var nf = Object.defineProperty;
var ao = (r) => {
  throw TypeError(r);
};
var rf = (r, e, t) => e in r ? nf(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
var ce = (r, e, t) => rf(r, typeof e != "symbol" ? e + "" : e, t), Ki = (r, e, t) => e.has(r) || ao("Cannot " + t);
var hr = (r, e, t) => (Ki(r, e, "read from private field"), t ? t.call(r) : e.get(r)), Yi = (r, e, t) => e.has(r) ? ao("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), io = (r, e, t, n) => (Ki(r, e, "write to private field"), n ? n.call(r, t) : e.set(r, t), t), Da = (r, e, t) => (Ki(r, e, "access private method"), t);
const {
  SvelteComponent: af,
  append_hydration: Ys,
  assign: sf,
  attr: Ft,
  binding_callbacks: lf,
  children: Xr,
  claim_element: R1,
  claim_space: O1,
  claim_svg_element: Xi,
  create_slot: of,
  detach: Pn,
  element: P1,
  empty: so,
  get_all_dirty_from_scope: uf,
  get_slot_changes: cf,
  get_spread_update: hf,
  init: ff,
  insert_hydration: ra,
  listen: df,
  noop: mf,
  safe_not_equal: pf,
  set_dynamic_element_data: lo,
  set_style: $e,
  space: H1,
  svg_element: Zi,
  toggle_class: wt,
  transition_in: U1,
  transition_out: G1,
  update_slot_base: gf
} = window.__gradio__svelte__internal;
function oo(r) {
  let e, t, n, a, i;
  return {
    c() {
      e = Zi("svg"), t = Zi("line"), n = Zi("line"), this.h();
    },
    l(s) {
      e = Xi(s, "svg", { class: !0, xmlns: !0, viewBox: !0 });
      var l = Xr(e);
      t = Xi(l, "line", {
        x1: !0,
        y1: !0,
        x2: !0,
        y2: !0,
        stroke: !0,
        "stroke-width": !0
      }), Xr(t).forEach(Pn), n = Xi(l, "line", {
        x1: !0,
        y1: !0,
        x2: !0,
        y2: !0,
        stroke: !0,
        "stroke-width": !0
      }), Xr(n).forEach(Pn), l.forEach(Pn), this.h();
    },
    h() {
      Ft(t, "x1", "1"), Ft(t, "y1", "9"), Ft(t, "x2", "9"), Ft(t, "y2", "1"), Ft(t, "stroke", "gray"), Ft(t, "stroke-width", "0.5"), Ft(n, "x1", "5"), Ft(n, "y1", "9"), Ft(n, "x2", "9"), Ft(n, "y2", "5"), Ft(n, "stroke", "gray"), Ft(n, "stroke-width", "0.5"), Ft(e, "class", "resize-handle svelte-239wnu"), Ft(e, "xmlns", "http://www.w3.org/2000/svg"), Ft(e, "viewBox", "0 0 10 10");
    },
    m(s, l) {
      ra(s, e, l), Ys(e, t), Ys(e, n), a || (i = df(
        e,
        "mousedown",
        /*resize*/
        r[27]
      ), a = !0);
    },
    p: mf,
    d(s) {
      s && Pn(e), a = !1, i();
    }
  };
}
function _f(r) {
  var m;
  let e, t, n, a, i;
  const s = (
    /*#slots*/
    r[31].default
  ), l = of(
    s,
    r,
    /*$$scope*/
    r[30],
    null
  );
  let o = (
    /*resizable*/
    r[19] && oo(r)
  ), u = [
    { "data-testid": (
      /*test_id*/
      r[11]
    ) },
    { id: (
      /*elem_id*/
      r[6]
    ) },
    {
      class: n = "block " + /*elem_classes*/
      (((m = r[7]) == null ? void 0 : m.join(" ")) || "") + " svelte-239wnu"
    },
    {
      dir: a = /*rtl*/
      r[20] ? "rtl" : "ltr"
    }
  ], h = {};
  for (let d = 0; d < u.length; d += 1)
    h = sf(h, u[d]);
  return {
    c() {
      e = P1(
        /*tag*/
        r[25]
      ), l && l.c(), t = H1(), o && o.c(), this.h();
    },
    l(d) {
      e = R1(
        d,
        /*tag*/
        (r[25] || "null").toUpperCase(),
        {
          "data-testid": !0,
          id: !0,
          class: !0,
          dir: !0
        }
      );
      var g = Xr(e);
      l && l.l(g), t = O1(g), o && o.l(g), g.forEach(Pn), this.h();
    },
    h() {
      lo(
        /*tag*/
        r[25]
      )(e, h), wt(
        e,
        "hidden",
        /*visible*/
        r[14] === !1
      ), wt(
        e,
        "padded",
        /*padding*/
        r[10]
      ), wt(
        e,
        "flex",
        /*flex*/
        r[1]
      ), wt(
        e,
        "border_focus",
        /*border_mode*/
        r[9] === "focus"
      ), wt(
        e,
        "border_contrast",
        /*border_mode*/
        r[9] === "contrast"
      ), wt(e, "hide-container", !/*explicit_call*/
      r[12] && !/*container*/
      r[13]), wt(
        e,
        "fullscreen",
        /*fullscreen*/
        r[0]
      ), wt(
        e,
        "animating",
        /*fullscreen*/
        r[0] && /*preexpansionBoundingRect*/
        r[24] !== null
      ), wt(
        e,
        "auto-margin",
        /*scale*/
        r[17] === null
      ), $e(
        e,
        "height",
        /*fullscreen*/
        r[0] ? void 0 : (
          /*get_dimension*/
          r[26](
            /*height*/
            r[2]
          )
        )
      ), $e(
        e,
        "min-height",
        /*fullscreen*/
        r[0] ? void 0 : (
          /*get_dimension*/
          r[26](
            /*min_height*/
            r[3]
          )
        )
      ), $e(
        e,
        "max-height",
        /*fullscreen*/
        r[0] ? void 0 : (
          /*get_dimension*/
          r[26](
            /*max_height*/
            r[4]
          )
        )
      ), $e(
        e,
        "--start-top",
        /*preexpansionBoundingRect*/
        r[24] ? `${/*preexpansionBoundingRect*/
        r[24].top}px` : "0px"
      ), $e(
        e,
        "--start-left",
        /*preexpansionBoundingRect*/
        r[24] ? `${/*preexpansionBoundingRect*/
        r[24].left}px` : "0px"
      ), $e(
        e,
        "--start-width",
        /*preexpansionBoundingRect*/
        r[24] ? `${/*preexpansionBoundingRect*/
        r[24].width}px` : "0px"
      ), $e(
        e,
        "--start-height",
        /*preexpansionBoundingRect*/
        r[24] ? `${/*preexpansionBoundingRect*/
        r[24].height}px` : "0px"
      ), $e(
        e,
        "width",
        /*fullscreen*/
        r[0] ? void 0 : typeof /*width*/
        r[5] == "number" ? `calc(min(${/*width*/
        r[5]}px, 100%))` : (
          /*get_dimension*/
          r[26](
            /*width*/
            r[5]
          )
        )
      ), $e(
        e,
        "border-style",
        /*variant*/
        r[8]
      ), $e(
        e,
        "overflow",
        /*allow_overflow*/
        r[15] ? (
          /*overflow_behavior*/
          r[16]
        ) : "hidden"
      ), $e(
        e,
        "flex-grow",
        /*scale*/
        r[17]
      ), $e(e, "min-width", `calc(min(${/*min_width*/
      r[18]}px, 100%))`), $e(e, "border-width", "var(--block-border-width)");
    },
    m(d, g) {
      ra(d, e, g), l && l.m(e, null), Ys(e, t), o && o.m(e, null), r[32](e), i = !0;
    },
    p(d, g) {
      var b;
      l && l.p && (!i || g[0] & /*$$scope*/
      1073741824) && gf(
        l,
        s,
        d,
        /*$$scope*/
        d[30],
        i ? cf(
          s,
          /*$$scope*/
          d[30],
          g,
          null
        ) : uf(
          /*$$scope*/
          d[30]
        ),
        null
      ), /*resizable*/
      d[19] ? o ? o.p(d, g) : (o = oo(d), o.c(), o.m(e, null)) : o && (o.d(1), o = null), lo(
        /*tag*/
        d[25]
      )(e, h = hf(u, [
        (!i || g[0] & /*test_id*/
        2048) && { "data-testid": (
          /*test_id*/
          d[11]
        ) },
        (!i || g[0] & /*elem_id*/
        64) && { id: (
          /*elem_id*/
          d[6]
        ) },
        (!i || g[0] & /*elem_classes*/
        128 && n !== (n = "block " + /*elem_classes*/
        (((b = d[7]) == null ? void 0 : b.join(" ")) || "") + " svelte-239wnu")) && { class: n },
        (!i || g[0] & /*rtl*/
        1048576 && a !== (a = /*rtl*/
        d[20] ? "rtl" : "ltr")) && { dir: a }
      ])), wt(
        e,
        "hidden",
        /*visible*/
        d[14] === !1
      ), wt(
        e,
        "padded",
        /*padding*/
        d[10]
      ), wt(
        e,
        "flex",
        /*flex*/
        d[1]
      ), wt(
        e,
        "border_focus",
        /*border_mode*/
        d[9] === "focus"
      ), wt(
        e,
        "border_contrast",
        /*border_mode*/
        d[9] === "contrast"
      ), wt(e, "hide-container", !/*explicit_call*/
      d[12] && !/*container*/
      d[13]), wt(
        e,
        "fullscreen",
        /*fullscreen*/
        d[0]
      ), wt(
        e,
        "animating",
        /*fullscreen*/
        d[0] && /*preexpansionBoundingRect*/
        d[24] !== null
      ), wt(
        e,
        "auto-margin",
        /*scale*/
        d[17] === null
      ), g[0] & /*fullscreen, height*/
      5 && $e(
        e,
        "height",
        /*fullscreen*/
        d[0] ? void 0 : (
          /*get_dimension*/
          d[26](
            /*height*/
            d[2]
          )
        )
      ), g[0] & /*fullscreen, min_height*/
      9 && $e(
        e,
        "min-height",
        /*fullscreen*/
        d[0] ? void 0 : (
          /*get_dimension*/
          d[26](
            /*min_height*/
            d[3]
          )
        )
      ), g[0] & /*fullscreen, max_height*/
      17 && $e(
        e,
        "max-height",
        /*fullscreen*/
        d[0] ? void 0 : (
          /*get_dimension*/
          d[26](
            /*max_height*/
            d[4]
          )
        )
      ), g[0] & /*preexpansionBoundingRect*/
      16777216 && $e(
        e,
        "--start-top",
        /*preexpansionBoundingRect*/
        d[24] ? `${/*preexpansionBoundingRect*/
        d[24].top}px` : "0px"
      ), g[0] & /*preexpansionBoundingRect*/
      16777216 && $e(
        e,
        "--start-left",
        /*preexpansionBoundingRect*/
        d[24] ? `${/*preexpansionBoundingRect*/
        d[24].left}px` : "0px"
      ), g[0] & /*preexpansionBoundingRect*/
      16777216 && $e(
        e,
        "--start-width",
        /*preexpansionBoundingRect*/
        d[24] ? `${/*preexpansionBoundingRect*/
        d[24].width}px` : "0px"
      ), g[0] & /*preexpansionBoundingRect*/
      16777216 && $e(
        e,
        "--start-height",
        /*preexpansionBoundingRect*/
        d[24] ? `${/*preexpansionBoundingRect*/
        d[24].height}px` : "0px"
      ), g[0] & /*fullscreen, width*/
      33 && $e(
        e,
        "width",
        /*fullscreen*/
        d[0] ? void 0 : typeof /*width*/
        d[5] == "number" ? `calc(min(${/*width*/
        d[5]}px, 100%))` : (
          /*get_dimension*/
          d[26](
            /*width*/
            d[5]
          )
        )
      ), g[0] & /*variant*/
      256 && $e(
        e,
        "border-style",
        /*variant*/
        d[8]
      ), g[0] & /*allow_overflow, overflow_behavior*/
      98304 && $e(
        e,
        "overflow",
        /*allow_overflow*/
        d[15] ? (
          /*overflow_behavior*/
          d[16]
        ) : "hidden"
      ), g[0] & /*scale*/
      131072 && $e(
        e,
        "flex-grow",
        /*scale*/
        d[17]
      ), g[0] & /*min_width*/
      262144 && $e(e, "min-width", `calc(min(${/*min_width*/
      d[18]}px, 100%))`);
    },
    i(d) {
      i || (U1(l, d), i = !0);
    },
    o(d) {
      G1(l, d), i = !1;
    },
    d(d) {
      d && Pn(e), l && l.d(d), o && o.d(), r[32](null);
    }
  };
}
function uo(r) {
  let e;
  return {
    c() {
      e = P1("div"), this.h();
    },
    l(t) {
      e = R1(t, "DIV", { class: !0 }), Xr(e).forEach(Pn), this.h();
    },
    h() {
      Ft(e, "class", "placeholder svelte-239wnu"), $e(
        e,
        "height",
        /*placeholder_height*/
        r[22] + "px"
      ), $e(
        e,
        "width",
        /*placeholder_width*/
        r[23] + "px"
      );
    },
    m(t, n) {
      ra(t, e, n);
    },
    p(t, n) {
      n[0] & /*placeholder_height*/
      4194304 && $e(
        e,
        "height",
        /*placeholder_height*/
        t[22] + "px"
      ), n[0] & /*placeholder_width*/
      8388608 && $e(
        e,
        "width",
        /*placeholder_width*/
        t[23] + "px"
      );
    },
    d(t) {
      t && Pn(e);
    }
  };
}
function vf(r) {
  let e, t, n, a = (
    /*tag*/
    r[25] && _f(r)
  ), i = (
    /*fullscreen*/
    r[0] && uo(r)
  );
  return {
    c() {
      a && a.c(), e = H1(), i && i.c(), t = so();
    },
    l(s) {
      a && a.l(s), e = O1(s), i && i.l(s), t = so();
    },
    m(s, l) {
      a && a.m(s, l), ra(s, e, l), i && i.m(s, l), ra(s, t, l), n = !0;
    },
    p(s, l) {
      /*tag*/
      s[25] && a.p(s, l), /*fullscreen*/
      s[0] ? i ? i.p(s, l) : (i = uo(s), i.c(), i.m(t.parentNode, t)) : i && (i.d(1), i = null);
    },
    i(s) {
      n || (U1(a, s), n = !0);
    },
    o(s) {
      G1(a, s), n = !1;
    },
    d(s) {
      s && (Pn(e), Pn(t)), a && a.d(s), i && i.d(s);
    }
  };
}
function bf(r, e, t) {
  let { $$slots: n = {}, $$scope: a } = e, { height: i = void 0 } = e, { min_height: s = void 0 } = e, { max_height: l = void 0 } = e, { width: o = void 0 } = e, { elem_id: u = "" } = e, { elem_classes: h = [] } = e, { variant: m = "solid" } = e, { border_mode: d = "base" } = e, { padding: g = !0 } = e, { type: b = "normal" } = e, { test_id: v = void 0 } = e, { explicit_call: w = !1 } = e, { container: x = !0 } = e, { visible: k = !0 } = e, { allow_overflow: y = !0 } = e, { overflow_behavior: A = "auto" } = e, { scale: $ = null } = e, { min_width: M = 0 } = e, { flex: z = !1 } = e, { resizable: O = !1 } = e, { rtl: L = !1 } = e, { fullscreen: K = !1 } = e, X = K, J, Se = b === "fieldset" ? "fieldset" : "div", _e = 0, ge = 0, Ae = null;
  function Oe(I) {
    K && I.key === "Escape" && t(0, K = !1);
  }
  const ke = (I) => {
    if (I !== void 0) {
      if (typeof I == "number")
        return I + "px";
      if (typeof I == "string")
        return I;
    }
  }, Be = (I) => {
    let be = I.clientY;
    const ye = (H) => {
      const nt = H.clientY - be;
      be = H.clientY, t(21, J.style.height = `${J.offsetHeight + nt}px`, J);
    }, Ie = () => {
      window.removeEventListener("mousemove", ye), window.removeEventListener("mouseup", Ie);
    };
    window.addEventListener("mousemove", ye), window.addEventListener("mouseup", Ie);
  };
  function Ee(I) {
    lf[I ? "unshift" : "push"](() => {
      J = I, t(21, J);
    });
  }
  return r.$$set = (I) => {
    "height" in I && t(2, i = I.height), "min_height" in I && t(3, s = I.min_height), "max_height" in I && t(4, l = I.max_height), "width" in I && t(5, o = I.width), "elem_id" in I && t(6, u = I.elem_id), "elem_classes" in I && t(7, h = I.elem_classes), "variant" in I && t(8, m = I.variant), "border_mode" in I && t(9, d = I.border_mode), "padding" in I && t(10, g = I.padding), "type" in I && t(28, b = I.type), "test_id" in I && t(11, v = I.test_id), "explicit_call" in I && t(12, w = I.explicit_call), "container" in I && t(13, x = I.container), "visible" in I && t(14, k = I.visible), "allow_overflow" in I && t(15, y = I.allow_overflow), "overflow_behavior" in I && t(16, A = I.overflow_behavior), "scale" in I && t(17, $ = I.scale), "min_width" in I && t(18, M = I.min_width), "flex" in I && t(1, z = I.flex), "resizable" in I && t(19, O = I.resizable), "rtl" in I && t(20, L = I.rtl), "fullscreen" in I && t(0, K = I.fullscreen), "$$scope" in I && t(30, a = I.$$scope);
  }, r.$$.update = () => {
    r.$$.dirty[0] & /*fullscreen, old_fullscreen, element*/
    538968065 && K !== X && (t(29, X = K), K ? (t(24, Ae = J.getBoundingClientRect()), t(22, _e = J.offsetHeight), t(23, ge = J.offsetWidth), window.addEventListener("keydown", Oe)) : (t(24, Ae = null), window.removeEventListener("keydown", Oe))), r.$$.dirty[0] & /*visible*/
    16384 && (k || t(1, z = !1));
  }, [
    K,
    z,
    i,
    s,
    l,
    o,
    u,
    h,
    m,
    d,
    g,
    v,
    w,
    x,
    k,
    y,
    A,
    $,
    M,
    O,
    L,
    J,
    _e,
    ge,
    Ae,
    Se,
    ke,
    Be,
    b,
    X,
    a,
    n,
    Ee
  ];
}
class yf extends af {
  constructor(e) {
    super(), ff(
      this,
      e,
      bf,
      vf,
      pf,
      {
        height: 2,
        min_height: 3,
        max_height: 4,
        width: 5,
        elem_id: 6,
        elem_classes: 7,
        variant: 8,
        border_mode: 9,
        padding: 10,
        type: 28,
        test_id: 11,
        explicit_call: 12,
        container: 13,
        visible: 14,
        allow_overflow: 15,
        overflow_behavior: 16,
        scale: 17,
        min_width: 18,
        flex: 1,
        resizable: 19,
        rtl: 20,
        fullscreen: 0
      },
      null,
      [-1, -1]
    );
  }
}
class rn {
  // The + prefix indicates that these fields aren't writeable
  // Lexer holding the input string.
  // Start offset, zero-based inclusive.
  // End offset, zero-based exclusive.
  constructor(e, t, n) {
    this.lexer = void 0, this.start = void 0, this.end = void 0, this.lexer = e, this.start = t, this.end = n;
  }
  /**
   * Merges two `SourceLocation`s from location providers, given they are
   * provided in order of appearance.
   * - Returns the first one's location if only the first is provided.
   * - Returns a merged range of the first and the last if both are provided
   *   and their lexers match.
   * - Otherwise, returns null.
   */
  static range(e, t) {
    return t ? !e || !e.loc || !t.loc || e.loc.lexer !== t.loc.lexer ? null : new rn(e.loc.lexer, e.loc.start, t.loc.end) : e && e.loc;
  }
}
class yn {
  // don't expand the token
  // used in \noexpand
  constructor(e, t) {
    this.text = void 0, this.loc = void 0, this.noexpand = void 0, this.treatAsRelax = void 0, this.text = e, this.loc = t;
  }
  /**
   * Given a pair of tokens (this and endToken), compute a `Token` encompassing
   * the whole input range enclosed by these two.
   */
  range(e, t) {
    return new yn(t, rn.range(this, e));
  }
}
class U {
  // Error start position based on passed-in Token or ParseNode.
  // Length of affected text based on passed-in Token or ParseNode.
  // The underlying error message without any context added.
  constructor(e, t) {
    this.name = void 0, this.position = void 0, this.length = void 0, this.rawMessage = void 0;
    var n = "KaTeX parse error: " + e, a, i, s = t && t.loc;
    if (s && s.start <= s.end) {
      var l = s.lexer.input;
      a = s.start, i = s.end, a === l.length ? n += " at end of input: " : n += " at position " + (a + 1) + ": ";
      var o = l.slice(a, i).replace(/[^]/g, "$&̲"), u;
      a > 15 ? u = "…" + l.slice(a - 15, a) : u = l.slice(0, a);
      var h;
      i + 15 < l.length ? h = l.slice(i, i + 15) + "…" : h = l.slice(i), n += u + o + h;
    }
    var m = new Error(n);
    return m.name = "ParseError", m.__proto__ = U.prototype, m.position = a, a != null && i != null && (m.length = i - a), m.rawMessage = e, m;
  }
}
U.prototype.__proto__ = Error.prototype;
var wf = function(e, t) {
  return e.indexOf(t) !== -1;
}, kf = function(e, t) {
  return e === void 0 ? t : e;
}, Sf = /([A-Z])/g, Df = function(e) {
  return e.replace(Sf, "-$1").toLowerCase();
}, xf = {
  "&": "&amp;",
  ">": "&gt;",
  "<": "&lt;",
  '"': "&quot;",
  "'": "&#x27;"
}, Af = /[&><"']/g;
function Ef(r) {
  return String(r).replace(Af, (e) => xf[e]);
}
var j1 = function r(e) {
  return e.type === "ordgroup" || e.type === "color" ? e.body.length === 1 ? r(e.body[0]) : e : e.type === "font" ? r(e.body) : e;
}, Cf = function(e) {
  var t = j1(e);
  return t.type === "mathord" || t.type === "textord" || t.type === "atom";
}, $f = function(e) {
  if (!e)
    throw new Error("Expected non-null, but got " + String(e));
  return e;
}, Tf = function(e) {
  var t = /^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(e);
  return t ? t[2] !== ":" || !/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1]) ? null : t[1].toLowerCase() : "_relative";
}, ae = {
  contains: wf,
  deflt: kf,
  escape: Ef,
  hyphenate: Df,
  getBaseElem: j1,
  isCharacterBox: Cf,
  protocolFromUrl: Tf
}, Zr = {
  displayMode: {
    type: "boolean",
    description: "Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",
    cli: "-d, --display-mode"
  },
  output: {
    type: {
      enum: ["htmlAndMathml", "html", "mathml"]
    },
    description: "Determines the markup language of the output.",
    cli: "-F, --format <type>"
  },
  leqno: {
    type: "boolean",
    description: "Render display math in leqno style (left-justified tags)."
  },
  fleqn: {
    type: "boolean",
    description: "Render display math flush left."
  },
  throwOnError: {
    type: "boolean",
    default: !0,
    cli: "-t, --no-throw-on-error",
    cliDescription: "Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."
  },
  errorColor: {
    type: "string",
    default: "#cc0000",
    cli: "-c, --error-color <color>",
    cliDescription: "A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",
    cliProcessor: (r) => "#" + r
  },
  macros: {
    type: "object",
    cli: "-m, --macro <def>",
    cliDescription: "Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",
    cliDefault: [],
    cliProcessor: (r, e) => (e.push(r), e)
  },
  minRuleThickness: {
    type: "number",
    description: "Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",
    processor: (r) => Math.max(0, r),
    cli: "--min-rule-thickness <size>",
    cliProcessor: parseFloat
  },
  colorIsTextColor: {
    type: "boolean",
    description: "Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",
    cli: "-b, --color-is-text-color"
  },
  strict: {
    type: [{
      enum: ["warn", "ignore", "error"]
    }, "boolean", "function"],
    description: "Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",
    cli: "-S, --strict",
    cliDefault: !1
  },
  trust: {
    type: ["boolean", "function"],
    description: "Trust the input, enabling all HTML features such as \\url.",
    cli: "-T, --trust"
  },
  maxSize: {
    type: "number",
    default: 1 / 0,
    description: "If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",
    processor: (r) => Math.max(0, r),
    cli: "-s, --max-size <n>",
    cliProcessor: parseInt
  },
  maxExpand: {
    type: "number",
    default: 1e3,
    description: "Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",
    processor: (r) => Math.max(0, r),
    cli: "-e, --max-expand <n>",
    cliProcessor: (r) => r === "Infinity" ? 1 / 0 : parseInt(r)
  },
  globalGroup: {
    type: "boolean",
    cli: !1
  }
};
function Ff(r) {
  if (r.default)
    return r.default;
  var e = r.type, t = Array.isArray(e) ? e[0] : e;
  if (typeof t != "string")
    return t.enum[0];
  switch (t) {
    case "boolean":
      return !1;
    case "string":
      return "";
    case "number":
      return 0;
    case "object":
      return {};
  }
}
class kl {
  constructor(e) {
    this.displayMode = void 0, this.output = void 0, this.leqno = void 0, this.fleqn = void 0, this.throwOnError = void 0, this.errorColor = void 0, this.macros = void 0, this.minRuleThickness = void 0, this.colorIsTextColor = void 0, this.strict = void 0, this.trust = void 0, this.maxSize = void 0, this.maxExpand = void 0, this.globalGroup = void 0, e = e || {};
    for (var t in Zr)
      if (Zr.hasOwnProperty(t)) {
        var n = Zr[t];
        this[t] = e[t] !== void 0 ? n.processor ? n.processor(e[t]) : e[t] : Ff(n);
      }
  }
  /**
   * Report nonstrict (non-LaTeX-compatible) input.
   * Can safely not be called if `this.strict` is false in JavaScript.
   */
  reportNonstrict(e, t, n) {
    var a = this.strict;
    if (typeof a == "function" && (a = a(e, t, n)), !(!a || a === "ignore")) {
      if (a === !0 || a === "error")
        throw new U("LaTeX-incompatible input and strict mode is set to 'error': " + (t + " [" + e + "]"), n);
      a === "warn" ? typeof console < "u" && console.warn("LaTeX-incompatible input and strict mode is set to 'warn': " + (t + " [" + e + "]")) : typeof console < "u" && console.warn("LaTeX-incompatible input and strict mode is set to " + ("unrecognized '" + a + "': " + t + " [" + e + "]"));
    }
  }
  /**
   * Check whether to apply strict (LaTeX-adhering) behavior for unusual
   * input (like `\\`).  Unlike `nonstrict`, will not throw an error;
   * instead, "error" translates to a return value of `true`, while "ignore"
   * translates to a return value of `false`.  May still print a warning:
   * "warn" prints a warning and returns `false`.
   * This is for the second category of `errorCode`s listed in the README.
   */
  useStrictBehavior(e, t, n) {
    var a = this.strict;
    if (typeof a == "function")
      try {
        a = a(e, t, n);
      } catch {
        a = "error";
      }
    return !a || a === "ignore" ? !1 : a === !0 || a === "error" ? !0 : a === "warn" ? (typeof console < "u" && console.warn("LaTeX-incompatible input and strict mode is set to 'warn': " + (t + " [" + e + "]")), !1) : (typeof console < "u" && console.warn("LaTeX-incompatible input and strict mode is set to " + ("unrecognized '" + a + "': " + t + " [" + e + "]")), !1);
  }
  /**
   * Check whether to test potentially dangerous input, and return
   * `true` (trusted) or `false` (untrusted).  The sole argument `context`
   * should be an object with `command` field specifying the relevant LaTeX
   * command (as a string starting with `\`), and any other arguments, etc.
   * If `context` has a `url` field, a `protocol` field will automatically
   * get added by this function (changing the specified object).
   */
  isTrusted(e) {
    if (e.url && !e.protocol) {
      var t = ae.protocolFromUrl(e.url);
      if (t == null)
        return !1;
      e.protocol = t;
    }
    var n = typeof this.trust == "function" ? this.trust(e) : this.trust;
    return !!n;
  }
}
class S0 {
  constructor(e, t, n) {
    this.id = void 0, this.size = void 0, this.cramped = void 0, this.id = e, this.size = t, this.cramped = n;
  }
  /**
   * Get the style of a superscript given a base in the current style.
   */
  sup() {
    return On[Mf[this.id]];
  }
  /**
   * Get the style of a subscript given a base in the current style.
   */
  sub() {
    return On[zf[this.id]];
  }
  /**
   * Get the style of a fraction numerator given the fraction in the current
   * style.
   */
  fracNum() {
    return On[Bf[this.id]];
  }
  /**
   * Get the style of a fraction denominator given the fraction in the current
   * style.
   */
  fracDen() {
    return On[Nf[this.id]];
  }
  /**
   * Get the cramped version of a style (in particular, cramping a cramped style
   * doesn't change the style).
   */
  cramp() {
    return On[qf[this.id]];
  }
  /**
   * Get a text or display version of this style.
   */
  text() {
    return On[Lf[this.id]];
  }
  /**
   * Return true if this style is tightly spaced (scriptstyle/scriptscriptstyle)
   */
  isTight() {
    return this.size >= 2;
  }
}
var Sl = 0, bi = 1, yr = 2, h0 = 3, aa = 4, gn = 5, Dr = 6, Ot = 7, On = [new S0(Sl, 0, !1), new S0(bi, 0, !0), new S0(yr, 1, !1), new S0(h0, 1, !0), new S0(aa, 2, !1), new S0(gn, 2, !0), new S0(Dr, 3, !1), new S0(Ot, 3, !0)], Mf = [aa, gn, aa, gn, Dr, Ot, Dr, Ot], zf = [gn, gn, gn, gn, Ot, Ot, Ot, Ot], Bf = [yr, h0, aa, gn, Dr, Ot, Dr, Ot], Nf = [h0, h0, gn, gn, Ot, Ot, Ot, Ot], qf = [bi, bi, h0, h0, gn, gn, Ot, Ot], Lf = [Sl, bi, yr, h0, yr, h0, yr, h0], le = {
  DISPLAY: On[Sl],
  TEXT: On[yr],
  SCRIPT: On[aa],
  SCRIPTSCRIPT: On[Dr]
}, Xs = [{
  // Latin characters beyond the Latin-1 characters we have metrics for.
  // Needed for Czech, Hungarian and Turkish text, for example.
  name: "latin",
  blocks: [
    [256, 591],
    // Latin Extended-A and Latin Extended-B
    [768, 879]
    // Combining Diacritical marks
  ]
}, {
  // The Cyrillic script used by Russian and related languages.
  // A Cyrillic subset used to be supported as explicitly defined
  // symbols in symbols.js
  name: "cyrillic",
  blocks: [[1024, 1279]]
}, {
  // Armenian
  name: "armenian",
  blocks: [[1328, 1423]]
}, {
  // The Brahmic scripts of South and Southeast Asia
  // Devanagari (0900–097F)
  // Bengali (0980–09FF)
  // Gurmukhi (0A00–0A7F)
  // Gujarati (0A80–0AFF)
  // Oriya (0B00–0B7F)
  // Tamil (0B80–0BFF)
  // Telugu (0C00–0C7F)
  // Kannada (0C80–0CFF)
  // Malayalam (0D00–0D7F)
  // Sinhala (0D80–0DFF)
  // Thai (0E00–0E7F)
  // Lao (0E80–0EFF)
  // Tibetan (0F00–0FFF)
  // Myanmar (1000–109F)
  name: "brahmic",
  blocks: [[2304, 4255]]
}, {
  name: "georgian",
  blocks: [[4256, 4351]]
}, {
  // Chinese and Japanese.
  // The "k" in cjk is for Korean, but we've separated Korean out
  name: "cjk",
  blocks: [
    [12288, 12543],
    // CJK symbols and punctuation, Hiragana, Katakana
    [19968, 40879],
    // CJK ideograms
    [65280, 65376]
    // Fullwidth punctuation
    // TODO: add halfwidth Katakana and Romanji glyphs
  ]
}, {
  // Korean
  name: "hangul",
  blocks: [[44032, 55215]]
}];
function If(r) {
  for (var e = 0; e < Xs.length; e++)
    for (var t = Xs[e], n = 0; n < t.blocks.length; n++) {
      var a = t.blocks[n];
      if (r >= a[0] && r <= a[1])
        return t.name;
    }
  return null;
}
var oi = [];
Xs.forEach((r) => r.blocks.forEach((e) => oi.push(...e)));
function V1(r) {
  for (var e = 0; e < oi.length; e += 2)
    if (r >= oi[e] && r <= oi[e + 1])
      return !0;
  return !1;
}
var fr = 80, Rf = function(e, t) {
  return "M95," + (622 + e + t) + `
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
c69,-144,104.5,-217.7,106.5,-221
l` + e / 2.075 + " -" + e + `
c5.3,-9.3,12,-14,20,-14
H400000v` + (40 + e) + `H845.2724
s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
M` + (834 + e) + " " + t + "h400000v" + (40 + e) + "h-400000z";
}, Of = function(e, t) {
  return "M263," + (601 + e + t) + `c0.7,0,18,39.7,52,119
c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
c340,-704.7,510.7,-1060.3,512,-1067
l` + e / 2.084 + " -" + e + `
c4.7,-7.3,11,-11,19,-11
H40000v` + (40 + e) + `H1012.3
s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
M` + (1001 + e) + " " + t + "h400000v" + (40 + e) + "h-400000z";
}, Pf = function(e, t) {
  return "M983 " + (10 + e + t) + `
l` + e / 3.13 + " -" + e + `
c4,-6.7,10,-10,18,-10 H400000v` + (40 + e) + `
H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7
s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744
c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
c53.7,-170.3,84.5,-266.8,92.5,-289.5z
M` + (1001 + e) + " " + t + "h400000v" + (40 + e) + "h-400000z";
}, Hf = function(e, t) {
  return "M424," + (2398 + e + t) + `
c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20
s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
l` + e / 4.223 + " -" + e + `c4,-6.7,10,-10,18,-10 H400000
v` + (40 + e) + `H1014.6
s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
c-2,6,-10,9,-24,9
c-8,0,-12,-0.7,-12,-2z M` + (1001 + e) + " " + t + `
h400000v` + (40 + e) + "h-400000z";
}, Uf = function(e, t) {
  return "M473," + (2713 + e + t) + `
c339.3,-1799.3,509.3,-2700,510,-2702 l` + e / 5.298 + " -" + e + `
c3.3,-7.3,9.3,-11,18,-11 H400000v` + (40 + e) + `H1017.7
s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200
c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26
s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
606zM` + (1001 + e) + " " + t + "h400000v" + (40 + e) + "H1017.7z";
}, Gf = function(e) {
  var t = e / 2;
  return "M400000 " + e + " H0 L" + t + " 0 l65 45 L145 " + (e - 80) + " H400000z";
}, jf = function(e, t, n) {
  var a = n - 54 - t - e;
  return "M702 " + (e + t) + "H400000" + (40 + e) + `
H742v` + a + `l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1
h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
219 661 l218 661zM702 ` + t + "H400000v" + (40 + e) + "H742z";
}, Vf = function(e, t, n) {
  t = 1e3 * t;
  var a = "";
  switch (e) {
    case "sqrtMain":
      a = Rf(t, fr);
      break;
    case "sqrtSize1":
      a = Of(t, fr);
      break;
    case "sqrtSize2":
      a = Pf(t, fr);
      break;
    case "sqrtSize3":
      a = Hf(t, fr);
      break;
    case "sqrtSize4":
      a = Uf(t, fr);
      break;
    case "sqrtTall":
      a = jf(t, fr, n);
  }
  return a;
}, Wf = function(e, t) {
  switch (e) {
    case "⎜":
      return "M291 0 H417 V" + t + " H291z M291 0 H417 V" + t + " H291z";
    case "∣":
      return "M145 0 H188 V" + t + " H145z M145 0 H188 V" + t + " H145z";
    case "∥":
      return "M145 0 H188 V" + t + " H145z M145 0 H188 V" + t + " H145z" + ("M367 0 H410 V" + t + " H367z M367 0 H410 V" + t + " H367z");
    case "⎟":
      return "M457 0 H583 V" + t + " H457z M457 0 H583 V" + t + " H457z";
    case "⎢":
      return "M319 0 H403 V" + t + " H319z M319 0 H403 V" + t + " H319z";
    case "⎥":
      return "M263 0 H347 V" + t + " H263z M263 0 H347 V" + t + " H263z";
    case "⎪":
      return "M384 0 H504 V" + t + " H384z M384 0 H504 V" + t + " H384z";
    case "⏐":
      return "M312 0 H355 V" + t + " H312z M312 0 H355 V" + t + " H312z";
    case "‖":
      return "M257 0 H300 V" + t + " H257z M257 0 H300 V" + t + " H257z" + ("M478 0 H521 V" + t + " H478z M478 0 H521 V" + t + " H478z");
    default:
      return "";
  }
}, co = {
  // The doubleleftarrow geometry is from glyph U+21D0 in the font KaTeX Main
  doubleleftarrow: `M262 157
l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
m8 0v40h399730v-40zm0 194v40h399730v-40z`,
  // doublerightarrow is from glyph U+21D2 in font KaTeX Main
  doublerightarrow: `M399738 392l
-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,
  // leftarrow is from glyph U+2190 in font KaTeX Main
  leftarrow: `M400000 241H110l3-3c68.7-52.7 113.7-120
 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
 l-3-3h399890zM100 241v40h399900v-40z`,
  // overbrace is from glyphs U+23A9/23A8/23A7 in font KaTeX_Size4-Regular
  leftbrace: `M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
 5-6 9-10 13-.7 1-7.3 1-20 1H6z`,
  leftbraceunder: `M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,
  // overgroup is from the MnSymbol package (public domain)
  leftgroup: `M400000 80
H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
 435 0h399565z`,
  leftgroupunder: `M400000 262
H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
 435 219h399565z`,
  // Harpoons are from glyph U+21BD in font KaTeX Main
  leftharpoon: `M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,
  leftharpoonplus: `M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
m0 0v40h400000v-40z`,
  leftharpoondown: `M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,
  leftharpoondownplus: `M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,
  // hook is from glyph U+21A9 in font KaTeX Main
  lefthook: `M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
 71.5 23h399859zM103 281v-40h399897v40z`,
  leftlinesegment: `M40 281 V428 H0 V94 H40 V241 H400000 v40z
M40 281 V428 H0 V94 H40 V241 H400000 v40z`,
  leftmapsto: `M40 281 V448H0V74H40V241H400000v40z
M40 281 V448H0V74H40V241H400000v40z`,
  // tofrom is from glyph U+21C4 in font KaTeX AMS Regular
  leftToFrom: `M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,
  longequal: `M0 50 h400000 v40H0z m0 194h40000v40H0z
M0 50 h400000 v40H0z m0 194h40000v40H0z`,
  midbrace: `M200428 334
c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,
  midbraceunder: `M199572 214
c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,
  oiintSize1: `M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,
  oiintSize2: `M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
c0 110 84 276 504 276s502.4-166 502.4-276z`,
  oiiintSize1: `M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,
  oiiintSize2: `M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,
  rightarrow: `M0 241v40h399891c-47.3 35.3-84 78-110 128
-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
 151.7 139 205zm0 0v40h399900v-40z`,
  rightbrace: `M400000 542l
-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,
  rightbraceunder: `M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,
  rightgroup: `M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
 3-1 3-3v-38c-76-158-257-219-435-219H0z`,
  rightgroupunder: `M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,
  rightharpoon: `M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
 69.2 92 94.5zm0 0v40h399900v-40z`,
  rightharpoonplus: `M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,
  rightharpoondown: `M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,
  rightharpoondownplus: `M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
m0-194v40h400000v-40zm0 0v40h400000v-40z`,
  righthook: `M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,
  rightlinesegment: `M399960 241 V94 h40 V428 h-40 V281 H0 v-40z
M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`,
  rightToFrom: `M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,
  // twoheadleftarrow is from glyph U+219E in font KaTeX AMS Regular
  twoheadleftarrow: `M0 167c68 40
 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,
  twoheadrightarrow: `M400000 167
c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,
  // tilde1 is a modified version of a glyph from the MnSymbol package
  tilde1: `M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
-68.267.847-113-73.952-191-73.952z`,
  // ditto tilde2, tilde3, & tilde4
  tilde2: `M344 55.266c-142 0-300.638 81.316-311.5 86.418
-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
 181.476 676 181.476c-149 0-189-126.21-332-126.21z`,
  tilde3: `M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
 -338 0-409-156.573-744-156.573z`,
  tilde4: `M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
 -175.236-744-175.236z`,
  // vec is from glyph U+20D7 in font KaTeX Main
  vec: `M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
c-16-25.333-24-45-24-59z`,
  // widehat1 is a modified version of a glyph from the MnSymbol package
  widehat1: `M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,
  // ditto widehat2, widehat3, & widehat4
  widehat2: `M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,
  widehat3: `M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,
  widehat4: `M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,
  // widecheck paths are all inverted versions of widehat
  widecheck1: `M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,
  widecheck2: `M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,
  widecheck3: `M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,
  widecheck4: `M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,
  // The next ten paths support reaction arrows from the mhchem package.
  // Arrows for \ce{<-->} are offset from xAxis by 0.22ex, per mhchem in LaTeX
  // baraboveleftarrow is mostly from glyph U+2190 in font KaTeX Main
  baraboveleftarrow: `M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,
  // rightarrowabovebar is mostly from glyph U+2192, KaTeX Main
  rightarrowabovebar: `M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,
  // The short left harpoon has 0.5em (i.e. 500 units) kern on the left end.
  // Ref from mhchem.sty: \rlap{\raisebox{-.22ex}{$\kern0.5em
  baraboveshortleftharpoon: `M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,
  rightharpoonaboveshortbar: `M0,241 l0,40c399126,0,399993,0,399993,0
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,
  shortbaraboveleftharpoon: `M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,
  shortrightharpoonabovebar: `M53,241l0,40c398570,0,399437,0,399437,0
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`
}, Kf = function(e, t) {
  switch (e) {
    case "lbrack":
      return "M403 1759 V84 H666 V0 H319 V1759 v" + t + ` v1759 h347 v-84
H403z M403 1759 V0 H319 V1759 v` + t + " v1759 h84z";
    case "rbrack":
      return "M347 1759 V0 H0 V84 H263 V1759 v" + t + ` v1759 H0 v84 H347z
M347 1759 V0 H263 V1759 v` + t + " v1759 h84z";
    case "vert":
      return "M145 15 v585 v" + t + ` v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v` + -t + ` v-585 c-2.667,-10,-9.667,-15,-21,-15
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v` + t + " v585 h43z";
    case "doublevert":
      return "M145 15 v585 v" + t + ` v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v` + -t + ` v-585 c-2.667,-10,-9.667,-15,-21,-15
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v` + t + ` v585 h43z
M367 15 v585 v` + t + ` v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v` + -t + ` v-585 c-2.667,-10,-9.667,-15,-21,-15
c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v` + t + " v585 h43z";
    case "lfloor":
      return "M319 602 V0 H403 V602 v" + t + ` v1715 h263 v84 H319z
MM319 602 V0 H403 V602 v` + t + " v1715 H319z";
    case "rfloor":
      return "M319 602 V0 H403 V602 v" + t + ` v1799 H0 v-84 H319z
MM319 602 V0 H403 V602 v` + t + " v1715 H319z";
    case "lceil":
      return "M403 1759 V84 H666 V0 H319 V1759 v" + t + ` v602 h84z
M403 1759 V0 H319 V1759 v` + t + " v602 h84z";
    case "rceil":
      return "M347 1759 V0 H0 V84 H263 V1759 v" + t + ` v602 h84z
M347 1759 V0 h-84 V1759 v` + t + " v602 h84z";
    case "lparen":
      return `M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1
c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,
-36,557 l0,` + (t + 84) + `c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,
949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9
c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,
-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189
l0,-` + (t + 92) + `c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,
-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;
    case "rparen":
      return `M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,
63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5
c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,` + (t + 9) + `
c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664
c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11
c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17
c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
l0,-` + (t + 144) + `c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;
    default:
      throw new Error("Unknown stretchy delimiter.");
  }
};
class ha {
  // HtmlDomNode
  // Never used; needed for satisfying interface.
  constructor(e) {
    this.children = void 0, this.classes = void 0, this.height = void 0, this.depth = void 0, this.maxFontSize = void 0, this.style = void 0, this.children = e, this.classes = [], this.height = 0, this.depth = 0, this.maxFontSize = 0, this.style = {};
  }
  hasClass(e) {
    return ae.contains(this.classes, e);
  }
  /** Convert the fragment into a node. */
  toNode() {
    for (var e = document.createDocumentFragment(), t = 0; t < this.children.length; t++)
      e.appendChild(this.children[t].toNode());
    return e;
  }
  /** Convert the fragment into HTML markup. */
  toMarkup() {
    for (var e = "", t = 0; t < this.children.length; t++)
      e += this.children[t].toMarkup();
    return e;
  }
  /**
   * Converts the math node into a string, similar to innerText. Applies to
   * MathDomNode's only.
   */
  toText() {
    var e = (t) => t.toText();
    return this.children.map(e).join("");
  }
}
var Hn = {
  "AMS-Regular": {
    32: [0, 0, 0, 0, 0.25],
    65: [0, 0.68889, 0, 0, 0.72222],
    66: [0, 0.68889, 0, 0, 0.66667],
    67: [0, 0.68889, 0, 0, 0.72222],
    68: [0, 0.68889, 0, 0, 0.72222],
    69: [0, 0.68889, 0, 0, 0.66667],
    70: [0, 0.68889, 0, 0, 0.61111],
    71: [0, 0.68889, 0, 0, 0.77778],
    72: [0, 0.68889, 0, 0, 0.77778],
    73: [0, 0.68889, 0, 0, 0.38889],
    74: [0.16667, 0.68889, 0, 0, 0.5],
    75: [0, 0.68889, 0, 0, 0.77778],
    76: [0, 0.68889, 0, 0, 0.66667],
    77: [0, 0.68889, 0, 0, 0.94445],
    78: [0, 0.68889, 0, 0, 0.72222],
    79: [0.16667, 0.68889, 0, 0, 0.77778],
    80: [0, 0.68889, 0, 0, 0.61111],
    81: [0.16667, 0.68889, 0, 0, 0.77778],
    82: [0, 0.68889, 0, 0, 0.72222],
    83: [0, 0.68889, 0, 0, 0.55556],
    84: [0, 0.68889, 0, 0, 0.66667],
    85: [0, 0.68889, 0, 0, 0.72222],
    86: [0, 0.68889, 0, 0, 0.72222],
    87: [0, 0.68889, 0, 0, 1],
    88: [0, 0.68889, 0, 0, 0.72222],
    89: [0, 0.68889, 0, 0, 0.72222],
    90: [0, 0.68889, 0, 0, 0.66667],
    107: [0, 0.68889, 0, 0, 0.55556],
    160: [0, 0, 0, 0, 0.25],
    165: [0, 0.675, 0.025, 0, 0.75],
    174: [0.15559, 0.69224, 0, 0, 0.94666],
    240: [0, 0.68889, 0, 0, 0.55556],
    295: [0, 0.68889, 0, 0, 0.54028],
    710: [0, 0.825, 0, 0, 2.33334],
    732: [0, 0.9, 0, 0, 2.33334],
    770: [0, 0.825, 0, 0, 2.33334],
    771: [0, 0.9, 0, 0, 2.33334],
    989: [0.08167, 0.58167, 0, 0, 0.77778],
    1008: [0, 0.43056, 0.04028, 0, 0.66667],
    8245: [0, 0.54986, 0, 0, 0.275],
    8463: [0, 0.68889, 0, 0, 0.54028],
    8487: [0, 0.68889, 0, 0, 0.72222],
    8498: [0, 0.68889, 0, 0, 0.55556],
    8502: [0, 0.68889, 0, 0, 0.66667],
    8503: [0, 0.68889, 0, 0, 0.44445],
    8504: [0, 0.68889, 0, 0, 0.66667],
    8513: [0, 0.68889, 0, 0, 0.63889],
    8592: [-0.03598, 0.46402, 0, 0, 0.5],
    8594: [-0.03598, 0.46402, 0, 0, 0.5],
    8602: [-0.13313, 0.36687, 0, 0, 1],
    8603: [-0.13313, 0.36687, 0, 0, 1],
    8606: [0.01354, 0.52239, 0, 0, 1],
    8608: [0.01354, 0.52239, 0, 0, 1],
    8610: [0.01354, 0.52239, 0, 0, 1.11111],
    8611: [0.01354, 0.52239, 0, 0, 1.11111],
    8619: [0, 0.54986, 0, 0, 1],
    8620: [0, 0.54986, 0, 0, 1],
    8621: [-0.13313, 0.37788, 0, 0, 1.38889],
    8622: [-0.13313, 0.36687, 0, 0, 1],
    8624: [0, 0.69224, 0, 0, 0.5],
    8625: [0, 0.69224, 0, 0, 0.5],
    8630: [0, 0.43056, 0, 0, 1],
    8631: [0, 0.43056, 0, 0, 1],
    8634: [0.08198, 0.58198, 0, 0, 0.77778],
    8635: [0.08198, 0.58198, 0, 0, 0.77778],
    8638: [0.19444, 0.69224, 0, 0, 0.41667],
    8639: [0.19444, 0.69224, 0, 0, 0.41667],
    8642: [0.19444, 0.69224, 0, 0, 0.41667],
    8643: [0.19444, 0.69224, 0, 0, 0.41667],
    8644: [0.1808, 0.675, 0, 0, 1],
    8646: [0.1808, 0.675, 0, 0, 1],
    8647: [0.1808, 0.675, 0, 0, 1],
    8648: [0.19444, 0.69224, 0, 0, 0.83334],
    8649: [0.1808, 0.675, 0, 0, 1],
    8650: [0.19444, 0.69224, 0, 0, 0.83334],
    8651: [0.01354, 0.52239, 0, 0, 1],
    8652: [0.01354, 0.52239, 0, 0, 1],
    8653: [-0.13313, 0.36687, 0, 0, 1],
    8654: [-0.13313, 0.36687, 0, 0, 1],
    8655: [-0.13313, 0.36687, 0, 0, 1],
    8666: [0.13667, 0.63667, 0, 0, 1],
    8667: [0.13667, 0.63667, 0, 0, 1],
    8669: [-0.13313, 0.37788, 0, 0, 1],
    8672: [-0.064, 0.437, 0, 0, 1.334],
    8674: [-0.064, 0.437, 0, 0, 1.334],
    8705: [0, 0.825, 0, 0, 0.5],
    8708: [0, 0.68889, 0, 0, 0.55556],
    8709: [0.08167, 0.58167, 0, 0, 0.77778],
    8717: [0, 0.43056, 0, 0, 0.42917],
    8722: [-0.03598, 0.46402, 0, 0, 0.5],
    8724: [0.08198, 0.69224, 0, 0, 0.77778],
    8726: [0.08167, 0.58167, 0, 0, 0.77778],
    8733: [0, 0.69224, 0, 0, 0.77778],
    8736: [0, 0.69224, 0, 0, 0.72222],
    8737: [0, 0.69224, 0, 0, 0.72222],
    8738: [0.03517, 0.52239, 0, 0, 0.72222],
    8739: [0.08167, 0.58167, 0, 0, 0.22222],
    8740: [0.25142, 0.74111, 0, 0, 0.27778],
    8741: [0.08167, 0.58167, 0, 0, 0.38889],
    8742: [0.25142, 0.74111, 0, 0, 0.5],
    8756: [0, 0.69224, 0, 0, 0.66667],
    8757: [0, 0.69224, 0, 0, 0.66667],
    8764: [-0.13313, 0.36687, 0, 0, 0.77778],
    8765: [-0.13313, 0.37788, 0, 0, 0.77778],
    8769: [-0.13313, 0.36687, 0, 0, 0.77778],
    8770: [-0.03625, 0.46375, 0, 0, 0.77778],
    8774: [0.30274, 0.79383, 0, 0, 0.77778],
    8776: [-0.01688, 0.48312, 0, 0, 0.77778],
    8778: [0.08167, 0.58167, 0, 0, 0.77778],
    8782: [0.06062, 0.54986, 0, 0, 0.77778],
    8783: [0.06062, 0.54986, 0, 0, 0.77778],
    8785: [0.08198, 0.58198, 0, 0, 0.77778],
    8786: [0.08198, 0.58198, 0, 0, 0.77778],
    8787: [0.08198, 0.58198, 0, 0, 0.77778],
    8790: [0, 0.69224, 0, 0, 0.77778],
    8791: [0.22958, 0.72958, 0, 0, 0.77778],
    8796: [0.08198, 0.91667, 0, 0, 0.77778],
    8806: [0.25583, 0.75583, 0, 0, 0.77778],
    8807: [0.25583, 0.75583, 0, 0, 0.77778],
    8808: [0.25142, 0.75726, 0, 0, 0.77778],
    8809: [0.25142, 0.75726, 0, 0, 0.77778],
    8812: [0.25583, 0.75583, 0, 0, 0.5],
    8814: [0.20576, 0.70576, 0, 0, 0.77778],
    8815: [0.20576, 0.70576, 0, 0, 0.77778],
    8816: [0.30274, 0.79383, 0, 0, 0.77778],
    8817: [0.30274, 0.79383, 0, 0, 0.77778],
    8818: [0.22958, 0.72958, 0, 0, 0.77778],
    8819: [0.22958, 0.72958, 0, 0, 0.77778],
    8822: [0.1808, 0.675, 0, 0, 0.77778],
    8823: [0.1808, 0.675, 0, 0, 0.77778],
    8828: [0.13667, 0.63667, 0, 0, 0.77778],
    8829: [0.13667, 0.63667, 0, 0, 0.77778],
    8830: [0.22958, 0.72958, 0, 0, 0.77778],
    8831: [0.22958, 0.72958, 0, 0, 0.77778],
    8832: [0.20576, 0.70576, 0, 0, 0.77778],
    8833: [0.20576, 0.70576, 0, 0, 0.77778],
    8840: [0.30274, 0.79383, 0, 0, 0.77778],
    8841: [0.30274, 0.79383, 0, 0, 0.77778],
    8842: [0.13597, 0.63597, 0, 0, 0.77778],
    8843: [0.13597, 0.63597, 0, 0, 0.77778],
    8847: [0.03517, 0.54986, 0, 0, 0.77778],
    8848: [0.03517, 0.54986, 0, 0, 0.77778],
    8858: [0.08198, 0.58198, 0, 0, 0.77778],
    8859: [0.08198, 0.58198, 0, 0, 0.77778],
    8861: [0.08198, 0.58198, 0, 0, 0.77778],
    8862: [0, 0.675, 0, 0, 0.77778],
    8863: [0, 0.675, 0, 0, 0.77778],
    8864: [0, 0.675, 0, 0, 0.77778],
    8865: [0, 0.675, 0, 0, 0.77778],
    8872: [0, 0.69224, 0, 0, 0.61111],
    8873: [0, 0.69224, 0, 0, 0.72222],
    8874: [0, 0.69224, 0, 0, 0.88889],
    8876: [0, 0.68889, 0, 0, 0.61111],
    8877: [0, 0.68889, 0, 0, 0.61111],
    8878: [0, 0.68889, 0, 0, 0.72222],
    8879: [0, 0.68889, 0, 0, 0.72222],
    8882: [0.03517, 0.54986, 0, 0, 0.77778],
    8883: [0.03517, 0.54986, 0, 0, 0.77778],
    8884: [0.13667, 0.63667, 0, 0, 0.77778],
    8885: [0.13667, 0.63667, 0, 0, 0.77778],
    8888: [0, 0.54986, 0, 0, 1.11111],
    8890: [0.19444, 0.43056, 0, 0, 0.55556],
    8891: [0.19444, 0.69224, 0, 0, 0.61111],
    8892: [0.19444, 0.69224, 0, 0, 0.61111],
    8901: [0, 0.54986, 0, 0, 0.27778],
    8903: [0.08167, 0.58167, 0, 0, 0.77778],
    8905: [0.08167, 0.58167, 0, 0, 0.77778],
    8906: [0.08167, 0.58167, 0, 0, 0.77778],
    8907: [0, 0.69224, 0, 0, 0.77778],
    8908: [0, 0.69224, 0, 0, 0.77778],
    8909: [-0.03598, 0.46402, 0, 0, 0.77778],
    8910: [0, 0.54986, 0, 0, 0.76042],
    8911: [0, 0.54986, 0, 0, 0.76042],
    8912: [0.03517, 0.54986, 0, 0, 0.77778],
    8913: [0.03517, 0.54986, 0, 0, 0.77778],
    8914: [0, 0.54986, 0, 0, 0.66667],
    8915: [0, 0.54986, 0, 0, 0.66667],
    8916: [0, 0.69224, 0, 0, 0.66667],
    8918: [0.0391, 0.5391, 0, 0, 0.77778],
    8919: [0.0391, 0.5391, 0, 0, 0.77778],
    8920: [0.03517, 0.54986, 0, 0, 1.33334],
    8921: [0.03517, 0.54986, 0, 0, 1.33334],
    8922: [0.38569, 0.88569, 0, 0, 0.77778],
    8923: [0.38569, 0.88569, 0, 0, 0.77778],
    8926: [0.13667, 0.63667, 0, 0, 0.77778],
    8927: [0.13667, 0.63667, 0, 0, 0.77778],
    8928: [0.30274, 0.79383, 0, 0, 0.77778],
    8929: [0.30274, 0.79383, 0, 0, 0.77778],
    8934: [0.23222, 0.74111, 0, 0, 0.77778],
    8935: [0.23222, 0.74111, 0, 0, 0.77778],
    8936: [0.23222, 0.74111, 0, 0, 0.77778],
    8937: [0.23222, 0.74111, 0, 0, 0.77778],
    8938: [0.20576, 0.70576, 0, 0, 0.77778],
    8939: [0.20576, 0.70576, 0, 0, 0.77778],
    8940: [0.30274, 0.79383, 0, 0, 0.77778],
    8941: [0.30274, 0.79383, 0, 0, 0.77778],
    8994: [0.19444, 0.69224, 0, 0, 0.77778],
    8995: [0.19444, 0.69224, 0, 0, 0.77778],
    9416: [0.15559, 0.69224, 0, 0, 0.90222],
    9484: [0, 0.69224, 0, 0, 0.5],
    9488: [0, 0.69224, 0, 0, 0.5],
    9492: [0, 0.37788, 0, 0, 0.5],
    9496: [0, 0.37788, 0, 0, 0.5],
    9585: [0.19444, 0.68889, 0, 0, 0.88889],
    9586: [0.19444, 0.74111, 0, 0, 0.88889],
    9632: [0, 0.675, 0, 0, 0.77778],
    9633: [0, 0.675, 0, 0, 0.77778],
    9650: [0, 0.54986, 0, 0, 0.72222],
    9651: [0, 0.54986, 0, 0, 0.72222],
    9654: [0.03517, 0.54986, 0, 0, 0.77778],
    9660: [0, 0.54986, 0, 0, 0.72222],
    9661: [0, 0.54986, 0, 0, 0.72222],
    9664: [0.03517, 0.54986, 0, 0, 0.77778],
    9674: [0.11111, 0.69224, 0, 0, 0.66667],
    9733: [0.19444, 0.69224, 0, 0, 0.94445],
    10003: [0, 0.69224, 0, 0, 0.83334],
    10016: [0, 0.69224, 0, 0, 0.83334],
    10731: [0.11111, 0.69224, 0, 0, 0.66667],
    10846: [0.19444, 0.75583, 0, 0, 0.61111],
    10877: [0.13667, 0.63667, 0, 0, 0.77778],
    10878: [0.13667, 0.63667, 0, 0, 0.77778],
    10885: [0.25583, 0.75583, 0, 0, 0.77778],
    10886: [0.25583, 0.75583, 0, 0, 0.77778],
    10887: [0.13597, 0.63597, 0, 0, 0.77778],
    10888: [0.13597, 0.63597, 0, 0, 0.77778],
    10889: [0.26167, 0.75726, 0, 0, 0.77778],
    10890: [0.26167, 0.75726, 0, 0, 0.77778],
    10891: [0.48256, 0.98256, 0, 0, 0.77778],
    10892: [0.48256, 0.98256, 0, 0, 0.77778],
    10901: [0.13667, 0.63667, 0, 0, 0.77778],
    10902: [0.13667, 0.63667, 0, 0, 0.77778],
    10933: [0.25142, 0.75726, 0, 0, 0.77778],
    10934: [0.25142, 0.75726, 0, 0, 0.77778],
    10935: [0.26167, 0.75726, 0, 0, 0.77778],
    10936: [0.26167, 0.75726, 0, 0, 0.77778],
    10937: [0.26167, 0.75726, 0, 0, 0.77778],
    10938: [0.26167, 0.75726, 0, 0, 0.77778],
    10949: [0.25583, 0.75583, 0, 0, 0.77778],
    10950: [0.25583, 0.75583, 0, 0, 0.77778],
    10955: [0.28481, 0.79383, 0, 0, 0.77778],
    10956: [0.28481, 0.79383, 0, 0, 0.77778],
    57350: [0.08167, 0.58167, 0, 0, 0.22222],
    57351: [0.08167, 0.58167, 0, 0, 0.38889],
    57352: [0.08167, 0.58167, 0, 0, 0.77778],
    57353: [0, 0.43056, 0.04028, 0, 0.66667],
    57356: [0.25142, 0.75726, 0, 0, 0.77778],
    57357: [0.25142, 0.75726, 0, 0, 0.77778],
    57358: [0.41951, 0.91951, 0, 0, 0.77778],
    57359: [0.30274, 0.79383, 0, 0, 0.77778],
    57360: [0.30274, 0.79383, 0, 0, 0.77778],
    57361: [0.41951, 0.91951, 0, 0, 0.77778],
    57366: [0.25142, 0.75726, 0, 0, 0.77778],
    57367: [0.25142, 0.75726, 0, 0, 0.77778],
    57368: [0.25142, 0.75726, 0, 0, 0.77778],
    57369: [0.25142, 0.75726, 0, 0, 0.77778],
    57370: [0.13597, 0.63597, 0, 0, 0.77778],
    57371: [0.13597, 0.63597, 0, 0, 0.77778]
  },
  "Caligraphic-Regular": {
    32: [0, 0, 0, 0, 0.25],
    65: [0, 0.68333, 0, 0.19445, 0.79847],
    66: [0, 0.68333, 0.03041, 0.13889, 0.65681],
    67: [0, 0.68333, 0.05834, 0.13889, 0.52653],
    68: [0, 0.68333, 0.02778, 0.08334, 0.77139],
    69: [0, 0.68333, 0.08944, 0.11111, 0.52778],
    70: [0, 0.68333, 0.09931, 0.11111, 0.71875],
    71: [0.09722, 0.68333, 0.0593, 0.11111, 0.59487],
    72: [0, 0.68333, 965e-5, 0.11111, 0.84452],
    73: [0, 0.68333, 0.07382, 0, 0.54452],
    74: [0.09722, 0.68333, 0.18472, 0.16667, 0.67778],
    75: [0, 0.68333, 0.01445, 0.05556, 0.76195],
    76: [0, 0.68333, 0, 0.13889, 0.68972],
    77: [0, 0.68333, 0, 0.13889, 1.2009],
    78: [0, 0.68333, 0.14736, 0.08334, 0.82049],
    79: [0, 0.68333, 0.02778, 0.11111, 0.79611],
    80: [0, 0.68333, 0.08222, 0.08334, 0.69556],
    81: [0.09722, 0.68333, 0, 0.11111, 0.81667],
    82: [0, 0.68333, 0, 0.08334, 0.8475],
    83: [0, 0.68333, 0.075, 0.13889, 0.60556],
    84: [0, 0.68333, 0.25417, 0, 0.54464],
    85: [0, 0.68333, 0.09931, 0.08334, 0.62583],
    86: [0, 0.68333, 0.08222, 0, 0.61278],
    87: [0, 0.68333, 0.08222, 0.08334, 0.98778],
    88: [0, 0.68333, 0.14643, 0.13889, 0.7133],
    89: [0.09722, 0.68333, 0.08222, 0.08334, 0.66834],
    90: [0, 0.68333, 0.07944, 0.13889, 0.72473],
    160: [0, 0, 0, 0, 0.25]
  },
  "Fraktur-Regular": {
    32: [0, 0, 0, 0, 0.25],
    33: [0, 0.69141, 0, 0, 0.29574],
    34: [0, 0.69141, 0, 0, 0.21471],
    38: [0, 0.69141, 0, 0, 0.73786],
    39: [0, 0.69141, 0, 0, 0.21201],
    40: [0.24982, 0.74947, 0, 0, 0.38865],
    41: [0.24982, 0.74947, 0, 0, 0.38865],
    42: [0, 0.62119, 0, 0, 0.27764],
    43: [0.08319, 0.58283, 0, 0, 0.75623],
    44: [0, 0.10803, 0, 0, 0.27764],
    45: [0.08319, 0.58283, 0, 0, 0.75623],
    46: [0, 0.10803, 0, 0, 0.27764],
    47: [0.24982, 0.74947, 0, 0, 0.50181],
    48: [0, 0.47534, 0, 0, 0.50181],
    49: [0, 0.47534, 0, 0, 0.50181],
    50: [0, 0.47534, 0, 0, 0.50181],
    51: [0.18906, 0.47534, 0, 0, 0.50181],
    52: [0.18906, 0.47534, 0, 0, 0.50181],
    53: [0.18906, 0.47534, 0, 0, 0.50181],
    54: [0, 0.69141, 0, 0, 0.50181],
    55: [0.18906, 0.47534, 0, 0, 0.50181],
    56: [0, 0.69141, 0, 0, 0.50181],
    57: [0.18906, 0.47534, 0, 0, 0.50181],
    58: [0, 0.47534, 0, 0, 0.21606],
    59: [0.12604, 0.47534, 0, 0, 0.21606],
    61: [-0.13099, 0.36866, 0, 0, 0.75623],
    63: [0, 0.69141, 0, 0, 0.36245],
    65: [0, 0.69141, 0, 0, 0.7176],
    66: [0, 0.69141, 0, 0, 0.88397],
    67: [0, 0.69141, 0, 0, 0.61254],
    68: [0, 0.69141, 0, 0, 0.83158],
    69: [0, 0.69141, 0, 0, 0.66278],
    70: [0.12604, 0.69141, 0, 0, 0.61119],
    71: [0, 0.69141, 0, 0, 0.78539],
    72: [0.06302, 0.69141, 0, 0, 0.7203],
    73: [0, 0.69141, 0, 0, 0.55448],
    74: [0.12604, 0.69141, 0, 0, 0.55231],
    75: [0, 0.69141, 0, 0, 0.66845],
    76: [0, 0.69141, 0, 0, 0.66602],
    77: [0, 0.69141, 0, 0, 1.04953],
    78: [0, 0.69141, 0, 0, 0.83212],
    79: [0, 0.69141, 0, 0, 0.82699],
    80: [0.18906, 0.69141, 0, 0, 0.82753],
    81: [0.03781, 0.69141, 0, 0, 0.82699],
    82: [0, 0.69141, 0, 0, 0.82807],
    83: [0, 0.69141, 0, 0, 0.82861],
    84: [0, 0.69141, 0, 0, 0.66899],
    85: [0, 0.69141, 0, 0, 0.64576],
    86: [0, 0.69141, 0, 0, 0.83131],
    87: [0, 0.69141, 0, 0, 1.04602],
    88: [0, 0.69141, 0, 0, 0.71922],
    89: [0.18906, 0.69141, 0, 0, 0.83293],
    90: [0.12604, 0.69141, 0, 0, 0.60201],
    91: [0.24982, 0.74947, 0, 0, 0.27764],
    93: [0.24982, 0.74947, 0, 0, 0.27764],
    94: [0, 0.69141, 0, 0, 0.49965],
    97: [0, 0.47534, 0, 0, 0.50046],
    98: [0, 0.69141, 0, 0, 0.51315],
    99: [0, 0.47534, 0, 0, 0.38946],
    100: [0, 0.62119, 0, 0, 0.49857],
    101: [0, 0.47534, 0, 0, 0.40053],
    102: [0.18906, 0.69141, 0, 0, 0.32626],
    103: [0.18906, 0.47534, 0, 0, 0.5037],
    104: [0.18906, 0.69141, 0, 0, 0.52126],
    105: [0, 0.69141, 0, 0, 0.27899],
    106: [0, 0.69141, 0, 0, 0.28088],
    107: [0, 0.69141, 0, 0, 0.38946],
    108: [0, 0.69141, 0, 0, 0.27953],
    109: [0, 0.47534, 0, 0, 0.76676],
    110: [0, 0.47534, 0, 0, 0.52666],
    111: [0, 0.47534, 0, 0, 0.48885],
    112: [0.18906, 0.52396, 0, 0, 0.50046],
    113: [0.18906, 0.47534, 0, 0, 0.48912],
    114: [0, 0.47534, 0, 0, 0.38919],
    115: [0, 0.47534, 0, 0, 0.44266],
    116: [0, 0.62119, 0, 0, 0.33301],
    117: [0, 0.47534, 0, 0, 0.5172],
    118: [0, 0.52396, 0, 0, 0.5118],
    119: [0, 0.52396, 0, 0, 0.77351],
    120: [0.18906, 0.47534, 0, 0, 0.38865],
    121: [0.18906, 0.47534, 0, 0, 0.49884],
    122: [0.18906, 0.47534, 0, 0, 0.39054],
    160: [0, 0, 0, 0, 0.25],
    8216: [0, 0.69141, 0, 0, 0.21471],
    8217: [0, 0.69141, 0, 0, 0.21471],
    58112: [0, 0.62119, 0, 0, 0.49749],
    58113: [0, 0.62119, 0, 0, 0.4983],
    58114: [0.18906, 0.69141, 0, 0, 0.33328],
    58115: [0.18906, 0.69141, 0, 0, 0.32923],
    58116: [0.18906, 0.47534, 0, 0, 0.50343],
    58117: [0, 0.69141, 0, 0, 0.33301],
    58118: [0, 0.62119, 0, 0, 0.33409],
    58119: [0, 0.47534, 0, 0, 0.50073]
  },
  "Main-Bold": {
    32: [0, 0, 0, 0, 0.25],
    33: [0, 0.69444, 0, 0, 0.35],
    34: [0, 0.69444, 0, 0, 0.60278],
    35: [0.19444, 0.69444, 0, 0, 0.95833],
    36: [0.05556, 0.75, 0, 0, 0.575],
    37: [0.05556, 0.75, 0, 0, 0.95833],
    38: [0, 0.69444, 0, 0, 0.89444],
    39: [0, 0.69444, 0, 0, 0.31944],
    40: [0.25, 0.75, 0, 0, 0.44722],
    41: [0.25, 0.75, 0, 0, 0.44722],
    42: [0, 0.75, 0, 0, 0.575],
    43: [0.13333, 0.63333, 0, 0, 0.89444],
    44: [0.19444, 0.15556, 0, 0, 0.31944],
    45: [0, 0.44444, 0, 0, 0.38333],
    46: [0, 0.15556, 0, 0, 0.31944],
    47: [0.25, 0.75, 0, 0, 0.575],
    48: [0, 0.64444, 0, 0, 0.575],
    49: [0, 0.64444, 0, 0, 0.575],
    50: [0, 0.64444, 0, 0, 0.575],
    51: [0, 0.64444, 0, 0, 0.575],
    52: [0, 0.64444, 0, 0, 0.575],
    53: [0, 0.64444, 0, 0, 0.575],
    54: [0, 0.64444, 0, 0, 0.575],
    55: [0, 0.64444, 0, 0, 0.575],
    56: [0, 0.64444, 0, 0, 0.575],
    57: [0, 0.64444, 0, 0, 0.575],
    58: [0, 0.44444, 0, 0, 0.31944],
    59: [0.19444, 0.44444, 0, 0, 0.31944],
    60: [0.08556, 0.58556, 0, 0, 0.89444],
    61: [-0.10889, 0.39111, 0, 0, 0.89444],
    62: [0.08556, 0.58556, 0, 0, 0.89444],
    63: [0, 0.69444, 0, 0, 0.54305],
    64: [0, 0.69444, 0, 0, 0.89444],
    65: [0, 0.68611, 0, 0, 0.86944],
    66: [0, 0.68611, 0, 0, 0.81805],
    67: [0, 0.68611, 0, 0, 0.83055],
    68: [0, 0.68611, 0, 0, 0.88194],
    69: [0, 0.68611, 0, 0, 0.75555],
    70: [0, 0.68611, 0, 0, 0.72361],
    71: [0, 0.68611, 0, 0, 0.90416],
    72: [0, 0.68611, 0, 0, 0.9],
    73: [0, 0.68611, 0, 0, 0.43611],
    74: [0, 0.68611, 0, 0, 0.59444],
    75: [0, 0.68611, 0, 0, 0.90138],
    76: [0, 0.68611, 0, 0, 0.69166],
    77: [0, 0.68611, 0, 0, 1.09166],
    78: [0, 0.68611, 0, 0, 0.9],
    79: [0, 0.68611, 0, 0, 0.86388],
    80: [0, 0.68611, 0, 0, 0.78611],
    81: [0.19444, 0.68611, 0, 0, 0.86388],
    82: [0, 0.68611, 0, 0, 0.8625],
    83: [0, 0.68611, 0, 0, 0.63889],
    84: [0, 0.68611, 0, 0, 0.8],
    85: [0, 0.68611, 0, 0, 0.88472],
    86: [0, 0.68611, 0.01597, 0, 0.86944],
    87: [0, 0.68611, 0.01597, 0, 1.18888],
    88: [0, 0.68611, 0, 0, 0.86944],
    89: [0, 0.68611, 0.02875, 0, 0.86944],
    90: [0, 0.68611, 0, 0, 0.70277],
    91: [0.25, 0.75, 0, 0, 0.31944],
    92: [0.25, 0.75, 0, 0, 0.575],
    93: [0.25, 0.75, 0, 0, 0.31944],
    94: [0, 0.69444, 0, 0, 0.575],
    95: [0.31, 0.13444, 0.03194, 0, 0.575],
    97: [0, 0.44444, 0, 0, 0.55902],
    98: [0, 0.69444, 0, 0, 0.63889],
    99: [0, 0.44444, 0, 0, 0.51111],
    100: [0, 0.69444, 0, 0, 0.63889],
    101: [0, 0.44444, 0, 0, 0.52708],
    102: [0, 0.69444, 0.10903, 0, 0.35139],
    103: [0.19444, 0.44444, 0.01597, 0, 0.575],
    104: [0, 0.69444, 0, 0, 0.63889],
    105: [0, 0.69444, 0, 0, 0.31944],
    106: [0.19444, 0.69444, 0, 0, 0.35139],
    107: [0, 0.69444, 0, 0, 0.60694],
    108: [0, 0.69444, 0, 0, 0.31944],
    109: [0, 0.44444, 0, 0, 0.95833],
    110: [0, 0.44444, 0, 0, 0.63889],
    111: [0, 0.44444, 0, 0, 0.575],
    112: [0.19444, 0.44444, 0, 0, 0.63889],
    113: [0.19444, 0.44444, 0, 0, 0.60694],
    114: [0, 0.44444, 0, 0, 0.47361],
    115: [0, 0.44444, 0, 0, 0.45361],
    116: [0, 0.63492, 0, 0, 0.44722],
    117: [0, 0.44444, 0, 0, 0.63889],
    118: [0, 0.44444, 0.01597, 0, 0.60694],
    119: [0, 0.44444, 0.01597, 0, 0.83055],
    120: [0, 0.44444, 0, 0, 0.60694],
    121: [0.19444, 0.44444, 0.01597, 0, 0.60694],
    122: [0, 0.44444, 0, 0, 0.51111],
    123: [0.25, 0.75, 0, 0, 0.575],
    124: [0.25, 0.75, 0, 0, 0.31944],
    125: [0.25, 0.75, 0, 0, 0.575],
    126: [0.35, 0.34444, 0, 0, 0.575],
    160: [0, 0, 0, 0, 0.25],
    163: [0, 0.69444, 0, 0, 0.86853],
    168: [0, 0.69444, 0, 0, 0.575],
    172: [0, 0.44444, 0, 0, 0.76666],
    176: [0, 0.69444, 0, 0, 0.86944],
    177: [0.13333, 0.63333, 0, 0, 0.89444],
    184: [0.17014, 0, 0, 0, 0.51111],
    198: [0, 0.68611, 0, 0, 1.04166],
    215: [0.13333, 0.63333, 0, 0, 0.89444],
    216: [0.04861, 0.73472, 0, 0, 0.89444],
    223: [0, 0.69444, 0, 0, 0.59722],
    230: [0, 0.44444, 0, 0, 0.83055],
    247: [0.13333, 0.63333, 0, 0, 0.89444],
    248: [0.09722, 0.54167, 0, 0, 0.575],
    305: [0, 0.44444, 0, 0, 0.31944],
    338: [0, 0.68611, 0, 0, 1.16944],
    339: [0, 0.44444, 0, 0, 0.89444],
    567: [0.19444, 0.44444, 0, 0, 0.35139],
    710: [0, 0.69444, 0, 0, 0.575],
    711: [0, 0.63194, 0, 0, 0.575],
    713: [0, 0.59611, 0, 0, 0.575],
    714: [0, 0.69444, 0, 0, 0.575],
    715: [0, 0.69444, 0, 0, 0.575],
    728: [0, 0.69444, 0, 0, 0.575],
    729: [0, 0.69444, 0, 0, 0.31944],
    730: [0, 0.69444, 0, 0, 0.86944],
    732: [0, 0.69444, 0, 0, 0.575],
    733: [0, 0.69444, 0, 0, 0.575],
    915: [0, 0.68611, 0, 0, 0.69166],
    916: [0, 0.68611, 0, 0, 0.95833],
    920: [0, 0.68611, 0, 0, 0.89444],
    923: [0, 0.68611, 0, 0, 0.80555],
    926: [0, 0.68611, 0, 0, 0.76666],
    928: [0, 0.68611, 0, 0, 0.9],
    931: [0, 0.68611, 0, 0, 0.83055],
    933: [0, 0.68611, 0, 0, 0.89444],
    934: [0, 0.68611, 0, 0, 0.83055],
    936: [0, 0.68611, 0, 0, 0.89444],
    937: [0, 0.68611, 0, 0, 0.83055],
    8211: [0, 0.44444, 0.03194, 0, 0.575],
    8212: [0, 0.44444, 0.03194, 0, 1.14999],
    8216: [0, 0.69444, 0, 0, 0.31944],
    8217: [0, 0.69444, 0, 0, 0.31944],
    8220: [0, 0.69444, 0, 0, 0.60278],
    8221: [0, 0.69444, 0, 0, 0.60278],
    8224: [0.19444, 0.69444, 0, 0, 0.51111],
    8225: [0.19444, 0.69444, 0, 0, 0.51111],
    8242: [0, 0.55556, 0, 0, 0.34444],
    8407: [0, 0.72444, 0.15486, 0, 0.575],
    8463: [0, 0.69444, 0, 0, 0.66759],
    8465: [0, 0.69444, 0, 0, 0.83055],
    8467: [0, 0.69444, 0, 0, 0.47361],
    8472: [0.19444, 0.44444, 0, 0, 0.74027],
    8476: [0, 0.69444, 0, 0, 0.83055],
    8501: [0, 0.69444, 0, 0, 0.70277],
    8592: [-0.10889, 0.39111, 0, 0, 1.14999],
    8593: [0.19444, 0.69444, 0, 0, 0.575],
    8594: [-0.10889, 0.39111, 0, 0, 1.14999],
    8595: [0.19444, 0.69444, 0, 0, 0.575],
    8596: [-0.10889, 0.39111, 0, 0, 1.14999],
    8597: [0.25, 0.75, 0, 0, 0.575],
    8598: [0.19444, 0.69444, 0, 0, 1.14999],
    8599: [0.19444, 0.69444, 0, 0, 1.14999],
    8600: [0.19444, 0.69444, 0, 0, 1.14999],
    8601: [0.19444, 0.69444, 0, 0, 1.14999],
    8636: [-0.10889, 0.39111, 0, 0, 1.14999],
    8637: [-0.10889, 0.39111, 0, 0, 1.14999],
    8640: [-0.10889, 0.39111, 0, 0, 1.14999],
    8641: [-0.10889, 0.39111, 0, 0, 1.14999],
    8656: [-0.10889, 0.39111, 0, 0, 1.14999],
    8657: [0.19444, 0.69444, 0, 0, 0.70277],
    8658: [-0.10889, 0.39111, 0, 0, 1.14999],
    8659: [0.19444, 0.69444, 0, 0, 0.70277],
    8660: [-0.10889, 0.39111, 0, 0, 1.14999],
    8661: [0.25, 0.75, 0, 0, 0.70277],
    8704: [0, 0.69444, 0, 0, 0.63889],
    8706: [0, 0.69444, 0.06389, 0, 0.62847],
    8707: [0, 0.69444, 0, 0, 0.63889],
    8709: [0.05556, 0.75, 0, 0, 0.575],
    8711: [0, 0.68611, 0, 0, 0.95833],
    8712: [0.08556, 0.58556, 0, 0, 0.76666],
    8715: [0.08556, 0.58556, 0, 0, 0.76666],
    8722: [0.13333, 0.63333, 0, 0, 0.89444],
    8723: [0.13333, 0.63333, 0, 0, 0.89444],
    8725: [0.25, 0.75, 0, 0, 0.575],
    8726: [0.25, 0.75, 0, 0, 0.575],
    8727: [-0.02778, 0.47222, 0, 0, 0.575],
    8728: [-0.02639, 0.47361, 0, 0, 0.575],
    8729: [-0.02639, 0.47361, 0, 0, 0.575],
    8730: [0.18, 0.82, 0, 0, 0.95833],
    8733: [0, 0.44444, 0, 0, 0.89444],
    8734: [0, 0.44444, 0, 0, 1.14999],
    8736: [0, 0.69224, 0, 0, 0.72222],
    8739: [0.25, 0.75, 0, 0, 0.31944],
    8741: [0.25, 0.75, 0, 0, 0.575],
    8743: [0, 0.55556, 0, 0, 0.76666],
    8744: [0, 0.55556, 0, 0, 0.76666],
    8745: [0, 0.55556, 0, 0, 0.76666],
    8746: [0, 0.55556, 0, 0, 0.76666],
    8747: [0.19444, 0.69444, 0.12778, 0, 0.56875],
    8764: [-0.10889, 0.39111, 0, 0, 0.89444],
    8768: [0.19444, 0.69444, 0, 0, 0.31944],
    8771: [222e-5, 0.50222, 0, 0, 0.89444],
    8773: [0.027, 0.638, 0, 0, 0.894],
    8776: [0.02444, 0.52444, 0, 0, 0.89444],
    8781: [222e-5, 0.50222, 0, 0, 0.89444],
    8801: [222e-5, 0.50222, 0, 0, 0.89444],
    8804: [0.19667, 0.69667, 0, 0, 0.89444],
    8805: [0.19667, 0.69667, 0, 0, 0.89444],
    8810: [0.08556, 0.58556, 0, 0, 1.14999],
    8811: [0.08556, 0.58556, 0, 0, 1.14999],
    8826: [0.08556, 0.58556, 0, 0, 0.89444],
    8827: [0.08556, 0.58556, 0, 0, 0.89444],
    8834: [0.08556, 0.58556, 0, 0, 0.89444],
    8835: [0.08556, 0.58556, 0, 0, 0.89444],
    8838: [0.19667, 0.69667, 0, 0, 0.89444],
    8839: [0.19667, 0.69667, 0, 0, 0.89444],
    8846: [0, 0.55556, 0, 0, 0.76666],
    8849: [0.19667, 0.69667, 0, 0, 0.89444],
    8850: [0.19667, 0.69667, 0, 0, 0.89444],
    8851: [0, 0.55556, 0, 0, 0.76666],
    8852: [0, 0.55556, 0, 0, 0.76666],
    8853: [0.13333, 0.63333, 0, 0, 0.89444],
    8854: [0.13333, 0.63333, 0, 0, 0.89444],
    8855: [0.13333, 0.63333, 0, 0, 0.89444],
    8856: [0.13333, 0.63333, 0, 0, 0.89444],
    8857: [0.13333, 0.63333, 0, 0, 0.89444],
    8866: [0, 0.69444, 0, 0, 0.70277],
    8867: [0, 0.69444, 0, 0, 0.70277],
    8868: [0, 0.69444, 0, 0, 0.89444],
    8869: [0, 0.69444, 0, 0, 0.89444],
    8900: [-0.02639, 0.47361, 0, 0, 0.575],
    8901: [-0.02639, 0.47361, 0, 0, 0.31944],
    8902: [-0.02778, 0.47222, 0, 0, 0.575],
    8968: [0.25, 0.75, 0, 0, 0.51111],
    8969: [0.25, 0.75, 0, 0, 0.51111],
    8970: [0.25, 0.75, 0, 0, 0.51111],
    8971: [0.25, 0.75, 0, 0, 0.51111],
    8994: [-0.13889, 0.36111, 0, 0, 1.14999],
    8995: [-0.13889, 0.36111, 0, 0, 1.14999],
    9651: [0.19444, 0.69444, 0, 0, 1.02222],
    9657: [-0.02778, 0.47222, 0, 0, 0.575],
    9661: [0.19444, 0.69444, 0, 0, 1.02222],
    9667: [-0.02778, 0.47222, 0, 0, 0.575],
    9711: [0.19444, 0.69444, 0, 0, 1.14999],
    9824: [0.12963, 0.69444, 0, 0, 0.89444],
    9825: [0.12963, 0.69444, 0, 0, 0.89444],
    9826: [0.12963, 0.69444, 0, 0, 0.89444],
    9827: [0.12963, 0.69444, 0, 0, 0.89444],
    9837: [0, 0.75, 0, 0, 0.44722],
    9838: [0.19444, 0.69444, 0, 0, 0.44722],
    9839: [0.19444, 0.69444, 0, 0, 0.44722],
    10216: [0.25, 0.75, 0, 0, 0.44722],
    10217: [0.25, 0.75, 0, 0, 0.44722],
    10815: [0, 0.68611, 0, 0, 0.9],
    10927: [0.19667, 0.69667, 0, 0, 0.89444],
    10928: [0.19667, 0.69667, 0, 0, 0.89444],
    57376: [0.19444, 0.69444, 0, 0, 0]
  },
  "Main-BoldItalic": {
    32: [0, 0, 0, 0, 0.25],
    33: [0, 0.69444, 0.11417, 0, 0.38611],
    34: [0, 0.69444, 0.07939, 0, 0.62055],
    35: [0.19444, 0.69444, 0.06833, 0, 0.94444],
    37: [0.05556, 0.75, 0.12861, 0, 0.94444],
    38: [0, 0.69444, 0.08528, 0, 0.88555],
    39: [0, 0.69444, 0.12945, 0, 0.35555],
    40: [0.25, 0.75, 0.15806, 0, 0.47333],
    41: [0.25, 0.75, 0.03306, 0, 0.47333],
    42: [0, 0.75, 0.14333, 0, 0.59111],
    43: [0.10333, 0.60333, 0.03306, 0, 0.88555],
    44: [0.19444, 0.14722, 0, 0, 0.35555],
    45: [0, 0.44444, 0.02611, 0, 0.41444],
    46: [0, 0.14722, 0, 0, 0.35555],
    47: [0.25, 0.75, 0.15806, 0, 0.59111],
    48: [0, 0.64444, 0.13167, 0, 0.59111],
    49: [0, 0.64444, 0.13167, 0, 0.59111],
    50: [0, 0.64444, 0.13167, 0, 0.59111],
    51: [0, 0.64444, 0.13167, 0, 0.59111],
    52: [0.19444, 0.64444, 0.13167, 0, 0.59111],
    53: [0, 0.64444, 0.13167, 0, 0.59111],
    54: [0, 0.64444, 0.13167, 0, 0.59111],
    55: [0.19444, 0.64444, 0.13167, 0, 0.59111],
    56: [0, 0.64444, 0.13167, 0, 0.59111],
    57: [0, 0.64444, 0.13167, 0, 0.59111],
    58: [0, 0.44444, 0.06695, 0, 0.35555],
    59: [0.19444, 0.44444, 0.06695, 0, 0.35555],
    61: [-0.10889, 0.39111, 0.06833, 0, 0.88555],
    63: [0, 0.69444, 0.11472, 0, 0.59111],
    64: [0, 0.69444, 0.09208, 0, 0.88555],
    65: [0, 0.68611, 0, 0, 0.86555],
    66: [0, 0.68611, 0.0992, 0, 0.81666],
    67: [0, 0.68611, 0.14208, 0, 0.82666],
    68: [0, 0.68611, 0.09062, 0, 0.87555],
    69: [0, 0.68611, 0.11431, 0, 0.75666],
    70: [0, 0.68611, 0.12903, 0, 0.72722],
    71: [0, 0.68611, 0.07347, 0, 0.89527],
    72: [0, 0.68611, 0.17208, 0, 0.8961],
    73: [0, 0.68611, 0.15681, 0, 0.47166],
    74: [0, 0.68611, 0.145, 0, 0.61055],
    75: [0, 0.68611, 0.14208, 0, 0.89499],
    76: [0, 0.68611, 0, 0, 0.69777],
    77: [0, 0.68611, 0.17208, 0, 1.07277],
    78: [0, 0.68611, 0.17208, 0, 0.8961],
    79: [0, 0.68611, 0.09062, 0, 0.85499],
    80: [0, 0.68611, 0.0992, 0, 0.78721],
    81: [0.19444, 0.68611, 0.09062, 0, 0.85499],
    82: [0, 0.68611, 0.02559, 0, 0.85944],
    83: [0, 0.68611, 0.11264, 0, 0.64999],
    84: [0, 0.68611, 0.12903, 0, 0.7961],
    85: [0, 0.68611, 0.17208, 0, 0.88083],
    86: [0, 0.68611, 0.18625, 0, 0.86555],
    87: [0, 0.68611, 0.18625, 0, 1.15999],
    88: [0, 0.68611, 0.15681, 0, 0.86555],
    89: [0, 0.68611, 0.19803, 0, 0.86555],
    90: [0, 0.68611, 0.14208, 0, 0.70888],
    91: [0.25, 0.75, 0.1875, 0, 0.35611],
    93: [0.25, 0.75, 0.09972, 0, 0.35611],
    94: [0, 0.69444, 0.06709, 0, 0.59111],
    95: [0.31, 0.13444, 0.09811, 0, 0.59111],
    97: [0, 0.44444, 0.09426, 0, 0.59111],
    98: [0, 0.69444, 0.07861, 0, 0.53222],
    99: [0, 0.44444, 0.05222, 0, 0.53222],
    100: [0, 0.69444, 0.10861, 0, 0.59111],
    101: [0, 0.44444, 0.085, 0, 0.53222],
    102: [0.19444, 0.69444, 0.21778, 0, 0.4],
    103: [0.19444, 0.44444, 0.105, 0, 0.53222],
    104: [0, 0.69444, 0.09426, 0, 0.59111],
    105: [0, 0.69326, 0.11387, 0, 0.35555],
    106: [0.19444, 0.69326, 0.1672, 0, 0.35555],
    107: [0, 0.69444, 0.11111, 0, 0.53222],
    108: [0, 0.69444, 0.10861, 0, 0.29666],
    109: [0, 0.44444, 0.09426, 0, 0.94444],
    110: [0, 0.44444, 0.09426, 0, 0.64999],
    111: [0, 0.44444, 0.07861, 0, 0.59111],
    112: [0.19444, 0.44444, 0.07861, 0, 0.59111],
    113: [0.19444, 0.44444, 0.105, 0, 0.53222],
    114: [0, 0.44444, 0.11111, 0, 0.50167],
    115: [0, 0.44444, 0.08167, 0, 0.48694],
    116: [0, 0.63492, 0.09639, 0, 0.385],
    117: [0, 0.44444, 0.09426, 0, 0.62055],
    118: [0, 0.44444, 0.11111, 0, 0.53222],
    119: [0, 0.44444, 0.11111, 0, 0.76777],
    120: [0, 0.44444, 0.12583, 0, 0.56055],
    121: [0.19444, 0.44444, 0.105, 0, 0.56166],
    122: [0, 0.44444, 0.13889, 0, 0.49055],
    126: [0.35, 0.34444, 0.11472, 0, 0.59111],
    160: [0, 0, 0, 0, 0.25],
    168: [0, 0.69444, 0.11473, 0, 0.59111],
    176: [0, 0.69444, 0, 0, 0.94888],
    184: [0.17014, 0, 0, 0, 0.53222],
    198: [0, 0.68611, 0.11431, 0, 1.02277],
    216: [0.04861, 0.73472, 0.09062, 0, 0.88555],
    223: [0.19444, 0.69444, 0.09736, 0, 0.665],
    230: [0, 0.44444, 0.085, 0, 0.82666],
    248: [0.09722, 0.54167, 0.09458, 0, 0.59111],
    305: [0, 0.44444, 0.09426, 0, 0.35555],
    338: [0, 0.68611, 0.11431, 0, 1.14054],
    339: [0, 0.44444, 0.085, 0, 0.82666],
    567: [0.19444, 0.44444, 0.04611, 0, 0.385],
    710: [0, 0.69444, 0.06709, 0, 0.59111],
    711: [0, 0.63194, 0.08271, 0, 0.59111],
    713: [0, 0.59444, 0.10444, 0, 0.59111],
    714: [0, 0.69444, 0.08528, 0, 0.59111],
    715: [0, 0.69444, 0, 0, 0.59111],
    728: [0, 0.69444, 0.10333, 0, 0.59111],
    729: [0, 0.69444, 0.12945, 0, 0.35555],
    730: [0, 0.69444, 0, 0, 0.94888],
    732: [0, 0.69444, 0.11472, 0, 0.59111],
    733: [0, 0.69444, 0.11472, 0, 0.59111],
    915: [0, 0.68611, 0.12903, 0, 0.69777],
    916: [0, 0.68611, 0, 0, 0.94444],
    920: [0, 0.68611, 0.09062, 0, 0.88555],
    923: [0, 0.68611, 0, 0, 0.80666],
    926: [0, 0.68611, 0.15092, 0, 0.76777],
    928: [0, 0.68611, 0.17208, 0, 0.8961],
    931: [0, 0.68611, 0.11431, 0, 0.82666],
    933: [0, 0.68611, 0.10778, 0, 0.88555],
    934: [0, 0.68611, 0.05632, 0, 0.82666],
    936: [0, 0.68611, 0.10778, 0, 0.88555],
    937: [0, 0.68611, 0.0992, 0, 0.82666],
    8211: [0, 0.44444, 0.09811, 0, 0.59111],
    8212: [0, 0.44444, 0.09811, 0, 1.18221],
    8216: [0, 0.69444, 0.12945, 0, 0.35555],
    8217: [0, 0.69444, 0.12945, 0, 0.35555],
    8220: [0, 0.69444, 0.16772, 0, 0.62055],
    8221: [0, 0.69444, 0.07939, 0, 0.62055]
  },
  "Main-Italic": {
    32: [0, 0, 0, 0, 0.25],
    33: [0, 0.69444, 0.12417, 0, 0.30667],
    34: [0, 0.69444, 0.06961, 0, 0.51444],
    35: [0.19444, 0.69444, 0.06616, 0, 0.81777],
    37: [0.05556, 0.75, 0.13639, 0, 0.81777],
    38: [0, 0.69444, 0.09694, 0, 0.76666],
    39: [0, 0.69444, 0.12417, 0, 0.30667],
    40: [0.25, 0.75, 0.16194, 0, 0.40889],
    41: [0.25, 0.75, 0.03694, 0, 0.40889],
    42: [0, 0.75, 0.14917, 0, 0.51111],
    43: [0.05667, 0.56167, 0.03694, 0, 0.76666],
    44: [0.19444, 0.10556, 0, 0, 0.30667],
    45: [0, 0.43056, 0.02826, 0, 0.35778],
    46: [0, 0.10556, 0, 0, 0.30667],
    47: [0.25, 0.75, 0.16194, 0, 0.51111],
    48: [0, 0.64444, 0.13556, 0, 0.51111],
    49: [0, 0.64444, 0.13556, 0, 0.51111],
    50: [0, 0.64444, 0.13556, 0, 0.51111],
    51: [0, 0.64444, 0.13556, 0, 0.51111],
    52: [0.19444, 0.64444, 0.13556, 0, 0.51111],
    53: [0, 0.64444, 0.13556, 0, 0.51111],
    54: [0, 0.64444, 0.13556, 0, 0.51111],
    55: [0.19444, 0.64444, 0.13556, 0, 0.51111],
    56: [0, 0.64444, 0.13556, 0, 0.51111],
    57: [0, 0.64444, 0.13556, 0, 0.51111],
    58: [0, 0.43056, 0.0582, 0, 0.30667],
    59: [0.19444, 0.43056, 0.0582, 0, 0.30667],
    61: [-0.13313, 0.36687, 0.06616, 0, 0.76666],
    63: [0, 0.69444, 0.1225, 0, 0.51111],
    64: [0, 0.69444, 0.09597, 0, 0.76666],
    65: [0, 0.68333, 0, 0, 0.74333],
    66: [0, 0.68333, 0.10257, 0, 0.70389],
    67: [0, 0.68333, 0.14528, 0, 0.71555],
    68: [0, 0.68333, 0.09403, 0, 0.755],
    69: [0, 0.68333, 0.12028, 0, 0.67833],
    70: [0, 0.68333, 0.13305, 0, 0.65277],
    71: [0, 0.68333, 0.08722, 0, 0.77361],
    72: [0, 0.68333, 0.16389, 0, 0.74333],
    73: [0, 0.68333, 0.15806, 0, 0.38555],
    74: [0, 0.68333, 0.14028, 0, 0.525],
    75: [0, 0.68333, 0.14528, 0, 0.76888],
    76: [0, 0.68333, 0, 0, 0.62722],
    77: [0, 0.68333, 0.16389, 0, 0.89666],
    78: [0, 0.68333, 0.16389, 0, 0.74333],
    79: [0, 0.68333, 0.09403, 0, 0.76666],
    80: [0, 0.68333, 0.10257, 0, 0.67833],
    81: [0.19444, 0.68333, 0.09403, 0, 0.76666],
    82: [0, 0.68333, 0.03868, 0, 0.72944],
    83: [0, 0.68333, 0.11972, 0, 0.56222],
    84: [0, 0.68333, 0.13305, 0, 0.71555],
    85: [0, 0.68333, 0.16389, 0, 0.74333],
    86: [0, 0.68333, 0.18361, 0, 0.74333],
    87: [0, 0.68333, 0.18361, 0, 0.99888],
    88: [0, 0.68333, 0.15806, 0, 0.74333],
    89: [0, 0.68333, 0.19383, 0, 0.74333],
    90: [0, 0.68333, 0.14528, 0, 0.61333],
    91: [0.25, 0.75, 0.1875, 0, 0.30667],
    93: [0.25, 0.75, 0.10528, 0, 0.30667],
    94: [0, 0.69444, 0.06646, 0, 0.51111],
    95: [0.31, 0.12056, 0.09208, 0, 0.51111],
    97: [0, 0.43056, 0.07671, 0, 0.51111],
    98: [0, 0.69444, 0.06312, 0, 0.46],
    99: [0, 0.43056, 0.05653, 0, 0.46],
    100: [0, 0.69444, 0.10333, 0, 0.51111],
    101: [0, 0.43056, 0.07514, 0, 0.46],
    102: [0.19444, 0.69444, 0.21194, 0, 0.30667],
    103: [0.19444, 0.43056, 0.08847, 0, 0.46],
    104: [0, 0.69444, 0.07671, 0, 0.51111],
    105: [0, 0.65536, 0.1019, 0, 0.30667],
    106: [0.19444, 0.65536, 0.14467, 0, 0.30667],
    107: [0, 0.69444, 0.10764, 0, 0.46],
    108: [0, 0.69444, 0.10333, 0, 0.25555],
    109: [0, 0.43056, 0.07671, 0, 0.81777],
    110: [0, 0.43056, 0.07671, 0, 0.56222],
    111: [0, 0.43056, 0.06312, 0, 0.51111],
    112: [0.19444, 0.43056, 0.06312, 0, 0.51111],
    113: [0.19444, 0.43056, 0.08847, 0, 0.46],
    114: [0, 0.43056, 0.10764, 0, 0.42166],
    115: [0, 0.43056, 0.08208, 0, 0.40889],
    116: [0, 0.61508, 0.09486, 0, 0.33222],
    117: [0, 0.43056, 0.07671, 0, 0.53666],
    118: [0, 0.43056, 0.10764, 0, 0.46],
    119: [0, 0.43056, 0.10764, 0, 0.66444],
    120: [0, 0.43056, 0.12042, 0, 0.46389],
    121: [0.19444, 0.43056, 0.08847, 0, 0.48555],
    122: [0, 0.43056, 0.12292, 0, 0.40889],
    126: [0.35, 0.31786, 0.11585, 0, 0.51111],
    160: [0, 0, 0, 0, 0.25],
    168: [0, 0.66786, 0.10474, 0, 0.51111],
    176: [0, 0.69444, 0, 0, 0.83129],
    184: [0.17014, 0, 0, 0, 0.46],
    198: [0, 0.68333, 0.12028, 0, 0.88277],
    216: [0.04861, 0.73194, 0.09403, 0, 0.76666],
    223: [0.19444, 0.69444, 0.10514, 0, 0.53666],
    230: [0, 0.43056, 0.07514, 0, 0.71555],
    248: [0.09722, 0.52778, 0.09194, 0, 0.51111],
    338: [0, 0.68333, 0.12028, 0, 0.98499],
    339: [0, 0.43056, 0.07514, 0, 0.71555],
    710: [0, 0.69444, 0.06646, 0, 0.51111],
    711: [0, 0.62847, 0.08295, 0, 0.51111],
    713: [0, 0.56167, 0.10333, 0, 0.51111],
    714: [0, 0.69444, 0.09694, 0, 0.51111],
    715: [0, 0.69444, 0, 0, 0.51111],
    728: [0, 0.69444, 0.10806, 0, 0.51111],
    729: [0, 0.66786, 0.11752, 0, 0.30667],
    730: [0, 0.69444, 0, 0, 0.83129],
    732: [0, 0.66786, 0.11585, 0, 0.51111],
    733: [0, 0.69444, 0.1225, 0, 0.51111],
    915: [0, 0.68333, 0.13305, 0, 0.62722],
    916: [0, 0.68333, 0, 0, 0.81777],
    920: [0, 0.68333, 0.09403, 0, 0.76666],
    923: [0, 0.68333, 0, 0, 0.69222],
    926: [0, 0.68333, 0.15294, 0, 0.66444],
    928: [0, 0.68333, 0.16389, 0, 0.74333],
    931: [0, 0.68333, 0.12028, 0, 0.71555],
    933: [0, 0.68333, 0.11111, 0, 0.76666],
    934: [0, 0.68333, 0.05986, 0, 0.71555],
    936: [0, 0.68333, 0.11111, 0, 0.76666],
    937: [0, 0.68333, 0.10257, 0, 0.71555],
    8211: [0, 0.43056, 0.09208, 0, 0.51111],
    8212: [0, 0.43056, 0.09208, 0, 1.02222],
    8216: [0, 0.69444, 0.12417, 0, 0.30667],
    8217: [0, 0.69444, 0.12417, 0, 0.30667],
    8220: [0, 0.69444, 0.1685, 0, 0.51444],
    8221: [0, 0.69444, 0.06961, 0, 0.51444],
    8463: [0, 0.68889, 0, 0, 0.54028]
  },
  "Main-Regular": {
    32: [0, 0, 0, 0, 0.25],
    33: [0, 0.69444, 0, 0, 0.27778],
    34: [0, 0.69444, 0, 0, 0.5],
    35: [0.19444, 0.69444, 0, 0, 0.83334],
    36: [0.05556, 0.75, 0, 0, 0.5],
    37: [0.05556, 0.75, 0, 0, 0.83334],
    38: [0, 0.69444, 0, 0, 0.77778],
    39: [0, 0.69444, 0, 0, 0.27778],
    40: [0.25, 0.75, 0, 0, 0.38889],
    41: [0.25, 0.75, 0, 0, 0.38889],
    42: [0, 0.75, 0, 0, 0.5],
    43: [0.08333, 0.58333, 0, 0, 0.77778],
    44: [0.19444, 0.10556, 0, 0, 0.27778],
    45: [0, 0.43056, 0, 0, 0.33333],
    46: [0, 0.10556, 0, 0, 0.27778],
    47: [0.25, 0.75, 0, 0, 0.5],
    48: [0, 0.64444, 0, 0, 0.5],
    49: [0, 0.64444, 0, 0, 0.5],
    50: [0, 0.64444, 0, 0, 0.5],
    51: [0, 0.64444, 0, 0, 0.5],
    52: [0, 0.64444, 0, 0, 0.5],
    53: [0, 0.64444, 0, 0, 0.5],
    54: [0, 0.64444, 0, 0, 0.5],
    55: [0, 0.64444, 0, 0, 0.5],
    56: [0, 0.64444, 0, 0, 0.5],
    57: [0, 0.64444, 0, 0, 0.5],
    58: [0, 0.43056, 0, 0, 0.27778],
    59: [0.19444, 0.43056, 0, 0, 0.27778],
    60: [0.0391, 0.5391, 0, 0, 0.77778],
    61: [-0.13313, 0.36687, 0, 0, 0.77778],
    62: [0.0391, 0.5391, 0, 0, 0.77778],
    63: [0, 0.69444, 0, 0, 0.47222],
    64: [0, 0.69444, 0, 0, 0.77778],
    65: [0, 0.68333, 0, 0, 0.75],
    66: [0, 0.68333, 0, 0, 0.70834],
    67: [0, 0.68333, 0, 0, 0.72222],
    68: [0, 0.68333, 0, 0, 0.76389],
    69: [0, 0.68333, 0, 0, 0.68056],
    70: [0, 0.68333, 0, 0, 0.65278],
    71: [0, 0.68333, 0, 0, 0.78472],
    72: [0, 0.68333, 0, 0, 0.75],
    73: [0, 0.68333, 0, 0, 0.36111],
    74: [0, 0.68333, 0, 0, 0.51389],
    75: [0, 0.68333, 0, 0, 0.77778],
    76: [0, 0.68333, 0, 0, 0.625],
    77: [0, 0.68333, 0, 0, 0.91667],
    78: [0, 0.68333, 0, 0, 0.75],
    79: [0, 0.68333, 0, 0, 0.77778],
    80: [0, 0.68333, 0, 0, 0.68056],
    81: [0.19444, 0.68333, 0, 0, 0.77778],
    82: [0, 0.68333, 0, 0, 0.73611],
    83: [0, 0.68333, 0, 0, 0.55556],
    84: [0, 0.68333, 0, 0, 0.72222],
    85: [0, 0.68333, 0, 0, 0.75],
    86: [0, 0.68333, 0.01389, 0, 0.75],
    87: [0, 0.68333, 0.01389, 0, 1.02778],
    88: [0, 0.68333, 0, 0, 0.75],
    89: [0, 0.68333, 0.025, 0, 0.75],
    90: [0, 0.68333, 0, 0, 0.61111],
    91: [0.25, 0.75, 0, 0, 0.27778],
    92: [0.25, 0.75, 0, 0, 0.5],
    93: [0.25, 0.75, 0, 0, 0.27778],
    94: [0, 0.69444, 0, 0, 0.5],
    95: [0.31, 0.12056, 0.02778, 0, 0.5],
    97: [0, 0.43056, 0, 0, 0.5],
    98: [0, 0.69444, 0, 0, 0.55556],
    99: [0, 0.43056, 0, 0, 0.44445],
    100: [0, 0.69444, 0, 0, 0.55556],
    101: [0, 0.43056, 0, 0, 0.44445],
    102: [0, 0.69444, 0.07778, 0, 0.30556],
    103: [0.19444, 0.43056, 0.01389, 0, 0.5],
    104: [0, 0.69444, 0, 0, 0.55556],
    105: [0, 0.66786, 0, 0, 0.27778],
    106: [0.19444, 0.66786, 0, 0, 0.30556],
    107: [0, 0.69444, 0, 0, 0.52778],
    108: [0, 0.69444, 0, 0, 0.27778],
    109: [0, 0.43056, 0, 0, 0.83334],
    110: [0, 0.43056, 0, 0, 0.55556],
    111: [0, 0.43056, 0, 0, 0.5],
    112: [0.19444, 0.43056, 0, 0, 0.55556],
    113: [0.19444, 0.43056, 0, 0, 0.52778],
    114: [0, 0.43056, 0, 0, 0.39167],
    115: [0, 0.43056, 0, 0, 0.39445],
    116: [0, 0.61508, 0, 0, 0.38889],
    117: [0, 0.43056, 0, 0, 0.55556],
    118: [0, 0.43056, 0.01389, 0, 0.52778],
    119: [0, 0.43056, 0.01389, 0, 0.72222],
    120: [0, 0.43056, 0, 0, 0.52778],
    121: [0.19444, 0.43056, 0.01389, 0, 0.52778],
    122: [0, 0.43056, 0, 0, 0.44445],
    123: [0.25, 0.75, 0, 0, 0.5],
    124: [0.25, 0.75, 0, 0, 0.27778],
    125: [0.25, 0.75, 0, 0, 0.5],
    126: [0.35, 0.31786, 0, 0, 0.5],
    160: [0, 0, 0, 0, 0.25],
    163: [0, 0.69444, 0, 0, 0.76909],
    167: [0.19444, 0.69444, 0, 0, 0.44445],
    168: [0, 0.66786, 0, 0, 0.5],
    172: [0, 0.43056, 0, 0, 0.66667],
    176: [0, 0.69444, 0, 0, 0.75],
    177: [0.08333, 0.58333, 0, 0, 0.77778],
    182: [0.19444, 0.69444, 0, 0, 0.61111],
    184: [0.17014, 0, 0, 0, 0.44445],
    198: [0, 0.68333, 0, 0, 0.90278],
    215: [0.08333, 0.58333, 0, 0, 0.77778],
    216: [0.04861, 0.73194, 0, 0, 0.77778],
    223: [0, 0.69444, 0, 0, 0.5],
    230: [0, 0.43056, 0, 0, 0.72222],
    247: [0.08333, 0.58333, 0, 0, 0.77778],
    248: [0.09722, 0.52778, 0, 0, 0.5],
    305: [0, 0.43056, 0, 0, 0.27778],
    338: [0, 0.68333, 0, 0, 1.01389],
    339: [0, 0.43056, 0, 0, 0.77778],
    567: [0.19444, 0.43056, 0, 0, 0.30556],
    710: [0, 0.69444, 0, 0, 0.5],
    711: [0, 0.62847, 0, 0, 0.5],
    713: [0, 0.56778, 0, 0, 0.5],
    714: [0, 0.69444, 0, 0, 0.5],
    715: [0, 0.69444, 0, 0, 0.5],
    728: [0, 0.69444, 0, 0, 0.5],
    729: [0, 0.66786, 0, 0, 0.27778],
    730: [0, 0.69444, 0, 0, 0.75],
    732: [0, 0.66786, 0, 0, 0.5],
    733: [0, 0.69444, 0, 0, 0.5],
    915: [0, 0.68333, 0, 0, 0.625],
    916: [0, 0.68333, 0, 0, 0.83334],
    920: [0, 0.68333, 0, 0, 0.77778],
    923: [0, 0.68333, 0, 0, 0.69445],
    926: [0, 0.68333, 0, 0, 0.66667],
    928: [0, 0.68333, 0, 0, 0.75],
    931: [0, 0.68333, 0, 0, 0.72222],
    933: [0, 0.68333, 0, 0, 0.77778],
    934: [0, 0.68333, 0, 0, 0.72222],
    936: [0, 0.68333, 0, 0, 0.77778],
    937: [0, 0.68333, 0, 0, 0.72222],
    8211: [0, 0.43056, 0.02778, 0, 0.5],
    8212: [0, 0.43056, 0.02778, 0, 1],
    8216: [0, 0.69444, 0, 0, 0.27778],
    8217: [0, 0.69444, 0, 0, 0.27778],
    8220: [0, 0.69444, 0, 0, 0.5],
    8221: [0, 0.69444, 0, 0, 0.5],
    8224: [0.19444, 0.69444, 0, 0, 0.44445],
    8225: [0.19444, 0.69444, 0, 0, 0.44445],
    8230: [0, 0.123, 0, 0, 1.172],
    8242: [0, 0.55556, 0, 0, 0.275],
    8407: [0, 0.71444, 0.15382, 0, 0.5],
    8463: [0, 0.68889, 0, 0, 0.54028],
    8465: [0, 0.69444, 0, 0, 0.72222],
    8467: [0, 0.69444, 0, 0.11111, 0.41667],
    8472: [0.19444, 0.43056, 0, 0.11111, 0.63646],
    8476: [0, 0.69444, 0, 0, 0.72222],
    8501: [0, 0.69444, 0, 0, 0.61111],
    8592: [-0.13313, 0.36687, 0, 0, 1],
    8593: [0.19444, 0.69444, 0, 0, 0.5],
    8594: [-0.13313, 0.36687, 0, 0, 1],
    8595: [0.19444, 0.69444, 0, 0, 0.5],
    8596: [-0.13313, 0.36687, 0, 0, 1],
    8597: [0.25, 0.75, 0, 0, 0.5],
    8598: [0.19444, 0.69444, 0, 0, 1],
    8599: [0.19444, 0.69444, 0, 0, 1],
    8600: [0.19444, 0.69444, 0, 0, 1],
    8601: [0.19444, 0.69444, 0, 0, 1],
    8614: [0.011, 0.511, 0, 0, 1],
    8617: [0.011, 0.511, 0, 0, 1.126],
    8618: [0.011, 0.511, 0, 0, 1.126],
    8636: [-0.13313, 0.36687, 0, 0, 1],
    8637: [-0.13313, 0.36687, 0, 0, 1],
    8640: [-0.13313, 0.36687, 0, 0, 1],
    8641: [-0.13313, 0.36687, 0, 0, 1],
    8652: [0.011, 0.671, 0, 0, 1],
    8656: [-0.13313, 0.36687, 0, 0, 1],
    8657: [0.19444, 0.69444, 0, 0, 0.61111],
    8658: [-0.13313, 0.36687, 0, 0, 1],
    8659: [0.19444, 0.69444, 0, 0, 0.61111],
    8660: [-0.13313, 0.36687, 0, 0, 1],
    8661: [0.25, 0.75, 0, 0, 0.61111],
    8704: [0, 0.69444, 0, 0, 0.55556],
    8706: [0, 0.69444, 0.05556, 0.08334, 0.5309],
    8707: [0, 0.69444, 0, 0, 0.55556],
    8709: [0.05556, 0.75, 0, 0, 0.5],
    8711: [0, 0.68333, 0, 0, 0.83334],
    8712: [0.0391, 0.5391, 0, 0, 0.66667],
    8715: [0.0391, 0.5391, 0, 0, 0.66667],
    8722: [0.08333, 0.58333, 0, 0, 0.77778],
    8723: [0.08333, 0.58333, 0, 0, 0.77778],
    8725: [0.25, 0.75, 0, 0, 0.5],
    8726: [0.25, 0.75, 0, 0, 0.5],
    8727: [-0.03472, 0.46528, 0, 0, 0.5],
    8728: [-0.05555, 0.44445, 0, 0, 0.5],
    8729: [-0.05555, 0.44445, 0, 0, 0.5],
    8730: [0.2, 0.8, 0, 0, 0.83334],
    8733: [0, 0.43056, 0, 0, 0.77778],
    8734: [0, 0.43056, 0, 0, 1],
    8736: [0, 0.69224, 0, 0, 0.72222],
    8739: [0.25, 0.75, 0, 0, 0.27778],
    8741: [0.25, 0.75, 0, 0, 0.5],
    8743: [0, 0.55556, 0, 0, 0.66667],
    8744: [0, 0.55556, 0, 0, 0.66667],
    8745: [0, 0.55556, 0, 0, 0.66667],
    8746: [0, 0.55556, 0, 0, 0.66667],
    8747: [0.19444, 0.69444, 0.11111, 0, 0.41667],
    8764: [-0.13313, 0.36687, 0, 0, 0.77778],
    8768: [0.19444, 0.69444, 0, 0, 0.27778],
    8771: [-0.03625, 0.46375, 0, 0, 0.77778],
    8773: [-0.022, 0.589, 0, 0, 0.778],
    8776: [-0.01688, 0.48312, 0, 0, 0.77778],
    8781: [-0.03625, 0.46375, 0, 0, 0.77778],
    8784: [-0.133, 0.673, 0, 0, 0.778],
    8801: [-0.03625, 0.46375, 0, 0, 0.77778],
    8804: [0.13597, 0.63597, 0, 0, 0.77778],
    8805: [0.13597, 0.63597, 0, 0, 0.77778],
    8810: [0.0391, 0.5391, 0, 0, 1],
    8811: [0.0391, 0.5391, 0, 0, 1],
    8826: [0.0391, 0.5391, 0, 0, 0.77778],
    8827: [0.0391, 0.5391, 0, 0, 0.77778],
    8834: [0.0391, 0.5391, 0, 0, 0.77778],
    8835: [0.0391, 0.5391, 0, 0, 0.77778],
    8838: [0.13597, 0.63597, 0, 0, 0.77778],
    8839: [0.13597, 0.63597, 0, 0, 0.77778],
    8846: [0, 0.55556, 0, 0, 0.66667],
    8849: [0.13597, 0.63597, 0, 0, 0.77778],
    8850: [0.13597, 0.63597, 0, 0, 0.77778],
    8851: [0, 0.55556, 0, 0, 0.66667],
    8852: [0, 0.55556, 0, 0, 0.66667],
    8853: [0.08333, 0.58333, 0, 0, 0.77778],
    8854: [0.08333, 0.58333, 0, 0, 0.77778],
    8855: [0.08333, 0.58333, 0, 0, 0.77778],
    8856: [0.08333, 0.58333, 0, 0, 0.77778],
    8857: [0.08333, 0.58333, 0, 0, 0.77778],
    8866: [0, 0.69444, 0, 0, 0.61111],
    8867: [0, 0.69444, 0, 0, 0.61111],
    8868: [0, 0.69444, 0, 0, 0.77778],
    8869: [0, 0.69444, 0, 0, 0.77778],
    8872: [0.249, 0.75, 0, 0, 0.867],
    8900: [-0.05555, 0.44445, 0, 0, 0.5],
    8901: [-0.05555, 0.44445, 0, 0, 0.27778],
    8902: [-0.03472, 0.46528, 0, 0, 0.5],
    8904: [5e-3, 0.505, 0, 0, 0.9],
    8942: [0.03, 0.903, 0, 0, 0.278],
    8943: [-0.19, 0.313, 0, 0, 1.172],
    8945: [-0.1, 0.823, 0, 0, 1.282],
    8968: [0.25, 0.75, 0, 0, 0.44445],
    8969: [0.25, 0.75, 0, 0, 0.44445],
    8970: [0.25, 0.75, 0, 0, 0.44445],
    8971: [0.25, 0.75, 0, 0, 0.44445],
    8994: [-0.14236, 0.35764, 0, 0, 1],
    8995: [-0.14236, 0.35764, 0, 0, 1],
    9136: [0.244, 0.744, 0, 0, 0.412],
    9137: [0.244, 0.745, 0, 0, 0.412],
    9651: [0.19444, 0.69444, 0, 0, 0.88889],
    9657: [-0.03472, 0.46528, 0, 0, 0.5],
    9661: [0.19444, 0.69444, 0, 0, 0.88889],
    9667: [-0.03472, 0.46528, 0, 0, 0.5],
    9711: [0.19444, 0.69444, 0, 0, 1],
    9824: [0.12963, 0.69444, 0, 0, 0.77778],
    9825: [0.12963, 0.69444, 0, 0, 0.77778],
    9826: [0.12963, 0.69444, 0, 0, 0.77778],
    9827: [0.12963, 0.69444, 0, 0, 0.77778],
    9837: [0, 0.75, 0, 0, 0.38889],
    9838: [0.19444, 0.69444, 0, 0, 0.38889],
    9839: [0.19444, 0.69444, 0, 0, 0.38889],
    10216: [0.25, 0.75, 0, 0, 0.38889],
    10217: [0.25, 0.75, 0, 0, 0.38889],
    10222: [0.244, 0.744, 0, 0, 0.412],
    10223: [0.244, 0.745, 0, 0, 0.412],
    10229: [0.011, 0.511, 0, 0, 1.609],
    10230: [0.011, 0.511, 0, 0, 1.638],
    10231: [0.011, 0.511, 0, 0, 1.859],
    10232: [0.024, 0.525, 0, 0, 1.609],
    10233: [0.024, 0.525, 0, 0, 1.638],
    10234: [0.024, 0.525, 0, 0, 1.858],
    10236: [0.011, 0.511, 0, 0, 1.638],
    10815: [0, 0.68333, 0, 0, 0.75],
    10927: [0.13597, 0.63597, 0, 0, 0.77778],
    10928: [0.13597, 0.63597, 0, 0, 0.77778],
    57376: [0.19444, 0.69444, 0, 0, 0]
  },
  "Math-BoldItalic": {
    32: [0, 0, 0, 0, 0.25],
    48: [0, 0.44444, 0, 0, 0.575],
    49: [0, 0.44444, 0, 0, 0.575],
    50: [0, 0.44444, 0, 0, 0.575],
    51: [0.19444, 0.44444, 0, 0, 0.575],
    52: [0.19444, 0.44444, 0, 0, 0.575],
    53: [0.19444, 0.44444, 0, 0, 0.575],
    54: [0, 0.64444, 0, 0, 0.575],
    55: [0.19444, 0.44444, 0, 0, 0.575],
    56: [0, 0.64444, 0, 0, 0.575],
    57: [0.19444, 0.44444, 0, 0, 0.575],
    65: [0, 0.68611, 0, 0, 0.86944],
    66: [0, 0.68611, 0.04835, 0, 0.8664],
    67: [0, 0.68611, 0.06979, 0, 0.81694],
    68: [0, 0.68611, 0.03194, 0, 0.93812],
    69: [0, 0.68611, 0.05451, 0, 0.81007],
    70: [0, 0.68611, 0.15972, 0, 0.68889],
    71: [0, 0.68611, 0, 0, 0.88673],
    72: [0, 0.68611, 0.08229, 0, 0.98229],
    73: [0, 0.68611, 0.07778, 0, 0.51111],
    74: [0, 0.68611, 0.10069, 0, 0.63125],
    75: [0, 0.68611, 0.06979, 0, 0.97118],
    76: [0, 0.68611, 0, 0, 0.75555],
    77: [0, 0.68611, 0.11424, 0, 1.14201],
    78: [0, 0.68611, 0.11424, 0, 0.95034],
    79: [0, 0.68611, 0.03194, 0, 0.83666],
    80: [0, 0.68611, 0.15972, 0, 0.72309],
    81: [0.19444, 0.68611, 0, 0, 0.86861],
    82: [0, 0.68611, 421e-5, 0, 0.87235],
    83: [0, 0.68611, 0.05382, 0, 0.69271],
    84: [0, 0.68611, 0.15972, 0, 0.63663],
    85: [0, 0.68611, 0.11424, 0, 0.80027],
    86: [0, 0.68611, 0.25555, 0, 0.67778],
    87: [0, 0.68611, 0.15972, 0, 1.09305],
    88: [0, 0.68611, 0.07778, 0, 0.94722],
    89: [0, 0.68611, 0.25555, 0, 0.67458],
    90: [0, 0.68611, 0.06979, 0, 0.77257],
    97: [0, 0.44444, 0, 0, 0.63287],
    98: [0, 0.69444, 0, 0, 0.52083],
    99: [0, 0.44444, 0, 0, 0.51342],
    100: [0, 0.69444, 0, 0, 0.60972],
    101: [0, 0.44444, 0, 0, 0.55361],
    102: [0.19444, 0.69444, 0.11042, 0, 0.56806],
    103: [0.19444, 0.44444, 0.03704, 0, 0.5449],
    104: [0, 0.69444, 0, 0, 0.66759],
    105: [0, 0.69326, 0, 0, 0.4048],
    106: [0.19444, 0.69326, 0.0622, 0, 0.47083],
    107: [0, 0.69444, 0.01852, 0, 0.6037],
    108: [0, 0.69444, 88e-4, 0, 0.34815],
    109: [0, 0.44444, 0, 0, 1.0324],
    110: [0, 0.44444, 0, 0, 0.71296],
    111: [0, 0.44444, 0, 0, 0.58472],
    112: [0.19444, 0.44444, 0, 0, 0.60092],
    113: [0.19444, 0.44444, 0.03704, 0, 0.54213],
    114: [0, 0.44444, 0.03194, 0, 0.5287],
    115: [0, 0.44444, 0, 0, 0.53125],
    116: [0, 0.63492, 0, 0, 0.41528],
    117: [0, 0.44444, 0, 0, 0.68102],
    118: [0, 0.44444, 0.03704, 0, 0.56666],
    119: [0, 0.44444, 0.02778, 0, 0.83148],
    120: [0, 0.44444, 0, 0, 0.65903],
    121: [0.19444, 0.44444, 0.03704, 0, 0.59028],
    122: [0, 0.44444, 0.04213, 0, 0.55509],
    160: [0, 0, 0, 0, 0.25],
    915: [0, 0.68611, 0.15972, 0, 0.65694],
    916: [0, 0.68611, 0, 0, 0.95833],
    920: [0, 0.68611, 0.03194, 0, 0.86722],
    923: [0, 0.68611, 0, 0, 0.80555],
    926: [0, 0.68611, 0.07458, 0, 0.84125],
    928: [0, 0.68611, 0.08229, 0, 0.98229],
    931: [0, 0.68611, 0.05451, 0, 0.88507],
    933: [0, 0.68611, 0.15972, 0, 0.67083],
    934: [0, 0.68611, 0, 0, 0.76666],
    936: [0, 0.68611, 0.11653, 0, 0.71402],
    937: [0, 0.68611, 0.04835, 0, 0.8789],
    945: [0, 0.44444, 0, 0, 0.76064],
    946: [0.19444, 0.69444, 0.03403, 0, 0.65972],
    947: [0.19444, 0.44444, 0.06389, 0, 0.59003],
    948: [0, 0.69444, 0.03819, 0, 0.52222],
    949: [0, 0.44444, 0, 0, 0.52882],
    950: [0.19444, 0.69444, 0.06215, 0, 0.50833],
    951: [0.19444, 0.44444, 0.03704, 0, 0.6],
    952: [0, 0.69444, 0.03194, 0, 0.5618],
    953: [0, 0.44444, 0, 0, 0.41204],
    954: [0, 0.44444, 0, 0, 0.66759],
    955: [0, 0.69444, 0, 0, 0.67083],
    956: [0.19444, 0.44444, 0, 0, 0.70787],
    957: [0, 0.44444, 0.06898, 0, 0.57685],
    958: [0.19444, 0.69444, 0.03021, 0, 0.50833],
    959: [0, 0.44444, 0, 0, 0.58472],
    960: [0, 0.44444, 0.03704, 0, 0.68241],
    961: [0.19444, 0.44444, 0, 0, 0.6118],
    962: [0.09722, 0.44444, 0.07917, 0, 0.42361],
    963: [0, 0.44444, 0.03704, 0, 0.68588],
    964: [0, 0.44444, 0.13472, 0, 0.52083],
    965: [0, 0.44444, 0.03704, 0, 0.63055],
    966: [0.19444, 0.44444, 0, 0, 0.74722],
    967: [0.19444, 0.44444, 0, 0, 0.71805],
    968: [0.19444, 0.69444, 0.03704, 0, 0.75833],
    969: [0, 0.44444, 0.03704, 0, 0.71782],
    977: [0, 0.69444, 0, 0, 0.69155],
    981: [0.19444, 0.69444, 0, 0, 0.7125],
    982: [0, 0.44444, 0.03194, 0, 0.975],
    1009: [0.19444, 0.44444, 0, 0, 0.6118],
    1013: [0, 0.44444, 0, 0, 0.48333],
    57649: [0, 0.44444, 0, 0, 0.39352],
    57911: [0.19444, 0.44444, 0, 0, 0.43889]
  },
  "Math-Italic": {
    32: [0, 0, 0, 0, 0.25],
    48: [0, 0.43056, 0, 0, 0.5],
    49: [0, 0.43056, 0, 0, 0.5],
    50: [0, 0.43056, 0, 0, 0.5],
    51: [0.19444, 0.43056, 0, 0, 0.5],
    52: [0.19444, 0.43056, 0, 0, 0.5],
    53: [0.19444, 0.43056, 0, 0, 0.5],
    54: [0, 0.64444, 0, 0, 0.5],
    55: [0.19444, 0.43056, 0, 0, 0.5],
    56: [0, 0.64444, 0, 0, 0.5],
    57: [0.19444, 0.43056, 0, 0, 0.5],
    65: [0, 0.68333, 0, 0.13889, 0.75],
    66: [0, 0.68333, 0.05017, 0.08334, 0.75851],
    67: [0, 0.68333, 0.07153, 0.08334, 0.71472],
    68: [0, 0.68333, 0.02778, 0.05556, 0.82792],
    69: [0, 0.68333, 0.05764, 0.08334, 0.7382],
    70: [0, 0.68333, 0.13889, 0.08334, 0.64306],
    71: [0, 0.68333, 0, 0.08334, 0.78625],
    72: [0, 0.68333, 0.08125, 0.05556, 0.83125],
    73: [0, 0.68333, 0.07847, 0.11111, 0.43958],
    74: [0, 0.68333, 0.09618, 0.16667, 0.55451],
    75: [0, 0.68333, 0.07153, 0.05556, 0.84931],
    76: [0, 0.68333, 0, 0.02778, 0.68056],
    77: [0, 0.68333, 0.10903, 0.08334, 0.97014],
    78: [0, 0.68333, 0.10903, 0.08334, 0.80347],
    79: [0, 0.68333, 0.02778, 0.08334, 0.76278],
    80: [0, 0.68333, 0.13889, 0.08334, 0.64201],
    81: [0.19444, 0.68333, 0, 0.08334, 0.79056],
    82: [0, 0.68333, 773e-5, 0.08334, 0.75929],
    83: [0, 0.68333, 0.05764, 0.08334, 0.6132],
    84: [0, 0.68333, 0.13889, 0.08334, 0.58438],
    85: [0, 0.68333, 0.10903, 0.02778, 0.68278],
    86: [0, 0.68333, 0.22222, 0, 0.58333],
    87: [0, 0.68333, 0.13889, 0, 0.94445],
    88: [0, 0.68333, 0.07847, 0.08334, 0.82847],
    89: [0, 0.68333, 0.22222, 0, 0.58056],
    90: [0, 0.68333, 0.07153, 0.08334, 0.68264],
    97: [0, 0.43056, 0, 0, 0.52859],
    98: [0, 0.69444, 0, 0, 0.42917],
    99: [0, 0.43056, 0, 0.05556, 0.43276],
    100: [0, 0.69444, 0, 0.16667, 0.52049],
    101: [0, 0.43056, 0, 0.05556, 0.46563],
    102: [0.19444, 0.69444, 0.10764, 0.16667, 0.48959],
    103: [0.19444, 0.43056, 0.03588, 0.02778, 0.47697],
    104: [0, 0.69444, 0, 0, 0.57616],
    105: [0, 0.65952, 0, 0, 0.34451],
    106: [0.19444, 0.65952, 0.05724, 0, 0.41181],
    107: [0, 0.69444, 0.03148, 0, 0.5206],
    108: [0, 0.69444, 0.01968, 0.08334, 0.29838],
    109: [0, 0.43056, 0, 0, 0.87801],
    110: [0, 0.43056, 0, 0, 0.60023],
    111: [0, 0.43056, 0, 0.05556, 0.48472],
    112: [0.19444, 0.43056, 0, 0.08334, 0.50313],
    113: [0.19444, 0.43056, 0.03588, 0.08334, 0.44641],
    114: [0, 0.43056, 0.02778, 0.05556, 0.45116],
    115: [0, 0.43056, 0, 0.05556, 0.46875],
    116: [0, 0.61508, 0, 0.08334, 0.36111],
    117: [0, 0.43056, 0, 0.02778, 0.57246],
    118: [0, 0.43056, 0.03588, 0.02778, 0.48472],
    119: [0, 0.43056, 0.02691, 0.08334, 0.71592],
    120: [0, 0.43056, 0, 0.02778, 0.57153],
    121: [0.19444, 0.43056, 0.03588, 0.05556, 0.49028],
    122: [0, 0.43056, 0.04398, 0.05556, 0.46505],
    160: [0, 0, 0, 0, 0.25],
    915: [0, 0.68333, 0.13889, 0.08334, 0.61528],
    916: [0, 0.68333, 0, 0.16667, 0.83334],
    920: [0, 0.68333, 0.02778, 0.08334, 0.76278],
    923: [0, 0.68333, 0, 0.16667, 0.69445],
    926: [0, 0.68333, 0.07569, 0.08334, 0.74236],
    928: [0, 0.68333, 0.08125, 0.05556, 0.83125],
    931: [0, 0.68333, 0.05764, 0.08334, 0.77986],
    933: [0, 0.68333, 0.13889, 0.05556, 0.58333],
    934: [0, 0.68333, 0, 0.08334, 0.66667],
    936: [0, 0.68333, 0.11, 0.05556, 0.61222],
    937: [0, 0.68333, 0.05017, 0.08334, 0.7724],
    945: [0, 0.43056, 37e-4, 0.02778, 0.6397],
    946: [0.19444, 0.69444, 0.05278, 0.08334, 0.56563],
    947: [0.19444, 0.43056, 0.05556, 0, 0.51773],
    948: [0, 0.69444, 0.03785, 0.05556, 0.44444],
    949: [0, 0.43056, 0, 0.08334, 0.46632],
    950: [0.19444, 0.69444, 0.07378, 0.08334, 0.4375],
    951: [0.19444, 0.43056, 0.03588, 0.05556, 0.49653],
    952: [0, 0.69444, 0.02778, 0.08334, 0.46944],
    953: [0, 0.43056, 0, 0.05556, 0.35394],
    954: [0, 0.43056, 0, 0, 0.57616],
    955: [0, 0.69444, 0, 0, 0.58334],
    956: [0.19444, 0.43056, 0, 0.02778, 0.60255],
    957: [0, 0.43056, 0.06366, 0.02778, 0.49398],
    958: [0.19444, 0.69444, 0.04601, 0.11111, 0.4375],
    959: [0, 0.43056, 0, 0.05556, 0.48472],
    960: [0, 0.43056, 0.03588, 0, 0.57003],
    961: [0.19444, 0.43056, 0, 0.08334, 0.51702],
    962: [0.09722, 0.43056, 0.07986, 0.08334, 0.36285],
    963: [0, 0.43056, 0.03588, 0, 0.57141],
    964: [0, 0.43056, 0.1132, 0.02778, 0.43715],
    965: [0, 0.43056, 0.03588, 0.02778, 0.54028],
    966: [0.19444, 0.43056, 0, 0.08334, 0.65417],
    967: [0.19444, 0.43056, 0, 0.05556, 0.62569],
    968: [0.19444, 0.69444, 0.03588, 0.11111, 0.65139],
    969: [0, 0.43056, 0.03588, 0, 0.62245],
    977: [0, 0.69444, 0, 0.08334, 0.59144],
    981: [0.19444, 0.69444, 0, 0.08334, 0.59583],
    982: [0, 0.43056, 0.02778, 0, 0.82813],
    1009: [0.19444, 0.43056, 0, 0.08334, 0.51702],
    1013: [0, 0.43056, 0, 0.05556, 0.4059],
    57649: [0, 0.43056, 0, 0.02778, 0.32246],
    57911: [0.19444, 0.43056, 0, 0.08334, 0.38403]
  },
  "SansSerif-Bold": {
    32: [0, 0, 0, 0, 0.25],
    33: [0, 0.69444, 0, 0, 0.36667],
    34: [0, 0.69444, 0, 0, 0.55834],
    35: [0.19444, 0.69444, 0, 0, 0.91667],
    36: [0.05556, 0.75, 0, 0, 0.55],
    37: [0.05556, 0.75, 0, 0, 1.02912],
    38: [0, 0.69444, 0, 0, 0.83056],
    39: [0, 0.69444, 0, 0, 0.30556],
    40: [0.25, 0.75, 0, 0, 0.42778],
    41: [0.25, 0.75, 0, 0, 0.42778],
    42: [0, 0.75, 0, 0, 0.55],
    43: [0.11667, 0.61667, 0, 0, 0.85556],
    44: [0.10556, 0.13056, 0, 0, 0.30556],
    45: [0, 0.45833, 0, 0, 0.36667],
    46: [0, 0.13056, 0, 0, 0.30556],
    47: [0.25, 0.75, 0, 0, 0.55],
    48: [0, 0.69444, 0, 0, 0.55],
    49: [0, 0.69444, 0, 0, 0.55],
    50: [0, 0.69444, 0, 0, 0.55],
    51: [0, 0.69444, 0, 0, 0.55],
    52: [0, 0.69444, 0, 0, 0.55],
    53: [0, 0.69444, 0, 0, 0.55],
    54: [0, 0.69444, 0, 0, 0.55],
    55: [0, 0.69444, 0, 0, 0.55],
    56: [0, 0.69444, 0, 0, 0.55],
    57: [0, 0.69444, 0, 0, 0.55],
    58: [0, 0.45833, 0, 0, 0.30556],
    59: [0.10556, 0.45833, 0, 0, 0.30556],
    61: [-0.09375, 0.40625, 0, 0, 0.85556],
    63: [0, 0.69444, 0, 0, 0.51945],
    64: [0, 0.69444, 0, 0, 0.73334],
    65: [0, 0.69444, 0, 0, 0.73334],
    66: [0, 0.69444, 0, 0, 0.73334],
    67: [0, 0.69444, 0, 0, 0.70278],
    68: [0, 0.69444, 0, 0, 0.79445],
    69: [0, 0.69444, 0, 0, 0.64167],
    70: [0, 0.69444, 0, 0, 0.61111],
    71: [0, 0.69444, 0, 0, 0.73334],
    72: [0, 0.69444, 0, 0, 0.79445],
    73: [0, 0.69444, 0, 0, 0.33056],
    74: [0, 0.69444, 0, 0, 0.51945],
    75: [0, 0.69444, 0, 0, 0.76389],
    76: [0, 0.69444, 0, 0, 0.58056],
    77: [0, 0.69444, 0, 0, 0.97778],
    78: [0, 0.69444, 0, 0, 0.79445],
    79: [0, 0.69444, 0, 0, 0.79445],
    80: [0, 0.69444, 0, 0, 0.70278],
    81: [0.10556, 0.69444, 0, 0, 0.79445],
    82: [0, 0.69444, 0, 0, 0.70278],
    83: [0, 0.69444, 0, 0, 0.61111],
    84: [0, 0.69444, 0, 0, 0.73334],
    85: [0, 0.69444, 0, 0, 0.76389],
    86: [0, 0.69444, 0.01528, 0, 0.73334],
    87: [0, 0.69444, 0.01528, 0, 1.03889],
    88: [0, 0.69444, 0, 0, 0.73334],
    89: [0, 0.69444, 0.0275, 0, 0.73334],
    90: [0, 0.69444, 0, 0, 0.67223],
    91: [0.25, 0.75, 0, 0, 0.34306],
    93: [0.25, 0.75, 0, 0, 0.34306],
    94: [0, 0.69444, 0, 0, 0.55],
    95: [0.35, 0.10833, 0.03056, 0, 0.55],
    97: [0, 0.45833, 0, 0, 0.525],
    98: [0, 0.69444, 0, 0, 0.56111],
    99: [0, 0.45833, 0, 0, 0.48889],
    100: [0, 0.69444, 0, 0, 0.56111],
    101: [0, 0.45833, 0, 0, 0.51111],
    102: [0, 0.69444, 0.07639, 0, 0.33611],
    103: [0.19444, 0.45833, 0.01528, 0, 0.55],
    104: [0, 0.69444, 0, 0, 0.56111],
    105: [0, 0.69444, 0, 0, 0.25556],
    106: [0.19444, 0.69444, 0, 0, 0.28611],
    107: [0, 0.69444, 0, 0, 0.53056],
    108: [0, 0.69444, 0, 0, 0.25556],
    109: [0, 0.45833, 0, 0, 0.86667],
    110: [0, 0.45833, 0, 0, 0.56111],
    111: [0, 0.45833, 0, 0, 0.55],
    112: [0.19444, 0.45833, 0, 0, 0.56111],
    113: [0.19444, 0.45833, 0, 0, 0.56111],
    114: [0, 0.45833, 0.01528, 0, 0.37222],
    115: [0, 0.45833, 0, 0, 0.42167],
    116: [0, 0.58929, 0, 0, 0.40417],
    117: [0, 0.45833, 0, 0, 0.56111],
    118: [0, 0.45833, 0.01528, 0, 0.5],
    119: [0, 0.45833, 0.01528, 0, 0.74445],
    120: [0, 0.45833, 0, 0, 0.5],
    121: [0.19444, 0.45833, 0.01528, 0, 0.5],
    122: [0, 0.45833, 0, 0, 0.47639],
    126: [0.35, 0.34444, 0, 0, 0.55],
    160: [0, 0, 0, 0, 0.25],
    168: [0, 0.69444, 0, 0, 0.55],
    176: [0, 0.69444, 0, 0, 0.73334],
    180: [0, 0.69444, 0, 0, 0.55],
    184: [0.17014, 0, 0, 0, 0.48889],
    305: [0, 0.45833, 0, 0, 0.25556],
    567: [0.19444, 0.45833, 0, 0, 0.28611],
    710: [0, 0.69444, 0, 0, 0.55],
    711: [0, 0.63542, 0, 0, 0.55],
    713: [0, 0.63778, 0, 0, 0.55],
    728: [0, 0.69444, 0, 0, 0.55],
    729: [0, 0.69444, 0, 0, 0.30556],
    730: [0, 0.69444, 0, 0, 0.73334],
    732: [0, 0.69444, 0, 0, 0.55],
    733: [0, 0.69444, 0, 0, 0.55],
    915: [0, 0.69444, 0, 0, 0.58056],
    916: [0, 0.69444, 0, 0, 0.91667],
    920: [0, 0.69444, 0, 0, 0.85556],
    923: [0, 0.69444, 0, 0, 0.67223],
    926: [0, 0.69444, 0, 0, 0.73334],
    928: [0, 0.69444, 0, 0, 0.79445],
    931: [0, 0.69444, 0, 0, 0.79445],
    933: [0, 0.69444, 0, 0, 0.85556],
    934: [0, 0.69444, 0, 0, 0.79445],
    936: [0, 0.69444, 0, 0, 0.85556],
    937: [0, 0.69444, 0, 0, 0.79445],
    8211: [0, 0.45833, 0.03056, 0, 0.55],
    8212: [0, 0.45833, 0.03056, 0, 1.10001],
    8216: [0, 0.69444, 0, 0, 0.30556],
    8217: [0, 0.69444, 0, 0, 0.30556],
    8220: [0, 0.69444, 0, 0, 0.55834],
    8221: [0, 0.69444, 0, 0, 0.55834]
  },
  "SansSerif-Italic": {
    32: [0, 0, 0, 0, 0.25],
    33: [0, 0.69444, 0.05733, 0, 0.31945],
    34: [0, 0.69444, 316e-5, 0, 0.5],
    35: [0.19444, 0.69444, 0.05087, 0, 0.83334],
    36: [0.05556, 0.75, 0.11156, 0, 0.5],
    37: [0.05556, 0.75, 0.03126, 0, 0.83334],
    38: [0, 0.69444, 0.03058, 0, 0.75834],
    39: [0, 0.69444, 0.07816, 0, 0.27778],
    40: [0.25, 0.75, 0.13164, 0, 0.38889],
    41: [0.25, 0.75, 0.02536, 0, 0.38889],
    42: [0, 0.75, 0.11775, 0, 0.5],
    43: [0.08333, 0.58333, 0.02536, 0, 0.77778],
    44: [0.125, 0.08333, 0, 0, 0.27778],
    45: [0, 0.44444, 0.01946, 0, 0.33333],
    46: [0, 0.08333, 0, 0, 0.27778],
    47: [0.25, 0.75, 0.13164, 0, 0.5],
    48: [0, 0.65556, 0.11156, 0, 0.5],
    49: [0, 0.65556, 0.11156, 0, 0.5],
    50: [0, 0.65556, 0.11156, 0, 0.5],
    51: [0, 0.65556, 0.11156, 0, 0.5],
    52: [0, 0.65556, 0.11156, 0, 0.5],
    53: [0, 0.65556, 0.11156, 0, 0.5],
    54: [0, 0.65556, 0.11156, 0, 0.5],
    55: [0, 0.65556, 0.11156, 0, 0.5],
    56: [0, 0.65556, 0.11156, 0, 0.5],
    57: [0, 0.65556, 0.11156, 0, 0.5],
    58: [0, 0.44444, 0.02502, 0, 0.27778],
    59: [0.125, 0.44444, 0.02502, 0, 0.27778],
    61: [-0.13, 0.37, 0.05087, 0, 0.77778],
    63: [0, 0.69444, 0.11809, 0, 0.47222],
    64: [0, 0.69444, 0.07555, 0, 0.66667],
    65: [0, 0.69444, 0, 0, 0.66667],
    66: [0, 0.69444, 0.08293, 0, 0.66667],
    67: [0, 0.69444, 0.11983, 0, 0.63889],
    68: [0, 0.69444, 0.07555, 0, 0.72223],
    69: [0, 0.69444, 0.11983, 0, 0.59722],
    70: [0, 0.69444, 0.13372, 0, 0.56945],
    71: [0, 0.69444, 0.11983, 0, 0.66667],
    72: [0, 0.69444, 0.08094, 0, 0.70834],
    73: [0, 0.69444, 0.13372, 0, 0.27778],
    74: [0, 0.69444, 0.08094, 0, 0.47222],
    75: [0, 0.69444, 0.11983, 0, 0.69445],
    76: [0, 0.69444, 0, 0, 0.54167],
    77: [0, 0.69444, 0.08094, 0, 0.875],
    78: [0, 0.69444, 0.08094, 0, 0.70834],
    79: [0, 0.69444, 0.07555, 0, 0.73611],
    80: [0, 0.69444, 0.08293, 0, 0.63889],
    81: [0.125, 0.69444, 0.07555, 0, 0.73611],
    82: [0, 0.69444, 0.08293, 0, 0.64584],
    83: [0, 0.69444, 0.09205, 0, 0.55556],
    84: [0, 0.69444, 0.13372, 0, 0.68056],
    85: [0, 0.69444, 0.08094, 0, 0.6875],
    86: [0, 0.69444, 0.1615, 0, 0.66667],
    87: [0, 0.69444, 0.1615, 0, 0.94445],
    88: [0, 0.69444, 0.13372, 0, 0.66667],
    89: [0, 0.69444, 0.17261, 0, 0.66667],
    90: [0, 0.69444, 0.11983, 0, 0.61111],
    91: [0.25, 0.75, 0.15942, 0, 0.28889],
    93: [0.25, 0.75, 0.08719, 0, 0.28889],
    94: [0, 0.69444, 0.0799, 0, 0.5],
    95: [0.35, 0.09444, 0.08616, 0, 0.5],
    97: [0, 0.44444, 981e-5, 0, 0.48056],
    98: [0, 0.69444, 0.03057, 0, 0.51667],
    99: [0, 0.44444, 0.08336, 0, 0.44445],
    100: [0, 0.69444, 0.09483, 0, 0.51667],
    101: [0, 0.44444, 0.06778, 0, 0.44445],
    102: [0, 0.69444, 0.21705, 0, 0.30556],
    103: [0.19444, 0.44444, 0.10836, 0, 0.5],
    104: [0, 0.69444, 0.01778, 0, 0.51667],
    105: [0, 0.67937, 0.09718, 0, 0.23889],
    106: [0.19444, 0.67937, 0.09162, 0, 0.26667],
    107: [0, 0.69444, 0.08336, 0, 0.48889],
    108: [0, 0.69444, 0.09483, 0, 0.23889],
    109: [0, 0.44444, 0.01778, 0, 0.79445],
    110: [0, 0.44444, 0.01778, 0, 0.51667],
    111: [0, 0.44444, 0.06613, 0, 0.5],
    112: [0.19444, 0.44444, 0.0389, 0, 0.51667],
    113: [0.19444, 0.44444, 0.04169, 0, 0.51667],
    114: [0, 0.44444, 0.10836, 0, 0.34167],
    115: [0, 0.44444, 0.0778, 0, 0.38333],
    116: [0, 0.57143, 0.07225, 0, 0.36111],
    117: [0, 0.44444, 0.04169, 0, 0.51667],
    118: [0, 0.44444, 0.10836, 0, 0.46111],
    119: [0, 0.44444, 0.10836, 0, 0.68334],
    120: [0, 0.44444, 0.09169, 0, 0.46111],
    121: [0.19444, 0.44444, 0.10836, 0, 0.46111],
    122: [0, 0.44444, 0.08752, 0, 0.43472],
    126: [0.35, 0.32659, 0.08826, 0, 0.5],
    160: [0, 0, 0, 0, 0.25],
    168: [0, 0.67937, 0.06385, 0, 0.5],
    176: [0, 0.69444, 0, 0, 0.73752],
    184: [0.17014, 0, 0, 0, 0.44445],
    305: [0, 0.44444, 0.04169, 0, 0.23889],
    567: [0.19444, 0.44444, 0.04169, 0, 0.26667],
    710: [0, 0.69444, 0.0799, 0, 0.5],
    711: [0, 0.63194, 0.08432, 0, 0.5],
    713: [0, 0.60889, 0.08776, 0, 0.5],
    714: [0, 0.69444, 0.09205, 0, 0.5],
    715: [0, 0.69444, 0, 0, 0.5],
    728: [0, 0.69444, 0.09483, 0, 0.5],
    729: [0, 0.67937, 0.07774, 0, 0.27778],
    730: [0, 0.69444, 0, 0, 0.73752],
    732: [0, 0.67659, 0.08826, 0, 0.5],
    733: [0, 0.69444, 0.09205, 0, 0.5],
    915: [0, 0.69444, 0.13372, 0, 0.54167],
    916: [0, 0.69444, 0, 0, 0.83334],
    920: [0, 0.69444, 0.07555, 0, 0.77778],
    923: [0, 0.69444, 0, 0, 0.61111],
    926: [0, 0.69444, 0.12816, 0, 0.66667],
    928: [0, 0.69444, 0.08094, 0, 0.70834],
    931: [0, 0.69444, 0.11983, 0, 0.72222],
    933: [0, 0.69444, 0.09031, 0, 0.77778],
    934: [0, 0.69444, 0.04603, 0, 0.72222],
    936: [0, 0.69444, 0.09031, 0, 0.77778],
    937: [0, 0.69444, 0.08293, 0, 0.72222],
    8211: [0, 0.44444, 0.08616, 0, 0.5],
    8212: [0, 0.44444, 0.08616, 0, 1],
    8216: [0, 0.69444, 0.07816, 0, 0.27778],
    8217: [0, 0.69444, 0.07816, 0, 0.27778],
    8220: [0, 0.69444, 0.14205, 0, 0.5],
    8221: [0, 0.69444, 316e-5, 0, 0.5]
  },
  "SansSerif-Regular": {
    32: [0, 0, 0, 0, 0.25],
    33: [0, 0.69444, 0, 0, 0.31945],
    34: [0, 0.69444, 0, 0, 0.5],
    35: [0.19444, 0.69444, 0, 0, 0.83334],
    36: [0.05556, 0.75, 0, 0, 0.5],
    37: [0.05556, 0.75, 0, 0, 0.83334],
    38: [0, 0.69444, 0, 0, 0.75834],
    39: [0, 0.69444, 0, 0, 0.27778],
    40: [0.25, 0.75, 0, 0, 0.38889],
    41: [0.25, 0.75, 0, 0, 0.38889],
    42: [0, 0.75, 0, 0, 0.5],
    43: [0.08333, 0.58333, 0, 0, 0.77778],
    44: [0.125, 0.08333, 0, 0, 0.27778],
    45: [0, 0.44444, 0, 0, 0.33333],
    46: [0, 0.08333, 0, 0, 0.27778],
    47: [0.25, 0.75, 0, 0, 0.5],
    48: [0, 0.65556, 0, 0, 0.5],
    49: [0, 0.65556, 0, 0, 0.5],
    50: [0, 0.65556, 0, 0, 0.5],
    51: [0, 0.65556, 0, 0, 0.5],
    52: [0, 0.65556, 0, 0, 0.5],
    53: [0, 0.65556, 0, 0, 0.5],
    54: [0, 0.65556, 0, 0, 0.5],
    55: [0, 0.65556, 0, 0, 0.5],
    56: [0, 0.65556, 0, 0, 0.5],
    57: [0, 0.65556, 0, 0, 0.5],
    58: [0, 0.44444, 0, 0, 0.27778],
    59: [0.125, 0.44444, 0, 0, 0.27778],
    61: [-0.13, 0.37, 0, 0, 0.77778],
    63: [0, 0.69444, 0, 0, 0.47222],
    64: [0, 0.69444, 0, 0, 0.66667],
    65: [0, 0.69444, 0, 0, 0.66667],
    66: [0, 0.69444, 0, 0, 0.66667],
    67: [0, 0.69444, 0, 0, 0.63889],
    68: [0, 0.69444, 0, 0, 0.72223],
    69: [0, 0.69444, 0, 0, 0.59722],
    70: [0, 0.69444, 0, 0, 0.56945],
    71: [0, 0.69444, 0, 0, 0.66667],
    72: [0, 0.69444, 0, 0, 0.70834],
    73: [0, 0.69444, 0, 0, 0.27778],
    74: [0, 0.69444, 0, 0, 0.47222],
    75: [0, 0.69444, 0, 0, 0.69445],
    76: [0, 0.69444, 0, 0, 0.54167],
    77: [0, 0.69444, 0, 0, 0.875],
    78: [0, 0.69444, 0, 0, 0.70834],
    79: [0, 0.69444, 0, 0, 0.73611],
    80: [0, 0.69444, 0, 0, 0.63889],
    81: [0.125, 0.69444, 0, 0, 0.73611],
    82: [0, 0.69444, 0, 0, 0.64584],
    83: [0, 0.69444, 0, 0, 0.55556],
    84: [0, 0.69444, 0, 0, 0.68056],
    85: [0, 0.69444, 0, 0, 0.6875],
    86: [0, 0.69444, 0.01389, 0, 0.66667],
    87: [0, 0.69444, 0.01389, 0, 0.94445],
    88: [0, 0.69444, 0, 0, 0.66667],
    89: [0, 0.69444, 0.025, 0, 0.66667],
    90: [0, 0.69444, 0, 0, 0.61111],
    91: [0.25, 0.75, 0, 0, 0.28889],
    93: [0.25, 0.75, 0, 0, 0.28889],
    94: [0, 0.69444, 0, 0, 0.5],
    95: [0.35, 0.09444, 0.02778, 0, 0.5],
    97: [0, 0.44444, 0, 0, 0.48056],
    98: [0, 0.69444, 0, 0, 0.51667],
    99: [0, 0.44444, 0, 0, 0.44445],
    100: [0, 0.69444, 0, 0, 0.51667],
    101: [0, 0.44444, 0, 0, 0.44445],
    102: [0, 0.69444, 0.06944, 0, 0.30556],
    103: [0.19444, 0.44444, 0.01389, 0, 0.5],
    104: [0, 0.69444, 0, 0, 0.51667],
    105: [0, 0.67937, 0, 0, 0.23889],
    106: [0.19444, 0.67937, 0, 0, 0.26667],
    107: [0, 0.69444, 0, 0, 0.48889],
    108: [0, 0.69444, 0, 0, 0.23889],
    109: [0, 0.44444, 0, 0, 0.79445],
    110: [0, 0.44444, 0, 0, 0.51667],
    111: [0, 0.44444, 0, 0, 0.5],
    112: [0.19444, 0.44444, 0, 0, 0.51667],
    113: [0.19444, 0.44444, 0, 0, 0.51667],
    114: [0, 0.44444, 0.01389, 0, 0.34167],
    115: [0, 0.44444, 0, 0, 0.38333],
    116: [0, 0.57143, 0, 0, 0.36111],
    117: [0, 0.44444, 0, 0, 0.51667],
    118: [0, 0.44444, 0.01389, 0, 0.46111],
    119: [0, 0.44444, 0.01389, 0, 0.68334],
    120: [0, 0.44444, 0, 0, 0.46111],
    121: [0.19444, 0.44444, 0.01389, 0, 0.46111],
    122: [0, 0.44444, 0, 0, 0.43472],
    126: [0.35, 0.32659, 0, 0, 0.5],
    160: [0, 0, 0, 0, 0.25],
    168: [0, 0.67937, 0, 0, 0.5],
    176: [0, 0.69444, 0, 0, 0.66667],
    184: [0.17014, 0, 0, 0, 0.44445],
    305: [0, 0.44444, 0, 0, 0.23889],
    567: [0.19444, 0.44444, 0, 0, 0.26667],
    710: [0, 0.69444, 0, 0, 0.5],
    711: [0, 0.63194, 0, 0, 0.5],
    713: [0, 0.60889, 0, 0, 0.5],
    714: [0, 0.69444, 0, 0, 0.5],
    715: [0, 0.69444, 0, 0, 0.5],
    728: [0, 0.69444, 0, 0, 0.5],
    729: [0, 0.67937, 0, 0, 0.27778],
    730: [0, 0.69444, 0, 0, 0.66667],
    732: [0, 0.67659, 0, 0, 0.5],
    733: [0, 0.69444, 0, 0, 0.5],
    915: [0, 0.69444, 0, 0, 0.54167],
    916: [0, 0.69444, 0, 0, 0.83334],
    920: [0, 0.69444, 0, 0, 0.77778],
    923: [0, 0.69444, 0, 0, 0.61111],
    926: [0, 0.69444, 0, 0, 0.66667],
    928: [0, 0.69444, 0, 0, 0.70834],
    931: [0, 0.69444, 0, 0, 0.72222],
    933: [0, 0.69444, 0, 0, 0.77778],
    934: [0, 0.69444, 0, 0, 0.72222],
    936: [0, 0.69444, 0, 0, 0.77778],
    937: [0, 0.69444, 0, 0, 0.72222],
    8211: [0, 0.44444, 0.02778, 0, 0.5],
    8212: [0, 0.44444, 0.02778, 0, 1],
    8216: [0, 0.69444, 0, 0, 0.27778],
    8217: [0, 0.69444, 0, 0, 0.27778],
    8220: [0, 0.69444, 0, 0, 0.5],
    8221: [0, 0.69444, 0, 0, 0.5]
  },
  "Script-Regular": {
    32: [0, 0, 0, 0, 0.25],
    65: [0, 0.7, 0.22925, 0, 0.80253],
    66: [0, 0.7, 0.04087, 0, 0.90757],
    67: [0, 0.7, 0.1689, 0, 0.66619],
    68: [0, 0.7, 0.09371, 0, 0.77443],
    69: [0, 0.7, 0.18583, 0, 0.56162],
    70: [0, 0.7, 0.13634, 0, 0.89544],
    71: [0, 0.7, 0.17322, 0, 0.60961],
    72: [0, 0.7, 0.29694, 0, 0.96919],
    73: [0, 0.7, 0.19189, 0, 0.80907],
    74: [0.27778, 0.7, 0.19189, 0, 1.05159],
    75: [0, 0.7, 0.31259, 0, 0.91364],
    76: [0, 0.7, 0.19189, 0, 0.87373],
    77: [0, 0.7, 0.15981, 0, 1.08031],
    78: [0, 0.7, 0.3525, 0, 0.9015],
    79: [0, 0.7, 0.08078, 0, 0.73787],
    80: [0, 0.7, 0.08078, 0, 1.01262],
    81: [0, 0.7, 0.03305, 0, 0.88282],
    82: [0, 0.7, 0.06259, 0, 0.85],
    83: [0, 0.7, 0.19189, 0, 0.86767],
    84: [0, 0.7, 0.29087, 0, 0.74697],
    85: [0, 0.7, 0.25815, 0, 0.79996],
    86: [0, 0.7, 0.27523, 0, 0.62204],
    87: [0, 0.7, 0.27523, 0, 0.80532],
    88: [0, 0.7, 0.26006, 0, 0.94445],
    89: [0, 0.7, 0.2939, 0, 0.70961],
    90: [0, 0.7, 0.24037, 0, 0.8212],
    160: [0, 0, 0, 0, 0.25]
  },
  "Size1-Regular": {
    32: [0, 0, 0, 0, 0.25],
    40: [0.35001, 0.85, 0, 0, 0.45834],
    41: [0.35001, 0.85, 0, 0, 0.45834],
    47: [0.35001, 0.85, 0, 0, 0.57778],
    91: [0.35001, 0.85, 0, 0, 0.41667],
    92: [0.35001, 0.85, 0, 0, 0.57778],
    93: [0.35001, 0.85, 0, 0, 0.41667],
    123: [0.35001, 0.85, 0, 0, 0.58334],
    125: [0.35001, 0.85, 0, 0, 0.58334],
    160: [0, 0, 0, 0, 0.25],
    710: [0, 0.72222, 0, 0, 0.55556],
    732: [0, 0.72222, 0, 0, 0.55556],
    770: [0, 0.72222, 0, 0, 0.55556],
    771: [0, 0.72222, 0, 0, 0.55556],
    8214: [-99e-5, 0.601, 0, 0, 0.77778],
    8593: [1e-5, 0.6, 0, 0, 0.66667],
    8595: [1e-5, 0.6, 0, 0, 0.66667],
    8657: [1e-5, 0.6, 0, 0, 0.77778],
    8659: [1e-5, 0.6, 0, 0, 0.77778],
    8719: [0.25001, 0.75, 0, 0, 0.94445],
    8720: [0.25001, 0.75, 0, 0, 0.94445],
    8721: [0.25001, 0.75, 0, 0, 1.05556],
    8730: [0.35001, 0.85, 0, 0, 1],
    8739: [-599e-5, 0.606, 0, 0, 0.33333],
    8741: [-599e-5, 0.606, 0, 0, 0.55556],
    8747: [0.30612, 0.805, 0.19445, 0, 0.47222],
    8748: [0.306, 0.805, 0.19445, 0, 0.47222],
    8749: [0.306, 0.805, 0.19445, 0, 0.47222],
    8750: [0.30612, 0.805, 0.19445, 0, 0.47222],
    8896: [0.25001, 0.75, 0, 0, 0.83334],
    8897: [0.25001, 0.75, 0, 0, 0.83334],
    8898: [0.25001, 0.75, 0, 0, 0.83334],
    8899: [0.25001, 0.75, 0, 0, 0.83334],
    8968: [0.35001, 0.85, 0, 0, 0.47222],
    8969: [0.35001, 0.85, 0, 0, 0.47222],
    8970: [0.35001, 0.85, 0, 0, 0.47222],
    8971: [0.35001, 0.85, 0, 0, 0.47222],
    9168: [-99e-5, 0.601, 0, 0, 0.66667],
    10216: [0.35001, 0.85, 0, 0, 0.47222],
    10217: [0.35001, 0.85, 0, 0, 0.47222],
    10752: [0.25001, 0.75, 0, 0, 1.11111],
    10753: [0.25001, 0.75, 0, 0, 1.11111],
    10754: [0.25001, 0.75, 0, 0, 1.11111],
    10756: [0.25001, 0.75, 0, 0, 0.83334],
    10758: [0.25001, 0.75, 0, 0, 0.83334]
  },
  "Size2-Regular": {
    32: [0, 0, 0, 0, 0.25],
    40: [0.65002, 1.15, 0, 0, 0.59722],
    41: [0.65002, 1.15, 0, 0, 0.59722],
    47: [0.65002, 1.15, 0, 0, 0.81111],
    91: [0.65002, 1.15, 0, 0, 0.47222],
    92: [0.65002, 1.15, 0, 0, 0.81111],
    93: [0.65002, 1.15, 0, 0, 0.47222],
    123: [0.65002, 1.15, 0, 0, 0.66667],
    125: [0.65002, 1.15, 0, 0, 0.66667],
    160: [0, 0, 0, 0, 0.25],
    710: [0, 0.75, 0, 0, 1],
    732: [0, 0.75, 0, 0, 1],
    770: [0, 0.75, 0, 0, 1],
    771: [0, 0.75, 0, 0, 1],
    8719: [0.55001, 1.05, 0, 0, 1.27778],
    8720: [0.55001, 1.05, 0, 0, 1.27778],
    8721: [0.55001, 1.05, 0, 0, 1.44445],
    8730: [0.65002, 1.15, 0, 0, 1],
    8747: [0.86225, 1.36, 0.44445, 0, 0.55556],
    8748: [0.862, 1.36, 0.44445, 0, 0.55556],
    8749: [0.862, 1.36, 0.44445, 0, 0.55556],
    8750: [0.86225, 1.36, 0.44445, 0, 0.55556],
    8896: [0.55001, 1.05, 0, 0, 1.11111],
    8897: [0.55001, 1.05, 0, 0, 1.11111],
    8898: [0.55001, 1.05, 0, 0, 1.11111],
    8899: [0.55001, 1.05, 0, 0, 1.11111],
    8968: [0.65002, 1.15, 0, 0, 0.52778],
    8969: [0.65002, 1.15, 0, 0, 0.52778],
    8970: [0.65002, 1.15, 0, 0, 0.52778],
    8971: [0.65002, 1.15, 0, 0, 0.52778],
    10216: [0.65002, 1.15, 0, 0, 0.61111],
    10217: [0.65002, 1.15, 0, 0, 0.61111],
    10752: [0.55001, 1.05, 0, 0, 1.51112],
    10753: [0.55001, 1.05, 0, 0, 1.51112],
    10754: [0.55001, 1.05, 0, 0, 1.51112],
    10756: [0.55001, 1.05, 0, 0, 1.11111],
    10758: [0.55001, 1.05, 0, 0, 1.11111]
  },
  "Size3-Regular": {
    32: [0, 0, 0, 0, 0.25],
    40: [0.95003, 1.45, 0, 0, 0.73611],
    41: [0.95003, 1.45, 0, 0, 0.73611],
    47: [0.95003, 1.45, 0, 0, 1.04445],
    91: [0.95003, 1.45, 0, 0, 0.52778],
    92: [0.95003, 1.45, 0, 0, 1.04445],
    93: [0.95003, 1.45, 0, 0, 0.52778],
    123: [0.95003, 1.45, 0, 0, 0.75],
    125: [0.95003, 1.45, 0, 0, 0.75],
    160: [0, 0, 0, 0, 0.25],
    710: [0, 0.75, 0, 0, 1.44445],
    732: [0, 0.75, 0, 0, 1.44445],
    770: [0, 0.75, 0, 0, 1.44445],
    771: [0, 0.75, 0, 0, 1.44445],
    8730: [0.95003, 1.45, 0, 0, 1],
    8968: [0.95003, 1.45, 0, 0, 0.58334],
    8969: [0.95003, 1.45, 0, 0, 0.58334],
    8970: [0.95003, 1.45, 0, 0, 0.58334],
    8971: [0.95003, 1.45, 0, 0, 0.58334],
    10216: [0.95003, 1.45, 0, 0, 0.75],
    10217: [0.95003, 1.45, 0, 0, 0.75]
  },
  "Size4-Regular": {
    32: [0, 0, 0, 0, 0.25],
    40: [1.25003, 1.75, 0, 0, 0.79167],
    41: [1.25003, 1.75, 0, 0, 0.79167],
    47: [1.25003, 1.75, 0, 0, 1.27778],
    91: [1.25003, 1.75, 0, 0, 0.58334],
    92: [1.25003, 1.75, 0, 0, 1.27778],
    93: [1.25003, 1.75, 0, 0, 0.58334],
    123: [1.25003, 1.75, 0, 0, 0.80556],
    125: [1.25003, 1.75, 0, 0, 0.80556],
    160: [0, 0, 0, 0, 0.25],
    710: [0, 0.825, 0, 0, 1.8889],
    732: [0, 0.825, 0, 0, 1.8889],
    770: [0, 0.825, 0, 0, 1.8889],
    771: [0, 0.825, 0, 0, 1.8889],
    8730: [1.25003, 1.75, 0, 0, 1],
    8968: [1.25003, 1.75, 0, 0, 0.63889],
    8969: [1.25003, 1.75, 0, 0, 0.63889],
    8970: [1.25003, 1.75, 0, 0, 0.63889],
    8971: [1.25003, 1.75, 0, 0, 0.63889],
    9115: [0.64502, 1.155, 0, 0, 0.875],
    9116: [1e-5, 0.6, 0, 0, 0.875],
    9117: [0.64502, 1.155, 0, 0, 0.875],
    9118: [0.64502, 1.155, 0, 0, 0.875],
    9119: [1e-5, 0.6, 0, 0, 0.875],
    9120: [0.64502, 1.155, 0, 0, 0.875],
    9121: [0.64502, 1.155, 0, 0, 0.66667],
    9122: [-99e-5, 0.601, 0, 0, 0.66667],
    9123: [0.64502, 1.155, 0, 0, 0.66667],
    9124: [0.64502, 1.155, 0, 0, 0.66667],
    9125: [-99e-5, 0.601, 0, 0, 0.66667],
    9126: [0.64502, 1.155, 0, 0, 0.66667],
    9127: [1e-5, 0.9, 0, 0, 0.88889],
    9128: [0.65002, 1.15, 0, 0, 0.88889],
    9129: [0.90001, 0, 0, 0, 0.88889],
    9130: [0, 0.3, 0, 0, 0.88889],
    9131: [1e-5, 0.9, 0, 0, 0.88889],
    9132: [0.65002, 1.15, 0, 0, 0.88889],
    9133: [0.90001, 0, 0, 0, 0.88889],
    9143: [0.88502, 0.915, 0, 0, 1.05556],
    10216: [1.25003, 1.75, 0, 0, 0.80556],
    10217: [1.25003, 1.75, 0, 0, 0.80556],
    57344: [-499e-5, 0.605, 0, 0, 1.05556],
    57345: [-499e-5, 0.605, 0, 0, 1.05556],
    57680: [0, 0.12, 0, 0, 0.45],
    57681: [0, 0.12, 0, 0, 0.45],
    57682: [0, 0.12, 0, 0, 0.45],
    57683: [0, 0.12, 0, 0, 0.45]
  },
  "Typewriter-Regular": {
    32: [0, 0, 0, 0, 0.525],
    33: [0, 0.61111, 0, 0, 0.525],
    34: [0, 0.61111, 0, 0, 0.525],
    35: [0, 0.61111, 0, 0, 0.525],
    36: [0.08333, 0.69444, 0, 0, 0.525],
    37: [0.08333, 0.69444, 0, 0, 0.525],
    38: [0, 0.61111, 0, 0, 0.525],
    39: [0, 0.61111, 0, 0, 0.525],
    40: [0.08333, 0.69444, 0, 0, 0.525],
    41: [0.08333, 0.69444, 0, 0, 0.525],
    42: [0, 0.52083, 0, 0, 0.525],
    43: [-0.08056, 0.53055, 0, 0, 0.525],
    44: [0.13889, 0.125, 0, 0, 0.525],
    45: [-0.08056, 0.53055, 0, 0, 0.525],
    46: [0, 0.125, 0, 0, 0.525],
    47: [0.08333, 0.69444, 0, 0, 0.525],
    48: [0, 0.61111, 0, 0, 0.525],
    49: [0, 0.61111, 0, 0, 0.525],
    50: [0, 0.61111, 0, 0, 0.525],
    51: [0, 0.61111, 0, 0, 0.525],
    52: [0, 0.61111, 0, 0, 0.525],
    53: [0, 0.61111, 0, 0, 0.525],
    54: [0, 0.61111, 0, 0, 0.525],
    55: [0, 0.61111, 0, 0, 0.525],
    56: [0, 0.61111, 0, 0, 0.525],
    57: [0, 0.61111, 0, 0, 0.525],
    58: [0, 0.43056, 0, 0, 0.525],
    59: [0.13889, 0.43056, 0, 0, 0.525],
    60: [-0.05556, 0.55556, 0, 0, 0.525],
    61: [-0.19549, 0.41562, 0, 0, 0.525],
    62: [-0.05556, 0.55556, 0, 0, 0.525],
    63: [0, 0.61111, 0, 0, 0.525],
    64: [0, 0.61111, 0, 0, 0.525],
    65: [0, 0.61111, 0, 0, 0.525],
    66: [0, 0.61111, 0, 0, 0.525],
    67: [0, 0.61111, 0, 0, 0.525],
    68: [0, 0.61111, 0, 0, 0.525],
    69: [0, 0.61111, 0, 0, 0.525],
    70: [0, 0.61111, 0, 0, 0.525],
    71: [0, 0.61111, 0, 0, 0.525],
    72: [0, 0.61111, 0, 0, 0.525],
    73: [0, 0.61111, 0, 0, 0.525],
    74: [0, 0.61111, 0, 0, 0.525],
    75: [0, 0.61111, 0, 0, 0.525],
    76: [0, 0.61111, 0, 0, 0.525],
    77: [0, 0.61111, 0, 0, 0.525],
    78: [0, 0.61111, 0, 0, 0.525],
    79: [0, 0.61111, 0, 0, 0.525],
    80: [0, 0.61111, 0, 0, 0.525],
    81: [0.13889, 0.61111, 0, 0, 0.525],
    82: [0, 0.61111, 0, 0, 0.525],
    83: [0, 0.61111, 0, 0, 0.525],
    84: [0, 0.61111, 0, 0, 0.525],
    85: [0, 0.61111, 0, 0, 0.525],
    86: [0, 0.61111, 0, 0, 0.525],
    87: [0, 0.61111, 0, 0, 0.525],
    88: [0, 0.61111, 0, 0, 0.525],
    89: [0, 0.61111, 0, 0, 0.525],
    90: [0, 0.61111, 0, 0, 0.525],
    91: [0.08333, 0.69444, 0, 0, 0.525],
    92: [0.08333, 0.69444, 0, 0, 0.525],
    93: [0.08333, 0.69444, 0, 0, 0.525],
    94: [0, 0.61111, 0, 0, 0.525],
    95: [0.09514, 0, 0, 0, 0.525],
    96: [0, 0.61111, 0, 0, 0.525],
    97: [0, 0.43056, 0, 0, 0.525],
    98: [0, 0.61111, 0, 0, 0.525],
    99: [0, 0.43056, 0, 0, 0.525],
    100: [0, 0.61111, 0, 0, 0.525],
    101: [0, 0.43056, 0, 0, 0.525],
    102: [0, 0.61111, 0, 0, 0.525],
    103: [0.22222, 0.43056, 0, 0, 0.525],
    104: [0, 0.61111, 0, 0, 0.525],
    105: [0, 0.61111, 0, 0, 0.525],
    106: [0.22222, 0.61111, 0, 0, 0.525],
    107: [0, 0.61111, 0, 0, 0.525],
    108: [0, 0.61111, 0, 0, 0.525],
    109: [0, 0.43056, 0, 0, 0.525],
    110: [0, 0.43056, 0, 0, 0.525],
    111: [0, 0.43056, 0, 0, 0.525],
    112: [0.22222, 0.43056, 0, 0, 0.525],
    113: [0.22222, 0.43056, 0, 0, 0.525],
    114: [0, 0.43056, 0, 0, 0.525],
    115: [0, 0.43056, 0, 0, 0.525],
    116: [0, 0.55358, 0, 0, 0.525],
    117: [0, 0.43056, 0, 0, 0.525],
    118: [0, 0.43056, 0, 0, 0.525],
    119: [0, 0.43056, 0, 0, 0.525],
    120: [0, 0.43056, 0, 0, 0.525],
    121: [0.22222, 0.43056, 0, 0, 0.525],
    122: [0, 0.43056, 0, 0, 0.525],
    123: [0.08333, 0.69444, 0, 0, 0.525],
    124: [0.08333, 0.69444, 0, 0, 0.525],
    125: [0.08333, 0.69444, 0, 0, 0.525],
    126: [0, 0.61111, 0, 0, 0.525],
    127: [0, 0.61111, 0, 0, 0.525],
    160: [0, 0, 0, 0, 0.525],
    176: [0, 0.61111, 0, 0, 0.525],
    184: [0.19445, 0, 0, 0, 0.525],
    305: [0, 0.43056, 0, 0, 0.525],
    567: [0.22222, 0.43056, 0, 0, 0.525],
    711: [0, 0.56597, 0, 0, 0.525],
    713: [0, 0.56555, 0, 0, 0.525],
    714: [0, 0.61111, 0, 0, 0.525],
    715: [0, 0.61111, 0, 0, 0.525],
    728: [0, 0.61111, 0, 0, 0.525],
    730: [0, 0.61111, 0, 0, 0.525],
    770: [0, 0.61111, 0, 0, 0.525],
    771: [0, 0.61111, 0, 0, 0.525],
    776: [0, 0.61111, 0, 0, 0.525],
    915: [0, 0.61111, 0, 0, 0.525],
    916: [0, 0.61111, 0, 0, 0.525],
    920: [0, 0.61111, 0, 0, 0.525],
    923: [0, 0.61111, 0, 0, 0.525],
    926: [0, 0.61111, 0, 0, 0.525],
    928: [0, 0.61111, 0, 0, 0.525],
    931: [0, 0.61111, 0, 0, 0.525],
    933: [0, 0.61111, 0, 0, 0.525],
    934: [0, 0.61111, 0, 0, 0.525],
    936: [0, 0.61111, 0, 0, 0.525],
    937: [0, 0.61111, 0, 0, 0.525],
    8216: [0, 0.61111, 0, 0, 0.525],
    8217: [0, 0.61111, 0, 0, 0.525],
    8242: [0, 0.61111, 0, 0, 0.525],
    9251: [0.11111, 0.21944, 0, 0, 0.525]
  }
}, xa = {
  slant: [0.25, 0.25, 0.25],
  // sigma1
  space: [0, 0, 0],
  // sigma2
  stretch: [0, 0, 0],
  // sigma3
  shrink: [0, 0, 0],
  // sigma4
  xHeight: [0.431, 0.431, 0.431],
  // sigma5
  quad: [1, 1.171, 1.472],
  // sigma6
  extraSpace: [0, 0, 0],
  // sigma7
  num1: [0.677, 0.732, 0.925],
  // sigma8
  num2: [0.394, 0.384, 0.387],
  // sigma9
  num3: [0.444, 0.471, 0.504],
  // sigma10
  denom1: [0.686, 0.752, 1.025],
  // sigma11
  denom2: [0.345, 0.344, 0.532],
  // sigma12
  sup1: [0.413, 0.503, 0.504],
  // sigma13
  sup2: [0.363, 0.431, 0.404],
  // sigma14
  sup3: [0.289, 0.286, 0.294],
  // sigma15
  sub1: [0.15, 0.143, 0.2],
  // sigma16
  sub2: [0.247, 0.286, 0.4],
  // sigma17
  supDrop: [0.386, 0.353, 0.494],
  // sigma18
  subDrop: [0.05, 0.071, 0.1],
  // sigma19
  delim1: [2.39, 1.7, 1.98],
  // sigma20
  delim2: [1.01, 1.157, 1.42],
  // sigma21
  axisHeight: [0.25, 0.25, 0.25],
  // sigma22
  // These font metrics are extracted from TeX by using tftopl on cmex10.tfm;
  // they correspond to the font parameters of the extension fonts (family 3).
  // See the TeXbook, page 441. In AMSTeX, the extension fonts scale; to
  // match cmex7, we'd use cmex7.tfm values for script and scriptscript
  // values.
  defaultRuleThickness: [0.04, 0.049, 0.049],
  // xi8; cmex7: 0.049
  bigOpSpacing1: [0.111, 0.111, 0.111],
  // xi9
  bigOpSpacing2: [0.166, 0.166, 0.166],
  // xi10
  bigOpSpacing3: [0.2, 0.2, 0.2],
  // xi11
  bigOpSpacing4: [0.6, 0.611, 0.611],
  // xi12; cmex7: 0.611
  bigOpSpacing5: [0.1, 0.143, 0.143],
  // xi13; cmex7: 0.143
  // The \sqrt rule width is taken from the height of the surd character.
  // Since we use the same font at all sizes, this thickness doesn't scale.
  sqrtRuleThickness: [0.04, 0.04, 0.04],
  // This value determines how large a pt is, for metrics which are defined
  // in terms of pts.
  // This value is also used in katex.scss; if you change it make sure the
  // values match.
  ptPerEm: [10, 10, 10],
  // The space between adjacent `|` columns in an array definition. From
  // `\showthe\doublerulesep` in LaTeX. Equals 2.0 / ptPerEm.
  doubleRuleSep: [0.2, 0.2, 0.2],
  // The width of separator lines in {array} environments. From
  // `\showthe\arrayrulewidth` in LaTeX. Equals 0.4 / ptPerEm.
  arrayRuleWidth: [0.04, 0.04, 0.04],
  // Two values from LaTeX source2e:
  fboxsep: [0.3, 0.3, 0.3],
  //        3 pt / ptPerEm
  fboxrule: [0.04, 0.04, 0.04]
  // 0.4 pt / ptPerEm
}, ho = {
  // Latin-1
  Å: "A",
  Ð: "D",
  Þ: "o",
  å: "a",
  ð: "d",
  þ: "o",
  // Cyrillic
  А: "A",
  Б: "B",
  В: "B",
  Г: "F",
  Д: "A",
  Е: "E",
  Ж: "K",
  З: "3",
  И: "N",
  Й: "N",
  К: "K",
  Л: "N",
  М: "M",
  Н: "H",
  О: "O",
  П: "N",
  Р: "P",
  С: "C",
  Т: "T",
  У: "y",
  Ф: "O",
  Х: "X",
  Ц: "U",
  Ч: "h",
  Ш: "W",
  Щ: "W",
  Ъ: "B",
  Ы: "X",
  Ь: "B",
  Э: "3",
  Ю: "X",
  Я: "R",
  а: "a",
  б: "b",
  в: "a",
  г: "r",
  д: "y",
  е: "e",
  ж: "m",
  з: "e",
  и: "n",
  й: "n",
  к: "n",
  л: "n",
  м: "m",
  н: "n",
  о: "o",
  п: "n",
  р: "p",
  с: "c",
  т: "o",
  у: "y",
  ф: "b",
  х: "x",
  ц: "n",
  ч: "n",
  ш: "w",
  щ: "w",
  ъ: "a",
  ы: "m",
  ь: "a",
  э: "e",
  ю: "m",
  я: "r"
};
function W1(r, e) {
  Hn[r] = e;
}
function Dl(r, e, t) {
  if (!Hn[e])
    throw new Error("Font metrics not found for font: " + e + ".");
  var n = r.charCodeAt(0), a = Hn[e][n];
  if (!a && r[0] in ho && (n = ho[r[0]].charCodeAt(0), a = Hn[e][n]), !a && t === "text" && V1(n) && (a = Hn[e][77]), a)
    return {
      depth: a[0],
      height: a[1],
      italic: a[2],
      skew: a[3],
      width: a[4]
    };
}
var Qi = {};
function Yf(r) {
  var e;
  if (r >= 5 ? e = 0 : r >= 3 ? e = 1 : e = 2, !Qi[e]) {
    var t = Qi[e] = {
      cssEmPerMu: xa.quad[e] / 18
    };
    for (var n in xa)
      xa.hasOwnProperty(n) && (t[n] = xa[n][e]);
  }
  return Qi[e];
}
var Xf = [
  // Each element contains [textsize, scriptsize, scriptscriptsize].
  // The size mappings are taken from TeX with \normalsize=10pt.
  [1, 1, 1],
  // size1: [5, 5, 5]              \tiny
  [2, 1, 1],
  // size2: [6, 5, 5]
  [3, 1, 1],
  // size3: [7, 5, 5]              \scriptsize
  [4, 2, 1],
  // size4: [8, 6, 5]              \footnotesize
  [5, 2, 1],
  // size5: [9, 6, 5]              \small
  [6, 3, 1],
  // size6: [10, 7, 5]             \normalsize
  [7, 4, 2],
  // size7: [12, 8, 6]             \large
  [8, 6, 3],
  // size8: [14.4, 10, 7]          \Large
  [9, 7, 6],
  // size9: [17.28, 12, 10]        \LARGE
  [10, 8, 7],
  // size10: [20.74, 14.4, 12]     \huge
  [11, 10, 9]
  // size11: [24.88, 20.74, 17.28] \HUGE
], fo = [
  // fontMetrics.js:getGlobalMetrics also uses size indexes, so if
  // you change size indexes, change that function.
  0.5,
  0.6,
  0.7,
  0.8,
  0.9,
  1,
  1.2,
  1.44,
  1.728,
  2.074,
  2.488
], mo = function(e, t) {
  return t.size < 2 ? e : Xf[e - 1][t.size - 1];
};
class u0 {
  // A font family applies to a group of fonts (i.e. SansSerif), while a font
  // represents a specific font (i.e. SansSerif Bold).
  // See: https://tex.stackexchange.com/questions/22350/difference-between-textrm-and-mathrm
  /**
   * The base size index.
   */
  constructor(e) {
    this.style = void 0, this.color = void 0, this.size = void 0, this.textSize = void 0, this.phantom = void 0, this.font = void 0, this.fontFamily = void 0, this.fontWeight = void 0, this.fontShape = void 0, this.sizeMultiplier = void 0, this.maxSize = void 0, this.minRuleThickness = void 0, this._fontMetrics = void 0, this.style = e.style, this.color = e.color, this.size = e.size || u0.BASESIZE, this.textSize = e.textSize || this.size, this.phantom = !!e.phantom, this.font = e.font || "", this.fontFamily = e.fontFamily || "", this.fontWeight = e.fontWeight || "", this.fontShape = e.fontShape || "", this.sizeMultiplier = fo[this.size - 1], this.maxSize = e.maxSize, this.minRuleThickness = e.minRuleThickness, this._fontMetrics = void 0;
  }
  /**
   * Returns a new options object with the same properties as "this".  Properties
   * from "extension" will be copied to the new options object.
   */
  extend(e) {
    var t = {
      style: this.style,
      size: this.size,
      textSize: this.textSize,
      color: this.color,
      phantom: this.phantom,
      font: this.font,
      fontFamily: this.fontFamily,
      fontWeight: this.fontWeight,
      fontShape: this.fontShape,
      maxSize: this.maxSize,
      minRuleThickness: this.minRuleThickness
    };
    for (var n in e)
      e.hasOwnProperty(n) && (t[n] = e[n]);
    return new u0(t);
  }
  /**
   * Return an options object with the given style. If `this.style === style`,
   * returns `this`.
   */
  havingStyle(e) {
    return this.style === e ? this : this.extend({
      style: e,
      size: mo(this.textSize, e)
    });
  }
  /**
   * Return an options object with a cramped version of the current style. If
   * the current style is cramped, returns `this`.
   */
  havingCrampedStyle() {
    return this.havingStyle(this.style.cramp());
  }
  /**
   * Return an options object with the given size and in at least `\textstyle`.
   * Returns `this` if appropriate.
   */
  havingSize(e) {
    return this.size === e && this.textSize === e ? this : this.extend({
      style: this.style.text(),
      size: e,
      textSize: e,
      sizeMultiplier: fo[e - 1]
    });
  }
  /**
   * Like `this.havingSize(BASESIZE).havingStyle(style)`. If `style` is omitted,
   * changes to at least `\textstyle`.
   */
  havingBaseStyle(e) {
    e = e || this.style.text();
    var t = mo(u0.BASESIZE, e);
    return this.size === t && this.textSize === u0.BASESIZE && this.style === e ? this : this.extend({
      style: e,
      size: t
    });
  }
  /**
   * Remove the effect of sizing changes such as \Huge.
   * Keep the effect of the current style, such as \scriptstyle.
   */
  havingBaseSizing() {
    var e;
    switch (this.style.id) {
      case 4:
      case 5:
        e = 3;
        break;
      case 6:
      case 7:
        e = 1;
        break;
      default:
        e = 6;
    }
    return this.extend({
      style: this.style.text(),
      size: e
    });
  }
  /**
   * Create a new options object with the given color.
   */
  withColor(e) {
    return this.extend({
      color: e
    });
  }
  /**
   * Create a new options object with "phantom" set to true.
   */
  withPhantom() {
    return this.extend({
      phantom: !0
    });
  }
  /**
   * Creates a new options object with the given math font or old text font.
   * @type {[type]}
   */
  withFont(e) {
    return this.extend({
      font: e
    });
  }
  /**
   * Create a new options objects with the given fontFamily.
   */
  withTextFontFamily(e) {
    return this.extend({
      fontFamily: e,
      font: ""
    });
  }
  /**
   * Creates a new options object with the given font weight
   */
  withTextFontWeight(e) {
    return this.extend({
      fontWeight: e,
      font: ""
    });
  }
  /**
   * Creates a new options object with the given font weight
   */
  withTextFontShape(e) {
    return this.extend({
      fontShape: e,
      font: ""
    });
  }
  /**
   * Return the CSS sizing classes required to switch from enclosing options
   * `oldOptions` to `this`. Returns an array of classes.
   */
  sizingClasses(e) {
    return e.size !== this.size ? ["sizing", "reset-size" + e.size, "size" + this.size] : [];
  }
  /**
   * Return the CSS sizing classes required to switch to the base size. Like
   * `this.havingSize(BASESIZE).sizingClasses(this)`.
   */
  baseSizingClasses() {
    return this.size !== u0.BASESIZE ? ["sizing", "reset-size" + this.size, "size" + u0.BASESIZE] : [];
  }
  /**
   * Return the font metrics for this size.
   */
  fontMetrics() {
    return this._fontMetrics || (this._fontMetrics = Yf(this.size)), this._fontMetrics;
  }
  /**
   * Gets the CSS color of the current options object
   */
  getColor() {
    return this.phantom ? "transparent" : this.color;
  }
}
u0.BASESIZE = 6;
var Zs = {
  // https://en.wikibooks.org/wiki/LaTeX/Lengths and
  // https://tex.stackexchange.com/a/8263
  pt: 1,
  // TeX point
  mm: 7227 / 2540,
  // millimeter
  cm: 7227 / 254,
  // centimeter
  in: 72.27,
  // inch
  bp: 803 / 800,
  // big (PostScript) points
  pc: 12,
  // pica
  dd: 1238 / 1157,
  // didot
  cc: 14856 / 1157,
  // cicero (12 didot)
  nd: 685 / 642,
  // new didot
  nc: 1370 / 107,
  // new cicero (12 new didot)
  sp: 1 / 65536,
  // scaled point (TeX's internal smallest unit)
  // https://tex.stackexchange.com/a/41371
  px: 803 / 800
  // \pdfpxdimen defaults to 1 bp in pdfTeX and LuaTeX
}, Zf = {
  ex: !0,
  em: !0,
  mu: !0
}, K1 = function(e) {
  return typeof e != "string" && (e = e.unit), e in Zs || e in Zf || e === "ex";
}, We = function(e, t) {
  var n;
  if (e.unit in Zs)
    n = Zs[e.unit] / t.fontMetrics().ptPerEm / t.sizeMultiplier;
  else if (e.unit === "mu")
    n = t.fontMetrics().cssEmPerMu;
  else {
    var a;
    if (t.style.isTight() ? a = t.havingStyle(t.style.text()) : a = t, e.unit === "ex")
      n = a.fontMetrics().xHeight;
    else if (e.unit === "em")
      n = a.fontMetrics().quad;
    else
      throw new U("Invalid unit: '" + e.unit + "'");
    a !== t && (n *= a.sizeMultiplier / t.sizeMultiplier);
  }
  return Math.min(e.number * n, t.maxSize);
}, W = function(e) {
  return +e.toFixed(4) + "em";
}, B0 = function(e) {
  return e.filter((t) => t).join(" ");
}, Y1 = function(e, t, n) {
  if (this.classes = e || [], this.attributes = {}, this.height = 0, this.depth = 0, this.maxFontSize = 0, this.style = n || {}, t) {
    t.style.isTight() && this.classes.push("mtight");
    var a = t.getColor();
    a && (this.style.color = a);
  }
}, X1 = function(e) {
  var t = document.createElement(e);
  t.className = B0(this.classes);
  for (var n in this.style)
    this.style.hasOwnProperty(n) && (t.style[n] = this.style[n]);
  for (var a in this.attributes)
    this.attributes.hasOwnProperty(a) && t.setAttribute(a, this.attributes[a]);
  for (var i = 0; i < this.children.length; i++)
    t.appendChild(this.children[i].toNode());
  return t;
}, Qf = /[\s"'>/=\x00-\x1f]/, Z1 = function(e) {
  var t = "<" + e;
  this.classes.length && (t += ' class="' + ae.escape(B0(this.classes)) + '"');
  var n = "";
  for (var a in this.style)
    this.style.hasOwnProperty(a) && (n += ae.hyphenate(a) + ":" + this.style[a] + ";");
  n && (t += ' style="' + ae.escape(n) + '"');
  for (var i in this.attributes)
    if (this.attributes.hasOwnProperty(i)) {
      if (Qf.test(i))
        throw new U("Invalid attribute name '" + i + "'");
      t += " " + i + '="' + ae.escape(this.attributes[i]) + '"';
    }
  t += ">";
  for (var s = 0; s < this.children.length; s++)
    t += this.children[s].toMarkup();
  return t += "</" + e + ">", t;
};
class fa {
  constructor(e, t, n, a) {
    this.children = void 0, this.attributes = void 0, this.classes = void 0, this.height = void 0, this.depth = void 0, this.width = void 0, this.maxFontSize = void 0, this.style = void 0, Y1.call(this, e, n, a), this.children = t || [];
  }
  /**
   * Sets an arbitrary attribute on the span. Warning: use this wisely. Not
   * all browsers support attributes the same, and having too many custom
   * attributes is probably bad.
   */
  setAttribute(e, t) {
    this.attributes[e] = t;
  }
  hasClass(e) {
    return ae.contains(this.classes, e);
  }
  toNode() {
    return X1.call(this, "span");
  }
  toMarkup() {
    return Z1.call(this, "span");
  }
}
class xl {
  constructor(e, t, n, a) {
    this.children = void 0, this.attributes = void 0, this.classes = void 0, this.height = void 0, this.depth = void 0, this.maxFontSize = void 0, this.style = void 0, Y1.call(this, t, a), this.children = n || [], this.setAttribute("href", e);
  }
  setAttribute(e, t) {
    this.attributes[e] = t;
  }
  hasClass(e) {
    return ae.contains(this.classes, e);
  }
  toNode() {
    return X1.call(this, "a");
  }
  toMarkup() {
    return Z1.call(this, "a");
  }
}
class Jf {
  constructor(e, t, n) {
    this.src = void 0, this.alt = void 0, this.classes = void 0, this.height = void 0, this.depth = void 0, this.maxFontSize = void 0, this.style = void 0, this.alt = t, this.src = e, this.classes = ["mord"], this.style = n;
  }
  hasClass(e) {
    return ae.contains(this.classes, e);
  }
  toNode() {
    var e = document.createElement("img");
    e.src = this.src, e.alt = this.alt, e.className = "mord";
    for (var t in this.style)
      this.style.hasOwnProperty(t) && (e.style[t] = this.style[t]);
    return e;
  }
  toMarkup() {
    var e = '<img src="' + ae.escape(this.src) + '"' + (' alt="' + ae.escape(this.alt) + '"'), t = "";
    for (var n in this.style)
      this.style.hasOwnProperty(n) && (t += ae.hyphenate(n) + ":" + this.style[n] + ";");
    return t && (e += ' style="' + ae.escape(t) + '"'), e += "'/>", e;
  }
}
var ed = {
  î: "ı̂",
  ï: "ı̈",
  í: "ı́",
  // 'ī': '\u0131\u0304', // enable when we add Extended Latin
  ì: "ı̀"
};
class wn {
  constructor(e, t, n, a, i, s, l, o) {
    this.text = void 0, this.height = void 0, this.depth = void 0, this.italic = void 0, this.skew = void 0, this.width = void 0, this.maxFontSize = void 0, this.classes = void 0, this.style = void 0, this.text = e, this.height = t || 0, this.depth = n || 0, this.italic = a || 0, this.skew = i || 0, this.width = s || 0, this.classes = l || [], this.style = o || {}, this.maxFontSize = 0;
    var u = If(this.text.charCodeAt(0));
    u && this.classes.push(u + "_fallback"), /[îïíì]/.test(this.text) && (this.text = ed[this.text]);
  }
  hasClass(e) {
    return ae.contains(this.classes, e);
  }
  /**
   * Creates a text node or span from a symbol node. Note that a span is only
   * created if it is needed.
   */
  toNode() {
    var e = document.createTextNode(this.text), t = null;
    this.italic > 0 && (t = document.createElement("span"), t.style.marginRight = W(this.italic)), this.classes.length > 0 && (t = t || document.createElement("span"), t.className = B0(this.classes));
    for (var n in this.style)
      this.style.hasOwnProperty(n) && (t = t || document.createElement("span"), t.style[n] = this.style[n]);
    return t ? (t.appendChild(e), t) : e;
  }
  /**
   * Creates markup for a symbol node.
   */
  toMarkup() {
    var e = !1, t = "<span";
    this.classes.length && (e = !0, t += ' class="', t += ae.escape(B0(this.classes)), t += '"');
    var n = "";
    this.italic > 0 && (n += "margin-right:" + this.italic + "em;");
    for (var a in this.style)
      this.style.hasOwnProperty(a) && (n += ae.hyphenate(a) + ":" + this.style[a] + ";");
    n && (e = !0, t += ' style="' + ae.escape(n) + '"');
    var i = ae.escape(this.text);
    return e ? (t += ">", t += i, t += "</span>", t) : i;
  }
}
class m0 {
  constructor(e, t) {
    this.children = void 0, this.attributes = void 0, this.children = e || [], this.attributes = t || {};
  }
  toNode() {
    var e = "http://www.w3.org/2000/svg", t = document.createElementNS(e, "svg");
    for (var n in this.attributes)
      Object.prototype.hasOwnProperty.call(this.attributes, n) && t.setAttribute(n, this.attributes[n]);
    for (var a = 0; a < this.children.length; a++)
      t.appendChild(this.children[a].toNode());
    return t;
  }
  toMarkup() {
    var e = '<svg xmlns="http://www.w3.org/2000/svg"';
    for (var t in this.attributes)
      Object.prototype.hasOwnProperty.call(this.attributes, t) && (e += " " + t + '="' + ae.escape(this.attributes[t]) + '"');
    e += ">";
    for (var n = 0; n < this.children.length; n++)
      e += this.children[n].toMarkup();
    return e += "</svg>", e;
  }
}
class N0 {
  constructor(e, t) {
    this.pathName = void 0, this.alternate = void 0, this.pathName = e, this.alternate = t;
  }
  toNode() {
    var e = "http://www.w3.org/2000/svg", t = document.createElementNS(e, "path");
    return this.alternate ? t.setAttribute("d", this.alternate) : t.setAttribute("d", co[this.pathName]), t;
  }
  toMarkup() {
    return this.alternate ? '<path d="' + ae.escape(this.alternate) + '"/>' : '<path d="' + ae.escape(co[this.pathName]) + '"/>';
  }
}
class Qs {
  constructor(e) {
    this.attributes = void 0, this.attributes = e || {};
  }
  toNode() {
    var e = "http://www.w3.org/2000/svg", t = document.createElementNS(e, "line");
    for (var n in this.attributes)
      Object.prototype.hasOwnProperty.call(this.attributes, n) && t.setAttribute(n, this.attributes[n]);
    return t;
  }
  toMarkup() {
    var e = "<line";
    for (var t in this.attributes)
      Object.prototype.hasOwnProperty.call(this.attributes, t) && (e += " " + t + '="' + ae.escape(this.attributes[t]) + '"');
    return e += "/>", e;
  }
}
function po(r) {
  if (r instanceof wn)
    return r;
  throw new Error("Expected symbolNode but got " + String(r) + ".");
}
function td(r) {
  if (r instanceof fa)
    return r;
  throw new Error("Expected span<HtmlDomNode> but got " + String(r) + ".");
}
var nd = {
  bin: 1,
  close: 1,
  inner: 1,
  open: 1,
  punct: 1,
  rel: 1
}, rd = {
  "accent-token": 1,
  mathord: 1,
  "op-token": 1,
  spacing: 1,
  textord: 1
}, Re = {
  math: {},
  text: {}
};
function c(r, e, t, n, a, i) {
  Re[r][a] = {
    font: e,
    group: t,
    replace: n
  }, i && n && (Re[r][n] = Re[r][a]);
}
var f = "math", R = "text", p = "main", S = "ams", Ge = "accent-token", Z = "bin", Ut = "close", xr = "inner", se = "mathord", dt = "op-token", on = "open", Ti = "punct", D = "rel", _0 = "spacing", E = "textord";
c(f, p, D, "≡", "\\equiv", !0);
c(f, p, D, "≺", "\\prec", !0);
c(f, p, D, "≻", "\\succ", !0);
c(f, p, D, "∼", "\\sim", !0);
c(f, p, D, "⊥", "\\perp");
c(f, p, D, "⪯", "\\preceq", !0);
c(f, p, D, "⪰", "\\succeq", !0);
c(f, p, D, "≃", "\\simeq", !0);
c(f, p, D, "∣", "\\mid", !0);
c(f, p, D, "≪", "\\ll", !0);
c(f, p, D, "≫", "\\gg", !0);
c(f, p, D, "≍", "\\asymp", !0);
c(f, p, D, "∥", "\\parallel");
c(f, p, D, "⋈", "\\bowtie", !0);
c(f, p, D, "⌣", "\\smile", !0);
c(f, p, D, "⊑", "\\sqsubseteq", !0);
c(f, p, D, "⊒", "\\sqsupseteq", !0);
c(f, p, D, "≐", "\\doteq", !0);
c(f, p, D, "⌢", "\\frown", !0);
c(f, p, D, "∋", "\\ni", !0);
c(f, p, D, "∝", "\\propto", !0);
c(f, p, D, "⊢", "\\vdash", !0);
c(f, p, D, "⊣", "\\dashv", !0);
c(f, p, D, "∋", "\\owns");
c(f, p, Ti, ".", "\\ldotp");
c(f, p, Ti, "⋅", "\\cdotp");
c(f, p, E, "#", "\\#");
c(R, p, E, "#", "\\#");
c(f, p, E, "&", "\\&");
c(R, p, E, "&", "\\&");
c(f, p, E, "ℵ", "\\aleph", !0);
c(f, p, E, "∀", "\\forall", !0);
c(f, p, E, "ℏ", "\\hbar", !0);
c(f, p, E, "∃", "\\exists", !0);
c(f, p, E, "∇", "\\nabla", !0);
c(f, p, E, "♭", "\\flat", !0);
c(f, p, E, "ℓ", "\\ell", !0);
c(f, p, E, "♮", "\\natural", !0);
c(f, p, E, "♣", "\\clubsuit", !0);
c(f, p, E, "℘", "\\wp", !0);
c(f, p, E, "♯", "\\sharp", !0);
c(f, p, E, "♢", "\\diamondsuit", !0);
c(f, p, E, "ℜ", "\\Re", !0);
c(f, p, E, "♡", "\\heartsuit", !0);
c(f, p, E, "ℑ", "\\Im", !0);
c(f, p, E, "♠", "\\spadesuit", !0);
c(f, p, E, "§", "\\S", !0);
c(R, p, E, "§", "\\S");
c(f, p, E, "¶", "\\P", !0);
c(R, p, E, "¶", "\\P");
c(f, p, E, "†", "\\dag");
c(R, p, E, "†", "\\dag");
c(R, p, E, "†", "\\textdagger");
c(f, p, E, "‡", "\\ddag");
c(R, p, E, "‡", "\\ddag");
c(R, p, E, "‡", "\\textdaggerdbl");
c(f, p, Ut, "⎱", "\\rmoustache", !0);
c(f, p, on, "⎰", "\\lmoustache", !0);
c(f, p, Ut, "⟯", "\\rgroup", !0);
c(f, p, on, "⟮", "\\lgroup", !0);
c(f, p, Z, "∓", "\\mp", !0);
c(f, p, Z, "⊖", "\\ominus", !0);
c(f, p, Z, "⊎", "\\uplus", !0);
c(f, p, Z, "⊓", "\\sqcap", !0);
c(f, p, Z, "∗", "\\ast");
c(f, p, Z, "⊔", "\\sqcup", !0);
c(f, p, Z, "◯", "\\bigcirc", !0);
c(f, p, Z, "∙", "\\bullet", !0);
c(f, p, Z, "‡", "\\ddagger");
c(f, p, Z, "≀", "\\wr", !0);
c(f, p, Z, "⨿", "\\amalg");
c(f, p, Z, "&", "\\And");
c(f, p, D, "⟵", "\\longleftarrow", !0);
c(f, p, D, "⇐", "\\Leftarrow", !0);
c(f, p, D, "⟸", "\\Longleftarrow", !0);
c(f, p, D, "⟶", "\\longrightarrow", !0);
c(f, p, D, "⇒", "\\Rightarrow", !0);
c(f, p, D, "⟹", "\\Longrightarrow", !0);
c(f, p, D, "↔", "\\leftrightarrow", !0);
c(f, p, D, "⟷", "\\longleftrightarrow", !0);
c(f, p, D, "⇔", "\\Leftrightarrow", !0);
c(f, p, D, "⟺", "\\Longleftrightarrow", !0);
c(f, p, D, "↦", "\\mapsto", !0);
c(f, p, D, "⟼", "\\longmapsto", !0);
c(f, p, D, "↗", "\\nearrow", !0);
c(f, p, D, "↩", "\\hookleftarrow", !0);
c(f, p, D, "↪", "\\hookrightarrow", !0);
c(f, p, D, "↘", "\\searrow", !0);
c(f, p, D, "↼", "\\leftharpoonup", !0);
c(f, p, D, "⇀", "\\rightharpoonup", !0);
c(f, p, D, "↙", "\\swarrow", !0);
c(f, p, D, "↽", "\\leftharpoondown", !0);
c(f, p, D, "⇁", "\\rightharpoondown", !0);
c(f, p, D, "↖", "\\nwarrow", !0);
c(f, p, D, "⇌", "\\rightleftharpoons", !0);
c(f, S, D, "≮", "\\nless", !0);
c(f, S, D, "", "\\@nleqslant");
c(f, S, D, "", "\\@nleqq");
c(f, S, D, "⪇", "\\lneq", !0);
c(f, S, D, "≨", "\\lneqq", !0);
c(f, S, D, "", "\\@lvertneqq");
c(f, S, D, "⋦", "\\lnsim", !0);
c(f, S, D, "⪉", "\\lnapprox", !0);
c(f, S, D, "⊀", "\\nprec", !0);
c(f, S, D, "⋠", "\\npreceq", !0);
c(f, S, D, "⋨", "\\precnsim", !0);
c(f, S, D, "⪹", "\\precnapprox", !0);
c(f, S, D, "≁", "\\nsim", !0);
c(f, S, D, "", "\\@nshortmid");
c(f, S, D, "∤", "\\nmid", !0);
c(f, S, D, "⊬", "\\nvdash", !0);
c(f, S, D, "⊭", "\\nvDash", !0);
c(f, S, D, "⋪", "\\ntriangleleft");
c(f, S, D, "⋬", "\\ntrianglelefteq", !0);
c(f, S, D, "⊊", "\\subsetneq", !0);
c(f, S, D, "", "\\@varsubsetneq");
c(f, S, D, "⫋", "\\subsetneqq", !0);
c(f, S, D, "", "\\@varsubsetneqq");
c(f, S, D, "≯", "\\ngtr", !0);
c(f, S, D, "", "\\@ngeqslant");
c(f, S, D, "", "\\@ngeqq");
c(f, S, D, "⪈", "\\gneq", !0);
c(f, S, D, "≩", "\\gneqq", !0);
c(f, S, D, "", "\\@gvertneqq");
c(f, S, D, "⋧", "\\gnsim", !0);
c(f, S, D, "⪊", "\\gnapprox", !0);
c(f, S, D, "⊁", "\\nsucc", !0);
c(f, S, D, "⋡", "\\nsucceq", !0);
c(f, S, D, "⋩", "\\succnsim", !0);
c(f, S, D, "⪺", "\\succnapprox", !0);
c(f, S, D, "≆", "\\ncong", !0);
c(f, S, D, "", "\\@nshortparallel");
c(f, S, D, "∦", "\\nparallel", !0);
c(f, S, D, "⊯", "\\nVDash", !0);
c(f, S, D, "⋫", "\\ntriangleright");
c(f, S, D, "⋭", "\\ntrianglerighteq", !0);
c(f, S, D, "", "\\@nsupseteqq");
c(f, S, D, "⊋", "\\supsetneq", !0);
c(f, S, D, "", "\\@varsupsetneq");
c(f, S, D, "⫌", "\\supsetneqq", !0);
c(f, S, D, "", "\\@varsupsetneqq");
c(f, S, D, "⊮", "\\nVdash", !0);
c(f, S, D, "⪵", "\\precneqq", !0);
c(f, S, D, "⪶", "\\succneqq", !0);
c(f, S, D, "", "\\@nsubseteqq");
c(f, S, Z, "⊴", "\\unlhd");
c(f, S, Z, "⊵", "\\unrhd");
c(f, S, D, "↚", "\\nleftarrow", !0);
c(f, S, D, "↛", "\\nrightarrow", !0);
c(f, S, D, "⇍", "\\nLeftarrow", !0);
c(f, S, D, "⇏", "\\nRightarrow", !0);
c(f, S, D, "↮", "\\nleftrightarrow", !0);
c(f, S, D, "⇎", "\\nLeftrightarrow", !0);
c(f, S, D, "△", "\\vartriangle");
c(f, S, E, "ℏ", "\\hslash");
c(f, S, E, "▽", "\\triangledown");
c(f, S, E, "◊", "\\lozenge");
c(f, S, E, "Ⓢ", "\\circledS");
c(f, S, E, "®", "\\circledR");
c(R, S, E, "®", "\\circledR");
c(f, S, E, "∡", "\\measuredangle", !0);
c(f, S, E, "∄", "\\nexists");
c(f, S, E, "℧", "\\mho");
c(f, S, E, "Ⅎ", "\\Finv", !0);
c(f, S, E, "⅁", "\\Game", !0);
c(f, S, E, "‵", "\\backprime");
c(f, S, E, "▲", "\\blacktriangle");
c(f, S, E, "▼", "\\blacktriangledown");
c(f, S, E, "■", "\\blacksquare");
c(f, S, E, "⧫", "\\blacklozenge");
c(f, S, E, "★", "\\bigstar");
c(f, S, E, "∢", "\\sphericalangle", !0);
c(f, S, E, "∁", "\\complement", !0);
c(f, S, E, "ð", "\\eth", !0);
c(R, p, E, "ð", "ð");
c(f, S, E, "╱", "\\diagup");
c(f, S, E, "╲", "\\diagdown");
c(f, S, E, "□", "\\square");
c(f, S, E, "□", "\\Box");
c(f, S, E, "◊", "\\Diamond");
c(f, S, E, "¥", "\\yen", !0);
c(R, S, E, "¥", "\\yen", !0);
c(f, S, E, "✓", "\\checkmark", !0);
c(R, S, E, "✓", "\\checkmark");
c(f, S, E, "ℶ", "\\beth", !0);
c(f, S, E, "ℸ", "\\daleth", !0);
c(f, S, E, "ℷ", "\\gimel", !0);
c(f, S, E, "ϝ", "\\digamma", !0);
c(f, S, E, "ϰ", "\\varkappa");
c(f, S, on, "┌", "\\@ulcorner", !0);
c(f, S, Ut, "┐", "\\@urcorner", !0);
c(f, S, on, "└", "\\@llcorner", !0);
c(f, S, Ut, "┘", "\\@lrcorner", !0);
c(f, S, D, "≦", "\\leqq", !0);
c(f, S, D, "⩽", "\\leqslant", !0);
c(f, S, D, "⪕", "\\eqslantless", !0);
c(f, S, D, "≲", "\\lesssim", !0);
c(f, S, D, "⪅", "\\lessapprox", !0);
c(f, S, D, "≊", "\\approxeq", !0);
c(f, S, Z, "⋖", "\\lessdot");
c(f, S, D, "⋘", "\\lll", !0);
c(f, S, D, "≶", "\\lessgtr", !0);
c(f, S, D, "⋚", "\\lesseqgtr", !0);
c(f, S, D, "⪋", "\\lesseqqgtr", !0);
c(f, S, D, "≑", "\\doteqdot");
c(f, S, D, "≓", "\\risingdotseq", !0);
c(f, S, D, "≒", "\\fallingdotseq", !0);
c(f, S, D, "∽", "\\backsim", !0);
c(f, S, D, "⋍", "\\backsimeq", !0);
c(f, S, D, "⫅", "\\subseteqq", !0);
c(f, S, D, "⋐", "\\Subset", !0);
c(f, S, D, "⊏", "\\sqsubset", !0);
c(f, S, D, "≼", "\\preccurlyeq", !0);
c(f, S, D, "⋞", "\\curlyeqprec", !0);
c(f, S, D, "≾", "\\precsim", !0);
c(f, S, D, "⪷", "\\precapprox", !0);
c(f, S, D, "⊲", "\\vartriangleleft");
c(f, S, D, "⊴", "\\trianglelefteq");
c(f, S, D, "⊨", "\\vDash", !0);
c(f, S, D, "⊪", "\\Vvdash", !0);
c(f, S, D, "⌣", "\\smallsmile");
c(f, S, D, "⌢", "\\smallfrown");
c(f, S, D, "≏", "\\bumpeq", !0);
c(f, S, D, "≎", "\\Bumpeq", !0);
c(f, S, D, "≧", "\\geqq", !0);
c(f, S, D, "⩾", "\\geqslant", !0);
c(f, S, D, "⪖", "\\eqslantgtr", !0);
c(f, S, D, "≳", "\\gtrsim", !0);
c(f, S, D, "⪆", "\\gtrapprox", !0);
c(f, S, Z, "⋗", "\\gtrdot");
c(f, S, D, "⋙", "\\ggg", !0);
c(f, S, D, "≷", "\\gtrless", !0);
c(f, S, D, "⋛", "\\gtreqless", !0);
c(f, S, D, "⪌", "\\gtreqqless", !0);
c(f, S, D, "≖", "\\eqcirc", !0);
c(f, S, D, "≗", "\\circeq", !0);
c(f, S, D, "≜", "\\triangleq", !0);
c(f, S, D, "∼", "\\thicksim");
c(f, S, D, "≈", "\\thickapprox");
c(f, S, D, "⫆", "\\supseteqq", !0);
c(f, S, D, "⋑", "\\Supset", !0);
c(f, S, D, "⊐", "\\sqsupset", !0);
c(f, S, D, "≽", "\\succcurlyeq", !0);
c(f, S, D, "⋟", "\\curlyeqsucc", !0);
c(f, S, D, "≿", "\\succsim", !0);
c(f, S, D, "⪸", "\\succapprox", !0);
c(f, S, D, "⊳", "\\vartriangleright");
c(f, S, D, "⊵", "\\trianglerighteq");
c(f, S, D, "⊩", "\\Vdash", !0);
c(f, S, D, "∣", "\\shortmid");
c(f, S, D, "∥", "\\shortparallel");
c(f, S, D, "≬", "\\between", !0);
c(f, S, D, "⋔", "\\pitchfork", !0);
c(f, S, D, "∝", "\\varpropto");
c(f, S, D, "◀", "\\blacktriangleleft");
c(f, S, D, "∴", "\\therefore", !0);
c(f, S, D, "∍", "\\backepsilon");
c(f, S, D, "▶", "\\blacktriangleright");
c(f, S, D, "∵", "\\because", !0);
c(f, S, D, "⋘", "\\llless");
c(f, S, D, "⋙", "\\gggtr");
c(f, S, Z, "⊲", "\\lhd");
c(f, S, Z, "⊳", "\\rhd");
c(f, S, D, "≂", "\\eqsim", !0);
c(f, p, D, "⋈", "\\Join");
c(f, S, D, "≑", "\\Doteq", !0);
c(f, S, Z, "∔", "\\dotplus", !0);
c(f, S, Z, "∖", "\\smallsetminus");
c(f, S, Z, "⋒", "\\Cap", !0);
c(f, S, Z, "⋓", "\\Cup", !0);
c(f, S, Z, "⩞", "\\doublebarwedge", !0);
c(f, S, Z, "⊟", "\\boxminus", !0);
c(f, S, Z, "⊞", "\\boxplus", !0);
c(f, S, Z, "⋇", "\\divideontimes", !0);
c(f, S, Z, "⋉", "\\ltimes", !0);
c(f, S, Z, "⋊", "\\rtimes", !0);
c(f, S, Z, "⋋", "\\leftthreetimes", !0);
c(f, S, Z, "⋌", "\\rightthreetimes", !0);
c(f, S, Z, "⋏", "\\curlywedge", !0);
c(f, S, Z, "⋎", "\\curlyvee", !0);
c(f, S, Z, "⊝", "\\circleddash", !0);
c(f, S, Z, "⊛", "\\circledast", !0);
c(f, S, Z, "⋅", "\\centerdot");
c(f, S, Z, "⊺", "\\intercal", !0);
c(f, S, Z, "⋒", "\\doublecap");
c(f, S, Z, "⋓", "\\doublecup");
c(f, S, Z, "⊠", "\\boxtimes", !0);
c(f, S, D, "⇢", "\\dashrightarrow", !0);
c(f, S, D, "⇠", "\\dashleftarrow", !0);
c(f, S, D, "⇇", "\\leftleftarrows", !0);
c(f, S, D, "⇆", "\\leftrightarrows", !0);
c(f, S, D, "⇚", "\\Lleftarrow", !0);
c(f, S, D, "↞", "\\twoheadleftarrow", !0);
c(f, S, D, "↢", "\\leftarrowtail", !0);
c(f, S, D, "↫", "\\looparrowleft", !0);
c(f, S, D, "⇋", "\\leftrightharpoons", !0);
c(f, S, D, "↶", "\\curvearrowleft", !0);
c(f, S, D, "↺", "\\circlearrowleft", !0);
c(f, S, D, "↰", "\\Lsh", !0);
c(f, S, D, "⇈", "\\upuparrows", !0);
c(f, S, D, "↿", "\\upharpoonleft", !0);
c(f, S, D, "⇃", "\\downharpoonleft", !0);
c(f, p, D, "⊶", "\\origof", !0);
c(f, p, D, "⊷", "\\imageof", !0);
c(f, S, D, "⊸", "\\multimap", !0);
c(f, S, D, "↭", "\\leftrightsquigarrow", !0);
c(f, S, D, "⇉", "\\rightrightarrows", !0);
c(f, S, D, "⇄", "\\rightleftarrows", !0);
c(f, S, D, "↠", "\\twoheadrightarrow", !0);
c(f, S, D, "↣", "\\rightarrowtail", !0);
c(f, S, D, "↬", "\\looparrowright", !0);
c(f, S, D, "↷", "\\curvearrowright", !0);
c(f, S, D, "↻", "\\circlearrowright", !0);
c(f, S, D, "↱", "\\Rsh", !0);
c(f, S, D, "⇊", "\\downdownarrows", !0);
c(f, S, D, "↾", "\\upharpoonright", !0);
c(f, S, D, "⇂", "\\downharpoonright", !0);
c(f, S, D, "⇝", "\\rightsquigarrow", !0);
c(f, S, D, "⇝", "\\leadsto");
c(f, S, D, "⇛", "\\Rrightarrow", !0);
c(f, S, D, "↾", "\\restriction");
c(f, p, E, "‘", "`");
c(f, p, E, "$", "\\$");
c(R, p, E, "$", "\\$");
c(R, p, E, "$", "\\textdollar");
c(f, p, E, "%", "\\%");
c(R, p, E, "%", "\\%");
c(f, p, E, "_", "\\_");
c(R, p, E, "_", "\\_");
c(R, p, E, "_", "\\textunderscore");
c(f, p, E, "∠", "\\angle", !0);
c(f, p, E, "∞", "\\infty", !0);
c(f, p, E, "′", "\\prime");
c(f, p, E, "△", "\\triangle");
c(f, p, E, "Γ", "\\Gamma", !0);
c(f, p, E, "Δ", "\\Delta", !0);
c(f, p, E, "Θ", "\\Theta", !0);
c(f, p, E, "Λ", "\\Lambda", !0);
c(f, p, E, "Ξ", "\\Xi", !0);
c(f, p, E, "Π", "\\Pi", !0);
c(f, p, E, "Σ", "\\Sigma", !0);
c(f, p, E, "Υ", "\\Upsilon", !0);
c(f, p, E, "Φ", "\\Phi", !0);
c(f, p, E, "Ψ", "\\Psi", !0);
c(f, p, E, "Ω", "\\Omega", !0);
c(f, p, E, "A", "Α");
c(f, p, E, "B", "Β");
c(f, p, E, "E", "Ε");
c(f, p, E, "Z", "Ζ");
c(f, p, E, "H", "Η");
c(f, p, E, "I", "Ι");
c(f, p, E, "K", "Κ");
c(f, p, E, "M", "Μ");
c(f, p, E, "N", "Ν");
c(f, p, E, "O", "Ο");
c(f, p, E, "P", "Ρ");
c(f, p, E, "T", "Τ");
c(f, p, E, "X", "Χ");
c(f, p, E, "¬", "\\neg", !0);
c(f, p, E, "¬", "\\lnot");
c(f, p, E, "⊤", "\\top");
c(f, p, E, "⊥", "\\bot");
c(f, p, E, "∅", "\\emptyset");
c(f, S, E, "∅", "\\varnothing");
c(f, p, se, "α", "\\alpha", !0);
c(f, p, se, "β", "\\beta", !0);
c(f, p, se, "γ", "\\gamma", !0);
c(f, p, se, "δ", "\\delta", !0);
c(f, p, se, "ϵ", "\\epsilon", !0);
c(f, p, se, "ζ", "\\zeta", !0);
c(f, p, se, "η", "\\eta", !0);
c(f, p, se, "θ", "\\theta", !0);
c(f, p, se, "ι", "\\iota", !0);
c(f, p, se, "κ", "\\kappa", !0);
c(f, p, se, "λ", "\\lambda", !0);
c(f, p, se, "μ", "\\mu", !0);
c(f, p, se, "ν", "\\nu", !0);
c(f, p, se, "ξ", "\\xi", !0);
c(f, p, se, "ο", "\\omicron", !0);
c(f, p, se, "π", "\\pi", !0);
c(f, p, se, "ρ", "\\rho", !0);
c(f, p, se, "σ", "\\sigma", !0);
c(f, p, se, "τ", "\\tau", !0);
c(f, p, se, "υ", "\\upsilon", !0);
c(f, p, se, "ϕ", "\\phi", !0);
c(f, p, se, "χ", "\\chi", !0);
c(f, p, se, "ψ", "\\psi", !0);
c(f, p, se, "ω", "\\omega", !0);
c(f, p, se, "ε", "\\varepsilon", !0);
c(f, p, se, "ϑ", "\\vartheta", !0);
c(f, p, se, "ϖ", "\\varpi", !0);
c(f, p, se, "ϱ", "\\varrho", !0);
c(f, p, se, "ς", "\\varsigma", !0);
c(f, p, se, "φ", "\\varphi", !0);
c(f, p, Z, "∗", "*", !0);
c(f, p, Z, "+", "+");
c(f, p, Z, "−", "-", !0);
c(f, p, Z, "⋅", "\\cdot", !0);
c(f, p, Z, "∘", "\\circ", !0);
c(f, p, Z, "÷", "\\div", !0);
c(f, p, Z, "±", "\\pm", !0);
c(f, p, Z, "×", "\\times", !0);
c(f, p, Z, "∩", "\\cap", !0);
c(f, p, Z, "∪", "\\cup", !0);
c(f, p, Z, "∖", "\\setminus", !0);
c(f, p, Z, "∧", "\\land");
c(f, p, Z, "∨", "\\lor");
c(f, p, Z, "∧", "\\wedge", !0);
c(f, p, Z, "∨", "\\vee", !0);
c(f, p, E, "√", "\\surd");
c(f, p, on, "⟨", "\\langle", !0);
c(f, p, on, "∣", "\\lvert");
c(f, p, on, "∥", "\\lVert");
c(f, p, Ut, "?", "?");
c(f, p, Ut, "!", "!");
c(f, p, Ut, "⟩", "\\rangle", !0);
c(f, p, Ut, "∣", "\\rvert");
c(f, p, Ut, "∥", "\\rVert");
c(f, p, D, "=", "=");
c(f, p, D, ":", ":");
c(f, p, D, "≈", "\\approx", !0);
c(f, p, D, "≅", "\\cong", !0);
c(f, p, D, "≥", "\\ge");
c(f, p, D, "≥", "\\geq", !0);
c(f, p, D, "←", "\\gets");
c(f, p, D, ">", "\\gt", !0);
c(f, p, D, "∈", "\\in", !0);
c(f, p, D, "", "\\@not");
c(f, p, D, "⊂", "\\subset", !0);
c(f, p, D, "⊃", "\\supset", !0);
c(f, p, D, "⊆", "\\subseteq", !0);
c(f, p, D, "⊇", "\\supseteq", !0);
c(f, S, D, "⊈", "\\nsubseteq", !0);
c(f, S, D, "⊉", "\\nsupseteq", !0);
c(f, p, D, "⊨", "\\models");
c(f, p, D, "←", "\\leftarrow", !0);
c(f, p, D, "≤", "\\le");
c(f, p, D, "≤", "\\leq", !0);
c(f, p, D, "<", "\\lt", !0);
c(f, p, D, "→", "\\rightarrow", !0);
c(f, p, D, "→", "\\to");
c(f, S, D, "≱", "\\ngeq", !0);
c(f, S, D, "≰", "\\nleq", !0);
c(f, p, _0, " ", "\\ ");
c(f, p, _0, " ", "\\space");
c(f, p, _0, " ", "\\nobreakspace");
c(R, p, _0, " ", "\\ ");
c(R, p, _0, " ", " ");
c(R, p, _0, " ", "\\space");
c(R, p, _0, " ", "\\nobreakspace");
c(f, p, _0, null, "\\nobreak");
c(f, p, _0, null, "\\allowbreak");
c(f, p, Ti, ",", ",");
c(f, p, Ti, ";", ";");
c(f, S, Z, "⊼", "\\barwedge", !0);
c(f, S, Z, "⊻", "\\veebar", !0);
c(f, p, Z, "⊙", "\\odot", !0);
c(f, p, Z, "⊕", "\\oplus", !0);
c(f, p, Z, "⊗", "\\otimes", !0);
c(f, p, E, "∂", "\\partial", !0);
c(f, p, Z, "⊘", "\\oslash", !0);
c(f, S, Z, "⊚", "\\circledcirc", !0);
c(f, S, Z, "⊡", "\\boxdot", !0);
c(f, p, Z, "△", "\\bigtriangleup");
c(f, p, Z, "▽", "\\bigtriangledown");
c(f, p, Z, "†", "\\dagger");
c(f, p, Z, "⋄", "\\diamond");
c(f, p, Z, "⋆", "\\star");
c(f, p, Z, "◃", "\\triangleleft");
c(f, p, Z, "▹", "\\triangleright");
c(f, p, on, "{", "\\{");
c(R, p, E, "{", "\\{");
c(R, p, E, "{", "\\textbraceleft");
c(f, p, Ut, "}", "\\}");
c(R, p, E, "}", "\\}");
c(R, p, E, "}", "\\textbraceright");
c(f, p, on, "{", "\\lbrace");
c(f, p, Ut, "}", "\\rbrace");
c(f, p, on, "[", "\\lbrack", !0);
c(R, p, E, "[", "\\lbrack", !0);
c(f, p, Ut, "]", "\\rbrack", !0);
c(R, p, E, "]", "\\rbrack", !0);
c(f, p, on, "(", "\\lparen", !0);
c(f, p, Ut, ")", "\\rparen", !0);
c(R, p, E, "<", "\\textless", !0);
c(R, p, E, ">", "\\textgreater", !0);
c(f, p, on, "⌊", "\\lfloor", !0);
c(f, p, Ut, "⌋", "\\rfloor", !0);
c(f, p, on, "⌈", "\\lceil", !0);
c(f, p, Ut, "⌉", "\\rceil", !0);
c(f, p, E, "\\", "\\backslash");
c(f, p, E, "∣", "|");
c(f, p, E, "∣", "\\vert");
c(R, p, E, "|", "\\textbar", !0);
c(f, p, E, "∥", "\\|");
c(f, p, E, "∥", "\\Vert");
c(R, p, E, "∥", "\\textbardbl");
c(R, p, E, "~", "\\textasciitilde");
c(R, p, E, "\\", "\\textbackslash");
c(R, p, E, "^", "\\textasciicircum");
c(f, p, D, "↑", "\\uparrow", !0);
c(f, p, D, "⇑", "\\Uparrow", !0);
c(f, p, D, "↓", "\\downarrow", !0);
c(f, p, D, "⇓", "\\Downarrow", !0);
c(f, p, D, "↕", "\\updownarrow", !0);
c(f, p, D, "⇕", "\\Updownarrow", !0);
c(f, p, dt, "∐", "\\coprod");
c(f, p, dt, "⋁", "\\bigvee");
c(f, p, dt, "⋀", "\\bigwedge");
c(f, p, dt, "⨄", "\\biguplus");
c(f, p, dt, "⋂", "\\bigcap");
c(f, p, dt, "⋃", "\\bigcup");
c(f, p, dt, "∫", "\\int");
c(f, p, dt, "∫", "\\intop");
c(f, p, dt, "∬", "\\iint");
c(f, p, dt, "∭", "\\iiint");
c(f, p, dt, "∏", "\\prod");
c(f, p, dt, "∑", "\\sum");
c(f, p, dt, "⨂", "\\bigotimes");
c(f, p, dt, "⨁", "\\bigoplus");
c(f, p, dt, "⨀", "\\bigodot");
c(f, p, dt, "∮", "\\oint");
c(f, p, dt, "∯", "\\oiint");
c(f, p, dt, "∰", "\\oiiint");
c(f, p, dt, "⨆", "\\bigsqcup");
c(f, p, dt, "∫", "\\smallint");
c(R, p, xr, "…", "\\textellipsis");
c(f, p, xr, "…", "\\mathellipsis");
c(R, p, xr, "…", "\\ldots", !0);
c(f, p, xr, "…", "\\ldots", !0);
c(f, p, xr, "⋯", "\\@cdots", !0);
c(f, p, xr, "⋱", "\\ddots", !0);
c(f, p, E, "⋮", "\\varvdots");
c(R, p, E, "⋮", "\\varvdots");
c(f, p, Ge, "ˊ", "\\acute");
c(f, p, Ge, "ˋ", "\\grave");
c(f, p, Ge, "¨", "\\ddot");
c(f, p, Ge, "~", "\\tilde");
c(f, p, Ge, "ˉ", "\\bar");
c(f, p, Ge, "˘", "\\breve");
c(f, p, Ge, "ˇ", "\\check");
c(f, p, Ge, "^", "\\hat");
c(f, p, Ge, "⃗", "\\vec");
c(f, p, Ge, "˙", "\\dot");
c(f, p, Ge, "˚", "\\mathring");
c(f, p, se, "", "\\@imath");
c(f, p, se, "", "\\@jmath");
c(f, p, E, "ı", "ı");
c(f, p, E, "ȷ", "ȷ");
c(R, p, E, "ı", "\\i", !0);
c(R, p, E, "ȷ", "\\j", !0);
c(R, p, E, "ß", "\\ss", !0);
c(R, p, E, "æ", "\\ae", !0);
c(R, p, E, "œ", "\\oe", !0);
c(R, p, E, "ø", "\\o", !0);
c(R, p, E, "Æ", "\\AE", !0);
c(R, p, E, "Œ", "\\OE", !0);
c(R, p, E, "Ø", "\\O", !0);
c(R, p, Ge, "ˊ", "\\'");
c(R, p, Ge, "ˋ", "\\`");
c(R, p, Ge, "ˆ", "\\^");
c(R, p, Ge, "˜", "\\~");
c(R, p, Ge, "ˉ", "\\=");
c(R, p, Ge, "˘", "\\u");
c(R, p, Ge, "˙", "\\.");
c(R, p, Ge, "¸", "\\c");
c(R, p, Ge, "˚", "\\r");
c(R, p, Ge, "ˇ", "\\v");
c(R, p, Ge, "¨", '\\"');
c(R, p, Ge, "˝", "\\H");
c(R, p, Ge, "◯", "\\textcircled");
var Q1 = {
  "--": !0,
  "---": !0,
  "``": !0,
  "''": !0
};
c(R, p, E, "–", "--", !0);
c(R, p, E, "–", "\\textendash");
c(R, p, E, "—", "---", !0);
c(R, p, E, "—", "\\textemdash");
c(R, p, E, "‘", "`", !0);
c(R, p, E, "‘", "\\textquoteleft");
c(R, p, E, "’", "'", !0);
c(R, p, E, "’", "\\textquoteright");
c(R, p, E, "“", "``", !0);
c(R, p, E, "“", "\\textquotedblleft");
c(R, p, E, "”", "''", !0);
c(R, p, E, "”", "\\textquotedblright");
c(f, p, E, "°", "\\degree", !0);
c(R, p, E, "°", "\\degree");
c(R, p, E, "°", "\\textdegree", !0);
c(f, p, E, "£", "\\pounds");
c(f, p, E, "£", "\\mathsterling", !0);
c(R, p, E, "£", "\\pounds");
c(R, p, E, "£", "\\textsterling", !0);
c(f, S, E, "✠", "\\maltese");
c(R, S, E, "✠", "\\maltese");
var go = '0123456789/@."';
for (var Ji = 0; Ji < go.length; Ji++) {
  var _o = go.charAt(Ji);
  c(f, p, E, _o, _o);
}
var vo = '0123456789!@*()-=+";:?/.,';
for (var es = 0; es < vo.length; es++) {
  var bo = vo.charAt(es);
  c(R, p, E, bo, bo);
}
var yi = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
for (var ts = 0; ts < yi.length; ts++) {
  var Aa = yi.charAt(ts);
  c(f, p, se, Aa, Aa), c(R, p, E, Aa, Aa);
}
c(f, S, E, "C", "ℂ");
c(R, S, E, "C", "ℂ");
c(f, S, E, "H", "ℍ");
c(R, S, E, "H", "ℍ");
c(f, S, E, "N", "ℕ");
c(R, S, E, "N", "ℕ");
c(f, S, E, "P", "ℙ");
c(R, S, E, "P", "ℙ");
c(f, S, E, "Q", "ℚ");
c(R, S, E, "Q", "ℚ");
c(f, S, E, "R", "ℝ");
c(R, S, E, "R", "ℝ");
c(f, S, E, "Z", "ℤ");
c(R, S, E, "Z", "ℤ");
c(f, p, se, "h", "ℎ");
c(R, p, se, "h", "ℎ");
var fe = "";
for (var It = 0; It < yi.length; It++) {
  var et = yi.charAt(It);
  fe = String.fromCharCode(55349, 56320 + It), c(f, p, se, et, fe), c(R, p, E, et, fe), fe = String.fromCharCode(55349, 56372 + It), c(f, p, se, et, fe), c(R, p, E, et, fe), fe = String.fromCharCode(55349, 56424 + It), c(f, p, se, et, fe), c(R, p, E, et, fe), fe = String.fromCharCode(55349, 56580 + It), c(f, p, se, et, fe), c(R, p, E, et, fe), fe = String.fromCharCode(55349, 56684 + It), c(f, p, se, et, fe), c(R, p, E, et, fe), fe = String.fromCharCode(55349, 56736 + It), c(f, p, se, et, fe), c(R, p, E, et, fe), fe = String.fromCharCode(55349, 56788 + It), c(f, p, se, et, fe), c(R, p, E, et, fe), fe = String.fromCharCode(55349, 56840 + It), c(f, p, se, et, fe), c(R, p, E, et, fe), fe = String.fromCharCode(55349, 56944 + It), c(f, p, se, et, fe), c(R, p, E, et, fe), It < 26 && (fe = String.fromCharCode(55349, 56632 + It), c(f, p, se, et, fe), c(R, p, E, et, fe), fe = String.fromCharCode(55349, 56476 + It), c(f, p, se, et, fe), c(R, p, E, et, fe));
}
fe = "𝕜";
c(f, p, se, "k", fe);
c(R, p, E, "k", fe);
for (var G0 = 0; G0 < 10; G0++) {
  var D0 = G0.toString();
  fe = String.fromCharCode(55349, 57294 + G0), c(f, p, se, D0, fe), c(R, p, E, D0, fe), fe = String.fromCharCode(55349, 57314 + G0), c(f, p, se, D0, fe), c(R, p, E, D0, fe), fe = String.fromCharCode(55349, 57324 + G0), c(f, p, se, D0, fe), c(R, p, E, D0, fe), fe = String.fromCharCode(55349, 57334 + G0), c(f, p, se, D0, fe), c(R, p, E, D0, fe);
}
var Js = "ÐÞþ";
for (var ns = 0; ns < Js.length; ns++) {
  var Ea = Js.charAt(ns);
  c(f, p, se, Ea, Ea), c(R, p, E, Ea, Ea);
}
var Ca = [
  ["mathbf", "textbf", "Main-Bold"],
  // A-Z bold upright
  ["mathbf", "textbf", "Main-Bold"],
  // a-z bold upright
  ["mathnormal", "textit", "Math-Italic"],
  // A-Z italic
  ["mathnormal", "textit", "Math-Italic"],
  // a-z italic
  ["boldsymbol", "boldsymbol", "Main-BoldItalic"],
  // A-Z bold italic
  ["boldsymbol", "boldsymbol", "Main-BoldItalic"],
  // a-z bold italic
  // Map fancy A-Z letters to script, not calligraphic.
  // This aligns with unicode-math and math fonts (except Cambria Math).
  ["mathscr", "textscr", "Script-Regular"],
  // A-Z script
  ["", "", ""],
  // a-z script.  No font
  ["", "", ""],
  // A-Z bold script. No font
  ["", "", ""],
  // a-z bold script. No font
  ["mathfrak", "textfrak", "Fraktur-Regular"],
  // A-Z Fraktur
  ["mathfrak", "textfrak", "Fraktur-Regular"],
  // a-z Fraktur
  ["mathbb", "textbb", "AMS-Regular"],
  // A-Z double-struck
  ["mathbb", "textbb", "AMS-Regular"],
  // k double-struck
  // Note that we are using a bold font, but font metrics for regular Fraktur.
  ["mathboldfrak", "textboldfrak", "Fraktur-Regular"],
  // A-Z bold Fraktur
  ["mathboldfrak", "textboldfrak", "Fraktur-Regular"],
  // a-z bold Fraktur
  ["mathsf", "textsf", "SansSerif-Regular"],
  // A-Z sans-serif
  ["mathsf", "textsf", "SansSerif-Regular"],
  // a-z sans-serif
  ["mathboldsf", "textboldsf", "SansSerif-Bold"],
  // A-Z bold sans-serif
  ["mathboldsf", "textboldsf", "SansSerif-Bold"],
  // a-z bold sans-serif
  ["mathitsf", "textitsf", "SansSerif-Italic"],
  // A-Z italic sans-serif
  ["mathitsf", "textitsf", "SansSerif-Italic"],
  // a-z italic sans-serif
  ["", "", ""],
  // A-Z bold italic sans. No font
  ["", "", ""],
  // a-z bold italic sans. No font
  ["mathtt", "texttt", "Typewriter-Regular"],
  // A-Z monospace
  ["mathtt", "texttt", "Typewriter-Regular"]
  // a-z monospace
], yo = [
  ["mathbf", "textbf", "Main-Bold"],
  // 0-9 bold
  ["", "", ""],
  // 0-9 double-struck. No KaTeX font.
  ["mathsf", "textsf", "SansSerif-Regular"],
  // 0-9 sans-serif
  ["mathboldsf", "textboldsf", "SansSerif-Bold"],
  // 0-9 bold sans-serif
  ["mathtt", "texttt", "Typewriter-Regular"]
  // 0-9 monospace
], ad = function(e, t) {
  var n = e.charCodeAt(0), a = e.charCodeAt(1), i = (n - 55296) * 1024 + (a - 56320) + 65536, s = t === "math" ? 0 : 1;
  if (119808 <= i && i < 120484) {
    var l = Math.floor((i - 119808) / 26);
    return [Ca[l][2], Ca[l][s]];
  } else if (120782 <= i && i <= 120831) {
    var o = Math.floor((i - 120782) / 10);
    return [yo[o][2], yo[o][s]];
  } else {
    if (i === 120485 || i === 120486)
      return [Ca[0][2], Ca[0][s]];
    if (120486 < i && i < 120782)
      return ["", ""];
    throw new U("Unsupported character: " + e);
  }
}, Fi = function(e, t, n) {
  return Re[n][e] && Re[n][e].replace && (e = Re[n][e].replace), {
    value: e,
    metrics: Dl(e, t, n)
  };
}, zn = function(e, t, n, a, i) {
  var s = Fi(e, t, n), l = s.metrics;
  e = s.value;
  var o;
  if (l) {
    var u = l.italic;
    (n === "text" || a && a.font === "mathit") && (u = 0), o = new wn(e, l.height, l.depth, u, l.skew, l.width, i);
  } else
    typeof console < "u" && console.warn("No character metrics " + ("for '" + e + "' in style '" + t + "' and mode '" + n + "'")), o = new wn(e, 0, 0, 0, 0, 0, i);
  if (a) {
    o.maxFontSize = a.sizeMultiplier, a.style.isTight() && o.classes.push("mtight");
    var h = a.getColor();
    h && (o.style.color = h);
  }
  return o;
}, id = function(e, t, n, a) {
  return a === void 0 && (a = []), n.font === "boldsymbol" && Fi(e, "Main-Bold", t).metrics ? zn(e, "Main-Bold", t, n, a.concat(["mathbf"])) : e === "\\" || Re[t][e].font === "main" ? zn(e, "Main-Regular", t, n, a) : zn(e, "AMS-Regular", t, n, a.concat(["amsrm"]));
}, sd = function(e, t, n, a, i) {
  return i !== "textord" && Fi(e, "Math-BoldItalic", t).metrics ? {
    fontName: "Math-BoldItalic",
    fontClass: "boldsymbol"
  } : {
    fontName: "Main-Bold",
    fontClass: "mathbf"
  };
}, ld = function(e, t, n) {
  var a = e.mode, i = e.text, s = ["mord"], l = a === "math" || a === "text" && t.font, o = l ? t.font : t.fontFamily, u = "", h = "";
  if (i.charCodeAt(0) === 55349 && ([u, h] = ad(i, a)), u.length > 0)
    return zn(i, u, a, t, s.concat(h));
  if (o) {
    var m, d;
    if (o === "boldsymbol") {
      var g = sd(i, a, t, s, n);
      m = g.fontName, d = [g.fontClass];
    } else l ? (m = tc[o].fontName, d = [o]) : (m = $a(o, t.fontWeight, t.fontShape), d = [o, t.fontWeight, t.fontShape]);
    if (Fi(i, m, a).metrics)
      return zn(i, m, a, t, s.concat(d));
    if (Q1.hasOwnProperty(i) && m.slice(0, 10) === "Typewriter") {
      for (var b = [], v = 0; v < i.length; v++)
        b.push(zn(i[v], m, a, t, s.concat(d)));
      return ec(b);
    }
  }
  if (n === "mathord")
    return zn(i, "Math-Italic", a, t, s.concat(["mathnormal"]));
  if (n === "textord") {
    var w = Re[a][i] && Re[a][i].font;
    if (w === "ams") {
      var x = $a("amsrm", t.fontWeight, t.fontShape);
      return zn(i, x, a, t, s.concat("amsrm", t.fontWeight, t.fontShape));
    } else if (w === "main" || !w) {
      var k = $a("textrm", t.fontWeight, t.fontShape);
      return zn(i, k, a, t, s.concat(t.fontWeight, t.fontShape));
    } else {
      var y = $a(w, t.fontWeight, t.fontShape);
      return zn(i, y, a, t, s.concat(y, t.fontWeight, t.fontShape));
    }
  } else
    throw new Error("unexpected type: " + n + " in makeOrd");
}, od = (r, e) => {
  if (B0(r.classes) !== B0(e.classes) || r.skew !== e.skew || r.maxFontSize !== e.maxFontSize)
    return !1;
  if (r.classes.length === 1) {
    var t = r.classes[0];
    if (t === "mbin" || t === "mord")
      return !1;
  }
  for (var n in r.style)
    if (r.style.hasOwnProperty(n) && r.style[n] !== e.style[n])
      return !1;
  for (var a in e.style)
    if (e.style.hasOwnProperty(a) && r.style[a] !== e.style[a])
      return !1;
  return !0;
}, ud = (r) => {
  for (var e = 0; e < r.length - 1; e++) {
    var t = r[e], n = r[e + 1];
    t instanceof wn && n instanceof wn && od(t, n) && (t.text += n.text, t.height = Math.max(t.height, n.height), t.depth = Math.max(t.depth, n.depth), t.italic = n.italic, r.splice(e + 1, 1), e--);
  }
  return r;
}, Al = function(e) {
  for (var t = 0, n = 0, a = 0, i = 0; i < e.children.length; i++) {
    var s = e.children[i];
    s.height > t && (t = s.height), s.depth > n && (n = s.depth), s.maxFontSize > a && (a = s.maxFontSize);
  }
  e.height = t, e.depth = n, e.maxFontSize = a;
}, Wt = function(e, t, n, a) {
  var i = new fa(e, t, n, a);
  return Al(i), i;
}, J1 = (r, e, t, n) => new fa(r, e, t, n), cd = function(e, t, n) {
  var a = Wt([e], [], t);
  return a.height = Math.max(n || t.fontMetrics().defaultRuleThickness, t.minRuleThickness), a.style.borderBottomWidth = W(a.height), a.maxFontSize = 1, a;
}, hd = function(e, t, n, a) {
  var i = new xl(e, t, n, a);
  return Al(i), i;
}, ec = function(e) {
  var t = new ha(e);
  return Al(t), t;
}, fd = function(e, t) {
  return e instanceof ha ? Wt([], [e], t) : e;
}, dd = function(e) {
  if (e.positionType === "individualShift") {
    for (var t = e.children, n = [t[0]], a = -t[0].shift - t[0].elem.depth, i = a, s = 1; s < t.length; s++) {
      var l = -t[s].shift - i - t[s].elem.depth, o = l - (t[s - 1].elem.height + t[s - 1].elem.depth);
      i = i + l, n.push({
        type: "kern",
        size: o
      }), n.push(t[s]);
    }
    return {
      children: n,
      depth: a
    };
  }
  var u;
  if (e.positionType === "top") {
    for (var h = e.positionData, m = 0; m < e.children.length; m++) {
      var d = e.children[m];
      h -= d.type === "kern" ? d.size : d.elem.height + d.elem.depth;
    }
    u = h;
  } else if (e.positionType === "bottom")
    u = -e.positionData;
  else {
    var g = e.children[0];
    if (g.type !== "elem")
      throw new Error('First child must have type "elem".');
    if (e.positionType === "shift")
      u = -g.elem.depth - e.positionData;
    else if (e.positionType === "firstBaseline")
      u = -g.elem.depth;
    else
      throw new Error("Invalid positionType " + e.positionType + ".");
  }
  return {
    children: e.children,
    depth: u
  };
}, md = function(e, t) {
  for (var {
    children: n,
    depth: a
  } = dd(e), i = 0, s = 0; s < n.length; s++) {
    var l = n[s];
    if (l.type === "elem") {
      var o = l.elem;
      i = Math.max(i, o.maxFontSize, o.height);
    }
  }
  i += 2;
  var u = Wt(["pstrut"], []);
  u.style.height = W(i);
  for (var h = [], m = a, d = a, g = a, b = 0; b < n.length; b++) {
    var v = n[b];
    if (v.type === "kern")
      g += v.size;
    else {
      var w = v.elem, x = v.wrapperClasses || [], k = v.wrapperStyle || {}, y = Wt(x, [u, w], void 0, k);
      y.style.top = W(-i - g - w.depth), v.marginLeft && (y.style.marginLeft = v.marginLeft), v.marginRight && (y.style.marginRight = v.marginRight), h.push(y), g += w.height + w.depth;
    }
    m = Math.min(m, g), d = Math.max(d, g);
  }
  var A = Wt(["vlist"], h);
  A.style.height = W(d);
  var $;
  if (m < 0) {
    var M = Wt([], []), z = Wt(["vlist"], [M]);
    z.style.height = W(-m);
    var O = Wt(["vlist-s"], [new wn("​")]);
    $ = [Wt(["vlist-r"], [A, O]), Wt(["vlist-r"], [z])];
  } else
    $ = [Wt(["vlist-r"], [A])];
  var L = Wt(["vlist-t"], $);
  return $.length === 2 && L.classes.push("vlist-t2"), L.height = d, L.depth = -m, L;
}, pd = (r, e) => {
  var t = Wt(["mspace"], [], e), n = We(r, e);
  return t.style.marginRight = W(n), t;
}, $a = function(e, t, n) {
  var a = "";
  switch (e) {
    case "amsrm":
      a = "AMS";
      break;
    case "textrm":
      a = "Main";
      break;
    case "textsf":
      a = "SansSerif";
      break;
    case "texttt":
      a = "Typewriter";
      break;
    default:
      a = e;
  }
  var i;
  return t === "textbf" && n === "textit" ? i = "BoldItalic" : t === "textbf" ? i = "Bold" : t === "textit" ? i = "Italic" : i = "Regular", a + "-" + i;
}, tc = {
  // styles
  mathbf: {
    variant: "bold",
    fontName: "Main-Bold"
  },
  mathrm: {
    variant: "normal",
    fontName: "Main-Regular"
  },
  textit: {
    variant: "italic",
    fontName: "Main-Italic"
  },
  mathit: {
    variant: "italic",
    fontName: "Main-Italic"
  },
  mathnormal: {
    variant: "italic",
    fontName: "Math-Italic"
  },
  mathsfit: {
    variant: "sans-serif-italic",
    fontName: "SansSerif-Italic"
  },
  // "boldsymbol" is missing because they require the use of multiple fonts:
  // Math-BoldItalic and Main-Bold.  This is handled by a special case in
  // makeOrd which ends up calling boldsymbol.
  // families
  mathbb: {
    variant: "double-struck",
    fontName: "AMS-Regular"
  },
  mathcal: {
    variant: "script",
    fontName: "Caligraphic-Regular"
  },
  mathfrak: {
    variant: "fraktur",
    fontName: "Fraktur-Regular"
  },
  mathscr: {
    variant: "script",
    fontName: "Script-Regular"
  },
  mathsf: {
    variant: "sans-serif",
    fontName: "SansSerif-Regular"
  },
  mathtt: {
    variant: "monospace",
    fontName: "Typewriter-Regular"
  }
}, nc = {
  //   path, width, height
  vec: ["vec", 0.471, 0.714],
  // values from the font glyph
  oiintSize1: ["oiintSize1", 0.957, 0.499],
  // oval to overlay the integrand
  oiintSize2: ["oiintSize2", 1.472, 0.659],
  oiiintSize1: ["oiiintSize1", 1.304, 0.499],
  oiiintSize2: ["oiiintSize2", 1.98, 0.659]
}, gd = function(e, t) {
  var [n, a, i] = nc[e], s = new N0(n), l = new m0([s], {
    width: W(a),
    height: W(i),
    // Override CSS rule `.katex svg { width: 100% }`
    style: "width:" + W(a),
    viewBox: "0 0 " + 1e3 * a + " " + 1e3 * i,
    preserveAspectRatio: "xMinYMin"
  }), o = J1(["overlay"], [l], t);
  return o.height = i, o.style.height = W(i), o.style.width = W(a), o;
}, F = {
  fontMap: tc,
  makeSymbol: zn,
  mathsym: id,
  makeSpan: Wt,
  makeSvgSpan: J1,
  makeLineSpan: cd,
  makeAnchor: hd,
  makeFragment: ec,
  wrapFragment: fd,
  makeVList: md,
  makeOrd: ld,
  makeGlue: pd,
  staticSvg: gd,
  svgData: nc,
  tryCombineChars: ud
}, Ve = {
  number: 3,
  unit: "mu"
}, j0 = {
  number: 4,
  unit: "mu"
}, i0 = {
  number: 5,
  unit: "mu"
}, _d = {
  mord: {
    mop: Ve,
    mbin: j0,
    mrel: i0,
    minner: Ve
  },
  mop: {
    mord: Ve,
    mop: Ve,
    mrel: i0,
    minner: Ve
  },
  mbin: {
    mord: j0,
    mop: j0,
    mopen: j0,
    minner: j0
  },
  mrel: {
    mord: i0,
    mop: i0,
    mopen: i0,
    minner: i0
  },
  mopen: {},
  mclose: {
    mop: Ve,
    mbin: j0,
    mrel: i0,
    minner: Ve
  },
  mpunct: {
    mord: Ve,
    mop: Ve,
    mrel: i0,
    mopen: Ve,
    mclose: Ve,
    mpunct: Ve,
    minner: Ve
  },
  minner: {
    mord: Ve,
    mop: Ve,
    mbin: j0,
    mrel: i0,
    mopen: Ve,
    mpunct: Ve,
    minner: Ve
  }
}, vd = {
  mord: {
    mop: Ve
  },
  mop: {
    mord: Ve,
    mop: Ve
  },
  mbin: {},
  mrel: {},
  mopen: {},
  mclose: {
    mop: Ve
  },
  mpunct: {},
  minner: {
    mop: Ve
  }
}, rc = {}, wi = {}, ki = {};
function Y(r) {
  for (var {
    type: e,
    names: t,
    props: n,
    handler: a,
    htmlBuilder: i,
    mathmlBuilder: s
  } = r, l = {
    type: e,
    numArgs: n.numArgs,
    argTypes: n.argTypes,
    allowedInArgument: !!n.allowedInArgument,
    allowedInText: !!n.allowedInText,
    allowedInMath: n.allowedInMath === void 0 ? !0 : n.allowedInMath,
    numOptionalArgs: n.numOptionalArgs || 0,
    infix: !!n.infix,
    primitive: !!n.primitive,
    handler: a
  }, o = 0; o < t.length; ++o)
    rc[t[o]] = l;
  e && (i && (wi[e] = i), s && (ki[e] = s));
}
function tr(r) {
  var {
    type: e,
    htmlBuilder: t,
    mathmlBuilder: n
  } = r;
  Y({
    type: e,
    names: [],
    props: {
      numArgs: 0
    },
    handler() {
      throw new Error("Should never be called.");
    },
    htmlBuilder: t,
    mathmlBuilder: n
  });
}
var Si = function(e) {
  return e.type === "ordgroup" && e.body.length === 1 ? e.body[0] : e;
}, it = function(e) {
  return e.type === "ordgroup" ? e.body : [e];
}, p0 = F.makeSpan, bd = ["leftmost", "mbin", "mopen", "mrel", "mop", "mpunct"], yd = ["rightmost", "mrel", "mclose", "mpunct"], wd = {
  display: le.DISPLAY,
  text: le.TEXT,
  script: le.SCRIPT,
  scriptscript: le.SCRIPTSCRIPT
}, kd = {
  mord: "mord",
  mop: "mop",
  mbin: "mbin",
  mrel: "mrel",
  mopen: "mopen",
  mclose: "mclose",
  mpunct: "mpunct",
  minner: "minner"
}, _t = function(e, t, n, a) {
  a === void 0 && (a = [null, null]);
  for (var i = [], s = 0; s < e.length; s++) {
    var l = xe(e[s], t);
    if (l instanceof ha) {
      var o = l.children;
      i.push(...o);
    } else
      i.push(l);
  }
  if (F.tryCombineChars(i), !n)
    return i;
  var u = t;
  if (e.length === 1) {
    var h = e[0];
    h.type === "sizing" ? u = t.havingSize(h.size) : h.type === "styling" && (u = t.havingStyle(wd[h.style]));
  }
  var m = p0([a[0] || "leftmost"], [], t), d = p0([a[1] || "rightmost"], [], t), g = n === "root";
  return wo(i, (b, v) => {
    var w = v.classes[0], x = b.classes[0];
    w === "mbin" && ae.contains(yd, x) ? v.classes[0] = "mord" : x === "mbin" && ae.contains(bd, w) && (b.classes[0] = "mord");
  }, {
    node: m
  }, d, g), wo(i, (b, v) => {
    var w = el(v), x = el(b), k = w && x ? b.hasClass("mtight") ? vd[w][x] : _d[w][x] : null;
    if (k)
      return F.makeGlue(k, u);
  }, {
    node: m
  }, d, g), i;
}, wo = function r(e, t, n, a, i) {
  a && e.push(a);
  for (var s = 0; s < e.length; s++) {
    var l = e[s], o = ac(l);
    if (o) {
      r(o.children, t, n, null, i);
      continue;
    }
    var u = !l.hasClass("mspace");
    if (u) {
      var h = t(l, n.node);
      h && (n.insertAfter ? n.insertAfter(h) : (e.unshift(h), s++));
    }
    u ? n.node = l : i && l.hasClass("newline") && (n.node = p0(["leftmost"])), n.insertAfter = /* @__PURE__ */ ((m) => (d) => {
      e.splice(m + 1, 0, d), s++;
    })(s);
  }
  a && e.pop();
}, ac = function(e) {
  return e instanceof ha || e instanceof xl || e instanceof fa && e.hasClass("enclosing") ? e : null;
}, Sd = function r(e, t) {
  var n = ac(e);
  if (n) {
    var a = n.children;
    if (a.length) {
      if (t === "right")
        return r(a[a.length - 1], "right");
      if (t === "left")
        return r(a[0], "left");
    }
  }
  return e;
}, el = function(e, t) {
  return e ? (t && (e = Sd(e, t)), kd[e.classes[0]] || null) : null;
}, ia = function(e, t) {
  var n = ["nulldelimiter"].concat(e.baseSizingClasses());
  return p0(t.concat(n));
}, xe = function(e, t, n) {
  if (!e)
    return p0();
  if (wi[e.type]) {
    var a = wi[e.type](e, t);
    if (n && t.size !== n.size) {
      a = p0(t.sizingClasses(n), [a], t);
      var i = t.sizeMultiplier / n.sizeMultiplier;
      a.height *= i, a.depth *= i;
    }
    return a;
  } else
    throw new U("Got group of unknown type: '" + e.type + "'");
};
function Ta(r, e) {
  var t = p0(["base"], r, e), n = p0(["strut"]);
  return n.style.height = W(t.height + t.depth), t.depth && (n.style.verticalAlign = W(-t.depth)), t.children.unshift(n), t;
}
function tl(r, e) {
  var t = null;
  r.length === 1 && r[0].type === "tag" && (t = r[0].tag, r = r[0].body);
  var n = _t(r, e, "root"), a;
  n.length === 2 && n[1].hasClass("tag") && (a = n.pop());
  for (var i = [], s = [], l = 0; l < n.length; l++)
    if (s.push(n[l]), n[l].hasClass("mbin") || n[l].hasClass("mrel") || n[l].hasClass("allowbreak")) {
      for (var o = !1; l < n.length - 1 && n[l + 1].hasClass("mspace") && !n[l + 1].hasClass("newline"); )
        l++, s.push(n[l]), n[l].hasClass("nobreak") && (o = !0);
      o || (i.push(Ta(s, e)), s = []);
    } else n[l].hasClass("newline") && (s.pop(), s.length > 0 && (i.push(Ta(s, e)), s = []), i.push(n[l]));
  s.length > 0 && i.push(Ta(s, e));
  var u;
  t ? (u = Ta(_t(t, e, !0)), u.classes = ["tag"], i.push(u)) : a && i.push(a);
  var h = p0(["katex-html"], i);
  if (h.setAttribute("aria-hidden", "true"), u) {
    var m = u.children[0];
    m.style.height = W(h.height + h.depth), h.depth && (m.style.verticalAlign = W(-h.depth));
  }
  return h;
}
function ic(r) {
  return new ha(r);
}
class sn {
  constructor(e, t, n) {
    this.type = void 0, this.attributes = void 0, this.children = void 0, this.classes = void 0, this.type = e, this.attributes = {}, this.children = t || [], this.classes = n || [];
  }
  /**
   * Sets an attribute on a MathML node. MathML depends on attributes to convey a
   * semantic content, so this is used heavily.
   */
  setAttribute(e, t) {
    this.attributes[e] = t;
  }
  /**
   * Gets an attribute on a MathML node.
   */
  getAttribute(e) {
    return this.attributes[e];
  }
  /**
   * Converts the math node into a MathML-namespaced DOM element.
   */
  toNode() {
    var e = document.createElementNS("http://www.w3.org/1998/Math/MathML", this.type);
    for (var t in this.attributes)
      Object.prototype.hasOwnProperty.call(this.attributes, t) && e.setAttribute(t, this.attributes[t]);
    this.classes.length > 0 && (e.className = B0(this.classes));
    for (var n = 0; n < this.children.length; n++)
      if (this.children[n] instanceof Un && this.children[n + 1] instanceof Un) {
        for (var a = this.children[n].toText() + this.children[++n].toText(); this.children[n + 1] instanceof Un; )
          a += this.children[++n].toText();
        e.appendChild(new Un(a).toNode());
      } else
        e.appendChild(this.children[n].toNode());
    return e;
  }
  /**
   * Converts the math node into an HTML markup string.
   */
  toMarkup() {
    var e = "<" + this.type;
    for (var t in this.attributes)
      Object.prototype.hasOwnProperty.call(this.attributes, t) && (e += " " + t + '="', e += ae.escape(this.attributes[t]), e += '"');
    this.classes.length > 0 && (e += ' class ="' + ae.escape(B0(this.classes)) + '"'), e += ">";
    for (var n = 0; n < this.children.length; n++)
      e += this.children[n].toMarkup();
    return e += "</" + this.type + ">", e;
  }
  /**
   * Converts the math node into a string, similar to innerText, but escaped.
   */
  toText() {
    return this.children.map((e) => e.toText()).join("");
  }
}
class Un {
  constructor(e) {
    this.text = void 0, this.text = e;
  }
  /**
   * Converts the text node into a DOM text node.
   */
  toNode() {
    return document.createTextNode(this.text);
  }
  /**
   * Converts the text node into escaped HTML markup
   * (representing the text itself).
   */
  toMarkup() {
    return ae.escape(this.toText());
  }
  /**
   * Converts the text node into a string
   * (representing the text itself).
   */
  toText() {
    return this.text;
  }
}
class Dd {
  /**
   * Create a Space node with width given in CSS ems.
   */
  constructor(e) {
    this.width = void 0, this.character = void 0, this.width = e, e >= 0.05555 && e <= 0.05556 ? this.character = " " : e >= 0.1666 && e <= 0.1667 ? this.character = " " : e >= 0.2222 && e <= 0.2223 ? this.character = " " : e >= 0.2777 && e <= 0.2778 ? this.character = "  " : e >= -0.05556 && e <= -0.05555 ? this.character = " ⁣" : e >= -0.1667 && e <= -0.1666 ? this.character = " ⁣" : e >= -0.2223 && e <= -0.2222 ? this.character = " ⁣" : e >= -0.2778 && e <= -0.2777 ? this.character = " ⁣" : this.character = null;
  }
  /**
   * Converts the math node into a MathML-namespaced DOM element.
   */
  toNode() {
    if (this.character)
      return document.createTextNode(this.character);
    var e = document.createElementNS("http://www.w3.org/1998/Math/MathML", "mspace");
    return e.setAttribute("width", W(this.width)), e;
  }
  /**
   * Converts the math node into an HTML markup string.
   */
  toMarkup() {
    return this.character ? "<mtext>" + this.character + "</mtext>" : '<mspace width="' + W(this.width) + '"/>';
  }
  /**
   * Converts the math node into a string, similar to innerText.
   */
  toText() {
    return this.character ? this.character : " ";
  }
}
var P = {
  MathNode: sn,
  TextNode: Un,
  SpaceNode: Dd,
  newDocumentFragment: ic
}, kn = function(e, t, n) {
  return Re[t][e] && Re[t][e].replace && e.charCodeAt(0) !== 55349 && !(Q1.hasOwnProperty(e) && n && (n.fontFamily && n.fontFamily.slice(4, 6) === "tt" || n.font && n.font.slice(4, 6) === "tt")) && (e = Re[t][e].replace), new P.TextNode(e);
}, El = function(e) {
  return e.length === 1 ? e[0] : new P.MathNode("mrow", e);
}, Cl = function(e, t) {
  if (t.fontFamily === "texttt")
    return "monospace";
  if (t.fontFamily === "textsf")
    return t.fontShape === "textit" && t.fontWeight === "textbf" ? "sans-serif-bold-italic" : t.fontShape === "textit" ? "sans-serif-italic" : t.fontWeight === "textbf" ? "bold-sans-serif" : "sans-serif";
  if (t.fontShape === "textit" && t.fontWeight === "textbf")
    return "bold-italic";
  if (t.fontShape === "textit")
    return "italic";
  if (t.fontWeight === "textbf")
    return "bold";
  var n = t.font;
  if (!n || n === "mathnormal")
    return null;
  var a = e.mode;
  if (n === "mathit")
    return "italic";
  if (n === "boldsymbol")
    return e.type === "textord" ? "bold" : "bold-italic";
  if (n === "mathbf")
    return "bold";
  if (n === "mathbb")
    return "double-struck";
  if (n === "mathsfit")
    return "sans-serif-italic";
  if (n === "mathfrak")
    return "fraktur";
  if (n === "mathscr" || n === "mathcal")
    return "script";
  if (n === "mathsf")
    return "sans-serif";
  if (n === "mathtt")
    return "monospace";
  var i = e.text;
  if (ae.contains(["\\imath", "\\jmath"], i))
    return null;
  Re[a][i] && Re[a][i].replace && (i = Re[a][i].replace);
  var s = F.fontMap[n].fontName;
  return Dl(i, s, a) ? F.fontMap[n].variant : null;
};
function rs(r) {
  if (!r)
    return !1;
  if (r.type === "mi" && r.children.length === 1) {
    var e = r.children[0];
    return e instanceof Un && e.text === ".";
  } else if (r.type === "mo" && r.children.length === 1 && r.getAttribute("separator") === "true" && r.getAttribute("lspace") === "0em" && r.getAttribute("rspace") === "0em") {
    var t = r.children[0];
    return t instanceof Un && t.text === ",";
  } else
    return !1;
}
var Yt = function(e, t, n) {
  if (e.length === 1) {
    var a = Le(e[0], t);
    return n && a instanceof sn && a.type === "mo" && (a.setAttribute("lspace", "0em"), a.setAttribute("rspace", "0em")), [a];
  }
  for (var i = [], s, l = 0; l < e.length; l++) {
    var o = Le(e[l], t);
    if (o instanceof sn && s instanceof sn) {
      if (o.type === "mtext" && s.type === "mtext" && o.getAttribute("mathvariant") === s.getAttribute("mathvariant")) {
        s.children.push(...o.children);
        continue;
      } else if (o.type === "mn" && s.type === "mn") {
        s.children.push(...o.children);
        continue;
      } else if (rs(o) && s.type === "mn") {
        s.children.push(...o.children);
        continue;
      } else if (o.type === "mn" && rs(s))
        o.children = [...s.children, ...o.children], i.pop();
      else if ((o.type === "msup" || o.type === "msub") && o.children.length >= 1 && (s.type === "mn" || rs(s))) {
        var u = o.children[0];
        u instanceof sn && u.type === "mn" && (u.children = [...s.children, ...u.children], i.pop());
      } else if (s.type === "mi" && s.children.length === 1) {
        var h = s.children[0];
        if (h instanceof Un && h.text === "̸" && (o.type === "mo" || o.type === "mi" || o.type === "mn")) {
          var m = o.children[0];
          m instanceof Un && m.text.length > 0 && (m.text = m.text.slice(0, 1) + "̸" + m.text.slice(1), i.pop());
        }
      }
    }
    i.push(o), s = o;
  }
  return i;
}, q0 = function(e, t, n) {
  return El(Yt(e, t, n));
}, Le = function(e, t) {
  if (!e)
    return new P.MathNode("mrow");
  if (ki[e.type]) {
    var n = ki[e.type](e, t);
    return n;
  } else
    throw new U("Got group of unknown type: '" + e.type + "'");
};
function ko(r, e, t, n, a) {
  var i = Yt(r, t), s;
  i.length === 1 && i[0] instanceof sn && ae.contains(["mrow", "mtable"], i[0].type) ? s = i[0] : s = new P.MathNode("mrow", i);
  var l = new P.MathNode("annotation", [new P.TextNode(e)]);
  l.setAttribute("encoding", "application/x-tex");
  var o = new P.MathNode("semantics", [s, l]), u = new P.MathNode("math", [o]);
  u.setAttribute("xmlns", "http://www.w3.org/1998/Math/MathML"), n && u.setAttribute("display", "block");
  var h = a ? "katex" : "katex-mathml";
  return F.makeSpan([h], [u]);
}
var sc = function(e) {
  return new u0({
    style: e.displayMode ? le.DISPLAY : le.TEXT,
    maxSize: e.maxSize,
    minRuleThickness: e.minRuleThickness
  });
}, lc = function(e, t) {
  if (t.displayMode) {
    var n = ["katex-display"];
    t.leqno && n.push("leqno"), t.fleqn && n.push("fleqn"), e = F.makeSpan(n, [e]);
  }
  return e;
}, xd = function(e, t, n) {
  var a = sc(n), i;
  if (n.output === "mathml")
    return ko(e, t, a, n.displayMode, !0);
  if (n.output === "html") {
    var s = tl(e, a);
    i = F.makeSpan(["katex"], [s]);
  } else {
    var l = ko(e, t, a, n.displayMode, !1), o = tl(e, a);
    i = F.makeSpan(["katex"], [l, o]);
  }
  return lc(i, n);
}, Ad = function(e, t, n) {
  var a = sc(n), i = tl(e, a), s = F.makeSpan(["katex"], [i]);
  return lc(s, n);
}, Ed = {
  widehat: "^",
  widecheck: "ˇ",
  widetilde: "~",
  utilde: "~",
  overleftarrow: "←",
  underleftarrow: "←",
  xleftarrow: "←",
  overrightarrow: "→",
  underrightarrow: "→",
  xrightarrow: "→",
  underbrace: "⏟",
  overbrace: "⏞",
  overgroup: "⏠",
  undergroup: "⏡",
  overleftrightarrow: "↔",
  underleftrightarrow: "↔",
  xleftrightarrow: "↔",
  Overrightarrow: "⇒",
  xRightarrow: "⇒",
  overleftharpoon: "↼",
  xleftharpoonup: "↼",
  overrightharpoon: "⇀",
  xrightharpoonup: "⇀",
  xLeftarrow: "⇐",
  xLeftrightarrow: "⇔",
  xhookleftarrow: "↩",
  xhookrightarrow: "↪",
  xmapsto: "↦",
  xrightharpoondown: "⇁",
  xleftharpoondown: "↽",
  xrightleftharpoons: "⇌",
  xleftrightharpoons: "⇋",
  xtwoheadleftarrow: "↞",
  xtwoheadrightarrow: "↠",
  xlongequal: "=",
  xtofrom: "⇄",
  xrightleftarrows: "⇄",
  xrightequilibrium: "⇌",
  // Not a perfect match.
  xleftequilibrium: "⇋",
  // None better available.
  "\\cdrightarrow": "→",
  "\\cdleftarrow": "←",
  "\\cdlongequal": "="
}, Cd = function(e) {
  var t = new P.MathNode("mo", [new P.TextNode(Ed[e.replace(/^\\/, "")])]);
  return t.setAttribute("stretchy", "true"), t;
}, $d = {
  //   path(s), minWidth, height, align
  overrightarrow: [["rightarrow"], 0.888, 522, "xMaxYMin"],
  overleftarrow: [["leftarrow"], 0.888, 522, "xMinYMin"],
  underrightarrow: [["rightarrow"], 0.888, 522, "xMaxYMin"],
  underleftarrow: [["leftarrow"], 0.888, 522, "xMinYMin"],
  xrightarrow: [["rightarrow"], 1.469, 522, "xMaxYMin"],
  "\\cdrightarrow": [["rightarrow"], 3, 522, "xMaxYMin"],
  // CD minwwidth2.5pc
  xleftarrow: [["leftarrow"], 1.469, 522, "xMinYMin"],
  "\\cdleftarrow": [["leftarrow"], 3, 522, "xMinYMin"],
  Overrightarrow: [["doublerightarrow"], 0.888, 560, "xMaxYMin"],
  xRightarrow: [["doublerightarrow"], 1.526, 560, "xMaxYMin"],
  xLeftarrow: [["doubleleftarrow"], 1.526, 560, "xMinYMin"],
  overleftharpoon: [["leftharpoon"], 0.888, 522, "xMinYMin"],
  xleftharpoonup: [["leftharpoon"], 0.888, 522, "xMinYMin"],
  xleftharpoondown: [["leftharpoondown"], 0.888, 522, "xMinYMin"],
  overrightharpoon: [["rightharpoon"], 0.888, 522, "xMaxYMin"],
  xrightharpoonup: [["rightharpoon"], 0.888, 522, "xMaxYMin"],
  xrightharpoondown: [["rightharpoondown"], 0.888, 522, "xMaxYMin"],
  xlongequal: [["longequal"], 0.888, 334, "xMinYMin"],
  "\\cdlongequal": [["longequal"], 3, 334, "xMinYMin"],
  xtwoheadleftarrow: [["twoheadleftarrow"], 0.888, 334, "xMinYMin"],
  xtwoheadrightarrow: [["twoheadrightarrow"], 0.888, 334, "xMaxYMin"],
  overleftrightarrow: [["leftarrow", "rightarrow"], 0.888, 522],
  overbrace: [["leftbrace", "midbrace", "rightbrace"], 1.6, 548],
  underbrace: [["leftbraceunder", "midbraceunder", "rightbraceunder"], 1.6, 548],
  underleftrightarrow: [["leftarrow", "rightarrow"], 0.888, 522],
  xleftrightarrow: [["leftarrow", "rightarrow"], 1.75, 522],
  xLeftrightarrow: [["doubleleftarrow", "doublerightarrow"], 1.75, 560],
  xrightleftharpoons: [["leftharpoondownplus", "rightharpoonplus"], 1.75, 716],
  xleftrightharpoons: [["leftharpoonplus", "rightharpoondownplus"], 1.75, 716],
  xhookleftarrow: [["leftarrow", "righthook"], 1.08, 522],
  xhookrightarrow: [["lefthook", "rightarrow"], 1.08, 522],
  overlinesegment: [["leftlinesegment", "rightlinesegment"], 0.888, 522],
  underlinesegment: [["leftlinesegment", "rightlinesegment"], 0.888, 522],
  overgroup: [["leftgroup", "rightgroup"], 0.888, 342],
  undergroup: [["leftgroupunder", "rightgroupunder"], 0.888, 342],
  xmapsto: [["leftmapsto", "rightarrow"], 1.5, 522],
  xtofrom: [["leftToFrom", "rightToFrom"], 1.75, 528],
  // The next three arrows are from the mhchem package.
  // In mhchem.sty, min-length is 2.0em. But these arrows might appear in the
  // document as \xrightarrow or \xrightleftharpoons. Those have
  // min-length = 1.75em, so we set min-length on these next three to match.
  xrightleftarrows: [["baraboveleftarrow", "rightarrowabovebar"], 1.75, 901],
  xrightequilibrium: [["baraboveshortleftharpoon", "rightharpoonaboveshortbar"], 1.75, 716],
  xleftequilibrium: [["shortbaraboveleftharpoon", "shortrightharpoonabovebar"], 1.75, 716]
}, Td = function(e) {
  return e.type === "ordgroup" ? e.body.length : 1;
}, Fd = function(e, t) {
  function n() {
    var l = 4e5, o = e.label.slice(1);
    if (ae.contains(["widehat", "widecheck", "widetilde", "utilde"], o)) {
      var u = e, h = Td(u.base), m, d, g;
      if (h > 5)
        o === "widehat" || o === "widecheck" ? (m = 420, l = 2364, g = 0.42, d = o + "4") : (m = 312, l = 2340, g = 0.34, d = "tilde4");
      else {
        var b = [1, 1, 2, 2, 3, 3][h];
        o === "widehat" || o === "widecheck" ? (l = [0, 1062, 2364, 2364, 2364][b], m = [0, 239, 300, 360, 420][b], g = [0, 0.24, 0.3, 0.3, 0.36, 0.42][b], d = o + b) : (l = [0, 600, 1033, 2339, 2340][b], m = [0, 260, 286, 306, 312][b], g = [0, 0.26, 0.286, 0.3, 0.306, 0.34][b], d = "tilde" + b);
      }
      var v = new N0(d), w = new m0([v], {
        width: "100%",
        height: W(g),
        viewBox: "0 0 " + l + " " + m,
        preserveAspectRatio: "none"
      });
      return {
        span: F.makeSvgSpan([], [w], t),
        minWidth: 0,
        height: g
      };
    } else {
      var x = [], k = $d[o], [y, A, $] = k, M = $ / 1e3, z = y.length, O, L;
      if (z === 1) {
        var K = k[3];
        O = ["hide-tail"], L = [K];
      } else if (z === 2)
        O = ["halfarrow-left", "halfarrow-right"], L = ["xMinYMin", "xMaxYMin"];
      else if (z === 3)
        O = ["brace-left", "brace-center", "brace-right"], L = ["xMinYMin", "xMidYMin", "xMaxYMin"];
      else
        throw new Error(`Correct katexImagesData or update code here to support
                    ` + z + " children.");
      for (var X = 0; X < z; X++) {
        var J = new N0(y[X]), Se = new m0([J], {
          width: "400em",
          height: W(M),
          viewBox: "0 0 " + l + " " + $,
          preserveAspectRatio: L[X] + " slice"
        }), _e = F.makeSvgSpan([O[X]], [Se], t);
        if (z === 1)
          return {
            span: _e,
            minWidth: A,
            height: M
          };
        _e.style.height = W(M), x.push(_e);
      }
      return {
        span: F.makeSpan(["stretchy"], x, t),
        minWidth: A,
        height: M
      };
    }
  }
  var {
    span: a,
    minWidth: i,
    height: s
  } = n();
  return a.height = s, a.style.height = W(s), i > 0 && (a.style.minWidth = W(i)), a;
}, Md = function(e, t, n, a, i) {
  var s, l = e.height + e.depth + n + a;
  if (/fbox|color|angl/.test(t)) {
    if (s = F.makeSpan(["stretchy", t], [], i), t === "fbox") {
      var o = i.color && i.getColor();
      o && (s.style.borderColor = o);
    }
  } else {
    var u = [];
    /^[bx]cancel$/.test(t) && u.push(new Qs({
      x1: "0",
      y1: "0",
      x2: "100%",
      y2: "100%",
      "stroke-width": "0.046em"
    })), /^x?cancel$/.test(t) && u.push(new Qs({
      x1: "0",
      y1: "100%",
      x2: "100%",
      y2: "0",
      "stroke-width": "0.046em"
    }));
    var h = new m0(u, {
      width: "100%",
      height: W(l)
    });
    s = F.makeSvgSpan([], [h], i);
  }
  return s.height = l, s.style.height = W(l), s;
}, g0 = {
  encloseSpan: Md,
  mathMLnode: Cd,
  svgSpan: Fd
};
function pe(r, e) {
  if (!r || r.type !== e)
    throw new Error("Expected node of type " + e + ", but got " + (r ? "node of type " + r.type : String(r)));
  return r;
}
function $l(r) {
  var e = Mi(r);
  if (!e)
    throw new Error("Expected node of symbol group type, but got " + (r ? "node of type " + r.type : String(r)));
  return e;
}
function Mi(r) {
  return r && (r.type === "atom" || rd.hasOwnProperty(r.type)) ? r : null;
}
var Tl = (r, e) => {
  var t, n, a;
  r && r.type === "supsub" ? (n = pe(r.base, "accent"), t = n.base, r.base = t, a = td(xe(r, e)), r.base = n) : (n = pe(r, "accent"), t = n.base);
  var i = xe(t, e.havingCrampedStyle()), s = n.isShifty && ae.isCharacterBox(t), l = 0;
  if (s) {
    var o = ae.getBaseElem(t), u = xe(o, e.havingCrampedStyle());
    l = po(u).skew;
  }
  var h = n.label === "\\c", m = h ? i.height + i.depth : Math.min(i.height, e.fontMetrics().xHeight), d;
  if (n.isStretchy)
    d = g0.svgSpan(n, e), d = F.makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: i
      }, {
        type: "elem",
        elem: d,
        wrapperClasses: ["svg-align"],
        wrapperStyle: l > 0 ? {
          width: "calc(100% - " + W(2 * l) + ")",
          marginLeft: W(2 * l)
        } : void 0
      }]
    }, e);
  else {
    var g, b;
    n.label === "\\vec" ? (g = F.staticSvg("vec", e), b = F.svgData.vec[1]) : (g = F.makeOrd({
      mode: n.mode,
      text: n.label
    }, e, "textord"), g = po(g), g.italic = 0, b = g.width, h && (m += g.depth)), d = F.makeSpan(["accent-body"], [g]);
    var v = n.label === "\\textcircled";
    v && (d.classes.push("accent-full"), m = i.height);
    var w = l;
    v || (w -= b / 2), d.style.left = W(w), n.label === "\\textcircled" && (d.style.top = ".2em"), d = F.makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: i
      }, {
        type: "kern",
        size: -m
      }, {
        type: "elem",
        elem: d
      }]
    }, e);
  }
  var x = F.makeSpan(["mord", "accent"], [d], e);
  return a ? (a.children[0] = x, a.height = Math.max(x.height, a.height), a.classes[0] = "mord", a) : x;
}, oc = (r, e) => {
  var t = r.isStretchy ? g0.mathMLnode(r.label) : new P.MathNode("mo", [kn(r.label, r.mode)]), n = new P.MathNode("mover", [Le(r.base, e), t]);
  return n.setAttribute("accent", "true"), n;
}, zd = new RegExp(["\\acute", "\\grave", "\\ddot", "\\tilde", "\\bar", "\\breve", "\\check", "\\hat", "\\vec", "\\dot", "\\mathring"].map((r) => "\\" + r).join("|"));
Y({
  type: "accent",
  names: ["\\acute", "\\grave", "\\ddot", "\\tilde", "\\bar", "\\breve", "\\check", "\\hat", "\\vec", "\\dot", "\\mathring", "\\widecheck", "\\widehat", "\\widetilde", "\\overrightarrow", "\\overleftarrow", "\\Overrightarrow", "\\overleftrightarrow", "\\overgroup", "\\overlinesegment", "\\overleftharpoon", "\\overrightharpoon"],
  props: {
    numArgs: 1
  },
  handler: (r, e) => {
    var t = Si(e[0]), n = !zd.test(r.funcName), a = !n || r.funcName === "\\widehat" || r.funcName === "\\widetilde" || r.funcName === "\\widecheck";
    return {
      type: "accent",
      mode: r.parser.mode,
      label: r.funcName,
      isStretchy: n,
      isShifty: a,
      base: t
    };
  },
  htmlBuilder: Tl,
  mathmlBuilder: oc
});
Y({
  type: "accent",
  names: ["\\'", "\\`", "\\^", "\\~", "\\=", "\\u", "\\.", '\\"', "\\c", "\\r", "\\H", "\\v", "\\textcircled"],
  props: {
    numArgs: 1,
    allowedInText: !0,
    allowedInMath: !0,
    // unless in strict mode
    argTypes: ["primitive"]
  },
  handler: (r, e) => {
    var t = e[0], n = r.parser.mode;
    return n === "math" && (r.parser.settings.reportNonstrict("mathVsTextAccents", "LaTeX's accent " + r.funcName + " works only in text mode"), n = "text"), {
      type: "accent",
      mode: n,
      label: r.funcName,
      isStretchy: !1,
      isShifty: !0,
      base: t
    };
  },
  htmlBuilder: Tl,
  mathmlBuilder: oc
});
Y({
  type: "accentUnder",
  names: ["\\underleftarrow", "\\underrightarrow", "\\underleftrightarrow", "\\undergroup", "\\underlinesegment", "\\utilde"],
  props: {
    numArgs: 1
  },
  handler: (r, e) => {
    var {
      parser: t,
      funcName: n
    } = r, a = e[0];
    return {
      type: "accentUnder",
      mode: t.mode,
      label: n,
      base: a
    };
  },
  htmlBuilder: (r, e) => {
    var t = xe(r.base, e), n = g0.svgSpan(r, e), a = r.label === "\\utilde" ? 0.12 : 0, i = F.makeVList({
      positionType: "top",
      positionData: t.height,
      children: [{
        type: "elem",
        elem: n,
        wrapperClasses: ["svg-align"]
      }, {
        type: "kern",
        size: a
      }, {
        type: "elem",
        elem: t
      }]
    }, e);
    return F.makeSpan(["mord", "accentunder"], [i], e);
  },
  mathmlBuilder: (r, e) => {
    var t = g0.mathMLnode(r.label), n = new P.MathNode("munder", [Le(r.base, e), t]);
    return n.setAttribute("accentunder", "true"), n;
  }
});
var Fa = (r) => {
  var e = new P.MathNode("mpadded", r ? [r] : []);
  return e.setAttribute("width", "+0.6em"), e.setAttribute("lspace", "0.3em"), e;
};
Y({
  type: "xArrow",
  names: [
    "\\xleftarrow",
    "\\xrightarrow",
    "\\xLeftarrow",
    "\\xRightarrow",
    "\\xleftrightarrow",
    "\\xLeftrightarrow",
    "\\xhookleftarrow",
    "\\xhookrightarrow",
    "\\xmapsto",
    "\\xrightharpoondown",
    "\\xrightharpoonup",
    "\\xleftharpoondown",
    "\\xleftharpoonup",
    "\\xrightleftharpoons",
    "\\xleftrightharpoons",
    "\\xlongequal",
    "\\xtwoheadrightarrow",
    "\\xtwoheadleftarrow",
    "\\xtofrom",
    // The next 3 functions are here to support the mhchem extension.
    // Direct use of these functions is discouraged and may break someday.
    "\\xrightleftarrows",
    "\\xrightequilibrium",
    "\\xleftequilibrium",
    // The next 3 functions are here only to support the {CD} environment.
    "\\\\cdrightarrow",
    "\\\\cdleftarrow",
    "\\\\cdlongequal"
  ],
  props: {
    numArgs: 1,
    numOptionalArgs: 1
  },
  handler(r, e, t) {
    var {
      parser: n,
      funcName: a
    } = r;
    return {
      type: "xArrow",
      mode: n.mode,
      label: a,
      body: e[0],
      below: t[0]
    };
  },
  // Flow is unable to correctly infer the type of `group`, even though it's
  // unambiguously determined from the passed-in `type` above.
  htmlBuilder(r, e) {
    var t = e.style, n = e.havingStyle(t.sup()), a = F.wrapFragment(xe(r.body, n, e), e), i = r.label.slice(0, 2) === "\\x" ? "x" : "cd";
    a.classes.push(i + "-arrow-pad");
    var s;
    r.below && (n = e.havingStyle(t.sub()), s = F.wrapFragment(xe(r.below, n, e), e), s.classes.push(i + "-arrow-pad"));
    var l = g0.svgSpan(r, e), o = -e.fontMetrics().axisHeight + 0.5 * l.height, u = -e.fontMetrics().axisHeight - 0.5 * l.height - 0.111;
    (a.depth > 0.25 || r.label === "\\xleftequilibrium") && (u -= a.depth);
    var h;
    if (s) {
      var m = -e.fontMetrics().axisHeight + s.height + 0.5 * l.height + 0.111;
      h = F.makeVList({
        positionType: "individualShift",
        children: [{
          type: "elem",
          elem: a,
          shift: u
        }, {
          type: "elem",
          elem: l,
          shift: o
        }, {
          type: "elem",
          elem: s,
          shift: m
        }]
      }, e);
    } else
      h = F.makeVList({
        positionType: "individualShift",
        children: [{
          type: "elem",
          elem: a,
          shift: u
        }, {
          type: "elem",
          elem: l,
          shift: o
        }]
      }, e);
    return h.children[0].children[0].children[1].classes.push("svg-align"), F.makeSpan(["mrel", "x-arrow"], [h], e);
  },
  mathmlBuilder(r, e) {
    var t = g0.mathMLnode(r.label);
    t.setAttribute("minsize", r.label.charAt(0) === "x" ? "1.75em" : "3.0em");
    var n;
    if (r.body) {
      var a = Fa(Le(r.body, e));
      if (r.below) {
        var i = Fa(Le(r.below, e));
        n = new P.MathNode("munderover", [t, i, a]);
      } else
        n = new P.MathNode("mover", [t, a]);
    } else if (r.below) {
      var s = Fa(Le(r.below, e));
      n = new P.MathNode("munder", [t, s]);
    } else
      n = Fa(), n = new P.MathNode("mover", [t, n]);
    return n;
  }
});
var Bd = F.makeSpan;
function uc(r, e) {
  var t = _t(r.body, e, !0);
  return Bd([r.mclass], t, e);
}
function cc(r, e) {
  var t, n = Yt(r.body, e);
  return r.mclass === "minner" ? t = new P.MathNode("mpadded", n) : r.mclass === "mord" ? r.isCharacterBox ? (t = n[0], t.type = "mi") : t = new P.MathNode("mi", n) : (r.isCharacterBox ? (t = n[0], t.type = "mo") : t = new P.MathNode("mo", n), r.mclass === "mbin" ? (t.attributes.lspace = "0.22em", t.attributes.rspace = "0.22em") : r.mclass === "mpunct" ? (t.attributes.lspace = "0em", t.attributes.rspace = "0.17em") : r.mclass === "mopen" || r.mclass === "mclose" ? (t.attributes.lspace = "0em", t.attributes.rspace = "0em") : r.mclass === "minner" && (t.attributes.lspace = "0.0556em", t.attributes.width = "+0.1111em")), t;
}
Y({
  type: "mclass",
  names: ["\\mathord", "\\mathbin", "\\mathrel", "\\mathopen", "\\mathclose", "\\mathpunct", "\\mathinner"],
  props: {
    numArgs: 1,
    primitive: !0
  },
  handler(r, e) {
    var {
      parser: t,
      funcName: n
    } = r, a = e[0];
    return {
      type: "mclass",
      mode: t.mode,
      mclass: "m" + n.slice(5),
      // TODO(kevinb): don't prefix with 'm'
      body: it(a),
      isCharacterBox: ae.isCharacterBox(a)
    };
  },
  htmlBuilder: uc,
  mathmlBuilder: cc
});
var zi = (r) => {
  var e = r.type === "ordgroup" && r.body.length ? r.body[0] : r;
  return e.type === "atom" && (e.family === "bin" || e.family === "rel") ? "m" + e.family : "mord";
};
Y({
  type: "mclass",
  names: ["\\@binrel"],
  props: {
    numArgs: 2
  },
  handler(r, e) {
    var {
      parser: t
    } = r;
    return {
      type: "mclass",
      mode: t.mode,
      mclass: zi(e[0]),
      body: it(e[1]),
      isCharacterBox: ae.isCharacterBox(e[1])
    };
  }
});
Y({
  type: "mclass",
  names: ["\\stackrel", "\\overset", "\\underset"],
  props: {
    numArgs: 2
  },
  handler(r, e) {
    var {
      parser: t,
      funcName: n
    } = r, a = e[1], i = e[0], s;
    n !== "\\stackrel" ? s = zi(a) : s = "mrel";
    var l = {
      type: "op",
      mode: a.mode,
      limits: !0,
      alwaysHandleSupSub: !0,
      parentIsSupSub: !1,
      symbol: !1,
      suppressBaseShift: n !== "\\stackrel",
      body: it(a)
    }, o = {
      type: "supsub",
      mode: i.mode,
      base: l,
      sup: n === "\\underset" ? null : i,
      sub: n === "\\underset" ? i : null
    };
    return {
      type: "mclass",
      mode: t.mode,
      mclass: s,
      body: [o],
      isCharacterBox: ae.isCharacterBox(o)
    };
  },
  htmlBuilder: uc,
  mathmlBuilder: cc
});
Y({
  type: "pmb",
  names: ["\\pmb"],
  props: {
    numArgs: 1,
    allowedInText: !0
  },
  handler(r, e) {
    var {
      parser: t
    } = r;
    return {
      type: "pmb",
      mode: t.mode,
      mclass: zi(e[0]),
      body: it(e[0])
    };
  },
  htmlBuilder(r, e) {
    var t = _t(r.body, e, !0), n = F.makeSpan([r.mclass], t, e);
    return n.style.textShadow = "0.02em 0.01em 0.04px", n;
  },
  mathmlBuilder(r, e) {
    var t = Yt(r.body, e), n = new P.MathNode("mstyle", t);
    return n.setAttribute("style", "text-shadow: 0.02em 0.01em 0.04px"), n;
  }
});
var Nd = {
  ">": "\\\\cdrightarrow",
  "<": "\\\\cdleftarrow",
  "=": "\\\\cdlongequal",
  A: "\\uparrow",
  V: "\\downarrow",
  "|": "\\Vert",
  ".": "no arrow"
}, So = () => ({
  type: "styling",
  body: [],
  mode: "math",
  style: "display"
}), Do = (r) => r.type === "textord" && r.text === "@", qd = (r, e) => (r.type === "mathord" || r.type === "atom") && r.text === e;
function Ld(r, e, t) {
  var n = Nd[r];
  switch (n) {
    case "\\\\cdrightarrow":
    case "\\\\cdleftarrow":
      return t.callFunction(n, [e[0]], [e[1]]);
    case "\\uparrow":
    case "\\downarrow": {
      var a = t.callFunction("\\\\cdleft", [e[0]], []), i = {
        type: "atom",
        text: n,
        mode: "math",
        family: "rel"
      }, s = t.callFunction("\\Big", [i], []), l = t.callFunction("\\\\cdright", [e[1]], []), o = {
        type: "ordgroup",
        mode: "math",
        body: [a, s, l]
      };
      return t.callFunction("\\\\cdparent", [o], []);
    }
    case "\\\\cdlongequal":
      return t.callFunction("\\\\cdlongequal", [], []);
    case "\\Vert": {
      var u = {
        type: "textord",
        text: "\\Vert",
        mode: "math"
      };
      return t.callFunction("\\Big", [u], []);
    }
    default:
      return {
        type: "textord",
        text: " ",
        mode: "math"
      };
  }
}
function Id(r) {
  var e = [];
  for (r.gullet.beginGroup(), r.gullet.macros.set("\\cr", "\\\\\\relax"), r.gullet.beginGroup(); ; ) {
    e.push(r.parseExpression(!1, "\\\\")), r.gullet.endGroup(), r.gullet.beginGroup();
    var t = r.fetch().text;
    if (t === "&" || t === "\\\\")
      r.consume();
    else if (t === "\\end") {
      e[e.length - 1].length === 0 && e.pop();
      break;
    } else
      throw new U("Expected \\\\ or \\cr or \\end", r.nextToken);
  }
  for (var n = [], a = [n], i = 0; i < e.length; i++) {
    for (var s = e[i], l = So(), o = 0; o < s.length; o++)
      if (!Do(s[o]))
        l.body.push(s[o]);
      else {
        n.push(l), o += 1;
        var u = $l(s[o]).text, h = new Array(2);
        if (h[0] = {
          type: "ordgroup",
          mode: "math",
          body: []
        }, h[1] = {
          type: "ordgroup",
          mode: "math",
          body: []
        }, !("=|.".indexOf(u) > -1)) if ("<>AV".indexOf(u) > -1)
          for (var m = 0; m < 2; m++) {
            for (var d = !0, g = o + 1; g < s.length; g++) {
              if (qd(s[g], u)) {
                d = !1, o = g;
                break;
              }
              if (Do(s[g]))
                throw new U("Missing a " + u + " character to complete a CD arrow.", s[g]);
              h[m].body.push(s[g]);
            }
            if (d)
              throw new U("Missing a " + u + " character to complete a CD arrow.", s[o]);
          }
        else
          throw new U('Expected one of "<>AV=|." after @', s[o]);
        var b = Ld(u, h, r), v = {
          type: "styling",
          body: [b],
          mode: "math",
          style: "display"
          // CD is always displaystyle.
        };
        n.push(v), l = So();
      }
    i % 2 === 0 ? n.push(l) : n.shift(), n = [], a.push(n);
  }
  r.gullet.endGroup(), r.gullet.endGroup();
  var w = new Array(a[0].length).fill({
    type: "align",
    align: "c",
    pregap: 0.25,
    // CD package sets \enskip between columns.
    postgap: 0.25
    // So pre and post each get half an \enskip, i.e. 0.25em.
  });
  return {
    type: "array",
    mode: "math",
    body: a,
    arraystretch: 1,
    addJot: !0,
    rowGaps: [null],
    cols: w,
    colSeparationType: "CD",
    hLinesBeforeRow: new Array(a.length + 1).fill([])
  };
}
Y({
  type: "cdlabel",
  names: ["\\\\cdleft", "\\\\cdright"],
  props: {
    numArgs: 1
  },
  handler(r, e) {
    var {
      parser: t,
      funcName: n
    } = r;
    return {
      type: "cdlabel",
      mode: t.mode,
      side: n.slice(4),
      label: e[0]
    };
  },
  htmlBuilder(r, e) {
    var t = e.havingStyle(e.style.sup()), n = F.wrapFragment(xe(r.label, t, e), e);
    return n.classes.push("cd-label-" + r.side), n.style.bottom = W(0.8 - n.depth), n.height = 0, n.depth = 0, n;
  },
  mathmlBuilder(r, e) {
    var t = new P.MathNode("mrow", [Le(r.label, e)]);
    return t = new P.MathNode("mpadded", [t]), t.setAttribute("width", "0"), r.side === "left" && t.setAttribute("lspace", "-1width"), t.setAttribute("voffset", "0.7em"), t = new P.MathNode("mstyle", [t]), t.setAttribute("displaystyle", "false"), t.setAttribute("scriptlevel", "1"), t;
  }
});
Y({
  type: "cdlabelparent",
  names: ["\\\\cdparent"],
  props: {
    numArgs: 1
  },
  handler(r, e) {
    var {
      parser: t
    } = r;
    return {
      type: "cdlabelparent",
      mode: t.mode,
      fragment: e[0]
    };
  },
  htmlBuilder(r, e) {
    var t = F.wrapFragment(xe(r.fragment, e), e);
    return t.classes.push("cd-vert-arrow"), t;
  },
  mathmlBuilder(r, e) {
    return new P.MathNode("mrow", [Le(r.fragment, e)]);
  }
});
Y({
  type: "textord",
  names: ["\\@char"],
  props: {
    numArgs: 1,
    allowedInText: !0
  },
  handler(r, e) {
    for (var {
      parser: t
    } = r, n = pe(e[0], "ordgroup"), a = n.body, i = "", s = 0; s < a.length; s++) {
      var l = pe(a[s], "textord");
      i += l.text;
    }
    var o = parseInt(i), u;
    if (isNaN(o))
      throw new U("\\@char has non-numeric argument " + i);
    if (o < 0 || o >= 1114111)
      throw new U("\\@char with invalid code point " + i);
    return o <= 65535 ? u = String.fromCharCode(o) : (o -= 65536, u = String.fromCharCode((o >> 10) + 55296, (o & 1023) + 56320)), {
      type: "textord",
      mode: t.mode,
      text: u
    };
  }
});
var hc = (r, e) => {
  var t = _t(r.body, e.withColor(r.color), !1);
  return F.makeFragment(t);
}, fc = (r, e) => {
  var t = Yt(r.body, e.withColor(r.color)), n = new P.MathNode("mstyle", t);
  return n.setAttribute("mathcolor", r.color), n;
};
Y({
  type: "color",
  names: ["\\textcolor"],
  props: {
    numArgs: 2,
    allowedInText: !0,
    argTypes: ["color", "original"]
  },
  handler(r, e) {
    var {
      parser: t
    } = r, n = pe(e[0], "color-token").color, a = e[1];
    return {
      type: "color",
      mode: t.mode,
      color: n,
      body: it(a)
    };
  },
  htmlBuilder: hc,
  mathmlBuilder: fc
});
Y({
  type: "color",
  names: ["\\color"],
  props: {
    numArgs: 1,
    allowedInText: !0,
    argTypes: ["color"]
  },
  handler(r, e) {
    var {
      parser: t,
      breakOnTokenText: n
    } = r, a = pe(e[0], "color-token").color;
    t.gullet.macros.set("\\current@color", a);
    var i = t.parseExpression(!0, n);
    return {
      type: "color",
      mode: t.mode,
      color: a,
      body: i
    };
  },
  htmlBuilder: hc,
  mathmlBuilder: fc
});
Y({
  type: "cr",
  names: ["\\\\"],
  props: {
    numArgs: 0,
    numOptionalArgs: 0,
    allowedInText: !0
  },
  handler(r, e, t) {
    var {
      parser: n
    } = r, a = n.gullet.future().text === "[" ? n.parseSizeGroup(!0) : null, i = !n.settings.displayMode || !n.settings.useStrictBehavior("newLineInDisplayMode", "In LaTeX, \\\\ or \\newline does nothing in display mode");
    return {
      type: "cr",
      mode: n.mode,
      newLine: i,
      size: a && pe(a, "size").value
    };
  },
  // The following builders are called only at the top level,
  // not within tabular/array environments.
  htmlBuilder(r, e) {
    var t = F.makeSpan(["mspace"], [], e);
    return r.newLine && (t.classes.push("newline"), r.size && (t.style.marginTop = W(We(r.size, e)))), t;
  },
  mathmlBuilder(r, e) {
    var t = new P.MathNode("mspace");
    return r.newLine && (t.setAttribute("linebreak", "newline"), r.size && t.setAttribute("height", W(We(r.size, e)))), t;
  }
});
var nl = {
  "\\global": "\\global",
  "\\long": "\\\\globallong",
  "\\\\globallong": "\\\\globallong",
  "\\def": "\\gdef",
  "\\gdef": "\\gdef",
  "\\edef": "\\xdef",
  "\\xdef": "\\xdef",
  "\\let": "\\\\globallet",
  "\\futurelet": "\\\\globalfuture"
}, dc = (r) => {
  var e = r.text;
  if (/^(?:[\\{}$&#^_]|EOF)$/.test(e))
    throw new U("Expected a control sequence", r);
  return e;
}, Rd = (r) => {
  var e = r.gullet.popToken();
  return e.text === "=" && (e = r.gullet.popToken(), e.text === " " && (e = r.gullet.popToken())), e;
}, mc = (r, e, t, n) => {
  var a = r.gullet.macros.get(t.text);
  a == null && (t.noexpand = !0, a = {
    tokens: [t],
    numArgs: 0,
    // reproduce the same behavior in expansion
    unexpandable: !r.gullet.isExpandable(t.text)
  }), r.gullet.macros.set(e, a, n);
};
Y({
  type: "internal",
  names: [
    "\\global",
    "\\long",
    "\\\\globallong"
    // can’t be entered directly
  ],
  props: {
    numArgs: 0,
    allowedInText: !0
  },
  handler(r) {
    var {
      parser: e,
      funcName: t
    } = r;
    e.consumeSpaces();
    var n = e.fetch();
    if (nl[n.text])
      return (t === "\\global" || t === "\\\\globallong") && (n.text = nl[n.text]), pe(e.parseFunction(), "internal");
    throw new U("Invalid token after macro prefix", n);
  }
});
Y({
  type: "internal",
  names: ["\\def", "\\gdef", "\\edef", "\\xdef"],
  props: {
    numArgs: 0,
    allowedInText: !0,
    primitive: !0
  },
  handler(r) {
    var {
      parser: e,
      funcName: t
    } = r, n = e.gullet.popToken(), a = n.text;
    if (/^(?:[\\{}$&#^_]|EOF)$/.test(a))
      throw new U("Expected a control sequence", n);
    for (var i = 0, s, l = [[]]; e.gullet.future().text !== "{"; )
      if (n = e.gullet.popToken(), n.text === "#") {
        if (e.gullet.future().text === "{") {
          s = e.gullet.future(), l[i].push("{");
          break;
        }
        if (n = e.gullet.popToken(), !/^[1-9]$/.test(n.text))
          throw new U('Invalid argument number "' + n.text + '"');
        if (parseInt(n.text) !== i + 1)
          throw new U('Argument number "' + n.text + '" out of order');
        i++, l.push([]);
      } else {
        if (n.text === "EOF")
          throw new U("Expected a macro definition");
        l[i].push(n.text);
      }
    var {
      tokens: o
    } = e.gullet.consumeArg();
    return s && o.unshift(s), (t === "\\edef" || t === "\\xdef") && (o = e.gullet.expandTokens(o), o.reverse()), e.gullet.macros.set(a, {
      tokens: o,
      numArgs: i,
      delimiters: l
    }, t === nl[t]), {
      type: "internal",
      mode: e.mode
    };
  }
});
Y({
  type: "internal",
  names: [
    "\\let",
    "\\\\globallet"
    // can’t be entered directly
  ],
  props: {
    numArgs: 0,
    allowedInText: !0,
    primitive: !0
  },
  handler(r) {
    var {
      parser: e,
      funcName: t
    } = r, n = dc(e.gullet.popToken());
    e.gullet.consumeSpaces();
    var a = Rd(e);
    return mc(e, n, a, t === "\\\\globallet"), {
      type: "internal",
      mode: e.mode
    };
  }
});
Y({
  type: "internal",
  names: [
    "\\futurelet",
    "\\\\globalfuture"
    // can’t be entered directly
  ],
  props: {
    numArgs: 0,
    allowedInText: !0,
    primitive: !0
  },
  handler(r) {
    var {
      parser: e,
      funcName: t
    } = r, n = dc(e.gullet.popToken()), a = e.gullet.popToken(), i = e.gullet.popToken();
    return mc(e, n, i, t === "\\\\globalfuture"), e.gullet.pushToken(i), e.gullet.pushToken(a), {
      type: "internal",
      mode: e.mode
    };
  }
});
var jr = function(e, t, n) {
  var a = Re.math[e] && Re.math[e].replace, i = Dl(a || e, t, n);
  if (!i)
    throw new Error("Unsupported symbol " + e + " and font size " + t + ".");
  return i;
}, Fl = function(e, t, n, a) {
  var i = n.havingBaseStyle(t), s = F.makeSpan(a.concat(i.sizingClasses(n)), [e], n), l = i.sizeMultiplier / n.sizeMultiplier;
  return s.height *= l, s.depth *= l, s.maxFontSize = i.sizeMultiplier, s;
}, pc = function(e, t, n) {
  var a = t.havingBaseStyle(n), i = (1 - t.sizeMultiplier / a.sizeMultiplier) * t.fontMetrics().axisHeight;
  e.classes.push("delimcenter"), e.style.top = W(i), e.height -= i, e.depth += i;
}, Od = function(e, t, n, a, i, s) {
  var l = F.makeSymbol(e, "Main-Regular", i, a), o = Fl(l, t, a, s);
  return n && pc(o, a, t), o;
}, Pd = function(e, t, n, a) {
  return F.makeSymbol(e, "Size" + t + "-Regular", n, a);
}, gc = function(e, t, n, a, i, s) {
  var l = Pd(e, t, i, a), o = Fl(F.makeSpan(["delimsizing", "size" + t], [l], a), le.TEXT, a, s);
  return n && pc(o, a, le.TEXT), o;
}, as = function(e, t, n) {
  var a;
  t === "Size1-Regular" ? a = "delim-size1" : a = "delim-size4";
  var i = F.makeSpan(["delimsizinginner", a], [F.makeSpan([], [F.makeSymbol(e, t, n)])]);
  return {
    type: "elem",
    elem: i
  };
}, is = function(e, t, n) {
  var a = Hn["Size4-Regular"][e.charCodeAt(0)] ? Hn["Size4-Regular"][e.charCodeAt(0)][4] : Hn["Size1-Regular"][e.charCodeAt(0)][4], i = new N0("inner", Wf(e, Math.round(1e3 * t))), s = new m0([i], {
    width: W(a),
    height: W(t),
    // Override CSS rule `.katex svg { width: 100% }`
    style: "width:" + W(a),
    viewBox: "0 0 " + 1e3 * a + " " + Math.round(1e3 * t),
    preserveAspectRatio: "xMinYMin"
  }), l = F.makeSvgSpan([], [s], n);
  return l.height = t, l.style.height = W(t), l.style.width = W(a), {
    type: "elem",
    elem: l
  };
}, rl = 8e-3, Ma = {
  type: "kern",
  size: -1 * rl
}, Hd = ["|", "\\lvert", "\\rvert", "\\vert"], Ud = ["\\|", "\\lVert", "\\rVert", "\\Vert"], _c = function(e, t, n, a, i, s) {
  var l, o, u, h, m = "", d = 0;
  l = u = h = e, o = null;
  var g = "Size1-Regular";
  e === "\\uparrow" ? u = h = "⏐" : e === "\\Uparrow" ? u = h = "‖" : e === "\\downarrow" ? l = u = "⏐" : e === "\\Downarrow" ? l = u = "‖" : e === "\\updownarrow" ? (l = "\\uparrow", u = "⏐", h = "\\downarrow") : e === "\\Updownarrow" ? (l = "\\Uparrow", u = "‖", h = "\\Downarrow") : ae.contains(Hd, e) ? (u = "∣", m = "vert", d = 333) : ae.contains(Ud, e) ? (u = "∥", m = "doublevert", d = 556) : e === "[" || e === "\\lbrack" ? (l = "⎡", u = "⎢", h = "⎣", g = "Size4-Regular", m = "lbrack", d = 667) : e === "]" || e === "\\rbrack" ? (l = "⎤", u = "⎥", h = "⎦", g = "Size4-Regular", m = "rbrack", d = 667) : e === "\\lfloor" || e === "⌊" ? (u = l = "⎢", h = "⎣", g = "Size4-Regular", m = "lfloor", d = 667) : e === "\\lceil" || e === "⌈" ? (l = "⎡", u = h = "⎢", g = "Size4-Regular", m = "lceil", d = 667) : e === "\\rfloor" || e === "⌋" ? (u = l = "⎥", h = "⎦", g = "Size4-Regular", m = "rfloor", d = 667) : e === "\\rceil" || e === "⌉" ? (l = "⎤", u = h = "⎥", g = "Size4-Regular", m = "rceil", d = 667) : e === "(" || e === "\\lparen" ? (l = "⎛", u = "⎜", h = "⎝", g = "Size4-Regular", m = "lparen", d = 875) : e === ")" || e === "\\rparen" ? (l = "⎞", u = "⎟", h = "⎠", g = "Size4-Regular", m = "rparen", d = 875) : e === "\\{" || e === "\\lbrace" ? (l = "⎧", o = "⎨", h = "⎩", u = "⎪", g = "Size4-Regular") : e === "\\}" || e === "\\rbrace" ? (l = "⎫", o = "⎬", h = "⎭", u = "⎪", g = "Size4-Regular") : e === "\\lgroup" || e === "⟮" ? (l = "⎧", h = "⎩", u = "⎪", g = "Size4-Regular") : e === "\\rgroup" || e === "⟯" ? (l = "⎫", h = "⎭", u = "⎪", g = "Size4-Regular") : e === "\\lmoustache" || e === "⎰" ? (l = "⎧", h = "⎭", u = "⎪", g = "Size4-Regular") : (e === "\\rmoustache" || e === "⎱") && (l = "⎫", h = "⎩", u = "⎪", g = "Size4-Regular");
  var b = jr(l, g, i), v = b.height + b.depth, w = jr(u, g, i), x = w.height + w.depth, k = jr(h, g, i), y = k.height + k.depth, A = 0, $ = 1;
  if (o !== null) {
    var M = jr(o, g, i);
    A = M.height + M.depth, $ = 2;
  }
  var z = v + y + A, O = Math.max(0, Math.ceil((t - z) / ($ * x))), L = z + O * $ * x, K = a.fontMetrics().axisHeight;
  n && (K *= a.sizeMultiplier);
  var X = L / 2 - K, J = [];
  if (m.length > 0) {
    var Se = L - v - y, _e = Math.round(L * 1e3), ge = Kf(m, Math.round(Se * 1e3)), Ae = new N0(m, ge), Oe = (d / 1e3).toFixed(3) + "em", ke = (_e / 1e3).toFixed(3) + "em", Be = new m0([Ae], {
      width: Oe,
      height: ke,
      viewBox: "0 0 " + d + " " + _e
    }), Ee = F.makeSvgSpan([], [Be], a);
    Ee.height = _e / 1e3, Ee.style.width = Oe, Ee.style.height = ke, J.push({
      type: "elem",
      elem: Ee
    });
  } else {
    if (J.push(as(h, g, i)), J.push(Ma), o === null) {
      var I = L - v - y + 2 * rl;
      J.push(is(u, I, a));
    } else {
      var be = (L - v - y - A) / 2 + 2 * rl;
      J.push(is(u, be, a)), J.push(Ma), J.push(as(o, g, i)), J.push(Ma), J.push(is(u, be, a));
    }
    J.push(Ma), J.push(as(l, g, i));
  }
  var ye = a.havingBaseStyle(le.TEXT), Ie = F.makeVList({
    positionType: "bottom",
    positionData: X,
    children: J
  }, ye);
  return Fl(F.makeSpan(["delimsizing", "mult"], [Ie], ye), le.TEXT, a, s);
}, ss = 80, ls = 0.08, os = function(e, t, n, a, i) {
  var s = Vf(e, a, n), l = new N0(e, s), o = new m0([l], {
    // Note: 1000:1 ratio of viewBox to document em width.
    width: "400em",
    height: W(t),
    viewBox: "0 0 400000 " + n,
    preserveAspectRatio: "xMinYMin slice"
  });
  return F.makeSvgSpan(["hide-tail"], [o], i);
}, Gd = function(e, t) {
  var n = t.havingBaseSizing(), a = wc("\\surd", e * n.sizeMultiplier, yc, n), i = n.sizeMultiplier, s = Math.max(0, t.minRuleThickness - t.fontMetrics().sqrtRuleThickness), l, o = 0, u = 0, h = 0, m;
  return a.type === "small" ? (h = 1e3 + 1e3 * s + ss, e < 1 ? i = 1 : e < 1.4 && (i = 0.7), o = (1 + s + ls) / i, u = (1 + s) / i, l = os("sqrtMain", o, h, s, t), l.style.minWidth = "0.853em", m = 0.833 / i) : a.type === "large" ? (h = (1e3 + ss) * Qr[a.size], u = (Qr[a.size] + s) / i, o = (Qr[a.size] + s + ls) / i, l = os("sqrtSize" + a.size, o, h, s, t), l.style.minWidth = "1.02em", m = 1 / i) : (o = e + s + ls, u = e + s, h = Math.floor(1e3 * e + s) + ss, l = os("sqrtTall", o, h, s, t), l.style.minWidth = "0.742em", m = 1.056), l.height = u, l.style.height = W(o), {
    span: l,
    advanceWidth: m,
    // Calculate the actual line width.
    // This actually should depend on the chosen font -- e.g. \boldmath
    // should use the thicker surd symbols from e.g. KaTeX_Main-Bold, and
    // have thicker rules.
    ruleWidth: (t.fontMetrics().sqrtRuleThickness + s) * i
  };
}, vc = ["(", "\\lparen", ")", "\\rparen", "[", "\\lbrack", "]", "\\rbrack", "\\{", "\\lbrace", "\\}", "\\rbrace", "\\lfloor", "\\rfloor", "⌊", "⌋", "\\lceil", "\\rceil", "⌈", "⌉", "\\surd"], jd = ["\\uparrow", "\\downarrow", "\\updownarrow", "\\Uparrow", "\\Downarrow", "\\Updownarrow", "|", "\\|", "\\vert", "\\Vert", "\\lvert", "\\rvert", "\\lVert", "\\rVert", "\\lgroup", "\\rgroup", "⟮", "⟯", "\\lmoustache", "\\rmoustache", "⎰", "⎱"], bc = ["<", ">", "\\langle", "\\rangle", "/", "\\backslash", "\\lt", "\\gt"], Qr = [0, 1.2, 1.8, 2.4, 3], Vd = function(e, t, n, a, i) {
  if (e === "<" || e === "\\lt" || e === "⟨" ? e = "\\langle" : (e === ">" || e === "\\gt" || e === "⟩") && (e = "\\rangle"), ae.contains(vc, e) || ae.contains(bc, e))
    return gc(e, t, !1, n, a, i);
  if (ae.contains(jd, e))
    return _c(e, Qr[t], !1, n, a, i);
  throw new U("Illegal delimiter: '" + e + "'");
}, Wd = [{
  type: "small",
  style: le.SCRIPTSCRIPT
}, {
  type: "small",
  style: le.SCRIPT
}, {
  type: "small",
  style: le.TEXT
}, {
  type: "large",
  size: 1
}, {
  type: "large",
  size: 2
}, {
  type: "large",
  size: 3
}, {
  type: "large",
  size: 4
}], Kd = [{
  type: "small",
  style: le.SCRIPTSCRIPT
}, {
  type: "small",
  style: le.SCRIPT
}, {
  type: "small",
  style: le.TEXT
}, {
  type: "stack"
}], yc = [{
  type: "small",
  style: le.SCRIPTSCRIPT
}, {
  type: "small",
  style: le.SCRIPT
}, {
  type: "small",
  style: le.TEXT
}, {
  type: "large",
  size: 1
}, {
  type: "large",
  size: 2
}, {
  type: "large",
  size: 3
}, {
  type: "large",
  size: 4
}, {
  type: "stack"
}], Yd = function(e) {
  if (e.type === "small")
    return "Main-Regular";
  if (e.type === "large")
    return "Size" + e.size + "-Regular";
  if (e.type === "stack")
    return "Size4-Regular";
  throw new Error("Add support for delim type '" + e.type + "' here.");
}, wc = function(e, t, n, a) {
  for (var i = Math.min(2, 3 - a.style.size), s = i; s < n.length && n[s].type !== "stack"; s++) {
    var l = jr(e, Yd(n[s]), "math"), o = l.height + l.depth;
    if (n[s].type === "small") {
      var u = a.havingBaseStyle(n[s].style);
      o *= u.sizeMultiplier;
    }
    if (o > t)
      return n[s];
  }
  return n[n.length - 1];
}, kc = function(e, t, n, a, i, s) {
  e === "<" || e === "\\lt" || e === "⟨" ? e = "\\langle" : (e === ">" || e === "\\gt" || e === "⟩") && (e = "\\rangle");
  var l;
  ae.contains(bc, e) ? l = Wd : ae.contains(vc, e) ? l = yc : l = Kd;
  var o = wc(e, t, l, a);
  return o.type === "small" ? Od(e, o.style, n, a, i, s) : o.type === "large" ? gc(e, o.size, n, a, i, s) : _c(e, t, n, a, i, s);
}, Xd = function(e, t, n, a, i, s) {
  var l = a.fontMetrics().axisHeight * a.sizeMultiplier, o = 901, u = 5 / a.fontMetrics().ptPerEm, h = Math.max(t - l, n + l), m = Math.max(
    // In real TeX, calculations are done using integral values which are
    // 65536 per pt, or 655360 per em. So, the division here truncates in
    // TeX but doesn't here, producing different results. If we wanted to
    // exactly match TeX's calculation, we could do
    //   Math.floor(655360 * maxDistFromAxis / 500) *
    //    delimiterFactor / 655360
    // (To see the difference, compare
    //    x^{x^{\left(\rule{0.1em}{0.68em}\right)}}
    // in TeX and KaTeX)
    h / 500 * o,
    2 * h - u
  );
  return kc(e, m, !0, a, i, s);
}, f0 = {
  sqrtImage: Gd,
  sizedDelim: Vd,
  sizeToMaxHeight: Qr,
  customSizedDelim: kc,
  leftRightDelim: Xd
}, xo = {
  "\\bigl": {
    mclass: "mopen",
    size: 1
  },
  "\\Bigl": {
    mclass: "mopen",
    size: 2
  },
  "\\biggl": {
    mclass: "mopen",
    size: 3
  },
  "\\Biggl": {
    mclass: "mopen",
    size: 4
  },
  "\\bigr": {
    mclass: "mclose",
    size: 1
  },
  "\\Bigr": {
    mclass: "mclose",
    size: 2
  },
  "\\biggr": {
    mclass: "mclose",
    size: 3
  },
  "\\Biggr": {
    mclass: "mclose",
    size: 4
  },
  "\\bigm": {
    mclass: "mrel",
    size: 1
  },
  "\\Bigm": {
    mclass: "mrel",
    size: 2
  },
  "\\biggm": {
    mclass: "mrel",
    size: 3
  },
  "\\Biggm": {
    mclass: "mrel",
    size: 4
  },
  "\\big": {
    mclass: "mord",
    size: 1
  },
  "\\Big": {
    mclass: "mord",
    size: 2
  },
  "\\bigg": {
    mclass: "mord",
    size: 3
  },
  "\\Bigg": {
    mclass: "mord",
    size: 4
  }
}, Zd = ["(", "\\lparen", ")", "\\rparen", "[", "\\lbrack", "]", "\\rbrack", "\\{", "\\lbrace", "\\}", "\\rbrace", "\\lfloor", "\\rfloor", "⌊", "⌋", "\\lceil", "\\rceil", "⌈", "⌉", "<", ">", "\\langle", "⟨", "\\rangle", "⟩", "\\lt", "\\gt", "\\lvert", "\\rvert", "\\lVert", "\\rVert", "\\lgroup", "\\rgroup", "⟮", "⟯", "\\lmoustache", "\\rmoustache", "⎰", "⎱", "/", "\\backslash", "|", "\\vert", "\\|", "\\Vert", "\\uparrow", "\\Uparrow", "\\downarrow", "\\Downarrow", "\\updownarrow", "\\Updownarrow", "."];
function Bi(r, e) {
  var t = Mi(r);
  if (t && ae.contains(Zd, t.text))
    return t;
  throw t ? new U("Invalid delimiter '" + t.text + "' after '" + e.funcName + "'", r) : new U("Invalid delimiter type '" + r.type + "'", r);
}
Y({
  type: "delimsizing",
  names: ["\\bigl", "\\Bigl", "\\biggl", "\\Biggl", "\\bigr", "\\Bigr", "\\biggr", "\\Biggr", "\\bigm", "\\Bigm", "\\biggm", "\\Biggm", "\\big", "\\Big", "\\bigg", "\\Bigg"],
  props: {
    numArgs: 1,
    argTypes: ["primitive"]
  },
  handler: (r, e) => {
    var t = Bi(e[0], r);
    return {
      type: "delimsizing",
      mode: r.parser.mode,
      size: xo[r.funcName].size,
      mclass: xo[r.funcName].mclass,
      delim: t.text
    };
  },
  htmlBuilder: (r, e) => r.delim === "." ? F.makeSpan([r.mclass]) : f0.sizedDelim(r.delim, r.size, e, r.mode, [r.mclass]),
  mathmlBuilder: (r) => {
    var e = [];
    r.delim !== "." && e.push(kn(r.delim, r.mode));
    var t = new P.MathNode("mo", e);
    r.mclass === "mopen" || r.mclass === "mclose" ? t.setAttribute("fence", "true") : t.setAttribute("fence", "false"), t.setAttribute("stretchy", "true");
    var n = W(f0.sizeToMaxHeight[r.size]);
    return t.setAttribute("minsize", n), t.setAttribute("maxsize", n), t;
  }
});
function Ao(r) {
  if (!r.body)
    throw new Error("Bug: The leftright ParseNode wasn't fully parsed.");
}
Y({
  type: "leftright-right",
  names: ["\\right"],
  props: {
    numArgs: 1,
    primitive: !0
  },
  handler: (r, e) => {
    var t = r.parser.gullet.macros.get("\\current@color");
    if (t && typeof t != "string")
      throw new U("\\current@color set to non-string in \\right");
    return {
      type: "leftright-right",
      mode: r.parser.mode,
      delim: Bi(e[0], r).text,
      color: t
      // undefined if not set via \color
    };
  }
});
Y({
  type: "leftright",
  names: ["\\left"],
  props: {
    numArgs: 1,
    primitive: !0
  },
  handler: (r, e) => {
    var t = Bi(e[0], r), n = r.parser;
    ++n.leftrightDepth;
    var a = n.parseExpression(!1);
    --n.leftrightDepth, n.expect("\\right", !1);
    var i = pe(n.parseFunction(), "leftright-right");
    return {
      type: "leftright",
      mode: n.mode,
      body: a,
      left: t.text,
      right: i.delim,
      rightColor: i.color
    };
  },
  htmlBuilder: (r, e) => {
    Ao(r);
    for (var t = _t(r.body, e, !0, ["mopen", "mclose"]), n = 0, a = 0, i = !1, s = 0; s < t.length; s++)
      t[s].isMiddle ? i = !0 : (n = Math.max(t[s].height, n), a = Math.max(t[s].depth, a));
    n *= e.sizeMultiplier, a *= e.sizeMultiplier;
    var l;
    if (r.left === "." ? l = ia(e, ["mopen"]) : l = f0.leftRightDelim(r.left, n, a, e, r.mode, ["mopen"]), t.unshift(l), i)
      for (var o = 1; o < t.length; o++) {
        var u = t[o], h = u.isMiddle;
        h && (t[o] = f0.leftRightDelim(h.delim, n, a, h.options, r.mode, []));
      }
    var m;
    if (r.right === ".")
      m = ia(e, ["mclose"]);
    else {
      var d = r.rightColor ? e.withColor(r.rightColor) : e;
      m = f0.leftRightDelim(r.right, n, a, d, r.mode, ["mclose"]);
    }
    return t.push(m), F.makeSpan(["minner"], t, e);
  },
  mathmlBuilder: (r, e) => {
    Ao(r);
    var t = Yt(r.body, e);
    if (r.left !== ".") {
      var n = new P.MathNode("mo", [kn(r.left, r.mode)]);
      n.setAttribute("fence", "true"), t.unshift(n);
    }
    if (r.right !== ".") {
      var a = new P.MathNode("mo", [kn(r.right, r.mode)]);
      a.setAttribute("fence", "true"), r.rightColor && a.setAttribute("mathcolor", r.rightColor), t.push(a);
    }
    return El(t);
  }
});
Y({
  type: "middle",
  names: ["\\middle"],
  props: {
    numArgs: 1,
    primitive: !0
  },
  handler: (r, e) => {
    var t = Bi(e[0], r);
    if (!r.parser.leftrightDepth)
      throw new U("\\middle without preceding \\left", t);
    return {
      type: "middle",
      mode: r.parser.mode,
      delim: t.text
    };
  },
  htmlBuilder: (r, e) => {
    var t;
    if (r.delim === ".")
      t = ia(e, []);
    else {
      t = f0.sizedDelim(r.delim, 1, e, r.mode, []);
      var n = {
        delim: r.delim,
        options: e
      };
      t.isMiddle = n;
    }
    return t;
  },
  mathmlBuilder: (r, e) => {
    var t = r.delim === "\\vert" || r.delim === "|" ? kn("|", "text") : kn(r.delim, r.mode), n = new P.MathNode("mo", [t]);
    return n.setAttribute("fence", "true"), n.setAttribute("lspace", "0.05em"), n.setAttribute("rspace", "0.05em"), n;
  }
});
var Ml = (r, e) => {
  var t = F.wrapFragment(xe(r.body, e), e), n = r.label.slice(1), a = e.sizeMultiplier, i, s = 0, l = ae.isCharacterBox(r.body);
  if (n === "sout")
    i = F.makeSpan(["stretchy", "sout"]), i.height = e.fontMetrics().defaultRuleThickness / a, s = -0.5 * e.fontMetrics().xHeight;
  else if (n === "phase") {
    var o = We({
      number: 0.6,
      unit: "pt"
    }, e), u = We({
      number: 0.35,
      unit: "ex"
    }, e), h = e.havingBaseSizing();
    a = a / h.sizeMultiplier;
    var m = t.height + t.depth + o + u;
    t.style.paddingLeft = W(m / 2 + o);
    var d = Math.floor(1e3 * m * a), g = Gf(d), b = new m0([new N0("phase", g)], {
      width: "400em",
      height: W(d / 1e3),
      viewBox: "0 0 400000 " + d,
      preserveAspectRatio: "xMinYMin slice"
    });
    i = F.makeSvgSpan(["hide-tail"], [b], e), i.style.height = W(m), s = t.depth + o + u;
  } else {
    /cancel/.test(n) ? l || t.classes.push("cancel-pad") : n === "angl" ? t.classes.push("anglpad") : t.classes.push("boxpad");
    var v = 0, w = 0, x = 0;
    /box/.test(n) ? (x = Math.max(
      e.fontMetrics().fboxrule,
      // default
      e.minRuleThickness
      // User override.
    ), v = e.fontMetrics().fboxsep + (n === "colorbox" ? 0 : x), w = v) : n === "angl" ? (x = Math.max(e.fontMetrics().defaultRuleThickness, e.minRuleThickness), v = 4 * x, w = Math.max(0, 0.25 - t.depth)) : (v = l ? 0.2 : 0, w = v), i = g0.encloseSpan(t, n, v, w, e), /fbox|boxed|fcolorbox/.test(n) ? (i.style.borderStyle = "solid", i.style.borderWidth = W(x)) : n === "angl" && x !== 0.049 && (i.style.borderTopWidth = W(x), i.style.borderRightWidth = W(x)), s = t.depth + w, r.backgroundColor && (i.style.backgroundColor = r.backgroundColor, r.borderColor && (i.style.borderColor = r.borderColor));
  }
  var k;
  if (r.backgroundColor)
    k = F.makeVList({
      positionType: "individualShift",
      children: [
        // Put the color background behind inner;
        {
          type: "elem",
          elem: i,
          shift: s
        },
        {
          type: "elem",
          elem: t,
          shift: 0
        }
      ]
    }, e);
  else {
    var y = /cancel|phase/.test(n) ? ["svg-align"] : [];
    k = F.makeVList({
      positionType: "individualShift",
      children: [
        // Write the \cancel stroke on top of inner.
        {
          type: "elem",
          elem: t,
          shift: 0
        },
        {
          type: "elem",
          elem: i,
          shift: s,
          wrapperClasses: y
        }
      ]
    }, e);
  }
  return /cancel/.test(n) && (k.height = t.height, k.depth = t.depth), /cancel/.test(n) && !l ? F.makeSpan(["mord", "cancel-lap"], [k], e) : F.makeSpan(["mord"], [k], e);
}, zl = (r, e) => {
  var t = 0, n = new P.MathNode(r.label.indexOf("colorbox") > -1 ? "mpadded" : "menclose", [Le(r.body, e)]);
  switch (r.label) {
    case "\\cancel":
      n.setAttribute("notation", "updiagonalstrike");
      break;
    case "\\bcancel":
      n.setAttribute("notation", "downdiagonalstrike");
      break;
    case "\\phase":
      n.setAttribute("notation", "phasorangle");
      break;
    case "\\sout":
      n.setAttribute("notation", "horizontalstrike");
      break;
    case "\\fbox":
      n.setAttribute("notation", "box");
      break;
    case "\\angl":
      n.setAttribute("notation", "actuarial");
      break;
    case "\\fcolorbox":
    case "\\colorbox":
      if (t = e.fontMetrics().fboxsep * e.fontMetrics().ptPerEm, n.setAttribute("width", "+" + 2 * t + "pt"), n.setAttribute("height", "+" + 2 * t + "pt"), n.setAttribute("lspace", t + "pt"), n.setAttribute("voffset", t + "pt"), r.label === "\\fcolorbox") {
        var a = Math.max(
          e.fontMetrics().fboxrule,
          // default
          e.minRuleThickness
          // user override
        );
        n.setAttribute("style", "border: " + a + "em solid " + String(r.borderColor));
      }
      break;
    case "\\xcancel":
      n.setAttribute("notation", "updiagonalstrike downdiagonalstrike");
      break;
  }
  return r.backgroundColor && n.setAttribute("mathbackground", r.backgroundColor), n;
};
Y({
  type: "enclose",
  names: ["\\colorbox"],
  props: {
    numArgs: 2,
    allowedInText: !0,
    argTypes: ["color", "text"]
  },
  handler(r, e, t) {
    var {
      parser: n,
      funcName: a
    } = r, i = pe(e[0], "color-token").color, s = e[1];
    return {
      type: "enclose",
      mode: n.mode,
      label: a,
      backgroundColor: i,
      body: s
    };
  },
  htmlBuilder: Ml,
  mathmlBuilder: zl
});
Y({
  type: "enclose",
  names: ["\\fcolorbox"],
  props: {
    numArgs: 3,
    allowedInText: !0,
    argTypes: ["color", "color", "text"]
  },
  handler(r, e, t) {
    var {
      parser: n,
      funcName: a
    } = r, i = pe(e[0], "color-token").color, s = pe(e[1], "color-token").color, l = e[2];
    return {
      type: "enclose",
      mode: n.mode,
      label: a,
      backgroundColor: s,
      borderColor: i,
      body: l
    };
  },
  htmlBuilder: Ml,
  mathmlBuilder: zl
});
Y({
  type: "enclose",
  names: ["\\fbox"],
  props: {
    numArgs: 1,
    argTypes: ["hbox"],
    allowedInText: !0
  },
  handler(r, e) {
    var {
      parser: t
    } = r;
    return {
      type: "enclose",
      mode: t.mode,
      label: "\\fbox",
      body: e[0]
    };
  }
});
Y({
  type: "enclose",
  names: ["\\cancel", "\\bcancel", "\\xcancel", "\\sout", "\\phase"],
  props: {
    numArgs: 1
  },
  handler(r, e) {
    var {
      parser: t,
      funcName: n
    } = r, a = e[0];
    return {
      type: "enclose",
      mode: t.mode,
      label: n,
      body: a
    };
  },
  htmlBuilder: Ml,
  mathmlBuilder: zl
});
Y({
  type: "enclose",
  names: ["\\angl"],
  props: {
    numArgs: 1,
    argTypes: ["hbox"],
    allowedInText: !1
  },
  handler(r, e) {
    var {
      parser: t
    } = r;
    return {
      type: "enclose",
      mode: t.mode,
      label: "\\angl",
      body: e[0]
    };
  }
});
var Sc = {};
function Jn(r) {
  for (var {
    type: e,
    names: t,
    props: n,
    handler: a,
    htmlBuilder: i,
    mathmlBuilder: s
  } = r, l = {
    type: e,
    numArgs: n.numArgs || 0,
    allowedInText: !1,
    numOptionalArgs: 0,
    handler: a
  }, o = 0; o < t.length; ++o)
    Sc[t[o]] = l;
  i && (wi[e] = i), s && (ki[e] = s);
}
var Dc = {};
function _(r, e) {
  Dc[r] = e;
}
function Eo(r) {
  var e = [];
  r.consumeSpaces();
  var t = r.fetch().text;
  for (t === "\\relax" && (r.consume(), r.consumeSpaces(), t = r.fetch().text); t === "\\hline" || t === "\\hdashline"; )
    r.consume(), e.push(t === "\\hdashline"), r.consumeSpaces(), t = r.fetch().text;
  return e;
}
var Ni = (r) => {
  var e = r.parser.settings;
  if (!e.displayMode)
    throw new U("{" + r.envName + "} can be used only in display mode.");
};
function Bl(r) {
  if (r.indexOf("ed") === -1)
    return r.indexOf("*") === -1;
}
function R0(r, e, t) {
  var {
    hskipBeforeAndAfter: n,
    addJot: a,
    cols: i,
    arraystretch: s,
    colSeparationType: l,
    autoTag: o,
    singleRow: u,
    emptySingleRow: h,
    maxNumCols: m,
    leqno: d
  } = e;
  if (r.gullet.beginGroup(), u || r.gullet.macros.set("\\cr", "\\\\\\relax"), !s) {
    var g = r.gullet.expandMacroAsText("\\arraystretch");
    if (g == null)
      s = 1;
    else if (s = parseFloat(g), !s || s < 0)
      throw new U("Invalid \\arraystretch: " + g);
  }
  r.gullet.beginGroup();
  var b = [], v = [b], w = [], x = [], k = o != null ? [] : void 0;
  function y() {
    o && r.gullet.macros.set("\\@eqnsw", "1", !0);
  }
  function A() {
    k && (r.gullet.macros.get("\\df@tag") ? (k.push(r.subparse([new yn("\\df@tag")])), r.gullet.macros.set("\\df@tag", void 0, !0)) : k.push(!!o && r.gullet.macros.get("\\@eqnsw") === "1"));
  }
  for (y(), x.push(Eo(r)); ; ) {
    var $ = r.parseExpression(!1, u ? "\\end" : "\\\\");
    r.gullet.endGroup(), r.gullet.beginGroup(), $ = {
      type: "ordgroup",
      mode: r.mode,
      body: $
    }, t && ($ = {
      type: "styling",
      mode: r.mode,
      style: t,
      body: [$]
    }), b.push($);
    var M = r.fetch().text;
    if (M === "&") {
      if (m && b.length === m) {
        if (u || l)
          throw new U("Too many tab characters: &", r.nextToken);
        r.settings.reportNonstrict("textEnv", "Too few columns specified in the {array} column argument.");
      }
      r.consume();
    } else if (M === "\\end") {
      A(), b.length === 1 && $.type === "styling" && $.body[0].body.length === 0 && (v.length > 1 || !h) && v.pop(), x.length < v.length + 1 && x.push([]);
      break;
    } else if (M === "\\\\") {
      r.consume();
      var z = void 0;
      r.gullet.future().text !== " " && (z = r.parseSizeGroup(!0)), w.push(z ? z.value : null), A(), x.push(Eo(r)), b = [], v.push(b), y();
    } else
      throw new U("Expected & or \\\\ or \\cr or \\end", r.nextToken);
  }
  return r.gullet.endGroup(), r.gullet.endGroup(), {
    type: "array",
    mode: r.mode,
    addJot: a,
    arraystretch: s,
    body: v,
    cols: i,
    rowGaps: w,
    hskipBeforeAndAfter: n,
    hLinesBeforeRow: x,
    colSeparationType: l,
    tags: k,
    leqno: d
  };
}
function Nl(r) {
  return r.slice(0, 1) === "d" ? "display" : "text";
}
var e0 = function(e, t) {
  var n, a, i = e.body.length, s = e.hLinesBeforeRow, l = 0, o = new Array(i), u = [], h = Math.max(
    // From LaTeX \showthe\arrayrulewidth. Equals 0.04 em.
    t.fontMetrics().arrayRuleWidth,
    t.minRuleThickness
    // User override.
  ), m = 1 / t.fontMetrics().ptPerEm, d = 5 * m;
  if (e.colSeparationType && e.colSeparationType === "small") {
    var g = t.havingStyle(le.SCRIPT).sizeMultiplier;
    d = 0.2778 * (g / t.sizeMultiplier);
  }
  var b = e.colSeparationType === "CD" ? We({
    number: 3,
    unit: "ex"
  }, t) : 12 * m, v = 3 * m, w = e.arraystretch * b, x = 0.7 * w, k = 0.3 * w, y = 0;
  function A(jt) {
    for (var Qt = 0; Qt < jt.length; ++Qt)
      Qt > 0 && (y += 0.25), u.push({
        pos: y,
        isDashed: jt[Qt]
      });
  }
  for (A(s[0]), n = 0; n < e.body.length; ++n) {
    var $ = e.body[n], M = x, z = k;
    l < $.length && (l = $.length);
    var O = new Array($.length);
    for (a = 0; a < $.length; ++a) {
      var L = xe($[a], t);
      z < L.depth && (z = L.depth), M < L.height && (M = L.height), O[a] = L;
    }
    var K = e.rowGaps[n], X = 0;
    K && (X = We(K, t), X > 0 && (X += k, z < X && (z = X), X = 0)), e.addJot && (z += v), O.height = M, O.depth = z, y += M, O.pos = y, y += z + X, o[n] = O, A(s[n + 1]);
  }
  var J = y / 2 + t.fontMetrics().axisHeight, Se = e.cols || [], _e = [], ge, Ae, Oe = [];
  if (e.tags && e.tags.some((jt) => jt))
    for (n = 0; n < i; ++n) {
      var ke = o[n], Be = ke.pos - J, Ee = e.tags[n], I = void 0;
      Ee === !0 ? I = F.makeSpan(["eqn-num"], [], t) : Ee === !1 ? I = F.makeSpan([], [], t) : I = F.makeSpan([], _t(Ee, t, !0), t), I.depth = ke.depth, I.height = ke.height, Oe.push({
        type: "elem",
        elem: I,
        shift: Be
      });
    }
  for (
    a = 0, Ae = 0;
    // Continue while either there are more columns or more column
    // descriptions, so trailing separators don't get lost.
    a < l || Ae < Se.length;
    ++a, ++Ae
  ) {
    for (var be = Se[Ae] || {}, ye = !0; be.type === "separator"; ) {
      if (ye || (ge = F.makeSpan(["arraycolsep"], []), ge.style.width = W(t.fontMetrics().doubleRuleSep), _e.push(ge)), be.separator === "|" || be.separator === ":") {
        var Ie = be.separator === "|" ? "solid" : "dashed", H = F.makeSpan(["vertical-separator"], [], t);
        H.style.height = W(y), H.style.borderRightWidth = W(h), H.style.borderRightStyle = Ie, H.style.margin = "0 " + W(-h / 2);
        var nt = y - J;
        nt && (H.style.verticalAlign = W(-nt)), _e.push(H);
      } else
        throw new U("Invalid separator type: " + be.separator);
      Ae++, be = Se[Ae] || {}, ye = !1;
    }
    if (!(a >= l)) {
      var Pe = void 0;
      (a > 0 || e.hskipBeforeAndAfter) && (Pe = ae.deflt(be.pregap, d), Pe !== 0 && (ge = F.makeSpan(["arraycolsep"], []), ge.style.width = W(Pe), _e.push(ge)));
      var mt = [];
      for (n = 0; n < i; ++n) {
        var vt = o[n], xt = vt[a];
        if (xt) {
          var Nt = vt.pos - J;
          xt.depth = vt.depth, xt.height = vt.height, mt.push({
            type: "elem",
            elem: xt,
            shift: Nt
          });
        }
      }
      mt = F.makeVList({
        positionType: "individualShift",
        children: mt
      }, t), mt = F.makeSpan(["col-align-" + (be.align || "c")], [mt]), _e.push(mt), (a < l - 1 || e.hskipBeforeAndAfter) && (Pe = ae.deflt(be.postgap, d), Pe !== 0 && (ge = F.makeSpan(["arraycolsep"], []), ge.style.width = W(Pe), _e.push(ge)));
    }
  }
  if (o = F.makeSpan(["mtable"], _e), u.length > 0) {
    for (var Q = F.makeLineSpan("hline", t, h), je = F.makeLineSpan("hdashline", t, h), Fe = [{
      type: "elem",
      elem: o,
      shift: 0
    }]; u.length > 0; ) {
      var Zt = u.pop(), Ln = Zt.pos - J;
      Zt.isDashed ? Fe.push({
        type: "elem",
        elem: je,
        shift: Ln
      }) : Fe.push({
        type: "elem",
        elem: Q,
        shift: Ln
      });
    }
    o = F.makeVList({
      positionType: "individualShift",
      children: Fe
    }, t);
  }
  if (Oe.length === 0)
    return F.makeSpan(["mord"], [o], t);
  var Gt = F.makeVList({
    positionType: "individualShift",
    children: Oe
  }, t);
  return Gt = F.makeSpan(["tag"], [Gt], t), F.makeFragment([o, Gt]);
}, Qd = {
  c: "center ",
  l: "left ",
  r: "right "
}, t0 = function(e, t) {
  for (var n = [], a = new P.MathNode("mtd", [], ["mtr-glue"]), i = new P.MathNode("mtd", [], ["mml-eqn-num"]), s = 0; s < e.body.length; s++) {
    for (var l = e.body[s], o = [], u = 0; u < l.length; u++)
      o.push(new P.MathNode("mtd", [Le(l[u], t)]));
    e.tags && e.tags[s] && (o.unshift(a), o.push(a), e.leqno ? o.unshift(i) : o.push(i)), n.push(new P.MathNode("mtr", o));
  }
  var h = new P.MathNode("mtable", n), m = e.arraystretch === 0.5 ? 0.1 : 0.16 + e.arraystretch - 1 + (e.addJot ? 0.09 : 0);
  h.setAttribute("rowspacing", W(m));
  var d = "", g = "";
  if (e.cols && e.cols.length > 0) {
    var b = e.cols, v = "", w = !1, x = 0, k = b.length;
    b[0].type === "separator" && (d += "top ", x = 1), b[b.length - 1].type === "separator" && (d += "bottom ", k -= 1);
    for (var y = x; y < k; y++)
      b[y].type === "align" ? (g += Qd[b[y].align], w && (v += "none "), w = !0) : b[y].type === "separator" && w && (v += b[y].separator === "|" ? "solid " : "dashed ", w = !1);
    h.setAttribute("columnalign", g.trim()), /[sd]/.test(v) && h.setAttribute("columnlines", v.trim());
  }
  if (e.colSeparationType === "align") {
    for (var A = e.cols || [], $ = "", M = 1; M < A.length; M++)
      $ += M % 2 ? "0em " : "1em ";
    h.setAttribute("columnspacing", $.trim());
  } else e.colSeparationType === "alignat" || e.colSeparationType === "gather" ? h.setAttribute("columnspacing", "0em") : e.colSeparationType === "small" ? h.setAttribute("columnspacing", "0.2778em") : e.colSeparationType === "CD" ? h.setAttribute("columnspacing", "0.5em") : h.setAttribute("columnspacing", "1em");
  var z = "", O = e.hLinesBeforeRow;
  d += O[0].length > 0 ? "left " : "", d += O[O.length - 1].length > 0 ? "right " : "";
  for (var L = 1; L < O.length - 1; L++)
    z += O[L].length === 0 ? "none " : O[L][0] ? "dashed " : "solid ";
  return /[sd]/.test(z) && h.setAttribute("rowlines", z.trim()), d !== "" && (h = new P.MathNode("menclose", [h]), h.setAttribute("notation", d.trim())), e.arraystretch && e.arraystretch < 1 && (h = new P.MathNode("mstyle", [h]), h.setAttribute("scriptlevel", "1")), h;
}, xc = function(e, t) {
  e.envName.indexOf("ed") === -1 && Ni(e);
  var n = [], a = e.envName.indexOf("at") > -1 ? "alignat" : "align", i = e.envName === "split", s = R0(e.parser, {
    cols: n,
    addJot: !0,
    autoTag: i ? void 0 : Bl(e.envName),
    emptySingleRow: !0,
    colSeparationType: a,
    maxNumCols: i ? 2 : void 0,
    leqno: e.parser.settings.leqno
  }, "display"), l, o = 0, u = {
    type: "ordgroup",
    mode: e.mode,
    body: []
  };
  if (t[0] && t[0].type === "ordgroup") {
    for (var h = "", m = 0; m < t[0].body.length; m++) {
      var d = pe(t[0].body[m], "textord");
      h += d.text;
    }
    l = Number(h), o = l * 2;
  }
  var g = !o;
  s.body.forEach(function(x) {
    for (var k = 1; k < x.length; k += 2) {
      var y = pe(x[k], "styling"), A = pe(y.body[0], "ordgroup");
      A.body.unshift(u);
    }
    if (g)
      o < x.length && (o = x.length);
    else {
      var $ = x.length / 2;
      if (l < $)
        throw new U("Too many math in a row: " + ("expected " + l + ", but got " + $), x[0]);
    }
  });
  for (var b = 0; b < o; ++b) {
    var v = "r", w = 0;
    b % 2 === 1 ? v = "l" : b > 0 && g && (w = 1), n[b] = {
      type: "align",
      align: v,
      pregap: w,
      postgap: 0
    };
  }
  return s.colSeparationType = g ? "align" : "alignat", s;
};
Jn({
  type: "array",
  names: ["array", "darray"],
  props: {
    numArgs: 1
  },
  handler(r, e) {
    var t = Mi(e[0]), n = t ? [e[0]] : pe(e[0], "ordgroup").body, a = n.map(function(s) {
      var l = $l(s), o = l.text;
      if ("lcr".indexOf(o) !== -1)
        return {
          type: "align",
          align: o
        };
      if (o === "|")
        return {
          type: "separator",
          separator: "|"
        };
      if (o === ":")
        return {
          type: "separator",
          separator: ":"
        };
      throw new U("Unknown column alignment: " + o, s);
    }), i = {
      cols: a,
      hskipBeforeAndAfter: !0,
      // \@preamble in lttab.dtx
      maxNumCols: a.length
    };
    return R0(r.parser, i, Nl(r.envName));
  },
  htmlBuilder: e0,
  mathmlBuilder: t0
});
Jn({
  type: "array",
  names: ["matrix", "pmatrix", "bmatrix", "Bmatrix", "vmatrix", "Vmatrix", "matrix*", "pmatrix*", "bmatrix*", "Bmatrix*", "vmatrix*", "Vmatrix*"],
  props: {
    numArgs: 0
  },
  handler(r) {
    var e = {
      matrix: null,
      pmatrix: ["(", ")"],
      bmatrix: ["[", "]"],
      Bmatrix: ["\\{", "\\}"],
      vmatrix: ["|", "|"],
      Vmatrix: ["\\Vert", "\\Vert"]
    }[r.envName.replace("*", "")], t = "c", n = {
      hskipBeforeAndAfter: !1,
      cols: [{
        type: "align",
        align: t
      }]
    };
    if (r.envName.charAt(r.envName.length - 1) === "*") {
      var a = r.parser;
      if (a.consumeSpaces(), a.fetch().text === "[") {
        if (a.consume(), a.consumeSpaces(), t = a.fetch().text, "lcr".indexOf(t) === -1)
          throw new U("Expected l or c or r", a.nextToken);
        a.consume(), a.consumeSpaces(), a.expect("]"), a.consume(), n.cols = [{
          type: "align",
          align: t
        }];
      }
    }
    var i = R0(r.parser, n, Nl(r.envName)), s = Math.max(0, ...i.body.map((l) => l.length));
    return i.cols = new Array(s).fill({
      type: "align",
      align: t
    }), e ? {
      type: "leftright",
      mode: r.mode,
      body: [i],
      left: e[0],
      right: e[1],
      rightColor: void 0
      // \right uninfluenced by \color in array
    } : i;
  },
  htmlBuilder: e0,
  mathmlBuilder: t0
});
Jn({
  type: "array",
  names: ["smallmatrix"],
  props: {
    numArgs: 0
  },
  handler(r) {
    var e = {
      arraystretch: 0.5
    }, t = R0(r.parser, e, "script");
    return t.colSeparationType = "small", t;
  },
  htmlBuilder: e0,
  mathmlBuilder: t0
});
Jn({
  type: "array",
  names: ["subarray"],
  props: {
    numArgs: 1
  },
  handler(r, e) {
    var t = Mi(e[0]), n = t ? [e[0]] : pe(e[0], "ordgroup").body, a = n.map(function(s) {
      var l = $l(s), o = l.text;
      if ("lc".indexOf(o) !== -1)
        return {
          type: "align",
          align: o
        };
      throw new U("Unknown column alignment: " + o, s);
    });
    if (a.length > 1)
      throw new U("{subarray} can contain only one column");
    var i = {
      cols: a,
      hskipBeforeAndAfter: !1,
      arraystretch: 0.5
    };
    if (i = R0(r.parser, i, "script"), i.body.length > 0 && i.body[0].length > 1)
      throw new U("{subarray} can contain only one column");
    return i;
  },
  htmlBuilder: e0,
  mathmlBuilder: t0
});
Jn({
  type: "array",
  names: ["cases", "dcases", "rcases", "drcases"],
  props: {
    numArgs: 0
  },
  handler(r) {
    var e = {
      arraystretch: 1.2,
      cols: [{
        type: "align",
        align: "l",
        pregap: 0,
        // TODO(kevinb) get the current style.
        // For now we use the metrics for TEXT style which is what we were
        // doing before.  Before attempting to get the current style we
        // should look at TeX's behavior especially for \over and matrices.
        postgap: 1
        /* 1em quad */
      }, {
        type: "align",
        align: "l",
        pregap: 0,
        postgap: 0
      }]
    }, t = R0(r.parser, e, Nl(r.envName));
    return {
      type: "leftright",
      mode: r.mode,
      body: [t],
      left: r.envName.indexOf("r") > -1 ? "." : "\\{",
      right: r.envName.indexOf("r") > -1 ? "\\}" : ".",
      rightColor: void 0
    };
  },
  htmlBuilder: e0,
  mathmlBuilder: t0
});
Jn({
  type: "array",
  names: ["align", "align*", "aligned", "split"],
  props: {
    numArgs: 0
  },
  handler: xc,
  htmlBuilder: e0,
  mathmlBuilder: t0
});
Jn({
  type: "array",
  names: ["gathered", "gather", "gather*"],
  props: {
    numArgs: 0
  },
  handler(r) {
    ae.contains(["gather", "gather*"], r.envName) && Ni(r);
    var e = {
      cols: [{
        type: "align",
        align: "c"
      }],
      addJot: !0,
      colSeparationType: "gather",
      autoTag: Bl(r.envName),
      emptySingleRow: !0,
      leqno: r.parser.settings.leqno
    };
    return R0(r.parser, e, "display");
  },
  htmlBuilder: e0,
  mathmlBuilder: t0
});
Jn({
  type: "array",
  names: ["alignat", "alignat*", "alignedat"],
  props: {
    numArgs: 1
  },
  handler: xc,
  htmlBuilder: e0,
  mathmlBuilder: t0
});
Jn({
  type: "array",
  names: ["equation", "equation*"],
  props: {
    numArgs: 0
  },
  handler(r) {
    Ni(r);
    var e = {
      autoTag: Bl(r.envName),
      emptySingleRow: !0,
      singleRow: !0,
      maxNumCols: 1,
      leqno: r.parser.settings.leqno
    };
    return R0(r.parser, e, "display");
  },
  htmlBuilder: e0,
  mathmlBuilder: t0
});
Jn({
  type: "array",
  names: ["CD"],
  props: {
    numArgs: 0
  },
  handler(r) {
    return Ni(r), Id(r.parser);
  },
  htmlBuilder: e0,
  mathmlBuilder: t0
});
_("\\nonumber", "\\gdef\\@eqnsw{0}");
_("\\notag", "\\nonumber");
Y({
  type: "text",
  // Doesn't matter what this is.
  names: ["\\hline", "\\hdashline"],
  props: {
    numArgs: 0,
    allowedInText: !0,
    allowedInMath: !0
  },
  handler(r, e) {
    throw new U(r.funcName + " valid only within array environment");
  }
});
var Co = Sc;
Y({
  type: "environment",
  names: ["\\begin", "\\end"],
  props: {
    numArgs: 1,
    argTypes: ["text"]
  },
  handler(r, e) {
    var {
      parser: t,
      funcName: n
    } = r, a = e[0];
    if (a.type !== "ordgroup")
      throw new U("Invalid environment name", a);
    for (var i = "", s = 0; s < a.body.length; ++s)
      i += pe(a.body[s], "textord").text;
    if (n === "\\begin") {
      if (!Co.hasOwnProperty(i))
        throw new U("No such environment: " + i, a);
      var l = Co[i], {
        args: o,
        optArgs: u
      } = t.parseArguments("\\begin{" + i + "}", l), h = {
        mode: t.mode,
        envName: i,
        parser: t
      }, m = l.handler(h, o, u);
      t.expect("\\end", !1);
      var d = t.nextToken, g = pe(t.parseFunction(), "environment");
      if (g.name !== i)
        throw new U("Mismatch: \\begin{" + i + "} matched by \\end{" + g.name + "}", d);
      return m;
    }
    return {
      type: "environment",
      mode: t.mode,
      name: i,
      nameGroup: a
    };
  }
});
var Ac = (r, e) => {
  var t = r.font, n = e.withFont(t);
  return xe(r.body, n);
}, Ec = (r, e) => {
  var t = r.font, n = e.withFont(t);
  return Le(r.body, n);
}, $o = {
  "\\Bbb": "\\mathbb",
  "\\bold": "\\mathbf",
  "\\frak": "\\mathfrak",
  "\\bm": "\\boldsymbol"
};
Y({
  type: "font",
  names: [
    // styles, except \boldsymbol defined below
    "\\mathrm",
    "\\mathit",
    "\\mathbf",
    "\\mathnormal",
    "\\mathsfit",
    // families
    "\\mathbb",
    "\\mathcal",
    "\\mathfrak",
    "\\mathscr",
    "\\mathsf",
    "\\mathtt",
    // aliases, except \bm defined below
    "\\Bbb",
    "\\bold",
    "\\frak"
  ],
  props: {
    numArgs: 1,
    allowedInArgument: !0
  },
  handler: (r, e) => {
    var {
      parser: t,
      funcName: n
    } = r, a = Si(e[0]), i = n;
    return i in $o && (i = $o[i]), {
      type: "font",
      mode: t.mode,
      font: i.slice(1),
      body: a
    };
  },
  htmlBuilder: Ac,
  mathmlBuilder: Ec
});
Y({
  type: "mclass",
  names: ["\\boldsymbol", "\\bm"],
  props: {
    numArgs: 1
  },
  handler: (r, e) => {
    var {
      parser: t
    } = r, n = e[0], a = ae.isCharacterBox(n);
    return {
      type: "mclass",
      mode: t.mode,
      mclass: zi(n),
      body: [{
        type: "font",
        mode: t.mode,
        font: "boldsymbol",
        body: n
      }],
      isCharacterBox: a
    };
  }
});
Y({
  type: "font",
  names: ["\\rm", "\\sf", "\\tt", "\\bf", "\\it", "\\cal"],
  props: {
    numArgs: 0,
    allowedInText: !0
  },
  handler: (r, e) => {
    var {
      parser: t,
      funcName: n,
      breakOnTokenText: a
    } = r, {
      mode: i
    } = t, s = t.parseExpression(!0, a), l = "math" + n.slice(1);
    return {
      type: "font",
      mode: i,
      font: l,
      body: {
        type: "ordgroup",
        mode: t.mode,
        body: s
      }
    };
  },
  htmlBuilder: Ac,
  mathmlBuilder: Ec
});
var Cc = (r, e) => {
  var t = e;
  return r === "display" ? t = t.id >= le.SCRIPT.id ? t.text() : le.DISPLAY : r === "text" && t.size === le.DISPLAY.size ? t = le.TEXT : r === "script" ? t = le.SCRIPT : r === "scriptscript" && (t = le.SCRIPTSCRIPT), t;
}, ql = (r, e) => {
  var t = Cc(r.size, e.style), n = t.fracNum(), a = t.fracDen(), i;
  i = e.havingStyle(n);
  var s = xe(r.numer, i, e);
  if (r.continued) {
    var l = 8.5 / e.fontMetrics().ptPerEm, o = 3.5 / e.fontMetrics().ptPerEm;
    s.height = s.height < l ? l : s.height, s.depth = s.depth < o ? o : s.depth;
  }
  i = e.havingStyle(a);
  var u = xe(r.denom, i, e), h, m, d;
  r.hasBarLine ? (r.barSize ? (m = We(r.barSize, e), h = F.makeLineSpan("frac-line", e, m)) : h = F.makeLineSpan("frac-line", e), m = h.height, d = h.height) : (h = null, m = 0, d = e.fontMetrics().defaultRuleThickness);
  var g, b, v;
  t.size === le.DISPLAY.size || r.size === "display" ? (g = e.fontMetrics().num1, m > 0 ? b = 3 * d : b = 7 * d, v = e.fontMetrics().denom1) : (m > 0 ? (g = e.fontMetrics().num2, b = d) : (g = e.fontMetrics().num3, b = 3 * d), v = e.fontMetrics().denom2);
  var w;
  if (h) {
    var k = e.fontMetrics().axisHeight;
    g - s.depth - (k + 0.5 * m) < b && (g += b - (g - s.depth - (k + 0.5 * m))), k - 0.5 * m - (u.height - v) < b && (v += b - (k - 0.5 * m - (u.height - v)));
    var y = -(k - 0.5 * m);
    w = F.makeVList({
      positionType: "individualShift",
      children: [{
        type: "elem",
        elem: u,
        shift: v
      }, {
        type: "elem",
        elem: h,
        shift: y
      }, {
        type: "elem",
        elem: s,
        shift: -g
      }]
    }, e);
  } else {
    var x = g - s.depth - (u.height - v);
    x < b && (g += 0.5 * (b - x), v += 0.5 * (b - x)), w = F.makeVList({
      positionType: "individualShift",
      children: [{
        type: "elem",
        elem: u,
        shift: v
      }, {
        type: "elem",
        elem: s,
        shift: -g
      }]
    }, e);
  }
  i = e.havingStyle(t), w.height *= i.sizeMultiplier / e.sizeMultiplier, w.depth *= i.sizeMultiplier / e.sizeMultiplier;
  var A;
  t.size === le.DISPLAY.size ? A = e.fontMetrics().delim1 : t.size === le.SCRIPTSCRIPT.size ? A = e.havingStyle(le.SCRIPT).fontMetrics().delim2 : A = e.fontMetrics().delim2;
  var $, M;
  return r.leftDelim == null ? $ = ia(e, ["mopen"]) : $ = f0.customSizedDelim(r.leftDelim, A, !0, e.havingStyle(t), r.mode, ["mopen"]), r.continued ? M = F.makeSpan([]) : r.rightDelim == null ? M = ia(e, ["mclose"]) : M = f0.customSizedDelim(r.rightDelim, A, !0, e.havingStyle(t), r.mode, ["mclose"]), F.makeSpan(["mord"].concat(i.sizingClasses(e)), [$, F.makeSpan(["mfrac"], [w]), M], e);
}, Ll = (r, e) => {
  var t = new P.MathNode("mfrac", [Le(r.numer, e), Le(r.denom, e)]);
  if (!r.hasBarLine)
    t.setAttribute("linethickness", "0px");
  else if (r.barSize) {
    var n = We(r.barSize, e);
    t.setAttribute("linethickness", W(n));
  }
  var a = Cc(r.size, e.style);
  if (a.size !== e.style.size) {
    t = new P.MathNode("mstyle", [t]);
    var i = a.size === le.DISPLAY.size ? "true" : "false";
    t.setAttribute("displaystyle", i), t.setAttribute("scriptlevel", "0");
  }
  if (r.leftDelim != null || r.rightDelim != null) {
    var s = [];
    if (r.leftDelim != null) {
      var l = new P.MathNode("mo", [new P.TextNode(r.leftDelim.replace("\\", ""))]);
      l.setAttribute("fence", "true"), s.push(l);
    }
    if (s.push(t), r.rightDelim != null) {
      var o = new P.MathNode("mo", [new P.TextNode(r.rightDelim.replace("\\", ""))]);
      o.setAttribute("fence", "true"), s.push(o);
    }
    return El(s);
  }
  return t;
};
Y({
  type: "genfrac",
  names: [
    "\\dfrac",
    "\\frac",
    "\\tfrac",
    "\\dbinom",
    "\\binom",
    "\\tbinom",
    "\\\\atopfrac",
    // can’t be entered directly
    "\\\\bracefrac",
    "\\\\brackfrac"
    // ditto
  ],
  props: {
    numArgs: 2,
    allowedInArgument: !0
  },
  handler: (r, e) => {
    var {
      parser: t,
      funcName: n
    } = r, a = e[0], i = e[1], s, l = null, o = null, u = "auto";
    switch (n) {
      case "\\dfrac":
      case "\\frac":
      case "\\tfrac":
        s = !0;
        break;
      case "\\\\atopfrac":
        s = !1;
        break;
      case "\\dbinom":
      case "\\binom":
      case "\\tbinom":
        s = !1, l = "(", o = ")";
        break;
      case "\\\\bracefrac":
        s = !1, l = "\\{", o = "\\}";
        break;
      case "\\\\brackfrac":
        s = !1, l = "[", o = "]";
        break;
      default:
        throw new Error("Unrecognized genfrac command");
    }
    switch (n) {
      case "\\dfrac":
      case "\\dbinom":
        u = "display";
        break;
      case "\\tfrac":
      case "\\tbinom":
        u = "text";
        break;
    }
    return {
      type: "genfrac",
      mode: t.mode,
      continued: !1,
      numer: a,
      denom: i,
      hasBarLine: s,
      leftDelim: l,
      rightDelim: o,
      size: u,
      barSize: null
    };
  },
  htmlBuilder: ql,
  mathmlBuilder: Ll
});
Y({
  type: "genfrac",
  names: ["\\cfrac"],
  props: {
    numArgs: 2
  },
  handler: (r, e) => {
    var {
      parser: t,
      funcName: n
    } = r, a = e[0], i = e[1];
    return {
      type: "genfrac",
      mode: t.mode,
      continued: !0,
      numer: a,
      denom: i,
      hasBarLine: !0,
      leftDelim: null,
      rightDelim: null,
      size: "display",
      barSize: null
    };
  }
});
Y({
  type: "infix",
  names: ["\\over", "\\choose", "\\atop", "\\brace", "\\brack"],
  props: {
    numArgs: 0,
    infix: !0
  },
  handler(r) {
    var {
      parser: e,
      funcName: t,
      token: n
    } = r, a;
    switch (t) {
      case "\\over":
        a = "\\frac";
        break;
      case "\\choose":
        a = "\\binom";
        break;
      case "\\atop":
        a = "\\\\atopfrac";
        break;
      case "\\brace":
        a = "\\\\bracefrac";
        break;
      case "\\brack":
        a = "\\\\brackfrac";
        break;
      default:
        throw new Error("Unrecognized infix genfrac command");
    }
    return {
      type: "infix",
      mode: e.mode,
      replaceWith: a,
      token: n
    };
  }
});
var To = ["display", "text", "script", "scriptscript"], Fo = function(e) {
  var t = null;
  return e.length > 0 && (t = e, t = t === "." ? null : t), t;
};
Y({
  type: "genfrac",
  names: ["\\genfrac"],
  props: {
    numArgs: 6,
    allowedInArgument: !0,
    argTypes: ["math", "math", "size", "text", "math", "math"]
  },
  handler(r, e) {
    var {
      parser: t
    } = r, n = e[4], a = e[5], i = Si(e[0]), s = i.type === "atom" && i.family === "open" ? Fo(i.text) : null, l = Si(e[1]), o = l.type === "atom" && l.family === "close" ? Fo(l.text) : null, u = pe(e[2], "size"), h, m = null;
    u.isBlank ? h = !0 : (m = u.value, h = m.number > 0);
    var d = "auto", g = e[3];
    if (g.type === "ordgroup") {
      if (g.body.length > 0) {
        var b = pe(g.body[0], "textord");
        d = To[Number(b.text)];
      }
    } else
      g = pe(g, "textord"), d = To[Number(g.text)];
    return {
      type: "genfrac",
      mode: t.mode,
      numer: n,
      denom: a,
      continued: !1,
      hasBarLine: h,
      barSize: m,
      leftDelim: s,
      rightDelim: o,
      size: d
    };
  },
  htmlBuilder: ql,
  mathmlBuilder: Ll
});
Y({
  type: "infix",
  names: ["\\above"],
  props: {
    numArgs: 1,
    argTypes: ["size"],
    infix: !0
  },
  handler(r, e) {
    var {
      parser: t,
      funcName: n,
      token: a
    } = r;
    return {
      type: "infix",
      mode: t.mode,
      replaceWith: "\\\\abovefrac",
      size: pe(e[0], "size").value,
      token: a
    };
  }
});
Y({
  type: "genfrac",
  names: ["\\\\abovefrac"],
  props: {
    numArgs: 3,
    argTypes: ["math", "size", "math"]
  },
  handler: (r, e) => {
    var {
      parser: t,
      funcName: n
    } = r, a = e[0], i = $f(pe(e[1], "infix").size), s = e[2], l = i.number > 0;
    return {
      type: "genfrac",
      mode: t.mode,
      numer: a,
      denom: s,
      continued: !1,
      hasBarLine: l,
      barSize: i,
      leftDelim: null,
      rightDelim: null,
      size: "auto"
    };
  },
  htmlBuilder: ql,
  mathmlBuilder: Ll
});
var $c = (r, e) => {
  var t = e.style, n, a;
  r.type === "supsub" ? (n = r.sup ? xe(r.sup, e.havingStyle(t.sup()), e) : xe(r.sub, e.havingStyle(t.sub()), e), a = pe(r.base, "horizBrace")) : a = pe(r, "horizBrace");
  var i = xe(a.base, e.havingBaseStyle(le.DISPLAY)), s = g0.svgSpan(a, e), l;
  if (a.isOver ? (l = F.makeVList({
    positionType: "firstBaseline",
    children: [{
      type: "elem",
      elem: i
    }, {
      type: "kern",
      size: 0.1
    }, {
      type: "elem",
      elem: s
    }]
  }, e), l.children[0].children[0].children[1].classes.push("svg-align")) : (l = F.makeVList({
    positionType: "bottom",
    positionData: i.depth + 0.1 + s.height,
    children: [{
      type: "elem",
      elem: s
    }, {
      type: "kern",
      size: 0.1
    }, {
      type: "elem",
      elem: i
    }]
  }, e), l.children[0].children[0].children[0].classes.push("svg-align")), n) {
    var o = F.makeSpan(["mord", a.isOver ? "mover" : "munder"], [l], e);
    a.isOver ? l = F.makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: o
      }, {
        type: "kern",
        size: 0.2
      }, {
        type: "elem",
        elem: n
      }]
    }, e) : l = F.makeVList({
      positionType: "bottom",
      positionData: o.depth + 0.2 + n.height + n.depth,
      children: [{
        type: "elem",
        elem: n
      }, {
        type: "kern",
        size: 0.2
      }, {
        type: "elem",
        elem: o
      }]
    }, e);
  }
  return F.makeSpan(["mord", a.isOver ? "mover" : "munder"], [l], e);
}, Jd = (r, e) => {
  var t = g0.mathMLnode(r.label);
  return new P.MathNode(r.isOver ? "mover" : "munder", [Le(r.base, e), t]);
};
Y({
  type: "horizBrace",
  names: ["\\overbrace", "\\underbrace"],
  props: {
    numArgs: 1
  },
  handler(r, e) {
    var {
      parser: t,
      funcName: n
    } = r;
    return {
      type: "horizBrace",
      mode: t.mode,
      label: n,
      isOver: /^\\over/.test(n),
      base: e[0]
    };
  },
  htmlBuilder: $c,
  mathmlBuilder: Jd
});
Y({
  type: "href",
  names: ["\\href"],
  props: {
    numArgs: 2,
    argTypes: ["url", "original"],
    allowedInText: !0
  },
  handler: (r, e) => {
    var {
      parser: t
    } = r, n = e[1], a = pe(e[0], "url").url;
    return t.settings.isTrusted({
      command: "\\href",
      url: a
    }) ? {
      type: "href",
      mode: t.mode,
      href: a,
      body: it(n)
    } : t.formatUnsupportedCmd("\\href");
  },
  htmlBuilder: (r, e) => {
    var t = _t(r.body, e, !1);
    return F.makeAnchor(r.href, [], t, e);
  },
  mathmlBuilder: (r, e) => {
    var t = q0(r.body, e);
    return t instanceof sn || (t = new sn("mrow", [t])), t.setAttribute("href", r.href), t;
  }
});
Y({
  type: "href",
  names: ["\\url"],
  props: {
    numArgs: 1,
    argTypes: ["url"],
    allowedInText: !0
  },
  handler: (r, e) => {
    var {
      parser: t
    } = r, n = pe(e[0], "url").url;
    if (!t.settings.isTrusted({
      command: "\\url",
      url: n
    }))
      return t.formatUnsupportedCmd("\\url");
    for (var a = [], i = 0; i < n.length; i++) {
      var s = n[i];
      s === "~" && (s = "\\textasciitilde"), a.push({
        type: "textord",
        mode: "text",
        text: s
      });
    }
    var l = {
      type: "text",
      mode: t.mode,
      font: "\\texttt",
      body: a
    };
    return {
      type: "href",
      mode: t.mode,
      href: n,
      body: it(l)
    };
  }
});
Y({
  type: "hbox",
  names: ["\\hbox"],
  props: {
    numArgs: 1,
    argTypes: ["text"],
    allowedInText: !0,
    primitive: !0
  },
  handler(r, e) {
    var {
      parser: t
    } = r;
    return {
      type: "hbox",
      mode: t.mode,
      body: it(e[0])
    };
  },
  htmlBuilder(r, e) {
    var t = _t(r.body, e, !1);
    return F.makeFragment(t);
  },
  mathmlBuilder(r, e) {
    return new P.MathNode("mrow", Yt(r.body, e));
  }
});
Y({
  type: "html",
  names: ["\\htmlClass", "\\htmlId", "\\htmlStyle", "\\htmlData"],
  props: {
    numArgs: 2,
    argTypes: ["raw", "original"],
    allowedInText: !0
  },
  handler: (r, e) => {
    var {
      parser: t,
      funcName: n,
      token: a
    } = r, i = pe(e[0], "raw").string, s = e[1];
    t.settings.strict && t.settings.reportNonstrict("htmlExtension", "HTML extension is disabled on strict mode");
    var l, o = {};
    switch (n) {
      case "\\htmlClass":
        o.class = i, l = {
          command: "\\htmlClass",
          class: i
        };
        break;
      case "\\htmlId":
        o.id = i, l = {
          command: "\\htmlId",
          id: i
        };
        break;
      case "\\htmlStyle":
        o.style = i, l = {
          command: "\\htmlStyle",
          style: i
        };
        break;
      case "\\htmlData": {
        for (var u = i.split(","), h = 0; h < u.length; h++) {
          var m = u[h].split("=");
          if (m.length !== 2)
            throw new U("Error parsing key-value for \\htmlData");
          o["data-" + m[0].trim()] = m[1].trim();
        }
        l = {
          command: "\\htmlData",
          attributes: o
        };
        break;
      }
      default:
        throw new Error("Unrecognized html command");
    }
    return t.settings.isTrusted(l) ? {
      type: "html",
      mode: t.mode,
      attributes: o,
      body: it(s)
    } : t.formatUnsupportedCmd(n);
  },
  htmlBuilder: (r, e) => {
    var t = _t(r.body, e, !1), n = ["enclosing"];
    r.attributes.class && n.push(...r.attributes.class.trim().split(/\s+/));
    var a = F.makeSpan(n, t, e);
    for (var i in r.attributes)
      i !== "class" && r.attributes.hasOwnProperty(i) && a.setAttribute(i, r.attributes[i]);
    return a;
  },
  mathmlBuilder: (r, e) => q0(r.body, e)
});
Y({
  type: "htmlmathml",
  names: ["\\html@mathml"],
  props: {
    numArgs: 2,
    allowedInText: !0
  },
  handler: (r, e) => {
    var {
      parser: t
    } = r;
    return {
      type: "htmlmathml",
      mode: t.mode,
      html: it(e[0]),
      mathml: it(e[1])
    };
  },
  htmlBuilder: (r, e) => {
    var t = _t(r.html, e, !1);
    return F.makeFragment(t);
  },
  mathmlBuilder: (r, e) => q0(r.mathml, e)
});
var us = function(e) {
  if (/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))
    return {
      number: +e,
      unit: "bp"
    };
  var t = /([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);
  if (!t)
    throw new U("Invalid size: '" + e + "' in \\includegraphics");
  var n = {
    number: +(t[1] + t[2]),
    // sign + magnitude, cast to number
    unit: t[3]
  };
  if (!K1(n))
    throw new U("Invalid unit: '" + n.unit + "' in \\includegraphics.");
  return n;
};
Y({
  type: "includegraphics",
  names: ["\\includegraphics"],
  props: {
    numArgs: 1,
    numOptionalArgs: 1,
    argTypes: ["raw", "url"],
    allowedInText: !1
  },
  handler: (r, e, t) => {
    var {
      parser: n
    } = r, a = {
      number: 0,
      unit: "em"
    }, i = {
      number: 0.9,
      unit: "em"
    }, s = {
      number: 0,
      unit: "em"
    }, l = "";
    if (t[0])
      for (var o = pe(t[0], "raw").string, u = o.split(","), h = 0; h < u.length; h++) {
        var m = u[h].split("=");
        if (m.length === 2) {
          var d = m[1].trim();
          switch (m[0].trim()) {
            case "alt":
              l = d;
              break;
            case "width":
              a = us(d);
              break;
            case "height":
              i = us(d);
              break;
            case "totalheight":
              s = us(d);
              break;
            default:
              throw new U("Invalid key: '" + m[0] + "' in \\includegraphics.");
          }
        }
      }
    var g = pe(e[0], "url").url;
    return l === "" && (l = g, l = l.replace(/^.*[\\/]/, ""), l = l.substring(0, l.lastIndexOf("."))), n.settings.isTrusted({
      command: "\\includegraphics",
      url: g
    }) ? {
      type: "includegraphics",
      mode: n.mode,
      alt: l,
      width: a,
      height: i,
      totalheight: s,
      src: g
    } : n.formatUnsupportedCmd("\\includegraphics");
  },
  htmlBuilder: (r, e) => {
    var t = We(r.height, e), n = 0;
    r.totalheight.number > 0 && (n = We(r.totalheight, e) - t);
    var a = 0;
    r.width.number > 0 && (a = We(r.width, e));
    var i = {
      height: W(t + n)
    };
    a > 0 && (i.width = W(a)), n > 0 && (i.verticalAlign = W(-n));
    var s = new Jf(r.src, r.alt, i);
    return s.height = t, s.depth = n, s;
  },
  mathmlBuilder: (r, e) => {
    var t = new P.MathNode("mglyph", []);
    t.setAttribute("alt", r.alt);
    var n = We(r.height, e), a = 0;
    if (r.totalheight.number > 0 && (a = We(r.totalheight, e) - n, t.setAttribute("valign", W(-a))), t.setAttribute("height", W(n + a)), r.width.number > 0) {
      var i = We(r.width, e);
      t.setAttribute("width", W(i));
    }
    return t.setAttribute("src", r.src), t;
  }
});
Y({
  type: "kern",
  names: ["\\kern", "\\mkern", "\\hskip", "\\mskip"],
  props: {
    numArgs: 1,
    argTypes: ["size"],
    primitive: !0,
    allowedInText: !0
  },
  handler(r, e) {
    var {
      parser: t,
      funcName: n
    } = r, a = pe(e[0], "size");
    if (t.settings.strict) {
      var i = n[1] === "m", s = a.value.unit === "mu";
      i ? (s || t.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + n + " supports only mu units, " + ("not " + a.value.unit + " units")), t.mode !== "math" && t.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + n + " works only in math mode")) : s && t.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + n + " doesn't support mu units");
    }
    return {
      type: "kern",
      mode: t.mode,
      dimension: a.value
    };
  },
  htmlBuilder(r, e) {
    return F.makeGlue(r.dimension, e);
  },
  mathmlBuilder(r, e) {
    var t = We(r.dimension, e);
    return new P.SpaceNode(t);
  }
});
Y({
  type: "lap",
  names: ["\\mathllap", "\\mathrlap", "\\mathclap"],
  props: {
    numArgs: 1,
    allowedInText: !0
  },
  handler: (r, e) => {
    var {
      parser: t,
      funcName: n
    } = r, a = e[0];
    return {
      type: "lap",
      mode: t.mode,
      alignment: n.slice(5),
      body: a
    };
  },
  htmlBuilder: (r, e) => {
    var t;
    r.alignment === "clap" ? (t = F.makeSpan([], [xe(r.body, e)]), t = F.makeSpan(["inner"], [t], e)) : t = F.makeSpan(["inner"], [xe(r.body, e)]);
    var n = F.makeSpan(["fix"], []), a = F.makeSpan([r.alignment], [t, n], e), i = F.makeSpan(["strut"]);
    return i.style.height = W(a.height + a.depth), a.depth && (i.style.verticalAlign = W(-a.depth)), a.children.unshift(i), a = F.makeSpan(["thinbox"], [a], e), F.makeSpan(["mord", "vbox"], [a], e);
  },
  mathmlBuilder: (r, e) => {
    var t = new P.MathNode("mpadded", [Le(r.body, e)]);
    if (r.alignment !== "rlap") {
      var n = r.alignment === "llap" ? "-1" : "-0.5";
      t.setAttribute("lspace", n + "width");
    }
    return t.setAttribute("width", "0px"), t;
  }
});
Y({
  type: "styling",
  names: ["\\(", "$"],
  props: {
    numArgs: 0,
    allowedInText: !0,
    allowedInMath: !1
  },
  handler(r, e) {
    var {
      funcName: t,
      parser: n
    } = r, a = n.mode;
    n.switchMode("math");
    var i = t === "\\(" ? "\\)" : "$", s = n.parseExpression(!1, i);
    return n.expect(i), n.switchMode(a), {
      type: "styling",
      mode: n.mode,
      style: "text",
      body: s
    };
  }
});
Y({
  type: "text",
  // Doesn't matter what this is.
  names: ["\\)", "\\]"],
  props: {
    numArgs: 0,
    allowedInText: !0,
    allowedInMath: !1
  },
  handler(r, e) {
    throw new U("Mismatched " + r.funcName);
  }
});
var Mo = (r, e) => {
  switch (e.style.size) {
    case le.DISPLAY.size:
      return r.display;
    case le.TEXT.size:
      return r.text;
    case le.SCRIPT.size:
      return r.script;
    case le.SCRIPTSCRIPT.size:
      return r.scriptscript;
    default:
      return r.text;
  }
};
Y({
  type: "mathchoice",
  names: ["\\mathchoice"],
  props: {
    numArgs: 4,
    primitive: !0
  },
  handler: (r, e) => {
    var {
      parser: t
    } = r;
    return {
      type: "mathchoice",
      mode: t.mode,
      display: it(e[0]),
      text: it(e[1]),
      script: it(e[2]),
      scriptscript: it(e[3])
    };
  },
  htmlBuilder: (r, e) => {
    var t = Mo(r, e), n = _t(t, e, !1);
    return F.makeFragment(n);
  },
  mathmlBuilder: (r, e) => {
    var t = Mo(r, e);
    return q0(t, e);
  }
});
var Tc = (r, e, t, n, a, i, s) => {
  r = F.makeSpan([], [r]);
  var l = t && ae.isCharacterBox(t), o, u;
  if (e) {
    var h = xe(e, n.havingStyle(a.sup()), n);
    u = {
      elem: h,
      kern: Math.max(n.fontMetrics().bigOpSpacing1, n.fontMetrics().bigOpSpacing3 - h.depth)
    };
  }
  if (t) {
    var m = xe(t, n.havingStyle(a.sub()), n);
    o = {
      elem: m,
      kern: Math.max(n.fontMetrics().bigOpSpacing2, n.fontMetrics().bigOpSpacing4 - m.height)
    };
  }
  var d;
  if (u && o) {
    var g = n.fontMetrics().bigOpSpacing5 + o.elem.height + o.elem.depth + o.kern + r.depth + s;
    d = F.makeVList({
      positionType: "bottom",
      positionData: g,
      children: [{
        type: "kern",
        size: n.fontMetrics().bigOpSpacing5
      }, {
        type: "elem",
        elem: o.elem,
        marginLeft: W(-i)
      }, {
        type: "kern",
        size: o.kern
      }, {
        type: "elem",
        elem: r
      }, {
        type: "kern",
        size: u.kern
      }, {
        type: "elem",
        elem: u.elem,
        marginLeft: W(i)
      }, {
        type: "kern",
        size: n.fontMetrics().bigOpSpacing5
      }]
    }, n);
  } else if (o) {
    var b = r.height - s;
    d = F.makeVList({
      positionType: "top",
      positionData: b,
      children: [{
        type: "kern",
        size: n.fontMetrics().bigOpSpacing5
      }, {
        type: "elem",
        elem: o.elem,
        marginLeft: W(-i)
      }, {
        type: "kern",
        size: o.kern
      }, {
        type: "elem",
        elem: r
      }]
    }, n);
  } else if (u) {
    var v = r.depth + s;
    d = F.makeVList({
      positionType: "bottom",
      positionData: v,
      children: [{
        type: "elem",
        elem: r
      }, {
        type: "kern",
        size: u.kern
      }, {
        type: "elem",
        elem: u.elem,
        marginLeft: W(i)
      }, {
        type: "kern",
        size: n.fontMetrics().bigOpSpacing5
      }]
    }, n);
  } else
    return r;
  var w = [d];
  if (o && i !== 0 && !l) {
    var x = F.makeSpan(["mspace"], [], n);
    x.style.marginRight = W(i), w.unshift(x);
  }
  return F.makeSpan(["mop", "op-limits"], w, n);
}, Fc = ["\\smallint"], Ar = (r, e) => {
  var t, n, a = !1, i;
  r.type === "supsub" ? (t = r.sup, n = r.sub, i = pe(r.base, "op"), a = !0) : i = pe(r, "op");
  var s = e.style, l = !1;
  s.size === le.DISPLAY.size && i.symbol && !ae.contains(Fc, i.name) && (l = !0);
  var o;
  if (i.symbol) {
    var u = l ? "Size2-Regular" : "Size1-Regular", h = "";
    if ((i.name === "\\oiint" || i.name === "\\oiiint") && (h = i.name.slice(1), i.name = h === "oiint" ? "\\iint" : "\\iiint"), o = F.makeSymbol(i.name, u, "math", e, ["mop", "op-symbol", l ? "large-op" : "small-op"]), h.length > 0) {
      var m = o.italic, d = F.staticSvg(h + "Size" + (l ? "2" : "1"), e);
      o = F.makeVList({
        positionType: "individualShift",
        children: [{
          type: "elem",
          elem: o,
          shift: 0
        }, {
          type: "elem",
          elem: d,
          shift: l ? 0.08 : 0
        }]
      }, e), i.name = "\\" + h, o.classes.unshift("mop"), o.italic = m;
    }
  } else if (i.body) {
    var g = _t(i.body, e, !0);
    g.length === 1 && g[0] instanceof wn ? (o = g[0], o.classes[0] = "mop") : o = F.makeSpan(["mop"], g, e);
  } else {
    for (var b = [], v = 1; v < i.name.length; v++)
      b.push(F.mathsym(i.name[v], i.mode, e));
    o = F.makeSpan(["mop"], b, e);
  }
  var w = 0, x = 0;
  return (o instanceof wn || i.name === "\\oiint" || i.name === "\\oiiint") && !i.suppressBaseShift && (w = (o.height - o.depth) / 2 - e.fontMetrics().axisHeight, x = o.italic), a ? Tc(o, t, n, e, s, x, w) : (w && (o.style.position = "relative", o.style.top = W(w)), o);
}, da = (r, e) => {
  var t;
  if (r.symbol)
    t = new sn("mo", [kn(r.name, r.mode)]), ae.contains(Fc, r.name) && t.setAttribute("largeop", "false");
  else if (r.body)
    t = new sn("mo", Yt(r.body, e));
  else {
    t = new sn("mi", [new Un(r.name.slice(1))]);
    var n = new sn("mo", [kn("⁡", "text")]);
    r.parentIsSupSub ? t = new sn("mrow", [t, n]) : t = ic([t, n]);
  }
  return t;
}, em = {
  "∏": "\\prod",
  "∐": "\\coprod",
  "∑": "\\sum",
  "⋀": "\\bigwedge",
  "⋁": "\\bigvee",
  "⋂": "\\bigcap",
  "⋃": "\\bigcup",
  "⨀": "\\bigodot",
  "⨁": "\\bigoplus",
  "⨂": "\\bigotimes",
  "⨄": "\\biguplus",
  "⨆": "\\bigsqcup"
};
Y({
  type: "op",
  names: ["\\coprod", "\\bigvee", "\\bigwedge", "\\biguplus", "\\bigcap", "\\bigcup", "\\intop", "\\prod", "\\sum", "\\bigotimes", "\\bigoplus", "\\bigodot", "\\bigsqcup", "\\smallint", "∏", "∐", "∑", "⋀", "⋁", "⋂", "⋃", "⨀", "⨁", "⨂", "⨄", "⨆"],
  props: {
    numArgs: 0
  },
  handler: (r, e) => {
    var {
      parser: t,
      funcName: n
    } = r, a = n;
    return a.length === 1 && (a = em[a]), {
      type: "op",
      mode: t.mode,
      limits: !0,
      parentIsSupSub: !1,
      symbol: !0,
      name: a
    };
  },
  htmlBuilder: Ar,
  mathmlBuilder: da
});
Y({
  type: "op",
  names: ["\\mathop"],
  props: {
    numArgs: 1,
    primitive: !0
  },
  handler: (r, e) => {
    var {
      parser: t
    } = r, n = e[0];
    return {
      type: "op",
      mode: t.mode,
      limits: !1,
      parentIsSupSub: !1,
      symbol: !1,
      body: it(n)
    };
  },
  htmlBuilder: Ar,
  mathmlBuilder: da
});
var tm = {
  "∫": "\\int",
  "∬": "\\iint",
  "∭": "\\iiint",
  "∮": "\\oint",
  "∯": "\\oiint",
  "∰": "\\oiiint"
};
Y({
  type: "op",
  names: ["\\arcsin", "\\arccos", "\\arctan", "\\arctg", "\\arcctg", "\\arg", "\\ch", "\\cos", "\\cosec", "\\cosh", "\\cot", "\\cotg", "\\coth", "\\csc", "\\ctg", "\\cth", "\\deg", "\\dim", "\\exp", "\\hom", "\\ker", "\\lg", "\\ln", "\\log", "\\sec", "\\sin", "\\sinh", "\\sh", "\\tan", "\\tanh", "\\tg", "\\th"],
  props: {
    numArgs: 0
  },
  handler(r) {
    var {
      parser: e,
      funcName: t
    } = r;
    return {
      type: "op",
      mode: e.mode,
      limits: !1,
      parentIsSupSub: !1,
      symbol: !1,
      name: t
    };
  },
  htmlBuilder: Ar,
  mathmlBuilder: da
});
Y({
  type: "op",
  names: ["\\det", "\\gcd", "\\inf", "\\lim", "\\max", "\\min", "\\Pr", "\\sup"],
  props: {
    numArgs: 0
  },
  handler(r) {
    var {
      parser: e,
      funcName: t
    } = r;
    return {
      type: "op",
      mode: e.mode,
      limits: !0,
      parentIsSupSub: !1,
      symbol: !1,
      name: t
    };
  },
  htmlBuilder: Ar,
  mathmlBuilder: da
});
Y({
  type: "op",
  names: ["\\int", "\\iint", "\\iiint", "\\oint", "\\oiint", "\\oiiint", "∫", "∬", "∭", "∮", "∯", "∰"],
  props: {
    numArgs: 0
  },
  handler(r) {
    var {
      parser: e,
      funcName: t
    } = r, n = t;
    return n.length === 1 && (n = tm[n]), {
      type: "op",
      mode: e.mode,
      limits: !1,
      parentIsSupSub: !1,
      symbol: !0,
      name: n
    };
  },
  htmlBuilder: Ar,
  mathmlBuilder: da
});
var Mc = (r, e) => {
  var t, n, a = !1, i;
  r.type === "supsub" ? (t = r.sup, n = r.sub, i = pe(r.base, "operatorname"), a = !0) : i = pe(r, "operatorname");
  var s;
  if (i.body.length > 0) {
    for (var l = i.body.map((m) => {
      var d = m.text;
      return typeof d == "string" ? {
        type: "textord",
        mode: m.mode,
        text: d
      } : m;
    }), o = _t(l, e.withFont("mathrm"), !0), u = 0; u < o.length; u++) {
      var h = o[u];
      h instanceof wn && (h.text = h.text.replace(/\u2212/, "-").replace(/\u2217/, "*"));
    }
    s = F.makeSpan(["mop"], o, e);
  } else
    s = F.makeSpan(["mop"], [], e);
  return a ? Tc(s, t, n, e, e.style, 0, 0) : s;
}, nm = (r, e) => {
  for (var t = Yt(r.body, e.withFont("mathrm")), n = !0, a = 0; a < t.length; a++) {
    var i = t[a];
    if (!(i instanceof P.SpaceNode)) if (i instanceof P.MathNode)
      switch (i.type) {
        case "mi":
        case "mn":
        case "ms":
        case "mspace":
        case "mtext":
          break;
        case "mo": {
          var s = i.children[0];
          i.children.length === 1 && s instanceof P.TextNode ? s.text = s.text.replace(/\u2212/, "-").replace(/\u2217/, "*") : n = !1;
          break;
        }
        default:
          n = !1;
      }
    else
      n = !1;
  }
  if (n) {
    var l = t.map((h) => h.toText()).join("");
    t = [new P.TextNode(l)];
  }
  var o = new P.MathNode("mi", t);
  o.setAttribute("mathvariant", "normal");
  var u = new P.MathNode("mo", [kn("⁡", "text")]);
  return r.parentIsSupSub ? new P.MathNode("mrow", [o, u]) : P.newDocumentFragment([o, u]);
};
Y({
  type: "operatorname",
  names: ["\\operatorname@", "\\operatornamewithlimits"],
  props: {
    numArgs: 1
  },
  handler: (r, e) => {
    var {
      parser: t,
      funcName: n
    } = r, a = e[0];
    return {
      type: "operatorname",
      mode: t.mode,
      body: it(a),
      alwaysHandleSupSub: n === "\\operatornamewithlimits",
      limits: !1,
      parentIsSupSub: !1
    };
  },
  htmlBuilder: Mc,
  mathmlBuilder: nm
});
_("\\operatorname", "\\@ifstar\\operatornamewithlimits\\operatorname@");
tr({
  type: "ordgroup",
  htmlBuilder(r, e) {
    return r.semisimple ? F.makeFragment(_t(r.body, e, !1)) : F.makeSpan(["mord"], _t(r.body, e, !0), e);
  },
  mathmlBuilder(r, e) {
    return q0(r.body, e, !0);
  }
});
Y({
  type: "overline",
  names: ["\\overline"],
  props: {
    numArgs: 1
  },
  handler(r, e) {
    var {
      parser: t
    } = r, n = e[0];
    return {
      type: "overline",
      mode: t.mode,
      body: n
    };
  },
  htmlBuilder(r, e) {
    var t = xe(r.body, e.havingCrampedStyle()), n = F.makeLineSpan("overline-line", e), a = e.fontMetrics().defaultRuleThickness, i = F.makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: t
      }, {
        type: "kern",
        size: 3 * a
      }, {
        type: "elem",
        elem: n
      }, {
        type: "kern",
        size: a
      }]
    }, e);
    return F.makeSpan(["mord", "overline"], [i], e);
  },
  mathmlBuilder(r, e) {
    var t = new P.MathNode("mo", [new P.TextNode("‾")]);
    t.setAttribute("stretchy", "true");
    var n = new P.MathNode("mover", [Le(r.body, e), t]);
    return n.setAttribute("accent", "true"), n;
  }
});
Y({
  type: "phantom",
  names: ["\\phantom"],
  props: {
    numArgs: 1,
    allowedInText: !0
  },
  handler: (r, e) => {
    var {
      parser: t
    } = r, n = e[0];
    return {
      type: "phantom",
      mode: t.mode,
      body: it(n)
    };
  },
  htmlBuilder: (r, e) => {
    var t = _t(r.body, e.withPhantom(), !1);
    return F.makeFragment(t);
  },
  mathmlBuilder: (r, e) => {
    var t = Yt(r.body, e);
    return new P.MathNode("mphantom", t);
  }
});
Y({
  type: "hphantom",
  names: ["\\hphantom"],
  props: {
    numArgs: 1,
    allowedInText: !0
  },
  handler: (r, e) => {
    var {
      parser: t
    } = r, n = e[0];
    return {
      type: "hphantom",
      mode: t.mode,
      body: n
    };
  },
  htmlBuilder: (r, e) => {
    var t = F.makeSpan([], [xe(r.body, e.withPhantom())]);
    if (t.height = 0, t.depth = 0, t.children)
      for (var n = 0; n < t.children.length; n++)
        t.children[n].height = 0, t.children[n].depth = 0;
    return t = F.makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: t
      }]
    }, e), F.makeSpan(["mord"], [t], e);
  },
  mathmlBuilder: (r, e) => {
    var t = Yt(it(r.body), e), n = new P.MathNode("mphantom", t), a = new P.MathNode("mpadded", [n]);
    return a.setAttribute("height", "0px"), a.setAttribute("depth", "0px"), a;
  }
});
Y({
  type: "vphantom",
  names: ["\\vphantom"],
  props: {
    numArgs: 1,
    allowedInText: !0
  },
  handler: (r, e) => {
    var {
      parser: t
    } = r, n = e[0];
    return {
      type: "vphantom",
      mode: t.mode,
      body: n
    };
  },
  htmlBuilder: (r, e) => {
    var t = F.makeSpan(["inner"], [xe(r.body, e.withPhantom())]), n = F.makeSpan(["fix"], []);
    return F.makeSpan(["mord", "rlap"], [t, n], e);
  },
  mathmlBuilder: (r, e) => {
    var t = Yt(it(r.body), e), n = new P.MathNode("mphantom", t), a = new P.MathNode("mpadded", [n]);
    return a.setAttribute("width", "0px"), a;
  }
});
Y({
  type: "raisebox",
  names: ["\\raisebox"],
  props: {
    numArgs: 2,
    argTypes: ["size", "hbox"],
    allowedInText: !0
  },
  handler(r, e) {
    var {
      parser: t
    } = r, n = pe(e[0], "size").value, a = e[1];
    return {
      type: "raisebox",
      mode: t.mode,
      dy: n,
      body: a
    };
  },
  htmlBuilder(r, e) {
    var t = xe(r.body, e), n = We(r.dy, e);
    return F.makeVList({
      positionType: "shift",
      positionData: -n,
      children: [{
        type: "elem",
        elem: t
      }]
    }, e);
  },
  mathmlBuilder(r, e) {
    var t = new P.MathNode("mpadded", [Le(r.body, e)]), n = r.dy.number + r.dy.unit;
    return t.setAttribute("voffset", n), t;
  }
});
Y({
  type: "internal",
  names: ["\\relax"],
  props: {
    numArgs: 0,
    allowedInText: !0,
    allowedInArgument: !0
  },
  handler(r) {
    var {
      parser: e
    } = r;
    return {
      type: "internal",
      mode: e.mode
    };
  }
});
Y({
  type: "rule",
  names: ["\\rule"],
  props: {
    numArgs: 2,
    numOptionalArgs: 1,
    allowedInText: !0,
    allowedInMath: !0,
    argTypes: ["size", "size", "size"]
  },
  handler(r, e, t) {
    var {
      parser: n
    } = r, a = t[0], i = pe(e[0], "size"), s = pe(e[1], "size");
    return {
      type: "rule",
      mode: n.mode,
      shift: a && pe(a, "size").value,
      width: i.value,
      height: s.value
    };
  },
  htmlBuilder(r, e) {
    var t = F.makeSpan(["mord", "rule"], [], e), n = We(r.width, e), a = We(r.height, e), i = r.shift ? We(r.shift, e) : 0;
    return t.style.borderRightWidth = W(n), t.style.borderTopWidth = W(a), t.style.bottom = W(i), t.width = n, t.height = a + i, t.depth = -i, t.maxFontSize = a * 1.125 * e.sizeMultiplier, t;
  },
  mathmlBuilder(r, e) {
    var t = We(r.width, e), n = We(r.height, e), a = r.shift ? We(r.shift, e) : 0, i = e.color && e.getColor() || "black", s = new P.MathNode("mspace");
    s.setAttribute("mathbackground", i), s.setAttribute("width", W(t)), s.setAttribute("height", W(n));
    var l = new P.MathNode("mpadded", [s]);
    return a >= 0 ? l.setAttribute("height", W(a)) : (l.setAttribute("height", W(a)), l.setAttribute("depth", W(-a))), l.setAttribute("voffset", W(a)), l;
  }
});
function zc(r, e, t) {
  for (var n = _t(r, e, !1), a = e.sizeMultiplier / t.sizeMultiplier, i = 0; i < n.length; i++) {
    var s = n[i].classes.indexOf("sizing");
    s < 0 ? Array.prototype.push.apply(n[i].classes, e.sizingClasses(t)) : n[i].classes[s + 1] === "reset-size" + e.size && (n[i].classes[s + 1] = "reset-size" + t.size), n[i].height *= a, n[i].depth *= a;
  }
  return F.makeFragment(n);
}
var zo = ["\\tiny", "\\sixptsize", "\\scriptsize", "\\footnotesize", "\\small", "\\normalsize", "\\large", "\\Large", "\\LARGE", "\\huge", "\\Huge"], rm = (r, e) => {
  var t = e.havingSize(r.size);
  return zc(r.body, t, e);
};
Y({
  type: "sizing",
  names: zo,
  props: {
    numArgs: 0,
    allowedInText: !0
  },
  handler: (r, e) => {
    var {
      breakOnTokenText: t,
      funcName: n,
      parser: a
    } = r, i = a.parseExpression(!1, t);
    return {
      type: "sizing",
      mode: a.mode,
      // Figure out what size to use based on the list of functions above
      size: zo.indexOf(n) + 1,
      body: i
    };
  },
  htmlBuilder: rm,
  mathmlBuilder: (r, e) => {
    var t = e.havingSize(r.size), n = Yt(r.body, t), a = new P.MathNode("mstyle", n);
    return a.setAttribute("mathsize", W(t.sizeMultiplier)), a;
  }
});
Y({
  type: "smash",
  names: ["\\smash"],
  props: {
    numArgs: 1,
    numOptionalArgs: 1,
    allowedInText: !0
  },
  handler: (r, e, t) => {
    var {
      parser: n
    } = r, a = !1, i = !1, s = t[0] && pe(t[0], "ordgroup");
    if (s)
      for (var l = "", o = 0; o < s.body.length; ++o) {
        var u = s.body[o];
        if (l = u.text, l === "t")
          a = !0;
        else if (l === "b")
          i = !0;
        else {
          a = !1, i = !1;
          break;
        }
      }
    else
      a = !0, i = !0;
    var h = e[0];
    return {
      type: "smash",
      mode: n.mode,
      body: h,
      smashHeight: a,
      smashDepth: i
    };
  },
  htmlBuilder: (r, e) => {
    var t = F.makeSpan([], [xe(r.body, e)]);
    if (!r.smashHeight && !r.smashDepth)
      return t;
    if (r.smashHeight && (t.height = 0, t.children))
      for (var n = 0; n < t.children.length; n++)
        t.children[n].height = 0;
    if (r.smashDepth && (t.depth = 0, t.children))
      for (var a = 0; a < t.children.length; a++)
        t.children[a].depth = 0;
    var i = F.makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: t
      }]
    }, e);
    return F.makeSpan(["mord"], [i], e);
  },
  mathmlBuilder: (r, e) => {
    var t = new P.MathNode("mpadded", [Le(r.body, e)]);
    return r.smashHeight && t.setAttribute("height", "0px"), r.smashDepth && t.setAttribute("depth", "0px"), t;
  }
});
Y({
  type: "sqrt",
  names: ["\\sqrt"],
  props: {
    numArgs: 1,
    numOptionalArgs: 1
  },
  handler(r, e, t) {
    var {
      parser: n
    } = r, a = t[0], i = e[0];
    return {
      type: "sqrt",
      mode: n.mode,
      body: i,
      index: a
    };
  },
  htmlBuilder(r, e) {
    var t = xe(r.body, e.havingCrampedStyle());
    t.height === 0 && (t.height = e.fontMetrics().xHeight), t = F.wrapFragment(t, e);
    var n = e.fontMetrics(), a = n.defaultRuleThickness, i = a;
    e.style.id < le.TEXT.id && (i = e.fontMetrics().xHeight);
    var s = a + i / 4, l = t.height + t.depth + s + a, {
      span: o,
      ruleWidth: u,
      advanceWidth: h
    } = f0.sqrtImage(l, e), m = o.height - u;
    m > t.height + t.depth + s && (s = (s + m - t.height - t.depth) / 2);
    var d = o.height - t.height - s - u;
    t.style.paddingLeft = W(h);
    var g = F.makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: t,
        wrapperClasses: ["svg-align"]
      }, {
        type: "kern",
        size: -(t.height + d)
      }, {
        type: "elem",
        elem: o
      }, {
        type: "kern",
        size: u
      }]
    }, e);
    if (r.index) {
      var b = e.havingStyle(le.SCRIPTSCRIPT), v = xe(r.index, b, e), w = 0.6 * (g.height - g.depth), x = F.makeVList({
        positionType: "shift",
        positionData: -w,
        children: [{
          type: "elem",
          elem: v
        }]
      }, e), k = F.makeSpan(["root"], [x]);
      return F.makeSpan(["mord", "sqrt"], [k, g], e);
    } else
      return F.makeSpan(["mord", "sqrt"], [g], e);
  },
  mathmlBuilder(r, e) {
    var {
      body: t,
      index: n
    } = r;
    return n ? new P.MathNode("mroot", [Le(t, e), Le(n, e)]) : new P.MathNode("msqrt", [Le(t, e)]);
  }
});
var Bo = {
  display: le.DISPLAY,
  text: le.TEXT,
  script: le.SCRIPT,
  scriptscript: le.SCRIPTSCRIPT
};
Y({
  type: "styling",
  names: ["\\displaystyle", "\\textstyle", "\\scriptstyle", "\\scriptscriptstyle"],
  props: {
    numArgs: 0,
    allowedInText: !0,
    primitive: !0
  },
  handler(r, e) {
    var {
      breakOnTokenText: t,
      funcName: n,
      parser: a
    } = r, i = a.parseExpression(!0, t), s = n.slice(1, n.length - 5);
    return {
      type: "styling",
      mode: a.mode,
      // Figure out what style to use by pulling out the style from
      // the function name
      style: s,
      body: i
    };
  },
  htmlBuilder(r, e) {
    var t = Bo[r.style], n = e.havingStyle(t).withFont("");
    return zc(r.body, n, e);
  },
  mathmlBuilder(r, e) {
    var t = Bo[r.style], n = e.havingStyle(t), a = Yt(r.body, n), i = new P.MathNode("mstyle", a), s = {
      display: ["0", "true"],
      text: ["0", "false"],
      script: ["1", "false"],
      scriptscript: ["2", "false"]
    }, l = s[r.style];
    return i.setAttribute("scriptlevel", l[0]), i.setAttribute("displaystyle", l[1]), i;
  }
});
var am = function(e, t) {
  var n = e.base;
  if (n)
    if (n.type === "op") {
      var a = n.limits && (t.style.size === le.DISPLAY.size || n.alwaysHandleSupSub);
      return a ? Ar : null;
    } else if (n.type === "operatorname") {
      var i = n.alwaysHandleSupSub && (t.style.size === le.DISPLAY.size || n.limits);
      return i ? Mc : null;
    } else {
      if (n.type === "accent")
        return ae.isCharacterBox(n.base) ? Tl : null;
      if (n.type === "horizBrace") {
        var s = !e.sub;
        return s === n.isOver ? $c : null;
      } else
        return null;
    }
  else return null;
};
tr({
  type: "supsub",
  htmlBuilder(r, e) {
    var t = am(r, e);
    if (t)
      return t(r, e);
    var {
      base: n,
      sup: a,
      sub: i
    } = r, s = xe(n, e), l, o, u = e.fontMetrics(), h = 0, m = 0, d = n && ae.isCharacterBox(n);
    if (a) {
      var g = e.havingStyle(e.style.sup());
      l = xe(a, g, e), d || (h = s.height - g.fontMetrics().supDrop * g.sizeMultiplier / e.sizeMultiplier);
    }
    if (i) {
      var b = e.havingStyle(e.style.sub());
      o = xe(i, b, e), d || (m = s.depth + b.fontMetrics().subDrop * b.sizeMultiplier / e.sizeMultiplier);
    }
    var v;
    e.style === le.DISPLAY ? v = u.sup1 : e.style.cramped ? v = u.sup3 : v = u.sup2;
    var w = e.sizeMultiplier, x = W(0.5 / u.ptPerEm / w), k = null;
    if (o) {
      var y = r.base && r.base.type === "op" && r.base.name && (r.base.name === "\\oiint" || r.base.name === "\\oiiint");
      (s instanceof wn || y) && (k = W(-s.italic));
    }
    var A;
    if (l && o) {
      h = Math.max(h, v, l.depth + 0.25 * u.xHeight), m = Math.max(m, u.sub2);
      var $ = u.defaultRuleThickness, M = 4 * $;
      if (h - l.depth - (o.height - m) < M) {
        m = M - (h - l.depth) + o.height;
        var z = 0.8 * u.xHeight - (h - l.depth);
        z > 0 && (h += z, m -= z);
      }
      var O = [{
        type: "elem",
        elem: o,
        shift: m,
        marginRight: x,
        marginLeft: k
      }, {
        type: "elem",
        elem: l,
        shift: -h,
        marginRight: x
      }];
      A = F.makeVList({
        positionType: "individualShift",
        children: O
      }, e);
    } else if (o) {
      m = Math.max(m, u.sub1, o.height - 0.8 * u.xHeight);
      var L = [{
        type: "elem",
        elem: o,
        marginLeft: k,
        marginRight: x
      }];
      A = F.makeVList({
        positionType: "shift",
        positionData: m,
        children: L
      }, e);
    } else if (l)
      h = Math.max(h, v, l.depth + 0.25 * u.xHeight), A = F.makeVList({
        positionType: "shift",
        positionData: -h,
        children: [{
          type: "elem",
          elem: l,
          marginRight: x
        }]
      }, e);
    else
      throw new Error("supsub must have either sup or sub.");
    var K = el(s, "right") || "mord";
    return F.makeSpan([K], [s, F.makeSpan(["msupsub"], [A])], e);
  },
  mathmlBuilder(r, e) {
    var t = !1, n, a;
    r.base && r.base.type === "horizBrace" && (a = !!r.sup, a === r.base.isOver && (t = !0, n = r.base.isOver)), r.base && (r.base.type === "op" || r.base.type === "operatorname") && (r.base.parentIsSupSub = !0);
    var i = [Le(r.base, e)];
    r.sub && i.push(Le(r.sub, e)), r.sup && i.push(Le(r.sup, e));
    var s;
    if (t)
      s = n ? "mover" : "munder";
    else if (r.sub)
      if (r.sup) {
        var u = r.base;
        u && u.type === "op" && u.limits && e.style === le.DISPLAY || u && u.type === "operatorname" && u.alwaysHandleSupSub && (e.style === le.DISPLAY || u.limits) ? s = "munderover" : s = "msubsup";
      } else {
        var o = r.base;
        o && o.type === "op" && o.limits && (e.style === le.DISPLAY || o.alwaysHandleSupSub) || o && o.type === "operatorname" && o.alwaysHandleSupSub && (o.limits || e.style === le.DISPLAY) ? s = "munder" : s = "msub";
      }
    else {
      var l = r.base;
      l && l.type === "op" && l.limits && (e.style === le.DISPLAY || l.alwaysHandleSupSub) || l && l.type === "operatorname" && l.alwaysHandleSupSub && (l.limits || e.style === le.DISPLAY) ? s = "mover" : s = "msup";
    }
    return new P.MathNode(s, i);
  }
});
tr({
  type: "atom",
  htmlBuilder(r, e) {
    return F.mathsym(r.text, r.mode, e, ["m" + r.family]);
  },
  mathmlBuilder(r, e) {
    var t = new P.MathNode("mo", [kn(r.text, r.mode)]);
    if (r.family === "bin") {
      var n = Cl(r, e);
      n === "bold-italic" && t.setAttribute("mathvariant", n);
    } else r.family === "punct" ? t.setAttribute("separator", "true") : (r.family === "open" || r.family === "close") && t.setAttribute("stretchy", "false");
    return t;
  }
});
var Bc = {
  mi: "italic",
  mn: "normal",
  mtext: "normal"
};
tr({
  type: "mathord",
  htmlBuilder(r, e) {
    return F.makeOrd(r, e, "mathord");
  },
  mathmlBuilder(r, e) {
    var t = new P.MathNode("mi", [kn(r.text, r.mode, e)]), n = Cl(r, e) || "italic";
    return n !== Bc[t.type] && t.setAttribute("mathvariant", n), t;
  }
});
tr({
  type: "textord",
  htmlBuilder(r, e) {
    return F.makeOrd(r, e, "textord");
  },
  mathmlBuilder(r, e) {
    var t = kn(r.text, r.mode, e), n = Cl(r, e) || "normal", a;
    return r.mode === "text" ? a = new P.MathNode("mtext", [t]) : /[0-9]/.test(r.text) ? a = new P.MathNode("mn", [t]) : r.text === "\\prime" ? a = new P.MathNode("mo", [t]) : a = new P.MathNode("mi", [t]), n !== Bc[a.type] && a.setAttribute("mathvariant", n), a;
  }
});
var cs = {
  "\\nobreak": "nobreak",
  "\\allowbreak": "allowbreak"
}, hs = {
  " ": {},
  "\\ ": {},
  "~": {
    className: "nobreak"
  },
  "\\space": {},
  "\\nobreakspace": {
    className: "nobreak"
  }
};
tr({
  type: "spacing",
  htmlBuilder(r, e) {
    if (hs.hasOwnProperty(r.text)) {
      var t = hs[r.text].className || "";
      if (r.mode === "text") {
        var n = F.makeOrd(r, e, "textord");
        return n.classes.push(t), n;
      } else
        return F.makeSpan(["mspace", t], [F.mathsym(r.text, r.mode, e)], e);
    } else {
      if (cs.hasOwnProperty(r.text))
        return F.makeSpan(["mspace", cs[r.text]], [], e);
      throw new U('Unknown type of space "' + r.text + '"');
    }
  },
  mathmlBuilder(r, e) {
    var t;
    if (hs.hasOwnProperty(r.text))
      t = new P.MathNode("mtext", [new P.TextNode(" ")]);
    else {
      if (cs.hasOwnProperty(r.text))
        return new P.MathNode("mspace");
      throw new U('Unknown type of space "' + r.text + '"');
    }
    return t;
  }
});
var No = () => {
  var r = new P.MathNode("mtd", []);
  return r.setAttribute("width", "50%"), r;
};
tr({
  type: "tag",
  mathmlBuilder(r, e) {
    var t = new P.MathNode("mtable", [new P.MathNode("mtr", [No(), new P.MathNode("mtd", [q0(r.body, e)]), No(), new P.MathNode("mtd", [q0(r.tag, e)])])]);
    return t.setAttribute("width", "100%"), t;
  }
});
var qo = {
  "\\text": void 0,
  "\\textrm": "textrm",
  "\\textsf": "textsf",
  "\\texttt": "texttt",
  "\\textnormal": "textrm"
}, Lo = {
  "\\textbf": "textbf",
  "\\textmd": "textmd"
}, im = {
  "\\textit": "textit",
  "\\textup": "textup"
}, Io = (r, e) => {
  var t = r.font;
  if (t) {
    if (qo[t])
      return e.withTextFontFamily(qo[t]);
    if (Lo[t])
      return e.withTextFontWeight(Lo[t]);
    if (t === "\\emph")
      return e.fontShape === "textit" ? e.withTextFontShape("textup") : e.withTextFontShape("textit");
  } else return e;
  return e.withTextFontShape(im[t]);
};
Y({
  type: "text",
  names: [
    // Font families
    "\\text",
    "\\textrm",
    "\\textsf",
    "\\texttt",
    "\\textnormal",
    // Font weights
    "\\textbf",
    "\\textmd",
    // Font Shapes
    "\\textit",
    "\\textup",
    "\\emph"
  ],
  props: {
    numArgs: 1,
    argTypes: ["text"],
    allowedInArgument: !0,
    allowedInText: !0
  },
  handler(r, e) {
    var {
      parser: t,
      funcName: n
    } = r, a = e[0];
    return {
      type: "text",
      mode: t.mode,
      body: it(a),
      font: n
    };
  },
  htmlBuilder(r, e) {
    var t = Io(r, e), n = _t(r.body, t, !0);
    return F.makeSpan(["mord", "text"], n, t);
  },
  mathmlBuilder(r, e) {
    var t = Io(r, e);
    return q0(r.body, t);
  }
});
Y({
  type: "underline",
  names: ["\\underline"],
  props: {
    numArgs: 1,
    allowedInText: !0
  },
  handler(r, e) {
    var {
      parser: t
    } = r;
    return {
      type: "underline",
      mode: t.mode,
      body: e[0]
    };
  },
  htmlBuilder(r, e) {
    var t = xe(r.body, e), n = F.makeLineSpan("underline-line", e), a = e.fontMetrics().defaultRuleThickness, i = F.makeVList({
      positionType: "top",
      positionData: t.height,
      children: [{
        type: "kern",
        size: a
      }, {
        type: "elem",
        elem: n
      }, {
        type: "kern",
        size: 3 * a
      }, {
        type: "elem",
        elem: t
      }]
    }, e);
    return F.makeSpan(["mord", "underline"], [i], e);
  },
  mathmlBuilder(r, e) {
    var t = new P.MathNode("mo", [new P.TextNode("‾")]);
    t.setAttribute("stretchy", "true");
    var n = new P.MathNode("munder", [Le(r.body, e), t]);
    return n.setAttribute("accentunder", "true"), n;
  }
});
Y({
  type: "vcenter",
  names: ["\\vcenter"],
  props: {
    numArgs: 1,
    argTypes: ["original"],
    // In LaTeX, \vcenter can act only on a box.
    allowedInText: !1
  },
  handler(r, e) {
    var {
      parser: t
    } = r;
    return {
      type: "vcenter",
      mode: t.mode,
      body: e[0]
    };
  },
  htmlBuilder(r, e) {
    var t = xe(r.body, e), n = e.fontMetrics().axisHeight, a = 0.5 * (t.height - n - (t.depth + n));
    return F.makeVList({
      positionType: "shift",
      positionData: a,
      children: [{
        type: "elem",
        elem: t
      }]
    }, e);
  },
  mathmlBuilder(r, e) {
    return new P.MathNode("mpadded", [Le(r.body, e)], ["vcenter"]);
  }
});
Y({
  type: "verb",
  names: ["\\verb"],
  props: {
    numArgs: 0,
    allowedInText: !0
  },
  handler(r, e, t) {
    throw new U("\\verb ended by end of line instead of matching delimiter");
  },
  htmlBuilder(r, e) {
    for (var t = Ro(r), n = [], a = e.havingStyle(e.style.text()), i = 0; i < t.length; i++) {
      var s = t[i];
      s === "~" && (s = "\\textasciitilde"), n.push(F.makeSymbol(s, "Typewriter-Regular", r.mode, a, ["mord", "texttt"]));
    }
    return F.makeSpan(["mord", "text"].concat(a.sizingClasses(e)), F.tryCombineChars(n), a);
  },
  mathmlBuilder(r, e) {
    var t = new P.TextNode(Ro(r)), n = new P.MathNode("mtext", [t]);
    return n.setAttribute("mathvariant", "monospace"), n;
  }
});
var Ro = (r) => r.body.replace(/ /g, r.star ? "␣" : " "), M0 = rc, Nc = `[ \r
	]`, sm = "\\\\[a-zA-Z@]+", lm = "\\\\[^\uD800-\uDFFF]", om = "(" + sm + ")" + Nc + "*", um = `\\\\(
|[ \r	]+
?)[ \r	]*`, al = "[̀-ͯ]", cm = new RegExp(al + "+$"), hm = "(" + Nc + "+)|" + // whitespace
(um + "|") + // \whitespace
"([!-\\[\\]-‧‪-퟿豈-]" + // single codepoint
(al + "*") + // ...plus accents
"|[\uD800-\uDBFF][\uDC00-\uDFFF]" + // surrogate pair
(al + "*") + // ...plus accents
"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5" + // \verb unstarred
("|" + om) + // \macroName + spaces
("|" + lm + ")");
class Oo {
  // Category codes. The lexer only supports comment characters (14) for now.
  // MacroExpander additionally distinguishes active (13).
  constructor(e, t) {
    this.input = void 0, this.settings = void 0, this.tokenRegex = void 0, this.catcodes = void 0, this.input = e, this.settings = t, this.tokenRegex = new RegExp(hm, "g"), this.catcodes = {
      "%": 14,
      // comment character
      "~": 13
      // active character
    };
  }
  setCatcode(e, t) {
    this.catcodes[e] = t;
  }
  /**
   * This function lexes a single token.
   */
  lex() {
    var e = this.input, t = this.tokenRegex.lastIndex;
    if (t === e.length)
      return new yn("EOF", new rn(this, t, t));
    var n = this.tokenRegex.exec(e);
    if (n === null || n.index !== t)
      throw new U("Unexpected character: '" + e[t] + "'", new yn(e[t], new rn(this, t, t + 1)));
    var a = n[6] || n[3] || (n[2] ? "\\ " : " ");
    if (this.catcodes[a] === 14) {
      var i = e.indexOf(`
`, this.tokenRegex.lastIndex);
      return i === -1 ? (this.tokenRegex.lastIndex = e.length, this.settings.reportNonstrict("commentAtEnd", "% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")) : this.tokenRegex.lastIndex = i + 1, this.lex();
    }
    return new yn(a, new rn(this, t, this.tokenRegex.lastIndex));
  }
}
class fm {
  /**
   * Both arguments are optional.  The first argument is an object of
   * built-in mappings which never change.  The second argument is an object
   * of initial (global-level) mappings, which will constantly change
   * according to any global/top-level `set`s done.
   */
  constructor(e, t) {
    e === void 0 && (e = {}), t === void 0 && (t = {}), this.current = void 0, this.builtins = void 0, this.undefStack = void 0, this.current = t, this.builtins = e, this.undefStack = [];
  }
  /**
   * Start a new nested group, affecting future local `set`s.
   */
  beginGroup() {
    this.undefStack.push({});
  }
  /**
   * End current nested group, restoring values before the group began.
   */
  endGroup() {
    if (this.undefStack.length === 0)
      throw new U("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");
    var e = this.undefStack.pop();
    for (var t in e)
      e.hasOwnProperty(t) && (e[t] == null ? delete this.current[t] : this.current[t] = e[t]);
  }
  /**
   * Ends all currently nested groups (if any), restoring values before the
   * groups began.  Useful in case of an error in the middle of parsing.
   */
  endGroups() {
    for (; this.undefStack.length > 0; )
      this.endGroup();
  }
  /**
   * Detect whether `name` has a definition.  Equivalent to
   * `get(name) != null`.
   */
  has(e) {
    return this.current.hasOwnProperty(e) || this.builtins.hasOwnProperty(e);
  }
  /**
   * Get the current value of a name, or `undefined` if there is no value.
   *
   * Note: Do not use `if (namespace.get(...))` to detect whether a macro
   * is defined, as the definition may be the empty string which evaluates
   * to `false` in JavaScript.  Use `if (namespace.get(...) != null)` or
   * `if (namespace.has(...))`.
   */
  get(e) {
    return this.current.hasOwnProperty(e) ? this.current[e] : this.builtins[e];
  }
  /**
   * Set the current value of a name, and optionally set it globally too.
   * Local set() sets the current value and (when appropriate) adds an undo
   * operation to the undo stack.  Global set() may change the undo
   * operation at every level, so takes time linear in their number.
   * A value of undefined means to delete existing definitions.
   */
  set(e, t, n) {
    if (n === void 0 && (n = !1), n) {
      for (var a = 0; a < this.undefStack.length; a++)
        delete this.undefStack[a][e];
      this.undefStack.length > 0 && (this.undefStack[this.undefStack.length - 1][e] = t);
    } else {
      var i = this.undefStack[this.undefStack.length - 1];
      i && !i.hasOwnProperty(e) && (i[e] = this.current[e]);
    }
    t == null ? delete this.current[e] : this.current[e] = t;
  }
}
var dm = Dc;
_("\\noexpand", function(r) {
  var e = r.popToken();
  return r.isExpandable(e.text) && (e.noexpand = !0, e.treatAsRelax = !0), {
    tokens: [e],
    numArgs: 0
  };
});
_("\\expandafter", function(r) {
  var e = r.popToken();
  return r.expandOnce(!0), {
    tokens: [e],
    numArgs: 0
  };
});
_("\\@firstoftwo", function(r) {
  var e = r.consumeArgs(2);
  return {
    tokens: e[0],
    numArgs: 0
  };
});
_("\\@secondoftwo", function(r) {
  var e = r.consumeArgs(2);
  return {
    tokens: e[1],
    numArgs: 0
  };
});
_("\\@ifnextchar", function(r) {
  var e = r.consumeArgs(3);
  r.consumeSpaces();
  var t = r.future();
  return e[0].length === 1 && e[0][0].text === t.text ? {
    tokens: e[1],
    numArgs: 0
  } : {
    tokens: e[2],
    numArgs: 0
  };
});
_("\\@ifstar", "\\@ifnextchar *{\\@firstoftwo{#1}}");
_("\\TextOrMath", function(r) {
  var e = r.consumeArgs(2);
  return r.mode === "text" ? {
    tokens: e[0],
    numArgs: 0
  } : {
    tokens: e[1],
    numArgs: 0
  };
});
var Po = {
  0: 0,
  1: 1,
  2: 2,
  3: 3,
  4: 4,
  5: 5,
  6: 6,
  7: 7,
  8: 8,
  9: 9,
  a: 10,
  A: 10,
  b: 11,
  B: 11,
  c: 12,
  C: 12,
  d: 13,
  D: 13,
  e: 14,
  E: 14,
  f: 15,
  F: 15
};
_("\\char", function(r) {
  var e = r.popToken(), t, n = "";
  if (e.text === "'")
    t = 8, e = r.popToken();
  else if (e.text === '"')
    t = 16, e = r.popToken();
  else if (e.text === "`")
    if (e = r.popToken(), e.text[0] === "\\")
      n = e.text.charCodeAt(1);
    else {
      if (e.text === "EOF")
        throw new U("\\char` missing argument");
      n = e.text.charCodeAt(0);
    }
  else
    t = 10;
  if (t) {
    if (n = Po[e.text], n == null || n >= t)
      throw new U("Invalid base-" + t + " digit " + e.text);
    for (var a; (a = Po[r.future().text]) != null && a < t; )
      n *= t, n += a, r.popToken();
  }
  return "\\@char{" + n + "}";
});
var Il = (r, e, t, n) => {
  var a = r.consumeArg().tokens;
  if (a.length !== 1)
    throw new U("\\newcommand's first argument must be a macro name");
  var i = a[0].text, s = r.isDefined(i);
  if (s && !e)
    throw new U("\\newcommand{" + i + "} attempting to redefine " + (i + "; use \\renewcommand"));
  if (!s && !t)
    throw new U("\\renewcommand{" + i + "} when command " + i + " does not yet exist; use \\newcommand");
  var l = 0;
  if (a = r.consumeArg().tokens, a.length === 1 && a[0].text === "[") {
    for (var o = "", u = r.expandNextToken(); u.text !== "]" && u.text !== "EOF"; )
      o += u.text, u = r.expandNextToken();
    if (!o.match(/^\s*[0-9]+\s*$/))
      throw new U("Invalid number of arguments: " + o);
    l = parseInt(o), a = r.consumeArg().tokens;
  }
  return s && n || r.macros.set(i, {
    tokens: a,
    numArgs: l
  }), "";
};
_("\\newcommand", (r) => Il(r, !1, !0, !1));
_("\\renewcommand", (r) => Il(r, !0, !1, !1));
_("\\providecommand", (r) => Il(r, !0, !0, !0));
_("\\message", (r) => {
  var e = r.consumeArgs(1)[0];
  return console.log(e.reverse().map((t) => t.text).join("")), "";
});
_("\\errmessage", (r) => {
  var e = r.consumeArgs(1)[0];
  return console.error(e.reverse().map((t) => t.text).join("")), "";
});
_("\\show", (r) => {
  var e = r.popToken(), t = e.text;
  return console.log(e, r.macros.get(t), M0[t], Re.math[t], Re.text[t]), "";
});
_("\\bgroup", "{");
_("\\egroup", "}");
_("~", "\\nobreakspace");
_("\\lq", "`");
_("\\rq", "'");
_("\\aa", "\\r a");
_("\\AA", "\\r A");
_("\\textcopyright", "\\html@mathml{\\textcircled{c}}{\\char`©}");
_("\\copyright", "\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");
_("\\textregistered", "\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");
_("ℬ", "\\mathscr{B}");
_("ℰ", "\\mathscr{E}");
_("ℱ", "\\mathscr{F}");
_("ℋ", "\\mathscr{H}");
_("ℐ", "\\mathscr{I}");
_("ℒ", "\\mathscr{L}");
_("ℳ", "\\mathscr{M}");
_("ℛ", "\\mathscr{R}");
_("ℭ", "\\mathfrak{C}");
_("ℌ", "\\mathfrak{H}");
_("ℨ", "\\mathfrak{Z}");
_("\\Bbbk", "\\Bbb{k}");
_("·", "\\cdotp");
_("\\llap", "\\mathllap{\\textrm{#1}}");
_("\\rlap", "\\mathrlap{\\textrm{#1}}");
_("\\clap", "\\mathclap{\\textrm{#1}}");
_("\\mathstrut", "\\vphantom{(}");
_("\\underbar", "\\underline{\\text{#1}}");
_("\\not", '\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}');
_("\\neq", "\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");
_("\\ne", "\\neq");
_("≠", "\\neq");
_("\\notin", "\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");
_("∉", "\\notin");
_("≘", "\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");
_("≙", "\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");
_("≚", "\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");
_("≛", "\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");
_("≝", "\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");
_("≞", "\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");
_("≟", "\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");
_("⟂", "\\perp");
_("‼", "\\mathclose{!\\mkern-0.8mu!}");
_("∌", "\\notni");
_("⌜", "\\ulcorner");
_("⌝", "\\urcorner");
_("⌞", "\\llcorner");
_("⌟", "\\lrcorner");
_("©", "\\copyright");
_("®", "\\textregistered");
_("️", "\\textregistered");
_("\\ulcorner", '\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');
_("\\urcorner", '\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');
_("\\llcorner", '\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');
_("\\lrcorner", '\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');
_("\\vdots", "{\\varvdots\\rule{0pt}{15pt}}");
_("⋮", "\\vdots");
_("\\varGamma", "\\mathit{\\Gamma}");
_("\\varDelta", "\\mathit{\\Delta}");
_("\\varTheta", "\\mathit{\\Theta}");
_("\\varLambda", "\\mathit{\\Lambda}");
_("\\varXi", "\\mathit{\\Xi}");
_("\\varPi", "\\mathit{\\Pi}");
_("\\varSigma", "\\mathit{\\Sigma}");
_("\\varUpsilon", "\\mathit{\\Upsilon}");
_("\\varPhi", "\\mathit{\\Phi}");
_("\\varPsi", "\\mathit{\\Psi}");
_("\\varOmega", "\\mathit{\\Omega}");
_("\\substack", "\\begin{subarray}{c}#1\\end{subarray}");
_("\\colon", "\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");
_("\\boxed", "\\fbox{$\\displaystyle{#1}$}");
_("\\iff", "\\DOTSB\\;\\Longleftrightarrow\\;");
_("\\implies", "\\DOTSB\\;\\Longrightarrow\\;");
_("\\impliedby", "\\DOTSB\\;\\Longleftarrow\\;");
_("\\dddot", "{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");
_("\\ddddot", "{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");
var Ho = {
  ",": "\\dotsc",
  "\\not": "\\dotsb",
  // \keybin@ checks for the following:
  "+": "\\dotsb",
  "=": "\\dotsb",
  "<": "\\dotsb",
  ">": "\\dotsb",
  "-": "\\dotsb",
  "*": "\\dotsb",
  ":": "\\dotsb",
  // Symbols whose definition starts with \DOTSB:
  "\\DOTSB": "\\dotsb",
  "\\coprod": "\\dotsb",
  "\\bigvee": "\\dotsb",
  "\\bigwedge": "\\dotsb",
  "\\biguplus": "\\dotsb",
  "\\bigcap": "\\dotsb",
  "\\bigcup": "\\dotsb",
  "\\prod": "\\dotsb",
  "\\sum": "\\dotsb",
  "\\bigotimes": "\\dotsb",
  "\\bigoplus": "\\dotsb",
  "\\bigodot": "\\dotsb",
  "\\bigsqcup": "\\dotsb",
  "\\And": "\\dotsb",
  "\\longrightarrow": "\\dotsb",
  "\\Longrightarrow": "\\dotsb",
  "\\longleftarrow": "\\dotsb",
  "\\Longleftarrow": "\\dotsb",
  "\\longleftrightarrow": "\\dotsb",
  "\\Longleftrightarrow": "\\dotsb",
  "\\mapsto": "\\dotsb",
  "\\longmapsto": "\\dotsb",
  "\\hookrightarrow": "\\dotsb",
  "\\doteq": "\\dotsb",
  // Symbols whose definition starts with \mathbin:
  "\\mathbin": "\\dotsb",
  // Symbols whose definition starts with \mathrel:
  "\\mathrel": "\\dotsb",
  "\\relbar": "\\dotsb",
  "\\Relbar": "\\dotsb",
  "\\xrightarrow": "\\dotsb",
  "\\xleftarrow": "\\dotsb",
  // Symbols whose definition starts with \DOTSI:
  "\\DOTSI": "\\dotsi",
  "\\int": "\\dotsi",
  "\\oint": "\\dotsi",
  "\\iint": "\\dotsi",
  "\\iiint": "\\dotsi",
  "\\iiiint": "\\dotsi",
  "\\idotsint": "\\dotsi",
  // Symbols whose definition starts with \DOTSX:
  "\\DOTSX": "\\dotsx"
};
_("\\dots", function(r) {
  var e = "\\dotso", t = r.expandAfterFuture().text;
  return t in Ho ? e = Ho[t] : (t.slice(0, 4) === "\\not" || t in Re.math && ae.contains(["bin", "rel"], Re.math[t].group)) && (e = "\\dotsb"), e;
});
var Rl = {
  // \rightdelim@ checks for the following:
  ")": !0,
  "]": !0,
  "\\rbrack": !0,
  "\\}": !0,
  "\\rbrace": !0,
  "\\rangle": !0,
  "\\rceil": !0,
  "\\rfloor": !0,
  "\\rgroup": !0,
  "\\rmoustache": !0,
  "\\right": !0,
  "\\bigr": !0,
  "\\biggr": !0,
  "\\Bigr": !0,
  "\\Biggr": !0,
  // \extra@ also tests for the following:
  $: !0,
  // \extrap@ checks for the following:
  ";": !0,
  ".": !0,
  ",": !0
};
_("\\dotso", function(r) {
  var e = r.future().text;
  return e in Rl ? "\\ldots\\," : "\\ldots";
});
_("\\dotsc", function(r) {
  var e = r.future().text;
  return e in Rl && e !== "," ? "\\ldots\\," : "\\ldots";
});
_("\\cdots", function(r) {
  var e = r.future().text;
  return e in Rl ? "\\@cdots\\," : "\\@cdots";
});
_("\\dotsb", "\\cdots");
_("\\dotsm", "\\cdots");
_("\\dotsi", "\\!\\cdots");
_("\\dotsx", "\\ldots\\,");
_("\\DOTSI", "\\relax");
_("\\DOTSB", "\\relax");
_("\\DOTSX", "\\relax");
_("\\tmspace", "\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");
_("\\,", "\\tmspace+{3mu}{.1667em}");
_("\\thinspace", "\\,");
_("\\>", "\\mskip{4mu}");
_("\\:", "\\tmspace+{4mu}{.2222em}");
_("\\medspace", "\\:");
_("\\;", "\\tmspace+{5mu}{.2777em}");
_("\\thickspace", "\\;");
_("\\!", "\\tmspace-{3mu}{.1667em}");
_("\\negthinspace", "\\!");
_("\\negmedspace", "\\tmspace-{4mu}{.2222em}");
_("\\negthickspace", "\\tmspace-{5mu}{.277em}");
_("\\enspace", "\\kern.5em ");
_("\\enskip", "\\hskip.5em\\relax");
_("\\quad", "\\hskip1em\\relax");
_("\\qquad", "\\hskip2em\\relax");
_("\\tag", "\\@ifstar\\tag@literal\\tag@paren");
_("\\tag@paren", "\\tag@literal{({#1})}");
_("\\tag@literal", (r) => {
  if (r.macros.get("\\df@tag"))
    throw new U("Multiple \\tag");
  return "\\gdef\\df@tag{\\text{#1}}";
});
_("\\bmod", "\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");
_("\\pod", "\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");
_("\\pmod", "\\pod{{\\rm mod}\\mkern6mu#1}");
_("\\mod", "\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");
_("\\newline", "\\\\\\relax");
_("\\TeX", "\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");
var qc = W(Hn["Main-Regular"][84][1] - 0.7 * Hn["Main-Regular"][65][1]);
_("\\LaTeX", "\\textrm{\\html@mathml{" + ("L\\kern-.36em\\raisebox{" + qc + "}{\\scriptstyle A}") + "\\kern-.15em\\TeX}{LaTeX}}");
_("\\KaTeX", "\\textrm{\\html@mathml{" + ("K\\kern-.17em\\raisebox{" + qc + "}{\\scriptstyle A}") + "\\kern-.15em\\TeX}{KaTeX}}");
_("\\hspace", "\\@ifstar\\@hspacer\\@hspace");
_("\\@hspace", "\\hskip #1\\relax");
_("\\@hspacer", "\\rule{0pt}{0pt}\\hskip #1\\relax");
_("\\ordinarycolon", ":");
_("\\vcentcolon", "\\mathrel{\\mathop\\ordinarycolon}");
_("\\dblcolon", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');
_("\\coloneqq", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');
_("\\Coloneqq", '\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');
_("\\coloneq", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');
_("\\Coloneq", '\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');
_("\\eqqcolon", '\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');
_("\\Eqqcolon", '\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');
_("\\eqcolon", '\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');
_("\\Eqcolon", '\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');
_("\\colonapprox", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');
_("\\Colonapprox", '\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');
_("\\colonsim", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');
_("\\Colonsim", '\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');
_("∷", "\\dblcolon");
_("∹", "\\eqcolon");
_("≔", "\\coloneqq");
_("≕", "\\eqqcolon");
_("⩴", "\\Coloneqq");
_("\\ratio", "\\vcentcolon");
_("\\coloncolon", "\\dblcolon");
_("\\colonequals", "\\coloneqq");
_("\\coloncolonequals", "\\Coloneqq");
_("\\equalscolon", "\\eqqcolon");
_("\\equalscoloncolon", "\\Eqqcolon");
_("\\colonminus", "\\coloneq");
_("\\coloncolonminus", "\\Coloneq");
_("\\minuscolon", "\\eqcolon");
_("\\minuscoloncolon", "\\Eqcolon");
_("\\coloncolonapprox", "\\Colonapprox");
_("\\coloncolonsim", "\\Colonsim");
_("\\simcolon", "\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");
_("\\simcoloncolon", "\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");
_("\\approxcolon", "\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");
_("\\approxcoloncolon", "\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");
_("\\notni", "\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");
_("\\limsup", "\\DOTSB\\operatorname*{lim\\,sup}");
_("\\liminf", "\\DOTSB\\operatorname*{lim\\,inf}");
_("\\injlim", "\\DOTSB\\operatorname*{inj\\,lim}");
_("\\projlim", "\\DOTSB\\operatorname*{proj\\,lim}");
_("\\varlimsup", "\\DOTSB\\operatorname*{\\overline{lim}}");
_("\\varliminf", "\\DOTSB\\operatorname*{\\underline{lim}}");
_("\\varinjlim", "\\DOTSB\\operatorname*{\\underrightarrow{lim}}");
_("\\varprojlim", "\\DOTSB\\operatorname*{\\underleftarrow{lim}}");
_("\\gvertneqq", "\\html@mathml{\\@gvertneqq}{≩}");
_("\\lvertneqq", "\\html@mathml{\\@lvertneqq}{≨}");
_("\\ngeqq", "\\html@mathml{\\@ngeqq}{≱}");
_("\\ngeqslant", "\\html@mathml{\\@ngeqslant}{≱}");
_("\\nleqq", "\\html@mathml{\\@nleqq}{≰}");
_("\\nleqslant", "\\html@mathml{\\@nleqslant}{≰}");
_("\\nshortmid", "\\html@mathml{\\@nshortmid}{∤}");
_("\\nshortparallel", "\\html@mathml{\\@nshortparallel}{∦}");
_("\\nsubseteqq", "\\html@mathml{\\@nsubseteqq}{⊈}");
_("\\nsupseteqq", "\\html@mathml{\\@nsupseteqq}{⊉}");
_("\\varsubsetneq", "\\html@mathml{\\@varsubsetneq}{⊊}");
_("\\varsubsetneqq", "\\html@mathml{\\@varsubsetneqq}{⫋}");
_("\\varsupsetneq", "\\html@mathml{\\@varsupsetneq}{⊋}");
_("\\varsupsetneqq", "\\html@mathml{\\@varsupsetneqq}{⫌}");
_("\\imath", "\\html@mathml{\\@imath}{ı}");
_("\\jmath", "\\html@mathml{\\@jmath}{ȷ}");
_("\\llbracket", "\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");
_("\\rrbracket", "\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");
_("⟦", "\\llbracket");
_("⟧", "\\rrbracket");
_("\\lBrace", "\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");
_("\\rBrace", "\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");
_("⦃", "\\lBrace");
_("⦄", "\\rBrace");
_("\\minuso", "\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");
_("⦵", "\\minuso");
_("\\darr", "\\downarrow");
_("\\dArr", "\\Downarrow");
_("\\Darr", "\\Downarrow");
_("\\lang", "\\langle");
_("\\rang", "\\rangle");
_("\\uarr", "\\uparrow");
_("\\uArr", "\\Uparrow");
_("\\Uarr", "\\Uparrow");
_("\\N", "\\mathbb{N}");
_("\\R", "\\mathbb{R}");
_("\\Z", "\\mathbb{Z}");
_("\\alef", "\\aleph");
_("\\alefsym", "\\aleph");
_("\\Alpha", "\\mathrm{A}");
_("\\Beta", "\\mathrm{B}");
_("\\bull", "\\bullet");
_("\\Chi", "\\mathrm{X}");
_("\\clubs", "\\clubsuit");
_("\\cnums", "\\mathbb{C}");
_("\\Complex", "\\mathbb{C}");
_("\\Dagger", "\\ddagger");
_("\\diamonds", "\\diamondsuit");
_("\\empty", "\\emptyset");
_("\\Epsilon", "\\mathrm{E}");
_("\\Eta", "\\mathrm{H}");
_("\\exist", "\\exists");
_("\\harr", "\\leftrightarrow");
_("\\hArr", "\\Leftrightarrow");
_("\\Harr", "\\Leftrightarrow");
_("\\hearts", "\\heartsuit");
_("\\image", "\\Im");
_("\\infin", "\\infty");
_("\\Iota", "\\mathrm{I}");
_("\\isin", "\\in");
_("\\Kappa", "\\mathrm{K}");
_("\\larr", "\\leftarrow");
_("\\lArr", "\\Leftarrow");
_("\\Larr", "\\Leftarrow");
_("\\lrarr", "\\leftrightarrow");
_("\\lrArr", "\\Leftrightarrow");
_("\\Lrarr", "\\Leftrightarrow");
_("\\Mu", "\\mathrm{M}");
_("\\natnums", "\\mathbb{N}");
_("\\Nu", "\\mathrm{N}");
_("\\Omicron", "\\mathrm{O}");
_("\\plusmn", "\\pm");
_("\\rarr", "\\rightarrow");
_("\\rArr", "\\Rightarrow");
_("\\Rarr", "\\Rightarrow");
_("\\real", "\\Re");
_("\\reals", "\\mathbb{R}");
_("\\Reals", "\\mathbb{R}");
_("\\Rho", "\\mathrm{P}");
_("\\sdot", "\\cdot");
_("\\sect", "\\S");
_("\\spades", "\\spadesuit");
_("\\sub", "\\subset");
_("\\sube", "\\subseteq");
_("\\supe", "\\supseteq");
_("\\Tau", "\\mathrm{T}");
_("\\thetasym", "\\vartheta");
_("\\weierp", "\\wp");
_("\\Zeta", "\\mathrm{Z}");
_("\\argmin", "\\DOTSB\\operatorname*{arg\\,min}");
_("\\argmax", "\\DOTSB\\operatorname*{arg\\,max}");
_("\\plim", "\\DOTSB\\mathop{\\operatorname{plim}}\\limits");
_("\\bra", "\\mathinner{\\langle{#1}|}");
_("\\ket", "\\mathinner{|{#1}\\rangle}");
_("\\braket", "\\mathinner{\\langle{#1}\\rangle}");
_("\\Bra", "\\left\\langle#1\\right|");
_("\\Ket", "\\left|#1\\right\\rangle");
var Lc = (r) => (e) => {
  var t = e.consumeArg().tokens, n = e.consumeArg().tokens, a = e.consumeArg().tokens, i = e.consumeArg().tokens, s = e.macros.get("|"), l = e.macros.get("\\|");
  e.macros.beginGroup();
  var o = (m) => (d) => {
    r && (d.macros.set("|", s), a.length && d.macros.set("\\|", l));
    var g = m;
    if (!m && a.length) {
      var b = d.future();
      b.text === "|" && (d.popToken(), g = !0);
    }
    return {
      tokens: g ? a : n,
      numArgs: 0
    };
  };
  e.macros.set("|", o(!1)), a.length && e.macros.set("\\|", o(!0));
  var u = e.consumeArg().tokens, h = e.expandTokens([
    ...i,
    ...u,
    ...t
    // reversed
  ]);
  return e.macros.endGroup(), {
    tokens: h.reverse(),
    numArgs: 0
  };
};
_("\\bra@ket", Lc(!1));
_("\\bra@set", Lc(!0));
_("\\Braket", "\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");
_("\\Set", "\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");
_("\\set", "\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");
_("\\angln", "{\\angl n}");
_("\\blue", "\\textcolor{##6495ed}{#1}");
_("\\orange", "\\textcolor{##ffa500}{#1}");
_("\\pink", "\\textcolor{##ff00af}{#1}");
_("\\red", "\\textcolor{##df0030}{#1}");
_("\\green", "\\textcolor{##28ae7b}{#1}");
_("\\gray", "\\textcolor{gray}{#1}");
_("\\purple", "\\textcolor{##9d38bd}{#1}");
_("\\blueA", "\\textcolor{##ccfaff}{#1}");
_("\\blueB", "\\textcolor{##80f6ff}{#1}");
_("\\blueC", "\\textcolor{##63d9ea}{#1}");
_("\\blueD", "\\textcolor{##11accd}{#1}");
_("\\blueE", "\\textcolor{##0c7f99}{#1}");
_("\\tealA", "\\textcolor{##94fff5}{#1}");
_("\\tealB", "\\textcolor{##26edd5}{#1}");
_("\\tealC", "\\textcolor{##01d1c1}{#1}");
_("\\tealD", "\\textcolor{##01a995}{#1}");
_("\\tealE", "\\textcolor{##208170}{#1}");
_("\\greenA", "\\textcolor{##b6ffb0}{#1}");
_("\\greenB", "\\textcolor{##8af281}{#1}");
_("\\greenC", "\\textcolor{##74cf70}{#1}");
_("\\greenD", "\\textcolor{##1fab54}{#1}");
_("\\greenE", "\\textcolor{##0d923f}{#1}");
_("\\goldA", "\\textcolor{##ffd0a9}{#1}");
_("\\goldB", "\\textcolor{##ffbb71}{#1}");
_("\\goldC", "\\textcolor{##ff9c39}{#1}");
_("\\goldD", "\\textcolor{##e07d10}{#1}");
_("\\goldE", "\\textcolor{##a75a05}{#1}");
_("\\redA", "\\textcolor{##fca9a9}{#1}");
_("\\redB", "\\textcolor{##ff8482}{#1}");
_("\\redC", "\\textcolor{##f9685d}{#1}");
_("\\redD", "\\textcolor{##e84d39}{#1}");
_("\\redE", "\\textcolor{##bc2612}{#1}");
_("\\maroonA", "\\textcolor{##ffbde0}{#1}");
_("\\maroonB", "\\textcolor{##ff92c6}{#1}");
_("\\maroonC", "\\textcolor{##ed5fa6}{#1}");
_("\\maroonD", "\\textcolor{##ca337c}{#1}");
_("\\maroonE", "\\textcolor{##9e034e}{#1}");
_("\\purpleA", "\\textcolor{##ddd7ff}{#1}");
_("\\purpleB", "\\textcolor{##c6b9fc}{#1}");
_("\\purpleC", "\\textcolor{##aa87ff}{#1}");
_("\\purpleD", "\\textcolor{##7854ab}{#1}");
_("\\purpleE", "\\textcolor{##543b78}{#1}");
_("\\mintA", "\\textcolor{##f5f9e8}{#1}");
_("\\mintB", "\\textcolor{##edf2df}{#1}");
_("\\mintC", "\\textcolor{##e0e5cc}{#1}");
_("\\grayA", "\\textcolor{##f6f7f7}{#1}");
_("\\grayB", "\\textcolor{##f0f1f2}{#1}");
_("\\grayC", "\\textcolor{##e3e5e6}{#1}");
_("\\grayD", "\\textcolor{##d6d8da}{#1}");
_("\\grayE", "\\textcolor{##babec2}{#1}");
_("\\grayF", "\\textcolor{##888d93}{#1}");
_("\\grayG", "\\textcolor{##626569}{#1}");
_("\\grayH", "\\textcolor{##3b3e40}{#1}");
_("\\grayI", "\\textcolor{##21242c}{#1}");
_("\\kaBlue", "\\textcolor{##314453}{#1}");
_("\\kaGreen", "\\textcolor{##71B307}{#1}");
var Ic = {
  "^": !0,
  // Parser.js
  _: !0,
  // Parser.js
  "\\limits": !0,
  // Parser.js
  "\\nolimits": !0
  // Parser.js
};
class mm {
  constructor(e, t, n) {
    this.settings = void 0, this.expansionCount = void 0, this.lexer = void 0, this.macros = void 0, this.stack = void 0, this.mode = void 0, this.settings = t, this.expansionCount = 0, this.feed(e), this.macros = new fm(dm, t.macros), this.mode = n, this.stack = [];
  }
  /**
   * Feed a new input string to the same MacroExpander
   * (with existing macros etc.).
   */
  feed(e) {
    this.lexer = new Oo(e, this.settings);
  }
  /**
   * Switches between "text" and "math" modes.
   */
  switchMode(e) {
    this.mode = e;
  }
  /**
   * Start a new group nesting within all namespaces.
   */
  beginGroup() {
    this.macros.beginGroup();
  }
  /**
   * End current group nesting within all namespaces.
   */
  endGroup() {
    this.macros.endGroup();
  }
  /**
   * Ends all currently nested groups (if any), restoring values before the
   * groups began.  Useful in case of an error in the middle of parsing.
   */
  endGroups() {
    this.macros.endGroups();
  }
  /**
   * Returns the topmost token on the stack, without expanding it.
   * Similar in behavior to TeX's `\futurelet`.
   */
  future() {
    return this.stack.length === 0 && this.pushToken(this.lexer.lex()), this.stack[this.stack.length - 1];
  }
  /**
   * Remove and return the next unexpanded token.
   */
  popToken() {
    return this.future(), this.stack.pop();
  }
  /**
   * Add a given token to the token stack.  In particular, this get be used
   * to put back a token returned from one of the other methods.
   */
  pushToken(e) {
    this.stack.push(e);
  }
  /**
   * Append an array of tokens to the token stack.
   */
  pushTokens(e) {
    this.stack.push(...e);
  }
  /**
   * Find an macro argument without expanding tokens and append the array of
   * tokens to the token stack. Uses Token as a container for the result.
   */
  scanArgument(e) {
    var t, n, a;
    if (e) {
      if (this.consumeSpaces(), this.future().text !== "[")
        return null;
      t = this.popToken(), {
        tokens: a,
        end: n
      } = this.consumeArg(["]"]);
    } else
      ({
        tokens: a,
        start: t,
        end: n
      } = this.consumeArg());
    return this.pushToken(new yn("EOF", n.loc)), this.pushTokens(a), t.range(n, "");
  }
  /**
   * Consume all following space tokens, without expansion.
   */
  consumeSpaces() {
    for (; ; ) {
      var e = this.future();
      if (e.text === " ")
        this.stack.pop();
      else
        break;
    }
  }
  /**
   * Consume an argument from the token stream, and return the resulting array
   * of tokens and start/end token.
   */
  consumeArg(e) {
    var t = [], n = e && e.length > 0;
    n || this.consumeSpaces();
    var a = this.future(), i, s = 0, l = 0;
    do {
      if (i = this.popToken(), t.push(i), i.text === "{")
        ++s;
      else if (i.text === "}") {
        if (--s, s === -1)
          throw new U("Extra }", i);
      } else if (i.text === "EOF")
        throw new U("Unexpected end of input in a macro argument, expected '" + (e && n ? e[l] : "}") + "'", i);
      if (e && n)
        if ((s === 0 || s === 1 && e[l] === "{") && i.text === e[l]) {
          if (++l, l === e.length) {
            t.splice(-l, l);
            break;
          }
        } else
          l = 0;
    } while (s !== 0 || n);
    return a.text === "{" && t[t.length - 1].text === "}" && (t.pop(), t.shift()), t.reverse(), {
      tokens: t,
      start: a,
      end: i
    };
  }
  /**
   * Consume the specified number of (delimited) arguments from the token
   * stream and return the resulting array of arguments.
   */
  consumeArgs(e, t) {
    if (t) {
      if (t.length !== e + 1)
        throw new U("The length of delimiters doesn't match the number of args!");
      for (var n = t[0], a = 0; a < n.length; a++) {
        var i = this.popToken();
        if (n[a] !== i.text)
          throw new U("Use of the macro doesn't match its definition", i);
      }
    }
    for (var s = [], l = 0; l < e; l++)
      s.push(this.consumeArg(t && t[l + 1]).tokens);
    return s;
  }
  /**
   * Increment `expansionCount` by the specified amount.
   * Throw an error if it exceeds `maxExpand`.
   */
  countExpansion(e) {
    if (this.expansionCount += e, this.expansionCount > this.settings.maxExpand)
      throw new U("Too many expansions: infinite loop or need to increase maxExpand setting");
  }
  /**
   * Expand the next token only once if possible.
   *
   * If the token is expanded, the resulting tokens will be pushed onto
   * the stack in reverse order, and the number of such tokens will be
   * returned.  This number might be zero or positive.
   *
   * If not, the return value is `false`, and the next token remains at the
   * top of the stack.
   *
   * In either case, the next token will be on the top of the stack,
   * or the stack will be empty (in case of empty expansion
   * and no other tokens).
   *
   * Used to implement `expandAfterFuture` and `expandNextToken`.
   *
   * If expandableOnly, only expandable tokens are expanded and
   * an undefined control sequence results in an error.
   */
  expandOnce(e) {
    var t = this.popToken(), n = t.text, a = t.noexpand ? null : this._getExpansion(n);
    if (a == null || e && a.unexpandable) {
      if (e && a == null && n[0] === "\\" && !this.isDefined(n))
        throw new U("Undefined control sequence: " + n);
      return this.pushToken(t), !1;
    }
    this.countExpansion(1);
    var i = a.tokens, s = this.consumeArgs(a.numArgs, a.delimiters);
    if (a.numArgs) {
      i = i.slice();
      for (var l = i.length - 1; l >= 0; --l) {
        var o = i[l];
        if (o.text === "#") {
          if (l === 0)
            throw new U("Incomplete placeholder at end of macro body", o);
          if (o = i[--l], o.text === "#")
            i.splice(l + 1, 1);
          else if (/^[1-9]$/.test(o.text))
            i.splice(l, 2, ...s[+o.text - 1]);
          else
            throw new U("Not a valid argument number", o);
        }
      }
    }
    return this.pushTokens(i), i.length;
  }
  /**
   * Expand the next token only once (if possible), and return the resulting
   * top token on the stack (without removing anything from the stack).
   * Similar in behavior to TeX's `\expandafter\futurelet`.
   * Equivalent to expandOnce() followed by future().
   */
  expandAfterFuture() {
    return this.expandOnce(), this.future();
  }
  /**
   * Recursively expand first token, then return first non-expandable token.
   */
  expandNextToken() {
    for (; ; )
      if (this.expandOnce() === !1) {
        var e = this.stack.pop();
        return e.treatAsRelax && (e.text = "\\relax"), e;
      }
    throw new Error();
  }
  /**
   * Fully expand the given macro name and return the resulting list of
   * tokens, or return `undefined` if no such macro is defined.
   */
  expandMacro(e) {
    return this.macros.has(e) ? this.expandTokens([new yn(e)]) : void 0;
  }
  /**
   * Fully expand the given token stream and return the resulting list of
   * tokens.  Note that the input tokens are in reverse order, but the
   * output tokens are in forward order.
   */
  expandTokens(e) {
    var t = [], n = this.stack.length;
    for (this.pushTokens(e); this.stack.length > n; )
      if (this.expandOnce(!0) === !1) {
        var a = this.stack.pop();
        a.treatAsRelax && (a.noexpand = !1, a.treatAsRelax = !1), t.push(a);
      }
    return this.countExpansion(t.length), t;
  }
  /**
   * Fully expand the given macro name and return the result as a string,
   * or return `undefined` if no such macro is defined.
   */
  expandMacroAsText(e) {
    var t = this.expandMacro(e);
    return t && t.map((n) => n.text).join("");
  }
  /**
   * Returns the expanded macro as a reversed array of tokens and a macro
   * argument count.  Or returns `null` if no such macro.
   */
  _getExpansion(e) {
    var t = this.macros.get(e);
    if (t == null)
      return t;
    if (e.length === 1) {
      var n = this.lexer.catcodes[e];
      if (n != null && n !== 13)
        return;
    }
    var a = typeof t == "function" ? t(this) : t;
    if (typeof a == "string") {
      var i = 0;
      if (a.indexOf("#") !== -1)
        for (var s = a.replace(/##/g, ""); s.indexOf("#" + (i + 1)) !== -1; )
          ++i;
      for (var l = new Oo(a, this.settings), o = [], u = l.lex(); u.text !== "EOF"; )
        o.push(u), u = l.lex();
      o.reverse();
      var h = {
        tokens: o,
        numArgs: i
      };
      return h;
    }
    return a;
  }
  /**
   * Determine whether a command is currently "defined" (has some
   * functionality), meaning that it's a macro (in the current group),
   * a function, a symbol, or one of the special commands listed in
   * `implicitCommands`.
   */
  isDefined(e) {
    return this.macros.has(e) || M0.hasOwnProperty(e) || Re.math.hasOwnProperty(e) || Re.text.hasOwnProperty(e) || Ic.hasOwnProperty(e);
  }
  /**
   * Determine whether a command is expandable.
   */
  isExpandable(e) {
    var t = this.macros.get(e);
    return t != null ? typeof t == "string" || typeof t == "function" || !t.unexpandable : M0.hasOwnProperty(e) && !M0[e].primitive;
  }
}
var Uo = /^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/, za = Object.freeze({
  "₊": "+",
  "₋": "-",
  "₌": "=",
  "₍": "(",
  "₎": ")",
  "₀": "0",
  "₁": "1",
  "₂": "2",
  "₃": "3",
  "₄": "4",
  "₅": "5",
  "₆": "6",
  "₇": "7",
  "₈": "8",
  "₉": "9",
  "ₐ": "a",
  "ₑ": "e",
  "ₕ": "h",
  "ᵢ": "i",
  "ⱼ": "j",
  "ₖ": "k",
  "ₗ": "l",
  "ₘ": "m",
  "ₙ": "n",
  "ₒ": "o",
  "ₚ": "p",
  "ᵣ": "r",
  "ₛ": "s",
  "ₜ": "t",
  "ᵤ": "u",
  "ᵥ": "v",
  "ₓ": "x",
  "ᵦ": "β",
  "ᵧ": "γ",
  "ᵨ": "ρ",
  "ᵩ": "ϕ",
  "ᵪ": "χ",
  "⁺": "+",
  "⁻": "-",
  "⁼": "=",
  "⁽": "(",
  "⁾": ")",
  "⁰": "0",
  "¹": "1",
  "²": "2",
  "³": "3",
  "⁴": "4",
  "⁵": "5",
  "⁶": "6",
  "⁷": "7",
  "⁸": "8",
  "⁹": "9",
  "ᴬ": "A",
  "ᴮ": "B",
  "ᴰ": "D",
  "ᴱ": "E",
  "ᴳ": "G",
  "ᴴ": "H",
  "ᴵ": "I",
  "ᴶ": "J",
  "ᴷ": "K",
  "ᴸ": "L",
  "ᴹ": "M",
  "ᴺ": "N",
  "ᴼ": "O",
  "ᴾ": "P",
  "ᴿ": "R",
  "ᵀ": "T",
  "ᵁ": "U",
  "ⱽ": "V",
  "ᵂ": "W",
  "ᵃ": "a",
  "ᵇ": "b",
  "ᶜ": "c",
  "ᵈ": "d",
  "ᵉ": "e",
  "ᶠ": "f",
  "ᵍ": "g",
  ʰ: "h",
  "ⁱ": "i",
  ʲ: "j",
  "ᵏ": "k",
  ˡ: "l",
  "ᵐ": "m",
  ⁿ: "n",
  "ᵒ": "o",
  "ᵖ": "p",
  ʳ: "r",
  ˢ: "s",
  "ᵗ": "t",
  "ᵘ": "u",
  "ᵛ": "v",
  ʷ: "w",
  ˣ: "x",
  ʸ: "y",
  "ᶻ": "z",
  "ᵝ": "β",
  "ᵞ": "γ",
  "ᵟ": "δ",
  "ᵠ": "ϕ",
  "ᵡ": "χ",
  "ᶿ": "θ"
}), fs = {
  "́": {
    text: "\\'",
    math: "\\acute"
  },
  "̀": {
    text: "\\`",
    math: "\\grave"
  },
  "̈": {
    text: '\\"',
    math: "\\ddot"
  },
  "̃": {
    text: "\\~",
    math: "\\tilde"
  },
  "̄": {
    text: "\\=",
    math: "\\bar"
  },
  "̆": {
    text: "\\u",
    math: "\\breve"
  },
  "̌": {
    text: "\\v",
    math: "\\check"
  },
  "̂": {
    text: "\\^",
    math: "\\hat"
  },
  "̇": {
    text: "\\.",
    math: "\\dot"
  },
  "̊": {
    text: "\\r",
    math: "\\mathring"
  },
  "̋": {
    text: "\\H"
  },
  "̧": {
    text: "\\c"
  }
}, Go = {
  á: "á",
  à: "à",
  ä: "ä",
  ǟ: "ǟ",
  ã: "ã",
  ā: "ā",
  ă: "ă",
  ắ: "ắ",
  ằ: "ằ",
  ẵ: "ẵ",
  ǎ: "ǎ",
  â: "â",
  ấ: "ấ",
  ầ: "ầ",
  ẫ: "ẫ",
  ȧ: "ȧ",
  ǡ: "ǡ",
  å: "å",
  ǻ: "ǻ",
  ḃ: "ḃ",
  ć: "ć",
  ḉ: "ḉ",
  č: "č",
  ĉ: "ĉ",
  ċ: "ċ",
  ç: "ç",
  ď: "ď",
  ḋ: "ḋ",
  ḑ: "ḑ",
  é: "é",
  è: "è",
  ë: "ë",
  ẽ: "ẽ",
  ē: "ē",
  ḗ: "ḗ",
  ḕ: "ḕ",
  ĕ: "ĕ",
  ḝ: "ḝ",
  ě: "ě",
  ê: "ê",
  ế: "ế",
  ề: "ề",
  ễ: "ễ",
  ė: "ė",
  ȩ: "ȩ",
  ḟ: "ḟ",
  ǵ: "ǵ",
  ḡ: "ḡ",
  ğ: "ğ",
  ǧ: "ǧ",
  ĝ: "ĝ",
  ġ: "ġ",
  ģ: "ģ",
  ḧ: "ḧ",
  ȟ: "ȟ",
  ĥ: "ĥ",
  ḣ: "ḣ",
  ḩ: "ḩ",
  í: "í",
  ì: "ì",
  ï: "ï",
  ḯ: "ḯ",
  ĩ: "ĩ",
  ī: "ī",
  ĭ: "ĭ",
  ǐ: "ǐ",
  î: "î",
  ǰ: "ǰ",
  ĵ: "ĵ",
  ḱ: "ḱ",
  ǩ: "ǩ",
  ķ: "ķ",
  ĺ: "ĺ",
  ľ: "ľ",
  ļ: "ļ",
  ḿ: "ḿ",
  ṁ: "ṁ",
  ń: "ń",
  ǹ: "ǹ",
  ñ: "ñ",
  ň: "ň",
  ṅ: "ṅ",
  ņ: "ņ",
  ó: "ó",
  ò: "ò",
  ö: "ö",
  ȫ: "ȫ",
  õ: "õ",
  ṍ: "ṍ",
  ṏ: "ṏ",
  ȭ: "ȭ",
  ō: "ō",
  ṓ: "ṓ",
  ṑ: "ṑ",
  ŏ: "ŏ",
  ǒ: "ǒ",
  ô: "ô",
  ố: "ố",
  ồ: "ồ",
  ỗ: "ỗ",
  ȯ: "ȯ",
  ȱ: "ȱ",
  ő: "ő",
  ṕ: "ṕ",
  ṗ: "ṗ",
  ŕ: "ŕ",
  ř: "ř",
  ṙ: "ṙ",
  ŗ: "ŗ",
  ś: "ś",
  ṥ: "ṥ",
  š: "š",
  ṧ: "ṧ",
  ŝ: "ŝ",
  ṡ: "ṡ",
  ş: "ş",
  ẗ: "ẗ",
  ť: "ť",
  ṫ: "ṫ",
  ţ: "ţ",
  ú: "ú",
  ù: "ù",
  ü: "ü",
  ǘ: "ǘ",
  ǜ: "ǜ",
  ǖ: "ǖ",
  ǚ: "ǚ",
  ũ: "ũ",
  ṹ: "ṹ",
  ū: "ū",
  ṻ: "ṻ",
  ŭ: "ŭ",
  ǔ: "ǔ",
  û: "û",
  ů: "ů",
  ű: "ű",
  ṽ: "ṽ",
  ẃ: "ẃ",
  ẁ: "ẁ",
  ẅ: "ẅ",
  ŵ: "ŵ",
  ẇ: "ẇ",
  ẘ: "ẘ",
  ẍ: "ẍ",
  ẋ: "ẋ",
  ý: "ý",
  ỳ: "ỳ",
  ÿ: "ÿ",
  ỹ: "ỹ",
  ȳ: "ȳ",
  ŷ: "ŷ",
  ẏ: "ẏ",
  ẙ: "ẙ",
  ź: "ź",
  ž: "ž",
  ẑ: "ẑ",
  ż: "ż",
  Á: "Á",
  À: "À",
  Ä: "Ä",
  Ǟ: "Ǟ",
  Ã: "Ã",
  Ā: "Ā",
  Ă: "Ă",
  Ắ: "Ắ",
  Ằ: "Ằ",
  Ẵ: "Ẵ",
  Ǎ: "Ǎ",
  Â: "Â",
  Ấ: "Ấ",
  Ầ: "Ầ",
  Ẫ: "Ẫ",
  Ȧ: "Ȧ",
  Ǡ: "Ǡ",
  Å: "Å",
  Ǻ: "Ǻ",
  Ḃ: "Ḃ",
  Ć: "Ć",
  Ḉ: "Ḉ",
  Č: "Č",
  Ĉ: "Ĉ",
  Ċ: "Ċ",
  Ç: "Ç",
  Ď: "Ď",
  Ḋ: "Ḋ",
  Ḑ: "Ḑ",
  É: "É",
  È: "È",
  Ë: "Ë",
  Ẽ: "Ẽ",
  Ē: "Ē",
  Ḗ: "Ḗ",
  Ḕ: "Ḕ",
  Ĕ: "Ĕ",
  Ḝ: "Ḝ",
  Ě: "Ě",
  Ê: "Ê",
  Ế: "Ế",
  Ề: "Ề",
  Ễ: "Ễ",
  Ė: "Ė",
  Ȩ: "Ȩ",
  Ḟ: "Ḟ",
  Ǵ: "Ǵ",
  Ḡ: "Ḡ",
  Ğ: "Ğ",
  Ǧ: "Ǧ",
  Ĝ: "Ĝ",
  Ġ: "Ġ",
  Ģ: "Ģ",
  Ḧ: "Ḧ",
  Ȟ: "Ȟ",
  Ĥ: "Ĥ",
  Ḣ: "Ḣ",
  Ḩ: "Ḩ",
  Í: "Í",
  Ì: "Ì",
  Ï: "Ï",
  Ḯ: "Ḯ",
  Ĩ: "Ĩ",
  Ī: "Ī",
  Ĭ: "Ĭ",
  Ǐ: "Ǐ",
  Î: "Î",
  İ: "İ",
  Ĵ: "Ĵ",
  Ḱ: "Ḱ",
  Ǩ: "Ǩ",
  Ķ: "Ķ",
  Ĺ: "Ĺ",
  Ľ: "Ľ",
  Ļ: "Ļ",
  Ḿ: "Ḿ",
  Ṁ: "Ṁ",
  Ń: "Ń",
  Ǹ: "Ǹ",
  Ñ: "Ñ",
  Ň: "Ň",
  Ṅ: "Ṅ",
  Ņ: "Ņ",
  Ó: "Ó",
  Ò: "Ò",
  Ö: "Ö",
  Ȫ: "Ȫ",
  Õ: "Õ",
  Ṍ: "Ṍ",
  Ṏ: "Ṏ",
  Ȭ: "Ȭ",
  Ō: "Ō",
  Ṓ: "Ṓ",
  Ṑ: "Ṑ",
  Ŏ: "Ŏ",
  Ǒ: "Ǒ",
  Ô: "Ô",
  Ố: "Ố",
  Ồ: "Ồ",
  Ỗ: "Ỗ",
  Ȯ: "Ȯ",
  Ȱ: "Ȱ",
  Ő: "Ő",
  Ṕ: "Ṕ",
  Ṗ: "Ṗ",
  Ŕ: "Ŕ",
  Ř: "Ř",
  Ṙ: "Ṙ",
  Ŗ: "Ŗ",
  Ś: "Ś",
  Ṥ: "Ṥ",
  Š: "Š",
  Ṧ: "Ṧ",
  Ŝ: "Ŝ",
  Ṡ: "Ṡ",
  Ş: "Ş",
  Ť: "Ť",
  Ṫ: "Ṫ",
  Ţ: "Ţ",
  Ú: "Ú",
  Ù: "Ù",
  Ü: "Ü",
  Ǘ: "Ǘ",
  Ǜ: "Ǜ",
  Ǖ: "Ǖ",
  Ǚ: "Ǚ",
  Ũ: "Ũ",
  Ṹ: "Ṹ",
  Ū: "Ū",
  Ṻ: "Ṻ",
  Ŭ: "Ŭ",
  Ǔ: "Ǔ",
  Û: "Û",
  Ů: "Ů",
  Ű: "Ű",
  Ṽ: "Ṽ",
  Ẃ: "Ẃ",
  Ẁ: "Ẁ",
  Ẅ: "Ẅ",
  Ŵ: "Ŵ",
  Ẇ: "Ẇ",
  Ẍ: "Ẍ",
  Ẋ: "Ẋ",
  Ý: "Ý",
  Ỳ: "Ỳ",
  Ÿ: "Ÿ",
  Ỹ: "Ỹ",
  Ȳ: "Ȳ",
  Ŷ: "Ŷ",
  Ẏ: "Ẏ",
  Ź: "Ź",
  Ž: "Ž",
  Ẑ: "Ẑ",
  Ż: "Ż",
  ά: "ά",
  ὰ: "ὰ",
  ᾱ: "ᾱ",
  ᾰ: "ᾰ",
  έ: "έ",
  ὲ: "ὲ",
  ή: "ή",
  ὴ: "ὴ",
  ί: "ί",
  ὶ: "ὶ",
  ϊ: "ϊ",
  ΐ: "ΐ",
  ῒ: "ῒ",
  ῑ: "ῑ",
  ῐ: "ῐ",
  ό: "ό",
  ὸ: "ὸ",
  ύ: "ύ",
  ὺ: "ὺ",
  ϋ: "ϋ",
  ΰ: "ΰ",
  ῢ: "ῢ",
  ῡ: "ῡ",
  ῠ: "ῠ",
  ώ: "ώ",
  ὼ: "ὼ",
  Ύ: "Ύ",
  Ὺ: "Ὺ",
  Ϋ: "Ϋ",
  Ῡ: "Ῡ",
  Ῠ: "Ῠ",
  Ώ: "Ώ",
  Ὼ: "Ὼ"
};
class qi {
  constructor(e, t) {
    this.mode = void 0, this.gullet = void 0, this.settings = void 0, this.leftrightDepth = void 0, this.nextToken = void 0, this.mode = "math", this.gullet = new mm(e, t, this.mode), this.settings = t, this.leftrightDepth = 0;
  }
  /**
   * Checks a result to make sure it has the right type, and throws an
   * appropriate error otherwise.
   */
  expect(e, t) {
    if (t === void 0 && (t = !0), this.fetch().text !== e)
      throw new U("Expected '" + e + "', got '" + this.fetch().text + "'", this.fetch());
    t && this.consume();
  }
  /**
   * Discards the current lookahead token, considering it consumed.
   */
  consume() {
    this.nextToken = null;
  }
  /**
   * Return the current lookahead token, or if there isn't one (at the
   * beginning, or if the previous lookahead token was consume()d),
   * fetch the next token as the new lookahead token and return it.
   */
  fetch() {
    return this.nextToken == null && (this.nextToken = this.gullet.expandNextToken()), this.nextToken;
  }
  /**
   * Switches between "text" and "math" modes.
   */
  switchMode(e) {
    this.mode = e, this.gullet.switchMode(e);
  }
  /**
   * Main parsing function, which parses an entire input.
   */
  parse() {
    this.settings.globalGroup || this.gullet.beginGroup(), this.settings.colorIsTextColor && this.gullet.macros.set("\\color", "\\textcolor");
    try {
      var e = this.parseExpression(!1);
      return this.expect("EOF"), this.settings.globalGroup || this.gullet.endGroup(), e;
    } finally {
      this.gullet.endGroups();
    }
  }
  /**
   * Fully parse a separate sequence of tokens as a separate job.
   * Tokens should be specified in reverse order, as in a MacroDefinition.
   */
  subparse(e) {
    var t = this.nextToken;
    this.consume(), this.gullet.pushToken(new yn("}")), this.gullet.pushTokens(e);
    var n = this.parseExpression(!1);
    return this.expect("}"), this.nextToken = t, n;
  }
  /**
   * Parses an "expression", which is a list of atoms.
   *
   * `breakOnInfix`: Should the parsing stop when we hit infix nodes? This
   *                 happens when functions have higher precedence han infix
   *                 nodes in implicit parses.
   *
   * `breakOnTokenText`: The text of the token that the expression should end
   *                     with, or `null` if something else should end the
   *                     expression.
   */
  parseExpression(e, t) {
    for (var n = []; ; ) {
      this.mode === "math" && this.consumeSpaces();
      var a = this.fetch();
      if (qi.endOfExpression.indexOf(a.text) !== -1 || t && a.text === t || e && M0[a.text] && M0[a.text].infix)
        break;
      var i = this.parseAtom(t);
      if (i) {
        if (i.type === "internal")
          continue;
      } else break;
      n.push(i);
    }
    return this.mode === "text" && this.formLigatures(n), this.handleInfixNodes(n);
  }
  /**
   * Rewrites infix operators such as \over with corresponding commands such
   * as \frac.
   *
   * There can only be one infix operator per group.  If there's more than one
   * then the expression is ambiguous.  This can be resolved by adding {}.
   */
  handleInfixNodes(e) {
    for (var t = -1, n, a = 0; a < e.length; a++)
      if (e[a].type === "infix") {
        if (t !== -1)
          throw new U("only one infix operator per group", e[a].token);
        t = a, n = e[a].replaceWith;
      }
    if (t !== -1 && n) {
      var i, s, l = e.slice(0, t), o = e.slice(t + 1);
      l.length === 1 && l[0].type === "ordgroup" ? i = l[0] : i = {
        type: "ordgroup",
        mode: this.mode,
        body: l
      }, o.length === 1 && o[0].type === "ordgroup" ? s = o[0] : s = {
        type: "ordgroup",
        mode: this.mode,
        body: o
      };
      var u;
      return n === "\\\\abovefrac" ? u = this.callFunction(n, [i, e[t], s], []) : u = this.callFunction(n, [i, s], []), [u];
    } else
      return e;
  }
  /**
   * Handle a subscript or superscript with nice errors.
   */
  handleSupSubscript(e) {
    var t = this.fetch(), n = t.text;
    this.consume(), this.consumeSpaces();
    var a;
    do {
      var i;
      a = this.parseGroup(e);
    } while (((i = a) == null ? void 0 : i.type) === "internal");
    if (!a)
      throw new U("Expected group after '" + n + "'", t);
    return a;
  }
  /**
   * Converts the textual input of an unsupported command into a text node
   * contained within a color node whose color is determined by errorColor
   */
  formatUnsupportedCmd(e) {
    for (var t = [], n = 0; n < e.length; n++)
      t.push({
        type: "textord",
        mode: "text",
        text: e[n]
      });
    var a = {
      type: "text",
      mode: this.mode,
      body: t
    }, i = {
      type: "color",
      mode: this.mode,
      color: this.settings.errorColor,
      body: [a]
    };
    return i;
  }
  /**
   * Parses a group with optional super/subscripts.
   */
  parseAtom(e) {
    var t = this.parseGroup("atom", e);
    if ((t == null ? void 0 : t.type) === "internal" || this.mode === "text")
      return t;
    for (var n, a; ; ) {
      this.consumeSpaces();
      var i = this.fetch();
      if (i.text === "\\limits" || i.text === "\\nolimits") {
        if (t && t.type === "op") {
          var s = i.text === "\\limits";
          t.limits = s, t.alwaysHandleSupSub = !0;
        } else if (t && t.type === "operatorname")
          t.alwaysHandleSupSub && (t.limits = i.text === "\\limits");
        else
          throw new U("Limit controls must follow a math operator", i);
        this.consume();
      } else if (i.text === "^") {
        if (n)
          throw new U("Double superscript", i);
        n = this.handleSupSubscript("superscript");
      } else if (i.text === "_") {
        if (a)
          throw new U("Double subscript", i);
        a = this.handleSupSubscript("subscript");
      } else if (i.text === "'") {
        if (n)
          throw new U("Double superscript", i);
        var l = {
          type: "textord",
          mode: this.mode,
          text: "\\prime"
        }, o = [l];
        for (this.consume(); this.fetch().text === "'"; )
          o.push(l), this.consume();
        this.fetch().text === "^" && o.push(this.handleSupSubscript("superscript")), n = {
          type: "ordgroup",
          mode: this.mode,
          body: o
        };
      } else if (za[i.text]) {
        var u = Uo.test(i.text), h = [];
        for (h.push(new yn(za[i.text])), this.consume(); ; ) {
          var m = this.fetch().text;
          if (!za[m] || Uo.test(m) !== u)
            break;
          h.unshift(new yn(za[m])), this.consume();
        }
        var d = this.subparse(h);
        u ? a = {
          type: "ordgroup",
          mode: "math",
          body: d
        } : n = {
          type: "ordgroup",
          mode: "math",
          body: d
        };
      } else
        break;
    }
    return n || a ? {
      type: "supsub",
      mode: this.mode,
      base: t,
      sup: n,
      sub: a
    } : t;
  }
  /**
   * Parses an entire function, including its base and all of its arguments.
   */
  parseFunction(e, t) {
    var n = this.fetch(), a = n.text, i = M0[a];
    if (!i)
      return null;
    if (this.consume(), t && t !== "atom" && !i.allowedInArgument)
      throw new U("Got function '" + a + "' with no arguments" + (t ? " as " + t : ""), n);
    if (this.mode === "text" && !i.allowedInText)
      throw new U("Can't use function '" + a + "' in text mode", n);
    if (this.mode === "math" && i.allowedInMath === !1)
      throw new U("Can't use function '" + a + "' in math mode", n);
    var {
      args: s,
      optArgs: l
    } = this.parseArguments(a, i);
    return this.callFunction(a, s, l, n, e);
  }
  /**
   * Call a function handler with a suitable context and arguments.
   */
  callFunction(e, t, n, a, i) {
    var s = {
      funcName: e,
      parser: this,
      token: a,
      breakOnTokenText: i
    }, l = M0[e];
    if (l && l.handler)
      return l.handler(s, t, n);
    throw new U("No function handler for " + e);
  }
  /**
   * Parses the arguments of a function or environment
   */
  parseArguments(e, t) {
    var n = t.numArgs + t.numOptionalArgs;
    if (n === 0)
      return {
        args: [],
        optArgs: []
      };
    for (var a = [], i = [], s = 0; s < n; s++) {
      var l = t.argTypes && t.argTypes[s], o = s < t.numOptionalArgs;
      (t.primitive && l == null || // \sqrt expands into primitive if optional argument doesn't exist
      t.type === "sqrt" && s === 1 && i[0] == null) && (l = "primitive");
      var u = this.parseGroupOfType("argument to '" + e + "'", l, o);
      if (o)
        i.push(u);
      else if (u != null)
        a.push(u);
      else
        throw new U("Null argument, please report this as a bug");
    }
    return {
      args: a,
      optArgs: i
    };
  }
  /**
   * Parses a group when the mode is changing.
   */
  parseGroupOfType(e, t, n) {
    switch (t) {
      case "color":
        return this.parseColorGroup(n);
      case "size":
        return this.parseSizeGroup(n);
      case "url":
        return this.parseUrlGroup(n);
      case "math":
      case "text":
        return this.parseArgumentGroup(n, t);
      case "hbox": {
        var a = this.parseArgumentGroup(n, "text");
        return a != null ? {
          type: "styling",
          mode: a.mode,
          body: [a],
          style: "text"
          // simulate \textstyle
        } : null;
      }
      case "raw": {
        var i = this.parseStringGroup("raw", n);
        return i != null ? {
          type: "raw",
          mode: "text",
          string: i.text
        } : null;
      }
      case "primitive": {
        if (n)
          throw new U("A primitive argument cannot be optional");
        var s = this.parseGroup(e);
        if (s == null)
          throw new U("Expected group as " + e, this.fetch());
        return s;
      }
      case "original":
      case null:
      case void 0:
        return this.parseArgumentGroup(n);
      default:
        throw new U("Unknown group type as " + e, this.fetch());
    }
  }
  /**
   * Discard any space tokens, fetching the next non-space token.
   */
  consumeSpaces() {
    for (; this.fetch().text === " "; )
      this.consume();
  }
  /**
   * Parses a group, essentially returning the string formed by the
   * brace-enclosed tokens plus some position information.
   */
  parseStringGroup(e, t) {
    var n = this.gullet.scanArgument(t);
    if (n == null)
      return null;
    for (var a = "", i; (i = this.fetch()).text !== "EOF"; )
      a += i.text, this.consume();
    return this.consume(), n.text = a, n;
  }
  /**
   * Parses a regex-delimited group: the largest sequence of tokens
   * whose concatenated strings match `regex`. Returns the string
   * formed by the tokens plus some position information.
   */
  parseRegexGroup(e, t) {
    for (var n = this.fetch(), a = n, i = "", s; (s = this.fetch()).text !== "EOF" && e.test(i + s.text); )
      a = s, i += a.text, this.consume();
    if (i === "")
      throw new U("Invalid " + t + ": '" + n.text + "'", n);
    return n.range(a, i);
  }
  /**
   * Parses a color description.
   */
  parseColorGroup(e) {
    var t = this.parseStringGroup("color", e);
    if (t == null)
      return null;
    var n = /^(#[a-f0-9]{3}|#?[a-f0-9]{6}|[a-z]+)$/i.exec(t.text);
    if (!n)
      throw new U("Invalid color: '" + t.text + "'", t);
    var a = n[0];
    return /^[0-9a-f]{6}$/i.test(a) && (a = "#" + a), {
      type: "color-token",
      mode: this.mode,
      color: a
    };
  }
  /**
   * Parses a size specification, consisting of magnitude and unit.
   */
  parseSizeGroup(e) {
    var t, n = !1;
    if (this.gullet.consumeSpaces(), !e && this.gullet.future().text !== "{" ? t = this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/, "size") : t = this.parseStringGroup("size", e), !t)
      return null;
    !e && t.text.length === 0 && (t.text = "0pt", n = !0);
    var a = /([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t.text);
    if (!a)
      throw new U("Invalid size: '" + t.text + "'", t);
    var i = {
      number: +(a[1] + a[2]),
      // sign + magnitude, cast to number
      unit: a[3]
    };
    if (!K1(i))
      throw new U("Invalid unit: '" + i.unit + "'", t);
    return {
      type: "size",
      mode: this.mode,
      value: i,
      isBlank: n
    };
  }
  /**
   * Parses an URL, checking escaped letters and allowed protocols,
   * and setting the catcode of % as an active character (as in \hyperref).
   */
  parseUrlGroup(e) {
    this.gullet.lexer.setCatcode("%", 13), this.gullet.lexer.setCatcode("~", 12);
    var t = this.parseStringGroup("url", e);
    if (this.gullet.lexer.setCatcode("%", 14), this.gullet.lexer.setCatcode("~", 13), t == null)
      return null;
    var n = t.text.replace(/\\([#$%&~_^{}])/g, "$1");
    return {
      type: "url",
      mode: this.mode,
      url: n
    };
  }
  /**
   * Parses an argument with the mode specified.
   */
  parseArgumentGroup(e, t) {
    var n = this.gullet.scanArgument(e);
    if (n == null)
      return null;
    var a = this.mode;
    t && this.switchMode(t), this.gullet.beginGroup();
    var i = this.parseExpression(!1, "EOF");
    this.expect("EOF"), this.gullet.endGroup();
    var s = {
      type: "ordgroup",
      mode: this.mode,
      loc: n.loc,
      body: i
    };
    return t && this.switchMode(a), s;
  }
  /**
   * Parses an ordinary group, which is either a single nucleus (like "x")
   * or an expression in braces (like "{x+y}") or an implicit group, a group
   * that starts at the current position, and ends right before a higher explicit
   * group ends, or at EOF.
   */
  parseGroup(e, t) {
    var n = this.fetch(), a = n.text, i;
    if (a === "{" || a === "\\begingroup") {
      this.consume();
      var s = a === "{" ? "}" : "\\endgroup";
      this.gullet.beginGroup();
      var l = this.parseExpression(!1, s), o = this.fetch();
      this.expect(s), this.gullet.endGroup(), i = {
        type: "ordgroup",
        mode: this.mode,
        loc: rn.range(n, o),
        body: l,
        // A group formed by \begingroup...\endgroup is a semi-simple group
        // which doesn't affect spacing in math mode, i.e., is transparent.
        // https://tex.stackexchange.com/questions/1930/when-should-one-
        // use-begingroup-instead-of-bgroup
        semisimple: a === "\\begingroup" || void 0
      };
    } else if (i = this.parseFunction(t, e) || this.parseSymbol(), i == null && a[0] === "\\" && !Ic.hasOwnProperty(a)) {
      if (this.settings.throwOnError)
        throw new U("Undefined control sequence: " + a, n);
      i = this.formatUnsupportedCmd(a), this.consume();
    }
    return i;
  }
  /**
   * Form ligature-like combinations of characters for text mode.
   * This includes inputs like "--", "---", "``" and "''".
   * The result will simply replace multiple textord nodes with a single
   * character in each value by a single textord node having multiple
   * characters in its value.  The representation is still ASCII source.
   * The group will be modified in place.
   */
  formLigatures(e) {
    for (var t = e.length - 1, n = 0; n < t; ++n) {
      var a = e[n], i = a.text;
      i === "-" && e[n + 1].text === "-" && (n + 1 < t && e[n + 2].text === "-" ? (e.splice(n, 3, {
        type: "textord",
        mode: "text",
        loc: rn.range(a, e[n + 2]),
        text: "---"
      }), t -= 2) : (e.splice(n, 2, {
        type: "textord",
        mode: "text",
        loc: rn.range(a, e[n + 1]),
        text: "--"
      }), t -= 1)), (i === "'" || i === "`") && e[n + 1].text === i && (e.splice(n, 2, {
        type: "textord",
        mode: "text",
        loc: rn.range(a, e[n + 1]),
        text: i + i
      }), t -= 1);
    }
  }
  /**
   * Parse a single symbol out of the string. Here, we handle single character
   * symbols and special functions like \verb.
   */
  parseSymbol() {
    var e = this.fetch(), t = e.text;
    if (/^\\verb[^a-zA-Z]/.test(t)) {
      this.consume();
      var n = t.slice(5), a = n.charAt(0) === "*";
      if (a && (n = n.slice(1)), n.length < 2 || n.charAt(0) !== n.slice(-1))
        throw new U(`\\verb assertion failed --
                    please report what input caused this bug`);
      return n = n.slice(1, -1), {
        type: "verb",
        mode: "text",
        body: n,
        star: a
      };
    }
    Go.hasOwnProperty(t[0]) && !Re[this.mode][t[0]] && (this.settings.strict && this.mode === "math" && this.settings.reportNonstrict("unicodeTextInMathMode", 'Accented Unicode text character "' + t[0] + '" used in math mode', e), t = Go[t[0]] + t.slice(1));
    var i = cm.exec(t);
    i && (t = t.substring(0, i.index), t === "i" ? t = "ı" : t === "j" && (t = "ȷ"));
    var s;
    if (Re[this.mode][t]) {
      this.settings.strict && this.mode === "math" && Js.indexOf(t) >= 0 && this.settings.reportNonstrict("unicodeTextInMathMode", 'Latin-1/Unicode text character "' + t[0] + '" used in math mode', e);
      var l = Re[this.mode][t].group, o = rn.range(e), u;
      if (nd.hasOwnProperty(l)) {
        var h = l;
        u = {
          type: "atom",
          mode: this.mode,
          family: h,
          loc: o,
          text: t
        };
      } else
        u = {
          type: l,
          mode: this.mode,
          loc: o,
          text: t
        };
      s = u;
    } else if (t.charCodeAt(0) >= 128)
      this.settings.strict && (V1(t.charCodeAt(0)) ? this.mode === "math" && this.settings.reportNonstrict("unicodeTextInMathMode", 'Unicode text character "' + t[0] + '" used in math mode', e) : this.settings.reportNonstrict("unknownSymbol", 'Unrecognized Unicode character "' + t[0] + '"' + (" (" + t.charCodeAt(0) + ")"), e)), s = {
        type: "textord",
        mode: "text",
        loc: rn.range(e),
        text: t
      };
    else
      return null;
    if (this.consume(), i)
      for (var m = 0; m < i[0].length; m++) {
        var d = i[0][m];
        if (!fs[d])
          throw new U("Unknown accent ' " + d + "'", e);
        var g = fs[d][this.mode] || fs[d].text;
        if (!g)
          throw new U("Accent " + d + " unsupported in " + this.mode + " mode", e);
        s = {
          type: "accent",
          mode: this.mode,
          loc: rn.range(e),
          label: g,
          isStretchy: !1,
          isShifty: !0,
          // $FlowFixMe
          base: s
        };
      }
    return s;
  }
}
qi.endOfExpression = ["}", "\\endgroup", "\\end", "\\right", "&"];
var Ol = function(e, t) {
  if (!(typeof e == "string" || e instanceof String))
    throw new TypeError("KaTeX can only parse string typed expression");
  var n = new qi(e, t);
  delete n.gullet.macros.current["\\df@tag"];
  var a = n.parse();
  if (delete n.gullet.macros.current["\\current@color"], delete n.gullet.macros.current["\\color"], n.gullet.macros.get("\\df@tag")) {
    if (!t.displayMode)
      throw new U("\\tag works only in display equations");
    a = [{
      type: "tag",
      mode: "text",
      body: a,
      tag: n.subparse([new yn("\\df@tag")])
    }];
  }
  return a;
}, Pl = function(e, t, n) {
  t.textContent = "";
  var a = Li(e, n).toNode();
  t.appendChild(a);
};
typeof document < "u" && document.compatMode !== "CSS1Compat" && (typeof console < "u" && console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."), Pl = function() {
  throw new U("KaTeX doesn't work in quirks mode.");
});
var Rc = function(e, t) {
  var n = Li(e, t).toMarkup();
  return n;
}, Oc = function(e, t) {
  var n = new kl(t);
  return Ol(e, n);
}, Pc = function(e, t, n) {
  if (n.throwOnError || !(e instanceof U))
    throw e;
  var a = F.makeSpan(["katex-error"], [new wn(t)]);
  return a.setAttribute("title", e.toString()), a.setAttribute("style", "color:" + n.errorColor), a;
}, Li = function(e, t) {
  var n = new kl(t);
  try {
    var a = Ol(e, n);
    return xd(a, e, n);
  } catch (i) {
    return Pc(i, e, n);
  }
}, Hc = function(e, t) {
  var n = new kl(t);
  try {
    var a = Ol(e, n);
    return Ad(a, e, n);
  } catch (i) {
    return Pc(i, e, n);
  }
}, Uc = "0.16.22", Gc = {
  Span: fa,
  Anchor: xl,
  SymbolNode: wn,
  SvgNode: m0,
  PathNode: N0,
  LineNode: Qs
}, il = {
  /**
   * Current KaTeX version
   */
  version: Uc,
  /**
   * Renders the given LaTeX into an HTML+MathML combination, and adds
   * it as a child to the specified DOM node.
   */
  render: Pl,
  /**
   * Renders the given LaTeX into an HTML+MathML combination string,
   * for sending to the client.
   */
  renderToString: Rc,
  /**
   * KaTeX error, usually during parsing.
   */
  ParseError: U,
  /**
   * The schema of Settings
   */
  SETTINGS_SCHEMA: Zr,
  /**
   * Parses the given LaTeX into KaTeX's internal parse tree structure,
   * without rendering to HTML or MathML.
   *
   * NOTE: This method is not currently recommended for public use.
   * The internal tree representation is unstable and is very likely
   * to change. Use at your own risk.
   */
  __parse: Oc,
  /**
   * Renders the given LaTeX into an HTML+MathML internal DOM tree
   * representation, without flattening that representation to a string.
   *
   * NOTE: This method is not currently recommended for public use.
   * The internal tree representation is unstable and is very likely
   * to change. Use at your own risk.
   */
  __renderToDomTree: Li,
  /**
   * Renders the given LaTeX into an HTML internal DOM tree representation,
   * without MathML and without flattening that representation to a string.
   *
   * NOTE: This method is not currently recommended for public use.
   * The internal tree representation is unstable and is very likely
   * to change. Use at your own risk.
   */
  __renderToHTMLTree: Hc,
  /**
   * extends internal font metrics object with a new object
   * each key in the new object represents a font name
  */
  __setFontMetrics: W1,
  /**
   * adds a new symbol to builtin symbols table
   */
  __defineSymbol: c,
  /**
   * adds a new function to builtin function list,
   * which directly produce parse tree elements
   * and have their own html/mathml builders
   */
  __defineFunction: Y,
  /**
   * adds a new macro to builtin macro list
   */
  __defineMacro: _,
  /**
   * Expose the dom tree node types, which can be useful for type checking nodes.
   *
   * NOTE: These methods are not currently recommended for public use.
   * The internal tree representation is unstable and is very likely
   * to change. Use at your own risk.
   */
  __domTree: Gc
};
const Sg = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  ParseError: U,
  SETTINGS_SCHEMA: Zr,
  __defineFunction: Y,
  __defineMacro: _,
  __defineSymbol: c,
  __domTree: Gc,
  __parse: Oc,
  __renderToDomTree: Li,
  __renderToHTMLTree: Hc,
  __setFontMetrics: W1,
  default: il,
  get render() {
    return Pl;
  },
  renderToString: Rc,
  version: Uc
}, Symbol.toStringTag, { value: "Module" }));
var pm = function(e, t, n) {
  for (var a = n, i = 0, s = e.length; a < t.length; ) {
    var l = t[a];
    if (i <= 0 && t.slice(a, a + s) === e)
      return a;
    l === "\\" ? a++ : l === "{" ? i++ : l === "}" && i--, a++;
  }
  return -1;
}, gm = function(e) {
  return e.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&");
}, _m = /^\\begin{/, vm = function(e, t) {
  for (var n, a = [], i = new RegExp("(" + t.map((u) => gm(u.left)).join("|") + ")"); n = e.search(i), n !== -1; ) {
    n > 0 && (a.push({
      type: "text",
      data: e.slice(0, n)
    }), e = e.slice(n));
    var s = t.findIndex((u) => e.startsWith(u.left));
    if (n = pm(t[s].right, e, t[s].left.length), n === -1)
      break;
    var l = e.slice(0, n + t[s].right.length), o = _m.test(l) ? l : e.slice(t[s].left.length, n);
    a.push({
      type: "math",
      data: o,
      rawData: l,
      display: t[s].display
    }), e = e.slice(n + t[s].right.length);
  }
  return e !== "" && a.push({
    type: "text",
    data: e
  }), a;
}, bm = function(e, t) {
  var n = vm(e, t.delimiters);
  if (n.length === 1 && n[0].type === "text")
    return null;
  for (var a = document.createDocumentFragment(), i = 0; i < n.length; i++)
    if (n[i].type === "text")
      a.appendChild(document.createTextNode(n[i].data));
    else {
      var s = document.createElement("span"), l = n[i].data;
      t.displayMode = n[i].display;
      try {
        t.preProcess && (l = t.preProcess(l)), il.render(l, s, t);
      } catch (o) {
        if (!(o instanceof il.ParseError))
          throw o;
        t.errorCallback("KaTeX auto-render: Failed to parse `" + n[i].data + "` with ", o), a.appendChild(document.createTextNode(n[i].rawData));
        continue;
      }
      a.appendChild(s);
    }
  return a;
}, ym = function r(e, t) {
  for (var n = 0; n < e.childNodes.length; n++) {
    var a = e.childNodes[n];
    if (a.nodeType === 3) {
      for (var i = a.textContent, s = a.nextSibling, l = 0; s && s.nodeType === Node.TEXT_NODE; )
        i += s.textContent, s = s.nextSibling, l++;
      var o = bm(i, t);
      if (o) {
        for (var u = 0; u < l; u++)
          a.nextSibling.remove();
        n += o.childNodes.length - 1, e.replaceChild(o, a);
      } else
        n += l;
    } else a.nodeType === 1 && function() {
      var h = " " + a.className + " ", m = t.ignoredTags.indexOf(a.nodeName.toLowerCase()) === -1 && t.ignoredClasses.every((d) => h.indexOf(" " + d + " ") === -1);
      m && r(a, t);
    }();
  }
}, wm = function(e, t) {
  if (!e)
    throw new Error("No element provided to render");
  var n = {};
  for (var a in t)
    t.hasOwnProperty(a) && (n[a] = t[a]);
  n.delimiters = n.delimiters || [
    {
      left: "$$",
      right: "$$",
      display: !0
    },
    {
      left: "\\(",
      right: "\\)",
      display: !1
    },
    // LaTeX uses $…$, but it ruins the display of normal `$` in text:
    // {left: "$", right: "$", display: false},
    // $ must come after $$
    // Render AMS environments even if outside $$…$$ delimiters.
    {
      left: "\\begin{equation}",
      right: "\\end{equation}",
      display: !0
    },
    {
      left: "\\begin{align}",
      right: "\\end{align}",
      display: !0
    },
    {
      left: "\\begin{alignat}",
      right: "\\end{alignat}",
      display: !0
    },
    {
      left: "\\begin{gather}",
      right: "\\end{gather}",
      display: !0
    },
    {
      left: "\\begin{CD}",
      right: "\\end{CD}",
      display: !0
    },
    {
      left: "\\[",
      right: "\\]",
      display: !0
    }
  ], n.ignoredTags = n.ignoredTags || ["script", "noscript", "style", "textarea", "pre", "code", "option"], n.ignoredClasses = n.ignoredClasses || [], n.errorCallback = n.errorCallback || console.error, n.macros = n.macros || {}, ym(e, n);
};
function Hl() {
  return {
    async: !1,
    breaks: !1,
    extensions: null,
    gfm: !0,
    hooks: null,
    pedantic: !1,
    renderer: null,
    silent: !1,
    tokenizer: null,
    walkTokens: null
  };
}
let nr = Hl();
function jc(r) {
  nr = r;
}
const Vc = /[&<>"']/, km = new RegExp(Vc.source, "g"), Wc = /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, Sm = new RegExp(Wc.source, "g"), Dm = {
  "&": "&amp;",
  "<": "&lt;",
  ">": "&gt;",
  '"': "&quot;",
  "'": "&#39;"
}, jo = (r) => Dm[r];
function an(r, e) {
  if (e) {
    if (Vc.test(r))
      return r.replace(km, jo);
  } else if (Wc.test(r))
    return r.replace(Sm, jo);
  return r;
}
const xm = /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;
function Am(r) {
  return r.replace(xm, (e, t) => (t = t.toLowerCase(), t === "colon" ? ":" : t.charAt(0) === "#" ? t.charAt(1) === "x" ? String.fromCharCode(parseInt(t.substring(2), 16)) : String.fromCharCode(+t.substring(1)) : ""));
}
const Em = /(^|[^\[])\^/g;
function ze(r, e) {
  let t = typeof r == "string" ? r : r.source;
  e = e || "";
  const n = {
    replace: (a, i) => {
      let s = typeof i == "string" ? i : i.source;
      return s = s.replace(Em, "$1"), t = t.replace(a, s), n;
    },
    getRegex: () => new RegExp(t, e)
  };
  return n;
}
function Vo(r) {
  try {
    r = encodeURI(r).replace(/%25/g, "%");
  } catch {
    return null;
  }
  return r;
}
const Jr = { exec: () => null };
function Wo(r, e) {
  const t = r.replace(/\|/g, (i, s, l) => {
    let o = !1, u = s;
    for (; --u >= 0 && l[u] === "\\"; )
      o = !o;
    return o ? "|" : " |";
  }), n = t.split(/ \|/);
  let a = 0;
  if (n[0].trim() || n.shift(), n.length > 0 && !n[n.length - 1].trim() && n.pop(), e)
    if (n.length > e)
      n.splice(e);
    else
      for (; n.length < e; )
        n.push("");
  for (; a < n.length; a++)
    n[a] = n[a].trim().replace(/\\\|/g, "|");
  return n;
}
function Ba(r, e, t) {
  const n = r.length;
  if (n === 0)
    return "";
  let a = 0;
  for (; a < n && r.charAt(n - a - 1) === e; )
    a++;
  return r.slice(0, n - a);
}
function Cm(r, e) {
  if (r.indexOf(e[1]) === -1)
    return -1;
  let t = 0;
  for (let n = 0; n < r.length; n++)
    if (r[n] === "\\")
      n++;
    else if (r[n] === e[0])
      t++;
    else if (r[n] === e[1] && (t--, t < 0))
      return n;
  return -1;
}
function Ko(r, e, t, n) {
  const a = e.href, i = e.title ? an(e.title) : null, s = r[1].replace(/\\([\[\]])/g, "$1");
  if (r[0].charAt(0) !== "!") {
    n.state.inLink = !0;
    const l = {
      type: "link",
      raw: t,
      href: a,
      title: i,
      text: s,
      tokens: n.inlineTokens(s)
    };
    return n.state.inLink = !1, l;
  }
  return {
    type: "image",
    raw: t,
    href: a,
    title: i,
    text: an(s)
  };
}
function $m(r, e) {
  const t = r.match(/^(\s+)(?:```)/);
  if (t === null)
    return e;
  const n = t[1];
  return e.split(`
`).map((a) => {
    const i = a.match(/^\s+/);
    if (i === null)
      return a;
    const [s] = i;
    return s.length >= n.length ? a.slice(n.length) : a;
  }).join(`
`);
}
class Di {
  // set by the lexer
  constructor(e) {
    ce(this, "options");
    ce(this, "rules");
    // set by the lexer
    ce(this, "lexer");
    this.options = e || nr;
  }
  space(e) {
    const t = this.rules.block.newline.exec(e);
    if (t && t[0].length > 0)
      return {
        type: "space",
        raw: t[0]
      };
  }
  code(e) {
    const t = this.rules.block.code.exec(e);
    if (t) {
      const n = t[0].replace(/^ {1,4}/gm, "");
      return {
        type: "code",
        raw: t[0],
        codeBlockStyle: "indented",
        text: this.options.pedantic ? n : Ba(n, `
`)
      };
    }
  }
  fences(e) {
    const t = this.rules.block.fences.exec(e);
    if (t) {
      const n = t[0], a = $m(n, t[3] || "");
      return {
        type: "code",
        raw: n,
        lang: t[2] ? t[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t[2],
        text: a
      };
    }
  }
  heading(e) {
    const t = this.rules.block.heading.exec(e);
    if (t) {
      let n = t[2].trim();
      if (/#$/.test(n)) {
        const a = Ba(n, "#");
        (this.options.pedantic || !a || / $/.test(a)) && (n = a.trim());
      }
      return {
        type: "heading",
        raw: t[0],
        depth: t[1].length,
        text: n,
        tokens: this.lexer.inline(n)
      };
    }
  }
  hr(e) {
    const t = this.rules.block.hr.exec(e);
    if (t)
      return {
        type: "hr",
        raw: t[0]
      };
  }
  blockquote(e) {
    const t = this.rules.block.blockquote.exec(e);
    if (t) {
      let n = t[0].replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g, `
    $1`);
      n = Ba(n.replace(/^ *>[ \t]?/gm, ""), `
`);
      const a = this.lexer.state.top;
      this.lexer.state.top = !0;
      const i = this.lexer.blockTokens(n);
      return this.lexer.state.top = a, {
        type: "blockquote",
        raw: t[0],
        tokens: i,
        text: n
      };
    }
  }
  list(e) {
    let t = this.rules.block.list.exec(e);
    if (t) {
      let n = t[1].trim();
      const a = n.length > 1, i = {
        type: "list",
        raw: "",
        ordered: a,
        start: a ? +n.slice(0, -1) : "",
        loose: !1,
        items: []
      };
      n = a ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = a ? n : "[*+-]");
      const s = new RegExp(`^( {0,3}${n})((?:[	 ][^\\n]*)?(?:\\n|$))`);
      let l = "", o = "", u = !1;
      for (; e; ) {
        let h = !1;
        if (!(t = s.exec(e)) || this.rules.block.hr.test(e))
          break;
        l = t[0], e = e.substring(l.length);
        let m = t[2].split(`
`, 1)[0].replace(/^\t+/, (x) => " ".repeat(3 * x.length)), d = e.split(`
`, 1)[0], g = 0;
        this.options.pedantic ? (g = 2, o = m.trimStart()) : (g = t[2].search(/[^ ]/), g = g > 4 ? 1 : g, o = m.slice(g), g += t[1].length);
        let b = !1;
        if (!m && /^ *$/.test(d) && (l += d + `
`, e = e.substring(d.length + 1), h = !0), !h) {
          const x = new RegExp(`^ {0,${Math.min(3, g - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ 	][^\\n]*)?(?:\\n|$))`), k = new RegExp(`^ {0,${Math.min(3, g - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), y = new RegExp(`^ {0,${Math.min(3, g - 1)}}(?:\`\`\`|~~~)`), A = new RegExp(`^ {0,${Math.min(3, g - 1)}}#`);
          for (; e; ) {
            const $ = e.split(`
`, 1)[0];
            if (d = $, this.options.pedantic && (d = d.replace(/^ {1,4}(?=( {4})*[^ ])/g, "  ")), y.test(d) || A.test(d) || x.test(d) || k.test(e))
              break;
            if (d.search(/[^ ]/) >= g || !d.trim())
              o += `
` + d.slice(g);
            else {
              if (b || m.search(/[^ ]/) >= 4 || y.test(m) || A.test(m) || k.test(m))
                break;
              o += `
` + d;
            }
            !b && !d.trim() && (b = !0), l += $ + `
`, e = e.substring($.length + 1), m = d.slice(g);
          }
        }
        i.loose || (u ? i.loose = !0 : /\n *\n *$/.test(l) && (u = !0));
        let v = null, w;
        this.options.gfm && (v = /^\[[ xX]\] /.exec(o), v && (w = v[0] !== "[ ] ", o = o.replace(/^\[[ xX]\] +/, ""))), i.items.push({
          type: "list_item",
          raw: l,
          task: !!v,
          checked: w,
          loose: !1,
          text: o,
          tokens: []
        }), i.raw += l;
      }
      i.items[i.items.length - 1].raw = l.trimEnd(), i.items[i.items.length - 1].text = o.trimEnd(), i.raw = i.raw.trimEnd();
      for (let h = 0; h < i.items.length; h++)
        if (this.lexer.state.top = !1, i.items[h].tokens = this.lexer.blockTokens(i.items[h].text, []), !i.loose) {
          const m = i.items[h].tokens.filter((g) => g.type === "space"), d = m.length > 0 && m.some((g) => /\n.*\n/.test(g.raw));
          i.loose = d;
        }
      if (i.loose)
        for (let h = 0; h < i.items.length; h++)
          i.items[h].loose = !0;
      return i;
    }
  }
  html(e) {
    const t = this.rules.block.html.exec(e);
    if (t)
      return {
        type: "html",
        block: !0,
        raw: t[0],
        pre: t[1] === "pre" || t[1] === "script" || t[1] === "style",
        text: t[0]
      };
  }
  def(e) {
    const t = this.rules.block.def.exec(e);
    if (t) {
      const n = t[1].toLowerCase().replace(/\s+/g, " "), a = t[2] ? t[2].replace(/^<(.*)>$/, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", i = t[3] ? t[3].substring(1, t[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : t[3];
      return {
        type: "def",
        tag: n,
        raw: t[0],
        href: a,
        title: i
      };
    }
  }
  table(e) {
    const t = this.rules.block.table.exec(e);
    if (!t || !/[:|]/.test(t[2]))
      return;
    const n = Wo(t[1]), a = t[2].replace(/^\||\| *$/g, "").split("|"), i = t[3] && t[3].trim() ? t[3].replace(/\n[ \t]*$/, "").split(`
`) : [], s = {
      type: "table",
      raw: t[0],
      header: [],
      align: [],
      rows: []
    };
    if (n.length === a.length) {
      for (const l of a)
        /^ *-+: *$/.test(l) ? s.align.push("right") : /^ *:-+: *$/.test(l) ? s.align.push("center") : /^ *:-+ *$/.test(l) ? s.align.push("left") : s.align.push(null);
      for (const l of n)
        s.header.push({
          text: l,
          tokens: this.lexer.inline(l)
        });
      for (const l of i)
        s.rows.push(Wo(l, s.header.length).map((o) => ({
          text: o,
          tokens: this.lexer.inline(o)
        })));
      return s;
    }
  }
  lheading(e) {
    const t = this.rules.block.lheading.exec(e);
    if (t)
      return {
        type: "heading",
        raw: t[0],
        depth: t[2].charAt(0) === "=" ? 1 : 2,
        text: t[1],
        tokens: this.lexer.inline(t[1])
      };
  }
  paragraph(e) {
    const t = this.rules.block.paragraph.exec(e);
    if (t) {
      const n = t[1].charAt(t[1].length - 1) === `
` ? t[1].slice(0, -1) : t[1];
      return {
        type: "paragraph",
        raw: t[0],
        text: n,
        tokens: this.lexer.inline(n)
      };
    }
  }
  text(e) {
    const t = this.rules.block.text.exec(e);
    if (t)
      return {
        type: "text",
        raw: t[0],
        text: t[0],
        tokens: this.lexer.inline(t[0])
      };
  }
  escape(e) {
    const t = this.rules.inline.escape.exec(e);
    if (t)
      return {
        type: "escape",
        raw: t[0],
        text: an(t[1])
      };
  }
  tag(e) {
    const t = this.rules.inline.tag.exec(e);
    if (t)
      return !this.lexer.state.inLink && /^<a /i.test(t[0]) ? this.lexer.state.inLink = !0 : this.lexer.state.inLink && /^<\/a>/i.test(t[0]) && (this.lexer.state.inLink = !1), !this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(t[0]) ? this.lexer.state.inRawBlock = !0 : this.lexer.state.inRawBlock && /^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0]) && (this.lexer.state.inRawBlock = !1), {
        type: "html",
        raw: t[0],
        inLink: this.lexer.state.inLink,
        inRawBlock: this.lexer.state.inRawBlock,
        block: !1,
        text: t[0]
      };
  }
  link(e) {
    const t = this.rules.inline.link.exec(e);
    if (t) {
      const n = t[2].trim();
      if (!this.options.pedantic && /^</.test(n)) {
        if (!/>$/.test(n))
          return;
        const s = Ba(n.slice(0, -1), "\\");
        if ((n.length - s.length) % 2 === 0)
          return;
      } else {
        const s = Cm(t[2], "()");
        if (s > -1) {
          const o = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + s;
          t[2] = t[2].substring(0, s), t[0] = t[0].substring(0, o).trim(), t[3] = "";
        }
      }
      let a = t[2], i = "";
      if (this.options.pedantic) {
        const s = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(a);
        s && (a = s[1], i = s[3]);
      } else
        i = t[3] ? t[3].slice(1, -1) : "";
      return a = a.trim(), /^</.test(a) && (this.options.pedantic && !/>$/.test(n) ? a = a.slice(1) : a = a.slice(1, -1)), Ko(t, {
        href: a && a.replace(this.rules.inline.anyPunctuation, "$1"),
        title: i && i.replace(this.rules.inline.anyPunctuation, "$1")
      }, t[0], this.lexer);
    }
  }
  reflink(e, t) {
    let n;
    if ((n = this.rules.inline.reflink.exec(e)) || (n = this.rules.inline.nolink.exec(e))) {
      const a = (n[2] || n[1]).replace(/\s+/g, " "), i = t[a.toLowerCase()];
      if (!i) {
        const s = n[0].charAt(0);
        return {
          type: "text",
          raw: s,
          text: s
        };
      }
      return Ko(n, i, n[0], this.lexer);
    }
  }
  emStrong(e, t, n = "") {
    let a = this.rules.inline.emStrongLDelim.exec(e);
    if (!a || a[3] && n.match(/[\p{L}\p{N}]/u))
      return;
    if (!(a[1] || a[2] || "") || !n || this.rules.inline.punctuation.exec(n)) {
      const s = [...a[0]].length - 1;
      let l, o, u = s, h = 0;
      const m = a[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
      for (m.lastIndex = 0, t = t.slice(-1 * e.length + s); (a = m.exec(t)) != null; ) {
        if (l = a[1] || a[2] || a[3] || a[4] || a[5] || a[6], !l)
          continue;
        if (o = [...l].length, a[3] || a[4]) {
          u += o;
          continue;
        } else if ((a[5] || a[6]) && s % 3 && !((s + o) % 3)) {
          h += o;
          continue;
        }
        if (u -= o, u > 0)
          continue;
        o = Math.min(o, o + u + h);
        const d = [...a[0]][0].length, g = e.slice(0, s + a.index + d + o);
        if (Math.min(s, o) % 2) {
          const v = g.slice(1, -1);
          return {
            type: "em",
            raw: g,
            text: v,
            tokens: this.lexer.inlineTokens(v)
          };
        }
        const b = g.slice(2, -2);
        return {
          type: "strong",
          raw: g,
          text: b,
          tokens: this.lexer.inlineTokens(b)
        };
      }
    }
  }
  codespan(e) {
    const t = this.rules.inline.code.exec(e);
    if (t) {
      let n = t[2].replace(/\n/g, " ");
      const a = /[^ ]/.test(n), i = /^ /.test(n) && / $/.test(n);
      return a && i && (n = n.substring(1, n.length - 1)), n = an(n, !0), {
        type: "codespan",
        raw: t[0],
        text: n
      };
    }
  }
  br(e) {
    const t = this.rules.inline.br.exec(e);
    if (t)
      return {
        type: "br",
        raw: t[0]
      };
  }
  del(e) {
    const t = this.rules.inline.del.exec(e);
    if (t)
      return {
        type: "del",
        raw: t[0],
        text: t[2],
        tokens: this.lexer.inlineTokens(t[2])
      };
  }
  autolink(e) {
    const t = this.rules.inline.autolink.exec(e);
    if (t) {
      let n, a;
      return t[2] === "@" ? (n = an(t[1]), a = "mailto:" + n) : (n = an(t[1]), a = n), {
        type: "link",
        raw: t[0],
        text: n,
        href: a,
        tokens: [
          {
            type: "text",
            raw: n,
            text: n
          }
        ]
      };
    }
  }
  url(e) {
    var n;
    let t;
    if (t = this.rules.inline.url.exec(e)) {
      let a, i;
      if (t[2] === "@")
        a = an(t[0]), i = "mailto:" + a;
      else {
        let s;
        do
          s = t[0], t[0] = ((n = this.rules.inline._backpedal.exec(t[0])) == null ? void 0 : n[0]) ?? "";
        while (s !== t[0]);
        a = an(t[0]), t[1] === "www." ? i = "http://" + t[0] : i = t[0];
      }
      return {
        type: "link",
        raw: t[0],
        text: a,
        href: i,
        tokens: [
          {
            type: "text",
            raw: a,
            text: a
          }
        ]
      };
    }
  }
  inlineText(e) {
    const t = this.rules.inline.text.exec(e);
    if (t) {
      let n;
      return this.lexer.state.inRawBlock ? n = t[0] : n = an(t[0]), {
        type: "text",
        raw: t[0],
        text: n
      };
    }
  }
}
const Tm = /^(?: *(?:\n|$))+/, Fm = /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/, Mm = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, ma = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, zm = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, Kc = /(?:[*+-]|\d{1,9}[.)])/, Yc = ze(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g, Kc).replace(/blockCode/g, / {4}/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).getRegex(), Ul = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Bm = /^[^\n]+/, Gl = /(?!\s*\])(?:\\.|[^\[\]\\])+/, Nm = ze(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label", Gl).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), qm = ze(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, Kc).getRegex(), Ii = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", jl = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Lm = ze("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))", "i").replace("comment", jl).replace("tag", Ii).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), Xc = ze(Ul).replace("hr", ma).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Ii).getRegex(), Im = ze(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", Xc).getRegex(), Vl = {
  blockquote: Im,
  code: Fm,
  def: Nm,
  fences: Mm,
  heading: zm,
  hr: ma,
  html: Lm,
  lheading: Yc,
  list: qm,
  newline: Tm,
  paragraph: Xc,
  table: Jr,
  text: Bm
}, Yo = ze("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", ma).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", " {4}[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Ii).getRegex(), Rm = {
  ...Vl,
  table: Yo,
  paragraph: ze(Ul).replace("hr", ma).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Yo).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Ii).getRegex()
}, Om = {
  ...Vl,
  html: ze(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", jl).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
  def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
  heading: /^(#{1,6})(.*)(?:\n+|$)/,
  fences: Jr,
  // fences not supported
  lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
  paragraph: ze(Ul).replace("hr", ma).replace("heading", ` *#{1,6} *[^
]`).replace("lheading", Yc).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
}, Zc = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Pm = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Qc = /^( {2,}|\\)\n(?!\s*$)/, Hm = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, pa = "\\p{P}\\p{S}", Um = ze(/^((?![*_])[\spunctuation])/, "u").replace(/punctuation/g, pa).getRegex(), Gm = /\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g, jm = ze(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/, "u").replace(/punct/g, pa).getRegex(), Vm = ze("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])", "gu").replace(/punct/g, pa).getRegex(), Wm = ze("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])", "gu").replace(/punct/g, pa).getRegex(), Km = ze(/\\([punct])/, "gu").replace(/punct/g, pa).getRegex(), Ym = ze(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), Xm = ze(jl).replace("(?:-->|$)", "-->").getRegex(), Zm = ze("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", Xm).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), xi = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, Qm = ze(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label", xi).replace("href", /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), Jc = ze(/^!?\[(label)\]\[(ref)\]/).replace("label", xi).replace("ref", Gl).getRegex(), eh = ze(/^!?\[(ref)\](?:\[\])?/).replace("ref", Gl).getRegex(), Jm = ze("reflink|nolink(?!\\()", "g").replace("reflink", Jc).replace("nolink", eh).getRegex(), Wl = {
  _backpedal: Jr,
  // only used for GFM url
  anyPunctuation: Km,
  autolink: Ym,
  blockSkip: Gm,
  br: Qc,
  code: Pm,
  del: Jr,
  emStrongLDelim: jm,
  emStrongRDelimAst: Vm,
  emStrongRDelimUnd: Wm,
  escape: Zc,
  link: Qm,
  nolink: eh,
  punctuation: Um,
  reflink: Jc,
  reflinkSearch: Jm,
  tag: Zm,
  text: Hm,
  url: Jr
}, e4 = {
  ...Wl,
  link: ze(/^!?\[(label)\]\((.*?)\)/).replace("label", xi).getRegex(),
  reflink: ze(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", xi).getRegex()
}, sl = {
  ...Wl,
  escape: ze(Zc).replace("])", "~|])").getRegex(),
  url: ze(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, "i").replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
  _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
  del: /^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,
  text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/
}, t4 = {
  ...sl,
  br: ze(Qc).replace("{2,}", "*").getRegex(),
  text: ze(sl.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
}, Na = {
  normal: Vl,
  gfm: Rm,
  pedantic: Om
}, zr = {
  normal: Wl,
  gfm: sl,
  breaks: t4,
  pedantic: e4
};
class Gn {
  constructor(e) {
    ce(this, "tokens");
    ce(this, "options");
    ce(this, "state");
    ce(this, "tokenizer");
    ce(this, "inlineQueue");
    this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || nr, this.options.tokenizer = this.options.tokenizer || new Di(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
      inLink: !1,
      inRawBlock: !1,
      top: !0
    };
    const t = {
      block: Na.normal,
      inline: zr.normal
    };
    this.options.pedantic ? (t.block = Na.pedantic, t.inline = zr.pedantic) : this.options.gfm && (t.block = Na.gfm, this.options.breaks ? t.inline = zr.breaks : t.inline = zr.gfm), this.tokenizer.rules = t;
  }
  /**
   * Expose Rules
   */
  static get rules() {
    return {
      block: Na,
      inline: zr
    };
  }
  /**
   * Static Lex Method
   */
  static lex(e, t) {
    return new Gn(t).lex(e);
  }
  /**
   * Static Lex Inline Method
   */
  static lexInline(e, t) {
    return new Gn(t).inlineTokens(e);
  }
  /**
   * Preprocessing
   */
  lex(e) {
    e = e.replace(/\r\n|\r/g, `
`), this.blockTokens(e, this.tokens);
    for (let t = 0; t < this.inlineQueue.length; t++) {
      const n = this.inlineQueue[t];
      this.inlineTokens(n.src, n.tokens);
    }
    return this.inlineQueue = [], this.tokens;
  }
  blockTokens(e, t = []) {
    this.options.pedantic ? e = e.replace(/\t/g, "    ").replace(/^ +$/gm, "") : e = e.replace(/^( *)(\t+)/gm, (l, o, u) => o + "    ".repeat(u.length));
    let n, a, i, s;
    for (; e; )
      if (!(this.options.extensions && this.options.extensions.block && this.options.extensions.block.some((l) => (n = l.call({ lexer: this }, e, t)) ? (e = e.substring(n.raw.length), t.push(n), !0) : !1))) {
        if (n = this.tokenizer.space(e)) {
          e = e.substring(n.raw.length), n.raw.length === 1 && t.length > 0 ? t[t.length - 1].raw += `
` : t.push(n);
          continue;
        }
        if (n = this.tokenizer.code(e)) {
          e = e.substring(n.raw.length), a = t[t.length - 1], a && (a.type === "paragraph" || a.type === "text") ? (a.raw += `
` + n.raw, a.text += `
` + n.text, this.inlineQueue[this.inlineQueue.length - 1].src = a.text) : t.push(n);
          continue;
        }
        if (n = this.tokenizer.fences(e)) {
          e = e.substring(n.raw.length), t.push(n);
          continue;
        }
        if (n = this.tokenizer.heading(e)) {
          e = e.substring(n.raw.length), t.push(n);
          continue;
        }
        if (n = this.tokenizer.hr(e)) {
          e = e.substring(n.raw.length), t.push(n);
          continue;
        }
        if (n = this.tokenizer.blockquote(e)) {
          e = e.substring(n.raw.length), t.push(n);
          continue;
        }
        if (n = this.tokenizer.list(e)) {
          e = e.substring(n.raw.length), t.push(n);
          continue;
        }
        if (n = this.tokenizer.html(e)) {
          e = e.substring(n.raw.length), t.push(n);
          continue;
        }
        if (n = this.tokenizer.def(e)) {
          e = e.substring(n.raw.length), a = t[t.length - 1], a && (a.type === "paragraph" || a.type === "text") ? (a.raw += `
` + n.raw, a.text += `
` + n.raw, this.inlineQueue[this.inlineQueue.length - 1].src = a.text) : this.tokens.links[n.tag] || (this.tokens.links[n.tag] = {
            href: n.href,
            title: n.title
          });
          continue;
        }
        if (n = this.tokenizer.table(e)) {
          e = e.substring(n.raw.length), t.push(n);
          continue;
        }
        if (n = this.tokenizer.lheading(e)) {
          e = e.substring(n.raw.length), t.push(n);
          continue;
        }
        if (i = e, this.options.extensions && this.options.extensions.startBlock) {
          let l = 1 / 0;
          const o = e.slice(1);
          let u;
          this.options.extensions.startBlock.forEach((h) => {
            u = h.call({ lexer: this }, o), typeof u == "number" && u >= 0 && (l = Math.min(l, u));
          }), l < 1 / 0 && l >= 0 && (i = e.substring(0, l + 1));
        }
        if (this.state.top && (n = this.tokenizer.paragraph(i))) {
          a = t[t.length - 1], s && a.type === "paragraph" ? (a.raw += `
` + n.raw, a.text += `
` + n.text, this.inlineQueue.pop(), this.inlineQueue[this.inlineQueue.length - 1].src = a.text) : t.push(n), s = i.length !== e.length, e = e.substring(n.raw.length);
          continue;
        }
        if (n = this.tokenizer.text(e)) {
          e = e.substring(n.raw.length), a = t[t.length - 1], a && a.type === "text" ? (a.raw += `
` + n.raw, a.text += `
` + n.text, this.inlineQueue.pop(), this.inlineQueue[this.inlineQueue.length - 1].src = a.text) : t.push(n);
          continue;
        }
        if (e) {
          const l = "Infinite loop on byte: " + e.charCodeAt(0);
          if (this.options.silent) {
            console.error(l);
            break;
          } else
            throw new Error(l);
        }
      }
    return this.state.top = !0, t;
  }
  inline(e, t = []) {
    return this.inlineQueue.push({ src: e, tokens: t }), t;
  }
  /**
   * Lexing/Compiling
   */
  inlineTokens(e, t = []) {
    let n, a, i, s = e, l, o, u;
    if (this.tokens.links) {
      const h = Object.keys(this.tokens.links);
      if (h.length > 0)
        for (; (l = this.tokenizer.rules.inline.reflinkSearch.exec(s)) != null; )
          h.includes(l[0].slice(l[0].lastIndexOf("[") + 1, -1)) && (s = s.slice(0, l.index) + "[" + "a".repeat(l[0].length - 2) + "]" + s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
    }
    for (; (l = this.tokenizer.rules.inline.blockSkip.exec(s)) != null; )
      s = s.slice(0, l.index) + "[" + "a".repeat(l[0].length - 2) + "]" + s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
    for (; (l = this.tokenizer.rules.inline.anyPunctuation.exec(s)) != null; )
      s = s.slice(0, l.index) + "++" + s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
    for (; e; )
      if (o || (u = ""), o = !1, !(this.options.extensions && this.options.extensions.inline && this.options.extensions.inline.some((h) => (n = h.call({ lexer: this }, e, t)) ? (e = e.substring(n.raw.length), t.push(n), !0) : !1))) {
        if (n = this.tokenizer.escape(e)) {
          e = e.substring(n.raw.length), t.push(n);
          continue;
        }
        if (n = this.tokenizer.tag(e)) {
          e = e.substring(n.raw.length), a = t[t.length - 1], a && n.type === "text" && a.type === "text" ? (a.raw += n.raw, a.text += n.text) : t.push(n);
          continue;
        }
        if (n = this.tokenizer.link(e)) {
          e = e.substring(n.raw.length), t.push(n);
          continue;
        }
        if (n = this.tokenizer.reflink(e, this.tokens.links)) {
          e = e.substring(n.raw.length), a = t[t.length - 1], a && n.type === "text" && a.type === "text" ? (a.raw += n.raw, a.text += n.text) : t.push(n);
          continue;
        }
        if (n = this.tokenizer.emStrong(e, s, u)) {
          e = e.substring(n.raw.length), t.push(n);
          continue;
        }
        if (n = this.tokenizer.codespan(e)) {
          e = e.substring(n.raw.length), t.push(n);
          continue;
        }
        if (n = this.tokenizer.br(e)) {
          e = e.substring(n.raw.length), t.push(n);
          continue;
        }
        if (n = this.tokenizer.del(e)) {
          e = e.substring(n.raw.length), t.push(n);
          continue;
        }
        if (n = this.tokenizer.autolink(e)) {
          e = e.substring(n.raw.length), t.push(n);
          continue;
        }
        if (!this.state.inLink && (n = this.tokenizer.url(e))) {
          e = e.substring(n.raw.length), t.push(n);
          continue;
        }
        if (i = e, this.options.extensions && this.options.extensions.startInline) {
          let h = 1 / 0;
          const m = e.slice(1);
          let d;
          this.options.extensions.startInline.forEach((g) => {
            d = g.call({ lexer: this }, m), typeof d == "number" && d >= 0 && (h = Math.min(h, d));
          }), h < 1 / 0 && h >= 0 && (i = e.substring(0, h + 1));
        }
        if (n = this.tokenizer.inlineText(i)) {
          e = e.substring(n.raw.length), n.raw.slice(-1) !== "_" && (u = n.raw.slice(-1)), o = !0, a = t[t.length - 1], a && a.type === "text" ? (a.raw += n.raw, a.text += n.text) : t.push(n);
          continue;
        }
        if (e) {
          const h = "Infinite loop on byte: " + e.charCodeAt(0);
          if (this.options.silent) {
            console.error(h);
            break;
          } else
            throw new Error(h);
        }
      }
    return t;
  }
}
class Ai {
  constructor(e) {
    ce(this, "options");
    this.options = e || nr;
  }
  code(e, t, n) {
    var i;
    const a = (i = (t || "").match(/^\S*/)) == null ? void 0 : i[0];
    return e = e.replace(/\n$/, "") + `
`, a ? '<pre><code class="language-' + an(a) + '">' + (n ? e : an(e, !0)) + `</code></pre>
` : "<pre><code>" + (n ? e : an(e, !0)) + `</code></pre>
`;
  }
  blockquote(e) {
    return `<blockquote>
${e}</blockquote>
`;
  }
  html(e, t) {
    return e;
  }
  heading(e, t, n) {
    return `<h${t}>${e}</h${t}>
`;
  }
  hr() {
    return `<hr>
`;
  }
  list(e, t, n) {
    const a = t ? "ol" : "ul", i = t && n !== 1 ? ' start="' + n + '"' : "";
    return "<" + a + i + `>
` + e + "</" + a + `>
`;
  }
  listitem(e, t, n) {
    return `<li>${e}</li>
`;
  }
  checkbox(e) {
    return "<input " + (e ? 'checked="" ' : "") + 'disabled="" type="checkbox">';
  }
  paragraph(e) {
    return `<p>${e}</p>
`;
  }
  table(e, t) {
    return t && (t = `<tbody>${t}</tbody>`), `<table>
<thead>
` + e + `</thead>
` + t + `</table>
`;
  }
  tablerow(e) {
    return `<tr>
${e}</tr>
`;
  }
  tablecell(e, t) {
    const n = t.header ? "th" : "td";
    return (t.align ? `<${n} align="${t.align}">` : `<${n}>`) + e + `</${n}>
`;
  }
  /**
   * span level renderer
   */
  strong(e) {
    return `<strong>${e}</strong>`;
  }
  em(e) {
    return `<em>${e}</em>`;
  }
  codespan(e) {
    return `<code>${e}</code>`;
  }
  br() {
    return "<br>";
  }
  del(e) {
    return `<del>${e}</del>`;
  }
  link(e, t, n) {
    const a = Vo(e);
    if (a === null)
      return n;
    e = a;
    let i = '<a href="' + e + '"';
    return t && (i += ' title="' + t + '"'), i += ">" + n + "</a>", i;
  }
  image(e, t, n) {
    const a = Vo(e);
    if (a === null)
      return n;
    e = a;
    let i = `<img src="${e}" alt="${n}"`;
    return t && (i += ` title="${t}"`), i += ">", i;
  }
  text(e) {
    return e;
  }
}
class Kl {
  // no need for block level renderers
  strong(e) {
    return e;
  }
  em(e) {
    return e;
  }
  codespan(e) {
    return e;
  }
  del(e) {
    return e;
  }
  html(e) {
    return e;
  }
  text(e) {
    return e;
  }
  link(e, t, n) {
    return "" + n;
  }
  image(e, t, n) {
    return "" + n;
  }
  br() {
    return "";
  }
}
class jn {
  constructor(e) {
    ce(this, "options");
    ce(this, "renderer");
    ce(this, "textRenderer");
    this.options = e || nr, this.options.renderer = this.options.renderer || new Ai(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.textRenderer = new Kl();
  }
  /**
   * Static Parse Method
   */
  static parse(e, t) {
    return new jn(t).parse(e);
  }
  /**
   * Static Parse Inline Method
   */
  static parseInline(e, t) {
    return new jn(t).parseInline(e);
  }
  /**
   * Parse Loop
   */
  parse(e, t = !0) {
    let n = "";
    for (let a = 0; a < e.length; a++) {
      const i = e[a];
      if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[i.type]) {
        const s = i, l = this.options.extensions.renderers[s.type].call({ parser: this }, s);
        if (l !== !1 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "paragraph", "text"].includes(s.type)) {
          n += l || "";
          continue;
        }
      }
      switch (i.type) {
        case "space":
          continue;
        case "hr": {
          n += this.renderer.hr();
          continue;
        }
        case "heading": {
          const s = i;
          n += this.renderer.heading(this.parseInline(s.tokens), s.depth, Am(this.parseInline(s.tokens, this.textRenderer)));
          continue;
        }
        case "code": {
          const s = i;
          n += this.renderer.code(s.text, s.lang, !!s.escaped);
          continue;
        }
        case "table": {
          const s = i;
          let l = "", o = "";
          for (let h = 0; h < s.header.length; h++)
            o += this.renderer.tablecell(this.parseInline(s.header[h].tokens), { header: !0, align: s.align[h] });
          l += this.renderer.tablerow(o);
          let u = "";
          for (let h = 0; h < s.rows.length; h++) {
            const m = s.rows[h];
            o = "";
            for (let d = 0; d < m.length; d++)
              o += this.renderer.tablecell(this.parseInline(m[d].tokens), { header: !1, align: s.align[d] });
            u += this.renderer.tablerow(o);
          }
          n += this.renderer.table(l, u);
          continue;
        }
        case "blockquote": {
          const s = i, l = this.parse(s.tokens);
          n += this.renderer.blockquote(l);
          continue;
        }
        case "list": {
          const s = i, l = s.ordered, o = s.start, u = s.loose;
          let h = "";
          for (let m = 0; m < s.items.length; m++) {
            const d = s.items[m], g = d.checked, b = d.task;
            let v = "";
            if (d.task) {
              const w = this.renderer.checkbox(!!g);
              u ? d.tokens.length > 0 && d.tokens[0].type === "paragraph" ? (d.tokens[0].text = w + " " + d.tokens[0].text, d.tokens[0].tokens && d.tokens[0].tokens.length > 0 && d.tokens[0].tokens[0].type === "text" && (d.tokens[0].tokens[0].text = w + " " + d.tokens[0].tokens[0].text)) : d.tokens.unshift({
                type: "text",
                text: w + " "
              }) : v += w + " ";
            }
            v += this.parse(d.tokens, u), h += this.renderer.listitem(v, b, !!g);
          }
          n += this.renderer.list(h, l, o);
          continue;
        }
        case "html": {
          const s = i;
          n += this.renderer.html(s.text, s.block);
          continue;
        }
        case "paragraph": {
          const s = i;
          n += this.renderer.paragraph(this.parseInline(s.tokens));
          continue;
        }
        case "text": {
          let s = i, l = s.tokens ? this.parseInline(s.tokens) : s.text;
          for (; a + 1 < e.length && e[a + 1].type === "text"; )
            s = e[++a], l += `
` + (s.tokens ? this.parseInline(s.tokens) : s.text);
          n += t ? this.renderer.paragraph(l) : l;
          continue;
        }
        default: {
          const s = 'Token with "' + i.type + '" type was not found.';
          if (this.options.silent)
            return console.error(s), "";
          throw new Error(s);
        }
      }
    }
    return n;
  }
  /**
   * Parse Inline Tokens
   */
  parseInline(e, t) {
    t = t || this.renderer;
    let n = "";
    for (let a = 0; a < e.length; a++) {
      const i = e[a];
      if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[i.type]) {
        const s = this.options.extensions.renderers[i.type].call({ parser: this }, i);
        if (s !== !1 || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(i.type)) {
          n += s || "";
          continue;
        }
      }
      switch (i.type) {
        case "escape": {
          const s = i;
          n += t.text(s.text);
          break;
        }
        case "html": {
          const s = i;
          n += t.html(s.text);
          break;
        }
        case "link": {
          const s = i;
          n += t.link(s.href, s.title, this.parseInline(s.tokens, t));
          break;
        }
        case "image": {
          const s = i;
          n += t.image(s.href, s.title, s.text);
          break;
        }
        case "strong": {
          const s = i;
          n += t.strong(this.parseInline(s.tokens, t));
          break;
        }
        case "em": {
          const s = i;
          n += t.em(this.parseInline(s.tokens, t));
          break;
        }
        case "codespan": {
          const s = i;
          n += t.codespan(s.text);
          break;
        }
        case "br": {
          n += t.br();
          break;
        }
        case "del": {
          const s = i;
          n += t.del(this.parseInline(s.tokens, t));
          break;
        }
        case "text": {
          const s = i;
          n += t.text(s.text);
          break;
        }
        default: {
          const s = 'Token with "' + i.type + '" type was not found.';
          if (this.options.silent)
            return console.error(s), "";
          throw new Error(s);
        }
      }
    }
    return n;
  }
}
class ea {
  constructor(e) {
    ce(this, "options");
    this.options = e || nr;
  }
  /**
   * Process markdown before marked
   */
  preprocess(e) {
    return e;
  }
  /**
   * Process HTML after marked is finished
   */
  postprocess(e) {
    return e;
  }
  /**
   * Process all tokens before walk tokens
   */
  processAllTokens(e) {
    return e;
  }
}
ce(ea, "passThroughHooks", /* @__PURE__ */ new Set([
  "preprocess",
  "postprocess",
  "processAllTokens"
]));
var er, ll, nh;
class th {
  constructor(...e) {
    Yi(this, er);
    ce(this, "defaults", Hl());
    ce(this, "options", this.setOptions);
    ce(this, "parse", Da(this, er, ll).call(this, Gn.lex, jn.parse));
    ce(this, "parseInline", Da(this, er, ll).call(this, Gn.lexInline, jn.parseInline));
    ce(this, "Parser", jn);
    ce(this, "Renderer", Ai);
    ce(this, "TextRenderer", Kl);
    ce(this, "Lexer", Gn);
    ce(this, "Tokenizer", Di);
    ce(this, "Hooks", ea);
    this.use(...e);
  }
  /**
   * Run callback for every token
   */
  walkTokens(e, t) {
    var a, i;
    let n = [];
    for (const s of e)
      switch (n = n.concat(t.call(this, s)), s.type) {
        case "table": {
          const l = s;
          for (const o of l.header)
            n = n.concat(this.walkTokens(o.tokens, t));
          for (const o of l.rows)
            for (const u of o)
              n = n.concat(this.walkTokens(u.tokens, t));
          break;
        }
        case "list": {
          const l = s;
          n = n.concat(this.walkTokens(l.items, t));
          break;
        }
        default: {
          const l = s;
          (i = (a = this.defaults.extensions) == null ? void 0 : a.childTokens) != null && i[l.type] ? this.defaults.extensions.childTokens[l.type].forEach((o) => {
            const u = l[o].flat(1 / 0);
            n = n.concat(this.walkTokens(u, t));
          }) : l.tokens && (n = n.concat(this.walkTokens(l.tokens, t)));
        }
      }
    return n;
  }
  use(...e) {
    const t = this.defaults.extensions || { renderers: {}, childTokens: {} };
    return e.forEach((n) => {
      const a = { ...n };
      if (a.async = this.defaults.async || a.async || !1, n.extensions && (n.extensions.forEach((i) => {
        if (!i.name)
          throw new Error("extension name required");
        if ("renderer" in i) {
          const s = t.renderers[i.name];
          s ? t.renderers[i.name] = function(...l) {
            let o = i.renderer.apply(this, l);
            return o === !1 && (o = s.apply(this, l)), o;
          } : t.renderers[i.name] = i.renderer;
        }
        if ("tokenizer" in i) {
          if (!i.level || i.level !== "block" && i.level !== "inline")
            throw new Error("extension level must be 'block' or 'inline'");
          const s = t[i.level];
          s ? s.unshift(i.tokenizer) : t[i.level] = [i.tokenizer], i.start && (i.level === "block" ? t.startBlock ? t.startBlock.push(i.start) : t.startBlock = [i.start] : i.level === "inline" && (t.startInline ? t.startInline.push(i.start) : t.startInline = [i.start]));
        }
        "childTokens" in i && i.childTokens && (t.childTokens[i.name] = i.childTokens);
      }), a.extensions = t), n.renderer) {
        const i = this.defaults.renderer || new Ai(this.defaults);
        for (const s in n.renderer) {
          if (!(s in i))
            throw new Error(`renderer '${s}' does not exist`);
          if (s === "options")
            continue;
          const l = s, o = n.renderer[l], u = i[l];
          i[l] = (...h) => {
            let m = o.apply(i, h);
            return m === !1 && (m = u.apply(i, h)), m || "";
          };
        }
        a.renderer = i;
      }
      if (n.tokenizer) {
        const i = this.defaults.tokenizer || new Di(this.defaults);
        for (const s in n.tokenizer) {
          if (!(s in i))
            throw new Error(`tokenizer '${s}' does not exist`);
          if (["options", "rules", "lexer"].includes(s))
            continue;
          const l = s, o = n.tokenizer[l], u = i[l];
          i[l] = (...h) => {
            let m = o.apply(i, h);
            return m === !1 && (m = u.apply(i, h)), m;
          };
        }
        a.tokenizer = i;
      }
      if (n.hooks) {
        const i = this.defaults.hooks || new ea();
        for (const s in n.hooks) {
          if (!(s in i))
            throw new Error(`hook '${s}' does not exist`);
          if (s === "options")
            continue;
          const l = s, o = n.hooks[l], u = i[l];
          ea.passThroughHooks.has(s) ? i[l] = (h) => {
            if (this.defaults.async)
              return Promise.resolve(o.call(i, h)).then((d) => u.call(i, d));
            const m = o.call(i, h);
            return u.call(i, m);
          } : i[l] = (...h) => {
            let m = o.apply(i, h);
            return m === !1 && (m = u.apply(i, h)), m;
          };
        }
        a.hooks = i;
      }
      if (n.walkTokens) {
        const i = this.defaults.walkTokens, s = n.walkTokens;
        a.walkTokens = function(l) {
          let o = [];
          return o.push(s.call(this, l)), i && (o = o.concat(i.call(this, l))), o;
        };
      }
      this.defaults = { ...this.defaults, ...a };
    }), this;
  }
  setOptions(e) {
    return this.defaults = { ...this.defaults, ...e }, this;
  }
  lexer(e, t) {
    return Gn.lex(e, t ?? this.defaults);
  }
  parser(e, t) {
    return jn.parse(e, t ?? this.defaults);
  }
}
er = new WeakSet(), ll = function(e, t) {
  return (n, a) => {
    const i = { ...a }, s = { ...this.defaults, ...i };
    this.defaults.async === !0 && i.async === !1 && (s.silent || console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."), s.async = !0);
    const l = Da(this, er, nh).call(this, !!s.silent, !!s.async);
    if (typeof n > "u" || n === null)
      return l(new Error("marked(): input parameter is undefined or null"));
    if (typeof n != "string")
      return l(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n) + ", string expected"));
    if (s.hooks && (s.hooks.options = s), s.async)
      return Promise.resolve(s.hooks ? s.hooks.preprocess(n) : n).then((o) => e(o, s)).then((o) => s.hooks ? s.hooks.processAllTokens(o) : o).then((o) => s.walkTokens ? Promise.all(this.walkTokens(o, s.walkTokens)).then(() => o) : o).then((o) => t(o, s)).then((o) => s.hooks ? s.hooks.postprocess(o) : o).catch(l);
    try {
      s.hooks && (n = s.hooks.preprocess(n));
      let o = e(n, s);
      s.hooks && (o = s.hooks.processAllTokens(o)), s.walkTokens && this.walkTokens(o, s.walkTokens);
      let u = t(o, s);
      return s.hooks && (u = s.hooks.postprocess(u)), u;
    } catch (o) {
      return l(o);
    }
  };
}, nh = function(e, t) {
  return (n) => {
    if (n.message += `
Please report this to https://github.com/markedjs/marked.`, e) {
      const a = "<p>An error occurred:</p><pre>" + an(n.message + "", !0) + "</pre>";
      return t ? Promise.resolve(a) : a;
    }
    if (t)
      return Promise.reject(n);
    throw n;
  };
};
const Z0 = new th();
function Me(r, e) {
  return Z0.parse(r, e);
}
Me.options = Me.setOptions = function(r) {
  return Z0.setOptions(r), Me.defaults = Z0.defaults, jc(Me.defaults), Me;
};
Me.getDefaults = Hl;
Me.defaults = nr;
Me.use = function(...r) {
  return Z0.use(...r), Me.defaults = Z0.defaults, jc(Me.defaults), Me;
};
Me.walkTokens = function(r, e) {
  return Z0.walkTokens(r, e);
};
Me.parseInline = Z0.parseInline;
Me.Parser = jn;
Me.parser = jn.parse;
Me.Renderer = Ai;
Me.TextRenderer = Kl;
Me.Lexer = Gn;
Me.lexer = Gn.lex;
Me.Tokenizer = Di;
Me.Hooks = ea;
Me.parse = Me;
Me.options;
Me.setOptions;
Me.use;
Me.walkTokens;
Me.parseInline;
jn.parse;
Gn.lex;
function n4(r) {
  if (typeof r == "function" && (r = {
    highlight: r
  }), !r || typeof r.highlight != "function")
    throw new Error("Must provide highlight function");
  return typeof r.langPrefix != "string" && (r.langPrefix = "language-"), typeof r.emptyLangClass != "string" && (r.emptyLangClass = ""), {
    async: !!r.async,
    walkTokens(e) {
      if (e.type !== "code")
        return;
      const t = Xo(e.lang);
      if (r.async)
        return Promise.resolve(r.highlight(e.text, t, e.lang || "")).then(Zo(e));
      const n = r.highlight(e.text, t, e.lang || "");
      if (n instanceof Promise)
        throw new Error("markedHighlight is not set to async but the highlight function is async. Set the async option to true on markedHighlight to await the async highlight function.");
      Zo(e)(n);
    },
    useNewRenderer: !0,
    renderer: {
      code(e, t, n) {
        typeof e == "object" && (n = e.escaped, t = e.lang, e = e.text);
        const a = Xo(t), i = a ? r.langPrefix + Jo(a) : r.emptyLangClass, s = i ? ` class="${i}"` : "";
        return e = e.replace(/\n$/, ""), `<pre><code${s}>${n ? e : Jo(e, !0)}
</code></pre>`;
      }
    }
  };
}
function Xo(r) {
  return (r || "").match(/\S*/)[0];
}
function Zo(r) {
  return (e) => {
    typeof e == "string" && e !== r.text && (r.escaped = !0, r.text = e);
  };
}
const rh = /[&<>"']/, r4 = new RegExp(rh.source, "g"), ah = /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, a4 = new RegExp(ah.source, "g"), i4 = {
  "&": "&amp;",
  "<": "&lt;",
  ">": "&gt;",
  '"': "&quot;",
  "'": "&#39;"
}, Qo = (r) => i4[r];
function Jo(r, e) {
  if (e) {
    if (rh.test(r))
      return r.replace(r4, Qo);
  } else if (ah.test(r))
    return r.replace(a4, Qo);
  return r;
}
const s4 = /[\0-\x1F!-,\.\/:-@\[-\^`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482\u0530\u0557\u0558\u055A-\u055F\u0589-\u0590\u05BE\u05C0\u05C3\u05C6\u05C8-\u05CF\u05EB-\u05EE\u05F3-\u060F\u061B-\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070F\u074B\u074C\u07B2-\u07BF\u07F6-\u07F9\u07FB\u07FC\u07FE\u07FF\u082E-\u083F\u085C-\u085F\u086B-\u089F\u08B5\u08C8-\u08D2\u08E2\u0964\u0965\u0970\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09F2-\u09FB\u09FD\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF0-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B54\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B70\u0B72-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BF0-\u0BFF\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C7F\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D0D\u0D11\u0D45\u0D49\u0D4F-\u0D53\u0D58-\u0D5E\u0D64\u0D65\u0D70-\u0D79\u0D80\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF4-\u0E00\u0E3B-\u0E3F\u0E4F\u0E5A-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F01-\u0F17\u0F1A-\u0F1F\u0F2A-\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F48\u0F6D-\u0F70\u0F85\u0F98\u0FBD-\u0FC5\u0FC7-\u0FFF\u104A-\u104F\u109E\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u1360-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16ED\u16F9-\u16FF\u170D\u1715-\u171F\u1735-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17D4-\u17D6\u17D8-\u17DB\u17DE\u17DF\u17EA-\u180A\u180E\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u1945\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DA-\u19FF\u1A1C-\u1A1F\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1AA6\u1AA8-\u1AAF\u1AC1-\u1AFF\u1B4C-\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BF4-\u1BFF\u1C38-\u1C3F\u1C4A-\u1C4C\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CCF\u1CD3\u1CFB-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u203E\u2041-\u2053\u2055-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u20CF\u20F1-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u215F\u2189-\u24B5\u24EA-\u2BFF\u2C2F\u2C5F\u2CE5-\u2CEA\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E00-\u2E2E\u2E30-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u3040\u3097\u3098\u309B\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\u9FFD-\u9FFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA62C-\uA63F\uA673\uA67E\uA6F2-\uA716\uA720\uA721\uA789\uA78A\uA7C0\uA7C1\uA7CB-\uA7F4\uA828-\uA82B\uA82D-\uA83F\uA874-\uA87F\uA8C6-\uA8CF\uA8DA-\uA8DF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA954-\uA95F\uA97D-\uA97F\uA9C1-\uA9CE\uA9DA-\uA9DF\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A-\uAA5F\uAA77-\uAA79\uAAC3-\uAADA\uAADE\uAADF\uAAF0\uAAF1\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABEB\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB29\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFC-\uFDFF\uFE10-\uFE1F\uFE30-\uFE32\uFE35-\uFE4C\uFE50-\uFE6F\uFE75\uFEFD-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF3E\uFF40\uFF5B-\uFF65\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDD3F\uDD75-\uDDFC\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEE1-\uDEFF\uDF20-\uDF2C\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDF9F\uDFC4-\uDFC7\uDFD0\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56-\uDC5F\uDC77-\uDC7F\uDC9F-\uDCDF\uDCF3\uDCF6-\uDCFF\uDD16-\uDD1F\uDD3A-\uDD7F\uDDB8-\uDDBD\uDDC0-\uDDFF\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE36\uDE37\uDE3B-\uDE3E\uDE40-\uDE5F\uDE7D-\uDE7F\uDE9D-\uDEBF\uDEC8\uDEE7-\uDEFF\uDF36-\uDF3F\uDF56-\uDF5F\uDF73-\uDF7F\uDF92-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCFF\uDD28-\uDD2F\uDD3A-\uDE7F\uDEAA\uDEAD-\uDEAF\uDEB2-\uDEFF\uDF1D-\uDF26\uDF28-\uDF2F\uDF51-\uDFAF\uDFC5-\uDFDF\uDFF7-\uDFFF]|\uD804[\uDC47-\uDC65\uDC70-\uDC7E\uDCBB-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD40-\uDD43\uDD48-\uDD4F\uDD74\uDD75\uDD77-\uDD7F\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDFF\uDE12\uDE38-\uDE3D\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEA9-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC4B-\uDC4F\uDC5A-\uDC5D\uDC62-\uDC7F\uDCC6\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDC1-\uDDD7\uDDDE-\uDDFF\uDE41-\uDE43\uDE45-\uDE4F\uDE5A-\uDE7F\uDEB9-\uDEBF\uDECA-\uDEFF\uDF1B\uDF1C\uDF2C-\uDF2F\uDF3A-\uDFFF]|\uD806[\uDC3B-\uDC9F\uDCEA-\uDCFE\uDD07\uDD08\uDD0A\uDD0B\uDD14\uDD17\uDD36\uDD39\uDD3A\uDD44-\uDD4F\uDD5A-\uDD9F\uDDA8\uDDA9\uDDD8\uDDD9\uDDE2\uDDE5-\uDDFF\uDE3F-\uDE46\uDE48-\uDE4F\uDE9A-\uDE9C\uDE9E-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC41-\uDC4F\uDC5A-\uDC71\uDC90\uDC91\uDCA8\uDCB7-\uDCFF\uDD07\uDD0A\uDD37-\uDD39\uDD3B\uDD3E\uDD48-\uDD4F\uDD5A-\uDD5F\uDD66\uDD69\uDD8F\uDD92\uDD99-\uDD9F\uDDAA-\uDEDF\uDEF7-\uDFAF\uDFB1-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD824-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83D\uD83F\uD87B-\uD87D\uD87F\uD885-\uDB3F\uDB41-\uDBFF][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDECF\uDEEE\uDEEF\uDEF5-\uDEFF\uDF37-\uDF3F\uDF44-\uDF4F\uDF5A-\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE80-\uDEFF\uDF4B-\uDF4E\uDF88-\uDF8E\uDFA0-\uDFDF\uDFE2\uDFE5-\uDFEF\uDFF2-\uDFFF]|\uD821[\uDFF8-\uDFFF]|\uD823[\uDCD6-\uDCFF\uDD09-\uDFFF]|\uD82C[\uDD1F-\uDD4F\uDD53-\uDD63\uDD68-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A-\uDC9C\uDC9F-\uDFFF]|\uD834[\uDC00-\uDD64\uDD6A-\uDD6C\uDD73-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDE41\uDE45-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3\uDFCC\uDFCD]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDCFF\uDD2D-\uDD2F\uDD3E\uDD3F\uDD4A-\uDD4D\uDD4F-\uDEBF\uDEFA-\uDFFF]|\uD83A[\uDCC5-\uDCCF\uDCD7-\uDCFF\uDD4C-\uDD4F\uDD5A-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD83C[\uDC00-\uDD2F\uDD4A-\uDD4F\uDD6A-\uDD6F\uDD8A-\uDFFF]|\uD83E[\uDC00-\uDFEF\uDFFA-\uDFFF]|\uD869[\uDEDE-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]/g, l4 = Object.hasOwnProperty;
class Yl {
  /**
   * Create a new slug class.
   */
  constructor() {
    this.occurrences, this.reset();
  }
  /**
   * Generate a unique slug.
  *
  * Tracks previously generated slugs: repeated calls with the same value
  * will result in different slugs.
  * Use the `slug` function to get same slugs.
   *
   * @param  {string} value
   *   String of text to slugify
   * @param  {boolean} [maintainCase=false]
   *   Keep the current case, otherwise make all lowercase
   * @return {string}
   *   A unique slug string
   */
  slug(e, t) {
    const n = this;
    let a = o4(e, t === !0);
    const i = a;
    for (; l4.call(n.occurrences, a); )
      n.occurrences[i]++, a = i + "-" + n.occurrences[i];
    return n.occurrences[a] = 0, a;
  }
  /**
   * Reset - Forget all previous slugs
   *
   * @return void
   */
  reset() {
    this.occurrences = /* @__PURE__ */ Object.create(null);
  }
}
function o4(r, e) {
  return typeof r != "string" ? "" : (e || (r = r.toLowerCase()), r.replace(s4, "").replace(/ /g, "-"));
}
let ih = new Yl(), sh = [];
function u4({ prefix: r = "", globalSlugs: e = !1 } = {}) {
  return {
    headerIds: !1,
    // prevent deprecation warning; remove this once headerIds option is removed
    hooks: {
      preprocess(t) {
        return e || c4(), t;
      }
    },
    renderer: {
      heading(t, n, a) {
        a = a.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi, "");
        const i = `${r}${ih.slug(a)}`, s = { level: n, text: t, id: i };
        return sh.push(s), `<h${n} id="${i}">${t}</h${n}>
`;
      }
    }
  };
}
function c4() {
  sh = [], ih = new Yl();
}
var eu = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function Dg(r) {
  return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
}
var lh = { exports: {} };
(function(r) {
  var e = typeof window < "u" ? window : typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope ? self : {};
  /**
   * Prism: Lightweight, robust, elegant syntax highlighting
   *
   * @license MIT <https://opensource.org/licenses/MIT>
   * @author Lea Verou <https://lea.verou.me>
   * @namespace
   * @public
   */
  var t = function(n) {
    var a = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i, i = 0, s = {}, l = {
      /**
       * By default, Prism will attempt to highlight all code elements (by calling {@link Prism.highlightAll}) on the
       * current page after the page finished loading. This might be a problem if e.g. you wanted to asynchronously load
       * additional languages or plugins yourself.
       *
       * By setting this value to `true`, Prism will not automatically highlight all code elements on the page.
       *
       * You obviously have to change this value before the automatic highlighting started. To do this, you can add an
       * empty Prism object into the global scope before loading the Prism script like this:
       *
       * ```js
       * window.Prism = window.Prism || {};
       * Prism.manual = true;
       * // add a new <script> to load Prism's script
       * ```
       *
       * @default false
       * @type {boolean}
       * @memberof Prism
       * @public
       */
      manual: n.Prism && n.Prism.manual,
      /**
       * By default, if Prism is in a web worker, it assumes that it is in a worker it created itself, so it uses
       * `addEventListener` to communicate with its parent instance. However, if you're using Prism manually in your
       * own worker, you don't want it to do this.
       *
       * By setting this value to `true`, Prism will not add its own listeners to the worker.
       *
       * You obviously have to change this value before Prism executes. To do this, you can add an
       * empty Prism object into the global scope before loading the Prism script like this:
       *
       * ```js
       * window.Prism = window.Prism || {};
       * Prism.disableWorkerMessageHandler = true;
       * // Load Prism's script
       * ```
       *
       * @default false
       * @type {boolean}
       * @memberof Prism
       * @public
       */
      disableWorkerMessageHandler: n.Prism && n.Prism.disableWorkerMessageHandler,
      /**
       * A namespace for utility methods.
       *
       * All function in this namespace that are not explicitly marked as _public_ are for __internal use only__ and may
       * change or disappear at any time.
       *
       * @namespace
       * @memberof Prism
       */
      util: {
        encode: function k(y) {
          return y instanceof o ? new o(y.type, k(y.content), y.alias) : Array.isArray(y) ? y.map(k) : y.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/\u00a0/g, " ");
        },
        /**
         * Returns the name of the type of the given value.
         *
         * @param {any} o
         * @returns {string}
         * @example
         * type(null)      === 'Null'
         * type(undefined) === 'Undefined'
         * type(123)       === 'Number'
         * type('foo')     === 'String'
         * type(true)      === 'Boolean'
         * type([1, 2])    === 'Array'
         * type({})        === 'Object'
         * type(String)    === 'Function'
         * type(/abc+/)    === 'RegExp'
         */
        type: function(k) {
          return Object.prototype.toString.call(k).slice(8, -1);
        },
        /**
         * Returns a unique number for the given object. Later calls will still return the same number.
         *
         * @param {Object} obj
         * @returns {number}
         */
        objId: function(k) {
          return k.__id || Object.defineProperty(k, "__id", { value: ++i }), k.__id;
        },
        /**
         * Creates a deep clone of the given object.
         *
         * The main intended use of this function is to clone language definitions.
         *
         * @param {T} o
         * @param {Record<number, any>} [visited]
         * @returns {T}
         * @template T
         */
        clone: function k(y, A) {
          A = A || {};
          var $, M;
          switch (l.util.type(y)) {
            case "Object":
              if (M = l.util.objId(y), A[M])
                return A[M];
              $ = /** @type {Record<string, any>} */
              {}, A[M] = $;
              for (var z in y)
                y.hasOwnProperty(z) && ($[z] = k(y[z], A));
              return (
                /** @type {any} */
                $
              );
            case "Array":
              return M = l.util.objId(y), A[M] ? A[M] : ($ = [], A[M] = $, /** @type {Array} */
              /** @type {any} */
              y.forEach(function(O, L) {
                $[L] = k(O, A);
              }), /** @type {any} */
              $);
            default:
              return y;
          }
        },
        /**
         * Returns the Prism language of the given element set by a `language-xxxx` or `lang-xxxx` class.
         *
         * If no language is set for the element or the element is `null` or `undefined`, `none` will be returned.
         *
         * @param {Element} element
         * @returns {string}
         */
        getLanguage: function(k) {
          for (; k; ) {
            var y = a.exec(k.className);
            if (y)
              return y[1].toLowerCase();
            k = k.parentElement;
          }
          return "none";
        },
        /**
         * Sets the Prism `language-xxxx` class of the given element.
         *
         * @param {Element} element
         * @param {string} language
         * @returns {void}
         */
        setLanguage: function(k, y) {
          k.className = k.className.replace(RegExp(a, "gi"), ""), k.classList.add("language-" + y);
        },
        /**
         * Returns the script element that is currently executing.
         *
         * This does __not__ work for line script element.
         *
         * @returns {HTMLScriptElement | null}
         */
        currentScript: function() {
          if (typeof document > "u")
            return null;
          if ("currentScript" in document)
            return (
              /** @type {any} */
              document.currentScript
            );
          try {
            throw new Error();
          } catch ($) {
            var k = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec($.stack) || [])[1];
            if (k) {
              var y = document.getElementsByTagName("script");
              for (var A in y)
                if (y[A].src == k)
                  return y[A];
            }
            return null;
          }
        },
        /**
         * Returns whether a given class is active for `element`.
         *
         * The class can be activated if `element` or one of its ancestors has the given class and it can be deactivated
         * if `element` or one of its ancestors has the negated version of the given class. The _negated version_ of the
         * given class is just the given class with a `no-` prefix.
         *
         * Whether the class is active is determined by the closest ancestor of `element` (where `element` itself is
         * closest ancestor) that has the given class or the negated version of it. If neither `element` nor any of its
         * ancestors have the given class or the negated version of it, then the default activation will be returned.
         *
         * In the paradoxical situation where the closest ancestor contains __both__ the given class and the negated
         * version of it, the class is considered active.
         *
         * @param {Element} element
         * @param {string} className
         * @param {boolean} [defaultActivation=false]
         * @returns {boolean}
         */
        isActive: function(k, y, A) {
          for (var $ = "no-" + y; k; ) {
            var M = k.classList;
            if (M.contains(y))
              return !0;
            if (M.contains($))
              return !1;
            k = k.parentElement;
          }
          return !!A;
        }
      },
      /**
       * This namespace contains all currently loaded languages and the some helper functions to create and modify languages.
       *
       * @namespace
       * @memberof Prism
       * @public
       */
      languages: {
        /**
         * The grammar for plain, unformatted text.
         */
        plain: s,
        plaintext: s,
        text: s,
        txt: s,
        /**
         * Creates a deep copy of the language with the given id and appends the given tokens.
         *
         * If a token in `redef` also appears in the copied language, then the existing token in the copied language
         * will be overwritten at its original position.
         *
         * ## Best practices
         *
         * Since the position of overwriting tokens (token in `redef` that overwrite tokens in the copied language)
         * doesn't matter, they can technically be in any order. However, this can be confusing to others that trying to
         * understand the language definition because, normally, the order of tokens matters in Prism grammars.
         *
         * Therefore, it is encouraged to order overwriting tokens according to the positions of the overwritten tokens.
         * Furthermore, all non-overwriting tokens should be placed after the overwriting ones.
         *
         * @param {string} id The id of the language to extend. This has to be a key in `Prism.languages`.
         * @param {Grammar} redef The new tokens to append.
         * @returns {Grammar} The new language created.
         * @public
         * @example
         * Prism.languages['css-with-colors'] = Prism.languages.extend('css', {
         *     // Prism.languages.css already has a 'comment' token, so this token will overwrite CSS' 'comment' token
         *     // at its original position
         *     'comment': { ... },
         *     // CSS doesn't have a 'color' token, so this token will be appended
         *     'color': /\b(?:red|green|blue)\b/
         * });
         */
        extend: function(k, y) {
          var A = l.util.clone(l.languages[k]);
          for (var $ in y)
            A[$] = y[$];
          return A;
        },
        /**
         * Inserts tokens _before_ another token in a language definition or any other grammar.
         *
         * ## Usage
         *
         * This helper method makes it easy to modify existing languages. For example, the CSS language definition
         * not only defines CSS highlighting for CSS documents, but also needs to define highlighting for CSS embedded
         * in HTML through `<style>` elements. To do this, it needs to modify `Prism.languages.markup` and add the
         * appropriate tokens. However, `Prism.languages.markup` is a regular JavaScript object literal, so if you do
         * this:
         *
         * ```js
         * Prism.languages.markup.style = {
         *     // token
         * };
         * ```
         *
         * then the `style` token will be added (and processed) at the end. `insertBefore` allows you to insert tokens
         * before existing tokens. For the CSS example above, you would use it like this:
         *
         * ```js
         * Prism.languages.insertBefore('markup', 'cdata', {
         *     'style': {
         *         // token
         *     }
         * });
         * ```
         *
         * ## Special cases
         *
         * If the grammars of `inside` and `insert` have tokens with the same name, the tokens in `inside`'s grammar
         * will be ignored.
         *
         * This behavior can be used to insert tokens after `before`:
         *
         * ```js
         * Prism.languages.insertBefore('markup', 'comment', {
         *     'comment': Prism.languages.markup.comment,
         *     // tokens after 'comment'
         * });
         * ```
         *
         * ## Limitations
         *
         * The main problem `insertBefore` has to solve is iteration order. Since ES2015, the iteration order for object
         * properties is guaranteed to be the insertion order (except for integer keys) but some browsers behave
         * differently when keys are deleted and re-inserted. So `insertBefore` can't be implemented by temporarily
         * deleting properties which is necessary to insert at arbitrary positions.
         *
         * To solve this problem, `insertBefore` doesn't actually insert the given tokens into the target object.
         * Instead, it will create a new object and replace all references to the target object with the new one. This
         * can be done without temporarily deleting properties, so the iteration order is well-defined.
         *
         * However, only references that can be reached from `Prism.languages` or `insert` will be replaced. I.e. if
         * you hold the target object in a variable, then the value of the variable will not change.
         *
         * ```js
         * var oldMarkup = Prism.languages.markup;
         * var newMarkup = Prism.languages.insertBefore('markup', 'comment', { ... });
         *
         * assert(oldMarkup !== Prism.languages.markup);
         * assert(newMarkup === Prism.languages.markup);
         * ```
         *
         * @param {string} inside The property of `root` (e.g. a language id in `Prism.languages`) that contains the
         * object to be modified.
         * @param {string} before The key to insert before.
         * @param {Grammar} insert An object containing the key-value pairs to be inserted.
         * @param {Object<string, any>} [root] The object containing `inside`, i.e. the object that contains the
         * object to be modified.
         *
         * Defaults to `Prism.languages`.
         * @returns {Grammar} The new grammar object.
         * @public
         */
        insertBefore: function(k, y, A, $) {
          $ = $ || /** @type {any} */
          l.languages;
          var M = $[k], z = {};
          for (var O in M)
            if (M.hasOwnProperty(O)) {
              if (O == y)
                for (var L in A)
                  A.hasOwnProperty(L) && (z[L] = A[L]);
              A.hasOwnProperty(O) || (z[O] = M[O]);
            }
          var K = $[k];
          return $[k] = z, l.languages.DFS(l.languages, function(X, J) {
            J === K && X != k && (this[X] = z);
          }), z;
        },
        // Traverse a language definition with Depth First Search
        DFS: function k(y, A, $, M) {
          M = M || {};
          var z = l.util.objId;
          for (var O in y)
            if (y.hasOwnProperty(O)) {
              A.call(y, O, y[O], $ || O);
              var L = y[O], K = l.util.type(L);
              K === "Object" && !M[z(L)] ? (M[z(L)] = !0, k(L, A, null, M)) : K === "Array" && !M[z(L)] && (M[z(L)] = !0, k(L, A, O, M));
            }
        }
      },
      plugins: {},
      /**
       * This is the most high-level function in Prism’s API.
       * It fetches all the elements that have a `.language-xxxx` class and then calls {@link Prism.highlightElement} on
       * each one of them.
       *
       * This is equivalent to `Prism.highlightAllUnder(document, async, callback)`.
       *
       * @param {boolean} [async=false] Same as in {@link Prism.highlightAllUnder}.
       * @param {HighlightCallback} [callback] Same as in {@link Prism.highlightAllUnder}.
       * @memberof Prism
       * @public
       */
      highlightAll: function(k, y) {
        l.highlightAllUnder(document, k, y);
      },
      /**
       * Fetches all the descendants of `container` that have a `.language-xxxx` class and then calls
       * {@link Prism.highlightElement} on each one of them.
       *
       * The following hooks will be run:
       * 1. `before-highlightall`
       * 2. `before-all-elements-highlight`
       * 3. All hooks of {@link Prism.highlightElement} for each element.
       *
       * @param {ParentNode} container The root element, whose descendants that have a `.language-xxxx` class will be highlighted.
       * @param {boolean} [async=false] Whether each element is to be highlighted asynchronously using Web Workers.
       * @param {HighlightCallback} [callback] An optional callback to be invoked on each element after its highlighting is done.
       * @memberof Prism
       * @public
       */
      highlightAllUnder: function(k, y, A) {
        var $ = {
          callback: A,
          container: k,
          selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
        };
        l.hooks.run("before-highlightall", $), $.elements = Array.prototype.slice.apply($.container.querySelectorAll($.selector)), l.hooks.run("before-all-elements-highlight", $);
        for (var M = 0, z; z = $.elements[M++]; )
          l.highlightElement(z, y === !0, $.callback);
      },
      /**
       * Highlights the code inside a single element.
       *
       * The following hooks will be run:
       * 1. `before-sanity-check`
       * 2. `before-highlight`
       * 3. All hooks of {@link Prism.highlight}. These hooks will be run by an asynchronous worker if `async` is `true`.
       * 4. `before-insert`
       * 5. `after-highlight`
       * 6. `complete`
       *
       * Some the above hooks will be skipped if the element doesn't contain any text or there is no grammar loaded for
       * the element's language.
       *
       * @param {Element} element The element containing the code.
       * It must have a class of `language-xxxx` to be processed, where `xxxx` is a valid language identifier.
       * @param {boolean} [async=false] Whether the element is to be highlighted asynchronously using Web Workers
       * to improve performance and avoid blocking the UI when highlighting very large chunks of code. This option is
       * [disabled by default](https://prismjs.com/faq.html#why-is-asynchronous-highlighting-disabled-by-default).
       *
       * Note: All language definitions required to highlight the code must be included in the main `prism.js` file for
       * asynchronous highlighting to work. You can build your own bundle on the
       * [Download page](https://prismjs.com/download.html).
       * @param {HighlightCallback} [callback] An optional callback to be invoked after the highlighting is done.
       * Mostly useful when `async` is `true`, since in that case, the highlighting is done asynchronously.
       * @memberof Prism
       * @public
       */
      highlightElement: function(k, y, A) {
        var $ = l.util.getLanguage(k), M = l.languages[$];
        l.util.setLanguage(k, $);
        var z = k.parentElement;
        z && z.nodeName.toLowerCase() === "pre" && l.util.setLanguage(z, $);
        var O = k.textContent, L = {
          element: k,
          language: $,
          grammar: M,
          code: O
        };
        function K(J) {
          L.highlightedCode = J, l.hooks.run("before-insert", L), L.element.innerHTML = L.highlightedCode, l.hooks.run("after-highlight", L), l.hooks.run("complete", L), A && A.call(L.element);
        }
        if (l.hooks.run("before-sanity-check", L), z = L.element.parentElement, z && z.nodeName.toLowerCase() === "pre" && !z.hasAttribute("tabindex") && z.setAttribute("tabindex", "0"), !L.code) {
          l.hooks.run("complete", L), A && A.call(L.element);
          return;
        }
        if (l.hooks.run("before-highlight", L), !L.grammar) {
          K(l.util.encode(L.code));
          return;
        }
        if (y && n.Worker) {
          var X = new Worker(l.filename);
          X.onmessage = function(J) {
            K(J.data);
          }, X.postMessage(JSON.stringify({
            language: L.language,
            code: L.code,
            immediateClose: !0
          }));
        } else
          K(l.highlight(L.code, L.grammar, L.language));
      },
      /**
       * Low-level function, only use if you know what you’re doing. It accepts a string of text as input
       * and the language definitions to use, and returns a string with the HTML produced.
       *
       * The following hooks will be run:
       * 1. `before-tokenize`
       * 2. `after-tokenize`
       * 3. `wrap`: On each {@link Token}.
       *
       * @param {string} text A string with the code to be highlighted.
       * @param {Grammar} grammar An object containing the tokens to use.
       *
       * Usually a language definition like `Prism.languages.markup`.
       * @param {string} language The name of the language definition passed to `grammar`.
       * @returns {string} The highlighted HTML.
       * @memberof Prism
       * @public
       * @example
       * Prism.highlight('var foo = true;', Prism.languages.javascript, 'javascript');
       */
      highlight: function(k, y, A) {
        var $ = {
          code: k,
          grammar: y,
          language: A
        };
        if (l.hooks.run("before-tokenize", $), !$.grammar)
          throw new Error('The language "' + $.language + '" has no grammar.');
        return $.tokens = l.tokenize($.code, $.grammar), l.hooks.run("after-tokenize", $), o.stringify(l.util.encode($.tokens), $.language);
      },
      /**
       * This is the heart of Prism, and the most low-level function you can use. It accepts a string of text as input
       * and the language definitions to use, and returns an array with the tokenized code.
       *
       * When the language definition includes nested tokens, the function is called recursively on each of these tokens.
       *
       * This method could be useful in other contexts as well, as a very crude parser.
       *
       * @param {string} text A string with the code to be highlighted.
       * @param {Grammar} grammar An object containing the tokens to use.
       *
       * Usually a language definition like `Prism.languages.markup`.
       * @returns {TokenStream} An array of strings and tokens, a token stream.
       * @memberof Prism
       * @public
       * @example
       * let code = `var foo = 0;`;
       * let tokens = Prism.tokenize(code, Prism.languages.javascript);
       * tokens.forEach(token => {
       *     if (token instanceof Prism.Token && token.type === 'number') {
       *         console.log(`Found numeric literal: ${token.content}`);
       *     }
       * });
       */
      tokenize: function(k, y) {
        var A = y.rest;
        if (A) {
          for (var $ in A)
            y[$] = A[$];
          delete y.rest;
        }
        var M = new m();
        return d(M, M.head, k), h(k, M, y, M.head, 0), b(M);
      },
      /**
       * @namespace
       * @memberof Prism
       * @public
       */
      hooks: {
        all: {},
        /**
         * Adds the given callback to the list of callbacks for the given hook.
         *
         * The callback will be invoked when the hook it is registered for is run.
         * Hooks are usually directly run by a highlight function but you can also run hooks yourself.
         *
         * One callback function can be registered to multiple hooks and the same hook multiple times.
         *
         * @param {string} name The name of the hook.
         * @param {HookCallback} callback The callback function which is given environment variables.
         * @public
         */
        add: function(k, y) {
          var A = l.hooks.all;
          A[k] = A[k] || [], A[k].push(y);
        },
        /**
         * Runs a hook invoking all registered callbacks with the given environment variables.
         *
         * Callbacks will be invoked synchronously and in the order in which they were registered.
         *
         * @param {string} name The name of the hook.
         * @param {Object<string, any>} env The environment variables of the hook passed to all callbacks registered.
         * @public
         */
        run: function(k, y) {
          var A = l.hooks.all[k];
          if (!(!A || !A.length))
            for (var $ = 0, M; M = A[$++]; )
              M(y);
        }
      },
      Token: o
    };
    n.Prism = l;
    function o(k, y, A, $) {
      this.type = k, this.content = y, this.alias = A, this.length = ($ || "").length | 0;
    }
    o.stringify = function k(y, A) {
      if (typeof y == "string")
        return y;
      if (Array.isArray(y)) {
        var $ = "";
        return y.forEach(function(K) {
          $ += k(K, A);
        }), $;
      }
      var M = {
        type: y.type,
        content: k(y.content, A),
        tag: "span",
        classes: ["token", y.type],
        attributes: {},
        language: A
      }, z = y.alias;
      z && (Array.isArray(z) ? Array.prototype.push.apply(M.classes, z) : M.classes.push(z)), l.hooks.run("wrap", M);
      var O = "";
      for (var L in M.attributes)
        O += " " + L + '="' + (M.attributes[L] || "").replace(/"/g, "&quot;") + '"';
      return "<" + M.tag + ' class="' + M.classes.join(" ") + '"' + O + ">" + M.content + "</" + M.tag + ">";
    };
    function u(k, y, A, $) {
      k.lastIndex = y;
      var M = k.exec(A);
      if (M && $ && M[1]) {
        var z = M[1].length;
        M.index += z, M[0] = M[0].slice(z);
      }
      return M;
    }
    function h(k, y, A, $, M, z) {
      for (var O in A)
        if (!(!A.hasOwnProperty(O) || !A[O])) {
          var L = A[O];
          L = Array.isArray(L) ? L : [L];
          for (var K = 0; K < L.length; ++K) {
            if (z && z.cause == O + "," + K)
              return;
            var X = L[K], J = X.inside, Se = !!X.lookbehind, _e = !!X.greedy, ge = X.alias;
            if (_e && !X.pattern.global) {
              var Ae = X.pattern.toString().match(/[imsuy]*$/)[0];
              X.pattern = RegExp(X.pattern.source, Ae + "g");
            }
            for (var Oe = X.pattern || X, ke = $.next, Be = M; ke !== y.tail && !(z && Be >= z.reach); Be += ke.value.length, ke = ke.next) {
              var Ee = ke.value;
              if (y.length > k.length)
                return;
              if (!(Ee instanceof o)) {
                var I = 1, be;
                if (_e) {
                  if (be = u(Oe, Be, k, Se), !be || be.index >= k.length)
                    break;
                  var nt = be.index, ye = be.index + be[0].length, Ie = Be;
                  for (Ie += ke.value.length; nt >= Ie; )
                    ke = ke.next, Ie += ke.value.length;
                  if (Ie -= ke.value.length, Be = Ie, ke.value instanceof o)
                    continue;
                  for (var H = ke; H !== y.tail && (Ie < ye || typeof H.value == "string"); H = H.next)
                    I++, Ie += H.value.length;
                  I--, Ee = k.slice(Be, Ie), be.index -= Be;
                } else if (be = u(Oe, 0, Ee, Se), !be)
                  continue;
                var nt = be.index, Pe = be[0], mt = Ee.slice(0, nt), vt = Ee.slice(nt + Pe.length), xt = Be + Ee.length;
                z && xt > z.reach && (z.reach = xt);
                var Nt = ke.prev;
                mt && (Nt = d(y, Nt, mt), Be += mt.length), g(y, Nt, I);
                var Q = new o(O, J ? l.tokenize(Pe, J) : Pe, ge, Pe);
                if (ke = d(y, Nt, Q), vt && d(y, ke, vt), I > 1) {
                  var je = {
                    cause: O + "," + K,
                    reach: xt
                  };
                  h(k, y, A, ke.prev, Be, je), z && je.reach > z.reach && (z.reach = je.reach);
                }
              }
            }
          }
        }
    }
    function m() {
      var k = { value: null, prev: null, next: null }, y = { value: null, prev: k, next: null };
      k.next = y, this.head = k, this.tail = y, this.length = 0;
    }
    function d(k, y, A) {
      var $ = y.next, M = { value: A, prev: y, next: $ };
      return y.next = M, $.prev = M, k.length++, M;
    }
    function g(k, y, A) {
      for (var $ = y.next, M = 0; M < A && $ !== k.tail; M++)
        $ = $.next;
      y.next = $, $.prev = y, k.length -= M;
    }
    function b(k) {
      for (var y = [], A = k.head.next; A !== k.tail; )
        y.push(A.value), A = A.next;
      return y;
    }
    if (!n.document)
      return n.addEventListener && (l.disableWorkerMessageHandler || n.addEventListener("message", function(k) {
        var y = JSON.parse(k.data), A = y.language, $ = y.code, M = y.immediateClose;
        n.postMessage(l.highlight($, l.languages[A], A)), M && n.close();
      }, !1)), l;
    var v = l.util.currentScript();
    v && (l.filename = v.src, v.hasAttribute("data-manual") && (l.manual = !0));
    function w() {
      l.manual || l.highlightAll();
    }
    if (!l.manual) {
      var x = document.readyState;
      x === "loading" || x === "interactive" && v && v.defer ? document.addEventListener("DOMContentLoaded", w) : window.requestAnimationFrame ? window.requestAnimationFrame(w) : window.setTimeout(w, 16);
    }
    return l;
  }(e);
  r.exports && (r.exports = t), typeof eu < "u" && (eu.Prism = t), t.languages.markup = {
    comment: {
      pattern: /<!--(?:(?!<!--)[\s\S])*?-->/,
      greedy: !0
    },
    prolog: {
      pattern: /<\?[\s\S]+?\?>/,
      greedy: !0
    },
    doctype: {
      // https://www.w3.org/TR/xml/#NT-doctypedecl
      pattern: /<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,
      greedy: !0,
      inside: {
        "internal-subset": {
          pattern: /(^[^\[]*\[)[\s\S]+(?=\]>$)/,
          lookbehind: !0,
          greedy: !0,
          inside: null
          // see below
        },
        string: {
          pattern: /"[^"]*"|'[^']*'/,
          greedy: !0
        },
        punctuation: /^<!|>$|[[\]]/,
        "doctype-tag": /^DOCTYPE/i,
        name: /[^\s<>'"]+/
      }
    },
    cdata: {
      pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
      greedy: !0
    },
    tag: {
      pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,
      greedy: !0,
      inside: {
        tag: {
          pattern: /^<\/?[^\s>\/]+/,
          inside: {
            punctuation: /^<\/?/,
            namespace: /^[^\s>\/:]+:/
          }
        },
        "special-attr": [],
        "attr-value": {
          pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,
          inside: {
            punctuation: [
              {
                pattern: /^=/,
                alias: "attr-equals"
              },
              {
                pattern: /^(\s*)["']|["']$/,
                lookbehind: !0
              }
            ]
          }
        },
        punctuation: /\/?>/,
        "attr-name": {
          pattern: /[^\s>\/]+/,
          inside: {
            namespace: /^[^\s>\/:]+:/
          }
        }
      }
    },
    entity: [
      {
        pattern: /&[\da-z]{1,8};/i,
        alias: "named-entity"
      },
      /&#x?[\da-f]{1,8};/i
    ]
  }, t.languages.markup.tag.inside["attr-value"].inside.entity = t.languages.markup.entity, t.languages.markup.doctype.inside["internal-subset"].inside = t.languages.markup, t.hooks.add("wrap", function(n) {
    n.type === "entity" && (n.attributes.title = n.content.replace(/&amp;/, "&"));
  }), Object.defineProperty(t.languages.markup.tag, "addInlined", {
    /**
     * Adds an inlined language to markup.
     *
     * An example of an inlined language is CSS with `<style>` tags.
     *
     * @param {string} tagName The name of the tag that contains the inlined language. This name will be treated as
     * case insensitive.
     * @param {string} lang The language key.
     * @example
     * addInlined('style', 'css');
     */
    value: function(a, i) {
      var s = {};
      s["language-" + i] = {
        pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
        lookbehind: !0,
        inside: t.languages[i]
      }, s.cdata = /^<!\[CDATA\[|\]\]>$/i;
      var l = {
        "included-cdata": {
          pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
          inside: s
        }
      };
      l["language-" + i] = {
        pattern: /[\s\S]+/,
        inside: t.languages[i]
      };
      var o = {};
      o[a] = {
        pattern: RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g, function() {
          return a;
        }), "i"),
        lookbehind: !0,
        greedy: !0,
        inside: l
      }, t.languages.insertBefore("markup", "cdata", o);
    }
  }), Object.defineProperty(t.languages.markup.tag, "addAttribute", {
    /**
     * Adds an pattern to highlight languages embedded in HTML attributes.
     *
     * An example of an inlined language is CSS with `style` attributes.
     *
     * @param {string} attrName The name of the tag that contains the inlined language. This name will be treated as
     * case insensitive.
     * @param {string} lang The language key.
     * @example
     * addAttribute('style', 'css');
     */
    value: function(n, a) {
      t.languages.markup.tag.inside["special-attr"].push({
        pattern: RegExp(
          /(^|["'\s])/.source + "(?:" + n + ")" + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,
          "i"
        ),
        lookbehind: !0,
        inside: {
          "attr-name": /^[^\s=]+/,
          "attr-value": {
            pattern: /=[\s\S]+/,
            inside: {
              value: {
                pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,
                lookbehind: !0,
                alias: [a, "language-" + a],
                inside: t.languages[a]
              },
              punctuation: [
                {
                  pattern: /^=/,
                  alias: "attr-equals"
                },
                /"|'/
              ]
            }
          }
        }
      });
    }
  }), t.languages.html = t.languages.markup, t.languages.mathml = t.languages.markup, t.languages.svg = t.languages.markup, t.languages.xml = t.languages.extend("markup", {}), t.languages.ssml = t.languages.xml, t.languages.atom = t.languages.xml, t.languages.rss = t.languages.xml, function(n) {
    var a = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
    n.languages.css = {
      comment: /\/\*[\s\S]*?\*\//,
      atrule: {
        pattern: RegExp("@[\\w-](?:" + /[^;{\s"']|\s+(?!\s)/.source + "|" + a.source + ")*?" + /(?:;|(?=\s*\{))/.source),
        inside: {
          rule: /^@[\w-]+/,
          "selector-function-argument": {
            pattern: /(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,
            lookbehind: !0,
            alias: "selector"
          },
          keyword: {
            pattern: /(^|[^\w-])(?:and|not|only|or)(?![\w-])/,
            lookbehind: !0
          }
          // See rest below
        }
      },
      url: {
        // https://drafts.csswg.org/css-values-3/#urls
        pattern: RegExp("\\burl\\((?:" + a.source + "|" + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ")\\)", "i"),
        greedy: !0,
        inside: {
          function: /^url/i,
          punctuation: /^\(|\)$/,
          string: {
            pattern: RegExp("^" + a.source + "$"),
            alias: "url"
          }
        }
      },
      selector: {
        pattern: RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|` + a.source + ")*(?=\\s*\\{)"),
        lookbehind: !0
      },
      string: {
        pattern: a,
        greedy: !0
      },
      property: {
        pattern: /(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,
        lookbehind: !0
      },
      important: /!important\b/i,
      function: {
        pattern: /(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,
        lookbehind: !0
      },
      punctuation: /[(){};:,]/
    }, n.languages.css.atrule.inside.rest = n.languages.css;
    var i = n.languages.markup;
    i && (i.tag.addInlined("style", "css"), i.tag.addAttribute("style", "css"));
  }(t), t.languages.clike = {
    comment: [
      {
        pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
        lookbehind: !0,
        greedy: !0
      },
      {
        pattern: /(^|[^\\:])\/\/.*/,
        lookbehind: !0,
        greedy: !0
      }
    ],
    string: {
      pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
      greedy: !0
    },
    "class-name": {
      pattern: /(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,
      lookbehind: !0,
      inside: {
        punctuation: /[.\\]/
      }
    },
    keyword: /\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,
    boolean: /\b(?:false|true)\b/,
    function: /\b\w+(?=\()/,
    number: /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,
    operator: /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,
    punctuation: /[{}[\];(),.:]/
  }, t.languages.javascript = t.languages.extend("clike", {
    "class-name": [
      t.languages.clike["class-name"],
      {
        pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,
        lookbehind: !0
      }
    ],
    keyword: [
      {
        pattern: /((?:^|\})\s*)catch\b/,
        lookbehind: !0
      },
      {
        pattern: /(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,
        lookbehind: !0
      }
    ],
    // Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444)
    function: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,
    number: {
      pattern: RegExp(
        /(^|[^\w$])/.source + "(?:" + // constant
        (/NaN|Infinity/.source + "|" + // binary integer
        /0[bB][01]+(?:_[01]+)*n?/.source + "|" + // octal integer
        /0[oO][0-7]+(?:_[0-7]+)*n?/.source + "|" + // hexadecimal integer
        /0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source + "|" + // decimal bigint
        /\d+(?:_\d+)*n/.source + "|" + // decimal number (integer or float) but no bigint
        /(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source) + ")" + /(?![\w$])/.source
      ),
      lookbehind: !0
    },
    operator: /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/
  }), t.languages.javascript["class-name"][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/, t.languages.insertBefore("javascript", "keyword", {
    regex: {
      pattern: RegExp(
        // lookbehind
        // eslint-disable-next-line regexp/no-dupe-characters-character-class
        /((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source + // Regex pattern:
        // There are 2 regex patterns here. The RegExp set notation proposal added support for nested character
        // classes if the `v` flag is present. Unfortunately, nested CCs are both context-free and incompatible
        // with the only syntax, so we have to define 2 different regex patterns.
        /\//.source + "(?:" + /(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source + "|" + // `v` flag syntax. This supports 3 levels of nested character classes.
        /(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source + ")" + // lookahead
        /(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source
      ),
      lookbehind: !0,
      greedy: !0,
      inside: {
        "regex-source": {
          pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/,
          lookbehind: !0,
          alias: "language-regex",
          inside: t.languages.regex
        },
        "regex-delimiter": /^\/|\/$/,
        "regex-flags": /^[a-z]+$/
      }
    },
    // This must be declared before keyword because we use "function" inside the look-forward
    "function-variable": {
      pattern: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,
      alias: "function"
    },
    parameter: [
      {
        pattern: /(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,
        lookbehind: !0,
        inside: t.languages.javascript
      },
      {
        pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,
        lookbehind: !0,
        inside: t.languages.javascript
      },
      {
        pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,
        lookbehind: !0,
        inside: t.languages.javascript
      },
      {
        pattern: /((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,
        lookbehind: !0,
        inside: t.languages.javascript
      }
    ],
    constant: /\b[A-Z](?:[A-Z_]|\dx?)*\b/
  }), t.languages.insertBefore("javascript", "string", {
    hashbang: {
      pattern: /^#!.*/,
      greedy: !0,
      alias: "comment"
    },
    "template-string": {
      pattern: /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,
      greedy: !0,
      inside: {
        "template-punctuation": {
          pattern: /^`|`$/,
          alias: "string"
        },
        interpolation: {
          pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
          lookbehind: !0,
          inside: {
            "interpolation-punctuation": {
              pattern: /^\$\{|\}$/,
              alias: "punctuation"
            },
            rest: t.languages.javascript
          }
        },
        string: /[\s\S]+/
      }
    },
    "string-property": {
      pattern: /((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,
      lookbehind: !0,
      greedy: !0,
      alias: "property"
    }
  }), t.languages.insertBefore("javascript", "operator", {
    "literal-property": {
      pattern: /((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,
      lookbehind: !0,
      alias: "property"
    }
  }), t.languages.markup && (t.languages.markup.tag.addInlined("script", "javascript"), t.languages.markup.tag.addAttribute(
    /on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,
    "javascript"
  )), t.languages.js = t.languages.javascript, function() {
    if (typeof t > "u" || typeof document > "u")
      return;
    Element.prototype.matches || (Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector);
    var n = "Loading…", a = function(v, w) {
      return "✖ Error " + v + " while fetching file: " + w;
    }, i = "✖ Error: File does not exist or is empty", s = {
      js: "javascript",
      py: "python",
      rb: "ruby",
      ps1: "powershell",
      psm1: "powershell",
      sh: "bash",
      bat: "batch",
      h: "c",
      tex: "latex"
    }, l = "data-src-status", o = "loading", u = "loaded", h = "failed", m = "pre[data-src]:not([" + l + '="' + u + '"]):not([' + l + '="' + o + '"])';
    function d(v, w, x) {
      var k = new XMLHttpRequest();
      k.open("GET", v, !0), k.onreadystatechange = function() {
        k.readyState == 4 && (k.status < 400 && k.responseText ? w(k.responseText) : k.status >= 400 ? x(a(k.status, k.statusText)) : x(i));
      }, k.send(null);
    }
    function g(v) {
      var w = /^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(v || "");
      if (w) {
        var x = Number(w[1]), k = w[2], y = w[3];
        return k ? y ? [x, Number(y)] : [x, void 0] : [x, x];
      }
    }
    t.hooks.add("before-highlightall", function(v) {
      v.selector += ", " + m;
    }), t.hooks.add("before-sanity-check", function(v) {
      var w = (
        /** @type {HTMLPreElement} */
        v.element
      );
      if (w.matches(m)) {
        v.code = "", w.setAttribute(l, o);
        var x = w.appendChild(document.createElement("CODE"));
        x.textContent = n;
        var k = w.getAttribute("data-src"), y = v.language;
        if (y === "none") {
          var A = (/\.(\w+)$/.exec(k) || [, "none"])[1];
          y = s[A] || A;
        }
        t.util.setLanguage(x, y), t.util.setLanguage(w, y);
        var $ = t.plugins.autoloader;
        $ && $.loadLanguages(y), d(
          k,
          function(M) {
            w.setAttribute(l, u);
            var z = g(w.getAttribute("data-range"));
            if (z) {
              var O = M.split(/\r\n?|\n/g), L = z[0], K = z[1] == null ? O.length : z[1];
              L < 0 && (L += O.length), L = Math.max(0, Math.min(L - 1, O.length)), K < 0 && (K += O.length), K = Math.max(0, Math.min(K, O.length)), M = O.slice(L, K).join(`
`), w.hasAttribute("data-start") || w.setAttribute("data-start", String(L + 1));
            }
            x.textContent = M, t.highlightElement(x);
          },
          function(M) {
            w.setAttribute(l, h), x.textContent = M;
          }
        );
      }
    }), t.plugins.fileHighlight = {
      /**
       * Executes the File Highlight plugin for all matching `pre` elements under the given container.
       *
       * Note: Elements which are already loaded or currently loading will not be touched by this method.
       *
       * @param {ParentNode} [container=document]
       */
      highlight: function(w) {
        for (var x = (w || document).querySelectorAll(m), k = 0, y; y = x[k++]; )
          t.highlightElement(y);
      }
    };
    var b = !1;
    t.fileHighlight = function() {
      b || (console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."), b = !0), t.plugins.fileHighlight.highlight.apply(this, arguments);
    };
  }();
})(lh);
var ds = lh.exports;
Prism.languages.python = {
  comment: {
    pattern: /(^|[^\\])#.*/,
    lookbehind: !0,
    greedy: !0
  },
  "string-interpolation": {
    pattern: /(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,
    greedy: !0,
    inside: {
      interpolation: {
        // "{" <expression> <optional "!s", "!r", or "!a"> <optional ":" format specifier> "}"
        pattern: /((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,
        lookbehind: !0,
        inside: {
          "format-spec": {
            pattern: /(:)[^:(){}]+(?=\}$)/,
            lookbehind: !0
          },
          "conversion-option": {
            pattern: /![sra](?=[:}]$)/,
            alias: "punctuation"
          },
          rest: null
        }
      },
      string: /[\s\S]+/
    }
  },
  "triple-quoted-string": {
    pattern: /(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,
    greedy: !0,
    alias: "string"
  },
  string: {
    pattern: /(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,
    greedy: !0
  },
  function: {
    pattern: /((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,
    lookbehind: !0
  },
  "class-name": {
    pattern: /(\bclass\s+)\w+/i,
    lookbehind: !0
  },
  decorator: {
    pattern: /(^[\t ]*)@\w+(?:\.\w+)*/m,
    lookbehind: !0,
    alias: ["annotation", "punctuation"],
    inside: {
      punctuation: /\./
    }
  },
  keyword: /\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,
  builtin: /\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,
  boolean: /\b(?:False|None|True)\b/,
  number: /\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,
  operator: /[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,
  punctuation: /[{}[\];(),.:]/
};
Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest = Prism.languages.python;
Prism.languages.py = Prism.languages.python;
(function(r) {
  var e = /\\(?:[^a-z()[\]]|[a-z*]+)/i, t = {
    "equation-command": {
      pattern: e,
      alias: "regex"
    }
  };
  r.languages.latex = {
    comment: /%.*/,
    // the verbatim environment prints whitespace to the document
    cdata: {
      pattern: /(\\begin\{((?:lstlisting|verbatim)\*?)\})[\s\S]*?(?=\\end\{\2\})/,
      lookbehind: !0
    },
    /*
     * equations can be between $$ $$ or $ $ or \( \) or \[ \]
     * (all are multiline)
     */
    equation: [
      {
        pattern: /\$\$(?:\\[\s\S]|[^\\$])+\$\$|\$(?:\\[\s\S]|[^\\$])+\$|\\\([\s\S]*?\\\)|\\\[[\s\S]*?\\\]/,
        inside: t,
        alias: "string"
      },
      {
        pattern: /(\\begin\{((?:align|eqnarray|equation|gather|math|multline)\*?)\})[\s\S]*?(?=\\end\{\2\})/,
        lookbehind: !0,
        inside: t,
        alias: "string"
      }
    ],
    /*
     * arguments which are keywords or references are highlighted
     * as keywords
     */
    keyword: {
      pattern: /(\\(?:begin|cite|documentclass|end|label|ref|usepackage)(?:\[[^\]]+\])?\{)[^}]+(?=\})/,
      lookbehind: !0
    },
    url: {
      pattern: /(\\url\{)[^}]+(?=\})/,
      lookbehind: !0
    },
    /*
     * section or chapter headlines are highlighted as bold so that
     * they stand out more
     */
    headline: {
      pattern: /(\\(?:chapter|frametitle|paragraph|part|section|subparagraph|subsection|subsubparagraph|subsubsection|subsubsubparagraph)\*?(?:\[[^\]]+\])?\{)[^}]+(?=\})/,
      lookbehind: !0,
      alias: "class-name"
    },
    function: {
      pattern: e,
      alias: "selector"
    },
    punctuation: /[[\]{}&]/
  }, r.languages.tex = r.languages.latex, r.languages.context = r.languages.latex;
})(Prism);
(function(r) {
  var e = "\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b", t = {
    pattern: /(^(["']?)\w+\2)[ \t]+\S.*/,
    lookbehind: !0,
    alias: "punctuation",
    // this looks reasonably well in all themes
    inside: null
    // see below
  }, n = {
    bash: t,
    environment: {
      pattern: RegExp("\\$" + e),
      alias: "constant"
    },
    variable: [
      // [0]: Arithmetic Environment
      {
        pattern: /\$?\(\([\s\S]+?\)\)/,
        greedy: !0,
        inside: {
          // If there is a $ sign at the beginning highlight $(( and )) as variable
          variable: [
            {
              pattern: /(^\$\(\([\s\S]+)\)\)/,
              lookbehind: !0
            },
            /^\$\(\(/
          ],
          number: /\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,
          // Operators according to https://www.gnu.org/software/bash/manual/bashref.html#Shell-Arithmetic
          operator: /--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,
          // If there is no $ sign at the beginning highlight (( and )) as punctuation
          punctuation: /\(\(?|\)\)?|,|;/
        }
      },
      // [1]: Command Substitution
      {
        pattern: /\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,
        greedy: !0,
        inside: {
          variable: /^\$\(|^`|\)$|`$/
        }
      },
      // [2]: Brace expansion
      {
        pattern: /\$\{[^}]+\}/,
        greedy: !0,
        inside: {
          operator: /:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,
          punctuation: /[\[\]]/,
          environment: {
            pattern: RegExp("(\\{)" + e),
            lookbehind: !0,
            alias: "constant"
          }
        }
      },
      /\$(?:\w+|[#?*!@$])/
    ],
    // Escape sequences from echo and printf's manuals, and escaped quotes.
    entity: /\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/
  };
  r.languages.bash = {
    shebang: {
      pattern: /^#!\s*\/.*/,
      alias: "important"
    },
    comment: {
      pattern: /(^|[^"{\\$])#.*/,
      lookbehind: !0
    },
    "function-name": [
      // a) function foo {
      // b) foo() {
      // c) function foo() {
      // but not “foo {”
      {
        // a) and c)
        pattern: /(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,
        lookbehind: !0,
        alias: "function"
      },
      {
        // b)
        pattern: /\b[\w-]+(?=\s*\(\s*\)\s*\{)/,
        alias: "function"
      }
    ],
    // Highlight variable names as variables in for and select beginnings.
    "for-or-select": {
      pattern: /(\b(?:for|select)\s+)\w+(?=\s+in\s)/,
      alias: "variable",
      lookbehind: !0
    },
    // Highlight variable names as variables in the left-hand part
    // of assignments (“=” and “+=”).
    "assign-left": {
      pattern: /(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,
      inside: {
        environment: {
          pattern: RegExp("(^|[\\s;|&]|[<>]\\()" + e),
          lookbehind: !0,
          alias: "constant"
        }
      },
      alias: "variable",
      lookbehind: !0
    },
    // Highlight parameter names as variables
    parameter: {
      pattern: /(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,
      alias: "variable",
      lookbehind: !0
    },
    string: [
      // Support for Here-documents https://en.wikipedia.org/wiki/Here_document
      {
        pattern: /((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,
        lookbehind: !0,
        greedy: !0,
        inside: n
      },
      // Here-document with quotes around the tag
      // → No expansion (so no “inside”).
      {
        pattern: /((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,
        lookbehind: !0,
        greedy: !0,
        inside: {
          bash: t
        }
      },
      // “Normal” string
      {
        // https://www.gnu.org/software/bash/manual/html_node/Double-Quotes.html
        pattern: /(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,
        lookbehind: !0,
        greedy: !0,
        inside: n
      },
      {
        // https://www.gnu.org/software/bash/manual/html_node/Single-Quotes.html
        pattern: /(^|[^$\\])'[^']*'/,
        lookbehind: !0,
        greedy: !0
      },
      {
        // https://www.gnu.org/software/bash/manual/html_node/ANSI_002dC-Quoting.html
        pattern: /\$'(?:[^'\\]|\\[\s\S])*'/,
        greedy: !0,
        inside: {
          entity: n.entity
        }
      }
    ],
    environment: {
      pattern: RegExp("\\$?" + e),
      alias: "constant"
    },
    variable: n.variable,
    function: {
      pattern: /(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,
      lookbehind: !0
    },
    keyword: {
      pattern: /(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,
      lookbehind: !0
    },
    // https://www.gnu.org/software/bash/manual/html_node/Shell-Builtin-Commands.html
    builtin: {
      pattern: /(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,
      lookbehind: !0,
      // Alias added to make those easier to distinguish from strings.
      alias: "class-name"
    },
    boolean: {
      pattern: /(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,
      lookbehind: !0
    },
    "file-descriptor": {
      pattern: /\B&\d\b/,
      alias: "important"
    },
    operator: {
      // Lots of redirections here, but not just that.
      pattern: /\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,
      inside: {
        "file-descriptor": {
          pattern: /^\d/,
          alias: "important"
        }
      }
    },
    punctuation: /\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,
    number: {
      pattern: /(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,
      lookbehind: !0
    }
  }, t.inside = r.languages.bash;
  for (var a = [
    "comment",
    "function-name",
    "for-or-select",
    "assign-left",
    "parameter",
    "string",
    "environment",
    "function",
    "keyword",
    "builtin",
    "boolean",
    "file-descriptor",
    "operator",
    "punctuation",
    "number"
  ], i = n.variable[1].inside, s = 0; s < a.length; s++)
    i[a[s]] = r.languages.bash[a[s]];
  r.languages.sh = r.languages.bash, r.languages.shell = r.languages.bash;
})(Prism);
const h4 = '<svg class="md-link-icon" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true" fill="currentColor"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg>', f4 = `
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15" color="currentColor" aria-hidden="true" aria-label="Copy" stroke-width="1.3" width="15" height="15">
  <path fill="currentColor" d="M12.728 4.545v8.182H4.545V4.545zm0 -0.909H4.545a0.909 0.909 0 0 0 -0.909 0.909v8.182a0.909 0.909 0 0 0 0.909 0.909h8.182a0.909 0.909 0 0 0 0.909 -0.909V4.545a0.909 0.909 0 0 0 -0.909 -0.909"/>
  <path fill="currentColor" d="M1.818 8.182H0.909V1.818a0.909 0.909 0 0 1 0.909 -0.909h6.364v0.909H1.818Z"/>
</svg>

`, d4 = `<svg xmlns="http://www.w3.org/2000/svg" width="17" height="17" viewBox="0 0 17 17" aria-hidden="true" aria-label="Copied" fill="none" stroke="currentColor" stroke-width="1.3">
  <path d="m13.813 4.781 -7.438 7.438 -3.188 -3.188"/>
</svg>
`, tu = `<button title="copy" class="copy_code_button">
  <span class="copy-text">${f4}</span>
  <span class="check">${d4}</span>
</button>`, oh = /[&<>"']/, m4 = new RegExp(oh.source, "g"), uh = /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, p4 = new RegExp(uh.source, "g"), g4 = {
  "&": "&amp;",
  "<": "&lt;",
  ">": "&gt;",
  '"': "&quot;",
  "'": "&#39;"
}, nu = (r) => g4[r] || "";
function ms(r, e) {
  if (e) {
    if (oh.test(r))
      return r.replace(m4, nu);
  } else if (uh.test(r))
    return r.replace(p4, nu);
  return r;
}
function _4(r) {
  const e = r.map((t) => ({
    start: new RegExp(t.left.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&")),
    end: new RegExp(t.right.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"))
  }));
  return {
    name: "latex",
    level: "block",
    start(t) {
      for (const n of e) {
        const a = t.match(n.start);
        if (a)
          return a.index;
      }
      return -1;
    },
    tokenizer(t, n) {
      for (const a of e) {
        const i = new RegExp(
          `${a.start.source}([\\s\\S]+?)${a.end.source}`
        ).exec(t);
        if (i)
          return {
            type: "latex",
            raw: i[0],
            text: i[1].trim()
          };
      }
    },
    renderer(t) {
      return `<div class="latex-block">${t.text}</div>`;
    }
  };
}
function v4() {
  return {
    name: "mermaid",
    level: "block",
    start(r) {
      var e;
      return (e = r.match(/^```mermaid\s*\n/)) == null ? void 0 : e.index;
    },
    tokenizer(r) {
      const e = /^```mermaid\s*\n([\s\S]*?)```\s*(?:\n|$)/.exec(r);
      if (e)
        return {
          type: "mermaid",
          raw: e[0],
          text: e[1].trim()
        };
    },
    renderer(r) {
      return `<div class="mermaid">${r.text}</div>
`;
    }
  };
}
const b4 = {
  code(r, e, t) {
    var a;
    const n = ((a = (e ?? "").match(/\S*/)) == null ? void 0 : a[0]) ?? "";
    return r = r.replace(/\n$/, "") + `
`, !n || n === "mermaid" ? '<div class="code_wrap">' + tu + "<pre><code>" + (t ? r : ms(r, !0)) + `</code></pre></div>
` : '<div class="code_wrap">' + tu + '<pre><code class="language-' + ms(n) + '">' + (t ? r : ms(r, !0)) + `</code></pre></div>
`;
  }
}, y4 = new Yl();
function w4({
  header_links: r,
  line_breaks: e,
  latex_delimiters: t
}) {
  const n = new th();
  n.use(
    {
      gfm: !0,
      pedantic: !1,
      breaks: e
    },
    n4({
      highlight: (s, l) => {
        var o;
        return (o = ds.languages) != null && o[l] ? ds.highlight(s, ds.languages[l], l) : s;
      }
    }),
    { renderer: b4 }
  ), r && (n.use(u4()), n.use({
    extensions: [
      {
        name: "heading",
        level: "block",
        renderer(s) {
          const l = s.raw.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi, ""), o = "h" + y4.slug(l), u = s.depth, h = this.parser.parseInline(s.tokens);
          return `<h${u} id="${o}"><a class="md-header-anchor" href="#${o}">${h4}</a>${h}</h${u}>
`;
        }
      }
    ]
  }));
  const a = v4(), i = _4(t);
  return n.use({
    extensions: [a, i]
  }), n;
}
const ol = (r) => JSON.parse(JSON.stringify(r)), k4 = (r) => r.nodeType === 1, S4 = (r) => G4.has(r.tagName), D4 = (r) => "action" in r, x4 = (r) => r.tagName === "IFRAME", A4 = (r) => "formAction" in r, E4 = (r) => "protocol" in r, qa = /* @__PURE__ */ (() => {
  const r = /^(?:\w+script|data):/i;
  return (e) => r.test(e);
})(), C4 = /* @__PURE__ */ (() => {
  const r = /(?:script|data):/i;
  return (e) => r.test(e);
})(), $4 = (r) => {
  const e = {};
  for (let t = 0, n = r.length; t < n; t++) {
    const a = r[t];
    for (const i in a)
      e[i] ? e[i] = e[i].concat(a[i]) : e[i] = a[i];
  }
  return e;
}, ch = (r, e) => {
  let t = r.firstChild;
  for (; t; ) {
    const n = t.nextSibling;
    k4(t) && (e(t, r), t.parentNode && ch(t, e)), t = n;
  }
}, T4 = (r, e) => {
  const t = document.createNodeIterator(r, NodeFilter.SHOW_ELEMENT);
  let n;
  for (; n = t.nextNode(); ) {
    const a = n.parentNode;
    a && e(n, a);
  }
}, F4 = (r, e) => !!globalThis.document && !!globalThis.document.createNodeIterator ? T4(r, e) : ch(r, e), hh = [
  "a",
  "abbr",
  "acronym",
  "address",
  "area",
  "article",
  "aside",
  "audio",
  "b",
  "bdi",
  "bdo",
  "bgsound",
  "big",
  "blockquote",
  "body",
  "br",
  "button",
  "canvas",
  "caption",
  "center",
  "cite",
  "code",
  "col",
  "colgroup",
  "datalist",
  "dd",
  "del",
  "details",
  "dfn",
  "dialog",
  "dir",
  "div",
  "dl",
  "dt",
  "em",
  "fieldset",
  "figcaption",
  "figure",
  "font",
  "footer",
  "form",
  "h1",
  "h2",
  "h3",
  "h4",
  "h5",
  "h6",
  "head",
  "header",
  "hgroup",
  "hr",
  "html",
  "i",
  "img",
  "input",
  "ins",
  "kbd",
  "keygen",
  "label",
  "layer",
  "legend",
  "li",
  "link",
  "listing",
  "main",
  "map",
  "mark",
  "marquee",
  "menu",
  "meta",
  "meter",
  "nav",
  "nobr",
  "ol",
  "optgroup",
  "option",
  "output",
  "p",
  "picture",
  "popup",
  "pre",
  "progress",
  "q",
  "rb",
  "rp",
  "rt",
  "rtc",
  "ruby",
  "s",
  "samp",
  "section",
  "select",
  "selectmenu",
  "small",
  "source",
  "span",
  "strike",
  "strong",
  "style",
  "sub",
  "summary",
  "sup",
  "table",
  "tbody",
  "td",
  "tfoot",
  "th",
  "thead",
  "time",
  "tr",
  "track",
  "tt",
  "u",
  "ul",
  "var",
  "video",
  "wbr"
], M4 = [
  "basefont",
  "command",
  "data",
  "iframe",
  "image",
  "plaintext",
  "portal",
  "slot",
  // 'template', //TODO: Not exactly correct to never allow this, too strict
  "textarea",
  "title",
  "xmp"
], z4 = /* @__PURE__ */ new Set([
  ...hh,
  ...M4
]), fh = [
  "svg",
  "a",
  "altglyph",
  "altglyphdef",
  "altglyphitem",
  "animatecolor",
  "animatemotion",
  "animatetransform",
  "circle",
  "clippath",
  "defs",
  "desc",
  "ellipse",
  "filter",
  "font",
  "g",
  "glyph",
  "glyphref",
  "hkern",
  "image",
  "line",
  "lineargradient",
  "marker",
  "mask",
  "metadata",
  "mpath",
  "path",
  "pattern",
  "polygon",
  "polyline",
  "radialgradient",
  "rect",
  "stop",
  "style",
  "switch",
  "symbol",
  "text",
  "textpath",
  "title",
  "tref",
  "tspan",
  "view",
  "vkern",
  /* FILTERS */
  "feBlend",
  "feColorMatrix",
  "feComponentTransfer",
  "feComposite",
  "feConvolveMatrix",
  "feDiffuseLighting",
  "feDisplacementMap",
  "feDistantLight",
  "feFlood",
  "feFuncA",
  "feFuncB",
  "feFuncG",
  "feFuncR",
  "feGaussianBlur",
  "feImage",
  "feMerge",
  "feMergeNode",
  "feMorphology",
  "feOffset",
  "fePointLight",
  "feSpecularLighting",
  "feSpotLight",
  "feTile",
  "feTurbulence"
], B4 = [
  "animate",
  "color-profile",
  "cursor",
  "discard",
  "fedropshadow",
  "font-face",
  "font-face-format",
  "font-face-name",
  "font-face-src",
  "font-face-uri",
  "foreignobject",
  "hatch",
  "hatchpath",
  "mesh",
  "meshgradient",
  "meshpatch",
  "meshrow",
  "missing-glyph",
  "script",
  "set",
  "solidcolor",
  "unknown",
  "use"
], N4 = /* @__PURE__ */ new Set([
  ...fh,
  ...B4
]), dh = [
  "math",
  "menclose",
  "merror",
  "mfenced",
  "mfrac",
  "mglyph",
  "mi",
  "mlabeledtr",
  "mmultiscripts",
  "mn",
  "mo",
  "mover",
  "mpadded",
  "mphantom",
  "mroot",
  "mrow",
  "ms",
  "mspace",
  "msqrt",
  "mstyle",
  "msub",
  "msup",
  "msubsup",
  "mtable",
  "mtd",
  "mtext",
  "mtr",
  "munder",
  "munderover"
], q4 = [
  "maction",
  "maligngroup",
  "malignmark",
  "mlongdiv",
  "mscarries",
  "mscarry",
  "msgroup",
  "mstack",
  "msline",
  "msrow",
  "semantics",
  "annotation",
  "annotation-xml",
  "mprescripts",
  "none"
], L4 = /* @__PURE__ */ new Set([
  ...dh,
  ...q4
]), I4 = [
  "abbr",
  "accept",
  "accept-charset",
  "accesskey",
  "action",
  "align",
  "alink",
  "allow",
  "allowfullscreen",
  "alt",
  "anchor",
  "archive",
  "as",
  "async",
  "autocapitalize",
  "autocomplete",
  "autocorrect",
  "autofocus",
  "autopictureinpicture",
  "autoplay",
  "axis",
  "background",
  "behavior",
  "bgcolor",
  "border",
  "bordercolor",
  "capture",
  "cellpadding",
  "cellspacing",
  "challenge",
  "char",
  "charoff",
  "charset",
  "checked",
  "cite",
  "class",
  "classid",
  "clear",
  "code",
  "codebase",
  "codetype",
  "color",
  "cols",
  "colspan",
  "compact",
  "content",
  "contenteditable",
  "controls",
  "controlslist",
  "conversiondestination",
  "coords",
  "crossorigin",
  "csp",
  "data",
  "datetime",
  "declare",
  "decoding",
  "default",
  "defer",
  "dir",
  "direction",
  "dirname",
  "disabled",
  "disablepictureinpicture",
  "disableremoteplayback",
  "disallowdocumentaccess",
  "download",
  "draggable",
  "elementtiming",
  "enctype",
  "end",
  "enterkeyhint",
  "event",
  "exportparts",
  "face",
  "for",
  "form",
  "formaction",
  "formenctype",
  "formmethod",
  "formnovalidate",
  "formtarget",
  "frame",
  "frameborder",
  "headers",
  "height",
  "hidden",
  "high",
  "href",
  "hreflang",
  "hreftranslate",
  "hspace",
  "http-equiv",
  "id",
  "imagesizes",
  "imagesrcset",
  "importance",
  "impressiondata",
  "impressionexpiry",
  "incremental",
  "inert",
  "inputmode",
  "integrity",
  "invisible",
  "ismap",
  "keytype",
  "kind",
  "label",
  "lang",
  "language",
  "latencyhint",
  "leftmargin",
  "link",
  "list",
  "loading",
  "longdesc",
  "loop",
  "low",
  "lowsrc",
  "manifest",
  "marginheight",
  "marginwidth",
  "max",
  "maxlength",
  "mayscript",
  "media",
  "method",
  "min",
  "minlength",
  "multiple",
  "muted",
  "name",
  "nohref",
  "nomodule",
  "nonce",
  "noresize",
  "noshade",
  "novalidate",
  "nowrap",
  "object",
  "open",
  "optimum",
  "part",
  "pattern",
  "ping",
  "placeholder",
  "playsinline",
  "policy",
  "poster",
  "preload",
  "pseudo",
  "readonly",
  "referrerpolicy",
  "rel",
  "reportingorigin",
  "required",
  "resources",
  "rev",
  "reversed",
  "role",
  "rows",
  "rowspan",
  "rules",
  "sandbox",
  "scheme",
  "scope",
  "scopes",
  "scrollamount",
  "scrolldelay",
  "scrolling",
  "select",
  "selected",
  "shadowroot",
  "shadowrootdelegatesfocus",
  "shape",
  "size",
  "sizes",
  "slot",
  "span",
  "spellcheck",
  "src",
  "srclang",
  "srcset",
  "standby",
  "start",
  "step",
  "style",
  "summary",
  "tabindex",
  "target",
  "text",
  "title",
  "topmargin",
  "translate",
  "truespeed",
  "trusttoken",
  "type",
  "usemap",
  "valign",
  "value",
  "valuetype",
  "version",
  "virtualkeyboardpolicy",
  "vlink",
  "vspace",
  "webkitdirectory",
  "width",
  "wrap"
], R4 = [
  "accent-height",
  "accumulate",
  "additive",
  "alignment-baseline",
  "ascent",
  "attributename",
  "attributetype",
  "azimuth",
  "basefrequency",
  "baseline-shift",
  "begin",
  "bias",
  "by",
  "class",
  "clip",
  "clippathunits",
  "clip-path",
  "clip-rule",
  "color",
  "color-interpolation",
  "color-interpolation-filters",
  "color-profile",
  "color-rendering",
  "cx",
  "cy",
  "d",
  "dx",
  "dy",
  "diffuseconstant",
  "direction",
  "display",
  "divisor",
  "dominant-baseline",
  "dur",
  "edgemode",
  "elevation",
  "end",
  "fill",
  "fill-opacity",
  "fill-rule",
  "filter",
  "filterunits",
  "flood-color",
  "flood-opacity",
  "font-family",
  "font-size",
  "font-size-adjust",
  "font-stretch",
  "font-style",
  "font-variant",
  "font-weight",
  "fx",
  "fy",
  "g1",
  "g2",
  "glyph-name",
  "glyphref",
  "gradientunits",
  "gradienttransform",
  "height",
  "href",
  "id",
  "image-rendering",
  "in",
  "in2",
  "k",
  "k1",
  "k2",
  "k3",
  "k4",
  "kerning",
  "keypoints",
  "keysplines",
  "keytimes",
  "lang",
  "lengthadjust",
  "letter-spacing",
  "kernelmatrix",
  "kernelunitlength",
  "lighting-color",
  "local",
  "marker-end",
  "marker-mid",
  "marker-start",
  "markerheight",
  "markerunits",
  "markerwidth",
  "maskcontentunits",
  "maskunits",
  "max",
  "mask",
  "media",
  "method",
  "mode",
  "min",
  "name",
  "numoctaves",
  "offset",
  "operator",
  "opacity",
  "order",
  "orient",
  "orientation",
  "origin",
  "overflow",
  "paint-order",
  "path",
  "pathlength",
  "patterncontentunits",
  "patterntransform",
  "patternunits",
  "points",
  "preservealpha",
  "preserveaspectratio",
  "primitiveunits",
  "r",
  "rx",
  "ry",
  "radius",
  "refx",
  "refy",
  "repeatcount",
  "repeatdur",
  "restart",
  "result",
  "rotate",
  "scale",
  "seed",
  "shape-rendering",
  "specularconstant",
  "specularexponent",
  "spreadmethod",
  "startoffset",
  "stddeviation",
  "stitchtiles",
  "stop-color",
  "stop-opacity",
  "stroke-dasharray",
  "stroke-dashoffset",
  "stroke-linecap",
  "stroke-linejoin",
  "stroke-miterlimit",
  "stroke-opacity",
  "stroke",
  "stroke-width",
  "style",
  "surfacescale",
  "systemlanguage",
  "tabindex",
  "targetx",
  "targety",
  "transform",
  "transform-origin",
  "text-anchor",
  "text-decoration",
  "text-rendering",
  "textlength",
  "type",
  "u1",
  "u2",
  "unicode",
  "values",
  "viewbox",
  "visibility",
  "version",
  "vert-adv-y",
  "vert-origin-x",
  "vert-origin-y",
  "width",
  "word-spacing",
  "wrap",
  "writing-mode",
  "xchannelselector",
  "ychannelselector",
  "x",
  "x1",
  "x2",
  "xmlns",
  "y",
  "y1",
  "y2",
  "z",
  "zoomandpan"
], O4 = [
  "accent",
  "accentunder",
  "align",
  "bevelled",
  "close",
  "columnsalign",
  "columnlines",
  "columnspan",
  "denomalign",
  "depth",
  "dir",
  "display",
  "displaystyle",
  "encoding",
  "fence",
  "frame",
  "height",
  "href",
  "id",
  "largeop",
  "length",
  "linethickness",
  "lspace",
  "lquote",
  "mathbackground",
  "mathcolor",
  "mathsize",
  "mathvariant",
  "maxsize",
  "minsize",
  "movablelimits",
  "notation",
  "numalign",
  "open",
  "rowalign",
  "rowlines",
  "rowspacing",
  "rowspan",
  "rspace",
  "rquote",
  "scriptlevel",
  "scriptminsize",
  "scriptsizemultiplier",
  "selection",
  "separator",
  "separators",
  "stretchy",
  "subscriptshift",
  "supscriptshift",
  "symmetric",
  "voffset",
  "width",
  "xmlns"
], qn = {
  HTML: "http://www.w3.org/1999/xhtml",
  SVG: "http://www.w3.org/2000/svg",
  MATH: "http://www.w3.org/1998/Math/MathML"
}, P4 = {
  [qn.HTML]: z4,
  [qn.SVG]: N4,
  [qn.MATH]: L4
}, H4 = {
  [qn.HTML]: "html",
  [qn.SVG]: "svg",
  [qn.MATH]: "math"
}, U4 = {
  [qn.HTML]: "",
  [qn.SVG]: "svg:",
  [qn.MATH]: "math:"
}, G4 = /* @__PURE__ */ new Set([
  "A",
  "AREA",
  "BUTTON",
  "FORM",
  "IFRAME",
  "INPUT"
]), mh = {
  allowComments: !0,
  allowCustomElements: !1,
  allowUnknownMarkup: !1,
  allowElements: [
    ...hh,
    ...fh.map((r) => `svg:${r}`),
    ...dh.map((r) => `math:${r}`)
  ],
  allowAttributes: $4([
    Object.fromEntries(I4.map((r) => [r, ["*"]])),
    Object.fromEntries(R4.map((r) => [r, ["svg:*"]])),
    Object.fromEntries(O4.map((r) => [r, ["math:*"]]))
  ])
};
var ps = function(r, e, t, n, a) {
  if (n === "m") throw new TypeError("Private method is not writable");
  if (n === "a" && !a) throw new TypeError("Private accessor was defined without a setter");
  if (typeof e == "function" ? r !== e || !a : !e.has(r)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
  return n === "a" ? a.call(r, t) : a ? a.value = t : e.set(r, t), t;
}, V0 = function(r, e, t, n) {
  if (t === "a" && !n) throw new TypeError("Private accessor was defined without a getter");
  if (typeof e == "function" ? r !== e || !n : !e.has(r)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
  return t === "m" ? n : t === "a" ? n.call(r) : n ? n.value : e.get(r);
}, T0, ui, ci;
class ph {
  /* CONSTRUCTOR */
  constructor(e = {}) {
    T0.set(this, void 0), ui.set(this, void 0), ci.set(this, void 0), this.getConfiguration = () => ol(V0(this, T0, "f")), this.sanitize = (h) => {
      const m = V0(this, ui, "f"), d = V0(this, ci, "f");
      return F4(h, (g, b) => {
        const v = g.namespaceURI || qn.HTML, w = b.namespaceURI || qn.HTML, x = P4[v], k = H4[v], y = U4[v], A = g.tagName.toLowerCase(), $ = `${y}${A}`, z = `${y}*`;
        if (!x.has(A) || !m.has($) || v !== w && A !== k)
          b.removeChild(g);
        else {
          const O = g.getAttributeNames(), L = O.length;
          if (L) {
            for (let K = 0; K < L; K++) {
              const X = O[K], J = d[X];
              (!J || !J.has(z) && !J.has($)) && g.removeAttribute(X);
            }
            if (S4(g))
              if (E4(g)) {
                const K = g.getAttribute("href");
                K && C4(K) && qa(g.protocol) && g.removeAttribute("href");
              } else D4(g) ? qa(g.action) && g.removeAttribute("action") : A4(g) ? qa(g.formAction) && g.removeAttribute("formaction") : x4(g) && (qa(g.src) && g.removeAttribute("formaction"), g.setAttribute("sandbox", "allow-scripts"));
          }
        }
      }), h;
    }, this.sanitizeFor = (h, m) => {
      throw new Error('"sanitizeFor" is not implemented yet');
    };
    const { allowComments: t, allowCustomElements: n, allowUnknownMarkup: a, blockElements: i, dropElements: s, dropAttributes: l } = e;
    if (t === !1)
      throw new Error('A false "allowComments" is not supported yet');
    if (n)
      throw new Error('A true "allowCustomElements" is not supported yet');
    if (a)
      throw new Error('A true "allowUnknownMarkup" is not supported yet');
    if (i)
      throw new Error('"blockElements" is not supported yet, use "allowElements" instead');
    if (s)
      throw new Error('"dropElements" is not supported yet, use "allowElements" instead');
    if (l)
      throw new Error('"dropAttributes" is not supported yet, use "allowAttributes" instead');
    ps(this, T0, ol(mh), "f");
    const { allowElements: o, allowAttributes: u } = e;
    o && (V0(this, T0, "f").allowElements = e.allowElements), u && (V0(this, T0, "f").allowAttributes = e.allowAttributes), ps(this, ui, new Set(V0(this, T0, "f").allowElements), "f"), ps(this, ci, Object.fromEntries(Object.entries(V0(this, T0, "f").allowAttributes || {}).map(([h, m]) => [h, new Set(m)])), "f");
  }
}
T0 = /* @__PURE__ */ new WeakMap(), ui = /* @__PURE__ */ new WeakMap(), ci = /* @__PURE__ */ new WeakMap();
ph.getDefaultConfiguration = () => ol(mh);
const j4 = (r, e) => {
  try {
    return !!r && new URL(r).origin !== new URL(e).origin;
  } catch {
    return !1;
  }
};
function ru(r, e) {
  const t = new ph(), n = new DOMParser().parseFromString(r, "text/html");
  return gh(n.body, "A", (a) => {
    a instanceof HTMLElement && "target" in a && j4(a.getAttribute("href"), e) && (a.setAttribute("target", "_blank"), a.setAttribute("rel", "noopener noreferrer"));
  }), t.sanitize(n).body.innerHTML;
}
function gh(r, e, t) {
  r && (r.nodeName === e || typeof e == "function") && t(r);
  const n = (r == null ? void 0 : r.childNodes) || [];
  for (let a = 0; a < n.length; a++)
    gh(n[a], e, t);
}
const au = [
  "!--",
  "!doctype",
  "a",
  "abbr",
  "acronym",
  "address",
  "applet",
  "area",
  "article",
  "aside",
  "audio",
  "b",
  "base",
  "basefont",
  "bdi",
  "bdo",
  "big",
  "blockquote",
  "body",
  "br",
  "button",
  "canvas",
  "caption",
  "center",
  "cite",
  "code",
  "col",
  "colgroup",
  "data",
  "datalist",
  "dd",
  "del",
  "details",
  "dfn",
  "dialog",
  "dir",
  "div",
  "dl",
  "dt",
  "em",
  "embed",
  "fieldset",
  "figcaption",
  "figure",
  "font",
  "footer",
  "form",
  "frame",
  "frameset",
  "h1",
  "h2",
  "h3",
  "h4",
  "h5",
  "h6",
  "head",
  "header",
  "hgroup",
  "hr",
  "html",
  "i",
  "iframe",
  "img",
  "input",
  "ins",
  "kbd",
  "label",
  "legend",
  "li",
  "link",
  "main",
  "map",
  "mark",
  "menu",
  "meta",
  "meter",
  "nav",
  "noframes",
  "noscript",
  "object",
  "ol",
  "optgroup",
  "option",
  "output",
  "p",
  "param",
  "picture",
  "pre",
  "progress",
  "q",
  "rp",
  "rt",
  "ruby",
  "s",
  "samp",
  "script",
  "search",
  "section",
  "select",
  "small",
  "source",
  "span",
  "strike",
  "strong",
  "style",
  "sub",
  "summary",
  "sup",
  "svg",
  "table",
  "tbody",
  "td",
  "template",
  "textarea",
  "tfoot",
  "th",
  "thead",
  "time",
  "title",
  "tr",
  "track",
  "tt",
  "u",
  "ul",
  "var",
  "video",
  "wbr"
], V4 = [
  // Base structural elements
  "g",
  "defs",
  "use",
  "symbol",
  // Shape elements
  "rect",
  "circle",
  "ellipse",
  "line",
  "polyline",
  "polygon",
  "path",
  "image",
  // Text elements
  "text",
  "tspan",
  "textPath",
  // Gradient and effects
  "linearGradient",
  "radialGradient",
  "stop",
  "pattern",
  "clipPath",
  "mask",
  "filter",
  // Filter effects
  "feBlend",
  "feColorMatrix",
  "feComponentTransfer",
  "feComposite",
  "feConvolveMatrix",
  "feDiffuseLighting",
  "feDisplacementMap",
  "feGaussianBlur",
  "feMerge",
  "feMorphology",
  "feOffset",
  "feSpecularLighting",
  "feTurbulence",
  "feMergeNode",
  "feFuncR",
  "feFuncG",
  "feFuncB",
  "feFuncA",
  "feDistantLight",
  "fePointLight",
  "feSpotLight",
  "feFlood",
  "feTile",
  // Animation elements
  "animate",
  "animateTransform",
  "animateMotion",
  "mpath",
  "set",
  // Interactive and other elements
  "view",
  "cursor",
  "foreignObject",
  "desc",
  "title",
  "metadata",
  "switch"
], W4 = [
  ...au,
  ...V4.filter((r) => !au.includes(r))
], {
  HtmlTagHydration: K4,
  SvelteComponent: Y4,
  attr: X4,
  binding_callbacks: Z4,
  children: Q4,
  claim_element: J4,
  claim_html_tag: e2,
  detach: iu,
  element: t2,
  init: n2,
  insert_hydration: r2,
  noop: su,
  safe_not_equal: a2,
  toggle_class: La
} = window.__gradio__svelte__internal, { afterUpdate: i2, tick: s2, onMount: xg } = window.__gradio__svelte__internal;
function l2(r) {
  let e, t;
  return {
    c() {
      e = t2("span"), t = new K4(!1), this.h();
    },
    l(n) {
      e = J4(n, "SPAN", { class: !0 });
      var a = Q4(e);
      t = e2(a, !1), a.forEach(iu), this.h();
    },
    h() {
      t.a = null, X4(e, "class", "md svelte-1m32c2s"), La(
        e,
        "chatbot",
        /*chatbot*/
        r[0]
      ), La(
        e,
        "prose",
        /*render_markdown*/
        r[1]
      );
    },
    m(n, a) {
      r2(n, e, a), t.m(
        /*html*/
        r[3],
        e
      ), r[12](e);
    },
    p(n, [a]) {
      a & /*html*/
      8 && t.p(
        /*html*/
        n[3]
      ), a & /*chatbot*/
      1 && La(
        e,
        "chatbot",
        /*chatbot*/
        n[0]
      ), a & /*render_markdown*/
      2 && La(
        e,
        "prose",
        /*render_markdown*/
        n[1]
      );
    },
    i: su,
    o: su,
    d(n) {
      n && iu(e), r[12](null);
    }
  };
}
function lu(r) {
  return r.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
}
function o2(r, e, t) {
  let { chatbot: n = !0 } = e, { message: a } = e, { sanitize_html: i = !0 } = e, { latex_delimiters: s = [] } = e, { render_markdown: l = !0 } = e, { line_breaks: o = !0 } = e, { header_links: u = !1 } = e, { root: h } = e, { allow_tags: m = !1 } = e, { theme_mode: d = "system" } = e, g, b;
  const v = w4({
    header_links: u,
    line_breaks: o,
    latex_delimiters: s || []
  });
  function w(A, $) {
    if ($ === !0) {
      const M = /<\/?([a-zA-Z][a-zA-Z0-9-]*)([\s>])/g;
      return A.replace(M, (z, O, L) => W4.includes(O.toLowerCase()) ? z : z.replace(/</g, "&lt;").replace(/>/g, "&gt;"));
    }
    if (Array.isArray($)) {
      const M = $.map((O) => ({
        open: new RegExp(`<(${O})(\\s+[^>]*)?>`, "gi"),
        close: new RegExp(`</(${O})>`, "gi")
      }));
      let z = A;
      return M.forEach((O) => {
        z = z.replace(O.open, (L) => L.replace(/</g, "&lt;").replace(/>/g, "&gt;")), z = z.replace(O.close, (L) => L.replace(/</g, "&lt;").replace(/>/g, "&gt;"));
      }), z;
    }
    return A;
  }
  function x(A) {
    let $ = A;
    if (l) {
      const M = [];
      s.forEach((z, O) => {
        const L = lu(z.left), K = lu(z.right), X = new RegExp(`${L}([\\s\\S]+?)${K}`, "g");
        $ = $.replace(X, (J, Se) => (M.push(J), `%%%LATEX_BLOCK_${M.length - 1}%%%`));
      }), $ = v.parse($), $ = $.replace(/%%%LATEX_BLOCK_(\d+)%%%/g, (z, O) => M[parseInt(O, 10)]);
    }
    return m && ($ = w($, m)), i && ru && ($ = ru($, h)), $;
  }
  async function k(A) {
    if (s.length > 0 && A && s.some((M) => A.includes(M.left) && A.includes(M.right)) && wm(g, {
      delimiters: s,
      throwOnError: !1
    }), g) {
      const $ = g.querySelectorAll(".mermaid");
      if ($.length > 0) {
        await s2();
        const { default: M } = await import("./mermaid.core-CUltyCao.js").then((z) => z.by);
        M.initialize({
          startOnLoad: !1,
          theme: d === "dark" ? "dark" : "default",
          securityLevel: "antiscript"
        }), await M.run({
          nodes: Array.from($).map((z) => z)
        });
      }
    }
  }
  i2(async () => {
    g && document.body.contains(g) ? await k(a) : console.error("Element is not in the DOM");
  });
  function y(A) {
    Z4[A ? "unshift" : "push"](() => {
      g = A, t(2, g);
    });
  }
  return r.$$set = (A) => {
    "chatbot" in A && t(0, n = A.chatbot), "message" in A && t(4, a = A.message), "sanitize_html" in A && t(5, i = A.sanitize_html), "latex_delimiters" in A && t(6, s = A.latex_delimiters), "render_markdown" in A && t(1, l = A.render_markdown), "line_breaks" in A && t(7, o = A.line_breaks), "header_links" in A && t(8, u = A.header_links), "root" in A && t(9, h = A.root), "allow_tags" in A && t(10, m = A.allow_tags), "theme_mode" in A && t(11, d = A.theme_mode);
  }, r.$$.update = () => {
    r.$$.dirty & /*message*/
    16 && (a && a.trim() ? t(3, b = x(a)) : t(3, b = ""));
  }, [
    n,
    l,
    g,
    b,
    a,
    i,
    s,
    o,
    u,
    h,
    m,
    d,
    y
  ];
}
class u2 extends Y4 {
  constructor(e) {
    super(), n2(this, e, o2, l2, a2, {
      chatbot: 0,
      message: 4,
      sanitize_html: 5,
      latex_delimiters: 6,
      render_markdown: 1,
      line_breaks: 7,
      header_links: 8,
      root: 9,
      allow_tags: 10,
      theme_mode: 11
    });
  }
}
const {
  SvelteComponent: c2,
  attr: h2,
  children: f2,
  claim_component: d2,
  claim_element: m2,
  create_component: p2,
  destroy_component: g2,
  detach: ou,
  element: _2,
  init: v2,
  insert_hydration: b2,
  mount_component: y2,
  safe_not_equal: w2,
  transition_in: k2,
  transition_out: S2
} = window.__gradio__svelte__internal;
function D2(r) {
  let e, t, n;
  return t = new u2({
    props: {
      root: (
        /*root*/
        r[1]
      ),
      message: (
        /*info*/
        r[0]
      ),
      sanitize_html: !0
    }
  }), {
    c() {
      e = _2("div"), p2(t.$$.fragment), this.h();
    },
    l(a) {
      e = m2(a, "DIV", { class: !0 });
      var i = f2(e);
      d2(t.$$.fragment, i), i.forEach(ou), this.h();
    },
    h() {
      h2(e, "class", "svelte-17qq50w");
    },
    m(a, i) {
      b2(a, e, i), y2(t, e, null), n = !0;
    },
    p(a, [i]) {
      const s = {};
      i & /*root*/
      2 && (s.root = /*root*/
      a[1]), i & /*info*/
      1 && (s.message = /*info*/
      a[0]), t.$set(s);
    },
    i(a) {
      n || (k2(t.$$.fragment, a), n = !0);
    },
    o(a) {
      S2(t.$$.fragment, a), n = !1;
    },
    d(a) {
      a && ou(e), g2(t);
    }
  };
}
function x2(r, e, t) {
  let { info: n } = e, { root: a } = e;
  return r.$$set = (i) => {
    "info" in i && t(0, n = i.info), "root" in i && t(1, a = i.root);
  }, [n, a];
}
class A2 extends c2 {
  constructor(e) {
    super(), v2(this, e, x2, D2, w2, { info: 0, root: 1 });
  }
}
const {
  SvelteComponent: E2,
  attr: Ia,
  check_outros: C2,
  children: $2,
  claim_component: T2,
  claim_element: F2,
  claim_space: M2,
  create_component: z2,
  create_slot: B2,
  destroy_component: N2,
  detach: Ra,
  element: q2,
  empty: uu,
  get_all_dirty_from_scope: L2,
  get_slot_changes: I2,
  group_outros: R2,
  init: O2,
  insert_hydration: gs,
  mount_component: P2,
  safe_not_equal: H2,
  space: U2,
  toggle_class: dr,
  transition_in: Vr,
  transition_out: hi,
  update_slot_base: G2
} = window.__gradio__svelte__internal;
function cu(r) {
  let e, t;
  return e = new A2({
    props: {
      root: (
        /*root*/
        r[2]
      ),
      info: (
        /*info*/
        r[1]
      )
    }
  }), {
    c() {
      z2(e.$$.fragment);
    },
    l(n) {
      T2(e.$$.fragment, n);
    },
    m(n, a) {
      P2(e, n, a), t = !0;
    },
    p(n, a) {
      const i = {};
      a & /*root*/
      4 && (i.root = /*root*/
      n[2]), a & /*info*/
      2 && (i.info = /*info*/
      n[1]), e.$set(i);
    },
    i(n) {
      t || (Vr(e.$$.fragment, n), t = !0);
    },
    o(n) {
      hi(e.$$.fragment, n), t = !1;
    },
    d(n) {
      N2(e, n);
    }
  };
}
function j2(r) {
  let e, t, n, a, i;
  const s = (
    /*#slots*/
    r[5].default
  ), l = B2(
    s,
    r,
    /*$$scope*/
    r[4],
    null
  );
  let o = (
    /*info*/
    r[1] && cu(r)
  );
  return {
    c() {
      e = q2("span"), l && l.c(), n = U2(), o && o.c(), a = uu(), this.h();
    },
    l(u) {
      e = F2(u, "SPAN", {
        "data-testid": !0,
        dir: !0,
        class: !0
      });
      var h = $2(e);
      l && l.l(h), h.forEach(Ra), n = M2(u), o && o.l(u), a = uu(), this.h();
    },
    h() {
      Ia(e, "data-testid", "block-info"), Ia(e, "dir", t = /*rtl*/
      r[3] ? "rtl" : "ltr"), Ia(e, "class", "svelte-zgrq3"), dr(e, "sr-only", !/*show_label*/
      r[0]), dr(e, "hide", !/*show_label*/
      r[0]), dr(
        e,
        "has-info",
        /*info*/
        r[1] != null
      );
    },
    m(u, h) {
      gs(u, e, h), l && l.m(e, null), gs(u, n, h), o && o.m(u, h), gs(u, a, h), i = !0;
    },
    p(u, [h]) {
      l && l.p && (!i || h & /*$$scope*/
      16) && G2(
        l,
        s,
        u,
        /*$$scope*/
        u[4],
        i ? I2(
          s,
          /*$$scope*/
          u[4],
          h,
          null
        ) : L2(
          /*$$scope*/
          u[4]
        ),
        null
      ), (!i || h & /*rtl*/
      8 && t !== (t = /*rtl*/
      u[3] ? "rtl" : "ltr")) && Ia(e, "dir", t), (!i || h & /*show_label*/
      1) && dr(e, "sr-only", !/*show_label*/
      u[0]), (!i || h & /*show_label*/
      1) && dr(e, "hide", !/*show_label*/
      u[0]), (!i || h & /*info*/
      2) && dr(
        e,
        "has-info",
        /*info*/
        u[1] != null
      ), /*info*/
      u[1] ? o ? (o.p(u, h), h & /*info*/
      2 && Vr(o, 1)) : (o = cu(u), o.c(), Vr(o, 1), o.m(a.parentNode, a)) : o && (R2(), hi(o, 1, 1, () => {
        o = null;
      }), C2());
    },
    i(u) {
      i || (Vr(l, u), Vr(o), i = !0);
    },
    o(u) {
      hi(l, u), hi(o), i = !1;
    },
    d(u) {
      u && (Ra(e), Ra(n), Ra(a)), l && l.d(u), o && o.d(u);
    }
  };
}
function V2(r, e, t) {
  let { $$slots: n = {}, $$scope: a } = e, { show_label: i = !0 } = e, { info: s = void 0 } = e, { root: l } = e, { rtl: o = !1 } = e;
  return r.$$set = (u) => {
    "show_label" in u && t(0, i = u.show_label), "info" in u && t(1, s = u.info), "root" in u && t(2, l = u.root), "rtl" in u && t(3, o = u.rtl), "$$scope" in u && t(4, a = u.$$scope);
  }, [i, s, l, o, a, n];
}
class _h extends E2 {
  constructor(e) {
    super(), O2(this, e, V2, j2, H2, { show_label: 0, info: 1, root: 2, rtl: 3 });
  }
}
const {
  SvelteComponent: Ag,
  append_hydration: Eg,
  attr: Cg,
  children: $g,
  claim_component: Tg,
  claim_element: Fg,
  claim_space: Mg,
  claim_text: zg,
  create_component: Bg,
  destroy_component: Ng,
  detach: qg,
  element: Lg,
  init: Ig,
  insert_hydration: Rg,
  mount_component: Og,
  safe_not_equal: Pg,
  set_data: Hg,
  space: Ug,
  text: Gg,
  toggle_class: jg,
  transition_in: Vg,
  transition_out: Wg
} = window.__gradio__svelte__internal, {
  SvelteComponent: W2,
  append_hydration: fi,
  attr: l0,
  bubble: K2,
  check_outros: Y2,
  children: ul,
  claim_component: X2,
  claim_element: cl,
  claim_space: hu,
  claim_text: Z2,
  construct_svelte_component: fu,
  create_component: du,
  create_slot: Q2,
  destroy_component: mu,
  detach: ta,
  element: hl,
  get_all_dirty_from_scope: J2,
  get_slot_changes: ep,
  group_outros: tp,
  init: np,
  insert_hydration: vh,
  listen: rp,
  mount_component: pu,
  safe_not_equal: ap,
  set_data: ip,
  set_style: Oa,
  space: gu,
  text: sp,
  toggle_class: $t,
  transition_in: _s,
  transition_out: vs,
  update_slot_base: lp
} = window.__gradio__svelte__internal;
function _u(r) {
  let e, t;
  return {
    c() {
      e = hl("span"), t = sp(
        /*label*/
        r[1]
      ), this.h();
    },
    l(n) {
      e = cl(n, "SPAN", { class: !0 });
      var a = ul(e);
      t = Z2(
        a,
        /*label*/
        r[1]
      ), a.forEach(ta), this.h();
    },
    h() {
      l0(e, "class", "svelte-qgco6m");
    },
    m(n, a) {
      vh(n, e, a), fi(e, t);
    },
    p(n, a) {
      a & /*label*/
      2 && ip(
        t,
        /*label*/
        n[1]
      );
    },
    d(n) {
      n && ta(e);
    }
  };
}
function op(r) {
  let e, t, n, a, i, s, l, o, u = (
    /*show_label*/
    r[2] && _u(r)
  );
  var h = (
    /*Icon*/
    r[0]
  );
  function m(b, v) {
    return {};
  }
  h && (a = fu(h, m()));
  const d = (
    /*#slots*/
    r[14].default
  ), g = Q2(
    d,
    r,
    /*$$scope*/
    r[13],
    null
  );
  return {
    c() {
      e = hl("button"), u && u.c(), t = gu(), n = hl("div"), a && du(a.$$.fragment), i = gu(), g && g.c(), this.h();
    },
    l(b) {
      e = cl(b, "BUTTON", {
        "aria-label": !0,
        "aria-haspopup": !0,
        title: !0,
        class: !0
      });
      var v = ul(e);
      u && u.l(v), t = hu(v), n = cl(v, "DIV", { class: !0 });
      var w = ul(n);
      a && X2(a.$$.fragment, w), i = hu(w), g && g.l(w), w.forEach(ta), v.forEach(ta), this.h();
    },
    h() {
      l0(n, "class", "svelte-qgco6m"), $t(
        n,
        "x-small",
        /*size*/
        r[4] === "x-small"
      ), $t(
        n,
        "small",
        /*size*/
        r[4] === "small"
      ), $t(
        n,
        "large",
        /*size*/
        r[4] === "large"
      ), $t(
        n,
        "medium",
        /*size*/
        r[4] === "medium"
      ), e.disabled = /*disabled*/
      r[7], l0(
        e,
        "aria-label",
        /*label*/
        r[1]
      ), l0(
        e,
        "aria-haspopup",
        /*hasPopup*/
        r[8]
      ), l0(
        e,
        "title",
        /*label*/
        r[1]
      ), l0(e, "class", "svelte-qgco6m"), $t(
        e,
        "pending",
        /*pending*/
        r[3]
      ), $t(
        e,
        "padded",
        /*padded*/
        r[5]
      ), $t(
        e,
        "highlight",
        /*highlight*/
        r[6]
      ), $t(
        e,
        "transparent",
        /*transparent*/
        r[9]
      ), Oa(e, "color", !/*disabled*/
      r[7] && /*_color*/
      r[11] ? (
        /*_color*/
        r[11]
      ) : "var(--block-label-text-color)"), Oa(e, "--bg-color", /*disabled*/
      r[7] ? "auto" : (
        /*background*/
        r[10]
      ));
    },
    m(b, v) {
      vh(b, e, v), u && u.m(e, null), fi(e, t), fi(e, n), a && pu(a, n, null), fi(n, i), g && g.m(n, null), s = !0, l || (o = rp(
        e,
        "click",
        /*click_handler*/
        r[15]
      ), l = !0);
    },
    p(b, [v]) {
      if (/*show_label*/
      b[2] ? u ? u.p(b, v) : (u = _u(b), u.c(), u.m(e, t)) : u && (u.d(1), u = null), v & /*Icon*/
      1 && h !== (h = /*Icon*/
      b[0])) {
        if (a) {
          tp();
          const w = a;
          vs(w.$$.fragment, 1, 0, () => {
            mu(w, 1);
          }), Y2();
        }
        h ? (a = fu(h, m()), du(a.$$.fragment), _s(a.$$.fragment, 1), pu(a, n, i)) : a = null;
      }
      g && g.p && (!s || v & /*$$scope*/
      8192) && lp(
        g,
        d,
        b,
        /*$$scope*/
        b[13],
        s ? ep(
          d,
          /*$$scope*/
          b[13],
          v,
          null
        ) : J2(
          /*$$scope*/
          b[13]
        ),
        null
      ), (!s || v & /*size*/
      16) && $t(
        n,
        "x-small",
        /*size*/
        b[4] === "x-small"
      ), (!s || v & /*size*/
      16) && $t(
        n,
        "small",
        /*size*/
        b[4] === "small"
      ), (!s || v & /*size*/
      16) && $t(
        n,
        "large",
        /*size*/
        b[4] === "large"
      ), (!s || v & /*size*/
      16) && $t(
        n,
        "medium",
        /*size*/
        b[4] === "medium"
      ), (!s || v & /*disabled*/
      128) && (e.disabled = /*disabled*/
      b[7]), (!s || v & /*label*/
      2) && l0(
        e,
        "aria-label",
        /*label*/
        b[1]
      ), (!s || v & /*hasPopup*/
      256) && l0(
        e,
        "aria-haspopup",
        /*hasPopup*/
        b[8]
      ), (!s || v & /*label*/
      2) && l0(
        e,
        "title",
        /*label*/
        b[1]
      ), (!s || v & /*pending*/
      8) && $t(
        e,
        "pending",
        /*pending*/
        b[3]
      ), (!s || v & /*padded*/
      32) && $t(
        e,
        "padded",
        /*padded*/
        b[5]
      ), (!s || v & /*highlight*/
      64) && $t(
        e,
        "highlight",
        /*highlight*/
        b[6]
      ), (!s || v & /*transparent*/
      512) && $t(
        e,
        "transparent",
        /*transparent*/
        b[9]
      ), v & /*disabled, _color*/
      2176 && Oa(e, "color", !/*disabled*/
      b[7] && /*_color*/
      b[11] ? (
        /*_color*/
        b[11]
      ) : "var(--block-label-text-color)"), v & /*disabled, background*/
      1152 && Oa(e, "--bg-color", /*disabled*/
      b[7] ? "auto" : (
        /*background*/
        b[10]
      ));
    },
    i(b) {
      s || (a && _s(a.$$.fragment, b), _s(g, b), s = !0);
    },
    o(b) {
      a && vs(a.$$.fragment, b), vs(g, b), s = !1;
    },
    d(b) {
      b && ta(e), u && u.d(), a && mu(a), g && g.d(b), l = !1, o();
    }
  };
}
function up(r, e, t) {
  let n, { $$slots: a = {}, $$scope: i } = e, { Icon: s } = e, { label: l = "" } = e, { show_label: o = !1 } = e, { pending: u = !1 } = e, { size: h = "small" } = e, { padded: m = !0 } = e, { highlight: d = !1 } = e, { disabled: g = !1 } = e, { hasPopup: b = !1 } = e, { color: v = "var(--block-label-text-color)" } = e, { transparent: w = !1 } = e, { background: x = "var(--block-background-fill)" } = e;
  function k(y) {
    K2.call(this, r, y);
  }
  return r.$$set = (y) => {
    "Icon" in y && t(0, s = y.Icon), "label" in y && t(1, l = y.label), "show_label" in y && t(2, o = y.show_label), "pending" in y && t(3, u = y.pending), "size" in y && t(4, h = y.size), "padded" in y && t(5, m = y.padded), "highlight" in y && t(6, d = y.highlight), "disabled" in y && t(7, g = y.disabled), "hasPopup" in y && t(8, b = y.hasPopup), "color" in y && t(12, v = y.color), "transparent" in y && t(9, w = y.transparent), "background" in y && t(10, x = y.background), "$$scope" in y && t(13, i = y.$$scope);
  }, r.$$.update = () => {
    r.$$.dirty & /*highlight, color*/
    4160 && t(11, n = d ? "var(--color-accent)" : v);
  }, [
    s,
    l,
    o,
    u,
    h,
    m,
    d,
    g,
    b,
    w,
    x,
    n,
    v,
    i,
    a,
    k
  ];
}
class cp extends W2 {
  constructor(e) {
    super(), np(this, e, up, op, ap, {
      Icon: 0,
      label: 1,
      show_label: 2,
      pending: 3,
      size: 4,
      padded: 5,
      highlight: 6,
      disabled: 7,
      hasPopup: 8,
      color: 12,
      transparent: 9,
      background: 10
    });
  }
}
const {
  SvelteComponent: Kg,
  append_hydration: Yg,
  attr: Xg,
  binding_callbacks: Zg,
  children: Qg,
  claim_element: Jg,
  create_slot: e_,
  detach: t_,
  element: n_,
  get_all_dirty_from_scope: r_,
  get_slot_changes: a_,
  init: i_,
  insert_hydration: s_,
  safe_not_equal: l_,
  toggle_class: o_,
  transition_in: u_,
  transition_out: c_,
  update_slot_base: h_
} = window.__gradio__svelte__internal, {
  SvelteComponent: f_,
  append_hydration: d_,
  attr: m_,
  children: p_,
  claim_svg_element: g_,
  detach: __,
  init: v_,
  insert_hydration: b_,
  noop: y_,
  safe_not_equal: w_,
  svg_element: k_
} = window.__gradio__svelte__internal, {
  SvelteComponent: S_,
  append_hydration: D_,
  attr: x_,
  children: A_,
  claim_svg_element: E_,
  detach: C_,
  init: $_,
  insert_hydration: T_,
  noop: F_,
  safe_not_equal: M_,
  svg_element: z_
} = window.__gradio__svelte__internal, {
  SvelteComponent: B_,
  append_hydration: N_,
  attr: q_,
  children: L_,
  claim_svg_element: I_,
  detach: R_,
  init: O_,
  insert_hydration: P_,
  noop: H_,
  safe_not_equal: U_,
  svg_element: G_
} = window.__gradio__svelte__internal, {
  SvelteComponent: j_,
  append_hydration: V_,
  attr: W_,
  children: K_,
  claim_svg_element: Y_,
  detach: X_,
  init: Z_,
  insert_hydration: Q_,
  noop: J_,
  safe_not_equal: e8,
  svg_element: t8
} = window.__gradio__svelte__internal, {
  SvelteComponent: n8,
  append_hydration: r8,
  attr: a8,
  children: i8,
  claim_svg_element: s8,
  detach: l8,
  init: o8,
  insert_hydration: u8,
  noop: c8,
  safe_not_equal: h8,
  svg_element: f8
} = window.__gradio__svelte__internal, {
  SvelteComponent: d8,
  append_hydration: m8,
  attr: p8,
  children: g8,
  claim_svg_element: _8,
  detach: v8,
  init: b8,
  insert_hydration: y8,
  noop: w8,
  safe_not_equal: k8,
  svg_element: S8
} = window.__gradio__svelte__internal, {
  SvelteComponent: D8,
  append_hydration: x8,
  attr: A8,
  children: E8,
  claim_svg_element: C8,
  detach: $8,
  init: T8,
  insert_hydration: F8,
  noop: M8,
  safe_not_equal: z8,
  svg_element: B8
} = window.__gradio__svelte__internal, {
  SvelteComponent: N8,
  append_hydration: q8,
  attr: L8,
  children: I8,
  claim_svg_element: R8,
  detach: O8,
  init: P8,
  insert_hydration: H8,
  noop: U8,
  safe_not_equal: G8,
  svg_element: j8
} = window.__gradio__svelte__internal, {
  SvelteComponent: V8,
  append_hydration: W8,
  attr: K8,
  children: Y8,
  claim_svg_element: X8,
  detach: Z8,
  init: Q8,
  insert_hydration: J8,
  noop: e9,
  safe_not_equal: t9,
  svg_element: n9
} = window.__gradio__svelte__internal, {
  SvelteComponent: r9,
  append_hydration: a9,
  attr: i9,
  children: s9,
  claim_svg_element: l9,
  detach: o9,
  init: u9,
  insert_hydration: c9,
  noop: h9,
  safe_not_equal: f9,
  svg_element: d9
} = window.__gradio__svelte__internal, {
  SvelteComponent: hp,
  append_hydration: fp,
  attr: hn,
  children: vu,
  claim_svg_element: bu,
  detach: bs,
  init: dp,
  insert_hydration: mp,
  noop: ys,
  safe_not_equal: pp,
  svg_element: yu
} = window.__gradio__svelte__internal;
function gp(r) {
  let e, t;
  return {
    c() {
      e = yu("svg"), t = yu("path"), this.h();
    },
    l(n) {
      e = bu(n, "svg", {
        width: !0,
        height: !0,
        "stroke-width": !0,
        viewBox: !0,
        fill: !0,
        xmlns: !0,
        color: !0
      });
      var a = vu(e);
      t = bu(a, "path", {
        d: !0,
        stroke: !0,
        "stroke-width": !0,
        "stroke-linecap": !0,
        "stroke-linejoin": !0
      }), vu(t).forEach(bs), a.forEach(bs), this.h();
    },
    h() {
      hn(t, "d", "M5 13L9 17L19 7"), hn(t, "stroke", "currentColor"), hn(t, "stroke-width", "1.5"), hn(t, "stroke-linecap", "round"), hn(t, "stroke-linejoin", "round"), hn(e, "width", "100%"), hn(e, "height", "100%"), hn(e, "stroke-width", "1.5"), hn(e, "viewBox", "0 0 24 24"), hn(e, "fill", "none"), hn(e, "xmlns", "http://www.w3.org/2000/svg"), hn(e, "color", "currentColor");
    },
    m(n, a) {
      mp(n, e, a), fp(e, t);
    },
    p: ys,
    i: ys,
    o: ys,
    d(n) {
      n && bs(e);
    }
  };
}
class _p extends hp {
  constructor(e) {
    super(), dp(this, e, null, gp, pp, {});
  }
}
const {
  SvelteComponent: m9,
  append_hydration: p9,
  attr: g9,
  children: _9,
  claim_svg_element: v9,
  detach: b9,
  init: y9,
  insert_hydration: w9,
  noop: k9,
  safe_not_equal: S9,
  svg_element: D9
} = window.__gradio__svelte__internal, {
  SvelteComponent: vp,
  append_hydration: ws,
  attr: Cn,
  children: Pa,
  claim_svg_element: Ha,
  detach: Br,
  init: bp,
  insert_hydration: yp,
  noop: ks,
  safe_not_equal: wp,
  set_style: In,
  svg_element: Ua
} = window.__gradio__svelte__internal;
function kp(r) {
  let e, t, n, a;
  return {
    c() {
      e = Ua("svg"), t = Ua("g"), n = Ua("path"), a = Ua("path"), this.h();
    },
    l(i) {
      e = Ha(i, "svg", {
        width: !0,
        height: !0,
        viewBox: !0,
        version: !0,
        xmlns: !0,
        "xmlns:xlink": !0,
        "xml:space": !0,
        stroke: !0,
        style: !0
      });
      var s = Pa(e);
      t = Ha(s, "g", { transform: !0 });
      var l = Pa(t);
      n = Ha(l, "path", { d: !0, style: !0 }), Pa(n).forEach(Br), l.forEach(Br), a = Ha(s, "path", { d: !0, style: !0 }), Pa(a).forEach(Br), s.forEach(Br), this.h();
    },
    h() {
      Cn(n, "d", "M18,6L6.087,17.913"), In(n, "fill", "none"), In(n, "fill-rule", "nonzero"), In(n, "stroke-width", "2px"), Cn(t, "transform", "matrix(1.14096,-0.140958,-0.140958,1.14096,-0.0559523,0.0559523)"), Cn(a, "d", "M4.364,4.364L19.636,19.636"), In(a, "fill", "none"), In(a, "fill-rule", "nonzero"), In(a, "stroke-width", "2px"), Cn(e, "width", "100%"), Cn(e, "height", "100%"), Cn(e, "viewBox", "0 0 24 24"), Cn(e, "version", "1.1"), Cn(e, "xmlns", "http://www.w3.org/2000/svg"), Cn(e, "xmlns:xlink", "http://www.w3.org/1999/xlink"), Cn(e, "xml:space", "preserve"), Cn(e, "stroke", "currentColor"), In(e, "fill-rule", "evenodd"), In(e, "clip-rule", "evenodd"), In(e, "stroke-linecap", "round"), In(e, "stroke-linejoin", "round");
    },
    m(i, s) {
      yp(i, e, s), ws(e, t), ws(t, n), ws(e, a);
    },
    p: ks,
    i: ks,
    o: ks,
    d(i) {
      i && Br(e);
    }
  };
}
class Sp extends vp {
  constructor(e) {
    super(), bp(this, e, null, kp, wp, {});
  }
}
const {
  SvelteComponent: x9,
  append_hydration: A9,
  attr: E9,
  children: C9,
  claim_svg_element: $9,
  detach: T9,
  init: F9,
  insert_hydration: M9,
  noop: z9,
  safe_not_equal: B9,
  svg_element: N9
} = window.__gradio__svelte__internal, {
  SvelteComponent: q9,
  append_hydration: L9,
  attr: I9,
  children: R9,
  claim_svg_element: O9,
  detach: P9,
  init: H9,
  insert_hydration: U9,
  noop: G9,
  safe_not_equal: j9,
  svg_element: V9
} = window.__gradio__svelte__internal, {
  SvelteComponent: W9,
  append_hydration: K9,
  attr: Y9,
  children: X9,
  claim_svg_element: Z9,
  detach: Q9,
  init: J9,
  insert_hydration: ev,
  noop: tv,
  safe_not_equal: nv,
  svg_element: rv
} = window.__gradio__svelte__internal, {
  SvelteComponent: av,
  append_hydration: iv,
  attr: sv,
  children: lv,
  claim_svg_element: ov,
  detach: uv,
  init: cv,
  insert_hydration: hv,
  noop: fv,
  safe_not_equal: dv,
  svg_element: mv
} = window.__gradio__svelte__internal, {
  SvelteComponent: Dp,
  append_hydration: wu,
  attr: Rn,
  children: Ss,
  claim_svg_element: Ds,
  detach: Ga,
  init: xp,
  insert_hydration: Ap,
  noop: xs,
  safe_not_equal: Ep,
  svg_element: As
} = window.__gradio__svelte__internal;
function Cp(r) {
  let e, t, n;
  return {
    c() {
      e = As("svg"), t = As("path"), n = As("path"), this.h();
    },
    l(a) {
      e = Ds(a, "svg", {
        xmlns: !0,
        viewBox: !0,
        color: !0,
        "aria-hidden": !0,
        width: !0,
        height: !0
      });
      var i = Ss(e);
      t = Ds(i, "path", { fill: !0, d: !0 }), Ss(t).forEach(Ga), n = Ds(i, "path", { fill: !0, d: !0 }), Ss(n).forEach(Ga), i.forEach(Ga), this.h();
    },
    h() {
      Rn(t, "fill", "currentColor"), Rn(t, "d", "M28 10v18H10V10h18m0-2H10a2 2 0 0 0-2 2v18a2 2 0 0 0 2 2h18a2 2 0 0 0 2-2V10a2 2 0 0 0-2-2Z"), Rn(n, "fill", "currentColor"), Rn(n, "d", "M4 18H2V4a2 2 0 0 1 2-2h14v2H4Z"), Rn(e, "xmlns", "http://www.w3.org/2000/svg"), Rn(e, "viewBox", "0 0 33 33"), Rn(e, "color", "currentColor"), Rn(e, "aria-hidden", "true"), Rn(e, "width", "100%"), Rn(e, "height", "100%");
    },
    m(a, i) {
      Ap(a, e, i), wu(e, t), wu(e, n);
    },
    p: xs,
    i: xs,
    o: xs,
    d(a) {
      a && Ga(e);
    }
  };
}
class $p extends Dp {
  constructor(e) {
    super(), xp(this, e, null, Cp, Ep, {});
  }
}
const {
  SvelteComponent: pv,
  append_hydration: gv,
  attr: _v,
  children: vv,
  claim_svg_element: bv,
  detach: yv,
  init: wv,
  insert_hydration: kv,
  noop: Sv,
  safe_not_equal: Dv,
  svg_element: xv
} = window.__gradio__svelte__internal, {
  SvelteComponent: Av,
  append_hydration: Ev,
  attr: Cv,
  children: $v,
  claim_svg_element: Tv,
  detach: Fv,
  init: Mv,
  insert_hydration: zv,
  noop: Bv,
  safe_not_equal: Nv,
  svg_element: qv
} = window.__gradio__svelte__internal, {
  SvelteComponent: Lv,
  append_hydration: Iv,
  attr: Rv,
  children: Ov,
  claim_svg_element: Pv,
  detach: Hv,
  init: Uv,
  insert_hydration: Gv,
  noop: jv,
  safe_not_equal: Vv,
  svg_element: Wv
} = window.__gradio__svelte__internal, {
  SvelteComponent: Kv,
  append_hydration: Yv,
  attr: Xv,
  children: Zv,
  claim_svg_element: Qv,
  detach: Jv,
  init: eb,
  insert_hydration: tb,
  noop: nb,
  safe_not_equal: rb,
  svg_element: ab
} = window.__gradio__svelte__internal, {
  SvelteComponent: ib,
  append_hydration: sb,
  attr: lb,
  children: ob,
  claim_svg_element: ub,
  detach: cb,
  init: hb,
  insert_hydration: fb,
  noop: db,
  safe_not_equal: mb,
  svg_element: pb
} = window.__gradio__svelte__internal, {
  SvelteComponent: gb,
  append_hydration: _b,
  attr: vb,
  children: bb,
  claim_svg_element: yb,
  detach: wb,
  init: kb,
  insert_hydration: Sb,
  noop: Db,
  safe_not_equal: xb,
  svg_element: Ab
} = window.__gradio__svelte__internal, {
  SvelteComponent: Eb,
  append_hydration: Cb,
  attr: $b,
  children: Tb,
  claim_svg_element: Fb,
  detach: Mb,
  init: zb,
  insert_hydration: Bb,
  noop: Nb,
  safe_not_equal: qb,
  svg_element: Lb
} = window.__gradio__svelte__internal, {
  SvelteComponent: Ib,
  append_hydration: Rb,
  attr: Ob,
  children: Pb,
  claim_svg_element: Hb,
  detach: Ub,
  init: Gb,
  insert_hydration: jb,
  noop: Vb,
  safe_not_equal: Wb,
  svg_element: Kb
} = window.__gradio__svelte__internal, {
  SvelteComponent: Yb,
  append_hydration: Xb,
  attr: Zb,
  children: Qb,
  claim_svg_element: Jb,
  detach: ey,
  init: ty,
  insert_hydration: ny,
  noop: ry,
  safe_not_equal: ay,
  svg_element: iy
} = window.__gradio__svelte__internal, {
  SvelteComponent: sy,
  append_hydration: ly,
  attr: oy,
  children: uy,
  claim_svg_element: cy,
  detach: hy,
  init: fy,
  insert_hydration: dy,
  noop: my,
  safe_not_equal: py,
  svg_element: gy
} = window.__gradio__svelte__internal, {
  SvelteComponent: _y,
  append_hydration: vy,
  attr: by,
  children: yy,
  claim_svg_element: wy,
  detach: ky,
  init: Sy,
  insert_hydration: Dy,
  noop: xy,
  safe_not_equal: Ay,
  svg_element: Ey
} = window.__gradio__svelte__internal, {
  SvelteComponent: Cy,
  append_hydration: $y,
  attr: Ty,
  children: Fy,
  claim_svg_element: My,
  detach: zy,
  init: By,
  insert_hydration: Ny,
  noop: qy,
  safe_not_equal: Ly,
  svg_element: Iy
} = window.__gradio__svelte__internal, {
  SvelteComponent: Ry,
  append_hydration: Oy,
  attr: Py,
  children: Hy,
  claim_svg_element: Uy,
  detach: Gy,
  init: jy,
  insert_hydration: Vy,
  noop: Wy,
  safe_not_equal: Ky,
  svg_element: Yy
} = window.__gradio__svelte__internal, {
  SvelteComponent: Xy,
  append_hydration: Zy,
  attr: Qy,
  children: Jy,
  claim_svg_element: ew,
  detach: tw,
  init: nw,
  insert_hydration: rw,
  noop: aw,
  safe_not_equal: iw,
  svg_element: sw
} = window.__gradio__svelte__internal, {
  SvelteComponent: lw,
  append_hydration: ow,
  attr: uw,
  children: cw,
  claim_svg_element: hw,
  detach: fw,
  init: dw,
  insert_hydration: mw,
  noop: pw,
  safe_not_equal: gw,
  svg_element: _w
} = window.__gradio__svelte__internal, {
  SvelteComponent: vw,
  append_hydration: bw,
  attr: yw,
  children: ww,
  claim_svg_element: kw,
  detach: Sw,
  init: Dw,
  insert_hydration: xw,
  noop: Aw,
  safe_not_equal: Ew,
  svg_element: Cw
} = window.__gradio__svelte__internal, {
  SvelteComponent: $w,
  append_hydration: Tw,
  attr: Fw,
  children: Mw,
  claim_svg_element: zw,
  detach: Bw,
  init: Nw,
  insert_hydration: qw,
  noop: Lw,
  safe_not_equal: Iw,
  svg_element: Rw
} = window.__gradio__svelte__internal, {
  SvelteComponent: Ow,
  append_hydration: Pw,
  attr: Hw,
  children: Uw,
  claim_svg_element: Gw,
  detach: jw,
  init: Vw,
  insert_hydration: Ww,
  noop: Kw,
  safe_not_equal: Yw,
  svg_element: Xw
} = window.__gradio__svelte__internal, {
  SvelteComponent: Zw,
  append_hydration: Qw,
  attr: Jw,
  children: ek,
  claim_svg_element: tk,
  detach: nk,
  init: rk,
  insert_hydration: ak,
  noop: ik,
  safe_not_equal: sk,
  svg_element: lk
} = window.__gradio__svelte__internal, {
  SvelteComponent: ok,
  append_hydration: uk,
  attr: ck,
  children: hk,
  claim_svg_element: fk,
  detach: dk,
  init: mk,
  insert_hydration: pk,
  noop: gk,
  safe_not_equal: _k,
  svg_element: vk
} = window.__gradio__svelte__internal, {
  SvelteComponent: bk,
  append_hydration: yk,
  attr: wk,
  children: kk,
  claim_svg_element: Sk,
  detach: Dk,
  init: xk,
  insert_hydration: Ak,
  noop: Ek,
  safe_not_equal: Ck,
  svg_element: $k
} = window.__gradio__svelte__internal, {
  SvelteComponent: Tk,
  append_hydration: Fk,
  attr: Mk,
  children: zk,
  claim_svg_element: Bk,
  detach: Nk,
  init: qk,
  insert_hydration: Lk,
  noop: Ik,
  safe_not_equal: Rk,
  svg_element: Ok
} = window.__gradio__svelte__internal, {
  SvelteComponent: Pk,
  append_hydration: Hk,
  attr: Uk,
  children: Gk,
  claim_svg_element: jk,
  detach: Vk,
  init: Wk,
  insert_hydration: Kk,
  noop: Yk,
  safe_not_equal: Xk,
  svg_element: Zk
} = window.__gradio__svelte__internal, {
  SvelteComponent: Qk,
  append_hydration: Jk,
  attr: eS,
  children: tS,
  claim_svg_element: nS,
  detach: rS,
  init: aS,
  insert_hydration: iS,
  noop: sS,
  safe_not_equal: lS,
  svg_element: oS
} = window.__gradio__svelte__internal, {
  SvelteComponent: uS,
  append_hydration: cS,
  attr: hS,
  children: fS,
  claim_svg_element: dS,
  detach: mS,
  init: pS,
  insert_hydration: gS,
  noop: _S,
  safe_not_equal: vS,
  svg_element: bS
} = window.__gradio__svelte__internal, {
  SvelteComponent: yS,
  append_hydration: wS,
  attr: kS,
  children: SS,
  claim_svg_element: DS,
  detach: xS,
  init: AS,
  insert_hydration: ES,
  noop: CS,
  safe_not_equal: $S,
  svg_element: TS
} = window.__gradio__svelte__internal, {
  SvelteComponent: FS,
  append_hydration: MS,
  attr: zS,
  children: BS,
  claim_svg_element: NS,
  detach: qS,
  init: LS,
  insert_hydration: IS,
  noop: RS,
  safe_not_equal: OS,
  svg_element: PS
} = window.__gradio__svelte__internal, {
  SvelteComponent: HS,
  append_hydration: US,
  attr: GS,
  children: jS,
  claim_svg_element: VS,
  detach: WS,
  init: KS,
  insert_hydration: YS,
  noop: XS,
  safe_not_equal: ZS,
  svg_element: QS
} = window.__gradio__svelte__internal, {
  SvelteComponent: JS,
  append_hydration: eD,
  attr: tD,
  children: nD,
  claim_svg_element: rD,
  detach: aD,
  init: iD,
  insert_hydration: sD,
  noop: lD,
  safe_not_equal: oD,
  svg_element: uD
} = window.__gradio__svelte__internal, {
  SvelteComponent: cD,
  append_hydration: hD,
  attr: fD,
  children: dD,
  claim_svg_element: mD,
  detach: pD,
  init: gD,
  insert_hydration: _D,
  noop: vD,
  safe_not_equal: bD,
  set_style: yD,
  svg_element: wD
} = window.__gradio__svelte__internal, {
  SvelteComponent: kD,
  append_hydration: SD,
  attr: DD,
  children: xD,
  claim_svg_element: AD,
  detach: ED,
  init: CD,
  insert_hydration: $D,
  noop: TD,
  safe_not_equal: FD,
  svg_element: MD
} = window.__gradio__svelte__internal, {
  SvelteComponent: zD,
  append_hydration: BD,
  attr: ND,
  children: qD,
  claim_svg_element: LD,
  detach: ID,
  init: RD,
  insert_hydration: OD,
  noop: PD,
  safe_not_equal: HD,
  svg_element: UD
} = window.__gradio__svelte__internal, {
  SvelteComponent: Tp,
  append_hydration: ja,
  attr: en,
  children: Nr,
  claim_svg_element: qr,
  detach: mr,
  init: Fp,
  insert_hydration: Mp,
  noop: Es,
  safe_not_equal: zp,
  svg_element: Lr
} = window.__gradio__svelte__internal;
function Bp(r) {
  let e, t, n, a, i;
  return {
    c() {
      e = Lr("svg"), t = Lr("g"), n = Lr("g"), a = Lr("g"), i = Lr("path"), this.h();
    },
    l(s) {
      e = qr(s, "svg", {
        viewBox: !0,
        width: !0,
        height: !0,
        fill: !0,
        xmlns: !0
      });
      var l = Nr(e);
      t = qr(l, "g", { id: !0, "stroke-width": !0 }), Nr(t).forEach(mr), n = qr(l, "g", {
        id: !0,
        "stroke-linecap": !0,
        "stroke-linejoin": !0
      }), Nr(n).forEach(mr), a = qr(l, "g", { id: !0 });
      var o = Nr(a);
      i = qr(o, "path", { d: !0, fill: !0 }), Nr(i).forEach(mr), o.forEach(mr), l.forEach(mr), this.h();
    },
    h() {
      en(t, "id", "SVGRepo_bgCarrier"), en(t, "stroke-width", "0"), en(n, "id", "SVGRepo_tracerCarrier"), en(n, "stroke-linecap", "round"), en(n, "stroke-linejoin", "round"), en(i, "d", "M19.1168 12.1484C19.474 12.3581 19.9336 12.2384 20.1432 11.8811C20.3528 11.5238 20.2331 11.0643 19.8758 10.8547L19.1168 12.1484ZM6.94331 4.13656L6.55624 4.77902L6.56378 4.78344L6.94331 4.13656ZM5.92408 4.1598L5.50816 3.5357L5.50816 3.5357L5.92408 4.1598ZM5.51031 5.09156L4.76841 5.20151C4.77575 5.25101 4.78802 5.29965 4.80505 5.34671L5.51031 5.09156ZM7.12405 11.7567C7.26496 12.1462 7.69495 12.3477 8.08446 12.2068C8.47397 12.0659 8.67549 11.6359 8.53458 11.2464L7.12405 11.7567ZM19.8758 12.1484C20.2331 11.9388 20.3528 11.4793 20.1432 11.122C19.9336 10.7648 19.474 10.6451 19.1168 10.8547L19.8758 12.1484ZM6.94331 18.8666L6.56375 18.2196L6.55627 18.2241L6.94331 18.8666ZM5.92408 18.8433L5.50815 19.4674H5.50815L5.92408 18.8433ZM5.51031 17.9116L4.80505 17.6564C4.78802 17.7035 4.77575 17.7521 4.76841 17.8016L5.51031 17.9116ZM8.53458 11.7567C8.67549 11.3672 8.47397 10.9372 8.08446 10.7963C7.69495 10.6554 7.26496 10.8569 7.12405 11.2464L8.53458 11.7567ZM19.4963 12.2516C19.9105 12.2516 20.2463 11.9158 20.2463 11.5016C20.2463 11.0873 19.9105 10.7516 19.4963 10.7516V12.2516ZM7.82931 10.7516C7.4151 10.7516 7.07931 11.0873 7.07931 11.5016C7.07931 11.9158 7.4151 12.2516 7.82931 12.2516V10.7516ZM19.8758 10.8547L7.32284 3.48968L6.56378 4.78344L19.1168 12.1484L19.8758 10.8547ZM7.33035 3.49414C6.76609 3.15419 6.05633 3.17038 5.50816 3.5357L6.34 4.78391C6.40506 4.74055 6.4893 4.73863 6.55627 4.77898L7.33035 3.49414ZM5.50816 3.5357C4.95998 3.90102 4.67184 4.54987 4.76841 5.20151L6.25221 4.98161C6.24075 4.90427 6.27494 4.82727 6.34 4.78391L5.50816 3.5357ZM4.80505 5.34671L7.12405 11.7567L8.53458 11.2464L6.21558 4.83641L4.80505 5.34671ZM19.1168 10.8547L6.56378 18.2197L7.32284 19.5134L19.8758 12.1484L19.1168 10.8547ZM6.55627 18.2241C6.4893 18.2645 6.40506 18.2626 6.34 18.2192L5.50815 19.4674C6.05633 19.8327 6.76609 19.8489 7.33035 19.509L6.55627 18.2241ZM6.34 18.2192C6.27494 18.1759 6.24075 18.0988 6.25221 18.0215L4.76841 17.8016C4.67184 18.4532 4.95998 19.1021 5.50815 19.4674L6.34 18.2192ZM6.21558 18.1667L8.53458 11.7567L7.12405 11.2464L4.80505 17.6564L6.21558 18.1667ZM19.4963 10.7516H7.82931V12.2516H19.4963V10.7516Z"), en(i, "fill", "currentColor"), en(a, "id", "SVGRepo_iconCarrier"), en(e, "viewBox", "0 0 22 24"), en(e, "width", "100%"), en(e, "height", "100%"), en(e, "fill", "none"), en(e, "xmlns", "http://www.w3.org/2000/svg");
    },
    m(s, l) {
      Mp(s, e, l), ja(e, t), ja(e, n), ja(e, a), ja(a, i);
    },
    p: Es,
    i: Es,
    o: Es,
    d(s) {
      s && mr(e);
    }
  };
}
class Np extends Tp {
  constructor(e) {
    super(), Fp(this, e, null, Bp, zp, {});
  }
}
const {
  SvelteComponent: GD,
  append_hydration: jD,
  attr: VD,
  children: WD,
  claim_svg_element: KD,
  detach: YD,
  init: XD,
  insert_hydration: ZD,
  noop: QD,
  safe_not_equal: JD,
  svg_element: ex
} = window.__gradio__svelte__internal, {
  SvelteComponent: tx,
  append_hydration: nx,
  attr: rx,
  children: ax,
  claim_svg_element: ix,
  detach: sx,
  init: lx,
  insert_hydration: ox,
  noop: ux,
  safe_not_equal: cx,
  svg_element: hx
} = window.__gradio__svelte__internal, {
  SvelteComponent: qp,
  append_hydration: Lp,
  attr: kt,
  children: ku,
  claim_svg_element: Su,
  detach: Cs,
  init: Ip,
  insert_hydration: Rp,
  noop: Du,
  safe_not_equal: Op,
  svg_element: xu
} = window.__gradio__svelte__internal;
function Pp(r) {
  let e, t, n;
  return {
    c() {
      e = xu("svg"), t = xu("rect"), this.h();
    },
    l(a) {
      e = Su(a, "svg", {
        xmlns: !0,
        width: !0,
        height: !0,
        viewBox: !0,
        fill: !0,
        stroke: !0,
        "stroke-width": !0,
        "stroke-linecap": !0,
        "stroke-linejoin": !0,
        class: !0
      });
      var i = ku(e);
      t = Su(i, "rect", {
        x: !0,
        y: !0,
        width: !0,
        height: !0,
        rx: !0,
        ry: !0
      }), ku(t).forEach(Cs), i.forEach(Cs), this.h();
    },
    h() {
      kt(t, "x", "3"), kt(t, "y", "3"), kt(t, "width", "18"), kt(t, "height", "18"), kt(t, "rx", "2"), kt(t, "ry", "2"), kt(e, "xmlns", "http://www.w3.org/2000/svg"), kt(e, "width", "100%"), kt(e, "height", "100%"), kt(e, "viewBox", "0 0 24 24"), kt(
        e,
        "fill",
        /*fill*/
        r[0]
      ), kt(e, "stroke", "currentColor"), kt(e, "stroke-width", n = `${/*stroke_width*/
      r[1]}`), kt(e, "stroke-linecap", "round"), kt(e, "stroke-linejoin", "round"), kt(e, "class", "feather feather-square");
    },
    m(a, i) {
      Rp(a, e, i), Lp(e, t);
    },
    p(a, [i]) {
      i & /*fill*/
      1 && kt(
        e,
        "fill",
        /*fill*/
        a[0]
      ), i & /*stroke_width*/
      2 && n !== (n = `${/*stroke_width*/
      a[1]}`) && kt(e, "stroke-width", n);
    },
    i: Du,
    o: Du,
    d(a) {
      a && Cs(e);
    }
  };
}
function Hp(r, e, t) {
  let { fill: n = "currentColor" } = e, { stroke_width: a = 1.5 } = e;
  return r.$$set = (i) => {
    "fill" in i && t(0, n = i.fill), "stroke_width" in i && t(1, a = i.stroke_width);
  }, [n, a];
}
class Up extends qp {
  constructor(e) {
    super(), Ip(this, e, Hp, Pp, Op, { fill: 0, stroke_width: 1 });
  }
}
const {
  SvelteComponent: fx,
  append_hydration: dx,
  attr: mx,
  children: px,
  claim_svg_element: gx,
  detach: _x,
  init: vx,
  insert_hydration: bx,
  noop: yx,
  safe_not_equal: wx,
  svg_element: kx
} = window.__gradio__svelte__internal, {
  SvelteComponent: Sx,
  append_hydration: Dx,
  attr: xx,
  children: Ax,
  claim_svg_element: Ex,
  detach: Cx,
  init: $x,
  insert_hydration: Tx,
  noop: Fx,
  safe_not_equal: Mx,
  svg_element: zx
} = window.__gradio__svelte__internal, {
  SvelteComponent: Bx,
  append_hydration: Nx,
  attr: qx,
  children: Lx,
  claim_svg_element: Ix,
  claim_text: Rx,
  detach: Ox,
  init: Px,
  insert_hydration: Hx,
  noop: Ux,
  safe_not_equal: Gx,
  svg_element: jx,
  text: Vx
} = window.__gradio__svelte__internal, {
  SvelteComponent: Wx,
  append_hydration: Kx,
  attr: Yx,
  children: Xx,
  claim_svg_element: Zx,
  detach: Qx,
  init: Jx,
  insert_hydration: eA,
  noop: tA,
  safe_not_equal: nA,
  svg_element: rA
} = window.__gradio__svelte__internal, {
  SvelteComponent: aA,
  append_hydration: iA,
  attr: sA,
  children: lA,
  claim_svg_element: oA,
  detach: uA,
  init: cA,
  insert_hydration: hA,
  noop: fA,
  safe_not_equal: dA,
  svg_element: mA
} = window.__gradio__svelte__internal, {
  SvelteComponent: pA,
  append_hydration: gA,
  attr: _A,
  children: vA,
  claim_svg_element: bA,
  detach: yA,
  init: wA,
  insert_hydration: kA,
  noop: SA,
  safe_not_equal: DA,
  svg_element: xA
} = window.__gradio__svelte__internal, {
  SvelteComponent: AA,
  append_hydration: EA,
  attr: CA,
  children: $A,
  claim_svg_element: TA,
  detach: FA,
  init: MA,
  insert_hydration: zA,
  noop: BA,
  safe_not_equal: NA,
  svg_element: qA
} = window.__gradio__svelte__internal, {
  SvelteComponent: LA,
  append_hydration: IA,
  attr: RA,
  children: OA,
  claim_svg_element: PA,
  detach: HA,
  init: UA,
  insert_hydration: GA,
  noop: jA,
  safe_not_equal: VA,
  svg_element: WA
} = window.__gradio__svelte__internal, {
  SvelteComponent: KA,
  append_hydration: YA,
  attr: XA,
  children: ZA,
  claim_svg_element: QA,
  detach: JA,
  init: eE,
  insert_hydration: tE,
  noop: nE,
  safe_not_equal: rE,
  svg_element: aE
} = window.__gradio__svelte__internal, {
  SvelteComponent: iE,
  append_hydration: sE,
  attr: lE,
  children: oE,
  claim_svg_element: uE,
  detach: cE,
  init: hE,
  insert_hydration: fE,
  noop: dE,
  safe_not_equal: mE,
  svg_element: pE
} = window.__gradio__svelte__internal, {
  SvelteComponent: gE,
  append_hydration: _E,
  attr: vE,
  children: bE,
  claim_svg_element: yE,
  claim_text: wE,
  detach: kE,
  init: SE,
  insert_hydration: DE,
  noop: xE,
  safe_not_equal: AE,
  svg_element: EE,
  text: CE
} = window.__gradio__svelte__internal, {
  SvelteComponent: $E,
  append_hydration: TE,
  attr: FE,
  children: ME,
  claim_svg_element: zE,
  claim_text: BE,
  detach: NE,
  init: qE,
  insert_hydration: LE,
  noop: IE,
  safe_not_equal: RE,
  svg_element: OE,
  text: PE
} = window.__gradio__svelte__internal, {
  SvelteComponent: HE,
  append_hydration: UE,
  attr: GE,
  children: jE,
  claim_svg_element: VE,
  claim_text: WE,
  detach: KE,
  init: YE,
  insert_hydration: XE,
  noop: ZE,
  safe_not_equal: QE,
  svg_element: JE,
  text: eC
} = window.__gradio__svelte__internal, {
  SvelteComponent: tC,
  append_hydration: nC,
  attr: rC,
  children: aC,
  claim_svg_element: iC,
  detach: sC,
  init: lC,
  insert_hydration: oC,
  noop: uC,
  safe_not_equal: cC,
  svg_element: hC
} = window.__gradio__svelte__internal, {
  SvelteComponent: fC,
  append_hydration: dC,
  attr: mC,
  children: pC,
  claim_svg_element: gC,
  detach: _C,
  init: vC,
  insert_hydration: bC,
  noop: yC,
  safe_not_equal: wC,
  svg_element: kC
} = window.__gradio__svelte__internal, {
  SvelteComponent: SC,
  append_hydration: DC,
  attr: xC,
  children: AC,
  claim_svg_element: EC,
  detach: CC,
  init: $C,
  insert_hydration: TC,
  noop: FC,
  safe_not_equal: MC,
  svg_element: zC
} = window.__gradio__svelte__internal, {
  SvelteComponent: BC,
  append_hydration: NC,
  attr: qC,
  children: LC,
  claim_svg_element: IC,
  detach: RC,
  init: OC,
  insert_hydration: PC,
  noop: HC,
  safe_not_equal: UC,
  svg_element: GC
} = window.__gradio__svelte__internal, {
  SvelteComponent: jC,
  append_hydration: VC,
  attr: WC,
  children: KC,
  claim_svg_element: YC,
  detach: XC,
  init: ZC,
  insert_hydration: QC,
  noop: JC,
  safe_not_equal: e$,
  svg_element: t$
} = window.__gradio__svelte__internal, {
  SvelteComponent: n$,
  append_hydration: r$,
  attr: a$,
  children: i$,
  claim_svg_element: s$,
  detach: l$,
  init: o$,
  insert_hydration: u$,
  noop: c$,
  safe_not_equal: h$,
  svg_element: f$
} = window.__gradio__svelte__internal, {
  SvelteComponent: d$,
  append_hydration: m$,
  attr: p$,
  children: g$,
  claim_svg_element: _$,
  detach: v$,
  init: b$,
  insert_hydration: y$,
  noop: w$,
  safe_not_equal: k$,
  svg_element: S$
} = window.__gradio__svelte__internal, {
  SvelteComponent: D$,
  append_hydration: x$,
  attr: A$,
  children: E$,
  claim_svg_element: C$,
  detach: $$,
  init: T$,
  insert_hydration: F$,
  noop: M$,
  safe_not_equal: z$,
  svg_element: B$
} = window.__gradio__svelte__internal, Gp = [
  { color: "red", primary: 600, secondary: 100 },
  { color: "green", primary: 600, secondary: 100 },
  { color: "blue", primary: 600, secondary: 100 },
  { color: "yellow", primary: 500, secondary: 100 },
  { color: "purple", primary: 600, secondary: 100 },
  { color: "teal", primary: 600, secondary: 100 },
  { color: "orange", primary: 600, secondary: 100 },
  { color: "cyan", primary: 600, secondary: 100 },
  { color: "lime", primary: 500, secondary: 100 },
  { color: "pink", primary: 600, secondary: 100 }
], Au = {
  inherit: "inherit",
  current: "currentColor",
  transparent: "transparent",
  black: "#000",
  white: "#fff",
  slate: {
    50: "#f8fafc",
    100: "#f1f5f9",
    200: "#e2e8f0",
    300: "#cbd5e1",
    400: "#94a3b8",
    500: "#64748b",
    600: "#475569",
    700: "#334155",
    800: "#1e293b",
    900: "#0f172a",
    950: "#020617"
  },
  gray: {
    50: "#f9fafb",
    100: "#f3f4f6",
    200: "#e5e7eb",
    300: "#d1d5db",
    400: "#9ca3af",
    500: "#6b7280",
    600: "#4b5563",
    700: "#374151",
    800: "#1f2937",
    900: "#111827",
    950: "#030712"
  },
  zinc: {
    50: "#fafafa",
    100: "#f4f4f5",
    200: "#e4e4e7",
    300: "#d4d4d8",
    400: "#a1a1aa",
    500: "#71717a",
    600: "#52525b",
    700: "#3f3f46",
    800: "#27272a",
    900: "#18181b",
    950: "#09090b"
  },
  neutral: {
    50: "#fafafa",
    100: "#f5f5f5",
    200: "#e5e5e5",
    300: "#d4d4d4",
    400: "#a3a3a3",
    500: "#737373",
    600: "#525252",
    700: "#404040",
    800: "#262626",
    900: "#171717",
    950: "#0a0a0a"
  },
  stone: {
    50: "#fafaf9",
    100: "#f5f5f4",
    200: "#e7e5e4",
    300: "#d6d3d1",
    400: "#a8a29e",
    500: "#78716c",
    600: "#57534e",
    700: "#44403c",
    800: "#292524",
    900: "#1c1917",
    950: "#0c0a09"
  },
  red: {
    50: "#fef2f2",
    100: "#fee2e2",
    200: "#fecaca",
    300: "#fca5a5",
    400: "#f87171",
    500: "#ef4444",
    600: "#dc2626",
    700: "#b91c1c",
    800: "#991b1b",
    900: "#7f1d1d",
    950: "#450a0a"
  },
  orange: {
    50: "#fff7ed",
    100: "#ffedd5",
    200: "#fed7aa",
    300: "#fdba74",
    400: "#fb923c",
    500: "#f97316",
    600: "#ea580c",
    700: "#c2410c",
    800: "#9a3412",
    900: "#7c2d12",
    950: "#431407"
  },
  amber: {
    50: "#fffbeb",
    100: "#fef3c7",
    200: "#fde68a",
    300: "#fcd34d",
    400: "#fbbf24",
    500: "#f59e0b",
    600: "#d97706",
    700: "#b45309",
    800: "#92400e",
    900: "#78350f",
    950: "#451a03"
  },
  yellow: {
    50: "#fefce8",
    100: "#fef9c3",
    200: "#fef08a",
    300: "#fde047",
    400: "#facc15",
    500: "#eab308",
    600: "#ca8a04",
    700: "#a16207",
    800: "#854d0e",
    900: "#713f12",
    950: "#422006"
  },
  lime: {
    50: "#f7fee7",
    100: "#ecfccb",
    200: "#d9f99d",
    300: "#bef264",
    400: "#a3e635",
    500: "#84cc16",
    600: "#65a30d",
    700: "#4d7c0f",
    800: "#3f6212",
    900: "#365314",
    950: "#1a2e05"
  },
  green: {
    50: "#f0fdf4",
    100: "#dcfce7",
    200: "#bbf7d0",
    300: "#86efac",
    400: "#4ade80",
    500: "#22c55e",
    600: "#16a34a",
    700: "#15803d",
    800: "#166534",
    900: "#14532d",
    950: "#052e16"
  },
  emerald: {
    50: "#ecfdf5",
    100: "#d1fae5",
    200: "#a7f3d0",
    300: "#6ee7b7",
    400: "#34d399",
    500: "#10b981",
    600: "#059669",
    700: "#047857",
    800: "#065f46",
    900: "#064e3b",
    950: "#022c22"
  },
  teal: {
    50: "#f0fdfa",
    100: "#ccfbf1",
    200: "#99f6e4",
    300: "#5eead4",
    400: "#2dd4bf",
    500: "#14b8a6",
    600: "#0d9488",
    700: "#0f766e",
    800: "#115e59",
    900: "#134e4a",
    950: "#042f2e"
  },
  cyan: {
    50: "#ecfeff",
    100: "#cffafe",
    200: "#a5f3fc",
    300: "#67e8f9",
    400: "#22d3ee",
    500: "#06b6d4",
    600: "#0891b2",
    700: "#0e7490",
    800: "#155e75",
    900: "#164e63",
    950: "#083344"
  },
  sky: {
    50: "#f0f9ff",
    100: "#e0f2fe",
    200: "#bae6fd",
    300: "#7dd3fc",
    400: "#38bdf8",
    500: "#0ea5e9",
    600: "#0284c7",
    700: "#0369a1",
    800: "#075985",
    900: "#0c4a6e",
    950: "#082f49"
  },
  blue: {
    50: "#eff6ff",
    100: "#dbeafe",
    200: "#bfdbfe",
    300: "#93c5fd",
    400: "#60a5fa",
    500: "#3b82f6",
    600: "#2563eb",
    700: "#1d4ed8",
    800: "#1e40af",
    900: "#1e3a8a",
    950: "#172554"
  },
  indigo: {
    50: "#eef2ff",
    100: "#e0e7ff",
    200: "#c7d2fe",
    300: "#a5b4fc",
    400: "#818cf8",
    500: "#6366f1",
    600: "#4f46e5",
    700: "#4338ca",
    800: "#3730a3",
    900: "#312e81",
    950: "#1e1b4b"
  },
  violet: {
    50: "#f5f3ff",
    100: "#ede9fe",
    200: "#ddd6fe",
    300: "#c4b5fd",
    400: "#a78bfa",
    500: "#8b5cf6",
    600: "#7c3aed",
    700: "#6d28d9",
    800: "#5b21b6",
    900: "#4c1d95",
    950: "#2e1065"
  },
  purple: {
    50: "#faf5ff",
    100: "#f3e8ff",
    200: "#e9d5ff",
    300: "#d8b4fe",
    400: "#c084fc",
    500: "#a855f7",
    600: "#9333ea",
    700: "#7e22ce",
    800: "#6b21a8",
    900: "#581c87",
    950: "#3b0764"
  },
  fuchsia: {
    50: "#fdf4ff",
    100: "#fae8ff",
    200: "#f5d0fe",
    300: "#f0abfc",
    400: "#e879f9",
    500: "#d946ef",
    600: "#c026d3",
    700: "#a21caf",
    800: "#86198f",
    900: "#701a75",
    950: "#4a044e"
  },
  pink: {
    50: "#fdf2f8",
    100: "#fce7f3",
    200: "#fbcfe8",
    300: "#f9a8d4",
    400: "#f472b6",
    500: "#ec4899",
    600: "#db2777",
    700: "#be185d",
    800: "#9d174d",
    900: "#831843",
    950: "#500724"
  },
  rose: {
    50: "#fff1f2",
    100: "#ffe4e6",
    200: "#fecdd3",
    300: "#fda4af",
    400: "#fb7185",
    500: "#f43f5e",
    600: "#e11d48",
    700: "#be123c",
    800: "#9f1239",
    900: "#881337",
    950: "#4c0519"
  }
};
Gp.reduce(
  (r, { color: e, primary: t, secondary: n }) => ({
    ...r,
    [e]: {
      primary: Au[e][t],
      secondary: Au[e][n]
    }
  }),
  {}
);
const {
  SvelteComponent: N$,
  claim_component: q$,
  create_component: L$,
  destroy_component: I$,
  init: R$,
  mount_component: O$,
  safe_not_equal: P$,
  transition_in: H$,
  transition_out: U$
} = window.__gradio__svelte__internal, { createEventDispatcher: G$ } = window.__gradio__svelte__internal, {
  SvelteComponent: j$,
  append_hydration: V$,
  attr: W$,
  check_outros: K$,
  children: Y$,
  claim_component: X$,
  claim_element: Z$,
  claim_space: Q$,
  claim_text: J$,
  create_component: eT,
  destroy_component: tT,
  detach: nT,
  element: rT,
  empty: aT,
  group_outros: iT,
  init: sT,
  insert_hydration: lT,
  mount_component: oT,
  safe_not_equal: uT,
  set_data: cT,
  space: hT,
  text: fT,
  toggle_class: dT,
  transition_in: mT,
  transition_out: pT
} = window.__gradio__svelte__internal, {
  SvelteComponent: gT,
  attr: _T,
  children: vT,
  claim_element: bT,
  create_slot: yT,
  detach: wT,
  element: kT,
  get_all_dirty_from_scope: ST,
  get_slot_changes: DT,
  init: xT,
  insert_hydration: AT,
  safe_not_equal: ET,
  toggle_class: CT,
  transition_in: $T,
  transition_out: TT,
  update_slot_base: FT
} = window.__gradio__svelte__internal, {
  SvelteComponent: MT,
  append_hydration: zT,
  attr: BT,
  check_outros: NT,
  children: qT,
  claim_component: LT,
  claim_element: IT,
  claim_space: RT,
  create_component: OT,
  destroy_component: PT,
  detach: HT,
  element: UT,
  empty: GT,
  group_outros: jT,
  init: VT,
  insert_hydration: WT,
  listen: KT,
  mount_component: YT,
  safe_not_equal: XT,
  space: ZT,
  toggle_class: QT,
  transition_in: JT,
  transition_out: eF
} = window.__gradio__svelte__internal, {
  SvelteComponent: tF,
  attr: nF,
  children: rF,
  claim_element: aF,
  create_slot: iF,
  detach: sF,
  element: lF,
  get_all_dirty_from_scope: oF,
  get_slot_changes: uF,
  init: cF,
  insert_hydration: hF,
  null_to_empty: fF,
  safe_not_equal: dF,
  transition_in: mF,
  transition_out: pF,
  update_slot_base: gF
} = window.__gradio__svelte__internal, {
  SvelteComponent: _F,
  check_outros: vF,
  claim_component: bF,
  create_component: yF,
  destroy_component: wF,
  detach: kF,
  empty: SF,
  group_outros: DF,
  init: xF,
  insert_hydration: AF,
  mount_component: EF,
  noop: CF,
  safe_not_equal: $F,
  transition_in: TF,
  transition_out: FF
} = window.__gradio__svelte__internal, { createEventDispatcher: MF } = window.__gradio__svelte__internal;
function vr(r) {
  let e = ["", "k", "M", "G", "T", "P", "E", "Z"], t = 0;
  for (; r > 1e3 && t < e.length - 1; )
    r /= 1e3, t++;
  let n = e[t];
  return (Number.isInteger(r) ? r : r.toFixed(1)) + n;
}
function di() {
}
const jp = (r) => r;
function Vp(r, e) {
  return r != r ? e == e : r !== e || r && typeof r == "object" || typeof r == "function";
}
const bh = typeof window < "u";
let Eu = bh ? () => window.performance.now() : () => Date.now(), yh = bh ? (r) => requestAnimationFrame(r) : di;
const wr = /* @__PURE__ */ new Set();
function wh(r) {
  wr.forEach((e) => {
    e.c(r) || (wr.delete(e), e.f());
  }), wr.size !== 0 && yh(wh);
}
function Wp(r) {
  let e;
  return wr.size === 0 && yh(wh), {
    promise: new Promise((t) => {
      wr.add(e = { c: r, f: t });
    }),
    abort() {
      wr.delete(e);
    }
  };
}
function Kp(r, { delay: e = 0, duration: t = 400, easing: n = jp } = {}) {
  const a = +getComputedStyle(r).opacity;
  return {
    delay: e,
    duration: t,
    easing: n,
    css: (i) => `opacity: ${i * a}`
  };
}
const pr = [];
function Yp(r, e = di) {
  let t;
  const n = /* @__PURE__ */ new Set();
  function a(l) {
    if (Vp(r, l) && (r = l, t)) {
      const o = !pr.length;
      for (const u of n)
        u[1](), pr.push(u, r);
      if (o) {
        for (let u = 0; u < pr.length; u += 2)
          pr[u][0](pr[u + 1]);
        pr.length = 0;
      }
    }
  }
  function i(l) {
    a(l(r));
  }
  function s(l, o = di) {
    const u = [l, o];
    return n.add(u), n.size === 1 && (t = e(a, i) || di), l(r), () => {
      n.delete(u), n.size === 0 && t && (t(), t = null);
    };
  }
  return { set: a, update: i, subscribe: s };
}
function Cu(r) {
  return Object.prototype.toString.call(r) === "[object Date]";
}
function fl(r, e, t, n) {
  if (typeof t == "number" || Cu(t)) {
    const a = n - t, i = (t - e) / (r.dt || 1 / 60), s = r.opts.stiffness * a, l = r.opts.damping * i, o = (s - l) * r.inv_mass, u = (i + o) * r.dt;
    return Math.abs(u) < r.opts.precision && Math.abs(a) < r.opts.precision ? n : (r.settled = !1, Cu(t) ? new Date(t.getTime() + u) : t + u);
  } else {
    if (Array.isArray(t))
      return t.map(
        (a, i) => fl(r, e[i], t[i], n[i])
      );
    if (typeof t == "object") {
      const a = {};
      for (const i in t)
        a[i] = fl(r, e[i], t[i], n[i]);
      return a;
    } else
      throw new Error(`Cannot spring ${typeof t} values`);
  }
}
function $u(r, e = {}) {
  const t = Yp(r), { stiffness: n = 0.15, damping: a = 0.8, precision: i = 0.01 } = e;
  let s, l, o, u = r, h = r, m = 1, d = 0, g = !1;
  function b(w, x = {}) {
    h = w;
    const k = o = {};
    return r == null || x.hard || v.stiffness >= 1 && v.damping >= 1 ? (g = !0, s = Eu(), u = w, t.set(r = h), Promise.resolve()) : (x.soft && (d = 1 / ((x.soft === !0 ? 0.5 : +x.soft) * 60), m = 0), l || (s = Eu(), g = !1, l = Wp((y) => {
      if (g)
        return g = !1, l = null, !1;
      m = Math.min(m + d, 1);
      const A = {
        inv_mass: m,
        opts: v,
        settled: !0,
        dt: (y - s) * 60 / 1e3
      }, $ = fl(A, u, r, h);
      return s = y, u = r, t.set(r = $), A.settled && (l = null), !A.settled;
    })), new Promise((y) => {
      l.promise.then(() => {
        k === o && y();
      });
    }));
  }
  const v = {
    set: b,
    update: (w, x) => b(w(h, r), x),
    subscribe: t.subscribe,
    stiffness: n,
    damping: a,
    precision: i
  };
  return v;
}
const {
  SvelteComponent: Xp,
  append_hydration: $n,
  attr: De,
  children: fn,
  claim_element: Zp,
  claim_svg_element: Tn,
  component_subscribe: Tu,
  detach: tn,
  element: Qp,
  init: Jp,
  insert_hydration: e5,
  noop: Fu,
  safe_not_equal: t5,
  set_style: Va,
  svg_element: Fn,
  toggle_class: Mu
} = window.__gradio__svelte__internal, { onMount: n5 } = window.__gradio__svelte__internal;
function r5(r) {
  let e, t, n, a, i, s, l, o, u, h, m, d;
  return {
    c() {
      e = Qp("div"), t = Fn("svg"), n = Fn("g"), a = Fn("path"), i = Fn("path"), s = Fn("path"), l = Fn("path"), o = Fn("g"), u = Fn("path"), h = Fn("path"), m = Fn("path"), d = Fn("path"), this.h();
    },
    l(g) {
      e = Zp(g, "DIV", { class: !0 });
      var b = fn(e);
      t = Tn(b, "svg", {
        viewBox: !0,
        fill: !0,
        xmlns: !0,
        class: !0
      });
      var v = fn(t);
      n = Tn(v, "g", { style: !0 });
      var w = fn(n);
      a = Tn(w, "path", {
        d: !0,
        fill: !0,
        "fill-opacity": !0,
        class: !0
      }), fn(a).forEach(tn), i = Tn(w, "path", { d: !0, fill: !0, class: !0 }), fn(i).forEach(tn), s = Tn(w, "path", {
        d: !0,
        fill: !0,
        "fill-opacity": !0,
        class: !0
      }), fn(s).forEach(tn), l = Tn(w, "path", { d: !0, fill: !0, class: !0 }), fn(l).forEach(tn), w.forEach(tn), o = Tn(v, "g", { style: !0 });
      var x = fn(o);
      u = Tn(x, "path", {
        d: !0,
        fill: !0,
        "fill-opacity": !0,
        class: !0
      }), fn(u).forEach(tn), h = Tn(x, "path", { d: !0, fill: !0, class: !0 }), fn(h).forEach(tn), m = Tn(x, "path", {
        d: !0,
        fill: !0,
        "fill-opacity": !0,
        class: !0
      }), fn(m).forEach(tn), d = Tn(x, "path", { d: !0, fill: !0, class: !0 }), fn(d).forEach(tn), x.forEach(tn), v.forEach(tn), b.forEach(tn), this.h();
    },
    h() {
      De(a, "d", "M255.926 0.754768L509.702 139.936V221.027L255.926 81.8465V0.754768Z"), De(a, "fill", "#FF7C00"), De(a, "fill-opacity", "0.4"), De(a, "class", "svelte-43sxxs"), De(i, "d", "M509.69 139.936L254.981 279.641V361.255L509.69 221.55V139.936Z"), De(i, "fill", "#FF7C00"), De(i, "class", "svelte-43sxxs"), De(s, "d", "M0.250138 139.937L254.981 279.641V361.255L0.250138 221.55V139.937Z"), De(s, "fill", "#FF7C00"), De(s, "fill-opacity", "0.4"), De(s, "class", "svelte-43sxxs"), De(l, "d", "M255.923 0.232622L0.236328 139.936V221.55L255.923 81.8469V0.232622Z"), De(l, "fill", "#FF7C00"), De(l, "class", "svelte-43sxxs"), Va(n, "transform", "translate(" + /*$top*/
      r[1][0] + "px, " + /*$top*/
      r[1][1] + "px)"), De(u, "d", "M255.926 141.5L509.702 280.681V361.773L255.926 222.592V141.5Z"), De(u, "fill", "#FF7C00"), De(u, "fill-opacity", "0.4"), De(u, "class", "svelte-43sxxs"), De(h, "d", "M509.69 280.679L254.981 420.384V501.998L509.69 362.293V280.679Z"), De(h, "fill", "#FF7C00"), De(h, "class", "svelte-43sxxs"), De(m, "d", "M0.250138 280.681L254.981 420.386V502L0.250138 362.295V280.681Z"), De(m, "fill", "#FF7C00"), De(m, "fill-opacity", "0.4"), De(m, "class", "svelte-43sxxs"), De(d, "d", "M255.923 140.977L0.236328 280.68V362.294L255.923 222.591V140.977Z"), De(d, "fill", "#FF7C00"), De(d, "class", "svelte-43sxxs"), Va(o, "transform", "translate(" + /*$bottom*/
      r[2][0] + "px, " + /*$bottom*/
      r[2][1] + "px)"), De(t, "viewBox", "-1200 -1200 3000 3000"), De(t, "fill", "none"), De(t, "xmlns", "http://www.w3.org/2000/svg"), De(t, "class", "svelte-43sxxs"), De(e, "class", "svelte-43sxxs"), Mu(
        e,
        "margin",
        /*margin*/
        r[0]
      );
    },
    m(g, b) {
      e5(g, e, b), $n(e, t), $n(t, n), $n(n, a), $n(n, i), $n(n, s), $n(n, l), $n(t, o), $n(o, u), $n(o, h), $n(o, m), $n(o, d);
    },
    p(g, [b]) {
      b & /*$top*/
      2 && Va(n, "transform", "translate(" + /*$top*/
      g[1][0] + "px, " + /*$top*/
      g[1][1] + "px)"), b & /*$bottom*/
      4 && Va(o, "transform", "translate(" + /*$bottom*/
      g[2][0] + "px, " + /*$bottom*/
      g[2][1] + "px)"), b & /*margin*/
      1 && Mu(
        e,
        "margin",
        /*margin*/
        g[0]
      );
    },
    i: Fu,
    o: Fu,
    d(g) {
      g && tn(e);
    }
  };
}
function a5(r, e, t) {
  let n, a, { margin: i = !0 } = e;
  const s = $u([0, 0]);
  Tu(r, s, (d) => t(1, n = d));
  const l = $u([0, 0]);
  Tu(r, l, (d) => t(2, a = d));
  let o;
  async function u() {
    await Promise.all([s.set([125, 140]), l.set([-125, -140])]), await Promise.all([s.set([-125, 140]), l.set([125, -140])]), await Promise.all([s.set([-125, 0]), l.set([125, -0])]), await Promise.all([s.set([125, 0]), l.set([-125, 0])]);
  }
  async function h() {
    await u(), o || h();
  }
  async function m() {
    await Promise.all([s.set([125, 0]), l.set([-125, 0])]), h();
  }
  return n5(() => (m(), () => o = !0)), r.$$set = (d) => {
    "margin" in d && t(0, i = d.margin);
  }, [i, n, a, s, l];
}
class i5 extends Xp {
  constructor(e) {
    super(), Jp(this, e, a5, r5, t5, { margin: 0 });
  }
}
const {
  SvelteComponent: s5,
  append_hydration: K0,
  attr: Nn,
  binding_callbacks: zu,
  check_outros: dl,
  children: Vn,
  claim_component: kh,
  claim_element: Wn,
  claim_space: _n,
  claim_text: Ke,
  create_component: Sh,
  create_slot: Dh,
  destroy_component: xh,
  destroy_each: Ah,
  detach: re,
  element: Kn,
  empty: Sn,
  ensure_array_like: Ei,
  get_all_dirty_from_scope: Eh,
  get_slot_changes: Ch,
  group_outros: ml,
  init: l5,
  insert_hydration: de,
  mount_component: $h,
  noop: pl,
  safe_not_equal: o5,
  set_data: Dn,
  set_style: z0,
  space: vn,
  text: Ye,
  toggle_class: pn,
  transition_in: Bn,
  transition_out: Yn,
  update_slot_base: Th
} = window.__gradio__svelte__internal, { tick: u5 } = window.__gradio__svelte__internal, { onDestroy: c5 } = window.__gradio__svelte__internal, { createEventDispatcher: h5 } = window.__gradio__svelte__internal, f5 = (r) => ({}), Bu = (r) => ({}), d5 = (r) => ({}), Nu = (r) => ({});
function qu(r, e, t) {
  const n = r.slice();
  return n[40] = e[t], n[42] = t, n;
}
function Lu(r, e, t) {
  const n = r.slice();
  return n[40] = e[t], n;
}
function m5(r) {
  let e, t, n, a, i = (
    /*i18n*/
    r[1]("common.error") + ""
  ), s, l, o;
  t = new cp({
    props: {
      Icon: Sp,
      label: (
        /*i18n*/
        r[1]("common.clear")
      ),
      disabled: !1
    }
  }), t.$on(
    "click",
    /*click_handler*/
    r[32]
  );
  const u = (
    /*#slots*/
    r[30].error
  ), h = Dh(
    u,
    r,
    /*$$scope*/
    r[29],
    Bu
  );
  return {
    c() {
      e = Kn("div"), Sh(t.$$.fragment), n = vn(), a = Kn("span"), s = Ye(i), l = vn(), h && h.c(), this.h();
    },
    l(m) {
      e = Wn(m, "DIV", { class: !0 });
      var d = Vn(e);
      kh(t.$$.fragment, d), d.forEach(re), n = _n(m), a = Wn(m, "SPAN", { class: !0 });
      var g = Vn(a);
      s = Ke(g, i), g.forEach(re), l = _n(m), h && h.l(m), this.h();
    },
    h() {
      Nn(e, "class", "clear-status svelte-17v219f"), Nn(a, "class", "error svelte-17v219f");
    },
    m(m, d) {
      de(m, e, d), $h(t, e, null), de(m, n, d), de(m, a, d), K0(a, s), de(m, l, d), h && h.m(m, d), o = !0;
    },
    p(m, d) {
      const g = {};
      d[0] & /*i18n*/
      2 && (g.label = /*i18n*/
      m[1]("common.clear")), t.$set(g), (!o || d[0] & /*i18n*/
      2) && i !== (i = /*i18n*/
      m[1]("common.error") + "") && Dn(s, i), h && h.p && (!o || d[0] & /*$$scope*/
      536870912) && Th(
        h,
        u,
        m,
        /*$$scope*/
        m[29],
        o ? Ch(
          u,
          /*$$scope*/
          m[29],
          d,
          f5
        ) : Eh(
          /*$$scope*/
          m[29]
        ),
        Bu
      );
    },
    i(m) {
      o || (Bn(t.$$.fragment, m), Bn(h, m), o = !0);
    },
    o(m) {
      Yn(t.$$.fragment, m), Yn(h, m), o = !1;
    },
    d(m) {
      m && (re(e), re(n), re(a), re(l)), xh(t), h && h.d(m);
    }
  };
}
function p5(r) {
  let e, t, n, a, i, s, l, o, u, h = (
    /*variant*/
    r[8] === "default" && /*show_eta_bar*/
    r[18] && /*show_progress*/
    r[6] === "full" && Iu(r)
  );
  function m(y, A) {
    if (
      /*progress*/
      y[7]
    ) return v5;
    if (
      /*queue_position*/
      y[2] !== null && /*queue_size*/
      y[3] !== void 0 && /*queue_position*/
      y[2] >= 0
    ) return _5;
    if (
      /*queue_position*/
      y[2] === 0
    ) return g5;
  }
  let d = m(r), g = d && d(r), b = (
    /*timer*/
    r[5] && Pu(r)
  );
  const v = [k5, w5], w = [];
  function x(y, A) {
    return (
      /*last_progress_level*/
      y[15] != null ? 0 : (
        /*show_progress*/
        y[6] === "full" ? 1 : -1
      )
    );
  }
  ~(i = x(r)) && (s = w[i] = v[i](r));
  let k = !/*timer*/
  r[5] && Ku(r);
  return {
    c() {
      h && h.c(), e = vn(), t = Kn("div"), g && g.c(), n = vn(), b && b.c(), a = vn(), s && s.c(), l = vn(), k && k.c(), o = Sn(), this.h();
    },
    l(y) {
      h && h.l(y), e = _n(y), t = Wn(y, "DIV", { class: !0 });
      var A = Vn(t);
      g && g.l(A), n = _n(A), b && b.l(A), A.forEach(re), a = _n(y), s && s.l(y), l = _n(y), k && k.l(y), o = Sn(), this.h();
    },
    h() {
      Nn(t, "class", "progress-text svelte-17v219f"), pn(
        t,
        "meta-text-center",
        /*variant*/
        r[8] === "center"
      ), pn(
        t,
        "meta-text",
        /*variant*/
        r[8] === "default"
      );
    },
    m(y, A) {
      h && h.m(y, A), de(y, e, A), de(y, t, A), g && g.m(t, null), K0(t, n), b && b.m(t, null), de(y, a, A), ~i && w[i].m(y, A), de(y, l, A), k && k.m(y, A), de(y, o, A), u = !0;
    },
    p(y, A) {
      /*variant*/
      y[8] === "default" && /*show_eta_bar*/
      y[18] && /*show_progress*/
      y[6] === "full" ? h ? h.p(y, A) : (h = Iu(y), h.c(), h.m(e.parentNode, e)) : h && (h.d(1), h = null), d === (d = m(y)) && g ? g.p(y, A) : (g && g.d(1), g = d && d(y), g && (g.c(), g.m(t, n))), /*timer*/
      y[5] ? b ? b.p(y, A) : (b = Pu(y), b.c(), b.m(t, null)) : b && (b.d(1), b = null), (!u || A[0] & /*variant*/
      256) && pn(
        t,
        "meta-text-center",
        /*variant*/
        y[8] === "center"
      ), (!u || A[0] & /*variant*/
      256) && pn(
        t,
        "meta-text",
        /*variant*/
        y[8] === "default"
      );
      let $ = i;
      i = x(y), i === $ ? ~i && w[i].p(y, A) : (s && (ml(), Yn(w[$], 1, 1, () => {
        w[$] = null;
      }), dl()), ~i ? (s = w[i], s ? s.p(y, A) : (s = w[i] = v[i](y), s.c()), Bn(s, 1), s.m(l.parentNode, l)) : s = null), /*timer*/
      y[5] ? k && (ml(), Yn(k, 1, 1, () => {
        k = null;
      }), dl()) : k ? (k.p(y, A), A[0] & /*timer*/
      32 && Bn(k, 1)) : (k = Ku(y), k.c(), Bn(k, 1), k.m(o.parentNode, o));
    },
    i(y) {
      u || (Bn(s), Bn(k), u = !0);
    },
    o(y) {
      Yn(s), Yn(k), u = !1;
    },
    d(y) {
      y && (re(e), re(t), re(a), re(l), re(o)), h && h.d(y), g && g.d(), b && b.d(), ~i && w[i].d(y), k && k.d(y);
    }
  };
}
function Iu(r) {
  let e, t = `translateX(${/*eta_level*/
  (r[17] || 0) * 100 - 100}%)`;
  return {
    c() {
      e = Kn("div"), this.h();
    },
    l(n) {
      e = Wn(n, "DIV", { class: !0 }), Vn(e).forEach(re), this.h();
    },
    h() {
      Nn(e, "class", "eta-bar svelte-17v219f"), z0(e, "transform", t);
    },
    m(n, a) {
      de(n, e, a);
    },
    p(n, a) {
      a[0] & /*eta_level*/
      131072 && t !== (t = `translateX(${/*eta_level*/
      (n[17] || 0) * 100 - 100}%)`) && z0(e, "transform", t);
    },
    d(n) {
      n && re(e);
    }
  };
}
function g5(r) {
  let e;
  return {
    c() {
      e = Ye("processing |");
    },
    l(t) {
      e = Ke(t, "processing |");
    },
    m(t, n) {
      de(t, e, n);
    },
    p: pl,
    d(t) {
      t && re(e);
    }
  };
}
function _5(r) {
  let e, t = (
    /*queue_position*/
    r[2] + 1 + ""
  ), n, a, i, s;
  return {
    c() {
      e = Ye("queue: "), n = Ye(t), a = Ye("/"), i = Ye(
        /*queue_size*/
        r[3]
      ), s = Ye(" |");
    },
    l(l) {
      e = Ke(l, "queue: "), n = Ke(l, t), a = Ke(l, "/"), i = Ke(
        l,
        /*queue_size*/
        r[3]
      ), s = Ke(l, " |");
    },
    m(l, o) {
      de(l, e, o), de(l, n, o), de(l, a, o), de(l, i, o), de(l, s, o);
    },
    p(l, o) {
      o[0] & /*queue_position*/
      4 && t !== (t = /*queue_position*/
      l[2] + 1 + "") && Dn(n, t), o[0] & /*queue_size*/
      8 && Dn(
        i,
        /*queue_size*/
        l[3]
      );
    },
    d(l) {
      l && (re(e), re(n), re(a), re(i), re(s));
    }
  };
}
function v5(r) {
  let e, t = Ei(
    /*progress*/
    r[7]
  ), n = [];
  for (let a = 0; a < t.length; a += 1)
    n[a] = Ou(Lu(r, t, a));
  return {
    c() {
      for (let a = 0; a < n.length; a += 1)
        n[a].c();
      e = Sn();
    },
    l(a) {
      for (let i = 0; i < n.length; i += 1)
        n[i].l(a);
      e = Sn();
    },
    m(a, i) {
      for (let s = 0; s < n.length; s += 1)
        n[s] && n[s].m(a, i);
      de(a, e, i);
    },
    p(a, i) {
      if (i[0] & /*progress*/
      128) {
        t = Ei(
          /*progress*/
          a[7]
        );
        let s;
        for (s = 0; s < t.length; s += 1) {
          const l = Lu(a, t, s);
          n[s] ? n[s].p(l, i) : (n[s] = Ou(l), n[s].c(), n[s].m(e.parentNode, e));
        }
        for (; s < n.length; s += 1)
          n[s].d(1);
        n.length = t.length;
      }
    },
    d(a) {
      a && re(e), Ah(n, a);
    }
  };
}
function Ru(r) {
  let e, t = (
    /*p*/
    r[40].unit + ""
  ), n, a, i = " ", s;
  function l(h, m) {
    return (
      /*p*/
      h[40].length != null ? y5 : b5
    );
  }
  let o = l(r), u = o(r);
  return {
    c() {
      u.c(), e = vn(), n = Ye(t), a = Ye(" | "), s = Ye(i);
    },
    l(h) {
      u.l(h), e = _n(h), n = Ke(h, t), a = Ke(h, " | "), s = Ke(h, i);
    },
    m(h, m) {
      u.m(h, m), de(h, e, m), de(h, n, m), de(h, a, m), de(h, s, m);
    },
    p(h, m) {
      o === (o = l(h)) && u ? u.p(h, m) : (u.d(1), u = o(h), u && (u.c(), u.m(e.parentNode, e))), m[0] & /*progress*/
      128 && t !== (t = /*p*/
      h[40].unit + "") && Dn(n, t);
    },
    d(h) {
      h && (re(e), re(n), re(a), re(s)), u.d(h);
    }
  };
}
function b5(r) {
  let e = vr(
    /*p*/
    r[40].index || 0
  ) + "", t;
  return {
    c() {
      t = Ye(e);
    },
    l(n) {
      t = Ke(n, e);
    },
    m(n, a) {
      de(n, t, a);
    },
    p(n, a) {
      a[0] & /*progress*/
      128 && e !== (e = vr(
        /*p*/
        n[40].index || 0
      ) + "") && Dn(t, e);
    },
    d(n) {
      n && re(t);
    }
  };
}
function y5(r) {
  let e = vr(
    /*p*/
    r[40].index || 0
  ) + "", t, n, a = vr(
    /*p*/
    r[40].length
  ) + "", i;
  return {
    c() {
      t = Ye(e), n = Ye("/"), i = Ye(a);
    },
    l(s) {
      t = Ke(s, e), n = Ke(s, "/"), i = Ke(s, a);
    },
    m(s, l) {
      de(s, t, l), de(s, n, l), de(s, i, l);
    },
    p(s, l) {
      l[0] & /*progress*/
      128 && e !== (e = vr(
        /*p*/
        s[40].index || 0
      ) + "") && Dn(t, e), l[0] & /*progress*/
      128 && a !== (a = vr(
        /*p*/
        s[40].length
      ) + "") && Dn(i, a);
    },
    d(s) {
      s && (re(t), re(n), re(i));
    }
  };
}
function Ou(r) {
  let e, t = (
    /*p*/
    r[40].index != null && Ru(r)
  );
  return {
    c() {
      t && t.c(), e = Sn();
    },
    l(n) {
      t && t.l(n), e = Sn();
    },
    m(n, a) {
      t && t.m(n, a), de(n, e, a);
    },
    p(n, a) {
      /*p*/
      n[40].index != null ? t ? t.p(n, a) : (t = Ru(n), t.c(), t.m(e.parentNode, e)) : t && (t.d(1), t = null);
    },
    d(n) {
      n && re(e), t && t.d(n);
    }
  };
}
function Pu(r) {
  let e, t = (
    /*eta*/
    r[0] ? `/${/*formatted_eta*/
    r[19]}` : ""
  ), n, a;
  return {
    c() {
      e = Ye(
        /*formatted_timer*/
        r[20]
      ), n = Ye(t), a = Ye("s");
    },
    l(i) {
      e = Ke(
        i,
        /*formatted_timer*/
        r[20]
      ), n = Ke(i, t), a = Ke(i, "s");
    },
    m(i, s) {
      de(i, e, s), de(i, n, s), de(i, a, s);
    },
    p(i, s) {
      s[0] & /*formatted_timer*/
      1048576 && Dn(
        e,
        /*formatted_timer*/
        i[20]
      ), s[0] & /*eta, formatted_eta*/
      524289 && t !== (t = /*eta*/
      i[0] ? `/${/*formatted_eta*/
      i[19]}` : "") && Dn(n, t);
    },
    d(i) {
      i && (re(e), re(n), re(a));
    }
  };
}
function w5(r) {
  let e, t;
  return e = new i5({
    props: { margin: (
      /*variant*/
      r[8] === "default"
    ) }
  }), {
    c() {
      Sh(e.$$.fragment);
    },
    l(n) {
      kh(e.$$.fragment, n);
    },
    m(n, a) {
      $h(e, n, a), t = !0;
    },
    p(n, a) {
      const i = {};
      a[0] & /*variant*/
      256 && (i.margin = /*variant*/
      n[8] === "default"), e.$set(i);
    },
    i(n) {
      t || (Bn(e.$$.fragment, n), t = !0);
    },
    o(n) {
      Yn(e.$$.fragment, n), t = !1;
    },
    d(n) {
      xh(e, n);
    }
  };
}
function k5(r) {
  let e, t, n, a, i, s = `${/*last_progress_level*/
  r[15] * 100}%`, l = (
    /*progress*/
    r[7] != null && Hu(r)
  );
  return {
    c() {
      e = Kn("div"), t = Kn("div"), l && l.c(), n = vn(), a = Kn("div"), i = Kn("div"), this.h();
    },
    l(o) {
      e = Wn(o, "DIV", { class: !0 });
      var u = Vn(e);
      t = Wn(u, "DIV", { class: !0 });
      var h = Vn(t);
      l && l.l(h), h.forEach(re), n = _n(u), a = Wn(u, "DIV", { class: !0 });
      var m = Vn(a);
      i = Wn(m, "DIV", { class: !0 }), Vn(i).forEach(re), m.forEach(re), u.forEach(re), this.h();
    },
    h() {
      Nn(t, "class", "progress-level-inner svelte-17v219f"), Nn(i, "class", "progress-bar svelte-17v219f"), z0(i, "width", s), Nn(a, "class", "progress-bar-wrap svelte-17v219f"), Nn(e, "class", "progress-level svelte-17v219f");
    },
    m(o, u) {
      de(o, e, u), K0(e, t), l && l.m(t, null), K0(e, n), K0(e, a), K0(a, i), r[31](i);
    },
    p(o, u) {
      /*progress*/
      o[7] != null ? l ? l.p(o, u) : (l = Hu(o), l.c(), l.m(t, null)) : l && (l.d(1), l = null), u[0] & /*last_progress_level*/
      32768 && s !== (s = `${/*last_progress_level*/
      o[15] * 100}%`) && z0(i, "width", s);
    },
    i: pl,
    o: pl,
    d(o) {
      o && re(e), l && l.d(), r[31](null);
    }
  };
}
function Hu(r) {
  let e, t = Ei(
    /*progress*/
    r[7]
  ), n = [];
  for (let a = 0; a < t.length; a += 1)
    n[a] = Wu(qu(r, t, a));
  return {
    c() {
      for (let a = 0; a < n.length; a += 1)
        n[a].c();
      e = Sn();
    },
    l(a) {
      for (let i = 0; i < n.length; i += 1)
        n[i].l(a);
      e = Sn();
    },
    m(a, i) {
      for (let s = 0; s < n.length; s += 1)
        n[s] && n[s].m(a, i);
      de(a, e, i);
    },
    p(a, i) {
      if (i[0] & /*progress_level, progress*/
      16512) {
        t = Ei(
          /*progress*/
          a[7]
        );
        let s;
        for (s = 0; s < t.length; s += 1) {
          const l = qu(a, t, s);
          n[s] ? n[s].p(l, i) : (n[s] = Wu(l), n[s].c(), n[s].m(e.parentNode, e));
        }
        for (; s < n.length; s += 1)
          n[s].d(1);
        n.length = t.length;
      }
    },
    d(a) {
      a && re(e), Ah(n, a);
    }
  };
}
function Uu(r) {
  let e, t, n, a, i = (
    /*i*/
    r[42] !== 0 && S5()
  ), s = (
    /*p*/
    r[40].desc != null && Gu(r)
  ), l = (
    /*p*/
    r[40].desc != null && /*progress_level*/
    r[14] && /*progress_level*/
    r[14][
      /*i*/
      r[42]
    ] != null && ju()
  ), o = (
    /*progress_level*/
    r[14] != null && Vu(r)
  );
  return {
    c() {
      i && i.c(), e = vn(), s && s.c(), t = vn(), l && l.c(), n = vn(), o && o.c(), a = Sn();
    },
    l(u) {
      i && i.l(u), e = _n(u), s && s.l(u), t = _n(u), l && l.l(u), n = _n(u), o && o.l(u), a = Sn();
    },
    m(u, h) {
      i && i.m(u, h), de(u, e, h), s && s.m(u, h), de(u, t, h), l && l.m(u, h), de(u, n, h), o && o.m(u, h), de(u, a, h);
    },
    p(u, h) {
      /*p*/
      u[40].desc != null ? s ? s.p(u, h) : (s = Gu(u), s.c(), s.m(t.parentNode, t)) : s && (s.d(1), s = null), /*p*/
      u[40].desc != null && /*progress_level*/
      u[14] && /*progress_level*/
      u[14][
        /*i*/
        u[42]
      ] != null ? l || (l = ju(), l.c(), l.m(n.parentNode, n)) : l && (l.d(1), l = null), /*progress_level*/
      u[14] != null ? o ? o.p(u, h) : (o = Vu(u), o.c(), o.m(a.parentNode, a)) : o && (o.d(1), o = null);
    },
    d(u) {
      u && (re(e), re(t), re(n), re(a)), i && i.d(u), s && s.d(u), l && l.d(u), o && o.d(u);
    }
  };
}
function S5(r) {
  let e;
  return {
    c() {
      e = Ye(" /");
    },
    l(t) {
      e = Ke(t, " /");
    },
    m(t, n) {
      de(t, e, n);
    },
    d(t) {
      t && re(e);
    }
  };
}
function Gu(r) {
  let e = (
    /*p*/
    r[40].desc + ""
  ), t;
  return {
    c() {
      t = Ye(e);
    },
    l(n) {
      t = Ke(n, e);
    },
    m(n, a) {
      de(n, t, a);
    },
    p(n, a) {
      a[0] & /*progress*/
      128 && e !== (e = /*p*/
      n[40].desc + "") && Dn(t, e);
    },
    d(n) {
      n && re(t);
    }
  };
}
function ju(r) {
  let e;
  return {
    c() {
      e = Ye("-");
    },
    l(t) {
      e = Ke(t, "-");
    },
    m(t, n) {
      de(t, e, n);
    },
    d(t) {
      t && re(e);
    }
  };
}
function Vu(r) {
  let e = (100 * /*progress_level*/
  (r[14][
    /*i*/
    r[42]
  ] || 0)).toFixed(1) + "", t, n;
  return {
    c() {
      t = Ye(e), n = Ye("%");
    },
    l(a) {
      t = Ke(a, e), n = Ke(a, "%");
    },
    m(a, i) {
      de(a, t, i), de(a, n, i);
    },
    p(a, i) {
      i[0] & /*progress_level*/
      16384 && e !== (e = (100 * /*progress_level*/
      (a[14][
        /*i*/
        a[42]
      ] || 0)).toFixed(1) + "") && Dn(t, e);
    },
    d(a) {
      a && (re(t), re(n));
    }
  };
}
function Wu(r) {
  let e, t = (
    /*p*/
    (r[40].desc != null || /*progress_level*/
    r[14] && /*progress_level*/
    r[14][
      /*i*/
      r[42]
    ] != null) && Uu(r)
  );
  return {
    c() {
      t && t.c(), e = Sn();
    },
    l(n) {
      t && t.l(n), e = Sn();
    },
    m(n, a) {
      t && t.m(n, a), de(n, e, a);
    },
    p(n, a) {
      /*p*/
      n[40].desc != null || /*progress_level*/
      n[14] && /*progress_level*/
      n[14][
        /*i*/
        n[42]
      ] != null ? t ? t.p(n, a) : (t = Uu(n), t.c(), t.m(e.parentNode, e)) : t && (t.d(1), t = null);
    },
    d(n) {
      n && re(e), t && t.d(n);
    }
  };
}
function Ku(r) {
  let e, t, n, a;
  const i = (
    /*#slots*/
    r[30]["additional-loading-text"]
  ), s = Dh(
    i,
    r,
    /*$$scope*/
    r[29],
    Nu
  );
  return {
    c() {
      e = Kn("p"), t = Ye(
        /*loading_text*/
        r[9]
      ), n = vn(), s && s.c(), this.h();
    },
    l(l) {
      e = Wn(l, "P", { class: !0 });
      var o = Vn(e);
      t = Ke(
        o,
        /*loading_text*/
        r[9]
      ), o.forEach(re), n = _n(l), s && s.l(l), this.h();
    },
    h() {
      Nn(e, "class", "loading svelte-17v219f");
    },
    m(l, o) {
      de(l, e, o), K0(e, t), de(l, n, o), s && s.m(l, o), a = !0;
    },
    p(l, o) {
      (!a || o[0] & /*loading_text*/
      512) && Dn(
        t,
        /*loading_text*/
        l[9]
      ), s && s.p && (!a || o[0] & /*$$scope*/
      536870912) && Th(
        s,
        i,
        l,
        /*$$scope*/
        l[29],
        a ? Ch(
          i,
          /*$$scope*/
          l[29],
          o,
          d5
        ) : Eh(
          /*$$scope*/
          l[29]
        ),
        Nu
      );
    },
    i(l) {
      a || (Bn(s, l), a = !0);
    },
    o(l) {
      Yn(s, l), a = !1;
    },
    d(l) {
      l && (re(e), re(n)), s && s.d(l);
    }
  };
}
function D5(r) {
  let e, t, n, a, i;
  const s = [p5, m5], l = [];
  function o(u, h) {
    return (
      /*status*/
      u[4] === "pending" ? 0 : (
        /*status*/
        u[4] === "error" ? 1 : -1
      )
    );
  }
  return ~(t = o(r)) && (n = l[t] = s[t](r)), {
    c() {
      e = Kn("div"), n && n.c(), this.h();
    },
    l(u) {
      e = Wn(u, "DIV", { class: !0 });
      var h = Vn(e);
      n && n.l(h), h.forEach(re), this.h();
    },
    h() {
      Nn(e, "class", a = "wrap " + /*variant*/
      r[8] + " " + /*show_progress*/
      r[6] + " svelte-17v219f"), pn(e, "hide", !/*status*/
      r[4] || /*status*/
      r[4] === "complete" || /*show_progress*/
      r[6] === "hidden" || /*status*/
      r[4] == "streaming"), pn(
        e,
        "translucent",
        /*variant*/
        r[8] === "center" && /*status*/
        (r[4] === "pending" || /*status*/
        r[4] === "error") || /*translucent*/
        r[11] || /*show_progress*/
        r[6] === "minimal"
      ), pn(
        e,
        "generating",
        /*status*/
        r[4] === "generating" && /*show_progress*/
        r[6] === "full"
      ), pn(
        e,
        "border",
        /*border*/
        r[12]
      ), z0(
        e,
        "position",
        /*absolute*/
        r[10] ? "absolute" : "static"
      ), z0(
        e,
        "padding",
        /*absolute*/
        r[10] ? "0" : "var(--size-8) 0"
      );
    },
    m(u, h) {
      de(u, e, h), ~t && l[t].m(e, null), r[33](e), i = !0;
    },
    p(u, h) {
      let m = t;
      t = o(u), t === m ? ~t && l[t].p(u, h) : (n && (ml(), Yn(l[m], 1, 1, () => {
        l[m] = null;
      }), dl()), ~t ? (n = l[t], n ? n.p(u, h) : (n = l[t] = s[t](u), n.c()), Bn(n, 1), n.m(e, null)) : n = null), (!i || h[0] & /*variant, show_progress*/
      320 && a !== (a = "wrap " + /*variant*/
      u[8] + " " + /*show_progress*/
      u[6] + " svelte-17v219f")) && Nn(e, "class", a), (!i || h[0] & /*variant, show_progress, status, show_progress*/
      336) && pn(e, "hide", !/*status*/
      u[4] || /*status*/
      u[4] === "complete" || /*show_progress*/
      u[6] === "hidden" || /*status*/
      u[4] == "streaming"), (!i || h[0] & /*variant, show_progress, variant, status, translucent, show_progress*/
      2384) && pn(
        e,
        "translucent",
        /*variant*/
        u[8] === "center" && /*status*/
        (u[4] === "pending" || /*status*/
        u[4] === "error") || /*translucent*/
        u[11] || /*show_progress*/
        u[6] === "minimal"
      ), (!i || h[0] & /*variant, show_progress, status, show_progress*/
      336) && pn(
        e,
        "generating",
        /*status*/
        u[4] === "generating" && /*show_progress*/
        u[6] === "full"
      ), (!i || h[0] & /*variant, show_progress, border*/
      4416) && pn(
        e,
        "border",
        /*border*/
        u[12]
      ), h[0] & /*absolute*/
      1024 && z0(
        e,
        "position",
        /*absolute*/
        u[10] ? "absolute" : "static"
      ), h[0] & /*absolute*/
      1024 && z0(
        e,
        "padding",
        /*absolute*/
        u[10] ? "0" : "var(--size-8) 0"
      );
    },
    i(u) {
      i || (Bn(n), i = !0);
    },
    o(u) {
      Yn(n), i = !1;
    },
    d(u) {
      u && re(e), ~t && l[t].d(), r[33](null);
    }
  };
}
let Wa = [], $s = !1;
const x5 = typeof window < "u", Fh = x5 ? window.requestAnimationFrame : (r) => {
};
async function A5(r, e = !0) {
  if (!(window.__gradio_mode__ === "website" || window.__gradio_mode__ !== "app" && e !== !0)) {
    if (Wa.push(r), !$s) $s = !0;
    else return;
    await u5(), Fh(() => {
      let t = [0, 0];
      for (let n = 0; n < Wa.length; n++) {
        const i = Wa[n].getBoundingClientRect();
        (n === 0 || i.top + window.scrollY <= t[0]) && (t[0] = i.top + window.scrollY, t[1] = n);
      }
      window.scrollTo({ top: t[0] - 20, behavior: "smooth" }), $s = !1, Wa = [];
    });
  }
}
function E5(r, e, t) {
  let n, { $$slots: a = {}, $$scope: i } = e;
  const s = h5();
  let { i18n: l } = e, { eta: o = null } = e, { queue_position: u } = e, { queue_size: h } = e, { status: m } = e, { scroll_to_output: d = !1 } = e, { timer: g = !0 } = e, { show_progress: b = "full" } = e, { message: v = null } = e, { progress: w = null } = e, { variant: x = "default" } = e, { loading_text: k = "Loading..." } = e, { absolute: y = !0 } = e, { translucent: A = !1 } = e, { border: $ = !1 } = e, { autoscroll: M } = e, z, O = !1, L = 0, K = 0, X = null, J = null, Se = 0, _e = null, ge, Ae = null, Oe = !0;
  const ke = () => {
    t(0, o = t(27, X = t(19, I = null))), t(25, L = performance.now()), t(26, K = 0), O = !0, Be();
  };
  function Be() {
    Fh(() => {
      t(26, K = (performance.now() - L) / 1e3), O && Be();
    });
  }
  function Ee() {
    t(26, K = 0), t(0, o = t(27, X = t(19, I = null))), O && (O = !1);
  }
  c5(() => {
    O && Ee();
  });
  let I = null;
  function be(H) {
    zu[H ? "unshift" : "push"](() => {
      Ae = H, t(16, Ae), t(7, w), t(14, _e), t(15, ge);
    });
  }
  const ye = () => {
    s("clear_status");
  };
  function Ie(H) {
    zu[H ? "unshift" : "push"](() => {
      z = H, t(13, z);
    });
  }
  return r.$$set = (H) => {
    "i18n" in H && t(1, l = H.i18n), "eta" in H && t(0, o = H.eta), "queue_position" in H && t(2, u = H.queue_position), "queue_size" in H && t(3, h = H.queue_size), "status" in H && t(4, m = H.status), "scroll_to_output" in H && t(22, d = H.scroll_to_output), "timer" in H && t(5, g = H.timer), "show_progress" in H && t(6, b = H.show_progress), "message" in H && t(23, v = H.message), "progress" in H && t(7, w = H.progress), "variant" in H && t(8, x = H.variant), "loading_text" in H && t(9, k = H.loading_text), "absolute" in H && t(10, y = H.absolute), "translucent" in H && t(11, A = H.translucent), "border" in H && t(12, $ = H.border), "autoscroll" in H && t(24, M = H.autoscroll), "$$scope" in H && t(29, i = H.$$scope);
  }, r.$$.update = () => {
    r.$$.dirty[0] & /*eta, old_eta, timer_start, eta_from_start*/
    436207617 && (o === null && t(0, o = X), o != null && X !== o && (t(28, J = (performance.now() - L) / 1e3 + o), t(19, I = J.toFixed(1)), t(27, X = o))), r.$$.dirty[0] & /*eta_from_start, timer_diff*/
    335544320 && t(17, Se = J === null || J <= 0 || !K ? null : Math.min(K / J, 1)), r.$$.dirty[0] & /*progress*/
    128 && w != null && t(18, Oe = !1), r.$$.dirty[0] & /*progress, progress_level, progress_bar, last_progress_level*/
    114816 && (w != null ? t(14, _e = w.map((H) => {
      if (H.index != null && H.length != null)
        return H.index / H.length;
      if (H.progress != null)
        return H.progress;
    })) : t(14, _e = null), _e ? (t(15, ge = _e[_e.length - 1]), Ae && (ge === 0 ? t(16, Ae.style.transition = "0", Ae) : t(16, Ae.style.transition = "150ms", Ae))) : t(15, ge = void 0)), r.$$.dirty[0] & /*status*/
    16 && (m === "pending" ? ke() : Ee()), r.$$.dirty[0] & /*el, scroll_to_output, status, autoscroll*/
    20979728 && z && d && (m === "pending" || m === "complete") && A5(z, M), r.$$.dirty[0] & /*status, message*/
    8388624, r.$$.dirty[0] & /*timer_diff*/
    67108864 && t(20, n = K.toFixed(1));
  }, [
    o,
    l,
    u,
    h,
    m,
    g,
    b,
    w,
    x,
    k,
    y,
    A,
    $,
    z,
    _e,
    ge,
    Ae,
    Se,
    Oe,
    I,
    n,
    s,
    d,
    v,
    M,
    L,
    K,
    X,
    J,
    i,
    a,
    be,
    ye,
    Ie
  ];
}
class Xl extends s5 {
  constructor(e) {
    super(), l5(
      this,
      e,
      E5,
      D5,
      o5,
      {
        i18n: 1,
        eta: 0,
        queue_position: 2,
        queue_size: 3,
        status: 4,
        scroll_to_output: 22,
        timer: 5,
        show_progress: 6,
        message: 23,
        progress: 7,
        variant: 8,
        loading_text: 9,
        absolute: 10,
        translucent: 11,
        border: 12,
        autoscroll: 24
      },
      null,
      [-1, -1]
    );
  }
}
/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */
const {
  entries: Mh,
  setPrototypeOf: Yu,
  isFrozen: C5,
  getPrototypeOf: $5,
  getOwnPropertyDescriptor: T5
} = Object;
let {
  freeze: Pt,
  seal: xn,
  create: zh
} = Object, {
  apply: gl,
  construct: _l
} = typeof Reflect < "u" && Reflect;
Pt || (Pt = function(e) {
  return e;
});
xn || (xn = function(e) {
  return e;
});
gl || (gl = function(e, t, n) {
  return e.apply(t, n);
});
_l || (_l = function(e, t) {
  return new e(...t);
});
const Ka = Ht(Array.prototype.forEach), F5 = Ht(Array.prototype.lastIndexOf), Xu = Ht(Array.prototype.pop), Ir = Ht(Array.prototype.push), M5 = Ht(Array.prototype.splice), mi = Ht(String.prototype.toLowerCase), Ts = Ht(String.prototype.toString), Zu = Ht(String.prototype.match), Rr = Ht(String.prototype.replace), z5 = Ht(String.prototype.indexOf), B5 = Ht(String.prototype.trim), Mn = Ht(Object.prototype.hasOwnProperty), Rt = Ht(RegExp.prototype.test), Or = N5(TypeError);
function Ht(r) {
  return function(e) {
    e instanceof RegExp && (e.lastIndex = 0);
    for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), a = 1; a < t; a++)
      n[a - 1] = arguments[a];
    return gl(r, e, n);
  };
}
function N5(r) {
  return function() {
    for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
      t[n] = arguments[n];
    return _l(r, t);
  };
}
function we(r, e) {
  let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : mi;
  Yu && Yu(r, null);
  let n = e.length;
  for (; n--; ) {
    let a = e[n];
    if (typeof a == "string") {
      const i = t(a);
      i !== a && (C5(e) || (e[n] = i), a = i);
    }
    r[a] = !0;
  }
  return r;
}
function q5(r) {
  for (let e = 0; e < r.length; e++)
    Mn(r, e) || (r[e] = null);
  return r;
}
function o0(r) {
  const e = zh(null);
  for (const [t, n] of Mh(r))
    Mn(r, t) && (Array.isArray(n) ? e[t] = q5(n) : n && typeof n == "object" && n.constructor === Object ? e[t] = o0(n) : e[t] = n);
  return e;
}
function Pr(r, e) {
  for (; r !== null; ) {
    const n = T5(r, e);
    if (n) {
      if (n.get)
        return Ht(n.get);
      if (typeof n.value == "function")
        return Ht(n.value);
    }
    r = $5(r);
  }
  function t() {
    return null;
  }
  return t;
}
const Qu = Pt(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "section", "select", "shadow", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), Fs = Pt(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), Ms = Pt(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), L5 = Pt(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]), zs = Pt(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]), I5 = Pt(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), Ju = Pt(["#text"]), e1 = Pt(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns", "slot"]), Bs = Pt(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), t1 = Pt(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), Ya = Pt(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), R5 = xn(/\{\{[\w\W]*|[\w\W]*\}\}/gm), O5 = xn(/<%[\w\W]*|[\w\W]*%>/gm), P5 = xn(/\$\{[\w\W]*/gm), H5 = xn(/^data-[\-\w.\u00B7-\uFFFF]+$/), U5 = xn(/^aria-[\-\w]+$/), Bh = xn(
  /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
  // eslint-disable-line no-useless-escape
), G5 = xn(/^(?:\w+script|data):/i), j5 = xn(
  /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
  // eslint-disable-line no-control-regex
), Nh = xn(/^html$/i), V5 = xn(/^[a-z][.\w]*(-[.\w]+)+$/i);
var n1 = /* @__PURE__ */ Object.freeze({
  __proto__: null,
  ARIA_ATTR: U5,
  ATTR_WHITESPACE: j5,
  CUSTOM_ELEMENT: V5,
  DATA_ATTR: H5,
  DOCTYPE_NAME: Nh,
  ERB_EXPR: O5,
  IS_ALLOWED_URI: Bh,
  IS_SCRIPT_OR_DATA: G5,
  MUSTACHE_EXPR: R5,
  TMPLIT_EXPR: P5
});
const Hr = {
  element: 1,
  text: 3,
  // Deprecated
  progressingInstruction: 7,
  comment: 8,
  document: 9
}, W5 = function() {
  return typeof window > "u" ? null : window;
}, K5 = function(e, t) {
  if (typeof e != "object" || typeof e.createPolicy != "function")
    return null;
  let n = null;
  const a = "data-tt-policy-suffix";
  t && t.hasAttribute(a) && (n = t.getAttribute(a));
  const i = "dompurify" + (n ? "#" + n : "");
  try {
    return e.createPolicy(i, {
      createHTML(s) {
        return s;
      },
      createScriptURL(s) {
        return s;
      }
    });
  } catch {
    return console.warn("TrustedTypes policy " + i + " could not be created."), null;
  }
}, r1 = function() {
  return {
    afterSanitizeAttributes: [],
    afterSanitizeElements: [],
    afterSanitizeShadowDOM: [],
    beforeSanitizeAttributes: [],
    beforeSanitizeElements: [],
    beforeSanitizeShadowDOM: [],
    uponSanitizeAttribute: [],
    uponSanitizeElement: [],
    uponSanitizeShadowNode: []
  };
};
function qh() {
  let r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : W5();
  const e = (te) => qh(te);
  if (e.version = "3.2.6", e.removed = [], !r || !r.document || r.document.nodeType !== Hr.document || !r.Element)
    return e.isSupported = !1, e;
  let {
    document: t
  } = r;
  const n = t, a = n.currentScript, {
    DocumentFragment: i,
    HTMLTemplateElement: s,
    Node: l,
    Element: o,
    NodeFilter: u,
    NamedNodeMap: h = r.NamedNodeMap || r.MozNamedAttrMap,
    HTMLFormElement: m,
    DOMParser: d,
    trustedTypes: g
  } = r, b = o.prototype, v = Pr(b, "cloneNode"), w = Pr(b, "remove"), x = Pr(b, "nextSibling"), k = Pr(b, "childNodes"), y = Pr(b, "parentNode");
  if (typeof s == "function") {
    const te = t.createElement("template");
    te.content && te.content.ownerDocument && (t = te.content.ownerDocument);
  }
  let A, $ = "";
  const {
    implementation: M,
    createNodeIterator: z,
    createDocumentFragment: O,
    getElementsByTagName: L
  } = t, {
    importNode: K
  } = n;
  let X = r1();
  e.isSupported = typeof Mh == "function" && typeof y == "function" && M && M.createHTMLDocument !== void 0;
  const {
    MUSTACHE_EXPR: J,
    ERB_EXPR: Se,
    TMPLIT_EXPR: _e,
    DATA_ATTR: ge,
    ARIA_ATTR: Ae,
    IS_SCRIPT_OR_DATA: Oe,
    ATTR_WHITESPACE: ke,
    CUSTOM_ELEMENT: Be
  } = n1;
  let {
    IS_ALLOWED_URI: Ee
  } = n1, I = null;
  const be = we({}, [...Qu, ...Fs, ...Ms, ...zs, ...Ju]);
  let ye = null;
  const Ie = we({}, [...e1, ...Bs, ...t1, ...Ya]);
  let H = Object.seal(zh(null, {
    tagNameCheck: {
      writable: !0,
      configurable: !1,
      enumerable: !0,
      value: null
    },
    attributeNameCheck: {
      writable: !0,
      configurable: !1,
      enumerable: !0,
      value: null
    },
    allowCustomizedBuiltInElements: {
      writable: !0,
      configurable: !1,
      enumerable: !0,
      value: !1
    }
  })), nt = null, Pe = null, mt = !0, vt = !0, xt = !1, Nt = !0, Q = !1, je = !0, Fe = !1, Zt = !1, Ln = !1, Gt = !1, jt = !1, Qt = !1, rr = !0, ar = !1;
  const Er = "user-content-";
  let G = !0, He = !1, bt = {}, Et = null;
  const n0 = we({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
  let O0 = null;
  const v0 = we({}, ["audio", "video", "img", "source", "image", "track"]);
  let b0 = null;
  const r0 = we({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), ir = "http://www.w3.org/1998/Math/MathML", sr = "http://www.w3.org/2000/svg", An = "http://www.w3.org/1999/xhtml";
  let y0 = An, Cr = !1, lr = null;
  const Hi = we({}, [ir, sr, An], Ts);
  let or = we({}, ["mi", "mo", "mn", "ms", "mtext"]), ur = we({}, ["annotation-xml"]);
  const Ui = we({}, ["title", "style", "font", "a", "script"]);
  let P0 = null;
  const Gi = ["application/xhtml+xml", "text/html"], ji = "text/html";
  let lt = null, w0 = null;
  const Vi = t.createElement("form"), ya = function(C) {
    return C instanceof RegExp || C instanceof Function;
  }, B = function() {
    let C = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
    if (!(w0 && w0 === C)) {
      if ((!C || typeof C != "object") && (C = {}), C = o0(C), P0 = // eslint-disable-next-line unicorn/prefer-includes
      Gi.indexOf(C.PARSER_MEDIA_TYPE) === -1 ? ji : C.PARSER_MEDIA_TYPE, lt = P0 === "application/xhtml+xml" ? Ts : mi, I = Mn(C, "ALLOWED_TAGS") ? we({}, C.ALLOWED_TAGS, lt) : be, ye = Mn(C, "ALLOWED_ATTR") ? we({}, C.ALLOWED_ATTR, lt) : Ie, lr = Mn(C, "ALLOWED_NAMESPACES") ? we({}, C.ALLOWED_NAMESPACES, Ts) : Hi, b0 = Mn(C, "ADD_URI_SAFE_ATTR") ? we(o0(r0), C.ADD_URI_SAFE_ATTR, lt) : r0, O0 = Mn(C, "ADD_DATA_URI_TAGS") ? we(o0(v0), C.ADD_DATA_URI_TAGS, lt) : v0, Et = Mn(C, "FORBID_CONTENTS") ? we({}, C.FORBID_CONTENTS, lt) : n0, nt = Mn(C, "FORBID_TAGS") ? we({}, C.FORBID_TAGS, lt) : o0({}), Pe = Mn(C, "FORBID_ATTR") ? we({}, C.FORBID_ATTR, lt) : o0({}), bt = Mn(C, "USE_PROFILES") ? C.USE_PROFILES : !1, mt = C.ALLOW_ARIA_ATTR !== !1, vt = C.ALLOW_DATA_ATTR !== !1, xt = C.ALLOW_UNKNOWN_PROTOCOLS || !1, Nt = C.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Q = C.SAFE_FOR_TEMPLATES || !1, je = C.SAFE_FOR_XML !== !1, Fe = C.WHOLE_DOCUMENT || !1, Gt = C.RETURN_DOM || !1, jt = C.RETURN_DOM_FRAGMENT || !1, Qt = C.RETURN_TRUSTED_TYPE || !1, Ln = C.FORCE_BODY || !1, rr = C.SANITIZE_DOM !== !1, ar = C.SANITIZE_NAMED_PROPS || !1, G = C.KEEP_CONTENT !== !1, He = C.IN_PLACE || !1, Ee = C.ALLOWED_URI_REGEXP || Bh, y0 = C.NAMESPACE || An, or = C.MATHML_TEXT_INTEGRATION_POINTS || or, ur = C.HTML_INTEGRATION_POINTS || ur, H = C.CUSTOM_ELEMENT_HANDLING || {}, C.CUSTOM_ELEMENT_HANDLING && ya(C.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (H.tagNameCheck = C.CUSTOM_ELEMENT_HANDLING.tagNameCheck), C.CUSTOM_ELEMENT_HANDLING && ya(C.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (H.attributeNameCheck = C.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), C.CUSTOM_ELEMENT_HANDLING && typeof C.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (H.allowCustomizedBuiltInElements = C.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), Q && (vt = !1), jt && (Gt = !0), bt && (I = we({}, Ju), ye = [], bt.html === !0 && (we(I, Qu), we(ye, e1)), bt.svg === !0 && (we(I, Fs), we(ye, Bs), we(ye, Ya)), bt.svgFilters === !0 && (we(I, Ms), we(ye, Bs), we(ye, Ya)), bt.mathMl === !0 && (we(I, zs), we(ye, t1), we(ye, Ya))), C.ADD_TAGS && (I === be && (I = o0(I)), we(I, C.ADD_TAGS, lt)), C.ADD_ATTR && (ye === Ie && (ye = o0(ye)), we(ye, C.ADD_ATTR, lt)), C.ADD_URI_SAFE_ATTR && we(b0, C.ADD_URI_SAFE_ATTR, lt), C.FORBID_CONTENTS && (Et === n0 && (Et = o0(Et)), we(Et, C.FORBID_CONTENTS, lt)), G && (I["#text"] = !0), Fe && we(I, ["html", "head", "body"]), I.table && (we(I, ["tbody"]), delete nt.tbody), C.TRUSTED_TYPES_POLICY) {
        if (typeof C.TRUSTED_TYPES_POLICY.createHTML != "function")
          throw Or('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
        if (typeof C.TRUSTED_TYPES_POLICY.createScriptURL != "function")
          throw Or('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
        A = C.TRUSTED_TYPES_POLICY, $ = A.createHTML("");
      } else
        A === void 0 && (A = K5(g, a)), A !== null && typeof $ == "string" && ($ = A.createHTML(""));
      Pt && Pt(C), w0 = C;
    }
  }, a0 = we({}, [...Fs, ...Ms, ...L5]), Vt = we({}, [...zs, ...I5]), cr = function(C) {
    let j = y(C);
    (!j || !j.tagName) && (j = {
      namespaceURI: y0,
      tagName: "template"
    });
    const ee = mi(C.tagName), Ne = mi(j.tagName);
    return lr[C.namespaceURI] ? C.namespaceURI === sr ? j.namespaceURI === An ? ee === "svg" : j.namespaceURI === ir ? ee === "svg" && (Ne === "annotation-xml" || or[Ne]) : !!a0[ee] : C.namespaceURI === ir ? j.namespaceURI === An ? ee === "math" : j.namespaceURI === sr ? ee === "math" && ur[Ne] : !!Vt[ee] : C.namespaceURI === An ? j.namespaceURI === sr && !ur[Ne] || j.namespaceURI === ir && !or[Ne] ? !1 : !Vt[ee] && (Ui[ee] || !a0[ee]) : !!(P0 === "application/xhtml+xml" && lr[C.namespaceURI]) : !1;
  }, V = function(C) {
    Ir(e.removed, {
      element: C
    });
    try {
      y(C).removeChild(C);
    } catch {
      w(C);
    }
  }, un = function(C, j) {
    try {
      Ir(e.removed, {
        attribute: j.getAttributeNode(C),
        from: j
      });
    } catch {
      Ir(e.removed, {
        attribute: null,
        from: j
      });
    }
    if (j.removeAttribute(C), C === "is")
      if (Gt || jt)
        try {
          V(j);
        } catch {
        }
      else
        try {
          j.setAttribute(C, "");
        } catch {
        }
  }, rt = function(C) {
    let j = null, ee = null;
    if (Ln)
      C = "<remove></remove>" + C;
    else {
      const at = Zu(C, /^[\r\n\t ]+/);
      ee = at && at[0];
    }
    P0 === "application/xhtml+xml" && y0 === An && (C = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + C + "</body></html>");
    const Ne = A ? A.createHTML(C) : C;
    if (y0 === An)
      try {
        j = new d().parseFromString(Ne, P0);
      } catch {
      }
    if (!j || !j.documentElement) {
      j = M.createDocument(y0, "template", null);
      try {
        j.documentElement.innerHTML = Cr ? $ : Ne;
      } catch {
      }
    }
    const pt = j.body || j.documentElement;
    return C && ee && pt.insertBefore(t.createTextNode(ee), pt.childNodes[0] || null), y0 === An ? L.call(j, Fe ? "html" : "body")[0] : Fe ? j.documentElement : pt;
  }, Jt = function(C) {
    return z.call(
      C.ownerDocument || C,
      C,
      // eslint-disable-next-line no-bitwise
      u.SHOW_ELEMENT | u.SHOW_COMMENT | u.SHOW_TEXT | u.SHOW_PROCESSING_INSTRUCTION | u.SHOW_CDATA_SECTION,
      null
    );
  }, $r = function(C) {
    return C instanceof m && (typeof C.nodeName != "string" || typeof C.textContent != "string" || typeof C.removeChild != "function" || !(C.attributes instanceof h) || typeof C.removeAttribute != "function" || typeof C.setAttribute != "function" || typeof C.namespaceURI != "string" || typeof C.insertBefore != "function" || typeof C.hasChildNodes != "function");
  }, qt = function(C) {
    return typeof l == "function" && C instanceof l;
  };
  function cn(te, C, j) {
    Ka(te, (ee) => {
      ee.call(e, C, j, w0);
    });
  }
  const Tr = function(C) {
    let j = null;
    if (cn(X.beforeSanitizeElements, C, null), $r(C))
      return V(C), !0;
    const ee = lt(C.nodeName);
    if (cn(X.uponSanitizeElement, C, {
      tagName: ee,
      allowedTags: I
    }), je && C.hasChildNodes() && !qt(C.firstElementChild) && Rt(/<[/\w!]/g, C.innerHTML) && Rt(/<[/\w!]/g, C.textContent) || C.nodeType === Hr.progressingInstruction || je && C.nodeType === Hr.comment && Rt(/<[/\w]/g, C.data))
      return V(C), !0;
    if (!I[ee] || nt[ee]) {
      if (!nt[ee] && wa(ee) && (H.tagNameCheck instanceof RegExp && Rt(H.tagNameCheck, ee) || H.tagNameCheck instanceof Function && H.tagNameCheck(ee)))
        return !1;
      if (G && !Et[ee]) {
        const Ne = y(C) || C.parentNode, pt = k(C) || C.childNodes;
        if (pt && Ne) {
          const at = pt.length;
          for (let Ct = at - 1; Ct >= 0; --Ct) {
            const En = v(pt[Ct], !0);
            En.__removalCount = (C.__removalCount || 0) + 1, Ne.insertBefore(En, x(C));
          }
        }
      }
      return V(C), !0;
    }
    return C instanceof o && !cr(C) || (ee === "noscript" || ee === "noembed" || ee === "noframes") && Rt(/<\/no(script|embed|frames)/i, C.innerHTML) ? (V(C), !0) : (Q && C.nodeType === Hr.text && (j = C.textContent, Ka([J, Se, _e], (Ne) => {
      j = Rr(j, Ne, " ");
    }), C.textContent !== j && (Ir(e.removed, {
      element: C.cloneNode()
    }), C.textContent = j)), cn(X.afterSanitizeElements, C, null), !1);
  }, ne = function(C, j, ee) {
    if (rr && (j === "id" || j === "name") && (ee in t || ee in Vi))
      return !1;
    if (!(vt && !Pe[j] && Rt(ge, j))) {
      if (!(mt && Rt(Ae, j))) {
        if (!ye[j] || Pe[j]) {
          if (
            // First condition does a very basic check if a) it's basically a valid custom element tagname AND
            // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
            // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
            !(wa(C) && (H.tagNameCheck instanceof RegExp && Rt(H.tagNameCheck, C) || H.tagNameCheck instanceof Function && H.tagNameCheck(C)) && (H.attributeNameCheck instanceof RegExp && Rt(H.attributeNameCheck, j) || H.attributeNameCheck instanceof Function && H.attributeNameCheck(j)) || // Alternative, second condition checks if it's an `is`-attribute, AND
            // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
            j === "is" && H.allowCustomizedBuiltInElements && (H.tagNameCheck instanceof RegExp && Rt(H.tagNameCheck, ee) || H.tagNameCheck instanceof Function && H.tagNameCheck(ee)))
          ) return !1;
        } else if (!b0[j]) {
          if (!Rt(Ee, Rr(ee, ke, ""))) {
            if (!((j === "src" || j === "xlink:href" || j === "href") && C !== "script" && z5(ee, "data:") === 0 && O0[C])) {
              if (!(xt && !Rt(Oe, Rr(ee, ke, "")))) {
                if (ee)
                  return !1;
              }
            }
          }
        }
      }
    }
    return !0;
  }, wa = function(C) {
    return C !== "annotation-xml" && Zu(C, Be);
  }, Fr = function(C) {
    cn(X.beforeSanitizeAttributes, C, null);
    const {
      attributes: j
    } = C;
    if (!j || $r(C))
      return;
    const ee = {
      attrName: "",
      attrValue: "",
      keepAttr: !0,
      allowedAttributes: ye,
      forceKeepAttr: void 0
    };
    let Ne = j.length;
    for (; Ne--; ) {
      const pt = j[Ne], {
        name: at,
        namespaceURI: Ct,
        value: En
      } = pt, k0 = lt(at), H0 = En;
      let yt = at === "value" ? H0 : B5(H0);
      if (ee.attrName = k0, ee.attrValue = yt, ee.keepAttr = !0, ee.forceKeepAttr = void 0, cn(X.uponSanitizeAttribute, C, ee), yt = ee.attrValue, ar && (k0 === "id" || k0 === "name") && (un(at, C), yt = Er + yt), je && Rt(/((--!?|])>)|<\/(style|title)/i, yt)) {
        un(at, C);
        continue;
      }
      if (ee.forceKeepAttr)
        continue;
      if (!ee.keepAttr) {
        un(at, C);
        continue;
      }
      if (!Nt && Rt(/\/>/i, yt)) {
        un(at, C);
        continue;
      }
      Q && Ka([J, Se, _e], (Mr) => {
        yt = Rr(yt, Mr, " ");
      });
      const ka = lt(C.nodeName);
      if (!ne(ka, k0, yt)) {
        un(at, C);
        continue;
      }
      if (A && typeof g == "object" && typeof g.getAttributeType == "function" && !Ct)
        switch (g.getAttributeType(ka, k0)) {
          case "TrustedHTML": {
            yt = A.createHTML(yt);
            break;
          }
          case "TrustedScriptURL": {
            yt = A.createScriptURL(yt);
            break;
          }
        }
      if (yt !== H0)
        try {
          Ct ? C.setAttributeNS(Ct, at, yt) : C.setAttribute(at, yt), $r(C) ? V(C) : Xu(e.removed);
        } catch {
          un(at, C);
        }
    }
    cn(X.afterSanitizeAttributes, C, null);
  }, Wi = function te(C) {
    let j = null;
    const ee = Jt(C);
    for (cn(X.beforeSanitizeShadowDOM, C, null); j = ee.nextNode(); )
      cn(X.uponSanitizeShadowNode, j, null), Tr(j), Fr(j), j.content instanceof i && te(j.content);
    cn(X.afterSanitizeShadowDOM, C, null);
  };
  return e.sanitize = function(te) {
    let C = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, j = null, ee = null, Ne = null, pt = null;
    if (Cr = !te, Cr && (te = "<!-->"), typeof te != "string" && !qt(te))
      if (typeof te.toString == "function") {
        if (te = te.toString(), typeof te != "string")
          throw Or("dirty is not a string, aborting");
      } else
        throw Or("toString is not a function");
    if (!e.isSupported)
      return te;
    if (Zt || B(C), e.removed = [], typeof te == "string" && (He = !1), He) {
      if (te.nodeName) {
        const En = lt(te.nodeName);
        if (!I[En] || nt[En])
          throw Or("root node is forbidden and cannot be sanitized in-place");
      }
    } else if (te instanceof l)
      j = rt("<!---->"), ee = j.ownerDocument.importNode(te, !0), ee.nodeType === Hr.element && ee.nodeName === "BODY" || ee.nodeName === "HTML" ? j = ee : j.appendChild(ee);
    else {
      if (!Gt && !Q && !Fe && // eslint-disable-next-line unicorn/prefer-includes
      te.indexOf("<") === -1)
        return A && Qt ? A.createHTML(te) : te;
      if (j = rt(te), !j)
        return Gt ? null : Qt ? $ : "";
    }
    j && Ln && V(j.firstChild);
    const at = Jt(He ? te : j);
    for (; Ne = at.nextNode(); )
      Tr(Ne), Fr(Ne), Ne.content instanceof i && Wi(Ne.content);
    if (He)
      return te;
    if (Gt) {
      if (jt)
        for (pt = O.call(j.ownerDocument); j.firstChild; )
          pt.appendChild(j.firstChild);
      else
        pt = j;
      return (ye.shadowroot || ye.shadowrootmode) && (pt = K.call(n, pt, !0)), pt;
    }
    let Ct = Fe ? j.outerHTML : j.innerHTML;
    return Fe && I["!doctype"] && j.ownerDocument && j.ownerDocument.doctype && j.ownerDocument.doctype.name && Rt(Nh, j.ownerDocument.doctype.name) && (Ct = "<!DOCTYPE " + j.ownerDocument.doctype.name + `>
` + Ct), Q && Ka([J, Se, _e], (En) => {
      Ct = Rr(Ct, En, " ");
    }), A && Qt ? A.createHTML(Ct) : Ct;
  }, e.setConfig = function() {
    let te = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
    B(te), Zt = !0;
  }, e.clearConfig = function() {
    w0 = null, Zt = !1;
  }, e.isValidAttribute = function(te, C, j) {
    w0 || B({});
    const ee = lt(te), Ne = lt(C);
    return ne(ee, Ne, j);
  }, e.addHook = function(te, C) {
    typeof C == "function" && Ir(X[te], C);
  }, e.removeHook = function(te, C) {
    if (C !== void 0) {
      const j = F5(X[te], C);
      return j === -1 ? void 0 : M5(X[te], j, 1)[0];
    }
    return Xu(X[te]);
  }, e.removeHooks = function(te) {
    X[te] = [];
  }, e.removeAllHooks = function() {
    X = r1();
  }, e;
}
var zF = qh();
const {
  HtmlTagHydration: BF,
  SvelteComponent: NF,
  add_render_callback: qF,
  append_hydration: LF,
  attr: IF,
  bubble: RF,
  check_outros: OF,
  children: PF,
  claim_component: HF,
  claim_element: UF,
  claim_html_tag: GF,
  claim_space: jF,
  claim_text: VF,
  create_component: WF,
  create_in_transition: KF,
  create_out_transition: YF,
  destroy_component: XF,
  detach: ZF,
  element: QF,
  get_svelte_dataset: JF,
  group_outros: eM,
  init: tM,
  insert_hydration: nM,
  listen: rM,
  mount_component: aM,
  run_all: iM,
  safe_not_equal: sM,
  set_data: lM,
  space: oM,
  stop_propagation: uM,
  text: cM,
  toggle_class: hM,
  transition_in: fM,
  transition_out: dM
} = window.__gradio__svelte__internal, { createEventDispatcher: mM, onMount: pM } = window.__gradio__svelte__internal, {
  SvelteComponent: gM,
  append_hydration: _M,
  attr: vM,
  bubble: bM,
  check_outros: yM,
  children: wM,
  claim_component: kM,
  claim_element: SM,
  claim_space: DM,
  create_animation: xM,
  create_component: AM,
  destroy_component: EM,
  detach: CM,
  element: $M,
  ensure_array_like: TM,
  fix_and_outro_and_destroy_block: FM,
  fix_position: MM,
  group_outros: zM,
  init: BM,
  insert_hydration: NM,
  mount_component: qM,
  noop: LM,
  safe_not_equal: IM,
  set_style: RM,
  space: OM,
  transition_in: PM,
  transition_out: HM,
  update_keyed_each: UM
} = window.__gradio__svelte__internal, {
  SvelteComponent: GM,
  attr: jM,
  children: VM,
  claim_element: WM,
  detach: KM,
  element: YM,
  empty: XM,
  init: ZM,
  insert_hydration: QM,
  noop: JM,
  safe_not_equal: ez,
  set_style: tz
} = window.__gradio__svelte__internal;
function Y5(r) {
  return r !== null ? { comment: r, variations: [] } : { variations: [] };
}
function X5(r, e, t, n, a) {
  const i = { move: r, variations: a };
  return e && (i.suffix = e), t && (i.nag = t), n !== null && (i.comment = n), i;
}
function Z5(...r) {
  const [e, ...t] = r;
  let n = e;
  for (const a of t)
    a !== null && (n.variations = [a, ...a.variations], a.variations = [], n = a);
  return e;
}
function Q5(r, e) {
  if (e.marker && e.marker.comment) {
    let t = e.root;
    for (; ; ) {
      const n = t.variations[0];
      if (!n) {
        t.comment = e.marker.comment;
        break;
      }
      t = n;
    }
  }
  return {
    headers: r,
    root: e.root,
    result: (e.marker && e.marker.result) ?? void 0
  };
}
function J5(r, e) {
  function t() {
    this.constructor = r;
  }
  t.prototype = e.prototype, r.prototype = new t();
}
function Q0(r, e, t, n) {
  var a = Error.call(this, r);
  return Object.setPrototypeOf && Object.setPrototypeOf(a, Q0.prototype), a.expected = e, a.found = t, a.location = n, a.name = "SyntaxError", a;
}
J5(Q0, Error);
function Ns(r, e, t) {
  return t = t || " ", r.length > e ? r : (e -= r.length, t += t.repeat(e), r + t.slice(0, e));
}
Q0.prototype.format = function(r) {
  var e = "Error: " + this.message;
  if (this.location) {
    var t = null, n;
    for (n = 0; n < r.length; n++)
      if (r[n].source === this.location.source) {
        t = r[n].text.split(/\r\n|\n|\r/g);
        break;
      }
    var a = this.location.start, i = this.location.source && typeof this.location.source.offset == "function" ? this.location.source.offset(a) : a, s = this.location.source + ":" + i.line + ":" + i.column;
    if (t) {
      var l = this.location.end, o = Ns("", i.line.toString().length, " "), u = t[a.line - 1], h = a.line === l.line ? l.column : u.length + 1, m = h - a.column || 1;
      e += `
 --> ` + s + `
` + o + ` |
` + i.line + " | " + u + `
` + o + " | " + Ns("", a.column - 1, " ") + Ns("", m, "^");
    } else
      e += `
 at ` + s;
  }
  return e;
};
Q0.buildMessage = function(r, e) {
  var t = {
    literal: function(u) {
      return '"' + a(u.text) + '"';
    },
    class: function(u) {
      var h = u.parts.map(function(m) {
        return Array.isArray(m) ? i(m[0]) + "-" + i(m[1]) : i(m);
      });
      return "[" + (u.inverted ? "^" : "") + h.join("") + "]";
    },
    any: function() {
      return "any character";
    },
    end: function() {
      return "end of input";
    },
    other: function(u) {
      return u.description;
    }
  };
  function n(u) {
    return u.charCodeAt(0).toString(16).toUpperCase();
  }
  function a(u) {
    return u.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, function(h) {
      return "\\x0" + n(h);
    }).replace(/[\x10-\x1F\x7F-\x9F]/g, function(h) {
      return "\\x" + n(h);
    });
  }
  function i(u) {
    return u.replace(/\\/g, "\\\\").replace(/\]/g, "\\]").replace(/\^/g, "\\^").replace(/-/g, "\\-").replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, function(h) {
      return "\\x0" + n(h);
    }).replace(/[\x10-\x1F\x7F-\x9F]/g, function(h) {
      return "\\x" + n(h);
    });
  }
  function s(u) {
    return t[u.type](u);
  }
  function l(u) {
    var h = u.map(s), m, d;
    if (h.sort(), h.length > 0) {
      for (m = 1, d = 1; m < h.length; m++)
        h[m - 1] !== h[m] && (h[d] = h[m], d++);
      h.length = d;
    }
    switch (h.length) {
      case 1:
        return h[0];
      case 2:
        return h[0] + " or " + h[1];
      default:
        return h.slice(0, -1).join(", ") + ", or " + h[h.length - 1];
    }
  }
  function o(u) {
    return u ? '"' + a(u) + '"' : "end of input";
  }
  return "Expected " + l(r) + " but " + o(e) + " found.";
};
function e3(r, e) {
  e = e !== void 0 ? e : {};
  var t = {}, n = e.grammarSource, a = { pgn: Fr }, i = Fr, s = "[", l = '"', o = "]", u = ".", h = "O-O-O", m = "O-O", d = "0-0-0", g = "0-0", b = "$", v = "{", w = "}", x = ";", k = "(", y = ")", A = "1-0", $ = "0-1", M = "1/2-1/2", z = "*", O = /^[a-zA-Z]/, L = /^[^"]/, K = /^[0-9]/, X = /^[.]/, J = /^[a-zA-Z1-8\-=]/, Se = /^[+#]/, _e = /^[!?]/, ge = /^[^}]/, Ae = /^[^\r\n]/, Oe = /^[ \t\r\n]/, ke = qt("tag pair"), Be = rt("[", !1), Ee = rt('"', !1), I = rt("]", !1), be = qt("tag name"), ye = Jt([["a", "z"], ["A", "Z"]], !1, !1), Ie = qt("tag value"), H = Jt(['"'], !0, !1), nt = qt("move number"), Pe = Jt([["0", "9"]], !1, !1), mt = rt(".", !1), vt = Jt(["."], !1, !1), xt = qt("standard algebraic notation"), Nt = rt("O-O-O", !1), Q = rt("O-O", !1), je = rt("0-0-0", !1), Fe = rt("0-0", !1), Zt = Jt([["a", "z"], ["A", "Z"], ["1", "8"], "-", "="], !1, !1), Ln = Jt(["+", "#"], !1, !1), Gt = qt("suffix annotation"), jt = Jt(["!", "?"], !1, !1), Qt = qt("NAG"), rr = rt("$", !1), ar = qt("brace comment"), Er = rt("{", !1), G = Jt(["}"], !0, !1), He = rt("}", !1), bt = qt("rest of line comment"), Et = rt(";", !1), n0 = Jt(["\r", `
`], !0, !1), O0 = qt("variation"), v0 = rt("(", !1), b0 = rt(")", !1), r0 = qt("game termination marker"), ir = rt("1-0", !1), sr = rt("0-1", !1), An = rt("1/2-1/2", !1), y0 = rt("*", !1), Cr = qt("whitespace"), lr = Jt([" ", "	", "\r", `
`], !1, !1), Hi = function(T, N) {
    return Q5(T, N);
  }, or = function(T) {
    return Object.fromEntries(T);
  }, ur = function(T, N) {
    return [T, N];
  }, Ui = function(T, N) {
    return { root: T, marker: N };
  }, P0 = function(T, N) {
    return Z5(Y5(T), ...N.flat());
  }, Gi = function(T, N, q, ie, oe) {
    return X5(T, N, q, ie, oe);
  }, ji = function(T) {
    return T;
  }, lt = function(T) {
    return T.replace(/[\r\n]+/g, " ");
  }, w0 = function(T) {
    return T.trim();
  }, Vi = function(T) {
    return T;
  }, ya = function(T, N) {
    return { result: T, comment: N };
  }, B = e.peg$currPos | 0, a0 = [{ line: 1, column: 1 }], Vt = B, cr = e.peg$maxFailExpected || [], V = e.peg$silentFails | 0, un;
  if (e.startRule) {
    if (!(e.startRule in a))
      throw new Error(`Can't start parsing from rule "` + e.startRule + '".');
    i = a[e.startRule];
  }
  function rt(T, N) {
    return { type: "literal", text: T, ignoreCase: N };
  }
  function Jt(T, N, q) {
    return { type: "class", parts: T, inverted: N, ignoreCase: q };
  }
  function $r() {
    return { type: "end" };
  }
  function qt(T) {
    return { type: "other", description: T };
  }
  function cn(T) {
    var N = a0[T], q;
    if (N)
      return N;
    if (T >= a0.length)
      q = a0.length - 1;
    else
      for (q = T; !a0[--q]; )
        ;
    for (N = a0[q], N = {
      line: N.line,
      column: N.column
    }; q < T; )
      r.charCodeAt(q) === 10 ? (N.line++, N.column = 1) : N.column++, q++;
    return a0[T] = N, N;
  }
  function Tr(T, N, q) {
    var ie = cn(T), oe = cn(N), Ce = {
      source: n,
      start: {
        offset: T,
        line: ie.line,
        column: ie.column
      },
      end: {
        offset: N,
        line: oe.line,
        column: oe.column
      }
    };
    return Ce;
  }
  function ne(T) {
    B < Vt || (B > Vt && (Vt = B, cr = []), cr.push(T));
  }
  function wa(T, N, q) {
    return new Q0(
      Q0.buildMessage(T, N),
      T,
      N,
      q
    );
  }
  function Fr() {
    var T, N, q;
    return T = B, N = Wi(), q = ee(), T = Hi(N, q), T;
  }
  function Wi() {
    var T, N, q;
    for (T = B, N = [], q = te(); q !== t; )
      N.push(q), q = te();
    return q = Lt(), T = or(N), T;
  }
  function te() {
    var T, N, q, ie, oe, Ce, U0;
    return V++, T = B, Lt(), r.charCodeAt(B) === 91 ? (N = s, B++) : (N = t, V === 0 && ne(Be)), N !== t ? (Lt(), q = C(), q !== t ? (Lt(), r.charCodeAt(B) === 34 ? (ie = l, B++) : (ie = t, V === 0 && ne(Ee)), ie !== t ? (oe = j(), r.charCodeAt(B) === 34 ? (Ce = l, B++) : (Ce = t, V === 0 && ne(Ee)), Ce !== t ? (Lt(), r.charCodeAt(B) === 93 ? (U0 = o, B++) : (U0 = t, V === 0 && ne(I)), U0 !== t ? T = ur(q, oe) : (B = T, T = t)) : (B = T, T = t)) : (B = T, T = t)) : (B = T, T = t)) : (B = T, T = t), V--, T === t && V === 0 && ne(ke), T;
  }
  function C() {
    var T, N, q;
    if (V++, T = B, N = [], q = r.charAt(B), O.test(q) ? B++ : (q = t, V === 0 && ne(ye)), q !== t)
      for (; q !== t; )
        N.push(q), q = r.charAt(B), O.test(q) ? B++ : (q = t, V === 0 && ne(ye));
    else
      N = t;
    return N !== t ? T = r.substring(T, B) : T = N, V--, T === t && (N = t, V === 0 && ne(be)), T;
  }
  function j() {
    var T, N, q;
    for (V++, T = B, N = [], q = r.charAt(B), L.test(q) ? B++ : (q = t, V === 0 && ne(H)); q !== t; )
      N.push(q), q = r.charAt(B), L.test(q) ? B++ : (q = t, V === 0 && ne(H));
    return T = r.substring(T, B), V--, N = t, V === 0 && ne(Ie), T;
  }
  function ee() {
    var T, N, q;
    return T = B, N = Ne(), Lt(), q = tf(), q === t && (q = null), Lt(), T = Ui(N, q), T;
  }
  function Ne() {
    var T, N, q, ie;
    for (T = B, N = H0(), N === t && (N = null), q = [], ie = pt(); ie !== t; )
      q.push(ie), ie = pt();
    return T = P0(N, q), T;
  }
  function pt() {
    var T, N, q, ie, oe, Ce, U0, Sa;
    if (T = B, Lt(), at(), Lt(), N = Ct(), N !== t) {
      for (q = En(), q === t && (q = null), ie = [], oe = k0(); oe !== t; )
        ie.push(oe), oe = k0();
      for (oe = Lt(), Ce = H0(), Ce === t && (Ce = null), U0 = [], Sa = Mr(); Sa !== t; )
        U0.push(Sa), Sa = Mr();
      T = Gi(N, q, ie, Ce, U0);
    } else
      B = T, T = t;
    return T;
  }
  function at() {
    var T, N, q, ie, oe, Ce;
    for (V++, T = B, N = [], q = r.charAt(B), K.test(q) ? B++ : (q = t, V === 0 && ne(Pe)); q !== t; )
      N.push(q), q = r.charAt(B), K.test(q) ? B++ : (q = t, V === 0 && ne(Pe));
    if (r.charCodeAt(B) === 46 ? (q = u, B++) : (q = t, V === 0 && ne(mt)), q !== t) {
      for (ie = Lt(), oe = [], Ce = r.charAt(B), X.test(Ce) ? B++ : (Ce = t, V === 0 && ne(vt)); Ce !== t; )
        oe.push(Ce), Ce = r.charAt(B), X.test(Ce) ? B++ : (Ce = t, V === 0 && ne(vt));
      N = [N, q, ie, oe], T = N;
    } else
      B = T, T = t;
    return V--, T === t && (N = t, V === 0 && ne(nt)), T;
  }
  function Ct() {
    var T, N, q, ie, oe, Ce;
    if (V++, T = B, N = B, r.substr(B, 5) === h ? (q = h, B += 5) : (q = t, V === 0 && ne(Nt)), q === t && (r.substr(B, 3) === m ? (q = m, B += 3) : (q = t, V === 0 && ne(Q)), q === t && (r.substr(B, 5) === d ? (q = d, B += 5) : (q = t, V === 0 && ne(je)), q === t && (r.substr(B, 3) === g ? (q = g, B += 3) : (q = t, V === 0 && ne(Fe)), q === t))))
      if (q = B, ie = r.charAt(B), O.test(ie) ? B++ : (ie = t, V === 0 && ne(ye)), ie !== t) {
        if (oe = [], Ce = r.charAt(B), J.test(Ce) ? B++ : (Ce = t, V === 0 && ne(Zt)), Ce !== t)
          for (; Ce !== t; )
            oe.push(Ce), Ce = r.charAt(B), J.test(Ce) ? B++ : (Ce = t, V === 0 && ne(Zt));
        else
          oe = t;
        oe !== t ? (ie = [ie, oe], q = ie) : (B = q, q = t);
      } else
        B = q, q = t;
    return q !== t ? (ie = r.charAt(B), Se.test(ie) ? B++ : (ie = t, V === 0 && ne(Ln)), ie === t && (ie = null), q = [q, ie], N = q) : (B = N, N = t), N !== t ? T = r.substring(T, B) : T = N, V--, T === t && (N = t, V === 0 && ne(xt)), T;
  }
  function En() {
    var T, N, q;
    for (V++, T = B, N = [], q = r.charAt(B), _e.test(q) ? B++ : (q = t, V === 0 && ne(jt)); q !== t; )
      N.push(q), N.length >= 2 ? q = t : (q = r.charAt(B), _e.test(q) ? B++ : (q = t, V === 0 && ne(jt)));
    return N.length < 1 ? (B = T, T = t) : T = N, V--, T === t && (N = t, V === 0 && ne(Gt)), T;
  }
  function k0() {
    var T, N, q, ie, oe;
    if (V++, T = B, Lt(), r.charCodeAt(B) === 36 ? (N = b, B++) : (N = t, V === 0 && ne(rr)), N !== t) {
      if (q = B, ie = [], oe = r.charAt(B), K.test(oe) ? B++ : (oe = t, V === 0 && ne(Pe)), oe !== t)
        for (; oe !== t; )
          ie.push(oe), oe = r.charAt(B), K.test(oe) ? B++ : (oe = t, V === 0 && ne(Pe));
      else
        ie = t;
      ie !== t ? q = r.substring(q, B) : q = ie, q !== t ? T = ji(q) : (B = T, T = t);
    } else
      B = T, T = t;
    return V--, T === t && V === 0 && ne(Qt), T;
  }
  function H0() {
    var T;
    return T = yt(), T === t && (T = ka()), T;
  }
  function yt() {
    var T, N, q, ie, oe;
    if (V++, T = B, r.charCodeAt(B) === 123 ? (N = v, B++) : (N = t, V === 0 && ne(Er)), N !== t) {
      for (q = B, ie = [], oe = r.charAt(B), ge.test(oe) ? B++ : (oe = t, V === 0 && ne(G)); oe !== t; )
        ie.push(oe), oe = r.charAt(B), ge.test(oe) ? B++ : (oe = t, V === 0 && ne(G));
      q = r.substring(q, B), r.charCodeAt(B) === 125 ? (ie = w, B++) : (ie = t, V === 0 && ne(He)), ie !== t ? T = lt(q) : (B = T, T = t);
    } else
      B = T, T = t;
    return V--, T === t && (N = t, V === 0 && ne(ar)), T;
  }
  function ka() {
    var T, N, q, ie, oe;
    if (V++, T = B, r.charCodeAt(B) === 59 ? (N = x, B++) : (N = t, V === 0 && ne(Et)), N !== t) {
      for (q = B, ie = [], oe = r.charAt(B), Ae.test(oe) ? B++ : (oe = t, V === 0 && ne(n0)); oe !== t; )
        ie.push(oe), oe = r.charAt(B), Ae.test(oe) ? B++ : (oe = t, V === 0 && ne(n0));
      q = r.substring(q, B), T = w0(q);
    } else
      B = T, T = t;
    return V--, T === t && (N = t, V === 0 && ne(bt)), T;
  }
  function Mr() {
    var T, N, q, ie;
    return V++, T = B, Lt(), r.charCodeAt(B) === 40 ? (N = k, B++) : (N = t, V === 0 && ne(v0)), N !== t ? (q = Ne(), q !== t ? (Lt(), r.charCodeAt(B) === 41 ? (ie = y, B++) : (ie = t, V === 0 && ne(b0)), ie !== t ? T = Vi(q) : (B = T, T = t)) : (B = T, T = t)) : (B = T, T = t), V--, T === t && V === 0 && ne(O0), T;
  }
  function tf() {
    var T, N, q;
    return V++, T = B, r.substr(B, 3) === A ? (N = A, B += 3) : (N = t, V === 0 && ne(ir)), N === t && (r.substr(B, 3) === $ ? (N = $, B += 3) : (N = t, V === 0 && ne(sr)), N === t && (r.substr(B, 7) === M ? (N = M, B += 7) : (N = t, V === 0 && ne(An)), N === t && (r.charCodeAt(B) === 42 ? (N = z, B++) : (N = t, V === 0 && ne(y0))))), N !== t ? (Lt(), q = H0(), q === t && (q = null), T = ya(N, q)) : (B = T, T = t), V--, T === t && (N = t, V === 0 && ne(r0)), T;
  }
  function Lt() {
    var T, N;
    for (V++, T = [], N = r.charAt(B), Oe.test(N) ? B++ : (N = t, V === 0 && ne(lr)); N !== t; )
      T.push(N), N = r.charAt(B), Oe.test(N) ? B++ : (N = t, V === 0 && ne(lr));
    return V--, N = t, V === 0 && ne(Cr), T;
  }
  if (un = i(), e.peg$library)
    return (
      /** @type {any} */
      {
        peg$result: un,
        peg$currPos: B,
        peg$FAILED: t,
        peg$maxFailExpected: cr,
        peg$maxFailPos: Vt
      }
    );
  if (un !== t && B === r.length)
    return un;
  throw un !== t && B < r.length && ne($r()), wa(
    cr,
    Vt < r.length ? r.charAt(Vt) : null,
    Vt < r.length ? Tr(Vt, Vt + 1) : Tr(Vt, Vt)
  );
}
var t3 = {
  StartRules: ["pgn"],
  SyntaxError: Q0,
  parse: e3
};
/**
 * @license
 * Copyright (c) 2025, Jeff Hlywa (jhlywa@gmail.com)
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * 1. Redistributions of source code must retain the above copyright notice,
 *    this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright notice,
 *    this list of conditions and the following disclaimer in the documentation
 *    and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */
const pi = 0xffffffffffffffffn;
function qs(r, e) {
  return (r << e | r >> 64n - e) & 0xffffffffffffffffn;
}
function a1(r, e) {
  return r * e & pi;
}
function n3(r) {
  return function() {
    let e = BigInt(r & pi), t = BigInt(r >> 64n & pi);
    const n = a1(qs(a1(e, 5n), 7n), 9n);
    return t ^= e, e = (qs(e, 24n) ^ t ^ t << 16n) & pi, t = qs(t, 37n), r = t << 64n | e, n;
  };
}
const Ri = n3(0xa187eb39cdcaed8f31c4b365b102e01en), r3 = Array.from({ length: 2 }, () => Array.from({ length: 6 }, () => Array.from({ length: 128 }, () => Ri()))), a3 = Array.from({ length: 8 }, () => Ri()), i3 = Array.from({ length: 16 }, () => Ri()), Ls = Ri(), Mt = "w", mn = "b", ot = "p", vl = "n", gi = "b", Wr = "r", F0 = "q", gt = "k", Is = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1";
class Xa {
  constructor(e, t) {
    ce(this, "color");
    ce(this, "from");
    ce(this, "to");
    ce(this, "piece");
    ce(this, "captured");
    ce(this, "promotion");
    /**
     * @deprecated This field is deprecated and will be removed in version 2.0.0.
     * Please use move descriptor functions instead: `isCapture`, `isPromotion`,
     * `isEnPassant`, `isKingsideCastle`, `isQueensideCastle`, `isCastle`, and
     * `isBigPawn`
     */
    ce(this, "flags");
    ce(this, "san");
    ce(this, "lan");
    ce(this, "before");
    ce(this, "after");
    const { color: n, piece: a, from: i, to: s, flags: l, captured: o, promotion: u } = t, h = St(i), m = St(s);
    this.color = n, this.piece = a, this.from = h, this.to = m, this.san = e._moveToSan(t, e._moves({ legal: !0 })), this.lan = h + m, this.before = e.fen(), e._makeMove(t), this.after = e.fen(), e._undoMove(), this.flags = "";
    for (const d in me)
      me[d] & l && (this.flags += W0[d]);
    o && (this.captured = o), u && (this.promotion = u, this.lan += u);
  }
  isCapture() {
    return this.flags.indexOf(W0.CAPTURE) > -1;
  }
  isPromotion() {
    return this.flags.indexOf(W0.PROMOTION) > -1;
  }
  isEnPassant() {
    return this.flags.indexOf(W0.EP_CAPTURE) > -1;
  }
  isKingsideCastle() {
    return this.flags.indexOf(W0.KSIDE_CASTLE) > -1;
  }
  isQueensideCastle() {
    return this.flags.indexOf(W0.QSIDE_CASTLE) > -1;
  }
  isBigPawn() {
    return this.flags.indexOf(W0.BIG_PAWN) > -1;
  }
}
const Tt = -1, W0 = {
  NORMAL: "n",
  CAPTURE: "c",
  BIG_PAWN: "b",
  EP_CAPTURE: "e",
  PROMOTION: "p",
  KSIDE_CASTLE: "k",
  QSIDE_CASTLE: "q"
}, me = {
  NORMAL: 1,
  CAPTURE: 2,
  BIG_PAWN: 4,
  EP_CAPTURE: 8,
  PROMOTION: 16,
  KSIDE_CASTLE: 32,
  QSIDE_CASTLE: 64
}, bl = {
  Event: "?",
  Site: "?",
  Date: "????.??.??",
  Round: "?",
  White: "?",
  Black: "?",
  Result: "*"
}, s3 = {
  WhiteTitle: null,
  BlackTitle: null,
  WhiteElo: null,
  BlackElo: null,
  WhiteUSCF: null,
  BlackUSCF: null,
  WhiteNA: null,
  BlackNA: null,
  WhiteType: null,
  BlackType: null,
  EventDate: null,
  EventSponsor: null,
  Section: null,
  Stage: null,
  Board: null,
  Opening: null,
  Variation: null,
  SubVariation: null,
  ECO: null,
  NIC: null,
  Time: null,
  UTCTime: null,
  UTCDate: null,
  TimeControl: null,
  SetUp: null,
  FEN: null,
  Termination: null,
  Annotator: null,
  Mode: null,
  PlyCount: null
}, l3 = {
  ...bl,
  ...s3
}, he = {
  a8: 0,
  b8: 1,
  c8: 2,
  d8: 3,
  e8: 4,
  f8: 5,
  g8: 6,
  h8: 7,
  a7: 16,
  b7: 17,
  c7: 18,
  d7: 19,
  e7: 20,
  f7: 21,
  g7: 22,
  h7: 23,
  a6: 32,
  b6: 33,
  c6: 34,
  d6: 35,
  e6: 36,
  f6: 37,
  g6: 38,
  h6: 39,
  a5: 48,
  b5: 49,
  c5: 50,
  d5: 51,
  e5: 52,
  f5: 53,
  g5: 54,
  h5: 55,
  a4: 64,
  b4: 65,
  c4: 66,
  d4: 67,
  e4: 68,
  f4: 69,
  g4: 70,
  h4: 71,
  a3: 80,
  b3: 81,
  c3: 82,
  d3: 83,
  e3: 84,
  f3: 85,
  g3: 86,
  h3: 87,
  a2: 96,
  b2: 97,
  c2: 98,
  d2: 99,
  e2: 100,
  f2: 101,
  g2: 102,
  h2: 103,
  a1: 112,
  b1: 113,
  c1: 114,
  d1: 115,
  e1: 116,
  f1: 117,
  g1: 118,
  h1: 119
}, Rs = {
  b: [16, 32, 17, 15],
  w: [-16, -32, -17, -15]
}, i1 = {
  n: [-18, -33, -31, -14, 18, 33, 31, 14],
  b: [-17, -15, 17, 15],
  r: [-16, 1, 16, -1],
  q: [-17, -16, -15, 1, 17, 16, 15, -1],
  k: [-17, -16, -15, 1, 17, 16, 15, -1]
}, o3 = [
  20,
  0,
  0,
  0,
  0,
  0,
  0,
  24,
  0,
  0,
  0,
  0,
  0,
  0,
  20,
  0,
  0,
  20,
  0,
  0,
  0,
  0,
  0,
  24,
  0,
  0,
  0,
  0,
  0,
  20,
  0,
  0,
  0,
  0,
  20,
  0,
  0,
  0,
  0,
  24,
  0,
  0,
  0,
  0,
  20,
  0,
  0,
  0,
  0,
  0,
  0,
  20,
  0,
  0,
  0,
  24,
  0,
  0,
  0,
  20,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  20,
  0,
  0,
  24,
  0,
  0,
  20,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  20,
  2,
  24,
  2,
  20,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  2,
  53,
  56,
  53,
  2,
  0,
  0,
  0,
  0,
  0,
  0,
  24,
  24,
  24,
  24,
  24,
  24,
  56,
  0,
  56,
  24,
  24,
  24,
  24,
  24,
  24,
  0,
  0,
  0,
  0,
  0,
  0,
  2,
  53,
  56,
  53,
  2,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  20,
  2,
  24,
  2,
  20,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  20,
  0,
  0,
  24,
  0,
  0,
  20,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  20,
  0,
  0,
  0,
  24,
  0,
  0,
  0,
  20,
  0,
  0,
  0,
  0,
  0,
  0,
  20,
  0,
  0,
  0,
  0,
  24,
  0,
  0,
  0,
  0,
  20,
  0,
  0,
  0,
  0,
  20,
  0,
  0,
  0,
  0,
  0,
  24,
  0,
  0,
  0,
  0,
  0,
  20,
  0,
  0,
  20,
  0,
  0,
  0,
  0,
  0,
  0,
  24,
  0,
  0,
  0,
  0,
  0,
  0,
  20
], u3 = [
  17,
  0,
  0,
  0,
  0,
  0,
  0,
  16,
  0,
  0,
  0,
  0,
  0,
  0,
  15,
  0,
  0,
  17,
  0,
  0,
  0,
  0,
  0,
  16,
  0,
  0,
  0,
  0,
  0,
  15,
  0,
  0,
  0,
  0,
  17,
  0,
  0,
  0,
  0,
  16,
  0,
  0,
  0,
  0,
  15,
  0,
  0,
  0,
  0,
  0,
  0,
  17,
  0,
  0,
  0,
  16,
  0,
  0,
  0,
  15,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  17,
  0,
  0,
  16,
  0,
  0,
  15,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  17,
  0,
  16,
  0,
  15,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  17,
  16,
  15,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  1,
  1,
  1,
  1,
  1,
  1,
  1,
  0,
  -1,
  -1,
  -1,
  -1,
  -1,
  -1,
  -1,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  -15,
  -16,
  -17,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  -15,
  0,
  -16,
  0,
  -17,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  -15,
  0,
  0,
  -16,
  0,
  0,
  -17,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  -15,
  0,
  0,
  0,
  -16,
  0,
  0,
  0,
  -17,
  0,
  0,
  0,
  0,
  0,
  0,
  -15,
  0,
  0,
  0,
  0,
  -16,
  0,
  0,
  0,
  0,
  -17,
  0,
  0,
  0,
  0,
  -15,
  0,
  0,
  0,
  0,
  0,
  -16,
  0,
  0,
  0,
  0,
  0,
  -17,
  0,
  0,
  -15,
  0,
  0,
  0,
  0,
  0,
  0,
  -16,
  0,
  0,
  0,
  0,
  0,
  0,
  -17
], c3 = { p: 1, n: 2, b: 4, r: 8, q: 16, k: 32 }, h3 = "pnbrqkPNBRQK", s1 = [vl, gi, Wr, F0], f3 = 7, d3 = 6, m3 = 1, p3 = 0, Za = {
  [gt]: me.KSIDE_CASTLE,
  [F0]: me.QSIDE_CASTLE
}, x0 = {
  w: [
    { square: he.a1, flag: me.QSIDE_CASTLE },
    { square: he.h1, flag: me.KSIDE_CASTLE }
  ],
  b: [
    { square: he.a8, flag: me.QSIDE_CASTLE },
    { square: he.h8, flag: me.KSIDE_CASTLE }
  ]
}, g3 = { b: m3, w: d3 };
function X0(r) {
  return r >> 4;
}
function sa(r) {
  return r & 15;
}
function Lh(r) {
  return "0123456789".indexOf(r) !== -1;
}
function St(r) {
  const e = sa(r), t = X0(r);
  return "abcdefgh".substring(e, e + 1) + "87654321".substring(t, t + 1);
}
function Ur(r) {
  return r === Mt ? mn : Mt;
}
function _3(r) {
  const e = r.split(/\s+/);
  if (e.length !== 6)
    return {
      ok: !1,
      error: "Invalid FEN: must contain six space-delimited fields"
    };
  const t = parseInt(e[5], 10);
  if (isNaN(t) || t <= 0)
    return {
      ok: !1,
      error: "Invalid FEN: move number must be a positive integer"
    };
  const n = parseInt(e[4], 10);
  if (isNaN(n) || n < 0)
    return {
      ok: !1,
      error: "Invalid FEN: half move counter number must be a non-negative integer"
    };
  if (!/^(-|[abcdefgh][36])$/.test(e[3]))
    return { ok: !1, error: "Invalid FEN: en-passant square is invalid" };
  if (/[^kKqQ-]/.test(e[2]))
    return { ok: !1, error: "Invalid FEN: castling availability is invalid" };
  if (!/^(w|b)$/.test(e[1]))
    return { ok: !1, error: "Invalid FEN: side-to-move is invalid" };
  const a = e[0].split("/");
  if (a.length !== 8)
    return {
      ok: !1,
      error: "Invalid FEN: piece data does not contain 8 '/'-delimited rows"
    };
  for (let s = 0; s < a.length; s++) {
    let l = 0, o = !1;
    for (let u = 0; u < a[s].length; u++)
      if (Lh(a[s][u])) {
        if (o)
          return {
            ok: !1,
            error: "Invalid FEN: piece data is invalid (consecutive number)"
          };
        l += parseInt(a[s][u], 10), o = !0;
      } else {
        if (!/^[prnbqkPRNBQK]$/.test(a[s][u]))
          return {
            ok: !1,
            error: "Invalid FEN: piece data is invalid (invalid piece)"
          };
        l += 1, o = !1;
      }
    if (l !== 8)
      return {
        ok: !1,
        error: "Invalid FEN: piece data is invalid (too many squares in rank)"
      };
  }
  if (e[3][1] == "3" && e[1] == "w" || e[3][1] == "6" && e[1] == "b")
    return { ok: !1, error: "Invalid FEN: illegal en-passant square" };
  const i = [
    { color: "white", regex: /K/g },
    { color: "black", regex: /k/g }
  ];
  for (const { color: s, regex: l } of i) {
    if (!l.test(e[0]))
      return { ok: !1, error: `Invalid FEN: missing ${s} king` };
    if ((e[0].match(l) || []).length > 1)
      return { ok: !1, error: `Invalid FEN: too many ${s} kings` };
  }
  return Array.from(a[0] + a[7]).some((s) => s.toUpperCase() === "P") ? {
    ok: !1,
    error: "Invalid FEN: some pawns are on the edge rows"
  } : { ok: !0 };
}
function v3(r, e) {
  const t = r.from, n = r.to, a = r.piece;
  let i = 0, s = 0, l = 0;
  for (let o = 0, u = e.length; o < u; o++) {
    const h = e[o].from, m = e[o].to, d = e[o].piece;
    a === d && t !== h && n === m && (i++, X0(t) === X0(h) && s++, sa(t) === sa(h) && l++);
  }
  return i > 0 ? s > 0 && l > 0 ? St(t) : l > 0 ? St(t).charAt(1) : St(t).charAt(0) : "";
}
function A0(r, e, t, n, a, i = void 0, s = me.NORMAL) {
  const l = X0(n);
  if (a === ot && (l === f3 || l === p3))
    for (let o = 0; o < s1.length; o++) {
      const u = s1[o];
      r.push({
        color: e,
        from: t,
        to: n,
        piece: a,
        captured: i,
        promotion: u,
        flags: s | me.PROMOTION
      });
    }
  else
    r.push({
      color: e,
      from: t,
      to: n,
      piece: a,
      captured: i,
      flags: s
    });
}
function l1(r) {
  let e = r.charAt(0);
  return e >= "a" && e <= "h" ? r.match(/[a-h]\d.*[a-h]\d/) ? void 0 : ot : (e = e.toLowerCase(), e === "o" ? gt : e);
}
function Os(r) {
  return r.replace(/=/, "").replace(/[+#]?[?!]*$/, "");
}
class Qa {
  constructor(e = Is, { skipValidation: t = !1 } = {}) {
    ce(this, "_board", new Array(128));
    ce(this, "_turn", Mt);
    ce(this, "_header", {});
    ce(this, "_kings", { w: Tt, b: Tt });
    ce(this, "_epSquare", -1);
    ce(this, "_halfMoves", 0);
    ce(this, "_moveNumber", 0);
    ce(this, "_history", []);
    ce(this, "_comments", {});
    ce(this, "_castling", { w: 0, b: 0 });
    ce(this, "_hash", 0n);
    // tracks number of times a position has been seen for repetition checking
    ce(this, "_positionCount", /* @__PURE__ */ new Map());
    this.load(e, { skipValidation: t });
  }
  clear({ preserveHeaders: e = !1 } = {}) {
    this._board = new Array(128), this._kings = { w: Tt, b: Tt }, this._turn = Mt, this._castling = { w: 0, b: 0 }, this._epSquare = Tt, this._halfMoves = 0, this._moveNumber = 1, this._history = [], this._comments = {}, this._header = e ? this._header : { ...l3 }, this._hash = this._computeHash(), this._positionCount = /* @__PURE__ */ new Map(), this._header.SetUp = null, this._header.FEN = null;
  }
  load(e, { skipValidation: t = !1, preserveHeaders: n = !1 } = {}) {
    let a = e.split(/\s+/);
    if (a.length >= 2 && a.length < 6) {
      const l = ["-", "-", "0", "1"];
      e = a.concat(l.slice(-(6 - a.length))).join(" ");
    }
    if (a = e.split(/\s+/), !t) {
      const { ok: l, error: o } = _3(e);
      if (!l)
        throw new Error(o);
    }
    const i = a[0];
    let s = 0;
    this.clear({ preserveHeaders: n });
    for (let l = 0; l < i.length; l++) {
      const o = i.charAt(l);
      if (o === "/")
        s += 8;
      else if (Lh(o))
        s += parseInt(o, 10);
      else {
        const u = o < "a" ? Mt : mn;
        this._put({ type: o.toLowerCase(), color: u }, St(s)), s++;
      }
    }
    this._turn = a[1], a[2].indexOf("K") > -1 && (this._castling.w |= me.KSIDE_CASTLE), a[2].indexOf("Q") > -1 && (this._castling.w |= me.QSIDE_CASTLE), a[2].indexOf("k") > -1 && (this._castling.b |= me.KSIDE_CASTLE), a[2].indexOf("q") > -1 && (this._castling.b |= me.QSIDE_CASTLE), this._epSquare = a[3] === "-" ? Tt : he[a[3]], this._halfMoves = parseInt(a[4], 10), this._moveNumber = parseInt(a[5], 10), this._hash = this._computeHash(), this._updateSetup(e), this._incPositionCount();
  }
  fen({ forceEnpassantSquare: e = !1 } = {}) {
    var s, l;
    let t = 0, n = "";
    for (let o = he.a8; o <= he.h1; o++) {
      if (this._board[o]) {
        t > 0 && (n += t, t = 0);
        const { color: u, type: h } = this._board[o];
        n += u === Mt ? h.toUpperCase() : h.toLowerCase();
      } else
        t++;
      o + 1 & 136 && (t > 0 && (n += t), o !== he.h1 && (n += "/"), t = 0, o += 8);
    }
    let a = "";
    this._castling[Mt] & me.KSIDE_CASTLE && (a += "K"), this._castling[Mt] & me.QSIDE_CASTLE && (a += "Q"), this._castling[mn] & me.KSIDE_CASTLE && (a += "k"), this._castling[mn] & me.QSIDE_CASTLE && (a += "q"), a = a || "-";
    let i = "-";
    if (this._epSquare !== Tt)
      if (e)
        i = St(this._epSquare);
      else {
        const o = this._epSquare + (this._turn === Mt ? 16 : -16), u = [o + 1, o - 1];
        for (const h of u) {
          if (h & 136)
            continue;
          const m = this._turn;
          if (((s = this._board[h]) == null ? void 0 : s.color) === m && ((l = this._board[h]) == null ? void 0 : l.type) === ot) {
            this._makeMove({
              color: m,
              from: h,
              to: this._epSquare,
              piece: ot,
              captured: ot,
              flags: me.EP_CAPTURE
            });
            const d = !this._isKingAttacked(m);
            if (this._undoMove(), d) {
              i = St(this._epSquare);
              break;
            }
          }
        }
      }
    return [
      n,
      this._turn,
      a,
      i,
      this._halfMoves,
      this._moveNumber
    ].join(" ");
  }
  _pieceKey(e) {
    if (!this._board[e])
      return 0n;
    const { color: t, type: n } = this._board[e], a = {
      w: 0,
      b: 1
    }[t], i = {
      p: 0,
      n: 1,
      b: 2,
      r: 3,
      q: 4,
      k: 5
    }[n];
    return r3[a][i][e];
  }
  _epKey() {
    return this._epSquare === Tt ? 0n : a3[this._epSquare & 7];
  }
  _castlingKey() {
    const e = this._castling.w >> 5 | this._castling.b >> 3;
    return i3[e];
  }
  _computeHash() {
    let e = 0n;
    for (let t = he.a8; t <= he.h1; t++) {
      if (t & 136) {
        t += 7;
        continue;
      }
      this._board[t] && (e ^= this._pieceKey(t));
    }
    return e ^= this._epKey(), e ^= this._castlingKey(), this._turn === "b" && (e ^= Ls), e;
  }
  /*
   * Called when the initial board setup is changed with put() or remove().
   * modifies the SetUp and FEN properties of the header object. If the FEN
   * is equal to the default position, the SetUp and FEN are deleted the setup
   * is only updated if history.length is zero, ie moves haven't been made.
   */
  _updateSetup(e) {
    this._history.length > 0 || (e !== Is ? (this._header.SetUp = "1", this._header.FEN = e) : (this._header.SetUp = null, this._header.FEN = null));
  }
  reset() {
    this.load(Is);
  }
  get(e) {
    return this._board[he[e]];
  }
  findPiece(e) {
    var n;
    const t = [];
    for (let a = he.a8; a <= he.h1; a++) {
      if (a & 136) {
        a += 7;
        continue;
      }
      !this._board[a] || ((n = this._board[a]) == null ? void 0 : n.color) !== e.color || this._board[a].color === e.color && this._board[a].type === e.type && t.push(St(a));
    }
    return t;
  }
  put({ type: e, color: t }, n) {
    return this._put({ type: e, color: t }, n) ? (this._updateCastlingRights(), this._updateEnPassantSquare(), this._updateSetup(this.fen()), !0) : !1;
  }
  _set(e, t) {
    this._hash ^= this._pieceKey(e), this._board[e] = t, this._hash ^= this._pieceKey(e);
  }
  _put({ type: e, color: t }, n) {
    if (h3.indexOf(e.toLowerCase()) === -1 || !(n in he))
      return !1;
    const a = he[n];
    if (e == gt && !(this._kings[t] == Tt || this._kings[t] == a))
      return !1;
    const i = this._board[a];
    return i && i.type === gt && (this._kings[i.color] = Tt), this._set(a, { type: e, color: t }), e === gt && (this._kings[t] = a), !0;
  }
  _clear(e) {
    this._hash ^= this._pieceKey(e), delete this._board[e];
  }
  remove(e) {
    const t = this.get(e);
    return this._clear(he[e]), t && t.type === gt && (this._kings[t.color] = Tt), this._updateCastlingRights(), this._updateEnPassantSquare(), this._updateSetup(this.fen()), t;
  }
  _updateCastlingRights() {
    var n, a, i, s, l, o, u, h, m, d, g, b;
    this._hash ^= this._castlingKey();
    const e = ((n = this._board[he.e1]) == null ? void 0 : n.type) === gt && ((a = this._board[he.e1]) == null ? void 0 : a.color) === Mt, t = ((i = this._board[he.e8]) == null ? void 0 : i.type) === gt && ((s = this._board[he.e8]) == null ? void 0 : s.color) === mn;
    (!e || ((l = this._board[he.a1]) == null ? void 0 : l.type) !== Wr || ((o = this._board[he.a1]) == null ? void 0 : o.color) !== Mt) && (this._castling.w &= -65), (!e || ((u = this._board[he.h1]) == null ? void 0 : u.type) !== Wr || ((h = this._board[he.h1]) == null ? void 0 : h.color) !== Mt) && (this._castling.w &= -33), (!t || ((m = this._board[he.a8]) == null ? void 0 : m.type) !== Wr || ((d = this._board[he.a8]) == null ? void 0 : d.color) !== mn) && (this._castling.b &= -65), (!t || ((g = this._board[he.h8]) == null ? void 0 : g.type) !== Wr || ((b = this._board[he.h8]) == null ? void 0 : b.color) !== mn) && (this._castling.b &= -33), this._hash ^= this._castlingKey();
  }
  _updateEnPassantSquare() {
    var i, s;
    if (this._epSquare === Tt)
      return;
    const e = this._epSquare + (this._turn === Mt ? -16 : 16), t = this._epSquare + (this._turn === Mt ? 16 : -16), n = [t + 1, t - 1];
    if (this._board[e] !== null || this._board[this._epSquare] !== null || ((i = this._board[t]) == null ? void 0 : i.color) !== Ur(this._turn) || ((s = this._board[t]) == null ? void 0 : s.type) !== ot) {
      this._hash ^= this._epKey(), this._epSquare = Tt;
      return;
    }
    const a = (l) => {
      var o, u;
      return !(l & 136) && ((o = this._board[l]) == null ? void 0 : o.color) === this._turn && ((u = this._board[l]) == null ? void 0 : u.type) === ot;
    };
    n.some(a) || (this._hash ^= this._epKey(), this._epSquare = Tt);
  }
  _attacked(e, t, n) {
    const a = [];
    for (let i = he.a8; i <= he.h1; i++) {
      if (i & 136) {
        i += 7;
        continue;
      }
      if (this._board[i] === void 0 || this._board[i].color !== e)
        continue;
      const s = this._board[i], l = i - t;
      if (l === 0)
        continue;
      const o = l + 119;
      if (o3[o] & c3[s.type]) {
        if (s.type === ot) {
          if (l > 0 && s.color === Mt || l <= 0 && s.color === mn)
            if (n)
              a.push(St(i));
            else
              return !0;
          continue;
        }
        if (s.type === "n" || s.type === "k")
          if (n) {
            a.push(St(i));
            continue;
          } else
            return !0;
        const u = u3[o];
        let h = i + u, m = !1;
        for (; h !== t; ) {
          if (this._board[h] != null) {
            m = !0;
            break;
          }
          h += u;
        }
        if (!m)
          if (n) {
            a.push(St(i));
            continue;
          } else
            return !0;
      }
    }
    return n ? a : !1;
  }
  attackers(e, t) {
    return t ? this._attacked(t, he[e], !0) : this._attacked(this._turn, he[e], !0);
  }
  _isKingAttacked(e) {
    const t = this._kings[e];
    return t === -1 ? !1 : this._attacked(Ur(e), t);
  }
  hash() {
    return this._hash.toString(16);
  }
  isAttacked(e, t) {
    return this._attacked(t, he[e]);
  }
  isCheck() {
    return this._isKingAttacked(this._turn);
  }
  inCheck() {
    return this.isCheck();
  }
  isCheckmate() {
    return this.isCheck() && this._moves().length === 0;
  }
  isStalemate() {
    return !this.isCheck() && this._moves().length === 0;
  }
  isInsufficientMaterial() {
    const e = {
      b: 0,
      n: 0,
      r: 0,
      q: 0,
      k: 0,
      p: 0
    }, t = [];
    let n = 0, a = 0;
    for (let i = he.a8; i <= he.h1; i++) {
      if (a = (a + 1) % 2, i & 136) {
        i += 7;
        continue;
      }
      const s = this._board[i];
      s && (e[s.type] = s.type in e ? e[s.type] + 1 : 1, s.type === gi && t.push(a), n++);
    }
    if (n === 2)
      return !0;
    if (
      // k vs. kn .... or .... k vs. kb
      n === 3 && (e[gi] === 1 || e[vl] === 1)
    )
      return !0;
    if (n === e[gi] + 2) {
      let i = 0;
      const s = t.length;
      for (let l = 0; l < s; l++)
        i += t[l];
      if (i === 0 || i === s)
        return !0;
    }
    return !1;
  }
  isThreefoldRepetition() {
    return this._getPositionCount(this._hash) >= 3;
  }
  isDrawByFiftyMoves() {
    return this._halfMoves >= 100;
  }
  isDraw() {
    return this.isDrawByFiftyMoves() || this.isStalemate() || this.isInsufficientMaterial() || this.isThreefoldRepetition();
  }
  isGameOver() {
    return this.isCheckmate() || this.isDraw();
  }
  moves({ verbose: e = !1, square: t = void 0, piece: n = void 0 } = {}) {
    const a = this._moves({ square: t, piece: n });
    return e ? a.map((i) => new Xa(this, i)) : a.map((i) => this._moveToSan(i, a));
  }
  _moves({ legal: e = !0, piece: t = void 0, square: n = void 0 } = {}) {
    var g;
    const a = n ? n.toLowerCase() : void 0, i = t == null ? void 0 : t.toLowerCase(), s = [], l = this._turn, o = Ur(l);
    let u = he.a8, h = he.h1, m = !1;
    if (a)
      if (a in he)
        u = h = he[a], m = !0;
      else
        return [];
    for (let b = u; b <= h; b++) {
      if (b & 136) {
        b += 7;
        continue;
      }
      if (!this._board[b] || this._board[b].color === o)
        continue;
      const { type: v } = this._board[b];
      let w;
      if (v === ot) {
        if (i && i !== v)
          continue;
        w = b + Rs[l][0], this._board[w] || (A0(s, l, b, w, ot), w = b + Rs[l][1], g3[l] === X0(b) && !this._board[w] && A0(s, l, b, w, ot, void 0, me.BIG_PAWN));
        for (let x = 2; x < 4; x++)
          w = b + Rs[l][x], !(w & 136) && (((g = this._board[w]) == null ? void 0 : g.color) === o ? A0(s, l, b, w, ot, this._board[w].type, me.CAPTURE) : w === this._epSquare && A0(s, l, b, w, ot, ot, me.EP_CAPTURE));
      } else {
        if (i && i !== v)
          continue;
        for (let x = 0, k = i1[v].length; x < k; x++) {
          const y = i1[v][x];
          for (w = b; w += y, !(w & 136); ) {
            if (!this._board[w])
              A0(s, l, b, w, v);
            else {
              if (this._board[w].color === l)
                break;
              A0(s, l, b, w, v, this._board[w].type, me.CAPTURE);
              break;
            }
            if (v === vl || v === gt)
              break;
          }
        }
      }
    }
    if ((i === void 0 || i === gt) && (!m || h === this._kings[l])) {
      if (this._castling[l] & me.KSIDE_CASTLE) {
        const b = this._kings[l], v = b + 2;
        !this._board[b + 1] && !this._board[v] && !this._attacked(o, this._kings[l]) && !this._attacked(o, b + 1) && !this._attacked(o, v) && A0(s, l, this._kings[l], v, gt, void 0, me.KSIDE_CASTLE);
      }
      if (this._castling[l] & me.QSIDE_CASTLE) {
        const b = this._kings[l], v = b - 2;
        !this._board[b - 1] && !this._board[b - 2] && !this._board[b - 3] && !this._attacked(o, this._kings[l]) && !this._attacked(o, b - 1) && !this._attacked(o, v) && A0(s, l, this._kings[l], v, gt, void 0, me.QSIDE_CASTLE);
      }
    }
    if (!e || this._kings[l] === -1)
      return s;
    const d = [];
    for (let b = 0, v = s.length; b < v; b++)
      this._makeMove(s[b]), this._isKingAttacked(l) || d.push(s[b]), this._undoMove();
    return d;
  }
  move(e, { strict: t = !1 } = {}) {
    let n = null;
    if (typeof e == "string")
      n = this._moveFromSan(e, t);
    else if (typeof e == "object") {
      const i = this._moves();
      for (let s = 0, l = i.length; s < l; s++)
        if (e.from === St(i[s].from) && e.to === St(i[s].to) && (!("promotion" in i[s]) || e.promotion === i[s].promotion)) {
          n = i[s];
          break;
        }
    }
    if (!n)
      throw typeof e == "string" ? new Error(`Invalid move: ${e}`) : new Error(`Invalid move: ${JSON.stringify(e)}`);
    const a = new Xa(this, n);
    return this._makeMove(n), this._incPositionCount(), a;
  }
  _push(e) {
    this._history.push({
      move: e,
      kings: { b: this._kings.b, w: this._kings.w },
      turn: this._turn,
      castling: { b: this._castling.b, w: this._castling.w },
      epSquare: this._epSquare,
      halfMoves: this._halfMoves,
      moveNumber: this._moveNumber
    });
  }
  _movePiece(e, t) {
    this._hash ^= this._pieceKey(e), this._board[t] = this._board[e], delete this._board[e], this._hash ^= this._pieceKey(t);
  }
  _makeMove(e) {
    var a, i, s, l;
    const t = this._turn, n = Ur(t);
    if (this._push(e), this._hash ^= this._epKey(), this._hash ^= this._castlingKey(), e.captured && (this._hash ^= this._pieceKey(e.to)), this._movePiece(e.from, e.to), e.flags & me.EP_CAPTURE && (this._turn === mn ? this._clear(e.to - 16) : this._clear(e.to + 16)), e.promotion && (this._clear(e.to), this._set(e.to, { type: e.promotion, color: t })), this._board[e.to].type === gt) {
      if (this._kings[t] = e.to, e.flags & me.KSIDE_CASTLE) {
        const o = e.to - 1, u = e.to + 1;
        this._movePiece(u, o);
      } else if (e.flags & me.QSIDE_CASTLE) {
        const o = e.to + 1, u = e.to - 2;
        this._movePiece(u, o);
      }
      this._castling[t] = 0;
    }
    if (this._castling[t]) {
      for (let o = 0, u = x0[t].length; o < u; o++)
        if (e.from === x0[t][o].square && this._castling[t] & x0[t][o].flag) {
          this._castling[t] ^= x0[t][o].flag;
          break;
        }
    }
    if (this._castling[n]) {
      for (let o = 0, u = x0[n].length; o < u; o++)
        if (e.to === x0[n][o].square && this._castling[n] & x0[n][o].flag) {
          this._castling[n] ^= x0[n][o].flag;
          break;
        }
    }
    if (this._hash ^= this._castlingKey(), e.flags & me.BIG_PAWN) {
      let o;
      t === mn ? o = e.to - 16 : o = e.to + 16, !(e.to - 1 & 136) && ((a = this._board[e.to - 1]) == null ? void 0 : a.type) === ot && ((i = this._board[e.to - 1]) == null ? void 0 : i.color) === n || !(e.to + 1 & 136) && ((s = this._board[e.to + 1]) == null ? void 0 : s.type) === ot && ((l = this._board[e.to + 1]) == null ? void 0 : l.color) === n ? (this._epSquare = o, this._hash ^= this._epKey()) : this._epSquare = Tt;
    } else
      this._epSquare = Tt;
    e.piece === ot ? this._halfMoves = 0 : e.flags & (me.CAPTURE | me.EP_CAPTURE) ? this._halfMoves = 0 : this._halfMoves++, t === mn && this._moveNumber++, this._turn = n, this._hash ^= Ls;
  }
  undo() {
    const e = this._hash, t = this._undoMove();
    if (t) {
      const n = new Xa(this, t);
      return this._decPositionCount(e), n;
    }
    return null;
  }
  _undoMove() {
    const e = this._history.pop();
    if (e === void 0)
      return null;
    this._hash ^= this._epKey(), this._hash ^= this._castlingKey();
    const t = e.move;
    this._kings = e.kings, this._turn = e.turn, this._castling = e.castling, this._epSquare = e.epSquare, this._halfMoves = e.halfMoves, this._moveNumber = e.moveNumber, this._hash ^= this._epKey(), this._hash ^= this._castlingKey(), this._hash ^= Ls;
    const n = this._turn, a = Ur(n);
    if (this._movePiece(t.to, t.from), t.piece && (this._clear(t.from), this._set(t.from, { type: t.piece, color: n })), t.captured)
      if (t.flags & me.EP_CAPTURE) {
        let i;
        n === mn ? i = t.to - 16 : i = t.to + 16, this._set(i, { type: ot, color: a });
      } else
        this._set(t.to, { type: t.captured, color: a });
    if (t.flags & (me.KSIDE_CASTLE | me.QSIDE_CASTLE)) {
      let i, s;
      t.flags & me.KSIDE_CASTLE ? (i = t.to + 1, s = t.to - 1) : (i = t.to - 2, s = t.to + 1), this._movePiece(s, i);
    }
    return t;
  }
  pgn({ newline: e = `
`, maxWidth: t = 0 } = {}) {
    const n = [];
    let a = !1;
    for (const d in this._header)
      this._header[d] && n.push(`[${d} "${this._header[d]}"]` + e), a = !0;
    a && this._history.length && n.push(e);
    const i = (d) => {
      const g = this._comments[this.fen()];
      if (typeof g < "u") {
        const b = d.length > 0 ? " " : "";
        d = `${d}${b}{${g}}`;
      }
      return d;
    }, s = [];
    for (; this._history.length > 0; )
      s.push(this._undoMove());
    const l = [];
    let o = "";
    for (s.length === 0 && l.push(i("")); s.length > 0; ) {
      o = i(o);
      const d = s.pop();
      if (!d)
        break;
      if (!this._history.length && d.color === "b") {
        const g = `${this._moveNumber}. ...`;
        o = o ? `${o} ${g}` : g;
      } else d.color === "w" && (o.length && l.push(o), o = this._moveNumber + ".");
      o = o + " " + this._moveToSan(d, this._moves({ legal: !0 })), this._makeMove(d);
    }
    if (o.length && l.push(i(o)), l.push(this._header.Result || "*"), t === 0)
      return n.join("") + l.join(" ");
    const u = function() {
      return n.length > 0 && n[n.length - 1] === " " ? (n.pop(), !0) : !1;
    }, h = function(d, g) {
      for (const b of g.split(" "))
        if (b) {
          if (d + b.length > t) {
            for (; u(); )
              d--;
            n.push(e), d = 0;
          }
          n.push(b), d += b.length, n.push(" "), d++;
        }
      return u() && d--, d;
    };
    let m = 0;
    for (let d = 0; d < l.length; d++) {
      if (m + l[d].length > t && l[d].includes("{")) {
        m = h(m, l[d]);
        continue;
      }
      m + l[d].length > t && d !== 0 ? (n[n.length - 1] === " " && n.pop(), n.push(e), m = 0) : d !== 0 && (n.push(" "), m++), n.push(l[d]), m += l[d].length;
    }
    return n.join("");
  }
  /**
   * @deprecated Use `setHeader` and `getHeaders` instead. This method will return null header tags (which is not what you want)
   */
  header(...e) {
    for (let t = 0; t < e.length; t += 2)
      typeof e[t] == "string" && typeof e[t + 1] == "string" && (this._header[e[t]] = e[t + 1]);
    return this._header;
  }
  // TODO: value validation per spec
  setHeader(e, t) {
    return this._header[e] = t ?? bl[e] ?? null, this.getHeaders();
  }
  removeHeader(e) {
    return e in this._header ? (this._header[e] = bl[e] || null, !0) : !1;
  }
  // return only non-null headers (omit placemarker nulls)
  getHeaders() {
    const e = {};
    for (const [t, n] of Object.entries(this._header))
      n !== null && (e[t] = n);
    return e;
  }
  loadPgn(e, { strict: t = !1, newlineChar: n = `\r?
` } = {}) {
    n !== `\r?
` && (e = e.replace(new RegExp(n, "g"), `
`));
    const a = t3.parse(e);
    this.reset();
    const i = a.headers;
    let s = "";
    for (const u in i)
      u.toLowerCase() === "fen" && (s = i[u]), this.header(u, i[u]);
    if (!t)
      s && this.load(s, { preserveHeaders: !0 });
    else if (i.SetUp === "1") {
      if (!("FEN" in i))
        throw new Error("Invalid PGN: FEN tag must be supplied with SetUp tag");
      this.load(i.FEN, { preserveHeaders: !0 });
    }
    let l = a.root;
    for (; l; ) {
      if (l.move) {
        const u = this._moveFromSan(l.move, t);
        if (u == null)
          throw new Error(`Invalid move in PGN: ${l.move}`);
        this._makeMove(u), this._incPositionCount();
      }
      l.comment !== void 0 && (this._comments[this.fen()] = l.comment), l = l.variations[0];
    }
    const o = a.result;
    o && Object.keys(this._header).length && this._header.Result !== o && this.setHeader("Result", o);
  }
  /*
   * Convert a move from 0x88 coordinates to Standard Algebraic Notation
   * (SAN)
   *
   * @param {boolean} strict Use the strict SAN parser. It will throw errors
   * on overly disambiguated moves (see below):
   *
   * r1bqkbnr/ppp2ppp/2n5/1B1pP3/4P3/8/PPPP2PP/RNBQK1NR b KQkq - 2 4
   * 4. ... Nge7 is overly disambiguated because the knight on c6 is pinned
   * 4. ... Ne7 is technically the valid SAN
   */
  _moveToSan(e, t) {
    let n = "";
    if (e.flags & me.KSIDE_CASTLE)
      n = "O-O";
    else if (e.flags & me.QSIDE_CASTLE)
      n = "O-O-O";
    else {
      if (e.piece !== ot) {
        const a = v3(e, t);
        n += e.piece.toUpperCase() + a;
      }
      e.flags & (me.CAPTURE | me.EP_CAPTURE) && (e.piece === ot && (n += St(e.from)[0]), n += "x"), n += St(e.to), e.promotion && (n += "=" + e.promotion.toUpperCase());
    }
    return this._makeMove(e), this.isCheck() && (this.isCheckmate() ? n += "#" : n += "+"), this._undoMove(), n;
  }
  // convert a move from Standard Algebraic Notation (SAN) to 0x88 coordinates
  _moveFromSan(e, t = !1) {
    let n = Os(e);
    t || (n === "0-0" ? n = "O-O" : n === "0-0-0" && (n = "O-O-O"));
    let a = l1(n), i = this._moves({ legal: !0, piece: a });
    for (let d = 0, g = i.length; d < g; d++)
      if (n === Os(this._moveToSan(i[d], i)))
        return i[d];
    if (t)
      return null;
    let s, l, o, u, h, m = !1;
    if (l = n.match(/([pnbrqkPNBRQK])?([a-h][1-8])x?-?([a-h][1-8])([qrbnQRBN])?/), l ? (s = l[1], o = l[2], u = l[3], h = l[4], o.length == 1 && (m = !0)) : (l = n.match(/([pnbrqkPNBRQK])?([a-h]?[1-8]?)x?-?([a-h][1-8])([qrbnQRBN])?/), l && (s = l[1], o = l[2], u = l[3], h = l[4], o.length == 1 && (m = !0))), a = l1(n), i = this._moves({
      legal: !0,
      piece: s || a
    }), !u)
      return null;
    for (let d = 0, g = i.length; d < g; d++)
      if (o) {
        if ((!s || s.toLowerCase() == i[d].piece) && he[o] == i[d].from && he[u] == i[d].to && (!h || h.toLowerCase() == i[d].promotion))
          return i[d];
        if (m) {
          const b = St(i[d].from);
          if ((!s || s.toLowerCase() == i[d].piece) && he[u] == i[d].to && (o == b[0] || o == b[1]) && (!h || h.toLowerCase() == i[d].promotion))
            return i[d];
        }
      } else if (n === Os(this._moveToSan(i[d], i)).replace("x", ""))
        return i[d];
    return null;
  }
  ascii() {
    let e = `   +------------------------+
`;
    for (let t = he.a8; t <= he.h1; t++) {
      if (sa(t) === 0 && (e += " " + "87654321"[X0(t)] + " |"), this._board[t]) {
        const n = this._board[t].type, i = this._board[t].color === Mt ? n.toUpperCase() : n.toLowerCase();
        e += " " + i + " ";
      } else
        e += " . ";
      t + 1 & 136 && (e += `|
`, t += 8);
    }
    return e += `   +------------------------+
`, e += "     a  b  c  d  e  f  g  h", e;
  }
  perft(e) {
    const t = this._moves({ legal: !1 });
    let n = 0;
    const a = this._turn;
    for (let i = 0, s = t.length; i < s; i++)
      this._makeMove(t[i]), this._isKingAttacked(a) || (e - 1 > 0 ? n += this.perft(e - 1) : n++), this._undoMove();
    return n;
  }
  turn() {
    return this._turn;
  }
  board() {
    const e = [];
    let t = [];
    for (let n = he.a8; n <= he.h1; n++)
      this._board[n] == null ? t.push(null) : t.push({
        square: St(n),
        type: this._board[n].type,
        color: this._board[n].color
      }), n + 1 & 136 && (e.push(t), t = [], n += 8);
    return e;
  }
  squareColor(e) {
    if (e in he) {
      const t = he[e];
      return (X0(t) + sa(t)) % 2 === 0 ? "light" : "dark";
    }
    return null;
  }
  history({ verbose: e = !1 } = {}) {
    const t = [], n = [];
    for (; this._history.length > 0; )
      t.push(this._undoMove());
    for (; ; ) {
      const a = t.pop();
      if (!a)
        break;
      e ? n.push(new Xa(this, a)) : n.push(this._moveToSan(a, this._moves())), this._makeMove(a);
    }
    return n;
  }
  /*
   * Keeps track of position occurrence counts for the purpose of repetition
   * checking. Old positions are removed from the map if their counts are reduced to 0.
   */
  _getPositionCount(e) {
    return this._positionCount.get(e) ?? 0;
  }
  _incPositionCount() {
    this._positionCount.set(this._hash, (this._positionCount.get(this._hash) ?? 0) + 1);
  }
  _decPositionCount(e) {
    const t = this._positionCount.get(e) ?? 0;
    t === 1 ? this._positionCount.delete(e) : this._positionCount.set(e, t - 1);
  }
  _pruneComments() {
    const e = [], t = {}, n = (a) => {
      a in this._comments && (t[a] = this._comments[a]);
    };
    for (; this._history.length > 0; )
      e.push(this._undoMove());
    for (n(this.fen()); ; ) {
      const a = e.pop();
      if (!a)
        break;
      this._makeMove(a), n(this.fen());
    }
    this._comments = t;
  }
  getComment() {
    return this._comments[this.fen()];
  }
  setComment(e) {
    this._comments[this.fen()] = e.replace("{", "[").replace("}", "]");
  }
  /**
   * @deprecated Renamed to `removeComment` for consistency
   */
  deleteComment() {
    return this.removeComment();
  }
  removeComment() {
    const e = this._comments[this.fen()];
    return delete this._comments[this.fen()], e;
  }
  getComments() {
    return this._pruneComments(), Object.keys(this._comments).map((e) => ({ fen: e, comment: this._comments[e] }));
  }
  /**
   * @deprecated Renamed to `removeComments` for consistency
   */
  deleteComments() {
    return this.removeComments();
  }
  removeComments() {
    return this._pruneComments(), Object.keys(this._comments).map((e) => {
      const t = this._comments[e];
      return delete this._comments[e], { fen: e, comment: t };
    });
  }
  setCastlingRights(e, t) {
    for (const a of [gt, F0])
      t[a] !== void 0 && (t[a] ? this._castling[e] |= Za[a] : this._castling[e] &= ~Za[a]);
    this._updateCastlingRights();
    const n = this.getCastlingRights(e);
    return (t[gt] === void 0 || t[gt] === n[gt]) && (t[F0] === void 0 || t[F0] === n[F0]);
  }
  getCastlingRights(e) {
    return {
      [gt]: (this._castling[e] & Za[gt]) !== 0,
      [F0]: (this._castling[e] & Za[F0]) !== 0
    };
  }
  moveNumber() {
    return this._moveNumber;
  }
}
const {
  SvelteComponent: b3,
  append_hydration: Ja,
  attr: gr,
  children: o1,
  claim_element: Ps,
  claim_space: y3,
  claim_text: w3,
  detach: Hs,
  element: Us,
  init: k3,
  insert_hydration: S3,
  listen: Gs,
  noop: u1,
  run_all: D3,
  safe_not_equal: x3,
  set_data: A3,
  space: E3,
  text: C3,
  toggle_class: c1
} = window.__gradio__svelte__internal, { createEventDispatcher: $3 } = window.__gradio__svelte__internal;
function T3(r) {
  let e, t, n, a, i, s, l;
  return {
    c() {
      e = Us("label"), t = Us("input"), n = E3(), a = Us("span"), i = C3(
        /*label*/
        r[1]
      ), this.h();
    },
    l(o) {
      e = Ps(o, "LABEL", { class: !0 });
      var u = o1(e);
      t = Ps(u, "INPUT", {
        type: !0,
        name: !0,
        "data-testid": !0,
        class: !0
      }), n = y3(u), a = Ps(u, "SPAN", { class: !0 });
      var h = o1(a);
      i = w3(
        h,
        /*label*/
        r[1]
      ), h.forEach(Hs), u.forEach(Hs), this.h();
    },
    h() {
      t.disabled = /*disabled*/
      r[2], gr(t, "type", "checkbox"), gr(t, "name", "test"), gr(t, "data-testid", "checkbox"), gr(t, "class", "svelte-6uhi3z"), gr(a, "class", "svelte-6uhi3z"), gr(e, "class", "svelte-6uhi3z"), c1(
        e,
        "disabled",
        /*disabled*/
        r[2]
      );
    },
    m(o, u) {
      S3(o, e, u), Ja(e, t), t.checked = /*value*/
      r[0], Ja(e, n), Ja(e, a), Ja(a, i), s || (l = [
        Gs(
          t,
          "change",
          /*input_change_handler*/
          r[6]
        ),
        Gs(
          t,
          "keydown",
          /*handle_enter*/
          r[3]
        ),
        Gs(
          t,
          "input",
          /*handle_input*/
          r[4]
        )
      ], s = !0);
    },
    p(o, [u]) {
      u & /*disabled*/
      4 && (t.disabled = /*disabled*/
      o[2]), u & /*value*/
      1 && (t.checked = /*value*/
      o[0]), u & /*label*/
      2 && A3(
        i,
        /*label*/
        o[1]
      ), u & /*disabled*/
      4 && c1(
        e,
        "disabled",
        /*disabled*/
        o[2]
      );
    },
    i: u1,
    o: u1,
    d(o) {
      o && Hs(e), s = !1, D3(l);
    }
  };
}
function F3(r, e, t) {
  let n, { value: a = !1 } = e, { label: i = "Checkbox" } = e, { interactive: s } = e;
  const l = $3();
  async function o(m) {
    m.key === "Enter" && (t(0, a = !a), l("select", {
      index: 0,
      value: m.currentTarget.checked,
      selected: m.currentTarget.checked
    }));
  }
  async function u(m) {
    t(0, a = m.currentTarget.checked), l("select", {
      index: 0,
      value: m.currentTarget.checked,
      selected: m.currentTarget.checked
    });
  }
  function h() {
    a = this.checked, t(0, a);
  }
  return r.$$set = (m) => {
    "value" in m && t(0, a = m.value), "label" in m && t(1, i = m.label), "interactive" in m && t(5, s = m.interactive);
  }, r.$$.update = () => {
    r.$$.dirty & /*value*/
    1 && l("change", a), r.$$.dirty & /*interactive*/
    32 && t(2, n = !s);
  }, [
    a,
    i,
    n,
    o,
    u,
    s,
    h
  ];
}
class Ci extends b3 {
  constructor(e) {
    super(), k3(this, e, F3, T3, x3, { value: 0, label: 1, interactive: 5 });
  }
}
const {
  SvelteComponent: nz,
  add_flush_callback: rz,
  assign: az,
  bind: iz,
  binding_callbacks: sz,
  check_outros: lz,
  claim_component: oz,
  claim_space: uz,
  create_component: cz,
  destroy_component: hz,
  detach: fz,
  get_spread_object: dz,
  get_spread_update: mz,
  group_outros: pz,
  init: gz,
  insert_hydration: _z,
  mount_component: vz,
  safe_not_equal: bz,
  space: yz,
  transition_in: wz,
  transition_out: kz
} = window.__gradio__svelte__internal, { afterUpdate: Sz } = window.__gradio__svelte__internal, {
  SvelteComponent: M3,
  action_destroyer: z3,
  add_render_callback: B3,
  append_hydration: Gr,
  attr: ue,
  binding_callbacks: ei,
  bubble: E0,
  check_outros: kr,
  children: J0,
  claim_component: ga,
  claim_element: Zn,
  claim_space: ti,
  claim_text: Zl,
  create_component: _a,
  create_in_transition: N3,
  destroy_component: va,
  detach: st,
  element: Qn,
  empty: $i,
  group_outros: Sr,
  init: q3,
  insert_hydration: Xt,
  is_function: L3,
  listen: Ue,
  mount_component: ba,
  noop: L0,
  run_all: Oi,
  safe_not_equal: I3,
  set_data: Ql,
  set_input_value: I0,
  space: ni,
  text: Jl,
  toggle_class: d0,
  transition_in: ut,
  transition_out: At
} = window.__gradio__svelte__internal, { beforeUpdate: R3, afterUpdate: O3, createEventDispatcher: P3, tick: h1 } = window.__gradio__svelte__internal;
function f1(r) {
  let e, t, n, a;
  const i = [U3, H3], s = [];
  function l(o, u) {
    return (
      /*copied*/
      o[19] ? 0 : 1
    );
  }
  return e = l(r), t = s[e] = i[e](r), {
    c() {
      t.c(), n = $i();
    },
    l(o) {
      t.l(o), n = $i();
    },
    m(o, u) {
      s[e].m(o, u), Xt(o, n, u), a = !0;
    },
    p(o, u) {
      let h = e;
      e = l(o), e === h ? s[e].p(o, u) : (Sr(), At(s[h], 1, 1, () => {
        s[h] = null;
      }), kr(), t = s[e], t ? t.p(o, u) : (t = s[e] = i[e](o), t.c()), ut(t, 1), t.m(n.parentNode, n));
    },
    i(o) {
      a || (ut(t), a = !0);
    },
    o(o) {
      At(t), a = !1;
    },
    d(o) {
      o && st(n), s[e].d(o);
    }
  };
}
function H3(r) {
  let e, t, n, a, i;
  return t = new $p({}), {
    c() {
      e = Qn("button"), _a(t.$$.fragment), this.h();
    },
    l(s) {
      e = Zn(s, "BUTTON", {
        class: !0,
        "aria-label": !0,
        "aria-roledescription": !0
      });
      var l = J0(e);
      ga(t.$$.fragment, l), l.forEach(st), this.h();
    },
    h() {
      ue(e, "class", "copy-button svelte-bj4kw9"), ue(e, "aria-label", "Copy"), ue(e, "aria-roledescription", "Copy text");
    },
    m(s, l) {
      Xt(s, e, l), ba(t, e, null), n = !0, a || (i = Ue(
        e,
        "click",
        /*handle_copy*/
        r[21]
      ), a = !0);
    },
    p: L0,
    i(s) {
      n || (ut(t.$$.fragment, s), n = !0);
    },
    o(s) {
      At(t.$$.fragment, s), n = !1;
    },
    d(s) {
      s && st(e), va(t), a = !1, i();
    }
  };
}
function U3(r) {
  let e, t, n, a;
  return t = new _p({}), {
    c() {
      e = Qn("button"), _a(t.$$.fragment), this.h();
    },
    l(i) {
      e = Zn(i, "BUTTON", {
        class: !0,
        "aria-label": !0,
        "aria-roledescription": !0
      });
      var s = J0(e);
      ga(t.$$.fragment, s), s.forEach(st), this.h();
    },
    h() {
      ue(e, "class", "copy-button svelte-bj4kw9"), ue(e, "aria-label", "Copied"), ue(e, "aria-roledescription", "Text copied");
    },
    m(i, s) {
      Xt(i, e, s), ba(t, e, null), a = !0;
    },
    p: L0,
    i(i) {
      a || (ut(t.$$.fragment, i), i && (n || B3(() => {
        n = N3(e, Kp, { duration: 300 }), n.start();
      })), a = !0);
    },
    o(i) {
      At(t.$$.fragment, i), a = !1;
    },
    d(i) {
      i && st(e), va(t);
    }
  };
}
function G3(r) {
  let e;
  return {
    c() {
      e = Jl(
        /*label*/
        r[3]
      );
    },
    l(t) {
      e = Zl(
        t,
        /*label*/
        r[3]
      );
    },
    m(t, n) {
      Xt(t, e, n);
    },
    p(t, n) {
      n[0] & /*label*/
      8 && Ql(
        e,
        /*label*/
        t[3]
      );
    },
    d(t) {
      t && st(e);
    }
  };
}
function j3(r) {
  let e, t, n, a, i, s;
  return {
    c() {
      e = Qn("textarea"), this.h();
    },
    l(l) {
      e = Zn(l, "TEXTAREA", {
        "data-testid": !0,
        class: !0,
        dir: !0,
        placeholder: !0,
        rows: !0,
        maxlength: !0,
        style: !0
      }), J0(e).forEach(st), this.h();
    },
    h() {
      ue(e, "data-testid", "textbox"), ue(e, "class", "scroll-hide svelte-bj4kw9"), ue(e, "dir", t = /*rtl*/
      r[12] ? "rtl" : "ltr"), ue(
        e,
        "placeholder",
        /*placeholder*/
        r[2]
      ), ue(
        e,
        "rows",
        /*lines*/
        r[1]
      ), e.disabled = /*disabled*/
      r[5], e.autofocus = /*autofocus*/
      r[13], ue(
        e,
        "maxlength",
        /*max_length*/
        r[15]
      ), ue(e, "style", n = /*text_align*/
      r[14] ? "text-align: " + /*text_align*/
      r[14] : ""), d0(e, "no-label", !/*show_label*/
      r[6] && /*submit_btn*/
      (r[10] || /*stop_btn*/
      r[11]));
    },
    m(l, o) {
      Xt(l, e, o), I0(
        e,
        /*value*/
        r[0]
      ), r[46](e), /*autofocus*/
      r[13] && e.focus(), i || (s = [
        z3(a = /*text_area_resize*/
        r[27].call(
          null,
          e,
          /*value*/
          r[0]
        )),
        Ue(
          e,
          "input",
          /*textarea_input_handler*/
          r[45]
        ),
        Ue(
          e,
          "keypress",
          /*handle_keypress*/
          r[23]
        ),
        Ue(
          e,
          "blur",
          /*blur_handler_3*/
          r[37]
        ),
        Ue(
          e,
          "select",
          /*handle_select*/
          r[22]
        ),
        Ue(
          e,
          "focus",
          /*focus_handler_3*/
          r[38]
        ),
        Ue(
          e,
          "scroll",
          /*handle_scroll*/
          r[24]
        )
      ], i = !0);
    },
    p(l, o) {
      o[0] & /*rtl*/
      4096 && t !== (t = /*rtl*/
      l[12] ? "rtl" : "ltr") && ue(e, "dir", t), o[0] & /*placeholder*/
      4 && ue(
        e,
        "placeholder",
        /*placeholder*/
        l[2]
      ), o[0] & /*lines*/
      2 && ue(
        e,
        "rows",
        /*lines*/
        l[1]
      ), o[0] & /*disabled*/
      32 && (e.disabled = /*disabled*/
      l[5]), o[0] & /*autofocus*/
      8192 && (e.autofocus = /*autofocus*/
      l[13]), o[0] & /*max_length*/
      32768 && ue(
        e,
        "maxlength",
        /*max_length*/
        l[15]
      ), o[0] & /*text_align*/
      16384 && n !== (n = /*text_align*/
      l[14] ? "text-align: " + /*text_align*/
      l[14] : "") && ue(e, "style", n), a && L3(a.update) && o[0] & /*value*/
      1 && a.update.call(
        null,
        /*value*/
        l[0]
      ), o[0] & /*value*/
      1 && I0(
        e,
        /*value*/
        l[0]
      ), o[0] & /*show_label, submit_btn, stop_btn*/
      3136 && d0(e, "no-label", !/*show_label*/
      l[6] && /*submit_btn*/
      (l[10] || /*stop_btn*/
      l[11]));
    },
    d(l) {
      l && st(e), r[46](null), i = !1, Oi(s);
    }
  };
}
function V3(r) {
  let e;
  function t(i, s) {
    if (
      /*type*/
      i[8] === "text"
    ) return Y3;
    if (
      /*type*/
      i[8] === "password"
    ) return K3;
    if (
      /*type*/
      i[8] === "email"
    ) return W3;
  }
  let n = t(r), a = n && n(r);
  return {
    c() {
      a && a.c(), e = $i();
    },
    l(i) {
      a && a.l(i), e = $i();
    },
    m(i, s) {
      a && a.m(i, s), Xt(i, e, s);
    },
    p(i, s) {
      n === (n = t(i)) && a ? a.p(i, s) : (a && a.d(1), a = n && n(i), a && (a.c(), a.m(e.parentNode, e)));
    },
    d(i) {
      i && st(e), a && a.d(i);
    }
  };
}
function W3(r) {
  let e, t, n;
  return {
    c() {
      e = Qn("input"), this.h();
    },
    l(a) {
      e = Zn(a, "INPUT", {
        "data-testid": !0,
        type: !0,
        class: !0,
        placeholder: !0,
        maxlength: !0,
        autocomplete: !0
      }), this.h();
    },
    h() {
      ue(e, "data-testid", "textbox"), ue(e, "type", "email"), ue(e, "class", "scroll-hide svelte-bj4kw9"), ue(
        e,
        "placeholder",
        /*placeholder*/
        r[2]
      ), e.disabled = /*disabled*/
      r[5], e.autofocus = /*autofocus*/
      r[13], ue(
        e,
        "maxlength",
        /*max_length*/
        r[15]
      ), ue(e, "autocomplete", "email");
    },
    m(a, i) {
      Xt(a, e, i), I0(
        e,
        /*value*/
        r[0]
      ), r[44](e), /*autofocus*/
      r[13] && e.focus(), t || (n = [
        Ue(
          e,
          "input",
          /*input_input_handler_2*/
          r[43]
        ),
        Ue(
          e,
          "keypress",
          /*handle_keypress*/
          r[23]
        ),
        Ue(
          e,
          "blur",
          /*blur_handler_2*/
          r[35]
        ),
        Ue(
          e,
          "select",
          /*handle_select*/
          r[22]
        ),
        Ue(
          e,
          "focus",
          /*focus_handler_2*/
          r[36]
        )
      ], t = !0);
    },
    p(a, i) {
      i[0] & /*placeholder*/
      4 && ue(
        e,
        "placeholder",
        /*placeholder*/
        a[2]
      ), i[0] & /*disabled*/
      32 && (e.disabled = /*disabled*/
      a[5]), i[0] & /*autofocus*/
      8192 && (e.autofocus = /*autofocus*/
      a[13]), i[0] & /*max_length*/
      32768 && ue(
        e,
        "maxlength",
        /*max_length*/
        a[15]
      ), i[0] & /*value*/
      1 && e.value !== /*value*/
      a[0] && I0(
        e,
        /*value*/
        a[0]
      );
    },
    d(a) {
      a && st(e), r[44](null), t = !1, Oi(n);
    }
  };
}
function K3(r) {
  let e, t, n;
  return {
    c() {
      e = Qn("input"), this.h();
    },
    l(a) {
      e = Zn(a, "INPUT", {
        "data-testid": !0,
        type: !0,
        class: !0,
        placeholder: !0,
        maxlength: !0,
        autocomplete: !0
      }), this.h();
    },
    h() {
      ue(e, "data-testid", "password"), ue(e, "type", "password"), ue(e, "class", "scroll-hide svelte-bj4kw9"), ue(
        e,
        "placeholder",
        /*placeholder*/
        r[2]
      ), e.disabled = /*disabled*/
      r[5], e.autofocus = /*autofocus*/
      r[13], ue(
        e,
        "maxlength",
        /*max_length*/
        r[15]
      ), ue(e, "autocomplete", "");
    },
    m(a, i) {
      Xt(a, e, i), I0(
        e,
        /*value*/
        r[0]
      ), r[42](e), /*autofocus*/
      r[13] && e.focus(), t || (n = [
        Ue(
          e,
          "input",
          /*input_input_handler_1*/
          r[41]
        ),
        Ue(
          e,
          "keypress",
          /*handle_keypress*/
          r[23]
        ),
        Ue(
          e,
          "blur",
          /*blur_handler_1*/
          r[33]
        ),
        Ue(
          e,
          "select",
          /*handle_select*/
          r[22]
        ),
        Ue(
          e,
          "focus",
          /*focus_handler_1*/
          r[34]
        )
      ], t = !0);
    },
    p(a, i) {
      i[0] & /*placeholder*/
      4 && ue(
        e,
        "placeholder",
        /*placeholder*/
        a[2]
      ), i[0] & /*disabled*/
      32 && (e.disabled = /*disabled*/
      a[5]), i[0] & /*autofocus*/
      8192 && (e.autofocus = /*autofocus*/
      a[13]), i[0] & /*max_length*/
      32768 && ue(
        e,
        "maxlength",
        /*max_length*/
        a[15]
      ), i[0] & /*value*/
      1 && e.value !== /*value*/
      a[0] && I0(
        e,
        /*value*/
        a[0]
      );
    },
    d(a) {
      a && st(e), r[42](null), t = !1, Oi(n);
    }
  };
}
function Y3(r) {
  let e, t, n, a, i;
  return {
    c() {
      e = Qn("input"), this.h();
    },
    l(s) {
      e = Zn(s, "INPUT", {
        "data-testid": !0,
        type: !0,
        class: !0,
        dir: !0,
        placeholder: !0,
        maxlength: !0,
        style: !0
      }), this.h();
    },
    h() {
      ue(e, "data-testid", "textbox"), ue(e, "type", "text"), ue(e, "class", "scroll-hide svelte-bj4kw9"), ue(e, "dir", t = /*rtl*/
      r[12] ? "rtl" : "ltr"), ue(
        e,
        "placeholder",
        /*placeholder*/
        r[2]
      ), e.disabled = /*disabled*/
      r[5], e.autofocus = /*autofocus*/
      r[13], ue(
        e,
        "maxlength",
        /*max_length*/
        r[15]
      ), ue(e, "style", n = /*text_align*/
      r[14] ? "text-align: " + /*text_align*/
      r[14] : "");
    },
    m(s, l) {
      Xt(s, e, l), I0(
        e,
        /*value*/
        r[0]
      ), r[40](e), /*autofocus*/
      r[13] && e.focus(), a || (i = [
        Ue(
          e,
          "input",
          /*input_input_handler*/
          r[39]
        ),
        Ue(
          e,
          "keypress",
          /*handle_keypress*/
          r[23]
        ),
        Ue(
          e,
          "blur",
          /*blur_handler*/
          r[31]
        ),
        Ue(
          e,
          "select",
          /*handle_select*/
          r[22]
        ),
        Ue(
          e,
          "focus",
          /*focus_handler*/
          r[32]
        )
      ], a = !0);
    },
    p(s, l) {
      l[0] & /*rtl*/
      4096 && t !== (t = /*rtl*/
      s[12] ? "rtl" : "ltr") && ue(e, "dir", t), l[0] & /*placeholder*/
      4 && ue(
        e,
        "placeholder",
        /*placeholder*/
        s[2]
      ), l[0] & /*disabled*/
      32 && (e.disabled = /*disabled*/
      s[5]), l[0] & /*autofocus*/
      8192 && (e.autofocus = /*autofocus*/
      s[13]), l[0] & /*max_length*/
      32768 && ue(
        e,
        "maxlength",
        /*max_length*/
        s[15]
      ), l[0] & /*text_align*/
      16384 && n !== (n = /*text_align*/
      s[14] ? "text-align: " + /*text_align*/
      s[14] : "") && ue(e, "style", n), l[0] & /*value*/
      1 && e.value !== /*value*/
      s[0] && I0(
        e,
        /*value*/
        s[0]
      );
    },
    d(s) {
      s && st(e), r[40](null), a = !1, Oi(i);
    }
  };
}
function d1(r) {
  let e, t, n, a, i, s;
  const l = [Z3, X3], o = [];
  function u(h, m) {
    return (
      /*submit_btn*/
      h[10] === !0 ? 0 : 1
    );
  }
  return t = u(r), n = o[t] = l[t](r), {
    c() {
      e = Qn("button"), n.c(), this.h();
    },
    l(h) {
      e = Zn(h, "BUTTON", { class: !0 });
      var m = J0(e);
      n.l(m), m.forEach(st), this.h();
    },
    h() {
      ue(e, "class", "submit-button svelte-bj4kw9"), d0(
        e,
        "padded-button",
        /*submit_btn*/
        r[10] !== !0
      );
    },
    m(h, m) {
      Xt(h, e, m), o[t].m(e, null), a = !0, i || (s = Ue(
        e,
        "click",
        /*handle_submit*/
        r[26]
      ), i = !0);
    },
    p(h, m) {
      let d = t;
      t = u(h), t === d ? o[t].p(h, m) : (Sr(), At(o[d], 1, 1, () => {
        o[d] = null;
      }), kr(), n = o[t], n ? n.p(h, m) : (n = o[t] = l[t](h), n.c()), ut(n, 1), n.m(e, null)), (!a || m[0] & /*submit_btn*/
      1024) && d0(
        e,
        "padded-button",
        /*submit_btn*/
        h[10] !== !0
      );
    },
    i(h) {
      a || (ut(n), a = !0);
    },
    o(h) {
      At(n), a = !1;
    },
    d(h) {
      h && st(e), o[t].d(), i = !1, s();
    }
  };
}
function X3(r) {
  let e;
  return {
    c() {
      e = Jl(
        /*submit_btn*/
        r[10]
      );
    },
    l(t) {
      e = Zl(
        t,
        /*submit_btn*/
        r[10]
      );
    },
    m(t, n) {
      Xt(t, e, n);
    },
    p(t, n) {
      n[0] & /*submit_btn*/
      1024 && Ql(
        e,
        /*submit_btn*/
        t[10]
      );
    },
    i: L0,
    o: L0,
    d(t) {
      t && st(e);
    }
  };
}
function Z3(r) {
  let e, t;
  return e = new Np({}), {
    c() {
      _a(e.$$.fragment);
    },
    l(n) {
      ga(e.$$.fragment, n);
    },
    m(n, a) {
      ba(e, n, a), t = !0;
    },
    p: L0,
    i(n) {
      t || (ut(e.$$.fragment, n), t = !0);
    },
    o(n) {
      At(e.$$.fragment, n), t = !1;
    },
    d(n) {
      va(e, n);
    }
  };
}
function m1(r) {
  let e, t, n, a, i, s;
  const l = [J3, Q3], o = [];
  function u(h, m) {
    return (
      /*stop_btn*/
      h[11] === !0 ? 0 : 1
    );
  }
  return t = u(r), n = o[t] = l[t](r), {
    c() {
      e = Qn("button"), n.c(), this.h();
    },
    l(h) {
      e = Zn(h, "BUTTON", { class: !0 });
      var m = J0(e);
      n.l(m), m.forEach(st), this.h();
    },
    h() {
      ue(e, "class", "stop-button svelte-bj4kw9"), d0(
        e,
        "padded-button",
        /*stop_btn*/
        r[11] !== !0
      );
    },
    m(h, m) {
      Xt(h, e, m), o[t].m(e, null), a = !0, i || (s = Ue(
        e,
        "click",
        /*handle_stop*/
        r[25]
      ), i = !0);
    },
    p(h, m) {
      let d = t;
      t = u(h), t === d ? o[t].p(h, m) : (Sr(), At(o[d], 1, 1, () => {
        o[d] = null;
      }), kr(), n = o[t], n ? n.p(h, m) : (n = o[t] = l[t](h), n.c()), ut(n, 1), n.m(e, null)), (!a || m[0] & /*stop_btn*/
      2048) && d0(
        e,
        "padded-button",
        /*stop_btn*/
        h[11] !== !0
      );
    },
    i(h) {
      a || (ut(n), a = !0);
    },
    o(h) {
      At(n), a = !1;
    },
    d(h) {
      h && st(e), o[t].d(), i = !1, s();
    }
  };
}
function Q3(r) {
  let e;
  return {
    c() {
      e = Jl(
        /*stop_btn*/
        r[11]
      );
    },
    l(t) {
      e = Zl(
        t,
        /*stop_btn*/
        r[11]
      );
    },
    m(t, n) {
      Xt(t, e, n);
    },
    p(t, n) {
      n[0] & /*stop_btn*/
      2048 && Ql(
        e,
        /*stop_btn*/
        t[11]
      );
    },
    i: L0,
    o: L0,
    d(t) {
      t && st(e);
    }
  };
}
function J3(r) {
  let e, t;
  return e = new Up({
    props: { fill: "none", stroke_width: 2.5 }
  }), {
    c() {
      _a(e.$$.fragment);
    },
    l(n) {
      ga(e.$$.fragment, n);
    },
    m(n, a) {
      ba(e, n, a), t = !0;
    },
    p: L0,
    i(n) {
      t || (ut(e.$$.fragment, n), t = !0);
    },
    o(n) {
      At(e.$$.fragment, n), t = !1;
    },
    d(n) {
      va(e, n);
    }
  };
}
function e6(r) {
  let e, t, n, a, i, s, l, o, u = (
    /*show_label*/
    r[6] && /*show_copy_button*/
    r[9] && f1(r)
  );
  n = new _h({
    props: {
      root: (
        /*root*/
        r[16]
      ),
      show_label: (
        /*show_label*/
        r[6]
      ),
      info: (
        /*info*/
        r[4]
      ),
      $$slots: { default: [G3] },
      $$scope: { ctx: r }
    }
  });
  function h(v, w) {
    return (
      /*lines*/
      v[1] === 1 && /*_max_lines*/
      v[18] === 1 ? V3 : j3
    );
  }
  let m = h(r), d = m(r), g = (
    /*submit_btn*/
    r[10] && d1(r)
  ), b = (
    /*stop_btn*/
    r[11] && m1(r)
  );
  return {
    c() {
      e = Qn("label"), u && u.c(), t = ni(), _a(n.$$.fragment), a = ni(), i = Qn("div"), d.c(), s = ni(), g && g.c(), l = ni(), b && b.c(), this.h();
    },
    l(v) {
      e = Zn(v, "LABEL", { class: !0 });
      var w = J0(e);
      u && u.l(w), t = ti(w), ga(n.$$.fragment, w), a = ti(w), i = Zn(w, "DIV", { class: !0 });
      var x = J0(i);
      d.l(x), s = ti(x), g && g.l(x), l = ti(x), b && b.l(x), x.forEach(st), w.forEach(st), this.h();
    },
    h() {
      ue(i, "class", "input-container svelte-bj4kw9"), ue(e, "class", "svelte-bj4kw9"), d0(
        e,
        "container",
        /*container*/
        r[7]
      ), d0(
        e,
        "show_textbox_border",
        /*show_textbox_border*/
        r[20]
      );
    },
    m(v, w) {
      Xt(v, e, w), u && u.m(e, null), Gr(e, t), ba(n, e, null), Gr(e, a), Gr(e, i), d.m(i, null), Gr(i, s), g && g.m(i, null), Gr(i, l), b && b.m(i, null), o = !0;
    },
    p(v, w) {
      /*show_label*/
      v[6] && /*show_copy_button*/
      v[9] ? u ? (u.p(v, w), w[0] & /*show_label, show_copy_button*/
      576 && ut(u, 1)) : (u = f1(v), u.c(), ut(u, 1), u.m(e, t)) : u && (Sr(), At(u, 1, 1, () => {
        u = null;
      }), kr());
      const x = {};
      w[0] & /*root*/
      65536 && (x.root = /*root*/
      v[16]), w[0] & /*show_label*/
      64 && (x.show_label = /*show_label*/
      v[6]), w[0] & /*info*/
      16 && (x.info = /*info*/
      v[4]), w[0] & /*label*/
      8 | w[1] & /*$$scope*/
      33554432 && (x.$$scope = { dirty: w, ctx: v }), n.$set(x), m === (m = h(v)) && d ? d.p(v, w) : (d.d(1), d = m(v), d && (d.c(), d.m(i, s))), /*submit_btn*/
      v[10] ? g ? (g.p(v, w), w[0] & /*submit_btn*/
      1024 && ut(g, 1)) : (g = d1(v), g.c(), ut(g, 1), g.m(i, l)) : g && (Sr(), At(g, 1, 1, () => {
        g = null;
      }), kr()), /*stop_btn*/
      v[11] ? b ? (b.p(v, w), w[0] & /*stop_btn*/
      2048 && ut(b, 1)) : (b = m1(v), b.c(), ut(b, 1), b.m(i, null)) : b && (Sr(), At(b, 1, 1, () => {
        b = null;
      }), kr()), (!o || w[0] & /*container*/
      128) && d0(
        e,
        "container",
        /*container*/
        v[7]
      );
    },
    i(v) {
      o || (ut(u), ut(n.$$.fragment, v), ut(g), ut(b), o = !0);
    },
    o(v) {
      At(u), At(n.$$.fragment, v), At(g), At(b), o = !1;
    },
    d(v) {
      v && st(e), u && u.d(), va(n), d.d(), g && g.d(), b && b.d();
    }
  };
}
function t6(r, e, t) {
  let { value: n = "" } = e, { value_is_output: a = !1 } = e, { lines: i = 1 } = e, { placeholder: s = "Type here..." } = e, { label: l } = e, { info: o = void 0 } = e, { disabled: u = !1 } = e, { show_label: h = !0 } = e, { container: m = !0 } = e, { max_lines: d = void 0 } = e, { type: g = "text" } = e, { show_copy_button: b = !1 } = e, { submit_btn: v = null } = e, { stop_btn: w = null } = e, { rtl: x = !1 } = e, { autofocus: k = !1 } = e, { text_align: y = void 0 } = e, { autoscroll: A = !0 } = e, { max_length: $ = void 0 } = e, { root: M } = e, z, O = !1, L, K, X = 0, J = !1, Se;
  const _e = !v, ge = P3();
  R3(() => {
    !J && z && z.offsetHeight + z.scrollTop > z.scrollHeight - 100 && (K = !0);
  });
  const Ae = () => {
    K && A && !J && z.scrollTo(0, z.scrollHeight);
  };
  function Oe() {
    ge("change", n), a || ge("input");
  }
  O3(() => {
    k && z.focus(), K && A && Ae(), t(28, a = !1);
  });
  async function ke() {
    "clipboard" in navigator && (await navigator.clipboard.writeText(n), ge("copy", { value: n }), Be());
  }
  function Be() {
    t(19, O = !0), L && clearTimeout(L), L = setTimeout(
      () => {
        t(19, O = !1);
      },
      1e3
    );
  }
  function Ee(G) {
    const He = G.target, bt = He.value, Et = [He.selectionStart, He.selectionEnd];
    ge("select", { value: bt.substring(...Et), index: Et });
  }
  async function I(G) {
    await h1(), (G.key === "Enter" && G.shiftKey && i > 1 || G.key === "Enter" && !G.shiftKey && i === 1 && Se >= 1) && (G.preventDefault(), ge("submit"));
  }
  function be(G) {
    const He = G.target, bt = He.scrollTop;
    bt < X && (J = !0), X = bt;
    const Et = He.scrollHeight - He.clientHeight;
    bt >= Et && (J = !1);
  }
  function ye() {
    ge("stop");
  }
  function Ie() {
    ge("submit");
  }
  async function H(G) {
    if (await h1(), i === Se) return;
    const He = G.target, bt = window.getComputedStyle(He), Et = parseFloat(bt.paddingTop), n0 = parseFloat(bt.paddingBottom), O0 = parseFloat(bt.lineHeight);
    let v0 = Se === void 0 ? !1 : Et + n0 + O0 * Se, b0 = Et + n0 + i * O0;
    He.style.height = "1px";
    let r0;
    v0 && He.scrollHeight > v0 ? r0 = v0 : He.scrollHeight < b0 ? r0 = b0 : r0 = He.scrollHeight, He.style.height = `${r0}px`;
  }
  function nt(G, He) {
    if (i !== Se && (G.style.overflowY = "scroll", G.addEventListener("input", H), !!He.trim()))
      return H({ target: G }), {
        destroy: () => G.removeEventListener("input", H)
      };
  }
  function Pe(G) {
    E0.call(this, r, G);
  }
  function mt(G) {
    E0.call(this, r, G);
  }
  function vt(G) {
    E0.call(this, r, G);
  }
  function xt(G) {
    E0.call(this, r, G);
  }
  function Nt(G) {
    E0.call(this, r, G);
  }
  function Q(G) {
    E0.call(this, r, G);
  }
  function je(G) {
    E0.call(this, r, G);
  }
  function Fe(G) {
    E0.call(this, r, G);
  }
  function Zt() {
    n = this.value, t(0, n);
  }
  function Ln(G) {
    ei[G ? "unshift" : "push"](() => {
      z = G, t(17, z);
    });
  }
  function Gt() {
    n = this.value, t(0, n);
  }
  function jt(G) {
    ei[G ? "unshift" : "push"](() => {
      z = G, t(17, z);
    });
  }
  function Qt() {
    n = this.value, t(0, n);
  }
  function rr(G) {
    ei[G ? "unshift" : "push"](() => {
      z = G, t(17, z);
    });
  }
  function ar() {
    n = this.value, t(0, n);
  }
  function Er(G) {
    ei[G ? "unshift" : "push"](() => {
      z = G, t(17, z);
    });
  }
  return r.$$set = (G) => {
    "value" in G && t(0, n = G.value), "value_is_output" in G && t(28, a = G.value_is_output), "lines" in G && t(1, i = G.lines), "placeholder" in G && t(2, s = G.placeholder), "label" in G && t(3, l = G.label), "info" in G && t(4, o = G.info), "disabled" in G && t(5, u = G.disabled), "show_label" in G && t(6, h = G.show_label), "container" in G && t(7, m = G.container), "max_lines" in G && t(29, d = G.max_lines), "type" in G && t(8, g = G.type), "show_copy_button" in G && t(9, b = G.show_copy_button), "submit_btn" in G && t(10, v = G.submit_btn), "stop_btn" in G && t(11, w = G.stop_btn), "rtl" in G && t(12, x = G.rtl), "autofocus" in G && t(13, k = G.autofocus), "text_align" in G && t(14, y = G.text_align), "autoscroll" in G && t(30, A = G.autoscroll), "max_length" in G && t(15, $ = G.max_length), "root" in G && t(16, M = G.root);
  }, r.$$.update = () => {
    r.$$.dirty[0] & /*max_lines, type, lines*/
    536871170 && (d === void 0 ? g === "text" ? t(18, Se = Math.max(i, 20)) : t(18, Se = 1) : t(18, Se = Math.max(d, i))), r.$$.dirty[0] & /*value*/
    1 && n === null && t(0, n = ""), r.$$.dirty[0] & /*value, el, lines, _max_lines*/
    393219 && z && i !== Se && H({ target: z }), r.$$.dirty[0] & /*value*/
    1 && Oe();
  }, [
    n,
    i,
    s,
    l,
    o,
    u,
    h,
    m,
    g,
    b,
    v,
    w,
    x,
    k,
    y,
    $,
    M,
    z,
    Se,
    O,
    _e,
    ke,
    Ee,
    I,
    be,
    ye,
    Ie,
    nt,
    a,
    d,
    A,
    Pe,
    mt,
    vt,
    xt,
    Nt,
    Q,
    je,
    Fe,
    Zt,
    Ln,
    Gt,
    jt,
    Qt,
    rr,
    ar,
    Er
  ];
}
class n6 extends M3 {
  constructor(e) {
    super(), q3(
      this,
      e,
      t6,
      e6,
      I3,
      {
        value: 0,
        value_is_output: 28,
        lines: 1,
        placeholder: 2,
        label: 3,
        info: 4,
        disabled: 5,
        show_label: 6,
        container: 7,
        max_lines: 29,
        type: 8,
        show_copy_button: 9,
        submit_btn: 10,
        stop_btn: 11,
        rtl: 12,
        autofocus: 13,
        text_align: 14,
        autoscroll: 30,
        max_length: 15,
        root: 16
      },
      null,
      [-1, -1]
    );
  }
}
const {
  SvelteComponent: Dz,
  add_iframe_resize_listener: xz,
  add_render_callback: Az,
  append_hydration: Ez,
  attr: Cz,
  binding_callbacks: $z,
  children: Tz,
  claim_element: Fz,
  claim_text: Mz,
  detach: zz,
  element: Bz,
  init: Nz,
  insert_hydration: qz,
  noop: Lz,
  safe_not_equal: Iz,
  set_data: Rz,
  text: Oz,
  toggle_class: Pz
} = window.__gradio__svelte__internal, { onMount: Hz } = window.__gradio__svelte__internal, {
  SvelteComponent: Uz,
  add_flush_callback: Gz,
  assign: jz,
  bind: Vz,
  binding_callbacks: Wz,
  check_outros: Kz,
  claim_component: Yz,
  claim_space: Xz,
  create_component: Zz,
  destroy_component: Qz,
  detach: Jz,
  flush: eB,
  get_spread_object: tB,
  get_spread_update: nB,
  group_outros: rB,
  init: aB,
  insert_hydration: iB,
  mount_component: sB,
  safe_not_equal: lB,
  space: oB,
  transition_in: uB,
  transition_out: cB
} = window.__gradio__svelte__internal;
new Intl.Collator(0, { numeric: 1 }).compare;
typeof process < "u" && process.versions && process.versions.node;
var c0;
class hB extends TransformStream {
  /** Constructs a new instance. */
  constructor(t = { allowCR: !1 }) {
    super({
      transform: (n, a) => {
        for (n = hr(this, c0) + n; ; ) {
          const i = n.indexOf(`
`), s = t.allowCR ? n.indexOf("\r") : -1;
          if (s !== -1 && s !== n.length - 1 && (i === -1 || i - 1 > s)) {
            a.enqueue(n.slice(0, s)), n = n.slice(s + 1);
            continue;
          }
          if (i === -1)
            break;
          const l = n[i - 1] === "\r" ? i - 1 : i;
          a.enqueue(n.slice(0, l)), n = n.slice(i + 1);
        }
        io(this, c0, n);
      },
      flush: (n) => {
        if (hr(this, c0) === "")
          return;
        const a = t.allowCR && hr(this, c0).endsWith("\r") ? hr(this, c0).slice(0, -1) : hr(this, c0);
        n.enqueue(a);
      }
    });
    Yi(this, c0, "");
  }
}
c0 = new WeakMap();
const { setContext: fB, getContext: r6 } = window.__gradio__svelte__internal, a6 = "WORKER_PROXY_CONTEXT_KEY";
function i6() {
  return r6(a6);
}
const s6 = "lite.local";
function l6(r) {
  return r.host === window.location.host || r.host === "localhost:7860" || r.host === "127.0.0.1:7860" || // Ref: https://github.com/gradio-app/gradio/blob/v3.32.0/js/app/src/Index.svelte#L194
  r.host === s6;
}
function o6(r, e) {
  const t = e.toLowerCase();
  for (const [n, a] of Object.entries(r))
    if (n.toLowerCase() === t)
      return a;
}
function u6(r) {
  const e = typeof window < "u";
  if (r == null || !e)
    return !1;
  const t = new URL(r, window.location.href);
  return !(!l6(t) || t.protocol !== "http:" && t.protocol !== "https:");
}
let ri;
async function c6(r) {
  const e = typeof window < "u";
  if (r == null || !e || !u6(r))
    return r;
  if (ri == null)
    try {
      ri = i6();
    } catch {
      return r;
    }
  if (ri == null)
    return r;
  const n = new URL(r, window.location.href).pathname;
  return ri.httpRequest({
    method: "GET",
    path: n,
    headers: {},
    query_string: ""
  }).then((a) => {
    if (a.status !== 200)
      throw new Error(`Failed to get file ${n} from the Wasm worker.`);
    const i = new Blob([a.body], {
      type: o6(a.headers, "content-type")
    });
    return URL.createObjectURL(i);
  });
}
const {
  SvelteComponent: dB,
  assign: mB,
  check_outros: pB,
  children: gB,
  claim_element: _B,
  compute_rest_props: vB,
  create_slot: bB,
  detach: yB,
  element: wB,
  empty: kB,
  exclude_internal_props: SB,
  get_all_dirty_from_scope: DB,
  get_slot_changes: xB,
  get_spread_update: AB,
  group_outros: EB,
  init: CB,
  insert_hydration: $B,
  listen: TB,
  prevent_default: FB,
  safe_not_equal: MB,
  set_attributes: zB,
  set_style: BB,
  toggle_class: NB,
  transition_in: qB,
  transition_out: LB,
  update_slot_base: IB
} = window.__gradio__svelte__internal, { createEventDispatcher: RB, onMount: OB } = window.__gradio__svelte__internal, {
  SvelteComponent: h6,
  assign: yl,
  bubble: f6,
  claim_element: d6,
  compute_rest_props: p1,
  detach: m6,
  element: p6,
  exclude_internal_props: g6,
  get_spread_update: _6,
  init: v6,
  insert_hydration: b6,
  listen: y6,
  noop: g1,
  safe_not_equal: w6,
  set_attributes: _1,
  src_url_equal: k6,
  toggle_class: v1
} = window.__gradio__svelte__internal;
function S6(r) {
  let e, t, n, a, i = [
    {
      src: t = /*resolved_src*/
      r[0]
    },
    /*$$restProps*/
    r[1]
  ], s = {};
  for (let l = 0; l < i.length; l += 1)
    s = yl(s, i[l]);
  return {
    c() {
      e = p6("img"), this.h();
    },
    l(l) {
      e = d6(l, "IMG", { src: !0 }), this.h();
    },
    h() {
      _1(e, s), v1(e, "svelte-kxeri3", !0);
    },
    m(l, o) {
      b6(l, e, o), n || (a = y6(
        e,
        "load",
        /*load_handler*/
        r[4]
      ), n = !0);
    },
    p(l, [o]) {
      _1(e, s = _6(i, [
        o & /*resolved_src*/
        1 && !k6(e.src, t = /*resolved_src*/
        l[0]) && { src: t },
        o & /*$$restProps*/
        2 && /*$$restProps*/
        l[1]
      ])), v1(e, "svelte-kxeri3", !0);
    },
    i: g1,
    o: g1,
    d(l) {
      l && m6(e), n = !1, a();
    }
  };
}
function D6(r, e, t) {
  const n = ["src"];
  let a = p1(e, n), { src: i = void 0 } = e, s, l;
  function o(u) {
    f6.call(this, r, u);
  }
  return r.$$set = (u) => {
    e = yl(yl({}, e), g6(u)), t(1, a = p1(e, n)), "src" in u && t(2, i = u.src);
  }, r.$$.update = () => {
    if (r.$$.dirty & /*src, latest_src*/
    12) {
      t(0, s = i), t(3, l = i);
      const u = i;
      c6(u).then((h) => {
        l === u && t(0, s = h);
      });
    }
  }, [s, a, i, l, o];
}
class Ih extends h6 {
  constructor(e) {
    super(), v6(this, e, D6, S6, w6, { src: 2 });
  }
}
const {
  SvelteComponent: PB,
  append_hydration: HB,
  attr: UB,
  binding_callbacks: GB,
  bubble: jB,
  check_outros: VB,
  children: WB,
  claim_component: KB,
  claim_element: YB,
  claim_space: XB,
  create_component: ZB,
  destroy_component: QB,
  detach: JB,
  element: eN,
  empty: tN,
  group_outros: nN,
  init: rN,
  insert_hydration: aN,
  listen: iN,
  mount_component: sN,
  safe_not_equal: lN,
  space: oN,
  toggle_class: uN,
  transition_in: cN,
  transition_out: hN
} = window.__gradio__svelte__internal, { createEventDispatcher: fN, onMount: dN } = window.__gradio__svelte__internal, {
  SvelteComponent: x6,
  append_hydration: Rh,
  attr: nn,
  bubble: A6,
  check_outros: eo,
  children: Oh,
  claim_component: Ph,
  claim_element: Hh,
  claim_space: Uh,
  create_component: Gh,
  create_slot: jh,
  destroy_component: Vh,
  detach: la,
  element: Wh,
  empty: b1,
  get_all_dirty_from_scope: Kh,
  get_slot_changes: Yh,
  group_outros: to,
  init: E6,
  insert_hydration: no,
  listen: C6,
  mount_component: Xh,
  safe_not_equal: $6,
  set_style: Kt,
  space: Zh,
  toggle_class: br,
  transition_in: bn,
  transition_out: Xn,
  update_slot_base: Qh
} = window.__gradio__svelte__internal;
function T6(r) {
  let e, t, n, a, i, s, l = (
    /*icon*/
    r[7] && y1(r)
  );
  const o = (
    /*#slots*/
    r[12].default
  ), u = jh(
    o,
    r,
    /*$$scope*/
    r[11],
    null
  );
  return {
    c() {
      e = Wh("button"), l && l.c(), t = Zh(), u && u.c(), this.h();
    },
    l(h) {
      e = Hh(h, "BUTTON", { class: !0, id: !0 });
      var m = Oh(e);
      l && l.l(m), t = Uh(m), u && u.l(m), m.forEach(la), this.h();
    },
    h() {
      nn(e, "class", n = /*size*/
      r[4] + " " + /*variant*/
      r[3] + " " + /*elem_classes*/
      r[1].join(" ") + " svelte-rvoavt"), nn(
        e,
        "id",
        /*elem_id*/
        r[0]
      ), e.disabled = /*disabled*/
      r[8], br(e, "hidden", !/*visible*/
      r[2]), Kt(
        e,
        "flex-grow",
        /*scale*/
        r[9]
      ), Kt(
        e,
        "width",
        /*scale*/
        r[9] === 0 ? "fit-content" : null
      ), Kt(e, "min-width", typeof /*min_width*/
      r[10] == "number" ? `calc(min(${/*min_width*/
      r[10]}px, 100%))` : null);
    },
    m(h, m) {
      no(h, e, m), l && l.m(e, null), Rh(e, t), u && u.m(e, null), a = !0, i || (s = C6(
        e,
        "click",
        /*click_handler*/
        r[13]
      ), i = !0);
    },
    p(h, m) {
      /*icon*/
      h[7] ? l ? (l.p(h, m), m & /*icon*/
      128 && bn(l, 1)) : (l = y1(h), l.c(), bn(l, 1), l.m(e, t)) : l && (to(), Xn(l, 1, 1, () => {
        l = null;
      }), eo()), u && u.p && (!a || m & /*$$scope*/
      2048) && Qh(
        u,
        o,
        h,
        /*$$scope*/
        h[11],
        a ? Yh(
          o,
          /*$$scope*/
          h[11],
          m,
          null
        ) : Kh(
          /*$$scope*/
          h[11]
        ),
        null
      ), (!a || m & /*size, variant, elem_classes*/
      26 && n !== (n = /*size*/
      h[4] + " " + /*variant*/
      h[3] + " " + /*elem_classes*/
      h[1].join(" ") + " svelte-rvoavt")) && nn(e, "class", n), (!a || m & /*elem_id*/
      1) && nn(
        e,
        "id",
        /*elem_id*/
        h[0]
      ), (!a || m & /*disabled*/
      256) && (e.disabled = /*disabled*/
      h[8]), (!a || m & /*size, variant, elem_classes, visible*/
      30) && br(e, "hidden", !/*visible*/
      h[2]), m & /*scale*/
      512 && Kt(
        e,
        "flex-grow",
        /*scale*/
        h[9]
      ), m & /*scale*/
      512 && Kt(
        e,
        "width",
        /*scale*/
        h[9] === 0 ? "fit-content" : null
      ), m & /*min_width*/
      1024 && Kt(e, "min-width", typeof /*min_width*/
      h[10] == "number" ? `calc(min(${/*min_width*/
      h[10]}px, 100%))` : null);
    },
    i(h) {
      a || (bn(l), bn(u, h), a = !0);
    },
    o(h) {
      Xn(l), Xn(u, h), a = !1;
    },
    d(h) {
      h && la(e), l && l.d(), u && u.d(h), i = !1, s();
    }
  };
}
function F6(r) {
  let e, t, n, a, i = (
    /*icon*/
    r[7] && w1(r)
  );
  const s = (
    /*#slots*/
    r[12].default
  ), l = jh(
    s,
    r,
    /*$$scope*/
    r[11],
    null
  );
  return {
    c() {
      e = Wh("a"), i && i.c(), t = Zh(), l && l.c(), this.h();
    },
    l(o) {
      e = Hh(o, "A", {
        href: !0,
        rel: !0,
        "aria-disabled": !0,
        class: !0,
        id: !0
      });
      var u = Oh(e);
      i && i.l(u), t = Uh(u), l && l.l(u), u.forEach(la), this.h();
    },
    h() {
      nn(
        e,
        "href",
        /*link*/
        r[6]
      ), nn(e, "rel", "noopener noreferrer"), nn(
        e,
        "aria-disabled",
        /*disabled*/
        r[8]
      ), nn(e, "class", n = /*size*/
      r[4] + " " + /*variant*/
      r[3] + " " + /*elem_classes*/
      r[1].join(" ") + " svelte-rvoavt"), nn(
        e,
        "id",
        /*elem_id*/
        r[0]
      ), br(e, "hidden", !/*visible*/
      r[2]), br(
        e,
        "disabled",
        /*disabled*/
        r[8]
      ), Kt(
        e,
        "flex-grow",
        /*scale*/
        r[9]
      ), Kt(
        e,
        "pointer-events",
        /*disabled*/
        r[8] ? "none" : null
      ), Kt(
        e,
        "width",
        /*scale*/
        r[9] === 0 ? "fit-content" : null
      ), Kt(e, "min-width", typeof /*min_width*/
      r[10] == "number" ? `calc(min(${/*min_width*/
      r[10]}px, 100%))` : null);
    },
    m(o, u) {
      no(o, e, u), i && i.m(e, null), Rh(e, t), l && l.m(e, null), a = !0;
    },
    p(o, u) {
      /*icon*/
      o[7] ? i ? (i.p(o, u), u & /*icon*/
      128 && bn(i, 1)) : (i = w1(o), i.c(), bn(i, 1), i.m(e, t)) : i && (to(), Xn(i, 1, 1, () => {
        i = null;
      }), eo()), l && l.p && (!a || u & /*$$scope*/
      2048) && Qh(
        l,
        s,
        o,
        /*$$scope*/
        o[11],
        a ? Yh(
          s,
          /*$$scope*/
          o[11],
          u,
          null
        ) : Kh(
          /*$$scope*/
          o[11]
        ),
        null
      ), (!a || u & /*link*/
      64) && nn(
        e,
        "href",
        /*link*/
        o[6]
      ), (!a || u & /*disabled*/
      256) && nn(
        e,
        "aria-disabled",
        /*disabled*/
        o[8]
      ), (!a || u & /*size, variant, elem_classes*/
      26 && n !== (n = /*size*/
      o[4] + " " + /*variant*/
      o[3] + " " + /*elem_classes*/
      o[1].join(" ") + " svelte-rvoavt")) && nn(e, "class", n), (!a || u & /*elem_id*/
      1) && nn(
        e,
        "id",
        /*elem_id*/
        o[0]
      ), (!a || u & /*size, variant, elem_classes, visible*/
      30) && br(e, "hidden", !/*visible*/
      o[2]), (!a || u & /*size, variant, elem_classes, disabled*/
      282) && br(
        e,
        "disabled",
        /*disabled*/
        o[8]
      ), u & /*scale*/
      512 && Kt(
        e,
        "flex-grow",
        /*scale*/
        o[9]
      ), u & /*disabled*/
      256 && Kt(
        e,
        "pointer-events",
        /*disabled*/
        o[8] ? "none" : null
      ), u & /*scale*/
      512 && Kt(
        e,
        "width",
        /*scale*/
        o[9] === 0 ? "fit-content" : null
      ), u & /*min_width*/
      1024 && Kt(e, "min-width", typeof /*min_width*/
      o[10] == "number" ? `calc(min(${/*min_width*/
      o[10]}px, 100%))` : null);
    },
    i(o) {
      a || (bn(i), bn(l, o), a = !0);
    },
    o(o) {
      Xn(i), Xn(l, o), a = !1;
    },
    d(o) {
      o && la(e), i && i.d(), l && l.d(o);
    }
  };
}
function y1(r) {
  let e, t;
  return e = new Ih({
    props: {
      class: `button-icon ${/*value*/
      r[5] ? "right-padded" : ""}`,
      src: (
        /*icon*/
        r[7].url
      ),
      alt: `${/*value*/
      r[5]} icon`
    }
  }), {
    c() {
      Gh(e.$$.fragment);
    },
    l(n) {
      Ph(e.$$.fragment, n);
    },
    m(n, a) {
      Xh(e, n, a), t = !0;
    },
    p(n, a) {
      const i = {};
      a & /*value*/
      32 && (i.class = `button-icon ${/*value*/
      n[5] ? "right-padded" : ""}`), a & /*icon*/
      128 && (i.src = /*icon*/
      n[7].url), a & /*value*/
      32 && (i.alt = `${/*value*/
      n[5]} icon`), e.$set(i);
    },
    i(n) {
      t || (bn(e.$$.fragment, n), t = !0);
    },
    o(n) {
      Xn(e.$$.fragment, n), t = !1;
    },
    d(n) {
      Vh(e, n);
    }
  };
}
function w1(r) {
  let e, t;
  return e = new Ih({
    props: {
      class: "button-icon",
      src: (
        /*icon*/
        r[7].url
      ),
      alt: `${/*value*/
      r[5]} icon`
    }
  }), {
    c() {
      Gh(e.$$.fragment);
    },
    l(n) {
      Ph(e.$$.fragment, n);
    },
    m(n, a) {
      Xh(e, n, a), t = !0;
    },
    p(n, a) {
      const i = {};
      a & /*icon*/
      128 && (i.src = /*icon*/
      n[7].url), a & /*value*/
      32 && (i.alt = `${/*value*/
      n[5]} icon`), e.$set(i);
    },
    i(n) {
      t || (bn(e.$$.fragment, n), t = !0);
    },
    o(n) {
      Xn(e.$$.fragment, n), t = !1;
    },
    d(n) {
      Vh(e, n);
    }
  };
}
function M6(r) {
  let e, t, n, a;
  const i = [F6, T6], s = [];
  function l(o, u) {
    return (
      /*link*/
      o[6] && /*link*/
      o[6].length > 0 ? 0 : 1
    );
  }
  return e = l(r), t = s[e] = i[e](r), {
    c() {
      t.c(), n = b1();
    },
    l(o) {
      t.l(o), n = b1();
    },
    m(o, u) {
      s[e].m(o, u), no(o, n, u), a = !0;
    },
    p(o, [u]) {
      let h = e;
      e = l(o), e === h ? s[e].p(o, u) : (to(), Xn(s[h], 1, 1, () => {
        s[h] = null;
      }), eo(), t = s[e], t ? t.p(o, u) : (t = s[e] = i[e](o), t.c()), bn(t, 1), t.m(n.parentNode, n));
    },
    i(o) {
      a || (bn(t), a = !0);
    },
    o(o) {
      Xn(t), a = !1;
    },
    d(o) {
      o && la(n), s[e].d(o);
    }
  };
}
function z6(r, e, t) {
  let { $$slots: n = {}, $$scope: a } = e, { elem_id: i = "" } = e, { elem_classes: s = [] } = e, { visible: l = !0 } = e, { variant: o = "secondary" } = e, { size: u = "lg" } = e, { value: h = null } = e, { link: m = null } = e, { icon: d = null } = e, { disabled: g = !1 } = e, { scale: b = null } = e, { min_width: v = void 0 } = e;
  function w(x) {
    A6.call(this, r, x);
  }
  return r.$$set = (x) => {
    "elem_id" in x && t(0, i = x.elem_id), "elem_classes" in x && t(1, s = x.elem_classes), "visible" in x && t(2, l = x.visible), "variant" in x && t(3, o = x.variant), "size" in x && t(4, u = x.size), "value" in x && t(5, h = x.value), "link" in x && t(6, m = x.link), "icon" in x && t(7, d = x.icon), "disabled" in x && t(8, g = x.disabled), "scale" in x && t(9, b = x.scale), "min_width" in x && t(10, v = x.min_width), "$$scope" in x && t(11, a = x.$$scope);
  }, [
    i,
    s,
    l,
    o,
    u,
    h,
    m,
    d,
    g,
    b,
    v,
    a,
    n,
    w
  ];
}
class ro extends x6 {
  constructor(e) {
    super(), E6(this, e, z6, M6, $6, {
      elem_id: 0,
      elem_classes: 1,
      visible: 2,
      variant: 3,
      size: 4,
      value: 5,
      link: 6,
      icon: 7,
      disabled: 8,
      scale: 9,
      min_width: 10
    });
  }
}
const {
  SvelteComponent: mN,
  claim_component: pN,
  claim_text: gN,
  create_component: _N,
  destroy_component: vN,
  detach: bN,
  init: yN,
  insert_hydration: wN,
  mount_component: kN,
  safe_not_equal: SN,
  set_data: DN,
  text: xN,
  transition_in: AN,
  transition_out: EN
} = window.__gradio__svelte__internal, {
  SvelteComponent: B6,
  append_hydration: ai,
  attr: s0,
  children: k1,
  claim_element: js,
  claim_space: N6,
  claim_text: q6,
  detach: Vs,
  element: Ws,
  init: L6,
  init_binding_group: I6,
  insert_hydration: R6,
  listen: O6,
  noop: S1,
  safe_not_equal: P6,
  set_data: H6,
  set_input_value: D1,
  space: U6,
  text: G6,
  toggle_class: _r
} = window.__gradio__svelte__internal, { createEventDispatcher: j6 } = window.__gradio__svelte__internal;
function V6(r) {
  let e, t, n = !1, a, i, s, l, o, u, h;
  return o = I6(
    /*$$binding_groups*/
    r[7][0]
  ), {
    c() {
      e = Ws("label"), t = Ws("input"), a = U6(), i = Ws("span"), s = G6(
        /*display_value*/
        r[1]
      ), this.h();
    },
    l(m) {
      e = js(m, "LABEL", { "data-testid": !0, class: !0 });
      var d = k1(e);
      t = js(d, "INPUT", {
        type: !0,
        name: !0,
        "aria-checked": !0,
        class: !0
      }), a = N6(d), i = js(d, "SPAN", { class: !0 });
      var g = k1(i);
      s = q6(
        g,
        /*display_value*/
        r[1]
      ), g.forEach(Vs), d.forEach(Vs), this.h();
    },
    h() {
      t.disabled = /*disabled*/
      r[3], s0(t, "type", "radio"), s0(t, "name", "radio-" + ++W6), t.__value = /*internal_value*/
      r[2], D1(t, t.__value), s0(
        t,
        "aria-checked",
        /*is_selected*/
        r[5]
      ), s0(t, "class", "svelte-e9stf"), s0(i, "class", "svelte-e9stf"), s0(e, "data-testid", l = /*display_value*/
      r[1] + "-radio-label"), s0(e, "class", "svelte-e9stf"), _r(
        e,
        "disabled",
        /*disabled*/
        r[3]
      ), _r(
        e,
        "selected",
        /*is_selected*/
        r[5]
      ), _r(
        e,
        "rtl",
        /*rtl*/
        r[4]
      ), o.p(t);
    },
    m(m, d) {
      R6(m, e, d), ai(e, t), t.checked = t.__value === /*selected*/
      r[0], ai(e, a), ai(e, i), ai(i, s), u || (h = O6(
        t,
        "change",
        /*input_change_handler*/
        r[6]
      ), u = !0);
    },
    p(m, [d]) {
      d & /*disabled*/
      8 && (t.disabled = /*disabled*/
      m[3]), d & /*internal_value*/
      4 && (t.__value = /*internal_value*/
      m[2], D1(t, t.__value), n = !0), d & /*is_selected*/
      32 && s0(
        t,
        "aria-checked",
        /*is_selected*/
        m[5]
      ), (n || d & /*selected*/
      1) && (t.checked = t.__value === /*selected*/
      m[0]), d & /*display_value*/
      2 && H6(
        s,
        /*display_value*/
        m[1]
      ), d & /*display_value*/
      2 && l !== (l = /*display_value*/
      m[1] + "-radio-label") && s0(e, "data-testid", l), d & /*disabled*/
      8 && _r(
        e,
        "disabled",
        /*disabled*/
        m[3]
      ), d & /*is_selected*/
      32 && _r(
        e,
        "selected",
        /*is_selected*/
        m[5]
      ), d & /*rtl*/
      16 && _r(
        e,
        "rtl",
        /*rtl*/
        m[4]
      );
    },
    i: S1,
    o: S1,
    d(m) {
      m && Vs(e), o.r(), u = !1, h();
    }
  };
}
let W6 = 0;
function K6(r, e, t) {
  let { display_value: n } = e, { internal_value: a } = e, { disabled: i = !1 } = e, { selected: s = null } = e, { rtl: l = !1 } = e;
  const o = j6();
  let u = !1;
  async function h(g, b) {
    t(5, u = g === b), u && o("input", b);
  }
  const m = [[]];
  function d() {
    s = this.__value, t(0, s);
  }
  return r.$$set = (g) => {
    "display_value" in g && t(1, n = g.display_value), "internal_value" in g && t(2, a = g.internal_value), "disabled" in g && t(3, i = g.disabled), "selected" in g && t(0, s = g.selected), "rtl" in g && t(4, l = g.rtl);
  }, r.$$.update = () => {
    r.$$.dirty & /*selected, internal_value*/
    5 && h(s, a);
  }, [
    s,
    n,
    a,
    i,
    l,
    u,
    d,
    m
  ];
}
class x1 extends B6 {
  constructor(e) {
    super(), L6(this, e, K6, V6, P6, {
      display_value: 1,
      internal_value: 2,
      disabled: 3,
      selected: 0,
      rtl: 4
    });
  }
}
const {
  SvelteComponent: CN,
  append_hydration: $N,
  attr: TN,
  children: FN,
  claim_element: MN,
  claim_text: zN,
  detach: BN,
  element: NN,
  init: qN,
  insert_hydration: LN,
  noop: IN,
  safe_not_equal: RN,
  set_data: ON,
  text: PN,
  toggle_class: HN
} = window.__gradio__svelte__internal, {
  SvelteComponent: UN,
  add_flush_callback: GN,
  assign: jN,
  attr: VN,
  bind: WN,
  binding_callbacks: KN,
  check_outros: YN,
  children: XN,
  claim_component: ZN,
  claim_element: QN,
  claim_space: JN,
  claim_text: eq,
  create_component: tq,
  destroy_component: nq,
  detach: rq,
  element: aq,
  empty: iq,
  ensure_array_like: sq,
  get_spread_object: lq,
  get_spread_update: oq,
  group_outros: uq,
  init: cq,
  insert_hydration: hq,
  mount_component: fq,
  outro_and_destroy_block: dq,
  safe_not_equal: mq,
  set_data: pq,
  space: gq,
  text: _q,
  transition_in: vq,
  transition_out: bq,
  update_keyed_each: yq
} = window.__gradio__svelte__internal, {
  SvelteComponent: Y6,
  append_hydration: X6,
  assign: Z6,
  attr: ii,
  check_outros: Q6,
  children: J6,
  claim_component: e7,
  claim_element: t7,
  claim_space: n7,
  create_component: r7,
  create_slot: a7,
  destroy_component: i7,
  detach: A1,
  element: s7,
  get_all_dirty_from_scope: l7,
  get_slot_changes: o7,
  get_spread_object: u7,
  get_spread_update: c7,
  group_outros: h7,
  init: f7,
  insert_hydration: d7,
  mount_component: m7,
  safe_not_equal: p7,
  set_style: C0,
  space: g7,
  toggle_class: dn,
  transition_in: Kr,
  transition_out: _i,
  update_slot_base: _7
} = window.__gradio__svelte__internal;
function E1(r) {
  let e, t;
  const n = [
    { autoscroll: (
      /*gradio*/
      r[6].autoscroll
    ) },
    { i18n: (
      /*gradio*/
      r[6].i18n
    ) },
    /*loading_status*/
    r[5],
    {
      status: (
        /*loading_status*/
        r[5] ? (
          /*loading_status*/
          r[5].status == "pending" ? "generating" : (
            /*loading_status*/
            r[5].status
          )
        ) : null
      )
    }
  ];
  let a = {};
  for (let i = 0; i < n.length; i += 1)
    a = Z6(a, n[i]);
  return e = new Xl({ props: a }), {
    c() {
      r7(e.$$.fragment);
    },
    l(i) {
      e7(e.$$.fragment, i);
    },
    m(i, s) {
      m7(e, i, s), t = !0;
    },
    p(i, s) {
      const l = s & /*gradio, loading_status*/
      96 ? c7(n, [
        s & /*gradio*/
        64 && { autoscroll: (
          /*gradio*/
          i[6].autoscroll
        ) },
        s & /*gradio*/
        64 && { i18n: (
          /*gradio*/
          i[6].i18n
        ) },
        s & /*loading_status*/
        32 && u7(
          /*loading_status*/
          i[5]
        ),
        s & /*loading_status*/
        32 && {
          status: (
            /*loading_status*/
            i[5] ? (
              /*loading_status*/
              i[5].status == "pending" ? "generating" : (
                /*loading_status*/
                i[5].status
              )
            ) : null
          )
        }
      ]) : {};
      e.$set(l);
    },
    i(i) {
      t || (Kr(e.$$.fragment, i), t = !0);
    },
    o(i) {
      _i(e.$$.fragment, i), t = !1;
    },
    d(i) {
      i7(e, i);
    }
  };
}
function v7(r) {
  let e, t, n, a, i = (
    /*loading_status*/
    r[5] && /*show_progress*/
    r[7] && /*gradio*/
    r[6] && E1(r)
  );
  const s = (
    /*#slots*/
    r[14].default
  ), l = a7(
    s,
    r,
    /*$$scope*/
    r[13],
    null
  );
  return {
    c() {
      e = s7("div"), i && i.c(), t = g7(), l && l.c(), this.h();
    },
    l(o) {
      e = t7(o, "DIV", { id: !0, class: !0 });
      var u = J6(e);
      i && i.l(u), t = n7(u), l && l.l(u), u.forEach(A1), this.h();
    },
    h() {
      ii(
        e,
        "id",
        /*elem_id*/
        r[1]
      ), ii(e, "class", n = "row " + /*elem_classes*/
      r[2].join(" ") + " svelte-14z3143"), dn(
        e,
        "compact",
        /*variant*/
        r[4] === "compact"
      ), dn(
        e,
        "panel",
        /*variant*/
        r[4] === "panel"
      ), dn(
        e,
        "unequal-height",
        /*equal_height*/
        r[0] === !1
      ), dn(
        e,
        "stretch",
        /*equal_height*/
        r[0]
      ), dn(e, "hide", !/*visible*/
      r[3]), dn(
        e,
        "grow-children",
        /*scale*/
        r[11] && /*scale*/
        r[11] >= 1
      ), C0(
        e,
        "height",
        /*get_dimension*/
        r[12](
          /*height*/
          r[8]
        )
      ), C0(
        e,
        "max-height",
        /*get_dimension*/
        r[12](
          /*max_height*/
          r[10]
        )
      ), C0(
        e,
        "min-height",
        /*get_dimension*/
        r[12](
          /*min_height*/
          r[9]
        )
      ), C0(
        e,
        "flex-grow",
        /*scale*/
        r[11]
      );
    },
    m(o, u) {
      d7(o, e, u), i && i.m(e, null), X6(e, t), l && l.m(e, null), a = !0;
    },
    p(o, [u]) {
      /*loading_status*/
      o[5] && /*show_progress*/
      o[7] && /*gradio*/
      o[6] ? i ? (i.p(o, u), u & /*loading_status, show_progress, gradio*/
      224 && Kr(i, 1)) : (i = E1(o), i.c(), Kr(i, 1), i.m(e, t)) : i && (h7(), _i(i, 1, 1, () => {
        i = null;
      }), Q6()), l && l.p && (!a || u & /*$$scope*/
      8192) && _7(
        l,
        s,
        o,
        /*$$scope*/
        o[13],
        a ? o7(
          s,
          /*$$scope*/
          o[13],
          u,
          null
        ) : l7(
          /*$$scope*/
          o[13]
        ),
        null
      ), (!a || u & /*elem_id*/
      2) && ii(
        e,
        "id",
        /*elem_id*/
        o[1]
      ), (!a || u & /*elem_classes*/
      4 && n !== (n = "row " + /*elem_classes*/
      o[2].join(" ") + " svelte-14z3143")) && ii(e, "class", n), (!a || u & /*elem_classes, variant*/
      20) && dn(
        e,
        "compact",
        /*variant*/
        o[4] === "compact"
      ), (!a || u & /*elem_classes, variant*/
      20) && dn(
        e,
        "panel",
        /*variant*/
        o[4] === "panel"
      ), (!a || u & /*elem_classes, equal_height*/
      5) && dn(
        e,
        "unequal-height",
        /*equal_height*/
        o[0] === !1
      ), (!a || u & /*elem_classes, equal_height*/
      5) && dn(
        e,
        "stretch",
        /*equal_height*/
        o[0]
      ), (!a || u & /*elem_classes, visible*/
      12) && dn(e, "hide", !/*visible*/
      o[3]), (!a || u & /*elem_classes, scale*/
      2052) && dn(
        e,
        "grow-children",
        /*scale*/
        o[11] && /*scale*/
        o[11] >= 1
      ), u & /*height*/
      256 && C0(
        e,
        "height",
        /*get_dimension*/
        o[12](
          /*height*/
          o[8]
        )
      ), u & /*max_height*/
      1024 && C0(
        e,
        "max-height",
        /*get_dimension*/
        o[12](
          /*max_height*/
          o[10]
        )
      ), u & /*min_height*/
      512 && C0(
        e,
        "min-height",
        /*get_dimension*/
        o[12](
          /*min_height*/
          o[9]
        )
      ), u & /*scale*/
      2048 && C0(
        e,
        "flex-grow",
        /*scale*/
        o[11]
      );
    },
    i(o) {
      a || (Kr(i), Kr(l, o), a = !0);
    },
    o(o) {
      _i(i), _i(l, o), a = !1;
    },
    d(o) {
      o && A1(e), i && i.d(), l && l.d(o);
    }
  };
}
function b7(r, e, t) {
  let { $$slots: n = {}, $$scope: a } = e, { equal_height: i = !0 } = e, { elem_id: s } = e, { elem_classes: l = [] } = e, { visible: o = !0 } = e, { variant: u = "default" } = e, { loading_status: h = void 0 } = e, { gradio: m = void 0 } = e, { show_progress: d = !1 } = e, { height: g } = e, { min_height: b } = e, { max_height: v } = e, { scale: w = null } = e;
  const x = (k) => {
    if (k !== void 0) {
      if (typeof k == "number")
        return k + "px";
      if (typeof k == "string")
        return k;
    }
  };
  return r.$$set = (k) => {
    "equal_height" in k && t(0, i = k.equal_height), "elem_id" in k && t(1, s = k.elem_id), "elem_classes" in k && t(2, l = k.elem_classes), "visible" in k && t(3, o = k.visible), "variant" in k && t(4, u = k.variant), "loading_status" in k && t(5, h = k.loading_status), "gradio" in k && t(6, m = k.gradio), "show_progress" in k && t(7, d = k.show_progress), "height" in k && t(8, g = k.height), "min_height" in k && t(9, b = k.min_height), "max_height" in k && t(10, v = k.max_height), "scale" in k && t(11, w = k.scale), "$$scope" in k && t(13, a = k.$$scope);
  }, [
    i,
    s,
    l,
    o,
    u,
    h,
    m,
    d,
    g,
    b,
    v,
    w,
    x,
    a,
    n
  ];
}
let Ks = class extends Y6 {
  constructor(e) {
    super(), f7(this, e, b7, v7, p7, {
      equal_height: 0,
      elem_id: 1,
      elem_classes: 2,
      visible: 3,
      variant: 4,
      loading_status: 5,
      gradio: 6,
      show_progress: 7,
      height: 8,
      min_height: 9,
      max_height: 10,
      scale: 11
    });
  }
};
const {
  SvelteComponent: y7,
  append_hydration: w7,
  assign: k7,
  attr: si,
  check_outros: S7,
  children: D7,
  claim_component: x7,
  claim_element: A7,
  claim_space: E7,
  create_component: C7,
  create_slot: $7,
  destroy_component: T7,
  detach: C1,
  element: F7,
  get_all_dirty_from_scope: M7,
  get_slot_changes: z7,
  get_spread_object: B7,
  get_spread_update: N7,
  group_outros: q7,
  init: L7,
  insert_hydration: I7,
  mount_component: R7,
  safe_not_equal: O7,
  set_style: li,
  space: P7,
  toggle_class: $0,
  transition_in: Yr,
  transition_out: vi,
  update_slot_base: H7
} = window.__gradio__svelte__internal;
function $1(r) {
  let e, t;
  const n = [
    { autoscroll: (
      /*gradio*/
      r[8].autoscroll
    ) },
    { i18n: (
      /*gradio*/
      r[8].i18n
    ) },
    /*loading_status*/
    r[7],
    {
      status: (
        /*loading_status*/
        r[7] ? (
          /*loading_status*/
          r[7].status == "pending" ? "generating" : (
            /*loading_status*/
            r[7].status
          )
        ) : null
      )
    }
  ];
  let a = {};
  for (let i = 0; i < n.length; i += 1)
    a = k7(a, n[i]);
  return e = new Xl({ props: a }), {
    c() {
      C7(e.$$.fragment);
    },
    l(i) {
      x7(e.$$.fragment, i);
    },
    m(i, s) {
      R7(e, i, s), t = !0;
    },
    p(i, s) {
      const l = s & /*gradio, loading_status*/
      384 ? N7(n, [
        s & /*gradio*/
        256 && { autoscroll: (
          /*gradio*/
          i[8].autoscroll
        ) },
        s & /*gradio*/
        256 && { i18n: (
          /*gradio*/
          i[8].i18n
        ) },
        s & /*loading_status*/
        128 && B7(
          /*loading_status*/
          i[7]
        ),
        s & /*loading_status*/
        128 && {
          status: (
            /*loading_status*/
            i[7] ? (
              /*loading_status*/
              i[7].status == "pending" ? "generating" : (
                /*loading_status*/
                i[7].status
              )
            ) : null
          )
        }
      ]) : {};
      e.$set(l);
    },
    i(i) {
      t || (Yr(e.$$.fragment, i), t = !0);
    },
    o(i) {
      vi(e.$$.fragment, i), t = !1;
    },
    d(i) {
      T7(e, i);
    }
  };
}
function U7(r) {
  let e, t, n, a = `calc(min(${/*min_width*/
  r[2]}px, 100%))`, i, s = (
    /*loading_status*/
    r[7] && /*show_progress*/
    r[9] && /*gradio*/
    r[8] && $1(r)
  );
  const l = (
    /*#slots*/
    r[11].default
  ), o = $7(
    l,
    r,
    /*$$scope*/
    r[10],
    null
  );
  return {
    c() {
      e = F7("div"), s && s.c(), t = P7(), o && o.c(), this.h();
    },
    l(u) {
      e = A7(u, "DIV", { id: !0, class: !0 });
      var h = D7(e);
      s && s.l(h), t = E7(h), o && o.l(h), h.forEach(C1), this.h();
    },
    h() {
      si(
        e,
        "id",
        /*elem_id*/
        r[3]
      ), si(e, "class", n = "column " + /*elem_classes*/
      r[4].join(" ") + " svelte-1m1obck"), $0(
        e,
        "gap",
        /*gap*/
        r[1]
      ), $0(
        e,
        "compact",
        /*variant*/
        r[6] === "compact"
      ), $0(
        e,
        "panel",
        /*variant*/
        r[6] === "panel"
      ), $0(e, "hide", !/*visible*/
      r[5]), li(
        e,
        "flex-grow",
        /*scale*/
        r[0]
      ), li(e, "min-width", a);
    },
    m(u, h) {
      I7(u, e, h), s && s.m(e, null), w7(e, t), o && o.m(e, null), i = !0;
    },
    p(u, [h]) {
      /*loading_status*/
      u[7] && /*show_progress*/
      u[9] && /*gradio*/
      u[8] ? s ? (s.p(u, h), h & /*loading_status, show_progress, gradio*/
      896 && Yr(s, 1)) : (s = $1(u), s.c(), Yr(s, 1), s.m(e, t)) : s && (q7(), vi(s, 1, 1, () => {
        s = null;
      }), S7()), o && o.p && (!i || h & /*$$scope*/
      1024) && H7(
        o,
        l,
        u,
        /*$$scope*/
        u[10],
        i ? z7(
          l,
          /*$$scope*/
          u[10],
          h,
          null
        ) : M7(
          /*$$scope*/
          u[10]
        ),
        null
      ), (!i || h & /*elem_id*/
      8) && si(
        e,
        "id",
        /*elem_id*/
        u[3]
      ), (!i || h & /*elem_classes*/
      16 && n !== (n = "column " + /*elem_classes*/
      u[4].join(" ") + " svelte-1m1obck")) && si(e, "class", n), (!i || h & /*elem_classes, gap*/
      18) && $0(
        e,
        "gap",
        /*gap*/
        u[1]
      ), (!i || h & /*elem_classes, variant*/
      80) && $0(
        e,
        "compact",
        /*variant*/
        u[6] === "compact"
      ), (!i || h & /*elem_classes, variant*/
      80) && $0(
        e,
        "panel",
        /*variant*/
        u[6] === "panel"
      ), (!i || h & /*elem_classes, visible*/
      48) && $0(e, "hide", !/*visible*/
      u[5]), h & /*scale*/
      1 && li(
        e,
        "flex-grow",
        /*scale*/
        u[0]
      ), h & /*min_width*/
      4 && a !== (a = `calc(min(${/*min_width*/
      u[2]}px, 100%))`) && li(e, "min-width", a);
    },
    i(u) {
      i || (Yr(s), Yr(o, u), i = !0);
    },
    o(u) {
      vi(s), vi(o, u), i = !1;
    },
    d(u) {
      u && C1(e), s && s.d(), o && o.d(u);
    }
  };
}
function G7(r, e, t) {
  let { $$slots: n = {}, $$scope: a } = e, { scale: i = null } = e, { gap: s = !0 } = e, { min_width: l = 0 } = e, { elem_id: o = "" } = e, { elem_classes: u = [] } = e, { visible: h = !0 } = e, { variant: m = "default" } = e, { loading_status: d = void 0 } = e, { gradio: g = void 0 } = e, { show_progress: b = !1 } = e;
  return r.$$set = (v) => {
    "scale" in v && t(0, i = v.scale), "gap" in v && t(1, s = v.gap), "min_width" in v && t(2, l = v.min_width), "elem_id" in v && t(3, o = v.elem_id), "elem_classes" in v && t(4, u = v.elem_classes), "visible" in v && t(5, h = v.visible), "variant" in v && t(6, m = v.variant), "loading_status" in v && t(7, d = v.loading_status), "gradio" in v && t(8, g = v.gradio), "show_progress" in v && t(9, b = v.show_progress), "$$scope" in v && t(10, a = v.$$scope);
  }, [
    i,
    s,
    l,
    o,
    u,
    h,
    m,
    d,
    g,
    b,
    a,
    n
  ];
}
let Y0 = class extends y7 {
  constructor(e) {
    super(), L7(this, e, G7, U7, O7, {
      scale: 0,
      gap: 1,
      min_width: 2,
      elem_id: 3,
      elem_classes: 4,
      visible: 5,
      variant: 6,
      loading_status: 7,
      gradio: 8,
      show_progress: 9
    });
  }
};
const {
  SvelteComponent: j7,
  add_flush_callback: oa,
  add_render_callback: V7,
  append_hydration: Dt,
  assign: W7,
  attr: tt,
  bind: ua,
  binding_callbacks: ca,
  check_outros: T1,
  children: ln,
  claim_component: Xe,
  claim_element: ct,
  claim_space: zt,
  claim_text: Jh,
  create_component: Ze,
  destroy_component: Qe,
  destroy_each: K7,
  detach: ve,
  element: ht,
  ensure_array_like: F1,
  get_spread_object: Y7,
  get_spread_update: X7,
  get_svelte_dataset: na,
  group_outros: M1,
  head_selector: Z7,
  init: Q7,
  insert_hydration: ft,
  listen: wl,
  mount_component: Je,
  noop: Pi,
  run_all: J7,
  safe_not_equal: eg,
  select_option: z1,
  select_value: tg,
  set_data: ng,
  set_input_value: rg,
  set_style: ag,
  space: Bt,
  src_url_equal: B1,
  text: ef,
  transition_in: Te,
  transition_out: qe
} = window.__gradio__svelte__internal;
function N1(r, e, t) {
  const n = r.slice();
  return n[45] = e[t], n;
}
function q1(r) {
  let e, t;
  const n = [
    { autoscroll: (
      /*gradio*/
      r[3].autoscroll
    ) },
    { i18n: (
      /*gradio*/
      r[3].i18n
    ) },
    /*loading_status*/
    r[11]
  ];
  let a = {};
  for (let i = 0; i < n.length; i += 1)
    a = W7(a, n[i]);
  return e = new Xl({ props: a }), e.$on(
    "clear_status",
    /*clear_status_handler*/
    r[29]
  ), {
    c() {
      Ze(e.$$.fragment);
    },
    l(i) {
      Xe(e.$$.fragment, i);
    },
    m(i, s) {
      Je(e, i, s), t = !0;
    },
    p(i, s) {
      const l = s[0] & /*gradio, loading_status*/
      2056 ? X7(n, [
        s[0] & /*gradio*/
        8 && { autoscroll: (
          /*gradio*/
          i[3].autoscroll
        ) },
        s[0] & /*gradio*/
        8 && { i18n: (
          /*gradio*/
          i[3].i18n
        ) },
        s[0] & /*loading_status*/
        2048 && Y7(
          /*loading_status*/
          i[11]
        )
      ]) : {};
      e.$set(l);
    },
    i(i) {
      t || (Te(e.$$.fragment, i), t = !0);
    },
    o(i) {
      qe(e.$$.fragment, i), t = !1;
    },
    d(i) {
      Qe(e, i);
    }
  };
}
function ig(r) {
  let e;
  return {
    c() {
      e = ef(
        /*label*/
        r[4]
      );
    },
    l(t) {
      e = Jh(
        t,
        /*label*/
        r[4]
      );
    },
    m(t, n) {
      ft(t, e, n);
    },
    p(t, n) {
      n[0] & /*label*/
      16 && ng(
        e,
        /*label*/
        t[4]
      );
    },
    d(t) {
      t && ve(e);
    }
  };
}
function L1(r) {
  let e, t, n, a, i, s, l;
  return t = new Ks({
    props: {
      style: "align-items: center; gap: 2rem;",
      $$slots: { default: [dg] },
      $$scope: { ctx: r }
    }
  }), a = new Ks({
    props: {
      style: "align-items: center; gap: 2rem;",
      $$slots: { default: [gg] },
      $$scope: { ctx: r }
    }
  }), s = new Ks({
    props: {
      class: "bottom‐row",
      $$slots: { default: [vg] },
      $$scope: { ctx: r }
    }
  }), {
    c() {
      e = ht("div"), Ze(t.$$.fragment), n = Bt(), Ze(a.$$.fragment), i = Bt(), Ze(s.$$.fragment), this.h();
    },
    l(o) {
      e = ct(o, "DIV", { class: !0 });
      var u = ln(e);
      Xe(t.$$.fragment, u), n = zt(u), Xe(a.$$.fragment, u), i = zt(u), Xe(s.$$.fragment, u), u.forEach(ve), this.h();
    },
    h() {
      tt(e, "class", "controls-container svelte-gikd8m");
    },
    m(o, u) {
      ft(o, e, u), Je(t, e, null), Dt(e, n), Je(a, e, null), Dt(e, i), Je(s, e, null), l = !0;
    },
    p(o, u) {
      const h = {};
      u[0] & /*board, orientation, sideToMove*/
      49156 | u[1] & /*$$scope*/
      131072 && (h.$$scope = { dirty: u, ctx: o }), t.$set(h);
      const m = {};
      u[0] & /*blackQueenside, blackKingside, whiteQueenside, whiteKingside*/
      983040 | u[1] & /*$$scope*/
      131072 && (m.$$scope = { dirty: u, ctx: o }), a.$set(m);
      const d = {};
      u[0] & /*value*/
      1 | u[1] & /*$$scope*/
      131072 && (d.$$scope = { dirty: u, ctx: o }), s.$set(d);
    },
    i(o) {
      l || (Te(t.$$.fragment, o), Te(a.$$.fragment, o), Te(s.$$.fragment, o), l = !0);
    },
    o(o) {
      qe(t.$$.fragment, o), qe(a.$$.fragment, o), qe(s.$$.fragment, o), l = !1;
    },
    d(o) {
      o && ve(e), Qe(t), Qe(a), Qe(s);
    }
  };
}
function I1(r) {
  let e, t = (
    /*item*/
    r[45].label + ""
  ), n;
  return {
    c() {
      e = ht("option"), n = ef(t), this.h();
    },
    l(a) {
      e = ct(a, "OPTION", {});
      var i = ln(e);
      n = Jh(i, t), i.forEach(ve), this.h();
    },
    h() {
      e.__value = /*item*/
      r[45].value, rg(e, e.__value);
    },
    m(a, i) {
      ft(a, e, i), Dt(e, n);
    },
    p: Pi,
    d(a) {
      a && ve(e);
    }
  };
}
function sg(r) {
  let e, t, n, a, i = F1(
    /*items*/
    r[21]
  ), s = [];
  for (let l = 0; l < i.length; l += 1)
    s[l] = I1(N1(r, i, l));
  return {
    c() {
      e = ht("div"), t = ht("select");
      for (let l = 0; l < s.length; l += 1)
        s[l].c();
      this.h();
    },
    l(l) {
      e = ct(l, "DIV", { class: !0 });
      var o = ln(e);
      t = ct(o, "SELECT", { class: !0 });
      var u = ln(t);
      for (let h = 0; h < s.length; h += 1)
        s[h].l(u);
      u.forEach(ve), o.forEach(ve), this.h();
    },
    h() {
      tt(t, "class", "svelte-gikd8m"), /*sideToMove*/
      r[15] === void 0 && V7(() => (
        /*select_change_handler*/
        r[32].call(t)
      )), tt(e, "class", "dropdown-container svelte-gikd8m");
    },
    m(l, o) {
      ft(l, e, o), Dt(e, t);
      for (let u = 0; u < s.length; u += 1)
        s[u] && s[u].m(t, null);
      z1(
        t,
        /*sideToMove*/
        r[15],
        !0
      ), n || (a = [
        wl(
          t,
          "change",
          /*select_change_handler*/
          r[32]
        ),
        wl(
          t,
          "change",
          /*updateValue*/
          r[26]
        )
      ], n = !0);
    },
    p(l, o) {
      if (o[0] & /*items*/
      2097152) {
        i = F1(
          /*items*/
          l[21]
        );
        let u;
        for (u = 0; u < i.length; u += 1) {
          const h = N1(l, i, u);
          s[u] ? s[u].p(h, o) : (s[u] = I1(h), s[u].c(), s[u].m(t, null));
        }
        for (; u < s.length; u += 1)
          s[u].d(1);
        s.length = i.length;
      }
      o[0] & /*sideToMove, items*/
      2129920 && z1(
        t,
        /*sideToMove*/
        l[15]
      );
    },
    d(l) {
      l && ve(e), K7(s, l), n = !1, J7(a);
    }
  };
}
function lg(r) {
  let e;
  return {
    c() {
      e = ht("i"), this.h();
    },
    l(t) {
      e = ct(t, "I", { class: !0 }), ln(e).forEach(ve), this.h();
    },
    h() {
      tt(e, "class", "fa-solid fa-arrows-rotate");
    },
    m(t, n) {
      ft(t, e, n);
    },
    p: Pi,
    d(t) {
      t && ve(e);
    }
  };
}
function og(r) {
  let e, t;
  return e = new ro({
    props: {
      label: "Flip",
      interactive: !0,
      $$slots: { default: [lg] },
      $$scope: { ctx: r }
    }
  }), e.$on(
    "click",
    /*click_handler*/
    r[33]
  ), {
    c() {
      Ze(e.$$.fragment);
    },
    l(n) {
      Xe(e.$$.fragment, n);
    },
    m(n, a) {
      Je(e, n, a), t = !0;
    },
    p(n, a) {
      const i = {};
      a[1] & /*$$scope*/
      131072 && (i.$$scope = { dirty: a, ctx: n }), e.$set(i);
    },
    i(n) {
      t || (Te(e.$$.fragment, n), t = !0);
    },
    o(n) {
      qe(e.$$.fragment, n), t = !1;
    },
    d(n) {
      Qe(e, n);
    }
  };
}
function ug(r) {
  let e;
  return {
    c() {
      e = ht("i"), this.h();
    },
    l(t) {
      e = ct(t, "I", { class: !0 }), ln(e).forEach(ve), this.h();
    },
    h() {
      tt(e, "class", "fa-solid fa-rotate-left");
    },
    m(t, n) {
      ft(t, e, n);
    },
    p: Pi,
    d(t) {
      t && ve(e);
    }
  };
}
function cg(r) {
  let e, t;
  return e = new ro({
    props: {
      label: "Reset",
      interactive: !0,
      $$slots: { default: [ug] },
      $$scope: { ctx: r }
    }
  }), e.$on(
    "click",
    /*resetBoard*/
    r[23]
  ), {
    c() {
      Ze(e.$$.fragment);
    },
    l(n) {
      Xe(e.$$.fragment, n);
    },
    m(n, a) {
      Je(e, n, a), t = !0;
    },
    p(n, a) {
      const i = {};
      a[1] & /*$$scope*/
      131072 && (i.$$scope = { dirty: a, ctx: n }), e.$set(i);
    },
    i(n) {
      t || (Te(e.$$.fragment, n), t = !0);
    },
    o(n) {
      qe(e.$$.fragment, n), t = !1;
    },
    d(n) {
      Qe(e, n);
    }
  };
}
function hg(r) {
  let e;
  return {
    c() {
      e = ht("i"), this.h();
    },
    l(t) {
      e = ct(t, "I", { class: !0 }), ln(e).forEach(ve), this.h();
    },
    h() {
      tt(e, "class", "fa-solid fa-trash");
    },
    m(t, n) {
      ft(t, e, n);
    },
    p: Pi,
    d(t) {
      t && ve(e);
    }
  };
}
function fg(r) {
  let e, t;
  return e = new ro({
    props: {
      label: "Clear",
      interactive: !0,
      $$slots: { default: [hg] },
      $$scope: { ctx: r }
    }
  }), e.$on(
    "click",
    /*clearBoard*/
    r[24]
  ), {
    c() {
      Ze(e.$$.fragment);
    },
    l(n) {
      Xe(e.$$.fragment, n);
    },
    m(n, a) {
      Je(e, n, a), t = !0;
    },
    p(n, a) {
      const i = {};
      a[1] & /*$$scope*/
      131072 && (i.$$scope = { dirty: a, ctx: n }), e.$set(i);
    },
    i(n) {
      t || (Te(e.$$.fragment, n), t = !0);
    },
    o(n) {
      qe(e.$$.fragment, n), t = !1;
    },
    d(n) {
      Qe(e, n);
    }
  };
}
function dg(r) {
  let e, t, n, a, i, s, l, o;
  return e = new Y0({
    props: {
      style: "flex: 0 0 50%",
      min_width: 200,
      $$slots: { default: [sg] },
      $$scope: { ctx: r }
    }
  }), n = new Y0({
    props: {
      style: "flex: 1",
      $$slots: { default: [og] },
      $$scope: { ctx: r }
    }
  }), i = new Y0({
    props: {
      style: "flex: 1",
      $$slots: { default: [cg] },
      $$scope: { ctx: r }
    }
  }), l = new Y0({
    props: {
      style: "flex: 1",
      $$slots: { default: [fg] },
      $$scope: { ctx: r }
    }
  }), {
    c() {
      Ze(e.$$.fragment), t = Bt(), Ze(n.$$.fragment), a = Bt(), Ze(i.$$.fragment), s = Bt(), Ze(l.$$.fragment);
    },
    l(u) {
      Xe(e.$$.fragment, u), t = zt(u), Xe(n.$$.fragment, u), a = zt(u), Xe(i.$$.fragment, u), s = zt(u), Xe(l.$$.fragment, u);
    },
    m(u, h) {
      Je(e, u, h), ft(u, t, h), Je(n, u, h), ft(u, a, h), Je(i, u, h), ft(u, s, h), Je(l, u, h), o = !0;
    },
    p(u, h) {
      const m = {};
      h[0] & /*sideToMove*/
      32768 | h[1] & /*$$scope*/
      131072 && (m.$$scope = { dirty: h, ctx: u }), e.$set(m);
      const d = {};
      h[0] & /*board, orientation*/
      16388 | h[1] & /*$$scope*/
      131072 && (d.$$scope = { dirty: h, ctx: u }), n.$set(d);
      const g = {};
      h[1] & /*$$scope*/
      131072 && (g.$$scope = { dirty: h, ctx: u }), i.$set(g);
      const b = {};
      h[1] & /*$$scope*/
      131072 && (b.$$scope = { dirty: h, ctx: u }), l.$set(b);
    },
    i(u) {
      o || (Te(e.$$.fragment, u), Te(n.$$.fragment, u), Te(i.$$.fragment, u), Te(l.$$.fragment, u), o = !0);
    },
    o(u) {
      qe(e.$$.fragment, u), qe(n.$$.fragment, u), qe(i.$$.fragment, u), qe(l.$$.fragment, u), o = !1;
    },
    d(u) {
      u && (ve(t), ve(a), ve(s)), Qe(e, u), Qe(n, u), Qe(i, u), Qe(l, u);
    }
  };
}
function mg(r) {
  let e, t = "White", n, a, i, s, l, o, u, h;
  function m(v) {
    r[34](v);
  }
  let d = { label: "(O‐O)", interactive: !0 };
  /*whiteKingside*/
  r[16] !== void 0 && (d.value = /*whiteKingside*/
  r[16]), i = new Ci({ props: d }), ca.push(() => ua(i, "value", m)), i.$on(
    "change",
    /*updateValue*/
    r[26]
  );
  function g(v) {
    r[35](v);
  }
  let b = { label: "(O‐O‐O)", interactive: !0 };
  return (
    /*whiteQueenside*/
    r[17] !== void 0 && (b.value = /*whiteQueenside*/
    r[17]), o = new Ci({ props: b }), ca.push(() => ua(o, "value", g)), o.$on(
      "change",
      /*updateValue*/
      r[26]
    ), {
      c() {
        e = ht("label"), e.textContent = t, n = Bt(), a = ht("div"), Ze(i.$$.fragment), l = Bt(), Ze(o.$$.fragment), this.h();
      },
      l(v) {
        e = ct(v, "LABEL", {
          class: !0,
          for: !0,
          "data-svelte-h": !0
        }), na(e) !== "svelte-bxm7jb" && (e.textContent = t), n = zt(v), a = ct(v, "DIV", { id: !0 });
        var w = ln(a);
        Xe(i.$$.fragment, w), l = zt(w), Xe(o.$$.fragment, w), w.forEach(ve), this.h();
      },
      h() {
        tt(e, "class", "header svelte-gikd8m"), tt(e, "for", "white-checkbox-group"), tt(a, "id", "white-checkbox-group");
      },
      m(v, w) {
        ft(v, e, w), ft(v, n, w), ft(v, a, w), Je(i, a, null), Dt(a, l), Je(o, a, null), h = !0;
      },
      p(v, w) {
        const x = {};
        !s && w[0] & /*whiteKingside*/
        65536 && (s = !0, x.value = /*whiteKingside*/
        v[16], oa(() => s = !1)), i.$set(x);
        const k = {};
        !u && w[0] & /*whiteQueenside*/
        131072 && (u = !0, k.value = /*whiteQueenside*/
        v[17], oa(() => u = !1)), o.$set(k);
      },
      i(v) {
        h || (Te(i.$$.fragment, v), Te(o.$$.fragment, v), h = !0);
      },
      o(v) {
        qe(i.$$.fragment, v), qe(o.$$.fragment, v), h = !1;
      },
      d(v) {
        v && (ve(e), ve(n), ve(a)), Qe(i), Qe(o);
      }
    }
  );
}
function pg(r) {
  let e, t = "Black", n, a, i, s, l, o, u, h;
  function m(v) {
    r[36](v);
  }
  let d = { label: "(O‐O)", interactive: !0 };
  /*blackKingside*/
  r[18] !== void 0 && (d.value = /*blackKingside*/
  r[18]), i = new Ci({ props: d }), ca.push(() => ua(i, "value", m)), i.$on(
    "change",
    /*updateValue*/
    r[26]
  );
  function g(v) {
    r[37](v);
  }
  let b = { label: "(O‐O‐O)", interactive: !0 };
  return (
    /*blackQueenside*/
    r[19] !== void 0 && (b.value = /*blackQueenside*/
    r[19]), o = new Ci({ props: b }), ca.push(() => ua(o, "value", g)), o.$on(
      "change",
      /*updateValue*/
      r[26]
    ), {
      c() {
        e = ht("label"), e.textContent = t, n = Bt(), a = ht("div"), Ze(i.$$.fragment), l = Bt(), Ze(o.$$.fragment), this.h();
      },
      l(v) {
        e = ct(v, "LABEL", {
          class: !0,
          for: !0,
          "data-svelte-h": !0
        }), na(e) !== "svelte-v755rv" && (e.textContent = t), n = zt(v), a = ct(v, "DIV", { id: !0 });
        var w = ln(a);
        Xe(i.$$.fragment, w), l = zt(w), Xe(o.$$.fragment, w), w.forEach(ve), this.h();
      },
      h() {
        tt(e, "class", "header svelte-gikd8m"), tt(e, "for", "black-checkbox-group"), tt(a, "id", "black-checkbox-group");
      },
      m(v, w) {
        ft(v, e, w), ft(v, n, w), ft(v, a, w), Je(i, a, null), Dt(a, l), Je(o, a, null), h = !0;
      },
      p(v, w) {
        const x = {};
        !s && w[0] & /*blackKingside*/
        262144 && (s = !0, x.value = /*blackKingside*/
        v[18], oa(() => s = !1)), i.$set(x);
        const k = {};
        !u && w[0] & /*blackQueenside*/
        524288 && (u = !0, k.value = /*blackQueenside*/
        v[19], oa(() => u = !1)), o.$set(k);
      },
      i(v) {
        h || (Te(i.$$.fragment, v), Te(o.$$.fragment, v), h = !0);
      },
      o(v) {
        qe(i.$$.fragment, v), qe(o.$$.fragment, v), h = !1;
      },
      d(v) {
        v && (ve(e), ve(n), ve(a)), Qe(i), Qe(o);
      }
    }
  );
}
function gg(r) {
  let e, t, n, a;
  return e = new Y0({
    props: {
      class: "checkbox‐group",
      style: "flex: 0 0 120px",
      $$slots: { default: [mg] },
      $$scope: { ctx: r }
    }
  }), n = new Y0({
    props: {
      class: "checkbox‐group",
      style: "flex: 0 0 120px",
      $$slots: { default: [pg] },
      $$scope: { ctx: r }
    }
  }), {
    c() {
      Ze(e.$$.fragment), t = Bt(), Ze(n.$$.fragment);
    },
    l(i) {
      Xe(e.$$.fragment, i), t = zt(i), Xe(n.$$.fragment, i);
    },
    m(i, s) {
      Je(e, i, s), ft(i, t, s), Je(n, i, s), a = !0;
    },
    p(i, s) {
      const l = {};
      s[0] & /*whiteQueenside, whiteKingside*/
      196608 | s[1] & /*$$scope*/
      131072 && (l.$$scope = { dirty: s, ctx: i }), e.$set(l);
      const o = {};
      s[0] & /*blackQueenside, blackKingside*/
      786432 | s[1] & /*$$scope*/
      131072 && (o.$$scope = { dirty: s, ctx: i }), n.$set(o);
    },
    i(i) {
      a || (Te(e.$$.fragment, i), Te(n.$$.fragment, i), a = !0);
    },
    o(i) {
      qe(e.$$.fragment, i), qe(n.$$.fragment, i), a = !1;
    },
    d(i) {
      i && ve(t), Qe(e, i), Qe(n, i);
    }
  };
}
function _g(r) {
  let e, t, n;
  function a(s) {
    r[38](s);
  }
  let i = { label: "" };
  return (
    /*value*/
    r[0] !== void 0 && (i.value = /*value*/
    r[0]), e = new n6({ props: i }), ca.push(() => ua(e, "value", a)), {
      c() {
        Ze(e.$$.fragment);
      },
      l(s) {
        Xe(e.$$.fragment, s);
      },
      m(s, l) {
        Je(e, s, l), n = !0;
      },
      p(s, l) {
        const o = {};
        !t && l[0] & /*value*/
        1 && (t = !0, o.value = /*value*/
        s[0], oa(() => t = !1)), e.$set(o);
      },
      i(s) {
        n || (Te(e.$$.fragment, s), n = !0);
      },
      o(s) {
        qe(e.$$.fragment, s), n = !1;
      },
      d(s) {
        Qe(e, s);
      }
    }
  );
}
function vg(r) {
  let e, t;
  return e = new Y0({
    props: {
      style: "flex: 1",
      $$slots: { default: [_g] },
      $$scope: { ctx: r }
    }
  }), {
    c() {
      Ze(e.$$.fragment);
    },
    l(n) {
      Xe(e.$$.fragment, n);
    },
    m(n, a) {
      Je(e, n, a), t = !0;
    },
    p(n, a) {
      const i = {};
      a[0] & /*value*/
      1 | a[1] & /*$$scope*/
      131072 && (i.$$scope = { dirty: a, ctx: n }), e.$set(i);
    },
    i(n) {
      t || (Te(e.$$.fragment, n), t = !0);
    },
    o(n) {
      qe(e.$$.fragment, n), t = !1;
    },
    d(n) {
      Qe(e, n);
    }
  };
}
function bg(r) {
  let e, t, n, a, i, s, l, o, u, h, m, d, g, b = !/*game_mode*/
  r[1] && /*loading_status*/
  r[11] && q1(r);
  n = new _h({
    props: {
      root: (
        /*root*/
        r[12]
      ),
      show_label: (
        /*show_label*/
        r[8]
      ),
      info: void 0,
      $$slots: { default: [ig] },
      $$scope: { ctx: r }
    }
  }), s = new x1({
    props: {
      display_value: "Play mode",
      internal_value: "game",
      selected: (
        /*selected*/
        r[13]
      )
    }
  }), s.$on(
    "input",
    /*input_handler*/
    r[30]
  ), o = new x1({
    props: {
      display_value: "Edit mode",
      internal_value: "edit",
      selected: (
        /*selected*/
        r[13]
      )
    }
  }), o.$on(
    "input",
    /*input_handler_1*/
    r[31]
  );
  let v = !/*game_mode*/
  r[1] && L1(r);
  return {
    c() {
      b && b.c(), e = Bt(), t = ht("div"), Ze(n.$$.fragment), a = Bt(), i = ht("div"), Ze(s.$$.fragment), l = Bt(), Ze(o.$$.fragment), u = Bt(), h = ht("div"), m = ht("div"), d = Bt(), v && v.c(), this.h();
    },
    l(w) {
      b && b.l(w), e = zt(w), t = ct(w, "DIV", { class: !0 });
      var x = ln(t);
      Xe(n.$$.fragment, x), a = zt(x), i = ct(x, "DIV", { class: !0 });
      var k = ln(i);
      Xe(s.$$.fragment, k), l = zt(k), Xe(o.$$.fragment, k), k.forEach(ve), u = zt(x), h = ct(x, "DIV", { class: !0 });
      var y = ln(h);
      m = ct(y, "DIV", { id: !0, style: !0 }), ln(m).forEach(ve), y.forEach(ve), d = zt(x), v && v.l(x), x.forEach(ve), this.h();
    },
    h() {
      tt(i, "class", "mode-selector svelte-gikd8m"), tt(
        m,
        "id",
        /*board_id*/
        r[20]
      ), ag(m, "width", "500px"), tt(h, "class", "board-container svelte-gikd8m"), tt(t, "class", "main-container svelte-gikd8m");
    },
    m(w, x) {
      b && b.m(w, x), ft(w, e, x), ft(w, t, x), Je(n, t, null), Dt(t, a), Dt(t, i), Je(s, i, null), Dt(i, l), Je(o, i, null), Dt(t, u), Dt(t, h), Dt(h, m), Dt(t, d), v && v.m(t, null), g = !0;
    },
    p(w, x) {
      !/*game_mode*/
      w[1] && /*loading_status*/
      w[11] ? b ? (b.p(w, x), x[0] & /*game_mode, loading_status*/
      2050 && Te(b, 1)) : (b = q1(w), b.c(), Te(b, 1), b.m(e.parentNode, e)) : b && (M1(), qe(b, 1, 1, () => {
        b = null;
      }), T1());
      const k = {};
      x[0] & /*root*/
      4096 && (k.root = /*root*/
      w[12]), x[0] & /*show_label*/
      256 && (k.show_label = /*show_label*/
      w[8]), x[0] & /*label*/
      16 | x[1] & /*$$scope*/
      131072 && (k.$$scope = { dirty: x, ctx: w }), n.$set(k);
      const y = {};
      x[0] & /*selected*/
      8192 && (y.selected = /*selected*/
      w[13]), s.$set(y);
      const A = {};
      x[0] & /*selected*/
      8192 && (A.selected = /*selected*/
      w[13]), o.$set(A), /*game_mode*/
      w[1] ? v && (M1(), qe(v, 1, 1, () => {
        v = null;
      }), T1()) : v ? (v.p(w, x), x[0] & /*game_mode*/
      2 && Te(v, 1)) : (v = L1(w), v.c(), Te(v, 1), v.m(t, null));
    },
    i(w) {
      g || (Te(b), Te(n.$$.fragment, w), Te(s.$$.fragment, w), Te(o.$$.fragment, w), Te(v), g = !0);
    },
    o(w) {
      qe(b), qe(n.$$.fragment, w), qe(s.$$.fragment, w), qe(o.$$.fragment, w), qe(v), g = !1;
    },
    d(w) {
      w && (ve(e), ve(t)), b && b.d(w), Qe(n), Qe(s), Qe(o), v && v.d();
    }
  };
}
function yg(r) {
  let e, t = "", n, a, i, s, l = "", o, u, h = `[class*="spare-pieces"] {
			display: flex !important;
			flex-direction: row !important;
			justify-content: center !important;
		}`, m, d, g, b, v;
  return d = new yf({
    props: {
      visible: (
        /*visible*/
        r[7]
      ),
      elem_id: (
        /*elem_id*/
        r[5]
      ),
      elem_classes: (
        /*elem_classes*/
        r[6]
      ),
      scale: (
        /*scale*/
        r[9]
      ),
      min_width: (
        /*min_width*/
        r[10]
      ),
      $$slots: { default: [bg] },
      $$scope: { ctx: r }
    }
  }), {
    c() {
      e = ht("script"), e.innerHTML = t, a = ht("link"), i = ht("link"), s = ht("script"), s.innerHTML = l, u = ht("style"), u.textContent = h, m = Bt(), Ze(d.$$.fragment), this.h();
    },
    l(w) {
      const x = Z7("svelte-9s06f8", document.head);
      e = ct(x, "SCRIPT", { src: !0, "data-svelte-h": !0 }), na(e) !== "svelte-1ds4dxo" && (e.innerHTML = t), a = ct(x, "LINK", { rel: !0, href: !0 }), i = ct(x, "LINK", { rel: !0, href: !0 }), s = ct(x, "SCRIPT", { src: !0, "data-svelte-h": !0 }), na(s) !== "svelte-16g0mo4" && (s.innerHTML = l), u = ct(x, "STYLE", { "data-svelte-h": !0 }), na(u) !== "svelte-y69n3l" && (u.textContent = h), x.forEach(ve), m = zt(w), Xe(d.$$.fragment, w), this.h();
    },
    h() {
      B1(e.src, n = "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js") || tt(e, "src", n), e.defer = !0, tt(a, "rel", "stylesheet"), tt(a, "href", "https://cdnjs.cloudflare.com/ajax/libs/chessboard-js/1.0.0/chessboard-1.0.0.min.css"), tt(i, "rel", "stylesheet"), tt(i, "href", "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"), B1(s.src, o = "https://cdnjs.cloudflare.com/ajax/libs/chessboard-js/1.0.0/chessboard-1.0.0.js") || tt(s, "src", o), s.defer = !0;
    },
    m(w, x) {
      Dt(document.head, e), Dt(document.head, a), Dt(document.head, i), Dt(document.head, s), Dt(document.head, u), ft(w, m, x), Je(d, w, x), g = !0, b || (v = wl(
        s,
        "load",
        /*initBoard*/
        r[22]
      ), b = !0);
    },
    p(w, x) {
      const k = {};
      x[0] & /*visible*/
      128 && (k.visible = /*visible*/
      w[7]), x[0] & /*elem_id*/
      32 && (k.elem_id = /*elem_id*/
      w[5]), x[0] & /*elem_classes*/
      64 && (k.elem_classes = /*elem_classes*/
      w[6]), x[0] & /*scale*/
      512 && (k.scale = /*scale*/
      w[9]), x[0] & /*min_width*/
      1024 && (k.min_width = /*min_width*/
      w[10]), x[0] & /*value, blackQueenside, blackKingside, whiteQueenside, whiteKingside, board, orientation, sideToMove, game_mode, selected, root, show_label, label, gradio, loading_status*/
      1046815 | x[1] & /*$$scope*/
      131072 && (k.$$scope = { dirty: x, ctx: w }), d.$set(k);
    },
    i(w) {
      g || (Te(d.$$.fragment, w), g = !0);
    },
    o(w) {
      qe(d.$$.fragment, w), g = !1;
    },
    d(w) {
      w && ve(m), ve(e), ve(a), ve(i), ve(s), ve(u), Qe(d, w), b = !1, v();
    }
  };
}
function wg(r, e, t) {
  let { gradio: n } = e, { label: a = "Chessboard" } = e, { elem_id: i = "" } = e, { elem_classes: s = [] } = e, { visible: l = !0 } = e, { value: o = new Qa().fen() } = e, { show_label: u } = e, { scale: h = null } = e, { min_width: m = void 0 } = e, { loading_status: d = void 0 } = e, { value_is_output: g = !1 } = e, { interactive: b } = e, { game_mode: v = !1 } = e, { orientation: w = "white" } = e, { root: x } = e, k = "game", y = new Qa(o), A, $ = "board_" + Math.random().toString(36).substring(2, 15), M = "White to move", z = !0, O = !0, L = !0, K = !0, X = [
    {
      label: "White to move",
      value: "White to move"
    },
    {
      label: "Black to move",
      value: "Black to move"
    }
  ];
  const J = () => {
    v ? t(14, A = Chessboard($, {
      draggable: b,
      position: y.fen(),
      orientation: w,
      pieceTheme: "https://chessboardjs.com/img/chesspieces/wikipedia/{piece}.png",
      onDrop: ke,
      onDragStart: Oe
    })) : t(14, A = Chessboard($, {
      draggable: b,
      position: y.fen(),
      orientation: w,
      pieceTheme: "https://chessboardjs.com/img/chesspieces/wikipedia/{piece}.png",
      sparePieces: !0,
      dropOffBoard: "trash",
      onChange: Be
    }));
  };
  function Se() {
    y.reset(), A.start(), t(0, o = y.fen()), t(15, M = "White to move"), t(16, z = !0), t(17, O = !0), t(18, L = !0), t(19, K = !0);
  }
  function _e() {
    y.clear(), A.clear(), t(0, o = y.fen()), t(15, M = "White to move"), t(16, z = !1), t(17, O = !1), t(18, L = !1), t(19, K = !1);
  }
  function ge(Q) {
    t(13, k = String(Q)), t(1, v = k === "game"), J();
  }
  function Ae() {
    (o === null || o === "") && t(0, o = new Qa().fen()), A !== void 0 && (A.position(o), y.load(o, { skipValidation: !0 }), n.dispatch("change"));
  }
  function Oe(Q, je, Fe, Zt) {
    if (y.isGameOver() || y.turn() === "w" && je.search(/^b/) !== -1 || y.turn() === "b" && je.search(/^w/) !== -1)
      return !1;
  }
  function ke(Q, je) {
    try {
      var Fe = y.move({
        from: Q,
        to: je,
        promotion: "q"
        // NOTE: always promote to a queen for now
      });
    } catch {
      return "snapback";
    }
    if (Fe === null) return "snapback";
    t(0, o = y.fen()), n.dispatch("move");
  }
  function Be(Q, je) {
    const Fe = Chessboard.objToFen(je);
    t(0, o = I(Fe));
  }
  function Ee(Q) {
    t(0, o = I(A.fen()));
  }
  function I(Q) {
    let je = M === "White to move" ? "w" : "b", Fe = "";
    return z && (Fe += "K"), O && (Fe += "Q"), L && (Fe += "k"), K && (Fe += "q"), Fe === "" && (Fe = "-"), `${Q} ${je} ${Fe} - 0 1`;
  }
  const be = () => n.dispatch("clear_status", d), ye = (Q) => ge(Q.detail), Ie = (Q) => ge(Q.detail);
  function H() {
    M = tg(this), t(15, M), t(21, X);
  }
  const nt = () => {
    A.flip(), t(2, w = A.orientation());
  };
  function Pe(Q) {
    z = Q, t(16, z);
  }
  function mt(Q) {
    O = Q, t(17, O);
  }
  function vt(Q) {
    L = Q, t(18, L);
  }
  function xt(Q) {
    K = Q, t(19, K);
  }
  function Nt(Q) {
    o = Q, t(0, o);
  }
  return r.$$set = (Q) => {
    "gradio" in Q && t(3, n = Q.gradio), "label" in Q && t(4, a = Q.label), "elem_id" in Q && t(5, i = Q.elem_id), "elem_classes" in Q && t(6, s = Q.elem_classes), "visible" in Q && t(7, l = Q.visible), "value" in Q && t(0, o = Q.value), "show_label" in Q && t(8, u = Q.show_label), "scale" in Q && t(9, h = Q.scale), "min_width" in Q && t(10, m = Q.min_width), "loading_status" in Q && t(11, d = Q.loading_status), "value_is_output" in Q && t(27, g = Q.value_is_output), "interactive" in Q && t(28, b = Q.interactive), "game_mode" in Q && t(1, v = Q.game_mode), "orientation" in Q && t(2, w = Q.orientation), "root" in Q && t(12, x = Q.root);
  }, r.$$.update = () => {
    r.$$.dirty[0] & /*value*/
    1 && o === null && t(0, o = new Qa().fen()), r.$$.dirty[0] & /*value*/
    1 && Ae();
  }, [
    o,
    v,
    w,
    n,
    a,
    i,
    s,
    l,
    u,
    h,
    m,
    d,
    x,
    k,
    A,
    M,
    z,
    O,
    L,
    K,
    $,
    X,
    J,
    Se,
    _e,
    ge,
    Ee,
    g,
    b,
    be,
    ye,
    Ie,
    H,
    nt,
    Pe,
    mt,
    vt,
    xt,
    Nt
  ];
}
class Sq extends j7 {
  constructor(e) {
    super(), Q7(
      this,
      e,
      wg,
      yg,
      eg,
      {
        gradio: 3,
        label: 4,
        elem_id: 5,
        elem_classes: 6,
        visible: 7,
        value: 0,
        show_label: 8,
        scale: 9,
        min_width: 10,
        loading_status: 11,
        value_is_output: 27,
        interactive: 28,
        game_mode: 1,
        orientation: 2,
        root: 12
      },
      null,
      [-1, -1]
    );
  }
}
export {
  Sq as I,
  eu as c,
  Dg as g,
  Sg as k,
  zF as p
};
