@mlightcad/cad-simple-viewer 1.7.2 → 1.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/dist/cad-simple-viewer.js +4665 -4424
  2. package/dist/cad-simple-viewer.umd.cjs +72 -72
  3. package/dist/mtext-renderer-worker.js +260 -256
  4. package/lib/command/AcApZoomCmd.d.ts +26 -0
  5. package/lib/command/AcApZoomCmd.d.ts.map +1 -1
  6. package/lib/command/AcApZoomCmd.js +69 -3
  7. package/lib/command/AcApZoomCmd.js.map +1 -1
  8. package/lib/editor/view/AcEdBaseView.d.ts +9 -0
  9. package/lib/editor/view/AcEdBaseView.d.ts.map +1 -1
  10. package/lib/editor/view/AcEdBaseView.js.map +1 -1
  11. package/lib/i18n/ar/jig.d.ts +10 -0
  12. package/lib/i18n/ar/jig.d.ts.map +1 -1
  13. package/lib/i18n/ar/jig.js +10 -2
  14. package/lib/i18n/ar/jig.js.map +1 -1
  15. package/lib/i18n/cs/jig.d.ts +10 -0
  16. package/lib/i18n/cs/jig.d.ts.map +1 -1
  17. package/lib/i18n/cs/jig.js +13 -3
  18. package/lib/i18n/cs/jig.js.map +1 -1
  19. package/lib/i18n/en/jig.d.ts +10 -0
  20. package/lib/i18n/en/jig.d.ts.map +1 -1
  21. package/lib/i18n/en/jig.js +13 -3
  22. package/lib/i18n/en/jig.js.map +1 -1
  23. package/lib/i18n/tr/jig.d.ts +10 -0
  24. package/lib/i18n/tr/jig.d.ts.map +1 -1
  25. package/lib/i18n/tr/jig.js +13 -3
  26. package/lib/i18n/tr/jig.js.map +1 -1
  27. package/lib/i18n/zh/jig.d.ts +10 -0
  28. package/lib/i18n/zh/jig.d.ts.map +1 -1
  29. package/lib/i18n/zh/jig.js +13 -3
  30. package/lib/i18n/zh/jig.js.map +1 -1
  31. package/lib/spatialIndex/AcTrHierarchicalSpatialIndex.d.ts.map +1 -1
  32. package/lib/spatialIndex/AcTrHierarchicalSpatialIndex.js +6 -3
  33. package/lib/spatialIndex/AcTrHierarchicalSpatialIndex.js.map +1 -1
  34. package/lib/view/AcTrExtentCluster.d.ts +30 -0
  35. package/lib/view/AcTrExtentCluster.d.ts.map +1 -0
  36. package/lib/view/AcTrExtentCluster.js +133 -0
  37. package/lib/view/AcTrExtentCluster.js.map +1 -0
  38. package/lib/view/AcTrIntelligentExtents.d.ts +22 -0
  39. package/lib/view/AcTrIntelligentExtents.d.ts.map +1 -0
  40. package/lib/view/AcTrIntelligentExtents.js +91 -0
  41. package/lib/view/AcTrIntelligentExtents.js.map +1 -0
  42. package/lib/view/AcTrLayout.d.ts +10 -1
  43. package/lib/view/AcTrLayout.d.ts.map +1 -1
  44. package/lib/view/AcTrLayout.js +11 -0
  45. package/lib/view/AcTrLayout.js.map +1 -1
  46. package/lib/view/AcTrView2d.d.ts +8 -0
  47. package/lib/view/AcTrView2d.d.ts.map +1 -1
  48. package/lib/view/AcTrView2d.js +61 -13
  49. package/lib/view/AcTrView2d.js.map +1 -1
  50. package/lib/view/index.d.ts +2 -0
  51. package/lib/view/index.d.ts.map +1 -1
  52. package/lib/view/index.js +2 -0
  53. package/lib/view/index.js.map +1 -1
  54. package/package.json +8 -8
@@ -1,7 +1,7 @@
1
- var nt;
1
+ var J;
2
2
  (function(s) {
3
3
  s[s.NONE = 0] = "NONE", s[s.WORD = 1] = "WORD", s[s.STACK = 2] = "STACK", s[s.SPACE = 3] = "SPACE", s[s.NBSP = 4] = "NBSP", s[s.TABULATOR = 5] = "TABULATOR", s[s.NEW_PARAGRAPH = 6] = "NEW_PARAGRAPH", s[s.NEW_COLUMN = 7] = "NEW_COLUMN", s[s.WRAP_AT_DIMLINE = 8] = "WRAP_AT_DIMLINE", s[s.PROPERTIES_CHANGED = 9] = "PROPERTIES_CHANGED", s[s.PERCENT_SYMBOL = 10] = "PERCENT_SYMBOL";
4
- })(nt || (nt = {}));
4
+ })(J || (J = {}));
5
5
  var $e;
6
6
  (function(s) {
7
7
  s[s.BOTTOM = 0] = "BOTTOM", s[s.MIDDLE = 1] = "MIDDLE", s[s.TOP = 2] = "TOP";
@@ -280,7 +280,7 @@ class ou {
280
280
  }
281
281
  return h;
282
282
  };
283
- return [e, i] = a(), i && (n = o(i === "^")), e === "" && n.includes("I/") ? [nt.STACK, [" ", " ", "/"]] : i === "^" ? [nt.STACK, [e, n, "^"]] : [nt.STACK, [e, n, i]];
283
+ return [e, i] = a(), i && (n = o(i === "^")), e === "" && n.includes("I/") ? [J.STACK, [" ", " ", "/"]] : i === "^" ? [J.STACK, [e, n, "^"]] : [J.STACK, [e, n, i]];
284
284
  }
285
285
  /**
286
286
  * Parse MText properties
@@ -547,7 +547,7 @@ class ou {
547
547
  const e = new qi(this.extractExpression());
548
548
  let n = t.paragraph.indent, i = t.paragraph.left, r = t.paragraph.right, a = t.paragraph.align, o = [];
549
549
  const c = () => {
550
- const h = e.tail.match(/^[+-]?\d+(?:\.\d*)?(?:[eE][+-]?\d+)?/);
550
+ const h = e.tail.match(/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?/);
551
551
  if (h) {
552
552
  const l = parseFloat(h[0]);
553
553
  for (e.consume(h[0].length); e.peek() === ","; )
@@ -577,15 +577,16 @@ class ou {
577
577
  }
578
578
  case "t":
579
579
  for (o = []; e.hasData; ) {
580
- const l = e.peek();
581
- if (l === "r" || l === "c") {
580
+ const l = e.currentIndex, u = e.peek();
581
+ if (u === "r" || u === "c") {
582
582
  e.consume(1);
583
- const u = c();
584
- o.push(l + u.toString());
583
+ const f = e.currentIndex, p = c();
584
+ e.currentIndex !== f && o.push(u + p.toString());
585
585
  } else {
586
- const u = c();
587
- isNaN(u) ? e.consume(1) : o.push(u);
586
+ const f = c();
587
+ e.currentIndex !== l && o.push(f);
588
588
  }
589
+ e.currentIndex === l && e.consume(1);
589
590
  }
590
591
  break;
591
592
  }
@@ -614,184 +615,187 @@ class ou {
614
615
  * @yields MTextToken objects
615
616
  */
