@mlightcad/cad-simple-viewer 1.5.0 → 1.5.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.
Files changed (159) hide show
  1. package/dist/index.js +11070 -34695
  2. package/dist/index.umd.cjs +39 -52
  3. package/dist/libredwg-parser-worker.js +3955 -7422
  4. package/dist/mtext-renderer-worker.js +978 -789
  5. package/dist/viewer-runtime.iife.js +3879 -0
  6. package/lib/app/AcApAnnotation.js +4 -4
  7. package/lib/app/AcApAnnotation.js.map +1 -1
  8. package/lib/app/AcApDocManager.d.ts +45 -1
  9. package/lib/app/AcApDocManager.d.ts.map +1 -1
  10. package/lib/app/AcApDocManager.js +127 -10
  11. package/lib/app/AcApDocManager.js.map +1 -1
  12. package/lib/command/AcApZoomCmd.js +3 -3
  13. package/lib/command/AcApZoomCmd.js.map +1 -1
  14. package/lib/command/convert/AcApExportHtmlCmd.d.ts +22 -0
  15. package/lib/command/convert/AcApExportHtmlCmd.d.ts.map +1 -0
  16. package/lib/command/convert/AcApExportHtmlCmd.js +93 -0
  17. package/lib/command/convert/AcApExportHtmlCmd.js.map +1 -0
  18. package/lib/command/convert/AcApHtmlConvertor.d.ts +61 -0
  19. package/lib/command/convert/AcApHtmlConvertor.d.ts.map +1 -0
  20. package/lib/command/convert/AcApHtmlConvertor.js +223 -0
  21. package/lib/command/convert/AcApHtmlConvertor.js.map +1 -0
  22. package/lib/command/convert/AcApHtmlSnapshotBuilder.d.ts +65 -0
  23. package/lib/command/convert/AcApHtmlSnapshotBuilder.d.ts.map +1 -0
  24. package/lib/command/convert/AcApHtmlSnapshotBuilder.js +301 -0
  25. package/lib/command/convert/AcApHtmlSnapshotBuilder.js.map +1 -0
  26. package/lib/command/convert/index.d.ts +3 -0
  27. package/lib/command/convert/index.d.ts.map +1 -1
  28. package/lib/command/convert/index.js +3 -0
  29. package/lib/command/convert/index.js.map +1 -1
  30. package/lib/command/draw/AcApArcCmd.d.ts.map +1 -1
  31. package/lib/command/draw/AcApArcCmd.js +46 -20
  32. package/lib/command/draw/AcApArcCmd.js.map +1 -1
  33. package/lib/command/draw/AcApCircleCmd.d.ts.map +1 -1
  34. package/lib/command/draw/AcApCircleCmd.js +5 -6
  35. package/lib/command/draw/AcApCircleCmd.js.map +1 -1
  36. package/lib/command/draw/AcApEllipseCmd.d.ts.map +1 -1
  37. package/lib/command/draw/AcApEllipseCmd.js +4 -6
  38. package/lib/command/draw/AcApEllipseCmd.js.map +1 -1
  39. package/lib/command/draw/AcApMLineCmd.d.ts.map +1 -1
  40. package/lib/command/draw/AcApMLineCmd.js +4 -7
  41. package/lib/command/draw/AcApMLineCmd.js.map +1 -1
  42. package/lib/command/draw/AcApMTextCmd.d.ts.map +1 -1
  43. package/lib/command/draw/AcApMTextCmd.js +3 -1
  44. package/lib/command/draw/AcApMTextCmd.js.map +1 -1
  45. package/lib/command/draw/AcApPolygonCmd.d.ts.map +1 -1
  46. package/lib/command/draw/AcApPolygonCmd.js +4 -5
  47. package/lib/command/draw/AcApPolygonCmd.js.map +1 -1
  48. package/lib/command/draw/AcApPolylineCmd.d.ts +49 -0
  49. package/lib/command/draw/AcApPolylineCmd.d.ts.map +1 -1
  50. package/lib/command/draw/AcApPolylineCmd.js +200 -18
  51. package/lib/command/draw/AcApPolylineCmd.js.map +1 -1
  52. package/lib/command/draw/AcApRayCmd.d.ts.map +1 -1
  53. package/lib/command/draw/AcApRayCmd.js +2 -3
  54. package/lib/command/draw/AcApRayCmd.js.map +1 -1
  55. package/lib/command/draw/AcApRectCmd.d.ts.map +1 -1
  56. package/lib/command/draw/AcApRectCmd.js +9 -10
  57. package/lib/command/draw/AcApRectCmd.js.map +1 -1
  58. package/lib/command/draw/AcApSplineCmd.d.ts.map +1 -1
  59. package/lib/command/draw/AcApSplineCmd.js +3 -6
  60. package/lib/command/draw/AcApSplineCmd.js.map +1 -1
  61. package/lib/command/draw/AcApXLineCmd.d.ts.map +1 -1
  62. package/lib/command/draw/AcApXLineCmd.js +2 -3
  63. package/lib/command/draw/AcApXLineCmd.js.map +1 -1
  64. package/lib/command/measure/AcApClearMeasurementsCmd.d.ts +11 -0
  65. package/lib/command/measure/AcApClearMeasurementsCmd.d.ts.map +1 -1
  66. package/lib/command/measure/AcApClearMeasurementsCmd.js +15 -4
  67. package/lib/command/measure/AcApClearMeasurementsCmd.js.map +1 -1
  68. package/lib/command/measure/AcApMeasureAngleCmd.d.ts.map +1 -1
  69. package/lib/command/measure/AcApMeasureAngleCmd.js +15 -6
  70. package/lib/command/measure/AcApMeasureAngleCmd.js.map +1 -1
  71. package/lib/command/measure/AcApMeasureArcCmd.d.ts.map +1 -1
  72. package/lib/command/measure/AcApMeasureArcCmd.js +11 -4
  73. package/lib/command/measure/AcApMeasureArcCmd.js.map +1 -1
  74. package/lib/command/measure/AcApMeasureAreaCmd.d.ts.map +1 -1
  75. package/lib/command/measure/AcApMeasureAreaCmd.js +11 -4
  76. package/lib/command/measure/AcApMeasureAreaCmd.js.map +1 -1
  77. package/lib/command/measure/AcApMeasureDistanceCmd.d.ts +3 -2
  78. package/lib/command/measure/AcApMeasureDistanceCmd.d.ts.map +1 -1
  79. package/lib/command/measure/AcApMeasureDistanceCmd.js +14 -6
  80. package/lib/command/measure/AcApMeasureDistanceCmd.js.map +1 -1
  81. package/lib/command/modify/AcApOffsetCmd.d.ts +30 -0
  82. package/lib/command/modify/AcApOffsetCmd.d.ts.map +1 -0
  83. package/lib/command/modify/AcApOffsetCmd.js +424 -0
  84. package/lib/command/modify/AcApOffsetCmd.js.map +1 -0
  85. package/lib/command/modify/AcApRotateCmd.d.ts.map +1 -1
  86. package/lib/command/modify/AcApRotateCmd.js +3 -4
  87. package/lib/command/modify/AcApRotateCmd.js.map +1 -1
  88. package/lib/command/modify/index.d.ts +1 -0
  89. package/lib/command/modify/index.d.ts.map +1 -1
  90. package/lib/command/modify/index.js +1 -0
  91. package/lib/command/modify/index.js.map +1 -1
  92. package/lib/command/review/AcApRevCircleCmd.d.ts.map +1 -1
  93. package/lib/command/review/AcApRevCircleCmd.js +4 -1
  94. package/lib/command/review/AcApRevCircleCmd.js.map +1 -1
  95. package/lib/editor/input/AcEdSelectionFilter.js +7 -6
  96. package/lib/editor/input/AcEdSelectionFilter.js.map +1 -1
  97. package/lib/editor/input/prompt/AcEdPromptDistanceOptions.d.ts.map +1 -1
  98. package/lib/editor/input/prompt/AcEdPromptDistanceOptions.js +1 -1
  99. package/lib/editor/input/prompt/AcEdPromptDistanceOptions.js.map +1 -1
  100. package/lib/editor/input/ui/AcEdFloatingInput.d.ts +9 -0
  101. package/lib/editor/input/ui/AcEdFloatingInput.d.ts.map +1 -1
  102. package/lib/editor/input/ui/AcEdFloatingInput.js +21 -3
  103. package/lib/editor/input/ui/AcEdFloatingInput.js.map +1 -1
  104. package/lib/editor/input/ui/AcEdInputManager.d.ts +25 -6
  105. package/lib/editor/input/ui/AcEdInputManager.d.ts.map +1 -1
  106. package/lib/editor/input/ui/AcEdInputManager.js +119 -39
  107. package/lib/editor/input/ui/AcEdInputManager.js.map +1 -1
  108. package/lib/editor/input/ui/AcEdMTextEditor.d.ts +67 -2
  109. package/lib/editor/input/ui/AcEdMTextEditor.d.ts.map +1 -1
  110. package/lib/editor/input/ui/AcEdMTextEditor.js +210 -19
  111. package/lib/editor/input/ui/AcEdMTextEditor.js.map +1 -1
  112. package/lib/editor/input/ui/AcEdRubberBand.d.ts.map +1 -1
  113. package/lib/editor/input/ui/AcEdRubberBand.js +16 -8
  114. package/lib/editor/input/ui/AcEdRubberBand.js.map +1 -1
  115. package/lib/i18n/en/command.d.ts +64 -10
  116. package/lib/i18n/en/command.d.ts.map +1 -1
  117. package/lib/i18n/en/command.js +67 -13
  118. package/lib/i18n/en/command.js.map +1 -1
  119. package/lib/i18n/en/jig.d.ts +8 -0
  120. package/lib/i18n/en/jig.d.ts.map +1 -1
  121. package/lib/i18n/en/jig.js +8 -0
  122. package/lib/i18n/en/jig.js.map +1 -1
  123. package/lib/i18n/zh/command.d.ts +64 -10
  124. package/lib/i18n/zh/command.d.ts.map +1 -1
  125. package/lib/i18n/zh/command.js +67 -13
  126. package/lib/i18n/zh/command.js.map +1 -1
  127. package/lib/i18n/zh/jig.d.ts +8 -0
  128. package/lib/i18n/zh/jig.d.ts.map +1 -1
  129. package/lib/i18n/zh/jig.js +8 -0
  130. package/lib/i18n/zh/jig.js.map +1 -1
  131. package/lib/index.d.ts +2 -1
  132. package/lib/index.d.ts.map +1 -1
  133. package/lib/index.js +2 -1
  134. package/lib/index.js.map +1 -1
  135. package/lib/util/AcApFontUtil.d.ts +69 -0
  136. package/lib/util/AcApFontUtil.d.ts.map +1 -0
  137. package/lib/util/AcApFontUtil.js +161 -0
  138. package/lib/util/AcApFontUtil.js.map +1 -0
  139. package/lib/util/index.d.ts +2 -0
  140. package/lib/util/index.d.ts.map +1 -1
  141. package/lib/util/index.js +2 -0
  142. package/lib/util/index.js.map +1 -1
  143. package/lib/util/yieldToMain.d.ts +5 -0
  144. package/lib/util/yieldToMain.d.ts.map +1 -0
  145. package/lib/util/yieldToMain.js +11 -0
  146. package/lib/util/yieldToMain.js.map +1 -0
  147. package/lib/view/AcTrLayoutView.d.ts +12 -0
  148. package/lib/view/AcTrLayoutView.d.ts.map +1 -1
  149. package/lib/view/AcTrLayoutView.js +18 -0
  150. package/lib/view/AcTrLayoutView.js.map +1 -1
  151. package/lib/view/AcTrScene.d.ts +38 -6
  152. package/lib/view/AcTrScene.d.ts.map +1 -1
  153. package/lib/view/AcTrScene.js +57 -30
  154. package/lib/view/AcTrScene.js.map +1 -1
  155. package/lib/view/AcTrView2d.d.ts +166 -0
  156. package/lib/view/AcTrView2d.d.ts.map +1 -1
  157. package/lib/view/AcTrView2d.js +586 -53
  158. package/lib/view/AcTrView2d.js.map +1 -1
  159. package/package.json +14 -8
@@ -8,10 +8,10 @@ var P1 = Fc((L) => {
8
8
  (function(n) {
9
9
  n[n.BOTTOM = 0] = "BOTTOM", n[n.MIDDLE = 1] = "MIDDLE", n[n.TOP = 2] = "TOP";
10
10
  })(_t || (_t = {}));
11
- var fe;
11
+ var ce;
12
12
  (function(n) {
13
13
  n[n.DEFAULT = 0] = "DEFAULT", n[n.LEFT = 1] = "LEFT", n[n.RIGHT = 2] = "RIGHT", n[n.CENTER = 3] = "CENTER", n[n.JUSTIFIED = 4] = "JUSTIFIED", n[n.DISTRIBUTED = 5] = "DISTRIBUTED";
14
- })(fe || (fe = {}));
14
+ })(ce || (ce = {}));
15
15
  var At;
