var dr = Object.defineProperty;
var Dn = (r) => {
  throw TypeError(r);
};
var mr = (r, e, t) => e in r ? dr(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
var Ke = (r, e, t) => mr(r, typeof e != "symbol" ? e + "" : e, t), Gt = (r, e, t) => e.has(r) || Dn("Cannot " + t);
var p = (r, e, t) => (Gt(r, e, "read from private field"), t ? t.call(r) : e.get(r)), de = (r, e, t) => e.has(r) ? Dn("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), fe = (r, e, t, n) => (Gt(r, e, "write to private field"), n ? n.call(r, t) : e.set(r, t), t), te = (r, e, t) => (Gt(r, e, "access private method"), t);
var At = (r, e, t, n) => ({
  set _(a) {
    fe(r, e, a, t);
  },
  get _() {
    return p(r, e, n);
  }
});
const {
  SvelteComponent: SvelteComponent$f,
  assign: assign$2,
  create_slot: create_slot$3,
  detach: detach$f,
  element: element$a,
  get_all_dirty_from_scope: get_all_dirty_from_scope$3,
  get_slot_changes: get_slot_changes$3,
  get_spread_update: get_spread_update$2,
  init: init$f,
  insert: insert$f,
  safe_not_equal: safe_not_equal$g,
  set_dynamic_element_data,
  set_style: set_style$6,
  toggle_class: toggle_class$8,
  transition_in: transition_in$9,
  transition_out: transition_out$9,
  update_slot_base: update_slot_base$3
} = window.__gradio__svelte__internal;
function create_dynamic_element(r) {
  let e, t, n;
  const a = (
    /*#slots*/
    r[18].default
  ), s = create_slot$3(
    a,
    r,
    /*$$scope*/
    r[17],
    null
  );
  let o = [
    { "data-testid": (
      /*test_id*/
      r[7]
    ) },
    { id: (
      /*elem_id*/
      r[2]
    ) },
    {
      class: t = "block " + /*elem_classes*/
      r[3].join(" ") + " svelte-nl1om8"
    }
  ], c = {};
  for (let l = 0; l < o.length; l += 1)
    c = assign$2(c, o[l]);
  return {
    c() {
      e = element$a(
        /*tag*/
        r[14]
      ), s && s.c(), set_dynamic_element_data(
        /*tag*/
        r[14]
      )(e, c), toggle_class$8(
        e,
        "hidden",
        /*visible*/
        r[10] === !1
      ), toggle_class$8(
        e,
        "padded",
        /*padding*/
        r[6]
      ), toggle_class$8(
        e,
        "border_focus",
        /*border_mode*/
        r[5] === "focus"
      ), toggle_class$8(
        e,
        "border_contrast",
        /*border_mode*/
        r[5] === "contrast"
      ), toggle_class$8(e, "hide-container", !/*explicit_call*/
      r[8] && !/*container*/
      r[9]), set_style$6(
        e,
        "height",
        /*get_dimension*/
        r[15](
          /*height*/
          r[0]
        )
      ), set_style$6(e, "width", typeof /*width*/
      r[1] == "number" ? `calc(min(${/*width*/
      r[1]}px, 100%))` : (
        /*get_dimension*/
        r[15](
          /*width*/
          r[1]
        )
      )), set_style$6(
        e,
        "border-style",
        /*variant*/
        r[4]
      ), set_style$6(
        e,
        "overflow",
        /*allow_overflow*/
        r[11] ? "visible" : "hidden"
      ), set_style$6(
        e,
        "flex-grow",
        /*scale*/
        r[12]
      ), set_style$6(e, "min-width", `calc(min(${/*min_width*/
      r[13]}px, 100%))`), set_style$6(e, "border-width", "var(--block-border-width)");
    },
    m(l, u) {
      insert$f(l, e, u), s && s.m(e, null), n = !0;
    },
    p(l, u) {
      s && s.p && (!n || u & /*$$scope*/
      131072) && update_slot_base$3(
        s,
        a,
        l,
        /*$$scope*/
        l[17],
        n ? get_slot_changes$3(
          a,
          /*$$scope*/
          l[17],
          u,
          null
        ) : get_all_dirty_from_scope$3(
          /*$$scope*/
          l[17]
        ),
        null
      ), set_dynamic_element_data(
        /*tag*/
        l[14]
      )(e, c = get_spread_update$2(o, [
        (!n || u & /*test_id*/
        128) && { "data-testid": (
          /*test_id*/
          l[7]
        ) },
        (!n || u & /*elem_id*/
        4) && { id: (
          /*elem_id*/
          l[2]
        ) },
        (!n || u & /*elem_classes*/
        8 && t !== (t = "block " + /*elem_classes*/
        l[3].join(" ") + " svelte-nl1om8")) && { class: t }
      ])), toggle_class$8(
        e,
        "hidden",
        /*visible*/
        l[10] === !1
      ), toggle_class$8(
        e,
        "padded",
        /*padding*/
        l[6]
      ), toggle_class$8(
        e,
        "border_focus",
        /*border_mode*/
        l[5] === "focus"
      ), toggle_class$8(
        e,
        "border_contrast",
        /*border_mode*/
        l[5] === "contrast"
      ), toggle_class$8(e, "hide-container", !/*explicit_call*/
      l[8] && !/*container*/
      l[9]), u & /*height*/
      1 && set_style$6(
        e,
        "height",
        /*get_dimension*/
        l[15](
          /*height*/
          l[0]
        )
      ), u & /*width*/
      2 && set_style$6(e, "width", typeof /*width*/
      l[1] == "number" ? `calc(min(${/*width*/
      l[1]}px, 100%))` : (
        /*get_dimension*/
        l[15](
          /*width*/
          l[1]
        )
      )), u & /*variant*/
      16 && set_style$6(
        e,
        "border-style",
        /*variant*/
        l[4]
      ), u & /*allow_overflow*/
      2048 && set_style$6(
        e,
        "overflow",
        /*allow_overflow*/
        l[11] ? "visible" : "hidden"
      ), u & /*scale*/
      4096 && set_style$6(
        e,
        "flex-grow",
        /*scale*/
        l[12]
      ), u & /*min_width*/
      8192 && set_style$6(e, "min-width", `calc(min(${/*min_width*/
      l[13]}px, 100%))`);
    },
    i(l) {
      n || (transition_in$9(s, l), n = !0);
    },
    o(l) {
      transition_out$9(s, l), n = !1;
    },
    d(l) {
      l && detach$f(e), s && s.d(l);
    }
  };
}
function create_fragment$f(r) {
  let e, t = (
    /*tag*/
    r[14] && create_dynamic_element(r)
  );
  return {
    c() {
      t && t.c();
    },
    m(n, a) {
      t && t.m(n, a), e = !0;
    },
    p(n, [a]) {
      /*tag*/
      n[14] && t.p(n, a);
    },
    i(n) {
      e || (transition_in$9(t, n), e = !0);
    },
    o(n) {
      transition_out$9(t, n), e = !1;
    },
    d(n) {
      t && t.d(n);
    }
  };
}
function instance$b(r, e, t) {
  let { $$slots: n = {}, $$scope: a } = e, { height: s = void 0 } = e, { width: o = void 0 } = e, { elem_id: c = "" } = e, { elem_classes: l = [] } = e, { variant: u = "solid" } = e, { border_mode: h = "base" } = e, { padding: d = !0 } = e, { type: w = "normal" } = e, { test_id: b = void 0 } = e, { explicit_call: _ = !1 } = e, { container: R = !0 } = e, { visible: k = !0 } = e, { allow_overflow: C = !0 } = e, { scale: m = null } = e, { min_width: A = 0 } = e, F = w === "fieldset" ? "fieldset" : "div";
  const f = (g) => {
    if (g !== void 0) {
      if (typeof g == "number")
        return g + "px";
      if (typeof g == "string")
        return g;
    }
  };
  return r.$$set = (g) => {
    "height" in g && t(0, s = g.height), "width" in g && t(1, o = g.width), "elem_id" in g && t(2, c = g.elem_id), "elem_classes" in g && t(3, l = g.elem_classes), "variant" in g && t(4, u = g.variant), "border_mode" in g && t(5, h = g.border_mode), "padding" in g && t(6, d = g.padding), "type" in g && t(16, w = g.type), "test_id" in g && t(7, b = g.test_id), "explicit_call" in g && t(8, _ = g.explicit_call), "container" in g && t(9, R = g.container), "visible" in g && t(10, k = g.visible), "allow_overflow" in g && t(11, C = g.allow_overflow), "scale" in g && t(12, m = g.scale), "min_width" in g && t(13, A = g.min_width), "$$scope" in g && t(17, a = g.$$scope);
  }, [
    s,
    o,
    c,
    l,
    u,
    h,
    d,
    b,
    _,
    R,
    k,
    C,
    m,
    A,
    F,
    f,
    w,
    a,
    n
  ];
}
class Block extends SvelteComponent$f {
  constructor(e) {
    super(), init$f(this, e, instance$b, create_fragment$f, safe_not_equal$g, {
      height: 0,
      width: 1,
      elem_id: 2,
      elem_classes: 3,
      variant: 4,
      border_mode: 5,
      padding: 6,
      type: 16,
      test_id: 7,
      explicit_call: 8,
      container: 9,
      visible: 10,
      allow_overflow: 11,
      scale: 12,
      min_width: 13
    });
  }
}
const {
  SvelteComponent: SvelteComponent$e,
  append: append$b,
  attr: attr$c,
  create_component: create_component$6,
  destroy_component: destroy_component$6,
  detach: detach$e,
  element: element$9,
  init: init$e,
  insert: insert$e,
  mount_component: mount_component$6,
  safe_not_equal: safe_not_equal$f,
  set_data: set_data$4,
  space: space$6,
  text: text$6,
  toggle_class: toggle_class$7,
  transition_in: transition_in$8,
  transition_out: transition_out$8
} = window.__gradio__svelte__internal;
function create_fragment$e(r) {
  let e, t, n, a, s, o;
  return n = new /*Icon*/
  r[1]({}), {
    c() {
      e = element$9("label"), t = element$9("span"), create_component$6(n.$$.fragment), a = space$6(), s = text$6(
        /*label*/
        r[0]
      ), attr$c(t, "class", "svelte-9gxdi0"), attr$c(e, "for", ""), attr$c(e, "data-testid", "block-label"), attr$c(e, "class", "svelte-9gxdi0"), toggle_class$7(e, "hide", !/*show_label*/
      r[2]), toggle_class$7(e, "sr-only", !/*show_label*/
      r[2]), toggle_class$7(
        e,
        "float",
        /*float*/
        r[4]
      ), toggle_class$7(
        e,
        "hide-label",
        /*disable*/
        r[3]
      );
    },
    m(c, l) {
      insert$e(c, e, l), append$b(e, t), mount_component$6(n, t, null), append$b(e, a), append$b(e, s), o = !0;
    },
    p(c, [l]) {
      (!o || l & /*label*/
      1) && set_data$4(
        s,
        /*label*/
        c[0]
      ), (!o || l & /*show_label*/
      4) && toggle_class$7(e, "hide", !/*show_label*/
      c[2]), (!o || l & /*show_label*/
      4) && toggle_class$7(e, "sr-only", !/*show_label*/
      c[2]), (!o || l & /*float*/
      16) && toggle_class$7(
        e,
        "float",
        /*float*/
        c[4]
      ), (!o || l & /*disable*/
      8) && toggle_class$7(
        e,
        "hide-label",
        /*disable*/
        c[3]
      );
    },
    i(c) {
      o || (transition_in$8(n.$$.fragment, c), o = !0);
    },
    o(c) {
      transition_out$8(n.$$.fragment, c), o = !1;
    },
    d(c) {
      c && detach$e(e), destroy_component$6(n);
    }
  };
}
function instance$a(r, e, t) {
  let { label: n = null } = e, { Icon: a } = e, { show_label: s = !0 } = e, { disable: o = !1 } = e, { float: c = !0 } = e;
  return r.$$set = (l) => {
    "label" in l && t(0, n = l.label), "Icon" in l && t(1, a = l.Icon), "show_label" in l && t(2, s = l.show_label), "disable" in l && t(3, o = l.disable), "float" in l && t(4, c = l.float);
  }, [n, a, s, o, c];
}
class BlockLabel extends SvelteComponent$e {
  constructor(e) {
    super(), init$e(this, e, instance$a, create_fragment$e, safe_not_equal$f, {
      label: 0,
      Icon: 1,
      show_label: 2,
      disable: 3,
      float: 4
    });
  }
}
const {
  SvelteComponent: SvelteComponent$d,
  append: append$a,
  attr: attr$b,
  bubble: bubble$1,
  create_component: create_component$5,
  destroy_component: destroy_component$5,
  detach: detach$d,
  element: element$8,
  init: init$d,
  insert: insert$d,
  listen: listen$4,
  mount_component: mount_component$5,
  safe_not_equal: safe_not_equal$e,
  set_data: set_data$3,
  set_style: set_style$5,
  space: space$5,
  text: text$5,
  toggle_class: toggle_class$6,
  transition_in: transition_in$7,
  transition_out: transition_out$7
} = window.__gradio__svelte__internal;
function create_if_block$6(r) {
  let e, t;
  return {
    c() {
      e = element$8("span"), t = text$5(
        /*label*/
        r[1]
      ), attr$b(e, "class", "svelte-1lrphxw");
    },
    m(n, a) {
      insert$d(n, e, a), append$a(e, t);
    },
    p(n, a) {
      a & /*label*/
      2 && set_data$3(
        t,
        /*label*/
        n[1]
      );
    },
    d(n) {
      n && detach$d(e);
    }
  };
}
function create_fragment$d(r) {
  let e, t, n, a, s, o, c, l = (
    /*show_label*/
    r[2] && create_if_block$6(r)
  );
  return a = new /*Icon*/
  r[0]({}), {
    c() {
      e = element$8("button"), l && l.c(), t = space$5(), n = element$8("div"), create_component$5(a.$$.fragment), attr$b(n, "class", "svelte-1lrphxw"), toggle_class$6(
        n,
        "small",
        /*size*/
        r[4] === "small"
      ), toggle_class$6(
        n,
        "large",
        /*size*/
        r[4] === "large"
      ), toggle_class$6(
        n,
        "medium",
        /*size*/
        r[4] === "medium"
      ), e.disabled = /*disabled*/
      r[7], attr$b(
        e,
        "aria-label",
        /*label*/
        r[1]
      ), attr$b(
        e,
        "aria-haspopup",
        /*hasPopup*/
        r[8]
      ), attr$b(
        e,
        "title",
        /*label*/
        r[1]
      ), attr$b(e, "class", "svelte-1lrphxw"), toggle_class$6(
        e,
        "pending",
        /*pending*/
        r[3]
      ), toggle_class$6(
        e,
        "padded",
        /*padded*/
        r[5]
      ), toggle_class$6(
        e,
        "highlight",
        /*highlight*/
        r[6]
      ), toggle_class$6(
        e,
        "transparent",
        /*transparent*/
        r[9]
      ), set_style$5(e, "color", !/*disabled*/
      r[7] && /*_color*/
      r[12] ? (
        /*_color*/
        r[12]
      ) : "var(--block-label-text-color)"), set_style$5(e, "--bg-color", /*disabled*/
      r[7] ? "auto" : (
        /*background*/
        r[10]
      )), set_style$5(
        e,
        "margin-left",
        /*offset*/
        r[11] + "px"
      );
    },
    m(u, h) {
      insert$d(u, e, h), l && l.m(e, null), append$a(e, t), append$a(e, n), mount_component$5(a, n, null), s = !0, o || (c = listen$4(
        e,
        "click",
        /*click_handler*/
        r[14]
      ), o = !0);
    },
    p(u, [h]) {
      /*show_label*/
      u[2] ? l ? l.p(u, h) : (l = create_if_block$6(u), l.c(), l.m(e, t)) : l && (l.d(1), l = null), (!s || h & /*size*/
      16) && toggle_class$6(
        n,
        "small",
        /*size*/
        u[4] === "small"
      ), (!s || h & /*size*/
      16) && toggle_class$6(
        n,
        "large",
        /*size*/
        u[4] === "large"
      ), (!s || h & /*size*/
      16) && toggle_class$6(
        n,
        "medium",
        /*size*/
        u[4] === "medium"
      ), (!s || h & /*disabled*/
      128) && (e.disabled = /*disabled*/
      u[7]), (!s || h & /*label*/
      2) && attr$b(
        e,
        "aria-label",
        /*label*/
        u[1]
      ), (!s || h & /*hasPopup*/
      256) && attr$b(
        e,
        "aria-haspopup",
        /*hasPopup*/
        u[8]
      ), (!s || h & /*label*/
      2) && attr$b(
        e,
        "title",
        /*label*/
        u[1]
      ), (!s || h & /*pending*/
      8) && toggle_class$6(
        e,
        "pending",
        /*pending*/
        u[3]
      ), (!s || h & /*padded*/
      32) && toggle_class$6(
        e,
        "padded",
        /*padded*/
        u[5]
      ), (!s || h & /*highlight*/
      64) && toggle_class$6(
        e,
        "highlight",
        /*highlight*/
        u[6]
      ), (!s || h & /*transparent*/
      512) && toggle_class$6(
        e,
        "transparent",
        /*transparent*/
        u[9]
      ), h & /*disabled, _color*/
      4224 && set_style$5(e, "color", !/*disabled*/
      u[7] && /*_color*/
      u[12] ? (
        /*_color*/
        u[12]
      ) : "var(--block-label-text-color)"), h & /*disabled, background*/
      1152 && set_style$5(e, "--bg-color", /*disabled*/
      u[7] ? "auto" : (
        /*background*/
        u[10]
      )), h & /*offset*/
      2048 && set_style$5(
        e,
        "margin-left",
        /*offset*/
        u[11] + "px"
      );
    },
    i(u) {
      s || (transition_in$7(a.$$.fragment, u), s = !0);
    },
    o(u) {
      transition_out$7(a.$$.fragment, u), s = !1;
    },
    d(u) {
      u && detach$d(e), l && l.d(), destroy_component$5(a), o = !1, c();
    }
  };
}
function instance$9(r, e, t) {
  let n, { Icon: a } = e, { label: s = "" } = e, { show_label: o = !1 } = e, { pending: c = !1 } = e, { size: l = "small" } = e, { padded: u = !0 } = e, { highlight: h = !1 } = e, { disabled: d = !1 } = e, { hasPopup: w = !1 } = e, { color: b = "var(--block-label-text-color)" } = e, { transparent: _ = !1 } = e, { background: R = "var(--background-fill-primary)" } = e, { offset: k = 0 } = e;
  function C(m) {
    bubble$1.call(this, r, m);
  }
  return r.$$set = (m) => {
    "Icon" in m && t(0, a = m.Icon), "label" in m && t(1, s = m.label), "show_label" in m && t(2, o = m.show_label), "pending" in m && t(3, c = m.pending), "size" in m && t(4, l = m.size), "padded" in m && t(5, u = m.padded), "highlight" in m && t(6, h = m.highlight), "disabled" in m && t(7, d = m.disabled), "hasPopup" in m && t(8, w = m.hasPopup), "color" in m && t(13, b = m.color), "transparent" in m && t(9, _ = m.transparent), "background" in m && t(10, R = m.background), "offset" in m && t(11, k = m.offset);
  }, r.$$.update = () => {
    r.$$.dirty & /*highlight, color*/
    8256 && t(12, n = h ? "var(--color-accent)" : b);
  }, [
    a,
    s,
    o,
    c,
    l,
    u,
    h,
    d,
    w,
    _,
    R,
    k,
    n,
    b,
    C
  ];
}
class IconButton extends SvelteComponent$d {
  constructor(e) {
    super(), init$d(this, e, instance$9, create_fragment$d, safe_not_equal$e, {
      Icon: 0,
      label: 1,
      show_label: 2,
      pending: 3,
      size: 4,
      padded: 5,
      highlight: 6,
      disabled: 7,
      hasPopup: 8,
      color: 13,
      transparent: 9,
      background: 10,
      offset: 11
    });
  }
}
const {
  SvelteComponent: SvelteComponent$c,
  append: append$9,
  attr: attr$a,
  binding_callbacks: binding_callbacks$3,
  create_slot: create_slot$2,
  detach: detach$c,
  element: element$7,
  get_all_dirty_from_scope: get_all_dirty_from_scope$2,
  get_slot_changes: get_slot_changes$2,
  init: init$c,
  insert: insert$c,
  safe_not_equal: safe_not_equal$d,
  toggle_class: toggle_class$5,
  transition_in: transition_in$6,
  transition_out: transition_out$6,
  update_slot_base: update_slot_base$2
} = window.__gradio__svelte__internal;
function create_fragment$c(r) {
  let e, t, n;
  const a = (
    /*#slots*/
    r[5].default
  ), s = create_slot$2(
    a,
    r,
    /*$$scope*/
    r[4],
    null
  );
  return {
    c() {
      e = element$7("div"), t = element$7("div"), s && s.c(), attr$a(t, "class", "icon svelte-3w3rth"), attr$a(e, "class", "empty svelte-3w3rth"), attr$a(e, "aria-label", "Empty value"), toggle_class$5(
        e,
        "small",
        /*size*/
        r[0] === "small"
      ), toggle_class$5(
        e,
        "large",
        /*size*/
        r[0] === "large"
      ), toggle_class$5(
        e,
        "unpadded_box",
        /*unpadded_box*/
        r[1]
      ), toggle_class$5(
        e,
        "small_parent",
        /*parent_height*/
        r[3]
      );
    },
    m(o, c) {
      insert$c(o, e, c), append$9(e, t), s && s.m(t, null), r[6](e), n = !0;
    },
    p(o, [c]) {
      s && s.p && (!n || c & /*$$scope*/
      16) && update_slot_base$2(
        s,
        a,
        o,
        /*$$scope*/
        o[4],
        n ? get_slot_changes$2(
          a,
          /*$$scope*/
          o[4],
          c,
          null
        ) : get_all_dirty_from_scope$2(
          /*$$scope*/
          o[4]
        ),
        null
      ), (!n || c & /*size*/
      1) && toggle_class$5(
        e,
        "small",
        /*size*/
        o[0] === "small"
      ), (!n || c & /*size*/
      1) && toggle_class$5(
        e,
        "large",
        /*size*/
        o[0] === "large"
      ), (!n || c & /*unpadded_box*/
      2) && toggle_class$5(
        e,
        "unpadded_box",
        /*unpadded_box*/
        o[1]
      ), (!n || c & /*parent_height*/
      8) && toggle_class$5(
        e,
        "small_parent",
        /*parent_height*/
        o[3]
      );
    },
    i(o) {
      n || (transition_in$6(s, o), n = !0);
    },
    o(o) {
      transition_out$6(s, o), n = !1;
    },
    d(o) {
      o && detach$c(e), s && s.d(o), r[6](null);
    }
  };
}
function instance$8(r, e, t) {
  let n, { $$slots: a = {}, $$scope: s } = e, { size: o = "small" } = e, { unpadded_box: c = !1 } = e, l;
  function u(d) {
    var w;
    if (!d) return !1;
    const { height: b } = d.getBoundingClientRect(), { height: _ } = ((w = d.parentElement) === null || w === void 0 ? void 0 : w.getBoundingClientRect()) || { height: b };
    return b > _ + 2;
  }
  function h(d) {
    binding_callbacks$3[d ? "unshift" : "push"](() => {
      l = d, t(2, l);
    });
  }
  return r.$$set = (d) => {
    "size" in d && t(0, o = d.size), "unpadded_box" in d && t(1, c = d.unpadded_box), "$$scope" in d && t(4, s = d.$$scope);
  }, r.$$.update = () => {
    r.$$.dirty & /*el*/
    4 && t(3, n = u(l));
  }, [o, c, l, n, s, a, h];
}
class Empty extends SvelteComponent$c {
  constructor(e) {
    super(), init$c(this, e, instance$8, create_fragment$c, safe_not_equal$d, { size: 0, unpadded_box: 1 });
  }
}
const {
  SvelteComponent: SvelteComponent$b,
  append: append$8,
  attr: attr$9,
  detach: detach$b,
  init: init$b,
  insert: insert$b,
  noop: noop$a,
  safe_not_equal: safe_not_equal$c,
  svg_element: svg_element$4
} = window.__gradio__svelte__internal;
function create_fragment$b(r) {
  let e, t;
  return {
    c() {
      e = svg_element$4("svg"), t = svg_element$4("polyline"), attr$9(t, "points", "20 6 9 17 4 12"), attr$9(e, "xmlns", "http://www.w3.org/2000/svg"), attr$9(e, "viewBox", "2 0 20 20"), attr$9(e, "fill", "none"), attr$9(e, "stroke", "currentColor"), attr$9(e, "aria-hidden", "true"), attr$9(e, "stroke-width", "2"), attr$9(e, "stroke-linecap", "round"), attr$9(e, "stroke-linejoin", "round");
    },
    m(n, a) {
      insert$b(n, e, a), append$8(e, t);
    },
    p: noop$a,
    i: noop$a,
    o: noop$a,
    d(n) {
      n && detach$b(e);
    }
  };
}
class Check extends SvelteComponent$b {
  constructor(e) {
    super(), init$b(this, e, null, create_fragment$b, safe_not_equal$c, {});
  }
}
const {
  SvelteComponent: SvelteComponent$a,
  append: append$7,
  attr: attr$8,
  detach: detach$a,
  init: init$a,
  insert: insert$a,
  noop: noop$9,
  safe_not_equal: safe_not_equal$b,
  set_style: set_style$4,
  svg_element: svg_element$3
} = window.__gradio__svelte__internal;
function create_fragment$a(r) {
  let e, t, n, a;
  return {
    c() {
      e = svg_element$3("svg"), t = svg_element$3("g"), n = svg_element$3("path"), a = svg_element$3("path"), attr$8(n, "d", "M18,6L6.087,17.913"), set_style$4(n, "fill", "none"), set_style$4(n, "fill-rule", "nonzero"), set_style$4(n, "stroke-width", "2px"), attr$8(t, "transform", "matrix(1.14096,-0.140958,-0.140958,1.14096,-0.0559523,0.0559523)"), attr$8(a, "d", "M4.364,4.364L19.636,19.636"), set_style$4(a, "fill", "none"), set_style$4(a, "fill-rule", "nonzero"), set_style$4(a, "stroke-width", "2px"), attr$8(e, "width", "100%"), attr$8(e, "height", "100%"), attr$8(e, "viewBox", "0 0 24 24"), attr$8(e, "version", "1.1"), attr$8(e, "xmlns", "http://www.w3.org/2000/svg"), attr$8(e, "xmlns:xlink", "http://www.w3.org/1999/xlink"), attr$8(e, "xml:space", "preserve"), attr$8(e, "stroke", "currentColor"), set_style$4(e, "fill-rule", "evenodd"), set_style$4(e, "clip-rule", "evenodd"), set_style$4(e, "stroke-linecap", "round"), set_style$4(e, "stroke-linejoin", "round");
    },
    m(s, o) {
      insert$a(s, e, o), append$7(e, t), append$7(t, n), append$7(e, a);
    },
    p: noop$9,
    i: noop$9,
    o: noop$9,
    d(s) {
      s && detach$a(e);
    }
  };
}
class Clear extends SvelteComponent$a {
  constructor(e) {
    super(), init$a(this, e, null, create_fragment$a, safe_not_equal$b, {});
  }
}
const {
  SvelteComponent: SvelteComponent$9,
  append: append$6,
  attr: attr$7,
  detach: detach$9,
  init: init$9,
  insert: insert$9,
  noop: noop$8,
  safe_not_equal: safe_not_equal$a,
  svg_element: svg_element$2
} = window.__gradio__svelte__internal;
function create_fragment$9(r) {
  let e, t, n;
  return {
    c() {
      e = svg_element$2("svg"), t = svg_element$2("path"), n = svg_element$2("path"), attr$7(t, "fill", "currentColor"), attr$7(t, "d", "M28 10v18H10V10h18m0-2H10a2 2 0 0 0-2 2v18a2 2 0 0 0 2 2h18a2 2 0 0 0 2-2V10a2 2 0 0 0-2-2Z"), attr$7(n, "fill", "currentColor"), attr$7(n, "d", "M4 18H2V4a2 2 0 0 1 2-2h14v2H4Z"), attr$7(e, "xmlns", "http://www.w3.org/2000/svg"), attr$7(e, "viewBox", "0 0 33 33"), attr$7(e, "color", "currentColor"), attr$7(e, "aria-hidden", "true");
    },
    m(a, s) {
      insert$9(a, e, s), append$6(e, t), append$6(e, n);
    },
    p: noop$8,
    i: noop$8,
    o: noop$8,
    d(a) {
      a && detach$9(e);
    }
  };
}
class Copy extends SvelteComponent$9 {
  constructor(e) {
    super(), init$9(this, e, null, create_fragment$9, safe_not_equal$a, {});
  }
}
const {
  SvelteComponent: SvelteComponent$8,
  append: append$5,
  attr: attr$6,
  detach: detach$8,
  init: init$8,
  insert: insert$8,
  noop: noop$7,
  safe_not_equal: safe_not_equal$9,
  svg_element: svg_element$1
} = window.__gradio__svelte__internal;
function create_fragment$8(r) {
  let e, t, n;
  return {
    c() {
      e = svg_element$1("svg"), t = svg_element$1("path"), n = svg_element$1("polyline"), attr$6(t, "d", "M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"), attr$6(n, "points", "13 2 13 9 20 9"), attr$6(e, "xmlns", "http://www.w3.org/2000/svg"), attr$6(e, "width", "100%"), attr$6(e, "height", "100%"), attr$6(e, "viewBox", "0 0 24 24"), attr$6(e, "fill", "none"), attr$6(e, "stroke", "currentColor"), attr$6(e, "stroke-width", "1.5"), attr$6(e, "stroke-linecap", "round"), attr$6(e, "stroke-linejoin", "round"), attr$6(e, "class", "feather feather-file");
    },
    m(a, s) {
      insert$8(a, e, s), append$5(e, t), append$5(e, n);
    },
    p: noop$7,
    i: noop$7,
    o: noop$7,
    d(a) {
      a && detach$8(e);
    }
  };
}
class File extends SvelteComponent$8 {
  constructor(e) {
    super(), init$8(this, e, null, create_fragment$8, safe_not_equal$9, {});
  }
}
const color_values = [
  { 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 }
], tw_colors = {
  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"
  }
};
color_values.reduce((r, { color: e, primary: t, secondary: n }) => ({
  ...r,
  [e]: {
    primary: tw_colors[e][t],
    secondary: tw_colors[e][n]
  }
}), {});
function copy(r) {
  r.addEventListener("click", e);
  async function e(t) {
    const n = t.composedPath(), [a] = n.filter(
      (s) => (s == null ? void 0 : s.tagName) === "BUTTON" && s.classList.contains("copy_code_button")
    );
    if (a) {
      let s = function(u) {
        u.style.opacity = "1", setTimeout(() => {
          u.style.opacity = "0";
        }, 2e3);
      };
      t.stopImmediatePropagation();
      const o = a.parentElement.innerText.trim(), c = Array.from(
        a.children
      )[1];
      await copy_to_clipboard(o) && s(c);
    }
  }
  return {
    destroy() {
      r.removeEventListener("click", e);
    }
  };
}
async function copy_to_clipboard(r) {
  let e = !1;
  if ("clipboard" in navigator)
    await navigator.clipboard.writeText(r), e = !0;
  else {
    const t = document.createElement("textarea");
    t.value = r, t.style.position = "absolute", t.style.left = "-999999px", document.body.prepend(t), t.select();
    try {
      document.execCommand("copy"), e = !0;
    } catch (n) {
      console.error(n), e = !1;
    } finally {
      t.remove();
    }
  }
  return e;
}
function _getDefaults() {
  return {
    async: !1,
    breaks: !1,
    extensions: null,
    gfm: !0,
    hooks: null,
    pedantic: !1,
    renderer: null,
    silent: !1,
    tokenizer: null,
    walkTokens: null
  };
}
let _defaults = _getDefaults();
function changeDefaults(r) {
  _defaults = r;
}
const escapeTest$1 = /[&<>"']/, escapeReplace$1 = new RegExp(escapeTest$1.source, "g"), escapeTestNoEncode$1 = /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode$1 = new RegExp(escapeTestNoEncode$1.source, "g"), escapeReplacements$1 = {
  "&": "&amp;",
  "<": "&lt;",
  ">": "&gt;",
  '"': "&quot;",
  "'": "&#39;"
}, getEscapeReplacement$1 = (r) => escapeReplacements$1[r];
function escape$1$1(r, e) {
  if (e) {
    if (escapeTest$1.test(r))
      return r.replace(escapeReplace$1, getEscapeReplacement$1);
  } else if (escapeTestNoEncode$1.test(r))
    return r.replace(escapeReplaceNoEncode$1, getEscapeReplacement$1);
  return r;
}
const unescapeTest = /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;
function unescape$1(r) {
  return r.replace(unescapeTest, (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 caret = /(^|[^\[])\^/g;
function edit(r, e) {
  let t = typeof r == "string" ? r : r.source;
  e = e || "";
  const n = {
    replace: (a, s) => {
      let o = typeof s == "string" ? s : s.source;
      return o = o.replace(caret, "$1"), t = t.replace(a, o), n;
    },
    getRegex: () => new RegExp(t, e)
  };
  return n;
}
function cleanUrl(r) {
  try {
    r = encodeURI(r).replace(/%25/g, "%");
  } catch {
    return null;
  }
  return r;
}
const noopTest = { exec: () => null };
function splitCells(r, e) {
  const t = r.replace(/\|/g, (s, o, c) => {
    let l = !1, u = o;
    for (; --u >= 0 && c[u] === "\\"; )
      l = !l;
    return l ? "|" : " |";
  }), n = t.split(/ \|/);
  let a = 0;
  if (n[0].trim() || n.shift(), n.length > 0 && !n[n.length - 1].trim() && n.pop(), e)
    if (n.length > e)
      n.splice(e);
    else
      for (; n.length < e; )
        n.push("");
  for (; a < n.length; a++)
    n[a] = n[a].trim().replace(/\\\|/g, "|");
  return n;
}
function rtrim(r, e, t) {
  const n = r.length;
  if (n === 0)
    return "";
  let a = 0;
  for (; a < n; ) {
    const s = r.charAt(n - a - 1);
    if (s === e && !t)
      a++;
    else if (s !== e && t)
      a++;
    else
      break;
  }
  return r.slice(0, n - a);
}
function findClosingBracket(r, e) {
  if (r.indexOf(e[1]) === -1)
    return -1;
  let t = 0;
  for (let n = 0; n < r.length; n++)
    if (r[n] === "\\")
      n++;
    else if (r[n] === e[0])
      t++;
    else if (r[n] === e[1] && (t--, t < 0))
      return n;
  return -1;
}
function outputLink(r, e, t, n) {
  const a = e.href, s = e.title ? escape$1$1(e.title) : null, o = r[1].replace(/\\([\[\]])/g, "$1");
  if (r[0].charAt(0) !== "!") {
    n.state.inLink = !0;
    const c = {
      type: "link",
      raw: t,
      href: a,
      title: s,
      text: o,
      tokens: n.inlineTokens(o)
    };
    return n.state.inLink = !1, c;
  }
  return {
    type: "image",
    raw: t,
    href: a,
    title: s,
    text: escape$1$1(o)
  };
}
function indentCodeCompensation(r, e) {
  const t = r.match(/^(\s+)(?:```)/);
  if (t === null)
    return e;
  const n = t[1];
  return e.split(`
`).map((a) => {
    const s = a.match(/^\s+/);
    if (s === null)
      return a;
    const [o] = s;
    return o.length >= n.length ? a.slice(n.length) : a;
  }).join(`
`);
}
class _Tokenizer {
  // set by the lexer
  constructor(e) {
    Ke(this, "options");
    Ke(this, "rules");
    // set by the lexer
    Ke(this, "lexer");
    this.options = e || _defaults;
  }
  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 : rtrim(n, `
`)
      };
    }
  }
  fences(e) {
    const t = this.rules.block.fences.exec(e);
    if (t) {
      const n = t[0], a = indentCodeCompensation(n, t[3] || "");
      return {
        type: "code",
        raw: n,
        lang: t[2] ? t[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t[2],
        text: a
      };
    }
  }
  heading(e) {
    const t = this.rules.block.heading.exec(e);
    if (t) {
      let n = t[2].trim();
      if (/#$/.test(n)) {
        const a = rtrim(n, "#");
        (this.options.pedantic || !a || / $/.test(a)) && (n = a.trim());
      }
      return {
        type: "heading",
        raw: t[0],
        depth: t[1].length,
        text: n,
        tokens: this.lexer.inline(n)
      };
    }
  }
  hr(e) {
    const t = this.rules.block.hr.exec(e);
    if (t)
      return {
        type: "hr",
        raw: t[0]
      };
  }
  blockquote(e) {
    const t = this.rules.block.blockquote.exec(e);
    if (t) {
      let n = t[0].replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g, `
    $1`);
      n = rtrim(n.replace(/^ *>[ \t]?/gm, ""), `
`);
      const a = this.lexer.state.top;
      this.lexer.state.top = !0;
      const s = this.lexer.blockTokens(n);
      return this.lexer.state.top = a, {
        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 a = n.length > 1, s = {
        type: "list",
        raw: "",
        ordered: a,
        start: a ? +n.slice(0, -1) : "",
        loose: !1,
        items: []
      };
      n = a ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = a ? n : "[*+-]");
      const o = new RegExp(`^( {0,3}${n})((?:[	 ][^\\n]*)?(?:\\n|$))`);
      let c = "", l = "", u = !1;
      for (; e; ) {
        let h = !1;
        if (!(t = o.exec(e)) || this.rules.block.hr.test(e))
          break;
        c = t[0], e = e.substring(c.length);
        let d = t[2].split(`
`, 1)[0].replace(/^\t+/, (C) => " ".repeat(3 * C.length)), w = e.split(`
`, 1)[0], b = 0;
        this.options.pedantic ? (b = 2, l = d.trimStart()) : (b = t[2].search(/[^ ]/), b = b > 4 ? 1 : b, l = d.slice(b), b += t[1].length);
        let _ = !1;
        if (!d && /^ *$/.test(w) && (c += w + `
`, e = e.substring(w.length + 1), h = !0), !h) {
          const C = new RegExp(`^ {0,${Math.min(3, b - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ 	][^\\n]*)?(?:\\n|$))`), m = new RegExp(`^ {0,${Math.min(3, b - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), A = new RegExp(`^ {0,${Math.min(3, b - 1)}}(?:\`\`\`|~~~)`), F = new RegExp(`^ {0,${Math.min(3, b - 1)}}#`);
          for (; e; ) {
            const f = e.split(`
`, 1)[0];
            if (w = f, this.options.pedantic && (w = w.replace(/^ {1,4}(?=( {4})*[^ ])/g, "  ")), A.test(w) || F.test(w) || C.test(w) || m.test(e))
              break;
            if (w.search(/[^ ]/) >= b || !w.trim())
              l += `
` + w.slice(b);
            else {
              if (_ || d.search(/[^ ]/) >= 4 || A.test(d) || F.test(d) || m.test(d))
                break;
              l += `
` + w;
            }
            !_ && !w.trim() && (_ = !0), c += f + `
`, e = e.substring(f.length + 1), d = w.slice(b);
          }
        }
        s.loose || (u ? s.loose = !0 : /\n *\n *$/.test(c) && (u = !0));
        let R = null, k;
        this.options.gfm && (R = /^\[[ xX]\] /.exec(l), R && (k = R[0] !== "[ ] ", l = l.replace(/^\[[ xX]\] +/, ""))), s.items.push({
          type: "list_item",
          raw: c,
          task: !!R,
          checked: k,
          loose: !1,
          text: l,
          tokens: []
        }), s.raw += c;
      }
      s.items[s.items.length - 1].raw = c.trimEnd(), s.items[s.items.length - 1].text = l.trimEnd(), s.raw = s.raw.trimEnd();
      for (let h = 0; h < s.items.length; h++)
        if (this.lexer.state.top = !1, s.items[h].tokens = this.lexer.blockTokens(s.items[h].text, []), !s.loose) {
          const d = s.items[h].tokens.filter((b) => b.type === "space"), w = d.length > 0 && d.some((b) => /\n.*\n/.test(b.raw));
          s.loose = w;
        }
      if (s.loose)
        for (let h = 0; h < s.items.length; h++)
          s.items[h].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, " "), a = 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: a,
        title: s
      };
    }
  }
  table(e) {
    const t = this.rules.block.table.exec(e);
    if (!t || !/[:|]/.test(t[2]))
      return;
    const n = splitCells(t[1]), a = t[2].replace(/^\||\| *$/g, "").split("|"), s = t[3] && t[3].trim() ? t[3].replace(/\n[ \t]*$/, "").split(`
`) : [], o = {
      type: "table",
      raw: t[0],
      header: [],
      align: [],
      rows: []
    };
    if (n.length === a.length) {
      for (const c of a)
        /^ *-+: *$/.test(c) ? o.align.push("right") : /^ *:-+: *$/.test(c) ? o.align.push("center") : /^ *:-+ *$/.test(c) ? o.align.push("left") : o.align.push(null);
      for (const c of n)
        o.header.push({
          text: c,
          tokens: this.lexer.inline(c)
        });
      for (const c of s)
        o.rows.push(splitCells(c, o.header.length).map((l) => ({
          text: l,
          tokens: this.lexer.inline(l)
        })));
      return o;
    }
  }
  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: escape$1$1(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 o = rtrim(n.slice(0, -1), "\\");
        if ((n.length - o.length) % 2 === 0)
          return;
      } else {
        const o = findClosingBracket(t[2], "()");
        if (o > -1) {
          const l = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + o;
          t[2] = t[2].substring(0, o), t[0] = t[0].substring(0, l).trim(), t[3] = "";
        }
      }
      let a = t[2], s = "";
      if (this.options.pedantic) {
        const o = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(a);
        o && (a = o[1], s = o[3]);
      } else
        s = t[3] ? t[3].slice(1, -1) : "";
      return a = a.trim(), /^</.test(a) && (this.options.pedantic && !/>$/.test(n) ? a = a.slice(1) : a = a.slice(1, -1)), outputLink(t, {
        href: a && a.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 a = (n[2] || n[1]).replace(/\s+/g, " "), s = t[a.toLowerCase()];
      if (!s) {
        const o = n[0].charAt(0);
        return {
          type: "text",
          raw: o,
          text: o
        };
      }
      return outputLink(n, s, n[0], this.lexer);
    }
  }
  emStrong(e, t, n = "") {
    let a = this.rules.inline.emStrongLDelim.exec(e);
    if (!a || a[3] && n.match(/[\p{L}\p{N}]/u))
      return;
    if (!(a[1] || a[2] || "") || !n || this.rules.inline.punctuation.exec(n)) {
      const o = [...a[0]].length - 1;
      let c, l, u = o, h = 0;
      const d = a[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
      for (d.lastIndex = 0, t = t.slice(-1 * e.length + o); (a = d.exec(t)) != null; ) {
        if (c = a[1] || a[2] || a[3] || a[4] || a[5] || a[6], !c)
          continue;
        if (l = [...c].length, a[3] || a[4]) {
          u += l;
          continue;
        } else if ((a[5] || a[6]) && o % 3 && !((o + l) % 3)) {
          h += l;
          continue;
        }
        if (u -= l, u > 0)
          continue;
        l = Math.min(l, l + u + h);
        const w = [...a[0]][0].length, b = e.slice(0, o + a.index + w + l);
        if (Math.min(o, l) % 2) {
          const R = b.slice(1, -1);
          return {
            type: "em",
            raw: b,
            text: R,
            tokens: this.lexer.inlineTokens(R)
          };
        }
        const _ = b.slice(2, -2);
        return {
          type: "strong",
          raw: b,
          text: _,
          tokens: this.lexer.inlineTokens(_)
        };
      }
    }
  }
  codespan(e) {
    const t = this.rules.inline.code.exec(e);
    if (t) {
      let n = t[2].replace(/\n/g, " ");
      const a = /[^ ]/.test(n), s = /^ /.test(n) && / $/.test(n);
      return a && s && (n = n.substring(1, n.length - 1)), n = escape$1$1(n, !0), {
        type: "codespan",
        raw: t[0],
        text: n
      };
    }
  }
  br(e) {
    const t = this.rules.inline.br.exec(e);
    if (t)
      return {
        type: "br",
        raw: t[0]
      };
  }
  del(e) {
    const t = this.rules.inline.del.exec(e);
    if (t)
      return {
        type: "del",
        raw: t[0],
        text: t[2],
        tokens: this.lexer.inlineTokens(t[2])
      };
  }
  autolink(e) {
    const t = this.rules.inline.autolink.exec(e);
    if (t) {
      let n, a;
      return t[2] === "@" ? (n = escape$1$1(t[1]), a = "mailto:" + n) : (n = escape$1$1(t[1]), a = n), {
        type: "link",
        raw: t[0],
        text: n,
        href: a,
        tokens: [
          {
            type: "text",
            raw: n,
            text: n
          }
        ]
      };
    }
  }
  url(e) {
    var n;
    let t;
    if (t = this.rules.inline.url.exec(e)) {
      let a, s;
      if (t[2] === "@")
        a = escape$1$1(t[0]), s = "mailto:" + a;
      else {
        let o;
        do
          o = t[0], t[0] = ((n = this.rules.inline._backpedal.exec(t[0])) == null ? void 0 : n[0]) ?? "";
        while (o !== t[0]);
        a = escape$1$1(t[0]), t[1] === "www." ? s = "http://" + t[0] : s = t[0];
      }
      return {
        type: "link",
        raw: t[0],
        text: a,
        href: s,
        tokens: [
          {
            type: "text",
            raw: a,
            text: a
          }
        ]
      };
    }
  }
  inlineText(e) {
    const t = this.rules.inline.text.exec(e);
    if (t) {
      let n;
      return this.lexer.state.inRawBlock ? n = t[0] : n = escape$1$1(t[0]), {
        type: "text",
        raw: t[0],
        text: n
      };
    }
  }
}
const newline = /^(?: *(?:\n|$))+/, blockCode = /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/, fences = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, hr = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, heading = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, bullet = /(?:[*+-]|\d{1,9}[.)])/, lheading = edit(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g, bullet).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(), _paragraph = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, blockText = /^[^\n]+/, _blockLabel = /(?!\s*\])(?:\\.|[^\[\]\\])+/, def = edit(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label", _blockLabel).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), list = edit(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, bullet).getRegex(), _tag = "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", _comment = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, html$2 = edit("^ {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", _comment).replace("tag", _tag).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), paragraph = edit(_paragraph).replace("hr", hr).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", _tag).getRegex(), blockquote = edit(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", paragraph).getRegex(), blockNormal = {
  blockquote,
  code: blockCode,
  def,
  fences,
  heading,
  hr,
  html: html$2,
  lheading,
  list,
  newline,
  paragraph,
  table: noopTest,
  text: blockText
}, gfmTable = edit("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", hr).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", _tag).getRegex(), blockGfm = {
  ...blockNormal,
  table: gfmTable,
  paragraph: edit(_paragraph).replace("hr", hr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", gfmTable).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", _tag).getRegex()
}, blockPedantic = {
  ...blockNormal,
  html: edit(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", _comment).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: noopTest,
  // fences not supported
  lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
  paragraph: edit(_paragraph).replace("hr", hr).replace("heading", ` *#{1,6} *[^
]`).replace("lheading", lheading).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
}, escape$4 = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, inlineCode = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, br = /^( {2,}|\\)\n(?!\s*$)/, inlineText = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, _punctuation = "\\p{P}\\p{S}", punctuation = edit(/^((?![*_])[\spunctuation])/, "u").replace(/punctuation/g, _punctuation).getRegex(), blockSkip = /\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g, emStrongLDelim = edit(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/, "u").replace(/punct/g, _punctuation).getRegex(), emStrongRDelimAst = edit("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])", "gu").replace(/punct/g, _punctuation).getRegex(), emStrongRDelimUnd = edit("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])", "gu").replace(/punct/g, _punctuation).getRegex(), anyPunctuation = edit(/\\([punct])/, "gu").replace(/punct/g, _punctuation).getRegex(), autolink = edit(/^<(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(), _inlineComment = edit(_comment).replace("(?:-->|$)", "-->").getRegex(), tag = edit("^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", _inlineComment).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), _inlineLabel = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, link = edit(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label", _inlineLabel).replace("href", /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), reflink = edit(/^!?\[(label)\]\[(ref)\]/).replace("label", _inlineLabel).replace("ref", _blockLabel).getRegex(), nolink = edit(/^!?\[(ref)\](?:\[\])?/).replace("ref", _blockLabel).getRegex(), reflinkSearch = edit("reflink|nolink(?!\\()", "g").replace("reflink", reflink).replace("nolink", nolink).getRegex(), inlineNormal = {
  _backpedal: noopTest,
  // only used for GFM url
  anyPunctuation,
  autolink,
  blockSkip,
  br,
  code: inlineCode,
  del: noopTest,
  emStrongLDelim,
  emStrongRDelimAst,
  emStrongRDelimUnd,
  escape: escape$4,
  link,
  nolink,
  punctuation,
  reflink,
  reflinkSearch,
  tag,
  text: inlineText,
  url: noopTest
}, inlinePedantic = {
  ...inlineNormal,
  link: edit(/^!?\[(label)\]\((.*?)\)/).replace("label", _inlineLabel).getRegex(),
  reflink: edit(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", _inlineLabel).getRegex()
}, inlineGfm = {
  ...inlineNormal,
  escape: edit(escape$4).replace("])", "~|])").getRegex(),
  url: edit(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/
}, inlineBreaks = {
  ...inlineGfm,
  br: edit(br).replace("{2,}", "*").getRegex(),
  text: edit(inlineGfm.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
}, block = {
  normal: blockNormal,
  gfm: blockGfm,
  pedantic: blockPedantic
}, inline = {
  normal: inlineNormal,
  gfm: inlineGfm,
  breaks: inlineBreaks,
  pedantic: inlinePedantic
};
class _Lexer {
  constructor(e) {
    Ke(this, "tokens");
    Ke(this, "options");
    Ke(this, "state");
    Ke(this, "tokenizer");
    Ke(this, "inlineQueue");
    this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || _defaults, this.options.tokenizer = this.options.tokenizer || new _Tokenizer(), 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: block.normal,
      inline: inline.normal
    };
    this.options.pedantic ? (t.block = block.pedantic, t.inline = inline.pedantic) : this.options.gfm && (t.block = block.gfm, this.options.breaks ? t.inline = inline.breaks : t.inline = inline.gfm), this.tokenizer.rules = t;
  }
  /**
   * Expose Rules
   */
  static get rules() {
    return {
      block,
      inline
    };
  }
  /**
   * Static Lex Method
   */
  static lex(e, t) {
    return new _Lexer(t).lex(e);
  }
  /**
   * Static Lex Inline Method
   */
  static lexInline(e, t) {
    return new _Lexer(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, (c, l, u) => l + "    ".repeat(u.length));
    let n, a, s, o;
    for (; e; )
      if (!(this.options.extensions && this.options.extensions.block && this.options.extensions.block.some((c) => (n = c.call({ lexer: this }, e, t)) ? (e = e.substring(n.raw.length), t.push(n), !0) : !1))) {
        if (n = this.tokenizer.space(e)) {
          e = e.substring(n.raw.length), n.raw.length === 1 && t.length > 0 ? t[t.length - 1].raw += `
` : t.push(n);
          continue;
        }
        if (n = this.tokenizer.code(e)) {
          e = e.substring(n.raw.length), a = t[t.length - 1], a && (a.type === "paragraph" || a.type === "text") ? (a.raw += `
` + n.raw, a.text += `
` + n.text, this.inlineQueue[this.inlineQueue.length - 1].src = a.text) : t.push(n);
          continue;
        }
        if (n = this.tokenizer.fences(e)) {
          e = e.substring(n.raw.length), t.push(n);
          continue;
        }
        if (n = this.tokenizer.heading(e)) {
          e = e.substring(n.raw.length), t.push(n);
          continue;
        }
        if (n = this.tokenizer.hr(e)) {
          e = e.substring(n.raw.length), t.push(n);
          continue;
        }
        if (n = this.tokenizer.blockquote(e)) {
          e = e.substring(n.raw.length), t.push(n);
          continue;
        }
        if (n = this.tokenizer.list(e)) {
          e = e.substring(n.raw.length), t.push(n);
          continue;
        }
        if (n = this.tokenizer.html(e)) {
          e = e.substring(n.raw.length), t.push(n);
          continue;
        }
        if (n = this.tokenizer.def(e)) {
          e = e.substring(n.raw.length), a = t[t.length - 1], a && (a.type === "paragraph" || a.type === "text") ? (a.raw += `
` + n.raw, a.text += `
` + n.raw, this.inlineQueue[this.inlineQueue.length - 1].src = a.text) : this.tokens.links[n.tag] || (this.tokens.links[n.tag] = {
            href: n.href,
            title: n.title
          });
          continue;
        }
        if (n = this.tokenizer.table(e)) {
          e = e.substring(n.raw.length), t.push(n);
          continue;
        }
        if (n = this.tokenizer.lheading(e)) {
          e = e.substring(n.raw.length), t.push(n);
          continue;
        }
        if (s = e, this.options.extensions && this.options.extensions.startBlock) {
          let c = 1 / 0;
          const l = e.slice(1);
          let u;
          this.options.extensions.startBlock.forEach((h) => {
            u = h.call({ lexer: this }, l), typeof u == "number" && u >= 0 && (c = Math.min(c, u));
          }), c < 1 / 0 && c >= 0 && (s = e.substring(0, c + 1));
        }
        if (this.state.top && (n = this.tokenizer.paragraph(s))) {
          a = t[t.length - 1], o && a.type === "paragraph" ? (a.raw += `
` + n.raw, a.text += `
` + n.text, this.inlineQueue.pop(), this.inlineQueue[this.inlineQueue.length - 1].src = a.text) : t.push(n), o = s.length !== e.length, e = e.substring(n.raw.length);
          continue;
        }
        if (n = this.tokenizer.text(e)) {
          e = e.substring(n.raw.length), a = t[t.length - 1], a && a.type === "text" ? (a.raw += `
` + n.raw, a.text += `
` + n.text, this.inlineQueue.pop(), this.inlineQueue[this.inlineQueue.length - 1].src = a.text) : t.push(n);
          continue;
        }
        if (e) {
          const c = "Infinite loop on byte: " + e.charCodeAt(0);
          if (this.options.silent) {
            console.error(c);
            break;
          } else
            throw new Error(c);
        }
      }
    return this.state.top = !0, t;
  }
  inline(e, t = []) {
    return this.inlineQueue.push({ src: e, tokens: t }), t;
  }
  /**
   * Lexing/Compiling
   */
  inlineTokens(e, t = []) {
    let n, a, s, o = e, c, l, u;
    if (this.tokens.links) {
      const h = Object.keys(this.tokens.links);
      if (h.length > 0)
        for (; (c = this.tokenizer.rules.inline.reflinkSearch.exec(o)) != null; )
          h.includes(c[0].slice(c[0].lastIndexOf("[") + 1, -1)) && (o = o.slice(0, c.index) + "[" + "a".repeat(c[0].length - 2) + "]" + o.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
    }
    for (; (c = this.tokenizer.rules.inline.blockSkip.exec(o)) != null; )
      o = o.slice(0, c.index) + "[" + "a".repeat(c[0].length - 2) + "]" + o.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
    for (; (c = this.tokenizer.rules.inline.anyPunctuation.exec(o)) != null; )
      o = o.slice(0, c.index) + "++" + o.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
    for (; e; )
      if (l || (u = ""), l = !1, !(this.options.extensions && this.options.extensions.inline && this.options.extensions.inline.some((h) => (n = h.call({ lexer: this }, e, t)) ? (e = e.substring(n.raw.length), t.push(n), !0) : !1))) {
        if (n = this.tokenizer.escape(e)) {
          e = e.substring(n.raw.length), t.push(n);
          continue;
        }
        if (n = this.tokenizer.tag(e)) {
          e = e.substring(n.raw.length), a = t[t.length - 1], a && n.type === "text" && a.type === "text" ? (a.raw += n.raw, a.text += n.text) : t.push(n);
          continue;
        }
        if (n = this.tokenizer.link(e)) {
          e = e.substring(n.raw.length), t.push(n);
          continue;
        }
        if (n = this.tokenizer.reflink(e, this.tokens.links)) {
          e = e.substring(n.raw.length), a = t[t.length - 1], a && n.type === "text" && a.type === "text" ? (a.raw += n.raw, a.text += n.text) : t.push(n);
          continue;
        }
        if (n = this.tokenizer.emStrong(e, o, u)) {
          e = e.substring(n.raw.length), t.push(n);
          continue;
        }
        if (n = this.tokenizer.codespan(e)) {
          e = e.substring(n.raw.length), t.push(n);
          continue;
        }
        if (n = this.tokenizer.br(e)) {
          e = e.substring(n.raw.length), t.push(n);
          continue;
        }
        if (n = this.tokenizer.del(e)) {
          e = e.substring(n.raw.length), t.push(n);
          continue;
        }
        if (n = this.tokenizer.autolink(e)) {
          e = e.substring(n.raw.length), t.push(n);
          continue;
        }
        if (!this.state.inLink && (n = this.tokenizer.url(e))) {
          e = e.substring(n.raw.length), t.push(n);
          continue;
        }
        if (s = e, this.options.extensions && this.options.extensions.startInline) {
          let h = 1 / 0;
          const d = e.slice(1);
          let w;
          this.options.extensions.startInline.forEach((b) => {
            w = b.call({ lexer: this }, d), typeof w == "number" && w >= 0 && (h = Math.min(h, w));
          }), h < 1 / 0 && h >= 0 && (s = e.substring(0, h + 1));
        }
        if (n = this.tokenizer.inlineText(s)) {
          e = e.substring(n.raw.length), n.raw.slice(-1) !== "_" && (u = n.raw.slice(-1)), l = !0, a = t[t.length - 1], a && a.type === "text" ? (a.raw += n.raw, a.text += n.text) : t.push(n);
          continue;
        }
        if (e) {
          const h = "Infinite loop on byte: " + e.charCodeAt(0);
          if (this.options.silent) {
            console.error(h);
            break;
          } else
            throw new Error(h);
        }
      }
    return t;
  }
}
class _Renderer {
  constructor(e) {
    Ke(this, "options");
    this.options = e || _defaults;
  }
  code(e, t, n) {
    var s;
    const a = (s = (t || "").match(/^\S*/)) == null ? void 0 : s[0];
    return e = e.replace(/\n$/, "") + `
`, a ? '<pre><code class="language-' + escape$1$1(a) + '">' + (n ? e : escape$1$1(e, !0)) + `</code></pre>
` : "<pre><code>" + (n ? e : escape$1$1(e, !0)) + `</code></pre>
`;
  }
  blockquote(e) {
    return `<blockquote>
${e}</blockquote>
`;
  }
  html(e, t) {
    return e;
  }
  heading(e, t, n) {
    return `<h${t}>${e}</h${t}>
`;
  }
  hr() {
    return `<hr>
`;
  }
  list(e, t, n) {
    const a = t ? "ol" : "ul", s = t && n !== 1 ? ' start="' + n + '"' : "";
    return "<" + a + s + `>
` + e + "</" + a + `>
`;
  }
  listitem(e, t, n) {
    return `<li>${e}</li>
`;
  }
  checkbox(e) {
    return "<input " + (e ? 'checked="" ' : "") + 'disabled="" type="checkbox">';
  }
  paragraph(e) {
    return `<p>${e}</p>
`;
  }
  table(e, t) {
    return t && (t = `<tbody>${t}</tbody>`), `<table>
<thead>
` + e + `</thead>
` + t + `</table>
`;
  }
  tablerow(e) {
    return `<tr>
${e}</tr>
`;
  }
  tablecell(e, t) {
    const n = t.header ? "th" : "td";
    return (t.align ? `<${n} align="${t.align}">` : `<${n}>`) + e + `</${n}>
`;
  }
  /**
   * span level renderer
   */
  strong(e) {
    return `<strong>${e}</strong>`;
  }
  em(e) {
    return `<em>${e}</em>`;
  }
  codespan(e) {
    return `<code>${e}</code>`;
  }
  br() {
    return "<br>";
  }
  del(e) {
    return `<del>${e}</del>`;
  }
  link(e, t, n) {
    const a = cleanUrl(e);
    if (a === null)
      return n;
    e = a;
    let s = '<a href="' + e + '"';
    return t && (s += ' title="' + t + '"'), s += ">" + n + "</a>", s;
  }
  image(e, t, n) {
    const a = cleanUrl(e);
    if (a === null)
      return n;
    e = a;
    let s = `<img src="${e}" alt="${n}"`;
    return t && (s += ` title="${t}"`), s += ">", s;
  }
  text(e) {
    return e;
  }
}
class _TextRenderer {
  // 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 _Parser {
  constructor(e) {
    Ke(this, "options");
    Ke(this, "renderer");
    Ke(this, "textRenderer");
    this.options = e || _defaults, this.options.renderer = this.options.renderer || new _Renderer(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.textRenderer = new _TextRenderer();
  }
  /**
   * Static Parse Method
   */
  static parse(e, t) {
    return new _Parser(t).parse(e);
  }
  /**
   * Static Parse Inline Method
   */
  static parseInline(e, t) {
    return new _Parser(t).parseInline(e);
  }
  /**
   * Parse Loop
   */
  parse(e, t = !0) {
    let n = "";
    for (let a = 0; a < e.length; a++) {
      const s = e[a];
      if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[s.type]) {
        const o = s, c = this.options.extensions.renderers[o.type].call({ parser: this }, o);
        if (c !== !1 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "paragraph", "text"].includes(o.type)) {
          n += c || "";
          continue;
        }
      }
      switch (s.type) {
        case "space":
          continue;
        case "hr": {
          n += this.renderer.hr();
          continue;
        }
        case "heading": {
          const o = s;
          n += this.renderer.heading(this.parseInline(o.tokens), o.depth, unescape$1(this.parseInline(o.tokens, this.textRenderer)));
          continue;
        }
        case "code": {
          const o = s;
          n += this.renderer.code(o.text, o.lang, !!o.escaped);
          continue;
        }
        case "table": {
          const o = s;
          let c = "", l = "";
          for (let h = 0; h < o.header.length; h++)
            l += this.renderer.tablecell(this.parseInline(o.header[h].tokens), { header: !0, align: o.align[h] });
          c += this.renderer.tablerow(l);
          let u = "";
          for (let h = 0; h < o.rows.length; h++) {
            const d = o.rows[h];
            l = "";
            for (let w = 0; w < d.length; w++)
              l += this.renderer.tablecell(this.parseInline(d[w].tokens), { header: !1, align: o.align[w] });
            u += this.renderer.tablerow(l);
          }
          n += this.renderer.table(c, u);
          continue;
        }
        case "blockquote": {
          const o = s, c = this.parse(o.tokens);
          n += this.renderer.blockquote(c);
          continue;
        }
        case "list": {
          const o = s, c = o.ordered, l = o.start, u = o.loose;
          let h = "";
          for (let d = 0; d < o.items.length; d++) {
            const w = o.items[d], b = w.checked, _ = w.task;
            let R = "";
            if (w.task) {
              const k = this.renderer.checkbox(!!b);
              u ? w.tokens.length > 0 && w.tokens[0].type === "paragraph" ? (w.tokens[0].text = k + " " + w.tokens[0].text, w.tokens[0].tokens && w.tokens[0].tokens.length > 0 && w.tokens[0].tokens[0].type === "text" && (w.tokens[0].tokens[0].text = k + " " + w.tokens[0].tokens[0].text)) : w.tokens.unshift({
                type: "text",
                text: k + " "
              }) : R += k + " ";
            }
            R += this.parse(w.tokens, u), h += this.renderer.listitem(R, _, !!b);
          }
          n += this.renderer.list(h, c, l);
          continue;
        }
        case "html": {
          const o = s;
          n += this.renderer.html(o.text, o.block);
          continue;
        }
        case "paragraph": {
          const o = s;
          n += this.renderer.paragraph(this.parseInline(o.tokens));
          continue;
        }
        case "text": {
          let o = s, c = o.tokens ? this.parseInline(o.tokens) : o.text;
          for (; a + 1 < e.length && e[a + 1].type === "text"; )
            o = e[++a], c += `
` + (o.tokens ? this.parseInline(o.tokens) : o.text);
          n += t ? this.renderer.paragraph(c) : c;
          continue;
        }
        default: {
          const o = 'Token with "' + s.type + '" type was not found.';
          if (this.options.silent)
            return console.error(o), "";
          throw new Error(o);
        }
      }
    }
    return n;
  }
  /**
   * Parse Inline Tokens
   */
  parseInline(e, t) {
    t = t || this.renderer;
    let n = "";
    for (let a = 0; a < e.length; a++) {
      const s = e[a];
      if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[s.type]) {
        const o = this.options.extensions.renderers[s.type].call({ parser: this }, s);
        if (o !== !1 || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(s.type)) {
          n += o || "";
          continue;
        }
      }
      switch (s.type) {
        case "escape": {
          const o = s;
          n += t.text(o.text);
          break;
        }
        case "html": {
          const o = s;
          n += t.html(o.text);
          break;
        }
        case "link": {
          const o = s;
          n += t.link(o.href, o.title, this.parseInline(o.tokens, t));
          break;
        }
        case "image": {
          const o = s;
          n += t.image(o.href, o.title, o.text);
          break;
        }
        case "strong": {
          const o = s;
          n += t.strong(this.parseInline(o.tokens, t));
          break;
        }
        case "em": {
          const o = s;
          n += t.em(this.parseInline(o.tokens, t));
          break;
        }
        case "codespan": {
          const o = s;
          n += t.codespan(o.text);
          break;
        }
        case "br": {
          n += t.br();
          break;
        }
        case "del": {
          const o = s;
          n += t.del(this.parseInline(o.tokens, t));
          break;
        }
        case "text": {
          const o = s;
          n += t.text(o.text);
          break;
        }
        default: {
          const o = 'Token with "' + s.type + '" type was not found.';
          if (this.options.silent)
            return console.error(o), "";
          throw new Error(o);
        }
      }
    }
    return n;
  }
}
class _Hooks {
  constructor(e) {
    Ke(this, "options");
    this.options = e || _defaults;
  }
  /**
   * 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;
  }
}
Ke(_Hooks, "passThroughHooks", /* @__PURE__ */ new Set([
  "preprocess",
  "postprocess",
  "processAllTokens"
]));
var pt, Wt, Mn;
class Marked {
  constructor(...e) {
    de(this, pt);
    Ke(this, "defaults", _getDefaults());
    Ke(this, "options", this.setOptions);
    Ke(this, "parse", te(this, pt, Wt).call(this, _Lexer.lex, _Parser.parse));
    Ke(this, "parseInline", te(this, pt, Wt).call(this, _Lexer.lexInline, _Parser.parseInline));
    Ke(this, "Parser", _Parser);
    Ke(this, "Renderer", _Renderer);
    Ke(this, "TextRenderer", _TextRenderer);
    Ke(this, "Lexer", _Lexer);
    Ke(this, "Tokenizer", _Tokenizer);
    Ke(this, "Hooks", _Hooks);
    this.use(...e);
  }
  /**
   * Run callback for every token
   */
  walkTokens(e, t) {
    var a, s;
    let n = [];
    for (const o of e)
      switch (n = n.concat(t.call(this, o)), o.type) {
        case "table": {
          const c = o;
          for (const l of c.header)
            n = n.concat(this.walkTokens(l.tokens, t));
          for (const l of c.rows)
            for (const u of l)
              n = n.concat(this.walkTokens(u.tokens, t));
          break;
        }
        case "list": {
          const c = o;
          n = n.concat(this.walkTokens(c.items, t));
          break;
        }
        default: {
          const c = o;
          (s = (a = this.defaults.extensions) == null ? void 0 : a.childTokens) != null && s[c.type] ? this.defaults.extensions.childTokens[c.type].forEach((l) => {
            const u = c[l].flat(1 / 0);
            n = n.concat(this.walkTokens(u, t));
          }) : c.tokens && (n = n.concat(this.walkTokens(c.tokens, t)));
        }
      }
    return n;
  }
  use(...e) {
    const t = this.defaults.extensions || { renderers: {}, childTokens: {} };
    return e.forEach((n) => {
      const a = { ...n };
      if (a.async = this.defaults.async || a.async || !1, n.extensions && (n.extensions.forEach((s) => {
        if (!s.name)
          throw new Error("extension name required");
        if ("renderer" in s) {
          const o = t.renderers[s.name];
          o ? t.renderers[s.name] = function(...c) {
            let l = s.renderer.apply(this, c);
            return l === !1 && (l = o.apply(this, c)), l;
          } : 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 o = t[s.level];
          o ? o.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);
      }), a.extensions = t), n.renderer) {
        const s = this.defaults.renderer || new _Renderer(this.defaults);
        for (const o in n.renderer) {
          if (!(o in s))
            throw new Error(`renderer '${o}' does not exist`);
          if (o === "options")
            continue;
          const c = o, l = n.renderer[c], u = s[c];
          s[c] = (...h) => {
            let d = l.apply(s, h);
            return d === !1 && (d = u.apply(s, h)), d || "";
          };
        }
        a.renderer = s;
      }
      if (n.tokenizer) {
        const s = this.defaults.tokenizer || new _Tokenizer(this.defaults);
        for (const o in n.tokenizer) {
          if (!(o in s))
            throw new Error(`tokenizer '${o}' does not exist`);
          if (["options", "rules", "lexer"].includes(o))
            continue;
          const c = o, l = n.tokenizer[c], u = s[c];
          s[c] = (...h) => {
            let d = l.apply(s, h);
            return d === !1 && (d = u.apply(s, h)), d;
          };
        }
        a.tokenizer = s;
      }
      if (n.hooks) {
        const s = this.defaults.hooks || new _Hooks();
        for (const o in n.hooks) {
          if (!(o in s))
            throw new Error(`hook '${o}' does not exist`);
          if (o === "options")
            continue;
          const c = o, l = n.hooks[c], u = s[c];
          _Hooks.passThroughHooks.has(o) ? s[c] = (h) => {
            if (this.defaults.async)
              return Promise.resolve(l.call(s, h)).then((w) => u.call(s, w));
            const d = l.call(s, h);
            return u.call(s, d);
          } : s[c] = (...h) => {
            let d = l.apply(s, h);
            return d === !1 && (d = u.apply(s, h)), d;
          };
        }
        a.hooks = s;
      }
      if (n.walkTokens) {
        const s = this.defaults.walkTokens, o = n.walkTokens;
        a.walkTokens = function(c) {
          let l = [];
          return l.push(o.call(this, c)), s && (l = l.concat(s.call(this, c))), l;
        };
      }
      this.defaults = { ...this.defaults, ...a };
    }), this;
  }
  setOptions(e) {
    return this.defaults = { ...this.defaults, ...e }, this;
  }
  lexer(e, t) {
    return _Lexer.lex(e, t ?? this.defaults);
  }
  parser(e, t) {
    return _Parser.parse(e, t ?? this.defaults);
  }
}
pt = new WeakSet(), Wt = function(e, t) {
  return (n, a) => {
    const s = { ...a }, o = { ...this.defaults, ...s };
    this.defaults.async === !0 && s.async === !1 && (o.silent || console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."), o.async = !0);
    const c = te(this, pt, Mn).call(this, !!o.silent, !!o.async);
    if (typeof n > "u" || n === null)
      return c(new Error("marked(): input parameter is undefined or null"));
    if (typeof n != "string")
      return c(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n) + ", string expected"));
    if (o.hooks && (o.hooks.options = o), o.async)
      return Promise.resolve(o.hooks ? o.hooks.preprocess(n) : n).then((l) => e(l, o)).then((l) => o.hooks ? o.hooks.processAllTokens(l) : l).then((l) => o.walkTokens ? Promise.all(this.walkTokens(l, o.walkTokens)).then(() => l) : l).then((l) => t(l, o)).then((l) => o.hooks ? o.hooks.postprocess(l) : l).catch(c);
    try {
      o.hooks && (n = o.hooks.preprocess(n));
      let l = e(n, o);
      o.hooks && (l = o.hooks.processAllTokens(l)), o.walkTokens && this.walkTokens(l, o.walkTokens);
      let u = t(l, o);
      return o.hooks && (u = o.hooks.postprocess(u)), u;
    } catch (l) {
      return c(l);
    }
  };
}, Mn = function(e, t) {
  return (n) => {
    if (n.message += `
Please report this to https://github.com/markedjs/marked.`, e) {
      const a = "<p>An error occurred:</p><pre>" + escape$1$1(n.message + "", !0) + "</pre>";
      return t ? Promise.resolve(a) : a;
    }
    if (t)
      return Promise.reject(n);
    throw n;
  };
};
const markedInstance = new Marked();
function marked(r, e) {
  return markedInstance.parse(r, e);
}
marked.options = marked.setOptions = function(r) {
  return markedInstance.setOptions(r), marked.defaults = markedInstance.defaults, changeDefaults(marked.defaults), marked;
};
marked.getDefaults = _getDefaults;
marked.defaults = _defaults;
marked.use = function(...r) {
  return markedInstance.use(...r), marked.defaults = markedInstance.defaults, changeDefaults(marked.defaults), marked;
};
marked.walkTokens = function(r, e) {
  return markedInstance.walkTokens(r, e);
};
marked.parseInline = markedInstance.parseInline;
marked.Parser = _Parser;
marked.parser = _Parser.parse;
marked.Renderer = _Renderer;
marked.TextRenderer = _TextRenderer;
marked.Lexer = _Lexer;
marked.lexer = _Lexer.lex;
marked.Tokenizer = _Tokenizer;
marked.Hooks = _Hooks;
marked.parse = marked;
marked.options;
marked.setOptions;
marked.use;
marked.walkTokens;
marked.parseInline;
_Parser.parse;
_Lexer.lex;
function markedHighlight(r) {
  if (typeof r == "function" && (r = {
    highlight: r
  }), !r || typeof r.highlight != "function")
    throw new Error("Must provide highlight function");
  return typeof r.langPrefix != "string" && (r.langPrefix = "language-"), {
    async: !!r.async,
    walkTokens(e) {
      if (e.type !== "code")
        return;
      const t = getLang(e.lang);
      if (r.async)
        return Promise.resolve(r.highlight(e.text, t, e.lang || "")).then(updateToken(e));
      const n = r.highlight(e.text, t, e.lang || "");
      if (n instanceof Promise)
        throw new Error("markedHighlight is not set to async but the highlight function is async. Set the async option to true on markedHighlight to await the async highlight function.");
      updateToken(e)(n);
    },
    useNewRenderer: !0,
    renderer: {
      code(e, t, n) {
        typeof e == "object" && (n = e.escaped, t = e.lang, e = e.text);
        const a = getLang(t), s = a ? ` class="${r.langPrefix}${escape$3(a)}"` : "";
        return e = e.replace(/\n$/, ""), `<pre><code${s}>${n ? e : escape$3(e, !0)}
</code></pre>`;
      }
    }
  };
}
function getLang(r) {
  return (r || "").match(/\S*/)[0];
}
function updateToken(r) {
  return (e) => {
    typeof e == "string" && e !== r.text && (r.escaped = !0, r.text = e);
  };
}
const escapeTest = /[&<>"']/, escapeReplace = new RegExp(escapeTest.source, "g"), escapeTestNoEncode = /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode = new RegExp(escapeTestNoEncode.source, "g"), escapeReplacements = {
  "&": "&amp;",
  "<": "&lt;",
  ">": "&gt;",
  '"': "&quot;",
  "'": "&#39;"
}, getEscapeReplacement = (r) => escapeReplacements[r];
function escape$3(r, e) {
  if (e) {
    if (escapeTest.test(r))
      return r.replace(escapeReplace, getEscapeReplacement);
  } else if (escapeTestNoEncode.test(r))
    return r.replace(escapeReplaceNoEncode, getEscapeReplacement);
  return r;
}
const regex = /[\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, own = Object.hasOwnProperty;
class BananaSlug {
  /**
   * Create a new slug class.
   */
  constructor() {
    this.occurrences, this.reset();
  }
  /**
   * Generate a unique slug.
  *
  * Tracks previously generated slugs: repeated calls with the same value
  * will result in different slugs.
  * Use the `slug` function to get same slugs.
   *
   * @param  {string} value
   *   String of text to slugify
   * @param  {boolean} [maintainCase=false]
   *   Keep the current case, otherwise make all lowercase
   * @return {string}
   *   A unique slug string
   */
  slug(e, t) {
    const n = this;
    let a = slug(e, t === !0);
    const s = a;
    for (; own.call(n.occurrences, a); )
      n.occurrences[s]++, a = s + "-" + n.occurrences[s];
    return n.occurrences[a] = 0, a;
  }
  /**
   * Reset - Forget all previous slugs
   *
   * @return void
   */
  reset() {
    this.occurrences = /* @__PURE__ */ Object.create(null);
  }
}
function slug(r, e) {
  return typeof r != "string" ? "" : (e || (r = r.toLowerCase()), r.replace(regex, "").replace(/ /g, "-"));
}
let slugger$1 = new BananaSlug(), headings = [];
function gfmHeadingId({ prefix: r = "", globalSlugs: e = !1 } = {}) {
  return {
    headerIds: !1,
    // prevent deprecation warning; remove this once headerIds option is removed
    hooks: {
      preprocess(t) {
        return e || resetHeadings(), t;
      }
    },
    renderer: {
      heading(t, n, a) {
        a = a.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi, "");
        const s = `${r}${slugger$1.slug(a)}`, o = { level: n, text: t, id: s };
        return headings.push(o), `<h${n} id="${s}">${t}</h${n}>
`;
      }
    }
  };
}
function resetHeadings() {
  headings = [], slugger$1 = new BananaSlug();
}
var commonjsGlobal = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function getAugmentedNamespace(r) {
  if (r.__esModule) return r;
  var e = r.default;
  if (typeof e == "function") {
    var t = function n() {
      return this instanceof n ? Reflect.construct(e, arguments, this.constructor) : e.apply(this, arguments);
    };
    t.prototype = e.prototype;
  } else t = {};
  return Object.defineProperty(t, "__esModule", { value: !0 }), Object.keys(r).forEach(function(n) {
    var a = Object.getOwnPropertyDescriptor(r, n);
    Object.defineProperty(t, n, a.get ? a : {
      enumerable: !0,
      get: function() {
        return r[n];
      }
    });
  }), t;
}
var prism = { exports: {} };
(function(r) {
  var e = typeof window < "u" ? window : typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope ? self : {};
  /**
   * Prism: Lightweight, robust, elegant syntax highlighting
   *
   * @license MIT <https://opensource.org/licenses/MIT>
   * @author Lea Verou <https://lea.verou.me>
   * @namespace
   * @public
   */
  var t = function(n) {
    var a = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i, s = 0, o = {}, c = {
      /**
       * 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 m(A) {
          return A instanceof l ? new l(A.type, m(A.content), A.alias) : Array.isArray(A) ? A.map(m) : A.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(m) {
          return Object.prototype.toString.call(m).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(m) {
          return m.__id || Object.defineProperty(m, "__id", { value: ++s }), m.__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 m(A, F) {
          F = F || {};
          var f, g;
          switch (c.util.type(A)) {
            case "Object":
              if (g = c.util.objId(A), F[g])
                return F[g];
              f = /** @type {Record<string, any>} */
              {}, F[g] = f;
              for (var y in A)
                A.hasOwnProperty(y) && (f[y] = m(A[y], F));
              return (
                /** @type {any} */
                f
              );
            case "Array":
              return g = c.util.objId(A), F[g] ? F[g] : (f = [], F[g] = f, /** @type {Array} */
              /** @type {any} */
              A.forEach(function(E, x) {
                f[x] = m(E, F);
              }), /** @type {any} */
              f);
            default:
              return A;
          }
        },
        /**
         * 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(m) {
          for (; m; ) {
            var A = a.exec(m.className);
            if (A)
              return A[1].toLowerCase();
            m = m.parentElement;
          }
          return "none";
        },
        /**
         * Sets the Prism `language-xxxx` class of the given element.
         *
         * @param {Element} element
         * @param {string} language
         * @returns {void}
         */
        setLanguage: function(m, A) {
          m.className = m.className.replace(RegExp(a, "gi"), ""), m.classList.add("language-" + A);
        },
        /**
         * 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 (f) {
            var m = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(f.stack) || [])[1];
            if (m) {
              var A = document.getElementsByTagName("script");
              for (var F in A)
                if (A[F].src == m)
                  return A[F];
            }
            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(m, A, F) {
          for (var f = "no-" + A; m; ) {
            var g = m.classList;
            if (g.contains(A))
              return !0;
            if (g.contains(f))
              return !1;
            m = m.parentElement;
          }
          return !!F;
        }
      },
      /**
       * 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: o,
        plaintext: o,
        text: o,
        txt: o,
        /**
         * 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(m, A) {
          var F = c.util.clone(c.languages[m]);
          for (var f in A)
            F[f] = A[f];
          return F;
        },
        /**
         * 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(m, A, F, f) {
          f = f || /** @type {any} */
          c.languages;
          var g = f[m], y = {};
          for (var E in g)
            if (g.hasOwnProperty(E)) {
              if (E == A)
                for (var x in F)
                  F.hasOwnProperty(x) && (y[x] = F[x]);
              F.hasOwnProperty(E) || (y[E] = g[E]);
            }
          var O = f[m];
          return f[m] = y, c.languages.DFS(c.languages, function(P, I) {
            I === O && P != m && (this[P] = y);
          }), y;
        },
        // Traverse a language definition with Depth First Search
        DFS: function m(A, F, f, g) {
          g = g || {};
          var y = c.util.objId;
          for (var E in A)
            if (A.hasOwnProperty(E)) {
              F.call(A, E, A[E], f || E);
              var x = A[E], O = c.util.type(x);
              O === "Object" && !g[y(x)] ? (g[y(x)] = !0, m(x, F, null, g)) : O === "Array" && !g[y(x)] && (g[y(x)] = !0, m(x, F, E, g));
            }
        }
      },
      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(m, A) {
        c.highlightAllUnder(document, m, A);
      },
      /**
       * 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(m, A, F) {
        var f = {
          callback: F,
          container: m,
          selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
        };
        c.hooks.run("before-highlightall", f), f.elements = Array.prototype.slice.apply(f.container.querySelectorAll(f.selector)), c.hooks.run("before-all-elements-highlight", f);
        for (var g = 0, y; y = f.elements[g++]; )
          c.highlightElement(y, A === !0, f.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(m, A, F) {
        var f = c.util.getLanguage(m), g = c.languages[f];
        c.util.setLanguage(m, f);
        var y = m.parentElement;
        y && y.nodeName.toLowerCase() === "pre" && c.util.setLanguage(y, f);
        var E = m.textContent, x = {
          element: m,
          language: f,
          grammar: g,
          code: E
        };
        function O(I) {
          x.highlightedCode = I, c.hooks.run("before-insert", x), x.element.innerHTML = x.highlightedCode, c.hooks.run("after-highlight", x), c.hooks.run("complete", x), F && F.call(x.element);
        }
        if (c.hooks.run("before-sanity-check", x), y = x.element.parentElement, y && y.nodeName.toLowerCase() === "pre" && !y.hasAttribute("tabindex") && y.setAttribute("tabindex", "0"), !x.code) {
          c.hooks.run("complete", x), F && F.call(x.element);
          return;
        }
        if (c.hooks.run("before-highlight", x), !x.grammar) {
          O(c.util.encode(x.code));
          return;
        }
        if (A && n.Worker) {
          var P = new Worker(c.filename);
          P.onmessage = function(I) {
            O(I.data);
          }, P.postMessage(JSON.stringify({
            language: x.language,
            code: x.code,
            immediateClose: !0
          }));
        } else
          O(c.highlight(x.code, x.grammar, x.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(m, A, F) {
        var f = {
          code: m,
          grammar: A,
          language: F
        };
        if (c.hooks.run("before-tokenize", f), !f.grammar)
          throw new Error('The language "' + f.language + '" has no grammar.');
        return f.tokens = c.tokenize(f.code, f.grammar), c.hooks.run("after-tokenize", f), l.stringify(c.util.encode(f.tokens), f.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(m, A) {
        var F = A.rest;
        if (F) {
          for (var f in F)
            A[f] = F[f];
          delete A.rest;
        }
        var g = new d();
        return w(g, g.head, m), h(m, g, A, g.head, 0), _(g);
      },
      /**
       * @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(m, A) {
          var F = c.hooks.all;
          F[m] = F[m] || [], F[m].push(A);
        },
        /**
         * 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(m, A) {
          var F = c.hooks.all[m];
          if (!(!F || !F.length))
            for (var f = 0, g; g = F[f++]; )
              g(A);
        }
      },
      Token: l
    };
    n.Prism = c;
    function l(m, A, F, f) {
      this.type = m, this.content = A, this.alias = F, this.length = (f || "").length | 0;
    }
    l.stringify = function m(A, F) {
      if (typeof A == "string")
        return A;
      if (Array.isArray(A)) {
        var f = "";
        return A.forEach(function(O) {
          f += m(O, F);
        }), f;
      }
      var g = {
        type: A.type,
        content: m(A.content, F),
        tag: "span",
        classes: ["token", A.type],
        attributes: {},
        language: F
      }, y = A.alias;
      y && (Array.isArray(y) ? Array.prototype.push.apply(g.classes, y) : g.classes.push(y)), c.hooks.run("wrap", g);
      var E = "";
      for (var x in g.attributes)
        E += " " + x + '="' + (g.attributes[x] || "").replace(/"/g, "&quot;") + '"';
      return "<" + g.tag + ' class="' + g.classes.join(" ") + '"' + E + ">" + g.content + "</" + g.tag + ">";
    };
    function u(m, A, F, f) {
      m.lastIndex = A;
      var g = m.exec(F);
      if (g && f && g[1]) {
        var y = g[1].length;
        g.index += y, g[0] = g[0].slice(y);
      }
      return g;
    }
    function h(m, A, F, f, g, y) {
      for (var E in F)
        if (!(!F.hasOwnProperty(E) || !F[E])) {
          var x = F[E];
          x = Array.isArray(x) ? x : [x];
          for (var O = 0; O < x.length; ++O) {
            if (y && y.cause == E + "," + O)
              return;
            var P = x[O], I = P.inside, G = !!P.lookbehind, ne = !!P.greedy, X = P.alias;
            if (ne && !P.pattern.global) {
              var ee = P.pattern.toString().match(/[imsuy]*$/)[0];
              P.pattern = RegExp(P.pattern.source, ee + "g");
            }
            for (var K = P.pattern || P, se = f.next, q = g; se !== A.tail && !(y && q >= y.reach); q += se.value.length, se = se.next) {
              var Y = se.value;
              if (A.length > m.length)
                return;
              if (!(Y instanceof l)) {
                var J = 1, N;
                if (ne) {
                  if (N = u(K, q, m, G), !N || N.index >= m.length)
                    break;
                  var H = N.index, M = N.index + N[0].length, v = q;
                  for (v += se.value.length; H >= v; )
                    se = se.next, v += se.value.length;
                  if (v -= se.value.length, q = v, se.value instanceof l)
                    continue;
                  for (var L = se; L !== A.tail && (v < M || typeof L.value == "string"); L = L.next)
                    J++, v += L.value.length;
                  J--, Y = m.slice(q, v), N.index -= q;
                } else if (N = u(K, 0, Y, G), !N)
                  continue;
                var H = N.index, B = N[0], U = Y.slice(0, H), Z = Y.slice(H + B.length), re = q + Y.length;
                y && re > y.reach && (y.reach = re);
                var pe = se.prev;
                U && (pe = w(A, pe, U), q += U.length), b(A, pe, J);
                var be = new l(E, I ? c.tokenize(B, I) : B, X, B);
                if (se = w(A, pe, be), Z && w(A, se, Z), J > 1) {
                  var Se = {
                    cause: E + "," + O,
                    reach: re
                  };
                  h(m, A, F, se.prev, q, Se), y && Se.reach > y.reach && (y.reach = Se.reach);
                }
              }
            }
          }
        }
    }
    function d() {
      var m = { value: null, prev: null, next: null }, A = { value: null, prev: m, next: null };
      m.next = A, this.head = m, this.tail = A, this.length = 0;
    }
    function w(m, A, F) {
      var f = A.next, g = { value: F, prev: A, next: f };
      return A.next = g, f.prev = g, m.length++, g;
    }
    function b(m, A, F) {
      for (var f = A.next, g = 0; g < F && f !== m.tail; g++)
        f = f.next;
      A.next = f, f.prev = A, m.length -= g;
    }
    function _(m) {
      for (var A = [], F = m.head.next; F !== m.tail; )
        A.push(F.value), F = F.next;
      return A;
    }
    if (!n.document)
      return n.addEventListener && (c.disableWorkerMessageHandler || n.addEventListener("message", function(m) {
        var A = JSON.parse(m.data), F = A.language, f = A.code, g = A.immediateClose;
        n.postMessage(c.highlight(f, c.languages[F], F)), g && n.close();
      }, !1)), c;
    var R = c.util.currentScript();
    R && (c.filename = R.src, R.hasAttribute("data-manual") && (c.manual = !0));
    function k() {
      c.manual || c.highlightAll();
    }
    if (!c.manual) {
      var C = document.readyState;
      C === "loading" || C === "interactive" && R && R.defer ? document.addEventListener("DOMContentLoaded", k) : window.requestAnimationFrame ? window.requestAnimationFrame(k) : window.setTimeout(k, 16);
    }
    return c;
  }(e);
  r.exports && (r.exports = t), typeof commonjsGlobal < "u" && (commonjsGlobal.Prism = t), t.languages.markup = {
    comment: {
      pattern: /<!--(?:(?!<!--)[\s\S])*?-->/,
      greedy: !0
    },
    prolog: {
      pattern: /<\?[\s\S]+?\?>/,
      greedy: !0
    },
    doctype: {
      // https://www.w3.org/TR/xml/#NT-doctypedecl
      pattern: /<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,
      greedy: !0,
      inside: {
        "internal-subset": {
          pattern: /(^[^\[]*\[)[\s\S]+(?=\]>$)/,
          lookbehind: !0,
          greedy: !0,
          inside: null
          // see below
        },
        string: {
          pattern: /"[^"]*"|'[^']*'/,
          greedy: !0
        },
        punctuation: /^<!|>$|[[\]]/,
        "doctype-tag": /^DOCTYPE/i,
        name: /[^\s<>'"]+/
      }
    },
    cdata: {
      pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
      greedy: !0
    },
    tag: {
      pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,
      greedy: !0,
      inside: {
        tag: {
          pattern: /^<\/?[^\s>\/]+/,
          inside: {
            punctuation: /^<\/?/,
            namespace: /^[^\s>\/:]+:/
          }
        },
        "special-attr": [],
        "attr-value": {
          pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,
          inside: {
            punctuation: [
              {
                pattern: /^=/,
                alias: "attr-equals"
              },
              {
                pattern: /^(\s*)["']|["']$/,
                lookbehind: !0
              }
            ]
          }
        },
        punctuation: /\/?>/,
        "attr-name": {
          pattern: /[^\s>\/]+/,
          inside: {
            namespace: /^[^\s>\/:]+:/
          }
        }
      }
    },
    entity: [
      {
        pattern: /&[\da-z]{1,8};/i,
        alias: "named-entity"
      },
      /&#x?[\da-f]{1,8};/i
    ]
  }, t.languages.markup.tag.inside["attr-value"].inside.entity = t.languages.markup.entity, t.languages.markup.doctype.inside["internal-subset"].inside = t.languages.markup, t.hooks.add("wrap", function(n) {
    n.type === "entity" && (n.attributes.title = n.content.replace(/&amp;/, "&"));
  }), Object.defineProperty(t.languages.markup.tag, "addInlined", {
    /**
     * Adds an inlined language to markup.
     *
     * An example of an inlined language is CSS with `<style>` tags.
     *
     * @param {string} tagName The name of the tag that contains the inlined language. This name will be treated as
     * case insensitive.
     * @param {string} lang The language key.
     * @example
     * addInlined('style', 'css');
     */
    value: function(a, s) {
      var o = {};
      o["language-" + s] = {
        pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
        lookbehind: !0,
        inside: t.languages[s]
      }, o.cdata = /^<!\[CDATA\[|\]\]>$/i;
      var c = {
        "included-cdata": {
          pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
          inside: o
        }
      };
      c["language-" + s] = {
        pattern: /[\s\S]+/,
        inside: t.languages[s]
      };
      var l = {};
      l[a] = {
        pattern: RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g, function() {
          return a;
        }), "i"),
        lookbehind: !0,
        greedy: !0,
        inside: c
      }, t.languages.insertBefore("markup", "cdata", l);
    }
  }), Object.defineProperty(t.languages.markup.tag, "addAttribute", {
    /**
     * Adds an pattern to highlight languages embedded in HTML attributes.
     *
     * An example of an inlined language is CSS with `style` attributes.
     *
     * @param {string} attrName The name of the tag that contains the inlined language. This name will be treated as
     * case insensitive.
     * @param {string} lang The language key.
     * @example
     * addAttribute('style', 'css');
     */
    value: function(n, a) {
      t.languages.markup.tag.inside["special-attr"].push({
        pattern: RegExp(
          /(^|["'\s])/.source + "(?:" + n + ")" + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,
          "i"
        ),
        lookbehind: !0,
        inside: {
          "attr-name": /^[^\s=]+/,
          "attr-value": {
            pattern: /=[\s\S]+/,
            inside: {
              value: {
                pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,
                lookbehind: !0,
                alias: [a, "language-" + a],
                inside: t.languages[a]
              },
              punctuation: [
                {
                  pattern: /^=/,
                  alias: "attr-equals"
                },
                /"|'/
              ]
            }
          }
        }
      });
    }
  }), t.languages.html = t.languages.markup, t.languages.mathml = t.languages.markup, t.languages.svg = t.languages.markup, t.languages.xml = t.languages.extend("markup", {}), t.languages.ssml = t.languages.xml, t.languages.atom = t.languages.xml, t.languages.rss = t.languages.xml, function(n) {
    var a = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
    n.languages.css = {
      comment: /\/\*[\s\S]*?\*\//,
      atrule: {
        pattern: RegExp("@[\\w-](?:" + /[^;{\s"']|\s+(?!\s)/.source + "|" + a.source + ")*?" + /(?:;|(?=\s*\{))/.source),
        inside: {
          rule: /^@[\w-]+/,
          "selector-function-argument": {
            pattern: /(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,
            lookbehind: !0,
            alias: "selector"
          },
          keyword: {
            pattern: /(^|[^\w-])(?:and|not|only|or)(?![\w-])/,
            lookbehind: !0
          }
          // See rest below
        }
      },
      url: {
        // https://drafts.csswg.org/css-values-3/#urls
        pattern: RegExp("\\burl\\((?:" + a.source + "|" + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ")\\)", "i"),
        greedy: !0,
        inside: {
          function: /^url/i,
          punctuation: /^\(|\)$/,
          string: {
            pattern: RegExp("^" + a.source + "$"),
            alias: "url"
          }
        }
      },
      selector: {
        pattern: RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|` + a.source + ")*(?=\\s*\\{)"),
        lookbehind: !0
      },
      string: {
        pattern: a,
        greedy: !0
      },
      property: {
        pattern: /(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,
        lookbehind: !0
      },
      important: /!important\b/i,
      function: {
        pattern: /(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,
        lookbehind: !0
      },
      punctuation: /[(){};:,]/
    }, n.languages.css.atrule.inside.rest = n.languages.css;
    var 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…", a = function(R, k) {
      return "✖ Error " + R + " while fetching file: " + k;
    }, s = "✖ Error: File does not exist or is empty", o = {
      js: "javascript",
      py: "python",
      rb: "ruby",
      ps1: "powershell",
      psm1: "powershell",
      sh: "bash",
      bat: "batch",
      h: "c",
      tex: "latex"
    }, c = "data-src-status", l = "loading", u = "loaded", h = "failed", d = "pre[data-src]:not([" + c + '="' + u + '"]):not([' + c + '="' + l + '"])';
    function w(R, k, C) {
      var m = new XMLHttpRequest();
      m.open("GET", R, !0), m.onreadystatechange = function() {
        m.readyState == 4 && (m.status < 400 && m.responseText ? k(m.responseText) : m.status >= 400 ? C(a(m.status, m.statusText)) : C(s));
      }, m.send(null);
    }
    function b(R) {
      var k = /^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(R || "");
      if (k) {
        var C = Number(k[1]), m = k[2], A = k[3];
        return m ? A ? [C, Number(A)] : [C, void 0] : [C, C];
      }
    }
    t.hooks.add("before-highlightall", function(R) {
      R.selector += ", " + d;
    }), t.hooks.add("before-sanity-check", function(R) {
      var k = (
        /** @type {HTMLPreElement} */
        R.element
      );
      if (k.matches(d)) {
        R.code = "", k.setAttribute(c, l);
        var C = k.appendChild(document.createElement("CODE"));
        C.textContent = n;
        var m = k.getAttribute("data-src"), A = R.language;
        if (A === "none") {
          var F = (/\.(\w+)$/.exec(m) || [, "none"])[1];
          A = o[F] || F;
        }
        t.util.setLanguage(C, A), t.util.setLanguage(k, A);
        var f = t.plugins.autoloader;
        f && f.loadLanguages(A), w(
          m,
          function(g) {
            k.setAttribute(c, u);
            var y = b(k.getAttribute("data-range"));
            if (y) {
              var E = g.split(/\r\n?|\n/g), x = y[0], O = y[1] == null ? E.length : y[1];
              x < 0 && (x += E.length), x = Math.max(0, Math.min(x - 1, E.length)), O < 0 && (O += E.length), O = Math.max(0, Math.min(O, E.length)), g = E.slice(x, O).join(`
`), k.hasAttribute("data-start") || k.setAttribute("data-start", String(x + 1));
            }
            C.textContent = g, t.highlightElement(C);
          },
          function(g) {
            k.setAttribute(c, h), C.textContent = g;
          }
        );
      }
    }), 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 C = (k || document).querySelectorAll(d), m = 0, A; A = C[m++]; )
          t.highlightElement(A);
      }
    };
    var _ = !1;
    t.fileHighlight = function() {
      _ || (console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."), _ = !0), t.plugins.fileHighlight.highlight.apply(this, arguments);
    };
  }();
})(prism);
var prismExports = prism.exports;
Prism.languages.python = {
  comment: {
    pattern: /(^|[^\\])#.*/,
    lookbehind: !0,
    greedy: !0
  },
  "string-interpolation": {
    pattern: /(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,
    greedy: !0,
    inside: {
      interpolation: {
        // "{" <expression> <optional "!s", "!r", or "!a"> <optional ":" format specifier> "}"
        pattern: /((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,
        lookbehind: !0,
        inside: {
          "format-spec": {
            pattern: /(:)[^:(){}]+(?=\}$)/,
            lookbehind: !0
          },
          "conversion-option": {
            pattern: /![sra](?=[:}]$)/,
            alias: "punctuation"
          },
          rest: null
        }
      },
      string: /[\s\S]+/
    }
  },
  "triple-quoted-string": {
    pattern: /(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,
    greedy: !0,
    alias: "string"
  },
  string: {
    pattern: /(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,
    greedy: !0
  },
  function: {
    pattern: /((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,
    lookbehind: !0
  },
  "class-name": {
    pattern: /(\bclass\s+)\w+/i,
    lookbehind: !0
  },
  decorator: {
    pattern: /(^[\t ]*)@\w+(?:\.\w+)*/m,
    lookbehind: !0,
    alias: ["annotation", "punctuation"],
    inside: {
      punctuation: /\./
    }
  },
  keyword: /\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,
  builtin: /\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,
  boolean: /\b(?:False|None|True)\b/,
  number: /\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,
  operator: /[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,
  punctuation: /[{}[\];(),.:]/
};
Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest = Prism.languages.python;
Prism.languages.py = Prism.languages.python;
(function(r) {
  var e = /\\(?:[^a-z()[\]]|[a-z*]+)/i, t = {
    "equation-command": {
      pattern: e,
      alias: "regex"
    }
  };
  r.languages.latex = {
    comment: /%.*/,
    // the verbatim environment prints whitespace to the document
    cdata: {
      pattern: /(\\begin\{((?:lstlisting|verbatim)\*?)\})[\s\S]*?(?=\\end\{\2\})/,
      lookbehind: !0
    },
    /*
     * equations can be between $$ $$ or $ $ or \( \) or \[ \]
     * (all are multiline)
     */
    equation: [
      {
        pattern: /\$\$(?:\\[\s\S]|[^\\$])+\$\$|\$(?:\\[\s\S]|[^\\$])+\$|\\\([\s\S]*?\\\)|\\\[[\s\S]*?\\\]/,
        inside: t,
        alias: "string"
      },
      {
        pattern: /(\\begin\{((?:align|eqnarray|equation|gather|math|multline)\*?)\})[\s\S]*?(?=\\end\{\2\})/,
        lookbehind: !0,
        inside: t,
        alias: "string"
      }
    ],
    /*
     * arguments which are keywords or references are highlighted
     * as keywords
     */
    keyword: {
      pattern: /(\\(?:begin|cite|documentclass|end|label|ref|usepackage)(?:\[[^\]]+\])?\{)[^}]+(?=\})/,
      lookbehind: !0
    },
    url: {
      pattern: /(\\url\{)[^}]+(?=\})/,
      lookbehind: !0
    },
    /*
     * section or chapter headlines are highlighted as bold so that
     * they stand out more
     */
    headline: {
      pattern: /(\\(?:chapter|frametitle|paragraph|part|section|subparagraph|subsection|subsubparagraph|subsubsection|subsubsubparagraph)\*?(?:\[[^\]]+\])?\{)[^}]+(?=\})/,
      lookbehind: !0,
      alias: "class-name"
    },
    function: {
      pattern: e,
      alias: "selector"
    },
    punctuation: /[[\]{}&]/
  }, r.languages.tex = r.languages.latex, r.languages.context = r.languages.latex;
})(Prism);
(function(r) {
  var e = "\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b", t = {
    pattern: /(^(["']?)\w+\2)[ \t]+\S.*/,
    lookbehind: !0,
    alias: "punctuation",
    // this looks reasonably well in all themes
    inside: null
    // see below
  }, n = {
    bash: t,
    environment: {
      pattern: RegExp("\\$" + e),
      alias: "constant"
    },
    variable: [
      // [0]: Arithmetic Environment
      {
        pattern: /\$?\(\([\s\S]+?\)\)/,
        greedy: !0,
        inside: {
          // If there is a $ sign at the beginning highlight $(( and )) as variable
          variable: [
            {
              pattern: /(^\$\(\([\s\S]+)\)\)/,
              lookbehind: !0
            },
            /^\$\(\(/
          ],
          number: /\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,
          // Operators according to https://www.gnu.org/software/bash/manual/bashref.html#Shell-Arithmetic
          operator: /--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,
          // If there is no $ sign at the beginning highlight (( and )) as punctuation
          punctuation: /\(\(?|\)\)?|,|;/
        }
      },
      // [1]: Command Substitution
      {
        pattern: /\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,
        greedy: !0,
        inside: {
          variable: /^\$\(|^`|\)$|`$/
        }
      },
      // [2]: Brace expansion
      {
        pattern: /\$\{[^}]+\}/,
        greedy: !0,
        inside: {
          operator: /:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,
          punctuation: /[\[\]]/,
          environment: {
            pattern: RegExp("(\\{)" + e),
            lookbehind: !0,
            alias: "constant"
          }
        }
      },
      /\$(?:\w+|[#?*!@$])/
    ],
    // Escape sequences from echo and printf's manuals, and escaped quotes.
    entity: /\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/
  };
  r.languages.bash = {
    shebang: {
      pattern: /^#!\s*\/.*/,
      alias: "important"
    },
    comment: {
      pattern: /(^|[^"{\\$])#.*/,
      lookbehind: !0
    },
    "function-name": [
      // a) function foo {
      // b) foo() {
      // c) function foo() {
      // but not “foo {”
      {
        // a) and c)
        pattern: /(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,
        lookbehind: !0,
        alias: "function"
      },
      {
        // b)
        pattern: /\b[\w-]+(?=\s*\(\s*\)\s*\{)/,
        alias: "function"
      }
    ],
    // Highlight variable names as variables in for and select beginnings.
    "for-or-select": {
      pattern: /(\b(?:for|select)\s+)\w+(?=\s+in\s)/,
      alias: "variable",
      lookbehind: !0
    },
    // Highlight variable names as variables in the left-hand part
    // of assignments (“=” and “+=”).
    "assign-left": {
      pattern: /(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,
      inside: {
        environment: {
          pattern: RegExp("(^|[\\s;|&]|[<>]\\()" + e),
          lookbehind: !0,
          alias: "constant"
        }
      },
      alias: "variable",
      lookbehind: !0
    },
    // Highlight parameter names as variables
    parameter: {
      pattern: /(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,
      alias: "variable",
      lookbehind: !0
    },
    string: [
      // Support for Here-documents https://en.wikipedia.org/wiki/Here_document
      {
        pattern: /((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,
        lookbehind: !0,
        greedy: !0,
        inside: n
      },
      // Here-document with quotes around the tag
      // → No expansion (so no “inside”).
      {
        pattern: /((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,
        lookbehind: !0,
        greedy: !0,
        inside: {
          bash: t
        }
      },
      // “Normal” string
      {
        // https://www.gnu.org/software/bash/manual/html_node/Double-Quotes.html
        pattern: /(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,
        lookbehind: !0,
        greedy: !0,
        inside: n
      },
      {
        // https://www.gnu.org/software/bash/manual/html_node/Single-Quotes.html
        pattern: /(^|[^$\\])'[^']*'/,
        lookbehind: !0,
        greedy: !0
      },
      {
        // https://www.gnu.org/software/bash/manual/html_node/ANSI_002dC-Quoting.html
        pattern: /\$'(?:[^'\\]|\\[\s\S])*'/,
        greedy: !0,
        inside: {
          entity: n.entity
        }
      }
    ],
    environment: {
      pattern: RegExp("\\$?" + e),
      alias: "constant"
    },
    variable: n.variable,
    function: {
      pattern: /(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,
      lookbehind: !0
    },
    keyword: {
      pattern: /(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,
      lookbehind: !0
    },
    // https://www.gnu.org/software/bash/manual/html_node/Shell-Builtin-Commands.html
    builtin: {
      pattern: /(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,
      lookbehind: !0,
      // Alias added to make those easier to distinguish from strings.
      alias: "class-name"
    },
    boolean: {
      pattern: /(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,
      lookbehind: !0
    },
    "file-descriptor": {
      pattern: /\B&\d\b/,
      alias: "important"
    },
    operator: {
      // Lots of redirections here, but not just that.
      pattern: /\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,
      inside: {
        "file-descriptor": {
          pattern: /^\d/,
          alias: "important"
        }
      }
    },
    punctuation: /\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,
    number: {
      pattern: /(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,
      lookbehind: !0
    }
  }, t.inside = r.languages.bash;
  for (var a = [
    "comment",
    "function-name",
    "for-or-select",
    "assign-left",
    "parameter",
    "string",
    "environment",
    "function",
    "keyword",
    "builtin",
    "boolean",
    "file-descriptor",
    "operator",
    "punctuation",
    "number"
  ], s = n.variable[1].inside, o = 0; o < a.length; o++)
    s[a[o]] = r.languages.bash[a[o]];
  r.languages.sh = r.languages.bash, r.languages.shell = r.languages.bash;
})(Prism);
const LINK_ICON_CODE = '<svg class="md-link-icon" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true" fill="currentColor"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg>', COPY_ICON_CODE = `<svg
xmlns="http://www.w3.org/2000/svg"
width="100%"
height="100%"
viewBox="0 0 32 32"
><path
  fill="currentColor"
  d="M28 10v18H10V10h18m0-2H10a2 2 0 0 0-2 2v18a2 2 0 0 0 2 2h18a2 2 0 0 0 2-2V10a2 2 0 0 0-2-2Z"
/><path fill="currentColor" d="M4 18H2V4a2 2 0 0 1 2-2h14v2H4Z" /></svg>`, CHECK_ICON_CODE = `<svg
xmlns="http://www.w3.org/2000/svg"
width="100%"
height="100%"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3"
stroke-linecap="round"
stroke-linejoin="round"><polyline points="20 6 9 17 4 12" /></svg>`, COPY_BUTTON_CODE = `<button title="copy" class="copy_code_button">
<span class="copy-text">${COPY_ICON_CODE}</span>
<span class="check">${CHECK_ICON_CODE}</span>
</button>`, escape_test = /[&<>"']/, escape_replace = new RegExp(escape_test.source, "g"), escape_test_no_encode = /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escape_replace_no_encode = new RegExp(escape_test_no_encode.source, "g"), escape_replacements = {
  "&": "&amp;",
  "<": "&lt;",
  ">": "&gt;",
  '"': "&quot;",
  "'": "&#39;"
}, get_escape_replacement = (r) => escape_replacements[r] || "";
function escape$2(r, e) {
  if (e) {
    if (escape_test.test(r))
      return r.replace(escape_replace, get_escape_replacement);
  } else if (escape_test_no_encode.test(r))
    return r.replace(escape_replace_no_encode, get_escape_replacement);
  return r;
}
function createLatexTokenizer(r) {
  const e = r.map((t) => ({
    start: new RegExp(t.left.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&")),
    end: new RegExp(t.right.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"))
  }));
  return {
    name: "latex",
    level: "block",
    start(t) {
      for (const n of e) {
        const a = t.match(n.start);
        if (a)
          return a.index;
      }
      return -1;
    },
    tokenizer(t, n) {
      for (const a of e) {
        const s = new RegExp(
          `${a.start.source}([\\s\\S]+?)${a.end.source}`
        ).exec(t);
        if (s)
          return {
            type: "latex",
            raw: s[0],
            text: s[1].trim()
          };
      }
    },
    renderer(t) {
      return `<div class="latex-block">${t.text}</div>`;
    }
  };
}
const renderer = {
  code(r, e, t) {
    var a;
    const n = ((a = (e ?? "").match(/\S*/)) == null ? void 0 : a[0]) ?? "";
    return r = r.replace(/\n$/, "") + `
`, n ? '<div class="code_wrap">' + COPY_BUTTON_CODE + '<pre><code class="language-' + escape$2(n) + '">' + (t ? r : escape$2(r, !0)) + `</code></pre></div>
` : '<div class="code_wrap">' + COPY_BUTTON_CODE + "<pre><code>" + (t ? r : escape$2(r, !0)) + `</code></pre></div>
`;
  }
}, slugger = new BananaSlug();
function create_marked({
  header_links: r,
  line_breaks: e,
  latex_delimiters: t
}) {
  const n = new Marked();
  n.use(
    {
      gfm: !0,
      pedantic: !1,
      breaks: e
    },
    markedHighlight({
      highlight: (s, o) => prismExports.languages[o] ? prismExports.highlight(s, prismExports.languages[o], o) : s
    }),
    { renderer }
  ), r && (n.use(gfmHeadingId()), n.use({
    extensions: [
      {
        name: "heading",
        level: "block",
        renderer(s) {
          const o = s.raw.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi, ""), c = "h" + slugger.slug(o), l = s.depth, u = this.parser.parseInline(s.tokens);
          return `<h${l} id="${c}"><a class="md-header-anchor" href="#${c}">${LINK_ICON_CODE}</a>${u}</h${l}>
`;
        }
      }
    ]
  }));
  const a = createLatexTokenizer(t);
  return n.use({
    extensions: [a]
  }), n;
}
const prettyBytes = (r) => {
  let e = ["B", "KB", "MB", "GB", "PB"], t = 0;
  for (; r > 1024; )
    r /= 1024, t++;
  let n = e[t];
  return r.toFixed(1) + "&nbsp;" + n;
}, { setContext, getContext } = window.__gradio__svelte__internal, WORKER_PROXY_CONTEXT_KEY = "WORKER_PROXY_CONTEXT_KEY";
function getWorkerProxyContext() {
  return getContext(WORKER_PROXY_CONTEXT_KEY);
}
function is_self_host(r) {
  return r.host === window.location.host || r.host === "localhost:7860" || r.host === "127.0.0.1:7860" || // Ref: https://github.com/gradio-app/gradio/blob/v3.32.0/js/app/src/Index.svelte#L194
  r.host === "lite.local";
}
function getHeaderValue(r, e) {
  const t = e.toLowerCase();
  for (const [n, a] of Object.entries(r))
    if (n.toLowerCase() === t)
      return a;
}
function should_proxy_wasm_src(r) {
  if (r == null)
    return !1;
  const e = new URL(r, window.location.href);
  return !(!is_self_host(e) || e.protocol !== "http:" && e.protocol !== "https:");
}
const {
  SvelteComponent: SvelteComponent$7,
  assign: assign$1,
  check_outros: check_outros$5,
  compute_rest_props,
  create_slot: create_slot$1,
  detach: detach$7,
  element: element$6,
  empty: empty$3,
  exclude_internal_props,
  get_all_dirty_from_scope: get_all_dirty_from_scope$1,
  get_slot_changes: get_slot_changes$1,
  get_spread_update: get_spread_update$1,
  group_outros: group_outros$5,
  init: init$7,
  insert: insert$7,
  listen: listen$3,
  prevent_default,
  safe_not_equal: safe_not_equal$8,
  set_attributes,
  transition_in: transition_in$5,
  transition_out: transition_out$5,
  update_slot_base: update_slot_base$1
} = window.__gradio__svelte__internal, { createEventDispatcher: createEventDispatcher$3 } = window.__gradio__svelte__internal;
function create_else_block_1(r) {
  let e, t, n, a, s;
  const o = (
    /*#slots*/
    r[8].default
  ), c = create_slot$1(
    o,
    r,
    /*$$scope*/
    r[7],
    null
  );
  let l = [
    { href: (
      /*href*/
      r[0]
    ) },
    {
      target: t = typeof window < "u" && window.__is_colab__ ? "_blank" : null
    },
    { rel: "noopener noreferrer" },
    { download: (
      /*download*/
      r[1]
    ) },
    /*$$restProps*/
    r[6]
  ], u = {};
  for (let h = 0; h < l.length; h += 1)
    u = assign$1(u, l[h]);
  return {
    c() {
      e = element$6("a"), c && c.c(), set_attributes(e, u);
    },
    m(h, d) {
      insert$7(h, e, d), c && c.m(e, null), n = !0, a || (s = listen$3(
        e,
        "click",
        /*dispatch*/
        r[3].bind(null, "click")
      ), a = !0);
    },
    p(h, d) {
      c && c.p && (!n || d & /*$$scope*/
      128) && update_slot_base$1(
        c,
        o,
        h,
        /*$$scope*/
        h[7],
        n ? get_slot_changes$1(
          o,
          /*$$scope*/
          h[7],
          d,
          null
        ) : get_all_dirty_from_scope$1(
          /*$$scope*/
          h[7]
        ),
        null
      ), set_attributes(e, u = get_spread_update$1(l, [
        (!n || d & /*href*/
        1) && { href: (
          /*href*/
          h[0]
        ) },
        { target: t },
        { rel: "noopener noreferrer" },
        (!n || d & /*download*/
        2) && { download: (
          /*download*/
          h[1]
        ) },
        d & /*$$restProps*/
        64 && /*$$restProps*/
        h[6]
      ]));
    },
    i(h) {
      n || (transition_in$5(c, h), n = !0);
    },
    o(h) {
      transition_out$5(c, h), n = !1;
    },
    d(h) {
      h && detach$7(e), c && c.d(h), a = !1, s();
    }
  };
}
function create_if_block$5(r) {
  let e, t, n, a;
  const s = [create_if_block_1$4, create_else_block$4], o = [];
  function c(l, u) {
    return (
      /*is_downloading*/
      l[2] ? 0 : 1
    );
  }
  return e = c(r), t = o[e] = s[e](r), {
    c() {
      t.c(), n = empty$3();
    },
    m(l, u) {
      o[e].m(l, u), insert$7(l, n, u), a = !0;
    },
    p(l, u) {
      let h = e;
      e = c(l), e === h ? o[e].p(l, u) : (group_outros$5(), transition_out$5(o[h], 1, 1, () => {
        o[h] = null;
      }), check_outros$5(), t = o[e], t ? t.p(l, u) : (t = o[e] = s[e](l), t.c()), transition_in$5(t, 1), t.m(n.parentNode, n));
    },
    i(l) {
      a || (transition_in$5(t), a = !0);
    },
    o(l) {
      transition_out$5(t), a = !1;
    },
    d(l) {
      l && detach$7(n), o[e].d(l);
    }
  };
}
function create_else_block$4(r) {
  let e, t, n, a;
  const s = (
    /*#slots*/
    r[8].default
  ), o = create_slot$1(
    s,
    r,
    /*$$scope*/
    r[7],
    null
  );
  let c = [
    /*$$restProps*/
    r[6],
    { href: (
      /*href*/
      r[0]
    ) }
  ], l = {};
  for (let u = 0; u < c.length; u += 1)
    l = assign$1(l, c[u]);
  return {
    c() {
      e = element$6("a"), o && o.c(), set_attributes(e, l);
    },
    m(u, h) {
      insert$7(u, e, h), o && o.m(e, null), t = !0, n || (a = listen$3(e, "click", prevent_default(
        /*wasm_click_handler*/
        r[5]
      )), n = !0);
    },
    p(u, h) {
      o && o.p && (!t || h & /*$$scope*/
      128) && update_slot_base$1(
        o,
        s,
        u,
        /*$$scope*/
        u[7],
        t ? get_slot_changes$1(
          s,
          /*$$scope*/
          u[7],
          h,
          null
        ) : get_all_dirty_from_scope$1(
          /*$$scope*/
          u[7]
        ),
        null
      ), set_attributes(e, l = get_spread_update$1(c, [
        h & /*$$restProps*/
        64 && /*$$restProps*/
        u[6],
        (!t || h & /*href*/
        1) && { href: (
          /*href*/
          u[0]
        ) }
      ]));
    },
    i(u) {
      t || (transition_in$5(o, u), t = !0);
    },
    o(u) {
      transition_out$5(o, u), t = !1;
    },
    d(u) {
      u && detach$7(e), o && o.d(u), n = !1, a();
    }
  };
}
function create_if_block_1$4(r) {
  let e;
  const t = (
    /*#slots*/
    r[8].default
  ), n = create_slot$1(
    t,
    r,
    /*$$scope*/
    r[7],
    null
  );
  return {
    c() {
      n && n.c();
    },
    m(a, s) {
      n && n.m(a, s), e = !0;
    },
    p(a, s) {
      n && n.p && (!e || s & /*$$scope*/
      128) && update_slot_base$1(
        n,
        t,
        a,
        /*$$scope*/
        a[7],
        e ? get_slot_changes$1(
          t,
          /*$$scope*/
          a[7],
          s,
          null
        ) : get_all_dirty_from_scope$1(
          /*$$scope*/
          a[7]
        ),
        null
      );
    },
    i(a) {
      e || (transition_in$5(n, a), e = !0);
    },
    o(a) {
      transition_out$5(n, a), e = !1;
    },
    d(a) {
      n && n.d(a);
    }
  };
}
function create_fragment$7(r) {
  let e, t, n, a, s;
  const o = [create_if_block$5, create_else_block_1], c = [];
  function l(u, h) {
    return h & /*href*/
    1 && (e = null), e == null && (e = !!/*worker_proxy*/
    (u[4] && should_proxy_wasm_src(
      /*href*/
      u[0]
    ))), e ? 0 : 1;
  }
  return t = l(r, -1), n = c[t] = o[t](r), {
    c() {
      n.c(), a = empty$3();
    },
    m(u, h) {
      c[t].m(u, h), insert$7(u, a, h), s = !0;
    },
    p(u, [h]) {
      let d = t;
      t = l(u, h), t === d ? c[t].p(u, h) : (group_outros$5(), transition_out$5(c[d], 1, 1, () => {
        c[d] = null;
      }), check_outros$5(), n = c[t], n ? n.p(u, h) : (n = c[t] = o[t](u), n.c()), transition_in$5(n, 1), n.m(a.parentNode, a));
    },
    i(u) {
      s || (transition_in$5(n), s = !0);
    },
    o(u) {
      transition_out$5(n), s = !1;
    },
    d(u) {
      u && detach$7(a), c[t].d(u);
    }
  };
}
function instance$7(r, e, t) {
  const n = ["href", "download"];
  let a = compute_rest_props(e, n), { $$slots: s = {}, $$scope: o } = e;
  var c = this && this.__awaiter || function(_, R, k, C) {
    function m(A) {
      return A instanceof k ? A : new k(function(F) {
        F(A);
      });
    }
    return new (k || (k = Promise))(function(A, F) {
      function f(E) {
        try {
          y(C.next(E));
        } catch (x) {
          F(x);
        }
      }
      function g(E) {
        try {
          y(C.throw(E));
        } catch (x) {
          F(x);
        }
      }
      function y(E) {
        E.done ? A(E.value) : m(E.value).then(f, g);
      }
      y((C = C.apply(_, R || [])).next());
    });
  };
  let { href: l = void 0 } = e, { download: u } = e;
  const h = createEventDispatcher$3();
  let d = !1;
  const w = getWorkerProxyContext();
  function b() {
    return c(this, void 0, void 0, function* () {
      if (d)
        return;
      if (h("click"), l == null)
        throw new Error("href is not defined.");
      if (w == null)
        throw new Error("Wasm worker proxy is not available.");
      const R = new URL(l, window.location.href).pathname;
      t(2, d = !0), w.httpRequest({
        method: "GET",
        path: R,
        headers: {},
        query_string: ""
      }).then((k) => {
        if (k.status !== 200)
          throw new Error(`Failed to get file ${R} from the Wasm worker.`);
        const C = new Blob(
          [k.body],
          {
            type: getHeaderValue(k.headers, "content-type")
          }
        ), m = URL.createObjectURL(C), A = document.createElement("a");
        A.href = m, A.download = u, A.click(), URL.revokeObjectURL(m);
      }).finally(() => {
        t(2, d = !1);
      });
    });
  }
  return r.$$set = (_) => {
    e = assign$1(assign$1({}, e), exclude_internal_props(_)), t(6, a = compute_rest_props(e, n)), "href" in _ && t(0, l = _.href), "download" in _ && t(1, u = _.download), "$$scope" in _ && t(7, o = _.$$scope);
  }, [
    l,
    u,
    d,
    h,
    w,
    b,
    a,
    o,
    s
  ];
}
class DownloadLink extends SvelteComponent$7 {
  constructor(e) {
    super(), init$7(this, e, instance$7, create_fragment$7, safe_not_equal$8, { href: 0, download: 1 });
  }
}
const {
  HtmlTag,
  SvelteComponent: SvelteComponent$6,
  append: append$4,
  attr: attr$5,
  check_outros: check_outros$4,
  create_component: create_component$4,
  destroy_component: destroy_component$4,
  detach: detach$6,
  element: element$5,
  ensure_array_like: ensure_array_like$1,
  group_outros: group_outros$4,
  init: init$6,
  insert: insert$6,
  listen: listen$2,
  mount_component: mount_component$4,
  noop: noop$6,
  outro_and_destroy_block,
  run_all,
  safe_not_equal: safe_not_equal$7,
  set_data: set_data$2,
  set_style: set_style$3,
  space: space$4,
  text: text$4,
  toggle_class: toggle_class$4,
  transition_in: transition_in$4,
  transition_out: transition_out$4,
  update_keyed_each
} = window.__gradio__svelte__internal, { createEventDispatcher: createEventDispatcher$2 } = window.__gradio__svelte__internal;
function get_each_context$1(r, e, t) {
  const n = r.slice();
  return n[11] = e[t], n[13] = t, n;
}
function create_else_block$3(r) {
  let e = (
    /*i18n*/
    r[2]("file.uploading") + ""
  ), t;
  return {
    c() {
      t = text$4(e);
    },
    m(n, a) {
      insert$6(n, t, a);
    },
    p(n, a) {
      a & /*i18n*/
      4 && e !== (e = /*i18n*/
      n[2]("file.uploading") + "") && set_data$2(t, e);
    },
    i: noop$6,
    o: noop$6,
    d(n) {
      n && detach$6(t);
    }
  };
}
function create_if_block_1$3(r) {
  let e, t;
  return e = new DownloadLink({
    props: {
      href: (
        /*file*/
        r[11].url
      ),
      download: window.__is_colab__ ? null : (
        /*file*/
        r[11].orig_name
      ),
      $$slots: { default: [create_default_slot$2] },
      $$scope: { ctx: r }
    }
  }), {
    c() {
      create_component$4(e.$$.fragment);
    },
    m(n, a) {
      mount_component$4(e, n, a), t = !0;
    },
    p(n, a) {
      const s = {};
      a & /*normalized_files*/
      8 && (s.href = /*file*/
      n[11].url), a & /*normalized_files*/
      8 && (s.download = window.__is_colab__ ? null : (
        /*file*/
        n[11].orig_name
      )), a & /*$$scope, normalized_files*/
      16392 && (s.$$scope = { dirty: a, ctx: n }), e.$set(s);
    },
    i(n) {
      t || (transition_in$4(e.$$.fragment, n), t = !0);
    },
    o(n) {
      transition_out$4(e.$$.fragment, n), t = !1;
    },
    d(n) {
      destroy_component$4(e, n);
    }
  };
}
function create_default_slot$2(r) {
  let e, t = (
    /*file*/
    (r[11].size != null ? prettyBytes(
      /*file*/
      r[11].size
    ) : "(size unknown)") + ""
  ), n;
  return {
    c() {
      e = new HtmlTag(!1), n = text$4(" ⇣"), e.a = n;
    },
    m(a, s) {
      e.m(t, a, s), insert$6(a, n, s);
    },
    p(a, s) {
      s & /*normalized_files*/
      8 && t !== (t = /*file*/
      (a[11].size != null ? prettyBytes(
        /*file*/
        a[11].size
      ) : "(size unknown)") + "") && e.p(t);
    },
    d(a) {
      a && (e.d(), detach$6(n));
    }
  };
}
function create_if_block$4(r) {
  let e, t, n, a;
  function s() {
    return (
      /*click_handler*/
      r[7](
        /*i*/
        r[13]
      )
    );
  }
  function o(...c) {
    return (
      /*keydown_handler*/
      r[8](
        /*i*/
        r[13],
        ...c
      )
    );
  }
  return {
    c() {
      e = element$5("td"), t = element$5("button"), t.textContent = "×", attr$5(t, "class", "label-clear-button svelte-1g4vug2"), attr$5(t, "aria-label", "Remove this file"), attr$5(e, "class", "svelte-1g4vug2");
    },
    m(c, l) {
      insert$6(c, e, l), append$4(e, t), n || (a = [
        listen$2(t, "click", s),
        listen$2(t, "keydown", o)
      ], n = !0);
    },
    p(c, l) {
      r = c;
    },
    d(c) {
      c && detach$6(e), n = !1, run_all(a);
    }
  };
}
function create_each_block$1(r, e) {
  let t, n, a, s = (
    /*file*/
    e[11].filename_stem + ""
  ), o, c, l, u = (
    /*file*/
    e[11].filename_ext + ""
  ), h, d, w, b, _, R, k, C, m, A, F;
  const f = [create_if_block_1$3, create_else_block$3], g = [];
  function y(O, P) {
    return (
      /*file*/
      O[11].url ? 0 : 1
    );
  }
  _ = y(e), R = g[_] = f[_](e);
  let E = (
    /*normalized_files*/
    e[3].length > 1 && create_if_block$4(e)
  );
  function x(...O) {
    return (
      /*click_handler_1*/
      e[9](
        /*i*/
        e[13],
        ...O
      )
    );
  }
  return {
    key: r,
    first: null,
    c() {
      t = element$5("tr"), n = element$5("td"), a = element$5("span"), o = text$4(s), c = space$4(), l = element$5("span"), h = text$4(u), w = space$4(), b = element$5("td"), R.c(), k = space$4(), E && E.c(), C = space$4(), attr$5(a, "class", "stem svelte-1g4vug2"), attr$5(l, "class", "ext svelte-1g4vug2"), attr$5(n, "class", "filename svelte-1g4vug2"), attr$5(n, "aria-label", d = /*file*/
      e[11].orig_name), attr$5(b, "class", "download svelte-1g4vug2"), attr$5(t, "class", "file svelte-1g4vug2"), toggle_class$4(
        t,
        "selectable",
        /*selectable*/
        e[0]
      ), this.first = t;
    },
    m(O, P) {
      insert$6(O, t, P), append$4(t, n), append$4(n, a), append$4(a, o), append$4(n, c), append$4(n, l), append$4(l, h), append$4(t, w), append$4(t, b), g[_].m(b, null), append$4(t, k), E && E.m(t, null), append$4(t, C), m = !0, A || (F = listen$2(t, "click", x), A = !0);
    },
    p(O, P) {
      e = O, (!m || P & /*normalized_files*/
      8) && s !== (s = /*file*/
      e[11].filename_stem + "") && set_data$2(o, s), (!m || P & /*normalized_files*/
      8) && u !== (u = /*file*/
      e[11].filename_ext + "") && set_data$2(h, u), (!m || P & /*normalized_files*/
      8 && d !== (d = /*file*/
      e[11].orig_name)) && attr$5(n, "aria-label", d);
      let I = _;
      _ = y(e), _ === I ? g[_].p(e, P) : (group_outros$4(), transition_out$4(g[I], 1, 1, () => {
        g[I] = null;
      }), check_outros$4(), R = g[_], R ? R.p(e, P) : (R = g[_] = f[_](e), R.c()), transition_in$4(R, 1), R.m(b, null)), /*normalized_files*/
      e[3].length > 1 ? E ? E.p(e, P) : (E = create_if_block$4(e), E.c(), E.m(t, C)) : E && (E.d(1), E = null), (!m || P & /*selectable*/
      1) && toggle_class$4(
        t,
        "selectable",
        /*selectable*/
        e[0]
      );
    },
    i(O) {
      m || (transition_in$4(R), m = !0);
    },
    o(O) {
      transition_out$4(R), m = !1;
    },
    d(O) {
      O && detach$6(t), g[_].d(), E && E.d(), A = !1, F();
    }
  };
}
function create_fragment$6(r) {
  let e, t, n, a = [], s = /* @__PURE__ */ new Map(), o, c = ensure_array_like$1(
    /*normalized_files*/
    r[3]
  );
  const l = (u) => (
    /*file*/
    u[11]
  );
  for (let u = 0; u < c.length; u += 1) {
    let h = get_each_context$1(r, c, u), d = l(h);
    s.set(d, a[u] = create_each_block$1(d, h));
  }
  return {
    c() {
      e = element$5("div"), t = element$5("table"), n = element$5("tbody");
      for (let u = 0; u < a.length; u += 1)
        a[u].c();
      attr$5(n, "class", "svelte-1g4vug2"), attr$5(t, "class", "file-preview svelte-1g4vug2"), attr$5(e, "class", "file-preview-holder svelte-1g4vug2"), set_style$3(e, "max-height", typeof /*height*/
      r[1] === void 0 ? "auto" : (
        /*height*/
        r[1] + "px"
      ));
    },
    m(u, h) {
      insert$6(u, e, h), append$4(e, t), append$4(t, n);
      for (let d = 0; d < a.length; d += 1)
        a[d] && a[d].m(n, null);
      o = !0;
    },
    p(u, [h]) {
      h & /*selectable, handle_row_click, normalized_files, remove_file, window, i18n*/
      61 && (c = ensure_array_like$1(
        /*normalized_files*/
        u[3]
      ), group_outros$4(), a = update_keyed_each(a, h, l, 1, u, c, s, n, outro_and_destroy_block, create_each_block$1, null, get_each_context$1), check_outros$4()), (!o || h & /*height*/
      2) && set_style$3(e, "max-height", typeof /*height*/
      u[1] === void 0 ? "auto" : (
        /*height*/
        u[1] + "px"
      ));
    },
    i(u) {
      if (!o) {
        for (let h = 0; h < c.length; h += 1)
          transition_in$4(a[h]);
        o = !0;
      }
    },
    o(u) {
      for (let h = 0; h < a.length; h += 1)
        transition_out$4(a[h]);
      o = !1;
    },
    d(u) {
      u && detach$6(e);
      for (let h = 0; h < a.length; h += 1)
        a[h].d();
    }
  };
}
function split_filename(r) {
  const e = r.lastIndexOf(".");
  return e === -1 ? [r, ""] : [r.slice(0, e), r.slice(e)];
}
function instance$6(r, e, t) {
  let n;
  const a = createEventDispatcher$2();
  let { value: s } = e, { selectable: o = !1 } = e, { height: c = void 0 } = e, { i18n: l } = e;
  function u(_, R) {
    const k = _.currentTarget;
    (_.target === k || // Only select if the click is on the row itself
    k && k.firstElementChild && _.composedPath().includes(k.firstElementChild)) && a("select", {
      value: n[R].orig_name,
      index: R
    });
  }
  function h(_) {
    const R = n.splice(_, 1);
    t(3, n = [...n]), t(6, s = n), a("delete", R[0]), a("change", n);
  }
  const d = (_) => {
    h(_);
  }, w = (_, R) => {
    R.key === "Enter" && h(_);
  }, b = (_, R) => {
    u(R, _);
  };
  return r.$$set = (_) => {
    "value" in _ && t(6, s = _.value), "selectable" in _ && t(0, o = _.selectable), "height" in _ && t(1, c = _.height), "i18n" in _ && t(2, l = _.i18n);
  }, r.$$.update = () => {
    r.$$.dirty & /*value*/
    64 && t(3, n = (Array.isArray(s) ? s : [s]).map((_) => {
      var R;
      const [k, C] = split_filename((R = _.orig_name) !== null && R !== void 0 ? R : "");
      return Object.assign(Object.assign({}, _), { filename_stem: k, filename_ext: C });
    }));
  }, [
    o,
    c,
    l,
    n,
    u,
    h,
    s,
    d,
    w,
    b
  ];
}
class FilePreview extends SvelteComponent$6 {
  constructor(e) {
    super(), init$6(this, e, instance$6, create_fragment$6, safe_not_equal$7, {
      value: 6,
      selectable: 0,
      height: 1,
      i18n: 2
    });
  }
}
const {
  SvelteComponent: SvelteComponent$5,
  bubble,
  check_outros: check_outros$3,
  create_component: create_component$3,
  destroy_component: destroy_component$3,
  detach: detach$5,
  empty: empty$2,
  group_outros: group_outros$3,
  init: init$5,
  insert: insert$5,
  mount_component: mount_component$3,
  safe_not_equal: safe_not_equal$6,
  space: space$3,
  transition_in: transition_in$3,
  transition_out: transition_out$3
} = window.__gradio__svelte__internal;
function create_else_block$2(r) {
  let e, t;
  return e = new Empty({
    props: {
      unpadded_box: !0,
      size: "large",
      $$slots: { default: [create_default_slot$1] },
      $$scope: { ctx: r }
    }
  }), {
    c() {
      create_component$3(e.$$.fragment);
    },
    m(n, a) {
      mount_component$3(e, n, a), t = !0;
    },
    p(n, a) {
      const s = {};
      a & /*$$scope*/
      128 && (s.$$scope = { dirty: a, ctx: n }), e.$set(s);
    },
    i(n) {
      t || (transition_in$3(e.$$.fragment, n), t = !0);
    },
    o(n) {
      transition_out$3(e.$$.fragment, n), t = !1;
    },
    d(n) {
      destroy_component$3(e, n);
    }
  };
}
function create_if_block$3(r) {
  let e, t;
  return e = new FilePreview({
    props: {
      i18n: (
        /*i18n*/
        r[5]
      ),
      selectable: (
        /*selectable*/
        r[3]
      ),
      value: (
        /*value*/
        r[0]
      ),
      height: (
        /*height*/
        r[4]
      )
    }
  }), e.$on(
    "select",
    /*select_handler*/
    r[6]
  ), {
    c() {
      create_component$3(e.$$.fragment);
    },
    m(n, a) {
      mount_component$3(e, n, a), t = !0;
    },
    p(n, a) {
      const s = {};
      a & /*i18n*/
      32 && (s.i18n = /*i18n*/
      n[5]), a & /*selectable*/
      8 && (s.selectable = /*selectable*/
      n[3]), a & /*value*/
      1 && (s.value = /*value*/
      n[0]), a & /*height*/
      16 && (s.height = /*height*/
      n[4]), e.$set(s);
    },
    i(n) {
      t || (transition_in$3(e.$$.fragment, n), t = !0);
    },
    o(n) {
      transition_out$3(e.$$.fragment, n), t = !1;
    },
    d(n) {
      destroy_component$3(e, n);
    }
  };
}
function create_default_slot$1(r) {
  let e, t;
  return e = new File({}), {
    c() {
      create_component$3(e.$$.fragment);
    },
    m(n, a) {
      mount_component$3(e, n, a), t = !0;
    },
    i(n) {
      t || (transition_in$3(e.$$.fragment, n), t = !0);
    },
    o(n) {
      transition_out$3(e.$$.fragment, n), t = !1;
    },
    d(n) {
      destroy_component$3(e, n);
    }
  };
}
function create_fragment$5(r) {
  let e, t, n, a, s, o, c;
  e = new BlockLabel({
    props: {
      show_label: (
        /*show_label*/
        r[2]
      ),
      float: (
        /*value*/
        r[0] === null
      ),
      Icon: File,
      label: (
        /*label*/
        r[1] || "File"
      )
    }
  });
  const l = [create_if_block$3, create_else_block$2], u = [];
  function h(d, w) {
    return w & /*value*/
    1 && (n = null), n == null && (n = !!/*value*/
    (d[0] && (!Array.isArray(
      /*value*/
      d[0]
    ) || /*value*/
    d[0].length > 0))), n ? 0 : 1;
  }
  return a = h(r, -1), s = u[a] = l[a](r), {
    c() {
      create_component$3(e.$$.fragment), t = space$3(), s.c(), o = empty$2();
    },
    m(d, w) {
      mount_component$3(e, d, w), insert$5(d, t, w), u[a].m(d, w), insert$5(d, o, w), c = !0;
    },
    p(d, [w]) {
      const b = {};
      w & /*show_label*/
      4 && (b.show_label = /*show_label*/
      d[2]), w & /*value*/
      1 && (b.float = /*value*/
      d[0] === null), w & /*label*/
      2 && (b.label = /*label*/
      d[1] || "File"), e.$set(b);
      let _ = a;
      a = h(d, w), a === _ ? u[a].p(d, w) : (group_outros$3(), transition_out$3(u[_], 1, 1, () => {
        u[_] = null;
      }), check_outros$3(), s = u[a], s ? s.p(d, w) : (s = u[a] = l[a](d), s.c()), transition_in$3(s, 1), s.m(o.parentNode, o));
    },
    i(d) {
      c || (transition_in$3(e.$$.fragment, d), transition_in$3(s), c = !0);
    },
    o(d) {
      transition_out$3(e.$$.fragment, d), transition_out$3(s), c = !1;
    },
    d(d) {
      d && (detach$5(t), detach$5(o)), destroy_component$3(e, d), u[a].d(d);
    }
  };
}
function instance$5(r, e, t) {
  let { value: n = null } = e, { label: a } = e, { show_label: s = !0 } = e, { selectable: o = !1 } = e, { height: c = void 0 } = e, { i18n: l } = e;
  function u(h) {
    bubble.call(this, r, h);
  }
  return r.$$set = (h) => {
    "value" in h && t(0, n = h.value), "label" in h && t(1, a = h.label), "show_label" in h && t(2, s = h.show_label), "selectable" in h && t(3, o = h.selectable), "height" in h && t(4, c = h.height), "i18n" in h && t(5, l = h.i18n);
  }, [n, a, s, o, c, l, u];
}
class File_1 extends SvelteComponent$5 {
  constructor(e) {
    super(), init$5(this, e, instance$5, create_fragment$5, safe_not_equal$6, {
      value: 0,
      label: 1,
      show_label: 2,
      selectable: 3,
      height: 4,
      i18n: 5
    });
  }
}
/*! @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,
  setPrototypeOf,
  isFrozen,
  getPrototypeOf,
  getOwnPropertyDescriptor
} = Object;
let {
  freeze,
  seal,
  create
} = Object, {
  apply,
  construct
} = typeof Reflect < "u" && Reflect;
freeze || (freeze = function(e) {
  return e;
});
seal || (seal = function(e) {
  return e;
});
apply || (apply = function(e, t, n) {
  return e.apply(t, n);
});
construct || (construct = function(e, t) {
  return new e(...t);
});
const arrayForEach = unapply(Array.prototype.forEach), arrayPop = unapply(Array.prototype.pop), arrayPush = unapply(Array.prototype.push), stringToLowerCase = unapply(String.prototype.toLowerCase), stringToString = unapply(String.prototype.toString), stringMatch = unapply(String.prototype.match), stringReplace = unapply(String.prototype.replace), stringIndexOf = unapply(String.prototype.indexOf), stringTrim = unapply(String.prototype.trim), objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty), regExpTest = unapply(RegExp.prototype.test), typeErrorCreate = unconstruct(TypeError);
function unapply(r) {
  return function(e) {
    for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), a = 1; a < t; a++)
      n[a - 1] = arguments[a];
    return apply(r, e, n);
  };
}
function unconstruct(r) {
  return function() {
    for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
      t[n] = arguments[n];
    return construct(r, t);
  };
}
function addToSet(r, e) {
  let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : stringToLowerCase;
  setPrototypeOf && setPrototypeOf(r, null);
  let n = e.length;
  for (; n--; ) {
    let a = e[n];
    if (typeof a == "string") {
      const s = t(a);
      s !== a && (isFrozen(e) || (e[n] = s), a = s);
    }
    r[a] = !0;
  }
  return r;
}
function cleanArray(r) {
  for (let e = 0; e < r.length; e++)
    objectHasOwnProperty(r, e) || (r[e] = null);
  return r;
}
function clone(r) {
  const e = create(null);
  for (const [t, n] of entries(r))
    objectHasOwnProperty(r, t) && (Array.isArray(n) ? e[t] = cleanArray(n) : n && typeof n == "object" && n.constructor === Object ? e[t] = clone(n) : e[t] = n);
  return e;
}
function lookupGetter(r, e) {
  for (; r !== null; ) {
    const n = getOwnPropertyDescriptor(r, e);
    if (n) {
      if (n.get)
        return unapply(n.get);
      if (typeof n.value == "function")
        return unapply(n.value);
    }
    r = getPrototypeOf(r);
  }
  function t() {
    return null;
  }
  return t;
}
const html$1 = freeze(["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"]), svg$1 = freeze(["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"]), svgFilters = freeze(["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"]), svgDisallowed = freeze(["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"]), mathMl$1 = freeze(["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"]), mathMlDisallowed = freeze(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), text$3 = freeze(["#text"]), html = freeze(["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"]), svg = freeze(["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"]), mathMl = freeze(["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"]), xml = freeze(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), MUSTACHE_EXPR = seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm), ERB_EXPR = seal(/<%[\w\W]*|[\w\W]*%>/gm), TMPLIT_EXPR = seal(/\${[\w\W]*}/gm), DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]/), ARIA_ATTR = seal(/^aria-[\-\w]+$/), IS_ALLOWED_URI = seal(
  /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
  // eslint-disable-line no-useless-escape
), IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i), ATTR_WHITESPACE = seal(
  /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
  // eslint-disable-line no-control-regex
), DOCTYPE_NAME = seal(/^html$/i), CUSTOM_ELEMENT = seal(/^[a-z][.\w]*(-[.\w]+)+$/i);
var EXPRESSIONS = /* @__PURE__ */ Object.freeze({
  __proto__: null,
  MUSTACHE_EXPR,
  ERB_EXPR,
  TMPLIT_EXPR,
  DATA_ATTR,
  ARIA_ATTR,
  IS_ALLOWED_URI,
  IS_SCRIPT_OR_DATA,
  ATTR_WHITESPACE,
  DOCTYPE_NAME,
  CUSTOM_ELEMENT
});
const NODE_TYPE = {
  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
}, getGlobal = function() {
  return typeof window > "u" ? null : window;
}, _createTrustedTypesPolicy = function(e, t) {
  if (typeof e != "object" || typeof e.createPolicy != "function")
    return null;
  let n = null;
  const a = "data-tt-policy-suffix";
  t && t.hasAttribute(a) && (n = t.getAttribute(a));
  const s = "dompurify" + (n ? "#" + n : "");
  try {
    return e.createPolicy(s, {
      createHTML(o) {
        return o;
      },
      createScriptURL(o) {
        return o;
      }
    });
  } catch {
    return console.warn("TrustedTypes policy " + s + " could not be created."), null;
  }
};
function createDOMPurify() {
  let r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : getGlobal();
  const e = (He) => createDOMPurify(He);
  if (e.version = "3.1.7", e.removed = [], !r || !r.document || r.document.nodeType !== NODE_TYPE.document)
    return e.isSupported = !1, e;
  let {
    document: t
  } = r;
  const n = t, a = n.currentScript, {
    DocumentFragment: s,
    HTMLTemplateElement: o,
    Node: c,
    Element: l,
    NodeFilter: u,
    NamedNodeMap: h = r.NamedNodeMap || r.MozNamedAttrMap,
    HTMLFormElement: d,
    DOMParser: w,
    trustedTypes: b
  } = r, _ = l.prototype, R = lookupGetter(_, "cloneNode"), k = lookupGetter(_, "remove"), C = lookupGetter(_, "nextSibling"), m = lookupGetter(_, "childNodes"), A = lookupGetter(_, "parentNode");
  if (typeof o == "function") {
    const He = t.createElement("template");
    He.content && He.content.ownerDocument && (t = He.content.ownerDocument);
  }
  let F, f = "";
  const {
    implementation: g,
    createNodeIterator: y,
    createDocumentFragment: E,
    getElementsByTagName: x
  } = t, {
    importNode: O
  } = n;
  let P = {};
  e.isSupported = typeof entries == "function" && typeof A == "function" && g && g.createHTMLDocument !== void 0;
  const {
    MUSTACHE_EXPR: I,
    ERB_EXPR: G,
    TMPLIT_EXPR: ne,
    DATA_ATTR: X,
    ARIA_ATTR: ee,
    IS_SCRIPT_OR_DATA: K,
    ATTR_WHITESPACE: se,
    CUSTOM_ELEMENT: q
  } = EXPRESSIONS;
  let {
    IS_ALLOWED_URI: Y
  } = EXPRESSIONS, J = null;
  const N = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text$3]);
  let M = null;
  const v = addToSet({}, [...html, ...svg, ...mathMl, ...xml]);
  let L = Object.seal(create(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
    }
  })), H = null, B = null, U = !0, Z = !0, re = !1, pe = !0, be = !1, Se = !0, _e = !1, we = !1, oe = !1, le = !1, $ = !1, j = !1, ae = !0, ue = !1;
  const Ae = "user-content-";
  let Te = !0, ke = !1, ie = {}, Fe = null;
  const De = addToSet({}, ["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 Xe = null;
  const je = addToSet({}, ["audio", "video", "img", "source", "image", "track"]);
  let tt = null;
  const $e = addToSet({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), Ge = "http://www.w3.org/1998/Math/MathML", Qe = "http://www.w3.org/2000/svg", nt = "http://www.w3.org/1999/xhtml";
  let xe = nt, he = !1, me = null;
  const Ie = addToSet({}, [Ge, Qe, nt], stringToString);
  let Ze = null;
  const et = ["application/xhtml+xml", "text/html"], V = "text/html";
  let ye = null, Me = null;
  const qe = t.createElement("form"), Ue = function(ce) {
    return ce instanceof RegExp || ce instanceof Function;
  }, Le = function() {
    let ce = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
    if (!(Me && Me === ce)) {
      if ((!ce || typeof ce != "object") && (ce = {}), ce = clone(ce), Ze = // eslint-disable-next-line unicorn/prefer-includes
      et.indexOf(ce.PARSER_MEDIA_TYPE) === -1 ? V : ce.PARSER_MEDIA_TYPE, ye = Ze === "application/xhtml+xml" ? stringToString : stringToLowerCase, J = objectHasOwnProperty(ce, "ALLOWED_TAGS") ? addToSet({}, ce.ALLOWED_TAGS, ye) : N, M = objectHasOwnProperty(ce, "ALLOWED_ATTR") ? addToSet({}, ce.ALLOWED_ATTR, ye) : v, me = objectHasOwnProperty(ce, "ALLOWED_NAMESPACES") ? addToSet({}, ce.ALLOWED_NAMESPACES, stringToString) : Ie, tt = objectHasOwnProperty(ce, "ADD_URI_SAFE_ATTR") ? addToSet(
        clone($e),
        // eslint-disable-line indent
        ce.ADD_URI_SAFE_ATTR,
        // eslint-disable-line indent
        ye
        // eslint-disable-line indent
      ) : $e, Xe = objectHasOwnProperty(ce, "ADD_DATA_URI_TAGS") ? addToSet(
        clone(je),
        // eslint-disable-line indent
        ce.ADD_DATA_URI_TAGS,
        // eslint-disable-line indent
        ye
        // eslint-disable-line indent
      ) : je, Fe = objectHasOwnProperty(ce, "FORBID_CONTENTS") ? addToSet({}, ce.FORBID_CONTENTS, ye) : De, H = objectHasOwnProperty(ce, "FORBID_TAGS") ? addToSet({}, ce.FORBID_TAGS, ye) : {}, B = objectHasOwnProperty(ce, "FORBID_ATTR") ? addToSet({}, ce.FORBID_ATTR, ye) : {}, ie = objectHasOwnProperty(ce, "USE_PROFILES") ? ce.USE_PROFILES : !1, U = ce.ALLOW_ARIA_ATTR !== !1, Z = ce.ALLOW_DATA_ATTR !== !1, re = ce.ALLOW_UNKNOWN_PROTOCOLS || !1, pe = ce.ALLOW_SELF_CLOSE_IN_ATTR !== !1, be = ce.SAFE_FOR_TEMPLATES || !1, Se = ce.SAFE_FOR_XML !== !1, _e = ce.WHOLE_DOCUMENT || !1, le = ce.RETURN_DOM || !1, $ = ce.RETURN_DOM_FRAGMENT || !1, j = ce.RETURN_TRUSTED_TYPE || !1, oe = ce.FORCE_BODY || !1, ae = ce.SANITIZE_DOM !== !1, ue = ce.SANITIZE_NAMED_PROPS || !1, Te = ce.KEEP_CONTENT !== !1, ke = ce.IN_PLACE || !1, Y = ce.ALLOWED_URI_REGEXP || IS_ALLOWED_URI, xe = ce.NAMESPACE || nt, L = ce.CUSTOM_ELEMENT_HANDLING || {}, ce.CUSTOM_ELEMENT_HANDLING && Ue(ce.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (L.tagNameCheck = ce.CUSTOM_ELEMENT_HANDLING.tagNameCheck), ce.CUSTOM_ELEMENT_HANDLING && Ue(ce.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (L.attributeNameCheck = ce.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), ce.CUSTOM_ELEMENT_HANDLING && typeof ce.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (L.allowCustomizedBuiltInElements = ce.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), be && (Z = !1), $ && (le = !0), ie && (J = addToSet({}, text$3), M = [], ie.html === !0 && (addToSet(J, html$1), addToSet(M, html)), ie.svg === !0 && (addToSet(J, svg$1), addToSet(M, svg), addToSet(M, xml)), ie.svgFilters === !0 && (addToSet(J, svgFilters), addToSet(M, svg), addToSet(M, xml)), ie.mathMl === !0 && (addToSet(J, mathMl$1), addToSet(M, mathMl), addToSet(M, xml))), ce.ADD_TAGS && (J === N && (J = clone(J)), addToSet(J, ce.ADD_TAGS, ye)), ce.ADD_ATTR && (M === v && (M = clone(M)), addToSet(M, ce.ADD_ATTR, ye)), ce.ADD_URI_SAFE_ATTR && addToSet(tt, ce.ADD_URI_SAFE_ATTR, ye), ce.FORBID_CONTENTS && (Fe === De && (Fe = clone(Fe)), addToSet(Fe, ce.FORBID_CONTENTS, ye)), Te && (J["#text"] = !0), _e && addToSet(J, ["html", "head", "body"]), J.table && (addToSet(J, ["tbody"]), delete H.tbody), ce.TRUSTED_TYPES_POLICY) {
        if (typeof ce.TRUSTED_TYPES_POLICY.createHTML != "function")
          throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
        if (typeof ce.TRUSTED_TYPES_POLICY.createScriptURL != "function")
          throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
        F = ce.TRUSTED_TYPES_POLICY, f = F.createHTML("");
      } else
        F === void 0 && (F = _createTrustedTypesPolicy(b, a)), F !== null && typeof f == "string" && (f = F.createHTML(""));
      freeze && freeze(ce), Me = ce;
    }
  }, W = addToSet({}, ["mi", "mo", "mn", "ms", "mtext"]), z = addToSet({}, ["annotation-xml"]), Q = addToSet({}, ["title", "style", "font", "a", "script"]), ge = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]), ve = addToSet({}, [...mathMl$1, ...mathMlDisallowed]), Ee = function(ce) {
    let Re = A(ce);
    (!Re || !Re.tagName) && (Re = {
      namespaceURI: xe,
      tagName: "template"
    });
    const We = stringToLowerCase(ce.tagName), at = stringToLowerCase(Re.tagName);
    return me[ce.namespaceURI] ? ce.namespaceURI === Qe ? Re.namespaceURI === nt ? We === "svg" : Re.namespaceURI === Ge ? We === "svg" && (at === "annotation-xml" || W[at]) : !!ge[We] : ce.namespaceURI === Ge ? Re.namespaceURI === nt ? We === "math" : Re.namespaceURI === Qe ? We === "math" && z[at] : !!ve[We] : ce.namespaceURI === nt ? Re.namespaceURI === Qe && !z[at] || Re.namespaceURI === Ge && !W[at] ? !1 : !ve[We] && (Q[We] || !ge[We]) : !!(Ze === "application/xhtml+xml" && me[ce.namespaceURI]) : !1;
  }, Ce = function(ce) {
    arrayPush(e.removed, {
      element: ce
    });
    try {
      A(ce).removeChild(ce);
    } catch {
      k(ce);
    }
  }, Ne = function(ce, Re) {
    try {
      arrayPush(e.removed, {
        attribute: Re.getAttributeNode(ce),
        from: Re
      });
    } catch {
      arrayPush(e.removed, {
        attribute: null,
        from: Re
      });
    }
    if (Re.removeAttribute(ce), ce === "is" && !M[ce])
      if (le || $)
        try {
          Ce(Re);
        } catch {
        }
      else
        try {
          Re.setAttribute(ce, "");
        } catch {
        }
  }, Be = function(ce) {
    let Re = null, We = null;
    if (oe)
      ce = "<remove></remove>" + ce;
    else {
      const ot = stringMatch(ce, /^[\r\n\t ]+/);
      We = ot && ot[0];
    }
    Ze === "application/xhtml+xml" && xe === nt && (ce = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + ce + "</body></html>");
    const at = F ? F.createHTML(ce) : ce;
    if (xe === nt)
      try {
        Re = new w().parseFromString(at, Ze);
      } catch {
      }
    if (!Re || !Re.documentElement) {
      Re = g.createDocument(xe, "template", null);
      try {
        Re.documentElement.innerHTML = he ? f : at;
      } catch {
      }
    }
    const lt = Re.body || Re.documentElement;
    return ce && We && lt.insertBefore(t.createTextNode(We), lt.childNodes[0] || null), xe === nt ? x.call(Re, _e ? "html" : "body")[0] : _e ? Re.documentElement : lt;
  }, Pe = function(ce) {
    return y.call(
      ce.ownerDocument || ce,
      ce,
      // eslint-disable-next-line no-bitwise
      u.SHOW_ELEMENT | u.SHOW_COMMENT | u.SHOW_TEXT | u.SHOW_PROCESSING_INSTRUCTION | u.SHOW_CDATA_SECTION,
      null
    );
  }, Ye = function(ce) {
    return ce instanceof d && (typeof ce.nodeName != "string" || typeof ce.textContent != "string" || typeof ce.removeChild != "function" || !(ce.attributes instanceof h) || typeof ce.removeAttribute != "function" || typeof ce.setAttribute != "function" || typeof ce.namespaceURI != "string" || typeof ce.insertBefore != "function" || typeof ce.hasChildNodes != "function");
  }, ze = function(ce) {
    return typeof c == "function" && ce instanceof c;
  }, Oe = function(ce, Re, We) {
    P[ce] && arrayForEach(P[ce], (at) => {
      at.call(e, Re, We, Me);
    });
  }, Ve = function(ce) {
    let Re = null;
    if (Oe("beforeSanitizeElements", ce, null), Ye(ce))
      return Ce(ce), !0;
    const We = ye(ce.nodeName);
    if (Oe("uponSanitizeElement", ce, {
      tagName: We,
      allowedTags: J
    }), ce.hasChildNodes() && !ze(ce.firstElementChild) && regExpTest(/<[/\w]/g, ce.innerHTML) && regExpTest(/<[/\w]/g, ce.textContent) || ce.nodeType === NODE_TYPE.progressingInstruction || Se && ce.nodeType === NODE_TYPE.comment && regExpTest(/<[/\w]/g, ce.data))
      return Ce(ce), !0;
    if (!J[We] || H[We]) {
      if (!H[We] && rt(We) && (L.tagNameCheck instanceof RegExp && regExpTest(L.tagNameCheck, We) || L.tagNameCheck instanceof Function && L.tagNameCheck(We)))
        return !1;
      if (Te && !Fe[We]) {
        const at = A(ce) || ce.parentNode, lt = m(ce) || ce.childNodes;
        if (lt && at) {
          const ot = lt.length;
          for (let ut = ot - 1; ut >= 0; --ut) {
            const dt = R(lt[ut], !0);
            dt.__removalCount = (ce.__removalCount || 0) + 1, at.insertBefore(dt, C(ce));
          }
        }
      }
      return Ce(ce), !0;
    }
    return ce instanceof l && !Ee(ce) || (We === "noscript" || We === "noembed" || We === "noframes") && regExpTest(/<\/no(script|embed|frames)/i, ce.innerHTML) ? (Ce(ce), !0) : (be && ce.nodeType === NODE_TYPE.text && (Re = ce.textContent, arrayForEach([I, G, ne], (at) => {
      Re = stringReplace(Re, at, " ");
    }), ce.textContent !== Re && (arrayPush(e.removed, {
      element: ce.cloneNode()
    }), ce.textContent = Re)), Oe("afterSanitizeElements", ce, null), !1);
  }, Je = function(ce, Re, We) {
    if (ae && (Re === "id" || Re === "name") && (We in t || We in qe))
      return !1;
    if (!(Z && !B[Re] && regExpTest(X, Re))) {
      if (!(U && regExpTest(ee, Re))) {
        if (!M[Re] || B[Re]) {
          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
            !(rt(ce) && (L.tagNameCheck instanceof RegExp && regExpTest(L.tagNameCheck, ce) || L.tagNameCheck instanceof Function && L.tagNameCheck(ce)) && (L.attributeNameCheck instanceof RegExp && regExpTest(L.attributeNameCheck, Re) || L.attributeNameCheck instanceof Function && L.attributeNameCheck(Re)) || // Alternative, second condition checks if it's an `is`-attribute, AND
            // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
            Re === "is" && L.allowCustomizedBuiltInElements && (L.tagNameCheck instanceof RegExp && regExpTest(L.tagNameCheck, We) || L.tagNameCheck instanceof Function && L.tagNameCheck(We)))
          ) return !1;
        } else if (!tt[Re]) {
          if (!regExpTest(Y, stringReplace(We, se, ""))) {
            if (!((Re === "src" || Re === "xlink:href" || Re === "href") && ce !== "script" && stringIndexOf(We, "data:") === 0 && Xe[ce])) {
              if (!(re && !regExpTest(K, stringReplace(We, se, "")))) {
                if (We)
                  return !1;
              }
            }
          }
        }
      }
    }
    return !0;
  }, rt = function(ce) {
    return ce !== "annotation-xml" && stringMatch(ce, q);
  }, it = function(ce) {
    Oe("beforeSanitizeAttributes", ce, null);
    const {
      attributes: Re
    } = ce;
    if (!Re)
      return;
    const We = {
      attrName: "",
      attrValue: "",
      keepAttr: !0,
      allowedAttributes: M
    };
    let at = Re.length;
    for (; at--; ) {
      const lt = Re[at], {
        name: ot,
        namespaceURI: ut,
        value: dt
      } = lt, St = ye(ot);
      let ct = ot === "value" ? dt : stringTrim(dt);
      if (We.attrName = St, We.attrValue = ct, We.keepAttr = !0, We.forceKeepAttr = void 0, Oe("uponSanitizeAttribute", ce, We), ct = We.attrValue, We.forceKeepAttr || (Ne(ot, ce), !We.keepAttr))
        continue;
      if (!pe && regExpTest(/\/>/i, ct)) {
        Ne(ot, ce);
        continue;
      }
      be && arrayForEach([I, G, ne], (Cn) => {
        ct = stringReplace(ct, Cn, " ");
      });
      const Tn = ye(ce.nodeName);
      if (Je(Tn, St, ct)) {
        if (ue && (St === "id" || St === "name") && (Ne(ot, ce), ct = Ae + ct), Se && regExpTest(/((--!?|])>)|<\/(style|title)/i, ct)) {
          Ne(ot, ce);
          continue;
        }
        if (F && typeof b == "object" && typeof b.getAttributeType == "function" && !ut)
          switch (b.getAttributeType(Tn, St)) {
            case "TrustedHTML": {
              ct = F.createHTML(ct);
              break;
            }
            case "TrustedScriptURL": {
              ct = F.createScriptURL(ct);
              break;
            }
          }
        try {
          ut ? ce.setAttributeNS(ut, ot, ct) : ce.setAttribute(ot, ct), Ye(ce) ? Ce(ce) : arrayPop(e.removed);
        } catch {
        }
      }
    }
    Oe("afterSanitizeAttributes", ce, null);
  }, st = function He(ce) {
    let Re = null;
    const We = Pe(ce);
    for (Oe("beforeSanitizeShadowDOM", ce, null); Re = We.nextNode(); )
      Oe("uponSanitizeShadowNode", Re, null), !Ve(Re) && (Re.content instanceof s && He(Re.content), it(Re));
    Oe("afterSanitizeShadowDOM", ce, null);
  };
  return e.sanitize = function(He) {
    let ce = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, Re = null, We = null, at = null, lt = null;
    if (he = !He, he && (He = "<!-->"), typeof He != "string" && !ze(He))
      if (typeof He.toString == "function") {
        if (He = He.toString(), typeof He != "string")
          throw typeErrorCreate("dirty is not a string, aborting");
      } else
        throw typeErrorCreate("toString is not a function");
    if (!e.isSupported)
      return He;
    if (we || Le(ce), e.removed = [], typeof He == "string" && (ke = !1), ke) {
      if (He.nodeName) {
        const dt = ye(He.nodeName);
        if (!J[dt] || H[dt])
          throw typeErrorCreate("root node is forbidden and cannot be sanitized in-place");
      }
    } else if (He instanceof c)
      Re = Be("<!---->"), We = Re.ownerDocument.importNode(He, !0), We.nodeType === NODE_TYPE.element && We.nodeName === "BODY" || We.nodeName === "HTML" ? Re = We : Re.appendChild(We);
    else {
      if (!le && !be && !_e && // eslint-disable-next-line unicorn/prefer-includes
      He.indexOf("<") === -1)
        return F && j ? F.createHTML(He) : He;
      if (Re = Be(He), !Re)
        return le ? null : j ? f : "";
    }
    Re && oe && Ce(Re.firstChild);
    const ot = Pe(ke ? He : Re);
    for (; at = ot.nextNode(); )
      Ve(at) || (at.content instanceof s && st(at.content), it(at));
    if (ke)
      return He;
    if (le) {
      if ($)
        for (lt = E.call(Re.ownerDocument); Re.firstChild; )
          lt.appendChild(Re.firstChild);
      else
        lt = Re;
      return (M.shadowroot || M.shadowrootmode) && (lt = O.call(n, lt, !0)), lt;
    }
    let ut = _e ? Re.outerHTML : Re.innerHTML;
    return _e && J["!doctype"] && Re.ownerDocument && Re.ownerDocument.doctype && Re.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, Re.ownerDocument.doctype.name) && (ut = "<!DOCTYPE " + Re.ownerDocument.doctype.name + `>
` + ut), be && arrayForEach([I, G, ne], (dt) => {
      ut = stringReplace(ut, dt, " ");
    }), F && j ? F.createHTML(ut) : ut;
  }, e.setConfig = function() {
    let He = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
    Le(He), we = !0;
  }, e.clearConfig = function() {
    Me = null, we = !1;
  }, e.isValidAttribute = function(He, ce, Re) {
    Me || Le({});
    const We = ye(He), at = ye(ce);
    return Je(We, at, Re);
  }, e.addHook = function(He, ce) {
    typeof ce == "function" && (P[He] = P[He] || [], arrayPush(P[He], ce));
  }, e.removeHook = function(He) {
    if (P[He])
      return arrayPop(P[He]);
  }, e.removeHooks = function(He) {
    P[He] && (P[He] = []);
  }, e.removeAllHooks = function() {
    P = {};
  }, e;
}
var purify = createDOMPurify();
class SourceLocation {
  // 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 SourceLocation(e.loc.lexer, e.loc.start, t.loc.end) : e && e.loc;
  }
}
class Token {
  // 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 Token(t, SourceLocation.range(this, e));
  }
}
class ParseError {
  // Error start position based on passed-in Token or ParseNode.
  // Length of affected text based on passed-in Token or ParseNode.
  // The underlying error message without any context added.
  constructor(e, t) {
    this.name = void 0, this.position = void 0, this.length = void 0, this.rawMessage = void 0;
    var n = "KaTeX parse error: " + e, a, s, o = t && t.loc;
    if (o && o.start <= o.end) {
      var c = o.lexer.input;
      a = o.start, s = o.end, a === c.length ? n += " at end of input: " : n += " at position " + (a + 1) + ": ";
      var l = c.slice(a, s).replace(/[^]/g, "$&̲"), u;
      a > 15 ? u = "…" + c.slice(a - 15, a) : u = c.slice(0, a);
      var h;
      s + 15 < c.length ? h = c.slice(s, s + 15) + "…" : h = c.slice(s), n += u + l + h;
    }
    var d = new Error(n);
    return d.name = "ParseError", d.__proto__ = ParseError.prototype, d.position = a, a != null && s != null && (d.length = s - a), d.rawMessage = e, d;
  }
}
ParseError.prototype.__proto__ = Error.prototype;
var contains = function(e, t) {
  return e.indexOf(t) !== -1;
}, deflt = function(e, t) {
  return e === void 0 ? t : e;
}, uppercase = /([A-Z])/g, hyphenate = function(e) {
  return e.replace(uppercase, "-$1").toLowerCase();
}, ESCAPE_LOOKUP = {
  "&": "&amp;",
  ">": "&gt;",
  "<": "&lt;",
  '"': "&quot;",
  "'": "&#x27;"
}, ESCAPE_REGEX = /[&><"']/g;
function escape$1(r) {
  return String(r).replace(ESCAPE_REGEX, (e) => ESCAPE_LOOKUP[e]);
}
var getBaseElem = function r(e) {
  return e.type === "ordgroup" || e.type === "color" ? e.body.length === 1 ? r(e.body[0]) : e : e.type === "font" ? r(e.body) : e;
}, isCharacterBox = function(e) {
  var t = getBaseElem(e);
  return t.type === "mathord" || t.type === "textord" || t.type === "atom";
}, assert = function(e) {
  if (!e)
    throw new Error("Expected non-null, but got " + String(e));
  return e;
}, protocolFromUrl = 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";
}, utils = {
  contains,
  deflt,
  escape: escape$1,
  hyphenate,
  getBaseElem,
  isCharacterBox,
  protocolFromUrl
}, SETTINGS_SCHEMA = {
  displayMode: {
    type: "boolean",
    description: "Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",
    cli: "-d, --display-mode"
  },
  output: {
    type: {
      enum: ["htmlAndMathml", "html", "mathml"]
    },
    description: "Determines the markup language of the output.",
    cli: "-F, --format <type>"
  },
  leqno: {
    type: "boolean",
    description: "Render display math in leqno style (left-justified tags)."
  },
  fleqn: {
    type: "boolean",
    description: "Render display math flush left."
  },
  throwOnError: {
    type: "boolean",
    default: !0,
    cli: "-t, --no-throw-on-error",
    cliDescription: "Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."
  },
  errorColor: {
    type: "string",
    default: "#cc0000",
    cli: "-c, --error-color <color>",
    cliDescription: "A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",
    cliProcessor: (r) => "#" + r
  },
  macros: {
    type: "object",
    cli: "-m, --macro <def>",
    cliDescription: "Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",
    cliDefault: [],
    cliProcessor: (r, e) => (e.push(r), e)
  },
  minRuleThickness: {
    type: "number",
    description: "Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",
    processor: (r) => Math.max(0, r),
    cli: "--min-rule-thickness <size>",
    cliProcessor: parseFloat
  },
  colorIsTextColor: {
    type: "boolean",
    description: "Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",
    cli: "-b, --color-is-text-color"
  },
  strict: {
    type: [{
      enum: ["warn", "ignore", "error"]
    }, "boolean", "function"],
    description: "Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",
    cli: "-S, --strict",
    cliDefault: !1
  },
  trust: {
    type: ["boolean", "function"],
    description: "Trust the input, enabling all HTML features such as \\url.",
    cli: "-T, --trust"
  },
  maxSize: {
    type: "number",
    default: 1 / 0,
    description: "If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",
    processor: (r) => Math.max(0, r),
    cli: "-s, --max-size <n>",
    cliProcessor: parseInt
  },
  maxExpand: {
    type: "number",
    default: 1e3,
    description: "Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",
    processor: (r) => Math.max(0, r),
    cli: "-e, --max-expand <n>",
    cliProcessor: (r) => r === "Infinity" ? 1 / 0 : parseInt(r)
  },
  globalGroup: {
    type: "boolean",
    cli: !1
  }
};
function getDefaultValue(r) {
  if (r.default)
    return r.default;
  var e = r.type, t = Array.isArray(e) ? e[0] : e;
  if (typeof t != "string")
    return t.enum[0];
  switch (t) {
    case "boolean":
      return !1;
    case "string":
      return "";
    case "number":
      return 0;
    case "object":
      return {};
  }
}
class Settings {
  constructor(e) {
    this.displayMode = void 0, this.output = void 0, this.leqno = void 0, this.fleqn = void 0, this.throwOnError = void 0, this.errorColor = void 0, this.macros = void 0, this.minRuleThickness = void 0, this.colorIsTextColor = void 0, this.strict = void 0, this.trust = void 0, this.maxSize = void 0, this.maxExpand = void 0, this.globalGroup = void 0, e = e || {};
    for (var t in SETTINGS_SCHEMA)
      if (SETTINGS_SCHEMA.hasOwnProperty(t)) {
        var n = SETTINGS_SCHEMA[t];
        this[t] = e[t] !== void 0 ? n.processor ? n.processor(e[t]) : e[t] : getDefaultValue(n);
      }
  }
  /**
   * Report nonstrict (non-LaTeX-compatible) input.
   * Can safely not be called if `this.strict` is false in JavaScript.
   */
  reportNonstrict(e, t, n) {
    var a = this.strict;
    if (typeof a == "function" && (a = a(e, t, n)), !(!a || a === "ignore")) {
      if (a === !0 || a === "error")
        throw new ParseError("LaTeX-incompatible input and strict mode is set to 'error': " + (t + " [" + e + "]"), n);
      a === "warn" ? typeof console < "u" && console.warn("LaTeX-incompatible input and strict mode is set to 'warn': " + (t + " [" + e + "]")) : typeof console < "u" && console.warn("LaTeX-incompatible input and strict mode is set to " + ("unrecognized '" + a + "': " + t + " [" + e + "]"));
    }
  }
  /**
   * Check whether to apply strict (LaTeX-adhering) behavior for unusual
   * input (like `\\`).  Unlike `nonstrict`, will not throw an error;
   * instead, "error" translates to a return value of `true`, while "ignore"
   * translates to a return value of `false`.  May still print a warning:
   * "warn" prints a warning and returns `false`.
   * This is for the second category of `errorCode`s listed in the README.
   */
  useStrictBehavior(e, t, n) {
    var a = this.strict;
    if (typeof a == "function")
      try {
        a = a(e, t, n);
      } catch {
        a = "error";
      }
    return !a || a === "ignore" ? !1 : a === !0 || a === "error" ? !0 : a === "warn" ? (typeof console < "u" && console.warn("LaTeX-incompatible input and strict mode is set to 'warn': " + (t + " [" + e + "]")), !1) : (typeof console < "u" && console.warn("LaTeX-incompatible input and strict mode is set to " + ("unrecognized '" + a + "': " + t + " [" + e + "]")), !1);
  }
  /**
   * Check whether to test potentially dangerous input, and return
   * `true` (trusted) or `false` (untrusted).  The sole argument `context`
   * should be an object with `command` field specifying the relevant LaTeX
   * command (as a string starting with `\`), and any other arguments, etc.
   * If `context` has a `url` field, a `protocol` field will automatically
   * get added by this function (changing the specified object).
   */
  isTrusted(e) {
    if (e.url && !e.protocol) {
      var t = utils.protocolFromUrl(e.url);
      if (t == null)
        return !1;
      e.protocol = t;
    }
    var n = typeof this.trust == "function" ? this.trust(e) : this.trust;
    return !!n;
  }
}
class Style {
  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 styles[sup[this.id]];
  }
  /**
   * Get the style of a subscript given a base in the current style.
   */
  sub() {
    return styles[sub[this.id]];
  }
  /**
   * Get the style of a fraction numerator given the fraction in the current
   * style.
   */
  fracNum() {
    return styles[fracNum[this.id]];
  }
  /**
   * Get the style of a fraction denominator given the fraction in the current
   * style.
   */
  fracDen() {
    return styles[fracDen[this.id]];
  }
  /**
   * Get the cramped version of a style (in particular, cramping a cramped style
   * doesn't change the style).
   */
  cramp() {
    return styles[cramp[this.id]];
  }
  /**
   * Get a text or display version of this style.
   */
  text() {
    return styles[text$1$1[this.id]];
  }
  /**
   * Return true if this style is tightly spaced (scriptstyle/scriptscriptstyle)
   */
  isTight() {
    return this.size >= 2;
  }
}
var D = 0, Dc = 1, T = 2, Tc = 3, S = 4, Sc = 5, SS = 6, SSc = 7, styles = [new Style(D, 0, !1), new Style(Dc, 0, !0), new Style(T, 1, !1), new Style(Tc, 1, !0), new Style(S, 2, !1), new Style(Sc, 2, !0), new Style(SS, 3, !1), new Style(SSc, 3, !0)], sup = [S, Sc, S, Sc, SS, SSc, SS, SSc], sub = [Sc, Sc, Sc, Sc, SSc, SSc, SSc, SSc], fracNum = [T, Tc, S, Sc, SS, SSc, SS, SSc], fracDen = [Tc, Tc, Sc, Sc, SSc, SSc, SSc, SSc], cramp = [Dc, Dc, Tc, Tc, Sc, Sc, SSc, SSc], text$1$1 = [D, Dc, T, Tc, T, Tc, T, Tc], Style$1 = {
  DISPLAY: styles[D],
  TEXT: styles[T],
  SCRIPT: styles[S],
  SCRIPTSCRIPT: styles[SS]
}, scriptData = [{
  // 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 scriptFromCodepoint(r) {
  for (var e = 0; e < scriptData.length; e++)
    for (var t = scriptData[e], n = 0; n < t.blocks.length; n++) {
      var a = t.blocks[n];
      if (r >= a[0] && r <= a[1])
        return t.name;
    }
  return null;
}
var allBlocks = [];
scriptData.forEach((r) => r.blocks.forEach((e) => allBlocks.push(...e)));
function supportedCodepoint(r) {
  for (var e = 0; e < allBlocks.length; e += 2)
    if (r >= allBlocks[e] && r <= allBlocks[e + 1])
      return !0;
  return !1;
}
var hLinePad = 80, sqrtMain = 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";
}, sqrtSize1 = 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";
}, sqrtSize2 = 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";
}, sqrtSize3 = 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";
}, sqrtSize4 = 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";
}, phasePath = function(e) {
  var t = e / 2;
  return "M400000 " + e + " H0 L" + t + " 0 l65 45 L145 " + (e - 80) + " H400000z";
}, sqrtTall = function(e, t, n) {
  var a = n - 54 - t - e;
  return "M702 " + (e + t) + "H400000" + (40 + e) + `
H742v` + a + `l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1
h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
219 661 l218 661zM702 ` + t + "H400000v" + (40 + e) + "H742z";
}, sqrtPath = function(e, t, n) {
  t = 1e3 * t;
  var a = "";
  switch (e) {
    case "sqrtMain":
      a = sqrtMain(t, hLinePad);
      break;
    case "sqrtSize1":
      a = sqrtSize1(t, hLinePad);
      break;
    case "sqrtSize2":
      a = sqrtSize2(t, hLinePad);
      break;
    case "sqrtSize3":
      a = sqrtSize3(t, hLinePad);
      break;
    case "sqrtSize4":
      a = sqrtSize4(t, hLinePad);
      break;
    case "sqrtTall":
      a = sqrtTall(t, hLinePad, n);
  }
  return a;
}, innerPath = 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 "";
  }
}, path = {
  // 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`
}, tallDelim = 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 DocumentFragment {
  // 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 utils.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 fontMetricsData = {
  "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]
  }
}, sigmasAndXis = {
  slant: [0.25, 0.25, 0.25],
  // sigma1
  space: [0, 0, 0],
  // sigma2
  stretch: [0, 0, 0],
  // sigma3
  shrink: [0, 0, 0],
  // sigma4
  xHeight: [0.431, 0.431, 0.431],
  // sigma5
  quad: [1, 1.171, 1.472],
  // sigma6
  extraSpace: [0, 0, 0],
  // sigma7
  num1: [0.677, 0.732, 0.925],
  // sigma8
  num2: [0.394, 0.384, 0.387],
  // sigma9
  num3: [0.444, 0.471, 0.504],
  // sigma10
  denom1: [0.686, 0.752, 1.025],
  // sigma11
  denom2: [0.345, 0.344, 0.532],
  // sigma12
  sup1: [0.413, 0.503, 0.504],
  // sigma13
  sup2: [0.363, 0.431, 0.404],
  // sigma14
  sup3: [0.289, 0.286, 0.294],
  // sigma15
  sub1: [0.15, 0.143, 0.2],
  // sigma16
  sub2: [0.247, 0.286, 0.4],
  // sigma17
  supDrop: [0.386, 0.353, 0.494],
  // sigma18
  subDrop: [0.05, 0.071, 0.1],
  // sigma19
  delim1: [2.39, 1.7, 1.98],
  // sigma20
  delim2: [1.01, 1.157, 1.42],
  // sigma21
  axisHeight: [0.25, 0.25, 0.25],
  // sigma22
  // These font metrics are extracted from TeX by using tftopl on cmex10.tfm;
  // they correspond to the font parameters of the extension fonts (family 3).
  // See the TeXbook, page 441. In AMSTeX, the extension fonts scale; to
  // match cmex7, we'd use cmex7.tfm values for script and scriptscript
  // values.
  defaultRuleThickness: [0.04, 0.049, 0.049],
  // xi8; cmex7: 0.049
  bigOpSpacing1: [0.111, 0.111, 0.111],
  // xi9
  bigOpSpacing2: [0.166, 0.166, 0.166],
  // xi10
  bigOpSpacing3: [0.2, 0.2, 0.2],
  // xi11
  bigOpSpacing4: [0.6, 0.611, 0.611],
  // xi12; cmex7: 0.611
  bigOpSpacing5: [0.1, 0.143, 0.143],
  // xi13; cmex7: 0.143
  // The \sqrt rule width is taken from the height of the surd character.
  // Since we use the same font at all sizes, this thickness doesn't scale.
  sqrtRuleThickness: [0.04, 0.04, 0.04],
  // This value determines how large a pt is, for metrics which are defined
  // in terms of pts.
  // This value is also used in katex.scss; if you change it make sure the
  // values match.
  ptPerEm: [10, 10, 10],
  // The space between adjacent `|` columns in an array definition. From
  // `\showthe\doublerulesep` in LaTeX. Equals 2.0 / ptPerEm.
  doubleRuleSep: [0.2, 0.2, 0.2],
  // The width of separator lines in {array} environments. From
  // `\showthe\arrayrulewidth` in LaTeX. Equals 0.4 / ptPerEm.
  arrayRuleWidth: [0.04, 0.04, 0.04],
  // Two values from LaTeX source2e:
  fboxsep: [0.3, 0.3, 0.3],
  //        3 pt / ptPerEm
  fboxrule: [0.04, 0.04, 0.04]
  // 0.4 pt / ptPerEm
}, extraCharacterMap = {
  // 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 setFontMetrics(r, e) {
  fontMetricsData[r] = e;
}
function getCharacterMetrics(r, e, t) {
  if (!fontMetricsData[e])
    throw new Error("Font metrics not found for font: " + e + ".");
  var n = r.charCodeAt(0), a = fontMetricsData[e][n];
  if (!a && r[0] in extraCharacterMap && (n = extraCharacterMap[r[0]].charCodeAt(0), a = fontMetricsData[e][n]), !a && t === "text" && supportedCodepoint(n) && (a = fontMetricsData[e][77]), a)
    return {
      depth: a[0],
      height: a[1],
      italic: a[2],
      skew: a[3],
      width: a[4]
    };
}
var fontMetricsBySizeIndex = {};
function getGlobalMetrics(r) {
  var e;
  if (r >= 5 ? e = 0 : r >= 3 ? e = 1 : e = 2, !fontMetricsBySizeIndex[e]) {
    var t = fontMetricsBySizeIndex[e] = {
      cssEmPerMu: sigmasAndXis.quad[e] / 18
    };
    for (var n in sigmasAndXis)
      sigmasAndXis.hasOwnProperty(n) && (t[n] = sigmasAndXis[n][e]);
  }
  return fontMetricsBySizeIndex[e];
}
var sizeStyleMap = [
  // Each element contains [textsize, scriptsize, scriptscriptsize].
  // The size mappings are taken from TeX with \normalsize=10pt.
  [1, 1, 1],
  // size1: [5, 5, 5]              \tiny
  [2, 1, 1],
  // size2: [6, 5, 5]
  [3, 1, 1],
  // size3: [7, 5, 5]              \scriptsize
  [4, 2, 1],
  // size4: [8, 6, 5]              \footnotesize
  [5, 2, 1],
  // size5: [9, 6, 5]              \small
  [6, 3, 1],
  // size6: [10, 7, 5]             \normalsize
  [7, 4, 2],
  // size7: [12, 8, 6]             \large
  [8, 6, 3],
  // size8: [14.4, 10, 7]          \Large
  [9, 7, 6],
  // size9: [17.28, 12, 10]        \LARGE
  [10, 8, 7],
  // size10: [20.74, 14.4, 12]     \huge
  [11, 10, 9]
  // size11: [24.88, 20.74, 17.28] \HUGE
], sizeMultipliers = [
  // fontMetrics.js:getGlobalMetrics also uses size indexes, so if
  // you change size indexes, change that function.
  0.5,
  0.6,
  0.7,
  0.8,
  0.9,
  1,
  1.2,
  1.44,
  1.728,
  2.074,
  2.488
], sizeAtStyle = function(e, t) {
  return t.size < 2 ? e : sizeStyleMap[e - 1][t.size - 1];
};
class Options {
  // A font family applies to a group of fonts (i.e. SansSerif), while a font
  // represents a specific font (i.e. SansSerif Bold).
  // See: https://tex.stackexchange.com/questions/22350/difference-between-textrm-and-mathrm
  /**
   * The base size index.
   */
  constructor(e) {
    this.style = void 0, this.color = void 0, this.size = void 0, this.textSize = void 0, this.phantom = void 0, this.font = void 0, this.fontFamily = void 0, this.fontWeight = void 0, this.fontShape = void 0, this.sizeMultiplier = void 0, this.maxSize = void 0, this.minRuleThickness = void 0, this._fontMetrics = void 0, this.style = e.style, this.color = e.color, this.size = e.size || Options.BASESIZE, this.textSize = e.textSize || this.size, this.phantom = !!e.phantom, this.font = e.font || "", this.fontFamily = e.fontFamily || "", this.fontWeight = e.fontWeight || "", this.fontShape = e.fontShape || "", this.sizeMultiplier = sizeMultipliers[this.size - 1], this.maxSize = e.maxSize, this.minRuleThickness = e.minRuleThickness, this._fontMetrics = void 0;
  }
  /**
   * Returns a new options object with the same properties as "this".  Properties
   * from "extension" will be copied to the new options object.
   */
  extend(e) {
    var t = {
      style: this.style,
      size: this.size,
      textSize: this.textSize,
      color: this.color,
      phantom: this.phantom,
      font: this.font,
      fontFamily: this.fontFamily,
      fontWeight: this.fontWeight,
      fontShape: this.fontShape,
      maxSize: this.maxSize,
      minRuleThickness: this.minRuleThickness
    };
    for (var n in e)
      e.hasOwnProperty(n) && (t[n] = e[n]);
    return new Options(t);
  }
  /**
   * Return an options object with the given style. If `this.style === style`,
   * returns `this`.
   */
  havingStyle(e) {
    return this.style === e ? this : this.extend({
      style: e,
      size: sizeAtStyle(this.textSize, e)
    });
  }
  /**
   * Return an options object with a cramped version of the current style. If
   * the current style is cramped, returns `this`.
   */
  havingCrampedStyle() {
    return this.havingStyle(this.style.cramp());
  }
  /**
   * Return an options object with the given size and in at least `\textstyle`.
   * Returns `this` if appropriate.
   */
  havingSize(e) {
    return this.size === e && this.textSize === e ? this : this.extend({
      style: this.style.text(),
      size: e,
      textSize: e,
      sizeMultiplier: sizeMultipliers[e - 1]
    });
  }
  /**
   * Like `this.havingSize(BASESIZE).havingStyle(style)`. If `style` is omitted,
   * changes to at least `\textstyle`.
   */
  havingBaseStyle(e) {
    e = e || this.style.text();
    var t = sizeAtStyle(Options.BASESIZE, e);
    return this.size === t && this.textSize === Options.BASESIZE && this.style === e ? this : this.extend({
      style: e,
      size: t
    });
  }
  /**
   * Remove the effect of sizing changes such as \Huge.
   * Keep the effect of the current style, such as \scriptstyle.
   */
  havingBaseSizing() {
    var e;
    switch (this.style.id) {
      case 4:
      case 5:
        e = 3;
        break;
      case 6:
      case 7:
        e = 1;
        break;
      default:
        e = 6;
    }
    return this.extend({
      style: this.style.text(),
      size: e
    });
  }
  /**
   * Create a new options object with the given color.
   */
  withColor(e) {
    return this.extend({
      color: e
    });
  }
  /**
   * Create a new options object with "phantom" set to true.
   */
  withPhantom() {
    return this.extend({
      phantom: !0
    });
  }
  /**
   * Creates a new options object with the given math font or old text font.
   * @type {[type]}
   */
  withFont(e) {
    return this.extend({
      font: e
    });
  }
  /**
   * Create a new options objects with the given fontFamily.
   */
  withTextFontFamily(e) {
    return this.extend({
      fontFamily: e,
      font: ""
    });
  }
  /**
   * Creates a new options object with the given font weight
   */
  withTextFontWeight(e) {
    return this.extend({
      fontWeight: e,
      font: ""
    });
  }
  /**
   * Creates a new options object with the given font weight
   */
  withTextFontShape(e) {
    return this.extend({
      fontShape: e,
      font: ""
    });
  }
  /**
   * Return the CSS sizing classes required to switch from enclosing options
   * `oldOptions` to `this`. Returns an array of classes.
   */
  sizingClasses(e) {
    return e.size !== this.size ? ["sizing", "reset-size" + e.size, "size" + this.size] : [];
  }
  /**
   * Return the CSS sizing classes required to switch to the base size. Like
   * `this.havingSize(BASESIZE).sizingClasses(this)`.
   */
  baseSizingClasses() {
    return this.size !== Options.BASESIZE ? ["sizing", "reset-size" + this.size, "size" + Options.BASESIZE] : [];
  }
  /**
   * Return the font metrics for this size.
   */
  fontMetrics() {
    return this._fontMetrics || (this._fontMetrics = getGlobalMetrics(this.size)), this._fontMetrics;
  }
  /**
   * Gets the CSS color of the current options object
   */
  getColor() {
    return this.phantom ? "transparent" : this.color;
  }
}
Options.BASESIZE = 6;
var ptPerUnit = {
  // 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
}, relativeUnit = {
  ex: !0,
  em: !0,
  mu: !0
}, validUnit = function(e) {
  return typeof e != "string" && (e = e.unit), e in ptPerUnit || e in relativeUnit || e === "ex";
}, calculateSize = function(e, t) {
  var n;
  if (e.unit in ptPerUnit)
    n = ptPerUnit[e.unit] / t.fontMetrics().ptPerEm / t.sizeMultiplier;
  else if (e.unit === "mu")
    n = t.fontMetrics().cssEmPerMu;
  else {
    var a;
    if (t.style.isTight() ? a = t.havingStyle(t.style.text()) : a = t, e.unit === "ex")
      n = a.fontMetrics().xHeight;
    else if (e.unit === "em")
      n = a.fontMetrics().quad;
    else
      throw new ParseError("Invalid unit: '" + e.unit + "'");
    a !== t && (n *= a.sizeMultiplier / t.sizeMultiplier);
  }
  return Math.min(e.number * n, t.maxSize);
}, makeEm = function(e) {
  return +e.toFixed(4) + "em";
}, createClass = function(e) {
  return e.filter((t) => t).join(" ");
}, initNode = function(e, t, n) {
  if (this.classes = e || [], this.attributes = {}, this.height = 0, this.depth = 0, this.maxFontSize = 0, this.style = n || {}, t) {
    t.style.isTight() && this.classes.push("mtight");
    var a = t.getColor();
    a && (this.style.color = a);
  }
}, toNode = function(e) {
  var t = document.createElement(e);
  t.className = createClass(this.classes);
  for (var n in this.style)
    this.style.hasOwnProperty(n) && (t.style[n] = this.style[n]);
  for (var a in this.attributes)
    this.attributes.hasOwnProperty(a) && t.setAttribute(a, this.attributes[a]);
  for (var s = 0; s < this.children.length; s++)
    t.appendChild(this.children[s].toNode());
  return t;
}, toMarkup = function(e) {
  var t = "<" + e;
  this.classes.length && (t += ' class="' + utils.escape(createClass(this.classes)) + '"');
  var n = "";
  for (var a in this.style)
    this.style.hasOwnProperty(a) && (n += utils.hyphenate(a) + ":" + this.style[a] + ";");
  n && (t += ' style="' + utils.escape(n) + '"');
  for (var s in this.attributes)
    this.attributes.hasOwnProperty(s) && (t += " " + s + '="' + utils.escape(this.attributes[s]) + '"');
  t += ">";
  for (var o = 0; o < this.children.length; o++)
    t += this.children[o].toMarkup();
  return t += "</" + e + ">", t;
};
class Span {
  constructor(e, t, n, a) {
    this.children = void 0, this.attributes = void 0, this.classes = void 0, this.height = void 0, this.depth = void 0, this.width = void 0, this.maxFontSize = void 0, this.style = void 0, initNode.call(this, e, n, a), this.children = t || [];
  }
  /**
   * Sets an arbitrary attribute on the span. Warning: use this wisely. Not
   * all browsers support attributes the same, and having too many custom
   * attributes is probably bad.
   */
  setAttribute(e, t) {
    this.attributes[e] = t;
  }
  hasClass(e) {
    return utils.contains(this.classes, e);
  }
  toNode() {
    return toNode.call(this, "span");
  }
  toMarkup() {
    return toMarkup.call(this, "span");
  }
}
class Anchor {
  constructor(e, t, n, a) {
    this.children = void 0, this.attributes = void 0, this.classes = void 0, this.height = void 0, this.depth = void 0, this.maxFontSize = void 0, this.style = void 0, initNode.call(this, t, a), this.children = n || [], this.setAttribute("href", e);
  }
  setAttribute(e, t) {
    this.attributes[e] = t;
  }
  hasClass(e) {
    return utils.contains(this.classes, e);
  }
  toNode() {
    return toNode.call(this, "a");
  }
  toMarkup() {
    return toMarkup.call(this, "a");
  }
}
class Img {
  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 utils.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="' + utils.escape(this.src) + '"' + (' alt="' + utils.escape(this.alt) + '"'), t = "";
    for (var n in this.style)
      this.style.hasOwnProperty(n) && (t += utils.hyphenate(n) + ":" + this.style[n] + ";");
    return t && (e += ' style="' + utils.escape(t) + '"'), e += "'/>", e;
  }
}
var iCombinations = {
  î: "ı̂",
  ï: "ı̈",
  í: "ı́",
  // 'ī': '\u0131\u0304', // enable when we add Extended Latin
  ì: "ı̀"
};
class SymbolNode {
  constructor(e, t, n, a, s, o, c, l) {
    this.text = void 0, this.height = void 0, this.depth = void 0, this.italic = void 0, this.skew = void 0, this.width = void 0, this.maxFontSize = void 0, this.classes = void 0, this.style = void 0, this.text = e, this.height = t || 0, this.depth = n || 0, this.italic = a || 0, this.skew = s || 0, this.width = o || 0, this.classes = c || [], this.style = l || {}, this.maxFontSize = 0;
    var u = scriptFromCodepoint(this.text.charCodeAt(0));
    u && this.classes.push(u + "_fallback"), /[îïíì]/.test(this.text) && (this.text = iCombinations[this.text]);
  }
  hasClass(e) {
    return utils.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 = makeEm(this.italic)), this.classes.length > 0 && (t = t || document.createElement("span"), t.className = createClass(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 += utils.escape(createClass(this.classes)), t += '"');
    var n = "";
    this.italic > 0 && (n += "margin-right:" + this.italic + "em;");
    for (var a in this.style)
      this.style.hasOwnProperty(a) && (n += utils.hyphenate(a) + ":" + this.style[a] + ";");
    n && (e = !0, t += ' style="' + utils.escape(n) + '"');
    var s = utils.escape(this.text);
    return e ? (t += ">", t += s, t += "</span>", t) : s;
  }
}
class SvgNode {
  constructor(e, t) {
    this.children = void 0, this.attributes = void 0, this.children = e || [], this.attributes = t || {};
  }
  toNode() {
    var e = "http://www.w3.org/2000/svg", t = document.createElementNS(e, "svg");
    for (var n in this.attributes)
      Object.prototype.hasOwnProperty.call(this.attributes, n) && t.setAttribute(n, this.attributes[n]);
    for (var a = 0; a < this.children.length; a++)
      t.appendChild(this.children[a].toNode());
    return t;
  }
  toMarkup() {
    var e = '<svg xmlns="http://www.w3.org/2000/svg"';
    for (var t in this.attributes)
      Object.prototype.hasOwnProperty.call(this.attributes, t) && (e += " " + t + '="' + utils.escape(this.attributes[t]) + '"');
    e += ">";
    for (var n = 0; n < this.children.length; n++)
      e += this.children[n].toMarkup();
    return e += "</svg>", e;
  }
}
class PathNode {
  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", path[this.pathName]), t;
  }
  toMarkup() {
    return this.alternate ? '<path d="' + utils.escape(this.alternate) + '"/>' : '<path d="' + utils.escape(path[this.pathName]) + '"/>';
  }
}
class LineNode {
  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 + '="' + utils.escape(this.attributes[t]) + '"');
    return e += "/>", e;
  }
}
function assertSymbolDomNode(r) {
  if (r instanceof SymbolNode)
    return r;
  throw new Error("Expected symbolNode but got " + String(r) + ".");
}
function assertSpan(r) {
  if (r instanceof Span)
    return r;
  throw new Error("Expected span<HtmlDomNode> but got " + String(r) + ".");
}
var ATOMS = {
  bin: 1,
  close: 1,
  inner: 1,
  open: 1,
  punct: 1,
  rel: 1
}, NON_ATOMS = {
  "accent-token": 1,
  mathord: 1,
  "op-token": 1,
  spacing: 1,
  textord: 1
}, symbols = {
  math: {},
  text: {}
};
function defineSymbol(r, e, t, n, a, s) {
  symbols[r][a] = {
    font: e,
    group: t,
    replace: n
  }, s && n && (symbols[r][n] = symbols[r][a]);
}
var math = "math", text$2 = "text", main = "main", ams = "ams", accent = "accent-token", bin = "bin", close = "close", inner = "inner", mathord = "mathord", op = "op-token", open = "open", punct = "punct", rel = "rel", spacing = "spacing", textord = "textord";
defineSymbol(math, main, rel, "≡", "\\equiv", !0);
defineSymbol(math, main, rel, "≺", "\\prec", !0);
defineSymbol(math, main, rel, "≻", "\\succ", !0);
defineSymbol(math, main, rel, "∼", "\\sim", !0);
defineSymbol(math, main, rel, "⊥", "\\perp");
defineSymbol(math, main, rel, "⪯", "\\preceq", !0);
defineSymbol(math, main, rel, "⪰", "\\succeq", !0);
defineSymbol(math, main, rel, "≃", "\\simeq", !0);
defineSymbol(math, main, rel, "∣", "\\mid", !0);
defineSymbol(math, main, rel, "≪", "\\ll", !0);
defineSymbol(math, main, rel, "≫", "\\gg", !0);
defineSymbol(math, main, rel, "≍", "\\asymp", !0);
defineSymbol(math, main, rel, "∥", "\\parallel");
defineSymbol(math, main, rel, "⋈", "\\bowtie", !0);
defineSymbol(math, main, rel, "⌣", "\\smile", !0);
defineSymbol(math, main, rel, "⊑", "\\sqsubseteq", !0);
defineSymbol(math, main, rel, "⊒", "\\sqsupseteq", !0);
defineSymbol(math, main, rel, "≐", "\\doteq", !0);
defineSymbol(math, main, rel, "⌢", "\\frown", !0);
defineSymbol(math, main, rel, "∋", "\\ni", !0);
defineSymbol(math, main, rel, "∝", "\\propto", !0);
defineSymbol(math, main, rel, "⊢", "\\vdash", !0);
defineSymbol(math, main, rel, "⊣", "\\dashv", !0);
defineSymbol(math, main, rel, "∋", "\\owns");
defineSymbol(math, main, punct, ".", "\\ldotp");
defineSymbol(math, main, punct, "⋅", "\\cdotp");
defineSymbol(math, main, textord, "#", "\\#");
defineSymbol(text$2, main, textord, "#", "\\#");
defineSymbol(math, main, textord, "&", "\\&");
defineSymbol(text$2, main, textord, "&", "\\&");
defineSymbol(math, main, textord, "ℵ", "\\aleph", !0);
defineSymbol(math, main, textord, "∀", "\\forall", !0);
defineSymbol(math, main, textord, "ℏ", "\\hbar", !0);
defineSymbol(math, main, textord, "∃", "\\exists", !0);
defineSymbol(math, main, textord, "∇", "\\nabla", !0);
defineSymbol(math, main, textord, "♭", "\\flat", !0);
defineSymbol(math, main, textord, "ℓ", "\\ell", !0);
defineSymbol(math, main, textord, "♮", "\\natural", !0);
defineSymbol(math, main, textord, "♣", "\\clubsuit", !0);
defineSymbol(math, main, textord, "℘", "\\wp", !0);
defineSymbol(math, main, textord, "♯", "\\sharp", !0);
defineSymbol(math, main, textord, "♢", "\\diamondsuit", !0);
defineSymbol(math, main, textord, "ℜ", "\\Re", !0);
defineSymbol(math, main, textord, "♡", "\\heartsuit", !0);
defineSymbol(math, main, textord, "ℑ", "\\Im", !0);
defineSymbol(math, main, textord, "♠", "\\spadesuit", !0);
defineSymbol(math, main, textord, "§", "\\S", !0);
defineSymbol(text$2, main, textord, "§", "\\S");
defineSymbol(math, main, textord, "¶", "\\P", !0);
defineSymbol(text$2, main, textord, "¶", "\\P");
defineSymbol(math, main, textord, "†", "\\dag");
defineSymbol(text$2, main, textord, "†", "\\dag");
defineSymbol(text$2, main, textord, "†", "\\textdagger");
defineSymbol(math, main, textord, "‡", "\\ddag");
defineSymbol(text$2, main, textord, "‡", "\\ddag");
defineSymbol(text$2, main, textord, "‡", "\\textdaggerdbl");
defineSymbol(math, main, close, "⎱", "\\rmoustache", !0);
defineSymbol(math, main, open, "⎰", "\\lmoustache", !0);
defineSymbol(math, main, close, "⟯", "\\rgroup", !0);
defineSymbol(math, main, open, "⟮", "\\lgroup", !0);
defineSymbol(math, main, bin, "∓", "\\mp", !0);
defineSymbol(math, main, bin, "⊖", "\\ominus", !0);
defineSymbol(math, main, bin, "⊎", "\\uplus", !0);
defineSymbol(math, main, bin, "⊓", "\\sqcap", !0);
defineSymbol(math, main, bin, "∗", "\\ast");
defineSymbol(math, main, bin, "⊔", "\\sqcup", !0);
defineSymbol(math, main, bin, "◯", "\\bigcirc", !0);
defineSymbol(math, main, bin, "∙", "\\bullet", !0);
defineSymbol(math, main, bin, "‡", "\\ddagger");
defineSymbol(math, main, bin, "≀", "\\wr", !0);
defineSymbol(math, main, bin, "⨿", "\\amalg");
defineSymbol(math, main, bin, "&", "\\And");
defineSymbol(math, main, rel, "⟵", "\\longleftarrow", !0);
defineSymbol(math, main, rel, "⇐", "\\Leftarrow", !0);
defineSymbol(math, main, rel, "⟸", "\\Longleftarrow", !0);
defineSymbol(math, main, rel, "⟶", "\\longrightarrow", !0);
defineSymbol(math, main, rel, "⇒", "\\Rightarrow", !0);
defineSymbol(math, main, rel, "⟹", "\\Longrightarrow", !0);
defineSymbol(math, main, rel, "↔", "\\leftrightarrow", !0);
defineSymbol(math, main, rel, "⟷", "\\longleftrightarrow", !0);
defineSymbol(math, main, rel, "⇔", "\\Leftrightarrow", !0);
defineSymbol(math, main, rel, "⟺", "\\Longleftrightarrow", !0);
defineSymbol(math, main, rel, "↦", "\\mapsto", !0);
defineSymbol(math, main, rel, "⟼", "\\longmapsto", !0);
defineSymbol(math, main, rel, "↗", "\\nearrow", !0);
defineSymbol(math, main, rel, "↩", "\\hookleftarrow", !0);
defineSymbol(math, main, rel, "↪", "\\hookrightarrow", !0);
defineSymbol(math, main, rel, "↘", "\\searrow", !0);
defineSymbol(math, main, rel, "↼", "\\leftharpoonup", !0);
defineSymbol(math, main, rel, "⇀", "\\rightharpoonup", !0);
defineSymbol(math, main, rel, "↙", "\\swarrow", !0);
defineSymbol(math, main, rel, "↽", "\\leftharpoondown", !0);
defineSymbol(math, main, rel, "⇁", "\\rightharpoondown", !0);
defineSymbol(math, main, rel, "↖", "\\nwarrow", !0);
defineSymbol(math, main, rel, "⇌", "\\rightleftharpoons", !0);
defineSymbol(math, ams, rel, "≮", "\\nless", !0);
defineSymbol(math, ams, rel, "", "\\@nleqslant");
defineSymbol(math, ams, rel, "", "\\@nleqq");
defineSymbol(math, ams, rel, "⪇", "\\lneq", !0);
defineSymbol(math, ams, rel, "≨", "\\lneqq", !0);
defineSymbol(math, ams, rel, "", "\\@lvertneqq");
defineSymbol(math, ams, rel, "⋦", "\\lnsim", !0);
defineSymbol(math, ams, rel, "⪉", "\\lnapprox", !0);
defineSymbol(math, ams, rel, "⊀", "\\nprec", !0);
defineSymbol(math, ams, rel, "⋠", "\\npreceq", !0);
defineSymbol(math, ams, rel, "⋨", "\\precnsim", !0);
defineSymbol(math, ams, rel, "⪹", "\\precnapprox", !0);
defineSymbol(math, ams, rel, "≁", "\\nsim", !0);
defineSymbol(math, ams, rel, "", "\\@nshortmid");
defineSymbol(math, ams, rel, "∤", "\\nmid", !0);
defineSymbol(math, ams, rel, "⊬", "\\nvdash", !0);
defineSymbol(math, ams, rel, "⊭", "\\nvDash", !0);
defineSymbol(math, ams, rel, "⋪", "\\ntriangleleft");
defineSymbol(math, ams, rel, "⋬", "\\ntrianglelefteq", !0);
defineSymbol(math, ams, rel, "⊊", "\\subsetneq", !0);
defineSymbol(math, ams, rel, "", "\\@varsubsetneq");
defineSymbol(math, ams, rel, "⫋", "\\subsetneqq", !0);
defineSymbol(math, ams, rel, "", "\\@varsubsetneqq");
defineSymbol(math, ams, rel, "≯", "\\ngtr", !0);
defineSymbol(math, ams, rel, "", "\\@ngeqslant");
defineSymbol(math, ams, rel, "", "\\@ngeqq");
defineSymbol(math, ams, rel, "⪈", "\\gneq", !0);
defineSymbol(math, ams, rel, "≩", "\\gneqq", !0);
defineSymbol(math, ams, rel, "", "\\@gvertneqq");
defineSymbol(math, ams, rel, "⋧", "\\gnsim", !0);
defineSymbol(math, ams, rel, "⪊", "\\gnapprox", !0);
defineSymbol(math, ams, rel, "⊁", "\\nsucc", !0);
defineSymbol(math, ams, rel, "⋡", "\\nsucceq", !0);
defineSymbol(math, ams, rel, "⋩", "\\succnsim", !0);
defineSymbol(math, ams, rel, "⪺", "\\succnapprox", !0);
defineSymbol(math, ams, rel, "≆", "\\ncong", !0);
defineSymbol(math, ams, rel, "", "\\@nshortparallel");
defineSymbol(math, ams, rel, "∦", "\\nparallel", !0);
defineSymbol(math, ams, rel, "⊯", "\\nVDash", !0);
defineSymbol(math, ams, rel, "⋫", "\\ntriangleright");
defineSymbol(math, ams, rel, "⋭", "\\ntrianglerighteq", !0);
defineSymbol(math, ams, rel, "", "\\@nsupseteqq");
defineSymbol(math, ams, rel, "⊋", "\\supsetneq", !0);
defineSymbol(math, ams, rel, "", "\\@varsupsetneq");
defineSymbol(math, ams, rel, "⫌", "\\supsetneqq", !0);
defineSymbol(math, ams, rel, "", "\\@varsupsetneqq");
defineSymbol(math, ams, rel, "⊮", "\\nVdash", !0);
defineSymbol(math, ams, rel, "⪵", "\\precneqq", !0);
defineSymbol(math, ams, rel, "⪶", "\\succneqq", !0);
defineSymbol(math, ams, rel, "", "\\@nsubseteqq");
defineSymbol(math, ams, bin, "⊴", "\\unlhd");
defineSymbol(math, ams, bin, "⊵", "\\unrhd");
defineSymbol(math, ams, rel, "↚", "\\nleftarrow", !0);
defineSymbol(math, ams, rel, "↛", "\\nrightarrow", !0);
defineSymbol(math, ams, rel, "⇍", "\\nLeftarrow", !0);
defineSymbol(math, ams, rel, "⇏", "\\nRightarrow", !0);
defineSymbol(math, ams, rel, "↮", "\\nleftrightarrow", !0);
defineSymbol(math, ams, rel, "⇎", "\\nLeftrightarrow", !0);
defineSymbol(math, ams, rel, "△", "\\vartriangle");
defineSymbol(math, ams, textord, "ℏ", "\\hslash");
defineSymbol(math, ams, textord, "▽", "\\triangledown");
defineSymbol(math, ams, textord, "◊", "\\lozenge");
defineSymbol(math, ams, textord, "Ⓢ", "\\circledS");
defineSymbol(math, ams, textord, "®", "\\circledR");
defineSymbol(text$2, ams, textord, "®", "\\circledR");
defineSymbol(math, ams, textord, "∡", "\\measuredangle", !0);
defineSymbol(math, ams, textord, "∄", "\\nexists");
defineSymbol(math, ams, textord, "℧", "\\mho");
defineSymbol(math, ams, textord, "Ⅎ", "\\Finv", !0);
defineSymbol(math, ams, textord, "⅁", "\\Game", !0);
defineSymbol(math, ams, textord, "‵", "\\backprime");
defineSymbol(math, ams, textord, "▲", "\\blacktriangle");
defineSymbol(math, ams, textord, "▼", "\\blacktriangledown");
defineSymbol(math, ams, textord, "■", "\\blacksquare");
defineSymbol(math, ams, textord, "⧫", "\\blacklozenge");
defineSymbol(math, ams, textord, "★", "\\bigstar");
defineSymbol(math, ams, textord, "∢", "\\sphericalangle", !0);
defineSymbol(math, ams, textord, "∁", "\\complement", !0);
defineSymbol(math, ams, textord, "ð", "\\eth", !0);
defineSymbol(text$2, main, textord, "ð", "ð");
defineSymbol(math, ams, textord, "╱", "\\diagup");
defineSymbol(math, ams, textord, "╲", "\\diagdown");
defineSymbol(math, ams, textord, "□", "\\square");
defineSymbol(math, ams, textord, "□", "\\Box");
defineSymbol(math, ams, textord, "◊", "\\Diamond");
defineSymbol(math, ams, textord, "¥", "\\yen", !0);
defineSymbol(text$2, ams, textord, "¥", "\\yen", !0);
defineSymbol(math, ams, textord, "✓", "\\checkmark", !0);
defineSymbol(text$2, ams, textord, "✓", "\\checkmark");
defineSymbol(math, ams, textord, "ℶ", "\\beth", !0);
defineSymbol(math, ams, textord, "ℸ", "\\daleth", !0);
defineSymbol(math, ams, textord, "ℷ", "\\gimel", !0);
defineSymbol(math, ams, textord, "ϝ", "\\digamma", !0);
defineSymbol(math, ams, textord, "ϰ", "\\varkappa");
defineSymbol(math, ams, open, "┌", "\\@ulcorner", !0);
defineSymbol(math, ams, close, "┐", "\\@urcorner", !0);
defineSymbol(math, ams, open, "└", "\\@llcorner", !0);
defineSymbol(math, ams, close, "┘", "\\@lrcorner", !0);
defineSymbol(math, ams, rel, "≦", "\\leqq", !0);
defineSymbol(math, ams, rel, "⩽", "\\leqslant", !0);
defineSymbol(math, ams, rel, "⪕", "\\eqslantless", !0);
defineSymbol(math, ams, rel, "≲", "\\lesssim", !0);
defineSymbol(math, ams, rel, "⪅", "\\lessapprox", !0);
defineSymbol(math, ams, rel, "≊", "\\approxeq", !0);
defineSymbol(math, ams, bin, "⋖", "\\lessdot");
defineSymbol(math, ams, rel, "⋘", "\\lll", !0);
defineSymbol(math, ams, rel, "≶", "\\lessgtr", !0);
defineSymbol(math, ams, rel, "⋚", "\\lesseqgtr", !0);
defineSymbol(math, ams, rel, "⪋", "\\lesseqqgtr", !0);
defineSymbol(math, ams, rel, "≑", "\\doteqdot");
defineSymbol(math, ams, rel, "≓", "\\risingdotseq", !0);
defineSymbol(math, ams, rel, "≒", "\\fallingdotseq", !0);
defineSymbol(math, ams, rel, "∽", "\\backsim", !0);
defineSymbol(math, ams, rel, "⋍", "\\backsimeq", !0);
defineSymbol(math, ams, rel, "⫅", "\\subseteqq", !0);
defineSymbol(math, ams, rel, "⋐", "\\Subset", !0);
defineSymbol(math, ams, rel, "⊏", "\\sqsubset", !0);
defineSymbol(math, ams, rel, "≼", "\\preccurlyeq", !0);
defineSymbol(math, ams, rel, "⋞", "\\curlyeqprec", !0);
defineSymbol(math, ams, rel, "≾", "\\precsim", !0);
defineSymbol(math, ams, rel, "⪷", "\\precapprox", !0);
defineSymbol(math, ams, rel, "⊲", "\\vartriangleleft");
defineSymbol(math, ams, rel, "⊴", "\\trianglelefteq");
defineSymbol(math, ams, rel, "⊨", "\\vDash", !0);
defineSymbol(math, ams, rel, "⊪", "\\Vvdash", !0);
defineSymbol(math, ams, rel, "⌣", "\\smallsmile");
defineSymbol(math, ams, rel, "⌢", "\\smallfrown");
defineSymbol(math, ams, rel, "≏", "\\bumpeq", !0);
defineSymbol(math, ams, rel, "≎", "\\Bumpeq", !0);
defineSymbol(math, ams, rel, "≧", "\\geqq", !0);
defineSymbol(math, ams, rel, "⩾", "\\geqslant", !0);
defineSymbol(math, ams, rel, "⪖", "\\eqslantgtr", !0);
defineSymbol(math, ams, rel, "≳", "\\gtrsim", !0);
defineSymbol(math, ams, rel, "⪆", "\\gtrapprox", !0);
defineSymbol(math, ams, bin, "⋗", "\\gtrdot");
defineSymbol(math, ams, rel, "⋙", "\\ggg", !0);
defineSymbol(math, ams, rel, "≷", "\\gtrless", !0);
defineSymbol(math, ams, rel, "⋛", "\\gtreqless", !0);
defineSymbol(math, ams, rel, "⪌", "\\gtreqqless", !0);
defineSymbol(math, ams, rel, "≖", "\\eqcirc", !0);
defineSymbol(math, ams, rel, "≗", "\\circeq", !0);
defineSymbol(math, ams, rel, "≜", "\\triangleq", !0);
defineSymbol(math, ams, rel, "∼", "\\thicksim");
defineSymbol(math, ams, rel, "≈", "\\thickapprox");
defineSymbol(math, ams, rel, "⫆", "\\supseteqq", !0);
defineSymbol(math, ams, rel, "⋑", "\\Supset", !0);
defineSymbol(math, ams, rel, "⊐", "\\sqsupset", !0);
defineSymbol(math, ams, rel, "≽", "\\succcurlyeq", !0);
defineSymbol(math, ams, rel, "⋟", "\\curlyeqsucc", !0);
defineSymbol(math, ams, rel, "≿", "\\succsim", !0);
defineSymbol(math, ams, rel, "⪸", "\\succapprox", !0);
defineSymbol(math, ams, rel, "⊳", "\\vartriangleright");
defineSymbol(math, ams, rel, "⊵", "\\trianglerighteq");
defineSymbol(math, ams, rel, "⊩", "\\Vdash", !0);
defineSymbol(math, ams, rel, "∣", "\\shortmid");
defineSymbol(math, ams, rel, "∥", "\\shortparallel");
defineSymbol(math, ams, rel, "≬", "\\between", !0);
defineSymbol(math, ams, rel, "⋔", "\\pitchfork", !0);
defineSymbol(math, ams, rel, "∝", "\\varpropto");
defineSymbol(math, ams, rel, "◀", "\\blacktriangleleft");
defineSymbol(math, ams, rel, "∴", "\\therefore", !0);
defineSymbol(math, ams, rel, "∍", "\\backepsilon");
defineSymbol(math, ams, rel, "▶", "\\blacktriangleright");
defineSymbol(math, ams, rel, "∵", "\\because", !0);
defineSymbol(math, ams, rel, "⋘", "\\llless");
defineSymbol(math, ams, rel, "⋙", "\\gggtr");
defineSymbol(math, ams, bin, "⊲", "\\lhd");
defineSymbol(math, ams, bin, "⊳", "\\rhd");
defineSymbol(math, ams, rel, "≂", "\\eqsim", !0);
defineSymbol(math, main, rel, "⋈", "\\Join");
defineSymbol(math, ams, rel, "≑", "\\Doteq", !0);
defineSymbol(math, ams, bin, "∔", "\\dotplus", !0);
defineSymbol(math, ams, bin, "∖", "\\smallsetminus");
defineSymbol(math, ams, bin, "⋒", "\\Cap", !0);
defineSymbol(math, ams, bin, "⋓", "\\Cup", !0);
defineSymbol(math, ams, bin, "⩞", "\\doublebarwedge", !0);
defineSymbol(math, ams, bin, "⊟", "\\boxminus", !0);
defineSymbol(math, ams, bin, "⊞", "\\boxplus", !0);
defineSymbol(math, ams, bin, "⋇", "\\divideontimes", !0);
defineSymbol(math, ams, bin, "⋉", "\\ltimes", !0);
defineSymbol(math, ams, bin, "⋊", "\\rtimes", !0);
defineSymbol(math, ams, bin, "⋋", "\\leftthreetimes", !0);
defineSymbol(math, ams, bin, "⋌", "\\rightthreetimes", !0);
defineSymbol(math, ams, bin, "⋏", "\\curlywedge", !0);
defineSymbol(math, ams, bin, "⋎", "\\curlyvee", !0);
defineSymbol(math, ams, bin, "⊝", "\\circleddash", !0);
defineSymbol(math, ams, bin, "⊛", "\\circledast", !0);
defineSymbol(math, ams, bin, "⋅", "\\centerdot");
defineSymbol(math, ams, bin, "⊺", "\\intercal", !0);
defineSymbol(math, ams, bin, "⋒", "\\doublecap");
defineSymbol(math, ams, bin, "⋓", "\\doublecup");
defineSymbol(math, ams, bin, "⊠", "\\boxtimes", !0);
defineSymbol(math, ams, rel, "⇢", "\\dashrightarrow", !0);
defineSymbol(math, ams, rel, "⇠", "\\dashleftarrow", !0);
defineSymbol(math, ams, rel, "⇇", "\\leftleftarrows", !0);
defineSymbol(math, ams, rel, "⇆", "\\leftrightarrows", !0);
defineSymbol(math, ams, rel, "⇚", "\\Lleftarrow", !0);
defineSymbol(math, ams, rel, "↞", "\\twoheadleftarrow", !0);
defineSymbol(math, ams, rel, "↢", "\\leftarrowtail", !0);
defineSymbol(math, ams, rel, "↫", "\\looparrowleft", !0);
defineSymbol(math, ams, rel, "⇋", "\\leftrightharpoons", !0);
defineSymbol(math, ams, rel, "↶", "\\curvearrowleft", !0);
defineSymbol(math, ams, rel, "↺", "\\circlearrowleft", !0);
defineSymbol(math, ams, rel, "↰", "\\Lsh", !0);
defineSymbol(math, ams, rel, "⇈", "\\upuparrows", !0);
defineSymbol(math, ams, rel, "↿", "\\upharpoonleft", !0);
defineSymbol(math, ams, rel, "⇃", "\\downharpoonleft", !0);
defineSymbol(math, main, rel, "⊶", "\\origof", !0);
defineSymbol(math, main, rel, "⊷", "\\imageof", !0);
defineSymbol(math, ams, rel, "⊸", "\\multimap", !0);
defineSymbol(math, ams, rel, "↭", "\\leftrightsquigarrow", !0);
defineSymbol(math, ams, rel, "⇉", "\\rightrightarrows", !0);
defineSymbol(math, ams, rel, "⇄", "\\rightleftarrows", !0);
defineSymbol(math, ams, rel, "↠", "\\twoheadrightarrow", !0);
defineSymbol(math, ams, rel, "↣", "\\rightarrowtail", !0);
defineSymbol(math, ams, rel, "↬", "\\looparrowright", !0);
defineSymbol(math, ams, rel, "↷", "\\curvearrowright", !0);
defineSymbol(math, ams, rel, "↻", "\\circlearrowright", !0);
defineSymbol(math, ams, rel, "↱", "\\Rsh", !0);
defineSymbol(math, ams, rel, "⇊", "\\downdownarrows", !0);
defineSymbol(math, ams, rel, "↾", "\\upharpoonright", !0);
defineSymbol(math, ams, rel, "⇂", "\\downharpoonright", !0);
defineSymbol(math, ams, rel, "⇝", "\\rightsquigarrow", !0);
defineSymbol(math, ams, rel, "⇝", "\\leadsto");
defineSymbol(math, ams, rel, "⇛", "\\Rrightarrow", !0);
defineSymbol(math, ams, rel, "↾", "\\restriction");
defineSymbol(math, main, textord, "‘", "`");
defineSymbol(math, main, textord, "$", "\\$");
defineSymbol(text$2, main, textord, "$", "\\$");
defineSymbol(text$2, main, textord, "$", "\\textdollar");
defineSymbol(math, main, textord, "%", "\\%");
defineSymbol(text$2, main, textord, "%", "\\%");
defineSymbol(math, main, textord, "_", "\\_");
defineSymbol(text$2, main, textord, "_", "\\_");
defineSymbol(text$2, main, textord, "_", "\\textunderscore");
defineSymbol(math, main, textord, "∠", "\\angle", !0);
defineSymbol(math, main, textord, "∞", "\\infty", !0);
defineSymbol(math, main, textord, "′", "\\prime");
defineSymbol(math, main, textord, "△", "\\triangle");
defineSymbol(math, main, textord, "Γ", "\\Gamma", !0);
defineSymbol(math, main, textord, "Δ", "\\Delta", !0);
defineSymbol(math, main, textord, "Θ", "\\Theta", !0);
defineSymbol(math, main, textord, "Λ", "\\Lambda", !0);
defineSymbol(math, main, textord, "Ξ", "\\Xi", !0);
defineSymbol(math, main, textord, "Π", "\\Pi", !0);
defineSymbol(math, main, textord, "Σ", "\\Sigma", !0);
defineSymbol(math, main, textord, "Υ", "\\Upsilon", !0);
defineSymbol(math, main, textord, "Φ", "\\Phi", !0);
defineSymbol(math, main, textord, "Ψ", "\\Psi", !0);
defineSymbol(math, main, textord, "Ω", "\\Omega", !0);
defineSymbol(math, main, textord, "A", "Α");
defineSymbol(math, main, textord, "B", "Β");
defineSymbol(math, main, textord, "E", "Ε");
defineSymbol(math, main, textord, "Z", "Ζ");
defineSymbol(math, main, textord, "H", "Η");
defineSymbol(math, main, textord, "I", "Ι");
defineSymbol(math, main, textord, "K", "Κ");
defineSymbol(math, main, textord, "M", "Μ");
defineSymbol(math, main, textord, "N", "Ν");
defineSymbol(math, main, textord, "O", "Ο");
defineSymbol(math, main, textord, "P", "Ρ");
defineSymbol(math, main, textord, "T", "Τ");
defineSymbol(math, main, textord, "X", "Χ");
defineSymbol(math, main, textord, "¬", "\\neg", !0);
defineSymbol(math, main, textord, "¬", "\\lnot");
defineSymbol(math, main, textord, "⊤", "\\top");
defineSymbol(math, main, textord, "⊥", "\\bot");
defineSymbol(math, main, textord, "∅", "\\emptyset");
defineSymbol(math, ams, textord, "∅", "\\varnothing");
defineSymbol(math, main, mathord, "α", "\\alpha", !0);
defineSymbol(math, main, mathord, "β", "\\beta", !0);
defineSymbol(math, main, mathord, "γ", "\\gamma", !0);
defineSymbol(math, main, mathord, "δ", "\\delta", !0);
defineSymbol(math, main, mathord, "ϵ", "\\epsilon", !0);
defineSymbol(math, main, mathord, "ζ", "\\zeta", !0);
defineSymbol(math, main, mathord, "η", "\\eta", !0);
defineSymbol(math, main, mathord, "θ", "\\theta", !0);
defineSymbol(math, main, mathord, "ι", "\\iota", !0);
defineSymbol(math, main, mathord, "κ", "\\kappa", !0);
defineSymbol(math, main, mathord, "λ", "\\lambda", !0);
defineSymbol(math, main, mathord, "μ", "\\mu", !0);
defineSymbol(math, main, mathord, "ν", "\\nu", !0);
defineSymbol(math, main, mathord, "ξ", "\\xi", !0);
defineSymbol(math, main, mathord, "ο", "\\omicron", !0);
defineSymbol(math, main, mathord, "π", "\\pi", !0);
defineSymbol(math, main, mathord, "ρ", "\\rho", !0);
defineSymbol(math, main, mathord, "σ", "\\sigma", !0);
defineSymbol(math, main, mathord, "τ", "\\tau", !0);
defineSymbol(math, main, mathord, "υ", "\\upsilon", !0);
defineSymbol(math, main, mathord, "ϕ", "\\phi", !0);
defineSymbol(math, main, mathord, "χ", "\\chi", !0);
defineSymbol(math, main, mathord, "ψ", "\\psi", !0);
defineSymbol(math, main, mathord, "ω", "\\omega", !0);
defineSymbol(math, main, mathord, "ε", "\\varepsilon", !0);
defineSymbol(math, main, mathord, "ϑ", "\\vartheta", !0);
defineSymbol(math, main, mathord, "ϖ", "\\varpi", !0);
defineSymbol(math, main, mathord, "ϱ", "\\varrho", !0);
defineSymbol(math, main, mathord, "ς", "\\varsigma", !0);
defineSymbol(math, main, mathord, "φ", "\\varphi", !0);
defineSymbol(math, main, bin, "∗", "*", !0);
defineSymbol(math, main, bin, "+", "+");
defineSymbol(math, main, bin, "−", "-", !0);
defineSymbol(math, main, bin, "⋅", "\\cdot", !0);
defineSymbol(math, main, bin, "∘", "\\circ", !0);
defineSymbol(math, main, bin, "÷", "\\div", !0);
defineSymbol(math, main, bin, "±", "\\pm", !0);
defineSymbol(math, main, bin, "×", "\\times", !0);
defineSymbol(math, main, bin, "∩", "\\cap", !0);
defineSymbol(math, main, bin, "∪", "\\cup", !0);
defineSymbol(math, main, bin, "∖", "\\setminus", !0);
defineSymbol(math, main, bin, "∧", "\\land");
defineSymbol(math, main, bin, "∨", "\\lor");
defineSymbol(math, main, bin, "∧", "\\wedge", !0);
defineSymbol(math, main, bin, "∨", "\\vee", !0);
defineSymbol(math, main, textord, "√", "\\surd");
defineSymbol(math, main, open, "⟨", "\\langle", !0);
defineSymbol(math, main, open, "∣", "\\lvert");
defineSymbol(math, main, open, "∥", "\\lVert");
defineSymbol(math, main, close, "?", "?");
defineSymbol(math, main, close, "!", "!");
defineSymbol(math, main, close, "⟩", "\\rangle", !0);
defineSymbol(math, main, close, "∣", "\\rvert");
defineSymbol(math, main, close, "∥", "\\rVert");
defineSymbol(math, main, rel, "=", "=");
defineSymbol(math, main, rel, ":", ":");
defineSymbol(math, main, rel, "≈", "\\approx", !0);
defineSymbol(math, main, rel, "≅", "\\cong", !0);
defineSymbol(math, main, rel, "≥", "\\ge");
defineSymbol(math, main, rel, "≥", "\\geq", !0);
defineSymbol(math, main, rel, "←", "\\gets");
defineSymbol(math, main, rel, ">", "\\gt", !0);
defineSymbol(math, main, rel, "∈", "\\in", !0);
defineSymbol(math, main, rel, "", "\\@not");
defineSymbol(math, main, rel, "⊂", "\\subset", !0);
defineSymbol(math, main, rel, "⊃", "\\supset", !0);
defineSymbol(math, main, rel, "⊆", "\\subseteq", !0);
defineSymbol(math, main, rel, "⊇", "\\supseteq", !0);
defineSymbol(math, ams, rel, "⊈", "\\nsubseteq", !0);
defineSymbol(math, ams, rel, "⊉", "\\nsupseteq", !0);
defineSymbol(math, main, rel, "⊨", "\\models");
defineSymbol(math, main, rel, "←", "\\leftarrow", !0);
defineSymbol(math, main, rel, "≤", "\\le");
defineSymbol(math, main, rel, "≤", "\\leq", !0);
defineSymbol(math, main, rel, "<", "\\lt", !0);
defineSymbol(math, main, rel, "→", "\\rightarrow", !0);
defineSymbol(math, main, rel, "→", "\\to");
defineSymbol(math, ams, rel, "≱", "\\ngeq", !0);
defineSymbol(math, ams, rel, "≰", "\\nleq", !0);
defineSymbol(math, main, spacing, " ", "\\ ");
defineSymbol(math, main, spacing, " ", "\\space");
defineSymbol(math, main, spacing, " ", "\\nobreakspace");
defineSymbol(text$2, main, spacing, " ", "\\ ");
defineSymbol(text$2, main, spacing, " ", " ");
defineSymbol(text$2, main, spacing, " ", "\\space");
defineSymbol(text$2, main, spacing, " ", "\\nobreakspace");
defineSymbol(math, main, spacing, null, "\\nobreak");
defineSymbol(math, main, spacing, null, "\\allowbreak");
defineSymbol(math, main, punct, ",", ",");
defineSymbol(math, main, punct, ";", ";");
defineSymbol(math, ams, bin, "⊼", "\\barwedge", !0);
defineSymbol(math, ams, bin, "⊻", "\\veebar", !0);
defineSymbol(math, main, bin, "⊙", "\\odot", !0);
defineSymbol(math, main, bin, "⊕", "\\oplus", !0);
defineSymbol(math, main, bin, "⊗", "\\otimes", !0);
defineSymbol(math, main, textord, "∂", "\\partial", !0);
defineSymbol(math, main, bin, "⊘", "\\oslash", !0);
defineSymbol(math, ams, bin, "⊚", "\\circledcirc", !0);
defineSymbol(math, ams, bin, "⊡", "\\boxdot", !0);
defineSymbol(math, main, bin, "△", "\\bigtriangleup");
defineSymbol(math, main, bin, "▽", "\\bigtriangledown");
defineSymbol(math, main, bin, "†", "\\dagger");
defineSymbol(math, main, bin, "⋄", "\\diamond");
defineSymbol(math, main, bin, "⋆", "\\star");
defineSymbol(math, main, bin, "◃", "\\triangleleft");
defineSymbol(math, main, bin, "▹", "\\triangleright");
defineSymbol(math, main, open, "{", "\\{");
defineSymbol(text$2, main, textord, "{", "\\{");
defineSymbol(text$2, main, textord, "{", "\\textbraceleft");
defineSymbol(math, main, close, "}", "\\}");
defineSymbol(text$2, main, textord, "}", "\\}");
defineSymbol(text$2, main, textord, "}", "\\textbraceright");
defineSymbol(math, main, open, "{", "\\lbrace");
defineSymbol(math, main, close, "}", "\\rbrace");
defineSymbol(math, main, open, "[", "\\lbrack", !0);
defineSymbol(text$2, main, textord, "[", "\\lbrack", !0);
defineSymbol(math, main, close, "]", "\\rbrack", !0);
defineSymbol(text$2, main, textord, "]", "\\rbrack", !0);
defineSymbol(math, main, open, "(", "\\lparen", !0);
defineSymbol(math, main, close, ")", "\\rparen", !0);
defineSymbol(text$2, main, textord, "<", "\\textless", !0);
defineSymbol(text$2, main, textord, ">", "\\textgreater", !0);
defineSymbol(math, main, open, "⌊", "\\lfloor", !0);
defineSymbol(math, main, close, "⌋", "\\rfloor", !0);
defineSymbol(math, main, open, "⌈", "\\lceil", !0);
defineSymbol(math, main, close, "⌉", "\\rceil", !0);
defineSymbol(math, main, textord, "\\", "\\backslash");
defineSymbol(math, main, textord, "∣", "|");
defineSymbol(math, main, textord, "∣", "\\vert");
defineSymbol(text$2, main, textord, "|", "\\textbar", !0);
defineSymbol(math, main, textord, "∥", "\\|");
defineSymbol(math, main, textord, "∥", "\\Vert");
defineSymbol(text$2, main, textord, "∥", "\\textbardbl");
defineSymbol(text$2, main, textord, "~", "\\textasciitilde");
defineSymbol(text$2, main, textord, "\\", "\\textbackslash");
defineSymbol(text$2, main, textord, "^", "\\textasciicircum");
defineSymbol(math, main, rel, "↑", "\\uparrow", !0);
defineSymbol(math, main, rel, "⇑", "\\Uparrow", !0);
defineSymbol(math, main, rel, "↓", "\\downarrow", !0);
defineSymbol(math, main, rel, "⇓", "\\Downarrow", !0);
defineSymbol(math, main, rel, "↕", "\\updownarrow", !0);
defineSymbol(math, main, rel, "⇕", "\\Updownarrow", !0);
defineSymbol(math, main, op, "∐", "\\coprod");
defineSymbol(math, main, op, "⋁", "\\bigvee");
defineSymbol(math, main, op, "⋀", "\\bigwedge");
defineSymbol(math, main, op, "⨄", "\\biguplus");
defineSymbol(math, main, op, "⋂", "\\bigcap");
defineSymbol(math, main, op, "⋃", "\\bigcup");
defineSymbol(math, main, op, "∫", "\\int");
defineSymbol(math, main, op, "∫", "\\intop");
defineSymbol(math, main, op, "∬", "\\iint");
defineSymbol(math, main, op, "∭", "\\iiint");
defineSymbol(math, main, op, "∏", "\\prod");
defineSymbol(math, main, op, "∑", "\\sum");
defineSymbol(math, main, op, "⨂", "\\bigotimes");
defineSymbol(math, main, op, "⨁", "\\bigoplus");
defineSymbol(math, main, op, "⨀", "\\bigodot");
defineSymbol(math, main, op, "∮", "\\oint");
defineSymbol(math, main, op, "∯", "\\oiint");
defineSymbol(math, main, op, "∰", "\\oiiint");
defineSymbol(math, main, op, "⨆", "\\bigsqcup");
defineSymbol(math, main, op, "∫", "\\smallint");
defineSymbol(text$2, main, inner, "…", "\\textellipsis");
defineSymbol(math, main, inner, "…", "\\mathellipsis");
defineSymbol(text$2, main, inner, "…", "\\ldots", !0);
defineSymbol(math, main, inner, "…", "\\ldots", !0);
defineSymbol(math, main, inner, "⋯", "\\@cdots", !0);
defineSymbol(math, main, inner, "⋱", "\\ddots", !0);
defineSymbol(math, main, textord, "⋮", "\\varvdots");
defineSymbol(math, main, accent, "ˊ", "\\acute");
defineSymbol(math, main, accent, "ˋ", "\\grave");
defineSymbol(math, main, accent, "¨", "\\ddot");
defineSymbol(math, main, accent, "~", "\\tilde");
defineSymbol(math, main, accent, "ˉ", "\\bar");
defineSymbol(math, main, accent, "˘", "\\breve");
defineSymbol(math, main, accent, "ˇ", "\\check");
defineSymbol(math, main, accent, "^", "\\hat");
defineSymbol(math, main, accent, "⃗", "\\vec");
defineSymbol(math, main, accent, "˙", "\\dot");
defineSymbol(math, main, accent, "˚", "\\mathring");
defineSymbol(math, main, mathord, "", "\\@imath");
defineSymbol(math, main, mathord, "", "\\@jmath");
defineSymbol(math, main, textord, "ı", "ı");
defineSymbol(math, main, textord, "ȷ", "ȷ");
defineSymbol(text$2, main, textord, "ı", "\\i", !0);
defineSymbol(text$2, main, textord, "ȷ", "\\j", !0);
defineSymbol(text$2, main, textord, "ß", "\\ss", !0);
defineSymbol(text$2, main, textord, "æ", "\\ae", !0);
defineSymbol(text$2, main, textord, "œ", "\\oe", !0);
defineSymbol(text$2, main, textord, "ø", "\\o", !0);
defineSymbol(text$2, main, textord, "Æ", "\\AE", !0);
defineSymbol(text$2, main, textord, "Œ", "\\OE", !0);
defineSymbol(text$2, main, textord, "Ø", "\\O", !0);
defineSymbol(text$2, main, accent, "ˊ", "\\'");
defineSymbol(text$2, main, accent, "ˋ", "\\`");
defineSymbol(text$2, main, accent, "ˆ", "\\^");
defineSymbol(text$2, main, accent, "˜", "\\~");
defineSymbol(text$2, main, accent, "ˉ", "\\=");
defineSymbol(text$2, main, accent, "˘", "\\u");
defineSymbol(text$2, main, accent, "˙", "\\.");
defineSymbol(text$2, main, accent, "¸", "\\c");
defineSymbol(text$2, main, accent, "˚", "\\r");
defineSymbol(text$2, main, accent, "ˇ", "\\v");
defineSymbol(text$2, main, accent, "¨", '\\"');
defineSymbol(text$2, main, accent, "˝", "\\H");
defineSymbol(text$2, main, accent, "◯", "\\textcircled");
var ligatures = {
  "--": !0,
  "---": !0,
  "``": !0,
  "''": !0
};
defineSymbol(text$2, main, textord, "–", "--", !0);
defineSymbol(text$2, main, textord, "–", "\\textendash");
defineSymbol(text$2, main, textord, "—", "---", !0);
defineSymbol(text$2, main, textord, "—", "\\textemdash");
defineSymbol(text$2, main, textord, "‘", "`", !0);
defineSymbol(text$2, main, textord, "‘", "\\textquoteleft");
defineSymbol(text$2, main, textord, "’", "'", !0);
defineSymbol(text$2, main, textord, "’", "\\textquoteright");
defineSymbol(text$2, main, textord, "“", "``", !0);
defineSymbol(text$2, main, textord, "“", "\\textquotedblleft");
defineSymbol(text$2, main, textord, "”", "''", !0);
defineSymbol(text$2, main, textord, "”", "\\textquotedblright");
defineSymbol(math, main, textord, "°", "\\degree", !0);
defineSymbol(text$2, main, textord, "°", "\\degree");
defineSymbol(text$2, main, textord, "°", "\\textdegree", !0);
defineSymbol(math, main, textord, "£", "\\pounds");
defineSymbol(math, main, textord, "£", "\\mathsterling", !0);
defineSymbol(text$2, main, textord, "£", "\\pounds");
defineSymbol(text$2, main, textord, "£", "\\textsterling", !0);
defineSymbol(math, ams, textord, "✠", "\\maltese");
defineSymbol(text$2, ams, textord, "✠", "\\maltese");
var mathTextSymbols = '0123456789/@."';
for (var i = 0; i < mathTextSymbols.length; i++) {
  var ch = mathTextSymbols.charAt(i);
  defineSymbol(math, main, textord, ch, ch);
}
var textSymbols = '0123456789!@*()-=+";:?/.,';
for (var _i = 0; _i < textSymbols.length; _i++) {
  var _ch = textSymbols.charAt(_i);
  defineSymbol(text$2, main, textord, _ch, _ch);
}
var letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
for (var _i2 = 0; _i2 < letters.length; _i2++) {
  var _ch2 = letters.charAt(_i2);
  defineSymbol(math, main, mathord, _ch2, _ch2), defineSymbol(text$2, main, textord, _ch2, _ch2);
}
defineSymbol(math, ams, textord, "C", "ℂ");
defineSymbol(text$2, ams, textord, "C", "ℂ");
defineSymbol(math, ams, textord, "H", "ℍ");
defineSymbol(text$2, ams, textord, "H", "ℍ");
defineSymbol(math, ams, textord, "N", "ℕ");
defineSymbol(text$2, ams, textord, "N", "ℕ");
defineSymbol(math, ams, textord, "P", "ℙ");
defineSymbol(text$2, ams, textord, "P", "ℙ");
defineSymbol(math, ams, textord, "Q", "ℚ");
defineSymbol(text$2, ams, textord, "Q", "ℚ");
defineSymbol(math, ams, textord, "R", "ℝ");
defineSymbol(text$2, ams, textord, "R", "ℝ");
defineSymbol(math, ams, textord, "Z", "ℤ");
defineSymbol(text$2, ams, textord, "Z", "ℤ");
defineSymbol(math, main, mathord, "h", "ℎ");
defineSymbol(text$2, main, mathord, "h", "ℎ");
var wideChar = "";
for (var _i3 = 0; _i3 < letters.length; _i3++) {
  var _ch3 = letters.charAt(_i3);
  wideChar = String.fromCharCode(55349, 56320 + _i3), defineSymbol(math, main, mathord, _ch3, wideChar), defineSymbol(text$2, main, textord, _ch3, wideChar), wideChar = String.fromCharCode(55349, 56372 + _i3), defineSymbol(math, main, mathord, _ch3, wideChar), defineSymbol(text$2, main, textord, _ch3, wideChar), wideChar = String.fromCharCode(55349, 56424 + _i3), defineSymbol(math, main, mathord, _ch3, wideChar), defineSymbol(text$2, main, textord, _ch3, wideChar), wideChar = String.fromCharCode(55349, 56580 + _i3), defineSymbol(math, main, mathord, _ch3, wideChar), defineSymbol(text$2, main, textord, _ch3, wideChar), wideChar = String.fromCharCode(55349, 56684 + _i3), defineSymbol(math, main, mathord, _ch3, wideChar), defineSymbol(text$2, main, textord, _ch3, wideChar), wideChar = String.fromCharCode(55349, 56736 + _i3), defineSymbol(math, main, mathord, _ch3, wideChar), defineSymbol(text$2, main, textord, _ch3, wideChar), wideChar = String.fromCharCode(55349, 56788 + _i3), defineSymbol(math, main, mathord, _ch3, wideChar), defineSymbol(text$2, main, textord, _ch3, wideChar), wideChar = String.fromCharCode(55349, 56840 + _i3), defineSymbol(math, main, mathord, _ch3, wideChar), defineSymbol(text$2, main, textord, _ch3, wideChar), wideChar = String.fromCharCode(55349, 56944 + _i3), defineSymbol(math, main, mathord, _ch3, wideChar), defineSymbol(text$2, main, textord, _ch3, wideChar), _i3 < 26 && (wideChar = String.fromCharCode(55349, 56632 + _i3), defineSymbol(math, main, mathord, _ch3, wideChar), defineSymbol(text$2, main, textord, _ch3, wideChar), wideChar = String.fromCharCode(55349, 56476 + _i3), defineSymbol(math, main, mathord, _ch3, wideChar), defineSymbol(text$2, main, textord, _ch3, wideChar));
}
wideChar = "𝕜";
defineSymbol(math, main, mathord, "k", wideChar);
defineSymbol(text$2, main, textord, "k", wideChar);
for (var _i4 = 0; _i4 < 10; _i4++) {
  var _ch4 = _i4.toString();
  wideChar = String.fromCharCode(55349, 57294 + _i4), defineSymbol(math, main, mathord, _ch4, wideChar), defineSymbol(text$2, main, textord, _ch4, wideChar), wideChar = String.fromCharCode(55349, 57314 + _i4), defineSymbol(math, main, mathord, _ch4, wideChar), defineSymbol(text$2, main, textord, _ch4, wideChar), wideChar = String.fromCharCode(55349, 57324 + _i4), defineSymbol(math, main, mathord, _ch4, wideChar), defineSymbol(text$2, main, textord, _ch4, wideChar), wideChar = String.fromCharCode(55349, 57334 + _i4), defineSymbol(math, main, mathord, _ch4, wideChar), defineSymbol(text$2, main, textord, _ch4, wideChar);
}
var extraLatin = "ÐÞþ";
for (var _i5 = 0; _i5 < extraLatin.length; _i5++) {
  var _ch5 = extraLatin.charAt(_i5);
  defineSymbol(math, main, mathord, _ch5, _ch5), defineSymbol(text$2, main, textord, _ch5, _ch5);
}
var wideLatinLetterData = [
  ["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
], wideNumeralData = [
  ["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
], wideCharacterFont = function(e, t) {
  var n = e.charCodeAt(0), a = e.charCodeAt(1), s = (n - 55296) * 1024 + (a - 56320) + 65536, o = t === "math" ? 0 : 1;
  if (119808 <= s && s < 120484) {
    var c = Math.floor((s - 119808) / 26);
    return [wideLatinLetterData[c][2], wideLatinLetterData[c][o]];
  } else if (120782 <= s && s <= 120831) {
    var l = Math.floor((s - 120782) / 10);
    return [wideNumeralData[l][2], wideNumeralData[l][o]];
  } else {
    if (s === 120485 || s === 120486)
      return [wideLatinLetterData[0][2], wideLatinLetterData[0][o]];
    if (120486 < s && s < 120782)
      return ["", ""];
    throw new ParseError("Unsupported character: " + e);
  }
}, lookupSymbol = function(e, t, n) {
  return symbols[n][e] && symbols[n][e].replace && (e = symbols[n][e].replace), {
    value: e,
    metrics: getCharacterMetrics(e, t, n)
  };
}, makeSymbol = function(e, t, n, a, s) {
  var o = lookupSymbol(e, t, n), c = o.metrics;
  e = o.value;
  var l;
  if (c) {
    var u = c.italic;
    (n === "text" || a && a.font === "mathit") && (u = 0), l = new SymbolNode(e, c.height, c.depth, u, c.skew, c.width, s);
  } else
    typeof console < "u" && console.warn("No character metrics " + ("for '" + e + "' in style '" + t + "' and mode '" + n + "'")), l = new SymbolNode(e, 0, 0, 0, 0, 0, s);
  if (a) {
    l.maxFontSize = a.sizeMultiplier, a.style.isTight() && l.classes.push("mtight");
    var h = a.getColor();
    h && (l.style.color = h);
  }
  return l;
}, mathsym = function(e, t, n, a) {
  return a === void 0 && (a = []), n.font === "boldsymbol" && lookupSymbol(e, "Main-Bold", t).metrics ? makeSymbol(e, "Main-Bold", t, n, a.concat(["mathbf"])) : e === "\\" || symbols[t][e].font === "main" ? makeSymbol(e, "Main-Regular", t, n, a) : makeSymbol(e, "AMS-Regular", t, n, a.concat(["amsrm"]));
}, boldsymbol = function(e, t, n, a, s) {
  return s !== "textord" && lookupSymbol(e, "Math-BoldItalic", t).metrics ? {
    fontName: "Math-BoldItalic",
    fontClass: "boldsymbol"
  } : {
    fontName: "Main-Bold",
    fontClass: "mathbf"
  };
}, makeOrd = function(e, t, n) {
  var a = e.mode, s = e.text, o = ["mord"], c = a === "math" || a === "text" && t.font, l = c ? t.font : t.fontFamily, u = "", h = "";
  if (s.charCodeAt(0) === 55349 && ([u, h] = wideCharacterFont(s, a)), u.length > 0)
    return makeSymbol(s, u, a, t, o.concat(h));
  if (l) {
    var d, w;
    if (l === "boldsymbol") {
      var b = boldsymbol(s, a, t, o, n);
      d = b.fontName, w = [b.fontClass];
    } else c ? (d = fontMap[l].fontName, w = [l]) : (d = retrieveTextFontName(l, t.fontWeight, t.fontShape), w = [l, t.fontWeight, t.fontShape]);
    if (lookupSymbol(s, d, a).metrics)
      return makeSymbol(s, d, a, t, o.concat(w));
    if (ligatures.hasOwnProperty(s) && d.slice(0, 10) === "Typewriter") {
      for (var _ = [], R = 0; R < s.length; R++)
        _.push(makeSymbol(s[R], d, a, t, o.concat(w)));
      return makeFragment(_);
    }
  }
  if (n === "mathord")
    return makeSymbol(s, "Math-Italic", a, t, o.concat(["mathnormal"]));
  if (n === "textord") {
    var k = symbols[a][s] && symbols[a][s].font;
    if (k === "ams") {
      var C = retrieveTextFontName("amsrm", t.fontWeight, t.fontShape);
      return makeSymbol(s, C, a, t, o.concat("amsrm", t.fontWeight, t.fontShape));
    } else if (k === "main" || !k) {
      var m = retrieveTextFontName("textrm", t.fontWeight, t.fontShape);
      return makeSymbol(s, m, a, t, o.concat(t.fontWeight, t.fontShape));
    } else {
      var A = retrieveTextFontName(k, t.fontWeight, t.fontShape);
      return makeSymbol(s, A, a, t, o.concat(A, t.fontWeight, t.fontShape));
    }
  } else
    throw new Error("unexpected type: " + n + " in makeOrd");
}, canCombine = (r, e) => {
  if (createClass(r.classes) !== createClass(e.classes) || r.skew !== e.skew || r.maxFontSize !== e.maxFontSize)
    return !1;
  if (r.classes.length === 1) {
    var t = r.classes[0];
    if (t === "mbin" || t === "mord")
      return !1;
  }
  for (var n in r.style)
    if (r.style.hasOwnProperty(n) && r.style[n] !== e.style[n])
      return !1;
  for (var a in e.style)
    if (e.style.hasOwnProperty(a) && r.style[a] !== e.style[a])
      return !1;
  return !0;
}, tryCombineChars = (r) => {
  for (var e = 0; e < r.length - 1; e++) {
    var t = r[e], n = r[e + 1];
    t instanceof SymbolNode && n instanceof SymbolNode && canCombine(t, n) && (t.text += n.text, t.height = Math.max(t.height, n.height), t.depth = Math.max(t.depth, n.depth), t.italic = n.italic, r.splice(e + 1, 1), e--);
  }
  return r;
}, sizeElementFromChildren = function(e) {
  for (var t = 0, n = 0, a = 0, s = 0; s < e.children.length; s++) {
    var o = e.children[s];
    o.height > t && (t = o.height), o.depth > n && (n = o.depth), o.maxFontSize > a && (a = o.maxFontSize);
  }
  e.height = t, e.depth = n, e.maxFontSize = a;
}, makeSpan$2 = function(e, t, n, a) {
  var s = new Span(e, t, n, a);
  return sizeElementFromChildren(s), s;
}, makeSvgSpan = (r, e, t, n) => new Span(r, e, t, n), makeLineSpan = function(e, t, n) {
  var a = makeSpan$2([e], [], t);
  return a.height = Math.max(n || t.fontMetrics().defaultRuleThickness, t.minRuleThickness), a.style.borderBottomWidth = makeEm(a.height), a.maxFontSize = 1, a;
}, makeAnchor = function(e, t, n, a) {
  var s = new Anchor(e, t, n, a);
  return sizeElementFromChildren(s), s;
}, makeFragment = function(e) {
  var t = new DocumentFragment(e);
  return sizeElementFromChildren(t), t;
}, wrapFragment = function(e, t) {
  return e instanceof DocumentFragment ? makeSpan$2([], [e], t) : e;
}, getVListChildrenAndDepth = function(e) {
  if (e.positionType === "individualShift") {
    for (var t = e.children, n = [t[0]], a = -t[0].shift - t[0].elem.depth, s = a, o = 1; o < t.length; o++) {
      var c = -t[o].shift - s - t[o].elem.depth, l = c - (t[o - 1].elem.height + t[o - 1].elem.depth);
      s = s + c, n.push({
        type: "kern",
        size: l
      }), n.push(t[o]);
    }
    return {
      children: n,
      depth: a
    };
  }
  var u;
  if (e.positionType === "top") {
    for (var h = e.positionData, d = 0; d < e.children.length; d++) {
      var w = e.children[d];
      h -= w.type === "kern" ? w.size : w.elem.height + w.elem.depth;
    }
    u = h;
  } else if (e.positionType === "bottom")
    u = -e.positionData;
  else {
    var b = e.children[0];
    if (b.type !== "elem")
      throw new Error('First child must have type "elem".');
    if (e.positionType === "shift")
      u = -b.elem.depth - e.positionData;
    else if (e.positionType === "firstBaseline")
      u = -b.elem.depth;
    else
      throw new Error("Invalid positionType " + e.positionType + ".");
  }
  return {
    children: e.children,
    depth: u
  };
}, makeVList = function(e, t) {
  for (var {
    children: n,
    depth: a
  } = getVListChildrenAndDepth(e), s = 0, o = 0; o < n.length; o++) {
    var c = n[o];
    if (c.type === "elem") {
      var l = c.elem;
      s = Math.max(s, l.maxFontSize, l.height);
    }
  }
  s += 2;
  var u = makeSpan$2(["pstrut"], []);
  u.style.height = makeEm(s);
  for (var h = [], d = a, w = a, b = a, _ = 0; _ < n.length; _++) {
    var R = n[_];
    if (R.type === "kern")
      b += R.size;
    else {
      var k = R.elem, C = R.wrapperClasses || [], m = R.wrapperStyle || {}, A = makeSpan$2(C, [u, k], void 0, m);
      A.style.top = makeEm(-s - b - k.depth), R.marginLeft && (A.style.marginLeft = R.marginLeft), R.marginRight && (A.style.marginRight = R.marginRight), h.push(A), b += k.height + k.depth;
    }
    d = Math.min(d, b), w = Math.max(w, b);
  }
  var F = makeSpan$2(["vlist"], h);
  F.style.height = makeEm(w);
  var f;
  if (d < 0) {
    var g = makeSpan$2([], []), y = makeSpan$2(["vlist"], [g]);
    y.style.height = makeEm(-d);
    var E = makeSpan$2(["vlist-s"], [new SymbolNode("​")]);
    f = [makeSpan$2(["vlist-r"], [F, E]), makeSpan$2(["vlist-r"], [y])];
  } else
    f = [makeSpan$2(["vlist-r"], [F])];
  var x = makeSpan$2(["vlist-t"], f);
  return f.length === 2 && x.classes.push("vlist-t2"), x.height = w, x.depth = -d, x;
}, makeGlue = (r, e) => {
  var t = makeSpan$2(["mspace"], [], e), n = calculateSize(r, e);
  return t.style.marginRight = makeEm(n), t;
}, retrieveTextFontName = function(e, t, n) {
  var a = "";
  switch (e) {
    case "amsrm":
      a = "AMS";
      break;
    case "textrm":
      a = "Main";
      break;
    case "textsf":
      a = "SansSerif";
      break;
    case "texttt":
      a = "Typewriter";
      break;
    default:
      a = e;
  }
  var s;
  return t === "textbf" && n === "textit" ? s = "BoldItalic" : t === "textbf" ? s = "Bold" : t === "textit" ? s = "Italic" : s = "Regular", a + "-" + s;
}, fontMap = {
  // 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"
  }
}, svgData = {
  //   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]
}, staticSvg = function(e, t) {
  var [n, a, s] = svgData[e], o = new PathNode(n), c = new SvgNode([o], {
    width: makeEm(a),
    height: makeEm(s),
    // Override CSS rule `.katex svg { width: 100% }`
    style: "width:" + makeEm(a),
    viewBox: "0 0 " + 1e3 * a + " " + 1e3 * s,
    preserveAspectRatio: "xMinYMin"
  }), l = makeSvgSpan(["overlay"], [c], t);
  return l.height = s, l.style.height = makeEm(s), l.style.width = makeEm(a), l;
}, buildCommon = {
  fontMap,
  makeSymbol,
  mathsym,
  makeSpan: makeSpan$2,
  makeSvgSpan,
  makeLineSpan,
  makeAnchor,
  makeFragment,
  wrapFragment,
  makeVList,
  makeOrd,
  makeGlue,
  staticSvg,
  svgData,
  tryCombineChars
}, thinspace = {
  number: 3,
  unit: "mu"
}, mediumspace = {
  number: 4,
  unit: "mu"
}, thickspace = {
  number: 5,
  unit: "mu"
}, spacings = {
  mord: {
    mop: thinspace,
    mbin: mediumspace,
    mrel: thickspace,
    minner: thinspace
  },
  mop: {
    mord: thinspace,
    mop: thinspace,
    mrel: thickspace,
    minner: thinspace
  },
  mbin: {
    mord: mediumspace,
    mop: mediumspace,
    mopen: mediumspace,
    minner: mediumspace
  },
  mrel: {
    mord: thickspace,
    mop: thickspace,
    mopen: thickspace,
    minner: thickspace
  },
  mopen: {},
  mclose: {
    mop: thinspace,
    mbin: mediumspace,
    mrel: thickspace,
    minner: thinspace
  },
  mpunct: {
    mord: thinspace,
    mop: thinspace,
    mrel: thickspace,
    mopen: thinspace,
    mclose: thinspace,
    mpunct: thinspace,
    minner: thinspace
  },
  minner: {
    mord: thinspace,
    mop: thinspace,
    mbin: mediumspace,
    mrel: thickspace,
    mopen: thinspace,
    mpunct: thinspace,
    minner: thinspace
  }
}, tightSpacings = {
  mord: {
    mop: thinspace
  },
  mop: {
    mord: thinspace,
    mop: thinspace
  },
  mbin: {},
  mrel: {},
  mopen: {},
  mclose: {
    mop: thinspace
  },
  mpunct: {},
  minner: {
    mop: thinspace
  }
}, _functions = {}, _htmlGroupBuilders = {}, _mathmlGroupBuilders = {};
function defineFunction(r) {
  for (var {
    type: e,
    names: t,
    props: n,
    handler: a,
    htmlBuilder: s,
    mathmlBuilder: o
  } = r, c = {
    type: e,
    numArgs: n.numArgs,
    argTypes: n.argTypes,
    allowedInArgument: !!n.allowedInArgument,
    allowedInText: !!n.allowedInText,
    allowedInMath: n.allowedInMath === void 0 ? !0 : n.allowedInMath,
    numOptionalArgs: n.numOptionalArgs || 0,
    infix: !!n.infix,
    primitive: !!n.primitive,
    handler: a
  }, l = 0; l < t.length; ++l)
    _functions[t[l]] = c;
  e && (s && (_htmlGroupBuilders[e] = s), o && (_mathmlGroupBuilders[e] = o));
}
function defineFunctionBuilders(r) {
  var {
    type: e,
    htmlBuilder: t,
    mathmlBuilder: n
  } = r;
  defineFunction({
    type: e,
    names: [],
    props: {
      numArgs: 0
    },
    handler() {
      throw new Error("Should never be called.");
    },
    htmlBuilder: t,
    mathmlBuilder: n
  });
}
var normalizeArgument = function(e) {
  return e.type === "ordgroup" && e.body.length === 1 ? e.body[0] : e;
}, ordargument = function(e) {
  return e.type === "ordgroup" ? e.body : [e];
}, makeSpan$1 = buildCommon.makeSpan, binLeftCanceller = ["leftmost", "mbin", "mopen", "mrel", "mop", "mpunct"], binRightCanceller = ["rightmost", "mrel", "mclose", "mpunct"], styleMap$1 = {
  display: Style$1.DISPLAY,
  text: Style$1.TEXT,
  script: Style$1.SCRIPT,
  scriptscript: Style$1.SCRIPTSCRIPT
}, DomEnum = {
  mord: "mord",
  mop: "mop",
  mbin: "mbin",
  mrel: "mrel",
  mopen: "mopen",
  mclose: "mclose",
  mpunct: "mpunct",
  minner: "minner"
}, buildExpression$1 = function(e, t, n, a) {
  a === void 0 && (a = [null, null]);
  for (var s = [], o = 0; o < e.length; o++) {
    var c = buildGroup$1(e[o], t);
    if (c instanceof DocumentFragment) {
      var l = c.children;
      s.push(...l);
    } else
      s.push(c);
  }
  if (buildCommon.tryCombineChars(s), !n)
    return s;
  var u = t;
  if (e.length === 1) {
    var h = e[0];
    h.type === "sizing" ? u = t.havingSize(h.size) : h.type === "styling" && (u = t.havingStyle(styleMap$1[h.style]));
  }
  var d = makeSpan$1([a[0] || "leftmost"], [], t), w = makeSpan$1([a[1] || "rightmost"], [], t), b = n === "root";
  return traverseNonSpaceNodes(s, (_, R) => {
    var k = R.classes[0], C = _.classes[0];
    k === "mbin" && utils.contains(binRightCanceller, C) ? R.classes[0] = "mord" : C === "mbin" && utils.contains(binLeftCanceller, k) && (_.classes[0] = "mord");
  }, {
    node: d
  }, w, b), traverseNonSpaceNodes(s, (_, R) => {
    var k = getTypeOfDomTree(R), C = getTypeOfDomTree(_), m = k && C ? _.hasClass("mtight") ? tightSpacings[k][C] : spacings[k][C] : null;
    if (m)
      return buildCommon.makeGlue(m, u);
  }, {
    node: d
  }, w, b), s;
}, traverseNonSpaceNodes = function r(e, t, n, a, s) {
  a && e.push(a);
  for (var o = 0; o < e.length; o++) {
    var c = e[o], l = checkPartialGroup(c);
    if (l) {
      r(l.children, t, n, null, s);
      continue;
    }
    var u = !c.hasClass("mspace");
    if (u) {
      var h = t(c, n.node);
      h && (n.insertAfter ? n.insertAfter(h) : (e.unshift(h), o++));
    }
    u ? n.node = c : s && c.hasClass("newline") && (n.node = makeSpan$1(["leftmost"])), n.insertAfter = /* @__PURE__ */ ((d) => (w) => {
      e.splice(d + 1, 0, w), o++;
    })(o);
  }
  a && e.pop();
}, checkPartialGroup = function(e) {
  return e instanceof DocumentFragment || e instanceof Anchor || e instanceof Span && e.hasClass("enclosing") ? e : null;
}, getOutermostNode = function r(e, t) {
  var n = checkPartialGroup(e);
  if (n) {
    var a = n.children;
    if (a.length) {
      if (t === "right")
        return r(a[a.length - 1], "right");
      if (t === "left")
        return r(a[0], "left");
    }
  }
  return e;
}, getTypeOfDomTree = function(e, t) {
  return e ? (t && (e = getOutermostNode(e, t)), DomEnum[e.classes[0]] || null) : null;
}, makeNullDelimiter = function(e, t) {
  var n = ["nulldelimiter"].concat(e.baseSizingClasses());
  return makeSpan$1(t.concat(n));
}, buildGroup$1 = function(e, t, n) {
  if (!e)
    return makeSpan$1();
  if (_htmlGroupBuilders[e.type]) {
    var a = _htmlGroupBuilders[e.type](e, t);
    if (n && t.size !== n.size) {
      a = makeSpan$1(t.sizingClasses(n), [a], t);
      var s = t.sizeMultiplier / n.sizeMultiplier;
      a.height *= s, a.depth *= s;
    }
    return a;
  } else
    throw new ParseError("Got group of unknown type: '" + e.type + "'");
};
function buildHTMLUnbreakable(r, e) {
  var t = makeSpan$1(["base"], r, e), n = makeSpan$1(["strut"]);
  return n.style.height = makeEm(t.height + t.depth), t.depth && (n.style.verticalAlign = makeEm(-t.depth)), t.children.unshift(n), t;
}
function buildHTML(r, e) {
  var t = null;
  r.length === 1 && r[0].type === "tag" && (t = r[0].tag, r = r[0].body);
  var n = buildExpression$1(r, e, "root"), a;
  n.length === 2 && n[1].hasClass("tag") && (a = n.pop());
  for (var s = [], o = [], c = 0; c < n.length; c++)
    if (o.push(n[c]), n[c].hasClass("mbin") || n[c].hasClass("mrel") || n[c].hasClass("allowbreak")) {
      for (var l = !1; c < n.length - 1 && n[c + 1].hasClass("mspace") && !n[c + 1].hasClass("newline"); )
        c++, o.push(n[c]), n[c].hasClass("nobreak") && (l = !0);
      l || (s.push(buildHTMLUnbreakable(o, e)), o = []);
    } else n[c].hasClass("newline") && (o.pop(), o.length > 0 && (s.push(buildHTMLUnbreakable(o, e)), o = []), s.push(n[c]));
  o.length > 0 && s.push(buildHTMLUnbreakable(o, e));
  var u;
  t ? (u = buildHTMLUnbreakable(buildExpression$1(t, e, !0)), u.classes = ["tag"], s.push(u)) : a && s.push(a);
  var h = makeSpan$1(["katex-html"], s);
  if (h.setAttribute("aria-hidden", "true"), u) {
    var d = u.children[0];
    d.style.height = makeEm(h.height + h.depth), h.depth && (d.style.verticalAlign = makeEm(-h.depth));
  }
  return h;
}
function newDocumentFragment(r) {
  return new DocumentFragment(r);
}
class MathNode {
  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 = createClass(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 += utils.escape(this.attributes[t]), e += '"');
    this.classes.length > 0 && (e += ' class ="' + utils.escape(createClass(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 TextNode {
  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 utils.escape(this.toText());
  }
  /**
   * Converts the text node into a string
   * (representing the text itself).
   */
  toText() {
    return this.text;
  }
}
class SpaceNode {
  /**
   * 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", makeEm(this.width)), e;
  }
  /**
   * Converts the math node into an HTML markup string.
   */
  toMarkup() {
    return this.character ? "<mtext>" + this.character + "</mtext>" : '<mspace width="' + makeEm(this.width) + '"/>';
  }
  /**
   * Converts the math node into a string, similar to innerText.
   */
  toText() {
    return this.character ? this.character : " ";
  }
}
var mathMLTree = {
  MathNode,
  TextNode,
  SpaceNode,
  newDocumentFragment
}, makeText = function(e, t, n) {
  return symbols[t][e] && symbols[t][e].replace && e.charCodeAt(0) !== 55349 && !(ligatures.hasOwnProperty(e) && n && (n.fontFamily && n.fontFamily.slice(4, 6) === "tt" || n.font && n.font.slice(4, 6) === "tt")) && (e = symbols[t][e].replace), new mathMLTree.TextNode(e);
}, makeRow = function(e) {
  return e.length === 1 ? e[0] : new mathMLTree.MathNode("mrow", e);
}, getVariant = function(e, t) {
  if (t.fontFamily === "texttt")
    return "monospace";
  if (t.fontFamily === "textsf")
    return t.fontShape === "textit" && t.fontWeight === "textbf" ? "sans-serif-bold-italic" : t.fontShape === "textit" ? "sans-serif-italic" : t.fontWeight === "textbf" ? "bold-sans-serif" : "sans-serif";
  if (t.fontShape === "textit" && t.fontWeight === "textbf")
    return "bold-italic";
  if (t.fontShape === "textit")
    return "italic";
  if (t.fontWeight === "textbf")
    return "bold";
  var n = t.font;
  if (!n || n === "mathnormal")
    return null;
  var a = e.mode;
  if (n === "mathit")
    return "italic";
  if (n === "boldsymbol")
    return e.type === "textord" ? "bold" : "bold-italic";
  if (n === "mathbf")
    return "bold";
  if (n === "mathbb")
    return "double-struck";
  if (n === "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 (utils.contains(["\\imath", "\\jmath"], s))
    return null;
  symbols[a][s] && symbols[a][s].replace && (s = symbols[a][s].replace);
  var o = buildCommon.fontMap[n].fontName;
  return getCharacterMetrics(s, o, a) ? buildCommon.fontMap[n].variant : null;
}, buildExpression = function(e, t, n) {
  if (e.length === 1) {
    var a = buildGroup(e[0], t);
    return n && a instanceof MathNode && a.type === "mo" && (a.setAttribute("lspace", "0em"), a.setAttribute("rspace", "0em")), [a];
  }
  for (var s = [], o, c = 0; c < e.length; c++) {
    var l = buildGroup(e[c], t);
    if (l instanceof MathNode && o instanceof MathNode) {
      if (l.type === "mtext" && o.type === "mtext" && l.getAttribute("mathvariant") === o.getAttribute("mathvariant")) {
        o.children.push(...l.children);
        continue;
      } else if (l.type === "mn" && o.type === "mn") {
        o.children.push(...l.children);
        continue;
      } else if (l.type === "mi" && l.children.length === 1 && o.type === "mn") {
        var u = l.children[0];
        if (u instanceof TextNode && u.text === ".") {
          o.children.push(...l.children);
          continue;
        }
      } else if (o.type === "mi" && o.children.length === 1) {
        var h = o.children[0];
        if (h instanceof TextNode && h.text === "̸" && (l.type === "mo" || l.type === "mi" || l.type === "mn")) {
          var d = l.children[0];
          d instanceof TextNode && d.text.length > 0 && (d.text = d.text.slice(0, 1) + "̸" + d.text.slice(1), s.pop());
        }
      }
    }
    s.push(l), o = l;
  }
  return s;
}, buildExpressionRow = function(e, t, n) {
  return makeRow(buildExpression(e, t, n));
}, buildGroup = function(e, t) {
  if (!e)
    return new mathMLTree.MathNode("mrow");
  if (_mathmlGroupBuilders[e.type]) {
    var n = _mathmlGroupBuilders[e.type](e, t);
    return n;
  } else
    throw new ParseError("Got group of unknown type: '" + e.type + "'");
};
function buildMathML(r, e, t, n, a) {
  var s = buildExpression(r, t), o;
  s.length === 1 && s[0] instanceof MathNode && utils.contains(["mrow", "mtable"], s[0].type) ? o = s[0] : o = new mathMLTree.MathNode("mrow", s);
  var c = new mathMLTree.MathNode("annotation", [new mathMLTree.TextNode(e)]);
  c.setAttribute("encoding", "application/x-tex");
  var l = new mathMLTree.MathNode("semantics", [o, c]), u = new mathMLTree.MathNode("math", [l]);
  u.setAttribute("xmlns", "http://www.w3.org/1998/Math/MathML"), n && u.setAttribute("display", "block");
  var h = a ? "katex" : "katex-mathml";
  return buildCommon.makeSpan([h], [u]);
}
var optionsFromSettings = function(e) {
  return new Options({
    style: e.displayMode ? Style$1.DISPLAY : Style$1.TEXT,
    maxSize: e.maxSize,
    minRuleThickness: e.minRuleThickness
  });
}, displayWrap = function(e, t) {
  if (t.displayMode) {
    var n = ["katex-display"];
    t.leqno && n.push("leqno"), t.fleqn && n.push("fleqn"), e = buildCommon.makeSpan(n, [e]);
  }
  return e;
}, buildTree = function(e, t, n) {
  var a = optionsFromSettings(n), s;
  if (n.output === "mathml")
    return buildMathML(e, t, a, n.displayMode, !0);
  if (n.output === "html") {
    var o = buildHTML(e, a);
    s = buildCommon.makeSpan(["katex"], [o]);
  } else {
    var c = buildMathML(e, t, a, n.displayMode, !1), l = buildHTML(e, a);
    s = buildCommon.makeSpan(["katex"], [c, l]);
  }
  return displayWrap(s, n);
}, buildHTMLTree = function(e, t, n) {
  var a = optionsFromSettings(n), s = buildHTML(e, a), o = buildCommon.makeSpan(["katex"], [s]);
  return displayWrap(o, n);
}, stretchyCodePoint = {
  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": "="
}, mathMLnode = function(e) {
  var t = new mathMLTree.MathNode("mo", [new mathMLTree.TextNode(stretchyCodePoint[e.replace(/^\\/, "")])]);
  return t.setAttribute("stretchy", "true"), t;
}, katexImagesData = {
  //   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]
}, groupLength = function(e) {
  return e.type === "ordgroup" ? e.body.length : 1;
}, svgSpan = function(e, t) {
  function n() {
    var c = 4e5, l = e.label.slice(1);
    if (utils.contains(["widehat", "widecheck", "widetilde", "utilde"], l)) {
      var u = e, h = groupLength(u.base), d, w, b;
      if (h > 5)
        l === "widehat" || l === "widecheck" ? (d = 420, c = 2364, b = 0.42, w = l + "4") : (d = 312, c = 2340, b = 0.34, w = "tilde4");
      else {
        var _ = [1, 1, 2, 2, 3, 3][h];
        l === "widehat" || l === "widecheck" ? (c = [0, 1062, 2364, 2364, 2364][_], d = [0, 239, 300, 360, 420][_], b = [0, 0.24, 0.3, 0.3, 0.36, 0.42][_], w = l + _) : (c = [0, 600, 1033, 2339, 2340][_], d = [0, 260, 286, 306, 312][_], b = [0, 0.26, 0.286, 0.3, 0.306, 0.34][_], w = "tilde" + _);
      }
      var R = new PathNode(w), k = new SvgNode([R], {
        width: "100%",
        height: makeEm(b),
        viewBox: "0 0 " + c + " " + d,
        preserveAspectRatio: "none"
      });
      return {
        span: buildCommon.makeSvgSpan([], [k], t),
        minWidth: 0,
        height: b
      };
    } else {
      var C = [], m = katexImagesData[l], [A, F, f] = m, g = f / 1e3, y = A.length, E, x;
      if (y === 1) {
        var O = m[3];
        E = ["hide-tail"], x = [O];
      } else if (y === 2)
        E = ["halfarrow-left", "halfarrow-right"], x = ["xMinYMin", "xMaxYMin"];
      else if (y === 3)
        E = ["brace-left", "brace-center", "brace-right"], x = ["xMinYMin", "xMidYMin", "xMaxYMin"];
      else
        throw new Error(`Correct katexImagesData or update code here to support
                    ` + y + " children.");
      for (var P = 0; P < y; P++) {
        var I = new PathNode(A[P]), G = new SvgNode([I], {
          width: "400em",
          height: makeEm(g),
          viewBox: "0 0 " + c + " " + f,
          preserveAspectRatio: x[P] + " slice"
        }), ne = buildCommon.makeSvgSpan([E[P]], [G], t);
        if (y === 1)
          return {
            span: ne,
            minWidth: F,
            height: g
          };
        ne.style.height = makeEm(g), C.push(ne);
      }
      return {
        span: buildCommon.makeSpan(["stretchy"], C, t),
        minWidth: F,
        height: g
      };
    }
  }
  var {
    span: a,
    minWidth: s,
    height: o
  } = n();
  return a.height = o, a.style.height = makeEm(o), s > 0 && (a.style.minWidth = makeEm(s)), a;
}, encloseSpan = function(e, t, n, a, s) {
  var o, c = e.height + e.depth + n + a;
  if (/fbox|color|angl/.test(t)) {
    if (o = buildCommon.makeSpan(["stretchy", t], [], s), t === "fbox") {
      var l = s.color && s.getColor();
      l && (o.style.borderColor = l);
    }
  } else {
    var u = [];
    /^[bx]cancel$/.test(t) && u.push(new LineNode({
      x1: "0",
      y1: "0",
      x2: "100%",
      y2: "100%",
      "stroke-width": "0.046em"
    })), /^x?cancel$/.test(t) && u.push(new LineNode({
      x1: "0",
      y1: "100%",
      x2: "100%",
      y2: "0",
      "stroke-width": "0.046em"
    }));
    var h = new SvgNode(u, {
      width: "100%",
      height: makeEm(c)
    });
    o = buildCommon.makeSvgSpan([], [h], s);
  }
  return o.height = c, o.style.height = makeEm(c), o;
}, stretchy = {
  encloseSpan,
  mathMLnode,
  svgSpan
};
function assertNodeType(r, e) {
  if (!r || r.type !== e)
    throw new Error("Expected node of type " + e + ", but got " + (r ? "node of type " + r.type : String(r)));
  return r;
}
function assertSymbolNodeType(r) {
  var e = checkSymbolNodeType(r);
  if (!e)
    throw new Error("Expected node of symbol group type, but got " + (r ? "node of type " + r.type : String(r)));
  return e;
}
function checkSymbolNodeType(r) {
  return r && (r.type === "atom" || NON_ATOMS.hasOwnProperty(r.type)) ? r : null;
}
var htmlBuilder$a = (r, e) => {
  var t, n, a;
  r && r.type === "supsub" ? (n = assertNodeType(r.base, "accent"), t = n.base, r.base = t, a = assertSpan(buildGroup$1(r, e)), r.base = n) : (n = assertNodeType(r, "accent"), t = n.base);
  var s = buildGroup$1(t, e.havingCrampedStyle()), o = n.isShifty && utils.isCharacterBox(t), c = 0;
  if (o) {
    var l = utils.getBaseElem(t), u = buildGroup$1(l, e.havingCrampedStyle());
    c = assertSymbolDomNode(u).skew;
  }
  var h = n.label === "\\c", d = h ? s.height + s.depth : Math.min(s.height, e.fontMetrics().xHeight), w;
  if (n.isStretchy)
    w = stretchy.svgSpan(n, e), w = buildCommon.makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: s
      }, {
        type: "elem",
        elem: w,
        wrapperClasses: ["svg-align"],
        wrapperStyle: c > 0 ? {
          width: "calc(100% - " + makeEm(2 * c) + ")",
          marginLeft: makeEm(2 * c)
        } : void 0
      }]
    }, e);
  else {
    var b, _;
    n.label === "\\vec" ? (b = buildCommon.staticSvg("vec", e), _ = buildCommon.svgData.vec[1]) : (b = buildCommon.makeOrd({
      mode: n.mode,
      text: n.label
    }, e, "textord"), b = assertSymbolDomNode(b), b.italic = 0, _ = b.width, h && (d += b.depth)), w = buildCommon.makeSpan(["accent-body"], [b]);
    var R = n.label === "\\textcircled";
    R && (w.classes.push("accent-full"), d = s.height);
    var k = c;
    R || (k -= _ / 2), w.style.left = makeEm(k), n.label === "\\textcircled" && (w.style.top = ".2em"), w = buildCommon.makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: s
      }, {
        type: "kern",
        size: -d
      }, {
        type: "elem",
        elem: w
      }]
    }, e);
  }
  var C = buildCommon.makeSpan(["mord", "accent"], [w], e);
  return a ? (a.children[0] = C, a.height = Math.max(C.height, a.height), a.classes[0] = "mord", a) : C;
}, mathmlBuilder$9 = (r, e) => {
  var t = r.isStretchy ? stretchy.mathMLnode(r.label) : new mathMLTree.MathNode("mo", [makeText(r.label, r.mode)]), n = new mathMLTree.MathNode("mover", [buildGroup(r.base, e), t]);
  return n.setAttribute("accent", "true"), n;
}, NON_STRETCHY_ACCENT_REGEX = new RegExp(["\\acute", "\\grave", "\\ddot", "\\tilde", "\\bar", "\\breve", "\\check", "\\hat", "\\vec", "\\dot", "\\mathring"].map((r) => "\\" + r).join("|"));
defineFunction({
  type: "accent",
  names: ["\\acute", "\\grave", "\\ddot", "\\tilde", "\\bar", "\\breve", "\\check", "\\hat", "\\vec", "\\dot", "\\mathring", "\\widecheck", "\\widehat", "\\widetilde", "\\overrightarrow", "\\overleftarrow", "\\Overrightarrow", "\\overleftrightarrow", "\\overgroup", "\\overlinesegment", "\\overleftharpoon", "\\overrightharpoon"],
  props: {
    numArgs: 1
  },
  handler: (r, e) => {
    var t = normalizeArgument(e[0]), n = !NON_STRETCHY_ACCENT_REGEX.test(r.funcName), a = !n || r.funcName === "\\widehat" || r.funcName === "\\widetilde" || r.funcName === "\\widecheck";
    return {
      type: "accent",
      mode: r.parser.mode,
      label: r.funcName,
      isStretchy: n,
      isShifty: a,
      base: t
    };
  },
  htmlBuilder: htmlBuilder$a,
  mathmlBuilder: mathmlBuilder$9
});
defineFunction({
  type: "accent",
  names: ["\\'", "\\`", "\\^", "\\~", "\\=", "\\u", "\\.", '\\"', "\\c", "\\r", "\\H", "\\v", "\\textcircled"],
  props: {
    numArgs: 1,
    allowedInText: !0,
    allowedInMath: !0,
    // unless in strict mode
    argTypes: ["primitive"]
  },
  handler: (r, e) => {
    var t = e[0], n = r.parser.mode;
    return n === "math" && (r.parser.settings.reportNonstrict("mathVsTextAccents", "LaTeX's accent " + r.funcName + " works only in text mode"), n = "text"), {
      type: "accent",
      mode: n,
      label: r.funcName,
      isStretchy: !1,
      isShifty: !0,
      base: t
    };
  },
  htmlBuilder: htmlBuilder$a,
  mathmlBuilder: mathmlBuilder$9
});
defineFunction({
  type: "accentUnder",
  names: ["\\underleftarrow", "\\underrightarrow", "\\underleftrightarrow", "\\undergroup", "\\underlinesegment", "\\utilde"],
  props: {
    numArgs: 1
  },
  handler: (r, e) => {
    var {
      parser: t,
      funcName: n
    } = r, a = e[0];
    return {
      type: "accentUnder",
      mode: t.mode,
      label: n,
      base: a
    };
  },
  htmlBuilder: (r, e) => {
    var t = buildGroup$1(r.base, e), n = stretchy.svgSpan(r, e), a = r.label === "\\utilde" ? 0.12 : 0, s = buildCommon.makeVList({
      positionType: "top",
      positionData: t.height,
      children: [{
        type: "elem",
        elem: n,
        wrapperClasses: ["svg-align"]
      }, {
        type: "kern",
        size: a
      }, {
        type: "elem",
        elem: t
      }]
    }, e);
    return buildCommon.makeSpan(["mord", "accentunder"], [s], e);
  },
  mathmlBuilder: (r, e) => {
    var t = stretchy.mathMLnode(r.label), n = new mathMLTree.MathNode("munder", [buildGroup(r.base, e), t]);
    return n.setAttribute("accentunder", "true"), n;
  }
});
var paddedNode = (r) => {
  var e = new mathMLTree.MathNode("mpadded", r ? [r] : []);
  return e.setAttribute("width", "+0.6em"), e.setAttribute("lspace", "0.3em"), e;
};
defineFunction({
  type: "xArrow",
  names: [
    "\\xleftarrow",
    "\\xrightarrow",
    "\\xLeftarrow",
    "\\xRightarrow",
    "\\xleftrightarrow",
    "\\xLeftrightarrow",
    "\\xhookleftarrow",
    "\\xhookrightarrow",
    "\\xmapsto",
    "\\xrightharpoondown",
    "\\xrightharpoonup",
    "\\xleftharpoondown",
    "\\xleftharpoonup",
    "\\xrightleftharpoons",
    "\\xleftrightharpoons",
    "\\xlongequal",
    "\\xtwoheadrightarrow",
    "\\xtwoheadleftarrow",
    "\\xtofrom",
    // The next 3 functions are here to support the mhchem extension.
    // Direct use of these functions is discouraged and may break someday.
    "\\xrightleftarrows",
    "\\xrightequilibrium",
    "\\xleftequilibrium",
    // The next 3 functions are here only to support the {CD} environment.
    "\\\\cdrightarrow",
    "\\\\cdleftarrow",
    "\\\\cdlongequal"
  ],
  props: {
    numArgs: 1,
    numOptionalArgs: 1
  },
  handler(r, e, t) {
    var {
      parser: n,
      funcName: a
    } = r;
    return {
      type: "xArrow",
      mode: n.mode,
      label: a,
      body: e[0],
      below: t[0]
    };
  },
  // Flow is unable to correctly infer the type of `group`, even though it's
  // unambiguously determined from the passed-in `type` above.
  htmlBuilder(r, e) {
    var t = e.style, n = e.havingStyle(t.sup()), a = buildCommon.wrapFragment(buildGroup$1(r.body, n, e), e), s = r.label.slice(0, 2) === "\\x" ? "x" : "cd";
    a.classes.push(s + "-arrow-pad");
    var o;
    r.below && (n = e.havingStyle(t.sub()), o = buildCommon.wrapFragment(buildGroup$1(r.below, n, e), e), o.classes.push(s + "-arrow-pad"));
    var c = stretchy.svgSpan(r, e), l = -e.fontMetrics().axisHeight + 0.5 * c.height, u = -e.fontMetrics().axisHeight - 0.5 * c.height - 0.111;
    (a.depth > 0.25 || r.label === "\\xleftequilibrium") && (u -= a.depth);
    var h;
    if (o) {
      var d = -e.fontMetrics().axisHeight + o.height + 0.5 * c.height + 0.111;
      h = buildCommon.makeVList({
        positionType: "individualShift",
        children: [{
          type: "elem",
          elem: a,
          shift: u
        }, {
          type: "elem",
          elem: c,
          shift: l
        }, {
          type: "elem",
          elem: o,
          shift: d
        }]
      }, e);
    } else
      h = buildCommon.makeVList({
        positionType: "individualShift",
        children: [{
          type: "elem",
          elem: a,
          shift: u
        }, {
          type: "elem",
          elem: c,
          shift: l
        }]
      }, e);
    return h.children[0].children[0].children[1].classes.push("svg-align"), buildCommon.makeSpan(["mrel", "x-arrow"], [h], e);
  },
  mathmlBuilder(r, e) {
    var t = stretchy.mathMLnode(r.label);
    t.setAttribute("minsize", r.label.charAt(0) === "x" ? "1.75em" : "3.0em");
    var n;
    if (r.body) {
      var a = paddedNode(buildGroup(r.body, e));
      if (r.below) {
        var s = paddedNode(buildGroup(r.below, e));
        n = new mathMLTree.MathNode("munderover", [t, s, a]);
      } else
        n = new mathMLTree.MathNode("mover", [t, a]);
    } else if (r.below) {
      var o = paddedNode(buildGroup(r.below, e));
      n = new mathMLTree.MathNode("munder", [t, o]);
    } else
      n = paddedNode(), n = new mathMLTree.MathNode("mover", [t, n]);
    return n;
  }
});
var makeSpan = buildCommon.makeSpan;
function htmlBuilder$9(r, e) {
  var t = buildExpression$1(r.body, e, !0);
  return makeSpan([r.mclass], t, e);
}
function mathmlBuilder$8(r, e) {
  var t, n = buildExpression(r.body, e);
  return r.mclass === "minner" ? t = new mathMLTree.MathNode("mpadded", n) : r.mclass === "mord" ? r.isCharacterBox ? (t = n[0], t.type = "mi") : t = new mathMLTree.MathNode("mi", n) : (r.isCharacterBox ? (t = n[0], t.type = "mo") : t = new mathMLTree.MathNode("mo", n), r.mclass === "mbin" ? (t.attributes.lspace = "0.22em", t.attributes.rspace = "0.22em") : r.mclass === "mpunct" ? (t.attributes.lspace = "0em", t.attributes.rspace = "0.17em") : r.mclass === "mopen" || r.mclass === "mclose" ? (t.attributes.lspace = "0em", t.attributes.rspace = "0em") : r.mclass === "minner" && (t.attributes.lspace = "0.0556em", t.attributes.width = "+0.1111em")), t;
}
defineFunction({
  type: "mclass",
  names: ["\\mathord", "\\mathbin", "\\mathrel", "\\mathopen", "\\mathclose", "\\mathpunct", "\\mathinner"],
  props: {
    numArgs: 1,
    primitive: !0
  },
  handler(r, e) {
    var {
      parser: t,
      funcName: n
    } = r, a = e[0];
    return {
      type: "mclass",
      mode: t.mode,
      mclass: "m" + n.slice(5),
      // TODO(kevinb): don't prefix with 'm'
      body: ordargument(a),
      isCharacterBox: utils.isCharacterBox(a)
    };
  },
  htmlBuilder: htmlBuilder$9,
  mathmlBuilder: mathmlBuilder$8
});
var binrelClass = (r) => {
  var e = r.type === "ordgroup" && r.body.length ? r.body[0] : r;
  return e.type === "atom" && (e.family === "bin" || e.family === "rel") ? "m" + e.family : "mord";
};
defineFunction({
  type: "mclass",
  names: ["\\@binrel"],
  props: {
    numArgs: 2
  },
  handler(r, e) {
    var {
      parser: t
    } = r;
    return {
      type: "mclass",
      mode: t.mode,
      mclass: binrelClass(e[0]),
      body: ordargument(e[1]),
      isCharacterBox: utils.isCharacterBox(e[1])
    };
  }
});
defineFunction({
  type: "mclass",
  names: ["\\stackrel", "\\overset", "\\underset"],
  props: {
    numArgs: 2
  },
  handler(r, e) {
    var {
      parser: t,
      funcName: n
    } = r, a = e[1], s = e[0], o;
    n !== "\\stackrel" ? o = binrelClass(a) : o = "mrel";
    var c = {
      type: "op",
      mode: a.mode,
      limits: !0,
      alwaysHandleSupSub: !0,
      parentIsSupSub: !1,
      symbol: !1,
      suppressBaseShift: n !== "\\stackrel",
      body: ordargument(a)
    }, l = {
      type: "supsub",
      mode: s.mode,
      base: c,
      sup: n === "\\underset" ? null : s,
      sub: n === "\\underset" ? s : null
    };
    return {
      type: "mclass",
      mode: t.mode,
      mclass: o,
      body: [l],
      isCharacterBox: utils.isCharacterBox(l)
    };
  },
  htmlBuilder: htmlBuilder$9,
  mathmlBuilder: mathmlBuilder$8
});
defineFunction({
  type: "pmb",
  names: ["\\pmb"],
  props: {
    numArgs: 1,
    allowedInText: !0
  },
  handler(r, e) {
    var {
      parser: t
    } = r;
    return {
      type: "pmb",
      mode: t.mode,
      mclass: binrelClass(e[0]),
      body: ordargument(e[0])
    };
  },
  htmlBuilder(r, e) {
    var t = buildExpression$1(r.body, e, !0), n = buildCommon.makeSpan([r.mclass], t, e);
    return n.style.textShadow = "0.02em 0.01em 0.04px", n;
  },
  mathmlBuilder(r, e) {
    var t = buildExpression(r.body, e), n = new mathMLTree.MathNode("mstyle", t);
    return n.setAttribute("style", "text-shadow: 0.02em 0.01em 0.04px"), n;
  }
});
var cdArrowFunctionName = {
  ">": "\\\\cdrightarrow",
  "<": "\\\\cdleftarrow",
  "=": "\\\\cdlongequal",
  A: "\\uparrow",
  V: "\\downarrow",
  "|": "\\Vert",
  ".": "no arrow"
}, newCell = () => ({
  type: "styling",
  body: [],
  mode: "math",
  style: "display"
}), isStartOfArrow = (r) => r.type === "textord" && r.text === "@", isLabelEnd = (r, e) => (r.type === "mathord" || r.type === "atom") && r.text === e;
function cdArrow(r, e, t) {
  var n = cdArrowFunctionName[r];
  switch (n) {
    case "\\\\cdrightarrow":
    case "\\\\cdleftarrow":
      return t.callFunction(n, [e[0]], [e[1]]);
    case "\\uparrow":
    case "\\downarrow": {
      var a = t.callFunction("\\\\cdleft", [e[0]], []), s = {
        type: "atom",
        text: n,
        mode: "math",
        family: "rel"
      }, o = t.callFunction("\\Big", [s], []), c = t.callFunction("\\\\cdright", [e[1]], []), l = {
        type: "ordgroup",
        mode: "math",
        body: [a, o, c]
      };
      return t.callFunction("\\\\cdparent", [l], []);
    }
    case "\\\\cdlongequal":
      return t.callFunction("\\\\cdlongequal", [], []);
    case "\\Vert": {
      var u = {
        type: "textord",
        text: "\\Vert",
        mode: "math"
      };
      return t.callFunction("\\Big", [u], []);
    }
    default:
      return {
        type: "textord",
        text: " ",
        mode: "math"
      };
  }
}
function parseCD(r) {
  var e = [];
  for (r.gullet.beginGroup(), r.gullet.macros.set("\\cr", "\\\\\\relax"), r.gullet.beginGroup(); ; ) {
    e.push(r.parseExpression(!1, "\\\\")), r.gullet.endGroup(), r.gullet.beginGroup();
    var t = r.fetch().text;
    if (t === "&" || t === "\\\\")
      r.consume();
    else if (t === "\\end") {
      e[e.length - 1].length === 0 && e.pop();
      break;
    } else
      throw new ParseError("Expected \\\\ or \\cr or \\end", r.nextToken);
  }
  for (var n = [], a = [n], s = 0; s < e.length; s++) {
    for (var o = e[s], c = newCell(), l = 0; l < o.length; l++)
      if (!isStartOfArrow(o[l]))
        c.body.push(o[l]);
      else {
        n.push(c), l += 1;
        var u = assertSymbolNodeType(o[l]).text, h = new Array(2);
        if (h[0] = {
          type: "ordgroup",
          mode: "math",
          body: []
        }, h[1] = {
          type: "ordgroup",
          mode: "math",
          body: []
        }, !("=|.".indexOf(u) > -1)) if ("<>AV".indexOf(u) > -1)
          for (var d = 0; d < 2; d++) {
            for (var w = !0, b = l + 1; b < o.length; b++) {
              if (isLabelEnd(o[b], u)) {
                w = !1, l = b;
                break;
              }
              if (isStartOfArrow(o[b]))
                throw new ParseError("Missing a " + u + " character to complete a CD arrow.", o[b]);
              h[d].body.push(o[b]);
            }
            if (w)
              throw new ParseError("Missing a " + u + " character to complete a CD arrow.", o[l]);
          }
        else
          throw new ParseError('Expected one of "<>AV=|." after @', o[l]);
        var _ = cdArrow(u, h, r), R = {
          type: "styling",
          body: [_],
          mode: "math",
          style: "display"
          // CD is always displaystyle.
        };
        n.push(R), c = newCell();
      }
    s % 2 === 0 ? n.push(c) : n.shift(), n = [], a.push(n);
  }
  r.gullet.endGroup(), r.gullet.endGroup();
  var k = new Array(a[0].length).fill({
    type: "align",
    align: "c",
    pregap: 0.25,
    // CD package sets \enskip between columns.
    postgap: 0.25
    // So pre and post each get half an \enskip, i.e. 0.25em.
  });
  return {
    type: "array",
    mode: "math",
    body: a,
    arraystretch: 1,
    addJot: !0,
    rowGaps: [null],
    cols: k,
    colSeparationType: "CD",
    hLinesBeforeRow: new Array(a.length + 1).fill([])
  };
}
defineFunction({
  type: "cdlabel",
  names: ["\\\\cdleft", "\\\\cdright"],
  props: {
    numArgs: 1
  },
  handler(r, e) {
    var {
      parser: t,
      funcName: n
    } = r;
    return {
      type: "cdlabel",
      mode: t.mode,
      side: n.slice(4),
      label: e[0]
    };
  },
  htmlBuilder(r, e) {
    var t = e.havingStyle(e.style.sup()), n = buildCommon.wrapFragment(buildGroup$1(r.label, t, e), e);
    return n.classes.push("cd-label-" + r.side), n.style.bottom = makeEm(0.8 - n.depth), n.height = 0, n.depth = 0, n;
  },
  mathmlBuilder(r, e) {
    var t = new mathMLTree.MathNode("mrow", [buildGroup(r.label, e)]);
    return t = new mathMLTree.MathNode("mpadded", [t]), t.setAttribute("width", "0"), r.side === "left" && t.setAttribute("lspace", "-1width"), t.setAttribute("voffset", "0.7em"), t = new mathMLTree.MathNode("mstyle", [t]), t.setAttribute("displaystyle", "false"), t.setAttribute("scriptlevel", "1"), t;
  }
});
defineFunction({
  type: "cdlabelparent",
  names: ["\\\\cdparent"],
  props: {
    numArgs: 1
  },
  handler(r, e) {
    var {
      parser: t
    } = r;
    return {
      type: "cdlabelparent",
      mode: t.mode,
      fragment: e[0]
    };
  },
  htmlBuilder(r, e) {
    var t = buildCommon.wrapFragment(buildGroup$1(r.fragment, e), e);
    return t.classes.push("cd-vert-arrow"), t;
  },
  mathmlBuilder(r, e) {
    return new mathMLTree.MathNode("mrow", [buildGroup(r.fragment, e)]);
  }
});
defineFunction({
  type: "textord",
  names: ["\\@char"],
  props: {
    numArgs: 1,
    allowedInText: !0
  },
  handler(r, e) {
    for (var {
      parser: t
    } = r, n = assertNodeType(e[0], "ordgroup"), a = n.body, s = "", o = 0; o < a.length; o++) {
      var c = assertNodeType(a[o], "textord");
      s += c.text;
    }
    var l = parseInt(s), u;
    if (isNaN(l))
      throw new ParseError("\\@char has non-numeric argument " + s);
    if (l < 0 || l >= 1114111)
      throw new ParseError("\\@char with invalid code point " + s);
    return l <= 65535 ? u = String.fromCharCode(l) : (l -= 65536, u = String.fromCharCode((l >> 10) + 55296, (l & 1023) + 56320)), {
      type: "textord",
      mode: t.mode,
      text: u
    };
  }
});
var htmlBuilder$8 = (r, e) => {
  var t = buildExpression$1(r.body, e.withColor(r.color), !1);
  return buildCommon.makeFragment(t);
}, mathmlBuilder$7 = (r, e) => {
  var t = buildExpression(r.body, e.withColor(r.color)), n = new mathMLTree.MathNode("mstyle", t);
  return n.setAttribute("mathcolor", r.color), n;
};
defineFunction({
  type: "color",
  names: ["\\textcolor"],
  props: {
    numArgs: 2,
    allowedInText: !0,
    argTypes: ["color", "original"]
  },
  handler(r, e) {
    var {
      parser: t
    } = r, n = assertNodeType(e[0], "color-token").color, a = e[1];
    return {
      type: "color",
      mode: t.mode,
      color: n,
      body: ordargument(a)
    };
  },
  htmlBuilder: htmlBuilder$8,
  mathmlBuilder: mathmlBuilder$7
});
defineFunction({
  type: "color",
  names: ["\\color"],
  props: {
    numArgs: 1,
    allowedInText: !0,
    argTypes: ["color"]
  },
  handler(r, e) {
    var {
      parser: t,
      breakOnTokenText: n
    } = r, a = assertNodeType(e[0], "color-token").color;
    t.gullet.macros.set("\\current@color", a);
    var s = t.parseExpression(!0, n);
    return {
      type: "color",
      mode: t.mode,
      color: a,
      body: s
    };
  },
  htmlBuilder: htmlBuilder$8,
  mathmlBuilder: mathmlBuilder$7
});
defineFunction({
  type: "cr",
  names: ["\\\\"],
  props: {
    numArgs: 0,
    numOptionalArgs: 0,
    allowedInText: !0
  },
  handler(r, e, t) {
    var {
      parser: n
    } = r, a = n.gullet.future().text === "[" ? n.parseSizeGroup(!0) : null, 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: a && assertNodeType(a, "size").value
    };
  },
  // The following builders are called only at the top level,
  // not within tabular/array environments.
  htmlBuilder(r, e) {
    var t = buildCommon.makeSpan(["mspace"], [], e);
    return r.newLine && (t.classes.push("newline"), r.size && (t.style.marginTop = makeEm(calculateSize(r.size, e)))), t;
  },
  mathmlBuilder(r, e) {
    var t = new mathMLTree.MathNode("mspace");
    return r.newLine && (t.setAttribute("linebreak", "newline"), r.size && t.setAttribute("height", makeEm(calculateSize(r.size, e)))), t;
  }
});
var globalMap = {
  "\\global": "\\global",
  "\\long": "\\\\globallong",
  "\\\\globallong": "\\\\globallong",
  "\\def": "\\gdef",
  "\\gdef": "\\gdef",
  "\\edef": "\\xdef",
  "\\xdef": "\\xdef",
  "\\let": "\\\\globallet",
  "\\futurelet": "\\\\globalfuture"
}, checkControlSequence = (r) => {
  var e = r.text;
  if (/^(?:[\\{}$&#^_]|EOF)$/.test(e))
    throw new ParseError("Expected a control sequence", r);
  return e;
}, getRHS = (r) => {
  var e = r.gullet.popToken();
  return e.text === "=" && (e = r.gullet.popToken(), e.text === " " && (e = r.gullet.popToken())), e;
}, letCommand = (r, e, t, n) => {
  var a = r.gullet.macros.get(t.text);
  a == null && (t.noexpand = !0, a = {
    tokens: [t],
    numArgs: 0,
    // reproduce the same behavior in expansion
    unexpandable: !r.gullet.isExpandable(t.text)
  }), r.gullet.macros.set(e, a, n);
};
defineFunction({
  type: "internal",
  names: [
    "\\global",
    "\\long",
    "\\\\globallong"
    // can’t be entered directly
  ],
  props: {
    numArgs: 0,
    allowedInText: !0
  },
  handler(r) {
    var {
      parser: e,
      funcName: t
    } = r;
    e.consumeSpaces();
    var n = e.fetch();
    if (globalMap[n.text])
      return (t === "\\global" || t === "\\\\globallong") && (n.text = globalMap[n.text]), assertNodeType(e.parseFunction(), "internal");
    throw new ParseError("Invalid token after macro prefix", n);
  }
});
defineFunction({
  type: "internal",
  names: ["\\def", "\\gdef", "\\edef", "\\xdef"],
  props: {
    numArgs: 0,
    allowedInText: !0,
    primitive: !0
  },
  handler(r) {
    var {
      parser: e,
      funcName: t
    } = r, n = e.gullet.popToken(), a = n.text;
    if (/^(?:[\\{}$&#^_]|EOF)$/.test(a))
      throw new ParseError("Expected a control sequence", n);
    for (var s = 0, o, c = [[]]; e.gullet.future().text !== "{"; )
      if (n = e.gullet.popToken(), n.text === "#") {
        if (e.gullet.future().text === "{") {
          o = e.gullet.future(), c[s].push("{");
          break;
        }
        if (n = e.gullet.popToken(), !/^[1-9]$/.test(n.text))
          throw new ParseError('Invalid argument number "' + n.text + '"');
        if (parseInt(n.text) !== s + 1)
          throw new ParseError('Argument number "' + n.text + '" out of order');
        s++, c.push([]);
      } else {
        if (n.text === "EOF")
          throw new ParseError("Expected a macro definition");
        c[s].push(n.text);
      }
    var {
      tokens: l
    } = e.gullet.consumeArg();
    return o && l.unshift(o), (t === "\\edef" || t === "\\xdef") && (l = e.gullet.expandTokens(l), l.reverse()), e.gullet.macros.set(a, {
      tokens: l,
      numArgs: s,
      delimiters: c
    }, t === globalMap[t]), {
      type: "internal",
      mode: e.mode
    };
  }
});
defineFunction({
  type: "internal",
  names: [
    "\\let",
    "\\\\globallet"
    // can’t be entered directly
  ],
  props: {
    numArgs: 0,
    allowedInText: !0,
    primitive: !0
  },
  handler(r) {
    var {
      parser: e,
      funcName: t
    } = r, n = checkControlSequence(e.gullet.popToken());
    e.gullet.consumeSpaces();
    var a = getRHS(e);
    return letCommand(e, n, a, t === "\\\\globallet"), {
      type: "internal",
      mode: e.mode
    };
  }
});
defineFunction({
  type: "internal",
  names: [
    "\\futurelet",
    "\\\\globalfuture"
    // can’t be entered directly
  ],
  props: {
    numArgs: 0,
    allowedInText: !0,
    primitive: !0
  },
  handler(r) {
    var {
      parser: e,
      funcName: t
    } = r, n = checkControlSequence(e.gullet.popToken()), a = e.gullet.popToken(), s = e.gullet.popToken();
    return letCommand(e, n, s, t === "\\\\globalfuture"), e.gullet.pushToken(s), e.gullet.pushToken(a), {
      type: "internal",
      mode: e.mode
    };
  }
});
var getMetrics = function(e, t, n) {
  var a = symbols.math[e] && symbols.math[e].replace, s = getCharacterMetrics(a || e, t, n);
  if (!s)
    throw new Error("Unsupported symbol " + e + " and font size " + t + ".");
  return s;
}, styleWrap = function(e, t, n, a) {
  var s = n.havingBaseStyle(t), o = buildCommon.makeSpan(a.concat(s.sizingClasses(n)), [e], n), c = s.sizeMultiplier / n.sizeMultiplier;
  return o.height *= c, o.depth *= c, o.maxFontSize = s.sizeMultiplier, o;
}, centerSpan = function(e, t, n) {
  var a = t.havingBaseStyle(n), s = (1 - t.sizeMultiplier / a.sizeMultiplier) * t.fontMetrics().axisHeight;
  e.classes.push("delimcenter"), e.style.top = makeEm(s), e.height -= s, e.depth += s;
}, makeSmallDelim = function(e, t, n, a, s, o) {
  var c = buildCommon.makeSymbol(e, "Main-Regular", s, a), l = styleWrap(c, t, a, o);
  return n && centerSpan(l, a, t), l;
}, mathrmSize = function(e, t, n, a) {
  return buildCommon.makeSymbol(e, "Size" + t + "-Regular", n, a);
}, makeLargeDelim = function(e, t, n, a, s, o) {
  var c = mathrmSize(e, t, s, a), l = styleWrap(buildCommon.makeSpan(["delimsizing", "size" + t], [c], a), Style$1.TEXT, a, o);
  return n && centerSpan(l, a, Style$1.TEXT), l;
}, makeGlyphSpan = function(e, t, n) {
  var a;
  t === "Size1-Regular" ? a = "delim-size1" : a = "delim-size4";
  var s = buildCommon.makeSpan(["delimsizinginner", a], [buildCommon.makeSpan([], [buildCommon.makeSymbol(e, t, n)])]);
  return {
    type: "elem",
    elem: s
  };
}, makeInner = function(e, t, n) {
  var a = fontMetricsData["Size4-Regular"][e.charCodeAt(0)] ? fontMetricsData["Size4-Regular"][e.charCodeAt(0)][4] : fontMetricsData["Size1-Regular"][e.charCodeAt(0)][4], s = new PathNode("inner", innerPath(e, Math.round(1e3 * t))), o = new SvgNode([s], {
    width: makeEm(a),
    height: makeEm(t),
    // Override CSS rule `.katex svg { width: 100% }`
    style: "width:" + makeEm(a),
    viewBox: "0 0 " + 1e3 * a + " " + Math.round(1e3 * t),
    preserveAspectRatio: "xMinYMin"
  }), c = buildCommon.makeSvgSpan([], [o], n);
  return c.height = t, c.style.height = makeEm(t), c.style.width = makeEm(a), {
    type: "elem",
    elem: c
  };
}, lapInEms = 8e-3, lap = {
  type: "kern",
  size: -1 * lapInEms
}, verts = ["|", "\\lvert", "\\rvert", "\\vert"], doubleVerts = ["\\|", "\\lVert", "\\rVert", "\\Vert"], makeStackedDelim = function(e, t, n, a, s, o) {
  var c, l, u, h, d = "", w = 0;
  c = u = h = e, l = null;
  var b = "Size1-Regular";
  e === "\\uparrow" ? u = h = "⏐" : e === "\\Uparrow" ? u = h = "‖" : e === "\\downarrow" ? c = u = "⏐" : e === "\\Downarrow" ? c = u = "‖" : e === "\\updownarrow" ? (c = "\\uparrow", u = "⏐", h = "\\downarrow") : e === "\\Updownarrow" ? (c = "\\Uparrow", u = "‖", h = "\\Downarrow") : utils.contains(verts, e) ? (u = "∣", d = "vert", w = 333) : utils.contains(doubleVerts, e) ? (u = "∥", d = "doublevert", w = 556) : e === "[" || e === "\\lbrack" ? (c = "⎡", u = "⎢", h = "⎣", b = "Size4-Regular", d = "lbrack", w = 667) : e === "]" || e === "\\rbrack" ? (c = "⎤", u = "⎥", h = "⎦", b = "Size4-Regular", d = "rbrack", w = 667) : e === "\\lfloor" || e === "⌊" ? (u = c = "⎢", h = "⎣", b = "Size4-Regular", d = "lfloor", w = 667) : e === "\\lceil" || e === "⌈" ? (c = "⎡", u = h = "⎢", b = "Size4-Regular", d = "lceil", w = 667) : e === "\\rfloor" || e === "⌋" ? (u = c = "⎥", h = "⎦", b = "Size4-Regular", d = "rfloor", w = 667) : e === "\\rceil" || e === "⌉" ? (c = "⎤", u = h = "⎥", b = "Size4-Regular", d = "rceil", w = 667) : e === "(" || e === "\\lparen" ? (c = "⎛", u = "⎜", h = "⎝", b = "Size4-Regular", d = "lparen", w = 875) : e === ")" || e === "\\rparen" ? (c = "⎞", u = "⎟", h = "⎠", b = "Size4-Regular", d = "rparen", w = 875) : e === "\\{" || e === "\\lbrace" ? (c = "⎧", l = "⎨", h = "⎩", u = "⎪", b = "Size4-Regular") : e === "\\}" || e === "\\rbrace" ? (c = "⎫", l = "⎬", h = "⎭", u = "⎪", b = "Size4-Regular") : e === "\\lgroup" || e === "⟮" ? (c = "⎧", h = "⎩", u = "⎪", b = "Size4-Regular") : e === "\\rgroup" || e === "⟯" ? (c = "⎫", h = "⎭", u = "⎪", b = "Size4-Regular") : e === "\\lmoustache" || e === "⎰" ? (c = "⎧", h = "⎭", u = "⎪", b = "Size4-Regular") : (e === "\\rmoustache" || e === "⎱") && (c = "⎫", h = "⎩", u = "⎪", b = "Size4-Regular");
  var _ = getMetrics(c, b, s), R = _.height + _.depth, k = getMetrics(u, b, s), C = k.height + k.depth, m = getMetrics(h, b, s), A = m.height + m.depth, F = 0, f = 1;
  if (l !== null) {
    var g = getMetrics(l, b, s);
    F = g.height + g.depth, f = 2;
  }
  var y = R + A + F, E = Math.max(0, Math.ceil((t - y) / (f * C))), x = y + E * f * C, O = a.fontMetrics().axisHeight;
  n && (O *= a.sizeMultiplier);
  var P = x / 2 - O, I = [];
  if (d.length > 0) {
    var G = x - R - A, ne = Math.round(x * 1e3), X = tallDelim(d, Math.round(G * 1e3)), ee = new PathNode(d, X), K = (w / 1e3).toFixed(3) + "em", se = (ne / 1e3).toFixed(3) + "em", q = new SvgNode([ee], {
      width: K,
      height: se,
      viewBox: "0 0 " + w + " " + ne
    }), Y = buildCommon.makeSvgSpan([], [q], a);
    Y.height = ne / 1e3, Y.style.width = K, Y.style.height = se, I.push({
      type: "elem",
      elem: Y
    });
  } else {
    if (I.push(makeGlyphSpan(h, b, s)), I.push(lap), l === null) {
      var J = x - R - A + 2 * lapInEms;
      I.push(makeInner(u, J, a));
    } else {
      var N = (x - R - A - F) / 2 + 2 * lapInEms;
      I.push(makeInner(u, N, a)), I.push(lap), I.push(makeGlyphSpan(l, b, s)), I.push(lap), I.push(makeInner(u, N, a));
    }
    I.push(lap), I.push(makeGlyphSpan(c, b, s));
  }
  var M = a.havingBaseStyle(Style$1.TEXT), v = buildCommon.makeVList({
    positionType: "bottom",
    positionData: P,
    children: I
  }, M);
  return styleWrap(buildCommon.makeSpan(["delimsizing", "mult"], [v], M), Style$1.TEXT, a, o);
}, vbPad = 80, emPad = 0.08, sqrtSvg = function(e, t, n, a, s) {
  var o = sqrtPath(e, a, n), c = new PathNode(e, o), l = new SvgNode([c], {
    // Note: 1000:1 ratio of viewBox to document em width.
    width: "400em",
    height: makeEm(t),
    viewBox: "0 0 400000 " + n,
    preserveAspectRatio: "xMinYMin slice"
  });
  return buildCommon.makeSvgSpan(["hide-tail"], [l], s);
}, makeSqrtImage = function(e, t) {
  var n = t.havingBaseSizing(), a = traverseSequence("\\surd", e * n.sizeMultiplier, stackLargeDelimiterSequence, n), s = n.sizeMultiplier, o = Math.max(0, t.minRuleThickness - t.fontMetrics().sqrtRuleThickness), c, l = 0, u = 0, h = 0, d;
  return a.type === "small" ? (h = 1e3 + 1e3 * o + vbPad, e < 1 ? s = 1 : e < 1.4 && (s = 0.7), l = (1 + o + emPad) / s, u = (1 + o) / s, c = sqrtSvg("sqrtMain", l, h, o, t), c.style.minWidth = "0.853em", d = 0.833 / s) : a.type === "large" ? (h = (1e3 + vbPad) * sizeToMaxHeight[a.size], u = (sizeToMaxHeight[a.size] + o) / s, l = (sizeToMaxHeight[a.size] + o + emPad) / s, c = sqrtSvg("sqrtSize" + a.size, l, h, o, t), c.style.minWidth = "1.02em", d = 1 / s) : (l = e + o + emPad, u = e + o, h = Math.floor(1e3 * e + o) + vbPad, c = sqrtSvg("sqrtTall", l, h, o, t), c.style.minWidth = "0.742em", d = 1.056), c.height = u, c.style.height = makeEm(l), {
    span: c,
    advanceWidth: d,
    // 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 + o) * s
  };
}, stackLargeDelimiters = ["(", "\\lparen", ")", "\\rparen", "[", "\\lbrack", "]", "\\rbrack", "\\{", "\\lbrace", "\\}", "\\rbrace", "\\lfloor", "\\rfloor", "⌊", "⌋", "\\lceil", "\\rceil", "⌈", "⌉", "\\surd"], stackAlwaysDelimiters = ["\\uparrow", "\\downarrow", "\\updownarrow", "\\Uparrow", "\\Downarrow", "\\Updownarrow", "|", "\\|", "\\vert", "\\Vert", "\\lvert", "\\rvert", "\\lVert", "\\rVert", "\\lgroup", "\\rgroup", "⟮", "⟯", "\\lmoustache", "\\rmoustache", "⎰", "⎱"], stackNeverDelimiters = ["<", ">", "\\langle", "\\rangle", "/", "\\backslash", "\\lt", "\\gt"], sizeToMaxHeight = [0, 1.2, 1.8, 2.4, 3], makeSizedDelim = function(e, t, n, a, s) {
  if (e === "<" || e === "\\lt" || e === "⟨" ? e = "\\langle" : (e === ">" || e === "\\gt" || e === "⟩") && (e = "\\rangle"), utils.contains(stackLargeDelimiters, e) || utils.contains(stackNeverDelimiters, e))
    return makeLargeDelim(e, t, !1, n, a, s);
  if (utils.contains(stackAlwaysDelimiters, e))
    return makeStackedDelim(e, sizeToMaxHeight[t], !1, n, a, s);
  throw new ParseError("Illegal delimiter: '" + e + "'");
}, stackNeverDelimiterSequence = [{
  type: "small",
  style: Style$1.SCRIPTSCRIPT
}, {
  type: "small",
  style: Style$1.SCRIPT
}, {
  type: "small",
  style: Style$1.TEXT
}, {
  type: "large",
  size: 1
}, {
  type: "large",
  size: 2
}, {
  type: "large",
  size: 3
}, {
  type: "large",
  size: 4
}], stackAlwaysDelimiterSequence = [{
  type: "small",
  style: Style$1.SCRIPTSCRIPT
}, {
  type: "small",
  style: Style$1.SCRIPT
}, {
  type: "small",
  style: Style$1.TEXT
}, {
  type: "stack"
}], stackLargeDelimiterSequence = [{
  type: "small",
  style: Style$1.SCRIPTSCRIPT
}, {
  type: "small",
  style: Style$1.SCRIPT
}, {
  type: "small",
  style: Style$1.TEXT
}, {
  type: "large",
  size: 1
}, {
  type: "large",
  size: 2
}, {
  type: "large",
  size: 3
}, {
  type: "large",
  size: 4
}, {
  type: "stack"
}], delimTypeToFont = 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.");
}, traverseSequence = function(e, t, n, a) {
  for (var s = Math.min(2, 3 - a.style.size), o = s; o < n.length && n[o].type !== "stack"; o++) {
    var c = getMetrics(e, delimTypeToFont(n[o]), "math"), l = c.height + c.depth;
    if (n[o].type === "small") {
      var u = a.havingBaseStyle(n[o].style);
      l *= u.sizeMultiplier;
    }
    if (l > t)
      return n[o];
  }
  return n[n.length - 1];
}, makeCustomSizedDelim = function(e, t, n, a, s, o) {
  e === "<" || e === "\\lt" || e === "⟨" ? e = "\\langle" : (e === ">" || e === "\\gt" || e === "⟩") && (e = "\\rangle");
  var c;
  utils.contains(stackNeverDelimiters, e) ? c = stackNeverDelimiterSequence : utils.contains(stackLargeDelimiters, e) ? c = stackLargeDelimiterSequence : c = stackAlwaysDelimiterSequence;
  var l = traverseSequence(e, t, c, a);
  return l.type === "small" ? makeSmallDelim(e, l.style, n, a, s, o) : l.type === "large" ? makeLargeDelim(e, l.size, n, a, s, o) : makeStackedDelim(e, t, n, a, s, o);
}, makeLeftRightDelim = function(e, t, n, a, s, o) {
  var c = a.fontMetrics().axisHeight * a.sizeMultiplier, l = 901, u = 5 / a.fontMetrics().ptPerEm, h = Math.max(t - c, n + c), d = Math.max(
    // In real TeX, calculations are done using integral values which are
    // 65536 per pt, or 655360 per em. So, the division here truncates in
    // TeX but doesn't here, producing different results. If we wanted to
    // exactly match TeX's calculation, we could do
    //   Math.floor(655360 * maxDistFromAxis / 500) *
    //    delimiterFactor / 655360
    // (To see the difference, compare
    //    x^{x^{\left(\rule{0.1em}{0.68em}\right)}}
    // in TeX and KaTeX)
    h / 500 * l,
    2 * h - u
  );
  return makeCustomSizedDelim(e, d, !0, a, s, o);
}, delimiter = {
  sqrtImage: makeSqrtImage,
  sizedDelim: makeSizedDelim,
  sizeToMaxHeight,
  customSizedDelim: makeCustomSizedDelim,
  leftRightDelim: makeLeftRightDelim
}, delimiterSizes = {
  "\\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
  }
}, delimiters = ["(", "\\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 checkDelimiter(r, e) {
  var t = checkSymbolNodeType(r);
  if (t && utils.contains(delimiters, t.text))
    return t;
  throw t ? new ParseError("Invalid delimiter '" + t.text + "' after '" + e.funcName + "'", r) : new ParseError("Invalid delimiter type '" + r.type + "'", r);
}
defineFunction({
  type: "delimsizing",
  names: ["\\bigl", "\\Bigl", "\\biggl", "\\Biggl", "\\bigr", "\\Bigr", "\\biggr", "\\Biggr", "\\bigm", "\\Bigm", "\\biggm", "\\Biggm", "\\big", "\\Big", "\\bigg", "\\Bigg"],
  props: {
    numArgs: 1,
    argTypes: ["primitive"]
  },
  handler: (r, e) => {
    var t = checkDelimiter(e[0], r);
    return {
      type: "delimsizing",
      mode: r.parser.mode,
      size: delimiterSizes[r.funcName].size,
      mclass: delimiterSizes[r.funcName].mclass,
      delim: t.text
    };
  },
  htmlBuilder: (r, e) => r.delim === "." ? buildCommon.makeSpan([r.mclass]) : delimiter.sizedDelim(r.delim, r.size, e, r.mode, [r.mclass]),
  mathmlBuilder: (r) => {
    var e = [];
    r.delim !== "." && e.push(makeText(r.delim, r.mode));
    var t = new mathMLTree.MathNode("mo", e);
    r.mclass === "mopen" || r.mclass === "mclose" ? t.setAttribute("fence", "true") : t.setAttribute("fence", "false"), t.setAttribute("stretchy", "true");
    var n = makeEm(delimiter.sizeToMaxHeight[r.size]);
    return t.setAttribute("minsize", n), t.setAttribute("maxsize", n), t;
  }
});
function assertParsed(r) {
  if (!r.body)
    throw new Error("Bug: The leftright ParseNode wasn't fully parsed.");
}
defineFunction({
  type: "leftright-right",
  names: ["\\right"],
  props: {
    numArgs: 1,
    primitive: !0
  },
  handler: (r, e) => {
    var t = r.parser.gullet.macros.get("\\current@color");
    if (t && typeof t != "string")
      throw new ParseError("\\current@color set to non-string in \\right");
    return {
      type: "leftright-right",
      mode: r.parser.mode,
      delim: checkDelimiter(e[0], r).text,
      color: t
      // undefined if not set via \color
    };
  }
});
defineFunction({
  type: "leftright",
  names: ["\\left"],
  props: {
    numArgs: 1,
    primitive: !0
  },
  handler: (r, e) => {
    var t = checkDelimiter(e[0], r), n = r.parser;
    ++n.leftrightDepth;
    var a = n.parseExpression(!1);
    --n.leftrightDepth, n.expect("\\right", !1);
    var s = assertNodeType(n.parseFunction(), "leftright-right");
    return {
      type: "leftright",
      mode: n.mode,
      body: a,
      left: t.text,
      right: s.delim,
      rightColor: s.color
    };
  },
  htmlBuilder: (r, e) => {
    assertParsed(r);
    for (var t = buildExpression$1(r.body, e, !0, ["mopen", "mclose"]), n = 0, a = 0, s = !1, o = 0; o < t.length; o++)
      t[o].isMiddle ? s = !0 : (n = Math.max(t[o].height, n), a = Math.max(t[o].depth, a));
    n *= e.sizeMultiplier, a *= e.sizeMultiplier;
    var c;
    if (r.left === "." ? c = makeNullDelimiter(e, ["mopen"]) : c = delimiter.leftRightDelim(r.left, n, a, e, r.mode, ["mopen"]), t.unshift(c), s)
      for (var l = 1; l < t.length; l++) {
        var u = t[l], h = u.isMiddle;
        h && (t[l] = delimiter.leftRightDelim(h.delim, n, a, h.options, r.mode, []));
      }
    var d;
    if (r.right === ".")
      d = makeNullDelimiter(e, ["mclose"]);
    else {
      var w = r.rightColor ? e.withColor(r.rightColor) : e;
      d = delimiter.leftRightDelim(r.right, n, a, w, r.mode, ["mclose"]);
    }
    return t.push(d), buildCommon.makeSpan(["minner"], t, e);
  },
  mathmlBuilder: (r, e) => {
    assertParsed(r);
    var t = buildExpression(r.body, e);
    if (r.left !== ".") {
      var n = new mathMLTree.MathNode("mo", [makeText(r.left, r.mode)]);
      n.setAttribute("fence", "true"), t.unshift(n);
    }
    if (r.right !== ".") {
      var a = new mathMLTree.MathNode("mo", [makeText(r.right, r.mode)]);
      a.setAttribute("fence", "true"), r.rightColor && a.setAttribute("mathcolor", r.rightColor), t.push(a);
    }
    return makeRow(t);
  }
});
defineFunction({
  type: "middle",
  names: ["\\middle"],
  props: {
    numArgs: 1,
    primitive: !0
  },
  handler: (r, e) => {
    var t = checkDelimiter(e[0], r);
    if (!r.parser.leftrightDepth)
      throw new ParseError("\\middle without preceding \\left", t);
    return {
      type: "middle",
      mode: r.parser.mode,
      delim: t.text
    };
  },
  htmlBuilder: (r, e) => {
    var t;
    if (r.delim === ".")
      t = makeNullDelimiter(e, []);
    else {
      t = delimiter.sizedDelim(r.delim, 1, e, r.mode, []);
      var n = {
        delim: r.delim,
        options: e
      };
      t.isMiddle = n;
    }
    return t;
  },
  mathmlBuilder: (r, e) => {
    var t = r.delim === "\\vert" || r.delim === "|" ? makeText("|", "text") : makeText(r.delim, r.mode), n = new mathMLTree.MathNode("mo", [t]);
    return n.setAttribute("fence", "true"), n.setAttribute("lspace", "0.05em"), n.setAttribute("rspace", "0.05em"), n;
  }
});
var htmlBuilder$7 = (r, e) => {
  var t = buildCommon.wrapFragment(buildGroup$1(r.body, e), e), n = r.label.slice(1), a = e.sizeMultiplier, s, o = 0, c = utils.isCharacterBox(r.body);
  if (n === "sout")
    s = buildCommon.makeSpan(["stretchy", "sout"]), s.height = e.fontMetrics().defaultRuleThickness / a, o = -0.5 * e.fontMetrics().xHeight;
  else if (n === "phase") {
    var l = calculateSize({
      number: 0.6,
      unit: "pt"
    }, e), u = calculateSize({
      number: 0.35,
      unit: "ex"
    }, e), h = e.havingBaseSizing();
    a = a / h.sizeMultiplier;
    var d = t.height + t.depth + l + u;
    t.style.paddingLeft = makeEm(d / 2 + l);
    var w = Math.floor(1e3 * d * a), b = phasePath(w), _ = new SvgNode([new PathNode("phase", b)], {
      width: "400em",
      height: makeEm(w / 1e3),
      viewBox: "0 0 400000 " + w,
      preserveAspectRatio: "xMinYMin slice"
    });
    s = buildCommon.makeSvgSpan(["hide-tail"], [_], e), s.style.height = makeEm(d), o = t.depth + l + u;
  } else {
    /cancel/.test(n) ? c || t.classes.push("cancel-pad") : n === "angl" ? t.classes.push("anglpad") : t.classes.push("boxpad");
    var R = 0, k = 0, C = 0;
    /box/.test(n) ? (C = Math.max(
      e.fontMetrics().fboxrule,
      // default
      e.minRuleThickness
      // User override.
    ), R = e.fontMetrics().fboxsep + (n === "colorbox" ? 0 : C), k = R) : n === "angl" ? (C = Math.max(e.fontMetrics().defaultRuleThickness, e.minRuleThickness), R = 4 * C, k = Math.max(0, 0.25 - t.depth)) : (R = c ? 0.2 : 0, k = R), s = stretchy.encloseSpan(t, n, R, k, e), /fbox|boxed|fcolorbox/.test(n) ? (s.style.borderStyle = "solid", s.style.borderWidth = makeEm(C)) : n === "angl" && C !== 0.049 && (s.style.borderTopWidth = makeEm(C), s.style.borderRightWidth = makeEm(C)), o = t.depth + k, r.backgroundColor && (s.style.backgroundColor = r.backgroundColor, r.borderColor && (s.style.borderColor = r.borderColor));
  }
  var m;
  if (r.backgroundColor)
    m = buildCommon.makeVList({
      positionType: "individualShift",
      children: [
        // Put the color background behind inner;
        {
          type: "elem",
          elem: s,
          shift: o
        },
        {
          type: "elem",
          elem: t,
          shift: 0
        }
      ]
    }, e);
  else {
    var A = /cancel|phase/.test(n) ? ["svg-align"] : [];
    m = buildCommon.makeVList({
      positionType: "individualShift",
      children: [
        // Write the \cancel stroke on top of inner.
        {
          type: "elem",
          elem: t,
          shift: 0
        },
        {
          type: "elem",
          elem: s,
          shift: o,
          wrapperClasses: A
        }
      ]
    }, e);
  }
  return /cancel/.test(n) && (m.height = t.height, m.depth = t.depth), /cancel/.test(n) && !c ? buildCommon.makeSpan(["mord", "cancel-lap"], [m], e) : buildCommon.makeSpan(["mord"], [m], e);
}, mathmlBuilder$6 = (r, e) => {
  var t = 0, n = new mathMLTree.MathNode(r.label.indexOf("colorbox") > -1 ? "mpadded" : "menclose", [buildGroup(r.body, e)]);
  switch (r.label) {
    case "\\cancel":
      n.setAttribute("notation", "updiagonalstrike");
      break;
    case "\\bcancel":
      n.setAttribute("notation", "downdiagonalstrike");
      break;
    case "\\phase":
      n.setAttribute("notation", "phasorangle");
      break;
    case "\\sout":
      n.setAttribute("notation", "horizontalstrike");
      break;
    case "\\fbox":
      n.setAttribute("notation", "box");
      break;
    case "\\angl":
      n.setAttribute("notation", "actuarial");
      break;
    case "\\fcolorbox":
    case "\\colorbox":
      if (t = e.fontMetrics().fboxsep * e.fontMetrics().ptPerEm, n.setAttribute("width", "+" + 2 * t + "pt"), n.setAttribute("height", "+" + 2 * t + "pt"), n.setAttribute("lspace", t + "pt"), n.setAttribute("voffset", t + "pt"), r.label === "\\fcolorbox") {
        var a = Math.max(
          e.fontMetrics().fboxrule,
          // default
          e.minRuleThickness
          // user override
        );
        n.setAttribute("style", "border: " + a + "em solid " + String(r.borderColor));
      }
      break;
    case "\\xcancel":
      n.setAttribute("notation", "updiagonalstrike downdiagonalstrike");
      break;
  }
  return r.backgroundColor && n.setAttribute("mathbackground", r.backgroundColor), n;
};
defineFunction({
  type: "enclose",
  names: ["\\colorbox"],
  props: {
    numArgs: 2,
    allowedInText: !0,
    argTypes: ["color", "text"]
  },
  handler(r, e, t) {
    var {
      parser: n,
      funcName: a
    } = r, s = assertNodeType(e[0], "color-token").color, o = e[1];
    return {
      type: "enclose",
      mode: n.mode,
      label: a,
      backgroundColor: s,
      body: o
    };
  },
  htmlBuilder: htmlBuilder$7,
  mathmlBuilder: mathmlBuilder$6
});
defineFunction({
  type: "enclose",
  names: ["\\fcolorbox"],
  props: {
    numArgs: 3,
    allowedInText: !0,
    argTypes: ["color", "color", "text"]
  },
  handler(r, e, t) {
    var {
      parser: n,
      funcName: a
    } = r, s = assertNodeType(e[0], "color-token").color, o = assertNodeType(e[1], "color-token").color, c = e[2];
    return {
      type: "enclose",
      mode: n.mode,
      label: a,
      backgroundColor: o,
      borderColor: s,
      body: c
    };
  },
  htmlBuilder: htmlBuilder$7,
  mathmlBuilder: mathmlBuilder$6
});
defineFunction({
  type: "enclose",
  names: ["\\fbox"],
  props: {
    numArgs: 1,
    argTypes: ["hbox"],
    allowedInText: !0
  },
  handler(r, e) {
    var {
      parser: t
    } = r;
    return {
      type: "enclose",
      mode: t.mode,
      label: "\\fbox",
      body: e[0]
    };
  }
});
defineFunction({
  type: "enclose",
  names: ["\\cancel", "\\bcancel", "\\xcancel", "\\sout", "\\phase"],
  props: {
    numArgs: 1
  },
  handler(r, e) {
    var {
      parser: t,
      funcName: n
    } = r, a = e[0];
    return {
      type: "enclose",
      mode: t.mode,
      label: n,
      body: a
    };
  },
  htmlBuilder: htmlBuilder$7,
  mathmlBuilder: mathmlBuilder$6
});
defineFunction({
  type: "enclose",
  names: ["\\angl"],
  props: {
    numArgs: 1,
    argTypes: ["hbox"],
    allowedInText: !1
  },
  handler(r, e) {
    var {
      parser: t
    } = r;
    return {
      type: "enclose",
      mode: t.mode,
      label: "\\angl",
      body: e[0]
    };
  }
});
var _environments = {};
function defineEnvironment(r) {
  for (var {
    type: e,
    names: t,
    props: n,
    handler: a,
    htmlBuilder: s,
    mathmlBuilder: o
  } = r, c = {
    type: e,
    numArgs: n.numArgs || 0,
    allowedInText: !1,
    numOptionalArgs: 0,
    handler: a
  }, l = 0; l < t.length; ++l)
    _environments[t[l]] = c;
  s && (_htmlGroupBuilders[e] = s), o && (_mathmlGroupBuilders[e] = o);
}
var _macros = {};
function defineMacro(r, e) {
  _macros[r] = e;
}
function getHLines(r) {
  var e = [];
  r.consumeSpaces();
  var t = r.fetch().text;
  for (t === "\\relax" && (r.consume(), r.consumeSpaces(), t = r.fetch().text); t === "\\hline" || t === "\\hdashline"; )
    r.consume(), e.push(t === "\\hdashline"), r.consumeSpaces(), t = r.fetch().text;
  return e;
}
var validateAmsEnvironmentContext = (r) => {
  var e = r.parser.settings;
  if (!e.displayMode)
    throw new ParseError("{" + r.envName + "} can be used only in display mode.");
};
function getAutoTag(r) {
  if (r.indexOf("ed") === -1)
    return r.indexOf("*") === -1;
}
function parseArray(r, e, t) {
  var {
    hskipBeforeAndAfter: n,
    addJot: a,
    cols: s,
    arraystretch: o,
    colSeparationType: c,
    autoTag: l,
    singleRow: u,
    emptySingleRow: h,
    maxNumCols: d,
    leqno: w
  } = e;
  if (r.gullet.beginGroup(), u || r.gullet.macros.set("\\cr", "\\\\\\relax"), !o) {
    var b = r.gullet.expandMacroAsText("\\arraystretch");
    if (b == null)
      o = 1;
    else if (o = parseFloat(b), !o || o < 0)
      throw new ParseError("Invalid \\arraystretch: " + b);
  }
  r.gullet.beginGroup();
  var _ = [], R = [_], k = [], C = [], m = l != null ? [] : void 0;
  function A() {
    l && r.gullet.macros.set("\\@eqnsw", "1", !0);
  }
  function F() {
    m && (r.gullet.macros.get("\\df@tag") ? (m.push(r.subparse([new Token("\\df@tag")])), r.gullet.macros.set("\\df@tag", void 0, !0)) : m.push(!!l && r.gullet.macros.get("\\@eqnsw") === "1"));
  }
  for (A(), C.push(getHLines(r)); ; ) {
    var f = r.parseExpression(!1, u ? "\\end" : "\\\\");
    r.gullet.endGroup(), r.gullet.beginGroup(), f = {
      type: "ordgroup",
      mode: r.mode,
      body: f
    }, t && (f = {
      type: "styling",
      mode: r.mode,
      style: t,
      body: [f]
    }), _.push(f);
    var g = r.fetch().text;
    if (g === "&") {
      if (d && _.length === d) {
        if (u || c)
          throw new ParseError("Too many tab characters: &", r.nextToken);
        r.settings.reportNonstrict("textEnv", "Too few columns specified in the {array} column argument.");
      }
      r.consume();
    } else if (g === "\\end") {
      F(), _.length === 1 && f.type === "styling" && f.body[0].body.length === 0 && (R.length > 1 || !h) && R.pop(), C.length < R.length + 1 && C.push([]);
      break;
    } else if (g === "\\\\") {
      r.consume();
      var y = void 0;
      r.gullet.future().text !== " " && (y = r.parseSizeGroup(!0)), k.push(y ? y.value : null), F(), C.push(getHLines(r)), _ = [], R.push(_), A();
    } else
      throw new ParseError("Expected & or \\\\ or \\cr or \\end", r.nextToken);
  }
  return r.gullet.endGroup(), r.gullet.endGroup(), {
    type: "array",
    mode: r.mode,
    addJot: a,
    arraystretch: o,
    body: R,
    cols: s,
    rowGaps: k,
    hskipBeforeAndAfter: n,
    hLinesBeforeRow: C,
    colSeparationType: c,
    tags: m,
    leqno: w
  };
}
function dCellStyle(r) {
  return r.slice(0, 1) === "d" ? "display" : "text";
}
var htmlBuilder$6 = function(e, t) {
  var n, a, s = e.body.length, o = e.hLinesBeforeRow, c = 0, l = new Array(s), u = [], h = Math.max(
    // From LaTeX \showthe\arrayrulewidth. Equals 0.04 em.
    t.fontMetrics().arrayRuleWidth,
    t.minRuleThickness
    // User override.
  ), d = 1 / t.fontMetrics().ptPerEm, w = 5 * d;
  if (e.colSeparationType && e.colSeparationType === "small") {
    var b = t.havingStyle(Style$1.SCRIPT).sizeMultiplier;
    w = 0.2778 * (b / t.sizeMultiplier);
  }
  var _ = e.colSeparationType === "CD" ? calculateSize({
    number: 3,
    unit: "ex"
  }, t) : 12 * d, R = 3 * d, k = e.arraystretch * _, C = 0.7 * k, m = 0.3 * k, A = 0;
  function F($) {
    for (var j = 0; j < $.length; ++j)
      j > 0 && (A += 0.25), u.push({
        pos: A,
        isDashed: $[j]
      });
  }
  for (F(o[0]), n = 0; n < e.body.length; ++n) {
    var f = e.body[n], g = C, y = m;
    c < f.length && (c = f.length);
    var E = new Array(f.length);
    for (a = 0; a < f.length; ++a) {
      var x = buildGroup$1(f[a], t);
      y < x.depth && (y = x.depth), g < x.height && (g = x.height), E[a] = x;
    }
    var O = e.rowGaps[n], P = 0;
    O && (P = calculateSize(O, t), P > 0 && (P += m, y < P && (y = P), P = 0)), e.addJot && (y += R), E.height = g, E.depth = y, A += g, E.pos = A, A += y + P, l[n] = E, F(o[n + 1]);
  }
  var I = A / 2 + t.fontMetrics().axisHeight, G = e.cols || [], ne = [], X, ee, K = [];
  if (e.tags && e.tags.some(($) => $))
    for (n = 0; n < s; ++n) {
      var se = l[n], q = se.pos - I, Y = e.tags[n], J = void 0;
      Y === !0 ? J = buildCommon.makeSpan(["eqn-num"], [], t) : Y === !1 ? J = buildCommon.makeSpan([], [], t) : J = buildCommon.makeSpan([], buildExpression$1(Y, t, !0), t), J.depth = se.depth, J.height = se.height, K.push({
        type: "elem",
        elem: J,
        shift: q
      });
    }
  for (
    a = 0, ee = 0;
    // Continue while either there are more columns or more column
    // descriptions, so trailing separators don't get lost.
    a < c || ee < G.length;
    ++a, ++ee
  ) {
    for (var N = G[ee] || {}, M = !0; N.type === "separator"; ) {
      if (M || (X = buildCommon.makeSpan(["arraycolsep"], []), X.style.width = makeEm(t.fontMetrics().doubleRuleSep), ne.push(X)), N.separator === "|" || N.separator === ":") {
        var v = N.separator === "|" ? "solid" : "dashed", L = buildCommon.makeSpan(["vertical-separator"], [], t);
        L.style.height = makeEm(A), L.style.borderRightWidth = makeEm(h), L.style.borderRightStyle = v, L.style.margin = "0 " + makeEm(-h / 2);
        var H = A - I;
        H && (L.style.verticalAlign = makeEm(-H)), ne.push(L);
      } else
        throw new ParseError("Invalid separator type: " + N.separator);
      ee++, N = G[ee] || {}, M = !1;
    }
    if (!(a >= c)) {
      var B = void 0;
      (a > 0 || e.hskipBeforeAndAfter) && (B = utils.deflt(N.pregap, w), B !== 0 && (X = buildCommon.makeSpan(["arraycolsep"], []), X.style.width = makeEm(B), ne.push(X)));
      var U = [];
      for (n = 0; n < s; ++n) {
        var Z = l[n], re = Z[a];
        if (re) {
          var pe = Z.pos - I;
          re.depth = Z.depth, re.height = Z.height, U.push({
            type: "elem",
            elem: re,
            shift: pe
          });
        }
      }
      U = buildCommon.makeVList({
        positionType: "individualShift",
        children: U
      }, t), U = buildCommon.makeSpan(["col-align-" + (N.align || "c")], [U]), ne.push(U), (a < c - 1 || e.hskipBeforeAndAfter) && (B = utils.deflt(N.postgap, w), B !== 0 && (X = buildCommon.makeSpan(["arraycolsep"], []), X.style.width = makeEm(B), ne.push(X)));
    }
  }
  if (l = buildCommon.makeSpan(["mtable"], ne), u.length > 0) {
    for (var be = buildCommon.makeLineSpan("hline", t, h), Se = buildCommon.makeLineSpan("hdashline", t, h), _e = [{
      type: "elem",
      elem: l,
      shift: 0
    }]; u.length > 0; ) {
      var we = u.pop(), oe = we.pos - I;
      we.isDashed ? _e.push({
        type: "elem",
        elem: Se,
        shift: oe
      }) : _e.push({
        type: "elem",
        elem: be,
        shift: oe
      });
    }
    l = buildCommon.makeVList({
      positionType: "individualShift",
      children: _e
    }, t);
  }
  if (K.length === 0)
    return buildCommon.makeSpan(["mord"], [l], t);
  var le = buildCommon.makeVList({
    positionType: "individualShift",
    children: K
  }, t);
  return le = buildCommon.makeSpan(["tag"], [le], t), buildCommon.makeFragment([l, le]);
}, alignMap = {
  c: "center ",
  l: "left ",
  r: "right "
}, mathmlBuilder$5 = function(e, t) {
  for (var n = [], a = new mathMLTree.MathNode("mtd", [], ["mtr-glue"]), s = new mathMLTree.MathNode("mtd", [], ["mml-eqn-num"]), o = 0; o < e.body.length; o++) {
    for (var c = e.body[o], l = [], u = 0; u < c.length; u++)
      l.push(new mathMLTree.MathNode("mtd", [buildGroup(c[u], t)]));
    e.tags && e.tags[o] && (l.unshift(a), l.push(a), e.leqno ? l.unshift(s) : l.push(s)), n.push(new mathMLTree.MathNode("mtr", l));
  }
  var h = new mathMLTree.MathNode("mtable", n), d = e.arraystretch === 0.5 ? 0.1 : 0.16 + e.arraystretch - 1 + (e.addJot ? 0.09 : 0);
  h.setAttribute("rowspacing", makeEm(d));
  var w = "", b = "";
  if (e.cols && e.cols.length > 0) {
    var _ = e.cols, R = "", k = !1, C = 0, m = _.length;
    _[0].type === "separator" && (w += "top ", C = 1), _[_.length - 1].type === "separator" && (w += "bottom ", m -= 1);
    for (var A = C; A < m; A++)
      _[A].type === "align" ? (b += alignMap[_[A].align], k && (R += "none "), k = !0) : _[A].type === "separator" && k && (R += _[A].separator === "|" ? "solid " : "dashed ", k = !1);
    h.setAttribute("columnalign", b.trim()), /[sd]/.test(R) && h.setAttribute("columnlines", R.trim());
  }
  if (e.colSeparationType === "align") {
    for (var F = e.cols || [], f = "", g = 1; g < F.length; g++)
      f += g % 2 ? "0em " : "1em ";
    h.setAttribute("columnspacing", f.trim());
  } else e.colSeparationType === "alignat" || e.colSeparationType === "gather" ? h.setAttribute("columnspacing", "0em") : e.colSeparationType === "small" ? h.setAttribute("columnspacing", "0.2778em") : e.colSeparationType === "CD" ? h.setAttribute("columnspacing", "0.5em") : h.setAttribute("columnspacing", "1em");
  var y = "", E = e.hLinesBeforeRow;
  w += E[0].length > 0 ? "left " : "", w += E[E.length - 1].length > 0 ? "right " : "";
  for (var x = 1; x < E.length - 1; x++)
    y += E[x].length === 0 ? "none " : E[x][0] ? "dashed " : "solid ";
  return /[sd]/.test(y) && h.setAttribute("rowlines", y.trim()), w !== "" && (h = new mathMLTree.MathNode("menclose", [h]), h.setAttribute("notation", w.trim())), e.arraystretch && e.arraystretch < 1 && (h = new mathMLTree.MathNode("mstyle", [h]), h.setAttribute("scriptlevel", "1")), h;
}, alignedHandler = function(e, t) {
  e.envName.indexOf("ed") === -1 && validateAmsEnvironmentContext(e);
  var n = [], a = e.envName.indexOf("at") > -1 ? "alignat" : "align", s = e.envName === "split", o = parseArray(e.parser, {
    cols: n,
    addJot: !0,
    autoTag: s ? void 0 : getAutoTag(e.envName),
    emptySingleRow: !0,
    colSeparationType: a,
    maxNumCols: s ? 2 : void 0,
    leqno: e.parser.settings.leqno
  }, "display"), c, l = 0, u = {
    type: "ordgroup",
    mode: e.mode,
    body: []
  };
  if (t[0] && t[0].type === "ordgroup") {
    for (var h = "", d = 0; d < t[0].body.length; d++) {
      var w = assertNodeType(t[0].body[d], "textord");
      h += w.text;
    }
    c = Number(h), l = c * 2;
  }
  var b = !l;
  o.body.forEach(function(C) {
    for (var m = 1; m < C.length; m += 2) {
      var A = assertNodeType(C[m], "styling"), F = assertNodeType(A.body[0], "ordgroup");
      F.body.unshift(u);
    }
    if (b)
      l < C.length && (l = C.length);
    else {
      var f = C.length / 2;
      if (c < f)
        throw new ParseError("Too many math in a row: " + ("expected " + c + ", but got " + f), C[0]);
    }
  });
  for (var _ = 0; _ < l; ++_) {
    var R = "r", k = 0;
    _ % 2 === 1 ? R = "l" : _ > 0 && b && (k = 1), n[_] = {
      type: "align",
      align: R,
      pregap: k,
      postgap: 0
    };
  }
  return o.colSeparationType = b ? "align" : "alignat", o;
};
defineEnvironment({
  type: "array",
  names: ["array", "darray"],
  props: {
    numArgs: 1
  },
  handler(r, e) {
    var t = checkSymbolNodeType(e[0]), n = t ? [e[0]] : assertNodeType(e[0], "ordgroup").body, a = n.map(function(o) {
      var c = assertSymbolNodeType(o), l = c.text;
      if ("lcr".indexOf(l) !== -1)
        return {
          type: "align",
          align: l
        };
      if (l === "|")
        return {
          type: "separator",
          separator: "|"
        };
      if (l === ":")
        return {
          type: "separator",
          separator: ":"
        };
      throw new ParseError("Unknown column alignment: " + l, o);
    }), s = {
      cols: a,
      hskipBeforeAndAfter: !0,
      // \@preamble in lttab.dtx
      maxNumCols: a.length
    };
    return parseArray(r.parser, s, dCellStyle(r.envName));
  },
  htmlBuilder: htmlBuilder$6,
  mathmlBuilder: mathmlBuilder$5
});
defineEnvironment({
  type: "array",
  names: ["matrix", "pmatrix", "bmatrix", "Bmatrix", "vmatrix", "Vmatrix", "matrix*", "pmatrix*", "bmatrix*", "Bmatrix*", "vmatrix*", "Vmatrix*"],
  props: {
    numArgs: 0
  },
  handler(r) {
    var e = {
      matrix: null,
      pmatrix: ["(", ")"],
      bmatrix: ["[", "]"],
      Bmatrix: ["\\{", "\\}"],
      vmatrix: ["|", "|"],
      Vmatrix: ["\\Vert", "\\Vert"]
    }[r.envName.replace("*", "")], t = "c", n = {
      hskipBeforeAndAfter: !1,
      cols: [{
        type: "align",
        align: t
      }]
    };
    if (r.envName.charAt(r.envName.length - 1) === "*") {
      var a = r.parser;
      if (a.consumeSpaces(), a.fetch().text === "[") {
        if (a.consume(), a.consumeSpaces(), t = a.fetch().text, "lcr".indexOf(t) === -1)
          throw new ParseError("Expected l or c or r", a.nextToken);
        a.consume(), a.consumeSpaces(), a.expect("]"), a.consume(), n.cols = [{
          type: "align",
          align: t
        }];
      }
    }
    var s = parseArray(r.parser, n, dCellStyle(r.envName)), o = Math.max(0, ...s.body.map((c) => c.length));
    return s.cols = new Array(o).fill({
      type: "align",
      align: t
    }), e ? {
      type: "leftright",
      mode: r.mode,
      body: [s],
      left: e[0],
      right: e[1],
      rightColor: void 0
      // \right uninfluenced by \color in array
    } : s;
  },
  htmlBuilder: htmlBuilder$6,
  mathmlBuilder: mathmlBuilder$5
});
defineEnvironment({
  type: "array",
  names: ["smallmatrix"],
  props: {
    numArgs: 0
  },
  handler(r) {
    var e = {
      arraystretch: 0.5
    }, t = parseArray(r.parser, e, "script");
    return t.colSeparationType = "small", t;
  },
  htmlBuilder: htmlBuilder$6,
  mathmlBuilder: mathmlBuilder$5
});
defineEnvironment({
  type: "array",
  names: ["subarray"],
  props: {
    numArgs: 1
  },
  handler(r, e) {
    var t = checkSymbolNodeType(e[0]), n = t ? [e[0]] : assertNodeType(e[0], "ordgroup").body, a = n.map(function(o) {
      var c = assertSymbolNodeType(o), l = c.text;
      if ("lc".indexOf(l) !== -1)
        return {
          type: "align",
          align: l
        };
      throw new ParseError("Unknown column alignment: " + l, o);
    });
    if (a.length > 1)
      throw new ParseError("{subarray} can contain only one column");
    var s = {
      cols: a,
      hskipBeforeAndAfter: !1,
      arraystretch: 0.5
    };
    if (s = parseArray(r.parser, s, "script"), s.body.length > 0 && s.body[0].length > 1)
      throw new ParseError("{subarray} can contain only one column");
    return s;
  },
  htmlBuilder: htmlBuilder$6,
  mathmlBuilder: mathmlBuilder$5
});
defineEnvironment({
  type: "array",
  names: ["cases", "dcases", "rcases", "drcases"],
  props: {
    numArgs: 0
  },
  handler(r) {
    var e = {
      arraystretch: 1.2,
      cols: [{
        type: "align",
        align: "l",
        pregap: 0,
        // TODO(kevinb) get the current style.
        // For now we use the metrics for TEXT style which is what we were
        // doing before.  Before attempting to get the current style we
        // should look at TeX's behavior especially for \over and matrices.
        postgap: 1
        /* 1em quad */
      }, {
        type: "align",
        align: "l",
        pregap: 0,
        postgap: 0
      }]
    }, t = parseArray(r.parser, e, dCellStyle(r.envName));
    return {
      type: "leftright",
      mode: r.mode,
      body: [t],
      left: r.envName.indexOf("r") > -1 ? "." : "\\{",
      right: r.envName.indexOf("r") > -1 ? "\\}" : ".",
      rightColor: void 0
    };
  },
  htmlBuilder: htmlBuilder$6,
  mathmlBuilder: mathmlBuilder$5
});
defineEnvironment({
  type: "array",
  names: ["align", "align*", "aligned", "split"],
  props: {
    numArgs: 0
  },
  handler: alignedHandler,
  htmlBuilder: htmlBuilder$6,
  mathmlBuilder: mathmlBuilder$5
});
defineEnvironment({
  type: "array",
  names: ["gathered", "gather", "gather*"],
  props: {
    numArgs: 0
  },
  handler(r) {
    utils.contains(["gather", "gather*"], r.envName) && validateAmsEnvironmentContext(r);
    var e = {
      cols: [{
        type: "align",
        align: "c"
      }],
      addJot: !0,
      colSeparationType: "gather",
      autoTag: getAutoTag(r.envName),
      emptySingleRow: !0,
      leqno: r.parser.settings.leqno
    };
    return parseArray(r.parser, e, "display");
  },
  htmlBuilder: htmlBuilder$6,
  mathmlBuilder: mathmlBuilder$5
});
defineEnvironment({
  type: "array",
  names: ["alignat", "alignat*", "alignedat"],
  props: {
    numArgs: 1
  },
  handler: alignedHandler,
  htmlBuilder: htmlBuilder$6,
  mathmlBuilder: mathmlBuilder$5
});
defineEnvironment({
  type: "array",
  names: ["equation", "equation*"],
  props: {
    numArgs: 0
  },
  handler(r) {
    validateAmsEnvironmentContext(r);
    var e = {
      autoTag: getAutoTag(r.envName),
      emptySingleRow: !0,
      singleRow: !0,
      maxNumCols: 1,
      leqno: r.parser.settings.leqno
    };
    return parseArray(r.parser, e, "display");
  },
  htmlBuilder: htmlBuilder$6,
  mathmlBuilder: mathmlBuilder$5
});
defineEnvironment({
  type: "array",
  names: ["CD"],
  props: {
    numArgs: 0
  },
  handler(r) {
    return validateAmsEnvironmentContext(r), parseCD(r.parser);
  },
  htmlBuilder: htmlBuilder$6,
  mathmlBuilder: mathmlBuilder$5
});
defineMacro("\\nonumber", "\\gdef\\@eqnsw{0}");
defineMacro("\\notag", "\\nonumber");
defineFunction({
  type: "text",
  // Doesn't matter what this is.
  names: ["\\hline", "\\hdashline"],
  props: {
    numArgs: 0,
    allowedInText: !0,
    allowedInMath: !0
  },
  handler(r, e) {
    throw new ParseError(r.funcName + " valid only within array environment");
  }
});
var environments = _environments;
defineFunction({
  type: "environment",
  names: ["\\begin", "\\end"],
  props: {
    numArgs: 1,
    argTypes: ["text"]
  },
  handler(r, e) {
    var {
      parser: t,
      funcName: n
    } = r, a = e[0];
    if (a.type !== "ordgroup")
      throw new ParseError("Invalid environment name", a);
    for (var s = "", o = 0; o < a.body.length; ++o)
      s += assertNodeType(a.body[o], "textord").text;
    if (n === "\\begin") {
      if (!environments.hasOwnProperty(s))
        throw new ParseError("No such environment: " + s, a);
      var c = environments[s], {
        args: l,
        optArgs: u
      } = t.parseArguments("\\begin{" + s + "}", c), h = {
        mode: t.mode,
        envName: s,
        parser: t
      }, d = c.handler(h, l, u);
      t.expect("\\end", !1);
      var w = t.nextToken, b = assertNodeType(t.parseFunction(), "environment");
      if (b.name !== s)
        throw new ParseError("Mismatch: \\begin{" + s + "} matched by \\end{" + b.name + "}", w);
      return d;
    }
    return {
      type: "environment",
      mode: t.mode,
      name: s,
      nameGroup: a
    };
  }
});
var htmlBuilder$5 = (r, e) => {
  var t = r.font, n = e.withFont(t);
  return buildGroup$1(r.body, n);
}, mathmlBuilder$4 = (r, e) => {
  var t = r.font, n = e.withFont(t);
  return buildGroup(r.body, n);
}, fontAliases = {
  "\\Bbb": "\\mathbb",
  "\\bold": "\\mathbf",
  "\\frak": "\\mathfrak",
  "\\bm": "\\boldsymbol"
};
defineFunction({
  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: (r, e) => {
    var {
      parser: t,
      funcName: n
    } = r, a = normalizeArgument(e[0]), s = n;
    return s in fontAliases && (s = fontAliases[s]), {
      type: "font",
      mode: t.mode,
      font: s.slice(1),
      body: a
    };
  },
  htmlBuilder: htmlBuilder$5,
  mathmlBuilder: mathmlBuilder$4
});
defineFunction({
  type: "mclass",
  names: ["\\boldsymbol", "\\bm"],
  props: {
    numArgs: 1
  },
  handler: (r, e) => {
    var {
      parser: t
    } = r, n = e[0], a = utils.isCharacterBox(n);
    return {
      type: "mclass",
      mode: t.mode,
      mclass: binrelClass(n),
      body: [{
        type: "font",
        mode: t.mode,
        font: "boldsymbol",
        body: n
      }],
      isCharacterBox: a
    };
  }
});
defineFunction({
  type: "font",
  names: ["\\rm", "\\sf", "\\tt", "\\bf", "\\it", "\\cal"],
  props: {
    numArgs: 0,
    allowedInText: !0
  },
  handler: (r, e) => {
    var {
      parser: t,
      funcName: n,
      breakOnTokenText: a
    } = r, {
      mode: s
    } = t, o = t.parseExpression(!0, a), c = "math" + n.slice(1);
    return {
      type: "font",
      mode: s,
      font: c,
      body: {
        type: "ordgroup",
        mode: t.mode,
        body: o
      }
    };
  },
  htmlBuilder: htmlBuilder$5,
  mathmlBuilder: mathmlBuilder$4
});
var adjustStyle = (r, e) => {
  var t = e;
  return r === "display" ? t = t.id >= Style$1.SCRIPT.id ? t.text() : Style$1.DISPLAY : r === "text" && t.size === Style$1.DISPLAY.size ? t = Style$1.TEXT : r === "script" ? t = Style$1.SCRIPT : r === "scriptscript" && (t = Style$1.SCRIPTSCRIPT), t;
}, htmlBuilder$4 = (r, e) => {
  var t = adjustStyle(r.size, e.style), n = t.fracNum(), a = t.fracDen(), s;
  s = e.havingStyle(n);
  var o = buildGroup$1(r.numer, s, e);
  if (r.continued) {
    var c = 8.5 / e.fontMetrics().ptPerEm, l = 3.5 / e.fontMetrics().ptPerEm;
    o.height = o.height < c ? c : o.height, o.depth = o.depth < l ? l : o.depth;
  }
  s = e.havingStyle(a);
  var u = buildGroup$1(r.denom, s, e), h, d, w;
  r.hasBarLine ? (r.barSize ? (d = calculateSize(r.barSize, e), h = buildCommon.makeLineSpan("frac-line", e, d)) : h = buildCommon.makeLineSpan("frac-line", e), d = h.height, w = h.height) : (h = null, d = 0, w = e.fontMetrics().defaultRuleThickness);
  var b, _, R;
  t.size === Style$1.DISPLAY.size || r.size === "display" ? (b = e.fontMetrics().num1, d > 0 ? _ = 3 * w : _ = 7 * w, R = e.fontMetrics().denom1) : (d > 0 ? (b = e.fontMetrics().num2, _ = w) : (b = e.fontMetrics().num3, _ = 3 * w), R = e.fontMetrics().denom2);
  var k;
  if (h) {
    var m = e.fontMetrics().axisHeight;
    b - o.depth - (m + 0.5 * d) < _ && (b += _ - (b - o.depth - (m + 0.5 * d))), m - 0.5 * d - (u.height - R) < _ && (R += _ - (m - 0.5 * d - (u.height - R)));
    var A = -(m - 0.5 * d);
    k = buildCommon.makeVList({
      positionType: "individualShift",
      children: [{
        type: "elem",
        elem: u,
        shift: R
      }, {
        type: "elem",
        elem: h,
        shift: A
      }, {
        type: "elem",
        elem: o,
        shift: -b
      }]
    }, e);
  } else {
    var C = b - o.depth - (u.height - R);
    C < _ && (b += 0.5 * (_ - C), R += 0.5 * (_ - C)), k = buildCommon.makeVList({
      positionType: "individualShift",
      children: [{
        type: "elem",
        elem: u,
        shift: R
      }, {
        type: "elem",
        elem: o,
        shift: -b
      }]
    }, e);
  }
  s = e.havingStyle(t), k.height *= s.sizeMultiplier / e.sizeMultiplier, k.depth *= s.sizeMultiplier / e.sizeMultiplier;
  var F;
  t.size === Style$1.DISPLAY.size ? F = e.fontMetrics().delim1 : t.size === Style$1.SCRIPTSCRIPT.size ? F = e.havingStyle(Style$1.SCRIPT).fontMetrics().delim2 : F = e.fontMetrics().delim2;
  var f, g;
  return r.leftDelim == null ? f = makeNullDelimiter(e, ["mopen"]) : f = delimiter.customSizedDelim(r.leftDelim, F, !0, e.havingStyle(t), r.mode, ["mopen"]), r.continued ? g = buildCommon.makeSpan([]) : r.rightDelim == null ? g = makeNullDelimiter(e, ["mclose"]) : g = delimiter.customSizedDelim(r.rightDelim, F, !0, e.havingStyle(t), r.mode, ["mclose"]), buildCommon.makeSpan(["mord"].concat(s.sizingClasses(e)), [f, buildCommon.makeSpan(["mfrac"], [k]), g], e);
}, mathmlBuilder$3 = (r, e) => {
  var t = new mathMLTree.MathNode("mfrac", [buildGroup(r.numer, e), buildGroup(r.denom, e)]);
  if (!r.hasBarLine)
    t.setAttribute("linethickness", "0px");
  else if (r.barSize) {
    var n = calculateSize(r.barSize, e);
    t.setAttribute("linethickness", makeEm(n));
  }
  var a = adjustStyle(r.size, e.style);
  if (a.size !== e.style.size) {
    t = new mathMLTree.MathNode("mstyle", [t]);
    var s = a.size === Style$1.DISPLAY.size ? "true" : "false";
    t.setAttribute("displaystyle", s), t.setAttribute("scriptlevel", "0");
  }
  if (r.leftDelim != null || r.rightDelim != null) {
    var o = [];
    if (r.leftDelim != null) {
      var c = new mathMLTree.MathNode("mo", [new mathMLTree.TextNode(r.leftDelim.replace("\\", ""))]);
      c.setAttribute("fence", "true"), o.push(c);
    }
    if (o.push(t), r.rightDelim != null) {
      var l = new mathMLTree.MathNode("mo", [new mathMLTree.TextNode(r.rightDelim.replace("\\", ""))]);
      l.setAttribute("fence", "true"), o.push(l);
    }
    return makeRow(o);
  }
  return t;
};
defineFunction({
  type: "genfrac",
  names: [
    "\\dfrac",
    "\\frac",
    "\\tfrac",
    "\\dbinom",
    "\\binom",
    "\\tbinom",
    "\\\\atopfrac",
    // can’t be entered directly
    "\\\\bracefrac",
    "\\\\brackfrac"
    // ditto
  ],
  props: {
    numArgs: 2,
    allowedInArgument: !0
  },
  handler: (r, e) => {
    var {
      parser: t,
      funcName: n
    } = r, a = e[0], s = e[1], o, c = null, l = null, u = "auto";
    switch (n) {
      case "\\dfrac":
      case "\\frac":
      case "\\tfrac":
        o = !0;
        break;
      case "\\\\atopfrac":
        o = !1;
        break;
      case "\\dbinom":
      case "\\binom":
      case "\\tbinom":
        o = !1, c = "(", l = ")";
        break;
      case "\\\\bracefrac":
        o = !1, c = "\\{", l = "\\}";
        break;
      case "\\\\brackfrac":
        o = !1, c = "[", l = "]";
        break;
      default:
        throw new Error("Unrecognized genfrac command");
    }
    switch (n) {
      case "\\dfrac":
      case "\\dbinom":
        u = "display";
        break;
      case "\\tfrac":
      case "\\tbinom":
        u = "text";
        break;
    }
    return {
      type: "genfrac",
      mode: t.mode,
      continued: !1,
      numer: a,
      denom: s,
      hasBarLine: o,
      leftDelim: c,
      rightDelim: l,
      size: u,
      barSize: null
    };
  },
  htmlBuilder: htmlBuilder$4,
  mathmlBuilder: mathmlBuilder$3
});
defineFunction({
  type: "genfrac",
  names: ["\\cfrac"],
  props: {
    numArgs: 2
  },
  handler: (r, e) => {
    var {
      parser: t,
      funcName: n
    } = r, a = e[0], s = e[1];
    return {
      type: "genfrac",
      mode: t.mode,
      continued: !0,
      numer: a,
      denom: s,
      hasBarLine: !0,
      leftDelim: null,
      rightDelim: null,
      size: "display",
      barSize: null
    };
  }
});
defineFunction({
  type: "infix",
  names: ["\\over", "\\choose", "\\atop", "\\brace", "\\brack"],
  props: {
    numArgs: 0,
    infix: !0
  },
  handler(r) {
    var {
      parser: e,
      funcName: t,
      token: n
    } = r, a;
    switch (t) {
      case "\\over":
        a = "\\frac";
        break;
      case "\\choose":
        a = "\\binom";
        break;
      case "\\atop":
        a = "\\\\atopfrac";
        break;
      case "\\brace":
        a = "\\\\bracefrac";
        break;
      case "\\brack":
        a = "\\\\brackfrac";
        break;
      default:
        throw new Error("Unrecognized infix genfrac command");
    }
    return {
      type: "infix",
      mode: e.mode,
      replaceWith: a,
      token: n
    };
  }
});
var stylArray = ["display", "text", "script", "scriptscript"], delimFromValue = function(e) {
  var t = null;
  return e.length > 0 && (t = e, t = t === "." ? null : t), t;
};
defineFunction({
  type: "genfrac",
  names: ["\\genfrac"],
  props: {
    numArgs: 6,
    allowedInArgument: !0,
    argTypes: ["math", "math", "size", "text", "math", "math"]
  },
  handler(r, e) {
    var {
      parser: t
    } = r, n = e[4], a = e[5], s = normalizeArgument(e[0]), o = s.type === "atom" && s.family === "open" ? delimFromValue(s.text) : null, c = normalizeArgument(e[1]), l = c.type === "atom" && c.family === "close" ? delimFromValue(c.text) : null, u = assertNodeType(e[2], "size"), h, d = null;
    u.isBlank ? h = !0 : (d = u.value, h = d.number > 0);
    var w = "auto", b = e[3];
    if (b.type === "ordgroup") {
      if (b.body.length > 0) {
        var _ = assertNodeType(b.body[0], "textord");
        w = stylArray[Number(_.text)];
      }
    } else
      b = assertNodeType(b, "textord"), w = stylArray[Number(b.text)];
    return {
      type: "genfrac",
      mode: t.mode,
      numer: n,
      denom: a,
      continued: !1,
      hasBarLine: h,
      barSize: d,
      leftDelim: o,
      rightDelim: l,
      size: w
    };
  },
  htmlBuilder: htmlBuilder$4,
  mathmlBuilder: mathmlBuilder$3
});
defineFunction({
  type: "infix",
  names: ["\\above"],
  props: {
    numArgs: 1,
    argTypes: ["size"],
    infix: !0
  },
  handler(r, e) {
    var {
      parser: t,
      funcName: n,
      token: a
    } = r;
    return {
      type: "infix",
      mode: t.mode,
      replaceWith: "\\\\abovefrac",
      size: assertNodeType(e[0], "size").value,
      token: a
    };
  }
});
defineFunction({
  type: "genfrac",
  names: ["\\\\abovefrac"],
  props: {
    numArgs: 3,
    argTypes: ["math", "size", "math"]
  },
  handler: (r, e) => {
    var {
      parser: t,
      funcName: n
    } = r, a = e[0], s = assert(assertNodeType(e[1], "infix").size), o = e[2], c = s.number > 0;
    return {
      type: "genfrac",
      mode: t.mode,
      numer: a,
      denom: o,
      continued: !1,
      hasBarLine: c,
      barSize: s,
      leftDelim: null,
      rightDelim: null,
      size: "auto"
    };
  },
  htmlBuilder: htmlBuilder$4,
  mathmlBuilder: mathmlBuilder$3
});
var htmlBuilder$3 = (r, e) => {
  var t = e.style, n, a;
  r.type === "supsub" ? (n = r.sup ? buildGroup$1(r.sup, e.havingStyle(t.sup()), e) : buildGroup$1(r.sub, e.havingStyle(t.sub()), e), a = assertNodeType(r.base, "horizBrace")) : a = assertNodeType(r, "horizBrace");
  var s = buildGroup$1(a.base, e.havingBaseStyle(Style$1.DISPLAY)), o = stretchy.svgSpan(a, e), c;
  if (a.isOver ? (c = buildCommon.makeVList({
    positionType: "firstBaseline",
    children: [{
      type: "elem",
      elem: s
    }, {
      type: "kern",
      size: 0.1
    }, {
      type: "elem",
      elem: o
    }]
  }, e), c.children[0].children[0].children[1].classes.push("svg-align")) : (c = buildCommon.makeVList({
    positionType: "bottom",
    positionData: s.depth + 0.1 + o.height,
    children: [{
      type: "elem",
      elem: o
    }, {
      type: "kern",
      size: 0.1
    }, {
      type: "elem",
      elem: s
    }]
  }, e), c.children[0].children[0].children[0].classes.push("svg-align")), n) {
    var l = buildCommon.makeSpan(["mord", a.isOver ? "mover" : "munder"], [c], e);
    a.isOver ? c = buildCommon.makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: l
      }, {
        type: "kern",
        size: 0.2
      }, {
        type: "elem",
        elem: n
      }]
    }, e) : c = buildCommon.makeVList({
      positionType: "bottom",
      positionData: l.depth + 0.2 + n.height + n.depth,
      children: [{
        type: "elem",
        elem: n
      }, {
        type: "kern",
        size: 0.2
      }, {
        type: "elem",
        elem: l
      }]
    }, e);
  }
  return buildCommon.makeSpan(["mord", a.isOver ? "mover" : "munder"], [c], e);
}, mathmlBuilder$2 = (r, e) => {
  var t = stretchy.mathMLnode(r.label);
  return new mathMLTree.MathNode(r.isOver ? "mover" : "munder", [buildGroup(r.base, e), t]);
};
defineFunction({
  type: "horizBrace",
  names: ["\\overbrace", "\\underbrace"],
  props: {
    numArgs: 1
  },
  handler(r, e) {
    var {
      parser: t,
      funcName: n
    } = r;
    return {
      type: "horizBrace",
      mode: t.mode,
      label: n,
      isOver: /^\\over/.test(n),
      base: e[0]
    };
  },
  htmlBuilder: htmlBuilder$3,
  mathmlBuilder: mathmlBuilder$2
});
defineFunction({
  type: "href",
  names: ["\\href"],
  props: {
    numArgs: 2,
    argTypes: ["url", "original"],
    allowedInText: !0
  },
  handler: (r, e) => {
    var {
      parser: t
    } = r, n = e[1], a = assertNodeType(e[0], "url").url;
    return t.settings.isTrusted({
      command: "\\href",
      url: a
    }) ? {
      type: "href",
      mode: t.mode,
      href: a,
      body: ordargument(n)
    } : t.formatUnsupportedCmd("\\href");
  },
  htmlBuilder: (r, e) => {
    var t = buildExpression$1(r.body, e, !1);
    return buildCommon.makeAnchor(r.href, [], t, e);
  },
  mathmlBuilder: (r, e) => {
    var t = buildExpressionRow(r.body, e);
    return t instanceof MathNode || (t = new MathNode("mrow", [t])), t.setAttribute("href", r.href), t;
  }
});
defineFunction({
  type: "href",
  names: ["\\url"],
  props: {
    numArgs: 1,
    argTypes: ["url"],
    allowedInText: !0
  },
  handler: (r, e) => {
    var {
      parser: t
    } = r, n = assertNodeType(e[0], "url").url;
    if (!t.settings.isTrusted({
      command: "\\url",
      url: n
    }))
      return t.formatUnsupportedCmd("\\url");
    for (var a = [], s = 0; s < n.length; s++) {
      var o = n[s];
      o === "~" && (o = "\\textasciitilde"), a.push({
        type: "textord",
        mode: "text",
        text: o
      });
    }
    var c = {
      type: "text",
      mode: t.mode,
      font: "\\texttt",
      body: a
    };
    return {
      type: "href",
      mode: t.mode,
      href: n,
      body: ordargument(c)
    };
  }
});
defineFunction({
  type: "hbox",
  names: ["\\hbox"],
  props: {
    numArgs: 1,
    argTypes: ["text"],
    allowedInText: !0,
    primitive: !0
  },
  handler(r, e) {
    var {
      parser: t
    } = r;
    return {
      type: "hbox",
      mode: t.mode,
      body: ordargument(e[0])
    };
  },
  htmlBuilder(r, e) {
    var t = buildExpression$1(r.body, e, !1);
    return buildCommon.makeFragment(t);
  },
  mathmlBuilder(r, e) {
    return new mathMLTree.MathNode("mrow", buildExpression(r.body, e));
  }
});
defineFunction({
  type: "html",
  names: ["\\htmlClass", "\\htmlId", "\\htmlStyle", "\\htmlData"],
  props: {
    numArgs: 2,
    argTypes: ["raw", "original"],
    allowedInText: !0
  },
  handler: (r, e) => {
    var {
      parser: t,
      funcName: n,
      token: a
    } = r, s = assertNodeType(e[0], "raw").string, o = e[1];
    t.settings.strict && t.settings.reportNonstrict("htmlExtension", "HTML extension is disabled on strict mode");
    var c, l = {};
    switch (n) {
      case "\\htmlClass":
        l.class = s, c = {
          command: "\\htmlClass",
          class: s
        };
        break;
      case "\\htmlId":
        l.id = s, c = {
          command: "\\htmlId",
          id: s
        };
        break;
      case "\\htmlStyle":
        l.style = s, c = {
          command: "\\htmlStyle",
          style: s
        };
        break;
      case "\\htmlData": {
        for (var u = s.split(","), h = 0; h < u.length; h++) {
          var d = u[h].split("=");
          if (d.length !== 2)
            throw new ParseError("Error parsing key-value for \\htmlData");
          l["data-" + d[0].trim()] = d[1].trim();
        }
        c = {
          command: "\\htmlData",
          attributes: l
        };
        break;
      }
      default:
        throw new Error("Unrecognized html command");
    }
    return t.settings.isTrusted(c) ? {
      type: "html",
      mode: t.mode,
      attributes: l,
      body: ordargument(o)
    } : t.formatUnsupportedCmd(n);
  },
  htmlBuilder: (r, e) => {
    var t = buildExpression$1(r.body, e, !1), n = ["enclosing"];
    r.attributes.class && n.push(...r.attributes.class.trim().split(/\s+/));
    var a = buildCommon.makeSpan(n, t, e);
    for (var s in r.attributes)
      s !== "class" && r.attributes.hasOwnProperty(s) && a.setAttribute(s, r.attributes[s]);
    return a;
  },
  mathmlBuilder: (r, e) => buildExpressionRow(r.body, e)
});
defineFunction({
  type: "htmlmathml",
  names: ["\\html@mathml"],
  props: {
    numArgs: 2,
    allowedInText: !0
  },
  handler: (r, e) => {
    var {
      parser: t
    } = r;
    return {
      type: "htmlmathml",
      mode: t.mode,
      html: ordargument(e[0]),
      mathml: ordargument(e[1])
    };
  },
  htmlBuilder: (r, e) => {
    var t = buildExpression$1(r.html, e, !1);
    return buildCommon.makeFragment(t);
  },
  mathmlBuilder: (r, e) => buildExpressionRow(r.mathml, e)
});
var sizeData = 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 ParseError("Invalid size: '" + e + "' in \\includegraphics");
  var n = {
    number: +(t[1] + t[2]),
    // sign + magnitude, cast to number
    unit: t[3]
  };
  if (!validUnit(n))
    throw new ParseError("Invalid unit: '" + n.unit + "' in \\includegraphics.");
  return n;
};
defineFunction({
  type: "includegraphics",
  names: ["\\includegraphics"],
  props: {
    numArgs: 1,
    numOptionalArgs: 1,
    argTypes: ["raw", "url"],
    allowedInText: !1
  },
  handler: (r, e, t) => {
    var {
      parser: n
    } = r, a = {
      number: 0,
      unit: "em"
    }, s = {
      number: 0.9,
      unit: "em"
    }, o = {
      number: 0,
      unit: "em"
    }, c = "";
    if (t[0])
      for (var l = assertNodeType(t[0], "raw").string, u = l.split(","), h = 0; h < u.length; h++) {
        var d = u[h].split("=");
        if (d.length === 2) {
          var w = d[1].trim();
          switch (d[0].trim()) {
            case "alt":
              c = w;
              break;
            case "width":
              a = sizeData(w);
              break;
            case "height":
              s = sizeData(w);
              break;
            case "totalheight":
              o = sizeData(w);
              break;
            default:
              throw new ParseError("Invalid key: '" + d[0] + "' in \\includegraphics.");
          }
        }
      }
    var b = assertNodeType(e[0], "url").url;
    return c === "" && (c = b, c = c.replace(/^.*[\\/]/, ""), c = c.substring(0, c.lastIndexOf("."))), n.settings.isTrusted({
      command: "\\includegraphics",
      url: b
    }) ? {
      type: "includegraphics",
      mode: n.mode,
      alt: c,
      width: a,
      height: s,
      totalheight: o,
      src: b
    } : n.formatUnsupportedCmd("\\includegraphics");
  },
  htmlBuilder: (r, e) => {
    var t = calculateSize(r.height, e), n = 0;
    r.totalheight.number > 0 && (n = calculateSize(r.totalheight, e) - t);
    var a = 0;
    r.width.number > 0 && (a = calculateSize(r.width, e));
    var s = {
      height: makeEm(t + n)
    };
    a > 0 && (s.width = makeEm(a)), n > 0 && (s.verticalAlign = makeEm(-n));
    var o = new Img(r.src, r.alt, s);
    return o.height = t, o.depth = n, o;
  },
  mathmlBuilder: (r, e) => {
    var t = new mathMLTree.MathNode("mglyph", []);
    t.setAttribute("alt", r.alt);
    var n = calculateSize(r.height, e), a = 0;
    if (r.totalheight.number > 0 && (a = calculateSize(r.totalheight, e) - n, t.setAttribute("valign", makeEm(-a))), t.setAttribute("height", makeEm(n + a)), r.width.number > 0) {
      var s = calculateSize(r.width, e);
      t.setAttribute("width", makeEm(s));
    }
    return t.setAttribute("src", r.src), t;
  }
});
defineFunction({
  type: "kern",
  names: ["\\kern", "\\mkern", "\\hskip", "\\mskip"],
  props: {
    numArgs: 1,
    argTypes: ["size"],
    primitive: !0,
    allowedInText: !0
  },
  handler(r, e) {
    var {
      parser: t,
      funcName: n
    } = r, a = assertNodeType(e[0], "size");
    if (t.settings.strict) {
      var s = n[1] === "m", o = a.value.unit === "mu";
      s ? (o || t.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + n + " supports only mu units, " + ("not " + a.value.unit + " units")), t.mode !== "math" && t.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + n + " works only in math mode")) : o && t.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + n + " doesn't support mu units");
    }
    return {
      type: "kern",
      mode: t.mode,
      dimension: a.value
    };
  },
  htmlBuilder(r, e) {
    return buildCommon.makeGlue(r.dimension, e);
  },
  mathmlBuilder(r, e) {
    var t = calculateSize(r.dimension, e);
    return new mathMLTree.SpaceNode(t);
  }
});
defineFunction({
  type: "lap",
  names: ["\\mathllap", "\\mathrlap", "\\mathclap"],
  props: {
    numArgs: 1,
    allowedInText: !0
  },
  handler: (r, e) => {
    var {
      parser: t,
      funcName: n
    } = r, a = e[0];
    return {
      type: "lap",
      mode: t.mode,
      alignment: n.slice(5),
      body: a
    };
  },
  htmlBuilder: (r, e) => {
    var t;
    r.alignment === "clap" ? (t = buildCommon.makeSpan([], [buildGroup$1(r.body, e)]), t = buildCommon.makeSpan(["inner"], [t], e)) : t = buildCommon.makeSpan(["inner"], [buildGroup$1(r.body, e)]);
    var n = buildCommon.makeSpan(["fix"], []), a = buildCommon.makeSpan([r.alignment], [t, n], e), s = buildCommon.makeSpan(["strut"]);
    return s.style.height = makeEm(a.height + a.depth), a.depth && (s.style.verticalAlign = makeEm(-a.depth)), a.children.unshift(s), a = buildCommon.makeSpan(["thinbox"], [a], e), buildCommon.makeSpan(["mord", "vbox"], [a], e);
  },
  mathmlBuilder: (r, e) => {
    var t = new mathMLTree.MathNode("mpadded", [buildGroup(r.body, e)]);
    if (r.alignment !== "rlap") {
      var n = r.alignment === "llap" ? "-1" : "-0.5";
      t.setAttribute("lspace", n + "width");
    }
    return t.setAttribute("width", "0px"), t;
  }
});
defineFunction({
  type: "styling",
  names: ["\\(", "$"],
  props: {
    numArgs: 0,
    allowedInText: !0,
    allowedInMath: !1
  },
  handler(r, e) {
    var {
      funcName: t,
      parser: n
    } = r, a = n.mode;
    n.switchMode("math");
    var s = t === "\\(" ? "\\)" : "$", o = n.parseExpression(!1, s);
    return n.expect(s), n.switchMode(a), {
      type: "styling",
      mode: n.mode,
      style: "text",
      body: o
    };
  }
});
defineFunction({
  type: "text",
  // Doesn't matter what this is.
  names: ["\\)", "\\]"],
  props: {
    numArgs: 0,
    allowedInText: !0,
    allowedInMath: !1
  },
  handler(r, e) {
    throw new ParseError("Mismatched " + r.funcName);
  }
});
var chooseMathStyle = (r, e) => {
  switch (e.style.size) {
    case Style$1.DISPLAY.size:
      return r.display;
    case Style$1.TEXT.size:
      return r.text;
    case Style$1.SCRIPT.size:
      return r.script;
    case Style$1.SCRIPTSCRIPT.size:
      return r.scriptscript;
    default:
      return r.text;
  }
};
defineFunction({
  type: "mathchoice",
  names: ["\\mathchoice"],
  props: {
    numArgs: 4,
    primitive: !0
  },
  handler: (r, e) => {
    var {
      parser: t
    } = r;
    return {
      type: "mathchoice",
      mode: t.mode,
      display: ordargument(e[0]),
      text: ordargument(e[1]),
      script: ordargument(e[2]),
      scriptscript: ordargument(e[3])
    };
  },
  htmlBuilder: (r, e) => {
    var t = chooseMathStyle(r, e), n = buildExpression$1(t, e, !1);
    return buildCommon.makeFragment(n);
  },
  mathmlBuilder: (r, e) => {
    var t = chooseMathStyle(r, e);
    return buildExpressionRow(t, e);
  }
});
var assembleSupSub = (r, e, t, n, a, s, o) => {
  r = buildCommon.makeSpan([], [r]);
  var c = t && utils.isCharacterBox(t), l, u;
  if (e) {
    var h = buildGroup$1(e, n.havingStyle(a.sup()), n);
    u = {
      elem: h,
      kern: Math.max(n.fontMetrics().bigOpSpacing1, n.fontMetrics().bigOpSpacing3 - h.depth)
    };
  }
  if (t) {
    var d = buildGroup$1(t, n.havingStyle(a.sub()), n);
    l = {
      elem: d,
      kern: Math.max(n.fontMetrics().bigOpSpacing2, n.fontMetrics().bigOpSpacing4 - d.height)
    };
  }
  var w;
  if (u && l) {
    var b = n.fontMetrics().bigOpSpacing5 + l.elem.height + l.elem.depth + l.kern + r.depth + o;
    w = buildCommon.makeVList({
      positionType: "bottom",
      positionData: b,
      children: [{
        type: "kern",
        size: n.fontMetrics().bigOpSpacing5
      }, {
        type: "elem",
        elem: l.elem,
        marginLeft: makeEm(-s)
      }, {
        type: "kern",
        size: l.kern
      }, {
        type: "elem",
        elem: r
      }, {
        type: "kern",
        size: u.kern
      }, {
        type: "elem",
        elem: u.elem,
        marginLeft: makeEm(s)
      }, {
        type: "kern",
        size: n.fontMetrics().bigOpSpacing5
      }]
    }, n);
  } else if (l) {
    var _ = r.height - o;
    w = buildCommon.makeVList({
      positionType: "top",
      positionData: _,
      children: [{
        type: "kern",
        size: n.fontMetrics().bigOpSpacing5
      }, {
        type: "elem",
        elem: l.elem,
        marginLeft: makeEm(-s)
      }, {
        type: "kern",
        size: l.kern
      }, {
        type: "elem",
        elem: r
      }]
    }, n);
  } else if (u) {
    var R = r.depth + o;
    w = buildCommon.makeVList({
      positionType: "bottom",
      positionData: R,
      children: [{
        type: "elem",
        elem: r
      }, {
        type: "kern",
        size: u.kern
      }, {
        type: "elem",
        elem: u.elem,
        marginLeft: makeEm(s)
      }, {
        type: "kern",
        size: n.fontMetrics().bigOpSpacing5
      }]
    }, n);
  } else
    return r;
  var k = [w];
  if (l && s !== 0 && !c) {
    var C = buildCommon.makeSpan(["mspace"], [], n);
    C.style.marginRight = makeEm(s), k.unshift(C);
  }
  return buildCommon.makeSpan(["mop", "op-limits"], k, n);
}, noSuccessor = ["\\smallint"], htmlBuilder$2 = (r, e) => {
  var t, n, a = !1, s;
  r.type === "supsub" ? (t = r.sup, n = r.sub, s = assertNodeType(r.base, "op"), a = !0) : s = assertNodeType(r, "op");
  var o = e.style, c = !1;
  o.size === Style$1.DISPLAY.size && s.symbol && !utils.contains(noSuccessor, s.name) && (c = !0);
  var l;
  if (s.symbol) {
    var u = c ? "Size2-Regular" : "Size1-Regular", h = "";
    if ((s.name === "\\oiint" || s.name === "\\oiiint") && (h = s.name.slice(1), s.name = h === "oiint" ? "\\iint" : "\\iiint"), l = buildCommon.makeSymbol(s.name, u, "math", e, ["mop", "op-symbol", c ? "large-op" : "small-op"]), h.length > 0) {
      var d = l.italic, w = buildCommon.staticSvg(h + "Size" + (c ? "2" : "1"), e);
      l = buildCommon.makeVList({
        positionType: "individualShift",
        children: [{
          type: "elem",
          elem: l,
          shift: 0
        }, {
          type: "elem",
          elem: w,
          shift: c ? 0.08 : 0
        }]
      }, e), s.name = "\\" + h, l.classes.unshift("mop"), l.italic = d;
    }
  } else if (s.body) {
    var b = buildExpression$1(s.body, e, !0);
    b.length === 1 && b[0] instanceof SymbolNode ? (l = b[0], l.classes[0] = "mop") : l = buildCommon.makeSpan(["mop"], b, e);
  } else {
    for (var _ = [], R = 1; R < s.name.length; R++)
      _.push(buildCommon.mathsym(s.name[R], s.mode, e));
    l = buildCommon.makeSpan(["mop"], _, e);
  }
  var k = 0, C = 0;
  return (l instanceof SymbolNode || s.name === "\\oiint" || s.name === "\\oiiint") && !s.suppressBaseShift && (k = (l.height - l.depth) / 2 - e.fontMetrics().axisHeight, C = l.italic), a ? assembleSupSub(l, t, n, e, o, C, k) : (k && (l.style.position = "relative", l.style.top = makeEm(k)), l);
}, mathmlBuilder$1 = (r, e) => {
  var t;
  if (r.symbol)
    t = new MathNode("mo", [makeText(r.name, r.mode)]), utils.contains(noSuccessor, r.name) && t.setAttribute("largeop", "false");
  else if (r.body)
    t = new MathNode("mo", buildExpression(r.body, e));
  else {
    t = new MathNode("mi", [new TextNode(r.name.slice(1))]);
    var n = new MathNode("mo", [makeText("⁡", "text")]);
    r.parentIsSupSub ? t = new MathNode("mrow", [t, n]) : t = newDocumentFragment([t, n]);
  }
  return t;
}, singleCharBigOps = {
  "∏": "\\prod",
  "∐": "\\coprod",
  "∑": "\\sum",
  "⋀": "\\bigwedge",
  "⋁": "\\bigvee",
  "⋂": "\\bigcap",
  "⋃": "\\bigcup",
  "⨀": "\\bigodot",
  "⨁": "\\bigoplus",
  "⨂": "\\bigotimes",
  "⨄": "\\biguplus",
  "⨆": "\\bigsqcup"
};
defineFunction({
  type: "op",
  names: ["\\coprod", "\\bigvee", "\\bigwedge", "\\biguplus", "\\bigcap", "\\bigcup", "\\intop", "\\prod", "\\sum", "\\bigotimes", "\\bigoplus", "\\bigodot", "\\bigsqcup", "\\smallint", "∏", "∐", "∑", "⋀", "⋁", "⋂", "⋃", "⨀", "⨁", "⨂", "⨄", "⨆"],
  props: {
    numArgs: 0
  },
  handler: (r, e) => {
    var {
      parser: t,
      funcName: n
    } = r, a = n;
    return a.length === 1 && (a = singleCharBigOps[a]), {
      type: "op",
      mode: t.mode,
      limits: !0,
      parentIsSupSub: !1,
      symbol: !0,
      name: a
    };
  },
  htmlBuilder: htmlBuilder$2,
  mathmlBuilder: mathmlBuilder$1
});
defineFunction({
  type: "op",
  names: ["\\mathop"],
  props: {
    numArgs: 1,
    primitive: !0
  },
  handler: (r, e) => {
    var {
      parser: t
    } = r, n = e[0];
    return {
      type: "op",
      mode: t.mode,
      limits: !1,
      parentIsSupSub: !1,
      symbol: !1,
      body: ordargument(n)
    };
  },
  htmlBuilder: htmlBuilder$2,
  mathmlBuilder: mathmlBuilder$1
});
var singleCharIntegrals = {
  "∫": "\\int",
  "∬": "\\iint",
  "∭": "\\iiint",
  "∮": "\\oint",
  "∯": "\\oiint",
  "∰": "\\oiiint"
};
defineFunction({
  type: "op",
  names: ["\\arcsin", "\\arccos", "\\arctan", "\\arctg", "\\arcctg", "\\arg", "\\ch", "\\cos", "\\cosec", "\\cosh", "\\cot", "\\cotg", "\\coth", "\\csc", "\\ctg", "\\cth", "\\deg", "\\dim", "\\exp", "\\hom", "\\ker", "\\lg", "\\ln", "\\log", "\\sec", "\\sin", "\\sinh", "\\sh", "\\tan", "\\tanh", "\\tg", "\\th"],
  props: {
    numArgs: 0
  },
  handler(r) {
    var {
      parser: e,
      funcName: t
    } = r;
    return {
      type: "op",
      mode: e.mode,
      limits: !1,
      parentIsSupSub: !1,
      symbol: !1,
      name: t
    };
  },
  htmlBuilder: htmlBuilder$2,
  mathmlBuilder: mathmlBuilder$1
});
defineFunction({
  type: "op",
  names: ["\\det", "\\gcd", "\\inf", "\\lim", "\\max", "\\min", "\\Pr", "\\sup"],
  props: {
    numArgs: 0
  },
  handler(r) {
    var {
      parser: e,
      funcName: t
    } = r;
    return {
      type: "op",
      mode: e.mode,
      limits: !0,
      parentIsSupSub: !1,
      symbol: !1,
      name: t
    };
  },
  htmlBuilder: htmlBuilder$2,
  mathmlBuilder: mathmlBuilder$1
});
defineFunction({
  type: "op",
  names: ["\\int", "\\iint", "\\iiint", "\\oint", "\\oiint", "\\oiiint", "∫", "∬", "∭", "∮", "∯", "∰"],
  props: {
    numArgs: 0
  },
  handler(r) {
    var {
      parser: e,
      funcName: t
    } = r, n = t;
    return n.length === 1 && (n = singleCharIntegrals[n]), {
      type: "op",
      mode: e.mode,
      limits: !1,
      parentIsSupSub: !1,
      symbol: !0,
      name: n
    };
  },
  htmlBuilder: htmlBuilder$2,
  mathmlBuilder: mathmlBuilder$1
});
var htmlBuilder$1 = (r, e) => {
  var t, n, a = !1, s;
  r.type === "supsub" ? (t = r.sup, n = r.sub, s = assertNodeType(r.base, "operatorname"), a = !0) : s = assertNodeType(r, "operatorname");
  var o;
  if (s.body.length > 0) {
    for (var c = s.body.map((d) => {
      var w = d.text;
      return typeof w == "string" ? {
        type: "textord",
        mode: d.mode,
        text: w
      } : d;
    }), l = buildExpression$1(c, e.withFont("mathrm"), !0), u = 0; u < l.length; u++) {
      var h = l[u];
      h instanceof SymbolNode && (h.text = h.text.replace(/\u2212/, "-").replace(/\u2217/, "*"));
    }
    o = buildCommon.makeSpan(["mop"], l, e);
  } else
    o = buildCommon.makeSpan(["mop"], [], e);
  return a ? assembleSupSub(o, t, n, e, e.style, 0, 0) : o;
}, mathmlBuilder = (r, e) => {
  for (var t = buildExpression(r.body, e.withFont("mathrm")), n = !0, a = 0; a < t.length; a++) {
    var s = t[a];
    if (!(s instanceof mathMLTree.SpaceNode)) if (s instanceof mathMLTree.MathNode)
      switch (s.type) {
        case "mi":
        case "mn":
        case "ms":
        case "mspace":
        case "mtext":
          break;
        case "mo": {
          var o = s.children[0];
          s.children.length === 1 && o instanceof mathMLTree.TextNode ? o.text = o.text.replace(/\u2212/, "-").replace(/\u2217/, "*") : n = !1;
          break;
        }
        default:
          n = !1;
      }
    else
      n = !1;
  }
  if (n) {
    var c = t.map((h) => h.toText()).join("");
    t = [new mathMLTree.TextNode(c)];
  }
  var l = new mathMLTree.MathNode("mi", t);
  l.setAttribute("mathvariant", "normal");
  var u = new mathMLTree.MathNode("mo", [makeText("⁡", "text")]);
  return r.parentIsSupSub ? new mathMLTree.MathNode("mrow", [l, u]) : mathMLTree.newDocumentFragment([l, u]);
};
defineFunction({
  type: "operatorname",
  names: ["\\operatorname@", "\\operatornamewithlimits"],
  props: {
    numArgs: 1
  },
  handler: (r, e) => {
    var {
      parser: t,
      funcName: n
    } = r, a = e[0];
    return {
      type: "operatorname",
      mode: t.mode,
      body: ordargument(a),
      alwaysHandleSupSub: n === "\\operatornamewithlimits",
      limits: !1,
      parentIsSupSub: !1
    };
  },
  htmlBuilder: htmlBuilder$1,
  mathmlBuilder
});
defineMacro("\\operatorname", "\\@ifstar\\operatornamewithlimits\\operatorname@");
defineFunctionBuilders({
  type: "ordgroup",
  htmlBuilder(r, e) {
    return r.semisimple ? buildCommon.makeFragment(buildExpression$1(r.body, e, !1)) : buildCommon.makeSpan(["mord"], buildExpression$1(r.body, e, !0), e);
  },
  mathmlBuilder(r, e) {
    return buildExpressionRow(r.body, e, !0);
  }
});
defineFunction({
  type: "overline",
  names: ["\\overline"],
  props: {
    numArgs: 1
  },
  handler(r, e) {
    var {
      parser: t
    } = r, n = e[0];
    return {
      type: "overline",
      mode: t.mode,
      body: n
    };
  },
  htmlBuilder(r, e) {
    var t = buildGroup$1(r.body, e.havingCrampedStyle()), n = buildCommon.makeLineSpan("overline-line", e), a = e.fontMetrics().defaultRuleThickness, s = buildCommon.makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: t
      }, {
        type: "kern",
        size: 3 * a
      }, {
        type: "elem",
        elem: n
      }, {
        type: "kern",
        size: a
      }]
    }, e);
    return buildCommon.makeSpan(["mord", "overline"], [s], e);
  },
  mathmlBuilder(r, e) {
    var t = new mathMLTree.MathNode("mo", [new mathMLTree.TextNode("‾")]);
    t.setAttribute("stretchy", "true");
    var n = new mathMLTree.MathNode("mover", [buildGroup(r.body, e), t]);
    return n.setAttribute("accent", "true"), n;
  }
});
defineFunction({
  type: "phantom",
  names: ["\\phantom"],
  props: {
    numArgs: 1,
    allowedInText: !0
  },
  handler: (r, e) => {
    var {
      parser: t
    } = r, n = e[0];
    return {
      type: "phantom",
      mode: t.mode,
      body: ordargument(n)
    };
  },
  htmlBuilder: (r, e) => {
    var t = buildExpression$1(r.body, e.withPhantom(), !1);
    return buildCommon.makeFragment(t);
  },
  mathmlBuilder: (r, e) => {
    var t = buildExpression(r.body, e);
    return new mathMLTree.MathNode("mphantom", t);
  }
});
defineFunction({
  type: "hphantom",
  names: ["\\hphantom"],
  props: {
    numArgs: 1,
    allowedInText: !0
  },
  handler: (r, e) => {
    var {
      parser: t
    } = r, n = e[0];
    return {
      type: "hphantom",
      mode: t.mode,
      body: n
    };
  },
  htmlBuilder: (r, e) => {
    var t = buildCommon.makeSpan([], [buildGroup$1(r.body, e.withPhantom())]);
    if (t.height = 0, t.depth = 0, t.children)
      for (var n = 0; n < t.children.length; n++)
        t.children[n].height = 0, t.children[n].depth = 0;
    return t = buildCommon.makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: t
      }]
    }, e), buildCommon.makeSpan(["mord"], [t], e);
  },
  mathmlBuilder: (r, e) => {
    var t = buildExpression(ordargument(r.body), e), n = new mathMLTree.MathNode("mphantom", t), a = new mathMLTree.MathNode("mpadded", [n]);
    return a.setAttribute("height", "0px"), a.setAttribute("depth", "0px"), a;
  }
});
defineFunction({
  type: "vphantom",
  names: ["\\vphantom"],
  props: {
    numArgs: 1,
    allowedInText: !0
  },
  handler: (r, e) => {
    var {
      parser: t
    } = r, n = e[0];
    return {
      type: "vphantom",
      mode: t.mode,
      body: n
    };
  },
  htmlBuilder: (r, e) => {
    var t = buildCommon.makeSpan(["inner"], [buildGroup$1(r.body, e.withPhantom())]), n = buildCommon.makeSpan(["fix"], []);
    return buildCommon.makeSpan(["mord", "rlap"], [t, n], e);
  },
  mathmlBuilder: (r, e) => {
    var t = buildExpression(ordargument(r.body), e), n = new mathMLTree.MathNode("mphantom", t), a = new mathMLTree.MathNode("mpadded", [n]);
    return a.setAttribute("width", "0px"), a;
  }
});
defineFunction({
  type: "raisebox",
  names: ["\\raisebox"],
  props: {
    numArgs: 2,
    argTypes: ["size", "hbox"],
    allowedInText: !0
  },
  handler(r, e) {
    var {
      parser: t
    } = r, n = assertNodeType(e[0], "size").value, a = e[1];
    return {
      type: "raisebox",
      mode: t.mode,
      dy: n,
      body: a
    };
  },
  htmlBuilder(r, e) {
    var t = buildGroup$1(r.body, e), n = calculateSize(r.dy, e);
    return buildCommon.makeVList({
      positionType: "shift",
      positionData: -n,
      children: [{
        type: "elem",
        elem: t
      }]
    }, e);
  },
  mathmlBuilder(r, e) {
    var t = new mathMLTree.MathNode("mpadded", [buildGroup(r.body, e)]), n = r.dy.number + r.dy.unit;
    return t.setAttribute("voffset", n), t;
  }
});
defineFunction({
  type: "internal",
  names: ["\\relax"],
  props: {
    numArgs: 0,
    allowedInText: !0
  },
  handler(r) {
    var {
      parser: e
    } = r;
    return {
      type: "internal",
      mode: e.mode
    };
  }
});
defineFunction({
  type: "rule",
  names: ["\\rule"],
  props: {
    numArgs: 2,
    numOptionalArgs: 1,
    argTypes: ["size", "size", "size"]
  },
  handler(r, e, t) {
    var {
      parser: n
    } = r, a = t[0], s = assertNodeType(e[0], "size"), o = assertNodeType(e[1], "size");
    return {
      type: "rule",
      mode: n.mode,
      shift: a && assertNodeType(a, "size").value,
      width: s.value,
      height: o.value
    };
  },
  htmlBuilder(r, e) {
    var t = buildCommon.makeSpan(["mord", "rule"], [], e), n = calculateSize(r.width, e), a = calculateSize(r.height, e), s = r.shift ? calculateSize(r.shift, e) : 0;
    return t.style.borderRightWidth = makeEm(n), t.style.borderTopWidth = makeEm(a), t.style.bottom = makeEm(s), t.width = n, t.height = a + s, t.depth = -s, t.maxFontSize = a * 1.125 * e.sizeMultiplier, t;
  },
  mathmlBuilder(r, e) {
    var t = calculateSize(r.width, e), n = calculateSize(r.height, e), a = r.shift ? calculateSize(r.shift, e) : 0, s = e.color && e.getColor() || "black", o = new mathMLTree.MathNode("mspace");
    o.setAttribute("mathbackground", s), o.setAttribute("width", makeEm(t)), o.setAttribute("height", makeEm(n));
    var c = new mathMLTree.MathNode("mpadded", [o]);
    return a >= 0 ? c.setAttribute("height", makeEm(a)) : (c.setAttribute("height", makeEm(a)), c.setAttribute("depth", makeEm(-a))), c.setAttribute("voffset", makeEm(a)), c;
  }
});
function sizingGroup(r, e, t) {
  for (var n = buildExpression$1(r, e, !1), a = e.sizeMultiplier / t.sizeMultiplier, s = 0; s < n.length; s++) {
    var o = n[s].classes.indexOf("sizing");
    o < 0 ? Array.prototype.push.apply(n[s].classes, e.sizingClasses(t)) : n[s].classes[o + 1] === "reset-size" + e.size && (n[s].classes[o + 1] = "reset-size" + t.size), n[s].height *= a, n[s].depth *= a;
  }
  return buildCommon.makeFragment(n);
}
var sizeFuncs = ["\\tiny", "\\sixptsize", "\\scriptsize", "\\footnotesize", "\\small", "\\normalsize", "\\large", "\\Large", "\\LARGE", "\\huge", "\\Huge"], htmlBuilder = (r, e) => {
  var t = e.havingSize(r.size);
  return sizingGroup(r.body, t, e);
};
defineFunction({
  type: "sizing",
  names: sizeFuncs,
  props: {
    numArgs: 0,
    allowedInText: !0
  },
  handler: (r, e) => {
    var {
      breakOnTokenText: t,
      funcName: n,
      parser: a
    } = r, s = a.parseExpression(!1, t);
    return {
      type: "sizing",
      mode: a.mode,
      // Figure out what size to use based on the list of functions above
      size: sizeFuncs.indexOf(n) + 1,
      body: s
    };
  },
  htmlBuilder,
  mathmlBuilder: (r, e) => {
    var t = e.havingSize(r.size), n = buildExpression(r.body, t), a = new mathMLTree.MathNode("mstyle", n);
    return a.setAttribute("mathsize", makeEm(t.sizeMultiplier)), a;
  }
});
defineFunction({
  type: "smash",
  names: ["\\smash"],
  props: {
    numArgs: 1,
    numOptionalArgs: 1,
    allowedInText: !0
  },
  handler: (r, e, t) => {
    var {
      parser: n
    } = r, a = !1, s = !1, o = t[0] && assertNodeType(t[0], "ordgroup");
    if (o)
      for (var c = "", l = 0; l < o.body.length; ++l) {
        var u = o.body[l];
        if (c = u.text, c === "t")
          a = !0;
        else if (c === "b")
          s = !0;
        else {
          a = !1, s = !1;
          break;
        }
      }
    else
      a = !0, s = !0;
    var h = e[0];
    return {
      type: "smash",
      mode: n.mode,
      body: h,
      smashHeight: a,
      smashDepth: s
    };
  },
  htmlBuilder: (r, e) => {
    var t = buildCommon.makeSpan([], [buildGroup$1(r.body, e)]);
    if (!r.smashHeight && !r.smashDepth)
      return t;
    if (r.smashHeight && (t.height = 0, t.children))
      for (var n = 0; n < t.children.length; n++)
        t.children[n].height = 0;
    if (r.smashDepth && (t.depth = 0, t.children))
      for (var a = 0; a < t.children.length; a++)
        t.children[a].depth = 0;
    var s = buildCommon.makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: t
      }]
    }, e);
    return buildCommon.makeSpan(["mord"], [s], e);
  },
  mathmlBuilder: (r, e) => {
    var t = new mathMLTree.MathNode("mpadded", [buildGroup(r.body, e)]);
    return r.smashHeight && t.setAttribute("height", "0px"), r.smashDepth && t.setAttribute("depth", "0px"), t;
  }
});
defineFunction({
  type: "sqrt",
  names: ["\\sqrt"],
  props: {
    numArgs: 1,
    numOptionalArgs: 1
  },
  handler(r, e, t) {
    var {
      parser: n
    } = r, a = t[0], s = e[0];
    return {
      type: "sqrt",
      mode: n.mode,
      body: s,
      index: a
    };
  },
  htmlBuilder(r, e) {
    var t = buildGroup$1(r.body, e.havingCrampedStyle());
    t.height === 0 && (t.height = e.fontMetrics().xHeight), t = buildCommon.wrapFragment(t, e);
    var n = e.fontMetrics(), a = n.defaultRuleThickness, s = a;
    e.style.id < Style$1.TEXT.id && (s = e.fontMetrics().xHeight);
    var o = a + s / 4, c = t.height + t.depth + o + a, {
      span: l,
      ruleWidth: u,
      advanceWidth: h
    } = delimiter.sqrtImage(c, e), d = l.height - u;
    d > t.height + t.depth + o && (o = (o + d - t.height - t.depth) / 2);
    var w = l.height - t.height - o - u;
    t.style.paddingLeft = makeEm(h);
    var b = buildCommon.makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: t,
        wrapperClasses: ["svg-align"]
      }, {
        type: "kern",
        size: -(t.height + w)
      }, {
        type: "elem",
        elem: l
      }, {
        type: "kern",
        size: u
      }]
    }, e);
    if (r.index) {
      var _ = e.havingStyle(Style$1.SCRIPTSCRIPT), R = buildGroup$1(r.index, _, e), k = 0.6 * (b.height - b.depth), C = buildCommon.makeVList({
        positionType: "shift",
        positionData: -k,
        children: [{
          type: "elem",
          elem: R
        }]
      }, e), m = buildCommon.makeSpan(["root"], [C]);
      return buildCommon.makeSpan(["mord", "sqrt"], [m, b], e);
    } else
      return buildCommon.makeSpan(["mord", "sqrt"], [b], e);
  },
  mathmlBuilder(r, e) {
    var {
      body: t,
      index: n
    } = r;
    return n ? new mathMLTree.MathNode("mroot", [buildGroup(t, e), buildGroup(n, e)]) : new mathMLTree.MathNode("msqrt", [buildGroup(t, e)]);
  }
});
var styleMap = {
  display: Style$1.DISPLAY,
  text: Style$1.TEXT,
  script: Style$1.SCRIPT,
  scriptscript: Style$1.SCRIPTSCRIPT
};
defineFunction({
  type: "styling",
  names: ["\\displaystyle", "\\textstyle", "\\scriptstyle", "\\scriptscriptstyle"],
  props: {
    numArgs: 0,
    allowedInText: !0,
    primitive: !0
  },
  handler(r, e) {
    var {
      breakOnTokenText: t,
      funcName: n,
      parser: a
    } = r, s = a.parseExpression(!0, t), o = n.slice(1, n.length - 5);
    return {
      type: "styling",
      mode: a.mode,
      // Figure out what style to use by pulling out the style from
      // the function name
      style: o,
      body: s
    };
  },
  htmlBuilder(r, e) {
    var t = styleMap[r.style], n = e.havingStyle(t).withFont("");
    return sizingGroup(r.body, n, e);
  },
  mathmlBuilder(r, e) {
    var t = styleMap[r.style], n = e.havingStyle(t), a = buildExpression(r.body, n), s = new mathMLTree.MathNode("mstyle", a), o = {
      display: ["0", "true"],
      text: ["0", "false"],
      script: ["1", "false"],
      scriptscript: ["2", "false"]
    }, c = o[r.style];
    return s.setAttribute("scriptlevel", c[0]), s.setAttribute("displaystyle", c[1]), s;
  }
});
var htmlBuilderDelegate = function(e, t) {
  var n = e.base;
  if (n)
    if (n.type === "op") {
      var a = n.limits && (t.style.size === Style$1.DISPLAY.size || n.alwaysHandleSupSub);
      return a ? htmlBuilder$2 : null;
    } else if (n.type === "operatorname") {
      var s = n.alwaysHandleSupSub && (t.style.size === Style$1.DISPLAY.size || n.limits);
      return s ? htmlBuilder$1 : null;
    } else {
      if (n.type === "accent")
        return utils.isCharacterBox(n.base) ? htmlBuilder$a : null;
      if (n.type === "horizBrace") {
        var o = !e.sub;
        return o === n.isOver ? htmlBuilder$3 : null;
      } else
        return null;
    }
  else return null;
};
defineFunctionBuilders({
  type: "supsub",
  htmlBuilder(r, e) {
    var t = htmlBuilderDelegate(r, e);
    if (t)
      return t(r, e);
    var {
      base: n,
      sup: a,
      sub: s
    } = r, o = buildGroup$1(n, e), c, l, u = e.fontMetrics(), h = 0, d = 0, w = n && utils.isCharacterBox(n);
    if (a) {
      var b = e.havingStyle(e.style.sup());
      c = buildGroup$1(a, b, e), w || (h = o.height - b.fontMetrics().supDrop * b.sizeMultiplier / e.sizeMultiplier);
    }
    if (s) {
      var _ = e.havingStyle(e.style.sub());
      l = buildGroup$1(s, _, e), w || (d = o.depth + _.fontMetrics().subDrop * _.sizeMultiplier / e.sizeMultiplier);
    }
    var R;
    e.style === Style$1.DISPLAY ? R = u.sup1 : e.style.cramped ? R = u.sup3 : R = u.sup2;
    var k = e.sizeMultiplier, C = makeEm(0.5 / u.ptPerEm / k), m = null;
    if (l) {
      var A = r.base && r.base.type === "op" && r.base.name && (r.base.name === "\\oiint" || r.base.name === "\\oiiint");
      (o instanceof SymbolNode || A) && (m = makeEm(-o.italic));
    }
    var F;
    if (c && l) {
      h = Math.max(h, R, c.depth + 0.25 * u.xHeight), d = Math.max(d, u.sub2);
      var f = u.defaultRuleThickness, g = 4 * f;
      if (h - c.depth - (l.height - d) < g) {
        d = g - (h - c.depth) + l.height;
        var y = 0.8 * u.xHeight - (h - c.depth);
        y > 0 && (h += y, d -= y);
      }
      var E = [{
        type: "elem",
        elem: l,
        shift: d,
        marginRight: C,
        marginLeft: m
      }, {
        type: "elem",
        elem: c,
        shift: -h,
        marginRight: C
      }];
      F = buildCommon.makeVList({
        positionType: "individualShift",
        children: E
      }, e);
    } else if (l) {
      d = Math.max(d, u.sub1, l.height - 0.8 * u.xHeight);
      var x = [{
        type: "elem",
        elem: l,
        marginLeft: m,
        marginRight: C
      }];
      F = buildCommon.makeVList({
        positionType: "shift",
        positionData: d,
        children: x
      }, e);
    } else if (c)
      h = Math.max(h, R, c.depth + 0.25 * u.xHeight), F = buildCommon.makeVList({
        positionType: "shift",
        positionData: -h,
        children: [{
          type: "elem",
          elem: c,
          marginRight: C
        }]
      }, e);
    else
      throw new Error("supsub must have either sup or sub.");
    var O = getTypeOfDomTree(o, "right") || "mord";
    return buildCommon.makeSpan([O], [o, buildCommon.makeSpan(["msupsub"], [F])], e);
  },
  mathmlBuilder(r, e) {
    var t = !1, n, a;
    r.base && r.base.type === "horizBrace" && (a = !!r.sup, a === r.base.isOver && (t = !0, n = r.base.isOver)), r.base && (r.base.type === "op" || r.base.type === "operatorname") && (r.base.parentIsSupSub = !0);
    var s = [buildGroup(r.base, e)];
    r.sub && s.push(buildGroup(r.sub, e)), r.sup && s.push(buildGroup(r.sup, e));
    var o;
    if (t)
      o = n ? "mover" : "munder";
    else if (r.sub)
      if (r.sup) {
        var u = r.base;
        u && u.type === "op" && u.limits && e.style === Style$1.DISPLAY || u && u.type === "operatorname" && u.alwaysHandleSupSub && (e.style === Style$1.DISPLAY || u.limits) ? o = "munderover" : o = "msubsup";
      } else {
        var l = r.base;
        l && l.type === "op" && l.limits && (e.style === Style$1.DISPLAY || l.alwaysHandleSupSub) || l && l.type === "operatorname" && l.alwaysHandleSupSub && (l.limits || e.style === Style$1.DISPLAY) ? o = "munder" : o = "msub";
      }
    else {
      var c = r.base;
      c && c.type === "op" && c.limits && (e.style === Style$1.DISPLAY || c.alwaysHandleSupSub) || c && c.type === "operatorname" && c.alwaysHandleSupSub && (c.limits || e.style === Style$1.DISPLAY) ? o = "mover" : o = "msup";
    }
    return new mathMLTree.MathNode(o, s);
  }
});
defineFunctionBuilders({
  type: "atom",
  htmlBuilder(r, e) {
    return buildCommon.mathsym(r.text, r.mode, e, ["m" + r.family]);
  },
  mathmlBuilder(r, e) {
    var t = new mathMLTree.MathNode("mo", [makeText(r.text, r.mode)]);
    if (r.family === "bin") {
      var n = getVariant(r, e);
      n === "bold-italic" && t.setAttribute("mathvariant", n);
    } else r.family === "punct" ? t.setAttribute("separator", "true") : (r.family === "open" || r.family === "close") && t.setAttribute("stretchy", "false");
    return t;
  }
});
var defaultVariant = {
  mi: "italic",
  mn: "normal",
  mtext: "normal"
};
defineFunctionBuilders({
  type: "mathord",
  htmlBuilder(r, e) {
    return buildCommon.makeOrd(r, e, "mathord");
  },
  mathmlBuilder(r, e) {
    var t = new mathMLTree.MathNode("mi", [makeText(r.text, r.mode, e)]), n = getVariant(r, e) || "italic";
    return n !== defaultVariant[t.type] && t.setAttribute("mathvariant", n), t;
  }
});
defineFunctionBuilders({
  type: "textord",
  htmlBuilder(r, e) {
    return buildCommon.makeOrd(r, e, "textord");
  },
  mathmlBuilder(r, e) {
    var t = makeText(r.text, r.mode, e), n = getVariant(r, e) || "normal", a;
    return r.mode === "text" ? a = new mathMLTree.MathNode("mtext", [t]) : /[0-9]/.test(r.text) ? a = new mathMLTree.MathNode("mn", [t]) : r.text === "\\prime" ? a = new mathMLTree.MathNode("mo", [t]) : a = new mathMLTree.MathNode("mi", [t]), n !== defaultVariant[a.type] && a.setAttribute("mathvariant", n), a;
  }
});
var cssSpace = {
  "\\nobreak": "nobreak",
  "\\allowbreak": "allowbreak"
}, regularSpace = {
  " ": {},
  "\\ ": {},
  "~": {
    className: "nobreak"
  },
  "\\space": {},
  "\\nobreakspace": {
    className: "nobreak"
  }
};
defineFunctionBuilders({
  type: "spacing",
  htmlBuilder(r, e) {
    if (regularSpace.hasOwnProperty(r.text)) {
      var t = regularSpace[r.text].className || "";
      if (r.mode === "text") {
        var n = buildCommon.makeOrd(r, e, "textord");
        return n.classes.push(t), n;
      } else
        return buildCommon.makeSpan(["mspace", t], [buildCommon.mathsym(r.text, r.mode, e)], e);
    } else {
      if (cssSpace.hasOwnProperty(r.text))
        return buildCommon.makeSpan(["mspace", cssSpace[r.text]], [], e);
      throw new ParseError('Unknown type of space "' + r.text + '"');
    }
  },
  mathmlBuilder(r, e) {
    var t;
    if (regularSpace.hasOwnProperty(r.text))
      t = new mathMLTree.MathNode("mtext", [new mathMLTree.TextNode(" ")]);
    else {
      if (cssSpace.hasOwnProperty(r.text))
        return new mathMLTree.MathNode("mspace");
      throw new ParseError('Unknown type of space "' + r.text + '"');
    }
    return t;
  }
});
var pad = () => {
  var r = new mathMLTree.MathNode("mtd", []);
  return r.setAttribute("width", "50%"), r;
};
defineFunctionBuilders({
  type: "tag",
  mathmlBuilder(r, e) {
    var t = new mathMLTree.MathNode("mtable", [new mathMLTree.MathNode("mtr", [pad(), new mathMLTree.MathNode("mtd", [buildExpressionRow(r.body, e)]), pad(), new mathMLTree.MathNode("mtd", [buildExpressionRow(r.tag, e)])])]);
    return t.setAttribute("width", "100%"), t;
  }
});
var textFontFamilies = {
  "\\text": void 0,
  "\\textrm": "textrm",
  "\\textsf": "textsf",
  "\\texttt": "texttt",
  "\\textnormal": "textrm"
}, textFontWeights = {
  "\\textbf": "textbf",
  "\\textmd": "textmd"
}, textFontShapes = {
  "\\textit": "textit",
  "\\textup": "textup"
}, optionsWithFont = (r, e) => {
  var t = r.font;
  if (t) {
    if (textFontFamilies[t])
      return e.withTextFontFamily(textFontFamilies[t]);
    if (textFontWeights[t])
      return e.withTextFontWeight(textFontWeights[t]);
    if (t === "\\emph")
      return e.fontShape === "textit" ? e.withTextFontShape("textup") : e.withTextFontShape("textit");
  } else return e;
  return e.withTextFontShape(textFontShapes[t]);
};
defineFunction({
  type: "text",
  names: [
    // Font families
    "\\text",
    "\\textrm",
    "\\textsf",
    "\\texttt",
    "\\textnormal",
    // Font weights
    "\\textbf",
    "\\textmd",
    // Font Shapes
    "\\textit",
    "\\textup",
    "\\emph"
  ],
  props: {
    numArgs: 1,
    argTypes: ["text"],
    allowedInArgument: !0,
    allowedInText: !0
  },
  handler(r, e) {
    var {
      parser: t,
      funcName: n
    } = r, a = e[0];
    return {
      type: "text",
      mode: t.mode,
      body: ordargument(a),
      font: n
    };
  },
  htmlBuilder(r, e) {
    var t = optionsWithFont(r, e), n = buildExpression$1(r.body, t, !0);
    return buildCommon.makeSpan(["mord", "text"], n, t);
  },
  mathmlBuilder(r, e) {
    var t = optionsWithFont(r, e);
    return buildExpressionRow(r.body, t);
  }
});
defineFunction({
  type: "underline",
  names: ["\\underline"],
  props: {
    numArgs: 1,
    allowedInText: !0
  },
  handler(r, e) {
    var {
      parser: t
    } = r;
    return {
      type: "underline",
      mode: t.mode,
      body: e[0]
    };
  },
  htmlBuilder(r, e) {
    var t = buildGroup$1(r.body, e), n = buildCommon.makeLineSpan("underline-line", e), a = e.fontMetrics().defaultRuleThickness, s = buildCommon.makeVList({
      positionType: "top",
      positionData: t.height,
      children: [{
        type: "kern",
        size: a
      }, {
        type: "elem",
        elem: n
      }, {
        type: "kern",
        size: 3 * a
      }, {
        type: "elem",
        elem: t
      }]
    }, e);
    return buildCommon.makeSpan(["mord", "underline"], [s], e);
  },
  mathmlBuilder(r, e) {
    var t = new mathMLTree.MathNode("mo", [new mathMLTree.TextNode("‾")]);
    t.setAttribute("stretchy", "true");
    var n = new mathMLTree.MathNode("munder", [buildGroup(r.body, e), t]);
    return n.setAttribute("accentunder", "true"), n;
  }
});
defineFunction({
  type: "vcenter",
  names: ["\\vcenter"],
  props: {
    numArgs: 1,
    argTypes: ["original"],
    // In LaTeX, \vcenter can act only on a box.
    allowedInText: !1
  },
  handler(r, e) {
    var {
      parser: t
    } = r;
    return {
      type: "vcenter",
      mode: t.mode,
      body: e[0]
    };
  },
  htmlBuilder(r, e) {
    var t = buildGroup$1(r.body, e), n = e.fontMetrics().axisHeight, a = 0.5 * (t.height - n - (t.depth + n));
    return buildCommon.makeVList({
      positionType: "shift",
      positionData: a,
      children: [{
        type: "elem",
        elem: t
      }]
    }, e);
  },
  mathmlBuilder(r, e) {
    return new mathMLTree.MathNode("mpadded", [buildGroup(r.body, e)], ["vcenter"]);
  }
});
defineFunction({
  type: "verb",
  names: ["\\verb"],
  props: {
    numArgs: 0,
    allowedInText: !0
  },
  handler(r, e, t) {
    throw new ParseError("\\verb ended by end of line instead of matching delimiter");
  },
  htmlBuilder(r, e) {
    for (var t = makeVerb(r), n = [], a = e.havingStyle(e.style.text()), s = 0; s < t.length; s++) {
      var o = t[s];
      o === "~" && (o = "\\textasciitilde"), n.push(buildCommon.makeSymbol(o, "Typewriter-Regular", r.mode, a, ["mord", "texttt"]));
    }
    return buildCommon.makeSpan(["mord", "text"].concat(a.sizingClasses(e)), buildCommon.tryCombineChars(n), a);
  },
  mathmlBuilder(r, e) {
    var t = new mathMLTree.TextNode(makeVerb(r)), n = new mathMLTree.MathNode("mtext", [t]);
    return n.setAttribute("mathvariant", "monospace"), n;
  }
});
var makeVerb = (r) => r.body.replace(/ /g, r.star ? "␣" : " "), functions = _functions, spaceRegexString = `[ \r
	]`, controlWordRegexString = "\\\\[a-zA-Z@]+", controlSymbolRegexString = "\\\\[^\uD800-\uDFFF]", controlWordWhitespaceRegexString = "(" + controlWordRegexString + ")" + spaceRegexString + "*", controlSpaceRegexString = `\\\\(
|[ \r	]+
?)[ \r	]*`, combiningDiacriticalMarkString = "[̀-ͯ]", combiningDiacriticalMarksEndRegex = new RegExp(combiningDiacriticalMarkString + "+$"), tokenRegexString = "(" + spaceRegexString + "+)|" + // whitespace
(controlSpaceRegexString + "|") + // \whitespace
"([!-\\[\\]-‧‪-퟿豈-]" + // single codepoint
(combiningDiacriticalMarkString + "*") + // ...plus accents
"|[\uD800-\uDBFF][\uDC00-\uDFFF]" + // surrogate pair
(combiningDiacriticalMarkString + "*") + // ...plus accents
"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5" + // \verb unstarred
("|" + controlWordWhitespaceRegexString) + // \macroName + spaces
("|" + controlSymbolRegexString + ")");
class Lexer {
  // Category codes. The lexer only supports comment characters (14) for now.
  // MacroExpander additionally distinguishes active (13).
  constructor(e, t) {
    this.input = void 0, this.settings = void 0, this.tokenRegex = void 0, this.catcodes = void 0, this.input = e, this.settings = t, this.tokenRegex = new RegExp(tokenRegexString, "g"), this.catcodes = {
      "%": 14,
      // comment character
      "~": 13
      // active character
    };
  }
  setCatcode(e, t) {
    this.catcodes[e] = t;
  }
  /**
   * This function lexes a single token.
   */
  lex() {
    var e = this.input, t = this.tokenRegex.lastIndex;
    if (t === e.length)
      return new Token("EOF", new SourceLocation(this, t, t));
    var n = this.tokenRegex.exec(e);
    if (n === null || n.index !== t)
      throw new ParseError("Unexpected character: '" + e[t] + "'", new Token(e[t], new SourceLocation(this, t, t + 1)));
    var a = n[6] || n[3] || (n[2] ? "\\ " : " ");
    if (this.catcodes[a] === 14) {
      var s = e.indexOf(`
`, this.tokenRegex.lastIndex);
      return s === -1 ? (this.tokenRegex.lastIndex = e.length, this.settings.reportNonstrict("commentAtEnd", "% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")) : this.tokenRegex.lastIndex = s + 1, this.lex();
    }
    return new Token(a, new SourceLocation(this, t, this.tokenRegex.lastIndex));
  }
}
class Namespace {
  /**
   * Both arguments are optional.  The first argument is an object of
   * built-in mappings which never change.  The second argument is an object
   * of initial (global-level) mappings, which will constantly change
   * according to any global/top-level `set`s done.
   */
  constructor(e, t) {
    e === void 0 && (e = {}), t === void 0 && (t = {}), this.current = void 0, this.builtins = void 0, this.undefStack = void 0, this.current = t, this.builtins = e, this.undefStack = [];
  }
  /**
   * Start a new nested group, affecting future local `set`s.
   */
  beginGroup() {
    this.undefStack.push({});
  }
  /**
   * End current nested group, restoring values before the group began.
   */
  endGroup() {
    if (this.undefStack.length === 0)
      throw new ParseError("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");
    var e = this.undefStack.pop();
    for (var t in e)
      e.hasOwnProperty(t) && (e[t] == null ? delete this.current[t] : this.current[t] = e[t]);
  }
  /**
   * Ends all currently nested groups (if any), restoring values before the
   * groups began.  Useful in case of an error in the middle of parsing.
   */
  endGroups() {
    for (; this.undefStack.length > 0; )
      this.endGroup();
  }
  /**
   * Detect whether `name` has a definition.  Equivalent to
   * `get(name) != null`.
   */
  has(e) {
    return this.current.hasOwnProperty(e) || this.builtins.hasOwnProperty(e);
  }
  /**
   * Get the current value of a name, or `undefined` if there is no value.
   *
   * Note: Do not use `if (namespace.get(...))` to detect whether a macro
   * is defined, as the definition may be the empty string which evaluates
   * to `false` in JavaScript.  Use `if (namespace.get(...) != null)` or
   * `if (namespace.has(...))`.
   */
  get(e) {
    return this.current.hasOwnProperty(e) ? this.current[e] : this.builtins[e];
  }
  /**
   * Set the current value of a name, and optionally set it globally too.
   * Local set() sets the current value and (when appropriate) adds an undo
   * operation to the undo stack.  Global set() may change the undo
   * operation at every level, so takes time linear in their number.
   * A value of undefined means to delete existing definitions.
   */
  set(e, t, n) {
    if (n === void 0 && (n = !1), n) {
      for (var a = 0; a < this.undefStack.length; a++)
        delete this.undefStack[a][e];
      this.undefStack.length > 0 && (this.undefStack[this.undefStack.length - 1][e] = t);
    } else {
      var s = this.undefStack[this.undefStack.length - 1];
      s && !s.hasOwnProperty(e) && (s[e] = this.current[e]);
    }
    t == null ? delete this.current[e] : this.current[e] = t;
  }
}
var macros = _macros;
defineMacro("\\noexpand", function(r) {
  var e = r.popToken();
  return r.isExpandable(e.text) && (e.noexpand = !0, e.treatAsRelax = !0), {
    tokens: [e],
    numArgs: 0
  };
});
defineMacro("\\expandafter", function(r) {
  var e = r.popToken();
  return r.expandOnce(!0), {
    tokens: [e],
    numArgs: 0
  };
});
defineMacro("\\@firstoftwo", function(r) {
  var e = r.consumeArgs(2);
  return {
    tokens: e[0],
    numArgs: 0
  };
});
defineMacro("\\@secondoftwo", function(r) {
  var e = r.consumeArgs(2);
  return {
    tokens: e[1],
    numArgs: 0
  };
});
defineMacro("\\@ifnextchar", function(r) {
  var e = r.consumeArgs(3);
  r.consumeSpaces();
  var t = r.future();
  return e[0].length === 1 && e[0][0].text === t.text ? {
    tokens: e[1],
    numArgs: 0
  } : {
    tokens: e[2],
    numArgs: 0
  };
});
defineMacro("\\@ifstar", "\\@ifnextchar *{\\@firstoftwo{#1}}");
defineMacro("\\TextOrMath", function(r) {
  var e = r.consumeArgs(2);
  return r.mode === "text" ? {
    tokens: e[0],
    numArgs: 0
  } : {
    tokens: e[1],
    numArgs: 0
  };
});
var digitToNumber = {
  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
};
defineMacro("\\char", function(r) {
  var e = r.popToken(), t, n = "";
  if (e.text === "'")
    t = 8, e = r.popToken();
  else if (e.text === '"')
    t = 16, e = r.popToken();
  else if (e.text === "`")
    if (e = r.popToken(), e.text[0] === "\\")
      n = e.text.charCodeAt(1);
    else {
      if (e.text === "EOF")
        throw new ParseError("\\char` missing argument");
      n = e.text.charCodeAt(0);
    }
  else
    t = 10;
  if (t) {
    if (n = digitToNumber[e.text], n == null || n >= t)
      throw new ParseError("Invalid base-" + t + " digit " + e.text);
    for (var a; (a = digitToNumber[r.future().text]) != null && a < t; )
      n *= t, n += a, r.popToken();
  }
  return "\\@char{" + n + "}";
});
var newcommand = (r, e, t) => {
  var n = r.consumeArg().tokens;
  if (n.length !== 1)
    throw new ParseError("\\newcommand's first argument must be a macro name");
  var a = n[0].text, s = r.isDefined(a);
  if (s && !e)
    throw new ParseError("\\newcommand{" + a + "} attempting to redefine " + (a + "; use \\renewcommand"));
  if (!s && !t)
    throw new ParseError("\\renewcommand{" + a + "} when command " + a + " does not yet exist; use \\newcommand");
  var o = 0;
  if (n = r.consumeArg().tokens, n.length === 1 && n[0].text === "[") {
    for (var c = "", l = r.expandNextToken(); l.text !== "]" && l.text !== "EOF"; )
      c += l.text, l = r.expandNextToken();
    if (!c.match(/^\s*[0-9]+\s*$/))
      throw new ParseError("Invalid number of arguments: " + c);
    o = parseInt(c), n = r.consumeArg().tokens;
  }
  return r.macros.set(a, {
    tokens: n,
    numArgs: o
  }), "";
};
defineMacro("\\newcommand", (r) => newcommand(r, !1, !0));
defineMacro("\\renewcommand", (r) => newcommand(r, !0, !1));
defineMacro("\\providecommand", (r) => newcommand(r, !0, !0));
defineMacro("\\message", (r) => {
  var e = r.consumeArgs(1)[0];
  return console.log(e.reverse().map((t) => t.text).join("")), "";
});
defineMacro("\\errmessage", (r) => {
  var e = r.consumeArgs(1)[0];
  return console.error(e.reverse().map((t) => t.text).join("")), "";
});
defineMacro("\\show", (r) => {
  var e = r.popToken(), t = e.text;
  return console.log(e, r.macros.get(t), functions[t], symbols.math[t], symbols.text[t]), "";
});
defineMacro("\\bgroup", "{");
defineMacro("\\egroup", "}");
defineMacro("~", "\\nobreakspace");
defineMacro("\\lq", "`");
defineMacro("\\rq", "'");
defineMacro("\\aa", "\\r a");
defineMacro("\\AA", "\\r A");
defineMacro("\\textcopyright", "\\html@mathml{\\textcircled{c}}{\\char`©}");
defineMacro("\\copyright", "\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");
defineMacro("\\textregistered", "\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");
defineMacro("ℬ", "\\mathscr{B}");
defineMacro("ℰ", "\\mathscr{E}");
defineMacro("ℱ", "\\mathscr{F}");
defineMacro("ℋ", "\\mathscr{H}");
defineMacro("ℐ", "\\mathscr{I}");
defineMacro("ℒ", "\\mathscr{L}");
defineMacro("ℳ", "\\mathscr{M}");
defineMacro("ℛ", "\\mathscr{R}");
defineMacro("ℭ", "\\mathfrak{C}");
defineMacro("ℌ", "\\mathfrak{H}");
defineMacro("ℨ", "\\mathfrak{Z}");
defineMacro("\\Bbbk", "\\Bbb{k}");
defineMacro("·", "\\cdotp");
defineMacro("\\llap", "\\mathllap{\\textrm{#1}}");
defineMacro("\\rlap", "\\mathrlap{\\textrm{#1}}");
defineMacro("\\clap", "\\mathclap{\\textrm{#1}}");
defineMacro("\\mathstrut", "\\vphantom{(}");
defineMacro("\\underbar", "\\underline{\\text{#1}}");
defineMacro("\\not", '\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}');
defineMacro("\\neq", "\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");
defineMacro("\\ne", "\\neq");
defineMacro("≠", "\\neq");
defineMacro("\\notin", "\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");
defineMacro("∉", "\\notin");
defineMacro("≘", "\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");
defineMacro("≙", "\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");
defineMacro("≚", "\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");
defineMacro("≛", "\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");
defineMacro("≝", "\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");
defineMacro("≞", "\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");
defineMacro("≟", "\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");
defineMacro("⟂", "\\perp");
defineMacro("‼", "\\mathclose{!\\mkern-0.8mu!}");
defineMacro("∌", "\\notni");
defineMacro("⌜", "\\ulcorner");
defineMacro("⌝", "\\urcorner");
defineMacro("⌞", "\\llcorner");
defineMacro("⌟", "\\lrcorner");
defineMacro("©", "\\copyright");
defineMacro("®", "\\textregistered");
defineMacro("️", "\\textregistered");
defineMacro("\\ulcorner", '\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');
defineMacro("\\urcorner", '\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');
defineMacro("\\llcorner", '\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');
defineMacro("\\lrcorner", '\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');
defineMacro("\\vdots", "\\mathord{\\varvdots\\rule{0pt}{15pt}}");
defineMacro("⋮", "\\vdots");
defineMacro("\\varGamma", "\\mathit{\\Gamma}");
defineMacro("\\varDelta", "\\mathit{\\Delta}");
defineMacro("\\varTheta", "\\mathit{\\Theta}");
defineMacro("\\varLambda", "\\mathit{\\Lambda}");
defineMacro("\\varXi", "\\mathit{\\Xi}");
defineMacro("\\varPi", "\\mathit{\\Pi}");
defineMacro("\\varSigma", "\\mathit{\\Sigma}");
defineMacro("\\varUpsilon", "\\mathit{\\Upsilon}");
defineMacro("\\varPhi", "\\mathit{\\Phi}");
defineMacro("\\varPsi", "\\mathit{\\Psi}");
defineMacro("\\varOmega", "\\mathit{\\Omega}");
defineMacro("\\substack", "\\begin{subarray}{c}#1\\end{subarray}");
defineMacro("\\colon", "\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");
defineMacro("\\boxed", "\\fbox{$\\displaystyle{#1}$}");
defineMacro("\\iff", "\\DOTSB\\;\\Longleftrightarrow\\;");
defineMacro("\\implies", "\\DOTSB\\;\\Longrightarrow\\;");
defineMacro("\\impliedby", "\\DOTSB\\;\\Longleftarrow\\;");
var dotsByToken = {
  ",": "\\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"
};
defineMacro("\\dots", function(r) {
  var e = "\\dotso", t = r.expandAfterFuture().text;
  return t in dotsByToken ? e = dotsByToken[t] : (t.slice(0, 4) === "\\not" || t in symbols.math && utils.contains(["bin", "rel"], symbols.math[t].group)) && (e = "\\dotsb"), e;
});
var spaceAfterDots = {
  // \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
};
defineMacro("\\dotso", function(r) {
  var e = r.future().text;
  return e in spaceAfterDots ? "\\ldots\\," : "\\ldots";
});
defineMacro("\\dotsc", function(r) {
  var e = r.future().text;
  return e in spaceAfterDots && e !== "," ? "\\ldots\\," : "\\ldots";
});
defineMacro("\\cdots", function(r) {
  var e = r.future().text;
  return e in spaceAfterDots ? "\\@cdots\\," : "\\@cdots";
});
defineMacro("\\dotsb", "\\cdots");
defineMacro("\\dotsm", "\\cdots");
defineMacro("\\dotsi", "\\!\\cdots");
defineMacro("\\dotsx", "\\ldots\\,");
defineMacro("\\DOTSI", "\\relax");
defineMacro("\\DOTSB", "\\relax");
defineMacro("\\DOTSX", "\\relax");
defineMacro("\\tmspace", "\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");
defineMacro("\\,", "\\tmspace+{3mu}{.1667em}");
defineMacro("\\thinspace", "\\,");
defineMacro("\\>", "\\mskip{4mu}");
defineMacro("\\:", "\\tmspace+{4mu}{.2222em}");
defineMacro("\\medspace", "\\:");
defineMacro("\\;", "\\tmspace+{5mu}{.2777em}");
defineMacro("\\thickspace", "\\;");
defineMacro("\\!", "\\tmspace-{3mu}{.1667em}");
defineMacro("\\negthinspace", "\\!");
defineMacro("\\negmedspace", "\\tmspace-{4mu}{.2222em}");
defineMacro("\\negthickspace", "\\tmspace-{5mu}{.277em}");
defineMacro("\\enspace", "\\kern.5em ");
defineMacro("\\enskip", "\\hskip.5em\\relax");
defineMacro("\\quad", "\\hskip1em\\relax");
defineMacro("\\qquad", "\\hskip2em\\relax");
defineMacro("\\tag", "\\@ifstar\\tag@literal\\tag@paren");
defineMacro("\\tag@paren", "\\tag@literal{({#1})}");
defineMacro("\\tag@literal", (r) => {
  if (r.macros.get("\\df@tag"))
    throw new ParseError("Multiple \\tag");
  return "\\gdef\\df@tag{\\text{#1}}";
});
defineMacro("\\bmod", "\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");
defineMacro("\\pod", "\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");
defineMacro("\\pmod", "\\pod{{\\rm mod}\\mkern6mu#1}");
defineMacro("\\mod", "\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");
defineMacro("\\newline", "\\\\\\relax");
defineMacro("\\TeX", "\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");
var latexRaiseA = makeEm(fontMetricsData["Main-Regular"][84][1] - 0.7 * fontMetricsData["Main-Regular"][65][1]);
defineMacro("\\LaTeX", "\\textrm{\\html@mathml{" + ("L\\kern-.36em\\raisebox{" + latexRaiseA + "}{\\scriptstyle A}") + "\\kern-.15em\\TeX}{LaTeX}}");
defineMacro("\\KaTeX", "\\textrm{\\html@mathml{" + ("K\\kern-.17em\\raisebox{" + latexRaiseA + "}{\\scriptstyle A}") + "\\kern-.15em\\TeX}{KaTeX}}");
defineMacro("\\hspace", "\\@ifstar\\@hspacer\\@hspace");
defineMacro("\\@hspace", "\\hskip #1\\relax");
defineMacro("\\@hspacer", "\\rule{0pt}{0pt}\\hskip #1\\relax");
defineMacro("\\ordinarycolon", ":");
defineMacro("\\vcentcolon", "\\mathrel{\\mathop\\ordinarycolon}");
defineMacro("\\dblcolon", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');
defineMacro("\\coloneqq", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');
defineMacro("\\Coloneqq", '\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');
defineMacro("\\coloneq", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');
defineMacro("\\Coloneq", '\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');
defineMacro("\\eqqcolon", '\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');
defineMacro("\\Eqqcolon", '\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');
defineMacro("\\eqcolon", '\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');
defineMacro("\\Eqcolon", '\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');
defineMacro("\\colonapprox", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');
defineMacro("\\Colonapprox", '\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');
defineMacro("\\colonsim", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');
defineMacro("\\Colonsim", '\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');
defineMacro("∷", "\\dblcolon");
defineMacro("∹", "\\eqcolon");
defineMacro("≔", "\\coloneqq");
defineMacro("≕", "\\eqqcolon");
defineMacro("⩴", "\\Coloneqq");
defineMacro("\\ratio", "\\vcentcolon");
defineMacro("\\coloncolon", "\\dblcolon");
defineMacro("\\colonequals", "\\coloneqq");
defineMacro("\\coloncolonequals", "\\Coloneqq");
defineMacro("\\equalscolon", "\\eqqcolon");
defineMacro("\\equalscoloncolon", "\\Eqqcolon");
defineMacro("\\colonminus", "\\coloneq");
defineMacro("\\coloncolonminus", "\\Coloneq");
defineMacro("\\minuscolon", "\\eqcolon");
defineMacro("\\minuscoloncolon", "\\Eqcolon");
defineMacro("\\coloncolonapprox", "\\Colonapprox");
defineMacro("\\coloncolonsim", "\\Colonsim");
defineMacro("\\simcolon", "\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");
defineMacro("\\simcoloncolon", "\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");
defineMacro("\\approxcolon", "\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");
defineMacro("\\approxcoloncolon", "\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");
defineMacro("\\notni", "\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");
defineMacro("\\limsup", "\\DOTSB\\operatorname*{lim\\,sup}");
defineMacro("\\liminf", "\\DOTSB\\operatorname*{lim\\,inf}");
defineMacro("\\injlim", "\\DOTSB\\operatorname*{inj\\,lim}");
defineMacro("\\projlim", "\\DOTSB\\operatorname*{proj\\,lim}");
defineMacro("\\varlimsup", "\\DOTSB\\operatorname*{\\overline{lim}}");
defineMacro("\\varliminf", "\\DOTSB\\operatorname*{\\underline{lim}}");
defineMacro("\\varinjlim", "\\DOTSB\\operatorname*{\\underrightarrow{lim}}");
defineMacro("\\varprojlim", "\\DOTSB\\operatorname*{\\underleftarrow{lim}}");
defineMacro("\\gvertneqq", "\\html@mathml{\\@gvertneqq}{≩}");
defineMacro("\\lvertneqq", "\\html@mathml{\\@lvertneqq}{≨}");
defineMacro("\\ngeqq", "\\html@mathml{\\@ngeqq}{≱}");
defineMacro("\\ngeqslant", "\\html@mathml{\\@ngeqslant}{≱}");
defineMacro("\\nleqq", "\\html@mathml{\\@nleqq}{≰}");
defineMacro("\\nleqslant", "\\html@mathml{\\@nleqslant}{≰}");
defineMacro("\\nshortmid", "\\html@mathml{\\@nshortmid}{∤}");
defineMacro("\\nshortparallel", "\\html@mathml{\\@nshortparallel}{∦}");
defineMacro("\\nsubseteqq", "\\html@mathml{\\@nsubseteqq}{⊈}");
defineMacro("\\nsupseteqq", "\\html@mathml{\\@nsupseteqq}{⊉}");
defineMacro("\\varsubsetneq", "\\html@mathml{\\@varsubsetneq}{⊊}");
defineMacro("\\varsubsetneqq", "\\html@mathml{\\@varsubsetneqq}{⫋}");
defineMacro("\\varsupsetneq", "\\html@mathml{\\@varsupsetneq}{⊋}");
defineMacro("\\varsupsetneqq", "\\html@mathml{\\@varsupsetneqq}{⫌}");
defineMacro("\\imath", "\\html@mathml{\\@imath}{ı}");
defineMacro("\\jmath", "\\html@mathml{\\@jmath}{ȷ}");
defineMacro("\\llbracket", "\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");
defineMacro("\\rrbracket", "\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");
defineMacro("⟦", "\\llbracket");
defineMacro("⟧", "\\rrbracket");
defineMacro("\\lBrace", "\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");
defineMacro("\\rBrace", "\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");
defineMacro("⦃", "\\lBrace");
defineMacro("⦄", "\\rBrace");
defineMacro("\\minuso", "\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");
defineMacro("⦵", "\\minuso");
defineMacro("\\darr", "\\downarrow");
defineMacro("\\dArr", "\\Downarrow");
defineMacro("\\Darr", "\\Downarrow");
defineMacro("\\lang", "\\langle");
defineMacro("\\rang", "\\rangle");
defineMacro("\\uarr", "\\uparrow");
defineMacro("\\uArr", "\\Uparrow");
defineMacro("\\Uarr", "\\Uparrow");
defineMacro("\\N", "\\mathbb{N}");
defineMacro("\\R", "\\mathbb{R}");
defineMacro("\\Z", "\\mathbb{Z}");
defineMacro("\\alef", "\\aleph");
defineMacro("\\alefsym", "\\aleph");
defineMacro("\\Alpha", "\\mathrm{A}");
defineMacro("\\Beta", "\\mathrm{B}");
defineMacro("\\bull", "\\bullet");
defineMacro("\\Chi", "\\mathrm{X}");
defineMacro("\\clubs", "\\clubsuit");
defineMacro("\\cnums", "\\mathbb{C}");
defineMacro("\\Complex", "\\mathbb{C}");
defineMacro("\\Dagger", "\\ddagger");
defineMacro("\\diamonds", "\\diamondsuit");
defineMacro("\\empty", "\\emptyset");
defineMacro("\\Epsilon", "\\mathrm{E}");
defineMacro("\\Eta", "\\mathrm{H}");
defineMacro("\\exist", "\\exists");
defineMacro("\\harr", "\\leftrightarrow");
defineMacro("\\hArr", "\\Leftrightarrow");
defineMacro("\\Harr", "\\Leftrightarrow");
defineMacro("\\hearts", "\\heartsuit");
defineMacro("\\image", "\\Im");
defineMacro("\\infin", "\\infty");
defineMacro("\\Iota", "\\mathrm{I}");
defineMacro("\\isin", "\\in");
defineMacro("\\Kappa", "\\mathrm{K}");
defineMacro("\\larr", "\\leftarrow");
defineMacro("\\lArr", "\\Leftarrow");
defineMacro("\\Larr", "\\Leftarrow");
defineMacro("\\lrarr", "\\leftrightarrow");
defineMacro("\\lrArr", "\\Leftrightarrow");
defineMacro("\\Lrarr", "\\Leftrightarrow");
defineMacro("\\Mu", "\\mathrm{M}");
defineMacro("\\natnums", "\\mathbb{N}");
defineMacro("\\Nu", "\\mathrm{N}");
defineMacro("\\Omicron", "\\mathrm{O}");
defineMacro("\\plusmn", "\\pm");
defineMacro("\\rarr", "\\rightarrow");
defineMacro("\\rArr", "\\Rightarrow");
defineMacro("\\Rarr", "\\Rightarrow");
defineMacro("\\real", "\\Re");
defineMacro("\\reals", "\\mathbb{R}");
defineMacro("\\Reals", "\\mathbb{R}");
defineMacro("\\Rho", "\\mathrm{P}");
defineMacro("\\sdot", "\\cdot");
defineMacro("\\sect", "\\S");
defineMacro("\\spades", "\\spadesuit");
defineMacro("\\sub", "\\subset");
defineMacro("\\sube", "\\subseteq");
defineMacro("\\supe", "\\supseteq");
defineMacro("\\Tau", "\\mathrm{T}");
defineMacro("\\thetasym", "\\vartheta");
defineMacro("\\weierp", "\\wp");
defineMacro("\\Zeta", "\\mathrm{Z}");
defineMacro("\\argmin", "\\DOTSB\\operatorname*{arg\\,min}");
defineMacro("\\argmax", "\\DOTSB\\operatorname*{arg\\,max}");
defineMacro("\\plim", "\\DOTSB\\mathop{\\operatorname{plim}}\\limits");
defineMacro("\\bra", "\\mathinner{\\langle{#1}|}");
defineMacro("\\ket", "\\mathinner{|{#1}\\rangle}");
defineMacro("\\braket", "\\mathinner{\\langle{#1}\\rangle}");
defineMacro("\\Bra", "\\left\\langle#1\\right|");
defineMacro("\\Ket", "\\left|#1\\right\\rangle");
var braketHelper = (r) => (e) => {
  var t = e.consumeArg().tokens, n = e.consumeArg().tokens, a = e.consumeArg().tokens, s = e.consumeArg().tokens, o = e.macros.get("|"), c = e.macros.get("\\|");
  e.macros.beginGroup();
  var l = (d) => (w) => {
    r && (w.macros.set("|", o), a.length && w.macros.set("\\|", c));
    var b = d;
    if (!d && a.length) {
      var _ = w.future();
      _.text === "|" && (w.popToken(), b = !0);
    }
    return {
      tokens: b ? a : n,
      numArgs: 0
    };
  };
  e.macros.set("|", l(!1)), a.length && e.macros.set("\\|", l(!0));
  var u = e.consumeArg().tokens, h = e.expandTokens([
    ...s,
    ...u,
    ...t
    // reversed
  ]);
  return e.macros.endGroup(), {
    tokens: h.reverse(),
    numArgs: 0
  };
};
defineMacro("\\bra@ket", braketHelper(!1));
defineMacro("\\bra@set", braketHelper(!0));
defineMacro("\\Braket", "\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");
defineMacro("\\Set", "\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");
defineMacro("\\set", "\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");
defineMacro("\\angln", "{\\angl n}");
defineMacro("\\blue", "\\textcolor{##6495ed}{#1}");
defineMacro("\\orange", "\\textcolor{##ffa500}{#1}");
defineMacro("\\pink", "\\textcolor{##ff00af}{#1}");
defineMacro("\\red", "\\textcolor{##df0030}{#1}");
defineMacro("\\green", "\\textcolor{##28ae7b}{#1}");
defineMacro("\\gray", "\\textcolor{gray}{#1}");
defineMacro("\\purple", "\\textcolor{##9d38bd}{#1}");
defineMacro("\\blueA", "\\textcolor{##ccfaff}{#1}");
defineMacro("\\blueB", "\\textcolor{##80f6ff}{#1}");
defineMacro("\\blueC", "\\textcolor{##63d9ea}{#1}");
defineMacro("\\blueD", "\\textcolor{##11accd}{#1}");
defineMacro("\\blueE", "\\textcolor{##0c7f99}{#1}");
defineMacro("\\tealA", "\\textcolor{##94fff5}{#1}");
defineMacro("\\tealB", "\\textcolor{##26edd5}{#1}");
defineMacro("\\tealC", "\\textcolor{##01d1c1}{#1}");
defineMacro("\\tealD", "\\textcolor{##01a995}{#1}");
defineMacro("\\tealE", "\\textcolor{##208170}{#1}");
defineMacro("\\greenA", "\\textcolor{##b6ffb0}{#1}");
defineMacro("\\greenB", "\\textcolor{##8af281}{#1}");
defineMacro("\\greenC", "\\textcolor{##74cf70}{#1}");
defineMacro("\\greenD", "\\textcolor{##1fab54}{#1}");
defineMacro("\\greenE", "\\textcolor{##0d923f}{#1}");
defineMacro("\\goldA", "\\textcolor{##ffd0a9}{#1}");
defineMacro("\\goldB", "\\textcolor{##ffbb71}{#1}");
defineMacro("\\goldC", "\\textcolor{##ff9c39}{#1}");
defineMacro("\\goldD", "\\textcolor{##e07d10}{#1}");
defineMacro("\\goldE", "\\textcolor{##a75a05}{#1}");
defineMacro("\\redA", "\\textcolor{##fca9a9}{#1}");
defineMacro("\\redB", "\\textcolor{##ff8482}{#1}");
defineMacro("\\redC", "\\textcolor{##f9685d}{#1}");
defineMacro("\\redD", "\\textcolor{##e84d39}{#1}");
defineMacro("\\redE", "\\textcolor{##bc2612}{#1}");
defineMacro("\\maroonA", "\\textcolor{##ffbde0}{#1}");
defineMacro("\\maroonB", "\\textcolor{##ff92c6}{#1}");
defineMacro("\\maroonC", "\\textcolor{##ed5fa6}{#1}");
defineMacro("\\maroonD", "\\textcolor{##ca337c}{#1}");
defineMacro("\\maroonE", "\\textcolor{##9e034e}{#1}");
defineMacro("\\purpleA", "\\textcolor{##ddd7ff}{#1}");
defineMacro("\\purpleB", "\\textcolor{##c6b9fc}{#1}");
defineMacro("\\purpleC", "\\textcolor{##aa87ff}{#1}");
defineMacro("\\purpleD", "\\textcolor{##7854ab}{#1}");
defineMacro("\\purpleE", "\\textcolor{##543b78}{#1}");
defineMacro("\\mintA", "\\textcolor{##f5f9e8}{#1}");
defineMacro("\\mintB", "\\textcolor{##edf2df}{#1}");
defineMacro("\\mintC", "\\textcolor{##e0e5cc}{#1}");
defineMacro("\\grayA", "\\textcolor{##f6f7f7}{#1}");
defineMacro("\\grayB", "\\textcolor{##f0f1f2}{#1}");
defineMacro("\\grayC", "\\textcolor{##e3e5e6}{#1}");
defineMacro("\\grayD", "\\textcolor{##d6d8da}{#1}");
defineMacro("\\grayE", "\\textcolor{##babec2}{#1}");
defineMacro("\\grayF", "\\textcolor{##888d93}{#1}");
defineMacro("\\grayG", "\\textcolor{##626569}{#1}");
defineMacro("\\grayH", "\\textcolor{##3b3e40}{#1}");
defineMacro("\\grayI", "\\textcolor{##21242c}{#1}");
defineMacro("\\kaBlue", "\\textcolor{##314453}{#1}");
defineMacro("\\kaGreen", "\\textcolor{##71B307}{#1}");
var implicitCommands = {
  "^": !0,
  // Parser.js
  _: !0,
  // Parser.js
  "\\limits": !0,
  // Parser.js
  "\\nolimits": !0
  // Parser.js
};
class MacroExpander {
  constructor(e, t, n) {
    this.settings = void 0, this.expansionCount = void 0, this.lexer = void 0, this.macros = void 0, this.stack = void 0, this.mode = void 0, this.settings = t, this.expansionCount = 0, this.feed(e), this.macros = new Namespace(macros, t.macros), this.mode = n, this.stack = [];
  }
  /**
   * Feed a new input string to the same MacroExpander
   * (with existing macros etc.).
   */
  feed(e) {
    this.lexer = new Lexer(e, this.settings);
  }
  /**
   * Switches between "text" and "math" modes.
   */
  switchMode(e) {
    this.mode = e;
  }
  /**
   * Start a new group nesting within all namespaces.
   */
  beginGroup() {
    this.macros.beginGroup();
  }
  /**
   * End current group nesting within all namespaces.
   */
  endGroup() {
    this.macros.endGroup();
  }
  /**
   * Ends all currently nested groups (if any), restoring values before the
   * groups began.  Useful in case of an error in the middle of parsing.
   */
  endGroups() {
    this.macros.endGroups();
  }
  /**
   * Returns the topmost token on the stack, without expanding it.
   * Similar in behavior to TeX's `\futurelet`.
   */
  future() {
    return this.stack.length === 0 && this.pushToken(this.lexer.lex()), this.stack[this.stack.length - 1];
  }
  /**
   * Remove and return the next unexpanded token.
   */
  popToken() {
    return this.future(), this.stack.pop();
  }
  /**
   * Add a given token to the token stack.  In particular, this get be used
   * to put back a token returned from one of the other methods.
   */
  pushToken(e) {
    this.stack.push(e);
  }
  /**
   * Append an array of tokens to the token stack.
   */
  pushTokens(e) {
    this.stack.push(...e);
  }
  /**
   * Find an macro argument without expanding tokens and append the array of
   * tokens to the token stack. Uses Token as a container for the result.
   */
  scanArgument(e) {
    var t, n, a;
    if (e) {
      if (this.consumeSpaces(), this.future().text !== "[")
        return null;
      t = this.popToken(), {
        tokens: a,
        end: n
      } = this.consumeArg(["]"]);
    } else
      ({
        tokens: a,
        start: t,
        end: n
      } = this.consumeArg());
    return this.pushToken(new Token("EOF", n.loc)), this.pushTokens(a), t.range(n, "");
  }
  /**
   * Consume all following space tokens, without expansion.
   */
  consumeSpaces() {
    for (; ; ) {
      var e = this.future();
      if (e.text === " ")
        this.stack.pop();
      else
        break;
    }
  }
  /**
   * Consume an argument from the token stream, and return the resulting array
   * of tokens and start/end token.
   */
  consumeArg(e) {
    var t = [], n = e && e.length > 0;
    n || this.consumeSpaces();
    var a = this.future(), s, o = 0, c = 0;
    do {
      if (s = this.popToken(), t.push(s), s.text === "{")
        ++o;
      else if (s.text === "}") {
        if (--o, o === -1)
          throw new ParseError("Extra }", s);
      } else if (s.text === "EOF")
        throw new ParseError("Unexpected end of input in a macro argument, expected '" + (e && n ? e[c] : "}") + "'", s);
      if (e && n)
        if ((o === 0 || o === 1 && e[c] === "{") && s.text === e[c]) {
          if (++c, c === e.length) {
            t.splice(-c, c);
            break;
          }
        } else
          c = 0;
    } while (o !== 0 || n);
    return a.text === "{" && t[t.length - 1].text === "}" && (t.pop(), t.shift()), t.reverse(), {
      tokens: t,
      start: a,
      end: s
    };
  }
  /**
   * Consume the specified number of (delimited) arguments from the token
   * stream and return the resulting array of arguments.
   */
  consumeArgs(e, t) {
    if (t) {
      if (t.length !== e + 1)
        throw new ParseError("The length of delimiters doesn't match the number of args!");
      for (var n = t[0], a = 0; a < n.length; a++) {
        var s = this.popToken();
        if (n[a] !== s.text)
          throw new ParseError("Use of the macro doesn't match its definition", s);
      }
    }
    for (var o = [], c = 0; c < e; c++)
      o.push(this.consumeArg(t && t[c + 1]).tokens);
    return o;
  }
  /**
   * Increment `expansionCount` by the specified amount.
   * Throw an error if it exceeds `maxExpand`.
   */
  countExpansion(e) {
    if (this.expansionCount += e, this.expansionCount > this.settings.maxExpand)
      throw new ParseError("Too many expansions: infinite loop or need to increase maxExpand setting");
  }
  /**
   * Expand the next token only once if possible.
   *
   * If the token is expanded, the resulting tokens will be pushed onto
   * the stack in reverse order, and the number of such tokens will be
   * returned.  This number might be zero or positive.
   *
   * If not, the return value is `false`, and the next token remains at the
   * top of the stack.
   *
   * In either case, the next token will be on the top of the stack,
   * or the stack will be empty (in case of empty expansion
   * and no other tokens).
   *
   * Used to implement `expandAfterFuture` and `expandNextToken`.
   *
   * If expandableOnly, only expandable tokens are expanded and
   * an undefined control sequence results in an error.
   */
  expandOnce(e) {
    var t = this.popToken(), n = t.text, a = t.noexpand ? null : this._getExpansion(n);
    if (a == null || e && a.unexpandable) {
      if (e && a == null && n[0] === "\\" && !this.isDefined(n))
        throw new ParseError("Undefined control sequence: " + n);
      return this.pushToken(t), !1;
    }
    this.countExpansion(1);
    var s = a.tokens, o = this.consumeArgs(a.numArgs, a.delimiters);
    if (a.numArgs) {
      s = s.slice();
      for (var c = s.length - 1; c >= 0; --c) {
        var l = s[c];
        if (l.text === "#") {
          if (c === 0)
            throw new ParseError("Incomplete placeholder at end of macro body", l);
          if (l = s[--c], l.text === "#")
            s.splice(c + 1, 1);
          else if (/^[1-9]$/.test(l.text))
            s.splice(c, 2, ...o[+l.text - 1]);
          else
            throw new ParseError("Not a valid argument number", l);
        }
      }
    }
    return this.pushTokens(s), s.length;
  }
  /**
   * Expand the next token only once (if possible), and return the resulting
   * top token on the stack (without removing anything from the stack).
   * Similar in behavior to TeX's `\expandafter\futurelet`.
   * Equivalent to expandOnce() followed by future().
   */
  expandAfterFuture() {
    return this.expandOnce(), this.future();
  }
  /**
   * Recursively expand first token, then return first non-expandable token.
   */
  expandNextToken() {
    for (; ; )
      if (this.expandOnce() === !1) {
        var e = this.stack.pop();
        return e.treatAsRelax && (e.text = "\\relax"), e;
      }
    throw new Error();
  }
  /**
   * Fully expand the given macro name and return the resulting list of
   * tokens, or return `undefined` if no such macro is defined.
   */
  expandMacro(e) {
    return this.macros.has(e) ? this.expandTokens([new Token(e)]) : void 0;
  }
  /**
   * Fully expand the given token stream and return the resulting list of
   * tokens.  Note that the input tokens are in reverse order, but the
   * output tokens are in forward order.
   */
  expandTokens(e) {
    var t = [], n = this.stack.length;
    for (this.pushTokens(e); this.stack.length > n; )
      if (this.expandOnce(!0) === !1) {
        var a = this.stack.pop();
        a.treatAsRelax && (a.noexpand = !1, a.treatAsRelax = !1), t.push(a);
      }
    return this.countExpansion(t.length), t;
  }
  /**
   * Fully expand the given macro name and return the result as a string,
   * or return `undefined` if no such macro is defined.
   */
  expandMacroAsText(e) {
    var t = this.expandMacro(e);
    return t && t.map((n) => n.text).join("");
  }
  /**
   * Returns the expanded macro as a reversed array of tokens and a macro
   * argument count.  Or returns `null` if no such macro.
   */
  _getExpansion(e) {
    var t = this.macros.get(e);
    if (t == null)
      return t;
    if (e.length === 1) {
      var n = this.lexer.catcodes[e];
      if (n != null && n !== 13)
        return;
    }
    var a = typeof t == "function" ? t(this) : t;
    if (typeof a == "string") {
      var s = 0;
      if (a.indexOf("#") !== -1)
        for (var o = a.replace(/##/g, ""); o.indexOf("#" + (s + 1)) !== -1; )
          ++s;
      for (var c = new Lexer(a, this.settings), l = [], u = c.lex(); u.text !== "EOF"; )
        l.push(u), u = c.lex();
      l.reverse();
      var h = {
        tokens: l,
        numArgs: s
      };
      return h;
    }
    return a;
  }
  /**
   * Determine whether a command is currently "defined" (has some
   * functionality), meaning that it's a macro (in the current group),
   * a function, a symbol, or one of the special commands listed in
   * `implicitCommands`.
   */
  isDefined(e) {
    return this.macros.has(e) || functions.hasOwnProperty(e) || symbols.math.hasOwnProperty(e) || symbols.text.hasOwnProperty(e) || implicitCommands.hasOwnProperty(e);
  }
  /**
   * Determine whether a command is expandable.
   */
  isExpandable(e) {
    var t = this.macros.get(e);
    return t != null ? typeof t == "string" || typeof t == "function" || !t.unexpandable : functions.hasOwnProperty(e) && !functions[e].primitive;
  }
}
var unicodeSubRegEx = /^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/, uSubsAndSups = Object.freeze({
  "₊": "+",
  "₋": "-",
  "₌": "=",
  "₍": "(",
  "₎": ")",
  "₀": "0",
  "₁": "1",
  "₂": "2",
  "₃": "3",
  "₄": "4",
  "₅": "5",
  "₆": "6",
  "₇": "7",
  "₈": "8",
  "₉": "9",
  "ₐ": "a",
  "ₑ": "e",
  "ₕ": "h",
  "ᵢ": "i",
  "ⱼ": "j",
  "ₖ": "k",
  "ₗ": "l",
  "ₘ": "m",
  "ₙ": "n",
  "ₒ": "o",
  "ₚ": "p",
  "ᵣ": "r",
  "ₛ": "s",
  "ₜ": "t",
  "ᵤ": "u",
  "ᵥ": "v",
  "ₓ": "x",
  "ᵦ": "β",
  "ᵧ": "γ",
  "ᵨ": "ρ",
  "ᵩ": "ϕ",
  "ᵪ": "χ",
  "⁺": "+",
  "⁻": "-",
  "⁼": "=",
  "⁽": "(",
  "⁾": ")",
  "⁰": "0",
  "¹": "1",
  "²": "2",
  "³": "3",
  "⁴": "4",
  "⁵": "5",
  "⁶": "6",
  "⁷": "7",
  "⁸": "8",
  "⁹": "9",
  "ᴬ": "A",
  "ᴮ": "B",
  "ᴰ": "D",
  "ᴱ": "E",
  "ᴳ": "G",
  "ᴴ": "H",
  "ᴵ": "I",
  "ᴶ": "J",
  "ᴷ": "K",
  "ᴸ": "L",
  "ᴹ": "M",
  "ᴺ": "N",
  "ᴼ": "O",
  "ᴾ": "P",
  "ᴿ": "R",
  "ᵀ": "T",
  "ᵁ": "U",
  "ⱽ": "V",
  "ᵂ": "W",
  "ᵃ": "a",
  "ᵇ": "b",
  "ᶜ": "c",
  "ᵈ": "d",
  "ᵉ": "e",
  "ᶠ": "f",
  "ᵍ": "g",
  ʰ: "h",
  "ⁱ": "i",
  ʲ: "j",
  "ᵏ": "k",
  ˡ: "l",
  "ᵐ": "m",
  ⁿ: "n",
  "ᵒ": "o",
  "ᵖ": "p",
  ʳ: "r",
  ˢ: "s",
  "ᵗ": "t",
  "ᵘ": "u",
  "ᵛ": "v",
  ʷ: "w",
  ˣ: "x",
  ʸ: "y",
  "ᶻ": "z",
  "ᵝ": "β",
  "ᵞ": "γ",
  "ᵟ": "δ",
  "ᵠ": "ϕ",
  "ᵡ": "χ",
  "ᶿ": "θ"
}), unicodeAccents = {
  "́": {
    text: "\\'",
    math: "\\acute"
  },
  "̀": {
    text: "\\`",
    math: "\\grave"
  },
  "̈": {
    text: '\\"',
    math: "\\ddot"
  },
  "̃": {
    text: "\\~",
    math: "\\tilde"
  },
  "̄": {
    text: "\\=",
    math: "\\bar"
  },
  "̆": {
    text: "\\u",
    math: "\\breve"
  },
  "̌": {
    text: "\\v",
    math: "\\check"
  },
  "̂": {
    text: "\\^",
    math: "\\hat"
  },
  "̇": {
    text: "\\.",
    math: "\\dot"
  },
  "̊": {
    text: "\\r",
    math: "\\mathring"
  },
  "̋": {
    text: "\\H"
  },
  "̧": {
    text: "\\c"
  }
}, unicodeSymbols = {
  á: "á",
  à: "à",
  ä: "ä",
  ǟ: "ǟ",
  ã: "ã",
  ā: "ā",
  ă: "ă",
  ắ: "ắ",
  ằ: "ằ",
  ẵ: "ẵ",
  ǎ: "ǎ",
  â: "â",
  ấ: "ấ",
  ầ: "ầ",
  ẫ: "ẫ",
  ȧ: "ȧ",
  ǡ: "ǡ",
  å: "å",
  ǻ: "ǻ",
  ḃ: "ḃ",
  ć: "ć",
  ḉ: "ḉ",
  č: "č",
  ĉ: "ĉ",
  ċ: "ċ",
  ç: "ç",
  ď: "ď",
  ḋ: "ḋ",
  ḑ: "ḑ",
  é: "é",
  è: "è",
  ë: "ë",
  ẽ: "ẽ",
  ē: "ē",
  ḗ: "ḗ",
  ḕ: "ḕ",
  ĕ: "ĕ",
  ḝ: "ḝ",
  ě: "ě",
  ê: "ê",
  ế: "ế",
  ề: "ề",
  ễ: "ễ",
  ė: "ė",
  ȩ: "ȩ",
  ḟ: "ḟ",
  ǵ: "ǵ",
  ḡ: "ḡ",
  ğ: "ğ",
  ǧ: "ǧ",
  ĝ: "ĝ",
  ġ: "ġ",
  ģ: "ģ",
  ḧ: "ḧ",
  ȟ: "ȟ",
  ĥ: "ĥ",
  ḣ: "ḣ",
  ḩ: "ḩ",
  í: "í",
  ì: "ì",
  ï: "ï",
  ḯ: "ḯ",
  ĩ: "ĩ",
  ī: "ī",
  ĭ: "ĭ",
  ǐ: "ǐ",
  î: "î",
  ǰ: "ǰ",
  ĵ: "ĵ",
  ḱ: "ḱ",
  ǩ: "ǩ",
  ķ: "ķ",
  ĺ: "ĺ",
  ľ: "ľ",
  ļ: "ļ",
  ḿ: "ḿ",
  ṁ: "ṁ",
  ń: "ń",
  ǹ: "ǹ",
  ñ: "ñ",
  ň: "ň",
  ṅ: "ṅ",
  ņ: "ņ",
  ó: "ó",
  ò: "ò",
  ö: "ö",
  ȫ: "ȫ",
  õ: "õ",
  ṍ: "ṍ",
  ṏ: "ṏ",
  ȭ: "ȭ",
  ō: "ō",
  ṓ: "ṓ",
  ṑ: "ṑ",
  ŏ: "ŏ",
  ǒ: "ǒ",
  ô: "ô",
  ố: "ố",
  ồ: "ồ",
  ỗ: "ỗ",
  ȯ: "ȯ",
  ȱ: "ȱ",
  ő: "ő",
  ṕ: "ṕ",
  ṗ: "ṗ",
  ŕ: "ŕ",
  ř: "ř",
  ṙ: "ṙ",
  ŗ: "ŗ",
  ś: "ś",
  ṥ: "ṥ",
  š: "š",
  ṧ: "ṧ",
  ŝ: "ŝ",
  ṡ: "ṡ",
  ş: "ş",
  ẗ: "ẗ",
  ť: "ť",
  ṫ: "ṫ",
  ţ: "ţ",
  ú: "ú",
  ù: "ù",
  ü: "ü",
  ǘ: "ǘ",
  ǜ: "ǜ",
  ǖ: "ǖ",
  ǚ: "ǚ",
  ũ: "ũ",
  ṹ: "ṹ",
  ū: "ū",
  ṻ: "ṻ",
  ŭ: "ŭ",
  ǔ: "ǔ",
  û: "û",
  ů: "ů",
  ű: "ű",
  ṽ: "ṽ",
  ẃ: "ẃ",
  ẁ: "ẁ",
  ẅ: "ẅ",
  ŵ: "ŵ",
  ẇ: "ẇ",
  ẘ: "ẘ",
  ẍ: "ẍ",
  ẋ: "ẋ",
  ý: "ý",
  ỳ: "ỳ",
  ÿ: "ÿ",
  ỹ: "ỹ",
  ȳ: "ȳ",
  ŷ: "ŷ",
  ẏ: "ẏ",
  ẙ: "ẙ",
  ź: "ź",
  ž: "ž",
  ẑ: "ẑ",
  ż: "ż",
  Á: "Á",
  À: "À",
  Ä: "Ä",
  Ǟ: "Ǟ",
  Ã: "Ã",
  Ā: "Ā",
  Ă: "Ă",
  Ắ: "Ắ",
  Ằ: "Ằ",
  Ẵ: "Ẵ",
  Ǎ: "Ǎ",
  Â: "Â",
  Ấ: "Ấ",
  Ầ: "Ầ",
  Ẫ: "Ẫ",
  Ȧ: "Ȧ",
  Ǡ: "Ǡ",
  Å: "Å",
  Ǻ: "Ǻ",
  Ḃ: "Ḃ",
  Ć: "Ć",
  Ḉ: "Ḉ",
  Č: "Č",
  Ĉ: "Ĉ",
  Ċ: "Ċ",
  Ç: "Ç",
  Ď: "Ď",
  Ḋ: "Ḋ",
  Ḑ: "Ḑ",
  É: "É",
  È: "È",
  Ë: "Ë",
  Ẽ: "Ẽ",
  Ē: "Ē",
  Ḗ: "Ḗ",
  Ḕ: "Ḕ",
  Ĕ: "Ĕ",
  Ḝ: "Ḝ",
  Ě: "Ě",
  Ê: "Ê",
  Ế: "Ế",
  Ề: "Ề",
  Ễ: "Ễ",
  Ė: "Ė",
  Ȩ: "Ȩ",
  Ḟ: "Ḟ",
  Ǵ: "Ǵ",
  Ḡ: "Ḡ",
  Ğ: "Ğ",
  Ǧ: "Ǧ",
  Ĝ: "Ĝ",
  Ġ: "Ġ",
  Ģ: "Ģ",
  Ḧ: "Ḧ",
  Ȟ: "Ȟ",
  Ĥ: "Ĥ",
  Ḣ: "Ḣ",
  Ḩ: "Ḩ",
  Í: "Í",
  Ì: "Ì",
  Ï: "Ï",
  Ḯ: "Ḯ",
  Ĩ: "Ĩ",
  Ī: "Ī",
  Ĭ: "Ĭ",
  Ǐ: "Ǐ",
  Î: "Î",
  İ: "İ",
  Ĵ: "Ĵ",
  Ḱ: "Ḱ",
  Ǩ: "Ǩ",
  Ķ: "Ķ",
  Ĺ: "Ĺ",
  Ľ: "Ľ",
  Ļ: "Ļ",
  Ḿ: "Ḿ",
  Ṁ: "Ṁ",
  Ń: "Ń",
  Ǹ: "Ǹ",
  Ñ: "Ñ",
  Ň: "Ň",
  Ṅ: "Ṅ",
  Ņ: "Ņ",
  Ó: "Ó",
  Ò: "Ò",
  Ö: "Ö",
  Ȫ: "Ȫ",
  Õ: "Õ",
  Ṍ: "Ṍ",
  Ṏ: "Ṏ",
  Ȭ: "Ȭ",
  Ō: "Ō",
  Ṓ: "Ṓ",
  Ṑ: "Ṑ",
  Ŏ: "Ŏ",
  Ǒ: "Ǒ",
  Ô: "Ô",
  Ố: "Ố",
  Ồ: "Ồ",
  Ỗ: "Ỗ",
  Ȯ: "Ȯ",
  Ȱ: "Ȱ",
  Ő: "Ő",
  Ṕ: "Ṕ",
  Ṗ: "Ṗ",
  Ŕ: "Ŕ",
  Ř: "Ř",
  Ṙ: "Ṙ",
  Ŗ: "Ŗ",
  Ś: "Ś",
  Ṥ: "Ṥ",
  Š: "Š",
  Ṧ: "Ṧ",
  Ŝ: "Ŝ",
  Ṡ: "Ṡ",
  Ş: "Ş",
  Ť: "Ť",
  Ṫ: "Ṫ",
  Ţ: "Ţ",
  Ú: "Ú",
  Ù: "Ù",
  Ü: "Ü",
  Ǘ: "Ǘ",
  Ǜ: "Ǜ",
  Ǖ: "Ǖ",
  Ǚ: "Ǚ",
  Ũ: "Ũ",
  Ṹ: "Ṹ",
  Ū: "Ū",
  Ṻ: "Ṻ",
  Ŭ: "Ŭ",
  Ǔ: "Ǔ",
  Û: "Û",
  Ů: "Ů",
  Ű: "Ű",
  Ṽ: "Ṽ",
  Ẃ: "Ẃ",
  Ẁ: "Ẁ",
  Ẅ: "Ẅ",
  Ŵ: "Ŵ",
  Ẇ: "Ẇ",
  Ẍ: "Ẍ",
  Ẋ: "Ẋ",
  Ý: "Ý",
  Ỳ: "Ỳ",
  Ÿ: "Ÿ",
  Ỹ: "Ỹ",
  Ȳ: "Ȳ",
  Ŷ: "Ŷ",
  Ẏ: "Ẏ",
  Ź: "Ź",
  Ž: "Ž",
  Ẑ: "Ẑ",
  Ż: "Ż",
  ά: "ά",
  ὰ: "ὰ",
  ᾱ: "ᾱ",
  ᾰ: "ᾰ",
  έ: "έ",
  ὲ: "ὲ",
  ή: "ή",
  ὴ: "ὴ",
  ί: "ί",
  ὶ: "ὶ",
  ϊ: "ϊ",
  ΐ: "ΐ",
  ῒ: "ῒ",
  ῑ: "ῑ",
  ῐ: "ῐ",
  ό: "ό",
  ὸ: "ὸ",
  ύ: "ύ",
  ὺ: "ὺ",
  ϋ: "ϋ",
  ΰ: "ΰ",
  ῢ: "ῢ",
  ῡ: "ῡ",
  ῠ: "ῠ",
  ώ: "ώ",
  ὼ: "ὼ",
  Ύ: "Ύ",
  Ὺ: "Ὺ",
  Ϋ: "Ϋ",
  Ῡ: "Ῡ",
  Ῠ: "Ῠ",
  Ώ: "Ώ",
  Ὼ: "Ὼ"
};
class Parser {
  constructor(e, t) {
    this.mode = void 0, this.gullet = void 0, this.settings = void 0, this.leftrightDepth = void 0, this.nextToken = void 0, this.mode = "math", this.gullet = new MacroExpander(e, t, this.mode), this.settings = t, this.leftrightDepth = 0;
  }
  /**
   * Checks a result to make sure it has the right type, and throws an
   * appropriate error otherwise.
   */
  expect(e, t) {
    if (t === void 0 && (t = !0), this.fetch().text !== e)
      throw new ParseError("Expected '" + e + "', got '" + this.fetch().text + "'", this.fetch());
    t && this.consume();
  }
  /**
   * Discards the current lookahead token, considering it consumed.
   */
  consume() {
    this.nextToken = null;
  }
  /**
   * Return the current lookahead token, or if there isn't one (at the
   * beginning, or if the previous lookahead token was consume()d),
   * fetch the next token as the new lookahead token and return it.
   */
  fetch() {
    return this.nextToken == null && (this.nextToken = this.gullet.expandNextToken()), this.nextToken;
  }
  /**
   * Switches between "text" and "math" modes.
   */
  switchMode(e) {
    this.mode = e, this.gullet.switchMode(e);
  }
  /**
   * Main parsing function, which parses an entire input.
   */
  parse() {
    this.settings.globalGroup || this.gullet.beginGroup(), this.settings.colorIsTextColor && this.gullet.macros.set("\\color", "\\textcolor");
    try {
      var e = this.parseExpression(!1);
      return this.expect("EOF"), this.settings.globalGroup || this.gullet.endGroup(), e;
    } finally {
      this.gullet.endGroups();
    }
  }
  /**
   * Fully parse a separate sequence of tokens as a separate job.
   * Tokens should be specified in reverse order, as in a MacroDefinition.
   */
  subparse(e) {
    var t = this.nextToken;
    this.consume(), this.gullet.pushToken(new Token("}")), this.gullet.pushTokens(e);
    var n = this.parseExpression(!1);
    return this.expect("}"), this.nextToken = t, n;
  }
  /**
   * Parses an "expression", which is a list of atoms.
   *
   * `breakOnInfix`: Should the parsing stop when we hit infix nodes? This
   *                 happens when functions have higher precedence han infix
   *                 nodes in implicit parses.
   *
   * `breakOnTokenText`: The text of the token that the expression should end
   *                     with, or `null` if something else should end the
   *                     expression.
   */
  parseExpression(e, t) {
    for (var n = []; ; ) {
      this.mode === "math" && this.consumeSpaces();
      var a = this.fetch();
      if (Parser.endOfExpression.indexOf(a.text) !== -1 || t && a.text === t || e && functions[a.text] && functions[a.text].infix)
        break;
      var s = this.parseAtom(t);
      if (s) {
        if (s.type === "internal")
          continue;
      } else break;
      n.push(s);
    }
    return this.mode === "text" && this.formLigatures(n), this.handleInfixNodes(n);
  }
  /**
   * Rewrites infix operators such as \over with corresponding commands such
   * as \frac.
   *
   * There can only be one infix operator per group.  If there's more than one
   * then the expression is ambiguous.  This can be resolved by adding {}.
   */
  handleInfixNodes(e) {
    for (var t = -1, n, a = 0; a < e.length; a++)
      if (e[a].type === "infix") {
        if (t !== -1)
          throw new ParseError("only one infix operator per group", e[a].token);
        t = a, n = e[a].replaceWith;
      }
    if (t !== -1 && n) {
      var s, o, c = e.slice(0, t), l = e.slice(t + 1);
      c.length === 1 && c[0].type === "ordgroup" ? s = c[0] : s = {
        type: "ordgroup",
        mode: this.mode,
        body: c
      }, l.length === 1 && l[0].type === "ordgroup" ? o = l[0] : o = {
        type: "ordgroup",
        mode: this.mode,
        body: l
      };
      var u;
      return n === "\\\\abovefrac" ? u = this.callFunction(n, [s, e[t], o], []) : u = this.callFunction(n, [s, o], []), [u];
    } else
      return e;
  }
  /**
   * Handle a subscript or superscript with nice errors.
   */
  handleSupSubscript(e) {
    var t = this.fetch(), n = t.text;
    this.consume(), this.consumeSpaces();
    var a = this.parseGroup(e);
    if (!a)
      throw new ParseError("Expected group after '" + n + "'", t);
    return a;
  }
  /**
   * Converts the textual input of an unsupported command into a text node
   * contained within a color node whose color is determined by errorColor
   */
  formatUnsupportedCmd(e) {
    for (var t = [], n = 0; n < e.length; n++)
      t.push({
        type: "textord",
        mode: "text",
        text: e[n]
      });
    var a = {
      type: "text",
      mode: this.mode,
      body: t
    }, s = {
      type: "color",
      mode: this.mode,
      color: this.settings.errorColor,
      body: [a]
    };
    return s;
  }
  /**
   * Parses a group with optional super/subscripts.
   */
  parseAtom(e) {
    var t = this.parseGroup("atom", e);
    if (this.mode === "text")
      return t;
    for (var n, a; ; ) {
      this.consumeSpaces();
      var s = this.fetch();
      if (s.text === "\\limits" || s.text === "\\nolimits") {
        if (t && t.type === "op") {
          var o = s.text === "\\limits";
          t.limits = o, t.alwaysHandleSupSub = !0;
        } else if (t && t.type === "operatorname")
          t.alwaysHandleSupSub && (t.limits = s.text === "\\limits");
        else
          throw new ParseError("Limit controls must follow a math operator", s);
        this.consume();
      } else if (s.text === "^") {
        if (n)
          throw new ParseError("Double superscript", s);
        n = this.handleSupSubscript("superscript");
      } else if (s.text === "_") {
        if (a)
          throw new ParseError("Double subscript", s);
        a = this.handleSupSubscript("subscript");
      } else if (s.text === "'") {
        if (n)
          throw new ParseError("Double superscript", s);
        var c = {
          type: "textord",
          mode: this.mode,
          text: "\\prime"
        }, l = [c];
        for (this.consume(); this.fetch().text === "'"; )
          l.push(c), this.consume();
        this.fetch().text === "^" && l.push(this.handleSupSubscript("superscript")), n = {
          type: "ordgroup",
          mode: this.mode,
          body: l
        };
      } else if (uSubsAndSups[s.text]) {
        var u = unicodeSubRegEx.test(s.text), h = [];
        for (h.push(new Token(uSubsAndSups[s.text])), this.consume(); ; ) {
          var d = this.fetch().text;
          if (!uSubsAndSups[d] || unicodeSubRegEx.test(d) !== u)
            break;
          h.unshift(new Token(uSubsAndSups[d])), this.consume();
        }
        var w = this.subparse(h);
        u ? a = {
          type: "ordgroup",
          mode: "math",
          body: w
        } : n = {
          type: "ordgroup",
          mode: "math",
          body: w
        };
      } else
        break;
    }
    return n || a ? {
      type: "supsub",
      mode: this.mode,
      base: t,
      sup: n,
      sub: a
    } : t;
  }
  /**
   * Parses an entire function, including its base and all of its arguments.
   */
  parseFunction(e, t) {
    var n = this.fetch(), a = n.text, s = functions[a];
    if (!s)
      return null;
    if (this.consume(), t && t !== "atom" && !s.allowedInArgument)
      throw new ParseError("Got function '" + a + "' with no arguments" + (t ? " as " + t : ""), n);
    if (this.mode === "text" && !s.allowedInText)
      throw new ParseError("Can't use function '" + a + "' in text mode", n);
    if (this.mode === "math" && s.allowedInMath === !1)
      throw new ParseError("Can't use function '" + a + "' in math mode", n);
    var {
      args: o,
      optArgs: c
    } = this.parseArguments(a, s);
    return this.callFunction(a, o, c, n, e);
  }
  /**
   * Call a function handler with a suitable context and arguments.
   */
  callFunction(e, t, n, a, s) {
    var o = {
      funcName: e,
      parser: this,
      token: a,
      breakOnTokenText: s
    }, c = functions[e];
    if (c && c.handler)
      return c.handler(o, t, n);
    throw new ParseError("No function handler for " + e);
  }
  /**
   * Parses the arguments of a function or environment
   */
  parseArguments(e, t) {
    var n = t.numArgs + t.numOptionalArgs;
    if (n === 0)
      return {
        args: [],
        optArgs: []
      };
    for (var a = [], s = [], o = 0; o < n; o++) {
      var c = t.argTypes && t.argTypes[o], l = o < t.numOptionalArgs;
      (t.primitive && c == null || // \sqrt expands into primitive if optional argument doesn't exist
      t.type === "sqrt" && o === 1 && s[0] == null) && (c = "primitive");
      var u = this.parseGroupOfType("argument to '" + e + "'", c, l);
      if (l)
        s.push(u);
      else if (u != null)
        a.push(u);
      else
        throw new ParseError("Null argument, please report this as a bug");
    }
    return {
      args: a,
      optArgs: s
    };
  }
  /**
   * Parses a group when the mode is changing.
   */
  parseGroupOfType(e, t, n) {
    switch (t) {
      case "color":
        return this.parseColorGroup(n);
      case "size":
        return this.parseSizeGroup(n);
      case "url":
        return this.parseUrlGroup(n);
      case "math":
      case "text":
        return this.parseArgumentGroup(n, t);
      case "hbox": {
        var a = this.parseArgumentGroup(n, "text");
        return a != null ? {
          type: "styling",
          mode: a.mode,
          body: [a],
          style: "text"
          // simulate \textstyle
        } : null;
      }
      case "raw": {
        var s = this.parseStringGroup("raw", n);
        return s != null ? {
          type: "raw",
          mode: "text",
          string: s.text
        } : null;
      }
      case "primitive": {
        if (n)
          throw new ParseError("A primitive argument cannot be optional");
        var o = this.parseGroup(e);
        if (o == null)
          throw new ParseError("Expected group as " + e, this.fetch());
        return o;
      }
      case "original":
      case null:
      case void 0:
        return this.parseArgumentGroup(n);
      default:
        throw new ParseError("Unknown group type as " + e, this.fetch());
    }
  }
  /**
   * Discard any space tokens, fetching the next non-space token.
   */
  consumeSpaces() {
    for (; this.fetch().text === " "; )
      this.consume();
  }
  /**
   * Parses a group, essentially returning the string formed by the
   * brace-enclosed tokens plus some position information.
   */
  parseStringGroup(e, t) {
    var n = this.gullet.scanArgument(t);
    if (n == null)
      return null;
    for (var a = "", s; (s = this.fetch()).text !== "EOF"; )
      a += s.text, this.consume();
    return this.consume(), n.text = a, n;
  }
  /**
   * Parses a regex-delimited group: the largest sequence of tokens
   * whose concatenated strings match `regex`. Returns the string
   * formed by the tokens plus some position information.
   */
  parseRegexGroup(e, t) {
    for (var n = this.fetch(), a = n, s = "", o; (o = this.fetch()).text !== "EOF" && e.test(s + o.text); )
      a = o, s += a.text, this.consume();
    if (s === "")
      throw new ParseError("Invalid " + t + ": '" + n.text + "'", n);
    return n.range(a, s);
  }
  /**
   * Parses a color description.
   */
  parseColorGroup(e) {
    var t = this.parseStringGroup("color", e);
    if (t == null)
      return null;
    var n = /^(#[a-f0-9]{3}|#?[a-f0-9]{6}|[a-z]+)$/i.exec(t.text);
    if (!n)
      throw new ParseError("Invalid color: '" + t.text + "'", t);
    var a = n[0];
    return /^[0-9a-f]{6}$/i.test(a) && (a = "#" + a), {
      type: "color-token",
      mode: this.mode,
      color: a
    };
  }
  /**
   * Parses a size specification, consisting of magnitude and unit.
   */
  parseSizeGroup(e) {
    var t, n = !1;
    if (this.gullet.consumeSpaces(), !e && this.gullet.future().text !== "{" ? t = this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/, "size") : t = this.parseStringGroup("size", e), !t)
      return null;
    !e && t.text.length === 0 && (t.text = "0pt", n = !0);
    var a = /([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t.text);
    if (!a)
      throw new ParseError("Invalid size: '" + t.text + "'", t);
    var s = {
      number: +(a[1] + a[2]),
      // sign + magnitude, cast to number
      unit: a[3]
    };
    if (!validUnit(s))
      throw new ParseError("Invalid unit: '" + s.unit + "'", t);
    return {
      type: "size",
      mode: this.mode,
      value: s,
      isBlank: n
    };
  }
  /**
   * Parses an URL, checking escaped letters and allowed protocols,
   * and setting the catcode of % as an active character (as in \hyperref).
   */
  parseUrlGroup(e) {
    this.gullet.lexer.setCatcode("%", 13), this.gullet.lexer.setCatcode("~", 12);
    var t = this.parseStringGroup("url", e);
    if (this.gullet.lexer.setCatcode("%", 14), this.gullet.lexer.setCatcode("~", 13), t == null)
      return null;
    var n = t.text.replace(/\\([#$%&~_^{}])/g, "$1");
    return {
      type: "url",
      mode: this.mode,
      url: n
    };
  }
  /**
   * Parses an argument with the mode specified.
   */
  parseArgumentGroup(e, t) {
    var n = this.gullet.scanArgument(e);
    if (n == null)
      return null;
    var a = this.mode;
    t && this.switchMode(t), this.gullet.beginGroup();
    var s = this.parseExpression(!1, "EOF");
    this.expect("EOF"), this.gullet.endGroup();
    var o = {
      type: "ordgroup",
      mode: this.mode,
      loc: n.loc,
      body: s
    };
    return t && this.switchMode(a), o;
  }
  /**
   * Parses an ordinary group, which is either a single nucleus (like "x")
   * or an expression in braces (like "{x+y}") or an implicit group, a group
   * that starts at the current position, and ends right before a higher explicit
   * group ends, or at EOF.
   */
  parseGroup(e, t) {
    var n = this.fetch(), a = n.text, s;
    if (a === "{" || a === "\\begingroup") {
      this.consume();
      var o = a === "{" ? "}" : "\\endgroup";
      this.gullet.beginGroup();
      var c = this.parseExpression(!1, o), l = this.fetch();
      this.expect(o), this.gullet.endGroup(), s = {
        type: "ordgroup",
        mode: this.mode,
        loc: SourceLocation.range(n, l),
        body: c,
        // A group formed by \begingroup...\endgroup is a semi-simple group
        // which doesn't affect spacing in math mode, i.e., is transparent.
        // https://tex.stackexchange.com/questions/1930/when-should-one-
        // use-begingroup-instead-of-bgroup
        semisimple: a === "\\begingroup" || void 0
      };
    } else if (s = this.parseFunction(t, e) || this.parseSymbol(), s == null && a[0] === "\\" && !implicitCommands.hasOwnProperty(a)) {
      if (this.settings.throwOnError)
        throw new ParseError("Undefined control sequence: " + a, n);
      s = this.formatUnsupportedCmd(a), this.consume();
    }
    return s;
  }
  /**
   * Form ligature-like combinations of characters for text mode.
   * This includes inputs like "--", "---", "``" and "''".
   * The result will simply replace multiple textord nodes with a single
   * character in each value by a single textord node having multiple
   * characters in its value.  The representation is still ASCII source.
   * The group will be modified in place.
   */
  formLigatures(e) {
    for (var t = e.length - 1, n = 0; n < t; ++n) {
      var a = e[n], s = a.text;
      s === "-" && e[n + 1].text === "-" && (n + 1 < t && e[n + 2].text === "-" ? (e.splice(n, 3, {
        type: "textord",
        mode: "text",
        loc: SourceLocation.range(a, e[n + 2]),
        text: "---"
      }), t -= 2) : (e.splice(n, 2, {
        type: "textord",
        mode: "text",
        loc: SourceLocation.range(a, e[n + 1]),
        text: "--"
      }), t -= 1)), (s === "'" || s === "`") && e[n + 1].text === s && (e.splice(n, 2, {
        type: "textord",
        mode: "text",
        loc: SourceLocation.range(a, e[n + 1]),
        text: s + s
      }), t -= 1);
    }
  }
  /**
   * Parse a single symbol out of the string. Here, we handle single character
   * symbols and special functions like \verb.
   */
  parseSymbol() {
    var e = this.fetch(), t = e.text;
    if (/^\\verb[^a-zA-Z]/.test(t)) {
      this.consume();
      var n = t.slice(5), a = n.charAt(0) === "*";
      if (a && (n = n.slice(1)), n.length < 2 || n.charAt(0) !== n.slice(-1))
        throw new ParseError(`\\verb assertion failed --
                    please report what input caused this bug`);
      return n = n.slice(1, -1), {
        type: "verb",
        mode: "text",
        body: n,
        star: a
      };
    }
    unicodeSymbols.hasOwnProperty(t[0]) && !symbols[this.mode][t[0]] && (this.settings.strict && this.mode === "math" && this.settings.reportNonstrict("unicodeTextInMathMode", 'Accented Unicode text character "' + t[0] + '" used in math mode', e), t = unicodeSymbols[t[0]] + t.slice(1));
    var s = combiningDiacriticalMarksEndRegex.exec(t);
    s && (t = t.substring(0, s.index), t === "i" ? t = "ı" : t === "j" && (t = "ȷ"));
    var o;
    if (symbols[this.mode][t]) {
      this.settings.strict && this.mode === "math" && extraLatin.indexOf(t) >= 0 && this.settings.reportNonstrict("unicodeTextInMathMode", 'Latin-1/Unicode text character "' + t[0] + '" used in math mode', e);
      var c = symbols[this.mode][t].group, l = SourceLocation.range(e), u;
      if (ATOMS.hasOwnProperty(c)) {
        var h = c;
        u = {
          type: "atom",
          mode: this.mode,
          family: h,
          loc: l,
          text: t
        };
      } else
        u = {
          type: c,
          mode: this.mode,
          loc: l,
          text: t
        };
      o = u;
    } else if (t.charCodeAt(0) >= 128)
      this.settings.strict && (supportedCodepoint(t.charCodeAt(0)) ? this.mode === "math" && this.settings.reportNonstrict("unicodeTextInMathMode", 'Unicode text character "' + t[0] + '" used in math mode', e) : this.settings.reportNonstrict("unknownSymbol", 'Unrecognized Unicode character "' + t[0] + '"' + (" (" + t.charCodeAt(0) + ")"), e)), o = {
        type: "textord",
        mode: "text",
        loc: SourceLocation.range(e),
        text: t
      };
    else
      return null;
    if (this.consume(), s)
      for (var d = 0; d < s[0].length; d++) {
        var w = s[0][d];
        if (!unicodeAccents[w])
          throw new ParseError("Unknown accent ' " + w + "'", e);
        var b = unicodeAccents[w][this.mode] || unicodeAccents[w].text;
        if (!b)
          throw new ParseError("Accent " + w + " unsupported in " + this.mode + " mode", e);
        o = {
          type: "accent",
          mode: this.mode,
          loc: SourceLocation.range(e),
          label: b,
          isStretchy: !1,
          isShifty: !0,
          // $FlowFixMe
          base: o
        };
      }
    return o;
  }
}
Parser.endOfExpression = ["}", "\\endgroup", "\\end", "\\right", "&"];
var parseTree = function(e, t) {
  if (!(typeof e == "string" || e instanceof String))
    throw new TypeError("KaTeX can only parse string typed expression");
  var n = new Parser(e, t);
  delete n.gullet.macros.current["\\df@tag"];
  var a = n.parse();
  if (delete n.gullet.macros.current["\\current@color"], delete n.gullet.macros.current["\\color"], n.gullet.macros.get("\\df@tag")) {
    if (!t.displayMode)
      throw new ParseError("\\tag works only in display equations");
    a = [{
      type: "tag",
      mode: "text",
      body: a,
      tag: n.subparse([new Token("\\df@tag")])
    }];
  }
  return a;
}, render = function(e, t, n) {
  t.textContent = "";
  var a = renderToDomTree(e, n).toNode();
  t.appendChild(a);
};
typeof document < "u" && document.compatMode !== "CSS1Compat" && (typeof console < "u" && console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."), render = function() {
  throw new ParseError("KaTeX doesn't work in quirks mode.");
});
var renderToString = function(e, t) {
  var n = renderToDomTree(e, t).toMarkup();
  return n;
}, generateParseTree = function(e, t) {
  var n = new Settings(t);
  return parseTree(e, n);
}, renderError = function(e, t, n) {
  if (n.throwOnError || !(e instanceof ParseError))
    throw e;
  var a = buildCommon.makeSpan(["katex-error"], [new SymbolNode(t)]);
  return a.setAttribute("title", e.toString()), a.setAttribute("style", "color:" + n.errorColor), a;
}, renderToDomTree = function(e, t) {
  var n = new Settings(t);
  try {
    var a = parseTree(e, n);
    return buildTree(a, e, n);
  } catch (s) {
    return renderError(s, e, n);
  }
}, renderToHTMLTree = function(e, t) {
  var n = new Settings(t);
  try {
    var a = parseTree(e, n);
    return buildHTMLTree(a, e, n);
  } catch (s) {
    return renderError(s, e, n);
  }
}, katex = {
  /**
   * Current KaTeX version
   */
  version: "0.16.11",
  /**
   * Renders the given LaTeX into an HTML+MathML combination, and adds
   * it as a child to the specified DOM node.
   */
  render,
  /**
   * Renders the given LaTeX into an HTML+MathML combination string,
   * for sending to the client.
   */
  renderToString,
  /**
   * KaTeX error, usually during parsing.
   */
  ParseError,
  /**
   * The shema of Settings
   */
  SETTINGS_SCHEMA,
  /**
   * Parses the given LaTeX into KaTeX's internal parse tree structure,
   * without rendering to HTML or MathML.
   *
   * NOTE: This method is not currently recommended for public use.
   * The internal tree representation is unstable and is very likely
   * to change. Use at your own risk.
   */
  __parse: generateParseTree,
  /**
   * Renders the given LaTeX into an HTML+MathML internal DOM tree
   * representation, without flattening that representation to a string.
   *
   * NOTE: This method is not currently recommended for public use.
   * The internal tree representation is unstable and is very likely
   * to change. Use at your own risk.
   */
  __renderToDomTree: renderToDomTree,
  /**
   * Renders the given LaTeX into an HTML internal DOM tree representation,
   * without MathML and without flattening that representation to a string.
   *
   * NOTE: This method is not currently recommended for public use.
   * The internal tree representation is unstable and is very likely
   * to change. Use at your own risk.
   */
  __renderToHTMLTree: renderToHTMLTree,
  /**
   * extends internal font metrics object with a new object
   * each key in the new object represents a font name
  */
  __setFontMetrics: setFontMetrics,
  /**
   * adds a new symbol to builtin symbols table
   */
  __defineSymbol: defineSymbol,
  /**
   * adds a new function to builtin function list,
   * which directly produce parse tree elements
   * and have their own html/mathml builders
   */
  __defineFunction: defineFunction,
  /**
   * adds a new macro to builtin macro list
   */
  __defineMacro: defineMacro,
  /**
   * Expose the dom tree node types, which can be useful for type checking nodes.
   *
   * NOTE: This method is not currently recommended for public use.
   * The internal tree representation is unstable and is very likely
   * to change. Use at your own risk.
   */
  __domTree: {
    Span,
    Anchor,
    SymbolNode,
    SvgNode,
    PathNode,
    LineNode
  }
}, findEndOfMath = function(e, t, n) {
  for (var a = n, s = 0, o = e.length; a < t.length; ) {
    var c = t[a];
    if (s <= 0 && t.slice(a, a + o) === e)
      return a;
    c === "\\" ? a++ : c === "{" ? s++ : c === "}" && s--, a++;
  }
  return -1;
}, escapeRegex = function(e) {
  return e.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&");
}, amsRegex = /^\\begin{/, splitAtDelimiters = function(e, t) {
  for (var n, a = [], s = new RegExp("(" + t.map((u) => escapeRegex(u.left)).join("|") + ")"); n = e.search(s), n !== -1; ) {
    n > 0 && (a.push({
      type: "text",
      data: e.slice(0, n)
    }), e = e.slice(n));
    var o = t.findIndex((u) => e.startsWith(u.left));
    if (n = findEndOfMath(t[o].right, e, t[o].left.length), n === -1)
      break;
    var c = e.slice(0, n + t[o].right.length), l = amsRegex.test(c) ? c : e.slice(t[o].left.length, n);
    a.push({
      type: "math",
      data: l,
      rawData: c,
      display: t[o].display
    }), e = e.slice(n + t[o].right.length);
  }
  return e !== "" && a.push({
    type: "text",
    data: e
  }), a;
}, renderMathInText = function(e, t) {
  var n = splitAtDelimiters(e, t.delimiters);
  if (n.length === 1 && n[0].type === "text")
    return null;
  for (var a = document.createDocumentFragment(), s = 0; s < n.length; s++)
    if (n[s].type === "text")
      a.appendChild(document.createTextNode(n[s].data));
    else {
      var o = document.createElement("span"), c = n[s].data;
      t.displayMode = n[s].display;
      try {
        t.preProcess && (c = t.preProcess(c)), katex.render(c, o, t);
      } catch (l) {
        if (!(l instanceof katex.ParseError))
          throw l;
        t.errorCallback("KaTeX auto-render: Failed to parse `" + n[s].data + "` with ", l), a.appendChild(document.createTextNode(n[s].rawData));
        continue;
      }
      a.appendChild(o);
    }
  return a;
}, renderElem = function r(e, t) {
  for (var n = 0; n < e.childNodes.length; n++) {
    var a = e.childNodes[n];
    if (a.nodeType === 3) {
      for (var s = a.textContent, o = a.nextSibling, c = 0; o && o.nodeType === Node.TEXT_NODE; )
        s += o.textContent, o = o.nextSibling, c++;
      var l = renderMathInText(s, t);
      if (l) {
        for (var u = 0; u < c; u++)
          a.nextSibling.remove();
        n += l.childNodes.length - 1, e.replaceChild(l, a);
      } else
        n += c;
    } else a.nodeType === 1 && function() {
      var h = " " + a.className + " ", d = t.ignoredTags.indexOf(a.nodeName.toLowerCase()) === -1 && t.ignoredClasses.every((w) => h.indexOf(" " + w + " ") === -1);
      d && r(a, t);
    }();
  }
}, renderMathInElement = function(e, t) {
  if (!e)
    throw new Error("No element provided to render");
  var n = {};
  for (var a in t)
    t.hasOwnProperty(a) && (n[a] = t[a]);
  n.delimiters = n.delimiters || [
    {
      left: "$$",
      right: "$$",
      display: !0
    },
    {
      left: "\\(",
      right: "\\)",
      display: !1
    },
    // LaTeX uses $…$, but it ruins the display of normal `$` in text:
    // {left: "$", right: "$", display: false},
    // $ must come after $$
    // Render AMS environments even if outside $$…$$ delimiters.
    {
      left: "\\begin{equation}",
      right: "\\end{equation}",
      display: !0
    },
    {
      left: "\\begin{align}",
      right: "\\end{align}",
      display: !0
    },
    {
      left: "\\begin{alignat}",
      right: "\\end{alignat}",
      display: !0
    },
    {
      left: "\\begin{gather}",
      right: "\\end{gather}",
      display: !0
    },
    {
      left: "\\begin{CD}",
      right: "\\end{CD}",
      display: !0
    },
    {
      left: "\\[",
      right: "\\]",
      display: !0
    }
  ], n.ignoredTags = n.ignoredTags || ["script", "noscript", "style", "textarea", "pre", "code", "option"], n.ignoredClasses = n.ignoredClasses || [], n.errorCallback = n.errorCallback || console.error, n.macros = n.macros || {}, renderElem(e, n);
};
const {
  SvelteComponent: SvelteComponent$4,
  attr: attr$4,
  binding_callbacks: binding_callbacks$2,
  detach: detach$4,
  element: element$4,
  init: init$4,
  insert: insert$4,
  noop: noop$5,
  safe_not_equal: safe_not_equal$5,
  toggle_class: toggle_class$3
} = window.__gradio__svelte__internal, { afterUpdate } = window.__gradio__svelte__internal;
function create_fragment$4(r) {
  let e;
  return {
    c() {
      e = element$4("span"), attr$4(e, "class", "md svelte-91qfmi"), toggle_class$3(
        e,
        "chatbot",
        /*chatbot*/
        r[0]
      ), toggle_class$3(
        e,
        "prose",
        /*render_markdown*/
        r[1]
      );
    },
    m(t, n) {
      insert$4(t, e, n), e.innerHTML = /*html*/
      r[3], r[9](e);
    },
    p(t, [n]) {
      n & /*html*/
      8 && (e.innerHTML = /*html*/
      t[3]), n & /*chatbot*/
      1 && toggle_class$3(
        e,
        "chatbot",
        /*chatbot*/
        t[0]
      ), n & /*render_markdown*/
      2 && toggle_class$3(
        e,
        "prose",
        /*render_markdown*/
        t[1]
      );
    },
    i: noop$5,
    o: noop$5,
    d(t) {
      t && detach$4(e), r[9](null);
    }
  };
}
function escapeRegExp(r) {
  return r.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
}
function instance$4(r, e, t) {
  var n = this && this.__awaiter || function(m, A, F, f) {
    function g(y) {
      return y instanceof F ? y : new F(function(E) {
        E(y);
      });
    }
    return new (F || (F = Promise))(function(y, E) {
      function x(I) {
        try {
          P(f.next(I));
        } catch (G) {
          E(G);
        }
      }
      function O(I) {
        try {
          P(f.throw(I));
        } catch (G) {
          E(G);
        }
      }
      function P(I) {
        I.done ? y(I.value) : g(I.value).then(x, O);
      }
      P((f = f.apply(m, A || [])).next());
    });
  };
  let { chatbot: a = !0 } = e, { message: s } = e, { sanitize_html: o = !0 } = e, { latex_delimiters: c = [] } = e, { render_markdown: l = !0 } = e, { line_breaks: u = !0 } = e, { header_links: h = !1 } = e, d, w;
  const b = create_marked({
    header_links: h,
    line_breaks: u,
    latex_delimiters: c
  }), _ = (m) => {
    try {
      return !!m && new URL(m, location.href).origin !== location.origin;
    } catch {
      return !1;
    }
  };
  purify.addHook("afterSanitizeAttributes", function(m) {
    "target" in m && _(m.getAttribute("href")) && (m.setAttribute("target", "_blank"), m.setAttribute("rel", "noopener noreferrer"));
  });
  function R(m) {
    let A = m;
    if (l) {
      const F = [];
      c.forEach((f, g) => {
        const y = escapeRegExp(f.left), E = escapeRegExp(f.right), x = new RegExp(`${y}([\\s\\S]+?)${E}`, "g");
        A = A.replace(x, (O, P) => (F.push(O), `%%%LATEX_BLOCK_${F.length - 1}%%%`));
      }), A = b.parse(A), A = A.replace(/%%%LATEX_BLOCK_(\d+)%%%/g, (f, g) => F[parseInt(g, 10)]);
    }
    return o && (A = purify.sanitize(A)), A;
  }
  function k(m) {
    return n(this, void 0, void 0, function* () {
      c.length > 0 && m && c.some((F) => m.includes(F.left) && m.includes(F.right)) && renderMathInElement(d, {
        delimiters: c,
        throwOnError: !1
      });
    });
  }
  afterUpdate(() => n(void 0, void 0, void 0, function* () {
    d && document.body.contains(d) ? yield k(s) : console.error("Element is not in the DOM");
  }));
  function C(m) {
    binding_callbacks$2[m ? "unshift" : "push"](() => {
      d = m, t(2, d);
    });
  }
  return r.$$set = (m) => {
    "chatbot" in m && t(0, a = m.chatbot), "message" in m && t(4, s = m.message), "sanitize_html" in m && t(5, o = m.sanitize_html), "latex_delimiters" in m && t(6, c = m.latex_delimiters), "render_markdown" in m && t(1, l = m.render_markdown), "line_breaks" in m && t(7, u = m.line_breaks), "header_links" in m && t(8, h = m.header_links);
  }, r.$$.update = () => {
    r.$$.dirty & /*message*/
    16 && (s && s.trim() ? t(3, w = R(s)) : t(3, w = ""));
  }, [
    a,
    l,
    d,
    w,
    s,
    o,
    c,
    u,
    h,
    C
  ];
}
class MarkdownCode extends SvelteComponent$4 {
  constructor(e) {
    super(), init$4(this, e, instance$4, create_fragment$4, safe_not_equal$5, {
      chatbot: 0,
      message: 4,
      sanitize_html: 5,
      latex_delimiters: 6,
      render_markdown: 1,
      line_breaks: 7,
      header_links: 8
    });
  }
}
function noop$4() {
}
const identity = (r) => r;
function safe_not_equal$4(r, e) {
  return r != r ? e == e : r !== e || r && typeof r == "object" || typeof r == "function";
}
const is_client = typeof window < "u";
let now = is_client ? () => window.performance.now() : () => Date.now(), raf = is_client ? (r) => requestAnimationFrame(r) : noop$4;
const tasks = /* @__PURE__ */ new Set();
function run_tasks(r) {
  tasks.forEach((e) => {
    e.c(r) || (tasks.delete(e), e.f());
  }), tasks.size !== 0 && raf(run_tasks);
}
function loop(r) {
  let e;
  return tasks.size === 0 && raf(run_tasks), {
    promise: new Promise((t) => {
      tasks.add(e = { c: r, f: t });
    }),
    abort() {
      tasks.delete(e);
    }
  };
}
function fade(r, { delay: e = 0, duration: t = 400, easing: n = identity } = {}) {
  const a = +getComputedStyle(r).opacity;
  return {
    delay: e,
    duration: t,
    easing: n,
    css: (s) => `opacity: ${s * a}`
  };
}
const subscriber_queue = [];
function writable(r, e = noop$4) {
  let t;
  const n = /* @__PURE__ */ new Set();
  function a(c) {
    if (safe_not_equal$4(r, c) && (r = c, t)) {
      const l = !subscriber_queue.length;
      for (const u of n)
        u[1](), subscriber_queue.push(u, r);
      if (l) {
        for (let u = 0; u < subscriber_queue.length; u += 2)
          subscriber_queue[u][0](subscriber_queue[u + 1]);
        subscriber_queue.length = 0;
      }
    }
  }
  function s(c) {
    a(c(r));
  }
  function o(c, l = noop$4) {
    const u = [c, l];
    return n.add(u), n.size === 1 && (t = e(a, s) || noop$4), c(r), () => {
      n.delete(u), n.size === 0 && t && (t(), t = null);
    };
  }
  return { set: a, update: s, subscribe: o };
}
function is_date(r) {
  return Object.prototype.toString.call(r) === "[object Date]";
}
function tick_spring(r, e, t, n) {
  if (typeof t == "number" || is_date(t)) {
    const a = n - t, s = (t - e) / (r.dt || 1 / 60), o = r.opts.stiffness * a, c = r.opts.damping * s, l = (o - c) * r.inv_mass, u = (s + l) * r.dt;
    return Math.abs(u) < r.opts.precision && Math.abs(a) < r.opts.precision ? n : (r.settled = !1, is_date(t) ? new Date(t.getTime() + u) : t + u);
  } else {
    if (Array.isArray(t))
      return t.map(
        (a, s) => tick_spring(r, e[s], t[s], n[s])
      );
    if (typeof t == "object") {
      const a = {};
      for (const s in t)
        a[s] = tick_spring(r, e[s], t[s], n[s]);
      return a;
    } else
      throw new Error(`Cannot spring ${typeof t} values`);
  }
}
function spring(r, e = {}) {
  const t = writable(r), { stiffness: n = 0.15, damping: a = 0.8, precision: s = 0.01 } = e;
  let o, c, l, u = r, h = r, d = 1, w = 0, b = !1;
  function _(k, C = {}) {
    h = k;
    const m = l = {};
    return r == null || C.hard || R.stiffness >= 1 && R.damping >= 1 ? (b = !0, o = now(), u = k, t.set(r = h), Promise.resolve()) : (C.soft && (w = 1 / ((C.soft === !0 ? 0.5 : +C.soft) * 60), d = 0), c || (o = now(), b = !1, c = loop((A) => {
      if (b)
        return b = !1, c = null, !1;
      d = Math.min(d + w, 1);
      const F = {
        inv_mass: d,
        opts: R,
        settled: !0,
        dt: (A - o) * 60 / 1e3
      }, f = tick_spring(F, u, r, h);
      return o = A, u = r, t.set(r = f), F.settled && (c = null), !F.settled;
    })), new Promise((A) => {
      c.promise.then(() => {
        m === l && A();
      });
    }));
  }
  const R = {
    set: _,
    update: (k, C) => _(k(h, r), C),
    subscribe: t.subscribe,
    stiffness: n,
    damping: a,
    precision: s
  };
  return R;
}
const {
  SvelteComponent: SvelteComponent$3,
  action_destroyer,
  add_render_callback,
  append: append$3,
  attr: attr$3,
  check_outros: check_outros$2,
  create_component: create_component$2,
  create_in_transition,
  destroy_component: destroy_component$2,
  detach: detach$3,
  element: element$3,
  empty: empty$1,
  group_outros: group_outros$2,
  init: init$3,
  insert: insert$3,
  listen: listen$1,
  mount_component: mount_component$2,
  noop: noop$3,
  safe_not_equal: safe_not_equal$3,
  space: space$2,
  toggle_class: toggle_class$2,
  transition_in: transition_in$2,
  transition_out: transition_out$2
} = window.__gradio__svelte__internal, { createEventDispatcher: createEventDispatcher$1 } = window.__gradio__svelte__internal;
function create_if_block$2(r) {
  let e, t, n, a;
  const s = [create_if_block_1$2, create_else_block$1], o = [];
  function c(l, u) {
    return (
      /*copied*/
      l[11] ? 0 : 1
    );
  }
  return e = c(r), t = o[e] = s[e](r), {
    c() {
      t.c(), n = empty$1();
    },
    m(l, u) {
      o[e].m(l, u), insert$3(l, n, u), a = !0;
    },
    p(l, u) {
      let h = e;
      e = c(l), e === h ? o[e].p(l, u) : (group_outros$2(), transition_out$2(o[h], 1, 1, () => {
        o[h] = null;
      }), check_outros$2(), t = o[e], t ? t.p(l, u) : (t = o[e] = s[e](l), t.c()), transition_in$2(t, 1), t.m(n.parentNode, n));
    },
    i(l) {
      a || (transition_in$2(t), a = !0);
    },
    o(l) {
      transition_out$2(t), a = !1;
    },
    d(l) {
      l && detach$3(n), o[e].d(l);
    }
  };
}
function create_else_block$1(r) {
  let e, t, n, a, s;
  return t = new Copy({}), {
    c() {
      e = element$3("button"), create_component$2(t.$$.fragment), attr$3(e, "aria-label", "Copy"), attr$3(e, "aria-roledescription", "Copy text"), attr$3(e, "class", "svelte-1sn7l5u");
    },
    m(o, c) {
      insert$3(o, e, c), mount_component$2(t, e, null), n = !0, a || (s = listen$1(
        e,
        "click",
        /*handle_copy*/
        r[13]
      ), a = !0);
    },
    p: noop$3,
    i(o) {
      n || (transition_in$2(t.$$.fragment, o), n = !0);
    },
    o(o) {
      transition_out$2(t.$$.fragment, o), n = !1;
    },
    d(o) {
      o && detach$3(e), destroy_component$2(t), a = !1, s();
    }
  };
}
function create_if_block_1$2(r) {
  let e, t, n, a;
  return t = new Check({}), {
    c() {
      e = element$3("button"), create_component$2(t.$$.fragment), attr$3(e, "aria-label", "Copied"), attr$3(e, "aria-roledescription", "Text copied"), attr$3(e, "class", "svelte-1sn7l5u");
    },
    m(s, o) {
      insert$3(s, e, o), mount_component$2(t, e, null), a = !0;
    },
    p: noop$3,
    i(s) {
      a || (transition_in$2(t.$$.fragment, s), s && (n || add_render_callback(() => {
        n = create_in_transition(e, fade, { duration: 300 }), n.start();
      })), a = !0);
    },
    o(s) {
      transition_out$2(t.$$.fragment, s), a = !1;
    },
    d(s) {
      s && detach$3(e), destroy_component$2(t);
    }
  };
}
function create_fragment$3(r) {
  let e, t, n, a, s, o, c, l, u, h = (
    /*show_copy_button*/
    r[10] && create_if_block$2(r)
  );
  return n = new MarkdownCode({
    props: {
      message: (
        /*value*/
        r[2]
      ),
      latex_delimiters: (
        /*latex_delimiters*/
        r[7]
      ),
      sanitize_html: (
        /*sanitize_html*/
        r[5]
      ),
      line_breaks: (
        /*line_breaks*/
        r[6]
      ),
      chatbot: !1,
      header_links: (
        /*header_links*/
        r[8]
      )
    }
  }), {
    c() {
      e = element$3("div"), h && h.c(), t = space$2(), create_component$2(n.$$.fragment), attr$3(e, "class", a = "prose " + /*elem_classes*/
      r[0].join(" ") + " svelte-1sn7l5u"), attr$3(e, "data-testid", "markdown"), attr$3(e, "dir", s = /*rtl*/
      r[4] ? "rtl" : "ltr"), attr$3(e, "style", o = /*height*/
      r[9] ? `max-height: ${/*css_units*/
      r[12](
        /*height*/
        r[9]
      )}; overflow-y: auto;` : ""), toggle_class$2(
        e,
        "min",
        /*min_height*/
        r[3]
      ), toggle_class$2(e, "hide", !/*visible*/
      r[1]);
    },
    m(d, w) {
      insert$3(d, e, w), h && h.m(e, null), append$3(e, t), mount_component$2(n, e, null), c = !0, l || (u = action_destroyer(copy.call(null, e)), l = !0);
    },
    p(d, [w]) {
      /*show_copy_button*/
      d[10] ? h ? (h.p(d, w), w & /*show_copy_button*/
      1024 && transition_in$2(h, 1)) : (h = create_if_block$2(d), h.c(), transition_in$2(h, 1), h.m(e, t)) : h && (group_outros$2(), transition_out$2(h, 1, 1, () => {
        h = null;
      }), check_outros$2());
      const b = {};
      w & /*value*/
      4 && (b.message = /*value*/
      d[2]), w & /*latex_delimiters*/
      128 && (b.latex_delimiters = /*latex_delimiters*/
      d[7]), w & /*sanitize_html*/
      32 && (b.sanitize_html = /*sanitize_html*/
      d[5]), w & /*line_breaks*/
      64 && (b.line_breaks = /*line_breaks*/
      d[6]), w & /*header_links*/
      256 && (b.header_links = /*header_links*/
      d[8]), n.$set(b), (!c || w & /*elem_classes*/
      1 && a !== (a = "prose " + /*elem_classes*/
      d[0].join(" ") + " svelte-1sn7l5u")) && attr$3(e, "class", a), (!c || w & /*rtl*/
      16 && s !== (s = /*rtl*/
      d[4] ? "rtl" : "ltr")) && attr$3(e, "dir", s), (!c || w & /*height*/
      512 && o !== (o = /*height*/
      d[9] ? `max-height: ${/*css_units*/
      d[12](
        /*height*/
        d[9]
      )}; overflow-y: auto;` : "")) && attr$3(e, "style", o), (!c || w & /*elem_classes, min_height*/
      9) && toggle_class$2(
        e,
        "min",
        /*min_height*/
        d[3]
      ), (!c || w & /*elem_classes, visible*/
      3) && toggle_class$2(e, "hide", !/*visible*/
      d[1]);
    },
    i(d) {
      c || (transition_in$2(h), transition_in$2(n.$$.fragment, d), c = !0);
    },
    o(d) {
      transition_out$2(h), transition_out$2(n.$$.fragment, d), c = !1;
    },
    d(d) {
      d && detach$3(e), h && h.d(), destroy_component$2(n), l = !1, u();
    }
  };
}
function instance$3(r, e, t) {
  var n = this && this.__awaiter || function(f, g, y, E) {
    function x(O) {
      return O instanceof y ? O : new y(function(P) {
        P(O);
      });
    }
    return new (y || (y = Promise))(function(O, P) {
      function I(X) {
        try {
          ne(E.next(X));
        } catch (ee) {
          P(ee);
        }
      }
      function G(X) {
        try {
          ne(E.throw(X));
        } catch (ee) {
          P(ee);
        }
      }
      function ne(X) {
        X.done ? O(X.value) : x(X.value).then(I, G);
      }
      ne((E = E.apply(f, g || [])).next());
    });
  };
  let { elem_classes: a = [] } = e, { visible: s = !0 } = e, { value: o } = e, { min_height: c = !1 } = e, { rtl: l = !1 } = e, { sanitize_html: u = !0 } = e, { line_breaks: h = !1 } = e, { latex_delimiters: d = [
    {
      left: "$$",
      right: "$$",
      display: !0
    }
  ] } = e, { header_links: w = !1 } = e, { height: b = void 0 } = e, { show_copy_button: _ = !1 } = e, R = !1, k;
  const C = createEventDispatcher$1(), m = (f) => typeof f == "number" ? f + "px" : f;
  function A() {
    return n(this, void 0, void 0, function* () {
      "clipboard" in navigator && (yield navigator.clipboard.writeText(o), F());
    });
  }
  function F() {
    t(11, R = !0), k && clearTimeout(k), k = setTimeout(
      () => {
        t(11, R = !1);
      },
      1e3
    );
  }
  return r.$$set = (f) => {
    "elem_classes" in f && t(0, a = f.elem_classes), "visible" in f && t(1, s = f.visible), "value" in f && t(2, o = f.value), "min_height" in f && t(3, c = f.min_height), "rtl" in f && t(4, l = f.rtl), "sanitize_html" in f && t(5, u = f.sanitize_html), "line_breaks" in f && t(6, h = f.line_breaks), "latex_delimiters" in f && t(7, d = f.latex_delimiters), "header_links" in f && t(8, w = f.header_links), "height" in f && t(9, b = f.height), "show_copy_button" in f && t(10, _ = f.show_copy_button);
  }, r.$$.update = () => {
    r.$$.dirty & /*value*/
    4 && C("change");
  }, [
    a,
    s,
    o,
    c,
    l,
    u,
    h,
    d,
    w,
    b,
    _,
    R,
    m,
    A
  ];
}
class Markdown extends SvelteComponent$3 {
  constructor(e) {
    super(), init$3(this, e, instance$3, create_fragment$3, safe_not_equal$3, {
      elem_classes: 0,
      visible: 1,
      value: 2,
      min_height: 3,
      rtl: 4,
      sanitize_html: 5,
      line_breaks: 6,
      latex_delimiters: 7,
      header_links: 8,
      height: 9,
      show_copy_button: 10
    });
  }
}
function commonjsRequire(r) {
  throw new Error('Could not dynamically require "' + r + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
}
var pdf = { exports: {} };
const __viteBrowserExternal = {}, __viteBrowserExternal$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  default: __viteBrowserExternal
}, Symbol.toStringTag, { value: "Module" })), require$$5 = /* @__PURE__ */ getAugmentedNamespace(__viteBrowserExternal$1);
(function(module, exports) {
  (function(e, t) {
    module.exports = e.pdfjsLib = t();
  })(globalThis, () => (
    /******/
    (() => {
      var __webpack_modules__ = [
        ,
        /* 1 */
        /***/
        (r, e) => {
          var nt;
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.VerbosityLevel = e.Util = e.UnknownErrorException = e.UnexpectedResponseException = e.TextRenderingMode = e.RenderingIntentFlag = e.PromiseCapability = e.PermissionFlag = e.PasswordResponses = e.PasswordException = e.PageActionEventType = e.OPS = e.MissingPDFException = e.MAX_IMAGE_SIZE_TO_CACHE = e.LINE_FACTOR = e.LINE_DESCENT_FACTOR = e.InvalidPDFException = e.ImageKind = e.IDENTITY_MATRIX = e.FormatError = e.FeatureTest = e.FONT_IDENTITY_MATRIX = e.DocumentActionEventType = e.CMapCompressionType = e.BaseException = e.BASELINE_FACTOR = e.AnnotationType = e.AnnotationReplyType = e.AnnotationPrefix = e.AnnotationMode = e.AnnotationFlag = e.AnnotationFieldFlag = e.AnnotationEditorType = e.AnnotationEditorPrefix = e.AnnotationEditorParamsType = e.AnnotationBorderStyleType = e.AnnotationActionEventType = e.AbortException = void 0, e.assert = q, e.bytesToString = pe, e.createValidAbsoluteUrl = J, e.getModificationDate = De, e.getUuid = Ge, e.getVerbosityLevel = X, e.info = ee, e.isArrayBuffer = ie, e.isArrayEqual = Fe, e.isNodeJS = void 0, e.normalizeUnicode = $e, e.objectFromMap = we, e.objectSize = _e, e.setVerbosityLevel = ne, e.shadow = N, e.string32 = Se, e.stringToBytes = be, e.stringToPDFString = Ae, e.stringToUTF8String = Te, e.unreachable = se, e.utf8StringToString = ke, e.warn = K;
          const t = typeof process == "object" && process + "" == "[object process]" && !process.versions.nw && !(process.versions.electron && process.type && process.type !== "browser");
          e.isNodeJS = t;
          const n = [1, 0, 0, 1, 0, 0];
          e.IDENTITY_MATRIX = n;
          const a = [1e-3, 0, 0, 1e-3, 0, 0];
          e.FONT_IDENTITY_MATRIX = a;
          const s = 1e7;
          e.MAX_IMAGE_SIZE_TO_CACHE = s;
          const o = 1.35;
          e.LINE_FACTOR = o;
          const c = 0.35;
          e.LINE_DESCENT_FACTOR = c;
          const l = c / o;
          e.BASELINE_FACTOR = l;
          const u = {
            ANY: 1,
            DISPLAY: 2,
            PRINT: 4,
            SAVE: 8,
            ANNOTATIONS_FORMS: 16,
            ANNOTATIONS_STORAGE: 32,
            ANNOTATIONS_DISABLE: 64,
            OPLIST: 256
          };
          e.RenderingIntentFlag = u;
          const h = {
            DISABLE: 0,
            ENABLE: 1,
            ENABLE_FORMS: 2,
            ENABLE_STORAGE: 3
          };
          e.AnnotationMode = h;
          const d = "pdfjs_internal_editor_";
          e.AnnotationEditorPrefix = d;
          const w = {
            DISABLE: -1,
            NONE: 0,
            FREETEXT: 3,
            STAMP: 13,
            INK: 15
          };
          e.AnnotationEditorType = w;
          const b = {
            RESIZE: 1,
            CREATE: 2,
            FREETEXT_SIZE: 11,
            FREETEXT_COLOR: 12,
            FREETEXT_OPACITY: 13,
            INK_COLOR: 21,
            INK_THICKNESS: 22,
            INK_OPACITY: 23
          };
          e.AnnotationEditorParamsType = b;
          const _ = {
            PRINT: 4,
            MODIFY_CONTENTS: 8,
            COPY: 16,
            MODIFY_ANNOTATIONS: 32,
            FILL_INTERACTIVE_FORMS: 256,
            COPY_FOR_ACCESSIBILITY: 512,
            ASSEMBLE: 1024,
            PRINT_HIGH_QUALITY: 2048
          };
          e.PermissionFlag = _;
          const R = {
            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
          };
          e.TextRenderingMode = R;
          const k = {
            GRAYSCALE_1BPP: 1,
            RGB_24BPP: 2,
            RGBA_32BPP: 3
          };
          e.ImageKind = k;
          const C = {
            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
          };
          e.AnnotationType = C;
          const m = {
            GROUP: "Group",
            REPLY: "R"
          };
          e.AnnotationReplyType = m;
          const A = {
            INVISIBLE: 1,
            HIDDEN: 2,
            PRINT: 4,
            NOZOOM: 8,
            NOROTATE: 16,
            NOVIEW: 32,
            READONLY: 64,
            LOCKED: 128,
            TOGGLENOVIEW: 256,
            LOCKEDCONTENTS: 512
          };
          e.AnnotationFlag = A;
          const F = {
            READONLY: 1,
            REQUIRED: 2,
            NOEXPORT: 4,
            MULTILINE: 4096,
            PASSWORD: 8192,
            NOTOGGLETOOFF: 16384,
            RADIO: 32768,
            PUSHBUTTON: 65536,
            COMBO: 131072,
            EDIT: 262144,
            SORT: 524288,
            FILESELECT: 1048576,
            MULTISELECT: 2097152,
            DONOTSPELLCHECK: 4194304,
            DONOTSCROLL: 8388608,
            COMB: 16777216,
            RICHTEXT: 33554432,
            RADIOSINUNISON: 33554432,
            COMMITONSELCHANGE: 67108864
          };
          e.AnnotationFieldFlag = F;
          const f = {
            SOLID: 1,
            DASHED: 2,
            BEVELED: 3,
            INSET: 4,
            UNDERLINE: 5
          };
          e.AnnotationBorderStyleType = f;
          const g = {
            E: "Mouse Enter",
            X: "Mouse Exit",
            D: "Mouse Down",
            U: "Mouse Up",
            Fo: "Focus",
            Bl: "Blur",
            PO: "PageOpen",
            PC: "PageClose",
            PV: "PageVisible",
            PI: "PageInvisible",
            K: "Keystroke",
            F: "Format",
            V: "Validate",
            C: "Calculate"
          };
          e.AnnotationActionEventType = g;
          const y = {
            WC: "WillClose",
            WS: "WillSave",
            DS: "DidSave",
            WP: "WillPrint",
            DP: "DidPrint"
          };
          e.DocumentActionEventType = y;
          const E = {
            O: "PageOpen",
            C: "PageClose"
          };
          e.PageActionEventType = E;
          const x = {
            ERRORS: 0,
            WARNINGS: 1,
            INFOS: 5
          };
          e.VerbosityLevel = x;
          const O = {
            NONE: 0,
            BINARY: 1
          };
          e.CMapCompressionType = O;
          const P = {
            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
          };
          e.OPS = P;
          const I = {
            NEED_PASSWORD: 1,
            INCORRECT_PASSWORD: 2
          };
          e.PasswordResponses = I;
          let G = x.WARNINGS;
          function ne(xe) {
            Number.isInteger(xe) && (G = xe);
          }
          function X() {
            return G;
          }
          function ee(xe) {
            G >= x.INFOS && console.log(`Info: ${xe}`);
          }
          function K(xe) {
            G >= x.WARNINGS && console.log(`Warning: ${xe}`);
          }
          function se(xe) {
            throw new Error(xe);
          }
          function q(xe, he) {
            xe || se(he);
          }
          function Y(xe) {
            switch (xe == null ? void 0 : xe.protocol) {
              case "http:":
              case "https:":
              case "ftp:":
              case "mailto:":
              case "tel:":
                return !0;
              default:
                return !1;
            }
          }
          function J(xe, he = null, me = null) {
            if (!xe)
              return null;
            try {
              if (me && typeof xe == "string") {
                if (me.addDefaultProtocol && xe.startsWith("www.")) {
                  const Ze = xe.match(/\./g);
                  (Ze == null ? void 0 : Ze.length) >= 2 && (xe = `http://${xe}`);
                }
                if (me.tryConvertEncoding)
                  try {
                    xe = Te(xe);
                  } catch {
                  }
              }
              const Ie = he ? new URL(xe, he) : new URL(xe);
              if (Y(Ie))
                return Ie;
            } catch {
            }
            return null;
          }
          function N(xe, he, me, Ie = !1) {
            return Object.defineProperty(xe, he, {
              value: me,
              enumerable: !Ie,
              configurable: !0,
              writable: !1
            }), me;
          }
          const M = function() {
            function he(me, Ie) {
              this.constructor === he && se("Cannot initialize BaseException."), this.message = me, this.name = Ie;
            }
            return he.prototype = new Error(), he.constructor = he, he;
          }();
          e.BaseException = M;
          class v extends M {
            constructor(he, me) {
              super(he, "PasswordException"), this.code = me;
            }
          }
          e.PasswordException = v;
          class L extends M {
            constructor(he, me) {
              super(he, "UnknownErrorException"), this.details = me;
            }
          }
          e.UnknownErrorException = L;
          class H extends M {
            constructor(he) {
              super(he, "InvalidPDFException");
            }
          }
          e.InvalidPDFException = H;
          class B extends M {
            constructor(he) {
              super(he, "MissingPDFException");
            }
          }
          e.MissingPDFException = B;
          class U extends M {
            constructor(he, me) {
              super(he, "UnexpectedResponseException"), this.status = me;
            }
          }
          e.UnexpectedResponseException = U;
          class Z extends M {
            constructor(he) {
              super(he, "FormatError");
            }
          }
          e.FormatError = Z;
          class re extends M {
            constructor(he) {
              super(he, "AbortException");
            }
          }
          e.AbortException = re;
          function pe(xe) {
            (typeof xe != "object" || (xe == null ? void 0 : xe.length) === void 0) && se("Invalid argument for bytesToString");
            const he = xe.length, me = 8192;
            if (he < me)
              return String.fromCharCode.apply(null, xe);
            const Ie = [];
            for (let Ze = 0; Ze < he; Ze += me) {
              const et = Math.min(Ze + me, he), V = xe.subarray(Ze, et);
              Ie.push(String.fromCharCode.apply(null, V));
            }
            return Ie.join("");
          }
          function be(xe) {
            typeof xe != "string" && se("Invalid argument for stringToBytes");
            const he = xe.length, me = new Uint8Array(he);
            for (let Ie = 0; Ie < he; ++Ie)
              me[Ie] = xe.charCodeAt(Ie) & 255;
            return me;
          }
          function Se(xe) {
            return String.fromCharCode(xe >> 24 & 255, xe >> 16 & 255, xe >> 8 & 255, xe & 255);
          }
          function _e(xe) {
            return Object.keys(xe).length;
          }
          function we(xe) {
            const he = /* @__PURE__ */ Object.create(null);
            for (const [me, Ie] of xe)
              he[me] = Ie;
            return he;
          }
          function oe() {
            const xe = new Uint8Array(4);
            return xe[0] = 1, new Uint32Array(xe.buffer, 0, 1)[0] === 1;
          }
          function le() {
            try {
              return new Function(""), !0;
            } catch {
              return !1;
            }
          }
          class $ {
            static get isLittleEndian() {
              return N(this, "isLittleEndian", oe());
            }
            static get isEvalSupported() {
              return N(this, "isEvalSupported", le());
            }
            static get isOffscreenCanvasSupported() {
              return N(this, "isOffscreenCanvasSupported", typeof OffscreenCanvas < "u");
            }
            static get platform() {
              return typeof navigator > "u" ? N(this, "platform", {
                isWin: !1,
                isMac: !1
              }) : N(this, "platform", {
                isWin: navigator.platform.includes("Win"),
                isMac: navigator.platform.includes("Mac")
              });
            }
            static get isCSSRoundSupported() {
              var he, me;
              return N(this, "isCSSRoundSupported", (me = (he = globalThis.CSS) == null ? void 0 : he.supports) == null ? void 0 : me.call(he, "width: round(1.5px, 1px)"));
            }
          }
          e.FeatureTest = $;
          const j = [...Array(256).keys()].map((xe) => xe.toString(16).padStart(2, "0"));
          class ae {
            static makeHexColor(he, me, Ie) {
              return `#${j[he]}${j[me]}${j[Ie]}`;
            }
            static scaleMinMax(he, me) {
              let Ie;
              he[0] ? (he[0] < 0 && (Ie = me[0], me[0] = me[1], me[1] = Ie), me[0] *= he[0], me[1] *= he[0], he[3] < 0 && (Ie = me[2], me[2] = me[3], me[3] = Ie), me[2] *= he[3], me[3] *= he[3]) : (Ie = me[0], me[0] = me[2], me[2] = Ie, Ie = me[1], me[1] = me[3], me[3] = Ie, he[1] < 0 && (Ie = me[2], me[2] = me[3], me[3] = Ie), me[2] *= he[1], me[3] *= he[1], he[2] < 0 && (Ie = me[0], me[0] = me[1], me[1] = Ie), me[0] *= he[2], me[1] *= he[2]), me[0] += he[4], me[1] += he[4], me[2] += he[5], me[3] += he[5];
            }
            static transform(he, me) {
              return [he[0] * me[0] + he[2] * me[1], he[1] * me[0] + he[3] * me[1], he[0] * me[2] + he[2] * me[3], he[1] * me[2] + he[3] * me[3], he[0] * me[4] + he[2] * me[5] + he[4], he[1] * me[4] + he[3] * me[5] + he[5]];
            }
            static applyTransform(he, me) {
              const Ie = he[0] * me[0] + he[1] * me[2] + me[4], Ze = he[0] * me[1] + he[1] * me[3] + me[5];
              return [Ie, Ze];
            }
            static applyInverseTransform(he, me) {
              const Ie = me[0] * me[3] - me[1] * me[2], Ze = (he[0] * me[3] - he[1] * me[2] + me[2] * me[5] - me[4] * me[3]) / Ie, et = (-he[0] * me[1] + he[1] * me[0] + me[4] * me[1] - me[5] * me[0]) / Ie;
              return [Ze, et];
            }
            static getAxialAlignedBoundingBox(he, me) {
              const Ie = this.applyTransform(he, me), Ze = this.applyTransform(he.slice(2, 4), me), et = this.applyTransform([he[0], he[3]], me), V = this.applyTransform([he[2], he[1]], me);
              return [Math.min(Ie[0], Ze[0], et[0], V[0]), Math.min(Ie[1], Ze[1], et[1], V[1]), Math.max(Ie[0], Ze[0], et[0], V[0]), Math.max(Ie[1], Ze[1], et[1], V[1])];
            }
            static inverseTransform(he) {
              const me = he[0] * he[3] - he[1] * he[2];
              return [he[3] / me, -he[1] / me, -he[2] / me, he[0] / me, (he[2] * he[5] - he[4] * he[3]) / me, (he[4] * he[1] - he[5] * he[0]) / me];
            }
            static singularValueDecompose2dScale(he) {
              const me = [he[0], he[2], he[1], he[3]], Ie = he[0] * me[0] + he[1] * me[2], Ze = he[0] * me[1] + he[1] * me[3], et = he[2] * me[0] + he[3] * me[2], V = he[2] * me[1] + he[3] * me[3], ye = (Ie + V) / 2, Me = Math.sqrt((Ie + V) ** 2 - 4 * (Ie * V - et * Ze)) / 2, qe = ye + Me || 1, Ue = ye - Me || 1;
              return [Math.sqrt(qe), Math.sqrt(Ue)];
            }
            static normalizeRect(he) {
              const me = he.slice(0);
              return he[0] > he[2] && (me[0] = he[2], me[2] = he[0]), he[1] > he[3] && (me[1] = he[3], me[3] = he[1]), me;
            }
            static intersect(he, me) {
              const Ie = Math.max(Math.min(he[0], he[2]), Math.min(me[0], me[2])), Ze = Math.min(Math.max(he[0], he[2]), Math.max(me[0], me[2]));
              if (Ie > Ze)
                return null;
              const et = Math.max(Math.min(he[1], he[3]), Math.min(me[1], me[3])), V = Math.min(Math.max(he[1], he[3]), Math.max(me[1], me[3]));
              return et > V ? null : [Ie, et, Ze, V];
            }
            static bezierBoundingBox(he, me, Ie, Ze, et, V, ye, Me) {
              const qe = [], Ue = [[], []];
              let Le, W, z, Q, ge, ve, Ee, Ce;
              for (let Ye = 0; Ye < 2; ++Ye) {
                if (Ye === 0 ? (W = 6 * he - 12 * Ie + 6 * et, Le = -3 * he + 9 * Ie - 9 * et + 3 * ye, z = 3 * Ie - 3 * he) : (W = 6 * me - 12 * Ze + 6 * V, Le = -3 * me + 9 * Ze - 9 * V + 3 * Me, z = 3 * Ze - 3 * me), Math.abs(Le) < 1e-12) {
                  if (Math.abs(W) < 1e-12)
                    continue;
                  Q = -z / W, 0 < Q && Q < 1 && qe.push(Q);
                  continue;
                }
                Ee = W * W - 4 * z * Le, Ce = Math.sqrt(Ee), !(Ee < 0) && (ge = (-W + Ce) / (2 * Le), 0 < ge && ge < 1 && qe.push(ge), ve = (-W - Ce) / (2 * Le), 0 < ve && ve < 1 && qe.push(ve));
              }
              let Ne = qe.length, Be;
              const Pe = Ne;
              for (; Ne--; )
                Q = qe[Ne], Be = 1 - Q, Ue[0][Ne] = Be * Be * Be * he + 3 * Be * Be * Q * Ie + 3 * Be * Q * Q * et + Q * Q * Q * ye, Ue[1][Ne] = Be * Be * Be * me + 3 * Be * Be * Q * Ze + 3 * Be * Q * Q * V + Q * Q * Q * Me;
              return Ue[0][Pe] = he, Ue[1][Pe] = me, Ue[0][Pe + 1] = ye, Ue[1][Pe + 1] = Me, Ue[0].length = Ue[1].length = Pe + 2, [Math.min(...Ue[0]), Math.min(...Ue[1]), Math.max(...Ue[0]), Math.max(...Ue[1])];
            }
          }
          e.Util = ae;
          const ue = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 728, 711, 710, 729, 733, 731, 730, 732, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8226, 8224, 8225, 8230, 8212, 8211, 402, 8260, 8249, 8250, 8722, 8240, 8222, 8220, 8221, 8216, 8217, 8218, 8482, 64257, 64258, 321, 338, 352, 376, 381, 305, 322, 339, 353, 382, 0, 8364];
          function Ae(xe) {
            if (xe[0] >= "ï") {
              let me;
              if (xe[0] === "þ" && xe[1] === "ÿ" ? me = "utf-16be" : xe[0] === "ÿ" && xe[1] === "þ" ? me = "utf-16le" : xe[0] === "ï" && xe[1] === "»" && xe[2] === "¿" && (me = "utf-8"), me)
                try {
                  const Ie = new TextDecoder(me, {
                    fatal: !0
                  }), Ze = be(xe);
                  return Ie.decode(Ze);
                } catch (Ie) {
                  K(`stringToPDFString: "${Ie}".`);
                }
            }
            const he = [];
            for (let me = 0, Ie = xe.length; me < Ie; me++) {
              const Ze = ue[xe.charCodeAt(me)];
              he.push(Ze ? String.fromCharCode(Ze) : xe.charAt(me));
            }
            return he.join("");
          }
          function Te(xe) {
            return decodeURIComponent(escape(xe));
          }
          function ke(xe) {
            return unescape(encodeURIComponent(xe));
          }
          function ie(xe) {
            return typeof xe == "object" && (xe == null ? void 0 : xe.byteLength) !== void 0;
          }
          function Fe(xe, he) {
            if (xe.length !== he.length)
              return !1;
            for (let me = 0, Ie = xe.length; me < Ie; me++)
              if (xe[me] !== he[me])
                return !1;
            return !0;
          }
          function De(xe = /* @__PURE__ */ new Date()) {
            return [xe.getUTCFullYear().toString(), (xe.getUTCMonth() + 1).toString().padStart(2, "0"), xe.getUTCDate().toString().padStart(2, "0"), xe.getUTCHours().toString().padStart(2, "0"), xe.getUTCMinutes().toString().padStart(2, "0"), xe.getUTCSeconds().toString().padStart(2, "0")].join("");
          }
          class Xe {
            constructor() {
              de(this, nt, !1);
              this.promise = new Promise((he, me) => {
                this.resolve = (Ie) => {
                  fe(this, nt, !0), he(Ie);
                }, this.reject = (Ie) => {
                  fe(this, nt, !0), me(Ie);
                };
              });
            }
            get settled() {
              return p(this, nt);
            }
          }
          nt = new WeakMap(), e.PromiseCapability = Xe;
          let je = null, tt = null;
          function $e(xe) {
            return je || (je = /([\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, tt = /* @__PURE__ */ new Map([["ﬅ", "ſt"]])), xe.replaceAll(je, (he, me, Ie) => me ? me.normalize("NFKC") : tt.get(Ie));
          }
          function Ge() {
            if (typeof crypto < "u" && typeof (crypto == null ? void 0 : crypto.randomUUID) == "function")
              return crypto.randomUUID();
            const xe = new Uint8Array(32);
            if (typeof crypto < "u" && typeof (crypto == null ? void 0 : crypto.getRandomValues) == "function")
              crypto.getRandomValues(xe);
            else
              for (let he = 0; he < 32; he++)
                xe[he] = Math.floor(Math.random() * 255);
            return pe(xe);
          }
          const Qe = "pdfjs_internal_id_";
          e.AnnotationPrefix = Qe;
        },
        /* 2 */
        /***/
        (__unused_webpack_module, exports, __w_pdfjs_require__) => {
          var r, t, n, a, gt, Mt, c, l, u, h, d, w, b, _, R, Ft, C, m, jt, F, f;
          Object.defineProperty(exports, "__esModule", {
            value: !0
          }), exports.RenderTask = exports.PDFWorkerUtil = exports.PDFWorker = exports.PDFPageProxy = exports.PDFDocumentProxy = exports.PDFDocumentLoadingTask = exports.PDFDataRangeTransport = exports.LoopbackPort = exports.DefaultStandardFontDataFactory = exports.DefaultFilterFactory = exports.DefaultCanvasFactory = exports.DefaultCMapReaderFactory = void 0, Object.defineProperty(exports, "SVGGraphics", {
            enumerable: !0,
            get: function() {
              return _displaySvg.SVGGraphics;
            }
          }), exports.build = void 0, exports.getDocument = getDocument, exports.version = void 0;
          var _util = __w_pdfjs_require__(1), _annotation_storage = __w_pdfjs_require__(3), _display_utils = __w_pdfjs_require__(6), _font_loader = __w_pdfjs_require__(9), _displayNode_utils = __w_pdfjs_require__(10), _canvas = __w_pdfjs_require__(11), _worker_options = __w_pdfjs_require__(14), _message_handler = __w_pdfjs_require__(15), _metadata = __w_pdfjs_require__(16), _optional_content_config = __w_pdfjs_require__(17), _transport_stream = __w_pdfjs_require__(18), _displayFetch_stream = __w_pdfjs_require__(19), _displayNetwork = __w_pdfjs_require__(22), _displayNode_stream = __w_pdfjs_require__(23), _displaySvg = __w_pdfjs_require__(24), _xfa_text = __w_pdfjs_require__(25);
          const DEFAULT_RANGE_CHUNK_SIZE = 65536, RENDERING_CANCELLED_TIMEOUT = 100, DELAYED_CLEANUP_TIMEOUT = 5e3, DefaultCanvasFactory = _util.isNodeJS ? _displayNode_utils.NodeCanvasFactory : _display_utils.DOMCanvasFactory;
          exports.DefaultCanvasFactory = DefaultCanvasFactory;
          const DefaultCMapReaderFactory = _util.isNodeJS ? _displayNode_utils.NodeCMapReaderFactory : _display_utils.DOMCMapReaderFactory;
          exports.DefaultCMapReaderFactory = DefaultCMapReaderFactory;
          const DefaultFilterFactory = _util.isNodeJS ? _displayNode_utils.NodeFilterFactory : _display_utils.DOMFilterFactory;
          exports.DefaultFilterFactory = DefaultFilterFactory;
          const DefaultStandardFontDataFactory = _util.isNodeJS ? _displayNode_utils.NodeStandardFontDataFactory : _display_utils.DOMStandardFontDataFactory;
          exports.DefaultStandardFontDataFactory = DefaultStandardFontDataFactory;
          function getDocument(y) {
            if (typeof y == "string" || y instanceof URL ? y = {
              url: y
            } : (0, _util.isArrayBuffer)(y) && (y = {
              data: y
            }), typeof y != "object")
              throw new Error("Invalid parameter in getDocument, need parameter object.");
            if (!y.url && !y.data && !y.range)
              throw new Error("Invalid parameter object: need either .data, .range or .url");
            const E = new PDFDocumentLoadingTask(), {
              docId: x
            } = E, O = y.url ? getUrlProp(y.url) : null, P = y.data ? getDataProp(y.data) : null, I = y.httpHeaders || null, G = y.withCredentials === !0, ne = y.password ?? null, X = y.range instanceof PDFDataRangeTransport ? y.range : null, ee = Number.isInteger(y.rangeChunkSize) && y.rangeChunkSize > 0 ? y.rangeChunkSize : DEFAULT_RANGE_CHUNK_SIZE;
            let K = y.worker instanceof PDFWorker ? y.worker : null;
            const se = y.verbosity, q = typeof y.docBaseUrl == "string" && !(0, _display_utils.isDataScheme)(y.docBaseUrl) ? y.docBaseUrl : null, Y = typeof y.cMapUrl == "string" ? y.cMapUrl : null, J = y.cMapPacked !== !1, N = y.CMapReaderFactory || DefaultCMapReaderFactory, M = typeof y.standardFontDataUrl == "string" ? y.standardFontDataUrl : null, v = y.StandardFontDataFactory || DefaultStandardFontDataFactory, L = y.stopAtErrors !== !0, H = Number.isInteger(y.maxImageSize) && y.maxImageSize > -1 ? y.maxImageSize : -1, B = y.isEvalSupported !== !1, U = typeof y.isOffscreenCanvasSupported == "boolean" ? y.isOffscreenCanvasSupported : !_util.isNodeJS, Z = Number.isInteger(y.canvasMaxAreaInBytes) ? y.canvasMaxAreaInBytes : -1, re = typeof y.disableFontFace == "boolean" ? y.disableFontFace : _util.isNodeJS, pe = y.fontExtraProperties === !0, be = y.enableXfa === !0, Se = y.ownerDocument || globalThis.document, _e = y.disableRange === !0, we = y.disableStream === !0, oe = y.disableAutoFetch === !0, le = y.pdfBug === !0, $ = X ? X.length : y.length ?? NaN, j = typeof y.useSystemFonts == "boolean" ? y.useSystemFonts : !_util.isNodeJS && !re, ae = typeof y.useWorkerFetch == "boolean" ? y.useWorkerFetch : N === _display_utils.DOMCMapReaderFactory && v === _display_utils.DOMStandardFontDataFactory && Y && M && (0, _display_utils.isValidFetchUrl)(Y, document.baseURI) && (0, _display_utils.isValidFetchUrl)(M, document.baseURI), ue = y.canvasFactory || new DefaultCanvasFactory({
              ownerDocument: Se
            }), Ae = y.filterFactory || new DefaultFilterFactory({
              docId: x,
              ownerDocument: Se
            }), Te = null;
            (0, _util.setVerbosityLevel)(se);
            const ke = {
              canvasFactory: ue,
              filterFactory: Ae
            };
            if (ae || (ke.cMapReaderFactory = new N({
              baseUrl: Y,
              isCompressed: J
            }), ke.standardFontDataFactory = new v({
              baseUrl: M
            })), !K) {
              const De = {
                verbosity: se,
                port: _worker_options.GlobalWorkerOptions.workerPort
              };
              K = De.port ? PDFWorker.fromPort(De) : new PDFWorker(De), E._worker = K;
            }
            const ie = {
              docId: x,
              apiVersion: "3.11.174",
              data: P,
              password: ne,
              disableAutoFetch: oe,
              rangeChunkSize: ee,
              length: $,
              docBaseUrl: q,
              enableXfa: be,
              evaluatorOptions: {
                maxImageSize: H,
                disableFontFace: re,
                ignoreErrors: L,
                isEvalSupported: B,
                isOffscreenCanvasSupported: U,
                canvasMaxAreaInBytes: Z,
                fontExtraProperties: pe,
                useSystemFonts: j,
                cMapUrl: ae ? Y : null,
                standardFontDataUrl: ae ? M : null
              }
            }, Fe = {
              ignoreErrors: L,
              isEvalSupported: B,
              disableFontFace: re,
              fontExtraProperties: pe,
              enableXfa: be,
              ownerDocument: Se,
              disableAutoFetch: oe,
              pdfBug: le,
              styleElement: Te
            };
            return K.promise.then(function() {
              if (E.destroyed)
                throw new Error("Loading aborted");
              const De = _fetchDocument(K, ie), Xe = new Promise(function(je) {
                let tt;
                X ? tt = new _transport_stream.PDFDataTransportStream({
                  length: $,
                  initialData: X.initialData,
                  progressiveDone: X.progressiveDone,
                  contentDispositionFilename: X.contentDispositionFilename,
                  disableRange: _e,
                  disableStream: we
                }, X) : P || (tt = ((Ge) => _util.isNodeJS ? new _displayNode_stream.PDFNodeStream(Ge) : (0, _display_utils.isValidFetchUrl)(Ge.url) ? new _displayFetch_stream.PDFFetchStream(Ge) : new _displayNetwork.PDFNetworkStream(Ge))({
                  url: O,
                  length: $,
                  httpHeaders: I,
                  withCredentials: G,
                  rangeChunkSize: ee,
                  disableRange: _e,
                  disableStream: we
                })), je(tt);
              });
              return Promise.all([De, Xe]).then(function([je, tt]) {
                if (E.destroyed)
                  throw new Error("Loading aborted");
                const $e = new _message_handler.MessageHandler(x, je, K.port), Ge = new WorkerTransport($e, E, tt, Fe, ke);
                E._transport = Ge, $e.send("Ready", null);
              });
            }).catch(E._capability.reject), E;
          }
          async function _fetchDocument(y, E) {
            if (y.destroyed)
              throw new Error("Worker was destroyed");
            const x = await y.messageHandler.sendWithPromise("GetDocRequest", E, E.data ? [E.data.buffer] : null);
            if (y.destroyed)
              throw new Error("Worker was destroyed");
            return x;
          }
          function getUrlProp(y) {
            if (y instanceof URL)
              return y.href;
            try {
              return new URL(y, window.location).href;
            } catch {
              if (_util.isNodeJS && typeof y == "string")
                return y;
            }
            throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.");
          }
          function getDataProp(y) {
            if (_util.isNodeJS && typeof Buffer < "u" && y instanceof Buffer)
              throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");
            if (y instanceof Uint8Array && y.byteLength === y.buffer.byteLength)
              return y;
            if (typeof y == "string")
              return (0, _util.stringToBytes)(y);
            if (typeof y == "object" && !isNaN(y == null ? void 0 : y.length) || (0, _util.isArrayBuffer)(y))
              return new Uint8Array(y);
            throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.");
          }
          const e = class e {
            constructor() {
              this._capability = new _util.PromiseCapability(), this._transport = null, this._worker = null, this.docId = `d${At(e, r)._++}`, this.destroyed = !1, this.onPassword = null, this.onProgress = null;
            }
            get promise() {
              return this._capability.promise;
            }
            async destroy() {
              var E, x, O;
              this.destroyed = !0;
              try {
                (E = this._worker) != null && E.port && (this._worker._pendingDestroy = !0), await ((x = this._transport) == null ? void 0 : x.destroy());
              } catch (P) {
                throw (O = this._worker) != null && O.port && delete this._worker._pendingDestroy, P;
              }
              this._transport = null, this._worker && (this._worker.destroy(), this._worker = null);
            }
          };
          r = new WeakMap(), de(e, r, 0);
          let PDFDocumentLoadingTask = e;
          exports.PDFDocumentLoadingTask = PDFDocumentLoadingTask;
          class PDFDataRangeTransport {
            constructor(E, x, O = !1, P = null) {
              this.length = E, this.initialData = x, this.progressiveDone = O, this.contentDispositionFilename = P, this._rangeListeners = [], this._progressListeners = [], this._progressiveReadListeners = [], this._progressiveDoneListeners = [], this._readyCapability = new _util.PromiseCapability();
            }
            addRangeListener(E) {
              this._rangeListeners.push(E);
            }
            addProgressListener(E) {
              this._progressListeners.push(E);
            }
            addProgressiveReadListener(E) {
              this._progressiveReadListeners.push(E);
            }
            addProgressiveDoneListener(E) {
              this._progressiveDoneListeners.push(E);
            }
            onDataRange(E, x) {
              for (const O of this._rangeListeners)
                O(E, x);
            }
            onDataProgress(E, x) {
              this._readyCapability.promise.then(() => {
                for (const O of this._progressListeners)
                  O(E, x);
              });
            }
            onDataProgressiveRead(E) {
              this._readyCapability.promise.then(() => {
                for (const x of this._progressiveReadListeners)
                  x(E);
              });
            }
            onDataProgressiveDone() {
              this._readyCapability.promise.then(() => {
                for (const E of this._progressiveDoneListeners)
                  E();
              });
            }
            transportReady() {
              this._readyCapability.resolve();
            }
            requestDataRange(E, x) {
              (0, _util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange");
            }
            abort() {
            }
          }
          exports.PDFDataRangeTransport = PDFDataRangeTransport;
          class PDFDocumentProxy {
            constructor(E, x) {
              this._pdfInfo = E, this._transport = x, Object.defineProperty(this, "getJavaScript", {
                value: () => ((0, _display_utils.deprecated)("`PDFDocumentProxy.getJavaScript`, please use `PDFDocumentProxy.getJSActions` instead."), this.getJSActions().then((O) => {
                  if (!O)
                    return O;
                  const P = [];
                  for (const I in O)
                    P.push(...O[I]);
                  return P;
                }))
              });
            }
            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, _util.shadow)(this, "isPureXfa", !!this._transport._htmlForXfa);
            }
            get allXfaHtml() {
              return this._transport._htmlForXfa;
            }
            getPage(E) {
              return this._transport.getPage(E);
            }
            getPageIndex(E) {
              return this._transport.getPageIndex(E);
            }
            getDestinations() {
              return this._transport.getDestinations();
            }
            getDestination(E) {
              return this._transport.getDestination(E);
            }
            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() {
              return this._transport.getOptionalContentConfig();
            }
            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(E = !1) {
              return this._transport.startCleanup(E || this.isPureXfa);
            }
            destroy() {
              return this.loadingTask.destroy();
            }
            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();
            }
          }
          exports.PDFDocumentProxy = PDFDocumentProxy;
          class PDFPageProxy {
            constructor(E, x, O, P = !1) {
              de(this, a);
              de(this, t, null);
              de(this, n, !1);
              this._pageIndex = E, this._pageInfo = x, this._transport = O, this._stats = P ? new _display_utils.StatTimer() : null, this._pdfBug = P, this.commonObjs = O.commonObjs, this.objs = new PDFObjects(), 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: E,
              rotation: x = this.rotate,
              offsetX: O = 0,
              offsetY: P = 0,
              dontFlip: I = !1
            } = {}) {
              return new _display_utils.PageViewport({
                viewBox: this.view,
                scale: E,
                rotation: x,
                offsetX: O,
                offsetY: P,
                dontFlip: I
              });
            }
            getAnnotations({
              intent: E = "display"
            } = {}) {
              const x = this._transport.getRenderingIntent(E);
              return this._transport.getAnnotations(this._pageIndex, x.renderingIntent);
            }
            getJSActions() {
              return this._transport.getPageJSActions(this._pageIndex);
            }
            get filterFactory() {
              return this._transport.filterFactory;
            }
            get isPureXfa() {
              return (0, _util.shadow)(this, "isPureXfa", !!this._transport._htmlForXfa);
            }
            async getXfa() {
              var E;
              return ((E = this._transport._htmlForXfa) == null ? void 0 : E.children[this._pageIndex]) || null;
            }
            render({
              canvasContext: E,
              viewport: x,
              intent: O = "display",
              annotationMode: P = _util.AnnotationMode.ENABLE,
              transform: I = null,
              background: G = null,
              optionalContentConfigPromise: ne = null,
              annotationCanvasMap: X = null,
              pageColors: ee = null,
              printAnnotationStorage: K = null
            }) {
              var v, L;
              (v = this._stats) == null || v.time("Overall");
              const se = this._transport.getRenderingIntent(O, P, K);
              fe(this, n, !1), te(this, a, Mt).call(this), ne || (ne = this._transport.getOptionalContentConfig());
              let q = this._intentStates.get(se.cacheKey);
              q || (q = /* @__PURE__ */ Object.create(null), this._intentStates.set(se.cacheKey, q)), q.streamReaderCancelTimeout && (clearTimeout(q.streamReaderCancelTimeout), q.streamReaderCancelTimeout = null);
              const Y = !!(se.renderingIntent & _util.RenderingIntentFlag.PRINT);
              q.displayReadyCapability || (q.displayReadyCapability = new _util.PromiseCapability(), q.operatorList = {
                fnArray: [],
                argsArray: [],
                lastChunk: !1,
                separateAnnots: null
              }, (L = this._stats) == null || L.time("Page Request"), this._pumpOperatorList(se));
              const J = (H) => {
                var B, U;
                q.renderTasks.delete(N), (this._maybeCleanupAfterRender || Y) && fe(this, n, !0), te(this, a, gt).call(this, !Y), H ? (N.capability.reject(H), this._abortOperatorList({
                  intentState: q,
                  reason: H instanceof Error ? H : new Error(H)
                })) : N.capability.resolve(), (B = this._stats) == null || B.timeEnd("Rendering"), (U = this._stats) == null || U.timeEnd("Overall");
              }, N = new InternalRenderTask({
                callback: J,
                params: {
                  canvasContext: E,
                  viewport: x,
                  transform: I,
                  background: G
                },
                objs: this.objs,
                commonObjs: this.commonObjs,
                annotationCanvasMap: X,
                operatorList: q.operatorList,
                pageIndex: this._pageIndex,
                canvasFactory: this._transport.canvasFactory,
                filterFactory: this._transport.filterFactory,
                useRequestAnimationFrame: !Y,
                pdfBug: this._pdfBug,
                pageColors: ee
              });
              (q.renderTasks || (q.renderTasks = /* @__PURE__ */ new Set())).add(N);
              const M = N.task;
              return Promise.all([q.displayReadyCapability.promise, ne]).then(([H, B]) => {
                var U;
                if (this.destroyed) {
                  J();
                  return;
                }
                (U = this._stats) == null || U.time("Rendering"), N.initializeGraphics({
                  transparency: H,
                  optionalContentConfig: B
                }), N.operatorListChanged();
              }).catch(J), M;
            }
            getOperatorList({
              intent: E = "display",
              annotationMode: x = _util.AnnotationMode.ENABLE,
              printAnnotationStorage: O = null
            } = {}) {
              var X;
              function P() {
                G.operatorList.lastChunk && (G.opListReadCapability.resolve(G.operatorList), G.renderTasks.delete(ne));
              }
              const I = this._transport.getRenderingIntent(E, x, O, !0);
              let G = this._intentStates.get(I.cacheKey);
              G || (G = /* @__PURE__ */ Object.create(null), this._intentStates.set(I.cacheKey, G));
              let ne;
              return G.opListReadCapability || (ne = /* @__PURE__ */ Object.create(null), ne.operatorListChanged = P, G.opListReadCapability = new _util.PromiseCapability(), (G.renderTasks || (G.renderTasks = /* @__PURE__ */ new Set())).add(ne), G.operatorList = {
                fnArray: [],
                argsArray: [],
                lastChunk: !1,
                separateAnnots: null
              }, (X = this._stats) == null || X.time("Page Request"), this._pumpOperatorList(I)), G.opListReadCapability.promise;
            }
            streamTextContent({
              includeMarkedContent: E = !1,
              disableNormalization: x = !1
            } = {}) {
              return this._transport.messageHandler.sendWithStream("GetTextContent", {
                pageIndex: this._pageIndex,
                includeMarkedContent: E === !0,
                disableNormalization: x === !0
              }, {
                highWaterMark: 100,
                size(P) {
                  return P.items.length;
                }
              });
            }
            getTextContent(E = {}) {
              if (this._transport._htmlForXfa)
                return this.getXfa().then((O) => _xfa_text.XfaText.textContent(O));
              const x = this.streamTextContent(E);
              return new Promise(function(O, P) {
                function I() {
                  G.read().then(function({
                    value: X,
                    done: ee
                  }) {
                    if (ee) {
                      O(ne);
                      return;
                    }
                    Object.assign(ne.styles, X.styles), ne.items.push(...X.items), I();
                  }, P);
                }
                const G = x.getReader(), ne = {
                  items: [],
                  styles: /* @__PURE__ */ Object.create(null)
                };
                I();
              });
            }
            getStructTree() {
              return this._transport.getStructTree(this._pageIndex);
            }
            _destroy() {
              this.destroyed = !0;
              const E = [];
              for (const x of this._intentStates.values())
                if (this._abortOperatorList({
                  intentState: x,
                  reason: new Error("Page was destroyed."),
                  force: !0
                }), !x.opListReadCapability)
                  for (const O of x.renderTasks)
                    E.push(O.completed), O.cancel();
              return this.objs.clear(), fe(this, n, !1), te(this, a, Mt).call(this), Promise.all(E);
            }
            cleanup(E = !1) {
              fe(this, n, !0);
              const x = te(this, a, gt).call(this, !1);
              return E && x && this._stats && (this._stats = new _display_utils.StatTimer()), x;
            }
            _startRenderPage(E, x) {
              var P, I;
              const O = this._intentStates.get(x);
              O && ((P = this._stats) == null || P.timeEnd("Page Request"), (I = O.displayReadyCapability) == null || I.resolve(E));
            }
            _renderPageChunk(E, x) {
              for (let O = 0, P = E.length; O < P; O++)
                x.operatorList.fnArray.push(E.fnArray[O]), x.operatorList.argsArray.push(E.argsArray[O]);
              x.operatorList.lastChunk = E.lastChunk, x.operatorList.separateAnnots = E.separateAnnots;
              for (const O of x.renderTasks)
                O.operatorListChanged();
              E.lastChunk && te(this, a, gt).call(this, !0);
            }
            _pumpOperatorList({
              renderingIntent: E,
              cacheKey: x,
              annotationStorageSerializable: O
            }) {
              const {
                map: P,
                transfers: I
              } = O, ne = this._transport.messageHandler.sendWithStream("GetOperatorList", {
                pageIndex: this._pageIndex,
                intent: E,
                cacheKey: x,
                annotationStorage: P
              }, I).getReader(), X = this._intentStates.get(x);
              X.streamReader = ne;
              const ee = () => {
                ne.read().then(({
                  value: K,
                  done: se
                }) => {
                  if (se) {
                    X.streamReader = null;
                    return;
                  }
                  this._transport.destroyed || (this._renderPageChunk(K, X), ee());
                }, (K) => {
                  if (X.streamReader = null, !this._transport.destroyed) {
                    if (X.operatorList) {
                      X.operatorList.lastChunk = !0;
                      for (const se of X.renderTasks)
                        se.operatorListChanged();
                      te(this, a, gt).call(this, !0);
                    }
                    if (X.displayReadyCapability)
                      X.displayReadyCapability.reject(K);
                    else if (X.opListReadCapability)
                      X.opListReadCapability.reject(K);
                    else
                      throw K;
                  }
                });
              };
              ee();
            }
            _abortOperatorList({
              intentState: E,
              reason: x,
              force: O = !1
            }) {
              if (E.streamReader) {
                if (E.streamReaderCancelTimeout && (clearTimeout(E.streamReaderCancelTimeout), E.streamReaderCancelTimeout = null), !O) {
                  if (E.renderTasks.size > 0)
                    return;
                  if (x instanceof _display_utils.RenderingCancelledException) {
                    let P = RENDERING_CANCELLED_TIMEOUT;
                    x.extraDelay > 0 && x.extraDelay < 1e3 && (P += x.extraDelay), E.streamReaderCancelTimeout = setTimeout(() => {
                      E.streamReaderCancelTimeout = null, this._abortOperatorList({
                        intentState: E,
                        reason: x,
                        force: !0
                      });
                    }, P);
                    return;
                  }
                }
                if (E.streamReader.cancel(new _util.AbortException(x.message)).catch(() => {
                }), E.streamReader = null, !this._transport.destroyed) {
                  for (const [P, I] of this._intentStates)
                    if (I === E) {
                      this._intentStates.delete(P);
                      break;
                    }
                  this.cleanup();
                }
              }
            }
            get stats() {
              return this._stats;
            }
          }
          t = new WeakMap(), n = new WeakMap(), a = new WeakSet(), gt = function(E = !1) {
            if (te(this, a, Mt).call(this), !p(this, n) || this.destroyed)
              return !1;
            if (E)
              return fe(this, t, setTimeout(() => {
                fe(this, t, null), te(this, a, gt).call(this, !1);
              }, DELAYED_CLEANUP_TIMEOUT)), !1;
            for (const {
              renderTasks: x,
              operatorList: O
            } of this._intentStates.values())
              if (x.size > 0 || !O.lastChunk)
                return !1;
            return this._intentStates.clear(), this.objs.clear(), fe(this, n, !1), !0;
          }, Mt = function() {
            p(this, t) && (clearTimeout(p(this, t)), fe(this, t, null));
          }, exports.PDFPageProxy = PDFPageProxy;
          class LoopbackPort {
            constructor() {
              de(this, c, /* @__PURE__ */ new Set());
              de(this, l, Promise.resolve());
            }
            postMessage(E, x) {
              const O = {
                data: structuredClone(E, x ? {
                  transfer: x
                } : null)
              };
              p(this, l).then(() => {
                for (const P of p(this, c))
                  P.call(this, O);
              });
            }
            addEventListener(E, x) {
              p(this, c).add(x);
            }
            removeEventListener(E, x) {
              p(this, c).delete(x);
            }
            terminate() {
              p(this, c).clear();
            }
          }
          c = new WeakMap(), l = new WeakMap(), exports.LoopbackPort = LoopbackPort;
          const PDFWorkerUtil = {
            isWorkerDisabled: !1,
            fallbackWorkerSrc: null,
            fakeWorkerId: 0
          };
          exports.PDFWorkerUtil = PDFWorkerUtil;
          {
            if (_util.isNodeJS && typeof commonjsRequire == "function")
              PDFWorkerUtil.isWorkerDisabled = !0, PDFWorkerUtil.fallbackWorkerSrc = "./pdf.worker.js";
            else if (typeof document == "object") {
              const y = (u = document == null ? void 0 : document.currentScript) == null ? void 0 : u.src;
              y && (PDFWorkerUtil.fallbackWorkerSrc = y.replace(/(\.(?:min\.)?js)(\?.*)?$/i, ".worker$1$2"));
            }
            PDFWorkerUtil.isSameOrigin = function(y, E) {
              let x;
              try {
                if (x = new URL(y), !x.origin || x.origin === "null")
                  return !1;
              } catch {
                return !1;
              }
              const O = new URL(E, x);
              return x.origin === O.origin;
            }, PDFWorkerUtil.createCDNWrapper = function(y) {
              const E = `importScripts("${y}");`;
              return URL.createObjectURL(new Blob([E]));
            };
          }
          const _PDFWorker = class _PDFWorker {
            constructor({
              name: y = null,
              port: E = null,
              verbosity: x = (0, _util.getVerbosityLevel)()
            } = {}) {
              var O;
              if (this.name = y, this.destroyed = !1, this.verbosity = x, this._readyCapability = new _util.PromiseCapability(), this._port = null, this._webWorker = null, this._messageHandler = null, E) {
                if ((O = p(_PDFWorker, h)) != null && O.has(E))
                  throw new Error("Cannot use more than one PDFWorker per port.");
                (p(_PDFWorker, h) || fe(_PDFWorker, h, /* @__PURE__ */ new WeakMap())).set(E, this), this._initializeFromPort(E);
                return;
              }
              this._initialize();
            }
            get promise() {
              return this._readyCapability.promise;
            }
            get port() {
              return this._port;
            }
            get messageHandler() {
              return this._messageHandler;
            }
            _initializeFromPort(y) {
              this._port = y, this._messageHandler = new _message_handler.MessageHandler("main", "worker", y), this._messageHandler.on("ready", function() {
              }), this._readyCapability.resolve(), this._messageHandler.send("configure", {
                verbosity: this.verbosity
              });
            }
            _initialize() {
              if (!PDFWorkerUtil.isWorkerDisabled && !_PDFWorker._mainThreadWorkerMessageHandler) {
                let {
                  workerSrc: y
                } = _PDFWorker;
                try {
                  PDFWorkerUtil.isSameOrigin(window.location.href, y) || (y = PDFWorkerUtil.createCDNWrapper(new URL(y, window.location).href));
                  const E = new Worker(y), x = new _message_handler.MessageHandler("main", "worker", E), O = () => {
                    E.removeEventListener("error", P), x.destroy(), E.terminate(), this.destroyed ? this._readyCapability.reject(new Error("Worker was destroyed")) : this._setupFakeWorker();
                  }, P = () => {
                    this._webWorker || O();
                  };
                  E.addEventListener("error", P), x.on("test", (G) => {
                    if (E.removeEventListener("error", P), this.destroyed) {
                      O();
                      return;
                    }
                    G ? (this._messageHandler = x, this._port = E, this._webWorker = E, this._readyCapability.resolve(), x.send("configure", {
                      verbosity: this.verbosity
                    })) : (this._setupFakeWorker(), x.destroy(), E.terminate());
                  }), x.on("ready", (G) => {
                    if (E.removeEventListener("error", P), this.destroyed) {
                      O();
                      return;
                    }
                    try {
                      I();
                    } catch {
                      this._setupFakeWorker();
                    }
                  });
                  const I = () => {
                    const G = new Uint8Array();
                    x.send("test", G, [G.buffer]);
                  };
                  I();
                  return;
                } catch {
                  (0, _util.info)("The worker has been disabled.");
                }
              }
              this._setupFakeWorker();
            }
            _setupFakeWorker() {
              PDFWorkerUtil.isWorkerDisabled || ((0, _util.warn)("Setting up fake worker."), PDFWorkerUtil.isWorkerDisabled = !0), _PDFWorker._setupFakeWorkerGlobal.then((y) => {
                if (this.destroyed) {
                  this._readyCapability.reject(new Error("Worker was destroyed"));
                  return;
                }
                const E = new LoopbackPort();
                this._port = E;
                const x = `fake${PDFWorkerUtil.fakeWorkerId++}`, O = new _message_handler.MessageHandler(x + "_worker", x, E);
                y.setup(O, E);
                const P = new _message_handler.MessageHandler(x, x + "_worker", E);
                this._messageHandler = P, this._readyCapability.resolve(), P.send("configure", {
                  verbosity: this.verbosity
                });
              }).catch((y) => {
                this._readyCapability.reject(new Error(`Setting up fake worker failed: "${y.message}".`));
              });
            }
            destroy() {
              var y;
              this.destroyed = !0, this._webWorker && (this._webWorker.terminate(), this._webWorker = null), (y = p(_PDFWorker, h)) == null || y.delete(this._port), this._port = null, this._messageHandler && (this._messageHandler.destroy(), this._messageHandler = null);
            }
            static fromPort(y) {
              var x;
              if (!(y != null && y.port))
                throw new Error("PDFWorker.fromPort - invalid method signature.");
              const E = (x = p(this, h)) == null ? void 0 : x.get(y.port);
              if (E) {
                if (E._pendingDestroy)
                  throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");
                return E;
              }
              return new _PDFWorker(y);
            }
            static get workerSrc() {
              if (_worker_options.GlobalWorkerOptions.workerSrc)
                return _worker_options.GlobalWorkerOptions.workerSrc;
              if (PDFWorkerUtil.fallbackWorkerSrc !== null)
                return _util.isNodeJS || (0, _display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'), PDFWorkerUtil.fallbackWorkerSrc;
              throw new Error('No "GlobalWorkerOptions.workerSrc" specified.');
            }
            static get _mainThreadWorkerMessageHandler() {
              var y;
              try {
                return ((y = globalThis.pdfjsWorker) == null ? void 0 : y.WorkerMessageHandler) || null;
              } catch {
                return null;
              }
            }
            static get _setupFakeWorkerGlobal() {
              const loader = async () => {
                const mainWorkerMessageHandler = this._mainThreadWorkerMessageHandler;
                if (mainWorkerMessageHandler)
                  return mainWorkerMessageHandler;
                if (_util.isNodeJS && typeof commonjsRequire == "function") {
                  const worker = eval("require")(this.workerSrc);
                  return worker.WorkerMessageHandler;
                }
                return await (0, _display_utils.loadScript)(this.workerSrc), window.pdfjsWorker.WorkerMessageHandler;
              };
              return (0, _util.shadow)(this, "_setupFakeWorkerGlobal", loader());
            }
          };
          h = new WeakMap(), de(_PDFWorker, h);
          let PDFWorker = _PDFWorker;
          exports.PDFWorker = PDFWorker;
          class WorkerTransport {
            constructor(E, x, O, P, I) {
              de(this, R);
              de(this, d, /* @__PURE__ */ new Map());
              de(this, w, /* @__PURE__ */ new Map());
              de(this, b, /* @__PURE__ */ new Map());
              de(this, _, null);
              this.messageHandler = E, this.loadingTask = x, this.commonObjs = new PDFObjects(), this.fontLoader = new _font_loader.FontLoader({
                ownerDocument: P.ownerDocument,
                styleElement: P.styleElement
              }), this._params = P, this.canvasFactory = I.canvasFactory, this.filterFactory = I.filterFactory, this.cMapReaderFactory = I.cMapReaderFactory, this.standardFontDataFactory = I.standardFontDataFactory, this.destroyed = !1, this.destroyCapability = null, this._networkStream = O, this._fullReader = null, this._lastProgress = null, this.downloadInfoCapability = new _util.PromiseCapability(), this.setupMessageHandler();
            }
            get annotationStorage() {
              return (0, _util.shadow)(this, "annotationStorage", new _annotation_storage.AnnotationStorage());
            }
            getRenderingIntent(E, x = _util.AnnotationMode.ENABLE, O = null, P = !1) {
              let I = _util.RenderingIntentFlag.DISPLAY, G = _annotation_storage.SerializableEmpty;
              switch (E) {
                case "any":
                  I = _util.RenderingIntentFlag.ANY;
                  break;
                case "display":
                  break;
                case "print":
                  I = _util.RenderingIntentFlag.PRINT;
                  break;
                default:
                  (0, _util.warn)(`getRenderingIntent - invalid intent: ${E}`);
              }
              switch (x) {
                case _util.AnnotationMode.DISABLE:
                  I += _util.RenderingIntentFlag.ANNOTATIONS_DISABLE;
                  break;
                case _util.AnnotationMode.ENABLE:
                  break;
                case _util.AnnotationMode.ENABLE_FORMS:
                  I += _util.RenderingIntentFlag.ANNOTATIONS_FORMS;
                  break;
                case _util.AnnotationMode.ENABLE_STORAGE:
                  I += _util.RenderingIntentFlag.ANNOTATIONS_STORAGE, G = (I & _util.RenderingIntentFlag.PRINT && O instanceof _annotation_storage.PrintAnnotationStorage ? O : this.annotationStorage).serializable;
                  break;
                default:
                  (0, _util.warn)(`getRenderingIntent - invalid annotationMode: ${x}`);
              }
              return P && (I += _util.RenderingIntentFlag.OPLIST), {
                renderingIntent: I,
                cacheKey: `${I}_${G.hash}`,
                annotationStorageSerializable: G
              };
            }
            destroy() {
              var O;
              if (this.destroyCapability)
                return this.destroyCapability.promise;
              this.destroyed = !0, this.destroyCapability = new _util.PromiseCapability(), (O = p(this, _)) == null || O.reject(new Error("Worker was destroyed during onPassword callback"));
              const E = [];
              for (const P of p(this, w).values())
                E.push(P._destroy());
              p(this, w).clear(), p(this, b).clear(), this.hasOwnProperty("annotationStorage") && this.annotationStorage.resetModified();
              const x = this.messageHandler.sendWithPromise("Terminate", null);
              return E.push(x), Promise.all(E).then(() => {
                var P;
                this.commonObjs.clear(), this.fontLoader.clear(), p(this, d).clear(), this.filterFactory.destroy(), (P = this._networkStream) == null || P.cancelAllRequests(new _util.AbortException("Worker was terminated.")), this.messageHandler && (this.messageHandler.destroy(), this.messageHandler = null), this.destroyCapability.resolve();
              }, this.destroyCapability.reject), this.destroyCapability.promise;
            }
            setupMessageHandler() {
              const {
                messageHandler: E,
                loadingTask: x
              } = this;
              E.on("GetReader", (O, P) => {
                (0, _util.assert)(this._networkStream, "GetReader - no `IPDFStream` instance available."), this._fullReader = this._networkStream.getFullReader(), this._fullReader.onProgress = (I) => {
                  this._lastProgress = {
                    loaded: I.loaded,
                    total: I.total
                  };
                }, P.onPull = () => {
                  this._fullReader.read().then(function({
                    value: I,
                    done: G
                  }) {
                    if (G) {
                      P.close();
                      return;
                    }
                    (0, _util.assert)(I instanceof ArrayBuffer, "GetReader - expected an ArrayBuffer."), P.enqueue(new Uint8Array(I), 1, [I]);
                  }).catch((I) => {
                    P.error(I);
                  });
                }, P.onCancel = (I) => {
                  this._fullReader.cancel(I), P.ready.catch((G) => {
                    if (!this.destroyed)
                      throw G;
                  });
                };
              }), E.on("ReaderHeadersReady", (O) => {
                const P = new _util.PromiseCapability(), I = this._fullReader;
                return I.headersReady.then(() => {
                  var G;
                  (!I.isStreamingSupported || !I.isRangeSupported) && (this._lastProgress && ((G = x.onProgress) == null || G.call(x, this._lastProgress)), I.onProgress = (ne) => {
                    var X;
                    (X = x.onProgress) == null || X.call(x, {
                      loaded: ne.loaded,
                      total: ne.total
                    });
                  }), P.resolve({
                    isStreamingSupported: I.isStreamingSupported,
                    isRangeSupported: I.isRangeSupported,
                    contentLength: I.contentLength
                  });
                }, P.reject), P.promise;
              }), E.on("GetRangeReader", (O, P) => {
                (0, _util.assert)(this._networkStream, "GetRangeReader - no `IPDFStream` instance available.");
                const I = this._networkStream.getRangeReader(O.begin, O.end);
                if (!I) {
                  P.close();
                  return;
                }
                P.onPull = () => {
                  I.read().then(function({
                    value: G,
                    done: ne
                  }) {
                    if (ne) {
                      P.close();
                      return;
                    }
                    (0, _util.assert)(G instanceof ArrayBuffer, "GetRangeReader - expected an ArrayBuffer."), P.enqueue(new Uint8Array(G), 1, [G]);
                  }).catch((G) => {
                    P.error(G);
                  });
                }, P.onCancel = (G) => {
                  I.cancel(G), P.ready.catch((ne) => {
                    if (!this.destroyed)
                      throw ne;
                  });
                };
              }), E.on("GetDoc", ({
                pdfInfo: O
              }) => {
                this._numPages = O.numPages, this._htmlForXfa = O.htmlForXfa, delete O.htmlForXfa, x._capability.resolve(new PDFDocumentProxy(O, this));
              }), E.on("DocException", function(O) {
                let P;
                switch (O.name) {
                  case "PasswordException":
                    P = new _util.PasswordException(O.message, O.code);
                    break;
                  case "InvalidPDFException":
                    P = new _util.InvalidPDFException(O.message);
                    break;
                  case "MissingPDFException":
                    P = new _util.MissingPDFException(O.message);
                    break;
                  case "UnexpectedResponseException":
                    P = new _util.UnexpectedResponseException(O.message, O.status);
                    break;
                  case "UnknownErrorException":
                    P = new _util.UnknownErrorException(O.message, O.details);
                    break;
                  default:
                    (0, _util.unreachable)("DocException - expected a valid Error.");
                }
                x._capability.reject(P);
              }), E.on("PasswordRequest", (O) => {
                if (fe(this, _, new _util.PromiseCapability()), x.onPassword) {
                  const P = (I) => {
                    I instanceof Error ? p(this, _).reject(I) : p(this, _).resolve({
                      password: I
                    });
                  };
                  try {
                    x.onPassword(P, O.code);
                  } catch (I) {
                    p(this, _).reject(I);
                  }
                } else
                  p(this, _).reject(new _util.PasswordException(O.message, O.code));
                return p(this, _).promise;
              }), E.on("DataLoaded", (O) => {
                var P;
                (P = x.onProgress) == null || P.call(x, {
                  loaded: O.length,
                  total: O.length
                }), this.downloadInfoCapability.resolve(O);
              }), E.on("StartRenderPage", (O) => {
                if (this.destroyed)
                  return;
                p(this, w).get(O.pageIndex)._startRenderPage(O.transparency, O.cacheKey);
              }), E.on("commonobj", ([O, P, I]) => {
                var G;
                if (!this.destroyed && !this.commonObjs.has(O))
                  switch (P) {
                    case "Font":
                      const ne = this._params;
                      if ("error" in I) {
                        const K = I.error;
                        (0, _util.warn)(`Error during font loading: ${K}`), this.commonObjs.resolve(O, K);
                        break;
                      }
                      const X = ne.pdfBug && ((G = globalThis.FontInspector) != null && G.enabled) ? (K, se) => globalThis.FontInspector.fontAdded(K, se) : null, ee = new _font_loader.FontFaceObject(I, {
                        isEvalSupported: ne.isEvalSupported,
                        disableFontFace: ne.disableFontFace,
                        ignoreErrors: ne.ignoreErrors,
                        inspectFont: X
                      });
                      this.fontLoader.bind(ee).catch((K) => E.sendWithPromise("FontFallback", {
                        id: O
                      })).finally(() => {
                        !ne.fontExtraProperties && ee.data && (ee.data = null), this.commonObjs.resolve(O, ee);
                      });
                      break;
                    case "FontPath":
                    case "Image":
                    case "Pattern":
                      this.commonObjs.resolve(O, I);
                      break;
                    default:
                      throw new Error(`Got unknown common object type ${P}`);
                  }
              }), E.on("obj", ([O, P, I, G]) => {
                var X;
                if (this.destroyed)
                  return;
                const ne = p(this, w).get(P);
                if (!ne.objs.has(O))
                  switch (I) {
                    case "Image":
                      if (ne.objs.resolve(O, G), G) {
                        let ee;
                        if (G.bitmap) {
                          const {
                            width: K,
                            height: se
                          } = G;
                          ee = K * se * 4;
                        } else
                          ee = ((X = G.data) == null ? void 0 : X.length) || 0;
                        ee > _util.MAX_IMAGE_SIZE_TO_CACHE && (ne._maybeCleanupAfterRender = !0);
                      }
                      break;
                    case "Pattern":
                      ne.objs.resolve(O, G);
                      break;
                    default:
                      throw new Error(`Got unknown object type ${I}`);
                  }
              }), E.on("DocProgress", (O) => {
                var P;
                this.destroyed || (P = x.onProgress) == null || P.call(x, {
                  loaded: O.loaded,
                  total: O.total
                });
              }), E.on("FetchBuiltInCMap", (O) => this.destroyed ? Promise.reject(new Error("Worker was destroyed.")) : this.cMapReaderFactory ? this.cMapReaderFactory.fetch(O) : Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))), E.on("FetchStandardFontData", (O) => this.destroyed ? Promise.reject(new Error("Worker was destroyed.")) : this.standardFontDataFactory ? this.standardFontDataFactory.fetch(O) : Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")));
            }
            getData() {
              return this.messageHandler.sendWithPromise("GetData", null);
            }
            saveDocument() {
              var O;
              this.annotationStorage.size <= 0 && (0, _util.warn)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");
              const {
                map: E,
                transfers: x
              } = this.annotationStorage.serializable;
              return this.messageHandler.sendWithPromise("SaveDocument", {
                isPureXfa: !!this._htmlForXfa,
                numPages: this._numPages,
                annotationStorage: E,
                filename: ((O = this._fullReader) == null ? void 0 : O.filename) ?? null
              }, x).finally(() => {
                this.annotationStorage.resetModified();
              });
            }
            getPage(E) {
              if (!Number.isInteger(E) || E <= 0 || E > this._numPages)
                return Promise.reject(new Error("Invalid page request."));
              const x = E - 1, O = p(this, b).get(x);
              if (O)
                return O;
              const P = this.messageHandler.sendWithPromise("GetPage", {
                pageIndex: x
              }).then((I) => {
                if (this.destroyed)
                  throw new Error("Transport destroyed");
                const G = new PDFPageProxy(x, I, this, this._params.pdfBug);
                return p(this, w).set(x, G), G;
              });
              return p(this, b).set(x, P), P;
            }
            getPageIndex(E) {
              return typeof E != "object" || E === null || !Number.isInteger(E.num) || E.num < 0 || !Number.isInteger(E.gen) || E.gen < 0 ? Promise.reject(new Error("Invalid pageIndex request.")) : this.messageHandler.sendWithPromise("GetPageIndex", {
                num: E.num,
                gen: E.gen
              });
            }
            getAnnotations(E, x) {
              return this.messageHandler.sendWithPromise("GetAnnotations", {
                pageIndex: E,
                intent: x
              });
            }
            getFieldObjects() {
              return te(this, R, Ft).call(this, "GetFieldObjects");
            }
            hasJSActions() {
              return te(this, R, Ft).call(this, "HasJSActions");
            }
            getCalculationOrderIds() {
              return this.messageHandler.sendWithPromise("GetCalculationOrderIds", null);
            }
            getDestinations() {
              return this.messageHandler.sendWithPromise("GetDestinations", null);
            }
            getDestination(E) {
              return typeof E != "string" ? Promise.reject(new Error("Invalid destination request.")) : this.messageHandler.sendWithPromise("GetDestination", {
                id: E
              });
            }
            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 te(this, R, Ft).call(this, "GetDocJSActions");
            }
            getPageJSActions(E) {
              return this.messageHandler.sendWithPromise("GetPageJSActions", {
                pageIndex: E
              });
            }
            getStructTree(E) {
              return this.messageHandler.sendWithPromise("GetStructTree", {
                pageIndex: E
              });
            }
            getOutline() {
              return this.messageHandler.sendWithPromise("GetOutline", null);
            }
            getOptionalContentConfig() {
              return this.messageHandler.sendWithPromise("GetOptionalContentConfig", null).then((E) => new _optional_content_config.OptionalContentConfig(E));
            }
            getPermissions() {
              return this.messageHandler.sendWithPromise("GetPermissions", null);
            }
            getMetadata() {
              const E = "GetMetadata", x = p(this, d).get(E);
              if (x)
                return x;
              const O = this.messageHandler.sendWithPromise(E, null).then((P) => {
                var I, G;
                return {
                  info: P[0],
                  metadata: P[1] ? new _metadata.Metadata(P[1]) : null,
                  contentDispositionFilename: ((I = this._fullReader) == null ? void 0 : I.filename) ?? null,
                  contentLength: ((G = this._fullReader) == null ? void 0 : G.contentLength) ?? null
                };
              });
              return p(this, d).set(E, O), O;
            }
            getMarkInfo() {
              return this.messageHandler.sendWithPromise("GetMarkInfo", null);
            }
            async startCleanup(E = !1) {
              if (!this.destroyed) {
                await this.messageHandler.sendWithPromise("Cleanup", null);
                for (const x of p(this, w).values())
                  if (!x.cleanup())
                    throw new Error(`startCleanup: Page ${x.pageNumber} is currently rendering.`);
                this.commonObjs.clear(), E || this.fontLoader.clear(), p(this, d).clear(), this.filterFactory.destroy(!0);
              }
            }
            get loadingParams() {
              const {
                disableAutoFetch: E,
                enableXfa: x
              } = this._params;
              return (0, _util.shadow)(this, "loadingParams", {
                disableAutoFetch: E,
                enableXfa: x
              });
            }
          }
          d = new WeakMap(), w = new WeakMap(), b = new WeakMap(), _ = new WeakMap(), R = new WeakSet(), Ft = function(E, x = null) {
            const O = p(this, d).get(E);
            if (O)
              return O;
            const P = this.messageHandler.sendWithPromise(E, x);
            return p(this, d).set(E, P), P;
          };
          class PDFObjects {
            constructor() {
              de(this, m);
              de(this, C, /* @__PURE__ */ Object.create(null));
            }
            get(E, x = null) {
              if (x) {
                const P = te(this, m, jt).call(this, E);
                return P.capability.promise.then(() => x(P.data)), null;
              }
              const O = p(this, C)[E];
              if (!(O != null && O.capability.settled))
                throw new Error(`Requesting object that isn't resolved yet ${E}.`);
              return O.data;
            }
            has(E) {
              const x = p(this, C)[E];
              return (x == null ? void 0 : x.capability.settled) || !1;
            }
            resolve(E, x = null) {
              const O = te(this, m, jt).call(this, E);
              O.data = x, O.capability.resolve();
            }
            clear() {
              var E;
              for (const x in p(this, C)) {
                const {
                  data: O
                } = p(this, C)[x];
                (E = O == null ? void 0 : O.bitmap) == null || E.close();
              }
              fe(this, C, /* @__PURE__ */ Object.create(null));
            }
          }
          C = new WeakMap(), m = new WeakSet(), jt = function(E) {
            var x;
            return (x = p(this, C))[E] || (x[E] = {
              capability: new _util.PromiseCapability(),
              data: null
            });
          };
          class RenderTask {
            constructor(E) {
              de(this, F, null);
              fe(this, F, E), this.onContinue = null;
            }
            get promise() {
              return p(this, F).capability.promise;
            }
            cancel(E = 0) {
              p(this, F).cancel(null, E);
            }
            get separateAnnots() {
              const {
                separateAnnots: E
              } = p(this, F).operatorList;
              if (!E)
                return !1;
              const {
                annotationCanvasMap: x
              } = p(this, F);
              return E.form || E.canvas && (x == null ? void 0 : x.size) > 0;
            }
          }
          F = new WeakMap(), exports.RenderTask = RenderTask;
          const g = class g {
            constructor({
              callback: E,
              params: x,
              objs: O,
              commonObjs: P,
              annotationCanvasMap: I,
              operatorList: G,
              pageIndex: ne,
              canvasFactory: X,
              filterFactory: ee,
              useRequestAnimationFrame: K = !1,
              pdfBug: se = !1,
              pageColors: q = null
            }) {
              this.callback = E, this.params = x, this.objs = O, this.commonObjs = P, this.annotationCanvasMap = I, this.operatorListIdx = null, this.operatorList = G, this._pageIndex = ne, this.canvasFactory = X, this.filterFactory = ee, this._pdfBug = se, this.pageColors = q, this.running = !1, this.graphicsReadyCallback = null, this.graphicsReady = !1, this._useRequestAnimationFrame = K === !0 && typeof window < "u", this.cancelled = !1, this.capability = new _util.PromiseCapability(), this.task = new RenderTask(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 = x.canvasContext.canvas;
            }
            get completed() {
              return this.capability.promise.catch(function() {
              });
            }
            initializeGraphics({
              transparency: E = !1,
              optionalContentConfig: x
            }) {
              var ne, X;
              if (this.cancelled)
                return;
              if (this._canvas) {
                if (p(g, f).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.");
                p(g, f).add(this._canvas);
              }
              this._pdfBug && ((ne = globalThis.StepperManager) != null && ne.enabled) && (this.stepper = globalThis.StepperManager.create(this._pageIndex), this.stepper.init(this.operatorList), this.stepper.nextBreakPoint = this.stepper.getNextBreakPoint());
              const {
                canvasContext: O,
                viewport: P,
                transform: I,
                background: G
              } = this.params;
              this.gfx = new _canvas.CanvasGraphics(O, this.commonObjs, this.objs, this.canvasFactory, this.filterFactory, {
                optionalContentConfig: x
              }, this.annotationCanvasMap, this.pageColors), this.gfx.beginDrawing({
                transform: I,
                viewport: P,
                transparency: E,
                background: G
              }), this.operatorListIdx = 0, this.graphicsReady = !0, (X = this.graphicsReadyCallback) == null || X.call(this);
            }
            cancel(E = null, x = 0) {
              var O;
              this.running = !1, this.cancelled = !0, (O = this.gfx) == null || O.endDrawing(), p(g, f).delete(this._canvas), this.callback(E || new _display_utils.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex + 1}`, x));
            }
            operatorListChanged() {
              var E;
              if (!this.graphicsReady) {
                this.graphicsReadyCallback || (this.graphicsReadyCallback = this._continueBound);
                return;
              }
              (E = this.stepper) == null || E.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(), p(g, f).delete(this._canvas), this.callback())));
            }
          };
          f = new WeakMap(), de(g, f, /* @__PURE__ */ new WeakSet());
          let InternalRenderTask = g;
          const version = "3.11.174";
          exports.version = version;
          const build = "ce8716743";
          exports.build = build;
        },
        /* 3 */
        /***/
        (r, e, t) => {
          var u, h, d, Fn, b;
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.SerializableEmpty = e.PrintAnnotationStorage = e.AnnotationStorage = void 0;
          var n = t(1), a = t(4), s = t(8);
          const o = Object.freeze({
            map: null,
            hash: "",
            transfers: void 0
          });
          e.SerializableEmpty = o;
          class c {
            constructor() {
              de(this, d);
              de(this, u, !1);
              de(this, h, /* @__PURE__ */ new Map());
              this.onSetModified = null, this.onResetModified = null, this.onAnnotationEditor = null;
            }
            getValue(R, k) {
              const C = p(this, h).get(R);
              return C === void 0 ? k : Object.assign(k, C);
            }
            getRawValue(R) {
              return p(this, h).get(R);
            }
            remove(R) {
              if (p(this, h).delete(R), p(this, h).size === 0 && this.resetModified(), typeof this.onAnnotationEditor == "function") {
                for (const k of p(this, h).values())
                  if (k instanceof a.AnnotationEditor)
                    return;
                this.onAnnotationEditor(null);
              }
            }
            setValue(R, k) {
              const C = p(this, h).get(R);
              let m = !1;
              if (C !== void 0)
                for (const [A, F] of Object.entries(k))
                  C[A] !== F && (m = !0, C[A] = F);
              else
                m = !0, p(this, h).set(R, k);
              m && te(this, d, Fn).call(this), k instanceof a.AnnotationEditor && typeof this.onAnnotationEditor == "function" && this.onAnnotationEditor(k.constructor._type);
            }
            has(R) {
              return p(this, h).has(R);
            }
            getAll() {
              return p(this, h).size > 0 ? (0, n.objectFromMap)(p(this, h)) : null;
            }
            setAll(R) {
              for (const [k, C] of Object.entries(R))
                this.setValue(k, C);
            }
            get size() {
              return p(this, h).size;
            }
            resetModified() {
              p(this, u) && (fe(this, u, !1), typeof this.onResetModified == "function" && this.onResetModified());
            }
            get print() {
              return new l(this);
            }
            get serializable() {
              if (p(this, h).size === 0)
                return o;
              const R = /* @__PURE__ */ new Map(), k = new s.MurmurHash3_64(), C = [], m = /* @__PURE__ */ Object.create(null);
              let A = !1;
              for (const [F, f] of p(this, h)) {
                const g = f instanceof a.AnnotationEditor ? f.serialize(!1, m) : f;
                g && (R.set(F, g), k.update(`${F}:${JSON.stringify(g)}`), A || (A = !!g.bitmap));
              }
              if (A)
                for (const F of R.values())
                  F.bitmap && C.push(F.bitmap);
              return R.size > 0 ? {
                map: R,
                hash: k.hexdigest(),
                transfers: C
              } : o;
            }
          }
          u = new WeakMap(), h = new WeakMap(), d = new WeakSet(), Fn = function() {
            p(this, u) || (fe(this, u, !0), typeof this.onSetModified == "function" && this.onSetModified());
          }, e.AnnotationStorage = c;
          class l extends c {
            constructor(k) {
              super();
              de(this, b);
              const {
                map: C,
                hash: m,
                transfers: A
              } = k.serializable, F = structuredClone(C, A ? {
                transfer: A
              } : null);
              fe(this, b, {
                map: F,
                hash: m,
                transfers: A
              });
            }
            get print() {
              (0, n.unreachable)("Should not call PrintAnnotationStorage.print");
            }
            get serializable() {
              return p(this, b);
            }
          }
          b = new WeakMap(), e.PrintAnnotationStorage = l;
        },
        /* 4 */
        /***/
        (r, e, t) => {
          var l, u, h, d, w, b, _, R, k, C, m, A, F, f, g, Vt, Xt, x, Yt, Kt, Pn, Rn, Ln, Zt, In;
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.AnnotationEditor = void 0;
          var n = t(5), a = t(1), s = t(6);
          const K = class K {
            constructor(q) {
              de(this, g);
              de(this, l, "");
              de(this, u, !1);
              de(this, h, null);
              de(this, d, null);
              de(this, w, null);
              de(this, b, !1);
              de(this, _, null);
              de(this, R, this.focusin.bind(this));
              de(this, k, this.focusout.bind(this));
              de(this, C, !1);
              de(this, m, !1);
              de(this, A, !1);
              Ke(this, "_initialOptions", /* @__PURE__ */ Object.create(null));
              Ke(this, "_uiManager", null);
              Ke(this, "_focusEventsAllowed", !0);
              Ke(this, "_l10nPromise", null);
              de(this, F, !1);
              de(this, f, K._zIndex++);
              this.constructor === K && (0, a.unreachable)("Cannot initialize AnnotationEditor."), this.parent = q.parent, this.id = q.id, this.width = this.height = null, this.pageIndex = q.parent.pageIndex, this.name = q.name, this.div = null, this._uiManager = q.uiManager, this.annotationElementId = null, this._willKeepAspectRatio = !1, this._initialOptions.isCentered = q.isCentered, this._structTreeParentId = null;
              const {
                rotation: Y,
                rawDims: {
                  pageWidth: J,
                  pageHeight: N,
                  pageX: M,
                  pageY: v
                }
              } = this.parent.viewport;
              this.rotation = Y, this.pageRotation = (360 + Y - this._uiManager.viewParameters.rotation) % 360, this.pageDimensions = [J, N], this.pageTranslation = [M, v];
              const [L, H] = this.parentDimensions;
              this.x = q.x / L, this.y = q.y / H, this.isAttachedToDOM = !1, this.deleted = !1;
            }
            get editorType() {
              return Object.getPrototypeOf(this).constructor._type;
            }
            static get _defaultLineColor() {
              return (0, a.shadow)(this, "_defaultLineColor", this._colorManager.getHexCode("CanvasText"));
            }
            static deleteAnnotationElement(q) {
              const Y = new c({
                id: q.parent.getNextId(),
                parent: q.parent,
                uiManager: q._uiManager
              });
              Y.annotationElementId = q.annotationElementId, Y.deleted = !0, Y._uiManager.addToAnnotationStorage(Y);
            }
            static initialize(q, Y = null) {
              if (K._l10nPromise || (K._l10nPromise = new Map(["editor_alt_text_button_label", "editor_alt_text_edit_button_label", "editor_alt_text_decorative_tooltip"].map((N) => [N, q.get(N)]))), Y != null && Y.strings)
                for (const N of Y.strings)
                  K._l10nPromise.set(N, q.get(N));
              if (K._borderLineWidth !== -1)
                return;
              const J = getComputedStyle(document.documentElement);
              K._borderLineWidth = parseFloat(J.getPropertyValue("--outline-width")) || 0;
            }
            static updateDefaultParams(q, Y) {
            }
            static get defaultPropertiesToUpdate() {
              return [];
            }
            static isHandlingMimeForPasting(q) {
              return !1;
            }
            static paste(q, Y) {
              (0, a.unreachable)("Not implemented");
            }
            get propertiesToUpdate() {
              return [];
            }
            get _isDraggable() {
              return p(this, F);
            }
            set _isDraggable(q) {
              var Y;
              fe(this, F, q), (Y = this.div) == null || Y.classList.toggle("draggable", q);
            }
            center() {
              const [q, Y] = this.pageDimensions;
              switch (this.parentRotation) {
                case 90:
                  this.x -= this.height * Y / (q * 2), this.y += this.width * q / (Y * 2);
                  break;
                case 180:
                  this.x += this.width / 2, this.y += this.height / 2;
                  break;
                case 270:
                  this.x += this.height * Y / (q * 2), this.y -= this.width * q / (Y * 2);
                  break;
                default:
                  this.x -= this.width / 2, this.y -= this.height / 2;
                  break;
              }
              this.fixAndSetPosition();
            }
            addCommands(q) {
              this._uiManager.addCommands(q);
            }
            get currentLayer() {
              return this._uiManager.currentLayer;
            }
            setInBackground() {
              this.div.style.zIndex = 0;
            }
            setInForeground() {
              this.div.style.zIndex = p(this, f);
            }
            setParent(q) {
              q !== null && (this.pageIndex = q.pageIndex, this.pageDimensions = q.pageDimensions), this.parent = q;
            }
            focusin(q) {
              this._focusEventsAllowed && (p(this, C) ? fe(this, C, !1) : this.parent.setSelected(this));
            }
            focusout(q) {
              var J;
              if (!this._focusEventsAllowed || !this.isAttachedToDOM)
                return;
              const Y = q.relatedTarget;
              Y != null && Y.closest(`#${this.id}`) || (q.preventDefault(), (J = this.parent) != null && J.isMultipleSelection || this.commitOrRemove());
            }
            commitOrRemove() {
              this.isEmpty() ? this.remove() : this.commit();
            }
            commit() {
              this.addToAnnotationStorage();
            }
            addToAnnotationStorage() {
              this._uiManager.addToAnnotationStorage(this);
            }
            setAt(q, Y, J, N) {
              const [M, v] = this.parentDimensions;
              [J, N] = this.screenToPageTranslation(J, N), this.x = (q + J) / M, this.y = (Y + N) / v, this.fixAndSetPosition();
            }
            translate(q, Y) {
              te(this, g, Vt).call(this, this.parentDimensions, q, Y);
            }
            translateInPage(q, Y) {
              te(this, g, Vt).call(this, this.pageDimensions, q, Y), this.div.scrollIntoView({
                block: "nearest"
              });
            }
            drag(q, Y) {
              const [J, N] = this.parentDimensions;
              if (this.x += q / J, this.y += Y / N, this.parent && (this.x < 0 || this.x > 1 || this.y < 0 || this.y > 1)) {
                const {
                  x: B,
                  y: U
                } = this.div.getBoundingClientRect();
                this.parent.findNewParent(this, B, U) && (this.x -= Math.floor(this.x), this.y -= Math.floor(this.y));
              }
              let {
                x: M,
                y: v
              } = this;
              const [L, H] = te(this, g, Xt).call(this);
              M += L, v += H, this.div.style.left = `${(100 * M).toFixed(2)}%`, this.div.style.top = `${(100 * v).toFixed(2)}%`, this.div.scrollIntoView({
                block: "nearest"
              });
            }
            fixAndSetPosition() {
              const [q, Y] = this.pageDimensions;
              let {
                x: J,
                y: N,
                width: M,
                height: v
              } = this;
              switch (M *= q, v *= Y, J *= q, N *= Y, this.rotation) {
                case 0:
                  J = Math.max(0, Math.min(q - M, J)), N = Math.max(0, Math.min(Y - v, N));
                  break;
                case 90:
                  J = Math.max(0, Math.min(q - v, J)), N = Math.min(Y, Math.max(M, N));
                  break;
                case 180:
                  J = Math.min(q, Math.max(M, J)), N = Math.min(Y, Math.max(v, N));
                  break;
                case 270:
                  J = Math.min(q, Math.max(v, J)), N = Math.max(0, Math.min(Y - M, N));
                  break;
              }
              this.x = J /= q, this.y = N /= Y;
              const [L, H] = te(this, g, Xt).call(this);
              J += L, N += H;
              const {
                style: B
              } = this.div;
              B.left = `${(100 * J).toFixed(2)}%`, B.top = `${(100 * N).toFixed(2)}%`, this.moveInDOM();
            }
            screenToPageTranslation(q, Y) {
              var J;
              return te(J = K, x, Yt).call(J, q, Y, this.parentRotation);
            }
            pageTranslationToScreen(q, Y) {
              var J;
              return te(J = K, x, Yt).call(J, q, Y, 360 - this.parentRotation);
            }
            get parentScale() {
              return this._uiManager.viewParameters.realScale;
            }
            get parentRotation() {
              return (this._uiManager.viewParameters.rotation + this.pageRotation) % 360;
            }
            get parentDimensions() {
              const {
                parentScale: q,
                pageDimensions: [Y, J]
              } = this, N = Y * q, M = J * q;
              return a.FeatureTest.isCSSRoundSupported ? [Math.round(N), Math.round(M)] : [N, M];
            }
            setDims(q, Y) {
              var M;
              const [J, N] = this.parentDimensions;
              this.div.style.width = `${(100 * q / J).toFixed(2)}%`, p(this, b) || (this.div.style.height = `${(100 * Y / N).toFixed(2)}%`), (M = p(this, h)) == null || M.classList.toggle("small", q < K.SMALL_EDITOR_SIZE || Y < K.SMALL_EDITOR_SIZE);
            }
            fixDims() {
              const {
                style: q
              } = this.div, {
                height: Y,
                width: J
              } = q, N = J.endsWith("%"), M = !p(this, b) && Y.endsWith("%");
              if (N && M)
                return;
              const [v, L] = this.parentDimensions;
              N || (q.width = `${(100 * parseFloat(J) / v).toFixed(2)}%`), !p(this, b) && !M && (q.height = `${(100 * parseFloat(Y) / L).toFixed(2)}%`);
            }
            getInitialTranslation() {
              return [0, 0];
            }
            async addAltTextButton() {
              if (p(this, h))
                return;
              const q = fe(this, h, document.createElement("button"));
              q.className = "altText";
              const Y = await K._l10nPromise.get("editor_alt_text_button_label");
              q.textContent = Y, q.setAttribute("aria-label", Y), q.tabIndex = "0", q.addEventListener("contextmenu", s.noContextMenu), q.addEventListener("pointerdown", (J) => J.stopPropagation()), q.addEventListener("click", (J) => {
                J.preventDefault(), this._uiManager.editAltText(this);
              }, {
                capture: !0
              }), q.addEventListener("keydown", (J) => {
                J.target === q && J.key === "Enter" && (J.preventDefault(), this._uiManager.editAltText(this));
              }), te(this, g, Zt).call(this), this.div.append(q), K.SMALL_EDITOR_SIZE || (K.SMALL_EDITOR_SIZE = Math.min(128, Math.round(q.getBoundingClientRect().width * 1.4)));
            }
            getClientDimensions() {
              return this.div.getBoundingClientRect();
            }
            get altTextData() {
              return {
                altText: p(this, l),
                decorative: p(this, u)
              };
            }
            set altTextData({
              altText: q,
              decorative: Y
            }) {
              p(this, l) === q && p(this, u) === Y || (fe(this, l, q), fe(this, u, Y), te(this, g, Zt).call(this));
            }
            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.setAttribute("tabIndex", 0), this.setInForeground(), this.div.addEventListener("focusin", p(this, R)), this.div.addEventListener("focusout", p(this, k));
              const [q, Y] = this.parentDimensions;
              this.parentRotation % 180 !== 0 && (this.div.style.maxWidth = `${(100 * Y / q).toFixed(2)}%`, this.div.style.maxHeight = `${(100 * q / Y).toFixed(2)}%`);
              const [J, N] = this.getInitialTranslation();
              return this.translate(J, N), (0, n.bindEvents)(this, this.div, ["pointerdown"]), this.div;
            }
            pointerdown(q) {
              const {
                isMac: Y
              } = a.FeatureTest.platform;
              if (q.button !== 0 || q.ctrlKey && Y) {
                q.preventDefault();
                return;
              }
              fe(this, C, !0), te(this, g, In).call(this, q);
            }
            moveInDOM() {
              var q;
              (q = this.parent) == null || q.moveEditorInDOM(this);
            }
            _setParentAndPosition(q, Y, J) {
              q.changeParent(this), this.x = Y, this.y = J, this.fixAndSetPosition();
            }
            getRect(q, Y) {
              const J = this.parentScale, [N, M] = this.pageDimensions, [v, L] = this.pageTranslation, H = q / J, B = Y / J, U = this.x * N, Z = this.y * M, re = this.width * N, pe = this.height * M;
              switch (this.rotation) {
                case 0:
                  return [U + H + v, M - Z - B - pe + L, U + H + re + v, M - Z - B + L];
                case 90:
                  return [U + B + v, M - Z + H + L, U + B + pe + v, M - Z + H + re + L];
                case 180:
                  return [U - H - re + v, M - Z + B + L, U - H + v, M - Z + B + pe + L];
                case 270:
                  return [U - B - pe + v, M - Z - H - re + L, U - B + v, M - Z - H + L];
                default:
                  throw new Error("Invalid rotation");
              }
            }
            getRectInCurrentCoords(q, Y) {
              const [J, N, M, v] = q, L = M - J, H = v - N;
              switch (this.rotation) {
                case 0:
                  return [J, Y - v, L, H];
                case 90:
                  return [J, Y - N, H, L];
                case 180:
                  return [M, Y - N, L, H];
                case 270:
                  return [M, Y - v, H, L];
                default:
                  throw new Error("Invalid rotation");
              }
            }
            onceAdded() {
            }
            isEmpty() {
              return !1;
            }
            enableEditMode() {
              fe(this, A, !0);
            }
            disableEditMode() {
              fe(this, A, !1);
            }
            isInEditMode() {
              return p(this, A);
            }
            shouldGetKeyboardEvents() {
              return !1;
            }
            needsToBeRebuilt() {
              return this.div && !this.isAttachedToDOM;
            }
            rebuild() {
              var q, Y;
              (q = this.div) == null || q.addEventListener("focusin", p(this, R)), (Y = this.div) == null || Y.addEventListener("focusout", p(this, k));
            }
            serialize(q = !1, Y = null) {
              (0, a.unreachable)("An editor must be serializable");
            }
            static deserialize(q, Y, J) {
              const N = new this.prototype.constructor({
                parent: Y,
                id: Y.getNextId(),
                uiManager: J
              });
              N.rotation = q.rotation;
              const [M, v] = N.pageDimensions, [L, H, B, U] = N.getRectInCurrentCoords(q.rect, v);
              return N.x = L / M, N.y = H / v, N.width = B / M, N.height = U / v, N;
            }
            remove() {
              var q;
              this.div.removeEventListener("focusin", p(this, R)), this.div.removeEventListener("focusout", p(this, k)), this.isEmpty() || this.commit(), this.parent ? this.parent.remove(this) : this._uiManager.removeEditor(this), (q = p(this, h)) == null || q.remove(), fe(this, h, null), fe(this, d, null);
            }
            get isResizable() {
              return !1;
            }
            makeResizable() {
              this.isResizable && (te(this, g, Pn).call(this), p(this, _).classList.remove("hidden"));
            }
            select() {
              var q;
              this.makeResizable(), (q = this.div) == null || q.classList.add("selectedEditor");
            }
            unselect() {
              var q, Y, J;
              (q = p(this, _)) == null || q.classList.add("hidden"), (Y = this.div) == null || Y.classList.remove("selectedEditor"), (J = this.div) != null && J.contains(document.activeElement) && this._uiManager.currentLayer.div.focus();
            }
            updateParams(q, Y) {
            }
            disableEditing() {
              p(this, h) && (p(this, h).hidden = !0);
            }
            enableEditing() {
              p(this, h) && (p(this, h).hidden = !1);
            }
            enterInEditMode() {
            }
            get contentDiv() {
              return this.div;
            }
            get isEditing() {
              return p(this, m);
            }
            set isEditing(q) {
              fe(this, m, q), this.parent && (q ? (this.parent.setSelected(this), this.parent.setActiveEditor(this)) : this.parent.setActiveEditor(null));
            }
            setAspectRatio(q, Y) {
              fe(this, b, !0);
              const J = q / Y, {
                style: N
              } = this.div;
              N.aspectRatio = J, N.height = "auto";
            }
            static get MIN_SIZE() {
              return 16;
            }
          };
          l = new WeakMap(), u = new WeakMap(), h = new WeakMap(), d = new WeakMap(), w = new WeakMap(), b = new WeakMap(), _ = new WeakMap(), R = new WeakMap(), k = new WeakMap(), C = new WeakMap(), m = new WeakMap(), A = new WeakMap(), F = new WeakMap(), f = new WeakMap(), g = new WeakSet(), Vt = function([q, Y], J, N) {
            [J, N] = this.screenToPageTranslation(J, N), this.x += J / q, this.y += N / Y, this.fixAndSetPosition();
          }, Xt = function() {
            const [q, Y] = this.parentDimensions, {
              _borderLineWidth: J
            } = K, N = J / q, M = J / Y;
            switch (this.rotation) {
              case 90:
                return [-N, M];
              case 180:
                return [N, M];
              case 270:
                return [N, -M];
              default:
                return [-N, -M];
            }
          }, x = new WeakSet(), Yt = function(q, Y, J) {
            switch (J) {
              case 90:
                return [Y, -q];
              case 180:
                return [-q, -Y];
              case 270:
                return [-Y, q];
              default:
                return [q, Y];
            }
          }, Kt = function(q) {
            switch (q) {
              case 90: {
                const [Y, J] = this.pageDimensions;
                return [0, -Y / J, J / Y, 0];
              }
              case 180:
                return [-1, 0, 0, -1];
              case 270: {
                const [Y, J] = this.pageDimensions;
                return [0, Y / J, -J / Y, 0];
              }
              default:
                return [1, 0, 0, 1];
            }
          }, Pn = function() {
            if (p(this, _))
              return;
            fe(this, _, document.createElement("div")), p(this, _).classList.add("resizers");
            const q = ["topLeft", "topRight", "bottomRight", "bottomLeft"];
            this._willKeepAspectRatio || q.push("topMiddle", "middleRight", "bottomMiddle", "middleLeft");
            for (const Y of q) {
              const J = document.createElement("div");
              p(this, _).append(J), J.classList.add("resizer", Y), J.addEventListener("pointerdown", te(this, g, Rn).bind(this, Y)), J.addEventListener("contextmenu", s.noContextMenu);
            }
            this.div.prepend(p(this, _));
          }, Rn = function(q, Y) {
            Y.preventDefault();
            const {
              isMac: J
            } = a.FeatureTest.platform;
            if (Y.button !== 0 || Y.ctrlKey && J)
              return;
            const N = te(this, g, Ln).bind(this, q), M = this._isDraggable;
            this._isDraggable = !1;
            const v = {
              passive: !0,
              capture: !0
            };
            window.addEventListener("pointermove", N, v);
            const L = this.x, H = this.y, B = this.width, U = this.height, Z = this.parent.div.style.cursor, re = this.div.style.cursor;
            this.div.style.cursor = this.parent.div.style.cursor = window.getComputedStyle(Y.target).cursor;
            const pe = () => {
              this._isDraggable = M, window.removeEventListener("pointerup", pe), window.removeEventListener("blur", pe), window.removeEventListener("pointermove", N, v), this.parent.div.style.cursor = Z, this.div.style.cursor = re;
              const be = this.x, Se = this.y, _e = this.width, we = this.height;
              be === L && Se === H && _e === B && we === U || this.addCommands({
                cmd: () => {
                  this.width = _e, this.height = we, this.x = be, this.y = Se;
                  const [oe, le] = this.parentDimensions;
                  this.setDims(oe * _e, le * we), this.fixAndSetPosition();
                },
                undo: () => {
                  this.width = B, this.height = U, this.x = L, this.y = H;
                  const [oe, le] = this.parentDimensions;
                  this.setDims(oe * B, le * U), this.fixAndSetPosition();
                },
                mustExec: !0
              });
            };
            window.addEventListener("pointerup", pe), window.addEventListener("blur", pe);
          }, Ln = function(q, Y) {
            const [J, N] = this.parentDimensions, M = this.x, v = this.y, L = this.width, H = this.height, B = K.MIN_SIZE / J, U = K.MIN_SIZE / N, Z = ($e) => Math.round($e * 1e4) / 1e4, re = te(this, g, Kt).call(this, this.rotation), pe = ($e, Ge) => [re[0] * $e + re[2] * Ge, re[1] * $e + re[3] * Ge], be = te(this, g, Kt).call(this, 360 - this.rotation), Se = ($e, Ge) => [be[0] * $e + be[2] * Ge, be[1] * $e + be[3] * Ge];
            let _e, we, oe = !1, le = !1;
            switch (q) {
              case "topLeft":
                oe = !0, _e = ($e, Ge) => [0, 0], we = ($e, Ge) => [$e, Ge];
                break;
              case "topMiddle":
                _e = ($e, Ge) => [$e / 2, 0], we = ($e, Ge) => [$e / 2, Ge];
                break;
              case "topRight":
                oe = !0, _e = ($e, Ge) => [$e, 0], we = ($e, Ge) => [0, Ge];
                break;
              case "middleRight":
                le = !0, _e = ($e, Ge) => [$e, Ge / 2], we = ($e, Ge) => [0, Ge / 2];
                break;
              case "bottomRight":
                oe = !0, _e = ($e, Ge) => [$e, Ge], we = ($e, Ge) => [0, 0];
                break;
              case "bottomMiddle":
                _e = ($e, Ge) => [$e / 2, Ge], we = ($e, Ge) => [$e / 2, 0];
                break;
              case "bottomLeft":
                oe = !0, _e = ($e, Ge) => [0, Ge], we = ($e, Ge) => [$e, 0];
                break;
              case "middleLeft":
                le = !0, _e = ($e, Ge) => [0, Ge / 2], we = ($e, Ge) => [$e, Ge / 2];
                break;
            }
            const $ = _e(L, H), j = we(L, H);
            let ae = pe(...j);
            const ue = Z(M + ae[0]), Ae = Z(v + ae[1]);
            let Te = 1, ke = 1, [ie, Fe] = this.screenToPageTranslation(Y.movementX, Y.movementY);
            if ([ie, Fe] = Se(ie / J, Fe / N), oe) {
              const $e = Math.hypot(L, H);
              Te = ke = Math.max(Math.min(Math.hypot(j[0] - $[0] - ie, j[1] - $[1] - Fe) / $e, 1 / L, 1 / H), B / L, U / H);
            } else le ? Te = Math.max(B, Math.min(1, Math.abs(j[0] - $[0] - ie))) / L : ke = Math.max(U, Math.min(1, Math.abs(j[1] - $[1] - Fe))) / H;
            const De = Z(L * Te), Xe = Z(H * ke);
            ae = pe(...we(De, Xe));
            const je = ue - ae[0], tt = Ae - ae[1];
            this.width = De, this.height = Xe, this.x = je, this.y = tt, this.setDims(J * De, N * Xe), this.fixAndSetPosition();
          }, Zt = async function() {
            var J;
            const q = p(this, h);
            if (!q)
              return;
            if (!p(this, l) && !p(this, u)) {
              q.classList.remove("done"), (J = p(this, d)) == null || J.remove();
              return;
            }
            K._l10nPromise.get("editor_alt_text_edit_button_label").then((N) => {
              q.setAttribute("aria-label", N);
            });
            let Y = p(this, d);
            if (!Y) {
              fe(this, d, Y = document.createElement("span")), Y.className = "tooltip", Y.setAttribute("role", "tooltip");
              const N = Y.id = `alt-text-tooltip-${this.id}`;
              q.setAttribute("aria-describedby", N);
              const M = 100;
              q.addEventListener("mouseenter", () => {
                fe(this, w, setTimeout(() => {
                  fe(this, w, null), p(this, d).classList.add("show"), this._uiManager._eventBus.dispatch("reporttelemetry", {
                    source: this,
                    details: {
                      type: "editing",
                      subtype: this.editorType,
                      data: {
                        action: "alt_text_tooltip"
                      }
                    }
                  });
                }, M));
              }), q.addEventListener("mouseleave", () => {
                var v;
                clearTimeout(p(this, w)), fe(this, w, null), (v = p(this, d)) == null || v.classList.remove("show");
              });
            }
            q.classList.add("done"), Y.innerText = p(this, u) ? await K._l10nPromise.get("editor_alt_text_decorative_tooltip") : p(this, l), Y.parentNode || q.append(Y);
          }, In = function(q) {
            if (!this._isDraggable)
              return;
            const Y = this._uiManager.isSelected(this);
            this._uiManager.setUpDragSession();
            let J, N;
            Y && (J = {
              passive: !0,
              capture: !0
            }, N = (v) => {
              const [L, H] = this.screenToPageTranslation(v.movementX, v.movementY);
              this._uiManager.dragSelectedEditors(L, H);
            }, window.addEventListener("pointermove", N, J));
            const M = () => {
              if (window.removeEventListener("pointerup", M), window.removeEventListener("blur", M), Y && window.removeEventListener("pointermove", N, J), fe(this, C, !1), !this._uiManager.endDragSession()) {
                const {
                  isMac: v
                } = a.FeatureTest.platform;
                q.ctrlKey && !v || q.shiftKey || q.metaKey && v ? this.parent.toggleSelected(this) : this.parent.setSelected(this);
              }
            };
            window.addEventListener("pointerup", M), window.addEventListener("blur", M);
          }, de(K, x), Ke(K, "_borderLineWidth", -1), Ke(K, "_colorManager", new n.ColorManager()), Ke(K, "_zIndex", 1), Ke(K, "SMALL_EDITOR_SIZE", 0);
          let o = K;
          e.AnnotationEditor = o;
          class c extends o {
            constructor(q) {
              super(q), this.annotationElementId = q.annotationElementId, this.deleted = !0;
            }
            serialize() {
              return {
                id: this.annotationElementId,
                deleted: !0,
                pageIndex: this.pageIndex
              };
            }
          }
        },
        /* 5 */
        /***/
        (r, e, t) => {
          var b, _, R, k, C, Jt, F, f, g, y, E, On, P, I, G, ne, X, ee, K, se, q, Y, J, N, M, v, L, H, B, U, Z, re, pe, be, Se, _e, we, oe, le, $, j, ae, ue, Ae, Te, ke, ie, $n, Qt, en, Pt, tn, nn, ht, wt, Nn, Bn, rn, xt, an;
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.KeyboardManager = e.CommandManager = e.ColorManager = e.AnnotationEditorUIManager = void 0, e.bindEvents = s, e.opacityToHex = o;
          var n = t(1), a = t(6);
          function s(et, V, ye) {
            for (const Me of ye)
              V.addEventListener(Me, et[Me].bind(et));
          }
          function o(et) {
            return Math.round(Math.min(255, Math.max(1, 255 * et))).toString(16).padStart(2, "0");
          }
          class c {
            constructor() {
              de(this, b, 0);
            }
            getId() {
              return `${n.AnnotationEditorPrefix}${At(this, b)._++}`;
            }
          }
          b = new WeakMap();
          const A = class A {
            constructor() {
              de(this, C);
              de(this, _, (0, n.getUuid)());
              de(this, R, 0);
              de(this, k, null);
            }
            static get _isSVGFittingCanvas() {
              const V = '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>', Me = new OffscreenCanvas(1, 3).getContext("2d"), qe = new Image();
              qe.src = V;
              const Ue = qe.decode().then(() => (Me.drawImage(qe, 0, 0, 1, 1, 0, 0, 1, 3), new Uint32Array(Me.getImageData(0, 0, 1, 1).data.buffer)[0] === 0));
              return (0, n.shadow)(this, "_isSVGFittingCanvas", Ue);
            }
            async getFromFile(V) {
              const {
                lastModified: ye,
                name: Me,
                size: qe,
                type: Ue
              } = V;
              return te(this, C, Jt).call(this, `${ye}_${Me}_${qe}_${Ue}`, V);
            }
            async getFromUrl(V) {
              return te(this, C, Jt).call(this, V, V);
            }
            async getFromId(V) {
              p(this, k) || fe(this, k, /* @__PURE__ */ new Map());
              const ye = p(this, k).get(V);
              return ye ? ye.bitmap ? (ye.refCounter += 1, ye) : ye.file ? this.getFromFile(ye.file) : this.getFromUrl(ye.url) : null;
            }
            getSvgUrl(V) {
              const ye = p(this, k).get(V);
              return ye != null && ye.isSvg ? ye.svgUrl : null;
            }
            deleteId(V) {
              p(this, k) || fe(this, k, /* @__PURE__ */ new Map());
              const ye = p(this, k).get(V);
              ye && (ye.refCounter -= 1, ye.refCounter === 0 && (ye.bitmap = null));
            }
            isValidId(V) {
              return V.startsWith(`image_${p(this, _)}_`);
            }
          };
          _ = new WeakMap(), R = new WeakMap(), k = new WeakMap(), C = new WeakSet(), Jt = async function(V, ye) {
            p(this, k) || fe(this, k, /* @__PURE__ */ new Map());
            let Me = p(this, k).get(V);
            if (Me === null)
              return null;
            if (Me != null && Me.bitmap)
              return Me.refCounter += 1, Me;
            try {
              Me || (Me = {
                bitmap: null,
                id: `image_${p(this, _)}_${At(this, R)._++}`,
                refCounter: 0,
                isSvg: !1
              });
              let qe;
              if (typeof ye == "string") {
                Me.url = ye;
                const Ue = await fetch(ye);
                if (!Ue.ok)
                  throw new Error(Ue.statusText);
                qe = await Ue.blob();
              } else
                qe = Me.file = ye;
              if (qe.type === "image/svg+xml") {
                const Ue = A._isSVGFittingCanvas, Le = new FileReader(), W = new Image(), z = new Promise((Q, ge) => {
                  W.onload = () => {
                    Me.bitmap = W, Me.isSvg = !0, Q();
                  }, Le.onload = async () => {
                    const ve = Me.svgUrl = Le.result;
                    W.src = await Ue ? `${ve}#svgView(preserveAspectRatio(none))` : ve;
                  }, W.onerror = Le.onerror = ge;
                });
                Le.readAsDataURL(qe), await z;
              } else
                Me.bitmap = await createImageBitmap(qe);
              Me.refCounter = 1;
            } catch (qe) {
              console.error(qe), Me = null;
            }
            return p(this, k).set(V, Me), Me && p(this, k).set(Me.id, Me), Me;
          };
          let l = A;
          class u {
            constructor(V = 128) {
              de(this, F, []);
              de(this, f, !1);
              de(this, g);
              de(this, y, -1);
              fe(this, g, V);
            }
            add({
              cmd: V,
              undo: ye,
              mustExec: Me,
              type: qe = NaN,
              overwriteIfSameType: Ue = !1,
              keepUndo: Le = !1
            }) {
              if (Me && V(), p(this, f))
                return;
              const W = {
                cmd: V,
                undo: ye,
                type: qe
              };
              if (p(this, y) === -1) {
                p(this, F).length > 0 && (p(this, F).length = 0), fe(this, y, 0), p(this, F).push(W);
                return;
              }
              if (Ue && p(this, F)[p(this, y)].type === qe) {
                Le && (W.undo = p(this, F)[p(this, y)].undo), p(this, F)[p(this, y)] = W;
                return;
              }
              const z = p(this, y) + 1;
              z === p(this, g) ? p(this, F).splice(0, 1) : (fe(this, y, z), z < p(this, F).length && p(this, F).splice(z)), p(this, F).push(W);
            }
            undo() {
              p(this, y) !== -1 && (fe(this, f, !0), p(this, F)[p(this, y)].undo(), fe(this, f, !1), fe(this, y, p(this, y) - 1));
            }
            redo() {
              p(this, y) < p(this, F).length - 1 && (fe(this, y, p(this, y) + 1), fe(this, f, !0), p(this, F)[p(this, y)].cmd(), fe(this, f, !1));
            }
            hasSomethingToUndo() {
              return p(this, y) !== -1;
            }
            hasSomethingToRedo() {
              return p(this, y) < p(this, F).length - 1;
            }
            destroy() {
              fe(this, F, null);
            }
          }
          F = new WeakMap(), f = new WeakMap(), g = new WeakMap(), y = new WeakMap(), e.CommandManager = u;
          class h {
            constructor(V) {
              de(this, E);
              this.buffer = [], this.callbacks = /* @__PURE__ */ new Map(), this.allKeys = /* @__PURE__ */ new Set();
              const {
                isMac: ye
              } = n.FeatureTest.platform;
              for (const [Me, qe, Ue = {}] of V)
                for (const Le of Me) {
                  const W = Le.startsWith("mac+");
                  ye && W ? (this.callbacks.set(Le.slice(4), {
                    callback: qe,
                    options: Ue
                  }), this.allKeys.add(Le.split("+").at(-1))) : !ye && !W && (this.callbacks.set(Le, {
                    callback: qe,
                    options: Ue
                  }), this.allKeys.add(Le.split("+").at(-1)));
                }
            }
            exec(V, ye) {
              if (!this.allKeys.has(ye.key))
                return;
              const Me = this.callbacks.get(te(this, E, On).call(this, ye));
              if (!Me)
                return;
              const {
                callback: qe,
                options: {
                  bubbles: Ue = !1,
                  args: Le = [],
                  checker: W = null
                }
              } = Me;
              W && !W(V, ye) || (qe.bind(V, ...Le)(), Ue || (ye.stopPropagation(), ye.preventDefault()));
            }
          }
          E = new WeakSet(), On = function(V) {
            V.altKey && this.buffer.push("alt"), V.ctrlKey && this.buffer.push("ctrl"), V.metaKey && this.buffer.push("meta"), V.shiftKey && this.buffer.push("shift"), this.buffer.push(V.key);
            const ye = this.buffer.join("+");
            return this.buffer.length = 0, ye;
          }, e.KeyboardManager = h;
          const O = class O {
            get _colors() {
              const V = /* @__PURE__ */ new Map([["CanvasText", null], ["Canvas", null]]);
              return (0, a.getColorValues)(V), (0, n.shadow)(this, "_colors", V);
            }
            convert(V) {
              const ye = (0, a.getRGB)(V);
              if (!window.matchMedia("(forced-colors: active)").matches)
                return ye;
              for (const [Me, qe] of this._colors)
                if (qe.every((Ue, Le) => Ue === ye[Le]))
                  return O._colorsMapping.get(Me);
              return ye;
            }
            getHexCode(V) {
              const ye = this._colors.get(V);
              return ye ? n.Util.makeHexColor(...ye) : V;
            }
          };
          Ke(O, "_colorsMapping", /* @__PURE__ */ new Map([["CanvasText", [0, 0, 0]], ["Canvas", [255, 255, 255]]]));
          let d = O;
          e.ColorManager = d;
          const Ze = class Ze {
            constructor(V, ye, Me, qe, Ue, Le) {
              de(this, ie);
              de(this, P, null);
              de(this, I, /* @__PURE__ */ new Map());
              de(this, G, /* @__PURE__ */ new Map());
              de(this, ne, null);
              de(this, X, null);
              de(this, ee, new u());
              de(this, K, 0);
              de(this, se, /* @__PURE__ */ new Set());
              de(this, q, null);
              de(this, Y, null);
              de(this, J, /* @__PURE__ */ new Set());
              de(this, N, null);
              de(this, M, new c());
              de(this, v, !1);
              de(this, L, !1);
              de(this, H, null);
              de(this, B, n.AnnotationEditorType.NONE);
              de(this, U, /* @__PURE__ */ new Set());
              de(this, Z, null);
              de(this, re, this.blur.bind(this));
              de(this, pe, this.focus.bind(this));
              de(this, be, this.copy.bind(this));
              de(this, Se, this.cut.bind(this));
              de(this, _e, this.paste.bind(this));
              de(this, we, this.keydown.bind(this));
              de(this, oe, this.onEditingAction.bind(this));
              de(this, le, this.onPageChanging.bind(this));
              de(this, $, this.onScaleChanging.bind(this));
              de(this, j, this.onRotationChanging.bind(this));
              de(this, ae, {
                isEditing: !1,
                isEmpty: !0,
                hasSomethingToUndo: !1,
                hasSomethingToRedo: !1,
                hasSelectedEditor: !1
              });
              de(this, ue, [0, 0]);
              de(this, Ae, null);
              de(this, Te, null);
              de(this, ke, null);
              fe(this, Te, V), fe(this, ke, ye), fe(this, ne, Me), this._eventBus = qe, this._eventBus._on("editingaction", p(this, oe)), this._eventBus._on("pagechanging", p(this, le)), this._eventBus._on("scalechanging", p(this, $)), this._eventBus._on("rotationchanging", p(this, j)), fe(this, X, Ue.annotationStorage), fe(this, N, Ue.filterFactory), fe(this, Z, Le), this.viewParameters = {
                realScale: a.PixelsPerInch.PDF_TO_CSS_UNITS,
                rotation: 0
              };
            }
            static get _keyboardManager() {
              const V = Ze.prototype, ye = (Ue) => {
                const {
                  activeElement: Le
                } = document;
                return Le && p(Ue, Te).contains(Le) && Ue.hasSomethingToControl();
              }, Me = this.TRANSLATE_SMALL, qe = this.TRANSLATE_BIG;
              return (0, n.shadow)(this, "_keyboardManager", new h([[["ctrl+a", "mac+meta+a"], V.selectAll], [["ctrl+z", "mac+meta+z"], V.undo], [["ctrl+y", "ctrl+shift+z", "mac+meta+shift+z", "ctrl+shift+Z", "mac+meta+shift+Z"], V.redo], [["Backspace", "alt+Backspace", "ctrl+Backspace", "shift+Backspace", "mac+Backspace", "mac+alt+Backspace", "mac+ctrl+Backspace", "Delete", "ctrl+Delete", "shift+Delete", "mac+Delete"], V.delete], [["Escape", "mac+Escape"], V.unselectAll], [["ArrowLeft", "mac+ArrowLeft"], V.translateSelectedEditors, {
                args: [-Me, 0],
                checker: ye
              }], [["ctrl+ArrowLeft", "mac+shift+ArrowLeft"], V.translateSelectedEditors, {
                args: [-qe, 0],
                checker: ye
              }], [["ArrowRight", "mac+ArrowRight"], V.translateSelectedEditors, {
                args: [Me, 0],
                checker: ye
              }], [["ctrl+ArrowRight", "mac+shift+ArrowRight"], V.translateSelectedEditors, {
                args: [qe, 0],
                checker: ye
              }], [["ArrowUp", "mac+ArrowUp"], V.translateSelectedEditors, {
                args: [0, -Me],
                checker: ye
              }], [["ctrl+ArrowUp", "mac+shift+ArrowUp"], V.translateSelectedEditors, {
                args: [0, -qe],
                checker: ye
              }], [["ArrowDown", "mac+ArrowDown"], V.translateSelectedEditors, {
                args: [0, Me],
                checker: ye
              }], [["ctrl+ArrowDown", "mac+shift+ArrowDown"], V.translateSelectedEditors, {
                args: [0, qe],
                checker: ye
              }]]));
            }
            destroy() {
              te(this, ie, Pt).call(this), te(this, ie, Qt).call(this), this._eventBus._off("editingaction", p(this, oe)), this._eventBus._off("pagechanging", p(this, le)), this._eventBus._off("scalechanging", p(this, $)), this._eventBus._off("rotationchanging", p(this, j));
              for (const V of p(this, G).values())
                V.destroy();
              p(this, G).clear(), p(this, I).clear(), p(this, J).clear(), fe(this, P, null), p(this, U).clear(), p(this, ee).destroy(), p(this, ne).destroy();
            }
            get hcmFilter() {
              return (0, n.shadow)(this, "hcmFilter", p(this, Z) ? p(this, N).addHCMFilter(p(this, Z).foreground, p(this, Z).background) : "none");
            }
            get direction() {
              return (0, n.shadow)(this, "direction", getComputedStyle(p(this, Te)).direction);
            }
            editAltText(V) {
              var ye;
              (ye = p(this, ne)) == null || ye.editAltText(this, V);
            }
            onPageChanging({
              pageNumber: V
            }) {
              fe(this, K, V - 1);
            }
            focusMainContainer() {
              p(this, Te).focus();
            }
            findParent(V, ye) {
              for (const Me of p(this, G).values()) {
                const {
                  x: qe,
                  y: Ue,
                  width: Le,
                  height: W
                } = Me.div.getBoundingClientRect();
                if (V >= qe && V <= qe + Le && ye >= Ue && ye <= Ue + W)
                  return Me;
              }
              return null;
            }
            disableUserSelect(V = !1) {
              p(this, ke).classList.toggle("noUserSelect", V);
            }
            addShouldRescale(V) {
              p(this, J).add(V);
            }
            removeShouldRescale(V) {
              p(this, J).delete(V);
            }
            onScaleChanging({
              scale: V
            }) {
              this.commitOrRemove(), this.viewParameters.realScale = V * a.PixelsPerInch.PDF_TO_CSS_UNITS;
              for (const ye of p(this, J))
                ye.onScaleChanging();
            }
            onRotationChanging({
              pagesRotation: V
            }) {
              this.commitOrRemove(), this.viewParameters.rotation = V;
            }
            addToAnnotationStorage(V) {
              !V.isEmpty() && p(this, X) && !p(this, X).has(V.id) && p(this, X).setValue(V.id, V);
            }
            blur() {
              if (!this.hasSelection)
                return;
              const {
                activeElement: V
              } = document;
              for (const ye of p(this, U))
                if (ye.div.contains(V)) {
                  fe(this, H, [ye, V]), ye._focusEventsAllowed = !1;
                  break;
                }
            }
            focus() {
              if (!p(this, H))
                return;
              const [V, ye] = p(this, H);
              fe(this, H, null), ye.addEventListener("focusin", () => {
                V._focusEventsAllowed = !0;
              }, {
                once: !0
              }), ye.focus();
            }
            addEditListeners() {
              te(this, ie, en).call(this), te(this, ie, tn).call(this);
            }
            removeEditListeners() {
              te(this, ie, Pt).call(this), te(this, ie, nn).call(this);
            }
            copy(V) {
              var Me;
              if (V.preventDefault(), (Me = p(this, P)) == null || Me.commitOrRemove(), !this.hasSelection)
                return;
              const ye = [];
              for (const qe of p(this, U)) {
                const Ue = qe.serialize(!0);
                Ue && ye.push(Ue);
              }
              ye.length !== 0 && V.clipboardData.setData("application/pdfjs", JSON.stringify(ye));
            }
            cut(V) {
              this.copy(V), this.delete();
            }
            paste(V) {
              V.preventDefault();
              const {
                clipboardData: ye
              } = V;
              for (const Ue of ye.items)
                for (const Le of p(this, Y))
                  if (Le.isHandlingMimeForPasting(Ue.type)) {
                    Le.paste(Ue, this.currentLayer);
                    return;
                  }
              let Me = ye.getData("application/pdfjs");
              if (!Me)
                return;
              try {
                Me = JSON.parse(Me);
              } catch (Ue) {
                (0, n.warn)(`paste: "${Ue.message}".`);
                return;
              }
              if (!Array.isArray(Me))
                return;
              this.unselectAll();
              const qe = this.currentLayer;
              try {
                const Ue = [];
                for (const z of Me) {
                  const Q = qe.deserialize(z);
                  if (!Q)
                    return;
                  Ue.push(Q);
                }
                const Le = () => {
                  for (const z of Ue)
                    te(this, ie, rn).call(this, z);
                  te(this, ie, an).call(this, Ue);
                }, W = () => {
                  for (const z of Ue)
                    z.remove();
                };
                this.addCommands({
                  cmd: Le,
                  undo: W,
                  mustExec: !0
                });
              } catch (Ue) {
                (0, n.warn)(`paste: "${Ue.message}".`);
              }
            }
            keydown(V) {
              var ye;
              (ye = this.getActive()) != null && ye.shouldGetKeyboardEvents() || Ze._keyboardManager.exec(this, V);
            }
            onEditingAction(V) {
              ["undo", "redo", "delete", "selectAll"].includes(V.name) && this[V.name]();
            }
            setEditingState(V) {
              V ? (te(this, ie, $n).call(this), te(this, ie, en).call(this), te(this, ie, tn).call(this), te(this, ie, ht).call(this, {
                isEditing: p(this, B) !== n.AnnotationEditorType.NONE,
                isEmpty: te(this, ie, xt).call(this),
                hasSomethingToUndo: p(this, ee).hasSomethingToUndo(),
                hasSomethingToRedo: p(this, ee).hasSomethingToRedo(),
                hasSelectedEditor: !1
              })) : (te(this, ie, Qt).call(this), te(this, ie, Pt).call(this), te(this, ie, nn).call(this), te(this, ie, ht).call(this, {
                isEditing: !1
              }), this.disableUserSelect(!1));
            }
            registerEditorTypes(V) {
              if (!p(this, Y)) {
                fe(this, Y, V);
                for (const ye of p(this, Y))
                  te(this, ie, wt).call(this, ye.defaultPropertiesToUpdate);
              }
            }
            getId() {
              return p(this, M).getId();
            }
            get currentLayer() {
              return p(this, G).get(p(this, K));
            }
            getLayer(V) {
              return p(this, G).get(V);
            }
            get currentPageIndex() {
              return p(this, K);
            }
            addLayer(V) {
              p(this, G).set(V.pageIndex, V), p(this, v) ? V.enable() : V.disable();
            }
            removeLayer(V) {
              p(this, G).delete(V.pageIndex);
            }
            updateMode(V, ye = null) {
              if (p(this, B) !== V) {
                if (fe(this, B, V), V === n.AnnotationEditorType.NONE) {
                  this.setEditingState(!1), te(this, ie, Bn).call(this);
                  return;
                }
                this.setEditingState(!0), te(this, ie, Nn).call(this), this.unselectAll();
                for (const Me of p(this, G).values())
                  Me.updateMode(V);
                if (ye) {
                  for (const Me of p(this, I).values())
                    if (Me.annotationElementId === ye) {
                      this.setSelected(Me), Me.enterInEditMode();
                      break;
                    }
                }
              }
            }
            updateToolbar(V) {
              V !== p(this, B) && this._eventBus.dispatch("switchannotationeditormode", {
                source: this,
                mode: V
              });
            }
            updateParams(V, ye) {
              if (p(this, Y)) {
                if (V === n.AnnotationEditorParamsType.CREATE) {
                  this.currentLayer.addNewEditor(V);
                  return;
                }
                for (const Me of p(this, U))
                  Me.updateParams(V, ye);
                for (const Me of p(this, Y))
                  Me.updateDefaultParams(V, ye);
              }
            }
            enableWaiting(V = !1) {
              if (p(this, L) !== V) {
                fe(this, L, V);
                for (const ye of p(this, G).values())
                  V ? ye.disableClick() : ye.enableClick(), ye.div.classList.toggle("waiting", V);
              }
            }
            getEditors(V) {
              const ye = [];
              for (const Me of p(this, I).values())
                Me.pageIndex === V && ye.push(Me);
              return ye;
            }
            getEditor(V) {
              return p(this, I).get(V);
            }
            addEditor(V) {
              p(this, I).set(V.id, V);
            }
            removeEditor(V) {
              var ye;
              p(this, I).delete(V.id), this.unselect(V), (!V.annotationElementId || !p(this, se).has(V.annotationElementId)) && ((ye = p(this, X)) == null || ye.remove(V.id));
            }
            addDeletedAnnotationElement(V) {
              p(this, se).add(V.annotationElementId), V.deleted = !0;
            }
            isDeletedAnnotationElement(V) {
              return p(this, se).has(V);
            }
            removeDeletedAnnotationElement(V) {
              p(this, se).delete(V.annotationElementId), V.deleted = !1;
            }
            setActiveEditor(V) {
              p(this, P) !== V && (fe(this, P, V), V && te(this, ie, wt).call(this, V.propertiesToUpdate));
            }
            toggleSelected(V) {
              if (p(this, U).has(V)) {
                p(this, U).delete(V), V.unselect(), te(this, ie, ht).call(this, {
                  hasSelectedEditor: this.hasSelection
                });
                return;
              }
              p(this, U).add(V), V.select(), te(this, ie, wt).call(this, V.propertiesToUpdate), te(this, ie, ht).call(this, {
                hasSelectedEditor: !0
              });
            }
            setSelected(V) {
              for (const ye of p(this, U))
                ye !== V && ye.unselect();
              p(this, U).clear(), p(this, U).add(V), V.select(), te(this, ie, wt).call(this, V.propertiesToUpdate), te(this, ie, ht).call(this, {
                hasSelectedEditor: !0
              });
            }
            isSelected(V) {
              return p(this, U).has(V);
            }
            unselect(V) {
              V.unselect(), p(this, U).delete(V), te(this, ie, ht).call(this, {
                hasSelectedEditor: this.hasSelection
              });
            }
            get hasSelection() {
              return p(this, U).size !== 0;
            }
            undo() {
              p(this, ee).undo(), te(this, ie, ht).call(this, {
                hasSomethingToUndo: p(this, ee).hasSomethingToUndo(),
                hasSomethingToRedo: !0,
                isEmpty: te(this, ie, xt).call(this)
              });
            }
            redo() {
              p(this, ee).redo(), te(this, ie, ht).call(this, {
                hasSomethingToUndo: !0,
                hasSomethingToRedo: p(this, ee).hasSomethingToRedo(),
                isEmpty: te(this, ie, xt).call(this)
              });
            }
            addCommands(V) {
              p(this, ee).add(V), te(this, ie, ht).call(this, {
                hasSomethingToUndo: !0,
                hasSomethingToRedo: !1,
                isEmpty: te(this, ie, xt).call(this)
              });
            }
            delete() {
              if (this.commitOrRemove(), !this.hasSelection)
                return;
              const V = [...p(this, U)], ye = () => {
                for (const qe of V)
                  qe.remove();
              }, Me = () => {
                for (const qe of V)
                  te(this, ie, rn).call(this, qe);
              };
              this.addCommands({
                cmd: ye,
                undo: Me,
                mustExec: !0
              });
            }
            commitOrRemove() {
              var V;
              (V = p(this, P)) == null || V.commitOrRemove();
            }
            hasSomethingToControl() {
              return p(this, P) || this.hasSelection;
            }
            selectAll() {
              for (const V of p(this, U))
                V.commit();
              te(this, ie, an).call(this, p(this, I).values());
            }
            unselectAll() {
              if (p(this, P)) {
                p(this, P).commitOrRemove();
                return;
              }
              if (this.hasSelection) {
                for (const V of p(this, U))
                  V.unselect();
                p(this, U).clear(), te(this, ie, ht).call(this, {
                  hasSelectedEditor: !1
                });
              }
            }
            translateSelectedEditors(V, ye, Me = !1) {
              if (Me || this.commitOrRemove(), !this.hasSelection)
                return;
              p(this, ue)[0] += V, p(this, ue)[1] += ye;
              const [qe, Ue] = p(this, ue), Le = [...p(this, U)], W = 1e3;
              p(this, Ae) && clearTimeout(p(this, Ae)), fe(this, Ae, setTimeout(() => {
                fe(this, Ae, null), p(this, ue)[0] = p(this, ue)[1] = 0, this.addCommands({
                  cmd: () => {
                    for (const z of Le)
                      p(this, I).has(z.id) && z.translateInPage(qe, Ue);
                  },
                  undo: () => {
                    for (const z of Le)
                      p(this, I).has(z.id) && z.translateInPage(-qe, -Ue);
                  },
                  mustExec: !1
                });
              }, W));
              for (const z of Le)
                z.translateInPage(V, ye);
            }
            setUpDragSession() {
              if (this.hasSelection) {
                this.disableUserSelect(!0), fe(this, q, /* @__PURE__ */ new Map());
                for (const V of p(this, U))
                  p(this, q).set(V, {
                    savedX: V.x,
                    savedY: V.y,
                    savedPageIndex: V.pageIndex,
                    newX: 0,
                    newY: 0,
                    newPageIndex: -1
                  });
              }
            }
            endDragSession() {
              if (!p(this, q))
                return !1;
              this.disableUserSelect(!1);
              const V = p(this, q);
              fe(this, q, null);
              let ye = !1;
              for (const [{
                x: qe,
                y: Ue,
                pageIndex: Le
              }, W] of V)
                W.newX = qe, W.newY = Ue, W.newPageIndex = Le, ye || (ye = qe !== W.savedX || Ue !== W.savedY || Le !== W.savedPageIndex);
              if (!ye)
                return !1;
              const Me = (qe, Ue, Le, W) => {
                if (p(this, I).has(qe.id)) {
                  const z = p(this, G).get(W);
                  z ? qe._setParentAndPosition(z, Ue, Le) : (qe.pageIndex = W, qe.x = Ue, qe.y = Le);
                }
              };
              return this.addCommands({
                cmd: () => {
                  for (const [qe, {
                    newX: Ue,
                    newY: Le,
                    newPageIndex: W
                  }] of V)
                    Me(qe, Ue, Le, W);
                },
                undo: () => {
                  for (const [qe, {
                    savedX: Ue,
                    savedY: Le,
                    savedPageIndex: W
                  }] of V)
                    Me(qe, Ue, Le, W);
                },
                mustExec: !0
              }), !0;
            }
            dragSelectedEditors(V, ye) {
              if (p(this, q))
                for (const Me of p(this, q).keys())
                  Me.drag(V, ye);
            }
            rebuild(V) {
              if (V.parent === null) {
                const ye = this.getLayer(V.pageIndex);
                ye ? (ye.changeParent(V), ye.addOrRebuild(V)) : (this.addEditor(V), this.addToAnnotationStorage(V), V.rebuild());
              } else
                V.parent.addOrRebuild(V);
            }
            isActive(V) {
              return p(this, P) === V;
            }
            getActive() {
              return p(this, P);
            }
            getMode() {
              return p(this, B);
            }
            get imageManager() {
              return (0, n.shadow)(this, "imageManager", new l());
            }
          };
          P = new WeakMap(), I = new WeakMap(), G = new WeakMap(), ne = new WeakMap(), X = new WeakMap(), ee = new WeakMap(), K = new WeakMap(), se = new WeakMap(), q = new WeakMap(), Y = new WeakMap(), J = new WeakMap(), N = new WeakMap(), M = new WeakMap(), v = new WeakMap(), L = new WeakMap(), H = new WeakMap(), B = new WeakMap(), U = new WeakMap(), Z = new WeakMap(), re = new WeakMap(), pe = new WeakMap(), be = new WeakMap(), Se = new WeakMap(), _e = new WeakMap(), we = new WeakMap(), oe = new WeakMap(), le = new WeakMap(), $ = new WeakMap(), j = new WeakMap(), ae = new WeakMap(), ue = new WeakMap(), Ae = new WeakMap(), Te = new WeakMap(), ke = new WeakMap(), ie = new WeakSet(), $n = function() {
            window.addEventListener("focus", p(this, pe)), window.addEventListener("blur", p(this, re));
          }, Qt = function() {
            window.removeEventListener("focus", p(this, pe)), window.removeEventListener("blur", p(this, re));
          }, en = function() {
            window.addEventListener("keydown", p(this, we), {
              capture: !0
            });
          }, Pt = function() {
            window.removeEventListener("keydown", p(this, we), {
              capture: !0
            });
          }, tn = function() {
            document.addEventListener("copy", p(this, be)), document.addEventListener("cut", p(this, Se)), document.addEventListener("paste", p(this, _e));
          }, nn = function() {
            document.removeEventListener("copy", p(this, be)), document.removeEventListener("cut", p(this, Se)), document.removeEventListener("paste", p(this, _e));
          }, ht = function(V) {
            Object.entries(V).some(([Me, qe]) => p(this, ae)[Me] !== qe) && this._eventBus.dispatch("annotationeditorstateschanged", {
              source: this,
              details: Object.assign(p(this, ae), V)
            });
          }, wt = function(V) {
            this._eventBus.dispatch("annotationeditorparamschanged", {
              source: this,
              details: V
            });
          }, Nn = function() {
            if (!p(this, v)) {
              fe(this, v, !0);
              for (const V of p(this, G).values())
                V.enable();
            }
          }, Bn = function() {
            if (this.unselectAll(), p(this, v)) {
              fe(this, v, !1);
              for (const V of p(this, G).values())
                V.disable();
            }
          }, rn = function(V) {
            const ye = p(this, G).get(V.pageIndex);
            ye ? ye.addOrRebuild(V) : this.addEditor(V);
          }, xt = function() {
            if (p(this, I).size === 0)
              return !0;
            if (p(this, I).size === 1)
              for (const V of p(this, I).values())
                return V.isEmpty();
            return !1;
          }, an = function(V) {
            p(this, U).clear();
            for (const ye of V)
              ye.isEmpty() || (p(this, U).add(ye), ye.select());
            te(this, ie, ht).call(this, {
              hasSelectedEditor: !0
            });
          }, Ke(Ze, "TRANSLATE_SMALL", 1), Ke(Ze, "TRANSLATE_BIG", 10);
          let w = Ze;
          e.AnnotationEditorUIManager = w;
        },
        /* 6 */
        /***/
        (r, e, t) => {
          var K, se, q, Y, J, N, M, v, L, H, B, U, bt, yt, sn, Rt, Lt, kt, Et;
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.StatTimer = e.RenderingCancelledException = e.PixelsPerInch = e.PageViewport = e.PDFDateString = e.DOMStandardFontDataFactory = e.DOMSVGFactory = e.DOMFilterFactory = e.DOMCanvasFactory = e.DOMCMapReaderFactory = void 0, e.deprecated = y, e.getColorValues = I, e.getCurrentTransform = G, e.getCurrentTransformInverse = ne, e.getFilenameFromUrl = C, e.getPdfFilenameFromUrl = m, e.getRGB = P, e.getXfaPageViewport = O, e.isDataScheme = R, e.isPdfFile = k, e.isValidFetchUrl = F, e.loadScript = g, e.noContextMenu = f, e.setLayerDimensions = X;
          var n = t(7), a = t(1);
          const s = "http://www.w3.org/2000/svg", ee = class ee {
          };
          Ke(ee, "CSS", 96), Ke(ee, "PDF", 72), Ke(ee, "PDF_TO_CSS_UNITS", ee.CSS / ee.PDF);
          let o = ee;
          e.PixelsPerInch = o;
          class c extends n.BaseFilterFactory {
            constructor({
              docId: $,
              ownerDocument: j = globalThis.document
            } = {}) {
              super();
              de(this, U);
              de(this, K);
              de(this, se);
              de(this, q);
              de(this, Y);
              de(this, J);
              de(this, N);
              de(this, M);
              de(this, v);
              de(this, L);
              de(this, H);
              de(this, B, 0);
              fe(this, q, $), fe(this, Y, j);
            }
            addFilter($) {
              if (!$)
                return "none";
              let j = p(this, U, bt).get($);
              if (j)
                return j;
              let ae, ue, Ae, Te;
              if ($.length === 1) {
                const De = $[0], Xe = new Array(256);
                for (let je = 0; je < 256; je++)
                  Xe[je] = De[je] / 255;
                Te = ae = ue = Ae = Xe.join(",");
              } else {
                const [De, Xe, je] = $, tt = new Array(256), $e = new Array(256), Ge = new Array(256);
                for (let Qe = 0; Qe < 256; Qe++)
                  tt[Qe] = De[Qe] / 255, $e[Qe] = Xe[Qe] / 255, Ge[Qe] = je[Qe] / 255;
                ae = tt.join(","), ue = $e.join(","), Ae = Ge.join(","), Te = `${ae}${ue}${Ae}`;
              }
              if (j = p(this, U, bt).get(Te), j)
                return p(this, U, bt).set($, j), j;
              const ke = `g_${p(this, q)}_transfer_map_${At(this, B)._++}`, ie = `url(#${ke})`;
              p(this, U, bt).set($, ie), p(this, U, bt).set(Te, ie);
              const Fe = te(this, U, Rt).call(this, ke);
              return te(this, U, kt).call(this, ae, ue, Ae, Fe), ie;
            }
            addHCMFilter($, j) {
              var Xe;
              const ae = `${$}-${j}`;
              if (p(this, N) === ae)
                return p(this, M);
              if (fe(this, N, ae), fe(this, M, "none"), (Xe = p(this, J)) == null || Xe.remove(), !$ || !j)
                return p(this, M);
              const ue = te(this, U, Et).call(this, $);
              $ = a.Util.makeHexColor(...ue);
              const Ae = te(this, U, Et).call(this, j);
              if (j = a.Util.makeHexColor(...Ae), p(this, U, yt).style.color = "", $ === "#000000" && j === "#ffffff" || $ === j)
                return p(this, M);
              const Te = new Array(256);
              for (let je = 0; je <= 255; je++) {
                const tt = je / 255;
                Te[je] = tt <= 0.03928 ? tt / 12.92 : ((tt + 0.055) / 1.055) ** 2.4;
              }
              const ke = Te.join(","), ie = `g_${p(this, q)}_hcm_filter`, Fe = fe(this, v, te(this, U, Rt).call(this, ie));
              te(this, U, kt).call(this, ke, ke, ke, Fe), te(this, U, sn).call(this, Fe);
              const De = (je, tt) => {
                const $e = ue[je] / 255, Ge = Ae[je] / 255, Qe = new Array(tt + 1);
                for (let nt = 0; nt <= tt; nt++)
                  Qe[nt] = $e + nt / tt * (Ge - $e);
                return Qe.join(",");
              };
              return te(this, U, kt).call(this, De(0, 5), De(1, 5), De(2, 5), Fe), fe(this, M, `url(#${ie})`), p(this, M);
            }
            addHighlightHCMFilter($, j, ae, ue) {
              var Ge;
              const Ae = `${$}-${j}-${ae}-${ue}`;
              if (p(this, L) === Ae)
                return p(this, H);
              if (fe(this, L, Ae), fe(this, H, "none"), (Ge = p(this, v)) == null || Ge.remove(), !$ || !j)
                return p(this, H);
              const [Te, ke] = [$, j].map(te(this, U, Et).bind(this));
              let ie = Math.round(0.2126 * Te[0] + 0.7152 * Te[1] + 0.0722 * Te[2]), Fe = Math.round(0.2126 * ke[0] + 0.7152 * ke[1] + 0.0722 * ke[2]), [De, Xe] = [ae, ue].map(te(this, U, Et).bind(this));
              Fe < ie && ([ie, Fe, De, Xe] = [Fe, ie, Xe, De]), p(this, U, yt).style.color = "";
              const je = (Qe, nt, xe) => {
                const he = new Array(256), me = (Fe - ie) / xe, Ie = Qe / 255, Ze = (nt - Qe) / (255 * xe);
                let et = 0;
                for (let V = 0; V <= xe; V++) {
                  const ye = Math.round(ie + V * me), Me = Ie + V * Ze;
                  for (let qe = et; qe <= ye; qe++)
                    he[qe] = Me;
                  et = ye + 1;
                }
                for (let V = et; V < 256; V++)
                  he[V] = he[et - 1];
                return he.join(",");
              }, tt = `g_${p(this, q)}_hcm_highlight_filter`, $e = fe(this, v, te(this, U, Rt).call(this, tt));
              return te(this, U, sn).call(this, $e), te(this, U, kt).call(this, je(De[0], Xe[0], 5), je(De[1], Xe[1], 5), je(De[2], Xe[2], 5), $e), fe(this, H, `url(#${tt})`), p(this, H);
            }
            destroy($ = !1) {
              $ && (p(this, M) || p(this, H)) || (p(this, se) && (p(this, se).parentNode.parentNode.remove(), fe(this, se, null)), p(this, K) && (p(this, K).clear(), fe(this, K, null)), fe(this, B, 0));
            }
          }
          K = new WeakMap(), se = new WeakMap(), q = new WeakMap(), Y = new WeakMap(), J = new WeakMap(), N = new WeakMap(), M = new WeakMap(), v = new WeakMap(), L = new WeakMap(), H = new WeakMap(), B = new WeakMap(), U = new WeakSet(), bt = function() {
            return p(this, K) || fe(this, K, /* @__PURE__ */ new Map());
          }, yt = function() {
            if (!p(this, se)) {
              const $ = p(this, Y).createElement("div"), {
                style: j
              } = $;
              j.visibility = "hidden", j.contain = "strict", j.width = j.height = 0, j.position = "absolute", j.top = j.left = 0, j.zIndex = -1;
              const ae = p(this, Y).createElementNS(s, "svg");
              ae.setAttribute("width", 0), ae.setAttribute("height", 0), fe(this, se, p(this, Y).createElementNS(s, "defs")), $.append(ae), ae.append(p(this, se)), p(this, Y).body.append($);
            }
            return p(this, se);
          }, sn = function($) {
            const j = p(this, Y).createElementNS(s, "feColorMatrix");
            j.setAttribute("type", "matrix"), j.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"), $.append(j);
          }, Rt = function($) {
            const j = p(this, Y).createElementNS(s, "filter");
            return j.setAttribute("color-interpolation-filters", "sRGB"), j.setAttribute("id", $), p(this, U, yt).append(j), j;
          }, Lt = function($, j, ae) {
            const ue = p(this, Y).createElementNS(s, j);
            ue.setAttribute("type", "discrete"), ue.setAttribute("tableValues", ae), $.append(ue);
          }, kt = function($, j, ae, ue) {
            const Ae = p(this, Y).createElementNS(s, "feComponentTransfer");
            ue.append(Ae), te(this, U, Lt).call(this, Ae, "feFuncR", $), te(this, U, Lt).call(this, Ae, "feFuncG", j), te(this, U, Lt).call(this, Ae, "feFuncB", ae);
          }, Et = function($) {
            return p(this, U, yt).style.color = $, P(getComputedStyle(p(this, U, yt)).getPropertyValue("color"));
          }, e.DOMFilterFactory = c;
          class l extends n.BaseCanvasFactory {
            constructor({
              ownerDocument: le = globalThis.document
            } = {}) {
              super(), this._document = le;
            }
            _createCanvas(le, $) {
              const j = this._document.createElement("canvas");
              return j.width = le, j.height = $, j;
            }
          }
          e.DOMCanvasFactory = l;
          async function u(oe, le = !1) {
            if (F(oe, document.baseURI)) {
              const $ = await fetch(oe);
              if (!$.ok)
                throw new Error($.statusText);
              return le ? new Uint8Array(await $.arrayBuffer()) : (0, a.stringToBytes)(await $.text());
            }
            return new Promise(($, j) => {
              const ae = new XMLHttpRequest();
              ae.open("GET", oe, !0), le && (ae.responseType = "arraybuffer"), ae.onreadystatechange = () => {
                if (ae.readyState === XMLHttpRequest.DONE) {
                  if (ae.status === 200 || ae.status === 0) {
                    let ue;
                    if (le && ae.response ? ue = new Uint8Array(ae.response) : !le && ae.responseText && (ue = (0, a.stringToBytes)(ae.responseText)), ue) {
                      $(ue);
                      return;
                    }
                  }
                  j(new Error(ae.statusText));
                }
              }, ae.send(null);
            });
          }
          class h extends n.BaseCMapReaderFactory {
            _fetchData(le, $) {
              return u(le, this.isCompressed).then((j) => ({
                cMapData: j,
                compressionType: $
              }));
            }
          }
          e.DOMCMapReaderFactory = h;
          class d extends n.BaseStandardFontDataFactory {
            _fetchData(le) {
              return u(le, !0);
            }
          }
          e.DOMStandardFontDataFactory = d;
          class w extends n.BaseSVGFactory {
            _createSVG(le) {
              return document.createElementNS(s, le);
            }
          }
          e.DOMSVGFactory = w;
          class b {
            constructor({
              viewBox: le,
              scale: $,
              rotation: j,
              offsetX: ae = 0,
              offsetY: ue = 0,
              dontFlip: Ae = !1
            }) {
              this.viewBox = le, this.scale = $, this.rotation = j, this.offsetX = ae, this.offsetY = ue;
              const Te = (le[2] + le[0]) / 2, ke = (le[3] + le[1]) / 2;
              let ie, Fe, De, Xe;
              switch (j %= 360, j < 0 && (j += 360), j) {
                case 180:
                  ie = -1, Fe = 0, De = 0, Xe = 1;
                  break;
                case 90:
                  ie = 0, Fe = 1, De = 1, Xe = 0;
                  break;
                case 270:
                  ie = 0, Fe = -1, De = -1, Xe = 0;
                  break;
                case 0:
                  ie = 1, Fe = 0, De = 0, Xe = -1;
                  break;
                default:
                  throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.");
              }
              Ae && (De = -De, Xe = -Xe);
              let je, tt, $e, Ge;
              ie === 0 ? (je = Math.abs(ke - le[1]) * $ + ae, tt = Math.abs(Te - le[0]) * $ + ue, $e = (le[3] - le[1]) * $, Ge = (le[2] - le[0]) * $) : (je = Math.abs(Te - le[0]) * $ + ae, tt = Math.abs(ke - le[1]) * $ + ue, $e = (le[2] - le[0]) * $, Ge = (le[3] - le[1]) * $), this.transform = [ie * $, Fe * $, De * $, Xe * $, je - ie * $ * Te - De * $ * ke, tt - Fe * $ * Te - Xe * $ * ke], this.width = $e, this.height = Ge;
            }
            get rawDims() {
              const {
                viewBox: le
              } = this;
              return (0, a.shadow)(this, "rawDims", {
                pageWidth: le[2] - le[0],
                pageHeight: le[3] - le[1],
                pageX: le[0],
                pageY: le[1]
              });
            }
            clone({
              scale: le = this.scale,
              rotation: $ = this.rotation,
              offsetX: j = this.offsetX,
              offsetY: ae = this.offsetY,
              dontFlip: ue = !1
            } = {}) {
              return new b({
                viewBox: this.viewBox.slice(),
                scale: le,
                rotation: $,
                offsetX: j,
                offsetY: ae,
                dontFlip: ue
              });
            }
            convertToViewportPoint(le, $) {
              return a.Util.applyTransform([le, $], this.transform);
            }
            convertToViewportRectangle(le) {
              const $ = a.Util.applyTransform([le[0], le[1]], this.transform), j = a.Util.applyTransform([le[2], le[3]], this.transform);
              return [$[0], $[1], j[0], j[1]];
            }
            convertToPdfPoint(le, $) {
              return a.Util.applyInverseTransform([le, $], this.transform);
            }
          }
          e.PageViewport = b;
          class _ extends a.BaseException {
            constructor(le, $ = 0) {
              super(le, "RenderingCancelledException"), this.extraDelay = $;
            }
          }
          e.RenderingCancelledException = _;
          function R(oe) {
            const le = oe.length;
            let $ = 0;
            for (; $ < le && oe[$].trim() === ""; )
              $++;
            return oe.substring($, $ + 5).toLowerCase() === "data:";
          }
          function k(oe) {
            return typeof oe == "string" && /\.pdf$/i.test(oe);
          }
          function C(oe, le = !1) {
            return le || ([oe] = oe.split(/[#?]/, 1)), oe.substring(oe.lastIndexOf("/") + 1);
          }
          function m(oe, le = "document.pdf") {
            if (typeof oe != "string")
              return le;
            if (R(oe))
              return (0, a.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'), le;
            const $ = /^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/, j = /[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i, ae = $.exec(oe);
            let ue = j.exec(ae[1]) || j.exec(ae[2]) || j.exec(ae[3]);
            if (ue && (ue = ue[0], ue.includes("%")))
              try {
                ue = j.exec(decodeURIComponent(ue))[0];
              } catch {
              }
            return ue || le;
          }
          class A {
            constructor() {
              Ke(this, "started", /* @__PURE__ */ Object.create(null));
              Ke(this, "times", []);
            }
            time(le) {
              le in this.started && (0, a.warn)(`Timer is already running for ${le}`), this.started[le] = Date.now();
            }
            timeEnd(le) {
              le in this.started || (0, a.warn)(`Timer has not been started for ${le}`), this.times.push({
                name: le,
                start: this.started[le],
                end: Date.now()
              }), delete this.started[le];
            }
            toString() {
              const le = [];
              let $ = 0;
              for (const {
                name: j
              } of this.times)
                $ = Math.max(j.length, $);
              for (const {
                name: j,
                start: ae,
                end: ue
              } of this.times)
                le.push(`${j.padEnd($)} ${ue - ae}ms
`);
              return le.join("");
            }
          }
          e.StatTimer = A;
          function F(oe, le) {
            try {
              const {
                protocol: $
              } = le ? new URL(oe, le) : new URL(oe);
              return $ === "http:" || $ === "https:";
            } catch {
              return !1;
            }
          }
          function f(oe) {
            oe.preventDefault();
          }
          function g(oe, le = !1) {
            return new Promise(($, j) => {
              const ae = document.createElement("script");
              ae.src = oe, ae.onload = function(ue) {
                le && ae.remove(), $(ue);
              }, ae.onerror = function() {
                j(new Error(`Cannot load script at: ${ae.src}`));
              }, (document.head || document.documentElement).append(ae);
            });
          }
          function y(oe) {
            console.log("Deprecated API usage: " + oe);
          }
          let E;
          class x {
            static toDateObject(le) {
              if (!le || typeof le != "string")
                return null;
              E || (E = new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));
              const $ = E.exec(le);
              if (!$)
                return null;
              const j = parseInt($[1], 10);
              let ae = parseInt($[2], 10);
              ae = ae >= 1 && ae <= 12 ? ae - 1 : 0;
              let ue = parseInt($[3], 10);
              ue = ue >= 1 && ue <= 31 ? ue : 1;
              let Ae = parseInt($[4], 10);
              Ae = Ae >= 0 && Ae <= 23 ? Ae : 0;
              let Te = parseInt($[5], 10);
              Te = Te >= 0 && Te <= 59 ? Te : 0;
              let ke = parseInt($[6], 10);
              ke = ke >= 0 && ke <= 59 ? ke : 0;
              const ie = $[7] || "Z";
              let Fe = parseInt($[8], 10);
              Fe = Fe >= 0 && Fe <= 23 ? Fe : 0;
              let De = parseInt($[9], 10) || 0;
              return De = De >= 0 && De <= 59 ? De : 0, ie === "-" ? (Ae += Fe, Te += De) : ie === "+" && (Ae -= Fe, Te -= De), new Date(Date.UTC(j, ae, ue, Ae, Te, ke));
            }
          }
          e.PDFDateString = x;
          function O(oe, {
            scale: le = 1,
            rotation: $ = 0
          }) {
            const {
              width: j,
              height: ae
            } = oe.attributes.style, ue = [0, 0, parseInt(j), parseInt(ae)];
            return new b({
              viewBox: ue,
              scale: le,
              rotation: $
            });
          }
          function P(oe) {
            if (oe.startsWith("#")) {
              const le = parseInt(oe.slice(1), 16);
              return [(le & 16711680) >> 16, (le & 65280) >> 8, le & 255];
            }
            return oe.startsWith("rgb(") ? oe.slice(4, -1).split(",").map((le) => parseInt(le)) : oe.startsWith("rgba(") ? oe.slice(5, -1).split(",").map((le) => parseInt(le)).slice(0, 3) : ((0, a.warn)(`Not a valid color format: "${oe}"`), [0, 0, 0]);
          }
          function I(oe) {
            const le = document.createElement("span");
            le.style.visibility = "hidden", document.body.append(le);
            for (const $ of oe.keys()) {
              le.style.color = $;
              const j = window.getComputedStyle(le).color;
              oe.set($, P(j));
            }
            le.remove();
          }
          function G(oe) {
            const {
              a: le,
              b: $,
              c: j,
              d: ae,
              e: ue,
              f: Ae
            } = oe.getTransform();
            return [le, $, j, ae, ue, Ae];
          }
          function ne(oe) {
            const {
              a: le,
              b: $,
              c: j,
              d: ae,
              e: ue,
              f: Ae
            } = oe.getTransform().invertSelf();
            return [le, $, j, ae, ue, Ae];
          }
          function X(oe, le, $ = !1, j = !0) {
            if (le instanceof b) {
              const {
                pageWidth: ae,
                pageHeight: ue
              } = le.rawDims, {
                style: Ae
              } = oe, Te = a.FeatureTest.isCSSRoundSupported, ke = `var(--scale-factor) * ${ae}px`, ie = `var(--scale-factor) * ${ue}px`, Fe = Te ? `round(${ke}, 1px)` : `calc(${ke})`, De = Te ? `round(${ie}, 1px)` : `calc(${ie})`;
              !$ || le.rotation % 180 === 0 ? (Ae.width = Fe, Ae.height = De) : (Ae.width = De, Ae.height = Fe);
            }
            j && oe.setAttribute("data-main-rotation", le.rotation);
          }
        },
        /* 7 */
        /***/
        (r, e, t) => {
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.BaseStandardFontDataFactory = e.BaseSVGFactory = e.BaseFilterFactory = e.BaseCanvasFactory = e.BaseCMapReaderFactory = void 0;
          var n = t(1);
          class a {
            constructor() {
              this.constructor === a && (0, n.unreachable)("Cannot initialize BaseFilterFactory.");
            }
            addFilter(h) {
              return "none";
            }
            addHCMFilter(h, d) {
              return "none";
            }
            addHighlightHCMFilter(h, d, w, b) {
              return "none";
            }
            destroy(h = !1) {
            }
          }
          e.BaseFilterFactory = a;
          class s {
            constructor() {
              this.constructor === s && (0, n.unreachable)("Cannot initialize BaseCanvasFactory.");
            }
            create(h, d) {
              if (h <= 0 || d <= 0)
                throw new Error("Invalid canvas size");
              const w = this._createCanvas(h, d);
              return {
                canvas: w,
                context: w.getContext("2d")
              };
            }
            reset(h, d, w) {
              if (!h.canvas)
                throw new Error("Canvas is not specified");
              if (d <= 0 || w <= 0)
                throw new Error("Invalid canvas size");
              h.canvas.width = d, h.canvas.height = w;
            }
            destroy(h) {
              if (!h.canvas)
                throw new Error("Canvas is not specified");
              h.canvas.width = 0, h.canvas.height = 0, h.canvas = null, h.context = null;
            }
            _createCanvas(h, d) {
              (0, n.unreachable)("Abstract method `_createCanvas` called.");
            }
          }
          e.BaseCanvasFactory = s;
          class o {
            constructor({
              baseUrl: h = null,
              isCompressed: d = !0
            }) {
              this.constructor === o && (0, n.unreachable)("Cannot initialize BaseCMapReaderFactory."), this.baseUrl = h, this.isCompressed = d;
            }
            async fetch({
              name: h
            }) {
              if (!this.baseUrl)
                throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');
              if (!h)
                throw new Error("CMap name must be specified.");
              const d = this.baseUrl + h + (this.isCompressed ? ".bcmap" : ""), w = this.isCompressed ? n.CMapCompressionType.BINARY : n.CMapCompressionType.NONE;
              return this._fetchData(d, w).catch((b) => {
                throw new Error(`Unable to load ${this.isCompressed ? "binary " : ""}CMap at: ${d}`);
              });
            }
            _fetchData(h, d) {
              (0, n.unreachable)("Abstract method `_fetchData` called.");
            }
          }
          e.BaseCMapReaderFactory = o;
          class c {
            constructor({
              baseUrl: h = null
            }) {
              this.constructor === c && (0, n.unreachable)("Cannot initialize BaseStandardFontDataFactory."), this.baseUrl = h;
            }
            async fetch({
              filename: h
            }) {
              if (!this.baseUrl)
                throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');
              if (!h)
                throw new Error("Font filename must be specified.");
              const d = `${this.baseUrl}${h}`;
              return this._fetchData(d).catch((w) => {
                throw new Error(`Unable to load font data at: ${d}`);
              });
            }
            _fetchData(h) {
              (0, n.unreachable)("Abstract method `_fetchData` called.");
            }
          }
          e.BaseStandardFontDataFactory = c;
          class l {
            constructor() {
              this.constructor === l && (0, n.unreachable)("Cannot initialize BaseSVGFactory.");
            }
            create(h, d, w = !1) {
              if (h <= 0 || d <= 0)
                throw new Error("Invalid SVG dimensions");
              const b = this._createSVG("svg:svg");
              return b.setAttribute("version", "1.1"), w || (b.setAttribute("width", `${h}px`), b.setAttribute("height", `${d}px`)), b.setAttribute("preserveAspectRatio", "none"), b.setAttribute("viewBox", `0 0 ${h} ${d}`), b;
            }
            createElement(h) {
              if (typeof h != "string")
                throw new Error("Invalid SVG element type");
              return this._createSVG(h);
            }
            _createSVG(h) {
              (0, n.unreachable)("Abstract method `_createSVG` called.");
            }
          }
          e.BaseSVGFactory = l;
        },
        /* 8 */
        /***/
        (r, e, t) => {
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.MurmurHash3_64 = void 0;
          var n = t(1);
          const a = 3285377520, s = 4294901760, o = 65535;
          class c {
            constructor(u) {
              this.h1 = u ? u & 4294967295 : a, this.h2 = u ? u & 4294967295 : a;
            }
            update(u) {
              let h, d;
              if (typeof u == "string") {
                h = new Uint8Array(u.length * 2), d = 0;
                for (let y = 0, E = u.length; y < E; y++) {
                  const x = u.charCodeAt(y);
                  x <= 255 ? h[d++] = x : (h[d++] = x >>> 8, h[d++] = x & 255);
                }
              } else if ((0, n.isArrayBuffer)(u))
                h = u.slice(), d = h.byteLength;
              else
                throw new Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");
              const w = d >> 2, b = d - w * 4, _ = new Uint32Array(h.buffer, 0, w);
              let R = 0, k = 0, C = this.h1, m = this.h2;
              const A = 3432918353, F = 461845907, f = A & o, g = F & o;
              for (let y = 0; y < w; y++)
                y & 1 ? (R = _[y], R = R * A & s | R * f & o, R = R << 15 | R >>> 17, R = R * F & s | R * g & o, C ^= R, C = C << 13 | C >>> 19, C = C * 5 + 3864292196) : (k = _[y], k = k * A & s | k * f & o, k = k << 15 | k >>> 17, k = k * F & s | k * g & o, m ^= k, m = m << 13 | m >>> 19, m = m * 5 + 3864292196);
              switch (R = 0, b) {
                case 3:
                  R ^= h[w * 4 + 2] << 16;
                case 2:
                  R ^= h[w * 4 + 1] << 8;
                case 1:
                  R ^= h[w * 4], R = R * A & s | R * f & o, R = R << 15 | R >>> 17, R = R * F & s | R * g & o, w & 1 ? C ^= R : m ^= R;
              }
              this.h1 = C, this.h2 = m;
            }
            hexdigest() {
              let u = this.h1, h = this.h2;
              return u ^= h >>> 1, u = u * 3981806797 & s | u * 36045 & o, h = h * 4283543511 & s | ((h << 16 | u >>> 16) * 2950163797 & s) >>> 16, u ^= h >>> 1, u = u * 444984403 & s | u * 60499 & o, h = h * 3301882366 & s | ((h << 16 | u >>> 16) * 3120437893 & s) >>> 16, u ^= h >>> 1, (u >>> 0).toString(16).padStart(8, "0") + (h >>> 0).toString(16).padStart(8, "0");
            }
          }
          e.MurmurHash3_64 = c;
        },
        /* 9 */
        /***/
        (r, e, t) => {
          var o;
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.FontLoader = e.FontFaceObject = void 0;
          var n = t(1);
          class a {
            constructor({
              ownerDocument: l = globalThis.document,
              styleElement: u = null
            }) {
              de(this, o, /* @__PURE__ */ new Set());
              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 u = this.styleElement.sheet;
              u.insertRule(l, u.cssRules.length);
            }
            clear() {
              for (const l of this.nativeFontFaces)
                this._document.fonts.delete(l);
              this.nativeFontFaces.clear(), p(this, o).clear(), this.styleElement && (this.styleElement.remove(), this.styleElement = null);
            }
            async loadSystemFont(l) {
              if (!(!l || p(this, o).has(l.loadedName))) {
                if ((0, n.assert)(!this.disableFontFace, "loadSystemFont shouldn't be called when `disableFontFace` is set."), this.isFontLoadingAPISupported) {
                  const {
                    loadedName: u,
                    src: h,
                    style: d
                  } = l, w = new FontFace(u, h, d);
                  this.addNativeFontFace(w);
                  try {
                    await w.load(), p(this, o).add(u);
                  } catch {
                    (0, n.warn)(`Cannot load system font: ${l.baseFontName}, installing it could help to improve PDF rendering.`), this.removeNativeFontFace(w);
                  }
                  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.systemFontInfo);
                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 u = l.createFontFaceRule();
              if (u) {
                if (this.insertRule(u), this.isSyncFontLoadingSupported)
                  return;
                await new Promise((h) => {
                  const d = this._queueLoadingCallback(h);
                  this._prepareFontLoadEvent(l, d);
                });
              }
            }
            get isFontLoadingAPISupported() {
              var u;
              const l = !!((u = this._document) != null && u.fonts);
              return (0, n.shadow)(this, "isFontLoadingAPISupported", l);
            }
            get isSyncFontLoadingSupported() {
              let l = !1;
              return (n.isNodeJS || typeof navigator < "u" && /Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent)) && (l = !0), (0, n.shadow)(this, "isSyncFontLoadingSupported", l);
            }
            _queueLoadingCallback(l) {
              function u() {
                for ((0, n.assert)(!d.done, "completeRequest() cannot be called twice."), d.done = !0; h.length > 0 && h[0].done; ) {
                  const w = h.shift();
                  setTimeout(w.callback, 0);
                }
              }
              const {
                loadingRequests: h
              } = this, d = {
                done: !1,
                complete: u,
                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, u) {
              function h(P, I) {
                return P.charCodeAt(I) << 24 | P.charCodeAt(I + 1) << 16 | P.charCodeAt(I + 2) << 8 | P.charCodeAt(I + 3) & 255;
              }
              function d(P, I, G, ne) {
                const X = P.substring(0, I), ee = P.substring(I + G);
                return X + ne + ee;
              }
              let w, b;
              const _ = this._document.createElement("canvas");
              _.width = 1, _.height = 1;
              const R = _.getContext("2d");
              let k = 0;
              function C(P, I) {
                if (++k > 30) {
                  (0, n.warn)("Load test font never loaded."), I();
                  return;
                }
                if (R.font = "30px " + P, R.fillText(".", 0, 20), R.getImageData(0, 0, 1, 1).data[3] > 0) {
                  I();
                  return;
                }
                setTimeout(C.bind(null, P, I));
              }
              const m = `lt${Date.now()}${this.loadTestFontId++}`;
              let A = this._loadTestFont;
              A = d(A, 976, m.length, m);
              const f = 16, g = 1482184792;
              let y = h(A, f);
              for (w = 0, b = m.length - 3; w < b; w += 4)
                y = y - g + h(m, w) | 0;
              w < m.length && (y = y - g + h(m + "XXX", w) | 0), A = d(A, f, 4, (0, n.string32)(y));
              const E = `url(data:font/opentype;base64,${btoa(A)});`, x = `@font-face {font-family:"${m}";src:${E}}`;
              this.insertRule(x);
              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 P of [l.loadedName, m]) {
                const I = this._document.createElement("span");
                I.textContent = "Hi", I.style.fontFamily = P, O.append(I);
              }
              this._document.body.append(O), C(m, () => {
                O.remove(), u.complete();
              });
            }
          }
          o = new WeakMap(), e.FontLoader = a;
          class s {
            constructor(l, {
              isEvalSupported: u = !0,
              disableFontFace: h = !1,
              ignoreErrors: d = !1,
              inspectFont: w = null
            }) {
              this.compiledGlyphs = /* @__PURE__ */ Object.create(null);
              for (const b in l)
                this[b] = l[b];
              this.isEvalSupported = u !== !1, this.disableFontFace = h === !0, this.ignoreErrors = d === !0, this._inspectFont = w;
            }
            createNativeFontFace() {
              var u;
              if (!this.data || this.disableFontFace)
                return null;
              let l;
              if (!this.cssFontInfo)
                l = new FontFace(this.loadedName, this.data, {});
              else {
                const h = {
                  weight: this.cssFontInfo.fontWeight
                };
                this.cssFontInfo.italicAngle && (h.style = `oblique ${this.cssFontInfo.italicAngle}deg`), l = new FontFace(this.cssFontInfo.fontFamily, this.data, h);
              }
              return (u = this._inspectFont) == null || u.call(this, this), l;
            }
            createFontFaceRule() {
              var d;
              if (!this.data || this.disableFontFace)
                return null;
              const l = (0, n.bytesToString)(this.data), u = `url(data:${this.mimetype};base64,${btoa(l)});`;
              let h;
              if (!this.cssFontInfo)
                h = `@font-face {font-family:"${this.loadedName}";src:${u}}`;
              else {
                let w = `font-weight: ${this.cssFontInfo.fontWeight};`;
                this.cssFontInfo.italicAngle && (w += `font-style: oblique ${this.cssFontInfo.italicAngle}deg;`), h = `@font-face {font-family:"${this.cssFontInfo.fontFamily}";${w}src:${u}}`;
              }
              return (d = this._inspectFont) == null || d.call(this, this, u), h;
            }
            getPathGenerator(l, u) {
              if (this.compiledGlyphs[u] !== void 0)
                return this.compiledGlyphs[u];
              let h;
              try {
                h = l.get(this.loadedName + "_path_" + u);
              } catch (d) {
                if (!this.ignoreErrors)
                  throw d;
                return (0, n.warn)(`getPathGenerator - ignoring character: "${d}".`), this.compiledGlyphs[u] = function(w, b) {
                };
              }
              if (this.isEvalSupported && n.FeatureTest.isEvalSupported) {
                const d = [];
                for (const w of h) {
                  const b = w.args !== void 0 ? w.args.join(",") : "";
                  d.push("c.", w.cmd, "(", b, `);
`);
                }
                return this.compiledGlyphs[u] = new Function("c", "size", d.join(""));
              }
              return this.compiledGlyphs[u] = function(d, w) {
                for (const b of h)
                  b.cmd === "scale" && (b.args = [w, -w]), d[b.cmd].apply(d, b.args);
              };
            }
          }
          e.FontFaceObject = s;
        },
        /* 10 */
        /***/
        (r, e, t) => {
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.NodeStandardFontDataFactory = e.NodeFilterFactory = e.NodeCanvasFactory = e.NodeCMapReaderFactory = void 0;
          var n = t(7);
          t(1);
          const a = function(u) {
            return new Promise((h, d) => {
              require$$5.readFile(u, (b, _) => {
                if (b || !_) {
                  d(new Error(b));
                  return;
                }
                h(new Uint8Array(_));
              });
            });
          };
          class s extends n.BaseFilterFactory {
          }
          e.NodeFilterFactory = s;
          class o extends n.BaseCanvasFactory {
            _createCanvas(h, d) {
              return require$$5.createCanvas(h, d);
            }
          }
          e.NodeCanvasFactory = o;
          class c extends n.BaseCMapReaderFactory {
            _fetchData(h, d) {
              return a(h).then((w) => ({
                cMapData: w,
                compressionType: d
              }));
            }
          }
          e.NodeCMapReaderFactory = c;
          class l extends n.BaseStandardFontDataFactory {
            _fetchData(h) {
              return a(h);
            }
          }
          e.NodeStandardFontDataFactory = l;
        },
        /* 11 */
        /***/
        (r, e, t) => {
          var se, on, ln;
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.CanvasGraphics = void 0;
          var n = t(1), a = t(6), s = t(12), o = t(13);
          const c = 16, l = 100, u = 4096, h = 15, d = 10, w = 1e3, b = 16;
          function _(N, M) {
            if (N._removeMirroring)
              throw new Error("Context is already forwarding operations.");
            N.__originalSave = N.save, N.__originalRestore = N.restore, N.__originalRotate = N.rotate, N.__originalScale = N.scale, N.__originalTranslate = N.translate, N.__originalTransform = N.transform, N.__originalSetTransform = N.setTransform, N.__originalResetTransform = N.resetTransform, N.__originalClip = N.clip, N.__originalMoveTo = N.moveTo, N.__originalLineTo = N.lineTo, N.__originalBezierCurveTo = N.bezierCurveTo, N.__originalRect = N.rect, N.__originalClosePath = N.closePath, N.__originalBeginPath = N.beginPath, N._removeMirroring = () => {
              N.save = N.__originalSave, N.restore = N.__originalRestore, N.rotate = N.__originalRotate, N.scale = N.__originalScale, N.translate = N.__originalTranslate, N.transform = N.__originalTransform, N.setTransform = N.__originalSetTransform, N.resetTransform = N.__originalResetTransform, N.clip = N.__originalClip, N.moveTo = N.__originalMoveTo, N.lineTo = N.__originalLineTo, N.bezierCurveTo = N.__originalBezierCurveTo, N.rect = N.__originalRect, N.closePath = N.__originalClosePath, N.beginPath = N.__originalBeginPath, delete N._removeMirroring;
            }, N.save = function() {
              M.save(), this.__originalSave();
            }, N.restore = function() {
              M.restore(), this.__originalRestore();
            }, N.translate = function(L, H) {
              M.translate(L, H), this.__originalTranslate(L, H);
            }, N.scale = function(L, H) {
              M.scale(L, H), this.__originalScale(L, H);
            }, N.transform = function(L, H, B, U, Z, re) {
              M.transform(L, H, B, U, Z, re), this.__originalTransform(L, H, B, U, Z, re);
            }, N.setTransform = function(L, H, B, U, Z, re) {
              M.setTransform(L, H, B, U, Z, re), this.__originalSetTransform(L, H, B, U, Z, re);
            }, N.resetTransform = function() {
              M.resetTransform(), this.__originalResetTransform();
            }, N.rotate = function(L) {
              M.rotate(L), this.__originalRotate(L);
            }, N.clip = function(L) {
              M.clip(L), this.__originalClip(L);
            }, N.moveTo = function(v, L) {
              M.moveTo(v, L), this.__originalMoveTo(v, L);
            }, N.lineTo = function(v, L) {
              M.lineTo(v, L), this.__originalLineTo(v, L);
            }, N.bezierCurveTo = function(v, L, H, B, U, Z) {
              M.bezierCurveTo(v, L, H, B, U, Z), this.__originalBezierCurveTo(v, L, H, B, U, Z);
            }, N.rect = function(v, L, H, B) {
              M.rect(v, L, H, B), this.__originalRect(v, L, H, B);
            }, N.closePath = function() {
              M.closePath(), this.__originalClosePath();
            }, N.beginPath = function() {
              M.beginPath(), this.__originalBeginPath();
            };
          }
          class R {
            constructor(M) {
              this.canvasFactory = M, this.cache = /* @__PURE__ */ Object.create(null);
            }
            getCanvas(M, v, L) {
              let H;
              return this.cache[M] !== void 0 ? (H = this.cache[M], this.canvasFactory.reset(H, v, L)) : (H = this.canvasFactory.create(v, L), this.cache[M] = H), H;
            }
            delete(M) {
              delete this.cache[M];
            }
            clear() {
              for (const M in this.cache) {
                const v = this.cache[M];
                this.canvasFactory.destroy(v), delete this.cache[M];
              }
            }
          }
          function k(N, M, v, L, H, B, U, Z, re, pe) {
            const [be, Se, _e, we, oe, le] = (0, a.getCurrentTransform)(N);
            if (Se === 0 && _e === 0) {
              const ae = U * be + oe, ue = Math.round(ae), Ae = Z * we + le, Te = Math.round(Ae), ke = (U + re) * be + oe, ie = Math.abs(Math.round(ke) - ue) || 1, Fe = (Z + pe) * we + le, De = Math.abs(Math.round(Fe) - Te) || 1;
              return N.setTransform(Math.sign(be), 0, 0, Math.sign(we), ue, Te), N.drawImage(M, v, L, H, B, 0, 0, ie, De), N.setTransform(be, Se, _e, we, oe, le), [ie, De];
            }
            if (be === 0 && we === 0) {
              const ae = Z * _e + oe, ue = Math.round(ae), Ae = U * Se + le, Te = Math.round(Ae), ke = (Z + pe) * _e + oe, ie = Math.abs(Math.round(ke) - ue) || 1, Fe = (U + re) * Se + le, De = Math.abs(Math.round(Fe) - Te) || 1;
              return N.setTransform(0, Math.sign(Se), Math.sign(_e), 0, ue, Te), N.drawImage(M, v, L, H, B, 0, 0, De, ie), N.setTransform(be, Se, _e, we, oe, le), [De, ie];
            }
            N.drawImage(M, v, L, H, B, U, Z, re, pe);
            const $ = Math.hypot(be, Se), j = Math.hypot(_e, we);
            return [$ * re, j * pe];
          }
          function C(N) {
            const {
              width: M,
              height: v
            } = N;
            if (M > w || v > w)
              return null;
            const L = 1e3, H = new Uint8Array([0, 2, 4, 0, 1, 0, 5, 4, 8, 10, 0, 8, 0, 2, 1, 0]), B = M + 1;
            let U = new Uint8Array(B * (v + 1)), Z, re, pe;
            const be = M + 7 & -8;
            let Se = new Uint8Array(be * v), _e = 0;
            for (const j of N.data) {
              let ae = 128;
              for (; ae > 0; )
                Se[_e++] = j & ae ? 0 : 255, ae >>= 1;
            }
            let we = 0;
            for (_e = 0, Se[_e] !== 0 && (U[0] = 1, ++we), re = 1; re < M; re++)
              Se[_e] !== Se[_e + 1] && (U[re] = Se[_e] ? 2 : 1, ++we), _e++;
            for (Se[_e] !== 0 && (U[re] = 2, ++we), Z = 1; Z < v; Z++) {
              _e = Z * be, pe = Z * B, Se[_e - be] !== Se[_e] && (U[pe] = Se[_e] ? 1 : 8, ++we);
              let j = (Se[_e] ? 4 : 0) + (Se[_e - be] ? 8 : 0);
              for (re = 1; re < M; re++)
                j = (j >> 2) + (Se[_e + 1] ? 4 : 0) + (Se[_e - be + 1] ? 8 : 0), H[j] && (U[pe + re] = H[j], ++we), _e++;
              if (Se[_e - be] !== Se[_e] && (U[pe + re] = Se[_e] ? 2 : 4, ++we), we > L)
                return null;
            }
            for (_e = be * (v - 1), pe = Z * B, Se[_e] !== 0 && (U[pe] = 8, ++we), re = 1; re < M; re++)
              Se[_e] !== Se[_e + 1] && (U[pe + re] = Se[_e] ? 4 : 8, ++we), _e++;
            if (Se[_e] !== 0 && (U[pe + re] = 4, ++we), we > L)
              return null;
            const oe = new Int32Array([0, B, -1, 0, -B, 0, 0, 0, 1]), le = new Path2D();
            for (Z = 0; we && Z <= v; Z++) {
              let j = Z * B;
              const ae = j + M;
              for (; j < ae && !U[j]; )
                j++;
              if (j === ae)
                continue;
              le.moveTo(j % B, Z);
              const ue = j;
              let Ae = U[j];
              do {
                const Te = oe[Ae];
                do
                  j += Te;
                while (!U[j]);
                const ke = U[j];
                ke !== 5 && ke !== 10 ? (Ae = ke, U[j] = 0) : (Ae = ke & 51 * Ae >> 4, U[j] &= Ae >> 2 | Ae << 2), le.lineTo(j % B, j / B | 0), U[j] || --we;
              } while (ue !== j);
              --Z;
            }
            return Se = null, U = null, function(j) {
              j.save(), j.scale(1 / M, -1 / v), j.translate(0, -v), j.fill(le), j.beginPath(), j.restore();
            };
          }
          class m {
            constructor(M, v) {
              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, M, v]);
            }
            clone() {
              const M = Object.create(this);
              return M.clipBox = this.clipBox.slice(), M;
            }
            setCurrentPoint(M, v) {
              this.x = M, this.y = v;
            }
            updatePathMinMax(M, v, L) {
              [v, L] = n.Util.applyTransform([v, L], M), this.minX = Math.min(this.minX, v), this.minY = Math.min(this.minY, L), this.maxX = Math.max(this.maxX, v), this.maxY = Math.max(this.maxY, L);
            }
            updateRectMinMax(M, v) {
              const L = n.Util.applyTransform(v, M), H = n.Util.applyTransform(v.slice(2), M);
              this.minX = Math.min(this.minX, L[0], H[0]), this.minY = Math.min(this.minY, L[1], H[1]), this.maxX = Math.max(this.maxX, L[0], H[0]), this.maxY = Math.max(this.maxY, L[1], H[1]);
            }
            updateScalingPathMinMax(M, v) {
              n.Util.scaleMinMax(M, v), this.minX = Math.min(this.minX, v[0]), this.maxX = Math.max(this.maxX, v[1]), this.minY = Math.min(this.minY, v[2]), this.maxY = Math.max(this.maxY, v[3]);
            }
            updateCurvePathMinMax(M, v, L, H, B, U, Z, re, pe, be) {
              const Se = n.Util.bezierBoundingBox(v, L, H, B, U, Z, re, pe);
              if (be) {
                be[0] = Math.min(be[0], Se[0], Se[2]), be[1] = Math.max(be[1], Se[0], Se[2]), be[2] = Math.min(be[2], Se[1], Se[3]), be[3] = Math.max(be[3], Se[1], Se[3]);
                return;
              }
              this.updateRectMinMax(M, Se);
            }
            getPathBoundingBox(M = s.PathType.FILL, v = null) {
              const L = [this.minX, this.minY, this.maxX, this.maxY];
              if (M === s.PathType.STROKE) {
                v || (0, n.unreachable)("Stroke bounding box must include transform.");
                const H = n.Util.singularValueDecompose2dScale(v), B = H[0] * this.lineWidth / 2, U = H[1] * this.lineWidth / 2;
                L[0] -= B, L[1] -= U, L[2] += B, L[3] += U;
              }
              return L;
            }
            updateClipFromPath() {
              const M = n.Util.intersect(this.clipBox, this.getPathBoundingBox());
              this.startNewPathAndClipBox(M || [0, 0, 0, 0]);
            }
            isEmptyClip() {
              return this.minX === 1 / 0;
            }
            startNewPathAndClipBox(M) {
              this.clipBox = M, this.minX = 1 / 0, this.minY = 1 / 0, this.maxX = 0, this.maxY = 0;
            }
            getClippedPathBoundingBox(M = s.PathType.FILL, v = null) {
              return n.Util.intersect(this.clipBox, this.getPathBoundingBox(M, v));
            }
          }
          function A(N, M) {
            if (typeof ImageData < "u" && M instanceof ImageData) {
              N.putImageData(M, 0, 0);
              return;
            }
            const v = M.height, L = M.width, H = v % b, B = (v - H) / b, U = H === 0 ? B : B + 1, Z = N.createImageData(L, b);
            let re = 0, pe;
            const be = M.data, Se = Z.data;
            let _e, we, oe, le;
            if (M.kind === n.ImageKind.GRAYSCALE_1BPP) {
              const $ = be.byteLength, j = new Uint32Array(Se.buffer, 0, Se.byteLength >> 2), ae = j.length, ue = L + 7 >> 3, Ae = 4294967295, Te = n.FeatureTest.isLittleEndian ? 4278190080 : 255;
              for (_e = 0; _e < U; _e++) {
                for (oe = _e < B ? b : H, pe = 0, we = 0; we < oe; we++) {
                  const ke = $ - re;
                  let ie = 0;
                  const Fe = ke > ue ? L : ke * 8 - 7, De = Fe & -8;
                  let Xe = 0, je = 0;
                  for (; ie < De; ie += 8)
                    je = be[re++], j[pe++] = je & 128 ? Ae : Te, j[pe++] = je & 64 ? Ae : Te, j[pe++] = je & 32 ? Ae : Te, j[pe++] = je & 16 ? Ae : Te, j[pe++] = je & 8 ? Ae : Te, j[pe++] = je & 4 ? Ae : Te, j[pe++] = je & 2 ? Ae : Te, j[pe++] = je & 1 ? Ae : Te;
                  for (; ie < Fe; ie++)
                    Xe === 0 && (je = be[re++], Xe = 128), j[pe++] = je & Xe ? Ae : Te, Xe >>= 1;
                }
                for (; pe < ae; )
                  j[pe++] = 0;
                N.putImageData(Z, 0, _e * b);
              }
            } else if (M.kind === n.ImageKind.RGBA_32BPP) {
              for (we = 0, le = L * b * 4, _e = 0; _e < B; _e++)
                Se.set(be.subarray(re, re + le)), re += le, N.putImageData(Z, 0, we), we += b;
              _e < U && (le = L * H * 4, Se.set(be.subarray(re, re + le)), N.putImageData(Z, 0, we));
            } else if (M.kind === n.ImageKind.RGB_24BPP)
              for (oe = b, le = L * oe, _e = 0; _e < U; _e++) {
                for (_e >= B && (oe = H, le = L * oe), pe = 0, we = le; we--; )
                  Se[pe++] = be[re++], Se[pe++] = be[re++], Se[pe++] = be[re++], Se[pe++] = 255;
                N.putImageData(Z, 0, _e * b);
              }
            else
              throw new Error(`bad image kind: ${M.kind}`);
          }
          function F(N, M) {
            if (M.bitmap) {
              N.drawImage(M.bitmap, 0, 0);
              return;
            }
            const v = M.height, L = M.width, H = v % b, B = (v - H) / b, U = H === 0 ? B : B + 1, Z = N.createImageData(L, b);
            let re = 0;
            const pe = M.data, be = Z.data;
            for (let Se = 0; Se < U; Se++) {
              const _e = Se < B ? b : H;
              ({
                srcPos: re
              } = (0, o.convertBlackAndWhiteToRGBA)({
                src: pe,
                srcPos: re,
                dest: be,
                width: L,
                height: _e,
                nonBlackColor: 0
              })), N.putImageData(Z, 0, Se * b);
            }
          }
          function f(N, M) {
            const v = ["strokeStyle", "fillStyle", "fillRule", "globalAlpha", "lineWidth", "lineCap", "lineJoin", "miterLimit", "globalCompositeOperation", "font", "filter"];
            for (const L of v)
              N[L] !== void 0 && (M[L] = N[L]);
            N.setLineDash !== void 0 && (M.setLineDash(N.getLineDash()), M.lineDashOffset = N.lineDashOffset);
          }
          function g(N) {
            if (N.strokeStyle = N.fillStyle = "#000000", N.fillRule = "nonzero", N.globalAlpha = 1, N.lineWidth = 1, N.lineCap = "butt", N.lineJoin = "miter", N.miterLimit = 10, N.globalCompositeOperation = "source-over", N.font = "10px sans-serif", N.setLineDash !== void 0 && (N.setLineDash([]), N.lineDashOffset = 0), !n.isNodeJS) {
              const {
                filter: M
              } = N;
              M !== "none" && M !== "" && (N.filter = "none");
            }
          }
          function y(N, M, v, L) {
            const H = N.length;
            for (let B = 3; B < H; B += 4) {
              const U = N[B];
              if (U === 0)
                N[B - 3] = M, N[B - 2] = v, N[B - 1] = L;
              else if (U < 255) {
                const Z = 255 - U;
                N[B - 3] = N[B - 3] * U + M * Z >> 8, N[B - 2] = N[B - 2] * U + v * Z >> 8, N[B - 1] = N[B - 1] * U + L * Z >> 8;
              }
            }
          }
          function E(N, M, v) {
            const L = N.length, H = 1 / 255;
            for (let B = 3; B < L; B += 4) {
              const U = v ? v[N[B]] : N[B];
              M[B] = M[B] * U * H | 0;
            }
          }
          function x(N, M, v) {
            const L = N.length;
            for (let H = 3; H < L; H += 4) {
              const B = N[H - 3] * 77 + N[H - 2] * 152 + N[H - 1] * 28;
              M[H] = v ? M[H] * v[B >> 8] >> 8 : M[H] * B >> 16;
            }
          }
          function O(N, M, v, L, H, B, U, Z, re, pe, be) {
            const Se = !!B, _e = Se ? B[0] : 0, we = Se ? B[1] : 0, oe = Se ? B[2] : 0, le = H === "Luminosity" ? x : E, j = Math.min(L, Math.ceil(1048576 / v));
            for (let ae = 0; ae < L; ae += j) {
              const ue = Math.min(j, L - ae), Ae = N.getImageData(Z - pe, ae + (re - be), v, ue), Te = M.getImageData(Z, ae + re, v, ue);
              Se && y(Ae.data, _e, we, oe), le(Ae.data, Te.data, U), M.putImageData(Te, Z, ae + re);
            }
          }
          function P(N, M, v, L) {
            const H = L[0], B = L[1], U = L[2] - H, Z = L[3] - B;
            U === 0 || Z === 0 || (O(M.context, v, U, Z, M.subtype, M.backdrop, M.transferMap, H, B, M.offsetX, M.offsetY), N.save(), N.globalAlpha = 1, N.globalCompositeOperation = "source-over", N.setTransform(1, 0, 0, 1, 0, 0), N.drawImage(v.canvas, 0, 0), N.restore());
          }
          function I(N, M) {
            const v = n.Util.singularValueDecompose2dScale(N);
            v[0] = Math.fround(v[0]), v[1] = Math.fround(v[1]);
            const L = Math.fround((globalThis.devicePixelRatio || 1) * a.PixelsPerInch.PDF_TO_CSS_UNITS);
            return M !== void 0 ? M : v[0] <= L || v[1] <= L;
          }
          const G = ["butt", "round", "square"], ne = ["miter", "round", "bevel"], X = {}, ee = {}, J = class J {
            constructor(M, v, L, H, B, {
              optionalContentConfig: U,
              markedContentStack: Z = null
            }, re, pe) {
              de(this, se);
              this.ctx = M, this.current = new m(this.ctx.canvas.width, this.ctx.canvas.height), this.stateStack = [], this.pendingClip = null, this.pendingEOFill = !1, this.res = null, this.xobjs = null, this.commonObjs = v, this.objs = L, this.canvasFactory = H, this.filterFactory = B, 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 = Z || [], this.optionalContentConfig = U, this.cachedCanvases = new R(this.canvasFactory), this.cachedPatterns = /* @__PURE__ */ new Map(), this.annotationCanvasMap = re, this.viewportScale = 1, this.outputScaleX = 1, this.outputScaleY = 1, this.pageColors = pe, this._cachedScaleForStroking = [-1, 0], this._cachedGetSinglePixelWidth = null, this._cachedBitmapsMap = /* @__PURE__ */ new Map();
            }
            getObject(M, v = null) {
              return typeof M == "string" ? M.startsWith("g_") ? this.commonObjs.get(M) : this.objs.get(M) : v;
            }
            beginDrawing({
              transform: M,
              viewport: v,
              transparency: L = !1,
              background: H = null
            }) {
              const B = this.ctx.canvas.width, U = this.ctx.canvas.height, Z = this.ctx.fillStyle;
              if (this.ctx.fillStyle = H || "#ffffff", this.ctx.fillRect(0, 0, B, U), this.ctx.fillStyle = Z, L) {
                const re = this.cachedCanvases.getCanvas("transparent", B, U);
                this.compositeCtx = this.ctx, this.transparentCanvas = re.canvas, this.ctx = re.context, this.ctx.save(), this.ctx.transform(...(0, a.getCurrentTransform)(this.compositeCtx));
              }
              this.ctx.save(), g(this.ctx), M && (this.ctx.transform(...M), this.outputScaleX = M[0], this.outputScaleY = M[0]), this.ctx.transform(...v.transform), this.viewportScale = v.scale, this.baseTransform = (0, a.getCurrentTransform)(this.ctx);
            }
            executeOperatorList(M, v, L, H) {
              const B = M.argsArray, U = M.fnArray;
              let Z = v || 0;
              const re = B.length;
              if (re === Z)
                return Z;
              const pe = re - Z > d && typeof L == "function", be = pe ? Date.now() + h : 0;
              let Se = 0;
              const _e = this.commonObjs, we = this.objs;
              let oe;
              for (; ; ) {
                if (H !== void 0 && Z === H.nextBreakPoint)
                  return H.breakIt(Z, L), Z;
                if (oe = U[Z], oe !== n.OPS.dependency)
                  this[oe].apply(this, B[Z]);
                else
                  for (const le of B[Z]) {
                    const $ = le.startsWith("g_") ? _e : we;
                    if (!$.has(le))
                      return $.get(le, L), Z;
                  }
                if (Z++, Z === re)
                  return Z;
                if (pe && ++Se > d) {
                  if (Date.now() > be)
                    return L(), Z;
                  Se = 0;
                }
              }
            }
            endDrawing() {
              te(this, se, on).call(this), this.cachedCanvases.clear(), this.cachedPatterns.clear();
              for (const M of this._cachedBitmapsMap.values()) {
                for (const v of M.values())
                  typeof HTMLCanvasElement < "u" && v instanceof HTMLCanvasElement && (v.width = v.height = 0);
                M.clear();
              }
              this._cachedBitmapsMap.clear(), te(this, se, ln).call(this);
            }
            _scaleImage(M, v) {
              const L = M.width, H = M.height;
              let B = Math.max(Math.hypot(v[0], v[1]), 1), U = Math.max(Math.hypot(v[2], v[3]), 1), Z = L, re = H, pe = "prescale1", be, Se;
              for (; B > 2 && Z > 1 || U > 2 && re > 1; ) {
                let _e = Z, we = re;
                B > 2 && Z > 1 && (_e = Z >= 16384 ? Math.floor(Z / 2) - 1 || 1 : Math.ceil(Z / 2), B /= Z / _e), U > 2 && re > 1 && (we = re >= 16384 ? Math.floor(re / 2) - 1 || 1 : Math.ceil(re) / 2, U /= re / we), be = this.cachedCanvases.getCanvas(pe, _e, we), Se = be.context, Se.clearRect(0, 0, _e, we), Se.drawImage(M, 0, 0, Z, re, 0, 0, _e, we), M = be.canvas, Z = _e, re = we, pe = pe === "prescale1" ? "prescale2" : "prescale1";
              }
              return {
                img: M,
                paintWidth: Z,
                paintHeight: re
              };
            }
            _createMaskCanvas(M) {
              const v = this.ctx, {
                width: L,
                height: H
              } = M, B = this.current.fillColor, U = this.current.patternFill, Z = (0, a.getCurrentTransform)(v);
              let re, pe, be, Se;
              if ((M.bitmap || M.data) && M.count > 1) {
                const ie = M.bitmap || M.data.buffer;
                pe = JSON.stringify(U ? Z : [Z.slice(0, 4), B]), re = this._cachedBitmapsMap.get(ie), re || (re = /* @__PURE__ */ new Map(), this._cachedBitmapsMap.set(ie, re));
                const Fe = re.get(pe);
                if (Fe && !U) {
                  const De = Math.round(Math.min(Z[0], Z[2]) + Z[4]), Xe = Math.round(Math.min(Z[1], Z[3]) + Z[5]);
                  return {
                    canvas: Fe,
                    offsetX: De,
                    offsetY: Xe
                  };
                }
                be = Fe;
              }
              be || (Se = this.cachedCanvases.getCanvas("maskCanvas", L, H), F(Se.context, M));
              let _e = n.Util.transform(Z, [1 / L, 0, 0, -1 / H, 0, 0]);
              _e = n.Util.transform(_e, [1, 0, 0, 1, 0, -H]);
              const we = n.Util.applyTransform([0, 0], _e), oe = n.Util.applyTransform([L, H], _e), le = n.Util.normalizeRect([we[0], we[1], oe[0], oe[1]]), $ = Math.round(le[2] - le[0]) || 1, j = Math.round(le[3] - le[1]) || 1, ae = this.cachedCanvases.getCanvas("fillCanvas", $, j), ue = ae.context, Ae = Math.min(we[0], oe[0]), Te = Math.min(we[1], oe[1]);
              ue.translate(-Ae, -Te), ue.transform(..._e), be || (be = this._scaleImage(Se.canvas, (0, a.getCurrentTransformInverse)(ue)), be = be.img, re && U && re.set(pe, be)), ue.imageSmoothingEnabled = I((0, a.getCurrentTransform)(ue), M.interpolate), k(ue, be, 0, 0, be.width, be.height, 0, 0, L, H), ue.globalCompositeOperation = "source-in";
              const ke = n.Util.transform((0, a.getCurrentTransformInverse)(ue), [1, 0, 0, 1, -Ae, -Te]);
              return ue.fillStyle = U ? B.getPattern(v, this, ke, s.PathType.FILL) : B, ue.fillRect(0, 0, L, H), re && !U && (this.cachedCanvases.delete("fillCanvas"), re.set(pe, ae.canvas)), {
                canvas: ae.canvas,
                offsetX: Math.round(Ae),
                offsetY: Math.round(Te)
              };
            }
            setLineWidth(M) {
              M !== this.current.lineWidth && (this._cachedScaleForStroking[0] = -1), this.current.lineWidth = M, this.ctx.lineWidth = M;
            }
            setLineCap(M) {
              this.ctx.lineCap = G[M];
            }
            setLineJoin(M) {
              this.ctx.lineJoin = ne[M];
            }
            setMiterLimit(M) {
              this.ctx.miterLimit = M;
            }
            setDash(M, v) {
              const L = this.ctx;
              L.setLineDash !== void 0 && (L.setLineDash(M), L.lineDashOffset = v);
            }
            setRenderingIntent(M) {
            }
            setFlatness(M) {
            }
            setGState(M) {
              for (const [v, L] of M)
                switch (v) {
                  case "LW":
                    this.setLineWidth(L);
                    break;
                  case "LC":
                    this.setLineCap(L);
                    break;
                  case "LJ":
                    this.setLineJoin(L);
                    break;
                  case "ML":
                    this.setMiterLimit(L);
                    break;
                  case "D":
                    this.setDash(L[0], L[1]);
                    break;
                  case "RI":
                    this.setRenderingIntent(L);
                    break;
                  case "FL":
                    this.setFlatness(L);
                    break;
                  case "Font":
                    this.setFont(L[0], L[1]);
                    break;
                  case "CA":
                    this.current.strokeAlpha = L;
                    break;
                  case "ca":
                    this.current.fillAlpha = L, this.ctx.globalAlpha = L;
                    break;
                  case "BM":
                    this.ctx.globalCompositeOperation = L;
                    break;
                  case "SMask":
                    this.current.activeSMask = L ? this.tempSMask : null, this.tempSMask = null, this.checkSMaskState();
                    break;
                  case "TR":
                    this.ctx.filter = this.current.transferMaps = this.filterFactory.addFilter(L);
                    break;
                }
            }
            get inSMaskMode() {
              return !!this.suspendedCtx;
            }
            checkSMaskState() {
              const M = this.inSMaskMode;
              this.current.activeSMask && !M ? this.beginSMaskMode() : !this.current.activeSMask && M && this.endSMaskMode();
            }
            beginSMaskMode() {
              if (this.inSMaskMode)
                throw new Error("beginSMaskMode called while already in smask mode");
              const M = this.ctx.canvas.width, v = this.ctx.canvas.height, L = "smaskGroupAt" + this.groupLevel, H = this.cachedCanvases.getCanvas(L, M, v);
              this.suspendedCtx = this.ctx, this.ctx = H.context;
              const B = this.ctx;
              B.setTransform(...(0, a.getCurrentTransform)(this.suspendedCtx)), f(this.suspendedCtx, B), _(B, 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(), f(this.ctx, this.suspendedCtx), this.ctx = this.suspendedCtx, this.suspendedCtx = null;
            }
            compose(M) {
              if (!this.current.activeSMask)
                return;
              M ? (M[0] = Math.floor(M[0]), M[1] = Math.floor(M[1]), M[2] = Math.ceil(M[2]), M[3] = Math.ceil(M[3])) : M = [0, 0, this.ctx.canvas.width, this.ctx.canvas.height];
              const v = this.current.activeSMask, L = this.suspendedCtx;
              P(L, v, this.ctx, M), 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 ? (f(this.ctx, this.suspendedCtx), this.suspendedCtx.save()) : this.ctx.save();
              const M = this.current;
              this.stateStack.push(M), this.current = M.clone();
            }
            restore() {
              this.stateStack.length === 0 && this.inSMaskMode && this.endSMaskMode(), this.stateStack.length !== 0 && (this.current = this.stateStack.pop(), this.inSMaskMode ? (this.suspendedCtx.restore(), f(this.suspendedCtx, this.ctx)) : this.ctx.restore(), this.checkSMaskState(), this.pendingClip = null, this._cachedScaleForStroking[0] = -1, this._cachedGetSinglePixelWidth = null);
            }
            transform(M, v, L, H, B, U) {
              this.ctx.transform(M, v, L, H, B, U), this._cachedScaleForStroking[0] = -1, this._cachedGetSinglePixelWidth = null;
            }
            constructPath(M, v, L) {
              const H = this.ctx, B = this.current;
              let U = B.x, Z = B.y, re, pe;
              const be = (0, a.getCurrentTransform)(H), Se = be[0] === 0 && be[3] === 0 || be[1] === 0 && be[2] === 0, _e = Se ? L.slice(0) : null;
              for (let we = 0, oe = 0, le = M.length; we < le; we++)
                switch (M[we] | 0) {
                  case n.OPS.rectangle:
                    U = v[oe++], Z = v[oe++];
                    const $ = v[oe++], j = v[oe++], ae = U + $, ue = Z + j;
                    H.moveTo(U, Z), $ === 0 || j === 0 ? H.lineTo(ae, ue) : (H.lineTo(ae, Z), H.lineTo(ae, ue), H.lineTo(U, ue)), Se || B.updateRectMinMax(be, [U, Z, ae, ue]), H.closePath();
                    break;
                  case n.OPS.moveTo:
                    U = v[oe++], Z = v[oe++], H.moveTo(U, Z), Se || B.updatePathMinMax(be, U, Z);
                    break;
                  case n.OPS.lineTo:
                    U = v[oe++], Z = v[oe++], H.lineTo(U, Z), Se || B.updatePathMinMax(be, U, Z);
                    break;
                  case n.OPS.curveTo:
                    re = U, pe = Z, U = v[oe + 4], Z = v[oe + 5], H.bezierCurveTo(v[oe], v[oe + 1], v[oe + 2], v[oe + 3], U, Z), B.updateCurvePathMinMax(be, re, pe, v[oe], v[oe + 1], v[oe + 2], v[oe + 3], U, Z, _e), oe += 6;
                    break;
                  case n.OPS.curveTo2:
                    re = U, pe = Z, H.bezierCurveTo(U, Z, v[oe], v[oe + 1], v[oe + 2], v[oe + 3]), B.updateCurvePathMinMax(be, re, pe, U, Z, v[oe], v[oe + 1], v[oe + 2], v[oe + 3], _e), U = v[oe + 2], Z = v[oe + 3], oe += 4;
                    break;
                  case n.OPS.curveTo3:
                    re = U, pe = Z, U = v[oe + 2], Z = v[oe + 3], H.bezierCurveTo(v[oe], v[oe + 1], U, Z, U, Z), B.updateCurvePathMinMax(be, re, pe, v[oe], v[oe + 1], U, Z, U, Z, _e), oe += 4;
                    break;
                  case n.OPS.closePath:
                    H.closePath();
                    break;
                }
              Se && B.updateScalingPathMinMax(be, _e), B.setCurrentPoint(U, Z);
            }
            closePath() {
              this.ctx.closePath();
            }
            stroke(M = !0) {
              const v = this.ctx, L = this.current.strokeColor;
              v.globalAlpha = this.current.strokeAlpha, this.contentVisible && (typeof L == "object" && (L != null && L.getPattern) ? (v.save(), v.strokeStyle = L.getPattern(v, this, (0, a.getCurrentTransformInverse)(v), s.PathType.STROKE), this.rescaleAndStroke(!1), v.restore()) : this.rescaleAndStroke(!0)), M && this.consumePath(this.current.getClippedPathBoundingBox()), v.globalAlpha = this.current.fillAlpha;
            }
            closeStroke() {
              this.closePath(), this.stroke();
            }
            fill(M = !0) {
              const v = this.ctx, L = this.current.fillColor, H = this.current.patternFill;
              let B = !1;
              H && (v.save(), v.fillStyle = L.getPattern(v, this, (0, a.getCurrentTransformInverse)(v), s.PathType.FILL), B = !0);
              const U = this.current.getClippedPathBoundingBox();
              this.contentVisible && U !== null && (this.pendingEOFill ? (v.fill("evenodd"), this.pendingEOFill = !1) : v.fill()), B && v.restore(), M && this.consumePath(U);
            }
            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 = X;
            }
            eoClip() {
              this.pendingClip = ee;
            }
            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 M = this.pendingTextPaths, v = this.ctx;
              if (M === void 0) {
                v.beginPath();
                return;
              }
              v.save(), v.beginPath();
              for (const L of M)
                v.setTransform(...L.transform), v.translate(L.x, L.y), L.addToPath(v, L.fontSize);
              v.restore(), v.clip(), v.beginPath(), delete this.pendingTextPaths;
            }
            setCharSpacing(M) {
              this.current.charSpacing = M;
            }
            setWordSpacing(M) {
              this.current.wordSpacing = M;
            }
            setHScale(M) {
              this.current.textHScale = M / 100;
            }
            setLeading(M) {
              this.current.leading = -M;
            }
            setFont(M, v) {
              var be;
              const L = this.commonObjs.get(M), H = this.current;
              if (!L)
                throw new Error(`Can't find font for ${M}`);
              if (H.fontMatrix = L.fontMatrix || n.FONT_IDENTITY_MATRIX, (H.fontMatrix[0] === 0 || H.fontMatrix[3] === 0) && (0, n.warn)("Invalid font matrix for font " + M), v < 0 ? (v = -v, H.fontDirection = -1) : H.fontDirection = 1, this.current.font = L, this.current.fontSize = v, L.isType3Font)
                return;
              const B = L.loadedName || "sans-serif", U = ((be = L.systemFontInfo) == null ? void 0 : be.css) || `"${B}", ${L.fallbackName}`;
              let Z = "normal";
              L.black ? Z = "900" : L.bold && (Z = "bold");
              const re = L.italic ? "italic" : "normal";
              let pe = v;
              v < c ? pe = c : v > l && (pe = l), this.current.fontSizeScale = v / pe, this.ctx.font = `${re} ${Z} ${pe}px ${U}`;
            }
            setTextRenderingMode(M) {
              this.current.textRenderingMode = M;
            }
            setTextRise(M) {
              this.current.textRise = M;
            }
            moveText(M, v) {
              this.current.x = this.current.lineX += M, this.current.y = this.current.lineY += v;
            }
            setLeadingMoveText(M, v) {
              this.setLeading(-v), this.moveText(M, v);
            }
            setTextMatrix(M, v, L, H, B, U) {
              this.current.textMatrix = [M, v, L, H, B, U], this.current.textMatrixScale = Math.hypot(M, v), this.current.x = this.current.lineX = 0, this.current.y = this.current.lineY = 0;
            }
            nextLine() {
              this.moveText(0, this.current.leading);
            }
            paintChar(M, v, L, H) {
              const B = this.ctx, U = this.current, Z = U.font, re = U.textRenderingMode, pe = U.fontSize / U.fontSizeScale, be = re & n.TextRenderingMode.FILL_STROKE_MASK, Se = !!(re & n.TextRenderingMode.ADD_TO_PATH_FLAG), _e = U.patternFill && !Z.missingFile;
              let we;
              (Z.disableFontFace || Se || _e) && (we = Z.getPathGenerator(this.commonObjs, M)), Z.disableFontFace || _e ? (B.save(), B.translate(v, L), B.beginPath(), we(B, pe), H && B.setTransform(...H), (be === n.TextRenderingMode.FILL || be === n.TextRenderingMode.FILL_STROKE) && B.fill(), (be === n.TextRenderingMode.STROKE || be === n.TextRenderingMode.FILL_STROKE) && B.stroke(), B.restore()) : ((be === n.TextRenderingMode.FILL || be === n.TextRenderingMode.FILL_STROKE) && B.fillText(M, v, L), (be === n.TextRenderingMode.STROKE || be === n.TextRenderingMode.FILL_STROKE) && B.strokeText(M, v, L)), Se && (this.pendingTextPaths || (this.pendingTextPaths = [])).push({
                transform: (0, a.getCurrentTransform)(B),
                x: v,
                y: L,
                fontSize: pe,
                addToPath: we
              });
            }
            get isFontSubpixelAAEnabled() {
              const {
                context: M
              } = this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled", 10, 10);
              M.scale(1.5, 1), M.fillText("I", 0, 10);
              const v = M.getImageData(0, 0, 10, 10).data;
              let L = !1;
              for (let H = 3; H < v.length; H += 4)
                if (v[H] > 0 && v[H] < 255) {
                  L = !0;
                  break;
                }
              return (0, n.shadow)(this, "isFontSubpixelAAEnabled", L);
            }
            showText(M) {
              const v = this.current, L = v.font;
              if (L.isType3Font)
                return this.showType3Text(M);
              const H = v.fontSize;
              if (H === 0)
                return;
              const B = this.ctx, U = v.fontSizeScale, Z = v.charSpacing, re = v.wordSpacing, pe = v.fontDirection, be = v.textHScale * pe, Se = M.length, _e = L.vertical, we = _e ? 1 : -1, oe = L.defaultVMetrics, le = H * v.fontMatrix[0], $ = v.textRenderingMode === n.TextRenderingMode.FILL && !L.disableFontFace && !v.patternFill;
              B.save(), B.transform(...v.textMatrix), B.translate(v.x, v.y + v.textRise), pe > 0 ? B.scale(be, -1) : B.scale(be, 1);
              let j;
              if (v.patternFill) {
                B.save();
                const ke = v.fillColor.getPattern(B, this, (0, a.getCurrentTransformInverse)(B), s.PathType.FILL);
                j = (0, a.getCurrentTransform)(B), B.restore(), B.fillStyle = ke;
              }
              let ae = v.lineWidth;
              const ue = v.textMatrixScale;
              if (ue === 0 || ae === 0) {
                const ke = v.textRenderingMode & n.TextRenderingMode.FILL_STROKE_MASK;
                (ke === n.TextRenderingMode.STROKE || ke === n.TextRenderingMode.FILL_STROKE) && (ae = this.getSinglePixelWidth());
              } else
                ae /= ue;
              if (U !== 1 && (B.scale(U, U), ae /= U), B.lineWidth = ae, L.isInvalidPDFjsFont) {
                const ke = [];
                let ie = 0;
                for (const Fe of M)
                  ke.push(Fe.unicode), ie += Fe.width;
                B.fillText(ke.join(""), 0, 0), v.x += ie * le * be, B.restore(), this.compose();
                return;
              }
              let Ae = 0, Te;
              for (Te = 0; Te < Se; ++Te) {
                const ke = M[Te];
                if (typeof ke == "number") {
                  Ae += we * ke * H / 1e3;
                  continue;
                }
                let ie = !1;
                const Fe = (ke.isSpace ? re : 0) + Z, De = ke.fontChar, Xe = ke.accent;
                let je, tt, $e = ke.width;
                if (_e) {
                  const Qe = ke.vmetric || oe, nt = -(ke.vmetric ? Qe[1] : $e * 0.5) * le, xe = Qe[2] * le;
                  $e = Qe ? -Qe[0] : $e, je = nt / U, tt = (Ae + xe) / U;
                } else
                  je = Ae / U, tt = 0;
                if (L.remeasure && $e > 0) {
                  const Qe = B.measureText(De).width * 1e3 / H * U;
                  if ($e < Qe && this.isFontSubpixelAAEnabled) {
                    const nt = $e / Qe;
                    ie = !0, B.save(), B.scale(nt, 1), je /= nt;
                  } else $e !== Qe && (je += ($e - Qe) / 2e3 * H / U);
                }
                if (this.contentVisible && (ke.isInFont || L.missingFile)) {
                  if ($ && !Xe)
                    B.fillText(De, je, tt);
                  else if (this.paintChar(De, je, tt, j), Xe) {
                    const Qe = je + H * Xe.offset.x / U, nt = tt - H * Xe.offset.y / U;
                    this.paintChar(Xe.fontChar, Qe, nt, j);
                  }
                }
                const Ge = _e ? $e * le - Fe * pe : $e * le + Fe * pe;
                Ae += Ge, ie && B.restore();
              }
              _e ? v.y -= Ae : v.x += Ae * be, B.restore(), this.compose();
            }
            showType3Text(M) {
              const v = this.ctx, L = this.current, H = L.font, B = L.fontSize, U = L.fontDirection, Z = H.vertical ? 1 : -1, re = L.charSpacing, pe = L.wordSpacing, be = L.textHScale * U, Se = L.fontMatrix || n.FONT_IDENTITY_MATRIX, _e = M.length, we = L.textRenderingMode === n.TextRenderingMode.INVISIBLE;
              let oe, le, $, j;
              if (!(we || B === 0)) {
                for (this._cachedScaleForStroking[0] = -1, this._cachedGetSinglePixelWidth = null, v.save(), v.transform(...L.textMatrix), v.translate(L.x, L.y), v.scale(be, U), oe = 0; oe < _e; ++oe) {
                  if (le = M[oe], typeof le == "number") {
                    j = Z * le * B / 1e3, this.ctx.translate(j, 0), L.x += j * be;
                    continue;
                  }
                  const ae = (le.isSpace ? pe : 0) + re, ue = H.charProcOperatorList[le.operatorListId];
                  if (!ue) {
                    (0, n.warn)(`Type3 character "${le.operatorListId}" is not available.`);
                    continue;
                  }
                  this.contentVisible && (this.processingType3 = le, this.save(), v.scale(B, B), v.transform(...Se), this.executeOperatorList(ue), this.restore()), $ = n.Util.applyTransform([le.width, 0], Se)[0] * B + ae, v.translate($, 0), L.x += $ * be;
                }
                v.restore(), this.processingType3 = null;
              }
            }
            setCharWidth(M, v) {
            }
            setCharWidthAndBounds(M, v, L, H, B, U) {
              this.ctx.rect(L, H, B - L, U - H), this.ctx.clip(), this.endPath();
            }
            getColorN_Pattern(M) {
              let v;
              if (M[0] === "TilingPattern") {
                const L = M[1], H = this.baseTransform || (0, a.getCurrentTransform)(this.ctx), B = {
                  createCanvasGraphics: (U) => new J(U, this.commonObjs, this.objs, this.canvasFactory, this.filterFactory, {
                    optionalContentConfig: this.optionalContentConfig,
                    markedContentStack: this.markedContentStack
                  })
                };
                v = new s.TilingPattern(M, L, this.ctx, B, H);
              } else
                v = this._getPattern(M[1], M[2]);
              return v;
            }
            setStrokeColorN() {
              this.current.strokeColor = this.getColorN_Pattern(arguments);
            }
            setFillColorN() {
              this.current.fillColor = this.getColorN_Pattern(arguments), this.current.patternFill = !0;
            }
            setStrokeRGBColor(M, v, L) {
              const H = n.Util.makeHexColor(M, v, L);
              this.ctx.strokeStyle = H, this.current.strokeColor = H;
            }
            setFillRGBColor(M, v, L) {
              const H = n.Util.makeHexColor(M, v, L);
              this.ctx.fillStyle = H, this.current.fillColor = H, this.current.patternFill = !1;
            }
            _getPattern(M, v = null) {
              let L;
              return this.cachedPatterns.has(M) ? L = this.cachedPatterns.get(M) : (L = (0, s.getShadingPattern)(this.getObject(M)), this.cachedPatterns.set(M, L)), v && (L.matrix = v), L;
            }
            shadingFill(M) {
              if (!this.contentVisible)
                return;
              const v = this.ctx;
              this.save();
              const L = this._getPattern(M);
              v.fillStyle = L.getPattern(v, this, (0, a.getCurrentTransformInverse)(v), s.PathType.SHADING);
              const H = (0, a.getCurrentTransformInverse)(v);
              if (H) {
                const {
                  width: B,
                  height: U
                } = v.canvas, [Z, re, pe, be] = n.Util.getAxialAlignedBoundingBox([0, 0, B, U], H);
                this.ctx.fillRect(Z, re, pe - Z, be - re);
              } 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(M, v) {
              if (this.contentVisible && (this.save(), this.baseTransformStack.push(this.baseTransform), Array.isArray(M) && M.length === 6 && this.transform(...M), this.baseTransform = (0, a.getCurrentTransform)(this.ctx), v)) {
                const L = v[2] - v[0], H = v[3] - v[1];
                this.ctx.rect(v[0], v[1], L, H), this.current.updateRectMinMax((0, a.getCurrentTransform)(this.ctx), v), this.clip(), this.endPath();
              }
            }
            paintFormXObjectEnd() {
              this.contentVisible && (this.restore(), this.baseTransform = this.baseTransformStack.pop());
            }
            beginGroup(M) {
              if (!this.contentVisible)
                return;
              this.save(), this.inSMaskMode && (this.endSMaskMode(), this.current.activeSMask = null);
              const v = this.ctx;
              M.isolated || (0, n.info)("TODO: Support non-isolated groups."), M.knockout && (0, n.warn)("Knockout groups not supported.");
              const L = (0, a.getCurrentTransform)(v);
              if (M.matrix && v.transform(...M.matrix), !M.bbox)
                throw new Error("Bounding box is required.");
              let H = n.Util.getAxialAlignedBoundingBox(M.bbox, (0, a.getCurrentTransform)(v));
              const B = [0, 0, v.canvas.width, v.canvas.height];
              H = n.Util.intersect(H, B) || [0, 0, 0, 0];
              const U = Math.floor(H[0]), Z = Math.floor(H[1]);
              let re = Math.max(Math.ceil(H[2]) - U, 1), pe = Math.max(Math.ceil(H[3]) - Z, 1), be = 1, Se = 1;
              re > u && (be = re / u, re = u), pe > u && (Se = pe / u, pe = u), this.current.startNewPathAndClipBox([0, 0, re, pe]);
              let _e = "groupAt" + this.groupLevel;
              M.smask && (_e += "_smask_" + this.smaskCounter++ % 2);
              const we = this.cachedCanvases.getCanvas(_e, re, pe), oe = we.context;
              oe.scale(1 / be, 1 / Se), oe.translate(-U, -Z), oe.transform(...L), M.smask ? this.smaskStack.push({
                canvas: we.canvas,
                context: oe,
                offsetX: U,
                offsetY: Z,
                scaleX: be,
                scaleY: Se,
                subtype: M.smask.subtype,
                backdrop: M.smask.backdrop,
                transferMap: M.smask.transferMap || null,
                startTransformInverse: null
              }) : (v.setTransform(1, 0, 0, 1, 0, 0), v.translate(U, Z), v.scale(be, Se), v.save()), f(v, oe), this.ctx = oe, this.setGState([["BM", "source-over"], ["ca", 1], ["CA", 1]]), this.groupStack.push(v), this.groupLevel++;
            }
            endGroup(M) {
              if (!this.contentVisible)
                return;
              this.groupLevel--;
              const v = this.ctx, L = this.groupStack.pop();
              if (this.ctx = L, this.ctx.imageSmoothingEnabled = !1, M.smask)
                this.tempSMask = this.smaskStack.pop(), this.restore();
              else {
                this.ctx.restore();
                const H = (0, a.getCurrentTransform)(this.ctx);
                this.restore(), this.ctx.save(), this.ctx.setTransform(...H);
                const B = n.Util.getAxialAlignedBoundingBox([0, 0, v.canvas.width, v.canvas.height], H);
                this.ctx.drawImage(v.canvas, 0, 0), this.ctx.restore(), this.compose(B);
              }
            }
            beginAnnotation(M, v, L, H, B) {
              if (te(this, se, on).call(this), g(this.ctx), this.ctx.save(), this.save(), this.baseTransform && this.ctx.setTransform(...this.baseTransform), Array.isArray(v) && v.length === 4) {
                const U = v[2] - v[0], Z = v[3] - v[1];
                if (B && this.annotationCanvasMap) {
                  L = L.slice(), L[4] -= v[0], L[5] -= v[1], v = v.slice(), v[0] = v[1] = 0, v[2] = U, v[3] = Z;
                  const [re, pe] = n.Util.singularValueDecompose2dScale((0, a.getCurrentTransform)(this.ctx)), {
                    viewportScale: be
                  } = this, Se = Math.ceil(U * this.outputScaleX * be), _e = Math.ceil(Z * this.outputScaleY * be);
                  this.annotationCanvas = this.canvasFactory.create(Se, _e);
                  const {
                    canvas: we,
                    context: oe
                  } = this.annotationCanvas;
                  this.annotationCanvasMap.set(M, we), this.annotationCanvas.savedCtx = this.ctx, this.ctx = oe, this.ctx.save(), this.ctx.setTransform(re, 0, 0, -pe, 0, Z * pe), g(this.ctx);
                } else
                  g(this.ctx), this.ctx.rect(v[0], v[1], U, Z), this.ctx.clip(), this.endPath();
              }
              this.current = new m(this.ctx.canvas.width, this.ctx.canvas.height), this.transform(...L), this.transform(...H);
            }
            endAnnotation() {
              this.annotationCanvas && (this.ctx.restore(), te(this, se, ln).call(this), this.ctx = this.annotationCanvas.savedCtx, delete this.annotationCanvas.savedCtx, delete this.annotationCanvas);
            }
            paintImageMaskXObject(M) {
              if (!this.contentVisible)
                return;
              const v = M.count;
              M = this.getObject(M.data, M), M.count = v;
              const L = this.ctx, H = this.processingType3;
              if (H && (H.compiled === void 0 && (H.compiled = C(M)), H.compiled)) {
                H.compiled(L);
                return;
              }
              const B = this._createMaskCanvas(M), U = B.canvas;
              L.save(), L.setTransform(1, 0, 0, 1, 0, 0), L.drawImage(U, B.offsetX, B.offsetY), L.restore(), this.compose();
            }
            paintImageMaskXObjectRepeat(M, v, L = 0, H = 0, B, U) {
              if (!this.contentVisible)
                return;
              M = this.getObject(M.data, M);
              const Z = this.ctx;
              Z.save();
              const re = (0, a.getCurrentTransform)(Z);
              Z.transform(v, L, H, B, 0, 0);
              const pe = this._createMaskCanvas(M);
              Z.setTransform(1, 0, 0, 1, pe.offsetX - re[4], pe.offsetY - re[5]);
              for (let be = 0, Se = U.length; be < Se; be += 2) {
                const _e = n.Util.transform(re, [v, L, H, B, U[be], U[be + 1]]), [we, oe] = n.Util.applyTransform([0, 0], _e);
                Z.drawImage(pe.canvas, we, oe);
              }
              Z.restore(), this.compose();
            }
            paintImageMaskXObjectGroup(M) {
              if (!this.contentVisible)
                return;
              const v = this.ctx, L = this.current.fillColor, H = this.current.patternFill;
              for (const B of M) {
                const {
                  data: U,
                  width: Z,
                  height: re,
                  transform: pe
                } = B, be = this.cachedCanvases.getCanvas("maskCanvas", Z, re), Se = be.context;
                Se.save();
                const _e = this.getObject(U, B);
                F(Se, _e), Se.globalCompositeOperation = "source-in", Se.fillStyle = H ? L.getPattern(Se, this, (0, a.getCurrentTransformInverse)(v), s.PathType.FILL) : L, Se.fillRect(0, 0, Z, re), Se.restore(), v.save(), v.transform(...pe), v.scale(1, -1), k(v, be.canvas, 0, 0, Z, re, 0, -1, 1, 1), v.restore();
              }
              this.compose();
            }
            paintImageXObject(M) {
              if (!this.contentVisible)
                return;
              const v = this.getObject(M);
              if (!v) {
                (0, n.warn)("Dependent image isn't ready yet");
                return;
              }
              this.paintInlineImageXObject(v);
            }
            paintImageXObjectRepeat(M, v, L, H) {
              if (!this.contentVisible)
                return;
              const B = this.getObject(M);
              if (!B) {
                (0, n.warn)("Dependent image isn't ready yet");
                return;
              }
              const U = B.width, Z = B.height, re = [];
              for (let pe = 0, be = H.length; pe < be; pe += 2)
                re.push({
                  transform: [v, 0, 0, L, H[pe], H[pe + 1]],
                  x: 0,
                  y: 0,
                  w: U,
                  h: Z
                });
              this.paintInlineImageXObjectGroup(B, re);
            }
            applyTransferMapsToCanvas(M) {
              return this.current.transferMaps !== "none" && (M.filter = this.current.transferMaps, M.drawImage(M.canvas, 0, 0), M.filter = "none"), M.canvas;
            }
            applyTransferMapsToBitmap(M) {
              if (this.current.transferMaps === "none")
                return M.bitmap;
              const {
                bitmap: v,
                width: L,
                height: H
              } = M, B = this.cachedCanvases.getCanvas("inlineImage", L, H), U = B.context;
              return U.filter = this.current.transferMaps, U.drawImage(v, 0, 0), U.filter = "none", B.canvas;
            }
            paintInlineImageXObject(M) {
              if (!this.contentVisible)
                return;
              const v = M.width, L = M.height, H = this.ctx;
              if (this.save(), !n.isNodeJS) {
                const {
                  filter: Z
                } = H;
                Z !== "none" && Z !== "" && (H.filter = "none");
              }
              H.scale(1 / v, -1 / L);
              let B;
              if (M.bitmap)
                B = this.applyTransferMapsToBitmap(M);
              else if (typeof HTMLElement == "function" && M instanceof HTMLElement || !M.data)
                B = M;
              else {
                const re = this.cachedCanvases.getCanvas("inlineImage", v, L).context;
                A(re, M), B = this.applyTransferMapsToCanvas(re);
              }
              const U = this._scaleImage(B, (0, a.getCurrentTransformInverse)(H));
              H.imageSmoothingEnabled = I((0, a.getCurrentTransform)(H), M.interpolate), k(H, U.img, 0, 0, U.paintWidth, U.paintHeight, 0, -L, v, L), this.compose(), this.restore();
            }
            paintInlineImageXObjectGroup(M, v) {
              if (!this.contentVisible)
                return;
              const L = this.ctx;
              let H;
              if (M.bitmap)
                H = M.bitmap;
              else {
                const B = M.width, U = M.height, re = this.cachedCanvases.getCanvas("inlineImage", B, U).context;
                A(re, M), H = this.applyTransferMapsToCanvas(re);
              }
              for (const B of v)
                L.save(), L.transform(...B.transform), L.scale(1, -1), k(L, H, B.x, B.y, B.w, B.h, 0, -1, 1, 1), L.restore();
              this.compose();
            }
            paintSolidColorImageMask() {
              this.contentVisible && (this.ctx.fillRect(0, 0, 1, 1), this.compose());
            }
            markPoint(M) {
            }
            markPointProps(M, v) {
            }
            beginMarkedContent(M) {
              this.markedContentStack.push({
                visible: !0
              });
            }
            beginMarkedContentProps(M, v) {
              M === "OC" ? this.markedContentStack.push({
                visible: this.optionalContentConfig.isVisible(v)
              }) : this.markedContentStack.push({
                visible: !0
              }), this.contentVisible = this.isContentVisible();
            }
            endMarkedContent() {
              this.markedContentStack.pop(), this.contentVisible = this.isContentVisible();
            }
            beginCompat() {
            }
            endCompat() {
            }
            consumePath(M) {
              const v = this.current.isEmptyClip();
              this.pendingClip && this.current.updateClipFromPath(), this.pendingClip || this.compose(M);
              const L = this.ctx;
              this.pendingClip && (v || (this.pendingClip === ee ? L.clip("evenodd") : L.clip()), this.pendingClip = null), this.current.startNewPathAndClipBox(this.current.clipBox), L.beginPath();
            }
            getSinglePixelWidth() {
              if (!this._cachedGetSinglePixelWidth) {
                const M = (0, a.getCurrentTransform)(this.ctx);
                if (M[1] === 0 && M[2] === 0)
                  this._cachedGetSinglePixelWidth = 1 / Math.min(Math.abs(M[0]), Math.abs(M[3]));
                else {
                  const v = Math.abs(M[0] * M[3] - M[2] * M[1]), L = Math.hypot(M[0], M[2]), H = Math.hypot(M[1], M[3]);
                  this._cachedGetSinglePixelWidth = Math.max(L, H) / v;
                }
              }
              return this._cachedGetSinglePixelWidth;
            }
            getScaleForStroking() {
              if (this._cachedScaleForStroking[0] === -1) {
                const {
                  lineWidth: M
                } = this.current, {
                  a: v,
                  b: L,
                  c: H,
                  d: B
                } = this.ctx.getTransform();
                let U, Z;
                if (L === 0 && H === 0) {
                  const re = Math.abs(v), pe = Math.abs(B);
                  if (re === pe)
                    if (M === 0)
                      U = Z = 1 / re;
                    else {
                      const be = re * M;
                      U = Z = be < 1 ? 1 / be : 1;
                    }
                  else if (M === 0)
                    U = 1 / re, Z = 1 / pe;
                  else {
                    const be = re * M, Se = pe * M;
                    U = be < 1 ? 1 / be : 1, Z = Se < 1 ? 1 / Se : 1;
                  }
                } else {
                  const re = Math.abs(v * B - L * H), pe = Math.hypot(v, L), be = Math.hypot(H, B);
                  if (M === 0)
                    U = be / re, Z = pe / re;
                  else {
                    const Se = M * re;
                    U = be > Se ? be / Se : 1, Z = pe > Se ? pe / Se : 1;
                  }
                }
                this._cachedScaleForStroking[0] = U, this._cachedScaleForStroking[1] = Z;
              }
              return this._cachedScaleForStroking;
            }
            rescaleAndStroke(M) {
              const {
                ctx: v
              } = this, {
                lineWidth: L
              } = this.current, [H, B] = this.getScaleForStroking();
              if (v.lineWidth = L || 1, H === 1 && B === 1) {
                v.stroke();
                return;
              }
              const U = v.getLineDash();
              if (M && v.save(), v.scale(H, B), U.length > 0) {
                const Z = Math.max(H, B);
                v.setLineDash(U.map((re) => re / Z)), v.lineDashOffset /= Z;
              }
              v.stroke(), M && v.restore();
            }
            isContentVisible() {
              for (let M = this.markedContentStack.length - 1; M >= 0; M--)
                if (!this.markedContentStack[M].visible)
                  return !1;
              return !0;
            }
          };
          se = new WeakSet(), on = function() {
            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);
          }, ln = function() {
            if (this.pageColors) {
              const M = this.filterFactory.addHCMFilter(this.pageColors.foreground, this.pageColors.background);
              if (M !== "none") {
                const v = this.ctx.filter;
                this.ctx.filter = M, this.ctx.drawImage(this.ctx.canvas, 0, 0), this.ctx.filter = v;
              }
            }
          };
          let K = J;
          e.CanvasGraphics = K;
          for (const N in n.OPS)
            K.prototype[N] !== void 0 && (K.prototype[n.OPS[N]] = K.prototype[N]);
        },
        /* 12 */
        /***/
        (r, e, t) => {
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.TilingPattern = e.PathType = void 0, e.getShadingPattern = b;
          var n = t(1), a = t(6);
          const s = {
            FILL: "Fill",
            STROKE: "Stroke",
            SHADING: "Shading"
          };
          e.PathType = s;
          function o(C, m) {
            if (!m)
              return;
            const A = m[2] - m[0], F = m[3] - m[1], f = new Path2D();
            f.rect(m[0], m[1], A, F), C.clip(f);
          }
          class c {
            constructor() {
              this.constructor === c && (0, n.unreachable)("Cannot initialize BaseShadingPattern.");
            }
            getPattern() {
              (0, n.unreachable)("Abstract method `getPattern` called.");
            }
          }
          class l extends c {
            constructor(m) {
              super(), this._type = m[1], this._bbox = m[2], this._colorStops = m[3], this._p0 = m[4], this._p1 = m[5], this._r0 = m[6], this._r1 = m[7], this.matrix = null;
            }
            _createGradient(m) {
              let A;
              this._type === "axial" ? A = m.createLinearGradient(this._p0[0], this._p0[1], this._p1[0], this._p1[1]) : this._type === "radial" && (A = m.createRadialGradient(this._p0[0], this._p0[1], this._r0, this._p1[0], this._p1[1], this._r1));
              for (const F of this._colorStops)
                A.addColorStop(F[0], F[1]);
              return A;
            }
            getPattern(m, A, F, f) {
              let g;
              if (f === s.STROKE || f === s.FILL) {
                const y = A.current.getClippedPathBoundingBox(f, (0, a.getCurrentTransform)(m)) || [0, 0, 0, 0], E = Math.ceil(y[2] - y[0]) || 1, x = Math.ceil(y[3] - y[1]) || 1, O = A.cachedCanvases.getCanvas("pattern", E, x, !0), P = O.context;
                P.clearRect(0, 0, P.canvas.width, P.canvas.height), P.beginPath(), P.rect(0, 0, P.canvas.width, P.canvas.height), P.translate(-y[0], -y[1]), F = n.Util.transform(F, [1, 0, 0, 1, y[0], y[1]]), P.transform(...A.baseTransform), this.matrix && P.transform(...this.matrix), o(P, this._bbox), P.fillStyle = this._createGradient(P), P.fill(), g = m.createPattern(O.canvas, "no-repeat");
                const I = new DOMMatrix(F);
                g.setTransform(I);
              } else
                o(m, this._bbox), g = this._createGradient(m);
              return g;
            }
          }
          function u(C, m, A, F, f, g, y, E) {
            const x = m.coords, O = m.colors, P = C.data, I = C.width * 4;
            let G;
            x[A + 1] > x[F + 1] && (G = A, A = F, F = G, G = g, g = y, y = G), x[F + 1] > x[f + 1] && (G = F, F = f, f = G, G = y, y = E, E = G), x[A + 1] > x[F + 1] && (G = A, A = F, F = G, G = g, g = y, y = G);
            const ne = (x[A] + m.offsetX) * m.scaleX, X = (x[A + 1] + m.offsetY) * m.scaleY, ee = (x[F] + m.offsetX) * m.scaleX, K = (x[F + 1] + m.offsetY) * m.scaleY, se = (x[f] + m.offsetX) * m.scaleX, q = (x[f + 1] + m.offsetY) * m.scaleY;
            if (X >= q)
              return;
            const Y = O[g], J = O[g + 1], N = O[g + 2], M = O[y], v = O[y + 1], L = O[y + 2], H = O[E], B = O[E + 1], U = O[E + 2], Z = Math.round(X), re = Math.round(q);
            let pe, be, Se, _e, we, oe, le, $;
            for (let j = Z; j <= re; j++) {
              if (j < K) {
                const ke = j < X ? 0 : (X - j) / (X - K);
                pe = ne - (ne - ee) * ke, be = Y - (Y - M) * ke, Se = J - (J - v) * ke, _e = N - (N - L) * ke;
              } else {
                let ke;
                j > q ? ke = 1 : K === q ? ke = 0 : ke = (K - j) / (K - q), pe = ee - (ee - se) * ke, be = M - (M - H) * ke, Se = v - (v - B) * ke, _e = L - (L - U) * ke;
              }
              let ae;
              j < X ? ae = 0 : j > q ? ae = 1 : ae = (X - j) / (X - q), we = ne - (ne - se) * ae, oe = Y - (Y - H) * ae, le = J - (J - B) * ae, $ = N - (N - U) * ae;
              const ue = Math.round(Math.min(pe, we)), Ae = Math.round(Math.max(pe, we));
              let Te = I * j + ue * 4;
              for (let ke = ue; ke <= Ae; ke++)
                ae = (pe - ke) / (pe - we), ae < 0 ? ae = 0 : ae > 1 && (ae = 1), P[Te++] = be - (be - oe) * ae | 0, P[Te++] = Se - (Se - le) * ae | 0, P[Te++] = _e - (_e - $) * ae | 0, P[Te++] = 255;
            }
          }
          function h(C, m, A) {
            const F = m.coords, f = m.colors;
            let g, y;
            switch (m.type) {
              case "lattice":
                const E = m.verticesPerRow, x = Math.floor(F.length / E) - 1, O = E - 1;
                for (g = 0; g < x; g++) {
                  let P = g * E;
                  for (let I = 0; I < O; I++, P++)
                    u(C, A, F[P], F[P + 1], F[P + E], f[P], f[P + 1], f[P + E]), u(C, A, F[P + E + 1], F[P + 1], F[P + E], f[P + E + 1], f[P + 1], f[P + E]);
                }
                break;
              case "triangles":
                for (g = 0, y = F.length; g < y; g += 3)
                  u(C, A, F[g], F[g + 1], F[g + 2], f[g], f[g + 1], f[g + 2]);
                break;
              default:
                throw new Error("illegal figure");
            }
          }
          class d extends c {
            constructor(m) {
              super(), this._coords = m[2], this._colors = m[3], this._figures = m[4], this._bounds = m[5], this._bbox = m[7], this._background = m[8], this.matrix = null;
            }
            _createMeshCanvas(m, A, F) {
              const E = Math.floor(this._bounds[0]), x = Math.floor(this._bounds[1]), O = Math.ceil(this._bounds[2]) - E, P = Math.ceil(this._bounds[3]) - x, I = Math.min(Math.ceil(Math.abs(O * m[0] * 1.1)), 3e3), G = Math.min(Math.ceil(Math.abs(P * m[1] * 1.1)), 3e3), ne = O / I, X = P / G, ee = {
                coords: this._coords,
                colors: this._colors,
                offsetX: -E,
                offsetY: -x,
                scaleX: 1 / ne,
                scaleY: 1 / X
              }, K = I + 2 * 2, se = G + 2 * 2, q = F.getCanvas("mesh", K, se, !1), Y = q.context, J = Y.createImageData(I, G);
              if (A) {
                const M = J.data;
                for (let v = 0, L = M.length; v < L; v += 4)
                  M[v] = A[0], M[v + 1] = A[1], M[v + 2] = A[2], M[v + 3] = 255;
              }
              for (const M of this._figures)
                h(J, M, ee);
              return Y.putImageData(J, 2, 2), {
                canvas: q.canvas,
                offsetX: E - 2 * ne,
                offsetY: x - 2 * X,
                scaleX: ne,
                scaleY: X
              };
            }
            getPattern(m, A, F, f) {
              o(m, this._bbox);
              let g;
              if (f === s.SHADING)
                g = n.Util.singularValueDecompose2dScale((0, a.getCurrentTransform)(m));
              else if (g = n.Util.singularValueDecompose2dScale(A.baseTransform), this.matrix) {
                const E = n.Util.singularValueDecompose2dScale(this.matrix);
                g = [g[0] * E[0], g[1] * E[1]];
              }
              const y = this._createMeshCanvas(g, f === s.SHADING ? null : this._background, A.cachedCanvases);
              return f !== s.SHADING && (m.setTransform(...A.baseTransform), this.matrix && m.transform(...this.matrix)), m.translate(y.offsetX, y.offsetY), m.scale(y.scaleX, y.scaleY), m.createPattern(y.canvas, "no-repeat");
            }
          }
          class w extends c {
            getPattern() {
              return "hotpink";
            }
          }
          function b(C) {
            switch (C[0]) {
              case "RadialAxial":
                return new l(C);
              case "Mesh":
                return new d(C);
              case "Dummy":
                return new w();
            }
            throw new Error(`Unknown IR type: ${C[0]}`);
          }
          const _ = {
            COLORED: 1,
            UNCOLORED: 2
          }, k = class k {
            constructor(m, A, F, f, g) {
              this.operatorList = m[2], this.matrix = m[3] || [1, 0, 0, 1, 0, 0], this.bbox = m[4], this.xstep = m[5], this.ystep = m[6], this.paintType = m[7], this.tilingType = m[8], this.color = A, this.ctx = F, this.canvasGraphicsFactory = f, this.baseTransform = g;
            }
            createPatternCanvas(m) {
              const A = this.operatorList, F = this.bbox, f = this.xstep, g = this.ystep, y = this.paintType, E = this.tilingType, x = this.color, O = this.canvasGraphicsFactory;
              (0, n.info)("TilingType: " + E);
              const P = F[0], I = F[1], G = F[2], ne = F[3], X = n.Util.singularValueDecompose2dScale(this.matrix), ee = n.Util.singularValueDecompose2dScale(this.baseTransform), K = [X[0] * ee[0], X[1] * ee[1]], se = this.getSizeAndScale(f, this.ctx.canvas.width, K[0]), q = this.getSizeAndScale(g, this.ctx.canvas.height, K[1]), Y = m.cachedCanvases.getCanvas("pattern", se.size, q.size, !0), J = Y.context, N = O.createCanvasGraphics(J);
              N.groupLevel = m.groupLevel, this.setFillAndStrokeStyleToContext(N, y, x);
              let M = P, v = I, L = G, H = ne;
              return P < 0 && (M = 0, L += Math.abs(P)), I < 0 && (v = 0, H += Math.abs(I)), J.translate(-(se.scale * M), -(q.scale * v)), N.transform(se.scale, 0, 0, q.scale, 0, 0), J.save(), this.clipBbox(N, M, v, L, H), N.baseTransform = (0, a.getCurrentTransform)(N.ctx), N.executeOperatorList(A), N.endDrawing(), {
                canvas: Y.canvas,
                scaleX: se.scale,
                scaleY: q.scale,
                offsetX: M,
                offsetY: v
              };
            }
            getSizeAndScale(m, A, F) {
              m = Math.abs(m);
              const f = Math.max(k.MAX_PATTERN_SIZE, A);
              let g = Math.ceil(m * F);
              return g >= f ? g = f : F = g / m, {
                scale: F,
                size: g
              };
            }
            clipBbox(m, A, F, f, g) {
              const y = f - A, E = g - F;
              m.ctx.rect(A, F, y, E), m.current.updateRectMinMax((0, a.getCurrentTransform)(m.ctx), [A, F, f, g]), m.clip(), m.endPath();
            }
            setFillAndStrokeStyleToContext(m, A, F) {
              const f = m.ctx, g = m.current;
              switch (A) {
                case _.COLORED:
                  const y = this.ctx;
                  f.fillStyle = y.fillStyle, f.strokeStyle = y.strokeStyle, g.fillColor = y.fillStyle, g.strokeColor = y.strokeStyle;
                  break;
                case _.UNCOLORED:
                  const E = n.Util.makeHexColor(F[0], F[1], F[2]);
                  f.fillStyle = E, f.strokeStyle = E, g.fillColor = E, g.strokeColor = E;
                  break;
                default:
                  throw new n.FormatError(`Unsupported paint type: ${A}`);
              }
            }
            getPattern(m, A, F, f) {
              let g = F;
              f !== s.SHADING && (g = n.Util.transform(g, A.baseTransform), this.matrix && (g = n.Util.transform(g, this.matrix)));
              const y = this.createPatternCanvas(A);
              let E = new DOMMatrix(g);
              E = E.translate(y.offsetX, y.offsetY), E = E.scale(1 / y.scaleX, 1 / y.scaleY);
              const x = m.createPattern(y.canvas, "repeat");
              return x.setTransform(E), x;
            }
          };
          Ke(k, "MAX_PATTERN_SIZE", 3e3);
          let R = k;
          e.TilingPattern = R;
        },
        /* 13 */
        /***/
        (r, e, t) => {
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.convertBlackAndWhiteToRGBA = s, e.convertToRGBA = a, e.grayToRGBA = c;
          var n = t(1);
          function a(l) {
            switch (l.kind) {
              case n.ImageKind.GRAYSCALE_1BPP:
                return s(l);
              case n.ImageKind.RGB_24BPP:
                return o(l);
            }
            return null;
          }
          function s({
            src: l,
            srcPos: u = 0,
            dest: h,
            width: d,
            height: w,
            nonBlackColor: b = 4294967295,
            inverseDecode: _ = !1
          }) {
            const R = n.FeatureTest.isLittleEndian ? 4278190080 : 255, [k, C] = _ ? [b, R] : [R, b], m = d >> 3, A = d & 7, F = l.length;
            h = new Uint32Array(h.buffer);
            let f = 0;
            for (let g = 0; g < w; g++) {
              for (const E = u + m; u < E; u++) {
                const x = u < F ? l[u] : 255;
                h[f++] = x & 128 ? C : k, h[f++] = x & 64 ? C : k, h[f++] = x & 32 ? C : k, h[f++] = x & 16 ? C : k, h[f++] = x & 8 ? C : k, h[f++] = x & 4 ? C : k, h[f++] = x & 2 ? C : k, h[f++] = x & 1 ? C : k;
              }
              if (A === 0)
                continue;
              const y = u < F ? l[u++] : 255;
              for (let E = 0; E < A; E++)
                h[f++] = y & 1 << 7 - E ? C : k;
            }
            return {
              srcPos: u,
              destPos: f
            };
          }
          function o({
            src: l,
            srcPos: u = 0,
            dest: h,
            destPos: d = 0,
            width: w,
            height: b
          }) {
            let _ = 0;
            const R = l.length >> 2, k = new Uint32Array(l.buffer, u, R);
            if (n.FeatureTest.isLittleEndian) {
              for (; _ < R - 2; _ += 3, d += 4) {
                const C = k[_], m = k[_ + 1], A = k[_ + 2];
                h[d] = C | 4278190080, h[d + 1] = C >>> 24 | m << 8 | 4278190080, h[d + 2] = m >>> 16 | A << 16 | 4278190080, h[d + 3] = A >>> 8 | 4278190080;
              }
              for (let C = _ * 4, m = l.length; C < m; C += 3)
                h[d++] = l[C] | l[C + 1] << 8 | l[C + 2] << 16 | 4278190080;
            } else {
              for (; _ < R - 2; _ += 3, d += 4) {
                const C = k[_], m = k[_ + 1], A = k[_ + 2];
                h[d] = C | 255, h[d + 1] = C << 24 | m >>> 8 | 255, h[d + 2] = m << 16 | A >>> 16 | 255, h[d + 3] = A << 8 | 255;
              }
              for (let C = _ * 4, m = l.length; C < m; C += 3)
                h[d++] = l[C] << 24 | l[C + 1] << 16 | l[C + 2] << 8 | 255;
            }
            return {
              srcPos: u,
              destPos: d
            };
          }
          function c(l, u) {
            if (n.FeatureTest.isLittleEndian)
              for (let h = 0, d = l.length; h < d; h++)
                u[h] = l[h] * 65793 | 4278190080;
            else
              for (let h = 0, d = l.length; h < d; h++)
                u[h] = l[h] * 16843008 | 255;
          }
        },
        /* 14 */
        /***/
        (r, e) => {
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.GlobalWorkerOptions = void 0;
          const t = /* @__PURE__ */ Object.create(null);
          e.GlobalWorkerOptions = t, t.workerPort = null, t.workerSrc = "";
        },
        /* 15 */
        /***/
        (r, e, t) => {
          var l, zn, Hn, It;
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.MessageHandler = void 0;
          var n = t(1);
          const a = {
            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 o(w) {
            switch (w instanceof Error || typeof w == "object" && w !== null || (0, n.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'), w.name) {
              case "AbortException":
                return new n.AbortException(w.message);
              case "MissingPDFException":
                return new n.MissingPDFException(w.message);
              case "PasswordException":
                return new n.PasswordException(w.message, w.code);
              case "UnexpectedResponseException":
                return new n.UnexpectedResponseException(w.message, w.status);
              case "UnknownErrorException":
                return new n.UnknownErrorException(w.message, w.details);
              default:
                return new n.UnknownErrorException(w.message, w.toString());
            }
          }
          class c {
            constructor(b, _, R) {
              de(this, l);
              this.sourceName = b, this.targetName = _, this.comObj = R, 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 = (k) => {
                const C = k.data;
                if (C.targetName !== this.sourceName)
                  return;
                if (C.stream) {
                  te(this, l, Hn).call(this, C);
                  return;
                }
                if (C.callback) {
                  const A = C.callbackId, F = this.callbackCapabilities[A];
                  if (!F)
                    throw new Error(`Cannot resolve callback ${A}`);
                  if (delete this.callbackCapabilities[A], C.callback === a.DATA)
                    F.resolve(C.data);
                  else if (C.callback === a.ERROR)
                    F.reject(o(C.reason));
                  else
                    throw new Error("Unexpected callback case");
                  return;
                }
                const m = this.actionHandler[C.action];
                if (!m)
                  throw new Error(`Unknown action from worker: ${C.action}`);
                if (C.callbackId) {
                  const A = this.sourceName, F = C.sourceName;
                  new Promise(function(f) {
                    f(m(C.data));
                  }).then(function(f) {
                    R.postMessage({
                      sourceName: A,
                      targetName: F,
                      callback: a.DATA,
                      callbackId: C.callbackId,
                      data: f
                    });
                  }, function(f) {
                    R.postMessage({
                      sourceName: A,
                      targetName: F,
                      callback: a.ERROR,
                      callbackId: C.callbackId,
                      reason: o(f)
                    });
                  });
                  return;
                }
                if (C.streamId) {
                  te(this, l, zn).call(this, C);
                  return;
                }
                m(C.data);
              }, R.addEventListener("message", this._onComObjOnMessage);
            }
            on(b, _) {
              const R = this.actionHandler;
              if (R[b])
                throw new Error(`There is already an actionName called "${b}"`);
              R[b] = _;
            }
            send(b, _, R) {
              this.comObj.postMessage({
                sourceName: this.sourceName,
                targetName: this.targetName,
                action: b,
                data: _
              }, R);
            }
            sendWithPromise(b, _, R) {
              const k = this.callbackId++, C = new n.PromiseCapability();
              this.callbackCapabilities[k] = C;
              try {
                this.comObj.postMessage({
                  sourceName: this.sourceName,
                  targetName: this.targetName,
                  action: b,
                  callbackId: k,
                  data: _
                }, R);
              } catch (m) {
                C.reject(m);
              }
              return C.promise;
            }
            sendWithStream(b, _, R, k) {
              const C = this.streamId++, m = this.sourceName, A = this.targetName, F = this.comObj;
              return new ReadableStream({
                start: (f) => {
                  const g = new n.PromiseCapability();
                  return this.streamControllers[C] = {
                    controller: f,
                    startCall: g,
                    pullCall: null,
                    cancelCall: null,
                    isClosed: !1
                  }, F.postMessage({
                    sourceName: m,
                    targetName: A,
                    action: b,
                    streamId: C,
                    data: _,
                    desiredSize: f.desiredSize
                  }, k), g.promise;
                },
                pull: (f) => {
                  const g = new n.PromiseCapability();
                  return this.streamControllers[C].pullCall = g, F.postMessage({
                    sourceName: m,
                    targetName: A,
                    stream: s.PULL,
                    streamId: C,
                    desiredSize: f.desiredSize
                  }), g.promise;
                },
                cancel: (f) => {
                  (0, n.assert)(f instanceof Error, "cancel must have a valid reason");
                  const g = new n.PromiseCapability();
                  return this.streamControllers[C].cancelCall = g, this.streamControllers[C].isClosed = !0, F.postMessage({
                    sourceName: m,
                    targetName: A,
                    stream: s.CANCEL,
                    streamId: C,
                    reason: o(f)
                  }), g.promise;
                }
              }, R);
            }
            destroy() {
              this.comObj.removeEventListener("message", this._onComObjOnMessage);
            }
          }
          l = new WeakSet(), zn = function(b) {
            const _ = b.streamId, R = this.sourceName, k = b.sourceName, C = this.comObj, m = this, A = this.actionHandler[b.action], F = {
              enqueue(f, g = 1, y) {
                if (this.isCancelled)
                  return;
                const E = this.desiredSize;
                this.desiredSize -= g, E > 0 && this.desiredSize <= 0 && (this.sinkCapability = new n.PromiseCapability(), this.ready = this.sinkCapability.promise), C.postMessage({
                  sourceName: R,
                  targetName: k,
                  stream: s.ENQUEUE,
                  streamId: _,
                  chunk: f
                }, y);
              },
              close() {
                this.isCancelled || (this.isCancelled = !0, C.postMessage({
                  sourceName: R,
                  targetName: k,
                  stream: s.CLOSE,
                  streamId: _
                }), delete m.streamSinks[_]);
              },
              error(f) {
                (0, n.assert)(f instanceof Error, "error must have a valid reason"), !this.isCancelled && (this.isCancelled = !0, C.postMessage({
                  sourceName: R,
                  targetName: k,
                  stream: s.ERROR,
                  streamId: _,
                  reason: o(f)
                }));
              },
              sinkCapability: new n.PromiseCapability(),
              onPull: null,
              onCancel: null,
              isCancelled: !1,
              desiredSize: b.desiredSize,
              ready: null
            };
            F.sinkCapability.resolve(), F.ready = F.sinkCapability.promise, this.streamSinks[_] = F, new Promise(function(f) {
              f(A(b.data, F));
            }).then(function() {
              C.postMessage({
                sourceName: R,
                targetName: k,
                stream: s.START_COMPLETE,
                streamId: _,
                success: !0
              });
            }, function(f) {
              C.postMessage({
                sourceName: R,
                targetName: k,
                stream: s.START_COMPLETE,
                streamId: _,
                reason: o(f)
              });
            });
          }, Hn = function(b) {
            const _ = b.streamId, R = this.sourceName, k = b.sourceName, C = this.comObj, m = this.streamControllers[_], A = this.streamSinks[_];
            switch (b.stream) {
              case s.START_COMPLETE:
                b.success ? m.startCall.resolve() : m.startCall.reject(o(b.reason));
                break;
              case s.PULL_COMPLETE:
                b.success ? m.pullCall.resolve() : m.pullCall.reject(o(b.reason));
                break;
              case s.PULL:
                if (!A) {
                  C.postMessage({
                    sourceName: R,
                    targetName: k,
                    stream: s.PULL_COMPLETE,
                    streamId: _,
                    success: !0
                  });
                  break;
                }
                A.desiredSize <= 0 && b.desiredSize > 0 && A.sinkCapability.resolve(), A.desiredSize = b.desiredSize, new Promise(function(F) {
                  var f;
                  F((f = A.onPull) == null ? void 0 : f.call(A));
                }).then(function() {
                  C.postMessage({
                    sourceName: R,
                    targetName: k,
                    stream: s.PULL_COMPLETE,
                    streamId: _,
                    success: !0
                  });
                }, function(F) {
                  C.postMessage({
                    sourceName: R,
                    targetName: k,
                    stream: s.PULL_COMPLETE,
                    streamId: _,
                    reason: o(F)
                  });
                });
                break;
              case s.ENQUEUE:
                if ((0, n.assert)(m, "enqueue should have stream controller"), m.isClosed)
                  break;
                m.controller.enqueue(b.chunk);
                break;
              case s.CLOSE:
                if ((0, n.assert)(m, "close should have stream controller"), m.isClosed)
                  break;
                m.isClosed = !0, m.controller.close(), te(this, l, It).call(this, m, _);
                break;
              case s.ERROR:
                (0, n.assert)(m, "error should have stream controller"), m.controller.error(o(b.reason)), te(this, l, It).call(this, m, _);
                break;
              case s.CANCEL_COMPLETE:
                b.success ? m.cancelCall.resolve() : m.cancelCall.reject(o(b.reason)), te(this, l, It).call(this, m, _);
                break;
              case s.CANCEL:
                if (!A)
                  break;
                new Promise(function(F) {
                  var f;
                  F((f = A.onCancel) == null ? void 0 : f.call(A, o(b.reason)));
                }).then(function() {
                  C.postMessage({
                    sourceName: R,
                    targetName: k,
                    stream: s.CANCEL_COMPLETE,
                    streamId: _,
                    success: !0
                  });
                }, function(F) {
                  C.postMessage({
                    sourceName: R,
                    targetName: k,
                    stream: s.CANCEL_COMPLETE,
                    streamId: _,
                    reason: o(F)
                  });
                }), A.sinkCapability.reject(o(b.reason)), A.isCancelled = !0, delete this.streamSinks[_];
                break;
              default:
                throw new Error("Unexpected stream case");
            }
          }, It = async function(b, _) {
            var R, k, C;
            await Promise.allSettled([(R = b.startCall) == null ? void 0 : R.promise, (k = b.pullCall) == null ? void 0 : k.promise, (C = b.cancelCall) == null ? void 0 : C.promise]), delete this.streamControllers[_];
          }, e.MessageHandler = c;
        },
        /* 16 */
        /***/
        (r, e, t) => {
          var s, o;
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.Metadata = void 0;
          var n = t(1);
          class a {
            constructor({
              parsedData: l,
              rawData: u
            }) {
              de(this, s);
              de(this, o);
              fe(this, s, l), fe(this, o, u);
            }
            getRaw() {
              return p(this, o);
            }
            get(l) {
              return p(this, s).get(l) ?? null;
            }
            getAll() {
              return (0, n.objectFromMap)(p(this, s));
            }
            has(l) {
              return p(this, s).has(l);
            }
          }
          s = new WeakMap(), o = new WeakMap(), e.Metadata = a;
        },
        /* 17 */
        /***/
        (r, e, t) => {
          var l, u, h, d, w, b, cn;
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.OptionalContentConfig = void 0;
          var n = t(1), a = t(8);
          const s = Symbol("INTERNAL");
          class o {
            constructor(k, C) {
              de(this, l, !0);
              this.name = k, this.intent = C;
            }
            get visible() {
              return p(this, l);
            }
            _setVisible(k, C) {
              k !== s && (0, n.unreachable)("Internal method `_setVisible` called."), fe(this, l, C);
            }
          }
          l = new WeakMap();
          class c {
            constructor(k) {
              de(this, b);
              de(this, u, null);
              de(this, h, /* @__PURE__ */ new Map());
              de(this, d, null);
              de(this, w, null);
              if (this.name = null, this.creator = null, k !== null) {
                this.name = k.name, this.creator = k.creator, fe(this, w, k.order);
                for (const C of k.groups)
                  p(this, h).set(C.id, new o(C.name, C.intent));
                if (k.baseState === "OFF")
                  for (const C of p(this, h).values())
                    C._setVisible(s, !1);
                for (const C of k.on)
                  p(this, h).get(C)._setVisible(s, !0);
                for (const C of k.off)
                  p(this, h).get(C)._setVisible(s, !1);
                fe(this, d, this.getHash());
              }
            }
            isVisible(k) {
              if (p(this, h).size === 0)
                return !0;
              if (!k)
                return (0, n.warn)("Optional content group not defined."), !0;
              if (k.type === "OCG")
                return p(this, h).has(k.id) ? p(this, h).get(k.id).visible : ((0, n.warn)(`Optional content group not found: ${k.id}`), !0);
              if (k.type === "OCMD") {
                if (k.expression)
                  return te(this, b, cn).call(this, k.expression);
                if (!k.policy || k.policy === "AnyOn") {
                  for (const C of k.ids) {
                    if (!p(this, h).has(C))
                      return (0, n.warn)(`Optional content group not found: ${C}`), !0;
                    if (p(this, h).get(C).visible)
                      return !0;
                  }
                  return !1;
                } else if (k.policy === "AllOn") {
                  for (const C of k.ids) {
                    if (!p(this, h).has(C))
                      return (0, n.warn)(`Optional content group not found: ${C}`), !0;
                    if (!p(this, h).get(C).visible)
                      return !1;
                  }
                  return !0;
                } else if (k.policy === "AnyOff") {
                  for (const C of k.ids) {
                    if (!p(this, h).has(C))
                      return (0, n.warn)(`Optional content group not found: ${C}`), !0;
                    if (!p(this, h).get(C).visible)
                      return !0;
                  }
                  return !1;
                } else if (k.policy === "AllOff") {
                  for (const C of k.ids) {
                    if (!p(this, h).has(C))
                      return (0, n.warn)(`Optional content group not found: ${C}`), !0;
                    if (p(this, h).get(C).visible)
                      return !1;
                  }
                  return !0;
                }
                return (0, n.warn)(`Unknown optional content policy ${k.policy}.`), !0;
              }
              return (0, n.warn)(`Unknown group type ${k.type}.`), !0;
            }
            setVisibility(k, C = !0) {
              if (!p(this, h).has(k)) {
                (0, n.warn)(`Optional content group not found: ${k}`);
                return;
              }
              p(this, h).get(k)._setVisible(s, !!C), fe(this, u, null);
            }
            get hasInitialVisibility() {
              return p(this, d) === null || this.getHash() === p(this, d);
            }
            getOrder() {
              return p(this, h).size ? p(this, w) ? p(this, w).slice() : [...p(this, h).keys()] : null;
            }
            getGroups() {
              return p(this, h).size > 0 ? (0, n.objectFromMap)(p(this, h)) : null;
            }
            getGroup(k) {
              return p(this, h).get(k) || null;
            }
            getHash() {
              if (p(this, u) !== null)
                return p(this, u);
              const k = new a.MurmurHash3_64();
              for (const [C, m] of p(this, h))
                k.update(`${C}:${m.visible}`);
              return fe(this, u, k.hexdigest());
            }
          }
          u = new WeakMap(), h = new WeakMap(), d = new WeakMap(), w = new WeakMap(), b = new WeakSet(), cn = function(k) {
            const C = k.length;
            if (C < 2)
              return !0;
            const m = k[0];
            for (let A = 1; A < C; A++) {
              const F = k[A];
              let f;
              if (Array.isArray(F))
                f = te(this, b, cn).call(this, F);
              else if (p(this, h).has(F))
                f = p(this, h).get(F).visible;
              else
                return (0, n.warn)(`Optional content group not found: ${F}`), !0;
              switch (m) {
                case "And":
                  if (!f)
                    return !1;
                  break;
                case "Or":
                  if (f)
                    return !0;
                  break;
                case "Not":
                  return !f;
                default:
                  return !0;
              }
            }
            return m === "And";
          }, e.OptionalContentConfig = c;
        },
        /* 18 */
        /***/
        (r, e, t) => {
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.PDFDataTransportStream = void 0;
          var n = t(1), a = t(6);
          class s {
            constructor({
              length: u,
              initialData: h,
              progressiveDone: d = !1,
              contentDispositionFilename: w = null,
              disableRange: b = !1,
              disableStream: _ = !1
            }, R) {
              if ((0, n.assert)(R, 'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'), this._queuedChunks = [], this._progressiveDone = d, this._contentDispositionFilename = w, (h == null ? void 0 : h.length) > 0) {
                const k = h instanceof Uint8Array && h.byteLength === h.buffer.byteLength ? h.buffer : new Uint8Array(h).buffer;
                this._queuedChunks.push(k);
              }
              this._pdfDataRangeTransport = R, this._isStreamingSupported = !_, this._isRangeSupported = !b, this._contentLength = u, this._fullRequestReader = null, this._rangeReaders = [], this._pdfDataRangeTransport.addRangeListener((k, C) => {
                this._onReceiveData({
                  begin: k,
                  chunk: C
                });
              }), this._pdfDataRangeTransport.addProgressListener((k, C) => {
                this._onProgress({
                  loaded: k,
                  total: C
                });
              }), this._pdfDataRangeTransport.addProgressiveReadListener((k) => {
                this._onReceiveData({
                  chunk: k
                });
              }), this._pdfDataRangeTransport.addProgressiveDoneListener(() => {
                this._onProgressiveDone();
              }), this._pdfDataRangeTransport.transportReady();
            }
            _onReceiveData({
              begin: u,
              chunk: h
            }) {
              const d = h instanceof Uint8Array && h.byteLength === h.buffer.byteLength ? h.buffer : new Uint8Array(h).buffer;
              if (u === void 0)
                this._fullRequestReader ? this._fullRequestReader._enqueue(d) : this._queuedChunks.push(d);
              else {
                const w = this._rangeReaders.some(function(b) {
                  return b._begin !== u ? !1 : (b._enqueue(d), !0);
                });
                (0, n.assert)(w, "_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.");
              }
            }
            get _progressiveDataLength() {
              var u;
              return ((u = this._fullRequestReader) == null ? void 0 : u._loaded) ?? 0;
            }
            _onProgress(u) {
              var h, d, w, b;
              u.total === void 0 ? (d = (h = this._rangeReaders[0]) == null ? void 0 : h.onProgress) == null || d.call(h, {
                loaded: u.loaded
              }) : (b = (w = this._fullRequestReader) == null ? void 0 : w.onProgress) == null || b.call(w, {
                loaded: u.loaded,
                total: u.total
              });
            }
            _onProgressiveDone() {
              var u;
              (u = this._fullRequestReader) == null || u.progressiveDone(), this._progressiveDone = !0;
            }
            _removeRangeReader(u) {
              const h = this._rangeReaders.indexOf(u);
              h >= 0 && this._rangeReaders.splice(h, 1);
            }
            getFullReader() {
              (0, n.assert)(!this._fullRequestReader, "PDFDataTransportStream.getFullReader can only be called once.");
              const u = this._queuedChunks;
              return this._queuedChunks = null, new o(this, u, this._progressiveDone, this._contentDispositionFilename);
            }
            getRangeReader(u, h) {
              if (h <= this._progressiveDataLength)
                return null;
              const d = new c(this, u, h);
              return this._pdfDataRangeTransport.requestDataRange(u, h), this._rangeReaders.push(d), d;
            }
            cancelAllRequests(u) {
              var h;
              (h = this._fullRequestReader) == null || h.cancel(u);
              for (const d of this._rangeReaders.slice(0))
                d.cancel(u);
              this._pdfDataRangeTransport.abort();
            }
          }
          e.PDFDataTransportStream = s;
          class o {
            constructor(u, h, d = !1, w = null) {
              this._stream = u, this._done = d || !1, this._filename = (0, a.isPdfFile)(w) ? w : null, this._queuedChunks = h || [], this._loaded = 0;
              for (const b of this._queuedChunks)
                this._loaded += b.byteLength;
              this._requests = [], this._headersReady = Promise.resolve(), u._fullRequestReader = this, this.onProgress = null;
            }
            _enqueue(u) {
              this._done || (this._requests.length > 0 ? this._requests.shift().resolve({
                value: u,
                done: !1
              }) : this._queuedChunks.push(u), this._loaded += u.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 u = new n.PromiseCapability();
              return this._requests.push(u), u.promise;
            }
            cancel(u) {
              this._done = !0;
              for (const h of this._requests)
                h.resolve({
                  value: void 0,
                  done: !0
                });
              this._requests.length = 0;
            }
            progressiveDone() {
              this._done || (this._done = !0);
            }
          }
          class c {
            constructor(u, h, d) {
              this._stream = u, this._begin = h, this._end = d, this._queuedChunk = null, this._requests = [], this._done = !1, this.onProgress = null;
            }
            _enqueue(u) {
              if (!this._done) {
                if (this._requests.length === 0)
                  this._queuedChunk = u;
                else {
                  this._requests.shift().resolve({
                    value: u,
                    done: !1
                  });
                  for (const d of this._requests)
                    d.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 h = this._queuedChunk;
                return this._queuedChunk = null, {
                  value: h,
                  done: !1
                };
              }
              if (this._done)
                return {
                  value: void 0,
                  done: !0
                };
              const u = new n.PromiseCapability();
              return this._requests.push(u), u.promise;
            }
            cancel(u) {
              this._done = !0;
              for (const h of this._requests)
                h.resolve({
                  value: void 0,
                  done: !0
                });
              this._requests.length = 0, this._stream._removeRangeReader(this);
            }
          }
        },
        /* 19 */
        /***/
        (r, e, t) => {
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.PDFFetchStream = void 0;
          var n = t(1), a = t(20);
          function s(d, w, b) {
            return {
              method: "GET",
              headers: d,
              signal: b.signal,
              mode: "cors",
              credentials: w ? "include" : "same-origin",
              redirect: "follow"
            };
          }
          function o(d) {
            const w = new Headers();
            for (const b in d) {
              const _ = d[b];
              _ !== void 0 && w.append(b, _);
            }
            return w;
          }
          function c(d) {
            return d instanceof Uint8Array ? d.buffer : d instanceof ArrayBuffer ? d : ((0, n.warn)(`getArrayBuffer - unexpected data format: ${d}`), new Uint8Array(d).buffer);
          }
          class l {
            constructor(w) {
              this.source = w, this.isHttp = /^https?:/i.test(w.url), this.httpHeaders = this.isHttp && w.httpHeaders || {}, this._fullRequestReader = null, this._rangeRequestReaders = [];
            }
            get _progressiveDataLength() {
              var w;
              return ((w = this._fullRequestReader) == null ? void 0 : w._loaded) ?? 0;
            }
            getFullReader() {
              return (0, n.assert)(!this._fullRequestReader, "PDFFetchStream.getFullReader can only be called once."), this._fullRequestReader = new u(this), this._fullRequestReader;
            }
            getRangeReader(w, b) {
              if (b <= this._progressiveDataLength)
                return null;
              const _ = new h(this, w, b);
              return this._rangeRequestReaders.push(_), _;
            }
            cancelAllRequests(w) {
              var b;
              (b = this._fullRequestReader) == null || b.cancel(w);
              for (const _ of this._rangeRequestReaders.slice(0))
                _.cancel(w);
            }
          }
          e.PDFFetchStream = l;
          class u {
            constructor(w) {
              this._stream = w, this._reader = null, this._loaded = 0, this._filename = null;
              const b = w.source;
              this._withCredentials = b.withCredentials || !1, this._contentLength = b.length, this._headersCapability = new n.PromiseCapability(), this._disableRange = b.disableRange || !1, this._rangeChunkSize = b.rangeChunkSize, !this._rangeChunkSize && !this._disableRange && (this._disableRange = !0), this._abortController = new AbortController(), this._isStreamingSupported = !b.disableStream, this._isRangeSupported = !b.disableRange, this._headers = o(this._stream.httpHeaders);
              const _ = b.url;
              fetch(_, s(this._headers, this._withCredentials, this._abortController)).then((R) => {
                if (!(0, a.validateResponseStatus)(R.status))
                  throw (0, a.createResponseStatusError)(R.status, _);
                this._reader = R.body.getReader(), this._headersCapability.resolve();
                const k = (A) => R.headers.get(A), {
                  allowRangeRequests: C,
                  suggestedLength: m
                } = (0, a.validateRangeRequestCapabilities)({
                  getResponseHeader: k,
                  isHttp: this._stream.isHttp,
                  rangeChunkSize: this._rangeChunkSize,
                  disableRange: this._disableRange
                });
                this._isRangeSupported = C, this._contentLength = m || this._contentLength, this._filename = (0, a.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() {
              var _;
              await this._headersCapability.promise;
              const {
                value: w,
                done: b
              } = await this._reader.read();
              return b ? {
                value: w,
                done: b
              } : (this._loaded += w.byteLength, (_ = this.onProgress) == null || _.call(this, {
                loaded: this._loaded,
                total: this._contentLength
              }), {
                value: c(w),
                done: !1
              });
            }
            cancel(w) {
              var b;
              (b = this._reader) == null || b.cancel(w), this._abortController.abort();
            }
          }
          class h {
            constructor(w, b, _) {
              this._stream = w, this._reader = null, this._loaded = 0;
              const R = w.source;
              this._withCredentials = R.withCredentials || !1, this._readCapability = new n.PromiseCapability(), this._isStreamingSupported = !R.disableStream, this._abortController = new AbortController(), this._headers = o(this._stream.httpHeaders), this._headers.append("Range", `bytes=${b}-${_ - 1}`);
              const k = R.url;
              fetch(k, s(this._headers, this._withCredentials, this._abortController)).then((C) => {
                if (!(0, a.validateResponseStatus)(C.status))
                  throw (0, a.createResponseStatusError)(C.status, k);
                this._readCapability.resolve(), this._reader = C.body.getReader();
              }).catch(this._readCapability.reject), this.onProgress = null;
            }
            get isStreamingSupported() {
              return this._isStreamingSupported;
            }
            async read() {
              var _;
              await this._readCapability.promise;
              const {
                value: w,
                done: b
              } = await this._reader.read();
              return b ? {
                value: w,
                done: b
              } : (this._loaded += w.byteLength, (_ = this.onProgress) == null || _.call(this, {
                loaded: this._loaded
              }), {
                value: c(w),
                done: !1
              });
            }
            cancel(w) {
              var b;
              (b = this._reader) == null || b.cancel(w), this._abortController.abort();
            }
          }
        },
        /* 20 */
        /***/
        (r, e, t) => {
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.createResponseStatusError = l, e.extractFilenameFromHeader = c, e.validateRangeRequestCapabilities = o, e.validateResponseStatus = u;
          var n = t(1), a = t(21), s = t(6);
          function o({
            getResponseHeader: h,
            isHttp: d,
            rangeChunkSize: w,
            disableRange: b
          }) {
            const _ = {
              allowRangeRequests: !1,
              suggestedLength: void 0
            }, R = parseInt(h("Content-Length"), 10);
            return !Number.isInteger(R) || (_.suggestedLength = R, R <= 2 * w) || b || !d || h("Accept-Ranges") !== "bytes" || (h("Content-Encoding") || "identity") !== "identity" || (_.allowRangeRequests = !0), _;
          }
          function c(h) {
            const d = h("Content-Disposition");
            if (d) {
              let w = (0, a.getFilenameFromContentDispositionHeader)(d);
              if (w.includes("%"))
                try {
                  w = decodeURIComponent(w);
                } catch {
                }
              if ((0, s.isPdfFile)(w))
                return w;
            }
            return null;
          }
          function l(h, d) {
            return h === 404 || h === 0 && d.startsWith("file:") ? new n.MissingPDFException('Missing PDF "' + d + '".') : new n.UnexpectedResponseException(`Unexpected server response (${h}) while retrieving PDF "${d}".`, h);
          }
          function u(h) {
            return h === 200 || h === 206;
          }
        },
        /* 21 */
        /***/
        (r, e, t) => {
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.getFilenameFromContentDispositionHeader = a;
          var n = t(1);
          function a(s) {
            let o = !0, c = l("filename\\*", "i").exec(s);
            if (c) {
              c = c[1];
              let R = w(c);
              return R = unescape(R), R = b(R), R = _(R), h(R);
            }
            if (c = d(s), c) {
              const R = _(c);
              return h(R);
            }
            if (c = l("filename", "i").exec(s), c) {
              c = c[1];
              let R = w(c);
              return R = _(R), h(R);
            }
            function l(R, k) {
              return new RegExp("(?:^|;)\\s*" + R + '\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)', k);
            }
            function u(R, k) {
              if (R) {
                if (!/^[\x00-\xFF]+$/.test(k))
                  return k;
                try {
                  const C = new TextDecoder(R, {
                    fatal: !0
                  }), m = (0, n.stringToBytes)(k);
                  k = C.decode(m), o = !1;
                } catch {
                }
              }
              return k;
            }
            function h(R) {
              return o && /[\x80-\xff]/.test(R) && (R = u("utf-8", R), o && (R = u("iso-8859-1", R))), R;
            }
            function d(R) {
              const k = [];
              let C;
              const m = l("filename\\*((?!0\\d)\\d+)(\\*?)", "ig");
              for (; (C = m.exec(R)) !== null; ) {
                let [, F, f, g] = C;
                if (F = parseInt(F, 10), F in k) {
                  if (F === 0)
                    break;
                  continue;
                }
                k[F] = [f, g];
              }
              const A = [];
              for (let F = 0; F < k.length && F in k; ++F) {
                let [f, g] = k[F];
                g = w(g), f && (g = unescape(g), F === 0 && (g = b(g))), A.push(g);
              }
              return A.join("");
            }
            function w(R) {
              if (R.startsWith('"')) {
                const k = R.slice(1).split('\\"');
                for (let C = 0; C < k.length; ++C) {
                  const m = k[C].indexOf('"');
                  m !== -1 && (k[C] = k[C].slice(0, m), k.length = C + 1), k[C] = k[C].replaceAll(/\\(.)/g, "$1");
                }
                R = k.join('"');
              }
              return R;
            }
            function b(R) {
              const k = R.indexOf("'");
              if (k === -1)
                return R;
              const C = R.slice(0, k), A = R.slice(k + 1).replace(/^[^']*'/, "");
              return u(C, A);
            }
            function _(R) {
              return !R.startsWith("=?") || /[\x00-\x19\x80-\xff]/.test(R) ? R : R.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g, function(k, C, m, A) {
                if (m === "q" || m === "Q")
                  return A = A.replaceAll("_", " "), A = A.replaceAll(/=([0-9a-fA-F]{2})/g, function(F, f) {
                    return String.fromCharCode(parseInt(f, 16));
                  }), u(C, A);
                try {
                  A = atob(A);
                } catch {
                }
                return u(C, A);
              });
            }
            return "";
          }
        },
        /* 22 */
        /***/
        (r, e, t) => {
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.PDFNetworkStream = void 0;
          var n = t(1), a = t(20);
          const s = 200, o = 206;
          function c(w) {
            const b = w.response;
            return typeof b != "string" ? b : (0, n.stringToBytes)(b).buffer;
          }
          class l {
            constructor(b, _ = {}) {
              this.url = b, this.isHttp = /^https?:/i.test(b), this.httpHeaders = this.isHttp && _.httpHeaders || /* @__PURE__ */ Object.create(null), this.withCredentials = _.withCredentials || !1, this.currXhrId = 0, this.pendingRequests = /* @__PURE__ */ Object.create(null);
            }
            requestRange(b, _, R) {
              const k = {
                begin: b,
                end: _
              };
              for (const C in R)
                k[C] = R[C];
              return this.request(k);
            }
            requestFull(b) {
              return this.request(b);
            }
            request(b) {
              const _ = new XMLHttpRequest(), R = this.currXhrId++, k = this.pendingRequests[R] = {
                xhr: _
              };
              _.open("GET", this.url), _.withCredentials = this.withCredentials;
              for (const C in this.httpHeaders) {
                const m = this.httpHeaders[C];
                m !== void 0 && _.setRequestHeader(C, m);
              }
              return this.isHttp && "begin" in b && "end" in b ? (_.setRequestHeader("Range", `bytes=${b.begin}-${b.end - 1}`), k.expectedStatus = o) : k.expectedStatus = s, _.responseType = "arraybuffer", b.onError && (_.onerror = function(C) {
                b.onError(_.status);
              }), _.onreadystatechange = this.onStateChange.bind(this, R), _.onprogress = this.onProgress.bind(this, R), k.onHeadersReceived = b.onHeadersReceived, k.onDone = b.onDone, k.onError = b.onError, k.onProgress = b.onProgress, _.send(null), R;
            }
            onProgress(b, _) {
              var k;
              const R = this.pendingRequests[b];
              R && ((k = R.onProgress) == null || k.call(R, _));
            }
            onStateChange(b, _) {
              var F, f, g;
              const R = this.pendingRequests[b];
              if (!R)
                return;
              const k = R.xhr;
              if (k.readyState >= 2 && R.onHeadersReceived && (R.onHeadersReceived(), delete R.onHeadersReceived), k.readyState !== 4 || !(b in this.pendingRequests))
                return;
              if (delete this.pendingRequests[b], k.status === 0 && this.isHttp) {
                (F = R.onError) == null || F.call(R, k.status);
                return;
              }
              const C = k.status || s;
              if (!(C === s && R.expectedStatus === o) && C !== R.expectedStatus) {
                (f = R.onError) == null || f.call(R, k.status);
                return;
              }
              const A = c(k);
              if (C === o) {
                const y = k.getResponseHeader("Content-Range"), E = /bytes (\d+)-(\d+)\/(\d+)/.exec(y);
                R.onDone({
                  begin: parseInt(E[1], 10),
                  chunk: A
                });
              } else A ? R.onDone({
                begin: 0,
                chunk: A
              }) : (g = R.onError) == null || g.call(R, k.status);
            }
            getRequestXhr(b) {
              return this.pendingRequests[b].xhr;
            }
            isPendingRequest(b) {
              return b in this.pendingRequests;
            }
            abortRequest(b) {
              const _ = this.pendingRequests[b].xhr;
              delete this.pendingRequests[b], _.abort();
            }
          }
          class u {
            constructor(b) {
              this._source = b, this._manager = new l(b.url, {
                httpHeaders: b.httpHeaders,
                withCredentials: b.withCredentials
              }), this._rangeChunkSize = b.rangeChunkSize, this._fullRequestReader = null, this._rangeRequestReaders = [];
            }
            _onRangeRequestReaderClosed(b) {
              const _ = this._rangeRequestReaders.indexOf(b);
              _ >= 0 && this._rangeRequestReaders.splice(_, 1);
            }
            getFullReader() {
              return (0, n.assert)(!this._fullRequestReader, "PDFNetworkStream.getFullReader can only be called once."), this._fullRequestReader = new h(this._manager, this._source), this._fullRequestReader;
            }
            getRangeReader(b, _) {
              const R = new d(this._manager, b, _);
              return R.onClosed = this._onRangeRequestReaderClosed.bind(this), this._rangeRequestReaders.push(R), R;
            }
            cancelAllRequests(b) {
              var _;
              (_ = this._fullRequestReader) == null || _.cancel(b);
              for (const R of this._rangeRequestReaders.slice(0))
                R.cancel(b);
            }
          }
          e.PDFNetworkStream = u;
          class h {
            constructor(b, _) {
              this._manager = b;
              const R = {
                onHeadersReceived: this._onHeadersReceived.bind(this),
                onDone: this._onDone.bind(this),
                onError: this._onError.bind(this),
                onProgress: this._onProgress.bind(this)
              };
              this._url = _.url, this._fullRequestId = b.requestFull(R), this._headersReceivedCapability = new n.PromiseCapability(), this._disableRange = _.disableRange || !1, this._contentLength = _.length, this._rangeChunkSize = _.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 b = this._fullRequestId, _ = this._manager.getRequestXhr(b), R = (m) => _.getResponseHeader(m), {
                allowRangeRequests: k,
                suggestedLength: C
              } = (0, a.validateRangeRequestCapabilities)({
                getResponseHeader: R,
                isHttp: this._manager.isHttp,
                rangeChunkSize: this._rangeChunkSize,
                disableRange: this._disableRange
              });
              k && (this._isRangeSupported = !0), this._contentLength = C || this._contentLength, this._filename = (0, a.extractFilenameFromHeader)(R), this._isRangeSupported && this._manager.abortRequest(b), this._headersReceivedCapability.resolve();
            }
            _onDone(b) {
              if (b && (this._requests.length > 0 ? this._requests.shift().resolve({
                value: b.chunk,
                done: !1
              }) : this._cachedChunks.push(b.chunk)), this._done = !0, !(this._cachedChunks.length > 0)) {
                for (const _ of this._requests)
                  _.resolve({
                    value: void 0,
                    done: !0
                  });
                this._requests.length = 0;
              }
            }
            _onError(b) {
              this._storedError = (0, a.createResponseStatusError)(b, this._url), this._headersReceivedCapability.reject(this._storedError);
              for (const _ of this._requests)
                _.reject(this._storedError);
              this._requests.length = 0, this._cachedChunks.length = 0;
            }
            _onProgress(b) {
              var _;
              (_ = this.onProgress) == null || _.call(this, {
                loaded: b.loaded,
                total: b.lengthComputable ? b.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 b = new n.PromiseCapability();
              return this._requests.push(b), b.promise;
            }
            cancel(b) {
              this._done = !0, this._headersReceivedCapability.reject(b);
              for (const _ of this._requests)
                _.resolve({
                  value: void 0,
                  done: !0
                });
              this._requests.length = 0, this._manager.isPendingRequest(this._fullRequestId) && this._manager.abortRequest(this._fullRequestId), this._fullRequestReader = null;
            }
          }
          class d {
            constructor(b, _, R) {
              this._manager = b;
              const k = {
                onDone: this._onDone.bind(this),
                onError: this._onError.bind(this),
                onProgress: this._onProgress.bind(this)
              };
              this._url = b.url, this._requestId = b.requestRange(_, R, k), this._requests = [], this._queuedChunk = null, this._done = !1, this._storedError = void 0, this.onProgress = null, this.onClosed = null;
            }
            _close() {
              var b;
              (b = this.onClosed) == null || b.call(this, this);
            }
            _onDone(b) {
              const _ = b.chunk;
              this._requests.length > 0 ? this._requests.shift().resolve({
                value: _,
                done: !1
              }) : this._queuedChunk = _, this._done = !0;
              for (const R of this._requests)
                R.resolve({
                  value: void 0,
                  done: !0
                });
              this._requests.length = 0, this._close();
            }
            _onError(b) {
              this._storedError = (0, a.createResponseStatusError)(b, this._url);
              for (const _ of this._requests)
                _.reject(this._storedError);
              this._requests.length = 0, this._queuedChunk = null;
            }
            _onProgress(b) {
              var _;
              this.isStreamingSupported || (_ = this.onProgress) == null || _.call(this, {
                loaded: b.loaded
              });
            }
            get isStreamingSupported() {
              return !1;
            }
            async read() {
              if (this._storedError)
                throw this._storedError;
              if (this._queuedChunk !== null) {
                const _ = this._queuedChunk;
                return this._queuedChunk = null, {
                  value: _,
                  done: !1
                };
              }
              if (this._done)
                return {
                  value: void 0,
                  done: !0
                };
              const b = new n.PromiseCapability();
              return this._requests.push(b), b.promise;
            }
            cancel(b) {
              this._done = !0;
              for (const _ of this._requests)
                _.resolve({
                  value: void 0,
                  done: !0
                });
              this._requests.length = 0, this._manager.isPendingRequest(this._requestId) && this._manager.abortRequest(this._requestId), this._close();
            }
          }
        },
        /* 23 */
        /***/
        (r, e, t) => {
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.PDFNodeStream = void 0;
          var n = t(1), a = t(20);
          const s = /^file:\/\/\/[a-zA-Z]:\//;
          function o(R) {
            const k = require$$5, C = k.parse(R);
            return C.protocol === "file:" || C.host ? C : /^[a-z]:[/\\]/i.test(R) ? k.parse(`file:///${R}`) : (C.host || (C.protocol = "file:"), C);
          }
          class c {
            constructor(k) {
              this.source = k, this.url = o(k.url), this.isHttp = this.url.protocol === "http:" || this.url.protocol === "https:", this.isFsUrl = this.url.protocol === "file:", this.httpHeaders = this.isHttp && k.httpHeaders || {}, this._fullRequestReader = null, this._rangeRequestReaders = [];
            }
            get _progressiveDataLength() {
              var k;
              return ((k = this._fullRequestReader) == null ? void 0 : k._loaded) ?? 0;
            }
            getFullReader() {
              return (0, n.assert)(!this._fullRequestReader, "PDFNodeStream.getFullReader can only be called once."), this._fullRequestReader = this.isFsUrl ? new b(this) : new d(this), this._fullRequestReader;
            }
            getRangeReader(k, C) {
              if (C <= this._progressiveDataLength)
                return null;
              const m = this.isFsUrl ? new _(this, k, C) : new w(this, k, C);
              return this._rangeRequestReaders.push(m), m;
            }
            cancelAllRequests(k) {
              var C;
              (C = this._fullRequestReader) == null || C.cancel(k);
              for (const m of this._rangeRequestReaders.slice(0))
                m.cancel(k);
            }
          }
          e.PDFNodeStream = c;
          class l {
            constructor(k) {
              this._url = k.url, this._done = !1, this._storedError = null, this.onProgress = null;
              const C = k.source;
              this._contentLength = C.length, this._loaded = 0, this._filename = null, this._disableRange = C.disableRange || !1, this._rangeChunkSize = C.rangeChunkSize, !this._rangeChunkSize && !this._disableRange && (this._disableRange = !0), this._isStreamingSupported = !C.disableStream, this._isRangeSupported = !C.disableRange, this._readableStream = null, this._readCapability = new n.PromiseCapability(), this._headersCapability = new n.PromiseCapability();
            }
            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() {
              var m;
              if (await this._readCapability.promise, this._done)
                return {
                  value: void 0,
                  done: !0
                };
              if (this._storedError)
                throw this._storedError;
              const k = this._readableStream.read();
              return k === null ? (this._readCapability = new n.PromiseCapability(), this.read()) : (this._loaded += k.length, (m = this.onProgress) == null || m.call(this, {
                loaded: this._loaded,
                total: this._contentLength
              }), {
                value: new Uint8Array(k).buffer,
                done: !1
              });
            }
            cancel(k) {
              if (!this._readableStream) {
                this._error(k);
                return;
              }
              this._readableStream.destroy(k);
            }
            _error(k) {
              this._storedError = k, this._readCapability.resolve();
            }
            _setReadableStream(k) {
              this._readableStream = k, k.on("readable", () => {
                this._readCapability.resolve();
              }), k.on("end", () => {
                k.destroy(), this._done = !0, this._readCapability.resolve();
              }), k.on("error", (C) => {
                this._error(C);
              }), !this._isStreamingSupported && this._isRangeSupported && this._error(new n.AbortException("streaming is disabled")), this._storedError && this._readableStream.destroy(this._storedError);
            }
          }
          class u {
            constructor(k) {
              this._url = k.url, this._done = !1, this._storedError = null, this.onProgress = null, this._loaded = 0, this._readableStream = null, this._readCapability = new n.PromiseCapability();
              const C = k.source;
              this._isStreamingSupported = !C.disableStream;
            }
            get isStreamingSupported() {
              return this._isStreamingSupported;
            }
            async read() {
              var m;
              if (await this._readCapability.promise, this._done)
                return {
                  value: void 0,
                  done: !0
                };
              if (this._storedError)
                throw this._storedError;
              const k = this._readableStream.read();
              return k === null ? (this._readCapability = new n.PromiseCapability(), this.read()) : (this._loaded += k.length, (m = this.onProgress) == null || m.call(this, {
                loaded: this._loaded
              }), {
                value: new Uint8Array(k).buffer,
                done: !1
              });
            }
            cancel(k) {
              if (!this._readableStream) {
                this._error(k);
                return;
              }
              this._readableStream.destroy(k);
            }
            _error(k) {
              this._storedError = k, this._readCapability.resolve();
            }
            _setReadableStream(k) {
              this._readableStream = k, k.on("readable", () => {
                this._readCapability.resolve();
              }), k.on("end", () => {
                k.destroy(), this._done = !0, this._readCapability.resolve();
              }), k.on("error", (C) => {
                this._error(C);
              }), this._storedError && this._readableStream.destroy(this._storedError);
            }
          }
          function h(R, k) {
            return {
              protocol: R.protocol,
              auth: R.auth,
              host: R.hostname,
              port: R.port,
              path: R.path,
              method: "GET",
              headers: k
            };
          }
          class d extends l {
            constructor(k) {
              super(k);
              const C = (m) => {
                if (m.statusCode === 404) {
                  const g = new n.MissingPDFException(`Missing PDF "${this._url}".`);
                  this._storedError = g, this._headersCapability.reject(g);
                  return;
                }
                this._headersCapability.resolve(), this._setReadableStream(m);
                const A = (g) => this._readableStream.headers[g.toLowerCase()], {
                  allowRangeRequests: F,
                  suggestedLength: f
                } = (0, a.validateRangeRequestCapabilities)({
                  getResponseHeader: A,
                  isHttp: k.isHttp,
                  rangeChunkSize: this._rangeChunkSize,
                  disableRange: this._disableRange
                });
                this._isRangeSupported = F, this._contentLength = f || this._contentLength, this._filename = (0, a.extractFilenameFromHeader)(A);
              };
              if (this._request = null, this._url.protocol === "http:") {
                const m = require$$5;
                this._request = m.request(h(this._url, k.httpHeaders), C);
              } else {
                const m = require$$5;
                this._request = m.request(h(this._url, k.httpHeaders), C);
              }
              this._request.on("error", (m) => {
                this._storedError = m, this._headersCapability.reject(m);
              }), this._request.end();
            }
          }
          class w extends u {
            constructor(k, C, m) {
              super(k), this._httpHeaders = {};
              for (const F in k.httpHeaders) {
                const f = k.httpHeaders[F];
                f !== void 0 && (this._httpHeaders[F] = f);
              }
              this._httpHeaders.Range = `bytes=${C}-${m - 1}`;
              const A = (F) => {
                if (F.statusCode === 404) {
                  const f = new n.MissingPDFException(`Missing PDF "${this._url}".`);
                  this._storedError = f;
                  return;
                }
                this._setReadableStream(F);
              };
              if (this._request = null, this._url.protocol === "http:") {
                const F = require$$5;
                this._request = F.request(h(this._url, this._httpHeaders), A);
              } else {
                const F = require$$5;
                this._request = F.request(h(this._url, this._httpHeaders), A);
              }
              this._request.on("error", (F) => {
                this._storedError = F;
              }), this._request.end();
            }
          }
          class b extends l {
            constructor(k) {
              super(k);
              let C = decodeURIComponent(this._url.path);
              s.test(this._url.href) && (C = C.replace(/^\//, ""));
              const m = require$$5;
              m.lstat(C, (A, F) => {
                if (A) {
                  A.code === "ENOENT" && (A = new n.MissingPDFException(`Missing PDF "${C}".`)), this._storedError = A, this._headersCapability.reject(A);
                  return;
                }
                this._contentLength = F.size, this._setReadableStream(m.createReadStream(C)), this._headersCapability.resolve();
              });
            }
          }
          class _ extends u {
            constructor(k, C, m) {
              super(k);
              let A = decodeURIComponent(this._url.path);
              s.test(this._url.href) && (A = A.replace(/^\//, ""));
              const F = require$$5;
              this._setReadableStream(F.createReadStream(A, {
                start: C,
                end: m - 1
              }));
            }
          }
        },
        /* 24 */
        /***/
        (r, e, t) => {
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.SVGGraphics = void 0;
          var n = t(6), a = t(1);
          const s = {
            fontStyle: "normal",
            fontWeight: "normal",
            fillColor: "#000000"
          }, o = "http://www.w3.org/XML/1998/namespace", c = "http://www.w3.org/1999/xlink", l = ["butt", "round", "square"], u = ["miter", "round", "bevel"], h = function(F, f = "", g = !1) {
            if (URL.createObjectURL && typeof Blob < "u" && !g)
              return URL.createObjectURL(new Blob([F], {
                type: f
              }));
            const y = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
            let E = `data:${f};base64,`;
            for (let x = 0, O = F.length; x < O; x += 3) {
              const P = F[x] & 255, I = F[x + 1] & 255, G = F[x + 2] & 255, ne = P >> 2, X = (P & 3) << 4 | I >> 4, ee = x + 1 < O ? (I & 15) << 2 | G >> 6 : 64, K = x + 2 < O ? G & 63 : 64;
              E += y[ne] + y[X] + y[ee] + y[K];
            }
            return E;
          }, d = function() {
            const F = new Uint8Array([137, 80, 78, 71, 13, 10, 26, 10]), f = 12, g = new Int32Array(256);
            for (let G = 0; G < 256; G++) {
              let ne = G;
              for (let X = 0; X < 8; X++)
                ne = ne & 1 ? 3988292384 ^ ne >> 1 & 2147483647 : ne >> 1 & 2147483647;
              g[G] = ne;
            }
            function y(G, ne, X) {
              let ee = -1;
              for (let K = ne; K < X; K++) {
                const se = (ee ^ G[K]) & 255, q = g[se];
                ee = ee >>> 8 ^ q;
              }
              return ee ^ -1;
            }
            function E(G, ne, X, ee) {
              let K = ee;
              const se = ne.length;
              X[K] = se >> 24 & 255, X[K + 1] = se >> 16 & 255, X[K + 2] = se >> 8 & 255, X[K + 3] = se & 255, K += 4, X[K] = G.charCodeAt(0) & 255, X[K + 1] = G.charCodeAt(1) & 255, X[K + 2] = G.charCodeAt(2) & 255, X[K + 3] = G.charCodeAt(3) & 255, K += 4, X.set(ne, K), K += ne.length;
              const q = y(X, ee + 4, K);
              X[K] = q >> 24 & 255, X[K + 1] = q >> 16 & 255, X[K + 2] = q >> 8 & 255, X[K + 3] = q & 255;
            }
            function x(G, ne, X) {
              let ee = 1, K = 0;
              for (let se = ne; se < X; ++se)
                ee = (ee + (G[se] & 255)) % 65521, K = (K + ee) % 65521;
              return K << 16 | ee;
            }
            function O(G) {
              if (!a.isNodeJS)
                return P(G);
              try {
                const ne = parseInt(process.versions.node) >= 8 ? G : Buffer.from(G), X = require$$5.deflateSync(ne, {
                  level: 9
                });
                return X instanceof Uint8Array ? X : new Uint8Array(X);
              } catch (ne) {
                (0, a.warn)("Not compressing PNG because zlib.deflateSync is unavailable: " + ne);
              }
              return P(G);
            }
            function P(G) {
              let ne = G.length;
              const X = 65535, ee = Math.ceil(ne / X), K = new Uint8Array(2 + ne + ee * 5 + 4);
              let se = 0;
              K[se++] = 120, K[se++] = 156;
              let q = 0;
              for (; ne > X; )
                K[se++] = 0, K[se++] = 255, K[se++] = 255, K[se++] = 0, K[se++] = 0, K.set(G.subarray(q, q + X), se), se += X, q += X, ne -= X;
              K[se++] = 1, K[se++] = ne & 255, K[se++] = ne >> 8 & 255, K[se++] = ~ne & 65535 & 255, K[se++] = (~ne & 65535) >> 8 & 255, K.set(G.subarray(q), se), se += G.length - q;
              const Y = x(G, 0, G.length);
              return K[se++] = Y >> 24 & 255, K[se++] = Y >> 16 & 255, K[se++] = Y >> 8 & 255, K[se++] = Y & 255, K;
            }
            function I(G, ne, X, ee) {
              const K = G.width, se = G.height;
              let q, Y, J;
              const N = G.data;
              switch (ne) {
                case a.ImageKind.GRAYSCALE_1BPP:
                  Y = 0, q = 1, J = K + 7 >> 3;
                  break;
                case a.ImageKind.RGB_24BPP:
                  Y = 2, q = 8, J = K * 3;
                  break;
                case a.ImageKind.RGBA_32BPP:
                  Y = 6, q = 8, J = K * 4;
                  break;
                default:
                  throw new Error("invalid format");
              }
              const M = new Uint8Array((1 + J) * se);
              let v = 0, L = 0;
              for (let pe = 0; pe < se; ++pe)
                M[v++] = 0, M.set(N.subarray(L, L + J), v), L += J, v += J;
              if (ne === a.ImageKind.GRAYSCALE_1BPP && ee) {
                v = 0;
                for (let pe = 0; pe < se; pe++) {
                  v++;
                  for (let be = 0; be < J; be++)
                    M[v++] ^= 255;
                }
              }
              const H = new Uint8Array([K >> 24 & 255, K >> 16 & 255, K >> 8 & 255, K & 255, se >> 24 & 255, se >> 16 & 255, se >> 8 & 255, se & 255, q, Y, 0, 0, 0]), B = O(M), U = F.length + f * 3 + H.length + B.length, Z = new Uint8Array(U);
              let re = 0;
              return Z.set(F, re), re += F.length, E("IHDR", H, Z, re), re += f + H.length, E("IDATA", B, Z, re), re += f + B.length, E("IEND", new Uint8Array(0), Z, re), h(Z, "image/png", X);
            }
            return function(ne, X, ee) {
              const K = ne.kind === void 0 ? a.ImageKind.GRAYSCALE_1BPP : ne.kind;
              return I(ne, K, X, ee);
            };
          }();
          class w {
            constructor() {
              this.fontSizeScale = 1, this.fontWeight = s.fontWeight, this.fontSize = 0, this.textMatrix = a.IDENTITY_MATRIX, this.fontMatrix = a.FONT_IDENTITY_MATRIX, this.leading = 0, this.textRenderingMode = a.TextRenderingMode.FILL, this.textMatrixScale = 1, this.x = 0, this.y = 0, this.lineX = 0, this.lineY = 0, this.charSpacing = 0, this.wordSpacing = 0, this.textHScale = 1, this.textRise = 0, this.fillColor = s.fillColor, this.strokeColor = "#000000", this.fillAlpha = 1, this.strokeAlpha = 1, this.lineWidth = 1, this.lineJoin = "", this.lineCap = "", this.miterLimit = 0, this.dashArray = [], this.dashPhase = 0, this.dependencies = [], this.activeClipUrl = null, this.clipGroup = null, this.maskId = "";
            }
            clone() {
              return Object.create(this);
            }
            setCurrentPoint(f, g) {
              this.x = f, this.y = g;
            }
          }
          function b(F) {
            let f = [];
            const g = [];
            for (const y of F) {
              if (y.fn === "save") {
                f.push({
                  fnId: 92,
                  fn: "group",
                  items: []
                }), g.push(f), f = f.at(-1).items;
                continue;
              }
              y.fn === "restore" ? f = g.pop() : f.push(y);
            }
            return f;
          }
          function _(F) {
            if (Number.isInteger(F))
              return F.toString();
            const f = F.toFixed(10);
            let g = f.length - 1;
            if (f[g] !== "0")
              return f;
            do
              g--;
            while (f[g] === "0");
            return f.substring(0, f[g] === "." ? g : g + 1);
          }
          function R(F) {
            if (F[4] === 0 && F[5] === 0) {
              if (F[1] === 0 && F[2] === 0)
                return F[0] === 1 && F[3] === 1 ? "" : `scale(${_(F[0])} ${_(F[3])})`;
              if (F[0] === F[3] && F[1] === -F[2]) {
                const f = Math.acos(F[0]) * 180 / Math.PI;
                return `rotate(${_(f)})`;
              }
            } else if (F[0] === 1 && F[1] === 0 && F[2] === 0 && F[3] === 1)
              return `translate(${_(F[4])} ${_(F[5])})`;
            return `matrix(${_(F[0])} ${_(F[1])} ${_(F[2])} ${_(F[3])} ${_(F[4])} ${_(F[5])})`;
          }
          let k = 0, C = 0, m = 0;
          class A {
            constructor(f, g, y = !1) {
              (0, n.deprecated)("The SVG back-end is no longer maintained and *may* be removed in the future."), this.svgFactory = new n.DOMSVGFactory(), this.current = new w(), this.transformMatrix = a.IDENTITY_MATRIX, this.transformStack = [], this.extraStack = [], this.commonObjs = f, this.objs = g, this.pendingClip = null, this.pendingEOFill = !1, this.embedFonts = !1, this.embeddedFonts = /* @__PURE__ */ Object.create(null), this.cssStyle = null, this.forceDataSchema = !!y, this._operatorIdMapping = [];
              for (const E in a.OPS)
                this._operatorIdMapping[a.OPS[E]] = E;
            }
            getObject(f, g = null) {
              return typeof f == "string" ? f.startsWith("g_") ? this.commonObjs.get(f) : this.objs.get(f) : g;
            }
            save() {
              this.transformStack.push(this.transformMatrix);
              const f = this.current;
              this.extraStack.push(f), this.current = f.clone();
            }
            restore() {
              this.transformMatrix = this.transformStack.pop(), this.current = this.extraStack.pop(), this.pendingClip = null, this.tgrp = null;
            }
            group(f) {
              this.save(), this.executeOpTree(f), this.restore();
            }
            loadDependencies(f) {
              const g = f.fnArray, y = f.argsArray;
              for (let E = 0, x = g.length; E < x; E++)
                if (g[E] === a.OPS.dependency)
                  for (const O of y[E]) {
                    const P = O.startsWith("g_") ? this.commonObjs : this.objs, I = new Promise((G) => {
                      P.get(O, G);
                    });
                    this.current.dependencies.push(I);
                  }
              return Promise.all(this.current.dependencies);
            }
            transform(f, g, y, E, x, O) {
              const P = [f, g, y, E, x, O];
              this.transformMatrix = a.Util.transform(this.transformMatrix, P), this.tgrp = null;
            }
            getSVG(f, g) {
              this.viewport = g;
              const y = this._initialize(g);
              return this.loadDependencies(f).then(() => (this.transformMatrix = a.IDENTITY_MATRIX, this.executeOpTree(this.convertOpList(f)), y));
            }
            convertOpList(f) {
              const g = this._operatorIdMapping, y = f.argsArray, E = f.fnArray, x = [];
              for (let O = 0, P = E.length; O < P; O++) {
                const I = E[O];
                x.push({
                  fnId: I,
                  fn: g[I],
                  args: y[O]
                });
              }
              return b(x);
            }
            executeOpTree(f) {
              for (const g of f) {
                const y = g.fn, E = g.fnId, x = g.args;
                switch (E | 0) {
                  case a.OPS.beginText:
                    this.beginText();
                    break;
                  case a.OPS.dependency:
                    break;
                  case a.OPS.setLeading:
                    this.setLeading(x);
                    break;
                  case a.OPS.setLeadingMoveText:
                    this.setLeadingMoveText(x[0], x[1]);
                    break;
                  case a.OPS.setFont:
                    this.setFont(x);
                    break;
                  case a.OPS.showText:
                    this.showText(x[0]);
                    break;
                  case a.OPS.showSpacedText:
                    this.showText(x[0]);
                    break;
                  case a.OPS.endText:
                    this.endText();
                    break;
                  case a.OPS.moveText:
                    this.moveText(x[0], x[1]);
                    break;
                  case a.OPS.setCharSpacing:
                    this.setCharSpacing(x[0]);
                    break;
                  case a.OPS.setWordSpacing:
                    this.setWordSpacing(x[0]);
                    break;
                  case a.OPS.setHScale:
                    this.setHScale(x[0]);
                    break;
                  case a.OPS.setTextMatrix:
                    this.setTextMatrix(x[0], x[1], x[2], x[3], x[4], x[5]);
                    break;
                  case a.OPS.setTextRise:
                    this.setTextRise(x[0]);
                    break;
                  case a.OPS.setTextRenderingMode:
                    this.setTextRenderingMode(x[0]);
                    break;
                  case a.OPS.setLineWidth:
                    this.setLineWidth(x[0]);
                    break;
                  case a.OPS.setLineJoin:
                    this.setLineJoin(x[0]);
                    break;
                  case a.OPS.setLineCap:
                    this.setLineCap(x[0]);
                    break;
                  case a.OPS.setMiterLimit:
                    this.setMiterLimit(x[0]);
                    break;
                  case a.OPS.setFillRGBColor:
                    this.setFillRGBColor(x[0], x[1], x[2]);
                    break;
                  case a.OPS.setStrokeRGBColor:
                    this.setStrokeRGBColor(x[0], x[1], x[2]);
                    break;
                  case a.OPS.setStrokeColorN:
                    this.setStrokeColorN(x);
                    break;
                  case a.OPS.setFillColorN:
                    this.setFillColorN(x);
                    break;
                  case a.OPS.shadingFill:
                    this.shadingFill(x[0]);
                    break;
                  case a.OPS.setDash:
                    this.setDash(x[0], x[1]);
                    break;
                  case a.OPS.setRenderingIntent:
                    this.setRenderingIntent(x[0]);
                    break;
                  case a.OPS.setFlatness:
                    this.setFlatness(x[0]);
                    break;
                  case a.OPS.setGState:
                    this.setGState(x[0]);
                    break;
                  case a.OPS.fill:
                    this.fill();
                    break;
                  case a.OPS.eoFill:
                    this.eoFill();
                    break;
                  case a.OPS.stroke:
                    this.stroke();
                    break;
                  case a.OPS.fillStroke:
                    this.fillStroke();
                    break;
                  case a.OPS.eoFillStroke:
                    this.eoFillStroke();
                    break;
                  case a.OPS.clip:
                    this.clip("nonzero");
                    break;
                  case a.OPS.eoClip:
                    this.clip("evenodd");
                    break;
                  case a.OPS.paintSolidColorImageMask:
                    this.paintSolidColorImageMask();
                    break;
                  case a.OPS.paintImageXObject:
                    this.paintImageXObject(x[0]);
                    break;
                  case a.OPS.paintInlineImageXObject:
                    this.paintInlineImageXObject(x[0]);
                    break;
                  case a.OPS.paintImageMaskXObject:
                    this.paintImageMaskXObject(x[0]);
                    break;
                  case a.OPS.paintFormXObjectBegin:
                    this.paintFormXObjectBegin(x[0], x[1]);
                    break;
                  case a.OPS.paintFormXObjectEnd:
                    this.paintFormXObjectEnd();
                    break;
                  case a.OPS.closePath:
                    this.closePath();
                    break;
                  case a.OPS.closeStroke:
                    this.closeStroke();
                    break;
                  case a.OPS.closeFillStroke:
                    this.closeFillStroke();
                    break;
                  case a.OPS.closeEOFillStroke:
                    this.closeEOFillStroke();
                    break;
                  case a.OPS.nextLine:
                    this.nextLine();
                    break;
                  case a.OPS.transform:
                    this.transform(x[0], x[1], x[2], x[3], x[4], x[5]);
                    break;
                  case a.OPS.constructPath:
                    this.constructPath(x[0], x[1]);
                    break;
                  case a.OPS.endPath:
                    this.endPath();
                    break;
                  case 92:
                    this.group(g.items);
                    break;
                  default:
                    (0, a.warn)(`Unimplemented operator ${y}`);
                    break;
                }
              }
            }
            setWordSpacing(f) {
              this.current.wordSpacing = f;
            }
            setCharSpacing(f) {
              this.current.charSpacing = f;
            }
            nextLine() {
              this.moveText(0, this.current.leading);
            }
            setTextMatrix(f, g, y, E, x, O) {
              const P = this.current;
              P.textMatrix = P.lineMatrix = [f, g, y, E, x, O], P.textMatrixScale = Math.hypot(f, g), P.x = P.lineX = 0, P.y = P.lineY = 0, P.xcoords = [], P.ycoords = [], P.tspan = this.svgFactory.createElement("svg:tspan"), P.tspan.setAttributeNS(null, "font-family", P.fontFamily), P.tspan.setAttributeNS(null, "font-size", `${_(P.fontSize)}px`), P.tspan.setAttributeNS(null, "y", _(-P.y)), P.txtElement = this.svgFactory.createElement("svg:text"), P.txtElement.append(P.tspan);
            }
            beginText() {
              const f = this.current;
              f.x = f.lineX = 0, f.y = f.lineY = 0, f.textMatrix = a.IDENTITY_MATRIX, f.lineMatrix = a.IDENTITY_MATRIX, f.textMatrixScale = 1, f.tspan = this.svgFactory.createElement("svg:tspan"), f.txtElement = this.svgFactory.createElement("svg:text"), f.txtgrp = this.svgFactory.createElement("svg:g"), f.xcoords = [], f.ycoords = [];
            }
            moveText(f, g) {
              const y = this.current;
              y.x = y.lineX += f, y.y = y.lineY += g, y.xcoords = [], y.ycoords = [], y.tspan = this.svgFactory.createElement("svg:tspan"), y.tspan.setAttributeNS(null, "font-family", y.fontFamily), y.tspan.setAttributeNS(null, "font-size", `${_(y.fontSize)}px`), y.tspan.setAttributeNS(null, "y", _(-y.y));
            }
            showText(f) {
              const g = this.current, y = g.font, E = g.fontSize;
              if (E === 0)
                return;
              const x = g.fontSizeScale, O = g.charSpacing, P = g.wordSpacing, I = g.fontDirection, G = g.textHScale * I, ne = y.vertical, X = ne ? 1 : -1, ee = y.defaultVMetrics, K = E * g.fontMatrix[0];
              let se = 0;
              for (const J of f) {
                if (J === null) {
                  se += I * P;
                  continue;
                } else if (typeof J == "number") {
                  se += X * J * E / 1e3;
                  continue;
                }
                const N = (J.isSpace ? P : 0) + O, M = J.fontChar;
                let v, L, H = J.width;
                if (ne) {
                  let U;
                  const Z = J.vmetric || ee;
                  U = J.vmetric ? Z[1] : H * 0.5, U = -U * K;
                  const re = Z[2] * K;
                  H = Z ? -Z[0] : H, v = U / x, L = (se + re) / x;
                } else
                  v = se / x, L = 0;
                (J.isInFont || y.missingFile) && (g.xcoords.push(g.x + v), ne && g.ycoords.push(-g.y + L), g.tspan.textContent += M);
                const B = ne ? H * K - N * I : H * K + N * I;
                se += B;
              }
              g.tspan.setAttributeNS(null, "x", g.xcoords.map(_).join(" ")), ne ? g.tspan.setAttributeNS(null, "y", g.ycoords.map(_).join(" ")) : g.tspan.setAttributeNS(null, "y", _(-g.y)), ne ? g.y -= se : g.x += se * G, g.tspan.setAttributeNS(null, "font-family", g.fontFamily), g.tspan.setAttributeNS(null, "font-size", `${_(g.fontSize)}px`), g.fontStyle !== s.fontStyle && g.tspan.setAttributeNS(null, "font-style", g.fontStyle), g.fontWeight !== s.fontWeight && g.tspan.setAttributeNS(null, "font-weight", g.fontWeight);
              const q = g.textRenderingMode & a.TextRenderingMode.FILL_STROKE_MASK;
              if (q === a.TextRenderingMode.FILL || q === a.TextRenderingMode.FILL_STROKE ? (g.fillColor !== s.fillColor && g.tspan.setAttributeNS(null, "fill", g.fillColor), g.fillAlpha < 1 && g.tspan.setAttributeNS(null, "fill-opacity", g.fillAlpha)) : g.textRenderingMode === a.TextRenderingMode.ADD_TO_PATH ? g.tspan.setAttributeNS(null, "fill", "transparent") : g.tspan.setAttributeNS(null, "fill", "none"), q === a.TextRenderingMode.STROKE || q === a.TextRenderingMode.FILL_STROKE) {
                const J = 1 / (g.textMatrixScale || 1);
                this._setStrokeAttributes(g.tspan, J);
              }
              let Y = g.textMatrix;
              g.textRise !== 0 && (Y = Y.slice(), Y[5] += g.textRise), g.txtElement.setAttributeNS(null, "transform", `${R(Y)} scale(${_(G)}, -1)`), g.txtElement.setAttributeNS(o, "xml:space", "preserve"), g.txtElement.append(g.tspan), g.txtgrp.append(g.txtElement), this._ensureTransformGroup().append(g.txtElement);
            }
            setLeadingMoveText(f, g) {
              this.setLeading(-g), this.moveText(f, g);
            }
            addFontStyle(f) {
              if (!f.data)
                throw new Error('addFontStyle: No font data available, ensure that the "fontExtraProperties" API parameter is set.');
              this.cssStyle || (this.cssStyle = this.svgFactory.createElement("svg:style"), this.cssStyle.setAttributeNS(null, "type", "text/css"), this.defs.append(this.cssStyle));
              const g = h(f.data, f.mimetype, this.forceDataSchema);
              this.cssStyle.textContent += `@font-face { font-family: "${f.loadedName}"; src: url(${g}); }
`;
            }
            setFont(f) {
              const g = this.current, y = this.commonObjs.get(f[0]);
              let E = f[1];
              g.font = y, this.embedFonts && !y.missingFile && !this.embeddedFonts[y.loadedName] && (this.addFontStyle(y), this.embeddedFonts[y.loadedName] = y), g.fontMatrix = y.fontMatrix || a.FONT_IDENTITY_MATRIX;
              let x = "normal";
              y.black ? x = "900" : y.bold && (x = "bold");
              const O = y.italic ? "italic" : "normal";
              E < 0 ? (E = -E, g.fontDirection = -1) : g.fontDirection = 1, g.fontSize = E, g.fontFamily = y.loadedName, g.fontWeight = x, g.fontStyle = O, g.tspan = this.svgFactory.createElement("svg:tspan"), g.tspan.setAttributeNS(null, "y", _(-g.y)), g.xcoords = [], g.ycoords = [];
            }
            endText() {
              var g;
              const f = this.current;
              f.textRenderingMode & a.TextRenderingMode.ADD_TO_PATH_FLAG && ((g = f.txtElement) != null && g.hasChildNodes()) && (f.element = f.txtElement, this.clip("nonzero"), this.endPath());
            }
            setLineWidth(f) {
              f > 0 && (this.current.lineWidth = f);
            }
            setLineCap(f) {
              this.current.lineCap = l[f];
            }
            setLineJoin(f) {
              this.current.lineJoin = u[f];
            }
            setMiterLimit(f) {
              this.current.miterLimit = f;
            }
            setStrokeAlpha(f) {
              this.current.strokeAlpha = f;
            }
            setStrokeRGBColor(f, g, y) {
              this.current.strokeColor = a.Util.makeHexColor(f, g, y);
            }
            setFillAlpha(f) {
              this.current.fillAlpha = f;
            }
            setFillRGBColor(f, g, y) {
              this.current.fillColor = a.Util.makeHexColor(f, g, y), this.current.tspan = this.svgFactory.createElement("svg:tspan"), this.current.xcoords = [], this.current.ycoords = [];
            }
            setStrokeColorN(f) {
              this.current.strokeColor = this._makeColorN_Pattern(f);
            }
            setFillColorN(f) {
              this.current.fillColor = this._makeColorN_Pattern(f);
            }
            shadingFill(f) {
              const {
                width: g,
                height: y
              } = this.viewport, E = a.Util.inverseTransform(this.transformMatrix), [x, O, P, I] = a.Util.getAxialAlignedBoundingBox([0, 0, g, y], E), G = this.svgFactory.createElement("svg:rect");
              G.setAttributeNS(null, "x", x), G.setAttributeNS(null, "y", O), G.setAttributeNS(null, "width", P - x), G.setAttributeNS(null, "height", I - O), G.setAttributeNS(null, "fill", this._makeShadingPattern(f)), this.current.fillAlpha < 1 && G.setAttributeNS(null, "fill-opacity", this.current.fillAlpha), this._ensureTransformGroup().append(G);
            }
            _makeColorN_Pattern(f) {
              return f[0] === "TilingPattern" ? this._makeTilingPattern(f) : this._makeShadingPattern(f);
            }
            _makeTilingPattern(f) {
              const g = f[1], y = f[2], E = f[3] || a.IDENTITY_MATRIX, [x, O, P, I] = f[4], G = f[5], ne = f[6], X = f[7], ee = `shading${m++}`, [K, se, q, Y] = a.Util.normalizeRect([...a.Util.applyTransform([x, O], E), ...a.Util.applyTransform([P, I], E)]), [J, N] = a.Util.singularValueDecompose2dScale(E), M = G * J, v = ne * N, L = this.svgFactory.createElement("svg:pattern");
              L.setAttributeNS(null, "id", ee), L.setAttributeNS(null, "patternUnits", "userSpaceOnUse"), L.setAttributeNS(null, "width", M), L.setAttributeNS(null, "height", v), L.setAttributeNS(null, "x", `${K}`), L.setAttributeNS(null, "y", `${se}`);
              const H = this.svg, B = this.transformMatrix, U = this.current.fillColor, Z = this.current.strokeColor, re = this.svgFactory.create(q - K, Y - se);
              if (this.svg = re, this.transformMatrix = E, X === 2) {
                const pe = a.Util.makeHexColor(...g);
                this.current.fillColor = pe, this.current.strokeColor = pe;
              }
              return this.executeOpTree(this.convertOpList(y)), this.svg = H, this.transformMatrix = B, this.current.fillColor = U, this.current.strokeColor = Z, L.append(re.childNodes[0]), this.defs.append(L), `url(#${ee})`;
            }
            _makeShadingPattern(f) {
              switch (typeof f == "string" && (f = this.objs.get(f)), f[0]) {
                case "RadialAxial":
                  const g = `shading${m++}`, y = f[3];
                  let E;
                  switch (f[1]) {
                    case "axial":
                      const x = f[4], O = f[5];
                      E = this.svgFactory.createElement("svg:linearGradient"), E.setAttributeNS(null, "id", g), E.setAttributeNS(null, "gradientUnits", "userSpaceOnUse"), E.setAttributeNS(null, "x1", x[0]), E.setAttributeNS(null, "y1", x[1]), E.setAttributeNS(null, "x2", O[0]), E.setAttributeNS(null, "y2", O[1]);
                      break;
                    case "radial":
                      const P = f[4], I = f[5], G = f[6], ne = f[7];
                      E = this.svgFactory.createElement("svg:radialGradient"), E.setAttributeNS(null, "id", g), E.setAttributeNS(null, "gradientUnits", "userSpaceOnUse"), E.setAttributeNS(null, "cx", I[0]), E.setAttributeNS(null, "cy", I[1]), E.setAttributeNS(null, "r", ne), E.setAttributeNS(null, "fx", P[0]), E.setAttributeNS(null, "fy", P[1]), E.setAttributeNS(null, "fr", G);
                      break;
                    default:
                      throw new Error(`Unknown RadialAxial type: ${f[1]}`);
                  }
                  for (const x of y) {
                    const O = this.svgFactory.createElement("svg:stop");
                    O.setAttributeNS(null, "offset", x[0]), O.setAttributeNS(null, "stop-color", x[1]), E.append(O);
                  }
                  return this.defs.append(E), `url(#${g})`;
                case "Mesh":
                  return (0, a.warn)("Unimplemented pattern Mesh"), null;
                case "Dummy":
                  return "hotpink";
                default:
                  throw new Error(`Unknown IR type: ${f[0]}`);
              }
            }
            setDash(f, g) {
              this.current.dashArray = f, this.current.dashPhase = g;
            }
            constructPath(f, g) {
              const y = this.current;
              let E = y.x, x = y.y, O = [], P = 0;
              for (const I of f)
                switch (I | 0) {
                  case a.OPS.rectangle:
                    E = g[P++], x = g[P++];
                    const G = g[P++], ne = g[P++], X = E + G, ee = x + ne;
                    O.push("M", _(E), _(x), "L", _(X), _(x), "L", _(X), _(ee), "L", _(E), _(ee), "Z");
                    break;
                  case a.OPS.moveTo:
                    E = g[P++], x = g[P++], O.push("M", _(E), _(x));
                    break;
                  case a.OPS.lineTo:
                    E = g[P++], x = g[P++], O.push("L", _(E), _(x));
                    break;
                  case a.OPS.curveTo:
                    E = g[P + 4], x = g[P + 5], O.push("C", _(g[P]), _(g[P + 1]), _(g[P + 2]), _(g[P + 3]), _(E), _(x)), P += 6;
                    break;
                  case a.OPS.curveTo2:
                    O.push("C", _(E), _(x), _(g[P]), _(g[P + 1]), _(g[P + 2]), _(g[P + 3])), E = g[P + 2], x = g[P + 3], P += 4;
                    break;
                  case a.OPS.curveTo3:
                    E = g[P + 2], x = g[P + 3], O.push("C", _(g[P]), _(g[P + 1]), _(E), _(x), _(E), _(x)), P += 4;
                    break;
                  case a.OPS.closePath:
                    O.push("Z");
                    break;
                }
              O = O.join(" "), y.path && f.length > 0 && f[0] !== a.OPS.rectangle && f[0] !== a.OPS.moveTo ? O = y.path.getAttributeNS(null, "d") + O : (y.path = this.svgFactory.createElement("svg:path"), this._ensureTransformGroup().append(y.path)), y.path.setAttributeNS(null, "d", O), y.path.setAttributeNS(null, "fill", "none"), y.element = y.path, y.setCurrentPoint(E, x);
            }
            endPath() {
              const f = this.current;
              if (f.path = null, !this.pendingClip)
                return;
              if (!f.element) {
                this.pendingClip = null;
                return;
              }
              const g = `clippath${k++}`, y = this.svgFactory.createElement("svg:clipPath");
              y.setAttributeNS(null, "id", g), y.setAttributeNS(null, "transform", R(this.transformMatrix));
              const E = f.element.cloneNode(!0);
              if (this.pendingClip === "evenodd" ? E.setAttributeNS(null, "clip-rule", "evenodd") : E.setAttributeNS(null, "clip-rule", "nonzero"), this.pendingClip = null, y.append(E), this.defs.append(y), f.activeClipUrl) {
                f.clipGroup = null;
                for (const x of this.extraStack)
                  x.clipGroup = null;
                y.setAttributeNS(null, "clip-path", f.activeClipUrl);
              }
              f.activeClipUrl = `url(#${g})`, this.tgrp = null;
            }
            clip(f) {
              this.pendingClip = f;
            }
            closePath() {
              const f = this.current;
              if (f.path) {
                const g = `${f.path.getAttributeNS(null, "d")}Z`;
                f.path.setAttributeNS(null, "d", g);
              }
            }
            setLeading(f) {
              this.current.leading = -f;
            }
            setTextRise(f) {
              this.current.textRise = f;
            }
            setTextRenderingMode(f) {
              this.current.textRenderingMode = f;
            }
            setHScale(f) {
              this.current.textHScale = f / 100;
            }
            setRenderingIntent(f) {
            }
            setFlatness(f) {
            }
            setGState(f) {
              for (const [g, y] of f)
                switch (g) {
                  case "LW":
                    this.setLineWidth(y);
                    break;
                  case "LC":
                    this.setLineCap(y);
                    break;
                  case "LJ":
                    this.setLineJoin(y);
                    break;
                  case "ML":
                    this.setMiterLimit(y);
                    break;
                  case "D":
                    this.setDash(y[0], y[1]);
                    break;
                  case "RI":
                    this.setRenderingIntent(y);
                    break;
                  case "FL":
                    this.setFlatness(y);
                    break;
                  case "Font":
                    this.setFont(y);
                    break;
                  case "CA":
                    this.setStrokeAlpha(y);
                    break;
                  case "ca":
                    this.setFillAlpha(y);
                    break;
                  default:
                    (0, a.warn)(`Unimplemented graphic state operator ${g}`);
                    break;
                }
            }
            fill() {
              const f = this.current;
              f.element && (f.element.setAttributeNS(null, "fill", f.fillColor), f.element.setAttributeNS(null, "fill-opacity", f.fillAlpha), this.endPath());
            }
            stroke() {
              const f = this.current;
              f.element && (this._setStrokeAttributes(f.element), f.element.setAttributeNS(null, "fill", "none"), this.endPath());
            }
            _setStrokeAttributes(f, g = 1) {
              const y = this.current;
              let E = y.dashArray;
              g !== 1 && E.length > 0 && (E = E.map(function(x) {
                return g * x;
              })), f.setAttributeNS(null, "stroke", y.strokeColor), f.setAttributeNS(null, "stroke-opacity", y.strokeAlpha), f.setAttributeNS(null, "stroke-miterlimit", _(y.miterLimit)), f.setAttributeNS(null, "stroke-linecap", y.lineCap), f.setAttributeNS(null, "stroke-linejoin", y.lineJoin), f.setAttributeNS(null, "stroke-width", _(g * y.lineWidth) + "px"), f.setAttributeNS(null, "stroke-dasharray", E.map(_).join(" ")), f.setAttributeNS(null, "stroke-dashoffset", _(g * y.dashPhase) + "px");
            }
            eoFill() {
              var f;
              (f = this.current.element) == null || f.setAttributeNS(null, "fill-rule", "evenodd"), this.fill();
            }
            fillStroke() {
              this.stroke(), this.fill();
            }
            eoFillStroke() {
              var f;
              (f = this.current.element) == null || f.setAttributeNS(null, "fill-rule", "evenodd"), this.fillStroke();
            }
            closeStroke() {
              this.closePath(), this.stroke();
            }
            closeFillStroke() {
              this.closePath(), this.fillStroke();
            }
            closeEOFillStroke() {
              this.closePath(), this.eoFillStroke();
            }
            paintSolidColorImageMask() {
              const f = this.svgFactory.createElement("svg:rect");
              f.setAttributeNS(null, "x", "0"), f.setAttributeNS(null, "y", "0"), f.setAttributeNS(null, "width", "1px"), f.setAttributeNS(null, "height", "1px"), f.setAttributeNS(null, "fill", this.current.fillColor), this._ensureTransformGroup().append(f);
            }
            paintImageXObject(f) {
              const g = this.getObject(f);
              if (!g) {
                (0, a.warn)(`Dependent image with object ID ${f} is not ready yet`);
                return;
              }
              this.paintInlineImageXObject(g);
            }
            paintInlineImageXObject(f, g) {
              const y = f.width, E = f.height, x = d(f, this.forceDataSchema, !!g), O = this.svgFactory.createElement("svg:rect");
              O.setAttributeNS(null, "x", "0"), O.setAttributeNS(null, "y", "0"), O.setAttributeNS(null, "width", _(y)), O.setAttributeNS(null, "height", _(E)), this.current.element = O, this.clip("nonzero");
              const P = this.svgFactory.createElement("svg:image");
              P.setAttributeNS(c, "xlink:href", x), P.setAttributeNS(null, "x", "0"), P.setAttributeNS(null, "y", _(-E)), P.setAttributeNS(null, "width", _(y) + "px"), P.setAttributeNS(null, "height", _(E) + "px"), P.setAttributeNS(null, "transform", `scale(${_(1 / y)} ${_(-1 / E)})`), g ? g.append(P) : this._ensureTransformGroup().append(P);
            }
            paintImageMaskXObject(f) {
              const g = this.getObject(f.data, f);
              if (g.bitmap) {
                (0, a.warn)("paintImageMaskXObject: ImageBitmap support is not implemented, ensure that the `isOffscreenCanvasSupported` API parameter is disabled.");
                return;
              }
              const y = this.current, E = g.width, x = g.height, O = y.fillColor;
              y.maskId = `mask${C++}`;
              const P = this.svgFactory.createElement("svg:mask");
              P.setAttributeNS(null, "id", y.maskId);
              const I = this.svgFactory.createElement("svg:rect");
              I.setAttributeNS(null, "x", "0"), I.setAttributeNS(null, "y", "0"), I.setAttributeNS(null, "width", _(E)), I.setAttributeNS(null, "height", _(x)), I.setAttributeNS(null, "fill", O), I.setAttributeNS(null, "mask", `url(#${y.maskId})`), this.defs.append(P), this._ensureTransformGroup().append(I), this.paintInlineImageXObject(g, P);
            }
            paintFormXObjectBegin(f, g) {
              if (Array.isArray(f) && f.length === 6 && this.transform(f[0], f[1], f[2], f[3], f[4], f[5]), g) {
                const y = g[2] - g[0], E = g[3] - g[1], x = this.svgFactory.createElement("svg:rect");
                x.setAttributeNS(null, "x", g[0]), x.setAttributeNS(null, "y", g[1]), x.setAttributeNS(null, "width", _(y)), x.setAttributeNS(null, "height", _(E)), this.current.element = x, this.clip("nonzero"), this.endPath();
              }
            }
            paintFormXObjectEnd() {
            }
            _initialize(f) {
              const g = this.svgFactory.create(f.width, f.height), y = this.svgFactory.createElement("svg:defs");
              g.append(y), this.defs = y;
              const E = this.svgFactory.createElement("svg:g");
              return E.setAttributeNS(null, "transform", R(f.transform)), g.append(E), this.svg = E, g;
            }
            _ensureClipGroup() {
              if (!this.current.clipGroup) {
                const f = this.svgFactory.createElement("svg:g");
                f.setAttributeNS(null, "clip-path", this.current.activeClipUrl), this.svg.append(f), this.current.clipGroup = f;
              }
              return this.current.clipGroup;
            }
            _ensureTransformGroup() {
              return this.tgrp || (this.tgrp = this.svgFactory.createElement("svg:g"), this.tgrp.setAttributeNS(null, "transform", R(this.transformMatrix)), this.current.activeClipUrl ? this._ensureClipGroup().append(this.tgrp) : this.svg.append(this.tgrp)), this.tgrp;
            }
          }
          e.SVGGraphics = A;
        },
        /* 25 */
        /***/
        (r, e) => {
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.XfaText = void 0;
          class t {
            static textContent(a) {
              const s = [], o = {
                items: s,
                styles: /* @__PURE__ */ Object.create(null)
              };
              function c(l) {
                var d;
                if (!l)
                  return;
                let u = null;
                const h = l.name;
                if (h === "#text")
                  u = l.value;
                else if (t.shouldBuildText(h))
                  (d = l == null ? void 0 : l.attributes) != null && d.textContent ? u = l.attributes.textContent : l.value && (u = l.value);
                else return;
                if (u !== null && s.push({
                  str: u
                }), !!l.children)
                  for (const w of l.children)
                    c(w);
              }
              return c(a), o;
            }
            static shouldBuildText(a) {
              return !(a === "textarea" || a === "input" || a === "option" || a === "select");
            }
          }
          e.XfaText = t;
        },
        /* 26 */
        /***/
        (r, e, t) => {
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.TextLayerRenderTask = void 0, e.renderTextLayer = R, e.updateTextLayer = k;
          var n = t(1), a = t(6);
          const s = 1e5, o = 30, c = 0.8, l = /* @__PURE__ */ new Map();
          function u(C, m) {
            let A;
            if (m && n.FeatureTest.isOffscreenCanvasSupported)
              A = new OffscreenCanvas(C, C).getContext("2d", {
                alpha: !1
              });
            else {
              const F = document.createElement("canvas");
              F.width = F.height = C, A = F.getContext("2d", {
                alpha: !1
              });
            }
            return A;
          }
          function h(C, m) {
            const A = l.get(C);
            if (A)
              return A;
            const F = u(o, m);
            F.font = `${o}px ${C}`;
            const f = F.measureText("");
            let g = f.fontBoundingBoxAscent, y = Math.abs(f.fontBoundingBoxDescent);
            if (g) {
              const x = g / (g + y);
              return l.set(C, x), F.canvas.width = F.canvas.height = 0, x;
            }
            F.strokeStyle = "red", F.clearRect(0, 0, o, o), F.strokeText("g", 0, 0);
            let E = F.getImageData(0, 0, o, o).data;
            y = 0;
            for (let x = E.length - 1 - 3; x >= 0; x -= 4)
              if (E[x] > 0) {
                y = Math.ceil(x / 4 / o);
                break;
              }
            F.clearRect(0, 0, o, o), F.strokeText("A", 0, o), E = F.getImageData(0, 0, o, o).data, g = 0;
            for (let x = 0, O = E.length; x < O; x += 4)
              if (E[x] > 0) {
                g = o - Math.floor(x / 4 / o);
                break;
              }
            if (F.canvas.width = F.canvas.height = 0, g) {
              const x = g / (g + y);
              return l.set(C, x), x;
            }
            return l.set(C, c), c;
          }
          function d(C, m, A) {
            const F = document.createElement("span"), f = {
              angle: 0,
              canvasWidth: 0,
              hasText: m.str !== "",
              hasEOL: m.hasEOL,
              fontSize: 0
            };
            C._textDivs.push(F);
            const g = n.Util.transform(C._transform, m.transform);
            let y = Math.atan2(g[1], g[0]);
            const E = A[m.fontName];
            E.vertical && (y += Math.PI / 2);
            const x = Math.hypot(g[2], g[3]), O = x * h(E.fontFamily, C._isOffscreenCanvasSupported);
            let P, I;
            y === 0 ? (P = g[4], I = g[5] - O) : (P = g[4] + O * Math.sin(y), I = g[5] - O * Math.cos(y));
            const G = "calc(var(--scale-factor)*", ne = F.style;
            C._container === C._rootContainer ? (ne.left = `${(100 * P / C._pageWidth).toFixed(2)}%`, ne.top = `${(100 * I / C._pageHeight).toFixed(2)}%`) : (ne.left = `${G}${P.toFixed(2)}px)`, ne.top = `${G}${I.toFixed(2)}px)`), ne.fontSize = `${G}${x.toFixed(2)}px)`, ne.fontFamily = E.fontFamily, f.fontSize = x, F.setAttribute("role", "presentation"), F.textContent = m.str, F.dir = m.dir, C._fontInspectorEnabled && (F.dataset.fontName = m.fontName), y !== 0 && (f.angle = y * (180 / Math.PI));
            let X = !1;
            if (m.str.length > 1)
              X = !0;
            else if (m.str !== " " && m.transform[0] !== m.transform[3]) {
              const ee = Math.abs(m.transform[0]), K = Math.abs(m.transform[3]);
              ee !== K && Math.max(ee, K) / Math.min(ee, K) > 1.5 && (X = !0);
            }
            X && (f.canvasWidth = E.vertical ? m.height : m.width), C._textDivProperties.set(F, f), C._isReadableStream && C._layoutText(F);
          }
          function w(C) {
            const {
              div: m,
              scale: A,
              properties: F,
              ctx: f,
              prevFontSize: g,
              prevFontFamily: y
            } = C, {
              style: E
            } = m;
            let x = "";
            if (F.canvasWidth !== 0 && F.hasText) {
              const {
                fontFamily: O
              } = E, {
                canvasWidth: P,
                fontSize: I
              } = F;
              (g !== I || y !== O) && (f.font = `${I * A}px ${O}`, C.prevFontSize = I, C.prevFontFamily = O);
              const {
                width: G
              } = f.measureText(m.textContent);
              G > 0 && (x = `scaleX(${P * A / G})`);
            }
            F.angle !== 0 && (x = `rotate(${F.angle}deg) ${x}`), x.length > 0 && (E.transform = x);
          }
          function b(C) {
            if (C._canceled)
              return;
            const m = C._textDivs, A = C._capability;
            if (m.length > s) {
              A.resolve();
              return;
            }
            if (!C._isReadableStream)
              for (const f of m)
                C._layoutText(f);
            A.resolve();
          }
          class _ {
            constructor({
              textContentSource: m,
              container: A,
              viewport: F,
              textDivs: f,
              textDivProperties: g,
              textContentItemsStr: y,
              isOffscreenCanvasSupported: E
            }) {
              var G;
              this._textContentSource = m, this._isReadableStream = m instanceof ReadableStream, this._container = this._rootContainer = A, this._textDivs = f || [], this._textContentItemsStr = y || [], this._isOffscreenCanvasSupported = E, this._fontInspectorEnabled = !!((G = globalThis.FontInspector) != null && G.enabled), this._reader = null, this._textDivProperties = g || /* @__PURE__ */ new WeakMap(), this._canceled = !1, this._capability = new n.PromiseCapability(), this._layoutTextParams = {
                prevFontSize: null,
                prevFontFamily: null,
                div: null,
                scale: F.scale * (globalThis.devicePixelRatio || 1),
                properties: null,
                ctx: u(0, E)
              };
              const {
                pageWidth: x,
                pageHeight: O,
                pageX: P,
                pageY: I
              } = F.rawDims;
              this._transform = [1, 0, 0, -1, -P, I + O], this._pageWidth = x, this._pageHeight = O, (0, a.setLayerDimensions)(A, F), 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(m, A) {
              for (const F of m) {
                if (F.str === void 0) {
                  if (F.type === "beginMarkedContentProps" || F.type === "beginMarkedContent") {
                    const f = this._container;
                    this._container = document.createElement("span"), this._container.classList.add("markedContent"), F.id !== null && this._container.setAttribute("id", `${F.id}`), f.append(this._container);
                  } else F.type === "endMarkedContent" && (this._container = this._container.parentNode);
                  continue;
                }
                this._textContentItemsStr.push(F.str), d(this, F, A);
              }
            }
            _layoutText(m) {
              const A = this._layoutTextParams.properties = this._textDivProperties.get(m);
              if (this._layoutTextParams.div = m, w(this._layoutTextParams), A.hasText && this._container.append(m), A.hasEOL) {
                const F = document.createElement("br");
                F.setAttribute("role", "presentation"), this._container.append(F);
              }
            }
            _render() {
              const m = new n.PromiseCapability();
              let A = /* @__PURE__ */ Object.create(null);
              if (this._isReadableStream) {
                const F = () => {
                  this._reader.read().then(({
                    value: f,
                    done: g
                  }) => {
                    if (g) {
                      m.resolve();
                      return;
                    }
                    Object.assign(A, f.styles), this._processItems(f.items, A), F();
                  }, m.reject);
                };
                this._reader = this._textContentSource.getReader(), F();
              } else if (this._textContentSource) {
                const {
                  items: F,
                  styles: f
                } = this._textContentSource;
                this._processItems(F, f), m.resolve();
              } else
                throw new Error('No "textContentSource" parameter specified.');
              m.promise.then(() => {
                A = null, b(this);
              }, this._capability.reject);
            }
          }
          e.TextLayerRenderTask = _;
          function R(C) {
            !C.textContentSource && (C.textContent || C.textContentStream) && ((0, a.deprecated)("The TextLayerRender `textContent`/`textContentStream` parameters will be removed in the future, please use `textContentSource` instead."), C.textContentSource = C.textContent || C.textContentStream);
            const {
              container: m,
              viewport: A
            } = C, F = getComputedStyle(m), f = F.getPropertyValue("visibility"), g = parseFloat(F.getPropertyValue("--scale-factor"));
            f === "visible" && (!g || Math.abs(g - A.scale) > 1e-5) && console.error("The `--scale-factor` CSS-variable must be set, to the same value as `viewport.scale`, either on the `container`-element itself or higher up in the DOM.");
            const y = new _(C);
            return y._render(), y;
          }
          function k({
            container: C,
            viewport: m,
            textDivs: A,
            textDivProperties: F,
            isOffscreenCanvasSupported: f,
            mustRotate: g = !0,
            mustRescale: y = !0
          }) {
            if (g && (0, a.setLayerDimensions)(C, {
              rotation: m.rotation
            }), y) {
              const E = u(0, f), O = {
                prevFontSize: null,
                prevFontFamily: null,
                div: null,
                scale: m.scale * (globalThis.devicePixelRatio || 1),
                properties: null,
                ctx: E
              };
              for (const P of A)
                O.properties = F.get(P), O.div = P, w(O);
            }
          }
        },
        /* 27 */
        /***/
        (r, e, t) => {
          var h, d, w, b, _, R, k, C, m, A, F, un, Ot, hn, dn;
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.AnnotationEditorLayer = void 0;
          var n = t(1), a = t(4), s = t(28), o = t(33), c = t(6), l = t(34);
          const x = class x {
            constructor({
              uiManager: P,
              pageIndex: I,
              div: G,
              accessibilityManager: ne,
              annotationLayer: X,
              viewport: ee,
              l10n: K
            }) {
              de(this, F);
              de(this, h);
              de(this, d, !1);
              de(this, w, null);
              de(this, b, this.pointerup.bind(this));
              de(this, _, this.pointerdown.bind(this));
              de(this, R, /* @__PURE__ */ new Map());
              de(this, k, !1);
              de(this, C, !1);
              de(this, m, !1);
              de(this, A);
              const se = [s.FreeTextEditor, o.InkEditor, l.StampEditor];
              if (!x._initialized) {
                x._initialized = !0;
                for (const q of se)
                  q.initialize(K);
              }
              P.registerEditorTypes(se), fe(this, A, P), this.pageIndex = I, this.div = G, fe(this, h, ne), fe(this, w, X), this.viewport = ee, p(this, A).addLayer(this);
            }
            get isEmpty() {
              return p(this, R).size === 0;
            }
            updateToolbar(P) {
              p(this, A).updateToolbar(P);
            }
            updateMode(P = p(this, A).getMode()) {
              te(this, F, dn).call(this), P === n.AnnotationEditorType.INK ? (this.addInkEditorIfNeeded(!1), this.disableClick()) : this.enableClick(), P !== n.AnnotationEditorType.NONE && (this.div.classList.toggle("freeTextEditing", P === n.AnnotationEditorType.FREETEXT), this.div.classList.toggle("inkEditing", P === n.AnnotationEditorType.INK), this.div.classList.toggle("stampEditing", P === n.AnnotationEditorType.STAMP), this.div.hidden = !1);
            }
            addInkEditorIfNeeded(P) {
              if (!P && p(this, A).getMode() !== n.AnnotationEditorType.INK)
                return;
              if (!P) {
                for (const G of p(this, R).values())
                  if (G.isEmpty()) {
                    G.setInBackground();
                    return;
                  }
              }
              te(this, F, Ot).call(this, {
                offsetX: 0,
                offsetY: 0
              }, !1).setInBackground();
            }
            setEditingState(P) {
              p(this, A).setEditingState(P);
            }
            addCommands(P) {
              p(this, A).addCommands(P);
            }
            enable() {
              this.div.style.pointerEvents = "auto";
              const P = /* @__PURE__ */ new Set();
              for (const G of p(this, R).values())
                G.enableEditing(), G.annotationElementId && P.add(G.annotationElementId);
              if (!p(this, w))
                return;
              const I = p(this, w).getEditableAnnotations();
              for (const G of I) {
                if (G.hide(), p(this, A).isDeletedAnnotationElement(G.data.id) || P.has(G.data.id))
                  continue;
                const ne = this.deserialize(G);
                ne && (this.addOrRebuild(ne), ne.enableEditing());
              }
            }
            disable() {
              var I;
              fe(this, m, !0), this.div.style.pointerEvents = "none";
              const P = /* @__PURE__ */ new Set();
              for (const G of p(this, R).values()) {
                if (G.disableEditing(), !G.annotationElementId || G.serialize() !== null) {
                  P.add(G.annotationElementId);
                  continue;
                }
                (I = this.getEditableAnnotation(G.annotationElementId)) == null || I.show(), G.remove();
              }
              if (p(this, w)) {
                const G = p(this, w).getEditableAnnotations();
                for (const ne of G) {
                  const {
                    id: X
                  } = ne.data;
                  P.has(X) || p(this, A).isDeletedAnnotationElement(X) || ne.show();
                }
              }
              te(this, F, dn).call(this), this.isEmpty && (this.div.hidden = !0), fe(this, m, !1);
            }
            getEditableAnnotation(P) {
              var I;
              return ((I = p(this, w)) == null ? void 0 : I.getEditableAnnotation(P)) || null;
            }
            setActiveEditor(P) {
              p(this, A).getActive() !== P && p(this, A).setActiveEditor(P);
            }
            enableClick() {
              this.div.addEventListener("pointerdown", p(this, _)), this.div.addEventListener("pointerup", p(this, b));
            }
            disableClick() {
              this.div.removeEventListener("pointerdown", p(this, _)), this.div.removeEventListener("pointerup", p(this, b));
            }
            attach(P) {
              p(this, R).set(P.id, P);
              const {
                annotationElementId: I
              } = P;
              I && p(this, A).isDeletedAnnotationElement(I) && p(this, A).removeDeletedAnnotationElement(P);
            }
            detach(P) {
              var I;
              p(this, R).delete(P.id), (I = p(this, h)) == null || I.removePointerInTextLayer(P.contentDiv), !p(this, m) && P.annotationElementId && p(this, A).addDeletedAnnotationElement(P);
            }
            remove(P) {
              this.detach(P), p(this, A).removeEditor(P), P.div.contains(document.activeElement) && setTimeout(() => {
                p(this, A).focusMainContainer();
              }, 0), P.div.remove(), P.isAttachedToDOM = !1, p(this, C) || this.addInkEditorIfNeeded(!1);
            }
            changeParent(P) {
              var I;
              P.parent !== this && (P.annotationElementId && (p(this, A).addDeletedAnnotationElement(P.annotationElementId), a.AnnotationEditor.deleteAnnotationElement(P), P.annotationElementId = null), this.attach(P), (I = P.parent) == null || I.detach(P), P.setParent(this), P.div && P.isAttachedToDOM && (P.div.remove(), this.div.append(P.div)));
            }
            add(P) {
              if (this.changeParent(P), p(this, A).addEditor(P), this.attach(P), !P.isAttachedToDOM) {
                const I = P.render();
                this.div.append(I), P.isAttachedToDOM = !0;
              }
              P.fixAndSetPosition(), P.onceAdded(), p(this, A).addToAnnotationStorage(P);
            }
            moveEditorInDOM(P) {
              var G;
              if (!P.isAttachedToDOM)
                return;
              const {
                activeElement: I
              } = document;
              P.div.contains(I) && (P._focusEventsAllowed = !1, setTimeout(() => {
                P.div.contains(document.activeElement) ? P._focusEventsAllowed = !0 : (P.div.addEventListener("focusin", () => {
                  P._focusEventsAllowed = !0;
                }, {
                  once: !0
                }), I.focus());
              }, 0)), P._structTreeParentId = (G = p(this, h)) == null ? void 0 : G.moveElementInDOM(this.div, P.div, P.contentDiv, !0);
            }
            addOrRebuild(P) {
              P.needsToBeRebuilt() ? P.rebuild() : this.add(P);
            }
            addUndoableEditor(P) {
              const I = () => P._uiManager.rebuild(P), G = () => {
                P.remove();
              };
              this.addCommands({
                cmd: I,
                undo: G,
                mustExec: !1
              });
            }
            getNextId() {
              return p(this, A).getId();
            }
            pasteEditor(P, I) {
              p(this, A).updateToolbar(P), p(this, A).updateMode(P);
              const {
                offsetX: G,
                offsetY: ne
              } = te(this, F, hn).call(this), X = this.getNextId(), ee = te(this, F, un).call(this, {
                parent: this,
                id: X,
                x: G,
                y: ne,
                uiManager: p(this, A),
                isCentered: !0,
                ...I
              });
              ee && this.add(ee);
            }
            deserialize(P) {
              switch (P.annotationType ?? P.annotationEditorType) {
                case n.AnnotationEditorType.FREETEXT:
                  return s.FreeTextEditor.deserialize(P, this, p(this, A));
                case n.AnnotationEditorType.INK:
                  return o.InkEditor.deserialize(P, this, p(this, A));
                case n.AnnotationEditorType.STAMP:
                  return l.StampEditor.deserialize(P, this, p(this, A));
              }
              return null;
            }
            addNewEditor() {
              te(this, F, Ot).call(this, te(this, F, hn).call(this), !0);
            }
            setSelected(P) {
              p(this, A).setSelected(P);
            }
            toggleSelected(P) {
              p(this, A).toggleSelected(P);
            }
            isSelected(P) {
              return p(this, A).isSelected(P);
            }
            unselect(P) {
              p(this, A).unselect(P);
            }
            pointerup(P) {
              const {
                isMac: I
              } = n.FeatureTest.platform;
              if (!(P.button !== 0 || P.ctrlKey && I) && P.target === this.div && p(this, k)) {
                if (fe(this, k, !1), !p(this, d)) {
                  fe(this, d, !0);
                  return;
                }
                if (p(this, A).getMode() === n.AnnotationEditorType.STAMP) {
                  p(this, A).unselectAll();
                  return;
                }
                te(this, F, Ot).call(this, P, !1);
              }
            }
            pointerdown(P) {
              if (p(this, k)) {
                fe(this, k, !1);
                return;
              }
              const {
                isMac: I
              } = n.FeatureTest.platform;
              if (P.button !== 0 || P.ctrlKey && I || P.target !== this.div)
                return;
              fe(this, k, !0);
              const G = p(this, A).getActive();
              fe(this, d, !G || G.isEmpty());
            }
            findNewParent(P, I, G) {
              const ne = p(this, A).findParent(I, G);
              return ne === null || ne === this ? !1 : (ne.changeParent(P), !0);
            }
            destroy() {
              var P, I;
              ((P = p(this, A).getActive()) == null ? void 0 : P.parent) === this && (p(this, A).commitOrRemove(), p(this, A).setActiveEditor(null));
              for (const G of p(this, R).values())
                (I = p(this, h)) == null || I.removePointerInTextLayer(G.contentDiv), G.setParent(null), G.isAttachedToDOM = !1, G.div.remove();
              this.div = null, p(this, R).clear(), p(this, A).removeLayer(this);
            }
            render({
              viewport: P
            }) {
              this.viewport = P, (0, c.setLayerDimensions)(this.div, P);
              for (const I of p(this, A).getEditors(this.pageIndex))
                this.add(I);
              this.updateMode();
            }
            update({
              viewport: P
            }) {
              p(this, A).commitOrRemove(), this.viewport = P, (0, c.setLayerDimensions)(this.div, {
                rotation: P.rotation
              }), this.updateMode();
            }
            get pageDimensions() {
              const {
                pageWidth: P,
                pageHeight: I
              } = this.viewport.rawDims;
              return [P, I];
            }
          };
          h = new WeakMap(), d = new WeakMap(), w = new WeakMap(), b = new WeakMap(), _ = new WeakMap(), R = new WeakMap(), k = new WeakMap(), C = new WeakMap(), m = new WeakMap(), A = new WeakMap(), F = new WeakSet(), un = function(P) {
            switch (p(this, A).getMode()) {
              case n.AnnotationEditorType.FREETEXT:
                return new s.FreeTextEditor(P);
              case n.AnnotationEditorType.INK:
                return new o.InkEditor(P);
              case n.AnnotationEditorType.STAMP:
                return new l.StampEditor(P);
            }
            return null;
          }, Ot = function(P, I) {
            const G = this.getNextId(), ne = te(this, F, un).call(this, {
              parent: this,
              id: G,
              x: P.offsetX,
              y: P.offsetY,
              uiManager: p(this, A),
              isCentered: I
            });
            return ne && this.add(ne), ne;
          }, hn = function() {
            const {
              x: P,
              y: I,
              width: G,
              height: ne
            } = this.div.getBoundingClientRect(), X = Math.max(0, P), ee = Math.max(0, I), K = Math.min(window.innerWidth, P + G), se = Math.min(window.innerHeight, I + ne), q = (X + K) / 2 - P, Y = (ee + se) / 2 - I, [J, N] = this.viewport.rotation % 180 === 0 ? [q, Y] : [Y, q];
            return {
              offsetX: J,
              offsetY: N
            };
          }, dn = function() {
            fe(this, C, !0);
            for (const P of p(this, R).values())
              P.isEmpty() && P.remove();
            fe(this, C, !1);
          }, Ke(x, "_initialized", !1);
          let u = x;
          e.AnnotationEditorLayer = u;
        },
        /* 28 */
        /***/
        (r, e, t) => {
          var l, u, h, d, w, b, _, R, k, C, qn, Un, Gn, Tt, mn, Wn, fn;
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.FreeTextEditor = void 0;
          var n = t(1), a = t(5), s = t(4), o = t(29);
          const x = class x extends s.AnnotationEditor {
            constructor(I) {
              super({
                ...I,
                name: "freeTextEditor"
              });
              de(this, C);
              de(this, l, this.editorDivBlur.bind(this));
              de(this, u, this.editorDivFocus.bind(this));
              de(this, h, this.editorDivInput.bind(this));
              de(this, d, this.editorDivKeydown.bind(this));
              de(this, w);
              de(this, b, "");
              de(this, _, `${this.id}-editor`);
              de(this, R);
              de(this, k, null);
              fe(this, w, I.color || x._defaultColor || s.AnnotationEditor._defaultLineColor), fe(this, R, I.fontSize || x._defaultFontSize);
            }
            static get _keyboardManager() {
              const I = x.prototype, G = (ee) => ee.isEmpty(), ne = a.AnnotationEditorUIManager.TRANSLATE_SMALL, X = a.AnnotationEditorUIManager.TRANSLATE_BIG;
              return (0, n.shadow)(this, "_keyboardManager", new a.KeyboardManager([[["ctrl+s", "mac+meta+s", "ctrl+p", "mac+meta+p"], I.commitOrRemove, {
                bubbles: !0
              }], [["ctrl+Enter", "mac+meta+Enter", "Escape", "mac+Escape"], I.commitOrRemove], [["ArrowLeft", "mac+ArrowLeft"], I._translateEmpty, {
                args: [-ne, 0],
                checker: G
              }], [["ctrl+ArrowLeft", "mac+shift+ArrowLeft"], I._translateEmpty, {
                args: [-X, 0],
                checker: G
              }], [["ArrowRight", "mac+ArrowRight"], I._translateEmpty, {
                args: [ne, 0],
                checker: G
              }], [["ctrl+ArrowRight", "mac+shift+ArrowRight"], I._translateEmpty, {
                args: [X, 0],
                checker: G
              }], [["ArrowUp", "mac+ArrowUp"], I._translateEmpty, {
                args: [0, -ne],
                checker: G
              }], [["ctrl+ArrowUp", "mac+shift+ArrowUp"], I._translateEmpty, {
                args: [0, -X],
                checker: G
              }], [["ArrowDown", "mac+ArrowDown"], I._translateEmpty, {
                args: [0, ne],
                checker: G
              }], [["ctrl+ArrowDown", "mac+shift+ArrowDown"], I._translateEmpty, {
                args: [0, X],
                checker: G
              }]]));
            }
            static initialize(I) {
              s.AnnotationEditor.initialize(I, {
                strings: ["free_text2_default_content", "editor_free_text2_aria_label"]
              });
              const G = getComputedStyle(document.documentElement);
              this._internalPadding = parseFloat(G.getPropertyValue("--freetext-padding"));
            }
            static updateDefaultParams(I, G) {
              switch (I) {
                case n.AnnotationEditorParamsType.FREETEXT_SIZE:
                  x._defaultFontSize = G;
                  break;
                case n.AnnotationEditorParamsType.FREETEXT_COLOR:
                  x._defaultColor = G;
                  break;
              }
            }
            updateParams(I, G) {
              switch (I) {
                case n.AnnotationEditorParamsType.FREETEXT_SIZE:
                  te(this, C, qn).call(this, G);
                  break;
                case n.AnnotationEditorParamsType.FREETEXT_COLOR:
                  te(this, C, Un).call(this, G);
                  break;
              }
            }
            static get defaultPropertiesToUpdate() {
              return [[n.AnnotationEditorParamsType.FREETEXT_SIZE, x._defaultFontSize], [n.AnnotationEditorParamsType.FREETEXT_COLOR, x._defaultColor || s.AnnotationEditor._defaultLineColor]];
            }
            get propertiesToUpdate() {
              return [[n.AnnotationEditorParamsType.FREETEXT_SIZE, p(this, R)], [n.AnnotationEditorParamsType.FREETEXT_COLOR, p(this, w)]];
            }
            _translateEmpty(I, G) {
              this._uiManager.translateSelectedEditors(I, G, !0);
            }
            getInitialTranslation() {
              const I = this.parentScale;
              return [-x._internalPadding * I, -(x._internalPadding + p(this, R)) * I];
            }
            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", p(this, d)), this.editorDiv.addEventListener("focus", p(this, u)), this.editorDiv.addEventListener("blur", p(this, l)), this.editorDiv.addEventListener("input", p(this, h)));
            }
            disableEditMode() {
              this.isInEditMode() && (this.parent.setEditingState(!0), super.disableEditMode(), this.overlayDiv.classList.add("enabled"), this.editorDiv.contentEditable = !1, this.div.setAttribute("aria-activedescendant", p(this, _)), this._isDraggable = !0, this.editorDiv.removeEventListener("keydown", p(this, d)), this.editorDiv.removeEventListener("focus", p(this, u)), this.editorDiv.removeEventListener("blur", p(this, l)), this.editorDiv.removeEventListener("input", p(this, h)), this.div.focus({
                preventScroll: !0
              }), this.isEditing = !1, this.parent.div.classList.add("freeTextEditing"));
            }
            focusin(I) {
              this._focusEventsAllowed && (super.focusin(I), I.target !== this.editorDiv && this.editorDiv.focus());
            }
            onceAdded() {
              var I;
              if (this.width) {
                te(this, C, fn).call(this);
                return;
              }
              this.enableEditMode(), this.editorDiv.focus(), (I = this._initialOptions) != null && I.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();
            }
            commit() {
              if (!this.isInEditMode())
                return;
              super.commit(), this.disableEditMode();
              const I = p(this, b), G = fe(this, b, te(this, C, Gn).call(this).trimEnd());
              if (I === G)
                return;
              const ne = (X) => {
                if (fe(this, b, X), !X) {
                  this.remove();
                  return;
                }
                te(this, C, mn).call(this), this._uiManager.rebuild(this), te(this, C, Tt).call(this);
              };
              this.addCommands({
                cmd: () => {
                  ne(G);
                },
                undo: () => {
                  ne(I);
                },
                mustExec: !1
              }), te(this, C, Tt).call(this);
            }
            shouldGetKeyboardEvents() {
              return this.isInEditMode();
            }
            enterInEditMode() {
              this.enableEditMode(), this.editorDiv.focus();
            }
            dblclick(I) {
              this.enterInEditMode();
            }
            keydown(I) {
              I.target === this.div && I.key === "Enter" && (this.enterInEditMode(), I.preventDefault());
            }
            editorDivKeydown(I) {
              x._keyboardManager.exec(this, I);
            }
            editorDivFocus(I) {
              this.isEditing = !0;
            }
            editorDivBlur(I) {
              this.isEditing = !1;
            }
            editorDivInput(I) {
              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 I, G;
              this.width && (I = this.x, G = this.y), super.render(), this.editorDiv = document.createElement("div"), this.editorDiv.className = "internal", this.editorDiv.setAttribute("id", p(this, _)), this.enableEditing(), s.AnnotationEditor._l10nPromise.get("editor_free_text2_aria_label").then((X) => {
                var ee;
                return (ee = this.editorDiv) == null ? void 0 : ee.setAttribute("aria-label", X);
              }), s.AnnotationEditor._l10nPromise.get("free_text2_default_content").then((X) => {
                var ee;
                return (ee = this.editorDiv) == null ? void 0 : ee.setAttribute("default-content", X);
              }), this.editorDiv.contentEditable = !0;
              const {
                style: ne
              } = this.editorDiv;
              if (ne.fontSize = `calc(${p(this, R)}px * var(--scale-factor))`, ne.color = p(this, w), this.div.append(this.editorDiv), this.overlayDiv = document.createElement("div"), this.overlayDiv.classList.add("overlay", "enabled"), this.div.append(this.overlayDiv), (0, a.bindEvents)(this, this.div, ["dblclick", "keydown"]), this.width) {
                const [X, ee] = this.parentDimensions;
                if (this.annotationElementId) {
                  const {
                    position: K
                  } = p(this, k);
                  let [se, q] = this.getInitialTranslation();
                  [se, q] = this.pageTranslationToScreen(se, q);
                  const [Y, J] = this.pageDimensions, [N, M] = this.pageTranslation;
                  let v, L;
                  switch (this.rotation) {
                    case 0:
                      v = I + (K[0] - N) / Y, L = G + this.height - (K[1] - M) / J;
                      break;
                    case 90:
                      v = I + (K[0] - N) / Y, L = G - (K[1] - M) / J, [se, q] = [q, -se];
                      break;
                    case 180:
                      v = I - this.width + (K[0] - N) / Y, L = G - (K[1] - M) / J, [se, q] = [-se, -q];
                      break;
                    case 270:
                      v = I + (K[0] - N - this.height * J) / Y, L = G + (K[1] - M - this.width * Y) / J, [se, q] = [-q, se];
                      break;
                  }
                  this.setAt(v * X, L * ee, se, q);
                } else
                  this.setAt(I * X, G * ee, this.width * X, this.height * ee);
                te(this, C, mn).call(this), this._isDraggable = !0, this.editorDiv.contentEditable = !1;
              } else
                this._isDraggable = !1, this.editorDiv.contentEditable = !0;
              return this.div;
            }
            get contentDiv() {
              return this.editorDiv;
            }
            static deserialize(I, G, ne) {
              let X = null;
              if (I instanceof o.FreeTextAnnotationElement) {
                const {
                  data: {
                    defaultAppearanceData: {
                      fontSize: K,
                      fontColor: se
                    },
                    rect: q,
                    rotation: Y,
                    id: J
                  },
                  textContent: N,
                  textPosition: M,
                  parent: {
                    page: {
                      pageNumber: v
                    }
                  }
                } = I;
                if (!N || N.length === 0)
                  return null;
                X = I = {
                  annotationType: n.AnnotationEditorType.FREETEXT,
                  color: Array.from(se),
                  fontSize: K,
                  value: N.join(`
`),
                  position: M,
                  pageIndex: v - 1,
                  rect: q,
                  rotation: Y,
                  id: J,
                  deleted: !1
                };
              }
              const ee = super.deserialize(I, G, ne);
              return fe(ee, R, I.fontSize), fe(ee, w, n.Util.makeHexColor(...I.color)), fe(ee, b, I.value), ee.annotationElementId = I.id || null, fe(ee, k, X), ee;
            }
            serialize(I = !1) {
              if (this.isEmpty())
                return null;
              if (this.deleted)
                return {
                  pageIndex: this.pageIndex,
                  id: this.annotationElementId,
                  deleted: !0
                };
              const G = x._internalPadding * this.parentScale, ne = this.getRect(G, G), X = s.AnnotationEditor._colorManager.convert(this.isAttachedToDOM ? getComputedStyle(this.editorDiv).color : p(this, w)), ee = {
                annotationType: n.AnnotationEditorType.FREETEXT,
                color: X,
                fontSize: p(this, R),
                value: p(this, b),
                pageIndex: this.pageIndex,
                rect: ne,
                rotation: this.rotation,
                structTreeParentId: this._structTreeParentId
              };
              return I ? ee : this.annotationElementId && !te(this, C, Wn).call(this, ee) ? null : (ee.id = this.annotationElementId, ee);
            }
          };
          l = new WeakMap(), u = new WeakMap(), h = new WeakMap(), d = new WeakMap(), w = new WeakMap(), b = new WeakMap(), _ = new WeakMap(), R = new WeakMap(), k = new WeakMap(), C = new WeakSet(), qn = function(I) {
            const G = (X) => {
              this.editorDiv.style.fontSize = `calc(${X}px * var(--scale-factor))`, this.translate(0, -(X - p(this, R)) * this.parentScale), fe(this, R, X), te(this, C, Tt).call(this);
            }, ne = p(this, R);
            this.addCommands({
              cmd: () => {
                G(I);
              },
              undo: () => {
                G(ne);
              },
              mustExec: !0,
              type: n.AnnotationEditorParamsType.FREETEXT_SIZE,
              overwriteIfSameType: !0,
              keepUndo: !0
            });
          }, Un = function(I) {
            const G = p(this, w);
            this.addCommands({
              cmd: () => {
                fe(this, w, this.editorDiv.style.color = I);
              },
              undo: () => {
                fe(this, w, this.editorDiv.style.color = G);
              },
              mustExec: !0,
              type: n.AnnotationEditorParamsType.FREETEXT_COLOR,
              overwriteIfSameType: !0,
              keepUndo: !0
            });
          }, Gn = function() {
            const I = this.editorDiv.getElementsByTagName("div");
            if (I.length === 0)
              return this.editorDiv.innerText;
            const G = [];
            for (const ne of I)
              G.push(ne.innerText.replace(/\r\n?|\n/, ""));
            return G.join(`
`);
          }, Tt = function() {
            const [I, G] = this.parentDimensions;
            let ne;
            if (this.isAttachedToDOM)
              ne = this.div.getBoundingClientRect();
            else {
              const {
                currentLayer: X,
                div: ee
              } = this, K = ee.style.display;
              ee.style.display = "hidden", X.div.append(this.div), ne = ee.getBoundingClientRect(), ee.remove(), ee.style.display = K;
            }
            this.rotation % 180 === this.parentRotation % 180 ? (this.width = ne.width / I, this.height = ne.height / G) : (this.width = ne.height / I, this.height = ne.width / G), this.fixAndSetPosition();
          }, mn = function() {
            if (this.editorDiv.replaceChildren(), !!p(this, b))
              for (const I of p(this, b).split(`
`)) {
                const G = document.createElement("div");
                G.append(I ? document.createTextNode(I) : document.createElement("br")), this.editorDiv.append(G);
              }
          }, Wn = function(I) {
            const {
              value: G,
              fontSize: ne,
              color: X,
              rect: ee,
              pageIndex: K
            } = p(this, k);
            return I.value !== G || I.fontSize !== ne || I.rect.some((se, q) => Math.abs(se - ee[q]) >= 1) || I.color.some((se, q) => se !== X[q]) || I.pageIndex !== K;
          }, fn = function(I = !1) {
            if (!this.annotationElementId)
              return;
            if (te(this, C, Tt).call(this), !I && (this.width === 0 || this.height === 0)) {
              setTimeout(() => te(this, C, fn).call(this, !0), 0);
              return;
            }
            const G = x._internalPadding * this.parentScale;
            p(this, k).rect = this.getRect(G, G);
          }, Ke(x, "_freeTextDefaultContent", ""), Ke(x, "_internalPadding", 0), Ke(x, "_defaultColor", null), Ke(x, "_defaultFontSize", 10), Ke(x, "_type", "freetext");
          let c = x;
          e.FreeTextEditor = c;
        },
        /* 29 */
        /***/
        (r, e, t) => {
          var L, B, ft, jn, re, pe, be, Se, _e, we, oe, le, $, j, ae, ue, Ae, Te, ke, ie, Fe, De, Vn, $t, pn, gn, Ge, Qe, nt, xe, he, me, Ie, bn, et, V, ye, Me, Xn, yn;
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.StampAnnotationElement = e.InkAnnotationElement = e.FreeTextAnnotationElement = e.AnnotationLayer = void 0;
          var n = t(1), a = t(6), s = t(3), o = t(30), c = t(31), l = t(32);
          const u = 1e3, h = 9, d = /* @__PURE__ */ new WeakSet();
          function w(Le) {
            return {
              width: Le[2] - Le[0],
              height: Le[3] - Le[1]
            };
          }
          class b {
            static create(W) {
              switch (W.data.annotationType) {
                case n.AnnotationType.LINK:
                  return new R(W);
                case n.AnnotationType.TEXT:
                  return new k(W);
                case n.AnnotationType.WIDGET:
                  switch (W.data.fieldType) {
                    case "Tx":
                      return new m(W);
                    case "Btn":
                      return W.data.radioButton ? new f(W) : W.data.checkBox ? new F(W) : new g(W);
                    case "Ch":
                      return new y(W);
                    case "Sig":
                      return new A(W);
                  }
                  return new C(W);
                case n.AnnotationType.POPUP:
                  return new E(W);
                case n.AnnotationType.FREETEXT:
                  return new O(W);
                case n.AnnotationType.LINE:
                  return new P(W);
                case n.AnnotationType.SQUARE:
                  return new I(W);
                case n.AnnotationType.CIRCLE:
                  return new G(W);
                case n.AnnotationType.POLYLINE:
                  return new ne(W);
                case n.AnnotationType.CARET:
                  return new ee(W);
                case n.AnnotationType.INK:
                  return new K(W);
                case n.AnnotationType.POLYGON:
                  return new X(W);
                case n.AnnotationType.HIGHLIGHT:
                  return new se(W);
                case n.AnnotationType.UNDERLINE:
                  return new q(W);
                case n.AnnotationType.SQUIGGLY:
                  return new Y(W);
                case n.AnnotationType.STRIKEOUT:
                  return new J(W);
                case n.AnnotationType.STAMP:
                  return new N(W);
                case n.AnnotationType.FILEATTACHMENT:
                  return new M(W);
                default:
                  return new _(W);
              }
            }
          }
          const H = class H {
            constructor(W, {
              isRenderable: z = !1,
              ignoreBorder: Q = !1,
              createQuadrilaterals: ge = !1
            } = {}) {
              de(this, L, !1);
              this.isRenderable = z, this.data = W.data, this.layer = W.layer, this.linkService = W.linkService, this.downloadManager = W.downloadManager, this.imageResourcesPath = W.imageResourcesPath, this.renderForms = W.renderForms, this.svgFactory = W.svgFactory, this.annotationStorage = W.annotationStorage, this.enableScripting = W.enableScripting, this.hasJSActions = W.hasJSActions, this._fieldObjects = W.fieldObjects, this.parent = W.parent, z && (this.container = this._createContainer(Q)), ge && this._createQuadrilaterals();
            }
            static _hasPopupData({
              titleObj: W,
              contentsObj: z,
              richText: Q
            }) {
              return !!(W != null && W.str || z != null && z.str || Q != null && Q.str);
            }
            get hasPopupData() {
              return H._hasPopupData(this.data);
            }
            _createContainer(W) {
              const {
                data: z,
                parent: {
                  page: Q,
                  viewport: ge
                }
              } = this, ve = document.createElement("section");
              ve.setAttribute("data-annotation-id", z.id), this instanceof C || (ve.tabIndex = u), ve.style.zIndex = this.parent.zIndex++, this.data.popupRef && ve.setAttribute("aria-haspopup", "dialog"), z.noRotate && ve.classList.add("norotate");
              const {
                pageWidth: Ee,
                pageHeight: Ce,
                pageX: Ne,
                pageY: Be
              } = ge.rawDims;
              if (!z.rect || this instanceof E) {
                const {
                  rotation: Ve
                } = z;
                return !z.hasOwnCanvas && Ve !== 0 && this.setRotation(Ve, ve), ve;
              }
              const {
                width: Pe,
                height: Ye
              } = w(z.rect), ze = n.Util.normalizeRect([z.rect[0], Q.view[3] - z.rect[1] + Q.view[1], z.rect[2], Q.view[3] - z.rect[3] + Q.view[1]]);
              if (!W && z.borderStyle.width > 0) {
                ve.style.borderWidth = `${z.borderStyle.width}px`;
                const Ve = z.borderStyle.horizontalCornerRadius, Je = z.borderStyle.verticalCornerRadius;
                if (Ve > 0 || Je > 0) {
                  const it = `calc(${Ve}px * var(--scale-factor)) / calc(${Je}px * var(--scale-factor))`;
                  ve.style.borderRadius = it;
                } else if (this instanceof f) {
                  const it = `calc(${Pe}px * var(--scale-factor)) / calc(${Ye}px * var(--scale-factor))`;
                  ve.style.borderRadius = it;
                }
                switch (z.borderStyle.style) {
                  case n.AnnotationBorderStyleType.SOLID:
                    ve.style.borderStyle = "solid";
                    break;
                  case n.AnnotationBorderStyleType.DASHED:
                    ve.style.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:
                    ve.style.borderBottomStyle = "solid";
                    break;
                }
                const rt = z.borderColor || null;
                rt ? (fe(this, L, !0), ve.style.borderColor = n.Util.makeHexColor(rt[0] | 0, rt[1] | 0, rt[2] | 0)) : ve.style.borderWidth = 0;
              }
              ve.style.left = `${100 * (ze[0] - Ne) / Ee}%`, ve.style.top = `${100 * (ze[1] - Be) / Ce}%`;
              const {
                rotation: Oe
              } = z;
              return z.hasOwnCanvas || Oe === 0 ? (ve.style.width = `${100 * Pe / Ee}%`, ve.style.height = `${100 * Ye / Ce}%`) : this.setRotation(Oe, ve), ve;
            }
            setRotation(W, z = this.container) {
              if (!this.data.rect)
                return;
              const {
                pageWidth: Q,
                pageHeight: ge
              } = this.parent.viewport.rawDims, {
                width: ve,
                height: Ee
              } = w(this.data.rect);
              let Ce, Ne;
              W % 180 === 0 ? (Ce = 100 * ve / Q, Ne = 100 * Ee / ge) : (Ce = 100 * Ee / Q, Ne = 100 * ve / ge), z.style.width = `${Ce}%`, z.style.height = `${Ne}%`, z.setAttribute("data-main-rotation", (360 - W) % 360);
            }
            get _commonActions() {
              const W = (z, Q, ge) => {
                const ve = ge.detail[z], Ee = ve[0], Ce = ve.slice(1);
                ge.target.style[Q] = o.ColorConverters[`${Ee}_HTML`](Ce), this.annotationStorage.setValue(this.data.id, {
                  [Q]: o.ColorConverters[`${Ee}_rgb`](Ce)
                });
              };
              return (0, n.shadow)(this, "_commonActions", {
                display: (z) => {
                  const {
                    display: Q
                  } = z.detail, ge = Q % 2 === 1;
                  this.container.style.visibility = ge ? "hidden" : "visible", this.annotationStorage.setValue(this.data.id, {
                    noView: ge,
                    noPrint: Q === 1 || Q === 2
                  });
                },
                print: (z) => {
                  this.annotationStorage.setValue(this.data.id, {
                    noPrint: !z.detail.print
                  });
                },
                hidden: (z) => {
                  const {
                    hidden: Q
                  } = z.detail;
                  this.container.style.visibility = Q ? "hidden" : "visible", this.annotationStorage.setValue(this.data.id, {
                    noPrint: Q,
                    noView: Q
                  });
                },
                focus: (z) => {
                  setTimeout(() => z.target.focus({
                    preventScroll: !1
                  }), 0);
                },
                userName: (z) => {
                  z.target.title = z.detail.userName;
                },
                readonly: (z) => {
                  z.target.disabled = z.detail.readonly;
                },
                required: (z) => {
                  this._setRequired(z.target, z.detail.required);
                },
                bgColor: (z) => {
                  W("bgColor", "backgroundColor", z);
                },
                fillColor: (z) => {
                  W("fillColor", "backgroundColor", z);
                },
                fgColor: (z) => {
                  W("fgColor", "color", z);
                },
                textColor: (z) => {
                  W("textColor", "color", z);
                },
                borderColor: (z) => {
                  W("borderColor", "borderColor", z);
                },
                strokeColor: (z) => {
                  W("strokeColor", "borderColor", z);
                },
                rotation: (z) => {
                  const Q = z.detail.rotation;
                  this.setRotation(Q), this.annotationStorage.setValue(this.data.id, {
                    rotation: Q
                  });
                }
              });
            }
            _dispatchEventFromSandbox(W, z) {
              const Q = this._commonActions;
              for (const ge of Object.keys(z.detail)) {
                const ve = W[ge] || Q[ge];
                ve == null || ve(z);
              }
            }
            _setDefaultPropertiesFromJS(W) {
              if (!this.enableScripting)
                return;
              const z = this.annotationStorage.getRawValue(this.data.id);
              if (!z)
                return;
              const Q = this._commonActions;
              for (const [ge, ve] of Object.entries(z)) {
                const Ee = Q[ge];
                if (Ee) {
                  const Ce = {
                    detail: {
                      [ge]: ve
                    },
                    target: W
                  };
                  Ee(Ce), delete z[ge];
                }
              }
            }
            _createQuadrilaterals() {
              if (!this.container)
                return;
              const {
                quadPoints: W
              } = this.data;
              if (!W)
                return;
              const [z, Q, ge, ve] = this.data.rect;
              if (W.length === 1) {
                const [, {
                  x: Je,
                  y: rt
                }, {
                  x: it,
                  y: st
                }] = W[0];
                if (ge === Je && ve === rt && z === it && Q === st)
                  return;
              }
              const {
                style: Ee
              } = this.container;
              let Ce;
              if (p(this, L)) {
                const {
                  borderColor: Je,
                  borderWidth: rt
                } = Ee;
                Ee.borderWidth = 0, Ce = ["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="${Je}" stroke-width="${rt}">`], this.container.classList.add("hasBorder");
              }
              const Ne = ge - z, Be = ve - Q, {
                svgFactory: Pe
              } = this, Ye = Pe.createElement("svg");
              Ye.classList.add("quadrilateralsContainer"), Ye.setAttribute("width", 0), Ye.setAttribute("height", 0);
              const ze = Pe.createElement("defs");
              Ye.append(ze);
              const Oe = Pe.createElement("clipPath"), Ve = `clippath_${this.data.id}`;
              Oe.setAttribute("id", Ve), Oe.setAttribute("clipPathUnits", "objectBoundingBox"), ze.append(Oe);
              for (const [, {
                x: Je,
                y: rt
              }, {
                x: it,
                y: st
              }] of W) {
                const He = Pe.createElement("rect"), ce = (it - z) / Ne, Re = (ve - rt) / Be, We = (Je - it) / Ne, at = (rt - st) / Be;
                He.setAttribute("x", ce), He.setAttribute("y", Re), He.setAttribute("width", We), He.setAttribute("height", at), Oe.append(He), Ce == null || Ce.push(`<rect vector-effect="non-scaling-stroke" x="${ce}" y="${Re}" width="${We}" height="${at}"/>`);
              }
              p(this, L) && (Ce.push("</g></svg>')"), Ee.backgroundImage = Ce.join("")), this.container.append(Ye), this.container.style.clipPath = `url(#${Ve})`;
            }
            _createPopup() {
              const {
                container: W,
                data: z
              } = this;
              W.setAttribute("aria-haspopup", "dialog");
              const Q = new E({
                data: {
                  color: z.color,
                  titleObj: z.titleObj,
                  modificationDate: z.modificationDate,
                  contentsObj: z.contentsObj,
                  richText: z.richText,
                  parentRect: z.rect,
                  borderStyle: 0,
                  id: `popup_${z.id}`,
                  rotation: z.rotation
                },
                parent: this.parent,
                elements: [this]
              });
              this.parent.div.append(Q.render());
            }
            render() {
              (0, n.unreachable)("Abstract method `AnnotationElement.render` called");
            }
            _getElementsByName(W, z = null) {
              const Q = [];
              if (this._fieldObjects) {
                const ge = this._fieldObjects[W];
                if (ge)
                  for (const {
                    page: ve,
                    id: Ee,
                    exportValues: Ce
                  } of ge) {
                    if (ve === -1 || Ee === z)
                      continue;
                    const Ne = typeof Ce == "string" ? Ce : null, Be = document.querySelector(`[data-element-id="${Ee}"]`);
                    if (Be && !d.has(Be)) {
                      (0, n.warn)(`_getElementsByName - element not allowed: ${Ee}`);
                      continue;
                    }
                    Q.push({
                      id: Ee,
                      exportValue: Ne,
                      domElement: Be
                    });
                  }
                return Q;
              }
              for (const ge of document.getElementsByName(W)) {
                const {
                  exportValue: ve
                } = ge, Ee = ge.getAttribute("data-element-id");
                Ee !== z && d.has(ge) && Q.push({
                  id: Ee,
                  exportValue: ve,
                  domElement: ge
                });
              }
              return Q;
            }
            show() {
              var W;
              this.container && (this.container.hidden = !1), (W = this.popup) == null || W.maybeShow();
            }
            hide() {
              var W;
              this.container && (this.container.hidden = !0), (W = this.popup) == null || W.forceHide();
            }
            getElementsToTriggerPopup() {
              return this.container;
            }
            addHighlightArea() {
              const W = this.getElementsToTriggerPopup();
              if (Array.isArray(W))
                for (const z of W)
                  z.classList.add("highlightArea");
              else
                W.classList.add("highlightArea");
            }
            _editOnDoubleClick() {
              const {
                annotationEditorType: W,
                data: {
                  id: z
                }
              } = this;
              this.container.addEventListener("dblclick", () => {
                var Q;
                (Q = this.linkService.eventBus) == null || Q.dispatch("switchannotationeditormode", {
                  source: this,
                  mode: W,
                  editId: z
                });
              });
            }
          };
          L = new WeakMap();
          let _ = H;
          class R extends _ {
            constructor(z, Q = null) {
              super(z, {
                isRenderable: !0,
                ignoreBorder: !!(Q != null && Q.ignoreBorder),
                createQuadrilaterals: !0
              });
              de(this, B);
              this.isTooltipOnly = z.data.isTooltipOnly;
            }
            render() {
              const {
                data: z,
                linkService: Q
              } = this, ge = document.createElement("a");
              ge.setAttribute("data-element-id", z.id);
              let ve = !1;
              return z.url ? (Q.addLinkAttributes(ge, z.url, z.newWindow), ve = !0) : z.action ? (this._bindNamedAction(ge, z.action), ve = !0) : z.attachment ? (this._bindAttachment(ge, z.attachment), ve = !0) : z.setOCGState ? (te(this, B, jn).call(this, ge, z.setOCGState), ve = !0) : z.dest ? (this._bindLink(ge, z.dest), ve = !0) : (z.actions && (z.actions.Action || z.actions["Mouse Up"] || z.actions["Mouse Down"]) && this.enableScripting && this.hasJSActions && (this._bindJSAction(ge, z), ve = !0), z.resetForm ? (this._bindResetFormAction(ge, z.resetForm), ve = !0) : this.isTooltipOnly && !ve && (this._bindLink(ge, ""), ve = !0)), this.container.classList.add("linkAnnotation"), ve && this.container.append(ge), this.container;
            }
            _bindLink(z, Q) {
              z.href = this.linkService.getDestinationHash(Q), z.onclick = () => (Q && this.linkService.goToDestination(Q), !1), (Q || Q === "") && te(this, B, ft).call(this);
            }
            _bindNamedAction(z, Q) {
              z.href = this.linkService.getAnchorUrl(""), z.onclick = () => (this.linkService.executeNamedAction(Q), !1), te(this, B, ft).call(this);
            }
            _bindAttachment(z, Q) {
              z.href = this.linkService.getAnchorUrl(""), z.onclick = () => {
                var ge;
                return (ge = this.downloadManager) == null || ge.openOrDownloadData(this.container, Q.content, Q.filename), !1;
              }, te(this, B, ft).call(this);
            }
            _bindJSAction(z, Q) {
              z.href = this.linkService.getAnchorUrl("");
              const ge = /* @__PURE__ */ new Map([["Action", "onclick"], ["Mouse Up", "onmouseup"], ["Mouse Down", "onmousedown"]]);
              for (const ve of Object.keys(Q.actions)) {
                const Ee = ge.get(ve);
                Ee && (z[Ee] = () => {
                  var Ce;
                  return (Ce = this.linkService.eventBus) == null || Ce.dispatch("dispatcheventinsandbox", {
                    source: this,
                    detail: {
                      id: Q.id,
                      name: ve
                    }
                  }), !1;
                });
              }
              z.onclick || (z.onclick = () => !1), te(this, B, ft).call(this);
            }
            _bindResetFormAction(z, Q) {
              const ge = z.onclick;
              if (ge || (z.href = this.linkService.getAnchorUrl("")), te(this, B, ft).call(this), !this._fieldObjects) {
                (0, n.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'), ge || (z.onclick = () => !1);
                return;
              }
              z.onclick = () => {
                var Ye;
                ge == null || ge();
                const {
                  fields: ve,
                  refs: Ee,
                  include: Ce
                } = Q, Ne = [];
                if (ve.length !== 0 || Ee.length !== 0) {
                  const ze = new Set(Ee);
                  for (const Oe of ve) {
                    const Ve = this._fieldObjects[Oe] || [];
                    for (const {
                      id: Je
                    } of Ve)
                      ze.add(Je);
                  }
                  for (const Oe of Object.values(this._fieldObjects))
                    for (const Ve of Oe)
                      ze.has(Ve.id) === Ce && Ne.push(Ve);
                } else
                  for (const ze of Object.values(this._fieldObjects))
                    Ne.push(...ze);
                const Be = this.annotationStorage, Pe = [];
                for (const ze of Ne) {
                  const {
                    id: Oe
                  } = ze;
                  switch (Pe.push(Oe), ze.type) {
                    case "text": {
                      const Je = ze.defaultValue || "";
                      Be.setValue(Oe, {
                        value: Je
                      });
                      break;
                    }
                    case "checkbox":
                    case "radiobutton": {
                      const Je = ze.defaultValue === ze.exportValues;
                      Be.setValue(Oe, {
                        value: Je
                      });
                      break;
                    }
                    case "combobox":
                    case "listbox": {
                      const Je = ze.defaultValue || "";
                      Be.setValue(Oe, {
                        value: Je
                      });
                      break;
                    }
                    default:
                      continue;
                  }
                  const Ve = document.querySelector(`[data-element-id="${Oe}"]`);
                  if (Ve) {
                    if (!d.has(Ve)) {
                      (0, n.warn)(`_bindResetFormAction - element not allowed: ${Oe}`);
                      continue;
                    }
                  } else continue;
                  Ve.dispatchEvent(new Event("resetform"));
                }
                return this.enableScripting && ((Ye = this.linkService.eventBus) == null || Ye.dispatch("dispatcheventinsandbox", {
                  source: this,
                  detail: {
                    id: "app",
                    ids: Pe,
                    name: "ResetForm"
                  }
                })), !1;
              };
            }
          }
          B = new WeakSet(), ft = function() {
            this.container.setAttribute("data-internal-link", "");
          }, jn = function(z, Q) {
            z.href = this.linkService.getAnchorUrl(""), z.onclick = () => (this.linkService.executeSetOCGState(Q), !1), te(this, B, ft).call(this);
          };
          class k extends _ {
            constructor(W) {
              super(W, {
                isRenderable: !0
              });
            }
            render() {
              this.container.classList.add("textAnnotation");
              const W = document.createElement("img");
              return W.src = this.imageResourcesPath + "annotation-" + this.data.name.toLowerCase() + ".svg", W.alt = "[{{type}} Annotation]", W.dataset.l10nId = "text_annotation_type", W.dataset.l10nArgs = JSON.stringify({
                type: this.data.name
              }), !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.append(W), this.container;
            }
          }
          class C extends _ {
            render() {
              return this.data.alternativeText && (this.container.title = this.data.alternativeText), this.container;
            }
            showElementAndHideCanvas(W) {
              var z;
              this.data.hasOwnCanvas && (((z = W.previousSibling) == null ? void 0 : z.nodeName) === "CANVAS" && (W.previousSibling.hidden = !0), W.hidden = !1);
            }
            _getKeyModifier(W) {
              const {
                isWin: z,
                isMac: Q
              } = n.FeatureTest.platform;
              return z && W.ctrlKey || Q && W.metaKey;
            }
            _setEventListener(W, z, Q, ge, ve) {
              Q.includes("mouse") ? W.addEventListener(Q, (Ee) => {
                var Ce;
                (Ce = this.linkService.eventBus) == null || Ce.dispatch("dispatcheventinsandbox", {
                  source: this,
                  detail: {
                    id: this.data.id,
                    name: ge,
                    value: ve(Ee),
                    shift: Ee.shiftKey,
                    modifier: this._getKeyModifier(Ee)
                  }
                });
              }) : W.addEventListener(Q, (Ee) => {
                var Ce;
                if (Q === "blur") {
                  if (!z.focused || !Ee.relatedTarget)
                    return;
                  z.focused = !1;
                } else if (Q === "focus") {
                  if (z.focused)
                    return;
                  z.focused = !0;
                }
                ve && ((Ce = this.linkService.eventBus) == null || Ce.dispatch("dispatcheventinsandbox", {
                  source: this,
                  detail: {
                    id: this.data.id,
                    name: ge,
                    value: ve(Ee)
                  }
                }));
              });
            }
            _setEventListeners(W, z, Q, ge) {
              var ve, Ee, Ce;
              for (const [Ne, Be] of Q)
                (Be === "Action" || (ve = this.data.actions) != null && ve[Be]) && ((Be === "Focus" || Be === "Blur") && (z || (z = {
                  focused: !1
                })), this._setEventListener(W, z, Ne, Be, ge), Be === "Focus" && !((Ee = this.data.actions) != null && Ee.Blur) ? this._setEventListener(W, z, "blur", "Blur", null) : Be === "Blur" && !((Ce = this.data.actions) != null && Ce.Focus) && this._setEventListener(W, z, "focus", "Focus", null));
            }
            _setBackgroundColor(W) {
              const z = this.data.backgroundColor || null;
              W.style.backgroundColor = z === null ? "transparent" : n.Util.makeHexColor(z[0], z[1], z[2]);
            }
            _setTextStyle(W) {
              const z = ["left", "center", "right"], {
                fontColor: Q
              } = this.data.defaultAppearanceData, ge = this.data.defaultAppearanceData.fontSize || h, ve = W.style;
              let Ee;
              const Ce = 2, Ne = (Be) => Math.round(10 * Be) / 10;
              if (this.data.multiLine) {
                const Be = Math.abs(this.data.rect[3] - this.data.rect[1] - Ce), Pe = Math.round(Be / (n.LINE_FACTOR * ge)) || 1, Ye = Be / Pe;
                Ee = Math.min(ge, Ne(Ye / n.LINE_FACTOR));
              } else {
                const Be = Math.abs(this.data.rect[3] - this.data.rect[1] - Ce);
                Ee = Math.min(ge, Ne(Be / n.LINE_FACTOR));
              }
              ve.fontSize = `calc(${Ee}px * var(--scale-factor))`, ve.color = n.Util.makeHexColor(Q[0], Q[1], Q[2]), this.data.textAlignment !== null && (ve.textAlign = z[this.data.textAlignment]);
            }
            _setRequired(W, z) {
              z ? W.setAttribute("required", !0) : W.removeAttribute("required"), W.setAttribute("aria-required", z);
            }
          }
          class m extends C {
            constructor(W) {
              const z = W.renderForms || !W.data.hasAppearance && !!W.data.fieldValue;
              super(W, {
                isRenderable: z
              });
            }
            setPropertyOnSiblings(W, z, Q, ge) {
              const ve = this.annotationStorage;
              for (const Ee of this._getElementsByName(W.name, W.id))
                Ee.domElement && (Ee.domElement[z] = Q), ve.setValue(Ee.id, {
                  [ge]: Q
                });
            }
            render() {
              var ge, ve;
              const W = this.annotationStorage, z = this.data.id;
              this.container.classList.add("textWidgetAnnotation");
              let Q = null;
              if (this.renderForms) {
                const Ee = W.getValue(z, {
                  value: this.data.fieldValue
                });
                let Ce = Ee.value || "";
                const Ne = W.getValue(z, {
                  charLimit: this.data.maxLen
                }).charLimit;
                Ne && Ce.length > Ne && (Ce = Ce.slice(0, Ne));
                let Be = Ee.formattedValue || ((ge = this.data.textContent) == null ? void 0 : ge.join(`
`)) || null;
                Be && this.data.comb && (Be = Be.replaceAll(/\s+/g, ""));
                const Pe = {
                  userValue: Ce,
                  formattedValue: Be,
                  lastCommittedValue: null,
                  commitKey: 1,
                  focused: !1
                };
                this.data.multiLine ? (Q = document.createElement("textarea"), Q.textContent = Be ?? Ce, this.data.doNotScroll && (Q.style.overflowY = "hidden")) : (Q = document.createElement("input"), Q.type = "text", Q.setAttribute("value", Be ?? Ce), this.data.doNotScroll && (Q.style.overflowX = "hidden")), this.data.hasOwnCanvas && (Q.hidden = !0), d.add(Q), Q.setAttribute("data-element-id", z), Q.disabled = this.data.readOnly, Q.name = this.data.fieldName, Q.tabIndex = u, this._setRequired(Q, this.data.required), Ne && (Q.maxLength = Ne), Q.addEventListener("input", (ze) => {
                  W.setValue(z, {
                    value: ze.target.value
                  }), this.setPropertyOnSiblings(Q, "value", ze.target.value, "value"), Pe.formattedValue = null;
                }), Q.addEventListener("resetform", (ze) => {
                  const Oe = this.data.defaultFieldValue ?? "";
                  Q.value = Pe.userValue = Oe, Pe.formattedValue = null;
                });
                let Ye = (ze) => {
                  const {
                    formattedValue: Oe
                  } = Pe;
                  Oe != null && (ze.target.value = Oe), ze.target.scrollLeft = 0;
                };
                if (this.enableScripting && this.hasJSActions) {
                  Q.addEventListener("focus", (Oe) => {
                    if (Pe.focused)
                      return;
                    const {
                      target: Ve
                    } = Oe;
                    Pe.userValue && (Ve.value = Pe.userValue), Pe.lastCommittedValue = Ve.value, Pe.commitKey = 1, Pe.focused = !0;
                  }), Q.addEventListener("updatefromsandbox", (Oe) => {
                    this.showElementAndHideCanvas(Oe.target);
                    const Ve = {
                      value(Je) {
                        Pe.userValue = Je.detail.value ?? "", W.setValue(z, {
                          value: Pe.userValue.toString()
                        }), Je.target.value = Pe.userValue;
                      },
                      formattedValue(Je) {
                        const {
                          formattedValue: rt
                        } = Je.detail;
                        Pe.formattedValue = rt, rt != null && Je.target !== document.activeElement && (Je.target.value = rt), W.setValue(z, {
                          formattedValue: rt
                        });
                      },
                      selRange(Je) {
                        Je.target.setSelectionRange(...Je.detail.selRange);
                      },
                      charLimit: (Je) => {
                        var He;
                        const {
                          charLimit: rt
                        } = Je.detail, {
                          target: it
                        } = Je;
                        if (rt === 0) {
                          it.removeAttribute("maxLength");
                          return;
                        }
                        it.setAttribute("maxLength", rt);
                        let st = Pe.userValue;
                        !st || st.length <= rt || (st = st.slice(0, rt), it.value = Pe.userValue = st, W.setValue(z, {
                          value: st
                        }), (He = this.linkService.eventBus) == null || He.dispatch("dispatcheventinsandbox", {
                          source: this,
                          detail: {
                            id: z,
                            name: "Keystroke",
                            value: st,
                            willCommit: !0,
                            commitKey: 1,
                            selStart: it.selectionStart,
                            selEnd: it.selectionEnd
                          }
                        }));
                      }
                    };
                    this._dispatchEventFromSandbox(Ve, Oe);
                  }), Q.addEventListener("keydown", (Oe) => {
                    var rt;
                    Pe.commitKey = 1;
                    let Ve = -1;
                    if (Oe.key === "Escape" ? Ve = 0 : Oe.key === "Enter" && !this.data.multiLine ? Ve = 2 : Oe.key === "Tab" && (Pe.commitKey = 3), Ve === -1)
                      return;
                    const {
                      value: Je
                    } = Oe.target;
                    Pe.lastCommittedValue !== Je && (Pe.lastCommittedValue = Je, Pe.userValue = Je, (rt = this.linkService.eventBus) == null || rt.dispatch("dispatcheventinsandbox", {
                      source: this,
                      detail: {
                        id: z,
                        name: "Keystroke",
                        value: Je,
                        willCommit: !0,
                        commitKey: Ve,
                        selStart: Oe.target.selectionStart,
                        selEnd: Oe.target.selectionEnd
                      }
                    }));
                  });
                  const ze = Ye;
                  Ye = null, Q.addEventListener("blur", (Oe) => {
                    var Je;
                    if (!Pe.focused || !Oe.relatedTarget)
                      return;
                    Pe.focused = !1;
                    const {
                      value: Ve
                    } = Oe.target;
                    Pe.userValue = Ve, Pe.lastCommittedValue !== Ve && ((Je = this.linkService.eventBus) == null || Je.dispatch("dispatcheventinsandbox", {
                      source: this,
                      detail: {
                        id: z,
                        name: "Keystroke",
                        value: Ve,
                        willCommit: !0,
                        commitKey: Pe.commitKey,
                        selStart: Oe.target.selectionStart,
                        selEnd: Oe.target.selectionEnd
                      }
                    })), ze(Oe);
                  }), (ve = this.data.actions) != null && ve.Keystroke && Q.addEventListener("beforeinput", (Oe) => {
                    var Re;
                    Pe.lastCommittedValue = null;
                    const {
                      data: Ve,
                      target: Je
                    } = Oe, {
                      value: rt,
                      selectionStart: it,
                      selectionEnd: st
                    } = Je;
                    let He = it, ce = st;
                    switch (Oe.inputType) {
                      case "deleteWordBackward": {
                        const We = rt.substring(0, it).match(/\w*[^\w]*$/);
                        We && (He -= We[0].length);
                        break;
                      }
                      case "deleteWordForward": {
                        const We = rt.substring(it).match(/^[^\w]*\w*/);
                        We && (ce += We[0].length);
                        break;
                      }
                      case "deleteContentBackward":
                        it === st && (He -= 1);
                        break;
                      case "deleteContentForward":
                        it === st && (ce += 1);
                        break;
                    }
                    Oe.preventDefault(), (Re = this.linkService.eventBus) == null || Re.dispatch("dispatcheventinsandbox", {
                      source: this,
                      detail: {
                        id: z,
                        name: "Keystroke",
                        value: rt,
                        change: Ve || "",
                        willCommit: !1,
                        selStart: He,
                        selEnd: ce
                      }
                    });
                  }), this._setEventListeners(Q, Pe, [["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"]], (Oe) => Oe.target.value);
                }
                if (Ye && Q.addEventListener("blur", Ye), this.data.comb) {
                  const Oe = (this.data.rect[2] - this.data.rect[0]) / Ne;
                  Q.classList.add("comb"), Q.style.letterSpacing = `calc(${Oe}px * var(--scale-factor) - 1ch)`;
                }
              } else
                Q = document.createElement("div"), Q.textContent = this.data.fieldValue, Q.style.verticalAlign = "middle", Q.style.display = "table-cell";
              return this._setTextStyle(Q), this._setBackgroundColor(Q), this._setDefaultPropertiesFromJS(Q), this.container.append(Q), this.container;
            }
          }
          class A extends C {
            constructor(W) {
              super(W, {
                isRenderable: !!W.data.hasOwnCanvas
              });
            }
          }
          class F extends C {
            constructor(W) {
              super(W, {
                isRenderable: W.renderForms
              });
            }
            render() {
              const W = this.annotationStorage, z = this.data, Q = z.id;
              let ge = W.getValue(Q, {
                value: z.exportValue === z.fieldValue
              }).value;
              typeof ge == "string" && (ge = ge !== "Off", W.setValue(Q, {
                value: ge
              })), this.container.classList.add("buttonWidgetAnnotation", "checkBox");
              const ve = document.createElement("input");
              return d.add(ve), ve.setAttribute("data-element-id", Q), ve.disabled = z.readOnly, this._setRequired(ve, this.data.required), ve.type = "checkbox", ve.name = z.fieldName, ge && ve.setAttribute("checked", !0), ve.setAttribute("exportValue", z.exportValue), ve.tabIndex = u, ve.addEventListener("change", (Ee) => {
                const {
                  name: Ce,
                  checked: Ne
                } = Ee.target;
                for (const Be of this._getElementsByName(Ce, Q)) {
                  const Pe = Ne && Be.exportValue === z.exportValue;
                  Be.domElement && (Be.domElement.checked = Pe), W.setValue(Be.id, {
                    value: Pe
                  });
                }
                W.setValue(Q, {
                  value: Ne
                });
              }), ve.addEventListener("resetform", (Ee) => {
                const Ce = z.defaultFieldValue || "Off";
                Ee.target.checked = Ce === z.exportValue;
              }), this.enableScripting && this.hasJSActions && (ve.addEventListener("updatefromsandbox", (Ee) => {
                const Ce = {
                  value(Ne) {
                    Ne.target.checked = Ne.detail.value !== "Off", W.setValue(Q, {
                      value: Ne.target.checked
                    });
                  }
                };
                this._dispatchEventFromSandbox(Ce, Ee);
              }), this._setEventListeners(ve, null, [["change", "Validate"], ["change", "Action"], ["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"]], (Ee) => Ee.target.checked)), this._setBackgroundColor(ve), this._setDefaultPropertiesFromJS(ve), this.container.append(ve), this.container;
            }
          }
          class f extends C {
            constructor(W) {
              super(W, {
                isRenderable: W.renderForms
              });
            }
            render() {
              this.container.classList.add("buttonWidgetAnnotation", "radioButton");
              const W = this.annotationStorage, z = this.data, Q = z.id;
              let ge = W.getValue(Q, {
                value: z.fieldValue === z.buttonValue
              }).value;
              typeof ge == "string" && (ge = ge !== z.buttonValue, W.setValue(Q, {
                value: ge
              }));
              const ve = document.createElement("input");
              if (d.add(ve), ve.setAttribute("data-element-id", Q), ve.disabled = z.readOnly, this._setRequired(ve, this.data.required), ve.type = "radio", ve.name = z.fieldName, ge && ve.setAttribute("checked", !0), ve.tabIndex = u, ve.addEventListener("change", (Ee) => {
                const {
                  name: Ce,
                  checked: Ne
                } = Ee.target;
                for (const Be of this._getElementsByName(Ce, Q))
                  W.setValue(Be.id, {
                    value: !1
                  });
                W.setValue(Q, {
                  value: Ne
                });
              }), ve.addEventListener("resetform", (Ee) => {
                const Ce = z.defaultFieldValue;
                Ee.target.checked = Ce != null && Ce === z.buttonValue;
              }), this.enableScripting && this.hasJSActions) {
                const Ee = z.buttonValue;
                ve.addEventListener("updatefromsandbox", (Ce) => {
                  const Ne = {
                    value: (Be) => {
                      const Pe = Ee === Be.detail.value;
                      for (const Ye of this._getElementsByName(Be.target.name)) {
                        const ze = Pe && Ye.id === Q;
                        Ye.domElement && (Ye.domElement.checked = ze), W.setValue(Ye.id, {
                          value: ze
                        });
                      }
                    }
                  };
                  this._dispatchEventFromSandbox(Ne, Ce);
                }), this._setEventListeners(ve, null, [["change", "Validate"], ["change", "Action"], ["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"]], (Ce) => Ce.target.checked);
              }
              return this._setBackgroundColor(ve), this._setDefaultPropertiesFromJS(ve), this.container.append(ve), this.container;
            }
          }
          class g extends R {
            constructor(W) {
              super(W, {
                ignoreBorder: W.data.hasAppearance
              });
            }
            render() {
              const W = super.render();
              W.classList.add("buttonWidgetAnnotation", "pushButton"), this.data.alternativeText && (W.title = this.data.alternativeText);
              const z = W.lastChild;
              return this.enableScripting && this.hasJSActions && z && (this._setDefaultPropertiesFromJS(z), z.addEventListener("updatefromsandbox", (Q) => {
                this._dispatchEventFromSandbox({}, Q);
              })), W;
            }
          }
          class y extends C {
            constructor(W) {
              super(W, {
                isRenderable: W.renderForms
              });
            }
            render() {
              this.container.classList.add("choiceWidgetAnnotation");
              const W = this.annotationStorage, z = this.data.id, Q = W.getValue(z, {
                value: this.data.fieldValue
              }), ge = document.createElement("select");
              d.add(ge), ge.setAttribute("data-element-id", z), ge.disabled = this.data.readOnly, this._setRequired(ge, this.data.required), ge.name = this.data.fieldName, ge.tabIndex = u;
              let ve = this.data.combo && this.data.options.length > 0;
              this.data.combo || (ge.size = this.data.options.length, this.data.multiSelect && (ge.multiple = !0)), ge.addEventListener("resetform", (Pe) => {
                const Ye = this.data.defaultFieldValue;
                for (const ze of ge.options)
                  ze.selected = ze.value === Ye;
              });
              for (const Pe of this.data.options) {
                const Ye = document.createElement("option");
                Ye.textContent = Pe.displayValue, Ye.value = Pe.exportValue, Q.value.includes(Pe.exportValue) && (Ye.setAttribute("selected", !0), ve = !1), ge.append(Ye);
              }
              let Ee = null;
              if (ve) {
                const Pe = document.createElement("option");
                Pe.value = " ", Pe.setAttribute("hidden", !0), Pe.setAttribute("selected", !0), ge.prepend(Pe), Ee = () => {
                  Pe.remove(), ge.removeEventListener("input", Ee), Ee = null;
                }, ge.addEventListener("input", Ee);
              }
              const Ce = (Pe) => {
                const Ye = Pe ? "value" : "textContent", {
                  options: ze,
                  multiple: Oe
                } = ge;
                return Oe ? Array.prototype.filter.call(ze, (Ve) => Ve.selected).map((Ve) => Ve[Ye]) : ze.selectedIndex === -1 ? null : ze[ze.selectedIndex][Ye];
              };
              let Ne = Ce(!1);
              const Be = (Pe) => {
                const Ye = Pe.target.options;
                return Array.prototype.map.call(Ye, (ze) => ({
                  displayValue: ze.textContent,
                  exportValue: ze.value
                }));
              };
              return this.enableScripting && this.hasJSActions ? (ge.addEventListener("updatefromsandbox", (Pe) => {
                const Ye = {
                  value(ze) {
                    Ee == null || Ee();
                    const Oe = ze.detail.value, Ve = new Set(Array.isArray(Oe) ? Oe : [Oe]);
                    for (const Je of ge.options)
                      Je.selected = Ve.has(Je.value);
                    W.setValue(z, {
                      value: Ce(!0)
                    }), Ne = Ce(!1);
                  },
                  multipleSelection(ze) {
                    ge.multiple = !0;
                  },
                  remove(ze) {
                    const Oe = ge.options, Ve = ze.detail.remove;
                    Oe[Ve].selected = !1, ge.remove(Ve), Oe.length > 0 && Array.prototype.findIndex.call(Oe, (rt) => rt.selected) === -1 && (Oe[0].selected = !0), W.setValue(z, {
                      value: Ce(!0),
                      items: Be(ze)
                    }), Ne = Ce(!1);
                  },
                  clear(ze) {
                    for (; ge.length !== 0; )
                      ge.remove(0);
                    W.setValue(z, {
                      value: null,
                      items: []
                    }), Ne = Ce(!1);
                  },
                  insert(ze) {
                    const {
                      index: Oe,
                      displayValue: Ve,
                      exportValue: Je
                    } = ze.detail.insert, rt = ge.children[Oe], it = document.createElement("option");
                    it.textContent = Ve, it.value = Je, rt ? rt.before(it) : ge.append(it), W.setValue(z, {
                      value: Ce(!0),
                      items: Be(ze)
                    }), Ne = Ce(!1);
                  },
                  items(ze) {
                    const {
                      items: Oe
                    } = ze.detail;
                    for (; ge.length !== 0; )
                      ge.remove(0);
                    for (const Ve of Oe) {
                      const {
                        displayValue: Je,
                        exportValue: rt
                      } = Ve, it = document.createElement("option");
                      it.textContent = Je, it.value = rt, ge.append(it);
                    }
                    ge.options.length > 0 && (ge.options[0].selected = !0), W.setValue(z, {
                      value: Ce(!0),
                      items: Be(ze)
                    }), Ne = Ce(!1);
                  },
                  indices(ze) {
                    const Oe = new Set(ze.detail.indices);
                    for (const Ve of ze.target.options)
                      Ve.selected = Oe.has(Ve.index);
                    W.setValue(z, {
                      value: Ce(!0)
                    }), Ne = Ce(!1);
                  },
                  editable(ze) {
                    ze.target.disabled = !ze.detail.editable;
                  }
                };
                this._dispatchEventFromSandbox(Ye, Pe);
              }), ge.addEventListener("input", (Pe) => {
                var ze;
                const Ye = Ce(!0);
                W.setValue(z, {
                  value: Ye
                }), Pe.preventDefault(), (ze = this.linkService.eventBus) == null || ze.dispatch("dispatcheventinsandbox", {
                  source: this,
                  detail: {
                    id: z,
                    name: "Keystroke",
                    value: Ne,
                    changeEx: Ye,
                    willCommit: !1,
                    commitKey: 1,
                    keyDown: !1
                  }
                });
              }), this._setEventListeners(ge, null, [["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"], ["input", "Action"], ["input", "Validate"]], (Pe) => Pe.target.value)) : ge.addEventListener("input", function(Pe) {
                W.setValue(z, {
                  value: Ce(!0)
                });
              }), this.data.combo && this._setTextStyle(ge), this._setBackgroundColor(ge), this._setDefaultPropertiesFromJS(ge), this.container.append(ge), this.container;
            }
          }
          class E extends _ {
            constructor(W) {
              const {
                data: z,
                elements: Q
              } = W;
              super(W, {
                isRenderable: _._hasPopupData(z)
              }), this.elements = Q;
            }
            render() {
              this.container.classList.add("popupAnnotation");
              const W = new x({
                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
              }), z = [];
              for (const Q of this.elements)
                Q.popup = W, z.push(Q.data.id), Q.addHighlightArea();
              return this.container.setAttribute("aria-controls", z.map((Q) => `${n.AnnotationPrefix}${Q}`).join(",")), this.container;
            }
          }
          class x {
            constructor({
              container: W,
              color: z,
              elements: Q,
              titleObj: ge,
              modificationDate: ve,
              contentsObj: Ee,
              richText: Ce,
              parent: Ne,
              rect: Be,
              parentRect: Pe,
              open: Ye
            }) {
              de(this, De);
              de(this, re, null);
              de(this, pe, te(this, De, Vn).bind(this));
              de(this, be, te(this, De, gn).bind(this));
              de(this, Se, te(this, De, pn).bind(this));
              de(this, _e, te(this, De, $t).bind(this));
              de(this, we, null);
              de(this, oe, null);
              de(this, le, null);
              de(this, $, null);
              de(this, j, null);
              de(this, ae, null);
              de(this, ue, !1);
              de(this, Ae, null);
              de(this, Te, null);
              de(this, ke, null);
              de(this, ie, null);
              de(this, Fe, !1);
              var Oe;
              fe(this, oe, W), fe(this, ie, ge), fe(this, le, Ee), fe(this, ke, Ce), fe(this, j, Ne), fe(this, we, z), fe(this, Te, Be), fe(this, ae, Pe), fe(this, $, Q);
              const ze = a.PDFDateString.toDateObject(ve);
              ze && fe(this, re, Ne.l10n.get("annotation_date_string", {
                date: ze.toLocaleDateString(),
                time: ze.toLocaleTimeString()
              })), this.trigger = Q.flatMap((Ve) => Ve.getElementsToTriggerPopup());
              for (const Ve of this.trigger)
                Ve.addEventListener("click", p(this, _e)), Ve.addEventListener("mouseenter", p(this, Se)), Ve.addEventListener("mouseleave", p(this, be)), Ve.classList.add("popupTriggerArea");
              for (const Ve of Q)
                (Oe = Ve.container) == null || Oe.addEventListener("keydown", p(this, pe));
              p(this, oe).hidden = !0, Ye && te(this, De, $t).call(this);
            }
            render() {
              if (p(this, Ae))
                return;
              const {
                page: {
                  view: W
                },
                viewport: {
                  rawDims: {
                    pageWidth: z,
                    pageHeight: Q,
                    pageX: ge,
                    pageY: ve
                  }
                }
              } = p(this, j), Ee = fe(this, Ae, document.createElement("div"));
              if (Ee.className = "popup", p(this, we)) {
                const He = Ee.style.outlineColor = n.Util.makeHexColor(...p(this, we));
                CSS.supports("background-color", "color-mix(in srgb, red 30%, white)") ? Ee.style.backgroundColor = `color-mix(in srgb, ${He} 30%, white)` : Ee.style.backgroundColor = n.Util.makeHexColor(...p(this, we).map((Re) => Math.floor(0.7 * (255 - Re) + Re)));
              }
              const Ce = document.createElement("span");
              Ce.className = "header";
              const Ne = document.createElement("h1");
              if (Ce.append(Ne), {
                dir: Ne.dir,
                str: Ne.textContent
              } = p(this, ie), Ee.append(Ce), p(this, re)) {
                const He = document.createElement("span");
                He.classList.add("popupDate"), p(this, re).then((ce) => {
                  He.textContent = ce;
                }), Ce.append(He);
              }
              const Be = p(this, le), Pe = p(this, ke);
              if (Pe != null && Pe.str && (!(Be != null && Be.str) || Be.str === Pe.str))
                l.XfaLayer.render({
                  xfaHtml: Pe.html,
                  intent: "richText",
                  div: Ee
                }), Ee.lastChild.classList.add("richText", "popupContent");
              else {
                const He = this._formatContents(Be);
                Ee.append(He);
              }
              let Ye = !!p(this, ae), ze = Ye ? p(this, ae) : p(this, Te);
              for (const He of p(this, $))
                if (!ze || n.Util.intersect(He.data.rect, ze) !== null) {
                  ze = He.data.rect, Ye = !0;
                  break;
                }
              const Oe = n.Util.normalizeRect([ze[0], W[3] - ze[1] + W[1], ze[2], W[3] - ze[3] + W[1]]), Je = Ye ? ze[2] - ze[0] + 5 : 0, rt = Oe[0] + Je, it = Oe[1], {
                style: st
              } = p(this, oe);
              st.left = `${100 * (rt - ge) / z}%`, st.top = `${100 * (it - ve) / Q}%`, p(this, oe).append(Ee);
            }
            _formatContents({
              str: W,
              dir: z
            }) {
              const Q = document.createElement("p");
              Q.classList.add("popupContent"), Q.dir = z;
              const ge = W.split(/(?:\r\n?|\n)/);
              for (let ve = 0, Ee = ge.length; ve < Ee; ++ve) {
                const Ce = ge[ve];
                Q.append(document.createTextNode(Ce)), ve < Ee - 1 && Q.append(document.createElement("br"));
              }
              return Q;
            }
            forceHide() {
              fe(this, Fe, this.isVisible), p(this, Fe) && (p(this, oe).hidden = !0);
            }
            maybeShow() {
              p(this, Fe) && (fe(this, Fe, !1), p(this, oe).hidden = !1);
            }
            get isVisible() {
              return p(this, oe).hidden === !1;
            }
          }
          re = new WeakMap(), pe = new WeakMap(), be = new WeakMap(), Se = new WeakMap(), _e = new WeakMap(), we = new WeakMap(), oe = new WeakMap(), le = new WeakMap(), $ = new WeakMap(), j = new WeakMap(), ae = new WeakMap(), ue = new WeakMap(), Ae = new WeakMap(), Te = new WeakMap(), ke = new WeakMap(), ie = new WeakMap(), Fe = new WeakMap(), De = new WeakSet(), Vn = function(W) {
            W.altKey || W.shiftKey || W.ctrlKey || W.metaKey || (W.key === "Enter" || W.key === "Escape" && p(this, ue)) && te(this, De, $t).call(this);
          }, $t = function() {
            fe(this, ue, !p(this, ue)), p(this, ue) ? (te(this, De, pn).call(this), p(this, oe).addEventListener("click", p(this, _e)), p(this, oe).addEventListener("keydown", p(this, pe))) : (te(this, De, gn).call(this), p(this, oe).removeEventListener("click", p(this, _e)), p(this, oe).removeEventListener("keydown", p(this, pe)));
          }, pn = function() {
            p(this, Ae) || this.render(), this.isVisible ? p(this, ue) && p(this, oe).classList.add("focused") : (p(this, oe).hidden = !1, p(this, oe).style.zIndex = parseInt(p(this, oe).style.zIndex) + 1e3);
          }, gn = function() {
            p(this, oe).classList.remove("focused"), !(p(this, ue) || !this.isVisible) && (p(this, oe).hidden = !0, p(this, oe).style.zIndex = parseInt(p(this, oe).style.zIndex) - 1e3);
          };
          class O extends _ {
            constructor(W) {
              super(W, {
                isRenderable: !0,
                ignoreBorder: !0
              }), this.textContent = W.data.textContent, this.textPosition = W.data.textPosition, this.annotationEditorType = n.AnnotationEditorType.FREETEXT;
            }
            render() {
              if (this.container.classList.add("freeTextAnnotation"), this.textContent) {
                const W = document.createElement("div");
                W.classList.add("annotationTextContent"), W.setAttribute("role", "comment");
                for (const z of this.textContent) {
                  const Q = document.createElement("span");
                  Q.textContent = z, W.append(Q);
                }
                this.container.append(W);
              }
              return !this.data.popupRef && this.hasPopupData && this._createPopup(), this._editOnDoubleClick(), this.container;
            }
          }
          e.FreeTextAnnotationElement = O;
          class P extends _ {
            constructor(z) {
              super(z, {
                isRenderable: !0,
                ignoreBorder: !0
              });
              de(this, Ge, null);
            }
            render() {
              this.container.classList.add("lineAnnotation");
              const z = this.data, {
                width: Q,
                height: ge
              } = w(z.rect), ve = this.svgFactory.create(Q, ge, !0), Ee = fe(this, Ge, this.svgFactory.createElement("svg:line"));
              return Ee.setAttribute("x1", z.rect[2] - z.lineCoordinates[0]), Ee.setAttribute("y1", z.rect[3] - z.lineCoordinates[1]), Ee.setAttribute("x2", z.rect[2] - z.lineCoordinates[2]), Ee.setAttribute("y2", z.rect[3] - z.lineCoordinates[3]), Ee.setAttribute("stroke-width", z.borderStyle.width || 1), Ee.setAttribute("stroke", "transparent"), Ee.setAttribute("fill", "transparent"), ve.append(Ee), this.container.append(ve), !z.popupRef && this.hasPopupData && this._createPopup(), this.container;
            }
            getElementsToTriggerPopup() {
              return p(this, Ge);
            }
            addHighlightArea() {
              this.container.classList.add("highlightArea");
            }
          }
          Ge = new WeakMap();
          class I extends _ {
            constructor(z) {
              super(z, {
                isRenderable: !0,
                ignoreBorder: !0
              });
              de(this, Qe, null);
            }
            render() {
              this.container.classList.add("squareAnnotation");
              const z = this.data, {
                width: Q,
                height: ge
              } = w(z.rect), ve = this.svgFactory.create(Q, ge, !0), Ee = z.borderStyle.width, Ce = fe(this, Qe, this.svgFactory.createElement("svg:rect"));
              return Ce.setAttribute("x", Ee / 2), Ce.setAttribute("y", Ee / 2), Ce.setAttribute("width", Q - Ee), Ce.setAttribute("height", ge - Ee), Ce.setAttribute("stroke-width", Ee || 1), Ce.setAttribute("stroke", "transparent"), Ce.setAttribute("fill", "transparent"), ve.append(Ce), this.container.append(ve), !z.popupRef && this.hasPopupData && this._createPopup(), this.container;
            }
            getElementsToTriggerPopup() {
              return p(this, Qe);
            }
            addHighlightArea() {
              this.container.classList.add("highlightArea");
            }
          }
          Qe = new WeakMap();
          class G extends _ {
            constructor(z) {
              super(z, {
                isRenderable: !0,
                ignoreBorder: !0
              });
              de(this, nt, null);
            }
            render() {
              this.container.classList.add("circleAnnotation");
              const z = this.data, {
                width: Q,
                height: ge
              } = w(z.rect), ve = this.svgFactory.create(Q, ge, !0), Ee = z.borderStyle.width, Ce = fe(this, nt, this.svgFactory.createElement("svg:ellipse"));
              return Ce.setAttribute("cx", Q / 2), Ce.setAttribute("cy", ge / 2), Ce.setAttribute("rx", Q / 2 - Ee / 2), Ce.setAttribute("ry", ge / 2 - Ee / 2), Ce.setAttribute("stroke-width", Ee || 1), Ce.setAttribute("stroke", "transparent"), Ce.setAttribute("fill", "transparent"), ve.append(Ce), this.container.append(ve), !z.popupRef && this.hasPopupData && this._createPopup(), this.container;
            }
            getElementsToTriggerPopup() {
              return p(this, nt);
            }
            addHighlightArea() {
              this.container.classList.add("highlightArea");
            }
          }
          nt = new WeakMap();
          class ne extends _ {
            constructor(z) {
              super(z, {
                isRenderable: !0,
                ignoreBorder: !0
              });
              de(this, xe, null);
              this.containerClassName = "polylineAnnotation", this.svgElementName = "svg:polyline";
            }
            render() {
              this.container.classList.add(this.containerClassName);
              const z = this.data, {
                width: Q,
                height: ge
              } = w(z.rect), ve = this.svgFactory.create(Q, ge, !0);
              let Ee = [];
              for (const Ne of z.vertices) {
                const Be = Ne.x - z.rect[0], Pe = z.rect[3] - Ne.y;
                Ee.push(Be + "," + Pe);
              }
              Ee = Ee.join(" ");
              const Ce = fe(this, xe, this.svgFactory.createElement(this.svgElementName));
              return Ce.setAttribute("points", Ee), Ce.setAttribute("stroke-width", z.borderStyle.width || 1), Ce.setAttribute("stroke", "transparent"), Ce.setAttribute("fill", "transparent"), ve.append(Ce), this.container.append(ve), !z.popupRef && this.hasPopupData && this._createPopup(), this.container;
            }
            getElementsToTriggerPopup() {
              return p(this, xe);
            }
            addHighlightArea() {
              this.container.classList.add("highlightArea");
            }
          }
          xe = new WeakMap();
          class X extends ne {
            constructor(W) {
              super(W), this.containerClassName = "polygonAnnotation", this.svgElementName = "svg:polygon";
            }
          }
          class ee extends _ {
            constructor(W) {
              super(W, {
                isRenderable: !0,
                ignoreBorder: !0
              });
            }
            render() {
              return this.container.classList.add("caretAnnotation"), !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container;
            }
          }
          class K extends _ {
            constructor(z) {
              super(z, {
                isRenderable: !0,
                ignoreBorder: !0
              });
              de(this, he, []);
              this.containerClassName = "inkAnnotation", this.svgElementName = "svg:polyline", this.annotationEditorType = n.AnnotationEditorType.INK;
            }
            render() {
              this.container.classList.add(this.containerClassName);
              const z = this.data, {
                width: Q,
                height: ge
              } = w(z.rect), ve = this.svgFactory.create(Q, ge, !0);
              for (const Ee of z.inkLists) {
                let Ce = [];
                for (const Be of Ee) {
                  const Pe = Be.x - z.rect[0], Ye = z.rect[3] - Be.y;
                  Ce.push(`${Pe},${Ye}`);
                }
                Ce = Ce.join(" ");
                const Ne = this.svgFactory.createElement(this.svgElementName);
                p(this, he).push(Ne), Ne.setAttribute("points", Ce), Ne.setAttribute("stroke-width", z.borderStyle.width || 1), Ne.setAttribute("stroke", "transparent"), Ne.setAttribute("fill", "transparent"), !z.popupRef && this.hasPopupData && this._createPopup(), ve.append(Ne);
              }
              return this.container.append(ve), this.container;
            }
            getElementsToTriggerPopup() {
              return p(this, he);
            }
            addHighlightArea() {
              this.container.classList.add("highlightArea");
            }
          }
          he = new WeakMap(), e.InkAnnotationElement = K;
          class se extends _ {
            constructor(W) {
              super(W, {
                isRenderable: !0,
                ignoreBorder: !0,
                createQuadrilaterals: !0
              });
            }
            render() {
              return !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.classList.add("highlightAnnotation"), this.container;
            }
          }
          class q extends _ {
            constructor(W) {
              super(W, {
                isRenderable: !0,
                ignoreBorder: !0,
                createQuadrilaterals: !0
              });
            }
            render() {
              return !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.classList.add("underlineAnnotation"), this.container;
            }
          }
          class Y extends _ {
            constructor(W) {
              super(W, {
                isRenderable: !0,
                ignoreBorder: !0,
                createQuadrilaterals: !0
              });
            }
            render() {
              return !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.classList.add("squigglyAnnotation"), this.container;
            }
          }
          class J extends _ {
            constructor(W) {
              super(W, {
                isRenderable: !0,
                ignoreBorder: !0,
                createQuadrilaterals: !0
              });
            }
            render() {
              return !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.classList.add("strikeoutAnnotation"), this.container;
            }
          }
          class N extends _ {
            constructor(W) {
              super(W, {
                isRenderable: !0,
                ignoreBorder: !0
              });
            }
            render() {
              return this.container.classList.add("stampAnnotation"), !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container;
            }
          }
          e.StampAnnotationElement = N;
          class M extends _ {
            constructor(z) {
              var ve;
              super(z, {
                isRenderable: !0
              });
              de(this, Ie);
              de(this, me, null);
              const {
                filename: Q,
                content: ge
              } = this.data.file;
              this.filename = (0, a.getFilenameFromUrl)(Q, !0), this.content = ge, (ve = this.linkService.eventBus) == null || ve.dispatch("fileattachmentannotation", {
                source: this,
                filename: Q,
                content: ge
              });
            }
            render() {
              this.container.classList.add("fileAttachmentAnnotation");
              const {
                container: z,
                data: Q
              } = this;
              let ge;
              Q.hasAppearance || Q.fillAlpha === 0 ? ge = document.createElement("div") : (ge = document.createElement("img"), ge.src = `${this.imageResourcesPath}annotation-${/paperclip/i.test(Q.name) ? "paperclip" : "pushpin"}.svg`, Q.fillAlpha && Q.fillAlpha < 1 && (ge.style = `filter: opacity(${Math.round(Q.fillAlpha * 100)}%);`)), ge.addEventListener("dblclick", te(this, Ie, bn).bind(this)), fe(this, me, ge);
              const {
                isMac: ve
              } = n.FeatureTest.platform;
              return z.addEventListener("keydown", (Ee) => {
                Ee.key === "Enter" && (ve ? Ee.metaKey : Ee.ctrlKey) && te(this, Ie, bn).call(this);
              }), !Q.popupRef && this.hasPopupData ? this._createPopup() : ge.classList.add("popupTriggerArea"), z.append(ge), z;
            }
            getElementsToTriggerPopup() {
              return p(this, me);
            }
            addHighlightArea() {
              this.container.classList.add("highlightArea");
            }
          }
          me = new WeakMap(), Ie = new WeakSet(), bn = function() {
            var z;
            (z = this.downloadManager) == null || z.openOrDownloadData(this.container, this.content, this.filename);
          };
          class v {
            constructor({
              div: W,
              accessibilityManager: z,
              annotationCanvasMap: Q,
              l10n: ge,
              page: ve,
              viewport: Ee
            }) {
              de(this, Me);
              de(this, et, null);
              de(this, V, null);
              de(this, ye, /* @__PURE__ */ new Map());
              this.div = W, fe(this, et, z), fe(this, V, Q), this.l10n = ge, this.page = ve, this.viewport = Ee, this.zIndex = 0, this.l10n || (this.l10n = c.NullL10n);
            }
            async render(W) {
              const {
                annotations: z
              } = W, Q = this.div;
              (0, a.setLayerDimensions)(Q, this.viewport);
              const ge = /* @__PURE__ */ new Map(), ve = {
                data: null,
                layer: Q,
                linkService: W.linkService,
                downloadManager: W.downloadManager,
                imageResourcesPath: W.imageResourcesPath || "",
                renderForms: W.renderForms !== !1,
                svgFactory: new a.DOMSVGFactory(),
                annotationStorage: W.annotationStorage || new s.AnnotationStorage(),
                enableScripting: W.enableScripting === !0,
                hasJSActions: W.hasJSActions,
                fieldObjects: W.fieldObjects,
                parent: this,
                elements: null
              };
              for (const Ee of z) {
                if (Ee.noHTML)
                  continue;
                const Ce = Ee.annotationType === n.AnnotationType.POPUP;
                if (Ce) {
                  const Pe = ge.get(Ee.id);
                  if (!Pe)
                    continue;
                  ve.elements = Pe;
                } else {
                  const {
                    width: Pe,
                    height: Ye
                  } = w(Ee.rect);
                  if (Pe <= 0 || Ye <= 0)
                    continue;
                }
                ve.data = Ee;
                const Ne = b.create(ve);
                if (!Ne.isRenderable)
                  continue;
                if (!Ce && Ee.popupRef) {
                  const Pe = ge.get(Ee.popupRef);
                  Pe ? Pe.push(Ne) : ge.set(Ee.popupRef, [Ne]);
                }
                Ne.annotationEditorType > 0 && p(this, ye).set(Ne.data.id, Ne);
                const Be = Ne.render();
                Ee.hidden && (Be.style.visibility = "hidden"), te(this, Me, Xn).call(this, Be, Ee.id);
              }
              te(this, Me, yn).call(this), await this.l10n.translate(Q);
            }
            update({
              viewport: W
            }) {
              const z = this.div;
              this.viewport = W, (0, a.setLayerDimensions)(z, {
                rotation: W.rotation
              }), te(this, Me, yn).call(this), z.hidden = !1;
            }
            getEditableAnnotations() {
              return Array.from(p(this, ye).values());
            }
            getEditableAnnotation(W) {
              return p(this, ye).get(W);
            }
          }
          et = new WeakMap(), V = new WeakMap(), ye = new WeakMap(), Me = new WeakSet(), Xn = function(W, z) {
            var ge;
            const Q = W.firstChild || W;
            Q.id = `${n.AnnotationPrefix}${z}`, this.div.append(W), (ge = p(this, et)) == null || ge.moveElementInDOM(this.div, W, Q, !1);
          }, yn = function() {
            if (!p(this, V))
              return;
            const W = this.div;
            for (const [z, Q] of p(this, V)) {
              const ge = W.querySelector(`[data-annotation-id="${z}"]`);
              if (!ge)
                continue;
              const {
                firstChild: ve
              } = ge;
              ve ? ve.nodeName === "CANVAS" ? ve.replaceWith(Q) : ve.before(Q) : ge.append(Q);
            }
            p(this, V).clear();
          }, e.AnnotationLayer = v;
        },
        /* 30 */
        /***/
        (r, e) => {
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.ColorConverters = void 0;
          function t(s) {
            return Math.floor(Math.max(0, Math.min(1, s)) * 255).toString(16).padStart(2, "0");
          }
          function n(s) {
            return Math.max(0, Math.min(255, 255 * s));
          }
          class a {
            static CMYK_G([o, c, l, u]) {
              return ["G", 1 - Math.min(1, 0.3 * o + 0.59 * l + 0.11 * c + u)];
            }
            static G_CMYK([o]) {
              return ["CMYK", 0, 0, 0, 1 - o];
            }
            static G_RGB([o]) {
              return ["RGB", o, o, o];
            }
            static G_rgb([o]) {
              return o = n(o), [o, o, o];
            }
            static G_HTML([o]) {
              const c = t(o);
              return `#${c}${c}${c}`;
            }
            static RGB_G([o, c, l]) {
              return ["G", 0.3 * o + 0.59 * c + 0.11 * l];
            }
            static RGB_rgb(o) {
              return o.map(n);
            }
            static RGB_HTML(o) {
              return `#${o.map(t).join("")}`;
            }
            static T_HTML() {
              return "#00000000";
            }
            static T_rgb() {
              return [null];
            }
            static CMYK_RGB([o, c, l, u]) {
              return ["RGB", 1 - Math.min(1, o + u), 1 - Math.min(1, l + u), 1 - Math.min(1, c + u)];
            }
            static CMYK_rgb([o, c, l, u]) {
              return [n(1 - Math.min(1, o + u)), n(1 - Math.min(1, l + u)), n(1 - Math.min(1, c + u))];
            }
            static CMYK_HTML(o) {
              const c = this.CMYK_RGB(o).slice(1);
              return this.RGB_HTML(c);
            }
            static RGB_CMYK([o, c, l]) {
              const u = 1 - o, h = 1 - c, d = 1 - l, w = Math.min(u, h, d);
              return ["CMYK", u, h, d, w];
            }
          }
          e.ColorConverters = a;
        },
        /* 31 */
        /***/
        (r, e) => {
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.NullL10n = void 0, e.getL10nFallback = n;
          const t = {
            of_pages: "of {{pagesCount}}",
            page_of_pages: "({{pageNumber}} of {{pagesCount}})",
            document_properties_kb: "{{size_kb}} KB ({{size_b}} bytes)",
            document_properties_mb: "{{size_mb}} MB ({{size_b}} bytes)",
            document_properties_date_string: "{{date}}, {{time}}",
            document_properties_page_size_unit_inches: "in",
            document_properties_page_size_unit_millimeters: "mm",
            document_properties_page_size_orientation_portrait: "portrait",
            document_properties_page_size_orientation_landscape: "landscape",
            document_properties_page_size_name_a3: "A3",
            document_properties_page_size_name_a4: "A4",
            document_properties_page_size_name_letter: "Letter",
            document_properties_page_size_name_legal: "Legal",
            document_properties_page_size_dimension_string: "{{width}} × {{height}} {{unit}} ({{orientation}})",
            document_properties_page_size_dimension_name_string: "{{width}} × {{height}} {{unit}} ({{name}}, {{orientation}})",
            document_properties_linearized_yes: "Yes",
            document_properties_linearized_no: "No",
            additional_layers: "Additional Layers",
            page_landmark: "Page {{page}}",
            thumb_page_title: "Page {{page}}",
            thumb_page_canvas: "Thumbnail of Page {{page}}",
            find_reached_top: "Reached top of document, continued from bottom",
            find_reached_bottom: "Reached end of document, continued from top",
            "find_match_count[one]": "{{current}} of {{total}} match",
            "find_match_count[other]": "{{current}} of {{total}} matches",
            "find_match_count_limit[one]": "More than {{limit}} match",
            "find_match_count_limit[other]": "More than {{limit}} matches",
            find_not_found: "Phrase not found",
            page_scale_width: "Page Width",
            page_scale_fit: "Page Fit",
            page_scale_auto: "Automatic Zoom",
            page_scale_actual: "Actual Size",
            page_scale_percent: "{{scale}}%",
            loading_error: "An error occurred while loading the PDF.",
            invalid_file_error: "Invalid or corrupted PDF file.",
            missing_file_error: "Missing PDF file.",
            unexpected_response_error: "Unexpected server response.",
            rendering_error: "An error occurred while rendering the page.",
            annotation_date_string: "{{date}}, {{time}}",
            printing_not_supported: "Warning: Printing is not fully supported by this browser.",
            printing_not_ready: "Warning: The PDF is not fully loaded for printing.",
            web_fonts_disabled: "Web fonts are disabled: unable to use embedded PDF fonts.",
            free_text2_default_content: "Start typing…",
            editor_free_text2_aria_label: "Text Editor",
            editor_ink2_aria_label: "Draw Editor",
            editor_ink_canvas_aria_label: "User-created image",
            editor_alt_text_button_label: "Alt text",
            editor_alt_text_edit_button_label: "Edit alt text",
            editor_alt_text_decorative_tooltip: "Marked as decorative"
          };
          t.print_progress_percent = "{{progress}}%";
          function n(o, c) {
            switch (o) {
              case "find_match_count":
                o = `find_match_count[${c.total === 1 ? "one" : "other"}]`;
                break;
              case "find_match_count_limit":
                o = `find_match_count_limit[${c.limit === 1 ? "one" : "other"}]`;
                break;
            }
            return t[o] || "";
          }
          function a(o, c) {
            return c ? o.replaceAll(/\{\{\s*(\w+)\s*\}\}/g, (l, u) => u in c ? c[u] : "{{" + u + "}}") : o;
          }
          const s = {
            async getLanguage() {
              return "en-us";
            },
            async getDirection() {
              return "ltr";
            },
            async get(o, c = null, l = n(o, c)) {
              return a(l, c);
            },
            async translate(o) {
            }
          };
          e.NullL10n = s;
        },
        /* 32 */
        /***/
        (r, e, t) => {
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.XfaLayer = void 0;
          var n = t(25);
          class a {
            static setupStorage(o, c, l, u, h) {
              const d = u.getValue(c, {
                value: null
              });
              switch (l.name) {
                case "textarea":
                  if (d.value !== null && (o.textContent = d.value), h === "print")
                    break;
                  o.addEventListener("input", (w) => {
                    u.setValue(c, {
                      value: w.target.value
                    });
                  });
                  break;
                case "input":
                  if (l.attributes.type === "radio" || l.attributes.type === "checkbox") {
                    if (d.value === l.attributes.xfaOn ? o.setAttribute("checked", !0) : d.value === l.attributes.xfaOff && o.removeAttribute("checked"), h === "print")
                      break;
                    o.addEventListener("change", (w) => {
                      u.setValue(c, {
                        value: w.target.checked ? w.target.getAttribute("xfaOn") : w.target.getAttribute("xfaOff")
                      });
                    });
                  } else {
                    if (d.value !== null && o.setAttribute("value", d.value), h === "print")
                      break;
                    o.addEventListener("input", (w) => {
                      u.setValue(c, {
                        value: w.target.value
                      });
                    });
                  }
                  break;
                case "select":
                  if (d.value !== null) {
                    o.setAttribute("value", d.value);
                    for (const w of l.children)
                      w.attributes.value === d.value ? w.attributes.selected = !0 : w.attributes.hasOwnProperty("selected") && delete w.attributes.selected;
                  }
                  o.addEventListener("input", (w) => {
                    const b = w.target.options, _ = b.selectedIndex === -1 ? "" : b[b.selectedIndex].value;
                    u.setValue(c, {
                      value: _
                    });
                  });
                  break;
              }
            }
            static setAttributes({
              html: o,
              element: c,
              storage: l = null,
              intent: u,
              linkService: h
            }) {
              const {
                attributes: d
              } = c, w = o instanceof HTMLAnchorElement;
              d.type === "radio" && (d.name = `${d.name}-${u}`);
              for (const [b, _] of Object.entries(d))
                if (_ != null)
                  switch (b) {
                    case "class":
                      _.length && o.setAttribute(b, _.join(" "));
                      break;
                    case "dataId":
                      break;
                    case "id":
                      o.setAttribute("data-element-id", _);
                      break;
                    case "style":
                      Object.assign(o.style, _);
                      break;
                    case "textContent":
                      o.textContent = _;
                      break;
                    default:
                      (!w || b !== "href" && b !== "newWindow") && o.setAttribute(b, _);
                  }
              w && h.addLinkAttributes(o, d.href, d.newWindow), l && d.dataId && this.setupStorage(o, d.dataId, c, l);
            }
            static render(o) {
              var R;
              const c = o.annotationStorage, l = o.linkService, u = o.xfaHtml, h = o.intent || "display", d = document.createElement(u.name);
              u.attributes && this.setAttributes({
                html: d,
                element: u,
                intent: h,
                linkService: l
              });
              const w = [[u, -1, d]], b = o.div;
              if (b.append(d), o.viewport) {
                const k = `matrix(${o.viewport.transform.join(",")})`;
                b.style.transform = k;
              }
              h !== "richText" && b.setAttribute("class", "xfaLayer xfaFont");
              const _ = [];
              for (; w.length > 0; ) {
                const [k, C, m] = w.at(-1);
                if (C + 1 === k.children.length) {
                  w.pop();
                  continue;
                }
                const A = k.children[++w.at(-1)[1]];
                if (A === null)
                  continue;
                const {
                  name: F
                } = A;
                if (F === "#text") {
                  const g = document.createTextNode(A.value);
                  _.push(g), m.append(g);
                  continue;
                }
                const f = (R = A == null ? void 0 : A.attributes) != null && R.xmlns ? document.createElementNS(A.attributes.xmlns, F) : document.createElement(F);
                if (m.append(f), A.attributes && this.setAttributes({
                  html: f,
                  element: A,
                  storage: c,
                  intent: h,
                  linkService: l
                }), A.children && A.children.length > 0)
                  w.push([A, -1, f]);
                else if (A.value) {
                  const g = document.createTextNode(A.value);
                  n.XfaText.shouldBuildText(F) && _.push(g), f.append(g);
                }
              }
              for (const k of b.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))
                k.setAttribute("readOnly", !0);
              return {
                textDivs: _
              };
            }
            static update(o) {
              const c = `matrix(${o.viewport.transform.join(",")})`;
              o.div.style.transform = c, o.div.hidden = !1;
            }
          }
          e.XfaLayer = a;
        },
        /* 33 */
        /***/
        (r, e, t) => {
          var u, h, d, w, b, _, R, k, C, m, A, F, f, g, y, Yn, Kn, Zn, Jn, vn, Qn, _n, er, tr, nr, rr, ir, mt, Sn, Nt, Bt, vt, An, zt, B, ar, wn, sr, or, xn, Ht, _t;
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.InkEditor = void 0;
          var n = t(1), a = t(4), s = t(29), o = t(6), c = t(5);
          const we = class we extends a.AnnotationEditor {
            constructor($) {
              super({
                ...$,
                name: "inkEditor"
              });
              de(this, y);
              de(this, u, 0);
              de(this, h, 0);
              de(this, d, this.canvasPointermove.bind(this));
              de(this, w, this.canvasPointerleave.bind(this));
              de(this, b, this.canvasPointerup.bind(this));
              de(this, _, this.canvasPointerdown.bind(this));
              de(this, R, new Path2D());
              de(this, k, !1);
              de(this, C, !1);
              de(this, m, !1);
              de(this, A, null);
              de(this, F, 0);
              de(this, f, 0);
              de(this, g, null);
              this.color = $.color || null, this.thickness = $.thickness || null, this.opacity = $.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.AnnotationEditor.initialize($, {
                strings: ["editor_ink_canvas_aria_label", "editor_ink2_aria_label"]
              });
            }
            static updateDefaultParams($, j) {
              switch ($) {
                case n.AnnotationEditorParamsType.INK_THICKNESS:
                  we._defaultThickness = j;
                  break;
                case n.AnnotationEditorParamsType.INK_COLOR:
                  we._defaultColor = j;
                  break;
                case n.AnnotationEditorParamsType.INK_OPACITY:
                  we._defaultOpacity = j / 100;
                  break;
              }
            }
            updateParams($, j) {
              switch ($) {
                case n.AnnotationEditorParamsType.INK_THICKNESS:
                  te(this, y, Yn).call(this, j);
                  break;
                case n.AnnotationEditorParamsType.INK_COLOR:
                  te(this, y, Kn).call(this, j);
                  break;
                case n.AnnotationEditorParamsType.INK_OPACITY:
                  te(this, y, Zn).call(this, j);
                  break;
              }
            }
            static get defaultPropertiesToUpdate() {
              return [[n.AnnotationEditorParamsType.INK_THICKNESS, we._defaultThickness], [n.AnnotationEditorParamsType.INK_COLOR, we._defaultColor || a.AnnotationEditor._defaultLineColor], [n.AnnotationEditorParamsType.INK_OPACITY, Math.round(we._defaultOpacity * 100)]];
            }
            get propertiesToUpdate() {
              return [[n.AnnotationEditorParamsType.INK_THICKNESS, this.thickness || we._defaultThickness], [n.AnnotationEditorParamsType.INK_COLOR, this.color || we._defaultColor || a.AnnotationEditor._defaultLineColor], [n.AnnotationEditorParamsType.INK_OPACITY, Math.round(100 * (this.opacity ?? we._defaultOpacity))]];
            }
            rebuild() {
              this.parent && (super.rebuild(), this.div !== null && (this.canvas || (te(this, y, Nt).call(this), te(this, y, Bt).call(this)), this.isAttachedToDOM || (this.parent.add(this), te(this, y, vt).call(this)), te(this, y, _t).call(this)));
            }
            remove() {
              this.canvas !== null && (this.isEmpty() || this.commit(), this.canvas.width = this.canvas.height = 0, this.canvas.remove(), this.canvas = null, p(this, A).disconnect(), fe(this, A, null), super.remove());
            }
            setParent($) {
              !this.parent && $ ? this._uiManager.removeShouldRescale(this) : this.parent && $ === null && this._uiManager.addShouldRescale(this), super.setParent($);
            }
            onScaleChanging() {
              const [$, j] = this.parentDimensions, ae = this.width * $, ue = this.height * j;
              this.setDimensions(ae, ue);
            }
            enableEditMode() {
              p(this, k) || this.canvas === null || (super.enableEditMode(), this._isDraggable = !1, this.canvas.addEventListener("pointerdown", p(this, _)));
            }
            disableEditMode() {
              !this.isInEditMode() || this.canvas === null || (super.disableEditMode(), this._isDraggable = !this.isEmpty(), this.div.classList.remove("editing"), this.canvas.removeEventListener("pointerdown", p(this, _)));
            }
            onceAdded() {
              this._isDraggable = !this.isEmpty();
            }
            isEmpty() {
              return this.paths.length === 0 || this.paths.length === 1 && this.paths[0].length === 0;
            }
            commit() {
              p(this, k) || (super.commit(), this.isEditing = !1, this.disableEditMode(), this.setInForeground(), fe(this, k, !0), this.div.classList.add("disabled"), te(this, y, _t).call(this, !0), this.makeResizable(), this.parent.addInkEditorIfNeeded(!0), this.moveInDOM(), this.div.focus({
                preventScroll: !0
              }));
            }
            focusin($) {
              this._focusEventsAllowed && (super.focusin($), this.enableEditMode());
            }
            canvasPointerdown($) {
              $.button !== 0 || !this.isInEditMode() || p(this, k) || (this.setInForeground(), $.preventDefault(), $.type !== "mouse" && this.div.focus(), te(this, y, Qn).call(this, $.offsetX, $.offsetY));
            }
            canvasPointermove($) {
              $.preventDefault(), te(this, y, _n).call(this, $.offsetX, $.offsetY);
            }
            canvasPointerup($) {
              $.preventDefault(), te(this, y, Sn).call(this, $);
            }
            canvasPointerleave($) {
              te(this, y, Sn).call(this, $);
            }
            get isResizable() {
              return !this.isEmpty() && p(this, k);
            }
            render() {
              if (this.div)
                return this.div;
              let $, j;
              this.width && ($ = this.x, j = this.y), super.render(), a.AnnotationEditor._l10nPromise.get("editor_ink2_aria_label").then((ke) => {
                var ie;
                return (ie = this.div) == null ? void 0 : ie.setAttribute("aria-label", ke);
              });
              const [ae, ue, Ae, Te] = te(this, y, Jn).call(this);
              if (this.setAt(ae, ue, 0, 0), this.setDims(Ae, Te), te(this, y, Nt).call(this), this.width) {
                const [ke, ie] = this.parentDimensions;
                this.setAspectRatio(this.width * ke, this.height * ie), this.setAt($ * ke, j * ie, this.width * ke, this.height * ie), fe(this, m, !0), te(this, y, vt).call(this), this.setDims(this.width * ke, this.height * ie), te(this, y, mt).call(this), this.div.classList.add("disabled");
              } else
                this.div.classList.add("editing"), this.enableEditMode();
              return te(this, y, Bt).call(this), this.div;
            }
            setDimensions($, j) {
              const ae = Math.round($), ue = Math.round(j);
              if (p(this, F) === ae && p(this, f) === ue)
                return;
              fe(this, F, ae), fe(this, f, ue), this.canvas.style.visibility = "hidden";
              const [Ae, Te] = this.parentDimensions;
              this.width = $ / Ae, this.height = j / Te, this.fixAndSetPosition(), p(this, k) && te(this, y, An).call(this, $, j), te(this, y, vt).call(this), te(this, y, mt).call(this), this.canvas.style.visibility = "visible", this.fixDims();
            }
            static deserialize($, j, ae) {
              var Ge, Qe, nt;
              if ($ instanceof s.InkAnnotationElement)
                return null;
              const ue = super.deserialize($, j, ae);
              ue.thickness = $.thickness, ue.color = n.Util.makeHexColor(...$.color), ue.opacity = $.opacity;
              const [Ae, Te] = ue.pageDimensions, ke = ue.width * Ae, ie = ue.height * Te, Fe = ue.parentScale, De = $.thickness / 2;
              fe(ue, k, !0), fe(ue, F, Math.round(ke)), fe(ue, f, Math.round(ie));
              const {
                paths: Xe,
                rect: je,
                rotation: tt
              } = $;
              for (let {
                bezier: xe
              } of Xe) {
                xe = te(Ge = we, B, sr).call(Ge, xe, je, tt);
                const he = [];
                ue.paths.push(he);
                let me = Fe * (xe[0] - De), Ie = Fe * (xe[1] - De);
                for (let et = 2, V = xe.length; et < V; et += 6) {
                  const ye = Fe * (xe[et] - De), Me = Fe * (xe[et + 1] - De), qe = Fe * (xe[et + 2] - De), Ue = Fe * (xe[et + 3] - De), Le = Fe * (xe[et + 4] - De), W = Fe * (xe[et + 5] - De);
                  he.push([[me, Ie], [ye, Me], [qe, Ue], [Le, W]]), me = Le, Ie = W;
                }
                const Ze = te(this, B, ar).call(this, he);
                ue.bezierPath2D.push(Ze);
              }
              const $e = te(Qe = ue, y, xn).call(Qe);
              return fe(ue, h, Math.max(a.AnnotationEditor.MIN_SIZE, $e[2] - $e[0])), fe(ue, u, Math.max(a.AnnotationEditor.MIN_SIZE, $e[3] - $e[1])), te(nt = ue, y, An).call(nt, ke, ie), ue;
            }
            serialize() {
              if (this.isEmpty())
                return null;
              const $ = this.getRect(0, 0), j = a.AnnotationEditor._colorManager.convert(this.ctx.strokeStyle);
              return {
                annotationType: n.AnnotationEditorType.INK,
                color: j,
                thickness: this.thickness,
                opacity: this.opacity,
                paths: te(this, y, or).call(this, this.scaleFactor / this.parentScale, this.translationX, this.translationY, $),
                pageIndex: this.pageIndex,
                rect: $,
                rotation: this.rotation,
                structTreeParentId: this._structTreeParentId
              };
            }
          };
          u = new WeakMap(), h = new WeakMap(), d = new WeakMap(), w = new WeakMap(), b = new WeakMap(), _ = new WeakMap(), R = new WeakMap(), k = new WeakMap(), C = new WeakMap(), m = new WeakMap(), A = new WeakMap(), F = new WeakMap(), f = new WeakMap(), g = new WeakMap(), y = new WeakSet(), Yn = function($) {
            const j = this.thickness;
            this.addCommands({
              cmd: () => {
                this.thickness = $, te(this, y, _t).call(this);
              },
              undo: () => {
                this.thickness = j, te(this, y, _t).call(this);
              },
              mustExec: !0,
              type: n.AnnotationEditorParamsType.INK_THICKNESS,
              overwriteIfSameType: !0,
              keepUndo: !0
            });
          }, Kn = function($) {
            const j = this.color;
            this.addCommands({
              cmd: () => {
                this.color = $, te(this, y, mt).call(this);
              },
              undo: () => {
                this.color = j, te(this, y, mt).call(this);
              },
              mustExec: !0,
              type: n.AnnotationEditorParamsType.INK_COLOR,
              overwriteIfSameType: !0,
              keepUndo: !0
            });
          }, Zn = function($) {
            $ /= 100;
            const j = this.opacity;
            this.addCommands({
              cmd: () => {
                this.opacity = $, te(this, y, mt).call(this);
              },
              undo: () => {
                this.opacity = j, te(this, y, mt).call(this);
              },
              mustExec: !0,
              type: n.AnnotationEditorParamsType.INK_OPACITY,
              overwriteIfSameType: !0,
              keepUndo: !0
            });
          }, Jn = function() {
            const {
              parentRotation: $,
              parentDimensions: [j, ae]
            } = this;
            switch ($) {
              case 90:
                return [0, ae, ae, j];
              case 180:
                return [j, ae, j, ae];
              case 270:
                return [j, 0, ae, j];
              default:
                return [0, 0, j, ae];
            }
          }, vn = function() {
            const {
              ctx: $,
              color: j,
              opacity: ae,
              thickness: ue,
              parentScale: Ae,
              scaleFactor: Te
            } = this;
            $.lineWidth = ue * Ae / Te, $.lineCap = "round", $.lineJoin = "round", $.miterLimit = 10, $.strokeStyle = `${j}${(0, c.opacityToHex)(ae)}`;
          }, Qn = function($, j) {
            this.canvas.addEventListener("contextmenu", o.noContextMenu), this.canvas.addEventListener("pointerleave", p(this, w)), this.canvas.addEventListener("pointermove", p(this, d)), this.canvas.addEventListener("pointerup", p(this, b)), this.canvas.removeEventListener("pointerdown", p(this, _)), this.isEditing = !0, p(this, m) || (fe(this, m, !0), te(this, y, vt).call(this), this.thickness || (this.thickness = we._defaultThickness), this.color || (this.color = we._defaultColor || a.AnnotationEditor._defaultLineColor), this.opacity ?? (this.opacity = we._defaultOpacity)), this.currentPath.push([$, j]), fe(this, C, !1), te(this, y, vn).call(this), fe(this, g, () => {
              te(this, y, nr).call(this), p(this, g) && window.requestAnimationFrame(p(this, g));
            }), window.requestAnimationFrame(p(this, g));
          }, _n = function($, j) {
            const [ae, ue] = this.currentPath.at(-1);
            if (this.currentPath.length > 1 && $ === ae && j === ue)
              return;
            const Ae = this.currentPath;
            let Te = p(this, R);
            if (Ae.push([$, j]), fe(this, C, !0), Ae.length <= 2) {
              Te.moveTo(...Ae[0]), Te.lineTo($, j);
              return;
            }
            Ae.length === 3 && (fe(this, R, Te = new Path2D()), Te.moveTo(...Ae[0])), te(this, y, rr).call(this, Te, ...Ae.at(-3), ...Ae.at(-2), $, j);
          }, er = function() {
            if (this.currentPath.length === 0)
              return;
            const $ = this.currentPath.at(-1);
            p(this, R).lineTo(...$);
          }, tr = function($, j) {
            fe(this, g, null), $ = Math.min(Math.max($, 0), this.canvas.width), j = Math.min(Math.max(j, 0), this.canvas.height), te(this, y, _n).call(this, $, j), te(this, y, er).call(this);
            let ae;
            if (this.currentPath.length !== 1)
              ae = te(this, y, ir).call(this);
            else {
              const ie = [$, j];
              ae = [[ie, ie.slice(), ie.slice(), ie]];
            }
            const ue = p(this, R), Ae = this.currentPath;
            this.currentPath = [], fe(this, R, new Path2D());
            const Te = () => {
              this.allRawPaths.push(Ae), this.paths.push(ae), this.bezierPath2D.push(ue), this.rebuild();
            }, ke = () => {
              this.allRawPaths.pop(), this.paths.pop(), this.bezierPath2D.pop(), this.paths.length === 0 ? this.remove() : (this.canvas || (te(this, y, Nt).call(this), te(this, y, Bt).call(this)), te(this, y, _t).call(this));
            };
            this.addCommands({
              cmd: Te,
              undo: ke,
              mustExec: !0
            });
          }, nr = function() {
            if (!p(this, C))
              return;
            fe(this, C, !1);
            const $ = Math.ceil(this.thickness * this.parentScale), j = this.currentPath.slice(-3), ae = j.map((Te) => Te[0]), ue = j.map((Te) => Te[1]);
            Math.min(...ae) - $, Math.max(...ae) + $, Math.min(...ue) - $, Math.max(...ue) + $;
            const {
              ctx: Ae
            } = this;
            Ae.save(), Ae.clearRect(0, 0, this.canvas.width, this.canvas.height);
            for (const Te of this.bezierPath2D)
              Ae.stroke(Te);
            Ae.stroke(p(this, R)), Ae.restore();
          }, rr = function($, j, ae, ue, Ae, Te, ke) {
            const ie = (j + ue) / 2, Fe = (ae + Ae) / 2, De = (ue + Te) / 2, Xe = (Ae + ke) / 2;
            $.bezierCurveTo(ie + 2 * (ue - ie) / 3, Fe + 2 * (Ae - Fe) / 3, De + 2 * (ue - De) / 3, Xe + 2 * (Ae - Xe) / 3, De, Xe);
          }, ir = function() {
            const $ = this.currentPath;
            if ($.length <= 2)
              return [[$[0], $[0], $.at(-1), $.at(-1)]];
            const j = [];
            let ae, [ue, Ae] = $[0];
            for (ae = 1; ae < $.length - 2; ae++) {
              const [je, tt] = $[ae], [$e, Ge] = $[ae + 1], Qe = (je + $e) / 2, nt = (tt + Ge) / 2, xe = [ue + 2 * (je - ue) / 3, Ae + 2 * (tt - Ae) / 3], he = [Qe + 2 * (je - Qe) / 3, nt + 2 * (tt - nt) / 3];
              j.push([[ue, Ae], xe, he, [Qe, nt]]), [ue, Ae] = [Qe, nt];
            }
            const [Te, ke] = $[ae], [ie, Fe] = $[ae + 1], De = [ue + 2 * (Te - ue) / 3, Ae + 2 * (ke - Ae) / 3], Xe = [ie + 2 * (Te - ie) / 3, Fe + 2 * (ke - Fe) / 3];
            return j.push([[ue, Ae], De, Xe, [ie, Fe]]), j;
          }, mt = function() {
            if (this.isEmpty()) {
              te(this, y, zt).call(this);
              return;
            }
            te(this, y, vn).call(this);
            const {
              canvas: $,
              ctx: j
            } = this;
            j.setTransform(1, 0, 0, 1, 0, 0), j.clearRect(0, 0, $.width, $.height), te(this, y, zt).call(this);
            for (const ae of this.bezierPath2D)
              j.stroke(ae);
          }, Sn = function($) {
            this.canvas.removeEventListener("pointerleave", p(this, w)), this.canvas.removeEventListener("pointermove", p(this, d)), this.canvas.removeEventListener("pointerup", p(this, b)), this.canvas.addEventListener("pointerdown", p(this, _)), setTimeout(() => {
              this.canvas.removeEventListener("contextmenu", o.noContextMenu);
            }, 10), te(this, y, tr).call(this, $.offsetX, $.offsetY), this.addToAnnotationStorage(), this.setInBackground();
          }, Nt = function() {
            this.canvas = document.createElement("canvas"), this.canvas.width = this.canvas.height = 0, this.canvas.className = "inkEditorCanvas", a.AnnotationEditor._l10nPromise.get("editor_ink_canvas_aria_label").then(($) => {
              var j;
              return (j = this.canvas) == null ? void 0 : j.setAttribute("aria-label", $);
            }), this.div.append(this.canvas), this.ctx = this.canvas.getContext("2d");
          }, Bt = function() {
            fe(this, A, new ResizeObserver(($) => {
              const j = $[0].contentRect;
              j.width && j.height && this.setDimensions(j.width, j.height);
            })), p(this, A).observe(this.div);
          }, vt = function() {
            if (!p(this, m))
              return;
            const [$, j] = this.parentDimensions;
            this.canvas.width = Math.ceil(this.width * $), this.canvas.height = Math.ceil(this.height * j), te(this, y, zt).call(this);
          }, An = function($, j) {
            const ae = te(this, y, Ht).call(this), ue = ($ - ae) / p(this, h), Ae = (j - ae) / p(this, u);
            this.scaleFactor = Math.min(ue, Ae);
          }, zt = function() {
            const $ = te(this, y, Ht).call(this) / 2;
            this.ctx.setTransform(this.scaleFactor, 0, 0, this.scaleFactor, this.translationX * this.scaleFactor + $, this.translationY * this.scaleFactor + $);
          }, B = new WeakSet(), ar = function($) {
            const j = new Path2D();
            for (let ae = 0, ue = $.length; ae < ue; ae++) {
              const [Ae, Te, ke, ie] = $[ae];
              ae === 0 && j.moveTo(...Ae), j.bezierCurveTo(Te[0], Te[1], ke[0], ke[1], ie[0], ie[1]);
            }
            return j;
          }, wn = function($, j, ae) {
            const [ue, Ae, Te, ke] = j;
            switch (ae) {
              case 0:
                for (let ie = 0, Fe = $.length; ie < Fe; ie += 2)
                  $[ie] += ue, $[ie + 1] = ke - $[ie + 1];
                break;
              case 90:
                for (let ie = 0, Fe = $.length; ie < Fe; ie += 2) {
                  const De = $[ie];
                  $[ie] = $[ie + 1] + ue, $[ie + 1] = De + Ae;
                }
                break;
              case 180:
                for (let ie = 0, Fe = $.length; ie < Fe; ie += 2)
                  $[ie] = Te - $[ie], $[ie + 1] += Ae;
                break;
              case 270:
                for (let ie = 0, Fe = $.length; ie < Fe; ie += 2) {
                  const De = $[ie];
                  $[ie] = Te - $[ie + 1], $[ie + 1] = ke - De;
                }
                break;
              default:
                throw new Error("Invalid rotation");
            }
            return $;
          }, sr = function($, j, ae) {
            const [ue, Ae, Te, ke] = j;
            switch (ae) {
              case 0:
                for (let ie = 0, Fe = $.length; ie < Fe; ie += 2)
                  $[ie] -= ue, $[ie + 1] = ke - $[ie + 1];
                break;
              case 90:
                for (let ie = 0, Fe = $.length; ie < Fe; ie += 2) {
                  const De = $[ie];
                  $[ie] = $[ie + 1] - Ae, $[ie + 1] = De - ue;
                }
                break;
              case 180:
                for (let ie = 0, Fe = $.length; ie < Fe; ie += 2)
                  $[ie] = Te - $[ie], $[ie + 1] -= Ae;
                break;
              case 270:
                for (let ie = 0, Fe = $.length; ie < Fe; ie += 2) {
                  const De = $[ie];
                  $[ie] = ke - $[ie + 1], $[ie + 1] = Te - De;
                }
                break;
              default:
                throw new Error("Invalid rotation");
            }
            return $;
          }, or = function($, j, ae, ue) {
            var Fe, De;
            const Ae = [], Te = this.thickness / 2, ke = $ * j + Te, ie = $ * ae + Te;
            for (const Xe of this.paths) {
              const je = [], tt = [];
              for (let $e = 0, Ge = Xe.length; $e < Ge; $e++) {
                const [Qe, nt, xe, he] = Xe[$e], me = $ * Qe[0] + ke, Ie = $ * Qe[1] + ie, Ze = $ * nt[0] + ke, et = $ * nt[1] + ie, V = $ * xe[0] + ke, ye = $ * xe[1] + ie, Me = $ * he[0] + ke, qe = $ * he[1] + ie;
                $e === 0 && (je.push(me, Ie), tt.push(me, Ie)), je.push(Ze, et, V, ye, Me, qe), tt.push(Ze, et), $e === Ge - 1 && tt.push(Me, qe);
              }
              Ae.push({
                bezier: te(Fe = we, B, wn).call(Fe, je, ue, this.rotation),
                points: te(De = we, B, wn).call(De, tt, ue, this.rotation)
              });
            }
            return Ae;
          }, xn = function() {
            let $ = 1 / 0, j = -1 / 0, ae = 1 / 0, ue = -1 / 0;
            for (const Ae of this.paths)
              for (const [Te, ke, ie, Fe] of Ae) {
                const De = n.Util.bezierBoundingBox(...Te, ...ke, ...ie, ...Fe);
                $ = Math.min($, De[0]), ae = Math.min(ae, De[1]), j = Math.max(j, De[2]), ue = Math.max(ue, De[3]);
              }
            return [$, ae, j, ue];
          }, Ht = function() {
            return p(this, k) ? Math.ceil(this.thickness * this.parentScale) : 0;
          }, _t = function($ = !1) {
            if (this.isEmpty())
              return;
            if (!p(this, k)) {
              te(this, y, mt).call(this);
              return;
            }
            const j = te(this, y, xn).call(this), ae = te(this, y, Ht).call(this);
            fe(this, h, Math.max(a.AnnotationEditor.MIN_SIZE, j[2] - j[0])), fe(this, u, Math.max(a.AnnotationEditor.MIN_SIZE, j[3] - j[1]));
            const ue = Math.ceil(ae + p(this, h) * this.scaleFactor), Ae = Math.ceil(ae + p(this, u) * this.scaleFactor), [Te, ke] = this.parentDimensions;
            this.width = ue / Te, this.height = Ae / ke, this.setAspectRatio(ue, Ae);
            const ie = this.translationX, Fe = this.translationY;
            this.translationX = -j[0], this.translationY = -j[1], te(this, y, vt).call(this), te(this, y, mt).call(this), fe(this, F, ue), fe(this, f, Ae), this.setDims(ue, Ae);
            const De = $ ? ae / this.scaleFactor / 2 : 0;
            this.translate(ie - this.translationX - De, Fe - this.translationY - De);
          }, de(we, B), Ke(we, "_defaultColor", null), Ke(we, "_defaultOpacity", 1), Ke(we, "_defaultThickness", 1), Ke(we, "_type", "ink");
          let l = we;
          e.InkEditor = l;
        },
        /* 34 */
        /***/
        (r, e, t) => {
          var l, u, h, d, w, b, _, R, k, C, m, Ct, Dt, qt, kn, lr, cr, En, Ut, ur;
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.StampEditor = void 0;
          var n = t(1), a = t(4), s = t(6), o = t(29);
          const I = class I extends a.AnnotationEditor {
            constructor(X) {
              super({
                ...X,
                name: "stampEditor"
              });
              de(this, m);
              de(this, l, null);
              de(this, u, null);
              de(this, h, null);
              de(this, d, null);
              de(this, w, null);
              de(this, b, null);
              de(this, _, null);
              de(this, R, null);
              de(this, k, !1);
              de(this, C, !1);
              fe(this, d, X.bitmapUrl), fe(this, w, X.bitmapFile);
            }
            static initialize(X) {
              a.AnnotationEditor.initialize(X);
            }
            static get supportedTypes() {
              const X = ["apng", "avif", "bmp", "gif", "jpeg", "png", "svg+xml", "webp", "x-icon"];
              return (0, n.shadow)(this, "supportedTypes", X.map((ee) => `image/${ee}`));
            }
            static get supportedTypesStr() {
              return (0, n.shadow)(this, "supportedTypesStr", this.supportedTypes.join(","));
            }
            static isHandlingMimeForPasting(X) {
              return this.supportedTypes.includes(X);
            }
            static paste(X, ee) {
              ee.pasteEditor(n.AnnotationEditorType.STAMP, {
                bitmapFile: X.getAsFile()
              });
            }
            remove() {
              var X, ee;
              p(this, u) && (fe(this, l, null), this._uiManager.imageManager.deleteId(p(this, u)), (X = p(this, b)) == null || X.remove(), fe(this, b, null), (ee = p(this, _)) == null || ee.disconnect(), fe(this, _, null)), super.remove();
            }
            rebuild() {
              if (!this.parent) {
                p(this, u) && te(this, m, qt).call(this);
                return;
              }
              super.rebuild(), this.div !== null && (p(this, u) && te(this, m, qt).call(this), this.isAttachedToDOM || this.parent.add(this));
            }
            onceAdded() {
              this._isDraggable = !0, this.div.focus();
            }
            isEmpty() {
              return !(p(this, h) || p(this, l) || p(this, d) || p(this, w));
            }
            get isResizable() {
              return !0;
            }
            render() {
              if (this.div)
                return this.div;
              let X, ee;
              if (this.width && (X = this.x, ee = this.y), super.render(), this.div.hidden = !0, p(this, l) ? te(this, m, kn).call(this) : te(this, m, qt).call(this), this.width) {
                const [K, se] = this.parentDimensions;
                this.setAt(X * K, ee * se, this.width * K, this.height * se);
              }
              return this.div;
            }
            static deserialize(X, ee, K) {
              if (X instanceof o.StampAnnotationElement)
                return null;
              const se = super.deserialize(X, ee, K), {
                rect: q,
                bitmapUrl: Y,
                bitmapId: J,
                isSvg: N,
                accessibilityData: M
              } = X;
              J && K.imageManager.isValidId(J) ? fe(se, u, J) : fe(se, d, Y), fe(se, k, N);
              const [v, L] = se.pageDimensions;
              return se.width = (q[2] - q[0]) / v, se.height = (q[3] - q[1]) / L, M && (se.altTextData = M), se;
            }
            serialize(X = !1, ee = null) {
              if (this.isEmpty())
                return null;
              const K = {
                annotationType: n.AnnotationEditorType.STAMP,
                bitmapId: p(this, u),
                pageIndex: this.pageIndex,
                rect: this.getRect(0, 0),
                rotation: this.rotation,
                isSvg: p(this, k),
                structTreeParentId: this._structTreeParentId
              };
              if (X)
                return K.bitmapUrl = te(this, m, Ut).call(this, !0), K.accessibilityData = this.altTextData, K;
              const {
                decorative: se,
                altText: q
              } = this.altTextData;
              if (!se && q && (K.accessibilityData = {
                type: "Figure",
                alt: q
              }), ee === null)
                return K;
              ee.stamps || (ee.stamps = /* @__PURE__ */ new Map());
              const Y = p(this, k) ? (K.rect[2] - K.rect[0]) * (K.rect[3] - K.rect[1]) : null;
              if (!ee.stamps.has(p(this, u)))
                ee.stamps.set(p(this, u), {
                  area: Y,
                  serialized: K
                }), K.bitmap = te(this, m, Ut).call(this, !1);
              else if (p(this, k)) {
                const J = ee.stamps.get(p(this, u));
                Y > J.area && (J.area = Y, J.serialized.bitmap.close(), J.serialized.bitmap = te(this, m, Ut).call(this, !1));
              }
              return K;
            }
          };
          l = new WeakMap(), u = new WeakMap(), h = new WeakMap(), d = new WeakMap(), w = new WeakMap(), b = new WeakMap(), _ = new WeakMap(), R = new WeakMap(), k = new WeakMap(), C = new WeakMap(), m = new WeakSet(), Ct = function(X, ee = !1) {
            if (!X) {
              this.remove();
              return;
            }
            fe(this, l, X.bitmap), ee || (fe(this, u, X.id), fe(this, k, X.isSvg)), te(this, m, kn).call(this);
          }, Dt = function() {
            fe(this, h, null), this._uiManager.enableWaiting(!1), p(this, b) && this.div.focus();
          }, qt = function() {
            if (p(this, u)) {
              this._uiManager.enableWaiting(!0), this._uiManager.imageManager.getFromId(p(this, u)).then((ee) => te(this, m, Ct).call(this, ee, !0)).finally(() => te(this, m, Dt).call(this));
              return;
            }
            if (p(this, d)) {
              const ee = p(this, d);
              fe(this, d, null), this._uiManager.enableWaiting(!0), fe(this, h, this._uiManager.imageManager.getFromUrl(ee).then((K) => te(this, m, Ct).call(this, K)).finally(() => te(this, m, Dt).call(this)));
              return;
            }
            if (p(this, w)) {
              const ee = p(this, w);
              fe(this, w, null), this._uiManager.enableWaiting(!0), fe(this, h, this._uiManager.imageManager.getFromFile(ee).then((K) => te(this, m, Ct).call(this, K)).finally(() => te(this, m, Dt).call(this)));
              return;
            }
            const X = document.createElement("input");
            X.type = "file", X.accept = I.supportedTypesStr, fe(this, h, new Promise((ee) => {
              X.addEventListener("change", async () => {
                if (!X.files || X.files.length === 0)
                  this.remove();
                else {
                  this._uiManager.enableWaiting(!0);
                  const K = await this._uiManager.imageManager.getFromFile(X.files[0]);
                  te(this, m, Ct).call(this, K);
                }
                ee();
              }), X.addEventListener("cancel", () => {
                this.remove(), ee();
              });
            }).finally(() => te(this, m, Dt).call(this))), X.click();
          }, kn = function() {
            const {
              div: X
            } = this;
            let {
              width: ee,
              height: K
            } = p(this, l);
            const [se, q] = this.pageDimensions, Y = 0.75;
            if (this.width)
              ee = this.width * se, K = this.height * q;
            else if (ee > Y * se || K > Y * q) {
              const v = Math.min(Y * se / ee, Y * q / K);
              ee *= v, K *= v;
            }
            const [J, N] = this.parentDimensions;
            this.setDims(ee * J / se, K * N / q), this._uiManager.enableWaiting(!1);
            const M = fe(this, b, document.createElement("canvas"));
            X.append(M), X.hidden = !1, te(this, m, En).call(this, ee, K), te(this, m, ur).call(this), p(this, C) || (this.parent.addUndoableEditor(this), fe(this, C, !0)), this._uiManager._eventBus.dispatch("reporttelemetry", {
              source: this,
              details: {
                type: "editing",
                subtype: this.editorType,
                data: {
                  action: "inserted_image"
                }
              }
            }), this.addAltTextButton();
          }, lr = function(X, ee) {
            var Y;
            const [K, se] = this.parentDimensions;
            this.width = X / K, this.height = ee / se, this.setDims(X, ee), (Y = this._initialOptions) != null && Y.isCentered ? this.center() : this.fixAndSetPosition(), this._initialOptions = null, p(this, R) !== null && clearTimeout(p(this, R)), fe(this, R, setTimeout(() => {
              fe(this, R, null), te(this, m, En).call(this, X, ee);
            }, 200));
          }, cr = function(X, ee) {
            const {
              width: K,
              height: se
            } = p(this, l);
            let q = K, Y = se, J = p(this, l);
            for (; q > 2 * X || Y > 2 * ee; ) {
              const N = q, M = Y;
              q > 2 * X && (q = q >= 16384 ? Math.floor(q / 2) - 1 : Math.ceil(q / 2)), Y > 2 * ee && (Y = Y >= 16384 ? Math.floor(Y / 2) - 1 : Math.ceil(Y / 2));
              const v = new OffscreenCanvas(q, Y);
              v.getContext("2d").drawImage(J, 0, 0, N, M, 0, 0, q, Y), J = v.transferToImageBitmap();
            }
            return J;
          }, En = function(X, ee) {
            X = Math.ceil(X), ee = Math.ceil(ee);
            const K = p(this, b);
            if (!K || K.width === X && K.height === ee)
              return;
            K.width = X, K.height = ee;
            const se = p(this, k) ? p(this, l) : te(this, m, cr).call(this, X, ee), q = K.getContext("2d");
            q.filter = this._uiManager.hcmFilter, q.drawImage(se, 0, 0, se.width, se.height, 0, 0, X, ee);
          }, Ut = function(X) {
            if (X) {
              if (p(this, k)) {
                const se = this._uiManager.imageManager.getSvgUrl(p(this, u));
                if (se)
                  return se;
              }
              const ee = document.createElement("canvas");
              return {
                width: ee.width,
                height: ee.height
              } = p(this, l), ee.getContext("2d").drawImage(p(this, l), 0, 0), ee.toDataURL();
            }
            if (p(this, k)) {
              const [ee, K] = this.pageDimensions, se = Math.round(this.width * ee * s.PixelsPerInch.PDF_TO_CSS_UNITS), q = Math.round(this.height * K * s.PixelsPerInch.PDF_TO_CSS_UNITS), Y = new OffscreenCanvas(se, q);
              return Y.getContext("2d").drawImage(p(this, l), 0, 0, p(this, l).width, p(this, l).height, 0, 0, se, q), Y.transferToImageBitmap();
            }
            return structuredClone(p(this, l));
          }, ur = function() {
            fe(this, _, new ResizeObserver((X) => {
              const ee = X[0].contentRect;
              ee.width && ee.height && te(this, m, lr).call(this, ee.width, ee.height);
            })), p(this, _).observe(this.div);
          }, Ke(I, "_type", "stamp");
          let c = I;
          e.StampEditor = c;
        }
        /******/
      ], __webpack_module_cache__ = {};
      function __w_pdfjs_require__(r) {
        var e = __webpack_module_cache__[r];
        if (e !== void 0)
          return e.exports;
        var t = __webpack_module_cache__[r] = {
          /******/
          // no module.id needed
          /******/
          // no module.loaded needed
          /******/
          exports: {}
          /******/
        };
        return __webpack_modules__[r](t, t.exports, __w_pdfjs_require__), t.exports;
      }
      var __webpack_exports__ = {};
      return (() => {
        var r = __webpack_exports__;
        Object.defineProperty(r, "__esModule", {
          value: !0
        }), Object.defineProperty(r, "AbortException", {
          enumerable: !0,
          get: function() {
            return e.AbortException;
          }
        }), Object.defineProperty(r, "AnnotationEditorLayer", {
          enumerable: !0,
          get: function() {
            return s.AnnotationEditorLayer;
          }
        }), Object.defineProperty(r, "AnnotationEditorParamsType", {
          enumerable: !0,
          get: function() {
            return e.AnnotationEditorParamsType;
          }
        }), Object.defineProperty(r, "AnnotationEditorType", {
          enumerable: !0,
          get: function() {
            return e.AnnotationEditorType;
          }
        }), Object.defineProperty(r, "AnnotationEditorUIManager", {
          enumerable: !0,
          get: function() {
            return o.AnnotationEditorUIManager;
          }
        }), Object.defineProperty(r, "AnnotationLayer", {
          enumerable: !0,
          get: function() {
            return c.AnnotationLayer;
          }
        }), Object.defineProperty(r, "AnnotationMode", {
          enumerable: !0,
          get: function() {
            return e.AnnotationMode;
          }
        }), Object.defineProperty(r, "CMapCompressionType", {
          enumerable: !0,
          get: function() {
            return e.CMapCompressionType;
          }
        }), Object.defineProperty(r, "DOMSVGFactory", {
          enumerable: !0,
          get: function() {
            return n.DOMSVGFactory;
          }
        }), Object.defineProperty(r, "FeatureTest", {
          enumerable: !0,
          get: function() {
            return e.FeatureTest;
          }
        }), Object.defineProperty(r, "GlobalWorkerOptions", {
          enumerable: !0,
          get: function() {
            return l.GlobalWorkerOptions;
          }
        }), Object.defineProperty(r, "ImageKind", {
          enumerable: !0,
          get: function() {
            return e.ImageKind;
          }
        }), Object.defineProperty(r, "InvalidPDFException", {
          enumerable: !0,
          get: function() {
            return e.InvalidPDFException;
          }
        }), Object.defineProperty(r, "MissingPDFException", {
          enumerable: !0,
          get: function() {
            return e.MissingPDFException;
          }
        }), Object.defineProperty(r, "OPS", {
          enumerable: !0,
          get: function() {
            return e.OPS;
          }
        }), Object.defineProperty(r, "PDFDataRangeTransport", {
          enumerable: !0,
          get: function() {
            return t.PDFDataRangeTransport;
          }
        }), Object.defineProperty(r, "PDFDateString", {
          enumerable: !0,
          get: function() {
            return n.PDFDateString;
          }
        }), Object.defineProperty(r, "PDFWorker", {
          enumerable: !0,
          get: function() {
            return t.PDFWorker;
          }
        }), Object.defineProperty(r, "PasswordResponses", {
          enumerable: !0,
          get: function() {
            return e.PasswordResponses;
          }
        }), Object.defineProperty(r, "PermissionFlag", {
          enumerable: !0,
          get: function() {
            return e.PermissionFlag;
          }
        }), Object.defineProperty(r, "PixelsPerInch", {
          enumerable: !0,
          get: function() {
            return n.PixelsPerInch;
          }
        }), Object.defineProperty(r, "PromiseCapability", {
          enumerable: !0,
          get: function() {
            return e.PromiseCapability;
          }
        }), Object.defineProperty(r, "RenderingCancelledException", {
          enumerable: !0,
          get: function() {
            return n.RenderingCancelledException;
          }
        }), Object.defineProperty(r, "SVGGraphics", {
          enumerable: !0,
          get: function() {
            return t.SVGGraphics;
          }
        }), Object.defineProperty(r, "UnexpectedResponseException", {
          enumerable: !0,
          get: function() {
            return e.UnexpectedResponseException;
          }
        }), Object.defineProperty(r, "Util", {
          enumerable: !0,
          get: function() {
            return e.Util;
          }
        }), Object.defineProperty(r, "VerbosityLevel", {
          enumerable: !0,
          get: function() {
            return e.VerbosityLevel;
          }
        }), Object.defineProperty(r, "XfaLayer", {
          enumerable: !0,
          get: function() {
            return u.XfaLayer;
          }
        }), Object.defineProperty(r, "build", {
          enumerable: !0,
          get: function() {
            return t.build;
          }
        }), Object.defineProperty(r, "createValidAbsoluteUrl", {
          enumerable: !0,
          get: function() {
            return e.createValidAbsoluteUrl;
          }
        }), Object.defineProperty(r, "getDocument", {
          enumerable: !0,
          get: function() {
            return t.getDocument;
          }
        }), Object.defineProperty(r, "getFilenameFromUrl", {
          enumerable: !0,
          get: function() {
            return n.getFilenameFromUrl;
          }
        }), Object.defineProperty(r, "getPdfFilenameFromUrl", {
          enumerable: !0,
          get: function() {
            return n.getPdfFilenameFromUrl;
          }
        }), Object.defineProperty(r, "getXfaPageViewport", {
          enumerable: !0,
          get: function() {
            return n.getXfaPageViewport;
          }
        }), Object.defineProperty(r, "isDataScheme", {
          enumerable: !0,
          get: function() {
            return n.isDataScheme;
          }
        }), Object.defineProperty(r, "isPdfFile", {
          enumerable: !0,
          get: function() {
            return n.isPdfFile;
          }
        }), Object.defineProperty(r, "loadScript", {
          enumerable: !0,
          get: function() {
            return n.loadScript;
          }
        }), Object.defineProperty(r, "noContextMenu", {
          enumerable: !0,
          get: function() {
            return n.noContextMenu;
          }
        }), Object.defineProperty(r, "normalizeUnicode", {
          enumerable: !0,
          get: function() {
            return e.normalizeUnicode;
          }
        }), Object.defineProperty(r, "renderTextLayer", {
          enumerable: !0,
          get: function() {
            return a.renderTextLayer;
          }
        }), Object.defineProperty(r, "setLayerDimensions", {
          enumerable: !0,
          get: function() {
            return n.setLayerDimensions;
          }
        }), Object.defineProperty(r, "shadow", {
          enumerable: !0,
          get: function() {
            return e.shadow;
          }
        }), Object.defineProperty(r, "updateTextLayer", {
          enumerable: !0,
          get: function() {
            return a.updateTextLayer;
          }
        }), Object.defineProperty(r, "version", {
          enumerable: !0,
          get: function() {
            return t.version;
          }
        });
        var e = __w_pdfjs_require__(1), t = __w_pdfjs_require__(2), n = __w_pdfjs_require__(6), a = __w_pdfjs_require__(26), s = __w_pdfjs_require__(27), o = __w_pdfjs_require__(5), c = __w_pdfjs_require__(29), l = __w_pdfjs_require__(14), u = __w_pdfjs_require__(32);
      })(), __webpack_exports__;
    })()
  ));
})(pdf);
var pdfExports = pdf.exports;
function pretty_si(r) {
  let e = ["", "k", "M", "G", "T", "P", "E", "Z"], t = 0;
  for (; r > 1e3 && t < e.length - 1; )
    r /= 1e3, t++;
  let n = e[t];
  return (Number.isInteger(r) ? r : r.toFixed(1)) + n;
}
const {
  SvelteComponent: SvelteComponent$2,
  append: append$2,
  attr: attr$2,
  component_subscribe,
  detach: detach$2,
  element: element$2,
  init: init$2,
  insert: insert$2,
  noop: noop$2,
  safe_not_equal: safe_not_equal$2,
  set_style: set_style$2,
  svg_element,
  toggle_class: toggle_class$1
} = window.__gradio__svelte__internal, { onMount } = window.__gradio__svelte__internal;
function create_fragment$2(r) {
  let e, t, n, a, s, o, c, l, u, h, d, w;
  return {
    c() {
      e = element$2("div"), t = svg_element("svg"), n = svg_element("g"), a = svg_element("path"), s = svg_element("path"), o = svg_element("path"), c = svg_element("path"), l = svg_element("g"), u = svg_element("path"), h = svg_element("path"), d = svg_element("path"), w = svg_element("path"), attr$2(a, "d", "M255.926 0.754768L509.702 139.936V221.027L255.926 81.8465V0.754768Z"), attr$2(a, "fill", "#FF7C00"), attr$2(a, "fill-opacity", "0.4"), attr$2(a, "class", "svelte-43sxxs"), attr$2(s, "d", "M509.69 139.936L254.981 279.641V361.255L509.69 221.55V139.936Z"), attr$2(s, "fill", "#FF7C00"), attr$2(s, "class", "svelte-43sxxs"), attr$2(o, "d", "M0.250138 139.937L254.981 279.641V361.255L0.250138 221.55V139.937Z"), attr$2(o, "fill", "#FF7C00"), attr$2(o, "fill-opacity", "0.4"), attr$2(o, "class", "svelte-43sxxs"), attr$2(c, "d", "M255.923 0.232622L0.236328 139.936V221.55L255.923 81.8469V0.232622Z"), attr$2(c, "fill", "#FF7C00"), attr$2(c, "class", "svelte-43sxxs"), set_style$2(n, "transform", "translate(" + /*$top*/
      r[1][0] + "px, " + /*$top*/
      r[1][1] + "px)"), attr$2(u, "d", "M255.926 141.5L509.702 280.681V361.773L255.926 222.592V141.5Z"), attr$2(u, "fill", "#FF7C00"), attr$2(u, "fill-opacity", "0.4"), attr$2(u, "class", "svelte-43sxxs"), attr$2(h, "d", "M509.69 280.679L254.981 420.384V501.998L509.69 362.293V280.679Z"), attr$2(h, "fill", "#FF7C00"), attr$2(h, "class", "svelte-43sxxs"), attr$2(d, "d", "M0.250138 280.681L254.981 420.386V502L0.250138 362.295V280.681Z"), attr$2(d, "fill", "#FF7C00"), attr$2(d, "fill-opacity", "0.4"), attr$2(d, "class", "svelte-43sxxs"), attr$2(w, "d", "M255.923 140.977L0.236328 280.68V362.294L255.923 222.591V140.977Z"), attr$2(w, "fill", "#FF7C00"), attr$2(w, "class", "svelte-43sxxs"), set_style$2(l, "transform", "translate(" + /*$bottom*/
      r[2][0] + "px, " + /*$bottom*/
      r[2][1] + "px)"), attr$2(t, "viewBox", "-1200 -1200 3000 3000"), attr$2(t, "fill", "none"), attr$2(t, "xmlns", "http://www.w3.org/2000/svg"), attr$2(t, "class", "svelte-43sxxs"), attr$2(e, "class", "svelte-43sxxs"), toggle_class$1(
        e,
        "margin",
        /*margin*/
        r[0]
      );
    },
    m(b, _) {
      insert$2(b, e, _), append$2(e, t), append$2(t, n), append$2(n, a), append$2(n, s), append$2(n, o), append$2(n, c), append$2(t, l), append$2(l, u), append$2(l, h), append$2(l, d), append$2(l, w);
    },
    p(b, [_]) {
      _ & /*$top*/
      2 && set_style$2(n, "transform", "translate(" + /*$top*/
      b[1][0] + "px, " + /*$top*/
      b[1][1] + "px)"), _ & /*$bottom*/
      4 && set_style$2(l, "transform", "translate(" + /*$bottom*/
      b[2][0] + "px, " + /*$bottom*/
      b[2][1] + "px)"), _ & /*margin*/
      1 && toggle_class$1(
        e,
        "margin",
        /*margin*/
        b[0]
      );
    },
    i: noop$2,
    o: noop$2,
    d(b) {
      b && detach$2(e);
    }
  };
}
function instance$2(r, e, t) {
  let n, a;
  var s = this && this.__awaiter || function(b, _, R, k) {
    function C(m) {
      return m instanceof R ? m : new R(function(A) {
        A(m);
      });
    }
    return new (R || (R = Promise))(function(m, A) {
      function F(y) {
        try {
          g(k.next(y));
        } catch (E) {
          A(E);
        }
      }
      function f(y) {
        try {
          g(k.throw(y));
        } catch (E) {
          A(E);
        }
      }
      function g(y) {
        y.done ? m(y.value) : C(y.value).then(F, f);
      }
      g((k = k.apply(b, _ || [])).next());
    });
  };
  let { margin: o = !0 } = e;
  const c = spring([0, 0]);
  component_subscribe(r, c, (b) => t(1, n = b));
  const l = spring([0, 0]);
  component_subscribe(r, l, (b) => t(2, a = b));
  let u;
  function h() {
    return s(this, void 0, void 0, function* () {
      yield Promise.all([c.set([125, 140]), l.set([-125, -140])]), yield Promise.all([c.set([-125, 140]), l.set([125, -140])]), yield Promise.all([c.set([-125, 0]), l.set([125, -0])]), yield Promise.all([c.set([125, 0]), l.set([-125, 0])]);
    });
  }
  function d() {
    return s(this, void 0, void 0, function* () {
      yield h(), u || d();
    });
  }
  function w() {
    return s(this, void 0, void 0, function* () {
      yield Promise.all([c.set([125, 0]), l.set([-125, 0])]), d();
    });
  }
  return onMount(() => (w(), () => u = !0)), r.$$set = (b) => {
    "margin" in b && t(0, o = b.margin);
  }, [o, n, a, c, l];
}
class Loader extends SvelteComponent$2 {
  constructor(e) {
    super(), init$2(this, e, instance$2, create_fragment$2, safe_not_equal$2, { margin: 0 });
  }
}
const {
  SvelteComponent: SvelteComponent$1,
  append: append$1,
  attr: attr$1,
  binding_callbacks: binding_callbacks$1,
  check_outros: check_outros$1,
  create_component: create_component$1,
  create_slot,
  destroy_component: destroy_component$1,
  destroy_each,
  detach: detach$1,
  element: element$1,
  empty,
  ensure_array_like,
  get_all_dirty_from_scope,
  get_slot_changes,
  group_outros: group_outros$1,
  init: init$1,
  insert: insert$1,
  mount_component: mount_component$1,
  noop: noop$1,
  safe_not_equal: safe_not_equal$1,
  set_data: set_data$1,
  set_style: set_style$1,
  space: space$1,
  text: text$1,
  toggle_class,
  transition_in: transition_in$1,
  transition_out: transition_out$1,
  update_slot_base
} = window.__gradio__svelte__internal, { tick: tick$1 } = window.__gradio__svelte__internal, { onDestroy } = window.__gradio__svelte__internal, { createEventDispatcher } = window.__gradio__svelte__internal, get_error_slot_changes = (r) => ({}), get_error_slot_context = (r) => ({}), get_additional_loading_text_slot_changes = (r) => ({}), get_additional_loading_text_slot_context = (r) => ({});
function get_each_context(r, e, t) {
  const n = r.slice();
  return n[41] = e[t], n[43] = t, n;
}
function get_each_context_1(r, e, t) {
  const n = r.slice();
  return n[41] = e[t], n;
}
function create_if_block_17(r) {
  let e, t, n, a, s = (
    /*i18n*/
    r[1]("common.error") + ""
  ), o, c, l;
  t = new IconButton({
    props: {
      Icon: Clear,
      label: (
        /*i18n*/
        r[1]("common.clear")
      ),
      disabled: !1
    }
  }), t.$on(
    "click",
    /*click_handler*/
    r[32]
  );
  const u = (
    /*#slots*/
    r[30].error
  ), h = create_slot(
    u,
    r,
    /*$$scope*/
    r[29],
    get_error_slot_context
  );
  return {
    c() {
      e = element$1("div"), create_component$1(t.$$.fragment), n = space$1(), a = element$1("span"), o = text$1(s), c = space$1(), h && h.c(), attr$1(e, "class", "clear-status svelte-v0wucf"), attr$1(a, "class", "error svelte-v0wucf");
    },
    m(d, w) {
      insert$1(d, e, w), mount_component$1(t, e, null), insert$1(d, n, w), insert$1(d, a, w), append$1(a, o), insert$1(d, c, w), h && h.m(d, w), l = !0;
    },
    p(d, w) {
      const b = {};
      w[0] & /*i18n*/
      2 && (b.label = /*i18n*/
      d[1]("common.clear")), t.$set(b), (!l || w[0] & /*i18n*/
      2) && s !== (s = /*i18n*/
      d[1]("common.error") + "") && set_data$1(o, s), h && h.p && (!l || w[0] & /*$$scope*/
      536870912) && update_slot_base(
        h,
        u,
        d,
        /*$$scope*/
        d[29],
        l ? get_slot_changes(
          u,
          /*$$scope*/
          d[29],
          w,
          get_error_slot_changes
        ) : get_all_dirty_from_scope(
          /*$$scope*/
          d[29]
        ),
        get_error_slot_context
      );
    },
    i(d) {
      l || (transition_in$1(t.$$.fragment, d), transition_in$1(h, d), l = !0);
    },
    o(d) {
      transition_out$1(t.$$.fragment, d), transition_out$1(h, d), l = !1;
    },
    d(d) {
      d && (detach$1(e), detach$1(n), detach$1(a), detach$1(c)), destroy_component$1(t), h && h.d(d);
    }
  };
}
function create_if_block$1(r) {
  let e, t, n, a, s, o, c, l, u, h = (
    /*variant*/
    r[8] === "default" && /*show_eta_bar*/
    r[18] && /*show_progress*/
    r[6] === "full" && create_if_block_16(r)
  );
  function d(A, F) {
    if (
      /*progress*/
      A[7]
    ) return create_if_block_11;
    if (
      /*queue_position*/
      A[2] !== null && /*queue_size*/
      A[3] !== void 0 && /*queue_position*/
      A[2] >= 0
    ) return create_if_block_14;
    if (
      /*queue_position*/
      A[2] === 0
    ) return create_if_block_15;
  }
  let w = d(r), b = w && w(r), _ = (
    /*timer*/
    r[5] && create_if_block_10(r)
  );
  const R = [create_if_block_2$1, create_if_block_9], k = [];
  function C(A, F) {
    return (
      /*last_progress_level*/
      A[15] != null ? 0 : (
        /*show_progress*/
        A[6] === "full" ? 1 : -1
      )
    );
  }
  ~(s = C(r)) && (o = k[s] = R[s](r));
  let m = !/*timer*/
  r[5] && create_if_block_1$1(r);
  return {
    c() {
      h && h.c(), e = space$1(), t = element$1("div"), b && b.c(), n = space$1(), _ && _.c(), a = space$1(), o && o.c(), c = space$1(), m && m.c(), l = empty(), attr$1(t, "class", "progress-text svelte-v0wucf"), toggle_class(
        t,
        "meta-text-center",
        /*variant*/
        r[8] === "center"
      ), toggle_class(
        t,
        "meta-text",
        /*variant*/
        r[8] === "default"
      );
    },
    m(A, F) {
      h && h.m(A, F), insert$1(A, e, F), insert$1(A, t, F), b && b.m(t, null), append$1(t, n), _ && _.m(t, null), insert$1(A, a, F), ~s && k[s].m(A, F), insert$1(A, c, F), m && m.m(A, F), insert$1(A, l, F), u = !0;
    },
    p(A, F) {
      /*variant*/
      A[8] === "default" && /*show_eta_bar*/
      A[18] && /*show_progress*/
      A[6] === "full" ? h ? h.p(A, F) : (h = create_if_block_16(A), h.c(), h.m(e.parentNode, e)) : h && (h.d(1), h = null), w === (w = d(A)) && b ? b.p(A, F) : (b && b.d(1), b = w && w(A), b && (b.c(), b.m(t, n))), /*timer*/
      A[5] ? _ ? _.p(A, F) : (_ = create_if_block_10(A), _.c(), _.m(t, null)) : _ && (_.d(1), _ = null), (!u || F[0] & /*variant*/
      256) && toggle_class(
        t,
        "meta-text-center",
        /*variant*/
        A[8] === "center"
      ), (!u || F[0] & /*variant*/
      256) && toggle_class(
        t,
        "meta-text",
        /*variant*/
        A[8] === "default"
      );
      let f = s;
      s = C(A), s === f ? ~s && k[s].p(A, F) : (o && (group_outros$1(), transition_out$1(k[f], 1, 1, () => {
        k[f] = null;
      }), check_outros$1()), ~s ? (o = k[s], o ? o.p(A, F) : (o = k[s] = R[s](A), o.c()), transition_in$1(o, 1), o.m(c.parentNode, c)) : o = null), /*timer*/
      A[5] ? m && (group_outros$1(), transition_out$1(m, 1, 1, () => {
        m = null;
      }), check_outros$1()) : m ? (m.p(A, F), F[0] & /*timer*/
      32 && transition_in$1(m, 1)) : (m = create_if_block_1$1(A), m.c(), transition_in$1(m, 1), m.m(l.parentNode, l));
    },
    i(A) {
      u || (transition_in$1(o), transition_in$1(m), u = !0);
    },
    o(A) {
      transition_out$1(o), transition_out$1(m), u = !1;
    },
    d(A) {
      A && (detach$1(e), detach$1(t), detach$1(a), detach$1(c), detach$1(l)), h && h.d(A), b && b.d(), _ && _.d(), ~s && k[s].d(A), m && m.d(A);
    }
  };
}
function create_if_block_16(r) {
  let e, t = `translateX(${/*eta_level*/
  (r[17] || 0) * 100 - 100}%)`;
  return {
    c() {
      e = element$1("div"), attr$1(e, "class", "eta-bar svelte-v0wucf"), set_style$1(e, "transform", t);
    },
    m(n, a) {
      insert$1(n, e, a);
    },
    p(n, a) {
      a[0] & /*eta_level*/
      131072 && t !== (t = `translateX(${/*eta_level*/
      (n[17] || 0) * 100 - 100}%)`) && set_style$1(e, "transform", t);
    },
    d(n) {
      n && detach$1(e);
    }
  };
}
function create_if_block_15(r) {
  let e;
  return {
    c() {
      e = text$1("processing |");
    },
    m(t, n) {
      insert$1(t, e, n);
    },
    p: noop$1,
    d(t) {
      t && detach$1(e);
    }
  };
}
function create_if_block_14(r) {
  let e, t = (
    /*queue_position*/
    r[2] + 1 + ""
  ), n, a, s, o;
  return {
    c() {
      e = text$1("queue: "), n = text$1(t), a = text$1("/"), s = text$1(
        /*queue_size*/
        r[3]
      ), o = text$1(" |");
    },
    m(c, l) {
      insert$1(c, e, l), insert$1(c, n, l), insert$1(c, a, l), insert$1(c, s, l), insert$1(c, o, l);
    },
    p(c, l) {
      l[0] & /*queue_position*/
      4 && t !== (t = /*queue_position*/
      c[2] + 1 + "") && set_data$1(n, t), l[0] & /*queue_size*/
      8 && set_data$1(
        s,
        /*queue_size*/
        c[3]
      );
    },
    d(c) {
      c && (detach$1(e), detach$1(n), detach$1(a), detach$1(s), detach$1(o));
    }
  };
}
function create_if_block_11(r) {
  let e, t = ensure_array_like(
    /*progress*/
    r[7]
  ), n = [];
  for (let a = 0; a < t.length; a += 1)
    n[a] = create_each_block_1(get_each_context_1(r, t, a));
  return {
    c() {
      for (let a = 0; a < n.length; a += 1)
        n[a].c();
      e = empty();
    },
    m(a, s) {
      for (let o = 0; o < n.length; o += 1)
        n[o] && n[o].m(a, s);
      insert$1(a, e, s);
    },
    p(a, s) {
      if (s[0] & /*progress*/
      128) {
        t = ensure_array_like(
          /*progress*/
          a[7]
        );
        let o;
        for (o = 0; o < t.length; o += 1) {
          const c = get_each_context_1(a, t, o);
          n[o] ? n[o].p(c, s) : (n[o] = create_each_block_1(c), n[o].c(), n[o].m(e.parentNode, e));
        }
        for (; o < n.length; o += 1)
          n[o].d(1);
        n.length = t.length;
      }
    },
    d(a) {
      a && detach$1(e), destroy_each(n, a);
    }
  };
}
function create_if_block_12(r) {
  let e, t = (
    /*p*/
    r[41].unit + ""
  ), n, a, s = " ", o;
  function c(h, d) {
    return (
      /*p*/
      h[41].length != null ? create_if_block_13 : create_else_block
    );
  }
  let l = c(r), u = l(r);
  return {
    c() {
      u.c(), e = space$1(), n = text$1(t), a = text$1(" | "), o = text$1(s);
    },
    m(h, d) {
      u.m(h, d), insert$1(h, e, d), insert$1(h, n, d), insert$1(h, a, d), insert$1(h, o, d);
    },
    p(h, d) {
      l === (l = c(h)) && u ? u.p(h, d) : (u.d(1), u = l(h), u && (u.c(), u.m(e.parentNode, e))), d[0] & /*progress*/
      128 && t !== (t = /*p*/
      h[41].unit + "") && set_data$1(n, t);
    },
    d(h) {
      h && (detach$1(e), detach$1(n), detach$1(a), detach$1(o)), u.d(h);
    }
  };
}
function create_else_block(r) {
  let e = pretty_si(
    /*p*/
    r[41].index || 0
  ) + "", t;
  return {
    c() {
      t = text$1(e);
    },
    m(n, a) {
      insert$1(n, t, a);
    },
    p(n, a) {
      a[0] & /*progress*/
      128 && e !== (e = pretty_si(
        /*p*/
        n[41].index || 0
      ) + "") && set_data$1(t, e);
    },
    d(n) {
      n && detach$1(t);
    }
  };
}
function create_if_block_13(r) {
  let e = pretty_si(
    /*p*/
    r[41].index || 0
  ) + "", t, n, a = pretty_si(
    /*p*/
    r[41].length
  ) + "", s;
  return {
    c() {
      t = text$1(e), n = text$1("/"), s = text$1(a);
    },
    m(o, c) {
      insert$1(o, t, c), insert$1(o, n, c), insert$1(o, s, c);
    },
    p(o, c) {
      c[0] & /*progress*/
      128 && e !== (e = pretty_si(
        /*p*/
        o[41].index || 0
      ) + "") && set_data$1(t, e), c[0] & /*progress*/
      128 && a !== (a = pretty_si(
        /*p*/
        o[41].length
      ) + "") && set_data$1(s, a);
    },
    d(o) {
      o && (detach$1(t), detach$1(n), detach$1(s));
    }
  };
}
function create_each_block_1(r) {
  let e, t = (
    /*p*/
    r[41].index != null && create_if_block_12(r)
  );
  return {
    c() {
      t && t.c(), e = empty();
    },
    m(n, a) {
      t && t.m(n, a), insert$1(n, e, a);
    },
    p(n, a) {
      /*p*/
      n[41].index != null ? t ? t.p(n, a) : (t = create_if_block_12(n), t.c(), t.m(e.parentNode, e)) : t && (t.d(1), t = null);
    },
    d(n) {
      n && detach$1(e), t && t.d(n);
    }
  };
}
function create_if_block_10(r) {
  let e, t = (
    /*eta*/
    r[0] ? `/${/*formatted_eta*/
    r[19]}` : ""
  ), n, a;
  return {
    c() {
      e = text$1(
        /*formatted_timer*/
        r[20]
      ), n = text$1(t), a = text$1("s");
    },
    m(s, o) {
      insert$1(s, e, o), insert$1(s, n, o), insert$1(s, a, o);
    },
    p(s, o) {
      o[0] & /*formatted_timer*/
      1048576 && set_data$1(
        e,
        /*formatted_timer*/
        s[20]
      ), o[0] & /*eta, formatted_eta*/
      524289 && t !== (t = /*eta*/
      s[0] ? `/${/*formatted_eta*/
      s[19]}` : "") && set_data$1(n, t);
    },
    d(s) {
      s && (detach$1(e), detach$1(n), detach$1(a));
    }
  };
}
function create_if_block_9(r) {
  let e, t;
  return e = new Loader({
    props: { margin: (
      /*variant*/
      r[8] === "default"
    ) }
  }), {
    c() {
      create_component$1(e.$$.fragment);
    },
    m(n, a) {
      mount_component$1(e, n, a), t = !0;
    },
    p(n, a) {
      const s = {};
      a[0] & /*variant*/
      256 && (s.margin = /*variant*/
      n[8] === "default"), e.$set(s);
    },
    i(n) {
      t || (transition_in$1(e.$$.fragment, n), t = !0);
    },
    o(n) {
      transition_out$1(e.$$.fragment, n), t = !1;
    },
    d(n) {
      destroy_component$1(e, n);
    }
  };
}
function create_if_block_2$1(r) {
  let e, t, n, a, s, o = `${/*last_progress_level*/
  r[15] * 100}%`, c = (
    /*progress*/
    r[7] != null && create_if_block_3$1(r)
  );
  return {
    c() {
      e = element$1("div"), t = element$1("div"), c && c.c(), n = space$1(), a = element$1("div"), s = element$1("div"), attr$1(t, "class", "progress-level-inner svelte-v0wucf"), attr$1(s, "class", "progress-bar svelte-v0wucf"), set_style$1(s, "width", o), attr$1(a, "class", "progress-bar-wrap svelte-v0wucf"), attr$1(e, "class", "progress-level svelte-v0wucf");
    },
    m(l, u) {
      insert$1(l, e, u), append$1(e, t), c && c.m(t, null), append$1(e, n), append$1(e, a), append$1(a, s), r[31](s);
    },
    p(l, u) {
      /*progress*/
      l[7] != null ? c ? c.p(l, u) : (c = create_if_block_3$1(l), c.c(), c.m(t, null)) : c && (c.d(1), c = null), u[0] & /*last_progress_level*/
      32768 && o !== (o = `${/*last_progress_level*/
      l[15] * 100}%`) && set_style$1(s, "width", o);
    },
    i: noop$1,
    o: noop$1,
    d(l) {
      l && detach$1(e), c && c.d(), r[31](null);
    }
  };
}
function create_if_block_3$1(r) {
  let e, t = ensure_array_like(
    /*progress*/
    r[7]
  ), n = [];
  for (let a = 0; a < t.length; a += 1)
    n[a] = create_each_block(get_each_context(r, t, a));
  return {
    c() {
      for (let a = 0; a < n.length; a += 1)
        n[a].c();
      e = empty();
    },
    m(a, s) {
      for (let o = 0; o < n.length; o += 1)
        n[o] && n[o].m(a, s);
      insert$1(a, e, s);
    },
    p(a, s) {
      if (s[0] & /*progress_level, progress*/
      16512) {
        t = ensure_array_like(
          /*progress*/
          a[7]
        );
        let o;
        for (o = 0; o < t.length; o += 1) {
          const c = get_each_context(a, t, o);
          n[o] ? n[o].p(c, s) : (n[o] = create_each_block(c), n[o].c(), n[o].m(e.parentNode, e));
        }
        for (; o < n.length; o += 1)
          n[o].d(1);
        n.length = t.length;
      }
    },
    d(a) {
      a && detach$1(e), destroy_each(n, a);
    }
  };
}
function create_if_block_4(r) {
  let e, t, n, a, s = (
    /*i*/
    r[43] !== 0 && create_if_block_8()
  ), o = (
    /*p*/
    r[41].desc != null && create_if_block_7(r)
  ), c = (
    /*p*/
    r[41].desc != null && /*progress_level*/
    r[14] && /*progress_level*/
    r[14][
      /*i*/
      r[43]
    ] != null && create_if_block_6()
  ), l = (
    /*progress_level*/
    r[14] != null && create_if_block_5(r)
  );
  return {
    c() {
      s && s.c(), e = space$1(), o && o.c(), t = space$1(), c && c.c(), n = space$1(), l && l.c(), a = empty();
    },
    m(u, h) {
      s && s.m(u, h), insert$1(u, e, h), o && o.m(u, h), insert$1(u, t, h), c && c.m(u, h), insert$1(u, n, h), l && l.m(u, h), insert$1(u, a, h);
    },
    p(u, h) {
      /*p*/
      u[41].desc != null ? o ? o.p(u, h) : (o = create_if_block_7(u), o.c(), o.m(t.parentNode, t)) : o && (o.d(1), o = null), /*p*/
      u[41].desc != null && /*progress_level*/
      u[14] && /*progress_level*/
      u[14][
        /*i*/
        u[43]
      ] != null ? c || (c = create_if_block_6(), c.c(), c.m(n.parentNode, n)) : c && (c.d(1), c = null), /*progress_level*/
      u[14] != null ? l ? l.p(u, h) : (l = create_if_block_5(u), l.c(), l.m(a.parentNode, a)) : l && (l.d(1), l = null);
    },
    d(u) {
      u && (detach$1(e), detach$1(t), detach$1(n), detach$1(a)), s && s.d(u), o && o.d(u), c && c.d(u), l && l.d(u);
    }
  };
}
function create_if_block_8(r) {
  let e;
  return {
    c() {
      e = text$1(" /");
    },
    m(t, n) {
      insert$1(t, e, n);
    },
    d(t) {
      t && detach$1(e);
    }
  };
}
function create_if_block_7(r) {
  let e = (
    /*p*/
    r[41].desc + ""
  ), t;
  return {
    c() {
      t = text$1(e);
    },
    m(n, a) {
      insert$1(n, t, a);
    },
    p(n, a) {
      a[0] & /*progress*/
      128 && e !== (e = /*p*/
      n[41].desc + "") && set_data$1(t, e);
    },
    d(n) {
      n && detach$1(t);
    }
  };
}
function create_if_block_6(r) {
  let e;
  return {
    c() {
      e = text$1("-");
    },
    m(t, n) {
      insert$1(t, e, n);
    },
    d(t) {
      t && detach$1(e);
    }
  };
}
function create_if_block_5(r) {
  let e = (100 * /*progress_level*/
  (r[14][
    /*i*/
    r[43]
  ] || 0)).toFixed(1) + "", t, n;
  return {
    c() {
      t = text$1(e), n = text$1("%");
    },
    m(a, s) {
      insert$1(a, t, s), insert$1(a, n, s);
    },
    p(a, s) {
      s[0] & /*progress_level*/
      16384 && e !== (e = (100 * /*progress_level*/
      (a[14][
        /*i*/
        a[43]
      ] || 0)).toFixed(1) + "") && set_data$1(t, e);
    },
    d(a) {
      a && (detach$1(t), detach$1(n));
    }
  };
}
function create_each_block(r) {
  let e, t = (
    /*p*/
    (r[41].desc != null || /*progress_level*/
    r[14] && /*progress_level*/
    r[14][
      /*i*/
      r[43]
    ] != null) && create_if_block_4(r)
  );
  return {
    c() {
      t && t.c(), e = empty();
    },
    m(n, a) {
      t && t.m(n, a), insert$1(n, e, a);
    },
    p(n, a) {
      /*p*/
      n[41].desc != null || /*progress_level*/
      n[14] && /*progress_level*/
      n[14][
        /*i*/
        n[43]
      ] != null ? t ? t.p(n, a) : (t = create_if_block_4(n), t.c(), t.m(e.parentNode, e)) : t && (t.d(1), t = null);
    },
    d(n) {
      n && detach$1(e), t && t.d(n);
    }
  };
}
function create_if_block_1$1(r) {
  let e, t, n, a;
  const s = (
    /*#slots*/
    r[30]["additional-loading-text"]
  ), o = create_slot(
    s,
    r,
    /*$$scope*/
    r[29],
    get_additional_loading_text_slot_context
  );
  return {
    c() {
      e = element$1("p"), t = text$1(
        /*loading_text*/
        r[9]
      ), n = space$1(), o && o.c(), attr$1(e, "class", "loading svelte-v0wucf");
    },
    m(c, l) {
      insert$1(c, e, l), append$1(e, t), insert$1(c, n, l), o && o.m(c, l), a = !0;
    },
    p(c, l) {
      (!a || l[0] & /*loading_text*/
      512) && set_data$1(
        t,
        /*loading_text*/
        c[9]
      ), o && o.p && (!a || l[0] & /*$$scope*/
      536870912) && update_slot_base(
        o,
        s,
        c,
        /*$$scope*/
        c[29],
        a ? get_slot_changes(
          s,
          /*$$scope*/
          c[29],
          l,
          get_additional_loading_text_slot_changes
        ) : get_all_dirty_from_scope(
          /*$$scope*/
          c[29]
        ),
        get_additional_loading_text_slot_context
      );
    },
    i(c) {
      a || (transition_in$1(o, c), a = !0);
    },
    o(c) {
      transition_out$1(o, c), a = !1;
    },
    d(c) {
      c && (detach$1(e), detach$1(n)), o && o.d(c);
    }
  };
}
function create_fragment$1(r) {
  let e, t, n, a, s;
  const o = [create_if_block$1, create_if_block_17], c = [];
  function l(u, h) {
    return (
      /*status*/
      u[4] === "pending" ? 0 : (
        /*status*/
        u[4] === "error" ? 1 : -1
      )
    );
  }
  return ~(t = l(r)) && (n = c[t] = o[t](r)), {
    c() {
      e = element$1("div"), n && n.c(), attr$1(e, "class", a = "wrap " + /*variant*/
      r[8] + " " + /*show_progress*/
      r[6] + " svelte-v0wucf"), toggle_class(e, "hide", !/*status*/
      r[4] || /*status*/
      r[4] === "complete" || /*show_progress*/
      r[6] === "hidden"), toggle_class(
        e,
        "translucent",
        /*variant*/
        r[8] === "center" && /*status*/
        (r[4] === "pending" || /*status*/
        r[4] === "error") || /*translucent*/
        r[11] || /*show_progress*/
        r[6] === "minimal"
      ), toggle_class(
        e,
        "generating",
        /*status*/
        r[4] === "generating" && /*show_progress*/
        r[6] === "full"
      ), toggle_class(
        e,
        "border",
        /*border*/
        r[12]
      ), set_style$1(
        e,
        "position",
        /*absolute*/
        r[10] ? "absolute" : "static"
      ), set_style$1(
        e,
        "padding",
        /*absolute*/
        r[10] ? "0" : "var(--size-8) 0"
      );
    },
    m(u, h) {
      insert$1(u, e, h), ~t && c[t].m(e, null), r[33](e), s = !0;
    },
    p(u, h) {
      let d = t;
      t = l(u), t === d ? ~t && c[t].p(u, h) : (n && (group_outros$1(), transition_out$1(c[d], 1, 1, () => {
        c[d] = null;
      }), check_outros$1()), ~t ? (n = c[t], n ? n.p(u, h) : (n = c[t] = o[t](u), n.c()), transition_in$1(n, 1), n.m(e, null)) : n = null), (!s || h[0] & /*variant, show_progress*/
      320 && a !== (a = "wrap " + /*variant*/
      u[8] + " " + /*show_progress*/
      u[6] + " svelte-v0wucf")) && attr$1(e, "class", a), (!s || h[0] & /*variant, show_progress, status, show_progress*/
      336) && toggle_class(e, "hide", !/*status*/
      u[4] || /*status*/
      u[4] === "complete" || /*show_progress*/
      u[6] === "hidden"), (!s || h[0] & /*variant, show_progress, variant, status, translucent, show_progress*/
      2384) && toggle_class(
        e,
        "translucent",
        /*variant*/
        u[8] === "center" && /*status*/
        (u[4] === "pending" || /*status*/
        u[4] === "error") || /*translucent*/
        u[11] || /*show_progress*/
        u[6] === "minimal"
      ), (!s || h[0] & /*variant, show_progress, status, show_progress*/
      336) && toggle_class(
        e,
        "generating",
        /*status*/
        u[4] === "generating" && /*show_progress*/
        u[6] === "full"
      ), (!s || h[0] & /*variant, show_progress, border*/
      4416) && toggle_class(
        e,
        "border",
        /*border*/
        u[12]
      ), h[0] & /*absolute*/
      1024 && set_style$1(
        e,
        "position",
        /*absolute*/
        u[10] ? "absolute" : "static"
      ), h[0] & /*absolute*/
      1024 && set_style$1(
        e,
        "padding",
        /*absolute*/
        u[10] ? "0" : "var(--size-8) 0"
      );
    },
    i(u) {
      s || (transition_in$1(n), s = !0);
    },
    o(u) {
      transition_out$1(n), s = !1;
    },
    d(u) {
      u && detach$1(e), ~t && c[t].d(), r[33](null);
    }
  };
}
var __awaiter = function(r, e, t, n) {
  function a(s) {
    return s instanceof t ? s : new t(function(o) {
      o(s);
    });
  }
  return new (t || (t = Promise))(function(s, o) {
    function c(h) {
      try {
        u(n.next(h));
      } catch (d) {
        o(d);
      }
    }
    function l(h) {
      try {
        u(n.throw(h));
      } catch (d) {
        o(d);
      }
    }
    function u(h) {
      h.done ? s(h.value) : a(h.value).then(c, l);
    }
    u((n = n.apply(r, e || [])).next());
  });
};
let items = [], called = !1;
function scroll_into_view(r) {
  return __awaiter(this, arguments, void 0, function* (e, t = !0) {
    if (!(window.__gradio_mode__ === "website" || window.__gradio_mode__ !== "app" && t !== !0)) {
      if (items.push(e), !called) called = !0;
      else return;
      yield tick$1(), requestAnimationFrame(() => {
        let n = [0, 0];
        for (let a = 0; a < items.length; a++) {
          const o = items[a].getBoundingClientRect();
          (a === 0 || o.top + window.scrollY <= n[0]) && (n[0] = o.top + window.scrollY, n[1] = a);
        }
        window.scrollTo({ top: n[0] - 20, behavior: "smooth" }), called = !1, items = [];
      });
    }
  });
}
function instance$1(r, e, t) {
  let n, { $$slots: a = {}, $$scope: s } = e;
  this && this.__awaiter;
  const o = createEventDispatcher();
  let { i18n: c } = e, { eta: l = null } = e, { queue_position: u } = e, { queue_size: h } = e, { status: d } = e, { scroll_to_output: w = !1 } = e, { timer: b = !0 } = e, { show_progress: _ = "full" } = e, { message: R = null } = e, { progress: k = null } = e, { variant: C = "default" } = e, { loading_text: m = "Loading..." } = e, { absolute: A = !0 } = e, { translucent: F = !1 } = e, { border: f = !1 } = e, { autoscroll: g } = e, y, E = !1, x = 0, O = 0, P = null, I = null, G = 0, ne = null, X, ee = null, K = !0;
  const se = () => {
    t(0, l = t(27, P = t(19, J = null))), t(25, x = performance.now()), t(26, O = 0), E = !0, q();
  };
  function q() {
    requestAnimationFrame(() => {
      t(26, O = (performance.now() - x) / 1e3), E && q();
    });
  }
  function Y() {
    t(26, O = 0), t(0, l = t(27, P = t(19, J = null))), E && (E = !1);
  }
  onDestroy(() => {
    E && Y();
  });
  let J = null;
  function N(L) {
    binding_callbacks$1[L ? "unshift" : "push"](() => {
      ee = L, t(16, ee), t(7, k), t(14, ne), t(15, X);
    });
  }
  const M = () => {
    o("clear_status");
  };
  function v(L) {
    binding_callbacks$1[L ? "unshift" : "push"](() => {
      y = L, t(13, y);
    });
  }
  return r.$$set = (L) => {
    "i18n" in L && t(1, c = L.i18n), "eta" in L && t(0, l = L.eta), "queue_position" in L && t(2, u = L.queue_position), "queue_size" in L && t(3, h = L.queue_size), "status" in L && t(4, d = L.status), "scroll_to_output" in L && t(22, w = L.scroll_to_output), "timer" in L && t(5, b = L.timer), "show_progress" in L && t(6, _ = L.show_progress), "message" in L && t(23, R = L.message), "progress" in L && t(7, k = L.progress), "variant" in L && t(8, C = L.variant), "loading_text" in L && t(9, m = L.loading_text), "absolute" in L && t(10, A = L.absolute), "translucent" in L && t(11, F = L.translucent), "border" in L && t(12, f = L.border), "autoscroll" in L && t(24, g = L.autoscroll), "$$scope" in L && t(29, s = L.$$scope);
  }, r.$$.update = () => {
    r.$$.dirty[0] & /*eta, old_eta, timer_start, eta_from_start*/
    436207617 && (l === null && t(0, l = P), l != null && P !== l && (t(28, I = (performance.now() - x) / 1e3 + l), t(19, J = I.toFixed(1)), t(27, P = l))), r.$$.dirty[0] & /*eta_from_start, timer_diff*/
    335544320 && t(17, G = I === null || I <= 0 || !O ? null : Math.min(O / I, 1)), r.$$.dirty[0] & /*progress*/
    128 && k != null && t(18, K = !1), r.$$.dirty[0] & /*progress, progress_level, progress_bar, last_progress_level*/
    114816 && (k != null ? t(14, ne = k.map((L) => {
      if (L.index != null && L.length != null)
        return L.index / L.length;
      if (L.progress != null)
        return L.progress;
    })) : t(14, ne = null), ne ? (t(15, X = ne[ne.length - 1]), ee && (X === 0 ? t(16, ee.style.transition = "0", ee) : t(16, ee.style.transition = "150ms", ee))) : t(15, X = void 0)), r.$$.dirty[0] & /*status*/
    16 && (d === "pending" ? se() : Y()), r.$$.dirty[0] & /*el, scroll_to_output, status, autoscroll*/
    20979728 && y && w && (d === "pending" || d === "complete") && scroll_into_view(y, g), r.$$.dirty[0] & /*status, message*/
    8388624, r.$$.dirty[0] & /*timer_diff*/
    67108864 && t(20, n = O.toFixed(1));
  }, [
    l,
    c,
    u,
    h,
    d,
    b,
    _,
    k,
    C,
    m,
    A,
    F,
    f,
    y,
    ne,
    X,
    ee,
    G,
    K,
    J,
    n,
    o,
    w,
    R,
    g,
    x,
    O,
    P,
    I,
    s,
    a,
    N,
    M,
    v
  ];
}
class Static extends SvelteComponent$1 {
  constructor(e) {
    super(), init$1(
      this,
      e,
      instance$1,
      create_fragment$1,
      safe_not_equal$1,
      {
        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]
    );
  }
}
const {
  SvelteComponent,
  append,
  assign,
  attr,
  binding_callbacks,
  check_outros,
  create_component,
  destroy_component,
  detach,
  element,
  flush,
  get_spread_object,
  get_spread_update,
  group_outros,
  init,
  insert,
  listen,
  mount_component,
  noop,
  safe_not_equal,
  set_data,
  set_style,
  space,
  text,
  transition_in,
  transition_out
} = window.__gradio__svelte__internal, { tick } = window.__gradio__svelte__internal;
function create_if_block_3(r) {
  let e, t;
  const n = [
    {
      autoscroll: (
        /*gradio*/
        r[11].autoscroll
      )
    },
    { i18n: (
      /*gradio*/
      r[11].i18n
    ) },
    /*loading_status*/
    r[7]
  ];
  let a = {};
  for (let s = 0; s < n.length; s += 1)
    a = assign(a, n[s]);
  return e = new Static({ props: a }), {
    c() {
      create_component(e.$$.fragment);
    },
    m(s, o) {
      mount_component(e, s, o), t = !0;
    },
    p(s, o) {
      const c = o[0] & /*gradio, loading_status*/
      2176 ? get_spread_update(n, [
        o[0] & /*gradio*/
        2048 && {
          autoscroll: (
            /*gradio*/
            s[11].autoscroll
          )
        },
        o[0] & /*gradio*/
        2048 && { i18n: (
          /*gradio*/
          s[11].i18n
        ) },
        o[0] & /*loading_status*/
        128 && get_spread_object(
          /*loading_status*/
          s[7]
        )
      ]) : {};
      e.$set(c);
    },
    i(s) {
      t || (transition_in(e.$$.fragment, s), t = !0);
    },
    o(s) {
      transition_out(e.$$.fragment, s), t = !1;
    },
    d(s) {
      destroy_component(e, s);
    }
  };
}
function create_if_block(r) {
  let e, t, n, a, s, o, c = Array.isArray(
    /*value*/
    r[4]
  ) && /*value*/
  r[4].length > 1, l, u, h, d = (
    /*files_with_original_ext*/
    r[5][
      /*n*/
      r[0]
    ] + ""
  ), w, b, _, R = Array.isArray(
    /*value*/
    r[4]
  ) && /*value*/
  r[4].length > 1, k = c && create_if_block_2(r), C = R && create_if_block_1(r);
  return {
    c() {
      e = element("div"), t = element("div"), t.innerHTML = "<span>·</span><span>·</span><span>·</span>", n = space(), a = element("div"), s = space(), o = element("div"), k && k.c(), l = space(), u = element("span"), h = text("   "), w = text(d), b = text("   "), _ = space(), C && C.c(), attr(t, "class", "viewer-blinker"), set_style(t, "display", "none"), attr(a, "class", "viewer"), attr(u, "class", "file-name"), attr(o, "class", "button-row"), attr(e, "class", "viewer-container");
    },
    m(m, A) {
      insert(m, e, A), append(e, t), r[24](t), append(e, n), append(e, a), r[25](a), append(e, s), append(e, o), k && k.m(o, null), append(o, l), append(o, u), append(u, h), append(u, w), append(u, b), append(o, _), C && C.m(o, null);
    },
    p(m, A) {
      A[0] & /*value*/
      16 && (c = Array.isArray(
        /*value*/
        m[4]
      ) && /*value*/
      m[4].length > 1), c ? k ? k.p(m, A) : (k = create_if_block_2(m), k.c(), k.m(o, l)) : k && (k.d(1), k = null), A[0] & /*files_with_original_ext, n*/
      33 && d !== (d = /*files_with_original_ext*/
      m[5][
        /*n*/
        m[0]
      ] + "") && set_data(w, d), A[0] & /*value*/
      16 && (R = Array.isArray(
        /*value*/
        m[4]
      ) && /*value*/
      m[4].length > 1), R ? C ? C.p(m, A) : (C = create_if_block_1(m), C.c(), C.m(o, null)) : C && (C.d(1), C = null);
    },
    d(m) {
      m && detach(e), r[24](null), r[25](null), k && k.d(), C && C.d();
    }
  };
}
function create_if_block_2(r) {
  let e, t, n;
  return {
    c() {
      e = element("button"), e.innerHTML = '<svg width="18" height="18" viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg"><polygon points="12.4,3.8 5.6,9 12.4,14.2" fill="none" stroke_width="1.5" stroke_linejoin="round" stroke_linecap="round"></polygon></svg>', attr(e, "class", "next-button");
    },
    m(a, s) {
      insert(a, e, s), t || (n = listen(
        e,
        "click",
        /*previous_file*/
        r[16]
      ), t = !0);
    },
    p: noop,
    d(a) {
      a && detach(e), t = !1, n();
    }
  };
}
function create_if_block_1(r) {
  let e, t, n;
  return {
    c() {
      e = element("button"), e.innerHTML = '<svg width="18" height="18" viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg"><polygon points="5.6,3.8 12.4,9 5.6,14.2" fill="none" stroke_width="1.5" stroke_linejoin="round" stroke_linecap="round"></polygon></svg>', attr(e, "class", "next-button");
    },
    m(a, s) {
      insert(a, e, s), t || (n = listen(
        e,
        "click",
        /*next_file*/
        r[15]
      ), t = !0);
    },
    p: noop,
    d(a) {
      a && detach(e), t = !1, n();
    }
  };
}
function create_default_slot(r) {
  let e, t, n, a, s, o, c = (
    /*loading_status*/
    r[7] && create_if_block_3(r)
  );
  t = new BlockLabel({
    props: {
      show_label: !1,
      Icon: File_1,
      float: 1,
      label: null
    }
  });
  let l = (
    /*file*/
    r[12] && create_if_block(r)
  );
  return {
    c() {
      c && c.c(), e = space(), create_component(t.$$.fragment), n = space(), l && l.c(), a = space(), s = element("style"), s.textContent = `:root {
            --neo-blue: rgb(0, 162, 223);
			--neo-white: rgb(255, 255, 255);
			--neo-black: rgb(5, 5, 5);
		}
		.viewer-container {
			position: relative;
			overflow: hidden;
			height: 100%;
			width: 100%;
			display: flex;
			flex-direction: column;
		}
		.viewer {
			display: flex;
			flex-direction: column;
			width: 100%;
			height: 100%;
			overflow: auto;
		}
		.error-message {
			text-align: center;
		}
		.viewer canvas {
			margin: .1vh 0;
		}
		.button-row {
			display: flex;
			flex-direction: row;
			width: 100%;
			justify-content: center;
			align-items: center;
		}
		.file-name {
			max-width: 90%;
			overflow: hidden;
			text-overflow: ellipsis;
			white-space: nowrap;
		}
		.viewer-blinker {
			position: absolute;
			top: 50%;
			left: 50%;
			transform: translate(-50%, -50%);
			color: var(--neo-blue);
			animation: blinker 1.5s cubic-bezier(.5, 0, 1, 1) infinite alternate;
			font-size: 3em;
		}
		.viewer-blinker span {
			opacity: 0;
			animation-name: blinker;
			animation-duration: 1.5s;
			animation-timing-function: cubic-bezier(.5, 0, 1, 1);
			animation-iteration-count: infinite;
		}
		.viewer-blinker span:nth-child(1) {
			animation-delay: 0s;
		}
		.viewer-blinker span:nth-child(2) {
			animation-delay: .5s; /* Délai pour le deuxième point */
		}
		.viewer-blinker span:nth-child(3) {
			animation-delay: 1s; /* Délai pour le troisième point */
		}
		@keyframes blinker {  
            0%, 100% { opacity: 0; }
            50% { opacity: 1; }
        }
		/* Style par défaut */
		.next-button polygon {
		stroke: var(--neo-black);
		}
		.dark .next-button polygon {
		stroke: var(--neo-white);
		}`;
    },
    m(u, h) {
      c && c.m(u, h), insert(u, e, h), mount_component(t, u, h), insert(u, n, h), l && l.m(u, h), insert(u, a, h), insert(u, s, h), o = !0;
    },
    p(u, h) {
      /*loading_status*/
      u[7] ? c ? (c.p(u, h), h[0] & /*loading_status*/
      128 && transition_in(c, 1)) : (c = create_if_block_3(u), c.c(), transition_in(c, 1), c.m(e.parentNode, e)) : c && (group_outros(), transition_out(c, 1, 1, () => {
        c = null;
      }), check_outros()), /*file*/
      u[12] ? l ? l.p(u, h) : (l = create_if_block(u), l.c(), l.m(a.parentNode, a)) : l && (l.d(1), l = null);
    },
    i(u) {
      o || (transition_in(c), transition_in(t.$$.fragment, u), o = !0);
    },
    o(u) {
      transition_out(c), transition_out(t.$$.fragment, u), o = !1;
    },
    d(u) {
      u && (detach(e), detach(n), detach(a), detach(s)), c && c.d(u), destroy_component(t, u), l && l.d(u);
    }
  };
}
function create_fragment(r) {
  let e, t;
  return e = new Block({
    props: {
      visible: (
        /*visible*/
        r[3]
      ),
      elem_id: (
        /*elem_id*/
        r[1]
      ),
      elem_classes: (
        /*elem_classes*/
        r[2]
      ),
      container: (
        /*container*/
        r[8]
      ),
      scale: (
        /*scale*/
        r[9]
      ),
      min_width: (
        /*min_width*/
        r[10]
      ),
      height: (
        /*height*/
        r[6]
      ),
      $$slots: { default: [create_default_slot] },
      $$scope: { ctx: r }
    }
  }), {
    c() {
      create_component(e.$$.fragment);
    },
    m(n, a) {
      mount_component(e, n, a), t = !0;
    },
    p(n, a) {
      const s = {};
      a[0] & /*visible*/
      8 && (s.visible = /*visible*/
      n[3]), a[0] & /*elem_id*/
      2 && (s.elem_id = /*elem_id*/
      n[1]), a[0] & /*elem_classes*/
      4 && (s.elem_classes = /*elem_classes*/
      n[2]), a[0] & /*container*/
      256 && (s.container = /*container*/
      n[8]), a[0] & /*scale*/
      512 && (s.scale = /*scale*/
      n[9]), a[0] & /*min_width*/
      1024 && (s.min_width = /*min_width*/
      n[10]), a[0] & /*height*/
      64 && (s.height = /*height*/
      n[6]), a[0] & /*value, files_with_original_ext, n, viewer, blinking, file, gradio, loading_status*/
      30897 | a[1] & /*$$scope*/
      128 && (s.$$scope = { dirty: a, ctx: n }), e.$set(s);
    },
    i(n) {
      t || (transition_in(e.$$.fragment, n), t = !0);
    },
    o(n) {
      transition_out(e.$$.fragment, n), t = !1;
    },
    d(n) {
      destroy_component(e, n);
    }
  };
}
function add_url(r, e) {
  return console.log("Add url en cours"), console.log(e), console.log(r), r && (r.url = e + "/file=" + r.path), r;
}
function instance(r, e, t) {
  var n = this && this.__awaiter || function(v, L, H, B) {
    function U(Z) {
      return Z instanceof H ? Z : new H(function(re) {
        re(Z);
      });
    }
    return new (H || (H = Promise))(function(Z, re) {
      function pe(_e) {
        try {
          Se(B.next(_e));
        } catch (we) {
          re(we);
        }
      }
      function be(_e) {
        try {
          Se(B.throw(_e));
        } catch (we) {
          re(we);
        }
      }
      function Se(_e) {
        _e.done ? Z(_e.value) : U(_e.value).then(pe, be);
      }
      Se((B = B.apply(v, L || [])).next());
    });
  };
  pdfExports.GlobalWorkerOptions.workerSrc = "https://cdnjs.cloudflare.com/ajax/libs/pdf.js/3.11.174/pdf.worker.min.js";
  let { elem_id: a = "" } = e, { elem_classes: s = [] } = e, { visible: o = !0 } = e, { value: c } = e, { n: l = 0 } = e, { files_with_original_ext: u } = e, { interface_language: h = "fr" } = e, { interactive: d = !1 } = e, { root: w } = e, { label: b = null } = e, { show_label: _ = !1 } = e, { height: R } = e, { _selectable: k = !1 } = e, { loading_status: C } = e, { container: m = !0 } = e, { scale: A = null } = e, { min_width: F = void 0 } = e, { gradio: f } = e, g, y = null, E = [], x, O;
  const P = [".html", ".svg"], I = [".png", ".jpg", ".jpeg"], G = [".md", ".txt"], ne = [
    ".py",
    ".js",
    ".css",
    ".json",
    ".yaml",
    ".yml",
    ".xml",
    ".sh",
    ".bash",
    ".log",
    ".ts",
    ".tsx",
    ".js",
    ".jsx",
    ".cpp"
  ];
  Array.isArray(c) ? g = c[l] : g = c;
  function X() {
    return n(this, void 0, void 0, function* () {
      yield tick(), t(14, O.innerHTML = "", O);
      const v = h.startsWith("fr") ? "Format non pris en charge" : "Unsupported format";
      t(14, O.innerHTML = `<div class="error-message">${v}</div>`, O);
    });
  }
  function ee(v) {
    return n(this, void 0, void 0, function* () {
      console.log("Get doc en cours"), yield tick(), t(14, O.innerHTML = "", O), t(13, x.style.display = "block", x);
      const H = yield pdfExports.getDocument(v.url).promise;
      console.log("PDF loaded");
      const B = document.createDocumentFragment(), U = (re) => n(this, void 0, void 0, function* () {
        const pe = yield H.getPage(re);
        console.log(`Page ${re} loaded`);
        const Se = pe.getViewport({ scale: 1.5 }), _e = document.createElement("canvas");
        _e.height = Se.height, _e.width = Se.width, B.appendChild(_e);
        const oe = { canvasContext: _e.getContext("2d"), viewport: Se }, le = pe.render(oe);
        E.push(le), yield le.promise, console.log(`Page ${re} rendered`);
      }), Z = [];
      for (let re = 1; re <= H.numPages; re++)
        Z.push(U(re));
      yield Promise.all(Z), O.appendChild(B), t(13, x.style.display = "none", x);
    });
  }
  function K(v) {
    return n(this, void 0, void 0, function* () {
      yield tick(), t(14, O.innerHTML = "", O), t(13, x.style.display = "block", x);
      try {
        const L = yield fetch(v.url);
        if (!L.ok)
          throw new Error(`HTTP error! status: ${L.status}`);
        const H = yield L.text(), B = document.createElement("iframe");
        B.style.width = "100%", B.style.height = "100%", B.srcdoc = H, O.appendChild(B);
      } catch (L) {
        console.error("Error fetching HTML content:", L);
      }
      t(13, x.style.display = "none", x);
    });
  }
  function se(v) {
    return n(this, void 0, void 0, function* () {
      yield tick(), t(14, O.innerHTML = "", O), t(13, x.style.display = "block", x);
      try {
        const L = yield fetch(v.url);
        if (!L.ok)
          throw new Error(`HTTP error! status: ${L.status}`);
        const H = yield L.blob(), B = URL.createObjectURL(H), U = document.createElement("img");
        U.style.width = "100%", U.src = B, O.appendChild(U);
      } catch (L) {
        console.error("Error fetching image content:", L);
      }
      t(13, x.style.display = "none", x);
    });
  }
  function q(v) {
    return n(this, void 0, void 0, function* () {
      yield tick(), t(14, O.innerHTML = "", O), t(13, x.style.display = "block", x);
      try {
        const L = yield fetch(v.url);
        if (!L.ok)
          throw new Error(`HTTP error! status: ${L.status}`);
        let H = yield L.text();
        const B = v.path.match(/\.(\w+)$/);
        if (B) {
          const U = B[1];
          console.log(U), ne.includes(`.${U}`) && (H = `\`\`\`${U}
${H}
\`\`\``);
        }
        new Markdown({
          target: O,
          props: { value: H }
        });
      } catch (L) {
        console.error("Error fetching Markdown content:", L);
      }
      t(13, x.style.display = "none", x);
    });
  }
  function Y() {
    return n(this, void 0, void 0, function* () {
      yield tick(), t(13, x.style.display = "none", x), E.forEach((v) => v.cancel()), E = [], console.log("Bouton cliqué !"), t(0, l = (l + 1) % c.length);
    });
  }
  function J() {
    return n(this, void 0, void 0, function* () {
      yield tick(), t(13, x.style.display = "none", x), E.forEach((v) => v.cancel()), E = [], console.log("Bouton cliqué !"), t(0, l = (l - 1 + c.length) % c.length), console.log(l);
    });
  }
  function N(v) {
    binding_callbacks[v ? "unshift" : "push"](() => {
      x = v, t(13, x);
    });
  }
  function M(v) {
    binding_callbacks[v ? "unshift" : "push"](() => {
      O = v, t(14, O);
    });
  }
  return r.$$set = (v) => {
    "elem_id" in v && t(1, a = v.elem_id), "elem_classes" in v && t(2, s = v.elem_classes), "visible" in v && t(3, o = v.visible), "value" in v && t(4, c = v.value), "n" in v && t(0, l = v.n), "files_with_original_ext" in v && t(5, u = v.files_with_original_ext), "interface_language" in v && t(17, h = v.interface_language), "interactive" in v && t(18, d = v.interactive), "root" in v && t(19, w = v.root), "label" in v && t(20, b = v.label), "show_label" in v && t(21, _ = v.show_label), "height" in v && t(6, R = v.height), "_selectable" in v && t(22, k = v._selectable), "loading_status" in v && t(7, C = v.loading_status), "container" in v && t(8, m = v.container), "scale" in v && t(9, A = v.scale), "min_width" in v && t(10, F = v.min_width), "gradio" in v && t(11, f = v.gradio);
  }, r.$$.update = () => {
    r.$$.dirty[0] & /*value, old_file, n, gradio, root, file*/
    8919057 && c && JSON.stringify(y) !== JSON.stringify(c[l]) && (console.log(`value ${c}`), f.dispatch("change"), t(23, y = c[l]), t(12, g = add_url(c[l], w)), g && (g.path.endsWith("pdf") ? ee(g) : P.some((v) => g.path.endsWith(v)) ? (console.log("HTML"), K(g)) : I.some((v) => g.path.endsWith(v)) ? (console.log("Image"), se(g)) : G.some((v) => g.path.endsWith(v)) || ne.some((v) => g.path.endsWith(v)) ? (console.log("Markdown"), q(g)) : (console.log("Autre"), X())));
  }, [
    l,
    a,
    s,
    o,
    c,
    u,
    R,
    C,
    m,
    A,
    F,
    f,
    g,
    x,
    O,
    Y,
    J,
    h,
    d,
    w,
    b,
    _,
    k,
    y,
    N,
    M
  ];
}
class Index extends SvelteComponent {
  constructor(e) {
    super(), init(
      this,
      e,
      instance,
      create_fragment,
      safe_not_equal,
      {
        elem_id: 1,
        elem_classes: 2,
        visible: 3,
        value: 4,
        n: 0,
        files_with_original_ext: 5,
        interface_language: 17,
        interactive: 18,
        root: 19,
        label: 20,
        show_label: 21,
        height: 6,
        _selectable: 22,
        loading_status: 7,
        container: 8,
        scale: 9,
        min_width: 10,
        gradio: 11
      },
      null,
      [-1, -1]
    );
  }
  get elem_id() {
    return this.$$.ctx[1];
  }
  set elem_id(e) {
    this.$$set({ elem_id: e }), flush();
  }
  get elem_classes() {
    return this.$$.ctx[2];
  }
  set elem_classes(e) {
    this.$$set({ elem_classes: e }), flush();
  }
  get visible() {
    return this.$$.ctx[3];
  }
  set visible(e) {
    this.$$set({ visible: e }), flush();
  }
  get value() {
    return this.$$.ctx[4];
  }
  set value(e) {
    this.$$set({ value: e }), flush();
  }
  get n() {
    return this.$$.ctx[0];
  }
  set n(e) {
    this.$$set({ n: e }), flush();
  }
  get files_with_original_ext() {
    return this.$$.ctx[5];
  }
  set files_with_original_ext(e) {
    this.$$set({ files_with_original_ext: e }), flush();
  }
  get interface_language() {
    return this.$$.ctx[17];
  }
  set interface_language(e) {
    this.$$set({ interface_language: e }), flush();
  }
  get interactive() {
    return this.$$.ctx[18];
  }
  set interactive(e) {
    this.$$set({ interactive: e }), flush();
  }
  get root() {
    return this.$$.ctx[19];
  }
  set root(e) {
    this.$$set({ root: e }), flush();
  }
  get label() {
    return this.$$.ctx[20];
  }
  set label(e) {
    this.$$set({ label: e }), flush();
  }
  get show_label() {
    return this.$$.ctx[21];
  }
  set show_label(e) {
    this.$$set({ show_label: e }), flush();
  }
  get height() {
    return this.$$.ctx[6];
  }
  set height(e) {
    this.$$set({ height: e }), flush();
  }
  get _selectable() {
    return this.$$.ctx[22];
  }
  set _selectable(e) {
    this.$$set({ _selectable: e }), flush();
  }
  get loading_status() {
    return this.$$.ctx[7];
  }
  set loading_status(e) {
    this.$$set({ loading_status: e }), flush();
  }
  get container() {
    return this.$$.ctx[8];
  }
  set container(e) {
    this.$$set({ container: e }), flush();
  }
  get scale() {
    return this.$$.ctx[9];
  }
  set scale(e) {
    this.$$set({ scale: e }), flush();
  }
  get min_width() {
    return this.$$.ctx[10];
  }
  set min_width(e) {
    this.$$set({ min_width: e }), flush();
  }
  get gradio() {
    return this.$$.ctx[11];
  }
  set gradio(e) {
    this.$$set({ gradio: e }), flush();
  }
}
export {
  Index as default
};