616
617
  *parse() {
617
- const t = nt.WORD, e = nt.SPACE;
618
+ const t = J.WORD, e = J.SPACE;
618
619
  let n = null, i;
619
- function r(o) {
620
- const c = { ...o.paragraph };
621
- o.paragraph = {
620
+ function r(c) {
621
+ const h = { ...c.paragraph };
622
+ c.paragraph = {
622
623
  indent: 0,
623
624
  left: 0,
624
625
  right: 0,
625
626
  align: ct.DEFAULT,
626
627
  tabs: []
627
628
  };
628
- const h = {};
629
- return c.indent !== 0 && (h.indent = 0), c.left !== 0 && (h.left = 0), c.right !== 0 && (h.right = 0), c.align !== ct.DEFAULT && (h.align = ct.DEFAULT), JSON.stringify(c.tabs) !== JSON.stringify([]) && (h.tabs = []), h;
629
+ const l = {};
630
+ return h.indent !== 0 && (l.indent = 0), h.left !== 0 && (l.left = 0), h.right !== 0 && (l.right = 0), h.align !== ct.DEFAULT && (l.align = ct.DEFAULT), JSON.stringify(h.tabs) !== JSON.stringify([]) && (l.tabs = []), l;
630
631
  }
631
632
  const a = () => {
632
- let o = "";
633
+ let c = "";
633
634
  for (; this.scanner.hasData; ) {
634
- let c = !1, h = this.scanner.peek();
635
- const l = this.scanner.currentIndex;
636
- if (h.charCodeAt(0) < 32) {
637
- if (this.scanner.consume(1), h === " ")
638
- return [nt.TABULATOR, null];
639
- if (h === `
640
- `)
641
- return [nt.NEW_PARAGRAPH, null];
642
- h = " ";
643
- }
644
- if (h === "\\")
635
+ let h = !1, l = this.scanner.peek();
636
+ const u = this.scanner.currentIndex;
637
+ if (l.charCodeAt(0) < 32)
638
+ return l === " " ? (this.scanner.consume(1), c ? (n = J.TABULATOR, i = null, [t, c]) : [J.TABULATOR, null]) : l === `
639
+ ` ? (this.scanner.consume(1), c ? (n = J.NEW_PARAGRAPH, i = null, [t, c]) : [J.NEW_PARAGRAPH, null]) : (this.scanner.consume(1), c ? (n = e, [t, c]) : [e, null]);
640
+ if (l === "\\")
645
641
  if ("\\{}".includes(this.scanner.peek(1)))
646
- c = !0, this.scanner.consume(1), h = this.scanner.peek();
642
+ h = !0, this.scanner.consume(1), l = this.scanner.peek();
647
643
  else {
648
- if (o)
649
- return [t, o];
644
+ if (c)
645
+ return [t, c];
650
646
  this.scanner.consume(1);
651
- const u = this.scanner.get();
652
- switch (u) {
647
+ const f = this.scanner.get();
648
+ switch (f) {
653
649
  case "~":
654
- return [nt.NBSP, null];
650
+ return [J.NBSP, null];
655
651
  case "P":
656
- return [nt.NEW_PARAGRAPH, null];
652
+ return [J.NEW_PARAGRAPH, null];
657
653
  case "N":
658
- return [nt.NEW_COLUMN, null];
654
+ return [J.NEW_COLUMN, null];
659
655
  case "X":
660
- return [nt.WRAP_AT_DIMLINE, null];
656
+ return [J.WRAP_AT_DIMLINE, null];
661
657
  case "S": {
662
658
  this.inStackContext = !0;
663
- const f = this.parseStacking();
664
- return this.inStackContext = !1, f;
659
+ const p = this.parseStacking();
660
+ return this.inStackContext = !1, p;
665
661
  }
666
662
  case "m":
667
663
  case "M":
668
664
  if (this.scanner.peek() === "+") {
669
665
  this.scanner.consume(1);
670
- const f = this.extractMifCode(this.mifCodeLength);
671
- if (f) {
672
- this.scanner.consume(f.length);
673
- const p = this.mifDecoder(f);
674
- return o ? [t, o] : [t, p];
666
+ const p = this.extractMifCode(this.mifCodeLength);
667
+ if (p) {
668
+ this.scanner.consume(p.length);
669
+ const d = this.mifDecoder(p);
670
+ return c ? [t, c] : [t, d];
675
671
  }
676
672
  this.scanner.consume(-1);
677
673
  }
678
- o += "\\M";
674
+ c += "\\M";
679
675
  continue;
680
676
  case "U": {
681
- const f = this.parseUnicodeEscape();
682
- if (f !== null)
683
- return o ? [t, o] : [t, f];
684
- o += "\\U";
677
+ const p = this.parseUnicodeEscape();
678
+ if (p !== null)
679
+ return c ? [t, c] : [t, p];
680
+ c += "\\U";
685
681
  continue;
686
682
  }
687
683
  default:
688
- if (u)
684
+ if (f)
689
685
  try {
690
- const f = this.parseProperties(u);
691
- if (this.yieldPropertyCommands && f)
692
- return [nt.PROPERTIES_CHANGED, f];
686
+ const p = this.parseProperties(f);
687
+ if (this.yieldPropertyCommands && p)
688
+ return [J.PROPERTIES_CHANGED, p];
693
689
  continue;
694
690
  } catch {
695
- const f = this.scanner.tail.slice(l, this.scanner.currentIndex);
696
- o += f;
691
+ const p = this.scanner.tail.slice(u, this.scanner.currentIndex);
692
+ c += p;
697
693
  }
698
694
  }
699
695
  continue;
700
696
  }
701
- if (h === "%" && this.scanner.peek(1) === "%") {
702
- const u = this.scanner.peek(2).toLowerCase(), f = Ql[u];
703
- if (f) {
697
+ if (l === "%" && this.scanner.peek(1) === "%") {
698
+ const f = this.scanner.peek(2).toLowerCase(), p = Ql[f];
699
+ if (p) {
704
700
  if (this.scanner.consume(3), this.yieldPercentSymbols) {
705
- const p = this.buildPercentSymbolData(u, f);
706
- if (p)
707
- return o ? (n = nt.PERCENT_SYMBOL, i = p, [t, o]) : [nt.PERCENT_SYMBOL, p];
701
+ const d = this.buildPercentSymbolData(f, p);
702
+ if (d)
703
+ return c ? (n = J.PERCENT_SYMBOL, i = d, [t, c]) : [J.PERCENT_SYMBOL, d];
708
704
  }
709
- o += f;
705
+ c += p;
710
706
  continue;
711
707
  } else {
712
- const p = [];
713
- for (let d = 0; d < 3; d++) {
714
- const g = this.scanner.peek(2 + d);
715
- if (g >= "0" && g <= "9")
716
- p.push(g);
708
+ const d = [];
709
+ for (let g = 0; g < 3; g++) {
710
+ const x = this.scanner.peek(2 + g);
711
+ if (x >= "0" && x <= "9")
712
+ d.push(x);
717
713
  else
718
714
  break;
719
715
  }
720
- if (p.length > 0) {
721
- const d = Number.parseInt(p.join(""), 10);
722
- if (this.scanner.consume(2 + p.length), this.yieldPercentSymbols) {
723
- const g = {
716
+ if (d.length > 0) {
717
+ const g = Number.parseInt(d.join(""), 10);
718
+ if (this.scanner.consume(2 + d.length), this.yieldPercentSymbols) {
719
+ const x = {
724
720
  kind: "numeric",
725
- charCode: d,
726
- char: String.fromCharCode(d)
721
+ charCode: g,
722
+ char: String.fromCharCode(g)
727
723
  };
728
- return o ? (n = nt.PERCENT_SYMBOL, i = g, [t, o]) : [nt.PERCENT_SYMBOL, g];
724
+ return c ? (n = J.PERCENT_SYMBOL, i = x, [t, c]) : [J.PERCENT_SYMBOL, x];
729
725
  }
730
- o += String.fromCharCode(d);
726
+ c += String.fromCharCode(g);
731
727
  } else
732
728
  this.scanner.consume(3);
733
729
  continue;
734
730
  }
735
731
  }
736
- if (h === " ")
737
- return o ? (this.scanner.consume(1), n = e, [t, o]) : (this.scanner.consume(1), [e, null]);
738
- if (!c) {
739
- if (h === "{") {
740
- if (o)
741
- return [t, o];
732
+ if (l === " ")
733
+ return c ? (this.scanner.consume(1), n = e, [t, c]) : (this.scanner.consume(1), [e, null]);
734
+ if (!h) {
735
+ if (l === "{") {
736
+ if (c)
737
+ return [t, c];
742
738
  this.scanner.consume(1), this.pushCtx();
743
739
  continue;
744
- } else if (h === "}") {
745
- if (o)
746
- return [t, o];
740
+ } else if (l === "}") {
741
+ if (c)
742
+ return [t, c];
747
743
  if (this.scanner.consume(1), this.yieldPropertyCommands) {
748
- const u = this.ctxStack.current;
744
+ const f = this.ctxStack.current;
749
745
  this.popCtx();
750
- const f = this.getPropertyChanges(u, this.ctxStack.current);
751
- if (Object.keys(f).length > 0)
746
+ const p = this.getPropertyChanges(f, this.ctxStack.current);
747
+ if (Object.keys(p).length > 0)
752
748
  return [
753
- nt.PROPERTIES_CHANGED,
754
- { command: void 0, changes: f, depth: this.ctxStack.depth }
749
+ J.PROPERTIES_CHANGED,
750
+ { command: void 0, changes: p, depth: this.ctxStack.depth }
755
751
  ];
756
752
  } else
757
753
  this.popCtx();
758
754
  continue;
759
755
  }
760
756
  }
761
- if (!this.inStackContext && h === "^") {
762
- const u = this.scanner.peek(1);
763
- if (u) {
764
- const f = u.charCodeAt(0);
765
- if (this.scanner.consume(2), f === 32)
766
- o += "^";
757
+ if (!this.inStackContext && l === "^") {
758
+ const f = this.scanner.peek(1);
759
+ if (f) {
760
+ const p = f.charCodeAt(0);
761
+ if (this.scanner.consume(2), p === 32)
762
+ c += "^";
767
763
  else {
768
- if (f === 73)
769
- return o ? [t, o] : [nt.TABULATOR, null];
770
- if (f === 74)
771
- return o ? [t, o] : [nt.NEW_PARAGRAPH, null];
772
- if (f === 77)
764
+ if (p === 73)
765
+ return c ? [t, c] : [J.TABULATOR, null];
766
+ if (p === 74)
767
+ return c ? [t, c] : [J.NEW_PARAGRAPH, null];
768
+ if (p === 77)
773
769
  continue;
774
- o += "▯";
770
+ c += "▯";
775
771
  }
776
772
  continue;
777
773
  }
778
774
  }
779
- this.scanner.consume(1), h.charCodeAt(0) >= 32 && (o += h);
775
+ this.scanner.consume(1), l.charCodeAt(0) >= 32 && (c += l);
780
776
  }
781
- return o ? [t, o] : [nt.NONE, null];
777
+ return c ? [t, c] : [J.NONE, null];
778
+ }, o = (c) => {
779
+ if (c !== J.NEW_PARAGRAPH || !this.resetParagraphParameters)
780
+ return;
781
+ const h = this.ctxStack.current, l = r(h);
782
+ if (this.yieldPropertyCommands && Object.keys(l).length > 0)
783
+ return new ji(J.PROPERTIES_CHANGED, h.copy(), {
784
+ command: void 0,
785
+ changes: { paragraph: l },
786
+ depth: this.ctxStack.depth
787
+ });
782
788
  };
783
789
  for (; ; ) {
784
- const [o, c] = a.call(this);
785
- if (o) {
786
- if (yield new ji(o, this.ctxStack.current.copy(), c), o === nt.NEW_PARAGRAPH && this.resetParagraphParameters) {
787
- const h = this.ctxStack.current, l = r(h);
788
- this.yieldPropertyCommands && Object.keys(l).length > 0 && (yield new ji(nt.PROPERTIES_CHANGED, h.copy(), {
789
- command: void 0,
790
- changes: { paragraph: l },
791
- depth: this.ctxStack.depth
792
- }));
790
+ const [c, h] = a.call(this);
791
+ if (c) {
792
+ yield new ji(c, this.ctxStack.current.copy(), h);
793
+ const l = o(c);
794
+ if (l && (yield l), n) {
795
+ yield new ji(n, this.ctxStack.current.copy(), i ?? null);
796
+ const u = o(n);
797
+ u && (yield u), n = null, i = void 0;
793
798
  }
794
- n && (yield new ji(n, this.ctxStack.current.copy(), i ?? null), n = null, i = void 0);
795
799
  } else
796
800
  break;
797
801
  }
@@ -3141,8 +3145,8 @@ class mt {
3141
3145
  return this.multiplyMatrices(t, this);
3142
3146
  }
3143
3147
  multiplyMatrices(t, e) {
3144
- const n = t.elements, i = e.elements, r = this.elements, a = n[0], o = n[4], c = n[8], h = n[12], l = n[1], u = n[5], f = n[9], p = n[13], d = n[2], g = n[6], x = n[10], b = n[14], S = n[3], v = n[7], w = n[11], T = n[15], M = i[0], O = i[4], B = i[8], V = i[12], D = i[1], q = i[5], K = i[9], U = i[13], R = i[2], N = i[6], rt = i[10], vt = i[14], Pt = i[3], Tt = i[7], ut = i[11], j = i[15];
3145
- return r[0] = a * M + o * D + c * R + h * Pt, r[4] = a * O + o * q + c * N + h * Tt, r[8] = a * B + o * K + c * rt + h * ut, r[12] = a * V + o * U + c * vt + h * j, r[1] = l * M + u * D + f * R + p * Pt, r[5] = l * O + u * q + f * N + p * Tt, r[9] = l * B + u * K + f * rt + p * ut, r[13] = l * V + u * U + f * vt + p * j, r[2] = d * M + g * D + x * R + b * Pt, r[6] = d * O + g * q + x * N + b * Tt, r[10] = d * B + g * K + x * rt + b * ut, r[14] = d * V + g * U + x * vt + b * j, r[3] = S * M + v * D + w * R + T * Pt, r[7] = S * O + v * q + w * N + T * Tt, r[11] = S * B + v * K + w * rt + T * ut, r[15] = S * V + v * U + w * vt + T * j, this;
3148
+ const n = t.elements, i = e.elements, r = this.elements, a = n[0], o = n[4], c = n[8], h = n[12], l = n[1], u = n[5], f = n[9], p = n[13], d = n[2], g = n[6], x = n[10], b = n[14], S = n[3], v = n[7], w = n[11], T = n[15], M = i[0], O = i[4], B = i[8], V = i[12], D = i[1], q = i[5], Q = i[9], U = i[13], R = i[2], N = i[6], rt = i[10], vt = i[14], Pt = i[3], Tt = i[7], ut = i[11], j = i[15];
3149
+ return r[0] = a * M + o * D + c * R + h * Pt, r[4] = a * O + o * q + c * N + h * Tt, r[8] = a * B + o * Q + c * rt + h * ut, r[12] = a * V + o * U + c * vt + h * j, r[1] = l * M + u * D + f * R + p * Pt, r[5] = l * O + u * q + f * N + p * Tt, r[9] = l * B + u * Q + f * rt + p * ut, r[13] = l * V + u * U + f * vt + p * j, r[2] = d * M + g * D + x * R + b * Pt, r[6] = d * O + g * q + x * N + b * Tt, r[10] = d * B + g * Q + x * rt + b * ut, r[14] = d * V + g * U + x * vt + b * j, r[3] = S * M + v * D + w * R + T * Pt, r[7] = S * O + v * q + w * N + T * Tt, r[11] = S * B + v * Q + w * rt + T * ut, r[15] = S * V + v * U + w * vt + T * j, this;
3146
3150
  }
3147
3151
  multiplyScalar(t) {
3148
3152
  const e = this.elements;
@@ -4670,8 +4674,8 @@ class kt extends Di {
4670
4674
  count: t.count
4671
4675
  }]);
4672
4676
  for (let B = 0, V = S.length; B < V; ++B) {
4673
- const D = S[B], q = D.start, K = D.count;
4674
- for (let U = q, R = q + K; U < R; U += 3)
4677
+ const D = S[B], q = D.start, Q = D.count;
4678
+ for (let U = q, R = q + Q; U < R; U += 3)
4675
4679
  b(
4676
4680
  t.getX(U + 0),
4677
4681
  t.getX(U + 1),
@@ -4687,8 +4691,8 @@ class kt extends Di {
4687
4691
  a.setXYZW(B, v.x, v.y, v.z, q);
4688
4692
  }
4689
4693
  for (let B = 0, V = S.length; B < V; ++B) {
4690
- const D = S[B], q = D.start, K = D.count;
4691
- for (let U = q, R = q + K; U < R; U += 3)
4694
+ const D = S[B], q = D.start, Q = D.count;
4695
+ for (let U = q, R = q + Q; U < R; U += 3)
4692
4696
  O(t.getX(U + 0)), O(t.getX(U + 1)), O(t.getX(U + 2));
4693
4697
  }
4694
4698
  }
@@ -7035,11 +7039,11 @@ class Rt {
7035
7039
  );
7036
7040
  }
7037
7041
  }
7038
- var J = /* @__PURE__ */ ((s) => (s.SHAPES = "shapes", s.BIGFONT = "bigfont", s.UNIFONT = "unifont", s))(J || {});
7042
+ var K = /* @__PURE__ */ ((s) => (s.SHAPES = "shapes", s.BIGFONT = "bigfont", s.UNIFONT = "unifont", s))(K || {});
7039
7043
  class Cf {
7040
7044
  parse(t) {
7041
7045
  const e = this.parseHeader(t).split(" "), n = e[1].toLocaleLowerCase();
7042
- if (!Object.values(J).includes(n))
7046
+ if (!Object.values(K).includes(n))
7043
7047
  throw new Error(`Invalid font type: ${n}`);
7044
7048
  return {
7045
7049
  fileHeader: e[0],
@@ -7341,11 +7345,11 @@ class kf {
7341
7345
  class Ef {
7342
7346
  static createParser(t) {
7343
7347
  switch (t) {
7344
- case J.SHAPES:
7348
+ case K.SHAPES:
7345
7349
  return new Tf();
7346
- case J.BIGFONT:
7350
+ case K.BIGFONT:
7347
7351
  return new Af();
7348
- case J.UNIFONT:
7352
+ case K.UNIFONT:
7349
7353
  return new kf();
7350
7354
  default:
7351
7355
  throw new Error(`Unsupported font type: ${t}`);
@@ -7712,7 +7716,7 @@ function Pi(s, t) {
7712
7716
  };
7713
7717
  }
7714
7718
  function Pf(s, t, e) {
7715
- if (s.header.fontType !== J.SHAPES || !(0 in s.content.data))
7719
+ if (s.header.fontType !== K.SHAPES || !(0 in s.content.data))
7716
7720
  return !1;
7717
7721
  const n = -(e.descenderHeight + e.capHeight * 0.2);
7718
7722
  return t.bbox.minY < n;
@@ -7722,7 +7726,7 @@ function Rh(s, t) {
7722
7726
  return !(s.bbox.minY < e || s.bbox.maxY - s.bbox.minY < t.capHeight * 0.05);
7723
7727
  }
7724
7728
  function Nf(s, t, e) {
7725
- if (s.header.fontType !== J.BIGFONT || s.content.baseDown > 0)
7729
+ if (s.header.fontType !== K.BIGFONT || s.content.baseDown > 0)
7726
7730
  return 0;
7727
7731
  const { height: n } = s.content;
7728
7732
  if (n <= 0)
@@ -7752,7 +7756,7 @@ function Nf(s, t, e) {
7752
7756
  return r.length % 2 === 0 ? (r[c - 1] + r[c]) / 2 : r[c];
7753
7757
  }
7754
7758
  function zf(s, t, e) {
7755
- if (s.header.fontType !== J.UNIFONT)
7759
+ if (s.header.fontType !== K.UNIFONT)
7756
7760
  return !1;
7757
7761
  if (s.content.dualOrientation)
7758
7762
  return !0;
@@ -7769,13 +7773,13 @@ function zf(s, t, e) {
7769
7773
  function Hf(s, t, e, n = Ui, i = !1, r = 0) {
7770
7774
  var a;
7771
7775
  let o = s;
7772
- if (t.header.fontType === J.BIGFONT && r > 0) {
7776
+ if (t.header.fontType === K.BIGFONT && r > 0) {
7773
7777
  const l = t.content.height > 0 ? e.size / t.content.height : 1;
7774
7778
  o = o.offset(new at(0, -r * l), !0);
7775
7779
  }
7776
- if (t.header.fontType === J.UNIFONT || Pf(t, s, e)) {
7777
- const l = t.header.fontType === J.UNIFONT && (i || t.content.dualOrientation || Rh(s, e));
7778
- (t.header.fontType !== J.UNIFONT || !l) && (o = o.offset(new at(0, e.capHeight), !0));
7780
+ if (t.header.fontType === K.UNIFONT || Pf(t, s, e)) {
7781
+ const l = t.header.fontType === K.UNIFONT && (i || t.content.dualOrientation || Rh(s, e));
7782
+ (t.header.fontType !== K.UNIFONT || !l) && (o = o.offset(new at(0, e.capHeight), !0));
7779
7783
  }
7780
7784
  const c = n.resolve(o, e.cellWidth), h = n.markAlignedAdvanceExplicit(o) ? !0 : o.hasExplicitAdvance;
7781
7785
  return new Pn(
@@ -7897,7 +7901,7 @@ class qf {
7897
7901
  * @returns The parsed shape or undefined if the character is not found
7898
7902
  */
7899
7903
  getCharShape(t, e) {
7900
- const n = this.fontData.header.fontType === J.SHAPES && !(0 in this.fontData.content.data) ? e : e / this.fontData.content.height;
7904
+ const n = this.fontData.header.fontType === K.SHAPES && !(0 in this.fontData.content.data) ? e : e / this.fontData.content.height;
7901
7905
  return this.parseAndScale(t, { factor: n });
7902
7906
  }
7903
7907
  /**
@@ -7915,7 +7919,7 @@ class qf {
7915
7919
  else {
7916
7920
  const i = this.fontData.content.data;
7917
7921
  if (i[t]) {
7918
- const r = this.prepareBigfontGlyphBytecode(t, i[t]), a = this.fontData.header.fontType !== J.BIGFONT;
7922
+ const r = this.prepareBigfontGlyphBytecode(t, i[t]), a = this.fontData.header.fontType !== K.BIGFONT;
7919
7923
  n = this.parseShape(r, { flushOnEnd: !0, initialPenDown: a }), this.shapeData.set(t, n), this.shapeCache.set(t, n);
7920
7924
  }
7921
7925
  }
@@ -7931,7 +7935,7 @@ class qf {
7931
7935
  }
7932
7936
  /** Strips the embedded character-code prefix from dual-byte BIGFONT parent glyphs. */
7933
7937
  prepareBigfontGlyphBytecode(t, e) {
7934
- if (this.fontData.header.fontType !== J.BIGFONT || t <= 255)
7938
+ if (this.fontData.header.fontType !== K.BIGFONT || t <= 255)
7935
7939
  return e;
7936
7940
  const n = t >> 8 & 255, i = t & 255;
7937
7941
  if (e.length >= 2 && e[0] === n && e[1] === i) {
@@ -7987,7 +7991,7 @@ class qf {
7987
7991
  */
7988
7992
  shouldSkipVerticalFlagCommand(t = !1) {
7989
7993
  const { content: e, header: n } = this.fontData;
7990
- return n.fontType === J.BIGFONT ? !e.verticalDualMode : e.dualOrientation ? !t : e.orientation === "horizontal";
7994
+ return n.fontType === K.BIGFONT ? !e.verticalDualMode : e.dualOrientation ? !t : e.orientation === "horizontal";
7991
7995
  }
7992
7996
  /** Marks that bytecode explicitly defines horizontal advance. */
7993
7997
  markAdvanceDefined(t) {
@@ -8186,22 +8190,22 @@ class qf {
8186
8190
  let i = e, r = 0, a, o = n.scale * this.fontData.content.baseUp, c = o;
8187
8191
  const h = n.currentPoint.clone();
8188
8192
  switch (n.currentPolyline.length > 1 && (n.polylines.push(n.currentPolyline.slice()), n.currentPolyline = []), this.fontData.header.fontType) {
8189
- case J.SHAPES:
8193
+ case K.SHAPES:
8190
8194
  i++, r = t[i];
8191
8195
  break;
8192
- case J.BIGFONT:
8196
+ case K.BIGFONT:
8193
8197
  if (i++, this.isVerticalDualBigfontMarker(t, i, "open"))
8194
8198
  return i;
8195
8199
  if (this.isVerticalDualBigfontMarker(t, i, "close"))
8196
8200
  return i + 1;
8197
8201
  r = t[i], r === 0 && (i++, r = t[i++] << 8 | t[i++], h.x = Rt.byteToSByte(t[i++]) * n.scale, h.y = Rt.byteToSByte(t[i++]) * n.scale, this.fontData.content.isExtended ? (c = t[i++] * n.scale, o = t[i] * n.scale) : (o = t[i] * n.scale, c = o));
8198
8202
  break;
8199
- case J.UNIFONT:
8203
+ case K.UNIFONT:
8200
8204
  i++, r = t[i++] << 8 | t[i++], i--;
8201
8205
  break;
8202
8206
  }
8203
8207
  if (r !== 0)
8204
- if (this.fontData.header.fontType === J.UNIFONT) {
8208
+ if (this.fontData.header.fontType === K.UNIFONT) {
8205
8209
  const l = n.isPenDown;
8206
8210
  a = this.getScaledSubshapeAtInsertPoint(
8207
8211
  r,
@@ -8210,7 +8214,7 @@ class qf {
8210
8214
  h,
8211
8215
  l
8212
8216
  ), a != null && a.polylines.some((u) => u.length >= 2) && (n.polylines.push(...a.polylines.slice()), a.lastPoint && (n.currentPoint = a.lastPoint.clone()), n.currentPolyline = [], n.isPenDown && n.currentPolyline.push(n.currentPoint.clone()));
8213
- } else if (this.fontData.header.fontType === J.SHAPES)
8217
+ } else if (this.fontData.header.fontType === K.SHAPES)
8214
8218
  a = this.getScaledSubshapeAtInsertPoint(
8215
8219
  r,
8216
8220
  c,
@@ -8333,13 +8337,13 @@ class qf {
8333
8337
  break;
8334
8338
  case 7:
8335
8339
  switch (this.fontData.header.fontType) {
8336
- case J.SHAPES:
8340
+ case K.SHAPES:
8337
8341
  e++;
8338
8342
  break;
8339
- case J.BIGFONT:
8343
+ case K.BIGFONT:
8340
8344
  e++, this.isVerticalDualBigfontMarker(t, e, "open") ? e++ : this.isVerticalDualBigfontMarker(t, e, "close") ? e += 2 : t[e] === 0 && (e += this.fontData.content.isExtended ? 6 : 5);
8341
8345
  break;
8342
- case J.UNIFONT:
8346
+ case K.UNIFONT:
8343
8347
  e += 2;
8344
8348
  break;
8345
8349
  }
@@ -8391,13 +8395,13 @@ class qf {
8391
8395
  const h = this.fontData.content.data[t];
8392
8396
  if (!h)
8393
8397
  return;
8394
- const l = this.fontData.header.fontType !== J.BIGFONT;
8398
+ const l = this.fontData.header.fontType !== K.BIGFONT;
8395
8399
  a = this.parseShape(h, {
8396
8400
  flushOnEnd: !1,
8397
8401
  initialPenDown: l
8398
8402
  }), this.shapeData.set(t, a), this.subshapeCache.set(t, a);
8399
8403
  }
8400
- const o = this.fontData.header.fontType === J.BIGFONT ? void 0 : n / this.fontData.content.baseUp, c = a.polylines.some((h) => h.length > 0);
8404
+ const o = this.fontData.header.fontType === K.BIGFONT ? void 0 : n / this.fontData.content.baseUp, c = a.polylines.some((h) => h.length > 0);
8401
8405
  return (o !== void 0 ? this.scaleShapeByFactor(a, o) : this.scaleShapeByHeightAndWidth(
8402
8406
  c ? a.normalizeToOrigin(!0) : a,
8403
8407
  n,
@@ -14212,7 +14216,7 @@ function oa(s, t, e, n, i) {
14212
14216
  function q(R, N) {
14213
14217
  p && V !== 2 && h.closePath(), h.moveTo(R, N), p = !0;
14214
14218
  }
14215
- function K() {
14219
+ function Q() {
14216
14220
  let R;
14217
14221
  R = (l.length & 1) !== 0, R && !f && (D = l.shift() + v), u += l.length >> 1, l.length = 0, f = !0;
14218
14222
  }
@@ -14222,10 +14226,10 @@ function oa(s, t, e, n, i) {
14222
14226
  let Ot = R[ht];
14223
14227
  switch (ht += 1, Ot) {
14224
14228
  case 1:
14225
- K();
14229
+ Q();
14226
14230
  break;
14227
14231
  case 3:
14228
- K();
14232
+ Q();
14229
14233
  break;
14230
14234
  case 4:
14231
14235
  l.length > 1 && !f && (D = l.shift() + v, f = !0), g += l.pop(), q(d, g);
@@ -14321,9 +14325,9 @@ function oa(s, t, e, n, i) {
14321
14325
  break;
14322
14326
  }
14323
14327
  M || (M = s.variation && i && s.variation.process.getBlendVector(T, w, i));
14324
- var Q = l.pop(), Mt = M ? M.length : T.itemVariationSubtables[w].regionIndexes.length, Nt = Q * Mt, zt = l.length - Nt, Ht = zt - Q;
14328
+ var tt = l.pop(), Mt = M ? M.length : T.itemVariationSubtables[w].regionIndexes.length, Nt = tt * Mt, zt = l.length - Nt, Ht = zt - tt;
14325
14329
  if (M)
14326
- for (let Fe = 0; Fe < Q; Fe++) {
14330
+ for (let Fe = 0; Fe < tt; Fe++) {
14327
14331
  var Vt = l[Ht + Fe];
14328
14332
  for (let C = 0; C < Mt; C++)
14329
14333
  Vt += M[C] * l[zt++];
@@ -14333,11 +14337,11 @@ function oa(s, t, e, n, i) {
14333
14337
  l.pop();
14334
14338
  break;
14335
14339
  case 18:
14336
- K();
14340
+ Q();
14337
14341
  break;
14338
14342
  case 19:
14339
14343
  case 20:
14340
- K(), ht += u + 7 >> 3;
14344
+ Q(), ht += u + 7 >> 3;
14341
14345
  break;
14342
14346
  case 21:
14343
14347
  l.length > 2 && !f && (D = l.shift() + v, f = !0), g += l.pop(), d += l.pop(), q(d, g);
@@ -14346,7 +14350,7 @@ function oa(s, t, e, n, i) {
14346
14350
  l.length > 1 && !f && (D = l.shift() + v, f = !0), d += l.pop(), q(d, g);
14347
14351
  break;
14348
14352
  case 23:
14349
- K();
14353
+ Q();
14350
14354
  break;
14351
14355
  case 24:
14352
14356
  for (; l.length > 2; )
@@ -15963,10 +15967,10 @@ function E0(s) {
15963
15967
  function M0(s) {
15964
15968
  const t = [], e = [], n = [], i = [], r = [], a = [], o = [];
15965
15969
  let c, h = 0, l = 0, u = 0, f = 0, p = 0;
15966
- for (let Q = 0; Q < s.glyphs.length; Q += 1) {
15967
- const Mt = s.glyphs.get(Q), Nt = Mt.unicode | 0;
15970
+ for (let tt = 0; tt < s.glyphs.length; tt += 1) {
15971
+ const Mt = s.glyphs.get(tt), Nt = Mt.unicode | 0;
15968
15972
  if (isNaN(Mt.advanceWidth))
15969
- throw new Error("Glyph " + Mt.name + " (" + Q + "): advanceWidth is not a number.");
15973
+ throw new Error("Glyph " + Mt.name + " (" + tt + "): advanceWidth is not a number.");
15970
15974
  (c > Nt || c === void 0) && Nt > 0 && (c = Nt), h < Nt && (h = Nt);
15971
15975
  const zt = la.getUnicodeRange(Nt);
15972
15976
  if (zt < 32)
@@ -16045,18 +16049,18 @@ function M0(s) {
16045
16049
  let V = s.getEnglishName("postScriptName");
16046
16050
  V || (V = M.replace(/\s/g, "") + "-" + O);
16047
16051
  const D = {};
16048
- for (let Q in s.names)
16049
- D[Q] = s.names[Q];
16052
+ for (let tt in s.names)
16053
+ D[tt] = s.names[tt];
16050
16054
  D.unicode = D.unicode || {}, D.macintosh = D.macintosh || {}, D.windows = D.windows || {};
16051
- const q = s.names.unicode || {}, K = s.names.macintosh || {}, U = s.names.windows || {};
16052
- for (const Q in D) {
16053
- if (D[Q] = D[Q] || {}, !D[Q].uniqueID) {
16055
+ const q = s.names.unicode || {}, Q = s.names.macintosh || {}, U = s.names.windows || {};
16056
+ for (const tt in D) {
16057
+ if (D[tt] = D[tt] || {}, !D[tt].uniqueID) {
16054
16058
  const Mt = s.getEnglishName("manufacturer") || "";
16055
- D[Q].uniqueID = { en: `${Mt}: ${B}` };
16059
+ D[tt].uniqueID = { en: `${Mt}: ${B}` };
16056
16060
  }
16057
- D[Q].postScriptName || (D[Q].postScriptName = { en: V });
16061
+ D[tt].postScriptName || (D[tt].postScriptName = { en: V });
16058
16062
  }
16059
- D.unicode.preferredFamily || (D.unicode.preferredFamily = q.fontFamily || K.fontFamily || U.fontFamily), D.macintosh.preferredFamily || (D.macintosh.preferredFamily = K.fontFamily || q.fontFamily || U.fontFamily), D.windows.preferredFamily || (D.windows.preferredFamily = U.fontFamily || q.fontFamily || K.fontFamily), D.unicode.preferredSubfamily || (D.unicode.preferredSubfamily = q.fontSubfamily || K.fontSubfamily || U.fontSubfamily), D.macintosh.preferredSubfamily || (D.macintosh.preferredSubfamily = K.fontSubfamily || q.fontSubfamily || U.fontSubfamily), D.windows.preferredSubfamily || (D.windows.preferredSubfamily = U.fontSubfamily || q.fontSubfamily || K.fontSubfamily);
16063
+ D.unicode.preferredFamily || (D.unicode.preferredFamily = q.fontFamily || Q.fontFamily || U.fontFamily), D.macintosh.preferredFamily || (D.macintosh.preferredFamily = Q.fontFamily || q.fontFamily || U.fontFamily), D.windows.preferredFamily || (D.windows.preferredFamily = U.fontFamily || q.fontFamily || Q.fontFamily), D.unicode.preferredSubfamily || (D.unicode.preferredSubfamily = q.fontSubfamily || Q.fontSubfamily || U.fontSubfamily), D.macintosh.preferredSubfamily || (D.macintosh.preferredSubfamily = Q.fontSubfamily || q.fontSubfamily || U.fontSubfamily), D.windows.preferredSubfamily || (D.windows.preferredSubfamily = U.fontSubfamily || q.fontSubfamily || Q.fontSubfamily);
16060
16064
  const R = [], N = nl.make(D, R), rt = R.length > 0 ? bl.make(R) : void 0, vt = Sl.make(s), Pt = ca.make(s.glyphs, {
16061
16065
  version: s.getEnglishName("version"),
16062
16066
  fullName: B,
@@ -16083,19 +16087,19 @@ function M0(s) {
16083
16087
  avar: [s.tables.fvar],
16084
16088
  fvar: [s.names]
16085
16089
  };
16086
- for (let Q in j) {
16087
- const Mt = s.tables[Q];
16090
+ for (let tt in j) {
16091
+ const Mt = s.tables[tt];
16088
16092
  if (Mt) {
16089
- const Nt = j[Q].make.call(s, Mt, ...it[Q] || []);
16093
+ const Nt = j[tt].make.call(s, Mt, ...it[tt] || []);
16090
16094
  Nt && ut.push(Nt);
16091
16095
  }
16092
16096
  }
16093
16097
  Tt && ut.push(Tt);
16094
16098
  const xt = Ll(ut), Et = xt.encode(), St = Ea(Et), At = xt.fields;
16095
16099
  let ht = !1;
16096
- for (let Q = 0; Q < At.length; Q += 1)
16097
- if (At[Q].name === "head table") {
16098
- At[Q].value.checkSumAdjustment = 2981146554 - St, ht = !0;
16100
+ for (let tt = 0; tt < At.length; tt += 1)
16101
+ if (At[tt].name === "head table") {
16102
+ At[tt].value.checkSumAdjustment = 2981146554 - St, ht = !0;
16099
16103
  break;
16100
16104
  }
16101
16105
  if (!ht)
@@ -20834,7 +20838,7 @@ function iy(s, t) {
20834
20838
  }
20835
20839
  return e;
20836
20840
  }
20837
- function tt(s, t) {
20841
+ function et(s, t) {
20838
20842
  if (t.compression === "WOFF") {
20839
20843
  const e = new Uint8Array(s.buffer, t.offset + 2, t.compressedLength - 2), n = new Uint8Array(t.length);
20840
20844
  if (jh(e, n), n.byteLength !== t.length)
@@ -20877,10 +20881,10 @@ function ry(s, t = {}) {
20877
20881
  g = R;
20878
20882
  break;
20879
20883
  case "cmap":
20880
- N = tt(r, R), i.tables.cmap = sl.parse(N.data, N.offset), i.encoding = new rl(i.tables.cmap);
20884
+ N = et(r, R), i.tables.cmap = sl.parse(N.data, N.offset), i.encoding = new rl(i.tables.cmap);
20881
20885
  break;
20882
20886
  case "cvt ":
20883
- N = tt(r, R), D = new z.Parser(N.data, N.offset), i.tables.cvt = D.parseShortList(R.length / 2);
20887
+ N = et(r, R), D = new z.Parser(N.data, N.offset), i.tables.cvt = D.parseShortList(R.length / 2);
20884
20888
  break;
20885
20889
  case "fvar":
20886
20890
  u = R;
@@ -20895,13 +20899,13 @@ function ry(s, t = {}) {
20895
20899
  d = R;
20896
20900
  break;
20897
20901
  case "fpgm":
20898
- N = tt(r, R), D = new z.Parser(N.data, N.offset), i.tables.fpgm = D.parseByteList(R.length);
20902
+ N = et(r, R), D = new z.Parser(N.data, N.offset), i.tables.fpgm = D.parseByteList(R.length);
20899
20903
  break;
20900
20904
  case "head":
20901
- N = tt(r, R), i.tables.head = ml.parse(N.data, N.offset), i.unitsPerEm = i.tables.head.unitsPerEm, e = i.tables.head.indexToLocFormat;
20905
+ N = et(r, R), i.tables.head = ml.parse(N.data, N.offset), i.unitsPerEm = i.tables.head.unitsPerEm, e = i.tables.head.indexToLocFormat;
20902
20906
  break;
20903
20907
  case "hhea":
20904
- N = tt(r, R), i.tables.hhea = yl.parse(N.data, N.offset), i.ascender = i.tables.hhea.ascender, i.descender = i.tables.hhea.descender, i.numberOfHMetrics = i.tables.hhea.numberOfHMetrics;
20908
+ N = et(r, R), i.tables.hhea = yl.parse(N.data, N.offset), i.ascender = i.tables.hhea.ascender, i.descender = i.tables.hhea.descender, i.numberOfHMetrics = i.tables.hhea.numberOfHMetrics;
20905
20909
  break;
20906
20910
  case "HVAR":
20907
20911
  T = R;
@@ -20910,28 +20914,28 @@ function ry(s, t = {}) {
20910
20914
  w = R;
20911
20915
  break;
20912
20916
  case "ltag":
20913
- N = tt(r, R), n = bl.parse(N.data, N.offset);
20917
+ N = et(r, R), n = bl.parse(N.data, N.offset);
20914
20918
  break;
20915
20919
  case "COLR":
20916
- N = tt(r, R), i.tables.colr = Fl.parse(N.data, N.offset);
20920
+ N = et(r, R), i.tables.colr = Fl.parse(N.data, N.offset);
20917
20921
  break;
20918
20922
  case "CPAL":
20919
- N = tt(r, R), i.tables.cpal = hl.parse(N.data, N.offset);
20923
+ N = et(r, R), i.tables.cpal = hl.parse(N.data, N.offset);
20920
20924
  break;
20921
20925
  case "maxp":
20922
- N = tt(r, R), i.tables.maxp = vl.parse(N.data, N.offset), i.numGlyphs = i.tables.maxp.numGlyphs;
20926
+ N = et(r, R), i.tables.maxp = vl.parse(N.data, N.offset), i.numGlyphs = i.tables.maxp.numGlyphs;
20923
20927
  break;
20924
20928
  case "name":
20925
20929
  B = R;
20926
20930
  break;
20927
20931
  case "OS/2":
20928
- N = tt(r, R), i.tables.os2 = la.parse(N.data, N.offset);
20932
+ N = et(r, R), i.tables.os2 = la.parse(N.data, N.offset);
20929
20933
  break;
20930
20934
  case "post":
20931
- N = tt(r, R), i.tables.post = Sl.parse(N.data, N.offset), i.glyphNames = new Ca(i.tables.post);
20935
+ N = et(r, R), i.tables.post = Sl.parse(N.data, N.offset), i.glyphNames = new Ca(i.tables.post);
20932
20936
  break;
20933
20937
  case "prep":
20934
- N = tt(r, R), D = new z.Parser(N.data, N.offset), i.tables.prep = D.parseByteList(R.length);
20938
+ N = et(r, R), D = new z.Parser(N.data, N.offset), i.tables.prep = D.parseByteList(R.length);
20935
20939
  break;
20936
20940
  case "glyf":
20937
20941
  x = R;
@@ -20962,76 +20966,76 @@ function ry(s, t = {}) {
20962
20966
  break;
20963
20967
  case "gasp":
20964
20968
  try {
20965
- N = tt(r, R), i.tables.gasp = Ol.parse(N.data, N.offset);
20969
+ N = et(r, R), i.tables.gasp = Ol.parse(N.data, N.offset);
20966
20970
  } catch (rt) {
20967
20971
  console.warn("Failed to parse gasp table, skipping."), console.warn(rt);
20968
20972
  }
20969
20973
  break;
20970
20974
  case "SVG ":
20971
- N = tt(r, R), i.tables.svg = _l.parse(N.data, N.offset);
20975
+ N = et(r, R), i.tables.svg = _l.parse(N.data, N.offset);
20972
20976
  break;
20973
20977
  }
20974
20978
  }
20975
- const q = tt(r, B);
20979
+ const q = et(r, B);
20976
20980
  if (i.tables.name = nl.parse(q.data, q.offset, n), i.names = i.tables.name, x && O) {
20977
- const U = e === 0, R = tt(r, O), N = sy.parse(R.data, R.offset, i.numGlyphs, U), rt = tt(r, x);
20981
+ const U = e === 0, R = et(r, O), N = sy.parse(R.data, R.offset, i.numGlyphs, U), rt = et(r, x);
20978
20982
  i.glyphs = Pl.parse(rt.data, rt.offset, N, i, t);
20979
20983
  } else if (h) {
20980
- const U = tt(r, h);
20984
+ const U = et(r, h);
20981
20985
  ca.parse(U.data, U.offset, i, t);
20982
20986
  } else if (l) {
20983
- const U = tt(r, l);
20987
+ const U = et(r, l);
20984
20988
  ca.parse(U.data, U.offset, i, t);
20985
20989
  } else
20986
20990
  throw new Error("Font doesn't contain TrueType, CFF or CFF2 outlines.");
20987
- const K = tt(r, w);
20988
- if (xl.parse(i, K.data, K.offset, i.numberOfHMetrics, i.numGlyphs, i.glyphs, t), td(i, t), M) {
20989
- const U = tt(r, M);
20991
+ const Q = et(r, w);
20992
+ if (xl.parse(i, Q.data, Q.offset, i.numberOfHMetrics, i.numGlyphs, i.glyphs, t), td(i, t), M) {
20993
+ const U = et(r, M);
20990
20994
  i.kerningPairs = ey.parse(U.data, U.offset);
20991
20995
  } else
20992
20996
  i.kerningPairs = {};
20993
20997
  if (b) {
20994
- const U = tt(r, b);
20998
+ const U = et(r, b);
20995
20999
  i.tables.gdef = Xm.parse(U.data, U.offset);
20996
21000
  }
20997
21001
  if (S) {
20998
- const U = tt(r, S);
21002
+ const U = et(r, S);
20999
21003
  i.tables.gpos = Jm.parse(U.data, U.offset), i.position.init();
21000
21004
  }
21001
21005
  if (v) {
21002
- const U = tt(r, v);
21006
+ const U = et(r, v);
21003
21007
  i.tables.gsub = wl.parse(U.data, U.offset);
21004
21008
  }
21005
21009
  if (u) {
21006
- const U = tt(r, u);
21010
+ const U = et(r, u);
21007
21011
  i.tables.fvar = Tl.parse(U.data, U.offset, i.names);
21008
21012
  }
21009
21013
  if (f) {
21010
- const U = tt(r, f);
21014
+ const U = et(r, f);
21011
21015
  i.tables.stat = Al.parse(U.data, U.offset, i.tables.fvar);
21012
21016
  }
21013
21017
  if (p) {
21014
21018
  u || console.warn("This font provides a gvar table, but no fvar table, which is required for variable fonts."), x || console.warn("This font provides a gvar table, but no glyf table. Glyph variation only works with TrueType outlines.");
21015
- const U = tt(r, p);
21019
+ const U = et(r, p);
21016
21020
  i.tables.gvar = Ml.parse(U.data, U.offset, i.tables.fvar, i.glyphs);
21017
21021
  }
21018
21022
  if (d) {
21019
21023
  u || console.warn("This font provides a cvar table, but no fvar table, which is required for variable fonts."), i.tables.cvt || console.warn("This font provides a cvar table, but no cvt table which could be made variable."), x || console.warn("This font provides a gvar table, but no glyf table. Glyph variation only works with TrueType outlines.");
21020
- const U = tt(r, d);
21024
+ const U = et(r, d);
21021
21025
  i.tables.cvar = El.parse(U.data, U.offset, i.tables.fvar, i.tables.cvt || []);
21022
21026
  }
21023
21027
  if (g) {
21024
21028
  u || console.warn("This font provides an avar table, but no fvar table, which is required for variable fonts.");
21025
- const U = tt(r, g);
21029
+ const U = et(r, g);
21026
21030
  i.tables.avar = kl.parse(U.data, U.offset, i.tables.fvar);
21027
21031
  }
21028
21032
  if (T) {
21029
21033
  u || console.warn("This font provides an HVAR table, but no fvar table, which is required for variable fonts."), w || console.warn("This font provides an HVAR table, but no hmtx table to vary.");
21030
- const U = tt(r, T);
21034
+ const U = et(r, T);
21031
21035
  i.tables.hvar = zm.parse(U.data, U.offset, i.tables.fvar);
21032
21036
  }
21033
21037
  if (V) {
21034
- const U = tt(r, V);
21038
+ const U = et(r, V);
21035
21039
  i.tables.meta = Cl.parse(U.data, U.offset), i.metas = i.tables.meta;
21036
21040
  }
21037
21041
  return i.palettes = new Dl(i), i;
@@ -21899,7 +21903,7 @@ Ia.write = function(s, t, e, n, i, r) {
21899
21903
  return y;
21900
21904
  case "utf8":
21901
21905
  case "utf-8":
21902
- return Q(C).length;
21906
+ return tt(C).length;
21903
21907
  case "ucs2":
21904
21908
  case "ucs-2":
21905
21909
  case "utf16le":
@@ -21911,7 +21915,7 @@ Ia.write = function(s, t, e, n, i, r) {
21911
21915
  return zt(C).length;
21912
21916
  default:
21913
21917
  if (k)
21914
- return F ? -1 : Q(C).length;
21918
+ return F ? -1 : tt(C).length;
21915
21919
  m = ("" + m).toLowerCase(), k = !0;
21916
21920
  }
21917
21921
  }
@@ -22064,7 +22068,7 @@ Ia.write = function(s, t, e, n, i, r) {
22064
22068
  return I;
22065
22069
  }
22066
22070
  function V(C, m, y, F) {
22067
- return Ht(Q(m, C.length - y), C, y, F);
22071
+ return Ht(tt(m, C.length - y), C, y, F);
22068
22072
  }
22069
22073
  function D(C, m, y, F) {
22070
22074
  return Ht(Mt(m), C, y, F);
@@ -22072,7 +22076,7 @@ Ia.write = function(s, t, e, n, i, r) {
22072
22076
  function q(C, m, y, F) {
22073
22077
  return Ht(zt(m), C, y, F);
22074
22078
  }
22075
- function K(C, m, y, F) {
22079
+ function Q(C, m, y, F) {
22076
22080
  return Ht(Nt(m, C.length - y), C, y, F);
22077
22081
  }
22078
22082
  o.prototype.write = function(m, y, F, k) {
@@ -22107,7 +22111,7 @@ Ia.write = function(s, t, e, n, i, r) {
22107
22111
  case "ucs-2":
22108
22112
  case "utf16le":
22109
22113
  case "utf-16le":
22110
- return K(this, m, y, F);
22114
+ return Q(this, m, y, F);
22111
22115
  default:
22112
22116
  if (I) throw new TypeError("Unknown encoding: " + k);
22113
22117
  k = ("" + k).toLowerCase(), I = !0;
@@ -22377,7 +22381,7 @@ Ia.write = function(s, t, e, n, i, r) {
22377
22381
  C = C + "=";
22378
22382
  return C;
22379
22383
  }
22380
- function Q(C, m) {
22384
+ function tt(C, m) {
22381
22385
  m = m || 1 / 0;
22382
22386
  for (var y, F = C.length, k = null, _ = [], I = 0; I < F; ++I) {
22383
22387
  if (y = C.charCodeAt(I), y > 55295 && y < 57344) {
@@ -32856,7 +32860,7 @@ const Be = class Be extends Eh {
32856
32860
  * @returns The fallback shape, or undefined if it cannot be built.
32857
32861
  */
32858
32862
  getNotFoundTextShape(t) {
32859
- const e = this.font.fontData.header.fontType === J.BIGFONT ? "?" : "?";
32863
+ const e = this.font.fontData.header.fontType === K.BIGFONT ? "?" : "?";
32860
32864
  return this.getCharShape(e, t);
32861
32865
  }
32862
32866
  /**
@@ -32919,14 +32923,14 @@ const Be = class Be extends Eh {
32919
32923
  return e;
32920
32924
  const n = this.font.fontData.header.fontType;
32921
32925
  let i;
32922
- if (n === J.BIGFONT && this.encoding) {
32926
+ if (n === K.BIGFONT && this.encoding) {
32923
32927
  const r = Yc.encode(t[0], this.encoding);
32924
32928
  if (Yc.decode(r, this.encoding) !== t[0])
32925
32929
  return this.codeCache.set(t, Be.NOT_ENCODABLE), Be.NOT_ENCODABLE;
32926
32930
  i = r.length === 1 ? r[0] : r[0] << 8 | r[1];
32927
32931
  } else
32928
32932
  i = t.charCodeAt(0);
32929
- if (n === J.BIGFONT && i >= 32 && i <= 126) {
32933
+ if (n === K.BIGFONT && i >= 32 && i <= 126) {
32930
32934
  const r = 41856 + i;
32931
32935
  this.font.hasChar(r) && (i = r);
32932
32936
  }
@@ -33293,7 +33297,7 @@ class ee {
33293
33297
  var e;
33294
33298
  for (const n of this.defaultFonts) {
33295
33299
  const i = this.loadedFontMap.get(n.toLowerCase());
33296
- if (i && !(t && i.type === "shx" && ((e = i.data.header) == null ? void 0 : e.fontType) === J.BIGFONT))
33300
+ if (i && !(t && i.type === "shx" && ((e = i.data.header) == null ? void 0 : e.fontType) === K.BIGFONT))
33297
33301
  return n;
33298
33302
  }
33299
33303
  }
@@ -33964,7 +33968,7 @@ class hx {
33964
33968
  return e && t.layer ? `layer_${t.layer}_${n}` : `entity_${n}`;
33965
33969
  }
33966
33970
  }
33967
- var le = /* @__PURE__ */ ((s) => (s[s.LEFT_TO_RIGHT = 1] = "LEFT_TO_RIGHT", s[s.RIGHT_TO_LEFT = 2] = "RIGHT_TO_LEFT", s[s.TOP_TO_BOTTOM = 3] = "TOP_TO_BOTTOM", s[s.BOTTOM_TO_TOP = 4] = "BOTTOM_TO_TOP", s[s.BY_STYLE = 5] = "BY_STYLE", s))(le || {}), et = /* @__PURE__ */ ((s) => (s[s.TopLeft = 1] = "TopLeft", s[s.TopCenter = 2] = "TopCenter", s[s.TopRight = 3] = "TopRight", s[s.MiddleLeft = 4] = "MiddleLeft", s[s.MiddleCenter = 5] = "MiddleCenter", s[s.MiddleRight = 6] = "MiddleRight", s[s.BottomLeft = 7] = "BottomLeft", s[s.BottomCenter = 8] = "BottomCenter", s[s.BottomRight = 9] = "BottomRight", s[s.BaselineLeft = 10] = "BaselineLeft", s[s.BaselineCenter = 11] = "BaselineCenter", s[s.BaselineRight = 12] = "BaselineRight", s))(et || {}), ln = /* @__PURE__ */ ((s) => (s[s.AtLeast = 1] = "AtLeast", s[s.Exact = 2] = "Exact", s))(ln || {}), dt = /* @__PURE__ */ ((s) => (s.CHAR = "CHAR", s.STACK = "STACK", s))(dt || {});
33971
+ var le = /* @__PURE__ */ ((s) => (s[s.LEFT_TO_RIGHT = 1] = "LEFT_TO_RIGHT", s[s.RIGHT_TO_LEFT = 2] = "RIGHT_TO_LEFT", s[s.TOP_TO_BOTTOM = 3] = "TOP_TO_BOTTOM", s[s.BOTTOM_TO_TOP = 4] = "BOTTOM_TO_TOP", s[s.BY_STYLE = 5] = "BY_STYLE", s))(le || {}), nt = /* @__PURE__ */ ((s) => (s[s.TopLeft = 1] = "TopLeft", s[s.TopCenter = 2] = "TopCenter", s[s.TopRight = 3] = "TopRight", s[s.MiddleLeft = 4] = "MiddleLeft", s[s.MiddleCenter = 5] = "MiddleCenter", s[s.MiddleRight = 6] = "MiddleRight", s[s.BottomLeft = 7] = "BottomLeft", s[s.BottomCenter = 8] = "BottomCenter", s[s.BottomRight = 9] = "BottomRight", s[s.BaselineLeft = 10] = "BaselineLeft", s[s.BaselineCenter = 11] = "BaselineCenter", s[s.BaselineRight = 12] = "BaselineRight", s))(nt || {}), ln = /* @__PURE__ */ ((s) => (s[s.AtLeast = 1] = "AtLeast", s[s.Exact = 2] = "Exact", s))(ln || {}), dt = /* @__PURE__ */ ((s) => (s.CHAR = "CHAR", s.STACK = "STACK", s))(dt || {});
33968
33972
  const mi = "", lx = () => ({
33969
33973
  byLayerColor: 16777215,
33970
33974
  byBlockColor: 16777215,
@@ -34867,7 +34871,7 @@ class rh {
34867
34871
  this._lastCharBoxTarget = void 0, this._lineBatchEntries = [], this._meshBatchEntries = [];
34868
34872
  const e = [], n = [], i = [], r = [], a = new So();
34869
34873
  for (const o of t)
34870
- if (o.type === nt.NEW_PARAGRAPH)
34874
+ if (o.type === J.NEW_PARAGRAPH)
34871
34875
  this.startNewParagraph(
34872
34876
  e,
34873
34877
  n,
@@ -34875,7 +34879,7 @@ class rh {
34875
34879
  r,
34876
34880
  a
34877
34881
  );
34878
- else if (o.type === nt.WORD) {
34882
+ else if (o.type === J.WORD) {
34879
34883
  const c = o.data;
34880
34884
  Array.isArray(c) ? c.forEach(
34881
34885
  (h) => this.processWord(
@@ -34892,9 +34896,9 @@ class rh {
34892
34896
  i,
34893
34897
  r
34894
34898
  );
34895
- } else if (o.type === nt.SPACE)
34899
+ } else if (o.type === J.SPACE)
34896
34900
  this.processBlank(i, r);
34897
- else if (o.type === nt.PERCENT_SYMBOL)
34901
+ else if (o.type === J.PERCENT_SYMBOL)
34898
34902
  this.processPercentSymbol(
34899
34903
  o.data,
34900
34904
  e,
@@ -34902,7 +34906,7 @@ class rh {
34902
34906
  i,
34903
34907
  r
34904
34908
  );
34905
- else if (o.type === nt.PROPERTIES_CHANGED) {
34909
+ else if (o.type === J.PROPERTIES_CHANGED) {
34906
34910
  this.processGeometries(
34907
34911
  e,
34908
34912
  n,
@@ -34920,7 +34924,7 @@ class rh {
34920
34924
  this._contextStack.push(this._currentContext.clone());
34921
34925
  this.processFormat(c);
34922
34926
  }
34923
- } else if (o.type === nt.STACK) {
34927
+ } else if (o.type === J.STACK) {
34924
34928
  this.processGeometries(
34925
34929
  e,
34926
34930
  n,
@@ -35117,17 +35121,17 @@ class rh {
35117
35121
  } else if (a && o) {
35118
35122
  const v = this._currentContext.fontScaleFactor || 1, w = (this._maxFontSize || this.currentFontSize) / v, T = Math.abs(this.currentLayoutFontSize - w) < 1e-6;
35119
35123
  T && (this._currentContext.fontSizeScaleFactor = p * 0.7, this.calcuateLineParams());
35120
- const M = Math.max(d, g), O = 0, B = 0, V = this.currentLayoutFontSize, D = l - w + V, q = D + this.currentFontSize, K = [], U = [], R = [], N = [];
35124
+ const M = Math.max(d, g), O = 0, B = 0, V = this.currentLayoutFontSize, D = l - w + V, q = D + this.currentFontSize, Q = [], U = [], R = [], N = [];
35121
35125
  this._hOffset = h + O, this._vOffset = q;
35122
35126
  for (const ut of a)
35123
35127
  this.processChar(
35124
35128
  ut,
35125
- K,
35129
+ Q,
35126
35130
  U,
35127
35131
  R,
35128
35132
  N
35129
35133
  );
35130
- e.push(...K), n.push(...U), i.push(...R), r.push(...N);
35134
+ e.push(...Q), n.push(...U), i.push(...R), r.push(...N);
35131
35135
  const rt = [], vt = [], Pt = [], Tt = [];
35132
35136
  this._hOffset = h + B, this._vOffset = D;
35133
35137
  for (const ut of o)
@@ -35175,7 +35179,7 @@ class rh {
35175
35179
  D
35176
35180
  );
35177
35181
  if (e.push(...O), n.push(...B), i.push(...V), r.push(...D), c === "/" || c === "#") {
35178
- const q = new kt(), K = new Float32Array([
35182
+ const q = new kt(), Q = new Float32Array([
35179
35183
  h,
35180
35184
  l - this.currentFontSize * 0.8 + this.defaultFontSize * ci,
35181
35185
  0,
@@ -35185,7 +35189,7 @@ class rh {
35185
35189
  ]);
35186
35190
  q.setAttribute(
35187
35191
  "position",
35188
- new Xt(K, 3)
35192
+ new Xt(Q, 3)
35189
35193
  ), q.setIndex([0, 1]), q.userData = { isDecoration: !0 }, n.push(q);
35190
35194
  }
35191
35195
  this._hOffset = h + x;
@@ -36006,7 +36010,7 @@ class Na extends Yt {
36006
36010
  e.drawingDirection
36007
36011
  );
36008
36012
  let c = { x: 0, y: 0 };
36009
- (i == null ? void 0 : i.shxFontType) === J.SHAPES ? c = { x: 0, y: 0 } : c = this.calculateAnchorPoint(
36013
+ (i == null ? void 0 : i.shxFontType) === K.SHAPES ? c = { x: 0, y: 0 } : c = this.calculateAnchorPoint(
36010
36014
  o,
36011
36015
  e.attachmentPoint
36012
36016
  ), t.userData.logicalBounds = {
@@ -36040,7 +36044,7 @@ class Na extends Yt {
36040
36044
  ), d.layers.enableAll();
36041
36045
  });
36042
36046
  let u = e.rotation || 0;
36043
- if (e.directionVector && (i == null ? void 0 : i.shxFontType) !== J.SHAPES) {
36047
+ if (e.directionVector && (i == null ? void 0 : i.shxFontType) !== K.SHAPES) {
36044
36048
  const d = e.directionVector, g = new E(d.x, d.y, d.z), x = g.clone().cross(ah), b = ah.angleTo(g);
36045
36049
  u = x.z > 0 ? -b : b;
36046
36050
  }
@@ -36089,30 +36093,30 @@ class Na extends Yt {
36089
36093
  const n = eh(t) || 0, i = Number.isFinite(n) && n > 0;
36090
36094
  let r = ct.LEFT;
36091
36095
  i && t.attachmentPoint && ([
36092
- et.TopLeft,
36093
- et.MiddleLeft,
36094
- et.BottomLeft,
36095
- et.BaselineLeft
36096
+ nt.TopLeft,
36097
+ nt.MiddleLeft,
36098
+ nt.BottomLeft,
36099
+ nt.BaselineLeft
36096
36100
  ].includes(t.attachmentPoint) ? r = ct.LEFT : [
36097
- et.TopCenter,
36098
- et.MiddleCenter,
36099
- et.BottomCenter,
36100
- et.BaselineCenter
36101
+ nt.TopCenter,
36102
+ nt.MiddleCenter,
36103
+ nt.BottomCenter,
36104
+ nt.BaselineCenter
36101
36105
  ].includes(t.attachmentPoint) ? r = ct.CENTER : [
36102
- et.TopRight,
36103
- et.MiddleRight,
36104
- et.BottomRight,
36105
- et.BaselineRight
36106
+ nt.TopRight,
36107
+ nt.MiddleRight,
36108
+ nt.BottomRight,
36109
+ nt.BaselineRight
36106
36110
  ].includes(t.attachmentPoint) && (r = ct.RIGHT));
36107
36111
  let a = $e.BOTTOM;
36108
36112
  t.attachmentPoint && ([
36109
- et.TopLeft,
36110
- et.TopCenter,
36111
- et.TopRight
36113
+ nt.TopLeft,
36114
+ nt.TopCenter,
36115
+ nt.TopRight
36112
36116
  ].includes(t.attachmentPoint) ? a = $e.TOP : [
36113
- et.MiddleLeft,
36114
- et.MiddleCenter,
36115
- et.MiddleRight
36117
+ nt.MiddleLeft,
36118
+ nt.MiddleCenter,
36119
+ nt.MiddleRight
36116
36120
  ].includes(t.attachmentPoint) ? a = $e.MIDDLE : a = $e.BOTTOM);
36117
36121
  const o = t.height || e.fixedTextHeight || 0, c = t.widthFactor || e.widthFactor || 1, h = t.lineSpaceFactor ?? Kc, l = t.lineSpaceStyle === ln.Exact ? ln.Exact : Qc, u = t.drawingDirection ?? le.LEFT_TO_RIGHT, f = {
36118
36122
  fontSize: o,
@@ -36223,40 +36227,40 @@ class Na extends Yt {
36223
36227
  let r = 0, a = 0;
36224
36228
  switch (e) {
36225
36229
  case void 0:
36226
- case et.TopLeft:
36230
+ case nt.TopLeft:
36227
36231
  r = -t.minX, a = -t.maxY;
36228
36232
  break;
36229
- case et.TopCenter:
36233
+ case nt.TopCenter:
36230
36234
  r = -n, a = -t.maxY;
36231
36235
  break;
36232
- case et.TopRight:
36236
+ case nt.TopRight:
36233
36237
  r = -t.maxX, a = -t.maxY;
36234
36238
  break;
36235
- case et.MiddleLeft:
36239
+ case nt.MiddleLeft:
36236
36240
  r = -t.minX, a = -i;
36237
36241
  break;
36238
- case et.MiddleCenter:
36242
+ case nt.MiddleCenter:
36239
36243
  r = -n, a = -i;
36240
36244
  break;
36241
- case et.MiddleRight:
36245
+ case nt.MiddleRight:
36242
36246
  r = -t.maxX, a = -i;
36243
36247
  break;
36244
- case et.BottomLeft:
36248
+ case nt.BottomLeft:
36245
36249
  r = -t.minX, a = -t.minY;
36246
36250
  break;
36247
- case et.BottomCenter:
36251
+ case nt.BottomCenter:
36248
36252
  r = -n, a = -t.minY;
36249
36253
  break;
36250
- case et.BottomRight:
36254
+ case nt.BottomRight:
36251
36255
  r = -t.maxX, a = -t.minY;
36252
36256
  break;
36253
- case et.BaselineLeft:
36257
+ case nt.BaselineLeft:
36254
36258
  r = -t.minX, a = -t.baselineY;
36255
36259
  break;
36256
- case et.BaselineCenter:
36260
+ case nt.BaselineCenter:
36257
36261
  r = -n, a = -t.baselineY;
36258
36262
  break;
36259
- case et.BaselineRight:
36263
+ case nt.BaselineRight:
36260
36264
  r = -t.maxX, a = -t.baselineY;
36261
36265
  break;
36262
36266
  }