@threepipe/plugin-svg-renderer 0.2.2 → 0.2.4

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 (41) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +12 -0
  3. package/dist/dependencies.txt +13 -13
  4. package/dist/index.js +614 -665
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.mjs +630 -681
  7. package/dist/index.mjs.map +1 -1
  8. package/dist/three-svg-renderer/core/SVGMesh.d.ts +1 -1
  9. package/dist/three-svg-renderer/core/SVGMesh.d.ts.map +1 -1
  10. package/docs/.nojekyll +1 -0
  11. package/docs/assets/hierarchy.js +1 -0
  12. package/docs/assets/highlight.css +22 -0
  13. package/docs/assets/icons.js +18 -0
  14. package/docs/assets/icons.svg +1 -0
  15. package/docs/assets/main.js +60 -0
  16. package/docs/assets/navigation.js +1 -0
  17. package/docs/assets/search.js +1 -0
  18. package/docs/assets/style.css +1633 -0
  19. package/docs/classes/BasicSVGRenderer.html +7 -0
  20. package/docs/classes/BasicSVGRendererPlugin.html +36 -0
  21. package/docs/classes/DrawPass.html +11 -0
  22. package/docs/classes/FillPass.html +15 -0
  23. package/docs/classes/SVGDrawHandler.html +5 -0
  24. package/docs/classes/SVGDrawInfo.html +4 -0
  25. package/docs/classes/SVGMesh.html +29 -0
  26. package/docs/classes/SVGRenderInfo.html +6 -0
  27. package/docs/classes/SVGRenderer.html +17 -0
  28. package/docs/classes/ThreeSVGRendererPlugin.html +67 -0
  29. package/docs/classes/Viewmap.html +15 -0
  30. package/docs/classes/ViewmapBuildInfo.html +8 -0
  31. package/docs/hierarchy.html +1 -0
  32. package/docs/index.html +1 -0
  33. package/docs/interfaces/FillPassOptions.html +14 -0
  34. package/docs/interfaces/SVGDrawOptions.html +2 -0
  35. package/docs/interfaces/SVGMeshOptions.html +2 -0
  36. package/docs/interfaces/SVGTexture.html +7 -0
  37. package/docs/interfaces/ViewmapOptions.html +5 -0
  38. package/package.json +9 -5
  39. package/src/three-svg-renderer/core/SVGMesh.ts +1 -1
  40. package/src/three-svg-renderer/core/viewmap/operations/assignPolygons.ts +3 -3
  41. package/src/three-svg-renderer/core/viewmap/operations/computeChainsVisibility.ts +7 -7
package/dist/index.mjs CHANGED
@@ -1,11 +1,11 @@
1
1
  /**
2
2
  * @license
3
- * @threepipe/plugin-svg-renderer v0.2.2
3
+ * @threepipe/plugin-svg-renderer v0.2.4
4
4
  * Copyright 2022-2025 repalash <palash@shaders.app>
5
5
  * GPLV3 License
6
6
  * See ./dependencies.txt for any bundled third-party dependencies and licenses.
7
7
  */
8
- import { Vector3, Color as Color$1, Vector2, Vector4, Box3, Matrix4, Frustum, Matrix3, DoubleSide, Box2, Camera, uiToggle as uiToggle$1, uiConfig as uiConfig$1, uiButton, uiFolderContainer as uiFolderContainer$1, AViewerPluginSync, computeMorphedAttributes, Triangle, BufferAttribute, Plane, Line3 as Line3$1, Sphere, BackSide, FrontSide, Mesh, Ray, onChange, uiVector, timeout } from "threepipe";
8
+ import { Vector3, Vector4, Box3, Matrix4, Frustum, Vector2, Color as Color$1, Matrix3, DoubleSide, Box2, SRGBColorSpace, Camera, uiToggle, uiConfig, uiButton, uiFolderContainer, AViewerPluginSync, computeMorphedAttributes, Triangle, BufferAttribute, Plane, Line3 as Line3$1, Sphere, BackSide, FrontSide, Ray, Mesh, onChange, uiVector, timeout } from "threepipe";
9
9
  import { Vector3 as Vector3$1, Matrix4 as Matrix4$1, Vector2 as Vector2$1, Color as Color$2, Raycaster, DoubleSide as DoubleSide$1, Line3, PerspectiveCamera, Box2 as Box2$1, Triangle as Triangle$1, Mesh as Mesh$1 } from "threepipe";
