@mlightcad/mtext-renderer 0.11.2 → 0.11.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -397,7 +397,7 @@ function oo() {
397
397
  IDBCursor.prototype.continuePrimaryKey
398
398
  ]);
399
399
  }
400
- const yr = /* @__PURE__ */ new WeakMap(), Vn = /* @__PURE__ */ new WeakMap(), Un = /* @__PURE__ */ new WeakMap();
400
+ const yr = /* @__PURE__ */ new WeakMap(), Wn = /* @__PURE__ */ new WeakMap(), Un = /* @__PURE__ */ new WeakMap();
401
401
  function co(t) {
402
402
  const e = new Promise((n, r) => {
403
403
  const s = () => {
@@ -459,10 +459,10 @@ function ho(t) {
459
459
  function St(t) {
460
460
  if (t instanceof IDBRequest)
461
461
  return co(t);
462
- if (Vn.has(t))
463
- return Vn.get(t);
462
+ if (Wn.has(t))
463
+ return Wn.get(t);
464
464
  const e = ho(t);
465
- return e !== t && (Vn.set(t, e), Un.set(e, t)), e;
465
+ return e !== t && (Wn.set(t, e), Un.set(e, t)), e;
466
466
  }
467
467
  const xr = (t) => Un.get(t);
468
468
  function fo(t, e, { blocked: n, upgrade: r, blocking: s, terminated: i } = {}) {
@@ -479,12 +479,12 @@ function fo(t, e, { blocked: n, upgrade: r, blocking: s, terminated: i } = {}) {
479
479
  }).catch(() => {
480
480
  }), o;
481
481
  }
482
- const po = ["get", "getKey", "getAll", "getAllKeys", "count"], go = ["put", "add", "delete", "clear"], Wn = /* @__PURE__ */ new Map();
482
+ const po = ["get", "getKey", "getAll", "getAllKeys", "count"], go = ["put", "add", "delete", "clear"], Vn = /* @__PURE__ */ new Map();
483
483
  function cs(t, e) {
484
484
  if (!(t instanceof IDBDatabase && !(e in t) && typeof e == "string"))
485
485
  return;
486
- if (Wn.get(e))
487
- return Wn.get(e);
486
+ if (Vn.get(e))
487
+ return Vn.get(e);
488
488
  const n = e.replace(/FromIndex$/, ""), r = e !== n, s = go.includes(n);
489
489
  if (
490
490
  // Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.
@@ -499,7 +499,7 @@ function cs(t, e) {
499
499
  s && c.done
500
500
  ]))[0];
501
501
  };
502
- return Wn.set(e, i), i;
502
+ return Vn.set(e, i), i;
503
503
  }
504
504
  Ni((t) => ({
505
505
  ...t,
@@ -717,7 +717,7 @@ function jt() {
717
717
  function xo(t, e) {
718
718
  this.source = t, this.sourceIndex = 0, this.tag = 0, this.bitcount = 0, this.dest = e, this.destLen = 0, this.ltree = new jt(), this.dtree = new jt();
719
719
  }
720
- var zi = new jt(), Vi = new jt(), Mr = new Uint8Array(30), Ur = new Uint16Array(30), Wi = new Uint8Array(30), ji = new Uint16Array(30), vo = new Uint8Array([
720
+ var zi = new jt(), Wi = new jt(), Mr = new Uint8Array(30), Ur = new Uint16Array(30), Vi = new Uint8Array(30), ji = new Uint16Array(30), vo = new Uint8Array([
721
721
  16,
722
722
  17,
723
723
  18,
@@ -826,7 +826,7 @@ function ds(t, e, n) {
826
826
  t.dest[t.destLen++] = r;
827
827
  else {
828
828
  var s, i, a, o;
829
- for (r -= 257, s = Ye(t, Mr[r], Ur[r]), i = wr(t, n), a = t.destLen - Ye(t, Wi[i], ji[i]), o = a; o < a + s; ++o)
829
+ for (r -= 257, s = Ye(t, Mr[r], Ur[r]), i = wr(t, n), a = t.destLen - Ye(t, Vi[i], ji[i]), o = a; o < a + s; ++o)
830
830
  t.dest[t.destLen++] = t.dest[o];
831
831
  }
832
832
  }
@@ -848,7 +848,7 @@ function $i(t, e) {
848
848
  i = To(n);
849
849
  break;
850
850
  case 1:
851
- i = ds(n, zi, Vi);
851
+ i = ds(n, zi, Wi);
852
852
  break;
853
853
  case 2:
854
854
  Co(n, n.ltree, n.dtree), i = ds(n, n.ltree, n.dtree);
@@ -861,9 +861,9 @@ function $i(t, e) {
861
861
  } while (!r);
862
862
  return n.destLen < n.dest.length ? typeof n.dest.slice == "function" ? n.dest.slice(0, n.destLen) : n.dest.subarray(0, n.destLen) : n.dest;
863
863
  }
864
- So(zi, Vi);
864
+ So(zi, Wi);
865
865
  qi(Mr, Ur, 4, 3);
866
- qi(Wi, ji, 2, 1);
866
+ qi(Vi, ji, 2, 1);
867
867
  Mr[28] = 0;
868
868
  Ur[28] = 258;
869
869
  function Ft(t, e, n, r, s) {
@@ -1637,7 +1637,7 @@ D.LITERAL = function(t) {
1637
1637
  z.LITERAL = function(t) {
1638
1638
  return t.length;
1639
1639
  };
1640
- function he(t, e, n) {
1640
+ function fe(t, e, n) {
1641
1641
  if (e && e.length)
1642
1642
  for (let r = 0; r < e.length; r += 1) {
1643
1643
  const s = e[r];
@@ -1651,10 +1651,10 @@ function he(t, e, n) {
1651
1651
  }
1652
1652
  }
1653
1653
  }
1654
- he.prototype.encode = function() {
1654
+ fe.prototype.encode = function() {
1655
1655
  return D.TABLE(this);
1656
1656
  };
1657
- he.prototype.sizeOf = function() {
1657
+ fe.prototype.sizeOf = function() {
1658
1658
  return z.TABLE(this);
1659
1659
  };
1660
1660
  function Mt(t, e, n) {
@@ -1681,11 +1681,11 @@ function Ut(t, e, n) {
1681
1681
  return s;
1682
1682
  }
1683
1683
  function wn(t) {
1684
- t.format === 1 ? he.call(
1684
+ t.format === 1 ? fe.call(
1685
1685
  this,
1686
1686
  "coverageTable",
1687
1687
  [{ name: "coverageFormat", type: "USHORT", value: 1 }].concat(Mt("glyph", t.glyphs))
1688
- ) : t.format === 2 ? he.call(
1688
+ ) : t.format === 2 ? fe.call(
1689
1689
  this,
1690
1690
  "coverageTable",
1691
1691
  [{ name: "coverageFormat", type: "USHORT", value: 2 }].concat(Ut("rangeRecord", t.ranges, function(e, n) {
@@ -1697,10 +1697,10 @@ function wn(t) {
1697
1697
  }))
1698
1698
  ) : H.assert(!1, "Coverage format must be 1 or 2.");
1699
1699
  }
1700
- wn.prototype = Object.create(he.prototype);
1700
+ wn.prototype = Object.create(fe.prototype);
1701
1701
  wn.prototype.constructor = wn;
1702
1702
  function Cn(t) {
1703
- he.call(
1703
+ fe.call(
1704
1704
  this,
1705
1705
  "scriptListTable",
1706
1706
  Ut("scriptRecord", t, function(e, n) {
@@ -1708,8 +1708,8 @@ function Cn(t) {
1708
1708
  let s = r.defaultLangSys;
1709
1709
  return H.assert(!!s, "Unable to write GSUB: script " + e.tag + " has no default language system."), [
1710
1710
  { name: "scriptTag" + n, type: "TAG", value: e.tag },
1711
- { name: "script" + n, type: "TABLE", value: new he("scriptTable", [
1712
- { name: "defaultLangSys", type: "TABLE", value: new he("defaultLangSys", [
1711
+ { name: "script" + n, type: "TABLE", value: new fe("scriptTable", [
1712
+ { name: "defaultLangSys", type: "TABLE", value: new fe("defaultLangSys", [
1713
1713
  { name: "lookupOrder", type: "USHORT", value: 0 },
1714
1714
  { name: "reqFeatureIndex", type: "USHORT", value: s.reqFeatureIndex }
1715
1715
  ].concat(Mt("featureIndex", s.featureIndexes))) }
@@ -1717,7 +1717,7 @@ function Cn(t) {
1717
1717
  const o = i.langSys;
1718
1718
  return [
1719
1719
  { name: "langSysTag" + a, type: "TAG", value: i.tag },
1720
- { name: "langSys" + a, type: "TABLE", value: new he("langSys", [
1720
+ { name: "langSys" + a, type: "TABLE", value: new fe("langSys", [
1721
1721
  { name: "lookupOrder", type: "USHORT", value: 0 },
1722
1722
  { name: "reqFeatureIndex", type: "USHORT", value: o.reqFeatureIndex }
1723
1723
  ].concat(Mt("featureIndex", o.featureIndexes))) }
@@ -1727,45 +1727,45 @@ function Cn(t) {
1727
1727
  })
1728
1728
  );
1729
1729
  }
1730
- Cn.prototype = Object.create(he.prototype);
1730
+ Cn.prototype = Object.create(fe.prototype);
1731
1731
  Cn.prototype.constructor = Cn;
1732
1732
  function Tn(t) {
1733
- he.call(
1733
+ fe.call(
1734
1734
  this,
1735
1735
  "featureListTable",
1736
1736
  Ut("featureRecord", t, function(e, n) {
1737
1737
  const r = e.feature;
1738
1738
  return [
1739
1739
  { name: "featureTag" + n, type: "TAG", value: e.tag },
1740
- { name: "feature" + n, type: "TABLE", value: new he("featureTable", [
1740
+ { name: "feature" + n, type: "TABLE", value: new fe("featureTable", [
1741
1741
  { name: "featureParams", type: "USHORT", value: r.featureParams }
1742
1742
  ].concat(Mt("lookupListIndex", r.lookupListIndexes))) }
1743
1743
  ];
1744
1744
  })
1745
1745
  );
1746
1746
  }
1747
- Tn.prototype = Object.create(he.prototype);
1747
+ Tn.prototype = Object.create(fe.prototype);
1748
1748
  Tn.prototype.constructor = Tn;
1749
1749
  function kn(t, e) {
1750
- he.call(this, "lookupListTable", Tr("lookup", t, function(n) {
1750
+ fe.call(this, "lookupListTable", Tr("lookup", t, function(n) {
1751
1751
  let r = e[n.lookupType];
1752
- return H.assert(!!r, "Unable to write GSUB lookup type " + n.lookupType + " tables."), new he("lookupTable", [
1752
+ return H.assert(!!r, "Unable to write GSUB lookup type " + n.lookupType + " tables."), new fe("lookupTable", [
1753
1753
  { name: "lookupType", type: "USHORT", value: n.lookupType },
1754
1754
  { name: "lookupFlag", type: "USHORT", value: n.lookupFlag }
1755
1755
  ].concat(Tr("subtable", n.subtables, r)));
1756
1756
  }));
1757
1757
  }
1758
- kn.prototype = Object.create(he.prototype);
1758
+ kn.prototype = Object.create(fe.prototype);
1759
1759
  kn.prototype.constructor = kn;
1760
1760
  function Fn(t) {
1761
- t.format === 1 ? he.call(
1761
+ t.format === 1 ? fe.call(
1762
1762
  this,
1763
1763
  "classDefTable",
1764
1764
  [
1765
1765
  { name: "classFormat", type: "USHORT", value: 1 },
1766
1766
  { name: "startGlyphID", type: "USHORT", value: t.startGlyph }
1767
1767
  ].concat(Mt("glyph", t.classes))
1768
- ) : t.format === 2 ? he.call(
1768
+ ) : t.format === 2 ? fe.call(
1769
1769
  this,
1770
1770
  "classDefTable",
1771
1771
  [{ name: "classFormat", type: "USHORT", value: 2 }].concat(Ut("rangeRecord", t.ranges, function(e, n) {
@@ -1777,11 +1777,11 @@ function Fn(t) {
1777
1777
  }))
1778
1778
  ) : H.assert(!1, "Class format must be 1 or 2.");
1779
1779
  }
1780
- Fn.prototype = Object.create(he.prototype);
1780
+ Fn.prototype = Object.create(fe.prototype);
1781
1781
  Fn.prototype.constructor = Fn;
1782
1782
  var A = {
1783
- Table: he,
1784
- Record: he,
1783
+ Table: fe,
1784
+ Record: fe,
1785
1785
  Coverage: wn,
1786
1786
  ClassDef: Fn,
1787
1787
  ScriptList: Cn,
@@ -2316,8 +2316,8 @@ k.prototype.parseTupleVariationStore = function(t, e, n, r, s) {
2316
2316
  let _ = 0;
2317
2317
  if (n === "gvar") {
2318
2318
  if (_ = m.privatePoints.length || h.length, !_) {
2319
- const V = r.get(s);
2320
- V.path, _ = V.points.length, _ += 4;
2319
+ const W = r.get(s);
2320
+ W.path, _ = W.points.length, _ += 4;
2321
2321
  }
2322
2322
  } else n === "cvar" && (_ = r.length);
2323
2323
  this.offset = b, this.relativeOffset = v, T = this.parsePackedDeltas(_), n === "gvar" && (E = this.parsePackedDeltas(_));
@@ -3088,7 +3088,7 @@ var kr = "utf-16", zo = {
3088
3088
  // smVietnamese
3089
3089
  31: "x-mac-extarabic"
3090
3090
  // smExtArabic
3091
- }, Vo = {
3091
+ }, Wo = {
3092
3092
  15: "x-mac-icelandic",
3093
3093
  // langIcelandic
3094
3094
  17: "x-mac-turkish",
@@ -3125,7 +3125,7 @@ function Pr(t, e, n) {
3125
3125
  case 0:
3126
3126
  return kr;
3127
3127
  case 1:
3128
- return Vo[n] || zo[e];
3128
+ return Wo[n] || zo[e];
3129
3129
  case 3:
3130
3130
  if (e === 1 || e === 10)
3131
3131
  return kr;
@@ -3138,13 +3138,13 @@ var na = {
3138
3138
  2: "reserved",
3139
3139
  3: "windows"
3140
3140
  };
3141
- function Wo(t) {
3141
+ function Vo(t) {
3142
3142
  return na[t];
3143
3143
  }
3144
3144
  function jo(t, e, n) {
3145
3145
  const r = {}, s = new M.Parser(t, e), i = s.parseUShort(), a = s.parseUShort(), o = s.offset + s.parseUShort();
3146
3146
  for (let c = 0; c < a; c++) {
3147
- const l = s.parseUShort(), u = s.parseUShort(), h = s.parseUShort(), f = s.parseUShort(), p = On[f] || f, y = s.parseUShort(), m = s.parseUShort(), b = Ho(l, h, n), v = Pr(l, u, h), w = Wo(l);
3147
+ const l = s.parseUShort(), u = s.parseUShort(), h = s.parseUShort(), f = s.parseUShort(), p = On[f] || f, y = s.parseUShort(), m = s.parseUShort(), b = Ho(l, h, n), v = Pr(l, u, h), w = Vo(l);
3148
3148
  if (v !== void 0 && b !== void 0 && w !== void 0) {
3149
3149
  let C;
3150
3150
  if (v === kr ? C = Bt.UTF16(t, o + m, y) : C = Bt.MACSTRING(t, o + m, y, v), C) {
@@ -5743,7 +5743,7 @@ function Hr(t, e, n, r) {
5743
5743
  }
5744
5744
  return Cc(i);
5745
5745
  }
5746
- function Vt(t, e) {
5746
+ function Wt(t, e) {
5747
5747
  return e <= 390 ? e = dn[e] : t ? e = t[e - 391] : e = void 0, e;
5748
5748
  }
5749
5749
  function zr(t, e, n) {
@@ -5755,10 +5755,10 @@ function zr(t, e, n) {
5755
5755
  const o = [];
5756
5756
  o.length = a.type.length;
5757
5757
  for (let c = 0; c < a.type.length; c++)
5758
- s = t[a.op] !== void 0 ? t[a.op][c] : void 0, s === void 0 && (s = a.value !== void 0 && a.value[c] !== void 0 ? a.value[c] : null), a.type[c] === "SID" && (s = Vt(n, s)), o[c] = s;
5758
+ s = t[a.op] !== void 0 ? t[a.op][c] : void 0, s === void 0 && (s = a.value !== void 0 && a.value[c] !== void 0 ? a.value[c] : null), a.type[c] === "SID" && (s = Wt(n, s)), o[c] = s;
5759
5759
  r[a.name] = o;
5760
5760
  } else
5761
- s = t[a.op], s === void 0 && (s = a.value !== void 0 ? a.value : null), a.type === "SID" && (s = Vt(n, s)), r[a.name] = s;
5761
+ s = t[a.op], s === void 0 && (s = a.value !== void 0 ? a.value : null), a.type === "SID" && (s = Wt(n, s)), r[a.name] = s;
5762
5762
  }
5763
5763
  return r;
5764
5764
  }
@@ -5843,7 +5843,7 @@ function Oc(t, e, n, r) {
5843
5843
  const s = Hr(t, e, t.byteLength, r);
5844
5844
  return zr(s, r > 1 ? kc : fa, n);
5845
5845
  }
5846
- function Vr(t, e, n, r, s) {
5846
+ function Wr(t, e, n, r, s) {
5847
5847
  const i = Hr(t, e, n, s);
5848
5848
  return zr(i, s > 1 ? Fc : pa, r);
5849
5849
  }
@@ -5856,7 +5856,7 @@ function Lc(t, e, n) {
5856
5856
  for (let s = 0; s < n.length; s++) {
5857
5857
  const i = new DataView(new Uint8Array(n[s]).buffer), a = Ac(i, 0, 2), o = a.private[0], c = a.private[1];
5858
5858
  if (o !== 0 && c !== 0) {
5859
- const l = Vr(t, c + e, o, [], 2);
5859
+ const l = Wr(t, c + e, o, [], 2);
5860
5860
  if (l.subrs) {
5861
5861
  const u = c + l.subrs, h = $e(t, u + e, void 0, 2);
5862
5862
  a._subrs = h.objects, a._subrsBias = In(a._subrs);
@@ -5874,7 +5874,7 @@ function Yn(t, e, n, r, s) {
5874
5874
  c._subrs = [], c._subrsBias = 0, c._defaultWidthX = 0, c._nominalWidthX = 0;
5875
5875
  const l = s < 2 ? c.private[0] : 0, u = s < 2 ? c.private[1] : 0;
5876
5876
  if (l !== 0 && u !== 0) {
5877
- const h = Vr(t, u + e, l, r, s);
5877
+ const h = Wr(t, u + e, l, r, s);
5878
5878
  if (c._defaultWidthX = h.defaultWidthX, c._nominalWidthX = h.nominalWidthX, h.subrs !== 0) {
5879
5879
  const f = u + h.subrs, p = $e(t, f + e, void 0, s);
5880
5880
  c._subrs = p.objects, c._subrsBias = In(c._subrs);
@@ -5892,18 +5892,18 @@ function Ic(t, e, n, r, s) {
5892
5892
  const c = [".notdef"], l = o.parseCard8();
5893
5893
  if (l === 0)
5894
5894
  for (let u = 0; u < n; u += 1)
5895
- i = o.parseSID(), s ? c.push(i) : c.push(Vt(r, i) || i);
5895
+ i = o.parseSID(), s ? c.push(i) : c.push(Wt(r, i) || i);
5896
5896
  else if (l === 1)
5897
5897
  for (; c.length <= n; ) {
5898
5898
  i = o.parseSID(), a = o.parseCard8();
5899
5899
  for (let u = 0; u <= a; u += 1)
5900
- s ? c.push("cid" + ("00000" + i).slice(-5)) : c.push(Vt(r, i) || i), i += 1;
5900
+ s ? c.push("cid" + ("00000" + i).slice(-5)) : c.push(Wt(r, i) || i), i += 1;
5901
5901
  }
5902
5902
  else if (l === 2)
5903
5903
  for (; c.length <= n; ) {
5904
5904
  i = o.parseSID(), a = o.parseCard16();
5905
5905
  for (let u = 0; u <= a; u += 1)
5906
- s ? c.push("cid" + ("00000" + i).slice(-5)) : c.push(Vt(r, i) || i), i += 1;
5906
+ s ? c.push("cid" + ("00000" + i).slice(-5)) : c.push(Wt(r, i) || i), i += 1;
5907
5907
  }
5908
5908
  else
5909
5909
  throw new Error("Unknown charset format " + l);
@@ -5941,14 +5941,14 @@ function Er(t, e, n, r, s) {
5941
5941
  let i, a, o, c;
5942
5942
  const l = new Dt(), u = [];
5943
5943
  let h = 0, f = !1, p = !1, y = 0, m = 0, b, v, w, C, T = 0, E = [], I, _ = 0;
5944
- const V = t.tables.cff2 || t.tables.cff;
5945
- if (w = V.topDict._defaultWidthX, C = V.topDict._nominalWidthX, s = s || t.variation && t.variation.get(), e.getBlendPath || (e.getBlendPath = function(B) {
5944
+ const W = t.tables.cff2 || t.tables.cff;
5945
+ if (w = W.topDict._defaultWidthX, C = W.topDict._nominalWidthX, s = s || t.variation && t.variation.get(), e.getBlendPath || (e.getBlendPath = function(B) {
5946
5946
  return Er(t, e, n, r, B);
5947
5947
  }), t.isCIDFont || r > 1) {
5948
- const B = V.topDict._fdSelect ? V.topDict._fdSelect[e.index] : 0, U = V.topDict._fdArray[B];
5949
- b = U._subrs, v = U._subrsBias, r > 1 ? (E = V.topDict._vstore.itemVariationStore, T = U._privateDict.vsindex) : (w = U._defaultWidthX, C = U._nominalWidthX);
5948
+ const B = W.topDict._fdSelect ? W.topDict._fdSelect[e.index] : 0, U = W.topDict._fdArray[B];
5949
+ b = U._subrs, v = U._subrsBias, r > 1 ? (E = W.topDict._vstore.itemVariationStore, T = U._privateDict.vsindex) : (w = U._defaultWidthX, C = U._nominalWidthX);
5950
5950
  } else
5951
- b = V.topDict._subrs, v = V.topDict._subrsBias;
5951
+ b = W.topDict._subrs, v = W.topDict._subrsBias;
5952
5952
  const $ = da(t, l);
5953
5953
  let G = w;
5954
5954
  function q(B, U) {
@@ -5959,7 +5959,7 @@ function Er(t, e, n, r, s) {
5959
5959
  B = (u.length & 1) !== 0, B && !f && (G = u.shift() + C), h += u.length >> 1, u.length = 0, f = !0;
5960
5960
  }
5961
5961
  function P(B) {
5962
- let U, te, Te, Qe, Me, ue, Y, ee, pe, be, ge, me, ae = 0;
5962
+ let U, te, Te, Qe, Me, he, Y, ee, pe, be, ge, me, ae = 0;
5963
5963
  for (; ae < B.length; ) {
5964
5964
  let ve = B[ae];
5965
5965
  switch (ae += 1, ve) {
@@ -5989,12 +5989,12 @@ function Er(t, e, n, r, s) {
5989
5989
  i = y + u.shift(), a = m + u.shift(), o = i + u.shift(), c = a + u.shift(), y = o + u.shift(), m = c + u.shift(), l.curveTo(i, a, o, c, y, m);
5990
5990
  break;
5991
5991
  case 10:
5992
- if (Me = u.pop() + v, ue = b[Me], ue) {
5992
+ if (Me = u.pop() + v, he = b[Me], he) {
5993
5993
  if (_ >= ws) {
5994
5994
  console.warn("CFF charstring subroutine call depth exceeded, skipping callsubr");
5995
5995
  break;
5996
5996
  }
5997
- _++, P(ue), _--;
5997
+ _++, P(he), _--;
5998
5998
  }
5999
5999
  break;
6000
6000
  case 11:
@@ -6042,8 +6042,8 @@ function Er(t, e, n, r, s) {
6042
6042
  }), l.extend(t.glyphs.get(F).path);
6043
6043
  const O = t.glyphs.get(S), L = JSON.parse(JSON.stringify(O.path.commands));
6044
6044
  for (let j = 0; j < L.length; j += 1) {
6045
- const W = L[j];
6046
- W.type !== "Z" && (W.x += g, W.y += d), (W.type === "Q" || W.type === "C") && (W.x1 += g, W.y1 += d), W.type === "C" && (W.x2 += g, W.y2 += d);
6045
+ const V = L[j];
6046
+ V.type !== "Z" && (V.x += g, V.y += d), (V.type === "Q" || V.type === "C") && (V.x1 += g, V.y1 += d), V.type === "C" && (V.x2 += g, V.y2 += d);
6047
6047
  }
6048
6048
  l.extend(L);
6049
6049
  }
@@ -6112,12 +6112,12 @@ function Er(t, e, n, r, s) {
6112
6112
  U = B[ae], te = B[ae + 1], u.push((U << 24 | te << 16) >> 16), ae += 2;
6113
6113
  break;
6114
6114
  case 29:
6115
- if (Me = u.pop() + t.gsubrsBias, ue = t.gsubrs[Me], ue) {
6115
+ if (Me = u.pop() + t.gsubrsBias, he = t.gsubrs[Me], he) {
6116
6116
  if (_ >= ws) {
6117
6117
  console.warn("CFF charstring subroutine call depth exceeded, skipping callgsubr");
6118
6118
  break;
6119
6119
  }
6120
- _++, P(ue), _--;
6120
+ _++, P(he), _--;
6121
6121
  }
6122
6122
  break;
6123
6123
  case 30:
@@ -6204,7 +6204,7 @@ function Bc(t, e, n, r) {
6204
6204
  u._fdArray = m, p += e, u._fdSelect = Cs(t, p, n.numGlyphs, m.length, i.formatMajor);
6205
6205
  }
6206
6206
  if (i.formatMajor < 2) {
6207
- const f = e + u.private[1], p = Vr(t, f, u.private[0], c.objects, i.formatMajor);
6207
+ const f = e + u.private[1], p = Wr(t, f, u.private[0], c.objects, i.formatMajor);
6208
6208
  if (n.defaultWidthX = p.defaultWidthX, n.nominalWidthX = p.nominalWidthX, p.subrs !== 0) {
6209
6209
  const y = f + p.subrs, m = $e(t, y);
6210
6210
  n.subrs = m.objects, n.subrsBias = In(n.subrs);
@@ -6342,7 +6342,7 @@ function zc(t, e, n) {
6342
6342
  ]);
6343
6343
  return r.dict = ma(pa, t, e), r;
6344
6344
  }
6345
- function Vc(t, e) {
6345
+ function Wc(t, e) {
6346
6346
  const n = new A.Table("CFF ", [
6347
6347
  { name: "header", type: "RECORD" },
6348
6348
  { name: "nameIndex", type: "RECORD" },
@@ -6376,8 +6376,8 @@ function Vc(t, e) {
6376
6376
  const h = n.header.sizeOf() + n.nameIndex.sizeOf() + n.topDictIndex.sizeOf() + n.stringIndex.sizeOf() + n.globalSubrIndex.sizeOf();
6377
6377
  return s.charset = h, s.encoding = 0, s.charStrings = s.charset + n.charsets.sizeOf(), s.private[1] = s.charStrings + n.charStringsIndex.sizeOf(), u = Ts(s, l), n.topDictIndex = ks(u), n;
6378
6378
  }
6379
- var Or = { parse: Bc, make: Vc };
6380
- function Wc(t, e) {
6379
+ var Or = { parse: Bc, make: Wc };
6380
+ function Vc(t, e) {
6381
6381
  const n = {}, r = new M.Parser(t, e);
6382
6382
  return n.version = r.parseVersion(), n.fontRevision = Math.round(r.parseFixed() * 1e3) / 1e3, n.checkSumAdjustment = r.parseULong(), n.magicNumber = r.parseULong(), H.argument(n.magicNumber === 1594834165, "Font header has wrong magic number."), n.flags = r.parseUShort(), n.unitsPerEm = r.parseUShort(), n.created = r.parseLongDateTime(), n.modified = r.parseLongDateTime(), n.xMin = r.parseShort(), n.yMin = r.parseShort(), n.xMax = r.parseShort(), n.yMax = r.parseShort(), n.macStyle = r.parseUShort(), n.lowestRecPPEM = r.parseUShort(), n.fontDirectionHint = r.parseShort(), n.indexToLocFormat = r.parseShort(), n.glyphDataFormat = r.parseShort(), n;
6383
6383
  }
@@ -6404,7 +6404,7 @@ function jc(t) {
6404
6404
  { name: "glyphDataFormat", type: "SHORT", value: 0 }
6405
6405
  ], t);
6406
6406
  }
6407
- var ya = { parse: Wc, make: jc };
6407
+ var ya = { parse: Vc, make: jc };
6408
6408
  function qc(t, e) {
6409
6409
  const n = {}, r = new M.Parser(t, e);
6410
6410
  return n.version = r.parseVersion(), n.ascender = r.parseShort(), n.descender = r.parseShort(), n.lineGap = r.parseShort(), n.advanceWidthMax = r.parseUShort(), n.minLeftSideBearing = r.parseShort(), n.minRightSideBearing = r.parseShort(), n.xMaxExtent = r.parseShort(), n.caretSlopeRise = r.parseShort(), n.caretSlopeRun = r.parseShort(), n.caretOffset = r.parseShort(), r.relativeOffset += 8, n.metricDataFormat = r.parseShort(), n.numberOfHMetrics = r.parseUShort(), n;
@@ -6862,8 +6862,8 @@ function al(t) {
6862
6862
  { name: "maxMemType1", type: "ULONG", value: c }
6863
6863
  ]);
6864
6864
  }
6865
- var wa = { parse: il, make: al }, Ve = new Array(9);
6866
- Ve[1] = function() {
6865
+ var wa = { parse: il, make: al }, We = new Array(9);
6866
+ We[1] = function() {
6867
6867
  const e = this.offset + this.relativeOffset, n = this.parseUShort();
6868
6868
  if (n === 1)
6869
6869
  return {
@@ -6879,7 +6879,7 @@ Ve[1] = function() {
6879
6879
  };
6880
6880
  H.assert(!1, "0x" + e.toString(16) + ": lookup type 1 format must be 1 or 2.");
6881
6881
  };
6882
- Ve[2] = function() {
6882
+ We[2] = function() {
6883
6883
  const e = this.parseUShort();
6884
6884
  return H.argument(e === 1, "GSUB Multiple Substitution Subtable identifier-format must be 1"), {
6885
6885
  substFormat: e,
@@ -6887,7 +6887,7 @@ Ve[2] = function() {
6887
6887
  sequences: this.parseListOfLists()
6888
6888
  };
6889
6889
  };
6890
- Ve[3] = function() {
6890
+ We[3] = function() {
6891
6891
  const e = this.parseUShort();
6892
6892
  return H.argument(e === 1, "GSUB Alternate Substitution Subtable identifier-format must be 1"), {
6893
6893
  substFormat: e,
@@ -6895,7 +6895,7 @@ Ve[3] = function() {
6895
6895
  alternateSets: this.parseListOfLists()
6896
6896
  };
6897
6897
  };
6898
- Ve[4] = function() {
6898
+ We[4] = function() {
6899
6899
  const e = this.parseUShort();
6900
6900
  return H.argument(e === 1, "GSUB ligature table identifier-format must be 1"), {
6901
6901
  substFormat: e,
@@ -6912,7 +6912,7 @@ var Lt = {
6912
6912
  sequenceIndex: k.uShort,
6913
6913
  lookupListIndex: k.uShort
6914
6914
  };
6915
- Ve[5] = function() {
6915
+ We[5] = function() {
6916
6916
  const e = this.offset + this.relativeOffset, n = this.parseUShort();
6917
6917
  if (n === 1)
6918
6918
  return {
@@ -6949,7 +6949,7 @@ Ve[5] = function() {
6949
6949
  }
6950
6950
  H.assert(!1, "0x" + e.toString(16) + ": lookup type 5 format must be 1, 2 or 3.");
6951
6951
  };
6952
- Ve[6] = function() {
6952
+ We[6] = function() {
6953
6953
  const e = this.offset + this.relativeOffset, n = this.parseUShort();
6954
6954
  if (n === 1)
6955
6955
  return {
@@ -6990,17 +6990,17 @@ Ve[6] = function() {
6990
6990
  };
6991
6991
  H.assert(!1, "0x" + e.toString(16) + ": lookup type 6 format must be 1, 2 or 3.");
6992
6992
  };
6993
- Ve[7] = function() {
6993
+ We[7] = function() {
6994
6994
  const e = this.parseUShort();
6995
6995
  H.argument(e === 1, "GSUB Extension Substitution subtable identifier-format must be 1");
6996
6996
  const n = this.parseUShort(), r = new k(this.data, this.offset + this.parseULong());
6997
6997
  return {
6998
6998
  substFormat: 1,
6999
6999
  lookupType: n,
7000
- extension: Ve[n].call(r)
7000
+ extension: We[n].call(r)
7001
7001
  };
7002
7002
  };
7003
- Ve[8] = function() {
7003
+ We[8] = function() {
7004
7004
  const e = this.parseUShort();
7005
7005
  return H.argument(e === 1, "GSUB Reverse Chaining Contextual Single Substitution Subtable identifier-format must be 1"), {
7006
7006
  substFormat: e,
@@ -7017,12 +7017,12 @@ function ol(t, e) {
7017
7017
  version: r,
7018
7018
  scripts: n.parseScriptList(),
7019
7019
  features: n.parseFeatureList(),
7020
- lookups: n.parseLookupList(Ve)
7020
+ lookups: n.parseLookupList(We)
7021
7021
  } : {
7022
7022
  version: r,
7023
7023
  scripts: n.parseScriptList(),
7024
7024
  features: n.parseFeatureList(),
7025
- lookups: n.parseLookupList(Ve),
7025
+ lookups: n.parseLookupList(We),
7026
7026
  variations: n.parseFeatureVariationsList()
7027
7027
  };
7028
7028
  }
@@ -7646,7 +7646,7 @@ var Ra = {
7646
7646
  function Fs(t) {
7647
7647
  return Math.log(t) / Math.log(2) | 0;
7648
7648
  }
7649
- function Wr(t) {
7649
+ function Vr(t) {
7650
7650
  for (; t.length % 4 !== 0; )
7651
7651
  t.push(0);
7652
7652
  let e = 0;
@@ -7680,7 +7680,7 @@ function Da(t) {
7680
7680
  for (let a = 0; a < t.length; a += 1) {
7681
7681
  const o = t[a];
7682
7682
  H.argument(o.tableName.length === 4, "Table name" + o.tableName + " is invalid.");
7683
- const c = o.sizeOf(), l = Es(o.tableName, Wr(o.encode()), i, c);
7683
+ const c = o.sizeOf(), l = Es(o.tableName, Vr(o.encode()), i, c);
7684
7684
  for (r.push({ name: l.tag + " Table Record", type: "RECORD", value: l }), s.push({ name: o.tableName + " table", type: "RECORD", value: o }), i += c, H.argument(!isNaN(i), "Something went wrong calculating the offset."); i % 4 !== 0; )
7685
7685
  i += 1, s.push({ name: "padding", type: "BYTE", value: 0 });
7686
7686
  }
@@ -7783,7 +7783,7 @@ function Pl(t) {
7783
7783
  // Use space as the default character, if available.
7784
7784
  usBreakChar: t.hasChar(" ") ? 32 : 0
7785
7785
  // Use space as the break character, if available.
7786
- }, t.tables.os2)), T = xa.make(t.glyphs), E = sa.make(t.glyphs), I = t.getEnglishName("fontFamily"), _ = t.getEnglishName("fontSubfamily"), V = I + " " + _;
7786
+ }, t.tables.os2)), T = xa.make(t.glyphs), E = sa.make(t.glyphs), I = t.getEnglishName("fontFamily"), _ = t.getEnglishName("fontSubfamily"), W = I + " " + _;
7787
7787
  let $ = t.getEnglishName("postScriptName");
7788
7788
  $ || ($ = I.replace(/\s/g, "") + "-" + _);
7789
7789
  const G = {};
@@ -7794,22 +7794,22 @@ function Pl(t) {
7794
7794
  for (const K in G) {
7795
7795
  if (G[K] = G[K] || {}, !G[K].uniqueID) {
7796
7796
  const xe = t.getEnglishName("manufacturer") || "";
7797
- G[K].uniqueID = { en: `${xe}: ${V}` };
7797
+ G[K].uniqueID = { en: `${xe}: ${W}` };
7798
7798
  }
7799
7799
  G[K].postScriptName || (G[K].postScriptName = { en: $ });
7800
7800
  }
7801
7801
  G.unicode.preferredFamily || (G.unicode.preferredFamily = q.fontFamily || ne.fontFamily || P.fontFamily), G.macintosh.preferredFamily || (G.macintosh.preferredFamily = ne.fontFamily || q.fontFamily || P.fontFamily), G.windows.preferredFamily || (G.windows.preferredFamily = P.fontFamily || q.fontFamily || ne.fontFamily), G.unicode.preferredSubfamily || (G.unicode.preferredSubfamily = q.fontSubfamily || ne.fontSubfamily || P.fontSubfamily), G.macintosh.preferredSubfamily || (G.macintosh.preferredSubfamily = ne.fontSubfamily || q.fontSubfamily || P.fontSubfamily), G.windows.preferredSubfamily || (G.windows.preferredSubfamily = P.fontSubfamily || q.fontSubfamily || ne.fontSubfamily);
7802
7802
  const B = [], U = ra.make(G, B), te = B.length > 0 ? va.make(B) : void 0, Te = wa.make(t), Qe = Or.make(t.glyphs, {
7803
7803
  version: t.getEnglishName("version"),
7804
- fullName: V,
7804
+ fullName: W,
7805
7805
  familyName: I,
7806
7806
  weightName: _,
7807
7807
  postScriptName: $,
7808
7808
  unitsPerEm: t.unitsPerEm,
7809
7809
  fontBBox: [0, y.yMin, y.ascender, y.advanceWidthMax],
7810
7810
  topDict: t.tables.cff && t.tables.cff.topDict || {}
7811
- }), Me = t.metas && Object.keys(t.metas).length > 0 ? Ta.make(t.metas) : void 0, ue = [b, v, w, C, U, E, Te, Qe, T];
7812
- te && ue.push(te);
7811
+ }), Me = t.metas && Object.keys(t.metas).length > 0 ? Ta.make(t.metas) : void 0, he = [b, v, w, C, U, E, Te, Qe, T];
7812
+ te && he.push(te);
7813
7813
  const Y = {
7814
7814
  gsub: Ca,
7815
7815
  cpal: ua,
@@ -7829,11 +7829,11 @@ function Pl(t) {
7829
7829
  const xe = t.tables[K];
7830
7830
  if (xe) {
7831
7831
  const Ee = Y[K].make.call(t, xe, ...ee[K] || []);
7832
- Ee && ue.push(Ee);
7832
+ Ee && he.push(Ee);
7833
7833
  }
7834
7834
  }
7835
- Me && ue.push(Me);
7836
- const pe = Da(ue), be = pe.encode(), ge = Wr(be), me = pe.fields;
7835
+ Me && he.push(Me);
7836
+ const pe = Da(he), be = pe.encode(), ge = Vr(be), me = pe.fields;
7837
7837
  let ae = !1;
7838
7838
  for (let K = 0; K < me.length; K += 1)
7839
7839
  if (me[K].name === "head table") {
@@ -7844,7 +7844,7 @@ function Pl(t) {
7844
7844
  throw new Error("Could not find head table with checkSum to adjust.");
7845
7845
  return pe;
7846
7846
  }
7847
- var Nl = { make: Da, fontToTable: Pl, computeCheckSum: Wr };
7847
+ var Nl = { make: Da, fontToTable: Pl, computeCheckSum: Vr };
7848
7848
  function Xn(t, e) {
7849
7849
  let n = 0, r = t.length - 1;
7850
7850
  for (; n <= r; ) {
@@ -8168,7 +8168,7 @@ function zl(t, e, n) {
8168
8168
  }
8169
8169
  return i;
8170
8170
  }
8171
- function Vl(t, e, n) {
8171
+ function Wl(t, e, n) {
8172
8172
  let r = 0, s = t.length - 1;
8173
8173
  for (; r <= s; ) {
8174
8174
  const i = Math.floor((r + s) / 2), a = t[i];
@@ -8181,7 +8181,7 @@ function Vl(t, e, n) {
8181
8181
  }
8182
8182
  return -1;
8183
8183
  }
8184
- function Wl(t, e, n) {
8184
+ function Vl(t, e, n) {
8185
8185
  let r = 0, s = t.length;
8186
8186
  const i = (a, o) => a[e] - o[e];
8187
8187
  for (; r < s; ) {
@@ -8711,10 +8711,10 @@ var $l = De, Ua = class {
8711
8711
  updateColrTable(t, e) {
8712
8712
  this.ensureCOLR();
8713
8713
  const r = this.font.tables.colr;
8714
- let s = Vl(r.baseGlyphRecords, "glyphID", t);
8714
+ let s = Wl(r.baseGlyphRecords, "glyphID", t);
8715
8715
  if (s === -1) {
8716
8716
  const u = { glyphID: t, firstLayerIndex: r.layerRecords.length, numLayers: 0 };
8717
- s = Wl(r.baseGlyphRecords, "glyphID", u);
8717
+ s = Vl(r.baseGlyphRecords, "glyphID", u);
8718
8718
  }
8719
8719
  const a = r.baseGlyphRecords[s], o = a.numLayers, c = e.length, l = c - o;
8720
8720
  if (l > 0) {
@@ -9466,7 +9466,7 @@ function za(t) {
9466
9466
  function lu(t) {
9467
9467
  return t;
9468
9468
  }
9469
- function Va(t) {
9469
+ function Wa(t) {
9470
9470
  return Math.sign(t) * Math.round(Math.abs(t));
9471
9471
  }
9472
9472
  function uu(t) {
@@ -9481,7 +9481,7 @@ function fu(t) {
9481
9481
  function pu(t) {
9482
9482
  return Math.sign(t) * Math.floor(Math.abs(t));
9483
9483
  }
9484
- var Wa = function(t) {
9484
+ var Va = function(t) {
9485
9485
  const e = this.srPeriod;
9486
9486
  let n = this.srPhase;
9487
9487
  const r = this.srThreshold;
@@ -9673,7 +9673,7 @@ function ft(t, e) {
9673
9673
  case "glyf":
9674
9674
  this.zp0 = this.zp1 = this.zp2 = 1, this.rp0 = this.rp1 = this.rp2 = 0;
9675
9675
  case "prep":
9676
- this.fv = this.pv = this.dpv = Ze, this.round = Va;
9676
+ this.fv = this.pv = this.dpv = Ze, this.round = Wa;
9677
9677
  }
9678
9678
  }
9679
9679
  za.prototype.exec = function(t, e) {
@@ -9843,8 +9843,8 @@ function xu(t) {
9843
9843
  t.fv = t.pv;
9844
9844
  }
9845
9845
  function vu(t) {
9846
- const e = t.stack, n = e.pop(), r = e.pop(), s = e.pop(), i = e.pop(), a = e.pop(), o = t.z0, c = t.z1, l = o[n], u = o[r], h = c[s], f = c[i], p = t.z2[a], y = l.x, m = l.y, b = u.x, v = u.y, w = h.x, C = h.y, T = f.x, E = f.y, I = (y - b) * (C - E) - (m - v) * (w - T), _ = y * v - m * b, V = w * E - C * T;
9847
- p.x = (_ * (w - T) - V * (y - b)) / I, p.y = (_ * (C - E) - V * (m - v)) / I;
9846
+ const e = t.stack, n = e.pop(), r = e.pop(), s = e.pop(), i = e.pop(), a = e.pop(), o = t.z0, c = t.z1, l = o[n], u = o[r], h = c[s], f = c[i], p = t.z2[a], y = l.x, m = l.y, b = u.x, v = u.y, w = h.x, C = h.y, T = f.x, E = f.y, I = (y - b) * (C - E) - (m - v) * (w - T), _ = y * v - m * b, W = w * E - C * T;
9847
+ p.x = (_ * (w - T) - W * (y - b)) / I, p.y = (_ * (C - E) - W * (m - v)) / I;
9848
9848
  }
9849
9849
  function Su(t) {
9850
9850
  t.rp0 = t.stack.pop();
@@ -9911,7 +9911,7 @@ function Ou(t) {
9911
9911
  t.loop = t.stack.pop(), t.loop > Dn && (t.loop = Dn);
9912
9912
  }
9913
9913
  function Au(t) {
9914
- t.round = Va;
9914
+ t.round = Wa;
9915
9915
  }
9916
9916
  function Lu(t) {
9917
9917
  t.round = hu;
@@ -9975,7 +9975,7 @@ function zu(t) {
9975
9975
  const e = t.stack, n = e.pop();
9976
9976
  e.push(e.splice(e.length - n, 1)[0]);
9977
9977
  }
9978
- function Vu(t) {
9978
+ function Wu(t) {
9979
9979
  if (t.env !== "fpgm") throw new Error("FDEF not allowed here");
9980
9980
  const e = t.stack, n = t.prog;
9981
9981
  let r = t.ip;
@@ -10012,7 +10012,7 @@ function zs(t, e) {
10012
10012
  l !== s && i.setRelative(l, l, u, a), l = l.nextPointOnContour;
10013
10013
  while (l !== c);
10014
10014
  }
10015
- function Vs(t, e) {
10015
+ function Ws(t, e) {
10016
10016
  const n = e.stack, r = t ? e.rp1 : e.rp2, s = (t ? e.z0 : e.z1)[r], i = e.fv, a = e.pv, o = n.pop();
10017
10017
  let c;
10018
10018
  switch (o) {
@@ -10030,7 +10030,7 @@ function Vs(t, e) {
10030
10030
  for (let f = 0; f < h; f++)
10031
10031
  l = c[f], i.setRelative(l, l, u, a);
10032
10032
  }
10033
- function Wu(t) {
10033
+ function Vu(t) {
10034
10034
  const e = t.stack;
10035
10035
  let n = t.loop;
10036
10036
  const r = t.fv, s = e.pop() / 64, i = t.z2;
@@ -10050,7 +10050,7 @@ function ju(t) {
10050
10050
  }
10051
10051
  t.loop = 1;
10052
10052
  }
10053
- function Ws(t, e) {
10053
+ function Vs(t, e) {
10054
10054
  const n = e.stack, r = n.pop() / 64, s = n.pop(), i = e.z1[s], a = e.z0[e.rp0], o = e.fv, c = e.pv;
10055
10055
  o.setRelative(i, a, r, c), o.touch(i), e.rp1 = e.rp0, e.rp2 = s, t && (e.rp0 = s);
10056
10056
  }
@@ -10243,7 +10243,7 @@ function Qn(t, e) {
10243
10243
  }
10244
10244
  function Fh(t) {
10245
10245
  let e = t.stack.pop();
10246
- t.round = Wa;
10246
+ t.round = Va;
10247
10247
  let n;
10248
10248
  switch (e & 192) {
10249
10249
  case 0:
@@ -10278,7 +10278,7 @@ function Fh(t) {
10278
10278
  }
10279
10279
  function Eh(t) {
10280
10280
  let e = t.stack.pop();
10281
- t.round = Wa;
10281
+ t.round = Va;
10282
10282
  let n;
10283
10283
  switch (e & 192) {
10284
10284
  case 0:
@@ -10476,7 +10476,7 @@ Ga = [
10476
10476
  /* 0x2B */
10477
10477
  Gu,
10478
10478
  /* 0x2C */
10479
- Vu,
10479
+ Wu,
10480
10480
  /* 0x2D */
10481
10481
  void 0,
10482
10482
  // ENDF (eaten by FDEF)
@@ -10497,17 +10497,17 @@ Ga = [
10497
10497
  /* 0x35 */
10498
10498
  zs.bind(void 0, 1),
10499
10499
  /* 0x36 */
10500
- Vs.bind(void 0, 0),
10500
+ Ws.bind(void 0, 0),
10501
10501
  /* 0x37 */
10502
- Vs.bind(void 0, 1),
10502
+ Ws.bind(void 0, 1),
10503
10503
  /* 0x38 */
10504
- Wu,
10504
+ Vu,
10505
10505
  /* 0x39 */
10506
10506
  ju,
10507
10507
  /* 0x3A */
10508
- Ws.bind(void 0, 0),
10508
+ Vs.bind(void 0, 0),
10509
10509
  /* 0x3B */
10510
- Ws.bind(void 0, 1),
10510
+ Vs.bind(void 0, 1),
10511
10511
  /* 0x3C */
10512
10512
  qu,
10513
10513
  /* 0x3D */
@@ -10975,7 +10975,7 @@ function Gh(t) {
10975
10975
  );
10976
10976
  }
10977
10977
  }
10978
- function le(t) {
10978
+ function ue(t) {
10979
10979
  this.tokens = [], this.registeredContexts = {}, this.contextCheckers = [], this.events = {}, this.registeredModifiers = [], Gh.call(this, t);
10980
10980
  }
10981
10981
  Nt.prototype.setState = function(t, e) {
@@ -10984,10 +10984,10 @@ Nt.prototype.setState = function(t, e) {
10984
10984
  Nt.prototype.getState = function(t) {
10985
10985
  return this.state[t] || null;
10986
10986
  };
10987
- le.prototype.inboundIndex = function(t) {
10987
+ ue.prototype.inboundIndex = function(t) {
10988
10988
  return t >= 0 && t < this.tokens.length;
10989
10989
  };
10990
- le.prototype.composeRUD = function(t) {
10990
+ ue.prototype.composeRUD = function(t) {
10991
10991
  const n = t.map((s) => this[s[0]].apply(this, s.slice(1).concat(!0))), r = (s) => typeof s == "object" && Object.prototype.hasOwnProperty.call(s, "FAIL");
10992
10992
  if (n.every(r))
10993
10993
  return {
@@ -10996,7 +10996,7 @@ le.prototype.composeRUD = function(t) {
10996
10996
  };
10997
10997
  this.dispatch("composeRUD", [n.filter((s) => !r(s))]);
10998
10998
  };
10999
- le.prototype.replaceRange = function(t, e, n, r) {
10999
+ ue.prototype.replaceRange = function(t, e, n, r) {
11000
11000
  e = e !== null ? e : this.tokens.length;
11001
11001
  const s = n.every((i) => i instanceof Nt);
11002
11002
  if (!isNaN(t) && this.inboundIndex(t) && s) {
@@ -11008,26 +11008,26 @@ le.prototype.replaceRange = function(t, e, n, r) {
11008
11008
  } else
11009
11009
  return { FAIL: "replaceRange: invalid tokens or startIndex." };
11010
11010
  };
11011
- le.prototype.replaceToken = function(t, e, n) {
11011
+ ue.prototype.replaceToken = function(t, e, n) {
11012
11012
  if (!isNaN(t) && this.inboundIndex(t) && e instanceof Nt) {
11013
11013
  const r = this.tokens.splice(t, 1, e);
11014
11014
  return n || this.dispatch("replaceToken", [t, e]), [r[0], e];
11015
11015
  } else
11016
11016
  return { FAIL: "replaceToken: invalid token or index." };
11017
11017
  };
11018
- le.prototype.removeRange = function(t, e, n) {
11018
+ ue.prototype.removeRange = function(t, e, n) {
11019
11019
  e = isNaN(e) ? this.tokens.length : e;
11020
11020
  const r = this.tokens.splice(t, e);
11021
11021
  return n || this.dispatch("removeRange", [r, t, e]), r;
11022
11022
  };
11023
- le.prototype.removeToken = function(t, e) {
11023
+ ue.prototype.removeToken = function(t, e) {
11024
11024
  if (!isNaN(t) && this.inboundIndex(t)) {
11025
11025
  const n = this.tokens.splice(t, 1);
11026
11026
  return e || this.dispatch("removeToken", [n, t]), n;
11027
11027
  } else
11028
11028
  return { FAIL: "removeToken: invalid token index." };
11029
11029
  };
11030
- le.prototype.insertToken = function(t, e, n) {
11030
+ ue.prototype.insertToken = function(t, e, n) {
11031
11031
  return t.every(
11032
11032
  (s) => s instanceof Nt
11033
11033
  ) ? (this.tokens.splice.apply(
@@ -11035,7 +11035,7 @@ le.prototype.insertToken = function(t, e, n) {
11035
11035
  [e, 0].concat(t)
11036
11036
  ), n || this.dispatch("insertToken", [t, e]), t) : { FAIL: "insertToken: invalid token(s)." };
11037
11037
  };
11038
- le.prototype.registerModifier = function(t, e, n) {
11038
+ ue.prototype.registerModifier = function(t, e, n) {
11039
11039
  this.events.newToken.subscribe(function(r, s) {
11040
11040
  const i = [r, s], a = e === null || e.apply(this, i) === !0, o = [r, s];
11041
11041
  if (a) {
@@ -11065,28 +11065,28 @@ Fe.prototype.get = function(t) {
11065
11065
  return null;
11066
11066
  }
11067
11067
  };
11068
- le.prototype.rangeToText = function(t) {
11068
+ ue.prototype.rangeToText = function(t) {
11069
11069
  if (t instanceof $r)
11070
11070
  return this.getRangeTokens(t).map((e) => e.char).join("");
11071
11071
  };
11072
- le.prototype.getText = function() {
11072
+ ue.prototype.getText = function() {
11073
11073
  return this.tokens.map((t) => t.char).join("");
11074
11074
  };
11075
- le.prototype.getContext = function(t) {
11075
+ ue.prototype.getContext = function(t) {
11076
11076
  let e = this.registeredContexts[t];
11077
11077
  return e || null;
11078
11078
  };
11079
- le.prototype.on = function(t, e) {
11079
+ ue.prototype.on = function(t, e) {
11080
11080
  const n = this.events[t];
11081
11081
  return n ? n.subscribe(e) : null;
11082
11082
  };
11083
- le.prototype.dispatch = function(t, e) {
11083
+ ue.prototype.dispatch = function(t, e) {
11084
11084
  const n = this.events[t];
11085
11085
  if (n instanceof Gn)
11086
11086
  for (let r = 0; r < n.subscribers.length; r++)
11087
11087
  n.subscribers[r].apply(this, e || []);
11088
11088
  };
11089
- le.prototype.registerContextChecker = function(t, e, n) {
11089
+ ue.prototype.registerContextChecker = function(t, e, n) {
11090
11090
  if (this.getContext(t)) return {
11091
11091
  FAIL: `context name '${t}' is already registered.`
11092
11092
  };
@@ -11103,17 +11103,17 @@ le.prototype.registerContextChecker = function(t, e, n) {
11103
11103
  );
11104
11104
  return this.registeredContexts[t] = r, this.contextCheckers.push(r), r;
11105
11105
  };
11106
- le.prototype.getRangeTokens = function(t) {
11106
+ ue.prototype.getRangeTokens = function(t) {
11107
11107
  const e = t.startIndex + t.endOffset;
11108
11108
  return [].concat(
11109
11109
  this.tokens.slice(t.startIndex, e)
11110
11110
  );
11111
11111
  };
11112
- le.prototype.getContextRanges = function(t) {
11112
+ ue.prototype.getContextRanges = function(t) {
11113
11113
  const e = this.getContext(t);
11114
11114
  return e ? e.ranges : { FAIL: `context checker '${t}' is not registered.` };
11115
11115
  };
11116
- le.prototype.resetContextsRanges = function() {
11116
+ ue.prototype.resetContextsRanges = function() {
11117
11117
  const t = this.registeredContexts;
11118
11118
  for (const e in t)
11119
11119
  if (Object.prototype.hasOwnProperty.call(t, e)) {
@@ -11121,7 +11121,7 @@ le.prototype.resetContextsRanges = function() {
11121
11121
  n.ranges = [];
11122
11122
  }
11123
11123
  };
11124
- le.prototype.updateContextsRanges = function() {
11124
+ ue.prototype.updateContextsRanges = function() {
11125
11125
  this.resetContextsRanges();
11126
11126
  const t = this.tokens.map((e) => e.char);
11127
11127
  for (let e = 0; e < t.length; e++) {
@@ -11130,13 +11130,13 @@ le.prototype.updateContextsRanges = function() {
11130
11130
  }
11131
11131
  this.dispatch("updateContextsRanges", [this.registeredContexts]);
11132
11132
  };
11133
- le.prototype.setEndOffset = function(t, e) {
11133
+ ue.prototype.setEndOffset = function(t, e) {
11134
11134
  const n = this.getContext(e).openRange.startIndex;
11135
11135
  let r = new $r(n, t, e);
11136
11136
  const s = this.getContext(e).ranges;
11137
11137
  return r.rangeId = `${e}.${s.length}`, s.push(r), this.getContext(e).openRange = null, r;
11138
11138
  };
11139
- le.prototype.runContextCheck = function(t) {
11139
+ ue.prototype.runContextCheck = function(t) {
11140
11140
  const e = t.index;
11141
11141
  for (let n = 0; n < this.contextCheckers.length; n++) {
11142
11142
  const r = this.contextCheckers[n];
@@ -11147,7 +11147,7 @@ le.prototype.runContextCheck = function(t) {
11147
11147
  }
11148
11148
  }
11149
11149
  };
11150
- le.prototype.tokenize = function(t) {
11150
+ ue.prototype.tokenize = function(t) {
11151
11151
  this.tokens = [], this.resetContextsRanges();
11152
11152
  let e = Array.from(t);
11153
11153
  this.dispatch("start");
@@ -11159,7 +11159,7 @@ le.prototype.tokenize = function(t) {
11159
11159
  }
11160
11160
  return this.dispatch("end", [this.tokens]), this.tokens;
11161
11161
  };
11162
- var Hh = le;
11162
+ var Hh = ue;
11163
11163
  function dt(t) {
11164
11164
  return /[\u0600-\u065F\u066A-\u06D2\u06FA-\u06FF]/.test(t);
11165
11165
  }
@@ -11205,10 +11205,10 @@ function mt(t, e) {
11205
11205
  }
11206
11206
  return -1;
11207
11207
  }
11208
- function Vh(t, e) {
11208
+ function Wh(t, e) {
11209
11209
  return mt(t, e.coverage) === -1 ? null : t + e.deltaGlyphId;
11210
11210
  }
11211
- function Wh(t, e) {
11211
+ function Vh(t, e) {
11212
11212
  let n = mt(t, e.coverage);
11213
11213
  return n === -1 ? null : e.substitute[n];
11214
11214
  }
@@ -11393,12 +11393,12 @@ Be.prototype.getLookupMethod = function(t, e) {
11393
11393
  let n = this.getSubstitutionType(t, e);
11394
11394
  switch (n) {
11395
11395
  case "11":
11396
- return (r) => Vh.apply(
11396
+ return (r) => Wh.apply(
11397
11397
  this,
11398
11398
  [r, e]
11399
11399
  );
11400
11400
  case "12":
11401
- return (r) => Wh.apply(
11401
+ return (r) => Vh.apply(
11402
11402
  this,
11403
11403
  [r, e]
11404
11404
  );
@@ -11996,7 +11996,7 @@ function zf() {
11996
11996
  pf.call(this, n);
11997
11997
  }
11998
11998
  }
11999
- function Vf() {
11999
+ function Wf() {
12000
12000
  if (!this.hasFeatureEnabled("latn", "liga")) return;
12001
12001
  tn.call(this);
12002
12002
  const t = this.tokenizer.getContextRanges("latinWord");
@@ -12005,7 +12005,7 @@ function Vf() {
12005
12005
  Cf.call(this, n);
12006
12006
  }
12007
12007
  }
12008
- function Wf() {
12008
+ function Vf() {
12009
12009
  const t = this.tokenizer.getContextRanges("unicodeVariationSequence");
12010
12010
  for (let e = 0; e < t.length; e++) {
12011
12011
  const n = t[e];
@@ -12024,7 +12024,7 @@ He.prototype.checkContextReady = function(t) {
12024
12024
  return !!this.tokenizer.getContext(t);
12025
12025
  };
12026
12026
  He.prototype.applyFeaturesToContexts = function() {
12027
- this.checkContextReady("ccmpReplacement") && Hf.call(this), this.checkContextReady("arabicWord") && (Gf.call(this), zf.call(this)), this.checkContextReady("latinWord") && Vf.call(this), this.checkContextReady("arabicSentence") && Nf.call(this), this.checkContextReady("thaiWord") && jf.call(this), this.checkContextReady("unicodeVariationSequence") && Wf.call(this);
12027
+ this.checkContextReady("ccmpReplacement") && Hf.call(this), this.checkContextReady("arabicWord") && (Gf.call(this), zf.call(this)), this.checkContextReady("latinWord") && Wf.call(this), this.checkContextReady("arabicSentence") && Nf.call(this), this.checkContextReady("thaiWord") && jf.call(this), this.checkContextReady("unicodeVariationSequence") && Vf.call(this);
12028
12028
  };
12029
12029
  He.prototype.hasFeatureEnabled = function(t, e) {
12030
12030
  return (this.featuresTags[t] || []).indexOf(e) !== -1;
@@ -12402,8 +12402,8 @@ function np(t, e) {
12402
12402
  };
12403
12403
  return r >= 1.2 && (s.markGlyphSets = n.parsePointer(tp)), s;
12404
12404
  }
12405
- var rp = { parse: np }, We = new Array(10);
12406
- We[1] = function() {
12405
+ var rp = { parse: np }, Ve = new Array(10);
12406
+ Ve[1] = function() {
12407
12407
  const e = this.offset + this.relativeOffset, n = this.parseUShort();
12408
12408
  if (n === 1)
12409
12409
  return {
@@ -12419,7 +12419,7 @@ We[1] = function() {
12419
12419
  };
12420
12420
  H.assert(!1, "0x" + e.toString(16) + ": GPOS lookup type 1 format must be 1 or 2.");
12421
12421
  };
12422
- We[2] = function() {
12422
+ Ve[2] = function() {
12423
12423
  const e = this.offset + this.relativeOffset, n = this.parseUShort();
12424
12424
  H.assert(n === 1 || n === 2, "0x" + e.toString(16) + ": GPOS lookup type 2 format must be 1 or 2.");
12425
12425
  const r = this.parsePointer(k.coverage), s = this.parseUShort(), i = this.parseUShort();
@@ -12459,25 +12459,25 @@ We[2] = function() {
12459
12459
  };
12460
12460
  }
12461
12461
  };
12462
- We[3] = function() {
12462
+ Ve[3] = function() {
12463
12463
  return { error: "GPOS Lookup 3 not supported" };
12464
12464
  };
12465
- We[4] = function() {
12465
+ Ve[4] = function() {
12466
12466
  return { error: "GPOS Lookup 4 not supported" };
12467
12467
  };
12468
- We[5] = function() {
12468
+ Ve[5] = function() {
12469
12469
  return { error: "GPOS Lookup 5 not supported" };
12470
12470
  };
12471
- We[6] = function() {
12471
+ Ve[6] = function() {
12472
12472
  return { error: "GPOS Lookup 6 not supported" };
12473
12473
  };
12474
- We[7] = function() {
12474
+ Ve[7] = function() {
12475
12475
  return { error: "GPOS Lookup 7 not supported" };
12476
12476
  };
12477
- We[8] = function() {
12477
+ Ve[8] = function() {
12478
12478
  return { error: "GPOS Lookup 8 not supported" };
12479
12479
  };
12480
- We[9] = function() {
12480
+ Ve[9] = function() {
12481
12481
  return { error: "GPOS Lookup 9 not supported" };
12482
12482
  };
12483
12483
  function sp(t, e) {
@@ -12487,12 +12487,12 @@ function sp(t, e) {
12487
12487
  version: r,
12488
12488
  scripts: n.parseScriptList(),
12489
12489
  features: n.parseFeatureList(),
12490
- lookups: n.parseLookupList(We)
12490
+ lookups: n.parseLookupList(Ve)
12491
12491
  } : {
12492
12492
  version: r,
12493
12493
  scripts: n.parseScriptList(),
12494
12494
  features: n.parseFeatureList(),
12495
- lookups: n.parseLookupList(We),
12495
+ lookups: n.parseLookupList(Ve),
12496
12496
  variations: n.parseFeatureVariationsList()
12497
12497
  };
12498
12498
  }
@@ -12610,7 +12610,7 @@ function gp(t, e = {}) {
12610
12610
  throw new Error("WOFF2 require an external decompressor library, see examples at: " + P);
12611
12611
  } else
12612
12612
  throw new Error("Unsupported OpenType signature " + c);
12613
- let l, u, h, f, p, y, m, b, v, w, C, T, E, I, _, V, $, G;
12613
+ let l, u, h, f, p, y, m, b, v, w, C, T, E, I, _, W, $, G;
12614
12614
  for (let P = 0; P < a; P += 1) {
12615
12615
  const B = o[P];
12616
12616
  let U;
@@ -12664,7 +12664,7 @@ function gp(t, e = {}) {
12664
12664
  U = Z(i, B), s.tables.maxp = Sa.parse(U.data, U.offset), s.numGlyphs = s.tables.maxp.numGlyphs;
12665
12665
  break;
12666
12666
  case "name":
12667
- V = B;
12667
+ W = B;
12668
12668
  break;
12669
12669
  case "OS/2":
12670
12670
  U = Z(i, B), s.tables.os2 = Lr.parse(U.data, U.offset);
@@ -12714,7 +12714,7 @@ function gp(t, e = {}) {
12714
12714
  break;
12715
12715
  }
12716
12716
  }
12717
- const q = Z(i, V);
12717
+ const q = Z(i, W);
12718
12718
  if (s.tables.name = ra.parse(q.data, q.offset, r), s.names = s.tables.name, b && _) {
12719
12719
  const P = n === 0, B = Z(i, _), U = pp.parse(B.data, B.offset, s.numGlyphs, P), te = Z(i, b);
12720
12720
  s.glyphs = Na.parse(te.data, te.offset, U, s, e);
@@ -12888,9 +12888,9 @@ function mp(t, e = 1e-4) {
12888
12888
  E.normalized
12889
12889
  );
12890
12890
  const I = t.morphAttributes[T];
12891
- I && (l[T] || (l[T] = []), I.forEach((_, V) => {
12891
+ I && (l[T] || (l[T] = []), I.forEach((_, W) => {
12892
12892
  const $ = new _.array.constructor(_.count * _.itemSize);
12893
- l[T][V] = new _.constructor($, _.itemSize, _.normalized);
12893
+ l[T][W] = new _.constructor($, _.itemSize, _.normalized);
12894
12894
  }));
12895
12895
  }
12896
12896
  const p = e * 0.5, y = Math.log10(1 / e), m = Math.pow(10, y), b = p * m;
@@ -12898,18 +12898,18 @@ function mp(t, e = 1e-4) {
12898
12898
  const C = r ? r.getX(w) : w;
12899
12899
  let T = "";
12900
12900
  for (let E = 0, I = o.length; E < I; E++) {
12901
- const _ = o[E], V = t.getAttribute(_), $ = V.itemSize;
12901
+ const _ = o[E], W = t.getAttribute(_), $ = W.itemSize;
12902
12902
  for (let G = 0; G < $; G++)
12903
- T += `${~~(V[h[G]](C) * m + b)},`;
12903
+ T += `${~~(W[h[G]](C) * m + b)},`;
12904
12904
  }
12905
12905
  if (T in n)
12906
12906
  u.push(n[T]);
12907
12907
  else {
12908
12908
  for (let E = 0, I = o.length; E < I; E++) {
12909
- const _ = o[E], V = t.getAttribute(_), $ = t.morphAttributes[_], G = V.itemSize, q = c[_], ne = l[_];
12909
+ const _ = o[E], W = t.getAttribute(_), $ = t.morphAttributes[_], G = W.itemSize, q = c[_], ne = l[_];
12910
12910
  for (let P = 0; P < G; P++) {
12911
12911
  const B = h[P], U = f[P];
12912
- if (q[U](a, V[B](C)), $)
12912
+ if (q[U](a, W[B](C)), $)
12913
12913
  for (let te = 0, Te = $.length; te < Te; te++)
12914
12914
  ne[te][U](a, $[te][B](C));
12915
12915
  }
@@ -14007,7 +14007,7 @@ class Yt {
14007
14007
  ), n;
14008
14008
  }
14009
14009
  }
14010
- class Wt {
14010
+ class Vt {
14011
14011
  constructor(e, n = []) {
14012
14012
  this.lastPoint = e, this.polylines = n;
14013
14013
  }
@@ -14033,7 +14033,7 @@ class Wt {
14033
14033
  */
14034
14034
  offset(e, n = !0) {
14035
14035
  var r, s;
14036
- return n ? new Wt(
14036
+ return n ? new Vt(
14037
14037
  (r = this.lastPoint) == null ? void 0 : r.clone().add(e),
14038
14038
  this.polylines.map((i) => i.map((a) => a.clone().add(e)))
14039
14039
  ) : ((s = this.lastPoint) == null || s.add(e), this.polylines.forEach((i) => i.forEach((a) => a.add(e))), this._bbox && (this._bbox.maxX += e.x, this._bbox.minX += e.x, this._bbox.maxY += e.y, this._bbox.minY += e.y), this);
@@ -14134,7 +14134,7 @@ class Pp {
14134
14134
  */
14135
14135
  scaleShapeByFactor(e, n) {
14136
14136
  var r;
14137
- return new Wt(
14137
+ return new Vt(
14138
14138
  (r = e.lastPoint) == null ? void 0 : r.clone().multiply(n),
14139
14139
  e.polylines.map((s) => s.map((i) => i.clone().multiply(n)))
14140
14140
  );
@@ -14156,7 +14156,7 @@ class Pp {
14156
14156
  return y.x *= l, y.y *= c, y;
14157
14157
  })
14158
14158
  );
14159
- return new Wt(u, h);
14159
+ return new Vt(u, h);
14160
14160
  }
14161
14161
  /**
14162
14162
  * Parses the shape of a character.
@@ -14187,7 +14187,7 @@ class Pp {
14187
14187
  const u = e[l];
14188
14188
  u <= 15 ? l = this.handleSpecialCommand(u, e, l, c) : this.handleVectorCommand(u, c);
14189
14189
  }
14190
- return new Wt(c.currentPoint, c.polylines);
14190
+ return new Vt(c.currentPoint, c.polylines);
14191
14191
  }
14192
14192
  /**
14193
14193
  * Please refer to special codes reference in the following link for more information.
@@ -14645,11 +14645,11 @@ function Hp(t) {
14645
14645
  }), n;
14646
14646
  }
14647
14647
  var Ya = { exports: {} }, Yr = {}, Hn = {};
14648
- Hn.byteLength = Wp;
14648
+ Hn.byteLength = Vp;
14649
14649
  Hn.toByteArray = qp;
14650
14650
  Hn.fromByteArray = Xp;
14651
14651
  var Xe = [], Ue = [], zp = typeof Uint8Array < "u" ? Uint8Array : Array, rr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
14652
- for (var At = 0, Vp = rr.length; At < Vp; ++At)
14652
+ for (var At = 0, Wp = rr.length; At < Wp; ++At)
14653
14653
  Xe[At] = rr[At], Ue[rr.charCodeAt(At)] = At;
14654
14654
  Ue[45] = 62;
14655
14655
  Ue[95] = 63;
@@ -14662,7 +14662,7 @@ function Xa(t) {
14662
14662
  var r = n === e ? 0 : 4 - n % 4;
14663
14663
  return [n, r];
14664
14664
  }
14665
- function Wp(t) {
14665
+ function Vp(t) {
14666
14666
  var e = Xa(t), n = e[0], r = e[1];
14667
14667
  return (n + r) * 3 / 4 - r;
14668
14668
  }
@@ -14982,7 +14982,7 @@ Xr.write = function(t, e, n, r, s, i) {
14982
14982
  case "ucs-2":
14983
14983
  case "utf16le":
14984
14984
  case "utf-16le":
14985
- return ue(this, d, g);
14985
+ return he(this, d, g);
14986
14986
  default:
14987
14987
  if (S) throw new TypeError("Unknown encoding: " + x);
14988
14988
  x = (x + "").toLowerCase(), S = !0;
@@ -15037,7 +15037,7 @@ Xr.write = function(t, e, n, r, s, i) {
15037
15037
  if (g >= S)
15038
15038
  return 1;
15039
15039
  if (g >>>= 0, S >>>= 0, F >>>= 0, O >>>= 0, this === d) return 0;
15040
- for (var L = O - F, j = S - g, W = Math.min(L, j), re = this.slice(F, O), Se = d.slice(g, S), oe = 0; oe < W; ++oe)
15040
+ for (var L = O - F, j = S - g, V = Math.min(L, j), re = this.slice(F, O), Se = d.slice(g, S), oe = 0; oe < V; ++oe)
15041
15041
  if (re[oe] !== Se[oe]) {
15042
15042
  L = re[oe], j = Se[oe];
15043
15043
  break;
@@ -15065,21 +15065,21 @@ Xr.write = function(t, e, n, r, s, i) {
15065
15065
  return -1;
15066
15066
  O = 2, L /= 2, j /= 2, g /= 2;
15067
15067
  }
15068
- function W(es, ts) {
15068
+ function V(es, ts) {
15069
15069
  return O === 1 ? es[ts] : es.readUInt16BE(ts * O);
15070
15070
  }
15071
15071
  var re;
15072
15072
  if (F) {
15073
15073
  var Se = -1;
15074
15074
  for (re = g; re < L; re++)
15075
- if (W(x, re) === W(d, Se === -1 ? 0 : re - Se)) {
15075
+ if (V(x, re) === V(d, Se === -1 ? 0 : re - Se)) {
15076
15076
  if (Se === -1 && (Se = re), re - Se + 1 === j) return Se * O;
15077
15077
  } else
15078
15078
  Se !== -1 && (re -= re - Se), Se = -1;
15079
15079
  } else
15080
15080
  for (g + j > L && (g = L - j), re = g; re >= 0; re--) {
15081
15081
  for (var oe = !0, rn = 0; rn < j; rn++)
15082
- if (W(x, re + rn) !== W(d, rn)) {
15082
+ if (V(x, re + rn) !== V(d, rn)) {
15083
15083
  oe = !1;
15084
15084
  break;
15085
15085
  }
@@ -15094,7 +15094,7 @@ Xr.write = function(t, e, n, r, s, i) {
15094
15094
  }, o.prototype.lastIndexOf = function(d, g, S) {
15095
15095
  return I(this, d, g, S, !1);
15096
15096
  };
15097
- function V(x, d, g, S) {
15097
+ function W(x, d, g, S) {
15098
15098
  g = Number(g) || 0;
15099
15099
  var F = x.length - g;
15100
15100
  S ? (S = Number(S), S > F && (S = F)) : S = F;
@@ -15137,7 +15137,7 @@ Xr.write = function(t, e, n, r, s, i) {
15137
15137
  for (var L = !1; ; )
15138
15138
  switch (F) {
15139
15139
  case "hex":
15140
- return V(this, d, g, S);
15140
+ return W(this, d, g, S);
15141
15141
  case "utf8":
15142
15142
  case "utf-8":
15143
15143
  return $(this, d, g, S);
@@ -15170,19 +15170,19 @@ Xr.write = function(t, e, n, r, s, i) {
15170
15170
  for (var S = [], F = d; F < g; ) {
15171
15171
  var O = x[F], L = null, j = O > 239 ? 4 : O > 223 ? 3 : O > 191 ? 2 : 1;
15172
15172
  if (F + j <= g) {
15173
- var W, re, Se, oe;
15173
+ var V, re, Se, oe;
15174
15174
  switch (j) {
15175
15175
  case 1:
15176
15176
  O < 128 && (L = O);
15177
15177
  break;
15178
15178
  case 2:
15179
- W = x[F + 1], (W & 192) === 128 && (oe = (O & 31) << 6 | W & 63, oe > 127 && (L = oe));
15179
+ V = x[F + 1], (V & 192) === 128 && (oe = (O & 31) << 6 | V & 63, oe > 127 && (L = oe));
15180
15180
  break;
15181
15181
  case 3:
15182
- W = x[F + 1], re = x[F + 2], (W & 192) === 128 && (re & 192) === 128 && (oe = (O & 15) << 12 | (W & 63) << 6 | re & 63, oe > 2047 && (oe < 55296 || oe > 57343) && (L = oe));
15182
+ V = x[F + 1], re = x[F + 2], (V & 192) === 128 && (re & 192) === 128 && (oe = (O & 15) << 12 | (V & 63) << 6 | re & 63, oe > 2047 && (oe < 55296 || oe > 57343) && (L = oe));
15183
15183
  break;
15184
15184
  case 4:
15185
- W = x[F + 1], re = x[F + 2], Se = x[F + 3], (W & 192) === 128 && (re & 192) === 128 && (Se & 192) === 128 && (oe = (O & 15) << 18 | (W & 63) << 12 | (re & 63) << 6 | Se & 63, oe > 65535 && oe < 1114112 && (L = oe));
15185
+ V = x[F + 1], re = x[F + 2], Se = x[F + 3], (V & 192) === 128 && (re & 192) === 128 && (Se & 192) === 128 && (oe = (O & 15) << 18 | (V & 63) << 12 | (re & 63) << 6 | Se & 63, oe > 65535 && oe < 1114112 && (L = oe));
15186
15186
  }
15187
15187
  }
15188
15188
  L === null ? (L = 65533, j = 1) : L > 65535 && (L -= 65536, S.push(L >>> 10 & 1023 | 55296), L = 56320 | L & 1023), S.push(L), F += j;
@@ -15222,7 +15222,7 @@ Xr.write = function(t, e, n, r, s, i) {
15222
15222
  F += et[x[O]];
15223
15223
  return F;
15224
15224
  }
15225
- function ue(x, d, g) {
15225
+ function he(x, d, g) {
15226
15226
  for (var S = x.slice(d, g), F = "", O = 0; O < S.length - 1; O += 2)
15227
15227
  F += String.fromCharCode(S[O] + S[O + 1] * 256);
15228
15228
  return F;
@@ -15328,18 +15328,18 @@ Xr.write = function(t, e, n, r, s, i) {
15328
15328
  var O = Math.pow(2, 8 * S - 1);
15329
15329
  ee(this, d, g, S, O - 1, -O);
15330
15330
  }
15331
- var L = 0, j = 1, W = 0;
15331
+ var L = 0, j = 1, V = 0;
15332
15332
  for (this[g] = d & 255; ++L < S && (j *= 256); )
15333
- d < 0 && W === 0 && this[g + L - 1] !== 0 && (W = 1), this[g + L] = (d / j >> 0) - W & 255;
15333
+ d < 0 && V === 0 && this[g + L - 1] !== 0 && (V = 1), this[g + L] = (d / j >> 0) - V & 255;
15334
15334
  return g + S;
15335
15335
  }, o.prototype.writeIntBE = function(d, g, S, F) {
15336
15336
  if (d = +d, g = g >>> 0, !F) {
15337
15337
  var O = Math.pow(2, 8 * S - 1);
15338
15338
  ee(this, d, g, S, O - 1, -O);
15339
15339
  }
15340
- var L = S - 1, j = 1, W = 0;
15340
+ var L = S - 1, j = 1, V = 0;
15341
15341
  for (this[g + L] = d & 255; --L >= 0 && (j *= 256); )
15342
- d < 0 && W === 0 && this[g + L + 1] !== 0 && (W = 1), this[g + L] = (d / j >> 0) - W & 255;
15342
+ d < 0 && V === 0 && this[g + L + 1] !== 0 && (V = 1), this[g + L] = (d / j >> 0) - V & 255;
15343
15343
  return g + S;
15344
15344
  }, o.prototype.writeInt8 = function(d, g, S) {
15345
15345
  return d = +d, g = g >>> 0, S || ee(this, d, g, 1, 127, -128), d < 0 && (d = 255 + d + 1), this[g] = d & 255, g + 1;
@@ -15406,11 +15406,11 @@ Xr.write = function(t, e, n, r, s, i) {
15406
15406
  for (L = g; L < S; ++L)
15407
15407
  this[L] = d;
15408
15408
  else {
15409
- var j = o.isBuffer(d) ? d : o.from(d, F), W = j.length;
15410
- if (W === 0)
15409
+ var j = o.isBuffer(d) ? d : o.from(d, F), V = j.length;
15410
+ if (V === 0)
15411
15411
  throw new TypeError('The value "' + d + '" is invalid for argument "value"');
15412
15412
  for (L = 0; L < S - g; ++L)
15413
- this[L + g] = j[L % W];
15413
+ this[L + g] = j[L % V];
15414
15414
  }
15415
15415
  return this;
15416
15416
  };
@@ -16823,8 +16823,8 @@ function od() {
16823
16823
  if (E[I] > s)
16824
16824
  throw new Error("gb18030 decode tables conflict at byte 3");
16825
16825
  }
16826
- for (var _ = this.decodeTables[s - E[I]], V = 48; V <= 57; V++)
16827
- _[V] === e && (_[V] = n);
16826
+ for (var _ = this.decodeTables[s - E[I]], W = 48; W <= 57; W++)
16827
+ _[W] === e && (_[W] = n);
16828
16828
  }
16829
16829
  }
16830
16830
  }
@@ -16994,9 +16994,9 @@ function od() {
16994
16994
  y = s - w;
16995
16995
  continue;
16996
16996
  } else if (w <= r) {
16997
- for (var V = this.decodeTableSeq[r - w], $ = 0; $ < V.length - 1; $++)
16998
- w = V[$], p[T++] = w & 255, p[T++] = w >> 8;
16999
- w = V[V.length - 1];
16997
+ for (var W = this.decodeTableSeq[r - w], $ = 0; $ < W.length - 1; $++)
16998
+ w = W[$], p[T++] = w & 255, p[T++] = w >> 8;
16999
+ w = W[W.length - 1];
17000
17000
  } else
17001
17001
  throw new Error("iconv-lite internal error: invalid decoding table value " + w + " at " + y + "/" + E);
17002
17002
  if (w >= 65536) {
@@ -25911,7 +25911,7 @@ class Ke {
25911
25911
  throw new Error("Unsupported font data type");
25912
25912
  }
25913
25913
  }
25914
- class fe {
25914
+ class le {
25915
25915
  constructor() {
25916
25916
  this.fontMapping = {}, this.loadedFontMap = /* @__PURE__ */ new Map(), this.unsupportedChars = {}, this.missedFonts = {}, this.enableFontCache = !0, this.defaultFonts = /* @__PURE__ */ new Set(["simkai"]), this.symbolFonts = /* @__PURE__ */ new Set(["simplex", "amgdt"]), this.events = {
25917
25917
  /** Event triggered when a font cannot be found */
@@ -25925,7 +25925,7 @@ class fe {
25925
25925
  * @returns The FontManager instance
25926
25926
  */
25927
25927
  static get instance() {
25928
- return fe._instance || (fe._instance = new fe()), fe._instance;
25928
+ return le._instance || (le._instance = new le()), le._instance;
25929
25929
  }
25930
25930
  /**
25931
25931
  * Base URL to load fonts
@@ -26471,13 +26471,13 @@ class Cd {
26471
26471
  const n = [], r = [], s = /* @__PURE__ */ new Map();
26472
26472
  e.forEach((c) => {
26473
26473
  const l = c.toLowerCase(), u = this._avaiableFontMap.get(l);
26474
- u && (s.set(l, u), fe.instance.isFontLoaded(l) && n.push({
26474
+ u && (s.set(l, u), le.instance.isFontLoaded(l) && n.push({
26475
26475
  fontName: l,
26476
26476
  url: u.url,
26477
26477
  status: "Success"
26478
26478
  }), r.push(u));
26479
26479
  });
26480
- const i = await fe.instance.loadFonts(r), a = {};
26480
+ const i = await le.instance.loadFonts(r), a = {};
26481
26481
  [...n, ...i].forEach((c) => {
26482
26482
  a[c.fontName] = c;
26483
26483
  });
@@ -26490,7 +26490,7 @@ class Cd {
26490
26490
  }
26491
26491
  const h = s.get(l);
26492
26492
  if (h) {
26493
- if (fe.instance.isFontLoaded(l)) {
26493
+ if (le.instance.isFontLoaded(l)) {
26494
26494
  o.push({
26495
26495
  fontName: l,
26496
26496
  url: h.url,
@@ -26510,7 +26510,7 @@ class Cd {
26510
26510
  continue;
26511
26511
  }
26512
26512
  }
26513
- if (await fe.instance.loadFontFromCache(c)) {
26513
+ if (await le.instance.loadFontFromCache(c)) {
26514
26514
  o.push({
26515
26515
  fontName: l,
26516
26516
  url: "",
@@ -28510,11 +28510,11 @@ class Ei {
28510
28510
  } else if (a && o) {
28511
28511
  const C = this._currentContext.fontScaleFactor || 1, T = (this._maxFontSize || this.currentFontSize) / C, E = Math.abs(this.currentLayoutFontSize - T) < 1e-6;
28512
28512
  E && (this._currentContext.fontSizeScaleFactor = p * 0.7, this.calcuateLineParams());
28513
- const I = Math.max(y, m), _ = 0, V = 0, $ = this.currentLayoutFontSize, G = u - T + $, q = G + this.currentFontSize, ne = [], P = [], B = [], U = [];
28513
+ const I = Math.max(y, m), _ = 0, W = 0, $ = this.currentLayoutFontSize, G = u - T + $, q = G + this.currentFontSize, ne = [], P = [], B = [], U = [];
28514
28514
  this._hOffset = l + _, this._vOffset = q;
28515
- for (let ue = 0; ue < a.length; ue++)
28515
+ for (let he = 0; he < a.length; he++)
28516
28516
  this.processChar(
28517
- a[ue],
28517
+ a[he],
28518
28518
  ne,
28519
28519
  P,
28520
28520
  B,
@@ -28522,10 +28522,10 @@ class Ei {
28522
28522
  );
28523
28523
  n.push(...ne), r.push(...P), s.push(...B), i.push(...U);
28524
28524
  const te = [], Te = [], Qe = [], Me = [];
28525
- this._hOffset = l + V, this._vOffset = G;
28526
- for (let ue = 0; ue < o.length; ue++)
28525
+ this._hOffset = l + W, this._vOffset = G;
28526
+ for (let he = 0; he < o.length; he++)
28527
28527
  this.processChar(
28528
- o[ue],
28528
+ o[he],
28529
28529
  te,
28530
28530
  Te,
28531
28531
  Qe,
@@ -28554,7 +28554,7 @@ class Ei {
28554
28554
  s,
28555
28555
  i
28556
28556
  );
28557
- const _ = [], V = [], $ = [], G = [];
28557
+ const _ = [], W = [], $ = [], G = [];
28558
28558
  this._hOffset = l + w, this._vOffset = this.convertTopAlignedVOffset(
28559
28559
  u - this.currentFontSize * 0.6,
28560
28560
  this.currentFontSize
@@ -28563,11 +28563,11 @@ class Ei {
28563
28563
  this.processChar(
28564
28564
  o[q],
28565
28565
  _,
28566
- V,
28566
+ W,
28567
28567
  $,
28568
28568
  G
28569
28569
  );
28570
- if (n.push(..._), r.push(...V), s.push(...$), i.push(...G), c === "/" || c === "#") {
28570
+ if (n.push(..._), r.push(...W), s.push(...$), i.push(...G), c === "/" || c === "#") {
28571
28571
  const q = new R.BufferGeometry(), ne = new Float32Array([
28572
28572
  l,
28573
28573
  u - this.currentFontSize * 0.8 + this.defaultFontSize * pn,
@@ -28579,7 +28579,7 @@ class Ei {
28579
28579
  q.setAttribute(
28580
28580
  "position",
28581
28581
  new R.BufferAttribute(ne, 3)
28582
- ), q.setIndex(null), q.userData = { isDecoration: !0 }, r.push(q);
28582
+ ), q.setIndex([0, 1]), q.userData = { isDecoration: !0 }, r.push(q);
28583
28583
  }
28584
28584
  this._hOffset = l + b;
28585
28585
  }
@@ -28737,7 +28737,7 @@ class Ei {
28737
28737
  ]),
28738
28738
  3
28739
28739
  )
28740
- ), C.setIndex(null), C.userData = { isDecoration: !0 }, r.push(C);
28740
+ ), C.setIndex([0, 1]), C.userData = { isDecoration: !0 }, r.push(C);
28741
28741
  }
28742
28742
  if (this._currentContext.overline) {
28743
28743
  const C = new R.BufferGeometry(), T = y + l + v;
@@ -28754,7 +28754,7 @@ class Ei {
28754
28754
  ]),
28755
28755
  3
28756
28756
  )
28757
- ), C.setIndex(null), C.userData = { isDecoration: !0 }, r.push(C);
28757
+ ), C.setIndex([0, 1]), C.userData = { isDecoration: !0 }, r.push(C);
28758
28758
  }
28759
28759
  if (this._currentContext.strikeThrough) {
28760
28760
  const C = new R.BufferGeometry(), T = y + l / 2 - l * 0.2;
@@ -28771,7 +28771,7 @@ class Ei {
28771
28771
  ]),
28772
28772
  3
28773
28773
  )
28774
- ), C.setIndex(null), C.userData = { isDecoration: !0 }, r.push(C);
28774
+ ), C.setIndex([0, 1]), C.userData = { isDecoration: !0 }, r.push(C);
28775
28775
  }
28776
28776
  }
28777
28777
  processLastLine() {
@@ -29019,13 +29019,13 @@ const zd = [
29019
29019
  [/%%oon/gi, "\\O"],
29020
29020
  [/%%uoff/gi, "\\l"],
29021
29021
  [/%%uon/gi, "\\L"]
29022
- ], Vd = /%%([kou])/gi;
29023
- function Wd(t) {
29022
+ ], Wd = /%%([kou])/gi;
29023
+ function Vd(t) {
29024
29024
  let e = t;
29025
29025
  for (const [i, a] of zd)
29026
29026
  e = e.replace(i, a);
29027
29027
  let n = !1, r = !1, s = !1;
29028
- return e.replace(Vd, (i, a) => {
29028
+ return e.replace(Wd, (i, a) => {
29029
29029
  switch (a.toLowerCase()) {
29030
29030
  case "k":
29031
29031
  return n = !n, n ? "\\K" : "\\k";
@@ -29369,7 +29369,7 @@ class Xt extends R.Object3D {
29369
29369
  this.styleManager,
29370
29370
  this.fontManager,
29371
29371
  h
29372
- ), m = new Rd(Wd(e.text), f, {
29372
+ ), m = new Rd(Vd(e.text), f, {
29373
29373
  resetParagraphParameters: !0,
29374
29374
  yieldPropertyCommands: !0,
29375
29375
  yieldPercentSymbols: !0
@@ -29764,7 +29764,7 @@ class jd {
29764
29764
  this.defaultStyleManager = e;
29765
29765
  }
29766
29766
  async ensureInitialized() {
29767
- this.isInitialized || (await this.loadFonts(fe.instance.getFontsToLoad()), this.isInitialized = !0);
29767
+ this.isInitialized || (await this.loadFonts(le.instance.getFontsToLoad()), this.isInitialized = !0);
29768
29768
  }
29769
29769
  /**
29770
29770
  * Handles messages coming from any worker.
@@ -29858,7 +29858,7 @@ class jd {
29858
29858
  * Syncs the default font fallback chain to all workers.
29859
29859
  */
29860
29860
  async setDefaultFonts(e, n) {
29861
- fe.instance.setDefaultFonts(e), fe.instance.setSymbolFonts(n), await this.sendMessageToAllWorkers({
29861
+ le.instance.setDefaultFonts(e), le.instance.setSymbolFonts(n), await this.sendMessageToAllWorkers({
29862
29862
  type: "setDefaultFonts",
29863
29863
  data: {
29864
29864
  fonts: [...e],
@@ -29917,7 +29917,20 @@ class jd {
29917
29917
  */
29918
29918
  reconstructMText(e, n) {
29919
29919
  const r = n.color.aci === 256, s = new R.Group();
29920
- e.children.forEach((a) => {
29920
+ s.position.set(
29921
+ e.position.x,
29922
+ e.position.y,
29923
+ e.position.z
29924
+ ), s.quaternion.set(
29925
+ e.rotation.x,
29926
+ e.rotation.y,
29927
+ e.rotation.z,
29928
+ e.rotation.w
29929
+ ), s.scale.set(
29930
+ e.scale.x,
29931
+ e.scale.y,
29932
+ e.scale.z
29933
+ ), e.children.forEach((a) => {
29921
29934
  const o = new R.BufferGeometry();
29922
29935
  if (Object.keys(a.geometry.attributes).forEach((u) => {
29923
29936
  const h = a.geometry.attributes[u], f = new Float32Array(
@@ -30069,7 +30082,7 @@ class jd {
30069
30082
  }
30070
30083
  class qd {
30071
30084
  constructor() {
30072
- this.fontManager = fe.instance, this.defaultStyleManager = new Qa(), this.isInitialized = !1;
30085
+ this.fontManager = le.instance, this.defaultStyleManager = new Qa(), this.isInitialized = !1;
30073
30086
  }
30074
30087
  /**
30075
30088
  * Used to manage materials used by texts
@@ -30152,7 +30165,7 @@ class qd {
30152
30165
  destroy() {
30153
30166
  }
30154
30167
  async ensureInitialized() {
30155
- this.isInitialized || (await this.loadFonts(fe.instance.getFontsToLoad()), this.isInitialized = !0);
30168
+ this.isInitialized || (await this.loadFonts(le.instance.getFontsToLoad()), this.isInitialized = !0);
30156
30169
  }
30157
30170
  }
30158
30171
  class Zd {
@@ -30164,7 +30177,17 @@ class Zd {
30164
30177
  * when render mode is 'worker'.
30165
30178
  */
30166
30179
  constructor(e = "main", n = {}) {
30167
- this.defaultMode = e, this.mainThreadRenderer = new qd(), this.webWorkerRenderer = new jd(n), this.renderer = this.mainThreadRenderer, e === "worker" && (this.renderer = this.webWorkerRenderer);
30180
+ this.webWorkerRenderer = null, this.webWorkerConfigured = !1, this.defaultMode = e, this.workerConfig = n, this.mainThreadRenderer = new qd(), this.renderer = this.mainThreadRenderer, e === "worker" && (this.renderer = this.ensureWebWorkerRenderer());
30181
+ }
30182
+ ensureWebWorkerRenderer() {
30183
+ return this.webWorkerRenderer || (this.webWorkerRenderer = new jd(this.workerConfig), this.webWorkerRenderer.styleManager = this.mainThreadRenderer.styleManager, this.webWorkerConfigured = !1), this.webWorkerRenderer;
30184
+ }
30185
+ async activateWebWorkerRenderer() {
30186
+ const e = this.ensureWebWorkerRenderer();
30187
+ return this.webWorkerConfigured || (await e.setDefaultFonts(
30188
+ [...le.instance.defaultFonts],
30189
+ [...le.instance.symbolFonts]
30190
+ ), this.webWorkerConfigured = !0), e;
30168
30191
  }
30169
30192
  /**
30170
30193
  * Sets one new style manager to override the default style manager.
@@ -30177,14 +30200,14 @@ class Zd {
30177
30200
  * @param value - New style manager
30178
30201
  */
30179
30202
  setStyleManager(e) {
30180
- this.mainThreadRenderer.styleManager = e, this.webWorkerRenderer.styleManager = e;
30203
+ this.mainThreadRenderer.styleManager = e, this.webWorkerRenderer && (this.webWorkerRenderer.styleManager = e);
30181
30204
  }
30182
30205
  /**
30183
30206
  * Sets the default rendering mmode
30184
30207
  * @param mode The default rendering mode
30185
30208
  */
30186
30209
  setDefaultMode(e) {
30187
- this.defaultMode !== e && (this.defaultMode = e, e === "worker" ? this.renderer = this.webWorkerRenderer : this.renderer = this.mainThreadRenderer);
30210
+ this.defaultMode !== e && (this.defaultMode = e, e === "worker" ? this.renderer = this.ensureWebWorkerRenderer() : this.renderer = this.mainThreadRenderer);
30188
30211
  }
30189
30212
  /**
30190
30213
  * Set URL to load fonts
@@ -30205,7 +30228,7 @@ class Zd {
30205
30228
  * @param mode - Rendering mode used. If undefined, the default rendering mode is used.
30206
30229
  */
30207
30230
  async asyncRenderMText(e, n, r = Le(), s) {
30208
- return s ? (s === "worker" ? this.webWorkerRenderer : this.mainThreadRenderer).asyncRenderMText(e, n, r) : this.renderer.asyncRenderMText(
30231
+ return (s ?? this.defaultMode) === "worker" ? (await this.activateWebWorkerRenderer()).asyncRenderMText(e, n, r) : this.mainThreadRenderer.asyncRenderMText(
30209
30232
  e,
30210
30233
  n,
30211
30234
  r
@@ -30241,22 +30264,22 @@ class Zd {
30241
30264
  * Sets the default font fallback chain on the active renderer and workers.
30242
30265
  */
30243
30266
  async setDefaultFonts(e) {
30244
- fe.instance.setDefaultFonts(e), await this.webWorkerRenderer.setDefaultFonts(
30245
- [...fe.instance.defaultFonts],
30246
- [...fe.instance.symbolFonts]
30247
- );
30267
+ le.instance.setDefaultFonts(e), this.webWorkerRenderer && (await this.webWorkerRenderer.setDefaultFonts(
30268
+ [...le.instance.defaultFonts],
30269
+ [...le.instance.symbolFonts]
30270
+ ), this.webWorkerConfigured = !0);
30248
30271
  }
30249
30272
  /**
30250
30273
  * Returns font names for a predefined default-font preset.
30251
30274
  */
30252
30275
  getDefaultFontsPreset(e) {
30253
- return fe.instance.getDefaultFontsPreset(e);
30276
+ return le.instance.getDefaultFontsPreset(e);
30254
30277
  }
30255
30278
  /**
30256
30279
  * Returns symbol-font names for a predefined preset.
30257
30280
  */
30258
30281
  getSymbolFontsPreset(e) {
30259
- return fe.instance.getSymbolFontsPreset(e);
30282
+ return le.instance.getSymbolFontsPreset(e);
30260
30283
  }
30261
30284
  /**
30262
30285
  * Load fonts using the current mode
@@ -30276,13 +30299,24 @@ class Zd {
30276
30299
  * with the web worker renderer.
30277
30300
  */
30278
30301
  async cacheFont(e, n, r, s) {
30279
- return fe.instance.cacheFont(e, n, r, s);
30302
+ return le.instance.cacheFont(e, n, r, s);
30303
+ }
30304
+ /**
30305
+ * Terminate web workers and release their memory.
30306
+ *
30307
+ * The unified renderer keeps working on the main thread. Workers are
30308
+ * recreated lazily the next time worker rendering is requested.
30309
+ * Safe to call when no workers were created.
30310
+ */
30311
+ terminateWorkers() {
30312
+ var e;
30313
+ (e = this.webWorkerRenderer) == null || e.terminate(), this.webWorkerRenderer = null, this.webWorkerConfigured = !1, this.renderer = this.mainThreadRenderer;
30280
30314
  }
30281
30315
  /**
30282
30316
  * Clean up resources
30283
30317
  */
30284
30318
  destroy() {
30285
- this.webWorkerRenderer && this.webWorkerRenderer.terminate(), this.mainThreadRenderer.destroy();
30319
+ this.terminateWorkers(), this.mainThreadRenderer.destroy();
30286
30320
  }
30287
30321
  }
30288
30322
  export {
@@ -30294,7 +30328,7 @@ export {
30294
30328
  Cd as DefaultFontLoader,
30295
30329
  is as EventManager,
30296
30330
  Ke as FontFactory,
30297
- fe as FontManager,
30331
+ le as FontManager,
30298
30332
  Dd as LINE_SPACING_SCALE_FACTOR,
30299
30333
  Md as MIN_REASONABLE_MTEXT_WIDTH_HEIGHT_RATIO,
30300
30334
  Xt as MText,