@mlightcad/mtext-renderer 0.7.0 → 0.7.1

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
@@ -674,60 +674,6 @@ const Ia = (t) => t.split("/").pop(), kn = (t) => {
674
674
  16777215,
675
675
  0
676
676
  ], Ji = (t) => Qi[t];
677
- let es = class {
678
- constructor(e) {
679
- this.isFont = !0, this.type = "Font", this.data = e;
680
- }
681
- generateShapes(e, r = 100) {
682
- const n = [], a = ts(e, r, this.data);
683
- for (let i = 0, s = a.length; i < s; i++)
684
- n.push(...a[i].toShapes());
685
- return n;
686
- }
687
- };
688
- function ts(t, e, r) {
689
- const n = Array.from(t), a = e / r.resolution, i = (r.boundingBox.yMax - r.boundingBox.yMin + r.underlineThickness) * a, s = [];
690
- let o = 0, c = 0;
691
- for (let u = 0; u < n.length; u++) {
692
- const h = n[u];
693
- if (h === `
694
- `)
695
- o = 0, c -= i;
696
- else {
697
- const d = rs(h, a, o, c, r);
698
- o += d.offsetX, s.push(d.path);
699
- }
700
- }
701
- return s;
702
- }
703
- function rs(t, e, r, n, a) {
704
- const i = a.glyphs[t] || a.glyphs["?"];
705
- if (!i) {
706
- console.error('THREE.Font: character "' + t + '" does not exists in font family ' + a.familyName + ".");
707
- return;
708
- }
709
- const s = new Di();
710
- let o, c, u, h, d, p, g, x;
711
- if (i.o) {
712
- const m = i._cachedOutline || (i._cachedOutline = i.o.split(" "));
713
- for (let F = 0, y = m.length; F < y; )
714
- switch (m[F++]) {
715
- case "m":
716
- o = m[F++] * e + r, c = m[F++] * e + n, s.moveTo(o, c);
717
- break;
718
- case "l":
719
- o = m[F++] * e + r, c = m[F++] * e + n, s.lineTo(o, c);
720
- break;
721
- case "q":
722
- u = m[F++] * e + r, h = m[F++] * e + n, d = m[F++] * e + r, p = m[F++] * e + n, s.quadraticCurveTo(d, p, u, h);
723
- break;
724
- case "b":
725
- u = m[F++] * e + r, h = m[F++] * e + n, d = m[F++] * e + r, p = m[F++] * e + n, g = m[F++] * e + r, x = m[F++] * e + n, s.bezierCurveTo(d, p, g, x, u, h);
726
- break;
727
- }
728
- }
729
- return { offsetX: i.ha * e, path: s };
730
- }
731
677
  /*! https://mths.be/codepointat v0.2.0 by @mathias */
