const {
  SvelteComponent: Tc,
  append_hydration: Rs,
  attr: ln,
  children: xr,
  claim_svg_element: Er,
  detach: tr,
  init: Cc,
  insert_hydration: Dc,
  noop: Ls,
  safe_not_equal: Fc,
  set_style: yn,
  svg_element: _r
} = window.__gradio__svelte__internal;
function Mc(i) {
  let e, t, n, r;
  return {
    c() {
      e = _r("svg"), t = _r("g"), n = _r("path"), r = _r("path"), this.h();
    },
    l(s) {
      e = Er(s, "svg", {
        width: !0,
        height: !0,
        viewBox: !0,
        version: !0,
        xmlns: !0,
        "xmlns:xlink": !0,
        "xml:space": !0,
        stroke: !0,
        style: !0
      });
      var u = xr(e);
      t = Er(u, "g", { transform: !0 });
      var l = xr(t);
      n = Er(l, "path", { d: !0, style: !0 }), xr(n).forEach(tr), l.forEach(tr), r = Er(u, "path", { d: !0, style: !0 }), xr(r).forEach(tr), u.forEach(tr), this.h();
    },
    h() {
      ln(n, "d", "M18,6L6.087,17.913"), yn(n, "fill", "none"), yn(n, "fill-rule", "nonzero"), yn(n, "stroke-width", "2px"), ln(t, "transform", "matrix(1.14096,-0.140958,-0.140958,1.14096,-0.0559523,0.0559523)"), ln(r, "d", "M4.364,4.364L19.636,19.636"), yn(r, "fill", "none"), yn(r, "fill-rule", "nonzero"), yn(r, "stroke-width", "2px"), ln(e, "width", "100%"), ln(e, "height", "100%"), ln(e, "viewBox", "0 0 24 24"), ln(e, "version", "1.1"), ln(e, "xmlns", "http://www.w3.org/2000/svg"), ln(e, "xmlns:xlink", "http://www.w3.org/1999/xlink"), ln(e, "xml:space", "preserve"), ln(e, "stroke", "currentColor"), yn(e, "fill-rule", "evenodd"), yn(e, "clip-rule", "evenodd"), yn(e, "stroke-linecap", "round"), yn(e, "stroke-linejoin", "round");
    },
    m(s, u) {
      Dc(s, e, u), Rs(e, t), Rs(t, n), Rs(e, r);
    },
    p: Ls,
    i: Ls,
    o: Ls,
    d(s) {
      s && tr(e);
    }
  };
}
class N0 extends Tc {
  constructor(e) {
    super(), Cc(this, e, null, Mc, Fc, {});
  }
}
const {
  SvelteComponent: Rc,
  append_hydration: Lc,
  attr: Pi,
  children: _o,
  claim_svg_element: To,
  detach: Is,
  init: Ic,
  insert_hydration: Nc,
  noop: Ns,
  safe_not_equal: Pc,
  svg_element: Co
} = window.__gradio__svelte__internal;
function Bc(i) {
  let e, t;
  return {
    c() {
      e = Co("svg"), t = Co("path"), this.h();
    },
    l(n) {
      e = To(n, "svg", {
        xmlns: !0,
        width: !0,
        height: !0,
        viewBox: !0
      });
      var r = _o(e);
      t = To(r, "path", { fill: !0, d: !0 }), _o(t).forEach(Is), r.forEach(Is), this.h();
    },
    h() {
      Pi(t, "fill", "currentColor"), Pi(t, "d", "M26 24v4H6v-4H4v4a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2v-4zm0-10l-1.41-1.41L17 20.17V2h-2v18.17l-7.59-7.58L6 14l10 10l10-10z"), Pi(e, "xmlns", "http://www.w3.org/2000/svg"), Pi(e, "width", "100%"), Pi(e, "height", "100%"), Pi(e, "viewBox", "0 0 32 32");
    },
    m(n, r) {
      Nc(n, e, r), Lc(e, t);
    },
    p: Ns,
    i: Ns,
    o: Ns,
    d(n) {
      n && Is(e);
    }
  };
}
class zc extends Rc {
  constructor(e) {
    super(), Ic(this, e, null, Bc, Pc, {});
  }
}
const {
  SvelteComponent: Oc,
  append_hydration: Hc,
  attr: un,
  children: Do,
  claim_svg_element: Fo,
  detach: Ps,
  init: qc,
  insert_hydration: Uc,
  noop: Bs,
  safe_not_equal: Vc,
  svg_element: Mo
} = window.__gradio__svelte__internal;
function Gc(i) {
  let e, t;
  return {
    c() {
      e = Mo("svg"), t = Mo("path"), this.h();
    },
    l(n) {
      e = Fo(n, "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 r = Do(e);
      t = Fo(r, "path", { d: !0 }), Do(t).forEach(Ps), r.forEach(Ps), this.h();
    },
    h() {
      un(t, "d", "M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"), un(e, "xmlns", "http://www.w3.org/2000/svg"), un(e, "width", "100%"), un(e, "height", "100%"), un(e, "viewBox", "0 0 24 24"), un(e, "fill", "none"), un(e, "stroke", "currentColor"), un(e, "stroke-width", "1.5"), un(e, "stroke-linecap", "round"), un(e, "stroke-linejoin", "round"), un(e, "class", "feather feather-edit-2");
    },
    m(n, r) {
      Uc(n, e, r), Hc(e, t);
    },
    p: Bs,
    i: Bs,
    o: Bs,
    d(n) {
      n && Ps(e);
    }
  };
}
class Xc extends Oc {
  constructor(e) {
    super(), qc(this, e, null, Gc, Vc, {});
  }
}
const {
  SvelteComponent: jc,
  append_hydration: Ro,
  attr: Yt,
  children: zs,
  claim_svg_element: Os,
  detach: Tr,
  init: Yc,
  insert_hydration: Wc,
  noop: Hs,
  safe_not_equal: $c,
  svg_element: qs
} = window.__gradio__svelte__internal;
function Kc(i) {
  let e, t, n;
  return {
    c() {
      e = qs("svg"), t = qs("path"), n = qs("polyline"), this.h();
    },
    l(r) {
      e = Os(r, "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 s = zs(e);
      t = Os(s, "path", { d: !0 }), zs(t).forEach(Tr), n = Os(s, "polyline", { points: !0 }), zs(n).forEach(Tr), s.forEach(Tr), this.h();
    },
    h() {
      Yt(t, "d", "M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"), Yt(n, "points", "13 2 13 9 20 9"), Yt(e, "xmlns", "http://www.w3.org/2000/svg"), Yt(e, "width", "100%"), Yt(e, "height", "100%"), Yt(e, "viewBox", "0 0 24 24"), Yt(e, "fill", "none"), Yt(e, "stroke", "currentColor"), Yt(e, "stroke-width", "1.5"), Yt(e, "stroke-linecap", "round"), Yt(e, "stroke-linejoin", "round"), Yt(e, "class", "feather feather-file");
    },
    m(r, s) {
      Wc(r, e, s), Ro(e, t), Ro(e, n);
    },
    p: Hs,
    i: Hs,
    o: Hs,
    d(r) {
      r && Tr(e);
    }
  };
}
let Zc = class extends jc {
  constructor(e) {
    super(), Yc(this, e, null, Kc, $c, {});
  }
};
const {
  SvelteComponent: Qc,
  append_hydration: Lo,
  attr: Pt,
  children: Us,
  claim_svg_element: Vs,
  detach: Cr,
  init: Jc,
  insert_hydration: eh,
  noop: Gs,
  safe_not_equal: th,
  svg_element: Xs
} = window.__gradio__svelte__internal;
function nh(i) {
  let e, t, n;
  return {
    c() {
      e = Xs("svg"), t = Xs("polyline"), n = Xs("path"), this.h();
    },
    l(r) {
      e = Vs(r, "svg", {
        "aria-label": !0,
        xmlns: !0,
        width: !0,
        height: !0,
        viewBox: !0,
        fill: !0,
        stroke: !0,
        "stroke-width": !0,
        "stroke-linecap": !0,
        "stroke-linejoin": !0,
        class: !0
      });
      var s = Us(e);
      t = Vs(s, "polyline", { points: !0 }), Us(t).forEach(Cr), n = Vs(s, "path", { d: !0 }), Us(n).forEach(Cr), s.forEach(Cr), this.h();
    },
    h() {
      Pt(t, "points", "1 4 1 10 7 10"), Pt(n, "d", "M3.51 15a9 9 0 1 0 2.13-9.36L1 10"), Pt(e, "aria-label", "undo"), Pt(e, "xmlns", "http://www.w3.org/2000/svg"), Pt(e, "width", "100%"), Pt(e, "height", "100%"), Pt(e, "viewBox", "0 0 24 24"), Pt(e, "fill", "none"), Pt(e, "stroke", "currentColor"), Pt(e, "stroke-width", "1.5"), Pt(e, "stroke-linecap", "round"), Pt(e, "stroke-linejoin", "round"), Pt(e, "class", "feather feather-rotate-ccw");
    },
    m(r, s) {
      eh(r, e, s), Lo(e, t), Lo(e, n);
    },
    p: Gs,
    i: Gs,
    o: Gs,
    d(r) {
      r && Cr(e);
    }
  };
}
class ih extends Qc {
  constructor(e) {
    super(), Jc(this, e, null, nh, th, {});
  }
}
const {
  SvelteComponent: rh,
  append_hydration: js,
  attr: yt,
  children: Dr,
  claim_svg_element: Fr,
  detach: nr,
  init: sh,
  insert_hydration: ah,
  noop: Ys,
  safe_not_equal: oh,
  svg_element: Mr
} = window.__gradio__svelte__internal;
function lh(i) {
  let e, t, n, r;
  return {
    c() {
      e = Mr("svg"), t = Mr("path"), n = Mr("polyline"), r = Mr("line"), this.h();
    },
    l(s) {
      e = Fr(s, "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 u = Dr(e);
      t = Fr(u, "path", { d: !0 }), Dr(t).forEach(nr), n = Fr(u, "polyline", { points: !0 }), Dr(n).forEach(nr), r = Fr(u, "line", { x1: !0, y1: !0, x2: !0, y2: !0 }), Dr(r).forEach(nr), u.forEach(nr), this.h();
    },
    h() {
      yt(t, "d", "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"), yt(n, "points", "17 8 12 3 7 8"), yt(r, "x1", "12"), yt(r, "y1", "3"), yt(r, "x2", "12"), yt(r, "y2", "15"), yt(e, "xmlns", "http://www.w3.org/2000/svg"), yt(e, "width", "90%"), yt(e, "height", "90%"), yt(e, "viewBox", "0 0 24 24"), yt(e, "fill", "none"), yt(e, "stroke", "currentColor"), yt(e, "stroke-width", "2"), yt(e, "stroke-linecap", "round"), yt(e, "stroke-linejoin", "round"), yt(e, "class", "feather feather-upload");
    },
    m(s, u) {
      ah(s, e, u), js(e, t), js(e, n), js(e, r);
    },
    p: Ys,
    i: Ys,
    o: Ys,
    d(s) {
      s && nr(e);
    }
  };
}
let uh = class extends rh {
  constructor(e) {
    super(), sh(this, e, null, lh, oh, {});
  }
};
const {
  SvelteComponent: ch,
  append_hydration: Rr,
  attr: Ws,
  children: Io,
  claim_component: hh,
  claim_element: $s,
  claim_text: No,
  create_component: dh,
  destroy_component: fh,
  detach: Ks,
  element: Zs,
  get_svelte_dataset: mh,
  init: ph,
  insert_hydration: gh,
  mount_component: bh,
  safe_not_equal: vh,
  text: Po,
  toggle_class: Bo,
  transition_in: yh,
  transition_out: wh
} = window.__gradio__svelte__internal;
function Ah(i) {
  let e, t, n, r, s, u = "- or -", l, o;
  return n = new uh({}), {
    c() {
      e = Zs("div"), t = Zs("span"), dh(n.$$.fragment), r = Po(`
    Drop PDF
    `), s = Zs("span"), s.textContent = u, l = Po(`
    Click to Upload`), this.h();
    },
    l(h) {
      e = $s(h, "DIV", { class: !0 });
      var d = Io(e);
      t = $s(d, "SPAN", { class: !0 });
      var c = Io(t);
      hh(n.$$.fragment, c), c.forEach(Ks), r = No(d, `
    Drop PDF
    `), s = $s(d, "SPAN", { class: !0, "data-svelte-h": !0 }), mh(s) !== "svelte-1c66qmz" && (s.textContent = u), l = No(d, `
    Click to Upload`), d.forEach(Ks), this.h();
    },
    h() {
      Ws(t, "class", "icon-wrap svelte-kzcjhc"), Bo(
        t,
        "hovered",
        /*hovered*/
        i[0]
      ), Ws(s, "class", "or svelte-kzcjhc"), Ws(e, "class", "wrap svelte-kzcjhc");
    },
    m(h, d) {
      gh(h, e, d), Rr(e, t), bh(n, t, null), Rr(e, r), Rr(e, s), Rr(e, l), o = !0;
    },
    p(h, [d]) {
      (!o || d & /*hovered*/
      1) && Bo(
        t,
        "hovered",
        /*hovered*/
        h[0]
      );
    },
    i(h) {
      o || (yh(n.$$.fragment, h), o = !0);
    },
    o(h) {
      wh(n.$$.fragment, h), o = !1;
    },
    d(h) {
      h && Ks(e), fh(n);
    }
  };
}
function kh(i, e, t) {
  let { hovered: n = !1 } = e;
  return i.$$set = (r) => {
    "hovered" in r && t(0, n = r.hovered);
  }, [n];
}
class Sh extends ch {
  constructor(e) {
    super(), ph(this, e, kh, Ah, vh, { hovered: 0 });
  }
}
const {
  SvelteComponent: xh,
  assign: Eh,
  children: _h,
  claim_element: Th,
  create_slot: Ch,
  detach: zo,
  element: Dh,
  get_all_dirty_from_scope: Fh,
  get_slot_changes: Mh,
  get_spread_update: Rh,
  init: Lh,
  insert_hydration: Ih,
  safe_not_equal: Nh,
  set_dynamic_element_data: Oo,
  set_style: pt,
  toggle_class: Wt,
  transition_in: P0,
  transition_out: B0,
  update_slot_base: Ph
} = window.__gradio__svelte__internal;
function Bh(i) {
  let e, t, n;
  const r = (
    /*#slots*/
    i[22].default
  ), s = Ch(
    r,
    i,
    /*$$scope*/
    i[21],
    null
  );
  let u = [
    { "data-testid": (
      /*test_id*/
      i[10]
    ) },
    { id: (
      /*elem_id*/
      i[5]
    ) },
    {
      class: t = "block " + /*elem_classes*/
      i[6].join(" ") + " svelte-1ezsyiy"
    }
  ], l = {};
  for (let o = 0; o < u.length; o += 1)
    l = Eh(l, u[o]);
  return {
    c() {
      e = Dh(
        /*tag*/
        i[18]
      ), s && s.c(), this.h();
    },
    l(o) {
      e = Th(
        o,
        /*tag*/
        (i[18] || "null").toUpperCase(),
        {
          "data-testid": !0,
          id: !0,
          class: !0
        }
      );
      var h = _h(e);
      s && s.l(h), h.forEach(zo), this.h();
    },
    h() {
      Oo(
        /*tag*/
        i[18]
      )(e, l), Wt(
        e,
        "hidden",
        /*visible*/
        i[13] === !1
      ), Wt(
        e,
        "padded",
        /*padding*/
        i[9]
      ), Wt(
        e,
        "flex",
        /*flex*/
        i[0]
      ), Wt(
        e,
        "border_focus",
        /*border_mode*/
        i[8] === "focus"
      ), Wt(
        e,
        "border_contrast",
        /*border_mode*/
        i[8] === "contrast"
      ), Wt(e, "hide-container", !/*explicit_call*/
      i[11] && !/*container*/
      i[12]), pt(
        e,
        "height",
        /*get_dimension*/
        i[19](
          /*height*/
          i[1]
        )
      ), pt(
        e,
        "min-height",
        /*get_dimension*/
        i[19](
          /*min_height*/
          i[2]
        )
      ), pt(
        e,
        "max-height",
        /*get_dimension*/
        i[19](
          /*max_height*/
          i[3]
        )
      ), pt(e, "width", typeof /*width*/
      i[4] == "number" ? `calc(min(${/*width*/
      i[4]}px, 100%))` : (
        /*get_dimension*/
        i[19](
          /*width*/
          i[4]
        )
      )), pt(
        e,
        "border-style",
        /*variant*/
        i[7]
      ), pt(
        e,
        "overflow",
        /*allow_overflow*/
        i[14] ? (
          /*overflow_behavior*/
          i[15]
        ) : "hidden"
      ), pt(
        e,
        "flex-grow",
        /*scale*/
        i[16]
      ), pt(e, "min-width", `calc(min(${/*min_width*/
      i[17]}px, 100%))`), pt(e, "border-width", "var(--block-border-width)");
    },
    m(o, h) {
      Ih(o, e, h), s && s.m(e, null), n = !0;
    },
    p(o, h) {
      s && s.p && (!n || h & /*$$scope*/
      2097152) && Ph(
        s,
        r,
        o,
        /*$$scope*/
        o[21],
        n ? Mh(
          r,
          /*$$scope*/
          o[21],
          h,
          null
        ) : Fh(
          /*$$scope*/
          o[21]
        ),
        null
      ), Oo(
        /*tag*/
        o[18]
      )(e, l = Rh(u, [
        (!n || h & /*test_id*/
        1024) && { "data-testid": (
          /*test_id*/
          o[10]
        ) },
        (!n || h & /*elem_id*/
        32) && { id: (
          /*elem_id*/
          o[5]
        ) },
        (!n || h & /*elem_classes*/
        64 && t !== (t = "block " + /*elem_classes*/
        o[6].join(" ") + " svelte-1ezsyiy")) && { class: t }
      ])), Wt(
        e,
        "hidden",
        /*visible*/
        o[13] === !1
      ), Wt(
        e,
        "padded",
        /*padding*/
        o[9]
      ), Wt(
        e,
        "flex",
        /*flex*/
        o[0]
      ), Wt(
        e,
        "border_focus",
        /*border_mode*/
        o[8] === "focus"
      ), Wt(
        e,
        "border_contrast",
        /*border_mode*/
        o[8] === "contrast"
      ), Wt(e, "hide-container", !/*explicit_call*/
      o[11] && !/*container*/
      o[12]), h & /*height*/
      2 && pt(
        e,
        "height",
        /*get_dimension*/
        o[19](
          /*height*/
          o[1]
        )
      ), h & /*min_height*/
      4 && pt(
        e,
        "min-height",
        /*get_dimension*/
        o[19](
          /*min_height*/
          o[2]
        )
      ), h & /*max_height*/
      8 && pt(
        e,
        "max-height",
        /*get_dimension*/
        o[19](
          /*max_height*/
          o[3]
        )
      ), h & /*width*/
      16 && pt(e, "width", typeof /*width*/
      o[4] == "number" ? `calc(min(${/*width*/
      o[4]}px, 100%))` : (
        /*get_dimension*/
        o[19](
          /*width*/
          o[4]
        )
      )), h & /*variant*/
      128 && pt(
        e,
        "border-style",
        /*variant*/
        o[7]
      ), h & /*allow_overflow, overflow_behavior*/
      49152 && pt(
        e,
        "overflow",
        /*allow_overflow*/
        o[14] ? (
          /*overflow_behavior*/
          o[15]
        ) : "hidden"
      ), h & /*scale*/
      65536 && pt(
        e,
        "flex-grow",
        /*scale*/
        o[16]
      ), h & /*min_width*/
      131072 && pt(e, "min-width", `calc(min(${/*min_width*/
      o[17]}px, 100%))`);
    },
    i(o) {
      n || (P0(s, o), n = !0);
    },
    o(o) {
      B0(s, o), n = !1;
    },
    d(o) {
      o && zo(e), s && s.d(o);
    }
  };
}
function zh(i) {
  let e, t = (
    /*tag*/
    i[18] && Bh(i)
  );
  return {
    c() {
      t && t.c();
    },
    l(n) {
      t && t.l(n);
    },
    m(n, r) {
      t && t.m(n, r), e = !0;
    },
    p(n, [r]) {
      /*tag*/
      n[18] && t.p(n, r);
    },
    i(n) {
      e || (P0(t, n), e = !0);
    },
    o(n) {
      B0(t, n), e = !1;
    },
    d(n) {
      t && t.d(n);
    }
  };
}
function Oh(i, e, t) {
  let { $$slots: n = {}, $$scope: r } = e, { height: s = void 0 } = e, { min_height: u = void 0 } = e, { max_height: l = void 0 } = e, { width: o = void 0 } = e, { elem_id: h = "" } = e, { elem_classes: d = [] } = e, { variant: c = "solid" } = e, { border_mode: f = "base" } = e, { padding: g = !0 } = e, { type: A = "normal" } = e, { test_id: m = void 0 } = e, { explicit_call: k = !1 } = e, { container: a = !0 } = e, { visible: p = !0 } = e, { allow_overflow: b = !0 } = e, { overflow_behavior: y = "auto" } = e, { scale: C = null } = e, { min_width: M = 0 } = e, { flex: L = !1 } = e;
  p || (L = !1);
  let P = A === "fieldset" ? "fieldset" : "div";
  const O = (q) => {
    if (q !== void 0) {
      if (typeof q == "number")
        return q + "px";
      if (typeof q == "string")
        return q;
    }
  };
  return i.$$set = (q) => {
    "height" in q && t(1, s = q.height), "min_height" in q && t(2, u = q.min_height), "max_height" in q && t(3, l = q.max_height), "width" in q && t(4, o = q.width), "elem_id" in q && t(5, h = q.elem_id), "elem_classes" in q && t(6, d = q.elem_classes), "variant" in q && t(7, c = q.variant), "border_mode" in q && t(8, f = q.border_mode), "padding" in q && t(9, g = q.padding), "type" in q && t(20, A = q.type), "test_id" in q && t(10, m = q.test_id), "explicit_call" in q && t(11, k = q.explicit_call), "container" in q && t(12, a = q.container), "visible" in q && t(13, p = q.visible), "allow_overflow" in q && t(14, b = q.allow_overflow), "overflow_behavior" in q && t(15, y = q.overflow_behavior), "scale" in q && t(16, C = q.scale), "min_width" in q && t(17, M = q.min_width), "flex" in q && t(0, L = q.flex), "$$scope" in q && t(21, r = q.$$scope);
  }, [
    L,
    s,
    u,
    l,
    o,
    h,
    d,
    c,
    f,
    g,
    m,
    k,
    a,
    p,
    b,
    y,
    C,
    M,
    P,
    O,
    A,
    r,
    n
  ];
}
class Hh extends xh {
  constructor(e) {
    super(), Lh(this, e, Oh, zh, Nh, {
      height: 1,
      min_height: 2,
      max_height: 3,
      width: 4,
      elem_id: 5,
      elem_classes: 6,
      variant: 7,
      border_mode: 8,
      padding: 9,
      type: 20,
      test_id: 10,
      explicit_call: 11,
      container: 12,
      visible: 13,
      allow_overflow: 14,
      overflow_behavior: 15,
      scale: 16,
      min_width: 17,
      flex: 0
    });
  }
}
const qh = [
  { 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 }
], Ho = {
  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"
  }
};
qh.reduce(
  (i, { color: e, primary: t, secondary: n }) => ({
    ...i,
    [e]: {
      primary: Ho[e][t],
      secondary: Ho[e][n]
    }
  }),
  {}
);
class Ua {
  // 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 Ua(e.loc.lexer, e.loc.start, t.loc.end) : e && e.loc;
  }
}
class Va {
  // 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 Va(t, Ua.range(this, e));
  }
}
class Re {
  // 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, r, s, u = t && t.loc;
    if (u && u.start <= u.end) {
      var l = u.lexer.input;
      r = u.start, s = u.end, r === l.length ? n += " at end of input: " : n += " at position " + (r + 1) + ": ";
      var o = l.slice(r, s).replace(/[^]/g, "$&̲"), h;
      r > 15 ? h = "…" + l.slice(r - 15, r) : h = l.slice(0, r);
      var d;
      s + 15 < l.length ? d = l.slice(s, s + 15) + "…" : d = l.slice(s), n += h + o + d;
    }
    var c = new Error(n);
    return c.name = "ParseError", c.__proto__ = Re.prototype, c.position = r, r != null && s != null && (c.length = s - r), c.rawMessage = e, c;
  }
}
Re.prototype.__proto__ = Error.prototype;
var Uh = function(e, t) {
  return e.indexOf(t) !== -1;
}, Vh = function(e, t) {
  return e === void 0 ? t : e;
}, Gh = /([A-Z])/g, Xh = function(e) {
  return e.replace(Gh, "-$1").toLowerCase();
}, jh = {
  "&": "&amp;",
  ">": "&gt;",
  "<": "&lt;",
  '"': "&quot;",
  "'": "&#x27;"
}, Yh = /[&><"']/g;
function Wh(i) {
  return String(i).replace(Yh, (e) => jh[e]);
}
var z0 = function i(e) {
  return e.type === "ordgroup" || e.type === "color" ? e.body.length === 1 ? i(e.body[0]) : e : e.type === "font" ? i(e.body) : e;
}, $h = function(e) {
  var t = z0(e);
  return t.type === "mathord" || t.type === "textord" || t.type === "atom";
}, Kh = function(e) {
  if (!e)
    throw new Error("Expected non-null, but got " + String(e));
  return e;
}, Zh = 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";
}, Ie = {
  contains: Uh,
  deflt: Vh,
  escape: Wh,
  hyphenate: Xh,
  getBaseElem: z0,
  isCharacterBox: $h,
  protocolFromUrl: Zh
};
class Yn {
  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 kn[Qh[this.id]];
  }
  /**
   * Get the style of a subscript given a base in the current style.
   */
  sub() {
    return kn[Jh[this.id]];
  }
  /**
   * Get the style of a fraction numerator given the fraction in the current
   * style.
   */
  fracNum() {
    return kn[ed[this.id]];
  }
  /**
   * Get the style of a fraction denominator given the fraction in the current
   * style.
   */
  fracDen() {
    return kn[td[this.id]];
  }
  /**
   * Get the cramped version of a style (in particular, cramping a cramped style
   * doesn't change the style).
   */
  cramp() {
    return kn[nd[this.id]];
  }
  /**
   * Get a text or display version of this style.
   */
  text() {
    return kn[id[this.id]];
  }
  /**
   * Return true if this style is tightly spaced (scriptstyle/scriptscriptstyle)
   */
  isTight() {
    return this.size >= 2;
  }
}
var Ga = 0, ts = 1, Ui = 2, qn = 3, gr = 4, Qt = 5, Gi = 6, Et = 7, kn = [new Yn(Ga, 0, !1), new Yn(ts, 0, !0), new Yn(Ui, 1, !1), new Yn(qn, 1, !0), new Yn(gr, 2, !1), new Yn(Qt, 2, !0), new Yn(Gi, 3, !1), new Yn(Et, 3, !0)], Qh = [gr, Qt, gr, Qt, Gi, Et, Gi, Et], Jh = [Qt, Qt, Qt, Qt, Et, Et, Et, Et], ed = [Ui, qn, gr, Qt, Gi, Et, Gi, Et], td = [qn, qn, Qt, Qt, Et, Et, Et, Et], nd = [ts, ts, qn, qn, Qt, Qt, Et, Et], id = [Ga, ts, Ui, qn, Ui, qn, Ui, qn], Ne = {
  DISPLAY: kn[Ga],
  TEXT: kn[Ui],
  SCRIPT: kn[gr],
  SCRIPTSCRIPT: kn[Gi]
}, ka = [{
  // 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 rd(i) {
  for (var e = 0; e < ka.length; e++)
    for (var t = ka[e], n = 0; n < t.blocks.length; n++) {
      var r = t.blocks[n];
      if (i >= r[0] && i <= r[1])
        return t.name;
    }
  return null;
}
var Zr = [];
ka.forEach((i) => i.blocks.forEach((e) => Zr.push(...e)));
function sd(i) {
  for (var e = 0; e < Zr.length; e += 2)
    if (i >= Zr[e] && i <= Zr[e + 1])
      return !0;
  return !1;
}
var Bi = 80, ad = 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";
}, od = 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";
}, ld = 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";
}, ud = 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";
}, cd = 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";
}, hd = function(e) {
  var t = e / 2;
  return "M400000 " + e + " H0 L" + t + " 0 l65 45 L145 " + (e - 80) + " H400000z";
}, dd = function(e, t, n) {
  var r = n - 54 - t - e;
  return "M702 " + (e + t) + "H400000" + (40 + e) + `
H742v` + r + `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";
}, fd = function(e, t, n) {
  t = 1e3 * t;
  var r = "";
  switch (e) {
    case "sqrtMain":
      r = ad(t, Bi);
      break;
    case "sqrtSize1":
      r = od(t, Bi);
      break;
    case "sqrtSize2":
      r = ld(t, Bi);
      break;
    case "sqrtSize3":
      r = ud(t, Bi);
      break;
    case "sqrtSize4":
      r = cd(t, Bi);
      break;
    case "sqrtTall":
      r = dd(t, Bi, n);
  }
  return r;
}, md = 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 "";
  }
}, qo = {
  // 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`
}, pd = 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 vr {
  // 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 Ie.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 On = {
  "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]
  }
}, Uo = {
  // 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 Xa(i, e, t) {
  if (!On[e])
    throw new Error("Font metrics not found for font: " + e + ".");
  var n = i.charCodeAt(0), r = On[e][n];
  if (!r && i[0] in Uo && (n = Uo[i[0]].charCodeAt(0), r = On[e][n]), !r && t === "text" && sd(n) && (r = On[e][77]), r)
    return {
      depth: r[0],
      height: r[1],
      italic: r[2],
      skew: r[3],
      width: r[4]
    };
}
var Sa = {
  // 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
}, gd = {
  ex: !0,
  em: !0,
  mu: !0
}, bd = function(e) {
  return typeof e != "string" && (e = e.unit), e in Sa || e in gd || e === "ex";
}, nt = function(e, t) {
  var n;
  if (e.unit in Sa)
    n = Sa[e.unit] / t.fontMetrics().ptPerEm / t.sizeMultiplier;
  else if (e.unit === "mu")
    n = t.fontMetrics().cssEmPerMu;
  else {
    var r;
    if (t.style.isTight() ? r = t.havingStyle(t.style.text()) : r = t, e.unit === "ex")
      n = r.fontMetrics().xHeight;
    else if (e.unit === "em")
      n = r.fontMetrics().quad;
    else
      throw new Re("Invalid unit: '" + e.unit + "'");
    r !== t && (n *= r.sizeMultiplier / t.sizeMultiplier);
  }
  return Math.min(e.number * n, t.maxSize);
}, Se = function(e) {
  return +e.toFixed(4) + "em";
}, si = function(e) {
  return e.filter((t) => t).join(" ");
}, O0 = 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 r = t.getColor();
    r && (this.style.color = r);
  }
}, H0 = function(e) {
  var t = document.createElement(e);
  t.className = si(this.classes);
  for (var n in this.style)
    this.style.hasOwnProperty(n) && (t.style[n] = this.style[n]);
  for (var r in this.attributes)
    this.attributes.hasOwnProperty(r) && t.setAttribute(r, this.attributes[r]);
  for (var s = 0; s < this.children.length; s++)
    t.appendChild(this.children[s].toNode());
  return t;
}, q0 = function(e) {
  var t = "<" + e;
  this.classes.length && (t += ' class="' + Ie.escape(si(this.classes)) + '"');
  var n = "";
  for (var r in this.style)
    this.style.hasOwnProperty(r) && (n += Ie.hyphenate(r) + ":" + this.style[r] + ";");
  n && (t += ' style="' + Ie.escape(n) + '"');
  for (var s in this.attributes)
    this.attributes.hasOwnProperty(s) && (t += " " + s + '="' + Ie.escape(this.attributes[s]) + '"');
  t += ">";
  for (var u = 0; u < this.children.length; u++)
    t += this.children[u].toMarkup();
  return t += "</" + e + ">", t;
};
class ys {
  constructor(e, t, n, r) {
    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, O0.call(this, e, n, r), 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 Ie.contains(this.classes, e);
  }
  toNode() {
    return H0.call(this, "span");
  }
  toMarkup() {
    return q0.call(this, "span");
  }
}
class U0 {
  constructor(e, t, n, r) {
    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, O0.call(this, t, r), this.children = n || [], this.setAttribute("href", e);
  }
  setAttribute(e, t) {
    this.attributes[e] = t;
  }
  hasClass(e) {
    return Ie.contains(this.classes, e);
  }
  toNode() {
    return H0.call(this, "a");
  }
  toMarkup() {
    return q0.call(this, "a");
  }
}
class vd {
  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 Ie.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="' + Ie.escape(this.src) + '"' + (' alt="' + Ie.escape(this.alt) + '"'), t = "";
    for (var n in this.style)
      this.style.hasOwnProperty(n) && (t += Ie.hyphenate(n) + ":" + this.style[n] + ";");
    return t && (e += ' style="' + Ie.escape(t) + '"'), e += "'/>", e;
  }
}
var yd = {
  î: "ı̂",
  ï: "ı̈",
  í: "ı́",
  // 'ī': '\u0131\u0304', // enable when we add Extended Latin
  ì: "ı̀"
};
class Dn {
  constructor(e, t, n, r, s, u, 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 = r || 0, this.skew = s || 0, this.width = u || 0, this.classes = l || [], this.style = o || {}, this.maxFontSize = 0;
    var h = rd(this.text.charCodeAt(0));
    h && this.classes.push(h + "_fallback"), /[îïíì]/.test(this.text) && (this.text = yd[this.text]);
  }
  hasClass(e) {
    return Ie.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 = Se(this.italic)), this.classes.length > 0 && (t = t || document.createElement("span"), t.className = si(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 += Ie.escape(si(this.classes)), t += '"');
    var n = "";
    this.italic > 0 && (n += "margin-right:" + this.italic + "em;");
    for (var r in this.style)
      this.style.hasOwnProperty(r) && (n += Ie.hyphenate(r) + ":" + this.style[r] + ";");
    n && (e = !0, t += ' style="' + Ie.escape(n) + '"');
    var s = Ie.escape(this.text);
    return e ? (t += ">", t += s, t += "</span>", t) : s;
  }
}
class ai {
  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 r = 0; r < this.children.length; r++)
      t.appendChild(this.children[r].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 + '="' + Ie.escape(this.attributes[t]) + '"');
    e += ">";
    for (var n = 0; n < this.children.length; n++)
      e += this.children[n].toMarkup();
    return e += "</svg>", e;
  }
}
class _i {
  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", qo[this.pathName]), t;
  }
  toMarkup() {
    return this.alternate ? '<path d="' + Ie.escape(this.alternate) + '"/>' : '<path d="' + Ie.escape(qo[this.pathName]) + '"/>';
  }
}
class Vo {
  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 + '="' + Ie.escape(this.attributes[t]) + '"');
    return e += "/>", e;
  }
}
function Go(i) {
  if (i instanceof Dn)
    return i;
  throw new Error("Expected symbolNode but got " + String(i) + ".");
}
function wd(i) {
  if (i instanceof ys)
    return i;
  throw new Error("Expected span<HtmlDomNode> but got " + String(i) + ".");
}
var Ad = {
  "accent-token": 1,
  mathord: 1,
  "op-token": 1,
  spacing: 1,
  textord: 1
}, lt = {
  math: {},
  text: {}
};
function w(i, e, t, n, r, s) {
  lt[i][r] = {
    font: e,
    group: t,
    replace: n
  }, s && n && (lt[i][n] = lt[i][r]);
}
var T = "math", ce = "text", N = "main", j = "ams", Je = "accent-token", Te = "bin", Tt = "close", Wi = "inner", Le = "mathord", ct = "op-token", Vt = "open", ws = "punct", W = "rel", Gn = "spacing", Q = "textord";
w(T, N, W, "≡", "\\equiv", !0);
w(T, N, W, "≺", "\\prec", !0);
w(T, N, W, "≻", "\\succ", !0);
w(T, N, W, "∼", "\\sim", !0);
w(T, N, W, "⊥", "\\perp");
w(T, N, W, "⪯", "\\preceq", !0);
w(T, N, W, "⪰", "\\succeq", !0);
w(T, N, W, "≃", "\\simeq", !0);
w(T, N, W, "∣", "\\mid", !0);
w(T, N, W, "≪", "\\ll", !0);
w(T, N, W, "≫", "\\gg", !0);
w(T, N, W, "≍", "\\asymp", !0);
w(T, N, W, "∥", "\\parallel");
w(T, N, W, "⋈", "\\bowtie", !0);
w(T, N, W, "⌣", "\\smile", !0);
w(T, N, W, "⊑", "\\sqsubseteq", !0);
w(T, N, W, "⊒", "\\sqsupseteq", !0);
w(T, N, W, "≐", "\\doteq", !0);
w(T, N, W, "⌢", "\\frown", !0);
w(T, N, W, "∋", "\\ni", !0);
w(T, N, W, "∝", "\\propto", !0);
w(T, N, W, "⊢", "\\vdash", !0);
w(T, N, W, "⊣", "\\dashv", !0);
w(T, N, W, "∋", "\\owns");
w(T, N, ws, ".", "\\ldotp");
w(T, N, ws, "⋅", "\\cdotp");
w(T, N, Q, "#", "\\#");
w(ce, N, Q, "#", "\\#");
w(T, N, Q, "&", "\\&");
w(ce, N, Q, "&", "\\&");
w(T, N, Q, "ℵ", "\\aleph", !0);
w(T, N, Q, "∀", "\\forall", !0);
w(T, N, Q, "ℏ", "\\hbar", !0);
w(T, N, Q, "∃", "\\exists", !0);
w(T, N, Q, "∇", "\\nabla", !0);
w(T, N, Q, "♭", "\\flat", !0);
w(T, N, Q, "ℓ", "\\ell", !0);
w(T, N, Q, "♮", "\\natural", !0);
w(T, N, Q, "♣", "\\clubsuit", !0);
w(T, N, Q, "℘", "\\wp", !0);
w(T, N, Q, "♯", "\\sharp", !0);
w(T, N, Q, "♢", "\\diamondsuit", !0);
w(T, N, Q, "ℜ", "\\Re", !0);
w(T, N, Q, "♡", "\\heartsuit", !0);
w(T, N, Q, "ℑ", "\\Im", !0);
w(T, N, Q, "♠", "\\spadesuit", !0);
w(T, N, Q, "§", "\\S", !0);
w(ce, N, Q, "§", "\\S");
w(T, N, Q, "¶", "\\P", !0);
w(ce, N, Q, "¶", "\\P");
w(T, N, Q, "†", "\\dag");
w(ce, N, Q, "†", "\\dag");
w(ce, N, Q, "†", "\\textdagger");
w(T, N, Q, "‡", "\\ddag");
w(ce, N, Q, "‡", "\\ddag");
w(ce, N, Q, "‡", "\\textdaggerdbl");
w(T, N, Tt, "⎱", "\\rmoustache", !0);
w(T, N, Vt, "⎰", "\\lmoustache", !0);
w(T, N, Tt, "⟯", "\\rgroup", !0);
w(T, N, Vt, "⟮", "\\lgroup", !0);
w(T, N, Te, "∓", "\\mp", !0);
w(T, N, Te, "⊖", "\\ominus", !0);
w(T, N, Te, "⊎", "\\uplus", !0);
w(T, N, Te, "⊓", "\\sqcap", !0);
w(T, N, Te, "∗", "\\ast");
w(T, N, Te, "⊔", "\\sqcup", !0);
w(T, N, Te, "◯", "\\bigcirc", !0);
w(T, N, Te, "∙", "\\bullet", !0);
w(T, N, Te, "‡", "\\ddagger");
w(T, N, Te, "≀", "\\wr", !0);
w(T, N, Te, "⨿", "\\amalg");
w(T, N, Te, "&", "\\And");
w(T, N, W, "⟵", "\\longleftarrow", !0);
w(T, N, W, "⇐", "\\Leftarrow", !0);
w(T, N, W, "⟸", "\\Longleftarrow", !0);
w(T, N, W, "⟶", "\\longrightarrow", !0);
w(T, N, W, "⇒", "\\Rightarrow", !0);
w(T, N, W, "⟹", "\\Longrightarrow", !0);
w(T, N, W, "↔", "\\leftrightarrow", !0);
w(T, N, W, "⟷", "\\longleftrightarrow", !0);
w(T, N, W, "⇔", "\\Leftrightarrow", !0);
w(T, N, W, "⟺", "\\Longleftrightarrow", !0);
w(T, N, W, "↦", "\\mapsto", !0);
w(T, N, W, "⟼", "\\longmapsto", !0);
w(T, N, W, "↗", "\\nearrow", !0);
w(T, N, W, "↩", "\\hookleftarrow", !0);
w(T, N, W, "↪", "\\hookrightarrow", !0);
w(T, N, W, "↘", "\\searrow", !0);
w(T, N, W, "↼", "\\leftharpoonup", !0);
w(T, N, W, "⇀", "\\rightharpoonup", !0);
w(T, N, W, "↙", "\\swarrow", !0);
w(T, N, W, "↽", "\\leftharpoondown", !0);
w(T, N, W, "⇁", "\\rightharpoondown", !0);
w(T, N, W, "↖", "\\nwarrow", !0);
w(T, N, W, "⇌", "\\rightleftharpoons", !0);
w(T, j, W, "≮", "\\nless", !0);
w(T, j, W, "", "\\@nleqslant");
w(T, j, W, "", "\\@nleqq");
w(T, j, W, "⪇", "\\lneq", !0);
w(T, j, W, "≨", "\\lneqq", !0);
w(T, j, W, "", "\\@lvertneqq");
w(T, j, W, "⋦", "\\lnsim", !0);
w(T, j, W, "⪉", "\\lnapprox", !0);
w(T, j, W, "⊀", "\\nprec", !0);
w(T, j, W, "⋠", "\\npreceq", !0);
w(T, j, W, "⋨", "\\precnsim", !0);
w(T, j, W, "⪹", "\\precnapprox", !0);
w(T, j, W, "≁", "\\nsim", !0);
w(T, j, W, "", "\\@nshortmid");
w(T, j, W, "∤", "\\nmid", !0);
w(T, j, W, "⊬", "\\nvdash", !0);
w(T, j, W, "⊭", "\\nvDash", !0);
w(T, j, W, "⋪", "\\ntriangleleft");
w(T, j, W, "⋬", "\\ntrianglelefteq", !0);
w(T, j, W, "⊊", "\\subsetneq", !0);
w(T, j, W, "", "\\@varsubsetneq");
w(T, j, W, "⫋", "\\subsetneqq", !0);
w(T, j, W, "", "\\@varsubsetneqq");
w(T, j, W, "≯", "\\ngtr", !0);
w(T, j, W, "", "\\@ngeqslant");
w(T, j, W, "", "\\@ngeqq");
w(T, j, W, "⪈", "\\gneq", !0);
w(T, j, W, "≩", "\\gneqq", !0);
w(T, j, W, "", "\\@gvertneqq");
w(T, j, W, "⋧", "\\gnsim", !0);
w(T, j, W, "⪊", "\\gnapprox", !0);
w(T, j, W, "⊁", "\\nsucc", !0);
w(T, j, W, "⋡", "\\nsucceq", !0);
w(T, j, W, "⋩", "\\succnsim", !0);
w(T, j, W, "⪺", "\\succnapprox", !0);
w(T, j, W, "≆", "\\ncong", !0);
w(T, j, W, "", "\\@nshortparallel");
w(T, j, W, "∦", "\\nparallel", !0);
w(T, j, W, "⊯", "\\nVDash", !0);
w(T, j, W, "⋫", "\\ntriangleright");
w(T, j, W, "⋭", "\\ntrianglerighteq", !0);
w(T, j, W, "", "\\@nsupseteqq");
w(T, j, W, "⊋", "\\supsetneq", !0);
w(T, j, W, "", "\\@varsupsetneq");
w(T, j, W, "⫌", "\\supsetneqq", !0);
w(T, j, W, "", "\\@varsupsetneqq");
w(T, j, W, "⊮", "\\nVdash", !0);
w(T, j, W, "⪵", "\\precneqq", !0);
w(T, j, W, "⪶", "\\succneqq", !0);
w(T, j, W, "", "\\@nsubseteqq");
w(T, j, Te, "⊴", "\\unlhd");
w(T, j, Te, "⊵", "\\unrhd");
w(T, j, W, "↚", "\\nleftarrow", !0);
w(T, j, W, "↛", "\\nrightarrow", !0);
w(T, j, W, "⇍", "\\nLeftarrow", !0);
w(T, j, W, "⇏", "\\nRightarrow", !0);
w(T, j, W, "↮", "\\nleftrightarrow", !0);
w(T, j, W, "⇎", "\\nLeftrightarrow", !0);
w(T, j, W, "△", "\\vartriangle");
w(T, j, Q, "ℏ", "\\hslash");
w(T, j, Q, "▽", "\\triangledown");
w(T, j, Q, "◊", "\\lozenge");
w(T, j, Q, "Ⓢ", "\\circledS");
w(T, j, Q, "®", "\\circledR");
w(ce, j, Q, "®", "\\circledR");
w(T, j, Q, "∡", "\\measuredangle", !0);
w(T, j, Q, "∄", "\\nexists");
w(T, j, Q, "℧", "\\mho");
w(T, j, Q, "Ⅎ", "\\Finv", !0);
w(T, j, Q, "⅁", "\\Game", !0);
w(T, j, Q, "‵", "\\backprime");
w(T, j, Q, "▲", "\\blacktriangle");
w(T, j, Q, "▼", "\\blacktriangledown");
w(T, j, Q, "■", "\\blacksquare");
w(T, j, Q, "⧫", "\\blacklozenge");
w(T, j, Q, "★", "\\bigstar");
w(T, j, Q, "∢", "\\sphericalangle", !0);
w(T, j, Q, "∁", "\\complement", !0);
w(T, j, Q, "ð", "\\eth", !0);
w(ce, N, Q, "ð", "ð");
w(T, j, Q, "╱", "\\diagup");
w(T, j, Q, "╲", "\\diagdown");
w(T, j, Q, "□", "\\square");
w(T, j, Q, "□", "\\Box");
w(T, j, Q, "◊", "\\Diamond");
w(T, j, Q, "¥", "\\yen", !0);
w(ce, j, Q, "¥", "\\yen", !0);
w(T, j, Q, "✓", "\\checkmark", !0);
w(ce, j, Q, "✓", "\\checkmark");
w(T, j, Q, "ℶ", "\\beth", !0);
w(T, j, Q, "ℸ", "\\daleth", !0);
w(T, j, Q, "ℷ", "\\gimel", !0);
w(T, j, Q, "ϝ", "\\digamma", !0);
w(T, j, Q, "ϰ", "\\varkappa");
w(T, j, Vt, "┌", "\\@ulcorner", !0);
w(T, j, Tt, "┐", "\\@urcorner", !0);
w(T, j, Vt, "└", "\\@llcorner", !0);
w(T, j, Tt, "┘", "\\@lrcorner", !0);
w(T, j, W, "≦", "\\leqq", !0);
w(T, j, W, "⩽", "\\leqslant", !0);
w(T, j, W, "⪕", "\\eqslantless", !0);
w(T, j, W, "≲", "\\lesssim", !0);
w(T, j, W, "⪅", "\\lessapprox", !0);
w(T, j, W, "≊", "\\approxeq", !0);
w(T, j, Te, "⋖", "\\lessdot");
w(T, j, W, "⋘", "\\lll", !0);
w(T, j, W, "≶", "\\lessgtr", !0);
w(T, j, W, "⋚", "\\lesseqgtr", !0);
w(T, j, W, "⪋", "\\lesseqqgtr", !0);
w(T, j, W, "≑", "\\doteqdot");
w(T, j, W, "≓", "\\risingdotseq", !0);
w(T, j, W, "≒", "\\fallingdotseq", !0);
w(T, j, W, "∽", "\\backsim", !0);
w(T, j, W, "⋍", "\\backsimeq", !0);
w(T, j, W, "⫅", "\\subseteqq", !0);
w(T, j, W, "⋐", "\\Subset", !0);
w(T, j, W, "⊏", "\\sqsubset", !0);
w(T, j, W, "≼", "\\preccurlyeq", !0);
w(T, j, W, "⋞", "\\curlyeqprec", !0);
w(T, j, W, "≾", "\\precsim", !0);
w(T, j, W, "⪷", "\\precapprox", !0);
w(T, j, W, "⊲", "\\vartriangleleft");
w(T, j, W, "⊴", "\\trianglelefteq");
w(T, j, W, "⊨", "\\vDash", !0);
w(T, j, W, "⊪", "\\Vvdash", !0);
w(T, j, W, "⌣", "\\smallsmile");
w(T, j, W, "⌢", "\\smallfrown");
w(T, j, W, "≏", "\\bumpeq", !0);
w(T, j, W, "≎", "\\Bumpeq", !0);
w(T, j, W, "≧", "\\geqq", !0);
w(T, j, W, "⩾", "\\geqslant", !0);
w(T, j, W, "⪖", "\\eqslantgtr", !0);
w(T, j, W, "≳", "\\gtrsim", !0);
w(T, j, W, "⪆", "\\gtrapprox", !0);
w(T, j, Te, "⋗", "\\gtrdot");
w(T, j, W, "⋙", "\\ggg", !0);
w(T, j, W, "≷", "\\gtrless", !0);
w(T, j, W, "⋛", "\\gtreqless", !0);
w(T, j, W, "⪌", "\\gtreqqless", !0);
w(T, j, W, "≖", "\\eqcirc", !0);
w(T, j, W, "≗", "\\circeq", !0);
w(T, j, W, "≜", "\\triangleq", !0);
w(T, j, W, "∼", "\\thicksim");
w(T, j, W, "≈", "\\thickapprox");
w(T, j, W, "⫆", "\\supseteqq", !0);
w(T, j, W, "⋑", "\\Supset", !0);
w(T, j, W, "⊐", "\\sqsupset", !0);
w(T, j, W, "≽", "\\succcurlyeq", !0);
w(T, j, W, "⋟", "\\curlyeqsucc", !0);
w(T, j, W, "≿", "\\succsim", !0);
w(T, j, W, "⪸", "\\succapprox", !0);
w(T, j, W, "⊳", "\\vartriangleright");
w(T, j, W, "⊵", "\\trianglerighteq");
w(T, j, W, "⊩", "\\Vdash", !0);
w(T, j, W, "∣", "\\shortmid");
w(T, j, W, "∥", "\\shortparallel");
w(T, j, W, "≬", "\\between", !0);
w(T, j, W, "⋔", "\\pitchfork", !0);
w(T, j, W, "∝", "\\varpropto");
w(T, j, W, "◀", "\\blacktriangleleft");
w(T, j, W, "∴", "\\therefore", !0);
w(T, j, W, "∍", "\\backepsilon");
w(T, j, W, "▶", "\\blacktriangleright");
w(T, j, W, "∵", "\\because", !0);
w(T, j, W, "⋘", "\\llless");
w(T, j, W, "⋙", "\\gggtr");
w(T, j, Te, "⊲", "\\lhd");
w(T, j, Te, "⊳", "\\rhd");
w(T, j, W, "≂", "\\eqsim", !0);
w(T, N, W, "⋈", "\\Join");
w(T, j, W, "≑", "\\Doteq", !0);
w(T, j, Te, "∔", "\\dotplus", !0);
w(T, j, Te, "∖", "\\smallsetminus");
w(T, j, Te, "⋒", "\\Cap", !0);
w(T, j, Te, "⋓", "\\Cup", !0);
w(T, j, Te, "⩞", "\\doublebarwedge", !0);
w(T, j, Te, "⊟", "\\boxminus", !0);
w(T, j, Te, "⊞", "\\boxplus", !0);
w(T, j, Te, "⋇", "\\divideontimes", !0);
w(T, j, Te, "⋉", "\\ltimes", !0);
w(T, j, Te, "⋊", "\\rtimes", !0);
w(T, j, Te, "⋋", "\\leftthreetimes", !0);
w(T, j, Te, "⋌", "\\rightthreetimes", !0);
w(T, j, Te, "⋏", "\\curlywedge", !0);
w(T, j, Te, "⋎", "\\curlyvee", !0);
w(T, j, Te, "⊝", "\\circleddash", !0);
w(T, j, Te, "⊛", "\\circledast", !0);
w(T, j, Te, "⋅", "\\centerdot");
w(T, j, Te, "⊺", "\\intercal", !0);
w(T, j, Te, "⋒", "\\doublecap");
w(T, j, Te, "⋓", "\\doublecup");
w(T, j, Te, "⊠", "\\boxtimes", !0);
w(T, j, W, "⇢", "\\dashrightarrow", !0);
w(T, j, W, "⇠", "\\dashleftarrow", !0);
w(T, j, W, "⇇", "\\leftleftarrows", !0);
w(T, j, W, "⇆", "\\leftrightarrows", !0);
w(T, j, W, "⇚", "\\Lleftarrow", !0);
w(T, j, W, "↞", "\\twoheadleftarrow", !0);
w(T, j, W, "↢", "\\leftarrowtail", !0);
w(T, j, W, "↫", "\\looparrowleft", !0);
w(T, j, W, "⇋", "\\leftrightharpoons", !0);
w(T, j, W, "↶", "\\curvearrowleft", !0);
w(T, j, W, "↺", "\\circlearrowleft", !0);
w(T, j, W, "↰", "\\Lsh", !0);
w(T, j, W, "⇈", "\\upuparrows", !0);
w(T, j, W, "↿", "\\upharpoonleft", !0);
w(T, j, W, "⇃", "\\downharpoonleft", !0);
w(T, N, W, "⊶", "\\origof", !0);
w(T, N, W, "⊷", "\\imageof", !0);
w(T, j, W, "⊸", "\\multimap", !0);
w(T, j, W, "↭", "\\leftrightsquigarrow", !0);
w(T, j, W, "⇉", "\\rightrightarrows", !0);
w(T, j, W, "⇄", "\\rightleftarrows", !0);
w(T, j, W, "↠", "\\twoheadrightarrow", !0);
w(T, j, W, "↣", "\\rightarrowtail", !0);
w(T, j, W, "↬", "\\looparrowright", !0);
w(T, j, W, "↷", "\\curvearrowright", !0);
w(T, j, W, "↻", "\\circlearrowright", !0);
w(T, j, W, "↱", "\\Rsh", !0);
w(T, j, W, "⇊", "\\downdownarrows", !0);
w(T, j, W, "↾", "\\upharpoonright", !0);
w(T, j, W, "⇂", "\\downharpoonright", !0);
w(T, j, W, "⇝", "\\rightsquigarrow", !0);
w(T, j, W, "⇝", "\\leadsto");
w(T, j, W, "⇛", "\\Rrightarrow", !0);
w(T, j, W, "↾", "\\restriction");
w(T, N, Q, "‘", "`");
w(T, N, Q, "$", "\\$");
w(ce, N, Q, "$", "\\$");
w(ce, N, Q, "$", "\\textdollar");
w(T, N, Q, "%", "\\%");
w(ce, N, Q, "%", "\\%");
w(T, N, Q, "_", "\\_");
w(ce, N, Q, "_", "\\_");
w(ce, N, Q, "_", "\\textunderscore");
w(T, N, Q, "∠", "\\angle", !0);
w(T, N, Q, "∞", "\\infty", !0);
w(T, N, Q, "′", "\\prime");
w(T, N, Q, "△", "\\triangle");
w(T, N, Q, "Γ", "\\Gamma", !0);
w(T, N, Q, "Δ", "\\Delta", !0);
w(T, N, Q, "Θ", "\\Theta", !0);
w(T, N, Q, "Λ", "\\Lambda", !0);
w(T, N, Q, "Ξ", "\\Xi", !0);
w(T, N, Q, "Π", "\\Pi", !0);
w(T, N, Q, "Σ", "\\Sigma", !0);
w(T, N, Q, "Υ", "\\Upsilon", !0);
w(T, N, Q, "Φ", "\\Phi", !0);
w(T, N, Q, "Ψ", "\\Psi", !0);
w(T, N, Q, "Ω", "\\Omega", !0);
w(T, N, Q, "A", "Α");
w(T, N, Q, "B", "Β");
w(T, N, Q, "E", "Ε");
w(T, N, Q, "Z", "Ζ");
w(T, N, Q, "H", "Η");
w(T, N, Q, "I", "Ι");
w(T, N, Q, "K", "Κ");
w(T, N, Q, "M", "Μ");
w(T, N, Q, "N", "Ν");
w(T, N, Q, "O", "Ο");
w(T, N, Q, "P", "Ρ");
w(T, N, Q, "T", "Τ");
w(T, N, Q, "X", "Χ");
w(T, N, Q, "¬", "\\neg", !0);
w(T, N, Q, "¬", "\\lnot");
w(T, N, Q, "⊤", "\\top");
w(T, N, Q, "⊥", "\\bot");
w(T, N, Q, "∅", "\\emptyset");
w(T, j, Q, "∅", "\\varnothing");
w(T, N, Le, "α", "\\alpha", !0);
w(T, N, Le, "β", "\\beta", !0);
w(T, N, Le, "γ", "\\gamma", !0);
w(T, N, Le, "δ", "\\delta", !0);
w(T, N, Le, "ϵ", "\\epsilon", !0);
w(T, N, Le, "ζ", "\\zeta", !0);
w(T, N, Le, "η", "\\eta", !0);
w(T, N, Le, "θ", "\\theta", !0);
w(T, N, Le, "ι", "\\iota", !0);
w(T, N, Le, "κ", "\\kappa", !0);
w(T, N, Le, "λ", "\\lambda", !0);
w(T, N, Le, "μ", "\\mu", !0);
w(T, N, Le, "ν", "\\nu", !0);
w(T, N, Le, "ξ", "\\xi", !0);
w(T, N, Le, "ο", "\\omicron", !0);
w(T, N, Le, "π", "\\pi", !0);
w(T, N, Le, "ρ", "\\rho", !0);
w(T, N, Le, "σ", "\\sigma", !0);
w(T, N, Le, "τ", "\\tau", !0);
w(T, N, Le, "υ", "\\upsilon", !0);
w(T, N, Le, "ϕ", "\\phi", !0);
w(T, N, Le, "χ", "\\chi", !0);
w(T, N, Le, "ψ", "\\psi", !0);
w(T, N, Le, "ω", "\\omega", !0);
w(T, N, Le, "ε", "\\varepsilon", !0);
w(T, N, Le, "ϑ", "\\vartheta", !0);
w(T, N, Le, "ϖ", "\\varpi", !0);
w(T, N, Le, "ϱ", "\\varrho", !0);
w(T, N, Le, "ς", "\\varsigma", !0);
w(T, N, Le, "φ", "\\varphi", !0);
w(T, N, Te, "∗", "*", !0);
w(T, N, Te, "+", "+");
w(T, N, Te, "−", "-", !0);
w(T, N, Te, "⋅", "\\cdot", !0);
w(T, N, Te, "∘", "\\circ", !0);
w(T, N, Te, "÷", "\\div", !0);
w(T, N, Te, "±", "\\pm", !0);
w(T, N, Te, "×", "\\times", !0);
w(T, N, Te, "∩", "\\cap", !0);
w(T, N, Te, "∪", "\\cup", !0);
w(T, N, Te, "∖", "\\setminus", !0);
w(T, N, Te, "∧", "\\land");
w(T, N, Te, "∨", "\\lor");
w(T, N, Te, "∧", "\\wedge", !0);
w(T, N, Te, "∨", "\\vee", !0);
w(T, N, Q, "√", "\\surd");
w(T, N, Vt, "⟨", "\\langle", !0);
w(T, N, Vt, "∣", "\\lvert");
w(T, N, Vt, "∥", "\\lVert");
w(T, N, Tt, "?", "?");
w(T, N, Tt, "!", "!");
w(T, N, Tt, "⟩", "\\rangle", !0);
w(T, N, Tt, "∣", "\\rvert");
w(T, N, Tt, "∥", "\\rVert");
w(T, N, W, "=", "=");
w(T, N, W, ":", ":");
w(T, N, W, "≈", "\\approx", !0);
w(T, N, W, "≅", "\\cong", !0);
w(T, N, W, "≥", "\\ge");
w(T, N, W, "≥", "\\geq", !0);
w(T, N, W, "←", "\\gets");
w(T, N, W, ">", "\\gt", !0);
w(T, N, W, "∈", "\\in", !0);
w(T, N, W, "", "\\@not");
w(T, N, W, "⊂", "\\subset", !0);
w(T, N, W, "⊃", "\\supset", !0);
w(T, N, W, "⊆", "\\subseteq", !0);
w(T, N, W, "⊇", "\\supseteq", !0);
w(T, j, W, "⊈", "\\nsubseteq", !0);
w(T, j, W, "⊉", "\\nsupseteq", !0);
w(T, N, W, "⊨", "\\models");
w(T, N, W, "←", "\\leftarrow", !0);
w(T, N, W, "≤", "\\le");
w(T, N, W, "≤", "\\leq", !0);
w(T, N, W, "<", "\\lt", !0);
w(T, N, W, "→", "\\rightarrow", !0);
w(T, N, W, "→", "\\to");
w(T, j, W, "≱", "\\ngeq", !0);
w(T, j, W, "≰", "\\nleq", !0);
w(T, N, Gn, " ", "\\ ");
w(T, N, Gn, " ", "\\space");
w(T, N, Gn, " ", "\\nobreakspace");
w(ce, N, Gn, " ", "\\ ");
w(ce, N, Gn, " ", " ");
w(ce, N, Gn, " ", "\\space");
w(ce, N, Gn, " ", "\\nobreakspace");
w(T, N, Gn, null, "\\nobreak");
w(T, N, Gn, null, "\\allowbreak");
w(T, N, ws, ",", ",");
w(T, N, ws, ";", ";");
w(T, j, Te, "⊼", "\\barwedge", !0);
w(T, j, Te, "⊻", "\\veebar", !0);
w(T, N, Te, "⊙", "\\odot", !0);
w(T, N, Te, "⊕", "\\oplus", !0);
w(T, N, Te, "⊗", "\\otimes", !0);
w(T, N, Q, "∂", "\\partial", !0);
w(T, N, Te, "⊘", "\\oslash", !0);
w(T, j, Te, "⊚", "\\circledcirc", !0);
w(T, j, Te, "⊡", "\\boxdot", !0);
w(T, N, Te, "△", "\\bigtriangleup");
w(T, N, Te, "▽", "\\bigtriangledown");
w(T, N, Te, "†", "\\dagger");
w(T, N, Te, "⋄", "\\diamond");
w(T, N, Te, "⋆", "\\star");
w(T, N, Te, "◃", "\\triangleleft");
w(T, N, Te, "▹", "\\triangleright");
w(T, N, Vt, "{", "\\{");
w(ce, N, Q, "{", "\\{");
w(ce, N, Q, "{", "\\textbraceleft");
w(T, N, Tt, "}", "\\}");
w(ce, N, Q, "}", "\\}");
w(ce, N, Q, "}", "\\textbraceright");
w(T, N, Vt, "{", "\\lbrace");
w(T, N, Tt, "}", "\\rbrace");
w(T, N, Vt, "[", "\\lbrack", !0);
w(ce, N, Q, "[", "\\lbrack", !0);
w(T, N, Tt, "]", "\\rbrack", !0);
w(ce, N, Q, "]", "\\rbrack", !0);
w(T, N, Vt, "(", "\\lparen", !0);
w(T, N, Tt, ")", "\\rparen", !0);
w(ce, N, Q, "<", "\\textless", !0);
w(ce, N, Q, ">", "\\textgreater", !0);
w(T, N, Vt, "⌊", "\\lfloor", !0);
w(T, N, Tt, "⌋", "\\rfloor", !0);
w(T, N, Vt, "⌈", "\\lceil", !0);
w(T, N, Tt, "⌉", "\\rceil", !0);
w(T, N, Q, "\\", "\\backslash");
w(T, N, Q, "∣", "|");
w(T, N, Q, "∣", "\\vert");
w(ce, N, Q, "|", "\\textbar", !0);
w(T, N, Q, "∥", "\\|");
w(T, N, Q, "∥", "\\Vert");
w(ce, N, Q, "∥", "\\textbardbl");
w(ce, N, Q, "~", "\\textasciitilde");
w(ce, N, Q, "\\", "\\textbackslash");
w(ce, N, Q, "^", "\\textasciicircum");
w(T, N, W, "↑", "\\uparrow", !0);
w(T, N, W, "⇑", "\\Uparrow", !0);
w(T, N, W, "↓", "\\downarrow", !0);
w(T, N, W, "⇓", "\\Downarrow", !0);
w(T, N, W, "↕", "\\updownarrow", !0);
w(T, N, W, "⇕", "\\Updownarrow", !0);
w(T, N, ct, "∐", "\\coprod");
w(T, N, ct, "⋁", "\\bigvee");
w(T, N, ct, "⋀", "\\bigwedge");
w(T, N, ct, "⨄", "\\biguplus");
w(T, N, ct, "⋂", "\\bigcap");
w(T, N, ct, "⋃", "\\bigcup");
w(T, N, ct, "∫", "\\int");
w(T, N, ct, "∫", "\\intop");
w(T, N, ct, "∬", "\\iint");
w(T, N, ct, "∭", "\\iiint");
w(T, N, ct, "∏", "\\prod");
w(T, N, ct, "∑", "\\sum");
w(T, N, ct, "⨂", "\\bigotimes");
w(T, N, ct, "⨁", "\\bigoplus");
w(T, N, ct, "⨀", "\\bigodot");
w(T, N, ct, "∮", "\\oint");
w(T, N, ct, "∯", "\\oiint");
w(T, N, ct, "∰", "\\oiiint");
w(T, N, ct, "⨆", "\\bigsqcup");
w(T, N, ct, "∫", "\\smallint");
w(ce, N, Wi, "…", "\\textellipsis");
w(T, N, Wi, "…", "\\mathellipsis");
w(ce, N, Wi, "…", "\\ldots", !0);
w(T, N, Wi, "…", "\\ldots", !0);
w(T, N, Wi, "⋯", "\\@cdots", !0);
w(T, N, Wi, "⋱", "\\ddots", !0);
w(T, N, Q, "⋮", "\\varvdots");
w(T, N, Je, "ˊ", "\\acute");
w(T, N, Je, "ˋ", "\\grave");
w(T, N, Je, "¨", "\\ddot");
w(T, N, Je, "~", "\\tilde");
w(T, N, Je, "ˉ", "\\bar");
w(T, N, Je, "˘", "\\breve");
w(T, N, Je, "ˇ", "\\check");
w(T, N, Je, "^", "\\hat");
w(T, N, Je, "⃗", "\\vec");
w(T, N, Je, "˙", "\\dot");
w(T, N, Je, "˚", "\\mathring");
w(T, N, Le, "", "\\@imath");
w(T, N, Le, "", "\\@jmath");
w(T, N, Q, "ı", "ı");
w(T, N, Q, "ȷ", "ȷ");
w(ce, N, Q, "ı", "\\i", !0);
w(ce, N, Q, "ȷ", "\\j", !0);
w(ce, N, Q, "ß", "\\ss", !0);
w(ce, N, Q, "æ", "\\ae", !0);
w(ce, N, Q, "œ", "\\oe", !0);
w(ce, N, Q, "ø", "\\o", !0);
w(ce, N, Q, "Æ", "\\AE", !0);
w(ce, N, Q, "Œ", "\\OE", !0);
w(ce, N, Q, "Ø", "\\O", !0);
w(ce, N, Je, "ˊ", "\\'");
w(ce, N, Je, "ˋ", "\\`");
w(ce, N, Je, "ˆ", "\\^");
w(ce, N, Je, "˜", "\\~");
w(ce, N, Je, "ˉ", "\\=");
w(ce, N, Je, "˘", "\\u");
w(ce, N, Je, "˙", "\\.");
w(ce, N, Je, "¸", "\\c");
w(ce, N, Je, "˚", "\\r");
w(ce, N, Je, "ˇ", "\\v");
w(ce, N, Je, "¨", '\\"');
w(ce, N, Je, "˝", "\\H");
w(ce, N, Je, "◯", "\\textcircled");
var V0 = {
  "--": !0,
  "---": !0,
  "``": !0,
  "''": !0
};
w(ce, N, Q, "–", "--", !0);
w(ce, N, Q, "–", "\\textendash");
w(ce, N, Q, "—", "---", !0);
w(ce, N, Q, "—", "\\textemdash");
w(ce, N, Q, "‘", "`", !0);
w(ce, N, Q, "‘", "\\textquoteleft");
w(ce, N, Q, "’", "'", !0);
w(ce, N, Q, "’", "\\textquoteright");
w(ce, N, Q, "“", "``", !0);
w(ce, N, Q, "“", "\\textquotedblleft");
w(ce, N, Q, "”", "''", !0);
w(ce, N, Q, "”", "\\textquotedblright");
w(T, N, Q, "°", "\\degree", !0);
w(ce, N, Q, "°", "\\degree");
w(ce, N, Q, "°", "\\textdegree", !0);
w(T, N, Q, "£", "\\pounds");
w(T, N, Q, "£", "\\mathsterling", !0);
w(ce, N, Q, "£", "\\pounds");
w(ce, N, Q, "£", "\\textsterling", !0);
w(T, j, Q, "✠", "\\maltese");
w(ce, j, Q, "✠", "\\maltese");
var Xo = '0123456789/@."';
for (var Qs = 0; Qs < Xo.length; Qs++) {
  var jo = Xo.charAt(Qs);
  w(T, N, Q, jo, jo);
}
var Yo = '0123456789!@*()-=+";:?/.,';
for (var Js = 0; Js < Yo.length; Js++) {
  var Wo = Yo.charAt(Js);
  w(ce, N, Q, Wo, Wo);
}
var ns = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
for (var ea = 0; ea < ns.length; ea++) {
  var Lr = ns.charAt(ea);
  w(T, N, Le, Lr, Lr), w(ce, N, Q, Lr, Lr);
}
w(T, j, Q, "C", "ℂ");
w(ce, j, Q, "C", "ℂ");
w(T, j, Q, "H", "ℍ");
w(ce, j, Q, "H", "ℍ");
w(T, j, Q, "N", "ℕ");
w(ce, j, Q, "N", "ℕ");
w(T, j, Q, "P", "ℙ");
w(ce, j, Q, "P", "ℙ");
w(T, j, Q, "Q", "ℚ");
w(ce, j, Q, "Q", "ℚ");
w(T, j, Q, "R", "ℝ");
w(ce, j, Q, "R", "ℝ");
w(T, j, Q, "Z", "ℤ");
w(ce, j, Q, "Z", "ℤ");
w(T, N, Le, "h", "ℎ");
w(ce, N, Le, "h", "ℎ");
var Pe = "";
for (var St = 0; St < ns.length; St++) {
  var st = ns.charAt(St);
  Pe = String.fromCharCode(55349, 56320 + St), w(T, N, Le, st, Pe), w(ce, N, Q, st, Pe), Pe = String.fromCharCode(55349, 56372 + St), w(T, N, Le, st, Pe), w(ce, N, Q, st, Pe), Pe = String.fromCharCode(55349, 56424 + St), w(T, N, Le, st, Pe), w(ce, N, Q, st, Pe), Pe = String.fromCharCode(55349, 56580 + St), w(T, N, Le, st, Pe), w(ce, N, Q, st, Pe), Pe = String.fromCharCode(55349, 56684 + St), w(T, N, Le, st, Pe), w(ce, N, Q, st, Pe), Pe = String.fromCharCode(55349, 56736 + St), w(T, N, Le, st, Pe), w(ce, N, Q, st, Pe), Pe = String.fromCharCode(55349, 56788 + St), w(T, N, Le, st, Pe), w(ce, N, Q, st, Pe), Pe = String.fromCharCode(55349, 56840 + St), w(T, N, Le, st, Pe), w(ce, N, Q, st, Pe), Pe = String.fromCharCode(55349, 56944 + St), w(T, N, Le, st, Pe), w(ce, N, Q, st, Pe), St < 26 && (Pe = String.fromCharCode(55349, 56632 + St), w(T, N, Le, st, Pe), w(ce, N, Q, st, Pe), Pe = String.fromCharCode(55349, 56476 + St), w(T, N, Le, st, Pe), w(ce, N, Q, st, Pe));
}
Pe = "𝕜";
w(T, N, Le, "k", Pe);
w(ce, N, Q, "k", Pe);
for (var di = 0; di < 10; di++) {
  var Wn = di.toString();
  Pe = String.fromCharCode(55349, 57294 + di), w(T, N, Le, Wn, Pe), w(ce, N, Q, Wn, Pe), Pe = String.fromCharCode(55349, 57314 + di), w(T, N, Le, Wn, Pe), w(ce, N, Q, Wn, Pe), Pe = String.fromCharCode(55349, 57324 + di), w(T, N, Le, Wn, Pe), w(ce, N, Q, Wn, Pe), Pe = String.fromCharCode(55349, 57334 + di), w(T, N, Le, Wn, Pe), w(ce, N, Q, Wn, Pe);
}
var $o = "ÐÞþ";
for (var ta = 0; ta < $o.length; ta++) {
  var Ir = $o.charAt(ta);
  w(T, N, Le, Ir, Ir), w(ce, N, Q, Ir, Ir);
}
var Nr = [
  ["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
], Ko = [
  ["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
], kd = function(e, t) {
  var n = e.charCodeAt(0), r = e.charCodeAt(1), s = (n - 55296) * 1024 + (r - 56320) + 65536, u = t === "math" ? 0 : 1;
  if (119808 <= s && s < 120484) {
    var l = Math.floor((s - 119808) / 26);
    return [Nr[l][2], Nr[l][u]];
  } else if (120782 <= s && s <= 120831) {
    var o = Math.floor((s - 120782) / 10);
    return [Ko[o][2], Ko[o][u]];
  } else {
    if (s === 120485 || s === 120486)
      return [Nr[0][2], Nr[0][u]];
    if (120486 < s && s < 120782)
      return ["", ""];
    throw new Re("Unsupported character: " + e);
  }
}, As = function(e, t, n) {
  return lt[n][e] && lt[n][e].replace && (e = lt[n][e].replace), {
    value: e,
    metrics: Xa(e, t, n)
  };
}, mn = function(e, t, n, r, s) {
  var u = As(e, t, n), l = u.metrics;
  e = u.value;
  var o;
  if (l) {
    var h = l.italic;
    (n === "text" || r && r.font === "mathit") && (h = 0), o = new Dn(e, l.height, l.depth, h, l.skew, l.width, s);
  } else
    typeof console < "u" && console.warn("No character metrics " + ("for '" + e + "' in style '" + t + "' and mode '" + n + "'")), o = new Dn(e, 0, 0, 0, 0, 0, s);
  if (r) {
    o.maxFontSize = r.sizeMultiplier, r.style.isTight() && o.classes.push("mtight");
    var d = r.getColor();
    d && (o.style.color = d);
  }
  return o;
}, Sd = function(e, t, n, r) {
  return r === void 0 && (r = []), n.font === "boldsymbol" && As(e, "Main-Bold", t).metrics ? mn(e, "Main-Bold", t, n, r.concat(["mathbf"])) : e === "\\" || lt[t][e].font === "main" ? mn(e, "Main-Regular", t, n, r) : mn(e, "AMS-Regular", t, n, r.concat(["amsrm"]));
}, xd = function(e, t, n, r, s) {
  return s !== "textord" && As(e, "Math-BoldItalic", t).metrics ? {
    fontName: "Math-BoldItalic",
    fontClass: "boldsymbol"
  } : {
    fontName: "Main-Bold",
    fontClass: "mathbf"
  };
}, Ed = function(e, t, n) {
  var r = e.mode, s = e.text, u = ["mord"], l = r === "math" || r === "text" && t.font, o = l ? t.font : t.fontFamily, h = "", d = "";
  if (s.charCodeAt(0) === 55349 && ([h, d] = kd(s, r)), h.length > 0)
    return mn(s, h, r, t, u.concat(d));
  if (o) {
    var c, f;
    if (o === "boldsymbol") {
      var g = xd(s, r, t, u, n);
      c = g.fontName, f = [g.fontClass];
    } else l ? (c = j0[o].fontName, f = [o]) : (c = Pr(o, t.fontWeight, t.fontShape), f = [o, t.fontWeight, t.fontShape]);
    if (As(s, c, r).metrics)
      return mn(s, c, r, t, u.concat(f));
    if (V0.hasOwnProperty(s) && c.slice(0, 10) === "Typewriter") {
      for (var A = [], m = 0; m < s.length; m++)
        A.push(mn(s[m], c, r, t, u.concat(f)));
      return X0(A);
    }
  }
  if (n === "mathord")
    return mn(s, "Math-Italic", r, t, u.concat(["mathnormal"]));
  if (n === "textord") {
    var k = lt[r][s] && lt[r][s].font;
    if (k === "ams") {
      var a = Pr("amsrm", t.fontWeight, t.fontShape);
      return mn(s, a, r, t, u.concat("amsrm", t.fontWeight, t.fontShape));
    } else if (k === "main" || !k) {
      var p = Pr("textrm", t.fontWeight, t.fontShape);
      return mn(s, p, r, t, u.concat(t.fontWeight, t.fontShape));
    } else {
      var b = Pr(k, t.fontWeight, t.fontShape);
      return mn(s, b, r, t, u.concat(b, t.fontWeight, t.fontShape));
    }
  } else
    throw new Error("unexpected type: " + n + " in makeOrd");
}, _d = (i, e) => {
  if (si(i.classes) !== si(e.classes) || i.skew !== e.skew || i.maxFontSize !== e.maxFontSize)
    return !1;
  if (i.classes.length === 1) {
    var t = i.classes[0];
    if (t === "mbin" || t === "mord")
      return !1;
  }
  for (var n in i.style)
    if (i.style.hasOwnProperty(n) && i.style[n] !== e.style[n])
      return !1;
  for (var r in e.style)
    if (e.style.hasOwnProperty(r) && i.style[r] !== e.style[r])
      return !1;
  return !0;
}, Td = (i) => {
  for (var e = 0; e < i.length - 1; e++) {
    var t = i[e], n = i[e + 1];
    t instanceof Dn && n instanceof Dn && _d(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, i.splice(e + 1, 1), e--);
  }
  return i;
}, ja = function(e) {
  for (var t = 0, n = 0, r = 0, s = 0; s < e.children.length; s++) {
    var u = e.children[s];
    u.height > t && (t = u.height), u.depth > n && (n = u.depth), u.maxFontSize > r && (r = u.maxFontSize);
  }
  e.height = t, e.depth = n, e.maxFontSize = r;
}, Rt = function(e, t, n, r) {
  var s = new ys(e, t, n, r);
  return ja(s), s;
}, G0 = (i, e, t, n) => new ys(i, e, t, n), Cd = function(e, t, n) {
  var r = Rt([e], [], t);
  return r.height = Math.max(n || t.fontMetrics().defaultRuleThickness, t.minRuleThickness), r.style.borderBottomWidth = Se(r.height), r.maxFontSize = 1, r;
}, Dd = function(e, t, n, r) {
  var s = new U0(e, t, n, r);
  return ja(s), s;
}, X0 = function(e) {
  var t = new vr(e);
  return ja(t), t;
}, Fd = function(e, t) {
  return e instanceof vr ? Rt([], [e], t) : e;
}, Md = function(e) {
  if (e.positionType === "individualShift") {
    for (var t = e.children, n = [t[0]], r = -t[0].shift - t[0].elem.depth, s = r, u = 1; u < t.length; u++) {
      var l = -t[u].shift - s - t[u].elem.depth, o = l - (t[u - 1].elem.height + t[u - 1].elem.depth);
      s = s + l, n.push({
        type: "kern",
        size: o
      }), n.push(t[u]);
    }
    return {
      children: n,
      depth: r
    };
  }
  var h;
  if (e.positionType === "top") {
    for (var d = e.positionData, c = 0; c < e.children.length; c++) {
      var f = e.children[c];
      d -= f.type === "kern" ? f.size : f.elem.height + f.elem.depth;
    }
    h = d;
  } else if (e.positionType === "bottom")
    h = -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")
      h = -g.elem.depth - e.positionData;
    else if (e.positionType === "firstBaseline")
      h = -g.elem.depth;
    else
      throw new Error("Invalid positionType " + e.positionType + ".");
  }
  return {
    children: e.children,
    depth: h
  };
}, Rd = function(e, t) {
  for (var {
    children: n,
    depth: r
  } = Md(e), s = 0, u = 0; u < n.length; u++) {
    var l = n[u];
    if (l.type === "elem") {
      var o = l.elem;
      s = Math.max(s, o.maxFontSize, o.height);
    }
  }
  s += 2;
  var h = Rt(["pstrut"], []);
  h.style.height = Se(s);
  for (var d = [], c = r, f = r, g = r, A = 0; A < n.length; A++) {
    var m = n[A];
    if (m.type === "kern")
      g += m.size;
    else {
      var k = m.elem, a = m.wrapperClasses || [], p = m.wrapperStyle || {}, b = Rt(a, [h, k], void 0, p);
      b.style.top = Se(-s - g - k.depth), m.marginLeft && (b.style.marginLeft = m.marginLeft), m.marginRight && (b.style.marginRight = m.marginRight), d.push(b), g += k.height + k.depth;
    }
    c = Math.min(c, g), f = Math.max(f, g);
  }
  var y = Rt(["vlist"], d);
  y.style.height = Se(f);
  var C;
  if (c < 0) {
    var M = Rt([], []), L = Rt(["vlist"], [M]);
    L.style.height = Se(-c);
    var P = Rt(["vlist-s"], [new Dn("​")]);
    C = [Rt(["vlist-r"], [y, P]), Rt(["vlist-r"], [L])];
  } else
    C = [Rt(["vlist-r"], [y])];
  var O = Rt(["vlist-t"], C);
  return C.length === 2 && O.classes.push("vlist-t2"), O.height = f, O.depth = -c, O;
}, Ld = (i, e) => {
  var t = Rt(["mspace"], [], e), n = nt(i, e);
  return t.style.marginRight = Se(n), t;
}, Pr = function(e, t, n) {
  var r = "";
  switch (e) {
    case "amsrm":
      r = "AMS";
      break;
    case "textrm":
      r = "Main";
      break;
    case "textsf":
      r = "SansSerif";
      break;
    case "texttt":
      r = "Typewriter";
      break;
    default:
      r = e;
  }
  var s;
  return t === "textbf" && n === "textit" ? s = "BoldItalic" : t === "textbf" ? s = "Bold" : t === "textit" ? s = "Italic" : s = "Regular", r + "-" + s;
}, j0 = {
  // 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"
  },
  // "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"
  }
}, Y0 = {
  //   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]
}, Id = function(e, t) {
  var [n, r, s] = Y0[e], u = new _i(n), l = new ai([u], {
    width: Se(r),
    height: Se(s),
    // Override CSS rule `.katex svg { width: 100% }`
    style: "width:" + Se(r),
    viewBox: "0 0 " + 1e3 * r + " " + 1e3 * s,
    preserveAspectRatio: "xMinYMin"
  }), o = G0(["overlay"], [l], t);
  return o.height = s, o.style.height = Se(s), o.style.width = Se(r), o;
}, ne = {
  fontMap: j0,
  makeSymbol: mn,
  mathsym: Sd,
  makeSpan: Rt,
  makeSvgSpan: G0,
  makeLineSpan: Cd,
  makeAnchor: Dd,
  makeFragment: X0,
  wrapFragment: Fd,
  makeVList: Rd,
  makeOrd: Ed,
  makeGlue: Ld,
  staticSvg: Id,
  svgData: Y0,
  tryCombineChars: Td
}, et = {
  number: 3,
  unit: "mu"
}, fi = {
  number: 4,
  unit: "mu"
}, Pn = {
  number: 5,
  unit: "mu"
}, Nd = {
  mord: {
    mop: et,
    mbin: fi,
    mrel: Pn,
    minner: et
  },
  mop: {
    mord: et,
    mop: et,
    mrel: Pn,
    minner: et
  },
  mbin: {
    mord: fi,
    mop: fi,
    mopen: fi,
    minner: fi
  },
  mrel: {
    mord: Pn,
    mop: Pn,
    mopen: Pn,
    minner: Pn
  },
  mopen: {},
  mclose: {
    mop: et,
    mbin: fi,
    mrel: Pn,
    minner: et
  },
  mpunct: {
    mord: et,
    mop: et,
    mrel: Pn,
    mopen: et,
    mclose: et,
    mpunct: et,
    minner: et
  },
  minner: {
    mord: et,
    mop: et,
    mbin: fi,
    mrel: Pn,
    mopen: et,
    mpunct: et,
    minner: et
  }
}, Pd = {
  mord: {
    mop: et
  },
  mop: {
    mord: et,
    mop: et
  },
  mbin: {},
  mrel: {},
  mopen: {},
  mclose: {
    mop: et
  },
  mpunct: {},
  minner: {
    mop: et
  }
}, W0 = {}, is = {}, rs = {};
function Ee(i) {
  for (var {
    type: e,
    names: t,
    props: n,
    handler: r,
    htmlBuilder: s,
    mathmlBuilder: u
  } = i, 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: r
  }, o = 0; o < t.length; ++o)
    W0[t[o]] = l;
  e && (s && (is[e] = s), u && (rs[e] = u));
}
function Ri(i) {
  var {
    type: e,
    htmlBuilder: t,
    mathmlBuilder: n
  } = i;
  Ee({
    type: e,
    names: [],
    props: {
      numArgs: 0
    },
    handler() {
      throw new Error("Should never be called.");
    },
    htmlBuilder: t,
    mathmlBuilder: n
  });
}
var ss = function(e) {
  return e.type === "ordgroup" && e.body.length === 1 ? e.body[0] : e;
}, ot = function(e) {
  return e.type === "ordgroup" ? e.body : [e];
}, Xi = ne.makeSpan, Bd = ["leftmost", "mbin", "mopen", "mrel", "mop", "mpunct"], zd = ["rightmost", "mrel", "mclose", "mpunct"], Od = {
  display: Ne.DISPLAY,
  text: Ne.TEXT,
  script: Ne.SCRIPT,
  scriptscript: Ne.SCRIPTSCRIPT
}, Hd = {
  mord: "mord",
  mop: "mop",
  mbin: "mbin",
  mrel: "mrel",
  mopen: "mopen",
  mclose: "mclose",
  mpunct: "mpunct",
  minner: "minner"
}, gt = function(e, t, n, r) {
  r === void 0 && (r = [null, null]);
  for (var s = [], u = 0; u < e.length; u++) {
    var l = je(e[u], t);
    if (l instanceof vr) {
      var o = l.children;
      s.push(...o);
    } else
      s.push(l);
  }
  if (ne.tryCombineChars(s), !n)
    return s;
  var h = t;
  if (e.length === 1) {
    var d = e[0];
    d.type === "sizing" ? h = t.havingSize(d.size) : d.type === "styling" && (h = t.havingStyle(Od[d.style]));
  }
  var c = Xi([r[0] || "leftmost"], [], t), f = Xi([r[1] || "rightmost"], [], t), g = n === "root";
  return Zo(s, (A, m) => {
    var k = m.classes[0], a = A.classes[0];
    k === "mbin" && Ie.contains(zd, a) ? m.classes[0] = "mord" : a === "mbin" && Ie.contains(Bd, k) && (A.classes[0] = "mord");
  }, {
    node: c
  }, f, g), Zo(s, (A, m) => {
    var k = xa(m), a = xa(A), p = k && a ? A.hasClass("mtight") ? Pd[k][a] : Nd[k][a] : null;
    if (p)
      return ne.makeGlue(p, h);
  }, {
    node: c
  }, f, g), s;
}, Zo = function i(e, t, n, r, s) {
  r && e.push(r);
  for (var u = 0; u < e.length; u++) {
    var l = e[u], o = $0(l);
    if (o) {
      i(o.children, t, n, null, s);
      continue;
    }
    var h = !l.hasClass("mspace");
    if (h) {
      var d = t(l, n.node);
      d && (n.insertAfter ? n.insertAfter(d) : (e.unshift(d), u++));
    }
    h ? n.node = l : s && l.hasClass("newline") && (n.node = Xi(["leftmost"])), n.insertAfter = /* @__PURE__ */ ((c) => (f) => {
      e.splice(c + 1, 0, f), u++;
    })(u);
  }
  r && e.pop();
}, $0 = function(e) {
  return e instanceof vr || e instanceof U0 || e instanceof ys && e.hasClass("enclosing") ? e : null;
}, qd = function i(e, t) {
  var n = $0(e);
  if (n) {
    var r = n.children;
    if (r.length) {
      if (t === "right")
        return i(r[r.length - 1], "right");
      if (t === "left")
        return i(r[0], "left");
    }
  }
  return e;
}, xa = function(e, t) {
  return e ? (t && (e = qd(e, t)), Hd[e.classes[0]] || null) : null;
}, br = function(e, t) {
  var n = ["nulldelimiter"].concat(e.baseSizingClasses());
  return Xi(t.concat(n));
}, je = function(e, t, n) {
  if (!e)
    return Xi();
  if (is[e.type]) {
    var r = is[e.type](e, t);
    if (n && t.size !== n.size) {
      r = Xi(t.sizingClasses(n), [r], t);
      var s = t.sizeMultiplier / n.sizeMultiplier;
      r.height *= s, r.depth *= s;
    }
    return r;
  } else
    throw new Re("Got group of unknown type: '" + e.type + "'");
};
function K0(i) {
  return new vr(i);
}
class pn {
  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 = si(this.classes));
    for (var n = 0; n < this.children.length; n++)
      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 += Ie.escape(this.attributes[t]), e += '"');
    this.classes.length > 0 && (e += ' class ="' + Ie.escape(si(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 dr {
  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 Ie.escape(this.toText());
  }
  /**
   * Converts the text node into a string
   * (representing the text itself).
   */
  toText() {
    return this.text;
  }
}
class Ud {
  /**
   * 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", Se(this.width)), e;
  }
  /**
   * Converts the math node into an HTML markup string.
   */
  toMarkup() {
    return this.character ? "<mtext>" + this.character + "</mtext>" : '<mspace width="' + Se(this.width) + '"/>';
  }
  /**
   * Converts the math node into a string, similar to innerText.
   */
  toText() {
    return this.character ? this.character : " ";
  }
}
var ge = {
  MathNode: pn,
  TextNode: dr,
  SpaceNode: Ud,
  newDocumentFragment: K0
}, tn = function(e, t, n) {
  return lt[t][e] && lt[t][e].replace && e.charCodeAt(0) !== 55349 && !(V0.hasOwnProperty(e) && n && (n.fontFamily && n.fontFamily.slice(4, 6) === "tt" || n.font && n.font.slice(4, 6) === "tt")) && (e = lt[t][e].replace), new ge.TextNode(e);
}, Ya = function(e) {
  return e.length === 1 ? e[0] : new ge.MathNode("mrow", e);
}, Wa = 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 r = 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 === "mathfrak")
    return "fraktur";
  if (n === "mathscr" || n === "mathcal")
    return "script";
  if (n === "mathsf")
    return "sans-serif";
  if (n === "mathtt")
    return "monospace";
  var s = e.text;
  if (Ie.contains(["\\imath", "\\jmath"], s))
    return null;
  lt[r][s] && lt[r][s].replace && (s = lt[r][s].replace);
  var u = ne.fontMap[n].fontName;
  return Xa(s, u, r) ? ne.fontMap[n].variant : null;
}, Gt = function(e, t, n) {
  if (e.length === 1) {
    var r = $e(e[0], t);
    return n && r instanceof pn && r.type === "mo" && (r.setAttribute("lspace", "0em"), r.setAttribute("rspace", "0em")), [r];
  }
  for (var s = [], u, l = 0; l < e.length; l++) {
    var o = $e(e[l], t);
    if (o instanceof pn && u instanceof pn) {
      if (o.type === "mtext" && u.type === "mtext" && o.getAttribute("mathvariant") === u.getAttribute("mathvariant")) {
        u.children.push(...o.children);
        continue;
      } else if (o.type === "mn" && u.type === "mn") {
        u.children.push(...o.children);
        continue;
      } else if (o.type === "mi" && o.children.length === 1 && u.type === "mn") {
        var h = o.children[0];
        if (h instanceof dr && h.text === ".") {
          u.children.push(...o.children);
          continue;
        }
      } else if (u.type === "mi" && u.children.length === 1) {
        var d = u.children[0];
        if (d instanceof dr && d.text === "̸" && (o.type === "mo" || o.type === "mi" || o.type === "mn")) {
          var c = o.children[0];
          c instanceof dr && c.text.length > 0 && (c.text = c.text.slice(0, 1) + "̸" + c.text.slice(1), s.pop());
        }
      }
    }
    s.push(o), u = o;
  }
  return s;
}, oi = function(e, t, n) {
  return Ya(Gt(e, t, n));
}, $e = function(e, t) {
  if (!e)
    return new ge.MathNode("mrow");
  if (rs[e.type]) {
    var n = rs[e.type](e, t);
    return n;
  } else
    throw new Re("Got group of unknown type: '" + e.type + "'");
}, Vd = {
  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": "="
}, Gd = function(e) {
  var t = new ge.MathNode("mo", [new ge.TextNode(Vd[e.replace(/^\\/, "")])]);
  return t.setAttribute("stretchy", "true"), t;
}, Xd = {
  //   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]
}, jd = function(e) {
  return e.type === "ordgroup" ? e.body.length : 1;
}, Yd = function(e, t) {
  function n() {
    var l = 4e5, o = e.label.slice(1);
    if (Ie.contains(["widehat", "widecheck", "widetilde", "utilde"], o)) {
      var h = e, d = jd(h.base), c, f, g;
      if (d > 5)
        o === "widehat" || o === "widecheck" ? (c = 420, l = 2364, g = 0.42, f = o + "4") : (c = 312, l = 2340, g = 0.34, f = "tilde4");
      else {
        var A = [1, 1, 2, 2, 3, 3][d];
        o === "widehat" || o === "widecheck" ? (l = [0, 1062, 2364, 2364, 2364][A], c = [0, 239, 300, 360, 420][A], g = [0, 0.24, 0.3, 0.3, 0.36, 0.42][A], f = o + A) : (l = [0, 600, 1033, 2339, 2340][A], c = [0, 260, 286, 306, 312][A], g = [0, 0.26, 0.286, 0.3, 0.306, 0.34][A], f = "tilde" + A);
      }
      var m = new _i(f), k = new ai([m], {
        width: "100%",
        height: Se(g),
        viewBox: "0 0 " + l + " " + c,
        preserveAspectRatio: "none"
      });
      return {
        span: ne.makeSvgSpan([], [k], t),
        minWidth: 0,
        height: g
      };
    } else {
      var a = [], p = Xd[o], [b, y, C] = p, M = C / 1e3, L = b.length, P, O;
      if (L === 1) {
        var q = p[3];
        P = ["hide-tail"], O = [q];
      } else if (L === 2)
        P = ["halfarrow-left", "halfarrow-right"], O = ["xMinYMin", "xMaxYMin"];
      else if (L === 3)
        P = ["brace-left", "brace-center", "brace-right"], O = ["xMinYMin", "xMidYMin", "xMaxYMin"];
      else
        throw new Error(`Correct katexImagesData or update code here to support
                    ` + L + " children.");
      for (var Y = 0; Y < L; Y++) {
        var se = new _i(b[Y]), me = new ai([se], {
          width: "400em",
          height: Se(M),
          viewBox: "0 0 " + l + " " + C,
          preserveAspectRatio: O[Y] + " slice"
        }), te = ne.makeSvgSpan([P[Y]], [me], t);
        if (L === 1)
          return {
            span: te,
            minWidth: y,
            height: M
          };
        te.style.height = Se(M), a.push(te);
      }
      return {
        span: ne.makeSpan(["stretchy"], a, t),
        minWidth: y,
        height: M
      };
    }
  }
  var {
    span: r,
    minWidth: s,
    height: u
  } = n();
  return r.height = u, r.style.height = Se(u), s > 0 && (r.style.minWidth = Se(s)), r;
}, Wd = function(e, t, n, r, s) {
  var u, l = e.height + e.depth + n + r;
  if (/fbox|color|angl/.test(t)) {
    if (u = ne.makeSpan(["stretchy", t], [], s), t === "fbox") {
      var o = s.color && s.getColor();
      o && (u.style.borderColor = o);
    }
  } else {
    var h = [];
    /^[bx]cancel$/.test(t) && h.push(new Vo({
      x1: "0",
      y1: "0",
      x2: "100%",
      y2: "100%",
      "stroke-width": "0.046em"
    })), /^x?cancel$/.test(t) && h.push(new Vo({
      x1: "0",
      y1: "100%",
      x2: "100%",
      y2: "0",
      "stroke-width": "0.046em"
    }));
    var d = new ai(h, {
      width: "100%",
      height: Se(l)
    });
    u = ne.makeSvgSpan([], [d], s);
  }
  return u.height = l, u.style.height = Se(l), u;
}, Vn = {
  encloseSpan: Wd,
  mathMLnode: Gd,
  svgSpan: Yd
};
function qe(i, e) {
  if (!i || i.type !== e)
    throw new Error("Expected node of type " + e + ", but got " + (i ? "node of type " + i.type : String(i)));
  return i;
}
function $a(i) {
  var e = ks(i);
  if (!e)
    throw new Error("Expected node of symbol group type, but got " + (i ? "node of type " + i.type : String(i)));
  return e;
}
function ks(i) {
  return i && (i.type === "atom" || Ad.hasOwnProperty(i.type)) ? i : null;
}
var Ka = (i, e) => {
  var t, n, r;
  i && i.type === "supsub" ? (n = qe(i.base, "accent"), t = n.base, i.base = t, r = wd(je(i, e)), i.base = n) : (n = qe(i, "accent"), t = n.base);
  var s = je(t, e.havingCrampedStyle()), u = n.isShifty && Ie.isCharacterBox(t), l = 0;
  if (u) {
    var o = Ie.getBaseElem(t), h = je(o, e.havingCrampedStyle());
    l = Go(h).skew;
  }
  var d = n.label === "\\c", c = d ? s.height + s.depth : Math.min(s.height, e.fontMetrics().xHeight), f;
  if (n.isStretchy)
    f = Vn.svgSpan(n, e), f = ne.makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: s
      }, {
        type: "elem",
        elem: f,
        wrapperClasses: ["svg-align"],
        wrapperStyle: l > 0 ? {
          width: "calc(100% - " + Se(2 * l) + ")",
          marginLeft: Se(2 * l)
        } : void 0
      }]
    }, e);
  else {
    var g, A;
    n.label === "\\vec" ? (g = ne.staticSvg("vec", e), A = ne.svgData.vec[1]) : (g = ne.makeOrd({
      mode: n.mode,
      text: n.label
    }, e, "textord"), g = Go(g), g.italic = 0, A = g.width, d && (c += g.depth)), f = ne.makeSpan(["accent-body"], [g]);
    var m = n.label === "\\textcircled";
    m && (f.classes.push("accent-full"), c = s.height);
    var k = l;
    m || (k -= A / 2), f.style.left = Se(k), n.label === "\\textcircled" && (f.style.top = ".2em"), f = ne.makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: s
      }, {
        type: "kern",
        size: -c
      }, {
        type: "elem",
        elem: f
      }]
    }, e);
  }
  var a = ne.makeSpan(["mord", "accent"], [f], e);
  return r ? (r.children[0] = a, r.height = Math.max(a.height, r.height), r.classes[0] = "mord", r) : a;
}, Z0 = (i, e) => {
  var t = i.isStretchy ? Vn.mathMLnode(i.label) : new ge.MathNode("mo", [tn(i.label, i.mode)]), n = new ge.MathNode("mover", [$e(i.base, e), t]);
  return n.setAttribute("accent", "true"), n;
}, $d = new RegExp(["\\acute", "\\grave", "\\ddot", "\\tilde", "\\bar", "\\breve", "\\check", "\\hat", "\\vec", "\\dot", "\\mathring"].map((i) => "\\" + i).join("|"));
Ee({
  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: (i, e) => {
    var t = ss(e[0]), n = !$d.test(i.funcName), r = !n || i.funcName === "\\widehat" || i.funcName === "\\widetilde" || i.funcName === "\\widecheck";
    return {
      type: "accent",
      mode: i.parser.mode,
      label: i.funcName,
      isStretchy: n,
      isShifty: r,
      base: t
    };
  },
  htmlBuilder: Ka,
  mathmlBuilder: Z0
});
Ee({
  type: "accent",
  names: ["\\'", "\\`", "\\^", "\\~", "\\=", "\\u", "\\.", '\\"', "\\c", "\\r", "\\H", "\\v", "\\textcircled"],
  props: {
    numArgs: 1,
    allowedInText: !0,
    allowedInMath: !0,
    // unless in strict mode
    argTypes: ["primitive"]
  },
  handler: (i, e) => {
    var t = e[0], n = i.parser.mode;
    return n === "math" && (i.parser.settings.reportNonstrict("mathVsTextAccents", "LaTeX's accent " + i.funcName + " works only in text mode"), n = "text"), {
      type: "accent",
      mode: n,
      label: i.funcName,
      isStretchy: !1,
      isShifty: !0,
      base: t
    };
  },
  htmlBuilder: Ka,
  mathmlBuilder: Z0
});
Ee({
  type: "accentUnder",
  names: ["\\underleftarrow", "\\underrightarrow", "\\underleftrightarrow", "\\undergroup", "\\underlinesegment", "\\utilde"],
  props: {
    numArgs: 1
  },
  handler: (i, e) => {
    var {
      parser: t,
      funcName: n
    } = i, r = e[0];
    return {
      type: "accentUnder",
      mode: t.mode,
      label: n,
      base: r
    };
  },
  htmlBuilder: (i, e) => {
    var t = je(i.base, e), n = Vn.svgSpan(i, e), r = i.label === "\\utilde" ? 0.12 : 0, s = ne.makeVList({
      positionType: "top",
      positionData: t.height,
      children: [{
        type: "elem",
        elem: n,
        wrapperClasses: ["svg-align"]
      }, {
        type: "kern",
        size: r
      }, {
        type: "elem",
        elem: t
      }]
    }, e);
    return ne.makeSpan(["mord", "accentunder"], [s], e);
  },
  mathmlBuilder: (i, e) => {
    var t = Vn.mathMLnode(i.label), n = new ge.MathNode("munder", [$e(i.base, e), t]);
    return n.setAttribute("accentunder", "true"), n;
  }
});
var Br = (i) => {
  var e = new ge.MathNode("mpadded", i ? [i] : []);
  return e.setAttribute("width", "+0.6em"), e.setAttribute("lspace", "0.3em"), e;
};
Ee({
  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(i, e, t) {
    var {
      parser: n,
      funcName: r
    } = i;
    return {
      type: "xArrow",
      mode: n.mode,
      label: r,
      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(i, e) {
    var t = e.style, n = e.havingStyle(t.sup()), r = ne.wrapFragment(je(i.body, n, e), e), s = i.label.slice(0, 2) === "\\x" ? "x" : "cd";
    r.classes.push(s + "-arrow-pad");
    var u;
    i.below && (n = e.havingStyle(t.sub()), u = ne.wrapFragment(je(i.below, n, e), e), u.classes.push(s + "-arrow-pad"));
    var l = Vn.svgSpan(i, e), o = -e.fontMetrics().axisHeight + 0.5 * l.height, h = -e.fontMetrics().axisHeight - 0.5 * l.height - 0.111;
    (r.depth > 0.25 || i.label === "\\xleftequilibrium") && (h -= r.depth);
    var d;
    if (u) {
      var c = -e.fontMetrics().axisHeight + u.height + 0.5 * l.height + 0.111;
      d = ne.makeVList({
        positionType: "individualShift",
        children: [{
          type: "elem",
          elem: r,
          shift: h
        }, {
          type: "elem",
          elem: l,
          shift: o
        }, {
          type: "elem",
          elem: u,
          shift: c
        }]
      }, e);
    } else
      d = ne.makeVList({
        positionType: "individualShift",
        children: [{
          type: "elem",
          elem: r,
          shift: h
        }, {
          type: "elem",
          elem: l,
          shift: o
        }]
      }, e);
    return d.children[0].children[0].children[1].classes.push("svg-align"), ne.makeSpan(["mrel", "x-arrow"], [d], e);
  },
  mathmlBuilder(i, e) {
    var t = Vn.mathMLnode(i.label);
    t.setAttribute("minsize", i.label.charAt(0) === "x" ? "1.75em" : "3.0em");
    var n;
    if (i.body) {
      var r = Br($e(i.body, e));
      if (i.below) {
        var s = Br($e(i.below, e));
        n = new ge.MathNode("munderover", [t, s, r]);
      } else
        n = new ge.MathNode("mover", [t, r]);
    } else if (i.below) {
      var u = Br($e(i.below, e));
      n = new ge.MathNode("munder", [t, u]);
    } else
      n = Br(), n = new ge.MathNode("mover", [t, n]);
    return n;
  }
});
var Kd = ne.makeSpan;
function Q0(i, e) {
  var t = gt(i.body, e, !0);
  return Kd([i.mclass], t, e);
}
function J0(i, e) {
  var t, n = Gt(i.body, e);
  return i.mclass === "minner" ? t = new ge.MathNode("mpadded", n) : i.mclass === "mord" ? i.isCharacterBox ? (t = n[0], t.type = "mi") : t = new ge.MathNode("mi", n) : (i.isCharacterBox ? (t = n[0], t.type = "mo") : t = new ge.MathNode("mo", n), i.mclass === "mbin" ? (t.attributes.lspace = "0.22em", t.attributes.rspace = "0.22em") : i.mclass === "mpunct" ? (t.attributes.lspace = "0em", t.attributes.rspace = "0.17em") : i.mclass === "mopen" || i.mclass === "mclose" ? (t.attributes.lspace = "0em", t.attributes.rspace = "0em") : i.mclass === "minner" && (t.attributes.lspace = "0.0556em", t.attributes.width = "+0.1111em")), t;
}
Ee({
  type: "mclass",
  names: ["\\mathord", "\\mathbin", "\\mathrel", "\\mathopen", "\\mathclose", "\\mathpunct", "\\mathinner"],
  props: {
    numArgs: 1,
    primitive: !0
  },
  handler(i, e) {
    var {
      parser: t,
      funcName: n
    } = i, r = e[0];
    return {
      type: "mclass",
      mode: t.mode,
      mclass: "m" + n.slice(5),
      // TODO(kevinb): don't prefix with 'm'
      body: ot(r),
      isCharacterBox: Ie.isCharacterBox(r)
    };
  },
  htmlBuilder: Q0,
  mathmlBuilder: J0
});
var Ss = (i) => {
  var e = i.type === "ordgroup" && i.body.length ? i.body[0] : i;
  return e.type === "atom" && (e.family === "bin" || e.family === "rel") ? "m" + e.family : "mord";
};
Ee({
  type: "mclass",
  names: ["\\@binrel"],
  props: {
    numArgs: 2
  },
  handler(i, e) {
    var {
      parser: t
    } = i;
    return {
      type: "mclass",
      mode: t.mode,
      mclass: Ss(e[0]),
      body: ot(e[1]),
      isCharacterBox: Ie.isCharacterBox(e[1])
    };
  }
});
Ee({
  type: "mclass",
  names: ["\\stackrel", "\\overset", "\\underset"],
  props: {
    numArgs: 2
  },
  handler(i, e) {
    var {
      parser: t,
      funcName: n
    } = i, r = e[1], s = e[0], u;
    n !== "\\stackrel" ? u = Ss(r) : u = "mrel";
    var l = {
      type: "op",
      mode: r.mode,
      limits: !0,
      alwaysHandleSupSub: !0,
      parentIsSupSub: !1,
      symbol: !1,
      suppressBaseShift: n !== "\\stackrel",
      body: ot(r)
    }, o = {
      type: "supsub",
      mode: s.mode,
      base: l,
      sup: n === "\\underset" ? null : s,
      sub: n === "\\underset" ? s : null
    };
    return {
      type: "mclass",
      mode: t.mode,
      mclass: u,
      body: [o],
      isCharacterBox: Ie.isCharacterBox(o)
    };
  },
  htmlBuilder: Q0,
  mathmlBuilder: J0
});
Ee({
  type: "pmb",
  names: ["\\pmb"],
  props: {
    numArgs: 1,
    allowedInText: !0
  },
  handler(i, e) {
    var {
      parser: t
    } = i;
    return {
      type: "pmb",
      mode: t.mode,
      mclass: Ss(e[0]),
      body: ot(e[0])
    };
  },
  htmlBuilder(i, e) {
    var t = gt(i.body, e, !0), n = ne.makeSpan([i.mclass], t, e);
    return n.style.textShadow = "0.02em 0.01em 0.04px", n;
  },
  mathmlBuilder(i, e) {
    var t = Gt(i.body, e), n = new ge.MathNode("mstyle", t);
    return n.setAttribute("style", "text-shadow: 0.02em 0.01em 0.04px"), n;
  }
});
var Zd = {
  ">": "\\\\cdrightarrow",
  "<": "\\\\cdleftarrow",
  "=": "\\\\cdlongequal",
  A: "\\uparrow",
  V: "\\downarrow",
  "|": "\\Vert",
  ".": "no arrow"
}, Qo = () => ({
  type: "styling",
  body: [],
  mode: "math",
  style: "display"
}), Jo = (i) => i.type === "textord" && i.text === "@", Qd = (i, e) => (i.type === "mathord" || i.type === "atom") && i.text === e;
function Jd(i, e, t) {
  var n = Zd[i];
  switch (n) {
    case "\\\\cdrightarrow":
    case "\\\\cdleftarrow":
      return t.callFunction(n, [e[0]], [e[1]]);
    case "\\uparrow":
    case "\\downarrow": {
      var r = t.callFunction("\\\\cdleft", [e[0]], []), s = {
        type: "atom",
        text: n,
        mode: "math",
        family: "rel"
      }, u = t.callFunction("\\Big", [s], []), l = t.callFunction("\\\\cdright", [e[1]], []), o = {
        type: "ordgroup",
        mode: "math",
        body: [r, u, l]
      };
      return t.callFunction("\\\\cdparent", [o], []);
    }
    case "\\\\cdlongequal":
      return t.callFunction("\\\\cdlongequal", [], []);
    case "\\Vert": {
      var h = {
        type: "textord",
        text: "\\Vert",
        mode: "math"
      };
      return t.callFunction("\\Big", [h], []);
    }
    default:
      return {
        type: "textord",
        text: " ",
        mode: "math"
      };
  }
}
function ef(i) {
  var e = [];
  for (i.gullet.beginGroup(), i.gullet.macros.set("\\cr", "\\\\\\relax"), i.gullet.beginGroup(); ; ) {
    e.push(i.parseExpression(!1, "\\\\")), i.gullet.endGroup(), i.gullet.beginGroup();
    var t = i.fetch().text;
    if (t === "&" || t === "\\\\")
      i.consume();
    else if (t === "\\end") {
      e[e.length - 1].length === 0 && e.pop();
      break;
    } else
      throw new Re("Expected \\\\ or \\cr or \\end", i.nextToken);
  }
  for (var n = [], r = [n], s = 0; s < e.length; s++) {
    for (var u = e[s], l = Qo(), o = 0; o < u.length; o++)
      if (!Jo(u[o]))
        l.body.push(u[o]);
      else {
        n.push(l), o += 1;
        var h = $a(u[o]).text, d = new Array(2);
        if (d[0] = {
          type: "ordgroup",
          mode: "math",
          body: []
        }, d[1] = {
          type: "ordgroup",
          mode: "math",
          body: []
        }, !("=|.".indexOf(h) > -1)) if ("<>AV".indexOf(h) > -1)
          for (var c = 0; c < 2; c++) {
            for (var f = !0, g = o + 1; g < u.length; g++) {
              if (Qd(u[g], h)) {
                f = !1, o = g;
                break;
              }
              if (Jo(u[g]))
                throw new Re("Missing a " + h + " character to complete a CD arrow.", u[g]);
              d[c].body.push(u[g]);
            }
            if (f)
              throw new Re("Missing a " + h + " character to complete a CD arrow.", u[o]);
          }
        else
          throw new Re('Expected one of "<>AV=|." after @', u[o]);
        var A = Jd(h, d, i), m = {
          type: "styling",
          body: [A],
          mode: "math",
          style: "display"
          // CD is always displaystyle.
        };
        n.push(m), l = Qo();
      }
    s % 2 === 0 ? n.push(l) : n.shift(), n = [], r.push(n);
  }
  i.gullet.endGroup(), i.gullet.endGroup();
  var k = new Array(r[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: r,
    arraystretch: 1,
    addJot: !0,
    rowGaps: [null],
    cols: k,
    colSeparationType: "CD",
    hLinesBeforeRow: new Array(r.length + 1).fill([])
  };
}
Ee({
  type: "cdlabel",
  names: ["\\\\cdleft", "\\\\cdright"],
  props: {
    numArgs: 1
  },
  handler(i, e) {
    var {
      parser: t,
      funcName: n
    } = i;
    return {
      type: "cdlabel",
      mode: t.mode,
      side: n.slice(4),
      label: e[0]
    };
  },
  htmlBuilder(i, e) {
    var t = e.havingStyle(e.style.sup()), n = ne.wrapFragment(je(i.label, t, e), e);
    return n.classes.push("cd-label-" + i.side), n.style.bottom = Se(0.8 - n.depth), n.height = 0, n.depth = 0, n;
  },
  mathmlBuilder(i, e) {
    var t = new ge.MathNode("mrow", [$e(i.label, e)]);
    return t = new ge.MathNode("mpadded", [t]), t.setAttribute("width", "0"), i.side === "left" && t.setAttribute("lspace", "-1width"), t.setAttribute("voffset", "0.7em"), t = new ge.MathNode("mstyle", [t]), t.setAttribute("displaystyle", "false"), t.setAttribute("scriptlevel", "1"), t;
  }
});
Ee({
  type: "cdlabelparent",
  names: ["\\\\cdparent"],
  props: {
    numArgs: 1
  },
  handler(i, e) {
    var {
      parser: t
    } = i;
    return {
      type: "cdlabelparent",
      mode: t.mode,
      fragment: e[0]
    };
  },
  htmlBuilder(i, e) {
    var t = ne.wrapFragment(je(i.fragment, e), e);
    return t.classes.push("cd-vert-arrow"), t;
  },
  mathmlBuilder(i, e) {
    return new ge.MathNode("mrow", [$e(i.fragment, e)]);
  }
});
Ee({
  type: "textord",
  names: ["\\@char"],
  props: {
    numArgs: 1,
    allowedInText: !0
  },
  handler(i, e) {
    for (var {
      parser: t
    } = i, n = qe(e[0], "ordgroup"), r = n.body, s = "", u = 0; u < r.length; u++) {
      var l = qe(r[u], "textord");
      s += l.text;
    }
    var o = parseInt(s), h;
    if (isNaN(o))
      throw new Re("\\@char has non-numeric argument " + s);
    if (o < 0 || o >= 1114111)
      throw new Re("\\@char with invalid code point " + s);
    return o <= 65535 ? h = String.fromCharCode(o) : (o -= 65536, h = String.fromCharCode((o >> 10) + 55296, (o & 1023) + 56320)), {
      type: "textord",
      mode: t.mode,
      text: h
    };
  }
});
var eu = (i, e) => {
  var t = gt(i.body, e.withColor(i.color), !1);
  return ne.makeFragment(t);
}, tu = (i, e) => {
  var t = Gt(i.body, e.withColor(i.color)), n = new ge.MathNode("mstyle", t);
  return n.setAttribute("mathcolor", i.color), n;
};
Ee({
  type: "color",
  names: ["\\textcolor"],
  props: {
    numArgs: 2,
    allowedInText: !0,
    argTypes: ["color", "original"]
  },
  handler(i, e) {
    var {
      parser: t
    } = i, n = qe(e[0], "color-token").color, r = e[1];
    return {
      type: "color",
      mode: t.mode,
      color: n,
      body: ot(r)
    };
  },
  htmlBuilder: eu,
  mathmlBuilder: tu
});
Ee({
  type: "color",
  names: ["\\color"],
  props: {
    numArgs: 1,
    allowedInText: !0,
    argTypes: ["color"]
  },
  handler(i, e) {
    var {
      parser: t,
      breakOnTokenText: n
    } = i, r = qe(e[0], "color-token").color;
    t.gullet.macros.set("\\current@color", r);
    var s = t.parseExpression(!0, n);
    return {
      type: "color",
      mode: t.mode,
      color: r,
      body: s
    };
  },
  htmlBuilder: eu,
  mathmlBuilder: tu
});
Ee({
  type: "cr",
  names: ["\\\\"],
  props: {
    numArgs: 0,
    numOptionalArgs: 0,
    allowedInText: !0
  },
  handler(i, e, t) {
    var {
      parser: n
    } = i, r = n.gullet.future().text === "[" ? n.parseSizeGroup(!0) : null, s = !n.settings.displayMode || !n.settings.useStrictBehavior("newLineInDisplayMode", "In LaTeX, \\\\ or \\newline does nothing in display mode");
    return {
      type: "cr",
      mode: n.mode,
      newLine: s,
      size: r && qe(r, "size").value
    };
  },
  // The following builders are called only at the top level,
  // not within tabular/array environments.
  htmlBuilder(i, e) {
    var t = ne.makeSpan(["mspace"], [], e);
    return i.newLine && (t.classes.push("newline"), i.size && (t.style.marginTop = Se(nt(i.size, e)))), t;
  },
  mathmlBuilder(i, e) {
    var t = new ge.MathNode("mspace");
    return i.newLine && (t.setAttribute("linebreak", "newline"), i.size && t.setAttribute("height", Se(nt(i.size, e)))), t;
  }
});
var Ea = {
  "\\global": "\\global",
  "\\long": "\\\\globallong",
  "\\\\globallong": "\\\\globallong",
  "\\def": "\\gdef",
  "\\gdef": "\\gdef",
  "\\edef": "\\xdef",
  "\\xdef": "\\xdef",
  "\\let": "\\\\globallet",
  "\\futurelet": "\\\\globalfuture"
}, nu = (i) => {
  var e = i.text;
  if (/^(?:[\\{}$&#^_]|EOF)$/.test(e))
    throw new Re("Expected a control sequence", i);
  return e;
}, tf = (i) => {
  var e = i.gullet.popToken();
  return e.text === "=" && (e = i.gullet.popToken(), e.text === " " && (e = i.gullet.popToken())), e;
}, iu = (i, e, t, n) => {
  var r = i.gullet.macros.get(t.text);
  r == null && (t.noexpand = !0, r = {
    tokens: [t],
    numArgs: 0,
    // reproduce the same behavior in expansion
    unexpandable: !i.gullet.isExpandable(t.text)
  }), i.gullet.macros.set(e, r, n);
};
Ee({
  type: "internal",
  names: [
    "\\global",
    "\\long",
    "\\\\globallong"
    // can’t be entered directly
  ],
  props: {
    numArgs: 0,
    allowedInText: !0
  },
  handler(i) {
    var {
      parser: e,
      funcName: t
    } = i;
    e.consumeSpaces();
    var n = e.fetch();
    if (Ea[n.text])
      return (t === "\\global" || t === "\\\\globallong") && (n.text = Ea[n.text]), qe(e.parseFunction(), "internal");
    throw new Re("Invalid token after macro prefix", n);
  }
});
Ee({
  type: "internal",
  names: ["\\def", "\\gdef", "\\edef", "\\xdef"],
  props: {
    numArgs: 0,
    allowedInText: !0,
    primitive: !0
  },
  handler(i) {
    var {
      parser: e,
      funcName: t
    } = i, n = e.gullet.popToken(), r = n.text;
    if (/^(?:[\\{}$&#^_]|EOF)$/.test(r))
      throw new Re("Expected a control sequence", n);
    for (var s = 0, u, l = [[]]; e.gullet.future().text !== "{"; )
      if (n = e.gullet.popToken(), n.text === "#") {
        if (e.gullet.future().text === "{") {
          u = e.gullet.future(), l[s].push("{");
          break;
        }
        if (n = e.gullet.popToken(), !/^[1-9]$/.test(n.text))
          throw new Re('Invalid argument number "' + n.text + '"');
        if (parseInt(n.text) !== s + 1)
          throw new Re('Argument number "' + n.text + '" out of order');
        s++, l.push([]);
      } else {
        if (n.text === "EOF")
          throw new Re("Expected a macro definition");
        l[s].push(n.text);
      }
    var {
      tokens: o
    } = e.gullet.consumeArg();
    return u && o.unshift(u), (t === "\\edef" || t === "\\xdef") && (o = e.gullet.expandTokens(o), o.reverse()), e.gullet.macros.set(r, {
      tokens: o,
      numArgs: s,
      delimiters: l
    }, t === Ea[t]), {
      type: "internal",
      mode: e.mode
    };
  }
});
Ee({
  type: "internal",
  names: [
    "\\let",
    "\\\\globallet"
    // can’t be entered directly
  ],
  props: {
    numArgs: 0,
    allowedInText: !0,
    primitive: !0
  },
  handler(i) {
    var {
      parser: e,
      funcName: t
    } = i, n = nu(e.gullet.popToken());
    e.gullet.consumeSpaces();
    var r = tf(e);
    return iu(e, n, r, t === "\\\\globallet"), {
      type: "internal",
      mode: e.mode
    };
  }
});
Ee({
  type: "internal",
  names: [
    "\\futurelet",
    "\\\\globalfuture"
    // can’t be entered directly
  ],
  props: {
    numArgs: 0,
    allowedInText: !0,
    primitive: !0
  },
  handler(i) {
    var {
      parser: e,
      funcName: t
    } = i, n = nu(e.gullet.popToken()), r = e.gullet.popToken(), s = e.gullet.popToken();
    return iu(e, n, s, t === "\\\\globalfuture"), e.gullet.pushToken(s), e.gullet.pushToken(r), {
      type: "internal",
      mode: e.mode
    };
  }
});
var cr = function(e, t, n) {
  var r = lt.math[e] && lt.math[e].replace, s = Xa(r || e, t, n);
  if (!s)
    throw new Error("Unsupported symbol " + e + " and font size " + t + ".");
  return s;
}, Za = function(e, t, n, r) {
  var s = n.havingBaseStyle(t), u = ne.makeSpan(r.concat(s.sizingClasses(n)), [e], n), l = s.sizeMultiplier / n.sizeMultiplier;
  return u.height *= l, u.depth *= l, u.maxFontSize = s.sizeMultiplier, u;
}, ru = function(e, t, n) {
  var r = t.havingBaseStyle(n), s = (1 - t.sizeMultiplier / r.sizeMultiplier) * t.fontMetrics().axisHeight;
  e.classes.push("delimcenter"), e.style.top = Se(s), e.height -= s, e.depth += s;
}, nf = function(e, t, n, r, s, u) {
  var l = ne.makeSymbol(e, "Main-Regular", s, r), o = Za(l, t, r, u);
  return n && ru(o, r, t), o;
}, rf = function(e, t, n, r) {
  return ne.makeSymbol(e, "Size" + t + "-Regular", n, r);
}, su = function(e, t, n, r, s, u) {
  var l = rf(e, t, s, r), o = Za(ne.makeSpan(["delimsizing", "size" + t], [l], r), Ne.TEXT, r, u);
  return n && ru(o, r, Ne.TEXT), o;
}, na = function(e, t, n) {
  var r;
  t === "Size1-Regular" ? r = "delim-size1" : r = "delim-size4";
  var s = ne.makeSpan(["delimsizinginner", r], [ne.makeSpan([], [ne.makeSymbol(e, t, n)])]);
  return {
    type: "elem",
    elem: s
  };
}, ia = function(e, t, n) {
  var r = On["Size4-Regular"][e.charCodeAt(0)] ? On["Size4-Regular"][e.charCodeAt(0)][4] : On["Size1-Regular"][e.charCodeAt(0)][4], s = new _i("inner", md(e, Math.round(1e3 * t))), u = new ai([s], {
    width: Se(r),
    height: Se(t),
    // Override CSS rule `.katex svg { width: 100% }`
    style: "width:" + Se(r),
    viewBox: "0 0 " + 1e3 * r + " " + Math.round(1e3 * t),
    preserveAspectRatio: "xMinYMin"
  }), l = ne.makeSvgSpan([], [u], n);
  return l.height = t, l.style.height = Se(t), l.style.width = Se(r), {
    type: "elem",
    elem: l
  };
}, _a = 8e-3, zr = {
  type: "kern",
  size: -1 * _a
}, sf = ["|", "\\lvert", "\\rvert", "\\vert"], af = ["\\|", "\\lVert", "\\rVert", "\\Vert"], au = function(e, t, n, r, s, u) {
  var l, o, h, d, c = "", f = 0;
  l = h = d = e, o = null;
  var g = "Size1-Regular";
  e === "\\uparrow" ? h = d = "⏐" : e === "\\Uparrow" ? h = d = "‖" : e === "\\downarrow" ? l = h = "⏐" : e === "\\Downarrow" ? l = h = "‖" : e === "\\updownarrow" ? (l = "\\uparrow", h = "⏐", d = "\\downarrow") : e === "\\Updownarrow" ? (l = "\\Uparrow", h = "‖", d = "\\Downarrow") : Ie.contains(sf, e) ? (h = "∣", c = "vert", f = 333) : Ie.contains(af, e) ? (h = "∥", c = "doublevert", f = 556) : e === "[" || e === "\\lbrack" ? (l = "⎡", h = "⎢", d = "⎣", g = "Size4-Regular", c = "lbrack", f = 667) : e === "]" || e === "\\rbrack" ? (l = "⎤", h = "⎥", d = "⎦", g = "Size4-Regular", c = "rbrack", f = 667) : e === "\\lfloor" || e === "⌊" ? (h = l = "⎢", d = "⎣", g = "Size4-Regular", c = "lfloor", f = 667) : e === "\\lceil" || e === "⌈" ? (l = "⎡", h = d = "⎢", g = "Size4-Regular", c = "lceil", f = 667) : e === "\\rfloor" || e === "⌋" ? (h = l = "⎥", d = "⎦", g = "Size4-Regular", c = "rfloor", f = 667) : e === "\\rceil" || e === "⌉" ? (l = "⎤", h = d = "⎥", g = "Size4-Regular", c = "rceil", f = 667) : e === "(" || e === "\\lparen" ? (l = "⎛", h = "⎜", d = "⎝", g = "Size4-Regular", c = "lparen", f = 875) : e === ")" || e === "\\rparen" ? (l = "⎞", h = "⎟", d = "⎠", g = "Size4-Regular", c = "rparen", f = 875) : e === "\\{" || e === "\\lbrace" ? (l = "⎧", o = "⎨", d = "⎩", h = "⎪", g = "Size4-Regular") : e === "\\}" || e === "\\rbrace" ? (l = "⎫", o = "⎬", d = "⎭", h = "⎪", g = "Size4-Regular") : e === "\\lgroup" || e === "⟮" ? (l = "⎧", d = "⎩", h = "⎪", g = "Size4-Regular") : e === "\\rgroup" || e === "⟯" ? (l = "⎫", d = "⎭", h = "⎪", g = "Size4-Regular") : e === "\\lmoustache" || e === "⎰" ? (l = "⎧", d = "⎭", h = "⎪", g = "Size4-Regular") : (e === "\\rmoustache" || e === "⎱") && (l = "⎫", d = "⎩", h = "⎪", g = "Size4-Regular");
  var A = cr(l, g, s), m = A.height + A.depth, k = cr(h, g, s), a = k.height + k.depth, p = cr(d, g, s), b = p.height + p.depth, y = 0, C = 1;
  if (o !== null) {
    var M = cr(o, g, s);
    y = M.height + M.depth, C = 2;
  }
  var L = m + b + y, P = Math.max(0, Math.ceil((t - L) / (C * a))), O = L + P * C * a, q = r.fontMetrics().axisHeight;
  n && (q *= r.sizeMultiplier);
  var Y = O / 2 - q, se = [];
  if (c.length > 0) {
    var me = O - m - b, te = Math.round(O * 1e3), K = pd(c, Math.round(me * 1e3)), Z = new _i(c, K), oe = (f / 1e3).toFixed(3) + "em", le = (te / 1e3).toFixed(3) + "em", ie = new ai([Z], {
      width: oe,
      height: le,
      viewBox: "0 0 " + f + " " + te
    }), pe = ne.makeSvgSpan([], [ie], r);
    pe.height = te / 1e3, pe.style.width = oe, pe.style.height = le, se.push({
      type: "elem",
      elem: pe
    });
  } else {
    if (se.push(na(d, g, s)), se.push(zr), o === null) {
      var he = O - m - b + 2 * _a;
      se.push(ia(h, he, r));
    } else {
      var we = (O - m - b - y) / 2 + 2 * _a;
      se.push(ia(h, we, r)), se.push(zr), se.push(na(o, g, s)), se.push(zr), se.push(ia(h, we, r));
    }
    se.push(zr), se.push(na(l, g, s));
  }
  var ke = r.havingBaseStyle(Ne.TEXT), Ae = ne.makeVList({
    positionType: "bottom",
    positionData: Y,
    children: se
  }, ke);
  return Za(ne.makeSpan(["delimsizing", "mult"], [Ae], ke), Ne.TEXT, r, u);
}, ra = 80, sa = 0.08, aa = function(e, t, n, r, s) {
  var u = fd(e, r, n), l = new _i(e, u), o = new ai([l], {
    // Note: 1000:1 ratio of viewBox to document em width.
    width: "400em",
    height: Se(t),
    viewBox: "0 0 400000 " + n,
    preserveAspectRatio: "xMinYMin slice"
  });
  return ne.makeSvgSpan(["hide-tail"], [o], s);
}, of = function(e, t) {
  var n = t.havingBaseSizing(), r = cu("\\surd", e * n.sizeMultiplier, uu, n), s = n.sizeMultiplier, u = Math.max(0, t.minRuleThickness - t.fontMetrics().sqrtRuleThickness), l, o = 0, h = 0, d = 0, c;
  return r.type === "small" ? (d = 1e3 + 1e3 * u + ra, e < 1 ? s = 1 : e < 1.4 && (s = 0.7), o = (1 + u + sa) / s, h = (1 + u) / s, l = aa("sqrtMain", o, d, u, t), l.style.minWidth = "0.853em", c = 0.833 / s) : r.type === "large" ? (d = (1e3 + ra) * fr[r.size], h = (fr[r.size] + u) / s, o = (fr[r.size] + u + sa) / s, l = aa("sqrtSize" + r.size, o, d, u, t), l.style.minWidth = "1.02em", c = 1 / s) : (o = e + u + sa, h = e + u, d = Math.floor(1e3 * e + u) + ra, l = aa("sqrtTall", o, d, u, t), l.style.minWidth = "0.742em", c = 1.056), l.height = h, l.style.height = Se(o), {
    span: l,
    advanceWidth: c,
    // 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 + u) * s
  };
}, ou = ["(", "\\lparen", ")", "\\rparen", "[", "\\lbrack", "]", "\\rbrack", "\\{", "\\lbrace", "\\}", "\\rbrace", "\\lfloor", "\\rfloor", "⌊", "⌋", "\\lceil", "\\rceil", "⌈", "⌉", "\\surd"], lf = ["\\uparrow", "\\downarrow", "\\updownarrow", "\\Uparrow", "\\Downarrow", "\\Updownarrow", "|", "\\|", "\\vert", "\\Vert", "\\lvert", "\\rvert", "\\lVert", "\\rVert", "\\lgroup", "\\rgroup", "⟮", "⟯", "\\lmoustache", "\\rmoustache", "⎰", "⎱"], lu = ["<", ">", "\\langle", "\\rangle", "/", "\\backslash", "\\lt", "\\gt"], fr = [0, 1.2, 1.8, 2.4, 3], uf = function(e, t, n, r, s) {
  if (e === "<" || e === "\\lt" || e === "⟨" ? e = "\\langle" : (e === ">" || e === "\\gt" || e === "⟩") && (e = "\\rangle"), Ie.contains(ou, e) || Ie.contains(lu, e))
    return su(e, t, !1, n, r, s);
  if (Ie.contains(lf, e))
    return au(e, fr[t], !1, n, r, s);
  throw new Re("Illegal delimiter: '" + e + "'");
}, cf = [{
  type: "small",
  style: Ne.SCRIPTSCRIPT
}, {
  type: "small",
  style: Ne.SCRIPT
}, {
  type: "small",
  style: Ne.TEXT
}, {
  type: "large",
  size: 1
}, {
  type: "large",
  size: 2
}, {
  type: "large",
  size: 3
}, {
  type: "large",
  size: 4
}], hf = [{
  type: "small",
  style: Ne.SCRIPTSCRIPT
}, {
  type: "small",
  style: Ne.SCRIPT
}, {
  type: "small",
  style: Ne.TEXT
}, {
  type: "stack"
}], uu = [{
  type: "small",
  style: Ne.SCRIPTSCRIPT
}, {
  type: "small",
  style: Ne.SCRIPT
}, {
  type: "small",
  style: Ne.TEXT
}, {
  type: "large",
  size: 1
}, {
  type: "large",
  size: 2
}, {
  type: "large",
  size: 3
}, {
  type: "large",
  size: 4
}, {
  type: "stack"
}], df = 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.");
}, cu = function(e, t, n, r) {
  for (var s = Math.min(2, 3 - r.style.size), u = s; u < n.length && n[u].type !== "stack"; u++) {
    var l = cr(e, df(n[u]), "math"), o = l.height + l.depth;
    if (n[u].type === "small") {
      var h = r.havingBaseStyle(n[u].style);
      o *= h.sizeMultiplier;
    }
    if (o > t)
      return n[u];
  }
  return n[n.length - 1];
}, hu = function(e, t, n, r, s, u) {
  e === "<" || e === "\\lt" || e === "⟨" ? e = "\\langle" : (e === ">" || e === "\\gt" || e === "⟩") && (e = "\\rangle");
  var l;
  Ie.contains(lu, e) ? l = cf : Ie.contains(ou, e) ? l = uu : l = hf;
  var o = cu(e, t, l, r);
  return o.type === "small" ? nf(e, o.style, n, r, s, u) : o.type === "large" ? su(e, o.size, n, r, s, u) : au(e, t, n, r, s, u);
}, ff = function(e, t, n, r, s, u) {
  var l = r.fontMetrics().axisHeight * r.sizeMultiplier, o = 901, h = 5 / r.fontMetrics().ptPerEm, d = Math.max(t - l, n + l), c = 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)
    d / 500 * o,
    2 * d - h
  );
  return hu(e, c, !0, r, s, u);
}, Un = {
  sqrtImage: of,
  sizedDelim: uf,
  sizeToMaxHeight: fr,
  customSizedDelim: hu,
  leftRightDelim: ff
}, el = {
  "\\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
  }
}, mf = ["(", "\\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 xs(i, e) {
  var t = ks(i);
  if (t && Ie.contains(mf, t.text))
    return t;
  throw t ? new Re("Invalid delimiter '" + t.text + "' after '" + e.funcName + "'", i) : new Re("Invalid delimiter type '" + i.type + "'", i);
}
Ee({
  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: (i, e) => {
    var t = xs(e[0], i);
    return {
      type: "delimsizing",
      mode: i.parser.mode,
      size: el[i.funcName].size,
      mclass: el[i.funcName].mclass,
      delim: t.text
    };
  },
  htmlBuilder: (i, e) => i.delim === "." ? ne.makeSpan([i.mclass]) : Un.sizedDelim(i.delim, i.size, e, i.mode, [i.mclass]),
  mathmlBuilder: (i) => {
    var e = [];
    i.delim !== "." && e.push(tn(i.delim, i.mode));
    var t = new ge.MathNode("mo", e);
    i.mclass === "mopen" || i.mclass === "mclose" ? t.setAttribute("fence", "true") : t.setAttribute("fence", "false"), t.setAttribute("stretchy", "true");
    var n = Se(Un.sizeToMaxHeight[i.size]);
    return t.setAttribute("minsize", n), t.setAttribute("maxsize", n), t;
  }
});
function tl(i) {
  if (!i.body)
    throw new Error("Bug: The leftright ParseNode wasn't fully parsed.");
}
Ee({
  type: "leftright-right",
  names: ["\\right"],
  props: {
    numArgs: 1,
    primitive: !0
  },
  handler: (i, e) => {
    var t = i.parser.gullet.macros.get("\\current@color");
    if (t && typeof t != "string")
      throw new Re("\\current@color set to non-string in \\right");
    return {
      type: "leftright-right",
      mode: i.parser.mode,
      delim: xs(e[0], i).text,
      color: t
      // undefined if not set via \color
    };
  }
});
Ee({
  type: "leftright",
  names: ["\\left"],
  props: {
    numArgs: 1,
    primitive: !0
  },
  handler: (i, e) => {
    var t = xs(e[0], i), n = i.parser;
    ++n.leftrightDepth;
    var r = n.parseExpression(!1);
    --n.leftrightDepth, n.expect("\\right", !1);
    var s = qe(n.parseFunction(), "leftright-right");
    return {
      type: "leftright",
      mode: n.mode,
      body: r,
      left: t.text,
      right: s.delim,
      rightColor: s.color
    };
  },
  htmlBuilder: (i, e) => {
    tl(i);
    for (var t = gt(i.body, e, !0, ["mopen", "mclose"]), n = 0, r = 0, s = !1, u = 0; u < t.length; u++)
      t[u].isMiddle ? s = !0 : (n = Math.max(t[u].height, n), r = Math.max(t[u].depth, r));
    n *= e.sizeMultiplier, r *= e.sizeMultiplier;
    var l;
    if (i.left === "." ? l = br(e, ["mopen"]) : l = Un.leftRightDelim(i.left, n, r, e, i.mode, ["mopen"]), t.unshift(l), s)
      for (var o = 1; o < t.length; o++) {
        var h = t[o], d = h.isMiddle;
        d && (t[o] = Un.leftRightDelim(d.delim, n, r, d.options, i.mode, []));
      }
    var c;
    if (i.right === ".")
      c = br(e, ["mclose"]);
    else {
      var f = i.rightColor ? e.withColor(i.rightColor) : e;
      c = Un.leftRightDelim(i.right, n, r, f, i.mode, ["mclose"]);
    }
    return t.push(c), ne.makeSpan(["minner"], t, e);
  },
  mathmlBuilder: (i, e) => {
    tl(i);
    var t = Gt(i.body, e);
    if (i.left !== ".") {
      var n = new ge.MathNode("mo", [tn(i.left, i.mode)]);
      n.setAttribute("fence", "true"), t.unshift(n);
    }
    if (i.right !== ".") {
      var r = new ge.MathNode("mo", [tn(i.right, i.mode)]);
      r.setAttribute("fence", "true"), i.rightColor && r.setAttribute("mathcolor", i.rightColor), t.push(r);
    }
    return Ya(t);
  }
});
Ee({
  type: "middle",
  names: ["\\middle"],
  props: {
    numArgs: 1,
    primitive: !0
  },
  handler: (i, e) => {
    var t = xs(e[0], i);
    if (!i.parser.leftrightDepth)
      throw new Re("\\middle without preceding \\left", t);
    return {
      type: "middle",
      mode: i.parser.mode,
      delim: t.text
    };
  },
  htmlBuilder: (i, e) => {
    var t;
    if (i.delim === ".")
      t = br(e, []);
    else {
      t = Un.sizedDelim(i.delim, 1, e, i.mode, []);
      var n = {
        delim: i.delim,
        options: e
      };
      t.isMiddle = n;
    }
    return t;
  },
  mathmlBuilder: (i, e) => {
    var t = i.delim === "\\vert" || i.delim === "|" ? tn("|", "text") : tn(i.delim, i.mode), n = new ge.MathNode("mo", [t]);
    return n.setAttribute("fence", "true"), n.setAttribute("lspace", "0.05em"), n.setAttribute("rspace", "0.05em"), n;
  }
});
var Qa = (i, e) => {
  var t = ne.wrapFragment(je(i.body, e), e), n = i.label.slice(1), r = e.sizeMultiplier, s, u = 0, l = Ie.isCharacterBox(i.body);
  if (n === "sout")
    s = ne.makeSpan(["stretchy", "sout"]), s.height = e.fontMetrics().defaultRuleThickness / r, u = -0.5 * e.fontMetrics().xHeight;
  else if (n === "phase") {
    var o = nt({
      number: 0.6,
      unit: "pt"
    }, e), h = nt({
      number: 0.35,
      unit: "ex"
    }, e), d = e.havingBaseSizing();
    r = r / d.sizeMultiplier;
    var c = t.height + t.depth + o + h;
    t.style.paddingLeft = Se(c / 2 + o);
    var f = Math.floor(1e3 * c * r), g = hd(f), A = new ai([new _i("phase", g)], {
      width: "400em",
      height: Se(f / 1e3),
      viewBox: "0 0 400000 " + f,
      preserveAspectRatio: "xMinYMin slice"
    });
    s = ne.makeSvgSpan(["hide-tail"], [A], e), s.style.height = Se(c), u = t.depth + o + h;
  } else {
    /cancel/.test(n) ? l || t.classes.push("cancel-pad") : n === "angl" ? t.classes.push("anglpad") : t.classes.push("boxpad");
    var m = 0, k = 0, a = 0;
    /box/.test(n) ? (a = Math.max(
      e.fontMetrics().fboxrule,
      // default
      e.minRuleThickness
      // User override.
    ), m = e.fontMetrics().fboxsep + (n === "colorbox" ? 0 : a), k = m) : n === "angl" ? (a = Math.max(e.fontMetrics().defaultRuleThickness, e.minRuleThickness), m = 4 * a, k = Math.max(0, 0.25 - t.depth)) : (m = l ? 0.2 : 0, k = m), s = Vn.encloseSpan(t, n, m, k, e), /fbox|boxed|fcolorbox/.test(n) ? (s.style.borderStyle = "solid", s.style.borderWidth = Se(a)) : n === "angl" && a !== 0.049 && (s.style.borderTopWidth = Se(a), s.style.borderRightWidth = Se(a)), u = t.depth + k, i.backgroundColor && (s.style.backgroundColor = i.backgroundColor, i.borderColor && (s.style.borderColor = i.borderColor));
  }
  var p;
  if (i.backgroundColor)
    p = ne.makeVList({
      positionType: "individualShift",
      children: [
        // Put the color background behind inner;
        {
          type: "elem",
          elem: s,
          shift: u
        },
        {
          type: "elem",
          elem: t,
          shift: 0
        }
      ]
    }, e);
  else {
    var b = /cancel|phase/.test(n) ? ["svg-align"] : [];
    p = ne.makeVList({
      positionType: "individualShift",
      children: [
        // Write the \cancel stroke on top of inner.
        {
          type: "elem",
          elem: t,
          shift: 0
        },
        {
          type: "elem",
          elem: s,
          shift: u,
          wrapperClasses: b
        }
      ]
    }, e);
  }
  return /cancel/.test(n) && (p.height = t.height, p.depth = t.depth), /cancel/.test(n) && !l ? ne.makeSpan(["mord", "cancel-lap"], [p], e) : ne.makeSpan(["mord"], [p], e);
}, Ja = (i, e) => {
  var t = 0, n = new ge.MathNode(i.label.indexOf("colorbox") > -1 ? "mpadded" : "menclose", [$e(i.body, e)]);
  switch (i.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"), i.label === "\\fcolorbox") {
        var r = Math.max(
          e.fontMetrics().fboxrule,
          // default
          e.minRuleThickness
          // user override
        );
        n.setAttribute("style", "border: " + r + "em solid " + String(i.borderColor));
      }
      break;
    case "\\xcancel":
      n.setAttribute("notation", "updiagonalstrike downdiagonalstrike");
      break;
  }
  return i.backgroundColor && n.setAttribute("mathbackground", i.backgroundColor), n;
};
Ee({
  type: "enclose",
  names: ["\\colorbox"],
  props: {
    numArgs: 2,
    allowedInText: !0,
    argTypes: ["color", "text"]
  },
  handler(i, e, t) {
    var {
      parser: n,
      funcName: r
    } = i, s = qe(e[0], "color-token").color, u = e[1];
    return {
      type: "enclose",
      mode: n.mode,
      label: r,
      backgroundColor: s,
      body: u
    };
  },
  htmlBuilder: Qa,
  mathmlBuilder: Ja
});
Ee({
  type: "enclose",
  names: ["\\fcolorbox"],
  props: {
    numArgs: 3,
    allowedInText: !0,
    argTypes: ["color", "color", "text"]
  },
  handler(i, e, t) {
    var {
      parser: n,
      funcName: r
    } = i, s = qe(e[0], "color-token").color, u = qe(e[1], "color-token").color, l = e[2];
    return {
      type: "enclose",
      mode: n.mode,
      label: r,
      backgroundColor: u,
      borderColor: s,
      body: l
    };
  },
  htmlBuilder: Qa,
  mathmlBuilder: Ja
});
Ee({
  type: "enclose",
  names: ["\\fbox"],
  props: {
    numArgs: 1,
    argTypes: ["hbox"],
    allowedInText: !0
  },
  handler(i, e) {
    var {
      parser: t
    } = i;
    return {
      type: "enclose",
      mode: t.mode,
      label: "\\fbox",
      body: e[0]
    };
  }
});
Ee({
  type: "enclose",
  names: ["\\cancel", "\\bcancel", "\\xcancel", "\\sout", "\\phase"],
  props: {
    numArgs: 1
  },
  handler(i, e) {
    var {
      parser: t,
      funcName: n
    } = i, r = e[0];
    return {
      type: "enclose",
      mode: t.mode,
      label: n,
      body: r
    };
  },
  htmlBuilder: Qa,
  mathmlBuilder: Ja
});
Ee({
  type: "enclose",
  names: ["\\angl"],
  props: {
    numArgs: 1,
    argTypes: ["hbox"],
    allowedInText: !1
  },
  handler(i, e) {
    var {
      parser: t
    } = i;
    return {
      type: "enclose",
      mode: t.mode,
      label: "\\angl",
      body: e[0]
    };
  }
});
var du = {};
function Fn(i) {
  for (var {
    type: e,
    names: t,
    props: n,
    handler: r,
    htmlBuilder: s,
    mathmlBuilder: u
  } = i, l = {
    type: e,
    numArgs: n.numArgs || 0,
    allowedInText: !1,
    numOptionalArgs: 0,
    handler: r
  }, o = 0; o < t.length; ++o)
    du[t[o]] = l;
  s && (is[e] = s), u && (rs[e] = u);
}
var pf = {};
function z(i, e) {
  pf[i] = e;
}
function nl(i) {
  var e = [];
  i.consumeSpaces();
  var t = i.fetch().text;
  for (t === "\\relax" && (i.consume(), i.consumeSpaces(), t = i.fetch().text); t === "\\hline" || t === "\\hdashline"; )
    i.consume(), e.push(t === "\\hdashline"), i.consumeSpaces(), t = i.fetch().text;
  return e;
}
var Es = (i) => {
  var e = i.parser.settings;
  if (!e.displayMode)
    throw new Re("{" + i.envName + "} can be used only in display mode.");
};
function eo(i) {
  if (i.indexOf("ed") === -1)
    return i.indexOf("*") === -1;
}
function li(i, e, t) {
  var {
    hskipBeforeAndAfter: n,
    addJot: r,
    cols: s,
    arraystretch: u,
    colSeparationType: l,
    autoTag: o,
    singleRow: h,
    emptySingleRow: d,
    maxNumCols: c,
    leqno: f
  } = e;
  if (i.gullet.beginGroup(), h || i.gullet.macros.set("\\cr", "\\\\\\relax"), !u) {
    var g = i.gullet.expandMacroAsText("\\arraystretch");
    if (g == null)
      u = 1;
    else if (u = parseFloat(g), !u || u < 0)
      throw new Re("Invalid \\arraystretch: " + g);
  }
  i.gullet.beginGroup();
  var A = [], m = [A], k = [], a = [], p = o != null ? [] : void 0;
  function b() {
    o && i.gullet.macros.set("\\@eqnsw", "1", !0);
  }
  function y() {
    p && (i.gullet.macros.get("\\df@tag") ? (p.push(i.subparse([new Va("\\df@tag")])), i.gullet.macros.set("\\df@tag", void 0, !0)) : p.push(!!o && i.gullet.macros.get("\\@eqnsw") === "1"));
  }
  for (b(), a.push(nl(i)); ; ) {
    var C = i.parseExpression(!1, h ? "\\end" : "\\\\");
    i.gullet.endGroup(), i.gullet.beginGroup(), C = {
      type: "ordgroup",
      mode: i.mode,
      body: C
    }, t && (C = {
      type: "styling",
      mode: i.mode,
      style: t,
      body: [C]
    }), A.push(C);
    var M = i.fetch().text;
    if (M === "&") {
      if (c && A.length === c) {
        if (h || l)
          throw new Re("Too many tab characters: &", i.nextToken);
        i.settings.reportNonstrict("textEnv", "Too few columns specified in the {array} column argument.");
      }
      i.consume();
    } else if (M === "\\end") {
      y(), A.length === 1 && C.type === "styling" && C.body[0].body.length === 0 && (m.length > 1 || !d) && m.pop(), a.length < m.length + 1 && a.push([]);
      break;
    } else if (M === "\\\\") {
      i.consume();
      var L = void 0;
      i.gullet.future().text !== " " && (L = i.parseSizeGroup(!0)), k.push(L ? L.value : null), y(), a.push(nl(i)), A = [], m.push(A), b();
    } else
      throw new Re("Expected & or \\\\ or \\cr or \\end", i.nextToken);
  }
  return i.gullet.endGroup(), i.gullet.endGroup(), {
    type: "array",
    mode: i.mode,
    addJot: r,
    arraystretch: u,
    body: m,
    cols: s,
    rowGaps: k,
    hskipBeforeAndAfter: n,
    hLinesBeforeRow: a,
    colSeparationType: l,
    tags: p,
    leqno: f
  };
}
function to(i) {
  return i.slice(0, 1) === "d" ? "display" : "text";
}
var Mn = function(e, t) {
  var n, r, s = e.body.length, u = e.hLinesBeforeRow, l = 0, o = new Array(s), h = [], d = Math.max(
    // From LaTeX \showthe\arrayrulewidth. Equals 0.04 em.
    t.fontMetrics().arrayRuleWidth,
    t.minRuleThickness
    // User override.
  ), c = 1 / t.fontMetrics().ptPerEm, f = 5 * c;
  if (e.colSeparationType && e.colSeparationType === "small") {
    var g = t.havingStyle(Ne.SCRIPT).sizeMultiplier;
    f = 0.2778 * (g / t.sizeMultiplier);
  }
  var A = e.colSeparationType === "CD" ? nt({
    number: 3,
    unit: "ex"
  }, t) : 12 * c, m = 3 * c, k = e.arraystretch * A, a = 0.7 * k, p = 0.3 * k, b = 0;
  function y(V) {
    for (var $ = 0; $ < V.length; ++$)
      $ > 0 && (b += 0.25), h.push({
        pos: b,
        isDashed: V[$]
      });
  }
  for (y(u[0]), n = 0; n < e.body.length; ++n) {
    var C = e.body[n], M = a, L = p;
    l < C.length && (l = C.length);
    var P = new Array(C.length);
    for (r = 0; r < C.length; ++r) {
      var O = je(C[r], t);
      L < O.depth && (L = O.depth), M < O.height && (M = O.height), P[r] = O;
    }
    var q = e.rowGaps[n], Y = 0;
    q && (Y = nt(q, t), Y > 0 && (Y += p, L < Y && (L = Y), Y = 0)), e.addJot && (L += m), P.height = M, P.depth = L, b += M, P.pos = b, b += L + Y, o[n] = P, y(u[n + 1]);
  }
  var se = b / 2 + t.fontMetrics().axisHeight, me = e.cols || [], te = [], K, Z, oe = [];
  if (e.tags && e.tags.some((V) => V))
    for (n = 0; n < s; ++n) {
      var le = o[n], ie = le.pos - se, pe = e.tags[n], he = void 0;
      pe === !0 ? he = ne.makeSpan(["eqn-num"], [], t) : pe === !1 ? he = ne.makeSpan([], [], t) : he = ne.makeSpan([], gt(pe, t, !0), t), he.depth = le.depth, he.height = le.height, oe.push({
        type: "elem",
        elem: he,
        shift: ie
      });
    }
  for (
    r = 0, Z = 0;
    // Continue while either there are more columns or more column
    // descriptions, so trailing separators don't get lost.
    r < l || Z < me.length;
    ++r, ++Z
  ) {
    for (var we = me[Z] || {}, ke = !0; we.type === "separator"; ) {
      if (ke || (K = ne.makeSpan(["arraycolsep"], []), K.style.width = Se(t.fontMetrics().doubleRuleSep), te.push(K)), we.separator === "|" || we.separator === ":") {
        var Ae = we.separator === "|" ? "solid" : "dashed", ae = ne.makeSpan(["vertical-separator"], [], t);
        ae.style.height = Se(b), ae.style.borderRightWidth = Se(d), ae.style.borderRightStyle = Ae, ae.style.margin = "0 " + Se(-d / 2);
        var de = b - se;
        de && (ae.style.verticalAlign = Se(-de)), te.push(ae);
      } else
        throw new Re("Invalid separator type: " + we.separator);
      Z++, we = me[Z] || {}, ke = !1;
    }
    if (!(r >= l)) {
      var R = void 0;
      (r > 0 || e.hskipBeforeAndAfter) && (R = Ie.deflt(we.pregap, f), R !== 0 && (K = ne.makeSpan(["arraycolsep"], []), K.style.width = Se(R), te.push(K)));
      var D = [];
      for (n = 0; n < s; ++n) {
        var v = o[n], S = v[r];
        if (S) {
          var E = v.pos - se;
          S.depth = v.depth, S.height = v.height, D.push({
            type: "elem",
            elem: S,
            shift: E
          });
        }
      }
      D = ne.makeVList({
        positionType: "individualShift",
        children: D
      }, t), D = ne.makeSpan(["col-align-" + (we.align || "c")], [D]), te.push(D), (r < l - 1 || e.hskipBeforeAndAfter) && (R = Ie.deflt(we.postgap, f), R !== 0 && (K = ne.makeSpan(["arraycolsep"], []), K.style.width = Se(R), te.push(K)));
    }
  }
  if (o = ne.makeSpan(["mtable"], te), h.length > 0) {
    for (var _ = ne.makeLineSpan("hline", t, d), x = ne.makeLineSpan("hdashline", t, d), F = [{
      type: "elem",
      elem: o,
      shift: 0
    }]; h.length > 0; ) {
      var I = h.pop(), B = I.pos - se;
      I.isDashed ? F.push({
        type: "elem",
        elem: x,
        shift: B
      }) : F.push({
        type: "elem",
        elem: _,
        shift: B
      });
    }
    o = ne.makeVList({
      positionType: "individualShift",
      children: F
    }, t);
  }
  if (oe.length === 0)
    return ne.makeSpan(["mord"], [o], t);
  var H = ne.makeVList({
    positionType: "individualShift",
    children: oe
  }, t);
  return H = ne.makeSpan(["tag"], [H], t), ne.makeFragment([o, H]);
}, gf = {
  c: "center ",
  l: "left ",
  r: "right "
}, Rn = function(e, t) {
  for (var n = [], r = new ge.MathNode("mtd", [], ["mtr-glue"]), s = new ge.MathNode("mtd", [], ["mml-eqn-num"]), u = 0; u < e.body.length; u++) {
    for (var l = e.body[u], o = [], h = 0; h < l.length; h++)
      o.push(new ge.MathNode("mtd", [$e(l[h], t)]));
    e.tags && e.tags[u] && (o.unshift(r), o.push(r), e.leqno ? o.unshift(s) : o.push(s)), n.push(new ge.MathNode("mtr", o));
  }
  var d = new ge.MathNode("mtable", n), c = e.arraystretch === 0.5 ? 0.1 : 0.16 + e.arraystretch - 1 + (e.addJot ? 0.09 : 0);
  d.setAttribute("rowspacing", Se(c));
  var f = "", g = "";
  if (e.cols && e.cols.length > 0) {
    var A = e.cols, m = "", k = !1, a = 0, p = A.length;
    A[0].type === "separator" && (f += "top ", a = 1), A[A.length - 1].type === "separator" && (f += "bottom ", p -= 1);
    for (var b = a; b < p; b++)
      A[b].type === "align" ? (g += gf[A[b].align], k && (m += "none "), k = !0) : A[b].type === "separator" && k && (m += A[b].separator === "|" ? "solid " : "dashed ", k = !1);
    d.setAttribute("columnalign", g.trim()), /[sd]/.test(m) && d.setAttribute("columnlines", m.trim());
  }
  if (e.colSeparationType === "align") {
    for (var y = e.cols || [], C = "", M = 1; M < y.length; M++)
      C += M % 2 ? "0em " : "1em ";
    d.setAttribute("columnspacing", C.trim());
  } else e.colSeparationType === "alignat" || e.colSeparationType === "gather" ? d.setAttribute("columnspacing", "0em") : e.colSeparationType === "small" ? d.setAttribute("columnspacing", "0.2778em") : e.colSeparationType === "CD" ? d.setAttribute("columnspacing", "0.5em") : d.setAttribute("columnspacing", "1em");
  var L = "", P = e.hLinesBeforeRow;
  f += P[0].length > 0 ? "left " : "", f += P[P.length - 1].length > 0 ? "right " : "";
  for (var O = 1; O < P.length - 1; O++)
    L += P[O].length === 0 ? "none " : P[O][0] ? "dashed " : "solid ";
  return /[sd]/.test(L) && d.setAttribute("rowlines", L.trim()), f !== "" && (d = new ge.MathNode("menclose", [d]), d.setAttribute("notation", f.trim())), e.arraystretch && e.arraystretch < 1 && (d = new ge.MathNode("mstyle", [d]), d.setAttribute("scriptlevel", "1")), d;
}, fu = function(e, t) {
  e.envName.indexOf("ed") === -1 && Es(e);
  var n = [], r = e.envName.indexOf("at") > -1 ? "alignat" : "align", s = e.envName === "split", u = li(e.parser, {
    cols: n,
    addJot: !0,
    autoTag: s ? void 0 : eo(e.envName),
    emptySingleRow: !0,
    colSeparationType: r,
    maxNumCols: s ? 2 : void 0,
    leqno: e.parser.settings.leqno
  }, "display"), l, o = 0, h = {
    type: "ordgroup",
    mode: e.mode,
    body: []
  };
  if (t[0] && t[0].type === "ordgroup") {
    for (var d = "", c = 0; c < t[0].body.length; c++) {
      var f = qe(t[0].body[c], "textord");
      d += f.text;
    }
    l = Number(d), o = l * 2;
  }
  var g = !o;
  u.body.forEach(function(a) {
    for (var p = 1; p < a.length; p += 2) {
      var b = qe(a[p], "styling"), y = qe(b.body[0], "ordgroup");
      y.body.unshift(h);
    }
    if (g)
      o < a.length && (o = a.length);
    else {
      var C = a.length / 2;
      if (l < C)
        throw new Re("Too many math in a row: " + ("expected " + l + ", but got " + C), a[0]);
    }
  });
  for (var A = 0; A < o; ++A) {
    var m = "r", k = 0;
    A % 2 === 1 ? m = "l" : A > 0 && g && (k = 1), n[A] = {
      type: "align",
      align: m,
      pregap: k,
      postgap: 0
    };
  }
  return u.colSeparationType = g ? "align" : "alignat", u;
};
Fn({
  type: "array",
  names: ["array", "darray"],
  props: {
    numArgs: 1
  },
  handler(i, e) {
    var t = ks(e[0]), n = t ? [e[0]] : qe(e[0], "ordgroup").body, r = n.map(function(u) {
      var l = $a(u), 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 Re("Unknown column alignment: " + o, u);
    }), s = {
      cols: r,
      hskipBeforeAndAfter: !0,
      // \@preamble in lttab.dtx
      maxNumCols: r.length
    };
    return li(i.parser, s, to(i.envName));
  },
  htmlBuilder: Mn,
  mathmlBuilder: Rn
});
Fn({
  type: "array",
  names: ["matrix", "pmatrix", "bmatrix", "Bmatrix", "vmatrix", "Vmatrix", "matrix*", "pmatrix*", "bmatrix*", "Bmatrix*", "vmatrix*", "Vmatrix*"],
  props: {
    numArgs: 0
  },
  handler(i) {
    var e = {
      matrix: null,
      pmatrix: ["(", ")"],
      bmatrix: ["[", "]"],
      Bmatrix: ["\\{", "\\}"],
      vmatrix: ["|", "|"],
      Vmatrix: ["\\Vert", "\\Vert"]
    }[i.envName.replace("*", "")], t = "c", n = {
      hskipBeforeAndAfter: !1,
      cols: [{
        type: "align",
        align: t
      }]
    };
    if (i.envName.charAt(i.envName.length - 1) === "*") {
      var r = i.parser;
      if (r.consumeSpaces(), r.fetch().text === "[") {
        if (r.consume(), r.consumeSpaces(), t = r.fetch().text, "lcr".indexOf(t) === -1)
          throw new Re("Expected l or c or r", r.nextToken);
        r.consume(), r.consumeSpaces(), r.expect("]"), r.consume(), n.cols = [{
          type: "align",
          align: t
        }];
      }
    }
    var s = li(i.parser, n, to(i.envName)), u = Math.max(0, ...s.body.map((l) => l.length));
    return s.cols = new Array(u).fill({
      type: "align",
      align: t
    }), e ? {
      type: "leftright",
      mode: i.mode,
      body: [s],
      left: e[0],
      right: e[1],
      rightColor: void 0
      // \right uninfluenced by \color in array
    } : s;
  },
  htmlBuilder: Mn,
  mathmlBuilder: Rn
});
Fn({
  type: "array",
  names: ["smallmatrix"],
  props: {
    numArgs: 0
  },
  handler(i) {
    var e = {
      arraystretch: 0.5
    }, t = li(i.parser, e, "script");
    return t.colSeparationType = "small", t;
  },
  htmlBuilder: Mn,
  mathmlBuilder: Rn
});
Fn({
  type: "array",
  names: ["subarray"],
  props: {
    numArgs: 1
  },
  handler(i, e) {
    var t = ks(e[0]), n = t ? [e[0]] : qe(e[0], "ordgroup").body, r = n.map(function(u) {
      var l = $a(u), o = l.text;
      if ("lc".indexOf(o) !== -1)
        return {
          type: "align",
          align: o
        };
      throw new Re("Unknown column alignment: " + o, u);
    });
    if (r.length > 1)
      throw new Re("{subarray} can contain only one column");
    var s = {
      cols: r,
      hskipBeforeAndAfter: !1,
      arraystretch: 0.5
    };
    if (s = li(i.parser, s, "script"), s.body.length > 0 && s.body[0].length > 1)
      throw new Re("{subarray} can contain only one column");
    return s;
  },
  htmlBuilder: Mn,
  mathmlBuilder: Rn
});
Fn({
  type: "array",
  names: ["cases", "dcases", "rcases", "drcases"],
  props: {
    numArgs: 0
  },
  handler(i) {
    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 = li(i.parser, e, to(i.envName));
    return {
      type: "leftright",
      mode: i.mode,
      body: [t],
      left: i.envName.indexOf("r") > -1 ? "." : "\\{",
      right: i.envName.indexOf("r") > -1 ? "\\}" : ".",
      rightColor: void 0
    };
  },
  htmlBuilder: Mn,
  mathmlBuilder: Rn
});
Fn({
  type: "array",
  names: ["align", "align*", "aligned", "split"],
  props: {
    numArgs: 0
  },
  handler: fu,
  htmlBuilder: Mn,
  mathmlBuilder: Rn
});
Fn({
  type: "array",
  names: ["gathered", "gather", "gather*"],
  props: {
    numArgs: 0
  },
  handler(i) {
    Ie.contains(["gather", "gather*"], i.envName) && Es(i);
    var e = {
      cols: [{
        type: "align",
        align: "c"
      }],
      addJot: !0,
      colSeparationType: "gather",
      autoTag: eo(i.envName),
      emptySingleRow: !0,
      leqno: i.parser.settings.leqno
    };
    return li(i.parser, e, "display");
  },
  htmlBuilder: Mn,
  mathmlBuilder: Rn
});
Fn({
  type: "array",
  names: ["alignat", "alignat*", "alignedat"],
  props: {
    numArgs: 1
  },
  handler: fu,
  htmlBuilder: Mn,
  mathmlBuilder: Rn
});
Fn({
  type: "array",
  names: ["equation", "equation*"],
  props: {
    numArgs: 0
  },
  handler(i) {
    Es(i);
    var e = {
      autoTag: eo(i.envName),
      emptySingleRow: !0,
      singleRow: !0,
      maxNumCols: 1,
      leqno: i.parser.settings.leqno
    };
    return li(i.parser, e, "display");
  },
  htmlBuilder: Mn,
  mathmlBuilder: Rn
});
Fn({
  type: "array",
  names: ["CD"],
  props: {
    numArgs: 0
  },
  handler(i) {
    return Es(i), ef(i.parser);
  },
  htmlBuilder: Mn,
  mathmlBuilder: Rn
});
z("\\nonumber", "\\gdef\\@eqnsw{0}");
z("\\notag", "\\nonumber");
Ee({
  type: "text",
  // Doesn't matter what this is.
  names: ["\\hline", "\\hdashline"],
  props: {
    numArgs: 0,
    allowedInText: !0,
    allowedInMath: !0
  },
  handler(i, e) {
    throw new Re(i.funcName + " valid only within array environment");
  }
});
var il = du;
Ee({
  type: "environment",
  names: ["\\begin", "\\end"],
  props: {
    numArgs: 1,
    argTypes: ["text"]
  },
  handler(i, e) {
    var {
      parser: t,
      funcName: n
    } = i, r = e[0];
    if (r.type !== "ordgroup")
      throw new Re("Invalid environment name", r);
    for (var s = "", u = 0; u < r.body.length; ++u)
      s += qe(r.body[u], "textord").text;
    if (n === "\\begin") {
      if (!il.hasOwnProperty(s))
        throw new Re("No such environment: " + s, r);
      var l = il[s], {
        args: o,
        optArgs: h
      } = t.parseArguments("\\begin{" + s + "}", l), d = {
        mode: t.mode,
        envName: s,
        parser: t
      }, c = l.handler(d, o, h);
      t.expect("\\end", !1);
      var f = t.nextToken, g = qe(t.parseFunction(), "environment");
      if (g.name !== s)
        throw new Re("Mismatch: \\begin{" + s + "} matched by \\end{" + g.name + "}", f);
      return c;
    }
    return {
      type: "environment",
      mode: t.mode,
      name: s,
      nameGroup: r
    };
  }
});
var mu = (i, e) => {
  var t = i.font, n = e.withFont(t);
  return je(i.body, n);
}, pu = (i, e) => {
  var t = i.font, n = e.withFont(t);
  return $e(i.body, n);
}, rl = {
  "\\Bbb": "\\mathbb",
  "\\bold": "\\mathbf",
  "\\frak": "\\mathfrak",
  "\\bm": "\\boldsymbol"
};
Ee({
  type: "font",
  names: [
    // styles, except \boldsymbol defined below
    "\\mathrm",
    "\\mathit",
    "\\mathbf",
    "\\mathnormal",
    // families
    "\\mathbb",
    "\\mathcal",
    "\\mathfrak",
    "\\mathscr",
    "\\mathsf",
    "\\mathtt",
    // aliases, except \bm defined below
    "\\Bbb",
    "\\bold",
    "\\frak"
  ],
  props: {
    numArgs: 1,
    allowedInArgument: !0
  },
  handler: (i, e) => {
    var {
      parser: t,
      funcName: n
    } = i, r = ss(e[0]), s = n;
    return s in rl && (s = rl[s]), {
      type: "font",
      mode: t.mode,
      font: s.slice(1),
      body: r
    };
  },
  htmlBuilder: mu,
  mathmlBuilder: pu
});
Ee({
  type: "mclass",
  names: ["\\boldsymbol", "\\bm"],
  props: {
    numArgs: 1
  },
  handler: (i, e) => {
    var {
      parser: t
    } = i, n = e[0], r = Ie.isCharacterBox(n);
    return {
      type: "mclass",
      mode: t.mode,
      mclass: Ss(n),
      body: [{
        type: "font",
        mode: t.mode,
        font: "boldsymbol",
        body: n
      }],
      isCharacterBox: r
    };
  }
});
Ee({
  type: "font",
  names: ["\\rm", "\\sf", "\\tt", "\\bf", "\\it", "\\cal"],
  props: {
    numArgs: 0,
    allowedInText: !0
  },
  handler: (i, e) => {
    var {
      parser: t,
      funcName: n,
      breakOnTokenText: r
    } = i, {
      mode: s
    } = t, u = t.parseExpression(!0, r), l = "math" + n.slice(1);
    return {
      type: "font",
      mode: s,
      font: l,
      body: {
        type: "ordgroup",
        mode: t.mode,
        body: u
      }
    };
  },
  htmlBuilder: mu,
  mathmlBuilder: pu
});
var gu = (i, e) => {
  var t = e;
  return i === "display" ? t = t.id >= Ne.SCRIPT.id ? t.text() : Ne.DISPLAY : i === "text" && t.size === Ne.DISPLAY.size ? t = Ne.TEXT : i === "script" ? t = Ne.SCRIPT : i === "scriptscript" && (t = Ne.SCRIPTSCRIPT), t;
}, no = (i, e) => {
  var t = gu(i.size, e.style), n = t.fracNum(), r = t.fracDen(), s;
  s = e.havingStyle(n);
  var u = je(i.numer, s, e);
  if (i.continued) {
    var l = 8.5 / e.fontMetrics().ptPerEm, o = 3.5 / e.fontMetrics().ptPerEm;
    u.height = u.height < l ? l : u.height, u.depth = u.depth < o ? o : u.depth;
  }
  s = e.havingStyle(r);
  var h = je(i.denom, s, e), d, c, f;
  i.hasBarLine ? (i.barSize ? (c = nt(i.barSize, e), d = ne.makeLineSpan("frac-line", e, c)) : d = ne.makeLineSpan("frac-line", e), c = d.height, f = d.height) : (d = null, c = 0, f = e.fontMetrics().defaultRuleThickness);
  var g, A, m;
  t.size === Ne.DISPLAY.size || i.size === "display" ? (g = e.fontMetrics().num1, c > 0 ? A = 3 * f : A = 7 * f, m = e.fontMetrics().denom1) : (c > 0 ? (g = e.fontMetrics().num2, A = f) : (g = e.fontMetrics().num3, A = 3 * f), m = e.fontMetrics().denom2);
  var k;
  if (d) {
    var p = e.fontMetrics().axisHeight;
    g - u.depth - (p + 0.5 * c) < A && (g += A - (g - u.depth - (p + 0.5 * c))), p - 0.5 * c - (h.height - m) < A && (m += A - (p - 0.5 * c - (h.height - m)));
    var b = -(p - 0.5 * c);
    k = ne.makeVList({
      positionType: "individualShift",
      children: [{
        type: "elem",
        elem: h,
        shift: m
      }, {
        type: "elem",
        elem: d,
        shift: b
      }, {
        type: "elem",
        elem: u,
        shift: -g
      }]
    }, e);
  } else {
    var a = g - u.depth - (h.height - m);
    a < A && (g += 0.5 * (A - a), m += 0.5 * (A - a)), k = ne.makeVList({
      positionType: "individualShift",
      children: [{
        type: "elem",
        elem: h,
        shift: m
      }, {
        type: "elem",
        elem: u,
        shift: -g
      }]
    }, e);
  }
  s = e.havingStyle(t), k.height *= s.sizeMultiplier / e.sizeMultiplier, k.depth *= s.sizeMultiplier / e.sizeMultiplier;
  var y;
  t.size === Ne.DISPLAY.size ? y = e.fontMetrics().delim1 : t.size === Ne.SCRIPTSCRIPT.size ? y = e.havingStyle(Ne.SCRIPT).fontMetrics().delim2 : y = e.fontMetrics().delim2;
  var C, M;
  return i.leftDelim == null ? C = br(e, ["mopen"]) : C = Un.customSizedDelim(i.leftDelim, y, !0, e.havingStyle(t), i.mode, ["mopen"]), i.continued ? M = ne.makeSpan([]) : i.rightDelim == null ? M = br(e, ["mclose"]) : M = Un.customSizedDelim(i.rightDelim, y, !0, e.havingStyle(t), i.mode, ["mclose"]), ne.makeSpan(["mord"].concat(s.sizingClasses(e)), [C, ne.makeSpan(["mfrac"], [k]), M], e);
}, io = (i, e) => {
  var t = new ge.MathNode("mfrac", [$e(i.numer, e), $e(i.denom, e)]);
  if (!i.hasBarLine)
    t.setAttribute("linethickness", "0px");
  else if (i.barSize) {
    var n = nt(i.barSize, e);
    t.setAttribute("linethickness", Se(n));
  }
  var r = gu(i.size, e.style);
  if (r.size !== e.style.size) {
    t = new ge.MathNode("mstyle", [t]);
    var s = r.size === Ne.DISPLAY.size ? "true" : "false";
    t.setAttribute("displaystyle", s), t.setAttribute("scriptlevel", "0");
  }
  if (i.leftDelim != null || i.rightDelim != null) {
    var u = [];
    if (i.leftDelim != null) {
      var l = new ge.MathNode("mo", [new ge.TextNode(i.leftDelim.replace("\\", ""))]);
      l.setAttribute("fence", "true"), u.push(l);
    }
    if (u.push(t), i.rightDelim != null) {
      var o = new ge.MathNode("mo", [new ge.TextNode(i.rightDelim.replace("\\", ""))]);
      o.setAttribute("fence", "true"), u.push(o);
    }
    return Ya(u);
  }
  return t;
};
Ee({
  type: "genfrac",
  names: [
    "\\dfrac",
    "\\frac",
    "\\tfrac",
    "\\dbinom",
    "\\binom",
    "\\tbinom",
    "\\\\atopfrac",
    // can’t be entered directly
    "\\\\bracefrac",
    "\\\\brackfrac"
    // ditto
  ],
  props: {
    numArgs: 2,
    allowedInArgument: !0
  },
  handler: (i, e) => {
    var {
      parser: t,
      funcName: n
    } = i, r = e[0], s = e[1], u, l = null, o = null, h = "auto";
    switch (n) {
      case "\\dfrac":
      case "\\frac":
      case "\\tfrac":
        u = !0;
        break;
      case "\\\\atopfrac":
        u = !1;
        break;
      case "\\dbinom":
      case "\\binom":
      case "\\tbinom":
        u = !1, l = "(", o = ")";
        break;
      case "\\\\bracefrac":
        u = !1, l = "\\{", o = "\\}";
        break;
      case "\\\\brackfrac":
        u = !1, l = "[", o = "]";
        break;
      default:
        throw new Error("Unrecognized genfrac command");
    }
    switch (n) {
      case "\\dfrac":
      case "\\dbinom":
        h = "display";
        break;
      case "\\tfrac":
      case "\\tbinom":
        h = "text";
        break;
    }
    return {
      type: "genfrac",
      mode: t.mode,
      continued: !1,
      numer: r,
      denom: s,
      hasBarLine: u,
      leftDelim: l,
      rightDelim: o,
      size: h,
      barSize: null
    };
  },
  htmlBuilder: no,
  mathmlBuilder: io
});
Ee({
  type: "genfrac",
  names: ["\\cfrac"],
  props: {
    numArgs: 2
  },
  handler: (i, e) => {
    var {
      parser: t,
      funcName: n
    } = i, r = e[0], s = e[1];
    return {
      type: "genfrac",
      mode: t.mode,
      continued: !0,
      numer: r,
      denom: s,
      hasBarLine: !0,
      leftDelim: null,
      rightDelim: null,
      size: "display",
      barSize: null
    };
  }
});
Ee({
  type: "infix",
  names: ["\\over", "\\choose", "\\atop", "\\brace", "\\brack"],
  props: {
    numArgs: 0,
    infix: !0
  },
  handler(i) {
    var {
      parser: e,
      funcName: t,
      token: n
    } = i, r;
    switch (t) {
      case "\\over":
        r = "\\frac";
        break;
      case "\\choose":
        r = "\\binom";
        break;
      case "\\atop":
        r = "\\\\atopfrac";
        break;
      case "\\brace":
        r = "\\\\bracefrac";
        break;
      case "\\brack":
        r = "\\\\brackfrac";
        break;
      default:
        throw new Error("Unrecognized infix genfrac command");
    }
    return {
      type: "infix",
      mode: e.mode,
      replaceWith: r,
      token: n
    };
  }
});
var sl = ["display", "text", "script", "scriptscript"], al = function(e) {
  var t = null;
  return e.length > 0 && (t = e, t = t === "." ? null : t), t;
};
Ee({
  type: "genfrac",
  names: ["\\genfrac"],
  props: {
    numArgs: 6,
    allowedInArgument: !0,
    argTypes: ["math", "math", "size", "text", "math", "math"]
  },
  handler(i, e) {
    var {
      parser: t
    } = i, n = e[4], r = e[5], s = ss(e[0]), u = s.type === "atom" && s.family === "open" ? al(s.text) : null, l = ss(e[1]), o = l.type === "atom" && l.family === "close" ? al(l.text) : null, h = qe(e[2], "size"), d, c = null;
    h.isBlank ? d = !0 : (c = h.value, d = c.number > 0);
    var f = "auto", g = e[3];
    if (g.type === "ordgroup") {
      if (g.body.length > 0) {
        var A = qe(g.body[0], "textord");
        f = sl[Number(A.text)];
      }
    } else
      g = qe(g, "textord"), f = sl[Number(g.text)];
    return {
      type: "genfrac",
      mode: t.mode,
      numer: n,
      denom: r,
      continued: !1,
      hasBarLine: d,
      barSize: c,
      leftDelim: u,
      rightDelim: o,
      size: f
    };
  },
  htmlBuilder: no,
  mathmlBuilder: io
});
Ee({
  type: "infix",
  names: ["\\above"],
  props: {
    numArgs: 1,
    argTypes: ["size"],
    infix: !0
  },
  handler(i, e) {
    var {
      parser: t,
      funcName: n,
      token: r
    } = i;
    return {
      type: "infix",
      mode: t.mode,
      replaceWith: "\\\\abovefrac",
      size: qe(e[0], "size").value,
      token: r
    };
  }
});
Ee({
  type: "genfrac",
  names: ["\\\\abovefrac"],
  props: {
    numArgs: 3,
    argTypes: ["math", "size", "math"]
  },
  handler: (i, e) => {
    var {
      parser: t,
      funcName: n
    } = i, r = e[0], s = Kh(qe(e[1], "infix").size), u = e[2], l = s.number > 0;
    return {
      type: "genfrac",
      mode: t.mode,
      numer: r,
      denom: u,
      continued: !1,
      hasBarLine: l,
      barSize: s,
      leftDelim: null,
      rightDelim: null,
      size: "auto"
    };
  },
  htmlBuilder: no,
  mathmlBuilder: io
});
var bu = (i, e) => {
  var t = e.style, n, r;
  i.type === "supsub" ? (n = i.sup ? je(i.sup, e.havingStyle(t.sup()), e) : je(i.sub, e.havingStyle(t.sub()), e), r = qe(i.base, "horizBrace")) : r = qe(i, "horizBrace");
  var s = je(r.base, e.havingBaseStyle(Ne.DISPLAY)), u = Vn.svgSpan(r, e), l;
  if (r.isOver ? (l = ne.makeVList({
    positionType: "firstBaseline",
    children: [{
      type: "elem",
      elem: s
    }, {
      type: "kern",
      size: 0.1
    }, {
      type: "elem",
      elem: u
    }]
  }, e), l.children[0].children[0].children[1].classes.push("svg-align")) : (l = ne.makeVList({
    positionType: "bottom",
    positionData: s.depth + 0.1 + u.height,
    children: [{
      type: "elem",
      elem: u
    }, {
      type: "kern",
      size: 0.1
    }, {
      type: "elem",
      elem: s
    }]
  }, e), l.children[0].children[0].children[0].classes.push("svg-align")), n) {
    var o = ne.makeSpan(["mord", r.isOver ? "mover" : "munder"], [l], e);
    r.isOver ? l = ne.makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: o
      }, {
        type: "kern",
        size: 0.2
      }, {
        type: "elem",
        elem: n
      }]
    }, e) : l = ne.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 ne.makeSpan(["mord", r.isOver ? "mover" : "munder"], [l], e);
}, bf = (i, e) => {
  var t = Vn.mathMLnode(i.label);
  return new ge.MathNode(i.isOver ? "mover" : "munder", [$e(i.base, e), t]);
};
Ee({
  type: "horizBrace",
  names: ["\\overbrace", "\\underbrace"],
  props: {
    numArgs: 1
  },
  handler(i, e) {
    var {
      parser: t,
      funcName: n
    } = i;
    return {
      type: "horizBrace",
      mode: t.mode,
      label: n,
      isOver: /^\\over/.test(n),
      base: e[0]
    };
  },
  htmlBuilder: bu,
  mathmlBuilder: bf
});
Ee({
  type: "href",
  names: ["\\href"],
  props: {
    numArgs: 2,
    argTypes: ["url", "original"],
    allowedInText: !0
  },
  handler: (i, e) => {
    var {
      parser: t
    } = i, n = e[1], r = qe(e[0], "url").url;
    return t.settings.isTrusted({
      command: "\\href",
      url: r
    }) ? {
      type: "href",
      mode: t.mode,
      href: r,
      body: ot(n)
    } : t.formatUnsupportedCmd("\\href");
  },
  htmlBuilder: (i, e) => {
    var t = gt(i.body, e, !1);
    return ne.makeAnchor(i.href, [], t, e);
  },
  mathmlBuilder: (i, e) => {
    var t = oi(i.body, e);
    return t instanceof pn || (t = new pn("mrow", [t])), t.setAttribute("href", i.href), t;
  }
});
Ee({
  type: "href",
  names: ["\\url"],
  props: {
    numArgs: 1,
    argTypes: ["url"],
    allowedInText: !0
  },
  handler: (i, e) => {
    var {
      parser: t
    } = i, n = qe(e[0], "url").url;
    if (!t.settings.isTrusted({
      command: "\\url",
      url: n
    }))
      return t.formatUnsupportedCmd("\\url");
    for (var r = [], s = 0; s < n.length; s++) {
      var u = n[s];
      u === "~" && (u = "\\textasciitilde"), r.push({
        type: "textord",
        mode: "text",
        text: u
      });
    }
    var l = {
      type: "text",
      mode: t.mode,
      font: "\\texttt",
      body: r
    };
    return {
      type: "href",
      mode: t.mode,
      href: n,
      body: ot(l)
    };
  }
});
Ee({
  type: "hbox",
  names: ["\\hbox"],
  props: {
    numArgs: 1,
    argTypes: ["text"],
    allowedInText: !0,
    primitive: !0
  },
  handler(i, e) {
    var {
      parser: t
    } = i;
    return {
      type: "hbox",
      mode: t.mode,
      body: ot(e[0])
    };
  },
  htmlBuilder(i, e) {
    var t = gt(i.body, e, !1);
    return ne.makeFragment(t);
  },
  mathmlBuilder(i, e) {
    return new ge.MathNode("mrow", Gt(i.body, e));
  }
});
Ee({
  type: "html",
  names: ["\\htmlClass", "\\htmlId", "\\htmlStyle", "\\htmlData"],
  props: {
    numArgs: 2,
    argTypes: ["raw", "original"],
    allowedInText: !0
  },
  handler: (i, e) => {
    var {
      parser: t,
      funcName: n,
      token: r
    } = i, s = qe(e[0], "raw").string, u = 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 = s, l = {
          command: "\\htmlClass",
          class: s
        };
        break;
      case "\\htmlId":
        o.id = s, l = {
          command: "\\htmlId",
          id: s
        };
        break;
      case "\\htmlStyle":
        o.style = s, l = {
          command: "\\htmlStyle",
          style: s
        };
        break;
      case "\\htmlData": {
        for (var h = s.split(","), d = 0; d < h.length; d++) {
          var c = h[d].split("=");
          if (c.length !== 2)
            throw new Re("Error parsing key-value for \\htmlData");
          o["data-" + c[0].trim()] = c[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: ot(u)
    } : t.formatUnsupportedCmd(n);
  },
  htmlBuilder: (i, e) => {
    var t = gt(i.body, e, !1), n = ["enclosing"];
    i.attributes.class && n.push(...i.attributes.class.trim().split(/\s+/));
    var r = ne.makeSpan(n, t, e);
    for (var s in i.attributes)
      s !== "class" && i.attributes.hasOwnProperty(s) && r.setAttribute(s, i.attributes[s]);
    return r;
  },
  mathmlBuilder: (i, e) => oi(i.body, e)
});
Ee({
  type: "htmlmathml",
  names: ["\\html@mathml"],
  props: {
    numArgs: 2,
    allowedInText: !0
  },
  handler: (i, e) => {
    var {
      parser: t
    } = i;
    return {
      type: "htmlmathml",
      mode: t.mode,
      html: ot(e[0]),
      mathml: ot(e[1])
    };
  },
  htmlBuilder: (i, e) => {
    var t = gt(i.html, e, !1);
    return ne.makeFragment(t);
  },
  mathmlBuilder: (i, e) => oi(i.mathml, e)
});
var oa = 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 Re("Invalid size: '" + e + "' in \\includegraphics");
  var n = {
    number: +(t[1] + t[2]),
    // sign + magnitude, cast to number
    unit: t[3]
  };
  if (!bd(n))
    throw new Re("Invalid unit: '" + n.unit + "' in \\includegraphics.");
  return n;
};
Ee({
  type: "includegraphics",
  names: ["\\includegraphics"],
  props: {
    numArgs: 1,
    numOptionalArgs: 1,
    argTypes: ["raw", "url"],
    allowedInText: !1
  },
  handler: (i, e, t) => {
    var {
      parser: n
    } = i, r = {
      number: 0,
      unit: "em"
    }, s = {
      number: 0.9,
      unit: "em"
    }, u = {
      number: 0,
      unit: "em"
    }, l = "";
    if (t[0])
      for (var o = qe(t[0], "raw").string, h = o.split(","), d = 0; d < h.length; d++) {
        var c = h[d].split("=");
        if (c.length === 2) {
          var f = c[1].trim();
          switch (c[0].trim()) {
            case "alt":
              l = f;
              break;
            case "width":
              r = oa(f);
              break;
            case "height":
              s = oa(f);
              break;
            case "totalheight":
              u = oa(f);
              break;
            default:
              throw new Re("Invalid key: '" + c[0] + "' in \\includegraphics.");
          }
        }
      }
    var g = qe(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: r,
      height: s,
      totalheight: u,
      src: g
    } : n.formatUnsupportedCmd("\\includegraphics");
  },
  htmlBuilder: (i, e) => {
    var t = nt(i.height, e), n = 0;
    i.totalheight.number > 0 && (n = nt(i.totalheight, e) - t);
    var r = 0;
    i.width.number > 0 && (r = nt(i.width, e));
    var s = {
      height: Se(t + n)
    };
    r > 0 && (s.width = Se(r)), n > 0 && (s.verticalAlign = Se(-n));
    var u = new vd(i.src, i.alt, s);
    return u.height = t, u.depth = n, u;
  },
  mathmlBuilder: (i, e) => {
    var t = new ge.MathNode("mglyph", []);
    t.setAttribute("alt", i.alt);
    var n = nt(i.height, e), r = 0;
    if (i.totalheight.number > 0 && (r = nt(i.totalheight, e) - n, t.setAttribute("valign", Se(-r))), t.setAttribute("height", Se(n + r)), i.width.number > 0) {
      var s = nt(i.width, e);
      t.setAttribute("width", Se(s));
    }
    return t.setAttribute("src", i.src), t;
  }
});
Ee({
  type: "kern",
  names: ["\\kern", "\\mkern", "\\hskip", "\\mskip"],
  props: {
    numArgs: 1,
    argTypes: ["size"],
    primitive: !0,
    allowedInText: !0
  },
  handler(i, e) {
    var {
      parser: t,
      funcName: n
    } = i, r = qe(e[0], "size");
    if (t.settings.strict) {
      var s = n[1] === "m", u = r.value.unit === "mu";
      s ? (u || t.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + n + " supports only mu units, " + ("not " + r.value.unit + " units")), t.mode !== "math" && t.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + n + " works only in math mode")) : u && t.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + n + " doesn't support mu units");
    }
    return {
      type: "kern",
      mode: t.mode,
      dimension: r.value
    };
  },
  htmlBuilder(i, e) {
    return ne.makeGlue(i.dimension, e);
  },
  mathmlBuilder(i, e) {
    var t = nt(i.dimension, e);
    return new ge.SpaceNode(t);
  }
});
Ee({
  type: "lap",
  names: ["\\mathllap", "\\mathrlap", "\\mathclap"],
  props: {
    numArgs: 1,
    allowedInText: !0
  },
  handler: (i, e) => {
    var {
      parser: t,
      funcName: n
    } = i, r = e[0];
    return {
      type: "lap",
      mode: t.mode,
      alignment: n.slice(5),
      body: r
    };
  },
  htmlBuilder: (i, e) => {
    var t;
    i.alignment === "clap" ? (t = ne.makeSpan([], [je(i.body, e)]), t = ne.makeSpan(["inner"], [t], e)) : t = ne.makeSpan(["inner"], [je(i.body, e)]);
    var n = ne.makeSpan(["fix"], []), r = ne.makeSpan([i.alignment], [t, n], e), s = ne.makeSpan(["strut"]);
    return s.style.height = Se(r.height + r.depth), r.depth && (s.style.verticalAlign = Se(-r.depth)), r.children.unshift(s), r = ne.makeSpan(["thinbox"], [r], e), ne.makeSpan(["mord", "vbox"], [r], e);
  },
  mathmlBuilder: (i, e) => {
    var t = new ge.MathNode("mpadded", [$e(i.body, e)]);
    if (i.alignment !== "rlap") {
      var n = i.alignment === "llap" ? "-1" : "-0.5";
      t.setAttribute("lspace", n + "width");
    }
    return t.setAttribute("width", "0px"), t;
  }
});
Ee({
  type: "styling",
  names: ["\\(", "$"],
  props: {
    numArgs: 0,
    allowedInText: !0,
    allowedInMath: !1
  },
  handler(i, e) {
    var {
      funcName: t,
      parser: n
    } = i, r = n.mode;
    n.switchMode("math");
    var s = t === "\\(" ? "\\)" : "$", u = n.parseExpression(!1, s);
    return n.expect(s), n.switchMode(r), {
      type: "styling",
      mode: n.mode,
      style: "text",
      body: u
    };
  }
});
Ee({
  type: "text",
  // Doesn't matter what this is.
  names: ["\\)", "\\]"],
  props: {
    numArgs: 0,
    allowedInText: !0,
    allowedInMath: !1
  },
  handler(i, e) {
    throw new Re("Mismatched " + i.funcName);
  }
});
var ol = (i, e) => {
  switch (e.style.size) {
    case Ne.DISPLAY.size:
      return i.display;
    case Ne.TEXT.size:
      return i.text;
    case Ne.SCRIPT.size:
      return i.script;
    case Ne.SCRIPTSCRIPT.size:
      return i.scriptscript;
    default:
      return i.text;
  }
};
Ee({
  type: "mathchoice",
  names: ["\\mathchoice"],
  props: {
    numArgs: 4,
    primitive: !0
  },
  handler: (i, e) => {
    var {
      parser: t
    } = i;
    return {
      type: "mathchoice",
      mode: t.mode,
      display: ot(e[0]),
      text: ot(e[1]),
      script: ot(e[2]),
      scriptscript: ot(e[3])
    };
  },
  htmlBuilder: (i, e) => {
    var t = ol(i, e), n = gt(t, e, !1);
    return ne.makeFragment(n);
  },
  mathmlBuilder: (i, e) => {
    var t = ol(i, e);
    return oi(t, e);
  }
});
var vu = (i, e, t, n, r, s, u) => {
  i = ne.makeSpan([], [i]);
  var l = t && Ie.isCharacterBox(t), o, h;
  if (e) {
    var d = je(e, n.havingStyle(r.sup()), n);
    h = {
      elem: d,
      kern: Math.max(n.fontMetrics().bigOpSpacing1, n.fontMetrics().bigOpSpacing3 - d.depth)
    };
  }
  if (t) {
    var c = je(t, n.havingStyle(r.sub()), n);
    o = {
      elem: c,
      kern: Math.max(n.fontMetrics().bigOpSpacing2, n.fontMetrics().bigOpSpacing4 - c.height)
    };
  }
  var f;
  if (h && o) {
    var g = n.fontMetrics().bigOpSpacing5 + o.elem.height + o.elem.depth + o.kern + i.depth + u;
    f = ne.makeVList({
      positionType: "bottom",
      positionData: g,
      children: [{
        type: "kern",
        size: n.fontMetrics().bigOpSpacing5
      }, {
        type: "elem",
        elem: o.elem,
        marginLeft: Se(-s)
      }, {
        type: "kern",
        size: o.kern
      }, {
        type: "elem",
        elem: i
      }, {
        type: "kern",
        size: h.kern
      }, {
        type: "elem",
        elem: h.elem,
        marginLeft: Se(s)
      }, {
        type: "kern",
        size: n.fontMetrics().bigOpSpacing5
      }]
    }, n);
  } else if (o) {
    var A = i.height - u;
    f = ne.makeVList({
      positionType: "top",
      positionData: A,
      children: [{
        type: "kern",
        size: n.fontMetrics().bigOpSpacing5
      }, {
        type: "elem",
        elem: o.elem,
        marginLeft: Se(-s)
      }, {
        type: "kern",
        size: o.kern
      }, {
        type: "elem",
        elem: i
      }]
    }, n);
  } else if (h) {
    var m = i.depth + u;
    f = ne.makeVList({
      positionType: "bottom",
      positionData: m,
      children: [{
        type: "elem",
        elem: i
      }, {
        type: "kern",
        size: h.kern
      }, {
        type: "elem",
        elem: h.elem,
        marginLeft: Se(s)
      }, {
        type: "kern",
        size: n.fontMetrics().bigOpSpacing5
      }]
    }, n);
  } else
    return i;
  var k = [f];
  if (o && s !== 0 && !l) {
    var a = ne.makeSpan(["mspace"], [], n);
    a.style.marginRight = Se(s), k.unshift(a);
  }
  return ne.makeSpan(["mop", "op-limits"], k, n);
}, yu = ["\\smallint"], $i = (i, e) => {
  var t, n, r = !1, s;
  i.type === "supsub" ? (t = i.sup, n = i.sub, s = qe(i.base, "op"), r = !0) : s = qe(i, "op");
  var u = e.style, l = !1;
  u.size === Ne.DISPLAY.size && s.symbol && !Ie.contains(yu, s.name) && (l = !0);
  var o;
  if (s.symbol) {
    var h = l ? "Size2-Regular" : "Size1-Regular", d = "";
    if ((s.name === "\\oiint" || s.name === "\\oiiint") && (d = s.name.slice(1), s.name = d === "oiint" ? "\\iint" : "\\iiint"), o = ne.makeSymbol(s.name, h, "math", e, ["mop", "op-symbol", l ? "large-op" : "small-op"]), d.length > 0) {
      var c = o.italic, f = ne.staticSvg(d + "Size" + (l ? "2" : "1"), e);
      o = ne.makeVList({
        positionType: "individualShift",
        children: [{
          type: "elem",
          elem: o,
          shift: 0
        }, {
          type: "elem",
          elem: f,
          shift: l ? 0.08 : 0
        }]
      }, e), s.name = "\\" + d, o.classes.unshift("mop"), o.italic = c;
    }
  } else if (s.body) {
    var g = gt(s.body, e, !0);
    g.length === 1 && g[0] instanceof Dn ? (o = g[0], o.classes[0] = "mop") : o = ne.makeSpan(["mop"], g, e);
  } else {
    for (var A = [], m = 1; m < s.name.length; m++)
      A.push(ne.mathsym(s.name[m], s.mode, e));
    o = ne.makeSpan(["mop"], A, e);
  }
  var k = 0, a = 0;
  return (o instanceof Dn || s.name === "\\oiint" || s.name === "\\oiiint") && !s.suppressBaseShift && (k = (o.height - o.depth) / 2 - e.fontMetrics().axisHeight, a = o.italic), r ? vu(o, t, n, e, u, a, k) : (k && (o.style.position = "relative", o.style.top = Se(k)), o);
}, yr = (i, e) => {
  var t;
  if (i.symbol)
    t = new pn("mo", [tn(i.name, i.mode)]), Ie.contains(yu, i.name) && t.setAttribute("largeop", "false");
  else if (i.body)
    t = new pn("mo", Gt(i.body, e));
  else {
    t = new pn("mi", [new dr(i.name.slice(1))]);
    var n = new pn("mo", [tn("⁡", "text")]);
    i.parentIsSupSub ? t = new pn("mrow", [t, n]) : t = K0([t, n]);
  }
  return t;
}, vf = {
  "∏": "\\prod",
  "∐": "\\coprod",
  "∑": "\\sum",
  "⋀": "\\bigwedge",
  "⋁": "\\bigvee",
  "⋂": "\\bigcap",
  "⋃": "\\bigcup",
  "⨀": "\\bigodot",
  "⨁": "\\bigoplus",
  "⨂": "\\bigotimes",
  "⨄": "\\biguplus",
  "⨆": "\\bigsqcup"
};
Ee({
  type: "op",
  names: ["\\coprod", "\\bigvee", "\\bigwedge", "\\biguplus", "\\bigcap", "\\bigcup", "\\intop", "\\prod", "\\sum", "\\bigotimes", "\\bigoplus", "\\bigodot", "\\bigsqcup", "\\smallint", "∏", "∐", "∑", "⋀", "⋁", "⋂", "⋃", "⨀", "⨁", "⨂", "⨄", "⨆"],
  props: {
    numArgs: 0
  },
  handler: (i, e) => {
    var {
      parser: t,
      funcName: n
    } = i, r = n;
    return r.length === 1 && (r = vf[r]), {
      type: "op",
      mode: t.mode,
      limits: !0,
      parentIsSupSub: !1,
      symbol: !0,
      name: r
    };
  },
  htmlBuilder: $i,
  mathmlBuilder: yr
});
Ee({
  type: "op",
  names: ["\\mathop"],
  props: {
    numArgs: 1,
    primitive: !0
  },
  handler: (i, e) => {
    var {
      parser: t
    } = i, n = e[0];
    return {
      type: "op",
      mode: t.mode,
      limits: !1,
      parentIsSupSub: !1,
      symbol: !1,
      body: ot(n)
    };
  },
  htmlBuilder: $i,
  mathmlBuilder: yr
});
var yf = {
  "∫": "\\int",
  "∬": "\\iint",
  "∭": "\\iiint",
  "∮": "\\oint",
  "∯": "\\oiint",
  "∰": "\\oiiint"
};
Ee({
  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(i) {
    var {
      parser: e,
      funcName: t
    } = i;
    return {
      type: "op",
      mode: e.mode,
      limits: !1,
      parentIsSupSub: !1,
      symbol: !1,
      name: t
    };
  },
  htmlBuilder: $i,
  mathmlBuilder: yr
});
Ee({
  type: "op",
  names: ["\\det", "\\gcd", "\\inf", "\\lim", "\\max", "\\min", "\\Pr", "\\sup"],
  props: {
    numArgs: 0
  },
  handler(i) {
    var {
      parser: e,
      funcName: t
    } = i;
    return {
      type: "op",
      mode: e.mode,
      limits: !0,
      parentIsSupSub: !1,
      symbol: !1,
      name: t
    };
  },
  htmlBuilder: $i,
  mathmlBuilder: yr
});
Ee({
  type: "op",
  names: ["\\int", "\\iint", "\\iiint", "\\oint", "\\oiint", "\\oiiint", "∫", "∬", "∭", "∮", "∯", "∰"],
  props: {
    numArgs: 0
  },
  handler(i) {
    var {
      parser: e,
      funcName: t
    } = i, n = t;
    return n.length === 1 && (n = yf[n]), {
      type: "op",
      mode: e.mode,
      limits: !1,
      parentIsSupSub: !1,
      symbol: !0,
      name: n
    };
  },
  htmlBuilder: $i,
  mathmlBuilder: yr
});
var wu = (i, e) => {
  var t, n, r = !1, s;
  i.type === "supsub" ? (t = i.sup, n = i.sub, s = qe(i.base, "operatorname"), r = !0) : s = qe(i, "operatorname");
  var u;
  if (s.body.length > 0) {
    for (var l = s.body.map((c) => {
      var f = c.text;
      return typeof f == "string" ? {
        type: "textord",
        mode: c.mode,
        text: f
      } : c;
    }), o = gt(l, e.withFont("mathrm"), !0), h = 0; h < o.length; h++) {
      var d = o[h];
      d instanceof Dn && (d.text = d.text.replace(/\u2212/, "-").replace(/\u2217/, "*"));
    }
    u = ne.makeSpan(["mop"], o, e);
  } else
    u = ne.makeSpan(["mop"], [], e);
  return r ? vu(u, t, n, e, e.style, 0, 0) : u;
}, wf = (i, e) => {
  for (var t = Gt(i.body, e.withFont("mathrm")), n = !0, r = 0; r < t.length; r++) {
    var s = t[r];
    if (!(s instanceof ge.SpaceNode)) if (s instanceof ge.MathNode)
      switch (s.type) {
        case "mi":
        case "mn":
        case "ms":
        case "mspace":
        case "mtext":
          break;
        case "mo": {
          var u = s.children[0];
          s.children.length === 1 && u instanceof ge.TextNode ? u.text = u.text.replace(/\u2212/, "-").replace(/\u2217/, "*") : n = !1;
          break;
        }
        default:
          n = !1;
      }
    else
      n = !1;
  }
  if (n) {
    var l = t.map((d) => d.toText()).join("");
    t = [new ge.TextNode(l)];
  }
  var o = new ge.MathNode("mi", t);
  o.setAttribute("mathvariant", "normal");
  var h = new ge.MathNode("mo", [tn("⁡", "text")]);
  return i.parentIsSupSub ? new ge.MathNode("mrow", [o, h]) : ge.newDocumentFragment([o, h]);
};
Ee({
  type: "operatorname",
  names: ["\\operatorname@", "\\operatornamewithlimits"],
  props: {
    numArgs: 1
  },
  handler: (i, e) => {
    var {
      parser: t,
      funcName: n
    } = i, r = e[0];
    return {
      type: "operatorname",
      mode: t.mode,
      body: ot(r),
      alwaysHandleSupSub: n === "\\operatornamewithlimits",
      limits: !1,
      parentIsSupSub: !1
    };
  },
  htmlBuilder: wu,
  mathmlBuilder: wf
});
z("\\operatorname", "\\@ifstar\\operatornamewithlimits\\operatorname@");
Ri({
  type: "ordgroup",
  htmlBuilder(i, e) {
    return i.semisimple ? ne.makeFragment(gt(i.body, e, !1)) : ne.makeSpan(["mord"], gt(i.body, e, !0), e);
  },
  mathmlBuilder(i, e) {
    return oi(i.body, e, !0);
  }
});
Ee({
  type: "overline",
  names: ["\\overline"],
  props: {
    numArgs: 1
  },
  handler(i, e) {
    var {
      parser: t
    } = i, n = e[0];
    return {
      type: "overline",
      mode: t.mode,
      body: n
    };
  },
  htmlBuilder(i, e) {
    var t = je(i.body, e.havingCrampedStyle()), n = ne.makeLineSpan("overline-line", e), r = e.fontMetrics().defaultRuleThickness, s = ne.makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: t
      }, {
        type: "kern",
        size: 3 * r
      }, {
        type: "elem",
        elem: n
      }, {
        type: "kern",
        size: r
      }]
    }, e);
    return ne.makeSpan(["mord", "overline"], [s], e);
  },
  mathmlBuilder(i, e) {
    var t = new ge.MathNode("mo", [new ge.TextNode("‾")]);
    t.setAttribute("stretchy", "true");
    var n = new ge.MathNode("mover", [$e(i.body, e), t]);
    return n.setAttribute("accent", "true"), n;
  }
});
Ee({
  type: "phantom",
  names: ["\\phantom"],
  props: {
    numArgs: 1,
    allowedInText: !0
  },
  handler: (i, e) => {
    var {
      parser: t
    } = i, n = e[0];
    return {
      type: "phantom",
      mode: t.mode,
      body: ot(n)
    };
  },
  htmlBuilder: (i, e) => {
    var t = gt(i.body, e.withPhantom(), !1);
    return ne.makeFragment(t);
  },
  mathmlBuilder: (i, e) => {
    var t = Gt(i.body, e);
    return new ge.MathNode("mphantom", t);
  }
});
Ee({
  type: "hphantom",
  names: ["\\hphantom"],
  props: {
    numArgs: 1,
    allowedInText: !0
  },
  handler: (i, e) => {
    var {
      parser: t
    } = i, n = e[0];
    return {
      type: "hphantom",
      mode: t.mode,
      body: n
    };
  },
  htmlBuilder: (i, e) => {
    var t = ne.makeSpan([], [je(i.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 = ne.makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: t
      }]
    }, e), ne.makeSpan(["mord"], [t], e);
  },
  mathmlBuilder: (i, e) => {
    var t = Gt(ot(i.body), e), n = new ge.MathNode("mphantom", t), r = new ge.MathNode("mpadded", [n]);
    return r.setAttribute("height", "0px"), r.setAttribute("depth", "0px"), r;
  }
});
Ee({
  type: "vphantom",
  names: ["\\vphantom"],
  props: {
    numArgs: 1,
    allowedInText: !0
  },
  handler: (i, e) => {
    var {
      parser: t
    } = i, n = e[0];
    return {
      type: "vphantom",
      mode: t.mode,
      body: n
    };
  },
  htmlBuilder: (i, e) => {
    var t = ne.makeSpan(["inner"], [je(i.body, e.withPhantom())]), n = ne.makeSpan(["fix"], []);
    return ne.makeSpan(["mord", "rlap"], [t, n], e);
  },
  mathmlBuilder: (i, e) => {
    var t = Gt(ot(i.body), e), n = new ge.MathNode("mphantom", t), r = new ge.MathNode("mpadded", [n]);
    return r.setAttribute("width", "0px"), r;
  }
});
Ee({
  type: "raisebox",
  names: ["\\raisebox"],
  props: {
    numArgs: 2,
    argTypes: ["size", "hbox"],
    allowedInText: !0
  },
  handler(i, e) {
    var {
      parser: t
    } = i, n = qe(e[0], "size").value, r = e[1];
    return {
      type: "raisebox",
      mode: t.mode,
      dy: n,
      body: r
    };
  },
  htmlBuilder(i, e) {
    var t = je(i.body, e), n = nt(i.dy, e);
    return ne.makeVList({
      positionType: "shift",
      positionData: -n,
      children: [{
        type: "elem",
        elem: t
      }]
    }, e);
  },
  mathmlBuilder(i, e) {
    var t = new ge.MathNode("mpadded", [$e(i.body, e)]), n = i.dy.number + i.dy.unit;
    return t.setAttribute("voffset", n), t;
  }
});
Ee({
  type: "internal",
  names: ["\\relax"],
  props: {
    numArgs: 0,
    allowedInText: !0
  },
  handler(i) {
    var {
      parser: e
    } = i;
    return {
      type: "internal",
      mode: e.mode
    };
  }
});
Ee({
  type: "rule",
  names: ["\\rule"],
  props: {
    numArgs: 2,
    numOptionalArgs: 1,
    argTypes: ["size", "size", "size"]
  },
  handler(i, e, t) {
    var {
      parser: n
    } = i, r = t[0], s = qe(e[0], "size"), u = qe(e[1], "size");
    return {
      type: "rule",
      mode: n.mode,
      shift: r && qe(r, "size").value,
      width: s.value,
      height: u.value
    };
  },
  htmlBuilder(i, e) {
    var t = ne.makeSpan(["mord", "rule"], [], e), n = nt(i.width, e), r = nt(i.height, e), s = i.shift ? nt(i.shift, e) : 0;
    return t.style.borderRightWidth = Se(n), t.style.borderTopWidth = Se(r), t.style.bottom = Se(s), t.width = n, t.height = r + s, t.depth = -s, t.maxFontSize = r * 1.125 * e.sizeMultiplier, t;
  },
  mathmlBuilder(i, e) {
    var t = nt(i.width, e), n = nt(i.height, e), r = i.shift ? nt(i.shift, e) : 0, s = e.color && e.getColor() || "black", u = new ge.MathNode("mspace");
    u.setAttribute("mathbackground", s), u.setAttribute("width", Se(t)), u.setAttribute("height", Se(n));
    var l = new ge.MathNode("mpadded", [u]);
    return r >= 0 ? l.setAttribute("height", Se(r)) : (l.setAttribute("height", Se(r)), l.setAttribute("depth", Se(-r))), l.setAttribute("voffset", Se(r)), l;
  }
});
function Au(i, e, t) {
  for (var n = gt(i, e, !1), r = e.sizeMultiplier / t.sizeMultiplier, s = 0; s < n.length; s++) {
    var u = n[s].classes.indexOf("sizing");
    u < 0 ? Array.prototype.push.apply(n[s].classes, e.sizingClasses(t)) : n[s].classes[u + 1] === "reset-size" + e.size && (n[s].classes[u + 1] = "reset-size" + t.size), n[s].height *= r, n[s].depth *= r;
  }
  return ne.makeFragment(n);
}
var ll = ["\\tiny", "\\sixptsize", "\\scriptsize", "\\footnotesize", "\\small", "\\normalsize", "\\large", "\\Large", "\\LARGE", "\\huge", "\\Huge"], Af = (i, e) => {
  var t = e.havingSize(i.size);
  return Au(i.body, t, e);
};
Ee({
  type: "sizing",
  names: ll,
  props: {
    numArgs: 0,
    allowedInText: !0
  },
  handler: (i, e) => {
    var {
      breakOnTokenText: t,
      funcName: n,
      parser: r
    } = i, s = r.parseExpression(!1, t);
    return {
      type: "sizing",
      mode: r.mode,
      // Figure out what size to use based on the list of functions above
      size: ll.indexOf(n) + 1,
      body: s
    };
  },
  htmlBuilder: Af,
  mathmlBuilder: (i, e) => {
    var t = e.havingSize(i.size), n = Gt(i.body, t), r = new ge.MathNode("mstyle", n);
    return r.setAttribute("mathsize", Se(t.sizeMultiplier)), r;
  }
});
Ee({
  type: "smash",
  names: ["\\smash"],
  props: {
    numArgs: 1,
    numOptionalArgs: 1,
    allowedInText: !0
  },
  handler: (i, e, t) => {
    var {
      parser: n
    } = i, r = !1, s = !1, u = t[0] && qe(t[0], "ordgroup");
    if (u)
      for (var l = "", o = 0; o < u.body.length; ++o) {
        var h = u.body[o];
        if (l = h.text, l === "t")
          r = !0;
        else if (l === "b")
          s = !0;
        else {
          r = !1, s = !1;
          break;
        }
      }
    else
      r = !0, s = !0;
    var d = e[0];
    return {
      type: "smash",
      mode: n.mode,
      body: d,
      smashHeight: r,
      smashDepth: s
    };
  },
  htmlBuilder: (i, e) => {
    var t = ne.makeSpan([], [je(i.body, e)]);
    if (!i.smashHeight && !i.smashDepth)
      return t;
    if (i.smashHeight && (t.height = 0, t.children))
      for (var n = 0; n < t.children.length; n++)
        t.children[n].height = 0;
    if (i.smashDepth && (t.depth = 0, t.children))
      for (var r = 0; r < t.children.length; r++)
        t.children[r].depth = 0;
    var s = ne.makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: t
      }]
    }, e);
    return ne.makeSpan(["mord"], [s], e);
  },
  mathmlBuilder: (i, e) => {
    var t = new ge.MathNode("mpadded", [$e(i.body, e)]);
    return i.smashHeight && t.setAttribute("height", "0px"), i.smashDepth && t.setAttribute("depth", "0px"), t;
  }
});
Ee({
  type: "sqrt",
  names: ["\\sqrt"],
  props: {
    numArgs: 1,
    numOptionalArgs: 1
  },
  handler(i, e, t) {
    var {
      parser: n
    } = i, r = t[0], s = e[0];
    return {
      type: "sqrt",
      mode: n.mode,
      body: s,
      index: r
    };
  },
  htmlBuilder(i, e) {
    var t = je(i.body, e.havingCrampedStyle());
    t.height === 0 && (t.height = e.fontMetrics().xHeight), t = ne.wrapFragment(t, e);
    var n = e.fontMetrics(), r = n.defaultRuleThickness, s = r;
    e.style.id < Ne.TEXT.id && (s = e.fontMetrics().xHeight);
    var u = r + s / 4, l = t.height + t.depth + u + r, {
      span: o,
      ruleWidth: h,
      advanceWidth: d
    } = Un.sqrtImage(l, e), c = o.height - h;
    c > t.height + t.depth + u && (u = (u + c - t.height - t.depth) / 2);
    var f = o.height - t.height - u - h;
    t.style.paddingLeft = Se(d);
    var g = ne.makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: t,
        wrapperClasses: ["svg-align"]
      }, {
        type: "kern",
        size: -(t.height + f)
      }, {
        type: "elem",
        elem: o
      }, {
        type: "kern",
        size: h
      }]
    }, e);
    if (i.index) {
      var A = e.havingStyle(Ne.SCRIPTSCRIPT), m = je(i.index, A, e), k = 0.6 * (g.height - g.depth), a = ne.makeVList({
        positionType: "shift",
        positionData: -k,
        children: [{
          type: "elem",
          elem: m
        }]
      }, e), p = ne.makeSpan(["root"], [a]);
      return ne.makeSpan(["mord", "sqrt"], [p, g], e);
    } else
      return ne.makeSpan(["mord", "sqrt"], [g], e);
  },
  mathmlBuilder(i, e) {
    var {
      body: t,
      index: n
    } = i;
    return n ? new ge.MathNode("mroot", [$e(t, e), $e(n, e)]) : new ge.MathNode("msqrt", [$e(t, e)]);
  }
});
var ul = {
  display: Ne.DISPLAY,
  text: Ne.TEXT,
  script: Ne.SCRIPT,
  scriptscript: Ne.SCRIPTSCRIPT
};
Ee({
  type: "styling",
  names: ["\\displaystyle", "\\textstyle", "\\scriptstyle", "\\scriptscriptstyle"],
  props: {
    numArgs: 0,
    allowedInText: !0,
    primitive: !0
  },
  handler(i, e) {
    var {
      breakOnTokenText: t,
      funcName: n,
      parser: r
    } = i, s = r.parseExpression(!0, t), u = n.slice(1, n.length - 5);
    return {
      type: "styling",
      mode: r.mode,
      // Figure out what style to use by pulling out the style from
      // the function name
      style: u,
      body: s
    };
  },
  htmlBuilder(i, e) {
    var t = ul[i.style], n = e.havingStyle(t).withFont("");
    return Au(i.body, n, e);
  },
  mathmlBuilder(i, e) {
    var t = ul[i.style], n = e.havingStyle(t), r = Gt(i.body, n), s = new ge.MathNode("mstyle", r), u = {
      display: ["0", "true"],
      text: ["0", "false"],
      script: ["1", "false"],
      scriptscript: ["2", "false"]
    }, l = u[i.style];
    return s.setAttribute("scriptlevel", l[0]), s.setAttribute("displaystyle", l[1]), s;
  }
});
var kf = function(e, t) {
  var n = e.base;
  if (n)
    if (n.type === "op") {
      var r = n.limits && (t.style.size === Ne.DISPLAY.size || n.alwaysHandleSupSub);
      return r ? $i : null;
    } else if (n.type === "operatorname") {
      var s = n.alwaysHandleSupSub && (t.style.size === Ne.DISPLAY.size || n.limits);
      return s ? wu : null;
    } else {
      if (n.type === "accent")
        return Ie.isCharacterBox(n.base) ? Ka : null;
      if (n.type === "horizBrace") {
        var u = !e.sub;
        return u === n.isOver ? bu : null;
      } else
        return null;
    }
  else return null;
};
Ri({
  type: "supsub",
  htmlBuilder(i, e) {
    var t = kf(i, e);
    if (t)
      return t(i, e);
    var {
      base: n,
      sup: r,
      sub: s
    } = i, u = je(n, e), l, o, h = e.fontMetrics(), d = 0, c = 0, f = n && Ie.isCharacterBox(n);
    if (r) {
      var g = e.havingStyle(e.style.sup());
      l = je(r, g, e), f || (d = u.height - g.fontMetrics().supDrop * g.sizeMultiplier / e.sizeMultiplier);
    }
    if (s) {
      var A = e.havingStyle(e.style.sub());
      o = je(s, A, e), f || (c = u.depth + A.fontMetrics().subDrop * A.sizeMultiplier / e.sizeMultiplier);
    }
    var m;
    e.style === Ne.DISPLAY ? m = h.sup1 : e.style.cramped ? m = h.sup3 : m = h.sup2;
    var k = e.sizeMultiplier, a = Se(0.5 / h.ptPerEm / k), p = null;
    if (o) {
      var b = i.base && i.base.type === "op" && i.base.name && (i.base.name === "\\oiint" || i.base.name === "\\oiiint");
      (u instanceof Dn || b) && (p = Se(-u.italic));
    }
    var y;
    if (l && o) {
      d = Math.max(d, m, l.depth + 0.25 * h.xHeight), c = Math.max(c, h.sub2);
      var C = h.defaultRuleThickness, M = 4 * C;
      if (d - l.depth - (o.height - c) < M) {
        c = M - (d - l.depth) + o.height;
        var L = 0.8 * h.xHeight - (d - l.depth);
        L > 0 && (d += L, c -= L);
      }
      var P = [{
        type: "elem",
        elem: o,
        shift: c,
        marginRight: a,
        marginLeft: p
      }, {
        type: "elem",
        elem: l,
        shift: -d,
        marginRight: a
      }];
      y = ne.makeVList({
        positionType: "individualShift",
        children: P
      }, e);
    } else if (o) {
      c = Math.max(c, h.sub1, o.height - 0.8 * h.xHeight);
      var O = [{
        type: "elem",
        elem: o,
        marginLeft: p,
        marginRight: a
      }];
      y = ne.makeVList({
        positionType: "shift",
        positionData: c,
        children: O
      }, e);
    } else if (l)
      d = Math.max(d, m, l.depth + 0.25 * h.xHeight), y = ne.makeVList({
        positionType: "shift",
        positionData: -d,
        children: [{
          type: "elem",
          elem: l,
          marginRight: a
        }]
      }, e);
    else
      throw new Error("supsub must have either sup or sub.");
    var q = xa(u, "right") || "mord";
    return ne.makeSpan([q], [u, ne.makeSpan(["msupsub"], [y])], e);
  },
  mathmlBuilder(i, e) {
    var t = !1, n, r;
    i.base && i.base.type === "horizBrace" && (r = !!i.sup, r === i.base.isOver && (t = !0, n = i.base.isOver)), i.base && (i.base.type === "op" || i.base.type === "operatorname") && (i.base.parentIsSupSub = !0);
    var s = [$e(i.base, e)];
    i.sub && s.push($e(i.sub, e)), i.sup && s.push($e(i.sup, e));
    var u;
    if (t)
      u = n ? "mover" : "munder";
    else if (i.sub)
      if (i.sup) {
        var h = i.base;
        h && h.type === "op" && h.limits && e.style === Ne.DISPLAY || h && h.type === "operatorname" && h.alwaysHandleSupSub && (e.style === Ne.DISPLAY || h.limits) ? u = "munderover" : u = "msubsup";
      } else {
        var o = i.base;
        o && o.type === "op" && o.limits && (e.style === Ne.DISPLAY || o.alwaysHandleSupSub) || o && o.type === "operatorname" && o.alwaysHandleSupSub && (o.limits || e.style === Ne.DISPLAY) ? u = "munder" : u = "msub";
      }
    else {
      var l = i.base;
      l && l.type === "op" && l.limits && (e.style === Ne.DISPLAY || l.alwaysHandleSupSub) || l && l.type === "operatorname" && l.alwaysHandleSupSub && (l.limits || e.style === Ne.DISPLAY) ? u = "mover" : u = "msup";
    }
    return new ge.MathNode(u, s);
  }
});
Ri({
  type: "atom",
  htmlBuilder(i, e) {
    return ne.mathsym(i.text, i.mode, e, ["m" + i.family]);
  },
  mathmlBuilder(i, e) {
    var t = new ge.MathNode("mo", [tn(i.text, i.mode)]);
    if (i.family === "bin") {
      var n = Wa(i, e);
      n === "bold-italic" && t.setAttribute("mathvariant", n);
    } else i.family === "punct" ? t.setAttribute("separator", "true") : (i.family === "open" || i.family === "close") && t.setAttribute("stretchy", "false");
    return t;
  }
});
var ku = {
  mi: "italic",
  mn: "normal",
  mtext: "normal"
};
Ri({
  type: "mathord",
  htmlBuilder(i, e) {
    return ne.makeOrd(i, e, "mathord");
  },
  mathmlBuilder(i, e) {
    var t = new ge.MathNode("mi", [tn(i.text, i.mode, e)]), n = Wa(i, e) || "italic";
    return n !== ku[t.type] && t.setAttribute("mathvariant", n), t;
  }
});
Ri({
  type: "textord",
  htmlBuilder(i, e) {
    return ne.makeOrd(i, e, "textord");
  },
  mathmlBuilder(i, e) {
    var t = tn(i.text, i.mode, e), n = Wa(i, e) || "normal", r;
    return i.mode === "text" ? r = new ge.MathNode("mtext", [t]) : /[0-9]/.test(i.text) ? r = new ge.MathNode("mn", [t]) : i.text === "\\prime" ? r = new ge.MathNode("mo", [t]) : r = new ge.MathNode("mi", [t]), n !== ku[r.type] && r.setAttribute("mathvariant", n), r;
  }
});
var la = {
  "\\nobreak": "nobreak",
  "\\allowbreak": "allowbreak"
}, ua = {
  " ": {},
  "\\ ": {},
  "~": {
    className: "nobreak"
  },
  "\\space": {},
  "\\nobreakspace": {
    className: "nobreak"
  }
};
Ri({
  type: "spacing",
  htmlBuilder(i, e) {
    if (ua.hasOwnProperty(i.text)) {
      var t = ua[i.text].className || "";
      if (i.mode === "text") {
        var n = ne.makeOrd(i, e, "textord");
        return n.classes.push(t), n;
      } else
        return ne.makeSpan(["mspace", t], [ne.mathsym(i.text, i.mode, e)], e);
    } else {
      if (la.hasOwnProperty(i.text))
        return ne.makeSpan(["mspace", la[i.text]], [], e);
      throw new Re('Unknown type of space "' + i.text + '"');
    }
  },
  mathmlBuilder(i, e) {
    var t;
    if (ua.hasOwnProperty(i.text))
      t = new ge.MathNode("mtext", [new ge.TextNode(" ")]);
    else {
      if (la.hasOwnProperty(i.text))
        return new ge.MathNode("mspace");
      throw new Re('Unknown type of space "' + i.text + '"');
    }
    return t;
  }
});
var cl = () => {
  var i = new ge.MathNode("mtd", []);
  return i.setAttribute("width", "50%"), i;
};
Ri({
  type: "tag",
  mathmlBuilder(i, e) {
    var t = new ge.MathNode("mtable", [new ge.MathNode("mtr", [cl(), new ge.MathNode("mtd", [oi(i.body, e)]), cl(), new ge.MathNode("mtd", [oi(i.tag, e)])])]);
    return t.setAttribute("width", "100%"), t;
  }
});
var hl = {
  "\\text": void 0,
  "\\textrm": "textrm",
  "\\textsf": "textsf",
  "\\texttt": "texttt",
  "\\textnormal": "textrm"
}, dl = {
  "\\textbf": "textbf",
  "\\textmd": "textmd"
}, Sf = {
  "\\textit": "textit",
  "\\textup": "textup"
}, fl = (i, e) => {
  var t = i.font;
  if (t) {
    if (hl[t])
      return e.withTextFontFamily(hl[t]);
    if (dl[t])
      return e.withTextFontWeight(dl[t]);
    if (t === "\\emph")
      return e.fontShape === "textit" ? e.withTextFontShape("textup") : e.withTextFontShape("textit");
  } else return e;
  return e.withTextFontShape(Sf[t]);
};
Ee({
  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(i, e) {
    var {
      parser: t,
      funcName: n
    } = i, r = e[0];
    return {
      type: "text",
      mode: t.mode,
      body: ot(r),
      font: n
    };
  },
  htmlBuilder(i, e) {
    var t = fl(i, e), n = gt(i.body, t, !0);
    return ne.makeSpan(["mord", "text"], n, t);
  },
  mathmlBuilder(i, e) {
    var t = fl(i, e);
    return oi(i.body, t);
  }
});
Ee({
  type: "underline",
  names: ["\\underline"],
  props: {
    numArgs: 1,
    allowedInText: !0
  },
  handler(i, e) {
    var {
      parser: t
    } = i;
    return {
      type: "underline",
      mode: t.mode,
      body: e[0]
    };
  },
  htmlBuilder(i, e) {
    var t = je(i.body, e), n = ne.makeLineSpan("underline-line", e), r = e.fontMetrics().defaultRuleThickness, s = ne.makeVList({
      positionType: "top",
      positionData: t.height,
      children: [{
        type: "kern",
        size: r
      }, {
        type: "elem",
        elem: n
      }, {
        type: "kern",
        size: 3 * r
      }, {
        type: "elem",
        elem: t
      }]
    }, e);
    return ne.makeSpan(["mord", "underline"], [s], e);
  },
  mathmlBuilder(i, e) {
    var t = new ge.MathNode("mo", [new ge.TextNode("‾")]);
    t.setAttribute("stretchy", "true");
    var n = new ge.MathNode("munder", [$e(i.body, e), t]);
    return n.setAttribute("accentunder", "true"), n;
  }
});
Ee({
  type: "vcenter",
  names: ["\\vcenter"],
  props: {
    numArgs: 1,
    argTypes: ["original"],
    // In LaTeX, \vcenter can act only on a box.
    allowedInText: !1
  },
  handler(i, e) {
    var {
      parser: t
    } = i;
    return {
      type: "vcenter",
      mode: t.mode,
      body: e[0]
    };
  },
  htmlBuilder(i, e) {
    var t = je(i.body, e), n = e.fontMetrics().axisHeight, r = 0.5 * (t.height - n - (t.depth + n));
    return ne.makeVList({
      positionType: "shift",
      positionData: r,
      children: [{
        type: "elem",
        elem: t
      }]
    }, e);
  },
  mathmlBuilder(i, e) {
    return new ge.MathNode("mpadded", [$e(i.body, e)], ["vcenter"]);
  }
});
Ee({
  type: "verb",
  names: ["\\verb"],
  props: {
    numArgs: 0,
    allowedInText: !0
  },
  handler(i, e, t) {
    throw new Re("\\verb ended by end of line instead of matching delimiter");
  },
  htmlBuilder(i, e) {
    for (var t = ml(i), n = [], r = e.havingStyle(e.style.text()), s = 0; s < t.length; s++) {
      var u = t[s];
      u === "~" && (u = "\\textasciitilde"), n.push(ne.makeSymbol(u, "Typewriter-Regular", i.mode, r, ["mord", "texttt"]));
    }
    return ne.makeSpan(["mord", "text"].concat(r.sizingClasses(e)), ne.tryCombineChars(n), r);
  },
  mathmlBuilder(i, e) {
    var t = new ge.TextNode(ml(i)), n = new ge.MathNode("mtext", [t]);
    return n.setAttribute("mathvariant", "monospace"), n;
  }
});
var ml = (i) => i.body.replace(/ /g, i.star ? "␣" : " "), xf = W0;
z("\\noexpand", function(i) {
  var e = i.popToken();
  return i.isExpandable(e.text) && (e.noexpand = !0, e.treatAsRelax = !0), {
    tokens: [e],
    numArgs: 0
  };
});
z("\\expandafter", function(i) {
  var e = i.popToken();
  return i.expandOnce(!0), {
    tokens: [e],
    numArgs: 0
  };
});
z("\\@firstoftwo", function(i) {
  var e = i.consumeArgs(2);
  return {
    tokens: e[0],
    numArgs: 0
  };
});
z("\\@secondoftwo", function(i) {
  var e = i.consumeArgs(2);
  return {
    tokens: e[1],
    numArgs: 0
  };
});
z("\\@ifnextchar", function(i) {
  var e = i.consumeArgs(3);
  i.consumeSpaces();
  var t = i.future();
  return e[0].length === 1 && e[0][0].text === t.text ? {
    tokens: e[1],
    numArgs: 0
  } : {
    tokens: e[2],
    numArgs: 0
  };
});
z("\\@ifstar", "\\@ifnextchar *{\\@firstoftwo{#1}}");
z("\\TextOrMath", function(i) {
  var e = i.consumeArgs(2);
  return i.mode === "text" ? {
    tokens: e[0],
    numArgs: 0
  } : {
    tokens: e[1],
    numArgs: 0
  };
});
var pl = {
  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
};
z("\\char", function(i) {
  var e = i.popToken(), t, n = "";
  if (e.text === "'")
    t = 8, e = i.popToken();
  else if (e.text === '"')
    t = 16, e = i.popToken();
  else if (e.text === "`")
    if (e = i.popToken(), e.text[0] === "\\")
      n = e.text.charCodeAt(1);
    else {
      if (e.text === "EOF")
        throw new Re("\\char` missing argument");
      n = e.text.charCodeAt(0);
    }
  else
    t = 10;
  if (t) {
    if (n = pl[e.text], n == null || n >= t)
      throw new Re("Invalid base-" + t + " digit " + e.text);
    for (var r; (r = pl[i.future().text]) != null && r < t; )
      n *= t, n += r, i.popToken();
  }
  return "\\@char{" + n + "}";
});
var ro = (i, e, t) => {
  var n = i.consumeArg().tokens;
  if (n.length !== 1)
    throw new Re("\\newcommand's first argument must be a macro name");
  var r = n[0].text, s = i.isDefined(r);
  if (s && !e)
    throw new Re("\\newcommand{" + r + "} attempting to redefine " + (r + "; use \\renewcommand"));
  if (!s && !t)
    throw new Re("\\renewcommand{" + r + "} when command " + r + " does not yet exist; use \\newcommand");
  var u = 0;
  if (n = i.consumeArg().tokens, n.length === 1 && n[0].text === "[") {
    for (var l = "", o = i.expandNextToken(); o.text !== "]" && o.text !== "EOF"; )
      l += o.text, o = i.expandNextToken();
    if (!l.match(/^\s*[0-9]+\s*$/))
      throw new Re("Invalid number of arguments: " + l);
    u = parseInt(l), n = i.consumeArg().tokens;
  }
  return i.macros.set(r, {
    tokens: n,
    numArgs: u
  }), "";
};
z("\\newcommand", (i) => ro(i, !1, !0));
z("\\renewcommand", (i) => ro(i, !0, !1));
z("\\providecommand", (i) => ro(i, !0, !0));
z("\\message", (i) => {
  var e = i.consumeArgs(1)[0];
  return console.log(e.reverse().map((t) => t.text).join("")), "";
});
z("\\errmessage", (i) => {
  var e = i.consumeArgs(1)[0];
  return console.error(e.reverse().map((t) => t.text).join("")), "";
});
z("\\show", (i) => {
  var e = i.popToken(), t = e.text;
  return console.log(e, i.macros.get(t), xf[t], lt.math[t], lt.text[t]), "";
});
z("\\bgroup", "{");
z("\\egroup", "}");
z("~", "\\nobreakspace");
z("\\lq", "`");
z("\\rq", "'");
z("\\aa", "\\r a");
z("\\AA", "\\r A");
z("\\textcopyright", "\\html@mathml{\\textcircled{c}}{\\char`©}");
z("\\copyright", "\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");
z("\\textregistered", "\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");
z("ℬ", "\\mathscr{B}");
z("ℰ", "\\mathscr{E}");
z("ℱ", "\\mathscr{F}");
z("ℋ", "\\mathscr{H}");
z("ℐ", "\\mathscr{I}");
z("ℒ", "\\mathscr{L}");
z("ℳ", "\\mathscr{M}");
z("ℛ", "\\mathscr{R}");
z("ℭ", "\\mathfrak{C}");
z("ℌ", "\\mathfrak{H}");
z("ℨ", "\\mathfrak{Z}");
z("\\Bbbk", "\\Bbb{k}");
z("·", "\\cdotp");
z("\\llap", "\\mathllap{\\textrm{#1}}");
z("\\rlap", "\\mathrlap{\\textrm{#1}}");
z("\\clap", "\\mathclap{\\textrm{#1}}");
z("\\mathstrut", "\\vphantom{(}");
z("\\underbar", "\\underline{\\text{#1}}");
z("\\not", '\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}');
z("\\neq", "\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");
z("\\ne", "\\neq");
z("≠", "\\neq");
z("\\notin", "\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");
z("∉", "\\notin");
z("≘", "\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");
z("≙", "\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");
z("≚", "\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");
z("≛", "\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");
z("≝", "\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");
z("≞", "\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");
z("≟", "\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");
z("⟂", "\\perp");
z("‼", "\\mathclose{!\\mkern-0.8mu!}");
z("∌", "\\notni");
z("⌜", "\\ulcorner");
z("⌝", "\\urcorner");
z("⌞", "\\llcorner");
z("⌟", "\\lrcorner");
z("©", "\\copyright");
z("®", "\\textregistered");
z("️", "\\textregistered");
z("\\ulcorner", '\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');
z("\\urcorner", '\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');
z("\\llcorner", '\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');
z("\\lrcorner", '\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');
z("\\vdots", "\\mathord{\\varvdots\\rule{0pt}{15pt}}");
z("⋮", "\\vdots");
z("\\varGamma", "\\mathit{\\Gamma}");
z("\\varDelta", "\\mathit{\\Delta}");
z("\\varTheta", "\\mathit{\\Theta}");
z("\\varLambda", "\\mathit{\\Lambda}");
z("\\varXi", "\\mathit{\\Xi}");
z("\\varPi", "\\mathit{\\Pi}");
z("\\varSigma", "\\mathit{\\Sigma}");
z("\\varUpsilon", "\\mathit{\\Upsilon}");
z("\\varPhi", "\\mathit{\\Phi}");
z("\\varPsi", "\\mathit{\\Psi}");
z("\\varOmega", "\\mathit{\\Omega}");
z("\\substack", "\\begin{subarray}{c}#1\\end{subarray}");
z("\\colon", "\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");
z("\\boxed", "\\fbox{$\\displaystyle{#1}$}");
z("\\iff", "\\DOTSB\\;\\Longleftrightarrow\\;");
z("\\implies", "\\DOTSB\\;\\Longrightarrow\\;");
z("\\impliedby", "\\DOTSB\\;\\Longleftarrow\\;");
var gl = {
  ",": "\\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"
};
z("\\dots", function(i) {
  var e = "\\dotso", t = i.expandAfterFuture().text;
  return t in gl ? e = gl[t] : (t.slice(0, 4) === "\\not" || t in lt.math && Ie.contains(["bin", "rel"], lt.math[t].group)) && (e = "\\dotsb"), e;
});
var so = {
  // \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
};
z("\\dotso", function(i) {
  var e = i.future().text;
  return e in so ? "\\ldots\\," : "\\ldots";
});
z("\\dotsc", function(i) {
  var e = i.future().text;
  return e in so && e !== "," ? "\\ldots\\," : "\\ldots";
});
z("\\cdots", function(i) {
  var e = i.future().text;
  return e in so ? "\\@cdots\\," : "\\@cdots";
});
z("\\dotsb", "\\cdots");
z("\\dotsm", "\\cdots");
z("\\dotsi", "\\!\\cdots");
z("\\dotsx", "\\ldots\\,");
z("\\DOTSI", "\\relax");
z("\\DOTSB", "\\relax");
z("\\DOTSX", "\\relax");
z("\\tmspace", "\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");
z("\\,", "\\tmspace+{3mu}{.1667em}");
z("\\thinspace", "\\,");
z("\\>", "\\mskip{4mu}");
z("\\:", "\\tmspace+{4mu}{.2222em}");
z("\\medspace", "\\:");
z("\\;", "\\tmspace+{5mu}{.2777em}");
z("\\thickspace", "\\;");
z("\\!", "\\tmspace-{3mu}{.1667em}");
z("\\negthinspace", "\\!");
z("\\negmedspace", "\\tmspace-{4mu}{.2222em}");
z("\\negthickspace", "\\tmspace-{5mu}{.277em}");
z("\\enspace", "\\kern.5em ");
z("\\enskip", "\\hskip.5em\\relax");
z("\\quad", "\\hskip1em\\relax");
z("\\qquad", "\\hskip2em\\relax");
z("\\tag", "\\@ifstar\\tag@literal\\tag@paren");
z("\\tag@paren", "\\tag@literal{({#1})}");
z("\\tag@literal", (i) => {
  if (i.macros.get("\\df@tag"))
    throw new Re("Multiple \\tag");
  return "\\gdef\\df@tag{\\text{#1}}";
});
z("\\bmod", "\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");
z("\\pod", "\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");
z("\\pmod", "\\pod{{\\rm mod}\\mkern6mu#1}");
z("\\mod", "\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");
z("\\newline", "\\\\\\relax");
z("\\TeX", "\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");
var Su = Se(On["Main-Regular"][84][1] - 0.7 * On["Main-Regular"][65][1]);
z("\\LaTeX", "\\textrm{\\html@mathml{" + ("L\\kern-.36em\\raisebox{" + Su + "}{\\scriptstyle A}") + "\\kern-.15em\\TeX}{LaTeX}}");
z("\\KaTeX", "\\textrm{\\html@mathml{" + ("K\\kern-.17em\\raisebox{" + Su + "}{\\scriptstyle A}") + "\\kern-.15em\\TeX}{KaTeX}}");
z("\\hspace", "\\@ifstar\\@hspacer\\@hspace");
z("\\@hspace", "\\hskip #1\\relax");
z("\\@hspacer", "\\rule{0pt}{0pt}\\hskip #1\\relax");
z("\\ordinarycolon", ":");
z("\\vcentcolon", "\\mathrel{\\mathop\\ordinarycolon}");
z("\\dblcolon", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');
z("\\coloneqq", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');
z("\\Coloneqq", '\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');
z("\\coloneq", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');
z("\\Coloneq", '\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');
z("\\eqqcolon", '\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');
z("\\Eqqcolon", '\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');
z("\\eqcolon", '\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');
z("\\Eqcolon", '\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');
z("\\colonapprox", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');
z("\\Colonapprox", '\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');
z("\\colonsim", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');
z("\\Colonsim", '\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');
z("∷", "\\dblcolon");
z("∹", "\\eqcolon");
z("≔", "\\coloneqq");
z("≕", "\\eqqcolon");
z("⩴", "\\Coloneqq");
z("\\ratio", "\\vcentcolon");
z("\\coloncolon", "\\dblcolon");
z("\\colonequals", "\\coloneqq");
z("\\coloncolonequals", "\\Coloneqq");
z("\\equalscolon", "\\eqqcolon");
z("\\equalscoloncolon", "\\Eqqcolon");
z("\\colonminus", "\\coloneq");
z("\\coloncolonminus", "\\Coloneq");
z("\\minuscolon", "\\eqcolon");
z("\\minuscoloncolon", "\\Eqcolon");
z("\\coloncolonapprox", "\\Colonapprox");
z("\\coloncolonsim", "\\Colonsim");
z("\\simcolon", "\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");
z("\\simcoloncolon", "\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");
z("\\approxcolon", "\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");
z("\\approxcoloncolon", "\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");
z("\\notni", "\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");
z("\\limsup", "\\DOTSB\\operatorname*{lim\\,sup}");
z("\\liminf", "\\DOTSB\\operatorname*{lim\\,inf}");
z("\\injlim", "\\DOTSB\\operatorname*{inj\\,lim}");
z("\\projlim", "\\DOTSB\\operatorname*{proj\\,lim}");
z("\\varlimsup", "\\DOTSB\\operatorname*{\\overline{lim}}");
z("\\varliminf", "\\DOTSB\\operatorname*{\\underline{lim}}");
z("\\varinjlim", "\\DOTSB\\operatorname*{\\underrightarrow{lim}}");
z("\\varprojlim", "\\DOTSB\\operatorname*{\\underleftarrow{lim}}");
z("\\gvertneqq", "\\html@mathml{\\@gvertneqq}{≩}");
z("\\lvertneqq", "\\html@mathml{\\@lvertneqq}{≨}");
z("\\ngeqq", "\\html@mathml{\\@ngeqq}{≱}");
z("\\ngeqslant", "\\html@mathml{\\@ngeqslant}{≱}");
z("\\nleqq", "\\html@mathml{\\@nleqq}{≰}");
z("\\nleqslant", "\\html@mathml{\\@nleqslant}{≰}");
z("\\nshortmid", "\\html@mathml{\\@nshortmid}{∤}");
z("\\nshortparallel", "\\html@mathml{\\@nshortparallel}{∦}");
z("\\nsubseteqq", "\\html@mathml{\\@nsubseteqq}{⊈}");
z("\\nsupseteqq", "\\html@mathml{\\@nsupseteqq}{⊉}");
z("\\varsubsetneq", "\\html@mathml{\\@varsubsetneq}{⊊}");
z("\\varsubsetneqq", "\\html@mathml{\\@varsubsetneqq}{⫋}");
z("\\varsupsetneq", "\\html@mathml{\\@varsupsetneq}{⊋}");
z("\\varsupsetneqq", "\\html@mathml{\\@varsupsetneqq}{⫌}");
z("\\imath", "\\html@mathml{\\@imath}{ı}");
z("\\jmath", "\\html@mathml{\\@jmath}{ȷ}");
z("\\llbracket", "\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");
z("\\rrbracket", "\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");
z("⟦", "\\llbracket");
z("⟧", "\\rrbracket");
z("\\lBrace", "\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");
z("\\rBrace", "\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");
z("⦃", "\\lBrace");
z("⦄", "\\rBrace");
z("\\minuso", "\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");
z("⦵", "\\minuso");
z("\\darr", "\\downarrow");
z("\\dArr", "\\Downarrow");
z("\\Darr", "\\Downarrow");
z("\\lang", "\\langle");
z("\\rang", "\\rangle");
z("\\uarr", "\\uparrow");
z("\\uArr", "\\Uparrow");
z("\\Uarr", "\\Uparrow");
z("\\N", "\\mathbb{N}");
z("\\R", "\\mathbb{R}");
z("\\Z", "\\mathbb{Z}");
z("\\alef", "\\aleph");
z("\\alefsym", "\\aleph");
z("\\Alpha", "\\mathrm{A}");
z("\\Beta", "\\mathrm{B}");
z("\\bull", "\\bullet");
z("\\Chi", "\\mathrm{X}");
z("\\clubs", "\\clubsuit");
z("\\cnums", "\\mathbb{C}");
z("\\Complex", "\\mathbb{C}");
z("\\Dagger", "\\ddagger");
z("\\diamonds", "\\diamondsuit");
z("\\empty", "\\emptyset");
z("\\Epsilon", "\\mathrm{E}");
z("\\Eta", "\\mathrm{H}");
z("\\exist", "\\exists");
z("\\harr", "\\leftrightarrow");
z("\\hArr", "\\Leftrightarrow");
z("\\Harr", "\\Leftrightarrow");
z("\\hearts", "\\heartsuit");
z("\\image", "\\Im");
z("\\infin", "\\infty");
z("\\Iota", "\\mathrm{I}");
z("\\isin", "\\in");
z("\\Kappa", "\\mathrm{K}");
z("\\larr", "\\leftarrow");
z("\\lArr", "\\Leftarrow");
z("\\Larr", "\\Leftarrow");
z("\\lrarr", "\\leftrightarrow");
z("\\lrArr", "\\Leftrightarrow");
z("\\Lrarr", "\\Leftrightarrow");
z("\\Mu", "\\mathrm{M}");
z("\\natnums", "\\mathbb{N}");
z("\\Nu", "\\mathrm{N}");
z("\\Omicron", "\\mathrm{O}");
z("\\plusmn", "\\pm");
z("\\rarr", "\\rightarrow");
z("\\rArr", "\\Rightarrow");
z("\\Rarr", "\\Rightarrow");
z("\\real", "\\Re");
z("\\reals", "\\mathbb{R}");
z("\\Reals", "\\mathbb{R}");
z("\\Rho", "\\mathrm{P}");
z("\\sdot", "\\cdot");
z("\\sect", "\\S");
z("\\spades", "\\spadesuit");
z("\\sub", "\\subset");
z("\\sube", "\\subseteq");
z("\\supe", "\\supseteq");
z("\\Tau", "\\mathrm{T}");
z("\\thetasym", "\\vartheta");
z("\\weierp", "\\wp");
z("\\Zeta", "\\mathrm{Z}");
z("\\argmin", "\\DOTSB\\operatorname*{arg\\,min}");
z("\\argmax", "\\DOTSB\\operatorname*{arg\\,max}");
z("\\plim", "\\DOTSB\\mathop{\\operatorname{plim}}\\limits");
z("\\bra", "\\mathinner{\\langle{#1}|}");
z("\\ket", "\\mathinner{|{#1}\\rangle}");
z("\\braket", "\\mathinner{\\langle{#1}\\rangle}");
z("\\Bra", "\\left\\langle#1\\right|");
z("\\Ket", "\\left|#1\\right\\rangle");
var xu = (i) => (e) => {
  var t = e.consumeArg().tokens, n = e.consumeArg().tokens, r = e.consumeArg().tokens, s = e.consumeArg().tokens, u = e.macros.get("|"), l = e.macros.get("\\|");
  e.macros.beginGroup();
  var o = (c) => (f) => {
    i && (f.macros.set("|", u), r.length && f.macros.set("\\|", l));
    var g = c;
    if (!c && r.length) {
      var A = f.future();
      A.text === "|" && (f.popToken(), g = !0);
    }
    return {
      tokens: g ? r : n,
      numArgs: 0
    };
  };
  e.macros.set("|", o(!1)), r.length && e.macros.set("\\|", o(!0));
  var h = e.consumeArg().tokens, d = e.expandTokens([
    ...s,
    ...h,
    ...t
    // reversed
  ]);
  return e.macros.endGroup(), {
    tokens: d.reverse(),
    numArgs: 0
  };
};
z("\\bra@ket", xu(!1));
z("\\bra@set", xu(!0));
z("\\Braket", "\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");
z("\\Set", "\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");
z("\\set", "\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");
z("\\angln", "{\\angl n}");
z("\\blue", "\\textcolor{##6495ed}{#1}");
z("\\orange", "\\textcolor{##ffa500}{#1}");
z("\\pink", "\\textcolor{##ff00af}{#1}");
z("\\red", "\\textcolor{##df0030}{#1}");
z("\\green", "\\textcolor{##28ae7b}{#1}");
z("\\gray", "\\textcolor{gray}{#1}");
z("\\purple", "\\textcolor{##9d38bd}{#1}");
z("\\blueA", "\\textcolor{##ccfaff}{#1}");
z("\\blueB", "\\textcolor{##80f6ff}{#1}");
z("\\blueC", "\\textcolor{##63d9ea}{#1}");
z("\\blueD", "\\textcolor{##11accd}{#1}");
z("\\blueE", "\\textcolor{##0c7f99}{#1}");
z("\\tealA", "\\textcolor{##94fff5}{#1}");
z("\\tealB", "\\textcolor{##26edd5}{#1}");
z("\\tealC", "\\textcolor{##01d1c1}{#1}");
z("\\tealD", "\\textcolor{##01a995}{#1}");
z("\\tealE", "\\textcolor{##208170}{#1}");
z("\\greenA", "\\textcolor{##b6ffb0}{#1}");
z("\\greenB", "\\textcolor{##8af281}{#1}");
z("\\greenC", "\\textcolor{##74cf70}{#1}");
z("\\greenD", "\\textcolor{##1fab54}{#1}");
z("\\greenE", "\\textcolor{##0d923f}{#1}");
z("\\goldA", "\\textcolor{##ffd0a9}{#1}");
z("\\goldB", "\\textcolor{##ffbb71}{#1}");
z("\\goldC", "\\textcolor{##ff9c39}{#1}");
z("\\goldD", "\\textcolor{##e07d10}{#1}");
z("\\goldE", "\\textcolor{##a75a05}{#1}");
z("\\redA", "\\textcolor{##fca9a9}{#1}");
z("\\redB", "\\textcolor{##ff8482}{#1}");
z("\\redC", "\\textcolor{##f9685d}{#1}");
z("\\redD", "\\textcolor{##e84d39}{#1}");
z("\\redE", "\\textcolor{##bc2612}{#1}");
z("\\maroonA", "\\textcolor{##ffbde0}{#1}");
z("\\maroonB", "\\textcolor{##ff92c6}{#1}");
z("\\maroonC", "\\textcolor{##ed5fa6}{#1}");
z("\\maroonD", "\\textcolor{##ca337c}{#1}");
z("\\maroonE", "\\textcolor{##9e034e}{#1}");
z("\\purpleA", "\\textcolor{##ddd7ff}{#1}");
z("\\purpleB", "\\textcolor{##c6b9fc}{#1}");
z("\\purpleC", "\\textcolor{##aa87ff}{#1}");
z("\\purpleD", "\\textcolor{##7854ab}{#1}");
z("\\purpleE", "\\textcolor{##543b78}{#1}");
z("\\mintA", "\\textcolor{##f5f9e8}{#1}");
z("\\mintB", "\\textcolor{##edf2df}{#1}");
z("\\mintC", "\\textcolor{##e0e5cc}{#1}");
z("\\grayA", "\\textcolor{##f6f7f7}{#1}");
z("\\grayB", "\\textcolor{##f0f1f2}{#1}");
z("\\grayC", "\\textcolor{##e3e5e6}{#1}");
z("\\grayD", "\\textcolor{##d6d8da}{#1}");
z("\\grayE", "\\textcolor{##babec2}{#1}");
z("\\grayF", "\\textcolor{##888d93}{#1}");
z("\\grayG", "\\textcolor{##626569}{#1}");
z("\\grayH", "\\textcolor{##3b3e40}{#1}");
z("\\grayI", "\\textcolor{##21242c}{#1}");
z("\\kaBlue", "\\textcolor{##314453}{#1}");
z("\\kaGreen", "\\textcolor{##71B307}{#1}");
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.");
function ao() {
  return {
    async: !1,
    breaks: !1,
    extensions: null,
    gfm: !0,
    hooks: null,
    pedantic: !1,
    renderer: null,
    silent: !1,
    tokenizer: null,
    walkTokens: null
  };
}
let Li = ao();
function Eu(i) {
  Li = i;
}
const _u = /[&<>"']/, Ef = new RegExp(_u.source, "g"), Tu = /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, _f = new RegExp(Tu.source, "g"), Tf = {
  "&": "&amp;",
  "<": "&lt;",
  ">": "&gt;",
  '"': "&quot;",
  "'": "&#39;"
}, bl = (i) => Tf[i];
function Ht(i, e) {
  if (e) {
    if (_u.test(i))
      return i.replace(Ef, bl);
  } else if (Tu.test(i))
    return i.replace(_f, bl);
  return i;
}
const Cf = /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;
function Df(i) {
  return i.replace(Cf, (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 Ff = /(^|[^\[])\^/g;
function We(i, e) {
  let t = typeof i == "string" ? i : i.source;
  e = e || "";
  const n = {
    replace: (r, s) => {
      let u = typeof s == "string" ? s : s.source;
      return u = u.replace(Ff, "$1"), t = t.replace(r, u), n;
    },
    getRegex: () => new RegExp(t, e)
  };
  return n;
}
function vl(i) {
  try {
    i = encodeURI(i).replace(/%25/g, "%");
  } catch {
    return null;
  }
  return i;
}
const mr = { exec: () => null };
function yl(i, e) {
  const t = i.replace(/\|/g, (s, u, l) => {
    let o = !1, h = u;
    for (; --h >= 0 && l[h] === "\\"; )
      o = !o;
    return o ? "|" : " |";
  }), n = t.split(/ \|/);
  let r = 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 (; r < n.length; r++)
    n[r] = n[r].trim().replace(/\\\|/g, "|");
  return n;
}
function Or(i, e, t) {
  const n = i.length;
  if (n === 0)
    return "";
  let r = 0;
  for (; r < n; ) {
    const s = i.charAt(n - r - 1);
    if (s === e && !t)
      r++;
    else if (s !== e && t)
      r++;
    else
      break;
  }
  return i.slice(0, n - r);
}
function Mf(i, e) {
  if (i.indexOf(e[1]) === -1)
    return -1;
  let t = 0;
  for (let n = 0; n < i.length; n++)
    if (i[n] === "\\")
      n++;
    else if (i[n] === e[0])
      t++;
    else if (i[n] === e[1] && (t--, t < 0))
      return n;
  return -1;
}
function wl(i, e, t, n) {
  const r = e.href, s = e.title ? Ht(e.title) : null, u = i[1].replace(/\\([\[\]])/g, "$1");
  if (i[0].charAt(0) !== "!") {
    n.state.inLink = !0;
    const l = {
      type: "link",
      raw: t,
      href: r,
      title: s,
      text: u,
      tokens: n.inlineTokens(u)
    };
    return n.state.inLink = !1, l;
  }
  return {
    type: "image",
    raw: t,
    href: r,
    title: s,
    text: Ht(u)
  };
}
function Rf(i, e) {
  const t = i.match(/^(\s+)(?:```)/);
  if (t === null)
    return e;
  const n = t[1];
  return e.split(`
`).map((r) => {
    const s = r.match(/^\s+/);
    if (s === null)
      return r;
    const [u] = s;
    return u.length >= n.length ? r.slice(n.length) : r;
  }).join(`
`);
}
class as {
  options;
  rules;
  // set by the lexer
  lexer;
  // set by the lexer
  constructor(e) {
    this.options = e || Li;
  }
  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 : Or(n, `
`)
      };
    }
  }
  fences(e) {
    const t = this.rules.block.fences.exec(e);
    if (t) {
      const n = t[0], r = Rf(n, t[3] || "");
      return {
        type: "code",
        raw: n,
        lang: t[2] ? t[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t[2],
        text: r
      };
    }
  }
  heading(e) {
    const t = this.rules.block.heading.exec(e);
    if (t) {
      let n = t[2].trim();
      if (/#$/.test(n)) {
        const r = Or(n, "#");
        (this.options.pedantic || !r || / $/.test(r)) && (n = r.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 = Or(n.replace(/^ *>[ \t]?/gm, ""), `
`);
      const r = this.lexer.state.top;
      this.lexer.state.top = !0;
      const s = this.lexer.blockTokens(n);
      return this.lexer.state.top = r, {
        type: "blockquote",
        raw: t[0],
        tokens: s,
        text: n
      };
    }
  }
  list(e) {
    let t = this.rules.block.list.exec(e);
    if (t) {
      let n = t[1].trim();
      const r = n.length > 1, s = {
        type: "list",
        raw: "",
        ordered: r,
        start: r ? +n.slice(0, -1) : "",
        loose: !1,
        items: []
      };
      n = r ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = r ? n : "[*+-]");
      const u = new RegExp(`^( {0,3}${n})((?:[	 ][^\\n]*)?(?:\\n|$))`);
      let l = "", o = "", h = !1;
      for (; e; ) {
        let d = !1;
        if (!(t = u.exec(e)) || this.rules.block.hr.test(e))
          break;
        l = t[0], e = e.substring(l.length);
        let c = t[2].split(`
`, 1)[0].replace(/^\t+/, (a) => " ".repeat(3 * a.length)), f = e.split(`
`, 1)[0], g = 0;
        this.options.pedantic ? (g = 2, o = c.trimStart()) : (g = t[2].search(/[^ ]/), g = g > 4 ? 1 : g, o = c.slice(g), g += t[1].length);
        let A = !1;
        if (!c && /^ *$/.test(f) && (l += f + `
`, e = e.substring(f.length + 1), d = !0), !d) {
          const a = new RegExp(`^ {0,${Math.min(3, g - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ 	][^\\n]*)?(?:\\n|$))`), p = new RegExp(`^ {0,${Math.min(3, g - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), b = new RegExp(`^ {0,${Math.min(3, g - 1)}}(?:\`\`\`|~~~)`), y = new RegExp(`^ {0,${Math.min(3, g - 1)}}#`);
          for (; e; ) {
            const C = e.split(`
`, 1)[0];
            if (f = C, this.options.pedantic && (f = f.replace(/^ {1,4}(?=( {4})*[^ ])/g, "  ")), b.test(f) || y.test(f) || a.test(f) || p.test(e))
              break;
            if (f.search(/[^ ]/) >= g || !f.trim())
              o += `
` + f.slice(g);
            else {
              if (A || c.search(/[^ ]/) >= 4 || b.test(c) || y.test(c) || p.test(c))
                break;
              o += `
` + f;
            }
            !A && !f.trim() && (A = !0), l += C + `
`, e = e.substring(C.length + 1), c = f.slice(g);
          }
        }
        s.loose || (h ? s.loose = !0 : /\n *\n *$/.test(l) && (h = !0));
        let m = null, k;
        this.options.gfm && (m = /^\[[ xX]\] /.exec(o), m && (k = m[0] !== "[ ] ", o = o.replace(/^\[[ xX]\] +/, ""))), s.items.push({
          type: "list_item",
          raw: l,
          task: !!m,
          checked: k,
          loose: !1,
          text: o,
          tokens: []
        }), s.raw += l;
      }
      s.items[s.items.length - 1].raw = l.trimEnd(), s.items[s.items.length - 1].text = o.trimEnd(), s.raw = s.raw.trimEnd();
      for (let d = 0; d < s.items.length; d++)
        if (this.lexer.state.top = !1, s.items[d].tokens = this.lexer.blockTokens(s.items[d].text, []), !s.loose) {
          const c = s.items[d].tokens.filter((g) => g.type === "space"), f = c.length > 0 && c.some((g) => /\n.*\n/.test(g.raw));
          s.loose = f;
        }
      if (s.loose)
        for (let d = 0; d < s.items.length; d++)
          s.items[d].loose = !0;
      return s;
    }
  }
  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, " "), r = t[2] ? t[2].replace(/^<(.*)>$/, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", s = 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: r,
        title: s
      };
    }
  }
  table(e) {
    const t = this.rules.block.table.exec(e);
    if (!t || !/[:|]/.test(t[2]))
      return;
    const n = yl(t[1]), r = t[2].replace(/^\||\| *$/g, "").split("|"), s = t[3] && t[3].trim() ? t[3].replace(/\n[ \t]*$/, "").split(`
`) : [], u = {
      type: "table",
      raw: t[0],
      header: [],
      align: [],
      rows: []
    };
    if (n.length === r.length) {
      for (const l of r)
        /^ *-+: *$/.test(l) ? u.align.push("right") : /^ *:-+: *$/.test(l) ? u.align.push("center") : /^ *:-+ *$/.test(l) ? u.align.push("left") : u.align.push(null);
      for (const l of n)
        u.header.push({
          text: l,
          tokens: this.lexer.inline(l)
        });
      for (const l of s)
        u.rows.push(yl(l, u.header.length).map((o) => ({
          text: o,
          tokens: this.lexer.inline(o)
        })));
      return u;
    }
  }
  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: Ht(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 u = Or(n.slice(0, -1), "\\");
        if ((n.length - u.length) % 2 === 0)
          return;
      } else {
        const u = Mf(t[2], "()");
        if (u > -1) {
          const o = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + u;
          t[2] = t[2].substring(0, u), t[0] = t[0].substring(0, o).trim(), t[3] = "";
        }
      }
      let r = t[2], s = "";
      if (this.options.pedantic) {
        const u = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r);
        u && (r = u[1], s = u[3]);
      } else
        s = t[3] ? t[3].slice(1, -1) : "";
      return r = r.trim(), /^</.test(r) && (this.options.pedantic && !/>$/.test(n) ? r = r.slice(1) : r = r.slice(1, -1)), wl(t, {
        href: r && r.replace(this.rules.inline.anyPunctuation, "$1"),
        title: s && s.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 r = (n[2] || n[1]).replace(/\s+/g, " "), s = t[r.toLowerCase()];
      if (!s) {
        const u = n[0].charAt(0);
        return {
          type: "text",
          raw: u,
          text: u
        };
      }
      return wl(n, s, n[0], this.lexer);
    }
  }
  emStrong(e, t, n = "") {
    let r = this.rules.inline.emStrongLDelim.exec(e);
    if (!r || r[3] && n.match(/[\p{L}\p{N}]/u))
      return;
    if (!(r[1] || r[2] || "") || !n || this.rules.inline.punctuation.exec(n)) {
      const u = [...r[0]].length - 1;
      let l, o, h = u, d = 0;
      const c = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
      for (c.lastIndex = 0, t = t.slice(-1 * e.length + u); (r = c.exec(t)) != null; ) {
        if (l = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !l)
          continue;
        if (o = [...l].length, r[3] || r[4]) {
          h += o;
          continue;
        } else if ((r[5] || r[6]) && u % 3 && !((u + o) % 3)) {
          d += o;
          continue;
        }
        if (h -= o, h > 0)
          continue;
        o = Math.min(o, o + h + d);
        const f = [...r[0]][0].length, g = e.slice(0, u + r.index + f + o);
        if (Math.min(u, o) % 2) {
          const m = g.slice(1, -1);
          return {
            type: "em",
            raw: g,
            text: m,
            tokens: this.lexer.inlineTokens(m)
          };
        }
        const A = g.slice(2, -2);
        return {
          type: "strong",
          raw: g,
          text: A,
          tokens: this.lexer.inlineTokens(A)
        };
      }
    }
  }
  codespan(e) {
    const t = this.rules.inline.code.exec(e);
    if (t) {
      let n = t[2].replace(/\n/g, " ");
      const r = /[^ ]/.test(n), s = /^ /.test(n) && / $/.test(n);
      return r && s && (n = n.substring(1, n.length - 1)), n = Ht(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, r;
      return t[2] === "@" ? (n = Ht(t[1]), r = "mailto:" + n) : (n = Ht(t[1]), r = n), {
        type: "link",
        raw: t[0],
        text: n,
        href: r,
        tokens: [
          {
            type: "text",
            raw: n,
            text: n
          }
        ]
      };
    }
  }
  url(e) {
    let t;
    if (t = this.rules.inline.url.exec(e)) {
      let n, r;
      if (t[2] === "@")
        n = Ht(t[0]), r = "mailto:" + n;
      else {
        let s;
        do
          s = t[0], t[0] = this.rules.inline._backpedal.exec(t[0])?.[0] ?? "";
        while (s !== t[0]);
        n = Ht(t[0]), t[1] === "www." ? r = "http://" + t[0] : r = t[0];
      }
      return {
        type: "link",
        raw: t[0],
        text: n,
        href: r,
        tokens: [
          {
            type: "text",
            raw: n,
            text: n
          }
        ]
      };
    }
  }
  inlineText(e) {
    const t = this.rules.inline.text.exec(e);
    if (t) {
      let n;
      return this.lexer.state.inRawBlock ? n = t[0] : n = Ht(t[0]), {
        type: "text",
        raw: t[0],
        text: n
      };
    }
  }
}
const Lf = /^(?: *(?:\n|$))+/, If = /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/, Nf = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, wr = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Pf = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, Cu = /(?:[*+-]|\d{1,9}[.)])/, Du = We(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g, Cu).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(), oo = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Bf = /^[^\n]+/, lo = /(?!\s*\])(?:\\.|[^\[\]\\])+/, zf = We(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label", lo).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Of = We(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, Cu).getRegex(), _s = "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", uo = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Hf = We("^ {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", uo).replace("tag", _s).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), Fu = We(oo).replace("hr", wr).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", _s).getRegex(), qf = We(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", Fu).getRegex(), co = {
  blockquote: qf,
  code: If,
  def: zf,
  fences: Nf,
  heading: Pf,
  hr: wr,
  html: Hf,
  lheading: Du,
  list: Of,
  newline: Lf,
  paragraph: Fu,
  table: mr,
  text: Bf
}, Al = We("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", wr).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", _s).getRegex(), Uf = {
  ...co,
  table: Al,
  paragraph: We(oo).replace("hr", wr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Al).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", _s).getRegex()
}, Vf = {
  ...co,
  html: We(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", uo).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: mr,
  // fences not supported
  lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
  paragraph: We(oo).replace("hr", wr).replace("heading", ` *#{1,6} *[^
]`).replace("lheading", Du).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
}, Mu = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Gf = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Ru = /^( {2,}|\\)\n(?!\s*$)/, Xf = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Ar = "\\p{P}\\p{S}", jf = We(/^((?![*_])[\spunctuation])/, "u").replace(/punctuation/g, Ar).getRegex(), Yf = /\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g, Wf = We(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/, "u").replace(/punct/g, Ar).getRegex(), $f = We("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])", "gu").replace(/punct/g, Ar).getRegex(), Kf = We("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])", "gu").replace(/punct/g, Ar).getRegex(), Zf = We(/\\([punct])/, "gu").replace(/punct/g, Ar).getRegex(), Qf = We(/^<(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(), Jf = We(uo).replace("(?:-->|$)", "-->").getRegex(), e1 = We("^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", Jf).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), os = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, t1 = We(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label", os).replace("href", /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), Lu = We(/^!?\[(label)\]\[(ref)\]/).replace("label", os).replace("ref", lo).getRegex(), Iu = We(/^!?\[(ref)\](?:\[\])?/).replace("ref", lo).getRegex(), n1 = We("reflink|nolink(?!\\()", "g").replace("reflink", Lu).replace("nolink", Iu).getRegex(), ho = {
  _backpedal: mr,
  // only used for GFM url
  anyPunctuation: Zf,
  autolink: Qf,
  blockSkip: Yf,
  br: Ru,
  code: Gf,
  del: mr,
  emStrongLDelim: Wf,
  emStrongRDelimAst: $f,
  emStrongRDelimUnd: Kf,
  escape: Mu,
  link: t1,
  nolink: Iu,
  punctuation: jf,
  reflink: Lu,
  reflinkSearch: n1,
  tag: e1,
  text: Xf,
  url: mr
}, i1 = {
  ...ho,
  link: We(/^!?\[(label)\]\((.*?)\)/).replace("label", os).getRegex(),
  reflink: We(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", os).getRegex()
}, Ta = {
  ...ho,
  escape: We(Mu).replace("])", "~|])").getRegex(),
  url: We(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/
}, r1 = {
  ...Ta,
  br: We(Ru).replace("{2,}", "*").getRegex(),
  text: We(Ta.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
}, Hr = {
  normal: co,
  gfm: Uf,
  pedantic: Vf
}, ir = {
  normal: ho,
  gfm: Ta,
  breaks: r1,
  pedantic: i1
};
class Sn {
  tokens;
  options;
  state;
  tokenizer;
  inlineQueue;
  constructor(e) {
    this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || Li, this.options.tokenizer = this.options.tokenizer || new as(), 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: Hr.normal,
      inline: ir.normal
    };
    this.options.pedantic ? (t.block = Hr.pedantic, t.inline = ir.pedantic) : this.options.gfm && (t.block = Hr.gfm, this.options.breaks ? t.inline = ir.breaks : t.inline = ir.gfm), this.tokenizer.rules = t;
  }
  /**
   * Expose Rules
   */
  static get rules() {
    return {
      block: Hr,
      inline: ir
    };
  }
  /**
   * Static Lex Method
   */
  static lex(e, t) {
    return new Sn(t).lex(e);
  }
  /**
   * Static Lex Inline Method
   */
  static lexInline(e, t) {
    return new Sn(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, h) => o + "    ".repeat(h.length));
    let n, r, s, u;
    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), r = t[t.length - 1], r && (r.type === "paragraph" || r.type === "text") ? (r.raw += `
` + n.raw, r.text += `
` + n.text, this.inlineQueue[this.inlineQueue.length - 1].src = r.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), r = t[t.length - 1], r && (r.type === "paragraph" || r.type === "text") ? (r.raw += `
` + n.raw, r.text += `
` + n.raw, this.inlineQueue[this.inlineQueue.length - 1].src = r.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 (s = e, this.options.extensions && this.options.extensions.startBlock) {
          let l = 1 / 0;
          const o = e.slice(1);
          let h;
          this.options.extensions.startBlock.forEach((d) => {
            h = d.call({ lexer: this }, o), typeof h == "number" && h >= 0 && (l = Math.min(l, h));
          }), l < 1 / 0 && l >= 0 && (s = e.substring(0, l + 1));
        }
        if (this.state.top && (n = this.tokenizer.paragraph(s))) {
          r = t[t.length - 1], u && r.type === "paragraph" ? (r.raw += `
` + n.raw, r.text += `
` + n.text, this.inlineQueue.pop(), this.inlineQueue[this.inlineQueue.length - 1].src = r.text) : t.push(n), u = s.length !== e.length, e = e.substring(n.raw.length);
          continue;
        }
        if (n = this.tokenizer.text(e)) {
          e = e.substring(n.raw.length), r = t[t.length - 1], r && r.type === "text" ? (r.raw += `
` + n.raw, r.text += `
` + n.text, this.inlineQueue.pop(), this.inlineQueue[this.inlineQueue.length - 1].src = r.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, r, s, u = e, l, o, h;
    if (this.tokens.links) {
      const d = Object.keys(this.tokens.links);
      if (d.length > 0)
        for (; (l = this.tokenizer.rules.inline.reflinkSearch.exec(u)) != null; )
          d.includes(l[0].slice(l[0].lastIndexOf("[") + 1, -1)) && (u = u.slice(0, l.index) + "[" + "a".repeat(l[0].length - 2) + "]" + u.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
    }
    for (; (l = this.tokenizer.rules.inline.blockSkip.exec(u)) != null; )
      u = u.slice(0, l.index) + "[" + "a".repeat(l[0].length - 2) + "]" + u.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
    for (; (l = this.tokenizer.rules.inline.anyPunctuation.exec(u)) != null; )
      u = u.slice(0, l.index) + "++" + u.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
    for (; e; )
      if (o || (h = ""), o = !1, !(this.options.extensions && this.options.extensions.inline && this.options.extensions.inline.some((d) => (n = d.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), r = t[t.length - 1], r && n.type === "text" && r.type === "text" ? (r.raw += n.raw, r.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), r = t[t.length - 1], r && n.type === "text" && r.type === "text" ? (r.raw += n.raw, r.text += n.text) : t.push(n);
          continue;
        }
        if (n = this.tokenizer.emStrong(e, u, h)) {
          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 (s = e, this.options.extensions && this.options.extensions.startInline) {
          let d = 1 / 0;
          const c = e.slice(1);
          let f;
          this.options.extensions.startInline.forEach((g) => {
            f = g.call({ lexer: this }, c), typeof f == "number" && f >= 0 && (d = Math.min(d, f));
          }), d < 1 / 0 && d >= 0 && (s = e.substring(0, d + 1));
        }
        if (n = this.tokenizer.inlineText(s)) {
          e = e.substring(n.raw.length), n.raw.slice(-1) !== "_" && (h = n.raw.slice(-1)), o = !0, r = t[t.length - 1], r && r.type === "text" ? (r.raw += n.raw, r.text += n.text) : t.push(n);
          continue;
        }
        if (e) {
          const d = "Infinite loop on byte: " + e.charCodeAt(0);
          if (this.options.silent) {
            console.error(d);
            break;
          } else
            throw new Error(d);
        }
      }
    return t;
  }
}
class ls {
  options;
  constructor(e) {
    this.options = e || Li;
  }
  code(e, t, n) {
    const r = (t || "").match(/^\S*/)?.[0];
    return e = e.replace(/\n$/, "") + `
`, r ? '<pre><code class="language-' + Ht(r) + '">' + (n ? e : Ht(e, !0)) + `</code></pre>
` : "<pre><code>" + (n ? e : Ht(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 r = t ? "ol" : "ul", s = t && n !== 1 ? ' start="' + n + '"' : "";
    return "<" + r + s + `>
` + e + "</" + r + `>
`;
  }
  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 r = vl(e);
    if (r === null)
      return n;
    e = r;
    let s = '<a href="' + e + '"';
    return t && (s += ' title="' + t + '"'), s += ">" + n + "</a>", s;
  }
  image(e, t, n) {
    const r = vl(e);
    if (r === null)
      return n;
    e = r;
    let s = `<img src="${e}" alt="${n}"`;
    return t && (s += ` title="${t}"`), s += ">", s;
  }
  text(e) {
    return e;
  }
}
class fo {
  // 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 xn {
  options;
  renderer;
  textRenderer;
  constructor(e) {
    this.options = e || Li, this.options.renderer = this.options.renderer || new ls(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.textRenderer = new fo();
  }
  /**
   * Static Parse Method
   */
  static parse(e, t) {
    return new xn(t).parse(e);
  }
  /**
   * Static Parse Inline Method
   */
  static parseInline(e, t) {
    return new xn(t).parseInline(e);
  }
  /**
   * Parse Loop
   */
  parse(e, t = !0) {
    let n = "";
    for (let r = 0; r < e.length; r++) {
      const s = e[r];
      if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[s.type]) {
        const u = s, l = this.options.extensions.renderers[u.type].call({ parser: this }, u);
        if (l !== !1 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "paragraph", "text"].includes(u.type)) {
          n += l || "";
          continue;
        }
      }
      switch (s.type) {
        case "space":
          continue;
        case "hr": {
          n += this.renderer.hr();
          continue;
        }
        case "heading": {
          const u = s;
          n += this.renderer.heading(this.parseInline(u.tokens), u.depth, Df(this.parseInline(u.tokens, this.textRenderer)));
          continue;
        }
        case "code": {
          const u = s;
          n += this.renderer.code(u.text, u.lang, !!u.escaped);
          continue;
        }
        case "table": {
          const u = s;
          let l = "", o = "";
          for (let d = 0; d < u.header.length; d++)
            o += this.renderer.tablecell(this.parseInline(u.header[d].tokens), { header: !0, align: u.align[d] });
          l += this.renderer.tablerow(o);
          let h = "";
          for (let d = 0; d < u.rows.length; d++) {
            const c = u.rows[d];
            o = "";
            for (let f = 0; f < c.length; f++)
              o += this.renderer.tablecell(this.parseInline(c[f].tokens), { header: !1, align: u.align[f] });
            h += this.renderer.tablerow(o);
          }
          n += this.renderer.table(l, h);
          continue;
        }
        case "blockquote": {
          const u = s, l = this.parse(u.tokens);
          n += this.renderer.blockquote(l);
          continue;
        }
        case "list": {
          const u = s, l = u.ordered, o = u.start, h = u.loose;
          let d = "";
          for (let c = 0; c < u.items.length; c++) {
            const f = u.items[c], g = f.checked, A = f.task;
            let m = "";
            if (f.task) {
              const k = this.renderer.checkbox(!!g);
              h ? f.tokens.length > 0 && f.tokens[0].type === "paragraph" ? (f.tokens[0].text = k + " " + f.tokens[0].text, f.tokens[0].tokens && f.tokens[0].tokens.length > 0 && f.tokens[0].tokens[0].type === "text" && (f.tokens[0].tokens[0].text = k + " " + f.tokens[0].tokens[0].text)) : f.tokens.unshift({
                type: "text",
                text: k + " "
              }) : m += k + " ";
            }
            m += this.parse(f.tokens, h), d += this.renderer.listitem(m, A, !!g);
          }
          n += this.renderer.list(d, l, o);
          continue;
        }
        case "html": {
          const u = s;
          n += this.renderer.html(u.text, u.block);
          continue;
        }
        case "paragraph": {
          const u = s;
          n += this.renderer.paragraph(this.parseInline(u.tokens));
          continue;
        }
        case "text": {
          let u = s, l = u.tokens ? this.parseInline(u.tokens) : u.text;
          for (; r + 1 < e.length && e[r + 1].type === "text"; )
            u = e[++r], l += `
` + (u.tokens ? this.parseInline(u.tokens) : u.text);
          n += t ? this.renderer.paragraph(l) : l;
          continue;
        }
        default: {
          const u = 'Token with "' + s.type + '" type was not found.';
          if (this.options.silent)
            return console.error(u), "";
          throw new Error(u);
        }
      }
    }
    return n;
  }
  /**
   * Parse Inline Tokens
   */
  parseInline(e, t) {
    t = t || this.renderer;
    let n = "";
    for (let r = 0; r < e.length; r++) {
      const s = e[r];
      if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[s.type]) {
        const u = this.options.extensions.renderers[s.type].call({ parser: this }, s);
        if (u !== !1 || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(s.type)) {
          n += u || "";
          continue;
        }
      }
      switch (s.type) {
        case "escape": {
          const u = s;
          n += t.text(u.text);
          break;
        }
        case "html": {
          const u = s;
          n += t.html(u.text);
          break;
        }
        case "link": {
          const u = s;
          n += t.link(u.href, u.title, this.parseInline(u.tokens, t));
          break;
        }
        case "image": {
          const u = s;
          n += t.image(u.href, u.title, u.text);
          break;
        }
        case "strong": {
          const u = s;
          n += t.strong(this.parseInline(u.tokens, t));
          break;
        }
        case "em": {
          const u = s;
          n += t.em(this.parseInline(u.tokens, t));
          break;
        }
        case "codespan": {
          const u = s;
          n += t.codespan(u.text);
          break;
        }
        case "br": {
          n += t.br();
          break;
        }
        case "del": {
          const u = s;
          n += t.del(this.parseInline(u.tokens, t));
          break;
        }
        case "text": {
          const u = s;
          n += t.text(u.text);
          break;
        }
        default: {
          const u = 'Token with "' + s.type + '" type was not found.';
          if (this.options.silent)
            return console.error(u), "";
          throw new Error(u);
        }
      }
    }
    return n;
  }
}
class Qr {
  options;
  constructor(e) {
    this.options = e || Li;
  }
  static passThroughHooks = /* @__PURE__ */ new Set([
    "preprocess",
    "postprocess",
    "processAllTokens"
  ]);
  /**
   * 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;
  }
}
class s1 {
  defaults = ao();
  options = this.setOptions;
  parse = this.#e(Sn.lex, xn.parse);
  parseInline = this.#e(Sn.lexInline, xn.parseInline);
  Parser = xn;
  Renderer = ls;
  TextRenderer = fo;
  Lexer = Sn;
  Tokenizer = as;
  Hooks = Qr;
  constructor(...e) {
    this.use(...e);
  }
  /**
   * Run callback for every token
   */
  walkTokens(e, t) {
    let n = [];
    for (const r of e)
      switch (n = n.concat(t.call(this, r)), r.type) {
        case "table": {
          const s = r;
          for (const u of s.header)
            n = n.concat(this.walkTokens(u.tokens, t));
          for (const u of s.rows)
            for (const l of u)
              n = n.concat(this.walkTokens(l.tokens, t));
          break;
        }
        case "list": {
          const s = r;
          n = n.concat(this.walkTokens(s.items, t));
          break;
        }
        default: {
          const s = r;
          this.defaults.extensions?.childTokens?.[s.type] ? this.defaults.extensions.childTokens[s.type].forEach((u) => {
            const l = s[u].flat(1 / 0);
            n = n.concat(this.walkTokens(l, t));
          }) : s.tokens && (n = n.concat(this.walkTokens(s.tokens, t)));
        }
      }
    return n;
  }
  use(...e) {
    const t = this.defaults.extensions || { renderers: {}, childTokens: {} };
    return e.forEach((n) => {
      const r = { ...n };
      if (r.async = this.defaults.async || r.async || !1, n.extensions && (n.extensions.forEach((s) => {
        if (!s.name)
          throw new Error("extension name required");
        if ("renderer" in s) {
          const u = t.renderers[s.name];
          u ? t.renderers[s.name] = function(...l) {
            let o = s.renderer.apply(this, l);
            return o === !1 && (o = u.apply(this, l)), o;
          } : t.renderers[s.name] = s.renderer;
        }
        if ("tokenizer" in s) {
          if (!s.level || s.level !== "block" && s.level !== "inline")
            throw new Error("extension level must be 'block' or 'inline'");
          const u = t[s.level];
          u ? u.unshift(s.tokenizer) : t[s.level] = [s.tokenizer], s.start && (s.level === "block" ? t.startBlock ? t.startBlock.push(s.start) : t.startBlock = [s.start] : s.level === "inline" && (t.startInline ? t.startInline.push(s.start) : t.startInline = [s.start]));
        }
        "childTokens" in s && s.childTokens && (t.childTokens[s.name] = s.childTokens);
      }), r.extensions = t), n.renderer) {
        const s = this.defaults.renderer || new ls(this.defaults);
        for (const u in n.renderer) {
          if (!(u in s))
            throw new Error(`renderer '${u}' does not exist`);
          if (u === "options")
            continue;
          const l = u, o = n.renderer[l], h = s[l];
          s[l] = (...d) => {
            let c = o.apply(s, d);
            return c === !1 && (c = h.apply(s, d)), c || "";
          };
        }
        r.renderer = s;
      }
      if (n.tokenizer) {
        const s = this.defaults.tokenizer || new as(this.defaults);
        for (const u in n.tokenizer) {
          if (!(u in s))
            throw new Error(`tokenizer '${u}' does not exist`);
          if (["options", "rules", "lexer"].includes(u))
            continue;
          const l = u, o = n.tokenizer[l], h = s[l];
          s[l] = (...d) => {
            let c = o.apply(s, d);
            return c === !1 && (c = h.apply(s, d)), c;
          };
        }
        r.tokenizer = s;
      }
      if (n.hooks) {
        const s = this.defaults.hooks || new Qr();
        for (const u in n.hooks) {
          if (!(u in s))
            throw new Error(`hook '${u}' does not exist`);
          if (u === "options")
            continue;
          const l = u, o = n.hooks[l], h = s[l];
          Qr.passThroughHooks.has(u) ? s[l] = (d) => {
            if (this.defaults.async)
              return Promise.resolve(o.call(s, d)).then((f) => h.call(s, f));
            const c = o.call(s, d);
            return h.call(s, c);
          } : s[l] = (...d) => {
            let c = o.apply(s, d);
            return c === !1 && (c = h.apply(s, d)), c;
          };
        }
        r.hooks = s;
      }
      if (n.walkTokens) {
        const s = this.defaults.walkTokens, u = n.walkTokens;
        r.walkTokens = function(l) {
          let o = [];
          return o.push(u.call(this, l)), s && (o = o.concat(s.call(this, l))), o;
        };
      }
      this.defaults = { ...this.defaults, ...r };
    }), this;
  }
  setOptions(e) {
    return this.defaults = { ...this.defaults, ...e }, this;
  }
  lexer(e, t) {
    return Sn.lex(e, t ?? this.defaults);
  }
  parser(e, t) {
    return xn.parse(e, t ?? this.defaults);
  }
  #e(e, t) {
    return (n, r) => {
      const s = { ...r }, u = { ...this.defaults, ...s };
      this.defaults.async === !0 && s.async === !1 && (u.silent || console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."), u.async = !0);
      const l = this.#t(!!u.silent, !!u.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 (u.hooks && (u.hooks.options = u), u.async)
        return Promise.resolve(u.hooks ? u.hooks.preprocess(n) : n).then((o) => e(o, u)).then((o) => u.hooks ? u.hooks.processAllTokens(o) : o).then((o) => u.walkTokens ? Promise.all(this.walkTokens(o, u.walkTokens)).then(() => o) : o).then((o) => t(o, u)).then((o) => u.hooks ? u.hooks.postprocess(o) : o).catch(l);
      try {
        u.hooks && (n = u.hooks.preprocess(n));
        let o = e(n, u);
        u.hooks && (o = u.hooks.processAllTokens(o)), u.walkTokens && this.walkTokens(o, u.walkTokens);
        let h = t(o, u);
        return u.hooks && (h = u.hooks.postprocess(h)), h;
      } catch (o) {
        return l(o);
      }
    };
  }
  #t(e, t) {
    return (n) => {
      if (n.message += `
Please report this to https://github.com/markedjs/marked.`, e) {
        const r = "<p>An error occurred:</p><pre>" + Ht(n.message + "", !0) + "</pre>";
        return t ? Promise.resolve(r) : r;
      }
      if (t)
        return Promise.reject(n);
      throw n;
    };
  }
}
const Ti = new s1();
function Ye(i, e) {
  return Ti.parse(i, e);
}
Ye.options = Ye.setOptions = function(i) {
  return Ti.setOptions(i), Ye.defaults = Ti.defaults, Eu(Ye.defaults), Ye;
};
Ye.getDefaults = ao;
Ye.defaults = Li;
Ye.use = function(...i) {
  return Ti.use(...i), Ye.defaults = Ti.defaults, Eu(Ye.defaults), Ye;
};
Ye.walkTokens = function(i, e) {
  return Ti.walkTokens(i, e);
};
Ye.parseInline = Ti.parseInline;
Ye.Parser = xn;
Ye.parser = xn.parse;
Ye.Renderer = ls;
Ye.TextRenderer = fo;
Ye.Lexer = Sn;
Ye.lexer = Sn.lex;
Ye.Tokenizer = as;
Ye.Hooks = Qr;
Ye.parse = Ye;
Ye.options;
Ye.setOptions;
Ye.use;
Ye.walkTokens;
Ye.parseInline;
xn.parse;
Sn.lex;
const a1 = /[\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, o1 = Object.hasOwnProperty;
class Nu {
  /**
   * 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 r = l1(e, t === !0);
    const s = r;
    for (; o1.call(n.occurrences, r); )
      n.occurrences[s]++, r = s + "-" + n.occurrences[s];
    return n.occurrences[r] = 0, r;
  }
  /**
   * Reset - Forget all previous slugs
   *
   * @return void
   */
  reset() {
    this.occurrences = /* @__PURE__ */ Object.create(null);
  }
}
function l1(i, e) {
  return typeof i != "string" ? "" : (e || (i = i.toLowerCase()), i.replace(a1, "").replace(/ /g, "-"));
}
new Nu();
var kl = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, u1 = { exports: {} };
(function(i) {
  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 r = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i, s = 0, u = {}, 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 p(b) {
          return b instanceof o ? new o(b.type, p(b.content), b.alias) : Array.isArray(b) ? b.map(p) : b.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(p) {
          return Object.prototype.toString.call(p).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(p) {
          return p.__id || Object.defineProperty(p, "__id", { value: ++s }), p.__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 p(b, y) {
          y = y || {};
          var C, M;
          switch (l.util.type(b)) {
            case "Object":
              if (M = l.util.objId(b), y[M])
                return y[M];
              C = /** @type {Record<string, any>} */
              {}, y[M] = C;
              for (var L in b)
                b.hasOwnProperty(L) && (C[L] = p(b[L], y));
              return (
                /** @type {any} */
                C
              );
            case "Array":
              return M = l.util.objId(b), y[M] ? y[M] : (C = [], y[M] = C, /** @type {Array} */
              /** @type {any} */
              b.forEach(function(P, O) {
                C[O] = p(P, y);
              }), /** @type {any} */
              C);
            default:
              return b;
          }
        },
        /**
         * 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(p) {
          for (; p; ) {
            var b = r.exec(p.className);
            if (b)
              return b[1].toLowerCase();
            p = p.parentElement;
          }
          return "none";
        },
        /**
         * Sets the Prism `language-xxxx` class of the given element.
         *
         * @param {Element} element
         * @param {string} language
         * @returns {void}
         */
        setLanguage: function(p, b) {
          p.className = p.className.replace(RegExp(r, "gi"), ""), p.classList.add("language-" + b);
        },
        /**
         * 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 (C) {
            var p = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(C.stack) || [])[1];
            if (p) {
              var b = document.getElementsByTagName("script");
              for (var y in b)
                if (b[y].src == p)
                  return b[y];
            }
            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(p, b, y) {
          for (var C = "no-" + b; p; ) {
            var M = p.classList;
            if (M.contains(b))
              return !0;
            if (M.contains(C))
              return !1;
            p = p.parentElement;
          }
          return !!y;
        }
      },
      /**
       * 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: u,
        plaintext: u,
        text: u,
        txt: u,
        /**
         * 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(p, b) {
          var y = l.util.clone(l.languages[p]);
          for (var C in b)
            y[C] = b[C];
          return y;
        },
        /**
         * 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(p, b, y, C) {
          C = C || /** @type {any} */
          l.languages;
          var M = C[p], L = {};
          for (var P in M)
            if (M.hasOwnProperty(P)) {
              if (P == b)
                for (var O in y)
                  y.hasOwnProperty(O) && (L[O] = y[O]);
              y.hasOwnProperty(P) || (L[P] = M[P]);
            }
          var q = C[p];
          return C[p] = L, l.languages.DFS(l.languages, function(Y, se) {
            se === q && Y != p && (this[Y] = L);
          }), L;
        },
        // Traverse a language definition with Depth First Search
        DFS: function p(b, y, C, M) {
          M = M || {};
          var L = l.util.objId;
          for (var P in b)
            if (b.hasOwnProperty(P)) {
              y.call(b, P, b[P], C || P);
              var O = b[P], q = l.util.type(O);
              q === "Object" && !M[L(O)] ? (M[L(O)] = !0, p(O, y, null, M)) : q === "Array" && !M[L(O)] && (M[L(O)] = !0, p(O, y, P, 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(p, b) {
        l.highlightAllUnder(document, p, b);
      },
      /**
       * 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(p, b, y) {
        var C = {
          callback: y,
          container: p,
          selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
        };
        l.hooks.run("before-highlightall", C), C.elements = Array.prototype.slice.apply(C.container.querySelectorAll(C.selector)), l.hooks.run("before-all-elements-highlight", C);
        for (var M = 0, L; L = C.elements[M++]; )
          l.highlightElement(L, b === !0, C.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(p, b, y) {
        var C = l.util.getLanguage(p), M = l.languages[C];
        l.util.setLanguage(p, C);
        var L = p.parentElement;
        L && L.nodeName.toLowerCase() === "pre" && l.util.setLanguage(L, C);
        var P = p.textContent, O = {
          element: p,
          language: C,
          grammar: M,
          code: P
        };
        function q(se) {
          O.highlightedCode = se, l.hooks.run("before-insert", O), O.element.innerHTML = O.highlightedCode, l.hooks.run("after-highlight", O), l.hooks.run("complete", O), y && y.call(O.element);
        }
        if (l.hooks.run("before-sanity-check", O), L = O.element.parentElement, L && L.nodeName.toLowerCase() === "pre" && !L.hasAttribute("tabindex") && L.setAttribute("tabindex", "0"), !O.code) {
          l.hooks.run("complete", O), y && y.call(O.element);
          return;
        }
        if (l.hooks.run("before-highlight", O), !O.grammar) {
          q(l.util.encode(O.code));
          return;
        }
        if (b && n.Worker) {
          var Y = new Worker(l.filename);
          Y.onmessage = function(se) {
            q(se.data);
          }, Y.postMessage(JSON.stringify({
            language: O.language,
            code: O.code,
            immediateClose: !0
          }));
        } else
          q(l.highlight(O.code, O.grammar, O.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(p, b, y) {
        var C = {
          code: p,
          grammar: b,
          language: y
        };
        if (l.hooks.run("before-tokenize", C), !C.grammar)
          throw new Error('The language "' + C.language + '" has no grammar.');
        return C.tokens = l.tokenize(C.code, C.grammar), l.hooks.run("after-tokenize", C), o.stringify(l.util.encode(C.tokens), C.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(p, b) {
        var y = b.rest;
        if (y) {
          for (var C in y)
            b[C] = y[C];
          delete b.rest;
        }
        var M = new c();
        return f(M, M.head, p), d(p, M, b, M.head, 0), A(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(p, b) {
          var y = l.hooks.all;
          y[p] = y[p] || [], y[p].push(b);
        },
        /**
         * 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(p, b) {
          var y = l.hooks.all[p];
          if (!(!y || !y.length))
            for (var C = 0, M; M = y[C++]; )
              M(b);
        }
      },
      Token: o
    };
    n.Prism = l;
    function o(p, b, y, C) {
      this.type = p, this.content = b, this.alias = y, this.length = (C || "").length | 0;
    }
    o.stringify = function p(b, y) {
      if (typeof b == "string")
        return b;
      if (Array.isArray(b)) {
        var C = "";
        return b.forEach(function(q) {
          C += p(q, y);
        }), C;
      }
      var M = {
        type: b.type,
        content: p(b.content, y),
        tag: "span",
        classes: ["token", b.type],
        attributes: {},
        language: y
      }, L = b.alias;
      L && (Array.isArray(L) ? Array.prototype.push.apply(M.classes, L) : M.classes.push(L)), l.hooks.run("wrap", M);
      var P = "";
      for (var O in M.attributes)
        P += " " + O + '="' + (M.attributes[O] || "").replace(/"/g, "&quot;") + '"';
      return "<" + M.tag + ' class="' + M.classes.join(" ") + '"' + P + ">" + M.content + "</" + M.tag + ">";
    };
    function h(p, b, y, C) {
      p.lastIndex = b;
      var M = p.exec(y);
      if (M && C && M[1]) {
        var L = M[1].length;
        M.index += L, M[0] = M[0].slice(L);
      }
      return M;
    }
    function d(p, b, y, C, M, L) {
      for (var P in y)
        if (!(!y.hasOwnProperty(P) || !y[P])) {
          var O = y[P];
          O = Array.isArray(O) ? O : [O];
          for (var q = 0; q < O.length; ++q) {
            if (L && L.cause == P + "," + q)
              return;
            var Y = O[q], se = Y.inside, me = !!Y.lookbehind, te = !!Y.greedy, K = Y.alias;
            if (te && !Y.pattern.global) {
              var Z = Y.pattern.toString().match(/[imsuy]*$/)[0];
              Y.pattern = RegExp(Y.pattern.source, Z + "g");
            }
            for (var oe = Y.pattern || Y, le = C.next, ie = M; le !== b.tail && !(L && ie >= L.reach); ie += le.value.length, le = le.next) {
              var pe = le.value;
              if (b.length > p.length)
                return;
              if (!(pe instanceof o)) {
                var he = 1, we;
                if (te) {
                  if (we = h(oe, ie, p, me), !we || we.index >= p.length)
                    break;
                  var de = we.index, ke = we.index + we[0].length, Ae = ie;
                  for (Ae += le.value.length; de >= Ae; )
                    le = le.next, Ae += le.value.length;
                  if (Ae -= le.value.length, ie = Ae, le.value instanceof o)
                    continue;
                  for (var ae = le; ae !== b.tail && (Ae < ke || typeof ae.value == "string"); ae = ae.next)
                    he++, Ae += ae.value.length;
                  he--, pe = p.slice(ie, Ae), we.index -= ie;
                } else if (we = h(oe, 0, pe, me), !we)
                  continue;
                var de = we.index, R = we[0], D = pe.slice(0, de), v = pe.slice(de + R.length), S = ie + pe.length;
                L && S > L.reach && (L.reach = S);
                var E = le.prev;
                D && (E = f(b, E, D), ie += D.length), g(b, E, he);
                var _ = new o(P, se ? l.tokenize(R, se) : R, K, R);
                if (le = f(b, E, _), v && f(b, le, v), he > 1) {
                  var x = {
                    cause: P + "," + q,
                    reach: S
                  };
                  d(p, b, y, le.prev, ie, x), L && x.reach > L.reach && (L.reach = x.reach);
                }
              }
            }
          }
        }
    }
    function c() {
      var p = { value: null, prev: null, next: null }, b = { value: null, prev: p, next: null };
      p.next = b, this.head = p, this.tail = b, this.length = 0;
    }
    function f(p, b, y) {
      var C = b.next, M = { value: y, prev: b, next: C };
      return b.next = M, C.prev = M, p.length++, M;
    }
    function g(p, b, y) {
      for (var C = b.next, M = 0; M < y && C !== p.tail; M++)
        C = C.next;
      b.next = C, C.prev = b, p.length -= M;
    }
    function A(p) {
      for (var b = [], y = p.head.next; y !== p.tail; )
        b.push(y.value), y = y.next;
      return b;
    }
    if (!n.document)
      return n.addEventListener && (l.disableWorkerMessageHandler || n.addEventListener("message", function(p) {
        var b = JSON.parse(p.data), y = b.language, C = b.code, M = b.immediateClose;
        n.postMessage(l.highlight(C, l.languages[y], y)), M && n.close();
      }, !1)), l;
    var m = l.util.currentScript();
    m && (l.filename = m.src, m.hasAttribute("data-manual") && (l.manual = !0));
    function k() {
      l.manual || l.highlightAll();
    }
    if (!l.manual) {
      var a = document.readyState;
      a === "loading" || a === "interactive" && m && m.defer ? document.addEventListener("DOMContentLoaded", k) : window.requestAnimationFrame ? window.requestAnimationFrame(k) : window.setTimeout(k, 16);
    }
    return l;
  }(e);
  i.exports && (i.exports = t), typeof kl < "u" && (kl.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(r, s) {
      var u = {};
      u["language-" + s] = {
        pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
        lookbehind: !0,
        inside: t.languages[s]
      }, u.cdata = /^<!\[CDATA\[|\]\]>$/i;
      var l = {
        "included-cdata": {
          pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
          inside: u
        }
      };
      l["language-" + s] = {
        pattern: /[\s\S]+/,
        inside: t.languages[s]
      };
      var o = {};
      o[r] = {
        pattern: RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g, function() {
          return r;
        }), "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, r) {
      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: [r, "language-" + r],
                inside: t.languages[r]
              },
              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 r = /(?:"(?:\\(?:\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 + "|" + r.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\\((?:" + r.source + "|" + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ")\\)", "i"),
        greedy: !0,
        inside: {
          function: /^url/i,
          punctuation: /^\(|\)$/,
          string: {
            pattern: RegExp("^" + r.source + "$"),
            alias: "url"
          }
        }
      },
      selector: {
        pattern: RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|` + r.source + ")*(?=\\s*\\{)"),
        lookbehind: !0
      },
      string: {
        pattern: r,
        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 s = n.languages.markup;
    s && (s.tag.addInlined("style", "css"), s.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…", r = function(m, k) {
      return "✖ Error " + m + " while fetching file: " + k;
    }, s = "✖ Error: File does not exist or is empty", u = {
      js: "javascript",
      py: "python",
      rb: "ruby",
      ps1: "powershell",
      psm1: "powershell",
      sh: "bash",
      bat: "batch",
      h: "c",
      tex: "latex"
    }, l = "data-src-status", o = "loading", h = "loaded", d = "failed", c = "pre[data-src]:not([" + l + '="' + h + '"]):not([' + l + '="' + o + '"])';
    function f(m, k, a) {
      var p = new XMLHttpRequest();
      p.open("GET", m, !0), p.onreadystatechange = function() {
        p.readyState == 4 && (p.status < 400 && p.responseText ? k(p.responseText) : p.status >= 400 ? a(r(p.status, p.statusText)) : a(s));
      }, p.send(null);
    }
    function g(m) {
      var k = /^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(m || "");
      if (k) {
        var a = Number(k[1]), p = k[2], b = k[3];
        return p ? b ? [a, Number(b)] : [a, void 0] : [a, a];
      }
    }
    t.hooks.add("before-highlightall", function(m) {
      m.selector += ", " + c;
    }), t.hooks.add("before-sanity-check", function(m) {
      var k = (
        /** @type {HTMLPreElement} */
        m.element
      );
      if (k.matches(c)) {
        m.code = "", k.setAttribute(l, o);
        var a = k.appendChild(document.createElement("CODE"));
        a.textContent = n;
        var p = k.getAttribute("data-src"), b = m.language;
        if (b === "none") {
          var y = (/\.(\w+)$/.exec(p) || [, "none"])[1];
          b = u[y] || y;
        }
        t.util.setLanguage(a, b), t.util.setLanguage(k, b);
        var C = t.plugins.autoloader;
        C && C.loadLanguages(b), f(
          p,
          function(M) {
            k.setAttribute(l, h);
            var L = g(k.getAttribute("data-range"));
            if (L) {
              var P = M.split(/\r\n?|\n/g), O = L[0], q = L[1] == null ? P.length : L[1];
              O < 0 && (O += P.length), O = Math.max(0, Math.min(O - 1, P.length)), q < 0 && (q += P.length), q = Math.max(0, Math.min(q, P.length)), M = P.slice(O, q).join(`
`), k.hasAttribute("data-start") || k.setAttribute("data-start", String(O + 1));
            }
            a.textContent = M, t.highlightElement(a);
          },
          function(M) {
            k.setAttribute(l, d), a.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(k) {
        for (var a = (k || document).querySelectorAll(c), p = 0, b; b = a[p++]; )
          t.highlightElement(b);
      }
    };
    var A = !1;
    t.fileHighlight = function() {
      A || (console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."), A = !0), t.plugins.fileHighlight.highlight.apply(this, arguments);
    };
  }();
})(u1);
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(i) {
  var e = /\\(?:[^a-z()[\]]|[a-z*]+)/i, t = {
    "equation-command": {
      pattern: e,
      alias: "regex"
    }
  };
  i.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: /[[\]{}&]/
  }, i.languages.tex = i.languages.latex, i.languages.context = i.languages.latex;
})(Prism);
(function(i) {
  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})/
  };
  i.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 = i.languages.bash;
  for (var r = [
    "comment",
    "function-name",
    "for-or-select",
    "assign-left",
    "parameter",
    "string",
    "environment",
    "function",
    "keyword",
    "builtin",
    "boolean",
    "file-descriptor",
    "operator",
    "punctuation",
    "number"
  ], s = n.variable[1].inside, u = 0; u < r.length; u++)
    s[r[u]] = i.languages.bash[r[u]];
  i.languages.sh = i.languages.bash, i.languages.shell = i.languages.bash;
})(Prism);
new Nu();
const c1 = (i) => {
  const e = {};
  for (let t = 0, n = i.length; t < n; t++) {
    const r = i[t];
    for (const s in r)
      e[s] ? e[s] = e[s].concat(r[s]) : e[s] = r[s];
  }
  return e;
}, h1 = [
  "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"
], d1 = [
  "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"
], f1 = [
  "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"
], m1 = [
  "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"
], p1 = [
  "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"
], g1 = [
  "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"
];
[
  ...h1,
  ...d1.map((i) => `svg:${i}`),
  ...f1.map((i) => `math:${i}`)
], c1([
  Object.fromEntries(m1.map((i) => [i, ["*"]])),
  Object.fromEntries(p1.map((i) => [i, ["svg:*"]])),
  Object.fromEntries(g1.map((i) => [i, ["math:*"]]))
]);
function Oi(i) {
  let e = ["", "k", "M", "G", "T", "P", "E", "Z"], t = 0;
  for (; i > 1e3 && t < e.length - 1; )
    i /= 1e3, t++;
  let n = e[t];
  return (Number.isInteger(i) ? i : i.toFixed(1)) + n;
}
function Jr() {
}
function b1(i, e) {
  return i != i ? e == e : i !== e || i && typeof i == "object" || typeof i == "function";
}
const Pu = typeof window < "u";
let Sl = Pu ? () => window.performance.now() : () => Date.now(), Bu = Pu ? (i) => requestAnimationFrame(i) : Jr;
const Vi = /* @__PURE__ */ new Set();
function zu(i) {
  Vi.forEach((e) => {
    e.c(i) || (Vi.delete(e), e.f());
  }), Vi.size !== 0 && Bu(zu);
}
function v1(i) {
  let e;
  return Vi.size === 0 && Bu(zu), {
    promise: new Promise((t) => {
      Vi.add(e = { c: i, f: t });
    }),
    abort() {
      Vi.delete(e);
    }
  };
}
const zi = [];
function y1(i, e = Jr) {
  let t;
  const n = /* @__PURE__ */ new Set();
  function r(l) {
    if (b1(i, l) && (i = l, t)) {
      const o = !zi.length;
      for (const h of n)
        h[1](), zi.push(h, i);
      if (o) {
        for (let h = 0; h < zi.length; h += 2)
          zi[h][0](zi[h + 1]);
        zi.length = 0;
      }
    }
  }
  function s(l) {
    r(l(i));
  }
  function u(l, o = Jr) {
    const h = [l, o];
    return n.add(h), n.size === 1 && (t = e(r, s) || Jr), l(i), () => {
      n.delete(h), n.size === 0 && t && (t(), t = null);
    };
  }
  return { set: r, update: s, subscribe: u };
}
function xl(i) {
  return Object.prototype.toString.call(i) === "[object Date]";
}
function Ca(i, e, t, n) {
  if (typeof t == "number" || xl(t)) {
    const r = n - t, s = (t - e) / (i.dt || 1 / 60), u = i.opts.stiffness * r, l = i.opts.damping * s, o = (u - l) * i.inv_mass, h = (s + o) * i.dt;
    return Math.abs(h) < i.opts.precision && Math.abs(r) < i.opts.precision ? n : (i.settled = !1, xl(t) ? new Date(t.getTime() + h) : t + h);
  } else {
    if (Array.isArray(t))
      return t.map(
        (r, s) => Ca(i, e[s], t[s], n[s])
      );
    if (typeof t == "object") {
      const r = {};
      for (const s in t)
        r[s] = Ca(i, e[s], t[s], n[s]);
      return r;
    } else
      throw new Error(`Cannot spring ${typeof t} values`);
  }
}
function El(i, e = {}) {
  const t = y1(i), { stiffness: n = 0.15, damping: r = 0.8, precision: s = 0.01 } = e;
  let u, l, o, h = i, d = i, c = 1, f = 0, g = !1;
  function A(k, a = {}) {
    d = k;
    const p = o = {};
    return i == null || a.hard || m.stiffness >= 1 && m.damping >= 1 ? (g = !0, u = Sl(), h = k, t.set(i = d), Promise.resolve()) : (a.soft && (f = 1 / ((a.soft === !0 ? 0.5 : +a.soft) * 60), c = 0), l || (u = Sl(), g = !1, l = v1((b) => {
      if (g)
        return g = !1, l = null, !1;
      c = Math.min(c + f, 1);
      const y = {
        inv_mass: c,
        opts: m,
        settled: !0,
        dt: (b - u) * 60 / 1e3
      }, C = Ca(y, h, i, d);
      return u = b, h = i, t.set(i = C), y.settled && (l = null), !y.settled;
    })), new Promise((b) => {
      l.promise.then(() => {
        p === o && b();
      });
    }));
  }
  const m = {
    set: A,
    update: (k, a) => A(k(d, i), a),
    subscribe: t.subscribe,
    stiffness: n,
    damping: r,
    precision: s
  };
  return m;
}
const {
  SvelteComponent: w1,
  append_hydration: cn,
  attr: Xe,
  children: $t,
  claim_element: A1,
  claim_svg_element: hn,
  component_subscribe: _l,
  detach: Bt,
  element: k1,
  init: S1,
  insert_hydration: x1,
  noop: Tl,
  safe_not_equal: E1,
  set_style: qr,
  svg_element: dn,
  toggle_class: Cl
} = window.__gradio__svelte__internal, { onMount: _1 } = window.__gradio__svelte__internal;
function T1(i) {
  let e, t, n, r, s, u, l, o, h, d, c, f;
  return {
    c() {
      e = k1("div"), t = dn("svg"), n = dn("g"), r = dn("path"), s = dn("path"), u = dn("path"), l = dn("path"), o = dn("g"), h = dn("path"), d = dn("path"), c = dn("path"), f = dn("path"), this.h();
    },
    l(g) {
      e = A1(g, "DIV", { class: !0 });
      var A = $t(e);
      t = hn(A, "svg", {
        viewBox: !0,
        fill: !0,
        xmlns: !0,
        class: !0
      });
      var m = $t(t);
      n = hn(m, "g", { style: !0 });
      var k = $t(n);
      r = hn(k, "path", {
        d: !0,
        fill: !0,
        "fill-opacity": !0,
        class: !0
      }), $t(r).forEach(Bt), s = hn(k, "path", { d: !0, fill: !0, class: !0 }), $t(s).forEach(Bt), u = hn(k, "path", {
        d: !0,
        fill: !0,
        "fill-opacity": !0,
        class: !0
      }), $t(u).forEach(Bt), l = hn(k, "path", { d: !0, fill: !0, class: !0 }), $t(l).forEach(Bt), k.forEach(Bt), o = hn(m, "g", { style: !0 });
      var a = $t(o);
      h = hn(a, "path", {
        d: !0,
        fill: !0,
        "fill-opacity": !0,
        class: !0
      }), $t(h).forEach(Bt), d = hn(a, "path", { d: !0, fill: !0, class: !0 }), $t(d).forEach(Bt), c = hn(a, "path", {
        d: !0,
        fill: !0,
        "fill-opacity": !0,
        class: !0
      }), $t(c).forEach(Bt), f = hn(a, "path", { d: !0, fill: !0, class: !0 }), $t(f).forEach(Bt), a.forEach(Bt), m.forEach(Bt), A.forEach(Bt), this.h();
    },
    h() {
      Xe(r, "d", "M255.926 0.754768L509.702 139.936V221.027L255.926 81.8465V0.754768Z"), Xe(r, "fill", "#FF7C00"), Xe(r, "fill-opacity", "0.4"), Xe(r, "class", "svelte-43sxxs"), Xe(s, "d", "M509.69 139.936L254.981 279.641V361.255L509.69 221.55V139.936Z"), Xe(s, "fill", "#FF7C00"), Xe(s, "class", "svelte-43sxxs"), Xe(u, "d", "M0.250138 139.937L254.981 279.641V361.255L0.250138 221.55V139.937Z"), Xe(u, "fill", "#FF7C00"), Xe(u, "fill-opacity", "0.4"), Xe(u, "class", "svelte-43sxxs"), Xe(l, "d", "M255.923 0.232622L0.236328 139.936V221.55L255.923 81.8469V0.232622Z"), Xe(l, "fill", "#FF7C00"), Xe(l, "class", "svelte-43sxxs"), qr(n, "transform", "translate(" + /*$top*/
      i[1][0] + "px, " + /*$top*/
      i[1][1] + "px)"), Xe(h, "d", "M255.926 141.5L509.702 280.681V361.773L255.926 222.592V141.5Z"), Xe(h, "fill", "#FF7C00"), Xe(h, "fill-opacity", "0.4"), Xe(h, "class", "svelte-43sxxs"), Xe(d, "d", "M509.69 280.679L254.981 420.384V501.998L509.69 362.293V280.679Z"), Xe(d, "fill", "#FF7C00"), Xe(d, "class", "svelte-43sxxs"), Xe(c, "d", "M0.250138 280.681L254.981 420.386V502L0.250138 362.295V280.681Z"), Xe(c, "fill", "#FF7C00"), Xe(c, "fill-opacity", "0.4"), Xe(c, "class", "svelte-43sxxs"), Xe(f, "d", "M255.923 140.977L0.236328 280.68V362.294L255.923 222.591V140.977Z"), Xe(f, "fill", "#FF7C00"), Xe(f, "class", "svelte-43sxxs"), qr(o, "transform", "translate(" + /*$bottom*/
      i[2][0] + "px, " + /*$bottom*/
      i[2][1] + "px)"), Xe(t, "viewBox", "-1200 -1200 3000 3000"), Xe(t, "fill", "none"), Xe(t, "xmlns", "http://www.w3.org/2000/svg"), Xe(t, "class", "svelte-43sxxs"), Xe(e, "class", "svelte-43sxxs"), Cl(
        e,
        "margin",
        /*margin*/
        i[0]
      );
    },
    m(g, A) {
      x1(g, e, A), cn(e, t), cn(t, n), cn(n, r), cn(n, s), cn(n, u), cn(n, l), cn(t, o), cn(o, h), cn(o, d), cn(o, c), cn(o, f);
    },
    p(g, [A]) {
      A & /*$top*/
      2 && qr(n, "transform", "translate(" + /*$top*/
      g[1][0] + "px, " + /*$top*/
      g[1][1] + "px)"), A & /*$bottom*/
      4 && qr(o, "transform", "translate(" + /*$bottom*/
      g[2][0] + "px, " + /*$bottom*/
      g[2][1] + "px)"), A & /*margin*/
      1 && Cl(
        e,
        "margin",
        /*margin*/
        g[0]
      );
    },
    i: Tl,
    o: Tl,
    d(g) {
      g && Bt(e);
    }
  };
}
function C1(i, e, t) {
  let n, r;
  var s = this && this.__awaiter || function(g, A, m, k) {
    function a(p) {
      return p instanceof m ? p : new m(function(b) {
        b(p);
      });
    }
    return new (m || (m = Promise))(function(p, b) {
      function y(L) {
        try {
          M(k.next(L));
        } catch (P) {
          b(P);
        }
      }
      function C(L) {
        try {
          M(k.throw(L));
        } catch (P) {
          b(P);
        }
      }
      function M(L) {
        L.done ? p(L.value) : a(L.value).then(y, C);
      }
      M((k = k.apply(g, A || [])).next());
    });
  };
  let { margin: u = !0 } = e;
  const l = El([0, 0]);
  _l(i, l, (g) => t(1, n = g));
  const o = El([0, 0]);
  _l(i, o, (g) => t(2, r = g));
  let h;
  function d() {
    return s(this, void 0, void 0, function* () {
      yield Promise.all([l.set([125, 140]), o.set([-125, -140])]), yield Promise.all([l.set([-125, 140]), o.set([125, -140])]), yield Promise.all([l.set([-125, 0]), o.set([125, -0])]), yield Promise.all([l.set([125, 0]), o.set([-125, 0])]);
    });
  }
  function c() {
    return s(this, void 0, void 0, function* () {
      yield d(), h || c();
    });
  }
  function f() {
    return s(this, void 0, void 0, function* () {
      yield Promise.all([l.set([125, 0]), o.set([-125, 0])]), c();
    });
  }
  return _1(() => (f(), () => h = !0)), i.$$set = (g) => {
    "margin" in g && t(0, u = g.margin);
  }, [u, n, r, l, o];
}
class D1 extends w1 {
  constructor(e) {
    super(), S1(this, e, C1, T1, E1, { margin: 0 });
  }
}
const {
  SvelteComponent: F1,
  append_hydration: xi,
  attr: bn,
  binding_callbacks: Dl,
  check_outros: Da,
  children: En,
  claim_component: Ou,
  claim_element: _n,
  claim_space: Jt,
  claim_text: it,
  create_component: Hu,
  create_slot: qu,
  destroy_component: Uu,
  destroy_each: Vu,
  detach: Me,
  element: Tn,
  empty: nn,
  ensure_array_like: us,
  get_all_dirty_from_scope: Gu,
  get_slot_changes: Xu,
  group_outros: Fa,
  init: M1,
  insert_hydration: ze,
  mount_component: ju,
  noop: Ma,
  safe_not_equal: R1,
  set_data: rn,
  set_style: Qn,
  space: en,
  text: rt,
  toggle_class: Kt,
  transition_in: gn,
  transition_out: Cn,
  update_slot_base: Yu
} = window.__gradio__svelte__internal, { tick: L1 } = window.__gradio__svelte__internal, { onDestroy: I1 } = window.__gradio__svelte__internal, { createEventDispatcher: N1 } = window.__gradio__svelte__internal, P1 = (i) => ({}), Fl = (i) => ({}), B1 = (i) => ({}), Ml = (i) => ({});
function Rl(i, e, t) {
  const n = i.slice();
  return n[41] = e[t], n[43] = t, n;
}
function Ll(i, e, t) {
  const n = i.slice();
  return n[41] = e[t], n;
}
function z1(i) {
  let e, t, n, r, s = (
    /*i18n*/
    i[1]("common.error") + ""
  ), u, l, o;
  t = new kr({
    props: {
      Icon: N0,
      label: (
        /*i18n*/
        i[1]("common.clear")
      ),
      disabled: !1
    }
  }), t.$on(
    "click",
    /*click_handler*/
    i[32]
  );
  const h = (
    /*#slots*/
    i[30].error
  ), d = qu(
    h,
    i,
    /*$$scope*/
    i[29],
    Fl
  );
  return {
    c() {
      e = Tn("div"), Hu(t.$$.fragment), n = en(), r = Tn("span"), u = rt(s), l = en(), d && d.c(), this.h();
    },
    l(c) {
      e = _n(c, "DIV", { class: !0 });
      var f = En(e);
      Ou(t.$$.fragment, f), f.forEach(Me), n = Jt(c), r = _n(c, "SPAN", { class: !0 });
      var g = En(r);
      u = it(g, s), g.forEach(Me), l = Jt(c), d && d.l(c), this.h();
    },
    h() {
      bn(e, "class", "clear-status svelte-17v219f"), bn(r, "class", "error svelte-17v219f");
    },
    m(c, f) {
      ze(c, e, f), ju(t, e, null), ze(c, n, f), ze(c, r, f), xi(r, u), ze(c, l, f), d && d.m(c, f), o = !0;
    },
    p(c, f) {
      const g = {};
      f[0] & /*i18n*/
      2 && (g.label = /*i18n*/
      c[1]("common.clear")), t.$set(g), (!o || f[0] & /*i18n*/
      2) && s !== (s = /*i18n*/
      c[1]("common.error") + "") && rn(u, s), d && d.p && (!o || f[0] & /*$$scope*/
      536870912) && Yu(
        d,
        h,
        c,
        /*$$scope*/
        c[29],
        o ? Xu(
          h,
          /*$$scope*/
          c[29],
          f,
          P1
        ) : Gu(
          /*$$scope*/
          c[29]
        ),
        Fl
      );
    },
    i(c) {
      o || (gn(t.$$.fragment, c), gn(d, c), o = !0);
    },
    o(c) {
      Cn(t.$$.fragment, c), Cn(d, c), o = !1;
    },
    d(c) {
      c && (Me(e), Me(n), Me(r), Me(l)), Uu(t), d && d.d(c);
    }
  };
}
function O1(i) {
  let e, t, n, r, s, u, l, o, h, d = (
    /*variant*/
    i[8] === "default" && /*show_eta_bar*/
    i[18] && /*show_progress*/
    i[6] === "full" && Il(i)
  );
  function c(b, y) {
    if (
      /*progress*/
      b[7]
    ) return U1;
    if (
      /*queue_position*/
      b[2] !== null && /*queue_size*/
      b[3] !== void 0 && /*queue_position*/
      b[2] >= 0
    ) return q1;
    if (
      /*queue_position*/
      b[2] === 0
    ) return H1;
  }
  let f = c(i), g = f && f(i), A = (
    /*timer*/
    i[5] && Bl(i)
  );
  const m = [j1, X1], k = [];
  function a(b, y) {
    return (
      /*last_progress_level*/
      b[15] != null ? 0 : (
        /*show_progress*/
        b[6] === "full" ? 1 : -1
      )
    );
  }
  ~(s = a(i)) && (u = k[s] = m[s](i));
  let p = !/*timer*/
  i[5] && Gl(i);
  return {
    c() {
      d && d.c(), e = en(), t = Tn("div"), g && g.c(), n = en(), A && A.c(), r = en(), u && u.c(), l = en(), p && p.c(), o = nn(), this.h();
    },
    l(b) {
      d && d.l(b), e = Jt(b), t = _n(b, "DIV", { class: !0 });
      var y = En(t);
      g && g.l(y), n = Jt(y), A && A.l(y), y.forEach(Me), r = Jt(b), u && u.l(b), l = Jt(b), p && p.l(b), o = nn(), this.h();
    },
    h() {
      bn(t, "class", "progress-text svelte-17v219f"), Kt(
        t,
        "meta-text-center",
        /*variant*/
        i[8] === "center"
      ), Kt(
        t,
        "meta-text",
        /*variant*/
        i[8] === "default"
      );
    },
    m(b, y) {
      d && d.m(b, y), ze(b, e, y), ze(b, t, y), g && g.m(t, null), xi(t, n), A && A.m(t, null), ze(b, r, y), ~s && k[s].m(b, y), ze(b, l, y), p && p.m(b, y), ze(b, o, y), h = !0;
    },
    p(b, y) {
      /*variant*/
      b[8] === "default" && /*show_eta_bar*/
      b[18] && /*show_progress*/
      b[6] === "full" ? d ? d.p(b, y) : (d = Il(b), d.c(), d.m(e.parentNode, e)) : d && (d.d(1), d = null), f === (f = c(b)) && g ? g.p(b, y) : (g && g.d(1), g = f && f(b), g && (g.c(), g.m(t, n))), /*timer*/
      b[5] ? A ? A.p(b, y) : (A = Bl(b), A.c(), A.m(t, null)) : A && (A.d(1), A = null), (!h || y[0] & /*variant*/
      256) && Kt(
        t,
        "meta-text-center",
        /*variant*/
        b[8] === "center"
      ), (!h || y[0] & /*variant*/
      256) && Kt(
        t,
        "meta-text",
        /*variant*/
        b[8] === "default"
      );
      let C = s;
      s = a(b), s === C ? ~s && k[s].p(b, y) : (u && (Fa(), Cn(k[C], 1, 1, () => {
        k[C] = null;
      }), Da()), ~s ? (u = k[s], u ? u.p(b, y) : (u = k[s] = m[s](b), u.c()), gn(u, 1), u.m(l.parentNode, l)) : u = null), /*timer*/
      b[5] ? p && (Fa(), Cn(p, 1, 1, () => {
        p = null;
      }), Da()) : p ? (p.p(b, y), y[0] & /*timer*/
      32 && gn(p, 1)) : (p = Gl(b), p.c(), gn(p, 1), p.m(o.parentNode, o));
    },
    i(b) {
      h || (gn(u), gn(p), h = !0);
    },
    o(b) {
      Cn(u), Cn(p), h = !1;
    },
    d(b) {
      b && (Me(e), Me(t), Me(r), Me(l), Me(o)), d && d.d(b), g && g.d(), A && A.d(), ~s && k[s].d(b), p && p.d(b);
    }
  };
}
function Il(i) {
  let e, t = `translateX(${/*eta_level*/
  (i[17] || 0) * 100 - 100}%)`;
  return {
    c() {
      e = Tn("div"), this.h();
    },
    l(n) {
      e = _n(n, "DIV", { class: !0 }), En(e).forEach(Me), this.h();
    },
    h() {
      bn(e, "class", "eta-bar svelte-17v219f"), Qn(e, "transform", t);
    },
    m(n, r) {
      ze(n, e, r);
    },
    p(n, r) {
      r[0] & /*eta_level*/
      131072 && t !== (t = `translateX(${/*eta_level*/
      (n[17] || 0) * 100 - 100}%)`) && Qn(e, "transform", t);
    },
    d(n) {
      n && Me(e);
    }
  };
}
function H1(i) {
  let e;
  return {
    c() {
      e = rt("processing |");
    },
    l(t) {
      e = it(t, "processing |");
    },
    m(t, n) {
      ze(t, e, n);
    },
    p: Ma,
    d(t) {
      t && Me(e);
    }
  };
}
function q1(i) {
  let e, t = (
    /*queue_position*/
    i[2] + 1 + ""
  ), n, r, s, u;
  return {
    c() {
      e = rt("queue: "), n = rt(t), r = rt("/"), s = rt(
        /*queue_size*/
        i[3]
      ), u = rt(" |");
    },
    l(l) {
      e = it(l, "queue: "), n = it(l, t), r = it(l, "/"), s = it(
        l,
        /*queue_size*/
        i[3]
      ), u = it(l, " |");
    },
    m(l, o) {
      ze(l, e, o), ze(l, n, o), ze(l, r, o), ze(l, s, o), ze(l, u, o);
    },
    p(l, o) {
      o[0] & /*queue_position*/
      4 && t !== (t = /*queue_position*/
      l[2] + 1 + "") && rn(n, t), o[0] & /*queue_size*/
      8 && rn(
        s,
        /*queue_size*/
        l[3]
      );
    },
    d(l) {
      l && (Me(e), Me(n), Me(r), Me(s), Me(u));
    }
  };
}
function U1(i) {
  let e, t = us(
    /*progress*/
    i[7]
  ), n = [];
  for (let r = 0; r < t.length; r += 1)
    n[r] = Pl(Ll(i, t, r));
  return {
    c() {
      for (let r = 0; r < n.length; r += 1)
        n[r].c();
      e = nn();
    },
    l(r) {
      for (let s = 0; s < n.length; s += 1)
        n[s].l(r);
      e = nn();
    },
    m(r, s) {
      for (let u = 0; u < n.length; u += 1)
        n[u] && n[u].m(r, s);
      ze(r, e, s);
    },
    p(r, s) {
      if (s[0] & /*progress*/
      128) {
        t = us(
          /*progress*/
          r[7]
        );
        let u;
        for (u = 0; u < t.length; u += 1) {
          const l = Ll(r, t, u);
          n[u] ? n[u].p(l, s) : (n[u] = Pl(l), n[u].c(), n[u].m(e.parentNode, e));
        }
        for (; u < n.length; u += 1)
          n[u].d(1);
        n.length = t.length;
      }
    },
    d(r) {
      r && Me(e), Vu(n, r);
    }
  };
}
function Nl(i) {
  let e, t = (
    /*p*/
    i[41].unit + ""
  ), n, r, s = " ", u;
  function l(d, c) {
    return (
      /*p*/
      d[41].length != null ? G1 : V1
    );
  }
  let o = l(i), h = o(i);
  return {
    c() {
      h.c(), e = en(), n = rt(t), r = rt(" | "), u = rt(s);
    },
    l(d) {
      h.l(d), e = Jt(d), n = it(d, t), r = it(d, " | "), u = it(d, s);
    },
    m(d, c) {
      h.m(d, c), ze(d, e, c), ze(d, n, c), ze(d, r, c), ze(d, u, c);
    },
    p(d, c) {
      o === (o = l(d)) && h ? h.p(d, c) : (h.d(1), h = o(d), h && (h.c(), h.m(e.parentNode, e))), c[0] & /*progress*/
      128 && t !== (t = /*p*/
      d[41].unit + "") && rn(n, t);
    },
    d(d) {
      d && (Me(e), Me(n), Me(r), Me(u)), h.d(d);
    }
  };
}
function V1(i) {
  let e = Oi(
    /*p*/
    i[41].index || 0
  ) + "", t;
  return {
    c() {
      t = rt(e);
    },
    l(n) {
      t = it(n, e);
    },
    m(n, r) {
      ze(n, t, r);
    },
    p(n, r) {
      r[0] & /*progress*/
      128 && e !== (e = Oi(
        /*p*/
        n[41].index || 0
      ) + "") && rn(t, e);
    },
    d(n) {
      n && Me(t);
    }
  };
}
function G1(i) {
  let e = Oi(
    /*p*/
    i[41].index || 0
  ) + "", t, n, r = Oi(
    /*p*/
    i[41].length
  ) + "", s;
  return {
    c() {
      t = rt(e), n = rt("/"), s = rt(r);
    },
    l(u) {
      t = it(u, e), n = it(u, "/"), s = it(u, r);
    },
    m(u, l) {
      ze(u, t, l), ze(u, n, l), ze(u, s, l);
    },
    p(u, l) {
      l[0] & /*progress*/
      128 && e !== (e = Oi(
        /*p*/
        u[41].index || 0
      ) + "") && rn(t, e), l[0] & /*progress*/
      128 && r !== (r = Oi(
        /*p*/
        u[41].length
      ) + "") && rn(s, r);
    },
    d(u) {
      u && (Me(t), Me(n), Me(s));
    }
  };
}
function Pl(i) {
  let e, t = (
    /*p*/
    i[41].index != null && Nl(i)
  );
  return {
    c() {
      t && t.c(), e = nn();
    },
    l(n) {
      t && t.l(n), e = nn();
    },
    m(n, r) {
      t && t.m(n, r), ze(n, e, r);
    },
    p(n, r) {
      /*p*/
      n[41].index != null ? t ? t.p(n, r) : (t = Nl(n), t.c(), t.m(e.parentNode, e)) : t && (t.d(1), t = null);
    },
    d(n) {
      n && Me(e), t && t.d(n);
    }
  };
}
function Bl(i) {
  let e, t = (
    /*eta*/
    i[0] ? `/${/*formatted_eta*/
    i[19]}` : ""
  ), n, r;
  return {
    c() {
      e = rt(
        /*formatted_timer*/
        i[20]
      ), n = rt(t), r = rt("s");
    },
    l(s) {
      e = it(
        s,
        /*formatted_timer*/
        i[20]
      ), n = it(s, t), r = it(s, "s");
    },
    m(s, u) {
      ze(s, e, u), ze(s, n, u), ze(s, r, u);
    },
    p(s, u) {
      u[0] & /*formatted_timer*/
      1048576 && rn(
        e,
        /*formatted_timer*/
        s[20]
      ), u[0] & /*eta, formatted_eta*/
      524289 && t !== (t = /*eta*/
      s[0] ? `/${/*formatted_eta*/
      s[19]}` : "") && rn(n, t);
    },
    d(s) {
      s && (Me(e), Me(n), Me(r));
    }
  };
}
function X1(i) {
  let e, t;
  return e = new D1({
    props: { margin: (
      /*variant*/
      i[8] === "default"
    ) }
  }), {
    c() {
      Hu(e.$$.fragment);
    },
    l(n) {
      Ou(e.$$.fragment, n);
    },
    m(n, r) {
      ju(e, n, r), t = !0;
    },
    p(n, r) {
      const s = {};
      r[0] & /*variant*/
      256 && (s.margin = /*variant*/
      n[8] === "default"), e.$set(s);
    },
    i(n) {
      t || (gn(e.$$.fragment, n), t = !0);
    },
    o(n) {
      Cn(e.$$.fragment, n), t = !1;
    },
    d(n) {
      Uu(e, n);
    }
  };
}
function j1(i) {
  let e, t, n, r, s, u = `${/*last_progress_level*/
  i[15] * 100}%`, l = (
    /*progress*/
    i[7] != null && zl(i)
  );
  return {
    c() {
      e = Tn("div"), t = Tn("div"), l && l.c(), n = en(), r = Tn("div"), s = Tn("div"), this.h();
    },
    l(o) {
      e = _n(o, "DIV", { class: !0 });
      var h = En(e);
      t = _n(h, "DIV", { class: !0 });
      var d = En(t);
      l && l.l(d), d.forEach(Me), n = Jt(h), r = _n(h, "DIV", { class: !0 });
      var c = En(r);
      s = _n(c, "DIV", { class: !0 }), En(s).forEach(Me), c.forEach(Me), h.forEach(Me), this.h();
    },
    h() {
      bn(t, "class", "progress-level-inner svelte-17v219f"), bn(s, "class", "progress-bar svelte-17v219f"), Qn(s, "width", u), bn(r, "class", "progress-bar-wrap svelte-17v219f"), bn(e, "class", "progress-level svelte-17v219f");
    },
    m(o, h) {
      ze(o, e, h), xi(e, t), l && l.m(t, null), xi(e, n), xi(e, r), xi(r, s), i[31](s);
    },
    p(o, h) {
      /*progress*/
      o[7] != null ? l ? l.p(o, h) : (l = zl(o), l.c(), l.m(t, null)) : l && (l.d(1), l = null), h[0] & /*last_progress_level*/
      32768 && u !== (u = `${/*last_progress_level*/
      o[15] * 100}%`) && Qn(s, "width", u);
    },
    i: Ma,
    o: Ma,
    d(o) {
      o && Me(e), l && l.d(), i[31](null);
    }
  };
}
function zl(i) {
  let e, t = us(
    /*progress*/
    i[7]
  ), n = [];
  for (let r = 0; r < t.length; r += 1)
    n[r] = Vl(Rl(i, t, r));
  return {
    c() {
      for (let r = 0; r < n.length; r += 1)
        n[r].c();
      e = nn();
    },
    l(r) {
      for (let s = 0; s < n.length; s += 1)
        n[s].l(r);
      e = nn();
    },
    m(r, s) {
      for (let u = 0; u < n.length; u += 1)
        n[u] && n[u].m(r, s);
      ze(r, e, s);
    },
    p(r, s) {
      if (s[0] & /*progress_level, progress*/
      16512) {
        t = us(
          /*progress*/
          r[7]
        );
        let u;
        for (u = 0; u < t.length; u += 1) {
          const l = Rl(r, t, u);
          n[u] ? n[u].p(l, s) : (n[u] = Vl(l), n[u].c(), n[u].m(e.parentNode, e));
        }
        for (; u < n.length; u += 1)
          n[u].d(1);
        n.length = t.length;
      }
    },
    d(r) {
      r && Me(e), Vu(n, r);
    }
  };
}
function Ol(i) {
  let e, t, n, r, s = (
    /*i*/
    i[43] !== 0 && Y1()
  ), u = (
    /*p*/
    i[41].desc != null && Hl(i)
  ), l = (
    /*p*/
    i[41].desc != null && /*progress_level*/
    i[14] && /*progress_level*/
    i[14][
      /*i*/
      i[43]
    ] != null && ql()
  ), o = (
    /*progress_level*/
    i[14] != null && Ul(i)
  );
  return {
    c() {
      s && s.c(), e = en(), u && u.c(), t = en(), l && l.c(), n = en(), o && o.c(), r = nn();
    },
    l(h) {
      s && s.l(h), e = Jt(h), u && u.l(h), t = Jt(h), l && l.l(h), n = Jt(h), o && o.l(h), r = nn();
    },
    m(h, d) {
      s && s.m(h, d), ze(h, e, d), u && u.m(h, d), ze(h, t, d), l && l.m(h, d), ze(h, n, d), o && o.m(h, d), ze(h, r, d);
    },
    p(h, d) {
      /*p*/
      h[41].desc != null ? u ? u.p(h, d) : (u = Hl(h), u.c(), u.m(t.parentNode, t)) : u && (u.d(1), u = null), /*p*/
      h[41].desc != null && /*progress_level*/
      h[14] && /*progress_level*/
      h[14][
        /*i*/
        h[43]
      ] != null ? l || (l = ql(), l.c(), l.m(n.parentNode, n)) : l && (l.d(1), l = null), /*progress_level*/
      h[14] != null ? o ? o.p(h, d) : (o = Ul(h), o.c(), o.m(r.parentNode, r)) : o && (o.d(1), o = null);
    },
    d(h) {
      h && (Me(e), Me(t), Me(n), Me(r)), s && s.d(h), u && u.d(h), l && l.d(h), o && o.d(h);
    }
  };
}
function Y1(i) {
  let e;
  return {
    c() {
      e = rt(" /");
    },
    l(t) {
      e = it(t, " /");
    },
    m(t, n) {
      ze(t, e, n);
    },
    d(t) {
      t && Me(e);
    }
  };
}
function Hl(i) {
  let e = (
    /*p*/
    i[41].desc + ""
  ), t;
  return {
    c() {
      t = rt(e);
    },
    l(n) {
      t = it(n, e);
    },
    m(n, r) {
      ze(n, t, r);
    },
    p(n, r) {
      r[0] & /*progress*/
      128 && e !== (e = /*p*/
      n[41].desc + "") && rn(t, e);
    },
    d(n) {
      n && Me(t);
    }
  };
}
function ql(i) {
  let e;
  return {
    c() {
      e = rt("-");
    },
    l(t) {
      e = it(t, "-");
    },
    m(t, n) {
      ze(t, e, n);
    },
    d(t) {
      t && Me(e);
    }
  };
}
function Ul(i) {
  let e = (100 * /*progress_level*/
  (i[14][
    /*i*/
    i[43]
  ] || 0)).toFixed(1) + "", t, n;
  return {
    c() {
      t = rt(e), n = rt("%");
    },
    l(r) {
      t = it(r, e), n = it(r, "%");
    },
    m(r, s) {
      ze(r, t, s), ze(r, n, s);
    },
    p(r, s) {
      s[0] & /*progress_level*/
      16384 && e !== (e = (100 * /*progress_level*/
      (r[14][
        /*i*/
        r[43]
      ] || 0)).toFixed(1) + "") && rn(t, e);
    },
    d(r) {
      r && (Me(t), Me(n));
    }
  };
}
function Vl(i) {
  let e, t = (
    /*p*/
    (i[41].desc != null || /*progress_level*/
    i[14] && /*progress_level*/
    i[14][
      /*i*/
      i[43]
    ] != null) && Ol(i)
  );
  return {
    c() {
      t && t.c(), e = nn();
    },
    l(n) {
      t && t.l(n), e = nn();
    },
    m(n, r) {
      t && t.m(n, r), ze(n, e, r);
    },
    p(n, r) {
      /*p*/
      n[41].desc != null || /*progress_level*/
      n[14] && /*progress_level*/
      n[14][
        /*i*/
        n[43]
      ] != null ? t ? t.p(n, r) : (t = Ol(n), t.c(), t.m(e.parentNode, e)) : t && (t.d(1), t = null);
    },
    d(n) {
      n && Me(e), t && t.d(n);
    }
  };
}
function Gl(i) {
  let e, t, n, r;
  const s = (
    /*#slots*/
    i[30]["additional-loading-text"]
  ), u = qu(
    s,
    i,
    /*$$scope*/
    i[29],
    Ml
  );
  return {
    c() {
      e = Tn("p"), t = rt(
        /*loading_text*/
        i[9]
      ), n = en(), u && u.c(), this.h();
    },
    l(l) {
      e = _n(l, "P", { class: !0 });
      var o = En(e);
      t = it(
        o,
        /*loading_text*/
        i[9]
      ), o.forEach(Me), n = Jt(l), u && u.l(l), this.h();
    },
    h() {
      bn(e, "class", "loading svelte-17v219f");
    },
    m(l, o) {
      ze(l, e, o), xi(e, t), ze(l, n, o), u && u.m(l, o), r = !0;
    },
    p(l, o) {
      (!r || o[0] & /*loading_text*/
      512) && rn(
        t,
        /*loading_text*/
        l[9]
      ), u && u.p && (!r || o[0] & /*$$scope*/
      536870912) && Yu(
        u,
        s,
        l,
        /*$$scope*/
        l[29],
        r ? Xu(
          s,
          /*$$scope*/
          l[29],
          o,
          B1
        ) : Gu(
          /*$$scope*/
          l[29]
        ),
        Ml
      );
    },
    i(l) {
      r || (gn(u, l), r = !0);
    },
    o(l) {
      Cn(u, l), r = !1;
    },
    d(l) {
      l && (Me(e), Me(n)), u && u.d(l);
    }
  };
}
function W1(i) {
  let e, t, n, r, s;
  const u = [O1, z1], l = [];
  function o(h, d) {
    return (
      /*status*/
      h[4] === "pending" ? 0 : (
        /*status*/
        h[4] === "error" ? 1 : -1
      )
    );
  }
  return ~(t = o(i)) && (n = l[t] = u[t](i)), {
    c() {
      e = Tn("div"), n && n.c(), this.h();
    },
    l(h) {
      e = _n(h, "DIV", { class: !0 });
      var d = En(e);
      n && n.l(d), d.forEach(Me), this.h();
    },
    h() {
      bn(e, "class", r = "wrap " + /*variant*/
      i[8] + " " + /*show_progress*/
      i[6] + " svelte-17v219f"), Kt(e, "hide", !/*status*/
      i[4] || /*status*/
      i[4] === "complete" || /*show_progress*/
      i[6] === "hidden" || /*status*/
      i[4] == "streaming"), Kt(
        e,
        "translucent",
        /*variant*/
        i[8] === "center" && /*status*/
        (i[4] === "pending" || /*status*/
        i[4] === "error") || /*translucent*/
        i[11] || /*show_progress*/
        i[6] === "minimal"
      ), Kt(
        e,
        "generating",
        /*status*/
        i[4] === "generating" && /*show_progress*/
        i[6] === "full"
      ), Kt(
        e,
        "border",
        /*border*/
        i[12]
      ), Qn(
        e,
        "position",
        /*absolute*/
        i[10] ? "absolute" : "static"
      ), Qn(
        e,
        "padding",
        /*absolute*/
        i[10] ? "0" : "var(--size-8) 0"
      );
    },
    m(h, d) {
      ze(h, e, d), ~t && l[t].m(e, null), i[33](e), s = !0;
    },
    p(h, d) {
      let c = t;
      t = o(h), t === c ? ~t && l[t].p(h, d) : (n && (Fa(), Cn(l[c], 1, 1, () => {
        l[c] = null;
      }), Da()), ~t ? (n = l[t], n ? n.p(h, d) : (n = l[t] = u[t](h), n.c()), gn(n, 1), n.m(e, null)) : n = null), (!s || d[0] & /*variant, show_progress*/
      320 && r !== (r = "wrap " + /*variant*/
      h[8] + " " + /*show_progress*/
      h[6] + " svelte-17v219f")) && bn(e, "class", r), (!s || d[0] & /*variant, show_progress, status, show_progress*/
      336) && Kt(e, "hide", !/*status*/
      h[4] || /*status*/
      h[4] === "complete" || /*show_progress*/
      h[6] === "hidden" || /*status*/
      h[4] == "streaming"), (!s || d[0] & /*variant, show_progress, variant, status, translucent, show_progress*/
      2384) && Kt(
        e,
        "translucent",
        /*variant*/
        h[8] === "center" && /*status*/
        (h[4] === "pending" || /*status*/
        h[4] === "error") || /*translucent*/
        h[11] || /*show_progress*/
        h[6] === "minimal"
      ), (!s || d[0] & /*variant, show_progress, status, show_progress*/
      336) && Kt(
        e,
        "generating",
        /*status*/
        h[4] === "generating" && /*show_progress*/
        h[6] === "full"
      ), (!s || d[0] & /*variant, show_progress, border*/
      4416) && Kt(
        e,
        "border",
        /*border*/
        h[12]
      ), d[0] & /*absolute*/
      1024 && Qn(
        e,
        "position",
        /*absolute*/
        h[10] ? "absolute" : "static"
      ), d[0] & /*absolute*/
      1024 && Qn(
        e,
        "padding",
        /*absolute*/
        h[10] ? "0" : "var(--size-8) 0"
      );
    },
    i(h) {
      s || (gn(n), s = !0);
    },
    o(h) {
      Cn(n), s = !1;
    },
    d(h) {
      h && Me(e), ~t && l[t].d(), i[33](null);
    }
  };
}
var $1 = function(i, e, t, n) {
  function r(s) {
    return s instanceof t ? s : new t(function(u) {
      u(s);
    });
  }
  return new (t || (t = Promise))(function(s, u) {
    function l(d) {
      try {
        h(n.next(d));
      } catch (c) {
        u(c);
      }
    }
    function o(d) {
      try {
        h(n.throw(d));
      } catch (c) {
        u(c);
      }
    }
    function h(d) {
      d.done ? s(d.value) : r(d.value).then(l, o);
    }
    h((n = n.apply(i, e || [])).next());
  });
};
let Ur = [], ca = !1;
const K1 = typeof window < "u", Wu = K1 ? window.requestAnimationFrame : (i) => {
};
function Z1(i) {
  return $1(this, arguments, void 0, function* (e, t = !0) {
    if (!(window.__gradio_mode__ === "website" || window.__gradio_mode__ !== "app" && t !== !0)) {
      if (Ur.push(e), !ca) ca = !0;
      else return;
      yield L1(), Wu(() => {
        let n = [0, 0];
        for (let r = 0; r < Ur.length; r++) {
          const u = Ur[r].getBoundingClientRect();
          (r === 0 || u.top + window.scrollY <= n[0]) && (n[0] = u.top + window.scrollY, n[1] = r);
        }
        window.scrollTo({ top: n[0] - 20, behavior: "smooth" }), ca = !1, Ur = [];
      });
    }
  });
}
function Q1(i, e, t) {
  let n, { $$slots: r = {}, $$scope: s } = e;
  this && this.__awaiter;
  const u = N1();
  let { i18n: l } = e, { eta: o = null } = e, { queue_position: h } = e, { queue_size: d } = e, { status: c } = e, { scroll_to_output: f = !1 } = e, { timer: g = !0 } = e, { show_progress: A = "full" } = e, { message: m = null } = e, { progress: k = null } = e, { variant: a = "default" } = e, { loading_text: p = "Loading..." } = e, { absolute: b = !0 } = e, { translucent: y = !1 } = e, { border: C = !1 } = e, { autoscroll: M } = e, L, P = !1, O = 0, q = 0, Y = null, se = null, me = 0, te = null, K, Z = null, oe = !0;
  const le = () => {
    t(0, o = t(27, Y = t(19, he = null))), t(25, O = performance.now()), t(26, q = 0), P = !0, ie();
  };
  function ie() {
    Wu(() => {
      t(26, q = (performance.now() - O) / 1e3), P && ie();
    });
  }
  function pe() {
    t(26, q = 0), t(0, o = t(27, Y = t(19, he = null))), P && (P = !1);
  }
  I1(() => {
    P && pe();
  });
  let he = null;
  function we(ae) {
    Dl[ae ? "unshift" : "push"](() => {
      Z = ae, t(16, Z), t(7, k), t(14, te), t(15, K);
    });
  }
  const ke = () => {
    u("clear_status");
  };
  function Ae(ae) {
    Dl[ae ? "unshift" : "push"](() => {
      L = ae, t(13, L);
    });
  }
  return i.$$set = (ae) => {
    "i18n" in ae && t(1, l = ae.i18n), "eta" in ae && t(0, o = ae.eta), "queue_position" in ae && t(2, h = ae.queue_position), "queue_size" in ae && t(3, d = ae.queue_size), "status" in ae && t(4, c = ae.status), "scroll_to_output" in ae && t(22, f = ae.scroll_to_output), "timer" in ae && t(5, g = ae.timer), "show_progress" in ae && t(6, A = ae.show_progress), "message" in ae && t(23, m = ae.message), "progress" in ae && t(7, k = ae.progress), "variant" in ae && t(8, a = ae.variant), "loading_text" in ae && t(9, p = ae.loading_text), "absolute" in ae && t(10, b = ae.absolute), "translucent" in ae && t(11, y = ae.translucent), "border" in ae && t(12, C = ae.border), "autoscroll" in ae && t(24, M = ae.autoscroll), "$$scope" in ae && t(29, s = ae.$$scope);
  }, i.$$.update = () => {
    i.$$.dirty[0] & /*eta, old_eta, timer_start, eta_from_start*/
    436207617 && (o === null && t(0, o = Y), o != null && Y !== o && (t(28, se = (performance.now() - O) / 1e3 + o), t(19, he = se.toFixed(1)), t(27, Y = o))), i.$$.dirty[0] & /*eta_from_start, timer_diff*/
    335544320 && t(17, me = se === null || se <= 0 || !q ? null : Math.min(q / se, 1)), i.$$.dirty[0] & /*progress*/
    128 && k != null && t(18, oe = !1), i.$$.dirty[0] & /*progress, progress_level, progress_bar, last_progress_level*/
    114816 && (k != null ? t(14, te = k.map((ae) => {
      if (ae.index != null && ae.length != null)
        return ae.index / ae.length;
      if (ae.progress != null)
        return ae.progress;
    })) : t(14, te = null), te ? (t(15, K = te[te.length - 1]), Z && (K === 0 ? t(16, Z.style.transition = "0", Z) : t(16, Z.style.transition = "150ms", Z))) : t(15, K = void 0)), i.$$.dirty[0] & /*status*/
    16 && (c === "pending" ? le() : pe()), i.$$.dirty[0] & /*el, scroll_to_output, status, autoscroll*/
    20979728 && L && f && (c === "pending" || c === "complete") && Z1(L, M), i.$$.dirty[0] & /*status, message*/
    8388624, i.$$.dirty[0] & /*timer_diff*/
    67108864 && t(20, n = q.toFixed(1));
  }, [
    o,
    l,
    h,
    d,
    c,
    g,
    A,
    k,
    a,
    p,
    b,
    y,
    C,
    L,
    te,
    K,
    Z,
    me,
    oe,
    he,
    n,
    u,
    f,
    m,
    M,
    O,
    q,
    Y,
    se,
    s,
    r,
    we,
    ke,
    Ae
  ];
}
class J1 extends F1 {
  constructor(e) {
    super(), M1(
      this,
      e,
      Q1,
      W1,
      R1,
      {
        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.1.7 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.7/LICENSE */
const {
  entries: $u,
  setPrototypeOf: Xl,
  isFrozen: em,
  getPrototypeOf: tm,
  getOwnPropertyDescriptor: nm
} = Object;
let {
  freeze: _t,
  seal: sn,
  create: Ku
} = Object, {
  apply: Ra,
  construct: La
} = typeof Reflect < "u" && Reflect;
_t || (_t = function(e) {
  return e;
});
sn || (sn = function(e) {
  return e;
});
Ra || (Ra = function(e, t, n) {
  return e.apply(t, n);
});
La || (La = function(e, t) {
  return new e(...t);
});
const Vr = Ut(Array.prototype.forEach), jl = Ut(Array.prototype.pop), rr = Ut(Array.prototype.push), es = Ut(String.prototype.toLowerCase), ha = Ut(String.prototype.toString), Yl = Ut(String.prototype.match), sr = Ut(String.prototype.replace), im = Ut(String.prototype.indexOf), rm = Ut(String.prototype.trim), fn = Ut(Object.prototype.hasOwnProperty), xt = Ut(RegExp.prototype.test), ar = sm(TypeError);
function Ut(i) {
  return function(e) {
    for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), r = 1; r < t; r++)
      n[r - 1] = arguments[r];
    return Ra(i, e, n);
  };
}
function sm(i) {
  return function() {
    for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
      t[n] = arguments[n];
    return La(i, t);
  };
}
function Ue(i, e) {
  let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : es;
  Xl && Xl(i, null);
  let n = e.length;
  for (; n--; ) {
    let r = e[n];
    if (typeof r == "string") {
      const s = t(r);
      s !== r && (em(e) || (e[n] = s), r = s);
    }
    i[r] = !0;
  }
  return i;
}
function am(i) {
  for (let e = 0; e < i.length; e++)
    fn(i, e) || (i[e] = null);
  return i;
}
function yi(i) {
  const e = Ku(null);
  for (const [t, n] of $u(i))
    fn(i, t) && (Array.isArray(n) ? e[t] = am(n) : n && typeof n == "object" && n.constructor === Object ? e[t] = yi(n) : e[t] = n);
  return e;
}
function or(i, e) {
  for (; i !== null; ) {
    const n = nm(i, e);
    if (n) {
      if (n.get)
        return Ut(n.get);
      if (typeof n.value == "function")
        return Ut(n.value);
    }
    i = tm(i);
  }
  function t() {
    return null;
  }
  return t;
}
const Wl = _t(["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"]), da = _t(["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"]), fa = _t(["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"]), om = _t(["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"]), ma = _t(["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"]), lm = _t(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), $l = _t(["#text"]), Kl = _t(["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"]), pa = _t(["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"]), Zl = _t(["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"]), Gr = _t(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), um = sn(/\{\{[\w\W]*|[\w\W]*\}\}/gm), cm = sn(/<%[\w\W]*|[\w\W]*%>/gm), hm = sn(/\${[\w\W]*}/gm), dm = sn(/^data-[\-\w.\u00B7-\uFFFF]/), fm = sn(/^aria-[\-\w]+$/), Zu = sn(
  /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
  // eslint-disable-line no-useless-escape
), mm = sn(/^(?:\w+script|data):/i), pm = sn(
  /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
  // eslint-disable-line no-control-regex
), Qu = sn(/^html$/i), gm = sn(/^[a-z][.\w]*(-[.\w]+)+$/i);
var Ql = /* @__PURE__ */ Object.freeze({
  __proto__: null,
  MUSTACHE_EXPR: um,
  ERB_EXPR: cm,
  TMPLIT_EXPR: hm,
  DATA_ATTR: dm,
  ARIA_ATTR: fm,
  IS_ALLOWED_URI: Zu,
  IS_SCRIPT_OR_DATA: mm,
  ATTR_WHITESPACE: pm,
  DOCTYPE_NAME: Qu,
  CUSTOM_ELEMENT: gm
});
const lr = {
  element: 1,
  attribute: 2,
  text: 3,
  cdataSection: 4,
  entityReference: 5,
  // Deprecated
  entityNode: 6,
  // Deprecated
  progressingInstruction: 7,
  comment: 8,
  document: 9,
  documentType: 10,
  documentFragment: 11,
  notation: 12
  // Deprecated
}, bm = function() {
  return typeof window > "u" ? null : window;
}, vm = function(e, t) {
  if (typeof e != "object" || typeof e.createPolicy != "function")
    return null;
  let n = null;
  const r = "data-tt-policy-suffix";
  t && t.hasAttribute(r) && (n = t.getAttribute(r));
  const s = "dompurify" + (n ? "#" + n : "");
  try {
    return e.createPolicy(s, {
      createHTML(u) {
        return u;
      },
      createScriptURL(u) {
        return u;
      }
    });
  } catch {
    return console.warn("TrustedTypes policy " + s + " could not be created."), null;
  }
};
function Ju() {
  let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : bm();
  const e = (Fe) => Ju(Fe);
  if (e.version = "3.1.7", e.removed = [], !i || !i.document || i.document.nodeType !== lr.document)
    return e.isSupported = !1, e;
  let {
    document: t
  } = i;
  const n = t, r = n.currentScript, {
    DocumentFragment: s,
    HTMLTemplateElement: u,
    Node: l,
    Element: o,
    NodeFilter: h,
    NamedNodeMap: d = i.NamedNodeMap || i.MozNamedAttrMap,
    HTMLFormElement: c,
    DOMParser: f,
    trustedTypes: g
  } = i, A = o.prototype, m = or(A, "cloneNode"), k = or(A, "remove"), a = or(A, "nextSibling"), p = or(A, "childNodes"), b = or(A, "parentNode");
  if (typeof u == "function") {
    const Fe = t.createElement("template");
    Fe.content && Fe.content.ownerDocument && (t = Fe.content.ownerDocument);
  }
  let y, C = "";
  const {
    implementation: M,
    createNodeIterator: L,
    createDocumentFragment: P,
    getElementsByTagName: O
  } = t, {
    importNode: q
  } = n;
  let Y = {};
  e.isSupported = typeof $u == "function" && typeof b == "function" && M && M.createHTMLDocument !== void 0;
  const {
    MUSTACHE_EXPR: se,
    ERB_EXPR: me,
    TMPLIT_EXPR: te,
    DATA_ATTR: K,
    ARIA_ATTR: Z,
    IS_SCRIPT_OR_DATA: oe,
    ATTR_WHITESPACE: le,
    CUSTOM_ELEMENT: ie
  } = Ql;
  let {
    IS_ALLOWED_URI: pe
  } = Ql, he = null;
  const we = Ue({}, [...Wl, ...da, ...fa, ...ma, ...$l]);
  let ke = null;
  const Ae = Ue({}, [...Kl, ...pa, ...Zl, ...Gr]);
  let ae = Object.seal(Ku(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
    }
  })), de = null, R = null, D = !0, v = !0, S = !1, E = !0, _ = !1, x = !0, F = !1, I = !1, B = !1, H = !1, V = !1, $ = !1, X = !0, G = !1;
  const U = "user-content-";
  let ee = !0, fe = !1, re = {}, ue = null;
  const _e = Ue({}, ["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 ve = null;
  const be = Ue({}, ["audio", "video", "img", "source", "image", "track"]);
  let xe = null;
  const De = Ue({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), Oe = "http://www.w3.org/1998/Math/MathML", Ve = "http://www.w3.org/2000/svg", Ge = "http://www.w3.org/1999/xhtml";
  let He = Ge, Ct = !1, ht = null;
  const Dt = Ue({}, [Oe, Ve, Ge], ha);
  let Ze = null;
  const bt = ["application/xhtml+xml", "text/html"], an = "text/html";
  let Qe = null, Xt = null;
  const Ii = t.createElement("form"), Ln = function(J) {
    return J instanceof RegExp || J instanceof Function;
  }, ft = function() {
    let J = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
    if (!(Xt && Xt === J)) {
      if ((!J || typeof J != "object") && (J = {}), J = yi(J), Ze = // eslint-disable-next-line unicorn/prefer-includes
      bt.indexOf(J.PARSER_MEDIA_TYPE) === -1 ? an : J.PARSER_MEDIA_TYPE, Qe = Ze === "application/xhtml+xml" ? ha : es, he = fn(J, "ALLOWED_TAGS") ? Ue({}, J.ALLOWED_TAGS, Qe) : we, ke = fn(J, "ALLOWED_ATTR") ? Ue({}, J.ALLOWED_ATTR, Qe) : Ae, ht = fn(J, "ALLOWED_NAMESPACES") ? Ue({}, J.ALLOWED_NAMESPACES, ha) : Dt, xe = fn(J, "ADD_URI_SAFE_ATTR") ? Ue(
        yi(De),
        // eslint-disable-line indent
        J.ADD_URI_SAFE_ATTR,
        // eslint-disable-line indent
        Qe
        // eslint-disable-line indent
      ) : De, ve = fn(J, "ADD_DATA_URI_TAGS") ? Ue(
        yi(be),
        // eslint-disable-line indent
        J.ADD_DATA_URI_TAGS,
        // eslint-disable-line indent
        Qe
        // eslint-disable-line indent
      ) : be, ue = fn(J, "FORBID_CONTENTS") ? Ue({}, J.FORBID_CONTENTS, Qe) : _e, de = fn(J, "FORBID_TAGS") ? Ue({}, J.FORBID_TAGS, Qe) : {}, R = fn(J, "FORBID_ATTR") ? Ue({}, J.FORBID_ATTR, Qe) : {}, re = fn(J, "USE_PROFILES") ? J.USE_PROFILES : !1, D = J.ALLOW_ARIA_ATTR !== !1, v = J.ALLOW_DATA_ATTR !== !1, S = J.ALLOW_UNKNOWN_PROTOCOLS || !1, E = J.ALLOW_SELF_CLOSE_IN_ATTR !== !1, _ = J.SAFE_FOR_TEMPLATES || !1, x = J.SAFE_FOR_XML !== !1, F = J.WHOLE_DOCUMENT || !1, H = J.RETURN_DOM || !1, V = J.RETURN_DOM_FRAGMENT || !1, $ = J.RETURN_TRUSTED_TYPE || !1, B = J.FORCE_BODY || !1, X = J.SANITIZE_DOM !== !1, G = J.SANITIZE_NAMED_PROPS || !1, ee = J.KEEP_CONTENT !== !1, fe = J.IN_PLACE || !1, pe = J.ALLOWED_URI_REGEXP || Zu, He = J.NAMESPACE || Ge, ae = J.CUSTOM_ELEMENT_HANDLING || {}, J.CUSTOM_ELEMENT_HANDLING && Ln(J.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (ae.tagNameCheck = J.CUSTOM_ELEMENT_HANDLING.tagNameCheck), J.CUSTOM_ELEMENT_HANDLING && Ln(J.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (ae.attributeNameCheck = J.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), J.CUSTOM_ELEMENT_HANDLING && typeof J.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (ae.allowCustomizedBuiltInElements = J.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), _ && (v = !1), V && (H = !0), re && (he = Ue({}, $l), ke = [], re.html === !0 && (Ue(he, Wl), Ue(ke, Kl)), re.svg === !0 && (Ue(he, da), Ue(ke, pa), Ue(ke, Gr)), re.svgFilters === !0 && (Ue(he, fa), Ue(ke, pa), Ue(ke, Gr)), re.mathMl === !0 && (Ue(he, ma), Ue(ke, Zl), Ue(ke, Gr))), J.ADD_TAGS && (he === we && (he = yi(he)), Ue(he, J.ADD_TAGS, Qe)), J.ADD_ATTR && (ke === Ae && (ke = yi(ke)), Ue(ke, J.ADD_ATTR, Qe)), J.ADD_URI_SAFE_ATTR && Ue(xe, J.ADD_URI_SAFE_ATTR, Qe), J.FORBID_CONTENTS && (ue === _e && (ue = yi(ue)), Ue(ue, J.FORBID_CONTENTS, Qe)), ee && (he["#text"] = !0), F && Ue(he, ["html", "head", "body"]), he.table && (Ue(he, ["tbody"]), delete de.tbody), J.TRUSTED_TYPES_POLICY) {
        if (typeof J.TRUSTED_TYPES_POLICY.createHTML != "function")
          throw ar('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
        if (typeof J.TRUSTED_TYPES_POLICY.createScriptURL != "function")
          throw ar('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
        y = J.TRUSTED_TYPES_POLICY, C = y.createHTML("");
      } else
        y === void 0 && (y = vm(g, r)), y !== null && typeof C == "string" && (C = y.createHTML(""));
      _t && _t(J), Xt = J;
    }
  }, ut = Ue({}, ["mi", "mo", "mn", "ms", "mtext"]), ui = Ue({}, ["annotation-xml"]), ci = Ue({}, ["title", "style", "font", "a", "script"]), In = Ue({}, [...da, ...fa, ...om]), at = Ue({}, [...ma, ...lm]), hi = function(J) {
    let ye = b(J);
    (!ye || !ye.tagName) && (ye = {
      namespaceURI: He,
      tagName: "template"
    });
    const Ce = es(J.tagName), Ke = es(ye.tagName);
    return ht[J.namespaceURI] ? J.namespaceURI === Ve ? ye.namespaceURI === Ge ? Ce === "svg" : ye.namespaceURI === Oe ? Ce === "svg" && (Ke === "annotation-xml" || ut[Ke]) : !!In[Ce] : J.namespaceURI === Oe ? ye.namespaceURI === Ge ? Ce === "math" : ye.namespaceURI === Ve ? Ce === "math" && ui[Ke] : !!at[Ce] : J.namespaceURI === Ge ? ye.namespaceURI === Ve && !ui[Ke] || ye.namespaceURI === Oe && !ut[Ke] ? !1 : !at[Ce] && (ci[Ce] || !In[Ce]) : !!(Ze === "application/xhtml+xml" && ht[J.namespaceURI]) : !1;
  }, jt = function(J) {
    rr(e.removed, {
      element: J
    });
    try {
      b(J).removeChild(J);
    } catch {
      k(J);
    }
  }, Xn = function(J, ye) {
    try {
      rr(e.removed, {
        attribute: ye.getAttributeNode(J),
        from: ye
      });
    } catch {
      rr(e.removed, {
        attribute: null,
        from: ye
      });
    }
    if (ye.removeAttribute(J), J === "is" && !ke[J])
      if (H || V)
        try {
          jt(ye);
        } catch {
        }
      else
        try {
          ye.setAttribute(J, "");
        } catch {
        }
  }, jn = function(J) {
    let ye = null, Ce = null;
    if (B)
      J = "<remove></remove>" + J;
    else {
      const mt = Yl(J, /^[\r\n\t ]+/);
      Ce = mt && mt[0];
    }
    Ze === "application/xhtml+xml" && He === Ge && (J = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + J + "</body></html>");
    const Ke = y ? y.createHTML(J) : J;
    if (He === Ge)
      try {
        ye = new f().parseFromString(Ke, Ze);
      } catch {
      }
    if (!ye || !ye.documentElement) {
      ye = M.createDocument(He, "template", null);
      try {
        ye.documentElement.innerHTML = Ct ? C : Ke;
      } catch {
      }
    }
    const vt = ye.body || ye.documentElement;
    return J && Ce && vt.insertBefore(t.createTextNode(Ce), vt.childNodes[0] || null), He === Ge ? O.call(ye, F ? "html" : "body")[0] : F ? ye.documentElement : vt;
  }, Ni = function(J) {
    return L.call(
      J.ownerDocument || J,
      J,
      // eslint-disable-next-line no-bitwise
      h.SHOW_ELEMENT | h.SHOW_COMMENT | h.SHOW_TEXT | h.SHOW_PROCESSING_INSTRUCTION | h.SHOW_CDATA_SECTION,
      null
    );
  }, on = function(J) {
    return J instanceof c && (typeof J.nodeName != "string" || typeof J.textContent != "string" || typeof J.removeChild != "function" || !(J.attributes instanceof d) || typeof J.removeAttribute != "function" || typeof J.setAttribute != "function" || typeof J.namespaceURI != "string" || typeof J.insertBefore != "function" || typeof J.hasChildNodes != "function");
  }, Ms = function(J) {
    return typeof l == "function" && J instanceof l;
  }, Nn = function(J, ye, Ce) {
    Y[J] && Vr(Y[J], (Ke) => {
      Ke.call(e, ye, Ce, Xt);
    });
  }, wo = function(J) {
    let ye = null;
    if (Nn("beforeSanitizeElements", J, null), on(J))
      return jt(J), !0;
    const Ce = Qe(J.nodeName);
    if (Nn("uponSanitizeElement", J, {
      tagName: Ce,
      allowedTags: he
    }), J.hasChildNodes() && !Ms(J.firstElementChild) && xt(/<[/\w]/g, J.innerHTML) && xt(/<[/\w]/g, J.textContent) || J.nodeType === lr.progressingInstruction || x && J.nodeType === lr.comment && xt(/<[/\w]/g, J.data))
      return jt(J), !0;
    if (!he[Ce] || de[Ce]) {
      if (!de[Ce] && ko(Ce) && (ae.tagNameCheck instanceof RegExp && xt(ae.tagNameCheck, Ce) || ae.tagNameCheck instanceof Function && ae.tagNameCheck(Ce)))
        return !1;
      if (ee && !ue[Ce]) {
        const Ke = b(J) || J.parentNode, vt = p(J) || J.childNodes;
        if (vt && Ke) {
          const mt = vt.length;
          for (let Ft = mt - 1; Ft >= 0; --Ft) {
            const vn = m(vt[Ft], !0);
            vn.__removalCount = (J.__removalCount || 0) + 1, Ke.insertBefore(vn, a(J));
          }
        }
      }
      return jt(J), !0;
    }
    return J instanceof o && !hi(J) || (Ce === "noscript" || Ce === "noembed" || Ce === "noframes") && xt(/<\/no(script|embed|frames)/i, J.innerHTML) ? (jt(J), !0) : (_ && J.nodeType === lr.text && (ye = J.textContent, Vr([se, me, te], (Ke) => {
      ye = sr(ye, Ke, " ");
    }), J.textContent !== ye && (rr(e.removed, {
      element: J.cloneNode()
    }), J.textContent = ye)), Nn("afterSanitizeElements", J, null), !1);
  }, Ao = function(J, ye, Ce) {
    if (X && (ye === "id" || ye === "name") && (Ce in t || Ce in Ii))
      return !1;
    if (!(v && !R[ye] && xt(K, ye))) {
      if (!(D && xt(Z, ye))) {
        if (!ke[ye] || R[ye]) {
          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
            !(ko(J) && (ae.tagNameCheck instanceof RegExp && xt(ae.tagNameCheck, J) || ae.tagNameCheck instanceof Function && ae.tagNameCheck(J)) && (ae.attributeNameCheck instanceof RegExp && xt(ae.attributeNameCheck, ye) || ae.attributeNameCheck instanceof Function && ae.attributeNameCheck(ye)) || // Alternative, second condition checks if it's an `is`-attribute, AND
            // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
            ye === "is" && ae.allowCustomizedBuiltInElements && (ae.tagNameCheck instanceof RegExp && xt(ae.tagNameCheck, Ce) || ae.tagNameCheck instanceof Function && ae.tagNameCheck(Ce)))
          ) return !1;
        } else if (!xe[ye]) {
          if (!xt(pe, sr(Ce, le, ""))) {
            if (!((ye === "src" || ye === "xlink:href" || ye === "href") && J !== "script" && im(Ce, "data:") === 0 && ve[J])) {
              if (!(S && !xt(oe, sr(Ce, le, "")))) {
                if (Ce)
                  return !1;
              }
            }
          }
        }
      }
    }
    return !0;
  }, ko = function(J) {
    return J !== "annotation-xml" && Yl(J, ie);
  }, So = function(J) {
    Nn("beforeSanitizeAttributes", J, null);
    const {
      attributes: ye
    } = J;
    if (!ye)
      return;
    const Ce = {
      attrName: "",
      attrValue: "",
      keepAttr: !0,
      allowedAttributes: ke
    };
    let Ke = ye.length;
    for (; Ke--; ) {
      const vt = ye[Ke], {
        name: mt,
        namespaceURI: Ft,
        value: vn
      } = vt, er = Qe(mt);
      let kt = mt === "value" ? vn : rm(vn);
      if (Ce.attrName = er, Ce.attrValue = kt, Ce.keepAttr = !0, Ce.forceKeepAttr = void 0, Nn("uponSanitizeAttribute", J, Ce), kt = Ce.attrValue, Ce.forceKeepAttr || (Xn(mt, J), !Ce.keepAttr))
        continue;
      if (!E && xt(/\/>/i, kt)) {
        Xn(mt, J);
        continue;
      }
      _ && Vr([se, me, te], (Eo) => {
        kt = sr(kt, Eo, " ");
      });
      const xo = Qe(J.nodeName);
      if (Ao(xo, er, kt)) {
        if (G && (er === "id" || er === "name") && (Xn(mt, J), kt = U + kt), x && xt(/((--!?|])>)|<\/(style|title)/i, kt)) {
          Xn(mt, J);
          continue;
        }
        if (y && typeof g == "object" && typeof g.getAttributeType == "function" && !Ft)
          switch (g.getAttributeType(xo, er)) {
            case "TrustedHTML": {
              kt = y.createHTML(kt);
              break;
            }
            case "TrustedScriptURL": {
              kt = y.createScriptURL(kt);
              break;
            }
          }
        try {
          Ft ? J.setAttributeNS(Ft, mt, kt) : J.setAttribute(mt, kt), on(J) ? jt(J) : jl(e.removed);
        } catch {
        }
      }
    }
    Nn("afterSanitizeAttributes", J, null);
  }, _c = function Fe(J) {
    let ye = null;
    const Ce = Ni(J);
    for (Nn("beforeSanitizeShadowDOM", J, null); ye = Ce.nextNode(); )
      Nn("uponSanitizeShadowNode", ye, null), !wo(ye) && (ye.content instanceof s && Fe(ye.content), So(ye));
    Nn("afterSanitizeShadowDOM", J, null);
  };
  return e.sanitize = function(Fe) {
    let J = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, ye = null, Ce = null, Ke = null, vt = null;
    if (Ct = !Fe, Ct && (Fe = "<!-->"), typeof Fe != "string" && !Ms(Fe))
      if (typeof Fe.toString == "function") {
        if (Fe = Fe.toString(), typeof Fe != "string")
          throw ar("dirty is not a string, aborting");
      } else
        throw ar("toString is not a function");
    if (!e.isSupported)
      return Fe;
    if (I || ft(J), e.removed = [], typeof Fe == "string" && (fe = !1), fe) {
      if (Fe.nodeName) {
        const vn = Qe(Fe.nodeName);
        if (!he[vn] || de[vn])
          throw ar("root node is forbidden and cannot be sanitized in-place");
      }
    } else if (Fe instanceof l)
      ye = jn("<!---->"), Ce = ye.ownerDocument.importNode(Fe, !0), Ce.nodeType === lr.element && Ce.nodeName === "BODY" || Ce.nodeName === "HTML" ? ye = Ce : ye.appendChild(Ce);
    else {
      if (!H && !_ && !F && // eslint-disable-next-line unicorn/prefer-includes
      Fe.indexOf("<") === -1)
        return y && $ ? y.createHTML(Fe) : Fe;
      if (ye = jn(Fe), !ye)
        return H ? null : $ ? C : "";
    }
    ye && B && jt(ye.firstChild);
    const mt = Ni(fe ? Fe : ye);
    for (; Ke = mt.nextNode(); )
      wo(Ke) || (Ke.content instanceof s && _c(Ke.content), So(Ke));
    if (fe)
      return Fe;
    if (H) {
      if (V)
        for (vt = P.call(ye.ownerDocument); ye.firstChild; )
          vt.appendChild(ye.firstChild);
      else
        vt = ye;
      return (ke.shadowroot || ke.shadowrootmode) && (vt = q.call(n, vt, !0)), vt;
    }
    let Ft = F ? ye.outerHTML : ye.innerHTML;
    return F && he["!doctype"] && ye.ownerDocument && ye.ownerDocument.doctype && ye.ownerDocument.doctype.name && xt(Qu, ye.ownerDocument.doctype.name) && (Ft = "<!DOCTYPE " + ye.ownerDocument.doctype.name + `>
` + Ft), _ && Vr([se, me, te], (vn) => {
      Ft = sr(Ft, vn, " ");
    }), y && $ ? y.createHTML(Ft) : Ft;
  }, e.setConfig = function() {
    let Fe = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
    ft(Fe), I = !0;
  }, e.clearConfig = function() {
    Xt = null, I = !1;
  }, e.isValidAttribute = function(Fe, J, ye) {
    Xt || ft({});
    const Ce = Qe(Fe), Ke = Qe(J);
    return Ao(Ce, Ke, ye);
  }, e.addHook = function(Fe, J) {
    typeof J == "function" && (Y[Fe] = Y[Fe] || [], rr(Y[Fe], J));
  }, e.removeHook = function(Fe) {
    if (Y[Fe])
      return jl(Y[Fe]);
  }, e.removeHooks = function(Fe) {
    Y[Fe] && (Y[Fe] = []);
  }, e.removeAllHooks = function() {
    Y = {};
  }, e;
}
Ju();
const {
  SvelteComponent: ym,
  append_hydration: ga,
  attr: Xr,
  children: Jl,
  claim_component: wm,
  claim_element: e0,
  claim_space: Am,
  claim_text: km,
  create_component: Sm,
  destroy_component: xm,
  detach: ba,
  element: t0,
  init: Em,
  insert_hydration: _m,
  mount_component: Tm,
  safe_not_equal: Cm,
  set_data: Dm,
  space: Fm,
  text: Mm,
  toggle_class: $n,
  transition_in: Rm,
  transition_out: Lm
} = window.__gradio__svelte__internal;
function Im(i) {
  let e, t, n, r, s, u;
  return n = new /*Icon*/
  i[1]({}), {
    c() {
      e = t0("label"), t = t0("span"), Sm(n.$$.fragment), r = Fm(), s = Mm(
        /*label*/
        i[0]
      ), this.h();
    },
    l(l) {
      e = e0(l, "LABEL", {
        for: !0,
        "data-testid": !0,
        class: !0
      });
      var o = Jl(e);
      t = e0(o, "SPAN", { class: !0 });
      var h = Jl(t);
      wm(n.$$.fragment, h), h.forEach(ba), r = Am(o), s = km(
        o,
        /*label*/
        i[0]
      ), o.forEach(ba), this.h();
    },
    h() {
      Xr(t, "class", "svelte-168uj4v"), Xr(e, "for", ""), Xr(e, "data-testid", "block-label"), Xr(e, "class", "svelte-168uj4v"), $n(e, "hide", !/*show_label*/
      i[2]), $n(e, "sr-only", !/*show_label*/
      i[2]), $n(
        e,
        "float",
        /*float*/
        i[4]
      ), $n(
        e,
        "hide-label",
        /*disable*/
        i[3]
      );
    },
    m(l, o) {
      _m(l, e, o), ga(e, t), Tm(n, t, null), ga(e, r), ga(e, s), u = !0;
    },
    p(l, [o]) {
      (!u || o & /*label*/
      1) && Dm(
        s,
        /*label*/
        l[0]
      ), (!u || o & /*show_label*/
      4) && $n(e, "hide", !/*show_label*/
      l[2]), (!u || o & /*show_label*/
      4) && $n(e, "sr-only", !/*show_label*/
      l[2]), (!u || o & /*float*/
      16) && $n(
        e,
        "float",
        /*float*/
        l[4]
      ), (!u || o & /*disable*/
      8) && $n(
        e,
        "hide-label",
        /*disable*/
        l[3]
      );
    },
    i(l) {
      u || (Rm(n.$$.fragment, l), u = !0);
    },
    o(l) {
      Lm(n.$$.fragment, l), u = !1;
    },
    d(l) {
      l && ba(e), xm(n);
    }
  };
}
function Nm(i, e, t) {
  let { label: n = null } = e, { Icon: r } = e, { show_label: s = !0 } = e, { disable: u = !1 } = e, { float: l = !0 } = e;
  return i.$$set = (o) => {
    "label" in o && t(0, n = o.label), "Icon" in o && t(1, r = o.Icon), "show_label" in o && t(2, s = o.show_label), "disable" in o && t(3, u = o.disable), "float" in o && t(4, l = o.float);
  }, [n, r, s, u, l];
}
class Pm extends ym {
  constructor(e) {
    super(), Em(this, e, Nm, Im, Cm, {
      label: 0,
      Icon: 1,
      show_label: 2,
      disable: 3,
      float: 4
    });
  }
}
const {
  SvelteComponent: Bm,
  append_hydration: Ia,
  attr: Bn,
  bubble: zm,
  check_outros: Om,
  children: Na,
  claim_component: Hm,
  claim_element: Pa,
  claim_space: qm,
  claim_text: Um,
  construct_svelte_component: n0,
  create_component: i0,
  destroy_component: r0,
  detach: pr,
  element: Ba,
  group_outros: Vm,
  init: Gm,
  insert_hydration: ec,
  listen: Xm,
  mount_component: s0,
  safe_not_equal: jm,
  set_data: Ym,
  set_style: jr,
  space: Wm,
  text: $m,
  toggle_class: Mt,
  transition_in: a0,
  transition_out: o0
} = window.__gradio__svelte__internal;
function l0(i) {
  let e, t;
  return {
    c() {
      e = Ba("span"), t = $m(
        /*label*/
        i[1]
      ), this.h();
    },
    l(n) {
      e = Pa(n, "SPAN", { class: !0 });
      var r = Na(e);
      t = Um(
        r,
        /*label*/
        i[1]
      ), r.forEach(pr), this.h();
    },
    h() {
      Bn(e, "class", "svelte-vk34kx");
    },
    m(n, r) {
      ec(n, e, r), Ia(e, t);
    },
    p(n, r) {
      r & /*label*/
      2 && Ym(
        t,
        /*label*/
        n[1]
      );
    },
    d(n) {
      n && pr(e);
    }
  };
}
function Km(i) {
  let e, t, n, r, s, u, l, o = (
    /*show_label*/
    i[2] && l0(i)
  );
  var h = (
    /*Icon*/
    i[0]
  );
  function d(c, f) {
    return {};
  }
  return h && (r = n0(h, d())), {
    c() {
      e = Ba("button"), o && o.c(), t = Wm(), n = Ba("div"), r && i0(r.$$.fragment), this.h();
    },
    l(c) {
      e = Pa(c, "BUTTON", {
        "aria-label": !0,
        "aria-haspopup": !0,
        title: !0,
        class: !0
      });
      var f = Na(e);
      o && o.l(f), t = qm(f), n = Pa(f, "DIV", { class: !0 });
      var g = Na(n);
      r && Hm(r.$$.fragment, g), g.forEach(pr), f.forEach(pr), this.h();
    },
    h() {
      Bn(n, "class", "svelte-vk34kx"), Mt(
        n,
        "small",
        /*size*/
        i[4] === "small"
      ), Mt(
        n,
        "large",
        /*size*/
        i[4] === "large"
      ), Mt(
        n,
        "medium",
        /*size*/
        i[4] === "medium"
      ), e.disabled = /*disabled*/
      i[7], Bn(
        e,
        "aria-label",
        /*label*/
        i[1]
      ), Bn(
        e,
        "aria-haspopup",
        /*hasPopup*/
        i[8]
      ), Bn(
        e,
        "title",
        /*label*/
        i[1]
      ), Bn(e, "class", "svelte-vk34kx"), Mt(
        e,
        "pending",
        /*pending*/
        i[3]
      ), Mt(
        e,
        "padded",
        /*padded*/
        i[5]
      ), Mt(
        e,
        "highlight",
        /*highlight*/
        i[6]
      ), Mt(
        e,
        "transparent",
        /*transparent*/
        i[9]
      ), jr(e, "color", !/*disabled*/
      i[7] && /*_color*/
      i[11] ? (
        /*_color*/
        i[11]
      ) : "var(--block-label-text-color)"), jr(e, "--bg-color", /*disabled*/
      i[7] ? "auto" : (
        /*background*/
        i[10]
      ));
    },
    m(c, f) {
      ec(c, e, f), o && o.m(e, null), Ia(e, t), Ia(e, n), r && s0(r, n, null), s = !0, u || (l = Xm(
        e,
        "click",
        /*click_handler*/
        i[13]
      ), u = !0);
    },
    p(c, [f]) {
      if (/*show_label*/
      c[2] ? o ? o.p(c, f) : (o = l0(c), o.c(), o.m(e, t)) : o && (o.d(1), o = null), f & /*Icon*/
      1 && h !== (h = /*Icon*/
      c[0])) {
        if (r) {
          Vm();
          const g = r;
          o0(g.$$.fragment, 1, 0, () => {
            r0(g, 1);
          }), Om();
        }
        h ? (r = n0(h, d()), i0(r.$$.fragment), a0(r.$$.fragment, 1), s0(r, n, null)) : r = null;
      }
      (!s || f & /*size*/
      16) && Mt(
        n,
        "small",
        /*size*/
        c[4] === "small"
      ), (!s || f & /*size*/
      16) && Mt(
        n,
        "large",
        /*size*/
        c[4] === "large"
      ), (!s || f & /*size*/
      16) && Mt(
        n,
        "medium",
        /*size*/
        c[4] === "medium"
      ), (!s || f & /*disabled*/
      128) && (e.disabled = /*disabled*/
      c[7]), (!s || f & /*label*/
      2) && Bn(
        e,
        "aria-label",
        /*label*/
        c[1]
      ), (!s || f & /*hasPopup*/
      256) && Bn(
        e,
        "aria-haspopup",
        /*hasPopup*/
        c[8]
      ), (!s || f & /*label*/
      2) && Bn(
        e,
        "title",
        /*label*/
        c[1]
      ), (!s || f & /*pending*/
      8) && Mt(
        e,
        "pending",
        /*pending*/
        c[3]
      ), (!s || f & /*padded*/
      32) && Mt(
        e,
        "padded",
        /*padded*/
        c[5]
      ), (!s || f & /*highlight*/
      64) && Mt(
        e,
        "highlight",
        /*highlight*/
        c[6]
      ), (!s || f & /*transparent*/
      512) && Mt(
        e,
        "transparent",
        /*transparent*/
        c[9]
      ), f & /*disabled, _color*/
      2176 && jr(e, "color", !/*disabled*/
      c[7] && /*_color*/
      c[11] ? (
        /*_color*/
        c[11]
      ) : "var(--block-label-text-color)"), f & /*disabled, background*/
      1152 && jr(e, "--bg-color", /*disabled*/
      c[7] ? "auto" : (
        /*background*/
        c[10]
      ));
    },
    i(c) {
      s || (r && a0(r.$$.fragment, c), s = !0);
    },
    o(c) {
      r && o0(r.$$.fragment, c), s = !1;
    },
    d(c) {
      c && pr(e), o && o.d(), r && r0(r), u = !1, l();
    }
  };
}
function Zm(i, e, t) {
  let n, { Icon: r } = e, { label: s = "" } = e, { show_label: u = !1 } = e, { pending: l = !1 } = e, { size: o = "small" } = e, { padded: h = !0 } = e, { highlight: d = !1 } = e, { disabled: c = !1 } = e, { hasPopup: f = !1 } = e, { color: g = "var(--block-label-text-color)" } = e, { transparent: A = !1 } = e, { background: m = "var(--block-background-fill)" } = e;
  function k(a) {
    zm.call(this, i, a);
  }
  return i.$$set = (a) => {
    "Icon" in a && t(0, r = a.Icon), "label" in a && t(1, s = a.label), "show_label" in a && t(2, u = a.show_label), "pending" in a && t(3, l = a.pending), "size" in a && t(4, o = a.size), "padded" in a && t(5, h = a.padded), "highlight" in a && t(6, d = a.highlight), "disabled" in a && t(7, c = a.disabled), "hasPopup" in a && t(8, f = a.hasPopup), "color" in a && t(12, g = a.color), "transparent" in a && t(9, A = a.transparent), "background" in a && t(10, m = a.background);
  }, i.$$.update = () => {
    i.$$.dirty & /*highlight, color*/
    4160 && t(11, n = d ? "var(--color-accent)" : g);
  }, [
    r,
    s,
    u,
    l,
    o,
    h,
    d,
    c,
    f,
    A,
    m,
    n,
    g,
    k
  ];
}
class kr extends Bm {
  constructor(e) {
    super(), Gm(this, e, Zm, Km, jm, {
      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: Qm,
  attr: u0,
  children: Jm,
  claim_element: ep,
  create_slot: tp,
  detach: c0,
  element: np,
  get_all_dirty_from_scope: ip,
  get_slot_changes: rp,
  init: sp,
  insert_hydration: ap,
  null_to_empty: h0,
  safe_not_equal: op,
  transition_in: lp,
  transition_out: up,
  update_slot_base: cp
} = window.__gradio__svelte__internal;
function hp(i) {
  let e, t, n;
  const r = (
    /*#slots*/
    i[2].default
  ), s = tp(
    r,
    i,
    /*$$scope*/
    i[1],
    null
  );
  return {
    c() {
      e = np("div"), s && s.c(), this.h();
    },
    l(u) {
      e = ep(u, "DIV", { class: !0 });
      var l = Jm(e);
      s && s.l(l), l.forEach(c0), this.h();
    },
    h() {
      u0(e, "class", t = h0(`icon-button-wrapper ${/*top_panel*/
      i[0] ? "top-panel" : ""}`) + " svelte-171ybii");
    },
    m(u, l) {
      ap(u, e, l), s && s.m(e, null), n = !0;
    },
    p(u, [l]) {
      s && s.p && (!n || l & /*$$scope*/
      2) && cp(
        s,
        r,
        u,
        /*$$scope*/
        u[1],
        n ? rp(
          r,
          /*$$scope*/
          u[1],
          l,
          null
        ) : ip(
          /*$$scope*/
          u[1]
        ),
        null
      ), (!n || l & /*top_panel*/
      1 && t !== (t = h0(`icon-button-wrapper ${/*top_panel*/
      u[0] ? "top-panel" : ""}`) + " svelte-171ybii")) && u0(e, "class", t);
    },
    i(u) {
      n || (lp(s, u), n = !0);
    },
    o(u) {
      up(s, u), n = !1;
    },
    d(u) {
      u && c0(e), s && s.d(u);
    }
  };
}
function dp(i, e, t) {
  let { $$slots: n = {}, $$scope: r } = e, { top_panel: s = !0 } = e;
  return i.$$set = (u) => {
    "top_panel" in u && t(0, s = u.top_panel), "$$scope" in u && t(1, r = u.$$scope);
  }, [s, r, n];
}
class fp extends Qm {
  constructor(e) {
    super(), sp(this, e, dp, hp, op, { top_panel: 0 });
  }
}
const {
  SvelteComponent: mp,
  append_hydration: tc,
  attr: tt,
  bubble: pp,
  check_outros: gp,
  children: nc,
  claim_element: Ts,
  claim_space: ic,
  create_slot: rc,
  detach: Ci,
  element: Cs,
  empty: d0,
  get_all_dirty_from_scope: sc,
  get_slot_changes: ac,
  group_outros: bp,
  init: vp,
  insert_hydration: Sr,
  listen: yp,
  safe_not_equal: wp,
  set_style: It,
  space: oc,
  src_url_equal: cs,
  toggle_class: Jn,
  transition_in: hs,
  transition_out: ds,
  update_slot_base: lc
} = window.__gradio__svelte__internal;
function Ap(i) {
  let e, t, n, r, s, u, l = (
    /*icon*/
    i[7] && f0(i)
  );
  const o = (
    /*#slots*/
    i[12].default
  ), h = rc(
    o,
    i,
    /*$$scope*/
    i[11],
    null
  );
  return {
    c() {
      e = Cs("button"), l && l.c(), t = oc(), h && h.c(), this.h();
    },
    l(d) {
      e = Ts(d, "BUTTON", { class: !0, id: !0 });
      var c = nc(e);
      l && l.l(c), t = ic(c), h && h.l(c), c.forEach(Ci), this.h();
    },
    h() {
      tt(e, "class", n = /*size*/
      i[4] + " " + /*variant*/
      i[3] + " " + /*elem_classes*/
      i[1].join(" ") + " svelte-im87wg"), tt(
        e,
        "id",
        /*elem_id*/
        i[0]
      ), e.disabled = /*disabled*/
      i[8], Jn(e, "hidden", !/*visible*/
      i[2]), It(
        e,
        "flex-grow",
        /*scale*/
        i[9]
      ), It(
        e,
        "width",
        /*scale*/
        i[9] === 0 ? "fit-content" : null
      ), It(e, "min-width", typeof /*min_width*/
      i[10] == "number" ? `calc(min(${/*min_width*/
      i[10]}px, 100%))` : null);
    },
    m(d, c) {
      Sr(d, e, c), l && l.m(e, null), tc(e, t), h && h.m(e, null), r = !0, s || (u = yp(
        e,
        "click",
        /*click_handler*/
        i[13]
      ), s = !0);
    },
    p(d, c) {
      /*icon*/
      d[7] ? l ? l.p(d, c) : (l = f0(d), l.c(), l.m(e, t)) : l && (l.d(1), l = null), h && h.p && (!r || c & /*$$scope*/
      2048) && lc(
        h,
        o,
        d,
        /*$$scope*/
        d[11],
        r ? ac(
          o,
          /*$$scope*/
          d[11],
          c,
          null
        ) : sc(
          /*$$scope*/
          d[11]
        ),
        null
      ), (!r || c & /*size, variant, elem_classes*/
      26 && n !== (n = /*size*/
      d[4] + " " + /*variant*/
      d[3] + " " + /*elem_classes*/
      d[1].join(" ") + " svelte-im87wg")) && tt(e, "class", n), (!r || c & /*elem_id*/
      1) && tt(
        e,
        "id",
        /*elem_id*/
        d[0]
      ), (!r || c & /*disabled*/
      256) && (e.disabled = /*disabled*/
      d[8]), (!r || c & /*size, variant, elem_classes, visible*/
      30) && Jn(e, "hidden", !/*visible*/
      d[2]), c & /*scale*/
      512 && It(
        e,
        "flex-grow",
        /*scale*/
        d[9]
      ), c & /*scale*/
      512 && It(
        e,
        "width",
        /*scale*/
        d[9] === 0 ? "fit-content" : null
      ), c & /*min_width*/
      1024 && It(e, "min-width", typeof /*min_width*/
      d[10] == "number" ? `calc(min(${/*min_width*/
      d[10]}px, 100%))` : null);
    },
    i(d) {
      r || (hs(h, d), r = !0);
    },
    o(d) {
      ds(h, d), r = !1;
    },
    d(d) {
      d && Ci(e), l && l.d(), h && h.d(d), s = !1, u();
    }
  };
}
function kp(i) {
  let e, t, n, r, s = (
    /*icon*/
    i[7] && m0(i)
  );
  const u = (
    /*#slots*/
    i[12].default
  ), l = rc(
    u,
    i,
    /*$$scope*/
    i[11],
    null
  );
  return {
    c() {
      e = Cs("a"), s && s.c(), t = oc(), l && l.c(), this.h();
    },
    l(o) {
      e = Ts(o, "A", {
        href: !0,
        rel: !0,
        "aria-disabled": !0,
        class: !0,
        id: !0
      });
      var h = nc(e);
      s && s.l(h), t = ic(h), l && l.l(h), h.forEach(Ci), this.h();
    },
    h() {
      tt(
        e,
        "href",
        /*link*/
        i[6]
      ), tt(e, "rel", "noopener noreferrer"), tt(
        e,
        "aria-disabled",
        /*disabled*/
        i[8]
      ), tt(e, "class", n = /*size*/
      i[4] + " " + /*variant*/
      i[3] + " " + /*elem_classes*/
      i[1].join(" ") + " svelte-im87wg"), tt(
        e,
        "id",
        /*elem_id*/
        i[0]
      ), Jn(e, "hidden", !/*visible*/
      i[2]), Jn(
        e,
        "disabled",
        /*disabled*/
        i[8]
      ), It(
        e,
        "flex-grow",
        /*scale*/
        i[9]
      ), It(
        e,
        "pointer-events",
        /*disabled*/
        i[8] ? "none" : null
      ), It(
        e,
        "width",
        /*scale*/
        i[9] === 0 ? "fit-content" : null
      ), It(e, "min-width", typeof /*min_width*/
      i[10] == "number" ? `calc(min(${/*min_width*/
      i[10]}px, 100%))` : null);
    },
    m(o, h) {
      Sr(o, e, h), s && s.m(e, null), tc(e, t), l && l.m(e, null), r = !0;
    },
    p(o, h) {
      /*icon*/
      o[7] ? s ? s.p(o, h) : (s = m0(o), s.c(), s.m(e, t)) : s && (s.d(1), s = null), l && l.p && (!r || h & /*$$scope*/
      2048) && lc(
        l,
        u,
        o,
        /*$$scope*/
        o[11],
        r ? ac(
          u,
          /*$$scope*/
          o[11],
          h,
          null
        ) : sc(
          /*$$scope*/
          o[11]
        ),
        null
      ), (!r || h & /*link*/
      64) && tt(
        e,
        "href",
        /*link*/
        o[6]
      ), (!r || h & /*disabled*/
      256) && tt(
        e,
        "aria-disabled",
        /*disabled*/
        o[8]
      ), (!r || h & /*size, variant, elem_classes*/
      26 && n !== (n = /*size*/
      o[4] + " " + /*variant*/
      o[3] + " " + /*elem_classes*/
      o[1].join(" ") + " svelte-im87wg")) && tt(e, "class", n), (!r || h & /*elem_id*/
      1) && tt(
        e,
        "id",
        /*elem_id*/
        o[0]
      ), (!r || h & /*size, variant, elem_classes, visible*/
      30) && Jn(e, "hidden", !/*visible*/
      o[2]), (!r || h & /*size, variant, elem_classes, disabled*/
      282) && Jn(
        e,
        "disabled",
        /*disabled*/
        o[8]
      ), h & /*scale*/
      512 && It(
        e,
        "flex-grow",
        /*scale*/
        o[9]
      ), h & /*disabled*/
      256 && It(
        e,
        "pointer-events",
        /*disabled*/
        o[8] ? "none" : null
      ), h & /*scale*/
      512 && It(
        e,
        "width",
        /*scale*/
        o[9] === 0 ? "fit-content" : null
      ), h & /*min_width*/
      1024 && It(e, "min-width", typeof /*min_width*/
      o[10] == "number" ? `calc(min(${/*min_width*/
      o[10]}px, 100%))` : null);
    },
    i(o) {
      r || (hs(l, o), r = !0);
    },
    o(o) {
      ds(l, o), r = !1;
    },
    d(o) {
      o && Ci(e), s && s.d(), l && l.d(o);
    }
  };
}
function f0(i) {
  let e, t, n;
  return {
    c() {
      e = Cs("img"), this.h();
    },
    l(r) {
      e = Ts(r, "IMG", { class: !0, src: !0, alt: !0 }), this.h();
    },
    h() {
      tt(e, "class", "button-icon svelte-im87wg"), cs(e.src, t = /*icon*/
      i[7].url) || tt(e, "src", t), tt(e, "alt", n = `${/*value*/
      i[5]} icon`), Jn(
        e,
        "right-padded",
        /*value*/
        i[5]
      );
    },
    m(r, s) {
      Sr(r, e, s);
    },
    p(r, s) {
      s & /*icon*/
      128 && !cs(e.src, t = /*icon*/
      r[7].url) && tt(e, "src", t), s & /*value*/
      32 && n !== (n = `${/*value*/
      r[5]} icon`) && tt(e, "alt", n), s & /*value*/
      32 && Jn(
        e,
        "right-padded",
        /*value*/
        r[5]
      );
    },
    d(r) {
      r && Ci(e);
    }
  };
}
function m0(i) {
  let e, t, n;
  return {
    c() {
      e = Cs("img"), this.h();
    },
    l(r) {
      e = Ts(r, "IMG", { class: !0, src: !0, alt: !0 }), this.h();
    },
    h() {
      tt(e, "class", "button-icon svelte-im87wg"), cs(e.src, t = /*icon*/
      i[7].url) || tt(e, "src", t), tt(e, "alt", n = `${/*value*/
      i[5]} icon`);
    },
    m(r, s) {
      Sr(r, e, s);
    },
    p(r, s) {
      s & /*icon*/
      128 && !cs(e.src, t = /*icon*/
      r[7].url) && tt(e, "src", t), s & /*value*/
      32 && n !== (n = `${/*value*/
      r[5]} icon`) && tt(e, "alt", n);
    },
    d(r) {
      r && Ci(e);
    }
  };
}
function Sp(i) {
  let e, t, n, r;
  const s = [kp, Ap], u = [];
  function l(o, h) {
    return (
      /*link*/
      o[6] && /*link*/
      o[6].length > 0 ? 0 : 1
    );
  }
  return e = l(i), t = u[e] = s[e](i), {
    c() {
      t.c(), n = d0();
    },
    l(o) {
      t.l(o), n = d0();
    },
    m(o, h) {
      u[e].m(o, h), Sr(o, n, h), r = !0;
    },
    p(o, [h]) {
      let d = e;
      e = l(o), e === d ? u[e].p(o, h) : (bp(), ds(u[d], 1, 1, () => {
        u[d] = null;
      }), gp(), t = u[e], t ? t.p(o, h) : (t = u[e] = s[e](o), t.c()), hs(t, 1), t.m(n.parentNode, n));
    },
    i(o) {
      r || (hs(t), r = !0);
    },
    o(o) {
      ds(t), r = !1;
    },
    d(o) {
      o && Ci(n), u[e].d(o);
    }
  };
}
function xp(i, e, t) {
  let { $$slots: n = {}, $$scope: r } = e, { elem_id: s = "" } = e, { elem_classes: u = [] } = e, { visible: l = !0 } = e, { variant: o = "secondary" } = e, { size: h = "lg" } = e, { value: d = null } = e, { link: c = null } = e, { icon: f = null } = e, { disabled: g = !1 } = e, { scale: A = null } = e, { min_width: m = void 0 } = e;
  function k(a) {
    pp.call(this, i, a);
  }
  return i.$$set = (a) => {
    "elem_id" in a && t(0, s = a.elem_id), "elem_classes" in a && t(1, u = a.elem_classes), "visible" in a && t(2, l = a.visible), "variant" in a && t(3, o = a.variant), "size" in a && t(4, h = a.size), "value" in a && t(5, d = a.value), "link" in a && t(6, c = a.link), "icon" in a && t(7, f = a.icon), "disabled" in a && t(8, g = a.disabled), "scale" in a && t(9, A = a.scale), "min_width" in a && t(10, m = a.min_width), "$$scope" in a && t(11, r = a.$$scope);
  }, [
    s,
    u,
    l,
    o,
    h,
    d,
    c,
    f,
    g,
    A,
    m,
    r,
    n,
    k
  ];
}
class p0 extends mp {
  constructor(e) {
    super(), vp(this, e, xp, Sp, wp, {
      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
    });
  }
}
new Intl.Collator(0, { numeric: 1 }).compare;
async function Ep(i, e) {
  return i.map(
    (t) => new _p({
      path: t.name,
      orig_name: t.name,
      blob: t,
      size: t.size,
      mime_type: t.type,
      is_stream: e
    })
  );
}
class _p {
  constructor({
    path: e,
    url: t,
    orig_name: n,
    size: r,
    blob: s,
    is_stream: u,
    mime_type: l,
    alt_text: o,
    b64: h
  }) {
    this.meta = { _type: "gradio.FileData" }, this.path = e, this.url = t, this.orig_name = n, this.size = r, this.blob = t ? void 0 : s, this.is_stream = u, this.mime_type = l, this.alt_text = o, this.b64 = h;
  }
}
typeof process < "u" && process.versions && process.versions.node;
class a4 extends TransformStream {
  #e = "";
  /** Constructs a new instance. */
  constructor(e = { allowCR: !1 }) {
    super({
      transform: (t, n) => {
        for (t = this.#e + t; ; ) {
          const r = t.indexOf(`
`), s = e.allowCR ? t.indexOf("\r") : -1;
          if (s !== -1 && s !== t.length - 1 && (r === -1 || r - 1 > s)) {
            n.enqueue(t.slice(0, s)), t = t.slice(s + 1);
            continue;
          }
          if (r === -1)
            break;
          const u = t[r - 1] === "\r" ? r - 1 : r;
          n.enqueue(t.slice(0, u)), t = t.slice(r + 1);
        }
        this.#e = t;
      },
      flush: (t) => {
        if (this.#e === "")
          return;
        const n = e.allowCR && this.#e.endsWith("\r") ? this.#e.slice(0, -1) : this.#e;
        t.enqueue(n);
      }
    });
  }
}
const {
  SvelteComponent: Tp,
  append_hydration: Nt,
  attr: wi,
  children: Ai,
  claim_element: ki,
  claim_space: za,
  claim_text: Hi,
  detach: zn,
  element: Si,
  init: Cp,
  insert_hydration: uc,
  noop: g0,
  safe_not_equal: Dp,
  set_data: fs,
  set_style: va,
  space: Oa,
  text: qi,
  toggle_class: b0
} = window.__gradio__svelte__internal, { onMount: Fp, createEventDispatcher: Mp, onDestroy: Rp } = window.__gradio__svelte__internal;
function v0(i) {
  let e, t, n, r, s = hr(
    /*file_to_display*/
    i[2]
  ) + "", u, l, o, h, d = (
    /*file_to_display*/
    i[2].orig_name + ""
  ), c;
  return {
    c() {
      e = Si("div"), t = Si("span"), n = Si("div"), r = Si("progress"), u = qi(s), o = Oa(), h = Si("span"), c = qi(d), this.h();
    },
    l(f) {
      e = ki(f, "DIV", { class: !0 });
      var g = Ai(e);
      t = ki(g, "SPAN", {});
      var A = Ai(t);
      n = ki(A, "DIV", { class: !0 });
      var m = Ai(n);
      r = ki(m, "PROGRESS", { style: !0, max: !0, class: !0 });
      var k = Ai(r);
      u = Hi(k, s), k.forEach(zn), m.forEach(zn), A.forEach(zn), o = za(g), h = ki(g, "SPAN", { class: !0 });
      var a = Ai(h);
      c = Hi(a, d), a.forEach(zn), g.forEach(zn), this.h();
    },
    h() {
      va(r, "visibility", "hidden"), va(r, "height", "0"), va(r, "width", "0"), r.value = l = hr(
        /*file_to_display*/
        i[2]
      ), wi(r, "max", "100"), wi(r, "class", "svelte-cr2edf"), wi(n, "class", "progress-bar svelte-cr2edf"), wi(h, "class", "file-name svelte-cr2edf"), wi(e, "class", "file svelte-cr2edf");
    },
    m(f, g) {
      uc(f, e, g), Nt(e, t), Nt(t, n), Nt(n, r), Nt(r, u), Nt(e, o), Nt(e, h), Nt(h, c);
    },
    p(f, g) {
      g & /*file_to_display*/
      4 && s !== (s = hr(
        /*file_to_display*/
        f[2]
      ) + "") && fs(u, s), g & /*file_to_display*/
      4 && l !== (l = hr(
        /*file_to_display*/
        f[2]
      )) && (r.value = l), g & /*file_to_display*/
      4 && d !== (d = /*file_to_display*/
      f[2].orig_name + "") && fs(c, d);
    },
    d(f) {
      f && zn(e);
    }
  };
}
function Lp(i) {
  let e, t, n, r = (
    /*files_with_progress*/
    i[0].length + ""
  ), s, u, l = (
    /*files_with_progress*/
    i[0].length > 1 ? "files" : "file"
  ), o, h, d, c = (
    /*file_to_display*/
    i[2] && v0(i)
  );
  return {
    c() {
      e = Si("div"), t = Si("span"), n = qi("Uploading "), s = qi(r), u = Oa(), o = qi(l), h = qi("..."), d = Oa(), c && c.c(), this.h();
    },
    l(f) {
      e = ki(f, "DIV", { class: !0 });
      var g = Ai(e);
      t = ki(g, "SPAN", { class: !0 });
      var A = Ai(t);
      n = Hi(A, "Uploading "), s = Hi(A, r), u = za(A), o = Hi(A, l), h = Hi(A, "..."), A.forEach(zn), d = za(g), c && c.l(g), g.forEach(zn), this.h();
    },
    h() {
      wi(t, "class", "uploading svelte-cr2edf"), wi(e, "class", "wrap svelte-cr2edf"), b0(
        e,
        "progress",
        /*progress*/
        i[1]
      );
    },
    m(f, g) {
      uc(f, e, g), Nt(e, t), Nt(t, n), Nt(t, s), Nt(t, u), Nt(t, o), Nt(t, h), Nt(e, d), c && c.m(e, null);
    },
    p(f, [g]) {
      g & /*files_with_progress*/
      1 && r !== (r = /*files_with_progress*/
      f[0].length + "") && fs(s, r), g & /*files_with_progress*/
      1 && l !== (l = /*files_with_progress*/
      f[0].length > 1 ? "files" : "file") && fs(o, l), /*file_to_display*/
      f[2] ? c ? c.p(f, g) : (c = v0(f), c.c(), c.m(e, null)) : c && (c.d(1), c = null), g & /*progress*/
      2 && b0(
        e,
        "progress",
        /*progress*/
        f[1]
      );
    },
    i: g0,
    o: g0,
    d(f) {
      f && zn(e), c && c.d();
    }
  };
}
function hr(i) {
  return i.progress * 100 / (i.size || 0) || 0;
}
function Ip(i) {
  let e = 0;
  return i.forEach((t) => {
    e += hr(t);
  }), document.documentElement.style.setProperty("--upload-progress-width", (e / i.length).toFixed(2) + "%"), e / i.length;
}
function Np(i, e, t) {
  var n = this && this.__awaiter || function(m, k, a, p) {
    function b(y) {
      return y instanceof a ? y : new a(function(C) {
        C(y);
      });
    }
    return new (a || (a = Promise))(function(y, C) {
      function M(O) {
        try {
          P(p.next(O));
        } catch (q) {
          C(q);
        }
      }
      function L(O) {
        try {
          P(p.throw(O));
        } catch (q) {
          C(q);
        }
      }
      function P(O) {
        O.done ? y(O.value) : b(O.value).then(M, L);
      }
      P((p = p.apply(m, k || [])).next());
    });
  };
  let { upload_id: r } = e, { root: s } = e, { files: u } = e, { stream_handler: l } = e, o, h = !1, d, c, f = u.map((m) => Object.assign(Object.assign({}, m), { progress: 0 }));
  const g = Mp();
  function A(m, k) {
    t(0, f = f.map((a) => (a.orig_name === m && (a.progress += k), a)));
  }
  return Fp(() => n(void 0, void 0, void 0, function* () {
    if (o = yield l(new URL(`${s}/gradio_api/upload_progress?upload_id=${r}`)), o == null)
      throw new Error("Event source is not defined");
    o.onmessage = function(m) {
      return n(this, void 0, void 0, function* () {
        const k = JSON.parse(m.data);
        h || t(1, h = !0), k.msg === "done" ? (o?.close(), g("done")) : (t(7, d = k), A(k.orig_name, k.chunk_size));
      });
    };
  })), Rp(() => {
    (o != null || o != null) && o.close();
  }), i.$$set = (m) => {
    "upload_id" in m && t(3, r = m.upload_id), "root" in m && t(4, s = m.root), "files" in m && t(5, u = m.files), "stream_handler" in m && t(6, l = m.stream_handler);
  }, i.$$.update = () => {
    i.$$.dirty & /*files_with_progress*/
    1 && Ip(f), i.$$.dirty & /*current_file_upload, files_with_progress*/
    129 && t(2, c = d || f[0]);
  }, [
    f,
    h,
    c,
    r,
    s,
    u,
    l,
    d
  ];
}
class Pp extends Tp {
  constructor(e) {
    super(), Cp(this, e, Np, Lp, Dp, {
      upload_id: 3,
      root: 4,
      files: 5,
      stream_handler: 6
    });
  }
}
const {
  SvelteComponent: Bp,
  append_hydration: y0,
  attr: wt,
  binding_callbacks: zp,
  bubble: mi,
  check_outros: cc,
  children: hc,
  claim_component: Op,
  claim_element: Ha,
  claim_space: Hp,
  create_component: qp,
  create_slot: dc,
  destroy_component: Up,
  detach: ji,
  element: qa,
  empty: ms,
  get_all_dirty_from_scope: fc,
  get_slot_changes: mc,
  group_outros: pc,
  init: Vp,
  insert_hydration: Ds,
  listen: zt,
  mount_component: Gp,
  prevent_default: pi,
  run_all: Xp,
  safe_not_equal: jp,
  set_style: gc,
  space: Yp,
  stop_propagation: gi,
  toggle_class: dt,
  transition_in: ei,
  transition_out: Di,
  update_slot_base: bc
} = window.__gradio__svelte__internal, { createEventDispatcher: Wp, tick: $p } = window.__gradio__svelte__internal;
function Kp(i) {
  let e, t, n, r, s, u, l, o, h, d, c;
  const f = (
    /*#slots*/
    i[27].default
  ), g = dc(
    f,
    i,
    /*$$scope*/
    i[26],
    null
  );
  return {
    c() {
      e = qa("button"), g && g.c(), t = Yp(), n = qa("input"), this.h();
    },
    l(A) {
      e = Ha(A, "BUTTON", { tabindex: !0, class: !0 });
      var m = hc(e);
      g && g.l(m), t = Hp(m), n = Ha(m, "INPUT", {
        "aria-label": !0,
        "data-testid": !0,
        type: !0,
        accept: !0,
        webkitdirectory: !0,
        mozdirectory: !0,
        class: !0
      }), m.forEach(ji), this.h();
    },
    h() {
      wt(n, "aria-label", "file upload"), wt(n, "data-testid", "file-upload"), wt(n, "type", "file"), wt(n, "accept", r = /*accept_file_types*/
      i[16] || void 0), n.multiple = s = /*file_count*/
      i[6] === "multiple" || void 0, wt(n, "webkitdirectory", u = /*file_count*/
      i[6] === "directory" || void 0), wt(n, "mozdirectory", l = /*file_count*/
      i[6] === "directory" || void 0), wt(n, "class", "svelte-1mceliw"), wt(e, "tabindex", o = /*hidden*/
      i[9] ? -1 : 0), wt(e, "class", "svelte-1mceliw"), dt(
        e,
        "hidden",
        /*hidden*/
        i[9]
      ), dt(
        e,
        "center",
        /*center*/
        i[4]
      ), dt(
        e,
        "boundedheight",
        /*boundedheight*/
        i[3]
      ), dt(
        e,
        "flex",
        /*flex*/
        i[5]
      ), dt(
        e,
        "disable_click",
        /*disable_click*/
        i[7]
      ), gc(e, "height", "100%");
    },
    m(A, m) {
      Ds(A, e, m), g && g.m(e, null), y0(e, t), y0(e, n), i[35](n), h = !0, d || (c = [
        zt(
          n,
          "change",
          /*load_files_from_upload*/
          i[18]
        ),
        zt(e, "drag", gi(pi(
          /*drag_handler*/
          i[28]
        ))),
        zt(e, "dragstart", gi(pi(
          /*dragstart_handler*/
          i[29]
        ))),
        zt(e, "dragend", gi(pi(
          /*dragend_handler*/
          i[30]
        ))),
        zt(e, "dragover", gi(pi(
          /*dragover_handler*/
          i[31]
        ))),
        zt(e, "dragenter", gi(pi(
          /*dragenter_handler*/
          i[32]
        ))),
        zt(e, "dragleave", gi(pi(
          /*dragleave_handler*/
          i[33]
        ))),
        zt(e, "drop", gi(pi(
          /*drop_handler*/
          i[34]
        ))),
        zt(
          e,
          "click",
          /*open_file_upload*/
          i[13]
        ),
        zt(
          e,
          "drop",
          /*loadFilesFromDrop*/
          i[19]
        ),
        zt(
          e,
          "dragenter",
          /*updateDragging*/
          i[17]
        ),
        zt(
          e,
          "dragleave",
          /*updateDragging*/
          i[17]
        )
      ], d = !0);
    },
    p(A, m) {
      g && g.p && (!h || m[0] & /*$$scope*/
      67108864) && bc(
        g,
        f,
        A,
        /*$$scope*/
        A[26],
        h ? mc(
          f,
          /*$$scope*/
          A[26],
          m,
          null
        ) : fc(
          /*$$scope*/
          A[26]
        ),
        null
      ), (!h || m[0] & /*accept_file_types*/
      65536 && r !== (r = /*accept_file_types*/
      A[16] || void 0)) && wt(n, "accept", r), (!h || m[0] & /*file_count*/
      64 && s !== (s = /*file_count*/
      A[6] === "multiple" || void 0)) && (n.multiple = s), (!h || m[0] & /*file_count*/
      64 && u !== (u = /*file_count*/
      A[6] === "directory" || void 0)) && wt(n, "webkitdirectory", u), (!h || m[0] & /*file_count*/
      64 && l !== (l = /*file_count*/
      A[6] === "directory" || void 0)) && wt(n, "mozdirectory", l), (!h || m[0] & /*hidden*/
      512 && o !== (o = /*hidden*/
      A[9] ? -1 : 0)) && wt(e, "tabindex", o), (!h || m[0] & /*hidden*/
      512) && dt(
        e,
        "hidden",
        /*hidden*/
        A[9]
      ), (!h || m[0] & /*center*/
      16) && dt(
        e,
        "center",
        /*center*/
        A[4]
      ), (!h || m[0] & /*boundedheight*/
      8) && dt(
        e,
        "boundedheight",
        /*boundedheight*/
        A[3]
      ), (!h || m[0] & /*flex*/
      32) && dt(
        e,
        "flex",
        /*flex*/
        A[5]
      ), (!h || m[0] & /*disable_click*/
      128) && dt(
        e,
        "disable_click",
        /*disable_click*/
        A[7]
      );
    },
    i(A) {
      h || (ei(g, A), h = !0);
    },
    o(A) {
      Di(g, A), h = !1;
    },
    d(A) {
      A && ji(e), g && g.d(A), i[35](null), d = !1, Xp(c);
    }
  };
}
function Zp(i) {
  let e, t, n = !/*hidden*/
  i[9] && w0(i);
  return {
    c() {
      n && n.c(), e = ms();
    },
    l(r) {
      n && n.l(r), e = ms();
    },
    m(r, s) {
      n && n.m(r, s), Ds(r, e, s), t = !0;
    },
    p(r, s) {
      /*hidden*/
      r[9] ? n && (pc(), Di(n, 1, 1, () => {
        n = null;
      }), cc()) : n ? (n.p(r, s), s[0] & /*hidden*/
      512 && ei(n, 1)) : (n = w0(r), n.c(), ei(n, 1), n.m(e.parentNode, e));
    },
    i(r) {
      t || (ei(n), t = !0);
    },
    o(r) {
      Di(n), t = !1;
    },
    d(r) {
      r && ji(e), n && n.d(r);
    }
  };
}
function Qp(i) {
  let e, t, n, r, s;
  const u = (
    /*#slots*/
    i[27].default
  ), l = dc(
    u,
    i,
    /*$$scope*/
    i[26],
    null
  );
  return {
    c() {
      e = qa("button"), l && l.c(), this.h();
    },
    l(o) {
      e = Ha(o, "BUTTON", { tabindex: !0, class: !0 });
      var h = hc(e);
      l && l.l(h), h.forEach(ji), this.h();
    },
    h() {
      wt(e, "tabindex", t = /*hidden*/
      i[9] ? -1 : 0), wt(e, "class", "svelte-1mceliw"), dt(
        e,
        "hidden",
        /*hidden*/
        i[9]
      ), dt(
        e,
        "center",
        /*center*/
        i[4]
      ), dt(
        e,
        "boundedheight",
        /*boundedheight*/
        i[3]
      ), dt(
        e,
        "flex",
        /*flex*/
        i[5]
      ), gc(e, "height", "100%");
    },
    m(o, h) {
      Ds(o, e, h), l && l.m(e, null), n = !0, r || (s = zt(
        e,
        "click",
        /*paste_clipboard*/
        i[12]
      ), r = !0);
    },
    p(o, h) {
      l && l.p && (!n || h[0] & /*$$scope*/
      67108864) && bc(
        l,
        u,
        o,
        /*$$scope*/
        o[26],
        n ? mc(
          u,
          /*$$scope*/
          o[26],
          h,
          null
        ) : fc(
          /*$$scope*/
          o[26]
        ),
        null
      ), (!n || h[0] & /*hidden*/
      512 && t !== (t = /*hidden*/
      o[9] ? -1 : 0)) && wt(e, "tabindex", t), (!n || h[0] & /*hidden*/
      512) && dt(
        e,
        "hidden",
        /*hidden*/
        o[9]
      ), (!n || h[0] & /*center*/
      16) && dt(
        e,
        "center",
        /*center*/
        o[4]
      ), (!n || h[0] & /*boundedheight*/
      8) && dt(
        e,
        "boundedheight",
        /*boundedheight*/
        o[3]
      ), (!n || h[0] & /*flex*/
      32) && dt(
        e,
        "flex",
        /*flex*/
        o[5]
      );
    },
    i(o) {
      n || (ei(l, o), n = !0);
    },
    o(o) {
      Di(l, o), n = !1;
    },
    d(o) {
      o && ji(e), l && l.d(o), r = !1, s();
    }
  };
}
function w0(i) {
  let e, t;
  return e = new Pp({
    props: {
      root: (
        /*root*/
        i[8]
      ),
      upload_id: (
        /*upload_id*/
        i[14]
      ),
      files: (
        /*file_data*/
        i[15]
      ),
      stream_handler: (
        /*stream_handler*/
        i[11]
      )
    }
  }), {
    c() {
      qp(e.$$.fragment);
    },
    l(n) {
      Op(e.$$.fragment, n);
    },
    m(n, r) {
      Gp(e, n, r), t = !0;
    },
    p(n, r) {
      const s = {};
      r[0] & /*root*/
      256 && (s.root = /*root*/
      n[8]), r[0] & /*upload_id*/
      16384 && (s.upload_id = /*upload_id*/
      n[14]), r[0] & /*file_data*/
      32768 && (s.files = /*file_data*/
      n[15]), r[0] & /*stream_handler*/
      2048 && (s.stream_handler = /*stream_handler*/
      n[11]), e.$set(s);
    },
    i(n) {
      t || (ei(e.$$.fragment, n), t = !0);
    },
    o(n) {
      Di(e.$$.fragment, n), t = !1;
    },
    d(n) {
      Up(e, n);
    }
  };
}
function Jp(i) {
  let e, t, n, r;
  const s = [Qp, Zp, Kp], u = [];
  function l(o, h) {
    return (
      /*filetype*/
      o[0] === "clipboard" ? 0 : (
        /*uploading*/
        o[1] && /*show_progress*/
        o[10] ? 1 : 2
      )
    );
  }
  return e = l(i), t = u[e] = s[e](i), {
    c() {
      t.c(), n = ms();
    },
    l(o) {
      t.l(o), n = ms();
    },
    m(o, h) {
      u[e].m(o, h), Ds(o, n, h), r = !0;
    },
    p(o, h) {
      let d = e;
      e = l(o), e === d ? u[e].p(o, h) : (pc(), Di(u[d], 1, 1, () => {
        u[d] = null;
      }), cc(), t = u[e], t ? t.p(o, h) : (t = u[e] = s[e](o), t.c()), ei(t, 1), t.m(n.parentNode, n));
    },
    i(o) {
      r || (ei(t), r = !0);
    },
    o(o) {
      Di(t), r = !1;
    },
    d(o) {
      o && ji(n), u[e].d(o);
    }
  };
}
function eg(i, e, t) {
  if (!i || i === "*" || i === "file/*" || Array.isArray(i) && i.some((r) => r === "*" || r === "file/*"))
    return !0;
  let n;
  if (typeof i == "string")
    n = i.split(",").map((r) => r.trim());
  else if (Array.isArray(i))
    n = i;
  else
    return !1;
  return n.includes(e) || n.some((r) => {
    const [s] = r.split("/").map((u) => u.trim());
    return r.endsWith("/*") && t.startsWith(s + "/");
  });
}
function tg(i, e, t) {
  let n, { $$slots: r = {}, $$scope: s } = e;
  var u = this && this.__awaiter || function(E, _, x, F) {
    function I(B) {
      return B instanceof x ? B : new x(function(H) {
        H(B);
      });
    }
    return new (x || (x = Promise))(function(B, H) {
      function V(G) {
        try {
          X(F.next(G));
        } catch (U) {
          H(U);
        }
      }
      function $(G) {
        try {
          X(F.throw(G));
        } catch (U) {
          H(U);
        }
      }
      function X(G) {
        G.done ? B(G.value) : I(G.value).then(V, $);
      }
      X((F = F.apply(E, _ || [])).next());
    });
  };
  let { filetype: l = null } = e, { dragging: o = !1 } = e, { boundedheight: h = !0 } = e, { center: d = !0 } = e, { flex: c = !0 } = e, { file_count: f = "single" } = e, { disable_click: g = !1 } = e, { root: A } = e, { hidden: m = !1 } = e, { format: k = "file" } = e, { uploading: a = !1 } = e, { hidden_upload: p = null } = e, { show_progress: b = !0 } = e, { max_file_size: y = null } = e, { upload: C } = e, { stream_handler: M } = e, L, P, O, q = null;
  const Y = () => {
    if (typeof navigator < "u") {
      const E = navigator.userAgent.toLowerCase();
      return E.indexOf("iphone") > -1 || E.indexOf("ipad") > -1;
    }
    return !1;
  }, se = Wp(), me = ["image", "video", "audio", "text", "file"], te = (E) => n && E.startsWith(".") ? (q = !0, E) : n && E.includes("file/*") ? "*" : E.startsWith(".") || E.endsWith("/*") ? E : me.includes(E) ? E + "/*" : "." + E;
  function K() {
    t(20, o = !o);
  }
  function Z() {
    navigator.clipboard.read().then((E) => u(this, void 0, void 0, function* () {
      for (let _ = 0; _ < E.length; _++) {
        const x = E[_].types.find((F) => F.startsWith("image/"));
        if (x) {
          E[_].getType(x).then((F) => u(this, void 0, void 0, function* () {
            const I = new File([F], `clipboard.${x.replace("image/", "")}`);
            yield ie([I]);
          }));
          break;
        }
      }
    }));
  }
  function oe() {
    g || p && (t(2, p.value = "", p), p.click());
  }
  function le(E) {
    return u(this, void 0, void 0, function* () {
      yield $p(), t(14, L = Math.random().toString(36).substring(2, 15)), t(1, a = !0);
      try {
        const _ = yield C(E, A, L, y ?? 1 / 0);
        return se("load", f === "single" ? _?.[0] : _), t(1, a = !1), _ || [];
      } catch (_) {
        return se("error", _.message), t(1, a = !1), [];
      }
    });
  }
  function ie(E) {
    return u(this, void 0, void 0, function* () {
      if (!E.length)
        return;
      let _ = E.map((x) => new File([x], x instanceof File ? x.name : "file", { type: x.type }));
      return n && q && (_ = _.filter((x) => pe(x) ? !0 : (se("error", `Invalid file type: ${x.name}. Only ${l} allowed.`), !1)), _.length === 0) ? [] : (t(15, P = yield Ep(_)), yield le(P));
    });
  }
  function pe(E) {
    return l ? (Array.isArray(l) ? l : [l]).some((x) => {
      const F = te(x);
      if (F.startsWith("."))
        return E.name.toLowerCase().endsWith(F.toLowerCase());
      if (F === "*")
        return !0;
      if (F.endsWith("/*")) {
        const [I] = F.split("/");
        return E.type.startsWith(I + "/");
      }
      return E.type === F;
    }) : !0;
  }
  function he(E) {
    return u(this, void 0, void 0, function* () {
      const _ = E.target;
      if (_.files)
        if (k != "blob")
          yield ie(Array.from(_.files));
        else {
          if (f === "single") {
            se("load", _.files[0]);
            return;
          }
          se("load", _.files);
        }
    });
  }
  function we(E) {
    return u(this, void 0, void 0, function* () {
      var _;
      if (t(20, o = !1), !(!((_ = E.dataTransfer) === null || _ === void 0) && _.files)) return;
      const x = Array.from(E.dataTransfer.files).filter((F) => {
        const I = "." + F.name.split(".").pop();
        return I && eg(O, I, F.type) || (I && Array.isArray(l) ? l.includes(I) : I === l) ? !0 : (se("error", `Invalid file type only ${l} allowed.`), !1);
      });
      if (k != "blob")
        yield ie(x);
      else {
        if (f === "single") {
          se("load", x[0]);
          return;
        }
        se("load", x);
      }
    });
  }
  function ke(E) {
    mi.call(this, i, E);
  }
  function Ae(E) {
    mi.call(this, i, E);
  }
  function ae(E) {
    mi.call(this, i, E);
  }
  function de(E) {
    mi.call(this, i, E);
  }
  function R(E) {
    mi.call(this, i, E);
  }
  function D(E) {
    mi.call(this, i, E);
  }
  function v(E) {
    mi.call(this, i, E);
  }
  function S(E) {
    zp[E ? "unshift" : "push"](() => {
      p = E, t(2, p);
    });
  }
  return i.$$set = (E) => {
    "filetype" in E && t(0, l = E.filetype), "dragging" in E && t(20, o = E.dragging), "boundedheight" in E && t(3, h = E.boundedheight), "center" in E && t(4, d = E.center), "flex" in E && t(5, c = E.flex), "file_count" in E && t(6, f = E.file_count), "disable_click" in E && t(7, g = E.disable_click), "root" in E && t(8, A = E.root), "hidden" in E && t(9, m = E.hidden), "format" in E && t(21, k = E.format), "uploading" in E && t(1, a = E.uploading), "hidden_upload" in E && t(2, p = E.hidden_upload), "show_progress" in E && t(10, b = E.show_progress), "max_file_size" in E && t(22, y = E.max_file_size), "upload" in E && t(23, C = E.upload), "stream_handler" in E && t(11, M = E.stream_handler), "$$scope" in E && t(26, s = E.$$scope);
  }, i.$$.update = () => {
    i.$$.dirty[0] & /*filetype, ios*/
    33554433 && (l == null ? t(16, O = null) : typeof l == "string" ? t(16, O = te(l)) : n && l.includes("file/*") ? t(16, O = "*") : (t(0, l = l.map(te)), t(16, O = l.join(", "))));
  }, t(25, n = Y()), [
    l,
    a,
    p,
    h,
    d,
    c,
    f,
    g,
    A,
    m,
    b,
    M,
    Z,
    oe,
    L,
    P,
    O,
    K,
    he,
    we,
    o,
    k,
    y,
    C,
    ie,
    n,
    s,
    r,
    ke,
    Ae,
    ae,
    de,
    R,
    D,
    v,
    S
  ];
}
class ng extends Bp {
  constructor(e) {
    super(), Vp(
      this,
      e,
      tg,
      Jp,
      jp,
      {
        filetype: 0,
        dragging: 20,
        boundedheight: 3,
        center: 4,
        flex: 5,
        file_count: 6,
        disable_click: 7,
        root: 8,
        hidden: 9,
        format: 21,
        uploading: 1,
        hidden_upload: 2,
        show_progress: 10,
        max_file_size: 22,
        upload: 23,
        stream_handler: 11,
        paste_clipboard: 12,
        open_file_upload: 13,
        load_files: 24
      },
      null,
      [-1, -1]
    );
  }
  get paste_clipboard() {
    return this.$$.ctx[12];
  }
  get open_file_upload() {
    return this.$$.ctx[13];
  }
  get load_files() {
    return this.$$.ctx[24];
  }
}
const { setContext: o4, getContext: ig } = window.__gradio__svelte__internal, rg = "WORKER_PROXY_CONTEXT_KEY";
function sg() {
  return ig(rg);
}
const ag = "lite.local";
function og(i) {
  return i.host === window.location.host || i.host === "localhost:7860" || i.host === "127.0.0.1:7860" || // Ref: https://github.com/gradio-app/gradio/blob/v3.32.0/js/app/src/Index.svelte#L194
  i.host === ag;
}
function lg(i, e) {
  const t = e.toLowerCase();
  for (const [n, r] of Object.entries(i))
    if (n.toLowerCase() === t)
      return r;
}
function ug(i) {
  const e = typeof window < "u";
  if (i == null || !e)
    return !1;
  const t = new URL(i, window.location.href);
  return !(!og(t) || t.protocol !== "http:" && t.protocol !== "https:");
}
const {
  SvelteComponent: cg,
  assign: ps,
  check_outros: vc,
  children: yc,
  claim_element: wc,
  compute_rest_props: A0,
  create_slot: mo,
  detach: Yi,
  element: Ac,
  empty: gs,
  exclude_internal_props: hg,
  get_all_dirty_from_scope: po,
  get_slot_changes: go,
  get_spread_update: kc,
  group_outros: Sc,
  init: dg,
  insert_hydration: Fs,
  listen: xc,
  prevent_default: fg,
  safe_not_equal: mg,
  set_attributes: bs,
  set_style: k0,
  toggle_class: vs,
  transition_in: Fi,
  transition_out: Mi,
  update_slot_base: bo
} = window.__gradio__svelte__internal, { createEventDispatcher: pg } = window.__gradio__svelte__internal;
function gg(i) {
  let e, t, n, r, s;
  const u = (
    /*#slots*/
    i[8].default
  ), l = mo(
    u,
    i,
    /*$$scope*/
    i[7],
    null
  );
  let o = [
    { class: "download-link" },
    { href: (
      /*href*/
      i[0]
    ) },
    {
      target: t = typeof window < "u" && window.__is_colab__ ? "_blank" : null
    },
    { rel: "noopener noreferrer" },
    { download: (
      /*download*/
      i[1]
    ) },
    /*$$restProps*/
    i[6]
  ], h = {};
  for (let d = 0; d < o.length; d += 1)
    h = ps(h, o[d]);
  return {
    c() {
      e = Ac("a"), l && l.c(), this.h();
    },
    l(d) {
      e = wc(d, "A", {
        class: !0,
        href: !0,
        target: !0,
        rel: !0,
        download: !0
      });
      var c = yc(e);
      l && l.l(c), c.forEach(Yi), this.h();
    },
    h() {
      bs(e, h), k0(e, "position", "relative"), vs(e, "svelte-151nsdd", !0);
    },
    m(d, c) {
      Fs(d, e, c), l && l.m(e, null), n = !0, r || (s = xc(
        e,
        "click",
        /*dispatch*/
        i[3].bind(null, "click")
      ), r = !0);
    },
    p(d, c) {
      l && l.p && (!n || c & /*$$scope*/
      128) && bo(
        l,
        u,
        d,
        /*$$scope*/
        d[7],
        n ? go(
          u,
          /*$$scope*/
          d[7],
          c,
          null
        ) : po(
          /*$$scope*/
          d[7]
        ),
        null
      ), bs(e, h = kc(o, [
        { class: "download-link" },
        (!n || c & /*href*/
        1) && { href: (
          /*href*/
          d[0]
        ) },
        { target: t },
        { rel: "noopener noreferrer" },
        (!n || c & /*download*/
        2) && { download: (
          /*download*/
          d[1]
        ) },
        c & /*$$restProps*/
        64 && /*$$restProps*/
        d[6]
      ])), k0(e, "position", "relative"), vs(e, "svelte-151nsdd", !0);
    },
    i(d) {
      n || (Fi(l, d), n = !0);
    },
    o(d) {
      Mi(l, d), n = !1;
    },
    d(d) {
      d && Yi(e), l && l.d(d), r = !1, s();
    }
  };
}
function bg(i) {
  let e, t, n, r;
  const s = [yg, vg], u = [];
  function l(o, h) {
    return (
      /*is_downloading*/
      o[2] ? 0 : 1
    );
  }
  return e = l(i), t = u[e] = s[e](i), {
    c() {
      t.c(), n = gs();
    },
    l(o) {
      t.l(o), n = gs();
    },
    m(o, h) {
      u[e].m(o, h), Fs(o, n, h), r = !0;
    },
    p(o, h) {
      let d = e;
      e = l(o), e === d ? u[e].p(o, h) : (Sc(), Mi(u[d], 1, 1, () => {
        u[d] = null;
      }), vc(), t = u[e], t ? t.p(o, h) : (t = u[e] = s[e](o), t.c()), Fi(t, 1), t.m(n.parentNode, n));
    },
    i(o) {
      r || (Fi(t), r = !0);
    },
    o(o) {
      Mi(t), r = !1;
    },
    d(o) {
      o && Yi(n), u[e].d(o);
    }
  };
}
function vg(i) {
  let e, t, n, r;
  const s = (
    /*#slots*/
    i[8].default
  ), u = mo(
    s,
    i,
    /*$$scope*/
    i[7],
    null
  );
  let l = [
    /*$$restProps*/
    i[6],
    { href: (
      /*href*/
      i[0]
    ) }
  ], o = {};
  for (let h = 0; h < l.length; h += 1)
    o = ps(o, l[h]);
  return {
    c() {
      e = Ac("a"), u && u.c(), this.h();
    },
    l(h) {
      e = wc(h, "A", { href: !0 });
      var d = yc(e);
      u && u.l(d), d.forEach(Yi), this.h();
    },
    h() {
      bs(e, o), vs(e, "svelte-151nsdd", !0);
    },
    m(h, d) {
      Fs(h, e, d), u && u.m(e, null), t = !0, n || (r = xc(e, "click", fg(
        /*wasm_click_handler*/
        i[5]
      )), n = !0);
    },
    p(h, d) {
      u && u.p && (!t || d & /*$$scope*/
      128) && bo(
        u,
        s,
        h,
        /*$$scope*/
        h[7],
        t ? go(
          s,
          /*$$scope*/
          h[7],
          d,
          null
        ) : po(
          /*$$scope*/
          h[7]
        ),
        null
      ), bs(e, o = kc(l, [
        d & /*$$restProps*/
        64 && /*$$restProps*/
        h[6],
        (!t || d & /*href*/
        1) && { href: (
          /*href*/
          h[0]
        ) }
      ])), vs(e, "svelte-151nsdd", !0);
    },
    i(h) {
      t || (Fi(u, h), t = !0);
    },
    o(h) {
      Mi(u, h), t = !1;
    },
    d(h) {
      h && Yi(e), u && u.d(h), n = !1, r();
    }
  };
}
function yg(i) {
  let e;
  const t = (
    /*#slots*/
    i[8].default
  ), n = mo(
    t,
    i,
    /*$$scope*/
    i[7],
    null
  );
  return {
    c() {
      n && n.c();
    },
    l(r) {
      n && n.l(r);
    },
    m(r, s) {
      n && n.m(r, s), e = !0;
    },
    p(r, s) {
      n && n.p && (!e || s & /*$$scope*/
      128) && bo(
        n,
        t,
        r,
        /*$$scope*/
        r[7],
        e ? go(
          t,
          /*$$scope*/
          r[7],
          s,
          null
        ) : po(
          /*$$scope*/
          r[7]
        ),
        null
      );
    },
    i(r) {
      e || (Fi(n, r), e = !0);
    },
    o(r) {
      Mi(n, r), e = !1;
    },
    d(r) {
      n && n.d(r);
    }
  };
}
function wg(i) {
  let e, t, n, r, s;
  const u = [bg, gg], l = [];
  function o(h, d) {
    return d & /*href*/
    1 && (e = null), e == null && (e = !!/*worker_proxy*/
    (h[4] && ug(
      /*href*/
      h[0]
    ))), e ? 0 : 1;
  }
  return t = o(i, -1), n = l[t] = u[t](i), {
    c() {
      n.c(), r = gs();
    },
    l(h) {
      n.l(h), r = gs();
    },
    m(h, d) {
      l[t].m(h, d), Fs(h, r, d), s = !0;
    },
    p(h, [d]) {
      let c = t;
      t = o(h, d), t === c ? l[t].p(h, d) : (Sc(), Mi(l[c], 1, 1, () => {
        l[c] = null;
      }), vc(), n = l[t], n ? n.p(h, d) : (n = l[t] = u[t](h), n.c()), Fi(n, 1), n.m(r.parentNode, r));
    },
    i(h) {
      s || (Fi(n), s = !0);
    },
    o(h) {
      Mi(n), s = !1;
    },
    d(h) {
      h && Yi(r), l[t].d(h);
    }
  };
}
function Ag(i, e, t) {
  const n = ["href", "download"];
  let r = A0(e, n), { $$slots: s = {}, $$scope: u } = e;
  var l = this && this.__awaiter || function(A, m, k, a) {
    function p(b) {
      return b instanceof k ? b : new k(function(y) {
        y(b);
      });
    }
    return new (k || (k = Promise))(function(b, y) {
      function C(P) {
        try {
          L(a.next(P));
        } catch (O) {
          y(O);
        }
      }
      function M(P) {
        try {
          L(a.throw(P));
        } catch (O) {
          y(O);
        }
      }
      function L(P) {
        P.done ? b(P.value) : p(P.value).then(C, M);
      }
      L((a = a.apply(A, m || [])).next());
    });
  };
  let { href: o = void 0 } = e, { download: h } = e;
  const d = pg();
  let c = !1;
  const f = sg();
  function g() {
    return l(this, void 0, void 0, function* () {
      if (c)
        return;
      if (d("click"), o == null)
        throw new Error("href is not defined.");
      if (f == null)
        throw new Error("Wasm worker proxy is not available.");
      const m = new URL(o, window.location.href).pathname;
      t(2, c = !0), f.httpRequest({
        method: "GET",
        path: m,
        headers: {},
        query_string: ""
      }).then((k) => {
        if (k.status !== 200)
          throw new Error(`Failed to get file ${m} from the Wasm worker.`);
        const a = new Blob(
          [k.body],
          {
            type: lg(k.headers, "content-type")
          }
        ), p = URL.createObjectURL(a), b = document.createElement("a");
        b.href = p, b.download = h, b.click(), URL.revokeObjectURL(p);
      }).finally(() => {
        t(2, c = !1);
      });
    });
  }
  return i.$$set = (A) => {
    e = ps(ps({}, e), hg(A)), t(6, r = A0(e, n)), "href" in A && t(0, o = A.href), "download" in A && t(1, h = A.download), "$$scope" in A && t(7, u = A.$$scope);
  }, [
    o,
    h,
    c,
    d,
    f,
    g,
    r,
    u,
    s
  ];
}
class kg extends cg {
  constructor(e) {
    super(), dg(this, e, Ag, wg, mg, { href: 0, download: 1 });
  }
}
const {
  SvelteComponent: Sg,
  check_outros: ya,
  claim_component: Ki,
  claim_space: Yr,
  create_component: Zi,
  create_slot: xg,
  destroy_component: Qi,
  detach: Wr,
  get_all_dirty_from_scope: Eg,
  get_slot_changes: _g,
  group_outros: wa,
  init: Tg,
  insert_hydration: $r,
  mount_component: Ji,
  safe_not_equal: Cg,
  space: Kr,
  transition_in: At,
  transition_out: Ot,
  update_slot_base: Dg
} = window.__gradio__svelte__internal, { createEventDispatcher: Fg } = window.__gradio__svelte__internal;
function S0(i) {
  let e, t;
  return e = new kr({
    props: {
      Icon: Xc,
      label: (
        /*i18n*/
        i[3]("common.edit")
      )
    }
  }), e.$on(
    "click",
    /*click_handler*/
    i[6]
  ), {
    c() {
      Zi(e.$$.fragment);
    },
    l(n) {
      Ki(e.$$.fragment, n);
    },
    m(n, r) {
      Ji(e, n, r), t = !0;
    },
    p(n, r) {
      const s = {};
      r & /*i18n*/
      8 && (s.label = /*i18n*/
      n[3]("common.edit")), e.$set(s);
    },
    i(n) {
      t || (At(e.$$.fragment, n), t = !0);
    },
    o(n) {
      Ot(e.$$.fragment, n), t = !1;
    },
    d(n) {
      Qi(e, n);
    }
  };
}
function x0(i) {
  let e, t;
  return e = new kr({
    props: {
      Icon: ih,
      label: (
        /*i18n*/
        i[3]("common.undo")
      )
    }
  }), e.$on(
    "click",
    /*click_handler_1*/
    i[7]
  ), {
    c() {
      Zi(e.$$.fragment);
    },
    l(n) {
      Ki(e.$$.fragment, n);
    },
    m(n, r) {
      Ji(e, n, r), t = !0;
    },
    p(n, r) {
      const s = {};
      r & /*i18n*/
      8 && (s.label = /*i18n*/
      n[3]("common.undo")), e.$set(s);
    },
    i(n) {
      t || (At(e.$$.fragment, n), t = !0);
    },
    o(n) {
      Ot(e.$$.fragment, n), t = !1;
    },
    d(n) {
      Qi(e, n);
    }
  };
}
function E0(i) {
  let e, t;
  return e = new kg({
    props: {
      href: (
        /*download*/
        i[2]
      ),
      download: !0,
      $$slots: { default: [Mg] },
      $$scope: { ctx: i }
    }
  }), {
    c() {
      Zi(e.$$.fragment);
    },
    l(n) {
      Ki(e.$$.fragment, n);
    },
    m(n, r) {
      Ji(e, n, r), t = !0;
    },
    p(n, r) {
      const s = {};
      r & /*download*/
      4 && (s.href = /*download*/
      n[2]), r & /*$$scope, i18n*/
      520 && (s.$$scope = { dirty: r, ctx: n }), e.$set(s);
    },
    i(n) {
      t || (At(e.$$.fragment, n), t = !0);
    },
    o(n) {
      Ot(e.$$.fragment, n), t = !1;
    },
    d(n) {
      Qi(e, n);
    }
  };
}
function Mg(i) {
  let e, t;
  return e = new kr({
    props: {
      Icon: zc,
      label: (
        /*i18n*/
        i[3]("common.download")
      )
    }
  }), {
    c() {
      Zi(e.$$.fragment);
    },
    l(n) {
      Ki(e.$$.fragment, n);
    },
    m(n, r) {
      Ji(e, n, r), t = !0;
    },
    p(n, r) {
      const s = {};
      r & /*i18n*/
      8 && (s.label = /*i18n*/
      n[3]("common.download")), e.$set(s);
    },
    i(n) {
      t || (At(e.$$.fragment, n), t = !0);
    },
    o(n) {
      Ot(e.$$.fragment, n), t = !1;
    },
    d(n) {
      Qi(e, n);
    }
  };
}
function Rg(i) {
  let e, t, n, r, s, u, l = (
    /*editable*/
    i[0] && S0(i)
  ), o = (
    /*undoable*/
    i[1] && x0(i)
  ), h = (
    /*download*/
    i[2] && E0(i)
  );
  const d = (
    /*#slots*/
    i[5].default
  ), c = xg(
    d,
    i,
    /*$$scope*/
    i[9],
    null
  );
  return s = new kr({
    props: {
      Icon: N0,
      label: (
        /*i18n*/
        i[3]("common.clear")
      )
    }
  }), s.$on(
    "click",
    /*click_handler_2*/
    i[8]
  ), {
    c() {
      l && l.c(), e = Kr(), o && o.c(), t = Kr(), h && h.c(), n = Kr(), c && c.c(), r = Kr(), Zi(s.$$.fragment);
    },
    l(f) {
      l && l.l(f), e = Yr(f), o && o.l(f), t = Yr(f), h && h.l(f), n = Yr(f), c && c.l(f), r = Yr(f), Ki(s.$$.fragment, f);
    },
    m(f, g) {
      l && l.m(f, g), $r(f, e, g), o && o.m(f, g), $r(f, t, g), h && h.m(f, g), $r(f, n, g), c && c.m(f, g), $r(f, r, g), Ji(s, f, g), u = !0;
    },
    p(f, g) {
      /*editable*/
      f[0] ? l ? (l.p(f, g), g & /*editable*/
      1 && At(l, 1)) : (l = S0(f), l.c(), At(l, 1), l.m(e.parentNode, e)) : l && (wa(), Ot(l, 1, 1, () => {
        l = null;
      }), ya()), /*undoable*/
      f[1] ? o ? (o.p(f, g), g & /*undoable*/
      2 && At(o, 1)) : (o = x0(f), o.c(), At(o, 1), o.m(t.parentNode, t)) : o && (wa(), Ot(o, 1, 1, () => {
        o = null;
      }), ya()), /*download*/
      f[2] ? h ? (h.p(f, g), g & /*download*/
      4 && At(h, 1)) : (h = E0(f), h.c(), At(h, 1), h.m(n.parentNode, n)) : h && (wa(), Ot(h, 1, 1, () => {
        h = null;
      }), ya()), c && c.p && (!u || g & /*$$scope*/
      512) && Dg(
        c,
        d,
        f,
        /*$$scope*/
        f[9],
        u ? _g(
          d,
          /*$$scope*/
          f[9],
          g,
          null
        ) : Eg(
          /*$$scope*/
          f[9]
        ),
        null
      );
      const A = {};
      g & /*i18n*/
      8 && (A.label = /*i18n*/
      f[3]("common.clear")), s.$set(A);
    },
    i(f) {
      u || (At(l), At(o), At(h), At(c, f), At(s.$$.fragment, f), u = !0);
    },
    o(f) {
      Ot(l), Ot(o), Ot(h), Ot(c, f), Ot(s.$$.fragment, f), u = !1;
    },
    d(f) {
      f && (Wr(e), Wr(t), Wr(n), Wr(r)), l && l.d(f), o && o.d(f), h && h.d(f), c && c.d(f), Qi(s, f);
    }
  };
}
function Lg(i) {
  let e, t;
  return e = new fp({
    props: {
      $$slots: { default: [Rg] },
      $$scope: { ctx: i }
    }
  }), {
    c() {
      Zi(e.$$.fragment);
    },
    l(n) {
      Ki(e.$$.fragment, n);
    },
    m(n, r) {
      Ji(e, n, r), t = !0;
    },
    p(n, [r]) {
      const s = {};
      r & /*$$scope, i18n, download, undoable, editable*/
      527 && (s.$$scope = { dirty: r, ctx: n }), e.$set(s);
    },
    i(n) {
      t || (At(e.$$.fragment, n), t = !0);
    },
    o(n) {
      Ot(e.$$.fragment, n), t = !1;
    },
    d(n) {
      Qi(e, n);
    }
  };
}
function Ig(i, e, t) {
  let { $$slots: n = {}, $$scope: r } = e, { editable: s = !1 } = e, { undoable: u = !1 } = e, { download: l = null } = e, { i18n: o } = e;
  const h = Fg(), d = () => h("edit"), c = () => h("undo"), f = (g) => {
    h("clear"), g.stopPropagation();
  };
  return i.$$set = (g) => {
    "editable" in g && t(0, s = g.editable), "undoable" in g && t(1, u = g.undoable), "download" in g && t(2, l = g.download), "i18n" in g && t(3, o = g.i18n), "$$scope" in g && t(9, r = g.$$scope);
  }, [
    s,
    u,
    l,
    o,
    h,
    n,
    d,
    c,
    f,
    r
  ];
}
class Ng extends Sg {
  constructor(e) {
    super(), Tg(this, e, Ig, Lg, Cg, {
      editable: 0,
      undoable: 1,
      download: 2,
      i18n: 3
    });
  }
}
var Pg = {
  /***/
  976: (
    /***/
    (i, e, t) => {
      t.d(e, {
        AnnotationLayer: () => (
          /* binding */
          ae
        ),
        FreeTextAnnotationElement: () => (
          /* binding */
          Y
        ),
        InkAnnotationElement: () => (
          /* binding */
          le
        ),
        StampAnnotationElement: () => (
          /* binding */
          ke
        )
      });
      var n = t(292), r = t(419), s = t(792);
      function u(de) {
        return Math.floor(Math.max(0, Math.min(1, de)) * 255).toString(16).padStart(2, "0");
      }
      function l(de) {
        return Math.max(0, Math.min(255, 255 * de));
      }
      class o {
        static CMYK_G([R, D, v, S]) {
          return ["G", 1 - Math.min(1, 0.3 * R + 0.59 * v + 0.11 * D + S)];
        }
        static G_CMYK([R]) {
          return ["CMYK", 0, 0, 0, 1 - R];
        }
        static G_RGB([R]) {
          return ["RGB", R, R, R];
        }
        static G_rgb([R]) {
          return R = l(R), [R, R, R];
        }
        static G_HTML([R]) {
          const D = u(R);
          return `#${D}${D}${D}`;
        }
        static RGB_G([R, D, v]) {
          return ["G", 0.3 * R + 0.59 * D + 0.11 * v];
        }
        static RGB_rgb(R) {
          return R.map(l);
        }
        static RGB_HTML(R) {
          return `#${R.map(u).join("")}`;
        }
        static T_HTML() {
          return "#00000000";
        }
        static T_rgb() {
          return [null];
        }
        static CMYK_RGB([R, D, v, S]) {
          return ["RGB", 1 - Math.min(1, R + S), 1 - Math.min(1, v + S), 1 - Math.min(1, D + S)];
        }
        static CMYK_rgb([R, D, v, S]) {
          return [l(1 - Math.min(1, R + S)), l(1 - Math.min(1, v + S)), l(1 - Math.min(1, D + S))];
        }
        static CMYK_HTML(R) {
          const D = this.CMYK_RGB(R).slice(1);
          return this.RGB_HTML(D);
        }
        static RGB_CMYK([R, D, v]) {
          const S = 1 - R, E = 1 - D, _ = 1 - v, x = Math.min(S, E, _);
          return ["CMYK", S, E, _, x];
        }
      }
      var h = t(284);
      const d = 1e3, c = 9, f = /* @__PURE__ */ new WeakSet();
      function g(de) {
        return {
          width: de[2] - de[0],
          height: de[3] - de[1]
        };
      }
      class A {
        static create(R) {
          switch (R.data.annotationType) {
            case n.AnnotationType.LINK:
              return new k(R);
            case n.AnnotationType.TEXT:
              return new a(R);
            case n.AnnotationType.WIDGET:
              switch (R.data.fieldType) {
                case "Tx":
                  return new b(R);
                case "Btn":
                  return R.data.radioButton ? new M(R) : R.data.checkBox ? new C(R) : new L(R);
                case "Ch":
                  return new P(R);
                case "Sig":
                  return new y(R);
              }
              return new p(R);
            case n.AnnotationType.POPUP:
              return new O(R);
            case n.AnnotationType.FREETEXT:
              return new Y(R);
            case n.AnnotationType.LINE:
              return new se(R);
            case n.AnnotationType.SQUARE:
              return new me(R);
            case n.AnnotationType.CIRCLE:
              return new te(R);
            case n.AnnotationType.POLYLINE:
              return new K(R);
            case n.AnnotationType.CARET:
              return new oe(R);
            case n.AnnotationType.INK:
              return new le(R);
            case n.AnnotationType.POLYGON:
              return new Z(R);
            case n.AnnotationType.HIGHLIGHT:
              return new ie(R);
            case n.AnnotationType.UNDERLINE:
              return new pe(R);
            case n.AnnotationType.SQUIGGLY:
              return new he(R);
            case n.AnnotationType.STRIKEOUT:
              return new we(R);
            case n.AnnotationType.STAMP:
              return new ke(R);
            case n.AnnotationType.FILEATTACHMENT:
              return new Ae(R);
            default:
              return new m(R);
          }
        }
      }
      class m {
        #e = null;
        #t = !1;
        constructor(R, {
          isRenderable: D = !1,
          ignoreBorder: v = !1,
          createQuadrilaterals: S = !1
        } = {}) {
          this.isRenderable = D, this.data = R.data, this.layer = R.layer, this.linkService = R.linkService, this.downloadManager = R.downloadManager, this.imageResourcesPath = R.imageResourcesPath, this.renderForms = R.renderForms, this.svgFactory = R.svgFactory, this.annotationStorage = R.annotationStorage, this.enableScripting = R.enableScripting, this.hasJSActions = R.hasJSActions, this._fieldObjects = R.fieldObjects, this.parent = R.parent, D && (this.container = this._createContainer(v)), S && this._createQuadrilaterals();
        }
        static _hasPopupData({
          titleObj: R,
          contentsObj: D,
          richText: v
        }) {
          return !!(R?.str || D?.str || v?.str);
        }
        get hasPopupData() {
          return m._hasPopupData(this.data);
        }
        updateEdited(R) {
          if (!this.container)
            return;
          this.#e ||= {
            rect: this.data.rect.slice(0)
          };
          const {
            rect: D
          } = R;
          D && this.#n(D);
        }
        resetEdited() {
          this.#e && (this.#n(this.#e.rect), this.#e = null);
        }
        #n(R) {
          const {
            container: {
              style: D
            },
            data: {
              rect: v,
              rotation: S
            },
            parent: {
              viewport: {
                rawDims: {
                  pageWidth: E,
                  pageHeight: _,
                  pageX: x,
                  pageY: F
                }
              }
            }
          } = this;
          v?.splice(0, 4, ...R);
          const {
            width: I,
            height: B
          } = g(R);
          D.left = `${100 * (R[0] - x) / E}%`, D.top = `${100 * (_ - R[3] + F) / _}%`, S === 0 ? (D.width = `${100 * I / E}%`, D.height = `${100 * B / _}%`) : this.setRotation(S);
        }
        _createContainer(R) {
          const {
            data: D,
            parent: {
              page: v,
              viewport: S
            }
          } = this, E = document.createElement("section");
          E.setAttribute("data-annotation-id", D.id), this instanceof p || (E.tabIndex = d);
          const {
            style: _
          } = E;
          if (_.zIndex = this.parent.zIndex++, D.popupRef && E.setAttribute("aria-haspopup", "dialog"), D.alternativeText && (E.title = D.alternativeText), D.noRotate && E.classList.add("norotate"), !D.rect || this instanceof O) {
            const {
              rotation: G
            } = D;
            return !D.hasOwnCanvas && G !== 0 && this.setRotation(G, E), E;
          }
          const {
            width: x,
            height: F
          } = g(D.rect);
          if (!R && D.borderStyle.width > 0) {
            _.borderWidth = `${D.borderStyle.width}px`;
            const G = D.borderStyle.horizontalCornerRadius, U = D.borderStyle.verticalCornerRadius;
            if (G > 0 || U > 0) {
              const fe = `calc(${G}px * var(--scale-factor)) / calc(${U}px * var(--scale-factor))`;
              _.borderRadius = fe;
            } else if (this instanceof M) {
              const fe = `calc(${x}px * var(--scale-factor)) / calc(${F}px * var(--scale-factor))`;
              _.borderRadius = fe;
            }
            switch (D.borderStyle.style) {
              case n.AnnotationBorderStyleType.SOLID:
                _.borderStyle = "solid";
                break;
              case n.AnnotationBorderStyleType.DASHED:
                _.borderStyle = "dashed";
                break;
              case n.AnnotationBorderStyleType.BEVELED:
                (0, n.warn)("Unimplemented border style: beveled");
                break;
              case n.AnnotationBorderStyleType.INSET:
                (0, n.warn)("Unimplemented border style: inset");
                break;
              case n.AnnotationBorderStyleType.UNDERLINE:
                _.borderBottomStyle = "solid";
                break;
            }
            const ee = D.borderColor || null;
            ee ? (this.#t = !0, _.borderColor = n.Util.makeHexColor(ee[0] | 0, ee[1] | 0, ee[2] | 0)) : _.borderWidth = 0;
          }
          const I = n.Util.normalizeRect([D.rect[0], v.view[3] - D.rect[1] + v.view[1], D.rect[2], v.view[3] - D.rect[3] + v.view[1]]), {
            pageWidth: B,
            pageHeight: H,
            pageX: V,
            pageY: $
          } = S.rawDims;
          _.left = `${100 * (I[0] - V) / B}%`, _.top = `${100 * (I[1] - $) / H}%`;
          const {
            rotation: X
          } = D;
          return D.hasOwnCanvas || X === 0 ? (_.width = `${100 * x / B}%`, _.height = `${100 * F / H}%`) : this.setRotation(X, E), E;
        }
        setRotation(R, D = this.container) {
          if (!this.data.rect)
            return;
          const {
            pageWidth: v,
            pageHeight: S
          } = this.parent.viewport.rawDims, {
            width: E,
            height: _
          } = g(this.data.rect);
          let x, F;
          R % 180 === 0 ? (x = 100 * E / v, F = 100 * _ / S) : (x = 100 * _ / v, F = 100 * E / S), D.style.width = `${x}%`, D.style.height = `${F}%`, D.setAttribute("data-main-rotation", (360 - R) % 360);
        }
        get _commonActions() {
          const R = (D, v, S) => {
            const E = S.detail[D], _ = E[0], x = E.slice(1);
            S.target.style[v] = o[`${_}_HTML`](x), this.annotationStorage.setValue(this.data.id, {
              [v]: o[`${_}_rgb`](x)
            });
          };
          return (0, n.shadow)(this, "_commonActions", {
            display: (D) => {
              const {
                display: v
              } = D.detail, S = v % 2 === 1;
              this.container.style.visibility = S ? "hidden" : "visible", this.annotationStorage.setValue(this.data.id, {
                noView: S,
                noPrint: v === 1 || v === 2
              });
            },
            print: (D) => {
              this.annotationStorage.setValue(this.data.id, {
                noPrint: !D.detail.print
              });
            },
            hidden: (D) => {
              const {
                hidden: v
              } = D.detail;
              this.container.style.visibility = v ? "hidden" : "visible", this.annotationStorage.setValue(this.data.id, {
                noPrint: v,
                noView: v
              });
            },
            focus: (D) => {
              setTimeout(() => D.target.focus({
                preventScroll: !1
              }), 0);
            },
            userName: (D) => {
              D.target.title = D.detail.userName;
            },
            readonly: (D) => {
              D.target.disabled = D.detail.readonly;
            },
            required: (D) => {
              this._setRequired(D.target, D.detail.required);
            },
            bgColor: (D) => {
              R("bgColor", "backgroundColor", D);
            },
            fillColor: (D) => {
              R("fillColor", "backgroundColor", D);
            },
            fgColor: (D) => {
              R("fgColor", "color", D);
            },
            textColor: (D) => {
              R("textColor", "color", D);
            },
            borderColor: (D) => {
              R("borderColor", "borderColor", D);
            },
            strokeColor: (D) => {
              R("strokeColor", "borderColor", D);
            },
            rotation: (D) => {
              const v = D.detail.rotation;
              this.setRotation(v), this.annotationStorage.setValue(this.data.id, {
                rotation: v
              });
            }
          });
        }
        _dispatchEventFromSandbox(R, D) {
          const v = this._commonActions;
          for (const S of Object.keys(D.detail))
            (R[S] || v[S])?.(D);
        }
        _setDefaultPropertiesFromJS(R) {
          if (!this.enableScripting)
            return;
          const D = this.annotationStorage.getRawValue(this.data.id);
          if (!D)
            return;
          const v = this._commonActions;
          for (const [S, E] of Object.entries(D)) {
            const _ = v[S];
            if (_) {
              const x = {
                detail: {
                  [S]: E
                },
                target: R
              };
              _(x), delete D[S];
            }
          }
        }
        _createQuadrilaterals() {
          if (!this.container)
            return;
          const {
            quadPoints: R
          } = this.data;
          if (!R)
            return;
          const [D, v, S, E] = this.data.rect;
          if (R.length === 1) {
            const [, {
              x: G,
              y: U
            }, {
              x: ee,
              y: fe
            }] = R[0];
            if (S === G && E === U && D === ee && v === fe)
              return;
          }
          const {
            style: _
          } = this.container;
          let x;
          if (this.#t) {
            const {
              borderColor: G,
              borderWidth: U
            } = _;
            _.borderWidth = 0, x = ["url('data:image/svg+xml;utf8,", '<svg xmlns="http://www.w3.org/2000/svg"', ' preserveAspectRatio="none" viewBox="0 0 1 1">', `<g fill="transparent" stroke="${G}" stroke-width="${U}">`], this.container.classList.add("hasBorder");
          }
          const F = S - D, I = E - v, {
            svgFactory: B
          } = this, H = B.createElement("svg");
          H.classList.add("quadrilateralsContainer"), H.setAttribute("width", 0), H.setAttribute("height", 0);
          const V = B.createElement("defs");
          H.append(V);
          const $ = B.createElement("clipPath"), X = `clippath_${this.data.id}`;
          $.setAttribute("id", X), $.setAttribute("clipPathUnits", "objectBoundingBox"), V.append($);
          for (const [, {
            x: G,
            y: U
          }, {
            x: ee,
            y: fe
          }] of R) {
            const re = B.createElement("rect"), ue = (ee - D) / F, _e = (E - U) / I, ve = (G - ee) / F, be = (U - fe) / I;
            re.setAttribute("x", ue), re.setAttribute("y", _e), re.setAttribute("width", ve), re.setAttribute("height", be), $.append(re), x?.push(`<rect vector-effect="non-scaling-stroke" x="${ue}" y="${_e}" width="${ve}" height="${be}"/>`);
          }
          this.#t && (x.push("</g></svg>')"), _.backgroundImage = x.join("")), this.container.append(H), this.container.style.clipPath = `url(#${X})`;
        }
        _createPopup() {
          const {
            container: R,
            data: D
          } = this;
          R.setAttribute("aria-haspopup", "dialog");
          const v = new O({
            data: {
              color: D.color,
              titleObj: D.titleObj,
              modificationDate: D.modificationDate,
              contentsObj: D.contentsObj,
              richText: D.richText,
              parentRect: D.rect,
              borderStyle: 0,
              id: `popup_${D.id}`,
              rotation: D.rotation
            },
            parent: this.parent,
            elements: [this]
          });
          this.parent.div.append(v.render());
        }
        render() {
          (0, n.unreachable)("Abstract method `AnnotationElement.render` called");
        }
        _getElementsByName(R, D = null) {
          const v = [];
          if (this._fieldObjects) {
            const S = this._fieldObjects[R];
            if (S)
              for (const {
                page: E,
                id: _,
                exportValues: x
              } of S) {
                if (E === -1 || _ === D)
                  continue;
                const F = typeof x == "string" ? x : null, I = document.querySelector(`[data-element-id="${_}"]`);
                if (I && !f.has(I)) {
                  (0, n.warn)(`_getElementsByName - element not allowed: ${_}`);
                  continue;
                }
                v.push({
                  id: _,
                  exportValue: F,
                  domElement: I
                });
              }
            return v;
          }
          for (const S of document.getElementsByName(R)) {
            const {
              exportValue: E
            } = S, _ = S.getAttribute("data-element-id");
            _ !== D && f.has(S) && v.push({
              id: _,
              exportValue: E,
              domElement: S
            });
          }
          return v;
        }
        show() {
          this.container && (this.container.hidden = !1), this.popup?.maybeShow();
        }
        hide() {
          this.container && (this.container.hidden = !0), this.popup?.forceHide();
        }
        getElementsToTriggerPopup() {
          return this.container;
        }
        addHighlightArea() {
          const R = this.getElementsToTriggerPopup();
          if (Array.isArray(R))
            for (const D of R)
              D.classList.add("highlightArea");
          else
            R.classList.add("highlightArea");
        }
        get _isEditable() {
          return !1;
        }
        _editOnDoubleClick() {
          if (!this._isEditable)
            return;
          const {
            annotationEditorType: R,
            data: {
              id: D
            }
          } = this;
          this.container.addEventListener("dblclick", () => {
            this.linkService.eventBus?.dispatch("switchannotationeditormode", {
              source: this,
              mode: R,
              editId: D
            });
          });
        }
      }
      class k extends m {
        constructor(R, D = null) {
          super(R, {
            isRenderable: !0,
            ignoreBorder: !!D?.ignoreBorder,
            createQuadrilaterals: !0
          }), this.isTooltipOnly = R.data.isTooltipOnly;
        }
        render() {
          const {
            data: R,
            linkService: D
          } = this, v = document.createElement("a");
          v.setAttribute("data-element-id", R.id);
          let S = !1;
          return R.url ? (D.addLinkAttributes(v, R.url, R.newWindow), S = !0) : R.action ? (this._bindNamedAction(v, R.action), S = !0) : R.attachment ? (this.#t(v, R.attachment, R.attachmentDest), S = !0) : R.setOCGState ? (this.#n(v, R.setOCGState), S = !0) : R.dest ? (this._bindLink(v, R.dest), S = !0) : (R.actions && (R.actions.Action || R.actions["Mouse Up"] || R.actions["Mouse Down"]) && this.enableScripting && this.hasJSActions && (this._bindJSAction(v, R), S = !0), R.resetForm ? (this._bindResetFormAction(v, R.resetForm), S = !0) : this.isTooltipOnly && !S && (this._bindLink(v, ""), S = !0)), this.container.classList.add("linkAnnotation"), S && this.container.append(v), this.container;
        }
        #e() {
          this.container.setAttribute("data-internal-link", "");
        }
        _bindLink(R, D) {
          R.href = this.linkService.getDestinationHash(D), R.onclick = () => (D && this.linkService.goToDestination(D), !1), (D || D === "") && this.#e();
        }
        _bindNamedAction(R, D) {
          R.href = this.linkService.getAnchorUrl(""), R.onclick = () => (this.linkService.executeNamedAction(D), !1), this.#e();
        }
        #t(R, D, v = null) {
          R.href = this.linkService.getAnchorUrl(""), R.onclick = () => (this.downloadManager?.openOrDownloadData(D.content, D.filename, v), !1), this.#e();
        }
        #n(R, D) {
          R.href = this.linkService.getAnchorUrl(""), R.onclick = () => (this.linkService.executeSetOCGState(D), !1), this.#e();
        }
        _bindJSAction(R, D) {
          R.href = this.linkService.getAnchorUrl("");
          const v = /* @__PURE__ */ new Map([["Action", "onclick"], ["Mouse Up", "onmouseup"], ["Mouse Down", "onmousedown"]]);
          for (const S of Object.keys(D.actions)) {
            const E = v.get(S);
            E && (R[E] = () => (this.linkService.eventBus?.dispatch("dispatcheventinsandbox", {
              source: this,
              detail: {
                id: D.id,
                name: S
              }
            }), !1));
          }
          R.onclick || (R.onclick = () => !1), this.#e();
        }
        _bindResetFormAction(R, D) {
          const v = R.onclick;
          if (v || (R.href = this.linkService.getAnchorUrl("")), this.#e(), !this._fieldObjects) {
            (0, n.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'), v || (R.onclick = () => !1);
            return;
          }
          R.onclick = () => {
            v?.();
            const {
              fields: S,
              refs: E,
              include: _
            } = D, x = [];
            if (S.length !== 0 || E.length !== 0) {
              const B = new Set(E);
              for (const H of S) {
                const V = this._fieldObjects[H] || [];
                for (const {
                  id: $
                } of V)
                  B.add($);
              }
              for (const H of Object.values(this._fieldObjects))
                for (const V of H)
                  B.has(V.id) === _ && x.push(V);
            } else
              for (const B of Object.values(this._fieldObjects))
                x.push(...B);
            const F = this.annotationStorage, I = [];
            for (const B of x) {
              const {
                id: H
              } = B;
              switch (I.push(H), B.type) {
                case "text": {
                  const $ = B.defaultValue || "";
                  F.setValue(H, {
                    value: $
                  });
                  break;
                }
                case "checkbox":
                case "radiobutton": {
                  const $ = B.defaultValue === B.exportValues;
                  F.setValue(H, {
                    value: $
                  });
                  break;
                }
                case "combobox":
                case "listbox": {
                  const $ = B.defaultValue || "";
                  F.setValue(H, {
                    value: $
                  });
                  break;
                }
                default:
                  continue;
              }
              const V = document.querySelector(`[data-element-id="${H}"]`);
              if (V) {
                if (!f.has(V)) {
                  (0, n.warn)(`_bindResetFormAction - element not allowed: ${H}`);
                  continue;
                }
              } else continue;
              V.dispatchEvent(new Event("resetform"));
            }
            return this.enableScripting && this.linkService.eventBus?.dispatch("dispatcheventinsandbox", {
              source: this,
              detail: {
                id: "app",
                ids: I,
                name: "ResetForm"
              }
            }), !1;
          };
        }
      }
      class a extends m {
        constructor(R) {
          super(R, {
            isRenderable: !0
          });
        }
        render() {
          this.container.classList.add("textAnnotation");
          const R = document.createElement("img");
          return R.src = this.imageResourcesPath + "annotation-" + this.data.name.toLowerCase() + ".svg", R.setAttribute("data-l10n-id", "pdfjs-text-annotation-type"), R.setAttribute("data-l10n-args", JSON.stringify({
            type: this.data.name
          })), !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.append(R), this.container;
        }
      }
      class p extends m {
        render() {
          return this.container;
        }
        showElementAndHideCanvas(R) {
          this.data.hasOwnCanvas && (R.previousSibling?.nodeName === "CANVAS" && (R.previousSibling.hidden = !0), R.hidden = !1);
        }
        _getKeyModifier(R) {
          return n.FeatureTest.platform.isMac ? R.metaKey : R.ctrlKey;
        }
        _setEventListener(R, D, v, S, E) {
          v.includes("mouse") ? R.addEventListener(v, (_) => {
            this.linkService.eventBus?.dispatch("dispatcheventinsandbox", {
              source: this,
              detail: {
                id: this.data.id,
                name: S,
                value: E(_),
                shift: _.shiftKey,
                modifier: this._getKeyModifier(_)
              }
            });
          }) : R.addEventListener(v, (_) => {
            if (v === "blur") {
              if (!D.focused || !_.relatedTarget)
                return;
              D.focused = !1;
            } else if (v === "focus") {
              if (D.focused)
                return;
              D.focused = !0;
            }
            E && this.linkService.eventBus?.dispatch("dispatcheventinsandbox", {
              source: this,
              detail: {
                id: this.data.id,
                name: S,
                value: E(_)
              }
            });
          });
        }
        _setEventListeners(R, D, v, S) {
          for (const [E, _] of v)
            (_ === "Action" || this.data.actions?.[_]) && ((_ === "Focus" || _ === "Blur") && (D ||= {
              focused: !1
            }), this._setEventListener(R, D, E, _, S), _ === "Focus" && !this.data.actions?.Blur ? this._setEventListener(R, D, "blur", "Blur", null) : _ === "Blur" && !this.data.actions?.Focus && this._setEventListener(R, D, "focus", "Focus", null));
        }
        _setBackgroundColor(R) {
          const D = this.data.backgroundColor || null;
          R.style.backgroundColor = D === null ? "transparent" : n.Util.makeHexColor(D[0], D[1], D[2]);
        }
        _setTextStyle(R) {
          const D = ["left", "center", "right"], {
            fontColor: v
          } = this.data.defaultAppearanceData, S = this.data.defaultAppearanceData.fontSize || c, E = R.style;
          let _;
          const x = 2, F = (I) => Math.round(10 * I) / 10;
          if (this.data.multiLine) {
            const I = Math.abs(this.data.rect[3] - this.data.rect[1] - x), B = Math.round(I / (n.LINE_FACTOR * S)) || 1, H = I / B;
            _ = Math.min(S, F(H / n.LINE_FACTOR));
          } else {
            const I = Math.abs(this.data.rect[3] - this.data.rect[1] - x);
            _ = Math.min(S, F(I / n.LINE_FACTOR));
          }
          E.fontSize = `calc(${_}px * var(--scale-factor))`, E.color = n.Util.makeHexColor(v[0], v[1], v[2]), this.data.textAlignment !== null && (E.textAlign = D[this.data.textAlignment]);
        }
        _setRequired(R, D) {
          D ? R.setAttribute("required", !0) : R.removeAttribute("required"), R.setAttribute("aria-required", D);
        }
      }
      class b extends p {
        constructor(R) {
          const D = R.renderForms || R.data.hasOwnCanvas || !R.data.hasAppearance && !!R.data.fieldValue;
          super(R, {
            isRenderable: D
          });
        }
        setPropertyOnSiblings(R, D, v, S) {
          const E = this.annotationStorage;
          for (const _ of this._getElementsByName(R.name, R.id))
            _.domElement && (_.domElement[D] = v), E.setValue(_.id, {
              [S]: v
            });
        }
        render() {
          const R = this.annotationStorage, D = this.data.id;
          this.container.classList.add("textWidgetAnnotation");
          let v = null;
          if (this.renderForms) {
            const S = R.getValue(D, {
              value: this.data.fieldValue
            });
            let E = S.value || "";
            const _ = R.getValue(D, {
              charLimit: this.data.maxLen
            }).charLimit;
            _ && E.length > _ && (E = E.slice(0, _));
            let x = S.formattedValue || this.data.textContent?.join(`
`) || null;
            x && this.data.comb && (x = x.replaceAll(/\s+/g, ""));
            const F = {
              userValue: E,
              formattedValue: x,
              lastCommittedValue: null,
              commitKey: 1,
              focused: !1
            };
            this.data.multiLine ? (v = document.createElement("textarea"), v.textContent = x ?? E, this.data.doNotScroll && (v.style.overflowY = "hidden")) : (v = document.createElement("input"), v.type = "text", v.setAttribute("value", x ?? E), this.data.doNotScroll && (v.style.overflowX = "hidden")), this.data.hasOwnCanvas && (v.hidden = !0), f.add(v), v.setAttribute("data-element-id", D), v.disabled = this.data.readOnly, v.name = this.data.fieldName, v.tabIndex = d, this._setRequired(v, this.data.required), _ && (v.maxLength = _), v.addEventListener("input", (B) => {
              R.setValue(D, {
                value: B.target.value
              }), this.setPropertyOnSiblings(v, "value", B.target.value, "value"), F.formattedValue = null;
            }), v.addEventListener("resetform", (B) => {
              const H = this.data.defaultFieldValue ?? "";
              v.value = F.userValue = H, F.formattedValue = null;
            });
            let I = (B) => {
              const {
                formattedValue: H
              } = F;
              H != null && (B.target.value = H), B.target.scrollLeft = 0;
            };
            if (this.enableScripting && this.hasJSActions) {
              v.addEventListener("focus", (H) => {
                if (F.focused)
                  return;
                const {
                  target: V
                } = H;
                F.userValue && (V.value = F.userValue), F.lastCommittedValue = V.value, F.commitKey = 1, this.data.actions?.Focus || (F.focused = !0);
              }), v.addEventListener("updatefromsandbox", (H) => {
                this.showElementAndHideCanvas(H.target);
                const V = {
                  value($) {
                    F.userValue = $.detail.value ?? "", R.setValue(D, {
                      value: F.userValue.toString()
                    }), $.target.value = F.userValue;
                  },
                  formattedValue($) {
                    const {
                      formattedValue: X
                    } = $.detail;
                    F.formattedValue = X, X != null && $.target !== document.activeElement && ($.target.value = X), R.setValue(D, {
                      formattedValue: X
                    });
                  },
                  selRange($) {
                    $.target.setSelectionRange(...$.detail.selRange);
                  },
                  charLimit: ($) => {
                    const {
                      charLimit: X
                    } = $.detail, {
                      target: G
                    } = $;
                    if (X === 0) {
                      G.removeAttribute("maxLength");
                      return;
                    }
                    G.setAttribute("maxLength", X);
                    let U = F.userValue;
                    !U || U.length <= X || (U = U.slice(0, X), G.value = F.userValue = U, R.setValue(D, {
                      value: U
                    }), this.linkService.eventBus?.dispatch("dispatcheventinsandbox", {
                      source: this,
                      detail: {
                        id: D,
                        name: "Keystroke",
                        value: U,
                        willCommit: !0,
                        commitKey: 1,
                        selStart: G.selectionStart,
                        selEnd: G.selectionEnd
                      }
                    }));
                  }
                };
                this._dispatchEventFromSandbox(V, H);
              }), v.addEventListener("keydown", (H) => {
                F.commitKey = 1;
                let V = -1;
                if (H.key === "Escape" ? V = 0 : H.key === "Enter" && !this.data.multiLine ? V = 2 : H.key === "Tab" && (F.commitKey = 3), V === -1)
                  return;
                const {
                  value: $
                } = H.target;
                F.lastCommittedValue !== $ && (F.lastCommittedValue = $, F.userValue = $, this.linkService.eventBus?.dispatch("dispatcheventinsandbox", {
                  source: this,
                  detail: {
                    id: D,
                    name: "Keystroke",
                    value: $,
                    willCommit: !0,
                    commitKey: V,
                    selStart: H.target.selectionStart,
                    selEnd: H.target.selectionEnd
                  }
                }));
              });
              const B = I;
              I = null, v.addEventListener("blur", (H) => {
                if (!F.focused || !H.relatedTarget)
                  return;
                this.data.actions?.Blur || (F.focused = !1);
                const {
                  value: V
                } = H.target;
                F.userValue = V, F.lastCommittedValue !== V && this.linkService.eventBus?.dispatch("dispatcheventinsandbox", {
                  source: this,
                  detail: {
                    id: D,
                    name: "Keystroke",
                    value: V,
                    willCommit: !0,
                    commitKey: F.commitKey,
                    selStart: H.target.selectionStart,
                    selEnd: H.target.selectionEnd
                  }
                }), B(H);
              }), this.data.actions?.Keystroke && v.addEventListener("beforeinput", (H) => {
                F.lastCommittedValue = null;
                const {
                  data: V,
                  target: $
                } = H, {
                  value: X,
                  selectionStart: G,
                  selectionEnd: U
                } = $;
                let ee = G, fe = U;
                switch (H.inputType) {
                  case "deleteWordBackward": {
                    const re = X.substring(0, G).match(/\w*[^\w]*$/);
                    re && (ee -= re[0].length);
                    break;
                  }
                  case "deleteWordForward": {
                    const re = X.substring(G).match(/^[^\w]*\w*/);
                    re && (fe += re[0].length);
                    break;
                  }
                  case "deleteContentBackward":
                    G === U && (ee -= 1);
                    break;
                  case "deleteContentForward":
                    G === U && (fe += 1);
                    break;
                }
                H.preventDefault(), this.linkService.eventBus?.dispatch("dispatcheventinsandbox", {
                  source: this,
                  detail: {
                    id: D,
                    name: "Keystroke",
                    value: X,
                    change: V || "",
                    willCommit: !1,
                    selStart: ee,
                    selEnd: fe
                  }
                });
              }), this._setEventListeners(v, F, [["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"]], (H) => H.target.value);
            }
            if (I && v.addEventListener("blur", I), this.data.comb) {
              const H = (this.data.rect[2] - this.data.rect[0]) / _;
              v.classList.add("comb"), v.style.letterSpacing = `calc(${H}px * var(--scale-factor) - 1ch)`;
            }
          } else
            v = document.createElement("div"), v.textContent = this.data.fieldValue, v.style.verticalAlign = "middle", v.style.display = "table-cell", this.data.hasOwnCanvas && (v.hidden = !0);
          return this._setTextStyle(v), this._setBackgroundColor(v), this._setDefaultPropertiesFromJS(v), this.container.append(v), this.container;
        }
      }
      class y extends p {
        constructor(R) {
          super(R, {
            isRenderable: !!R.data.hasOwnCanvas
          });
        }
      }
      class C extends p {
        constructor(R) {
          super(R, {
            isRenderable: R.renderForms
          });
        }
        render() {
          const R = this.annotationStorage, D = this.data, v = D.id;
          let S = R.getValue(v, {
            value: D.exportValue === D.fieldValue
          }).value;
          typeof S == "string" && (S = S !== "Off", R.setValue(v, {
            value: S
          })), this.container.classList.add("buttonWidgetAnnotation", "checkBox");
          const E = document.createElement("input");
          return f.add(E), E.setAttribute("data-element-id", v), E.disabled = D.readOnly, this._setRequired(E, this.data.required), E.type = "checkbox", E.name = D.fieldName, S && E.setAttribute("checked", !0), E.setAttribute("exportValue", D.exportValue), E.tabIndex = d, E.addEventListener("change", (_) => {
            const {
              name: x,
              checked: F
            } = _.target;
            for (const I of this._getElementsByName(x, v)) {
              const B = F && I.exportValue === D.exportValue;
              I.domElement && (I.domElement.checked = B), R.setValue(I.id, {
                value: B
              });
            }
            R.setValue(v, {
              value: F
            });
          }), E.addEventListener("resetform", (_) => {
            const x = D.defaultFieldValue || "Off";
            _.target.checked = x === D.exportValue;
          }), this.enableScripting && this.hasJSActions && (E.addEventListener("updatefromsandbox", (_) => {
            const x = {
              value(F) {
                F.target.checked = F.detail.value !== "Off", R.setValue(v, {
                  value: F.target.checked
                });
              }
            };
            this._dispatchEventFromSandbox(x, _);
          }), this._setEventListeners(E, null, [["change", "Validate"], ["change", "Action"], ["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"]], (_) => _.target.checked)), this._setBackgroundColor(E), this._setDefaultPropertiesFromJS(E), this.container.append(E), this.container;
        }
      }
      class M extends p {
        constructor(R) {
          super(R, {
            isRenderable: R.renderForms
          });
        }
        render() {
          this.container.classList.add("buttonWidgetAnnotation", "radioButton");
          const R = this.annotationStorage, D = this.data, v = D.id;
          let S = R.getValue(v, {
            value: D.fieldValue === D.buttonValue
          }).value;
          if (typeof S == "string" && (S = S !== D.buttonValue, R.setValue(v, {
            value: S
          })), S)
            for (const _ of this._getElementsByName(D.fieldName, v))
              R.setValue(_.id, {
                value: !1
              });
          const E = document.createElement("input");
          if (f.add(E), E.setAttribute("data-element-id", v), E.disabled = D.readOnly, this._setRequired(E, this.data.required), E.type = "radio", E.name = D.fieldName, S && E.setAttribute("checked", !0), E.tabIndex = d, E.addEventListener("change", (_) => {
            const {
              name: x,
              checked: F
            } = _.target;
            for (const I of this._getElementsByName(x, v))
              R.setValue(I.id, {
                value: !1
              });
            R.setValue(v, {
              value: F
            });
          }), E.addEventListener("resetform", (_) => {
            const x = D.defaultFieldValue;
            _.target.checked = x != null && x === D.buttonValue;
          }), this.enableScripting && this.hasJSActions) {
            const _ = D.buttonValue;
            E.addEventListener("updatefromsandbox", (x) => {
              const F = {
                value: (I) => {
                  const B = _ === I.detail.value;
                  for (const H of this._getElementsByName(I.target.name)) {
                    const V = B && H.id === v;
                    H.domElement && (H.domElement.checked = V), R.setValue(H.id, {
                      value: V
                    });
                  }
                }
              };
              this._dispatchEventFromSandbox(F, x);
            }), this._setEventListeners(E, null, [["change", "Validate"], ["change", "Action"], ["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"]], (x) => x.target.checked);
          }
          return this._setBackgroundColor(E), this._setDefaultPropertiesFromJS(E), this.container.append(E), this.container;
        }
      }
      class L extends k {
        constructor(R) {
          super(R, {
            ignoreBorder: R.data.hasAppearance
          });
        }
        render() {
          const R = super.render();
          R.classList.add("buttonWidgetAnnotation", "pushButton");
          const D = R.lastChild;
          return this.enableScripting && this.hasJSActions && D && (this._setDefaultPropertiesFromJS(D), D.addEventListener("updatefromsandbox", (v) => {
            this._dispatchEventFromSandbox({}, v);
          })), R;
        }
      }
      class P extends p {
        constructor(R) {
          super(R, {
            isRenderable: R.renderForms
          });
        }
        render() {
          this.container.classList.add("choiceWidgetAnnotation");
          const R = this.annotationStorage, D = this.data.id, v = R.getValue(D, {
            value: this.data.fieldValue
          }), S = document.createElement("select");
          f.add(S), S.setAttribute("data-element-id", D), S.disabled = this.data.readOnly, this._setRequired(S, this.data.required), S.name = this.data.fieldName, S.tabIndex = d;
          let E = this.data.combo && this.data.options.length > 0;
          this.data.combo || (S.size = this.data.options.length, this.data.multiSelect && (S.multiple = !0)), S.addEventListener("resetform", (B) => {
            const H = this.data.defaultFieldValue;
            for (const V of S.options)
              V.selected = V.value === H;
          });
          for (const B of this.data.options) {
            const H = document.createElement("option");
            H.textContent = B.displayValue, H.value = B.exportValue, v.value.includes(B.exportValue) && (H.setAttribute("selected", !0), E = !1), S.append(H);
          }
          let _ = null;
          if (E) {
            const B = document.createElement("option");
            B.value = " ", B.setAttribute("hidden", !0), B.setAttribute("selected", !0), S.prepend(B), _ = () => {
              B.remove(), S.removeEventListener("input", _), _ = null;
            }, S.addEventListener("input", _);
          }
          const x = (B) => {
            const H = B ? "value" : "textContent", {
              options: V,
              multiple: $
            } = S;
            return $ ? Array.prototype.filter.call(V, (X) => X.selected).map((X) => X[H]) : V.selectedIndex === -1 ? null : V[V.selectedIndex][H];
          };
          let F = x(!1);
          const I = (B) => {
            const H = B.target.options;
            return Array.prototype.map.call(H, (V) => ({
              displayValue: V.textContent,
              exportValue: V.value
            }));
          };
          return this.enableScripting && this.hasJSActions ? (S.addEventListener("updatefromsandbox", (B) => {
            const H = {
              value(V) {
                _?.();
                const $ = V.detail.value, X = new Set(Array.isArray($) ? $ : [$]);
                for (const G of S.options)
                  G.selected = X.has(G.value);
                R.setValue(D, {
                  value: x(!0)
                }), F = x(!1);
              },
              multipleSelection(V) {
                S.multiple = !0;
              },
              remove(V) {
                const $ = S.options, X = V.detail.remove;
                $[X].selected = !1, S.remove(X), $.length > 0 && Array.prototype.findIndex.call($, (U) => U.selected) === -1 && ($[0].selected = !0), R.setValue(D, {
                  value: x(!0),
                  items: I(V)
                }), F = x(!1);
              },
              clear(V) {
                for (; S.length !== 0; )
                  S.remove(0);
                R.setValue(D, {
                  value: null,
                  items: []
                }), F = x(!1);
              },
              insert(V) {
                const {
                  index: $,
                  displayValue: X,
                  exportValue: G
                } = V.detail.insert, U = S.children[$], ee = document.createElement("option");
                ee.textContent = X, ee.value = G, U ? U.before(ee) : S.append(ee), R.setValue(D, {
                  value: x(!0),
                  items: I(V)
                }), F = x(!1);
              },
              items(V) {
                const {
                  items: $
                } = V.detail;
                for (; S.length !== 0; )
                  S.remove(0);
                for (const X of $) {
                  const {
                    displayValue: G,
                    exportValue: U
                  } = X, ee = document.createElement("option");
                  ee.textContent = G, ee.value = U, S.append(ee);
                }
                S.options.length > 0 && (S.options[0].selected = !0), R.setValue(D, {
                  value: x(!0),
                  items: I(V)
                }), F = x(!1);
              },
              indices(V) {
                const $ = new Set(V.detail.indices);
                for (const X of V.target.options)
                  X.selected = $.has(X.index);
                R.setValue(D, {
                  value: x(!0)
                }), F = x(!1);
              },
              editable(V) {
                V.target.disabled = !V.detail.editable;
              }
            };
            this._dispatchEventFromSandbox(H, B);
          }), S.addEventListener("input", (B) => {
            const H = x(!0), V = x(!1);
            R.setValue(D, {
              value: H
            }), B.preventDefault(), this.linkService.eventBus?.dispatch("dispatcheventinsandbox", {
              source: this,
              detail: {
                id: D,
                name: "Keystroke",
                value: F,
                change: V,
                changeEx: H,
                willCommit: !1,
                commitKey: 1,
                keyDown: !1
              }
            });
          }), this._setEventListeners(S, null, [["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"], ["input", "Action"], ["input", "Validate"]], (B) => B.target.value)) : S.addEventListener("input", function(B) {
            R.setValue(D, {
              value: x(!0)
            });
          }), this.data.combo && this._setTextStyle(S), this._setBackgroundColor(S), this._setDefaultPropertiesFromJS(S), this.container.append(S), this.container;
        }
      }
      class O extends m {
        constructor(R) {
          const {
            data: D,
            elements: v
          } = R;
          super(R, {
            isRenderable: m._hasPopupData(D)
          }), this.elements = v;
        }
        render() {
          this.container.classList.add("popupAnnotation");
          const R = new q({
            container: this.container,
            color: this.data.color,
            titleObj: this.data.titleObj,
            modificationDate: this.data.modificationDate,
            contentsObj: this.data.contentsObj,
            richText: this.data.richText,
            rect: this.data.rect,
            parentRect: this.data.parentRect || null,
            parent: this.parent,
            elements: this.elements,
            open: this.data.open
          }), D = [];
          for (const v of this.elements)
            v.popup = R, D.push(v.data.id), v.addHighlightArea();
          return this.container.setAttribute("aria-controls", D.map((v) => `${n.AnnotationPrefix}${v}`).join(",")), this.container;
        }
      }
      class q {
        #e = this.#g.bind(this);
        #t = this.#_.bind(this);
        #n = this.#A.bind(this);
        #r = this.#y.bind(this);
        #s = null;
        #i = null;
        #a = null;
        #u = null;
        #l = null;
        #h = null;
        #d = null;
        #c = !1;
        #o = null;
        #m = null;
        #p = null;
        #f = null;
        #v = !1;
        constructor({
          container: R,
          color: D,
          elements: v,
          titleObj: S,
          modificationDate: E,
          contentsObj: _,
          richText: x,
          parent: F,
          rect: I,
          parentRect: B,
          open: H
        }) {
          this.#i = R, this.#f = S, this.#a = _, this.#p = x, this.#h = F, this.#s = D, this.#m = I, this.#d = B, this.#l = v, this.#u = r.PDFDateString.toDateObject(E), this.trigger = v.flatMap((V) => V.getElementsToTriggerPopup());
          for (const V of this.trigger)
            V.addEventListener("click", this.#r), V.addEventListener("mouseenter", this.#n), V.addEventListener("mouseleave", this.#t), V.classList.add("popupTriggerArea");
          for (const V of v)
            V.container?.addEventListener("keydown", this.#e);
          this.#i.hidden = !0, H && this.#y();
        }
        render() {
          if (this.#o)
            return;
          const {
            page: {
              view: R
            },
            viewport: {
              rawDims: {
                pageWidth: D,
                pageHeight: v,
                pageX: S,
                pageY: E
              }
            }
          } = this.#h, _ = this.#o = document.createElement("div");
          if (_.className = "popup", this.#s) {
            const re = _.style.outlineColor = n.Util.makeHexColor(...this.#s);
            CSS.supports("background-color", "color-mix(in srgb, red 30%, white)") ? _.style.backgroundColor = `color-mix(in srgb, ${re} 30%, white)` : _.style.backgroundColor = n.Util.makeHexColor(...this.#s.map((_e) => Math.floor(0.7 * (255 - _e) + _e)));
          }
          const x = document.createElement("span");
          x.className = "header";
          const F = document.createElement("h1");
          if (x.append(F), {
            dir: F.dir,
            str: F.textContent
          } = this.#f, _.append(x), this.#u) {
            const re = document.createElement("span");
            re.classList.add("popupDate"), re.setAttribute("data-l10n-id", "pdfjs-annotation-date-string"), re.setAttribute("data-l10n-args", JSON.stringify({
              date: this.#u.toLocaleDateString(),
              time: this.#u.toLocaleTimeString()
            })), x.append(re);
          }
          const I = this.#a, B = this.#p;
          if (B?.str && (!I?.str || I.str === B.str))
            h.XfaLayer.render({
              xfaHtml: B.html,
              intent: "richText",
              div: _
            }), _.lastChild.classList.add("richText", "popupContent");
          else {
            const re = this._formatContents(I);
            _.append(re);
          }
          let H = !!this.#d, V = H ? this.#d : this.#m;
          for (const re of this.#l)
            if (!V || n.Util.intersect(re.data.rect, V) !== null) {
              V = re.data.rect, H = !0;
              break;
            }
          const $ = n.Util.normalizeRect([V[0], R[3] - V[1] + R[1], V[2], R[3] - V[3] + R[1]]), G = H ? V[2] - V[0] + 5 : 0, U = $[0] + G, ee = $[1], {
            style: fe
          } = this.#i;
          fe.left = `${100 * (U - S) / D}%`, fe.top = `${100 * (ee - E) / v}%`, this.#i.append(_);
        }
        _formatContents({
          str: R,
          dir: D
        }) {
          const v = document.createElement("p");
          v.classList.add("popupContent"), v.dir = D;
          const S = R.split(/(?:\r\n?|\n)/);
          for (let E = 0, _ = S.length; E < _; ++E) {
            const x = S[E];
            v.append(document.createTextNode(x)), E < _ - 1 && v.append(document.createElement("br"));
          }
          return v;
        }
        #g(R) {
          R.altKey || R.shiftKey || R.ctrlKey || R.metaKey || (R.key === "Enter" || R.key === "Escape" && this.#c) && this.#y();
        }
        #y() {
          this.#c = !this.#c, this.#c ? (this.#A(), this.#i.addEventListener("click", this.#r), this.#i.addEventListener("keydown", this.#e)) : (this.#_(), this.#i.removeEventListener("click", this.#r), this.#i.removeEventListener("keydown", this.#e));
        }
        #A() {
          this.#o || this.render(), this.isVisible ? this.#c && this.#i.classList.add("focused") : (this.#i.hidden = !1, this.#i.style.zIndex = parseInt(this.#i.style.zIndex) + 1e3);
        }
        #_() {
          this.#i.classList.remove("focused"), !(this.#c || !this.isVisible) && (this.#i.hidden = !0, this.#i.style.zIndex = parseInt(this.#i.style.zIndex) - 1e3);
        }
        forceHide() {
          this.#v = this.isVisible, this.#v && (this.#i.hidden = !0);
        }
        maybeShow() {
          this.#v && (this.#v = !1, this.#i.hidden = !1);
        }
        get isVisible() {
          return this.#i.hidden === !1;
        }
      }
      class Y extends m {
        constructor(R) {
          super(R, {
            isRenderable: !0,
            ignoreBorder: !0
          }), this.textContent = R.data.textContent, this.textPosition = R.data.textPosition, this.annotationEditorType = n.AnnotationEditorType.FREETEXT;
        }
        render() {
          if (this.container.classList.add("freeTextAnnotation"), this.textContent) {
            const R = document.createElement("div");
            R.classList.add("annotationTextContent"), R.setAttribute("role", "comment");
            for (const D of this.textContent) {
              const v = document.createElement("span");
              v.textContent = D, R.append(v);
            }
            this.container.append(R);
          }
          return !this.data.popupRef && this.hasPopupData && this._createPopup(), this._editOnDoubleClick(), this.container;
        }
        get _isEditable() {
          return this.data.hasOwnCanvas;
        }
      }
      class se extends m {
        #e = null;
        constructor(R) {
          super(R, {
            isRenderable: !0,
            ignoreBorder: !0
          });
        }
        render() {
          this.container.classList.add("lineAnnotation");
          const R = this.data, {
            width: D,
            height: v
          } = g(R.rect), S = this.svgFactory.create(D, v, !0), E = this.#e = this.svgFactory.createElement("svg:line");
          return E.setAttribute("x1", R.rect[2] - R.lineCoordinates[0]), E.setAttribute("y1", R.rect[3] - R.lineCoordinates[1]), E.setAttribute("x2", R.rect[2] - R.lineCoordinates[2]), E.setAttribute("y2", R.rect[3] - R.lineCoordinates[3]), E.setAttribute("stroke-width", R.borderStyle.width || 1), E.setAttribute("stroke", "transparent"), E.setAttribute("fill", "transparent"), S.append(E), this.container.append(S), !R.popupRef && this.hasPopupData && this._createPopup(), this.container;
        }
        getElementsToTriggerPopup() {
          return this.#e;
        }
        addHighlightArea() {
          this.container.classList.add("highlightArea");
        }
      }
      class me extends m {
        #e = null;
        constructor(R) {
          super(R, {
            isRenderable: !0,
            ignoreBorder: !0
          });
        }
        render() {
          this.container.classList.add("squareAnnotation");
          const R = this.data, {
            width: D,
            height: v
          } = g(R.rect), S = this.svgFactory.create(D, v, !0), E = R.borderStyle.width, _ = this.#e = this.svgFactory.createElement("svg:rect");
          return _.setAttribute("x", E / 2), _.setAttribute("y", E / 2), _.setAttribute("width", D - E), _.setAttribute("height", v - E), _.setAttribute("stroke-width", E || 1), _.setAttribute("stroke", "transparent"), _.setAttribute("fill", "transparent"), S.append(_), this.container.append(S), !R.popupRef && this.hasPopupData && this._createPopup(), this.container;
        }
        getElementsToTriggerPopup() {
          return this.#e;
        }
        addHighlightArea() {
          this.container.classList.add("highlightArea");
        }
      }
      class te extends m {
        #e = null;
        constructor(R) {
          super(R, {
            isRenderable: !0,
            ignoreBorder: !0
          });
        }
        render() {
          this.container.classList.add("circleAnnotation");
          const R = this.data, {
            width: D,
            height: v
          } = g(R.rect), S = this.svgFactory.create(D, v, !0), E = R.borderStyle.width, _ = this.#e = this.svgFactory.createElement("svg:ellipse");
          return _.setAttribute("cx", D / 2), _.setAttribute("cy", v / 2), _.setAttribute("rx", D / 2 - E / 2), _.setAttribute("ry", v / 2 - E / 2), _.setAttribute("stroke-width", E || 1), _.setAttribute("stroke", "transparent"), _.setAttribute("fill", "transparent"), S.append(_), this.container.append(S), !R.popupRef && this.hasPopupData && this._createPopup(), this.container;
        }
        getElementsToTriggerPopup() {
          return this.#e;
        }
        addHighlightArea() {
          this.container.classList.add("highlightArea");
        }
      }
      class K extends m {
        #e = null;
        constructor(R) {
          super(R, {
            isRenderable: !0,
            ignoreBorder: !0
          }), this.containerClassName = "polylineAnnotation", this.svgElementName = "svg:polyline";
        }
        render() {
          this.container.classList.add(this.containerClassName);
          const R = this.data, {
            width: D,
            height: v
          } = g(R.rect), S = this.svgFactory.create(D, v, !0);
          let E = [];
          for (const x of R.vertices) {
            const F = x.x - R.rect[0], I = R.rect[3] - x.y;
            E.push(F + "," + I);
          }
          E = E.join(" ");
          const _ = this.#e = this.svgFactory.createElement(this.svgElementName);
          return _.setAttribute("points", E), _.setAttribute("stroke-width", R.borderStyle.width || 1), _.setAttribute("stroke", "transparent"), _.setAttribute("fill", "transparent"), S.append(_), this.container.append(S), !R.popupRef && this.hasPopupData && this._createPopup(), this.container;
        }
        getElementsToTriggerPopup() {
          return this.#e;
        }
        addHighlightArea() {
          this.container.classList.add("highlightArea");
        }
      }
      class Z extends K {
        constructor(R) {
          super(R), this.containerClassName = "polygonAnnotation", this.svgElementName = "svg:polygon";
        }
      }
      class oe extends m {
        constructor(R) {
          super(R, {
            isRenderable: !0,
            ignoreBorder: !0
          });
        }
        render() {
          return this.container.classList.add("caretAnnotation"), !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container;
        }
      }
      class le extends m {
        #e = [];
        constructor(R) {
          super(R, {
            isRenderable: !0,
            ignoreBorder: !0
          }), this.containerClassName = "inkAnnotation", this.svgElementName = "svg:polyline", this.annotationEditorType = n.AnnotationEditorType.INK;
        }
        render() {
          this.container.classList.add(this.containerClassName);
          const R = this.data, {
            width: D,
            height: v
          } = g(R.rect), S = this.svgFactory.create(D, v, !0);
          for (const E of R.inkLists) {
            let _ = [];
            for (const F of E) {
              const I = F.x - R.rect[0], B = R.rect[3] - F.y;
              _.push(`${I},${B}`);
            }
            _ = _.join(" ");
            const x = this.svgFactory.createElement(this.svgElementName);
            this.#e.push(x), x.setAttribute("points", _), x.setAttribute("stroke-width", R.borderStyle.width || 1), x.setAttribute("stroke", "transparent"), x.setAttribute("fill", "transparent"), !R.popupRef && this.hasPopupData && this._createPopup(), S.append(x);
          }
          return this.container.append(S), this.container;
        }
        getElementsToTriggerPopup() {
          return this.#e;
        }
        addHighlightArea() {
          this.container.classList.add("highlightArea");
        }
      }
      class ie extends m {
        constructor(R) {
          super(R, {
            isRenderable: !0,
            ignoreBorder: !0,
            createQuadrilaterals: !0
          });
        }
        render() {
          return !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.classList.add("highlightAnnotation"), this.container;
        }
      }
      class pe extends m {
        constructor(R) {
          super(R, {
            isRenderable: !0,
            ignoreBorder: !0,
            createQuadrilaterals: !0
          });
        }
        render() {
          return !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.classList.add("underlineAnnotation"), this.container;
        }
      }
      class he extends m {
        constructor(R) {
          super(R, {
            isRenderable: !0,
            ignoreBorder: !0,
            createQuadrilaterals: !0
          });
        }
        render() {
          return !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.classList.add("squigglyAnnotation"), this.container;
        }
      }
      class we extends m {
        constructor(R) {
          super(R, {
            isRenderable: !0,
            ignoreBorder: !0,
            createQuadrilaterals: !0
          });
        }
        render() {
          return !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.classList.add("strikeoutAnnotation"), this.container;
        }
      }
      class ke extends m {
        constructor(R) {
          super(R, {
            isRenderable: !0,
            ignoreBorder: !0
          });
        }
        render() {
          return this.container.classList.add("stampAnnotation"), !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container;
        }
      }
      class Ae extends m {
        #e = null;
        constructor(R) {
          super(R, {
            isRenderable: !0
          });
          const {
            filename: D,
            content: v
          } = this.data.file;
          this.filename = (0, r.getFilenameFromUrl)(D, !0), this.content = v, this.linkService.eventBus?.dispatch("fileattachmentannotation", {
            source: this,
            filename: D,
            content: v
          });
        }
        render() {
          this.container.classList.add("fileAttachmentAnnotation");
          const {
            container: R,
            data: D
          } = this;
          let v;
          D.hasAppearance || D.fillAlpha === 0 ? v = document.createElement("div") : (v = document.createElement("img"), v.src = `${this.imageResourcesPath}annotation-${/paperclip/i.test(D.name) ? "paperclip" : "pushpin"}.svg`, D.fillAlpha && D.fillAlpha < 1 && (v.style = `filter: opacity(${Math.round(D.fillAlpha * 100)}%);`)), v.addEventListener("dblclick", this.#t.bind(this)), this.#e = v;
          const {
            isMac: S
          } = n.FeatureTest.platform;
          return R.addEventListener("keydown", (E) => {
            E.key === "Enter" && (S ? E.metaKey : E.ctrlKey) && this.#t();
          }), !D.popupRef && this.hasPopupData ? this._createPopup() : v.classList.add("popupTriggerArea"), R.append(v), R;
        }
        getElementsToTriggerPopup() {
          return this.#e;
        }
        addHighlightArea() {
          this.container.classList.add("highlightArea");
        }
        #t() {
          this.downloadManager?.openOrDownloadData(this.content, this.filename);
        }
      }
      class ae {
        #e = null;
        #t = null;
        #n = /* @__PURE__ */ new Map();
        constructor({
          div: R,
          accessibilityManager: D,
          annotationCanvasMap: v,
          annotationEditorUIManager: S,
          page: E,
          viewport: _
        }) {
          this.div = R, this.#e = D, this.#t = v, this.page = E, this.viewport = _, this.zIndex = 0, this._annotationEditorUIManager = S;
        }
        #r(R, D) {
          const v = R.firstChild || R;
          v.id = `${n.AnnotationPrefix}${D}`, this.div.append(R), this.#e?.moveElementInDOM(this.div, R, v, !1);
        }
        async render(R) {
          const {
            annotations: D
          } = R, v = this.div;
          (0, r.setLayerDimensions)(v, this.viewport);
          const S = /* @__PURE__ */ new Map(), E = {
            data: null,
            layer: v,
            linkService: R.linkService,
            downloadManager: R.downloadManager,
            imageResourcesPath: R.imageResourcesPath || "",
            renderForms: R.renderForms !== !1,
            svgFactory: new r.DOMSVGFactory(),
            annotationStorage: R.annotationStorage || new s.AnnotationStorage(),
            enableScripting: R.enableScripting === !0,
            hasJSActions: R.hasJSActions,
            fieldObjects: R.fieldObjects,
            parent: this,
            elements: null
          };
          for (const _ of D) {
            if (_.noHTML)
              continue;
            const x = _.annotationType === n.AnnotationType.POPUP;
            if (x) {
              const B = S.get(_.id);
              if (!B)
                continue;
              E.elements = B;
            } else {
              const {
                width: B,
                height: H
              } = g(_.rect);
              if (B <= 0 || H <= 0)
                continue;
            }
            E.data = _;
            const F = A.create(E);
            if (!F.isRenderable)
              continue;
            if (!x && _.popupRef) {
              const B = S.get(_.popupRef);
              B ? B.push(F) : S.set(_.popupRef, [F]);
            }
            const I = F.render();
            _.hidden && (I.style.visibility = "hidden"), this.#r(I, _.id), F.annotationEditorType > 0 && (this.#n.set(F.data.id, F), this._annotationEditorUIManager?.renderAnnotationElement(F));
          }
          this.#s();
        }
        update({
          viewport: R
        }) {
          const D = this.div;
          this.viewport = R, (0, r.setLayerDimensions)(D, {
            rotation: R.rotation
          }), this.#s(), D.hidden = !1;
        }
        #s() {
          if (!this.#t)
            return;
          const R = this.div;
          for (const [D, v] of this.#t) {
            const S = R.querySelector(`[data-annotation-id="${D}"]`);
            if (!S)
              continue;
            v.className = "annotationContent";
            const {
              firstChild: E
            } = S;
            E ? E.nodeName === "CANVAS" ? E.replaceWith(v) : E.classList.contains("annotationContent") ? E.after(v) : E.before(v) : S.append(v);
          }
          this.#t.clear();
        }
        getEditableAnnotations() {
          return Array.from(this.#n.values());
        }
        getEditableAnnotation(R) {
          return this.#n.get(R);
        }
      }
    }
  ),
  /***/
  792: (
    /***/
    (i, e, t) => {
      t.d(e, {
        /* harmony export */
        AnnotationStorage: () => (
          /* binding */
          l
        ),
        /* harmony export */
        PrintAnnotationStorage: () => (
          /* binding */
          o
        ),
        /* harmony export */
        SerializableEmpty: () => (
          /* binding */
          u
        )
        /* harmony export */
      });
      var n = t(292), r = t(310), s = t(651);
      const u = Object.freeze({
        map: null,
        hash: "",
        transfer: void 0
      });
      class l {
        #e = !1;
        #t = /* @__PURE__ */ new Map();
        constructor() {
          this.onSetModified = null, this.onResetModified = null, this.onAnnotationEditor = null;
        }
        getValue(d, c) {
          const f = this.#t.get(d);
          return f === void 0 ? c : Object.assign(c, f);
        }
        getRawValue(d) {
          return this.#t.get(d);
        }
        remove(d) {
          if (this.#t.delete(d), this.#t.size === 0 && this.resetModified(), typeof this.onAnnotationEditor == "function") {
            for (const c of this.#t.values())
              if (c instanceof r.AnnotationEditor)
                return;
            this.onAnnotationEditor(null);
          }
        }
        setValue(d, c) {
          const f = this.#t.get(d);
          let g = !1;
          if (f !== void 0)
            for (const [A, m] of Object.entries(c))
              f[A] !== m && (g = !0, f[A] = m);
          else
            g = !0, this.#t.set(d, c);
          g && this.#n(), c instanceof r.AnnotationEditor && typeof this.onAnnotationEditor == "function" && this.onAnnotationEditor(c.constructor._type);
        }
        has(d) {
          return this.#t.has(d);
        }
        getAll() {
          return this.#t.size > 0 ? (0, n.objectFromMap)(this.#t) : null;
        }
        setAll(d) {
          for (const [c, f] of Object.entries(d))
            this.setValue(c, f);
        }
        get size() {
          return this.#t.size;
        }
        #n() {
          this.#e || (this.#e = !0, typeof this.onSetModified == "function" && this.onSetModified());
        }
        resetModified() {
          this.#e && (this.#e = !1, typeof this.onResetModified == "function" && this.onResetModified());
        }
        get print() {
          return new o(this);
        }
        get serializable() {
          if (this.#t.size === 0)
            return u;
          const d = /* @__PURE__ */ new Map(), c = new s.MurmurHash3_64(), f = [], g = /* @__PURE__ */ Object.create(null);
          let A = !1;
          for (const [m, k] of this.#t) {
            const a = k instanceof r.AnnotationEditor ? k.serialize(!1, g) : k;
            a && (d.set(m, a), c.update(`${m}:${JSON.stringify(a)}`), A ||= !!a.bitmap);
          }
          if (A)
            for (const m of d.values())
              m.bitmap && f.push(m.bitmap);
          return d.size > 0 ? {
            map: d,
            hash: c.hexdigest(),
            transfer: f
          } : u;
        }
        get editorStats() {
          let d = null;
          const c = /* @__PURE__ */ new Map();
          for (const f of this.#t.values()) {
            if (!(f instanceof r.AnnotationEditor))
              continue;
            const g = f.telemetryFinalData;
            if (!g)
              continue;
            const {
              type: A
            } = g;
            c.has(A) || c.set(A, Object.getPrototypeOf(f).constructor), d ||= /* @__PURE__ */ Object.create(null);
            const m = d[A] ||= /* @__PURE__ */ new Map();
            for (const [k, a] of Object.entries(g)) {
              if (k === "type")
                continue;
              let p = m.get(k);
              p || (p = /* @__PURE__ */ new Map(), m.set(k, p));
              const b = p.get(a) ?? 0;
              p.set(a, b + 1);
            }
          }
          for (const [f, g] of c)
            d[f] = g.computeTelemetryFinalData(d[f]);
          return d;
        }
      }
      class o extends l {
        #e;
        constructor(d) {
          super();
          const {
            map: c,
            hash: f,
            transfer: g
          } = d.serializable, A = structuredClone(c, g ? {
            transfer: g
          } : null);
          this.#e = {
            map: A,
            hash: f,
            transfer: g
          };
        }
        get print() {
          (0, n.unreachable)("Should not call PrintAnnotationStorage.print");
        }
        get serializable() {
          return this.#e;
        }
      }
    }
  ),
  /***/
  831: (
    /***/
    (i, e, t) => {
      t.a(i, async (n, r) => {
        try {
          let me = function(_) {
            if (typeof _ == "string" || _ instanceof URL ? _ = {
              url: _
            } : (_ instanceof ArrayBuffer || ArrayBuffer.isView(_)) && (_ = {
              data: _
            }), typeof _ != "object")
              throw new Error("Invalid parameter in getDocument, need parameter object.");
            if (!_.url && !_.data && !_.range)
              throw new Error("Invalid parameter object: need either .data, .range or .url");
            const x = new le(), {
              docId: F
            } = x, I = _.url ? K(_.url) : null, B = _.data ? Z(_.data) : null, H = _.httpHeaders || null, V = _.withCredentials === !0, $ = _.password ?? null, X = _.range instanceof ie ? _.range : null, G = Number.isInteger(_.rangeChunkSize) && _.rangeChunkSize > 0 ? _.rangeChunkSize : M;
            let U = _.worker instanceof Ae ? _.worker : null;
            const ee = _.verbosity, fe = typeof _.docBaseUrl == "string" && !(0, l.isDataScheme)(_.docBaseUrl) ? _.docBaseUrl : null, re = typeof _.cMapUrl == "string" ? _.cMapUrl : null, ue = _.cMapPacked !== !1, _e = _.CMapReaderFactory || q, ve = typeof _.standardFontDataUrl == "string" ? _.standardFontDataUrl : null, be = _.StandardFontDataFactory || se, xe = _.stopAtErrors !== !0, De = Number.isInteger(_.maxImageSize) && _.maxImageSize > -1 ? _.maxImageSize : -1, Oe = _.isEvalSupported !== !1, Ve = typeof _.isOffscreenCanvasSupported == "boolean" ? _.isOffscreenCanvasSupported : !s.isNodeJS, Ge = Number.isInteger(_.canvasMaxAreaInBytes) ? _.canvasMaxAreaInBytes : -1, He = typeof _.disableFontFace == "boolean" ? _.disableFontFace : s.isNodeJS, Ct = _.fontExtraProperties === !0, ht = _.enableXfa === !0, Dt = _.ownerDocument || globalThis.document, Ze = _.disableRange === !0, bt = _.disableStream === !0, an = _.disableAutoFetch === !0, Qe = _.pdfBug === !0, Xt = X ? X.length : _.length ?? NaN, Ii = typeof _.useSystemFonts == "boolean" ? _.useSystemFonts : !s.isNodeJS && !He, Ln = typeof _.useWorkerFetch == "boolean" ? _.useWorkerFetch : _e === l.DOMCMapReaderFactory && be === l.DOMStandardFontDataFactory && re && ve && (0, l.isValidFetchUrl)(re, document.baseURI) && (0, l.isValidFetchUrl)(ve, document.baseURI), ft = _.canvasFactory || new O({
              ownerDocument: Dt
            }), ut = _.filterFactory || new Y({
              docId: F,
              ownerDocument: Dt
            }), ui = null;
            (0, s.setVerbosityLevel)(ee);
            const ci = {
              canvasFactory: ft,
              filterFactory: ut
            };
            if (Ln || (ci.cMapReaderFactory = new _e({
              baseUrl: re,
              isCompressed: ue
            }), ci.standardFontDataFactory = new be({
              baseUrl: ve
            })), !U) {
              const hi = {
                verbosity: ee,
                port: f.GlobalWorkerOptions.workerPort
              };
              U = hi.port ? Ae.fromPort(hi) : new Ae(hi), x._worker = U;
            }
            const In = {
              docId: F,
              apiVersion: "4.2.67",
              data: B,
              password: $,
              disableAutoFetch: an,
              rangeChunkSize: G,
              length: Xt,
              docBaseUrl: fe,
              enableXfa: ht,
              evaluatorOptions: {
                maxImageSize: De,
                disableFontFace: He,
                ignoreErrors: xe,
                isEvalSupported: Oe,
                isOffscreenCanvasSupported: Ve,
                canvasMaxAreaInBytes: Ge,
                fontExtraProperties: Ct,
                useSystemFonts: Ii,
                cMapUrl: Ln ? re : null,
                standardFontDataUrl: Ln ? ve : null
              }
            }, at = {
              ignoreErrors: xe,
              disableFontFace: He,
              fontExtraProperties: Ct,
              enableXfa: ht,
              ownerDocument: Dt,
              disableAutoFetch: an,
              pdfBug: Qe,
              styleElement: ui
            };
            return U.promise.then(function() {
              if (x.destroyed)
                throw new Error("Loading aborted");
              const hi = te(U, In), jt = new Promise(function(Xn) {
                let jn;
                X ? jn = new k.PDFDataTransportStream(X, {
                  disableRange: Ze,
                  disableStream: bt
                }) : B || (jn = ((on) => s.isNodeJS ? function() {
                  return typeof fetch < "u" && typeof Response < "u" && "body" in Response.prototype;
                }() && (0, l.isValidFetchUrl)(on.url) ? new a.PDFFetchStream(on) : new b.PDFNodeStream(on) : (0, l.isValidFetchUrl)(on.url) ? new a.PDFFetchStream(on) : new p.PDFNetworkStream(on))({
                  url: I,
                  length: Xt,
                  httpHeaders: H,
                  withCredentials: V,
                  rangeChunkSize: G,
                  disableRange: Ze,
                  disableStream: bt
                })), Xn(jn);
              });
              return Promise.all([hi, jt]).then(function([Xn, jn]) {
                if (x.destroyed)
                  throw new Error("Loading aborted");
                const Ni = new g.MessageHandler(F, Xn, U.port), on = new ae(Ni, x, jn, at, ci);
                x._transport = on, Ni.send("Ready", null);
              });
            }).catch(x._capability.reject), x;
          }, K = function(_) {
            if (_ instanceof URL)
              return _.href;
            try {
              return new URL(_, window.location).href;
            } catch {
              if (s.isNodeJS && typeof _ == "string")
                return _;
            }
            throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.");
          }, Z = function(_) {
            if (s.isNodeJS && typeof Buffer < "u" && _ instanceof Buffer)
              throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");
            if (_ instanceof Uint8Array && _.byteLength === _.buffer.byteLength)
              return _;
            if (typeof _ == "string")
              return (0, s.stringToBytes)(_);
            if (_ instanceof ArrayBuffer || ArrayBuffer.isView(_) || typeof _ == "object" && !isNaN(_?.length))
              return new Uint8Array(_);
            throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.");
          }, oe = function(_) {
            return typeof _ == "object" && Number.isInteger(_?.num) && _.num >= 0 && Number.isInteger(_?.gen) && _.gen >= 0;
          };
          t.d(e, {
            /* harmony export */
            PDFDataRangeTransport: () => (
              /* binding */
              ie
            ),
            /* harmony export */
            PDFWorker: () => (
              /* binding */
              Ae
            ),
            /* harmony export */
            build: () => (
              /* binding */
              E
            ),
            /* harmony export */
            getDocument: () => (
              /* binding */
              me
            ),
            /* harmony export */
            version: () => (
              /* binding */
              S
            )
            /* harmony export */
          });
          var s = t(292), u = t(792), l = t(419), o = t(10), h = t(573), d = t(923), c = t(814), f = t(164), g = t(178), A = t(62), m = t(626), k = t(585), a = t(94), p = t(457), b = t(786), y = t(50), C = n([h, b]);
          [h, b] = C.then ? (await C)() : C;
          const M = 65536, L = 100, P = 5e3, O = s.isNodeJS ? h.NodeCanvasFactory : l.DOMCanvasFactory, q = s.isNodeJS ? h.NodeCMapReaderFactory : l.DOMCMapReaderFactory, Y = s.isNodeJS ? h.NodeFilterFactory : l.DOMFilterFactory, se = s.isNodeJS ? h.NodeStandardFontDataFactory : l.DOMStandardFontDataFactory;
          async function te(_, x) {
            if (_.destroyed)
              throw new Error("Worker was destroyed");
            const F = await _.messageHandler.sendWithPromise("GetDocRequest", x, x.data ? [x.data.buffer] : null);
            if (_.destroyed)
              throw new Error("Worker was destroyed");
            return F;
          }
          class le {
            static #e = 0;
            constructor() {
              this._capability = Promise.withResolvers(), this._transport = null, this._worker = null, this.docId = `d${le.#e++}`, this.destroyed = !1, this.onPassword = null, this.onProgress = null;
            }
            get promise() {
              return this._capability.promise;
            }
            async destroy() {
              this.destroyed = !0;
              try {
                this._worker?.port && (this._worker._pendingDestroy = !0), await this._transport?.destroy();
              } catch (x) {
                throw this._worker?.port && delete this._worker._pendingDestroy, x;
              }
              this._transport = null, this._worker && (this._worker.destroy(), this._worker = null);
            }
          }
          class ie {
            constructor(x, F, I = !1, B = null) {
              this.length = x, this.initialData = F, this.progressiveDone = I, this.contentDispositionFilename = B, this._rangeListeners = [], this._progressListeners = [], this._progressiveReadListeners = [], this._progressiveDoneListeners = [], this._readyCapability = Promise.withResolvers();
            }
            addRangeListener(x) {
              this._rangeListeners.push(x);
            }
            addProgressListener(x) {
              this._progressListeners.push(x);
            }
            addProgressiveReadListener(x) {
              this._progressiveReadListeners.push(x);
            }
            addProgressiveDoneListener(x) {
              this._progressiveDoneListeners.push(x);
            }
            onDataRange(x, F) {
              for (const I of this._rangeListeners)
                I(x, F);
            }
            onDataProgress(x, F) {
              this._readyCapability.promise.then(() => {
                for (const I of this._progressListeners)
                  I(x, F);
              });
            }
            onDataProgressiveRead(x) {
              this._readyCapability.promise.then(() => {
                for (const F of this._progressiveReadListeners)
                  F(x);
              });
            }
            onDataProgressiveDone() {
              this._readyCapability.promise.then(() => {
                for (const x of this._progressiveDoneListeners)
                  x();
              });
            }
            transportReady() {
              this._readyCapability.resolve();
            }
            requestDataRange(x, F) {
              (0, s.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange");
            }
            abort() {
            }
          }
          class pe {
            constructor(x, F) {
              this._pdfInfo = x, this._transport = F;
            }
            get annotationStorage() {
              return this._transport.annotationStorage;
            }
            get filterFactory() {
              return this._transport.filterFactory;
            }
            get numPages() {
              return this._pdfInfo.numPages;
            }
            get fingerprints() {
              return this._pdfInfo.fingerprints;
            }
            get isPureXfa() {
              return (0, s.shadow)(this, "isPureXfa", !!this._transport._htmlForXfa);
            }
            get allXfaHtml() {
              return this._transport._htmlForXfa;
            }
            getPage(x) {
              return this._transport.getPage(x);
            }
            getPageIndex(x) {
              return this._transport.getPageIndex(x);
            }
            getDestinations() {
              return this._transport.getDestinations();
            }
            getDestination(x) {
              return this._transport.getDestination(x);
            }
            getPageLabels() {
              return this._transport.getPageLabels();
            }
            getPageLayout() {
              return this._transport.getPageLayout();
            }
            getPageMode() {
              return this._transport.getPageMode();
            }
            getViewerPreferences() {
              return this._transport.getViewerPreferences();
            }
            getOpenAction() {
              return this._transport.getOpenAction();
            }
            getAttachments() {
              return this._transport.getAttachments();
            }
            getJSActions() {
              return this._transport.getDocJSActions();
            }
            getOutline() {
              return this._transport.getOutline();
            }
            getOptionalContentConfig({
              intent: x = "display"
            } = {}) {
              const {
                renderingIntent: F
              } = this._transport.getRenderingIntent(x);
              return this._transport.getOptionalContentConfig(F);
            }
            getPermissions() {
              return this._transport.getPermissions();
            }
            getMetadata() {
              return this._transport.getMetadata();
            }
            getMarkInfo() {
              return this._transport.getMarkInfo();
            }
            getData() {
              return this._transport.getData();
            }
            saveDocument() {
              return this._transport.saveDocument();
            }
            getDownloadInfo() {
              return this._transport.downloadInfoCapability.promise;
            }
            cleanup(x = !1) {
              return this._transport.startCleanup(x || this.isPureXfa);
            }
            destroy() {
              return this.loadingTask.destroy();
            }
            cachedPageNumber(x) {
              return this._transport.cachedPageNumber(x);
            }
            get loadingParams() {
              return this._transport.loadingParams;
            }
            get loadingTask() {
              return this._transport.loadingTask;
            }
            getFieldObjects() {
              return this._transport.getFieldObjects();
            }
            hasJSActions() {
              return this._transport.hasJSActions();
            }
            getCalculationOrderIds() {
              return this._transport.getCalculationOrderIds();
            }
          }
          class he {
            #e = null;
            #t = !1;
            constructor(x, F, I, B = !1) {
              this._pageIndex = x, this._pageInfo = F, this._transport = I, this._stats = B ? new l.StatTimer() : null, this._pdfBug = B, this.commonObjs = I.commonObjs, this.objs = new R(), this._maybeCleanupAfterRender = !1, this._intentStates = /* @__PURE__ */ new Map(), this.destroyed = !1;
            }
            get pageNumber() {
              return this._pageIndex + 1;
            }
            get rotate() {
              return this._pageInfo.rotate;
            }
            get ref() {
              return this._pageInfo.ref;
            }
            get userUnit() {
              return this._pageInfo.userUnit;
            }
            get view() {
              return this._pageInfo.view;
            }
            getViewport({
              scale: x,
              rotation: F = this.rotate,
              offsetX: I = 0,
              offsetY: B = 0,
              dontFlip: H = !1
            } = {}) {
              return new l.PageViewport({
                viewBox: this.view,
                scale: x,
                rotation: F,
                offsetX: I,
                offsetY: B,
                dontFlip: H
              });
            }
            getAnnotations({
              intent: x = "display"
            } = {}) {
              const {
                renderingIntent: F
              } = this._transport.getRenderingIntent(x);
              return this._transport.getAnnotations(this._pageIndex, F);
            }
            getJSActions() {
              return this._transport.getPageJSActions(this._pageIndex);
            }
            get filterFactory() {
              return this._transport.filterFactory;
            }
            get isPureXfa() {
              return (0, s.shadow)(this, "isPureXfa", !!this._transport._htmlForXfa);
            }
            async getXfa() {
              return this._transport._htmlForXfa?.children[this._pageIndex] || null;
            }
            render({
              canvasContext: x,
              viewport: F,
              intent: I = "display",
              annotationMode: B = s.AnnotationMode.ENABLE,
              transform: H = null,
              background: V = null,
              optionalContentConfigPromise: $ = null,
              annotationCanvasMap: X = null,
              pageColors: G = null,
              printAnnotationStorage: U = null
            }) {
              this._stats?.time("Overall");
              const ee = this._transport.getRenderingIntent(I, B, U), {
                renderingIntent: fe,
                cacheKey: re
              } = ee;
              this.#t = !1, this.#r(), $ ||= this._transport.getOptionalContentConfig(fe);
              let ue = this._intentStates.get(re);
              ue || (ue = /* @__PURE__ */ Object.create(null), this._intentStates.set(re, ue)), ue.streamReaderCancelTimeout && (clearTimeout(ue.streamReaderCancelTimeout), ue.streamReaderCancelTimeout = null);
              const _e = !!(fe & s.RenderingIntentFlag.PRINT);
              ue.displayReadyCapability || (ue.displayReadyCapability = Promise.withResolvers(), ue.operatorList = {
                fnArray: [],
                argsArray: [],
                lastChunk: !1,
                separateAnnots: null
              }, this._stats?.time("Page Request"), this._pumpOperatorList(ee));
              const ve = (De) => {
                ue.renderTasks.delete(be), (this._maybeCleanupAfterRender || _e) && (this.#t = !0), this.#n(!_e), De ? (be.capability.reject(De), this._abortOperatorList({
                  intentState: ue,
                  reason: De instanceof Error ? De : new Error(De)
                })) : be.capability.resolve(), this._stats?.timeEnd("Rendering"), this._stats?.timeEnd("Overall");
              }, be = new v({
                callback: ve,
                params: {
                  canvasContext: x,
                  viewport: F,
                  transform: H,
                  background: V
                },
                objs: this.objs,
                commonObjs: this.commonObjs,
                annotationCanvasMap: X,
                operatorList: ue.operatorList,
                pageIndex: this._pageIndex,
                canvasFactory: this._transport.canvasFactory,
                filterFactory: this._transport.filterFactory,
                useRequestAnimationFrame: !_e,
                pdfBug: this._pdfBug,
                pageColors: G
              });
              (ue.renderTasks ||= /* @__PURE__ */ new Set()).add(be);
              const xe = be.task;
              return Promise.all([ue.displayReadyCapability.promise, $]).then(([De, Oe]) => {
                if (this.destroyed) {
                  ve();
                  return;
                }
                if (this._stats?.time("Rendering"), !(Oe.renderingIntent & fe))
                  throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");
                be.initializeGraphics({
                  transparency: De,
                  optionalContentConfig: Oe
                }), be.operatorListChanged();
              }).catch(ve), xe;
            }
            getOperatorList({
              intent: x = "display",
              annotationMode: F = s.AnnotationMode.ENABLE,
              printAnnotationStorage: I = null
            } = {}) {
              function B() {
                V.operatorList.lastChunk && (V.opListReadCapability.resolve(V.operatorList), V.renderTasks.delete($));
              }
              const H = this._transport.getRenderingIntent(x, F, I, !0);
              let V = this._intentStates.get(H.cacheKey);
              V || (V = /* @__PURE__ */ Object.create(null), this._intentStates.set(H.cacheKey, V));
              let $;
              return V.opListReadCapability || ($ = /* @__PURE__ */ Object.create(null), $.operatorListChanged = B, V.opListReadCapability = Promise.withResolvers(), (V.renderTasks ||= /* @__PURE__ */ new Set()).add($), V.operatorList = {
                fnArray: [],
                argsArray: [],
                lastChunk: !1,
                separateAnnots: null
              }, this._stats?.time("Page Request"), this._pumpOperatorList(H)), V.opListReadCapability.promise;
            }
            streamTextContent({
              includeMarkedContent: x = !1,
              disableNormalization: F = !1
            } = {}) {
              return this._transport.messageHandler.sendWithStream("GetTextContent", {
                pageIndex: this._pageIndex,
                includeMarkedContent: x === !0,
                disableNormalization: F === !0
              }, {
                highWaterMark: 100,
                size(B) {
                  return B.items.length;
                }
              });
            }
            getTextContent(x = {}) {
              if (this._transport._htmlForXfa)
                return this.getXfa().then((I) => y.XfaText.textContent(I));
              const F = this.streamTextContent(x);
              return new Promise(function(I, B) {
                function H() {
                  V.read().then(function({
                    value: X,
                    done: G
                  }) {
                    if (G) {
                      I($);
                      return;
                    }
                    Object.assign($.styles, X.styles), $.items.push(...X.items), H();
                  }, B);
                }
                const V = F.getReader(), $ = {
                  items: [],
                  styles: /* @__PURE__ */ Object.create(null)
                };
                H();
              });
            }
            getStructTree() {
              return this._transport.getStructTree(this._pageIndex);
            }
            _destroy() {
              this.destroyed = !0;
              const x = [];
              for (const F of this._intentStates.values())
                if (this._abortOperatorList({
                  intentState: F,
                  reason: new Error("Page was destroyed."),
                  force: !0
                }), !F.opListReadCapability)
                  for (const I of F.renderTasks)
                    x.push(I.completed), I.cancel();
              return this.objs.clear(), this.#t = !1, this.#r(), Promise.all(x);
            }
            cleanup(x = !1) {
              this.#t = !0;
              const F = this.#n(!1);
              return x && F && (this._stats &&= new l.StatTimer()), F;
            }
            #n(x = !1) {
              if (this.#r(), !this.#t || this.destroyed)
                return !1;
              if (x)
                return this.#e = setTimeout(() => {
                  this.#e = null, this.#n(!1);
                }, P), !1;
              for (const {
                renderTasks: F,
                operatorList: I
              } of this._intentStates.values())
                if (F.size > 0 || !I.lastChunk)
                  return !1;
              return this._intentStates.clear(), this.objs.clear(), this.#t = !1, !0;
            }
            #r() {
              this.#e && (clearTimeout(this.#e), this.#e = null);
            }
            _startRenderPage(x, F) {
              const I = this._intentStates.get(F);
              I && (this._stats?.timeEnd("Page Request"), I.displayReadyCapability?.resolve(x));
            }
            _renderPageChunk(x, F) {
              for (let I = 0, B = x.length; I < B; I++)
                F.operatorList.fnArray.push(x.fnArray[I]), F.operatorList.argsArray.push(x.argsArray[I]);
              F.operatorList.lastChunk = x.lastChunk, F.operatorList.separateAnnots = x.separateAnnots;
              for (const I of F.renderTasks)
                I.operatorListChanged();
              x.lastChunk && this.#n(!0);
            }
            _pumpOperatorList({
              renderingIntent: x,
              cacheKey: F,
              annotationStorageSerializable: I
            }) {
              const {
                map: B,
                transfer: H
              } = I, $ = this._transport.messageHandler.sendWithStream("GetOperatorList", {
                pageIndex: this._pageIndex,
                intent: x,
                cacheKey: F,
                annotationStorage: B
              }, H).getReader(), X = this._intentStates.get(F);
              X.streamReader = $;
              const G = () => {
                $.read().then(({
                  value: U,
                  done: ee
                }) => {
                  if (ee) {
                    X.streamReader = null;
                    return;
                  }
                  this._transport.destroyed || (this._renderPageChunk(U, X), G());
                }, (U) => {
                  if (X.streamReader = null, !this._transport.destroyed) {
                    if (X.operatorList) {
                      X.operatorList.lastChunk = !0;
                      for (const ee of X.renderTasks)
                        ee.operatorListChanged();
                      this.#n(!0);
                    }
                    if (X.displayReadyCapability)
                      X.displayReadyCapability.reject(U);
                    else if (X.opListReadCapability)
                      X.opListReadCapability.reject(U);
                    else
                      throw U;
                  }
                });
              };
              G();
            }
            _abortOperatorList({
              intentState: x,
              reason: F,
              force: I = !1
            }) {
              if (x.streamReader) {
                if (x.streamReaderCancelTimeout && (clearTimeout(x.streamReaderCancelTimeout), x.streamReaderCancelTimeout = null), !I) {
                  if (x.renderTasks.size > 0)
                    return;
                  if (F instanceof l.RenderingCancelledException) {
                    let B = L;
                    F.extraDelay > 0 && F.extraDelay < 1e3 && (B += F.extraDelay), x.streamReaderCancelTimeout = setTimeout(() => {
                      x.streamReaderCancelTimeout = null, this._abortOperatorList({
                        intentState: x,
                        reason: F,
                        force: !0
                      });
                    }, B);
                    return;
                  }
                }
                if (x.streamReader.cancel(new s.AbortException(F.message)).catch(() => {
                }), x.streamReader = null, !this._transport.destroyed) {
                  for (const [B, H] of this._intentStates)
                    if (H === x) {
                      this._intentStates.delete(B);
                      break;
                    }
                  this.cleanup();
                }
              }
            }
            get stats() {
              return this._stats;
            }
          }
          class we {
            #e = /* @__PURE__ */ new Set();
            #t = Promise.resolve();
            postMessage(x, F) {
              const I = {
                data: structuredClone(x, F ? {
                  transfer: F
                } : null)
              };
              this.#t.then(() => {
                for (const B of this.#e)
                  B.call(this, I);
              });
            }
            addEventListener(x, F) {
              this.#e.add(F);
            }
            removeEventListener(x, F) {
              this.#e.delete(F);
            }
            terminate() {
              this.#e.clear();
            }
          }
          const ke = {
            isWorkerDisabled: !1,
            fakeWorkerId: 0
          };
          s.isNodeJS && (ke.isWorkerDisabled = !0, f.GlobalWorkerOptions.workerSrc ||= "./pdf.worker.mjs"), ke.isSameOrigin = function(_, x) {
            let F;
            try {
              if (F = new URL(_), !F.origin || F.origin === "null")
                return !1;
            } catch {
              return !1;
            }
            const I = new URL(x, F);
            return F.origin === I.origin;
          }, ke.createCDNWrapper = function(_) {
            const x = `await import("${_}");`;
            return URL.createObjectURL(new Blob([x], {
              type: "text/javascript"
            }));
          };
          class Ae {
            static #e;
            constructor({
              name: x = null,
              port: F = null,
              verbosity: I = (0, s.getVerbosityLevel)()
            } = {}) {
              if (this.name = x, this.destroyed = !1, this.verbosity = I, this._readyCapability = Promise.withResolvers(), this._port = null, this._webWorker = null, this._messageHandler = null, F) {
                if (Ae.#e?.has(F))
                  throw new Error("Cannot use more than one PDFWorker per port.");
                (Ae.#e ||= /* @__PURE__ */ new WeakMap()).set(F, this), this._initializeFromPort(F);
                return;
              }
              this._initialize();
            }
            get promise() {
              return this._readyCapability.promise;
            }
            get port() {
              return this._port;
            }
            get messageHandler() {
              return this._messageHandler;
            }
            _initializeFromPort(x) {
              this._port = x, this._messageHandler = new g.MessageHandler("main", "worker", x), this._messageHandler.on("ready", function() {
              }), this._readyCapability.resolve(), this._messageHandler.send("configure", {
                verbosity: this.verbosity
              });
            }
            _initialize() {
              if (!ke.isWorkerDisabled && !Ae.#t) {
                let {
                  workerSrc: x
                } = Ae;
                try {
                  ke.isSameOrigin(window.location.href, x) || (x = ke.createCDNWrapper(new URL(x, window.location).href));
                  const F = new Worker(x, {
                    type: "module"
                  }), I = new g.MessageHandler("main", "worker", F), B = () => {
                    F.removeEventListener("error", H), I.destroy(), F.terminate(), this.destroyed ? this._readyCapability.reject(new Error("Worker was destroyed")) : this._setupFakeWorker();
                  }, H = () => {
                    this._webWorker || B();
                  };
                  F.addEventListener("error", H), I.on("test", ($) => {
                    if (F.removeEventListener("error", H), this.destroyed) {
                      B();
                      return;
                    }
                    $ ? (this._messageHandler = I, this._port = F, this._webWorker = F, this._readyCapability.resolve(), I.send("configure", {
                      verbosity: this.verbosity
                    })) : (this._setupFakeWorker(), I.destroy(), F.terminate());
                  }), I.on("ready", ($) => {
                    if (F.removeEventListener("error", H), this.destroyed) {
                      B();
                      return;
                    }
                    try {
                      V();
                    } catch {
                      this._setupFakeWorker();
                    }
                  });
                  const V = () => {
                    const $ = new Uint8Array();
                    I.send("test", $, [$.buffer]);
                  };
                  V();
                  return;
                } catch {
                  (0, s.info)("The worker has been disabled.");
                }
              }
              this._setupFakeWorker();
            }
            _setupFakeWorker() {
              ke.isWorkerDisabled || ((0, s.warn)("Setting up fake worker."), ke.isWorkerDisabled = !0), Ae._setupFakeWorkerGlobal.then((x) => {
                if (this.destroyed) {
                  this._readyCapability.reject(new Error("Worker was destroyed"));
                  return;
                }
                const F = new we();
                this._port = F;
                const I = `fake${ke.fakeWorkerId++}`, B = new g.MessageHandler(I + "_worker", I, F);
                x.setup(B, F);
                const H = new g.MessageHandler(I, I + "_worker", F);
                this._messageHandler = H, this._readyCapability.resolve(), H.send("configure", {
                  verbosity: this.verbosity
                });
              }).catch((x) => {
                this._readyCapability.reject(new Error(`Setting up fake worker failed: "${x.message}".`));
              });
            }
            destroy() {
              this.destroyed = !0, this._webWorker && (this._webWorker.terminate(), this._webWorker = null), Ae.#e?.delete(this._port), this._port = null, this._messageHandler && (this._messageHandler.destroy(), this._messageHandler = null);
            }
            static fromPort(x) {
              if (!x?.port)
                throw new Error("PDFWorker.fromPort - invalid method signature.");
              const F = this.#e?.get(x.port);
              if (F) {
                if (F._pendingDestroy)
                  throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");
                return F;
              }
              return new Ae(x);
            }
            static get workerSrc() {
              if (f.GlobalWorkerOptions.workerSrc)
                return f.GlobalWorkerOptions.workerSrc;
              throw new Error('No "GlobalWorkerOptions.workerSrc" specified.');
            }
            static get #t() {
              try {
                return globalThis.pdfjsWorker?.WorkerMessageHandler || null;
              } catch {
                return null;
              }
            }
            static get _setupFakeWorkerGlobal() {
              const x = async () => this.#t ? this.#t : (await import(
                /*webpackIgnore: true*/
                this.workerSrc
              )).WorkerMessageHandler;
              return (0, s.shadow)(this, "_setupFakeWorkerGlobal", x());
            }
          }
          class ae {
            #e = /* @__PURE__ */ new Map();
            #t = /* @__PURE__ */ new Map();
            #n = /* @__PURE__ */ new Map();
            #r = /* @__PURE__ */ new Map();
            #s = null;
            constructor(x, F, I, B, H) {
              this.messageHandler = x, this.loadingTask = F, this.commonObjs = new R(), this.fontLoader = new o.FontLoader({
                ownerDocument: B.ownerDocument,
                styleElement: B.styleElement
              }), this._params = B, this.canvasFactory = H.canvasFactory, this.filterFactory = H.filterFactory, this.cMapReaderFactory = H.cMapReaderFactory, this.standardFontDataFactory = H.standardFontDataFactory, this.destroyed = !1, this.destroyCapability = null, this._networkStream = I, this._fullReader = null, this._lastProgress = null, this.downloadInfoCapability = Promise.withResolvers(), this.setupMessageHandler();
            }
            #i(x, F = null) {
              const I = this.#e.get(x);
              if (I)
                return I;
              const B = this.messageHandler.sendWithPromise(x, F);
              return this.#e.set(x, B), B;
            }
            get annotationStorage() {
              return (0, s.shadow)(this, "annotationStorage", new u.AnnotationStorage());
            }
            getRenderingIntent(x, F = s.AnnotationMode.ENABLE, I = null, B = !1) {
              let H = s.RenderingIntentFlag.DISPLAY, V = u.SerializableEmpty;
              switch (x) {
                case "any":
                  H = s.RenderingIntentFlag.ANY;
                  break;
                case "display":
                  break;
                case "print":
                  H = s.RenderingIntentFlag.PRINT;
                  break;
                default:
                  (0, s.warn)(`getRenderingIntent - invalid intent: ${x}`);
              }
              switch (F) {
                case s.AnnotationMode.DISABLE:
                  H += s.RenderingIntentFlag.ANNOTATIONS_DISABLE;
                  break;
                case s.AnnotationMode.ENABLE:
                  break;
                case s.AnnotationMode.ENABLE_FORMS:
                  H += s.RenderingIntentFlag.ANNOTATIONS_FORMS;
                  break;
                case s.AnnotationMode.ENABLE_STORAGE:
                  H += s.RenderingIntentFlag.ANNOTATIONS_STORAGE, V = (H & s.RenderingIntentFlag.PRINT && I instanceof u.PrintAnnotationStorage ? I : this.annotationStorage).serializable;
                  break;
                default:
                  (0, s.warn)(`getRenderingIntent - invalid annotationMode: ${F}`);
              }
              return B && (H += s.RenderingIntentFlag.OPLIST), {
                renderingIntent: H,
                cacheKey: `${H}_${V.hash}`,
                annotationStorageSerializable: V
              };
            }
            destroy() {
              if (this.destroyCapability)
                return this.destroyCapability.promise;
              this.destroyed = !0, this.destroyCapability = Promise.withResolvers(), this.#s?.reject(new Error("Worker was destroyed during onPassword callback"));
              const x = [];
              for (const I of this.#t.values())
                x.push(I._destroy());
              this.#t.clear(), this.#n.clear(), this.#r.clear(), this.hasOwnProperty("annotationStorage") && this.annotationStorage.resetModified();
              const F = this.messageHandler.sendWithPromise("Terminate", null);
              return x.push(F), Promise.all(x).then(() => {
                this.commonObjs.clear(), this.fontLoader.clear(), this.#e.clear(), this.filterFactory.destroy(), (0, c.cleanupTextLayer)(), this._networkStream?.cancelAllRequests(new s.AbortException("Worker was terminated.")), this.messageHandler && (this.messageHandler.destroy(), this.messageHandler = null), this.destroyCapability.resolve();
              }, this.destroyCapability.reject), this.destroyCapability.promise;
            }
            setupMessageHandler() {
              const {
                messageHandler: x,
                loadingTask: F
              } = this;
              x.on("GetReader", (I, B) => {
                (0, s.assert)(this._networkStream, "GetReader - no `IPDFStream` instance available."), this._fullReader = this._networkStream.getFullReader(), this._fullReader.onProgress = (H) => {
                  this._lastProgress = {
                    loaded: H.loaded,
                    total: H.total
                  };
                }, B.onPull = () => {
                  this._fullReader.read().then(function({
                    value: H,
                    done: V
                  }) {
                    if (V) {
                      B.close();
                      return;
                    }
                    (0, s.assert)(H instanceof ArrayBuffer, "GetReader - expected an ArrayBuffer."), B.enqueue(new Uint8Array(H), 1, [H]);
                  }).catch((H) => {
                    B.error(H);
                  });
                }, B.onCancel = (H) => {
                  this._fullReader.cancel(H), B.ready.catch((V) => {
                    if (!this.destroyed)
                      throw V;
                  });
                };
              }), x.on("ReaderHeadersReady", (I) => {
                const B = Promise.withResolvers(), H = this._fullReader;
                return H.headersReady.then(() => {
                  (!H.isStreamingSupported || !H.isRangeSupported) && (this._lastProgress && F.onProgress?.(this._lastProgress), H.onProgress = (V) => {
                    F.onProgress?.({
                      loaded: V.loaded,
                      total: V.total
                    });
                  }), B.resolve({
                    isStreamingSupported: H.isStreamingSupported,
                    isRangeSupported: H.isRangeSupported,
                    contentLength: H.contentLength
                  });
                }, B.reject), B.promise;
              }), x.on("GetRangeReader", (I, B) => {
                (0, s.assert)(this._networkStream, "GetRangeReader - no `IPDFStream` instance available.");
                const H = this._networkStream.getRangeReader(I.begin, I.end);
                if (!H) {
                  B.close();
                  return;
                }
                B.onPull = () => {
                  H.read().then(function({
                    value: V,
                    done: $
                  }) {
                    if ($) {
                      B.close();
                      return;
                    }
                    (0, s.assert)(V instanceof ArrayBuffer, "GetRangeReader - expected an ArrayBuffer."), B.enqueue(new Uint8Array(V), 1, [V]);
                  }).catch((V) => {
                    B.error(V);
                  });
                }, B.onCancel = (V) => {
                  H.cancel(V), B.ready.catch(($) => {
                    if (!this.destroyed)
                      throw $;
                  });
                };
              }), x.on("GetDoc", ({
                pdfInfo: I
              }) => {
                this._numPages = I.numPages, this._htmlForXfa = I.htmlForXfa, delete I.htmlForXfa, F._capability.resolve(new pe(I, this));
              }), x.on("DocException", function(I) {
                let B;
                switch (I.name) {
                  case "PasswordException":
                    B = new s.PasswordException(I.message, I.code);
                    break;
                  case "InvalidPDFException":
                    B = new s.InvalidPDFException(I.message);
                    break;
                  case "MissingPDFException":
                    B = new s.MissingPDFException(I.message);
                    break;
                  case "UnexpectedResponseException":
                    B = new s.UnexpectedResponseException(I.message, I.status);
                    break;
                  case "UnknownErrorException":
                    B = new s.UnknownErrorException(I.message, I.details);
                    break;
                  default:
                    (0, s.unreachable)("DocException - expected a valid Error.");
                }
                F._capability.reject(B);
              }), x.on("PasswordRequest", (I) => {
                if (this.#s = Promise.withResolvers(), F.onPassword) {
                  const B = (H) => {
                    H instanceof Error ? this.#s.reject(H) : this.#s.resolve({
                      password: H
                    });
                  };
                  try {
                    F.onPassword(B, I.code);
                  } catch (H) {
                    this.#s.reject(H);
                  }
                } else
                  this.#s.reject(new s.PasswordException(I.message, I.code));
                return this.#s.promise;
              }), x.on("DataLoaded", (I) => {
                F.onProgress?.({
                  loaded: I.length,
                  total: I.length
                }), this.downloadInfoCapability.resolve(I);
              }), x.on("StartRenderPage", (I) => {
                if (this.destroyed)
                  return;
                this.#t.get(I.pageIndex)._startRenderPage(I.transparency, I.cacheKey);
              }), x.on("commonobj", ([I, B, H]) => {
                if (this.destroyed || this.commonObjs.has(I))
                  return null;
                switch (B) {
                  case "Font":
                    const V = this._params;
                    if ("error" in H) {
                      const U = H.error;
                      (0, s.warn)(`Error during font loading: ${U}`), this.commonObjs.resolve(I, U);
                      break;
                    }
                    const $ = V.pdfBug && globalThis.FontInspector?.enabled ? (U, ee) => globalThis.FontInspector.fontAdded(U, ee) : null, X = new o.FontFaceObject(H, {
                      disableFontFace: V.disableFontFace,
                      ignoreErrors: V.ignoreErrors,
                      inspectFont: $
                    });
                    this.fontLoader.bind(X).catch(() => x.sendWithPromise("FontFallback", {
                      id: I
                    })).finally(() => {
                      !V.fontExtraProperties && X.data && (X.data = null), this.commonObjs.resolve(I, X);
                    });
                    break;
                  case "CopyLocalImage":
                    const {
                      imageRef: G
                    } = H;
                    (0, s.assert)(G, "The imageRef must be defined.");
                    for (const U of this.#t.values())
                      for (const [, ee] of U.objs)
                        if (ee.ref === G)
                          return ee.dataLen ? (this.commonObjs.resolve(I, structuredClone(ee)), ee.dataLen) : null;
                    break;
                  case "FontPath":
                  case "Image":
                  case "Pattern":
                    this.commonObjs.resolve(I, H);
                    break;
                  default:
                    throw new Error(`Got unknown common object type ${B}`);
                }
                return null;
              }), x.on("obj", ([I, B, H, V]) => {
                if (this.destroyed)
                  return;
                const $ = this.#t.get(B);
                if (!$.objs.has(I)) {
                  if ($._intentStates.size === 0) {
                    V?.bitmap?.close();
                    return;
                  }
                  switch (H) {
                    case "Image":
                      $.objs.resolve(I, V), V?.dataLen > s.MAX_IMAGE_SIZE_TO_CACHE && ($._maybeCleanupAfterRender = !0);
                      break;
                    case "Pattern":
                      $.objs.resolve(I, V);
                      break;
                    default:
                      throw new Error(`Got unknown object type ${H}`);
                  }
                }
              }), x.on("DocProgress", (I) => {
                this.destroyed || F.onProgress?.({
                  loaded: I.loaded,
                  total: I.total
                });
              }), x.on("FetchBuiltInCMap", (I) => this.destroyed ? Promise.reject(new Error("Worker was destroyed.")) : this.cMapReaderFactory ? this.cMapReaderFactory.fetch(I) : Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))), x.on("FetchStandardFontData", (I) => this.destroyed ? Promise.reject(new Error("Worker was destroyed.")) : this.standardFontDataFactory ? this.standardFontDataFactory.fetch(I) : Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")));
            }
            getData() {
              return this.messageHandler.sendWithPromise("GetData", null);
            }
            saveDocument() {
              this.annotationStorage.size <= 0 && (0, s.warn)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");
              const {
                map: x,
                transfer: F
              } = this.annotationStorage.serializable;
              return this.messageHandler.sendWithPromise("SaveDocument", {
                isPureXfa: !!this._htmlForXfa,
                numPages: this._numPages,
                annotationStorage: x,
                filename: this._fullReader?.filename ?? null
              }, F).finally(() => {
                this.annotationStorage.resetModified();
              });
            }
            getPage(x) {
              if (!Number.isInteger(x) || x <= 0 || x > this._numPages)
                return Promise.reject(new Error("Invalid page request."));
              const F = x - 1, I = this.#n.get(F);
              if (I)
                return I;
              const B = this.messageHandler.sendWithPromise("GetPage", {
                pageIndex: F
              }).then((H) => {
                if (this.destroyed)
                  throw new Error("Transport destroyed");
                H.refStr && this.#r.set(H.refStr, x);
                const V = new he(F, H, this, this._params.pdfBug);
                return this.#t.set(F, V), V;
              });
              return this.#n.set(F, B), B;
            }
            getPageIndex(x) {
              return oe(x) ? this.messageHandler.sendWithPromise("GetPageIndex", {
                num: x.num,
                gen: x.gen
              }) : Promise.reject(new Error("Invalid pageIndex request."));
            }
            getAnnotations(x, F) {
              return this.messageHandler.sendWithPromise("GetAnnotations", {
                pageIndex: x,
                intent: F
              });
            }
            getFieldObjects() {
              return this.#i("GetFieldObjects");
            }
            hasJSActions() {
              return this.#i("HasJSActions");
            }
            getCalculationOrderIds() {
              return this.messageHandler.sendWithPromise("GetCalculationOrderIds", null);
            }
            getDestinations() {
              return this.messageHandler.sendWithPromise("GetDestinations", null);
            }
            getDestination(x) {
              return typeof x != "string" ? Promise.reject(new Error("Invalid destination request.")) : this.messageHandler.sendWithPromise("GetDestination", {
                id: x
              });
            }
            getPageLabels() {
              return this.messageHandler.sendWithPromise("GetPageLabels", null);
            }
            getPageLayout() {
              return this.messageHandler.sendWithPromise("GetPageLayout", null);
            }
            getPageMode() {
              return this.messageHandler.sendWithPromise("GetPageMode", null);
            }
            getViewerPreferences() {
              return this.messageHandler.sendWithPromise("GetViewerPreferences", null);
            }
            getOpenAction() {
              return this.messageHandler.sendWithPromise("GetOpenAction", null);
            }
            getAttachments() {
              return this.messageHandler.sendWithPromise("GetAttachments", null);
            }
            getDocJSActions() {
              return this.#i("GetDocJSActions");
            }
            getPageJSActions(x) {
              return this.messageHandler.sendWithPromise("GetPageJSActions", {
                pageIndex: x
              });
            }
            getStructTree(x) {
              return this.messageHandler.sendWithPromise("GetStructTree", {
                pageIndex: x
              });
            }
            getOutline() {
              return this.messageHandler.sendWithPromise("GetOutline", null);
            }
            getOptionalContentConfig(x) {
              return this.#i("GetOptionalContentConfig").then((F) => new m.OptionalContentConfig(F, x));
            }
            getPermissions() {
              return this.messageHandler.sendWithPromise("GetPermissions", null);
            }
            getMetadata() {
              const x = "GetMetadata", F = this.#e.get(x);
              if (F)
                return F;
              const I = this.messageHandler.sendWithPromise(x, null).then((B) => ({
                info: B[0],
                metadata: B[1] ? new A.Metadata(B[1]) : null,
                contentDispositionFilename: this._fullReader?.filename ?? null,
                contentLength: this._fullReader?.contentLength ?? null
              }));
              return this.#e.set(x, I), I;
            }
            getMarkInfo() {
              return this.messageHandler.sendWithPromise("GetMarkInfo", null);
            }
            async startCleanup(x = !1) {
              if (!this.destroyed) {
                await this.messageHandler.sendWithPromise("Cleanup", null);
                for (const F of this.#t.values())
                  if (!F.cleanup())
                    throw new Error(`startCleanup: Page ${F.pageNumber} is currently rendering.`);
                this.commonObjs.clear(), x || this.fontLoader.clear(), this.#e.clear(), this.filterFactory.destroy(!0), (0, c.cleanupTextLayer)();
              }
            }
            cachedPageNumber(x) {
              if (!oe(x))
                return null;
              const F = x.gen === 0 ? `${x.num}R` : `${x.num}R${x.gen}`;
              return this.#r.get(F) ?? null;
            }
            get loadingParams() {
              const {
                disableAutoFetch: x,
                enableXfa: F
              } = this._params;
              return (0, s.shadow)(this, "loadingParams", {
                disableAutoFetch: x,
                enableXfa: F
              });
            }
          }
          const de = Symbol("INITIAL_DATA");
          class R {
            #e = /* @__PURE__ */ Object.create(null);
            #t(x) {
              return this.#e[x] ||= {
                ...Promise.withResolvers(),
                data: de
              };
            }
            get(x, F = null) {
              if (F) {
                const B = this.#t(x);
                return B.promise.then(() => F(B.data)), null;
              }
              const I = this.#e[x];
              if (!I || I.data === de)
                throw new Error(`Requesting object that isn't resolved yet ${x}.`);
              return I.data;
            }
            has(x) {
              const F = this.#e[x];
              return !!F && F.data !== de;
            }
            resolve(x, F = null) {
              const I = this.#t(x);
              I.data = F, I.resolve();
            }
            clear() {
              for (const x in this.#e) {
                const {
                  data: F
                } = this.#e[x];
                F?.bitmap?.close();
              }
              this.#e = /* @__PURE__ */ Object.create(null);
            }
            *[Symbol.iterator]() {
              for (const x in this.#e) {
                const {
                  data: F
                } = this.#e[x];
                F !== de && (yield [x, F]);
              }
            }
          }
          class D {
            #e = null;
            constructor(x) {
              this.#e = x, this.onContinue = null;
            }
            get promise() {
              return this.#e.capability.promise;
            }
            cancel(x = 0) {
              this.#e.cancel(null, x);
            }
            get separateAnnots() {
              const {
                separateAnnots: x
              } = this.#e.operatorList;
              if (!x)
                return !1;
              const {
                annotationCanvasMap: F
              } = this.#e;
              return x.form || x.canvas && F?.size > 0;
            }
          }
          class v {
            static #e = /* @__PURE__ */ new WeakSet();
            constructor({
              callback: x,
              params: F,
              objs: I,
              commonObjs: B,
              annotationCanvasMap: H,
              operatorList: V,
              pageIndex: $,
              canvasFactory: X,
              filterFactory: G,
              useRequestAnimationFrame: U = !1,
              pdfBug: ee = !1,
              pageColors: fe = null
            }) {
              this.callback = x, this.params = F, this.objs = I, this.commonObjs = B, this.annotationCanvasMap = H, this.operatorListIdx = null, this.operatorList = V, this._pageIndex = $, this.canvasFactory = X, this.filterFactory = G, this._pdfBug = ee, this.pageColors = fe, this.running = !1, this.graphicsReadyCallback = null, this.graphicsReady = !1, this._useRequestAnimationFrame = U === !0 && typeof window < "u", this.cancelled = !1, this.capability = Promise.withResolvers(), this.task = new D(this), this._cancelBound = this.cancel.bind(this), this._continueBound = this._continue.bind(this), this._scheduleNextBound = this._scheduleNext.bind(this), this._nextBound = this._next.bind(this), this._canvas = F.canvasContext.canvas;
            }
            get completed() {
              return this.capability.promise.catch(function() {
              });
            }
            initializeGraphics({
              transparency: x = !1,
              optionalContentConfig: F
            }) {
              if (this.cancelled)
                return;
              if (this._canvas) {
                if (v.#e.has(this._canvas))
                  throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");
                v.#e.add(this._canvas);
              }
              this._pdfBug && globalThis.StepperManager?.enabled && (this.stepper = globalThis.StepperManager.create(this._pageIndex), this.stepper.init(this.operatorList), this.stepper.nextBreakPoint = this.stepper.getNextBreakPoint());
              const {
                canvasContext: I,
                viewport: B,
                transform: H,
                background: V
              } = this.params;
              this.gfx = new d.CanvasGraphics(I, this.commonObjs, this.objs, this.canvasFactory, this.filterFactory, {
                optionalContentConfig: F
              }, this.annotationCanvasMap, this.pageColors), this.gfx.beginDrawing({
                transform: H,
                viewport: B,
                transparency: x,
                background: V
              }), this.operatorListIdx = 0, this.graphicsReady = !0, this.graphicsReadyCallback?.();
            }
            cancel(x = null, F = 0) {
              this.running = !1, this.cancelled = !0, this.gfx?.endDrawing(), v.#e.delete(this._canvas), this.callback(x || new l.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex + 1}`, F));
            }
            operatorListChanged() {
              if (!this.graphicsReady) {
                this.graphicsReadyCallback ||= this._continueBound;
                return;
              }
              this.stepper?.updateOperatorList(this.operatorList), !this.running && this._continue();
            }
            _continue() {
              this.running = !0, !this.cancelled && (this.task.onContinue ? this.task.onContinue(this._scheduleNextBound) : this._scheduleNext());
            }
            _scheduleNext() {
              this._useRequestAnimationFrame ? window.requestAnimationFrame(() => {
                this._nextBound().catch(this._cancelBound);
              }) : Promise.resolve().then(this._nextBound).catch(this._cancelBound);
            }
            async _next() {
              this.cancelled || (this.operatorListIdx = this.gfx.executeOperatorList(this.operatorList, this.operatorListIdx, this._continueBound, this.stepper), this.operatorListIdx === this.operatorList.argsArray.length && (this.running = !1, this.operatorList.lastChunk && (this.gfx.endDrawing(), v.#e.delete(this._canvas), this.callback())));
            }
          }
          const S = "4.2.67", E = "49b388101";
          r();
        } catch (M) {
          r(M);
        }
      });
    }
  ),
  /***/
  583: (
    /***/
    (i, e, t) => {
      t.d(e, {
        /* harmony export */
        BaseCMapReaderFactory: () => (
          /* binding */
          u
        ),
        /* harmony export */
        BaseCanvasFactory: () => (
          /* binding */
          s
        ),
        /* harmony export */
        BaseFilterFactory: () => (
          /* binding */
          r
        ),
        /* harmony export */
        BaseSVGFactory: () => (
          /* binding */
          o
        ),
        /* harmony export */
        BaseStandardFontDataFactory: () => (
          /* binding */
          l
        )
        /* harmony export */
      });
      var n = t(292);
      class r {
        constructor() {
          this.constructor === r && (0, n.unreachable)("Cannot initialize BaseFilterFactory.");
        }
        addFilter(d) {
          return "none";
        }
        addHCMFilter(d, c) {
          return "none";
        }
        addHighlightHCMFilter(d, c, f, g, A) {
          return "none";
        }
        destroy(d = !1) {
        }
      }
      class s {
        constructor() {
          this.constructor === s && (0, n.unreachable)("Cannot initialize BaseCanvasFactory.");
        }
        create(d, c) {
          if (d <= 0 || c <= 0)
            throw new Error("Invalid canvas size");
          const f = this._createCanvas(d, c);
          return {
            canvas: f,
            context: f.getContext("2d")
          };
        }
        reset(d, c, f) {
          if (!d.canvas)
            throw new Error("Canvas is not specified");
          if (c <= 0 || f <= 0)
            throw new Error("Invalid canvas size");
          d.canvas.width = c, d.canvas.height = f;
        }
        destroy(d) {
          if (!d.canvas)
            throw new Error("Canvas is not specified");
          d.canvas.width = 0, d.canvas.height = 0, d.canvas = null, d.context = null;
        }
        _createCanvas(d, c) {
          (0, n.unreachable)("Abstract method `_createCanvas` called.");
        }
      }
      class u {
        constructor({
          baseUrl: d = null,
          isCompressed: c = !0
        }) {
          this.constructor === u && (0, n.unreachable)("Cannot initialize BaseCMapReaderFactory."), this.baseUrl = d, this.isCompressed = c;
        }
        async fetch({
          name: d
        }) {
          if (!this.baseUrl)
            throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');
          if (!d)
            throw new Error("CMap name must be specified.");
          const c = this.baseUrl + d + (this.isCompressed ? ".bcmap" : ""), f = this.isCompressed ? n.CMapCompressionType.BINARY : n.CMapCompressionType.NONE;
          return this._fetchData(c, f).catch((g) => {
            throw new Error(`Unable to load ${this.isCompressed ? "binary " : ""}CMap at: ${c}`);
          });
        }
        _fetchData(d, c) {
          (0, n.unreachable)("Abstract method `_fetchData` called.");
        }
      }
      class l {
        constructor({
          baseUrl: d = null
        }) {
          this.constructor === l && (0, n.unreachable)("Cannot initialize BaseStandardFontDataFactory."), this.baseUrl = d;
        }
        async fetch({
          filename: d
        }) {
          if (!this.baseUrl)
            throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');
          if (!d)
            throw new Error("Font filename must be specified.");
          const c = `${this.baseUrl}${d}`;
          return this._fetchData(c).catch((f) => {
            throw new Error(`Unable to load font data at: ${c}`);
          });
        }
        _fetchData(d) {
          (0, n.unreachable)("Abstract method `_fetchData` called.");
        }
      }
      class o {
        constructor() {
          this.constructor === o && (0, n.unreachable)("Cannot initialize BaseSVGFactory.");
        }
        create(d, c, f = !1) {
          if (d <= 0 || c <= 0)
            throw new Error("Invalid SVG dimensions");
          const g = this._createSVG("svg:svg");
          return g.setAttribute("version", "1.1"), f || (g.setAttribute("width", `${d}px`), g.setAttribute("height", `${c}px`)), g.setAttribute("preserveAspectRatio", "none"), g.setAttribute("viewBox", `0 0 ${d} ${c}`), g;
        }
        createElement(d) {
          if (typeof d != "string")
            throw new Error("Invalid SVG element type");
          return this._createSVG(d);
        }
        _createSVG(d) {
          (0, n.unreachable)("Abstract method `_createSVG` called.");
        }
      }
    }
  ),
  /***/
  923: (
    /***/
    (i, e, t) => {
      t.d(e, {
        CanvasGraphics: () => (
          /* binding */
          R
        )
      });
      var n = t(292), r = t(419);
      const s = {
        FILL: "Fill",
        STROKE: "Stroke",
        SHADING: "Shading"
      };
      function u(D, v) {
        if (!v)
          return;
        const S = v[2] - v[0], E = v[3] - v[1], _ = new Path2D();
        _.rect(v[0], v[1], S, E), D.clip(_);
      }
      class l {
        constructor() {
          this.constructor === l && (0, n.unreachable)("Cannot initialize BaseShadingPattern.");
        }
        getPattern() {
          (0, n.unreachable)("Abstract method `getPattern` called.");
        }
      }
      class o extends l {
        constructor(v) {
          super(), this._type = v[1], this._bbox = v[2], this._colorStops = v[3], this._p0 = v[4], this._p1 = v[5], this._r0 = v[6], this._r1 = v[7], this.matrix = null;
        }
        _createGradient(v) {
          let S;
          this._type === "axial" ? S = v.createLinearGradient(this._p0[0], this._p0[1], this._p1[0], this._p1[1]) : this._type === "radial" && (S = v.createRadialGradient(this._p0[0], this._p0[1], this._r0, this._p1[0], this._p1[1], this._r1));
          for (const E of this._colorStops)
            S.addColorStop(E[0], E[1]);
          return S;
        }
        getPattern(v, S, E, _) {
          let x;
          if (_ === s.STROKE || _ === s.FILL) {
            const F = S.current.getClippedPathBoundingBox(_, (0, r.getCurrentTransform)(v)) || [0, 0, 0, 0], I = Math.ceil(F[2] - F[0]) || 1, B = Math.ceil(F[3] - F[1]) || 1, H = S.cachedCanvases.getCanvas("pattern", I, B, !0), V = H.context;
            V.clearRect(0, 0, V.canvas.width, V.canvas.height), V.beginPath(), V.rect(0, 0, V.canvas.width, V.canvas.height), V.translate(-F[0], -F[1]), E = n.Util.transform(E, [1, 0, 0, 1, F[0], F[1]]), V.transform(...S.baseTransform), this.matrix && V.transform(...this.matrix), u(V, this._bbox), V.fillStyle = this._createGradient(V), V.fill(), x = v.createPattern(H.canvas, "no-repeat");
            const $ = new DOMMatrix(E);
            x.setTransform($);
          } else
            u(v, this._bbox), x = this._createGradient(v);
          return x;
        }
      }
      function h(D, v, S, E, _, x, F, I) {
        const B = v.coords, H = v.colors, V = D.data, $ = D.width * 4;
        let X;
        B[S + 1] > B[E + 1] && (X = S, S = E, E = X, X = x, x = F, F = X), B[E + 1] > B[_ + 1] && (X = E, E = _, _ = X, X = F, F = I, I = X), B[S + 1] > B[E + 1] && (X = S, S = E, E = X, X = x, x = F, F = X);
        const G = (B[S] + v.offsetX) * v.scaleX, U = (B[S + 1] + v.offsetY) * v.scaleY, ee = (B[E] + v.offsetX) * v.scaleX, fe = (B[E + 1] + v.offsetY) * v.scaleY, re = (B[_] + v.offsetX) * v.scaleX, ue = (B[_ + 1] + v.offsetY) * v.scaleY;
        if (U >= ue)
          return;
        const _e = H[x], ve = H[x + 1], be = H[x + 2], xe = H[F], De = H[F + 1], Oe = H[F + 2], Ve = H[I], Ge = H[I + 1], He = H[I + 2], Ct = Math.round(U), ht = Math.round(ue);
        let Dt, Ze, bt, an, Qe, Xt, Ii, Ln;
        for (let ft = Ct; ft <= ht; ft++) {
          if (ft < fe) {
            const at = ft < U ? 0 : (U - ft) / (U - fe);
            Dt = G - (G - ee) * at, Ze = _e - (_e - xe) * at, bt = ve - (ve - De) * at, an = be - (be - Oe) * at;
          } else {
            let at;
            ft > ue ? at = 1 : fe === ue ? at = 0 : at = (fe - ft) / (fe - ue), Dt = ee - (ee - re) * at, Ze = xe - (xe - Ve) * at, bt = De - (De - Ge) * at, an = Oe - (Oe - He) * at;
          }
          let ut;
          ft < U ? ut = 0 : ft > ue ? ut = 1 : ut = (U - ft) / (U - ue), Qe = G - (G - re) * ut, Xt = _e - (_e - Ve) * ut, Ii = ve - (ve - Ge) * ut, Ln = be - (be - He) * ut;
          const ui = Math.round(Math.min(Dt, Qe)), ci = Math.round(Math.max(Dt, Qe));
          let In = $ * ft + ui * 4;
          for (let at = ui; at <= ci; at++)
            ut = (Dt - at) / (Dt - Qe), ut < 0 ? ut = 0 : ut > 1 && (ut = 1), V[In++] = Ze - (Ze - Xt) * ut | 0, V[In++] = bt - (bt - Ii) * ut | 0, V[In++] = an - (an - Ln) * ut | 0, V[In++] = 255;
        }
      }
      function d(D, v, S) {
        const E = v.coords, _ = v.colors;
        let x, F;
        switch (v.type) {
          case "lattice":
            const I = v.verticesPerRow, B = Math.floor(E.length / I) - 1, H = I - 1;
            for (x = 0; x < B; x++) {
              let V = x * I;
              for (let $ = 0; $ < H; $++, V++)
                h(D, S, E[V], E[V + 1], E[V + I], _[V], _[V + 1], _[V + I]), h(D, S, E[V + I + 1], E[V + 1], E[V + I], _[V + I + 1], _[V + 1], _[V + I]);
            }
            break;
          case "triangles":
            for (x = 0, F = E.length; x < F; x += 3)
              h(D, S, E[x], E[x + 1], E[x + 2], _[x], _[x + 1], _[x + 2]);
            break;
          default:
            throw new Error("illegal figure");
        }
      }
      class c extends l {
        constructor(v) {
          super(), this._coords = v[2], this._colors = v[3], this._figures = v[4], this._bounds = v[5], this._bbox = v[7], this._background = v[8], this.matrix = null;
        }
        _createMeshCanvas(v, S, E) {
          const I = Math.floor(this._bounds[0]), B = Math.floor(this._bounds[1]), H = Math.ceil(this._bounds[2]) - I, V = Math.ceil(this._bounds[3]) - B, $ = Math.min(Math.ceil(Math.abs(H * v[0] * 1.1)), 3e3), X = Math.min(Math.ceil(Math.abs(V * v[1] * 1.1)), 3e3), G = H / $, U = V / X, ee = {
            coords: this._coords,
            colors: this._colors,
            offsetX: -I,
            offsetY: -B,
            scaleX: 1 / G,
            scaleY: 1 / U
          }, fe = $ + 2 * 2, re = X + 2 * 2, ue = E.getCanvas("mesh", fe, re, !1), _e = ue.context, ve = _e.createImageData($, X);
          if (S) {
            const xe = ve.data;
            for (let De = 0, Oe = xe.length; De < Oe; De += 4)
              xe[De] = S[0], xe[De + 1] = S[1], xe[De + 2] = S[2], xe[De + 3] = 255;
          }
          for (const xe of this._figures)
            d(ve, xe, ee);
          return _e.putImageData(ve, 2, 2), {
            canvas: ue.canvas,
            offsetX: I - 2 * G,
            offsetY: B - 2 * U,
            scaleX: G,
            scaleY: U
          };
        }
        getPattern(v, S, E, _) {
          u(v, this._bbox);
          let x;
          if (_ === s.SHADING)
            x = n.Util.singularValueDecompose2dScale((0, r.getCurrentTransform)(v));
          else if (x = n.Util.singularValueDecompose2dScale(S.baseTransform), this.matrix) {
            const I = n.Util.singularValueDecompose2dScale(this.matrix);
            x = [x[0] * I[0], x[1] * I[1]];
          }
          const F = this._createMeshCanvas(x, _ === s.SHADING ? null : this._background, S.cachedCanvases);
          return _ !== s.SHADING && (v.setTransform(...S.baseTransform), this.matrix && v.transform(...this.matrix)), v.translate(F.offsetX, F.offsetY), v.scale(F.scaleX, F.scaleY), v.createPattern(F.canvas, "no-repeat");
        }
      }
      class f extends l {
        getPattern() {
          return "hotpink";
        }
      }
      function g(D) {
        switch (D[0]) {
          case "RadialAxial":
            return new o(D);
          case "Mesh":
            return new c(D);
          case "Dummy":
            return new f();
        }
        throw new Error(`Unknown IR type: ${D[0]}`);
      }
      const A = {
        COLORED: 1,
        UNCOLORED: 2
      };
      class m {
        static MAX_PATTERN_SIZE = 3e3;
        constructor(v, S, E, _, x) {
          this.operatorList = v[2], this.matrix = v[3] || [1, 0, 0, 1, 0, 0], this.bbox = v[4], this.xstep = v[5], this.ystep = v[6], this.paintType = v[7], this.tilingType = v[8], this.color = S, this.ctx = E, this.canvasGraphicsFactory = _, this.baseTransform = x;
        }
        createPatternCanvas(v) {
          const S = this.operatorList, E = this.bbox, _ = this.xstep, x = this.ystep, F = this.paintType, I = this.tilingType, B = this.color, H = this.canvasGraphicsFactory;
          (0, n.info)("TilingType: " + I);
          const V = E[0], $ = E[1], X = E[2], G = E[3], U = n.Util.singularValueDecompose2dScale(this.matrix), ee = n.Util.singularValueDecompose2dScale(this.baseTransform), fe = [U[0] * ee[0], U[1] * ee[1]], re = this.getSizeAndScale(_, this.ctx.canvas.width, fe[0]), ue = this.getSizeAndScale(x, this.ctx.canvas.height, fe[1]), _e = v.cachedCanvases.getCanvas("pattern", re.size, ue.size, !0), ve = _e.context, be = H.createCanvasGraphics(ve);
          be.groupLevel = v.groupLevel, this.setFillAndStrokeStyleToContext(be, F, B);
          let xe = V, De = $, Oe = X, Ve = G;
          return V < 0 && (xe = 0, Oe += Math.abs(V)), $ < 0 && (De = 0, Ve += Math.abs($)), ve.translate(-(re.scale * xe), -(ue.scale * De)), be.transform(re.scale, 0, 0, ue.scale, 0, 0), ve.save(), this.clipBbox(be, xe, De, Oe, Ve), be.baseTransform = (0, r.getCurrentTransform)(be.ctx), be.executeOperatorList(S), be.endDrawing(), {
            canvas: _e.canvas,
            scaleX: re.scale,
            scaleY: ue.scale,
            offsetX: xe,
            offsetY: De
          };
        }
        getSizeAndScale(v, S, E) {
          v = Math.abs(v);
          const _ = Math.max(m.MAX_PATTERN_SIZE, S);
          let x = Math.ceil(v * E);
          return x >= _ ? x = _ : E = x / v, {
            scale: E,
            size: x
          };
        }
        clipBbox(v, S, E, _, x) {
          const F = _ - S, I = x - E;
          v.ctx.rect(S, E, F, I), v.current.updateRectMinMax((0, r.getCurrentTransform)(v.ctx), [S, E, _, x]), v.clip(), v.endPath();
        }
        setFillAndStrokeStyleToContext(v, S, E) {
          const _ = v.ctx, x = v.current;
          switch (S) {
            case A.COLORED:
              const F = this.ctx;
              _.fillStyle = F.fillStyle, _.strokeStyle = F.strokeStyle, x.fillColor = F.fillStyle, x.strokeColor = F.strokeStyle;
              break;
            case A.UNCOLORED:
              const I = n.Util.makeHexColor(E[0], E[1], E[2]);
              _.fillStyle = I, _.strokeStyle = I, x.fillColor = I, x.strokeColor = I;
              break;
            default:
              throw new n.FormatError(`Unsupported paint type: ${S}`);
          }
        }
        getPattern(v, S, E, _) {
          let x = E;
          _ !== s.SHADING && (x = n.Util.transform(x, S.baseTransform), this.matrix && (x = n.Util.transform(x, this.matrix)));
          const F = this.createPatternCanvas(S);
          let I = new DOMMatrix(x);
          I = I.translate(F.offsetX, F.offsetY), I = I.scale(1 / F.scaleX, 1 / F.scaleY);
          const B = v.createPattern(F.canvas, "repeat");
          return B.setTransform(I), B;
        }
      }
      function k({
        src: D,
        srcPos: v = 0,
        dest: S,
        width: E,
        height: _,
        nonBlackColor: x = 4294967295,
        inverseDecode: F = !1
      }) {
        const I = n.FeatureTest.isLittleEndian ? 4278190080 : 255, [B, H] = F ? [x, I] : [I, x], V = E >> 3, $ = E & 7, X = D.length;
        S = new Uint32Array(S.buffer);
        let G = 0;
        for (let U = 0; U < _; U++) {
          for (const fe = v + V; v < fe; v++) {
            const re = v < X ? D[v] : 255;
            S[G++] = re & 128 ? H : B, S[G++] = re & 64 ? H : B, S[G++] = re & 32 ? H : B, S[G++] = re & 16 ? H : B, S[G++] = re & 8 ? H : B, S[G++] = re & 4 ? H : B, S[G++] = re & 2 ? H : B, S[G++] = re & 1 ? H : B;
          }
          if ($ === 0)
            continue;
          const ee = v < X ? D[v++] : 255;
          for (let fe = 0; fe < $; fe++)
            S[G++] = ee & 1 << 7 - fe ? H : B;
        }
        return {
          srcPos: v,
          destPos: G
        };
      }
      const a = 16, p = 100, b = 4096, y = 15, C = 10, M = 1e3, L = 16;
      function P(D, v) {
        if (D._removeMirroring)
          throw new Error("Context is already forwarding operations.");
        D.__originalSave = D.save, D.__originalRestore = D.restore, D.__originalRotate = D.rotate, D.__originalScale = D.scale, D.__originalTranslate = D.translate, D.__originalTransform = D.transform, D.__originalSetTransform = D.setTransform, D.__originalResetTransform = D.resetTransform, D.__originalClip = D.clip, D.__originalMoveTo = D.moveTo, D.__originalLineTo = D.lineTo, D.__originalBezierCurveTo = D.bezierCurveTo, D.__originalRect = D.rect, D.__originalClosePath = D.closePath, D.__originalBeginPath = D.beginPath, D._removeMirroring = () => {
          D.save = D.__originalSave, D.restore = D.__originalRestore, D.rotate = D.__originalRotate, D.scale = D.__originalScale, D.translate = D.__originalTranslate, D.transform = D.__originalTransform, D.setTransform = D.__originalSetTransform, D.resetTransform = D.__originalResetTransform, D.clip = D.__originalClip, D.moveTo = D.__originalMoveTo, D.lineTo = D.__originalLineTo, D.bezierCurveTo = D.__originalBezierCurveTo, D.rect = D.__originalRect, D.closePath = D.__originalClosePath, D.beginPath = D.__originalBeginPath, delete D._removeMirroring;
        }, D.save = function() {
          v.save(), this.__originalSave();
        }, D.restore = function() {
          v.restore(), this.__originalRestore();
        }, D.translate = function(E, _) {
          v.translate(E, _), this.__originalTranslate(E, _);
        }, D.scale = function(E, _) {
          v.scale(E, _), this.__originalScale(E, _);
        }, D.transform = function(E, _, x, F, I, B) {
          v.transform(E, _, x, F, I, B), this.__originalTransform(E, _, x, F, I, B);
        }, D.setTransform = function(E, _, x, F, I, B) {
          v.setTransform(E, _, x, F, I, B), this.__originalSetTransform(E, _, x, F, I, B);
        }, D.resetTransform = function() {
          v.resetTransform(), this.__originalResetTransform();
        }, D.rotate = function(E) {
          v.rotate(E), this.__originalRotate(E);
        }, D.clip = function(E) {
          v.clip(E), this.__originalClip(E);
        }, D.moveTo = function(S, E) {
          v.moveTo(S, E), this.__originalMoveTo(S, E);
        }, D.lineTo = function(S, E) {
          v.lineTo(S, E), this.__originalLineTo(S, E);
        }, D.bezierCurveTo = function(S, E, _, x, F, I) {
          v.bezierCurveTo(S, E, _, x, F, I), this.__originalBezierCurveTo(S, E, _, x, F, I);
        }, D.rect = function(S, E, _, x) {
          v.rect(S, E, _, x), this.__originalRect(S, E, _, x);
        }, D.closePath = function() {
          v.closePath(), this.__originalClosePath();
        }, D.beginPath = function() {
          v.beginPath(), this.__originalBeginPath();
        };
      }
      class O {
        constructor(v) {
          this.canvasFactory = v, this.cache = /* @__PURE__ */ Object.create(null);
        }
        getCanvas(v, S, E) {
          let _;
          return this.cache[v] !== void 0 ? (_ = this.cache[v], this.canvasFactory.reset(_, S, E)) : (_ = this.canvasFactory.create(S, E), this.cache[v] = _), _;
        }
        delete(v) {
          delete this.cache[v];
        }
        clear() {
          for (const v in this.cache) {
            const S = this.cache[v];
            this.canvasFactory.destroy(S), delete this.cache[v];
          }
        }
      }
      function q(D, v, S, E, _, x, F, I, B, H) {
        const [V, $, X, G, U, ee] = (0, r.getCurrentTransform)(D);
        if ($ === 0 && X === 0) {
          const ue = F * V + U, _e = Math.round(ue), ve = I * G + ee, be = Math.round(ve), xe = (F + B) * V + U, De = Math.abs(Math.round(xe) - _e) || 1, Oe = (I + H) * G + ee, Ve = Math.abs(Math.round(Oe) - be) || 1;
          return D.setTransform(Math.sign(V), 0, 0, Math.sign(G), _e, be), D.drawImage(v, S, E, _, x, 0, 0, De, Ve), D.setTransform(V, $, X, G, U, ee), [De, Ve];
        }
        if (V === 0 && G === 0) {
          const ue = I * X + U, _e = Math.round(ue), ve = F * $ + ee, be = Math.round(ve), xe = (I + H) * X + U, De = Math.abs(Math.round(xe) - _e) || 1, Oe = (F + B) * $ + ee, Ve = Math.abs(Math.round(Oe) - be) || 1;
          return D.setTransform(0, Math.sign($), Math.sign(X), 0, _e, be), D.drawImage(v, S, E, _, x, 0, 0, Ve, De), D.setTransform(V, $, X, G, U, ee), [Ve, De];
        }
        D.drawImage(v, S, E, _, x, F, I, B, H);
        const fe = Math.hypot(V, $), re = Math.hypot(X, G);
        return [fe * B, re * H];
      }
      function Y(D) {
        const {
          width: v,
          height: S
        } = D;
        if (v > M || S > M)
          return null;
        const E = 1e3, _ = new Uint8Array([0, 2, 4, 0, 1, 0, 5, 4, 8, 10, 0, 8, 0, 2, 1, 0]), x = v + 1;
        let F = new Uint8Array(x * (S + 1)), I, B, H;
        const V = v + 7 & -8;
        let $ = new Uint8Array(V * S), X = 0;
        for (const re of D.data) {
          let ue = 128;
          for (; ue > 0; )
            $[X++] = re & ue ? 0 : 255, ue >>= 1;
        }
        let G = 0;
        for (X = 0, $[X] !== 0 && (F[0] = 1, ++G), B = 1; B < v; B++)
          $[X] !== $[X + 1] && (F[B] = $[X] ? 2 : 1, ++G), X++;
        for ($[X] !== 0 && (F[B] = 2, ++G), I = 1; I < S; I++) {
          X = I * V, H = I * x, $[X - V] !== $[X] && (F[H] = $[X] ? 1 : 8, ++G);
          let re = ($[X] ? 4 : 0) + ($[X - V] ? 8 : 0);
          for (B = 1; B < v; B++)
            re = (re >> 2) + ($[X + 1] ? 4 : 0) + ($[X - V + 1] ? 8 : 0), _[re] && (F[H + B] = _[re], ++G), X++;
          if ($[X - V] !== $[X] && (F[H + B] = $[X] ? 2 : 4, ++G), G > E)
            return null;
        }
        for (X = V * (S - 1), H = I * x, $[X] !== 0 && (F[H] = 8, ++G), B = 1; B < v; B++)
          $[X] !== $[X + 1] && (F[H + B] = $[X] ? 4 : 8, ++G), X++;
        if ($[X] !== 0 && (F[H + B] = 4, ++G), G > E)
          return null;
        const U = new Int32Array([0, x, -1, 0, -x, 0, 0, 0, 1]), ee = new Path2D();
        for (I = 0; G && I <= S; I++) {
          let re = I * x;
          const ue = re + v;
          for (; re < ue && !F[re]; )
            re++;
          if (re === ue)
            continue;
          ee.moveTo(re % x, I);
          const _e = re;
          let ve = F[re];
          do {
            const be = U[ve];
            do
              re += be;
            while (!F[re]);
            const xe = F[re];
            xe !== 5 && xe !== 10 ? (ve = xe, F[re] = 0) : (ve = xe & 51 * ve >> 4, F[re] &= ve >> 2 | ve << 2), ee.lineTo(re % x, re / x | 0), F[re] || --G;
          } while (_e !== re);
          --I;
        }
        return $ = null, F = null, function(re) {
          re.save(), re.scale(1 / v, -1 / S), re.translate(0, -S), re.fill(ee), re.beginPath(), re.restore();
        };
      }
      class se {
        constructor(v, S) {
          this.alphaIsShape = !1, this.fontSize = 0, this.fontSizeScale = 1, this.textMatrix = n.IDENTITY_MATRIX, this.textMatrixScale = 1, this.fontMatrix = n.FONT_IDENTITY_MATRIX, this.leading = 0, this.x = 0, this.y = 0, this.lineX = 0, this.lineY = 0, this.charSpacing = 0, this.wordSpacing = 0, this.textHScale = 1, this.textRenderingMode = n.TextRenderingMode.FILL, this.textRise = 0, this.fillColor = "#000000", this.strokeColor = "#000000", this.patternFill = !1, this.fillAlpha = 1, this.strokeAlpha = 1, this.lineWidth = 1, this.activeSMask = null, this.transferMaps = "none", this.startNewPathAndClipBox([0, 0, v, S]);
        }
        clone() {
          const v = Object.create(this);
          return v.clipBox = this.clipBox.slice(), v;
        }
        setCurrentPoint(v, S) {
          this.x = v, this.y = S;
        }
        updatePathMinMax(v, S, E) {
          [S, E] = n.Util.applyTransform([S, E], v), this.minX = Math.min(this.minX, S), this.minY = Math.min(this.minY, E), this.maxX = Math.max(this.maxX, S), this.maxY = Math.max(this.maxY, E);
        }
        updateRectMinMax(v, S) {
          const E = n.Util.applyTransform(S, v), _ = n.Util.applyTransform(S.slice(2), v), x = n.Util.applyTransform([S[0], S[3]], v), F = n.Util.applyTransform([S[2], S[1]], v);
          this.minX = Math.min(this.minX, E[0], _[0], x[0], F[0]), this.minY = Math.min(this.minY, E[1], _[1], x[1], F[1]), this.maxX = Math.max(this.maxX, E[0], _[0], x[0], F[0]), this.maxY = Math.max(this.maxY, E[1], _[1], x[1], F[1]);
        }
        updateScalingPathMinMax(v, S) {
          n.Util.scaleMinMax(v, S), this.minX = Math.min(this.minX, S[0]), this.minY = Math.min(this.minY, S[1]), this.maxX = Math.max(this.maxX, S[2]), this.maxY = Math.max(this.maxY, S[3]);
        }
        updateCurvePathMinMax(v, S, E, _, x, F, I, B, H, V) {
          const $ = n.Util.bezierBoundingBox(S, E, _, x, F, I, B, H, V);
          V || this.updateRectMinMax(v, $);
        }
        getPathBoundingBox(v = s.FILL, S = null) {
          const E = [this.minX, this.minY, this.maxX, this.maxY];
          if (v === s.STROKE) {
            S || (0, n.unreachable)("Stroke bounding box must include transform.");
            const _ = n.Util.singularValueDecompose2dScale(S), x = _[0] * this.lineWidth / 2, F = _[1] * this.lineWidth / 2;
            E[0] -= x, E[1] -= F, E[2] += x, E[3] += F;
          }
          return E;
        }
        updateClipFromPath() {
          const v = n.Util.intersect(this.clipBox, this.getPathBoundingBox());
          this.startNewPathAndClipBox(v || [0, 0, 0, 0]);
        }
        isEmptyClip() {
          return this.minX === 1 / 0;
        }
        startNewPathAndClipBox(v) {
          this.clipBox = v, this.minX = 1 / 0, this.minY = 1 / 0, this.maxX = 0, this.maxY = 0;
        }
        getClippedPathBoundingBox(v = s.FILL, S = null) {
          return n.Util.intersect(this.clipBox, this.getPathBoundingBox(v, S));
        }
      }
      function me(D, v) {
        if (typeof ImageData < "u" && v instanceof ImageData) {
          D.putImageData(v, 0, 0);
          return;
        }
        const S = v.height, E = v.width, _ = S % L, x = (S - _) / L, F = _ === 0 ? x : x + 1, I = D.createImageData(E, L);
        let B = 0, H;
        const V = v.data, $ = I.data;
        let X, G, U, ee;
        if (v.kind === n.ImageKind.GRAYSCALE_1BPP) {
          const fe = V.byteLength, re = new Uint32Array($.buffer, 0, $.byteLength >> 2), ue = re.length, _e = E + 7 >> 3, ve = 4294967295, be = n.FeatureTest.isLittleEndian ? 4278190080 : 255;
          for (X = 0; X < F; X++) {
            for (U = X < x ? L : _, H = 0, G = 0; G < U; G++) {
              const xe = fe - B;
              let De = 0;
              const Oe = xe > _e ? E : xe * 8 - 7, Ve = Oe & -8;
              let Ge = 0, He = 0;
              for (; De < Ve; De += 8)
                He = V[B++], re[H++] = He & 128 ? ve : be, re[H++] = He & 64 ? ve : be, re[H++] = He & 32 ? ve : be, re[H++] = He & 16 ? ve : be, re[H++] = He & 8 ? ve : be, re[H++] = He & 4 ? ve : be, re[H++] = He & 2 ? ve : be, re[H++] = He & 1 ? ve : be;
              for (; De < Oe; De++)
                Ge === 0 && (He = V[B++], Ge = 128), re[H++] = He & Ge ? ve : be, Ge >>= 1;
            }
            for (; H < ue; )
              re[H++] = 0;
            D.putImageData(I, 0, X * L);
          }
        } else if (v.kind === n.ImageKind.RGBA_32BPP) {
          for (G = 0, ee = E * L * 4, X = 0; X < x; X++)
            $.set(V.subarray(B, B + ee)), B += ee, D.putImageData(I, 0, G), G += L;
          X < F && (ee = E * _ * 4, $.set(V.subarray(B, B + ee)), D.putImageData(I, 0, G));
        } else if (v.kind === n.ImageKind.RGB_24BPP)
          for (U = L, ee = E * U, X = 0; X < F; X++) {
            for (X >= x && (U = _, ee = E * U), H = 0, G = ee; G--; )
              $[H++] = V[B++], $[H++] = V[B++], $[H++] = V[B++], $[H++] = 255;
            D.putImageData(I, 0, X * L);
          }
        else
          throw new Error(`bad image kind: ${v.kind}`);
      }
      function te(D, v) {
        if (v.bitmap) {
          D.drawImage(v.bitmap, 0, 0);
          return;
        }
        const S = v.height, E = v.width, _ = S % L, x = (S - _) / L, F = _ === 0 ? x : x + 1, I = D.createImageData(E, L);
        let B = 0;
        const H = v.data, V = I.data;
        for (let $ = 0; $ < F; $++) {
          const X = $ < x ? L : _;
          ({
            srcPos: B
          } = k({
            src: H,
            srcPos: B,
            dest: V,
            width: E,
            height: X,
            nonBlackColor: 0
          })), D.putImageData(I, 0, $ * L);
        }
      }
      function K(D, v) {
        const S = ["strokeStyle", "fillStyle", "fillRule", "globalAlpha", "lineWidth", "lineCap", "lineJoin", "miterLimit", "globalCompositeOperation", "font", "filter"];
        for (const E of S)
          D[E] !== void 0 && (v[E] = D[E]);
        D.setLineDash !== void 0 && (v.setLineDash(D.getLineDash()), v.lineDashOffset = D.lineDashOffset);
      }
      function Z(D) {
        if (D.strokeStyle = D.fillStyle = "#000000", D.fillRule = "nonzero", D.globalAlpha = 1, D.lineWidth = 1, D.lineCap = "butt", D.lineJoin = "miter", D.miterLimit = 10, D.globalCompositeOperation = "source-over", D.font = "10px sans-serif", D.setLineDash !== void 0 && (D.setLineDash([]), D.lineDashOffset = 0), !n.isNodeJS) {
          const {
            filter: v
          } = D;
          v !== "none" && v !== "" && (D.filter = "none");
        }
      }
      function oe(D, v, S, E) {
        const _ = D.length;
        for (let x = 3; x < _; x += 4) {
          const F = D[x];
          if (F === 0)
            D[x - 3] = v, D[x - 2] = S, D[x - 1] = E;
          else if (F < 255) {
            const I = 255 - F;
            D[x - 3] = D[x - 3] * F + v * I >> 8, D[x - 2] = D[x - 2] * F + S * I >> 8, D[x - 1] = D[x - 1] * F + E * I >> 8;
          }
        }
      }
      function le(D, v, S) {
        const E = D.length, _ = 1 / 255;
        for (let x = 3; x < E; x += 4) {
          const F = S ? S[D[x]] : D[x];
          v[x] = v[x] * F * _ | 0;
        }
      }
      function ie(D, v, S) {
        const E = D.length;
        for (let _ = 3; _ < E; _ += 4) {
          const x = D[_ - 3] * 77 + D[_ - 2] * 152 + D[_ - 1] * 28;
          v[_] = S ? v[_] * S[x >> 8] >> 8 : v[_] * x >> 16;
        }
      }
      function pe(D, v, S, E, _, x, F, I, B, H, V) {
        const $ = !!x, X = $ ? x[0] : 0, G = $ ? x[1] : 0, U = $ ? x[2] : 0, ee = _ === "Luminosity" ? ie : le, re = Math.min(E, Math.ceil(1048576 / S));
        for (let ue = 0; ue < E; ue += re) {
          const _e = Math.min(re, E - ue), ve = D.getImageData(I - H, ue + (B - V), S, _e), be = v.getImageData(I, ue + B, S, _e);
          $ && oe(ve.data, X, G, U), ee(ve.data, be.data, F), v.putImageData(be, I, ue + B);
        }
      }
      function he(D, v, S, E) {
        const _ = E[0], x = E[1], F = E[2] - _, I = E[3] - x;
        F === 0 || I === 0 || (pe(v.context, S, F, I, v.subtype, v.backdrop, v.transferMap, _, x, v.offsetX, v.offsetY), D.save(), D.globalAlpha = 1, D.globalCompositeOperation = "source-over", D.setTransform(1, 0, 0, 1, 0, 0), D.drawImage(S.canvas, 0, 0), D.restore());
      }
      function we(D, v) {
        if (v)
          return !0;
        const S = n.Util.singularValueDecompose2dScale(D);
        S[0] = Math.fround(S[0]), S[1] = Math.fround(S[1]);
        const E = Math.fround((globalThis.devicePixelRatio || 1) * r.PixelsPerInch.PDF_TO_CSS_UNITS);
        return S[0] <= E && S[1] <= E;
      }
      const ke = ["butt", "round", "square"], Ae = ["miter", "round", "bevel"], ae = {}, de = {};
      class R {
        constructor(v, S, E, _, x, {
          optionalContentConfig: F,
          markedContentStack: I = null
        }, B, H) {
          this.ctx = v, this.current = new se(this.ctx.canvas.width, this.ctx.canvas.height), this.stateStack = [], this.pendingClip = null, this.pendingEOFill = !1, this.res = null, this.xobjs = null, this.commonObjs = S, this.objs = E, this.canvasFactory = _, this.filterFactory = x, this.groupStack = [], this.processingType3 = null, this.baseTransform = null, this.baseTransformStack = [], this.groupLevel = 0, this.smaskStack = [], this.smaskCounter = 0, this.tempSMask = null, this.suspendedCtx = null, this.contentVisible = !0, this.markedContentStack = I || [], this.optionalContentConfig = F, this.cachedCanvases = new O(this.canvasFactory), this.cachedPatterns = /* @__PURE__ */ new Map(), this.annotationCanvasMap = B, this.viewportScale = 1, this.outputScaleX = 1, this.outputScaleY = 1, this.pageColors = H, this._cachedScaleForStroking = [-1, 0], this._cachedGetSinglePixelWidth = null, this._cachedBitmapsMap = /* @__PURE__ */ new Map();
        }
        getObject(v, S = null) {
          return typeof v == "string" ? v.startsWith("g_") ? this.commonObjs.get(v) : this.objs.get(v) : S;
        }
        beginDrawing({
          transform: v,
          viewport: S,
          transparency: E = !1,
          background: _ = null
        }) {
          const x = this.ctx.canvas.width, F = this.ctx.canvas.height, I = this.ctx.fillStyle;
          if (this.ctx.fillStyle = _ || "#ffffff", this.ctx.fillRect(0, 0, x, F), this.ctx.fillStyle = I, E) {
            const B = this.cachedCanvases.getCanvas("transparent", x, F);
            this.compositeCtx = this.ctx, this.transparentCanvas = B.canvas, this.ctx = B.context, this.ctx.save(), this.ctx.transform(...(0, r.getCurrentTransform)(this.compositeCtx));
          }
          this.ctx.save(), Z(this.ctx), v && (this.ctx.transform(...v), this.outputScaleX = v[0], this.outputScaleY = v[0]), this.ctx.transform(...S.transform), this.viewportScale = S.scale, this.baseTransform = (0, r.getCurrentTransform)(this.ctx);
        }
        executeOperatorList(v, S, E, _) {
          const x = v.argsArray, F = v.fnArray;
          let I = S || 0;
          const B = x.length;
          if (B === I)
            return I;
          const H = B - I > C && typeof E == "function", V = H ? Date.now() + y : 0;
          let $ = 0;
          const X = this.commonObjs, G = this.objs;
          let U;
          for (; ; ) {
            if (_ !== void 0 && I === _.nextBreakPoint)
              return _.breakIt(I, E), I;
            if (U = F[I], U !== n.OPS.dependency)
              this[U].apply(this, x[I]);
            else
              for (const ee of x[I]) {
                const fe = ee.startsWith("g_") ? X : G;
                if (!fe.has(ee))
                  return fe.get(ee, E), I;
              }
            if (I++, I === B)
              return I;
            if (H && ++$ > C) {
              if (Date.now() > V)
                return E(), I;
              $ = 0;
            }
          }
        }
        #e() {
          for (; this.stateStack.length || this.inSMaskMode; )
            this.restore();
          this.ctx.restore(), this.transparentCanvas && (this.ctx = this.compositeCtx, this.ctx.save(), this.ctx.setTransform(1, 0, 0, 1, 0, 0), this.ctx.drawImage(this.transparentCanvas, 0, 0), this.ctx.restore(), this.transparentCanvas = null);
        }
        endDrawing() {
          this.#e(), this.cachedCanvases.clear(), this.cachedPatterns.clear();
          for (const v of this._cachedBitmapsMap.values()) {
            for (const S of v.values())
              typeof HTMLCanvasElement < "u" && S instanceof HTMLCanvasElement && (S.width = S.height = 0);
            v.clear();
          }
          this._cachedBitmapsMap.clear(), this.#t();
        }
        #t() {
          if (this.pageColors) {
            const v = this.filterFactory.addHCMFilter(this.pageColors.foreground, this.pageColors.background);
            if (v !== "none") {
              const S = this.ctx.filter;
              this.ctx.filter = v, this.ctx.drawImage(this.ctx.canvas, 0, 0), this.ctx.filter = S;
            }
          }
        }
        _scaleImage(v, S) {
          const E = v.width, _ = v.height;
          let x = Math.max(Math.hypot(S[0], S[1]), 1), F = Math.max(Math.hypot(S[2], S[3]), 1), I = E, B = _, H = "prescale1", V, $;
          for (; x > 2 && I > 1 || F > 2 && B > 1; ) {
            let X = I, G = B;
            x > 2 && I > 1 && (X = I >= 16384 ? Math.floor(I / 2) - 1 || 1 : Math.ceil(I / 2), x /= I / X), F > 2 && B > 1 && (G = B >= 16384 ? Math.floor(B / 2) - 1 || 1 : Math.ceil(B) / 2, F /= B / G), V = this.cachedCanvases.getCanvas(H, X, G), $ = V.context, $.clearRect(0, 0, X, G), $.drawImage(v, 0, 0, I, B, 0, 0, X, G), v = V.canvas, I = X, B = G, H = H === "prescale1" ? "prescale2" : "prescale1";
          }
          return {
            img: v,
            paintWidth: I,
            paintHeight: B
          };
        }
        _createMaskCanvas(v) {
          const S = this.ctx, {
            width: E,
            height: _
          } = v, x = this.current.fillColor, F = this.current.patternFill, I = (0, r.getCurrentTransform)(S);
          let B, H, V, $;
          if ((v.bitmap || v.data) && v.count > 1) {
            const Oe = v.bitmap || v.data.buffer;
            H = JSON.stringify(F ? I : [I.slice(0, 4), x]), B = this._cachedBitmapsMap.get(Oe), B || (B = /* @__PURE__ */ new Map(), this._cachedBitmapsMap.set(Oe, B));
            const Ve = B.get(H);
            if (Ve && !F) {
              const Ge = Math.round(Math.min(I[0], I[2]) + I[4]), He = Math.round(Math.min(I[1], I[3]) + I[5]);
              return {
                canvas: Ve,
                offsetX: Ge,
                offsetY: He
              };
            }
            V = Ve;
          }
          V || ($ = this.cachedCanvases.getCanvas("maskCanvas", E, _), te($.context, v));
          let X = n.Util.transform(I, [1 / E, 0, 0, -1 / _, 0, 0]);
          X = n.Util.transform(X, [1, 0, 0, 1, 0, -_]);
          const [G, U, ee, fe] = n.Util.getAxialAlignedBoundingBox([0, 0, E, _], X), re = Math.round(ee - G) || 1, ue = Math.round(fe - U) || 1, _e = this.cachedCanvases.getCanvas("fillCanvas", re, ue), ve = _e.context, be = G, xe = U;
          ve.translate(-be, -xe), ve.transform(...X), V || (V = this._scaleImage($.canvas, (0, r.getCurrentTransformInverse)(ve)), V = V.img, B && F && B.set(H, V)), ve.imageSmoothingEnabled = we((0, r.getCurrentTransform)(ve), v.interpolate), q(ve, V, 0, 0, V.width, V.height, 0, 0, E, _), ve.globalCompositeOperation = "source-in";
          const De = n.Util.transform((0, r.getCurrentTransformInverse)(ve), [1, 0, 0, 1, -be, -xe]);
          return ve.fillStyle = F ? x.getPattern(S, this, De, s.FILL) : x, ve.fillRect(0, 0, E, _), B && !F && (this.cachedCanvases.delete("fillCanvas"), B.set(H, _e.canvas)), {
            canvas: _e.canvas,
            offsetX: Math.round(be),
            offsetY: Math.round(xe)
          };
        }
        setLineWidth(v) {
          v !== this.current.lineWidth && (this._cachedScaleForStroking[0] = -1), this.current.lineWidth = v, this.ctx.lineWidth = v;
        }
        setLineCap(v) {
          this.ctx.lineCap = ke[v];
        }
        setLineJoin(v) {
          this.ctx.lineJoin = Ae[v];
        }
        setMiterLimit(v) {
          this.ctx.miterLimit = v;
        }
        setDash(v, S) {
          const E = this.ctx;
          E.setLineDash !== void 0 && (E.setLineDash(v), E.lineDashOffset = S);
        }
        setRenderingIntent(v) {
        }
        setFlatness(v) {
        }
        setGState(v) {
          for (const [S, E] of v)
            switch (S) {
              case "LW":
                this.setLineWidth(E);
                break;
              case "LC":
                this.setLineCap(E);
                break;
              case "LJ":
                this.setLineJoin(E);
                break;
              case "ML":
                this.setMiterLimit(E);
                break;
              case "D":
                this.setDash(E[0], E[1]);
                break;
              case "RI":
                this.setRenderingIntent(E);
                break;
              case "FL":
                this.setFlatness(E);
                break;
              case "Font":
                this.setFont(E[0], E[1]);
                break;
              case "CA":
                this.current.strokeAlpha = E;
                break;
              case "ca":
                this.current.fillAlpha = E, this.ctx.globalAlpha = E;
                break;
              case "BM":
                this.ctx.globalCompositeOperation = E;
                break;
              case "SMask":
                this.current.activeSMask = E ? this.tempSMask : null, this.tempSMask = null, this.checkSMaskState();
                break;
              case "TR":
                this.ctx.filter = this.current.transferMaps = this.filterFactory.addFilter(E);
                break;
            }
        }
        get inSMaskMode() {
          return !!this.suspendedCtx;
        }
        checkSMaskState() {
          const v = this.inSMaskMode;
          this.current.activeSMask && !v ? this.beginSMaskMode() : !this.current.activeSMask && v && this.endSMaskMode();
        }
        beginSMaskMode() {
          if (this.inSMaskMode)
            throw new Error("beginSMaskMode called while already in smask mode");
          const v = this.ctx.canvas.width, S = this.ctx.canvas.height, E = "smaskGroupAt" + this.groupLevel, _ = this.cachedCanvases.getCanvas(E, v, S);
          this.suspendedCtx = this.ctx, this.ctx = _.context;
          const x = this.ctx;
          x.setTransform(...(0, r.getCurrentTransform)(this.suspendedCtx)), K(this.suspendedCtx, x), P(x, this.suspendedCtx), this.setGState([["BM", "source-over"], ["ca", 1], ["CA", 1]]);
        }
        endSMaskMode() {
          if (!this.inSMaskMode)
            throw new Error("endSMaskMode called while not in smask mode");
          this.ctx._removeMirroring(), K(this.ctx, this.suspendedCtx), this.ctx = this.suspendedCtx, this.suspendedCtx = null;
        }
        compose(v) {
          if (!this.current.activeSMask)
            return;
          v ? (v[0] = Math.floor(v[0]), v[1] = Math.floor(v[1]), v[2] = Math.ceil(v[2]), v[3] = Math.ceil(v[3])) : v = [0, 0, this.ctx.canvas.width, this.ctx.canvas.height];
          const S = this.current.activeSMask, E = this.suspendedCtx;
          he(E, S, this.ctx, v), this.ctx.save(), this.ctx.setTransform(1, 0, 0, 1, 0, 0), this.ctx.clearRect(0, 0, this.ctx.canvas.width, this.ctx.canvas.height), this.ctx.restore();
        }
        save() {
          this.inSMaskMode ? (K(this.ctx, this.suspendedCtx), this.suspendedCtx.save()) : this.ctx.save();
          const v = this.current;
          this.stateStack.push(v), this.current = v.clone();
        }
        restore() {
          this.stateStack.length === 0 && this.inSMaskMode && this.endSMaskMode(), this.stateStack.length !== 0 && (this.current = this.stateStack.pop(), this.inSMaskMode ? (this.suspendedCtx.restore(), K(this.suspendedCtx, this.ctx)) : this.ctx.restore(), this.checkSMaskState(), this.pendingClip = null, this._cachedScaleForStroking[0] = -1, this._cachedGetSinglePixelWidth = null);
        }
        transform(v, S, E, _, x, F) {
          this.ctx.transform(v, S, E, _, x, F), this._cachedScaleForStroking[0] = -1, this._cachedGetSinglePixelWidth = null;
        }
        constructPath(v, S, E) {
          const _ = this.ctx, x = this.current;
          let F = x.x, I = x.y, B, H;
          const V = (0, r.getCurrentTransform)(_), $ = V[0] === 0 && V[3] === 0 || V[1] === 0 && V[2] === 0, X = $ ? E.slice(0) : null;
          for (let G = 0, U = 0, ee = v.length; G < ee; G++)
            switch (v[G] | 0) {
              case n.OPS.rectangle:
                F = S[U++], I = S[U++];
                const fe = S[U++], re = S[U++], ue = F + fe, _e = I + re;
                _.moveTo(F, I), fe === 0 || re === 0 ? _.lineTo(ue, _e) : (_.lineTo(ue, I), _.lineTo(ue, _e), _.lineTo(F, _e)), $ || x.updateRectMinMax(V, [F, I, ue, _e]), _.closePath();
                break;
              case n.OPS.moveTo:
                F = S[U++], I = S[U++], _.moveTo(F, I), $ || x.updatePathMinMax(V, F, I);
                break;
              case n.OPS.lineTo:
                F = S[U++], I = S[U++], _.lineTo(F, I), $ || x.updatePathMinMax(V, F, I);
                break;
              case n.OPS.curveTo:
                B = F, H = I, F = S[U + 4], I = S[U + 5], _.bezierCurveTo(S[U], S[U + 1], S[U + 2], S[U + 3], F, I), x.updateCurvePathMinMax(V, B, H, S[U], S[U + 1], S[U + 2], S[U + 3], F, I, X), U += 6;
                break;
              case n.OPS.curveTo2:
                B = F, H = I, _.bezierCurveTo(F, I, S[U], S[U + 1], S[U + 2], S[U + 3]), x.updateCurvePathMinMax(V, B, H, F, I, S[U], S[U + 1], S[U + 2], S[U + 3], X), F = S[U + 2], I = S[U + 3], U += 4;
                break;
              case n.OPS.curveTo3:
                B = F, H = I, F = S[U + 2], I = S[U + 3], _.bezierCurveTo(S[U], S[U + 1], F, I, F, I), x.updateCurvePathMinMax(V, B, H, S[U], S[U + 1], F, I, F, I, X), U += 4;
                break;
              case n.OPS.closePath:
                _.closePath();
                break;
            }
          $ && x.updateScalingPathMinMax(V, X), x.setCurrentPoint(F, I);
        }
        closePath() {
          this.ctx.closePath();
        }
        stroke(v = !0) {
          const S = this.ctx, E = this.current.strokeColor;
          S.globalAlpha = this.current.strokeAlpha, this.contentVisible && (typeof E == "object" && E?.getPattern ? (S.save(), S.strokeStyle = E.getPattern(S, this, (0, r.getCurrentTransformInverse)(S), s.STROKE), this.rescaleAndStroke(!1), S.restore()) : this.rescaleAndStroke(!0)), v && this.consumePath(this.current.getClippedPathBoundingBox()), S.globalAlpha = this.current.fillAlpha;
        }
        closeStroke() {
          this.closePath(), this.stroke();
        }
        fill(v = !0) {
          const S = this.ctx, E = this.current.fillColor, _ = this.current.patternFill;
          let x = !1;
          _ && (S.save(), S.fillStyle = E.getPattern(S, this, (0, r.getCurrentTransformInverse)(S), s.FILL), x = !0);
          const F = this.current.getClippedPathBoundingBox();
          this.contentVisible && F !== null && (this.pendingEOFill ? (S.fill("evenodd"), this.pendingEOFill = !1) : S.fill()), x && S.restore(), v && this.consumePath(F);
        }
        eoFill() {
          this.pendingEOFill = !0, this.fill();
        }
        fillStroke() {
          this.fill(!1), this.stroke(!1), this.consumePath();
        }
        eoFillStroke() {
          this.pendingEOFill = !0, this.fillStroke();
        }
        closeFillStroke() {
          this.closePath(), this.fillStroke();
        }
        closeEOFillStroke() {
          this.pendingEOFill = !0, this.closePath(), this.fillStroke();
        }
        endPath() {
          this.consumePath();
        }
        clip() {
          this.pendingClip = ae;
        }
        eoClip() {
          this.pendingClip = de;
        }
        beginText() {
          this.current.textMatrix = n.IDENTITY_MATRIX, this.current.textMatrixScale = 1, this.current.x = this.current.lineX = 0, this.current.y = this.current.lineY = 0;
        }
        endText() {
          const v = this.pendingTextPaths, S = this.ctx;
          if (v === void 0) {
            S.beginPath();
            return;
          }
          S.save(), S.beginPath();
          for (const E of v)
            S.setTransform(...E.transform), S.translate(E.x, E.y), E.addToPath(S, E.fontSize);
          S.restore(), S.clip(), S.beginPath(), delete this.pendingTextPaths;
        }
        setCharSpacing(v) {
          this.current.charSpacing = v;
        }
        setWordSpacing(v) {
          this.current.wordSpacing = v;
        }
        setHScale(v) {
          this.current.textHScale = v / 100;
        }
        setLeading(v) {
          this.current.leading = -v;
        }
        setFont(v, S) {
          const E = this.commonObjs.get(v), _ = this.current;
          if (!E)
            throw new Error(`Can't find font for ${v}`);
          if (_.fontMatrix = E.fontMatrix || n.FONT_IDENTITY_MATRIX, (_.fontMatrix[0] === 0 || _.fontMatrix[3] === 0) && (0, n.warn)("Invalid font matrix for font " + v), S < 0 ? (S = -S, _.fontDirection = -1) : _.fontDirection = 1, this.current.font = E, this.current.fontSize = S, E.isType3Font)
            return;
          const x = E.loadedName || "sans-serif", F = E.systemFontInfo?.css || `"${x}", ${E.fallbackName}`;
          let I = "normal";
          E.black ? I = "900" : E.bold && (I = "bold");
          const B = E.italic ? "italic" : "normal";
          let H = S;
          S < a ? H = a : S > p && (H = p), this.current.fontSizeScale = S / H, this.ctx.font = `${B} ${I} ${H}px ${F}`;
        }
        setTextRenderingMode(v) {
          this.current.textRenderingMode = v;
        }
        setTextRise(v) {
          this.current.textRise = v;
        }
        moveText(v, S) {
          this.current.x = this.current.lineX += v, this.current.y = this.current.lineY += S;
        }
        setLeadingMoveText(v, S) {
          this.setLeading(-S), this.moveText(v, S);
        }
        setTextMatrix(v, S, E, _, x, F) {
          this.current.textMatrix = [v, S, E, _, x, F], this.current.textMatrixScale = Math.hypot(v, S), this.current.x = this.current.lineX = 0, this.current.y = this.current.lineY = 0;
        }
        nextLine() {
          this.moveText(0, this.current.leading);
        }
        paintChar(v, S, E, _) {
          const x = this.ctx, F = this.current, I = F.font, B = F.textRenderingMode, H = F.fontSize / F.fontSizeScale, V = B & n.TextRenderingMode.FILL_STROKE_MASK, $ = !!(B & n.TextRenderingMode.ADD_TO_PATH_FLAG), X = F.patternFill && !I.missingFile;
          let G;
          (I.disableFontFace || $ || X) && (G = I.getPathGenerator(this.commonObjs, v)), I.disableFontFace || X ? (x.save(), x.translate(S, E), x.beginPath(), G(x, H), _ && x.setTransform(..._), (V === n.TextRenderingMode.FILL || V === n.TextRenderingMode.FILL_STROKE) && x.fill(), (V === n.TextRenderingMode.STROKE || V === n.TextRenderingMode.FILL_STROKE) && x.stroke(), x.restore()) : ((V === n.TextRenderingMode.FILL || V === n.TextRenderingMode.FILL_STROKE) && x.fillText(v, S, E), (V === n.TextRenderingMode.STROKE || V === n.TextRenderingMode.FILL_STROKE) && x.strokeText(v, S, E)), $ && (this.pendingTextPaths ||= []).push({
            transform: (0, r.getCurrentTransform)(x),
            x: S,
            y: E,
            fontSize: H,
            addToPath: G
          });
        }
        get isFontSubpixelAAEnabled() {
          const {
            context: v
          } = this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled", 10, 10);
          v.scale(1.5, 1), v.fillText("I", 0, 10);
          const S = v.getImageData(0, 0, 10, 10).data;
          let E = !1;
          for (let _ = 3; _ < S.length; _ += 4)
            if (S[_] > 0 && S[_] < 255) {
              E = !0;
              break;
            }
          return (0, n.shadow)(this, "isFontSubpixelAAEnabled", E);
        }
        showText(v) {
          const S = this.current, E = S.font;
          if (E.isType3Font)
            return this.showType3Text(v);
          const _ = S.fontSize;
          if (_ === 0)
            return;
          const x = this.ctx, F = S.fontSizeScale, I = S.charSpacing, B = S.wordSpacing, H = S.fontDirection, V = S.textHScale * H, $ = v.length, X = E.vertical, G = X ? 1 : -1, U = E.defaultVMetrics, ee = _ * S.fontMatrix[0], fe = S.textRenderingMode === n.TextRenderingMode.FILL && !E.disableFontFace && !S.patternFill;
          x.save(), x.transform(...S.textMatrix), x.translate(S.x, S.y + S.textRise), H > 0 ? x.scale(V, -1) : x.scale(V, 1);
          let re;
          if (S.patternFill) {
            x.save();
            const xe = S.fillColor.getPattern(x, this, (0, r.getCurrentTransformInverse)(x), s.FILL);
            re = (0, r.getCurrentTransform)(x), x.restore(), x.fillStyle = xe;
          }
          let ue = S.lineWidth;
          const _e = S.textMatrixScale;
          if (_e === 0 || ue === 0) {
            const xe = S.textRenderingMode & n.TextRenderingMode.FILL_STROKE_MASK;
            (xe === n.TextRenderingMode.STROKE || xe === n.TextRenderingMode.FILL_STROKE) && (ue = this.getSinglePixelWidth());
          } else
            ue /= _e;
          if (F !== 1 && (x.scale(F, F), ue /= F), x.lineWidth = ue, E.isInvalidPDFjsFont) {
            const xe = [];
            let De = 0;
            for (const Oe of v)
              xe.push(Oe.unicode), De += Oe.width;
            x.fillText(xe.join(""), 0, 0), S.x += De * ee * V, x.restore(), this.compose();
            return;
          }
          let ve = 0, be;
          for (be = 0; be < $; ++be) {
            const xe = v[be];
            if (typeof xe == "number") {
              ve += G * xe * _ / 1e3;
              continue;
            }
            let De = !1;
            const Oe = (xe.isSpace ? B : 0) + I, Ve = xe.fontChar, Ge = xe.accent;
            let He, Ct, ht = xe.width;
            if (X) {
              const Ze = xe.vmetric || U, bt = -(xe.vmetric ? Ze[1] : ht * 0.5) * ee, an = Ze[2] * ee;
              ht = Ze ? -Ze[0] : ht, He = bt / F, Ct = (ve + an) / F;
            } else
              He = ve / F, Ct = 0;
            if (E.remeasure && ht > 0) {
              const Ze = x.measureText(Ve).width * 1e3 / _ * F;
              if (ht < Ze && this.isFontSubpixelAAEnabled) {
                const bt = ht / Ze;
                De = !0, x.save(), x.scale(bt, 1), He /= bt;
              } else ht !== Ze && (He += (ht - Ze) / 2e3 * _ / F);
            }
            if (this.contentVisible && (xe.isInFont || E.missingFile)) {
              if (fe && !Ge)
                x.fillText(Ve, He, Ct);
              else if (this.paintChar(Ve, He, Ct, re), Ge) {
                const Ze = He + _ * Ge.offset.x / F, bt = Ct - _ * Ge.offset.y / F;
                this.paintChar(Ge.fontChar, Ze, bt, re);
              }
            }
            const Dt = X ? ht * ee - Oe * H : ht * ee + Oe * H;
            ve += Dt, De && x.restore();
          }
          X ? S.y -= ve : S.x += ve * V, x.restore(), this.compose();
        }
        showType3Text(v) {
          const S = this.ctx, E = this.current, _ = E.font, x = E.fontSize, F = E.fontDirection, I = _.vertical ? 1 : -1, B = E.charSpacing, H = E.wordSpacing, V = E.textHScale * F, $ = E.fontMatrix || n.FONT_IDENTITY_MATRIX, X = v.length, G = E.textRenderingMode === n.TextRenderingMode.INVISIBLE;
          let U, ee, fe, re;
          if (!(G || x === 0)) {
            for (this._cachedScaleForStroking[0] = -1, this._cachedGetSinglePixelWidth = null, S.save(), S.transform(...E.textMatrix), S.translate(E.x, E.y), S.scale(V, F), U = 0; U < X; ++U) {
              if (ee = v[U], typeof ee == "number") {
                re = I * ee * x / 1e3, this.ctx.translate(re, 0), E.x += re * V;
                continue;
              }
              const ue = (ee.isSpace ? H : 0) + B, _e = _.charProcOperatorList[ee.operatorListId];
              if (!_e) {
                (0, n.warn)(`Type3 character "${ee.operatorListId}" is not available.`);
                continue;
              }
              this.contentVisible && (this.processingType3 = ee, this.save(), S.scale(x, x), S.transform(...$), this.executeOperatorList(_e), this.restore()), fe = n.Util.applyTransform([ee.width, 0], $)[0] * x + ue, S.translate(fe, 0), E.x += fe * V;
            }
            S.restore(), this.processingType3 = null;
          }
        }
        setCharWidth(v, S) {
        }
        setCharWidthAndBounds(v, S, E, _, x, F) {
          this.ctx.rect(E, _, x - E, F - _), this.ctx.clip(), this.endPath();
        }
        getColorN_Pattern(v) {
          let S;
          if (v[0] === "TilingPattern") {
            const E = v[1], _ = this.baseTransform || (0, r.getCurrentTransform)(this.ctx), x = {
              createCanvasGraphics: (F) => new R(F, this.commonObjs, this.objs, this.canvasFactory, this.filterFactory, {
                optionalContentConfig: this.optionalContentConfig,
                markedContentStack: this.markedContentStack
              })
            };
            S = new m(v, E, this.ctx, x, _);
          } else
            S = this._getPattern(v[1], v[2]);
          return S;
        }
        setStrokeColorN() {
          this.current.strokeColor = this.getColorN_Pattern(arguments);
        }
        setFillColorN() {
          this.current.fillColor = this.getColorN_Pattern(arguments), this.current.patternFill = !0;
        }
        setStrokeRGBColor(v, S, E) {
          const _ = n.Util.makeHexColor(v, S, E);
          this.ctx.strokeStyle = _, this.current.strokeColor = _;
        }
        setFillRGBColor(v, S, E) {
          const _ = n.Util.makeHexColor(v, S, E);
          this.ctx.fillStyle = _, this.current.fillColor = _, this.current.patternFill = !1;
        }
        _getPattern(v, S = null) {
          let E;
          return this.cachedPatterns.has(v) ? E = this.cachedPatterns.get(v) : (E = g(this.getObject(v)), this.cachedPatterns.set(v, E)), S && (E.matrix = S), E;
        }
        shadingFill(v) {
          if (!this.contentVisible)
            return;
          const S = this.ctx;
          this.save();
          const E = this._getPattern(v);
          S.fillStyle = E.getPattern(S, this, (0, r.getCurrentTransformInverse)(S), s.SHADING);
          const _ = (0, r.getCurrentTransformInverse)(S);
          if (_) {
            const {
              width: x,
              height: F
            } = S.canvas, [I, B, H, V] = n.Util.getAxialAlignedBoundingBox([0, 0, x, F], _);
            this.ctx.fillRect(I, B, H - I, V - B);
          } else
            this.ctx.fillRect(-1e10, -1e10, 2e10, 2e10);
          this.compose(this.current.getClippedPathBoundingBox()), this.restore();
        }
        beginInlineImage() {
          (0, n.unreachable)("Should not call beginInlineImage");
        }
        beginImageData() {
          (0, n.unreachable)("Should not call beginImageData");
        }
        paintFormXObjectBegin(v, S) {
          if (this.contentVisible && (this.save(), this.baseTransformStack.push(this.baseTransform), Array.isArray(v) && v.length === 6 && this.transform(...v), this.baseTransform = (0, r.getCurrentTransform)(this.ctx), S)) {
            const E = S[2] - S[0], _ = S[3] - S[1];
            this.ctx.rect(S[0], S[1], E, _), this.current.updateRectMinMax((0, r.getCurrentTransform)(this.ctx), S), this.clip(), this.endPath();
          }
        }
        paintFormXObjectEnd() {
          this.contentVisible && (this.restore(), this.baseTransform = this.baseTransformStack.pop());
        }
        beginGroup(v) {
          if (!this.contentVisible)
            return;
          this.save(), this.inSMaskMode && (this.endSMaskMode(), this.current.activeSMask = null);
          const S = this.ctx;
          v.isolated || (0, n.info)("TODO: Support non-isolated groups."), v.knockout && (0, n.warn)("Knockout groups not supported.");
          const E = (0, r.getCurrentTransform)(S);
          if (v.matrix && S.transform(...v.matrix), !v.bbox)
            throw new Error("Bounding box is required.");
          let _ = n.Util.getAxialAlignedBoundingBox(v.bbox, (0, r.getCurrentTransform)(S));
          const x = [0, 0, S.canvas.width, S.canvas.height];
          _ = n.Util.intersect(_, x) || [0, 0, 0, 0];
          const F = Math.floor(_[0]), I = Math.floor(_[1]);
          let B = Math.max(Math.ceil(_[2]) - F, 1), H = Math.max(Math.ceil(_[3]) - I, 1), V = 1, $ = 1;
          B > b && (V = B / b, B = b), H > b && ($ = H / b, H = b), this.current.startNewPathAndClipBox([0, 0, B, H]);
          let X = "groupAt" + this.groupLevel;
          v.smask && (X += "_smask_" + this.smaskCounter++ % 2);
          const G = this.cachedCanvases.getCanvas(X, B, H), U = G.context;
          U.scale(1 / V, 1 / $), U.translate(-F, -I), U.transform(...E), v.smask ? this.smaskStack.push({
            canvas: G.canvas,
            context: U,
            offsetX: F,
            offsetY: I,
            scaleX: V,
            scaleY: $,
            subtype: v.smask.subtype,
            backdrop: v.smask.backdrop,
            transferMap: v.smask.transferMap || null,
            startTransformInverse: null
          }) : (S.setTransform(1, 0, 0, 1, 0, 0), S.translate(F, I), S.scale(V, $), S.save()), K(S, U), this.ctx = U, this.setGState([["BM", "source-over"], ["ca", 1], ["CA", 1]]), this.groupStack.push(S), this.groupLevel++;
        }
        endGroup(v) {
          if (!this.contentVisible)
            return;
          this.groupLevel--;
          const S = this.ctx, E = this.groupStack.pop();
          if (this.ctx = E, this.ctx.imageSmoothingEnabled = !1, v.smask)
            this.tempSMask = this.smaskStack.pop(), this.restore();
          else {
            this.ctx.restore();
            const _ = (0, r.getCurrentTransform)(this.ctx);
            this.restore(), this.ctx.save(), this.ctx.setTransform(..._);
            const x = n.Util.getAxialAlignedBoundingBox([0, 0, S.canvas.width, S.canvas.height], _);
            this.ctx.drawImage(S.canvas, 0, 0), this.ctx.restore(), this.compose(x);
          }
        }
        beginAnnotation(v, S, E, _, x) {
          if (this.#e(), Z(this.ctx), this.ctx.save(), this.save(), this.baseTransform && this.ctx.setTransform(...this.baseTransform), Array.isArray(S) && S.length === 4) {
            const F = S[2] - S[0], I = S[3] - S[1];
            if (x && this.annotationCanvasMap) {
              E = E.slice(), E[4] -= S[0], E[5] -= S[1], S = S.slice(), S[0] = S[1] = 0, S[2] = F, S[3] = I;
              const [B, H] = n.Util.singularValueDecompose2dScale((0, r.getCurrentTransform)(this.ctx)), {
                viewportScale: V
              } = this, $ = Math.ceil(F * this.outputScaleX * V), X = Math.ceil(I * this.outputScaleY * V);
              this.annotationCanvas = this.canvasFactory.create($, X);
              const {
                canvas: G,
                context: U
              } = this.annotationCanvas;
              this.annotationCanvasMap.set(v, G), this.annotationCanvas.savedCtx = this.ctx, this.ctx = U, this.ctx.save(), this.ctx.setTransform(B, 0, 0, -H, 0, I * H), Z(this.ctx);
            } else
              Z(this.ctx), this.ctx.rect(S[0], S[1], F, I), this.ctx.clip(), this.endPath();
          }
          this.current = new se(this.ctx.canvas.width, this.ctx.canvas.height), this.transform(...E), this.transform(..._);
        }
        endAnnotation() {
          this.annotationCanvas && (this.ctx.restore(), this.#t(), this.ctx = this.annotationCanvas.savedCtx, delete this.annotationCanvas.savedCtx, delete this.annotationCanvas);
        }
        paintImageMaskXObject(v) {
          if (!this.contentVisible)
            return;
          const S = v.count;
          v = this.getObject(v.data, v), v.count = S;
          const E = this.ctx, _ = this.processingType3;
          if (_ && (_.compiled === void 0 && (_.compiled = Y(v)), _.compiled)) {
            _.compiled(E);
            return;
          }
          const x = this._createMaskCanvas(v), F = x.canvas;
          E.save(), E.setTransform(1, 0, 0, 1, 0, 0), E.drawImage(F, x.offsetX, x.offsetY), E.restore(), this.compose();
        }
        paintImageMaskXObjectRepeat(v, S, E = 0, _ = 0, x, F) {
          if (!this.contentVisible)
            return;
          v = this.getObject(v.data, v);
          const I = this.ctx;
          I.save();
          const B = (0, r.getCurrentTransform)(I);
          I.transform(S, E, _, x, 0, 0);
          const H = this._createMaskCanvas(v);
          I.setTransform(1, 0, 0, 1, H.offsetX - B[4], H.offsetY - B[5]);
          for (let V = 0, $ = F.length; V < $; V += 2) {
            const X = n.Util.transform(B, [S, E, _, x, F[V], F[V + 1]]), [G, U] = n.Util.applyTransform([0, 0], X);
            I.drawImage(H.canvas, G, U);
          }
          I.restore(), this.compose();
        }
        paintImageMaskXObjectGroup(v) {
          if (!this.contentVisible)
            return;
          const S = this.ctx, E = this.current.fillColor, _ = this.current.patternFill;
          for (const x of v) {
            const {
              data: F,
              width: I,
              height: B,
              transform: H
            } = x, V = this.cachedCanvases.getCanvas("maskCanvas", I, B), $ = V.context;
            $.save();
            const X = this.getObject(F, x);
            te($, X), $.globalCompositeOperation = "source-in", $.fillStyle = _ ? E.getPattern($, this, (0, r.getCurrentTransformInverse)(S), s.FILL) : E, $.fillRect(0, 0, I, B), $.restore(), S.save(), S.transform(...H), S.scale(1, -1), q(S, V.canvas, 0, 0, I, B, 0, -1, 1, 1), S.restore();
          }
          this.compose();
        }
        paintImageXObject(v) {
          if (!this.contentVisible)
            return;
          const S = this.getObject(v);
          if (!S) {
            (0, n.warn)("Dependent image isn't ready yet");
            return;
          }
          this.paintInlineImageXObject(S);
        }
        paintImageXObjectRepeat(v, S, E, _) {
          if (!this.contentVisible)
            return;
          const x = this.getObject(v);
          if (!x) {
            (0, n.warn)("Dependent image isn't ready yet");
            return;
          }
          const F = x.width, I = x.height, B = [];
          for (let H = 0, V = _.length; H < V; H += 2)
            B.push({
              transform: [S, 0, 0, E, _[H], _[H + 1]],
              x: 0,
              y: 0,
              w: F,
              h: I
            });
          this.paintInlineImageXObjectGroup(x, B);
        }
        applyTransferMapsToCanvas(v) {
          return this.current.transferMaps !== "none" && (v.filter = this.current.transferMaps, v.drawImage(v.canvas, 0, 0), v.filter = "none"), v.canvas;
        }
        applyTransferMapsToBitmap(v) {
          if (this.current.transferMaps === "none")
            return v.bitmap;
          const {
            bitmap: S,
            width: E,
            height: _
          } = v, x = this.cachedCanvases.getCanvas("inlineImage", E, _), F = x.context;
          return F.filter = this.current.transferMaps, F.drawImage(S, 0, 0), F.filter = "none", x.canvas;
        }
        paintInlineImageXObject(v) {
          if (!this.contentVisible)
            return;
          const S = v.width, E = v.height, _ = this.ctx;
          if (this.save(), !n.isNodeJS) {
            const {
              filter: I
            } = _;
            I !== "none" && I !== "" && (_.filter = "none");
          }
          _.scale(1 / S, -1 / E);
          let x;
          if (v.bitmap)
            x = this.applyTransferMapsToBitmap(v);
          else if (typeof HTMLElement == "function" && v instanceof HTMLElement || !v.data)
            x = v;
          else {
            const B = this.cachedCanvases.getCanvas("inlineImage", S, E).context;
            me(B, v), x = this.applyTransferMapsToCanvas(B);
          }
          const F = this._scaleImage(x, (0, r.getCurrentTransformInverse)(_));
          _.imageSmoothingEnabled = we((0, r.getCurrentTransform)(_), v.interpolate), q(_, F.img, 0, 0, F.paintWidth, F.paintHeight, 0, -E, S, E), this.compose(), this.restore();
        }
        paintInlineImageXObjectGroup(v, S) {
          if (!this.contentVisible)
            return;
          const E = this.ctx;
          let _;
          if (v.bitmap)
            _ = v.bitmap;
          else {
            const x = v.width, F = v.height, B = this.cachedCanvases.getCanvas("inlineImage", x, F).context;
            me(B, v), _ = this.applyTransferMapsToCanvas(B);
          }
          for (const x of S)
            E.save(), E.transform(...x.transform), E.scale(1, -1), q(E, _, x.x, x.y, x.w, x.h, 0, -1, 1, 1), E.restore();
          this.compose();
        }
        paintSolidColorImageMask() {
          this.contentVisible && (this.ctx.fillRect(0, 0, 1, 1), this.compose());
        }
        markPoint(v) {
        }
        markPointProps(v, S) {
        }
        beginMarkedContent(v) {
          this.markedContentStack.push({
            visible: !0
          });
        }
        beginMarkedContentProps(v, S) {
          v === "OC" ? this.markedContentStack.push({
            visible: this.optionalContentConfig.isVisible(S)
          }) : this.markedContentStack.push({
            visible: !0
          }), this.contentVisible = this.isContentVisible();
        }
        endMarkedContent() {
          this.markedContentStack.pop(), this.contentVisible = this.isContentVisible();
        }
        beginCompat() {
        }
        endCompat() {
        }
        consumePath(v) {
          const S = this.current.isEmptyClip();
          this.pendingClip && this.current.updateClipFromPath(), this.pendingClip || this.compose(v);
          const E = this.ctx;
          this.pendingClip && (S || (this.pendingClip === de ? E.clip("evenodd") : E.clip()), this.pendingClip = null), this.current.startNewPathAndClipBox(this.current.clipBox), E.beginPath();
        }
        getSinglePixelWidth() {
          if (!this._cachedGetSinglePixelWidth) {
            const v = (0, r.getCurrentTransform)(this.ctx);
            if (v[1] === 0 && v[2] === 0)
              this._cachedGetSinglePixelWidth = 1 / Math.min(Math.abs(v[0]), Math.abs(v[3]));
            else {
              const S = Math.abs(v[0] * v[3] - v[2] * v[1]), E = Math.hypot(v[0], v[2]), _ = Math.hypot(v[1], v[3]);
              this._cachedGetSinglePixelWidth = Math.max(E, _) / S;
            }
          }
          return this._cachedGetSinglePixelWidth;
        }
        getScaleForStroking() {
          if (this._cachedScaleForStroking[0] === -1) {
            const {
              lineWidth: v
            } = this.current, {
              a: S,
              b: E,
              c: _,
              d: x
            } = this.ctx.getTransform();
            let F, I;
            if (E === 0 && _ === 0) {
              const B = Math.abs(S), H = Math.abs(x);
              if (B === H)
                if (v === 0)
                  F = I = 1 / B;
                else {
                  const V = B * v;
                  F = I = V < 1 ? 1 / V : 1;
                }
              else if (v === 0)
                F = 1 / B, I = 1 / H;
              else {
                const V = B * v, $ = H * v;
                F = V < 1 ? 1 / V : 1, I = $ < 1 ? 1 / $ : 1;
              }
            } else {
              const B = Math.abs(S * x - E * _), H = Math.hypot(S, E), V = Math.hypot(_, x);
              if (v === 0)
                F = V / B, I = H / B;
              else {
                const $ = v * B;
                F = V > $ ? V / $ : 1, I = H > $ ? H / $ : 1;
              }
            }
            this._cachedScaleForStroking[0] = F, this._cachedScaleForStroking[1] = I;
          }
          return this._cachedScaleForStroking;
        }
        rescaleAndStroke(v) {
          const {
            ctx: S
          } = this, {
            lineWidth: E
          } = this.current, [_, x] = this.getScaleForStroking();
          if (S.lineWidth = E || 1, _ === 1 && x === 1) {
            S.stroke();
            return;
          }
          const F = S.getLineDash();
          if (v && S.save(), S.scale(_, x), F.length > 0) {
            const I = Math.max(_, x);
            S.setLineDash(F.map((B) => B / I)), S.lineDashOffset /= I;
          }
          S.stroke(), v && S.restore();
        }
        isContentVisible() {
          for (let v = this.markedContentStack.length - 1; v >= 0; v--)
            if (!this.markedContentStack[v].visible)
              return !1;
          return !0;
        }
      }
      for (const D in n.OPS)
        R.prototype[D] !== void 0 && (R.prototype[n.OPS[D]] = R.prototype[D]);
    }
  ),
  /***/
  419: (
    /***/
    (i, e, t) => {
      t.d(e, {
        /* harmony export */
        DOMCMapReaderFactory: () => (
          /* binding */
          d
        ),
        /* harmony export */
        DOMCanvasFactory: () => (
          /* binding */
          o
        ),
        /* harmony export */
        DOMFilterFactory: () => (
          /* binding */
          l
        ),
        /* harmony export */
        DOMSVGFactory: () => (
          /* binding */
          f
        ),
        /* harmony export */
        DOMStandardFontDataFactory: () => (
          /* binding */
          c
        ),
        /* harmony export */
        PDFDateString: () => (
          /* binding */
          L
        ),
        /* harmony export */
        PageViewport: () => (
          /* binding */
          g
        ),
        /* harmony export */
        PixelsPerInch: () => (
          /* binding */
          u
        ),
        /* harmony export */
        RenderingCancelledException: () => (
          /* binding */
          A
        ),
        /* harmony export */
        StatTimer: () => (
          /* binding */
          b
        ),
        /* harmony export */
        fetchData: () => (
          /* binding */
          h
        ),
        /* harmony export */
        getColorValues: () => (
          /* binding */
          q
        ),
        /* harmony export */
        getCurrentTransform: () => (
          /* binding */
          Y
        ),
        /* harmony export */
        getCurrentTransformInverse: () => (
          /* binding */
          se
        ),
        /* harmony export */
        getFilenameFromUrl: () => (
          /* binding */
          a
        ),
        /* harmony export */
        getPdfFilenameFromUrl: () => (
          /* binding */
          p
        ),
        /* harmony export */
        getRGB: () => (
          /* binding */
          O
        ),
        /* harmony export */
        getXfaPageViewport: () => (
          /* binding */
          P
        ),
        /* harmony export */
        isDataScheme: () => (
          /* binding */
          m
        ),
        /* harmony export */
        isPdfFile: () => (
          /* binding */
          k
        ),
        /* harmony export */
        isValidFetchUrl: () => (
          /* binding */
          y
        ),
        /* harmony export */
        noContextMenu: () => (
          /* binding */
          C
        ),
        /* harmony export */
        setLayerDimensions: () => (
          /* binding */
          me
        )
        /* harmony export */
      });
      var n = t(583), r = t(292);
      const s = "http://www.w3.org/2000/svg";
      class u {
        static CSS = 96;
        static PDF = 72;
        static PDF_TO_CSS_UNITS = this.CSS / this.PDF;
      }
      class l extends n.BaseFilterFactory {
        #e;
        #t;
        #n;
        #r;
        #s;
        #i = 0;
        constructor({
          docId: K,
          ownerDocument: Z = globalThis.document
        } = {}) {
          super(), this.#n = K, this.#r = Z;
        }
        get #a() {
          return this.#e ||= /* @__PURE__ */ new Map();
        }
        get #u() {
          return this.#s ||= /* @__PURE__ */ new Map();
        }
        get #l() {
          if (!this.#t) {
            const K = this.#r.createElement("div"), {
              style: Z
            } = K;
            Z.visibility = "hidden", Z.contain = "strict", Z.width = Z.height = 0, Z.position = "absolute", Z.top = Z.left = 0, Z.zIndex = -1;
            const oe = this.#r.createElementNS(s, "svg");
            oe.setAttribute("width", 0), oe.setAttribute("height", 0), this.#t = this.#r.createElementNS(s, "defs"), K.append(oe), oe.append(this.#t), this.#r.body.append(K);
          }
          return this.#t;
        }
        addFilter(K) {
          if (!K)
            return "none";
          let Z = this.#a.get(K);
          if (Z)
            return Z;
          let oe, le, ie, pe;
          if (K.length === 1) {
            const Ae = K[0], ae = new Array(256);
            for (let de = 0; de < 256; de++)
              ae[de] = Ae[de] / 255;
            pe = oe = le = ie = ae.join(",");
          } else {
            const [Ae, ae, de] = K, R = new Array(256), D = new Array(256), v = new Array(256);
            for (let S = 0; S < 256; S++)
              R[S] = Ae[S] / 255, D[S] = ae[S] / 255, v[S] = de[S] / 255;
            oe = R.join(","), le = D.join(","), ie = v.join(","), pe = `${oe}${le}${ie}`;
          }
          if (Z = this.#a.get(pe), Z)
            return this.#a.set(K, Z), Z;
          const he = `g_${this.#n}_transfer_map_${this.#i++}`, we = `url(#${he})`;
          this.#a.set(K, we), this.#a.set(pe, we);
          const ke = this.#d(he);
          return this.#o(oe, le, ie, ke), we;
        }
        addHCMFilter(K, Z) {
          const oe = `${K}-${Z}`, le = "base";
          let ie = this.#u.get(le);
          if (ie?.key === oe || (ie ? (ie.filter?.remove(), ie.key = oe, ie.url = "none", ie.filter = null) : (ie = {
            key: oe,
            url: "none",
            filter: null
          }, this.#u.set(le, ie)), !K || !Z))
            return ie.url;
          const pe = this.#m(K);
          K = r.Util.makeHexColor(...pe);
          const he = this.#m(Z);
          if (Z = r.Util.makeHexColor(...he), this.#l.style.color = "", K === "#000000" && Z === "#ffffff" || K === Z)
            return ie.url;
          const we = new Array(256);
          for (let R = 0; R <= 255; R++) {
            const D = R / 255;
            we[R] = D <= 0.03928 ? D / 12.92 : ((D + 0.055) / 1.055) ** 2.4;
          }
          const ke = we.join(","), Ae = `g_${this.#n}_hcm_filter`, ae = ie.filter = this.#d(Ae);
          this.#o(ke, ke, ke, ae), this.#h(ae);
          const de = (R, D) => {
            const v = pe[R] / 255, S = he[R] / 255, E = new Array(D + 1);
            for (let _ = 0; _ <= D; _++)
              E[_] = v + _ / D * (S - v);
            return E.join(",");
          };
          return this.#o(de(0, 5), de(1, 5), de(2, 5), ae), ie.url = `url(#${Ae})`, ie.url;
        }
        addHighlightHCMFilter(K, Z, oe, le, ie) {
          const pe = `${Z}-${oe}-${le}-${ie}`;
          let he = this.#u.get(K);
          if (he?.key === pe || (he ? (he.filter?.remove(), he.key = pe, he.url = "none", he.filter = null) : (he = {
            key: pe,
            url: "none",
            filter: null
          }, this.#u.set(K, he)), !Z || !oe))
            return he.url;
          const [we, ke] = [Z, oe].map(this.#m.bind(this));
          let Ae = Math.round(0.2126 * we[0] + 0.7152 * we[1] + 0.0722 * we[2]), ae = Math.round(0.2126 * ke[0] + 0.7152 * ke[1] + 0.0722 * ke[2]), [de, R] = [le, ie].map(this.#m.bind(this));
          ae < Ae && ([Ae, ae, de, R] = [ae, Ae, R, de]), this.#l.style.color = "";
          const D = (E, _, x) => {
            const F = new Array(256), I = (ae - Ae) / x, B = E / 255, H = (_ - E) / (255 * x);
            let V = 0;
            for (let $ = 0; $ <= x; $++) {
              const X = Math.round(Ae + $ * I), G = B + $ * H;
              for (let U = V; U <= X; U++)
                F[U] = G;
              V = X + 1;
            }
            for (let $ = V; $ < 256; $++)
              F[$] = F[V - 1];
            return F.join(",");
          }, v = `g_${this.#n}_hcm_${K}_filter`, S = he.filter = this.#d(v);
          return this.#h(S), this.#o(D(de[0], R[0], 5), D(de[1], R[1], 5), D(de[2], R[2], 5), S), he.url = `url(#${v})`, he.url;
        }
        destroy(K = !1) {
          K && this.#u.size !== 0 || (this.#t && (this.#t.parentNode.parentNode.remove(), this.#t = null), this.#e && (this.#e.clear(), this.#e = null), this.#i = 0);
        }
        #h(K) {
          const Z = this.#r.createElementNS(s, "feColorMatrix");
          Z.setAttribute("type", "matrix"), Z.setAttribute("values", "0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"), K.append(Z);
        }
        #d(K) {
          const Z = this.#r.createElementNS(s, "filter");
          return Z.setAttribute("color-interpolation-filters", "sRGB"), Z.setAttribute("id", K), this.#l.append(Z), Z;
        }
        #c(K, Z, oe) {
          const le = this.#r.createElementNS(s, Z);
          le.setAttribute("type", "discrete"), le.setAttribute("tableValues", oe), K.append(le);
        }
        #o(K, Z, oe, le) {
          const ie = this.#r.createElementNS(s, "feComponentTransfer");
          le.append(ie), this.#c(ie, "feFuncR", K), this.#c(ie, "feFuncG", Z), this.#c(ie, "feFuncB", oe);
        }
        #m(K) {
          return this.#l.style.color = K, O(getComputedStyle(this.#l).getPropertyValue("color"));
        }
      }
      class o extends n.BaseCanvasFactory {
        constructor({
          ownerDocument: K = globalThis.document
        } = {}) {
          super(), this._document = K;
        }
        _createCanvas(K, Z) {
          const oe = this._document.createElement("canvas");
          return oe.width = K, oe.height = Z, oe;
        }
      }
      async function h(te, K = "text") {
        if (y(te, document.baseURI)) {
          const Z = await fetch(te);
          if (!Z.ok)
            throw new Error(Z.statusText);
          switch (K) {
            case "arraybuffer":
              return Z.arrayBuffer();
            case "blob":
              return Z.blob();
            case "json":
              return Z.json();
          }
          return Z.text();
        }
        return new Promise((Z, oe) => {
          const le = new XMLHttpRequest();
          le.open("GET", te, !0), le.responseType = K, le.onreadystatechange = () => {
            if (le.readyState === XMLHttpRequest.DONE) {
              if (le.status === 200 || le.status === 0) {
                switch (K) {
                  case "arraybuffer":
                  case "blob":
                  case "json":
                    Z(le.response);
                    return;
                }
                Z(le.responseText);
                return;
              }
              oe(new Error(le.statusText));
            }
          }, le.send(null);
        });
      }
      class d extends n.BaseCMapReaderFactory {
        _fetchData(K, Z) {
          return h(K, this.isCompressed ? "arraybuffer" : "text").then((oe) => ({
            cMapData: oe instanceof ArrayBuffer ? new Uint8Array(oe) : (0, r.stringToBytes)(oe),
            compressionType: Z
          }));
        }
      }
      class c extends n.BaseStandardFontDataFactory {
        _fetchData(K) {
          return h(K, "arraybuffer").then((Z) => new Uint8Array(Z));
        }
      }
      class f extends n.BaseSVGFactory {
        _createSVG(K) {
          return document.createElementNS(s, K);
        }
      }
      class g {
        constructor({
          viewBox: K,
          scale: Z,
          rotation: oe,
          offsetX: le = 0,
          offsetY: ie = 0,
          dontFlip: pe = !1
        }) {
          this.viewBox = K, this.scale = Z, this.rotation = oe, this.offsetX = le, this.offsetY = ie;
          const he = (K[2] + K[0]) / 2, we = (K[3] + K[1]) / 2;
          let ke, Ae, ae, de;
          switch (oe %= 360, oe < 0 && (oe += 360), oe) {
            case 180:
              ke = -1, Ae = 0, ae = 0, de = 1;
              break;
            case 90:
              ke = 0, Ae = 1, ae = 1, de = 0;
              break;
            case 270:
              ke = 0, Ae = -1, ae = -1, de = 0;
              break;
            case 0:
              ke = 1, Ae = 0, ae = 0, de = -1;
              break;
            default:
              throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.");
          }
          pe && (ae = -ae, de = -de);
          let R, D, v, S;
          ke === 0 ? (R = Math.abs(we - K[1]) * Z + le, D = Math.abs(he - K[0]) * Z + ie, v = (K[3] - K[1]) * Z, S = (K[2] - K[0]) * Z) : (R = Math.abs(he - K[0]) * Z + le, D = Math.abs(we - K[1]) * Z + ie, v = (K[2] - K[0]) * Z, S = (K[3] - K[1]) * Z), this.transform = [ke * Z, Ae * Z, ae * Z, de * Z, R - ke * Z * he - ae * Z * we, D - Ae * Z * he - de * Z * we], this.width = v, this.height = S;
        }
        get rawDims() {
          const {
            viewBox: K
          } = this;
          return (0, r.shadow)(this, "rawDims", {
            pageWidth: K[2] - K[0],
            pageHeight: K[3] - K[1],
            pageX: K[0],
            pageY: K[1]
          });
        }
        clone({
          scale: K = this.scale,
          rotation: Z = this.rotation,
          offsetX: oe = this.offsetX,
          offsetY: le = this.offsetY,
          dontFlip: ie = !1
        } = {}) {
          return new g({
            viewBox: this.viewBox.slice(),
            scale: K,
            rotation: Z,
            offsetX: oe,
            offsetY: le,
            dontFlip: ie
          });
        }
        convertToViewportPoint(K, Z) {
          return r.Util.applyTransform([K, Z], this.transform);
        }
        convertToViewportRectangle(K) {
          const Z = r.Util.applyTransform([K[0], K[1]], this.transform), oe = r.Util.applyTransform([K[2], K[3]], this.transform);
          return [Z[0], Z[1], oe[0], oe[1]];
        }
        convertToPdfPoint(K, Z) {
          return r.Util.applyInverseTransform([K, Z], this.transform);
        }
      }
      class A extends r.BaseException {
        constructor(K, Z = 0) {
          super(K, "RenderingCancelledException"), this.extraDelay = Z;
        }
      }
      function m(te) {
        const K = te.length;
        let Z = 0;
        for (; Z < K && te[Z].trim() === ""; )
          Z++;
        return te.substring(Z, Z + 5).toLowerCase() === "data:";
      }
      function k(te) {
        return typeof te == "string" && /\.pdf$/i.test(te);
      }
      function a(te, K = !1) {
        return K || ([te] = te.split(/[#?]/, 1)), te.substring(te.lastIndexOf("/") + 1);
      }
      function p(te, K = "document.pdf") {
        if (typeof te != "string")
          return K;
        if (m(te))
          return (0, r.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'), K;
        const Z = /^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/, oe = /[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i, le = Z.exec(te);
        let ie = oe.exec(le[1]) || oe.exec(le[2]) || oe.exec(le[3]);
        if (ie && (ie = ie[0], ie.includes("%")))
          try {
            ie = oe.exec(decodeURIComponent(ie))[0];
          } catch {
          }
        return ie || K;
      }
      class b {
        started = /* @__PURE__ */ Object.create(null);
        times = [];
        time(K) {
          K in this.started && (0, r.warn)(`Timer is already running for ${K}`), this.started[K] = Date.now();
        }
        timeEnd(K) {
          K in this.started || (0, r.warn)(`Timer has not been started for ${K}`), this.times.push({
            name: K,
            start: this.started[K],
            end: Date.now()
          }), delete this.started[K];
        }
        toString() {
          const K = [];
          let Z = 0;
          for (const {
            name: oe
          } of this.times)
            Z = Math.max(oe.length, Z);
          for (const {
            name: oe,
            start: le,
            end: ie
          } of this.times)
            K.push(`${oe.padEnd(Z)} ${ie - le}ms
`);
          return K.join("");
        }
      }
      function y(te, K) {
        try {
          const {
            protocol: Z
          } = K ? new URL(te, K) : new URL(te);
          return Z === "http:" || Z === "https:";
        } catch {
          return !1;
        }
      }
      function C(te) {
        te.preventDefault();
      }
      let M;
      class L {
        static toDateObject(K) {
          if (!K || typeof K != "string")
            return null;
          M ||= new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?");
          const Z = M.exec(K);
          if (!Z)
            return null;
          const oe = parseInt(Z[1], 10);
          let le = parseInt(Z[2], 10);
          le = le >= 1 && le <= 12 ? le - 1 : 0;
          let ie = parseInt(Z[3], 10);
          ie = ie >= 1 && ie <= 31 ? ie : 1;
          let pe = parseInt(Z[4], 10);
          pe = pe >= 0 && pe <= 23 ? pe : 0;
          let he = parseInt(Z[5], 10);
          he = he >= 0 && he <= 59 ? he : 0;
          let we = parseInt(Z[6], 10);
          we = we >= 0 && we <= 59 ? we : 0;
          const ke = Z[7] || "Z";
          let Ae = parseInt(Z[8], 10);
          Ae = Ae >= 0 && Ae <= 23 ? Ae : 0;
          let ae = parseInt(Z[9], 10) || 0;
          return ae = ae >= 0 && ae <= 59 ? ae : 0, ke === "-" ? (pe += Ae, he += ae) : ke === "+" && (pe -= Ae, he -= ae), new Date(Date.UTC(oe, le, ie, pe, he, we));
        }
      }
      function P(te, {
        scale: K = 1,
        rotation: Z = 0
      }) {
        const {
          width: oe,
          height: le
        } = te.attributes.style, ie = [0, 0, parseInt(oe), parseInt(le)];
        return new g({
          viewBox: ie,
          scale: K,
          rotation: Z
        });
      }
      function O(te) {
        if (te.startsWith("#")) {
          const K = parseInt(te.slice(1), 16);
          return [(K & 16711680) >> 16, (K & 65280) >> 8, K & 255];
        }
        return te.startsWith("rgb(") ? te.slice(4, -1).split(",").map((K) => parseInt(K)) : te.startsWith("rgba(") ? te.slice(5, -1).split(",").map((K) => parseInt(K)).slice(0, 3) : ((0, r.warn)(`Not a valid color format: "${te}"`), [0, 0, 0]);
      }
      function q(te) {
        const K = document.createElement("span");
        K.style.visibility = "hidden", document.body.append(K);
        for (const Z of te.keys()) {
          K.style.color = Z;
          const oe = window.getComputedStyle(K).color;
          te.set(Z, O(oe));
        }
        K.remove();
      }
      function Y(te) {
        const {
          a: K,
          b: Z,
          c: oe,
          d: le,
          e: ie,
          f: pe
        } = te.getTransform();
        return [K, Z, oe, le, ie, pe];
      }
      function se(te) {
        const {
          a: K,
          b: Z,
          c: oe,
          d: le,
          e: ie,
          f: pe
        } = te.getTransform().invertSelf();
        return [K, Z, oe, le, ie, pe];
      }
      function me(te, K, Z = !1, oe = !0) {
        if (K instanceof g) {
          const {
            pageWidth: le,
            pageHeight: ie
          } = K.rawDims, {
            style: pe
          } = te, he = r.FeatureTest.isCSSRoundSupported, we = `var(--scale-factor) * ${le}px`, ke = `var(--scale-factor) * ${ie}px`, Ae = he ? `round(${we}, 1px)` : `calc(${we})`, ae = he ? `round(${ke}, 1px)` : `calc(${ke})`;
          !Z || K.rotation % 180 === 0 ? (pe.width = Ae, pe.height = ae) : (pe.width = ae, pe.height = Ae);
        }
        oe && te.setAttribute("data-main-rotation", K.rotation);
      }
    }
  ),
  /***/
  47: (
    /***/
    (i, e, t) => {
      t.d(e, {
        /* harmony export */
        DrawLayer: () => (
          /* binding */
          s
        )
        /* harmony export */
      });
      var n = t(419), r = t(292);
      class s {
        #e = null;
        #t = 0;
        #n = /* @__PURE__ */ new Map();
        #r = /* @__PURE__ */ new Map();
        constructor({
          pageIndex: l
        }) {
          this.pageIndex = l;
        }
        setParent(l) {
          if (!this.#e) {
            this.#e = l;
            return;
          }
          if (this.#e !== l) {
            if (this.#n.size > 0)
              for (const o of this.#n.values())
                o.remove(), l.append(o);
            this.#e = l;
          }
        }
        static get _svgFactory() {
          return (0, r.shadow)(this, "_svgFactory", new n.DOMSVGFactory());
        }
        static #s(l, {
          x: o = 0,
          y: h = 0,
          width: d = 1,
          height: c = 1
        } = {}) {
          const {
            style: f
          } = l;
          f.top = `${100 * h}%`, f.left = `${100 * o}%`, f.width = `${100 * d}%`, f.height = `${100 * c}%`;
        }
        #i(l) {
          const o = s._svgFactory.create(1, 1, !0);
          return this.#e.append(o), o.setAttribute("aria-hidden", !0), s.#s(o, l), o;
        }
        #a(l, o) {
          const h = s._svgFactory.createElement("clipPath");
          l.append(h);
          const d = `clip_${o}`;
          h.setAttribute("id", d), h.setAttribute("clipPathUnits", "objectBoundingBox");
          const c = s._svgFactory.createElement("use");
          return h.append(c), c.setAttribute("href", `#${o}`), c.classList.add("clip"), d;
        }
        highlight(l, o, h, d = !1) {
          const c = this.#t++, f = this.#i(l.box);
          f.classList.add("highlight"), l.free && f.classList.add("free");
          const g = s._svgFactory.createElement("defs");
          f.append(g);
          const A = s._svgFactory.createElement("path");
          g.append(A);
          const m = `path_p${this.pageIndex}_${c}`;
          A.setAttribute("id", m), A.setAttribute("d", l.toSVGPath()), d && this.#r.set(c, A);
          const k = this.#a(g, m), a = s._svgFactory.createElement("use");
          return f.append(a), f.setAttribute("fill", o), f.setAttribute("fill-opacity", h), a.setAttribute("href", `#${m}`), this.#n.set(c, f), {
            id: c,
            clipPathId: `url(#${k})`
          };
        }
        highlightOutline(l) {
          const o = this.#t++, h = this.#i(l.box);
          h.classList.add("highlightOutline");
          const d = s._svgFactory.createElement("defs");
          h.append(d);
          const c = s._svgFactory.createElement("path");
          d.append(c);
          const f = `path_p${this.pageIndex}_${o}`;
          c.setAttribute("id", f), c.setAttribute("d", l.toSVGPath()), c.setAttribute("vector-effect", "non-scaling-stroke");
          let g;
          if (l.free) {
            h.classList.add("free");
            const k = s._svgFactory.createElement("mask");
            d.append(k), g = `mask_p${this.pageIndex}_${o}`, k.setAttribute("id", g), k.setAttribute("maskUnits", "objectBoundingBox");
            const a = s._svgFactory.createElement("rect");
            k.append(a), a.setAttribute("width", "1"), a.setAttribute("height", "1"), a.setAttribute("fill", "white");
            const p = s._svgFactory.createElement("use");
            k.append(p), p.setAttribute("href", `#${f}`), p.setAttribute("stroke", "none"), p.setAttribute("fill", "black"), p.setAttribute("fill-rule", "nonzero"), p.classList.add("mask");
          }
          const A = s._svgFactory.createElement("use");
          h.append(A), A.setAttribute("href", `#${f}`), g && A.setAttribute("mask", `url(#${g})`);
          const m = A.cloneNode();
          return h.append(m), A.classList.add("mainOutline"), m.classList.add("secondaryOutline"), this.#n.set(o, h), o;
        }
        finalizeLine(l, o) {
          const h = this.#r.get(l);
          this.#r.delete(l), this.updateBox(l, o.box), h.setAttribute("d", o.toSVGPath());
        }
        updateLine(l, o) {
          this.#n.get(l).firstChild.firstChild.setAttribute("d", o.toSVGPath());
        }
        removeFreeHighlight(l) {
          this.remove(l), this.#r.delete(l);
        }
        updatePath(l, o) {
          this.#r.get(l).setAttribute("d", o.toSVGPath());
        }
        updateBox(l, o) {
          s.#s(this.#n.get(l), o);
        }
        show(l, o) {
          this.#n.get(l).classList.toggle("hidden", !o);
        }
        rotate(l, o) {
          this.#n.get(l).setAttribute("data-main-rotation", o);
        }
        changeColor(l, o) {
          this.#n.get(l).setAttribute("fill", o);
        }
        changeOpacity(l, o) {
          this.#n.get(l).setAttribute("fill-opacity", o);
        }
        addClass(l, o) {
          this.#n.get(l).classList.add(o);
        }
        removeClass(l, o) {
          this.#n.get(l).classList.remove(o);
        }
        remove(l) {
          this.#e !== null && (this.#n.get(l).remove(), this.#n.delete(l));
        }
        destroy() {
          this.#e = null;
          for (const l of this.#n.values())
            l.remove();
          this.#n.clear();
        }
      }
    }
  ),
  /***/
  731: (
    /***/
    (i, e, t) => {
      t.d(e, {
        AnnotationEditorLayer: () => (
          /* binding */
          m
        )
      });
      var n = t(292), r = t(310), s = t(830), u = t(976);
      const l = /\r\n?|\n/g;
      class o extends r.AnnotationEditor {
        #e = this.editorDivBlur.bind(this);
        #t = this.editorDivFocus.bind(this);
        #n = this.editorDivInput.bind(this);
        #r = this.editorDivKeydown.bind(this);
        #s = this.editorDivPaste.bind(this);
        #i;
        #a = "";
        #u = `${this.id}-editor`;
        #l;
        #h = null;
        static _freeTextDefaultContent = "";
        static _internalPadding = 0;
        static _defaultColor = null;
        static _defaultFontSize = 10;
        static get _keyboardManager() {
          const a = o.prototype, p = (C) => C.isEmpty(), b = s.AnnotationEditorUIManager.TRANSLATE_SMALL, y = s.AnnotationEditorUIManager.TRANSLATE_BIG;
          return (0, n.shadow)(this, "_keyboardManager", new s.KeyboardManager([[["ctrl+s", "mac+meta+s", "ctrl+p", "mac+meta+p"], a.commitOrRemove, {
            bubbles: !0
          }], [["ctrl+Enter", "mac+meta+Enter", "Escape", "mac+Escape"], a.commitOrRemove], [["ArrowLeft", "mac+ArrowLeft"], a._translateEmpty, {
            args: [-b, 0],
            checker: p
          }], [["ctrl+ArrowLeft", "mac+shift+ArrowLeft"], a._translateEmpty, {
            args: [-y, 0],
            checker: p
          }], [["ArrowRight", "mac+ArrowRight"], a._translateEmpty, {
            args: [b, 0],
            checker: p
          }], [["ctrl+ArrowRight", "mac+shift+ArrowRight"], a._translateEmpty, {
            args: [y, 0],
            checker: p
          }], [["ArrowUp", "mac+ArrowUp"], a._translateEmpty, {
            args: [0, -b],
            checker: p
          }], [["ctrl+ArrowUp", "mac+shift+ArrowUp"], a._translateEmpty, {
            args: [0, -y],
            checker: p
          }], [["ArrowDown", "mac+ArrowDown"], a._translateEmpty, {
            args: [0, b],
            checker: p
          }], [["ctrl+ArrowDown", "mac+shift+ArrowDown"], a._translateEmpty, {
            args: [0, y],
            checker: p
          }]]));
        }
        static _type = "freetext";
        static _editorType = n.AnnotationEditorType.FREETEXT;
        constructor(a) {
          super({
            ...a,
            name: "freeTextEditor"
          }), this.#i = a.color || o._defaultColor || r.AnnotationEditor._defaultLineColor, this.#l = a.fontSize || o._defaultFontSize;
        }
        static initialize(a, p) {
          r.AnnotationEditor.initialize(a, p, {
            strings: ["pdfjs-free-text-default-content"]
          });
          const b = getComputedStyle(document.documentElement);
          this._internalPadding = parseFloat(b.getPropertyValue("--freetext-padding"));
        }
        static updateDefaultParams(a, p) {
          switch (a) {
            case n.AnnotationEditorParamsType.FREETEXT_SIZE:
              o._defaultFontSize = p;
              break;
            case n.AnnotationEditorParamsType.FREETEXT_COLOR:
              o._defaultColor = p;
              break;
          }
        }
        updateParams(a, p) {
          switch (a) {
            case n.AnnotationEditorParamsType.FREETEXT_SIZE:
              this.#d(p);
              break;
            case n.AnnotationEditorParamsType.FREETEXT_COLOR:
              this.#c(p);
              break;
          }
        }
        static get defaultPropertiesToUpdate() {
          return [[n.AnnotationEditorParamsType.FREETEXT_SIZE, o._defaultFontSize], [n.AnnotationEditorParamsType.FREETEXT_COLOR, o._defaultColor || r.AnnotationEditor._defaultLineColor]];
        }
        get propertiesToUpdate() {
          return [[n.AnnotationEditorParamsType.FREETEXT_SIZE, this.#l], [n.AnnotationEditorParamsType.FREETEXT_COLOR, this.#i]];
        }
        #d(a) {
          const p = (y) => {
            this.editorDiv.style.fontSize = `calc(${y}px * var(--scale-factor))`, this.translate(0, -(y - this.#l) * this.parentScale), this.#l = y, this.#m();
          }, b = this.#l;
          this.addCommands({
            cmd: p.bind(this, a),
            undo: p.bind(this, b),
            post: this._uiManager.updateUI.bind(this._uiManager, this),
            mustExec: !0,
            type: n.AnnotationEditorParamsType.FREETEXT_SIZE,
            overwriteIfSameType: !0,
            keepUndo: !0
          });
        }
        #c(a) {
          const p = (y) => {
            this.#i = this.editorDiv.style.color = y;
          }, b = this.#i;
          this.addCommands({
            cmd: p.bind(this, a),
            undo: p.bind(this, b),
            post: this._uiManager.updateUI.bind(this._uiManager, this),
            mustExec: !0,
            type: n.AnnotationEditorParamsType.FREETEXT_COLOR,
            overwriteIfSameType: !0,
            keepUndo: !0
          });
        }
        _translateEmpty(a, p) {
          this._uiManager.translateSelectedEditors(a, p, !0);
        }
        getInitialTranslation() {
          const a = this.parentScale;
          return [-o._internalPadding * a, -(o._internalPadding + this.#l) * a];
        }
        rebuild() {
          this.parent && (super.rebuild(), this.div !== null && (this.isAttachedToDOM || this.parent.add(this)));
        }
        enableEditMode() {
          this.isInEditMode() || (this.parent.setEditingState(!1), this.parent.updateToolbar(n.AnnotationEditorType.FREETEXT), super.enableEditMode(), this.overlayDiv.classList.remove("enabled"), this.editorDiv.contentEditable = !0, this._isDraggable = !1, this.div.removeAttribute("aria-activedescendant"), this.editorDiv.addEventListener("keydown", this.#r), this.editorDiv.addEventListener("focus", this.#t), this.editorDiv.addEventListener("blur", this.#e), this.editorDiv.addEventListener("input", this.#n), this.editorDiv.addEventListener("paste", this.#s));
        }
        disableEditMode() {
          this.isInEditMode() && (this.parent.setEditingState(!0), super.disableEditMode(), this.overlayDiv.classList.add("enabled"), this.editorDiv.contentEditable = !1, this.div.setAttribute("aria-activedescendant", this.#u), this._isDraggable = !0, this.editorDiv.removeEventListener("keydown", this.#r), this.editorDiv.removeEventListener("focus", this.#t), this.editorDiv.removeEventListener("blur", this.#e), this.editorDiv.removeEventListener("input", this.#n), this.editorDiv.removeEventListener("paste", this.#s), this.div.focus({
            preventScroll: !0
          }), this.isEditing = !1, this.parent.div.classList.add("freetextEditing"));
        }
        focusin(a) {
          this._focusEventsAllowed && (super.focusin(a), a.target !== this.editorDiv && this.editorDiv.focus());
        }
        onceAdded() {
          this.width || (this.enableEditMode(), this.editorDiv.focus(), this._initialOptions?.isCentered && this.center(), this._initialOptions = null);
        }
        isEmpty() {
          return !this.editorDiv || this.editorDiv.innerText.trim() === "";
        }
        remove() {
          this.isEditing = !1, this.parent && (this.parent.setEditingState(!0), this.parent.div.classList.add("freetextEditing")), super.remove();
        }
        #o() {
          const a = [];
          this.editorDiv.normalize();
          for (const p of this.editorDiv.childNodes)
            a.push(o.#p(p));
          return a.join(`
`);
        }
        #m() {
          const [a, p] = this.parentDimensions;
          let b;
          if (this.isAttachedToDOM)
            b = this.div.getBoundingClientRect();
          else {
            const {
              currentLayer: y,
              div: C
            } = this, M = C.style.display, L = C.classList.contains("hidden");
            C.classList.remove("hidden"), C.style.display = "hidden", y.div.append(this.div), b = C.getBoundingClientRect(), C.remove(), C.style.display = M, C.classList.toggle("hidden", L);
          }
          this.rotation % 180 === this.parentRotation % 180 ? (this.width = b.width / a, this.height = b.height / p) : (this.width = b.height / a, this.height = b.width / p), this.fixAndSetPosition();
        }
        commit() {
          if (!this.isInEditMode())
            return;
          super.commit(), this.disableEditMode();
          const a = this.#a, p = this.#a = this.#o().trimEnd();
          if (a === p)
            return;
          const b = (y) => {
            if (this.#a = y, !y) {
              this.remove();
              return;
            }
            this.#f(), this._uiManager.rebuild(this), this.#m();
          };
          this.addCommands({
            cmd: () => {
              b(p);
            },
            undo: () => {
              b(a);
            },
            mustExec: !1
          }), this.#m();
        }
        shouldGetKeyboardEvents() {
          return this.isInEditMode();
        }
        enterInEditMode() {
          this.enableEditMode(), this.editorDiv.focus();
        }
        dblclick(a) {
          this.enterInEditMode();
        }
        keydown(a) {
          a.target === this.div && a.key === "Enter" && (this.enterInEditMode(), a.preventDefault());
        }
        editorDivKeydown(a) {
          o._keyboardManager.exec(this, a);
        }
        editorDivFocus(a) {
          this.isEditing = !0;
        }
        editorDivBlur(a) {
          this.isEditing = !1;
        }
        editorDivInput(a) {
          this.parent.div.classList.toggle("freetextEditing", this.isEmpty());
        }
        disableEditing() {
          this.editorDiv.setAttribute("role", "comment"), this.editorDiv.removeAttribute("aria-multiline");
        }
        enableEditing() {
          this.editorDiv.setAttribute("role", "textbox"), this.editorDiv.setAttribute("aria-multiline", !0);
        }
        render() {
          if (this.div)
            return this.div;
          let a, p;
          this.width && (a = this.x, p = this.y), super.render(), this.editorDiv = document.createElement("div"), this.editorDiv.className = "internal", this.editorDiv.setAttribute("id", this.#u), this.editorDiv.setAttribute("data-l10n-id", "pdfjs-free-text"), this.enableEditing(), r.AnnotationEditor._l10nPromise.get("pdfjs-free-text-default-content").then((y) => this.editorDiv?.setAttribute("default-content", y)), this.editorDiv.contentEditable = !0;
          const {
            style: b
          } = this.editorDiv;
          if (b.fontSize = `calc(${this.#l}px * var(--scale-factor))`, b.color = this.#i, this.div.append(this.editorDiv), this.overlayDiv = document.createElement("div"), this.overlayDiv.classList.add("overlay", "enabled"), this.div.append(this.overlayDiv), (0, s.bindEvents)(this, this.div, ["dblclick", "keydown"]), this.width) {
            const [y, C] = this.parentDimensions;
            if (this.annotationElementId) {
              const {
                position: M
              } = this.#h;
              let [L, P] = this.getInitialTranslation();
              [L, P] = this.pageTranslationToScreen(L, P);
              const [O, q] = this.pageDimensions, [Y, se] = this.pageTranslation;
              let me, te;
              switch (this.rotation) {
                case 0:
                  me = a + (M[0] - Y) / O, te = p + this.height - (M[1] - se) / q;
                  break;
                case 90:
                  me = a + (M[0] - Y) / O, te = p - (M[1] - se) / q, [L, P] = [P, -L];
                  break;
                case 180:
                  me = a - this.width + (M[0] - Y) / O, te = p - (M[1] - se) / q, [L, P] = [-L, -P];
                  break;
                case 270:
                  me = a + (M[0] - Y - this.height * q) / O, te = p + (M[1] - se - this.width * O) / q, [L, P] = [-P, L];
                  break;
              }
              this.setAt(me * y, te * C, L, P);
            } else
              this.setAt(a * y, p * C, this.width * y, this.height * C);
            this.#f(), this._isDraggable = !0, this.editorDiv.contentEditable = !1;
          } else
            this._isDraggable = !1, this.editorDiv.contentEditable = !0;
          return this.div;
        }
        static #p(a) {
          return (a.nodeType === Node.TEXT_NODE ? a.nodeValue : a.innerText).replaceAll(l, "");
        }
        editorDivPaste(a) {
          const p = a.clipboardData || window.clipboardData, {
            types: b
          } = p;
          if (b.length === 1 && b[0] === "text/plain")
            return;
          a.preventDefault();
          const y = o.#g(p.getData("text") || "").replaceAll(l, `
`);
          if (!y)
            return;
          const C = window.getSelection();
          if (!C.rangeCount)
            return;
          this.editorDiv.normalize(), C.deleteFromDocument();
          const M = C.getRangeAt(0);
          if (!y.includes(`
`)) {
            M.insertNode(document.createTextNode(y)), this.editorDiv.normalize(), C.collapseToStart();
            return;
          }
          const {
            startContainer: L,
            startOffset: P
          } = M, O = [], q = [];
          if (L.nodeType === Node.TEXT_NODE) {
            const me = L.parentElement;
            if (q.push(L.nodeValue.slice(P).replaceAll(l, "")), me !== this.editorDiv) {
              let te = O;
              for (const K of this.editorDiv.childNodes) {
                if (K === me) {
                  te = q;
                  continue;
                }
                te.push(o.#p(K));
              }
            }
            O.push(L.nodeValue.slice(0, P).replaceAll(l, ""));
          } else if (L === this.editorDiv) {
            let me = O, te = 0;
            for (const K of this.editorDiv.childNodes)
              te++ === P && (me = q), me.push(o.#p(K));
          }
          this.#a = `${O.join(`
`)}${y}${q.join(`
`)}`, this.#f();
          const Y = new Range();
          let se = O.reduce((me, te) => me + te.length, 0);
          for (const {
            firstChild: me
          } of this.editorDiv.childNodes)
            if (me.nodeType === Node.TEXT_NODE) {
              const te = me.nodeValue.length;
              if (se <= te) {
                Y.setStart(me, se), Y.setEnd(me, se);
                break;
              }
              se -= te;
            }
          C.removeAllRanges(), C.addRange(Y);
        }
        #f() {
          if (this.editorDiv.replaceChildren(), !!this.#a)
            for (const a of this.#a.split(`
`)) {
              const p = document.createElement("div");
              p.append(a ? document.createTextNode(a) : document.createElement("br")), this.editorDiv.append(p);
            }
        }
        #v() {
          return this.#a.replaceAll(" ", " ");
        }
        static #g(a) {
          return a.replaceAll(" ", " ");
        }
        get contentDiv() {
          return this.editorDiv;
        }
        static deserialize(a, p, b) {
          let y = null;
          if (a instanceof u.FreeTextAnnotationElement) {
            const {
              data: {
                defaultAppearanceData: {
                  fontSize: M,
                  fontColor: L
                },
                rect: P,
                rotation: O,
                id: q
              },
              textContent: Y,
              textPosition: se,
              parent: {
                page: {
                  pageNumber: me
                }
              }
            } = a;
            if (!Y || Y.length === 0)
              return null;
            y = a = {
              annotationType: n.AnnotationEditorType.FREETEXT,
              color: Array.from(L),
              fontSize: M,
              value: Y.join(`
`),
              position: se,
              pageIndex: me - 1,
              rect: P.slice(0),
              rotation: O,
              id: q,
              deleted: !1
            };
          }
          const C = super.deserialize(a, p, b);
          return C.#l = a.fontSize, C.#i = n.Util.makeHexColor(...a.color), C.#a = o.#g(a.value), C.annotationElementId = a.id || null, C.#h = y, C;
        }
        serialize(a = !1) {
          if (this.isEmpty())
            return null;
          if (this.deleted)
            return {
              pageIndex: this.pageIndex,
              id: this.annotationElementId,
              deleted: !0
            };
          const p = o._internalPadding * this.parentScale, b = this.getRect(p, p), y = r.AnnotationEditor._colorManager.convert(this.isAttachedToDOM ? getComputedStyle(this.editorDiv).color : this.#i), C = {
            annotationType: n.AnnotationEditorType.FREETEXT,
            color: y,
            fontSize: this.#l,
            value: this.#v(),
            pageIndex: this.pageIndex,
            rect: b,
            rotation: this.rotation,
            structTreeParentId: this._structTreeParentId
          };
          return a ? C : this.annotationElementId && !this.#y(C) ? null : (C.id = this.annotationElementId, C);
        }
        #y(a) {
          const {
            value: p,
            fontSize: b,
            color: y,
            pageIndex: C
          } = this.#h;
          return this._hasBeenMoved || a.value !== p || a.fontSize !== b || a.color.some((M, L) => M !== y[L]) || a.pageIndex !== C;
        }
        renderAnnotationElement(a) {
          const p = super.renderAnnotationElement(a);
          if (this.deleted)
            return p;
          const {
            style: b
          } = p;
          b.fontSize = `calc(${this.#l}px * var(--scale-factor))`, b.color = this.#i, p.replaceChildren();
          for (const C of this.#a.split(`
`)) {
            const M = document.createElement("div");
            M.append(C ? document.createTextNode(C) : document.createElement("br")), p.append(M);
          }
          const y = o._internalPadding * this.parentScale;
          return a.updateEdited({
            rect: this.getRect(y, y)
          }), p;
        }
        resetAnnotationElement(a) {
          super.resetAnnotationElement(a), a.resetEdited();
        }
      }
      var h = t(61), d = t(259), c = t(419);
      class f extends r.AnnotationEditor {
        #e = null;
        #t = 0;
        #n;
        #r = null;
        #s = null;
        #i = null;
        #a = null;
        #u = 0;
        #l = null;
        #h = null;
        #d = null;
        #c = !1;
        #o = this.#S.bind(this);
        #m = null;
        #p;
        #f = null;
        #v = "";
        #g;
        #y = "";
        static _defaultColor = null;
        static _defaultOpacity = 1;
        static _defaultThickness = 12;
        static _l10nPromise;
        static _type = "highlight";
        static _editorType = n.AnnotationEditorType.HIGHLIGHT;
        static _freeHighlightId = -1;
        static _freeHighlight = null;
        static _freeHighlightClipId = "";
        static get _keyboardManager() {
          const a = f.prototype;
          return (0, n.shadow)(this, "_keyboardManager", new s.KeyboardManager([[["ArrowLeft", "mac+ArrowLeft"], a._moveCaret, {
            args: [0]
          }], [["ArrowRight", "mac+ArrowRight"], a._moveCaret, {
            args: [1]
          }], [["ArrowUp", "mac+ArrowUp"], a._moveCaret, {
            args: [2]
          }], [["ArrowDown", "mac+ArrowDown"], a._moveCaret, {
            args: [3]
          }]]));
        }
        constructor(a) {
          super({
            ...a,
            name: "highlightEditor"
          }), this.color = a.color || f._defaultColor, this.#g = a.thickness || f._defaultThickness, this.#p = a.opacity || f._defaultOpacity, this.#n = a.boxes || null, this.#y = a.methodOfCreation || "", this.#v = a.text || "", this._isDraggable = !1, a.highlightId > -1 ? (this.#c = !0, this.#_(a), this.#b()) : (this.#e = a.anchorNode, this.#t = a.anchorOffset, this.#a = a.focusNode, this.#u = a.focusOffset, this.#A(), this.#b(), this.rotate(this.rotation));
        }
        get telemetryInitialData() {
          return {
            action: "added",
            type: this.#c ? "free_highlight" : "highlight",
            color: this._uiManager.highlightColorNames.get(this.color),
            thickness: this.#g,
            methodOfCreation: this.#y
          };
        }
        get telemetryFinalData() {
          return {
            type: "highlight",
            color: this._uiManager.highlightColorNames.get(this.color)
          };
        }
        static computeTelemetryFinalData(a) {
          return {
            numberOfColors: a.get("color").size
          };
        }
        #A() {
          const a = new h.Outliner(this.#n, 1e-3);
          this.#h = a.getOutlines(), {
            x: this.x,
            y: this.y,
            width: this.width,
            height: this.height
          } = this.#h.box;
          const p = new h.Outliner(this.#n, 25e-4, 1e-3, this._uiManager.direction === "ltr");
          this.#i = p.getOutlines();
          const {
            lastPoint: b
          } = this.#i.box;
          this.#m = [(b[0] - this.x) / this.width, (b[1] - this.y) / this.height];
        }
        #_({
          highlightOutlines: a,
          highlightId: p,
          clipPathId: b
        }) {
          this.#h = a;
          const y = 1.5;
          if (this.#i = a.getNewOutline(this.#g / 2 + y, 25e-4), p >= 0)
            this.#d = p, this.#r = b, this.parent.drawLayer.finalizeLine(p, a), this.#f = this.parent.drawLayer.highlightOutline(this.#i);
          else if (this.parent) {
            const q = this.parent.viewport.rotation;
            this.parent.drawLayer.updateLine(this.#d, a), this.parent.drawLayer.updateBox(this.#d, f.#k(this.#h.box, (q - this.rotation + 360) % 360)), this.parent.drawLayer.updateLine(this.#f, this.#i), this.parent.drawLayer.updateBox(this.#f, f.#k(this.#i.box, q));
          }
          const {
            x: C,
            y: M,
            width: L,
            height: P
          } = a.box;
          switch (this.rotation) {
            case 0:
              this.x = C, this.y = M, this.width = L, this.height = P;
              break;
            case 90: {
              const [q, Y] = this.parentDimensions;
              this.x = M, this.y = 1 - C, this.width = L * Y / q, this.height = P * q / Y;
              break;
            }
            case 180:
              this.x = 1 - C, this.y = 1 - M, this.width = L, this.height = P;
              break;
            case 270: {
              const [q, Y] = this.parentDimensions;
              this.x = 1 - M, this.y = C, this.width = L * Y / q, this.height = P * q / Y;
              break;
            }
          }
          const {
            lastPoint: O
          } = this.#i.box;
          this.#m = [(O[0] - C) / L, (O[1] - M) / P];
        }
        static initialize(a, p) {
          r.AnnotationEditor.initialize(a, p), f._defaultColor ||= p.highlightColors?.values().next().value || "#fff066";
        }
        static updateDefaultParams(a, p) {
          switch (a) {
            case n.AnnotationEditorParamsType.HIGHLIGHT_DEFAULT_COLOR:
              f._defaultColor = p;
              break;
            case n.AnnotationEditorParamsType.HIGHLIGHT_THICKNESS:
              f._defaultThickness = p;
              break;
          }
        }
        translateInPage(a, p) {
        }
        get toolbarPosition() {
          return this.#m;
        }
        updateParams(a, p) {
          switch (a) {
            case n.AnnotationEditorParamsType.HIGHLIGHT_COLOR:
              this.#T(p);
              break;
            case n.AnnotationEditorParamsType.HIGHLIGHT_THICKNESS:
              this.#L(p);
              break;
          }
        }
        static get defaultPropertiesToUpdate() {
          return [[n.AnnotationEditorParamsType.HIGHLIGHT_DEFAULT_COLOR, f._defaultColor], [n.AnnotationEditorParamsType.HIGHLIGHT_THICKNESS, f._defaultThickness]];
        }
        get propertiesToUpdate() {
          return [[n.AnnotationEditorParamsType.HIGHLIGHT_COLOR, this.color || f._defaultColor], [n.AnnotationEditorParamsType.HIGHLIGHT_THICKNESS, this.#g || f._defaultThickness], [n.AnnotationEditorParamsType.HIGHLIGHT_FREE, this.#c]];
        }
        #T(a) {
          const p = (y) => {
            this.color = y, this.parent?.drawLayer.changeColor(this.#d, y), this.#s?.updateColor(y);
          }, b = this.color;
          this.addCommands({
            cmd: p.bind(this, a),
            undo: p.bind(this, b),
            post: this._uiManager.updateUI.bind(this._uiManager, this),
            mustExec: !0,
            type: n.AnnotationEditorParamsType.HIGHLIGHT_COLOR,
            overwriteIfSameType: !0,
            keepUndo: !0
          }), this._reportTelemetry({
            action: "color_changed",
            color: this._uiManager.highlightColorNames.get(a)
          }, !0);
        }
        #L(a) {
          const p = this.#g, b = (y) => {
            this.#g = y, this.#M(y);
          };
          this.addCommands({
            cmd: b.bind(this, a),
            undo: b.bind(this, p),
            post: this._uiManager.updateUI.bind(this._uiManager, this),
            mustExec: !0,
            type: n.AnnotationEditorParamsType.INK_THICKNESS,
            overwriteIfSameType: !0,
            keepUndo: !0
          }), this._reportTelemetry({
            action: "thickness_changed",
            thickness: a
          }, !0);
        }
        async addEditToolbar() {
          const a = await super.addEditToolbar();
          return a ? (this._uiManager.highlightColors && (this.#s = new d.ColorPicker({
            editor: this
          }), a.addColorPicker(this.#s)), a) : null;
        }
        disableEditing() {
          super.disableEditing(), this.div.classList.toggle("disabled", !0);
        }
        enableEditing() {
          super.enableEditing(), this.div.classList.toggle("disabled", !1);
        }
        fixAndSetPosition() {
          return super.fixAndSetPosition(this.#E());
        }
        getBaseTranslation() {
          return [0, 0];
        }
        getRect(a, p) {
          return super.getRect(a, p, this.#E());
        }
        onceAdded() {
          this.parent.addUndoableEditor(this), this.div.focus();
        }
        remove() {
          this.#w(), this._reportTelemetry({
            action: "deleted"
          }), super.remove();
        }
        rebuild() {
          this.parent && (super.rebuild(), this.div !== null && (this.#b(), this.isAttachedToDOM || this.parent.add(this)));
        }
        setParent(a) {
          let p = !1;
          this.parent && !a ? this.#w() : a && (this.#b(a), p = !this.parent && this.div?.classList.contains("selectedEditor")), super.setParent(a), this.show(this._isVisible), p && this.select();
        }
        #M(a) {
          if (!this.#c)
            return;
          this.#_({
            highlightOutlines: this.#h.getNewOutline(a / 2)
          }), this.fixAndSetPosition();
          const [p, b] = this.parentDimensions;
          this.setDims(this.width * p, this.height * b);
        }
        #w() {
          this.#d === null || !this.parent || (this.parent.drawLayer.remove(this.#d), this.#d = null, this.parent.drawLayer.remove(this.#f), this.#f = null);
        }
        #b(a = this.parent) {
          this.#d === null && ({
            id: this.#d,
            clipPathId: this.#r
          } = a.drawLayer.highlight(this.#h, this.color, this.#p), this.#f = a.drawLayer.highlightOutline(this.#i), this.#l && (this.#l.style.clipPath = this.#r));
        }
        static #k({
          x: a,
          y: p,
          width: b,
          height: y
        }, C) {
          switch (C) {
            case 90:
              return {
                x: 1 - p - y,
                y: a,
                width: y,
                height: b
              };
            case 180:
              return {
                x: 1 - a - b,
                y: 1 - p - y,
                width: b,
                height: y
              };
            case 270:
              return {
                x: p,
                y: 1 - a - b,
                width: y,
                height: b
              };
          }
          return {
            x: a,
            y: p,
            width: b,
            height: y
          };
        }
        rotate(a) {
          const {
            drawLayer: p
          } = this.parent;
          let b;
          this.#c ? (a = (a - this.rotation + 360) % 360, b = f.#k(this.#h.box, a)) : b = f.#k(this, a), p.rotate(this.#d, a), p.rotate(this.#f, a), p.updateBox(this.#d, b), p.updateBox(this.#f, f.#k(this.#i.box, a));
        }
        render() {
          if (this.div)
            return this.div;
          const a = super.render();
          this.#v && (a.setAttribute("aria-label", this.#v), a.setAttribute("role", "mark")), this.#c ? a.classList.add("free") : this.div.addEventListener("keydown", this.#o);
          const p = this.#l = document.createElement("div");
          a.append(p), p.setAttribute("aria-hidden", "true"), p.className = "internal", p.style.clipPath = this.#r;
          const [b, y] = this.parentDimensions;
          return this.setDims(this.width * b, this.height * y), (0, s.bindEvents)(this, this.#l, ["pointerover", "pointerleave"]), this.enableEditing(), a;
        }
        pointerover() {
          this.parent.drawLayer.addClass(this.#f, "hovered");
        }
        pointerleave() {
          this.parent.drawLayer.removeClass(this.#f, "hovered");
        }
        #S(a) {
          f._keyboardManager.exec(this, a);
        }
        _moveCaret(a) {
          switch (this.parent.unselect(this), a) {
            case 0:
            case 2:
              this.#C(!0);
              break;
            case 1:
            case 3:
              this.#C(!1);
              break;
          }
        }
        #C(a) {
          if (!this.#e)
            return;
          const p = window.getSelection();
          a ? p.setPosition(this.#e, this.#t) : p.setPosition(this.#a, this.#u);
        }
        select() {
          super.select(), this.#f && (this.parent?.drawLayer.removeClass(this.#f, "hovered"), this.parent?.drawLayer.addClass(this.#f, "selected"));
        }
        unselect() {
          super.unselect(), this.#f && (this.parent?.drawLayer.removeClass(this.#f, "selected"), this.#c || this.#C(!1));
        }
        get _mustFixPosition() {
          return !this.#c;
        }
        show(a = this._isVisible) {
          super.show(a), this.parent && (this.parent.drawLayer.show(this.#d, a), this.parent.drawLayer.show(this.#f, a));
        }
        #E() {
          return this.#c ? this.rotation : 0;
        }
        #R() {
          if (this.#c)
            return null;
          const [a, p] = this.pageDimensions, b = this.#n, y = new Array(b.length * 8);
          let C = 0;
          for (const {
            x: M,
            y: L,
            width: P,
            height: O
          } of b) {
            const q = M * a, Y = (1 - L - O) * p;
            y[C] = y[C + 4] = q, y[C + 1] = y[C + 3] = Y, y[C + 2] = y[C + 6] = q + P * a, y[C + 5] = y[C + 7] = Y + O * p, C += 8;
          }
          return y;
        }
        #D(a) {
          return this.#h.serialize(a, this.#E());
        }
        static startHighlighting(a, p, {
          target: b,
          x: y,
          y: C
        }) {
          const {
            x: M,
            y: L,
            width: P,
            height: O
          } = b.getBoundingClientRect(), q = (te) => {
            this.#I(a, te);
          }, Y = {
            capture: !0,
            passive: !1
          }, se = (te) => {
            te.preventDefault(), te.stopPropagation();
          }, me = (te) => {
            b.removeEventListener("pointermove", q), window.removeEventListener("blur", me), window.removeEventListener("pointerup", me), window.removeEventListener("pointerdown", se, Y), window.removeEventListener("contextmenu", c.noContextMenu), this.#F(a, te);
          };
          window.addEventListener("blur", me), window.addEventListener("pointerup", me), window.addEventListener("pointerdown", se, Y), window.addEventListener("contextmenu", c.noContextMenu), b.addEventListener("pointermove", q), this._freeHighlight = new h.FreeOutliner({
            x: y,
            y: C
          }, [M, L, P, O], a.scale, this._defaultThickness / 2, p, 1e-3), {
            id: this._freeHighlightId,
            clipPathId: this._freeHighlightClipId
          } = a.drawLayer.highlight(this._freeHighlight, this._defaultColor, this._defaultOpacity, !0);
        }
        static #I(a, p) {
          this._freeHighlight.add(p) && a.drawLayer.updatePath(this._freeHighlightId, this._freeHighlight);
        }
        static #F(a, p) {
          this._freeHighlight.isEmpty() ? a.drawLayer.removeFreeHighlight(this._freeHighlightId) : a.createAndAddNewEditor(p, !1, {
            highlightId: this._freeHighlightId,
            highlightOutlines: this._freeHighlight.getOutlines(),
            clipPathId: this._freeHighlightClipId,
            methodOfCreation: "main_toolbar"
          }), this._freeHighlightId = -1, this._freeHighlight = null, this._freeHighlightClipId = "";
        }
        static deserialize(a, p, b) {
          const y = super.deserialize(a, p, b), {
            rect: [C, M, L, P],
            color: O,
            quadPoints: q
          } = a;
          y.color = n.Util.makeHexColor(...O), y.#p = a.opacity;
          const [Y, se] = y.pageDimensions;
          y.width = (L - C) / Y, y.height = (P - M) / se;
          const me = y.#n = [];
          for (let te = 0; te < q.length; te += 8)
            me.push({
              x: (q[4] - L) / Y,
              y: (P - (1 - q[te + 5])) / se,
              width: (q[te + 2] - q[te]) / Y,
              height: (q[te + 5] - q[te + 1]) / se
            });
          return y.#A(), y;
        }
        serialize(a = !1) {
          if (this.isEmpty() || a)
            return null;
          const p = this.getRect(0, 0), b = r.AnnotationEditor._colorManager.convert(this.color);
          return {
            annotationType: n.AnnotationEditorType.HIGHLIGHT,
            color: b,
            opacity: this.#p,
            thickness: this.#g,
            quadPoints: this.#R(),
            outlines: this.#D(p),
            pageIndex: this.pageIndex,
            rect: p,
            rotation: this.#E(),
            structTreeParentId: this._structTreeParentId
          };
        }
        static canCreateNewEmptyEditor() {
          return !1;
        }
      }
      class g extends r.AnnotationEditor {
        #e = 0;
        #t = 0;
        #n = this.canvasPointermove.bind(this);
        #r = this.canvasPointerleave.bind(this);
        #s = this.canvasPointerup.bind(this);
        #i = this.canvasPointerdown.bind(this);
        #a = null;
        #u = new Path2D();
        #l = !1;
        #h = !1;
        #d = !1;
        #c = null;
        #o = 0;
        #m = 0;
        #p = null;
        static _defaultColor = null;
        static _defaultOpacity = 1;
        static _defaultThickness = 1;
        static _type = "ink";
        static _editorType = n.AnnotationEditorType.INK;
        constructor(a) {
          super({
            ...a,
            name: "inkEditor"
          }), this.color = a.color || null, this.thickness = a.thickness || null, this.opacity = a.opacity || null, this.paths = [], this.bezierPath2D = [], this.allRawPaths = [], this.currentPath = [], this.scaleFactor = 1, this.translationX = this.translationY = 0, this.x = 0, this.y = 0, this._willKeepAspectRatio = !0;
        }
        static initialize(a, p) {
          r.AnnotationEditor.initialize(a, p);
        }
        static updateDefaultParams(a, p) {
          switch (a) {
            case n.AnnotationEditorParamsType.INK_THICKNESS:
              g._defaultThickness = p;
              break;
            case n.AnnotationEditorParamsType.INK_COLOR:
              g._defaultColor = p;
              break;
            case n.AnnotationEditorParamsType.INK_OPACITY:
              g._defaultOpacity = p / 100;
              break;
          }
        }
        updateParams(a, p) {
          switch (a) {
            case n.AnnotationEditorParamsType.INK_THICKNESS:
              this.#f(p);
              break;
            case n.AnnotationEditorParamsType.INK_COLOR:
              this.#v(p);
              break;
            case n.AnnotationEditorParamsType.INK_OPACITY:
              this.#g(p);
              break;
          }
        }
        static get defaultPropertiesToUpdate() {
          return [[n.AnnotationEditorParamsType.INK_THICKNESS, g._defaultThickness], [n.AnnotationEditorParamsType.INK_COLOR, g._defaultColor || r.AnnotationEditor._defaultLineColor], [n.AnnotationEditorParamsType.INK_OPACITY, Math.round(g._defaultOpacity * 100)]];
        }
        get propertiesToUpdate() {
          return [[n.AnnotationEditorParamsType.INK_THICKNESS, this.thickness || g._defaultThickness], [n.AnnotationEditorParamsType.INK_COLOR, this.color || g._defaultColor || r.AnnotationEditor._defaultLineColor], [n.AnnotationEditorParamsType.INK_OPACITY, Math.round(100 * (this.opacity ?? g._defaultOpacity))]];
        }
        #f(a) {
          const p = (y) => {
            this.thickness = y, this.#P();
          }, b = this.thickness;
          this.addCommands({
            cmd: p.bind(this, a),
            undo: p.bind(this, b),
            post: this._uiManager.updateUI.bind(this._uiManager, this),
            mustExec: !0,
            type: n.AnnotationEditorParamsType.INK_THICKNESS,
            overwriteIfSameType: !0,
            keepUndo: !0
          });
        }
        #v(a) {
          const p = (y) => {
            this.color = y, this.#S();
          }, b = this.color;
          this.addCommands({
            cmd: p.bind(this, a),
            undo: p.bind(this, b),
            post: this._uiManager.updateUI.bind(this._uiManager, this),
            mustExec: !0,
            type: n.AnnotationEditorParamsType.INK_COLOR,
            overwriteIfSameType: !0,
            keepUndo: !0
          });
        }
        #g(a) {
          const p = (y) => {
            this.opacity = y, this.#S();
          };
          a /= 100;
          const b = this.opacity;
          this.addCommands({
            cmd: p.bind(this, a),
            undo: p.bind(this, b),
            post: this._uiManager.updateUI.bind(this._uiManager, this),
            mustExec: !0,
            type: n.AnnotationEditorParamsType.INK_OPACITY,
            overwriteIfSameType: !0,
            keepUndo: !0
          });
        }
        rebuild() {
          this.parent && (super.rebuild(), this.div !== null && (this.canvas || (this.#E(), this.#R()), this.isAttachedToDOM || (this.parent.add(this), this.#D()), this.#P()));
        }
        remove() {
          this.canvas !== null && (this.isEmpty() || this.commit(), this.canvas.width = this.canvas.height = 0, this.canvas.remove(), this.canvas = null, this.#a && (clearTimeout(this.#a), this.#a = null), this.#c.disconnect(), this.#c = null, super.remove());
        }
        setParent(a) {
          !this.parent && a ? this._uiManager.removeShouldRescale(this) : this.parent && a === null && this._uiManager.addShouldRescale(this), super.setParent(a);
        }
        onScaleChanging() {
          const [a, p] = this.parentDimensions, b = this.width * a, y = this.height * p;
          this.setDimensions(b, y);
        }
        enableEditMode() {
          this.#l || this.canvas === null || (super.enableEditMode(), this._isDraggable = !1, this.canvas.addEventListener("pointerdown", this.#i));
        }
        disableEditMode() {
          !this.isInEditMode() || this.canvas === null || (super.disableEditMode(), this._isDraggable = !this.isEmpty(), this.div.classList.remove("editing"), this.canvas.removeEventListener("pointerdown", this.#i));
        }
        onceAdded() {
          this._isDraggable = !this.isEmpty();
        }
        isEmpty() {
          return this.paths.length === 0 || this.paths.length === 1 && this.paths[0].length === 0;
        }
        #y() {
          const {
            parentRotation: a,
            parentDimensions: [p, b]
          } = this;
          switch (a) {
            case 90:
              return [0, b, b, p];
            case 180:
              return [p, b, p, b];
            case 270:
              return [p, 0, b, p];
            default:
              return [0, 0, p, b];
          }
        }
        #A() {
          const {
            ctx: a,
            color: p,
            opacity: b,
            thickness: y,
            parentScale: C,
            scaleFactor: M
          } = this;
          a.lineWidth = y * C / M, a.lineCap = "round", a.lineJoin = "round", a.miterLimit = 10, a.strokeStyle = `${p}${(0, s.opacityToHex)(b)}`;
        }
        #_(a, p) {
          this.canvas.addEventListener("contextmenu", c.noContextMenu), this.canvas.addEventListener("pointerleave", this.#r), this.canvas.addEventListener("pointermove", this.#n), this.canvas.addEventListener("pointerup", this.#s), this.canvas.removeEventListener("pointerdown", this.#i), this.isEditing = !0, this.#d || (this.#d = !0, this.#D(), this.thickness ||= g._defaultThickness, this.color ||= g._defaultColor || r.AnnotationEditor._defaultLineColor, this.opacity ??= g._defaultOpacity), this.currentPath.push([a, p]), this.#h = !1, this.#A(), this.#p = () => {
            this.#w(), this.#p && window.requestAnimationFrame(this.#p);
          }, window.requestAnimationFrame(this.#p);
        }
        #T(a, p) {
          const [b, y] = this.currentPath.at(-1);
          if (this.currentPath.length > 1 && a === b && p === y)
            return;
          const C = this.currentPath;
          let M = this.#u;
          if (C.push([a, p]), this.#h = !0, C.length <= 2) {
            M.moveTo(...C[0]), M.lineTo(a, p);
            return;
          }
          C.length === 3 && (this.#u = M = new Path2D(), M.moveTo(...C[0])), this.#b(M, ...C.at(-3), ...C.at(-2), a, p);
        }
        #L() {
          if (this.currentPath.length === 0)
            return;
          const a = this.currentPath.at(-1);
          this.#u.lineTo(...a);
        }
        #M(a, p) {
          this.#p = null, a = Math.min(Math.max(a, 0), this.canvas.width), p = Math.min(Math.max(p, 0), this.canvas.height), this.#T(a, p), this.#L();
          let b;
          if (this.currentPath.length !== 1)
            b = this.#k();
          else {
            const P = [a, p];
            b = [[P, P.slice(), P.slice(), P]];
          }
          const y = this.#u, C = this.currentPath;
          this.currentPath = [], this.#u = new Path2D();
          const M = () => {
            this.allRawPaths.push(C), this.paths.push(b), this.bezierPath2D.push(y), this._uiManager.rebuild(this);
          }, L = () => {
            this.allRawPaths.pop(), this.paths.pop(), this.bezierPath2D.pop(), this.paths.length === 0 ? this.remove() : (this.canvas || (this.#E(), this.#R()), this.#P());
          };
          this.addCommands({
            cmd: M,
            undo: L,
            mustExec: !0
          });
        }
        #w() {
          if (!this.#h)
            return;
          this.#h = !1;
          const a = Math.ceil(this.thickness * this.parentScale), p = this.currentPath.slice(-3), b = p.map((M) => M[0]), y = p.map((M) => M[1]);
          Math.min(...b) - a, Math.max(...b) + a, Math.min(...y) - a, Math.max(...y) + a;
          const {
            ctx: C
          } = this;
          C.save(), C.clearRect(0, 0, this.canvas.width, this.canvas.height);
          for (const M of this.bezierPath2D)
            C.stroke(M);
          C.stroke(this.#u), C.restore();
        }
        #b(a, p, b, y, C, M, L) {
          const P = (p + y) / 2, O = (b + C) / 2, q = (y + M) / 2, Y = (C + L) / 2;
          a.bezierCurveTo(P + 2 * (y - P) / 3, O + 2 * (C - O) / 3, q + 2 * (y - q) / 3, Y + 2 * (C - Y) / 3, q, Y);
        }
        #k() {
          const a = this.currentPath;
          if (a.length <= 2)
            return [[a[0], a[0], a.at(-1), a.at(-1)]];
          const p = [];
          let b, [y, C] = a[0];
          for (b = 1; b < a.length - 2; b++) {
            const [se, me] = a[b], [te, K] = a[b + 1], Z = (se + te) / 2, oe = (me + K) / 2, le = [y + 2 * (se - y) / 3, C + 2 * (me - C) / 3], ie = [Z + 2 * (se - Z) / 3, oe + 2 * (me - oe) / 3];
            p.push([[y, C], le, ie, [Z, oe]]), [y, C] = [Z, oe];
          }
          const [M, L] = a[b], [P, O] = a[b + 1], q = [y + 2 * (M - y) / 3, C + 2 * (L - C) / 3], Y = [P + 2 * (M - P) / 3, O + 2 * (L - O) / 3];
          return p.push([[y, C], q, Y, [P, O]]), p;
        }
        #S() {
          if (this.isEmpty()) {
            this.#F();
            return;
          }
          this.#A();
          const {
            canvas: a,
            ctx: p
          } = this;
          p.setTransform(1, 0, 0, 1, 0, 0), p.clearRect(0, 0, a.width, a.height), this.#F();
          for (const b of this.bezierPath2D)
            p.stroke(b);
        }
        commit() {
          this.#l || (super.commit(), this.isEditing = !1, this.disableEditMode(), this.setInForeground(), this.#l = !0, this.div.classList.add("disabled"), this.#P(!0), this.select(), this.parent.addInkEditorIfNeeded(!0), this.moveInDOM(), this.div.focus({
            preventScroll: !0
          }));
        }
        focusin(a) {
          this._focusEventsAllowed && (super.focusin(a), this.enableEditMode());
        }
        canvasPointerdown(a) {
          a.button !== 0 || !this.isInEditMode() || this.#l || (this.setInForeground(), a.preventDefault(), this.div.contains(document.activeElement) || this.div.focus({
            preventScroll: !0
          }), this.#_(a.offsetX, a.offsetY));
        }
        canvasPointermove(a) {
          a.preventDefault(), this.#T(a.offsetX, a.offsetY);
        }
        canvasPointerup(a) {
          a.preventDefault(), this.#C(a);
        }
        canvasPointerleave(a) {
          this.#C(a);
        }
        #C(a) {
          this.canvas.removeEventListener("pointerleave", this.#r), this.canvas.removeEventListener("pointermove", this.#n), this.canvas.removeEventListener("pointerup", this.#s), this.canvas.addEventListener("pointerdown", this.#i), this.#a && clearTimeout(this.#a), this.#a = setTimeout(() => {
            this.#a = null, this.canvas.removeEventListener("contextmenu", c.noContextMenu);
          }, 10), this.#M(a.offsetX, a.offsetY), this.addToAnnotationStorage(), this.setInBackground();
        }
        #E() {
          this.canvas = document.createElement("canvas"), this.canvas.width = this.canvas.height = 0, this.canvas.className = "inkEditorCanvas", this.canvas.setAttribute("data-l10n-id", "pdfjs-ink-canvas"), this.div.append(this.canvas), this.ctx = this.canvas.getContext("2d");
        }
        #R() {
          this.#c = new ResizeObserver((a) => {
            const p = a[0].contentRect;
            p.width && p.height && this.setDimensions(p.width, p.height);
          }), this.#c.observe(this.div);
        }
        get isResizable() {
          return !this.isEmpty() && this.#l;
        }
        render() {
          if (this.div)
            return this.div;
          let a, p;
          this.width && (a = this.x, p = this.y), super.render(), this.div.setAttribute("data-l10n-id", "pdfjs-ink");
          const [b, y, C, M] = this.#y();
          if (this.setAt(b, y, 0, 0), this.setDims(C, M), this.#E(), this.width) {
            const [L, P] = this.parentDimensions;
            this.setAspectRatio(this.width * L, this.height * P), this.setAt(a * L, p * P, this.width * L, this.height * P), this.#d = !0, this.#D(), this.setDims(this.width * L, this.height * P), this.#S(), this.div.classList.add("disabled");
          } else
            this.div.classList.add("editing"), this.enableEditMode();
          return this.#R(), this.div;
        }
        #D() {
          if (!this.#d)
            return;
          const [a, p] = this.parentDimensions;
          this.canvas.width = Math.ceil(this.width * a), this.canvas.height = Math.ceil(this.height * p), this.#F();
        }
        setDimensions(a, p) {
          const b = Math.round(a), y = Math.round(p);
          if (this.#o === b && this.#m === y)
            return;
          this.#o = b, this.#m = y, this.canvas.style.visibility = "hidden";
          const [C, M] = this.parentDimensions;
          this.width = a / C, this.height = p / M, this.fixAndSetPosition(), this.#l && this.#I(a, p), this.#D(), this.#S(), this.canvas.style.visibility = "visible", this.fixDims();
        }
        #I(a, p) {
          const b = this.#O(), y = (a - b) / this.#t, C = (p - b) / this.#e;
          this.scaleFactor = Math.min(y, C);
        }
        #F() {
          const a = this.#O() / 2;
          this.ctx.setTransform(this.scaleFactor, 0, 0, this.scaleFactor, this.translationX * this.scaleFactor + a, this.translationY * this.scaleFactor + a);
        }
        static #N(a) {
          const p = new Path2D();
          for (let b = 0, y = a.length; b < y; b++) {
            const [C, M, L, P] = a[b];
            b === 0 && p.moveTo(...C), p.bezierCurveTo(M[0], M[1], L[0], L[1], P[0], P[1]);
          }
          return p;
        }
        static #q(a, p, b) {
          const [y, C, M, L] = p;
          switch (b) {
            case 0:
              for (let P = 0, O = a.length; P < O; P += 2)
                a[P] += y, a[P + 1] = L - a[P + 1];
              break;
            case 90:
              for (let P = 0, O = a.length; P < O; P += 2) {
                const q = a[P];
                a[P] = a[P + 1] + y, a[P + 1] = q + C;
              }
              break;
            case 180:
              for (let P = 0, O = a.length; P < O; P += 2)
                a[P] = M - a[P], a[P + 1] += C;
              break;
            case 270:
              for (let P = 0, O = a.length; P < O; P += 2) {
                const q = a[P];
                a[P] = M - a[P + 1], a[P + 1] = L - q;
              }
              break;
            default:
              throw new Error("Invalid rotation");
          }
          return a;
        }
        static #G(a, p, b) {
          const [y, C, M, L] = p;
          switch (b) {
            case 0:
              for (let P = 0, O = a.length; P < O; P += 2)
                a[P] -= y, a[P + 1] = L - a[P + 1];
              break;
            case 90:
              for (let P = 0, O = a.length; P < O; P += 2) {
                const q = a[P];
                a[P] = a[P + 1] - C, a[P + 1] = q - y;
              }
              break;
            case 180:
              for (let P = 0, O = a.length; P < O; P += 2)
                a[P] = M - a[P], a[P + 1] -= C;
              break;
            case 270:
              for (let P = 0, O = a.length; P < O; P += 2) {
                const q = a[P];
                a[P] = L - a[P + 1], a[P + 1] = M - q;
              }
              break;
            default:
              throw new Error("Invalid rotation");
          }
          return a;
        }
        #X(a, p, b, y) {
          const C = [], M = this.thickness / 2, L = a * p + M, P = a * b + M;
          for (const O of this.paths) {
            const q = [], Y = [];
            for (let se = 0, me = O.length; se < me; se++) {
              const [te, K, Z, oe] = O[se];
              if (te[0] === oe[0] && te[1] === oe[1] && me === 1) {
                const de = a * te[0] + L, R = a * te[1] + P;
                q.push(de, R), Y.push(de, R);
                break;
              }
              const le = a * te[0] + L, ie = a * te[1] + P, pe = a * K[0] + L, he = a * K[1] + P, we = a * Z[0] + L, ke = a * Z[1] + P, Ae = a * oe[0] + L, ae = a * oe[1] + P;
              se === 0 && (q.push(le, ie), Y.push(le, ie)), q.push(pe, he, we, ke, Ae, ae), Y.push(pe, he), se === me - 1 && Y.push(Ae, ae);
            }
            C.push({
              bezier: g.#q(q, y, this.rotation),
              points: g.#q(Y, y, this.rotation)
            });
          }
          return C;
        }
        #U() {
          let a = 1 / 0, p = -1 / 0, b = 1 / 0, y = -1 / 0;
          for (const C of this.paths)
            for (const [M, L, P, O] of C) {
              const q = n.Util.bezierBoundingBox(...M, ...L, ...P, ...O);
              a = Math.min(a, q[0]), b = Math.min(b, q[1]), p = Math.max(p, q[2]), y = Math.max(y, q[3]);
            }
          return [a, b, p, y];
        }
        #O() {
          return this.#l ? Math.ceil(this.thickness * this.parentScale) : 0;
        }
        #P(a = !1) {
          if (this.isEmpty())
            return;
          if (!this.#l) {
            this.#S();
            return;
          }
          const p = this.#U(), b = this.#O();
          this.#t = Math.max(r.AnnotationEditor.MIN_SIZE, p[2] - p[0]), this.#e = Math.max(r.AnnotationEditor.MIN_SIZE, p[3] - p[1]);
          const y = Math.ceil(b + this.#t * this.scaleFactor), C = Math.ceil(b + this.#e * this.scaleFactor), [M, L] = this.parentDimensions;
          this.width = y / M, this.height = C / L, this.setAspectRatio(y, C);
          const P = this.translationX, O = this.translationY;
          this.translationX = -p[0], this.translationY = -p[1], this.#D(), this.#S(), this.#o = y, this.#m = C, this.setDims(y, C);
          const q = a ? b / this.scaleFactor / 2 : 0;
          this.translate(P - this.translationX - q, O - this.translationY - q);
        }
        static deserialize(a, p, b) {
          if (a instanceof u.InkAnnotationElement)
            return null;
          const y = super.deserialize(a, p, b);
          y.thickness = a.thickness, y.color = n.Util.makeHexColor(...a.color), y.opacity = a.opacity;
          const [C, M] = y.pageDimensions, L = y.width * C, P = y.height * M, O = y.parentScale, q = a.thickness / 2;
          y.#l = !0, y.#o = Math.round(L), y.#m = Math.round(P);
          const {
            paths: Y,
            rect: se,
            rotation: me
          } = a;
          for (let {
            bezier: K
          } of Y) {
            K = g.#G(K, se, me);
            const Z = [];
            y.paths.push(Z);
            let oe = O * (K[0] - q), le = O * (K[1] - q);
            for (let pe = 2, he = K.length; pe < he; pe += 6) {
              const we = O * (K[pe] - q), ke = O * (K[pe + 1] - q), Ae = O * (K[pe + 2] - q), ae = O * (K[pe + 3] - q), de = O * (K[pe + 4] - q), R = O * (K[pe + 5] - q);
              Z.push([[oe, le], [we, ke], [Ae, ae], [de, R]]), oe = de, le = R;
            }
            const ie = this.#N(Z);
            y.bezierPath2D.push(ie);
          }
          const te = y.#U();
          return y.#t = Math.max(r.AnnotationEditor.MIN_SIZE, te[2] - te[0]), y.#e = Math.max(r.AnnotationEditor.MIN_SIZE, te[3] - te[1]), y.#I(L, P), y;
        }
        serialize() {
          if (this.isEmpty())
            return null;
          const a = this.getRect(0, 0), p = r.AnnotationEditor._colorManager.convert(this.ctx.strokeStyle);
          return {
            annotationType: n.AnnotationEditorType.INK,
            color: p,
            thickness: this.thickness,
            opacity: this.opacity,
            paths: this.#X(this.scaleFactor / this.parentScale, this.translationX, this.translationY, a),
            pageIndex: this.pageIndex,
            rect: a,
            rotation: this.rotation,
            structTreeParentId: this._structTreeParentId
          };
        }
      }
      class A extends r.AnnotationEditor {
        #e = null;
        #t = null;
        #n = null;
        #r = null;
        #s = null;
        #i = "";
        #a = null;
        #u = null;
        #l = null;
        #h = !1;
        #d = !1;
        static _type = "stamp";
        static _editorType = n.AnnotationEditorType.STAMP;
        constructor(a) {
          super({
            ...a,
            name: "stampEditor"
          }), this.#r = a.bitmapUrl, this.#s = a.bitmapFile;
        }
        static initialize(a, p) {
          r.AnnotationEditor.initialize(a, p);
        }
        static get supportedTypes() {
          const a = ["apng", "avif", "bmp", "gif", "jpeg", "png", "svg+xml", "webp", "x-icon"];
          return (0, n.shadow)(this, "supportedTypes", a.map((p) => `image/${p}`));
        }
        static get supportedTypesStr() {
          return (0, n.shadow)(this, "supportedTypesStr", this.supportedTypes.join(","));
        }
        static isHandlingMimeForPasting(a) {
          return this.supportedTypes.includes(a);
        }
        static paste(a, p) {
          p.pasteEditor(n.AnnotationEditorType.STAMP, {
            bitmapFile: a.getAsFile()
          });
        }
        #c(a, p = !1) {
          if (!a) {
            this.remove();
            return;
          }
          this.#e = a.bitmap, p || (this.#t = a.id, this.#h = a.isSvg), a.file && (this.#i = a.file.name), this.#p();
        }
        #o() {
          this.#n = null, this._uiManager.enableWaiting(!1), this.#a && this.div.focus();
        }
        #m() {
          if (this.#t) {
            this._uiManager.enableWaiting(!0), this._uiManager.imageManager.getFromId(this.#t).then((p) => this.#c(p, !0)).finally(() => this.#o());
            return;
          }
          if (this.#r) {
            const p = this.#r;
            this.#r = null, this._uiManager.enableWaiting(!0), this.#n = this._uiManager.imageManager.getFromUrl(p).then((b) => this.#c(b)).finally(() => this.#o());
            return;
          }
          if (this.#s) {
            const p = this.#s;
            this.#s = null, this._uiManager.enableWaiting(!0), this.#n = this._uiManager.imageManager.getFromFile(p).then((b) => this.#c(b)).finally(() => this.#o());
            return;
          }
          const a = document.createElement("input");
          a.type = "file", a.accept = A.supportedTypesStr, this.#n = new Promise((p) => {
            a.addEventListener("change", async () => {
              if (!a.files || a.files.length === 0)
                this.remove();
              else {
                this._uiManager.enableWaiting(!0);
                const b = await this._uiManager.imageManager.getFromFile(a.files[0]);
                this.#c(b);
              }
              p();
            }), a.addEventListener("cancel", () => {
              this.remove(), p();
            });
          }).finally(() => this.#o()), a.click();
        }
        remove() {
          this.#t && (this.#e = null, this._uiManager.imageManager.deleteId(this.#t), this.#a?.remove(), this.#a = null, this.#u?.disconnect(), this.#u = null, this.#l && (clearTimeout(this.#l), this.#l = null)), super.remove();
        }
        rebuild() {
          if (!this.parent) {
            this.#t && this.#m();
            return;
          }
          super.rebuild(), this.div !== null && (this.#t && this.#a === null && this.#m(), this.isAttachedToDOM || this.parent.add(this));
        }
        onceAdded() {
          this._isDraggable = !0, this.div.focus();
        }
        isEmpty() {
          return !(this.#n || this.#e || this.#r || this.#s || this.#t);
        }
        get isResizable() {
          return !0;
        }
        render() {
          if (this.div)
            return this.div;
          let a, p;
          if (this.width && (a = this.x, p = this.y), super.render(), this.div.hidden = !0, this.addAltTextButton(), this.#e ? this.#p() : this.#m(), this.width) {
            const [b, y] = this.parentDimensions;
            this.setAt(a * b, p * y, this.width * b, this.height * y);
          }
          return this.div;
        }
        #p() {
          const {
            div: a
          } = this;
          let {
            width: p,
            height: b
          } = this.#e;
          const [y, C] = this.pageDimensions, M = 0.75;
          if (this.width)
            p = this.width * y, b = this.height * C;
          else if (p > M * y || b > M * C) {
            const q = Math.min(M * y / p, M * C / b);
            p *= q, b *= q;
          }
          const [L, P] = this.parentDimensions;
          this.setDims(p * L / y, b * P / C), this._uiManager.enableWaiting(!1);
          const O = this.#a = document.createElement("canvas");
          a.append(O), a.hidden = !1, this.#g(p, b), this.#A(), this.#d || (this.parent.addUndoableEditor(this), this.#d = !0), this._reportTelemetry({
            action: "inserted_image"
          }), this.#i && O.setAttribute("aria-label", this.#i);
        }
        #f(a, p) {
          const [b, y] = this.parentDimensions;
          this.width = a / b, this.height = p / y, this.setDims(a, p), this._initialOptions?.isCentered ? this.center() : this.fixAndSetPosition(), this._initialOptions = null, this.#l !== null && clearTimeout(this.#l);
          const C = 200;
          this.#l = setTimeout(() => {
            this.#l = null, this.#g(a, p);
          }, C);
        }
        #v(a, p) {
          const {
            width: b,
            height: y
          } = this.#e;
          let C = b, M = y, L = this.#e;
          for (; C > 2 * a || M > 2 * p; ) {
            const P = C, O = M;
            C > 2 * a && (C = C >= 16384 ? Math.floor(C / 2) - 1 : Math.ceil(C / 2)), M > 2 * p && (M = M >= 16384 ? Math.floor(M / 2) - 1 : Math.ceil(M / 2));
            const q = new OffscreenCanvas(C, M);
            q.getContext("2d").drawImage(L, 0, 0, P, O, 0, 0, C, M), L = q.transferToImageBitmap();
          }
          return L;
        }
        #g(a, p) {
          a = Math.ceil(a), p = Math.ceil(p);
          const b = this.#a;
          if (!b || b.width === a && b.height === p)
            return;
          b.width = a, b.height = p;
          const y = this.#h ? this.#e : this.#v(a, p);
          if (this._uiManager.hasMLManager && !this.hasAltText()) {
            const M = new OffscreenCanvas(a, p);
            M.getContext("2d").drawImage(y, 0, 0, y.width, y.height, 0, 0, a, p), M.convertToBlob().then((P) => {
              const O = new FileReader();
              O.onload = () => {
                const q = O.result;
                this._uiManager.mlGuess({
                  service: "image-to-text",
                  request: {
                    imageData: q
                  }
                }).then((Y) => {
                  const se = Y?.output || "";
                  this.parent && se && !this.hasAltText() && (this.altTextData = {
                    altText: se,
                    decorative: !1
                  });
                });
              }, O.readAsDataURL(P);
            });
          }
          const C = b.getContext("2d");
          C.filter = this._uiManager.hcmFilter, C.drawImage(y, 0, 0, y.width, y.height, 0, 0, a, p);
        }
        getImageForAltText() {
          return this.#a;
        }
        #y(a) {
          if (a) {
            if (this.#h) {
              const y = this._uiManager.imageManager.getSvgUrl(this.#t);
              if (y)
                return y;
            }
            const p = document.createElement("canvas");
            return {
              width: p.width,
              height: p.height
            } = this.#e, p.getContext("2d").drawImage(this.#e, 0, 0), p.toDataURL();
          }
          if (this.#h) {
            const [p, b] = this.pageDimensions, y = Math.round(this.width * p * c.PixelsPerInch.PDF_TO_CSS_UNITS), C = Math.round(this.height * b * c.PixelsPerInch.PDF_TO_CSS_UNITS), M = new OffscreenCanvas(y, C);
            return M.getContext("2d").drawImage(this.#e, 0, 0, this.#e.width, this.#e.height, 0, 0, y, C), M.transferToImageBitmap();
          }
          return structuredClone(this.#e);
        }
        #A() {
          this.#u = new ResizeObserver((a) => {
            const p = a[0].contentRect;
            p.width && p.height && this.#f(p.width, p.height);
          }), this.#u.observe(this.div);
        }
        static deserialize(a, p, b) {
          if (a instanceof u.StampAnnotationElement)
            return null;
          const y = super.deserialize(a, p, b), {
            rect: C,
            bitmapUrl: M,
            bitmapId: L,
            isSvg: P,
            accessibilityData: O
          } = a;
          L && b.imageManager.isValidId(L) ? y.#t = L : y.#r = M, y.#h = P;
          const [q, Y] = y.pageDimensions;
          return y.width = (C[2] - C[0]) / q, y.height = (C[3] - C[1]) / Y, O && (y.altTextData = O), y;
        }
        serialize(a = !1, p = null) {
          if (this.isEmpty())
            return null;
          const b = {
            annotationType: n.AnnotationEditorType.STAMP,
            bitmapId: this.#t,
            pageIndex: this.pageIndex,
            rect: this.getRect(0, 0),
            rotation: this.rotation,
            isSvg: this.#h,
            structTreeParentId: this._structTreeParentId
          };
          if (a)
            return b.bitmapUrl = this.#y(!0), b.accessibilityData = this.altTextData, b;
          const {
            decorative: y,
            altText: C
          } = this.altTextData;
          if (!y && C && (b.accessibilityData = {
            type: "Figure",
            alt: C
          }), p === null)
            return b;
          p.stamps ||= /* @__PURE__ */ new Map();
          const M = this.#h ? (b.rect[2] - b.rect[0]) * (b.rect[3] - b.rect[1]) : null;
          if (!p.stamps.has(this.#t))
            p.stamps.set(this.#t, {
              area: M,
              serialized: b
            }), b.bitmap = this.#y(!1);
          else if (this.#h) {
            const L = p.stamps.get(this.#t);
            M > L.area && (L.area = M, L.serialized.bitmap.close(), L.serialized.bitmap = this.#y(!1));
          }
          return b;
        }
      }
      class m {
        #e;
        #t = !1;
        #n = null;
        #r = null;
        #s = null;
        #i = null;
        #a = null;
        #u = /* @__PURE__ */ new Map();
        #l = !1;
        #h = !1;
        #d = !1;
        #c = null;
        #o;
        static _initialized = !1;
        static #m = new Map([o, g, A, f].map((a) => [a._editorType, a]));
        constructor({
          uiManager: a,
          pageIndex: p,
          div: b,
          accessibilityManager: y,
          annotationLayer: C,
          drawLayer: M,
          textLayer: L,
          viewport: P,
          l10n: O
        }) {
          const q = [...m.#m.values()];
          if (!m._initialized) {
            m._initialized = !0;
            for (const Y of q)
              Y.initialize(O, a);
          }
          a.registerEditorTypes(q), this.#o = a, this.pageIndex = p, this.div = b, this.#e = y, this.#n = C, this.viewport = P, this.#c = L, this.drawLayer = M, this.#o.addLayer(this);
        }
        get isEmpty() {
          return this.#u.size === 0;
        }
        get isInvisible() {
          return this.isEmpty && this.#o.getMode() === n.AnnotationEditorType.NONE;
        }
        updateToolbar(a) {
          this.#o.updateToolbar(a);
        }
        updateMode(a = this.#o.getMode()) {
          switch (this.#y(), a) {
            case n.AnnotationEditorType.NONE:
              this.disableTextSelection(), this.togglePointerEvents(!1), this.toggleAnnotationLayerPointerEvents(!0), this.disableClick();
              return;
            case n.AnnotationEditorType.INK:
              this.addInkEditorIfNeeded(!1), this.disableTextSelection(), this.togglePointerEvents(!0), this.disableClick();
              break;
            case n.AnnotationEditorType.HIGHLIGHT:
              this.enableTextSelection(), this.togglePointerEvents(!1), this.disableClick();
              break;
            default:
              this.disableTextSelection(), this.togglePointerEvents(!0), this.enableClick();
          }
          this.toggleAnnotationLayerPointerEvents(!1);
          const {
            classList: p
          } = this.div;
          for (const b of m.#m.values())
            p.toggle(`${b._type}Editing`, a === b._editorType);
          this.div.hidden = !1;
        }
        hasTextLayer(a) {
          return a === this.#c?.div;
        }
        addInkEditorIfNeeded(a) {
          if (this.#o.getMode() !== n.AnnotationEditorType.INK)
            return;
          if (!a) {
            for (const b of this.#u.values())
              if (b.isEmpty()) {
                b.setInBackground();
                return;
              }
          }
          this.createAndAddNewEditor({
            offsetX: 0,
            offsetY: 0
          }, !1).setInBackground();
        }
        setEditingState(a) {
          this.#o.setEditingState(a);
        }
        addCommands(a) {
          this.#o.addCommands(a);
        }
        togglePointerEvents(a = !1) {
          this.div.classList.toggle("disabled", !a);
        }
        toggleAnnotationLayerPointerEvents(a = !1) {
          this.#n?.div.classList.toggle("disabled", !a);
        }
        enable() {
          this.div.tabIndex = 0, this.togglePointerEvents(!0);
          const a = /* @__PURE__ */ new Set();
          for (const b of this.#u.values())
            b.enableEditing(), b.show(!0), b.annotationElementId && (this.#o.removeChangedExistingAnnotation(b), a.add(b.annotationElementId));
          if (!this.#n)
            return;
          const p = this.#n.getEditableAnnotations();
          for (const b of p) {
            if (b.hide(), this.#o.isDeletedAnnotationElement(b.data.id) || a.has(b.data.id))
              continue;
            const y = this.deserialize(b);
            y && (this.addOrRebuild(y), y.enableEditing());
          }
        }
        disable() {
          this.#d = !0, this.div.tabIndex = -1, this.togglePointerEvents(!1);
          const a = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map();
          for (const y of this.#u.values())
            if (y.disableEditing(), !!y.annotationElementId) {
              if (y.serialize() !== null) {
                a.set(y.annotationElementId, y);
                continue;
              } else
                p.set(y.annotationElementId, y);
              this.getEditableAnnotation(y.annotationElementId)?.show(), y.remove();
            }
          if (this.#n) {
            const y = this.#n.getEditableAnnotations();
            for (const C of y) {
              const {
                id: M
              } = C.data;
              if (this.#o.isDeletedAnnotationElement(M))
                continue;
              let L = p.get(M);
              if (L) {
                L.resetAnnotationElement(C), L.show(!1), C.show();
                continue;
              }
              L = a.get(M), L && (this.#o.addChangedExistingAnnotation(L), L.renderAnnotationElement(C), L.show(!1)), C.show();
            }
          }
          this.#y(), this.isEmpty && (this.div.hidden = !0);
          const {
            classList: b
          } = this.div;
          for (const y of m.#m.values())
            b.remove(`${y._type}Editing`);
          this.disableTextSelection(), this.toggleAnnotationLayerPointerEvents(!0), this.#d = !1;
        }
        getEditableAnnotation(a) {
          return this.#n?.getEditableAnnotation(a) || null;
        }
        setActiveEditor(a) {
          this.#o.getActive() !== a && this.#o.setActiveEditor(a);
        }
        enableTextSelection() {
          this.div.tabIndex = -1, this.#c?.div && !this.#i && (this.#i = this.#p.bind(this), this.#c.div.addEventListener("pointerdown", this.#i), this.#c.div.classList.add("highlighting"));
        }
        disableTextSelection() {
          this.div.tabIndex = 0, this.#c?.div && this.#i && (this.#c.div.removeEventListener("pointerdown", this.#i), this.#i = null, this.#c.div.classList.remove("highlighting"));
        }
        #p(a) {
          if (this.#o.unselectAll(), a.target === this.#c.div) {
            const {
              isMac: p
            } = n.FeatureTest.platform;
            if (a.button !== 0 || a.ctrlKey && p)
              return;
            this.#o.showAllEditors("highlight", !0, !0), this.#c.div.classList.add("free"), f.startHighlighting(this, this.#o.direction === "ltr", a), this.#c.div.addEventListener("pointerup", () => {
              this.#c.div.classList.remove("free");
            }, {
              once: !0
            }), a.preventDefault();
          }
        }
        enableClick() {
          this.#s || (this.#s = this.pointerdown.bind(this), this.#r = this.pointerup.bind(this), this.div.addEventListener("pointerdown", this.#s), this.div.addEventListener("pointerup", this.#r));
        }
        disableClick() {
          this.#s && (this.div.removeEventListener("pointerdown", this.#s), this.div.removeEventListener("pointerup", this.#r), this.#s = null, this.#r = null);
        }
        attach(a) {
          this.#u.set(a.id, a);
          const {
            annotationElementId: p
          } = a;
          p && this.#o.isDeletedAnnotationElement(p) && this.#o.removeDeletedAnnotationElement(a);
        }
        detach(a) {
          this.#u.delete(a.id), this.#e?.removePointerInTextLayer(a.contentDiv), !this.#d && a.annotationElementId && this.#o.addDeletedAnnotationElement(a);
        }
        remove(a) {
          this.detach(a), this.#o.removeEditor(a), a.div.remove(), a.isAttachedToDOM = !1, this.#h || this.addInkEditorIfNeeded(!1);
        }
        changeParent(a) {
          a.parent !== this && (a.parent && a.annotationElementId && (this.#o.addDeletedAnnotationElement(a.annotationElementId), r.AnnotationEditor.deleteAnnotationElement(a), a.annotationElementId = null), this.attach(a), a.parent?.detach(a), a.setParent(this), a.div && a.isAttachedToDOM && (a.div.remove(), this.div.append(a.div)));
        }
        add(a) {
          if (!(a.parent === this && a.isAttachedToDOM)) {
            if (this.changeParent(a), this.#o.addEditor(a), this.attach(a), !a.isAttachedToDOM) {
              const p = a.render();
              this.div.append(p), a.isAttachedToDOM = !0;
            }
            a.fixAndSetPosition(), a.onceAdded(), this.#o.addToAnnotationStorage(a), a._reportTelemetry(a.telemetryInitialData);
          }
        }
        moveEditorInDOM(a) {
          if (!a.isAttachedToDOM)
            return;
          const {
            activeElement: p
          } = document;
          a.div.contains(p) && !this.#a && (a._focusEventsAllowed = !1, this.#a = setTimeout(() => {
            this.#a = null, a.div.contains(document.activeElement) ? a._focusEventsAllowed = !0 : (a.div.addEventListener("focusin", () => {
              a._focusEventsAllowed = !0;
            }, {
              once: !0
            }), p.focus());
          }, 0)), a._structTreeParentId = this.#e?.moveElementInDOM(this.div, a.div, a.contentDiv, !0);
        }
        addOrRebuild(a) {
          a.needsToBeRebuilt() ? (a.parent ||= this, a.rebuild(), a.show()) : this.add(a);
        }
        addUndoableEditor(a) {
          const p = () => a._uiManager.rebuild(a), b = () => {
            a.remove();
          };
          this.addCommands({
            cmd: p,
            undo: b,
            mustExec: !1
          });
        }
        getNextId() {
          return this.#o.getId();
        }
        get #f() {
          return m.#m.get(this.#o.getMode());
        }
        #v(a) {
          const p = this.#f;
          return p ? new p.prototype.constructor(a) : null;
        }
        canCreateNewEmptyEditor() {
          return this.#f?.canCreateNewEmptyEditor();
        }
        pasteEditor(a, p) {
          this.#o.updateToolbar(a), this.#o.updateMode(a);
          const {
            offsetX: b,
            offsetY: y
          } = this.#g(), C = this.getNextId(), M = this.#v({
            parent: this,
            id: C,
            x: b,
            y,
            uiManager: this.#o,
            isCentered: !0,
            ...p
          });
          M && this.add(M);
        }
        deserialize(a) {
          return m.#m.get(a.annotationType ?? a.annotationEditorType)?.deserialize(a, this, this.#o) || null;
        }
        createAndAddNewEditor(a, p, b = {}) {
          const y = this.getNextId(), C = this.#v({
            parent: this,
            id: y,
            x: a.offsetX,
            y: a.offsetY,
            uiManager: this.#o,
            isCentered: p,
            ...b
          });
          return C && this.add(C), C;
        }
        #g() {
          const {
            x: a,
            y: p,
            width: b,
            height: y
          } = this.div.getBoundingClientRect(), C = Math.max(0, a), M = Math.max(0, p), L = Math.min(window.innerWidth, a + b), P = Math.min(window.innerHeight, p + y), O = (C + L) / 2 - a, q = (M + P) / 2 - p, [Y, se] = this.viewport.rotation % 180 === 0 ? [O, q] : [q, O];
          return {
            offsetX: Y,
            offsetY: se
          };
        }
        addNewEditor() {
          this.createAndAddNewEditor(this.#g(), !0);
        }
        setSelected(a) {
          this.#o.setSelected(a);
        }
        toggleSelected(a) {
          this.#o.toggleSelected(a);
        }
        isSelected(a) {
          return this.#o.isSelected(a);
        }
        unselect(a) {
          this.#o.unselect(a);
        }
        pointerup(a) {
          const {
            isMac: p
          } = n.FeatureTest.platform;
          if (!(a.button !== 0 || a.ctrlKey && p) && a.target === this.div && this.#l) {
            if (this.#l = !1, !this.#t) {
              this.#t = !0;
              return;
            }
            if (this.#o.getMode() === n.AnnotationEditorType.STAMP) {
              this.#o.unselectAll();
              return;
            }
            this.createAndAddNewEditor(a, !1);
          }
        }
        pointerdown(a) {
          if (this.#o.getMode() === n.AnnotationEditorType.HIGHLIGHT && this.enableTextSelection(), this.#l) {
            this.#l = !1;
            return;
          }
          const {
            isMac: p
          } = n.FeatureTest.platform;
          if (a.button !== 0 || a.ctrlKey && p || a.target !== this.div)
            return;
          this.#l = !0;
          const b = this.#o.getActive();
          this.#t = !b || b.isEmpty();
        }
        findNewParent(a, p, b) {
          const y = this.#o.findParent(p, b);
          return y === null || y === this ? !1 : (y.changeParent(a), !0);
        }
        destroy() {
          this.#o.getActive()?.parent === this && (this.#o.commitOrRemove(), this.#o.setActiveEditor(null)), this.#a && (clearTimeout(this.#a), this.#a = null);
          for (const a of this.#u.values())
            this.#e?.removePointerInTextLayer(a.contentDiv), a.setParent(null), a.isAttachedToDOM = !1, a.div.remove();
          this.div = null, this.#u.clear(), this.#o.removeLayer(this);
        }
        #y() {
          this.#h = !0;
          for (const a of this.#u.values())
            a.isEmpty() && a.remove();
          this.#h = !1;
        }
        render({
          viewport: a
        }) {
          this.viewport = a, (0, c.setLayerDimensions)(this.div, a);
          for (const p of this.#o.getEditors(this.pageIndex))
            this.add(p), p.rebuild();
          this.updateMode();
        }
        update({
          viewport: a
        }) {
          this.#o.commitOrRemove(), this.#y();
          const p = this.viewport.rotation, b = a.rotation;
          if (this.viewport = a, (0, c.setLayerDimensions)(this.div, {
            rotation: b
          }), p !== b)
            for (const y of this.#u.values())
              y.rotate(b);
          this.addInkEditorIfNeeded(!1);
        }
        get pageDimensions() {
          const {
            pageWidth: a,
            pageHeight: p
          } = this.viewport.rawDims;
          return [a, p];
        }
        get scale() {
          return this.#o.viewParameters.realScale;
        }
      }
    }
  ),
  /***/
  259: (
    /***/
    (i, e, t) => {
      t.d(e, {
        /* harmony export */
        ColorPicker: () => (
          /* binding */
          u
        )
        /* harmony export */
      });
      var n = t(292), r = t(830), s = t(419);
      class u {
        #e = this.#p.bind(this);
        #t = this.#v.bind(this);
        #n = null;
        #r = null;
        #s;
        #i = null;
        #a = !1;
        #u = !1;
        #l = null;
        #h;
        #d = null;
        #c;
        static get _keyboardManager() {
          return (0, n.shadow)(this, "_keyboardManager", new r.KeyboardManager([[["Escape", "mac+Escape"], u.prototype._hideDropdownFromKeyboard], [[" ", "mac+ "], u.prototype._colorSelectFromKeyboard], [["ArrowDown", "ArrowRight", "mac+ArrowDown", "mac+ArrowRight"], u.prototype._moveToNext], [["ArrowUp", "ArrowLeft", "mac+ArrowUp", "mac+ArrowLeft"], u.prototype._moveToPrevious], [["Home", "mac+Home"], u.prototype._moveToBeginning], [["End", "mac+End"], u.prototype._moveToEnd]]));
        }
        constructor({
          editor: o = null,
          uiManager: h = null
        }) {
          o ? (this.#u = !1, this.#c = n.AnnotationEditorParamsType.HIGHLIGHT_COLOR, this.#l = o) : (this.#u = !0, this.#c = n.AnnotationEditorParamsType.HIGHLIGHT_DEFAULT_COLOR), this.#d = o?._uiManager || h, this.#h = this.#d._eventBus, this.#s = o?.color || this.#d?.highlightColors.values().next().value || "#FFFF98";
        }
        renderButton() {
          const o = this.#n = document.createElement("button");
          o.className = "colorPicker", o.tabIndex = "0", o.setAttribute("data-l10n-id", "pdfjs-editor-colorpicker-button"), o.setAttribute("aria-haspopup", !0), o.addEventListener("click", this.#f.bind(this)), o.addEventListener("keydown", this.#e);
          const h = this.#r = document.createElement("span");
          return h.className = "swatch", h.setAttribute("aria-hidden", !0), h.style.backgroundColor = this.#s, o.append(h), o;
        }
        renderMainDropdown() {
          const o = this.#i = this.#o();
          return o.setAttribute("aria-orientation", "horizontal"), o.setAttribute("aria-labelledby", "highlightColorPickerLabel"), o;
        }
        #o() {
          const o = document.createElement("div");
          o.addEventListener("contextmenu", s.noContextMenu), o.className = "dropdown", o.role = "listbox", o.setAttribute("aria-multiselectable", !1), o.setAttribute("aria-orientation", "vertical"), o.setAttribute("data-l10n-id", "pdfjs-editor-colorpicker-dropdown");
          for (const [h, d] of this.#d.highlightColors) {
            const c = document.createElement("button");
            c.tabIndex = "0", c.role = "option", c.setAttribute("data-color", d), c.title = h, c.setAttribute("data-l10n-id", `pdfjs-editor-colorpicker-${h}`);
            const f = document.createElement("span");
            c.append(f), f.className = "swatch", f.style.backgroundColor = d, c.setAttribute("aria-selected", d === this.#s), c.addEventListener("click", this.#m.bind(this, d)), o.append(c);
          }
          return o.addEventListener("keydown", this.#e), o;
        }
        #m(o, h) {
          h.stopPropagation(), this.#h.dispatch("switchannotationeditorparams", {
            source: this,
            type: this.#c,
            value: o
          });
        }
        _colorSelectFromKeyboard(o) {
          if (o.target === this.#n) {
            this.#f(o);
            return;
          }
          const h = o.target.getAttribute("data-color");
          h && this.#m(h, o);
        }
        _moveToNext(o) {
          if (!this.#g) {
            this.#f(o);
            return;
          }
          if (o.target === this.#n) {
            this.#i.firstChild?.focus();
            return;
          }
          o.target.nextSibling?.focus();
        }
        _moveToPrevious(o) {
          if (o.target === this.#i?.firstChild || o.target === this.#n) {
            this.#g && this._hideDropdownFromKeyboard();
            return;
          }
          this.#g || this.#f(o), o.target.previousSibling?.focus();
        }
        _moveToBeginning(o) {
          if (!this.#g) {
            this.#f(o);
            return;
          }
          this.#i.firstChild?.focus();
        }
        _moveToEnd(o) {
          if (!this.#g) {
            this.#f(o);
            return;
          }
          this.#i.lastChild?.focus();
        }
        #p(o) {
          u._keyboardManager.exec(this, o);
        }
        #f(o) {
          if (this.#g) {
            this.hideDropdown();
            return;
          }
          if (this.#a = o.detail === 0, window.addEventListener("pointerdown", this.#t), this.#i) {
            this.#i.classList.remove("hidden");
            return;
          }
          const h = this.#i = this.#o();
          this.#n.append(h);
        }
        #v(o) {
          this.#i?.contains(o.target) || this.hideDropdown();
        }
        hideDropdown() {
          this.#i?.classList.add("hidden"), window.removeEventListener("pointerdown", this.#t);
        }
        get #g() {
          return this.#i && !this.#i.classList.contains("hidden");
        }
        _hideDropdownFromKeyboard() {
          if (!this.#u) {
            if (!this.#g) {
              this.#l?.unselect();
              return;
            }
            this.hideDropdown(), this.#n.focus({
              preventScroll: !0,
              focusVisible: this.#a
            });
          }
        }
        updateColor(o) {
          if (this.#r && (this.#r.style.backgroundColor = o), !this.#i)
            return;
          const h = this.#d.highlightColors.values();
          for (const d of this.#i.children)
            d.setAttribute("aria-selected", h.next().value === o);
        }
        destroy() {
          this.#n?.remove(), this.#n = null, this.#r = null, this.#i?.remove(), this.#i = null;
        }
      }
    }
  ),
  /***/
  310: (
    /***/
    (i, e, t) => {
      t.d(e, {
        AnnotationEditor: () => (
          /* binding */
          o
        )
      });
      var n = t(830), r = t(292), s = t(419);
      class u {
        #e = "";
        #t = !1;
        #n = null;
        #r = null;
        #s = null;
        #i = !1;
        #a = null;
        static _l10nPromise = null;
        constructor(c) {
          this.#a = c;
        }
        static initialize(c) {
          u._l10nPromise ||= c;
        }
        async render() {
          const c = this.#n = document.createElement("button");
          c.className = "altText";
          const f = await u._l10nPromise.get("pdfjs-editor-alt-text-button-label");
          c.textContent = f, c.setAttribute("aria-label", f), c.tabIndex = "0", c.addEventListener("contextmenu", s.noContextMenu), c.addEventListener("pointerdown", (A) => A.stopPropagation());
          const g = (A) => {
            A.preventDefault(), this.#a._uiManager.editAltText(this.#a);
          };
          return c.addEventListener("click", g, {
            capture: !0
          }), c.addEventListener("keydown", (A) => {
            A.target === c && A.key === "Enter" && (this.#i = !0, g(A));
          }), await this.#u(), c;
        }
        finish() {
          this.#n && (this.#n.focus({
            focusVisible: this.#i
          }), this.#i = !1);
        }
        isEmpty() {
          return !this.#e && !this.#t;
        }
        get data() {
          return {
            altText: this.#e,
            decorative: this.#t
          };
        }
        set data({
          altText: c,
          decorative: f
        }) {
          this.#e === c && this.#t === f || (this.#e = c, this.#t = f, this.#u());
        }
        toggle(c = !1) {
          this.#n && (!c && this.#s && (clearTimeout(this.#s), this.#s = null), this.#n.disabled = !c);
        }
        destroy() {
          this.#n?.remove(), this.#n = null, this.#r = null;
        }
        async #u() {
          const c = this.#n;
          if (!c)
            return;
          if (!this.#e && !this.#t) {
            c.classList.remove("done"), this.#r?.remove();
            return;
          }
          c.classList.add("done"), u._l10nPromise.get("pdfjs-editor-alt-text-edit-button-label").then((A) => {
            c.setAttribute("aria-label", A);
          });
          let f = this.#r;
          if (!f) {
            this.#r = f = document.createElement("span"), f.className = "tooltip", f.setAttribute("role", "tooltip");
            const A = f.id = `alt-text-tooltip-${this.#a.id}`;
            c.setAttribute("aria-describedby", A);
            const m = 100;
            c.addEventListener("mouseenter", () => {
              this.#s = setTimeout(() => {
                this.#s = null, this.#r.classList.add("show"), this.#a._reportTelemetry({
                  action: "alt_text_tooltip"
                });
              }, m);
            }), c.addEventListener("mouseleave", () => {
              this.#s && (clearTimeout(this.#s), this.#s = null), this.#r?.classList.remove("show");
            });
          }
          f.innerText = this.#t ? await u._l10nPromise.get("pdfjs-editor-alt-text-decorative-tooltip") : this.#e, f.parentNode || c.append(f), this.#a.getImageForAltText()?.setAttribute("aria-describedby", f.id);
        }
      }
      var l = t(362);
      class o {
        #e = null;
        #t = null;
        #n = !1;
        #r = !1;
        #s = null;
        #i = null;
        #a = this.focusin.bind(this);
        #u = this.focusout.bind(this);
        #l = null;
        #h = "";
        #d = !1;
        #c = null;
        #o = !1;
        #m = !1;
        #p = !1;
        #f = null;
        #v = 0;
        #g = 0;
        #y = null;
        _initialOptions = /* @__PURE__ */ Object.create(null);
        _isVisible = !0;
        _uiManager = null;
        _focusEventsAllowed = !0;
        _l10nPromise = null;
        #A = !1;
        #_ = o._zIndex++;
        static _borderLineWidth = -1;
        static _colorManager = new n.ColorManager();
        static _zIndex = 1;
        static _telemetryTimeout = 1e3;
        static get _resizerKeyboardManager() {
          const c = o.prototype._resizeWithKeyboard, f = n.AnnotationEditorUIManager.TRANSLATE_SMALL, g = n.AnnotationEditorUIManager.TRANSLATE_BIG;
          return (0, r.shadow)(this, "_resizerKeyboardManager", new n.KeyboardManager([[["ArrowLeft", "mac+ArrowLeft"], c, {
            args: [-f, 0]
          }], [["ctrl+ArrowLeft", "mac+shift+ArrowLeft"], c, {
            args: [-g, 0]
          }], [["ArrowRight", "mac+ArrowRight"], c, {
            args: [f, 0]
          }], [["ctrl+ArrowRight", "mac+shift+ArrowRight"], c, {
            args: [g, 0]
          }], [["ArrowUp", "mac+ArrowUp"], c, {
            args: [0, -f]
          }], [["ctrl+ArrowUp", "mac+shift+ArrowUp"], c, {
            args: [0, -g]
          }], [["ArrowDown", "mac+ArrowDown"], c, {
            args: [0, f]
          }], [["ctrl+ArrowDown", "mac+shift+ArrowDown"], c, {
            args: [0, g]
          }], [["Escape", "mac+Escape"], o.prototype._stopResizingWithKeyboard]]));
        }
        constructor(c) {
          this.constructor === o && (0, r.unreachable)("Cannot initialize AnnotationEditor."), this.parent = c.parent, this.id = c.id, this.width = this.height = null, this.pageIndex = c.parent.pageIndex, this.name = c.name, this.div = null, this._uiManager = c.uiManager, this.annotationElementId = null, this._willKeepAspectRatio = !1, this._initialOptions.isCentered = c.isCentered, this._structTreeParentId = null;
          const {
            rotation: f,
            rawDims: {
              pageWidth: g,
              pageHeight: A,
              pageX: m,
              pageY: k
            }
          } = this.parent.viewport;
          this.rotation = f, this.pageRotation = (360 + f - this._uiManager.viewParameters.rotation) % 360, this.pageDimensions = [g, A], this.pageTranslation = [m, k];
          const [a, p] = this.parentDimensions;
          this.x = c.x / a, this.y = c.y / p, this.isAttachedToDOM = !1, this.deleted = !1;
        }
        get editorType() {
          return Object.getPrototypeOf(this).constructor._type;
        }
        static get _defaultLineColor() {
          return (0, r.shadow)(this, "_defaultLineColor", this._colorManager.getHexCode("CanvasText"));
        }
        static deleteAnnotationElement(c) {
          const f = new h({
            id: c.parent.getNextId(),
            parent: c.parent,
            uiManager: c._uiManager
          });
          f.annotationElementId = c.annotationElementId, f.deleted = !0, f._uiManager.addToAnnotationStorage(f);
        }
        static initialize(c, f, g) {
          if (o._l10nPromise ||= new Map(["pdfjs-editor-alt-text-button-label", "pdfjs-editor-alt-text-edit-button-label", "pdfjs-editor-alt-text-decorative-tooltip", "pdfjs-editor-resizer-label-topLeft", "pdfjs-editor-resizer-label-topMiddle", "pdfjs-editor-resizer-label-topRight", "pdfjs-editor-resizer-label-middleRight", "pdfjs-editor-resizer-label-bottomRight", "pdfjs-editor-resizer-label-bottomMiddle", "pdfjs-editor-resizer-label-bottomLeft", "pdfjs-editor-resizer-label-middleLeft"].map((m) => [m, c.get(m.replaceAll(/([A-Z])/g, (k) => `-${k.toLowerCase()}`))])), g?.strings)
            for (const m of g.strings)
              o._l10nPromise.set(m, c.get(m));
          if (o._borderLineWidth !== -1)
            return;
          const A = getComputedStyle(document.documentElement);
          o._borderLineWidth = parseFloat(A.getPropertyValue("--outline-width")) || 0;
        }
        static updateDefaultParams(c, f) {
        }
        static get defaultPropertiesToUpdate() {
          return [];
        }
        static isHandlingMimeForPasting(c) {
          return !1;
        }
        static paste(c, f) {
          (0, r.unreachable)("Not implemented");
        }
        get propertiesToUpdate() {
          return [];
        }
        get _isDraggable() {
          return this.#A;
        }
        set _isDraggable(c) {
          this.#A = c, this.div?.classList.toggle("draggable", c);
        }
        get isEnterHandled() {
          return !0;
        }
        center() {
          const [c, f] = this.pageDimensions;
          switch (this.parentRotation) {
            case 90:
              this.x -= this.height * f / (c * 2), this.y += this.width * c / (f * 2);
              break;
            case 180:
              this.x += this.width / 2, this.y += this.height / 2;
              break;
            case 270:
              this.x += this.height * f / (c * 2), this.y -= this.width * c / (f * 2);
              break;
            default:
              this.x -= this.width / 2, this.y -= this.height / 2;
              break;
          }
          this.fixAndSetPosition();
        }
        addCommands(c) {
          this._uiManager.addCommands(c);
        }
        get currentLayer() {
          return this._uiManager.currentLayer;
        }
        setInBackground() {
          this.div.style.zIndex = 0;
        }
        setInForeground() {
          this.div.style.zIndex = this.#_;
        }
        setParent(c) {
          c !== null ? (this.pageIndex = c.pageIndex, this.pageDimensions = c.pageDimensions) : this.#N(), this.parent = c;
        }
        focusin(c) {
          this._focusEventsAllowed && (this.#d ? this.#d = !1 : this.parent.setSelected(this));
        }
        focusout(c) {
          !this._focusEventsAllowed || !this.isAttachedToDOM || c.relatedTarget?.closest(`#${this.id}`) || (c.preventDefault(), this.parent?.isMultipleSelection || this.commitOrRemove());
        }
        commitOrRemove() {
          this.isEmpty() ? this.remove() : this.commit();
        }
        commit() {
          this.addToAnnotationStorage();
        }
        addToAnnotationStorage() {
          this._uiManager.addToAnnotationStorage(this);
        }
        setAt(c, f, g, A) {
          const [m, k] = this.parentDimensions;
          [g, A] = this.screenToPageTranslation(g, A), this.x = (c + g) / m, this.y = (f + A) / k, this.fixAndSetPosition();
        }
        #T([c, f], g, A) {
          [g, A] = this.screenToPageTranslation(g, A), this.x += g / c, this.y += A / f, this.fixAndSetPosition();
        }
        translate(c, f) {
          this.#T(this.parentDimensions, c, f);
        }
        translateInPage(c, f) {
          this.#c ||= [this.x, this.y], this.#T(this.pageDimensions, c, f), this.div.scrollIntoView({
            block: "nearest"
          });
        }
        drag(c, f) {
          this.#c ||= [this.x, this.y];
          const [g, A] = this.parentDimensions;
          if (this.x += c / g, this.y += f / A, this.parent && (this.x < 0 || this.x > 1 || this.y < 0 || this.y > 1)) {
            const {
              x: b,
              y
            } = this.div.getBoundingClientRect();
            this.parent.findNewParent(this, b, y) && (this.x -= Math.floor(this.x), this.y -= Math.floor(this.y));
          }
          let {
            x: m,
            y: k
          } = this;
          const [a, p] = this.getBaseTranslation();
          m += a, k += p, this.div.style.left = `${(100 * m).toFixed(2)}%`, this.div.style.top = `${(100 * k).toFixed(2)}%`, this.div.scrollIntoView({
            block: "nearest"
          });
        }
        get _hasBeenMoved() {
          return !!this.#c && (this.#c[0] !== this.x || this.#c[1] !== this.y);
        }
        getBaseTranslation() {
          const [c, f] = this.parentDimensions, {
            _borderLineWidth: g
          } = o, A = g / c, m = g / f;
          switch (this.rotation) {
            case 90:
              return [-A, m];
            case 180:
              return [A, m];
            case 270:
              return [A, -m];
            default:
              return [-A, -m];
          }
        }
        get _mustFixPosition() {
          return !0;
        }
        fixAndSetPosition(c = this.rotation) {
          const [f, g] = this.pageDimensions;
          let {
            x: A,
            y: m,
            width: k,
            height: a
          } = this;
          if (k *= f, a *= g, A *= f, m *= g, this._mustFixPosition)
            switch (c) {
              case 0:
                A = Math.max(0, Math.min(f - k, A)), m = Math.max(0, Math.min(g - a, m));
                break;
              case 90:
                A = Math.max(0, Math.min(f - a, A)), m = Math.min(g, Math.max(k, m));
                break;
              case 180:
                A = Math.min(f, Math.max(k, A)), m = Math.min(g, Math.max(a, m));
                break;
              case 270:
                A = Math.min(f, Math.max(a, A)), m = Math.max(0, Math.min(g - k, m));
                break;
            }
          this.x = A /= f, this.y = m /= g;
          const [p, b] = this.getBaseTranslation();
          A += p, m += b;
          const {
            style: y
          } = this.div;
          y.left = `${(100 * A).toFixed(2)}%`, y.top = `${(100 * m).toFixed(2)}%`, this.moveInDOM();
        }
        static #L(c, f, g) {
          switch (g) {
            case 90:
              return [f, -c];
            case 180:
              return [-c, -f];
            case 270:
              return [-f, c];
            default:
              return [c, f];
          }
        }
        screenToPageTranslation(c, f) {
          return o.#L(c, f, this.parentRotation);
        }
        pageTranslationToScreen(c, f) {
          return o.#L(c, f, 360 - this.parentRotation);
        }
        #M(c) {
          switch (c) {
            case 90: {
              const [f, g] = this.pageDimensions;
              return [0, -f / g, g / f, 0];
            }
            case 180:
              return [-1, 0, 0, -1];
            case 270: {
              const [f, g] = this.pageDimensions;
              return [0, f / g, -g / f, 0];
            }
            default:
              return [1, 0, 0, 1];
          }
        }
        get parentScale() {
          return this._uiManager.viewParameters.realScale;
        }
        get parentRotation() {
          return (this._uiManager.viewParameters.rotation + this.pageRotation) % 360;
        }
        get parentDimensions() {
          const {
            parentScale: c,
            pageDimensions: [f, g]
          } = this, A = f * c, m = g * c;
          return r.FeatureTest.isCSSRoundSupported ? [Math.round(A), Math.round(m)] : [A, m];
        }
        setDims(c, f) {
          const [g, A] = this.parentDimensions;
          this.div.style.width = `${(100 * c / g).toFixed(2)}%`, this.#r || (this.div.style.height = `${(100 * f / A).toFixed(2)}%`);
        }
        fixDims() {
          const {
            style: c
          } = this.div, {
            height: f,
            width: g
          } = c, A = g.endsWith("%"), m = !this.#r && f.endsWith("%");
          if (A && m)
            return;
          const [k, a] = this.parentDimensions;
          A || (c.width = `${(100 * parseFloat(g) / k).toFixed(2)}%`), !this.#r && !m && (c.height = `${(100 * parseFloat(f) / a).toFixed(2)}%`);
        }
        getInitialTranslation() {
          return [0, 0];
        }
        #w() {
          if (this.#s)
            return;
          this.#s = document.createElement("div"), this.#s.classList.add("resizers");
          const c = this._willKeepAspectRatio ? ["topLeft", "topRight", "bottomRight", "bottomLeft"] : ["topLeft", "topMiddle", "topRight", "middleRight", "bottomRight", "bottomMiddle", "bottomLeft", "middleLeft"];
          for (const f of c) {
            const g = document.createElement("div");
            this.#s.append(g), g.classList.add("resizer", f), g.setAttribute("data-resizer-name", f), g.addEventListener("pointerdown", this.#b.bind(this, f)), g.addEventListener("contextmenu", s.noContextMenu), g.tabIndex = -1;
          }
          this.div.prepend(this.#s);
        }
        #b(c, f) {
          f.preventDefault();
          const {
            isMac: g
          } = r.FeatureTest.platform;
          if (f.button !== 0 || f.ctrlKey && g)
            return;
          this.#t?.toggle(!1);
          const A = this.#S.bind(this, c), m = this._isDraggable;
          this._isDraggable = !1;
          const k = {
            passive: !0,
            capture: !0
          };
          this.parent.togglePointerEvents(!1), window.addEventListener("pointermove", A, k), window.addEventListener("contextmenu", s.noContextMenu);
          const a = this.x, p = this.y, b = this.width, y = this.height, C = this.parent.div.style.cursor, M = this.div.style.cursor;
          this.div.style.cursor = this.parent.div.style.cursor = window.getComputedStyle(f.target).cursor;
          const L = () => {
            this.parent.togglePointerEvents(!0), this.#t?.toggle(!0), this._isDraggable = m, window.removeEventListener("pointerup", L), window.removeEventListener("blur", L), window.removeEventListener("pointermove", A, k), window.removeEventListener("contextmenu", s.noContextMenu), this.parent.div.style.cursor = C, this.div.style.cursor = M, this.#k(a, p, b, y);
          };
          window.addEventListener("pointerup", L), window.addEventListener("blur", L);
        }
        #k(c, f, g, A) {
          const m = this.x, k = this.y, a = this.width, p = this.height;
          m === c && k === f && a === g && p === A || this.addCommands({
            cmd: () => {
              this.width = a, this.height = p, this.x = m, this.y = k;
              const [b, y] = this.parentDimensions;
              this.setDims(b * a, y * p), this.fixAndSetPosition();
            },
            undo: () => {
              this.width = g, this.height = A, this.x = c, this.y = f;
              const [b, y] = this.parentDimensions;
              this.setDims(b * g, y * A), this.fixAndSetPosition();
            },
            mustExec: !0
          });
        }
        #S(c, f) {
          const [g, A] = this.parentDimensions, m = this.x, k = this.y, a = this.width, p = this.height, b = o.MIN_SIZE / g, y = o.MIN_SIZE / A, C = (R) => Math.round(R * 1e4) / 1e4, M = this.#M(this.rotation), L = (R, D) => [M[0] * R + M[2] * D, M[1] * R + M[3] * D], P = this.#M(360 - this.rotation), O = (R, D) => [P[0] * R + P[2] * D, P[1] * R + P[3] * D];
          let q, Y, se = !1, me = !1;
          switch (c) {
            case "topLeft":
              se = !0, q = (R, D) => [0, 0], Y = (R, D) => [R, D];
              break;
            case "topMiddle":
              q = (R, D) => [R / 2, 0], Y = (R, D) => [R / 2, D];
              break;
            case "topRight":
              se = !0, q = (R, D) => [R, 0], Y = (R, D) => [0, D];
              break;
            case "middleRight":
              me = !0, q = (R, D) => [R, D / 2], Y = (R, D) => [0, D / 2];
              break;
            case "bottomRight":
              se = !0, q = (R, D) => [R, D], Y = (R, D) => [0, 0];
              break;
            case "bottomMiddle":
              q = (R, D) => [R / 2, D], Y = (R, D) => [R / 2, 0];
              break;
            case "bottomLeft":
              se = !0, q = (R, D) => [0, D], Y = (R, D) => [R, 0];
              break;
            case "middleLeft":
              me = !0, q = (R, D) => [0, D / 2], Y = (R, D) => [R, D / 2];
              break;
          }
          const te = q(a, p), K = Y(a, p);
          let Z = L(...K);
          const oe = C(m + Z[0]), le = C(k + Z[1]);
          let ie = 1, pe = 1, [he, we] = this.screenToPageTranslation(f.movementX, f.movementY);
          if ([he, we] = O(he / g, we / A), se) {
            const R = Math.hypot(a, p);
            ie = pe = Math.max(Math.min(Math.hypot(K[0] - te[0] - he, K[1] - te[1] - we) / R, 1 / a, 1 / p), b / a, y / p);
          } else me ? ie = Math.max(b, Math.min(1, Math.abs(K[0] - te[0] - he))) / a : pe = Math.max(y, Math.min(1, Math.abs(K[1] - te[1] - we))) / p;
          const ke = C(a * ie), Ae = C(p * pe);
          Z = L(...Y(ke, Ae));
          const ae = oe - Z[0], de = le - Z[1];
          this.width = ke, this.height = Ae, this.x = ae, this.y = de, this.setDims(g * ke, A * Ae), this.fixAndSetPosition();
        }
        altTextFinish() {
          this.#t?.finish();
        }
        async addEditToolbar() {
          return this.#l || this.#m ? this.#l : (this.#l = new l.EditorToolbar(this), this.div.append(this.#l.render()), this.#t && this.#l.addAltTextButton(await this.#t.render()), this.#l);
        }
        removeEditToolbar() {
          this.#l && (this.#l.remove(), this.#l = null, this.#t?.destroy());
        }
        getClientDimensions() {
          return this.div.getBoundingClientRect();
        }
        async addAltTextButton() {
          this.#t || (u.initialize(o._l10nPromise), this.#t = new u(this), await this.addEditToolbar());
        }
        get altTextData() {
          return this.#t?.data;
        }
        set altTextData(c) {
          this.#t && (this.#t.data = c);
        }
        hasAltText() {
          return !this.#t?.isEmpty();
        }
        render() {
          this.div = document.createElement("div"), this.div.setAttribute("data-editor-rotation", (360 - this.rotation) % 360), this.div.className = this.name, this.div.setAttribute("id", this.id), this.div.tabIndex = this.#n ? -1 : 0, this._isVisible || this.div.classList.add("hidden"), this.setInForeground(), this.div.addEventListener("focusin", this.#a), this.div.addEventListener("focusout", this.#u);
          const [c, f] = this.parentDimensions;
          this.parentRotation % 180 !== 0 && (this.div.style.maxWidth = `${(100 * f / c).toFixed(2)}%`, this.div.style.maxHeight = `${(100 * c / f).toFixed(2)}%`);
          const [g, A] = this.getInitialTranslation();
          return this.translate(g, A), (0, n.bindEvents)(this, this.div, ["pointerdown"]), this.div;
        }
        pointerdown(c) {
          const {
            isMac: f
          } = r.FeatureTest.platform;
          if (c.button !== 0 || c.ctrlKey && f) {
            c.preventDefault();
            return;
          }
          if (this.#d = !0, this._isDraggable) {
            this.#E(c);
            return;
          }
          this.#C(c);
        }
        #C(c) {
          const {
            isMac: f
          } = r.FeatureTest.platform;
          c.ctrlKey && !f || c.shiftKey || c.metaKey && f ? this.parent.toggleSelected(this) : this.parent.setSelected(this);
        }
        #E(c) {
          const f = this._uiManager.isSelected(this);
          this._uiManager.setUpDragSession();
          let g, A;
          f && (this.div.classList.add("moving"), g = {
            passive: !0,
            capture: !0
          }, this.#v = c.clientX, this.#g = c.clientY, A = (k) => {
            const {
              clientX: a,
              clientY: p
            } = k, [b, y] = this.screenToPageTranslation(a - this.#v, p - this.#g);
            this.#v = a, this.#g = p, this._uiManager.dragSelectedEditors(b, y);
          }, window.addEventListener("pointermove", A, g));
          const m = () => {
            window.removeEventListener("pointerup", m), window.removeEventListener("blur", m), f && (this.div.classList.remove("moving"), window.removeEventListener("pointermove", A, g)), this.#d = !1, this._uiManager.endDragSession() || this.#C(c);
          };
          window.addEventListener("pointerup", m), window.addEventListener("blur", m);
        }
        moveInDOM() {
          this.#f && clearTimeout(this.#f), this.#f = setTimeout(() => {
            this.#f = null, this.parent?.moveEditorInDOM(this);
          }, 0);
        }
        _setParentAndPosition(c, f, g) {
          c.changeParent(this), this.x = f, this.y = g, this.fixAndSetPosition();
        }
        getRect(c, f, g = this.rotation) {
          const A = this.parentScale, [m, k] = this.pageDimensions, [a, p] = this.pageTranslation, b = c / A, y = f / A, C = this.x * m, M = this.y * k, L = this.width * m, P = this.height * k;
          switch (g) {
            case 0:
              return [C + b + a, k - M - y - P + p, C + b + L + a, k - M - y + p];
            case 90:
              return [C + y + a, k - M + b + p, C + y + P + a, k - M + b + L + p];
            case 180:
              return [C - b - L + a, k - M + y + p, C - b + a, k - M + y + P + p];
            case 270:
              return [C - y - P + a, k - M - b - L + p, C - y + a, k - M - b + p];
            default:
              throw new Error("Invalid rotation");
          }
        }
        getRectInCurrentCoords(c, f) {
          const [g, A, m, k] = c, a = m - g, p = k - A;
          switch (this.rotation) {
            case 0:
              return [g, f - k, a, p];
            case 90:
              return [g, f - A, p, a];
            case 180:
              return [m, f - A, a, p];
            case 270:
              return [m, f - k, p, a];
            default:
              throw new Error("Invalid rotation");
          }
        }
        onceAdded() {
        }
        isEmpty() {
          return !1;
        }
        enableEditMode() {
          this.#m = !0;
        }
        disableEditMode() {
          this.#m = !1;
        }
        isInEditMode() {
          return this.#m;
        }
        shouldGetKeyboardEvents() {
          return this.#p;
        }
        needsToBeRebuilt() {
          return this.div && !this.isAttachedToDOM;
        }
        rebuild() {
          this.div?.addEventListener("focusin", this.#a), this.div?.addEventListener("focusout", this.#u);
        }
        rotate(c) {
        }
        serialize(c = !1, f = null) {
          (0, r.unreachable)("An editor must be serializable");
        }
        static deserialize(c, f, g) {
          const A = new this.prototype.constructor({
            parent: f,
            id: f.getNextId(),
            uiManager: g
          });
          A.rotation = c.rotation;
          const [m, k] = A.pageDimensions, [a, p, b, y] = A.getRectInCurrentCoords(c.rect, k);
          return A.x = a / m, A.y = p / k, A.width = b / m, A.height = y / k, A;
        }
        get hasBeenModified() {
          return !!this.annotationElementId && (this.deleted || this.serialize() !== null);
        }
        remove() {
          if (this.div.removeEventListener("focusin", this.#a), this.div.removeEventListener("focusout", this.#u), this.isEmpty() || this.commit(), this.parent ? this.parent.remove(this) : this._uiManager.removeEditor(this), this.#f && (clearTimeout(this.#f), this.#f = null), this.#N(), this.removeEditToolbar(), this.#y) {
            for (const c of this.#y.values())
              clearTimeout(c);
            this.#y = null;
          }
          this.parent = null;
        }
        get isResizable() {
          return !1;
        }
        makeResizable() {
          this.isResizable && (this.#w(), this.#s.classList.remove("hidden"), (0, n.bindEvents)(this, this.div, ["keydown"]));
        }
        get toolbarPosition() {
          return null;
        }
        keydown(c) {
          if (!this.isResizable || c.target !== this.div || c.key !== "Enter")
            return;
          this._uiManager.setSelected(this), this.#i = {
            savedX: this.x,
            savedY: this.y,
            savedWidth: this.width,
            savedHeight: this.height
          };
          const f = this.#s.children;
          if (!this.#e) {
            this.#e = Array.from(f);
            const k = this.#R.bind(this), a = this.#D.bind(this);
            for (const p of this.#e) {
              const b = p.getAttribute("data-resizer-name");
              p.setAttribute("role", "spinbutton"), p.addEventListener("keydown", k), p.addEventListener("blur", a), p.addEventListener("focus", this.#I.bind(this, b)), o._l10nPromise.get(`pdfjs-editor-resizer-label-${b}`).then((y) => p.setAttribute("aria-label", y));
            }
          }
          const g = this.#e[0];
          let A = 0;
          for (const k of f) {
            if (k === g)
              break;
            A++;
          }
          const m = (360 - this.rotation + this.parentRotation) % 360 / 90 * (this.#e.length / 4);
          if (m !== A) {
            if (m < A)
              for (let a = 0; a < A - m; a++)
                this.#s.append(this.#s.firstChild);
            else if (m > A)
              for (let a = 0; a < m - A; a++)
                this.#s.firstChild.before(this.#s.lastChild);
            let k = 0;
            for (const a of f) {
              const b = this.#e[k++].getAttribute("data-resizer-name");
              o._l10nPromise.get(`pdfjs-editor-resizer-label-${b}`).then((y) => a.setAttribute("aria-label", y));
            }
          }
          this.#F(0), this.#p = !0, this.#s.firstChild.focus({
            focusVisible: !0
          }), c.preventDefault(), c.stopImmediatePropagation();
        }
        #R(c) {
          o._resizerKeyboardManager.exec(this, c);
        }
        #D(c) {
          this.#p && c.relatedTarget?.parentNode !== this.#s && this.#N();
        }
        #I(c) {
          this.#h = this.#p ? c : "";
        }
        #F(c) {
          if (this.#e)
            for (const f of this.#e)
              f.tabIndex = c;
        }
        _resizeWithKeyboard(c, f) {
          this.#p && this.#S(this.#h, {
            movementX: c,
            movementY: f
          });
        }
        #N() {
          if (this.#p = !1, this.#F(-1), this.#i) {
            const {
              savedX: c,
              savedY: f,
              savedWidth: g,
              savedHeight: A
            } = this.#i;
            this.#k(c, f, g, A), this.#i = null;
          }
        }
        _stopResizingWithKeyboard() {
          this.#N(), this.div.focus();
        }
        select() {
          if (this.makeResizable(), this.div?.classList.add("selectedEditor"), !this.#l) {
            this.addEditToolbar().then(() => {
              this.div?.classList.contains("selectedEditor") && this.#l?.show();
            });
            return;
          }
          this.#l?.show();
        }
        unselect() {
          this.#s?.classList.add("hidden"), this.div?.classList.remove("selectedEditor"), this.div?.contains(document.activeElement) && this._uiManager.currentLayer.div.focus({
            preventScroll: !0
          }), this.#l?.hide();
        }
        updateParams(c, f) {
        }
        disableEditing() {
        }
        enableEditing() {
        }
        enterInEditMode() {
        }
        getImageForAltText() {
          return null;
        }
        get contentDiv() {
          return this.div;
        }
        get isEditing() {
          return this.#o;
        }
        set isEditing(c) {
          this.#o = c, this.parent && (c ? (this.parent.setSelected(this), this.parent.setActiveEditor(this)) : this.parent.setActiveEditor(null));
        }
        setAspectRatio(c, f) {
          this.#r = !0;
          const g = c / f, {
            style: A
          } = this.div;
          A.aspectRatio = g, A.height = "auto";
        }
        static get MIN_SIZE() {
          return 16;
        }
        static canCreateNewEmptyEditor() {
          return !0;
        }
        get telemetryInitialData() {
          return {
            action: "added"
          };
        }
        get telemetryFinalData() {
          return null;
        }
        _reportTelemetry(c, f = !1) {
          if (f) {
            this.#y ||= /* @__PURE__ */ new Map();
            const {
              action: g
            } = c;
            let A = this.#y.get(g);
            A && clearTimeout(A), A = setTimeout(() => {
              this._reportTelemetry(c), this.#y.delete(g), this.#y.size === 0 && (this.#y = null);
            }, o._telemetryTimeout), this.#y.set(g, A);
            return;
          }
          c.type ||= this.editorType, this._uiManager._eventBus.dispatch("reporttelemetry", {
            source: this,
            details: {
              type: "editing",
              data: c
            }
          });
        }
        show(c = this._isVisible) {
          this.div.classList.toggle("hidden", !c), this._isVisible = c;
        }
        enable() {
          this.div && (this.div.tabIndex = 0), this.#n = !1;
        }
        disable() {
          this.div && (this.div.tabIndex = -1), this.#n = !0;
        }
        renderAnnotationElement(c) {
          let f = c.container.querySelector(".annotationContent");
          if (!f)
            f = document.createElement("div"), f.classList.add("annotationContent", this.editorType), c.container.prepend(f);
          else if (f.nodeName === "CANVAS") {
            const g = f;
            f = document.createElement("div"), f.classList.add("annotationContent", this.editorType), g.before(f);
          }
          return f;
        }
        resetAnnotationElement(c) {
          const {
            firstChild: f
          } = c.container;
          f.nodeName === "DIV" && f.classList.contains("annotationContent") && f.remove();
        }
      }
      class h extends o {
        constructor(c) {
          super(c), this.annotationElementId = c.annotationElementId, this.deleted = !0;
        }
        serialize() {
          return {
            id: this.annotationElementId,
            deleted: !0,
            pageIndex: this.pageIndex
          };
        }
      }
    }
  ),
  /***/
  61: (
    /***/
    (i, e, t) => {
      t.d(e, {
        /* harmony export */
        FreeOutliner: () => (
          /* binding */
          l
        ),
        /* harmony export */
        Outliner: () => (
          /* binding */
          r
        )
        /* harmony export */
      });
      var n = t(292);
      class r {
        #e;
        #t = [];
        #n = [];
        constructor(d, c = 0, f = 0, g = !0) {
          let A = 1 / 0, m = -1 / 0, k = 1 / 0, a = -1 / 0;
          const b = 10 ** -4;
          for (const {
            x: q,
            y: Y,
            width: se,
            height: me
          } of d) {
            const te = Math.floor((q - c) / b) * b, K = Math.ceil((q + se + c) / b) * b, Z = Math.floor((Y - c) / b) * b, oe = Math.ceil((Y + me + c) / b) * b, le = [te, Z, oe, !0], ie = [K, Z, oe, !1];
            this.#t.push(le, ie), A = Math.min(A, te), m = Math.max(m, K), k = Math.min(k, Z), a = Math.max(a, oe);
          }
          const y = m - A + 2 * f, C = a - k + 2 * f, M = A - f, L = k - f, P = this.#t.at(g ? -1 : -2), O = [P[0], P[2]];
          for (const q of this.#t) {
            const [Y, se, me] = q;
            q[0] = (Y - M) / y, q[1] = (se - L) / C, q[2] = (me - L) / C;
          }
          this.#e = {
            x: M,
            y: L,
            width: y,
            height: C,
            lastPoint: O
          };
        }
        getOutlines() {
          this.#t.sort((c, f) => c[0] - f[0] || c[1] - f[1] || c[2] - f[2]);
          const d = [];
          for (const c of this.#t)
            c[3] ? (d.push(...this.#u(c)), this.#i(c)) : (this.#a(c), d.push(...this.#u(c)));
          return this.#r(d);
        }
        #r(d) {
          const c = [], f = /* @__PURE__ */ new Set();
          for (const m of d) {
            const [k, a, p] = m;
            c.push([k, a, m], [k, p, m]);
          }
          c.sort((m, k) => m[1] - k[1] || m[0] - k[0]);
          for (let m = 0, k = c.length; m < k; m += 2) {
            const a = c[m][2], p = c[m + 1][2];
            a.push(p), p.push(a), f.add(a), f.add(p);
          }
          const g = [];
          let A;
          for (; f.size > 0; ) {
            const m = f.values().next().value;
            let [k, a, p, b, y] = m;
            f.delete(m);
            let C = k, M = a;
            for (A = [k, p], g.push(A); ; ) {
              let L;
              if (f.has(b))
                L = b;
              else if (f.has(y))
                L = y;
              else
                break;
              f.delete(L), [k, a, p, b, y] = L, C !== k && (A.push(C, M, k, M === a ? a : p), C = k), M = M === a ? p : a;
            }
            A.push(C, M);
          }
          return new u(g, this.#e);
        }
        #s(d) {
          const c = this.#n;
          let f = 0, g = c.length - 1;
          for (; f <= g; ) {
            const A = f + g >> 1, m = c[A][0];
            if (m === d)
              return A;
            m < d ? f = A + 1 : g = A - 1;
          }
          return g + 1;
        }
        #i([, d, c]) {
          const f = this.#s(d);
          this.#n.splice(f, 0, [d, c]);
        }
        #a([, d, c]) {
          const f = this.#s(d);
          for (let g = f; g < this.#n.length; g++) {
            const [A, m] = this.#n[g];
            if (A !== d)
              break;
            if (A === d && m === c) {
              this.#n.splice(g, 1);
              return;
            }
          }
          for (let g = f - 1; g >= 0; g--) {
            const [A, m] = this.#n[g];
            if (A !== d)
              break;
            if (A === d && m === c) {
              this.#n.splice(g, 1);
              return;
            }
          }
        }
        #u(d) {
          const [c, f, g] = d, A = [[c, f, g]], m = this.#s(g);
          for (let k = 0; k < m; k++) {
            const [a, p] = this.#n[k];
            for (let b = 0, y = A.length; b < y; b++) {
              const [, C, M] = A[b];
              if (!(p <= C || M <= a)) {
                if (C >= a) {
                  if (M > p)
                    A[b][1] = p;
                  else {
                    if (y === 1)
                      return [];
                    A.splice(b, 1), b--, y--;
                  }
                  continue;
                }
                A[b][2] = a, M > p && A.push([c, p, M]);
              }
            }
          }
          return A;
        }
      }
      class s {
        toSVGPath() {
          throw new Error("Abstract method `toSVGPath` must be implemented.");
        }
        get box() {
          throw new Error("Abstract getter `box` must be implemented.");
        }
        serialize(d, c) {
          throw new Error("Abstract method `serialize` must be implemented.");
        }
        get free() {
          return this instanceof o;
        }
      }
      class u extends s {
        #e;
        #t;
        constructor(d, c) {
          super(), this.#t = d, this.#e = c;
        }
        toSVGPath() {
          const d = [];
          for (const c of this.#t) {
            let [f, g] = c;
            d.push(`M${f} ${g}`);
            for (let A = 2; A < c.length; A += 2) {
              const m = c[A], k = c[A + 1];
              m === f ? (d.push(`V${k}`), g = k) : k === g && (d.push(`H${m}`), f = m);
            }
            d.push("Z");
          }
          return d.join(" ");
        }
        serialize([d, c, f, g], A) {
          const m = [], k = f - d, a = g - c;
          for (const p of this.#t) {
            const b = new Array(p.length);
            for (let y = 0; y < p.length; y += 2)
              b[y] = d + p[y] * k, b[y + 1] = g - p[y + 1] * a;
            m.push(b);
          }
          return m;
        }
        get box() {
          return this.#e;
        }
      }
      class l {
        #e;
        #t = [];
        #n;
        #r;
        #s = [];
        #i = new Float64Array(18);
        #a;
        #u;
        #l;
        #h;
        #d;
        #c;
        #o = [];
        static #m = 8;
        static #p = 2;
        static #f = l.#m + l.#p;
        constructor({
          x: d,
          y: c
        }, f, g, A, m, k = 0) {
          this.#e = f, this.#c = A * g, this.#r = m, this.#i.set([NaN, NaN, NaN, NaN, d, c], 6), this.#n = k, this.#h = l.#m * g, this.#l = l.#f * g, this.#d = g, this.#o.push(d, c);
        }
        get free() {
          return !0;
        }
        isEmpty() {
          return isNaN(this.#i[8]);
        }
        #v() {
          const d = this.#i.subarray(4, 6), c = this.#i.subarray(16, 18), [f, g, A, m] = this.#e;
          return [(this.#a + (d[0] - c[0]) / 2 - f) / A, (this.#u + (d[1] - c[1]) / 2 - g) / m, (this.#a + (c[0] - d[0]) / 2 - f) / A, (this.#u + (c[1] - d[1]) / 2 - g) / m];
        }
        add({
          x: d,
          y: c
        }) {
          this.#a = d, this.#u = c;
          const [f, g, A, m] = this.#e;
          let [k, a, p, b] = this.#i.subarray(8, 12);
          const y = d - p, C = c - b, M = Math.hypot(y, C);
          if (M < this.#l)
            return !1;
          const L = M - this.#h, P = L / M, O = P * y, q = P * C;
          let Y = k, se = a;
          k = p, a = b, p += O, b += q, this.#o?.push(d, c);
          const me = -q / L, te = O / L, K = me * this.#c, Z = te * this.#c;
          return this.#i.set(this.#i.subarray(2, 8), 0), this.#i.set([p + K, b + Z], 4), this.#i.set(this.#i.subarray(14, 18), 12), this.#i.set([p - K, b - Z], 16), isNaN(this.#i[6]) ? (this.#s.length === 0 && (this.#i.set([k + K, a + Z], 2), this.#s.push(NaN, NaN, NaN, NaN, (k + K - f) / A, (a + Z - g) / m), this.#i.set([k - K, a - Z], 14), this.#t.push(NaN, NaN, NaN, NaN, (k - K - f) / A, (a - Z - g) / m)), this.#i.set([Y, se, k, a, p, b], 6), !this.isEmpty()) : (this.#i.set([Y, se, k, a, p, b], 6), Math.abs(Math.atan2(se - a, Y - k) - Math.atan2(q, O)) < Math.PI / 2 ? ([k, a, p, b] = this.#i.subarray(2, 6), this.#s.push(NaN, NaN, NaN, NaN, ((k + p) / 2 - f) / A, ((a + b) / 2 - g) / m), [k, a, Y, se] = this.#i.subarray(14, 18), this.#t.push(NaN, NaN, NaN, NaN, ((Y + k) / 2 - f) / A, ((se + a) / 2 - g) / m), !0) : ([Y, se, k, a, p, b] = this.#i.subarray(0, 6), this.#s.push(((Y + 5 * k) / 6 - f) / A, ((se + 5 * a) / 6 - g) / m, ((5 * k + p) / 6 - f) / A, ((5 * a + b) / 6 - g) / m, ((k + p) / 2 - f) / A, ((a + b) / 2 - g) / m), [p, b, k, a, Y, se] = this.#i.subarray(12, 18), this.#t.push(((Y + 5 * k) / 6 - f) / A, ((se + 5 * a) / 6 - g) / m, ((5 * k + p) / 6 - f) / A, ((5 * a + b) / 6 - g) / m, ((k + p) / 2 - f) / A, ((a + b) / 2 - g) / m), !0));
        }
        toSVGPath() {
          if (this.isEmpty())
            return "";
          const d = this.#s, c = this.#t, f = this.#i.subarray(4, 6), g = this.#i.subarray(16, 18), [A, m, k, a] = this.#e, [p, b, y, C] = this.#v();
          if (isNaN(this.#i[6]) && !this.isEmpty())
            return `M${(this.#i[2] - A) / k} ${(this.#i[3] - m) / a} L${(this.#i[4] - A) / k} ${(this.#i[5] - m) / a} L${p} ${b} L${y} ${C} L${(this.#i[16] - A) / k} ${(this.#i[17] - m) / a} L${(this.#i[14] - A) / k} ${(this.#i[15] - m) / a} Z`;
          const M = [];
          M.push(`M${d[4]} ${d[5]}`);
          for (let L = 6; L < d.length; L += 6)
            isNaN(d[L]) ? M.push(`L${d[L + 4]} ${d[L + 5]}`) : M.push(`C${d[L]} ${d[L + 1]} ${d[L + 2]} ${d[L + 3]} ${d[L + 4]} ${d[L + 5]}`);
          M.push(`L${(f[0] - A) / k} ${(f[1] - m) / a} L${p} ${b} L${y} ${C} L${(g[0] - A) / k} ${(g[1] - m) / a}`);
          for (let L = c.length - 6; L >= 6; L -= 6)
            isNaN(c[L]) ? M.push(`L${c[L + 4]} ${c[L + 5]}`) : M.push(`C${c[L]} ${c[L + 1]} ${c[L + 2]} ${c[L + 3]} ${c[L + 4]} ${c[L + 5]}`);
          return M.push(`L${c[4]} ${c[5]} Z`), M.join(" ");
        }
        getOutlines() {
          const d = this.#s, c = this.#t, f = this.#i, g = f.subarray(4, 6), A = f.subarray(16, 18), [m, k, a, p] = this.#e, b = new Float64Array((this.#o?.length ?? 0) + 2);
          for (let q = 0, Y = b.length - 2; q < Y; q += 2)
            b[q] = (this.#o[q] - m) / a, b[q + 1] = (this.#o[q + 1] - k) / p;
          b[b.length - 2] = (this.#a - m) / a, b[b.length - 1] = (this.#u - k) / p;
          const [y, C, M, L] = this.#v();
          if (isNaN(f[6]) && !this.isEmpty()) {
            const q = new Float64Array(36);
            return q.set([NaN, NaN, NaN, NaN, (f[2] - m) / a, (f[3] - k) / p, NaN, NaN, NaN, NaN, (f[4] - m) / a, (f[5] - k) / p, NaN, NaN, NaN, NaN, y, C, NaN, NaN, NaN, NaN, M, L, NaN, NaN, NaN, NaN, (f[16] - m) / a, (f[17] - k) / p, NaN, NaN, NaN, NaN, (f[14] - m) / a, (f[15] - k) / p], 0), new o(q, b, this.#e, this.#d, this.#n, this.#r);
          }
          const P = new Float64Array(this.#s.length + 24 + this.#t.length);
          let O = d.length;
          for (let q = 0; q < O; q += 2) {
            if (isNaN(d[q])) {
              P[q] = P[q + 1] = NaN;
              continue;
            }
            P[q] = d[q], P[q + 1] = d[q + 1];
          }
          P.set([NaN, NaN, NaN, NaN, (g[0] - m) / a, (g[1] - k) / p, NaN, NaN, NaN, NaN, y, C, NaN, NaN, NaN, NaN, M, L, NaN, NaN, NaN, NaN, (A[0] - m) / a, (A[1] - k) / p], O), O += 24;
          for (let q = c.length - 6; q >= 6; q -= 6)
            for (let Y = 0; Y < 6; Y += 2) {
              if (isNaN(c[q + Y])) {
                P[O] = P[O + 1] = NaN, O += 2;
                continue;
              }
              P[O] = c[q + Y], P[O + 1] = c[q + Y + 1], O += 2;
            }
          return P.set([NaN, NaN, NaN, NaN, c[4], c[5]], O), new o(P, b, this.#e, this.#d, this.#n, this.#r);
        }
      }
      class o extends s {
        #e;
        #t = null;
        #n;
        #r;
        #s;
        #i;
        #a;
        constructor(d, c, f, g, A, m) {
          super(), this.#a = d, this.#s = c, this.#e = f, this.#i = g, this.#n = A, this.#r = m, this.#h(m);
          const {
            x: k,
            y: a,
            width: p,
            height: b
          } = this.#t;
          for (let y = 0, C = d.length; y < C; y += 2)
            d[y] = (d[y] - k) / p, d[y + 1] = (d[y + 1] - a) / b;
          for (let y = 0, C = c.length; y < C; y += 2)
            c[y] = (c[y] - k) / p, c[y + 1] = (c[y + 1] - a) / b;
        }
        toSVGPath() {
          const d = [`M${this.#a[4]} ${this.#a[5]}`];
          for (let c = 6, f = this.#a.length; c < f; c += 6) {
            if (isNaN(this.#a[c])) {
              d.push(`L${this.#a[c + 4]} ${this.#a[c + 5]}`);
              continue;
            }
            d.push(`C${this.#a[c]} ${this.#a[c + 1]} ${this.#a[c + 2]} ${this.#a[c + 3]} ${this.#a[c + 4]} ${this.#a[c + 5]}`);
          }
          return d.push("Z"), d.join(" ");
        }
        serialize([d, c, f, g], A) {
          const m = f - d, k = g - c;
          let a, p;
          switch (A) {
            case 0:
              a = this.#u(this.#a, d, g, m, -k), p = this.#u(this.#s, d, g, m, -k);
              break;
            case 90:
              a = this.#l(this.#a, d, c, m, k), p = this.#l(this.#s, d, c, m, k);
              break;
            case 180:
              a = this.#u(this.#a, f, c, -m, k), p = this.#u(this.#s, f, c, -m, k);
              break;
            case 270:
              a = this.#l(this.#a, f, g, -m, -k), p = this.#l(this.#s, f, g, -m, -k);
              break;
          }
          return {
            outline: Array.from(a),
            points: [Array.from(p)]
          };
        }
        #u(d, c, f, g, A) {
          const m = new Float64Array(d.length);
          for (let k = 0, a = d.length; k < a; k += 2)
            m[k] = c + d[k] * g, m[k + 1] = f + d[k + 1] * A;
          return m;
        }
        #l(d, c, f, g, A) {
          const m = new Float64Array(d.length);
          for (let k = 0, a = d.length; k < a; k += 2)
            m[k] = c + d[k + 1] * g, m[k + 1] = f + d[k] * A;
          return m;
        }
        #h(d) {
          const c = this.#a;
          let f = c[4], g = c[5], A = f, m = g, k = f, a = g, p = f, b = g;
          const y = d ? Math.max : Math.min;
          for (let O = 6, q = c.length; O < q; O += 6) {
            if (isNaN(c[O]))
              A = Math.min(A, c[O + 4]), m = Math.min(m, c[O + 5]), k = Math.max(k, c[O + 4]), a = Math.max(a, c[O + 5]), b < c[O + 5] ? (p = c[O + 4], b = c[O + 5]) : b === c[O + 5] && (p = y(p, c[O + 4]));
            else {
              const Y = n.Util.bezierBoundingBox(f, g, ...c.slice(O, O + 6));
              A = Math.min(A, Y[0]), m = Math.min(m, Y[1]), k = Math.max(k, Y[2]), a = Math.max(a, Y[3]), b < Y[3] ? (p = Y[2], b = Y[3]) : b === Y[3] && (p = y(p, Y[2]));
            }
            f = c[O + 4], g = c[O + 5];
          }
          const C = A - this.#n, M = m - this.#n, L = k - A + 2 * this.#n, P = a - m + 2 * this.#n;
          this.#t = {
            x: C,
            y: M,
            width: L,
            height: P,
            lastPoint: [p, b]
          };
        }
        get box() {
          return this.#t;
        }
        getNewOutline(d, c) {
          const {
            x: f,
            y: g,
            width: A,
            height: m
          } = this.#t, [k, a, p, b] = this.#e, y = A * p, C = m * b, M = f * p + k, L = g * b + a, P = new l({
            x: this.#s[0] * y + M,
            y: this.#s[1] * C + L
          }, this.#e, this.#i, d, this.#r, c ?? this.#n);
          for (let O = 2; O < this.#s.length; O += 2)
            P.add({
              x: this.#s[O] * y + M,
              y: this.#s[O + 1] * C + L
            });
          return P.getOutlines();
        }
      }
    }
  ),
  /***/
  362: (
    /***/
    (i, e, t) => {
      t.d(e, {
        /* harmony export */
        EditorToolbar: () => (
          /* binding */
          r
        ),
        /* harmony export */
        HighlightToolbar: () => (
          /* binding */
          s
        )
        /* harmony export */
      });
      var n = t(419);
      class r {
        #e = null;
        #t = null;
        #n;
        #r = null;
        constructor(l) {
          this.#n = l;
        }
        render() {
          const l = this.#e = document.createElement("div");
          l.className = "editToolbar", l.setAttribute("role", "toolbar"), l.addEventListener("contextmenu", n.noContextMenu), l.addEventListener("pointerdown", r.#s);
          const o = this.#r = document.createElement("div");
          o.className = "buttons", l.append(o);
          const h = this.#n.toolbarPosition;
          if (h) {
            const {
              style: d
            } = l, c = this.#n._uiManager.direction === "ltr" ? 1 - h[0] : h[0];
            d.insetInlineEnd = `${100 * c}%`, d.top = `calc(${100 * h[1]}% + var(--editor-toolbar-vert-offset))`;
          }
          return this.#l(), l;
        }
        static #s(l) {
          l.stopPropagation();
        }
        #i(l) {
          this.#n._focusEventsAllowed = !1, l.preventDefault(), l.stopPropagation();
        }
        #a(l) {
          this.#n._focusEventsAllowed = !0, l.preventDefault(), l.stopPropagation();
        }
        #u(l) {
          l.addEventListener("focusin", this.#i.bind(this), {
            capture: !0
          }), l.addEventListener("focusout", this.#a.bind(this), {
            capture: !0
          }), l.addEventListener("contextmenu", n.noContextMenu);
        }
        hide() {
          this.#e.classList.add("hidden"), this.#t?.hideDropdown();
        }
        show() {
          this.#e.classList.remove("hidden");
        }
        #l() {
          const l = document.createElement("button");
          l.className = "delete", l.tabIndex = 0, l.setAttribute("data-l10n-id", `pdfjs-editor-remove-${this.#n.editorType}-button`), this.#u(l), l.addEventListener("click", (o) => {
            this.#n._uiManager.delete();
          }), this.#r.append(l);
        }
        get #h() {
          const l = document.createElement("div");
          return l.className = "divider", l;
        }
        addAltTextButton(l) {
          this.#u(l), this.#r.prepend(l, this.#h);
        }
        addColorPicker(l) {
          this.#t = l;
          const o = l.renderButton();
          this.#u(o), this.#r.prepend(o, this.#h);
        }
        remove() {
          this.#e.remove(), this.#t?.destroy(), this.#t = null;
        }
      }
      class s {
        #e = null;
        #t = null;
        #n;
        constructor(l) {
          this.#n = l;
        }
        #r() {
          const l = this.#t = document.createElement("div");
          l.className = "editToolbar", l.setAttribute("role", "toolbar"), l.addEventListener("contextmenu", n.noContextMenu);
          const o = this.#e = document.createElement("div");
          return o.className = "buttons", l.append(o), this.#i(), l;
        }
        #s(l, o) {
          let h = 0, d = 0;
          for (const c of l) {
            const f = c.y + c.height;
            if (f < h)
              continue;
            const g = c.x + (o ? c.width : 0);
            if (f > h) {
              d = g, h = f;
              continue;
            }
            o ? g > d && (d = g) : g < d && (d = g);
          }
          return [o ? 1 - d : d, h];
        }
        show(l, o, h) {
          const [d, c] = this.#s(o, h), {
            style: f
          } = this.#t ||= this.#r();
          l.append(this.#t), f.insetInlineEnd = `${100 * d}%`, f.top = `calc(${100 * c}% + var(--editor-toolbar-vert-offset))`;
        }
        hide() {
          this.#t.remove();
        }
        #i() {
          const l = document.createElement("button");
          l.className = "highlightButton", l.tabIndex = 0, l.setAttribute("data-l10n-id", "pdfjs-highlight-floating-button1");
          const o = document.createElement("span");
          l.append(o), o.className = "visuallyHidden", o.setAttribute("data-l10n-id", "pdfjs-highlight-floating-button-label"), l.addEventListener("contextmenu", n.noContextMenu), l.addEventListener("click", () => {
            this.#n.highlightSelection("floating_button");
          }), this.#e.append(l);
        }
      }
    }
  ),
  /***/
  830: (
    /***/
    (i, e, t) => {
      t.d(e, {
        /* harmony export */
        AnnotationEditorUIManager: () => (
          /* binding */
          g
        ),
        /* harmony export */
        ColorManager: () => (
          /* binding */
          f
        ),
        /* harmony export */
        KeyboardManager: () => (
          /* binding */
          c
        ),
        /* harmony export */
        bindEvents: () => (
          /* binding */
          u
        ),
        /* harmony export */
        opacityToHex: () => (
          /* binding */
          l
        )
        /* harmony export */
      });
      var n = t(292), r = t(419), s = t(362);
      function u(A, m, k) {
        for (const a of k)
          m.addEventListener(a, A[a].bind(A));
      }
      function l(A) {
        return Math.round(Math.min(255, Math.max(1, 255 * A))).toString(16).padStart(2, "0");
      }
      class o {
        #e = 0;
        constructor() {
        }
        get id() {
          return `${n.AnnotationEditorPrefix}${this.#e++}`;
        }
      }
      class h {
        #e = (0, n.getUuid)();
        #t = 0;
        #n = null;
        static get _isSVGFittingCanvas() {
          const m = 'data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>', a = new OffscreenCanvas(1, 3).getContext("2d"), p = new Image();
          p.src = m;
          const b = p.decode().then(() => (a.drawImage(p, 0, 0, 1, 1, 0, 0, 1, 3), new Uint32Array(a.getImageData(0, 0, 1, 1).data.buffer)[0] === 0));
          return (0, n.shadow)(this, "_isSVGFittingCanvas", b);
        }
        async #r(m, k) {
          this.#n ||= /* @__PURE__ */ new Map();
          let a = this.#n.get(m);
          if (a === null)
            return null;
          if (a?.bitmap)
            return a.refCounter += 1, a;
          try {
            a ||= {
              bitmap: null,
              id: `image_${this.#e}_${this.#t++}`,
              refCounter: 0,
              isSvg: !1
            };
            let p;
            if (typeof k == "string" ? (a.url = k, p = await (0, r.fetchData)(k, "blob")) : p = a.file = k, p.type === "image/svg+xml") {
              const b = h._isSVGFittingCanvas, y = new FileReader(), C = new Image(), M = new Promise((L, P) => {
                C.onload = () => {
                  a.bitmap = C, a.isSvg = !0, L();
                }, y.onload = async () => {
                  const O = a.svgUrl = y.result;
                  C.src = await b ? `${O}#svgView(preserveAspectRatio(none))` : O;
                }, C.onerror = y.onerror = P;
              });
              y.readAsDataURL(p), await M;
            } else
              a.bitmap = await createImageBitmap(p);
            a.refCounter = 1;
          } catch (p) {
            console.error(p), a = null;
          }
          return this.#n.set(m, a), a && this.#n.set(a.id, a), a;
        }
        async getFromFile(m) {
          const {
            lastModified: k,
            name: a,
            size: p,
            type: b
          } = m;
          return this.#r(`${k}_${a}_${p}_${b}`, m);
        }
        async getFromUrl(m) {
          return this.#r(m, m);
        }
        async getFromId(m) {
          this.#n ||= /* @__PURE__ */ new Map();
          const k = this.#n.get(m);
          return k ? k.bitmap ? (k.refCounter += 1, k) : k.file ? this.getFromFile(k.file) : this.getFromUrl(k.url) : null;
        }
        getSvgUrl(m) {
          const k = this.#n.get(m);
          return k?.isSvg ? k.svgUrl : null;
        }
        deleteId(m) {
          this.#n ||= /* @__PURE__ */ new Map();
          const k = this.#n.get(m);
          k && (k.refCounter -= 1, k.refCounter === 0 && (k.bitmap = null));
        }
        isValidId(m) {
          return m.startsWith(`image_${this.#e}_`);
        }
      }
      class d {
        #e = [];
        #t = !1;
        #n;
        #r = -1;
        constructor(m = 128) {
          this.#n = m;
        }
        add({
          cmd: m,
          undo: k,
          post: a,
          mustExec: p,
          type: b = NaN,
          overwriteIfSameType: y = !1,
          keepUndo: C = !1
        }) {
          if (p && m(), this.#t)
            return;
          const M = {
            cmd: m,
            undo: k,
            post: a,
            type: b
          };
          if (this.#r === -1) {
            this.#e.length > 0 && (this.#e.length = 0), this.#r = 0, this.#e.push(M);
            return;
          }
          if (y && this.#e[this.#r].type === b) {
            C && (M.undo = this.#e[this.#r].undo), this.#e[this.#r] = M;
            return;
          }
          const L = this.#r + 1;
          L === this.#n ? this.#e.splice(0, 1) : (this.#r = L, L < this.#e.length && this.#e.splice(L)), this.#e.push(M);
        }
        undo() {
          if (this.#r === -1)
            return;
          this.#t = !0;
          const {
            undo: m,
            post: k
          } = this.#e[this.#r];
          m(), k?.(), this.#t = !1, this.#r -= 1;
        }
        redo() {
          if (this.#r < this.#e.length - 1) {
            this.#r += 1, this.#t = !0;
            const {
              cmd: m,
              post: k
            } = this.#e[this.#r];
            m(), k?.(), this.#t = !1;
          }
        }
        hasSomethingToUndo() {
          return this.#r !== -1;
        }
        hasSomethingToRedo() {
          return this.#r < this.#e.length - 1;
        }
        destroy() {
          this.#e = null;
        }
      }
      class c {
        constructor(m) {
          this.buffer = [], this.callbacks = /* @__PURE__ */ new Map(), this.allKeys = /* @__PURE__ */ new Set();
          const {
            isMac: k
          } = n.FeatureTest.platform;
          for (const [a, p, b = {}] of m)
            for (const y of a) {
              const C = y.startsWith("mac+");
              k && C ? (this.callbacks.set(y.slice(4), {
                callback: p,
                options: b
              }), this.allKeys.add(y.split("+").at(-1))) : !k && !C && (this.callbacks.set(y, {
                callback: p,
                options: b
              }), this.allKeys.add(y.split("+").at(-1)));
            }
        }
        #e(m) {
          m.altKey && this.buffer.push("alt"), m.ctrlKey && this.buffer.push("ctrl"), m.metaKey && this.buffer.push("meta"), m.shiftKey && this.buffer.push("shift"), this.buffer.push(m.key);
          const k = this.buffer.join("+");
          return this.buffer.length = 0, k;
        }
        exec(m, k) {
          if (!this.allKeys.has(k.key))
            return;
          const a = this.callbacks.get(this.#e(k));
          if (!a)
            return;
          const {
            callback: p,
            options: {
              bubbles: b = !1,
              args: y = [],
              checker: C = null
            }
          } = a;
          C && !C(m, k) || (p.bind(m, ...y, k)(), b || (k.stopPropagation(), k.preventDefault()));
        }
      }
      class f {
        static _colorsMapping = /* @__PURE__ */ new Map([["CanvasText", [0, 0, 0]], ["Canvas", [255, 255, 255]]]);
        get _colors() {
          const m = /* @__PURE__ */ new Map([["CanvasText", null], ["Canvas", null]]);
          return (0, r.getColorValues)(m), (0, n.shadow)(this, "_colors", m);
        }
        convert(m) {
          const k = (0, r.getRGB)(m);
          if (!window.matchMedia("(forced-colors: active)").matches)
            return k;
          for (const [a, p] of this._colors)
            if (p.every((b, y) => b === k[y]))
              return f._colorsMapping.get(a);
          return k;
        }
        getHexCode(m) {
          const k = this._colors.get(m);
          return k ? n.Util.makeHexColor(...k) : m;
        }
      }
      class g {
        #e = null;
        #t = /* @__PURE__ */ new Map();
        #n = /* @__PURE__ */ new Map();
        #r = null;
        #s = null;
        #i = null;
        #a = new d();
        #u = 0;
        #l = /* @__PURE__ */ new Set();
        #h = null;
        #d = null;
        #c = /* @__PURE__ */ new Set();
        #o = !1;
        #m = null;
        #p = null;
        #f = null;
        #v = !1;
        #g = null;
        #y = new o();
        #A = !1;
        #_ = !1;
        #T = null;
        #L = null;
        #M = null;
        #w = n.AnnotationEditorType.NONE;
        #b = /* @__PURE__ */ new Set();
        #k = null;
        #S = null;
        #C = null;
        #E = this.blur.bind(this);
        #R = this.focus.bind(this);
        #D = this.copy.bind(this);
        #I = this.cut.bind(this);
        #F = this.paste.bind(this);
        #N = this.keydown.bind(this);
        #q = this.keyup.bind(this);
        #G = this.onEditingAction.bind(this);
        #X = this.onPageChanging.bind(this);
        #U = this.onScaleChanging.bind(this);
        #O = this.#se.bind(this);
        #P = this.onRotationChanging.bind(this);
        #$ = {
          isEditing: !1,
          isEmpty: !0,
          hasSomethingToUndo: !1,
          hasSomethingToRedo: !1,
          hasSelectedEditor: !1,
          hasSelectedText: !1
        };
        #V = [0, 0];
        #B = null;
        #H = null;
        #K = null;
        static TRANSLATE_SMALL = 1;
        static TRANSLATE_BIG = 10;
        static get _keyboardManager() {
          const m = g.prototype, k = (y) => y.#H.contains(document.activeElement) && document.activeElement.tagName !== "BUTTON" && y.hasSomethingToControl(), a = (y, {
            target: C
          }) => {
            if (C instanceof HTMLInputElement) {
              const {
                type: M
              } = C;
              return M !== "text" && M !== "number";
            }
            return !0;
          }, p = this.TRANSLATE_SMALL, b = this.TRANSLATE_BIG;
          return (0, n.shadow)(this, "_keyboardManager", new c([[["ctrl+a", "mac+meta+a"], m.selectAll, {
            checker: a
          }], [["ctrl+z", "mac+meta+z"], m.undo, {
            checker: a
          }], [["ctrl+y", "ctrl+shift+z", "mac+meta+shift+z", "ctrl+shift+Z", "mac+meta+shift+Z"], m.redo, {
            checker: a
          }], [["Backspace", "alt+Backspace", "ctrl+Backspace", "shift+Backspace", "mac+Backspace", "mac+alt+Backspace", "mac+ctrl+Backspace", "Delete", "ctrl+Delete", "shift+Delete", "mac+Delete"], m.delete, {
            checker: a
          }], [["Enter", "mac+Enter"], m.addNewEditorFromKeyboard, {
            checker: (y, {
              target: C
            }) => !(C instanceof HTMLButtonElement) && y.#H.contains(C) && !y.isEnterHandled
          }], [[" ", "mac+ "], m.addNewEditorFromKeyboard, {
            checker: (y, {
              target: C
            }) => !(C instanceof HTMLButtonElement) && y.#H.contains(document.activeElement)
          }], [["Escape", "mac+Escape"], m.unselectAll], [["ArrowLeft", "mac+ArrowLeft"], m.translateSelectedEditors, {
            args: [-p, 0],
            checker: k
          }], [["ctrl+ArrowLeft", "mac+shift+ArrowLeft"], m.translateSelectedEditors, {
            args: [-b, 0],
            checker: k
          }], [["ArrowRight", "mac+ArrowRight"], m.translateSelectedEditors, {
            args: [p, 0],
            checker: k
          }], [["ctrl+ArrowRight", "mac+shift+ArrowRight"], m.translateSelectedEditors, {
            args: [b, 0],
            checker: k
          }], [["ArrowUp", "mac+ArrowUp"], m.translateSelectedEditors, {
            args: [0, -p],
            checker: k
          }], [["ctrl+ArrowUp", "mac+shift+ArrowUp"], m.translateSelectedEditors, {
            args: [0, -b],
            checker: k
          }], [["ArrowDown", "mac+ArrowDown"], m.translateSelectedEditors, {
            args: [0, p],
            checker: k
          }], [["ctrl+ArrowDown", "mac+shift+ArrowDown"], m.translateSelectedEditors, {
            args: [0, b],
            checker: k
          }]]));
        }
        constructor(m, k, a, p, b, y, C, M, L) {
          this.#H = m, this.#K = k, this.#r = a, this._eventBus = p, this._eventBus._on("editingaction", this.#G), this._eventBus._on("pagechanging", this.#X), this._eventBus._on("scalechanging", this.#U), this._eventBus._on("rotationchanging", this.#P), this.#ae(), this.#Q(), this.#s = b.annotationStorage, this.#m = b.filterFactory, this.#S = y, this.#f = C || null, this.#o = M, this.#M = L || null, this.viewParameters = {
            realScale: r.PixelsPerInch.PDF_TO_CSS_UNITS,
            rotation: 0
          }, this.isShiftKeyDown = !1;
        }
        destroy() {
          this.#J(), this.#Z(), this._eventBus._off("editingaction", this.#G), this._eventBus._off("pagechanging", this.#X), this._eventBus._off("scalechanging", this.#U), this._eventBus._off("rotationchanging", this.#P);
          for (const m of this.#n.values())
            m.destroy();
          this.#n.clear(), this.#t.clear(), this.#c.clear(), this.#e = null, this.#b.clear(), this.#a.destroy(), this.#r?.destroy(), this.#g?.hide(), this.#g = null, this.#p && (clearTimeout(this.#p), this.#p = null), this.#B && (clearTimeout(this.#B), this.#B = null), this.#oe();
        }
        async mlGuess(m) {
          return this.#M?.guess(m) || null;
        }
        get hasMLManager() {
          return !!this.#M;
        }
        get hcmFilter() {
          return (0, n.shadow)(this, "hcmFilter", this.#S ? this.#m.addHCMFilter(this.#S.foreground, this.#S.background) : "none");
        }
        get direction() {
          return (0, n.shadow)(this, "direction", getComputedStyle(this.#H).direction);
        }
        get highlightColors() {
          return (0, n.shadow)(this, "highlightColors", this.#f ? new Map(this.#f.split(",").map((m) => m.split("=").map((k) => k.trim()))) : null);
        }
        get highlightColorNames() {
          return (0, n.shadow)(this, "highlightColorNames", this.highlightColors ? new Map(Array.from(this.highlightColors, (m) => m.reverse())) : null);
        }
        setMainHighlightColorPicker(m) {
          this.#L = m;
        }
        editAltText(m) {
          this.#r?.editAltText(this, m);
        }
        onPageChanging({
          pageNumber: m
        }) {
          this.#u = m - 1;
        }
        focusMainContainer() {
          this.#H.focus();
        }
        findParent(m, k) {
          for (const a of this.#n.values()) {
            const {
              x: p,
              y: b,
              width: y,
              height: C
            } = a.div.getBoundingClientRect();
            if (m >= p && m <= p + y && k >= b && k <= b + C)
              return a;
          }
          return null;
        }
        disableUserSelect(m = !1) {
          this.#K.classList.toggle("noUserSelect", m);
        }
        addShouldRescale(m) {
          this.#c.add(m);
        }
        removeShouldRescale(m) {
          this.#c.delete(m);
        }
        onScaleChanging({
          scale: m
        }) {
          this.commitOrRemove(), this.viewParameters.realScale = m * r.PixelsPerInch.PDF_TO_CSS_UNITS;
          for (const k of this.#c)
            k.onScaleChanging();
        }
        onRotationChanging({
          pagesRotation: m
        }) {
          this.commitOrRemove(), this.viewParameters.rotation = m;
        }
        #Y({
          anchorNode: m
        }) {
          return m.nodeType === Node.TEXT_NODE ? m.parentElement : m;
        }
        highlightSelection(m = "") {
          const k = document.getSelection();
          if (!k || k.isCollapsed)
            return;
          const {
            anchorNode: a,
            anchorOffset: p,
            focusNode: b,
            focusOffset: y
          } = k, C = k.toString(), L = this.#Y(k).closest(".textLayer"), P = this.getSelectionBoxes(L);
          if (P) {
            k.empty(), this.#w === n.AnnotationEditorType.NONE && (this._eventBus.dispatch("showannotationeditorui", {
              source: this,
              mode: n.AnnotationEditorType.HIGHLIGHT
            }), this.showAllEditors("highlight", !0, !0));
            for (const O of this.#n.values())
              if (O.hasTextLayer(L)) {
                O.createAndAddNewEditor({
                  x: 0,
                  y: 0
                }, !1, {
                  methodOfCreation: m,
                  boxes: P,
                  anchorNode: a,
                  anchorOffset: p,
                  focusNode: b,
                  focusOffset: y,
                  text: C
                });
                break;
              }
          }
        }
        #re() {
          const m = document.getSelection();
          if (!m || m.isCollapsed)
            return;
          const a = this.#Y(m).closest(".textLayer"), p = this.getSelectionBoxes(a);
          p && (this.#g ||= new s.HighlightToolbar(this), this.#g.show(a, p, this.direction === "ltr"));
        }
        addToAnnotationStorage(m) {
          !m.isEmpty() && this.#s && !this.#s.has(m.id) && this.#s.setValue(m.id, m);
        }
        #se() {
          const m = document.getSelection();
          if (!m || m.isCollapsed) {
            this.#k && (this.#g?.hide(), this.#k = null, this.#x({
              hasSelectedText: !1
            }));
            return;
          }
          const {
            anchorNode: k
          } = m;
          if (k === this.#k)
            return;
          if (!this.#Y(m).closest(".textLayer")) {
            this.#k && (this.#g?.hide(), this.#k = null, this.#x({
              hasSelectedText: !1
            }));
            return;
          }
          if (this.#g?.hide(), this.#k = k, this.#x({
            hasSelectedText: !0
          }), !(this.#w !== n.AnnotationEditorType.HIGHLIGHT && this.#w !== n.AnnotationEditorType.NONE) && (this.#w === n.AnnotationEditorType.HIGHLIGHT && this.showAllEditors("highlight", !0, !0), this.#v = this.isShiftKeyDown, !this.isShiftKeyDown)) {
            const b = (y) => {
              y.type === "pointerup" && y.button !== 0 || (window.removeEventListener("pointerup", b), window.removeEventListener("blur", b), y.type === "pointerup" && this.#W("main_toolbar"));
            };
            window.addEventListener("pointerup", b), window.addEventListener("blur", b);
          }
        }
        #W(m = "") {
          this.#w === n.AnnotationEditorType.HIGHLIGHT ? this.highlightSelection(m) : this.#o && this.#re();
        }
        #ae() {
          document.addEventListener("selectionchange", this.#O);
        }
        #oe() {
          document.removeEventListener("selectionchange", this.#O);
        }
        #le() {
          window.addEventListener("focus", this.#R), window.addEventListener("blur", this.#E);
        }
        #Z() {
          window.removeEventListener("focus", this.#R), window.removeEventListener("blur", this.#E);
        }
        blur() {
          if (this.isShiftKeyDown = !1, this.#v && (this.#v = !1, this.#W("main_toolbar")), !this.hasSelection)
            return;
          const {
            activeElement: m
          } = document;
          for (const k of this.#b)
            if (k.div.contains(m)) {
              this.#T = [k, m], k._focusEventsAllowed = !1;
              break;
            }
        }
        focus() {
          if (!this.#T)
            return;
          const [m, k] = this.#T;
          this.#T = null, k.addEventListener("focusin", () => {
            m._focusEventsAllowed = !0;
          }, {
            once: !0
          }), k.focus();
        }
        #Q() {
          window.addEventListener("keydown", this.#N), window.addEventListener("keyup", this.#q);
        }
        #J() {
          window.removeEventListener("keydown", this.#N), window.removeEventListener("keyup", this.#q);
        }
        #ee() {
          document.addEventListener("copy", this.#D), document.addEventListener("cut", this.#I), document.addEventListener("paste", this.#F);
        }
        #te() {
          document.removeEventListener("copy", this.#D), document.removeEventListener("cut", this.#I), document.removeEventListener("paste", this.#F);
        }
        addEditListeners() {
          this.#Q(), this.#ee();
        }
        removeEditListeners() {
          this.#J(), this.#te();
        }
        copy(m) {
          if (m.preventDefault(), this.#e?.commitOrRemove(), !this.hasSelection)
            return;
          const k = [];
          for (const a of this.#b) {
            const p = a.serialize(!0);
            p && k.push(p);
          }
          k.length !== 0 && m.clipboardData.setData("application/pdfjs", JSON.stringify(k));
        }
        cut(m) {
          this.copy(m), this.delete();
        }
        paste(m) {
          m.preventDefault();
          const {
            clipboardData: k
          } = m;
          for (const b of k.items)
            for (const y of this.#d)
              if (y.isHandlingMimeForPasting(b.type)) {
                y.paste(b, this.currentLayer);
                return;
              }
          let a = k.getData("application/pdfjs");
          if (!a)
            return;
          try {
            a = JSON.parse(a);
          } catch (b) {
            (0, n.warn)(`paste: "${b.message}".`);
            return;
          }
          if (!Array.isArray(a))
            return;
          this.unselectAll();
          const p = this.currentLayer;
          try {
            const b = [];
            for (const M of a) {
              const L = p.deserialize(M);
              if (!L)
                return;
              b.push(L);
            }
            const y = () => {
              for (const M of b)
                this.#ne(M);
              this.#ie(b);
            }, C = () => {
              for (const M of b)
                M.remove();
            };
            this.addCommands({
              cmd: y,
              undo: C,
              mustExec: !0
            });
          } catch (b) {
            (0, n.warn)(`paste: "${b.message}".`);
          }
        }
        keydown(m) {
          !this.isShiftKeyDown && m.key === "Shift" && (this.isShiftKeyDown = !0), this.#w !== n.AnnotationEditorType.NONE && !this.isEditorHandlingKeyboard && g._keyboardManager.exec(this, m);
        }
        keyup(m) {
          this.isShiftKeyDown && m.key === "Shift" && (this.isShiftKeyDown = !1, this.#v && (this.#v = !1, this.#W("main_toolbar")));
        }
        onEditingAction({
          name: m
        }) {
          switch (m) {
            case "undo":
            case "redo":
            case "delete":
            case "selectAll":
              this[m]();
              break;
            case "highlightSelection":
              this.highlightSelection("context_menu");
              break;
          }
        }
        #x(m) {
          Object.entries(m).some(([a, p]) => this.#$[a] !== p) && (this._eventBus.dispatch("annotationeditorstateschanged", {
            source: this,
            details: Object.assign(this.#$, m)
          }), this.#w === n.AnnotationEditorType.HIGHLIGHT && m.hasSelectedEditor === !1 && this.#z([[n.AnnotationEditorParamsType.HIGHLIGHT_FREE, !0]]));
        }
        #z(m) {
          this._eventBus.dispatch("annotationeditorparamschanged", {
            source: this,
            details: m
          });
        }
        setEditingState(m) {
          m ? (this.#le(), this.#ee(), this.#x({
            isEditing: this.#w !== n.AnnotationEditorType.NONE,
            isEmpty: this.#j(),
            hasSomethingToUndo: this.#a.hasSomethingToUndo(),
            hasSomethingToRedo: this.#a.hasSomethingToRedo(),
            hasSelectedEditor: !1
          })) : (this.#Z(), this.#te(), this.#x({
            isEditing: !1
          }), this.disableUserSelect(!1));
        }
        registerEditorTypes(m) {
          if (!this.#d) {
            this.#d = m;
            for (const k of this.#d)
              this.#z(k.defaultPropertiesToUpdate);
          }
        }
        getId() {
          return this.#y.id;
        }
        get currentLayer() {
          return this.#n.get(this.#u);
        }
        getLayer(m) {
          return this.#n.get(m);
        }
        get currentPageIndex() {
          return this.#u;
        }
        addLayer(m) {
          this.#n.set(m.pageIndex, m), this.#A ? m.enable() : m.disable();
        }
        removeLayer(m) {
          this.#n.delete(m.pageIndex);
        }
        updateMode(m, k = null, a = !1) {
          if (this.#w !== m) {
            if (this.#w = m, m === n.AnnotationEditorType.NONE) {
              this.setEditingState(!1), this.#ce();
              return;
            }
            this.setEditingState(!0), this.#ue(), this.unselectAll();
            for (const p of this.#n.values())
              p.updateMode(m);
            if (!k && a) {
              this.addNewEditorFromKeyboard();
              return;
            }
            if (k) {
              for (const p of this.#t.values())
                if (p.annotationElementId === k) {
                  this.setSelected(p), p.enterInEditMode();
                  break;
                }
            }
          }
        }
        addNewEditorFromKeyboard() {
          this.currentLayer.canCreateNewEmptyEditor() && this.currentLayer.addNewEditor();
        }
        updateToolbar(m) {
          m !== this.#w && this._eventBus.dispatch("switchannotationeditormode", {
            source: this,
            mode: m
          });
        }
        updateParams(m, k) {
          if (this.#d) {
            switch (m) {
              case n.AnnotationEditorParamsType.CREATE:
                this.currentLayer.addNewEditor();
                return;
              case n.AnnotationEditorParamsType.HIGHLIGHT_DEFAULT_COLOR:
                this.#L?.updateColor(k);
                break;
              case n.AnnotationEditorParamsType.HIGHLIGHT_SHOW_ALL:
                this._eventBus.dispatch("reporttelemetry", {
                  source: this,
                  details: {
                    type: "editing",
                    data: {
                      type: "highlight",
                      action: "toggle_visibility"
                    }
                  }
                }), (this.#C ||= /* @__PURE__ */ new Map()).set(m, k), this.showAllEditors("highlight", k);
                break;
            }
            for (const a of this.#b)
              a.updateParams(m, k);
            for (const a of this.#d)
              a.updateDefaultParams(m, k);
          }
        }
        showAllEditors(m, k, a = !1) {
          for (const b of this.#t.values())
            b.editorType === m && b.show(k);
          (this.#C?.get(n.AnnotationEditorParamsType.HIGHLIGHT_SHOW_ALL) ?? !0) !== k && this.#z([[n.AnnotationEditorParamsType.HIGHLIGHT_SHOW_ALL, k]]);
        }
        enableWaiting(m = !1) {
          if (this.#_ !== m) {
            this.#_ = m;
            for (const k of this.#n.values())
              m ? k.disableClick() : k.enableClick(), k.div.classList.toggle("waiting", m);
          }
        }
        #ue() {
          if (!this.#A) {
            this.#A = !0;
            for (const m of this.#n.values())
              m.enable();
            for (const m of this.#t.values())
              m.enable();
          }
        }
        #ce() {
          if (this.unselectAll(), this.#A) {
            this.#A = !1;
            for (const m of this.#n.values())
              m.disable();
            for (const m of this.#t.values())
              m.disable();
          }
        }
        getEditors(m) {
          const k = [];
          for (const a of this.#t.values())
            a.pageIndex === m && k.push(a);
          return k;
        }
        getEditor(m) {
          return this.#t.get(m);
        }
        addEditor(m) {
          this.#t.set(m.id, m);
        }
        removeEditor(m) {
          m.div.contains(document.activeElement) && (this.#p && clearTimeout(this.#p), this.#p = setTimeout(() => {
            this.focusMainContainer(), this.#p = null;
          }, 0)), this.#t.delete(m.id), this.unselect(m), (!m.annotationElementId || !this.#l.has(m.annotationElementId)) && this.#s?.remove(m.id);
        }
        addDeletedAnnotationElement(m) {
          this.#l.add(m.annotationElementId), this.addChangedExistingAnnotation(m), m.deleted = !0;
        }
        isDeletedAnnotationElement(m) {
          return this.#l.has(m);
        }
        removeDeletedAnnotationElement(m) {
          this.#l.delete(m.annotationElementId), this.removeChangedExistingAnnotation(m), m.deleted = !1;
        }
        #ne(m) {
          const k = this.#n.get(m.pageIndex);
          k ? k.addOrRebuild(m) : (this.addEditor(m), this.addToAnnotationStorage(m));
        }
        setActiveEditor(m) {
          this.#e !== m && (this.#e = m, m && this.#z(m.propertiesToUpdate));
        }
        get #he() {
          let m = null;
          for (m of this.#b)
            ;
          return m;
        }
        updateUI(m) {
          this.#he === m && this.#z(m.propertiesToUpdate);
        }
        toggleSelected(m) {
          if (this.#b.has(m)) {
            this.#b.delete(m), m.unselect(), this.#x({
              hasSelectedEditor: this.hasSelection
            });
            return;
          }
          this.#b.add(m), m.select(), this.#z(m.propertiesToUpdate), this.#x({
            hasSelectedEditor: !0
          });
        }
        setSelected(m) {
          for (const k of this.#b)
            k !== m && k.unselect();
          this.#b.clear(), this.#b.add(m), m.select(), this.#z(m.propertiesToUpdate), this.#x({
            hasSelectedEditor: !0
          });
        }
        isSelected(m) {
          return this.#b.has(m);
        }
        get firstSelectedEditor() {
          return this.#b.values().next().value;
        }
        unselect(m) {
          m.unselect(), this.#b.delete(m), this.#x({
            hasSelectedEditor: this.hasSelection
          });
        }
        get hasSelection() {
          return this.#b.size !== 0;
        }
        get isEnterHandled() {
          return this.#b.size === 1 && this.firstSelectedEditor.isEnterHandled;
        }
        undo() {
          this.#a.undo(), this.#x({
            hasSomethingToUndo: this.#a.hasSomethingToUndo(),
            hasSomethingToRedo: !0,
            isEmpty: this.#j()
          });
        }
        redo() {
          this.#a.redo(), this.#x({
            hasSomethingToUndo: !0,
            hasSomethingToRedo: this.#a.hasSomethingToRedo(),
            isEmpty: this.#j()
          });
        }
        addCommands(m) {
          this.#a.add(m), this.#x({
            hasSomethingToUndo: !0,
            hasSomethingToRedo: !1,
            isEmpty: this.#j()
          });
        }
        #j() {
          if (this.#t.size === 0)
            return !0;
          if (this.#t.size === 1)
            for (const m of this.#t.values())
              return m.isEmpty();
          return !1;
        }
        delete() {
          if (this.commitOrRemove(), !this.hasSelection)
            return;
          const m = [...this.#b], k = () => {
            for (const p of m)
              p.remove();
          }, a = () => {
            for (const p of m)
              this.#ne(p);
          };
          this.addCommands({
            cmd: k,
            undo: a,
            mustExec: !0
          });
        }
        commitOrRemove() {
          this.#e?.commitOrRemove();
        }
        hasSomethingToControl() {
          return this.#e || this.hasSelection;
        }
        #ie(m) {
          for (const k of this.#b)
            k.unselect();
          this.#b.clear();
          for (const k of m)
            k.isEmpty() || (this.#b.add(k), k.select());
          this.#x({
            hasSelectedEditor: this.hasSelection
          });
        }
        selectAll() {
          for (const m of this.#b)
            m.commit();
          this.#ie(this.#t.values());
        }
        unselectAll() {
          if (!(this.#e && (this.#e.commitOrRemove(), this.#w !== n.AnnotationEditorType.NONE)) && this.hasSelection) {
            for (const m of this.#b)
              m.unselect();
            this.#b.clear(), this.#x({
              hasSelectedEditor: !1
            });
          }
        }
        translateSelectedEditors(m, k, a = !1) {
          if (a || this.commitOrRemove(), !this.hasSelection)
            return;
          this.#V[0] += m, this.#V[1] += k;
          const [p, b] = this.#V, y = [...this.#b], C = 1e3;
          this.#B && clearTimeout(this.#B), this.#B = setTimeout(() => {
            this.#B = null, this.#V[0] = this.#V[1] = 0, this.addCommands({
              cmd: () => {
                for (const M of y)
                  this.#t.has(M.id) && M.translateInPage(p, b);
              },
              undo: () => {
                for (const M of y)
                  this.#t.has(M.id) && M.translateInPage(-p, -b);
              },
              mustExec: !1
            });
          }, C);
          for (const M of y)
            M.translateInPage(m, k);
        }
        setUpDragSession() {
          if (this.hasSelection) {
            this.disableUserSelect(!0), this.#h = /* @__PURE__ */ new Map();
            for (const m of this.#b)
              this.#h.set(m, {
                savedX: m.x,
                savedY: m.y,
                savedPageIndex: m.pageIndex,
                newX: 0,
                newY: 0,
                newPageIndex: -1
              });
          }
        }
        endDragSession() {
          if (!this.#h)
            return !1;
          this.disableUserSelect(!1);
          const m = this.#h;
          this.#h = null;
          let k = !1;
          for (const [{
            x: p,
            y: b,
            pageIndex: y
          }, C] of m)
            C.newX = p, C.newY = b, C.newPageIndex = y, k ||= p !== C.savedX || b !== C.savedY || y !== C.savedPageIndex;
          if (!k)
            return !1;
          const a = (p, b, y, C) => {
            if (this.#t.has(p.id)) {
              const M = this.#n.get(C);
              M ? p._setParentAndPosition(M, b, y) : (p.pageIndex = C, p.x = b, p.y = y);
            }
          };
          return this.addCommands({
            cmd: () => {
              for (const [p, {
                newX: b,
                newY: y,
                newPageIndex: C
              }] of m)
                a(p, b, y, C);
            },
            undo: () => {
              for (const [p, {
                savedX: b,
                savedY: y,
                savedPageIndex: C
              }] of m)
                a(p, b, y, C);
            },
            mustExec: !0
          }), !0;
        }
        dragSelectedEditors(m, k) {
          if (this.#h)
            for (const a of this.#h.keys())
              a.drag(m, k);
        }
        rebuild(m) {
          if (m.parent === null) {
            const k = this.getLayer(m.pageIndex);
            k ? (k.changeParent(m), k.addOrRebuild(m)) : (this.addEditor(m), this.addToAnnotationStorage(m), m.rebuild());
          } else
            m.parent.addOrRebuild(m);
        }
        get isEditorHandlingKeyboard() {
          return this.getActive()?.shouldGetKeyboardEvents() || this.#b.size === 1 && this.firstSelectedEditor.shouldGetKeyboardEvents();
        }
        isActive(m) {
          return this.#e === m;
        }
        getActive() {
          return this.#e;
        }
        getMode() {
          return this.#w;
        }
        get imageManager() {
          return (0, n.shadow)(this, "imageManager", new h());
        }
        getSelectionBoxes(m) {
          if (!m)
            return null;
          const k = document.getSelection();
          for (let L = 0, P = k.rangeCount; L < P; L++)
            if (!m.contains(k.getRangeAt(L).commonAncestorContainer))
              return null;
          const {
            x: a,
            y: p,
            width: b,
            height: y
          } = m.getBoundingClientRect();
          let C;
          switch (m.getAttribute("data-main-rotation")) {
            case "90":
              C = (L, P, O, q) => ({
                x: (P - p) / y,
                y: 1 - (L + O - a) / b,
                width: q / y,
                height: O / b
              });
              break;
            case "180":
              C = (L, P, O, q) => ({
                x: 1 - (L + O - a) / b,
                y: 1 - (P + q - p) / y,
                width: O / b,
                height: q / y
              });
              break;
            case "270":
              C = (L, P, O, q) => ({
                x: 1 - (P + q - p) / y,
                y: (L - a) / b,
                width: q / y,
                height: O / b
              });
              break;
            default:
              C = (L, P, O, q) => ({
                x: (L - a) / b,
                y: (P - p) / y,
                width: O / b,
                height: q / y
              });
              break;
          }
          const M = [];
          for (let L = 0, P = k.rangeCount; L < P; L++) {
            const O = k.getRangeAt(L);
            if (!O.collapsed)
              for (const {
                x: q,
                y: Y,
                width: se,
                height: me
              } of O.getClientRects())
                se === 0 || me === 0 || M.push(C(q, Y, se, me));
          }
          return M.length === 0 ? null : M;
        }
        addChangedExistingAnnotation({
          annotationElementId: m,
          id: k
        }) {
          (this.#i ||= /* @__PURE__ */ new Map()).set(m, k);
        }
        removeChangedExistingAnnotation({
          annotationElementId: m
        }) {
          this.#i?.delete(m);
        }
        renderAnnotationElement(m) {
          const k = this.#i?.get(m.data.id);
          if (!k)
            return;
          const a = this.#s.getRawValue(k);
          a && (this.#w === n.AnnotationEditorType.NONE && !a.hasBeenModified || a.renderAnnotationElement(m));
        }
      }
    }
  ),
  /***/
  94: (
    /***/
    (i, e, t) => {
      t.d(e, {
        /* harmony export */
        PDFFetchStream: () => (
          /* binding */
          o
        )
        /* harmony export */
      });
      var n = t(292), r = t(490);
      function s(c, f, g) {
        return {
          method: "GET",
          headers: c,
          signal: g.signal,
          mode: "cors",
          credentials: f ? "include" : "same-origin",
          redirect: "follow"
        };
      }
      function u(c) {
        const f = new Headers();
        for (const g in c) {
          const A = c[g];
          A !== void 0 && f.append(g, A);
        }
        return f;
      }
      function l(c) {
        return c instanceof Uint8Array ? c.buffer : c instanceof ArrayBuffer ? c : ((0, n.warn)(`getArrayBuffer - unexpected data format: ${c}`), new Uint8Array(c).buffer);
      }
      class o {
        constructor(f) {
          this.source = f, this.isHttp = /^https?:/i.test(f.url), this.httpHeaders = this.isHttp && f.httpHeaders || {}, this._fullRequestReader = null, this._rangeRequestReaders = [];
        }
        get _progressiveDataLength() {
          return this._fullRequestReader?._loaded ?? 0;
        }
        getFullReader() {
          return (0, n.assert)(!this._fullRequestReader, "PDFFetchStream.getFullReader can only be called once."), this._fullRequestReader = new h(this), this._fullRequestReader;
        }
        getRangeReader(f, g) {
          if (g <= this._progressiveDataLength)
            return null;
          const A = new d(this, f, g);
          return this._rangeRequestReaders.push(A), A;
        }
        cancelAllRequests(f) {
          this._fullRequestReader?.cancel(f);
          for (const g of this._rangeRequestReaders.slice(0))
            g.cancel(f);
        }
      }
      class h {
        constructor(f) {
          this._stream = f, this._reader = null, this._loaded = 0, this._filename = null;
          const g = f.source;
          this._withCredentials = g.withCredentials || !1, this._contentLength = g.length, this._headersCapability = Promise.withResolvers(), this._disableRange = g.disableRange || !1, this._rangeChunkSize = g.rangeChunkSize, !this._rangeChunkSize && !this._disableRange && (this._disableRange = !0), this._abortController = new AbortController(), this._isStreamingSupported = !g.disableStream, this._isRangeSupported = !g.disableRange, this._headers = u(this._stream.httpHeaders);
          const A = g.url;
          fetch(A, s(this._headers, this._withCredentials, this._abortController)).then((m) => {
            if (!(0, r.validateResponseStatus)(m.status))
              throw (0, r.createResponseStatusError)(m.status, A);
            this._reader = m.body.getReader(), this._headersCapability.resolve();
            const k = (b) => m.headers.get(b), {
              allowRangeRequests: a,
              suggestedLength: p
            } = (0, r.validateRangeRequestCapabilities)({
              getResponseHeader: k,
              isHttp: this._stream.isHttp,
              rangeChunkSize: this._rangeChunkSize,
              disableRange: this._disableRange
            });
            this._isRangeSupported = a, this._contentLength = p || this._contentLength, this._filename = (0, r.extractFilenameFromHeader)(k), !this._isStreamingSupported && this._isRangeSupported && this.cancel(new n.AbortException("Streaming is disabled."));
          }).catch(this._headersCapability.reject), this.onProgress = null;
        }
        get headersReady() {
          return this._headersCapability.promise;
        }
        get filename() {
          return this._filename;
        }
        get contentLength() {
          return this._contentLength;
        }
        get isRangeSupported() {
          return this._isRangeSupported;
        }
        get isStreamingSupported() {
          return this._isStreamingSupported;
        }
        async read() {
          await this._headersCapability.promise;
          const {
            value: f,
            done: g
          } = await this._reader.read();
          return g ? {
            value: f,
            done: g
          } : (this._loaded += f.byteLength, this.onProgress?.({
            loaded: this._loaded,
            total: this._contentLength
          }), {
            value: l(f),
            done: !1
          });
        }
        cancel(f) {
          this._reader?.cancel(f), this._abortController.abort();
        }
      }
      class d {
        constructor(f, g, A) {
          this._stream = f, this._reader = null, this._loaded = 0;
          const m = f.source;
          this._withCredentials = m.withCredentials || !1, this._readCapability = Promise.withResolvers(), this._isStreamingSupported = !m.disableStream, this._abortController = new AbortController(), this._headers = u(this._stream.httpHeaders), this._headers.append("Range", `bytes=${g}-${A - 1}`);
          const k = m.url;
          fetch(k, s(this._headers, this._withCredentials, this._abortController)).then((a) => {
            if (!(0, r.validateResponseStatus)(a.status))
              throw (0, r.createResponseStatusError)(a.status, k);
            this._readCapability.resolve(), this._reader = a.body.getReader();
          }).catch(this._readCapability.reject), this.onProgress = null;
        }
        get isStreamingSupported() {
          return this._isStreamingSupported;
        }
        async read() {
          await this._readCapability.promise;
          const {
            value: f,
            done: g
          } = await this._reader.read();
          return g ? {
            value: f,
            done: g
          } : (this._loaded += f.byteLength, this.onProgress?.({
            loaded: this._loaded
          }), {
            value: l(f),
            done: !1
          });
        }
        cancel(f) {
          this._reader?.cancel(f), this._abortController.abort();
        }
      }
    }
  ),
  /***/
  10: (
    /***/
    (i, e, t) => {
      t.d(e, {
        /* harmony export */
        FontFaceObject: () => (
          /* binding */
          s
        ),
        /* harmony export */
        FontLoader: () => (
          /* binding */
          r
        )
        /* harmony export */
      });
      var n = t(292);
      class r {
        #e = /* @__PURE__ */ new Set();
        constructor({
          ownerDocument: l = globalThis.document,
          styleElement: o = null
        }) {
          this._document = l, this.nativeFontFaces = /* @__PURE__ */ new Set(), this.styleElement = null, this.loadingRequests = [], this.loadTestFontId = 0;
        }
        addNativeFontFace(l) {
          this.nativeFontFaces.add(l), this._document.fonts.add(l);
        }
        removeNativeFontFace(l) {
          this.nativeFontFaces.delete(l), this._document.fonts.delete(l);
        }
        insertRule(l) {
          this.styleElement || (this.styleElement = this._document.createElement("style"), this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));
          const o = this.styleElement.sheet;
          o.insertRule(l, o.cssRules.length);
        }
        clear() {
          for (const l of this.nativeFontFaces)
            this._document.fonts.delete(l);
          this.nativeFontFaces.clear(), this.#e.clear(), this.styleElement && (this.styleElement.remove(), this.styleElement = null);
        }
        async loadSystemFont({
          systemFontInfo: l,
          _inspectFont: o
        }) {
          if (!(!l || this.#e.has(l.loadedName))) {
            if ((0, n.assert)(!this.disableFontFace, "loadSystemFont shouldn't be called when `disableFontFace` is set."), this.isFontLoadingAPISupported) {
              const {
                loadedName: h,
                src: d,
                style: c
              } = l, f = new FontFace(h, d, c);
              this.addNativeFontFace(f);
              try {
                await f.load(), this.#e.add(h), o?.(l);
              } catch {
                (0, n.warn)(`Cannot load system font: ${l.baseFontName}, installing it could help to improve PDF rendering.`), this.removeNativeFontFace(f);
              }
              return;
            }
            (0, n.unreachable)("Not implemented: loadSystemFont without the Font Loading API.");
          }
        }
        async bind(l) {
          if (l.attached || l.missingFile && !l.systemFontInfo)
            return;
          if (l.attached = !0, l.systemFontInfo) {
            await this.loadSystemFont(l);
            return;
          }
          if (this.isFontLoadingAPISupported) {
            const h = l.createNativeFontFace();
            if (h) {
              this.addNativeFontFace(h);
              try {
                await h.loaded;
              } catch (d) {
                throw (0, n.warn)(`Failed to load font '${h.family}': '${d}'.`), l.disableFontFace = !0, d;
              }
            }
            return;
          }
          const o = l.createFontFaceRule();
          if (o) {
            if (this.insertRule(o), this.isSyncFontLoadingSupported)
              return;
            await new Promise((h) => {
              const d = this._queueLoadingCallback(h);
              this._prepareFontLoadEvent(l, d);
            });
          }
        }
        get isFontLoadingAPISupported() {
          const l = !!this._document?.fonts;
          return (0, n.shadow)(this, "isFontLoadingAPISupported", l);
        }
        get isSyncFontLoadingSupported() {
          let l = !1;
          return (n.isNodeJS || typeof navigator < "u" && typeof navigator?.userAgent == "string" && /Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent)) && (l = !0), (0, n.shadow)(this, "isSyncFontLoadingSupported", l);
        }
        _queueLoadingCallback(l) {
          function o() {
            for ((0, n.assert)(!d.done, "completeRequest() cannot be called twice."), d.done = !0; h.length > 0 && h[0].done; ) {
              const c = h.shift();
              setTimeout(c.callback, 0);
            }
          }
          const {
            loadingRequests: h
          } = this, d = {
            done: !1,
            complete: o,
            callback: l
          };
          return h.push(d), d;
        }
        get _loadTestFont() {
          const l = atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");
          return (0, n.shadow)(this, "_loadTestFont", l);
        }
        _prepareFontLoadEvent(l, o) {
          function h(q, Y) {
            return q.charCodeAt(Y) << 24 | q.charCodeAt(Y + 1) << 16 | q.charCodeAt(Y + 2) << 8 | q.charCodeAt(Y + 3) & 255;
          }
          function d(q, Y, se, me) {
            const te = q.substring(0, Y), K = q.substring(Y + se);
            return te + me + K;
          }
          let c, f;
          const g = this._document.createElement("canvas");
          g.width = 1, g.height = 1;
          const A = g.getContext("2d");
          let m = 0;
          function k(q, Y) {
            if (++m > 30) {
              (0, n.warn)("Load test font never loaded."), Y();
              return;
            }
            if (A.font = "30px " + q, A.fillText(".", 0, 20), A.getImageData(0, 0, 1, 1).data[3] > 0) {
              Y();
              return;
            }
            setTimeout(k.bind(null, q, Y));
          }
          const a = `lt${Date.now()}${this.loadTestFontId++}`;
          let p = this._loadTestFont;
          p = d(p, 976, a.length, a);
          const y = 16, C = 1482184792;
          let M = h(p, y);
          for (c = 0, f = a.length - 3; c < f; c += 4)
            M = M - C + h(a, c) | 0;
          c < a.length && (M = M - C + h(a + "XXX", c) | 0), p = d(p, y, 4, (0, n.string32)(M));
          const L = `url(data:font/opentype;base64,${btoa(p)});`, P = `@font-face {font-family:"${a}";src:${L}}`;
          this.insertRule(P);
          const O = this._document.createElement("div");
          O.style.visibility = "hidden", O.style.width = O.style.height = "10px", O.style.position = "absolute", O.style.top = O.style.left = "0px";
          for (const q of [l.loadedName, a]) {
            const Y = this._document.createElement("span");
            Y.textContent = "Hi", Y.style.fontFamily = q, O.append(Y);
          }
          this._document.body.append(O), k(a, () => {
            O.remove(), o.complete();
          });
        }
      }
      class s {
        constructor(l, {
          disableFontFace: o = !1,
          ignoreErrors: h = !1,
          inspectFont: d = null
        }) {
          this.compiledGlyphs = /* @__PURE__ */ Object.create(null);
          for (const c in l)
            this[c] = l[c];
          this.disableFontFace = o === !0, this.ignoreErrors = h === !0, this._inspectFont = d;
        }
        createNativeFontFace() {
          if (!this.data || this.disableFontFace)
            return null;
          let l;
          if (!this.cssFontInfo)
            l = new FontFace(this.loadedName, this.data, {});
          else {
            const o = {
              weight: this.cssFontInfo.fontWeight
            };
            this.cssFontInfo.italicAngle && (o.style = `oblique ${this.cssFontInfo.italicAngle}deg`), l = new FontFace(this.cssFontInfo.fontFamily, this.data, o);
          }
          return this._inspectFont?.(this), l;
        }
        createFontFaceRule() {
          if (!this.data || this.disableFontFace)
            return null;
          const l = (0, n.bytesToString)(this.data), o = `url(data:${this.mimetype};base64,${btoa(l)});`;
          let h;
          if (!this.cssFontInfo)
            h = `@font-face {font-family:"${this.loadedName}";src:${o}}`;
          else {
            let d = `font-weight: ${this.cssFontInfo.fontWeight};`;
            this.cssFontInfo.italicAngle && (d += `font-style: oblique ${this.cssFontInfo.italicAngle}deg;`), h = `@font-face {font-family:"${this.cssFontInfo.fontFamily}";${d}src:${o}}`;
          }
          return this._inspectFont?.(this, o), h;
        }
        getPathGenerator(l, o) {
          if (this.compiledGlyphs[o] !== void 0)
            return this.compiledGlyphs[o];
          let h;
          try {
            h = l.get(this.loadedName + "_path_" + o);
          } catch (c) {
            if (!this.ignoreErrors)
              throw c;
            (0, n.warn)(`getPathGenerator - ignoring character: "${c}".`);
          }
          if (!Array.isArray(h) || h.length === 0)
            return this.compiledGlyphs[o] = function(c, f) {
            };
          const d = [];
          for (let c = 0, f = h.length; c < f; )
            switch (h[c++]) {
              case n.FontRenderOps.BEZIER_CURVE_TO:
                {
                  const [g, A, m, k, a, p] = h.slice(c, c + 6);
                  d.push((b) => b.bezierCurveTo(g, A, m, k, a, p)), c += 6;
                }
                break;
              case n.FontRenderOps.MOVE_TO:
                {
                  const [g, A] = h.slice(c, c + 2);
                  d.push((m) => m.moveTo(g, A)), c += 2;
                }
                break;
              case n.FontRenderOps.LINE_TO:
                {
                  const [g, A] = h.slice(c, c + 2);
                  d.push((m) => m.lineTo(g, A)), c += 2;
                }
                break;
              case n.FontRenderOps.QUADRATIC_CURVE_TO:
                {
                  const [g, A, m, k] = h.slice(c, c + 4);
                  d.push((a) => a.quadraticCurveTo(g, A, m, k)), c += 4;
                }
                break;
              case n.FontRenderOps.RESTORE:
                d.push((g) => g.restore());
                break;
              case n.FontRenderOps.SAVE:
                d.push((g) => g.save());
                break;
              case n.FontRenderOps.SCALE:
                (0, n.assert)(d.length === 2, "Scale command is only valid at the third position.");
                break;
              case n.FontRenderOps.TRANSFORM:
                {
                  const [g, A, m, k, a, p] = h.slice(c, c + 6);
                  d.push((b) => b.transform(g, A, m, k, a, p)), c += 6;
                }
                break;
              case n.FontRenderOps.TRANSLATE:
                {
                  const [g, A] = h.slice(c, c + 2);
                  d.push((m) => m.translate(g, A)), c += 2;
                }
                break;
            }
          return this.compiledGlyphs[o] = function(f, g) {
            d[0](f), d[1](f), f.scale(g, -g);
            for (let A = 2, m = d.length; A < m; A++)
              d[A](f);
          };
        }
      }
    }
  ),
  /***/
  62: (
    /***/
    (i, e, t) => {
      t.d(e, {
        /* harmony export */
        Metadata: () => (
          /* binding */
          r
        )
        /* harmony export */
      });
      var n = t(292);
      class r {
        #e;
        #t;
        constructor({
          parsedData: u,
          rawData: l
        }) {
          this.#e = u, this.#t = l;
        }
        getRaw() {
          return this.#t;
        }
        get(u) {
          return this.#e.get(u) ?? null;
        }
        getAll() {
          return (0, n.objectFromMap)(this.#e);
        }
        has(u) {
          return this.#e.has(u);
        }
      }
    }
  ),
  /***/
  457: (
    /***/
    (i, e, t) => {
      t.d(e, {
        /* harmony export */
        PDFNetworkStream: () => (
          /* binding */
          h
        )
        /* harmony export */
      });
      var n = t(292), r = t(490);
      const s = 200, u = 206;
      function l(f) {
        const g = f.response;
        return typeof g != "string" ? g : (0, n.stringToBytes)(g).buffer;
      }
      class o {
        constructor(g, A = {}) {
          this.url = g, this.isHttp = /^https?:/i.test(g), this.httpHeaders = this.isHttp && A.httpHeaders || /* @__PURE__ */ Object.create(null), this.withCredentials = A.withCredentials || !1, this.currXhrId = 0, this.pendingRequests = /* @__PURE__ */ Object.create(null);
        }
        requestRange(g, A, m) {
          const k = {
            begin: g,
            end: A
          };
          for (const a in m)
            k[a] = m[a];
          return this.request(k);
        }
        requestFull(g) {
          return this.request(g);
        }
        request(g) {
          const A = new XMLHttpRequest(), m = this.currXhrId++, k = this.pendingRequests[m] = {
            xhr: A
          };
          A.open("GET", this.url), A.withCredentials = this.withCredentials;
          for (const a in this.httpHeaders) {
            const p = this.httpHeaders[a];
            p !== void 0 && A.setRequestHeader(a, p);
          }
          return this.isHttp && "begin" in g && "end" in g ? (A.setRequestHeader("Range", `bytes=${g.begin}-${g.end - 1}`), k.expectedStatus = u) : k.expectedStatus = s, A.responseType = "arraybuffer", g.onError && (A.onerror = function(a) {
            g.onError(A.status);
          }), A.onreadystatechange = this.onStateChange.bind(this, m), A.onprogress = this.onProgress.bind(this, m), k.onHeadersReceived = g.onHeadersReceived, k.onDone = g.onDone, k.onError = g.onError, k.onProgress = g.onProgress, A.send(null), m;
        }
        onProgress(g, A) {
          const m = this.pendingRequests[g];
          m && m.onProgress?.(A);
        }
        onStateChange(g, A) {
          const m = this.pendingRequests[g];
          if (!m)
            return;
          const k = m.xhr;
          if (k.readyState >= 2 && m.onHeadersReceived && (m.onHeadersReceived(), delete m.onHeadersReceived), k.readyState !== 4 || !(g in this.pendingRequests))
            return;
          if (delete this.pendingRequests[g], k.status === 0 && this.isHttp) {
            m.onError?.(k.status);
            return;
          }
          const a = k.status || s;
          if (!(a === s && m.expectedStatus === u) && a !== m.expectedStatus) {
            m.onError?.(k.status);
            return;
          }
          const b = l(k);
          if (a === u) {
            const y = k.getResponseHeader("Content-Range"), C = /bytes (\d+)-(\d+)\/(\d+)/.exec(y);
            m.onDone({
              begin: parseInt(C[1], 10),
              chunk: b
            });
          } else b ? m.onDone({
            begin: 0,
            chunk: b
          }) : m.onError?.(k.status);
        }
        getRequestXhr(g) {
          return this.pendingRequests[g].xhr;
        }
        isPendingRequest(g) {
          return g in this.pendingRequests;
        }
        abortRequest(g) {
          const A = this.pendingRequests[g].xhr;
          delete this.pendingRequests[g], A.abort();
        }
      }
      class h {
        constructor(g) {
          this._source = g, this._manager = new o(g.url, {
            httpHeaders: g.httpHeaders,
            withCredentials: g.withCredentials
          }), this._rangeChunkSize = g.rangeChunkSize, this._fullRequestReader = null, this._rangeRequestReaders = [];
        }
        _onRangeRequestReaderClosed(g) {
          const A = this._rangeRequestReaders.indexOf(g);
          A >= 0 && this._rangeRequestReaders.splice(A, 1);
        }
        getFullReader() {
          return (0, n.assert)(!this._fullRequestReader, "PDFNetworkStream.getFullReader can only be called once."), this._fullRequestReader = new d(this._manager, this._source), this._fullRequestReader;
        }
        getRangeReader(g, A) {
          const m = new c(this._manager, g, A);
          return m.onClosed = this._onRangeRequestReaderClosed.bind(this), this._rangeRequestReaders.push(m), m;
        }
        cancelAllRequests(g) {
          this._fullRequestReader?.cancel(g);
          for (const A of this._rangeRequestReaders.slice(0))
            A.cancel(g);
        }
      }
      class d {
        constructor(g, A) {
          this._manager = g;
          const m = {
            onHeadersReceived: this._onHeadersReceived.bind(this),
            onDone: this._onDone.bind(this),
            onError: this._onError.bind(this),
            onProgress: this._onProgress.bind(this)
          };
          this._url = A.url, this._fullRequestId = g.requestFull(m), this._headersReceivedCapability = Promise.withResolvers(), this._disableRange = A.disableRange || !1, this._contentLength = A.length, this._rangeChunkSize = A.rangeChunkSize, !this._rangeChunkSize && !this._disableRange && (this._disableRange = !0), this._isStreamingSupported = !1, this._isRangeSupported = !1, this._cachedChunks = [], this._requests = [], this._done = !1, this._storedError = void 0, this._filename = null, this.onProgress = null;
        }
        _onHeadersReceived() {
          const g = this._fullRequestId, A = this._manager.getRequestXhr(g), m = (p) => A.getResponseHeader(p), {
            allowRangeRequests: k,
            suggestedLength: a
          } = (0, r.validateRangeRequestCapabilities)({
            getResponseHeader: m,
            isHttp: this._manager.isHttp,
            rangeChunkSize: this._rangeChunkSize,
            disableRange: this._disableRange
          });
          k && (this._isRangeSupported = !0), this._contentLength = a || this._contentLength, this._filename = (0, r.extractFilenameFromHeader)(m), this._isRangeSupported && this._manager.abortRequest(g), this._headersReceivedCapability.resolve();
        }
        _onDone(g) {
          if (g && (this._requests.length > 0 ? this._requests.shift().resolve({
            value: g.chunk,
            done: !1
          }) : this._cachedChunks.push(g.chunk)), this._done = !0, !(this._cachedChunks.length > 0)) {
            for (const A of this._requests)
              A.resolve({
                value: void 0,
                done: !0
              });
            this._requests.length = 0;
          }
        }
        _onError(g) {
          this._storedError = (0, r.createResponseStatusError)(g, this._url), this._headersReceivedCapability.reject(this._storedError);
          for (const A of this._requests)
            A.reject(this._storedError);
          this._requests.length = 0, this._cachedChunks.length = 0;
        }
        _onProgress(g) {
          this.onProgress?.({
            loaded: g.loaded,
            total: g.lengthComputable ? g.total : this._contentLength
          });
        }
        get filename() {
          return this._filename;
        }
        get isRangeSupported() {
          return this._isRangeSupported;
        }
        get isStreamingSupported() {
          return this._isStreamingSupported;
        }
        get contentLength() {
          return this._contentLength;
        }
        get headersReady() {
          return this._headersReceivedCapability.promise;
        }
        async read() {
          if (this._storedError)
            throw this._storedError;
          if (this._cachedChunks.length > 0)
            return {
              value: this._cachedChunks.shift(),
              done: !1
            };
          if (this._done)
            return {
              value: void 0,
              done: !0
            };
          const g = Promise.withResolvers();
          return this._requests.push(g), g.promise;
        }
        cancel(g) {
          this._done = !0, this._headersReceivedCapability.reject(g);
          for (const A of this._requests)
            A.resolve({
              value: void 0,
              done: !0
            });
          this._requests.length = 0, this._manager.isPendingRequest(this._fullRequestId) && this._manager.abortRequest(this._fullRequestId), this._fullRequestReader = null;
        }
      }
      class c {
        constructor(g, A, m) {
          this._manager = g;
          const k = {
            onDone: this._onDone.bind(this),
            onError: this._onError.bind(this),
            onProgress: this._onProgress.bind(this)
          };
          this._url = g.url, this._requestId = g.requestRange(A, m, k), this._requests = [], this._queuedChunk = null, this._done = !1, this._storedError = void 0, this.onProgress = null, this.onClosed = null;
        }
        _close() {
          this.onClosed?.(this);
        }
        _onDone(g) {
          const A = g.chunk;
          this._requests.length > 0 ? this._requests.shift().resolve({
            value: A,
            done: !1
          }) : this._queuedChunk = A, this._done = !0;
          for (const m of this._requests)
            m.resolve({
              value: void 0,
              done: !0
            });
          this._requests.length = 0, this._close();
        }
        _onError(g) {
          this._storedError = (0, r.createResponseStatusError)(g, this._url);
          for (const A of this._requests)
            A.reject(this._storedError);
          this._requests.length = 0, this._queuedChunk = null;
        }
        _onProgress(g) {
          this.isStreamingSupported || this.onProgress?.({
            loaded: g.loaded
          });
        }
        get isStreamingSupported() {
          return !1;
        }
        async read() {
          if (this._storedError)
            throw this._storedError;
          if (this._queuedChunk !== null) {
            const A = this._queuedChunk;
            return this._queuedChunk = null, {
              value: A,
              done: !1
            };
          }
          if (this._done)
            return {
              value: void 0,
              done: !0
            };
          const g = Promise.withResolvers();
          return this._requests.push(g), g.promise;
        }
        cancel(g) {
          this._done = !0;
          for (const A of this._requests)
            A.resolve({
              value: void 0,
              done: !0
            });
          this._requests.length = 0, this._manager.isPendingRequest(this._requestId) && this._manager.abortRequest(this._requestId), this._close();
        }
      }
    }
  ),
  /***/
  490: (
    /***/
    (i, e, t) => {
      t.d(e, {
        createResponseStatusError: () => (
          /* binding */
          o
        ),
        extractFilenameFromHeader: () => (
          /* binding */
          l
        ),
        validateRangeRequestCapabilities: () => (
          /* binding */
          u
        ),
        validateResponseStatus: () => (
          /* binding */
          h
        )
      });
      var n = t(292);
      function r(d) {
        let c = !0, f = g("filename\\*", "i").exec(d);
        if (f) {
          f = f[1];
          let y = a(f);
          return y = unescape(y), y = p(y), y = b(y), m(y);
        }
        if (f = k(d), f) {
          const y = b(f);
          return m(y);
        }
        if (f = g("filename", "i").exec(d), f) {
          f = f[1];
          let y = a(f);
          return y = b(y), m(y);
        }
        function g(y, C) {
          return new RegExp("(?:^|;)\\s*" + y + '\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)', C);
        }
        function A(y, C) {
          if (y) {
            if (!/^[\x00-\xFF]+$/.test(C))
              return C;
            try {
              const M = new TextDecoder(y, {
                fatal: !0
              }), L = (0, n.stringToBytes)(C);
              C = M.decode(L), c = !1;
            } catch {
            }
          }
          return C;
        }
        function m(y) {
          return c && /[\x80-\xff]/.test(y) && (y = A("utf-8", y), c && (y = A("iso-8859-1", y))), y;
        }
        function k(y) {
          const C = [];
          let M;
          const L = g("filename\\*((?!0\\d)\\d+)(\\*?)", "ig");
          for (; (M = L.exec(y)) !== null; ) {
            let [, O, q, Y] = M;
            if (O = parseInt(O, 10), O in C) {
              if (O === 0)
                break;
              continue;
            }
            C[O] = [q, Y];
          }
          const P = [];
          for (let O = 0; O < C.length && O in C; ++O) {
            let [q, Y] = C[O];
            Y = a(Y), q && (Y = unescape(Y), O === 0 && (Y = p(Y))), P.push(Y);
          }
          return P.join("");
        }
        function a(y) {
          if (y.startsWith('"')) {
            const C = y.slice(1).split('\\"');
            for (let M = 0; M < C.length; ++M) {
              const L = C[M].indexOf('"');
              L !== -1 && (C[M] = C[M].slice(0, L), C.length = M + 1), C[M] = C[M].replaceAll(/\\(.)/g, "$1");
            }
            y = C.join('"');
          }
          return y;
        }
        function p(y) {
          const C = y.indexOf("'");
          if (C === -1)
            return y;
          const M = y.slice(0, C), P = y.slice(C + 1).replace(/^[^']*'/, "");
          return A(M, P);
        }
        function b(y) {
          return !y.startsWith("=?") || /[\x00-\x19\x80-\xff]/.test(y) ? y : y.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g, function(C, M, L, P) {
            if (L === "q" || L === "Q")
              return P = P.replaceAll("_", " "), P = P.replaceAll(/=([0-9a-fA-F]{2})/g, function(O, q) {
                return String.fromCharCode(parseInt(q, 16));
              }), A(M, P);
            try {
              P = atob(P);
            } catch {
            }
            return A(M, P);
          });
        }
        return "";
      }
      var s = t(419);
      function u({
        getResponseHeader: d,
        isHttp: c,
        rangeChunkSize: f,
        disableRange: g
      }) {
        const A = {
          allowRangeRequests: !1,
          suggestedLength: void 0
        }, m = parseInt(d("Content-Length"), 10);
        return !Number.isInteger(m) || (A.suggestedLength = m, m <= 2 * f) || g || !c || d("Accept-Ranges") !== "bytes" || (d("Content-Encoding") || "identity") !== "identity" || (A.allowRangeRequests = !0), A;
      }
      function l(d) {
        const c = d("Content-Disposition");
        if (c) {
          let f = r(c);
          if (f.includes("%"))
            try {
              f = decodeURIComponent(f);
            } catch {
            }
          if ((0, s.isPdfFile)(f))
            return f;
        }
        return null;
      }
      function o(d, c) {
        return d === 404 || d === 0 && c.startsWith("file:") ? new n.MissingPDFException('Missing PDF "' + c + '".') : new n.UnexpectedResponseException(`Unexpected server response (${d}) while retrieving PDF "${c}".`, d);
      }
      function h(d) {
        return d === 200 || d === 206;
      }
    }
  ),
  /***/
  786: (
    /***/
    (i, e, t) => {
      t.a(i, async (n, r) => {
        try {
          let f = function(C) {
            const M = d.parse(C);
            return M.protocol === "file:" || M.host ? M : /^[a-z]:[/\\]/i.test(C) ? d.parse(`file:///${C}`) : (M.host || (M.protocol = "file:"), M);
          }, k = function(C, M) {
            return {
              protocol: C.protocol,
              auth: C.auth,
              host: C.hostname,
              port: C.port,
              path: C.path,
              method: "GET",
              headers: M
            };
          };
          t.d(e, {
            /* harmony export */
            PDFNodeStream: () => (
              /* binding */
              g
            )
            /* harmony export */
          });
          var s = t(292), u = t(490);
          let l, o, h, d;
          s.isNodeJS && (l = await import(
            /*webpackIgnore: true*/
            "./__vite-browser-external-DYxpcVy9.js"
          ), o = await import(
            /*webpackIgnore: true*/
            "./__vite-browser-external-DYxpcVy9.js"
          ), h = await import(
            /*webpackIgnore: true*/
            "./__vite-browser-external-DYxpcVy9.js"
          ), d = await import(
            /*webpackIgnore: true*/
            "./__vite-browser-external-DYxpcVy9.js"
          ));
          const c = /^file:\/\/\/[a-zA-Z]:\//;
          class g {
            constructor(M) {
              this.source = M, this.url = f(M.url), this.isHttp = this.url.protocol === "http:" || this.url.protocol === "https:", this.isFsUrl = this.url.protocol === "file:", this.httpHeaders = this.isHttp && M.httpHeaders || {}, this._fullRequestReader = null, this._rangeRequestReaders = [];
            }
            get _progressiveDataLength() {
              return this._fullRequestReader?._loaded ?? 0;
            }
            getFullReader() {
              return (0, s.assert)(!this._fullRequestReader, "PDFNodeStream.getFullReader can only be called once."), this._fullRequestReader = this.isFsUrl ? new b(this) : new a(this), this._fullRequestReader;
            }
            getRangeReader(M, L) {
              if (L <= this._progressiveDataLength)
                return null;
              const P = this.isFsUrl ? new y(this, M, L) : new p(this, M, L);
              return this._rangeRequestReaders.push(P), P;
            }
            cancelAllRequests(M) {
              this._fullRequestReader?.cancel(M);
              for (const L of this._rangeRequestReaders.slice(0))
                L.cancel(M);
            }
          }
          class A {
            constructor(M) {
              this._url = M.url, this._done = !1, this._storedError = null, this.onProgress = null;
              const L = M.source;
              this._contentLength = L.length, this._loaded = 0, this._filename = null, this._disableRange = L.disableRange || !1, this._rangeChunkSize = L.rangeChunkSize, !this._rangeChunkSize && !this._disableRange && (this._disableRange = !0), this._isStreamingSupported = !L.disableStream, this._isRangeSupported = !L.disableRange, this._readableStream = null, this._readCapability = Promise.withResolvers(), this._headersCapability = Promise.withResolvers();
            }
            get headersReady() {
              return this._headersCapability.promise;
            }
            get filename() {
              return this._filename;
            }
            get contentLength() {
              return this._contentLength;
            }
            get isRangeSupported() {
              return this._isRangeSupported;
            }
            get isStreamingSupported() {
              return this._isStreamingSupported;
            }
            async read() {
              if (await this._readCapability.promise, this._done)
                return {
                  value: void 0,
                  done: !0
                };
              if (this._storedError)
                throw this._storedError;
              const M = this._readableStream.read();
              return M === null ? (this._readCapability = Promise.withResolvers(), this.read()) : (this._loaded += M.length, this.onProgress?.({
                loaded: this._loaded,
                total: this._contentLength
              }), {
                value: new Uint8Array(M).buffer,
                done: !1
              });
            }
            cancel(M) {
              if (!this._readableStream) {
                this._error(M);
                return;
              }
              this._readableStream.destroy(M);
            }
            _error(M) {
              this._storedError = M, this._readCapability.resolve();
            }
            _setReadableStream(M) {
              this._readableStream = M, M.on("readable", () => {
                this._readCapability.resolve();
              }), M.on("end", () => {
                M.destroy(), this._done = !0, this._readCapability.resolve();
              }), M.on("error", (L) => {
                this._error(L);
              }), !this._isStreamingSupported && this._isRangeSupported && this._error(new s.AbortException("streaming is disabled")), this._storedError && this._readableStream.destroy(this._storedError);
            }
          }
          class m {
            constructor(M) {
              this._url = M.url, this._done = !1, this._storedError = null, this.onProgress = null, this._loaded = 0, this._readableStream = null, this._readCapability = Promise.withResolvers();
              const L = M.source;
              this._isStreamingSupported = !L.disableStream;
            }
            get isStreamingSupported() {
              return this._isStreamingSupported;
            }
            async read() {
              if (await this._readCapability.promise, this._done)
                return {
                  value: void 0,
                  done: !0
                };
              if (this._storedError)
                throw this._storedError;
              const M = this._readableStream.read();
              return M === null ? (this._readCapability = Promise.withResolvers(), this.read()) : (this._loaded += M.length, this.onProgress?.({
                loaded: this._loaded
              }), {
                value: new Uint8Array(M).buffer,
                done: !1
              });
            }
            cancel(M) {
              if (!this._readableStream) {
                this._error(M);
                return;
              }
              this._readableStream.destroy(M);
            }
            _error(M) {
              this._storedError = M, this._readCapability.resolve();
            }
            _setReadableStream(M) {
              this._readableStream = M, M.on("readable", () => {
                this._readCapability.resolve();
              }), M.on("end", () => {
                M.destroy(), this._done = !0, this._readCapability.resolve();
              }), M.on("error", (L) => {
                this._error(L);
              }), this._storedError && this._readableStream.destroy(this._storedError);
            }
          }
          class a extends A {
            constructor(M) {
              super(M);
              const L = (P) => {
                if (P.statusCode === 404) {
                  const se = new s.MissingPDFException(`Missing PDF "${this._url}".`);
                  this._storedError = se, this._headersCapability.reject(se);
                  return;
                }
                this._headersCapability.resolve(), this._setReadableStream(P);
                const O = (se) => this._readableStream.headers[se.toLowerCase()], {
                  allowRangeRequests: q,
                  suggestedLength: Y
                } = (0, u.validateRangeRequestCapabilities)({
                  getResponseHeader: O,
                  isHttp: M.isHttp,
                  rangeChunkSize: this._rangeChunkSize,
                  disableRange: this._disableRange
                });
                this._isRangeSupported = q, this._contentLength = Y || this._contentLength, this._filename = (0, u.extractFilenameFromHeader)(O);
              };
              this._request = null, this._url.protocol === "http:" ? this._request = o.request(k(this._url, M.httpHeaders), L) : this._request = h.request(k(this._url, M.httpHeaders), L), this._request.on("error", (P) => {
                this._storedError = P, this._headersCapability.reject(P);
              }), this._request.end();
            }
          }
          class p extends m {
            constructor(M, L, P) {
              super(M), this._httpHeaders = {};
              for (const q in M.httpHeaders) {
                const Y = M.httpHeaders[q];
                Y !== void 0 && (this._httpHeaders[q] = Y);
              }
              this._httpHeaders.Range = `bytes=${L}-${P - 1}`;
              const O = (q) => {
                if (q.statusCode === 404) {
                  const Y = new s.MissingPDFException(`Missing PDF "${this._url}".`);
                  this._storedError = Y;
                  return;
                }
                this._setReadableStream(q);
              };
              this._request = null, this._url.protocol === "http:" ? this._request = o.request(k(this._url, this._httpHeaders), O) : this._request = h.request(k(this._url, this._httpHeaders), O), this._request.on("error", (q) => {
                this._storedError = q;
              }), this._request.end();
            }
          }
          class b extends A {
            constructor(M) {
              super(M);
              let L = decodeURIComponent(this._url.path);
              c.test(this._url.href) && (L = L.replace(/^\//, "")), l.promises.lstat(L).then((P) => {
                this._contentLength = P.size, this._setReadableStream(l.createReadStream(L)), this._headersCapability.resolve();
              }, (P) => {
                P.code === "ENOENT" && (P = new s.MissingPDFException(`Missing PDF "${L}".`)), this._storedError = P, this._headersCapability.reject(P);
              });
            }
          }
          class y extends m {
            constructor(M, L, P) {
              super(M);
              let O = decodeURIComponent(this._url.path);
              c.test(this._url.href) && (O = O.replace(/^\//, "")), this._setReadableStream(l.createReadStream(O, {
                start: L,
                end: P - 1
              }));
            }
          }
          r();
        } catch (l) {
          r(l);
        }
      }, 1);
    }
  ),
  /***/
  573: (
    /***/
    (i, e, t) => {
      t.a(i, async (n, r) => {
        try {
          t.d(e, {
            /* harmony export */
            NodeCMapReaderFactory: () => (
              /* binding */
              g
            ),
            /* harmony export */
            NodeCanvasFactory: () => (
              /* binding */
              f
            ),
            /* harmony export */
            NodeFilterFactory: () => (
              /* binding */
              c
            ),
            /* harmony export */
            NodeStandardFontDataFactory: () => (
              /* binding */
              A
            )
            /* harmony export */
          });
          var s = t(583), u = t(292);
          let l, o, h;
          if (u.isNodeJS) {
            l = await import(
              /*webpackIgnore: true*/
              "./__vite-browser-external-DYxpcVy9.js"
            );
            try {
              o = await import(
                /*webpackIgnore: true*/
                "./__vite-browser-external-DYxpcVy9.js"
              );
            } catch {
            }
            try {
              h = await import(
                /*webpackIgnore: true*/
                "./index-BfdXe_BH.js"
              );
            } catch {
            }
          }
          const d = function(m) {
            return l.promises.readFile(m).then((k) => new Uint8Array(k));
          };
          class c extends s.BaseFilterFactory {
          }
          class f extends s.BaseCanvasFactory {
            _createCanvas(k, a) {
              return o.createCanvas(k, a);
            }
          }
          class g extends s.BaseCMapReaderFactory {
            _fetchData(k, a) {
              return d(k).then((p) => ({
                cMapData: p,
                compressionType: a
              }));
            }
          }
          class A extends s.BaseStandardFontDataFactory {
            _fetchData(k) {
              return d(k);
            }
          }
          r();
        } catch (l) {
          r(l);
        }
      }, 1);
    }
  ),
  /***/
  626: (
    /***/
    (i, e, t) => {
      t.d(e, {
        /* harmony export */
        OptionalContentConfig: () => (
          /* binding */
          l
        )
        /* harmony export */
      });
      var n = t(292), r = t(651);
      const s = Symbol("INTERNAL");
      class u {
        #e = !1;
        #t = !1;
        #n = !1;
        #r = !0;
        constructor(h, {
          name: d,
          intent: c,
          usage: f
        }) {
          this.#e = !!(h & n.RenderingIntentFlag.DISPLAY), this.#t = !!(h & n.RenderingIntentFlag.PRINT), this.name = d, this.intent = c, this.usage = f;
        }
        get visible() {
          if (this.#n)
            return this.#r;
          if (!this.#r)
            return !1;
          const {
            print: h,
            view: d
          } = this.usage;
          return this.#e ? d?.viewState !== "OFF" : this.#t ? h?.printState !== "OFF" : !0;
        }
        _setVisible(h, d, c = !1) {
          h !== s && (0, n.unreachable)("Internal method `_setVisible` called."), this.#n = c, this.#r = d;
        }
      }
      class l {
        #e = null;
        #t = /* @__PURE__ */ new Map();
        #n = null;
        #r = null;
        constructor(h, d = n.RenderingIntentFlag.DISPLAY) {
          if (this.renderingIntent = d, this.name = null, this.creator = null, h !== null) {
            this.name = h.name, this.creator = h.creator, this.#r = h.order;
            for (const c of h.groups)
              this.#t.set(c.id, new u(d, c));
            if (h.baseState === "OFF")
              for (const c of this.#t.values())
                c._setVisible(s, !1);
            for (const c of h.on)
              this.#t.get(c)._setVisible(s, !0);
            for (const c of h.off)
              this.#t.get(c)._setVisible(s, !1);
            this.#n = this.getHash();
          }
        }
        #s(h) {
          const d = h.length;
          if (d < 2)
            return !0;
          const c = h[0];
          for (let f = 1; f < d; f++) {
            const g = h[f];
            let A;
            if (Array.isArray(g))
              A = this.#s(g);
            else if (this.#t.has(g))
              A = this.#t.get(g).visible;
            else
              return (0, n.warn)(`Optional content group not found: ${g}`), !0;
            switch (c) {
              case "And":
                if (!A)
                  return !1;
                break;
              case "Or":
                if (A)
                  return !0;
                break;
              case "Not":
                return !A;
              default:
                return !0;
            }
          }
          return c === "And";
        }
        isVisible(h) {
          if (this.#t.size === 0)
            return !0;
          if (!h)
            return (0, n.info)("Optional content group not defined."), !0;
          if (h.type === "OCG")
            return this.#t.has(h.id) ? this.#t.get(h.id).visible : ((0, n.warn)(`Optional content group not found: ${h.id}`), !0);
          if (h.type === "OCMD") {
            if (h.expression)
              return this.#s(h.expression);
            if (!h.policy || h.policy === "AnyOn") {
              for (const d of h.ids) {
                if (!this.#t.has(d))
                  return (0, n.warn)(`Optional content group not found: ${d}`), !0;
                if (this.#t.get(d).visible)
                  return !0;
              }
              return !1;
            } else if (h.policy === "AllOn") {
              for (const d of h.ids) {
                if (!this.#t.has(d))
                  return (0, n.warn)(`Optional content group not found: ${d}`), !0;
                if (!this.#t.get(d).visible)
                  return !1;
              }
              return !0;
            } else if (h.policy === "AnyOff") {
              for (const d of h.ids) {
                if (!this.#t.has(d))
                  return (0, n.warn)(`Optional content group not found: ${d}`), !0;
                if (!this.#t.get(d).visible)
                  return !0;
              }
              return !1;
            } else if (h.policy === "AllOff") {
              for (const d of h.ids) {
                if (!this.#t.has(d))
                  return (0, n.warn)(`Optional content group not found: ${d}`), !0;
                if (this.#t.get(d).visible)
                  return !1;
              }
              return !0;
            }
            return (0, n.warn)(`Unknown optional content policy ${h.policy}.`), !0;
          }
          return (0, n.warn)(`Unknown group type ${h.type}.`), !0;
        }
        setVisibility(h, d = !0) {
          const c = this.#t.get(h);
          if (!c) {
            (0, n.warn)(`Optional content group not found: ${h}`);
            return;
          }
          c._setVisible(s, !!d, !0), this.#e = null;
        }
        setOCGState({
          state: h,
          preserveRB: d
        }) {
          let c;
          for (const f of h) {
            switch (f) {
              case "ON":
              case "OFF":
              case "Toggle":
                c = f;
                continue;
            }
            const g = this.#t.get(f);
            if (g)
              switch (c) {
                case "ON":
                  g._setVisible(s, !0);
                  break;
                case "OFF":
                  g._setVisible(s, !1);
                  break;
                case "Toggle":
                  g._setVisible(s, !g.visible);
                  break;
              }
          }
          this.#e = null;
        }
        get hasInitialVisibility() {
          return this.#n === null || this.getHash() === this.#n;
        }
        getOrder() {
          return this.#t.size ? this.#r ? this.#r.slice() : [...this.#t.keys()] : null;
        }
        getGroups() {
          return this.#t.size > 0 ? (0, n.objectFromMap)(this.#t) : null;
        }
        getGroup(h) {
          return this.#t.get(h) || null;
        }
        getHash() {
          if (this.#e !== null)
            return this.#e;
          const h = new r.MurmurHash3_64();
          for (const [d, c] of this.#t)
            h.update(`${d}:${c.visible}`);
          return this.#e = h.hexdigest();
        }
      }
    }
  ),
  /***/
  814: (
    /***/
    (i, e, t) => {
      t.d(e, {
        /* harmony export */
        cleanupTextLayer: () => (
          /* binding */
          c
        ),
        /* harmony export */
        renderTextLayer: () => (
          /* binding */
          a
        ),
        /* harmony export */
        updateTextLayer: () => (
          /* binding */
          p
        )
        /* harmony export */
      });
      var n = t(292), r = t(419);
      const s = 1e5, u = 30, l = 0.8, o = /* @__PURE__ */ new Map();
      let h = null;
      function d() {
        if (!h) {
          const b = document.createElement("canvas");
          b.className = "hiddenCanvasElement", document.body.append(b), h = b.getContext("2d", {
            alpha: !1
          });
        }
        return h;
      }
      function c() {
        h?.canvas.remove(), h = null;
      }
      function f(b) {
        const y = o.get(b);
        if (y)
          return y;
        const C = d(), M = C.font;
        C.canvas.width = C.canvas.height = u, C.font = `${u}px ${b}`;
        const L = C.measureText("");
        let P = L.fontBoundingBoxAscent, O = Math.abs(L.fontBoundingBoxDescent);
        if (P) {
          const Y = P / (P + O);
          return o.set(b, Y), C.canvas.width = C.canvas.height = 0, C.font = M, Y;
        }
        C.strokeStyle = "red", C.clearRect(0, 0, u, u), C.strokeText("g", 0, 0);
        let q = C.getImageData(0, 0, u, u).data;
        O = 0;
        for (let Y = q.length - 1 - 3; Y >= 0; Y -= 4)
          if (q[Y] > 0) {
            O = Math.ceil(Y / 4 / u);
            break;
          }
        C.clearRect(0, 0, u, u), C.strokeText("A", 0, u), q = C.getImageData(0, 0, u, u).data, P = 0;
        for (let Y = 0, se = q.length; Y < se; Y += 4)
          if (q[Y] > 0) {
            P = u - Math.floor(Y / 4 / u);
            break;
          }
        if (C.canvas.width = C.canvas.height = 0, C.font = M, P) {
          const Y = P / (P + O);
          return o.set(b, Y), Y;
        }
        return o.set(b, l), l;
      }
      function g(b, y, C) {
        const M = document.createElement("span"), L = {
          angle: 0,
          canvasWidth: 0,
          hasText: y.str !== "",
          hasEOL: y.hasEOL,
          fontSize: 0
        };
        b._textDivs.push(M);
        const P = n.Util.transform(b._transform, y.transform);
        let O = Math.atan2(P[1], P[0]);
        const q = C[y.fontName];
        q.vertical && (O += Math.PI / 2);
        const Y = b._fontInspectorEnabled && q.fontSubstitution || q.fontFamily, se = Math.hypot(P[2], P[3]), me = se * f(Y);
        let te, K;
        O === 0 ? (te = P[4], K = P[5] - me) : (te = P[4] + me * Math.sin(O), K = P[5] - me * Math.cos(O));
        const Z = "calc(var(--scale-factor)*", oe = M.style;
        b._container === b._rootContainer ? (oe.left = `${(100 * te / b._pageWidth).toFixed(2)}%`, oe.top = `${(100 * K / b._pageHeight).toFixed(2)}%`) : (oe.left = `${Z}${te.toFixed(2)}px)`, oe.top = `${Z}${K.toFixed(2)}px)`), oe.fontSize = `${Z}${se.toFixed(2)}px)`, oe.fontFamily = Y, L.fontSize = se, M.setAttribute("role", "presentation"), M.textContent = y.str, M.dir = y.dir, b._fontInspectorEnabled && (M.dataset.fontName = q.fontSubstitutionLoadedName || y.fontName), O !== 0 && (L.angle = O * (180 / Math.PI));
        let le = !1;
        if (y.str.length > 1)
          le = !0;
        else if (y.str !== " " && y.transform[0] !== y.transform[3]) {
          const ie = Math.abs(y.transform[0]), pe = Math.abs(y.transform[3]);
          ie !== pe && Math.max(ie, pe) / Math.min(ie, pe) > 1.5 && (le = !0);
        }
        le && (L.canvasWidth = q.vertical ? y.height : y.width), b._textDivProperties.set(M, L), b._isReadableStream && b._layoutText(M);
      }
      function A(b) {
        const {
          div: y,
          scale: C,
          properties: M,
          ctx: L,
          prevFontSize: P,
          prevFontFamily: O
        } = b, {
          style: q
        } = y;
        let Y = "";
        if (M.canvasWidth !== 0 && M.hasText) {
          const {
            fontFamily: se
          } = q, {
            canvasWidth: me,
            fontSize: te
          } = M;
          (P !== te || O !== se) && (L.font = `${te * C}px ${se}`, b.prevFontSize = te, b.prevFontFamily = se);
          const {
            width: K
          } = L.measureText(y.textContent);
          K > 0 && (Y = `scaleX(${me * C / K})`);
        }
        M.angle !== 0 && (Y = `rotate(${M.angle}deg) ${Y}`), Y.length > 0 && (q.transform = Y);
      }
      function m(b) {
        if (b._canceled)
          return;
        const y = b._textDivs, C = b._capability;
        if (y.length > s) {
          C.resolve();
          return;
        }
        if (!b._isReadableStream)
          for (const L of y)
            b._layoutText(L);
        C.resolve();
      }
      class k {
        constructor({
          textContentSource: y,
          container: C,
          viewport: M,
          textDivs: L,
          textDivProperties: P,
          textContentItemsStr: O
        }) {
          this._textContentSource = y, this._isReadableStream = y instanceof ReadableStream, this._container = this._rootContainer = C, this._textDivs = L || [], this._textContentItemsStr = O || [], this._fontInspectorEnabled = !!globalThis.FontInspector?.enabled, this._reader = null, this._textDivProperties = P || /* @__PURE__ */ new WeakMap(), this._canceled = !1, this._capability = Promise.withResolvers(), this._layoutTextParams = {
            prevFontSize: null,
            prevFontFamily: null,
            div: null,
            scale: M.scale * (globalThis.devicePixelRatio || 1),
            properties: null,
            ctx: d()
          };
          const {
            pageWidth: q,
            pageHeight: Y,
            pageX: se,
            pageY: me
          } = M.rawDims;
          this._transform = [1, 0, 0, -1, -se, me + Y], this._pageWidth = q, this._pageHeight = Y, (0, r.setLayerDimensions)(C, M), this._capability.promise.finally(() => {
            this._layoutTextParams = null;
          }).catch(() => {
          });
        }
        get promise() {
          return this._capability.promise;
        }
        cancel() {
          this._canceled = !0, this._reader && (this._reader.cancel(new n.AbortException("TextLayer task cancelled.")).catch(() => {
          }), this._reader = null), this._capability.reject(new n.AbortException("TextLayer task cancelled."));
        }
        _processItems(y, C) {
          for (const M of y) {
            if (M.str === void 0) {
              if (M.type === "beginMarkedContentProps" || M.type === "beginMarkedContent") {
                const L = this._container;
                this._container = document.createElement("span"), this._container.classList.add("markedContent"), M.id !== null && this._container.setAttribute("id", `${M.id}`), L.append(this._container);
              } else M.type === "endMarkedContent" && (this._container = this._container.parentNode);
              continue;
            }
            this._textContentItemsStr.push(M.str), g(this, M, C);
          }
        }
        _layoutText(y) {
          const C = this._layoutTextParams.properties = this._textDivProperties.get(y);
          if (this._layoutTextParams.div = y, A(this._layoutTextParams), C.hasText && this._container.append(y), C.hasEOL) {
            const M = document.createElement("br");
            M.setAttribute("role", "presentation"), this._container.append(M);
          }
        }
        _render() {
          const {
            promise: y,
            resolve: C,
            reject: M
          } = Promise.withResolvers();
          let L = /* @__PURE__ */ Object.create(null);
          if (this._isReadableStream) {
            const P = () => {
              this._reader.read().then(({
                value: O,
                done: q
              }) => {
                if (q) {
                  C();
                  return;
                }
                Object.assign(L, O.styles), this._processItems(O.items, L), P();
              }, M);
            };
            this._reader = this._textContentSource.getReader(), P();
          } else if (this._textContentSource) {
            const {
              items: P,
              styles: O
            } = this._textContentSource;
            this._processItems(P, O), C();
          } else
            throw new Error('No "textContentSource" parameter specified.');
          y.then(() => {
            L = null, m(this);
          }, this._capability.reject);
        }
      }
      function a(b) {
        const y = new k(b);
        return y._render(), y;
      }
      function p({
        container: b,
        viewport: y,
        textDivs: C,
        textDivProperties: M,
        mustRotate: L = !0,
        mustRescale: P = !0
      }) {
        if (L && (0, r.setLayerDimensions)(b, {
          rotation: y.rotation
        }), P) {
          const O = d(), Y = {
            prevFontSize: null,
            prevFontFamily: null,
            div: null,
            scale: y.scale * (globalThis.devicePixelRatio || 1),
            properties: null,
            ctx: O
          };
          for (const se of C)
            Y.properties = M.get(se), Y.div = se, A(Y);
        }
      }
    }
  ),
  /***/
  585: (
    /***/
    (i, e, t) => {
      t.d(e, {
        /* harmony export */
        PDFDataTransportStream: () => (
          /* binding */
          s
        )
        /* harmony export */
      });
      var n = t(292), r = t(419);
      class s {
        constructor(h, {
          disableRange: d = !1,
          disableStream: c = !1
        }) {
          (0, n.assert)(h, 'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');
          const {
            length: f,
            initialData: g,
            progressiveDone: A,
            contentDispositionFilename: m
          } = h;
          if (this._queuedChunks = [], this._progressiveDone = A, this._contentDispositionFilename = m, g?.length > 0) {
            const k = g instanceof Uint8Array && g.byteLength === g.buffer.byteLength ? g.buffer : new Uint8Array(g).buffer;
            this._queuedChunks.push(k);
          }
          this._pdfDataRangeTransport = h, this._isStreamingSupported = !c, this._isRangeSupported = !d, this._contentLength = f, this._fullRequestReader = null, this._rangeReaders = [], h.addRangeListener((k, a) => {
            this._onReceiveData({
              begin: k,
              chunk: a
            });
          }), h.addProgressListener((k, a) => {
            this._onProgress({
              loaded: k,
              total: a
            });
          }), h.addProgressiveReadListener((k) => {
            this._onReceiveData({
              chunk: k
            });
          }), h.addProgressiveDoneListener(() => {
            this._onProgressiveDone();
          }), h.transportReady();
        }
        _onReceiveData({
          begin: h,
          chunk: d
        }) {
          const c = d instanceof Uint8Array && d.byteLength === d.buffer.byteLength ? d.buffer : new Uint8Array(d).buffer;
          if (h === void 0)
            this._fullRequestReader ? this._fullRequestReader._enqueue(c) : this._queuedChunks.push(c);
          else {
            const f = this._rangeReaders.some(function(g) {
              return g._begin !== h ? !1 : (g._enqueue(c), !0);
            });
            (0, n.assert)(f, "_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.");
          }
        }
        get _progressiveDataLength() {
          return this._fullRequestReader?._loaded ?? 0;
        }
        _onProgress(h) {
          h.total === void 0 ? this._rangeReaders[0]?.onProgress?.({
            loaded: h.loaded
          }) : this._fullRequestReader?.onProgress?.({
            loaded: h.loaded,
            total: h.total
          });
        }
        _onProgressiveDone() {
          this._fullRequestReader?.progressiveDone(), this._progressiveDone = !0;
        }
        _removeRangeReader(h) {
          const d = this._rangeReaders.indexOf(h);
          d >= 0 && this._rangeReaders.splice(d, 1);
        }
        getFullReader() {
          (0, n.assert)(!this._fullRequestReader, "PDFDataTransportStream.getFullReader can only be called once.");
          const h = this._queuedChunks;
          return this._queuedChunks = null, new u(this, h, this._progressiveDone, this._contentDispositionFilename);
        }
        getRangeReader(h, d) {
          if (d <= this._progressiveDataLength)
            return null;
          const c = new l(this, h, d);
          return this._pdfDataRangeTransport.requestDataRange(h, d), this._rangeReaders.push(c), c;
        }
        cancelAllRequests(h) {
          this._fullRequestReader?.cancel(h);
          for (const d of this._rangeReaders.slice(0))
            d.cancel(h);
          this._pdfDataRangeTransport.abort();
        }
      }
      class u {
        constructor(h, d, c = !1, f = null) {
          this._stream = h, this._done = c || !1, this._filename = (0, r.isPdfFile)(f) ? f : null, this._queuedChunks = d || [], this._loaded = 0;
          for (const g of this._queuedChunks)
            this._loaded += g.byteLength;
          this._requests = [], this._headersReady = Promise.resolve(), h._fullRequestReader = this, this.onProgress = null;
        }
        _enqueue(h) {
          this._done || (this._requests.length > 0 ? this._requests.shift().resolve({
            value: h,
            done: !1
          }) : this._queuedChunks.push(h), this._loaded += h.byteLength);
        }
        get headersReady() {
          return this._headersReady;
        }
        get filename() {
          return this._filename;
        }
        get isRangeSupported() {
          return this._stream._isRangeSupported;
        }
        get isStreamingSupported() {
          return this._stream._isStreamingSupported;
        }
        get contentLength() {
          return this._stream._contentLength;
        }
        async read() {
          if (this._queuedChunks.length > 0)
            return {
              value: this._queuedChunks.shift(),
              done: !1
            };
          if (this._done)
            return {
              value: void 0,
              done: !0
            };
          const h = Promise.withResolvers();
          return this._requests.push(h), h.promise;
        }
        cancel(h) {
          this._done = !0;
          for (const d of this._requests)
            d.resolve({
              value: void 0,
              done: !0
            });
          this._requests.length = 0;
        }
        progressiveDone() {
          this._done || (this._done = !0);
        }
      }
      class l {
        constructor(h, d, c) {
          this._stream = h, this._begin = d, this._end = c, this._queuedChunk = null, this._requests = [], this._done = !1, this.onProgress = null;
        }
        _enqueue(h) {
          if (!this._done) {
            if (this._requests.length === 0)
              this._queuedChunk = h;
            else {
              this._requests.shift().resolve({
                value: h,
                done: !1
              });
              for (const c of this._requests)
                c.resolve({
                  value: void 0,
                  done: !0
                });
              this._requests.length = 0;
            }
            this._done = !0, this._stream._removeRangeReader(this);
          }
        }
        get isStreamingSupported() {
          return !1;
        }
        async read() {
          if (this._queuedChunk) {
            const d = this._queuedChunk;
            return this._queuedChunk = null, {
              value: d,
              done: !1
            };
          }
          if (this._done)
            return {
              value: void 0,
              done: !0
            };
          const h = Promise.withResolvers();
          return this._requests.push(h), h.promise;
        }
        cancel(h) {
          this._done = !0;
          for (const d of this._requests)
            d.resolve({
              value: void 0,
              done: !0
            });
          this._requests.length = 0, this._stream._removeRangeReader(this);
        }
      }
    }
  ),
  /***/
  164: (
    /***/
    (i, e, t) => {
      t.d(e, {
        /* harmony export */
        GlobalWorkerOptions: () => (
          /* binding */
          n
        )
        /* harmony export */
      });
      class n {
        static #e = null;
        static #t = "";
        static get workerPort() {
          return this.#e;
        }
        static set workerPort(s) {
          if (!(typeof Worker < "u" && s instanceof Worker) && s !== null)
            throw new Error("Invalid `workerPort` type.");
          this.#e = s;
        }
        static get workerSrc() {
          return this.#t;
        }
        static set workerSrc(s) {
          if (typeof s != "string")
            throw new Error("Invalid `workerSrc` type.");
          this.#t = s;
        }
      }
    }
  ),
  /***/
  284: (
    /***/
    (i, e, t) => {
      t.d(e, {
        /* harmony export */
        XfaLayer: () => (
          /* binding */
          r
        )
        /* harmony export */
      });
      var n = t(50);
      class r {
        static setupStorage(u, l, o, h, d) {
          const c = h.getValue(l, {
            value: null
          });
          switch (o.name) {
            case "textarea":
              if (c.value !== null && (u.textContent = c.value), d === "print")
                break;
              u.addEventListener("input", (f) => {
                h.setValue(l, {
                  value: f.target.value
                });
              });
              break;
            case "input":
              if (o.attributes.type === "radio" || o.attributes.type === "checkbox") {
                if (c.value === o.attributes.xfaOn ? u.setAttribute("checked", !0) : c.value === o.attributes.xfaOff && u.removeAttribute("checked"), d === "print")
                  break;
                u.addEventListener("change", (f) => {
                  h.setValue(l, {
                    value: f.target.checked ? f.target.getAttribute("xfaOn") : f.target.getAttribute("xfaOff")
                  });
                });
              } else {
                if (c.value !== null && u.setAttribute("value", c.value), d === "print")
                  break;
                u.addEventListener("input", (f) => {
                  h.setValue(l, {
                    value: f.target.value
                  });
                });
              }
              break;
            case "select":
              if (c.value !== null) {
                u.setAttribute("value", c.value);
                for (const f of o.children)
                  f.attributes.value === c.value ? f.attributes.selected = !0 : f.attributes.hasOwnProperty("selected") && delete f.attributes.selected;
              }
              u.addEventListener("input", (f) => {
                const g = f.target.options, A = g.selectedIndex === -1 ? "" : g[g.selectedIndex].value;
                h.setValue(l, {
                  value: A
                });
              });
              break;
          }
        }
        static setAttributes({
          html: u,
          element: l,
          storage: o = null,
          intent: h,
          linkService: d
        }) {
          const {
            attributes: c
          } = l, f = u instanceof HTMLAnchorElement;
          c.type === "radio" && (c.name = `${c.name}-${h}`);
          for (const [g, A] of Object.entries(c))
            if (A != null)
              switch (g) {
                case "class":
                  A.length && u.setAttribute(g, A.join(" "));
                  break;
                case "dataId":
                  break;
                case "id":
                  u.setAttribute("data-element-id", A);
                  break;
                case "style":
                  Object.assign(u.style, A);
                  break;
                case "textContent":
                  u.textContent = A;
                  break;
                default:
                  (!f || g !== "href" && g !== "newWindow") && u.setAttribute(g, A);
              }
          f && d.addLinkAttributes(u, c.href, c.newWindow), o && c.dataId && this.setupStorage(u, c.dataId, l, o);
        }
        static render(u) {
          const l = u.annotationStorage, o = u.linkService, h = u.xfaHtml, d = u.intent || "display", c = document.createElement(h.name);
          h.attributes && this.setAttributes({
            html: c,
            element: h,
            intent: d,
            linkService: o
          });
          const f = d !== "richText", g = u.div;
          if (g.append(c), u.viewport) {
            const k = `matrix(${u.viewport.transform.join(",")})`;
            g.style.transform = k;
          }
          f && g.setAttribute("class", "xfaLayer xfaFont");
          const A = [];
          if (h.children.length === 0) {
            if (h.value) {
              const k = document.createTextNode(h.value);
              c.append(k), f && n.XfaText.shouldBuildText(h.name) && A.push(k);
            }
            return {
              textDivs: A
            };
          }
          const m = [[h, -1, c]];
          for (; m.length > 0; ) {
            const [k, a, p] = m.at(-1);
            if (a + 1 === k.children.length) {
              m.pop();
              continue;
            }
            const b = k.children[++m.at(-1)[1]];
            if (b === null)
              continue;
            const {
              name: y
            } = b;
            if (y === "#text") {
              const M = document.createTextNode(b.value);
              A.push(M), p.append(M);
              continue;
            }
            const C = b?.attributes?.xmlns ? document.createElementNS(b.attributes.xmlns, y) : document.createElement(y);
            if (p.append(C), b.attributes && this.setAttributes({
              html: C,
              element: b,
              storage: l,
              intent: d,
              linkService: o
            }), b.children?.length > 0)
              m.push([b, -1, C]);
            else if (b.value) {
              const M = document.createTextNode(b.value);
              f && n.XfaText.shouldBuildText(y) && A.push(M), C.append(M);
            }
          }
          for (const k of g.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))
            k.setAttribute("readOnly", !0);
          return {
            textDivs: A
          };
        }
        static update(u) {
          const l = `matrix(${u.viewport.transform.join(",")})`;
          u.div.style.transform = l, u.div.hidden = !1;
        }
      }
    }
  ),
  /***/
  50: (
    /***/
    (i, e, t) => {
      t.d(e, {
        /* harmony export */
        XfaText: () => (
          /* binding */
          n
        )
        /* harmony export */
      });
      class n {
        static textContent(s) {
          const u = [], l = {
            items: u,
            styles: /* @__PURE__ */ Object.create(null)
          };
          function o(h) {
            if (!h)
              return;
            let d = null;
            const c = h.name;
            if (c === "#text")
              d = h.value;
            else if (n.shouldBuildText(c))
              h?.attributes?.textContent ? d = h.attributes.textContent : h.value && (d = h.value);
            else return;
            if (d !== null && u.push({
              str: d
            }), !!h.children)
              for (const f of h.children)
                o(f);
          }
          return o(s), l;
        }
        static shouldBuildText(s) {
          return !(s === "textarea" || s === "input" || s === "option" || s === "select");
        }
      }
    }
  ),
  /***/
  228: (
    /***/
    (i, e, t) => {
      t.a(i, async (n, r) => {
        try {
          t.d(e, {
            /* harmony export */
            AbortException: () => (
              /* reexport safe */
              s.AbortException
            ),
            /* harmony export */
            AnnotationEditorLayer: () => (
              /* reexport safe */
              h.AnnotationEditorLayer
            ),
            /* harmony export */
            AnnotationEditorParamsType: () => (
              /* reexport safe */
              s.AnnotationEditorParamsType
            ),
            /* harmony export */
            AnnotationEditorType: () => (
              /* reexport safe */
              s.AnnotationEditorType
            ),
            /* harmony export */
            AnnotationEditorUIManager: () => (
              /* reexport safe */
              d.AnnotationEditorUIManager
            ),
            /* harmony export */
            AnnotationLayer: () => (
              /* reexport safe */
              c.AnnotationLayer
            ),
            /* harmony export */
            AnnotationMode: () => (
              /* reexport safe */
              s.AnnotationMode
            ),
            /* harmony export */
            CMapCompressionType: () => (
              /* reexport safe */
              s.CMapCompressionType
            ),
            /* harmony export */
            ColorPicker: () => (
              /* reexport safe */
              f.ColorPicker
            ),
            /* harmony export */
            DOMSVGFactory: () => (
              /* reexport safe */
              l.DOMSVGFactory
            ),
            /* harmony export */
            DrawLayer: () => (
              /* reexport safe */
              g.DrawLayer
            ),
            /* harmony export */
            FeatureTest: () => (
              /* reexport safe */
              s.FeatureTest
            ),
            /* harmony export */
            GlobalWorkerOptions: () => (
              /* reexport safe */
              A.GlobalWorkerOptions
            ),
            /* harmony export */
            ImageKind: () => (
              /* reexport safe */
              s.ImageKind
            ),
            /* harmony export */
            InvalidPDFException: () => (
              /* reexport safe */
              s.InvalidPDFException
            ),
            /* harmony export */
            MissingPDFException: () => (
              /* reexport safe */
              s.MissingPDFException
            ),
            /* harmony export */
            OPS: () => (
              /* reexport safe */
              s.OPS
            ),
            /* harmony export */
            Outliner: () => (
              /* reexport safe */
              m.Outliner
            ),
            /* harmony export */
            PDFDataRangeTransport: () => (
              /* reexport safe */
              u.PDFDataRangeTransport
            ),
            /* harmony export */
            PDFDateString: () => (
              /* reexport safe */
              l.PDFDateString
            ),
            /* harmony export */
            PDFWorker: () => (
              /* reexport safe */
              u.PDFWorker
            ),
            /* harmony export */
            PasswordResponses: () => (
              /* reexport safe */
              s.PasswordResponses
            ),
            /* harmony export */
            PermissionFlag: () => (
              /* reexport safe */
              s.PermissionFlag
            ),
            /* harmony export */
            PixelsPerInch: () => (
              /* reexport safe */
              l.PixelsPerInch
            ),
            /* harmony export */
            RenderingCancelledException: () => (
              /* reexport safe */
              l.RenderingCancelledException
            ),
            /* harmony export */
            UnexpectedResponseException: () => (
              /* reexport safe */
              s.UnexpectedResponseException
            ),
            /* harmony export */
            Util: () => (
              /* reexport safe */
              s.Util
            ),
            /* harmony export */
            VerbosityLevel: () => (
              /* reexport safe */
              s.VerbosityLevel
            ),
            /* harmony export */
            XfaLayer: () => (
              /* reexport safe */
              k.XfaLayer
            ),
            /* harmony export */
            build: () => (
              /* reexport safe */
              u.build
            ),
            /* harmony export */
            createValidAbsoluteUrl: () => (
              /* reexport safe */
              s.createValidAbsoluteUrl
            ),
            /* harmony export */
            fetchData: () => (
              /* reexport safe */
              l.fetchData
            ),
            /* harmony export */
            getDocument: () => (
              /* reexport safe */
              u.getDocument
            ),
            /* harmony export */
            getFilenameFromUrl: () => (
              /* reexport safe */
              l.getFilenameFromUrl
            ),
            /* harmony export */
            getPdfFilenameFromUrl: () => (
              /* reexport safe */
              l.getPdfFilenameFromUrl
            ),
            /* harmony export */
            getXfaPageViewport: () => (
              /* reexport safe */
              l.getXfaPageViewport
            ),
            /* harmony export */
            isDataScheme: () => (
              /* reexport safe */
              l.isDataScheme
            ),
            /* harmony export */
            isPdfFile: () => (
              /* reexport safe */
              l.isPdfFile
            ),
            /* harmony export */
            noContextMenu: () => (
              /* reexport safe */
              l.noContextMenu
            ),
            /* harmony export */
            normalizeUnicode: () => (
              /* reexport safe */
              s.normalizeUnicode
            ),
            /* harmony export */
            renderTextLayer: () => (
              /* reexport safe */
              o.renderTextLayer
            ),
            /* harmony export */
            setLayerDimensions: () => (
              /* reexport safe */
              l.setLayerDimensions
            ),
            /* harmony export */
            shadow: () => (
              /* reexport safe */
              s.shadow
            ),
            /* harmony export */
            updateTextLayer: () => (
              /* reexport safe */
              o.updateTextLayer
            ),
            /* harmony export */
            version: () => (
              /* reexport safe */
              u.version
            )
            /* harmony export */
          });
          var s = t(292), u = t(831), l = t(419), o = t(814), h = t(731), d = t(830), c = t(976), f = t(259), g = t(47), A = t(164), m = t(61), k = t(284), a = n([u]);
          u = (a.then ? (await a)() : a)[0];
          const p = "4.2.67", b = "49b388101";
          r();
        } catch (p) {
          r(p);
        }
      });
    }
  ),
  /***/
  178: (
    /***/
    (i, e, t) => {
      t.d(e, {
        /* harmony export */
        MessageHandler: () => (
          /* binding */
          l
        )
        /* harmony export */
      });
      var n = t(292);
      const r = {
        UNKNOWN: 0,
        DATA: 1,
        ERROR: 2
      }, s = {
        UNKNOWN: 0,
        CANCEL: 1,
        CANCEL_COMPLETE: 2,
        CLOSE: 3,
        ENQUEUE: 4,
        ERROR: 5,
        PULL: 6,
        PULL_COMPLETE: 7,
        START_COMPLETE: 8
      };
      function u(o) {
        switch (o instanceof Error || typeof o == "object" && o !== null || (0, n.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'), o.name) {
          case "AbortException":
            return new n.AbortException(o.message);
          case "MissingPDFException":
            return new n.MissingPDFException(o.message);
          case "PasswordException":
            return new n.PasswordException(o.message, o.code);
          case "UnexpectedResponseException":
            return new n.UnexpectedResponseException(o.message, o.status);
          case "UnknownErrorException":
            return new n.UnknownErrorException(o.message, o.details);
          default:
            return new n.UnknownErrorException(o.message, o.toString());
        }
      }
      class l {
        constructor(h, d, c) {
          this.sourceName = h, this.targetName = d, this.comObj = c, this.callbackId = 1, this.streamId = 1, this.streamSinks = /* @__PURE__ */ Object.create(null), this.streamControllers = /* @__PURE__ */ Object.create(null), this.callbackCapabilities = /* @__PURE__ */ Object.create(null), this.actionHandler = /* @__PURE__ */ Object.create(null), this._onComObjOnMessage = (f) => {
            const g = f.data;
            if (g.targetName !== this.sourceName)
              return;
            if (g.stream) {
              this.#t(g);
              return;
            }
            if (g.callback) {
              const m = g.callbackId, k = this.callbackCapabilities[m];
              if (!k)
                throw new Error(`Cannot resolve callback ${m}`);
              if (delete this.callbackCapabilities[m], g.callback === r.DATA)
                k.resolve(g.data);
              else if (g.callback === r.ERROR)
                k.reject(u(g.reason));
              else
                throw new Error("Unexpected callback case");
              return;
            }
            const A = this.actionHandler[g.action];
            if (!A)
              throw new Error(`Unknown action from worker: ${g.action}`);
            if (g.callbackId) {
              const m = this.sourceName, k = g.sourceName;
              new Promise(function(a) {
                a(A(g.data));
              }).then(function(a) {
                c.postMessage({
                  sourceName: m,
                  targetName: k,
                  callback: r.DATA,
                  callbackId: g.callbackId,
                  data: a
                });
              }, function(a) {
                c.postMessage({
                  sourceName: m,
                  targetName: k,
                  callback: r.ERROR,
                  callbackId: g.callbackId,
                  reason: u(a)
                });
              });
              return;
            }
            if (g.streamId) {
              this.#e(g);
              return;
            }
            A(g.data);
          }, c.addEventListener("message", this._onComObjOnMessage);
        }
        on(h, d) {
          const c = this.actionHandler;
          if (c[h])
            throw new Error(`There is already an actionName called "${h}"`);
          c[h] = d;
        }
        send(h, d, c) {
          this.comObj.postMessage({
            sourceName: this.sourceName,
            targetName: this.targetName,
            action: h,
            data: d
          }, c);
        }
        sendWithPromise(h, d, c) {
          const f = this.callbackId++, g = Promise.withResolvers();
          this.callbackCapabilities[f] = g;
          try {
            this.comObj.postMessage({
              sourceName: this.sourceName,
              targetName: this.targetName,
              action: h,
              callbackId: f,
              data: d
            }, c);
          } catch (A) {
            g.reject(A);
          }
          return g.promise;
        }
        sendWithStream(h, d, c, f) {
          const g = this.streamId++, A = this.sourceName, m = this.targetName, k = this.comObj;
          return new ReadableStream({
            start: (a) => {
              const p = Promise.withResolvers();
              return this.streamControllers[g] = {
                controller: a,
                startCall: p,
                pullCall: null,
                cancelCall: null,
                isClosed: !1
              }, k.postMessage({
                sourceName: A,
                targetName: m,
                action: h,
                streamId: g,
                data: d,
                desiredSize: a.desiredSize
              }, f), p.promise;
            },
            pull: (a) => {
              const p = Promise.withResolvers();
              return this.streamControllers[g].pullCall = p, k.postMessage({
                sourceName: A,
                targetName: m,
                stream: s.PULL,
                streamId: g,
                desiredSize: a.desiredSize
              }), p.promise;
            },
            cancel: (a) => {
              (0, n.assert)(a instanceof Error, "cancel must have a valid reason");
              const p = Promise.withResolvers();
              return this.streamControllers[g].cancelCall = p, this.streamControllers[g].isClosed = !0, k.postMessage({
                sourceName: A,
                targetName: m,
                stream: s.CANCEL,
                streamId: g,
                reason: u(a)
              }), p.promise;
            }
          }, c);
        }
        #e(h) {
          const d = h.streamId, c = this.sourceName, f = h.sourceName, g = this.comObj, A = this, m = this.actionHandler[h.action], k = {
            enqueue(a, p = 1, b) {
              if (this.isCancelled)
                return;
              const y = this.desiredSize;
              this.desiredSize -= p, y > 0 && this.desiredSize <= 0 && (this.sinkCapability = Promise.withResolvers(), this.ready = this.sinkCapability.promise), g.postMessage({
                sourceName: c,
                targetName: f,
                stream: s.ENQUEUE,
                streamId: d,
                chunk: a
              }, b);
            },
            close() {
              this.isCancelled || (this.isCancelled = !0, g.postMessage({
                sourceName: c,
                targetName: f,
                stream: s.CLOSE,
                streamId: d
              }), delete A.streamSinks[d]);
            },
            error(a) {
              (0, n.assert)(a instanceof Error, "error must have a valid reason"), !this.isCancelled && (this.isCancelled = !0, g.postMessage({
                sourceName: c,
                targetName: f,
                stream: s.ERROR,
                streamId: d,
                reason: u(a)
              }));
            },
            sinkCapability: Promise.withResolvers(),
            onPull: null,
            onCancel: null,
            isCancelled: !1,
            desiredSize: h.desiredSize,
            ready: null
          };
          k.sinkCapability.resolve(), k.ready = k.sinkCapability.promise, this.streamSinks[d] = k, new Promise(function(a) {
            a(m(h.data, k));
          }).then(function() {
            g.postMessage({
              sourceName: c,
              targetName: f,
              stream: s.START_COMPLETE,
              streamId: d,
              success: !0
            });
          }, function(a) {
            g.postMessage({
              sourceName: c,
              targetName: f,
              stream: s.START_COMPLETE,
              streamId: d,
              reason: u(a)
            });
          });
        }
        #t(h) {
          const d = h.streamId, c = this.sourceName, f = h.sourceName, g = this.comObj, A = this.streamControllers[d], m = this.streamSinks[d];
          switch (h.stream) {
            case s.START_COMPLETE:
              h.success ? A.startCall.resolve() : A.startCall.reject(u(h.reason));
              break;
            case s.PULL_COMPLETE:
              h.success ? A.pullCall.resolve() : A.pullCall.reject(u(h.reason));
              break;
            case s.PULL:
              if (!m) {
                g.postMessage({
                  sourceName: c,
                  targetName: f,
                  stream: s.PULL_COMPLETE,
                  streamId: d,
                  success: !0
                });
                break;
              }
              m.desiredSize <= 0 && h.desiredSize > 0 && m.sinkCapability.resolve(), m.desiredSize = h.desiredSize, new Promise(function(k) {
                k(m.onPull?.());
              }).then(function() {
                g.postMessage({
                  sourceName: c,
                  targetName: f,
                  stream: s.PULL_COMPLETE,
                  streamId: d,
                  success: !0
                });
              }, function(k) {
                g.postMessage({
                  sourceName: c,
                  targetName: f,
                  stream: s.PULL_COMPLETE,
                  streamId: d,
                  reason: u(k)
                });
              });
              break;
            case s.ENQUEUE:
              if ((0, n.assert)(A, "enqueue should have stream controller"), A.isClosed)
                break;
              A.controller.enqueue(h.chunk);
              break;
            case s.CLOSE:
              if ((0, n.assert)(A, "close should have stream controller"), A.isClosed)
                break;
              A.isClosed = !0, A.controller.close(), this.#n(A, d);
              break;
            case s.ERROR:
              (0, n.assert)(A, "error should have stream controller"), A.controller.error(u(h.reason)), this.#n(A, d);
              break;
            case s.CANCEL_COMPLETE:
              h.success ? A.cancelCall.resolve() : A.cancelCall.reject(u(h.reason)), this.#n(A, d);
              break;
            case s.CANCEL:
              if (!m)
                break;
              new Promise(function(k) {
                k(m.onCancel?.(u(h.reason)));
              }).then(function() {
                g.postMessage({
                  sourceName: c,
                  targetName: f,
                  stream: s.CANCEL_COMPLETE,
                  streamId: d,
                  success: !0
                });
              }, function(k) {
                g.postMessage({
                  sourceName: c,
                  targetName: f,
                  stream: s.CANCEL_COMPLETE,
                  streamId: d,
                  reason: u(k)
                });
              }), m.sinkCapability.reject(u(h.reason)), m.isCancelled = !0, delete this.streamSinks[d];
              break;
            default:
              throw new Error("Unexpected stream case");
          }
        }
        async #n(h, d) {
          await Promise.allSettled([h.startCall?.promise, h.pullCall?.promise, h.cancelCall?.promise]), delete this.streamControllers[d];
        }
        destroy() {
          this.comObj.removeEventListener("message", this._onComObjOnMessage);
        }
      }
    }
  ),
  /***/
  651: (
    /***/
    (i, e, t) => {
      t.d(e, {
        /* harmony export */
        MurmurHash3_64: () => (
          /* binding */
          u
        )
        /* harmony export */
      });
      const n = 3285377520, r = 4294901760, s = 65535;
      class u {
        constructor(o) {
          this.h1 = o ? o & 4294967295 : n, this.h2 = o ? o & 4294967295 : n;
        }
        update(o) {
          let h, d;
          if (typeof o == "string") {
            h = new Uint8Array(o.length * 2), d = 0;
            for (let M = 0, L = o.length; M < L; M++) {
              const P = o.charCodeAt(M);
              P <= 255 ? h[d++] = P : (h[d++] = P >>> 8, h[d++] = P & 255);
            }
          } else if (ArrayBuffer.isView(o))
            h = o.slice(), d = h.byteLength;
          else
            throw new Error("Invalid data format, must be a string or TypedArray.");
          const c = d >> 2, f = d - c * 4, g = new Uint32Array(h.buffer, 0, c);
          let A = 0, m = 0, k = this.h1, a = this.h2;
          const p = 3432918353, b = 461845907, y = p & s, C = b & s;
          for (let M = 0; M < c; M++)
            M & 1 ? (A = g[M], A = A * p & r | A * y & s, A = A << 15 | A >>> 17, A = A * b & r | A * C & s, k ^= A, k = k << 13 | k >>> 19, k = k * 5 + 3864292196) : (m = g[M], m = m * p & r | m * y & s, m = m << 15 | m >>> 17, m = m * b & r | m * C & s, a ^= m, a = a << 13 | a >>> 19, a = a * 5 + 3864292196);
          switch (A = 0, f) {
            case 3:
              A ^= h[c * 4 + 2] << 16;
            case 2:
              A ^= h[c * 4 + 1] << 8;
            case 1:
              A ^= h[c * 4], A = A * p & r | A * y & s, A = A << 15 | A >>> 17, A = A * b & r | A * C & s, c & 1 ? k ^= A : a ^= A;
          }
          this.h1 = k, this.h2 = a;
        }
        hexdigest() {
          let o = this.h1, h = this.h2;
          return o ^= h >>> 1, o = o * 3981806797 & r | o * 36045 & s, h = h * 4283543511 & r | ((h << 16 | o >>> 16) * 2950163797 & r) >>> 16, o ^= h >>> 1, o = o * 444984403 & r | o * 60499 & s, h = h * 3301882366 & r | ((h << 16 | o >>> 16) * 3120437893 & r) >>> 16, o ^= h >>> 1, (o >>> 0).toString(16).padStart(8, "0") + (h >>> 0).toString(16).padStart(8, "0");
        }
      }
    }
  ),
  /***/
  292: (
    /***/
    (i, e, t) => {
      t.d(e, {
        /* harmony export */
        AbortException: () => (
          /* binding */
          ke
        ),
        /* harmony export */
        AnnotationBorderStyleType: () => (
          /* binding */
          a
        ),
        /* harmony export */
        AnnotationEditorParamsType: () => (
          /* binding */
          f
        ),
        /* harmony export */
        AnnotationEditorPrefix: () => (
          /* binding */
          d
        ),
        /* harmony export */
        AnnotationEditorType: () => (
          /* binding */
          c
        ),
        /* harmony export */
        AnnotationMode: () => (
          /* binding */
          h
        ),
        /* harmony export */
        AnnotationPrefix: () => (
          /* binding */
          V
        ),
        /* harmony export */
        AnnotationType: () => (
          /* binding */
          k
        ),
        /* harmony export */
        BaseException: () => (
          /* binding */
          Z
        ),
        /* harmony export */
        CMapCompressionType: () => (
          /* binding */
          b
        ),
        /* harmony export */
        FONT_IDENTITY_MATRIX: () => (
          /* binding */
          s
        ),
        /* harmony export */
        FeatureTest: () => (
          /* binding */
          S
        ),
        /* harmony export */
        FontRenderOps: () => (
          /* binding */
          $
        ),
        /* harmony export */
        FormatError: () => (
          /* binding */
          we
        ),
        /* harmony export */
        IDENTITY_MATRIX: () => (
          /* binding */
          r
        ),
        /* harmony export */
        ImageKind: () => (
          /* binding */
          m
        ),
        /* harmony export */
        InvalidPDFException: () => (
          /* binding */
          ie
        ),
        /* harmony export */
        LINE_FACTOR: () => (
          /* binding */
          l
        ),
        /* harmony export */
        MAX_IMAGE_SIZE_TO_CACHE: () => (
          /* binding */
          u
        ),
        /* harmony export */
        MissingPDFException: () => (
          /* binding */
          pe
        ),
        /* harmony export */
        OPS: () => (
          /* binding */
          y
        ),
        /* harmony export */
        PasswordException: () => (
          /* binding */
          oe
        ),
        /* harmony export */
        PasswordResponses: () => (
          /* binding */
          C
        ),
        /* harmony export */
        PermissionFlag: () => (
          /* binding */
          g
        ),
        /* harmony export */
        RenderingIntentFlag: () => (
          /* binding */
          o
        ),
        /* harmony export */
        TextRenderingMode: () => (
          /* binding */
          A
        ),
        /* harmony export */
        UnexpectedResponseException: () => (
          /* binding */
          he
        ),
        /* harmony export */
        UnknownErrorException: () => (
          /* binding */
          le
        ),
        /* harmony export */
        Util: () => (
          /* binding */
          _
        ),
        /* harmony export */
        VerbosityLevel: () => (
          /* binding */
          p
        ),
        /* harmony export */
        assert: () => (
          /* binding */
          se
        ),
        /* harmony export */
        bytesToString: () => (
          /* binding */
          Ae
        ),
        /* harmony export */
        createValidAbsoluteUrl: () => (
          /* binding */
          te
        ),
        /* harmony export */
        getUuid: () => (
          /* binding */
          H
        ),
        /* harmony export */
        getVerbosityLevel: () => (
          /* binding */
          P
        ),
        /* harmony export */
        info: () => (
          /* binding */
          O
        ),
        /* harmony export */
        isNodeJS: () => (
          /* binding */
          n
        ),
        /* harmony export */
        normalizeUnicode: () => (
          /* binding */
          B
        ),
        /* harmony export */
        objectFromMap: () => (
          /* binding */
          R
        ),
        /* harmony export */
        setVerbosityLevel: () => (
          /* binding */
          L
        ),
        /* harmony export */
        shadow: () => (
          /* binding */
          K
        ),
        /* harmony export */
        string32: () => (
          /* binding */
          de
        ),
        /* harmony export */
        stringToBytes: () => (
          /* binding */
          ae
        ),
        /* harmony export */
        unreachable: () => (
          /* binding */
          Y
        ),
        /* harmony export */
        warn: () => (
          /* binding */
          q
        )
        /* harmony export */
      });
      const n = typeof process == "object" && process + "" == "[object process]" && !process.versions.nw && !(process.versions.electron && process.type && process.type !== "browser"), r = [1, 0, 0, 1, 0, 0], s = [1e-3, 0, 0, 1e-3, 0, 0], u = 1e7, l = 1.35, o = {
        ANY: 1,
        DISPLAY: 2,
        PRINT: 4,
        SAVE: 8,
        ANNOTATIONS_FORMS: 16,
        ANNOTATIONS_STORAGE: 32,
        ANNOTATIONS_DISABLE: 64,
        OPLIST: 256
      }, h = {
        DISABLE: 0,
        ENABLE: 1,
        ENABLE_FORMS: 2,
        ENABLE_STORAGE: 3
      }, d = "pdfjs_internal_editor_", c = {
        DISABLE: -1,
        NONE: 0,
        FREETEXT: 3,
        HIGHLIGHT: 9,
        STAMP: 13,
        INK: 15
      }, f = {
        RESIZE: 1,
        CREATE: 2,
        FREETEXT_SIZE: 11,
        FREETEXT_COLOR: 12,
        FREETEXT_OPACITY: 13,
        INK_COLOR: 21,
        INK_THICKNESS: 22,
        INK_OPACITY: 23,
        HIGHLIGHT_COLOR: 31,
        HIGHLIGHT_DEFAULT_COLOR: 32,
        HIGHLIGHT_THICKNESS: 33,
        HIGHLIGHT_FREE: 34,
        HIGHLIGHT_SHOW_ALL: 35
      }, g = {
        PRINT: 4,
        MODIFY_CONTENTS: 8,
        COPY: 16,
        MODIFY_ANNOTATIONS: 32,
        FILL_INTERACTIVE_FORMS: 256,
        COPY_FOR_ACCESSIBILITY: 512,
        ASSEMBLE: 1024,
        PRINT_HIGH_QUALITY: 2048
      }, A = {
        FILL: 0,
        STROKE: 1,
        FILL_STROKE: 2,
        INVISIBLE: 3,
        FILL_ADD_TO_PATH: 4,
        STROKE_ADD_TO_PATH: 5,
        FILL_STROKE_ADD_TO_PATH: 6,
        ADD_TO_PATH: 7,
        FILL_STROKE_MASK: 3,
        ADD_TO_PATH_FLAG: 4
      }, m = {
        GRAYSCALE_1BPP: 1,
        RGB_24BPP: 2,
        RGBA_32BPP: 3
      }, k = {
        TEXT: 1,
        LINK: 2,
        FREETEXT: 3,
        LINE: 4,
        SQUARE: 5,
        CIRCLE: 6,
        POLYGON: 7,
        POLYLINE: 8,
        HIGHLIGHT: 9,
        UNDERLINE: 10,
        SQUIGGLY: 11,
        STRIKEOUT: 12,
        STAMP: 13,
        CARET: 14,
        INK: 15,
        POPUP: 16,
        FILEATTACHMENT: 17,
        SOUND: 18,
        MOVIE: 19,
        WIDGET: 20,
        SCREEN: 21,
        PRINTERMARK: 22,
        TRAPNET: 23,
        WATERMARK: 24,
        THREED: 25,
        REDACT: 26
      }, a = {
        SOLID: 1,
        DASHED: 2,
        BEVELED: 3,
        INSET: 4,
        UNDERLINE: 5
      }, p = {
        ERRORS: 0,
        WARNINGS: 1,
        INFOS: 5
      }, b = {
        NONE: 0,
        BINARY: 1
      }, y = {
        dependency: 1,
        setLineWidth: 2,
        setLineCap: 3,
        setLineJoin: 4,
        setMiterLimit: 5,
        setDash: 6,
        setRenderingIntent: 7,
        setFlatness: 8,
        setGState: 9,
        save: 10,
        restore: 11,
        transform: 12,
        moveTo: 13,
        lineTo: 14,
        curveTo: 15,
        curveTo2: 16,
        curveTo3: 17,
        closePath: 18,
        rectangle: 19,
        stroke: 20,
        closeStroke: 21,
        fill: 22,
        eoFill: 23,
        fillStroke: 24,
        eoFillStroke: 25,
        closeFillStroke: 26,
        closeEOFillStroke: 27,
        endPath: 28,
        clip: 29,
        eoClip: 30,
        beginText: 31,
        endText: 32,
        setCharSpacing: 33,
        setWordSpacing: 34,
        setHScale: 35,
        setLeading: 36,
        setFont: 37,
        setTextRenderingMode: 38,
        setTextRise: 39,
        moveText: 40,
        setLeadingMoveText: 41,
        setTextMatrix: 42,
        nextLine: 43,
        showText: 44,
        showSpacedText: 45,
        nextLineShowText: 46,
        nextLineSetSpacingShowText: 47,
        setCharWidth: 48,
        setCharWidthAndBounds: 49,
        setStrokeColorSpace: 50,
        setFillColorSpace: 51,
        setStrokeColor: 52,
        setStrokeColorN: 53,
        setFillColor: 54,
        setFillColorN: 55,
        setStrokeGray: 56,
        setFillGray: 57,
        setStrokeRGBColor: 58,
        setFillRGBColor: 59,
        setStrokeCMYKColor: 60,
        setFillCMYKColor: 61,
        shadingFill: 62,
        beginInlineImage: 63,
        beginImageData: 64,
        endInlineImage: 65,
        paintXObject: 66,
        markPoint: 67,
        markPointProps: 68,
        beginMarkedContent: 69,
        beginMarkedContentProps: 70,
        endMarkedContent: 71,
        beginCompat: 72,
        endCompat: 73,
        paintFormXObjectBegin: 74,
        paintFormXObjectEnd: 75,
        beginGroup: 76,
        endGroup: 77,
        beginAnnotation: 80,
        endAnnotation: 81,
        paintImageMaskXObject: 83,
        paintImageMaskXObjectGroup: 84,
        paintImageXObject: 85,
        paintInlineImageXObject: 86,
        paintInlineImageXObjectGroup: 87,
        paintImageXObjectRepeat: 88,
        paintImageMaskXObjectRepeat: 89,
        paintSolidColorImageMask: 90,
        constructPath: 91
      }, C = {
        NEED_PASSWORD: 1,
        INCORRECT_PASSWORD: 2
      };
      let M = p.WARNINGS;
      function L(X) {
        Number.isInteger(X) && (M = X);
      }
      function P() {
        return M;
      }
      function O(X) {
        M >= p.INFOS && console.log(`Info: ${X}`);
      }
      function q(X) {
        M >= p.WARNINGS && console.log(`Warning: ${X}`);
      }
      function Y(X) {
        throw new Error(X);
      }
      function se(X, G) {
        X || Y(G);
      }
      function me(X) {
        switch (X?.protocol) {
          case "http:":
          case "https:":
          case "ftp:":
          case "mailto:":
          case "tel:":
            return !0;
          default:
            return !1;
        }
      }
      function te(X, G = null, U = null) {
        if (!X)
          return null;
        try {
          if (U && typeof X == "string" && (U.addDefaultProtocol && X.startsWith("www.") && X.match(/\./g)?.length >= 2 && (X = `http://${X}`), U.tryConvertEncoding))
            try {
              X = x(X);
            } catch {
            }
          const ee = G ? new URL(X, G) : new URL(X);
          if (me(ee))
            return ee;
        } catch {
        }
        return null;
      }
      function K(X, G, U, ee = !1) {
        return Object.defineProperty(X, G, {
          value: U,
          enumerable: !ee,
          configurable: !0,
          writable: !1
        }), U;
      }
      const Z = function() {
        function G(U, ee) {
          this.constructor === G && Y("Cannot initialize BaseException."), this.message = U, this.name = ee;
        }
        return G.prototype = new Error(), G.constructor = G, G;
      }();
      class oe extends Z {
        constructor(G, U) {
          super(G, "PasswordException"), this.code = U;
        }
      }
      class le extends Z {
        constructor(G, U) {
          super(G, "UnknownErrorException"), this.details = U;
        }
      }
      class ie extends Z {
        constructor(G) {
          super(G, "InvalidPDFException");
        }
      }
      class pe extends Z {
        constructor(G) {
          super(G, "MissingPDFException");
        }
      }
      class he extends Z {
        constructor(G, U) {
          super(G, "UnexpectedResponseException"), this.status = U;
        }
      }
      class we extends Z {
        constructor(G) {
          super(G, "FormatError");
        }
      }
      class ke extends Z {
        constructor(G) {
          super(G, "AbortException");
        }
      }
      function Ae(X) {
        (typeof X != "object" || X?.length === void 0) && Y("Invalid argument for bytesToString");
        const G = X.length, U = 8192;
        if (G < U)
          return String.fromCharCode.apply(null, X);
        const ee = [];
        for (let fe = 0; fe < G; fe += U) {
          const re = Math.min(fe + U, G), ue = X.subarray(fe, re);
          ee.push(String.fromCharCode.apply(null, ue));
        }
        return ee.join("");
      }
      function ae(X) {
        typeof X != "string" && Y("Invalid argument for stringToBytes");
        const G = X.length, U = new Uint8Array(G);
        for (let ee = 0; ee < G; ++ee)
          U[ee] = X.charCodeAt(ee) & 255;
        return U;
      }
      function de(X) {
        return String.fromCharCode(X >> 24 & 255, X >> 16 & 255, X >> 8 & 255, X & 255);
      }
      function R(X) {
        const G = /* @__PURE__ */ Object.create(null);
        for (const [U, ee] of X)
          G[U] = ee;
        return G;
      }
      function D() {
        const X = new Uint8Array(4);
        return X[0] = 1, new Uint32Array(X.buffer, 0, 1)[0] === 1;
      }
      function v() {
        try {
          return new Function(""), !0;
        } catch {
          return !1;
        }
      }
      class S {
        static get isLittleEndian() {
          return K(this, "isLittleEndian", D());
        }
        static get isEvalSupported() {
          return K(this, "isEvalSupported", v());
        }
        static get isOffscreenCanvasSupported() {
          return K(this, "isOffscreenCanvasSupported", typeof OffscreenCanvas < "u");
        }
        static get platform() {
          return typeof navigator < "u" && typeof navigator?.platform == "string" ? K(this, "platform", {
            isMac: navigator.platform.includes("Mac")
          }) : K(this, "platform", {
            isMac: !1
          });
        }
        static get isCSSRoundSupported() {
          return K(this, "isCSSRoundSupported", globalThis.CSS?.supports?.("width: round(1.5px, 1px)"));
        }
      }
      const E = Array.from(Array(256).keys(), (X) => X.toString(16).padStart(2, "0"));
      class _ {
        static makeHexColor(G, U, ee) {
          return `#${E[G]}${E[U]}${E[ee]}`;
        }
        static scaleMinMax(G, U) {
          let ee;
          G[0] ? (G[0] < 0 && (ee = U[0], U[0] = U[2], U[2] = ee), U[0] *= G[0], U[2] *= G[0], G[3] < 0 && (ee = U[1], U[1] = U[3], U[3] = ee), U[1] *= G[3], U[3] *= G[3]) : (ee = U[0], U[0] = U[1], U[1] = ee, ee = U[2], U[2] = U[3], U[3] = ee, G[1] < 0 && (ee = U[1], U[1] = U[3], U[3] = ee), U[1] *= G[1], U[3] *= G[1], G[2] < 0 && (ee = U[0], U[0] = U[2], U[2] = ee), U[0] *= G[2], U[2] *= G[2]), U[0] += G[4], U[1] += G[5], U[2] += G[4], U[3] += G[5];
        }
        static transform(G, U) {
          return [G[0] * U[0] + G[2] * U[1], G[1] * U[0] + G[3] * U[1], G[0] * U[2] + G[2] * U[3], G[1] * U[2] + G[3] * U[3], G[0] * U[4] + G[2] * U[5] + G[4], G[1] * U[4] + G[3] * U[5] + G[5]];
        }
        static applyTransform(G, U) {
          const ee = G[0] * U[0] + G[1] * U[2] + U[4], fe = G[0] * U[1] + G[1] * U[3] + U[5];
          return [ee, fe];
        }
        static applyInverseTransform(G, U) {
          const ee = U[0] * U[3] - U[1] * U[2], fe = (G[0] * U[3] - G[1] * U[2] + U[2] * U[5] - U[4] * U[3]) / ee, re = (-G[0] * U[1] + G[1] * U[0] + U[4] * U[1] - U[5] * U[0]) / ee;
          return [fe, re];
        }
        static getAxialAlignedBoundingBox(G, U) {
          const ee = this.applyTransform(G, U), fe = this.applyTransform(G.slice(2, 4), U), re = this.applyTransform([G[0], G[3]], U), ue = this.applyTransform([G[2], G[1]], U);
          return [Math.min(ee[0], fe[0], re[0], ue[0]), Math.min(ee[1], fe[1], re[1], ue[1]), Math.max(ee[0], fe[0], re[0], ue[0]), Math.max(ee[1], fe[1], re[1], ue[1])];
        }
        static inverseTransform(G) {
          const U = G[0] * G[3] - G[1] * G[2];
          return [G[3] / U, -G[1] / U, -G[2] / U, G[0] / U, (G[2] * G[5] - G[4] * G[3]) / U, (G[4] * G[1] - G[5] * G[0]) / U];
        }
        static singularValueDecompose2dScale(G) {
          const U = [G[0], G[2], G[1], G[3]], ee = G[0] * U[0] + G[1] * U[2], fe = G[0] * U[1] + G[1] * U[3], re = G[2] * U[0] + G[3] * U[2], ue = G[2] * U[1] + G[3] * U[3], _e = (ee + ue) / 2, ve = Math.sqrt((ee + ue) ** 2 - 4 * (ee * ue - re * fe)) / 2, be = _e + ve || 1, xe = _e - ve || 1;
          return [Math.sqrt(be), Math.sqrt(xe)];
        }
        static normalizeRect(G) {
          const U = G.slice(0);
          return G[0] > G[2] && (U[0] = G[2], U[2] = G[0]), G[1] > G[3] && (U[1] = G[3], U[3] = G[1]), U;
        }
        static intersect(G, U) {
          const ee = Math.max(Math.min(G[0], G[2]), Math.min(U[0], U[2])), fe = Math.min(Math.max(G[0], G[2]), Math.max(U[0], U[2]));
          if (ee > fe)
            return null;
          const re = Math.max(Math.min(G[1], G[3]), Math.min(U[1], U[3])), ue = Math.min(Math.max(G[1], G[3]), Math.max(U[1], U[3]));
          return re > ue ? null : [ee, re, fe, ue];
        }
        static #e(G, U, ee, fe, re, ue, _e, ve, be, xe) {
          if (be <= 0 || be >= 1)
            return;
          const De = 1 - be, Oe = be * be, Ve = Oe * be, Ge = De * (De * (De * G + 3 * be * U) + 3 * Oe * ee) + Ve * fe, He = De * (De * (De * re + 3 * be * ue) + 3 * Oe * _e) + Ve * ve;
          xe[0] = Math.min(xe[0], Ge), xe[1] = Math.min(xe[1], He), xe[2] = Math.max(xe[2], Ge), xe[3] = Math.max(xe[3], He);
        }
        static #t(G, U, ee, fe, re, ue, _e, ve, be, xe, De, Oe) {
          if (Math.abs(be) < 1e-12) {
            Math.abs(xe) >= 1e-12 && this.#e(G, U, ee, fe, re, ue, _e, ve, -De / xe, Oe);
            return;
          }
          const Ve = xe ** 2 - 4 * De * be;
          if (Ve < 0)
            return;
          const Ge = Math.sqrt(Ve), He = 2 * be;
          this.#e(G, U, ee, fe, re, ue, _e, ve, (-xe + Ge) / He, Oe), this.#e(G, U, ee, fe, re, ue, _e, ve, (-xe - Ge) / He, Oe);
        }
        static bezierBoundingBox(G, U, ee, fe, re, ue, _e, ve, be) {
          return be ? (be[0] = Math.min(be[0], G, _e), be[1] = Math.min(be[1], U, ve), be[2] = Math.max(be[2], G, _e), be[3] = Math.max(be[3], U, ve)) : be = [Math.min(G, _e), Math.min(U, ve), Math.max(G, _e), Math.max(U, ve)], this.#t(G, ee, re, _e, U, fe, ue, ve, 3 * (-G + 3 * (ee - re) + _e), 6 * (G - 2 * ee + re), 3 * (ee - G), be), this.#t(G, ee, re, _e, U, fe, ue, ve, 3 * (-U + 3 * (fe - ue) + ve), 6 * (U - 2 * fe + ue), 3 * (fe - U), be), be;
        }
      }
      function x(X) {
        return decodeURIComponent(escape(X));
      }
      let F = null, I = null;
      function B(X) {
        return F || (F = /([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu, I = /* @__PURE__ */ new Map([["ﬅ", "ſt"]])), X.replaceAll(F, (G, U, ee) => U ? U.normalize("NFKC") : I.get(ee));
      }
      function H() {
        if (typeof crypto < "u" && typeof crypto?.randomUUID == "function")
          return crypto.randomUUID();
        const X = new Uint8Array(32);
        if (typeof crypto < "u" && typeof crypto?.getRandomValues == "function")
          crypto.getRandomValues(X);
        else
          for (let G = 0; G < 32; G++)
            X[G] = Math.floor(Math.random() * 255);
        return Ae(X);
      }
      const V = "pdfjs_internal_id_", $ = {
        BEZIER_CURVE_TO: 0,
        MOVE_TO: 1,
        LINE_TO: 2,
        QUADRATIC_CURVE_TO: 3,
        RESTORE: 4,
        SAVE: 5,
        SCALE: 6,
        TRANSFORM: 7,
        TRANSLATE: 8
      };
    }
  )
  /******/
}, _0 = {};
function Ei(i) {
  var e = _0[i];
  if (e !== void 0)
    return e.exports;
  var t = _0[i] = {
    /******/
    // no module.id needed
    /******/
    // no module.loaded needed
    /******/
    exports: {}
    /******/
  };
  return Pg[i](t, t.exports, Ei), t.exports;
}
(() => {
  var i = typeof Symbol == "function" ? Symbol("webpack queues") : "__webpack_queues__", e = typeof Symbol == "function" ? Symbol("webpack exports") : "__webpack_exports__", t = typeof Symbol == "function" ? Symbol("webpack error") : "__webpack_error__", n = (s) => {
    s && s.d < 1 && (s.d = 1, s.forEach((u) => u.r--), s.forEach((u) => u.r-- ? u.r++ : u()));
  }, r = (s) => s.map((u) => {
    if (u !== null && typeof u == "object") {
      if (u[i]) return u;
      if (u.then) {
        var l = [];
        l.d = 0, u.then((d) => {
          o[e] = d, n(l);
        }, (d) => {
          o[t] = d, n(l);
        });
        var o = {};
        return o[i] = (d) => d(l), o;
      }
    }
    var h = {};
    return h[i] = (d) => {
    }, h[e] = u, h;
  });
  Ei.a = (s, u, l) => {
    var o;
    l && ((o = []).d = -1);
    var h = /* @__PURE__ */ new Set(), d = s.exports, c, f, g, A = new Promise((m, k) => {
      g = k, f = m;
    });
    A[e] = d, A[i] = (m) => (o && m(o), h.forEach(m), A.catch((k) => {
    })), s.exports = A, u((m) => {
      c = r(m);
      var k, a = () => c.map((b) => {
        if (b[t]) throw b[t];
        return b[e];
      }), p = new Promise((b) => {
        k = () => b(a), k.r = 0;
        var y = (C) => C !== o && !h.has(C) && (h.add(C), C && !C.d && (k.r++, C.push(k)));
        c.map((C) => C[i](y));
      });
      return k.r ? p : a();
    }, (m) => (m ? g(A[t] = m) : f(d), n(o))), o && o.d < 0 && (o.d = 0);
  };
})();
Ei.d = (i, e) => {
  for (var t in e)
    Ei.o(e, t) && !Ei.o(i, t) && Object.defineProperty(i, t, { enumerable: !0, get: e[t] });
};
Ei.o = (i, e) => Object.prototype.hasOwnProperty.call(i, e);
var Be = Ei(228);
Be = globalThis.pdfjsLib = await (globalThis.pdfjsLibPromise = Be);
Be.AbortException;
Be.AnnotationEditorLayer;
Be.AnnotationEditorParamsType;
Be.AnnotationEditorType;
Be.AnnotationEditorUIManager;
Be.AnnotationLayer;
Be.AnnotationMode;
Be.CMapCompressionType;
Be.ColorPicker;
Be.DOMSVGFactory;
Be.DrawLayer;
Be.FeatureTest;
var Bg = Be.GlobalWorkerOptions;
Be.ImageKind;
Be.InvalidPDFException;
Be.MissingPDFException;
Be.OPS;
Be.Outliner;
Be.PDFDataRangeTransport;
Be.PDFDateString;
Be.PDFWorker;
Be.PasswordResponses;
Be.PermissionFlag;
Be.PixelsPerInch;
Be.RenderingCancelledException;
Be.UnexpectedResponseException;
Be.Util;
Be.VerbosityLevel;
Be.XfaLayer;
Be.build;
Be.createValidAbsoluteUrl;
Be.fetchData;
var zg = Be.getDocument;
Be.getFilenameFromUrl;
Be.getPdfFilenameFromUrl;
Be.getXfaPageViewport;
Be.isDataScheme;
Be.isPdfFile;
Be.noContextMenu;
Be.normalizeUnicode;
Be.renderTextLayer;
Be.setLayerDimensions;
Be.shadow;
Be.updateTextLayer;
Be.version;
const {
  SvelteComponent: Og,
  append_hydration: wn,
  assign: Hg,
  attr: An,
  binding_callbacks: qg,
  check_outros: T0,
  children: ur,
  claim_component: ti,
  claim_element: bi,
  claim_space: Kn,
  claim_text: vo,
  create_component: ni,
  destroy_component: ii,
  detach: Lt,
  element: vi,
  empty: C0,
  get_spread_object: Ug,
  get_spread_update: Vg,
  get_svelte_dataset: Gg,
  group_outros: D0,
  init: Xg,
  insert_hydration: Hn,
  listen: F0,
  mount_component: ri,
  run_all: jg,
  safe_not_equal: Yg,
  set_data: Wg,
  set_input_value: M0,
  set_style: Aa,
  space: Zn,
  text: yo,
  to_number: Ec,
  transition_in: qt,
  transition_out: Zt
} = window.__gradio__svelte__internal, { tick: R0 } = window.__gradio__svelte__internal;
function L0(i) {
  let e, t;
  const n = [
    {
      autoscroll: (
        /*gradio*/
        i[10].autoscroll
      )
    },
    { i18n: (
      /*gradio*/
      i[10].i18n
    ) },
    /*loading_status*/
    i[1]
  ];
  let r = {};
  for (let s = 0; s < n.length; s += 1)
    r = Hg(r, n[s]);
  return e = new J1({ props: r }), e.$on(
    "clear_status",
    /*clear_status_handler*/
    i[24]
  ), {
    c() {
      ni(e.$$.fragment);
    },
    l(s) {
      ti(e.$$.fragment, s);
    },
    m(s, u) {
      ri(e, s, u), t = !0;
    },
    p(s, u) {
      const l = u[0] & /*gradio, loading_status*/
      1026 ? Vg(n, [
        u[0] & /*gradio*/
        1024 && {
          autoscroll: (
            /*gradio*/
            s[10].autoscroll
          )
        },
        u[0] & /*gradio*/
        1024 && { i18n: (
          /*gradio*/
          s[10].i18n
        ) },
        u[0] & /*loading_status*/
        2 && Ug(
          /*loading_status*/
          s[1]
        )
      ]) : {};
      e.$set(l);
    },
    i(s) {
      t || (qt(e.$$.fragment, s), t = !0);
    },
    o(s) {
      Zt(e.$$.fragment, s), t = !1;
    },
    d(s) {
      ii(e, s);
    }
  };
}
function $g(i) {
  let e, t;
  return e = new ng({
    props: {
      filetype: ".pdf",
      file_count: "single",
      root: (
        /*root*/
        i[7]
      ),
      max_file_size: (
        /*gradio*/
        i[10].max_file_size
      ),
      upload: (
        /*gradio*/
        i[10].client.upload
      ),
      stream_handler: (
        /*gradio*/
        i[10].client.stream
      ),
      $$slots: { default: [Zg] },
      $$scope: { ctx: i }
    }
  }), e.$on(
    "load",
    /*handle_upload*/
    i[16]
  ), e.$on(
    "error",
    /*error_handler*/
    i[27]
  ), {
    c() {
      ni(e.$$.fragment);
    },
    l(n) {
      ti(e.$$.fragment, n);
    },
    m(n, r) {
      ri(e, n, r), t = !0;
    },
    p(n, r) {
      const s = {};
      r[0] & /*root*/
      128 && (s.root = /*root*/
      n[7]), r[0] & /*gradio*/
      1024 && (s.max_file_size = /*gradio*/
      n[10].max_file_size), r[0] & /*gradio*/
      1024 && (s.upload = /*gradio*/
      n[10].client.upload), r[0] & /*gradio*/
      1024 && (s.stream_handler = /*gradio*/
      n[10].client.stream), r[1] & /*$$scope*/
      4 && (s.$$scope = { dirty: r, ctx: n }), e.$set(s);
    },
    i(n) {
      t || (qt(e.$$.fragment, n), t = !0);
    },
    o(n) {
      Zt(e.$$.fragment, n), t = !1;
    },
    d(n) {
      ii(e, n);
    }
  };
}
function Kg(i) {
  let e, t, n, r, s, u, l, o, h, d, c, f, g, A = "/", m, k, a, p, b, y, C, M;
  return e = new Ng({
    props: {
      i18n: (
        /*gradio*/
        i[10].i18n
      ),
      absolute: !0
    }
  }), e.$on(
    "clear",
    /*handle_clear*/
    i[15]
  ), l = new p0({
    props: {
      $$slots: { default: [Qg] },
      $$scope: { ctx: i }
    }
  }), l.$on(
    "click",
    /*prev_page*/
    i[18]
  ), b = new p0({
    props: {
      $$slots: { default: [Jg] },
      $$scope: { ctx: i }
    }
  }), b.$on(
    "click",
    /*next_page*/
    i[17]
  ), {
    c() {
      ni(e.$$.fragment), t = Zn(), n = vi("div"), r = vi("canvas"), s = Zn(), u = vi("div"), ni(l.$$.fragment), o = Zn(), h = vi("div"), d = vi("input"), f = Zn(), g = vi("span"), g.textContent = A, m = Zn(), k = vi("span"), a = yo(
        /*numPages*/
        i[12]
      ), p = Zn(), ni(b.$$.fragment), this.h();
    },
    l(L) {
      ti(e.$$.fragment, L), t = Kn(L), n = bi(L, "DIV", { class: !0 });
      var P = ur(n);
      r = bi(P, "CANVAS", {}), ur(r).forEach(Lt), P.forEach(Lt), s = Kn(L), u = bi(L, "DIV", { class: !0 });
      var O = ur(u);
      ti(l.$$.fragment, O), o = Kn(O), h = bi(O, "DIV", { class: !0 });
      var q = ur(h);
      d = bi(q, "INPUT", {
        type: !0,
        style: !0,
        min: !0,
        max: !0,
        class: !0
      }), f = Kn(q), g = bi(q, "SPAN", { style: !0, "data-svelte-h": !0 }), Gg(g) !== "svelte-1eodmhh" && (g.textContent = A), m = Kn(q), k = bi(q, "SPAN", { style: !0 });
      var Y = ur(k);
      a = vo(
        Y,
        /*numPages*/
        i[12]
      ), Y.forEach(Lt), q.forEach(Lt), p = Kn(O), ti(b.$$.fragment, O), O.forEach(Lt), this.h();
    },
    h() {
      An(n, "class", "pdf-canvas svelte-1k8wk06"), An(d, "type", "number"), An(d, "style", c = `width: ${50 + I0(
        /*numPages*/
        i[12]
      ) * 10}px`), An(d, "min", 1), An(
        d,
        "max",
        /*numPages*/
        i[12]
      ), An(d, "class", "svelte-1k8wk06"), Aa(g, "padding", "var(--size-1)"), Aa(k, "padding-right", "var(--size-2)"), Aa(k, "width", "fit-content"), An(h, "class", "page-count svelte-1k8wk06"), An(u, "class", "button-row svelte-1k8wk06");
    },
    m(L, P) {
      ri(e, L, P), Hn(L, t, P), Hn(L, n, P), wn(n, r), i[25](r), Hn(L, s, P), Hn(L, u, P), ri(l, u, null), wn(u, o), wn(u, h), wn(h, d), M0(
        d,
        /*currentPage*/
        i[14]
      ), wn(h, f), wn(h, g), wn(h, m), wn(h, k), wn(k, a), wn(u, p), ri(b, u, null), y = !0, C || (M = [
        F0(
          d,
          "input",
          /*input_input_handler*/
          i[26]
        ),
        F0(
          d,
          "change",
          /*handle_page_change*/
          i[19]
        )
      ], C = !0);
    },
    p(L, P) {
      const O = {};
      P[0] & /*gradio*/
      1024 && (O.i18n = /*gradio*/
      L[10].i18n), e.$set(O);
      const q = {};
      P[1] & /*$$scope*/
      4 && (q.$$scope = { dirty: P, ctx: L }), l.$set(q), (!y || P[0] & /*numPages*/
      4096 && c !== (c = `width: ${50 + I0(
        /*numPages*/
        L[12]
      ) * 10}px`)) && An(d, "style", c), (!y || P[0] & /*numPages*/
      4096) && An(
        d,
        "max",
        /*numPages*/
        L[12]
      ), P[0] & /*currentPage*/
      16384 && Ec(d.value) !== /*currentPage*/
      L[14] && M0(
        d,
        /*currentPage*/
        L[14]
      ), (!y || P[0] & /*numPages*/
      4096) && Wg(
        a,
        /*numPages*/
        L[12]
      );
      const Y = {};
      P[1] & /*$$scope*/
      4 && (Y.$$scope = { dirty: P, ctx: L }), b.$set(Y);
    },
    i(L) {
      y || (qt(e.$$.fragment, L), qt(l.$$.fragment, L), qt(b.$$.fragment, L), y = !0);
    },
    o(L) {
      Zt(e.$$.fragment, L), Zt(l.$$.fragment, L), Zt(b.$$.fragment, L), y = !1;
    },
    d(L) {
      L && (Lt(t), Lt(n), Lt(s), Lt(u)), ii(e, L), i[25](null), ii(l), ii(b), C = !1, jg(M);
    }
  };
}
function Zg(i) {
  let e, t;
  return e = new Sh({}), {
    c() {
      ni(e.$$.fragment);
    },
    l(n) {
      ti(e.$$.fragment, n);
    },
    m(n, r) {
      ri(e, n, r), t = !0;
    },
    i(n) {
      t || (qt(e.$$.fragment, n), t = !0);
    },
    o(n) {
      Zt(e.$$.fragment, n), t = !1;
    },
    d(n) {
      ii(e, n);
    }
  };
}
function Qg(i) {
  let e;
  return {
    c() {
      e = yo("⬅️");
    },
    l(t) {
      e = vo(t, "⬅️");
    },
    m(t, n) {
      Hn(t, e, n);
    },
    d(t) {
      t && Lt(e);
    }
  };
}
function Jg(i) {
  let e;
  return {
    c() {
      e = yo("➡️");
    },
    l(t) {
      e = vo(t, "➡️");
    },
    m(t, n) {
      Hn(t, e, n);
    },
    d(t) {
      t && Lt(e);
    }
  };
}
function e4(i) {
  let e, t, n, r, s, u, l, o = (
    /*loading_status*/
    i[1] && L0(i)
  );
  t = new Pm({
    props: {
      show_label: (
        /*label*/
        i[8] !== null
      ),
      Icon: Zc,
      float: (
        /*value*/
        i[0] === null
      ),
      label: (
        /*label*/
        i[8] || "File"
      )
    }
  });
  const h = [Kg, $g], d = [];
  function c(f, g) {
    return (
      /*_value*/
      f[11] ? 0 : 1
    );
  }
  return r = c(i), s = d[r] = h[r](i), {
    c() {
      o && o.c(), e = Zn(), ni(t.$$.fragment), n = Zn(), s.c(), u = C0();
    },
    l(f) {
      o && o.l(f), e = Kn(f), ti(t.$$.fragment, f), n = Kn(f), s.l(f), u = C0();
    },
    m(f, g) {
      o && o.m(f, g), Hn(f, e, g), ri(t, f, g), Hn(f, n, g), d[r].m(f, g), Hn(f, u, g), l = !0;
    },
    p(f, g) {
      /*loading_status*/
      f[1] ? o ? (o.p(f, g), g[0] & /*loading_status*/
      2 && qt(o, 1)) : (o = L0(f), o.c(), qt(o, 1), o.m(e.parentNode, e)) : o && (D0(), Zt(o, 1, 1, () => {
        o = null;
      }), T0());
      const A = {};
      g[0] & /*label*/
      256 && (A.show_label = /*label*/
      f[8] !== null), g[0] & /*value*/
      1 && (A.float = /*value*/
      f[0] === null), g[0] & /*label*/
      256 && (A.label = /*label*/
      f[8] || "File"), t.$set(A);
      let m = r;
      r = c(f), r === m ? d[r].p(f, g) : (D0(), Zt(d[m], 1, 1, () => {
        d[m] = null;
      }), T0(), s = d[r], s ? s.p(f, g) : (s = d[r] = h[r](f), s.c()), qt(s, 1), s.m(u.parentNode, u));
    },
    i(f) {
      l || (qt(o), qt(t.$$.fragment, f), qt(s), l = !0);
    },
    o(f) {
      Zt(o), Zt(t.$$.fragment, f), Zt(s), l = !1;
    },
    d(f) {
      f && (Lt(e), Lt(n), Lt(u)), o && o.d(f), ii(t, f), d[r].d(f);
    }
  };
}
function t4(i) {
  let e, t;
  return e = new Hh({
    props: {
      visible: (
        /*visible*/
        i[4]
      ),
      elem_id: (
        /*elem_id*/
        i[2]
      ),
      elem_classes: (
        /*elem_classes*/
        i[3]
      ),
      container: (
        /*container*/
        i[5]
      ),
      scale: (
        /*scale*/
        i[6]
      ),
      min_width: (
        /*min_width*/
        i[9]
      ),
      $$slots: { default: [e4] },
      $$scope: { ctx: i }
    }
  }), {
    c() {
      ni(e.$$.fragment);
    },
    l(n) {
      ti(e.$$.fragment, n);
    },
    m(n, r) {
      ri(e, n, r), t = !0;
    },
    p(n, r) {
      const s = {};
      r[0] & /*visible*/
      16 && (s.visible = /*visible*/
      n[4]), r[0] & /*elem_id*/
      4 && (s.elem_id = /*elem_id*/
      n[2]), r[0] & /*elem_classes*/
      8 && (s.elem_classes = /*elem_classes*/
      n[3]), r[0] & /*container*/
      32 && (s.container = /*container*/
      n[5]), r[0] & /*scale*/
      64 && (s.scale = /*scale*/
      n[6]), r[0] & /*min_width*/
      512 && (s.min_width = /*min_width*/
      n[9]), r[0] & /*numPages, currentPage, canvasRef, gradio, _value, root, loading_status, label, value*/
      32131 | r[1] & /*$$scope*/
      4 && (s.$$scope = { dirty: r, ctx: n }), e.$set(s);
    },
    i(n) {
      t || (qt(e.$$.fragment, n), t = !0);
    },
    o(n) {
      Zt(e.$$.fragment, n), t = !1;
    },
    d(n) {
      ii(e, n);
    }
  };
}
function I0(i) {
  return (Math.log10((i ^ i >> 31) - (i >> 31)) | 0) + 1;
}
function n4(i, e, t) {
  return i;
}
function i4(i, e, t) {
  let n;
  var r = this && this.__awaiter || function(ie, pe, he, we) {
    function ke(Ae) {
      return Ae instanceof he ? Ae : new he(function(ae) {
        ae(Ae);
      });
    }
    return new (he || (he = Promise))(function(Ae, ae) {
      function de(v) {
        try {
          D(we.next(v));
        } catch (S) {
          ae(S);
        }
      }
      function R(v) {
        try {
          D(we.throw(v));
        } catch (S) {
          ae(S);
        }
      }
      function D(v) {
        v.done ? Ae(v.value) : ke(v.value).then(de, R);
      }
      D((we = we.apply(ie, pe || [])).next());
    });
  };
  let { elem_id: s = "" } = e, { elem_classes: u = [] } = e, { visible: l = !0 } = e, { value: o = null } = e, { container: h = !0 } = e, { scale: d = null } = e, { root: c } = e, { height: f = null } = e, { starting_page: g } = e, { label: A } = e, { proxy_url: m } = e, { min_width: k = void 0 } = e, { loading_status: a } = e, { gradio: p } = e;
  Bg.workerSrc = "https://cdn.jsdelivr.net/gh/freddyaboulton/gradio-pdf@main/pdf.worker.min.mjs";
  let b, y, C, M = 1, L;
  function P() {
    return r(this, void 0, void 0, function* () {
      t(11, b = null), yield R0(), p.dispatch("change");
    });
  }
  function O(ie) {
    return r(this, arguments, void 0, function* ({ detail: pe }) {
      t(0, o = pe), yield R0(), p.dispatch("change"), p.dispatch("upload");
    });
  }
  function q(ie) {
    return r(this, void 0, void 0, function* () {
      C = yield zg(ie.url).promise, t(12, M = C.numPages), t(14, n = Math.min(Math.max(g, 1), M)), Y(n);
    });
  }
  function Y(ie) {
    C.getPage(ie).then((pe) => {
      const he = L.getContext("2d");
      he.clearRect(0, 0, L.width, L.height);
      let we = pe.getViewport({ scale: 1 });
      console.log("height", f), f && (we = pe.getViewport({ scale: f / we.height }));
      const ke = { canvasContext: he, viewport: we };
      t(13, L.width = we.width, L), t(13, L.height = we.height, L), pe.render(ke);
    });
  }
  function se() {
    n >= M || (t(14, n++, n), Y(n));
  }
  function me() {
    n != 1 && (t(14, n--, n), Y(n));
  }
  function te() {
    n < 1 || n > M || Y(n);
  }
  const K = () => p.dispatch("clear_status", a);
  function Z(ie) {
    qg[ie ? "unshift" : "push"](() => {
      L = ie, t(13, L);
    });
  }
  function oe() {
    n = Ec(this.value), t(14, n), t(21, g), t(12, M);
  }
  const le = ({ detail: ie }) => {
    t(1, a = a || {}), t(1, a.status = "error", a), p.dispatch("error", ie);
  };
  return i.$$set = (ie) => {
    "elem_id" in ie && t(2, s = ie.elem_id), "elem_classes" in ie && t(3, u = ie.elem_classes), "visible" in ie && t(4, l = ie.visible), "value" in ie && t(0, o = ie.value), "container" in ie && t(5, h = ie.container), "scale" in ie && t(6, d = ie.scale), "root" in ie && t(7, c = ie.root), "height" in ie && t(20, f = ie.height), "starting_page" in ie && t(21, g = ie.starting_page), "label" in ie && t(8, A = ie.label), "proxy_url" in ie && t(22, m = ie.proxy_url), "min_width" in ie && t(9, k = ie.min_width), "loading_status" in ie && t(1, a = ie.loading_status), "gradio" in ie && t(10, p = ie.gradio);
  }, i.$$.update = () => {
    i.$$.dirty[0] & /*starting_page, numPages*/
    2101248 && t(14, n = Math.min(Math.max(g, 1), M)), i.$$.dirty[0] & /*value, root, proxy_url*/
    4194433 && t(11, b = n4(o)), i.$$.dirty[0] & /*old_value, _value, gradio*/
    8391680 && JSON.stringify(y) != JSON.stringify(b) && (b && q(b), t(23, y = b), p.dispatch("change"));
  }, [
    o,
    a,
    s,
    u,
    l,
    h,
    d,
    c,
    A,
    k,
    p,
    b,
    M,
    L,
    n,
    P,
    O,
    se,
    me,
    te,
    f,
    g,
    m,
    y,
    K,
    Z,
    oe,
    le
  ];
}
class l4 extends Og {
  constructor(e) {
    super(), Xg(
      this,
      e,
      i4,
      t4,
      Yg,
      {
        elem_id: 2,
        elem_classes: 3,
        visible: 4,
        value: 0,
        container: 5,
        scale: 6,
        root: 7,
        height: 20,
        starting_page: 21,
        label: 8,
        proxy_url: 22,
        min_width: 9,
        loading_status: 1,
        gradio: 10
      },
      null,
      [-1, -1]
    );
  }
}
export {
  l4 as default
};