10
10
  class RenderableObject {
11
11
  constructor() {
@@ -104,8 +104,8 @@ class Projector {
104
104
  function pushNormal(x2, y2, z) {
105
105
  normals.push(x2, y2, z);
106
106
  }
107
- function pushColor(r, g, b) {
108
- colors.push(r, g, b);
107
+ function pushColor(r, g, b2) {
108
+ colors.push(r, g, b2);
109
109
  }
110
110
  function pushUv(x2, y2) {
111
111
  uvs.push(x2, y2);
@@ -120,9 +120,9 @@ class Projector {
120
120
  function checkBackfaceCulling(v1, v2, v3) {
121
121
  return (v3.positionScreen.x - v1.positionScreen.x) * (v2.positionScreen.y - v1.positionScreen.y) - (v3.positionScreen.y - v1.positionScreen.y) * (v2.positionScreen.x - v1.positionScreen.x) < 0;
122
122
  }
123
- function pushLine(a, b) {
123
+ function pushLine(a, b2) {
124
124
  const v1 = _vertexPool[a];
125
- const v2 = _vertexPool[b];
125
+ const v2 = _vertexPool[b2];
126
126
  v1.positionScreen.copy(v1.position).applyMatrix4(_modelViewProjectionMatrix);
127
127
  v2.positionScreen.copy(v2.position).applyMatrix4(_modelViewProjectionMatrix);
128
128
  if (clipLine(v1.positionScreen, v2.positionScreen) === true) {
@@ -137,15 +137,15 @@ class Projector {
137
137
  _line2.material = object.material;
138
138
  if (object.material.vertexColors) {
139
139
  _line2.vertexColors[0].fromArray(colors, a * 3);
140
- _line2.vertexColors[1].fromArray(colors, b * 3);
140
+ _line2.vertexColors[1].fromArray(colors, b2 * 3);
141
141
  }
142
142
  _renderData.elements.push(_line2);
143
143
  }
144
144
  }
145
- function pushTriangle(a, b, c, material) {
145
+ function pushTriangle(a, b2, c2, material) {
146
146
  const v1 = _vertexPool[a];
147
- const v2 = _vertexPool[b];
148
- const v3 = _vertexPool[c];
147
+ const v2 = _vertexPool[b2];
148
+ const v3 = _vertexPool[c2];
149
149
  if (checkTriangleVisibility(v1, v2, v3) === false) return;
150
150
  if (material.side === DoubleSide || checkBackfaceCulling(v1, v2, v3) === true) {
151
151
  _face = getNextFaceInPool();
@@ -440,13 +440,13 @@ class Projector {
440
440
  }
441
441
  return _spritePool[_spriteCount++];
442
442
  }
443
- function painterSort(a, b) {
444
- if (a.renderOrder !== b.renderOrder) {
445
- return a.renderOrder - b.renderOrder;
446
- } else if (a.z !== b.z) {
447
- return b.z - a.z;
448
- } else if (a.id !== b.id) {
449
- return a.id - b.id;
443
+ function painterSort(a, b2) {
444
+ if (a.renderOrder !== b2.renderOrder) {
445
+ return a.renderOrder - b2.renderOrder;
446
+ } else if (a.z !== b2.z) {
447
+ return b2.z - a.z;
448
+ } else if (a.id !== b2.id) {
449
+ return a.id - b2.id;
450
450
  } else {
451
451
  return 0;
452
452
  }
@@ -489,6 +489,7 @@ let SVGRenderer$1 = class SVGRenderer {
489
489
  this.sortObjects = true;
490
490
  this.sortElements = true;
491
491
  this.overdraw = 0.5;
492
+ this.outputColorSpace = SRGBColorSpace;
492
493
  this.info = {
493
494
  render: {
494
495
  vertices: 0,
@@ -536,12 +537,12 @@ let SVGRenderer$1 = class SVGRenderer {
536
537
  _svg.removeChild(_svg.childNodes[0]);
537
538
  }
538
539
  }
539
- function convert(c) {
540
- return _precision !== null ? c.toFixed(_precision) : c;
540
+ function convert(c2) {
541
+ return _precision !== null ? c2.toFixed(_precision) : c2;
541
542
  }
542
543
  this.clear = function() {
543
544
  removeChildNodes();
544
- _svg.style.backgroundColor = _clearColor.getStyle();
545
+ _svg.style.backgroundColor = _clearColor.getStyle(_this.outputColorSpace);
545
546
  };
546
547
  this.render = function(scene, camera) {
547
548
  if (camera instanceof Camera === false) {
@@ -551,7 +552,7 @@ let SVGRenderer$1 = class SVGRenderer {
551
552
  const background = scene.background;
552
553
  if (background && background.isColor) {
553
554
  removeChildNodes();
554
- _svg.style.backgroundColor = background.getStyle();
555
+ _svg.style.backgroundColor = background.getStyle(_this.outputColorSpace);
555
556
  } else if (this.autoClear === true) {
556
557
  this.clear();
557
558
  }
@@ -686,14 +687,14 @@ let SVGRenderer$1 = class SVGRenderer {
686
687
  const path = "M" + convert(v1.x - scaleX * 0.5) + "," + convert(v1.y - scaleY * 0.5) + "h" + convert(scaleX) + "v" + convert(scaleY) + "h" + convert(-scaleX) + "z";
687
688
  let style = "";
688
689
  if (material.isSpriteMaterial || material.isPointsMaterial) {
689
- style = "fill:" + material.color.getStyle() + ";fill-opacity:" + material.opacity;
690
+ style = "fill:" + material.color.getStyle(_this.outputColorSpace) + ";fill-opacity:" + material.opacity;
690
691
  }
691
692
  addPath(style, path);
692
693
  }
693
694
  function renderLine(v1, v2, material) {
694
695
  const path = "M" + convert(v1.positionScreen.x) + "," + convert(v1.positionScreen.y) + "L" + convert(v2.positionScreen.x) + "," + convert(v2.positionScreen.y);
695
696
  if (material.isLineBasicMaterial) {
696
- let style = "fill:none;stroke:" + material.color.getStyle() + ";stroke-opacity:" + material.opacity + ";stroke-width:" + material.linewidth + ";stroke-linecap:" + material.linecap;
697
+ let style = "fill:none;stroke:" + material.color.getStyle(_this.outputColorSpace) + ";stroke-opacity:" + material.opacity + ";stroke-width:" + material.linewidth + ";stroke-linecap:" + material.linecap;
697
698
  if (material.isLineDashedMaterial) {
698
699
  style = style + ";stroke-dasharray:" + material.dashSize + "," + material.gapSize;
699
700
  }
@@ -724,9 +725,9 @@ let SVGRenderer$1 = class SVGRenderer {
724
725
  _color2.setRGB(_normal2.x, _normal2.y, _normal2.z).multiplyScalar(0.5).addScalar(0.5);
725
726
  }
726
727
  if (material.wireframe) {
727
- style = "fill:none;stroke:" + _color2.getStyle() + ";stroke-opacity:" + material.opacity + ";stroke-width:" + material.wireframeLinewidth + ";stroke-linecap:" + material.wireframeLinecap + ";stroke-linejoin:" + material.wireframeLinejoin;
728
+ style = "fill:none;stroke:" + _color2.getStyle(_this.outputColorSpace) + ";stroke-opacity:" + material.opacity + ";stroke-width:" + material.wireframeLinewidth + ";stroke-linecap:" + material.wireframeLinecap + ";stroke-linejoin:" + material.wireframeLinejoin;
728
729
  } else {
729
- style = "fill:" + _color2.getStyle() + ";fill-opacity:" + material.opacity;
730
+ style = "fill:" + _color2.getStyle(_this.outputColorSpace) + ";fill-opacity:" + material.opacity;
730
731
  }
731
732
  addPath(style, path);
732
733
  }
@@ -775,230 +776,187 @@ let SVGRenderer$1 = class SVGRenderer {
775
776
  };
776
777
  /**
777
778
  * @license
778
- * uiconfig.js v0.1.3
779
+ * ts-browser-helpers v0.19.4
779
780
  * Copyright 2022-2025 repalash <palash@shaders.app>
780
781
  * MIT License
782
+ * See ./dependencies.txt for bundled third-party dependencies and licenses.
781
783
  */
782
- function Ee(n, ...e) {
783
- return typeof n == "function" && (n = n(...e)), n;
784
+ function Fe(t, ...e) {
785
+ return t;
784
786
  }
785
- function it() {
786
- const n = (i, r) => i.toString(16).padStart(r, "0"), e = crypto.getRandomValues(new Uint8Array(16));
787
- e[6] = e[6] & 15 | 64, e[8] = e[8] & 63 | 128;
788
- const t = new DataView(e.buffer);
789
- return `${n(t.getUint32(0), 8)}-${n(t.getUint16(4), 4)}-${n(t.getUint16(6), 4)}-${n(t.getUint16(8), 4)}-${n(t.getUint32(10), 8)}${n(t.getUint16(14), 4)}`;
790
- }
791
- class UiConfigTypeMap {
792
- }
793
- UiConfigTypeMap.Map = /* @__PURE__ */ new Map();
794
- function generateValueConfig(obj, key, label, val) {
795
- val = val !== null && val !== void 0 ? val : obj[key];
796
- const config = val === null || val === void 0 ? void 0 : val.uiConfig;
797
- let result = void 0;
798
- if (config) {
799
- result = config;
800
- } else {
801
- const uiType = valueToUiType(val);
802
- if (uiType === "folder") {
803
- result = generateUiFolder(key + "", val, {}, "folder", true);
804
- } else if (uiType)
805
- result = {
806
- type: uiType,
807
- label: key + "",
808
- property: [obj, key]
809
- };
810
- }
811
- label = label !== null && label !== void 0 ? label : key + "";
812
- if (result && !result.label)
813
- result.label = label;
814
- return result;
787
+ function L(t, e) {
788
+ return Object.hasOwn ? Object.hasOwn(t, e) : t.hasOwnProperty(e);
815
789
  }
816
- function generateUiConfig(obj) {
817
- if (!obj)
818
- return [];
819
- let type = obj.constructor || Object;
820
- if (type === Array)
821
- type = Object;
822
- const result = [];
823
- const types = [];
824
- while (type && type !== Object) {
825
- types.push(type);
826
- type = Object.getPrototypeOf(type);
827
- }
828
- if (!types.length || Array.isArray(obj)) {
829
- const keys2 = typeof obj === "object" ? Object.keys(obj) : Array.isArray(obj) ? obj.map((_, i) => i) : [];
830
- for (const key of keys2) {
831
- const val = obj[key];
832
- if (val === void 0 || val === null)
833
- continue;
834
- const c = () => generateValueConfig(obj, key, key + "", val);
835
- result.push(c);
836
- }
837
- }
838
- types.reverse().forEach((t) => {
839
- var _a;
840
- (_a = UiConfigTypeMap.Map.get(t)) === null || _a === void 0 ? void 0 : _a.forEach(({ params, propKey, uiType }) => {
841
- let config;
842
- if (!uiType) {
843
- config = () => generateValueConfig(obj, propKey);
844
- }
845
- if (!config) {
846
- config = {
847
- property: [obj, propKey],
848
- type: uiType || "input"
849
- // ...params,
850
- // ...extraParams,
851
- };
852
- }
853
- if (params) {
854
- const extraParams = typeof params.params === "function" ? params.params(obj) : params.params || {};
855
- const params1 = Object.assign({}, params);
856
- delete params1.params;
857
- if (typeof config === "function") {
858
- const c1 = config;
859
- config = () => Object.assign(c1(), Object.assign(Object.assign({}, params1), extraParams));
860
- }
861
- Object.assign(config, Object.assign(Object.assign({}, params1), extraParams));
790
+ const k = class k2 {
791
+ static callFunction(e, i, n = []) {
792
+ if (!i) return e(...n);
793
+ if (e.name && i[e.name] === e) return e.call(i, ...n);
794
+ k2.methodMap.has(i) || k2.methodMap.set(i, /* @__PURE__ */ new WeakMap());
795
+ const r = k2.methodMap.get(i);
796
+ if (!r.has(e)) {
797
+ let o = i;
798
+ for (; o; ) {
799
+ const s = Object.values(Object.getOwnPropertyDescriptors(o));
800
+ for (let a of s)
801
+ if (a.value === e)
802
+ return r.set(e, true), e.call(i, ...n);
803
+ o = Object.getPrototypeOf(o);
862
804
  }
863
- result.push(config);
864
- });
865
- });
866
- return result;
867
- }
868
- function generateUiFolder(label, obj, params = {}, type = "folder", dynamic = false) {
869
- return Object.assign({ type, label, children: !dynamic ? generateUiConfig(obj) : () => generateUiConfig(obj), uuid: it() }, params);
870
- }
871
- function valueToUiType(val) {
872
- if (val === null || val === void 0)
873
- return null;
874
- if (Array.isArray(val))
875
- return "folder";
876
- if (typeof val === "boolean")
877
- return "checkbox";
878
- if (typeof val === "number")
879
- return "number";
880
- if (typeof val === "string")
881
- return "input";
882
- if (typeof val === "function")
883
- return "button";
884
- if (typeof val.x === "number")
885
- return "vec";
886
- if (typeof val.r === "number")
887
- return "color";
888
- if (val.isTexture)
889
- return "image";
890
- if (typeof val === "object")
891
- return "folder";
892
- return null;
893
- }
894
- function uiConfigDecorator(action) {
895
- return (targetPrototype, propertyKey) => {
896
- const type = targetPrototype.constructor;
897
- if (type === Object)
898
- throw new Error("Not possible to use uiConfig decorator on an object, use class instead");
899
- if (!UiConfigTypeMap.Map.has(type))
900
- UiConfigTypeMap.Map.set(type, []);
901
- action(targetPrototype, propertyKey, UiConfigTypeMap.Map.get(type));
902
- };
903
- }
904
- function uiConfig(uiType, params) {
905
- return uiConfigDecorator((_, propertyKey, uiConfigs) => {
906
- const index = uiConfigs.findIndex((item) => item.propKey === propertyKey);
907
- if (index && index < 0)
908
- uiConfigs.push({
909
- params: params || {},
910
- propKey: propertyKey,
911
- uiType
912
- });
913
- else {
914
- throw new Error(`Property ${propertyKey} already has a uiConfig decorator`);
805
+ r.set(e, false);
915
806
  }
916
- });
917
- }
918
- function uiContainer(label, params, type = "panel") {
919
- return (constructor) => {
920
- return class extends constructor {
921
- constructor() {
922
- super(...arguments);
923
- this.uiConfig = generateUiFolder(Ee(label, this) || "", this, {}, type);
807
+ return r.get(e) ? e.call(i, ...n) : e(...n);
808
+ }
809
+ };
810
+ k.methodMap = /* @__PURE__ */ new WeakMap();
811
+ let U$1 = k;
812
+ function I(t, e = "param") {
813
+ if (!t) throw new Error("onChange: fnKey is undefined, make sure the function exists or provide a string");
814
+ return (i, n, r) => {
815
+ const o = {
816
+ get() {
817
+ return this[`_oc_${n}`];
818
+ },
819
+ set(s) {
820
+ var u;
821
+ const a = this[`_oc_${n}`];
822
+ if (a === s) return;
823
+ this[`_oc_${n}`] = s;
824
+ const c2 = e === "param" ? [n, s, a, this] : e === "object" ? [{ key: n, value: s, oldValue: a, target: this }] : [];
825
+ typeof t == "string" ? (u = this[t]) == null || u.call(this, ...c2) : typeof t == "function" && U$1.callFunction(t, this, c2);
924
826
  }
925
827
  };
828
+ if (r)
829
+ return L(r, "value") && delete r.value, L(r, "writable") && delete r.writable, L(r, "initializer") && delete r.initializer, Object.assign(r, o);
830
+ Object.defineProperty(i, n, o);
926
831
  };
927
832
  }
928
- function uiDropdown(label, children, params) {
929
- if (Array.isArray(children) && typeof children[0] === "string")
930
- children = children.map((c) => ({ label: c, value: c }));
931
- return uiConfig("dropdown", { label, children, params });
932
- }
933
- function uiNumber(label, params) {
934
- return uiConfig("number", { label, params });
833
+ function Ke(t, e = "void") {
834
+ if (!t) throw new Error("onChange: fnKey is undefined, make sure the function exists or provide a string");
835
+ return I(t, e);
935
836
  }
936
- function uiToggle(label, params) {
937
- return uiConfig("checkbox", { label, params });
938
- }
939
- function uiFolderContainer(label, params) {
940
- return uiContainer(label, params, "folder");
837
+ function xt() {
838
+ const t = (n, r) => n.toString(16).padStart(r, "0"), e = crypto.getRandomValues(new Uint8Array(16));
839
+ e[6] = e[6] & 15 | 64, e[8] = e[8] & 63 | 128;
840
+ const i = new DataView(e.buffer);
841
+ return `${t(i.getUint32(0), 8)}-${t(i.getUint16(4), 4)}-${t(i.getUint16(6), 4)}-${t(i.getUint16(8), 4)}-${t(i.getUint32(10), 8)}${t(i.getUint16(14), 4)}`;
941
842
  }
942
- typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) {
943
- var e = new Error(message);
944
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
945
- };
946
843
  /**
947
844
  * @license
948
- * ts-browser-helpers v0.16.2
845
+ * uiconfig.js v0.3.1
949
846
  * Copyright 2022-2025 repalash <palash@shaders.app>
950
847
  * MIT License
951
848
  * See ./dependencies.txt for bundled third-party dependencies and licenses.
952
849
  */
953
- function v(n, e) {
954
- return Object.hasOwn ? Object.hasOwn(n, e) : n.hasOwnProperty(e);
955
- }
956
- const m = class m2 {
957
- static callFunction(e, t, i = []) {
958
- if (!t) return e(...i);
959
- if (e.name && t[e.name] === e) return e.call(t, ...i);
960
- m2.methodMap.has(t) || m2.methodMap.set(t, /* @__PURE__ */ new WeakMap());
961
- const r = m2.methodMap.get(t);
962
- if (!r.has(e)) {
963
- let s = t;
964
- for (; s; ) {
965
- const o = Object.values(Object.getOwnPropertyDescriptors(s));
966
- for (let c of o)
967
- if (c.value === e)
968
- return r.set(e, true), e.call(t, ...i);
969
- s = Object.getPrototypeOf(s);
970
- }
971
- r.set(e, false);
972
- }
973
- return r.get(e) ? e.call(t, ...i) : e(...i);
974
- }
850
+ const C = class C2 {
975
851
  };
976
- m.methodMap = /* @__PURE__ */ new WeakMap();
977
- let E = m;
978
- function x$4(n, e = "param") {
979
- if (!n) throw new Error("onChange: fnKey is undefined, make sure the function exists or provide a string");
980
- return (t, i, r) => {
981
- const s = {
982
- get() {
983
- return this[`_oc_${i}`];
984
- },
985
- set(o) {
986
- var u;
987
- const c = this[`_oc_${i}`];
988
- if (c === o) return;
989
- this[`_oc_${i}`] = o;
990
- const a = e === "param" ? [i, o, c, this] : e === "object" ? [{ key: i, value: o, oldValue: c, target: this }] : [];
991
- typeof n == "string" ? (u = this[n]) == null || u.call(this, ...a) : typeof n == "function" && E.callFunction(n, this, a);
852
+ C.Map = /* @__PURE__ */ new Map();
853
+ let c = C;
854
+ function v(n, e, t, r, i = true) {
855
+ r = r ?? n[e], t = t ?? e + "";
856
+ const o = r == null ? void 0 : r.uiConfig;
857
+ let s;
858
+ if (o)
859
+ s = o;
860
+ else {
861
+ const a = T(r);
862
+ a === "folder" ? s = U(t, r, {}, "folder", i) : a && (s = {
863
+ type: a,
864
+ label: t,
865
+ property: [n, e]
866
+ });
867
+ }
868
+ return s && !s.label && (s.label = t), s;
869
+ }
870
+ function _(n) {
871
+ if (!n) return [];
872
+ let e = n.constructor || Object;
873
+ e === Array && (e = Object);
874
+ const t = [], r = [];
875
+ for (; e && e !== Object; )
876
+ r.push(e), e = Object.getPrototypeOf(e);
877
+ if (!r.length || Array.isArray(n)) {
878
+ const i = typeof n == "object" ? Object.keys(n) : Array.isArray(n) ? n.map((o, s) => s) : [];
879
+ for (const o of i) {
880
+ const s = n[o];
881
+ if (s == null) continue;
882
+ const a = v(n, o, o + "", s, true);
883
+ a && t.push(a);
884
+ }
885
+ }
886
+ return r.reverse().forEach((i) => {
887
+ var o;
888
+ (o = c.Map.get(i)) == null || o.forEach(({ params: s, propKey: a, uiType: u }) => {
889
+ let d;
890
+ if (u || (d = () => v(n, a)), d || (d = {
891
+ property: [n, a],
892
+ type: u || "input"
893
+ // ...params,
894
+ // ...extraParams,
895
+ }), s) {
896
+ const y2 = typeof s.params == "function" ? s.params(n) : s.params || {}, p = { ...s };
897
+ if (delete p.params, typeof d == "function") {
898
+ const m = d;
899
+ d = () => {
900
+ const l = m();
901
+ return l && Object.assign(l, { ...p, ...y2 });
902
+ };
903
+ } else
904
+ Object.assign(d, { ...p, ...y2 });
992
905
  }
993
- };
994
- if (r)
995
- return v(r, "value") && delete r.value, v(r, "writable") && delete r.writable, v(r, "initializer") && delete r.initializer, Object.assign(r, s);
996
- Object.defineProperty(t, i, s);
906
+ t.push(d);
907
+ });
908
+ }), t;
909
+ }
910
+ function U(n, e, t = {}, r = "folder", i = false) {
911
+ return {
912
+ type: r,
913
+ label: n,
914
+ children: i ? [() => _(e)] : _(e),
915
+ uuid: xt(),
916
+ ...t
997
917
  };
998
918
  }
999
- function ze(n, e = "void") {
1000
- if (!n) throw new Error("onChange: fnKey is undefined, make sure the function exists or provide a string");
1001
- return x$4(n, e);
919
+ function T(n) {
920
+ return n == null ? null : Array.isArray(n) ? "folder" : typeof n == "boolean" ? "checkbox" : typeof n == "number" ? "number" : typeof n == "string" ? "input" : typeof n == "function" ? "button" : typeof n.x == "number" ? "vec" : typeof n.r == "number" ? "color" : n.isTexture ? "image" : typeof n == "object" ? "folder" : null;
921
+ }
922
+ function B(n) {
923
+ return (e, t) => {
924
+ const r = e.constructor;
925
+ if (r === Object) throw new Error("Not possible to use uiConfig decorator on an object, use class instead");
926
+ c.Map.has(r) || c.Map.set(r, []), n(e, t, c.Map.get(r));
927
+ };
928
+ }
929
+ function h(n, e) {
930
+ return B((t, r, i) => {
931
+ const o = i.findIndex((s) => s.propKey === r);
932
+ if (o && o < 0)
933
+ i.push({
934
+ params: e || {},
935
+ propKey: r,
936
+ uiType: n
937
+ });
938
+ else
939
+ throw new Error(`Property ${r} already has a uiConfig decorator`);
940
+ });
941
+ }
942
+ function b(n, e, t = "panel") {
943
+ return (r) => class extends r {
944
+ constructor() {
945
+ super(...arguments), this.uiConfig = U(Fe(n, this) || "", this, {}, t);
946
+ }
947
+ };
948
+ }
949
+ function N(n, e, t) {
950
+ return Array.isArray(e) && typeof e[0] == "string" && (e = e.map((r) => ({ label: r, value: r }))), h("dropdown", { label: n, children: e, params: t });
951
+ }
952
+ function H(n, e) {
953
+ return h("number", { label: n, params: e });
954
+ }
955
+ function G$1(n, e) {
956
+ return h("checkbox", { label: n, params: e });
957
+ }
958
+ function X(n, e) {
959
+ return b(n, e, "folder");
1002
960
  }
1003
961
  var __defProp$2 = Object.defineProperty;
1004
962
  var __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor;
@@ -1020,23 +978,23 @@ let BasicSVGRenderer = class extends SVGRenderer$1 {
1020
978
  }
1021
979
  };
1022
980
  __decorateClass$2([
1023
- uiToggle()
981
+ G$1()
1024
982
  ], BasicSVGRenderer.prototype, "autoClear", 2);
1025
983
  __decorateClass$2([
1026
- uiToggle()
984
+ G$1()
1027
985
  ], BasicSVGRenderer.prototype, "sortObjects", 2);
1028
986
  __decorateClass$2([
1029
- uiToggle()
987
+ G$1()
1030
988
  ], BasicSVGRenderer.prototype, "sortElements", 2);
1031
989
  __decorateClass$2([
1032
- uiNumber()
990
+ H()
1033
991
  ], BasicSVGRenderer.prototype, "overdraw", 2);
1034
992
  __decorateClass$2([
1035
- uiDropdown(void 0, ["low", "high"]),
1036
- ze(BasicSVGRenderer.prototype._refresh)
993
+ N(void 0, ["low", "high"]),
994
+ Ke(BasicSVGRenderer.prototype._refresh)
1037
995
  ], BasicSVGRenderer.prototype, "quality", 2);
1038
996
  BasicSVGRenderer = __decorateClass$2([
1039
- uiFolderContainer("Basic SVG Renderer")
997
+ X("Basic SVG Renderer")
1040
998
  ], BasicSVGRenderer);
1041
999
  var __defProp$1 = Object.defineProperty;
1042
1000
  var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
@@ -1061,7 +1019,7 @@ let BasicSVGRendererPlugin = class extends AViewerPluginSync {
1061
1019
  this._lastStyles = void 0;
1062
1020
  this.autoRender = true;
1063
1021
  this._viewerListeners = {
1064
- postRender: (_) => {
1022
+ postRender: (_2) => {
1065
1023
  if (this.autoRender) this.render();
1066
1024
  }
1067
1025
  };
@@ -1130,13 +1088,13 @@ let BasicSVGRendererPlugin = class extends AViewerPluginSync {
1130
1088
  };
1131
1089
  BasicSVGRendererPlugin.PluginType = "BasicSVGRendererPlugin";
1132
1090
  __decorateClass$1([
1133
- uiToggle$1()
1091
+ uiToggle()
1134
1092
  ], BasicSVGRendererPlugin.prototype, "enabled", 2);
1135
1093
  __decorateClass$1([
1136
- uiConfig$1()
1094
+ uiConfig()
1137
1095
  ], BasicSVGRendererPlugin.prototype, "renderer", 2);
1138
1096
  __decorateClass$1([
1139
- uiToggle$1()
1097
+ uiToggle()
1140
1098
  ], BasicSVGRendererPlugin.prototype, "autoRender", 2);
1141
1099
  __decorateClass$1([
1142
1100
  uiButton()
@@ -1145,7 +1103,7 @@ __decorateClass$1([
1145
1103
  uiButton()
1146
1104
  ], BasicSVGRendererPlugin.prototype, "download", 1);
1147
1105
  BasicSVGRendererPlugin = __decorateClass$1([
1148
- uiFolderContainer$1("SVG Renderer")
1106
+ uiFolderContainer("SVG Renderer")
1149
1107
  ], BasicSVGRendererPlugin);
1150
1108
  var ViewEdgeNature = /* @__PURE__ */ ((ViewEdgeNature2) => {
1151
1109
  ViewEdgeNature2["Silhouette"] = "Silhouette";
@@ -1162,14 +1120,14 @@ const VisibilityIndicatingNatures = /* @__PURE__ */ new Set([
1162
1120
  /* MeshIntersection */
1163
1121
  ]);
1164
1122
  class ViewEdge {
1165
- constructor(a, b, nature, halfedge) {
1123
+ constructor(a, b2, nature, halfedge) {
1166
1124
  this.meshes = new Array();
1167
1125
  this.faceAngle = Infinity;
1168
1126
  this.isBack = false;
1169
1127
  this.isConcave = false;
1170
1128
  this.faces = new Array();
1171
1129
  this.a = a;
1172
- this.b = b;
1130
+ this.b = b2;
1173
1131
  this.nature = nature;
1174
1132
  this.halfedge = halfedge;
1175
1133
  }
@@ -1303,26 +1261,26 @@ function intersectLines(line1, line2, target, infiniteLine = false, tolerance =
1303
1261
  }
1304
1262
  return false;
1305
1263
  }
1306
- function vectors3Equal(a, b, tolerance = 1e-10) {
1307
- return Math.abs(a.x - b.x) < tolerance && Math.abs(a.y - b.y) < tolerance && Math.abs(a.z - b.z) < tolerance;
1264
+ function vectors3Equal(a, b2, tolerance = 1e-10) {
1265
+ return Math.abs(a.x - b2.x) < tolerance && Math.abs(a.y - b2.y) < tolerance && Math.abs(a.z - b2.z) < tolerance;
1308
1266
  }
1309
- function vectors2Equal(a, b, tolerance = 1e-10) {
1310
- return Math.abs(a.x - b.x) < tolerance && Math.abs(a.y - b.y) < tolerance;
1267
+ function vectors2Equal(a, b2, tolerance = 1e-10) {
1268
+ return Math.abs(a.x - b2.x) < tolerance && Math.abs(a.y - b2.y) < tolerance;
1311
1269
  }
1312
1270
  const _matrix$3 = new Matrix4$1();
1313
- function orient3D$2(a, b, c, d, epsilon = 1e-10) {
1271
+ function orient3D$2(a, b2, c2, d, epsilon = 1e-10) {
1314
1272
  _matrix$3.set(
1315
1273
  a.x,
1316
1274
  a.y,
1317
1275
  a.z,
1318
1276
  1,
1319
- b.x,
1320
- b.y,
1321
- b.z,
1277
+ b2.x,
1278
+ b2.y,
1279
+ b2.z,
1322
1280
  1,
1323
- c.x,
1324
- c.y,
1325
- c.z,
1281
+ c2.x,
1282
+ c2.y,
1283
+ c2.z,
1326
1284
  1,
1327
1285
  d.x,
1328
1286
  d.y,
@@ -1337,11 +1295,11 @@ function orient3D$2(a, b, c, d, epsilon = 1e-10) {
1337
1295
  }
1338
1296
  return 0;
1339
1297
  }
1340
- function frontSide$1(a, b, c, d, epsilon = 1e-10) {
1341
- return orient3D$2(d, b, c, a, epsilon) > 0;
1298
+ function frontSide$1(a, b2, c2, d, epsilon = 1e-10) {
1299
+ return orient3D$2(d, b2, c2, a, epsilon) > 0;
1342
1300
  }
1343
- function sameSide(a, b, c, d, e, epsilon = 1e-10) {
1344
- return orient3D$2(a, b, c, d, epsilon) > 0 === orient3D$2(a, b, c, e, epsilon) > 0;
1301
+ function sameSide(a, b2, c2, d, e, epsilon = 1e-10) {
1302
+ return orient3D$2(a, b2, c2, d, epsilon) > 0 === orient3D$2(a, b2, c2, e, epsilon) > 0;
1345
1303
  }
1346
1304
  function round(num, divider = 100) {
1347
1305
  return Math.round(num * divider) / divider;
@@ -2100,7 +2058,7 @@ var Arrangement2D = (() => {
2100
2058
  var wasmBinary;
2101
2059
  if (Module["wasmBinary"]) wasmBinary = Module["wasmBinary"];
2102
2060
  legacyModuleProp("wasmBinary", "wasmBinary");
2103
- var noExitRuntime = Module["noExitRuntime"] || true;
2061
+ Module["noExitRuntime"] || true;
2104
2062
  legacyModuleProp("noExitRuntime", "noExitRuntime");
2105
2063
  if (typeof WebAssembly != "object") {
2106
2064
  abort("no native wasm support detected");
@@ -2258,9 +2216,6 @@ var Arrangement2D = (() => {
2258
2216
  var __ATINIT__ = [];
2259
2217
  var __ATPOSTRUN__ = [];
2260
2218
  var runtimeInitialized = false;
2261
- function keepRuntimeAlive() {
2262
- return noExitRuntime;
2263
- }
2264
2219
  function preRun() {
2265
2220
  if (Module["preRun"]) {
2266
2221
  if (typeof Module["preRun"] == "function") Module["preRun"] = [Module["preRun"]];
@@ -3008,7 +2963,7 @@ var Arrangement2D = (() => {
3008
2963
  bytes[i] = decoded.charCodeAt(i);
3009
2964
  }
3010
2965
  return bytes;
3011
- } catch (_) {
2966
+ } catch (_2) {
3012
2967
  throw new Error("Converting base64 string to bytes failed.");
3013
2968
  }
3014
2969
  }
@@ -3393,10 +3348,6 @@ var Arrangement2D = (() => {
3393
3348
  procExit(status);
3394
3349
  }
3395
3350
  function procExit(code) {
3396
- if (!keepRuntimeAlive()) {
3397
- if (Module["onExit"]) Module["onExit"](code);
3398
- ABORT = true;
3399
- }
3400
3351
  quit_(code, new ExitStatus(code));
3401
3352
  }
3402
3353
  if (Module["preInit"]) {
@@ -3705,16 +3656,16 @@ class PolygonsInfo {
3705
3656
  async function computePolygons(viewmap, info = new PolygonsInfo()) {
3706
3657
  const { chains, polygons } = viewmap;
3707
3658
  const Arr2D = await Arr2DPromise;
3708
- const visibleChains = chains.filter((c) => c.visibility === ChainVisibility.Visible);
3659
+ const visibleChains = chains.filter((c2) => c2.visibility === ChainVisibility.Visible);
3709
3660
  const points = new Arr2D.PointList();
3710
- let a, b;
3661
+ let a, b2;
3711
3662
  for (const chain of visibleChains) {
3712
3663
  a = new Arr2D.Point(chain.vertices[0].pos2d.x, chain.vertices[0].pos2d.y);
3713
3664
  for (let i = 1; i < chain.vertices.length; i++) {
3714
- b = new Arr2D.Point(chain.vertices[i].pos2d.x, chain.vertices[i].pos2d.y);
3665
+ b2 = new Arr2D.Point(chain.vertices[i].pos2d.x, chain.vertices[i].pos2d.y);
3715
3666
  points.push_back(a);
3716
- points.push_back(b);
3717
- a = b;
3667
+ points.push_back(b2);
3668
+ a = b2;
3718
3669
  }
3719
3670
  }
3720
3671
  const builder = new Arr2D.ArrangementBuilder();
@@ -3879,7 +3830,6 @@ function assignPolygons(viewmap, options, info = new AssignPolygonInfo()) {
3879
3830
  for (const polygon of polygons) {
3880
3831
  imagePointToNDC(polygon.insidePoint, _vec2, renderSize);
3881
3832
  _raycaster$1.setFromCamera(_vec2, camera);
3882
- _raycaster$1.firstHitOnly = true;
3883
3833
  const intersections = _raycaster$1.intersectObjects(threeMeshes, false);
3884
3834
  if (intersections.length > 0) {
3885
3835
  const intersection = intersections[0];
@@ -3950,7 +3900,6 @@ function chainVisibilityWithRaycasting(chain, camera, objects, tolerance = 1e-5)
3950
3900
  }
3951
3901
  _rayOrigin.lerpVectors(edge.a.pos3d, edge.b.pos3d, 0.5);
3952
3902
  _rayDirection.subVectors(camera.position, _rayOrigin).normalize();
3953
- _raycaster.firstHitOnly = false;
3954
3903
  _raycaster.set(_rayOrigin, _rayDirection);
3955
3904
  chain.raycastPoint.lerpVectors(edge.a.pos2d, edge.b.pos2d, 0.5);
3956
3905
  const intersections = _raycaster.intersectObjects(objects, false);
@@ -3973,22 +3922,22 @@ function isTriDegenerated(tri) {
3973
3922
  _tmp1.subVectors(tri.a, tri.b);
3974
3923
  _tmp2.subVectors(tri.a, tri.c);
3975
3924
  _tmp1.cross(_tmp2);
3976
- return _tmp1.x > -1e-10 && _tmp1.x < EPSILON$1 && _tmp1.y > -1e-10 && _tmp1.y < EPSILON$1 && _tmp1.z > -1e-10 && _tmp1.z < EPSILON$1;
3925
+ return _tmp1.x > -EPSILON$1 && _tmp1.x < EPSILON$1 && _tmp1.y > -EPSILON$1 && _tmp1.y < EPSILON$1 && _tmp1.z > -EPSILON$1 && _tmp1.z < EPSILON$1;
3977
3926
  }
3978
- function orient3D$1(a, b, c, d) {
3979
- _matrix4.set(a.x, a.y, a.z, 1, b.x, b.y, b.z, 1, c.x, c.y, c.z, 1, d.x, d.y, d.z, 1);
3927
+ function orient3D$1(a, b2, c2, d) {
3928
+ _matrix4.set(a.x, a.y, a.z, 1, b2.x, b2.y, b2.z, 1, c2.x, c2.y, c2.z, 1, d.x, d.y, d.z, 1);
3980
3929
  const det = _matrix4.determinant();
3981
- if (det < -1e-10)
3930
+ if (det < -EPSILON$1)
3982
3931
  return -1;
3983
3932
  else if (det > EPSILON$1)
3984
3933
  return 1;
3985
3934
  else
3986
3935
  return 0;
3987
3936
  }
3988
- function orient2D(a, b, c) {
3989
- _matrix3.set(a.x, a.y, 1, b.x, b.y, 1, c.x, c.y, 1);
3937
+ function orient2D(a, b2, c2) {
3938
+ _matrix3.set(a.x, a.y, 1, b2.x, b2.y, 1, c2.x, c2.y, 1);
3990
3939
  const det = _matrix3.determinant();
3991
- if (det < -1e-10)
3940
+ if (det < -EPSILON$1)
3992
3941
  return -1;
3993
3942
  else if (det > EPSILON$1)
3994
3943
  return 1;
@@ -4073,8 +4022,8 @@ function makeTriAVertexPositive(tri, other) {
4073
4022
  other.b = tmp;
4074
4023
  }
4075
4024
  }
4076
- function intersectPlane(a, b, p, n, target) {
4077
- _u$1$1.subVectors(b, a);
4025
+ function intersectPlane(a, b2, p, n, target) {
4026
+ _u$1$1.subVectors(b2, a);
4078
4027
  _v$1$1.subVectors(a, p);
4079
4028
  const dot1 = n.dot(_u$1$1);
4080
4029
  const dot2 = n.dot(_v$1$1);
@@ -4453,15 +4402,15 @@ function splitViewEdge2d(viewmap, edge, position2) {
4453
4402
  };
4454
4403
  }
4455
4404
  function splitViewEdgeWithViewVertex(viewmap, edge, vertex) {
4456
- const b = edge.b;
4405
+ const b2 = edge.b;
4457
4406
  const newEdge = edge.clone();
4458
4407
  edge.b = vertex;
4459
4408
  newEdge.a = vertex;
4460
- newEdge.b = b;
4409
+ newEdge.b = b2;
4461
4410
  vertex.viewEdges.push(edge);
4462
4411
  vertex.viewEdges.push(newEdge);
4463
- b.viewEdges.remove(edge);
4464
- b.viewEdges.push(newEdge);
4412
+ b2.viewEdges.remove(edge);
4413
+ b2.viewEdges.push(newEdge);
4465
4414
  for (const face of newEdge.faces) {
4466
4415
  face.viewEdges.push(newEdge);
4467
4416
  }
@@ -4509,8 +4458,8 @@ function computeMeshIntersections(viewmap, info = new MeshIntersectionInfo()) {
4509
4458
  }
4510
4459
  }
4511
4460
  _dir.subVectors(line.end, line.start);
4512
- intersectionViewVertices.sort((a, b) => {
4513
- _dir.subVectors(b.pos3d, a.pos3d);
4461
+ intersectionViewVertices.sort((a, b2) => {
4462
+ _dir.subVectors(b2.pos3d, a.pos3d);
4514
4463
  return _dir.dot(_lineDir);
4515
4464
  });
4516
4465
  for (let i = 0; i < intersectionViewVertices.length - 1; i++) {
@@ -4586,16 +4535,16 @@ var Node = function Node2(key, data2) {
4586
4535
  this.left = null;
4587
4536
  this.right = null;
4588
4537
  };
4589
- function DEFAULT_COMPARE(a, b) {
4590
- return a > b ? 1 : a < b ? -1 : 0;
4538
+ function DEFAULT_COMPARE(a, b2) {
4539
+ return a > b2 ? 1 : a < b2 ? -1 : 0;
4591
4540
  }
4592
4541
  function splay(i, t, comparator) {
4593
4542
  if (t === null) {
4594
4543
  return t;
4595
4544
  }
4596
4545
  var l, r, y2;
4597
- var N = new Node();
4598
- l = r = N;
4546
+ var N2 = new Node();
4547
+ l = r = N2;
4599
4548
  while (true) {
4600
4549
  var cmp = comparator(i, t.key);
4601
4550
  if (cmp < 0) {
@@ -4636,8 +4585,8 @@ function splay(i, t, comparator) {
4636
4585
  }
4637
4586
  l.right = t.left;
4638
4587
  r.left = t.right;
4639
- t.left = N.right;
4640
- t.right = N.left;
4588
+ t.left = N2.right;
4589
+ t.right = N2.left;
4641
4590
  return t;
4642
4591
  }
4643
4592
  function insert(i, data2, t, comparator, tree) {
@@ -5093,8 +5042,8 @@ function sortedListToBST(list, start, end) {
5093
5042
  return null;
5094
5043
  }
5095
5044
  function mergeLists(l1, l2, compare) {
5096
- if (compare === void 0) compare = function(a, b) {
5097
- return a - b;
5045
+ if (compare === void 0) compare = function(a, b2) {
5046
+ return a - b2;
5098
5047
  };
5099
5048
  var head = {};
5100
5049
  var p = head;
@@ -5144,10 +5093,10 @@ function sort(keys2, values2, left, right, compare) {
5144
5093
  sort(keys2, values2, left, j, compare);
5145
5094
  sort(keys2, values2, j + 1, right, compare);
5146
5095
  }
5147
- function intersectSegments$1(a, b) {
5148
- var aStart = a.from, bStart = b.from;
5096
+ function intersectSegments$1(a, b2) {
5097
+ var aStart = a.from, bStart = b2.from;
5149
5098
  var p0_x = aStart.x, p0_y = aStart.y, p2_x = bStart.x, p2_y = bStart.y;
5150
- var s1_x = a.from.x - a.to.x, s1_y = a.from.y - a.to.y, s2_x = b.from.x - b.to.x, s2_y = b.from.y - b.to.y;
5099
+ var s1_x = a.from.x - a.to.x, s1_y = a.from.y - a.to.y, s2_x = b2.from.x - b2.to.x, s2_y = b2.from.y - b2.to.y;
5151
5100
  var div = s1_x * s2_y - s2_x * s1_y;
5152
5101
  var s = (s1_y * (p0_x - p2_x) - s1_x * (p0_y - p2_y)) / div;
5153
5102
  if (s < 0 || s > 1) {
@@ -5379,59 +5328,59 @@ function swap(values2, boxes, indices, i, j) {
5379
5328
  var temp5 = values2[i];
5380
5329
  values2[i] = values2[j];
5381
5330
  values2[j] = temp5;
5382
- var k = 4 * i;
5383
- var m3 = 4 * j;
5384
- var a = boxes[k];
5385
- var b = boxes[k + 1];
5386
- var c = boxes[k + 2];
5387
- var d = boxes[k + 3];
5388
- boxes[k] = boxes[m3];
5389
- boxes[k + 1] = boxes[m3 + 1];
5390
- boxes[k + 2] = boxes[m3 + 2];
5391
- boxes[k + 3] = boxes[m3 + 3];
5392
- boxes[m3] = a;
5393
- boxes[m3 + 1] = b;
5394
- boxes[m3 + 2] = c;
5395
- boxes[m3 + 3] = d;
5331
+ var k3 = 4 * i;
5332
+ var m = 4 * j;
5333
+ var a = boxes[k3];
5334
+ var b2 = boxes[k3 + 1];
5335
+ var c2 = boxes[k3 + 2];
5336
+ var d = boxes[k3 + 3];
5337
+ boxes[k3] = boxes[m];
5338
+ boxes[k3 + 1] = boxes[m + 1];
5339
+ boxes[k3 + 2] = boxes[m + 2];
5340
+ boxes[k3 + 3] = boxes[m + 3];
5341
+ boxes[m] = a;
5342
+ boxes[m + 1] = b2;
5343
+ boxes[m + 2] = c2;
5344
+ boxes[m + 3] = d;
5396
5345
  var e = indices[i];
5397
5346
  indices[i] = indices[j];
5398
5347
  indices[j] = e;
5399
5348
  }
5400
5349
  function hilbert(x2, y2) {
5401
5350
  var a = x2 ^ y2;
5402
- var b = 65535 ^ a;
5403
- var c = 65535 ^ (x2 | y2);
5351
+ var b2 = 65535 ^ a;
5352
+ var c2 = 65535 ^ (x2 | y2);
5404
5353
  var d = x2 & (y2 ^ 65535);
5405
- var A2 = a | b >> 1;
5406
- var B = a >> 1 ^ a;
5407
- var C = c >> 1 ^ b & d >> 1 ^ c;
5408
- var D = a & c >> 1 ^ d >> 1 ^ d;
5354
+ var A2 = a | b2 >> 1;
5355
+ var B2 = a >> 1 ^ a;
5356
+ var C3 = c2 >> 1 ^ b2 & d >> 1 ^ c2;
5357
+ var D = a & c2 >> 1 ^ d >> 1 ^ d;
5409
5358
  a = A2;
5410
- b = B;
5411
- c = C;
5359
+ b2 = B2;
5360
+ c2 = C3;
5412
5361
  d = D;
5413
- A2 = a & a >> 2 ^ b & b >> 2;
5414
- B = a & b >> 2 ^ b & (a ^ b) >> 2;
5415
- C ^= a & c >> 2 ^ b & d >> 2;
5416
- D ^= b & c >> 2 ^ (a ^ b) & d >> 2;
5362
+ A2 = a & a >> 2 ^ b2 & b2 >> 2;
5363
+ B2 = a & b2 >> 2 ^ b2 & (a ^ b2) >> 2;
5364
+ C3 ^= a & c2 >> 2 ^ b2 & d >> 2;
5365
+ D ^= b2 & c2 >> 2 ^ (a ^ b2) & d >> 2;
5417
5366
  a = A2;
5418
- b = B;
5419
- c = C;
5367
+ b2 = B2;
5368
+ c2 = C3;
5420
5369
  d = D;
5421
- A2 = a & a >> 4 ^ b & b >> 4;
5422
- B = a & b >> 4 ^ b & (a ^ b) >> 4;
5423
- C ^= a & c >> 4 ^ b & d >> 4;
5424
- D ^= b & c >> 4 ^ (a ^ b) & d >> 4;
5370
+ A2 = a & a >> 4 ^ b2 & b2 >> 4;
5371
+ B2 = a & b2 >> 4 ^ b2 & (a ^ b2) >> 4;
5372
+ C3 ^= a & c2 >> 4 ^ b2 & d >> 4;
5373
+ D ^= b2 & c2 >> 4 ^ (a ^ b2) & d >> 4;
5425
5374
  a = A2;
5426
- b = B;
5427
- c = C;
5375
+ b2 = B2;
5376
+ c2 = C3;
5428
5377
  d = D;
5429
- C ^= a & c >> 8 ^ b & d >> 8;
5430
- D ^= b & c >> 8 ^ (a ^ b) & d >> 8;
5431
- a = C ^ C >> 1;
5432
- b = D ^ D >> 1;
5378
+ C3 ^= a & c2 >> 8 ^ b2 & d >> 8;
5379
+ D ^= b2 & c2 >> 8 ^ (a ^ b2) & d >> 8;
5380
+ a = C3 ^ C3 >> 1;
5381
+ b2 = D ^ D >> 1;
5433
5382
  var i0 = x2 ^ y2;
5434
- var i1 = b | 65535 ^ (i0 | a);
5383
+ var i1 = b2 | 65535 ^ (i0 | a);
5435
5384
  i0 = (i0 | i0 << 8) & 16711935;
5436
5385
  i0 = (i0 | i0 << 4) & 252645135;
5437
5386
  i0 = (i0 | i0 << 2) & 858993459;
@@ -5534,8 +5483,8 @@ function find2dSingularities(viewmap) {
5534
5483
  const { viewEdges } = viewmap;
5535
5484
  const interAlgorithm = bush([...viewEdges]);
5536
5485
  let intersections = interAlgorithm.run();
5537
- intersections = intersections.filter(({ segments: [a, b] }) => {
5538
- return !a.isConnectedTo(b) && (VisibilityIndicatingNatures.has(a.nature) || VisibilityIndicatingNatures.has(b.nature));
5486
+ intersections = intersections.filter(({ segments: [a, b2] }) => {
5487
+ return !a.isConnectedTo(b2) && (VisibilityIndicatingNatures.has(a.nature) || VisibilityIndicatingNatures.has(b2.nature));
5539
5488
  });
5540
5489
  const cutMap = /* @__PURE__ */ new Map();
5541
5490
  for (const intersection of intersections) {
@@ -5648,7 +5597,7 @@ function isAnyFaceOverlappingBoundary(viewVertex, camera) {
5648
5597
  }
5649
5598
  }
5650
5599
  if (farthestHalfedge && otherVertex) {
5651
- const c = camera.position;
5600
+ const c2 = camera.position;
5652
5601
  const p = vertex.position;
5653
5602
  const e = otherVertex.position;
5654
5603
  const boundaryFace = farthestHalfedge.twin.face;
@@ -5657,7 +5606,7 @@ function isAnyFaceOverlappingBoundary(viewVertex, camera) {
5657
5606
  if (halfedge.face !== boundaryFace) {
5658
5607
  const q = halfedge.next.vertex.position;
5659
5608
  const r = halfedge.next.vertex.position;
5660
- if (!sameSide(p, q, r, c, e) && sameSide(c, p, q, e, r) && sameSide(c, p, r, e, q)) {
5609
+ if (!sameSide(p, q, r, c2, e) && sameSide(c2, p, q, e, r) && sameSide(c2, p, r, e, q)) {
5661
5610
  return true;
5662
5611
  }
5663
5612
  }
@@ -5757,7 +5706,7 @@ class Viewmap {
5757
5706
  };
5758
5707
  if (this.skipActions) res();
5759
5708
  else {
5760
- actions[idx].process().catch((_) => {
5709
+ actions[idx].process().catch((_2) => {
5761
5710
  }).then(res);
5762
5711
  }
5763
5712
  } else {
@@ -5892,18 +5841,18 @@ class Viewmap {
5892
5841
  return actions;
5893
5842
  }
5894
5843
  visibleChains() {
5895
- return this.chains.filter((c) => c.visibility === ChainVisibility.Visible);
5844
+ return this.chains.filter((c2) => c2.visibility === ChainVisibility.Visible);
5896
5845
  }
5897
5846
  hiddenChains() {
5898
- return this.chains.filter((c) => c.visibility === ChainVisibility.Hidden);
5847
+ return this.chains.filter((c2) => c2.visibility === ChainVisibility.Hidden);
5899
5848
  }
5900
5849
  }
5901
5850
  const methods$1 = {};
5902
5851
  const names = [];
5903
- function registerMethods(name, m3) {
5852
+ function registerMethods(name, m) {
5904
5853
  if (Array.isArray(name)) {
5905
5854
  for (const _name of name) {
5906
- registerMethods(_name, m3);
5855
+ registerMethods(_name, m);
5907
5856
  }
5908
5857
  return;
5909
5858
  }
@@ -5913,8 +5862,8 @@ function registerMethods(name, m3) {
5913
5862
  }
5914
5863
  return;
5915
5864
  }
5916
- addMethodNames(Object.getOwnPropertyNames(m3));
5917
- methods$1[name] = Object.assign(methods$1[name] || {}, m3);
5865
+ addMethodNames(Object.getOwnPropertyNames(m));
5866
+ methods$1[name] = Object.assign(methods$1[name] || {}, m);
5918
5867
  }
5919
5868
  function getMethodsFor(name) {
5920
5869
  return methods$1[name] || {};
@@ -5949,12 +5898,12 @@ function radians(d) {
5949
5898
  return d % 360 * Math.PI / 180;
5950
5899
  }
5951
5900
  function camelCase(s) {
5952
- return s.toLowerCase().replace(/-(.)/g, function(m3, g) {
5901
+ return s.toLowerCase().replace(/-(.)/g, function(m, g) {
5953
5902
  return g.toUpperCase();
5954
5903
  });
5955
5904
  }
5956
5905
  function unCamelCase(s) {
5957
- return s.replace(/([A-Z])/g, function(m3, g) {
5906
+ return s.replace(/([A-Z])/g, function(m, g) {
5958
5907
  return "-" + g.toLowerCase();
5959
5908
  });
5960
5909
  }
@@ -6203,8 +6152,8 @@ function addClass(name) {
6203
6152
  }
6204
6153
  function removeClass(name) {
6205
6154
  if (this.hasClass(name)) {
6206
- this.attr("class", this.classes().filter(function(c) {
6207
- return c !== name;
6155
+ this.attr("class", this.classes().filter(function(c2) {
6156
+ return c2 !== name;
6208
6157
  }).join(" "));
6209
6158
  }
6210
6159
  return this;
@@ -6294,15 +6243,15 @@ function data(a, v2, r) {
6294
6243
  registerMethods("Dom", {
6295
6244
  data
6296
6245
  });
6297
- function remember(k, v2) {
6246
+ function remember(k3, v2) {
6298
6247
  if (typeof arguments[0] === "object") {
6299
- for (const key in k) {
6300
- this.remember(key, k[key]);
6248
+ for (const key in k3) {
6249
+ this.remember(key, k3[key]);
6301
6250
  }
6302
6251
  } else if (arguments.length === 1) {
6303
- return this.memory()[k];
6252
+ return this.memory()[k3];
6304
6253
  } else {
6305
- this.memory()[k] = v2;
6254
+ this.memory()[k3] = v2;
6306
6255
  }
6307
6256
  return this;
6308
6257
  }
@@ -6341,7 +6290,7 @@ function is(object, space) {
6341
6290
  }
6342
6291
  return true;
6343
6292
  }
6344
- function getParameters(a, b) {
6293
+ function getParameters(a, b2) {
6345
6294
  const params = is(a, "rgb") ? {
6346
6295
  _a: a.r,
6347
6296
  _b: a.g,
@@ -6384,7 +6333,7 @@ function getParameters(a, b) {
6384
6333
  _c: 0,
6385
6334
  space: "rgb"
6386
6335
  };
6387
- params.space = b || params.space;
6336
+ params.space = b2 || params.space;
6388
6337
  return params;
6389
6338
  }
6390
6339
  function cieSpace(space) {
@@ -6426,40 +6375,40 @@ class Color {
6426
6375
  } = Math;
6427
6376
  if (mode === "vibrant") {
6428
6377
  const l = (81 - 57) * random() + 57;
6429
- const c = (83 - 45) * random() + 45;
6430
- const h = 360 * random();
6431
- const color = new Color(l, c, h, "lch");
6378
+ const c2 = (83 - 45) * random() + 45;
6379
+ const h2 = 360 * random();
6380
+ const color = new Color(l, c2, h2, "lch");
6432
6381
  return color;
6433
6382
  } else if (mode === "sine") {
6434
6383
  t = t == null ? random() : t;
6435
6384
  const r = round2(80 * sin(2 * pi * t / 0.5 + 0.01) + 150);
6436
6385
  const g = round2(50 * sin(2 * pi * t / 0.5 + 4.6) + 200);
6437
- const b = round2(100 * sin(2 * pi * t / 0.5 + 2.3) + 150);
6438
- const color = new Color(r, g, b);
6386
+ const b2 = round2(100 * sin(2 * pi * t / 0.5 + 2.3) + 150);
6387
+ const color = new Color(r, g, b2);
6439
6388
  return color;
6440
6389
  } else if (mode === "pastel") {
6441
6390
  const l = (94 - 86) * random() + 86;
6442
- const c = (26 - 9) * random() + 9;
6443
- const h = 360 * random();
6444
- const color = new Color(l, c, h, "lch");
6391
+ const c2 = (26 - 9) * random() + 9;
6392
+ const h2 = 360 * random();
6393
+ const color = new Color(l, c2, h2, "lch");
6445
6394
  return color;
6446
6395
  } else if (mode === "dark") {
6447
6396
  const l = 10 + 10 * random();
6448
- const c = (125 - 75) * random() + 86;
6449
- const h = 360 * random();
6450
- const color = new Color(l, c, h, "lch");
6397
+ const c2 = (125 - 75) * random() + 86;
6398
+ const h2 = 360 * random();
6399
+ const color = new Color(l, c2, h2, "lch");
6451
6400
  return color;
6452
6401
  } else if (mode === "rgb") {
6453
6402
  const r = 255 * random();
6454
6403
  const g = 255 * random();
6455
- const b = 255 * random();
6456
- const color = new Color(r, g, b);
6404
+ const b2 = 255 * random();
6405
+ const color = new Color(r, g, b2);
6457
6406
  return color;
6458
6407
  } else if (mode === "lab") {
6459
6408
  const l = 100 * random();
6460
6409
  const a = 256 * random() - 128;
6461
- const b = 256 * random() - 128;
6462
- const color = new Color(l, a, b, "lab");
6410
+ const b2 = 256 * random() - 128;
6411
+ const color = new Color(l, a, b2, "lab");
6463
6412
  return color;
6464
6413
  } else if (mode === "grey") {
6465
6414
  const grey = 255 * random();
@@ -6479,15 +6428,15 @@ class Color {
6479
6428
  _b,
6480
6429
  _c
6481
6430
  } = this.rgb();
6482
- const [r, g, b] = [_a, _b, _c].map((v2) => v2 / 255);
6483
- const k = Math.min(1 - r, 1 - g, 1 - b);
6484
- if (k === 1) {
6431
+ const [r, g, b2] = [_a, _b, _c].map((v2) => v2 / 255);
6432
+ const k3 = Math.min(1 - r, 1 - g, 1 - b2);
6433
+ if (k3 === 1) {
6485
6434
  return new Color(0, 0, 0, 1, "cmyk");
6486
6435
  }
6487
- const c = (1 - r - k) / (1 - k);
6488
- const m3 = (1 - g - k) / (1 - k);
6489
- const y2 = (1 - b - k) / (1 - k);
6490
- const color = new Color(c, m3, y2, k, "cmyk");
6436
+ const c2 = (1 - r - k3) / (1 - k3);
6437
+ const m = (1 - g - k3) / (1 - k3);
6438
+ const y2 = (1 - b2 - k3) / (1 - k3);
6439
+ const color = new Color(c2, m, y2, k3, "cmyk");
6491
6440
  return color;
6492
6441
  }
6493
6442
  hsl() {
@@ -6496,18 +6445,18 @@ class Color {
6496
6445
  _b,
6497
6446
  _c
6498
6447
  } = this.rgb();
6499
- const [r, g, b] = [_a, _b, _c].map((v2) => v2 / 255);
6500
- const max2 = Math.max(r, g, b);
6501
- const min2 = Math.min(r, g, b);
6448
+ const [r, g, b2] = [_a, _b, _c].map((v2) => v2 / 255);
6449
+ const max2 = Math.max(r, g, b2);
6450
+ const min2 = Math.min(r, g, b2);
6502
6451
  const l = (max2 + min2) / 2;
6503
6452
  const isGrey = max2 === min2;
6504
6453
  const delta = max2 - min2;
6505
6454
  const s = isGrey ? 0 : l > 0.5 ? delta / (2 - max2 - min2) : delta / (max2 + min2);
6506
- const h = isGrey ? 0 : max2 === r ? ((g - b) / delta + (g < b ? 6 : 0)) / 6 : max2 === g ? ((b - r) / delta + 2) / 6 : max2 === b ? ((r - g) / delta + 4) / 6 : 0;
6507
- const color = new Color(360 * h, 100 * s, 100 * l, "hsl");
6455
+ const h2 = isGrey ? 0 : max2 === r ? ((g - b2) / delta + (g < b2 ? 6 : 0)) / 6 : max2 === g ? ((b2 - r) / delta + 2) / 6 : max2 === b2 ? ((r - g) / delta + 4) / 6 : 0;
6456
+ const color = new Color(360 * h2, 100 * s, 100 * l, "hsl");
6508
6457
  return color;
6509
6458
  }
6510
- init(a = 0, b = 0, c = 0, d = 0, space = "rgb") {
6459
+ init(a = 0, b2 = 0, c2 = 0, d = 0, space = "rgb") {
6511
6460
  a = !a ? 0 : a;
6512
6461
  if (this.space) {
6513
6462
  for (const component in this.space) {
@@ -6519,13 +6468,13 @@ class Color {
6519
6468
  d = typeof d === "string" ? 0 : d;
6520
6469
  Object.assign(this, {
6521
6470
  _a: a,
6522
- _b: b,
6523
- _c: c,
6471
+ _b: b2,
6472
+ _c: c2,
6524
6473
  _d: d,
6525
6474
  space
6526
6475
  });
6527
6476
  } else if (a instanceof Array) {
6528
- this.space = b || (typeof a[3] === "string" ? a[3] : a[4]) || "rgb";
6477
+ this.space = b2 || (typeof a[3] === "string" ? a[3] : a[4]) || "rgb";
6529
6478
  Object.assign(this, {
6530
6479
  _a: a[0],
6531
6480
  _b: a[1],
@@ -6533,7 +6482,7 @@ class Color {
6533
6482
  _d: a[3] || 0
6534
6483
  });
6535
6484
  } else if (a instanceof Object) {
6536
- const values2 = getParameters(a, b);
6485
+ const values2 = getParameters(a, b2);
6537
6486
  Object.assign(this, values2);
6538
6487
  } else if (typeof a === "string") {
6539
6488
  if (isRgb.test(a)) {
@@ -6600,23 +6549,23 @@ class Color {
6600
6549
  } = this.xyz();
6601
6550
  const l = 116 * y2 - 16;
6602
6551
  const a = 500 * (x2 - y2);
6603
- const b = 200 * (y2 - z);
6604
- const color = new Color(l, a, b, "lab");
6552
+ const b2 = 200 * (y2 - z);
6553
+ const color = new Color(l, a, b2, "lab");
6605
6554
  return color;
6606
6555
  }
6607
6556
  lch() {
6608
6557
  const {
6609
6558
  l,
6610
6559
  a,
6611
- b
6560
+ b: b2
6612
6561
  } = this.lab();
6613
- const c = Math.sqrt(a ** 2 + b ** 2);
6614
- let h = 180 * Math.atan2(b, a) / Math.PI;
6615
- if (h < 0) {
6616
- h *= -1;
6617
- h = 360 - h;
6562
+ const c2 = Math.sqrt(a ** 2 + b2 ** 2);
6563
+ let h2 = 180 * Math.atan2(b2, a) / Math.PI;
6564
+ if (h2 < 0) {
6565
+ h2 *= -1;
6566
+ h2 = 360 - h2;
6618
6567
  }
6619
- const color = new Color(l, c, h, "lch");
6568
+ const color = new Color(l, c2, h2, "lch");
6620
6569
  return color;
6621
6570
  }
6622
6571
  /*
@@ -6635,20 +6584,20 @@ class Color {
6635
6584
  let {
6636
6585
  l,
6637
6586
  a,
6638
- b: b2
6587
+ b: b3
6639
6588
  } = this;
6640
6589
  if (this.space === "lch") {
6641
6590
  const {
6642
- c,
6643
- h
6591
+ c: c2,
6592
+ h: h2
6644
6593
  } = this;
6645
6594
  const dToR = Math.PI / 180;
6646
- a = c * Math.cos(dToR * h);
6647
- b2 = c * Math.sin(dToR * h);
6595
+ a = c2 * Math.cos(dToR * h2);
6596
+ b3 = c2 * Math.sin(dToR * h2);
6648
6597
  }
6649
6598
  const yL = (l + 16) / 116;
6650
6599
  const xL = a / 500 + yL;
6651
- const zL = yL - b2 / 200;
6600
+ const zL = yL - b3 / 200;
6652
6601
  const ct = 16 / 116;
6653
6602
  const mx = 8856e-6;
6654
6603
  const nm = 7.787;
@@ -6663,16 +6612,16 @@ class Color {
6663
6612
  const bd = 31308e-7;
6664
6613
  const r = rU > bd ? 1.055 * pow(rU, 1 / 2.4) - 0.055 : 12.92 * rU;
6665
6614
  const g = gU > bd ? 1.055 * pow(gU, 1 / 2.4) - 0.055 : 12.92 * gU;
6666
- const b = bU > bd ? 1.055 * pow(bU, 1 / 2.4) - 0.055 : 12.92 * bU;
6667
- const color = new Color(255 * r, 255 * g, 255 * b);
6615
+ const b2 = bU > bd ? 1.055 * pow(bU, 1 / 2.4) - 0.055 : 12.92 * bU;
6616
+ const color = new Color(255 * r, 255 * g, 255 * b2);
6668
6617
  return color;
6669
6618
  } else if (this.space === "hsl") {
6670
6619
  let {
6671
- h,
6620
+ h: h2,
6672
6621
  s,
6673
6622
  l
6674
6623
  } = this;
6675
- h /= 360;
6624
+ h2 /= 360;
6676
6625
  s /= 100;
6677
6626
  l /= 100;
6678
6627
  if (s === 0) {
@@ -6682,22 +6631,22 @@ class Color {
6682
6631
  }
6683
6632
  const q = l < 0.5 ? l * (1 + s) : l + s - l * s;
6684
6633
  const p = 2 * l - q;
6685
- const r = 255 * hueToRgb(p, q, h + 1 / 3);
6686
- const g = 255 * hueToRgb(p, q, h);
6687
- const b = 255 * hueToRgb(p, q, h - 1 / 3);
6688
- const color = new Color(r, g, b);
6634
+ const r = 255 * hueToRgb(p, q, h2 + 1 / 3);
6635
+ const g = 255 * hueToRgb(p, q, h2);
6636
+ const b2 = 255 * hueToRgb(p, q, h2 - 1 / 3);
6637
+ const color = new Color(r, g, b2);
6689
6638
  return color;
6690
6639
  } else if (this.space === "cmyk") {
6691
6640
  const {
6692
- c,
6693
- m: m3,
6641
+ c: c2,
6642
+ m,
6694
6643
  y: y2,
6695
- k
6644
+ k: k3
6696
6645
  } = this;
6697
- const r = 255 * (1 - Math.min(1, c * (1 - k) + k));
6698
- const g = 255 * (1 - Math.min(1, m3 * (1 - k) + k));
6699
- const b = 255 * (1 - Math.min(1, y2 * (1 - k) + k));
6700
- const color = new Color(r, g, b);
6646
+ const r = 255 * (1 - Math.min(1, c2 * (1 - k3) + k3));
6647
+ const g = 255 * (1 - Math.min(1, m * (1 - k3) + k3));
6648
+ const b2 = 255 * (1 - Math.min(1, y2 * (1 - k3) + k3));
6649
+ const color = new Color(r, g, b2);
6701
6650
  return color;
6702
6651
  } else {
6703
6652
  return this;
@@ -6714,8 +6663,8 @@ class Color {
6714
6663
  return [_a, _b, _c, _d, space];
6715
6664
  }
6716
6665
  toHex() {
6717
- const [r, g, b] = this._clamped().map(componentHex);
6718
- return `#${r}${g}${b}`;
6666
+ const [r, g, b2] = this._clamped().map(componentHex);
6667
+ return `#${r}${g}${b2}`;
6719
6668
  }
6720
6669
  toRgb() {
6721
6670
  const [rV, gV, bV] = this._clamped();
@@ -6731,10 +6680,10 @@ class Color {
6731
6680
  _b: g255,
6732
6681
  _c: b255
6733
6682
  } = this.rgb();
6734
- const [r, g, b] = [r255, g255, b255].map((v2) => v2 / 255);
6683
+ const [r, g, b2] = [r255, g255, b255].map((v2) => v2 / 255);
6735
6684
  const rL = r > 0.04045 ? Math.pow((r + 0.055) / 1.055, 2.4) : r / 12.92;
6736
6685
  const gL = g > 0.04045 ? Math.pow((g + 0.055) / 1.055, 2.4) : g / 12.92;
6737
- const bL = b > 0.04045 ? Math.pow((b + 0.055) / 1.055, 2.4) : b / 12.92;
6686
+ const bL = b2 > 0.04045 ? Math.pow((b2 + 0.055) / 1.055, 2.4) : b2 / 12.92;
6738
6687
  const xU = (rL * 0.4124 + gL * 0.3576 + bL * 0.1805) / 0.95047;
6739
6688
  const yU = (rL * 0.2126 + gL * 0.7152 + bL * 0.0722) / 1;
6740
6689
  const zU = (rL * 0.0193 + gL * 0.1192 + bL * 0.9505) / 1.08883;
@@ -6796,28 +6745,28 @@ class Point {
6796
6745
  toArray() {
6797
6746
  return [this.x, this.y];
6798
6747
  }
6799
- transform(m3) {
6800
- return this.clone().transformO(m3);
6748
+ transform(m) {
6749
+ return this.clone().transformO(m);
6801
6750
  }
6802
6751
  // Transform point with matrix
6803
- transformO(m3) {
6804
- if (!Matrix.isMatrixLike(m3)) {
6805
- m3 = new Matrix(m3);
6752
+ transformO(m) {
6753
+ if (!Matrix.isMatrixLike(m)) {
6754
+ m = new Matrix(m);
6806
6755
  }
6807
6756
  const {
6808
6757
  x: x2,
6809
6758
  y: y2
6810
6759
  } = this;
6811
- this.x = m3.a * x2 + m3.c * y2 + m3.e;
6812
- this.y = m3.b * x2 + m3.d * y2 + m3.f;
6760
+ this.x = m.a * x2 + m.c * y2 + m.e;
6761
+ this.y = m.b * x2 + m.d * y2 + m.f;
6813
6762
  return this;
6814
6763
  }
6815
6764
  }
6816
6765
  function point(x2, y2) {
6817
6766
  return new Point(x2, y2).transformO(this.screenCTM().inverseO());
6818
6767
  }
6819
- function closeEnough(a, b, threshold) {
6820
- return Math.abs(b - a) < 1e-6;
6768
+ function closeEnough(a, b2, threshold) {
6769
+ return Math.abs(b2 - a) < 1e-6;
6821
6770
  }
6822
6771
  class Matrix {
6823
6772
  constructor(...args) {
@@ -6878,14 +6827,14 @@ class Matrix {
6878
6827
  // left matrix, right matrix, target matrix which is overwritten
6879
6828
  static matrixMultiply(l, r, o) {
6880
6829
  const a = l.a * r.a + l.c * r.b;
6881
- const b = l.b * r.a + l.d * r.b;
6882
- const c = l.a * r.c + l.c * r.d;
6830
+ const b2 = l.b * r.a + l.d * r.b;
6831
+ const c2 = l.a * r.c + l.c * r.d;
6883
6832
  const d = l.b * r.c + l.d * r.d;
6884
6833
  const e = l.e + l.a * r.e + l.c * r.f;
6885
6834
  const f = l.f + l.b * r.e + l.d * r.f;
6886
6835
  o.a = a;
6887
- o.b = b;
6888
- o.c = c;
6836
+ o.b = b2;
6837
+ o.c = c2;
6889
6838
  o.d = d;
6890
6839
  o.e = e;
6891
6840
  o.f = f;
@@ -6907,20 +6856,20 @@ class Matrix {
6907
6856
  // Decomposes this matrix into its affine parameters
6908
6857
  decompose(cx2 = 0, cy2 = 0) {
6909
6858
  const a = this.a;
6910
- const b = this.b;
6911
- const c = this.c;
6859
+ const b2 = this.b;
6860
+ const c2 = this.c;
6912
6861
  const d = this.d;
6913
6862
  const e = this.e;
6914
6863
  const f = this.f;
6915
- const determinant = a * d - b * c;
6864
+ const determinant = a * d - b2 * c2;
6916
6865
  const ccw = determinant > 0 ? 1 : -1;
6917
- const sx = ccw * Math.sqrt(a * a + b * b);
6918
- const thetaRad = Math.atan2(ccw * b, ccw * a);
6866
+ const sx = ccw * Math.sqrt(a * a + b2 * b2);
6867
+ const thetaRad = Math.atan2(ccw * b2, ccw * a);
6919
6868
  const theta = 180 / Math.PI * thetaRad;
6920
6869
  const ct = Math.cos(thetaRad);
6921
6870
  const st = Math.sin(thetaRad);
6922
- const lam = (a * c + b * d) / determinant;
6923
- const sy = c * sx / (lam * a - b) || d * sx / (lam * b + a);
6871
+ const lam = (a * c2 + b2 * d) / determinant;
6872
+ const sy = c2 * sx / (lam * a - b2) || d * sx / (lam * b2 + a);
6924
6873
  const tx = e - cx2 + cx2 * ct * sx + cy2 * (lam * ct * sx - st * sy);
6925
6874
  const ty = f - cy2 + cx2 * st * sx + cy2 * (lam * st * sx + ct * sy);
6926
6875
  return {
@@ -6973,16 +6922,16 @@ class Matrix {
6973
6922
  // Inverses matrix
6974
6923
  inverseO() {
6975
6924
  const a = this.a;
6976
- const b = this.b;
6977
- const c = this.c;
6925
+ const b2 = this.b;
6926
+ const c2 = this.c;
6978
6927
  const d = this.d;
6979
6928
  const e = this.e;
6980
6929
  const f = this.f;
6981
- const det = a * d - b * c;
6930
+ const det = a * d - b2 * c2;
6982
6931
  if (!det) throw new Error("Cannot invert " + this);
6983
6932
  const na = d / det;
6984
- const nb = -b / det;
6985
- const nc = -c / det;
6933
+ const nb = -b2 / det;
6934
+ const nc = -c2 / det;
6986
6935
  const nd = a / det;
6987
6936
  const ne = -(na * e + nc * f);
6988
6937
  const nf = -(nb * e + nd * f);
@@ -7021,16 +6970,16 @@ class Matrix {
7021
6970
  const sin = Math.sin(r);
7022
6971
  const {
7023
6972
  a,
7024
- b,
7025
- c,
6973
+ b: b2,
6974
+ c: c2,
7026
6975
  d,
7027
6976
  e,
7028
6977
  f
7029
6978
  } = this;
7030
- this.a = a * cos - b * sin;
7031
- this.b = b * cos + a * sin;
7032
- this.c = c * cos - d * sin;
7033
- this.d = d * cos + c * sin;
6979
+ this.a = a * cos - b2 * sin;
6980
+ this.b = b2 * cos + a * sin;
6981
+ this.c = c2 * cos - d * sin;
6982
+ this.d = d * cos + c2 * sin;
7034
6983
  this.e = e * cos - f * sin + cy2 * sin - cx2 * cos + cx2;
7035
6984
  this.f = f * cos + e * sin - cx2 * sin - cy2 * cos + cy2;
7036
6985
  return this;
@@ -7047,15 +6996,15 @@ class Matrix {
7047
6996
  }
7048
6997
  const {
7049
6998
  a,
7050
- b,
7051
- c,
6999
+ b: b2,
7000
+ c: c2,
7052
7001
  d,
7053
7002
  e,
7054
7003
  f
7055
7004
  } = this;
7056
7005
  this.a = a * x2;
7057
- this.b = b * y2;
7058
- this.c = c * x2;
7006
+ this.b = b2 * y2;
7007
+ this.c = c2 * x2;
7059
7008
  this.d = d * y2;
7060
7009
  this.e = e * x2 - cx2 * x2 + cx2;
7061
7010
  this.f = f * y2 - cy2 * y2 + cy2;
@@ -7068,14 +7017,14 @@ class Matrix {
7068
7017
  shearO(lx, cx2 = 0, cy2 = 0) {
7069
7018
  const {
7070
7019
  a,
7071
- b,
7072
- c,
7020
+ b: b2,
7021
+ c: c2,
7073
7022
  d,
7074
7023
  e,
7075
7024
  f
7076
7025
  } = this;
7077
- this.a = a + b * lx;
7078
- this.c = c + d * lx;
7026
+ this.a = a + b2 * lx;
7027
+ this.c = c2 + d * lx;
7079
7028
  this.e = e + f * lx - cy2 * lx;
7080
7029
  return this;
7081
7030
  }
@@ -7095,16 +7044,16 @@ class Matrix {
7095
7044
  const ly = Math.tan(y2);
7096
7045
  const {
7097
7046
  a,
7098
- b,
7099
- c,
7047
+ b: b2,
7048
+ c: c2,
7100
7049
  d,
7101
7050
  e,
7102
7051
  f
7103
7052
  } = this;
7104
- this.a = a + b * lx;
7105
- this.b = b + a * ly;
7106
- this.c = c + d * lx;
7107
- this.d = d + c * ly;
7053
+ this.a = a + b2 * lx;
7054
+ this.b = b2 + a * ly;
7055
+ this.c = c2 + d * lx;
7056
+ this.d = d + c2 * ly;
7108
7057
  this.e = e + f * lx - cy2 * lx;
7109
7058
  this.f = f + e * ly - cx2 * ly;
7110
7059
  return this;
@@ -7172,9 +7121,9 @@ function ctm() {
7172
7121
  function screenCTM() {
7173
7122
  if (typeof this.isRoot === "function" && !this.isRoot()) {
7174
7123
  const rect = this.rect(1, 1);
7175
- const m3 = rect.node.getScreenCTM();
7124
+ const m = rect.node.getScreenCTM();
7176
7125
  rect.remove();
7177
- return new Matrix(m3);
7126
+ return new Matrix(m);
7178
7127
  }
7179
7128
  return new Matrix(this.node.getScreenCTM());
7180
7129
  }
@@ -7192,8 +7141,8 @@ function parser() {
7192
7141
  };
7193
7142
  }
7194
7143
  if (!parser.nodes.svg.node.parentNode) {
7195
- const b = globals.document.body || globals.document.documentElement;
7196
- parser.nodes.svg.addTo(b);
7144
+ const b2 = globals.document.body || globals.document.documentElement;
7145
+ parser.nodes.svg.addTo(b2);
7197
7146
  }
7198
7147
  return parser.nodes;
7199
7148
  }
@@ -7247,9 +7196,9 @@ class Box {
7247
7196
  toString() {
7248
7197
  return this.x + " " + this.y + " " + this.width + " " + this.height;
7249
7198
  }
7250
- transform(m3) {
7251
- if (!(m3 instanceof Matrix)) {
7252
- m3 = new Matrix(m3);
7199
+ transform(m) {
7200
+ if (!(m instanceof Matrix)) {
7201
+ m = new Matrix(m);
7253
7202
  }
7254
7203
  let xMin = Infinity;
7255
7204
  let xMax = -Infinity;
@@ -7257,7 +7206,7 @@ class Box {
7257
7206
  let yMax = -Infinity;
7258
7207
  const pts = [new Point(this.x, this.y), new Point(this.x2, this.y), new Point(this.x, this.y2), new Point(this.x2, this.y2)];
7259
7208
  pts.forEach(function(p) {
7260
- p = p.transform(m3);
7209
+ p = p.transform(m);
7261
7210
  xMin = Math.min(xMin, p.x);
7262
7211
  xMax = Math.max(xMax, p.x);
7263
7212
  yMin = Math.min(yMin, p.y);
@@ -8024,8 +7973,8 @@ class Element extends Dom {
8024
7973
  reference(attr2) {
8025
7974
  attr2 = this.attr(attr2);
8026
7975
  if (!attr2) return null;
8027
- const m3 = (attr2 + "").match(reference);
8028
- return m3 ? makeInstance(m3[1]) : null;
7976
+ const m = (attr2 + "").match(reference);
7977
+ return m ? makeInstance(m[1]) : null;
8029
7978
  }
8030
7979
  // Get parent document
8031
7980
  root() {
@@ -8079,19 +8028,19 @@ const sugar = {
8079
8028
  return a === "color" ? t : t + "-" + a;
8080
8029
  }
8081
8030
  };
8082
- ["fill", "stroke"].forEach(function(m3) {
8031
+ ["fill", "stroke"].forEach(function(m) {
8083
8032
  const extension = {};
8084
8033
  let i;
8085
- extension[m3] = function(o) {
8034
+ extension[m] = function(o) {
8086
8035
  if (typeof o === "undefined") {
8087
- return this.attr(m3);
8036
+ return this.attr(m);
8088
8037
  }
8089
8038
  if (typeof o === "string" || o instanceof Color || Color.isRgb(o) || o instanceof Element) {
8090
- this.attr(m3, o);
8039
+ this.attr(m, o);
8091
8040
  } else {
8092
- for (i = sugar[m3].length - 1; i >= 0; i--) {
8093
- if (o[sugar[m3][i]] != null) {
8094
- this.attr(sugar.prefix(m3, sugar[m3][i]), o[sugar[m3][i]]);
8041
+ for (i = sugar[m].length - 1; i >= 0; i--) {
8042
+ if (o[sugar[m][i]] != null) {
8043
+ this.attr(sugar.prefix(m, sugar[m][i]), o[sugar[m][i]]);
8095
8044
  }
8096
8045
  }
8097
8046
  }
@@ -8101,11 +8050,11 @@ const sugar = {
8101
8050
  });
8102
8051
  registerMethods(["Element", "Runner"], {
8103
8052
  // Let the user set the matrix directly
8104
- matrix: function(mat, b, c, d, e, f) {
8053
+ matrix: function(mat, b2, c2, d, e, f) {
8105
8054
  if (mat == null) {
8106
8055
  return new Matrix(this);
8107
8056
  }
8108
- return this.attr("transform", new Matrix(mat, b, c, d, e, f));
8057
+ return this.attr("transform", new Matrix(mat, b2, c2, d, e, f));
8109
8058
  },
8110
8059
  // Map rotation to transform
8111
8060
  rotate: function(angle, cx2, cy2) {
@@ -8396,9 +8345,9 @@ class Gradient extends Container {
8396
8345
  super(nodeOrNew(type + "Gradient", typeof type === "string" ? null : type), attrs2);
8397
8346
  }
8398
8347
  // custom attr to handle transform
8399
- attr(a, b, c) {
8348
+ attr(a, b2, c2) {
8400
8349
  if (a === "transform") a = "gradientTransform";
8401
- return super.attr(a, b, c);
8350
+ return super.attr(a, b2, c2);
8402
8351
  }
8403
8352
  bbox() {
8404
8353
  return new Box();
@@ -8445,9 +8394,9 @@ class Pattern extends Container {
8445
8394
  super(nodeOrNew("pattern", node), attrs2);
8446
8395
  }
8447
8396
  // custom attr to handle transform
8448
- attr(a, b, c) {
8397
+ attr(a, b2, c2) {
8449
8398
  if (a === "transform") a = "patternTransform";
8450
- return super.attr(a, b, c);
8399
+ return super.attr(a, b2, c2);
8451
8400
  }
8452
8401
  bbox() {
8453
8402
  return new Box();
@@ -8610,18 +8559,18 @@ class PointArray extends SVGArray {
8610
8559
  }
8611
8560
  return array2.join(" ");
8612
8561
  }
8613
- transform(m3) {
8614
- return this.clone().transformO(m3);
8562
+ transform(m) {
8563
+ return this.clone().transformO(m);
8615
8564
  }
8616
8565
  // transform points with matrix (similar to Point.transform)
8617
- transformO(m3) {
8618
- if (!Matrix.isMatrixLike(m3)) {
8619
- m3 = new Matrix(m3);
8566
+ transformO(m) {
8567
+ if (!Matrix.isMatrixLike(m)) {
8568
+ m = new Matrix(m);
8620
8569
  }
8621
8570
  for (let i = this.length; i--; ) {
8622
8571
  const [x2, y2] = this[i];
8623
- this[i][0] = m3.a * x2 + m3.c * y2 + m3.e;
8624
- this[i][1] = m3.b * x2 + m3.d * y2 + m3.f;
8572
+ this[i][0] = m.a * x2 + m.c * y2 + m.e;
8573
+ this[i][1] = m.b * x2 + m.d * y2 + m.f;
8625
8574
  }
8626
8575
  return this;
8627
8576
  }
@@ -8634,12 +8583,12 @@ function y$2(y2) {
8634
8583
  return y2 == null ? this.bbox().y : this.move(this.bbox().x, y2);
8635
8584
  }
8636
8585
  function width$1(width2) {
8637
- const b = this.bbox();
8638
- return width2 == null ? b.width : this.size(width2, b.height);
8586
+ const b2 = this.bbox();
8587
+ return width2 == null ? b2.width : this.size(width2, b2.height);
8639
8588
  }
8640
8589
  function height$1(height2) {
8641
- const b = this.bbox();
8642
- return height2 == null ? b.height : this.size(b.width, height2);
8590
+ const b2 = this.bbox();
8591
+ return height2 == null ? b2.height : this.size(b2.width, height2);
8643
8592
  }
8644
8593
  var pointed = {
8645
8594
  __proto__: null,
@@ -8751,10 +8700,10 @@ registerMethods({
8751
8700
  }
8752
8701
  });
8753
8702
  register(Marker, "Marker");
8754
- function makeSetterGetter(k, f) {
8703
+ function makeSetterGetter(k3, f) {
8755
8704
  return function(v2) {
8756
- if (v2 == null) return this[k];
8757
- this[k] = v2;
8705
+ if (v2 == null) return this[k3];
8706
+ this[k3] = v2;
8758
8707
  if (f) f.call(this);
8759
8708
  return this;
8760
8709
  };
@@ -8845,11 +8794,11 @@ class Controller extends Stepper {
8845
8794
  super();
8846
8795
  this.stepper = fn;
8847
8796
  }
8848
- done(c) {
8849
- return c.done;
8797
+ done(c2) {
8798
+ return c2.done;
8850
8799
  }
8851
- step(current, target, dt, c) {
8852
- return this.stepper(current, target, dt, c);
8800
+ step(current, target, dt, c2) {
8801
+ return this.stepper(current, target, dt, c2);
8853
8802
  }
8854
8803
  }
8855
8804
  function recalculate() {
@@ -8868,19 +8817,19 @@ class Spring extends Controller {
8868
8817
  super();
8869
8818
  this.duration(duration).overshoot(overshoot);
8870
8819
  }
8871
- step(current, target, dt, c) {
8820
+ step(current, target, dt, c2) {
8872
8821
  if (typeof current === "string") return current;
8873
- c.done = dt === Infinity;
8822
+ c2.done = dt === Infinity;
8874
8823
  if (dt === Infinity) return target;
8875
8824
  if (dt === 0) return current;
8876
8825
  if (dt > 100) dt = 16;
8877
8826
  dt /= 1e3;
8878
- const velocity = c.velocity || 0;
8827
+ const velocity = c2.velocity || 0;
8879
8828
  const acceleration = -this.d * velocity - this.k * (current - target);
8880
8829
  const newPosition = current + velocity * dt + acceleration * dt * dt / 2;
8881
- c.velocity = velocity + acceleration * dt;
8882
- c.done = Math.abs(target - newPosition) + Math.abs(velocity) < 2e-3;
8883
- return c.done ? target : newPosition;
8830
+ c2.velocity = velocity + acceleration * dt;
8831
+ c2.done = Math.abs(target - newPosition) + Math.abs(velocity) < 2e-3;
8832
+ return c2.done ? target : newPosition;
8884
8833
  }
8885
8834
  }
8886
8835
  extend(Spring, {
@@ -8892,22 +8841,22 @@ class PID extends Controller {
8892
8841
  super();
8893
8842
  this.p(p).i(i).d(d).windup(windup);
8894
8843
  }
8895
- step(current, target, dt, c) {
8844
+ step(current, target, dt, c2) {
8896
8845
  if (typeof current === "string") return current;
8897
- c.done = dt === Infinity;
8846
+ c2.done = dt === Infinity;
8898
8847
  if (dt === Infinity) return target;
8899
8848
  if (dt === 0) return current;
8900
8849
  const p = target - current;
8901
- let i = (c.integral || 0) + p * dt;
8902
- const d = (p - (c.error || 0)) / dt;
8850
+ let i = (c2.integral || 0) + p * dt;
8851
+ const d = (p - (c2.error || 0)) / dt;
8903
8852
  const windup = this._windup;
8904
8853
  if (windup !== false) {
8905
8854
  i = Math.max(-windup, Math.min(i, windup));
8906
8855
  }
8907
- c.error = p;
8908
- c.integral = i;
8909
- c.done = Math.abs(p) < 1e-3;
8910
- return c.done ? target : current + (this.P * p + this.I * i + this.D * d);
8856
+ c2.error = p;
8857
+ c2.integral = i;
8858
+ c2.done = Math.abs(p) < 1e-3;
8859
+ return c2.done ? target : current + (this.P * p + this.I * i + this.D * d);
8911
8860
  }
8912
8861
  }
8913
8862
  extend(PID, {
@@ -8929,70 +8878,70 @@ const segmentParameters = {
8929
8878
  Z: 0
8930
8879
  };
8931
8880
  const pathHandlers = {
8932
- M: function(c, p, p0) {
8933
- p.x = p0.x = c[0];
8934
- p.y = p0.y = c[1];
8881
+ M: function(c2, p, p0) {
8882
+ p.x = p0.x = c2[0];
8883
+ p.y = p0.y = c2[1];
8935
8884
  return ["M", p.x, p.y];
8936
8885
  },
8937
- L: function(c, p) {
8938
- p.x = c[0];
8939
- p.y = c[1];
8940
- return ["L", c[0], c[1]];
8886
+ L: function(c2, p) {
8887
+ p.x = c2[0];
8888
+ p.y = c2[1];
8889
+ return ["L", c2[0], c2[1]];
8941
8890
  },
8942
- H: function(c, p) {
8943
- p.x = c[0];
8944
- return ["H", c[0]];
8891
+ H: function(c2, p) {
8892
+ p.x = c2[0];
8893
+ return ["H", c2[0]];
8945
8894
  },
8946
- V: function(c, p) {
8947
- p.y = c[0];
8948
- return ["V", c[0]];
8895
+ V: function(c2, p) {
8896
+ p.y = c2[0];
8897
+ return ["V", c2[0]];
8949
8898
  },
8950
- C: function(c, p) {
8951
- p.x = c[4];
8952
- p.y = c[5];
8953
- return ["C", c[0], c[1], c[2], c[3], c[4], c[5]];
8899
+ C: function(c2, p) {
8900
+ p.x = c2[4];
8901
+ p.y = c2[5];
8902
+ return ["C", c2[0], c2[1], c2[2], c2[3], c2[4], c2[5]];
8954
8903
  },
8955
- S: function(c, p) {
8956
- p.x = c[2];
8957
- p.y = c[3];
8958
- return ["S", c[0], c[1], c[2], c[3]];
8904
+ S: function(c2, p) {
8905
+ p.x = c2[2];
8906
+ p.y = c2[3];
8907
+ return ["S", c2[0], c2[1], c2[2], c2[3]];
8959
8908
  },
8960
- Q: function(c, p) {
8961
- p.x = c[2];
8962
- p.y = c[3];
8963
- return ["Q", c[0], c[1], c[2], c[3]];
8909
+ Q: function(c2, p) {
8910
+ p.x = c2[2];
8911
+ p.y = c2[3];
8912
+ return ["Q", c2[0], c2[1], c2[2], c2[3]];
8964
8913
  },
8965
- T: function(c, p) {
8966
- p.x = c[0];
8967
- p.y = c[1];
8968
- return ["T", c[0], c[1]];
8914
+ T: function(c2, p) {
8915
+ p.x = c2[0];
8916
+ p.y = c2[1];
8917
+ return ["T", c2[0], c2[1]];
8969
8918
  },
8970
- Z: function(c, p, p0) {
8919
+ Z: function(c2, p, p0) {
8971
8920
  p.x = p0.x;
8972
8921
  p.y = p0.y;
8973
8922
  return ["Z"];
8974
8923
  },
8975
- A: function(c, p) {
8976
- p.x = c[5];
8977
- p.y = c[6];
8978
- return ["A", c[0], c[1], c[2], c[3], c[4], c[5], c[6]];
8924
+ A: function(c2, p) {
8925
+ p.x = c2[5];
8926
+ p.y = c2[6];
8927
+ return ["A", c2[0], c2[1], c2[2], c2[3], c2[4], c2[5], c2[6]];
8979
8928
  }
8980
8929
  };
8981
8930
  const mlhvqtcsaz = "mlhvqtcsaz".split("");
8982
8931
  for (let i = 0, il = mlhvqtcsaz.length; i < il; ++i) {
8983
8932
  pathHandlers[mlhvqtcsaz[i]] = /* @__PURE__ */ function(i2) {
8984
- return function(c, p, p0) {
8985
- if (i2 === "H") c[0] = c[0] + p.x;
8986
- else if (i2 === "V") c[0] = c[0] + p.y;
8933
+ return function(c2, p, p0) {
8934
+ if (i2 === "H") c2[0] = c2[0] + p.x;
8935
+ else if (i2 === "V") c2[0] = c2[0] + p.y;
8987
8936
  else if (i2 === "A") {
8988
- c[5] = c[5] + p.x;
8989
- c[6] = c[6] + p.y;
8937
+ c2[5] = c2[5] + p.x;
8938
+ c2[6] = c2[6] + p.y;
8990
8939
  } else {
8991
- for (let j = 0, jl = c.length; j < jl; ++j) {
8992
- c[j] = c[j] + (j % 2 ? p.y : p.x);
8940
+ for (let j = 0, jl = c2.length; j < jl; ++j) {
8941
+ c2[j] = c2[j] + (j % 2 ? p.y : p.x);
8993
8942
  }
8994
8943
  }
8995
- return pathHandlers[i2](c, p, p0);
8944
+ return pathHandlers[i2](c2, p, p0);
8996
8945
  };
8997
8946
  }(mlhvqtcsaz[i].toUpperCase());
8998
8947
  }
@@ -9381,8 +9330,8 @@ TransformBag.defaults = {
9381
9330
  originX: 0,
9382
9331
  originY: 0
9383
9332
  };
9384
- const sortByKey = (a, b) => {
9385
- return a[0] < b[0] ? -1 : a[0] > b[0] ? 1 : 0;
9333
+ const sortByKey = (a, b2) => {
9334
+ return a[0] < b2[0] ? -1 : a[0] > b2[0] ? 1 : 0;
9386
9335
  };
9387
9336
  class ObjectBag {
9388
9337
  constructor(...args) {
@@ -9828,7 +9777,7 @@ class Timeline extends EventTarget {
9828
9777
  };
9829
9778
  this._lastRunnerId = runner.id;
9830
9779
  this._runners.push(runnerInfo);
9831
- this._runners.sort((a, b) => a.start - b.start);
9780
+ this._runners.sort((a, b2) => a.start - b2.start);
9832
9781
  this._runnerIds = this._runners.map((info) => info.runner.id);
9833
9782
  this.updateTime()._continue();
9834
9783
  return this;
@@ -9892,8 +9841,8 @@ class Timeline extends EventTarget {
9892
9841
  }
9893
9842
  this._lastStepTime = this._time;
9894
9843
  this.fire("time", this._time);
9895
- for (let k = this._runners.length; k--; ) {
9896
- const runnerInfo = this._runners[k];
9844
+ for (let k3 = this._runners.length; k3--; ) {
9845
+ const runnerInfo = this._runners[k3];
9897
9846
  const runner = runnerInfo.runner;
9898
9847
  const dtToStart = this._time - runnerInfo.start;
9899
9848
  if (dtToStart <= 0) {
@@ -10390,7 +10339,7 @@ registerMethods({
10390
10339
  }
10391
10340
  }
10392
10341
  });
10393
- const difference = (a, b) => a.filter((x2) => !b.includes(x2));
10342
+ const difference = (a, b2) => a.filter((x2) => !b2.includes(x2));
10394
10343
  extend(Runner, {
10395
10344
  attr(a, v2) {
10396
10345
  return this.styleAttr("attr", a, v2);
@@ -10625,9 +10574,9 @@ extend(Runner, {
10625
10574
  return this._queueNumber("height", height2);
10626
10575
  },
10627
10576
  // Add animatable plot
10628
- plot(a, b, c, d) {
10577
+ plot(a, b2, c2, d) {
10629
10578
  if (arguments.length === 4) {
10630
- return this.plot([a, b, c, d]);
10579
+ return this.plot([a, b2, c2, d]);
10631
10580
  }
10632
10581
  if (this._tryRetarget("plot", a)) return this;
10633
10582
  const morpher = new Morphable(this._stepper).type(this._element.MorphArray).to(a);
@@ -11038,8 +10987,8 @@ function dmove(dx2, dy2) {
11038
10987
  } catch (e) {
11039
10988
  return;
11040
10989
  }
11041
- const m3 = new Matrix(child);
11042
- const matrix = m3.translate(dx2, dy2).transform(m3.inverse());
10990
+ const m = new Matrix(child);
10991
+ const matrix = m.translate(dx2, dy2).transform(m.inverse());
11043
10992
  const p = new Point(bbox2.x, bbox2.y).transform(matrix);
11044
10993
  child.move(p.x, p.y);
11045
10994
  });
@@ -11392,7 +11341,7 @@ extend(Shape, {
11392
11341
  case "rect": {
11393
11342
  let {
11394
11343
  width: w,
11395
- height: h,
11344
+ height: h2,
11396
11345
  rx: rx2,
11397
11346
  ry: ry2,
11398
11347
  x: x2,
@@ -11403,17 +11352,17 @@ extend(Shape, {
11403
11352
  rx2 = rx2 || ry2;
11404
11353
  ry2 = ry2 || rx2;
11405
11354
  if (rx2 > w / 2) rx2 = w / 2;
11406
- if (ry2 > h / 2) ry2 = h / 2;
11355
+ if (ry2 > h2 / 2) ry2 = h2 / 2;
11407
11356
  if (rx2 && ry2) {
11408
11357
  d = [
11409
11358
  ["M", rx2 + x2, y2],
11410
11359
  ["h", w - 2 * rx2],
11411
11360
  ["a", rx2, ry2, 0, 0, 1, rx2, ry2],
11412
- ["v", h - 2 * ry2],
11361
+ ["v", h2 - 2 * ry2],
11413
11362
  ["a", rx2, ry2, 0, 0, 1, -rx2, ry2],
11414
11363
  ["h", -w + 2 * rx2],
11415
11364
  ["a", rx2, ry2, 0, 0, 1, -rx2, -ry2],
11416
- ["v", -h + 2 * ry2],
11365
+ ["v", -h2 + 2 * ry2],
11417
11366
  ["a", rx2, ry2, 0, 0, 1, rx2, -ry2],
11418
11367
  ["z"]
11419
11368
  ];
@@ -11421,9 +11370,9 @@ extend(Shape, {
11421
11370
  d = [
11422
11371
  ["M", x2, y2],
11423
11372
  ["h", w],
11424
- ["v", h],
11373
+ ["v", h2],
11425
11374
  ["h", -w],
11426
- ["v", -h],
11375
+ ["v", -h2],
11427
11376
  ["z"]
11428
11377
  ];
11429
11378
  }
@@ -11666,7 +11615,7 @@ class FillPass extends DrawPass {
11666
11615
  }
11667
11616
  }
11668
11617
  if (img) {
11669
- const patternAndImages = svg2.defs().children().filter((c) => c instanceof Pattern && c.children().length === 1).map((c) => [c, c.children()[0]]);
11618
+ const patternAndImages = svg2.defs().children().filter((c2) => c2 instanceof Pattern && c2.children().length === 1).map((c2) => [c2, c2.children()[0]]);
11670
11619
  patternAndImages.forEach(([pattern, image]) => {
11671
11620
  pattern.x(0);
11672
11621
  pattern.y(0);
@@ -11751,8 +11700,8 @@ class VisibleChainPass extends ChainPass {
11751
11700
  super(options);
11752
11701
  }
11753
11702
  async draw(svg2, viewmap) {
11754
- const chains = viewmap.chains.filter((c) => c.visibility === ChainVisibility.Visible);
11755
- const meshes = Array.from(viewmap.meshes).filter((m3) => m3.drawVisibleContours);
11703
+ const chains = viewmap.chains.filter((c2) => c2.visibility === ChainVisibility.Visible);
11704
+ const meshes = Array.from(viewmap.meshes).filter((m) => m.drawVisibleContours);
11756
11705
  const group = new G({ id: "visible-contours" });
11757
11706
  drawChains(group, meshes, chains, this.options);
11758
11707
  svg2.add(group);
@@ -11773,9 +11722,9 @@ class HiddenChainPass extends ChainPass {
11773
11722
  }
11774
11723
  async draw(svg2, viewmap) {
11775
11724
  const chains = viewmap.chains.filter(
11776
- (c) => c.visibility === ChainVisibility.Hidden
11725
+ (c2) => c2.visibility === ChainVisibility.Hidden
11777
11726
  );
11778
- const meshes = Array.from(viewmap.meshes).filter((m3) => m3.drawHiddenContours);
11727
+ const meshes = Array.from(viewmap.meshes).filter((m) => m.drawHiddenContours);
11779
11728
  const group = new G({ id: "hidden-contours" });
11780
11729
  svg2.add(group);
11781
11730
  drawChains(group, meshes, chains, this.options);
@@ -11788,13 +11737,13 @@ function drawChains(parent, meshes, chains, options) {
11788
11737
  (n1, n2) => (styles[n1].drawOrder ?? 0) - (styles[n2].drawOrder ?? 0)
11789
11738
  );
11790
11739
  for (const mesh of meshes) {
11791
- const objectChains = chains.filter((c) => c.object === mesh);
11740
+ const objectChains = chains.filter((c2) => c2.object === mesh);
11792
11741
  const objectGroup = new G({ id: mesh.name });
11793
11742
  parent.add(objectGroup);
11794
11743
  for (const nature of ViewEdgesNatures) {
11795
11744
  if ((_a = styles[nature]) == null ? void 0 : _a.enabled) {
11796
11745
  const strokeStyle = { ...defaultStyle, ...styles[nature] };
11797
- const natureChains = objectChains.filter((c) => c.nature === nature);
11746
+ const natureChains = objectChains.filter((c2) => c2.nature === nature);
11798
11747
  const natureGroup = new G({ id: nature });
11799
11748
  objectGroup.add(natureGroup);
11800
11749
  for (const chain of natureChains) {
@@ -11841,19 +11790,19 @@ function getLegend(options) {
11841
11790
  }
11842
11791
  const EPSILON = 1e-10;
11843
11792
  const _matrix = new Matrix4$1();
11844
- function orient3D(a, b, c, d) {
11793
+ function orient3D(a, b2, c2, d) {
11845
11794
  _matrix.set(
11846
11795
  a.x,
11847
11796
  a.y,
11848
11797
  a.z,
11849
11798
  1,
11850
- b.x,
11851
- b.y,
11852
- b.z,
11799
+ b2.x,
11800
+ b2.y,
11801
+ b2.z,
11853
11802
  1,
11854
- c.x,
11855
- c.y,
11856
- c.z,
11803
+ c2.x,
11804
+ c2.y,
11805
+ c2.z,
11857
11806
  1,
11858
11807
  d.x,
11859
11808
  d.y,
@@ -11863,13 +11812,13 @@ function orient3D(a, b, c, d) {
11863
11812
  const det = _matrix.determinant();
11864
11813
  if (det > EPSILON) {
11865
11814
  return 1;
11866
- } else if (det < -1e-10) {
11815
+ } else if (det < -EPSILON) {
11867
11816
  return -1;
11868
11817
  }
11869
11818
  return 0;
11870
11819
  }
11871
- function frontSide(a, b, c, d) {
11872
- return orient3D(d, b, c, a);
11820
+ function frontSide(a, b2, c2, d) {
11821
+ return orient3D(d, b2, c2, a);
11873
11822
  }
11874
11823
  const _u$1 = new Vector3$1();
11875
11824
  const _v = new Vector3$1();
@@ -12122,15 +12071,15 @@ function makeHalfedgesAdjacent(halfIn, halfOut) {
12122
12071
  if (!g) {
12123
12072
  return false;
12124
12073
  }
12125
- const b = halfIn.next;
12074
+ const b2 = halfIn.next;
12126
12075
  const d = halfOut.prev;
12127
- const h = g.next;
12076
+ const h2 = g.next;
12128
12077
  halfIn.next = halfOut;
12129
12078
  halfOut.prev = halfIn;
12130
- g.next = b;
12131
- b.prev = g;
12132
- d.next = h;
12133
- h.prev = d;
12079
+ g.next = b2;
12080
+ b2.prev = g;
12081
+ d.next = h2;
12082
+ h2.prev = d;
12134
12083
  return true;
12135
12084
  }
12136
12085
  const _u = new Vector3$1();
@@ -12400,10 +12349,10 @@ function cutFace(struct, face, v1, v2, createNewFace = true) {
12400
12349
  }
12401
12350
  let found = false;
12402
12351
  const loop = h1.nextLoop();
12403
- let h = loop.next();
12404
- while (!found && !h.done) {
12405
- found = h.value === h2;
12406
- h = loop.next();
12352
+ let h3 = loop.next();
12353
+ while (!found && !h3.done) {
12354
+ found = h3.value === h2;
12355
+ h3 = loop.next();
12407
12356
  }
12408
12357
  if (!found) {
12409
12358
  face.halfedge = h1;
@@ -12412,8 +12361,8 @@ function cutFace(struct, face, v1, v2, createNewFace = true) {
12412
12361
  newFace = new Face(h2);
12413
12362
  struct.faces.push(newFace);
12414
12363
  }
12415
- for (const h3 of h2.nextLoop()) {
12416
- h3.face = newFace;
12364
+ for (const h32 of h2.nextLoop()) {
12365
+ h32.face = newFace;
12417
12366
  }
12418
12367
  }
12419
12368
  return h1;
@@ -12421,22 +12370,22 @@ function cutFace(struct, face, v1, v2, createNewFace = true) {
12421
12370
  function splitEdge(struct, halfedge, position2, tolerance = 1e-10) {
12422
12371
  const twin = halfedge.twin;
12423
12372
  const A2 = halfedge.vertex;
12424
- const B = twin.vertex;
12373
+ const B2 = twin.vertex;
12425
12374
  if (A2.matchesPosition(position2, tolerance)) {
12426
12375
  return A2;
12427
12376
  }
12428
- if (B.matchesPosition(position2, tolerance)) {
12429
- return B;
12377
+ if (B2.matchesPosition(position2, tolerance)) {
12378
+ return B2;
12430
12379
  }
12431
12380
  const newVertex = new Vertex();
12432
12381
  newVertex.position.copy(position2);
12433
12382
  const newHalfedge = new Halfedge(newVertex);
12434
- const newTwin = new Halfedge(B);
12383
+ const newTwin = new Halfedge(B2);
12435
12384
  newHalfedge.twin = newTwin;
12436
12385
  newTwin.twin = newHalfedge;
12437
12386
  A2.halfedge = halfedge;
12438
12387
  newVertex.halfedge = newHalfedge;
12439
- B.halfedge = newTwin;
12388
+ B2.halfedge = newTwin;
12440
12389
  newHalfedge.face = halfedge.face;
12441
12390
  newTwin.face = twin.face;
12442
12391
  newHalfedge.next = halfedge.next;
@@ -12739,7 +12688,7 @@ function getRootIndexRanges(geo) {
12739
12688
  rangeBoundaries.add(Math.max(drawRangeStart, groupStart));
12740
12689
  rangeBoundaries.add(Math.min(drawRangeEnd, groupEnd));
12741
12690
  }
12742
- const sortedBoundaries = Array.from(rangeBoundaries.values()).sort((a, b) => a - b);
12691
+ const sortedBoundaries = Array.from(rangeBoundaries.values()).sort((a, b2) => a - b2);
12743
12692
  for (let i = 0; i < sortedBoundaries.length - 1; i++) {
12744
12693
  const start = sortedBoundaries[i];
12745
12694
  const end = sortedBoundaries[i + 1];
@@ -12755,7 +12704,7 @@ function hasGroupGaps(geometry) {
12755
12704
  return false;
12756
12705
  }
12757
12706
  const vertexCount = getTriCount(geometry);
12758
- const groups = getRootIndexRanges(geometry).sort((a, b) => a.offset - b.offset);
12707
+ const groups = getRootIndexRanges(geometry).sort((a, b2) => a.offset - b2.offset);
12759
12708
  const finalGroup = groups[groups.length - 1];
12760
12709
  finalGroup.count = Math.min(vertexCount - finalGroup.offset, finalGroup.count);
12761
12710
  let total = 0;
@@ -12853,22 +12802,22 @@ function computeTriangleBounds(geo, target = null, offset = null, count = null)
12853
12802
  ci = ci * stride + bufferOffset;
12854
12803
  }
12855
12804
  for (let el = 0; el < 3; el++) {
12856
- let a, b, c;
12805
+ let a, b2, c2;
12857
12806
  if (normalized) {
12858
12807
  a = posAttr[getters[el]](ai);
12859
- b = posAttr[getters[el]](bi);
12860
- c = posAttr[getters[el]](ci);
12808
+ b2 = posAttr[getters[el]](bi);
12809
+ c2 = posAttr[getters[el]](ci);
12861
12810
  } else {
12862
12811
  a = posArr[ai + el];
12863
- b = posArr[bi + el];
12864
- c = posArr[ci + el];
12812
+ b2 = posArr[bi + el];
12813
+ c2 = posArr[ci + el];
12865
12814
  }
12866
12815
  let min2 = a;
12867
- if (b < min2) min2 = b;
12868
- if (c < min2) min2 = c;
12816
+ if (b2 < min2) min2 = b2;
12817
+ if (c2 < min2) min2 = c2;
12869
12818
  let max2 = a;
12870
- if (b > max2) max2 = b;
12871
- if (c > max2) max2 = c;
12819
+ if (b2 > max2) max2 = b2;
12820
+ if (c2 > max2) max2 = c2;
12872
12821
  const halfExtents = (max2 - min2) / 2;
12873
12822
  const el2 = el * 2;
12874
12823
  triangleBounds[tri6 + el2 + 0] = min2 + halfExtents;
@@ -12901,15 +12850,15 @@ function getLongestEdgeIndex(bounds) {
12901
12850
  function copyBounds(source, target) {
12902
12851
  target.set(source);
12903
12852
  }
12904
- function unionBounds(a, b, target) {
12853
+ function unionBounds(a, b2, target) {
12905
12854
  let aVal, bVal;
12906
12855
  for (let d = 0; d < 3; d++) {
12907
12856
  const d3 = d + 3;
12908
12857
  aVal = a[d];
12909
- bVal = b[d];
12858
+ bVal = b2[d];
12910
12859
  target[d] = aVal < bVal ? aVal : bVal;
12911
12860
  aVal = a[d3];
12912
- bVal = b[d3];
12861
+ bVal = b2[d3];
12913
12862
  target[d3] = aVal > bVal ? aVal : bVal;
12914
12863
  }
12915
12864
  }
@@ -12934,7 +12883,7 @@ function computeSurfaceArea(bounds) {
12934
12883
  return 2 * (d0 * d1 + d1 * d2 + d2 * d0);
12935
12884
  }
12936
12885
  const BIN_COUNT = 32;
12937
- const binsSort = (a, b) => a.candidate - b.candidate;
12886
+ const binsSort = (a, b2) => a.candidate - b2.candidate;
12938
12887
  const sahBins = new Array(BIN_COUNT).fill().map(() => {
12939
12888
  return {
12940
12889
  count: 0,
@@ -12971,10 +12920,10 @@ function getOptimalSplit(nodeBoundingData, centroidBoundingData, triangleBounds,
12971
12920
  if (count < BIN_COUNT / 4) {
12972
12921
  const truncatedBins = [...sahBins];
12973
12922
  truncatedBins.length = count;
12974
- let b = 0;
12975
- for (let c = cStart; c < cEnd; c += 6, b++) {
12976
- const bin = truncatedBins[b];
12977
- bin.candidate = triangleBounds[c + 2 * a];
12923
+ let b2 = 0;
12924
+ for (let c2 = cStart; c2 < cEnd; c2 += 6, b2++) {
12925
+ const bin = truncatedBins[b2];
12926
+ bin.candidate = triangleBounds[c2 + 2 * a];
12978
12927
  bin.count = 0;
12979
12928
  const {
12980
12929
  bounds,
@@ -12989,7 +12938,7 @@ function getOptimalSplit(nodeBoundingData, centroidBoundingData, triangleBounds,
12989
12938
  bounds[d] = Infinity;
12990
12939
  bounds[d + 3] = -Infinity;
12991
12940
  }
12992
- expandByTriangleBounds(c, triangleBounds, bounds);
12941
+ expandByTriangleBounds(c2, triangleBounds, bounds);
12993
12942
  }
12994
12943
  truncatedBins.sort(binsSort);
12995
12944
  let splitCount = count;
@@ -13000,14 +12949,14 @@ function getOptimalSplit(nodeBoundingData, centroidBoundingData, triangleBounds,
13000
12949
  splitCount--;
13001
12950
  }
13002
12951
  }
13003
- for (let c = cStart; c < cEnd; c += 6) {
13004
- const center2 = triangleBounds[c + 2 * a];
12952
+ for (let c2 = cStart; c2 < cEnd; c2 += 6) {
12953
+ const center2 = triangleBounds[c2 + 2 * a];
13005
12954
  for (let bi = 0; bi < splitCount; bi++) {
13006
12955
  const bin = truncatedBins[bi];
13007
12956
  if (center2 >= bin.candidate) {
13008
- expandByTriangleBounds(c, triangleBounds, bin.rightCacheBounds);
12957
+ expandByTriangleBounds(c2, triangleBounds, bin.rightCacheBounds);
13009
12958
  } else {
13010
- expandByTriangleBounds(c, triangleBounds, bin.leftCacheBounds);
12959
+ expandByTriangleBounds(c2, triangleBounds, bin.leftCacheBounds);
13011
12960
  bin.count++;
13012
12961
  }
13013
12962
  }
@@ -13044,14 +12993,14 @@ function getOptimalSplit(nodeBoundingData, centroidBoundingData, triangleBounds,
13044
12993
  bounds[d + 3] = -Infinity;
13045
12994
  }
13046
12995
  }
13047
- for (let c = cStart; c < cEnd; c += 6) {
13048
- const triCenter = triangleBounds[c + 2 * a];
12996
+ for (let c2 = cStart; c2 < cEnd; c2 += 6) {
12997
+ const triCenter = triangleBounds[c2 + 2 * a];
13049
12998
  const relativeCenter = triCenter - axisLeft;
13050
12999
  let binIndex = ~~(relativeCenter / binWidth);
13051
13000
  if (binIndex >= BIN_COUNT) binIndex = BIN_COUNT - 1;
13052
13001
  const bin = sahBins[binIndex];
13053
13002
  bin.count++;
13054
- expandByTriangleBounds(c, triangleBounds, bin.bounds);
13003
+ expandByTriangleBounds(c2, triangleBounds, bin.bounds);
13055
13004
  }
13056
13005
  const lastBin = sahBins[BIN_COUNT - 1];
13057
13006
  copyBounds(lastBin.bounds, lastBin.rightCacheBounds);
@@ -13500,17 +13449,17 @@ const sphereIntersectTriangle = function() {
13500
13449
  const lineTemp = new Line3$1();
13501
13450
  return function sphereIntersectTriangle2(sphere, triangle3) {
13502
13451
  const { radius, center: center2 } = sphere;
13503
- const { a, b, c } = triangle3;
13452
+ const { a, b: b2, c: c2 } = triangle3;
13504
13453
  lineTemp.start = a;
13505
- lineTemp.end = b;
13454
+ lineTemp.end = b2;
13506
13455
  const closestPoint1 = lineTemp.closestPointToPoint(center2, true, closestPointTemp);
13507
13456
  if (closestPoint1.distanceTo(center2) <= radius) return true;
13508
13457
  lineTemp.start = a;
13509
- lineTemp.end = c;
13458
+ lineTemp.end = c2;
13510
13459
  const closestPoint2 = lineTemp.closestPointToPoint(center2, true, closestPointTemp);
13511
13460
  if (closestPoint2.distanceTo(center2) <= radius) return true;
13512
- lineTemp.start = b;
13513
- lineTemp.end = c;
13461
+ lineTemp.start = b2;
13462
+ lineTemp.end = c2;
13514
13463
  const closestPoint3 = lineTemp.closestPointToPoint(center2, true, closestPointTemp);
13515
13464
  if (closestPoint3.distanceTo(center2) <= radius) return true;
13516
13465
  const plane = triangle3.getPlane(planeTemp);
@@ -13543,8 +13492,8 @@ class ExtendedTriangle extends Triangle {
13543
13492
  }
13544
13493
  update() {
13545
13494
  const a = this.a;
13546
- const b = this.b;
13547
- const c = this.c;
13495
+ const b2 = this.b;
13496
+ const c2 = this.c;
13548
13497
  const points = this.points;
13549
13498
  const satAxes = this.satAxes;
13550
13499
  const satBounds = this.satBounds;
@@ -13554,15 +13503,15 @@ class ExtendedTriangle extends Triangle {
13554
13503
  sab0.setFromPoints(axis0, points);
13555
13504
  const axis1 = satAxes[1];
13556
13505
  const sab1 = satBounds[1];
13557
- axis1.subVectors(a, b);
13506
+ axis1.subVectors(a, b2);
13558
13507
  sab1.setFromPoints(axis1, points);
13559
13508
  const axis2 = satAxes[2];
13560
13509
  const sab2 = satBounds[2];
13561
- axis2.subVectors(b, c);
13510
+ axis2.subVectors(b2, c2);
13562
13511
  sab2.setFromPoints(axis2, points);
13563
13512
  const axis3 = satAxes[3];
13564
13513
  const sab3 = satBounds[3];
13565
- axis3.subVectors(c, a);
13514
+ axis3.subVectors(c2, a);
13566
13515
  sab3.setFromPoints(axis3, points);
13567
13516
  this.sphere.setFromPoints(this.points);
13568
13517
  this.plane.setFromNormalAndCoplanarPoint(axis0, a);
@@ -14326,28 +14275,28 @@ function checkIntersection(ray2, pA, pB, pC, point2, side) {
14326
14275
  point: point2.clone()
14327
14276
  };
14328
14277
  }
14329
- function checkBufferGeometryIntersection(ray2, position2, normal, uv, uv1, a, b, c, side) {
14278
+ function checkBufferGeometryIntersection(ray2, position2, normal, uv, uv1, a, b2, c2, side) {
14330
14279
  _vA.fromBufferAttribute(position2, a);
14331
- _vB.fromBufferAttribute(position2, b);
14332
- _vC.fromBufferAttribute(position2, c);
14280
+ _vB.fromBufferAttribute(position2, b2);
14281
+ _vC.fromBufferAttribute(position2, c2);
14333
14282
  const intersection = checkIntersection(ray2, _vA, _vB, _vC, _intersectionPoint, side);
14334
14283
  if (intersection) {
14335
14284
  if (uv) {
14336
14285
  _uvA.fromBufferAttribute(uv, a);
14337
- _uvB.fromBufferAttribute(uv, b);
14338
- _uvC.fromBufferAttribute(uv, c);
14286
+ _uvB.fromBufferAttribute(uv, b2);
14287
+ _uvC.fromBufferAttribute(uv, c2);
14339
14288
  intersection.uv = Triangle.getInterpolation(_intersectionPoint, _vA, _vB, _vC, _uvA, _uvB, _uvC, new Vector2());
14340
14289
  }
14341
14290
  if (uv1) {
14342
14291
  _uvA.fromBufferAttribute(uv1, a);
14343
- _uvB.fromBufferAttribute(uv1, b);
14344
- _uvC.fromBufferAttribute(uv1, c);
14292
+ _uvB.fromBufferAttribute(uv1, b2);
14293
+ _uvC.fromBufferAttribute(uv1, c2);
14345
14294
  intersection.uv1 = Triangle.getInterpolation(_intersectionPoint, _vA, _vB, _vC, _uvA, _uvB, _uvC, new Vector2());
14346
14295
  }
14347
14296
  if (normal) {
14348
14297
  _normalA.fromBufferAttribute(normal, a);
14349
- _normalB.fromBufferAttribute(normal, b);
14350
- _normalC.fromBufferAttribute(normal, c);
14298
+ _normalB.fromBufferAttribute(normal, b2);
14299
+ _normalC.fromBufferAttribute(normal, c2);
14351
14300
  intersection.normal = Triangle.getInterpolation(_intersectionPoint, _vA, _vB, _vC, _normalA, _normalB, _normalC, new Vector3());
14352
14301
  if (intersection.normal.dot(ray2.direction) > 0) {
14353
14302
  intersection.normal.multiplyScalar(-1);
@@ -14355,8 +14304,8 @@ function checkBufferGeometryIntersection(ray2, position2, normal, uv, uv1, a, b,
14355
14304
  }
14356
14305
  const face = {
14357
14306
  a,
14358
- b,
14359
- c,
14307
+ b: b2,
14308
+ c: c2,
14360
14309
  normal: new Vector3(),
14361
14310
  materialIndex: 0
14362
14311
  };
@@ -14369,16 +14318,16 @@ function checkBufferGeometryIntersection(ray2, position2, normal, uv, uv1, a, b,
14369
14318
  function intersectTri(geo, side, ray2, tri, intersections) {
14370
14319
  const triOffset = tri * 3;
14371
14320
  let a = triOffset + 0;
14372
- let b = triOffset + 1;
14373
- let c = triOffset + 2;
14321
+ let b2 = triOffset + 1;
14322
+ let c2 = triOffset + 2;
14374
14323
  const index = geo.index;
14375
14324
  if (geo.index) {
14376
14325
  a = index.getX(a);
14377
- b = index.getX(b);
14378
- c = index.getX(c);
14326
+ b2 = index.getX(b2);
14327
+ c2 = index.getX(c2);
14379
14328
  }
14380
14329
  const { position: position2, normal, uv, uv1 } = geo.attributes;
14381
- const intersection = checkBufferGeometryIntersection(ray2, position2, normal, uv, uv1, a, b, c, side);
14330
+ const intersection = checkBufferGeometryIntersection(ray2, position2, normal, uv, uv1, a, b2, c2, side);
14382
14331
  if (intersection) {
14383
14332
  intersection.faceIndex = tri;
14384
14333
  if (intersections) intersections.push(intersection);
@@ -16146,7 +16095,7 @@ let ThreeSVGRendererPlugin = class extends AViewerPluginSync {
16146
16095
  this._meshes = /* @__PURE__ */ new Map();
16147
16096
  this._rendering = false;
16148
16097
  this._viewerListeners = {
16149
- postRender: (_) => {
16098
+ postRender: (_2) => {
16150
16099
  if (this.autoRender) this.render();
16151
16100
  }
16152
16101
  };
@@ -16377,39 +16326,39 @@ let ThreeSVGRendererPlugin = class extends AViewerPluginSync {
16377
16326
  ThreeSVGRendererPlugin.PluginType = "ThreeSVGRendererPlugin";
16378
16327
  ThreeSVGRendererPlugin.SVG_RENDER_TIMEOUT = 2e3;
16379
16328
  __decorateClass([
16380
- uiToggle$1(),
16329
+ uiToggle(),
16381
16330
  onChange(ThreeSVGRendererPlugin.prototype.setDirty)
16382
16331
  ], ThreeSVGRendererPlugin.prototype, "enabled", 2);
16383
16332
  __decorateClass([
16384
- uiToggle$1(),
16333
+ uiToggle(),
16385
16334
  onChange(ThreeSVGRendererPlugin.prototype.setDirty)
16386
16335
  ], ThreeSVGRendererPlugin.prototype, "autoRender", 2);
16387
16336
  __decorateClass([
16388
- uiToggle$1(),
16337
+ uiToggle(),
16389
16338
  onChange(ThreeSVGRendererPlugin.prototype.setDirty)
16390
16339
  ], ThreeSVGRendererPlugin.prototype, "drawPolygons", 2);
16391
16340
  __decorateClass([
16392
- uiToggle$1(),
16341
+ uiToggle(),
16393
16342
  onChange(ThreeSVGRendererPlugin.prototype.setDirty)
16394
16343
  ], ThreeSVGRendererPlugin.prototype, "drawPolygonFills", 2);
16395
16344
  __decorateClass([
16396
- uiToggle$1(),
16345
+ uiToggle(),
16397
16346
  onChange(ThreeSVGRendererPlugin.prototype.setDirty)
16398
16347
  ], ThreeSVGRendererPlugin.prototype, "drawPolygonStrokes", 2);
16399
16348
  __decorateClass([
16400
- uiToggle$1(),
16349
+ uiToggle(),
16401
16350
  onChange(ThreeSVGRendererPlugin.prototype.setDirty)
16402
16351
  ], ThreeSVGRendererPlugin.prototype, "drawImageFills", 2);
16403
16352
  __decorateClass([
16404
- uiToggle$1(),
16353
+ uiToggle(),
16405
16354
  onChange(ThreeSVGRendererPlugin.prototype.setDirty)
16406
16355
  ], ThreeSVGRendererPlugin.prototype, "drawVisibleContours", 2);
16407
16356
  __decorateClass([
16408
- uiToggle$1(),
16357
+ uiToggle(),
16409
16358
  onChange(ThreeSVGRendererPlugin.prototype.setDirty)
16410
16359
  ], ThreeSVGRendererPlugin.prototype, "drawHiddenContours", 2);
16411
16360
  __decorateClass([
16412
- uiToggle$1(),
16361
+ uiToggle(),
16413
16362
  onChange(ThreeSVGRendererPlugin.prototype.setDirty)
16414
16363
  ], ThreeSVGRendererPlugin.prototype, "alwaysUpdateMeshes", 2);
16415
16364
  __decorateClass([
@@ -16417,7 +16366,7 @@ __decorateClass([
16417
16366
  onChange(ThreeSVGRendererPlugin.prototype.setDirty)
16418
16367
  ], ThreeSVGRendererPlugin.prototype, "creaseAngle", 2);
16419
16368
  __decorateClass([
16420
- uiToggle$1(),
16369
+ uiToggle(),
16421
16370
  onChange(ThreeSVGRendererPlugin.prototype.setDirty)
16422
16371
  ], ThreeSVGRendererPlugin.prototype, "autoMakeSvgObjects", 2);
16423
16372
  __decorateClass([
@@ -16427,7 +16376,7 @@ __decorateClass([
16427
16376
  uiButton()
16428
16377
  ], ThreeSVGRendererPlugin.prototype, "download", 1);
16429
16378
  ThreeSVGRendererPlugin = __decorateClass([
16430
- uiFolderContainer$1("SVG Renderer")
16379
+ uiFolderContainer("SVG Renderer")
16431
16380
  ], ThreeSVGRendererPlugin);
16432
16381
  /**
16433
16382
  * @license