732
678
  String.prototype.codePointAt || function() {
733
679
  var t = function() {
@@ -759,10 +705,10 @@ var jr = 0, Da = -3;
759
705
  function mt() {
760
706
  this.table = new Uint16Array(16), this.trans = new Uint16Array(288);
761
707
  }
762
- function ns(t, e) {
708
+ function es(t, e) {
763
709
  this.source = t, this.sourceIndex = 0, this.tag = 0, this.bitcount = 0, this.dest = e, this.destLen = 0, this.ltree = new mt(), this.dtree = new mt();
764
710
  }
765
- var _a = new mt(), Pa = new mt(), Zr = new Uint8Array(30), $r = new Uint16Array(30), Na = new Uint8Array(30), Ga = new Uint16Array(30), as = new Uint8Array([
711
+ var _a = new mt(), Pa = new mt(), Zr = new Uint8Array(30), $r = new Uint16Array(30), Na = new Uint8Array(30), Ga = new Uint16Array(30), ts = new Uint8Array([
766
712
  16,
767
713
  17,
768
714
  18,
@@ -792,7 +738,7 @@ function Ha(t, e, r, n) {
792
738
  for (i = n, a = 0; a < 30; ++a)
793
739
  e[a] = i, i += 1 << t[a];
794
740
  }
795
- function is(t, e) {
741
+ function rs(t, e) {
796
742
  var r;
797
743
  for (r = 0; r < 7; ++r)
798
744
  t.table[r] = 0;
@@ -821,7 +767,7 @@ function or(t, e, r, n) {
821
767
  for (a = 0; a < n; ++a)
822
768
  e[r + a] && (t.trans[En[e[r + a]]++] = a);
823
769
  }
824
- function ss(t) {
770
+ function ns(t) {
825
771
  t.bitcount-- || (t.tag = t.source[t.sourceIndex++], t.bitcount = 7);
826
772
  var e = t.tag & 1;
827
773
  return t.tag >>>= 1, e;
@@ -843,13 +789,13 @@ function Pr(t, e) {
843
789
  while (n >= 0);
844
790
  return t.tag = i, t.bitcount -= a, e.trans[r + n];
845
791
  }
846
- function os(t, e, r) {
792
+ function as(t, e, r) {
847
793
  var n, a, i, s, o, c;
848
794
  for (n = Ae(t, 5, 257), a = Ae(t, 5, 1), i = Ae(t, 4, 4), s = 0; s < 19; ++s)
849
795
  Ue[s] = 0;
850
796
  for (s = 0; s < i; ++s) {
851
797
  var u = Ae(t, 3, 0);
852
- Ue[as[s]] = u;
798
+ Ue[ts[s]] = u;
853
799
  }
854
800
  for (or(Tn, Ue, 0, 19), o = 0; o < n + a; ) {
855
801
  var h = Pr(t, Tn);
@@ -888,7 +834,7 @@ function Cn(t, e, r) {
888
834
  }
889
835
  }
890
836
  }
891
- function cs(t) {
837
+ function is(t) {
892
838
  for (var e, r, n; t.bitcount > 8; )
893
839
  t.sourceIndex--, t.bitcount -= 8;
894
840
  if (e = t.source[t.sourceIndex + 1], e = 256 * e + t.source[t.sourceIndex], r = t.source[t.sourceIndex + 3], r = 256 * r + t.source[t.sourceIndex + 2], e !== (~r & 65535))
@@ -897,18 +843,18 @@ function cs(t) {
897
843
  t.dest[t.destLen++] = t.source[t.sourceIndex++];
898
844
  return t.bitcount = 0, jr;
899
845
  }
900
- function us(t, e) {
901
- var r = new ns(t, e), n, a, i;
846
+ function ss(t, e) {
847
+ var r = new es(t, e), n, a, i;
902
848
  do {
903
- switch (n = ss(r), a = Ae(r, 2, 0), a) {
849
+ switch (n = ns(r), a = Ae(r, 2, 0), a) {
904
850
  case 0:
905
- i = cs(r);
851
+ i = is(r);
906
852
  break;
907
853
  case 1:
908
854
  i = Cn(r, _a, Pa);
909
855
  break;
910
856
  case 2:
911
- os(r, r.ltree, r.dtree), i = Cn(r, r.ltree, r.dtree);
857
+ as(r, r.ltree, r.dtree), i = Cn(r, r.ltree, r.dtree);
912
858
  break;
913
859
  default:
914
860
  i = Da;
@@ -918,12 +864,12 @@ function us(t, e) {
918
864
  } while (!n);
919
865
  return r.destLen < r.dest.length ? typeof r.dest.slice == "function" ? r.dest.slice(0, r.destLen) : r.dest.subarray(0, r.destLen) : r.dest;
920
866
  }
921
- is(_a, Pa);
867
+ rs(_a, Pa);
922
868
  Ha(Zr, $r, 4, 3);
923
869
  Ha(Na, Ga, 2, 1);
924
870
  Zr[28] = 0;
925
871
  $r[28] = 258;
926
- var hs = us;
872
+ var os = ss;
927
873
  function rt(t, e, r, n, a) {
928
874
  return Math.pow(1 - a, 3) * t + 3 * Math.pow(1 - a, 2) * a * e + 3 * (1 - a) * Math.pow(a, 2) * r + Math.pow(a, 3) * n;
929
875
  }
@@ -946,19 +892,19 @@ Ve.prototype.addBezier = function(t, e, r, n, a, i, s, o) {
946
892
  var c = [t, e], u = [r, n], h = [a, i], d = [s, o];
947
893
  this.addPoint(t, e), this.addPoint(s, o);
948
894
  for (var p = 0; p <= 1; p++) {
949
- var g = 6 * c[p] - 12 * u[p] + 6 * h[p], x = -3 * c[p] + 9 * u[p] - 9 * h[p] + 3 * d[p], m = 3 * u[p] - 3 * c[p];
950
- if (x === 0) {
895
+ var g = 6 * c[p] - 12 * u[p] + 6 * h[p], S = -3 * c[p] + 9 * u[p] - 9 * h[p] + 3 * d[p], m = 3 * u[p] - 3 * c[p];
896
+ if (S === 0) {
951
897
  if (g === 0)
952
898
  continue;
953
899
  var F = -m / g;
954
900
  0 < F && F < 1 && (p === 0 && this.addX(rt(c[p], u[p], h[p], d[p], F)), p === 1 && this.addY(rt(c[p], u[p], h[p], d[p], F)));
955
901
  continue;
956
902
  }
957
- var y = Math.pow(g, 2) - 4 * m * x;
903
+ var y = Math.pow(g, 2) - 4 * m * S;
958
904
  if (!(y < 0)) {
959
- var S = (-g + Math.sqrt(y)) / (2 * x);
960
- 0 < S && S < 1 && (p === 0 && this.addX(rt(c[p], u[p], h[p], d[p], S)), p === 1 && this.addY(rt(c[p], u[p], h[p], d[p], S)));
961
- var w = (-g - Math.sqrt(y)) / (2 * x);
905
+ var x = (-g + Math.sqrt(y)) / (2 * S);
906
+ 0 < x && x < 1 && (p === 0 && this.addX(rt(c[p], u[p], h[p], d[p], x)), p === 1 && this.addY(rt(c[p], u[p], h[p], d[p], x)));
907
+ var w = (-g - Math.sqrt(y)) / (2 * S);
962
908
  0 < w && w < 1 && (p === 0 && this.addX(rt(c[p], u[p], h[p], d[p], w)), p === 1 && this.addY(rt(c[p], u[p], h[p], d[p], w)));
963
909
  }
964
910
  }
@@ -1262,7 +1208,7 @@ ct.MACSTRING = function(t, e, r, n) {
1262
1208
  return i;
1263
1209
  }
1264
1210
  };
1265
- var It = typeof WeakMap == "function" && /* @__PURE__ */ new WeakMap(), Dt, ls = function(t) {
1211
+ var It = typeof WeakMap == "function" && /* @__PURE__ */ new WeakMap(), Dt, cs = function(t) {
1266
1212
  if (!Dt) {
1267
1213
  Dt = {};
1268
1214
  for (var e in Nr)
@@ -1284,7 +1230,7 @@ var It = typeof WeakMap == "function" && /* @__PURE__ */ new WeakMap(), Dt, ls =
1284
1230
  }
1285
1231
  };
1286
1232
  O.MACSTRING = function(t, e) {
1287
- var r = ls(e);
1233
+ var r = cs(e);
1288
1234
  if (r !== void 0) {
1289
1235
  for (var n = [], a = 0; a < t.length; a++) {
1290
1236
  var i = t.charCodeAt(a);
@@ -1302,12 +1248,12 @@ P.MACSTRING = function(t, e) {
1302
1248
  function Gr(t) {
1303
1249
  return t >= -128 && t <= 127;
1304
1250
  }
1305
- function fs(t, e, r) {
1251
+ function us(t, e, r) {
1306
1252
  for (var n = 0, a = t.length; e < a && n < 64 && t[e] === 0; )
1307
1253
  ++e, ++n;
1308
1254
  return r.push(128 | n - 1), e;
1309
1255
  }
1310
- function ps(t, e, r) {
1256
+ function hs(t, e, r) {
1311
1257
  for (var n = 0, a = t.length, i = e; i < a && n < 64; ) {
1312
1258
  var s = t[i];
1313
1259
  if (!Gr(s) || s === 0 && i + 1 < a && t[i + 1] === 0)
@@ -1319,7 +1265,7 @@ function ps(t, e, r) {
1319
1265
  r.push(t[o] + 256 & 255);
1320
1266
  return i;
1321
1267
  }
1322
- function ds(t, e, r) {
1268
+ function ls(t, e, r) {
1323
1269
  for (var n = 0, a = t.length, i = e; i < a && n < 64; ) {
1324
1270
  var s = t[i];
1325
1271
  if (s === 0 || Gr(s) && i + 1 < a && Gr(t[i + 1]))
@@ -1336,7 +1282,7 @@ function ds(t, e, r) {
1336
1282
  O.VARDELTAS = function(t) {
1337
1283
  for (var e = 0, r = []; e < t.length; ) {
1338
1284
  var n = t[e];
1339
- n === 0 ? e = fs(t, e, r) : n >= -128 && n <= 127 ? e = ps(t, e, r) : e = ds(t, e, r);
1285
+ n === 0 ? e = us(t, e, r) : n >= -128 && n <= 127 ? e = hs(t, e, r) : e = ls(t, e, r);
1340
1286
  }
1341
1287
  return r;
1342
1288
  };
@@ -1582,7 +1528,7 @@ function On(t, e) {
1582
1528
  function $t(t, e) {
1583
1529
  return t.getUint16(e, !1);
1584
1530
  }
1585
- function gs(t, e) {
1531
+ function fs(t, e) {
1586
1532
  return t.getInt16(e, !1);
1587
1533
  }
1588
1534
  function Kr(t, e) {
@@ -1592,27 +1538,27 @@ function Wa(t, e) {
1592
1538
  var r = t.getInt16(e, !1), n = t.getUint16(e + 2, !1);
1593
1539
  return r + n / 65535;
1594
1540
  }
1595
- function vs(t, e) {
1541
+ function ps(t, e) {
1596
1542
  for (var r = "", n = e; n < e + 4; n += 1)
1597
1543
  r += String.fromCharCode(t.getInt8(n));
1598
1544
  return r;
1599
1545
  }
1600
- function ys(t, e, r) {
1546
+ function ds(t, e, r) {
1601
1547
  for (var n = 0, a = 0; a < r; a += 1)
1602
1548
  n <<= 8, n += t.getUint8(e + a);
1603
1549
  return n;
1604
1550
  }
1605
- function ms(t, e, r) {
1551
+ function gs(t, e, r) {
1606
1552
  for (var n = [], a = e; a < r; a += 1)
1607
1553
  n.push(t.getUint8(a));
1608
1554
  return n;
1609
1555
  }
1610
- function bs(t) {
1556
+ function vs(t) {
1611
1557
  for (var e = "", r = 0; r < t.length; r += 1)
1612
1558
  e += String.fromCharCode(t[r]);
1613
1559
  return e;
1614
1560
  }
1615
- var xs = {
1561
+ var ys = {
1616
1562
  byte: 1,
1617
1563
  uShort: 2,
1618
1564
  short: 2,
@@ -1676,7 +1622,7 @@ C.prototype.parseVersion = function(t) {
1676
1622
  return this.relativeOffset += 4, t === void 0 && (t = 4096), e + r / t / 10;
1677
1623
  };
1678
1624
  C.prototype.skip = function(t, e) {
1679
- e === void 0 && (e = 1), this.relativeOffset += xs[t] * e;
1625
+ e === void 0 && (e = 1), this.relativeOffset += ys[t] * e;
1680
1626
  };
1681
1627
  C.prototype.parseULongList = function(t) {
1682
1628
  t === void 0 && (t = this.parseULong());
@@ -1914,16 +1860,16 @@ var D = {
1914
1860
  getCard8: On,
1915
1861
  getUShort: $t,
1916
1862
  getCard16: $t,
1917
- getShort: gs,
1863
+ getShort: fs,
1918
1864
  getULong: Kr,
1919
1865
  getFixed: Wa,
1920
- getTag: vs,
1921
- getOffset: ys,
1922
- getBytes: ms,
1923
- bytesToString: bs,
1866
+ getTag: ps,
1867
+ getOffset: ds,
1868
+ getBytes: gs,
1869
+ bytesToString: vs,
1924
1870
  Parser: C
1925
1871
  };
1926
- function Ss(t, e) {
1872
+ function ms(t, e) {
1927
1873
  e.parseUShort(), t.length = e.parseULong(), t.language = e.parseULong();
1928
1874
  var r;
1929
1875
  t.groupCount = r = e.parseULong(), t.glyphIndexMap = {};
@@ -1931,15 +1877,15 @@ function Ss(t, e) {
1931
1877
  for (var a = e.parseULong(), i = e.parseULong(), s = e.parseULong(), o = a; o <= i; o += 1)
1932
1878
  t.glyphIndexMap[o] = s, s++;
1933
1879
  }
1934
- function ws(t, e, r, n, a) {
1880
+ function bs(t, e, r, n, a) {
1935
1881
  t.length = e.parseUShort(), t.language = e.parseUShort();
1936
1882
  var i;
1937
1883
  t.segCount = i = e.parseUShort() >> 1, e.skip("uShort", 3), t.glyphIndexMap = {};
1938
1884
  for (var s = new D.Parser(r, n + a + 14), o = new D.Parser(r, n + a + 16 + i * 2), c = new D.Parser(r, n + a + 16 + i * 4), u = new D.Parser(r, n + a + 16 + i * 6), h = n + a + 16 + i * 8, d = 0; d < i - 1; d += 1)
1939
- for (var p = void 0, g = s.parseUShort(), x = o.parseUShort(), m = c.parseShort(), F = u.parseUShort(), y = x; y <= g; y += 1)
1940
- F !== 0 ? (h = u.offset + u.relativeOffset - 2, h += F, h += (y - x) * 2, p = D.getUShort(r, h), p !== 0 && (p = p + m & 65535)) : p = y + m & 65535, t.glyphIndexMap[y] = p;
1885
+ for (var p = void 0, g = s.parseUShort(), S = o.parseUShort(), m = c.parseShort(), F = u.parseUShort(), y = S; y <= g; y += 1)
1886
+ F !== 0 ? (h = u.offset + u.relativeOffset - 2, h += F, h += (y - S) * 2, p = D.getUShort(r, h), p !== 0 && (p = p + m & 65535)) : p = y + m & 65535, t.glyphIndexMap[y] = p;
1941
1887
  }
1942
- function Fs(t, e) {
1888
+ function xs(t, e) {
1943
1889
  var r = {};
1944
1890
  r.version = D.getUShort(t, e), _.argument(r.version === 0, "cmap table version should be 0."), r.numTables = D.getUShort(t, e + 2);
1945
1891
  for (var n = -1, a = r.numTables - 1; a >= 0; a -= 1) {
@@ -1953,14 +1899,14 @@ function Fs(t, e) {
1953
1899
  throw new Error("No valid cmap sub-tables found.");
1954
1900
  var o = new D.Parser(t, e + n);
1955
1901
  if (r.format = o.parseUShort(), r.format === 12)
1956
- Ss(r, o);
1902
+ ms(r, o);
1957
1903
  else if (r.format === 4)
1958
- ws(r, o, t, e, n);
1904
+ bs(r, o, t, e, n);
1959
1905
  else
1960
1906
  throw new Error("Only format 4 and 12 cmap tables are supported (found format " + r.format + ").");
1961
1907
  return r;
1962
1908
  }
1963
- function ks(t, e, r) {
1909
+ function Ss(t, e, r) {
1964
1910
  t.segments.push({
1965
1911
  end: e,
1966
1912
  start: e,
@@ -1969,7 +1915,7 @@ function ks(t, e, r) {
1969
1915
  glyphIndex: r
1970
1916
  });
1971
1917
  }
1972
- function Ts(t) {
1918
+ function ws(t) {
1973
1919
  t.segments.push({
1974
1920
  end: 65535,
1975
1921
  start: 65535,
@@ -1977,7 +1923,7 @@ function Ts(t) {
1977
1923
  offset: 0
1978
1924
  });
1979
1925
  }
1980
- function Es(t) {
1926
+ function Fs(t) {
1981
1927
  var e = !0, r;
1982
1928
  for (r = t.length - 1; r > 0; r -= 1) {
1983
1929
  var n = t.get(r);
@@ -2013,20 +1959,20 @@ function Es(t) {
2013
1959
  var i = new M.Table("cmap", a);
2014
1960
  for (i.segments = [], r = 0; r < t.length; r += 1) {
2015
1961
  for (var s = t.get(r), o = 0; o < s.unicodes.length; o += 1)
2016
- ks(i, s.unicodes[o], r);
2017
- i.segments = i.segments.sort(function(S, w) {
2018
- return S.start - w.start;
1962
+ Ss(i, s.unicodes[o], r);
1963
+ i.segments = i.segments.sort(function(x, w) {
1964
+ return x.start - w.start;
2019
1965
  });
2020
1966
  }
2021
- Ts(i);
2022
- var c = i.segments.length, u = 0, h = [], d = [], p = [], g = [], x = [], m = [];
1967
+ ws(i);
1968
+ var c = i.segments.length, u = 0, h = [], d = [], p = [], g = [], S = [], m = [];
2023
1969
  for (r = 0; r < c; r += 1) {
2024
1970
  var F = i.segments[r];
2025
- F.end <= 65535 && F.start <= 65535 ? (h = h.concat({ name: "end_" + r, type: "USHORT", value: F.end }), d = d.concat({ name: "start_" + r, type: "USHORT", value: F.start }), p = p.concat({ name: "idDelta_" + r, type: "SHORT", value: F.delta }), g = g.concat({ name: "idRangeOffset_" + r, type: "USHORT", value: F.offset }), F.glyphId !== void 0 && (x = x.concat({ name: "glyph_" + r, type: "USHORT", value: F.glyphId }))) : u += 1, !e && F.glyphIndex !== void 0 && (m = m.concat({ name: "cmap12Start_" + r, type: "ULONG", value: F.start }), m = m.concat({ name: "cmap12End_" + r, type: "ULONG", value: F.end }), m = m.concat({ name: "cmap12Glyph_" + r, type: "ULONG", value: F.glyphIndex }));
1971
+ F.end <= 65535 && F.start <= 65535 ? (h = h.concat({ name: "end_" + r, type: "USHORT", value: F.end }), d = d.concat({ name: "start_" + r, type: "USHORT", value: F.start }), p = p.concat({ name: "idDelta_" + r, type: "SHORT", value: F.delta }), g = g.concat({ name: "idRangeOffset_" + r, type: "USHORT", value: F.offset }), F.glyphId !== void 0 && (S = S.concat({ name: "glyph_" + r, type: "USHORT", value: F.glyphId }))) : u += 1, !e && F.glyphIndex !== void 0 && (m = m.concat({ name: "cmap12Start_" + r, type: "ULONG", value: F.start }), m = m.concat({ name: "cmap12End_" + r, type: "ULONG", value: F.end }), m = m.concat({ name: "cmap12Glyph_" + r, type: "ULONG", value: F.glyphIndex }));
2026
1972
  }
2027
- if (i.segCountX2 = (c - u) * 2, i.searchRange = Math.pow(2, Math.floor(Math.log(c - u) / Math.log(2))) * 2, i.entrySelector = Math.log(i.searchRange / 2) / Math.log(2), i.rangeShift = i.segCountX2 - i.searchRange, i.fields = i.fields.concat(h), i.fields.push({ name: "reservedPad", type: "USHORT", value: 0 }), i.fields = i.fields.concat(d), i.fields = i.fields.concat(p), i.fields = i.fields.concat(g), i.fields = i.fields.concat(x), i.cmap4Length = 14 + // Subtable header
1973
+ if (i.segCountX2 = (c - u) * 2, i.searchRange = Math.pow(2, Math.floor(Math.log(c - u) / Math.log(2))) * 2, i.entrySelector = Math.log(i.searchRange / 2) / Math.log(2), i.rangeShift = i.segCountX2 - i.searchRange, i.fields = i.fields.concat(h), i.fields.push({ name: "reservedPad", type: "USHORT", value: 0 }), i.fields = i.fields.concat(d), i.fields = i.fields.concat(p), i.fields = i.fields.concat(g), i.fields = i.fields.concat(S), i.cmap4Length = 14 + // Subtable header
2028
1974
  h.length * 2 + 2 + // reservedPad
2029
- d.length * 2 + p.length * 2 + g.length * 2 + x.length * 2, !e) {
1975
+ d.length * 2 + p.length * 2 + g.length * 2 + S.length * 2, !e) {
2030
1976
  var y = 16 + // Subtable header
2031
1977
  m.length * 4;
2032
1978
  i.cmap12Offset = 12 + 2 * 2 + 4 + i.cmap4Length, i.fields = i.fields.concat([
@@ -2039,7 +1985,7 @@ function Es(t) {
2039
1985
  }
2040
1986
  return i;
2041
1987
  }
2042
- var qa = { parse: Fs, make: Es }, Wt = [
1988
+ var qa = { parse: xs, make: Fs }, Wt = [
2043
1989
  ".notdef",
2044
1990
  "space",
2045
1991
  "exclam",
@@ -2431,7 +2377,7 @@ var qa = { parse: Fs, make: Es }, Wt = [
2431
2377
  "Regular",
2432
2378
  "Roman",
2433
2379
  "Semibold"
2434
- ], Cs = [
2380
+ ], ks = [
2435
2381
  "",
2436
2382
  "",
2437
2383
  "",
@@ -2684,7 +2630,7 @@ var qa = { parse: Fs, make: Es }, Wt = [
2684
2630
  "oslash",
2685
2631
  "oe",
2686
2632
  "germandbls"
2687
- ], Us = [
2633
+ ], Ts = [
2688
2634
  "",
2689
2635
  "",
2690
2636
  "",
@@ -3255,7 +3201,7 @@ Qr.prototype.nameToGlyphIndex = function(t) {
3255
3201
  Qr.prototype.glyphIndexToName = function(t) {
3256
3202
  return this.names[t];
3257
3203
  };
3258
- function As(t) {
3204
+ function Es(t) {
3259
3205
  for (var e, r = t.tables.cmap.glyphIndexMap, n = Object.keys(r), a = 0; a < n.length; a += 1) {
3260
3206
  var i = n[a], s = r[i];
3261
3207
  e = t.glyphs.get(s), e.addUnicode(parseInt(i));
@@ -3263,7 +3209,7 @@ function As(t) {
3263
3209
  for (var o = 0; o < t.glyphs.length; o += 1)
3264
3210
  e = t.glyphs.get(o), t.cffEncoding ? t.isCIDFont ? e.name = "gid" + o : e.name = t.cffEncoding.charset[o] : t.glyphNames.names && (e.name = t.glyphNames.glyphIndexToName(o));
3265
3211
  }
3266
- function Bs(t) {
3212
+ function Cs(t) {
3267
3213
  t._IndexToUnicodeMap = {};
3268
3214
  for (var e = t.tables.cmap.glyphIndexMap, r = Object.keys(e), n = 0; n < r.length; n += 1) {
3269
3215
  var a = r[n], i = e[a];
@@ -3272,14 +3218,14 @@ function Bs(t) {
3272
3218
  } : t._IndexToUnicodeMap[i].unicodes.push(parseInt(a));
3273
3219
  }
3274
3220
  }
3275
- function Os(t, e) {
3276
- e.lowMemory ? Bs(t) : As(t);
3221
+ function Us(t, e) {
3222
+ e.lowMemory ? Cs(t) : Es(t);
3277
3223
  }
3278
- function Ls(t, e, r, n, a) {
3224
+ function As(t, e, r, n, a) {
3279
3225
  t.beginPath(), t.moveTo(e, r), t.lineTo(n, a), t.stroke();
3280
3226
  }
3281
- var Ye = { line: Ls };
3282
- function Rs(t, e) {
3227
+ var Ye = { line: As };
3228
+ function Bs(t, e) {
3283
3229
  var r = e || new se();
3284
3230
  return {
3285
3231
  configurable: !0,
@@ -3295,7 +3241,7 @@ function xe(t) {
3295
3241
  this.bindConstructorValues(t);
3296
3242
  }
3297
3243
  xe.prototype.bindConstructorValues = function(t) {
3298
- this.index = t.index || 0, this.name = t.name || null, this.unicode = t.unicode || void 0, this.unicodes = t.unicodes || t.unicode !== void 0 ? [t.unicode] : [], "xMin" in t && (this.xMin = t.xMin), "yMin" in t && (this.yMin = t.yMin), "xMax" in t && (this.xMax = t.xMax), "yMax" in t && (this.yMax = t.yMax), "advanceWidth" in t && (this.advanceWidth = t.advanceWidth), Object.defineProperty(this, "path", Rs(this, t.path));
3244
+ this.index = t.index || 0, this.name = t.name || null, this.unicode = t.unicode || void 0, this.unicodes = t.unicodes || t.unicode !== void 0 ? [t.unicode] : [], "xMin" in t && (this.xMin = t.xMin), "yMin" in t && (this.yMin = t.yMin), "xMax" in t && (this.xMax = t.xMax), "yMax" in t && (this.yMax = t.yMax), "advanceWidth" in t && (this.advanceWidth = t.advanceWidth), Object.defineProperty(this, "path", Bs(this, t.path));
3299
3245
  };
3300
3246
  xe.prototype.addUnicode = function(t) {
3301
3247
  this.unicodes.length === 0 && (this.unicode = t), this.unicodes.push(t);
@@ -3360,10 +3306,10 @@ xe.prototype.draw = function(t, e, r, n, a) {
3360
3306
  this.getPath(e, r, n, a).draw(t);
3361
3307
  };
3362
3308
  xe.prototype.drawPoints = function(t, e, r, n) {
3363
- function a(d, p, g, x) {
3309
+ function a(d, p, g, S) {
3364
3310
  t.beginPath();
3365
3311
  for (var m = 0; m < d.length; m += 1)
3366
- t.moveTo(p + d[m].x * x, g + d[m].y * x), t.arc(p + d[m].x * x, g + d[m].y * x, 2, 0, Math.PI * 2, !1);
3312
+ t.moveTo(p + d[m].x * S, g + d[m].y * S), t.arc(p + d[m].x * S, g + d[m].y * S, 2, 0, Math.PI * 2, !1);
3367
3313
  t.closePath(), t.fill();
3368
3314
  }
3369
3315
  e = e !== void 0 ? e : 0, r = r !== void 0 ? r : 0, n = n !== void 0 ? n : 24;
@@ -3414,10 +3360,10 @@ Jr.prototype.get = function(t) {
3414
3360
  Jr.prototype.push = function(t, e) {
3415
3361
  this.glyphs[t] = e, this.length++;
3416
3362
  };
3417
- function Ms(t, e) {
3363
+ function Os(t, e) {
3418
3364
  return new xe({ index: e, font: t });
3419
3365
  }
3420
- function Is(t, e, r, n, a, i) {
3366
+ function Ls(t, e, r, n, a, i) {
3421
3367
  return function() {
3422
3368
  var s = new xe({ index: e, font: t });
3423
3369
  return s.path = function() {
@@ -3427,7 +3373,7 @@ function Is(t, e, r, n, a, i) {
3427
3373
  }, Pt(s, "xMin", "_xMin"), Pt(s, "xMax", "_xMax"), Pt(s, "yMin", "_yMin"), Pt(s, "yMax", "_yMax"), s;
3428
3374
  };
3429
3375
  }
3430
- function Ds(t, e, r, n) {
3376
+ function Rs(t, e, r, n) {
3431
3377
  return function() {
3432
3378
  var a = new xe({ index: e, font: t });
3433
3379
  return a.path = function() {
@@ -3436,7 +3382,7 @@ function Ds(t, e, r, n) {
3436
3382
  }, a;
3437
3383
  };
3438
3384
  }
3439
- var Re = { GlyphSet: Jr, glyphLoader: Ms, ttfGlyphLoader: Is, cffGlyphLoader: Ds };
3385
+ var Re = { GlyphSet: Jr, glyphLoader: Os, ttfGlyphLoader: Ls, cffGlyphLoader: Rs };
3440
3386
  function Ya(t, e) {
3441
3387
  if (t === e)
3442
3388
  return !0;
@@ -3470,7 +3416,7 @@ function Ge(t, e, r) {
3470
3416
  }
3471
3417
  return { objects: a, startOffset: e, endOffset: o };
3472
3418
  }
3473
- function _s(t, e) {
3419
+ function Ms(t, e) {
3474
3420
  var r = [], n = D.getCard16(t, e), a, i;
3475
3421
  if (n !== 0) {
3476
3422
  var s = D.getByte(t, e + 2);
@@ -3482,7 +3428,7 @@ function _s(t, e) {
3482
3428
  i = e + 2;
3483
3429
  return { offsets: r, startOffset: e, endOffset: i };
3484
3430
  }
3485
- function Ps(t, e, r, n, a) {
3431
+ function Is(t, e, r, n, a) {
3486
3432
  var i = D.getCard16(r, n), s = 0;
3487
3433
  if (i !== 0) {
3488
3434
  var o = D.getByte(r, n + 2);
@@ -3491,7 +3437,7 @@ function Ps(t, e, r, n, a) {
3491
3437
  var c = D.getBytes(r, s + e[t], s + e[t + 1]);
3492
3438
  return c;
3493
3439
  }
3494
- function Ns(t) {
3440
+ function Ds(t) {
3495
3441
  for (var e = "", r = 15, n = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", ".", "E", "E-", null, "-"]; ; ) {
3496
3442
  var a = t.parseByte(), i = a >> 4, s = a & 15;
3497
3443
  if (i === r || (e += n[i], s === r))
@@ -3500,14 +3446,14 @@ function Ns(t) {
3500
3446
  }
3501
3447
  return parseFloat(e);
3502
3448
  }
3503
- function Gs(t, e) {
3449
+ function _s(t, e) {
3504
3450
  var r, n, a, i;
3505
3451
  if (e === 28)
3506
3452
  return r = t.parseByte(), n = t.parseByte(), r << 8 | n;
3507
3453
  if (e === 29)
3508
3454
  return r = t.parseByte(), n = t.parseByte(), a = t.parseByte(), i = t.parseByte(), r << 24 | n << 16 | a << 8 | i;
3509
3455
  if (e === 30)
3510
- return Ns(t);
3456
+ return Ds(t);
3511
3457
  if (e >= 32 && e <= 246)
3512
3458
  return e - 139;
3513
3459
  if (e >= 247 && e <= 250)
@@ -3516,7 +3462,7 @@ function Gs(t, e) {
3516
3462
  return r = t.parseByte(), -(e - 251) * 256 - r - 108;
3517
3463
  throw new Error("Invalid b0 " + e);
3518
3464
  }
3519
- function Hs(t) {
3465
+ function Ps(t) {
3520
3466
  for (var e = {}, r = 0; r < t.length; r += 1) {
3521
3467
  var n = t[r][0], a = t[r][1], i = void 0;
3522
3468
  if (a.length === 1 ? i = a[0] : i = a, e.hasOwnProperty(n) && !isNaN(e[n]))
@@ -3530,9 +3476,9 @@ function ja(t, e, r) {
3530
3476
  var n = new D.Parser(t, e), a = [], i = [];
3531
3477
  for (r = r !== void 0 ? r : t.length; n.relativeOffset < r; ) {
3532
3478
  var s = n.parseByte();
3533
- s <= 21 ? (s === 12 && (s = 1200 + n.parseByte()), a.push([s, i]), i = []) : i.push(Gs(n, s));
3479
+ s <= 21 ? (s === 12 && (s = 1200 + n.parseByte()), a.push([s, i]), i = []) : i.push(_s(n, s));
3534
3480
  }
3535
- return Hs(a);
3481
+ return Ps(a);
3536
3482
  }
3537
3483
  function vt(t, e) {
3538
3484
  return e <= 390 ? e = Wt[e] : e = t[e - 391], e;
@@ -3551,7 +3497,7 @@ function Za(t, e, r) {
3551
3497
  }
3552
3498
  return n;
3553
3499
  }
3554
- function zs(t, e) {
3500
+ function Ns(t, e) {
3555
3501
  var r = {};
3556
3502
  return r.formatMajor = D.getCard8(t, e), r.formatMinor = D.getCard8(t, e + 1), r.size = D.getCard8(t, e + 2), r.offsetSize = D.getCard8(t, e + 3), r.startOffset = e, r.endOffset = e + 4, r;
3557
3503
  }
@@ -3596,7 +3542,7 @@ var $a = [
3596
3542
  { name: "defaultWidthX", op: 20, type: "number", value: 0 },
3597
3543
  { name: "nominalWidthX", op: 21, type: "number", value: 0 }
3598
3544
  ];
3599
- function Ws(t, e) {
3545
+ function Gs(t, e) {
3600
3546
  var r = ja(t, 0, t.byteLength);
3601
3547
  return Za(r, $a, e);
3602
3548
  }
@@ -3606,7 +3552,7 @@ function Qa(t, e, r, n) {
3606
3552
  }
3607
3553
  function Rn(t, e, r, n) {
3608
3554
  for (var a = [], i = 0; i < r.length; i += 1) {
3609
- var s = new DataView(new Uint8Array(r[i]).buffer), o = Ws(s, n);
3555
+ var s = new DataView(new Uint8Array(r[i]).buffer), o = Gs(s, n);
3610
3556
  o._subrs = [], o._subrsBias = 0, o._defaultWidthX = 0, o._nominalWidthX = 0;
3611
3557
  var c = o.private[0], u = o.private[1];
3612
3558
  if (c !== 0 && u !== 0) {
@@ -3621,7 +3567,7 @@ function Rn(t, e, r, n) {
3621
3567
  }
3622
3568
  return a;
3623
3569
  }
3624
- function qs(t, e, r, n) {
3570
+ function Hs(t, e, r, n) {
3625
3571
  var a, i, s = new D.Parser(t, e);
3626
3572
  r -= 1;
3627
3573
  var o = [".notdef"], c = s.parseCard8();
@@ -3644,7 +3590,7 @@ function qs(t, e, r, n) {
3644
3590
  throw new Error("Unknown charset format " + c);
3645
3591
  return o;
3646
3592
  }
3647
- function Vs(t, e, r) {
3593
+ function zs(t, e, r) {
3648
3594
  var n, a = {}, i = new D.Parser(t, e), s = i.parseCard8();
3649
3595
  if (s === 0)
3650
3596
  for (var o = i.parseCard8(), c = 0; c < o; c += 1)
@@ -3660,12 +3606,12 @@ function Vs(t, e, r) {
3660
3606
  return new Kt(a, r);
3661
3607
  }
3662
3608
  function Mn(t, e, r) {
3663
- var n, a, i, s, o = new se(), c = [], u = 0, h = !1, d = !1, p = 0, g = 0, x, m, F, y;
3609
+ var n, a, i, s, o = new se(), c = [], u = 0, h = !1, d = !1, p = 0, g = 0, S, m, F, y;
3664
3610
  if (t.isCIDFont) {
3665
- var S = t.tables.cff.topDict._fdSelect[e.index], w = t.tables.cff.topDict._fdArray[S];
3666
- x = w._subrs, m = w._subrsBias, F = w._defaultWidthX, y = w._nominalWidthX;
3611
+ var x = t.tables.cff.topDict._fdSelect[e.index], w = t.tables.cff.topDict._fdArray[x];
3612
+ S = w._subrs, m = w._subrsBias, F = w._defaultWidthX, y = w._nominalWidthX;
3667
3613
  } else
3668
- x = t.tables.cff.topDict._subrs, m = t.tables.cff.topDict._subrsBias, F = t.tables.cff.topDict._defaultWidthX, y = t.tables.cff.topDict._nominalWidthX;
3614
+ S = t.tables.cff.topDict._subrs, m = t.tables.cff.topDict._subrsBias, F = t.tables.cff.topDict._defaultWidthX, y = t.tables.cff.topDict._nominalWidthX;
3669
3615
  var k = F;
3670
3616
  function T(B, H) {
3671
3617
  d && o.closePath(), o.moveTo(B, H), d = !0;
@@ -3704,7 +3650,7 @@ function Mn(t, e, r) {
3704
3650
  n = p + c.shift(), a = g + c.shift(), i = n + c.shift(), s = a + c.shift(), p = i + c.shift(), g = s + c.shift(), o.curveTo(n, a, i, s, p, g);
3705
3651
  break;
3706
3652
  case 10:
3707
- ae = c.pop() + m, Y = x[ae], Y && L(Y);
3653
+ ae = c.pop() + m, Y = S[ae], Y && L(Y);
3708
3654
  break;
3709
3655
  case 11:
3710
3656
  return;
@@ -3784,7 +3730,7 @@ function Mn(t, e, r) {
3784
3730
  }
3785
3731
  return L(r), e.advanceWidth = k, o;
3786
3732
  }
3787
- function Xs(t, e, r, n) {
3733
+ function Ws(t, e, r, n) {
3788
3734
  var a = [], i, s = new D.Parser(t, e), o = s.parseCard8();
3789
3735
  if (o === 0)
3790
3736
  for (var c = 0; c < r; c++) {
@@ -3811,9 +3757,9 @@ function Xs(t, e, r, n) {
3811
3757
  throw new Error("CFF Table CID Font FDSelect table has unsupported format " + o);
3812
3758
  return a;
3813
3759
  }
3814
- function Ys(t, e, r, n) {
3760
+ function qs(t, e, r, n) {
3815
3761
  r.tables.cff = {};
3816
- var a = zs(t, e), i = Ge(t, a.endOffset, D.bytesToString), s = Ge(t, i.endOffset), o = Ge(t, s.endOffset, D.bytesToString), c = Ge(t, o.endOffset);
3762
+ var a = Ns(t, e), i = Ge(t, a.endOffset, D.bytesToString), s = Ge(t, i.endOffset), o = Ge(t, s.endOffset, D.bytesToString), c = Ge(t, o.endOffset);
3817
3763
  r.gsubrs = c.objects, r.gsubrsBias = zr(r.gsubrs);
3818
3764
  var u = Rn(t, e, s.objects, o.objects);
3819
3765
  if (u.length !== 1)
@@ -3824,21 +3770,21 @@ function Ys(t, e, r, n) {
3824
3770
  if (d === 0 || p === 0)
3825
3771
  throw new Error("Font is marked as a CID font, but FDArray and/or FDSelect information is missing");
3826
3772
  d += e;
3827
- var g = Ge(t, d), x = Rn(t, e, g.objects, o.objects);
3828
- h._fdArray = x, p += e, h._fdSelect = Xs(t, p, r.numGlyphs, x.length);
3773
+ var g = Ge(t, d), S = Rn(t, e, g.objects, o.objects);
3774
+ h._fdArray = S, p += e, h._fdSelect = Ws(t, p, r.numGlyphs, S.length);
3829
3775
  }
3830
3776
  var m = e + h.private[1], F = Qa(t, m, h.private[0], o.objects);
3831
3777
  if (r.defaultWidthX = F.defaultWidthX, r.nominalWidthX = F.nominalWidthX, F.subrs !== 0) {
3832
- var y = m + F.subrs, S = Ge(t, y);
3833
- r.subrs = S.objects, r.subrsBias = zr(r.subrs);
3778
+ var y = m + F.subrs, x = Ge(t, y);
3779
+ r.subrs = x.objects, r.subrsBias = zr(r.subrs);
3834
3780
  } else
3835
3781
  r.subrs = [], r.subrsBias = 0;
3836
3782
  var w;
3837
- n.lowMemory ? (w = _s(t, e + h.charStrings), r.nGlyphs = w.offsets.length) : (w = Ge(t, e + h.charStrings), r.nGlyphs = w.objects.length);
3838
- var k = qs(t, e + h.charset, r.nGlyphs, o.objects);
3839
- if (h.encoding === 0 ? r.cffEncoding = new Kt(Cs, k) : h.encoding === 1 ? r.cffEncoding = new Kt(Us, k) : r.cffEncoding = Vs(t, e + h.encoding, k), r.encoding = r.encoding || r.cffEncoding, r.glyphs = new Re.GlyphSet(r), n.lowMemory)
3783
+ n.lowMemory ? (w = Ms(t, e + h.charStrings), r.nGlyphs = w.offsets.length) : (w = Ge(t, e + h.charStrings), r.nGlyphs = w.objects.length);
3784
+ var k = Hs(t, e + h.charset, r.nGlyphs, o.objects);
3785
+ if (h.encoding === 0 ? r.cffEncoding = new Kt(ks, k) : h.encoding === 1 ? r.cffEncoding = new Kt(Ts, k) : r.cffEncoding = zs(t, e + h.encoding, k), r.encoding = r.encoding || r.cffEncoding, r.glyphs = new Re.GlyphSet(r), n.lowMemory)
3840
3786
  r._push = function(L) {
3841
- var B = Ps(L, w.offsets, t, e + h.charStrings);
3787
+ var B = Is(L, w.offsets, t, e + h.charStrings);
3842
3788
  r.glyphs.push(L, Re.cffGlyphLoader(r, L, Mn, B));
3843
3789
  };
3844
3790
  else
@@ -3851,7 +3797,7 @@ function Ja(t, e) {
3851
3797
  var r, n = Wt.indexOf(t);
3852
3798
  return n >= 0 && (r = n), n = e.indexOf(t), n >= 0 ? r = n + Wt.length : (r = Wt.length + e.length, e.push(t)), r;
3853
3799
  }
3854
- function js() {
3800
+ function Vs() {
3855
3801
  return new M.Record("Header", [
3856
3802
  { name: "major", type: "Card8", value: 1 },
3857
3803
  { name: "minor", type: "Card8", value: 0 },
@@ -3859,7 +3805,7 @@ function js() {
3859
3805
  { name: "major", type: "Card8", value: 1 }
3860
3806
  ]);
3861
3807
  }
3862
- function Zs(t) {
3808
+ function Xs(t) {
3863
3809
  var e = new M.Record("Name INDEX", [
3864
3810
  { name: "names", type: "INDEX", value: [] }
3865
3811
  ]);
@@ -3887,7 +3833,7 @@ function Dn(t) {
3887
3833
  ]);
3888
3834
  return e.topDicts = [{ name: "topDict_0", type: "TABLE", value: t }], e;
3889
3835
  }
3890
- function $s(t) {
3836
+ function Ys(t) {
3891
3837
  var e = new M.Record("String INDEX", [
3892
3838
  { name: "strings", type: "INDEX", value: [] }
3893
3839
  ]);
@@ -3896,12 +3842,12 @@ function $s(t) {
3896
3842
  e.strings.push({ name: "string_" + r, type: "STRING", value: t[r] });
3897
3843
  return e;
3898
3844
  }
3899
- function Ks() {
3845
+ function js() {
3900
3846
  return new M.Record("Global Subr INDEX", [
3901
3847
  { name: "subrs", type: "INDEX", value: [] }
3902
3848
  ]);
3903
3849
  }
3904
- function Qs(t, e) {
3850
+ function Zs(t, e) {
3905
3851
  for (var r = new M.Record("Charsets", [
3906
3852
  { name: "format", type: "Card8", value: 0 }
3907
3853
  ]), n = 0; n < t.length; n += 1) {
@@ -3910,7 +3856,7 @@ function Qs(t, e) {
3910
3856
  }
3911
3857
  return r;
3912
3858
  }
3913
- function Js(t) {
3859
+ function $s(t) {
3914
3860
  var e = [], r = t.path;
3915
3861
  e.push({ name: "width", type: "NUMBER", value: t.advanceWidth });
3916
3862
  for (var n = 0, a = 0, i = 0; i < r.commands.length; i += 1) {
@@ -3932,28 +3878,28 @@ function Js(t) {
3932
3878
  else if (c.type === "L")
3933
3879
  s = Math.round(c.x - n), o = Math.round(c.y - a), e.push({ name: "dx", type: "NUMBER", value: s }), e.push({ name: "dy", type: "NUMBER", value: o }), e.push({ name: "rlineto", type: "OP", value: 5 }), n = Math.round(c.x), a = Math.round(c.y);
3934
3880
  else if (c.type === "C") {
3935
- var d = Math.round(c.x1 - n), p = Math.round(c.y1 - a), g = Math.round(c.x2 - c.x1), x = Math.round(c.y2 - c.y1);
3936
- s = Math.round(c.x - c.x2), o = Math.round(c.y - c.y2), e.push({ name: "dx1", type: "NUMBER", value: d }), e.push({ name: "dy1", type: "NUMBER", value: p }), e.push({ name: "dx2", type: "NUMBER", value: g }), e.push({ name: "dy2", type: "NUMBER", value: x }), e.push({ name: "dx", type: "NUMBER", value: s }), e.push({ name: "dy", type: "NUMBER", value: o }), e.push({ name: "rrcurveto", type: "OP", value: 8 }), n = Math.round(c.x), a = Math.round(c.y);
3881
+ var d = Math.round(c.x1 - n), p = Math.round(c.y1 - a), g = Math.round(c.x2 - c.x1), S = Math.round(c.y2 - c.y1);
3882
+ s = Math.round(c.x - c.x2), o = Math.round(c.y - c.y2), e.push({ name: "dx1", type: "NUMBER", value: d }), e.push({ name: "dy1", type: "NUMBER", value: p }), e.push({ name: "dx2", type: "NUMBER", value: g }), e.push({ name: "dy2", type: "NUMBER", value: S }), e.push({ name: "dx", type: "NUMBER", value: s }), e.push({ name: "dy", type: "NUMBER", value: o }), e.push({ name: "rrcurveto", type: "OP", value: 8 }), n = Math.round(c.x), a = Math.round(c.y);
3937
3883
  }
3938
3884
  }
3939
3885
  return e.push({ name: "endchar", type: "OP", value: 14 }), e;
3940
3886
  }
3941
- function eo(t) {
3887
+ function Ks(t) {
3942
3888
  for (var e = new M.Record("CharStrings INDEX", [
3943
3889
  { name: "charStrings", type: "INDEX", value: [] }
3944
3890
  ]), r = 0; r < t.length; r += 1) {
3945
- var n = t.get(r), a = Js(n);
3891
+ var n = t.get(r), a = $s(n);
3946
3892
  e.charStrings.push({ name: n.name, type: "CHARSTRING", value: a });
3947
3893
  }
3948
3894
  return e;
3949
3895
  }
3950
- function to(t, e) {
3896
+ function Qs(t, e) {
3951
3897
  var r = new M.Record("Private DICT", [
3952
3898
  { name: "dict", type: "DICT", value: {} }
3953
3899
  ]);
3954
3900
  return r.dict = ei(Ka, t, e), r;
3955
3901
  }
3956
- function ro(t, e) {
3902
+ function Js(t, e) {
3957
3903
  for (var r = new M.Table("CFF ", [
3958
3904
  { name: "header", type: "RECORD" },
3959
3905
  { name: "nameIndex", type: "RECORD" },
@@ -3977,18 +3923,18 @@ function ro(t, e) {
3977
3923
  }, i = {}, s = [], o, c = 1; c < t.length; c += 1)
3978
3924
  o = t.get(c), s.push(o.name);
3979
3925
  var u = [];
3980
- r.header = js(), r.nameIndex = Zs([e.postScriptName]);
3926
+ r.header = Vs(), r.nameIndex = Xs([e.postScriptName]);
3981
3927
  var h = In(a, u);
3982
- r.topDictIndex = Dn(h), r.globalSubrIndex = Ks(), r.charsets = Qs(s, u), r.charStringsIndex = eo(t), r.privateDict = to(i, u), r.stringIndex = $s(u);
3928
+ r.topDictIndex = Dn(h), r.globalSubrIndex = js(), r.charsets = Zs(s, u), r.charStringsIndex = Ks(t), r.privateDict = Qs(i, u), r.stringIndex = Ys(u);
3983
3929
  var d = r.header.sizeOf() + r.nameIndex.sizeOf() + r.topDictIndex.sizeOf() + r.stringIndex.sizeOf() + r.globalSubrIndex.sizeOf();
3984
3930
  return a.charset = d, a.encoding = 0, a.charStrings = a.charset + r.charsets.sizeOf(), a.private[1] = a.charStrings + r.charStringsIndex.sizeOf(), h = In(a, u), r.topDictIndex = Dn(h), r;
3985
3931
  }
3986
- var ti = { parse: Ys, make: ro };
3987
- function no(t, e) {
3932
+ var ti = { parse: qs, make: Js };
3933
+ function eo(t, e) {
3988
3934
  var r = {}, n = new D.Parser(t, e);
3989
3935
  return r.version = n.parseVersion(), r.fontRevision = Math.round(n.parseFixed() * 1e3) / 1e3, r.checkSumAdjustment = n.parseULong(), r.magicNumber = n.parseULong(), _.argument(r.magicNumber === 1594834165, "Font header has wrong magic number."), r.flags = n.parseUShort(), r.unitsPerEm = n.parseUShort(), r.created = n.parseLongDateTime(), r.modified = n.parseLongDateTime(), r.xMin = n.parseShort(), r.yMin = n.parseShort(), r.xMax = n.parseShort(), r.yMax = n.parseShort(), r.macStyle = n.parseUShort(), r.lowestRecPPEM = n.parseUShort(), r.fontDirectionHint = n.parseShort(), r.indexToLocFormat = n.parseShort(), r.glyphDataFormat = n.parseShort(), r;
3990
3936
  }
3991
- function ao(t) {
3937
+ function to(t) {
3992
3938
  var e = Math.round((/* @__PURE__ */ new Date()).getTime() / 1e3) + 2082844800, r = e;
3993
3939
  return t.createdTimestamp && (r = t.createdTimestamp + 2082844800), new M.Table("head", [
3994
3940
  { name: "version", type: "FIXED", value: 65536 },
@@ -4010,12 +3956,12 @@ function ao(t) {
4010
3956
  { name: "glyphDataFormat", type: "SHORT", value: 0 }
4011
3957
  ], t);
4012
3958
  }
4013
- var ri = { parse: no, make: ao };
4014
- function io(t, e) {
3959
+ var ri = { parse: eo, make: to };
3960
+ function ro(t, e) {
4015
3961
  var r = {}, n = new D.Parser(t, e);
4016
3962
  return r.version = n.parseVersion(), r.ascender = n.parseShort(), r.descender = n.parseShort(), r.lineGap = n.parseShort(), r.advanceWidthMax = n.parseUShort(), r.minLeftSideBearing = n.parseShort(), r.minRightSideBearing = n.parseShort(), r.xMaxExtent = n.parseShort(), r.caretSlopeRise = n.parseShort(), r.caretSlopeRun = n.parseShort(), r.caretOffset = n.parseShort(), n.relativeOffset += 8, r.metricDataFormat = n.parseShort(), r.numberOfHMetrics = n.parseUShort(), r;
4017
3963
  }
4018
- function so(t) {
3964
+ function no(t) {
4019
3965
  return new M.Table("hhea", [
4020
3966
  { name: "version", type: "FIXED", value: 65536 },
4021
3967
  { name: "ascender", type: "FWORD", value: 0 },
@@ -4036,15 +3982,15 @@ function so(t) {
4036
3982
  { name: "numberOfHMetrics", type: "USHORT", value: 0 }
4037
3983
  ], t);
4038
3984
  }
4039
- var ni = { parse: io, make: so };
4040
- function oo(t, e, r, n, a) {
3985
+ var ni = { parse: ro, make: no };
3986
+ function ao(t, e, r, n, a) {
4041
3987
  for (var i, s, o = new D.Parser(t, e), c = 0; c < n; c += 1) {
4042
3988
  c < r && (i = o.parseUShort(), s = o.parseShort());
4043
3989
  var u = a.get(c);
4044
3990
  u.advanceWidth = i, u.leftSideBearing = s;
4045
3991
  }
4046
3992
  }
4047
- function co(t, e, r, n, a) {
3993
+ function io(t, e, r, n, a) {
4048
3994
  t._hmtxTableData = {};
4049
3995
  for (var i, s, o = new D.Parser(e, r), c = 0; c < a; c += 1)
4050
3996
  c < n && (i = o.parseUShort(), s = o.parseShort()), t._hmtxTableData[c] = {
@@ -4052,18 +3998,18 @@ function co(t, e, r, n, a) {
4052
3998
  leftSideBearing: s
4053
3999
  };
4054
4000
  }
4055
- function uo(t, e, r, n, a, i, s) {
4056
- s.lowMemory ? co(t, e, r, n, a) : oo(e, r, n, a, i);
4001
+ function so(t, e, r, n, a, i, s) {
4002
+ s.lowMemory ? io(t, e, r, n, a) : ao(e, r, n, a, i);
4057
4003
  }
4058
- function ho(t) {
4004
+ function oo(t) {
4059
4005
  for (var e = new M.Table("hmtx", []), r = 0; r < t.length; r += 1) {
4060
4006
  var n = t.get(r), a = n.advanceWidth || 0, i = n.leftSideBearing || 0;
4061
4007
  e.fields.push({ name: "advanceWidth_" + r, type: "USHORT", value: a }), e.fields.push({ name: "leftSideBearing_" + r, type: "SHORT", value: i });
4062
4008
  }
4063
4009
  return e;
4064
4010
  }
4065
- var ai = { parse: uo, make: ho };
4066
- function lo(t) {
4011
+ var ai = { parse: so, make: oo };
4012
+ function co(t) {
4067
4013
  for (var e = new M.Table("ltag", [
4068
4014
  { name: "version", type: "ULONG", value: 1 },
4069
4015
  { name: "flags", type: "ULONG", value: 0 },
@@ -4074,7 +4020,7 @@ function lo(t) {
4074
4020
  }
4075
4021
  return e.fields.push({ name: "stringPool", type: "CHARARRAY", value: r }), e;
4076
4022
  }
4077
- function fo(t, e) {
4023
+ function uo(t, e) {
4078
4024
  var r = new D.Parser(t, e), n = r.parseULong();
4079
4025
  _.argument(n === 1, "Unsupported ltag table version."), r.skip("uLong", 1);
4080
4026
  for (var a = r.parseULong(), i = [], s = 0; s < a; s++) {
@@ -4084,18 +4030,18 @@ function fo(t, e) {
4084
4030
  }
4085
4031
  return i;
4086
4032
  }
4087
- var ii = { make: lo, parse: fo };
4088
- function po(t, e) {
4033
+ var ii = { make: co, parse: uo };
4034
+ function ho(t, e) {
4089
4035
  var r = {}, n = new D.Parser(t, e);
4090
4036
  return r.version = n.parseVersion(), r.numGlyphs = n.parseUShort(), r.version === 1 && (r.maxPoints = n.parseUShort(), r.maxContours = n.parseUShort(), r.maxCompositePoints = n.parseUShort(), r.maxCompositeContours = n.parseUShort(), r.maxZones = n.parseUShort(), r.maxTwilightPoints = n.parseUShort(), r.maxStorage = n.parseUShort(), r.maxFunctionDefs = n.parseUShort(), r.maxInstructionDefs = n.parseUShort(), r.maxStackElements = n.parseUShort(), r.maxSizeOfInstructions = n.parseUShort(), r.maxComponentElements = n.parseUShort(), r.maxComponentDepth = n.parseUShort()), r;
4091
4037
  }
4092
- function go(t) {
4038
+ function lo(t) {
4093
4039
  return new M.Table("maxp", [
4094
4040
  { name: "version", type: "FIXED", value: 20480 },
4095
4041
  { name: "numGlyphs", type: "USHORT", value: t }
4096
4042
  ]);
4097
4043
  }
4098
- var si = { parse: po, make: go }, oi = [
4044
+ var si = { parse: ho, make: lo }, oi = [
4099
4045
  "copyright",
4100
4046
  // 0
4101
4047
  "fontFamily",
@@ -4262,7 +4208,7 @@ var si = { parse: po, make: go }, oi = [
4262
4208
  149: "kl",
4263
4209
  150: "az",
4264
4210
  151: "nn"
4265
- }, vo = {
4211
+ }, fo = {
4266
4212
  0: 0,
4267
4213
  // langEnglish → smRoman
4268
4214
  1: 0,
@@ -4715,7 +4661,7 @@ var si = { parse: po, make: go }, oi = [
4715
4661
  1144: "ii",
4716
4662
  1130: "yo"
4717
4663
  };
4718
- function yo(t, e, r) {
4664
+ function po(t, e, r) {
4719
4665
  switch (t) {
4720
4666
  case 0:
4721
4667
  if (e === 65535)
@@ -4729,7 +4675,7 @@ function yo(t, e, r) {
4729
4675
  return ui[e];
4730
4676
  }
4731
4677
  }
4732
- var Wr = "utf-16", mo = {
4678
+ var Wr = "utf-16", go = {
4733
4679
  0: "macintosh",
4734
4680
  // smRoman
4735
4681
  1: "x-mac-japanese",
@@ -4788,7 +4734,7 @@ var Wr = "utf-16", mo = {
4788
4734
  // smVietnamese
4789
4735
  31: "x-mac-extarabic"
4790
4736
  // smExtArabic
4791
- }, bo = {
4737
+ }, vo = {
4792
4738
  15: "x-mac-icelandic",
4793
4739
  // langIcelandic
4794
4740
  17: "x-mac-turkish",
@@ -4825,21 +4771,21 @@ function hi(t, e, r) {
4825
4771
  case 0:
4826
4772
  return Wr;
4827
4773
  case 1:
4828
- return bo[r] || mo[e];
4774
+ return vo[r] || go[e];
4829
4775
  case 3:
4830
4776
  if (e === 1 || e === 10)
4831
4777
  return Wr;
4832
4778
  break;
4833
4779
  }
4834
4780
  }
4835
- function xo(t, e, r) {
4781
+ function yo(t, e, r) {
4836
4782
  for (var n = {}, a = new D.Parser(t, e), i = a.parseUShort(), s = a.parseUShort(), o = a.offset + a.parseUShort(), c = 0; c < s; c++) {
4837
- var u = a.parseUShort(), h = a.parseUShort(), d = a.parseUShort(), p = a.parseUShort(), g = oi[p] || p, x = a.parseUShort(), m = a.parseUShort(), F = yo(u, d, r), y = hi(u, h, d);
4783
+ var u = a.parseUShort(), h = a.parseUShort(), d = a.parseUShort(), p = a.parseUShort(), g = oi[p] || p, S = a.parseUShort(), m = a.parseUShort(), F = po(u, d, r), y = hi(u, h, d);
4838
4784
  if (y !== void 0 && F !== void 0) {
4839
- var S = void 0;
4840
- if (y === Wr ? S = ct.UTF16(t, o + m, x) : S = ct.MACSTRING(t, o + m, x, y), S) {
4785
+ var x = void 0;
4786
+ if (y === Wr ? x = ct.UTF16(t, o + m, S) : x = ct.MACSTRING(t, o + m, S, y), x) {
4841
4787
  var w = n[g];
4842
- w === void 0 && (w = n[g] = {}), w[F] = S;
4788
+ w === void 0 && (w = n[g] = {}), w[F] = x;
4843
4789
  }
4844
4790
  }
4845
4791
  }
@@ -4861,7 +4807,7 @@ function _n(t, e, r, n, a, i) {
4861
4807
  { name: "offset", type: "USHORT", value: i }
4862
4808
  ]);
4863
4809
  }
4864
- function So(t, e) {
4810
+ function mo(t, e) {
4865
4811
  var r = t.length, n = e.length - r + 1;
4866
4812
  e:
4867
4813
  for (var a = 0; a < n; a++)
@@ -4874,7 +4820,7 @@ function So(t, e) {
4874
4820
  return -1;
4875
4821
  }
4876
4822
  function Pn(t, e) {
4877
- var r = So(t, e);
4823
+ var r = mo(t, e);
4878
4824
  if (r < 0) {
4879
4825
  r = e.length;
4880
4826
  for (var n = 0, a = t.length; n < a; ++n)
@@ -4882,7 +4828,7 @@ function Pn(t, e) {
4882
4828
  }
4883
4829
  return r;
4884
4830
  }
4885
- function wo(t, e) {
4831
+ function bo(t, e) {
4886
4832
  var r, n = [], a = {}, i = cr(oi);
4887
4833
  for (var s in t) {
4888
4834
  var o = i[s];
@@ -4893,19 +4839,19 @@ function wo(t, e) {
4893
4839
  for (var c = cr(ci), u = cr(ui), h = [], d = [], p = 0; p < n.length; p++) {
4894
4840
  r = n[p];
4895
4841
  var g = a[r];
4896
- for (var x in g) {
4897
- var m = g[x], F = 1, y = c[x], S = vo[y], w = hi(F, S, y), k = O.MACSTRING(m, w);
4898
- k === void 0 && (F = 0, y = e.indexOf(x), y < 0 && (y = e.length, e.push(x)), S = 4, k = O.UTF16(m));
4842
+ for (var S in g) {
4843
+ var m = g[S], F = 1, y = c[S], x = fo[y], w = hi(F, x, y), k = O.MACSTRING(m, w);
4844
+ k === void 0 && (F = 0, y = e.indexOf(S), y < 0 && (y = e.length, e.push(S)), x = 4, k = O.UTF16(m));
4899
4845
  var T = Pn(k, d);
4900
4846
  h.push(_n(
4901
4847
  F,
4902
- S,
4848
+ x,
4903
4849
  y,
4904
4850
  r,
4905
4851
  k.length,
4906
4852
  T
4907
4853
  ));
4908
- var R = u[x];
4854
+ var R = u[S];
4909
4855
  if (R !== void 0) {
4910
4856
  var L = O.UTF16(m), B = Pn(L, d);
4911
4857
  h.push(_n(
@@ -4930,7 +4876,7 @@ function wo(t, e) {
4930
4876
  H.fields.push({ name: "record_" + q, type: "RECORD", value: h[q] });
4931
4877
  return H.fields.push({ name: "strings", type: "LITERAL", value: d }), H;
4932
4878
  }
4933
- var li = { parse: xo, make: wo }, qr = [
4879
+ var li = { parse: yo, make: bo }, qr = [
4934
4880
  { begin: 0, end: 127 },
4935
4881
  // Basic Latin
4936
4882
  { begin: 128, end: 255 },
@@ -5178,7 +5124,7 @@ var li = { parse: xo, make: wo }, qr = [
5178
5124
  { begin: 127024, end: 127135 }
5179
5125
  // Domino Tiles
5180
5126
  ];
5181
- function Fo(t) {
5127
+ function xo(t) {
5182
5128
  for (var e = 0; e < qr.length; e += 1) {
5183
5129
  var r = qr[e];
5184
5130
  if (t >= r.begin && t < r.end)
@@ -5186,14 +5132,14 @@ function Fo(t) {
5186
5132
  }
5187
5133
  return -1;
5188
5134
  }
5189
- function ko(t, e) {
5135
+ function So(t, e) {
5190
5136
  var r = {}, n = new D.Parser(t, e);
5191
5137
  r.version = n.parseUShort(), r.xAvgCharWidth = n.parseShort(), r.usWeightClass = n.parseUShort(), r.usWidthClass = n.parseUShort(), r.fsType = n.parseUShort(), r.ySubscriptXSize = n.parseShort(), r.ySubscriptYSize = n.parseShort(), r.ySubscriptXOffset = n.parseShort(), r.ySubscriptYOffset = n.parseShort(), r.ySuperscriptXSize = n.parseShort(), r.ySuperscriptYSize = n.parseShort(), r.ySuperscriptXOffset = n.parseShort(), r.ySuperscriptYOffset = n.parseShort(), r.yStrikeoutSize = n.parseShort(), r.yStrikeoutPosition = n.parseShort(), r.sFamilyClass = n.parseShort(), r.panose = [];
5192
5138
  for (var a = 0; a < 10; a++)
5193
5139
  r.panose[a] = n.parseByte();
5194
5140
  return r.ulUnicodeRange1 = n.parseULong(), r.ulUnicodeRange2 = n.parseULong(), r.ulUnicodeRange3 = n.parseULong(), r.ulUnicodeRange4 = n.parseULong(), r.achVendID = String.fromCharCode(n.parseByte(), n.parseByte(), n.parseByte(), n.parseByte()), r.fsSelection = n.parseUShort(), r.usFirstCharIndex = n.parseUShort(), r.usLastCharIndex = n.parseUShort(), r.sTypoAscender = n.parseShort(), r.sTypoDescender = n.parseShort(), r.sTypoLineGap = n.parseShort(), r.usWinAscent = n.parseUShort(), r.usWinDescent = n.parseUShort(), r.version >= 1 && (r.ulCodePageRange1 = n.parseULong(), r.ulCodePageRange2 = n.parseULong()), r.version >= 2 && (r.sxHeight = n.parseShort(), r.sCapHeight = n.parseShort(), r.usDefaultChar = n.parseUShort(), r.usBreakChar = n.parseUShort(), r.usMaxContent = n.parseUShort()), r;
5195
5141
  }
5196
- function To(t) {
5142
+ function wo(t) {
5197
5143
  return new M.Table("OS/2", [
5198
5144
  { name: "version", type: "USHORT", value: 3 },
5199
5145
  { name: "xAvgCharWidth", type: "SHORT", value: 0 },
@@ -5243,8 +5189,8 @@ function To(t) {
5243
5189
  { name: "usMaxContext", type: "USHORT", value: 0 }
5244
5190
  ], t);
5245
5191
  }
5246
- var Vr = { parse: ko, make: To, unicodeRanges: qr, getUnicodeRange: Fo };
5247
- function Eo(t, e) {
5192
+ var Vr = { parse: So, make: wo, unicodeRanges: qr, getUnicodeRange: xo };
5193
+ function Fo(t, e) {
5248
5194
  var r = {}, n = new D.Parser(t, e);
5249
5195
  switch (r.version = n.parseVersion(), r.italicAngle = n.parseFixed(), r.underlinePosition = n.parseShort(), r.underlineThickness = n.parseShort(), r.isFixedPitch = n.parseULong(), r.minMemType42 = n.parseULong(), r.maxMemType42 = n.parseULong(), r.minMemType1 = n.parseULong(), r.maxMemType1 = n.parseULong(), r.version) {
5250
5196
  case 1:
@@ -5269,7 +5215,7 @@ function Eo(t, e) {
5269
5215
  }
5270
5216
  return r;
5271
5217
  }
5272
- function Co() {
5218
+ function ko() {
5273
5219
  return new M.Table("post", [
5274
5220
  { name: "version", type: "FIXED", value: 196608 },
5275
5221
  { name: "italicAngle", type: "FIXED", value: 0 },
@@ -5282,7 +5228,7 @@ function Co() {
5282
5228
  { name: "maxMemType1", type: "ULONG", value: 0 }
5283
5229
  ]);
5284
5230
  }
5285
- var fi = { parse: Eo, make: Co }, we = new Array(9);
5231
+ var fi = { parse: Fo, make: ko }, we = new Array(9);
5286
5232
  we[1] = function() {
5287
5233
  var e = this.offset + this.relativeOffset, r = this.parseUShort();
5288
5234
  if (r === 1)
@@ -5430,7 +5376,7 @@ we[8] = function() {
5430
5376
  substitutes: this.parseUShortList()
5431
5377
  };
5432
5378
  };
5433
- function Uo(t, e) {
5379
+ function To(t, e) {
5434
5380
  e = e || 0;
5435
5381
  var r = new C(t, e), n = r.parseVersion(1);
5436
5382
  return _.argument(n === 1 || n === 1.1, "Unsupported GSUB table version."), n === 1 ? {
@@ -5520,7 +5466,7 @@ ut[6] = function(e) {
5520
5466
  }
5521
5467
  _.assert(!1, "lookup type 6 format must be 1, 2 or 3.");
5522
5468
  };
5523
- function Ao(t) {
5469
+ function Eo(t) {
5524
5470
  return new M.Table("GSUB", [
5525
5471
  { name: "version", type: "ULONG", value: 65536 },
5526
5472
  { name: "scripts", type: "TABLE", value: new M.ScriptList(t.scripts) },
@@ -5528,8 +5474,8 @@ function Ao(t) {
5528
5474
  { name: "lookups", type: "TABLE", value: new M.LookupList(t.lookups, ut) }
5529
5475
  ]);
5530
5476
  }
5531
- var pi = { parse: Uo, make: Ao };
5532
- function Bo(t, e) {
5477
+ var pi = { parse: To, make: Eo };
5478
+ function Co(t, e) {
5533
5479
  var r = new D.Parser(t, e), n = r.parseULong();
5534
5480
  _.argument(n === 1, "Unsupported META table version."), r.parseULong(), r.parseULong();
5535
5481
  for (var a = r.parseULong(), i = {}, s = 0; s < a; s++) {
@@ -5538,7 +5484,7 @@ function Bo(t, e) {
5538
5484
  }
5539
5485
  return i;
5540
5486
  }
5541
- function Oo(t) {
5487
+ function Uo(t) {
5542
5488
  var e = Object.keys(t).length, r = "", n = 16 + e * 12, a = new M.Table("meta", [
5543
5489
  { name: "version", type: "ULONG", value: 1 },
5544
5490
  { name: "flags", type: "ULONG", value: 0 },
@@ -5551,7 +5497,7 @@ function Oo(t) {
5551
5497
  }
5552
5498
  return a.fields.push({ name: "stringPool", type: "CHARARRAY", value: r }), a;
5553
5499
  }
5554
- var di = { parse: Bo, make: Oo };
5500
+ var di = { parse: Co, make: Uo };
5555
5501
  function Nn(t) {
5556
5502
  return Math.log(t) / Math.log(2) | 0;
5557
5503
  }
@@ -5604,16 +5550,16 @@ function Hn(t, e, r) {
5604
5550
  }
5605
5551
  return r;
5606
5552
  }
5607
- function Lo(t) {
5553
+ function Ao(t) {
5608
5554
  for (var e = 0, r = 0; r < t.length; r += 1)
5609
5555
  e += t[r];
5610
5556
  return e / t.length;
5611
5557
  }
5612
- function Ro(t) {
5613
- for (var e = [], r = [], n = [], a = [], i = [], s = [], o = [], c, u = 0, h = 0, d = 0, p = 0, g = 0, x = 0; x < t.glyphs.length; x += 1) {
5614
- var m = t.glyphs.get(x), F = m.unicode | 0;
5558
+ function Bo(t) {
5559
+ for (var e = [], r = [], n = [], a = [], i = [], s = [], o = [], c, u = 0, h = 0, d = 0, p = 0, g = 0, S = 0; S < t.glyphs.length; S += 1) {
5560
+ var m = t.glyphs.get(S), F = m.unicode | 0;
5615
5561
  if (isNaN(m.advanceWidth))
5616
- throw new Error("Glyph " + m.name + " (" + x + "): advanceWidth is not a number.");
5562
+ throw new Error("Glyph " + m.name + " (" + S + "): advanceWidth is not a number.");
5617
5563
  (c > F || c === void 0) && F > 0 && (c = F), u < F && (u = F);
5618
5564
  var y = Vr.getUnicodeRange(F);
5619
5565
  if (y < 32)
@@ -5627,8 +5573,8 @@ function Ro(t) {
5627
5573
  else
5628
5574
  throw new Error("Unicode ranges bits > 123 are reserved for internal usage");
5629
5575
  if (m.name !== ".notdef") {
5630
- var S = m.getMetrics();
5631
- e.push(S.xMin), r.push(S.yMin), n.push(S.xMax), a.push(S.yMax), s.push(S.leftSideBearing), o.push(S.rightSideBearing), i.push(m.advanceWidth);
5576
+ var x = m.getMetrics();
5577
+ e.push(x.xMin), r.push(x.yMin), n.push(x.xMax), a.push(x.yMax), s.push(x.leftSideBearing), o.push(x.rightSideBearing), i.push(m.advanceWidth);
5632
5578
  }
5633
5579
  }
5634
5580
  var w = {
@@ -5637,7 +5583,7 @@ function Ro(t) {
5637
5583
  xMax: Math.max.apply(null, n),
5638
5584
  yMax: Math.max.apply(null, a),
5639
5585
  advanceWidthMax: Math.max.apply(null, i),
5640
- advanceWidthAvg: Lo(i),
5586
+ advanceWidthAvg: Ao(i),
5641
5587
  minLeftSideBearing: Math.min.apply(null, s),
5642
5588
  maxLeftSideBearing: Math.max.apply(null, s),
5643
5589
  minRightSideBearing: Math.min.apply(null, o)
@@ -5711,7 +5657,7 @@ function Ro(t) {
5711
5657
  throw new Error("Could not find head table with checkSum to adjust.");
5712
5658
  return tt;
5713
5659
  }
5714
- var Mo = { make: gi, fontToTable: Ro, computeCheckSum: en };
5660
+ var Oo = { make: gi, fontToTable: Bo, computeCheckSum: en };
5715
5661
  function ur(t, e) {
5716
5662
  for (var r = 0, n = t.length - 1; r <= n; ) {
5717
5663
  var a = r + n >>> 1, i = t[a].tag;
@@ -5993,7 +5939,7 @@ Tt.prototype.getKerningTables = function(t, e) {
5993
5939
  function de(t) {
5994
5940
  kt.call(this, t, "gsub");
5995
5941
  }
5996
- function Io(t, e) {
5942
+ function Lo(t, e) {
5997
5943
  var r = t.length;
5998
5944
  if (r !== e.length)
5999
5945
  return !1;
@@ -6066,8 +6012,8 @@ de.prototype.getLigatures = function(t, e, r) {
6066
6012
  for (var n = [], a = this.getLookupTables(e, r, t, 4), i = 0; i < a.length; i++)
6067
6013
  for (var s = a[i].subtables, o = 0; o < s.length; o++)
6068
6014
  for (var c = s[o], u = this.expandCoverage(c.coverage), h = c.ligatureSets, d = 0; d < u.length; d++)
6069
- for (var p = u[d], g = h[d], x = 0; x < g.length; x++) {
6070
- var m = g[x];
6015
+ for (var p = u[d], g = h[d], S = 0; S < g.length; S++) {
6016
+ var m = g[S];
6071
6017
  n.push({
6072
6018
  sub: [p].concat(m.components),
6073
6019
  by: m.ligGlyph
@@ -6123,7 +6069,7 @@ de.prototype.addLigature = function(t, e, r, n) {
6123
6069
  }, u = this.binSearch(i.coverage.glyphs, s);
6124
6070
  if (u >= 0) {
6125
6071
  for (var h = i.ligatureSets[u], d = 0; d < h.length; d++)
6126
- if (Io(h[d].components, o))
6072
+ if (Lo(h[d].components, o))
6127
6073
  return;
6128
6074
  h.push(c);
6129
6075
  } else
@@ -6161,10 +6107,10 @@ de.prototype.add = function(t, e, r, n) {
6161
6107
  return e.by instanceof Array ? this.addMultiple(t, e, r, n) : this.addLigature(t, e, r, n);
6162
6108
  }
6163
6109
  };
6164
- function Do() {
6110
+ function Ro() {
6165
6111
  return typeof window < "u";
6166
6112
  }
6167
- function _o(t) {
6113
+ function Mo(t) {
6168
6114
  for (var e = new Buffer(t.byteLength), r = new Uint8Array(t), n = 0; n < e.length; ++n)
6169
6115
  e[n] = r[n];
6170
6116
  return e;
@@ -6194,14 +6140,14 @@ function vi(t, e, r) {
6194
6140
  for (var d = n.parseByte(), p = 0; p < d; p += 1)
6195
6141
  a.push(i), h += 1;
6196
6142
  if (_.argument(a.length === u, "Bad flags."), s.length > 0) {
6197
- var g = [], x;
6143
+ var g = [], S;
6198
6144
  if (u > 0) {
6199
6145
  for (var m = 0; m < u; m += 1)
6200
- i = a[m], x = {}, x.onCurve = !!(i & 1), x.lastPointOfContour = s.indexOf(m) >= 0, g.push(x);
6146
+ i = a[m], S = {}, S.onCurve = !!(i & 1), S.lastPointOfContour = s.indexOf(m) >= 0, g.push(S);
6201
6147
  for (var F = 0, y = 0; y < u; y += 1)
6202
- i = a[y], x = g[y], x.x = qn(n, i, F, 2, 16), F = x.x;
6203
- for (var S = 0, w = 0; w < u; w += 1)
6204
- i = a[w], x = g[w], x.y = qn(n, i, S, 4, 32), S = x.y;
6148
+ i = a[y], S = g[y], S.x = qn(n, i, F, 2, 16), F = S.x;
6149
+ for (var x = 0, w = 0; w < u; w += 1)
6150
+ i = a[w], S = g[w], S.y = qn(n, i, x, 4, 32), x = S.y;
6205
6151
  }
6206
6152
  t.points = g;
6207
6153
  } else
@@ -6242,7 +6188,7 @@ function hr(t, e) {
6242
6188
  }
6243
6189
  return r;
6244
6190
  }
6245
- function Po(t) {
6191
+ function Io(t) {
6246
6192
  for (var e = [], r = [], n = 0; n < t.length; n += 1) {
6247
6193
  var a = t[n];
6248
6194
  r.push(a), a.lastPointOfContour && (e.push(r), r = []);
@@ -6253,7 +6199,7 @@ function yi(t) {
6253
6199
  var e = new se();
6254
6200
  if (!t)
6255
6201
  return e;
6256
- for (var r = Po(t), n = 0; n < r.length; ++n) {
6202
+ for (var r = Io(t), n = 0; n < r.length; ++n) {
6257
6203
  var a = r[n], i = null, s = a[a.length - 1], o = a[0];
6258
6204
  if (s.onCurve)
6259
6205
  e.moveTo(s.x, s.y);
@@ -6300,45 +6246,45 @@ function mi(t, e) {
6300
6246
  }
6301
6247
  return yi(e.points);
6302
6248
  }
6303
- function No(t, e, r, n) {
6249
+ function Do(t, e, r, n) {
6304
6250
  for (var a = new Re.GlyphSet(n), i = 0; i < r.length - 1; i += 1) {
6305
6251
  var s = r[i], o = r[i + 1];
6306
6252
  s !== o ? a.push(i, Re.ttfGlyphLoader(n, i, vi, t, e + s, mi)) : a.push(i, Re.glyphLoader(n, i));
6307
6253
  }
6308
6254
  return a;
6309
6255
  }
6310
- function Go(t, e, r, n) {
6256
+ function _o(t, e, r, n) {
6311
6257
  var a = new Re.GlyphSet(n);
6312
6258
  return n._push = function(i) {
6313
6259
  var s = r[i], o = r[i + 1];
6314
6260
  s !== o ? a.push(i, Re.ttfGlyphLoader(n, i, vi, t, e + s, mi)) : a.push(i, Re.glyphLoader(n, i));
6315
6261
  }, a;
6316
6262
  }
6317
- function Ho(t, e, r, n, a) {
6318
- return a.lowMemory ? Go(t, e, r, n) : No(t, e, r, n);
6263
+ function Po(t, e, r, n, a) {
6264
+ return a.lowMemory ? _o(t, e, r, n) : Do(t, e, r, n);
6319
6265
  }
6320
- var bi = { getPath: yi, parse: Ho }, xi, et, Si, Xr;
6266
+ var bi = { getPath: yi, parse: Po }, xi, et, Si, Xr;
6321
6267
  function wi(t) {
6322
6268
  this.font = t, this.getCommands = function(e) {
6323
6269
  return bi.getPath(e).commands;
6324
6270
  }, this._fpgmState = this._prepState = void 0, this._errorState = 0;
6325
6271
  }
6326
- function zo(t) {
6272
+ function No(t) {
6327
6273
  return t;
6328
6274
  }
6329
6275
  function Fi(t) {
6330
6276
  return Math.sign(t) * Math.round(Math.abs(t));
6331
6277
  }
6332
- function Wo(t) {
6278
+ function Go(t) {
6333
6279
  return Math.sign(t) * Math.round(Math.abs(t * 2)) / 2;
6334
6280
  }
6335
- function qo(t) {
6281
+ function Ho(t) {
6336
6282
  return Math.sign(t) * (Math.round(Math.abs(t) + 0.5) - 0.5);
6337
6283
  }
6338
- function Vo(t) {
6284
+ function zo(t) {
6339
6285
  return Math.sign(t) * Math.ceil(Math.abs(t));
6340
6286
  }
6341
- function Xo(t) {
6287
+ function Wo(t) {
6342
6288
  return Math.sign(t) * Math.floor(Math.abs(t));
6343
6289
  }
6344
6290
  var ki = function(t) {
@@ -6514,7 +6460,7 @@ De.prototype.prevTouched = function(t) {
6514
6460
  e = e.prevPointOnContour;
6515
6461
  return e;
6516
6462
  };
6517
- var St = Object.freeze(new De(0, 0)), Yo = {
6463
+ var St = Object.freeze(new De(0, 0)), qo = {
6518
6464
  cvCutIn: 17 / 16,
6519
6465
  // control value cut in
6520
6466
  deltaBase: 9,
@@ -6541,7 +6487,7 @@ wi.prototype.exec = function(t, e) {
6541
6487
  if (!n || n.ppem !== e) {
6542
6488
  var a = this._fpgmState;
6543
6489
  if (!a) {
6544
- He.prototype = Yo, a = this._fpgmState = new He("fpgm", r.tables.fpgm), a.funcs = [], a.font = r, exports.DEBUG && (console.log("---EXEC FPGM---"), a.step = -1);
6490
+ He.prototype = qo, a = this._fpgmState = new He("fpgm", r.tables.fpgm), a.funcs = [], a.font = r, exports.DEBUG && (console.log("---EXEC FPGM---"), a.step = -1);
6545
6491
  try {
6546
6492
  et(a);
6547
6493
  } catch (u) {
@@ -6582,14 +6528,14 @@ Si = function(t, e) {
6582
6528
  for (var u = 0; u < a.length; u++) {
6583
6529
  var h = a[u], d = c.glyphs.get(h.glyphIndex);
6584
6530
  o = new He("glyf", d.instructions), exports.DEBUG && (console.log("---EXEC COMP " + u + "---"), o.step = -1), Xr(d, o, r, n);
6585
- for (var p = Math.round(h.dx * r), g = Math.round(h.dy * n), x = o.gZone, m = o.contours, F = 0; F < x.length; F++) {
6586
- var y = x[F];
6531
+ for (var p = Math.round(h.dx * r), g = Math.round(h.dy * n), S = o.gZone, m = o.contours, F = 0; F < S.length; F++) {
6532
+ var y = S[F];
6587
6533
  y.xTouched = y.yTouched = !1, y.xo = y.x = y.x + p, y.yo = y.y = y.y + g;
6588
6534
  }
6589
- var S = s.length;
6590
- s.push.apply(s, x);
6535
+ var x = s.length;
6536
+ s.push.apply(s, S);
6591
6537
  for (var w = 0; w < m.length; w++)
6592
- i.push(m[w] + S);
6538
+ i.push(m[w] + x);
6593
6539
  }
6594
6540
  t.instructions && !o.inhibitGridFit && (o = new He("glyf", t.instructions), o.gZone = o.z0 = o.z1 = o.z2 = s, o.contours = i, s.push(
6595
6541
  new De(0, 0),
@@ -6619,8 +6565,8 @@ Xr = function(t, e, r, n) {
6619
6565
  new De(Math.round(t.advanceWidth * r), 0)
6620
6566
  ), et(e), s.length -= 2, exports.DEBUG) {
6621
6567
  console.log("FINISHED GLYPH", e.stack);
6622
- for (var x = 0; x < i; x++)
6623
- console.log(x, s[x].x, s[x].y);
6568
+ for (var S = 0; S < i; S++)
6569
+ console.log(S, s[S].x, s[S].y);
6624
6570
  }
6625
6571
  }
6626
6572
  };
@@ -6682,41 +6628,41 @@ function Zn(t, e) {
6682
6628
  var o, c;
6683
6629
  t ? (o = i.y - s.y, c = s.x - i.x) : (o = s.x - i.x, c = s.y - i.y), e.fv = Ct(o, c);
6684
6630
  }
6685
- function jo(t) {
6631
+ function Vo(t) {
6686
6632
  var e = t.stack, r = e.pop(), n = e.pop();
6687
6633
  exports.DEBUG && console.log(t.step, "SPVFS[]", r, n), t.pv = t.dpv = Ct(n, r);
6688
6634
  }
6689
- function Zo(t) {
6635
+ function Xo(t) {
6690
6636
  var e = t.stack, r = e.pop(), n = e.pop();
6691
6637
  exports.DEBUG && console.log(t.step, "SPVFS[]", r, n), t.fv = Ct(n, r);
6692
6638
  }
6693
- function $o(t) {
6639
+ function Yo(t) {
6694
6640
  var e = t.stack, r = t.pv;
6695
6641
  exports.DEBUG && console.log(t.step, "GPV[]"), e.push(r.x * 16384), e.push(r.y * 16384);
6696
6642
  }
6697
- function Ko(t) {
6643
+ function jo(t) {
6698
6644
  var e = t.stack, r = t.fv;
6699
6645
  exports.DEBUG && console.log(t.step, "GFV[]"), e.push(r.x * 16384), e.push(r.y * 16384);
6700
6646
  }
6701
- function Qo(t) {
6647
+ function Zo(t) {
6702
6648
  t.fv = t.pv, exports.DEBUG && console.log(t.step, "SFVTPV[]");
6703
6649
  }
6704
- function Jo(t) {
6650
+ function $o(t) {
6705
6651
  var e = t.stack, r = e.pop(), n = e.pop(), a = e.pop(), i = e.pop(), s = e.pop(), o = t.z0, c = t.z1, u = o[r], h = o[n], d = c[a], p = c[i], g = t.z2[s];
6706
6652
  exports.DEBUG && console.log("ISECT[], ", r, n, a, i, s);
6707
- var x = u.x, m = u.y, F = h.x, y = h.y, S = d.x, w = d.y, k = p.x, T = p.y, R = (x - F) * (w - T) - (m - y) * (S - k), L = x * y - m * F, B = S * T - w * k;
6708
- g.x = (L * (S - k) - B * (x - F)) / R, g.y = (L * (w - T) - B * (m - y)) / R;
6653
+ var S = u.x, m = u.y, F = h.x, y = h.y, x = d.x, w = d.y, k = p.x, T = p.y, R = (S - F) * (w - T) - (m - y) * (x - k), L = S * y - m * F, B = x * T - w * k;
6654
+ g.x = (L * (x - k) - B * (S - F)) / R, g.y = (L * (w - T) - B * (m - y)) / R;
6709
6655
  }
6710
- function ec(t) {
6656
+ function Ko(t) {
6711
6657
  t.rp0 = t.stack.pop(), exports.DEBUG && console.log(t.step, "SRP0[]", t.rp0);
6712
6658
  }
6713
- function tc(t) {
6659
+ function Qo(t) {
6714
6660
  t.rp1 = t.stack.pop(), exports.DEBUG && console.log(t.step, "SRP1[]", t.rp1);
6715
6661
  }
6716
- function rc(t) {
6662
+ function Jo(t) {
6717
6663
  t.rp2 = t.stack.pop(), exports.DEBUG && console.log(t.step, "SRP2[]", t.rp2);
6718
6664
  }
6719
- function nc(t) {
6665
+ function ec(t) {
6720
6666
  var e = t.stack.pop();
6721
6667
  switch (exports.DEBUG && console.log(t.step, "SZP0[]", e), t.zp0 = e, e) {
6722
6668
  case 0:
@@ -6729,7 +6675,7 @@ function nc(t) {
6729
6675
  throw new Error("Invalid zone pointer");
6730
6676
  }
6731
6677
  }
6732
- function ac(t) {
6678
+ function tc(t) {
6733
6679
  var e = t.stack.pop();
6734
6680
  switch (exports.DEBUG && console.log(t.step, "SZP1[]", e), t.zp1 = e, e) {
6735
6681
  case 0:
@@ -6742,7 +6688,7 @@ function ac(t) {
6742
6688
  throw new Error("Invalid zone pointer");
6743
6689
  }
6744
6690
  }
6745
- function ic(t) {
6691
+ function rc(t) {
6746
6692
  var e = t.stack.pop();
6747
6693
  switch (exports.DEBUG && console.log(t.step, "SZP2[]", e), t.zp2 = e, e) {
6748
6694
  case 0:
@@ -6755,7 +6701,7 @@ function ic(t) {
6755
6701
  throw new Error("Invalid zone pointer");
6756
6702
  }
6757
6703
  }
6758
- function sc(t) {
6704
+ function nc(t) {
6759
6705
  var e = t.stack.pop();
6760
6706
  switch (exports.DEBUG && console.log(t.step, "SZPS[]", e), t.zp0 = t.zp1 = t.zp2 = e, e) {
6761
6707
  case 0:
@@ -6768,49 +6714,49 @@ function sc(t) {
6768
6714
  throw new Error("Invalid zone pointer");
6769
6715
  }
6770
6716
  }
6771
- function oc(t) {
6717
+ function ac(t) {
6772
6718
  t.loop = t.stack.pop(), exports.DEBUG && console.log(t.step, "SLOOP[]", t.loop);
6773
6719
  }
6774
- function cc(t) {
6720
+ function ic(t) {
6775
6721
  exports.DEBUG && console.log(t.step, "RTG[]"), t.round = Fi;
6776
6722
  }
6777
- function uc(t) {
6778
- exports.DEBUG && console.log(t.step, "RTHG[]"), t.round = qo;
6723
+ function sc(t) {
6724
+ exports.DEBUG && console.log(t.step, "RTHG[]"), t.round = Ho;
6779
6725
  }
6780
- function hc(t) {
6726
+ function oc(t) {
6781
6727
  var e = t.stack.pop();
6782
6728
  exports.DEBUG && console.log(t.step, "SMD[]", e), t.minDis = e / 64;
6783
6729
  }
6784
- function lc(t) {
6730
+ function cc(t) {
6785
6731
  exports.DEBUG && console.log(t.step, "ELSE[]"), Ti(t, !1);
6786
6732
  }
6787
- function fc(t) {
6733
+ function uc(t) {
6788
6734
  var e = t.stack.pop();
6789
6735
  exports.DEBUG && console.log(t.step, "JMPR[]", e), t.ip += e - 1;
6790
6736
  }
6791
- function pc(t) {
6737
+ function hc(t) {
6792
6738
  var e = t.stack.pop();
6793
6739
  exports.DEBUG && console.log(t.step, "SCVTCI[]", e), t.cvCutIn = e / 64;
6794
6740
  }
6795
- function dc(t) {
6741
+ function lc(t) {
6796
6742
  var e = t.stack;
6797
6743
  exports.DEBUG && console.log(t.step, "DUP[]"), e.push(e[e.length - 1]);
6798
6744
  }
6799
6745
  function lr(t) {
6800
6746
  exports.DEBUG && console.log(t.step, "POP[]"), t.stack.pop();
6801
6747
  }
6802
- function gc(t) {
6748
+ function fc(t) {
6803
6749
  exports.DEBUG && console.log(t.step, "CLEAR[]"), t.stack.length = 0;
6804
6750
  }
6805
- function vc(t) {
6751
+ function pc(t) {
6806
6752
  var e = t.stack, r = e.pop(), n = e.pop();
6807
6753
  exports.DEBUG && console.log(t.step, "SWAP[]"), e.push(r), e.push(n);
6808
6754
  }
6809
- function yc(t) {
6755
+ function dc(t) {
6810
6756
  var e = t.stack;
6811
6757
  exports.DEBUG && console.log(t.step, "DEPTH[]"), e.push(e.length);
6812
6758
  }
6813
- function mc(t) {
6759
+ function gc(t) {
6814
6760
  var e = t.stack, r = e.pop(), n = e.pop();
6815
6761
  exports.DEBUG && console.log(t.step, "LOOPCALL[]", r, n);
6816
6762
  var a = t.ip, i = t.prog;
@@ -6823,21 +6769,21 @@ function mc(t) {
6823
6769
  );
6824
6770
  t.ip = a, t.prog = i;
6825
6771
  }
6826
- function bc(t) {
6772
+ function vc(t) {
6827
6773
  var e = t.stack.pop();
6828
6774
  exports.DEBUG && console.log(t.step, "CALL[]", e);
6829
6775
  var r = t.ip, n = t.prog;
6830
6776
  t.prog = t.funcs[e], et(t), t.ip = r, t.prog = n, exports.DEBUG && console.log(++t.step, "returning from", e);
6831
6777
  }
6832
- function xc(t) {
6778
+ function yc(t) {
6833
6779
  var e = t.stack, r = e.pop();
6834
6780
  exports.DEBUG && console.log(t.step, "CINDEX[]", r), e.push(e[e.length - r]);
6835
6781
  }
6836
- function Sc(t) {
6782
+ function mc(t) {
6837
6783
  var e = t.stack, r = e.pop();
6838
6784
  exports.DEBUG && console.log(t.step, "MINDEX[]", r), e.push(e.splice(e.length - r, 1)[0]);
6839
6785
  }
6840
- function wc(t) {
6786
+ function bc(t) {
6841
6787
  if (t.env !== "fpgm")
6842
6788
  throw new Error("FDEF not allowed here");
6843
6789
  var e = t.stack, r = t.prog, n = t.ip, a = e.pop(), i = n;
@@ -6893,7 +6839,7 @@ function ea(t, e) {
6893
6839
  for (var u, h = s.distance(a, a, !1, !0), d = c.length - 2, p = 0; p < d; p++)
6894
6840
  u = c[p], i.setRelative(u, u, h, s);
6895
6841
  }
6896
- function Fc(t) {
6842
+ function xc(t) {
6897
6843
  for (var e = t.stack, r = t.loop, n = t.fv, a = e.pop() / 64, i = t.z2; r--; ) {
6898
6844
  var s = e.pop(), o = i[s];
6899
6845
  exports.DEBUG && console.log(
@@ -6905,7 +6851,7 @@ function Fc(t) {
6905
6851
  }
6906
6852
  t.loop = 1;
6907
6853
  }
6908
- function kc(t) {
6854
+ function Sc(t) {
6909
6855
  for (var e = t.stack, r = t.rp1, n = t.rp2, a = t.loop, i = t.z0[r], s = t.z1[n], o = t.fv, c = t.dpv, u = t.z2; a--; ) {
6910
6856
  var h = e.pop(), d = u[h];
6911
6857
  exports.DEBUG && console.log(
@@ -6923,7 +6869,7 @@ function ta(t, e) {
6923
6869
  var r = e.stack, n = r.pop() / 64, a = r.pop(), i = e.z1[a], s = e.z0[e.rp0], o = e.fv, c = e.pv;
6924
6870
  o.setRelative(i, s, n, c), o.touch(i), exports.DEBUG && console.log(e.step, "MSIRP[" + t + "]", n, a), e.rp1 = e.rp0, e.rp2 = a, t && (e.rp0 = a);
6925
6871
  }
6926
- function Tc(t) {
6872
+ function wc(t) {
6927
6873
  for (var e = t.stack, r = t.rp0, n = t.z0[r], a = t.loop, i = t.fv, s = t.pv, o = t.z1; a--; ) {
6928
6874
  var c = e.pop(), u = o[c];
6929
6875
  exports.DEBUG && console.log(
@@ -6934,8 +6880,8 @@ function Tc(t) {
6934
6880
  }
6935
6881
  t.loop = 1;
6936
6882
  }
6937
- function Ec(t) {
6938
- exports.DEBUG && console.log(t.step, "RTDG[]"), t.round = Wo;
6883
+ function Fc(t) {
6884
+ exports.DEBUG && console.log(t.step, "RTDG[]"), t.round = Go;
6939
6885
  }
6940
6886
  function ra(t, e) {
6941
6887
  var r = e.stack, n = r.pop(), a = r.pop(), i = e.z0[a], s = e.fv, o = e.pv, c = e.cvt[n];
@@ -6951,14 +6897,14 @@ function ra(t, e) {
6951
6897
  var u = o.distance(i, St);
6952
6898
  t && (Math.abs(u - c) < e.cvCutIn && (u = c), u = e.round(u)), s.setRelative(i, St, u, o), e.zp0 === 0 && (i.xo = i.x, i.yo = i.y), s.touch(i), e.rp0 = e.rp1 = a;
6953
6899
  }
6954
- function Cc(t) {
6900
+ function kc(t) {
6955
6901
  var e = t.prog, r = t.ip, n = t.stack, a = e[++r];
6956
6902
  exports.DEBUG && console.log(t.step, "NPUSHB[]", a);
6957
6903
  for (var i = 0; i < a; i++)
6958
6904
  n.push(e[++r]);
6959
6905
  t.ip = r;
6960
6906
  }
6961
- function Uc(t) {
6907
+ function Tc(t) {
6962
6908
  var e = t.ip, r = t.prog, n = t.stack, a = r[++e];
6963
6909
  exports.DEBUG && console.log(t.step, "NPUSHW[]", a);
6964
6910
  for (var i = 0; i < a; i++) {
@@ -6967,23 +6913,23 @@ function Uc(t) {
6967
6913
  }
6968
6914
  t.ip = e;
6969
6915
  }
6970
- function Ac(t) {
6916
+ function Ec(t) {
6971
6917
  var e = t.stack, r = t.store;
6972
6918
  r || (r = t.store = []);
6973
6919
  var n = e.pop(), a = e.pop();
6974
6920
  exports.DEBUG && console.log(t.step, "WS", n, a), r[a] = n;
6975
6921
  }
6976
- function Bc(t) {
6922
+ function Cc(t) {
6977
6923
  var e = t.stack, r = t.store, n = e.pop();
6978
6924
  exports.DEBUG && console.log(t.step, "RS", n);
6979
6925
  var a = r && r[n] || 0;
6980
6926
  e.push(a);
6981
6927
  }
6982
- function Oc(t) {
6928
+ function Uc(t) {
6983
6929
  var e = t.stack, r = e.pop(), n = e.pop();
6984
6930
  exports.DEBUG && console.log(t.step, "WCVTP", r, n), t.cvt[n] = r / 64;
6985
6931
  }
6986
- function Lc(t) {
6932
+ function Ac(t) {
6987
6933
  var e = t.stack, r = e.pop();
6988
6934
  exports.DEBUG && console.log(t.step, "RCVT", r), e.push(t.cvt[r] * 64);
6989
6935
  }
@@ -6995,60 +6941,60 @@ function aa(t, e) {
6995
6941
  var r = e.stack, n = r.pop(), a = r.pop(), i = e.z1[n], s = e.z0[a], o = e.dpv.distance(s, i, t, t);
6996
6942
  exports.DEBUG && console.log(e.step, "MD[" + t + "]", n, a, "->", o), e.stack.push(Math.round(o * 64));
6997
6943
  }
6998
- function Rc(t) {
6944
+ function Bc(t) {
6999
6945
  exports.DEBUG && console.log(t.step, "MPPEM[]"), t.stack.push(t.ppem);
7000
6946
  }
7001
- function Mc(t) {
6947
+ function Oc(t) {
7002
6948
  exports.DEBUG && console.log(t.step, "FLIPON[]"), t.autoFlip = !0;
7003
6949
  }
7004
- function Ic(t) {
6950
+ function Lc(t) {
7005
6951
  var e = t.stack, r = e.pop(), n = e.pop();
7006
6952
  exports.DEBUG && console.log(t.step, "LT[]", r, n), e.push(n < r ? 1 : 0);
7007
6953
  }
7008
- function Dc(t) {
6954
+ function Rc(t) {
7009
6955
  var e = t.stack, r = e.pop(), n = e.pop();
7010
6956
  exports.DEBUG && console.log(t.step, "LTEQ[]", r, n), e.push(n <= r ? 1 : 0);
7011
6957
  }
7012
- function _c(t) {
6958
+ function Mc(t) {
7013
6959
  var e = t.stack, r = e.pop(), n = e.pop();
7014
6960
  exports.DEBUG && console.log(t.step, "GT[]", r, n), e.push(n > r ? 1 : 0);
7015
6961
  }
7016
- function Pc(t) {
6962
+ function Ic(t) {
7017
6963
  var e = t.stack, r = e.pop(), n = e.pop();
7018
6964
  exports.DEBUG && console.log(t.step, "GTEQ[]", r, n), e.push(n >= r ? 1 : 0);
7019
6965
  }
7020
- function Nc(t) {
6966
+ function Dc(t) {
7021
6967
  var e = t.stack, r = e.pop(), n = e.pop();
7022
6968
  exports.DEBUG && console.log(t.step, "EQ[]", r, n), e.push(r === n ? 1 : 0);
7023
6969
  }
7024
- function Gc(t) {
6970
+ function _c(t) {
7025
6971
  var e = t.stack, r = e.pop(), n = e.pop();
7026
6972
  exports.DEBUG && console.log(t.step, "NEQ[]", r, n), e.push(r !== n ? 1 : 0);
7027
6973
  }
7028
- function Hc(t) {
6974
+ function Pc(t) {
7029
6975
  var e = t.stack, r = e.pop();
7030
6976
  exports.DEBUG && console.log(t.step, "ODD[]", r), e.push(Math.trunc(r) % 2 ? 1 : 0);
7031
6977
  }
7032
- function zc(t) {
6978
+ function Nc(t) {
7033
6979
  var e = t.stack, r = e.pop();
7034
6980
  exports.DEBUG && console.log(t.step, "EVEN[]", r), e.push(Math.trunc(r) % 2 ? 0 : 1);
7035
6981
  }
7036
- function Wc(t) {
6982
+ function Gc(t) {
7037
6983
  var e = t.stack.pop();
7038
6984
  exports.DEBUG && console.log(t.step, "IF[]", e), e || (Ti(t, !0), exports.DEBUG && console.log(t.step, "EIF[]"));
7039
6985
  }
7040
- function qc(t) {
6986
+ function Hc(t) {
7041
6987
  exports.DEBUG && console.log(t.step, "EIF[]");
7042
6988
  }
7043
- function Vc(t) {
6989
+ function zc(t) {
7044
6990
  var e = t.stack, r = e.pop(), n = e.pop();
7045
6991
  exports.DEBUG && console.log(t.step, "AND[]", r, n), e.push(r && n ? 1 : 0);
7046
6992
  }
7047
- function Xc(t) {
6993
+ function Wc(t) {
7048
6994
  var e = t.stack, r = e.pop(), n = e.pop();
7049
6995
  exports.DEBUG && console.log(t.step, "OR[]", r, n), e.push(r || n ? 1 : 0);
7050
6996
  }
7051
- function Yc(t) {
6997
+ function qc(t) {
7052
6998
  var e = t.stack, r = e.pop();
7053
6999
  exports.DEBUG && console.log(t.step, "NOT[]", r), e.push(r ? 0 : 1);
7054
7000
  }
@@ -7058,50 +7004,50 @@ function fr(t, e) {
7058
7004
  for (var h = 0; h < n; h++) {
7059
7005
  var d = r.pop(), p = r.pop(), g = o + ((p & 240) >> 4);
7060
7006
  if (g === s) {
7061
- var x = (p & 15) - 8;
7062
- x >= 0 && x++, exports.DEBUG && console.log(e.step, "DELTAPFIX", d, "by", x * c);
7007
+ var S = (p & 15) - 8;
7008
+ S >= 0 && S++, exports.DEBUG && console.log(e.step, "DELTAPFIX", d, "by", S * c);
7063
7009
  var m = u[d];
7064
- a.setRelative(m, m, x * c, i);
7010
+ a.setRelative(m, m, S * c, i);
7065
7011
  }
7066
7012
  }
7067
7013
  }
7068
- function jc(t) {
7014
+ function Vc(t) {
7069
7015
  var e = t.stack, r = e.pop();
7070
7016
  exports.DEBUG && console.log(t.step, "SDB[]", r), t.deltaBase = r;
7071
7017
  }
7072
- function Zc(t) {
7018
+ function Xc(t) {
7073
7019
  var e = t.stack, r = e.pop();
7074
7020
  exports.DEBUG && console.log(t.step, "SDS[]", r), t.deltaShift = Math.pow(0.5, r);
7075
7021
  }
7076
- function $c(t) {
7022
+ function Yc(t) {
7077
7023
  var e = t.stack, r = e.pop(), n = e.pop();
7078
7024
  exports.DEBUG && console.log(t.step, "ADD[]", r, n), e.push(n + r);
7079
7025
  }
7080
- function Kc(t) {
7026
+ function jc(t) {
7081
7027
  var e = t.stack, r = e.pop(), n = e.pop();
7082
7028
  exports.DEBUG && console.log(t.step, "SUB[]", r, n), e.push(n - r);
7083
7029
  }
7084
- function Qc(t) {
7030
+ function Zc(t) {
7085
7031
  var e = t.stack, r = e.pop(), n = e.pop();
7086
7032
  exports.DEBUG && console.log(t.step, "DIV[]", r, n), e.push(n * 64 / r);
7087
7033
  }
7088
- function Jc(t) {
7034
+ function $c(t) {
7089
7035
  var e = t.stack, r = e.pop(), n = e.pop();
7090
7036
  exports.DEBUG && console.log(t.step, "MUL[]", r, n), e.push(n * r / 64);
7091
7037
  }
7092
- function eu(t) {
7038
+ function Kc(t) {
7093
7039
  var e = t.stack, r = e.pop();
7094
7040
  exports.DEBUG && console.log(t.step, "ABS[]", r), e.push(Math.abs(r));
7095
7041
  }
7096
- function tu(t) {
7042
+ function Qc(t) {
7097
7043
  var e = t.stack, r = e.pop();
7098
7044
  exports.DEBUG && console.log(t.step, "NEG[]", r), e.push(-r);
7099
7045
  }
7100
- function ru(t) {
7046
+ function Jc(t) {
7101
7047
  var e = t.stack, r = e.pop();
7102
7048
  exports.DEBUG && console.log(t.step, "FLOOR[]", r), e.push(Math.floor(r / 64) * 64);
7103
7049
  }
7104
- function nu(t) {
7050
+ function eu(t) {
7105
7051
  var e = t.stack, r = e.pop();
7106
7052
  exports.DEBUG && console.log(t.step, "CEILING[]", r), e.push(Math.ceil(r / 64) * 64);
7107
7053
  }
@@ -7109,7 +7055,7 @@ function Nt(t, e) {
7109
7055
  var r = e.stack, n = r.pop();
7110
7056
  exports.DEBUG && console.log(e.step, "ROUND[]"), r.push(e.round(n / 64) * 64);
7111
7057
  }
7112
- function au(t) {
7058
+ function tu(t) {
7113
7059
  var e = t.stack, r = e.pop(), n = e.pop();
7114
7060
  exports.DEBUG && console.log(t.step, "WCVTF[]", r, n), t.cvt[n] = r * t.ppem / t.font.unitsPerEm;
7115
7061
  }
@@ -7126,7 +7072,7 @@ function pr(t, e) {
7126
7072
  }
7127
7073
  }
7128
7074
  }
7129
- function iu(t) {
7075
+ function ru(t) {
7130
7076
  var e = t.stack.pop();
7131
7077
  exports.DEBUG && console.log(t.step, "SROUND[]", e), t.round = ki;
7132
7078
  var r;
@@ -7161,7 +7107,7 @@ function iu(t) {
7161
7107
  }
7162
7108
  e &= 15, e === 0 ? t.srThreshold = 0 : t.srThreshold = (e / 8 - 0.5) * r;
7163
7109
  }
7164
- function su(t) {
7110
+ function nu(t) {
7165
7111
  var e = t.stack.pop();
7166
7112
  exports.DEBUG && console.log(t.step, "S45ROUND[]", e), t.round = ki;
7167
7113
  var r;
@@ -7196,16 +7142,16 @@ function su(t) {
7196
7142
  }
7197
7143
  e &= 15, e === 0 ? t.srThreshold = 0 : t.srThreshold = (e / 8 - 0.5) * r;
7198
7144
  }
7199
- function ou(t) {
7200
- exports.DEBUG && console.log(t.step, "ROFF[]"), t.round = zo;
7145
+ function au(t) {
7146
+ exports.DEBUG && console.log(t.step, "ROFF[]"), t.round = No;
7201
7147
  }
7202
- function cu(t) {
7203
- exports.DEBUG && console.log(t.step, "RUTG[]"), t.round = Vo;
7148
+ function iu(t) {
7149
+ exports.DEBUG && console.log(t.step, "RUTG[]"), t.round = zo;
7204
7150
  }
7205
- function uu(t) {
7206
- exports.DEBUG && console.log(t.step, "RDTG[]"), t.round = Xo;
7151
+ function su(t) {
7152
+ exports.DEBUG && console.log(t.step, "RDTG[]"), t.round = Wo;
7207
7153
  }
7208
- function hu(t) {
7154
+ function ou(t) {
7209
7155
  var e = t.stack.pop();
7210
7156
  exports.DEBUG && console.log(t.step, "SCANCTRL[]", e);
7211
7157
  }
@@ -7215,27 +7161,27 @@ function ia(t, e) {
7215
7161
  var o, c;
7216
7162
  t ? (o = i.y - s.y, c = s.x - i.x) : (o = s.x - i.x, c = s.y - i.y), e.dpv = Ct(o, c);
7217
7163
  }
7218
- function lu(t) {
7164
+ function cu(t) {
7219
7165
  var e = t.stack, r = e.pop(), n = 0;
7220
7166
  exports.DEBUG && console.log(t.step, "GETINFO[]", r), r & 1 && (n = 35), r & 32 && (n |= 4096), e.push(n);
7221
7167
  }
7222
- function fu(t) {
7168
+ function uu(t) {
7223
7169
  var e = t.stack, r = e.pop(), n = e.pop(), a = e.pop();
7224
7170
  exports.DEBUG && console.log(t.step, "ROLL[]"), e.push(n), e.push(r), e.push(a);
7225
7171
  }
7226
- function pu(t) {
7172
+ function hu(t) {
7227
7173
  var e = t.stack, r = e.pop(), n = e.pop();
7228
7174
  exports.DEBUG && console.log(t.step, "MAX[]", r, n), e.push(Math.max(n, r));
7229
7175
  }
7230
- function du(t) {
7176
+ function lu(t) {
7231
7177
  var e = t.stack, r = e.pop(), n = e.pop();
7232
7178
  exports.DEBUG && console.log(t.step, "MIN[]", r, n), e.push(Math.min(n, r));
7233
7179
  }
7234
- function gu(t) {
7180
+ function fu(t) {
7235
7181
  var e = t.stack.pop();
7236
7182
  exports.DEBUG && console.log(t.step, "SCANTYPE[]", e);
7237
7183
  }
7238
- function vu(t) {
7184
+ function pu(t) {
7239
7185
  var e = t.stack.pop(), r = t.stack.pop();
7240
7186
  switch (exports.DEBUG && console.log(t.step, "INSTCTRL[]", e, r), e) {
7241
7187
  case 1:
@@ -7265,11 +7211,11 @@ function Ne(t, e) {
7265
7211
  e.ip = r;
7266
7212
  }
7267
7213
  function I(t, e, r, n, a, i) {
7268
- var s = i.stack, o = t && s.pop(), c = s.pop(), u = i.rp0, h = i.z0[u], d = i.z1[c], p = i.minDis, g = i.fv, x = i.dpv, m, F, y, S;
7269
- F = m = x.distance(d, h, !0, !0), y = F >= 0 ? 1 : -1, F = Math.abs(F), t && (S = i.cvt[o], n && Math.abs(F - S) < i.cvCutIn && (F = S)), r && F < p && (F = p), n && (F = i.round(F)), g.setRelative(d, h, y * F, x), g.touch(d), exports.DEBUG && console.log(
7214
+ var s = i.stack, o = t && s.pop(), c = s.pop(), u = i.rp0, h = i.z0[u], d = i.z1[c], p = i.minDis, g = i.fv, S = i.dpv, m, F, y, x;
7215
+ F = m = S.distance(d, h, !0, !0), y = F >= 0 ? 1 : -1, F = Math.abs(F), t && (x = i.cvt[o], n && Math.abs(F - x) < i.cvCutIn && (F = x)), r && F < p && (F = p), n && (F = i.round(F)), g.setRelative(d, h, y * F, S), g.touch(d), exports.DEBUG && console.log(
7270
7216
  i.step,
7271
7217
  (t ? "MIRP[" : "MDRP[") + (e ? "M" : "m") + (r ? ">" : "_") + (n ? "R" : "_") + (a === 0 ? "Gr" : a === 1 ? "Bl" : a === 2 ? "Wh" : "") + "]",
7272
- t ? o + "(" + i.cvt[o] + "," + S + ")" : "",
7218
+ t ? o + "(" + i.cvt[o] + "," + x + ")" : "",
7273
7219
  c,
7274
7220
  "(d =",
7275
7221
  m,
@@ -7300,45 +7246,45 @@ xi = [
7300
7246
  /* 0x09 */
7301
7247
  Zn.bind(void 0, 1),
7302
7248
  /* 0x0A */
7303
- jo,
7249
+ Vo,
7304
7250
  /* 0x0B */
7305
- Zo,
7251
+ Xo,
7306
7252
  /* 0x0C */
7307
- $o,
7253
+ Yo,
7308
7254
  /* 0x0D */
7309
- Ko,
7255
+ jo,
7310
7256
  /* 0x0E */
7311
- Qo,
7257
+ Zo,
7312
7258
  /* 0x0F */
7313
- Jo,
7259
+ $o,
7314
7260
  /* 0x10 */
7315
- ec,
7261
+ Ko,
7316
7262
  /* 0x11 */
7317
- tc,
7263
+ Qo,
7318
7264
  /* 0x12 */
7319
- rc,
7265
+ Jo,
7320
7266
  /* 0x13 */
7321
- nc,
7267
+ ec,
7322
7268
  /* 0x14 */
7323
- ac,
7269
+ tc,
7324
7270
  /* 0x15 */
7325
- ic,
7271
+ rc,
7326
7272
  /* 0x16 */
7327
- sc,
7273
+ nc,
7328
7274
  /* 0x17 */
7329
- oc,
7275
+ ac,
7330
7276
  /* 0x18 */
7331
- cc,
7277
+ ic,
7332
7278
  /* 0x19 */
7333
- uc,
7279
+ sc,
7334
7280
  /* 0x1A */
7335
- hc,
7281
+ oc,
7336
7282
  /* 0x1B */
7337
- lc,
7283
+ cc,
7338
7284
  /* 0x1C */
7339
- fc,
7285
+ uc,
7340
7286
  /* 0x1D */
7341
- pc,
7287
+ hc,
7342
7288
  /* 0x1E */
7343
7289
  void 0,
7344
7290
  // TODO SSWCI
@@ -7346,19 +7292,19 @@ xi = [
7346
7292
  void 0,
7347
7293
  // TODO SSW
7348
7294
  /* 0x20 */
7349
- dc,
7295
+ lc,
7350
7296
  /* 0x21 */
7351
7297
  lr,
7352
7298
  /* 0x22 */
7353
- gc,
7299
+ fc,
7354
7300
  /* 0x23 */
7355
- vc,
7301
+ pc,
7356
7302
  /* 0x24 */
7357
- yc,
7303
+ dc,
7358
7304
  /* 0x25 */
7359
- xc,
7305
+ yc,
7360
7306
  /* 0x26 */
7361
- Sc,
7307
+ mc,
7362
7308
  /* 0x27 */
7363
7309
  void 0,
7364
7310
  // TODO ALIGNPTS
@@ -7368,11 +7314,11 @@ xi = [
7368
7314
  void 0,
7369
7315
  // TODO UTP
7370
7316
  /* 0x2A */
7371
- mc,
7317
+ gc,
7372
7318
  /* 0x2B */
7373
- bc,
7319
+ vc,
7374
7320
  /* 0x2C */
7375
- wc,
7321
+ bc,
7376
7322
  /* 0x2D */
7377
7323
  void 0,
7378
7324
  // ENDF (eaten by FDEF)
@@ -7397,33 +7343,33 @@ xi = [
7397
7343
  /* 0x37 */
7398
7344
  ea.bind(void 0, 1),
7399
7345
  /* 0x38 */
7400
- Fc,
7346
+ xc,
7401
7347
  /* 0x39 */
7402
- kc,
7348
+ Sc,
7403
7349
  /* 0x3A */
7404
7350
  ta.bind(void 0, 0),
7405
7351
  /* 0x3B */
7406
7352
  ta.bind(void 0, 1),
7407
7353
  /* 0x3C */
7408
- Tc,
7354
+ wc,
7409
7355
  /* 0x3D */
7410
- Ec,
7356
+ Fc,
7411
7357
  /* 0x3E */
7412
7358
  ra.bind(void 0, 0),
7413
7359
  /* 0x3F */
7414
7360
  ra.bind(void 0, 1),
7415
7361
  /* 0x40 */
7416
- Cc,
7362
+ kc,
7417
7363
  /* 0x41 */
7418
- Uc,
7364
+ Tc,
7419
7365
  /* 0x42 */
7420
- Ac,
7366
+ Ec,
7421
7367
  /* 0x43 */
7422
- Bc,
7368
+ Cc,
7423
7369
  /* 0x44 */
7424
- Oc,
7370
+ Uc,
7425
7371
  /* 0x45 */
7426
- Lc,
7372
+ Ac,
7427
7373
  /* 0x46 */
7428
7374
  na.bind(void 0, 0),
7429
7375
  /* 0x47 */
@@ -7436,12 +7382,12 @@ xi = [
7436
7382
  /* 0x4A */
7437
7383
  aa.bind(void 0, 1),
7438
7384
  /* 0x4B */
7439
- Rc,
7385
+ Bc,
7440
7386
  /* 0x4C */
7441
7387
  void 0,
7442
7388
  // TODO MPS
7443
7389
  /* 0x4D */
7444
- Mc,
7390
+ Oc,
7445
7391
  /* 0x4E */
7446
7392
  void 0,
7447
7393
  // TODO FLIPOFF
@@ -7449,53 +7395,53 @@ xi = [
7449
7395
  void 0,
7450
7396
  // TODO DEBUG
7451
7397
  /* 0x50 */
7452
- Ic,
7398
+ Lc,
7453
7399
  /* 0x51 */
7454
- Dc,
7400
+ Rc,
7455
7401
  /* 0x52 */
7456
- _c,
7402
+ Mc,
7457
7403
  /* 0x53 */
7458
- Pc,
7404
+ Ic,
7459
7405
  /* 0x54 */
7460
- Nc,
7406
+ Dc,
7461
7407
  /* 0x55 */
7462
- Gc,
7408
+ _c,
7463
7409
  /* 0x56 */
7464
- Hc,
7410
+ Pc,
7465
7411
  /* 0x57 */
7466
- zc,
7412
+ Nc,
7467
7413
  /* 0x58 */
7468
- Wc,
7414
+ Gc,
7469
7415
  /* 0x59 */
7470
- qc,
7416
+ Hc,
7471
7417
  /* 0x5A */
7472
- Vc,
7418
+ zc,
7473
7419
  /* 0x5B */
7474
- Xc,
7420
+ Wc,
7475
7421
  /* 0x5C */
7476
- Yc,
7422
+ qc,
7477
7423
  /* 0x5D */
7478
7424
  fr.bind(void 0, 1),
7479
7425
  /* 0x5E */
7480
- jc,
7426
+ Vc,
7481
7427
  /* 0x5F */
7482
- Zc,
7428
+ Xc,
7483
7429
  /* 0x60 */
7484
- $c,
7430
+ Yc,
7485
7431
  /* 0x61 */
7486
- Kc,
7432
+ jc,
7487
7433
  /* 0x62 */
7488
- Qc,
7434
+ Zc,
7489
7435
  /* 0x63 */
7490
- Jc,
7436
+ $c,
7491
7437
  /* 0x64 */
7492
- eu,
7438
+ Kc,
7493
7439
  /* 0x65 */
7494
- tu,
7440
+ Qc,
7495
7441
  /* 0x66 */
7496
- ru,
7442
+ Jc,
7497
7443
  /* 0x67 */
7498
- nu,
7444
+ eu,
7499
7445
  /* 0x68 */
7500
7446
  Nt.bind(void 0, 0),
7501
7447
  /* 0x69 */
@@ -7517,7 +7463,7 @@ xi = [
7517
7463
  void 0,
7518
7464
  // TODO NROUND[ab]
7519
7465
  /* 0x70 */
7520
- au,
7466
+ tu,
7521
7467
  /* 0x71 */
7522
7468
  fr.bind(void 0, 2),
7523
7469
  /* 0x72 */
@@ -7529,9 +7475,9 @@ xi = [
7529
7475
  /* 0x75 */
7530
7476
  pr.bind(void 0, 3),
7531
7477
  /* 0x76 */
7532
- iu,
7478
+ ru,
7533
7479
  /* 0x77 */
7534
- su,
7480
+ nu,
7535
7481
  /* 0x78 */
7536
7482
  void 0,
7537
7483
  // TODO JROT[]
@@ -7539,13 +7485,13 @@ xi = [
7539
7485
  void 0,
7540
7486
  // TODO JROF[]
7541
7487
  /* 0x7A */
7542
- ou,
7488
+ au,
7543
7489
  /* 0x7B */
7544
7490
  void 0,
7545
7491
  /* 0x7C */
7546
- cu,
7492
+ iu,
7547
7493
  /* 0x7D */
7548
- uu,
7494
+ su,
7549
7495
  /* 0x7E */
7550
7496
  lr,
7551
7497
  // actually SANGW, supposed to do only a pop though
@@ -7566,26 +7512,26 @@ xi = [
7566
7512
  /* 0x84 */
7567
7513
  void 0,
7568
7514
  /* 0x85 */
7569
- hu,
7515
+ ou,
7570
7516
  /* 0x86 */
7571
7517
  ia.bind(void 0, 0),
7572
7518
  /* 0x87 */
7573
7519
  ia.bind(void 0, 1),
7574
7520
  /* 0x88 */
7575
- lu,
7521
+ cu,
7576
7522
  /* 0x89 */
7577
7523
  void 0,
7578
7524
  // TODO IDEF
7579
7525
  /* 0x8A */
7580
- fu,
7526
+ uu,
7581
7527
  /* 0x8B */
7582
- pu,
7528
+ hu,
7583
7529
  /* 0x8C */
7584
- du,
7530
+ lu,
7585
7531
  /* 0x8D */
7586
- gu,
7532
+ fu,
7587
7533
  /* 0x8E */
7588
- vu,
7534
+ pu,
7589
7535
  /* 0x8F */
7590
7536
  void 0,
7591
7537
  /* 0x90 */
@@ -7819,7 +7765,7 @@ function ht(t) {
7819
7765
  function rn(t, e, r) {
7820
7766
  this.contextName = r, this.startIndex = t, this.endOffset = e;
7821
7767
  }
7822
- function yu(t, e, r) {
7768
+ function du(t, e, r) {
7823
7769
  this.contextName = t, this.openRange = null, this.ranges = [], this.checkStart = e, this.checkEnd = r;
7824
7770
  }
7825
7771
  function Fe(t, e) {
@@ -7828,7 +7774,7 @@ function Fe(t, e) {
7828
7774
  function tr(t) {
7829
7775
  this.eventId = t, this.subscribers = [];
7830
7776
  }
7831
- function mu(t) {
7777
+ function gu(t) {
7832
7778
  var e = this, r = [
7833
7779
  "start",
7834
7780
  "end",
@@ -7867,7 +7813,7 @@ function mu(t) {
7867
7813
  });
7868
7814
  }
7869
7815
  function ee(t) {
7870
- this.tokens = [], this.registeredContexts = {}, this.contextCheckers = [], this.events = {}, this.registeredModifiers = [], mu.call(this, t);
7816
+ this.tokens = [], this.registeredContexts = {}, this.contextCheckers = [], this.events = {}, this.registeredModifiers = [], gu.call(this, t);
7871
7817
  }
7872
7818
  ht.prototype.setState = function(t, e) {
7873
7819
  return this.state[t] = e, this.activeState = { key: t, value: this.state[t] }, this.activeState;
@@ -8005,7 +7951,7 @@ ee.prototype.registerContextChecker = function(t, e, r) {
8005
7951
  return {
8006
7952
  FAIL: "missing context end check."
8007
7953
  };
8008
- var n = new yu(
7954
+ var n = new du(
8009
7955
  t,
8010
7956
  e,
8011
7957
  r
@@ -8078,7 +8024,7 @@ function qe(t) {
8078
8024
  function qt(t) {
8079
8025
  return /[A-z]/.test(t);
8080
8026
  }
8081
- function bu(t) {
8027
+ function vu(t) {
8082
8028
  return /\s/.test(t);
8083
8029
  }
8084
8030
  function ge(t) {
@@ -8107,11 +8053,11 @@ function Ut(t, e) {
8107
8053
  }
8108
8054
  return -1;
8109
8055
  }
8110
- function xu(t, e) {
8056
+ function yu(t, e) {
8111
8057
  var r = Ut(t, e.coverage);
8112
8058
  return r === -1 ? null : t + e.deltaGlyphId;
8113
8059
  }
8114
- function Su(t, e) {
8060
+ function mu(t, e) {
8115
8061
  var r = Ut(t, e.coverage);
8116
8062
  return r === -1 ? null : e.substitute[r];
8117
8063
  }
@@ -8124,7 +8070,7 @@ function dr(t, e) {
8124
8070
  }
8125
8071
  return r.length !== t.length ? -1 : r;
8126
8072
  }
8127
- function wu(t, e) {
8073
+ function bu(t, e) {
8128
8074
  var r = e.inputCoverage.length + e.lookaheadCoverage.length + e.backtrackCoverage.length;
8129
8075
  if (t.context.length < r)
8130
8076
  return [];
@@ -8153,8 +8099,8 @@ function wu(t, e) {
8153
8099
  ), d = n.length === e.inputCoverage.length && o.length === e.lookaheadCoverage.length && h.length === e.backtrackCoverage.length, p = [];
8154
8100
  if (d)
8155
8101
  for (var g = 0; g < e.lookupRecords.length; g++)
8156
- for (var x = e.lookupRecords[g], m = x.lookupListIndex, F = this.getLookupByIndex(m), y = 0; y < F.subtables.length; y++) {
8157
- var S = F.subtables[y], w = this.getLookupMethod(F, S), k = this.getSubstitutionType(F, S);
8102
+ for (var S = e.lookupRecords[g], m = S.lookupListIndex, F = this.getLookupByIndex(m), y = 0; y < F.subtables.length; y++) {
8103
+ var x = F.subtables[y], w = this.getLookupMethod(F, x), k = this.getSubstitutionType(F, x);
8158
8104
  if (k === "12")
8159
8105
  for (var T = 0; T < n.length; T++) {
8160
8106
  var R = t.get(T), L = w(R);
@@ -8163,7 +8109,7 @@ function wu(t, e) {
8163
8109
  }
8164
8110
  return p;
8165
8111
  }
8166
- function Fu(t, e) {
8112
+ function xu(t, e) {
8167
8113
  var r = t.current, n = Ut(r, e.coverage);
8168
8114
  if (n === -1)
8169
8115
  return null;
@@ -8179,7 +8125,7 @@ function Fu(t, e) {
8179
8125
  }
8180
8126
  return null;
8181
8127
  }
8182
- function ku(t, e) {
8128
+ function Su(t, e) {
8183
8129
  var r = Ut(t, e.coverage);
8184
8130
  return r === -1 ? null : e.sequences[r];
8185
8131
  }
@@ -8241,35 +8187,35 @@ ge.prototype.getLookupMethod = function(t, e) {
8241
8187
  switch (n) {
8242
8188
  case "11":
8243
8189
  return function(a) {
8244
- return xu.apply(
8190
+ return yu.apply(
8245
8191
  r,
8246
8192
  [a, e]
8247
8193
  );
8248
8194
  };
8249
8195
  case "12":
8250
8196
  return function(a) {
8251
- return Su.apply(
8197
+ return mu.apply(
8252
8198
  r,
8253
8199
  [a, e]
8254
8200
  );
8255
8201
  };
8256
8202
  case "63":
8257
8203
  return function(a) {
8258
- return wu.apply(
8204
+ return bu.apply(
8259
8205
  r,
8260
8206
  [a, e]
8261
8207
  );
8262
8208
  };
8263
8209
  case "41":
8264
8210
  return function(a) {
8265
- return Fu.apply(
8211
+ return xu.apply(
8266
8212
  r,
8267
8213
  [a, e]
8268
8214
  );
8269
8215
  };
8270
8216
  case "21":
8271
8217
  return function(a) {
8272
- return ku.apply(
8218
+ return Su.apply(
8273
8219
  r,
8274
8220
  [a, e]
8275
8221
  );
@@ -8362,7 +8308,7 @@ ge.prototype.getFeature = function(e) {
8362
8308
  var r = this.features[e.script];
8363
8309
  return r ? r.tags[e.tag] ? this.features[e.script].tags[e.tag] : null : { FAIL: "No feature for script " + e.script };
8364
8310
  };
8365
- function Tu(t) {
8311
+ function wu(t) {
8366
8312
  var e = t.current, r = t.get(-1);
8367
8313
  return (
8368
8314
  // ? arabic first char
@@ -8370,7 +8316,7 @@ function Tu(t) {
8370
8316
  !We(r) && We(e)
8371
8317
  );
8372
8318
  }
8373
- function Eu(t) {
8319
+ function Fu(t) {
8374
8320
  var e = t.get(1);
8375
8321
  return (
8376
8322
  // ? last arabic char
@@ -8378,24 +8324,24 @@ function Eu(t) {
8378
8324
  !We(e)
8379
8325
  );
8380
8326
  }
8381
- var Cu = {
8382
- startCheck: Tu,
8383
- endCheck: Eu
8327
+ var ku = {
8328
+ startCheck: wu,
8329
+ endCheck: Fu
8384
8330
  };
8385
- function Uu(t) {
8331
+ function Tu(t) {
8386
8332
  var e = t.current, r = t.get(-1);
8387
8333
  return (
8388
8334
  // ? an arabic char preceded with a non arabic char
8389
8335
  (We(e) || qe(e)) && !We(r)
8390
8336
  );
8391
8337
  }
8392
- function Au(t) {
8338
+ function Eu(t) {
8393
8339
  var e = t.get(1);
8394
8340
  switch (!0) {
8395
8341
  case e === null:
8396
8342
  return !0;
8397
8343
  case (!We(e) && !qe(e)):
8398
- var r = bu(e);
8344
+ var r = vu(e);
8399
8345
  if (!r)
8400
8346
  return !0;
8401
8347
  if (r) {
@@ -8412,38 +8358,38 @@ function Au(t) {
8412
8358
  return !1;
8413
8359
  }
8414
8360
  }
8415
- var Bu = {
8416
- startCheck: Uu,
8417
- endCheck: Au
8361
+ var Cu = {
8362
+ startCheck: Tu,
8363
+ endCheck: Eu
8418
8364
  };
8419
- function Ou(t, e, r) {
8365
+ function Uu(t, e, r) {
8420
8366
  e[r].setState(t.tag, t.substitution);
8421
8367
  }
8422
- function Lu(t, e, r) {
8368
+ function Au(t, e, r) {
8423
8369
  e[r].setState(t.tag, t.substitution);
8424
8370
  }
8425
- function Ru(t, e, r) {
8371
+ function Bu(t, e, r) {
8426
8372
  t.substitution.forEach(function(n, a) {
8427
8373
  var i = e[r + a];
8428
8374
  i.setState(t.tag, n);
8429
8375
  });
8430
8376
  }
8431
- function Mu(t, e, r) {
8377
+ function Ou(t, e, r) {
8432
8378
  var n = e[r];
8433
8379
  n.setState(t.tag, t.substitution.ligGlyph);
8434
8380
  for (var a = t.substitution.components.length, i = 0; i < a; i++)
8435
8381
  n = e[r + i + 1], n.setState("deleted", !0);
8436
8382
  }
8437
8383
  var sa = {
8438
- 11: Ou,
8439
- 12: Lu,
8440
- 63: Ru,
8441
- 41: Mu
8384
+ 11: Uu,
8385
+ 12: Au,
8386
+ 63: Bu,
8387
+ 41: Ou
8442
8388
  };
8443
8389
  function nn(t, e, r) {
8444
8390
  t instanceof Qe && sa[t.id] && sa[t.id](t, e, r);
8445
8391
  }
8446
- function Iu(t) {
8392
+ function Lu(t) {
8447
8393
  for (var e = [].concat(t.backtrack), r = e.length - 1; r >= 0; r--) {
8448
8394
  var n = e[r], a = Ei(n), i = qe(n);
8449
8395
  if (!a && !i)
@@ -8453,7 +8399,7 @@ function Iu(t) {
8453
8399
  }
8454
8400
  return !1;
8455
8401
  }
8456
- function Du(t) {
8402
+ function Ru(t) {
8457
8403
  if (Ei(t.current))
8458
8404
  return !1;
8459
8405
  for (var e = 0; e < t.lookahead.length; e++) {
@@ -8463,7 +8409,7 @@ function Du(t) {
8463
8409
  }
8464
8410
  return !1;
8465
8411
  }
8466
- function _u(t) {
8412
+ function Mu(t) {
8467
8413
  var e = this, r = "arab", n = this.featuresTags[r], a = this.tokenizer.getRangeTokens(t);
8468
8414
  if (a.length !== 1) {
8469
8415
  var i = new Fe(
@@ -8485,7 +8431,7 @@ function _u(t) {
8485
8431
  if (!qe(o.char)) {
8486
8432
  i.setCurrentIndex(c), s.setCurrentIndex(c);
8487
8433
  var u = 0;
8488
- Iu(s) && (u |= 1), Du(s) && (u |= 2);
8434
+ Lu(s) && (u |= 1), Ru(s) && (u |= 2);
8489
8435
  var h;
8490
8436
  switch (u) {
8491
8437
  case 1:
@@ -8520,7 +8466,7 @@ function oa(t, e) {
8520
8466
  });
8521
8467
  return new Fe(r, 0);
8522
8468
  }
8523
- function Pu(t) {
8469
+ function Iu(t) {
8524
8470
  var e = this, r = "arab", n = this.tokenizer.getRangeTokens(t), a = oa(n);
8525
8471
  a.context.forEach(function(i, s) {
8526
8472
  a.setCurrentIndex(s);
@@ -8536,7 +8482,7 @@ function Pu(t) {
8536
8482
  ), a = oa(n));
8537
8483
  });
8538
8484
  }
8539
- function Nu(t) {
8485
+ function Du(t) {
8540
8486
  var e = t.current, r = t.get(-1);
8541
8487
  return (
8542
8488
  // ? latin first char
@@ -8544,7 +8490,7 @@ function Nu(t) {
8544
8490
  !qt(r) && qt(e)
8545
8491
  );
8546
8492
  }
8547
- function Gu(t) {
8493
+ function _u(t) {
8548
8494
  var e = t.get(1);
8549
8495
  return (
8550
8496
  // ? last latin char
@@ -8552,9 +8498,9 @@ function Gu(t) {
8552
8498
  !qt(e)
8553
8499
  );
8554
8500
  }
8555
- var Hu = {
8556
- startCheck: Nu,
8557
- endCheck: Gu
8501
+ var Pu = {
8502
+ startCheck: Du,
8503
+ endCheck: _u
8558
8504
  };
8559
8505
  function ca(t, e) {
8560
8506
  var r = t.map(function(n) {
@@ -8562,7 +8508,7 @@ function ca(t, e) {
8562
8508
  });
8563
8509
  return new Fe(r, 0);
8564
8510
  }
8565
- function zu(t) {
8511
+ function Nu(t) {
8566
8512
  var e = this, r = "latn", n = this.tokenizer.getRangeTokens(t), a = ca(n);
8567
8513
  a.context.forEach(function(i, s) {
8568
8514
  a.setCurrentIndex(s);
@@ -8585,9 +8531,9 @@ Ee.prototype.setText = function(t) {
8585
8531
  this.text = t;
8586
8532
  };
8587
8533
  Ee.prototype.contextChecks = {
8588
- latinWordCheck: Hu,
8589
- arabicWordCheck: Cu,
8590
- arabicSentenceCheck: Bu
8534
+ latinWordCheck: Pu,
8535
+ arabicWordCheck: ku,
8536
+ arabicSentenceCheck: Cu
8591
8537
  };
8592
8538
  function gr(t) {
8593
8539
  var e = this.contextChecks[t + "Check"];
@@ -8597,10 +8543,10 @@ function gr(t) {
8597
8543
  e.endCheck
8598
8544
  );
8599
8545
  }
8600
- function Wu() {
8546
+ function Gu() {
8601
8547
  return gr.call(this, "latinWord"), gr.call(this, "arabicWord"), gr.call(this, "arabicSentence"), this.tokenizer.tokenize(this.text);
8602
8548
  }
8603
- function qu() {
8549
+ function Hu() {
8604
8550
  var t = this, e = this.tokenizer.getContextRanges("arabicSentence");
8605
8551
  e.forEach(function(r) {
8606
8552
  var n = t.tokenizer.getRangeTokens(r);
@@ -8639,17 +8585,17 @@ function an() {
8639
8585
  "glyphIndex modifier is required to apply arabic presentation features."
8640
8586
  );
8641
8587
  }
8642
- function Vu() {
8588
+ function zu() {
8643
8589
  var t = this, e = "arab";
8644
8590
  if (this.featuresTags.hasOwnProperty(e)) {
8645
8591
  an.call(this);
8646
8592
  var r = this.tokenizer.getContextRanges("arabicWord");
8647
8593
  r.forEach(function(n) {
8648
- _u.call(t, n);
8594
+ Mu.call(t, n);
8649
8595
  });
8650
8596
  }
8651
8597
  }
8652
- function Xu() {
8598
+ function Wu() {
8653
8599
  var t = this, e = "arab";
8654
8600
  if (this.featuresTags.hasOwnProperty(e)) {
8655
8601
  var r = this.featuresTags[e];
@@ -8657,12 +8603,12 @@ function Xu() {
8657
8603
  an.call(this);
8658
8604
  var n = this.tokenizer.getContextRanges("arabicWord");
8659
8605
  n.forEach(function(a) {
8660
- Pu.call(t, a);
8606
+ Iu.call(t, a);
8661
8607
  });
8662
8608
  }
8663
8609
  }
8664
8610
  }
8665
- function Yu() {
8611
+ function qu() {
8666
8612
  var t = this, e = "latn";
8667
8613
  if (this.featuresTags.hasOwnProperty(e)) {
8668
8614
  var r = this.featuresTags[e];
@@ -8670,7 +8616,7 @@ function Yu() {
8670
8616
  an.call(this);
8671
8617
  var n = this.tokenizer.getContextRanges("latinWord");
8672
8618
  n.forEach(function(a) {
8673
- zu.call(t, a);
8619
+ Nu.call(t, a);
8674
8620
  });
8675
8621
  }
8676
8622
  }
@@ -8679,10 +8625,10 @@ Ee.prototype.checkContextReady = function(t) {
8679
8625
  return !!this.tokenizer.getContext(t);
8680
8626
  };
8681
8627
  Ee.prototype.applyFeaturesToContexts = function() {
8682
- this.checkContextReady("arabicWord") && (Vu.call(this), Xu.call(this)), this.checkContextReady("latinWord") && Yu.call(this), this.checkContextReady("arabicSentence") && qu.call(this);
8628
+ this.checkContextReady("arabicWord") && (zu.call(this), Wu.call(this)), this.checkContextReady("latinWord") && qu.call(this), this.checkContextReady("arabicSentence") && Hu.call(this);
8683
8629
  };
8684
8630
  Ee.prototype.processText = function(t) {
8685
- (!this.text || this.text !== t) && (this.setText(t), Wu.call(this), this.applyFeaturesToContexts());
8631
+ (!this.text || this.text !== t) && (this.setText(t), Gu.call(this), this.applyFeaturesToContexts());
8686
8632
  };
8687
8633
  Ee.prototype.getBidiText = function(t) {
8688
8634
  return this.processText(t), this.tokenizer.getText();
@@ -8851,7 +8797,7 @@ X.prototype.validate = function() {
8851
8797
  r("fontFamily"), r("weightName"), r("manufacturer"), r("copyright"), r("version"), this.unitsPerEm > 0;
8852
8798
  };
8853
8799
  X.prototype.toTables = function() {
8854
- return Mo.fontToTable(this);
8800
+ return Oo.fontToTable(this);
8855
8801
  };
8856
8802
  X.prototype.toBuffer = function() {
8857
8803
  return console.warn("Font.toBuffer is deprecated. Use Font.toArrayBuffer instead."), this.toArrayBuffer();
@@ -8865,7 +8811,7 @@ X.prototype.download = function(t) {
8865
8811
  var e = this.getEnglishName("fontFamily"), r = this.getEnglishName("fontSubfamily");
8866
8812
  t = t || e.replace(/\s/g, "") + "-" + r + ".otf";
8867
8813
  var n = this.toArrayBuffer();
8868
- if (Do())
8814
+ if (Ro())
8869
8815
  if (window.URL = window.URL || window.webkitURL, window.URL) {
8870
8816
  var a = new DataView(n), i = new Blob([a], { type: "font/opentype" }), s = document.createElement("a");
8871
8817
  s.href = window.URL.createObjectURL(i), s.download = t;
@@ -8874,7 +8820,7 @@ X.prototype.download = function(t) {
8874
8820
  } else
8875
8821
  console.warn("Font file could not be downloaded. Try using a different browser.");
8876
8822
  else {
8877
- var c = require("fs"), u = _o(n);
8823
+ var c = require("fs"), u = Mo(n);
8878
8824
  c.writeFileSync(t, u);
8879
8825
  }
8880
8826
  };
@@ -8934,7 +8880,7 @@ function Ci(t, e) {
8934
8880
  }
8935
8881
  return e[n] = t, n;
8936
8882
  }
8937
- function ju(t, e, r) {
8883
+ function Vu(t, e, r) {
8938
8884
  var n = Ci(e.name, r);
8939
8885
  return [
8940
8886
  { name: "tag_" + t, type: "TAG", value: e.tag },
@@ -8945,11 +8891,11 @@ function ju(t, e, r) {
8945
8891
  { name: "nameID_" + t, type: "USHORT", value: n }
8946
8892
  ];
8947
8893
  }
8948
- function Zu(t, e, r) {
8894
+ function Xu(t, e, r) {
8949
8895
  var n = {}, a = new D.Parser(t, e);
8950
8896
  return n.tag = a.parseTag(), n.minValue = a.parseFixed(), n.defaultValue = a.parseFixed(), n.maxValue = a.parseFixed(), a.skip("uShort", 1), n.name = r[a.parseUShort()] || {}, n;
8951
8897
  }
8952
- function $u(t, e, r, n) {
8898
+ function Yu(t, e, r, n) {
8953
8899
  for (var a = Ci(e.name, n), i = [
8954
8900
  { name: "nameID_" + t, type: "USHORT", value: a },
8955
8901
  { name: "flags_" + t, type: "USHORT", value: 0 }
@@ -8963,14 +8909,14 @@ function $u(t, e, r, n) {
8963
8909
  }
8964
8910
  return i;
8965
8911
  }
8966
- function Ku(t, e, r, n) {
8912
+ function ju(t, e, r, n) {
8967
8913
  var a = {}, i = new D.Parser(t, e);
8968
8914
  a.name = n[i.parseUShort()] || {}, i.skip("uShort", 1), a.coordinates = {};
8969
8915
  for (var s = 0; s < r.length; ++s)
8970
8916
  a.coordinates[r[s].tag] = i.parseFixed();
8971
8917
  return a;
8972
8918
  }
8973
- function Qu(t, e) {
8919
+ function Zu(t, e) {
8974
8920
  var r = new M.Table("fvar", [
8975
8921
  { name: "version", type: "ULONG", value: 65536 },
8976
8922
  { name: "offsetToData", type: "USHORT", value: 0 },
@@ -8982,28 +8928,28 @@ function Qu(t, e) {
8982
8928
  ]);
8983
8929
  r.offsetToData = r.sizeOf();
8984
8930
  for (var n = 0; n < t.axes.length; n++)
8985
- r.fields = r.fields.concat(ju(n, t.axes[n], e));
8931
+ r.fields = r.fields.concat(Vu(n, t.axes[n], e));
8986
8932
  for (var a = 0; a < t.instances.length; a++)
8987
- r.fields = r.fields.concat($u(a, t.instances[a], t.axes, e));
8933
+ r.fields = r.fields.concat(Yu(a, t.instances[a], t.axes, e));
8988
8934
  return r;
8989
8935
  }
8990
- function Ju(t, e, r) {
8936
+ function $u(t, e, r) {
8991
8937
  var n = new D.Parser(t, e), a = n.parseULong();
8992
8938
  _.argument(a === 65536, "Unsupported fvar table version.");
8993
8939
  var i = n.parseOffset16();
8994
8940
  n.skip("uShort", 1);
8995
8941
  for (var s = n.parseUShort(), o = n.parseUShort(), c = n.parseUShort(), u = n.parseUShort(), h = [], d = 0; d < s; d++)
8996
- h.push(Zu(t, e + i + d * o, r));
8997
- for (var p = [], g = e + i + s * o, x = 0; x < c; x++)
8998
- p.push(Ku(t, g + x * u, h, r));
8942
+ h.push(Xu(t, e + i + d * o, r));
8943
+ for (var p = [], g = e + i + s * o, S = 0; S < c; S++)
8944
+ p.push(ju(t, g + S * u, h, r));
8999
8945
  return { axes: h, instances: p };
9000
8946
  }
9001
- var eh = { make: Qu, parse: Ju }, th = function() {
8947
+ var Ku = { make: Zu, parse: $u }, Qu = function() {
9002
8948
  return {
9003
8949
  coverage: this.parsePointer(C.coverage),
9004
8950
  attachPoints: this.parseList(C.pointer(C.uShortList))
9005
8951
  };
9006
- }, rh = function() {
8952
+ }, Ju = function() {
9007
8953
  var t = this.parseUShort();
9008
8954
  if (_.argument(
9009
8955
  t === 1 || t === 2 || t === 3,
@@ -9014,17 +8960,17 @@ var eh = { make: Qu, parse: Ju }, th = function() {
9014
8960
  return { pointindex: this.parseShort() };
9015
8961
  if (t === 3)
9016
8962
  return { coordinate: this.parseShort() };
9017
- }, nh = function() {
9018
- return this.parseList(C.pointer(rh));
9019
- }, ah = function() {
8963
+ }, eh = function() {
8964
+ return this.parseList(C.pointer(Ju));
8965
+ }, th = function() {
9020
8966
  return {
9021
8967
  coverage: this.parsePointer(C.coverage),
9022
- ligGlyphs: this.parseList(C.pointer(nh))
8968
+ ligGlyphs: this.parseList(C.pointer(eh))
9023
8969
  };
9024
- }, ih = function() {
8970
+ }, rh = function() {
9025
8971
  return this.parseUShort(), this.parseList(C.pointer(C.coverage));
9026
8972
  };
9027
- function sh(t, e) {
8973
+ function nh(t, e) {
9028
8974
  e = e || 0;
9029
8975
  var r = new C(t, e), n = r.parseVersion(1);
9030
8976
  _.argument(
@@ -9034,13 +8980,13 @@ function sh(t, e) {
9034
8980
  var a = {
9035
8981
  version: n,
9036
8982
  classDef: r.parsePointer(C.classDef),
9037
- attachList: r.parsePointer(th),
9038
- ligCaretList: r.parsePointer(ah),
8983
+ attachList: r.parsePointer(Qu),
8984
+ ligCaretList: r.parsePointer(th),
9039
8985
  markAttachClassDef: r.parsePointer(C.classDef)
9040
8986
  };
9041
- return n >= 1.2 && (a.markGlyphSets = r.parsePointer(ih)), a;
8987
+ return n >= 1.2 && (a.markGlyphSets = r.parsePointer(rh)), a;
9042
8988
  }
9043
- var oh = { parse: sh }, ke = new Array(10);
8989
+ var ah = { parse: nh }, ke = new Array(10);
9044
8990
  ke[1] = function() {
9045
8991
  var e = this.offset + this.relativeOffset, r = this.parseUShort();
9046
8992
  if (r === 1)
@@ -9118,7 +9064,7 @@ ke[8] = function() {
9118
9064
  ke[9] = function() {
9119
9065
  return { error: "GPOS Lookup 9 not supported" };
9120
9066
  };
9121
- function ch(t, e) {
9067
+ function ih(t, e) {
9122
9068
  e = e || 0;
9123
9069
  var r = new C(t, e), n = r.parseVersion(1);
9124
9070
  return _.argument(n === 1 || n === 1.1, "Unsupported GPOS table version " + n), n === 1 ? {
@@ -9134,17 +9080,17 @@ function ch(t, e) {
9134
9080
  variations: r.parseFeatureVariationsList()
9135
9081
  };
9136
9082
  }
9137
- var uh = new Array(10);
9138
- function hh(t) {
9083
+ var sh = new Array(10);
9084
+ function oh(t) {
9139
9085
  return new M.Table("GPOS", [
9140
9086
  { name: "version", type: "ULONG", value: 65536 },
9141
9087
  { name: "scripts", type: "TABLE", value: new M.ScriptList(t.scripts) },
9142
9088
  { name: "features", type: "TABLE", value: new M.FeatureList(t.features) },
9143
- { name: "lookups", type: "TABLE", value: new M.LookupList(t.lookups, uh) }
9089
+ { name: "lookups", type: "TABLE", value: new M.LookupList(t.lookups, sh) }
9144
9090
  ]);
9145
9091
  }
9146
- var lh = { parse: ch, make: hh };
9147
- function fh(t) {
9092
+ var ch = { parse: ih, make: oh };
9093
+ function uh(t) {
9148
9094
  var e = {};
9149
9095
  t.skip("uShort");
9150
9096
  var r = t.parseUShort();
@@ -9157,7 +9103,7 @@ function fh(t) {
9157
9103
  }
9158
9104
  return e;
9159
9105
  }
9160
- function ph(t) {
9106
+ function hh(t) {
9161
9107
  var e = {};
9162
9108
  t.skip("uShort");
9163
9109
  var r = t.parseULong();
@@ -9173,23 +9119,23 @@ function ph(t) {
9173
9119
  }
9174
9120
  return e;
9175
9121
  }
9176
- function dh(t, e) {
9122
+ function lh(t, e) {
9177
9123
  var r = new D.Parser(t, e), n = r.parseUShort();
9178
9124
  if (n === 0)
9179
- return fh(r);
9125
+ return uh(r);
9180
9126
  if (n === 1)
9181
- return ph(r);
9127
+ return hh(r);
9182
9128
  throw new Error("Unsupported kern table version (" + n + ").");
9183
9129
  }
9184
- var gh = { parse: dh };
9185
- function vh(t, e, r, n) {
9130
+ var fh = { parse: lh };
9131
+ function ph(t, e, r, n) {
9186
9132
  for (var a = new D.Parser(t, e), i = n ? a.parseUShort : a.parseULong, s = [], o = 0; o < r + 1; o += 1) {
9187
9133
  var c = i.call(a);
9188
9134
  n && (c *= 2), s.push(c);
9189
9135
  }
9190
9136
  return s;
9191
9137
  }
9192
- var yh = { parse: vh };
9138
+ var dh = { parse: ph };
9193
9139
  function ua(t, e) {
9194
9140
  for (var r = [], n = 12, a = 0; a < e; a += 1) {
9195
9141
  var i = D.getTag(t, n), s = D.getULong(t, n + 4), o = D.getULong(t, n + 8), c = D.getULong(t, n + 12);
@@ -9197,7 +9143,7 @@ function ua(t, e) {
9197
9143
  }
9198
9144
  return r;
9199
9145
  }
9200
- function mh(t, e) {
9146
+ function gh(t, e) {
9201
9147
  for (var r = [], n = 44, a = 0; a < e; a += 1) {
9202
9148
  var i = D.getTag(t, n), s = D.getULong(t, n + 4), o = D.getULong(t, n + 8), c = D.getULong(t, n + 12), u = void 0;
9203
9149
  o < c ? u = "WOFF" : u = !1, r.push({
@@ -9213,14 +9159,14 @@ function mh(t, e) {
9213
9159
  function re(t, e) {
9214
9160
  if (e.compression === "WOFF") {
9215
9161
  var r = new Uint8Array(t.buffer, e.offset + 2, e.compressedLength - 2), n = new Uint8Array(e.length);
9216
- if (hs(r, n), n.byteLength !== e.length)
9162
+ if (os(r, n), n.byteLength !== e.length)
9217
9163
  throw new Error("Decompression error: " + e.tag + " decompressed length doesn't match recorded length");
9218
9164
  var a = new DataView(n.buffer, 0);
9219
9165
  return { data: a, offset: 0 };
9220
9166
  } else
9221
9167
  return { data: t, offset: e.offset };
9222
9168
  }
9223
- function bh(t, e) {
9169
+ function vh(t, e) {
9224
9170
  e = e ?? {};
9225
9171
  var r, n, a = new X({ empty: !0 }), i = new DataView(t, 0), s, o = [], c = D.getTag(i, 0);
9226
9172
  if (c === "\0\0\0" || c === "true" || c === "typ1")
@@ -9235,10 +9181,10 @@ function bh(t, e) {
9235
9181
  a.outlinesFormat = "cff";
9236
9182
  else
9237
9183
  throw new Error("Unsupported OpenType flavor " + c);
9238
- s = D.getUShort(i, 12), o = mh(i, s);
9184
+ s = D.getUShort(i, 12), o = gh(i, s);
9239
9185
  } else
9240
9186
  throw new Error("Unsupported OpenType signature " + c);
9241
- for (var h, d, p, g, x, m, F, y, S, w, k, T, R = 0; R < s; R += 1) {
9187
+ for (var h, d, p, g, S, m, F, y, x, w, k, T, R = 0; R < s; R += 1) {
9242
9188
  var L = o[R], B = void 0;
9243
9189
  switch (L.tag) {
9244
9190
  case "cmap":
@@ -9284,7 +9230,7 @@ function bh(t, e) {
9284
9230
  p = L;
9285
9231
  break;
9286
9232
  case "loca":
9287
- S = L;
9233
+ x = L;
9288
9234
  break;
9289
9235
  case "CFF ":
9290
9236
  h = L;
@@ -9296,7 +9242,7 @@ function bh(t, e) {
9296
9242
  g = L;
9297
9243
  break;
9298
9244
  case "GPOS":
9299
- x = L;
9245
+ S = L;
9300
9246
  break;
9301
9247
  case "GSUB":
9302
9248
  m = L;
@@ -9307,8 +9253,8 @@ function bh(t, e) {
9307
9253
  }
9308
9254
  }
9309
9255
  var H = re(i, w);
9310
- if (a.tables.name = li.parse(H.data, H.offset, n), a.names = a.tables.name, p && S) {
9311
- var q = r === 0, K = re(i, S), ue = yh.parse(K.data, K.offset, a.numGlyphs, q), ae = re(i, p);
9256
+ if (a.tables.name = li.parse(H.data, H.offset, n), a.names = a.tables.name, p && x) {
9257
+ var q = r === 0, K = re(i, x), ue = dh.parse(K.data, K.offset, a.numGlyphs, q), ae = re(i, p);
9312
9258
  a.glyphs = bi.parse(ae.data, ae.offset, ue, a, e);
9313
9259
  } else if (h) {
9314
9260
  var Y = re(i, h);
@@ -9316,18 +9262,18 @@ function bh(t, e) {
9316
9262
  } else
9317
9263
  throw new Error("Font doesn't contain TrueType or CFF outlines.");
9318
9264
  var j = re(i, F);
9319
- if (ai.parse(a, j.data, j.offset, a.numberOfHMetrics, a.numGlyphs, a.glyphs, e), Os(a, e), y) {
9265
+ if (ai.parse(a, j.data, j.offset, a.numberOfHMetrics, a.numGlyphs, a.glyphs, e), Us(a, e), y) {
9320
9266
  var Z = re(i, y);
9321
- a.kerningPairs = gh.parse(Z.data, Z.offset);
9267
+ a.kerningPairs = fh.parse(Z.data, Z.offset);
9322
9268
  } else
9323
9269
  a.kerningPairs = {};
9324
9270
  if (g) {
9325
9271
  var te = re(i, g);
9326
- a.tables.gdef = oh.parse(te.data, te.offset);
9272
+ a.tables.gdef = ah.parse(te.data, te.offset);
9327
9273
  }
9328
- if (x) {
9329
- var ie = re(i, x);
9330
- a.tables.gpos = lh.parse(ie.data, ie.offset), a.position.init();
9274
+ if (S) {
9275
+ var ie = re(i, S);
9276
+ a.tables.gpos = ch.parse(ie.data, ie.offset), a.position.init();
9331
9277
  }
9332
9278
  if (m) {
9333
9279
  var ne = re(i, m);
@@ -9335,7 +9281,7 @@ function bh(t, e) {
9335
9281
  }
9336
9282
  if (d) {
9337
9283
  var oe = re(i, d);
9338
- a.tables.fvar = eh.parse(oe.data, oe.offset, a.names);
9284
+ a.tables.fvar = Ku.parse(oe.data, oe.offset, a.names);
9339
9285
  }
9340
9286
  if (k) {
9341
9287
  var G = re(i, k);
@@ -9343,45 +9289,61 @@ function bh(t, e) {
9343
9289
  }
9344
9290
  return a;
9345
9291
  }
9346
- function xh(t) {
9347
- return ((r, n) => {
9348
- const a = Math.round, i = {}, s = r.encoding.cmap.glyphIndexMap, o = Object.keys(s), c = r.glyphs.glyphs[s[65]];
9349
- let u = 1;
9350
- c && (u = r.unitsPerEm / c.yMax);
9351
- for (let h = 0; h < o.length; h++) {
9352
- const d = o[h], p = r.glyphs.glyphs[s[d]];
9353
- if (d !== void 0) {
9354
- const g = {
9355
- ha: a(p.advanceWidth),
9356
- x_min: a(p.xMin),
9357
- x_max: a(p.xMax),
9358
- o: ""
9359
- };
9360
- p.path.commands.forEach(function(x) {
9361
- x.type.toLowerCase() === "c" && (x.type = "b"), g.o += x.type.toLowerCase() + " ", x.x !== void 0 && x.y !== void 0 && (g.o += a(x.x) + " " + a(x.y) + " "), x.x1 !== void 0 && x.y1 !== void 0 && (g.o += a(x.x1) + " " + a(x.y1) + " "), x.x2 !== void 0 && x.y2 !== void 0 && (g.o += a(x.x2) + " " + a(x.y2) + " ");
9362
- }), i[String.fromCodePoint(p.unicode)] = g;
9363
- }
9292
+ class yh {
9293
+ constructor(e) {
9294
+ this.isFont = !0, this.type = "Font", this.data = e;
9295
+ }
9296
+ generateShapes(e, r = 100) {
9297
+ const n = [], a = mh(e, r, this.data);
9298
+ for (let i = 0, s = a.length; i < s; i++)
9299
+ n.push(...a[i].toShapes());
9300
+ return n;
9301
+ }
9302
+ }
9303
+ function mh(t, e, r) {
9304
+ const n = Array.from(t), a = e / r.resolution, i = (r.boundingBox.yMax - r.boundingBox.yMin + r.underlineThickness) * a, s = [];
9305
+ let o = 0, c = 0;
9306
+ for (let u = 0; u < n.length; u++) {
9307
+ const h = n[u];
9308
+ if (h === `
9309
+ `)
9310
+ o = 0, c -= i;
9311
+ else {
9312
+ const d = bh(h, a, o, c, r);
9313
+ o += d.offsetX, s.push(d.path);
9364
9314
  }
9365
- return {
9366
- glyphs: i,
9367
- familyName: r.getEnglishName("fullName"),
9368
- ascender: a(r.ascender),
9369
- descender: a(r.descender),
9370
- underlinePosition: r.tables.post.underlinePosition,
9371
- underlineThickness: r.tables.post.underlineThickness,
9372
- boundingBox: {
9373
- xMin: r.tables.head.xMin,
9374
- xMax: r.tables.head.xMax,
9375
- yMin: r.tables.head.yMin,
9376
- yMax: r.tables.head.yMax
9377
- },
9378
- resolution: r.unitsPerEm || 1e3,
9379
- scaleFactor: u,
9380
- original_font_information: r.tables.name
9381
- };
9382
- })(bh(t));
9315
+ }
9316
+ return s;
9317
+ }
9318
+ function bh(t, e, r, n, a) {
9319
+ const i = a.glyphs[t] || a.glyphs["?"];
9320
+ if (!i) {
9321
+ console.error('THREE.Font: character "' + t + '" does not exists in font family ' + a.familyName + ".");
9322
+ return;
9323
+ }
9324
+ const s = new Di();
9325
+ let o, c, u, h, d, p, g, S;
9326
+ if (i.o) {
9327
+ const m = i._cachedOutline || (i._cachedOutline = i.o.split(" "));
9328
+ for (let F = 0, y = m.length; F < y; )
9329
+ switch (m[F++]) {
9330
+ case "m":
9331
+ o = m[F++] * e + r, c = m[F++] * e + n, s.moveTo(o, c);
9332
+ break;
9333
+ case "l":
9334
+ o = m[F++] * e + r, c = m[F++] * e + n, s.lineTo(o, c);
9335
+ break;
9336
+ case "q":
9337
+ u = m[F++] * e + r, h = m[F++] * e + n, d = m[F++] * e + r, p = m[F++] * e + n, s.quadraticCurveTo(d, p, u, h);
9338
+ break;
9339
+ case "b":
9340
+ u = m[F++] * e + r, h = m[F++] * e + n, d = m[F++] * e + r, p = m[F++] * e + n, g = m[F++] * e + r, S = m[F++] * e + n, s.bezierCurveTo(d, p, g, S, u, h);
9341
+ break;
9342
+ }
9343
+ }
9344
+ return { offsetX: i.ha * e, path: s };
9383
9345
  }
9384
- class Sh extends _i {
9346
+ class xh extends _i {
9385
9347
  constructor(e, r = {}) {
9386
9348
  const n = r.font;
9387
9349
  if (n === void 0)
@@ -9431,8 +9393,8 @@ function ha(t, e = !1) {
9431
9393
  const d = [];
9432
9394
  for (let p = 0; p < t.length; ++p) {
9433
9395
  const g = t[p].index;
9434
- for (let x = 0; x < g.count; ++x)
9435
- d.push(g.getX(x) + h);
9396
+ for (let S = 0; S < g.count; ++S)
9397
+ d.push(g.getX(S) + h);
9436
9398
  h += t[p].attributes.position.count;
9437
9399
  }
9438
9400
  c.setIndex(d);
@@ -9451,10 +9413,10 @@ function ha(t, e = !1) {
9451
9413
  const g = [];
9452
9414
  for (let m = 0; m < s[h].length; ++m)
9453
9415
  g.push(s[h][m][p]);
9454
- const x = la(g);
9455
- if (!x)
9416
+ const S = la(g);
9417
+ if (!S)
9456
9418
  return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the " + h + " morphAttribute."), null;
9457
- c.morphAttributes[h].push(x);
9419
+ c.morphAttributes[h].push(S);
9458
9420
  }
9459
9421
  }
9460
9422
  return c;
@@ -9480,9 +9442,9 @@ function la(t) {
9480
9442
  if (h.isInterleavedBufferAttribute) {
9481
9443
  const d = c / r;
9482
9444
  for (let p = 0, g = h.count; p < g; p++)
9483
- for (let x = 0; x < r; x++) {
9484
- const m = h.getComponent(p, x);
9485
- o.setComponent(p + d, x, m);
9445
+ for (let S = 0; S < r; S++) {
9446
+ const m = h.getComponent(p, S);
9447
+ o.setComponent(p + d, S, m);
9486
9448
  }
9487
9449
  } else
9488
9450
  s.set(h.array, c);
@@ -9490,13 +9452,13 @@ function la(t) {
9490
9452
  }
9491
9453
  return a !== void 0 && (o.gpuType = a), o;
9492
9454
  }
9493
- function wh(t, e = 1e-4) {
9455
+ function Sh(t, e = 1e-4) {
9494
9456
  e = Math.max(e, Number.EPSILON);
9495
9457
  const r = {}, n = t.getIndex(), a = t.getAttribute("position"), i = n ? n.count : a.count;
9496
9458
  let s = 0;
9497
9459
  const o = Object.keys(t.attributes), c = {}, u = {}, h = [], d = ["getX", "getY", "getZ", "getW"], p = ["setX", "setY", "setZ", "setW"];
9498
- for (let S = 0, w = o.length; S < w; S++) {
9499
- const k = o[S], T = t.attributes[k];
9460
+ for (let x = 0, w = o.length; x < w; x++) {
9461
+ const k = o[x], T = t.attributes[k];
9500
9462
  c[k] = new T.constructor(
9501
9463
  new T.array.constructor(T.count * T.itemSize),
9502
9464
  T.itemSize,
@@ -9508,9 +9470,9 @@ function wh(t, e = 1e-4) {
9508
9470
  u[k][B] = new L.constructor(H, L.itemSize, L.normalized);
9509
9471
  }));
9510
9472
  }
9511
- const g = e * 0.5, x = Math.log10(1 / e), m = Math.pow(10, x), F = g * m;
9512
- for (let S = 0; S < i; S++) {
9513
- const w = n ? n.getX(S) : S;
9473
+ const g = e * 0.5, S = Math.log10(1 / e), m = Math.pow(10, S), F = g * m;
9474
+ for (let x = 0; x < i; x++) {
9475
+ const w = n ? n.getX(x) : x;
9514
9476
  let k = "";
9515
9477
  for (let T = 0, R = o.length; T < R; T++) {
9516
9478
  const L = o[T], B = t.getAttribute(L), H = B.itemSize;
@@ -9533,16 +9495,16 @@ function wh(t, e = 1e-4) {
9533
9495
  }
9534
9496
  }
9535
9497
  const y = t.clone();
9536
- for (const S in t.attributes) {
9537
- const w = c[S];
9538
- if (y.setAttribute(S, new w.constructor(
9498
+ for (const x in t.attributes) {
9499
+ const w = c[x];
9500
+ if (y.setAttribute(x, new w.constructor(
9539
9501
  w.array.slice(0, s * w.itemSize),
9540
9502
  w.itemSize,
9541
9503
  w.normalized
9542
- )), S in u)
9543
- for (let k = 0; k < u[S].length; k++) {
9544
- const T = u[S][k];
9545
- y.morphAttributes[S][k] = new T.constructor(
9504
+ )), x in u)
9505
+ for (let k = 0; k < u[x].length; k++) {
9506
+ const T = u[x][k];
9507
+ y.morphAttributes[x][k] = new T.constructor(
9546
9508
  T.array.slice(0, s * T.itemSize),
9547
9509
  T.itemSize,
9548
9510
  T.normalized
@@ -9615,7 +9577,7 @@ class fa extends La {
9615
9577
  this.fontSize
9616
9578
  );
9617
9579
  return e == null && (e = Yr.runWithoutNormals(() => {
9618
- const r = new Sh(this.char, {
9580
+ const r = new xh(this.char, {
9619
9581
  font: this.font.font,
9620
9582
  depth: 0,
9621
9583
  size: this.fontSize,
@@ -9629,7 +9591,7 @@ class fa extends La {
9629
9591
  generateSideWallUV: () => [je, je, je, je]
9630
9592
  }
9631
9593
  });
9632
- return r.hasAttribute("uv") && r.deleteAttribute("uv"), r.hasAttribute("normal") && r.deleteAttribute("normal"), wh(r, 1e-6);
9594
+ return r.hasAttribute("uv") && r.deleteAttribute("uv"), r.hasAttribute("normal") && r.deleteAttribute("normal"), Sh(r, 1e-6);
9633
9595
  })), e;
9634
9596
  }
9635
9597
  /**
@@ -9644,15 +9606,75 @@ class fa extends La {
9644
9606
  return a ? (this.isFound = !0, a.ha * r / n.data.resolution) : (this.isFound = !1, 0);
9645
9607
  }
9646
9608
  }
9609
+ class wh {
9610
+ constructor(e = 512) {
9611
+ this.maxSize = e, this.map = /* @__PURE__ */ new Map();
9612
+ }
9613
+ get(e) {
9614
+ const r = this.map.get(e);
9615
+ return r && (this.map.delete(e), this.map.set(e, r)), r;
9616
+ }
9617
+ set(e, r) {
9618
+ if (this.map.has(e))
9619
+ this.map.delete(e);
9620
+ else if (this.map.size >= this.maxSize) {
9621
+ const n = this.map.keys().next().value;
9622
+ n !== void 0 && this.map.delete(n);
9623
+ }
9624
+ this.map.set(e, r);
9625
+ }
9626
+ has(e) {
9627
+ return this.map.has(e);
9628
+ }
9629
+ clear() {
9630
+ this.map.clear();
9631
+ }
9632
+ }
9647
9633
  class Fh extends Oa {
9648
9634
  /**
9649
9635
  * Creates a new instance of MeshFont.
9650
- * @param data - Either a MeshFontData object containing font information or an ArrayBuffer containing raw font data
9636
+ * @param fontData - Either a MeshFontData object containing font information or an ArrayBuffer containing raw font data
9651
9637
  */
9652
9638
  constructor(e) {
9653
- super(e), this.type = "mesh";
9639
+ super(e), this.type = "mesh", this.glyphCache = new wh(512);
9654
9640
  const r = e.data;
9655
- r instanceof ArrayBuffer ? this.data = xh(r) : this.data = r, this.font = new es(this.data);
9641
+ if (r instanceof ArrayBuffer) {
9642
+ const n = this.parseMeshFont(r);
9643
+ this.data = n.data, this.opentypeFont = n.font;
9644
+ } else
9645
+ throw new Error(
9646
+ "Invalid font cache data. Please remove font cache database named 'mlightcad' in IndexedDB and try again!"
9647
+ );
9648
+ this.font = new yh(this.data);
9649
+ }
9650
+ /**
9651
+ * Parses a mesh font from raw binary data.
9652
+ * This function converts raw font data (e.g., TTF, OTF, WOFF) into a MeshFontData object
9653
+ * that can be used by the MeshFont class.
9654
+ *
9655
+ * @param data - The raw font data as an ArrayBuffer
9656
+ * @returns An object containing the opentype font and parsed metadata
9657
+ */
9658
+ parseMeshFont(e) {
9659
+ const r = vh(e), n = Math.round, a = r.charToGlyph("A"), i = a ? r.unitsPerEm / (a.yMax || r.unitsPerEm) : 1, s = {
9660
+ glyphs: {},
9661
+ // Lazy loaded later
9662
+ familyName: r.getEnglishName("fullName"),
9663
+ ascender: n(r.ascender),
9664
+ descender: n(r.descender),
9665
+ underlinePosition: r.tables.post.underlinePosition,
9666
+ underlineThickness: r.tables.post.underlineThickness,
9667
+ boundingBox: {
9668
+ xMin: r.tables.head.xMin,
9669
+ xMax: r.tables.head.xMax,
9670
+ yMin: r.tables.head.yMin,
9671
+ yMax: r.tables.head.yMax
9672
+ },
9673
+ resolution: r.unitsPerEm || 1e3,
9674
+ scaleFactor: i,
9675
+ original_font_information: r.tables.name
9676
+ };
9677
+ return { font: r, data: s };
9656
9678
  }
9657
9679
  /**
9658
9680
  * Return true if this font contains glyph of the specified character. Otherwise, return false.
@@ -9660,7 +9682,7 @@ class Fh extends Oa {
9660
9682
  * @returns True if this font contains glyph of the specified character. Otherwise, return false.
9661
9683
  */
9662
9684
  hasChar(e) {
9663
- return this.data.glyphs[e] != null;
9685
+ return this.opentypeFont.hasChar(e);
9664
9686
  }
9665
9687
  /**
9666
9688
  * Return true if this font contains glyph of the specified character code. Otherwise, return false.
@@ -9670,6 +9692,31 @@ class Fh extends Oa {
9670
9692
  hasCode(e) {
9671
9693
  return this.hasChar(String.fromCodePoint(e));
9672
9694
  }
9695
+ /**
9696
+ * Loads glyph data lazily when requested.
9697
+ * Parsed glyphs are cached in an LRU cache to limit memory usage.
9698
+ * @param char - The character whose glyph should be loaded
9699
+ */
9700
+ _loadGlyphIfNeeded(e) {
9701
+ if (this.data.glyphs[e] || !this.opentypeFont) return;
9702
+ const r = this.glyphCache.get(e);
9703
+ if (r) {
9704
+ this.data.glyphs[e] = r;
9705
+ return;
9706
+ }
9707
+ const n = this.opentypeFont.charToGlyph(e);
9708
+ if (!n || !n.path) return;
9709
+ const a = Math.round, i = {
9710
+ ha: a(n.advanceWidth ?? 0),
9711
+ x_min: a(n.xMin ?? 0),
9712
+ x_max: a(n.xMax ?? 0),
9713
+ o: ""
9714
+ };
9715
+ n.path.commands.forEach((s) => {
9716
+ let o = s.type.toLowerCase();
9717
+ o === "c" && (o = "b"), i.o += o + " ", s.x !== void 0 && s.y !== void 0 && (i.o += a(s.x) + " " + a(s.y) + " "), s.x1 !== void 0 && s.y1 !== void 0 && (i.o += a(s.x1) + " " + a(s.y1) + " "), s.x2 !== void 0 && s.y2 !== void 0 && (i.o += a(s.x2) + " " + a(s.y2) + " ");
9718
+ }), this.data.glyphs[e] = i, this.glyphCache.set(e, i);
9719
+ }
9673
9720
  /**
9674
9721
  * Generates shapes for a text string
9675
9722
  * @param text - The text to generate shapes for
@@ -9677,6 +9724,8 @@ class Fh extends Oa {
9677
9724
  * @returns Array of shapes representing the text
9678
9725
  */
9679
9726
  generateShapes(e, r) {
9727
+ for (const n of e)
9728
+ this._loadGlyphIfNeeded(n);
9680
9729
  return this.font.generateShapes(e, r);
9681
9730
  }
9682
9731
  /**
@@ -9686,7 +9735,7 @@ class Fh extends Oa {
9686
9735
  * @returns The shape data for the character, or undefined if not found
9687
9736
  */
9688
9737
  getCharShape(e, r) {
9689
- if (!this.data.glyphs[e]) {
9738
+ if (this._loadGlyphIfNeeded(e), !this.data.glyphs[e]) {
9690
9739
  this.addUnsupportedChar(e);
9691
9740
  return;
9692
9741
  }
@@ -10355,14 +10404,14 @@ class yt {
10355
10404
  const { strokeWidth: r = "0.5%", strokeColor: n = "black", isAutoFit: a = !1 } = e;
10356
10405
  let i, s;
10357
10406
  if (a) {
10358
- const o = this.bbox, c = 0.2, u = o.maxX - o.minX, h = o.maxY - o.minY, d = u === 0 ? h : u, p = h === 0 ? u : h, g = o.minX - d * c, x = o.maxX + d * c, m = o.minY - p * c, F = o.maxY + p * c;
10407
+ const o = this.bbox, c = 0.2, u = o.maxX - o.minX, h = o.maxY - o.minY, d = u === 0 ? h : u, p = h === 0 ? u : h, g = o.minX - d * c, S = o.maxX + d * c, m = o.minY - p * c, F = o.maxY + p * c;
10359
10408
  s = this.polylines.map((y) => {
10360
- let S = "";
10409
+ let x = "";
10361
10410
  return y.forEach((w, k) => {
10362
10411
  const T = w.x, R = -w.y;
10363
- S += k === 0 ? `M ${T} ${R} ` : `L ${T} ${R} `;
10364
- }), `<path d="${S}" stroke="${n}" stroke-width="${r}" fill="none"/>`;
10365
- }).join(""), i = `${g} ${-F} ${x - g} ${F - m}`;
10412
+ x += k === 0 ? `M ${T} ${R} ` : `L ${T} ${R} `;
10413
+ }), `<path d="${x}" stroke="${n}" stroke-width="${r}" fill="none"/>`;
10414
+ }).join(""), i = `${g} ${-F} ${S - g} ${F - m}`;
10366
10415
  } else
10367
10416
  i = "0 0 20 20", s = this.polylines.map((o) => {
10368
10417
  let c = "";
@@ -10450,8 +10499,8 @@ class Bh {
10450
10499
  h && (h.x *= u, h.y *= c);
10451
10500
  const d = e.polylines.map(
10452
10501
  (p) => p.map((g) => {
10453
- const x = g.clone();
10454
- return x.x *= u, x.y *= c, x;
10502
+ const S = g.clone();
10503
+ return S.x *= u, S.y *= c, S;
10455
10504
  })
10456
10505
  );
10457
10506
  return new yt(h, d);
@@ -10640,8 +10689,8 @@ class Bh {
10640
10689
  let u = o & 7;
10641
10690
  const h = o < 0, d = Math.PI / 4 * c, p = n.currentPoint.clone().subtract(new J(Math.cos(d) * s, Math.sin(d) * s)), g = wt.fromOctant(p, s, c, u, h);
10642
10691
  if (n.isPenDown) {
10643
- const x = g.tessellate();
10644
- n.currentPolyline.pop(), n.currentPolyline.push(...x.slice());
10692
+ const S = g.tessellate();
10693
+ n.currentPolyline.pop(), n.currentPolyline.push(...S.slice());
10645
10694
  }
10646
10695
  return n.currentPoint = (a = g.tessellate().pop()) == null ? void 0 : a.clone(), i;
10647
10696
  }
@@ -10651,27 +10700,27 @@ class Bh {
10651
10700
  let p = h & 7;
10652
10701
  p === 0 && (p = 8), s !== 0 && p--;
10653
10702
  const g = Math.PI / 4;
10654
- let x = g * p, m = Ah, F = 1;
10655
- h < 0 && (m = -m, x = -x, F = -1);
10656
- let y = g * d, S = y + x;
10657
- y += g * i / 256 * F, S += g * s / 256 * F;
10703
+ let S = g * p, m = Ah, F = 1;
10704
+ h < 0 && (m = -m, S = -S, F = -1);
10705
+ let y = g * d, x = y + S;
10706
+ y += g * i / 256 * F, x += g * s / 256 * F;
10658
10707
  const w = n.currentPoint.clone().subtract(new J(u * Math.cos(y), u * Math.sin(y)));
10659
- if (n.currentPoint = w.clone().add(new J(u * Math.cos(S), u * Math.sin(S))), n.isPenDown) {
10708
+ if (n.currentPoint = w.clone().add(new J(u * Math.cos(x), u * Math.sin(x))), n.isPenDown) {
10660
10709
  let k = y;
10661
10710
  const T = [];
10662
10711
  if (T.push(
10663
10712
  w.clone().add(new J(u * Math.cos(k), u * Math.sin(k)))
10664
10713
  ), m > 0)
10665
- for (; k + m < S; )
10714
+ for (; k + m < x; )
10666
10715
  k += m, T.push(
10667
10716
  w.clone().add(new J(u * Math.cos(k), u * Math.sin(k)))
10668
10717
  );
10669
10718
  else
10670
- for (; k + m > S; )
10719
+ for (; k + m > x; )
10671
10720
  k += m, T.push(
10672
10721
  w.clone().add(new J(u * Math.cos(k), u * Math.sin(k)))
10673
10722
  );
10674
- T.push(w.clone().add(new J(u * Math.cos(S), u * Math.sin(S)))), n.currentPolyline.push(...T);
10723
+ T.push(w.clone().add(new J(u * Math.cos(x), u * Math.sin(x)))), n.currentPolyline.push(...T);
10675
10724
  }
10676
10725
  return a;
10677
10726
  }
@@ -10931,12 +10980,12 @@ on.read = function(t, e, r, n, a) {
10931
10980
  return (g ? -1 : 1) * s * Math.pow(2, i - n);
10932
10981
  };
10933
10982
  on.write = function(t, e, r, n, a, i) {
10934
- var s, o, c, u = i * 8 - a - 1, h = (1 << u) - 1, d = h >> 1, p = a === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, g = n ? 0 : i - 1, x = n ? 1 : -1, m = e < 0 || e === 0 && 1 / e < 0 ? 1 : 0;
10935
- for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (o = isNaN(e) ? 1 : 0, s = h) : (s = Math.floor(Math.log(e) / Math.LN2), e * (c = Math.pow(2, -s)) < 1 && (s--, c *= 2), s + d >= 1 ? e += p / c : e += p * Math.pow(2, 1 - d), e * c >= 2 && (s++, c /= 2), s + d >= h ? (o = 0, s = h) : s + d >= 1 ? (o = (e * c - 1) * Math.pow(2, a), s = s + d) : (o = e * Math.pow(2, d - 1) * Math.pow(2, a), s = 0)); a >= 8; t[r + g] = o & 255, g += x, o /= 256, a -= 8)
10983
+ var s, o, c, u = i * 8 - a - 1, h = (1 << u) - 1, d = h >> 1, p = a === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, g = n ? 0 : i - 1, S = n ? 1 : -1, m = e < 0 || e === 0 && 1 / e < 0 ? 1 : 0;
10984
+ for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (o = isNaN(e) ? 1 : 0, s = h) : (s = Math.floor(Math.log(e) / Math.LN2), e * (c = Math.pow(2, -s)) < 1 && (s--, c *= 2), s + d >= 1 ? e += p / c : e += p * Math.pow(2, 1 - d), e * c >= 2 && (s++, c /= 2), s + d >= h ? (o = 0, s = h) : s + d >= 1 ? (o = (e * c - 1) * Math.pow(2, a), s = s + d) : (o = e * Math.pow(2, d - 1) * Math.pow(2, a), s = 0)); a >= 8; t[r + g] = o & 255, g += S, o /= 256, a -= 8)
10936
10985
  ;
10937
- for (s = s << a | o, u += a; u > 0; t[r + g] = s & 255, g += x, s /= 256, u -= 8)
10986
+ for (s = s << a | o, u += a; u > 0; t[r + g] = s & 255, g += S, s /= 256, u -= 8)
10938
10987
  ;
10939
- t[r + g - x] |= m * 128;
10988
+ t[r + g - S] |= m * 128;
10940
10989
  };
10941
10990
  /*!
10942
10991
  * The buffer module from node.js, for the browser.
@@ -10946,7 +10995,7 @@ on.write = function(t, e, r, n, a, i) {
10946
10995
  */
10947
10996
  (function(t) {
10948
10997
  var e = rr, r = on, n = typeof Symbol == "function" && typeof Symbol.for == "function" ? Symbol.for("nodejs.util.inspect.custom") : null;
10949
- t.Buffer = o, t.SlowBuffer = S, t.INSPECT_MAX_BYTES = 50;
10998
+ t.Buffer = o, t.SlowBuffer = x, t.INSPECT_MAX_BYTES = 50;
10950
10999
  var a = 2147483647;
10951
11000
  t.kMaxLength = a, o.TYPED_ARRAY_SUPPORT = i(), !o.TYPED_ARRAY_SUPPORT && typeof console < "u" && typeof console.error == "function" && console.error(
10952
11001
  "This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."
@@ -10995,7 +11044,7 @@ on.write = function(t, e, r, n, a, i) {
10995
11044
  if (typeof v == "string")
10996
11045
  return p(v, l);
10997
11046
  if (ArrayBuffer.isView(v))
10998
- return x(v);
11047
+ return S(v);
10999
11048
  if (v == null)
11000
11049
  throw new TypeError(
11001
11050
  "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof v
@@ -11055,7 +11104,7 @@ on.write = function(t, e, r, n, a, i) {
11055
11104
  f[b] = v[b] & 255;
11056
11105
  return f;
11057
11106
  }
11058
- function x(v) {
11107
+ function S(v) {
11059
11108
  if (Ce(v, Uint8Array)) {
11060
11109
  var l = new Uint8Array(v);
11061
11110
  return m(l.buffer, l.byteOffset, l.byteLength);
@@ -11085,7 +11134,7 @@ on.write = function(t, e, r, n, a, i) {
11085
11134
  throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + a.toString(16) + " bytes");
11086
11135
  return v | 0;
11087
11136
  }
11088
- function S(v) {
11137
+ function x(v) {
11089
11138
  return +v != v && (v = 0), o.alloc(+v);
11090
11139
  }
11091
11140
  o.isBuffer = function(l) {
@@ -11838,7 +11887,7 @@ function Vh() {
11838
11887
  };
11839
11888
  function r(y) {
11840
11889
  if (!y) return "utf8";
11841
- for (var S; ; )
11890
+ for (var x; ; )
11842
11891
  switch (y) {
11843
11892
  case "utf8":
11844
11893
  case "utf-8":
@@ -11856,44 +11905,44 @@ function Vh() {
11856
11905
  case "hex":
11857
11906
  return y;
11858
11907
  default:
11859
- if (S) return;
11860
- y = ("" + y).toLowerCase(), S = !0;
11908
+ if (x) return;
11909
+ y = ("" + y).toLowerCase(), x = !0;
11861
11910
  }
11862
11911
  }
11863
11912
  function n(y) {
11864
- var S = r(y);
11865
- if (typeof S != "string" && (t.isEncoding === e || !e(y))) throw new Error("Unknown encoding: " + y);
11866
- return S || y;
11913
+ var x = r(y);
11914
+ if (typeof x != "string" && (t.isEncoding === e || !e(y))) throw new Error("Unknown encoding: " + y);
11915
+ return x || y;
11867
11916
  }
11868
11917
  mr.StringDecoder = a;
11869
11918
  function a(y) {
11870
11919
  this.encoding = n(y);
11871
- var S;
11920
+ var x;
11872
11921
  switch (this.encoding) {
11873
11922
  case "utf16le":
11874
- this.text = d, this.end = p, S = 4;
11923
+ this.text = d, this.end = p, x = 4;
11875
11924
  break;
11876
11925
  case "utf8":
11877
- this.fillLast = c, S = 4;
11926
+ this.fillLast = c, x = 4;
11878
11927
  break;
11879
11928
  case "base64":
11880
- this.text = g, this.end = x, S = 3;
11929
+ this.text = g, this.end = S, x = 3;
11881
11930
  break;
11882
11931
  default:
11883
11932
  this.write = m, this.end = F;
11884
11933
  return;
11885
11934
  }
11886
- this.lastNeed = 0, this.lastTotal = 0, this.lastChar = t.allocUnsafe(S);
11935
+ this.lastNeed = 0, this.lastTotal = 0, this.lastChar = t.allocUnsafe(x);
11887
11936
  }
11888
11937
  a.prototype.write = function(y) {
11889
11938
  if (y.length === 0) return "";
11890
- var S, w;
11939
+ var x, w;
11891
11940
  if (this.lastNeed) {
11892
- if (S = this.fillLast(y), S === void 0) return "";
11941
+ if (x = this.fillLast(y), x === void 0) return "";
11893
11942
  w = this.lastNeed, this.lastNeed = 0;
11894
11943
  } else
11895
11944
  w = 0;
11896
- return w < y.length ? S ? S + this.text(y, w) : this.text(y, w) : S || "";
11945
+ return w < y.length ? x ? x + this.text(y, w) : this.text(y, w) : x || "";
11897
11946
  }, a.prototype.end = h, a.prototype.text = u, a.prototype.fillLast = function(y) {
11898
11947
  if (this.lastNeed <= y.length)
11899
11948
  return y.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed), this.lastChar.toString(this.encoding, 0, this.lastTotal);
@@ -11902,43 +11951,43 @@ function Vh() {
11902
11951
  function i(y) {
11903
11952
  return y <= 127 ? 0 : y >> 5 === 6 ? 2 : y >> 4 === 14 ? 3 : y >> 3 === 30 ? 4 : y >> 6 === 2 ? -1 : -2;
11904
11953
  }
11905
- function s(y, S, w) {
11906
- var k = S.length - 1;
11954
+ function s(y, x, w) {
11955
+ var k = x.length - 1;
11907
11956
  if (k < w) return 0;
11908
- var T = i(S[k]);
11909
- return T >= 0 ? (T > 0 && (y.lastNeed = T - 1), T) : --k < w || T === -2 ? 0 : (T = i(S[k]), T >= 0 ? (T > 0 && (y.lastNeed = T - 2), T) : --k < w || T === -2 ? 0 : (T = i(S[k]), T >= 0 ? (T > 0 && (T === 2 ? T = 0 : y.lastNeed = T - 3), T) : 0));
11957
+ var T = i(x[k]);
11958
+ return T >= 0 ? (T > 0 && (y.lastNeed = T - 1), T) : --k < w || T === -2 ? 0 : (T = i(x[k]), T >= 0 ? (T > 0 && (y.lastNeed = T - 2), T) : --k < w || T === -2 ? 0 : (T = i(x[k]), T >= 0 ? (T > 0 && (T === 2 ? T = 0 : y.lastNeed = T - 3), T) : 0));
11910
11959
  }
11911
- function o(y, S, w) {
11912
- if ((S[0] & 192) !== 128)
11960
+ function o(y, x, w) {
11961
+ if ((x[0] & 192) !== 128)
11913
11962
  return y.lastNeed = 0, "�";
11914
- if (y.lastNeed > 1 && S.length > 1) {
11915
- if ((S[1] & 192) !== 128)
11963
+ if (y.lastNeed > 1 && x.length > 1) {
11964
+ if ((x[1] & 192) !== 128)
11916
11965
  return y.lastNeed = 1, "�";
11917
- if (y.lastNeed > 2 && S.length > 2 && (S[2] & 192) !== 128)
11966
+ if (y.lastNeed > 2 && x.length > 2 && (x[2] & 192) !== 128)
11918
11967
  return y.lastNeed = 2, "�";
11919
11968
  }
11920
11969
  }
11921
11970
  function c(y) {
11922
- var S = this.lastTotal - this.lastNeed, w = o(this, y);
11971
+ var x = this.lastTotal - this.lastNeed, w = o(this, y);
11923
11972
  if (w !== void 0) return w;
11924
11973
  if (this.lastNeed <= y.length)
11925
- return y.copy(this.lastChar, S, 0, this.lastNeed), this.lastChar.toString(this.encoding, 0, this.lastTotal);
11926
- y.copy(this.lastChar, S, 0, y.length), this.lastNeed -= y.length;
11974
+ return y.copy(this.lastChar, x, 0, this.lastNeed), this.lastChar.toString(this.encoding, 0, this.lastTotal);
11975
+ y.copy(this.lastChar, x, 0, y.length), this.lastNeed -= y.length;
11927
11976
  }
11928
- function u(y, S) {
11929
- var w = s(this, y, S);
11930
- if (!this.lastNeed) return y.toString("utf8", S);
11977
+ function u(y, x) {
11978
+ var w = s(this, y, x);
11979
+ if (!this.lastNeed) return y.toString("utf8", x);
11931
11980
  this.lastTotal = w;
11932
11981
  var k = y.length - (w - this.lastNeed);
11933
- return y.copy(this.lastChar, 0, k), y.toString("utf8", S, k);
11982
+ return y.copy(this.lastChar, 0, k), y.toString("utf8", x, k);
11934
11983
  }
11935
11984
  function h(y) {
11936
- var S = y && y.length ? this.write(y) : "";
11937
- return this.lastNeed ? S + "�" : S;
11985
+ var x = y && y.length ? this.write(y) : "";
11986
+ return this.lastNeed ? x + "�" : x;
11938
11987
  }
11939
- function d(y, S) {
11940
- if ((y.length - S) % 2 === 0) {
11941
- var w = y.toString("utf16le", S);
11988
+ function d(y, x) {
11989
+ if ((y.length - x) % 2 === 0) {
11990
+ var w = y.toString("utf16le", x);
11942
11991
  if (w) {
11943
11992
  var k = w.charCodeAt(w.length - 1);
11944
11993
  if (k >= 55296 && k <= 56319)
@@ -11946,23 +11995,23 @@ function Vh() {
11946
11995
  }
11947
11996
  return w;
11948
11997
  }
11949
- return this.lastNeed = 1, this.lastTotal = 2, this.lastChar[0] = y[y.length - 1], y.toString("utf16le", S, y.length - 1);
11998
+ return this.lastNeed = 1, this.lastTotal = 2, this.lastChar[0] = y[y.length - 1], y.toString("utf16le", x, y.length - 1);
11950
11999
  }
11951
12000
  function p(y) {
11952
- var S = y && y.length ? this.write(y) : "";
12001
+ var x = y && y.length ? this.write(y) : "";
11953
12002
  if (this.lastNeed) {
11954
12003
  var w = this.lastTotal - this.lastNeed;
11955
- return S + this.lastChar.toString("utf16le", 0, w);
12004
+ return x + this.lastChar.toString("utf16le", 0, w);
11956
12005
  }
11957
- return S;
12006
+ return x;
11958
12007
  }
11959
- function g(y, S) {
11960
- var w = (y.length - S) % 3;
11961
- return w === 0 ? y.toString("base64", S) : (this.lastNeed = 3 - w, this.lastTotal = 3, w === 1 ? this.lastChar[0] = y[y.length - 1] : (this.lastChar[0] = y[y.length - 2], this.lastChar[1] = y[y.length - 1]), y.toString("base64", S, y.length - w));
12008
+ function g(y, x) {
12009
+ var w = (y.length - x) % 3;
12010
+ return w === 0 ? y.toString("base64", x) : (this.lastNeed = 3 - w, this.lastTotal = 3, w === 1 ? this.lastChar[0] = y[y.length - 1] : (this.lastChar[0] = y[y.length - 2], this.lastChar[1] = y[y.length - 1]), y.toString("base64", x, y.length - w));
11962
12011
  }
11963
- function x(y) {
11964
- var S = y && y.length ? this.write(y) : "";
11965
- return this.lastNeed ? S + this.lastChar.toString("base64", 0, 3 - this.lastNeed) : S;
12012
+ function S(y) {
12013
+ var x = y && y.length ? this.write(y) : "";
12014
+ return this.lastNeed ? x + this.lastChar.toString("base64", 0, 3 - this.lastNeed) : x;
11966
12015
  }
11967
12016
  function m(y) {
11968
12017
  return y.toString(this.encoding);
@@ -12034,8 +12083,8 @@ function Xh() {
12034
12083
  this.acc = 0, this.contBytes = 0, this.accBytes = 0, this.defaultCharUnicode = h.defaultCharUnicode;
12035
12084
  }
12036
12085
  o.prototype.write = function(u) {
12037
- for (var h = this.acc, d = this.contBytes, p = this.accBytes, g = "", x = 0; x < u.length; x++) {
12038
- var m = u[x];
12086
+ for (var h = this.acc, d = this.contBytes, p = this.accBytes, g = "", S = 0; S < u.length; S++) {
12087
+ var m = u[S];
12039
12088
  (m & 192) !== 128 ? (d > 0 && (g += this.defaultCharUnicode, d = 0), m < 128 ? g += String.fromCharCode(m) : m < 224 ? (h = m & 31, d = 1, p = 1) : m < 240 ? (h = m & 15, d = 2, p = 1) : g += this.defaultCharUnicode) : d > 0 ? (h = h << 6 | m & 63, d--, p++, d === 0 && (p === 2 && h < 128 && h > 0 ? g += this.defaultCharUnicode : p === 3 && h < 2048 ? g += this.defaultCharUnicode : g += String.fromCharCode(h))) : g += this.defaultCharUnicode;
12040
12089
  }
12041
12090
  return this.acc = h, this.contBytes = d, this.accBytes = p, g;
@@ -12073,14 +12122,14 @@ function Yh() {
12073
12122
  this.isLE = h.isLE, this.highSurrogate = 0;
12074
12123
  }
12075
12124
  r.prototype.write = function(u) {
12076
- for (var h = t.from(u, "ucs2"), d = t.alloc(h.length * 2), p = this.isLE ? d.writeUInt32LE : d.writeUInt32BE, g = 0, x = 0; x < h.length; x += 2) {
12077
- var m = h.readUInt16LE(x), F = m >= 55296 && m < 56320, y = m >= 56320 && m < 57344;
12125
+ for (var h = t.from(u, "ucs2"), d = t.alloc(h.length * 2), p = this.isLE ? d.writeUInt32LE : d.writeUInt32BE, g = 0, S = 0; S < h.length; S += 2) {
12126
+ var m = h.readUInt16LE(S), F = m >= 55296 && m < 56320, y = m >= 56320 && m < 57344;
12078
12127
  if (this.highSurrogate)
12079
12128
  if (F || !y)
12080
12129
  p.call(d, this.highSurrogate, g), g += 4;
12081
12130
  else {
12082
- var S = (this.highSurrogate - 55296 << 10 | m - 56320) + 65536;
12083
- p.call(d, S, g), g += 4, this.highSurrogate = 0;
12131
+ var x = (this.highSurrogate - 55296 << 10 | m - 56320) + 65536;
12132
+ p.call(d, x, g), g += 4, this.highSurrogate = 0;
12084
12133
  continue;
12085
12134
  }
12086
12135
  F ? this.highSurrogate = m : (p.call(d, m, g), g += 4, this.highSurrogate = 0);
@@ -12098,14 +12147,14 @@ function Yh() {
12098
12147
  n.prototype.write = function(u) {
12099
12148
  if (u.length === 0)
12100
12149
  return "";
12101
- var h = 0, d = 0, p = t.alloc(u.length + 4), g = 0, x = this.isLE, m = this.overflow, F = this.badChar;
12150
+ var h = 0, d = 0, p = t.alloc(u.length + 4), g = 0, S = this.isLE, m = this.overflow, F = this.badChar;
12102
12151
  if (m.length > 0) {
12103
12152
  for (; h < u.length && m.length < 4; h++)
12104
12153
  m.push(u[h]);
12105
- m.length === 4 && (x ? d = m[h] | m[h + 1] << 8 | m[h + 2] << 16 | m[h + 3] << 24 : d = m[h + 3] | m[h + 2] << 8 | m[h + 1] << 16 | m[h] << 24, m.length = 0, g = a(p, g, d, F));
12154
+ m.length === 4 && (S ? d = m[h] | m[h + 1] << 8 | m[h + 2] << 16 | m[h + 3] << 24 : d = m[h + 3] | m[h + 2] << 8 | m[h + 1] << 16 | m[h] << 24, m.length = 0, g = a(p, g, d, F));
12106
12155
  }
12107
12156
  for (; h < u.length - 3; h += 4)
12108
- x ? d = u[h] | u[h + 1] << 8 | u[h + 2] << 16 | u[h + 3] << 24 : d = u[h + 3] | u[h + 2] << 8 | u[h + 1] << 16 | u[h] << 24, g = a(p, g, d, F);
12157
+ S ? d = u[h] | u[h + 1] << 8 | u[h + 2] << 16 | u[h + 3] << 24 : d = u[h + 3] | u[h + 2] << 8 | u[h + 1] << 16 | u[h] << 24, g = a(p, g, d, F);
12109
12158
  for (; h < u.length; h++)
12110
12159
  m.push(u[h]);
12111
12160
  return p.slice(0, g).toString("ucs2");
@@ -12160,21 +12209,21 @@ function Yh() {
12160
12209
  return this.decoder.end();
12161
12210
  };
12162
12211
  function c(u, h) {
12163
- var d = [], p = 0, g = 0, x = 0, m = 0, F = 0;
12212
+ var d = [], p = 0, g = 0, S = 0, m = 0, F = 0;
12164
12213
  e:
12165
12214
  for (var y = 0; y < u.length; y++)
12166
- for (var S = u[y], w = 0; w < S.length; w++)
12167
- if (d.push(S[w]), d.length === 4) {
12215
+ for (var x = u[y], w = 0; w < x.length; w++)
12216
+ if (d.push(x[w]), d.length === 4) {
12168
12217
  if (p === 0) {
12169
12218
  if (d[0] === 255 && d[1] === 254 && d[2] === 0 && d[3] === 0)
12170
12219
  return "utf-32le";
12171
12220
  if (d[0] === 0 && d[1] === 0 && d[2] === 254 && d[3] === 255)
12172
12221
  return "utf-32be";
12173
12222
  }
12174
- if ((d[0] !== 0 || d[1] > 16) && x++, (d[3] !== 0 || d[2] > 16) && g++, d[0] === 0 && d[1] === 0 && (d[2] !== 0 || d[3] !== 0) && F++, (d[0] !== 0 || d[1] !== 0) && d[2] === 0 && d[3] === 0 && m++, d.length = 0, p++, p >= 100)
12223
+ if ((d[0] !== 0 || d[1] > 16) && S++, (d[3] !== 0 || d[2] > 16) && g++, d[0] === 0 && d[1] === 0 && (d[2] !== 0 || d[3] !== 0) && F++, (d[0] !== 0 || d[1] !== 0) && d[2] === 0 && d[3] === 0 && m++, d.length = 0, p++, p >= 100)
12175
12224
  break e;
12176
12225
  }
12177
- return F - x > m - g ? "utf-32be" : F - x < m - g ? "utf-32le" : h || "utf-32le";
12226
+ return F - S > m - g ? "utf-32be" : F - S < m - g ? "utf-32le" : h || "utf-32le";
12178
12227
  }
12179
12228
  return Me;
12180
12229
  }
@@ -12250,8 +12299,8 @@ function jh() {
12250
12299
  function o(c, u) {
12251
12300
  var h = [], d = 0, p = 0, g = 0;
12252
12301
  e:
12253
- for (var x = 0; x < c.length; x++)
12254
- for (var m = c[x], F = 0; F < m.length; F++)
12302
+ for (var S = 0; S < c.length; S++)
12303
+ for (var m = c[S], F = 0; F < m.length; F++)
12255
12304
  if (h.push(m[F]), h.length === 2) {
12256
12305
  if (d === 0) {
12257
12306
  if (h[0] === 255 && h[1] === 254) return "utf-16le";
@@ -12291,9 +12340,9 @@ function Zh() {
12291
12340
  s[o] = i.test(String.fromCharCode(o));
12292
12341
  var c = 43, u = 45, h = 38;
12293
12342
  a.prototype.write = function(m) {
12294
- for (var F = "", y = 0, S = this.inBase64, w = this.base64Accum, k = 0; k < m.length; k++)
12295
- if (!S)
12296
- m[k] == c && (F += this.iconv.decode(m.slice(y, k), "ascii"), y = k + 1, S = !0);
12343
+ for (var F = "", y = 0, x = this.inBase64, w = this.base64Accum, k = 0; k < m.length; k++)
12344
+ if (!x)
12345
+ m[k] == c && (F += this.iconv.decode(m.slice(y, k), "ascii"), y = k + 1, x = !0);
12297
12346
  else if (!s[m[k]]) {
12298
12347
  if (k == y && m[k] == u)
12299
12348
  F += "+";
@@ -12301,15 +12350,15 @@ function Zh() {
12301
12350
  var T = w + this.iconv.decode(m.slice(y, k), "ascii");
12302
12351
  F += this.iconv.decode(t.from(T, "base64"), "utf16-be");
12303
12352
  }
12304
- m[k] != u && k--, y = k + 1, S = !1, w = "";
12353
+ m[k] != u && k--, y = k + 1, x = !1, w = "";
12305
12354
  }
12306
- if (!S)
12355
+ if (!x)
12307
12356
  F += this.iconv.decode(m.slice(y), "ascii");
12308
12357
  else {
12309
12358
  var T = w + this.iconv.decode(m.slice(y), "ascii"), R = T.length - T.length % 8;
12310
12359
  w = T.slice(R), T = T.slice(0, R), F += this.iconv.decode(t.from(T, "base64"), "utf16-be");
12311
12360
  }
12312
- return this.inBase64 = S, this.base64Accum = w, F;
12361
+ return this.inBase64 = x, this.base64Accum = w, F;
12313
12362
  }, a.prototype.end = function() {
12314
12363
  var m = "";
12315
12364
  return this.inBase64 && this.base64Accum.length > 0 && (m = this.iconv.decode(t.from(this.base64Accum, "base64"), "utf16-be")), this.inBase64 = !1, this.base64Accum = "", m;
@@ -12322,11 +12371,11 @@ function Zh() {
12322
12371
  this.iconv = F.iconv, this.inBase64 = !1, this.base64Accum = t.alloc(6), this.base64AccumIdx = 0;
12323
12372
  }
12324
12373
  p.prototype.write = function(m) {
12325
- for (var F = this.inBase64, y = this.base64Accum, S = this.base64AccumIdx, w = t.alloc(m.length * 5 + 10), k = 0, T = 0; T < m.length; T++) {
12374
+ for (var F = this.inBase64, y = this.base64Accum, x = this.base64AccumIdx, w = t.alloc(m.length * 5 + 10), k = 0, T = 0; T < m.length; T++) {
12326
12375
  var R = m.charCodeAt(T);
12327
- R >= 32 && R <= 126 ? (F && (S > 0 && (k += w.write(y.slice(0, S).toString("base64").replace(/\//g, ",").replace(/=+$/, ""), k), S = 0), w[k++] = u, F = !1), F || (w[k++] = R, R === h && (w[k++] = u))) : (F || (w[k++] = h, F = !0), F && (y[S++] = R >> 8, y[S++] = R & 255, S == y.length && (k += w.write(y.toString("base64").replace(/\//g, ","), k), S = 0)));
12376
+ R >= 32 && R <= 126 ? (F && (x > 0 && (k += w.write(y.slice(0, x).toString("base64").replace(/\//g, ",").replace(/=+$/, ""), k), x = 0), w[k++] = u, F = !1), F || (w[k++] = R, R === h && (w[k++] = u))) : (F || (w[k++] = h, F = !0), F && (y[x++] = R >> 8, y[x++] = R & 255, x == y.length && (k += w.write(y.toString("base64").replace(/\//g, ","), k), x = 0)));
12328
12377
  }
12329
- return this.inBase64 = F, this.base64AccumIdx = S, w.slice(0, k);
12378
+ return this.inBase64 = F, this.base64AccumIdx = x, w.slice(0, k);
12330
12379
  }, p.prototype.end = function() {
12331
12380
  var m = t.alloc(10), F = 0;
12332
12381
  return this.inBase64 && (this.base64AccumIdx > 0 && (F += m.write(this.base64Accum.slice(0, this.base64AccumIdx).toString("base64").replace(/\//g, ",").replace(/=+$/, ""), F), this.base64AccumIdx = 0), m[F++] = u, this.inBase64 = !1), m.slice(0, F);
@@ -12334,27 +12383,27 @@ function Zh() {
12334
12383
  function g(m, F) {
12335
12384
  this.iconv = F.iconv, this.inBase64 = !1, this.base64Accum = "";
12336
12385
  }
12337
- var x = s.slice();
12338
- return x[44] = !0, g.prototype.write = function(m) {
12339
- for (var F = "", y = 0, S = this.inBase64, w = this.base64Accum, k = 0; k < m.length; k++)
12340
- if (!S)
12341
- m[k] == h && (F += this.iconv.decode(m.slice(y, k), "ascii"), y = k + 1, S = !0);
12342
- else if (!x[m[k]]) {
12386
+ var S = s.slice();
12387
+ return S[44] = !0, g.prototype.write = function(m) {
12388
+ for (var F = "", y = 0, x = this.inBase64, w = this.base64Accum, k = 0; k < m.length; k++)
12389
+ if (!x)
12390
+ m[k] == h && (F += this.iconv.decode(m.slice(y, k), "ascii"), y = k + 1, x = !0);
12391
+ else if (!S[m[k]]) {
12343
12392
  if (k == y && m[k] == u)
12344
12393
  F += "&";
12345
12394
  else {
12346
12395
  var T = w + this.iconv.decode(m.slice(y, k), "ascii").replace(/,/g, "/");
12347
12396
  F += this.iconv.decode(t.from(T, "base64"), "utf16-be");
12348
12397
  }
12349
- m[k] != u && k--, y = k + 1, S = !1, w = "";
12398
+ m[k] != u && k--, y = k + 1, x = !1, w = "";
12350
12399
  }
12351
- if (!S)
12400
+ if (!x)
12352
12401
  F += this.iconv.decode(m.slice(y), "ascii");
12353
12402
  else {
12354
12403
  var T = w + this.iconv.decode(m.slice(y), "ascii").replace(/,/g, "/"), R = T.length - T.length % 8;
12355
12404
  w = T.slice(R), T = T.slice(0, R), F += this.iconv.decode(t.from(T, "base64"), "utf16-be");
12356
12405
  }
12357
- return this.inBase64 = S, this.base64Accum = w, F;
12406
+ return this.inBase64 = x, this.base64Accum = w, F;
12358
12407
  }, g.prototype.end = function() {
12359
12408
  var m = "";
12360
12409
  return this.inBase64 && this.base64Accum.length > 0 && (m = this.iconv.decode(t.from(this.base64Accum, "base64"), "utf16-be")), this.inBase64 = !1, this.base64Accum = "", m;
@@ -13019,18 +13068,18 @@ function Jh() {
13019
13068
  throw new Error("DBCS codec is called without the data.");
13020
13069
  if (!p.table)
13021
13070
  throw new Error("Encoding '" + this.encodingName + "' has no data.");
13022
- var x = p.table();
13071
+ var S = p.table();
13023
13072
  this.decodeTables = [], this.decodeTables[0] = i.slice(0), this.decodeTableSeq = [];
13024
- for (var m = 0; m < x.length; m++)
13025
- this._addDecodeChunk(x[m]);
13073
+ for (var m = 0; m < S.length; m++)
13074
+ this._addDecodeChunk(S[m]);
13026
13075
  if (typeof p.gb18030 == "function") {
13027
13076
  this.gb18030 = p.gb18030();
13028
13077
  var F = this.decodeTables.length;
13029
13078
  this.decodeTables.push(i.slice(0));
13030
13079
  var y = this.decodeTables.length;
13031
13080
  this.decodeTables.push(i.slice(0));
13032
- for (var S = this.decodeTables[0], m = 129; m <= 254; m++)
13033
- for (var w = this.decodeTables[a - S[m]], k = 48; k <= 57; k++) {
13081
+ for (var x = this.decodeTables[0], m = 129; m <= 254; m++)
13082
+ for (var w = this.decodeTables[a - x[m]], k = 48; k <= 57; k++) {
13034
13083
  if (w[k] === e)
13035
13084
  w[k] = a - F;
13036
13085
  else if (w[k] > a)
@@ -13069,40 +13118,40 @@ function Jh() {
13069
13118
  for (var g = []; p > 0; p >>>= 8)
13070
13119
  g.push(p & 255);
13071
13120
  g.length == 0 && g.push(0);
13072
- for (var x = this.decodeTables[0], m = g.length - 1; m > 0; m--) {
13073
- var F = x[g[m]];
13121
+ for (var S = this.decodeTables[0], m = g.length - 1; m > 0; m--) {
13122
+ var F = S[g[m]];
13074
13123
  if (F == e)
13075
- x[g[m]] = a - this.decodeTables.length, this.decodeTables.push(x = i.slice(0));
13124
+ S[g[m]] = a - this.decodeTables.length, this.decodeTables.push(S = i.slice(0));
13076
13125
  else if (F <= a)
13077
- x = this.decodeTables[a - F];
13126
+ S = this.decodeTables[a - F];
13078
13127
  else
13079
13128
  throw new Error("Overwrite byte in " + this.encodingName + ", addr: " + p.toString(16));
13080
13129
  }
13081
- return x;
13130
+ return S;
13082
13131
  }, c.prototype._addDecodeChunk = function(p) {
13083
- var g = parseInt(p[0], 16), x = this._getDecodeTrieNode(g);
13132
+ var g = parseInt(p[0], 16), S = this._getDecodeTrieNode(g);
13084
13133
  g = g & 255;
13085
13134
  for (var m = 1; m < p.length; m++) {
13086
13135
  var F = p[m];
13087
13136
  if (typeof F == "string")
13088
13137
  for (var y = 0; y < F.length; ) {
13089
- var S = F.charCodeAt(y++);
13090
- if (S >= 55296 && S < 56320) {
13138
+ var x = F.charCodeAt(y++);
13139
+ if (x >= 55296 && x < 56320) {
13091
13140
  var w = F.charCodeAt(y++);
13092
13141
  if (w >= 56320 && w < 57344)
13093
- x[g++] = 65536 + (S - 55296) * 1024 + (w - 56320);
13142
+ S[g++] = 65536 + (x - 55296) * 1024 + (w - 56320);
13094
13143
  else
13095
13144
  throw new Error("Incorrect surrogate pair in " + this.encodingName + " at chunk " + p[0]);
13096
- } else if (S > 4080 && S <= 4095) {
13097
- for (var k = 4095 - S + 2, T = [], R = 0; R < k; R++)
13145
+ } else if (x > 4080 && x <= 4095) {
13146
+ for (var k = 4095 - x + 2, T = [], R = 0; R < k; R++)
13098
13147
  T.push(F.charCodeAt(y++));
13099
- x[g++] = n - this.decodeTableSeq.length, this.decodeTableSeq.push(T);
13148
+ S[g++] = n - this.decodeTableSeq.length, this.decodeTableSeq.push(T);
13100
13149
  } else
13101
- x[g++] = S;
13150
+ S[g++] = x;
13102
13151
  }
13103
13152
  else if (typeof F == "number")
13104
- for (var L = x[g - 1] + 1, y = 0; y < F; y++)
13105
- x[g++] = L++;
13153
+ for (var L = S[g - 1] + 1, y = 0; y < F; y++)
13154
+ S[g++] = L++;
13106
13155
  else
13107
13156
  throw new Error("Incorrect type '" + typeof F + "' given in " + this.encodingName + " at chunk " + p[0]);
13108
13157
  }
@@ -13112,27 +13161,27 @@ function Jh() {
13112
13161
  var g = p >> 8;
13113
13162
  return this.encodeTable[g] === void 0 && (this.encodeTable[g] = i.slice(0)), this.encodeTable[g];
13114
13163
  }, c.prototype._setEncodeChar = function(p, g) {
13115
- var x = this._getEncodeBucket(p), m = p & 255;
13116
- x[m] <= n ? this.encodeTableSeq[n - x[m]][s] = g : x[m] == e && (x[m] = g);
13164
+ var S = this._getEncodeBucket(p), m = p & 255;
13165
+ S[m] <= n ? this.encodeTableSeq[n - S[m]][s] = g : S[m] == e && (S[m] = g);
13117
13166
  }, c.prototype._setEncodeSequence = function(p, g) {
13118
- var x = p[0], m = this._getEncodeBucket(x), F = x & 255, y;
13167
+ var S = p[0], m = this._getEncodeBucket(S), F = S & 255, y;
13119
13168
  m[F] <= n ? y = this.encodeTableSeq[n - m[F]] : (y = {}, m[F] !== e && (y[s] = m[F]), m[F] = n - this.encodeTableSeq.length, this.encodeTableSeq.push(y));
13120
- for (var S = 1; S < p.length - 1; S++) {
13121
- var w = y[x];
13122
- typeof w == "object" ? y = w : (y = y[x] = {}, w !== void 0 && (y[s] = w));
13169
+ for (var x = 1; x < p.length - 1; x++) {
13170
+ var w = y[S];
13171
+ typeof w == "object" ? y = w : (y = y[S] = {}, w !== void 0 && (y[s] = w));
13123
13172
  }
13124
- x = p[p.length - 1], y[x] = g;
13125
- }, c.prototype._fillEncodeTable = function(p, g, x) {
13126
- for (var m = this.decodeTables[p], F = !1, y = {}, S = 0; S < 256; S++) {
13127
- var w = m[S], k = g + S;
13128
- if (!x[k])
13173
+ S = p[p.length - 1], y[S] = g;
13174
+ }, c.prototype._fillEncodeTable = function(p, g, S) {
13175
+ for (var m = this.decodeTables[p], F = !1, y = {}, x = 0; x < 256; x++) {
13176
+ var w = m[x], k = g + x;
13177
+ if (!S[k])
13129
13178
  if (w >= 0)
13130
13179
  this._setEncodeChar(w, k), F = !0;
13131
13180
  else if (w <= a) {
13132
13181
  var T = a - w;
13133
13182
  if (!y[T]) {
13134
13183
  var R = k << 8 >>> 0;
13135
- this._fillEncodeTable(T, R, x) ? F = !0 : y[T] = !0;
13184
+ this._fillEncodeTable(T, R, S) ? F = !0 : y[T] = !0;
13136
13185
  }
13137
13186
  } else w <= n && (this._setEncodeSequence(this.decodeTableSeq[n - w], k), F = !0);
13138
13187
  }
@@ -13142,7 +13191,7 @@ function Jh() {
13142
13191
  this.leadSurrogate = -1, this.seqObj = void 0, this.encodeTable = g.encodeTable, this.encodeTableSeq = g.encodeTableSeq, this.defaultCharSingleByte = g.defCharSB, this.gb18030 = g.gb18030;
13143
13192
  }
13144
13193
  u.prototype.write = function(p) {
13145
- for (var g = t.alloc(p.length * (this.gb18030 ? 4 : 3)), x = this.leadSurrogate, m = this.seqObj, F = -1, y = 0, S = 0; ; ) {
13194
+ for (var g = t.alloc(p.length * (this.gb18030 ? 4 : 3)), S = this.leadSurrogate, m = this.seqObj, F = -1, y = 0, x = 0; ; ) {
13146
13195
  if (F === -1) {
13147
13196
  if (y == p.length) break;
13148
13197
  var w = p.charCodeAt(y++);
@@ -13152,14 +13201,14 @@ function Jh() {
13152
13201
  }
13153
13202
  if (w >= 55296 && w < 57344)
13154
13203
  if (w < 56320)
13155
- if (x === -1) {
13156
- x = w;
13204
+ if (S === -1) {
13205
+ S = w;
13157
13206
  continue;
13158
13207
  } else
13159
- x = w, w = e;
13208
+ S = w, w = e;
13160
13209
  else
13161
- x !== -1 ? (w = 65536 + (x - 55296) * 1024 + (w - 56320), x = -1) : w = e;
13162
- else x !== -1 && (F = w, w = e, x = -1);
13210
+ S !== -1 ? (w = 65536 + (S - 55296) * 1024 + (w - 56320), S = -1) : w = e;
13211
+ else S !== -1 && (F = w, w = e, S = -1);
13163
13212
  var k = e;
13164
13213
  if (m !== void 0 && w != e) {
13165
13214
  var T = m[w];
@@ -13178,20 +13227,20 @@ function Jh() {
13178
13227
  var L = d(this.gb18030.uChars, w);
13179
13228
  if (L != -1) {
13180
13229
  var k = this.gb18030.gbChars[L] + (w - this.gb18030.uChars[L]);
13181
- g[S++] = 129 + Math.floor(k / 12600), k = k % 12600, g[S++] = 48 + Math.floor(k / 1260), k = k % 1260, g[S++] = 129 + Math.floor(k / 10), k = k % 10, g[S++] = 48 + k;
13230
+ g[x++] = 129 + Math.floor(k / 12600), k = k % 12600, g[x++] = 48 + Math.floor(k / 1260), k = k % 1260, g[x++] = 129 + Math.floor(k / 10), k = k % 10, g[x++] = 48 + k;
13182
13231
  continue;
13183
13232
  }
13184
13233
  }
13185
13234
  }
13186
- k === e && (k = this.defaultCharSingleByte), k < 256 ? g[S++] = k : k < 65536 ? (g[S++] = k >> 8, g[S++] = k & 255) : k < 16777216 ? (g[S++] = k >> 16, g[S++] = k >> 8 & 255, g[S++] = k & 255) : (g[S++] = k >>> 24, g[S++] = k >>> 16 & 255, g[S++] = k >>> 8 & 255, g[S++] = k & 255);
13235
+ k === e && (k = this.defaultCharSingleByte), k < 256 ? g[x++] = k : k < 65536 ? (g[x++] = k >> 8, g[x++] = k & 255) : k < 16777216 ? (g[x++] = k >> 16, g[x++] = k >> 8 & 255, g[x++] = k & 255) : (g[x++] = k >>> 24, g[x++] = k >>> 16 & 255, g[x++] = k >>> 8 & 255, g[x++] = k & 255);
13187
13236
  }
13188
- return this.seqObj = m, this.leadSurrogate = x, g.slice(0, S);
13237
+ return this.seqObj = m, this.leadSurrogate = S, g.slice(0, x);
13189
13238
  }, u.prototype.end = function() {
13190
13239
  if (!(this.leadSurrogate === -1 && this.seqObj === void 0)) {
13191
13240
  var p = t.alloc(10), g = 0;
13192
13241
  if (this.seqObj) {
13193
- var x = this.seqObj[s];
13194
- x !== void 0 && (x < 256 ? p[g++] = x : (p[g++] = x >> 8, p[g++] = x & 255)), this.seqObj = void 0;
13242
+ var S = this.seqObj[s];
13243
+ S !== void 0 && (S < 256 ? p[g++] = S : (p[g++] = S >> 8, p[g++] = S & 255)), this.seqObj = void 0;
13195
13244
  }
13196
13245
  return this.leadSurrogate !== -1 && (p[g++] = this.defaultCharSingleByte, this.leadSurrogate = -1), p.slice(0, g);
13197
13246
  }
@@ -13200,34 +13249,34 @@ function Jh() {
13200
13249
  this.nodeIdx = 0, this.prevBytes = [], this.decodeTables = g.decodeTables, this.decodeTableSeq = g.decodeTableSeq, this.defaultCharUnicode = g.defaultCharUnicode, this.gb18030 = g.gb18030;
13201
13250
  }
13202
13251
  h.prototype.write = function(p) {
13203
- for (var g = t.alloc(p.length * 2), x = this.nodeIdx, m = this.prevBytes, F = this.prevBytes.length, y = -this.prevBytes.length, S, w = 0, k = 0; w < p.length; w++) {
13204
- var T = w >= 0 ? p[w] : m[w + F], S = this.decodeTables[x][T];
13205
- if (!(S >= 0)) if (S === e)
13206
- S = this.defaultCharUnicode.charCodeAt(0), w = y;
13207
- else if (S === r) {
13252
+ for (var g = t.alloc(p.length * 2), S = this.nodeIdx, m = this.prevBytes, F = this.prevBytes.length, y = -this.prevBytes.length, x, w = 0, k = 0; w < p.length; w++) {
13253
+ var T = w >= 0 ? p[w] : m[w + F], x = this.decodeTables[S][T];
13254
+ if (!(x >= 0)) if (x === e)
13255
+ x = this.defaultCharUnicode.charCodeAt(0), w = y;
13256
+ else if (x === r) {
13208
13257
  if (w >= 3)
13209
13258
  var R = (p[w - 3] - 129) * 12600 + (p[w - 2] - 48) * 1260 + (p[w - 1] - 129) * 10 + (T - 48);
13210
13259
  else
13211
13260
  var R = (m[w - 3 + F] - 129) * 12600 + ((w - 2 >= 0 ? p[w - 2] : m[w - 2 + F]) - 48) * 1260 + ((w - 1 >= 0 ? p[w - 1] : m[w - 1 + F]) - 129) * 10 + (T - 48);
13212
13261
  var L = d(this.gb18030.gbChars, R);
13213
- S = this.gb18030.uChars[L] + R - this.gb18030.gbChars[L];
13214
- } else if (S <= a) {
13215
- x = a - S;
13262
+ x = this.gb18030.uChars[L] + R - this.gb18030.gbChars[L];
13263
+ } else if (x <= a) {
13264
+ S = a - x;
13216
13265
  continue;
13217
- } else if (S <= n) {
13218
- for (var B = this.decodeTableSeq[n - S], H = 0; H < B.length - 1; H++)
13219
- S = B[H], g[k++] = S & 255, g[k++] = S >> 8;
13220
- S = B[B.length - 1];
13266
+ } else if (x <= n) {
13267
+ for (var B = this.decodeTableSeq[n - x], H = 0; H < B.length - 1; H++)
13268
+ x = B[H], g[k++] = x & 255, g[k++] = x >> 8;
13269
+ x = B[B.length - 1];
13221
13270
  } else
13222
- throw new Error("iconv-lite internal error: invalid decoding table value " + S + " at " + x + "/" + T);
13223
- if (S >= 65536) {
13224
- S -= 65536;
13225
- var q = 55296 | S >> 10;
13226
- g[k++] = q & 255, g[k++] = q >> 8, S = 56320 | S & 1023;
13271
+ throw new Error("iconv-lite internal error: invalid decoding table value " + x + " at " + S + "/" + T);
13272
+ if (x >= 65536) {
13273
+ x -= 65536;
13274
+ var q = 55296 | x >> 10;
13275
+ g[k++] = q & 255, g[k++] = q >> 8, x = 56320 | x & 1023;
13227
13276
  }
13228
- g[k++] = S & 255, g[k++] = S >> 8, x = 0, y = w + 1;
13277
+ g[k++] = x & 255, g[k++] = x >> 8, S = 0, y = w + 1;
13229
13278
  }
13230
- return this.nodeIdx = x, this.prevBytes = y >= 0 ? Array.prototype.slice.call(p, y) : m.slice(y + F).concat(Array.prototype.slice.call(p)), g.slice(0, k).toString("ucs2");
13279
+ return this.nodeIdx = S, this.prevBytes = y >= 0 ? Array.prototype.slice.call(p, y) : m.slice(y + F).concat(Array.prototype.slice.call(p)), g.slice(0, k).toString("ucs2");
13231
13280
  }, h.prototype.end = function() {
13232
13281
  for (var p = ""; this.prevBytes.length > 0; ) {
13233
13282
  p += this.defaultCharUnicode;
@@ -13239,11 +13288,11 @@ function Jh() {
13239
13288
  function d(p, g) {
13240
13289
  if (p[0] > g)
13241
13290
  return -1;
13242
- for (var x = 0, m = p.length; x < m - 1; ) {
13243
- var F = x + (m - x + 1 >> 1);
13244
- p[F] <= g ? x = F : m = F;
13291
+ for (var S = 0, m = p.length; S < m - 1; ) {
13292
+ var F = S + (m - S + 1 >> 1);
13293
+ p[F] <= g ? S = F : m = F;
13245
13294
  }
13246
- return x;
13295
+ return S;
13247
13296
  }
13248
13297
  return Fr;
13249
13298
  }
@@ -22086,7 +22135,7 @@ class ze {
22086
22135
  }
22087
22136
  class Le {
22088
22137
  constructor() {
22089
- this.fontMapping = {}, this.fontMap = /* @__PURE__ */ new Map(), this.unsupportedChars = {}, this.missedFonts = {}, this.enableFontCache = !0, this.defaultFont = "simkai", this.events = {
22138
+ this.fontMapping = {}, this.loadedFontMap = /* @__PURE__ */ new Map(), this.unsupportedChars = {}, this.missedFonts = {}, this.enableFontCache = !0, this.defaultFont = "simkai", this.events = {
22090
22139
  /** Event triggered when a font cannot be found */
22091
22140
  fontNotFound: new mn(),
22092
22141
  /** Event triggered when a font is successfully loaded */
@@ -22137,7 +22186,7 @@ class Le {
22137
22186
  * @returns True if the default font was loaded. False otherwise.
22138
22187
  */
22139
22188
  isDefaultFontLoaded() {
22140
- return this.fontMap.get(this.defaultFont.toLowerCase()) != null;
22189
+ return this.loadedFontMap.get(this.defaultFont.toLowerCase()) != null;
22141
22190
  }
22142
22191
  /**
22143
22192
  * Loads the default font
@@ -22182,11 +22231,11 @@ class Le {
22182
22231
  * @returns The original font name if found, or the replacement font name if not found
22183
22232
  */
22184
22233
  findAndReplaceFont(e) {
22185
- let r = this.fontMap.get(e.toLowerCase());
22234
+ let r = this.loadedFontMap.get(e.toLowerCase());
22186
22235
  if (r == null) {
22187
22236
  const n = this.fontMapping[e];
22188
22237
  if (n)
22189
- return r = this.fontMap.get(n.toLowerCase()), n;
22238
+ return r = this.loadedFontMap.get(n.toLowerCase()), n;
22190
22239
  }
22191
22240
  return r ? e : this.defaultFont;
22192
22241
  }
@@ -22198,10 +22247,10 @@ class Le {
22198
22247
  * @returns The font with the specified font name, or undefined if not found
22199
22248
  */
22200
22249
  getFontByName(e, r = !0) {
22201
- if (this.fontMap.size === 0)
22250
+ if (this.loadedFontMap.size === 0)
22202
22251
  return;
22203
22252
  e == null && (e = "");
22204
- const n = this.fontMap.get(e.toLowerCase());
22253
+ const n = this.loadedFontMap.get(e.toLowerCase());
22205
22254
  if (!n) {
22206
22255
  r && this.recordMissedFonts(e);
22207
22256
  return;
@@ -22214,7 +22263,7 @@ class Le {
22214
22263
  * @returns The text shape for the character, or undefined if not found
22215
22264
  */
22216
22265
  getFontByChar(e) {
22217
- for (const [, r] of this.fontMap)
22266
+ for (const [, r] of this.loadedFontMap)
22218
22267
  if (r.hasChar(e))
22219
22268
  return r;
22220
22269
  }
@@ -22235,7 +22284,7 @@ class Le {
22235
22284
  * @returns The scale factor for the font, or 1 if the font is not found
22236
22285
  */
22237
22286
  getFontScaleFactor(e) {
22238
- const r = this.fontMap.get(e.toLowerCase());
22287
+ const r = this.loadedFontMap.get(e.toLowerCase());
22239
22288
  return r ? r.getScaleFactor() : 1;
22240
22289
  }
22241
22290
  /**
@@ -22244,7 +22293,7 @@ class Le {
22244
22293
  * @returns The type of the font. If the specified font can't be found, `undefined` is returned
22245
22294
  */
22246
22295
  getFontType(e) {
22247
- const r = this.fontMap.get(e.toLowerCase());
22296
+ const r = this.loadedFontMap.get(e.toLowerCase());
22248
22297
  return r == null ? void 0 : r.type;
22249
22298
  }
22250
22299
  /**
@@ -22253,7 +22302,7 @@ class Le {
22253
22302
  * @returns The shape for the not found indicator, or undefined if not available
22254
22303
  */
22255
22304
  getNotFoundTextShape(e) {
22256
- for (const [, r] of this.fontMap) {
22305
+ for (const [, r] of this.loadedFontMap) {
22257
22306
  const n = r.getNotFoundTextShape(e);
22258
22307
  if (n) return n;
22259
22308
  }
@@ -22264,7 +22313,7 @@ class Le {
22264
22313
  * @returns True if the font is loaded, false otherwise
22265
22314
  */
22266
22315
  isFontLoaded(e) {
22267
- return this.fontMap.has(e.toLowerCase());
22316
+ return this.loadedFontMap.has(e.toLowerCase());
22268
22317
  }
22269
22318
  /**
22270
22319
  * Records a font that was requested but not found
@@ -22289,12 +22338,12 @@ class Le {
22289
22338
  const i = await gt.instance.get(a);
22290
22339
  if (i) {
22291
22340
  const s = ze.instance.createFont(i);
22292
- this.fontMap.set(a, s);
22341
+ this.loadedFontMap.set(a, s);
22293
22342
  } else {
22294
22343
  const s = await this.loader.loadAsync(e.url);
22295
22344
  n.data = s;
22296
22345
  const o = ze.instance.createFont(n);
22297
- o && (e.name.forEach((c) => o.names.add(c)), this.fontMap.set(a, o), this.enableFontCache && await gt.instance.set(a, n));
22346
+ o && (e.name.forEach((c) => o.names.add(c)), this.loadedFontMap.set(a, o), this.enableFontCache && await gt.instance.set(a, n));
22298
22347
  }
22299
22348
  this.events.fontLoaded.dispatch({
22300
22349
  fontName: a
@@ -22313,7 +22362,7 @@ class Le {
22313
22362
  * Loads all fonts from the cache
22314
22363
  */
22315
22364
  async getAllFontsFromCache() {
22316
- if (this.fontMap.size !== 0)
22365
+ if (this.loadedFontMap.size !== 0)
22317
22366
  return;
22318
22367
  const e = await gt.instance.getAll();
22319
22368
  for (const r of e) {
@@ -22321,7 +22370,7 @@ class Le {
22321
22370
  if (this.fileNames && !this.fileNames.includes(n))
22322
22371
  continue;
22323
22372
  const a = ze.instance.createFont(r);
22324
- this.fontMap.set(n, a);
22373
+ this.loadedFontMap.set(n, a);
22325
22374
  }
22326
22375
  }
22327
22376
  /**
@@ -22329,7 +22378,7 @@ class Le {
22329
22378
  * @returns A record mapping unsupported characters to their occurrence count
22330
22379
  */
22331
22380
  getUnsupportedChar() {
22332
- for (const [, e] of this.fontMap)
22381
+ for (const [, e] of this.loadedFontMap)
22333
22382
  Object.assign(this.unsupportedChars, e.unsupportedChars);
22334
22383
  return this.unsupportedChars;
22335
22384
  }
@@ -22346,7 +22395,7 @@ class Le {
22346
22395
  * @returns `true` if the operation succeeded (all fonts released or the specified font was found and deleted), `false` if the specified font was not found.
22347
22396
  */
22348
22397
  release(e) {
22349
- return e == null ? (this.fontMap.clear(), !0) : this.fontMap.delete(e);
22398
+ return e == null ? (this.loadedFontMap.clear(), !0) : this.loadedFontMap.delete(e);
22350
22399
  }
22351
22400
  }
22352
22401
  class vl {
@@ -23793,49 +23842,49 @@ class Tl {
23793
23842
  this._hOffset = o, this._currentContext.charTrackingFactor = { value: 1, isRelative: !1 };
23794
23843
  let p = 0;
23795
23844
  for (let y = 0; y < a.length; y++) {
23796
- const S = this.getCharShape(a[y]);
23797
- S && (p += S.width * this.currentWidthFactor);
23845
+ const x = this.getCharShape(a[y]);
23846
+ x && (p += x.width * this.currentWidthFactor);
23798
23847
  }
23799
23848
  this._hOffset = o;
23800
23849
  let g = 0;
23801
23850
  for (let y = 0; y < i.length; y++) {
23802
- const S = this.getCharShape(i[y]);
23803
- S && (g += S.width * this.currentWidthFactor);
23851
+ const x = this.getCharShape(i[y]);
23852
+ x && (g += x.width * this.currentWidthFactor);
23804
23853
  }
23805
- const x = Math.max(p, g), m = (x - p) / 2, F = (x - g) / 2;
23854
+ const S = Math.max(p, g), m = (S - p) / 2, F = (S - g) / 2;
23806
23855
  if (s === "^") {
23807
23856
  if (this._currentContext.fontSizeScaleFactor = d * 0.7, this.calcuateLineParams(), a && !i) {
23808
- const y = [], S = [];
23857
+ const y = [], x = [];
23809
23858
  this._hOffset = o, this._vOffset = c + h * 0.1;
23810
23859
  for (let w = 0; w < a.length; w++)
23811
23860
  this.processChar(
23812
23861
  a[w],
23813
23862
  y,
23814
- S
23863
+ x
23815
23864
  );
23816
- r.push(...y), n.push(...S), this._hOffset = o + p;
23865
+ r.push(...y), n.push(...x), this._hOffset = o + p;
23817
23866
  } else if (!a && i) {
23818
- const y = [], S = [];
23867
+ const y = [], x = [];
23819
23868
  this._hOffset = o, this._vOffset = c - h * 0.6;
23820
23869
  for (let w = 0; w < i.length; w++)
23821
23870
  this.processChar(
23822
23871
  i[w],
23823
23872
  y,
23824
- S
23873
+ x
23825
23874
  );
23826
- r.push(...y), n.push(...S), this._hOffset = o + g;
23875
+ r.push(...y), n.push(...x), this._hOffset = o + g;
23827
23876
  }
23828
23877
  this._currentContext.fontSizeScaleFactor = d, this.calcuateLineParams();
23829
23878
  } else {
23830
- const y = [], S = [];
23879
+ const y = [], x = [];
23831
23880
  this._hOffset = o + m, this._vOffset = c + this.currentFontSize * 0.3;
23832
23881
  for (let T = 0; T < a.length; T++)
23833
23882
  this.processChar(
23834
23883
  a[T],
23835
23884
  y,
23836
- S
23885
+ x
23837
23886
  );
23838
- r.push(...y), n.push(...S);
23887
+ r.push(...y), n.push(...x);
23839
23888
  const w = [], k = [];
23840
23889
  this._hOffset = o + F, this._vOffset = c - this.currentFontSize * 0.6;
23841
23890
  for (let T = 0; T < i.length; T++)
@@ -23849,7 +23898,7 @@ class Tl {
23849
23898
  o,
23850
23899
  c - this.currentFontSize * 0.8,
23851
23900
  0,
23852
- o + x,
23901
+ o + S,
23853
23902
  c - this.currentFontSize * 0.8,
23854
23903
  0
23855
23904
  ]);
@@ -23858,7 +23907,7 @@ class Tl {
23858
23907
  new N.BufferAttribute(R, 3)
23859
23908
  ), T.setIndex(null), n.push(T);
23860
23909
  }
23861
- this._hOffset = o + x;
23910
+ this._hOffset = o + S;
23862
23911
  }
23863
23912
  this._vOffset = c, this._currentContext.charTrackingFactor = {
23864
23913
  value: u,
@@ -23878,10 +23927,10 @@ class Tl {
23878
23927
  i.scale(this.currentWidthFactor, 1, 1);
23879
23928
  let s = this._currentContext.oblique;
23880
23929
  if (this._currentContext.italic && (s += 15), s) {
23881
- const x = s * Math.PI / 180, m = new N.Matrix4();
23930
+ const S = s * Math.PI / 180, m = new N.Matrix4();
23882
23931
  m.set(
23883
23932
  1,
23884
- Math.tan(x),
23933
+ Math.tan(S),
23885
23934
  0,
23886
23935
  0,
23887
23936
  0,
@@ -23904,8 +23953,8 @@ class Tl {
23904
23953
  i.translate(c, u, 0), this.currentHorizontalAlignment == Se.DISTRIBUTED ? this._hOffset += a.width * this.currentWidthFactor : this._hOffset += a.width * this.currentWordSpace * this.currentWidthFactor, r.push(i);
23905
23954
  const p = d * 0.05, g = 1e-3;
23906
23955
  if (this._currentContext.underline) {
23907
- const x = new N.BufferGeometry(), m = u - p;
23908
- x.setAttribute(
23956
+ const S = new N.BufferGeometry(), m = u - p;
23957
+ S.setAttribute(
23909
23958
  "position",
23910
23959
  new N.BufferAttribute(
23911
23960
  new Float32Array([
@@ -23918,11 +23967,11 @@ class Tl {
23918
23967
  ]),
23919
23968
  3
23920
23969
  )
23921
- ), x.setIndex(null), n.push(x);
23970
+ ), S.setIndex(null), n.push(S);
23922
23971
  }
23923
23972
  if (this._currentContext.overline) {
23924
- const x = new N.BufferGeometry(), m = u + d + p;
23925
- x.setAttribute(
23973
+ const S = new N.BufferGeometry(), m = u + d + p;
23974
+ S.setAttribute(
23926
23975
  "position",
23927
23976
  new N.BufferAttribute(
23928
23977
  new Float32Array([
@@ -23935,11 +23984,11 @@ class Tl {
23935
23984
  ]),
23936
23985
  3
23937
23986
  )
23938
- ), x.setIndex(null), n.push(x);
23987
+ ), S.setIndex(null), n.push(S);
23939
23988
  }
23940
23989
  if (this._currentContext.strikeThrough) {
23941
- const x = new N.BufferGeometry(), m = u + d / 2 - d * 0.2;
23942
- x.setAttribute(
23990
+ const S = new N.BufferGeometry(), m = u + d / 2 - d * 0.2;
23991
+ S.setAttribute(
23943
23992
  "position",
23944
23993
  new N.BufferAttribute(
23945
23994
  new Float32Array([
@@ -23952,7 +24001,7 @@ class Tl {
23952
24001
  ]),
23953
24002
  3
23954
24003
  )
23955
- ), x.setIndex(null), n.push(x);
24004
+ ), S.setIndex(null), n.push(S);
23956
24005
  }
23957
24006
  }
23958
24007
  processLastLine() {
@@ -24392,7 +24441,7 @@ class El {
24392
24441
  this.isInitialized = !1;
24393
24442
  }
24394
24443
  async ensureInitialized() {
24395
- this.isInitialized || (await this.loadFonts([Le.instance.defaultFont]), this.isInitialized = !0), await this.ensureTasksFinished();
24444
+ this.isInitialized || (await this.loadFonts([Le.instance.defaultFont]), this.isInitialized = !0);
24396
24445
  }
24397
24446
  /**
24398
24447
  * Handles messages coming from any worker.
@@ -24667,7 +24716,7 @@ class Cl {
24667
24716
  this.isInitialized || (await this.loadFonts([Le.instance.defaultFont]), this.isInitialized = !0);
24668
24717
  }
24669
24718
  }
24670
- class Ol {
24719
+ class Bl {
24671
24720
  /**
24672
24721
  * Constructor
24673
24722
  *
@@ -24757,6 +24806,6 @@ export {
24757
24806
  Ft as MTextFlowDirection,
24758
24807
  Cl as MainThreadRenderer,
24759
24808
  Li as StyleManager,
24760
- Ol as UnifiedRenderer,
24809
+ Bl as UnifiedRenderer,
24761
24810
  El as WebWorkerRenderer
24762
24811
  };