16
16
  (function(n) {
17
17
  n[n.NONE = 0] = "NONE", n[n.UNDERLINE = 1] = "UNDERLINE", n[n.OVERLINE = 2] = "OVERLINE", n[n.STRIKE_THROUGH = 4] = "STRIKE_THROUGH";
@@ -22,11 +22,11 @@ var P1 = Fc((L) => {
22
22
  p: "±",
23
23
  "%": "%"
24
24
  }, Tc = {
25
- l: fe.LEFT,
26
- r: fe.RIGHT,
27
- c: fe.CENTER,
28
- j: fe.JUSTIFIED,
29
- d: fe.DISTRIBUTED
25
+ l: ce.LEFT,
26
+ r: ce.RIGHT,
27
+ c: ce.CENTER,
28
+ j: ce.JUSTIFIED,
29
+ d: ce.DISTRIBUTED
30
30
  };
31
31
  function kc(n) {
32
32
  const [e, t, r] = n;
@@ -538,7 +538,7 @@ var P1 = Fc((L) => {
538
538
  break;
539
539
  case "q": {
540
540
  const u = t.get();
541
- for (a = Tc[u] || fe.DEFAULT; t.peek() === ","; )
541
+ for (a = Tc[u] || ce.DEFAULT; t.peek() === ","; )
542
542
  t.consume(1);
543
543
  break;
544
544
  }
@@ -583,11 +583,11 @@ var P1 = Fc((L) => {
583
583
  indent: 0,
584
584
  left: 0,
585
585
  right: 0,
586
- align: fe.DEFAULT,
586
+ align: ce.DEFAULT,
587
587
  tabs: []
588
588
  };
589
589
  const h = {};
590
- return o.indent !== 0 && (h.indent = 0), o.left !== 0 && (h.left = 0), o.right !== 0 && (h.right = 0), o.align !== fe.DEFAULT && (h.align = fe.DEFAULT), JSON.stringify(o.tabs) !== JSON.stringify([]) && (h.tabs = []), h;
590
+ return o.indent !== 0 && (h.indent = 0), o.left !== 0 && (h.left = 0), o.right !== 0 && (h.right = 0), o.align !== ce.DEFAULT && (h.align = ce.DEFAULT), JSON.stringify(o.tabs) !== JSON.stringify([]) && (h.tabs = []), h;
591
591
  }
592
592
  const s = () => {
593
593
  let a = "";
@@ -646,13 +646,13 @@ var P1 = Fc((L) => {
646
646
  const l = f[0];
647
647
  this.scanner.consume(l.length);
648
648
  const p = parseInt(l, 16);
649
- let g = "";
649
+ let d = "";
650
650
  try {
651
- g = String.fromCodePoint(p);
651
+ d = String.fromCodePoint(p);
652
652
  } catch {
653
- g = "▯";
653
+ d = "▯";
654
654
  }
655
- return a ? [e, a] : [e, g];
655
+ return a ? [e, a] : [e, d];
656
656
  }
657
657
  this.scanner.consume(-1);
658
658
  }
@@ -970,7 +970,7 @@ var P1 = Fc((L) => {
970
970
  indent: 0,
971
971
  left: 0,
972
972
  right: 0,
973
- align: fe.DEFAULT,
973
+ align: ce.DEFAULT,
974
974
  tabs: []
975
975
  };
976
976
  }
@@ -1222,7 +1222,7 @@ var P1 = Fc((L) => {
1222
1222
  throw new Error("Invalid component type.");
1223
1223
  }
1224
1224
  }
1225
- function ke(n, e) {
1225
+ function Ee(n, e) {
1226
1226
  switch (e.constructor) {
1227
1227
  case Float32Array:
1228
1228
  return n;
@@ -1495,8 +1495,8 @@ var P1 = Fc((L) => {
1495
1495
  return this.multiplyMatrices(e, this);
1496
1496
  }
1497
1497
  multiplyMatrices(e, t) {
1498
- const r = e.elements, i = t.elements, s = this.elements, a = r[0], o = r[3], h = r[6], c = r[1], u = r[4], f = r[7], l = r[2], p = r[5], g = r[8], m = i[0], x = i[3], v = i[6], w = i[1], b = i[4], S = i[7], T = i[2], B = i[5], M = i[8];
1499
- return s[0] = a * m + o * w + h * T, s[3] = a * x + o * b + h * B, s[6] = a * v + o * S + h * M, s[1] = c * m + u * w + f * T, s[4] = c * x + u * b + f * B, s[7] = c * v + u * S + f * M, s[2] = l * m + p * w + g * T, s[5] = l * x + p * b + g * B, s[8] = l * v + p * S + g * M, this;
1498
+ const r = e.elements, i = t.elements, s = this.elements, a = r[0], o = r[3], h = r[6], c = r[1], u = r[4], f = r[7], l = r[2], p = r[5], d = r[8], m = i[0], x = i[3], v = i[6], w = i[1], b = i[4], S = i[7], T = i[2], B = i[5], M = i[8];
1499
+ return s[0] = a * m + o * w + h * T, s[3] = a * x + o * b + h * B, s[6] = a * v + o * S + h * M, s[1] = c * m + u * w + f * T, s[4] = c * x + u * b + f * B, s[7] = c * v + u * S + f * M, s[2] = l * m + p * w + d * T, s[5] = l * x + p * b + d * B, s[8] = l * v + p * S + d * M, this;
1500
1500
  }
1501
1501
  multiplyScalar(e) {
1502
1502
  const t = this.elements;
@@ -1507,9 +1507,9 @@ var P1 = Fc((L) => {
1507
1507
  return t * a * u - t * o * c - r * s * u + r * o * h + i * s * c - i * a * h;
1508
1508
  }
1509
1509
  invert() {
1510
- const e = this.elements, t = e[0], r = e[1], i = e[2], s = e[3], a = e[4], o = e[5], h = e[6], c = e[7], u = e[8], f = u * a - o * c, l = o * h - u * s, p = c * s - a * h, g = t * f + r * l + i * p;
1511
- if (g === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0);
1512
- const m = 1 / g;
1510
+ const e = this.elements, t = e[0], r = e[1], i = e[2], s = e[3], a = e[4], o = e[5], h = e[6], c = e[7], u = e[8], f = u * a - o * c, l = o * h - u * s, p = c * s - a * h, d = t * f + r * l + i * p;
1511
+ if (d === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0);
1512
+ const m = 1 / d;
1513
1513
  return e[0] = f * m, e[1] = (i * c - u * r) * m, e[2] = (o * r - i * a) * m, e[3] = l * m, e[4] = (u * t - i * h) * m, e[5] = (i * s - o * t) * m, e[6] = p * m, e[7] = (r * h - c * t) * m, e[8] = (a * t - r * s) * m, this;
1514
1514
  }
1515
1515
  transpose() {
@@ -2020,16 +2020,16 @@ var P1 = Fc((L) => {
2020
2020
  }
2021
2021
  setAxisAngleFromRotationMatrix(e) {
2022
2022
  let t, r, i, s;
2023
- const h = e.elements, c = h[0], u = h[4], f = h[8], l = h[1], p = h[5], g = h[9], m = h[2], x = h[6], v = h[10];
2024
- if (Math.abs(u - l) < 0.01 && Math.abs(f - m) < 0.01 && Math.abs(g - x) < 0.01) {
2025
- if (Math.abs(u + l) < 0.1 && Math.abs(f + m) < 0.1 && Math.abs(g + x) < 0.1 && Math.abs(c + p + v - 3) < 0.1)
2023
+ const h = e.elements, c = h[0], u = h[4], f = h[8], l = h[1], p = h[5], d = h[9], m = h[2], x = h[6], v = h[10];
2024
+ if (Math.abs(u - l) < 0.01 && Math.abs(f - m) < 0.01 && Math.abs(d - x) < 0.01) {
2025
+ if (Math.abs(u + l) < 0.1 && Math.abs(f + m) < 0.1 && Math.abs(d + x) < 0.1 && Math.abs(c + p + v - 3) < 0.1)
2026
2026
  return this.set(1, 0, 0, 0), this;
2027
2027
  t = Math.PI;
2028
- const b = (c + 1) / 2, S = (p + 1) / 2, T = (v + 1) / 2, B = (u + l) / 4, M = (f + m) / 4, _ = (g + x) / 4;
2028
+ const b = (c + 1) / 2, S = (p + 1) / 2, T = (v + 1) / 2, B = (u + l) / 4, M = (f + m) / 4, _ = (d + x) / 4;
2029
2029
  return b > S && b > T ? b < 0.01 ? (r = 0, i = 0.707106781, s = 0.707106781) : (r = Math.sqrt(b), i = B / r, s = M / r) : S > T ? S < 0.01 ? (r = 0.707106781, i = 0, s = 0.707106781) : (i = Math.sqrt(S), r = B / i, s = _ / i) : T < 0.01 ? (r = 0.707106781, i = 0.707106781, s = 0) : (s = Math.sqrt(T), r = M / s, i = _ / s), this.set(r, i, s, t), this;
2030
2030
  }
2031
- let w = Math.sqrt((x - g) * (x - g) + (f - m) * (f - m) + (l - u) * (l - u));
2032
- return Math.abs(w) < 1e-3 && (w = 1), this.x = (x - g) / w, this.y = (f - m) / w, this.z = (l - u) / w, this.w = Math.acos((c + p + v - 1) / 2), this;
2031
+ let w = Math.sqrt((x - d) * (x - d) + (f - m) * (f - m) + (l - u) * (l - u));
2032
+ return Math.abs(w) < 1e-3 && (w = 1), this.x = (x - d) / w, this.y = (f - m) / w, this.z = (l - u) / w, this.w = Math.acos((c + p + v - 1) / 2), this;
2033
2033
  }
2034
2034
  setFromMatrixPosition(e) {
2035
2035
  const t = e.elements;
@@ -2115,24 +2115,24 @@ var P1 = Fc((L) => {
2115
2115
  }
2116
2116
  static slerpFlat(e, t, r, i, s, a, o) {
2117
2117
  let h = r[i + 0], c = r[i + 1], u = r[i + 2], f = r[i + 3];
2118
- const l = s[a + 0], p = s[a + 1], g = s[a + 2], m = s[a + 3];
2118
+ const l = s[a + 0], p = s[a + 1], d = s[a + 2], m = s[a + 3];
2119
2119
  if (o === 0) {
2120
2120
  e[t + 0] = h, e[t + 1] = c, e[t + 2] = u, e[t + 3] = f;
2121
2121
  return;
2122
2122
  }
2123
2123
  if (o === 1) {
2124
- e[t + 0] = l, e[t + 1] = p, e[t + 2] = g, e[t + 3] = m;
2124
+ e[t + 0] = l, e[t + 1] = p, e[t + 2] = d, e[t + 3] = m;
2125
2125
  return;
2126
2126
  }
2127
- if (f !== m || h !== l || c !== p || u !== g) {
2127
+ if (f !== m || h !== l || c !== p || u !== d) {
2128
2128
  let x = 1 - o;
2129
- const v = h * l + c * p + u * g + f * m, w = v >= 0 ? 1 : -1, b = 1 - v * v;
2129
+ const v = h * l + c * p + u * d + f * m, w = v >= 0 ? 1 : -1, b = 1 - v * v;
2130
2130
  if (b > Number.EPSILON) {
2131
2131
  const T = Math.sqrt(b), B = Math.atan2(T, v * w);
2132
2132
  x = Math.sin(x * B) / T, o = Math.sin(o * B) / T;
2133
2133
  }
2134
2134
  const S = o * w;
2135
- if (h = h * x + l * S, c = c * x + p * S, u = u * x + g * S, f = f * x + m * S, x === 1 - o) {
2135
+ if (h = h * x + l * S, c = c * x + p * S, u = u * x + d * S, f = f * x + m * S, x === 1 - o) {
2136
2136
  const T = 1 / Math.sqrt(h * h + c * c + u * u + f * f);
2137
2137
  h *= T, c *= T, u *= T, f *= T;
2138
2138
  }
@@ -2140,8 +2140,8 @@ var P1 = Fc((L) => {
2140
2140
  e[t] = h, e[t + 1] = c, e[t + 2] = u, e[t + 3] = f;
2141
2141
  }
2142
2142
  static multiplyQuaternionsFlat(e, t, r, i, s, a) {
2143
- const o = r[i], h = r[i + 1], c = r[i + 2], u = r[i + 3], f = s[a], l = s[a + 1], p = s[a + 2], g = s[a + 3];
2144
- return e[t] = o * g + u * f + h * p - c * l, e[t + 1] = h * g + u * l + c * f - o * p, e[t + 2] = c * g + u * p + o * l - h * f, e[t + 3] = u * g - o * f - h * l - c * p, e;
2143
+ const o = r[i], h = r[i + 1], c = r[i + 2], u = r[i + 3], f = s[a], l = s[a + 1], p = s[a + 2], d = s[a + 3];
2144
+ return e[t] = o * d + u * f + h * p - c * l, e[t + 1] = h * d + u * l + c * f - o * p, e[t + 2] = c * d + u * p + o * l - h * f, e[t + 3] = u * d - o * f - h * l - c * p, e;
2145
2145
  }
2146
2146
  get x() {
2147
2147
  return this._x;
@@ -2177,25 +2177,25 @@ var P1 = Fc((L) => {
2177
2177
  return this._x = e.x, this._y = e.y, this._z = e.z, this._w = e.w, this._onChangeCallback(), this;
2178
2178
  }
2179
2179
  setFromEuler(e, t = !0) {
2180
- const r = e._x, i = e._y, s = e._z, a = e._order, o = Math.cos, h = Math.sin, c = o(r / 2), u = o(i / 2), f = o(s / 2), l = h(r / 2), p = h(i / 2), g = h(s / 2);
2180
+ const r = e._x, i = e._y, s = e._z, a = e._order, o = Math.cos, h = Math.sin, c = o(r / 2), u = o(i / 2), f = o(s / 2), l = h(r / 2), p = h(i / 2), d = h(s / 2);
2181
2181
  switch (a) {
2182
2182
  case "XYZ":
2183
- this._x = l * u * f + c * p * g, this._y = c * p * f - l * u * g, this._z = c * u * g + l * p * f, this._w = c * u * f - l * p * g;
2183
+ this._x = l * u * f + c * p * d, this._y = c * p * f - l * u * d, this._z = c * u * d + l * p * f, this._w = c * u * f - l * p * d;
2184
2184
  break;
2185
2185
  case "YXZ":
2186
- this._x = l * u * f + c * p * g, this._y = c * p * f - l * u * g, this._z = c * u * g - l * p * f, this._w = c * u * f + l * p * g;
2186
+ this._x = l * u * f + c * p * d, this._y = c * p * f - l * u * d, this._z = c * u * d - l * p * f, this._w = c * u * f + l * p * d;
2187
2187
  break;
2188
2188
  case "ZXY":
2189
- this._x = l * u * f - c * p * g, this._y = c * p * f + l * u * g, this._z = c * u * g + l * p * f, this._w = c * u * f - l * p * g;
2189
+ this._x = l * u * f - c * p * d, this._y = c * p * f + l * u * d, this._z = c * u * d + l * p * f, this._w = c * u * f - l * p * d;
2190
2190
  break;
2191
2191
  case "ZYX":
2192
- this._x = l * u * f - c * p * g, this._y = c * p * f + l * u * g, this._z = c * u * g - l * p * f, this._w = c * u * f + l * p * g;
2192
+ this._x = l * u * f - c * p * d, this._y = c * p * f + l * u * d, this._z = c * u * d - l * p * f, this._w = c * u * f + l * p * d;
2193
2193
  break;
2194
2194
  case "YZX":
2195
- this._x = l * u * f + c * p * g, this._y = c * p * f + l * u * g, this._z = c * u * g - l * p * f, this._w = c * u * f - l * p * g;
2195
+ this._x = l * u * f + c * p * d, this._y = c * p * f + l * u * d, this._z = c * u * d - l * p * f, this._w = c * u * f - l * p * d;
2196
2196
  break;
2197
2197
  case "XZY":
2198
- this._x = l * u * f - c * p * g, this._y = c * p * f - l * u * g, this._z = c * u * g + l * p * f, this._w = c * u * f + l * p * g;
2198
+ this._x = l * u * f - c * p * d, this._y = c * p * f - l * u * d, this._z = c * u * d + l * p * f, this._w = c * u * f + l * p * d;
2199
2199
  break;
2200
2200
  default:
2201
2201
  console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: " + a);
@@ -2587,7 +2587,7 @@ var P1 = Fc((L) => {
2587
2587
  }
2588
2588
  }
2589
2589
  const xi = /* @__PURE__ */ new E(), ma = /* @__PURE__ */ new zt();
2590
- class Ee {
2590
+ class ke {
2591
2591
  constructor(e = new E(1 / 0, 1 / 0, 1 / 0), t = new E(-1 / 0, -1 / 0, -1 / 0)) {
2592
2592
  this.isBox3 = !0, this.min = e, this.max = t;
2593
2593
  }
@@ -2754,7 +2754,7 @@ var P1 = Fc((L) => {
2754
2754
  /* @__PURE__ */ new E(),
2755
2755
  /* @__PURE__ */ new E(),
2756
2756
  /* @__PURE__ */ new E()
2757
- ], He = /* @__PURE__ */ new E(), dn = /* @__PURE__ */ new Ee(), nr = /* @__PURE__ */ new E(), ir = /* @__PURE__ */ new E(), sr = /* @__PURE__ */ new E(), bt = /* @__PURE__ */ new E(), wt = /* @__PURE__ */ new E(), Gt = /* @__PURE__ */ new E(), Ar = /* @__PURE__ */ new E(), gn = /* @__PURE__ */ new E(), yn = /* @__PURE__ */ new E(), Ht = /* @__PURE__ */ new E();
2757
+ ], He = /* @__PURE__ */ new E(), dn = /* @__PURE__ */ new ke(), nr = /* @__PURE__ */ new E(), ir = /* @__PURE__ */ new E(), sr = /* @__PURE__ */ new E(), bt = /* @__PURE__ */ new E(), wt = /* @__PURE__ */ new E(), Gt = /* @__PURE__ */ new E(), Ar = /* @__PURE__ */ new E(), gn = /* @__PURE__ */ new E(), yn = /* @__PURE__ */ new E(), Ht = /* @__PURE__ */ new E();
2758
2758
  function bi(n, e, t, r, i) {
2759
2759
  for (let s = 0, a = n.length - 3; s <= a; s += 3) {
2760
2760
  Ht.fromArray(n, s);
@@ -2764,7 +2764,7 @@ var P1 = Fc((L) => {
2764
2764
  }
2765
2765
  return !0;
2766
2766
  }
2767
- const Yc = /* @__PURE__ */ new Ee(), Mr = /* @__PURE__ */ new E(), wi = /* @__PURE__ */ new E();
2767
+ const Yc = /* @__PURE__ */ new ke(), Mr = /* @__PURE__ */ new E(), wi = /* @__PURE__ */ new E();
2768
2768
  class Bs {
2769
2769
  constructor(e = new E(), t = -1) {
2770
2770
  this.isSphere = !0, this.center = e, this.radius = t;
@@ -2874,11 +2874,11 @@ var P1 = Fc((L) => {
2874
2874
  distanceSqToSegment(e, t, r, i) {
2875
2875
  Si.copy(e).add(t).multiplyScalar(0.5), mn.copy(t).sub(e).normalize(), St.copy(this.origin).sub(Si);
2876
2876
  const s = e.distanceTo(t) * 0.5, a = -this.direction.dot(mn), o = St.dot(this.direction), h = -St.dot(mn), c = St.lengthSq(), u = Math.abs(1 - a * a);
2877
- let f, l, p, g;
2877
+ let f, l, p, d;
2878
2878
  if (u > 0)
2879
- if (f = a * h - o, l = a * o - h, g = s * u, f >= 0)
2880
- if (l >= -g)
2881
- if (l <= g) {
2879
+ if (f = a * h - o, l = a * o - h, d = s * u, f >= 0)
2880
+ if (l >= -d)
2881
+ if (l <= d) {
2882
2882
  const m = 1 / u;
2883
2883
  f *= m, l *= m, p = f * (f + a * l + 2 * o) + l * (a * f + l + 2 * h) + c;
2884
2884
  } else
@@ -2886,7 +2886,7 @@ var P1 = Fc((L) => {
2886
2886
  else
2887
2887
  l = -s, f = Math.max(0, -(a * l + o)), p = -f * f + l * (l + 2 * h) + c;
2888
2888
  else
2889
- l <= -g ? (f = Math.max(0, -(-a * s + o)), l = f > 0 ? -s : Math.min(Math.max(-s, -h), s), p = -f * f + l * (l + 2 * h) + c) : l <= g ? (f = 0, l = Math.min(Math.max(-s, -h), s), p = l * (l + 2 * h) + c) : (f = Math.max(0, -(a * s + o)), l = f > 0 ? s : Math.min(Math.max(-s, -h), s), p = -f * f + l * (l + 2 * h) + c);
2889
+ l <= -d ? (f = Math.max(0, -(-a * s + o)), l = f > 0 ? -s : Math.min(Math.max(-s, -h), s), p = -f * f + l * (l + 2 * h) + c) : l <= d ? (f = 0, l = Math.min(Math.max(-s, -h), s), p = l * (l + 2 * h) + c) : (f = Math.max(0, -(a * s + o)), l = f > 0 ? s : Math.min(Math.max(-s, -h), s), p = -f * f + l * (l + 2 * h) + c);
2890
2890
  else
2891
2891
  l = a > 0 ? -s : s, f = Math.max(0, -(a * l + o)), p = -f * f + l * (l + 2 * h) + c;
2892
2892
  return r && r.copy(this.origin).addScaledVector(this.direction, f), i && i.copy(Si).addScaledVector(mn, l), p;
@@ -2955,7 +2955,7 @@ var P1 = Fc((L) => {
2955
2955
  }
2956
2956
  }
2957
2957
  class Fe {
2958
- constructor(e, t, r, i, s, a, o, h, c, u, f, l, p, g, m, x) {
2958
+ constructor(e, t, r, i, s, a, o, h, c, u, f, l, p, d, m, x) {
2959
2959
  Fe.prototype.isMatrix4 = !0, this.elements = [
2960
2960
  1,
2961
2961
  0,
@@ -2973,11 +2973,11 @@ var P1 = Fc((L) => {
2973
2973
  0,
2974
2974
  0,
2975
2975
  1
2976
- ], e !== void 0 && this.set(e, t, r, i, s, a, o, h, c, u, f, l, p, g, m, x);
2976
+ ], e !== void 0 && this.set(e, t, r, i, s, a, o, h, c, u, f, l, p, d, m, x);
2977
2977
  }
2978
- set(e, t, r, i, s, a, o, h, c, u, f, l, p, g, m, x) {
2978
+ set(e, t, r, i, s, a, o, h, c, u, f, l, p, d, m, x) {
2979
2979
  const v = this.elements;
2980
- return v[0] = e, v[4] = t, v[8] = r, v[12] = i, v[1] = s, v[5] = a, v[9] = o, v[13] = h, v[2] = c, v[6] = u, v[10] = f, v[14] = l, v[3] = p, v[7] = g, v[11] = m, v[15] = x, this;
2980
+ return v[0] = e, v[4] = t, v[8] = r, v[12] = i, v[1] = s, v[5] = a, v[9] = o, v[13] = h, v[2] = c, v[6] = u, v[10] = f, v[14] = l, v[3] = p, v[7] = d, v[11] = m, v[15] = x, this;
2981
2981
  }
2982
2982
  identity() {
2983
2983
  return this.set(
@@ -3061,23 +3061,23 @@ var P1 = Fc((L) => {
3061
3061
  makeRotationFromEuler(e) {
3062
3062
  const t = this.elements, r = e.x, i = e.y, s = e.z, a = Math.cos(r), o = Math.sin(r), h = Math.cos(i), c = Math.sin(i), u = Math.cos(s), f = Math.sin(s);
3063
3063
  if (e.order === "XYZ") {
3064
- const l = a * u, p = a * f, g = o * u, m = o * f;
3065
- t[0] = h * u, t[4] = -h * f, t[8] = c, t[1] = p + g * c, t[5] = l - m * c, t[9] = -o * h, t[2] = m - l * c, t[6] = g + p * c, t[10] = a * h;
3064
+ const l = a * u, p = a * f, d = o * u, m = o * f;
3065
+ t[0] = h * u, t[4] = -h * f, t[8] = c, t[1] = p + d * c, t[5] = l - m * c, t[9] = -o * h, t[2] = m - l * c, t[6] = d + p * c, t[10] = a * h;
3066
3066
  } else if (e.order === "YXZ") {
3067
- const l = h * u, p = h * f, g = c * u, m = c * f;
3068
- t[0] = l + m * o, t[4] = g * o - p, t[8] = a * c, t[1] = a * f, t[5] = a * u, t[9] = -o, t[2] = p * o - g, t[6] = m + l * o, t[10] = a * h;
3067
+ const l = h * u, p = h * f, d = c * u, m = c * f;
3068
+ t[0] = l + m * o, t[4] = d * o - p, t[8] = a * c, t[1] = a * f, t[5] = a * u, t[9] = -o, t[2] = p * o - d, t[6] = m + l * o, t[10] = a * h;
3069
3069
  } else if (e.order === "ZXY") {
3070
- const l = h * u, p = h * f, g = c * u, m = c * f;
3071
- t[0] = l - m * o, t[4] = -a * f, t[8] = g + p * o, t[1] = p + g * o, t[5] = a * u, t[9] = m - l * o, t[2] = -a * c, t[6] = o, t[10] = a * h;
3070
+ const l = h * u, p = h * f, d = c * u, m = c * f;
3071
+ t[0] = l - m * o, t[4] = -a * f, t[8] = d + p * o, t[1] = p + d * o, t[5] = a * u, t[9] = m - l * o, t[2] = -a * c, t[6] = o, t[10] = a * h;
3072
3072
  } else if (e.order === "ZYX") {
3073
- const l = a * u, p = a * f, g = o * u, m = o * f;
3074
- t[0] = h * u, t[4] = g * c - p, t[8] = l * c + m, t[1] = h * f, t[5] = m * c + l, t[9] = p * c - g, t[2] = -c, t[6] = o * h, t[10] = a * h;
3073
+ const l = a * u, p = a * f, d = o * u, m = o * f;
3074
+ t[0] = h * u, t[4] = d * c - p, t[8] = l * c + m, t[1] = h * f, t[5] = m * c + l, t[9] = p * c - d, t[2] = -c, t[6] = o * h, t[10] = a * h;
3075
3075
  } else if (e.order === "YZX") {
3076
- const l = a * h, p = a * c, g = o * h, m = o * c;
3077
- t[0] = h * u, t[4] = m - l * f, t[8] = g * f + p, t[1] = f, t[5] = a * u, t[9] = -o * u, t[2] = -c * u, t[6] = p * f + g, t[10] = l - m * f;
3076
+ const l = a * h, p = a * c, d = o * h, m = o * c;
3077
+ t[0] = h * u, t[4] = m - l * f, t[8] = d * f + p, t[1] = f, t[5] = a * u, t[9] = -o * u, t[2] = -c * u, t[6] = p * f + d, t[10] = l - m * f;
3078
3078
  } else if (e.order === "XZY") {
3079
- const l = a * h, p = a * c, g = o * h, m = o * c;
3080
- t[0] = h * u, t[4] = -f, t[8] = c * u, t[1] = l * f + m, t[5] = a * u, t[9] = p * f - g, t[2] = g * f - p, t[6] = o * u, t[10] = m * f + l;
3079
+ const l = a * h, p = a * c, d = o * h, m = o * c;
3080
+ t[0] = h * u, t[4] = -f, t[8] = c * u, t[1] = l * f + m, t[5] = a * u, t[9] = p * f - d, t[2] = d * f - p, t[6] = o * u, t[10] = m * f + l;
3081
3081
  }
3082
3082
  return t[3] = 0, t[7] = 0, t[11] = 0, t[12] = 0, t[13] = 0, t[14] = 0, t[15] = 1, this;
3083
3083
  }
@@ -3095,16 +3095,16 @@ var P1 = Fc((L) => {
3095
3095
  return this.multiplyMatrices(e, this);
3096
3096
  }
3097
3097
  multiplyMatrices(e, t) {
3098
- const r = e.elements, i = t.elements, s = this.elements, a = r[0], o = r[4], h = r[8], c = r[12], u = r[1], f = r[5], l = r[9], p = r[13], g = r[2], m = r[6], x = r[10], v = r[14], w = r[3], b = r[7], S = r[11], T = r[15], B = i[0], M = i[4], _ = i[8], D = i[12], N = i[1], G = i[5], ee = i[9], Y = i[13], Z = i[2], Q = i[6], K = i[10], ne = i[14], ae = i[3], ie = i[7], he = i[11], W = i[15];
3099
- return s[0] = a * B + o * N + h * Z + c * ae, s[4] = a * M + o * G + h * Q + c * ie, s[8] = a * _ + o * ee + h * K + c * he, s[12] = a * D + o * Y + h * ne + c * W, s[1] = u * B + f * N + l * Z + p * ae, s[5] = u * M + f * G + l * Q + p * ie, s[9] = u * _ + f * ee + l * K + p * he, s[13] = u * D + f * Y + l * ne + p * W, s[2] = g * B + m * N + x * Z + v * ae, s[6] = g * M + m * G + x * Q + v * ie, s[10] = g * _ + m * ee + x * K + v * he, s[14] = g * D + m * Y + x * ne + v * W, s[3] = w * B + b * N + S * Z + T * ae, s[7] = w * M + b * G + S * Q + T * ie, s[11] = w * _ + b * ee + S * K + T * he, s[15] = w * D + b * Y + S * ne + T * W, this;
3098
+ const r = e.elements, i = t.elements, s = this.elements, a = r[0], o = r[4], h = r[8], c = r[12], u = r[1], f = r[5], l = r[9], p = r[13], d = r[2], m = r[6], x = r[10], v = r[14], w = r[3], b = r[7], S = r[11], T = r[15], B = i[0], M = i[4], _ = i[8], D = i[12], N = i[1], G = i[5], ee = i[9], Y = i[13], Z = i[2], Q = i[6], K = i[10], ne = i[14], ae = i[3], ie = i[7], he = i[11], W = i[15];
3099
+ return s[0] = a * B + o * N + h * Z + c * ae, s[4] = a * M + o * G + h * Q + c * ie, s[8] = a * _ + o * ee + h * K + c * he, s[12] = a * D + o * Y + h * ne + c * W, s[1] = u * B + f * N + l * Z + p * ae, s[5] = u * M + f * G + l * Q + p * ie, s[9] = u * _ + f * ee + l * K + p * he, s[13] = u * D + f * Y + l * ne + p * W, s[2] = d * B + m * N + x * Z + v * ae, s[6] = d * M + m * G + x * Q + v * ie, s[10] = d * _ + m * ee + x * K + v * he, s[14] = d * D + m * Y + x * ne + v * W, s[3] = w * B + b * N + S * Z + T * ae, s[7] = w * M + b * G + S * Q + T * ie, s[11] = w * _ + b * ee + S * K + T * he, s[15] = w * D + b * Y + S * ne + T * W, this;
3100
3100
  }
3101
3101
  multiplyScalar(e) {
3102
3102
  const t = this.elements;
3103
3103
  return t[0] *= e, t[4] *= e, t[8] *= e, t[12] *= e, t[1] *= e, t[5] *= e, t[9] *= e, t[13] *= e, t[2] *= e, t[6] *= e, t[10] *= e, t[14] *= e, t[3] *= e, t[7] *= e, t[11] *= e, t[15] *= e, this;
3104
3104
  }
3105
3105
  determinant() {
3106
- const e = this.elements, t = e[0], r = e[4], i = e[8], s = e[12], a = e[1], o = e[5], h = e[9], c = e[13], u = e[2], f = e[6], l = e[10], p = e[14], g = e[3], m = e[7], x = e[11], v = e[15];
3107
- return g * (+s * h * f - i * c * f - s * o * l + r * c * l + i * o * p - r * h * p) + m * (+t * h * p - t * c * l + s * a * l - i * a * p + i * c * u - s * h * u) + x * (+t * c * f - t * o * p - s * a * f + r * a * p + s * o * u - r * c * u) + v * (-i * o * u - t * h * f + t * o * l + i * a * f - r * a * l + r * h * u);
3106
+ const e = this.elements, t = e[0], r = e[4], i = e[8], s = e[12], a = e[1], o = e[5], h = e[9], c = e[13], u = e[2], f = e[6], l = e[10], p = e[14], d = e[3], m = e[7], x = e[11], v = e[15];
3107
+ return d * (+s * h * f - i * c * f - s * o * l + r * c * l + i * o * p - r * h * p) + m * (+t * h * p - t * c * l + s * a * l - i * a * p + i * c * u - s * h * u) + x * (+t * c * f - t * o * p - s * a * f + r * a * p + s * o * u - r * c * u) + v * (-i * o * u - t * h * f + t * o * l + i * a * f - r * a * l + r * h * u);
3108
3108
  }
3109
3109
  transpose() {
3110
3110
  const e = this.elements;
@@ -3116,10 +3116,10 @@ var P1 = Fc((L) => {
3116
3116
  return e.isVector3 ? (i[12] = e.x, i[13] = e.y, i[14] = e.z) : (i[12] = e, i[13] = t, i[14] = r), this;
3117
3117
  }
3118
3118
  invert() {
3119
- const e = this.elements, t = e[0], r = e[1], i = e[2], s = e[3], a = e[4], o = e[5], h = e[6], c = e[7], u = e[8], f = e[9], l = e[10], p = e[11], g = e[12], m = e[13], x = e[14], v = e[15], w = f * x * c - m * l * c + m * h * p - o * x * p - f * h * v + o * l * v, b = g * l * c - u * x * c - g * h * p + a * x * p + u * h * v - a * l * v, S = u * m * c - g * f * c + g * o * p - a * m * p - u * o * v + a * f * v, T = g * f * h - u * m * h - g * o * l + a * m * l + u * o * x - a * f * x, B = t * w + r * b + i * S + s * T;
3119
+ const e = this.elements, t = e[0], r = e[1], i = e[2], s = e[3], a = e[4], o = e[5], h = e[6], c = e[7], u = e[8], f = e[9], l = e[10], p = e[11], d = e[12], m = e[13], x = e[14], v = e[15], w = f * x * c - m * l * c + m * h * p - o * x * p - f * h * v + o * l * v, b = d * l * c - u * x * c - d * h * p + a * x * p + u * h * v - a * l * v, S = u * m * c - d * f * c + d * o * p - a * m * p - u * o * v + a * f * v, T = d * f * h - u * m * h - d * o * l + a * m * l + u * o * x - a * f * x, B = t * w + r * b + i * S + s * T;
3120
3120
  if (B === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
3121
3121
  const M = 1 / B;
3122
- return e[0] = w * M, e[1] = (m * l * s - f * x * s - m * i * p + r * x * p + f * i * v - r * l * v) * M, e[2] = (o * x * s - m * h * s + m * i * c - r * x * c - o * i * v + r * h * v) * M, e[3] = (f * h * s - o * l * s - f * i * c + r * l * c + o * i * p - r * h * p) * M, e[4] = b * M, e[5] = (u * x * s - g * l * s + g * i * p - t * x * p - u * i * v + t * l * v) * M, e[6] = (g * h * s - a * x * s - g * i * c + t * x * c + a * i * v - t * h * v) * M, e[7] = (a * l * s - u * h * s + u * i * c - t * l * c - a * i * p + t * h * p) * M, e[8] = S * M, e[9] = (g * f * s - u * m * s - g * r * p + t * m * p + u * r * v - t * f * v) * M, e[10] = (a * m * s - g * o * s + g * r * c - t * m * c - a * r * v + t * o * v) * M, e[11] = (u * o * s - a * f * s - u * r * c + t * f * c + a * r * p - t * o * p) * M, e[12] = T * M, e[13] = (u * m * i - g * f * i + g * r * l - t * m * l - u * r * x + t * f * x) * M, e[14] = (g * o * i - a * m * i - g * r * h + t * m * h + a * r * x - t * o * x) * M, e[15] = (a * f * i - u * o * i + u * r * h - t * f * h - a * r * l + t * o * l) * M, this;
3122
+ return e[0] = w * M, e[1] = (m * l * s - f * x * s - m * i * p + r * x * p + f * i * v - r * l * v) * M, e[2] = (o * x * s - m * h * s + m * i * c - r * x * c - o * i * v + r * h * v) * M, e[3] = (f * h * s - o * l * s - f * i * c + r * l * c + o * i * p - r * h * p) * M, e[4] = b * M, e[5] = (u * x * s - d * l * s + d * i * p - t * x * p - u * i * v + t * l * v) * M, e[6] = (d * h * s - a * x * s - d * i * c + t * x * c + a * i * v - t * h * v) * M, e[7] = (a * l * s - u * h * s + u * i * c - t * l * c - a * i * p + t * h * p) * M, e[8] = S * M, e[9] = (d * f * s - u * m * s - d * r * p + t * m * p + u * r * v - t * f * v) * M, e[10] = (a * m * s - d * o * s + d * r * c - t * m * c - a * r * v + t * o * v) * M, e[11] = (u * o * s - a * f * s - u * r * c + t * f * c + a * r * p - t * o * p) * M, e[12] = T * M, e[13] = (u * m * i - d * f * i + d * r * l - t * m * l - u * r * x + t * f * x) * M, e[14] = (d * o * i - a * m * i - d * r * h + t * m * h + a * r * x - t * o * x) * M, e[15] = (a * f * i - u * o * i + u * r * h - t * f * h - a * r * l + t * o * l) * M, this;
3123
3123
  }
3124
3124
  scale(e) {
3125
3125
  const t = this.elements, r = e.x, i = e.y, s = e.z;
@@ -3291,8 +3291,8 @@ var P1 = Fc((L) => {
3291
3291
  ), this;
3292
3292
  }
3293
3293
  compose(e, t, r) {
3294
- const i = this.elements, s = t._x, a = t._y, o = t._z, h = t._w, c = s + s, u = a + a, f = o + o, l = s * c, p = s * u, g = s * f, m = a * u, x = a * f, v = o * f, w = h * c, b = h * u, S = h * f, T = r.x, B = r.y, M = r.z;
3295
- return i[0] = (1 - (m + v)) * T, i[1] = (p + S) * T, i[2] = (g - b) * T, i[3] = 0, i[4] = (p - S) * B, i[5] = (1 - (l + v)) * B, i[6] = (x + w) * B, i[7] = 0, i[8] = (g + b) * M, i[9] = (x - w) * M, i[10] = (1 - (l + m)) * M, i[11] = 0, i[12] = e.x, i[13] = e.y, i[14] = e.z, i[15] = 1, this;
3294
+ const i = this.elements, s = t._x, a = t._y, o = t._z, h = t._w, c = s + s, u = a + a, f = o + o, l = s * c, p = s * u, d = s * f, m = a * u, x = a * f, v = o * f, w = h * c, b = h * u, S = h * f, T = r.x, B = r.y, M = r.z;
3295
+ return i[0] = (1 - (m + v)) * T, i[1] = (p + S) * T, i[2] = (d - b) * T, i[3] = 0, i[4] = (p - S) * B, i[5] = (1 - (l + v)) * B, i[6] = (x + w) * B, i[7] = 0, i[8] = (d + b) * M, i[9] = (x - w) * M, i[10] = (1 - (l + m)) * M, i[11] = 0, i[12] = e.x, i[13] = e.y, i[14] = e.z, i[15] = 1, this;
3296
3296
  }
3297
3297
  decompose(e, t, r) {
3298
3298
  const i = this.elements;
@@ -3304,25 +3304,25 @@ var P1 = Fc((L) => {
3304
3304
  }
3305
3305
  makePerspective(e, t, r, i, s, a, o = pn) {
3306
3306
  const h = this.elements, c = 2 * s / (t - e), u = 2 * s / (r - i), f = (t + e) / (t - e), l = (r + i) / (r - i);
3307
- let p, g;
3307
+ let p, d;
3308
3308
  if (o === pn)
3309
- p = -(a + s) / (a - s), g = -2 * a * s / (a - s);
3309
+ p = -(a + s) / (a - s), d = -2 * a * s / (a - s);
3310
3310
  else if (o === pa)
3311
- p = -a / (a - s), g = -a * s / (a - s);
3311
+ p = -a / (a - s), d = -a * s / (a - s);
3312
3312
  else
3313
3313
  throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: " + o);
3314
- return h[0] = c, h[4] = 0, h[8] = f, h[12] = 0, h[1] = 0, h[5] = u, h[9] = l, h[13] = 0, h[2] = 0, h[6] = 0, h[10] = p, h[14] = g, h[3] = 0, h[7] = 0, h[11] = -1, h[15] = 0, this;
3314
+ return h[0] = c, h[4] = 0, h[8] = f, h[12] = 0, h[1] = 0, h[5] = u, h[9] = l, h[13] = 0, h[2] = 0, h[6] = 0, h[10] = p, h[14] = d, h[3] = 0, h[7] = 0, h[11] = -1, h[15] = 0, this;
3315
3315
  }
3316
3316
  makeOrthographic(e, t, r, i, s, a, o = pn) {
3317
3317
  const h = this.elements, c = 1 / (t - e), u = 1 / (r - i), f = 1 / (a - s), l = (t + e) * c, p = (r + i) * u;
3318
- let g, m;
3318
+ let d, m;
3319
3319
  if (o === pn)
3320
- g = (a + s) * f, m = -2 * f;
3320
+ d = (a + s) * f, m = -2 * f;
3321
3321
  else if (o === pa)
3322
- g = s * f, m = -1 * f;
3322
+ d = s * f, m = -1 * f;
3323
3323
  else
3324
3324
  throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: " + o);
3325
- return h[0] = 2 * c, h[4] = 0, h[8] = 0, h[12] = -l, h[1] = 0, h[5] = 2 * u, h[9] = 0, h[13] = -p, h[2] = 0, h[6] = 0, h[10] = m, h[14] = -g, h[3] = 0, h[7] = 0, h[11] = 0, h[15] = 1, this;
3325
+ return h[0] = 2 * c, h[4] = 0, h[8] = 0, h[12] = -l, h[1] = 0, h[5] = 2 * u, h[9] = 0, h[13] = -p, h[2] = 0, h[6] = 0, h[10] = m, h[14] = -d, h[3] = 0, h[7] = 0, h[11] = 0, h[15] = 1, this;
3326
3326
  }
3327
3327
  equals(e) {
3328
3328
  const t = this.elements, r = e.elements;
@@ -3735,8 +3735,8 @@ var P1 = Fc((L) => {
3735
3735
  }
3736
3736
  }
3737
3737
  if (t) {
3738
- const o = a(e.geometries), h = a(e.materials), c = a(e.textures), u = a(e.images), f = a(e.shapes), l = a(e.skeletons), p = a(e.animations), g = a(e.nodes);
3739
- o.length > 0 && (r.geometries = o), h.length > 0 && (r.materials = h), c.length > 0 && (r.textures = c), u.length > 0 && (r.images = u), f.length > 0 && (r.shapes = f), l.length > 0 && (r.skeletons = l), p.length > 0 && (r.animations = p), g.length > 0 && (r.nodes = g);
3738
+ const o = a(e.geometries), h = a(e.materials), c = a(e.textures), u = a(e.images), f = a(e.shapes), l = a(e.skeletons), p = a(e.animations), d = a(e.nodes);
3739
+ o.length > 0 && (r.geometries = o), h.length > 0 && (r.materials = h), c.length > 0 && (r.textures = c), u.length > 0 && (r.images = u), f.length > 0 && (r.shapes = f), l.length > 0 && (r.skeletons = l), p.length > 0 && (r.animations = p), d.length > 0 && (r.nodes = d);
3740
3740
  }
3741
3741
  return r.object = i, r;
3742
3742
  function a(o) {
@@ -3780,8 +3780,8 @@ var P1 = Fc((L) => {
3780
3780
  const a = Ve.dot(Ve), o = Ve.dot(ct), h = Ve.dot(ki), c = ct.dot(ct), u = ct.dot(ki), f = a * c - o * o;
3781
3781
  if (f === 0)
3782
3782
  return s.set(0, 0, 0), null;
3783
- const l = 1 / f, p = (c * h - o * u) * l, g = (a * u - o * h) * l;
3784
- return s.set(1 - p - g, g, p);
3783
+ const l = 1 / f, p = (c * h - o * u) * l, d = (a * u - o * h) * l;
3784
+ return s.set(1 - p - d, d, p);
3785
3785
  }
3786
3786
  static containsPoint(e, t, r, i) {
3787
3787
  return this.getBarycoord(e, t, r, i, ut) === null ? !1 : ut.x >= 0 && ut.y >= 0 && ut.x + ut.y <= 1;
@@ -3852,15 +3852,15 @@ var P1 = Fc((L) => {
3852
3852
  if (l <= 0 && h >= 0 && u <= 0)
3853
3853
  return a = h / (h - u), t.copy(r).addScaledVector(cr, a);
3854
3854
  Mi.subVectors(e, s);
3855
- const p = cr.dot(Mi), g = ur.dot(Mi);
3856
- if (g >= 0 && p <= g)
3855
+ const p = cr.dot(Mi), d = ur.dot(Mi);
3856
+ if (d >= 0 && p <= d)
3857
3857
  return t.copy(s);
3858
- const m = p * c - h * g;
3859
- if (m <= 0 && c >= 0 && g <= 0)
3860
- return o = c / (c - g), t.copy(r).addScaledVector(ur, o);
3861
- const x = u * g - p * f;
3862
- if (x <= 0 && f - u >= 0 && p - g >= 0)
3863
- return Ta.subVectors(s, i), o = (f - u) / (f - u + (p - g)), t.copy(i).addScaledVector(Ta, o);
3858
+ const m = p * c - h * d;
3859
+ if (m <= 0 && c >= 0 && d <= 0)
3860
+ return o = c / (c - d), t.copy(r).addScaledVector(ur, o);
3861
+ const x = u * d - p * f;
3862
+ if (x <= 0 && f - u >= 0 && p - d >= 0)
3863
+ return Ta.subVectors(s, i), o = (f - u) / (f - u + (p - d)), t.copy(i).addScaledVector(Ta, o);
3864
3864
  const v = 1 / (x + m + l);
3865
3865
  return a = m * v, o = l * v, t.copy(r).addScaledVector(cr, a).addScaledVector(ur, o);
3866
3866
  }
@@ -4387,44 +4387,44 @@ var P1 = Fc((L) => {
4387
4387
  return this.normalized && (r = Er(r, this.array)), r;
4388
4388
  }
4389
4389
  setComponent(e, t, r) {
4390
- return this.normalized && (r = ke(r, this.array)), this.array[e * this.itemSize + t] = r, this;
4390
+ return this.normalized && (r = Ee(r, this.array)), this.array[e * this.itemSize + t] = r, this;
4391
4391
  }
4392
4392
  getX(e) {
4393
4393
  let t = this.array[e * this.itemSize];
4394
4394
  return this.normalized && (t = Er(t, this.array)), t;
4395
4395
  }
4396
4396
  setX(e, t) {
4397
- return this.normalized && (t = ke(t, this.array)), this.array[e * this.itemSize] = t, this;
4397
+ return this.normalized && (t = Ee(t, this.array)), this.array[e * this.itemSize] = t, this;
4398
4398
  }
4399
4399
  getY(e) {
4400
4400
  let t = this.array[e * this.itemSize + 1];
4401
4401
  return this.normalized && (t = Er(t, this.array)), t;
4402
4402
  }
4403
4403
  setY(e, t) {
4404
- return this.normalized && (t = ke(t, this.array)), this.array[e * this.itemSize + 1] = t, this;
4404
+ return this.normalized && (t = Ee(t, this.array)), this.array[e * this.itemSize + 1] = t, this;
4405
4405
  }
4406
4406
  getZ(e) {
4407
4407
  let t = this.array[e * this.itemSize + 2];
4408
4408
  return this.normalized && (t = Er(t, this.array)), t;
4409
4409
  }
4410
4410
  setZ(e, t) {
4411
- return this.normalized && (t = ke(t, this.array)), this.array[e * this.itemSize + 2] = t, this;
4411
+ return this.normalized && (t = Ee(t, this.array)), this.array[e * this.itemSize + 2] = t, this;
4412
4412
  }
4413
4413
  getW(e) {
4414
4414
  let t = this.array[e * this.itemSize + 3];
4415
4415
  return this.normalized && (t = Er(t, this.array)), t;
4416
4416
  }
4417
4417
  setW(e, t) {
4418
- return this.normalized && (t = ke(t, this.array)), this.array[e * this.itemSize + 3] = t, this;
4418
+ return this.normalized && (t = Ee(t, this.array)), this.array[e * this.itemSize + 3] = t, this;
4419
4419
  }
4420
4420
  setXY(e, t, r) {
4421
- return e *= this.itemSize, this.normalized && (t = ke(t, this.array), r = ke(r, this.array)), this.array[e + 0] = t, this.array[e + 1] = r, this;
4421
+ return e *= this.itemSize, this.normalized && (t = Ee(t, this.array), r = Ee(r, this.array)), this.array[e + 0] = t, this.array[e + 1] = r, this;
4422
4422
  }
4423
4423
  setXYZ(e, t, r, i) {
4424
- return e *= this.itemSize, this.normalized && (t = ke(t, this.array), r = ke(r, this.array), i = ke(i, this.array)), this.array[e + 0] = t, this.array[e + 1] = r, this.array[e + 2] = i, this;
4424
+ return e *= this.itemSize, this.normalized && (t = Ee(t, this.array), r = Ee(r, this.array), i = Ee(i, this.array)), this.array[e + 0] = t, this.array[e + 1] = r, this.array[e + 2] = i, this;
4425
4425
  }
4426
4426
  setXYZW(e, t, r, i, s) {
4427
- return e *= this.itemSize, this.normalized && (t = ke(t, this.array), r = ke(r, this.array), i = ke(i, this.array), s = ke(s, this.array)), this.array[e + 0] = t, this.array[e + 1] = r, this.array[e + 2] = i, this.array[e + 3] = s, this;
4427
+ return e *= this.itemSize, this.normalized && (t = Ee(t, this.array), r = Ee(r, this.array), i = Ee(i, this.array), s = Ee(s, this.array)), this.array[e + 0] = t, this.array[e + 1] = r, this.array[e + 2] = i, this.array[e + 3] = s, this;
4428
4428
  }
4429
4429
  onUpload(e) {
4430
4430
  return this.onUploadCallback = e, this;
@@ -4458,7 +4458,7 @@ var P1 = Fc((L) => {
4458
4458
  }
4459
4459
  }
4460
4460
  let iu = 0;
4461
- const Re = /* @__PURE__ */ new Fe(), Ri = /* @__PURE__ */ new Be(), lr = /* @__PURE__ */ new E(), Me = /* @__PURE__ */ new Ee(), Br = /* @__PURE__ */ new Ee(), ve = /* @__PURE__ */ new E();
4461
+ const Re = /* @__PURE__ */ new Fe(), Ri = /* @__PURE__ */ new Be(), lr = /* @__PURE__ */ new E(), Me = /* @__PURE__ */ new ke(), Br = /* @__PURE__ */ new ke(), ve = /* @__PURE__ */ new E();
4462
4462
  class ze extends ai {
4463
4463
  constructor() {
4464
4464
  super(), this.isBufferGeometry = !0, Object.defineProperty(this, "id", { value: iu++ }), this.uuid = Sr(), this.name = "", this.type = "BufferGeometry", this.index = null, this.indirect = null, this.attributes = {}, this.morphAttributes = {}, this.morphTargetsRelative = !1, this.groups = [], this.boundingBox = null, this.boundingSphere = null, this.drawRange = { start: 0, count: 1 / 0 }, this.userData = {};
@@ -4555,7 +4555,7 @@ var P1 = Fc((L) => {
4555
4555
  return this;
4556
4556
  }
4557
4557
  computeBoundingBox() {
4558
- this.boundingBox === null && (this.boundingBox = new Ee());
4558
+ this.boundingBox === null && (this.boundingBox = new ke());
4559
4559
  const e = this.attributes.position, t = this.morphAttributes.position;
4560
4560
  if (e && e.isGLBufferAttribute) {
4561
4561
  console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.", this), this.boundingBox.set(
@@ -4612,11 +4612,11 @@ var P1 = Fc((L) => {
4612
4612
  const a = this.getAttribute("tangent"), o = [], h = [];
4613
4613
  for (let _ = 0; _ < r.count; _++)
4614
4614
  o[_] = new E(), h[_] = new E();
4615
- const c = new E(), u = new E(), f = new E(), l = new q(), p = new q(), g = new q(), m = new E(), x = new E();
4615
+ const c = new E(), u = new E(), f = new E(), l = new q(), p = new q(), d = new q(), m = new E(), x = new E();
4616
4616
  function v(_, D, N) {
4617
- c.fromBufferAttribute(r, _), u.fromBufferAttribute(r, D), f.fromBufferAttribute(r, N), l.fromBufferAttribute(s, _), p.fromBufferAttribute(s, D), g.fromBufferAttribute(s, N), u.sub(c), f.sub(c), p.sub(l), g.sub(l);
4618
- const G = 1 / (p.x * g.y - g.x * p.y);
4619
- isFinite(G) && (m.copy(u).multiplyScalar(g.y).addScaledVector(f, -p.y).multiplyScalar(G), x.copy(f).multiplyScalar(p.x).addScaledVector(u, -g.x).multiplyScalar(G), o[_].add(m), o[D].add(m), o[N].add(m), h[_].add(x), h[D].add(x), h[N].add(x));
4617
+ c.fromBufferAttribute(r, _), u.fromBufferAttribute(r, D), f.fromBufferAttribute(r, N), l.fromBufferAttribute(s, _), p.fromBufferAttribute(s, D), d.fromBufferAttribute(s, N), u.sub(c), f.sub(c), p.sub(l), d.sub(l);
4618
+ const G = 1 / (p.x * d.y - d.x * p.y);
4619
+ isFinite(G) && (m.copy(u).multiplyScalar(d.y).addScaledVector(f, -p.y).multiplyScalar(G), x.copy(f).multiplyScalar(p.x).addScaledVector(u, -d.x).multiplyScalar(G), o[_].add(m), o[D].add(m), o[N].add(m), h[_].add(x), h[D].add(x), h[N].add(x));
4620
4620
  }
4621
4621
  let w = this.groups;
4622
4622
  w.length === 0 && (w = [{
@@ -4658,8 +4658,8 @@ var P1 = Fc((L) => {
4658
4658
  const i = new E(), s = new E(), a = new E(), o = new E(), h = new E(), c = new E(), u = new E(), f = new E();
4659
4659
  if (e)
4660
4660
  for (let l = 0, p = e.count; l < p; l += 3) {
4661
- const g = e.getX(l + 0), m = e.getX(l + 1), x = e.getX(l + 2);
4662
- i.fromBufferAttribute(t, g), s.fromBufferAttribute(t, m), a.fromBufferAttribute(t, x), u.subVectors(a, s), f.subVectors(i, s), u.cross(f), o.fromBufferAttribute(r, g), h.fromBufferAttribute(r, m), c.fromBufferAttribute(r, x), o.add(u), h.add(u), c.add(u), r.setXYZ(g, o.x, o.y, o.z), r.setXYZ(m, h.x, h.y, h.z), r.setXYZ(x, c.x, c.y, c.z);
4661
+ const d = e.getX(l + 0), m = e.getX(l + 1), x = e.getX(l + 2);
4662
+ i.fromBufferAttribute(t, d), s.fromBufferAttribute(t, m), a.fromBufferAttribute(t, x), u.subVectors(a, s), f.subVectors(i, s), u.cross(f), o.fromBufferAttribute(r, d), h.fromBufferAttribute(r, m), c.fromBufferAttribute(r, x), o.add(u), h.add(u), c.add(u), r.setXYZ(d, o.x, o.y, o.z), r.setXYZ(m, h.x, h.y, h.z), r.setXYZ(x, c.x, c.y, c.z);
4663
4663
  }
4664
4664
  else
4665
4665
  for (let l = 0, p = t.count; l < p; l += 3)
@@ -4675,11 +4675,11 @@ var P1 = Fc((L) => {
4675
4675
  toNonIndexed() {
4676
4676
  function e(o, h) {
4677
4677
  const c = o.array, u = o.itemSize, f = o.normalized, l = new c.constructor(h.length * u);
4678
- let p = 0, g = 0;
4678
+ let p = 0, d = 0;
4679
4679
  for (let m = 0, x = h.length; m < x; m++) {
4680
4680
  o.isInterleavedBufferAttribute ? p = h[m] * o.data.stride + o.offset : p = h[m] * u;
4681
4681
  for (let v = 0; v < u; v++)
4682
- l[g++] = c[p++];
4682
+ l[d++] = c[p++];
4683
4683
  }
4684
4684
  return new Ye(l, u, f);
4685
4685
  }
@@ -4831,32 +4831,32 @@ var P1 = Fc((L) => {
4831
4831
  const s = this.geometry, a = this.material, o = s.index, h = s.attributes.position, c = s.attributes.uv, u = s.attributes.uv1, f = s.attributes.normal, l = s.groups, p = s.drawRange;
4832
4832
  if (o !== null)
4833
4833
  if (Array.isArray(a))
4834
- for (let g = 0, m = l.length; g < m; g++) {
4835
- const x = l[g], v = a[x.materialIndex], w = Math.max(x.start, p.start), b = Math.min(o.count, Math.min(x.start + x.count, p.start + p.count));
4834
+ for (let d = 0, m = l.length; d < m; d++) {
4835
+ const x = l[d], v = a[x.materialIndex], w = Math.max(x.start, p.start), b = Math.min(o.count, Math.min(x.start + x.count, p.start + p.count));
4836
4836
  for (let S = w, T = b; S < T; S += 3) {
4837
4837
  const B = o.getX(S), M = o.getX(S + 1), _ = o.getX(S + 2);
4838
4838
  i = Mn(this, v, e, r, c, u, f, B, M, _), i && (i.faceIndex = Math.floor(S / 3), i.face.materialIndex = x.materialIndex, t.push(i));
4839
4839
  }
4840
4840
  }
4841
4841
  else {
4842
- const g = Math.max(0, p.start), m = Math.min(o.count, p.start + p.count);
4843
- for (let x = g, v = m; x < v; x += 3) {
4842
+ const d = Math.max(0, p.start), m = Math.min(o.count, p.start + p.count);
4843
+ for (let x = d, v = m; x < v; x += 3) {
4844
4844
  const w = o.getX(x), b = o.getX(x + 1), S = o.getX(x + 2);
4845
4845
  i = Mn(this, a, e, r, c, u, f, w, b, S), i && (i.faceIndex = Math.floor(x / 3), t.push(i));
4846
4846
  }
4847
4847
  }
4848
4848
  else if (h !== void 0)
4849
4849
  if (Array.isArray(a))
4850
- for (let g = 0, m = l.length; g < m; g++) {
4851
- const x = l[g], v = a[x.materialIndex], w = Math.max(x.start, p.start), b = Math.min(h.count, Math.min(x.start + x.count, p.start + p.count));
4850
+ for (let d = 0, m = l.length; d < m; d++) {
4851
+ const x = l[d], v = a[x.materialIndex], w = Math.max(x.start, p.start), b = Math.min(h.count, Math.min(x.start + x.count, p.start + p.count));
4852
4852
  for (let S = w, T = b; S < T; S += 3) {
4853
4853
  const B = S, M = S + 1, _ = S + 2;
4854
4854
  i = Mn(this, v, e, r, c, u, f, B, M, _), i && (i.faceIndex = Math.floor(S / 3), i.face.materialIndex = x.materialIndex, t.push(i));
4855
4855
  }
4856
4856
  }
4857
4857
  else {
4858
- const g = Math.max(0, p.start), m = Math.min(h.count, p.start + p.count);
4859
- for (let x = g, v = m; x < v; x += 3) {
4858
+ const d = Math.max(0, p.start), m = Math.min(h.count, p.start + p.count);
4859
+ for (let x = d, v = m; x < v; x += 3) {
4860
4860
  const w = x, b = x + 1, S = x + 2;
4861
4861
  i = Mn(this, a, e, r, c, u, f, w, b, S), i && (i.faceIndex = Math.floor(x / 3), t.push(i));
4862
4862
  }
@@ -4924,23 +4924,23 @@ var P1 = Fc((L) => {
4924
4924
  Ma.copy(i).invert(), Lr.copy(e.ray).applyMatrix4(Ma);
4925
4925
  const o = s / ((this.scale.x + this.scale.y + this.scale.z) / 3), h = o * o, c = this.isLineSegments ? 2 : 1, u = r.index, l = r.attributes.position;
4926
4926
  if (u !== null) {
4927
- const p = Math.max(0, a.start), g = Math.min(u.count, a.start + a.count);
4928
- for (let m = p, x = g - 1; m < x; m += c) {
4927
+ const p = Math.max(0, a.start), d = Math.min(u.count, a.start + a.count);
4928
+ for (let m = p, x = d - 1; m < x; m += c) {
4929
4929
  const v = u.getX(m), w = u.getX(m + 1), b = Bn(this, e, Lr, h, v, w);
4930
4930
  b && t.push(b);
4931
4931
  }
4932
4932
  if (this.isLineLoop) {
4933
- const m = u.getX(g - 1), x = u.getX(p), v = Bn(this, e, Lr, h, m, x);
4933
+ const m = u.getX(d - 1), x = u.getX(p), v = Bn(this, e, Lr, h, m, x);
4934
4934
  v && t.push(v);
4935
4935
  }
4936
4936
  } else {
4937
- const p = Math.max(0, a.start), g = Math.min(l.count, a.start + a.count);
4938
- for (let m = p, x = g - 1; m < x; m += c) {
4937
+ const p = Math.max(0, a.start), d = Math.min(l.count, a.start + a.count);
4938
+ for (let m = p, x = d - 1; m < x; m += c) {
4939
4939
  const v = Bn(this, e, Lr, h, m, m + 1);
4940
4940
  v && t.push(v);
4941
4941
  }
4942
4942
  if (this.isLineLoop) {
4943
- const m = Bn(this, e, Lr, h, g - 1, p);
4943
+ const m = Bn(this, e, Lr, h, d - 1, p);
4944
4944
  m && t.push(m);
4945
4945
  }
4946
4946
  }
@@ -5087,8 +5087,8 @@ var P1 = Fc((L) => {
5087
5087
  computeFrenetFrames(e, t) {
5088
5088
  const r = new E(), i = [], s = [], a = [], o = new E(), h = new Fe();
5089
5089
  for (let p = 0; p <= e; p++) {
5090
- const g = p / e;
5091
- i[p] = this.getTangentAt(g, new E());
5090
+ const d = p / e;
5091
+ i[p] = this.getTangentAt(d, new E());
5092
5092
  }
5093
5093
  s[0] = new E(), a[0] = new E();
5094
5094
  let c = Number.MAX_VALUE;
@@ -5097,16 +5097,16 @@ var P1 = Fc((L) => {
5097
5097
  for (let p = 1; p <= e; p++) {
5098
5098
  if (s[p] = s[p - 1].clone(), a[p] = a[p - 1].clone(), o.crossVectors(i[p - 1], i[p]), o.length() > Number.EPSILON) {
5099
5099
  o.normalize();
5100
- const g = Math.acos(X(i[p - 1].dot(i[p]), -1, 1));
5101
- s[p].applyMatrix4(h.makeRotationAxis(o, g));
5100
+ const d = Math.acos(X(i[p - 1].dot(i[p]), -1, 1));
5101
+ s[p].applyMatrix4(h.makeRotationAxis(o, d));
5102
5102
  }
5103
5103
  a[p].crossVectors(i[p], s[p]);
5104
5104
  }
5105
5105
  if (t === !0) {
5106
5106
  let p = Math.acos(X(s[0].dot(s[e]), -1, 1));
5107
5107
  p /= e, i[0].dot(o.crossVectors(s[0], s[e])) > 0 && (p = -p);
5108
- for (let g = 1; g <= e; g++)
5109
- s[g].applyMatrix4(h.makeRotationAxis(i[g], p * g)), a[g].crossVectors(i[g], s[g]);
5108
+ for (let d = 1; d <= e; d++)
5109
+ s[d].applyMatrix4(h.makeRotationAxis(i[d], p * d)), a[d].crossVectors(i[d], s[d]);
5110
5110
  }
5111
5111
  return {
5112
5112
  tangents: i,
@@ -5202,8 +5202,8 @@ var P1 = Fc((L) => {
5202
5202
  const f = i[o % s], l = i[(o + 1) % s];
5203
5203
  if (this.closed || o + 2 < s ? u = i[(o + 2) % s] : (Ln.subVectors(i[s - 1], i[s - 2]).add(i[s - 1]), u = Ln), this.curveType === "centripetal" || this.curveType === "chordal") {
5204
5204
  const p = this.curveType === "chordal" ? 0.5 : 0.25;
5205
- let g = Math.pow(c.distanceToSquared(f), p), m = Math.pow(f.distanceToSquared(l), p), x = Math.pow(l.distanceToSquared(u), p);
5206
- m < 1e-4 && (m = 1), g < 1e-4 && (g = m), x < 1e-4 && (x = m), Ii.initNonuniformCatmullRom(c.x, f.x, l.x, u.x, g, m, x), zi.initNonuniformCatmullRom(c.y, f.y, l.y, u.y, g, m, x), Pi.initNonuniformCatmullRom(c.z, f.z, l.z, u.z, g, m, x);
5205
+ let d = Math.pow(c.distanceToSquared(f), p), m = Math.pow(f.distanceToSquared(l), p), x = Math.pow(l.distanceToSquared(u), p);
5206
+ m < 1e-4 && (m = 1), d < 1e-4 && (d = m), x < 1e-4 && (x = m), Ii.initNonuniformCatmullRom(c.x, f.x, l.x, u.x, d, m, x), zi.initNonuniformCatmullRom(c.y, f.y, l.y, u.y, d, m, x), Pi.initNonuniformCatmullRom(c.z, f.z, l.z, u.z, d, m, x);
5207
5207
  } else this.curveType === "catmullrom" && (Ii.initCatmullRom(c.x, f.x, l.x, u.x, this.tension), zi.initCatmullRom(c.y, f.y, l.y, u.y, this.tension), Pi.initCatmullRom(c.z, f.z, l.z, u.z, this.tension));
5208
5208
  return r.set(
5209
5209
  Ii.calc(h),
@@ -5698,8 +5698,8 @@ var P1 = Fc((L) => {
5698
5698
  let o, h, c, u, f, l, p;
5699
5699
  if (r && (s = Tu(n, e, s, t)), n.length > 80 * t) {
5700
5700
  o = c = n[0], h = u = n[1];
5701
- for (let g = t; g < i; g += t)
5702
- f = n[g], l = n[g + 1], f < o && (o = f), l < h && (h = l), f > c && (c = f), l > u && (u = l);
5701
+ for (let d = t; d < i; d += t)
5702
+ f = n[d], l = n[d + 1], f < o && (o = f), l < h && (h = l), f > c && (c = f), l > u && (u = l);
5703
5703
  p = Math.max(c - o, u - h), p = p !== 0 ? 32767 / p : 0;
5704
5704
  }
5705
5705
  return Vr(s, a, t, o, h, p, 0), a;
@@ -5718,7 +5718,7 @@ var P1 = Fc((L) => {
5718
5718
  e || (e = n);
5719
5719
  let t = n, r;
5720
5720
  do
5721
- if (r = !1, !t.steiner && (oi(t, t.next) || ce(t.prev, t, t.next) === 0)) {
5721
+ if (r = !1, !t.steiner && (oi(t, t.next) || ue(t.prev, t, t.next) === 0)) {
5722
5722
  if (Xr(t), t = e = t.prev, t === t.next) break;
5723
5723
  r = !0;
5724
5724
  } else
@@ -5743,30 +5743,30 @@ var P1 = Fc((L) => {
5743
5743
  }
5744
5744
  function wu(n) {
5745
5745
  const e = n.prev, t = n, r = n.next;
5746
- if (ce(e, t, r) >= 0) return !1;
5746
+ if (ue(e, t, r) >= 0) return !1;
5747
5747
  const i = e.x, s = t.x, a = r.x, o = e.y, h = t.y, c = r.y, u = i < s ? i < a ? i : a : s < a ? s : a, f = o < h ? o < c ? o : c : h < c ? h : c, l = i > s ? i > a ? i : a : s > a ? s : a, p = o > h ? o > c ? o : c : h > c ? h : c;
5748
- let g = r.next;
5749
- for (; g !== e; ) {
5750
- if (g.x >= u && g.x <= l && g.y >= f && g.y <= p && dr(i, o, s, h, a, c, g.x, g.y) && ce(g.prev, g, g.next) >= 0) return !1;
5751
- g = g.next;
5748
+ let d = r.next;
5749
+ for (; d !== e; ) {
5750
+ if (d.x >= u && d.x <= l && d.y >= f && d.y <= p && dr(i, o, s, h, a, c, d.x, d.y) && ue(d.prev, d, d.next) >= 0) return !1;
5751
+ d = d.next;
5752
5752
  }
5753
5753
  return !0;
5754
5754
  }
5755
5755
  function Su(n, e, t, r) {
5756
5756
  const i = n.prev, s = n, a = n.next;
5757
- if (ce(i, s, a) >= 0) return !1;
5758
- const o = i.x, h = s.x, c = a.x, u = i.y, f = s.y, l = a.y, p = o < h ? o < c ? o : c : h < c ? h : c, g = u < f ? u < l ? u : l : f < l ? f : l, m = o > h ? o > c ? o : c : h > c ? h : c, x = u > f ? u > l ? u : l : f > l ? f : l, v = gs(p, g, e, t, r), w = gs(m, x, e, t, r);
5757
+ if (ue(i, s, a) >= 0) return !1;
5758
+ const o = i.x, h = s.x, c = a.x, u = i.y, f = s.y, l = a.y, p = o < h ? o < c ? o : c : h < c ? h : c, d = u < f ? u < l ? u : l : f < l ? f : l, m = o > h ? o > c ? o : c : h > c ? h : c, x = u > f ? u > l ? u : l : f > l ? f : l, v = gs(p, d, e, t, r), w = gs(m, x, e, t, r);
5759
5759
  let b = n.prevZ, S = n.nextZ;
5760
5760
  for (; b && b.z >= v && S && S.z <= w; ) {
5761
- if (b.x >= p && b.x <= m && b.y >= g && b.y <= x && b !== i && b !== a && dr(o, u, h, f, c, l, b.x, b.y) && ce(b.prev, b, b.next) >= 0 || (b = b.prevZ, S.x >= p && S.x <= m && S.y >= g && S.y <= x && S !== i && S !== a && dr(o, u, h, f, c, l, S.x, S.y) && ce(S.prev, S, S.next) >= 0)) return !1;
5761
+ if (b.x >= p && b.x <= m && b.y >= d && b.y <= x && b !== i && b !== a && dr(o, u, h, f, c, l, b.x, b.y) && ue(b.prev, b, b.next) >= 0 || (b = b.prevZ, S.x >= p && S.x <= m && S.y >= d && S.y <= x && S !== i && S !== a && dr(o, u, h, f, c, l, S.x, S.y) && ue(S.prev, S, S.next) >= 0)) return !1;
5762
5762
  S = S.nextZ;
5763
5763
  }
5764
5764
  for (; b && b.z >= v; ) {
5765
- if (b.x >= p && b.x <= m && b.y >= g && b.y <= x && b !== i && b !== a && dr(o, u, h, f, c, l, b.x, b.y) && ce(b.prev, b, b.next) >= 0) return !1;
5765
+ if (b.x >= p && b.x <= m && b.y >= d && b.y <= x && b !== i && b !== a && dr(o, u, h, f, c, l, b.x, b.y) && ue(b.prev, b, b.next) >= 0) return !1;
5766
5766
  b = b.prevZ;
5767
5767
  }
5768
5768
  for (; S && S.z <= w; ) {
5769
- if (S.x >= p && S.x <= m && S.y >= g && S.y <= x && S !== i && S !== a && dr(o, u, h, f, c, l, S.x, S.y) && ce(S.prev, S, S.next) >= 0) return !1;
5769
+ if (S.x >= p && S.x <= m && S.y >= d && S.y <= x && S !== i && S !== a && dr(o, u, h, f, c, l, S.x, S.y) && ue(S.prev, S, S.next) >= 0) return !1;
5770
5770
  S = S.nextZ;
5771
5771
  }
5772
5772
  return !0;
@@ -5834,7 +5834,7 @@ var P1 = Fc((L) => {
5834
5834
  return i;
5835
5835
  }
5836
5836
  function Mu(n, e) {
5837
- return ce(n.prev, n, e.prev) < 0 && ce(e.next, n, n.next) < 0;
5837
+ return ue(n.prev, n, e.prev) < 0 && ue(e.next, n, n.next) < 0;
5838
5838
  }
5839
5839
  function _u(n, e, t, r) {
5840
5840
  let i = n;
@@ -5873,17 +5873,17 @@ var P1 = Fc((L) => {
5873
5873
  function Ou(n, e) {
5874
5874
  return n.next.i !== e.i && n.prev.i !== e.i && !Ru(n, e) && // doesn't intersect other edges
5875
5875
  (qr(n, e) && qr(e, n) && Uu(n, e) && // locally visible
5876
- (ce(n.prev, n, e.prev) || ce(n, e.prev, e)) || // does not create opposite-facing sectors
5877
- oi(n, e) && ce(n.prev, n, n.next) > 0 && ce(e.prev, e, e.next) > 0);
5876
+ (ue(n.prev, n, e.prev) || ue(n, e.prev, e)) || // does not create opposite-facing sectors
5877
+ oi(n, e) && ue(n.prev, n, n.next) > 0 && ue(e.prev, e, e.next) > 0);
5878
5878
  }
5879
- function ce(n, e, t) {
5879
+ function ue(n, e, t) {
5880
5880
  return (e.y - n.y) * (t.x - e.x) - (e.x - n.x) * (t.y - e.y);
5881
5881
  }
5882
5882
  function oi(n, e) {
5883
5883
  return n.x === e.x && n.y === e.y;
5884
5884
  }
5885
5885
  function ph(n, e, t, r) {
5886
- const i = Rn(ce(n, e, t)), s = Rn(ce(n, e, r)), a = Rn(ce(t, r, n)), o = Rn(ce(t, r, e));
5886
+ const i = Rn(ue(n, e, t)), s = Rn(ue(n, e, r)), a = Rn(ue(t, r, n)), o = Rn(ue(t, r, e));
5887
5887
  return !!(i !== s && a !== o || i === 0 && On(n, t, e) || s === 0 && On(n, r, e) || a === 0 && On(t, n, r) || o === 0 && On(t, e, r));
5888
5888
  }
5889
5889
  function On(n, e, t) {
@@ -5901,7 +5901,7 @@ var P1 = Fc((L) => {
5901
5901
  return !1;
5902
5902
  }
5903
5903
  function qr(n, e) {
5904
- return ce(n.prev, n, n.next) < 0 ? ce(n, e, n.next) >= 0 && ce(n, n.prev, e) >= 0 : ce(n, e, n.prev) < 0 || ce(n, n.next, e) < 0;
5904
+ return ue(n.prev, n, n.next) < 0 ? ue(n, e, n.next) >= 0 && ue(n, n.prev, e) >= 0 : ue(n, e, n.prev) < 0 || ue(n, n.next, e) < 0;
5905
5905
  }
5906
5906
  function Uu(n, e) {
5907
5907
  let t = n, r = !1;
@@ -5981,15 +5981,15 @@ var P1 = Fc((L) => {
5981
5981
  function c(u) {
5982
5982
  const f = i.length / 3, l = u.extractPoints(t);
5983
5983
  let p = l.shape;
5984
- const g = l.holes;
5984
+ const d = l.holes;
5985
5985
  Rt.isClockWise(p) === !1 && (p = p.reverse());
5986
- for (let x = 0, v = g.length; x < v; x++) {
5987
- const w = g[x];
5988
- Rt.isClockWise(w) === !0 && (g[x] = w.reverse());
5986
+ for (let x = 0, v = d.length; x < v; x++) {
5987
+ const w = d[x];
5988
+ Rt.isClockWise(w) === !0 && (d[x] = w.reverse());
5989
5989
  }
5990
- const m = Rt.triangulateShape(p, g);
5991
- for (let x = 0, v = g.length; x < v; x++) {
5992
- const w = g[x];
5990
+ const m = Rt.triangulateShape(p, d);
5991
+ for (let x = 0, v = d.length; x < v; x++) {
5992
+ const w = d[x];
5993
5993
  p = p.concat(w);
5994
5994
  }
5995
5995
  for (let x = 0, v = p.length; x < v; x++) {
@@ -6067,9 +6067,9 @@ var P1 = Fc((L) => {
6067
6067
  return f !== -1 && c.splice(f, 2), this;
6068
6068
  }, this.getHandler = function(u) {
6069
6069
  for (let f = 0, l = c.length; f < l; f += 2) {
6070
- const p = c[f], g = c[f + 1];
6070
+ const p = c[f], d = c[f + 1];
6071
6071
  if (p.global && (p.lastIndex = 0), p.test(u))
6072
- return g;
6072
+ return d;
6073
6073
  }
6074
6074
  return null;
6075
6075
  };
@@ -6146,7 +6146,7 @@ var P1 = Fc((L) => {
6146
6146
  if (c.status === 200 || c.status === 0) {
6147
6147
  if (c.status === 0 && console.warn("THREE.FileLoader: HTTP Status 0 received."), typeof ReadableStream > "u" || c.body === void 0 || c.body.getReader === void 0)
6148
6148
  return c;
6149
- const u = lt[e], f = c.body.getReader(), l = c.headers.get("X-File-Size") || c.headers.get("Content-Length"), p = l ? parseInt(l) : 0, g = p !== 0;
6149
+ const u = lt[e], f = c.body.getReader(), l = c.headers.get("X-File-Size") || c.headers.get("Content-Length"), p = l ? parseInt(l) : 0, d = p !== 0;
6150
6150
  let m = 0;
6151
6151
  const x = new ReadableStream({
6152
6152
  start(v) {
@@ -6157,7 +6157,7 @@ var P1 = Fc((L) => {
6157
6157
  v.close();
6158
6158
  else {
6159
6159
  m += S.byteLength;
6160
- const T = new ProgressEvent("progress", { lengthComputable: g, loaded: m, total: p });
6160
+ const T = new ProgressEvent("progress", { lengthComputable: d, loaded: m, total: p });
6161
6161
  for (let B = 0, M = u.length; B < M; B++) {
6162
6162
  const _ = u[B];
6163
6163
  _.onProgress && _.onProgress(T);
@@ -6188,7 +6188,7 @@ var P1 = Fc((L) => {
6188
6188
  return c.text();
6189
6189
  {
6190
6190
  const f = /charset="?([^;"\s]*)"?/i.exec(o), l = f && f[1] ? f[1].toLowerCase() : void 0, p = new TextDecoder(l);
6191
- return c.arrayBuffer().then((g) => p.decode(g));
6191
+ return c.arrayBuffer().then((d) => p.decode(d));
6192
6192
  }
6193
6193
  }
6194
6194
  }).then((c) => {
@@ -6279,10 +6279,10 @@ var P1 = Fc((L) => {
6279
6279
  let u = !i(s[0].getPoints());
6280
6280
  u = e ? !u : u;
6281
6281
  const f = [], l = [];
6282
- let p = [], g = 0, m;
6283
- l[g] = void 0, p[g] = [];
6282
+ let p = [], d = 0, m;
6283
+ l[d] = void 0, p[d] = [];
6284
6284
  for (let v = 0, w = s.length; v < w; v++)
6285
- o = s[v], m = o.getPoints(), a = i(m), a = e ? !a : a, a ? (!u && l[g] && g++, l[g] = { s: new yr(), p: m }, l[g].s.curves = o.curves, u && g++, p[g] = []) : p[g].push({ h: o, p: m[0] });
6285
+ o = s[v], m = o.getPoints(), a = i(m), a = e ? !a : a, a ? (!u && l[d] && d++, l[d] = { s: new yr(), p: m }, l[d].s.curves = o.curves, u && d++, p[d] = []) : p[d].push({ h: o, p: m[0] });
6286
6286
  if (!l[0]) return t(s);
6287
6287
  if (l.length > 1) {
6288
6288
  let v = !1, w = 0;
@@ -7205,19 +7205,19 @@ var P1 = Fc((L) => {
7205
7205
  var h = [n, e], c = [t, r], u = [i, s], f = [a, o];
7206
7206
  this.addPoint(n, e), this.addPoint(a, o);
7207
7207
  for (var l = 0; l <= 1; l++) {
7208
- var p = 6 * h[l] - 12 * c[l] + 6 * u[l], g = -3 * h[l] + 9 * c[l] - 9 * u[l] + 3 * f[l], m = 3 * c[l] - 3 * h[l];
7209
- if (g === 0) {
7208
+ var p = 6 * h[l] - 12 * c[l] + 6 * u[l], d = -3 * h[l] + 9 * c[l] - 9 * u[l] + 3 * f[l], m = 3 * c[l] - 3 * h[l];
7209
+ if (d === 0) {
7210
7210
  if (p === 0)
7211
7211
  continue;
7212
7212
  var x = -m / p;
7213
7213
  0 < x && x < 1 && (l === 0 && this.addX(fr(h[l], c[l], u[l], f[l], x)), l === 1 && this.addY(fr(h[l], c[l], u[l], f[l], x)));
7214
7214
  continue;
7215
7215
  }
7216
- var v = Math.pow(p, 2) - 4 * m * g;
7216
+ var v = Math.pow(p, 2) - 4 * m * d;
7217
7217
  if (!(v < 0)) {
7218
- var w = (-p + Math.sqrt(v)) / (2 * g);
7218
+ var w = (-p + Math.sqrt(v)) / (2 * d);
7219
7219
  0 < w && w < 1 && (l === 0 && this.addX(fr(h[l], c[l], u[l], f[l], w)), l === 1 && this.addY(fr(h[l], c[l], u[l], f[l], w)));
7220
- var b = (-p - Math.sqrt(v)) / (2 * g);
7220
+ var b = (-p - Math.sqrt(v)) / (2 * d);
7221
7221
  0 < b && b < 1 && (l === 0 && this.addX(fr(h[l], c[l], u[l], f[l], b)), l === 1 && this.addY(fr(h[l], c[l], u[l], f[l], b)));
7222
7222
  }
7223
7223
  }
@@ -8195,8 +8195,8 @@ var P1 = Fc((L) => {
8195
8195
  var s;
8196
8196
  n.segCount = s = e.parseUShort() >> 1, e.skip("uShort", 3), n.glyphIndexMap = {};
8197
8197
  for (var a = new P.Parser(t, r + i + 14), o = new P.Parser(t, r + i + 16 + s * 2), h = new P.Parser(t, r + i + 16 + s * 4), c = new P.Parser(t, r + i + 16 + s * 6), u = r + i + 16 + s * 8, f = 0; f < s - 1; f += 1)
8198
- for (var l = void 0, p = a.parseUShort(), g = o.parseUShort(), m = h.parseShort(), x = c.parseUShort(), v = g; v <= p; v += 1)
8199
- x !== 0 ? (u = c.offset + c.relativeOffset - 2, u += x, u += (v - g) * 2, l = P.getUShort(t, u), l !== 0 && (l = l + m & 65535)) : l = v + m & 65535, n.glyphIndexMap[v] = l;
8198
+ for (var l = void 0, p = a.parseUShort(), d = o.parseUShort(), m = h.parseShort(), x = c.parseUShort(), v = d; v <= p; v += 1)
8199
+ x !== 0 ? (u = c.offset + c.relativeOffset - 2, u += x, u += (v - d) * 2, l = P.getUShort(t, u), l !== 0 && (l = l + m & 65535)) : l = v + m & 65535, n.glyphIndexMap[v] = l;
8200
8200
  }
8201
8201
  function Sl(n, e) {
8202
8202
  var t = {};
@@ -8278,14 +8278,14 @@ var P1 = Fc((L) => {
8278
8278
  });
8279
8279
  }
8280
8280
  Cl(s);
8281
- var h = s.segments.length, c = 0, u = [], f = [], l = [], p = [], g = [], m = [];
8281
+ var h = s.segments.length, c = 0, u = [], f = [], l = [], p = [], d = [], m = [];
8282
8282
  for (t = 0; t < h; t += 1) {
8283
8283
  var x = s.segments[t];
8284
- x.end <= 65535 && x.start <= 65535 ? (u = u.concat({ name: "end_" + t, type: "USHORT", value: x.end }), f = f.concat({ name: "start_" + t, type: "USHORT", value: x.start }), l = l.concat({ name: "idDelta_" + t, type: "SHORT", value: x.delta }), p = p.concat({ name: "idRangeOffset_" + t, type: "USHORT", value: x.offset }), x.glyphId !== void 0 && (g = g.concat({ name: "glyph_" + t, type: "USHORT", value: x.glyphId }))) : c += 1, !e && x.glyphIndex !== void 0 && (m = m.concat({ name: "cmap12Start_" + t, type: "ULONG", value: x.start }), m = m.concat({ name: "cmap12End_" + t, type: "ULONG", value: x.end }), m = m.concat({ name: "cmap12Glyph_" + t, type: "ULONG", value: x.glyphIndex }));
8284
+ x.end <= 65535 && x.start <= 65535 ? (u = u.concat({ name: "end_" + t, type: "USHORT", value: x.end }), f = f.concat({ name: "start_" + t, type: "USHORT", value: x.start }), l = l.concat({ name: "idDelta_" + t, type: "SHORT", value: x.delta }), p = p.concat({ name: "idRangeOffset_" + t, type: "USHORT", value: x.offset }), x.glyphId !== void 0 && (d = d.concat({ name: "glyph_" + t, type: "USHORT", value: x.glyphId }))) : c += 1, !e && x.glyphIndex !== void 0 && (m = m.concat({ name: "cmap12Start_" + t, type: "ULONG", value: x.start }), m = m.concat({ name: "cmap12End_" + t, type: "ULONG", value: x.end }), m = m.concat({ name: "cmap12Glyph_" + t, type: "ULONG", value: x.glyphIndex }));
8285
8285
  }
8286
- if (s.segCountX2 = (h - c) * 2, s.searchRange = Math.pow(2, Math.floor(Math.log(h - c) / Math.log(2))) * 2, s.entrySelector = Math.log(s.searchRange / 2) / Math.log(2), s.rangeShift = s.segCountX2 - s.searchRange, s.fields = s.fields.concat(u), s.fields.push({ name: "reservedPad", type: "USHORT", value: 0 }), s.fields = s.fields.concat(f), s.fields = s.fields.concat(l), s.fields = s.fields.concat(p), s.fields = s.fields.concat(g), s.cmap4Length = 14 + // Subtable header
8286
+ if (s.segCountX2 = (h - c) * 2, s.searchRange = Math.pow(2, Math.floor(Math.log(h - c) / Math.log(2))) * 2, s.entrySelector = Math.log(s.searchRange / 2) / Math.log(2), s.rangeShift = s.segCountX2 - s.searchRange, s.fields = s.fields.concat(u), s.fields.push({ name: "reservedPad", type: "USHORT", value: 0 }), s.fields = s.fields.concat(f), s.fields = s.fields.concat(l), s.fields = s.fields.concat(p), s.fields = s.fields.concat(d), s.cmap4Length = 14 + // Subtable header
8287
8287
  u.length * 2 + 2 + // reservedPad
8288
- f.length * 2 + l.length * 2 + p.length * 2 + g.length * 2, !e) {
8288
+ f.length * 2 + l.length * 2 + p.length * 2 + d.length * 2, !e) {
8289
8289
  var v = 16 + // Subtable header
8290
8290
  m.length * 4;
8291
8291
  s.cmap12Offset = 12 + 2 * 2 + 4 + s.cmap4Length, s.fields = s.fields.concat([
@@ -9619,10 +9619,10 @@ var P1 = Fc((L) => {
9619
9619
  this.getPath(e, t, r, i).draw(n);
9620
9620
  };
9621
9621
  Ne.prototype.drawPoints = function(n, e, t, r) {
9622
- function i(f, l, p, g) {
9622
+ function i(f, l, p, d) {
9623
9623
  n.beginPath();
9624
9624
  for (var m = 0; m < f.length; m += 1)
9625
- n.moveTo(l + f[m].x * g, p + f[m].y * g), n.arc(l + f[m].x * g, p + f[m].y * g, 2, 0, Math.PI * 2, !1);
9625
+ n.moveTo(l + f[m].x * d, p + f[m].y * d), n.arc(l + f[m].x * d, p + f[m].y * d, 2, 0, Math.PI * 2, !1);
9626
9626
  n.closePath(), n.fill();
9627
9627
  }
9628
9628
  e = e !== void 0 ? e : 0, t = t !== void 0 ? t : 0, r = r !== void 0 ? r : 24;
@@ -9919,12 +9919,12 @@ var P1 = Fc((L) => {
9919
9919
  return new si(i, t);
9920
9920
  }
9921
9921
  function ro(n, e, t) {
9922
- var r, i, s, a, o = new me(), h = [], c = 0, u = !1, f = !1, l = 0, p = 0, g, m, x, v;
9922
+ var r, i, s, a, o = new me(), h = [], c = 0, u = !1, f = !1, l = 0, p = 0, d, m, x, v;
9923
9923
  if (n.isCIDFont) {
9924
9924
  var w = n.tables.cff.topDict._fdSelect[e.index], b = n.tables.cff.topDict._fdArray[w];
9925
- g = b._subrs, m = b._subrsBias, x = b._defaultWidthX, v = b._nominalWidthX;
9925
+ d = b._subrs, m = b._subrsBias, x = b._defaultWidthX, v = b._nominalWidthX;
9926
9926
  } else
9927
- g = n.tables.cff.topDict._subrs, m = n.tables.cff.topDict._subrsBias, x = n.tables.cff.topDict._defaultWidthX, v = n.tables.cff.topDict._nominalWidthX;
9927
+ d = n.tables.cff.topDict._subrs, m = n.tables.cff.topDict._subrsBias, x = n.tables.cff.topDict._defaultWidthX, v = n.tables.cff.topDict._nominalWidthX;
9928
9928
  var S = x;
9929
9929
  function T(_, D) {
9930
9930
  f && o.closePath(), o.moveTo(_, D), f = !0;
@@ -9963,7 +9963,7 @@ var P1 = Fc((L) => {
9963
9963
  r = l + h.shift(), i = p + h.shift(), s = r + h.shift(), a = i + h.shift(), l = s + h.shift(), p = a + h.shift(), o.curveTo(r, i, s, a, l, p);
9964
9964
  break;
9965
9965
  case 10:
9966
- Y = h.pop() + m, Z = g[Y], Z && M(Z);
9966
+ Y = h.pop() + m, Z = d[Y], Z && M(Z);
9967
9967
  break;
9968
9968
  case 11:
9969
9969
  return;
@@ -10083,8 +10083,8 @@ var P1 = Fc((L) => {
10083
10083
  if (f === 0 || l === 0)
10084
10084
  throw new Error("Font is marked as a CID font, but FDArray and/or FDSelect information is missing");
10085
10085
  f += e;
10086
- var p = Et(n, f), g = to(n, e, p.objects, o.objects);
10087
- u._fdArray = g, l += e, u._fdSelect = ql(n, l, t.numGlyphs, g.length);
10086
+ var p = Et(n, f), d = to(n, e, p.objects, o.objects);
10087
+ u._fdArray = d, l += e, u._fdSelect = ql(n, l, t.numGlyphs, d.length);
10088
10088
  }
10089
10089
  var m = e + u.private[1], x = Ph(n, m, u.private[0], o.objects);
10090
10090
  if (t.defaultWidthX = x.defaultWidthX, t.nominalWidthX = x.nominalWidthX, x.subrs !== 0) {
@@ -10191,8 +10191,8 @@ var P1 = Fc((L) => {
10191
10191
  else if (h.type === "L")
10192
10192
  a = Math.round(h.x - r), o = Math.round(h.y - i), e.push({ name: "dx", type: "NUMBER", value: a }), e.push({ name: "dy", type: "NUMBER", value: o }), e.push({ name: "rlineto", type: "OP", value: 5 }), r = Math.round(h.x), i = Math.round(h.y);
10193
10193
  else if (h.type === "C") {
10194
- var f = Math.round(h.x1 - r), l = Math.round(h.y1 - i), p = Math.round(h.x2 - h.x1), g = Math.round(h.y2 - h.y1);
10195
- a = Math.round(h.x - h.x2), o = Math.round(h.y - h.y2), e.push({ name: "dx1", type: "NUMBER", value: f }), e.push({ name: "dy1", type: "NUMBER", value: l }), e.push({ name: "dx2", type: "NUMBER", value: p }), e.push({ name: "dy2", type: "NUMBER", value: g }), e.push({ name: "dx", type: "NUMBER", value: a }), e.push({ name: "dy", type: "NUMBER", value: o }), e.push({ name: "rrcurveto", type: "OP", value: 8 }), r = Math.round(h.x), i = Math.round(h.y);
10194
+ var f = Math.round(h.x1 - r), l = Math.round(h.y1 - i), p = Math.round(h.x2 - h.x1), d = Math.round(h.y2 - h.y1);
10195
+ a = Math.round(h.x - h.x2), o = Math.round(h.y - h.y2), e.push({ name: "dx1", type: "NUMBER", value: f }), e.push({ name: "dy1", type: "NUMBER", value: l }), e.push({ name: "dx2", type: "NUMBER", value: p }), e.push({ name: "dy2", type: "NUMBER", value: d }), e.push({ name: "dx", type: "NUMBER", value: a }), e.push({ name: "dy", type: "NUMBER", value: o }), e.push({ name: "rrcurveto", type: "OP", value: 8 }), r = Math.round(h.x), i = Math.round(h.y);
10196
10196
  }
10197
10197
  }
10198
10198
  return e.push({ name: "endchar", type: "OP", value: 14 }), e;
@@ -11093,10 +11093,10 @@ var P1 = Fc((L) => {
11093
11093
  }
11094
11094
  function xf(n, e, t) {
11095
11095
  for (var r = {}, i = new P.Parser(n, e), s = i.parseUShort(), a = i.parseUShort(), o = i.offset + i.parseUShort(), h = 0; h < a; h++) {
11096
- var c = i.parseUShort(), u = i.parseUShort(), f = i.parseUShort(), l = i.parseUShort(), p = Zh[l] || l, g = i.parseUShort(), m = i.parseUShort(), x = yf(c, f, t), v = jh(c, u, f);
11096
+ var c = i.parseUShort(), u = i.parseUShort(), f = i.parseUShort(), l = i.parseUShort(), p = Zh[l] || l, d = i.parseUShort(), m = i.parseUShort(), x = yf(c, f, t), v = jh(c, u, f);
11097
11097
  if (v !== void 0 && x !== void 0) {
11098
11098
  var w = void 0;
11099
- if (v === Es ? w = wr.UTF16(n, o + m, g) : w = wr.MACSTRING(n, o + m, g, v), w) {
11099
+ if (v === Es ? w = wr.UTF16(n, o + m, d) : w = wr.MACSTRING(n, o + m, d, v), w) {
11100
11100
  var b = r[p];
11101
11101
  b === void 0 && (b = r[p] = {}), b[x] = w;
11102
11102
  }
@@ -11152,9 +11152,9 @@ var P1 = Fc((L) => {
11152
11152
  for (var h = Vi(Jh), c = Vi($h), u = [], f = [], l = 0; l < r.length; l++) {
11153
11153
  t = r[l];
11154
11154
  var p = i[t];
11155
- for (var g in p) {
11156
- var m = p[g], x = 1, v = h[g], w = gf[v], b = jh(x, w, v), S = U.MACSTRING(m, b);
11157
- S === void 0 && (x = 0, v = e.indexOf(g), v < 0 && (v = e.length, e.push(g)), w = 4, S = U.UTF16(m));
11155
+ for (var d in p) {
11156
+ var m = p[d], x = 1, v = h[d], w = gf[v], b = jh(x, w, v), S = U.MACSTRING(m, b);
11157
+ S === void 0 && (x = 0, v = e.indexOf(d), v < 0 && (v = e.length, e.push(d)), w = 4, S = U.UTF16(m));
11158
11158
  var T = ao(S, f);
11159
11159
  u.push(so(
11160
11160
  x,
@@ -11164,7 +11164,7 @@ var P1 = Fc((L) => {
11164
11164
  S.length,
11165
11165
  T
11166
11166
  ));
11167
- var B = c[g];
11167
+ var B = c[d];
11168
11168
  if (B !== void 0) {
11169
11169
  var M = U.UTF16(m), _ = ao(M, f);
11170
11170
  u.push(so(
@@ -11869,10 +11869,10 @@ var P1 = Fc((L) => {
11869
11869
  return e / n.length;
11870
11870
  }
11871
11871
  function Lf(n) {
11872
- for (var e = [], t = [], r = [], i = [], s = [], a = [], o = [], h, c = 0, u = 0, f = 0, l = 0, p = 0, g = 0; g < n.glyphs.length; g += 1) {
11873
- var m = n.glyphs.get(g), x = m.unicode | 0;
11872
+ for (var e = [], t = [], r = [], i = [], s = [], a = [], o = [], h, c = 0, u = 0, f = 0, l = 0, p = 0, d = 0; d < n.glyphs.length; d += 1) {
11873
+ var m = n.glyphs.get(d), x = m.unicode | 0;
11874
11874
  if (isNaN(m.advanceWidth))
11875
- throw new Error("Glyph " + m.name + " (" + g + "): advanceWidth is not a number.");
11875
+ throw new Error("Glyph " + m.name + " (" + d + "): advanceWidth is not a number.");
11876
11876
  (h > x || h === void 0) && x > 0 && (h = x), c < x && (c = x);
11877
11877
  var v = Ms.getUnicodeRange(x);
11878
11878
  if (v < 32)
@@ -12325,8 +12325,8 @@ var P1 = Fc((L) => {
12325
12325
  for (var r = [], i = this.getLookupTables(e, t, n, 4), s = 0; s < i.length; s++)
12326
12326
  for (var a = i[s].subtables, o = 0; o < a.length; o++)
12327
12327
  for (var h = a[o], c = this.expandCoverage(h.coverage), u = h.ligatureSets, f = 0; f < c.length; f++)
12328
- for (var l = c[f], p = u[f], g = 0; g < p.length; g++) {
12329
- var m = p[g];
12328
+ for (var l = c[f], p = u[f], d = 0; d < p.length; d++) {
12329
+ var m = p[d];
12330
12330
  r.push({
12331
12331
  sub: [l].concat(m.components),
12332
12332
  by: m.ligGlyph
@@ -12453,14 +12453,14 @@ var P1 = Fc((L) => {
12453
12453
  for (var f = r.parseByte(), l = 0; l < f; l += 1)
12454
12454
  i.push(s), u += 1;
12455
12455
  if (H.argument(i.length === c, "Bad flags."), a.length > 0) {
12456
- var p = [], g;
12456
+ var p = [], d;
12457
12457
  if (c > 0) {
12458
12458
  for (var m = 0; m < c; m += 1)
12459
- s = i[m], g = {}, g.onCurve = !!(s & 1), g.lastPointOfContour = a.indexOf(m) >= 0, p.push(g);
12459
+ s = i[m], d = {}, d.onCurve = !!(s & 1), d.lastPointOfContour = a.indexOf(m) >= 0, p.push(d);
12460
12460
  for (var x = 0, v = 0; v < c; v += 1)
12461
- s = i[v], g = p[v], g.x = fo(r, s, x, 2, 16), x = g.x;
12461
+ s = i[v], d = p[v], d.x = fo(r, s, x, 2, 16), x = d.x;
12462
12462
  for (var w = 0, b = 0; b < c; b += 1)
12463
- s = i[b], g = p[b], g.y = fo(r, s, w, 4, 32), w = g.y;
12463
+ s = i[b], d = p[b], d.y = fo(r, s, w, 4, 32), w = d.y;
12464
12464
  }
12465
12465
  n.points = p;
12466
12466
  } else
@@ -12841,12 +12841,12 @@ var P1 = Fc((L) => {
12841
12841
  for (var c = 0; c < i.length; c++) {
12842
12842
  var u = i[c], f = h.glyphs.get(u.glyphIndex);
12843
12843
  o = new Bt("glyf", f.instructions), L.DEBUG && (console.log("---EXEC COMP " + c + "---"), o.step = -1), _s(f, o, t, r);
12844
- for (var l = Math.round(u.dx * t), p = Math.round(u.dy * r), g = o.gZone, m = o.contours, x = 0; x < g.length; x++) {
12845
- var v = g[x];
12844
+ for (var l = Math.round(u.dx * t), p = Math.round(u.dy * r), d = o.gZone, m = o.contours, x = 0; x < d.length; x++) {
12845
+ var v = d[x];
12846
12846
  v.xTouched = v.yTouched = !1, v.xo = v.x = v.x + l, v.yo = v.y = v.y + p;
12847
12847
  }
12848
12848
  var w = a.length;
12849
- a.push.apply(a, g);
12849
+ a.push.apply(a, d);
12850
12850
  for (var b = 0; b < m.length; b++)
12851
12851
  s.push(m[b] + w);
12852
12852
  }
@@ -12878,8 +12878,8 @@ var P1 = Fc((L) => {
12878
12878
  new vt(Math.round(n.advanceWidth * t), 0)
12879
12879
  ), Kt(e), a.length -= 2, L.DEBUG) {
12880
12880
  console.log("FINISHED GLYPH", e.stack);
12881
- for (var g = 0; g < s; g++)
12882
- console.log(g, a[g].x, a[g].y);
12881
+ for (var d = 0; d < s; d++)
12882
+ console.log(d, a[d].x, a[d].y);
12883
12883
  }
12884
12884
  }
12885
12885
  };
@@ -12963,8 +12963,8 @@ var P1 = Fc((L) => {
12963
12963
  function Qf(n) {
12964
12964
  var e = n.stack, t = e.pop(), r = e.pop(), i = e.pop(), s = e.pop(), a = e.pop(), o = n.z0, h = n.z1, c = o[t], u = o[r], f = h[i], l = h[s], p = n.z2[a];
12965
12965
  L.DEBUG && console.log("ISECT[], ", t, r, i, s, a);
12966
- var g = c.x, m = c.y, x = u.x, v = u.y, w = f.x, b = f.y, S = l.x, T = l.y, B = (g - x) * (b - T) - (m - v) * (w - S), M = g * v - m * x, _ = w * T - b * S;
12967
- p.x = (M * (w - S) - _ * (g - x)) / B, p.y = (M * (b - T) - _ * (m - v)) / B;
12966
+ var d = c.x, m = c.y, x = u.x, v = u.y, w = f.x, b = f.y, S = l.x, T = l.y, B = (d - x) * (b - T) - (m - v) * (w - S), M = d * v - m * x, _ = w * T - b * S;
12967
+ p.x = (M * (w - S) - _ * (d - x)) / B, p.y = (M * (b - T) - _ * (m - v)) / B;
12968
12968
  }
12969
12969
  function Kf(n) {
12970
12970
  n.rp0 = n.stack.pop(), L.DEBUG && console.log(n.step, "SRP0[]", n.rp0);
@@ -13317,10 +13317,10 @@ var P1 = Fc((L) => {
13317
13317
  for (var u = 0; u < r; u++) {
13318
13318
  var f = t.pop(), l = t.pop(), p = o + ((l & 240) >> 4);
13319
13319
  if (p === a) {
13320
- var g = (l & 15) - 8;
13321
- g >= 0 && g++, L.DEBUG && console.log(e.step, "DELTAPFIX", f, "by", g * h);
13320
+ var d = (l & 15) - 8;
13321
+ d >= 0 && d++, L.DEBUG && console.log(e.step, "DELTAPFIX", f, "by", d * h);
13322
13322
  var m = c[f];
13323
- i.setRelative(m, m, g * h, s);
13323
+ i.setRelative(m, m, d * h, s);
13324
13324
  }
13325
13325
  }
13326
13326
  }
@@ -13524,8 +13524,8 @@ var P1 = Fc((L) => {
13524
13524
  e.ip = t;
13525
13525
  }
13526
13526
  function z(n, e, t, r, i, s) {
13527
- var a = s.stack, o = n && a.pop(), h = a.pop(), c = s.rp0, u = s.z0[c], f = s.z1[h], l = s.minDis, p = s.fv, g = s.dpv, m, x, v, w;
13528
- x = m = g.distance(f, u, !0, !0), v = x >= 0 ? 1 : -1, x = Math.abs(x), n && (w = s.cvt[o], r && Math.abs(x - w) < s.cvCutIn && (x = w)), t && x < l && (x = l), r && (x = s.round(x)), p.setRelative(f, u, v * x, g), p.touch(f), L.DEBUG && console.log(
13527
+ var a = s.stack, o = n && a.pop(), h = a.pop(), c = s.rp0, u = s.z0[c], f = s.z1[h], l = s.minDis, p = s.fv, d = s.dpv, m, x, v, w;
13528
+ x = m = d.distance(f, u, !0, !0), v = x >= 0 ? 1 : -1, x = Math.abs(x), n && (w = s.cvt[o], r && Math.abs(x - w) < s.cvCutIn && (x = w)), t && x < l && (x = l), r && (x = s.round(x)), p.setRelative(f, u, v * x, d), p.touch(f), L.DEBUG && console.log(
13529
13529
  s.step,
13530
13530
  (n ? "MIRP[" : "MDRP[") + (e ? "M" : "m") + (t ? ">" : "_") + (r ? "R" : "_") + (i === 0 ? "Gr" : i === 1 ? "Bl" : i === 2 ? "Wh" : "") + "]",
13531
13531
  n ? o + "(" + s.cvt[o] + "," + w + ")" : "",
@@ -14412,7 +14412,7 @@ var P1 = Fc((L) => {
14412
14412
  ), f = r.length === e.inputCoverage.length && o.length === e.lookaheadCoverage.length && u.length === e.backtrackCoverage.length, l = [];
14413
14413
  if (f)
14414
14414
  for (var p = 0; p < e.lookupRecords.length; p++)
14415
- for (var g = e.lookupRecords[p], m = g.lookupListIndex, x = this.getLookupByIndex(m), v = 0; v < x.subtables.length; v++) {
14415
+ for (var d = e.lookupRecords[p], m = d.lookupListIndex, x = this.getLookupByIndex(m), v = 0; v < x.subtables.length; v++) {
14416
14416
  var w = x.subtables[v], b = this.getLookupMethod(x, w), S = this.getSubstitutionType(x, w);
14417
14417
  if (S === "12")
14418
14418
  for (var T = 0; T < r.length; T++) {
@@ -15253,8 +15253,8 @@ var P1 = Fc((L) => {
15253
15253
  r.skip("uShort", 1);
15254
15254
  for (var a = r.parseUShort(), o = r.parseUShort(), h = r.parseUShort(), c = r.parseUShort(), u = [], f = 0; f < a; f++)
15255
15255
  u.push(Zp(n, e + s + f * o, t));
15256
- for (var l = [], p = e + s + a * o, g = 0; g < h; g++)
15257
- l.push($p(n, p + g * c, u, t));
15256
+ for (var l = [], p = e + s + a * o, d = 0; d < h; d++)
15257
+ l.push($p(n, p + d * c, u, t));
15258
15258
  return { axes: u, instances: l };
15259
15259
  }
15260
15260
  var Kp = { make: jp, parse: Qp }, ed = function() {
@@ -15497,7 +15497,7 @@ var P1 = Fc((L) => {
15497
15497
  a = P.getUShort(s, 12), o = md(s, a);
15498
15498
  } else
15499
15499
  throw new Error("Unsupported OpenType signature " + h);
15500
- for (var u, f, l, p, g, m, x, v, w, b, S, T, B = 0; B < a; B += 1) {
15500
+ for (var u, f, l, p, d, m, x, v, w, b, S, T, B = 0; B < a; B += 1) {
15501
15501
  var M = o[B], _ = void 0;
15502
15502
  switch (M.tag) {
15503
15503
  case "cmap":
@@ -15555,7 +15555,7 @@ var P1 = Fc((L) => {
15555
15555
  p = M;
15556
15556
  break;
15557
15557
  case "GPOS":
15558
- g = M;
15558
+ d = M;
15559
15559
  break;
15560
15560
  case "GSUB":
15561
15561
  m = M;
@@ -15584,8 +15584,8 @@ var P1 = Fc((L) => {
15584
15584
  var ne = de(s, p);
15585
15585
  i.tables.gdef = ad.parse(ne.data, ne.offset);
15586
15586
  }
15587
- if (g) {
15588
- var ae = de(s, g);
15587
+ if (d) {
15588
+ var ae = de(s, d);
15589
15589
  i.tables.gpos = ud.parse(ae.data, ae.offset), i.position.init();
15590
15590
  }
15591
15591
  if (m) {
@@ -15640,8 +15640,8 @@ var P1 = Fc((L) => {
15640
15640
  const f = [];
15641
15641
  for (let l = 0; l < n.length; ++l) {
15642
15642
  const p = n[l].index;
15643
- for (let g = 0; g < p.count; ++g)
15644
- f.push(p.getX(g) + u);
15643
+ for (let d = 0; d < p.count; ++d)
15644
+ f.push(p.getX(d) + u);
15645
15645
  u += n[l].attributes.position.count;
15646
15646
  }
15647
15647
  h.setIndex(f);
@@ -15660,10 +15660,10 @@ var P1 = Fc((L) => {
15660
15660
  const p = [];
15661
15661
  for (let m = 0; m < a[u].length; ++m)
15662
15662
  p.push(a[u][m][l]);
15663
- const g = Ro(p);
15664
- if (!g)
15663
+ const d = Ro(p);
15664
+ if (!d)
15665
15665
  return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the " + u + " morphAttribute."), null;
15666
- h.morphAttributes[u].push(g);
15666
+ h.morphAttributes[u].push(d);
15667
15667
  }
15668
15668
  }
15669
15669
  return h;
@@ -15689,9 +15689,9 @@ var P1 = Fc((L) => {
15689
15689
  if (u.isInterleavedBufferAttribute) {
15690
15690
  const f = h / t;
15691
15691
  for (let l = 0, p = u.count; l < p; l++)
15692
- for (let g = 0; g < t; g++) {
15693
- const m = u.getComponent(l, g);
15694
- o.setComponent(l + f, g, m);
15692
+ for (let d = 0; d < t; d++) {
15693
+ const m = u.getComponent(l, d);
15694
+ o.setComponent(l + f, d, m);
15695
15695
  }
15696
15696
  } else
15697
15697
  a.set(u.array, h);
@@ -15717,7 +15717,7 @@ var P1 = Fc((L) => {
15717
15717
  c[S][_] = new M.constructor(D, M.itemSize, M.normalized);
15718
15718
  }));
15719
15719
  }
15720
- const p = e * 0.5, g = Math.log10(1 / e), m = Math.pow(10, g), x = p * m;
15720
+ const p = e * 0.5, d = Math.log10(1 / e), m = Math.pow(10, d), x = p * m;
15721
15721
  for (let w = 0; w < s; w++) {
15722
15722
  const b = r ? r.getX(w) : w;
15723
15723
  let S = "";
@@ -15826,7 +15826,7 @@ var P1 = Fc((L) => {
15826
15826
  return;
15827
15827
  }
15828
15828
  const a = new yh();
15829
- let o, h, c, u, f, l, p, g;
15829
+ let o, h, c, u, f, l, p, d;
15830
15830
  if (s.o) {
15831
15831
  const m = s._cachedOutline || (s._cachedOutline = s.o.split(" "));
15832
15832
  for (let x = 0, v = m.length; x < v; )
@@ -15841,7 +15841,7 @@ var P1 = Fc((L) => {
15841
15841
  c = m[x++] * e + t, u = m[x++] * e + r, f = m[x++] * e + t, l = m[x++] * e + r, a.quadraticCurveTo(f, l, c, u);
15842
15842
  break;
15843
15843
  case "b":
15844
- c = m[x++] * e + t, u = m[x++] * e + r, f = m[x++] * e + t, l = m[x++] * e + r, p = m[x++] * e + t, g = m[x++] * e + r, a.bezierCurveTo(f, l, p, g, c, u);
15844
+ c = m[x++] * e + t, u = m[x++] * e + r, f = m[x++] * e + t, l = m[x++] * e + r, p = m[x++] * e + t, d = m[x++] * e + r, a.bezierCurveTo(f, l, p, d, c, u);
15845
15845
  break;
15846
15846
  }
15847
15847
  }
@@ -15923,7 +15923,7 @@ var P1 = Fc((L) => {
15923
15923
  let h = 0;
15924
15924
  for (; h < o.length; ) {
15925
15925
  const c = o[h++];
15926
- let u, f, l, p, g, m, x, v;
15926
+ let u, f, l, p, d, m, x, v;
15927
15927
  switch (c) {
15928
15928
  case "m":
15929
15929
  u = parseFloat(o[h++]) * e + t, f = parseFloat(o[h++]) * e + r, a.moveTo(u, f);
@@ -15932,10 +15932,10 @@ var P1 = Fc((L) => {
15932
15932
  u = parseFloat(o[h++]) * e + t, f = parseFloat(o[h++]) * e + r, a.lineTo(u, f);
15933
15933
  break;
15934
15934
  case "q":
15935
- l = parseFloat(o[h++]) * e + t, p = parseFloat(o[h++]) * e + r, g = parseFloat(o[h++]) * e + t, m = parseFloat(o[h++]) * e + r, a.quadraticCurveTo(g, m, l, p);
15935
+ l = parseFloat(o[h++]) * e + t, p = parseFloat(o[h++]) * e + r, d = parseFloat(o[h++]) * e + t, m = parseFloat(o[h++]) * e + r, a.quadraticCurveTo(d, m, l, p);
15936
15936
  break;
15937
15937
  case "b":
15938
- l = parseFloat(o[h++]) * e + t, p = parseFloat(o[h++]) * e + r, g = parseFloat(o[h++]) * e + t, m = parseFloat(o[h++]) * e + r, x = parseFloat(o[h++]) * e + t, v = parseFloat(o[h++]) * e + r, a.bezierCurveTo(g, m, x, v, l, p);
15938
+ l = parseFloat(o[h++]) * e + t, p = parseFloat(o[h++]) * e + r, d = parseFloat(o[h++]) * e + t, m = parseFloat(o[h++]) * e + r, x = parseFloat(o[h++]) * e + t, v = parseFloat(o[h++]) * e + r, a.bezierCurveTo(d, m, x, v, l, p);
15939
15939
  break;
15940
15940
  }
15941
15941
  }
@@ -16024,23 +16024,23 @@ var P1 = Fc((L) => {
16024
16024
  if (!t || t.length === 0) return [];
16025
16025
  const r = t.map((p) => p.getPoints(e)), i = Ed(r), s = Ad(i), a = Md(i), o = t.length, h = Array(o).fill(-1), c = Array(o).fill(-1);
16026
16026
  for (const p of a) {
16027
- const g = [{ idx: p, d: 0 }];
16028
- for (; g.length; ) {
16029
- const m = g.pop();
16027
+ const d = [{ idx: p, d: 0 }];
16028
+ for (; d.length; ) {
16029
+ const m = d.pop();
16030
16030
  h[m.idx] = m.d, c[m.idx] = p;
16031
- for (const x of s[m.idx]) g.push({ idx: x, d: m.d + 1 });
16031
+ for (const x of s[m.idx]) d.push({ idx: x, d: m.d + 1 });
16032
16032
  }
16033
16033
  }
16034
16034
  const u = [], f = /* @__PURE__ */ new Set();
16035
16035
  function l(p) {
16036
- const g = Do(t[p], !0);
16036
+ const d = Do(t[p], !0);
16037
16037
  f.add(p);
16038
16038
  for (const m of s[p])
16039
16039
  if (!f.has(m) && h[m] === h[p] + 1) {
16040
16040
  const x = Do(t[m], !1);
16041
- g.holes.push(x), f.add(m);
16041
+ d.holes.push(x), f.add(m);
16042
16042
  }
16043
- u.push(g);
16043
+ u.push(d);
16044
16044
  }
16045
16045
  for (const p of a) l(p);
16046
16046
  for (let p = 0; p < o; p++)
@@ -16610,7 +16610,7 @@ var P1 = Fc((L) => {
16610
16610
  }
16611
16611
  }
16612
16612
  }
16613
- class le {
16613
+ class fe {
16614
16614
  /**
16615
16615
  * Creates a new Point instance.
16616
16616
  * @param x - The x-coordinate (defaults to 0)
@@ -16648,7 +16648,7 @@ var P1 = Fc((L) => {
16648
16648
  * @returns A new Point instance with the same x and y values
16649
16649
  */
16650
16650
  clone() {
16651
- return new le(this.x, this.y);
16651
+ return new fe(this.x, this.y);
16652
16652
  }
16653
16653
  /**
16654
16654
  * Adds another point's coordinates to this point.
@@ -16753,18 +16753,18 @@ var P1 = Fc((L) => {
16753
16753
  }
16754
16754
  const i = 4 * Math.atan(Math.abs(this.bulge));
16755
16755
  this.radius = r / (2 * Math.sin(i / 2));
16756
- const s = this.start.clone().add(t.clone().divide(2)), a = new le(-t.y, t.x);
16756
+ const s = this.start.clone().add(t.clone().divide(2)), a = new fe(-t.y, t.x);
16757
16757
  a.normalize(), a.multiply(Math.abs(this.radius * Math.cos(i / 2))), this.center = s.clone(), this.isClockwise ? this.center.subtract(a) : this.center.add(a), this.startAngle = Math.atan2(this.start.y - this.center.y, this.start.x - this.center.x), this.endAngle = Math.atan2(this.end.y - this.center.y, this.end.x - this.center.x), this.isClockwise ? this.endAngle >= this.startAngle && (this.endAngle -= 2 * Math.PI) : this.endAngle <= this.startAngle && (this.endAngle += 2 * Math.PI);
16758
16758
  } else if (e.center && e.radius !== void 0 && e.startOctant !== void 0 && e.octantCount !== void 0 && e.isClockwise !== void 0) {
16759
16759
  this.center = e.center.clone(), this.radius = e.radius, this.isClockwise = e.isClockwise, this.startAngle = e.startOctant * Io;
16760
16760
  const t = (e.octantCount === 0 ? 8 : e.octantCount) * Io;
16761
16761
  this.endAngle = this.startAngle + (this.isClockwise ? -t : t), this.start = this.center.clone().add(
16762
- new le(
16762
+ new fe(
16763
16763
  this.radius * Math.cos(this.startAngle),
16764
16764
  this.radius * Math.sin(this.startAngle)
16765
16765
  )
16766
16766
  ), this.end = this.center.clone().add(
16767
- new le(this.radius * Math.cos(this.endAngle), this.radius * Math.sin(this.endAngle))
16767
+ new fe(this.radius * Math.cos(this.endAngle), this.radius * Math.sin(this.endAngle))
16768
16768
  );
16769
16769
  } else
16770
16770
  throw new Error("Invalid arc parameters");
@@ -16781,12 +16781,12 @@ var P1 = Fc((L) => {
16781
16781
  for (let s = 1; s < i; s++) {
16782
16782
  const a = s / i, o = this.isClockwise ? this.startAngle - a * r : this.startAngle + a * r;
16783
16783
  t.push(
16784
- this.center.clone().add(new le(this.radius * Math.cos(o), this.radius * Math.sin(o)))
16784
+ this.center.clone().add(new fe(this.radius * Math.cos(o), this.radius * Math.sin(o)))
16785
16785
  );
16786
16786
  }
16787
16787
  return t.push(
16788
16788
  this.end ? this.end.clone() : this.center.clone().add(
16789
- new le(
16789
+ new fe(
16790
16790
  this.radius * Math.cos(this.endAngle),
16791
16791
  this.radius * Math.sin(this.endAngle)
16792
16792
  )
@@ -16833,7 +16833,7 @@ var P1 = Fc((L) => {
16833
16833
  */
16834
16834
  normalizeToOrigin(e = !1) {
16835
16835
  const t = this.bbox;
16836
- return this.offset(new le(-t.minX, -t.minY), e);
16836
+ return this.offset(new fe(-t.minX, -t.minY), e);
16837
16837
  }
16838
16838
  /**
16839
16839
  * Converts the shape to an SVG string
@@ -16844,14 +16844,14 @@ var P1 = Fc((L) => {
16844
16844
  const { strokeWidth: t = "0.5%", strokeColor: r = "black", isAutoFit: i = !1 } = e;
16845
16845
  let s, a;
16846
16846
  if (i) {
16847
- const o = this.bbox, h = 0.2, c = o.maxX - o.minX, u = o.maxY - o.minY, f = c === 0 ? u : c, l = u === 0 ? c : u, p = o.minX - f * h, g = o.maxX + f * h, m = o.minY - l * h, x = o.maxY + l * h;
16847
+ const o = this.bbox, h = 0.2, c = o.maxX - o.minX, u = o.maxY - o.minY, f = c === 0 ? u : c, l = u === 0 ? c : u, p = o.minX - f * h, d = o.maxX + f * h, m = o.minY - l * h, x = o.maxY + l * h;
16848
16848
  a = this.polylines.map((v) => {
16849
16849
  let w = "";
16850
16850
  return v.forEach((b, S) => {
16851
16851
  const T = b.x, B = -b.y;
16852
16852
  w += S === 0 ? `M ${T} ${B} ` : `L ${T} ${B} `;
16853
16853
  }), `<path d="${w}" stroke="${r}" stroke-width="${t}" fill="none"/>`;
16854
- }).join(""), s = `${p} ${-x} ${g - p} ${x - m}`;
16854
+ }).join(""), s = `${p} ${-x} ${d - p} ${x - m}`;
16855
16855
  } else
16856
16856
  s = "0 0 20 20", a = this.polylines.map((o) => {
16857
16857
  let h = "";
@@ -16939,8 +16939,8 @@ var P1 = Fc((L) => {
16939
16939
  u && (u.x *= c, u.y *= h);
16940
16940
  const f = e.polylines.map(
16941
16941
  (l) => l.map((p) => {
16942
- const g = p.clone();
16943
- return g.x *= c, g.y *= h, g;
16942
+ const d = p.clone();
16943
+ return d.x *= c, d.y *= h, d;
16944
16944
  })
16945
16945
  );
16946
16946
  return new Gr(u, f);
@@ -16952,7 +16952,7 @@ var P1 = Fc((L) => {
16952
16952
  */
16953
16953
  parseShape(e) {
16954
16954
  const t = {
16955
- currentPoint: new le(),
16955
+ currentPoint: new fe(),
16956
16956
  polylines: [],
16957
16957
  currentPolyline: [],
16958
16958
  sp: [],
@@ -17038,7 +17038,7 @@ var P1 = Fc((L) => {
17038
17038
  * @returns Returns the vector for the given direction code
17039
17039
  */
17040
17040
  getVectorForDirection(e) {
17041
- const t = new le();
17041
+ const t = new fe();
17042
17042
  switch (e) {
17043
17043
  case 0:
17044
17044
  t.x = 1;
@@ -17109,13 +17109,13 @@ var P1 = Fc((L) => {
17109
17109
  }
17110
17110
  handleXYDisplacement(e, t, r) {
17111
17111
  let i = t;
17112
- const s = new le();
17112
+ const s = new fe();
17113
17113
  return s.x = Ce.byteToSByte(e[++i]), s.y = Ce.byteToSByte(e[++i]), r.currentPoint.add(s.multiply(r.scale)), r.isPenDown && r.currentPolyline.push(r.currentPoint.clone()), i;
17114
17114
  }
17115
17115
  handleMultipleXYDisplacements(e, t, r) {
17116
17116
  let i = t;
17117
17117
  for (; ; ) {
17118
- const s = new le();
17118
+ const s = new fe();
17119
17119
  if (s.x = Ce.byteToSByte(e[++i]), s.y = Ce.byteToSByte(e[++i]), s.x === 0 && s.y === 0)
17120
17120
  break;
17121
17121
  r.currentPoint.add(s.multiply(r.scale)), r.isPenDown && r.currentPolyline.push(r.currentPoint.clone());
@@ -17127,10 +17127,10 @@ var P1 = Fc((L) => {
17127
17127
  let s = t;
17128
17128
  const a = e[++s] * r.scale, o = Ce.byteToSByte(e[++s]), h = (o & 112) >> 4;
17129
17129
  let c = o & 7;
17130
- const u = o < 0, f = Math.PI / 4 * h, l = r.currentPoint.clone().subtract(new le(Math.cos(f) * a, Math.sin(f) * a)), p = jr.fromOctant(l, a, h, c, u);
17130
+ const u = o < 0, f = Math.PI / 4 * h, l = r.currentPoint.clone().subtract(new fe(Math.cos(f) * a, Math.sin(f) * a)), p = jr.fromOctant(l, a, h, c, u);
17131
17131
  if (r.isPenDown) {
17132
- const g = p.tessellate();
17133
- r.currentPolyline.pop(), r.currentPolyline.push(...g.slice());
17132
+ const d = p.tessellate();
17133
+ r.currentPolyline.pop(), r.currentPolyline.push(...d.slice());
17134
17134
  }
17135
17135
  return r.currentPoint = (i = p.tessellate().pop()) == null ? void 0 : i.clone(), s;
17136
17136
  }
@@ -17140,33 +17140,33 @@ var P1 = Fc((L) => {
17140
17140
  let l = u & 7;
17141
17141
  l === 0 && (l = 8), a !== 0 && l--;
17142
17142
  const p = Math.PI / 4;
17143
- let g = p * l, m = Nd, x = 1;
17144
- u < 0 && (m = -m, g = -g, x = -1);
17145
- let v = p * f, w = v + g;
17143
+ let d = p * l, m = Nd, x = 1;
17144
+ u < 0 && (m = -m, d = -d, x = -1);
17145
+ let v = p * f, w = v + d;
17146
17146
  v += p * s / 256 * x, w += p * a / 256 * x;
17147
- const b = r.currentPoint.clone().subtract(new le(c * Math.cos(v), c * Math.sin(v)));
17148
- if (r.currentPoint = b.clone().add(new le(c * Math.cos(w), c * Math.sin(w))), r.isPenDown) {
17147
+ const b = r.currentPoint.clone().subtract(new fe(c * Math.cos(v), c * Math.sin(v)));
17148
+ if (r.currentPoint = b.clone().add(new fe(c * Math.cos(w), c * Math.sin(w))), r.isPenDown) {
17149
17149
  let S = v;
17150
17150
  const T = [];
17151
17151
  if (T.push(
17152
- b.clone().add(new le(c * Math.cos(S), c * Math.sin(S)))
17152
+ b.clone().add(new fe(c * Math.cos(S), c * Math.sin(S)))
17153
17153
  ), m > 0)
17154
17154
  for (; S + m < w; )
17155
17155
  S += m, T.push(
17156
- b.clone().add(new le(c * Math.cos(S), c * Math.sin(S)))
17156
+ b.clone().add(new fe(c * Math.cos(S), c * Math.sin(S)))
17157
17157
  );
17158
17158
  else
17159
17159
  for (; S + m > w; )
17160
17160
  S += m, T.push(
17161
- b.clone().add(new le(c * Math.cos(S), c * Math.sin(S)))
17161
+ b.clone().add(new fe(c * Math.cos(S), c * Math.sin(S)))
17162
17162
  );
17163
- T.push(b.clone().add(new le(c * Math.cos(w), c * Math.sin(w)))), r.currentPolyline.push(...T);
17163
+ T.push(b.clone().add(new fe(c * Math.cos(w), c * Math.sin(w)))), r.currentPolyline.push(...T);
17164
17164
  }
17165
17165
  return i;
17166
17166
  }
17167
17167
  handleBulgeArc(e, t, r) {
17168
17168
  let i = t;
17169
- const s = new le();
17169
+ const s = new fe();
17170
17170
  s.x = Ce.byteToSByte(e[++i]), s.y = Ce.byteToSByte(e[++i]);
17171
17171
  const a = Ce.byteToSByte(e[++i]);
17172
17172
  return r.currentPoint = this.handleArcSegment(
@@ -17181,7 +17181,7 @@ var P1 = Fc((L) => {
17181
17181
  handleMultipleBulgeArcs(e, t, r) {
17182
17182
  let i = t;
17183
17183
  for (; ; ) {
17184
- const s = new le();
17184
+ const s = new fe();
17185
17185
  if (s.x = Ce.byteToSByte(e[++i]), s.y = Ce.byteToSByte(e[++i]), s.x === 0 && s.y === 0)
17186
17186
  break;
17187
17187
  const a = Ce.byteToSByte(e[++i]);
@@ -17420,12 +17420,12 @@ var P1 = Fc((L) => {
17420
17420
  return (p ? -1 : 1) * a * Math.pow(2, s - r);
17421
17421
  };
17422
17422
  qs.write = function(n, e, t, r, i, s) {
17423
- var a, o, h, c = s * 8 - i - 1, u = (1 << c) - 1, f = u >> 1, l = i === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, p = r ? 0 : s - 1, g = r ? 1 : -1, m = e < 0 || e === 0 && 1 / e < 0 ? 1 : 0;
17424
- for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (o = isNaN(e) ? 1 : 0, a = u) : (a = Math.floor(Math.log(e) / Math.LN2), e * (h = Math.pow(2, -a)) < 1 && (a--, h *= 2), a + f >= 1 ? e += l / h : e += l * Math.pow(2, 1 - f), e * h >= 2 && (a++, h /= 2), a + f >= u ? (o = 0, a = u) : a + f >= 1 ? (o = (e * h - 1) * Math.pow(2, i), a = a + f) : (o = e * Math.pow(2, f - 1) * Math.pow(2, i), a = 0)); i >= 8; n[t + p] = o & 255, p += g, o /= 256, i -= 8)
17423
+ var a, o, h, c = s * 8 - i - 1, u = (1 << c) - 1, f = u >> 1, l = i === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, p = r ? 0 : s - 1, d = r ? 1 : -1, m = e < 0 || e === 0 && 1 / e < 0 ? 1 : 0;
17424
+ for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (o = isNaN(e) ? 1 : 0, a = u) : (a = Math.floor(Math.log(e) / Math.LN2), e * (h = Math.pow(2, -a)) < 1 && (a--, h *= 2), a + f >= 1 ? e += l / h : e += l * Math.pow(2, 1 - f), e * h >= 2 && (a++, h /= 2), a + f >= u ? (o = 0, a = u) : a + f >= 1 ? (o = (e * h - 1) * Math.pow(2, i), a = a + f) : (o = e * Math.pow(2, f - 1) * Math.pow(2, i), a = 0)); i >= 8; n[t + p] = o & 255, p += d, o /= 256, i -= 8)
17425
17425
  ;
17426
- for (a = a << i | o, c += i; c > 0; n[t + p] = a & 255, p += g, a /= 256, c -= 8)
17426
+ for (a = a << i | o, c += i; c > 0; n[t + p] = a & 255, p += d, a /= 256, c -= 8)
17427
17427
  ;
17428
- n[t + p - g] |= m * 128;
17428
+ n[t + p - d] |= m * 128;
17429
17429
  };
17430
17430
  /*!
17431
17431
  * The buffer module from node.js, for the browser.
@@ -17442,10 +17442,10 @@ var P1 = Fc((L) => {
17442
17442
  );
17443
17443
  function s() {
17444
17444
  try {
17445
- var F = new Uint8Array(1), d = { foo: function() {
17445
+ var F = new Uint8Array(1), g = { foo: function() {
17446
17446
  return 42;
17447
17447
  } };
17448
- return Object.setPrototypeOf(d, Uint8Array.prototype), Object.setPrototypeOf(F, d), F.foo() === 42;
17448
+ return Object.setPrototypeOf(g, Uint8Array.prototype), Object.setPrototypeOf(F, g), F.foo() === 42;
17449
17449
  } catch {
17450
17450
  return !1;
17451
17451
  }
@@ -17466,52 +17466,52 @@ var P1 = Fc((L) => {
17466
17466
  function a(F) {
17467
17467
  if (F > i)
17468
17468
  throw new RangeError('The value "' + F + '" is invalid for option "size"');
17469
- var d = new Uint8Array(F);
17470
- return Object.setPrototypeOf(d, o.prototype), d;
17469
+ var g = new Uint8Array(F);
17470
+ return Object.setPrototypeOf(g, o.prototype), g;
17471
17471
  }
17472
- function o(F, d, y) {
17472
+ function o(F, g, y) {
17473
17473
  if (typeof F == "number") {
17474
- if (typeof d == "string")
17474
+ if (typeof g == "string")
17475
17475
  throw new TypeError(
17476
17476
  'The "string" argument must be of type string. Received type number'
17477
17477
  );
17478
17478
  return f(F);
17479
17479
  }
17480
- return h(F, d, y);
17480
+ return h(F, g, y);
17481
17481
  }
17482
17482
  o.poolSize = 8192;
17483
- function h(F, d, y) {
17483
+ function h(F, g, y) {
17484
17484
  if (typeof F == "string")
17485
- return l(F, d);
17485
+ return l(F, g);
17486
17486
  if (ArrayBuffer.isView(F))
17487
- return g(F);
17487
+ return d(F);
17488
17488
  if (F == null)
17489
17489
  throw new TypeError(
17490
17490
  "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof F
17491
17491
  );
17492
17492
  if (Ke(F, ArrayBuffer) || F && Ke(F.buffer, ArrayBuffer) || typeof SharedArrayBuffer < "u" && (Ke(F, SharedArrayBuffer) || F && Ke(F.buffer, SharedArrayBuffer)))
17493
- return m(F, d, y);
17493
+ return m(F, g, y);
17494
17494
  if (typeof F == "number")
17495
17495
  throw new TypeError(
17496
17496
  'The "value" argument must not be of type number. Received type number'
17497
17497
  );
17498
17498
  var C = F.valueOf && F.valueOf();
17499
17499
  if (C != null && C !== F)
17500
- return o.from(C, d, y);
17500
+ return o.from(C, g, y);
17501
17501
  var k = x(F);
17502
17502
  if (k) return k;
17503
17503
  if (typeof Symbol < "u" && Symbol.toPrimitive != null && typeof F[Symbol.toPrimitive] == "function")
17504
17504
  return o.from(
17505
17505
  F[Symbol.toPrimitive]("string"),
17506
- d,
17506
+ g,
17507
17507
  y
17508
17508
  );
17509
17509
  throw new TypeError(
17510
17510
  "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof F
17511
17511
  );
17512
17512
  }
17513
- o.from = function(F, d, y) {
17514
- return h(F, d, y);
17513
+ o.from = function(F, g, y) {
17514
+ return h(F, g, y);
17515
17515
  }, Object.setPrototypeOf(o.prototype, Uint8Array.prototype), Object.setPrototypeOf(o, Uint8Array);
17516
17516
  function c(F) {
17517
17517
  if (typeof F != "number")
@@ -17519,11 +17519,11 @@ var P1 = Fc((L) => {
17519
17519
  if (F < 0)
17520
17520
  throw new RangeError('The value "' + F + '" is invalid for option "size"');
17521
17521
  }
17522
- function u(F, d, y) {
17523
- return c(F), F <= 0 ? a(F) : d !== void 0 ? typeof y == "string" ? a(F).fill(d, y) : a(F).fill(d) : a(F);
17522
+ function u(F, g, y) {
17523
+ return c(F), F <= 0 ? a(F) : g !== void 0 ? typeof y == "string" ? a(F).fill(g, y) : a(F).fill(g) : a(F);
17524
17524
  }
17525
- o.alloc = function(F, d, y) {
17526
- return u(F, d, y);
17525
+ o.alloc = function(F, g, y) {
17526
+ return u(F, g, y);
17527
17527
  };
17528
17528
  function f(F) {
17529
17529
  return c(F), a(F < 0 ? 0 : v(F) | 0);
@@ -17533,36 +17533,36 @@ var P1 = Fc((L) => {
17533
17533
  }, o.allocUnsafeSlow = function(F) {
17534
17534
  return f(F);
17535
17535
  };
17536
- function l(F, d) {
17537
- if ((typeof d != "string" || d === "") && (d = "utf8"), !o.isEncoding(d))
17538
- throw new TypeError("Unknown encoding: " + d);
17539
- var y = b(F, d) | 0, C = a(y), k = C.write(F, d);
17536
+ function l(F, g) {
17537
+ if ((typeof g != "string" || g === "") && (g = "utf8"), !o.isEncoding(g))
17538
+ throw new TypeError("Unknown encoding: " + g);
17539
+ var y = b(F, g) | 0, C = a(y), k = C.write(F, g);
17540
17540
  return k !== y && (C = C.slice(0, k)), C;
17541
17541
  }
17542
17542
  function p(F) {
17543
- for (var d = F.length < 0 ? 0 : v(F.length) | 0, y = a(d), C = 0; C < d; C += 1)
17543
+ for (var g = F.length < 0 ? 0 : v(F.length) | 0, y = a(g), C = 0; C < g; C += 1)
17544
17544
  y[C] = F[C] & 255;
17545
17545
  return y;
17546
17546
  }
17547
- function g(F) {
17547
+ function d(F) {
17548
17548
  if (Ke(F, Uint8Array)) {
17549
- var d = new Uint8Array(F);
17550
- return m(d.buffer, d.byteOffset, d.byteLength);
17549
+ var g = new Uint8Array(F);
17550
+ return m(g.buffer, g.byteOffset, g.byteLength);
17551
17551
  }
17552
17552
  return p(F);
17553
17553
  }
17554
- function m(F, d, y) {
17555
- if (d < 0 || F.byteLength < d)
17554
+ function m(F, g, y) {
17555
+ if (g < 0 || F.byteLength < g)
17556
17556
  throw new RangeError('"offset" is outside of buffer bounds');
17557
- if (F.byteLength < d + (y || 0))
17557
+ if (F.byteLength < g + (y || 0))
17558
17558
  throw new RangeError('"length" is outside of buffer bounds');
17559
17559
  var C;
17560
- return d === void 0 && y === void 0 ? C = new Uint8Array(F) : y === void 0 ? C = new Uint8Array(F, d) : C = new Uint8Array(F, d, y), Object.setPrototypeOf(C, o.prototype), C;
17560
+ return g === void 0 && y === void 0 ? C = new Uint8Array(F) : y === void 0 ? C = new Uint8Array(F, g) : C = new Uint8Array(F, g, y), Object.setPrototypeOf(C, o.prototype), C;
17561
17561
  }
17562
17562
  function x(F) {
17563
17563
  if (o.isBuffer(F)) {
17564
- var d = v(F.length) | 0, y = a(d);
17565
- return y.length === 0 || F.copy(y, 0, 0, d), y;
17564
+ var g = v(F.length) | 0, y = a(g);
17565
+ return y.length === 0 || F.copy(y, 0, 0, g), y;
17566
17566
  }
17567
17567
  if (F.length !== void 0)
17568
17568
  return typeof F.length != "number" || fi(F.length) ? a(0) : p(F);
@@ -17577,22 +17577,22 @@ var P1 = Fc((L) => {
17577
17577
  function w(F) {
17578
17578
  return +F != F && (F = 0), o.alloc(+F);
17579
17579
  }
17580
- o.isBuffer = function(d) {
17581
- return d != null && d._isBuffer === !0 && d !== o.prototype;
17582
- }, o.compare = function(d, y) {
17583
- if (Ke(d, Uint8Array) && (d = o.from(d, d.offset, d.byteLength)), Ke(y, Uint8Array) && (y = o.from(y, y.offset, y.byteLength)), !o.isBuffer(d) || !o.isBuffer(y))
17580
+ o.isBuffer = function(g) {
17581
+ return g != null && g._isBuffer === !0 && g !== o.prototype;
17582
+ }, o.compare = function(g, y) {
17583
+ if (Ke(g, Uint8Array) && (g = o.from(g, g.offset, g.byteLength)), Ke(y, Uint8Array) && (y = o.from(y, y.offset, y.byteLength)), !o.isBuffer(g) || !o.isBuffer(y))
17584
17584
  throw new TypeError(
17585
17585
  'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'
17586
17586
  );
17587
- if (d === y) return 0;
17588
- for (var C = d.length, k = y.length, O = 0, R = Math.min(C, k); O < R; ++O)
17589
- if (d[O] !== y[O]) {
17590
- C = d[O], k = y[O];
17587
+ if (g === y) return 0;
17588
+ for (var C = g.length, k = y.length, O = 0, R = Math.min(C, k); O < R; ++O)
17589
+ if (g[O] !== y[O]) {
17590
+ C = g[O], k = y[O];
17591
17591
  break;
17592
17592
  }
17593
17593
  return C < k ? -1 : k < C ? 1 : 0;
17594
- }, o.isEncoding = function(d) {
17595
- switch (String(d).toLowerCase()) {
17594
+ }, o.isEncoding = function(g) {
17595
+ switch (String(g).toLowerCase()) {
17596
17596
  case "hex":
17597
17597
  case "utf8":
17598
17598
  case "utf-8":
@@ -17608,18 +17608,18 @@ var P1 = Fc((L) => {
17608
17608
  default:
17609
17609
  return !1;
17610
17610
  }
17611
- }, o.concat = function(d, y) {
17612
- if (!Array.isArray(d))
17611
+ }, o.concat = function(g, y) {
17612
+ if (!Array.isArray(g))
17613
17613
  throw new TypeError('"list" argument must be an Array of Buffers');
17614
- if (d.length === 0)
17614
+ if (g.length === 0)
17615
17615
  return o.alloc(0);
17616
17616
  var C;
17617
17617
  if (y === void 0)
17618
- for (y = 0, C = 0; C < d.length; ++C)
17619
- y += d[C].length;
17618
+ for (y = 0, C = 0; C < g.length; ++C)
17619
+ y += g[C].length;
17620
17620
  var k = o.allocUnsafe(y), O = 0;
17621
- for (C = 0; C < d.length; ++C) {
17622
- var R = d[C];
17621
+ for (C = 0; C < g.length; ++C) {
17622
+ var R = g[C];
17623
17623
  if (Ke(R, Uint8Array))
17624
17624
  O + R.length > k.length ? o.from(R).copy(k, O) : Uint8Array.prototype.set.call(
17625
17625
  k,
@@ -17634,7 +17634,7 @@ var P1 = Fc((L) => {
17634
17634
  }
17635
17635
  return k;
17636
17636
  };
17637
- function b(F, d) {
17637
+ function b(F, g) {
17638
17638
  if (o.isBuffer(F))
17639
17639
  return F.length;
17640
17640
  if (ArrayBuffer.isView(F) || Ke(F, ArrayBuffer))
@@ -17646,7 +17646,7 @@ var P1 = Fc((L) => {
17646
17646
  var y = F.length, C = arguments.length > 2 && arguments[2] === !0;
17647
17647
  if (!C && y === 0) return 0;
17648
17648
  for (var k = !1; ; )
17649
- switch (d) {
17649
+ switch (g) {
17650
17650
  case "ascii":
17651
17651
  case "latin1":
17652
17652
  case "binary":
@@ -17666,79 +17666,79 @@ var P1 = Fc((L) => {
17666
17666
  default:
17667
17667
  if (k)
17668
17668
  return C ? -1 : xt(F).length;
17669
- d = ("" + d).toLowerCase(), k = !0;
17669
+ g = ("" + g).toLowerCase(), k = !0;
17670
17670
  }
17671
17671
  }
17672
17672
  o.byteLength = b;
17673
- function S(F, d, y) {
17673
+ function S(F, g, y) {
17674
17674
  var C = !1;
17675
- if ((d === void 0 || d < 0) && (d = 0), d > this.length || ((y === void 0 || y > this.length) && (y = this.length), y <= 0) || (y >>>= 0, d >>>= 0, y <= d))
17675
+ if ((g === void 0 || g < 0) && (g = 0), g > this.length || ((y === void 0 || y > this.length) && (y = this.length), y <= 0) || (y >>>= 0, g >>>= 0, y <= g))
17676
17676
  return "";
17677
17677
  for (F || (F = "utf8"); ; )
17678
17678
  switch (F) {
17679
17679
  case "hex":
17680
- return ie(this, d, y);
17680
+ return ie(this, g, y);
17681
17681
  case "utf8":
17682
17682
  case "utf-8":
17683
- return Z(this, d, y);
17683
+ return Z(this, g, y);
17684
17684
  case "ascii":
17685
- return ne(this, d, y);
17685
+ return ne(this, g, y);
17686
17686
  case "latin1":
17687
17687
  case "binary":
17688
- return ae(this, d, y);
17688
+ return ae(this, g, y);
17689
17689
  case "base64":
17690
- return Y(this, d, y);
17690
+ return Y(this, g, y);
17691
17691
  case "ucs2":
17692
17692
  case "ucs-2":
17693
17693
  case "utf16le":
17694
17694
  case "utf-16le":
17695
- return he(this, d, y);
17695
+ return he(this, g, y);
17696
17696
  default:
17697
17697
  if (C) throw new TypeError("Unknown encoding: " + F);
17698
17698
  F = (F + "").toLowerCase(), C = !0;
17699
17699
  }
17700
17700
  }
17701
17701
  o.prototype._isBuffer = !0;
17702
- function T(F, d, y) {
17703
- var C = F[d];
17704
- F[d] = F[y], F[y] = C;
17702
+ function T(F, g, y) {
17703
+ var C = F[g];
17704
+ F[g] = F[y], F[y] = C;
17705
17705
  }
17706
17706
  o.prototype.swap16 = function() {
17707
- var d = this.length;
17708
- if (d % 2 !== 0)
17707
+ var g = this.length;
17708
+ if (g % 2 !== 0)
17709
17709
  throw new RangeError("Buffer size must be a multiple of 16-bits");
17710
- for (var y = 0; y < d; y += 2)
17710
+ for (var y = 0; y < g; y += 2)
17711
17711
  T(this, y, y + 1);
17712
17712
  return this;
17713
17713
  }, o.prototype.swap32 = function() {
17714
- var d = this.length;
17715
- if (d % 4 !== 0)
17714
+ var g = this.length;
17715
+ if (g % 4 !== 0)
17716
17716
  throw new RangeError("Buffer size must be a multiple of 32-bits");
17717
- for (var y = 0; y < d; y += 4)
17717
+ for (var y = 0; y < g; y += 4)
17718
17718
  T(this, y, y + 3), T(this, y + 1, y + 2);
17719
17719
  return this;
17720
17720
  }, o.prototype.swap64 = function() {
17721
- var d = this.length;
17722
- if (d % 8 !== 0)
17721
+ var g = this.length;
17722
+ if (g % 8 !== 0)
17723
17723
  throw new RangeError("Buffer size must be a multiple of 64-bits");
17724
- for (var y = 0; y < d; y += 8)
17724
+ for (var y = 0; y < g; y += 8)
17725
17725
  T(this, y, y + 7), T(this, y + 1, y + 6), T(this, y + 2, y + 5), T(this, y + 3, y + 4);
17726
17726
  return this;
17727
17727
  }, o.prototype.toString = function() {
17728
- var d = this.length;
17729
- return d === 0 ? "" : arguments.length === 0 ? Z(this, 0, d) : S.apply(this, arguments);
17730
- }, o.prototype.toLocaleString = o.prototype.toString, o.prototype.equals = function(d) {
17731
- if (!o.isBuffer(d)) throw new TypeError("Argument must be a Buffer");
17732
- return this === d ? !0 : o.compare(this, d) === 0;
17728
+ var g = this.length;
17729
+ return g === 0 ? "" : arguments.length === 0 ? Z(this, 0, g) : S.apply(this, arguments);
17730
+ }, o.prototype.toLocaleString = o.prototype.toString, o.prototype.equals = function(g) {
17731
+ if (!o.isBuffer(g)) throw new TypeError("Argument must be a Buffer");
17732
+ return this === g ? !0 : o.compare(this, g) === 0;
17733
17733
  }, o.prototype.inspect = function() {
17734
- var d = "", y = n.INSPECT_MAX_BYTES;
17735
- return d = this.toString("hex", 0, y).replace(/(.{2})/g, "$1 ").trim(), this.length > y && (d += " ... "), "<Buffer " + d + ">";
17736
- }, r && (o.prototype[r] = o.prototype.inspect), o.prototype.compare = function(d, y, C, k, O) {
17737
- if (Ke(d, Uint8Array) && (d = o.from(d, d.offset, d.byteLength)), !o.isBuffer(d))
17734
+ var g = "", y = n.INSPECT_MAX_BYTES;
17735
+ return g = this.toString("hex", 0, y).replace(/(.{2})/g, "$1 ").trim(), this.length > y && (g += " ... "), "<Buffer " + g + ">";
17736
+ }, r && (o.prototype[r] = o.prototype.inspect), o.prototype.compare = function(g, y, C, k, O) {
17737
+ if (Ke(g, Uint8Array) && (g = o.from(g, g.offset, g.byteLength)), !o.isBuffer(g))
17738
17738
  throw new TypeError(
17739
- 'The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof d
17739
+ 'The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof g
17740
17740
  );
17741
- if (y === void 0 && (y = 0), C === void 0 && (C = d ? d.length : 0), k === void 0 && (k = 0), O === void 0 && (O = this.length), y < 0 || C > d.length || k < 0 || O > this.length)
17741
+ if (y === void 0 && (y = 0), C === void 0 && (C = g ? g.length : 0), k === void 0 && (k = 0), O === void 0 && (O = this.length), y < 0 || C > g.length || k < 0 || O > this.length)
17742
17742
  throw new RangeError("out of range index");
17743
17743
  if (k >= O && y >= C)
17744
17744
  return 0;
@@ -17746,15 +17746,15 @@ var P1 = Fc((L) => {
17746
17746
  return -1;
17747
17747
  if (y >= C)
17748
17748
  return 1;
17749
- if (y >>>= 0, C >>>= 0, k >>>= 0, O >>>= 0, this === d) return 0;
17750
- for (var R = O - k, J = C - y, te = Math.min(R, J), oe = this.slice(k, O), be = d.slice(y, C), ue = 0; ue < te; ++ue)
17751
- if (oe[ue] !== be[ue]) {
17752
- R = oe[ue], J = be[ue];
17749
+ if (y >>>= 0, C >>>= 0, k >>>= 0, O >>>= 0, this === g) return 0;
17750
+ for (var R = O - k, J = C - y, te = Math.min(R, J), oe = this.slice(k, O), be = g.slice(y, C), le = 0; le < te; ++le)
17751
+ if (oe[le] !== be[le]) {
17752
+ R = oe[le], J = be[le];
17753
17753
  break;
17754
17754
  }
17755
17755
  return R < J ? -1 : J < R ? 1 : 0;
17756
17756
  };
17757
- function B(F, d, y, C, k) {
17757
+ function B(F, g, y, C, k) {
17758
17758
  if (F.length === 0) return -1;
17759
17759
  if (typeof y == "string" ? (C = y, y = 0) : y > 2147483647 ? y = 2147483647 : y < -2147483648 && (y = -2147483648), y = +y, fi(y) && (y = k ? 0 : F.length - 1), y < 0 && (y = F.length + y), y >= F.length) {
17760
17760
  if (k) return -1;
@@ -17762,16 +17762,16 @@ var P1 = Fc((L) => {
17762
17762
  } else if (y < 0)
17763
17763
  if (k) y = 0;
17764
17764
  else return -1;
17765
- if (typeof d == "string" && (d = o.from(d, C)), o.isBuffer(d))
17766
- return d.length === 0 ? -1 : M(F, d, y, C, k);
17767
- if (typeof d == "number")
17768
- return d = d & 255, typeof Uint8Array.prototype.indexOf == "function" ? k ? Uint8Array.prototype.indexOf.call(F, d, y) : Uint8Array.prototype.lastIndexOf.call(F, d, y) : M(F, [d], y, C, k);
17765
+ if (typeof g == "string" && (g = o.from(g, C)), o.isBuffer(g))
17766
+ return g.length === 0 ? -1 : M(F, g, y, C, k);
17767
+ if (typeof g == "number")
17768
+ return g = g & 255, typeof Uint8Array.prototype.indexOf == "function" ? k ? Uint8Array.prototype.indexOf.call(F, g, y) : Uint8Array.prototype.lastIndexOf.call(F, g, y) : M(F, [g], y, C, k);
17769
17769
  throw new TypeError("val must be string, number or Buffer");
17770
17770
  }
17771
- function M(F, d, y, C, k) {
17772
- var O = 1, R = F.length, J = d.length;
17771
+ function M(F, g, y, C, k) {
17772
+ var O = 1, R = F.length, J = g.length;
17773
17773
  if (C !== void 0 && (C = String(C).toLowerCase(), C === "ucs2" || C === "ucs-2" || C === "utf16le" || C === "utf-16le")) {
17774
- if (F.length < 2 || d.length < 2)
17774
+ if (F.length < 2 || g.length < 2)
17775
17775
  return -1;
17776
17776
  O = 2, R /= 2, J /= 2, y /= 2;
17777
17777
  }
@@ -17782,54 +17782,54 @@ var P1 = Fc((L) => {
17782
17782
  if (k) {
17783
17783
  var be = -1;
17784
17784
  for (oe = y; oe < R; oe++)
17785
- if (te(F, oe) === te(d, be === -1 ? 0 : oe - be)) {
17785
+ if (te(F, oe) === te(g, be === -1 ? 0 : oe - be)) {
17786
17786
  if (be === -1 && (be = oe), oe - be + 1 === J) return be * O;
17787
17787
  } else
17788
17788
  be !== -1 && (oe -= oe - be), be = -1;
17789
17789
  } else
17790
17790
  for (y + J > R && (y = R - J), oe = y; oe >= 0; oe--) {
17791
- for (var ue = !0, ln = 0; ln < J; ln++)
17792
- if (te(F, oe + ln) !== te(d, ln)) {
17793
- ue = !1;
17791
+ for (var le = !0, ln = 0; ln < J; ln++)
17792
+ if (te(F, oe + ln) !== te(g, ln)) {
17793
+ le = !1;
17794
17794
  break;
17795
17795
  }
17796
- if (ue) return oe;
17796
+ if (le) return oe;
17797
17797
  }
17798
17798
  return -1;
17799
17799
  }
17800
- o.prototype.includes = function(d, y, C) {
17801
- return this.indexOf(d, y, C) !== -1;
17802
- }, o.prototype.indexOf = function(d, y, C) {
17803
- return B(this, d, y, C, !0);
17804
- }, o.prototype.lastIndexOf = function(d, y, C) {
17805
- return B(this, d, y, C, !1);
17800
+ o.prototype.includes = function(g, y, C) {
17801
+ return this.indexOf(g, y, C) !== -1;
17802
+ }, o.prototype.indexOf = function(g, y, C) {
17803
+ return B(this, g, y, C, !0);
17804
+ }, o.prototype.lastIndexOf = function(g, y, C) {
17805
+ return B(this, g, y, C, !1);
17806
17806
  };
17807
- function _(F, d, y, C) {
17807
+ function _(F, g, y, C) {
17808
17808
  y = Number(y) || 0;
17809
17809
  var k = F.length - y;
17810
17810
  C ? (C = Number(C), C > k && (C = k)) : C = k;
17811
- var O = d.length;
17811
+ var O = g.length;
17812
17812
  C > O / 2 && (C = O / 2);
17813
17813
  for (var R = 0; R < C; ++R) {
17814
- var J = parseInt(d.substr(R * 2, 2), 16);
17814
+ var J = parseInt(g.substr(R * 2, 2), 16);
17815
17815
  if (fi(J)) return R;
17816
17816
  F[y + R] = J;
17817
17817
  }
17818
17818
  return R;
17819
17819
  }
17820
- function D(F, d, y, C) {
17821
- return un(xt(d, F.length - y), F, y, C);
17820
+ function D(F, g, y, C) {
17821
+ return un(xt(g, F.length - y), F, y, C);
17822
17822
  }
17823
- function N(F, d, y, C) {
17824
- return un(bc(d), F, y, C);
17823
+ function N(F, g, y, C) {
17824
+ return un(bc(g), F, y, C);
17825
17825
  }
17826
- function G(F, d, y, C) {
17827
- return un(Qs(d), F, y, C);
17826
+ function G(F, g, y, C) {
17827
+ return un(Qs(g), F, y, C);
17828
17828
  }
17829
- function ee(F, d, y, C) {
17830
- return un(wc(d, F.length - y), F, y, C);
17829
+ function ee(F, g, y, C) {
17830
+ return un(wc(g, F.length - y), F, y, C);
17831
17831
  }
17832
- o.prototype.write = function(d, y, C, k) {
17832
+ o.prototype.write = function(g, y, C, k) {
17833
17833
  if (y === void 0)
17834
17834
  k = "utf8", C = this.length, y = 0;
17835
17835
  else if (C === void 0 && typeof y == "string")
@@ -17841,27 +17841,27 @@ var P1 = Fc((L) => {
17841
17841
  "Buffer.write(string, encoding, offset[, length]) is no longer supported"
17842
17842
  );
17843
17843
  var O = this.length - y;
17844
- if ((C === void 0 || C > O) && (C = O), d.length > 0 && (C < 0 || y < 0) || y > this.length)
17844
+ if ((C === void 0 || C > O) && (C = O), g.length > 0 && (C < 0 || y < 0) || y > this.length)
17845
17845
  throw new RangeError("Attempt to write outside buffer bounds");
17846
17846
  k || (k = "utf8");
17847
17847
  for (var R = !1; ; )
17848
17848
  switch (k) {
17849
17849
  case "hex":
17850
- return _(this, d, y, C);
17850
+ return _(this, g, y, C);
17851
17851
  case "utf8":
17852
17852
  case "utf-8":
17853
- return D(this, d, y, C);
17853
+ return D(this, g, y, C);
17854
17854
  case "ascii":
17855
17855
  case "latin1":
17856
17856
  case "binary":
17857
- return N(this, d, y, C);
17857
+ return N(this, g, y, C);
17858
17858
  case "base64":
17859
- return G(this, d, y, C);
17859
+ return G(this, g, y, C);
17860
17860
  case "ucs2":
17861
17861
  case "ucs-2":
17862
17862
  case "utf16le":
17863
17863
  case "utf-16le":
17864
- return ee(this, d, y, C);
17864
+ return ee(this, g, y, C);
17865
17865
  default:
17866
17866
  if (R) throw new TypeError("Unknown encoding: " + k);
17867
17867
  k = ("" + k).toLowerCase(), R = !0;
@@ -17872,27 +17872,27 @@ var P1 = Fc((L) => {
17872
17872
  data: Array.prototype.slice.call(this._arr || this, 0)
17873
17873
  };
17874
17874
  };
17875
- function Y(F, d, y) {
17876
- return d === 0 && y === F.length ? e.fromByteArray(F) : e.fromByteArray(F.slice(d, y));
17875
+ function Y(F, g, y) {
17876
+ return g === 0 && y === F.length ? e.fromByteArray(F) : e.fromByteArray(F.slice(g, y));
17877
17877
  }
17878
- function Z(F, d, y) {
17878
+ function Z(F, g, y) {
17879
17879
  y = Math.min(F.length, y);
17880
- for (var C = [], k = d; k < y; ) {
17880
+ for (var C = [], k = g; k < y; ) {
17881
17881
  var O = F[k], R = null, J = O > 239 ? 4 : O > 223 ? 3 : O > 191 ? 2 : 1;
17882
17882
  if (k + J <= y) {
17883
- var te, oe, be, ue;
17883
+ var te, oe, be, le;
17884
17884
  switch (J) {
17885
17885
  case 1:
17886
17886
  O < 128 && (R = O);
17887
17887
  break;
17888
17888
  case 2:
17889
- te = F[k + 1], (te & 192) === 128 && (ue = (O & 31) << 6 | te & 63, ue > 127 && (R = ue));
17889
+ te = F[k + 1], (te & 192) === 128 && (le = (O & 31) << 6 | te & 63, le > 127 && (R = le));
17890
17890
  break;
17891
17891
  case 3:
17892
- te = F[k + 1], oe = F[k + 2], (te & 192) === 128 && (oe & 192) === 128 && (ue = (O & 15) << 12 | (te & 63) << 6 | oe & 63, ue > 2047 && (ue < 55296 || ue > 57343) && (R = ue));
17892
+ te = F[k + 1], oe = F[k + 2], (te & 192) === 128 && (oe & 192) === 128 && (le = (O & 15) << 12 | (te & 63) << 6 | oe & 63, le > 2047 && (le < 55296 || le > 57343) && (R = le));
17893
17893
  break;
17894
17894
  case 4:
17895
- te = F[k + 1], oe = F[k + 2], be = F[k + 3], (te & 192) === 128 && (oe & 192) === 128 && (be & 192) === 128 && (ue = (O & 15) << 18 | (te & 63) << 12 | (oe & 63) << 6 | be & 63, ue > 65535 && ue < 1114112 && (R = ue));
17895
+ te = F[k + 1], oe = F[k + 2], be = F[k + 3], (te & 192) === 128 && (oe & 192) === 128 && (be & 192) === 128 && (le = (O & 15) << 18 | (te & 63) << 12 | (oe & 63) << 6 | be & 63, le > 65535 && le < 1114112 && (R = le));
17896
17896
  }
17897
17897
  }
17898
17898
  R === null ? (R = 65533, J = 1) : R > 65535 && (R -= 65536, C.push(R >>> 10 & 1023 | 55296), R = 56320 | R & 1023), C.push(R), k += J;
@@ -17901,224 +17901,224 @@ var P1 = Fc((L) => {
17901
17901
  }
17902
17902
  var Q = 4096;
17903
17903
  function K(F) {
17904
- var d = F.length;
17905
- if (d <= Q)
17904
+ var g = F.length;
17905
+ if (g <= Q)
17906
17906
  return String.fromCharCode.apply(String, F);
17907
- for (var y = "", C = 0; C < d; )
17907
+ for (var y = "", C = 0; C < g; )
17908
17908
  y += String.fromCharCode.apply(
17909
17909
  String,
17910
17910
  F.slice(C, C += Q)
17911
17911
  );
17912
17912
  return y;
17913
17913
  }
17914
- function ne(F, d, y) {
17914
+ function ne(F, g, y) {
17915
17915
  var C = "";
17916
17916
  y = Math.min(F.length, y);
17917
- for (var k = d; k < y; ++k)
17917
+ for (var k = g; k < y; ++k)
17918
17918
  C += String.fromCharCode(F[k] & 127);
17919
17919
  return C;
17920
17920
  }
17921
- function ae(F, d, y) {
17921
+ function ae(F, g, y) {
17922
17922
  var C = "";
17923
17923
  y = Math.min(F.length, y);
17924
- for (var k = d; k < y; ++k)
17924
+ for (var k = g; k < y; ++k)
17925
17925
  C += String.fromCharCode(F[k]);
17926
17926
  return C;
17927
17927
  }
17928
- function ie(F, d, y) {
17928
+ function ie(F, g, y) {
17929
17929
  var C = F.length;
17930
- (!d || d < 0) && (d = 0), (!y || y < 0 || y > C) && (y = C);
17931
- for (var k = "", O = d; O < y; ++O)
17930
+ (!g || g < 0) && (g = 0), (!y || y < 0 || y > C) && (y = C);
17931
+ for (var k = "", O = g; O < y; ++O)
17932
17932
  k += Sc[F[O]];
17933
17933
  return k;
17934
17934
  }
17935
- function he(F, d, y) {
17936
- for (var C = F.slice(d, y), k = "", O = 0; O < C.length - 1; O += 2)
17935
+ function he(F, g, y) {
17936
+ for (var C = F.slice(g, y), k = "", O = 0; O < C.length - 1; O += 2)
17937
17937
  k += String.fromCharCode(C[O] + C[O + 1] * 256);
17938
17938
  return k;
17939
17939
  }
17940
- o.prototype.slice = function(d, y) {
17940
+ o.prototype.slice = function(g, y) {
17941
17941
  var C = this.length;
17942
- d = ~~d, y = y === void 0 ? C : ~~y, d < 0 ? (d += C, d < 0 && (d = 0)) : d > C && (d = C), y < 0 ? (y += C, y < 0 && (y = 0)) : y > C && (y = C), y < d && (y = d);
17943
- var k = this.subarray(d, y);
17942
+ g = ~~g, y = y === void 0 ? C : ~~y, g < 0 ? (g += C, g < 0 && (g = 0)) : g > C && (g = C), y < 0 ? (y += C, y < 0 && (y = 0)) : y > C && (y = C), y < g && (y = g);
17943
+ var k = this.subarray(g, y);
17944
17944
  return Object.setPrototypeOf(k, o.prototype), k;
17945
17945
  };
17946
- function W(F, d, y) {
17946
+ function W(F, g, y) {
17947
17947
  if (F % 1 !== 0 || F < 0) throw new RangeError("offset is not uint");
17948
- if (F + d > y) throw new RangeError("Trying to access beyond buffer length");
17948
+ if (F + g > y) throw new RangeError("Trying to access beyond buffer length");
17949
17949
  }
17950
- o.prototype.readUintLE = o.prototype.readUIntLE = function(d, y, C) {
17951
- d = d >>> 0, y = y >>> 0, C || W(d, y, this.length);
17952
- for (var k = this[d], O = 1, R = 0; ++R < y && (O *= 256); )
17953
- k += this[d + R] * O;
17950
+ o.prototype.readUintLE = o.prototype.readUIntLE = function(g, y, C) {
17951
+ g = g >>> 0, y = y >>> 0, C || W(g, y, this.length);
17952
+ for (var k = this[g], O = 1, R = 0; ++R < y && (O *= 256); )
17953
+ k += this[g + R] * O;
17954
17954
  return k;
17955
- }, o.prototype.readUintBE = o.prototype.readUIntBE = function(d, y, C) {
17956
- d = d >>> 0, y = y >>> 0, C || W(d, y, this.length);
17957
- for (var k = this[d + --y], O = 1; y > 0 && (O *= 256); )
17958
- k += this[d + --y] * O;
17955
+ }, o.prototype.readUintBE = o.prototype.readUIntBE = function(g, y, C) {
17956
+ g = g >>> 0, y = y >>> 0, C || W(g, y, this.length);
17957
+ for (var k = this[g + --y], O = 1; y > 0 && (O *= 256); )
17958
+ k += this[g + --y] * O;
17959
17959
  return k;
17960
- }, o.prototype.readUint8 = o.prototype.readUInt8 = function(d, y) {
17961
- return d = d >>> 0, y || W(d, 1, this.length), this[d];
17962
- }, o.prototype.readUint16LE = o.prototype.readUInt16LE = function(d, y) {
17963
- return d = d >>> 0, y || W(d, 2, this.length), this[d] | this[d + 1] << 8;
17964
- }, o.prototype.readUint16BE = o.prototype.readUInt16BE = function(d, y) {
17965
- return d = d >>> 0, y || W(d, 2, this.length), this[d] << 8 | this[d + 1];
17966
- }, o.prototype.readUint32LE = o.prototype.readUInt32LE = function(d, y) {
17967
- return d = d >>> 0, y || W(d, 4, this.length), (this[d] | this[d + 1] << 8 | this[d + 2] << 16) + this[d + 3] * 16777216;
17968
- }, o.prototype.readUint32BE = o.prototype.readUInt32BE = function(d, y) {
17969
- return d = d >>> 0, y || W(d, 4, this.length), this[d] * 16777216 + (this[d + 1] << 16 | this[d + 2] << 8 | this[d + 3]);
17970
- }, o.prototype.readIntLE = function(d, y, C) {
17971
- d = d >>> 0, y = y >>> 0, C || W(d, y, this.length);
17972
- for (var k = this[d], O = 1, R = 0; ++R < y && (O *= 256); )
17973
- k += this[d + R] * O;
17960
+ }, o.prototype.readUint8 = o.prototype.readUInt8 = function(g, y) {
17961
+ return g = g >>> 0, y || W(g, 1, this.length), this[g];
17962
+ }, o.prototype.readUint16LE = o.prototype.readUInt16LE = function(g, y) {
17963
+ return g = g >>> 0, y || W(g, 2, this.length), this[g] | this[g + 1] << 8;
17964
+ }, o.prototype.readUint16BE = o.prototype.readUInt16BE = function(g, y) {
17965
+ return g = g >>> 0, y || W(g, 2, this.length), this[g] << 8 | this[g + 1];
17966
+ }, o.prototype.readUint32LE = o.prototype.readUInt32LE = function(g, y) {
17967
+ return g = g >>> 0, y || W(g, 4, this.length), (this[g] | this[g + 1] << 8 | this[g + 2] << 16) + this[g + 3] * 16777216;
17968
+ }, o.prototype.readUint32BE = o.prototype.readUInt32BE = function(g, y) {
17969
+ return g = g >>> 0, y || W(g, 4, this.length), this[g] * 16777216 + (this[g + 1] << 16 | this[g + 2] << 8 | this[g + 3]);
17970
+ }, o.prototype.readIntLE = function(g, y, C) {
17971
+ g = g >>> 0, y = y >>> 0, C || W(g, y, this.length);
17972
+ for (var k = this[g], O = 1, R = 0; ++R < y && (O *= 256); )
17973
+ k += this[g + R] * O;
17974
17974
  return O *= 128, k >= O && (k -= Math.pow(2, 8 * y)), k;
17975
- }, o.prototype.readIntBE = function(d, y, C) {
17976
- d = d >>> 0, y = y >>> 0, C || W(d, y, this.length);
17977
- for (var k = y, O = 1, R = this[d + --k]; k > 0 && (O *= 256); )
17978
- R += this[d + --k] * O;
17975
+ }, o.prototype.readIntBE = function(g, y, C) {
17976
+ g = g >>> 0, y = y >>> 0, C || W(g, y, this.length);
17977
+ for (var k = y, O = 1, R = this[g + --k]; k > 0 && (O *= 256); )
17978
+ R += this[g + --k] * O;
17979
17979
  return O *= 128, R >= O && (R -= Math.pow(2, 8 * y)), R;
17980
- }, o.prototype.readInt8 = function(d, y) {
17981
- return d = d >>> 0, y || W(d, 1, this.length), this[d] & 128 ? (255 - this[d] + 1) * -1 : this[d];
17982
- }, o.prototype.readInt16LE = function(d, y) {
17983
- d = d >>> 0, y || W(d, 2, this.length);
17984
- var C = this[d] | this[d + 1] << 8;
17980
+ }, o.prototype.readInt8 = function(g, y) {
17981
+ return g = g >>> 0, y || W(g, 1, this.length), this[g] & 128 ? (255 - this[g] + 1) * -1 : this[g];
17982
+ }, o.prototype.readInt16LE = function(g, y) {
17983
+ g = g >>> 0, y || W(g, 2, this.length);
17984
+ var C = this[g] | this[g + 1] << 8;
17985
17985
  return C & 32768 ? C | 4294901760 : C;
17986
- }, o.prototype.readInt16BE = function(d, y) {
17987
- d = d >>> 0, y || W(d, 2, this.length);
17988
- var C = this[d + 1] | this[d] << 8;
17986
+ }, o.prototype.readInt16BE = function(g, y) {
17987
+ g = g >>> 0, y || W(g, 2, this.length);
17988
+ var C = this[g + 1] | this[g] << 8;
17989
17989
  return C & 32768 ? C | 4294901760 : C;
17990
- }, o.prototype.readInt32LE = function(d, y) {
17991
- return d = d >>> 0, y || W(d, 4, this.length), this[d] | this[d + 1] << 8 | this[d + 2] << 16 | this[d + 3] << 24;
17992
- }, o.prototype.readInt32BE = function(d, y) {
17993
- return d = d >>> 0, y || W(d, 4, this.length), this[d] << 24 | this[d + 1] << 16 | this[d + 2] << 8 | this[d + 3];
17994
- }, o.prototype.readFloatLE = function(d, y) {
17995
- return d = d >>> 0, y || W(d, 4, this.length), t.read(this, d, !0, 23, 4);
17996
- }, o.prototype.readFloatBE = function(d, y) {
17997
- return d = d >>> 0, y || W(d, 4, this.length), t.read(this, d, !1, 23, 4);
17998
- }, o.prototype.readDoubleLE = function(d, y) {
17999
- return d = d >>> 0, y || W(d, 8, this.length), t.read(this, d, !0, 52, 8);
18000
- }, o.prototype.readDoubleBE = function(d, y) {
18001
- return d = d >>> 0, y || W(d, 8, this.length), t.read(this, d, !1, 52, 8);
17990
+ }, o.prototype.readInt32LE = function(g, y) {
17991
+ return g = g >>> 0, y || W(g, 4, this.length), this[g] | this[g + 1] << 8 | this[g + 2] << 16 | this[g + 3] << 24;
17992
+ }, o.prototype.readInt32BE = function(g, y) {
17993
+ return g = g >>> 0, y || W(g, 4, this.length), this[g] << 24 | this[g + 1] << 16 | this[g + 2] << 8 | this[g + 3];
17994
+ }, o.prototype.readFloatLE = function(g, y) {
17995
+ return g = g >>> 0, y || W(g, 4, this.length), t.read(this, g, !0, 23, 4);
17996
+ }, o.prototype.readFloatBE = function(g, y) {
17997
+ return g = g >>> 0, y || W(g, 4, this.length), t.read(this, g, !1, 23, 4);
17998
+ }, o.prototype.readDoubleLE = function(g, y) {
17999
+ return g = g >>> 0, y || W(g, 8, this.length), t.read(this, g, !0, 52, 8);
18000
+ }, o.prototype.readDoubleBE = function(g, y) {
18001
+ return g = g >>> 0, y || W(g, 8, this.length), t.read(this, g, !1, 52, 8);
18002
18002
  };
18003
- function $(F, d, y, C, k, O) {
18003
+ function $(F, g, y, C, k, O) {
18004
18004
  if (!o.isBuffer(F)) throw new TypeError('"buffer" argument must be a Buffer instance');
18005
- if (d > k || d < O) throw new RangeError('"value" argument is out of bounds');
18005
+ if (g > k || g < O) throw new RangeError('"value" argument is out of bounds');
18006
18006
  if (y + C > F.length) throw new RangeError("Index out of range");
18007
18007
  }
18008
- o.prototype.writeUintLE = o.prototype.writeUIntLE = function(d, y, C, k) {
18009
- if (d = +d, y = y >>> 0, C = C >>> 0, !k) {
18008
+ o.prototype.writeUintLE = o.prototype.writeUIntLE = function(g, y, C, k) {
18009
+ if (g = +g, y = y >>> 0, C = C >>> 0, !k) {
18010
18010
  var O = Math.pow(2, 8 * C) - 1;
18011
- $(this, d, y, C, O, 0);
18011
+ $(this, g, y, C, O, 0);
18012
18012
  }
18013
18013
  var R = 1, J = 0;
18014
- for (this[y] = d & 255; ++J < C && (R *= 256); )
18015
- this[y + J] = d / R & 255;
18014
+ for (this[y] = g & 255; ++J < C && (R *= 256); )
18015
+ this[y + J] = g / R & 255;
18016
18016
  return y + C;
18017
- }, o.prototype.writeUintBE = o.prototype.writeUIntBE = function(d, y, C, k) {
18018
- if (d = +d, y = y >>> 0, C = C >>> 0, !k) {
18017
+ }, o.prototype.writeUintBE = o.prototype.writeUIntBE = function(g, y, C, k) {
18018
+ if (g = +g, y = y >>> 0, C = C >>> 0, !k) {
18019
18019
  var O = Math.pow(2, 8 * C) - 1;
18020
- $(this, d, y, C, O, 0);
18020
+ $(this, g, y, C, O, 0);
18021
18021
  }
18022
18022
  var R = C - 1, J = 1;
18023
- for (this[y + R] = d & 255; --R >= 0 && (J *= 256); )
18024
- this[y + R] = d / J & 255;
18023
+ for (this[y + R] = g & 255; --R >= 0 && (J *= 256); )
18024
+ this[y + R] = g / J & 255;
18025
18025
  return y + C;
18026
- }, o.prototype.writeUint8 = o.prototype.writeUInt8 = function(d, y, C) {
18027
- return d = +d, y = y >>> 0, C || $(this, d, y, 1, 255, 0), this[y] = d & 255, y + 1;
18028
- }, o.prototype.writeUint16LE = o.prototype.writeUInt16LE = function(d, y, C) {
18029
- return d = +d, y = y >>> 0, C || $(this, d, y, 2, 65535, 0), this[y] = d & 255, this[y + 1] = d >>> 8, y + 2;
18030
- }, o.prototype.writeUint16BE = o.prototype.writeUInt16BE = function(d, y, C) {
18031
- return d = +d, y = y >>> 0, C || $(this, d, y, 2, 65535, 0), this[y] = d >>> 8, this[y + 1] = d & 255, y + 2;
18032
- }, o.prototype.writeUint32LE = o.prototype.writeUInt32LE = function(d, y, C) {
18033
- return d = +d, y = y >>> 0, C || $(this, d, y, 4, 4294967295, 0), this[y + 3] = d >>> 24, this[y + 2] = d >>> 16, this[y + 1] = d >>> 8, this[y] = d & 255, y + 4;
18034
- }, o.prototype.writeUint32BE = o.prototype.writeUInt32BE = function(d, y, C) {
18035
- return d = +d, y = y >>> 0, C || $(this, d, y, 4, 4294967295, 0), this[y] = d >>> 24, this[y + 1] = d >>> 16, this[y + 2] = d >>> 8, this[y + 3] = d & 255, y + 4;
18036
- }, o.prototype.writeIntLE = function(d, y, C, k) {
18037
- if (d = +d, y = y >>> 0, !k) {
18026
+ }, o.prototype.writeUint8 = o.prototype.writeUInt8 = function(g, y, C) {
18027
+ return g = +g, y = y >>> 0, C || $(this, g, y, 1, 255, 0), this[y] = g & 255, y + 1;
18028
+ }, o.prototype.writeUint16LE = o.prototype.writeUInt16LE = function(g, y, C) {
18029
+ return g = +g, y = y >>> 0, C || $(this, g, y, 2, 65535, 0), this[y] = g & 255, this[y + 1] = g >>> 8, y + 2;
18030
+ }, o.prototype.writeUint16BE = o.prototype.writeUInt16BE = function(g, y, C) {
18031
+ return g = +g, y = y >>> 0, C || $(this, g, y, 2, 65535, 0), this[y] = g >>> 8, this[y + 1] = g & 255, y + 2;
18032
+ }, o.prototype.writeUint32LE = o.prototype.writeUInt32LE = function(g, y, C) {
18033
+ return g = +g, y = y >>> 0, C || $(this, g, y, 4, 4294967295, 0), this[y + 3] = g >>> 24, this[y + 2] = g >>> 16, this[y + 1] = g >>> 8, this[y] = g & 255, y + 4;
18034
+ }, o.prototype.writeUint32BE = o.prototype.writeUInt32BE = function(g, y, C) {
18035
+ return g = +g, y = y >>> 0, C || $(this, g, y, 4, 4294967295, 0), this[y] = g >>> 24, this[y + 1] = g >>> 16, this[y + 2] = g >>> 8, this[y + 3] = g & 255, y + 4;
18036
+ }, o.prototype.writeIntLE = function(g, y, C, k) {
18037
+ if (g = +g, y = y >>> 0, !k) {
18038
18038
  var O = Math.pow(2, 8 * C - 1);
18039
- $(this, d, y, C, O - 1, -O);
18039
+ $(this, g, y, C, O - 1, -O);
18040
18040
  }
18041
18041
  var R = 0, J = 1, te = 0;
18042
- for (this[y] = d & 255; ++R < C && (J *= 256); )
18043
- d < 0 && te === 0 && this[y + R - 1] !== 0 && (te = 1), this[y + R] = (d / J >> 0) - te & 255;
18042
+ for (this[y] = g & 255; ++R < C && (J *= 256); )
18043
+ g < 0 && te === 0 && this[y + R - 1] !== 0 && (te = 1), this[y + R] = (g / J >> 0) - te & 255;
18044
18044
  return y + C;
18045
- }, o.prototype.writeIntBE = function(d, y, C, k) {
18046
- if (d = +d, y = y >>> 0, !k) {
18045
+ }, o.prototype.writeIntBE = function(g, y, C, k) {
18046
+ if (g = +g, y = y >>> 0, !k) {
18047
18047
  var O = Math.pow(2, 8 * C - 1);
18048
- $(this, d, y, C, O - 1, -O);
18048
+ $(this, g, y, C, O - 1, -O);
18049
18049
  }
18050
18050
  var R = C - 1, J = 1, te = 0;
18051
- for (this[y + R] = d & 255; --R >= 0 && (J *= 256); )
18052
- d < 0 && te === 0 && this[y + R + 1] !== 0 && (te = 1), this[y + R] = (d / J >> 0) - te & 255;
18051
+ for (this[y + R] = g & 255; --R >= 0 && (J *= 256); )
18052
+ g < 0 && te === 0 && this[y + R + 1] !== 0 && (te = 1), this[y + R] = (g / J >> 0) - te & 255;
18053
18053
  return y + C;
18054
- }, o.prototype.writeInt8 = function(d, y, C) {
18055
- return d = +d, y = y >>> 0, C || $(this, d, y, 1, 127, -128), d < 0 && (d = 255 + d + 1), this[y] = d & 255, y + 1;
18056
- }, o.prototype.writeInt16LE = function(d, y, C) {
18057
- return d = +d, y = y >>> 0, C || $(this, d, y, 2, 32767, -32768), this[y] = d & 255, this[y + 1] = d >>> 8, y + 2;
18058
- }, o.prototype.writeInt16BE = function(d, y, C) {
18059
- return d = +d, y = y >>> 0, C || $(this, d, y, 2, 32767, -32768), this[y] = d >>> 8, this[y + 1] = d & 255, y + 2;
18060
- }, o.prototype.writeInt32LE = function(d, y, C) {
18061
- return d = +d, y = y >>> 0, C || $(this, d, y, 4, 2147483647, -2147483648), this[y] = d & 255, this[y + 1] = d >>> 8, this[y + 2] = d >>> 16, this[y + 3] = d >>> 24, y + 4;
18062
- }, o.prototype.writeInt32BE = function(d, y, C) {
18063
- return d = +d, y = y >>> 0, C || $(this, d, y, 4, 2147483647, -2147483648), d < 0 && (d = 4294967295 + d + 1), this[y] = d >>> 24, this[y + 1] = d >>> 16, this[y + 2] = d >>> 8, this[y + 3] = d & 255, y + 4;
18054
+ }, o.prototype.writeInt8 = function(g, y, C) {
18055
+ return g = +g, y = y >>> 0, C || $(this, g, y, 1, 127, -128), g < 0 && (g = 255 + g + 1), this[y] = g & 255, y + 1;
18056
+ }, o.prototype.writeInt16LE = function(g, y, C) {
18057
+ return g = +g, y = y >>> 0, C || $(this, g, y, 2, 32767, -32768), this[y] = g & 255, this[y + 1] = g >>> 8, y + 2;
18058
+ }, o.prototype.writeInt16BE = function(g, y, C) {
18059
+ return g = +g, y = y >>> 0, C || $(this, g, y, 2, 32767, -32768), this[y] = g >>> 8, this[y + 1] = g & 255, y + 2;
18060
+ }, o.prototype.writeInt32LE = function(g, y, C) {
18061
+ return g = +g, y = y >>> 0, C || $(this, g, y, 4, 2147483647, -2147483648), this[y] = g & 255, this[y + 1] = g >>> 8, this[y + 2] = g >>> 16, this[y + 3] = g >>> 24, y + 4;
18062
+ }, o.prototype.writeInt32BE = function(g, y, C) {
18063
+ return g = +g, y = y >>> 0, C || $(this, g, y, 4, 2147483647, -2147483648), g < 0 && (g = 4294967295 + g + 1), this[y] = g >>> 24, this[y + 1] = g >>> 16, this[y + 2] = g >>> 8, this[y + 3] = g & 255, y + 4;
18064
18064
  };
18065
- function er(F, d, y, C, k, O) {
18065
+ function er(F, g, y, C, k, O) {
18066
18066
  if (y + C > F.length) throw new RangeError("Index out of range");
18067
18067
  if (y < 0) throw new RangeError("Index out of range");
18068
18068
  }
18069
- function on(F, d, y, C, k) {
18070
- return d = +d, y = y >>> 0, k || er(F, d, y, 4), t.write(F, d, y, C, 23, 4), y + 4;
18069
+ function on(F, g, y, C, k) {
18070
+ return g = +g, y = y >>> 0, k || er(F, g, y, 4), t.write(F, g, y, C, 23, 4), y + 4;
18071
18071
  }
18072
- o.prototype.writeFloatLE = function(d, y, C) {
18073
- return on(this, d, y, !0, C);
18074
- }, o.prototype.writeFloatBE = function(d, y, C) {
18075
- return on(this, d, y, !1, C);
18072
+ o.prototype.writeFloatLE = function(g, y, C) {
18073
+ return on(this, g, y, !0, C);
18074
+ }, o.prototype.writeFloatBE = function(g, y, C) {
18075
+ return on(this, g, y, !1, C);
18076
18076
  };
18077
- function hn(F, d, y, C, k) {
18078
- return d = +d, y = y >>> 0, k || er(F, d, y, 8), t.write(F, d, y, C, 52, 8), y + 8;
18079
- }
18080
- o.prototype.writeDoubleLE = function(d, y, C) {
18081
- return hn(this, d, y, !0, C);
18082
- }, o.prototype.writeDoubleBE = function(d, y, C) {
18083
- return hn(this, d, y, !1, C);
18084
- }, o.prototype.copy = function(d, y, C, k) {
18085
- if (!o.isBuffer(d)) throw new TypeError("argument should be a Buffer");
18086
- if (C || (C = 0), !k && k !== 0 && (k = this.length), y >= d.length && (y = d.length), y || (y = 0), k > 0 && k < C && (k = C), k === C || d.length === 0 || this.length === 0) return 0;
18077
+ function hn(F, g, y, C, k) {
18078
+ return g = +g, y = y >>> 0, k || er(F, g, y, 8), t.write(F, g, y, C, 52, 8), y + 8;
18079
+ }
18080
+ o.prototype.writeDoubleLE = function(g, y, C) {
18081
+ return hn(this, g, y, !0, C);
18082
+ }, o.prototype.writeDoubleBE = function(g, y, C) {
18083
+ return hn(this, g, y, !1, C);
18084
+ }, o.prototype.copy = function(g, y, C, k) {
18085
+ if (!o.isBuffer(g)) throw new TypeError("argument should be a Buffer");
18086
+ if (C || (C = 0), !k && k !== 0 && (k = this.length), y >= g.length && (y = g.length), y || (y = 0), k > 0 && k < C && (k = C), k === C || g.length === 0 || this.length === 0) return 0;
18087
18087
  if (y < 0)
18088
18088
  throw new RangeError("targetStart out of bounds");
18089
18089
  if (C < 0 || C >= this.length) throw new RangeError("Index out of range");
18090
18090
  if (k < 0) throw new RangeError("sourceEnd out of bounds");
18091
- k > this.length && (k = this.length), d.length - y < k - C && (k = d.length - y + C);
18091
+ k > this.length && (k = this.length), g.length - y < k - C && (k = g.length - y + C);
18092
18092
  var O = k - C;
18093
- return this === d && typeof Uint8Array.prototype.copyWithin == "function" ? this.copyWithin(y, C, k) : Uint8Array.prototype.set.call(
18094
- d,
18093
+ return this === g && typeof Uint8Array.prototype.copyWithin == "function" ? this.copyWithin(y, C, k) : Uint8Array.prototype.set.call(
18094
+ g,
18095
18095
  this.subarray(C, k),
18096
18096
  y
18097
18097
  ), O;
18098
- }, o.prototype.fill = function(d, y, C, k) {
18099
- if (typeof d == "string") {
18098
+ }, o.prototype.fill = function(g, y, C, k) {
18099
+ if (typeof g == "string") {
18100
18100
  if (typeof y == "string" ? (k = y, y = 0, C = this.length) : typeof C == "string" && (k = C, C = this.length), k !== void 0 && typeof k != "string")
18101
18101
  throw new TypeError("encoding must be a string");
18102
18102
  if (typeof k == "string" && !o.isEncoding(k))
18103
18103
  throw new TypeError("Unknown encoding: " + k);
18104
- if (d.length === 1) {
18105
- var O = d.charCodeAt(0);
18106
- (k === "utf8" && O < 128 || k === "latin1") && (d = O);
18104
+ if (g.length === 1) {
18105
+ var O = g.charCodeAt(0);
18106
+ (k === "utf8" && O < 128 || k === "latin1") && (g = O);
18107
18107
  }
18108
- } else typeof d == "number" ? d = d & 255 : typeof d == "boolean" && (d = Number(d));
18108
+ } else typeof g == "number" ? g = g & 255 : typeof g == "boolean" && (g = Number(g));
18109
18109
  if (y < 0 || this.length < y || this.length < C)
18110
18110
  throw new RangeError("Out of range index");
18111
18111
  if (C <= y)
18112
18112
  return this;
18113
- y = y >>> 0, C = C === void 0 ? this.length : C >>> 0, d || (d = 0);
18113
+ y = y >>> 0, C = C === void 0 ? this.length : C >>> 0, g || (g = 0);
18114
18114
  var R;
18115
- if (typeof d == "number")
18115
+ if (typeof g == "number")
18116
18116
  for (R = y; R < C; ++R)
18117
- this[R] = d;
18117
+ this[R] = g;
18118
18118
  else {
18119
- var J = o.isBuffer(d) ? d : o.from(d, k), te = J.length;
18119
+ var J = o.isBuffer(g) ? g : o.from(g, k), te = J.length;
18120
18120
  if (te === 0)
18121
- throw new TypeError('The value "' + d + '" is invalid for argument "value"');
18121
+ throw new TypeError('The value "' + g + '" is invalid for argument "value"');
18122
18122
  for (R = 0; R < C - y; ++R)
18123
18123
  this[R + y] = J[R % te];
18124
18124
  }
@@ -18131,45 +18131,45 @@ var P1 = Fc((L) => {
18131
18131
  F = F + "=";
18132
18132
  return F;
18133
18133
  }
18134
- function xt(F, d) {
18135
- d = d || 1 / 0;
18134
+ function xt(F, g) {
18135
+ g = g || 1 / 0;
18136
18136
  for (var y, C = F.length, k = null, O = [], R = 0; R < C; ++R) {
18137
18137
  if (y = F.charCodeAt(R), y > 55295 && y < 57344) {
18138
18138
  if (!k) {
18139
18139
  if (y > 56319) {
18140
- (d -= 3) > -1 && O.push(239, 191, 189);
18140
+ (g -= 3) > -1 && O.push(239, 191, 189);
18141
18141
  continue;
18142
18142
  } else if (R + 1 === C) {
18143
- (d -= 3) > -1 && O.push(239, 191, 189);
18143
+ (g -= 3) > -1 && O.push(239, 191, 189);
18144
18144
  continue;
18145
18145
  }
18146
18146
  k = y;
18147
18147
  continue;
18148
18148
  }
18149
18149
  if (y < 56320) {
18150
- (d -= 3) > -1 && O.push(239, 191, 189), k = y;
18150
+ (g -= 3) > -1 && O.push(239, 191, 189), k = y;
18151
18151
  continue;
18152
18152
  }
18153
18153
  y = (k - 55296 << 10 | y - 56320) + 65536;
18154
- } else k && (d -= 3) > -1 && O.push(239, 191, 189);
18154
+ } else k && (g -= 3) > -1 && O.push(239, 191, 189);
18155
18155
  if (k = null, y < 128) {
18156
- if ((d -= 1) < 0) break;
18156
+ if ((g -= 1) < 0) break;
18157
18157
  O.push(y);
18158
18158
  } else if (y < 2048) {
18159
- if ((d -= 2) < 0) break;
18159
+ if ((g -= 2) < 0) break;
18160
18160
  O.push(
18161
18161
  y >> 6 | 192,
18162
18162
  y & 63 | 128
18163
18163
  );
18164
18164
  } else if (y < 65536) {
18165
- if ((d -= 3) < 0) break;
18165
+ if ((g -= 3) < 0) break;
18166
18166
  O.push(
18167
18167
  y >> 12 | 224,
18168
18168
  y >> 6 & 63 | 128,
18169
18169
  y & 63 | 128
18170
18170
  );
18171
18171
  } else if (y < 1114112) {
18172
- if ((d -= 4) < 0) break;
18172
+ if ((g -= 4) < 0) break;
18173
18173
  O.push(
18174
18174
  y >> 18 | 240,
18175
18175
  y >> 12 & 63 | 128,
@@ -18182,34 +18182,34 @@ var P1 = Fc((L) => {
18182
18182
  return O;
18183
18183
  }
18184
18184
  function bc(F) {
18185
- for (var d = [], y = 0; y < F.length; ++y)
18186
- d.push(F.charCodeAt(y) & 255);
18187
- return d;
18185
+ for (var g = [], y = 0; y < F.length; ++y)
18186
+ g.push(F.charCodeAt(y) & 255);
18187
+ return g;
18188
18188
  }
18189
- function wc(F, d) {
18190
- for (var y, C, k, O = [], R = 0; R < F.length && !((d -= 2) < 0); ++R)
18189
+ function wc(F, g) {
18190
+ for (var y, C, k, O = [], R = 0; R < F.length && !((g -= 2) < 0); ++R)
18191
18191
  y = F.charCodeAt(R), C = y >> 8, k = y % 256, O.push(k), O.push(C);
18192
18192
  return O;
18193
18193
  }
18194
18194
  function Qs(F) {
18195
18195
  return e.toByteArray(cn(F));
18196
18196
  }
18197
- function un(F, d, y, C) {
18198
- for (var k = 0; k < C && !(k + y >= d.length || k >= F.length); ++k)
18199
- d[k + y] = F[k];
18197
+ function un(F, g, y, C) {
18198
+ for (var k = 0; k < C && !(k + y >= g.length || k >= F.length); ++k)
18199
+ g[k + y] = F[k];
18200
18200
  return k;
18201
18201
  }
18202
- function Ke(F, d) {
18203
- return F instanceof d || F != null && F.constructor != null && F.constructor.name != null && F.constructor.name === d.name;
18202
+ function Ke(F, g) {
18203
+ return F instanceof g || F != null && F.constructor != null && F.constructor.name != null && F.constructor.name === g.name;
18204
18204
  }
18205
18205
  function fi(F) {
18206
18206
  return F !== F;
18207
18207
  }
18208
18208
  var Sc = function() {
18209
- for (var F = "0123456789abcdef", d = new Array(256), y = 0; y < 16; ++y)
18209
+ for (var F = "0123456789abcdef", g = new Array(256), y = 0; y < 16; ++y)
18210
18210
  for (var C = y * 16, k = 0; k < 16; ++k)
18211
- d[C + k] = F[y] + F[k];
18212
- return d;
18211
+ g[C + k] = F[y] + F[k];
18212
+ return g;
18213
18213
  }();
18214
18214
  })(Vs);
18215
18215
  var Xn = Vs, xr = Xn.Buffer, De = {}, Ie;
@@ -18366,7 +18366,7 @@ var P1 = Fc((L) => {
18366
18366
  this.fillLast = h, w = 4;
18367
18367
  break;
18368
18368
  case "base64":
18369
- this.text = p, this.end = g, w = 3;
18369
+ this.text = p, this.end = d, w = 3;
18370
18370
  break;
18371
18371
  default:
18372
18372
  this.write = m, this.end = x;
@@ -18449,7 +18449,7 @@ var P1 = Fc((L) => {
18449
18449
  var b = (v.length - w) % 3;
18450
18450
  return b === 0 ? v.toString("base64", w) : (this.lastNeed = 3 - b, this.lastTotal = 3, b === 1 ? this.lastChar[0] = v[v.length - 1] : (this.lastChar[0] = v[v.length - 2], this.lastChar[1] = v[v.length - 1]), v.toString("base64", w, v.length - b));
18451
18451
  }
18452
- function g(v) {
18452
+ function d(v) {
18453
18453
  var w = v && v.length ? this.write(v) : "";
18454
18454
  return this.lastNeed ? w + this.lastChar.toString("base64", 0, 3 - this.lastNeed) : w;
18455
18455
  }
@@ -18523,8 +18523,8 @@ var P1 = Fc((L) => {
18523
18523
  this.acc = 0, this.contBytes = 0, this.accBytes = 0, this.defaultCharUnicode = u.defaultCharUnicode;
18524
18524
  }
18525
18525
  o.prototype.write = function(c) {
18526
- for (var u = this.acc, f = this.contBytes, l = this.accBytes, p = "", g = 0; g < c.length; g++) {
18527
- var m = c[g];
18526
+ for (var u = this.acc, f = this.contBytes, l = this.accBytes, p = "", d = 0; d < c.length; d++) {
18527
+ var m = c[d];
18528
18528
  (m & 192) !== 128 ? (f > 0 && (p += this.defaultCharUnicode, f = 0), m < 128 ? p += String.fromCharCode(m) : m < 224 ? (u = m & 31, f = 1, l = 1) : m < 240 ? (u = m & 15, f = 2, l = 1) : p += this.defaultCharUnicode) : f > 0 ? (u = u << 6 | m & 63, f--, l++, f === 0 && (l === 2 && u < 128 && u > 0 ? p += this.defaultCharUnicode : l === 3 && u < 2048 ? p += this.defaultCharUnicode : p += String.fromCharCode(u))) : p += this.defaultCharUnicode;
18529
18529
  }
18530
18530
  return this.acc = u, this.contBytes = f, this.accBytes = l, p;
@@ -18562,8 +18562,8 @@ var P1 = Fc((L) => {
18562
18562
  this.isLE = u.isLE, this.highSurrogate = 0;
18563
18563
  }
18564
18564
  t.prototype.write = function(c) {
18565
- for (var u = n.from(c, "ucs2"), f = n.alloc(u.length * 2), l = this.isLE ? f.writeUInt32LE : f.writeUInt32BE, p = 0, g = 0; g < u.length; g += 2) {
18566
- var m = u.readUInt16LE(g), x = m >= 55296 && m < 56320, v = m >= 56320 && m < 57344;
18565
+ for (var u = n.from(c, "ucs2"), f = n.alloc(u.length * 2), l = this.isLE ? f.writeUInt32LE : f.writeUInt32BE, p = 0, d = 0; d < u.length; d += 2) {
18566
+ var m = u.readUInt16LE(d), x = m >= 55296 && m < 56320, v = m >= 56320 && m < 57344;
18567
18567
  if (this.highSurrogate)
18568
18568
  if (x || !v)
18569
18569
  l.call(f, this.highSurrogate, p), p += 4;
@@ -18587,14 +18587,14 @@ var P1 = Fc((L) => {
18587
18587
  r.prototype.write = function(c) {
18588
18588
  if (c.length === 0)
18589
18589
  return "";
18590
- var u = 0, f = 0, l = n.alloc(c.length + 4), p = 0, g = this.isLE, m = this.overflow, x = this.badChar;
18590
+ var u = 0, f = 0, l = n.alloc(c.length + 4), p = 0, d = this.isLE, m = this.overflow, x = this.badChar;
18591
18591
  if (m.length > 0) {
18592
18592
  for (; u < c.length && m.length < 4; u++)
18593
18593
  m.push(c[u]);
18594
- m.length === 4 && (g ? f = m[u] | m[u + 1] << 8 | m[u + 2] << 16 | m[u + 3] << 24 : f = m[u + 3] | m[u + 2] << 8 | m[u + 1] << 16 | m[u] << 24, m.length = 0, p = i(l, p, f, x));
18594
+ m.length === 4 && (d ? f = m[u] | m[u + 1] << 8 | m[u + 2] << 16 | m[u + 3] << 24 : f = m[u + 3] | m[u + 2] << 8 | m[u + 1] << 16 | m[u] << 24, m.length = 0, p = i(l, p, f, x));
18595
18595
  }
18596
18596
  for (; u < c.length - 3; u += 4)
18597
- g ? f = c[u] | c[u + 1] << 8 | c[u + 2] << 16 | c[u + 3] << 24 : f = c[u + 3] | c[u + 2] << 8 | c[u + 1] << 16 | c[u] << 24, p = i(l, p, f, x);
18597
+ d ? f = c[u] | c[u + 1] << 8 | c[u + 2] << 16 | c[u + 3] << 24 : f = c[u + 3] | c[u + 2] << 8 | c[u + 1] << 16 | c[u] << 24, p = i(l, p, f, x);
18598
18598
  for (; u < c.length; u++)
18599
18599
  m.push(c[u]);
18600
18600
  return l.slice(0, p).toString("ucs2");
@@ -18649,7 +18649,7 @@ var P1 = Fc((L) => {
18649
18649
  return this.decoder.end();
18650
18650
  };
18651
18651
  function h(c, u) {
18652
- var f = [], l = 0, p = 0, g = 0, m = 0, x = 0;
18652
+ var f = [], l = 0, p = 0, d = 0, m = 0, x = 0;
18653
18653
  e:
18654
18654
  for (var v = 0; v < c.length; v++)
18655
18655
  for (var w = c[v], b = 0; b < w.length; b++)
@@ -18660,10 +18660,10 @@ var P1 = Fc((L) => {
18660
18660
  if (f[0] === 0 && f[1] === 0 && f[2] === 254 && f[3] === 255)
18661
18661
  return "utf-32be";
18662
18662
  }
18663
- if ((f[0] !== 0 || f[1] > 16) && g++, (f[3] !== 0 || f[2] > 16) && p++, f[0] === 0 && f[1] === 0 && (f[2] !== 0 || f[3] !== 0) && x++, (f[0] !== 0 || f[1] !== 0) && f[2] === 0 && f[3] === 0 && m++, f.length = 0, l++, l >= 100)
18663
+ if ((f[0] !== 0 || f[1] > 16) && d++, (f[3] !== 0 || f[2] > 16) && p++, f[0] === 0 && f[1] === 0 && (f[2] !== 0 || f[3] !== 0) && x++, (f[0] !== 0 || f[1] !== 0) && f[2] === 0 && f[3] === 0 && m++, f.length = 0, l++, l >= 100)
18664
18664
  break e;
18665
18665
  }
18666
- return x - g > m - p ? "utf-32be" : x - g < m - p ? "utf-32le" : u || "utf-32le";
18666
+ return x - d > m - p ? "utf-32be" : x - d < m - p ? "utf-32le" : u || "utf-32le";
18667
18667
  }
18668
18668
  return ft;
18669
18669
  }
@@ -18739,8 +18739,8 @@ var P1 = Fc((L) => {
18739
18739
  function o(h, c) {
18740
18740
  var u = [], f = 0, l = 0, p = 0;
18741
18741
  e:
18742
- for (var g = 0; g < h.length; g++)
18743
- for (var m = h[g], x = 0; x < m.length; x++)
18742
+ for (var d = 0; d < h.length; d++)
18743
+ for (var m = h[d], x = 0; x < m.length; x++)
18744
18744
  if (u.push(m[x]), u.length === 2) {
18745
18745
  if (f === 0) {
18746
18746
  if (u[0] === 255 && u[1] === 254) return "utf-16le";
@@ -18823,12 +18823,12 @@ var P1 = Fc((L) => {
18823
18823
  function p(m, x) {
18824
18824
  this.iconv = x.iconv, this.inBase64 = !1, this.base64Accum = "";
18825
18825
  }
18826
- var g = a.slice();
18827
- return g[44] = !0, p.prototype.write = function(m) {
18826
+ var d = a.slice();
18827
+ return d[44] = !0, p.prototype.write = function(m) {
18828
18828
  for (var x = "", v = 0, w = this.inBase64, b = this.base64Accum, S = 0; S < m.length; S++)
18829
18829
  if (!w)
18830
18830
  m[S] == u && (x += this.iconv.decode(m.slice(v, S), "ascii"), v = S + 1, w = !0);
18831
- else if (!g[m[S]]) {
18831
+ else if (!d[m[S]]) {
18832
18832
  if (S == v && m[S] == c)
18833
18833
  x += "&";
18834
18834
  else {
@@ -19508,10 +19508,10 @@ var P1 = Fc((L) => {
19508
19508
  throw new Error("DBCS codec is called without the data.");
19509
19509
  if (!l.table)
19510
19510
  throw new Error("Encoding '" + this.encodingName + "' has no data.");
19511
- var g = l.table();
19511
+ var d = l.table();
19512
19512
  this.decodeTables = [], this.decodeTables[0] = s.slice(0), this.decodeTableSeq = [];
19513
- for (var m = 0; m < g.length; m++)
19514
- this._addDecodeChunk(g[m]);
19513
+ for (var m = 0; m < d.length; m++)
19514
+ this._addDecodeChunk(d[m]);
19515
19515
  if (typeof l.gb18030 == "function") {
19516
19516
  this.gb18030 = l.gb18030();
19517
19517
  var x = this.decodeTables.length;
@@ -19558,18 +19558,18 @@ var P1 = Fc((L) => {
19558
19558
  for (var p = []; l > 0; l >>>= 8)
19559
19559
  p.push(l & 255);
19560
19560
  p.length == 0 && p.push(0);
19561
- for (var g = this.decodeTables[0], m = p.length - 1; m > 0; m--) {
19562
- var x = g[p[m]];
19561
+ for (var d = this.decodeTables[0], m = p.length - 1; m > 0; m--) {
19562
+ var x = d[p[m]];
19563
19563
  if (x == e)
19564
- g[p[m]] = i - this.decodeTables.length, this.decodeTables.push(g = s.slice(0));
19564
+ d[p[m]] = i - this.decodeTables.length, this.decodeTables.push(d = s.slice(0));
19565
19565
  else if (x <= i)
19566
- g = this.decodeTables[i - x];
19566
+ d = this.decodeTables[i - x];
19567
19567
  else
19568
19568
  throw new Error("Overwrite byte in " + this.encodingName + ", addr: " + l.toString(16));
19569
19569
  }
19570
- return g;
19570
+ return d;
19571
19571
  }, h.prototype._addDecodeChunk = function(l) {
19572
- var p = parseInt(l[0], 16), g = this._getDecodeTrieNode(p);
19572
+ var p = parseInt(l[0], 16), d = this._getDecodeTrieNode(p);
19573
19573
  p = p & 255;
19574
19574
  for (var m = 1; m < l.length; m++) {
19575
19575
  var x = l[m];
@@ -19579,19 +19579,19 @@ var P1 = Fc((L) => {
19579
19579
  if (w >= 55296 && w < 56320) {
19580
19580
  var b = x.charCodeAt(v++);
19581
19581
  if (b >= 56320 && b < 57344)
19582
- g[p++] = 65536 + (w - 55296) * 1024 + (b - 56320);
19582
+ d[p++] = 65536 + (w - 55296) * 1024 + (b - 56320);
19583
19583
  else
19584
19584
  throw new Error("Incorrect surrogate pair in " + this.encodingName + " at chunk " + l[0]);
19585
19585
  } else if (w > 4080 && w <= 4095) {
19586
19586
  for (var S = 4095 - w + 2, T = [], B = 0; B < S; B++)
19587
19587
  T.push(x.charCodeAt(v++));
19588
- g[p++] = r - this.decodeTableSeq.length, this.decodeTableSeq.push(T);
19588
+ d[p++] = r - this.decodeTableSeq.length, this.decodeTableSeq.push(T);
19589
19589
  } else
19590
- g[p++] = w;
19590
+ d[p++] = w;
19591
19591
  }
19592
19592
  else if (typeof x == "number")
19593
- for (var M = g[p - 1] + 1, v = 0; v < x; v++)
19594
- g[p++] = M++;
19593
+ for (var M = d[p - 1] + 1, v = 0; v < x; v++)
19594
+ d[p++] = M++;
19595
19595
  else
19596
19596
  throw new Error("Incorrect type '" + typeof x + "' given in " + this.encodingName + " at chunk " + l[0]);
19597
19597
  }
@@ -19601,27 +19601,27 @@ var P1 = Fc((L) => {
19601
19601
  var p = l >> 8;
19602
19602
  return this.encodeTable[p] === void 0 && (this.encodeTable[p] = s.slice(0)), this.encodeTable[p];
19603
19603
  }, h.prototype._setEncodeChar = function(l, p) {
19604
- var g = this._getEncodeBucket(l), m = l & 255;
19605
- g[m] <= r ? this.encodeTableSeq[r - g[m]][a] = p : g[m] == e && (g[m] = p);
19604
+ var d = this._getEncodeBucket(l), m = l & 255;
19605
+ d[m] <= r ? this.encodeTableSeq[r - d[m]][a] = p : d[m] == e && (d[m] = p);
19606
19606
  }, h.prototype._setEncodeSequence = function(l, p) {
19607
- var g = l[0], m = this._getEncodeBucket(g), x = g & 255, v;
19607
+ var d = l[0], m = this._getEncodeBucket(d), x = d & 255, v;
19608
19608
  m[x] <= r ? v = this.encodeTableSeq[r - m[x]] : (v = {}, m[x] !== e && (v[a] = m[x]), m[x] = r - this.encodeTableSeq.length, this.encodeTableSeq.push(v));
19609
19609
  for (var w = 1; w < l.length - 1; w++) {
19610
- var b = v[g];
19611
- typeof b == "object" ? v = b : (v = v[g] = {}, b !== void 0 && (v[a] = b));
19610
+ var b = v[d];
19611
+ typeof b == "object" ? v = b : (v = v[d] = {}, b !== void 0 && (v[a] = b));
19612
19612
  }
19613
- g = l[l.length - 1], v[g] = p;
19614
- }, h.prototype._fillEncodeTable = function(l, p, g) {
19613
+ d = l[l.length - 1], v[d] = p;
19614
+ }, h.prototype._fillEncodeTable = function(l, p, d) {
19615
19615
  for (var m = this.decodeTables[l], x = !1, v = {}, w = 0; w < 256; w++) {
19616
19616
  var b = m[w], S = p + w;
19617
- if (!g[S])
19617
+ if (!d[S])
19618
19618
  if (b >= 0)
19619
19619
  this._setEncodeChar(b, S), x = !0;
19620
19620
  else if (b <= i) {
19621
19621
  var T = i - b;
19622
19622
  if (!v[T]) {
19623
19623
  var B = S << 8 >>> 0;
19624
- this._fillEncodeTable(T, B, g) ? x = !0 : v[T] = !0;
19624
+ this._fillEncodeTable(T, B, d) ? x = !0 : v[T] = !0;
19625
19625
  }
19626
19626
  } else b <= r && (this._setEncodeSequence(this.decodeTableSeq[r - b], S), x = !0);
19627
19627
  }
@@ -19631,7 +19631,7 @@ var P1 = Fc((L) => {
19631
19631
  this.leadSurrogate = -1, this.seqObj = void 0, this.encodeTable = p.encodeTable, this.encodeTableSeq = p.encodeTableSeq, this.defaultCharSingleByte = p.defCharSB, this.gb18030 = p.gb18030;
19632
19632
  }
19633
19633
  c.prototype.write = function(l) {
19634
- for (var p = n.alloc(l.length * (this.gb18030 ? 4 : 3)), g = this.leadSurrogate, m = this.seqObj, x = -1, v = 0, w = 0; ; ) {
19634
+ for (var p = n.alloc(l.length * (this.gb18030 ? 4 : 3)), d = this.leadSurrogate, m = this.seqObj, x = -1, v = 0, w = 0; ; ) {
19635
19635
  if (x === -1) {
19636
19636
  if (v == l.length) break;
19637
19637
  var b = l.charCodeAt(v++);
@@ -19641,14 +19641,14 @@ var P1 = Fc((L) => {
19641
19641
  }
19642
19642
  if (b >= 55296 && b < 57344)
19643
19643
  if (b < 56320)
19644
- if (g === -1) {
19645
- g = b;
19644
+ if (d === -1) {
19645
+ d = b;
19646
19646
  continue;
19647
19647
  } else
19648
- g = b, b = e;
19648
+ d = b, b = e;
19649
19649
  else
19650
- g !== -1 ? (b = 65536 + (g - 55296) * 1024 + (b - 56320), g = -1) : b = e;
19651
- else g !== -1 && (x = b, b = e, g = -1);
19650
+ d !== -1 ? (b = 65536 + (d - 55296) * 1024 + (b - 56320), d = -1) : b = e;
19651
+ else d !== -1 && (x = b, b = e, d = -1);
19652
19652
  var S = e;
19653
19653
  if (m !== void 0 && b != e) {
19654
19654
  var T = m[b];
@@ -19674,13 +19674,13 @@ var P1 = Fc((L) => {
19674
19674
  }
19675
19675
  S === e && (S = this.defaultCharSingleByte), S < 256 ? p[w++] = S : S < 65536 ? (p[w++] = S >> 8, p[w++] = S & 255) : S < 16777216 ? (p[w++] = S >> 16, p[w++] = S >> 8 & 255, p[w++] = S & 255) : (p[w++] = S >>> 24, p[w++] = S >>> 16 & 255, p[w++] = S >>> 8 & 255, p[w++] = S & 255);
19676
19676
  }
19677
- return this.seqObj = m, this.leadSurrogate = g, p.slice(0, w);
19677
+ return this.seqObj = m, this.leadSurrogate = d, p.slice(0, w);
19678
19678
  }, c.prototype.end = function() {
19679
19679
  if (!(this.leadSurrogate === -1 && this.seqObj === void 0)) {
19680
19680
  var l = n.alloc(10), p = 0;
19681
19681
  if (this.seqObj) {
19682
- var g = this.seqObj[a];
19683
- g !== void 0 && (g < 256 ? l[p++] = g : (l[p++] = g >> 8, l[p++] = g & 255)), this.seqObj = void 0;
19682
+ var d = this.seqObj[a];
19683
+ d !== void 0 && (d < 256 ? l[p++] = d : (l[p++] = d >> 8, l[p++] = d & 255)), this.seqObj = void 0;
19684
19684
  }
19685
19685
  return this.leadSurrogate !== -1 && (l[p++] = this.defaultCharSingleByte, this.leadSurrogate = -1), l.slice(0, p);
19686
19686
  }
@@ -19689,8 +19689,8 @@ var P1 = Fc((L) => {
19689
19689
  this.nodeIdx = 0, this.prevBytes = [], this.decodeTables = p.decodeTables, this.decodeTableSeq = p.decodeTableSeq, this.defaultCharUnicode = p.defaultCharUnicode, this.gb18030 = p.gb18030;
19690
19690
  }
19691
19691
  u.prototype.write = function(l) {
19692
- for (var p = n.alloc(l.length * 2), g = this.nodeIdx, m = this.prevBytes, x = this.prevBytes.length, v = -this.prevBytes.length, w, b = 0, S = 0; b < l.length; b++) {
19693
- var T = b >= 0 ? l[b] : m[b + x], w = this.decodeTables[g][T];
19692
+ for (var p = n.alloc(l.length * 2), d = this.nodeIdx, m = this.prevBytes, x = this.prevBytes.length, v = -this.prevBytes.length, w, b = 0, S = 0; b < l.length; b++) {
19693
+ var T = b >= 0 ? l[b] : m[b + x], w = this.decodeTables[d][T];
19694
19694
  if (!(w >= 0)) if (w === e)
19695
19695
  w = this.defaultCharUnicode.charCodeAt(0), b = v;
19696
19696
  else if (w === t) {
@@ -19701,22 +19701,22 @@ var P1 = Fc((L) => {
19701
19701
  var M = f(this.gb18030.gbChars, B);
19702
19702
  w = this.gb18030.uChars[M] + B - this.gb18030.gbChars[M];
19703
19703
  } else if (w <= i) {
19704
- g = i - w;
19704
+ d = i - w;
19705
19705
  continue;
19706
19706
  } else if (w <= r) {
19707
19707
  for (var _ = this.decodeTableSeq[r - w], D = 0; D < _.length - 1; D++)
19708
19708
  w = _[D], p[S++] = w & 255, p[S++] = w >> 8;
19709
19709
  w = _[_.length - 1];
19710
19710
  } else
19711
- throw new Error("iconv-lite internal error: invalid decoding table value " + w + " at " + g + "/" + T);
19711
+ throw new Error("iconv-lite internal error: invalid decoding table value " + w + " at " + d + "/" + T);
19712
19712
  if (w >= 65536) {
19713
19713
  w -= 65536;
19714
19714
  var N = 55296 | w >> 10;
19715
19715
  p[S++] = N & 255, p[S++] = N >> 8, w = 56320 | w & 1023;
19716
19716
  }
19717
- p[S++] = w & 255, p[S++] = w >> 8, g = 0, v = b + 1;
19717
+ p[S++] = w & 255, p[S++] = w >> 8, d = 0, v = b + 1;
19718
19718
  }
19719
- return this.nodeIdx = g, this.prevBytes = v >= 0 ? Array.prototype.slice.call(l, v) : m.slice(v + x).concat(Array.prototype.slice.call(l)), p.slice(0, S).toString("ucs2");
19719
+ return this.nodeIdx = d, this.prevBytes = v >= 0 ? Array.prototype.slice.call(l, v) : m.slice(v + x).concat(Array.prototype.slice.call(l)), p.slice(0, S).toString("ucs2");
19720
19720
  }, u.prototype.end = function() {
19721
19721
  for (var l = ""; this.prevBytes.length > 0; ) {
19722
19722
  l += this.defaultCharUnicode;
@@ -19728,11 +19728,11 @@ var P1 = Fc((L) => {
19728
19728
  function f(l, p) {
19729
19729
  if (l[0] > p)
19730
19730
  return -1;
19731
- for (var g = 0, m = l.length; g < m - 1; ) {
19732
- var x = g + (m - g + 1 >> 1);
19733
- l[x] <= p ? g = x : m = x;
19731
+ for (var d = 0, m = l.length; d < m - 1; ) {
19732
+ var x = d + (m - d + 1 >> 1);
19733
+ l[x] <= p ? d = x : m = x;
19734
19734
  }
19735
- return g;
19735
+ return d;
19736
19736
  }
19737
19737
  return ss;
19738
19738
  }
@@ -28418,8 +28418,25 @@ var P1 = Fc((L) => {
28418
28418
  * @param shape - The shape data for this character
28419
28419
  */
28420
28420
  constructor(e, t, r, i) {
28421
- var s;
28422
- super(), this.fontSize = t, this.shape = r, this.font = i, this.code = e, i.data.header.fontType === Te.BIGFONT ? this.width = this.calcWidth() : this.width = ((s = r.lastPoint) == null ? void 0 : s.x) ?? this.calcWidth();
28421
+ super(), this.fontSize = t, this.shape = r, this.font = i, this.code = e, this.width = this.resolveAdvanceWidth(r);
28422
+ }
28423
+ /**
28424
+ * Resolves horizontal advance for SHX glyphs.
28425
+ *
28426
+ * - Unicode / shapes fonts: prefer the pen-down end X (lastPoint), which matches
28427
+ * AutoCAD's advance for single-byte SHX.
28428
+ * - Big fonts (CJK): advance is the scaled font cell width (content.width /
28429
+ * content.height * fontSize). Glyph bbox or lastPoint can be narrower than the
28430
+ * cell; using only bbox caused successive Han characters to overlap visually.
28431
+ */
28432
+ resolveAdvanceWidth(e) {
28433
+ var i;
28434
+ const t = this.calcWidth(), r = ((i = e.lastPoint) == null ? void 0 : i.x) ?? 0;
28435
+ if (this.font.data.header.fontType === Te.BIGFONT) {
28436
+ const { width: s, height: a } = this.font.data.content, o = a > 0 ? s / a * this.fontSize : 0;
28437
+ return Math.max(t, r, o);
28438
+ }
28439
+ return r > 0 ? r : t;
28423
28440
  }
28424
28441
  calcWidth() {
28425
28442
  const e = this.shape.bbox;
@@ -28479,30 +28496,63 @@ var P1 = Fc((L) => {
28479
28496
  hasCode(e) {
28480
28497
  return this.font.hasChar(e);
28481
28498
  }
28499
+ /**
28500
+ * Horizontal advance for the space character (ASCII 32) at the given size.
28501
+ * Uses the SHX glyph pen advance when defined; otherwise falls back to half the
28502
+ * text height (common for AutoCAD SHX fonts).
28503
+ */
28504
+ getSpaceAdvance(e) {
28505
+ const t = this.getCharShape(" ", e);
28506
+ return t ? t.width : e * 0.5;
28507
+ }
28482
28508
  generateShapes(e, t) {
28483
28509
  const r = [];
28484
28510
  let i = 0;
28485
28511
  for (let s = 0; s < e.length; s++) {
28486
28512
  const a = e[s];
28487
28513
  if (a === " ") {
28488
- i += t;
28514
+ i += this.getSpaceAdvance(t);
28489
28515
  continue;
28490
28516
  }
28491
28517
  const o = this.getCharShape(a, t);
28492
28518
  if (!o) {
28493
- i += t, this.addUnsupportedChar(a);
28519
+ i += this.getSpaceAdvance(t), this.addUnsupportedChar(a);
28494
28520
  continue;
28495
28521
  }
28496
- r.push(o.offset(new le(i, 0))), i += o.width;
28522
+ r.push(o.offset(new fe(i, 0))), i += o.width;
28497
28523
  }
28498
28524
  return r;
28499
28525
  }
28500
28526
  /**
28501
- * SHX font always has fixed scale factor 1.
28502
- * @returns Always return value 1
28527
+ * Scale factor that converts AutoCAD's `TEXT.height` (cap-height in the SHX
28528
+ * convention) into the em-box-scaled size expected by `generateShapes`.
28529
+ *
28530
+ * SHX glyphs are defined with `baseUp` units of cap-height (height of an
28531
+ * uppercase letter above the baseline) and `height` units of total em-box
28532
+ * (cap-height + descender + headroom for accents). AutoCAD's DXF group 40
28533
+ * for TEXT/ATTRIB/MTEXT is the cap-height — the historical SHX convention
28534
+ * since the format's introduction in AutoCAD R2 (1985), kept by AutoCAD
28535
+ * when TrueType support was added in the early 1990s so that DWGs portable
28536
+ * across font formats render at consistent visual sizes.
28537
+ *
28538
+ * Returning `1` (the previous behavior) meant SHX glyphs were rendered at
28539
+ * `baseUp / height` of the expected size — typically ~0.75 for western
28540
+ * fonts like `romans.shx`/`complex.shx` where `baseUp=21, height=28`.
28541
+ * Multiplying by `height / baseUp` restores the cap-height interpretation.
28542
+ *
28543
+ * Mirrors the behavior already in place for mesh fonts (see
28544
+ * `meshFontParser.ts` where `scaleFactor = unitsPerEm / glyph('A').yMax`),
28545
+ * isolated to the glyph render path only — `mtextProcessor.currentLayoutFontSize`
28546
+ * divides by this factor to keep layout metrics (line height, attachment
28547
+ * offsets, blank width) on the original cap-height scale.
28548
+ *
28549
+ * @returns `height / baseUp` when both are populated and positive; `1`
28550
+ * otherwise (e.g. exotic BIGFONT/symbol fonts without standard metrics),
28551
+ * matching the prior behavior as a safe fallback.
28503
28552
  */
28504
28553
  getScaleFactor() {
28505
- return 1;
28554
+ const { height: e, baseUp: t } = this.data.content;
28555
+ return t > 0 && e > 0 ? e / t : 1;
28506
28556
  }
28507
28557
  /**
28508
28558
  * Gets the shape data for a specific character at a given size.
@@ -28999,7 +29049,7 @@ var P1 = Fc((L) => {
28999
29049
  const r = [];
29000
29050
  if (n.filter((l) => l.char !== Zn).forEach((l) => {
29001
29051
  const p = _1(
29002
- new Ee().copy(l.box).applyMatrix4(e)
29052
+ new ke().copy(l.box).applyMatrix4(e)
29003
29053
  );
29004
29054
  p && r.push({
29005
29055
  type: ye.CHAR,
@@ -29019,7 +29069,7 @@ var P1 = Fc((L) => {
29019
29069
  }
29020
29070
  const h = r.slice(0, a).filter(i), c = r.slice(o + 1).filter(i), u = r.slice(a, o + 1).filter(s);
29021
29071
  if (u.length === 0) return [...h, ...c];
29022
- const f = new Ee().copy(u[0].box);
29072
+ const f = new ke().copy(u[0].box);
29023
29073
  return u.slice(1).forEach((l) => f.union(l.box)), [
29024
29074
  ...h,
29025
29075
  {
@@ -29031,7 +29081,7 @@ var P1 = Fc((L) => {
29031
29081
  ...c
29032
29082
  ];
29033
29083
  }
29034
- const B1 = /* @__PURE__ */ new E(), L1 = 1.666666, Wn = 0.3;
29084
+ const B1 = 1.666666, Wn = 0.3, L1 = /* @__PURE__ */ new E();
29035
29085
  class $s extends Qr {
29036
29086
  /**
29037
29087
  * Creates a new RenderContext instance with optional initial values.
@@ -29177,7 +29227,7 @@ var P1 = Fc((L) => {
29177
29227
  * The height of current line of texts
29178
29228
  */
29179
29229
  get currentLineHeight() {
29180
- const e = this.defaultLineSpaceFactor * this.currentFontSize * L1, t = this.currentMaxFontSize > 0 ? this.currentMaxFontSize : this.currentFontSize;
29230
+ const e = this.defaultLineSpaceFactor * this.currentFontSize * B1, t = this.currentMaxFontSize > 0 ? this.currentMaxFontSize : this.currentFontSize;
29181
29231
  return e + t;
29182
29232
  }
29183
29233
  /**
@@ -29203,6 +29253,10 @@ var P1 = Fc((L) => {
29203
29253
  get currentWidthFactor() {
29204
29254
  return this._currentContext.widthFactor.value;
29205
29255
  }
29256
+ /** Horizontal advance for one space, including tracking and width factor. */
29257
+ get currentBlankAdvance() {
29258
+ return this._currentContext.blankWidth * this.currentWordSpace * this.currentWidthFactor;
29259
+ }
29206
29260
  /**
29207
29261
  * All of THREE.js objects in current line. It contains objects in all of sections of this line.
29208
29262
  */
@@ -29311,7 +29365,7 @@ var P1 = Fc((L) => {
29311
29365
  * - underline/overline/strike-through flags
29312
29366
  */
29313
29367
  applyPropertyChanges(e) {
29314
- this.applyFontFaceChange(e.fontFace), this.applyColorCommandChanges(e), this.applyWidthFactorChange(e.widthFactor), this.applyCapHeightChange(e.capHeight), this.applyCharTrackingChange(e.charTrackingFactor), this.applyParagraphChange(e.paragraph), typeof e.underline == "boolean" && (this._currentContext.underline = e.underline), typeof e.overline == "boolean" && (this._currentContext.overline = e.overline), typeof e.strikeThrough == "boolean" && (this._currentContext.strikeThrough = e.strikeThrough), e.oblique !== void 0 && (this._currentContext.oblique = e.oblique);
29368
+ this.applyFontFaceChange(e.fontFace), this.applyColorCommandChanges(e), this.applyWidthFactorChange(e.widthFactor), this.applyCapHeightChange(e.capHeight), this.applyCharTrackingChange(e.charTrackingFactor), this.applyParagraphMarginsOnly(e.paragraph), typeof e.underline == "boolean" && (this._currentContext.underline = e.underline), typeof e.overline == "boolean" && (this._currentContext.overline = e.overline), typeof e.strikeThrough == "boolean" && (this._currentContext.strikeThrough = e.strikeThrough), e.oblique !== void 0 && (this._currentContext.oblique = e.oblique);
29315
29369
  }
29316
29370
  /**
29317
29371
  * Apply a font face change to the current render context, including
@@ -29373,12 +29427,23 @@ var P1 = Fc((L) => {
29373
29427
  isRelative: !1
29374
29428
  });
29375
29429
  }
29430
+ /**
29431
+ * Applies indent and margins from a paragraph snapshot only.
29432
+ *
29433
+ * Used when exiting `{}` formatting groups: the parser restores full context
29434
+ * including `paragraph.align`, but paragraph alignment is not scoped to `{}`
29435
+ * (see class comment on `_currentHorizontalAlignment`). Restoring align here
29436
+ * would undo an active `\\p...` alignment before the line is finalized.
29437
+ */
29438
+ applyParagraphMarginsOnly(e) {
29439
+ e && (typeof e.indent == "number" && (this._currentIndent = e.indent * this.defaultFontSize, this._hOffset += this._currentIndent), typeof e.left == "number" && (this._currentLeftMargin = e.left * this.defaultFontSize), typeof e.right == "number" && (this._currentRightMargin = e.right * this.defaultFontSize));
29440
+ }
29376
29441
  /**
29377
29442
  * Apply paragraph-level changes such as alignment and margins.
29378
29443
  * @param paragraph Paragraph change data.
29379
29444
  */
29380
29445
  applyParagraphChange(e) {
29381
- e && (e.align && (this._currentHorizontalAlignment = e.align), typeof e.indent == "number" && (this._currentIndent = e.indent * this.defaultFontSize, this._hOffset += this._currentIndent), typeof e.left == "number" && (this._currentLeftMargin = e.left * this.defaultFontSize), typeof e.right == "number" && (this._currentRightMargin = e.right * this.defaultFontSize));
29446
+ e && ("align" in e && (this._currentHorizontalAlignment = e.align), typeof e.indent == "number" && (this._currentIndent = e.indent * this.defaultFontSize, this._hOffset += this._currentIndent), typeof e.left == "number" && (this._currentLeftMargin = e.left * this.defaultFontSize), typeof e.right == "number" && (this._currentRightMargin = e.right * this.defaultFontSize));
29382
29447
  }
29383
29448
  /**
29384
29449
  * Reset paragraph properties to their default values from options.
@@ -29524,7 +29589,7 @@ var P1 = Fc((L) => {
29524
29589
  let a = 0;
29525
29590
  for (let o = 0; o < e.length; o++) {
29526
29591
  const h = this.getCharShape(e[o]);
29527
- h ? this.currentHorizontalAlignment == fe.DISTRIBUTED ? a += h.width * this.currentWidthFactor : a += h.width * this.currentWordSpace * this.currentWidthFactor : a += this._currentContext.blankWidth;
29592
+ h ? this.currentHorizontalAlignment == ce.DISTRIBUTED ? a += h.width * this.currentWidthFactor : a += h.width * this.currentWordSpace * this.currentWidthFactor : a += this.currentBlankAdvance;
29528
29593
  }
29529
29594
  this.hOffset + a > (this.maxLineWidth || 1 / 0) && (this._vOffset <= 0 && this._currentLineObjects.length <= 0 || (this.recordVisualLineBreak(i, s), this.advanceToNextLine(!1)));
29530
29595
  for (let o = 0; o < e.length; o++)
@@ -29537,12 +29602,12 @@ var P1 = Fc((L) => {
29537
29602
  );
29538
29603
  }
29539
29604
  processStack(e, t, r, i, s) {
29540
- const [a, o, h] = e, c = this._hOffset, u = this._vOffset, f = this._currentContext.charTrackingFactor.value, l = this.currentLayoutFontSize, p = this._currentContext.fontSizeScaleFactor;
29605
+ const [a, o, h] = e, c = this._hOffset, u = this._vOffset, f = this._currentContext.charTrackingFactor.value, l = this.currentFontSize, p = this._currentContext.fontSizeScaleFactor;
29541
29606
  this._hOffset = c, this._currentContext.charTrackingFactor = { value: 1, isRelative: !1 };
29542
- let g = 0;
29607
+ let d = 0;
29543
29608
  for (let b = 0; b < a.length; b++) {
29544
29609
  const S = this.getCharShape(a[b]);
29545
- S && (g += S.width * this.currentWidthFactor);
29610
+ S && (d += S.width * this.currentWidthFactor);
29546
29611
  }
29547
29612
  this._hOffset = c;
29548
29613
  let m = 0;
@@ -29550,13 +29615,13 @@ var P1 = Fc((L) => {
29550
29615
  const S = this.getCharShape(o[b]);
29551
29616
  S && (m += S.width * this.currentWidthFactor);
29552
29617
  }
29553
- const x = Math.max(g, m), v = (x - g) / 2, w = (x - m) / 2;
29618
+ const x = Math.max(d, m), v = (x - d) / 2, w = (x - m) / 2;
29554
29619
  if (h === "^") {
29555
29620
  if (this._currentContext.fontSizeScaleFactor = p * 0.7, this.calcuateLineParams(), a && !o) {
29556
29621
  const b = [], S = [], T = [], B = [];
29557
29622
  this._hOffset = c, this._vOffset = this.convertTopAlignedVOffset(
29558
29623
  u + l * 0.1,
29559
- this.currentLayoutFontSize
29624
+ this.currentFontSize
29560
29625
  );
29561
29626
  for (let M = 0; M < a.length; M++)
29562
29627
  this.processChar(
@@ -29566,12 +29631,12 @@ var P1 = Fc((L) => {
29566
29631
  T,
29567
29632
  B
29568
29633
  );
29569
- t.push(...b), r.push(...S), i.push(...T), s.push(...B), this._hOffset = c + g;
29634
+ t.push(...b), r.push(...S), i.push(...T), s.push(...B), this._hOffset = c + d;
29570
29635
  } else if (!a && o) {
29571
29636
  const b = [], S = [], T = [], B = [];
29572
29637
  this._hOffset = c, this._vOffset = this.convertTopAlignedVOffset(
29573
29638
  u - l * 0.6,
29574
- this.currentLayoutFontSize
29639
+ this.currentFontSize
29575
29640
  );
29576
29641
  for (let M = 0; M < o.length; M++)
29577
29642
  this.processChar(
@@ -29587,8 +29652,8 @@ var P1 = Fc((L) => {
29587
29652
  } else {
29588
29653
  const b = [], S = [], T = [], B = [];
29589
29654
  this._hOffset = c + v, this._vOffset = this.convertTopAlignedVOffset(
29590
- u + this.currentLayoutFontSize * 0.3,
29591
- this.currentLayoutFontSize
29655
+ u + this.currentFontSize * 0.3,
29656
+ this.currentFontSize
29592
29657
  );
29593
29658
  for (let G = 0; G < a.length; G++)
29594
29659
  this.processChar(
@@ -29607,8 +29672,8 @@ var P1 = Fc((L) => {
29607
29672
  );
29608
29673
  const M = [], _ = [], D = [], N = [];
29609
29674
  this._hOffset = c + w, this._vOffset = this.convertTopAlignedVOffset(
29610
- u - this.currentLayoutFontSize * 0.6,
29611
- this.currentLayoutFontSize
29675
+ u - this.currentFontSize * 0.6,
29676
+ this.currentFontSize
29612
29677
  );
29613
29678
  for (let G = 0; G < o.length; G++)
29614
29679
  this.processChar(
@@ -29621,10 +29686,10 @@ var P1 = Fc((L) => {
29621
29686
  if (t.push(...M), r.push(..._), i.push(...D), s.push(...N), h === "/" || h === "#") {
29622
29687
  const G = new ze(), ee = new Float32Array([
29623
29688
  c,
29624
- u - this.currentLayoutFontSize * 0.8 + this.defaultFontSize * Wn,
29689
+ u - this.currentFontSize * 0.8 + this.defaultFontSize * Wn,
29625
29690
  0,
29626
29691
  c + x,
29627
- u - this.currentLayoutFontSize * 0.8 + this.defaultFontSize * Wn,
29692
+ u - this.currentFontSize * 0.8 + this.defaultFontSize * Wn,
29628
29693
  0
29629
29694
  ]);
29630
29695
  G.setAttribute(
@@ -29641,7 +29706,7 @@ var P1 = Fc((L) => {
29641
29706
  }
29642
29707
  recordStackDivider(e, t, r, i, s) {
29643
29708
  if (this._options.collectCharBoxes === !1) return;
29644
- const a = t - this.currentLayoutFontSize * 0.8 + this.defaultFontSize * Wn, o = new Ee(
29709
+ const a = t - this.currentFontSize * 0.8 + this.defaultFontSize * Wn, o = new ke(
29645
29710
  new E(e, a, 0),
29646
29711
  new E(e + r, a, 0)
29647
29712
  );
@@ -29666,10 +29731,10 @@ var P1 = Fc((L) => {
29666
29731
  }
29667
29732
  processBlank(e, t) {
29668
29733
  if (this._options.collectCharBoxes !== !1) {
29669
- const r = this._hOffset, i = this.flowDirection == Mt.BOTTOM_TO_TOP ? this._vOffset : this._vOffset - this.currentLayoutFontSize, s = new Ee(
29734
+ const r = this._hOffset, i = this.flowDirection == Mt.BOTTOM_TO_TOP ? this._vOffset : this._vOffset - this.currentLayoutFontSize, s = new ke(
29670
29735
  new E(r, i, 0),
29671
29736
  new E(
29672
- r + this._currentContext.blankWidth,
29737
+ r + this.currentBlankAdvance,
29673
29738
  i + this.currentLayoutFontSize,
29674
29739
  0
29675
29740
  )
@@ -29686,7 +29751,7 @@ var P1 = Fc((L) => {
29686
29751
  children: []
29687
29752
  });
29688
29753
  }
29689
- this._hOffset += this._currentContext.blankWidth;
29754
+ this._hOffset += this.currentBlankAdvance;
29690
29755
  }
29691
29756
  recordVisualLineBreak(e, t) {
29692
29757
  const r = this._processedCharCount + this.countFinalCharBoxes(
@@ -29712,12 +29777,15 @@ var P1 = Fc((L) => {
29712
29777
  this._lineHasRenderableChar || this.applyPendingEmptyLineYAdjust();
29713
29778
  const o = a.toGeometry();
29714
29779
  o.scale(this.currentWidthFactor, 1, 1);
29715
- let h = this._currentContext.oblique;
29716
- if (this._currentContext.italic && (h += 15), h) {
29717
- const x = h * Math.PI / 180, v = new Fe();
29718
- v.set(
29780
+ const h = this.currentLayoutFontSize;
29781
+ let c = this._currentContext.oblique;
29782
+ this._currentContext.italic && (c += 15);
29783
+ let u = 0;
29784
+ if (c) {
29785
+ const w = c * Math.PI / 180, b = new Fe();
29786
+ b.set(
29719
29787
  1,
29720
- Math.tan(x),
29788
+ Math.tan(w),
29721
29789
  0,
29722
29790
  0,
29723
29791
  0,
@@ -29732,77 +29800,79 @@ var P1 = Fc((L) => {
29732
29800
  0,
29733
29801
  0,
29734
29802
  1
29735
- ), o.applyMatrix4(v);
29736
- }
29737
- const c = this.fontManager.getFontType(this.currentFont);
29738
- this._currentContext.bold && c === "mesh" && o.scale(1.06, 1.06, 1), this.hOffset > (this.maxLineWidth || 1 / 0) && (this.recordVisualLineBreak(i, s), this.advanceToNextLine(!1));
29739
- const u = this.hOffset, f = this.flowDirection == Mt.BOTTOM_TO_TOP ? this.vOffset : this.vOffset - this.currentLayoutFontSize, l = a.width * this.currentWidthFactor, p = this.currentLayoutFontSize;
29740
- if (o.translate(u, f, 0), this.currentHorizontalAlignment == fe.DISTRIBUTED ? this._hOffset += a.width * this.currentWidthFactor : this._hOffset += a.width * this.currentWordSpace * this.currentWidthFactor, t.push(o), this._lineHasRenderableChar = !0, this._options.collectCharBoxes !== !1) {
29803
+ ), o.applyMatrix4(b), u = Math.tan(w) * h;
29804
+ }
29805
+ const f = this.fontManager.getFontType(this.currentFont);
29806
+ this._currentContext.bold && f === "mesh" && o.scale(1.06, 1.06, 1), this.hOffset > (this.maxLineWidth || 1 / 0) && (this.recordVisualLineBreak(i, s), this.advanceToNextLine(!1));
29807
+ const l = this.hOffset, p = this.flowDirection == Mt.BOTTOM_TO_TOP ? this.vOffset : this.vOffset - this.currentLayoutFontSize, d = a.width * this.currentWidthFactor;
29808
+ o.translate(l, p, 0);
29809
+ const m = a.width * this.currentWidthFactor + u * this.currentWidthFactor;
29810
+ if (this.currentHorizontalAlignment == ce.DISTRIBUTED ? this._hOffset += m : this._hOffset += a.width * this.currentWordSpace * this.currentWidthFactor + u * this.currentWidthFactor, t.push(o), this._lineHasRenderableChar = !0, this._options.collectCharBoxes !== !1) {
29741
29811
  o.userData.char = e, o.boundingBox || o.computeBoundingBox();
29742
- const x = new Ee().copy(o.boundingBox);
29812
+ const w = new ke().copy(o.boundingBox);
29743
29813
  o instanceof mr ? (this._lastCharBoxTarget = "mesh", i.push({
29744
29814
  type: ye.CHAR,
29745
- box: x,
29815
+ box: w,
29746
29816
  char: e,
29747
29817
  children: []
29748
29818
  })) : (this._lastCharBoxTarget = "line", s.push({
29749
29819
  type: ye.CHAR,
29750
- box: x,
29820
+ box: w,
29751
29821
  char: e,
29752
29822
  children: []
29753
29823
  }));
29754
29824
  }
29755
- const g = p * 0.05, m = 1e-3;
29825
+ const x = h * 0.05, v = 1e-3;
29756
29826
  if (this._currentContext.underline) {
29757
- const x = new ze(), v = f - g;
29758
- x.setAttribute(
29827
+ const w = new ze(), b = p - x;
29828
+ w.setAttribute(
29759
29829
  "position",
29760
29830
  new Ye(
29761
29831
  new Float32Array([
29762
- u,
29763
- v,
29764
- m,
29765
- u + l,
29832
+ l,
29833
+ b,
29766
29834
  v,
29767
- m
29835
+ l + d,
29836
+ b,
29837
+ v
29768
29838
  ]),
29769
29839
  3
29770
29840
  )
29771
- ), x.setIndex(null), x.userData = { isDecoration: !0 }, r.push(x);
29841
+ ), w.setIndex(null), w.userData = { isDecoration: !0 }, r.push(w);
29772
29842
  }
29773
29843
  if (this._currentContext.overline) {
29774
- const x = new ze(), v = f + p + g;
29775
- x.setAttribute(
29844
+ const w = new ze(), b = p + h + x;
29845
+ w.setAttribute(
29776
29846
  "position",
29777
29847
  new Ye(
29778
29848
  new Float32Array([
29779
- u,
29780
- v,
29781
- m,
29782
- u + l,
29849
+ l,
29850
+ b,
29783
29851
  v,
29784
- m
29852
+ l + d,
29853
+ b,
29854
+ v
29785
29855
  ]),
29786
29856
  3
29787
29857
  )
29788
- ), x.setIndex(null), x.userData = { isDecoration: !0 }, r.push(x);
29858
+ ), w.setIndex(null), w.userData = { isDecoration: !0 }, r.push(w);
29789
29859
  }
29790
29860
  if (this._currentContext.strikeThrough) {
29791
- const x = new ze(), v = f + p / 2 - p * 0.2;
29792
- x.setAttribute(
29861
+ const w = new ze(), b = p + h / 2 - h * 0.2;
29862
+ w.setAttribute(
29793
29863
  "position",
29794
29864
  new Ye(
29795
29865
  new Float32Array([
29796
- u,
29797
- v,
29798
- m,
29799
- u + l,
29866
+ l,
29867
+ b,
29800
29868
  v,
29801
- m
29869
+ l + d,
29870
+ b,
29871
+ v
29802
29872
  ]),
29803
29873
  3
29804
29874
  )
29805
- ), x.setIndex(null), x.userData = { isDecoration: !0 }, r.push(x);
29875
+ ), w.setIndex(null), w.userData = { isDecoration: !0 }, r.push(w);
29806
29876
  }
29807
29877
  }
29808
29878
  processLastLine() {
@@ -29890,7 +29960,7 @@ var P1 = Fc((L) => {
29890
29960
  if (e.forEach((a, o) => {
29891
29961
  a.geometry.boundingBox || a.geometry.computeBoundingBox(), o === 0 ? t = a.geometry.boundingBox : t.union(a.geometry.boundingBox);
29892
29962
  }), !t) return;
29893
- const r = t, i = r.getSize(B1), s = (a, o) => {
29963
+ const r = t, i = r.getSize(L1), s = (a, o) => {
29894
29964
  var c, u;
29895
29965
  const h = (u = (c = a.userData) == null ? void 0 : c.layout) == null ? void 0 : u.chars;
29896
29966
  if (h && h.length > 0) {
@@ -29902,28 +29972,29 @@ var P1 = Fc((L) => {
29902
29972
  }
29903
29973
  };
29904
29974
  switch (this.currentHorizontalAlignment) {
29905
- case fe.LEFT: {
29975
+ case ce.LEFT:
29976
+ case ce.JUSTIFIED: {
29906
29977
  const a = this._currentLeftMargin - r.min.x, o = /* @__PURE__ */ new Set();
29907
29978
  e.forEach((h) => {
29908
29979
  h.geometry.translate(a, 0, 0), o.has(h.owner) || (s(h.owner, a), o.add(h.owner));
29909
29980
  });
29910
29981
  break;
29911
29982
  }
29912
- case fe.CENTER: {
29983
+ case ce.CENTER: {
29913
29984
  const a = this._currentLeftMargin + (this.maxLineWidth - i.x) / 2 - r.min.x, o = /* @__PURE__ */ new Set();
29914
29985
  e.forEach((h) => {
29915
29986
  h.geometry.translate(a, 0, 0), o.has(h.owner) || (s(h.owner, a), o.add(h.owner));
29916
29987
  });
29917
29988
  break;
29918
29989
  }
29919
- case fe.RIGHT: {
29990
+ case ce.RIGHT: {
29920
29991
  const a = this._currentLeftMargin + this.maxLineWidth - i.x - r.min.x, o = /* @__PURE__ */ new Set();
29921
29992
  e.forEach((h) => {
29922
29993
  h.geometry.translate(a, 0, 0), o.has(h.owner) || (s(h.owner, a), o.add(h.owner));
29923
29994
  });
29924
29995
  break;
29925
29996
  }
29926
- case fe.DISTRIBUTED: {
29997
+ case ce.DISTRIBUTED: {
29927
29998
  const a = e.length > 1 ? (this.maxLineWidth - i.x) / (e.length - 1) : 0, o = /* @__PURE__ */ new Set();
29928
29999
  e.forEach((h, c) => {
29929
30000
  const u = a * c + (this._currentLeftMargin - r.min.x);
@@ -29934,17 +30005,15 @@ var P1 = Fc((L) => {
29934
30005
  }
29935
30006
  }
29936
30007
  /**
29937
- * In AutoCAD, the width of a regular space character (ASCII 32, the space key on the keyboard) in MText
29938
- * depends on the current font and text height, and is not a fixed value.
29939
- * Specifically:
29940
- * - Space width Text height × space width ratio defined by the font
29941
- * - For common TrueType fonts (like Arial), the space width is typically about 1/4 to 1/3 of the text height.
29942
- * For example, if the text height is 10 (units), the space width would be approximately 2.5 to 3.3 units.
29943
- * - For SHX fonts (AutoCAD's built-in vector fonts, such as txt.shx), the space width is often half the text height.
29944
- * So if the text height is 10, the space width is typically 5 units.
30008
+ * Resolves horizontal advance for an ASCII space in the active font.
30009
+ *
30010
+ * AutoCAD uses each font's own space glyph metrics (SHX pen advance or TrueType
30011
+ * horizontal advance). A fixed fraction of text height (e.g. 50% for SHX) is only
30012
+ * a rough fallback when the font has no space definition.
29945
30013
  */
29946
30014
  calculateBlankWidthForFont(e, t) {
29947
- return this.fontManager.getFontType(e) === "shx" ? t * 0.5 : t * 0.3;
30015
+ const r = this.fontManager.getCharShape(" ", e, t);
30016
+ return r && r.width > 0 ? r.width : this.fontManager.getFontType(e) === "shx" ? t * 0.5 : t * 0.3;
29948
30017
  }
29949
30018
  /**
29950
30019
  * Convert the text shape geometries to three.js object
@@ -29958,16 +30027,16 @@ var P1 = Fc((L) => {
29958
30027
  o
29959
30028
  ), u = this._options.collectCharBoxes !== !1, f = e.filter((p) => p instanceof mr);
29960
30029
  if (f.length > 0) {
29961
- const p = f.length > 1 ? Oo(f) : f[0], g = new Hr(p, h);
29962
- g.userData.bboxIntersectionCheck = !0, g.userData.charBoxType = s, u && r.length > 0 && (g.userData.layout = { chars: r.slice() }), a.add(g);
30030
+ const p = f.length > 1 ? Oo(f) : f[0], d = new Hr(p, h);
30031
+ d.userData.bboxIntersectionCheck = !0, d.userData.charBoxType = s, u && r.length > 0 && (d.userData.layout = { chars: r.slice() }), a.add(d);
29963
30032
  }
29964
30033
  const l = [
29965
30034
  ...t,
29966
30035
  ...e.filter((p) => !(p instanceof mr))
29967
30036
  ];
29968
30037
  if (l.length > 0) {
29969
- const p = l.length > 1 ? Oo(l) : l[0], g = new au(p, c);
29970
- g.userData.bboxIntersectionCheck = !0, g.userData.charBoxType = s, u && i.length > 0 && (g.userData.layout = { chars: i.slice() }), a.add(g);
30038
+ const p = l.length > 1 ? Oo(l) : l[0], d = new au(p, c);
30039
+ d.userData.bboxIntersectionCheck = !0, d.userData.charBoxType = s, u && i.length > 0 && (d.userData.layout = { chars: i.slice() }), a.add(d);
29971
30040
  }
29972
30041
  return a.children.length === 1 ? a.children[0] : a;
29973
30042
  }
@@ -30023,7 +30092,7 @@ var P1 = Fc((L) => {
30023
30092
  byBlockColor: s.byBlockColor,
30024
30093
  layer: s.layer,
30025
30094
  color: s.color.copy()
30026
- }, this._box = new Ee(), this._layoutData = void 0, this._mtextData = e, this._fontsInStyleLoaded = !1;
30095
+ }, this._box = new ke(), this._layoutData = void 0, this._mtextData = e, this._fontsInStyleLoaded = !1;
30027
30096
  }
30028
30097
  /**
30029
30098
  * Gets the font manager instance associated with this MText object.
@@ -30075,9 +30144,10 @@ var P1 = Fc((L) => {
30075
30144
  minY: 1 / 0,
30076
30145
  maxY: -1 / 0,
30077
30146
  minZ: 1 / 0,
30078
- maxZ: -1 / 0
30147
+ maxZ: -1 / 0,
30148
+ hasLogicalBounds: !1
30079
30149
  };
30080
- this.updateBoxFromObject(e, t), t.hasLine && (this.box.isEmpty() ? (this.box.min.set(t.minX, t.minY, t.minZ), this.box.max.set(t.maxX, t.maxY, t.maxZ)) : (this.box.min.y = Math.min(this.box.min.y, t.minY), this.box.max.y = Math.max(this.box.max.y, t.maxY))), this.add(e);
30150
+ this.updateBoxFromObject(e, t), t.hasLine && !t.hasLogicalBounds && (this.box.isEmpty() ? (this.box.min.set(t.minX, t.minY, t.minZ), this.box.max.set(t.maxX, t.maxY, t.maxZ)) : (this.box.min.y = Math.min(this.box.min.y, t.minY), this.box.max.y = Math.max(this.box.max.y, t.maxY))), this.add(e);
30081
30151
  }
30082
30152
  }
30083
30153
  /**
@@ -30147,45 +30217,52 @@ var P1 = Fc((L) => {
30147
30217
  if (!r)
30148
30218
  return;
30149
30219
  r.matrix.decompose(qt, us, cs), e.position && (qt.x += e.position.x, qt.y += e.position.y, r.matrix.compose(qt, us, cs));
30150
- let s = e.width, a = i;
30220
+ let s = e.width;
30151
30221
  r.updateWorldMatrix(!0, !0);
30152
- const o = new Ee().setFromObject(r);
30153
- if (!o.isEmpty()) {
30154
- const p = o.max.y - o.min.y;
30155
- Number.isFinite(p) && p > 0 && (a = p);
30156
- }
30222
+ const a = new ke().setFromObject(r);
30157
30223
  if (!Number.isFinite(s)) {
30158
- const p = o.max.x - o.min.x;
30224
+ const p = a.max.x - a.min.x;
30159
30225
  s = Number.isFinite(p) && p > 0 ? p : 0;
30160
30226
  }
30161
- const h = this.calculateAnchorPoint(
30227
+ const o = this.measureAnchorMetrics(
30228
+ r,
30162
30229
  s,
30230
+ i,
30163
30231
  a,
30164
- e.attachmentPoint,
30165
30232
  e.drawingDirection
30166
- ), c = (p) => {
30233
+ ), h = this.calculateAnchorPoint(
30234
+ o,
30235
+ e.attachmentPoint
30236
+ );
30237
+ r.userData.logicalBounds = {
30238
+ minX: o.minX + h.x,
30239
+ maxX: o.maxX + h.x,
30240
+ minY: o.minY + h.y,
30241
+ maxY: o.maxY + h.y
30242
+ };
30243
+ const c = (p) => {
30167
30244
  if (!p || p.length === 0) return;
30168
- const g = new E(h.x, h.y, 0), m = (x) => {
30245
+ const d = new E(h.x, h.y, 0), m = (x) => {
30169
30246
  var v;
30170
- (v = x.box) == null || v.translate(g), x.children && x.children.length > 0 && x.children.forEach(m);
30247
+ (v = x.box) == null || v.translate(d), x.children && x.children.length > 0 && x.children.forEach(m);
30171
30248
  };
30172
30249
  p.forEach(m);
30173
30250
  }, u = (p) => {
30174
- !p || p.length === 0 || p.forEach((g) => {
30175
- g.y += h.y;
30251
+ !p || p.length === 0 || p.forEach((d) => {
30252
+ d.y += h.y;
30176
30253
  });
30177
30254
  };
30178
30255
  r.traverse((p) => {
30179
- var g, m, x;
30180
- "geometry" in p ? p.geometry.translate(h.x, h.y, 0) : c(
30181
- (m = (g = p.userData) == null ? void 0 : g.layout) == null ? void 0 : m.chars
30256
+ var d, m, x;
30257
+ "geometry" in p && p.geometry.translate(h.x, h.y, 0), c(
30258
+ (m = (d = p.userData) == null ? void 0 : d.layout) == null ? void 0 : m.chars
30182
30259
  ), u(
30183
30260
  (x = p.userData) == null ? void 0 : x.lineLayouts
30184
30261
  ), p.layers.enableAll();
30185
30262
  });
30186
30263
  let f = e.rotation || 0;
30187
30264
  if (e.directionVector) {
30188
- const p = e.directionVector, g = new E(p.x, p.y, p.z), m = g.clone().cross(th), x = th.angleTo(g);
30265
+ const p = e.directionVector, d = new E(p.x, p.y, p.z), m = d.clone().cross(th), x = th.angleTo(d);
30189
30266
  f = m.z > 0 ? -x : x;
30190
30267
  }
30191
30268
  r.matrix.compose(qt, us, cs);
@@ -30204,23 +30281,23 @@ var P1 = Fc((L) => {
30204
30281
  this.styleManager.unsupportedTextStyles[v] || (this.styleManager.unsupportedTextStyles[v] = 0), this.styleManager.unsupportedTextStyles[v]++;
30205
30282
  }
30206
30283
  const r = e.width || 0, i = Number.isFinite(r) && r > 0;
30207
- let s = fe.LEFT;
30284
+ let s = ce.LEFT;
30208
30285
  i && e.attachmentPoint && ([
30209
30286
  j.TopLeft,
30210
30287
  j.MiddleLeft,
30211
30288
  j.BottomLeft,
30212
30289
  j.BaselineLeft
30213
- ].includes(e.attachmentPoint) ? s = fe.LEFT : [
30290
+ ].includes(e.attachmentPoint) ? s = ce.LEFT : [
30214
30291
  j.TopCenter,
30215
30292
  j.MiddleCenter,
30216
30293
  j.BottomCenter,
30217
30294
  j.BaselineCenter
30218
- ].includes(e.attachmentPoint) ? s = fe.CENTER : [
30295
+ ].includes(e.attachmentPoint) ? s = ce.CENTER : [
30219
30296
  j.TopRight,
30220
30297
  j.MiddleRight,
30221
30298
  j.BottomRight,
30222
30299
  j.BaselineRight
30223
- ].includes(e.attachmentPoint) && (s = fe.RIGHT));
30300
+ ].includes(e.attachmentPoint) && (s = ce.RIGHT));
30224
30301
  let a = _t.BOTTOM;
30225
30302
  e.attachmentPoint && ([
30226
30303
  j.TopLeft,
@@ -30266,54 +30343,128 @@ var P1 = Fc((L) => {
30266
30343
  };
30267
30344
  }
30268
30345
  /**
30269
- * Calculates the anchor point for text positioning based on alignment and flow direction.
30270
- * @param width - The width of the text
30271
- * @param height - The height of the text
30272
- * @param attachmentPoint - The attachment point for text alignment
30273
- * @param flowDirection - The text flow direction
30274
- * @returns The calculated anchor point coordinates
30275
- */
30276
- calculateAnchorPoint(e, t, r, i) {
30346
+ * Measures the logical text frame used by attachment-point anchoring.
30347
+ *
30348
+ * @remarks
30349
+ * Line-layout boxes include inter-line leading that is useful for hit testing, but
30350
+ * that leading must not become extra padding above the first rendered line when
30351
+ * aligning to top/middle/bottom attachment points. This method therefore prefers the
30352
+ * visible geometry height from `geometryBox` when it is non-empty, and only falls
30353
+ * back to `layoutHeight` when there are no measurable glyphs (e.g. empty or
30354
+ * whitespace-only runs).
30355
+ *
30356
+ * @param object - Root group produced by layout; traversed for {@link LineLayout}
30357
+ * metadata to locate the first line baseline.
30358
+ * @param width - Column width used for horizontal anchoring when finite and
30359
+ * positive; if not, horizontal extents are taken from `geometryBox`.
30360
+ * @param layoutHeight - Total laid-out height from {@link MTextProcessor} when
30361
+ * geometry height is unavailable or zero.
30362
+ * @param geometryBox - Axis-aligned bounds of rendered primitives under `object`,
30363
+ * typically from {@link THREE.Box3.setFromObject}.
30364
+ * @param flowDirection - Optional flow; when {@link MTextFlowDirection.BOTTOM_TO_TOP},
30365
+ * the vertical frame is anchored from the geometry minimum upward.
30366
+ * @returns Metrics consumed by {@link MText.calculateAnchorPoint}.
30367
+ */
30368
+ measureAnchorMetrics(e, t, r, i, s) {
30369
+ const a = {
30370
+ hasLine: !1,
30371
+ minY: 1 / 0,
30372
+ maxY: -1 / 0,
30373
+ baselineY: 0
30374
+ };
30375
+ let o = !1;
30376
+ e.traverse((m) => {
30377
+ var v;
30378
+ const x = (v = m.userData) == null ? void 0 : v.lineLayouts;
30379
+ !x || x.length === 0 || x.forEach((w) => {
30380
+ const b = w.y - w.height / 2, S = w.y + w.height / 2;
30381
+ a.hasLine = !0, a.minY = Math.min(a.minY, b), a.maxY = Math.max(a.maxY, S), o || (a.baselineY = b, o = !0);
30382
+ });
30383
+ });
30384
+ const h = i.isEmpty() ? 0 : i.max.y - i.min.y, c = Number.isFinite(h) && h > 0 ? h : Number.isFinite(r) && r > 0 ? r : 0;
30385
+ let u = 0, f = Number.isFinite(t) && t > 0 ? t : 0;
30386
+ f <= u && !i.isEmpty() && (u = i.min.x, f = i.max.x);
30387
+ let l = 0, p = 0;
30388
+ s == Mt.BOTTOM_TO_TOP ? (l = i.isEmpty() ? 0 : i.min.y, p = l + c) : (p = i.isEmpty() ? 0 : i.max.y, l = p - c);
30389
+ const d = a.hasLine ? a.baselineY : l;
30390
+ return { minX: u, maxX: f, minY: l, maxY: p, baselineY: d };
30391
+ }
30392
+ /**
30393
+ * Computes the 2D translation that maps the logical frame described by `metrics`
30394
+ * so that the chosen AutoCAD-style attachment point coincides with the insertion
30395
+ * origin (before rotation/insertion-point transforms applied later in
30396
+ * {@link MText.loadMText}).
30397
+ *
30398
+ * @remarks
30399
+ * The returned vector is **added** to vertex positions and char-box metadata via
30400
+ * `geometry.translate` / `CharBox.box.translate` / line `y` offsets. For `undefined`
30401
+ * attachment, behavior matches {@link MTextAttachmentPoint.TopLeft}.
30402
+ *
30403
+ * @param metrics - Pre-anchoring frame from {@link MText.measureAnchorMetrics}.
30404
+ * @param attachmentPoint - DWG attachment constant; determines which corner, edge
30405
+ * center, or baseline of the frame is pinned to `(0,0)` in anchored space.
30406
+ * @returns Translation `(x, y)` in drawing units applied uniformly to the laid-out
30407
+ * group and its layout sidecars.
30408
+ */
30409
+ calculateAnchorPoint(e, t) {
30410
+ const r = (e.minX + e.maxX) / 2, i = (e.minY + e.maxY) / 2;
30277
30411
  let s = 0, a = 0;
30278
- switch (r) {
30412
+ switch (t) {
30279
30413
  case void 0:
30280
30414
  case j.TopLeft:
30281
- s = 0, a = 0;
30415
+ s = -e.minX, a = -e.maxY;
30282
30416
  break;
30283
30417
  case j.TopCenter:
30284
- s -= e / 2, a = 0;
30418
+ s = -r, a = -e.maxY;
30285
30419
  break;
30286
30420
  case j.TopRight:
30287
- s -= e, a = 0;
30421
+ s = -e.maxX, a = -e.maxY;
30288
30422
  break;
30289
30423
  case j.MiddleLeft:
30290
- s = 0, a += t / 2;
30424
+ s = -e.minX, a = -i;
30291
30425
  break;
30292
30426
  case j.MiddleCenter:
30293
- s -= e / 2, a += t / 2;
30427
+ s = -r, a = -i;
30294
30428
  break;
30295
30429
  case j.MiddleRight:
30296
- s -= e, a += t / 2;
30430
+ s = -e.maxX, a = -i;
30297
30431
  break;
30298
30432
  case j.BottomLeft:
30299
- case j.BaselineLeft:
30300
- s = 0, a += t;
30433
+ s = -e.minX, a = -e.minY;
30301
30434
  break;
30302
30435
  case j.BottomCenter:
30303
- case j.BaselineCenter:
30304
- s -= e / 2, a += t;
30436
+ s = -r, a = -e.minY;
30305
30437
  break;
30306
30438
  case j.BottomRight:
30439
+ s = -e.maxX, a = -e.minY;
30440
+ break;
30441
+ case j.BaselineLeft:
30442
+ s = -e.minX, a = -e.baselineY;
30443
+ break;
30444
+ case j.BaselineCenter:
30445
+ s = -r, a = -e.baselineY;
30446
+ break;
30307
30447
  case j.BaselineRight:
30308
- s -= e, a += t;
30448
+ s = -e.maxX, a = -e.baselineY;
30309
30449
  break;
30310
30450
  }
30311
- return i == Mt.BOTTOM_TO_TOP && (a -= t), { x: s, y: a };
30451
+ return { x: s, y: a };
30312
30452
  }
30313
30453
  /**
30314
- * Recursively calculates bounding boxes for an object and its children.
30315
- * @param object - The Three.js object to process
30316
- * @param boxes - Array to store the calculated bounding boxes
30454
+ * Walks a laid-out MText subgraph and accumulates world-space character hit boxes and
30455
+ * soft line rectangles for {@link MText.createLayoutData} (raycasting, cursors, debug).
30456
+ *
30457
+ * @remarks
30458
+ * - When `userData.layout.chars` is present, entries are transformed with
30459
+ * {@link buildCharBoxesFromObject} and appended to `chars`, then recursion stops
30460
+ * for that branch (char metadata is authoritative).
30461
+ * - When only mesh/line geometry exists, a single synthetic {@link CharBox} wrapping
30462
+ * the geometry AABB may be emitted.
30463
+ * - `userData.lineLayouts` rows are converted to world-space center `y` and height.
30464
+ *
30465
+ * @param object - Node to traverse (typically the root group from {@link MText.loadMText}).
30466
+ * @param chars - Output collection; receives merged {@link CharBox} entries in world space.
30467
+ * @param lines - Output collection; receives {@link LineLayout} summaries per line break.
30317
30468
  */
30318
30469
  getLayout(e, t, r) {
30319
30470
  var o, h, c, u, f;
@@ -30338,7 +30489,7 @@ var P1 = Fc((L) => {
30338
30489
  const l = e.geometry;
30339
30490
  if (!((f = l.userData) != null && f.isDecoration)) {
30340
30491
  l.boundingBox === null && l.computeBoundingBox();
30341
- const p = new Ee().copy(l.boundingBox);
30492
+ const p = new ke().copy(l.boundingBox);
30342
30493
  p.applyMatrix4(e.matrixWorld), t.push({
30343
30494
  type: ye.CHAR,
30344
30495
  box: p,
@@ -30351,36 +30502,67 @@ var P1 = Fc((L) => {
30351
30502
  for (let l = 0, p = a.length; l < p; l++)
30352
30503
  this.getLayout(a[l], t, r);
30353
30504
  }
30505
+ /**
30506
+ * Depth-first union of this MText’s {@link MText.box} from layout metadata and mesh
30507
+ * geometry, while optionally tracking coarse line AABB in `lineBounds`.
30508
+ *
30509
+ * @remarks
30510
+ * Priority order per node:
30511
+ * 1. If `userData.logicalBounds` exists (set in {@link MText.loadMText}), union that
30512
+ * axis-aligned rectangle transformed by `matrixWorld` — this reflects anchored
30513
+ * logical extents even when individual glyphs are expensive to union.
30514
+ * 2. Else if `userData.lineLayouts` exists, expand `lineBounds` from the world-space
30515
+ * top/bottom of each line strip (used as a fallback when no logical bounds were
30516
+ * written, e.g. legacy paths).
30517
+ * 3. Else if `userData.layout.chars` exists, union each transformed char AABB.
30518
+ * 4. Else for mesh/line primitives, union non-decoration geometry bounds.
30519
+ * 5. Always recurse into children.
30520
+ *
30521
+ * @param object - Current scene graph node.
30522
+ * @param lineBounds - Mutable accumulator: `hasLine`/`min*`/`max*` track the union of
30523
+ * line-layout strips in world space; `hasLogicalBounds` flips true when any child
30524
+ * contributed `logicalBounds` so {@link MText.syncDraw} can avoid double-counting
30525
+ * vertical extent from line strips alone.
30526
+ */
30354
30527
  updateBoxFromObject(e, t) {
30355
- var a, o, h, c, u;
30528
+ var o, h, c, u, f, l;
30356
30529
  e.updateWorldMatrix(!1, !1);
30357
- const r = (a = e.userData) == null ? void 0 : a.lineLayouts;
30358
- r && r.length > 0 && r.forEach((f) => {
30359
- pt.set(0, f.y - f.height / 2, 0).applyMatrix4(e.matrixWorld), dt.set(0, f.y + f.height / 2, 0).applyMatrix4(e.matrixWorld), t.hasLine = !0, t.minX = Math.min(t.minX, pt.x, dt.x), t.maxX = Math.max(t.maxX, pt.x, dt.x), t.minY = Math.min(t.minY, pt.y, dt.y), t.maxY = Math.max(t.maxY, pt.y, dt.y), t.minZ = Math.min(t.minZ, pt.z, dt.z), t.maxZ = Math.max(t.maxZ, pt.z, dt.z);
30530
+ const r = (o = e.userData) == null ? void 0 : o.logicalBounds;
30531
+ if (r) {
30532
+ t.hasLogicalBounds = !0;
30533
+ const p = new ke(
30534
+ new E(r.minX, r.minY, 0),
30535
+ new E(r.maxX, r.maxY, 0)
30536
+ );
30537
+ p.applyMatrix4(e.matrixWorld), this.box.union(p);
30538
+ }
30539
+ const i = (h = e.userData) == null ? void 0 : h.lineLayouts;
30540
+ i && i.length > 0 && i.forEach((p) => {
30541
+ pt.set(0, p.y - p.height / 2, 0).applyMatrix4(e.matrixWorld), dt.set(0, p.y + p.height / 2, 0).applyMatrix4(e.matrixWorld), t.hasLine = !0, t.minX = Math.min(t.minX, pt.x, dt.x), t.maxX = Math.max(t.maxX, pt.x, dt.x), t.minY = Math.min(t.minY, pt.y, dt.y), t.maxY = Math.max(t.maxY, pt.y, dt.y), t.minZ = Math.min(t.minZ, pt.z, dt.z), t.maxZ = Math.max(t.maxZ, pt.z, dt.z);
30360
30542
  });
30361
- const i = (h = (o = e.userData) == null ? void 0 : o.layout) == null ? void 0 : h.chars;
30362
- if (i && i.length > 0) {
30363
- const f = (c = e.userData) == null ? void 0 : c.charBoxType;
30543
+ const s = (u = (c = e.userData) == null ? void 0 : c.layout) == null ? void 0 : u.chars;
30544
+ if (s && s.length > 0) {
30545
+ const p = (f = e.userData) == null ? void 0 : f.charBoxType;
30364
30546
  Ko(
30365
- i,
30547
+ s,
30366
30548
  e.matrixWorld,
30367
- f
30368
- ).forEach((p) => {
30369
- p.box && this.box.union(p.box);
30549
+ p
30550
+ ).forEach((m) => {
30551
+ m.box && this.box.union(m.box);
30370
30552
  });
30371
30553
  return;
30372
30554
  }
30373
30555
  if (e instanceof jn || e instanceof Hr) {
30374
- const f = e.geometry;
30375
- if (!((u = f.userData) != null && u.isDecoration)) {
30376
- f.boundingBox === null && f.computeBoundingBox();
30377
- const l = new Ee().copy(f.boundingBox);
30378
- l.applyMatrix4(e.matrixWorld), this.box.union(l);
30556
+ const p = e.geometry;
30557
+ if (!((l = p.userData) != null && l.isDecoration)) {
30558
+ p.boundingBox === null && p.computeBoundingBox();
30559
+ const d = new ke().copy(p.boundingBox);
30560
+ d.applyMatrix4(e.matrixWorld), this.box.union(d);
30379
30561
  }
30380
30562
  }
30381
- const s = e.children;
30382
- for (let f = 0, l = s.length; f < l; f++)
30383
- this.updateBoxFromObject(s[f], t);
30563
+ const a = e.children;
30564
+ for (let p = 0, d = a.length; p < d; p++)
30565
+ this.updateBoxFromObject(a[p], t);
30384
30566
  }
30385
30567
  /**
30386
30568
  * Remove the specified object from its parent and release geometry and material resource used
@@ -30406,6 +30588,13 @@ var P1 = Fc((L) => {
30406
30588
  }
30407
30589
  });
30408
30590
  }
30591
+ /**
30592
+ * Normalizes a font file reference to the lowercase stem used by
30593
+ * {@link FontManager.loadFontsByNames} (strip extension).
30594
+ *
30595
+ * @param fontFileName - Style font path such as `arial.ttf` or extension-less name.
30596
+ * @returns Lowercase name without the last extension segment, or `undefined` if empty.
30597
+ */
30409
30598
  getFontName(e) {
30410
30599
  if (e) {
30411
30600
  const t = e.lastIndexOf(".");
@@ -30556,14 +30745,14 @@ var P1 = Fc((L) => {
30556
30745
  if (h instanceof ze) {
30557
30746
  const u = r.matrixWorld.clone(), f = new E(), l = new zt(), p = new E();
30558
30747
  u.decompose(f, l, p);
30559
- const g = {};
30748
+ const d = {};
30560
30749
  h.attributes && Object.keys(h.attributes).forEach((w) => {
30561
30750
  const b = h.attributes[w], B = new Uint8Array(
30562
30751
  b.array.buffer,
30563
30752
  b.array.byteOffset,
30564
30753
  b.array.byteLength
30565
30754
  ).slice().buffer;
30566
- t.push(B), g[w] = {
30755
+ t.push(B), d[w] = {
30567
30756
  arrayBuffer: B,
30568
30757
  byteOffset: 0,
30569
30758
  // Since we copied, offset is 0
@@ -30612,7 +30801,7 @@ var P1 = Fc((L) => {
30612
30801
  z: p.z
30613
30802
  },
30614
30803
  geometry: {
30615
- attributes: g,
30804
+ attributes: d,
30616
30805
  index: m
30617
30806
  },
30618
30807
  material: x,