vim-web 0.3.44-dev.2 → 0.3.44-dev.20

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 (55) hide show
  1. package/dist/style.css +38 -1
  2. package/dist/types/core-viewers/ultra/index.d.ts +1 -1
  3. package/dist/types/core-viewers/ultra/viewer/camera.d.ts +2 -1
  4. package/dist/types/core-viewers/ultra/viewer/inputs/inputMouse.d.ts +6 -5
  5. package/dist/types/core-viewers/ultra/viewer/marshal.d.ts +0 -1
  6. package/dist/types/core-viewers/ultra/viewer/rpcClient.d.ts +1 -0
  7. package/dist/types/core-viewers/ultra/viewer/rpcSafeClient.d.ts +1 -0
  8. package/dist/types/core-viewers/ultra/viewer/sectionBox.d.ts +2 -5
  9. package/dist/types/core-viewers/ultra/viewer/selection.d.ts +2 -0
  10. package/dist/types/core-viewers/ultra/viewer/viewer.d.ts +2 -0
  11. package/dist/types/core-viewers/ultra/viewer/vimCollection.d.ts +4 -0
  12. package/dist/types/core-viewers/webgl/utils/threeUtils.d.ts +3 -0
  13. package/dist/types/core-viewers/webgl/viewer/gizmos/gizmos.d.ts +1 -1
  14. package/dist/types/core-viewers/webgl/viewer/gizmos/sectionBox/sectionBox.d.ts +1 -1
  15. package/dist/types/core-viewers/webgl/viewer/gizmos/sectionBox/sectionBoxHandle.d.ts +2 -0
  16. package/dist/types/react-viewers/bim/bimPanel.d.ts +3 -3
  17. package/dist/types/react-viewers/bim/bimTree.d.ts +2 -2
  18. package/dist/types/react-viewers/controlbar/controlBar.d.ts +6 -44
  19. package/dist/types/react-viewers/controlbar/controlBarButton.d.ts +3 -1
  20. package/dist/types/react-viewers/controlbar/controlBarIds.d.ts +29 -0
  21. package/dist/types/react-viewers/controlbar/controlBarSection.d.ts +2 -1
  22. package/dist/types/react-viewers/helpers/inputs.d.ts +2 -2
  23. package/dist/types/react-viewers/helpers/isolation.d.ts +2 -2
  24. package/dist/types/react-viewers/helpers/reactUtils.d.ts +39 -0
  25. package/dist/types/react-viewers/index.d.ts +1 -0
  26. package/dist/types/react-viewers/panels/axesPanel.d.ts +2 -2
  27. package/dist/types/react-viewers/panels/contextMenu.d.ts +2 -2
  28. package/dist/types/react-viewers/panels/icons.d.ts +7 -0
  29. package/dist/types/react-viewers/panels/sectionBoxPanel.d.ts +4 -0
  30. package/dist/types/react-viewers/state/cameraState.d.ts +22 -0
  31. package/dist/types/react-viewers/state/controlBarState.d.ts +64 -0
  32. package/dist/types/react-viewers/state/sectionBoxState.d.ts +30 -0
  33. package/dist/types/react-viewers/ultra/index.d.ts +2 -0
  34. package/dist/types/react-viewers/ultra/ultraCameraState.d.ts +2 -0
  35. package/dist/types/react-viewers/ultra/ultraComponent.d.ts +1 -7
  36. package/dist/types/react-viewers/ultra/ultraComponentRef.d.ts +36 -0
  37. package/dist/types/react-viewers/ultra/ultraControlBarState.d.ts +19 -0
  38. package/dist/types/react-viewers/ultra/ultraModal.d.ts +4 -0
  39. package/dist/types/react-viewers/ultra/ultraSectionBoxState.d.ts +3 -0
  40. package/dist/types/react-viewers/webgl/index.d.ts +0 -1
  41. package/dist/types/react-viewers/webgl/webglCameraState.d.ts +2 -0
  42. package/dist/types/react-viewers/webgl/webglComponentRef.d.ts +7 -2
  43. package/dist/types/react-viewers/webgl/webglSectionBoxState.d.ts +3 -0
  44. package/dist/vim-web.iife.js +999 -424
  45. package/dist/vim-web.iife.js.map +1 -1
  46. package/dist/vim-web.js +1000 -425
  47. package/dist/vim-web.js.map +1 -1
  48. package/package.json +1 -1
  49. package/dist/types/react-viewers/controlbar/controlBarCommands.d.ts +0 -4
  50. package/dist/types/react-viewers/controlbar/sectionBoxState.d.ts +0 -15
  51. package/dist/types/react-viewers/helpers/camera.d.ts +0 -37
  52. /package/dist/types/react-viewers/{controlbar → panels}/restOfScreen.d.ts +0 -0
  53. /package/dist/types/react-viewers/{controlbar → state}/fullScreenState.d.ts +0 -0
  54. /package/dist/types/react-viewers/{controlbar → state}/measureState.d.ts +0 -0
  55. /package/dist/types/react-viewers/{controlbar → state}/pointerState.d.ts +0 -0
@@ -45835,7 +45835,7 @@ void main() {
45835
45835
  }
45836
45836
  }
45837
45837
  class ElementMapping {
45838
- constructor(instances, instanceToElement, elementIds2, instanceMeshes) {
45838
+ constructor(instances, instanceToElement, elementIds, instanceMeshes) {
45839
45839
  __publicField(this, "_instanceToElement");
45840
45840
  __publicField(this, "_instanceMeshes");
45841
45841
  __publicField(this, "_elementToInstances");
@@ -45848,17 +45848,17 @@ void main() {
45848
45848
  this._elementToInstances = ElementMapping.invertMap(
45849
45849
  this._instanceToElement
45850
45850
  );
45851
- this._elementIds = elementIds2;
45852
- this._elementIdToElements = ElementMapping.invertArray(elementIds2);
45851
+ this._elementIds = elementIds;
45852
+ this._elementIdToElements = ElementMapping.invertArray(elementIds);
45853
45853
  this._instanceMeshes = instanceMeshes;
45854
45854
  }
45855
45855
  static async fromG3d(g3d2, bim) {
45856
45856
  const instanceToElement = await bim.node.getAllElementIndex();
45857
- const elementIds2 = await bim.element.getAllId();
45857
+ const elementIds = await bim.element.getAllId();
45858
45858
  return new ElementMapping(
45859
45859
  Array.from(g3d2.instanceNodes),
45860
45860
  instanceToElement,
45861
- elementIds2,
45861
+ elementIds,
45862
45862
  g3d2.instanceMeshes
45863
45863
  );
45864
45864
  }
@@ -50664,7 +50664,7 @@ void main() {
50664
50664
  }
50665
50665
  init(duration) {
50666
50666
  this.cancel();
50667
- this._duration = duration;
50667
+ this._duration = Math.max(duration, 0.01);
50668
50668
  this._clock.start();
50669
50669
  }
50670
50670
  cancel() {
@@ -50985,6 +50985,7 @@ void main() {
50985
50985
  * @returns {CameraMovement} The camera movement api.
50986
50986
  */
50987
50987
  lerp(duration = 1, force = false) {
50988
+ if (duration <= 0) return this.snap(force);
50988
50989
  this.stop();
50989
50990
  this._force = force;
50990
50991
  this._lerp.init(duration);
@@ -51886,10 +51887,10 @@ void main() {
51886
51887
  });
51887
51888
  __publicField(this, "onMouseUp", (event) => {
51888
51889
  event.stopImmediatePropagation();
51890
+ event.preventDefault();
51889
51891
  const btn = this.getButton(event);
51890
51892
  if (btn === this._buttonDown) return;
51891
51893
  this._viewer.gizmos.rectangle.visible = false;
51892
- event.preventDefault();
51893
51894
  if (!this._buttonDown) return;
51894
51895
  if (this.inputs.pointerActive === "rect" && this._hasMouseMoved && !this._hasCameraMoved) {
51895
51896
  this.onRectEnd();
@@ -51906,6 +51907,7 @@ void main() {
51906
51907
  this.inputs.pointerOverride = void 0;
51907
51908
  });
51908
51909
  __publicField(this, "onDoubleClick", (event) => {
51910
+ console.log("Double click");
51909
51911
  event.stopImmediatePropagation();
51910
51912
  this.onMouseClick(
51911
51913
  new Vector2(event.offsetX, event.offsetY),
@@ -52253,7 +52255,7 @@ void main() {
52253
52255
  }
52254
52256
  }
52255
52257
  onIdleAction(hit) {
52256
- if (!this._viewer.gizmos.section.interactive) {
52258
+ if (!this._viewer.gizmos.sectionBox.interactive) {
52257
52259
  this._viewer.selection.focus(hit == null ? void 0 : hit.object);
52258
52260
  }
52259
52261
  }
@@ -54811,12 +54813,12 @@ void main() {
54811
54813
  const xz = this.screenDist(this._lineX.position, this._lineZ.position);
54812
54814
  const yz = this.screenDist(this._lineY.position, this._lineZ.position);
54813
54815
  let conflicts = 0;
54814
- if (lx !== void 0 && lx < 0.1) conflicts++;
54815
- if (ly !== void 0 && ly < 0.1) conflicts++;
54816
- if (lz !== void 0 && lz < 0.1) conflicts++;
54817
- if (xy !== void 0 && xy < 0.1) conflicts++;
54818
- if (xz !== void 0 && xz < 0.1) conflicts++;
54819
- if (yz !== void 0 && yz < 0.1) conflicts++;
54816
+ if (lx !== void 0 && lx < 0.3) conflicts++;
54817
+ if (ly !== void 0 && ly < 0.3) conflicts++;
54818
+ if (lz !== void 0 && lz < 0.3) conflicts++;
54819
+ if (xy !== void 0 && xy < 0.3) conflicts++;
54820
+ if (xz !== void 0 && xz < 0.3) conflicts++;
54821
+ if (yz !== void 0 && yz < 0.3) conflicts++;
54820
54822
  const collapse2 = conflicts > 1;
54821
54823
  this._label.visible = collapse2;
54822
54824
  this._line.label.visible = !collapse2;
@@ -54846,6 +54848,7 @@ void main() {
54846
54848
  this._line.mesh.visible = false;
54847
54849
  this._line.label.visible = false;
54848
54850
  }
54851
+ this._label.visible = false;
54849
54852
  this._viewer.renderer.needsUpdate = true;
54850
54853
  }
54851
54854
  /**
@@ -54895,7 +54898,9 @@ void main() {
54895
54898
  * Disposes all resources.
54896
54899
  */
54897
54900
  dispose() {
54901
+ console.log("dispose");
54898
54902
  if (this._animId !== void 0) cancelAnimationFrame(this._animId);
54903
+ this._html.div.remove();
54899
54904
  this._viewer.renderer.remove(this._group);
54900
54905
  this._startMarker.dispose();
54901
54906
  this._endMarker.dispose();
@@ -55466,6 +55471,7 @@ void main() {
55466
55471
  __publicField(this, "_color");
55467
55472
  __publicField(this, "_highlightColor");
55468
55473
  __publicField(this, "_materials");
55474
+ __publicField(this, "_camera");
55469
55475
  __publicField(this, "_camSub");
55470
55476
  this._materials = [matAlways, matBehind];
55471
55477
  this._forward = new Vector3();
@@ -55478,15 +55484,18 @@ void main() {
55478
55484
  this.quaternion.setFromUnitVectors(new Vector3(0, -1, 0), this._forward);
55479
55485
  }
55480
55486
  trackCamera(camera2) {
55481
- const rescale = () => {
55482
- const size = camera2.frustrumSizeAt(this.position);
55483
- this.scale.set(size.x * 5e-3, size.x * 5e-3, size.x * 5e-3);
55484
- };
55485
- this._camSub = camera2.onMoved.subscribe(() => rescale());
55486
- rescale();
55487
+ this._camera = camera2;
55488
+ this.update();
55489
+ this._camSub = camera2.onMoved.subscribe(() => this.update());
55490
+ }
55491
+ update() {
55492
+ if (!this._camera) return;
55493
+ const size = this._camera.frustrumSizeAt(this.position);
55494
+ this.scale.set(size.x * 3e-3, size.x * 3e-3, size.x * 3e-3);
55487
55495
  }
55488
55496
  setPosition(position) {
55489
55497
  this.position.copy(position);
55498
+ this.update();
55490
55499
  }
55491
55500
  get forward() {
55492
55501
  return this._forward;
@@ -55644,6 +55653,9 @@ void main() {
55644
55653
  this.update();
55645
55654
  };
55646
55655
  this._inputs.onBoxConfirm = (box) => this._onBoxConfirm.dispatch(box);
55656
+ viewer.renderer.onBoxUpdated.subscribe(() => {
55657
+ this.fitBox(viewer.renderer.getBoundingBox());
55658
+ });
55647
55659
  this.clip = false;
55648
55660
  this.visible = false;
55649
55661
  this.interactive = false;
@@ -55744,6 +55756,7 @@ void main() {
55744
55756
  set visible(value) {
55745
55757
  if (value === this._visible) return;
55746
55758
  this._gizmos.visible = value;
55759
+ this._visible = value;
55747
55760
  if (value) {
55748
55761
  this.update();
55749
55762
  }
@@ -55760,11 +55773,10 @@ void main() {
55760
55773
  * @param box - The bounding box to match (required).
55761
55774
  * @param padding - The scalar amount by which to expand the bounding box. Default is `1`.
55762
55775
  */
55763
- fitBox(box, padding = 1) {
55776
+ fitBox(box) {
55764
55777
  if (!box) return;
55765
- const b = box.expandByScalar(padding);
55766
- this._gizmos.fitBox(b);
55767
- this.renderer.section.fitBox(b);
55778
+ this._gizmos.fitBox(box);
55779
+ this.renderer.section.fitBox(box);
55768
55780
  this._onBoxConfirm.dispatch(this.box);
55769
55781
  this.renderer.needsUpdate = true;
55770
55782
  }
@@ -55774,7 +55786,7 @@ void main() {
55774
55786
  * Call this if the renderer's section box is changed by code outside this class.
55775
55787
  */
55776
55788
  update() {
55777
- this.fitBox(this.section.box, 0);
55789
+ this.fitBox(this.section.box);
55778
55790
  this.renderer.needsUpdate = true;
55779
55791
  }
55780
55792
  /**
@@ -55796,7 +55808,7 @@ void main() {
55796
55808
  /**
55797
55809
  * The section box gizmo.
55798
55810
  */
55799
- __publicField(this, "section");
55811
+ __publicField(this, "sectionBox");
55800
55812
  /**
55801
55813
  * The loading indicator gizmo.
55802
55814
  */
@@ -55820,7 +55832,7 @@ void main() {
55820
55832
  var _a2;
55821
55833
  this.viewer = viewer;
55822
55834
  this._measure = new Measure(viewer);
55823
- this.section = new SectionBox$1(viewer);
55835
+ this.sectionBox = new SectionBox$1(viewer);
55824
55836
  this.loading = new GizmoLoading(viewer);
55825
55837
  this.orbit = new GizmoOrbit(
55826
55838
  viewer.renderer,
@@ -55849,7 +55861,7 @@ void main() {
55849
55861
  var _a2;
55850
55862
  (_a2 = this.viewer.viewport.canvas.parentElement) == null ? void 0 : _a2.removeChild(this.axes.canvas);
55851
55863
  this._measure.clear();
55852
- this.section.dispose();
55864
+ this.sectionBox.dispose();
55853
55865
  this.loading.dispose();
55854
55866
  this.orbit.dispose();
55855
55867
  this.rectangle.dispose();
@@ -57621,6 +57633,36 @@ void main() {
57621
57633
  }
57622
57634
  return Math.min(Math.max(value, min2), max2);
57623
57635
  }
57636
+ class CaptureStateMachine {
57637
+ constructor(canvas) {
57638
+ __publicField(this, "_canvas");
57639
+ __publicField(this, "state");
57640
+ __publicField(this, "id");
57641
+ this._canvas = canvas;
57642
+ this.state = "none";
57643
+ this.id = -1;
57644
+ }
57645
+ onPointerDown(event) {
57646
+ if (this.state === "captured") {
57647
+ this._canvas.releasePointerCapture(this.id);
57648
+ }
57649
+ this.id = event.pointerId;
57650
+ this.state = "captured";
57651
+ }
57652
+ onPointerMove(event) {
57653
+ if (this.state === "capture") {
57654
+ this._canvas.setPointerCapture(this.id);
57655
+ this.state = "captured";
57656
+ }
57657
+ }
57658
+ onPointerUp(event) {
57659
+ if (this.state === "captured") {
57660
+ this._canvas.releasePointerCapture(this.id);
57661
+ this.state = "none";
57662
+ this.id = -1;
57663
+ }
57664
+ }
57665
+ }
57624
57666
  class InputMouse extends InputHandler {
57625
57667
  constructor(canvas, rpc, selection, camera2) {
57626
57668
  super();
@@ -57629,45 +57671,47 @@ void main() {
57629
57671
  __publicField(this, "_lastMouseDownPosition", new Vector2(0, 0));
57630
57672
  __publicField(this, "_selection");
57631
57673
  __publicField(this, "_camera");
57674
+ __publicField(this, "_capture");
57632
57675
  this._canvas = canvas;
57633
57676
  this._rpc = rpc;
57634
57677
  this._selection = selection;
57635
57678
  this._camera = camera2;
57679
+ this._capture = new CaptureStateMachine(canvas);
57636
57680
  }
57637
57681
  register() {
57638
57682
  this.reg(this._canvas, "pointerdown", (e) => {
57639
- this.handlePointerDown(e);
57683
+ this.onPointerDown(e);
57640
57684
  });
57641
57685
  this.reg(this._canvas, "pointerup", (e) => {
57642
- this.handlePointerUp(e);
57686
+ this.onPointerUp(e);
57643
57687
  });
57644
57688
  this.reg(this._canvas, "pointermove", (e) => {
57645
- this.handlePointerMove(e);
57689
+ this.onPointerMove(e);
57646
57690
  });
57647
57691
  this.reg(this._canvas, "wheel", (e) => {
57648
- this.handleMouseScroll(e);
57692
+ this.onMouseScroll(e);
57649
57693
  });
57650
57694
  this.reg(this._canvas, "dblclick", (e) => {
57651
- this.handleDoubleClick(e);
57695
+ this.onDoubleClick(e);
57652
57696
  });
57653
57697
  }
57654
57698
  dispose() {
57655
57699
  this.unregister();
57656
57700
  }
57657
- handlePointerDown(event) {
57701
+ onPointerDown(event) {
57658
57702
  if (event.pointerType !== "mouse") return;
57659
57703
  const pos = this.relativePosition(event);
57660
57704
  this._rpc.RPCMouseButtonEvent(pos, event.button, true);
57661
57705
  this._lastMouseDownPosition = pos;
57662
- this._canvas.setPointerCapture(event.pointerId);
57706
+ this._capture.onPointerDown(event);
57663
57707
  event.preventDefault();
57664
57708
  }
57665
- handlePointerUp(event) {
57709
+ onPointerUp(event) {
57666
57710
  if (event.pointerType !== "mouse") return;
57667
57711
  const pos = this.relativePosition(event);
57668
57712
  this._rpc.RPCMouseButtonEvent(pos, event.button, false);
57669
57713
  this.handleMouseClick(event);
57670
- this._canvas.releasePointerCapture(event.pointerId);
57714
+ this._capture.onPointerUp(event);
57671
57715
  event.preventDefault();
57672
57716
  }
57673
57717
  async handleMouseClick(event) {
@@ -57687,21 +57731,24 @@ void main() {
57687
57731
  this._selection.select(hit.vim, hit.nodeIndex);
57688
57732
  }
57689
57733
  }
57690
- handlePointerMove(event) {
57734
+ onPointerMove(event) {
57691
57735
  if (event.pointerType !== "mouse") return;
57692
57736
  this._canvas.focus();
57737
+ this._capture.onPointerMove(event);
57693
57738
  const pos = this.relativePosition(event);
57694
57739
  this._rpc.RPCMouseMoveEvent(pos);
57695
57740
  }
57696
- async handleDoubleClick(event) {
57741
+ async onDoubleClick(event) {
57697
57742
  const pos = this.relativePosition(event);
57698
57743
  const hit = await this._selection.hitTest(pos);
57699
57744
  if (hit) {
57700
57745
  this._camera.frameVim(hit.vim, [hit.nodeIndex], 1);
57746
+ } else {
57747
+ this._camera.frameAll(1);
57701
57748
  }
57702
57749
  event.preventDefault();
57703
57750
  }
57704
- handleMouseScroll(event) {
57751
+ onMouseScroll(event) {
57705
57752
  this._rpc.RPCMouseScrollEvent(Math.sign(event.deltaY));
57706
57753
  event.preventDefault();
57707
57754
  }
@@ -58009,7 +58056,6 @@ void main() {
58009
58056
  }
58010
58057
  // -------------------- SectionBox -------------------
58011
58058
  writeSectionBoxState(data2) {
58012
- this.writeBoolean(data2.enabled);
58013
58059
  this.writeBoolean(data2.visible);
58014
58060
  this.writeBoolean(data2.interactible);
58015
58061
  this.writeBoolean(data2.clip);
@@ -58165,13 +58211,11 @@ void main() {
58165
58211
  return new Segment(position, target);
58166
58212
  }
58167
58213
  readSectionBoxState() {
58168
- const enabled = this.readBoolean();
58169
58214
  const visible2 = this.readBoolean();
58170
58215
  const interactible = this.readBoolean();
58171
58216
  const clip = this.readBoolean();
58172
58217
  const box = this.readBox3();
58173
58218
  return {
58174
- enabled,
58175
58219
  visible: visible2,
58176
58220
  interactible,
58177
58221
  clip,
@@ -58290,6 +58334,12 @@ void main() {
58290
58334
  marshal.writeUInt(componentHandle);
58291
58335
  this._socket.sendRPC(marshal);
58292
58336
  }
58337
+ RPCEnableSectionBox(value) {
58338
+ const marshal = new Marshal();
58339
+ marshal.writeString("RPCEnableSectionBox");
58340
+ marshal.writeBoolean(value);
58341
+ this._socket.sendRPC(marshal);
58342
+ }
58293
58343
  async RPCFrameAll(blendTime) {
58294
58344
  const marshal = new Marshal();
58295
58345
  marshal.writeString("RPCFrameAll");
@@ -59133,6 +59183,9 @@ void main() {
59133
59183
  * SECTION BOX METHODS
59134
59184
  * Methods for controlling section box visibility and position.
59135
59185
  ******************************************************************************/
59186
+ RPCEnableSectionBox(enable) {
59187
+ this.rpc.RPCEnableSectionBox(enable);
59188
+ }
59136
59189
  RPCSetSectionBox(state) {
59137
59190
  this.rpc.RPCSetSectionBox(state);
59138
59191
  }
@@ -59675,15 +59728,19 @@ void main() {
59675
59728
  switch (event.key) {
59676
59729
  case "Escape":
59677
59730
  this._selection.clear();
59731
+ event.preventDefault();
59678
59732
  break;
59679
59733
  case "f":
59680
59734
  this.frameContext();
59735
+ event.preventDefault();
59681
59736
  break;
59682
59737
  case "Home":
59683
59738
  this._camera.restoreSavedPosition();
59739
+ event.preventDefault();
59684
59740
  break;
59685
59741
  case " ":
59686
59742
  this._inputs.mode = this._inputs.mode === InputMode.Orbit ? InputMode.Free : InputMode.Orbit;
59743
+ event.preventDefault();
59687
59744
  break;
59688
59745
  }
59689
59746
  }
@@ -60800,8 +60857,8 @@ Averrage Date/Second ${avgDataRatePS} kb
60800
60857
  if (nodes === "all") {
60801
60858
  this._rpc.RPCClearMaterialOverrides(this._handle);
60802
60859
  } else {
60803
- const ids = new Array(nodes.length).fill(MaterialHandles.Invalid);
60804
- this._rpc.RPCSetMaterialOverrides(this._handle, nodes, ids);
60860
+ const ids2 = new Array(nodes.length).fill(MaterialHandles.Invalid);
60861
+ this._rpc.RPCSetMaterialOverrides(this._handle, nodes, ids2);
60805
60862
  }
60806
60863
  }
60807
60864
  updateMap(nodes, state) {
@@ -61223,11 +61280,15 @@ Averrage Date/Second ${avgDataRatePS} kb
61223
61280
  * Handles camera initialization when connection is established
61224
61281
  */
61225
61282
  onConnect() {
61283
+ this.set(new Vector3(-1e3, 1e3, 1e3), new Vector3(0, 0, 0), 0);
61226
61284
  this.restoreLastPosition();
61227
61285
  }
61228
61286
  onCameraPose(pose) {
61229
61287
  this._lastPosition = pose;
61230
61288
  }
61289
+ set(position, target, blendTime = this._defaultBlendTime) {
61290
+ this._rpc.RPCSetCameraPosition(new Segment(position, target), blendTime);
61291
+ }
61231
61292
  /**
61232
61293
  * Pauses or resumes rendering
61233
61294
  * @param value - True to pause rendering, false to resume
@@ -61241,6 +61302,7 @@ Averrage Date/Second ${avgDataRatePS} kb
61241
61302
  * @returns Promise that resolves when the framing animation is complete
61242
61303
  */
61243
61304
  async frameAll(blendTime = this._defaultBlendTime) {
61305
+ console.log("Camera.frameAll");
61244
61306
  const segment = await this._rpc.RPCFrameAll(blendTime);
61245
61307
  this._savedPosition = this._savedPosition ?? segment;
61246
61308
  return segment;
@@ -61251,6 +61313,7 @@ Averrage Date/Second ${avgDataRatePS} kb
61251
61313
  * @param blendTime - Duration of the camera animation in seconds (defaults to 0.5)
61252
61314
  */
61253
61315
  async frameBox(box, blendTime = this._defaultBlendTime) {
61316
+ console.log("Camera.frameAll");
61254
61317
  const segment = await this._rpc.RPCFrameBox(box, blendTime);
61255
61318
  this._savedPosition = this._savedPosition ?? segment;
61256
61319
  return segment;
@@ -61283,10 +61346,14 @@ Averrage Date/Second ${avgDataRatePS} kb
61283
61346
  __publicField(this, "_rpc");
61284
61347
  __publicField(this, "_vims");
61285
61348
  __publicField(this, "_selectedNodes");
61349
+ __publicField(this, "_onValueChanged", new distExports$1.SignalDispatcher());
61286
61350
  this._rpc = rpc;
61287
61351
  this._vims = vims;
61288
61352
  this._selectedNodes = /* @__PURE__ */ new Map();
61289
61353
  }
61354
+ get onValueChanged() {
61355
+ return this._onValueChanged.asEvent();
61356
+ }
61290
61357
  /**
61291
61358
  * Gets the total number of selected nodes across all VIMs.
61292
61359
  * @returns The total count of selected nodes.
@@ -61355,12 +61422,17 @@ Averrage Date/Second ${avgDataRatePS} kb
61355
61422
  nodeSet = /* @__PURE__ */ new Set();
61356
61423
  this._selectedNodes.set(vim, nodeSet);
61357
61424
  }
61425
+ let changed = false;
61358
61426
  nodes.forEach((n) => {
61359
61427
  if (!nodeSet.has(n)) {
61360
61428
  nodeSet.add(n);
61361
61429
  vim.highlight([n]);
61430
+ changed = true;
61362
61431
  }
61363
61432
  });
61433
+ if (changed) {
61434
+ this._onValueChanged.dispatch();
61435
+ }
61364
61436
  }
61365
61437
  /**
61366
61438
  * Removes the specified node(s) from the current selection.
@@ -61372,27 +61444,37 @@ Averrage Date/Second ${avgDataRatePS} kb
61372
61444
  const nodeSet = this._selectedNodes.get(vim);
61373
61445
  if (!nodeSet) return;
61374
61446
  const nodes = Array.isArray(node) ? node : [node];
61447
+ let changed = false;
61375
61448
  nodes.forEach((n) => {
61376
61449
  if (nodeSet.has(n)) {
61377
61450
  nodeSet.delete(n);
61378
61451
  vim.removeHighlight([n], "visible");
61452
+ changed = true;
61379
61453
  }
61380
61454
  });
61381
61455
  if (nodeSet.size === 0) {
61382
61456
  this._selectedNodes.delete(vim);
61383
61457
  }
61458
+ if (changed) {
61459
+ this._onValueChanged.dispatch();
61460
+ }
61384
61461
  }
61385
61462
  /**
61386
61463
  * Clears all selections across all VIMs or for a specific VIM.
61387
61464
  * @param vim - Optional. If provided, only clears selections for the specified VIM.
61388
61465
  */
61389
61466
  clear(vim) {
61467
+ let changed = false;
61390
61468
  this._selectedNodes.forEach((nodes, v) => {
61391
61469
  if (vim === void 0 || v === vim) {
61392
61470
  v.removeHighlight(Array.from(nodes), "visible");
61471
+ changed = true;
61393
61472
  }
61394
61473
  });
61395
61474
  this._selectedNodes.clear();
61475
+ if (changed) {
61476
+ this._onValueChanged.dispatch();
61477
+ }
61396
61478
  }
61397
61479
  /**
61398
61480
  * Calculates the bounding box encompassing all selected nodes.
@@ -61421,8 +61503,12 @@ Averrage Date/Second ${avgDataRatePS} kb
61421
61503
  class VimCollection {
61422
61504
  constructor() {
61423
61505
  __publicField(this, "_vims");
61506
+ __publicField(this, "_onChanged", new distExports$1.SignalDispatcher());
61424
61507
  this._vims = [];
61425
61508
  }
61509
+ get onChanged() {
61510
+ return this._onChanged.asEvent();
61511
+ }
61426
61512
  get count() {
61427
61513
  return this._vims.length;
61428
61514
  }
@@ -61433,6 +61519,7 @@ Averrage Date/Second ${avgDataRatePS} kb
61433
61519
  add(vim) {
61434
61520
  if (!this._vims.some((v) => v.handle === vim.handle)) {
61435
61521
  this._vims.push(vim);
61522
+ this._onChanged.dispatch();
61436
61523
  }
61437
61524
  }
61438
61525
  /**
@@ -61440,7 +61527,11 @@ Averrage Date/Second ${avgDataRatePS} kb
61440
61527
  * @param vim - The Vim instance to remove.
61441
61528
  */
61442
61529
  remove(vim) {
61530
+ const count = this._vims.length;
61443
61531
  this._vims = this._vims.filter((v) => v.handle !== vim.handle);
61532
+ if (this._vims.length !== count) {
61533
+ this._onChanged.dispatch();
61534
+ }
61444
61535
  }
61445
61536
  /**
61446
61537
  * Gets a Vim instance by its handle.
@@ -61703,7 +61794,6 @@ Averrage Date/Second ${avgDataRatePS} kb
61703
61794
  }
61704
61795
  class SectionBox {
61705
61796
  constructor(rpc) {
61706
- __publicField(this, "_enabled", false);
61707
61797
  __publicField(this, "_visible", true);
61708
61798
  __publicField(this, "_interactible", true);
61709
61799
  __publicField(this, "_clip", true);
@@ -61722,6 +61812,7 @@ Averrage Date/Second ${avgDataRatePS} kb
61722
61812
  return this._animationFrame > 0;
61723
61813
  }
61724
61814
  async onConnect() {
61815
+ this._rpc.RPCEnableSectionBox(true);
61725
61816
  this.push();
61726
61817
  this._interval = setInterval(() => this.pull(), 1e3);
61727
61818
  }
@@ -61736,10 +61827,9 @@ Averrage Date/Second ${avgDataRatePS} kb
61736
61827
  if (this.needUpdate) return;
61737
61828
  const state = await this._rpc.RPCGetSectionBox();
61738
61829
  let changed = false;
61739
- if (state.enabled !== this._enabled || state.visible !== this._visible || state.interactible !== this._interactible || state.clip !== this._clip || state.box !== this._box) {
61830
+ if (state.visible !== this._visible || state.interactible !== this._interactible || state.clip !== this._clip || state.box !== this._box) {
61740
61831
  changed = true;
61741
61832
  }
61742
- this._enabled = state.enabled;
61743
61833
  this._visible = state.visible;
61744
61834
  this._interactible = state.interactible;
61745
61835
  this._clip = state.clip;
@@ -61750,20 +61840,12 @@ Averrage Date/Second ${avgDataRatePS} kb
61750
61840
  }
61751
61841
  async push() {
61752
61842
  await this._rpc.RPCSetSectionBox({
61753
- enabled: this._enabled,
61754
61843
  visible: this._visible,
61755
61844
  interactible: this._interactible,
61756
61845
  clip: this._clip,
61757
61846
  box: this._box
61758
61847
  });
61759
61848
  }
61760
- get enabled() {
61761
- return this._enabled;
61762
- }
61763
- set enabled(value) {
61764
- this._enabled = value;
61765
- this.scheduleUpdate();
61766
- }
61767
61849
  get visible() {
61768
61850
  return this._visible;
61769
61851
  }
@@ -61771,10 +61853,10 @@ Averrage Date/Second ${avgDataRatePS} kb
61771
61853
  this._visible = value;
61772
61854
  this.scheduleUpdate();
61773
61855
  }
61774
- get interactible() {
61856
+ get interactive() {
61775
61857
  return this._interactible;
61776
61858
  }
61777
- set interactible(value) {
61859
+ set interactive(value) {
61778
61860
  this._interactible = value;
61779
61861
  this.scheduleUpdate();
61780
61862
  }
@@ -61884,6 +61966,9 @@ Averrage Date/Second ${avgDataRatePS} kb
61884
61966
  get decoder() {
61885
61967
  return this._decoder;
61886
61968
  }
61969
+ get selection() {
61970
+ return this._selection;
61971
+ }
61887
61972
  /**
61888
61973
  * Gets the current URL to which the viewer is connected.
61889
61974
  * @returns The URL as a string, or undefined if not connected.
@@ -66514,6 +66599,31 @@ Averrage Date/Second ${avgDataRatePS} kb
66514
66599
  wrapper: "div",
66515
66600
  clickable: false
66516
66601
  }), _defineProperty(_class2, "supportedWrappers", ["div", "span"]), _defineProperty(_class2, "displayName", "ReactTooltip"), _class2)) || _class) || _class) || _class) || _class) || _class) || _class) || _class;
66602
+ function slidersHoriz({ height, width, fill: fill2, className }) {
66603
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { className, height, width, viewBox: "0 0 256 256", children: [
66604
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
66605
+ "path",
66606
+ {
66607
+ fill: fill2,
66608
+ d: "M24,74h111.163c6.293,15.258,21.308,26,38.837,26s32.543-10.742,38.837-26h19.163c8.836,0,16-7.164,16-16s-7.164-16-16-16h-19.163c-6.293-15.258-21.308-26-38.837-26s-32.543,10.742-38.837,26H24c-8.836,0-16,7.164-16,16s7.164,16,16,16Zm132.083-17.637c.014-.151,.031-.301,.048-.451,.05-.435,.116-.864,.197-1.289,.021-.11,.037-.222,.06-.331,.106-.503,.236-.998,.383-1.484,.046-.153,.1-.303,.15-.455,.116-.35,.242-.694,.379-1.033,.067-.167,.132-.336,.204-.5,.189-.433,.393-.859,.615-1.273,.092-.173,.196-.339,.294-.508,.15-.26,.305-.517,.467-.768,.133-.205,.268-.409,.409-.608,.147-.208,.302-.41,.458-.611,.28-.362,.572-.713,.878-1.053,.13-.146,.259-.293,.395-.435,.212-.221,.432-.435,.656-.645,.116-.109,.234-.215,.354-.321,.787-.703,1.634-1.338,2.535-1.896,.1-.062,.199-.123,.3-.182,.304-.181,.612-.356,.928-.519,2.464-1.27,5.25-2,8.208-2s5.744,.73,8.208,2c.315,.163,.624,.338,.928,.519,.101,.06,.201,.121,.3,.182,.901,.558,1.749,1.193,2.535,1.896,.119,.106,.238,.212,.354,.321,.224,.21,.443,.424,.656,.645,.135,.142,.264,.289,.395,.435,.306,.34,.599,.691,.878,1.053,.155,.202,.311,.403,.458,.611,.141,.199,.276,.403,.409,.608,.163,.251,.317,.508,.467,.768,.098,.169,.202,.335,.294,.508,.222,.415,.425,.84,.615,1.273,.072,.165,.137,.333,.204,.5,.137,.339,.263,.684,.379,1.033,.05,.151,.104,.301,.15,.455,.147,.487,.277,.981,.383,1.484,.023,.109,.039,.221,.06,.331,.081,.425,.147,.854,.197,1.289,.018,.15,.035,.3,.048,.451,.049,.54,.083,1.084,.083,1.637s-.034,1.097-.083,1.637c-.014,.151-.031,.301-.048,.451-.05,.435-.116,.864-.197,1.289-.021,.11-.037,.222-.06,.331-.106,.503-.236,.998-.383,1.484-.046,.153-.1,.303-.15,.455-.116,.35-.242,.694-.379,1.033-.067,.167-.132,.336-.204,.5-.189,.433-.393,.859-.615,1.273-.092,.173-.196,.339-.294,.508-.15,.26-.305,.517-.467,.768-.133,.205-.268,.409-.409,.608-.147,.208-.302,.41-.458,.611-.28,.362-.572,.713-.878,1.053-.13,.146-.259,.293-.395,.435-.212,.221-.432,.435-.656,.645-.116,.109-.234,.215-.354,.321-.787,.703-1.634,1.338-2.535,1.896-.1,.062-.199,.123-.3,.182-.304,.181-.612,.356-.928,.519-2.464,1.27-5.25,2-8.208,2s-5.744-.73-8.208-2c-.315-.163-.624-.338-.928-.519-.101-.06-.201-.121-.3-.182-.901-.558-1.749-1.193-2.535-1.896-.119-.106-.238-.212-.354-.321-.224-.21-.443-.424-.656-.645-.135-.142-.264-.289-.395-.435-.306-.34-.599-.691-.878-1.053-.155-.202-.311-.403-.458-.611-.141-.199-.276-.403-.409-.608-.163-.251-.317-.508-.467-.768-.098-.169-.202-.335-.294-.508-.222-.415-.425-.84-.615-1.273-.072-.165-.137-.333-.204-.5-.137-.339-.263-.684-.379-1.033-.05-.151-.104-.301-.15-.455-.147-.487-.277-.981-.383-1.484-.023-.109-.039-.221-.06-.331-.081-.425-.147-.854-.197-1.289-.018-.15-.035-.3-.048-.451-.049-.54-.083-1.084-.083-1.637s.034-1.097,.083-1.637Z"
66609
+ }
66610
+ ),
66611
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
66612
+ "path",
66613
+ {
66614
+ fill: fill2,
66615
+ d: "M232,112H120.837c-6.293-15.258-21.308-26-38.837-26s-32.543,10.742-38.837,26H24c-8.836,0-16,7.164-16,16s7.164,16,16,16h19.163c6.293,15.258,21.308,26,38.837,26s32.543-10.742,38.837-26h111.163c8.836,0,16-7.164,16-16s-7.164-16-16-16Zm-132.083,17.637c-.014,.151-.031,.301-.048,.451-.05,.435-.116,.864-.197,1.289-.021,.11-.037,.222-.06,.331-.106,.503-.236,.998-.383,1.484-.046,.153-.1,.303-.15,.455-.116,.35-.242,.694-.379,1.033-.067,.167-.132,.336-.204,.5-.189,.433-.393,.859-.615,1.273-.092,.173-.196,.339-.294,.508-.15,.26-.305,.517-.467,.768-.133,.205-.268,.409-.409,.608-.147,.208-.302,.41-.458,.611-.28,.362-.572,.713-.878,1.053-.13,.146-.259,.293-.395,.435-.212,.221-.432,.435-.656,.645-.116,.109-.234,.215-.354,.321-.787,.703-1.634,1.338-2.535,1.896-.1,.062-.199,.123-.3,.182-.304,.181-.612,.356-.928,.519-2.464,1.27-5.25,2-8.208,2s-5.744-.73-8.208-2c-.315-.163-.624-.338-.928-.519-.101-.06-.201-.121-.3-.182-.901-.558-1.749-1.193-2.535-1.896-.119-.106-.238-.212-.354-.321-.224-.21-.443-.424-.656-.645-.135-.142-.264-.289-.395-.435-.306-.34-.599-.691-.878-1.053-.155-.202-.311-.403-.458-.611-.141-.199-.276-.403-.409-.608-.163-.251-.317-.508-.467-.768-.098-.169-.202-.335-.294-.508-.222-.415-.425-.84-.615-1.273-.072-.165-.137-.333-.204-.5-.137-.339-.263-.684-.379-1.033-.05-.151-.104-.301-.15-.455-.147-.487-.277-.981-.383-1.484-.023-.109-.039-.221-.06-.331-.081-.425-.147-.854-.197-1.289-.018-.15-.035-.3-.048-.451-.049-.54-.083-1.084-.083-1.637s.034-1.097,.083-1.637c.014-.151,.031-.301,.048-.451,.05-.435,.116-.864,.197-1.289,.021-.11,.037-.222,.06-.331,.106-.503,.236-.998,.383-1.484,.046-.153,.1-.303,.15-.455,.116-.35,.242-.694,.379-1.033,.067-.167,.132-.336,.204-.5,.189-.433,.393-.859,.615-1.273,.092-.173,.196-.339,.294-.508,.15-.26,.305-.517,.467-.768,.133-.205,.268-.409,.409-.608,.147-.208,.302-.41,.458-.611,.28-.362,.572-.713,.878-1.053,.13-.146,.259-.293,.395-.435,.212-.221,.432-.435,.656-.645,.116-.109,.234-.215,.354-.321,.787-.703,1.634-1.338,2.535-1.896,.1-.062,.199-.123,.3-.182,.304-.181,.612-.356,.928-.519,2.464-1.27,5.25-2,8.208-2s5.744,.73,8.208,2c.315,.163,.624,.338,.928,.519,.101,.06,.201,.121,.3,.182,.901,.558,1.749,1.193,2.535,1.896,.119,.106,.238,.212,.354,.321,.224,.21,.443,.424,.656,.645,.135,.142,.264,.289,.395,.435,.306,.34,.599,.691,.878,1.053,.155,.202,.311,.403,.458,.611,.141,.199,.276,.403,.409,.608,.163,.251,.317,.508,.467,.768,.098,.169,.202,.335,.294,.508,.222,.415,.425,.84,.615,1.273,.072,.165,.137,.333,.204,.5,.137,.339,.263,.684,.379,1.033,.05,.151,.104,.301,.15,.455,.147,.487,.277,.981,.383,1.484,.023,.109,.039,.221,.06,.331,.081,.425,.147,.854,.197,1.289,.018,.15,.035,.3,.048,.451,.049,.54,.083,1.084,.083,1.637s-.034,1.097-.083,1.637Z"
66616
+ }
66617
+ ),
66618
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
66619
+ "path",
66620
+ {
66621
+ fill: fill2,
66622
+ d: "M232,182h-19.163c-6.293-15.258-21.308-26-38.837-26s-32.543,10.742-38.837,26H24c-8.836,0-16,7.164-16,16s7.164,16,16,16h111.163c6.293,15.258,21.308,26,38.837,26s32.543-10.742,38.837-26h19.163c8.836,0,16-7.164,16-16s-7.164-16-16-16Zm-40.083,17.637c-.014,.151-.031,.301-.048,.451-.05,.435-.116,.864-.197,1.289-.021,.11-.037,.222-.06,.331-.106,.503-.236,.998-.383,1.484-.046,.153-.1,.303-.15,.455-.116,.35-.242,.694-.379,1.033-.067,.167-.132,.336-.204,.5-.189,.433-.393,.859-.615,1.273-.092,.173-.196,.339-.294,.508-.15,.26-.305,.517-.467,.768-.133,.205-.268,.409-.409,.608-.147,.208-.302,.41-.458,.611-.28,.362-.572,.713-.878,1.053-.13,.146-.259,.293-.395,.435-.212,.221-.432,.435-.656,.645-.116,.109-.234,.215-.354,.321-.787,.703-1.634,1.338-2.535,1.896-.1,.062-.199,.123-.3,.182-.304,.181-.612,.356-.928,.519-2.464,1.27-5.25,2-8.208,2s-5.744-.73-8.208-2c-.315-.163-.624-.338-.928-.519-.101-.06-.201-.121-.3-.182-.901-.558-1.749-1.193-2.535-1.896-.119-.106-.238-.212-.354-.321-.224-.21-.443-.424-.656-.645-.135-.142-.264-.289-.395-.435-.306-.34-.599-.691-.878-1.053-.155-.202-.311-.403-.458-.611-.141-.199-.276-.403-.409-.608-.163-.251-.317-.508-.467-.768-.098-.169-.202-.335-.294-.508-.222-.415-.425-.84-.615-1.273-.072-.165-.137-.333-.204-.5-.137-.339-.263-.684-.379-1.033-.05-.151-.104-.301-.15-.455-.147-.487-.277-.981-.383-1.484-.023-.109-.039-.221-.06-.331-.081-.425-.147-.854-.197-1.289-.018-.15-.035-.3-.048-.451-.049-.54-.083-1.084-.083-1.637s.034-1.097,.083-1.637c.014-.151,.031-.301,.048-.451,.05-.435,.116-.864,.197-1.289,.021-.11,.037-.222,.06-.331,.106-.503,.236-.998,.383-1.484,.046-.153,.1-.303,.15-.455,.116-.35,.242-.694,.379-1.033,.067-.167,.132-.336,.204-.5,.189-.433,.393-.859,.615-1.273,.092-.173,.196-.339,.294-.508,.15-.26,.305-.517,.467-.768,.133-.205,.268-.409,.409-.608,.147-.208,.302-.41,.458-.611,.28-.362,.572-.713,.878-1.053,.13-.146,.259-.293,.395-.435,.212-.221,.432-.435,.656-.645,.116-.109,.234-.215,.354-.321,.787-.703,1.634-1.338,2.535-1.896,.1-.062,.199-.123,.3-.182,.304-.181,.612-.356,.928-.519,2.464-1.27,5.25-2,8.208-2s5.744,.73,8.208,2c.315,.163,.624,.338,.928,.519,.101,.06,.201,.121,.3,.182,.901,.558,1.749,1.193,2.535,1.896,.119,.106,.238,.212,.354,.321,.224,.21,.443,.424,.656,.645,.135,.142,.264,.289,.395,.435,.306,.34,.599,.691,.878,1.053,.155,.202,.311,.403,.458,.611,.141,.199,.276,.403,.409,.608,.163,.251,.317,.508,.467,.768,.098,.169,.202,.335,.294,.508,.222,.415,.425,.84,.615,1.273,.072,.165,.137,.333,.204,.5,.137,.339,.263,.684,.379,1.033,.05,.151,.104,.301,.15,.455,.147,.487,.277,.981,.383,1.484,.023,.109,.039,.221,.06,.331,.081,.425,.147,.854,.197,1.289,.018,.15,.035,.3,.048,.451,.049,.54,.083,1.084,.083,1.637s-.034,1.097-.083,1.637Z"
66623
+ }
66624
+ )
66625
+ ] });
66626
+ }
66517
66627
  function settings({ height, width, fill: fill2, className }) {
66518
66628
  return /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { className, height, width, viewBox: "0 0 256 256", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
66519
66629
  "path",
@@ -66758,6 +66868,25 @@ Averrage Date/Second ${avgDataRatePS} kb
66758
66868
  }
66759
66869
  );
66760
66870
  }
66871
+ function autoCamera({ height, width, fill: fill2 = "", className }) {
66872
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { className, height, width, viewBox: "0 0 256 256", children: [
66873
+ /* @__PURE__ */ jsxRuntimeExports.jsx("path", { fill: "none", d: "M0 0h256v256H0z" }),
66874
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
66875
+ "path",
66876
+ {
66877
+ fill: fill2,
66878
+ d: "M 242.35934,69.720521 V 192.19034 c 0,9.46501 -7.97359,15.37204 -14.35248,10.67406 l -39.68884,-29.41993 v 8.38267 c 0,25.1595 -15.90243,45.64407 -35.51391,45.64407 H 48.520099 C 28.90861,227.51727 13.006195,206.98664 13.006195,181.80411 V 80.187338 c 0,-25.159506 15.902415,-45.644066 35.513904,-45.644066 H 152.55325 c 19.57566,0 35.51392,20.4385 35.51392,45.644066 v 8.382665 L 227.756,59.150074 c 6.33409,-4.801607 14.60334,1.162981 14.60334,10.570447 z"
66879
+ }
66880
+ ),
66881
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
66882
+ "path",
66883
+ {
66884
+ fill: "white",
66885
+ d: "m 134.24221,179.28573 -6.38,-16.771 H 73.539201 l -6.38,17.135 c -2.492,6.684 -4.618,11.211 -6.38,13.581 -1.763,2.309 -4.649,3.464 -8.659,3.464 -3.403,0 -6.411,-1.246 -9.024,-3.737 -2.613,-2.492 -3.919,-5.317 -3.919,-8.477 0,-1.823 0.304,-3.706 0.911,-5.651 0.608,-1.944 1.611,-4.648 3.008,-8.112 l 34.18,-86.771005 c 0.972,-2.491 2.127,-5.469 3.463,-8.932 1.398,-3.525 2.856,-6.441 4.375,-8.75 1.58,-2.309 3.616,-4.163 6.107,-5.56 2.552005,-1.458 5.682005,-2.188 9.388009,-2.188 3.768,0 6.897,0.73 9.388,2.188 2.552,1.397 4.588,3.22 6.107,5.469 1.58,2.248 2.886,4.678 3.919,7.291 1.094,2.552 2.461,5.986 4.102,10.3 l 34.909,86.224005 c 2.734,6.562 4.101,11.332 4.101,14.31 0,3.099 -1.306,5.955 -3.919,8.568 -2.552,2.552 -5.651,3.828 -9.297,3.828 -2.126,0 -3.949,-0.395 -5.468,-1.185 -1.52,-0.729 -2.796,-1.732 -3.829,-3.008 -1.033,-1.337 -2.157,-3.342 -3.372,-6.016 -1.155,-2.734 -2.157,-5.134 -3.008,-7.2 z m -53.594009,-37.097 h 39.922009 l -20.143,-55.143005 z"
66886
+ }
66887
+ )
66888
+ ] });
66889
+ }
66761
66890
  function orbit({ height, width, fill: fill2 = "", className }) {
66762
66891
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { className, height, width, viewBox: "0 0 256 256", children: [
66763
66892
  /* @__PURE__ */ jsxRuntimeExports.jsx("path", { fill: "none", d: "M0 0h256v256H0z" }),
@@ -67048,6 +67177,60 @@ Averrage Date/Second ${avgDataRatePS} kb
67048
67177
  )
67049
67178
  ] });
67050
67179
  }
67180
+ function sectionBoxSettings({ height, width, fill: fill2, className }) {
67181
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { className, height, width, viewBox: "0 0 256 256", children: [
67182
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
67183
+ "path",
67184
+ {
67185
+ fill: fill2,
67186
+ d: "M 109.70368,2.190587 17.447731,55.710016 A 16.213,16.213 0 0 0 9.3632977,69.780402 L 9.6706253,176.28696 a 16.215,16.215 0 0 0 8.1654987,14.0235 l 95.269706,54.51732 c 1.35625,0.77609 3.04643,-0.20379 3.04192,-1.76478 L 115.79652,121.3395 221.23346,60.173007 c 1.35174,-0.783903 1.34611,-2.734895 -0.0101,-3.511985 L 125.95362,2.1436974 a 16.278,16.278 0 0 0 -16.24994,0.04689 z M 95.74464,211.51674 29.976783,173.88635 29.714025,82.825734 l 65.768857,37.630376 0.262761,91.06162 z m 9.95507,-107.77018 -65.766855,-37.629382 77.949835,-45.221114 65.76886,37.62938 -77.95084,45.221116 z"
67187
+ }
67188
+ ),
67189
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
67190
+ "path",
67191
+ {
67192
+ fill: fill2,
67193
+ d: "m 175.57713,226.38215 c -1.28316,3.98514 -5.40414,6.14971 -9.13315,4.86244 l -3.60809,-1.24739 c -3.76004,-1.29737 -5.86799,-5.60846 -4.70379,-9.64145 l 0.42438,-1.46966 c 0.96925,-3.3572 -0.3989,-7.74539 -3.07521,-9.81798 l -0.73032,-0.56682 c -2.66882,-2.0641 -7.02118,-2.10184 -9.7235,-0.0863 l -1.1842,0.8837 c -3.23919,2.42089 -7.76901,1.59565 -10.07644,-1.77642 l -2.23242,-3.26259 c -2.3254,-3.40131 -1.6226,-8.22657 1.51812,-10.73784 l 1.15669,-0.92571 c 2.63933,-2.1082 3.9555,-6.51288 2.93126,-9.86426 l -0.27844,-0.91558 c -1.01877,-3.33861 -4.52035,-6.09072 -7.821,-6.14815 l -1.44661,-0.0253 c -3.95551,-0.0693 -7.1652,-3.56724 -7.1652,-7.7374 v -4.03725 c 0,-4.20531 3.2372,-7.66991 7.1652,-7.73745 l 1.44661,-0.0251 c 3.30016,-0.0568 6.79826,-2.79894 7.821,-6.14974 l 0.27844,-0.91348 c 1.02023,-3.33859 -0.29193,-7.75605 -2.93126,-9.86586 l -1.15669,-0.9241 c -3.16419,-2.52987 -3.82354,-7.3652 -1.51812,-10.73784 l 2.23242,-3.2647 c 2.32739,-3.39921 6.86326,-4.17603 10.07644,-1.77645 l 1.1842,0.88372 c 2.70232,2.01782 7.04471,1.98645 9.7235,-0.086 l 0.73032,-0.56467 c 2.66683,-2.06414 4.04446,-6.46083 3.07521,-9.81803 l -0.42438,-1.47176 c -1.1627,-4.02504 0.97525,-8.35208 4.70379,-9.63935 l 3.60809,-1.24738 c 3.76004,-1.299493 7.84798,0.87146 9.13315,4.86086 l 0.46987,1.4569 c 1.07175,3.32157 4.60331,6.0152 7.91546,6.0152 h 0.90232 c 3.30011,0 6.84321,-2.69363 7.91345,-6.0152 l 0.46988,-1.4569 c 1.28517,-3.98301 5.40663,-6.148123 9.13516,-4.86033 l 3.60808,1.24739 c 3.76006,1.29738 5.86803,5.60632 4.70383,9.63932 l -0.42441,1.47179 c -0.96925,3.35722 0.39893,7.7454 3.07522,9.81798 l 0.73029,0.56467 c 2.66883,2.06622 7.02122,2.10401 9.72154,0.0862 l 1.1842,-0.88369 c 3.23916,-2.41874 7.77099,-1.59353 10.0764,1.77644 l 2.23444,3.26469 c 2.32542,3.40132 1.62261,8.22656 -1.51812,10.73784 l -1.15667,0.92409 c -2.63936,2.11036 -3.95552,6.51504 -2.93328,9.86586 l 0.28043,0.91346 c 1.01873,3.34022 4.52035,6.09284 7.82101,6.14975 l 1.44514,0.0251 c 3.95749,0.0671 7.16516,3.56725 7.16516,7.73741 v 4.03729 c 0,4.20314 -3.23717,7.66987 -7.16516,7.73739 l -1.44514,0.0254 c -3.30016,0.0568 -6.79828,2.79678 -7.82101,6.14812 l -0.28043,0.91562 c -1.01872,3.33856 0.29392,7.75601 2.93328,9.86424 l 1.15667,0.92571 c 3.16422,2.52985 3.82355,7.36522 1.51812,10.73786 l -2.23444,3.26254 c -2.32537,3.40135 -6.86123,4.17815 -10.0764,1.77645 l -1.1842,-0.88373 c -2.70032,-2.01569 -7.04322,-1.98646 -9.72154,0.086 l -0.73029,0.56681 c -2.66683,2.06412 -4.04447,6.46079 -3.07522,9.81801 l 0.42441,1.46964 c 1.1627,4.02717 -0.97526,8.3542 -4.70383,9.64146 l -3.60808,1.24739 c -3.76002,1.29736 -7.84798,-0.87146 -9.13516,-4.86248 l -0.46988,-1.45474 c -1.06973,-3.32157 -4.60133,-6.01523 -7.91345,-6.01523 h -0.90232 c -3.30013,0 -6.84323,2.69366 -7.91546,6.01523 l -0.46987,1.45474 z m 8.83473,-24.33631 c 18.77473,0 33.99232,-16.18681 33.99232,-36.15723 0,-19.97043 -15.21759,-36.1551 -33.99232,-36.1551 -18.77467,0 -33.9903,16.18681 -33.9903,36.1551 0,19.96828 15.21761,36.15723 33.9903,36.15723 z"
67194
+ }
67195
+ )
67196
+ ] });
67197
+ }
67198
+ function sectionBoxAuto({ height, width, fill: fill2, className }) {
67199
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { className, height, width, viewBox: "0 0 256 256", children: [
67200
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
67201
+ "path",
67202
+ {
67203
+ fill: fill2,
67204
+ d: "M 109.70368,2.190587 17.447731,55.710016 A 16.213,16.213 0 0 0 9.3632977,69.780402 L 9.6706253,176.28696 a 16.215,16.215 0 0 0 8.1654987,14.0235 l 95.269706,54.51732 c 1.35625,0.77609 3.04643,-0.20379 3.04192,-1.76478 L 115.79652,121.3395 221.23346,60.173007 c 1.35174,-0.783903 1.34611,-2.734895 -0.0101,-3.511985 L 125.95362,2.1436974 a 16.278,16.278 0 0 0 -16.24994,0.04689 z M 95.74464,211.51674 29.976783,173.88635 29.714025,82.825734 l 65.768857,37.630376 0.262761,91.06162 z m 9.95507,-107.77018 -65.766855,-37.629382 77.949835,-45.221114 65.76886,37.62938 -77.95084,45.221116 z"
67205
+ }
67206
+ ),
67207
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
67208
+ "path",
67209
+ {
67210
+ fill: fill2,
67211
+ d: "M 221.207314 217.240532 L 214.827314 200.469532 L 160.504314 200.469532 L 154.124314 217.604532 C 151.632314 224.288532 149.506314 228.815532 147.744314 231.186532 C 145.981314 233.494532 143.095314 234.649532 139.085314 234.649532 C 135.682314 234.649532 132.674314 233.403532 130.061314 230.912532 C 127.448314 228.420532 126.142314 225.595532 126.142314 222.435532 C 126.142314 220.612532 126.446314 218.729532 127.053314 216.784532 C 127.661314 214.840532 128.664314 212.137532 130.061314 208.672532 L 164.241314 121.901532 C 165.213314 119.410532 166.368314 116.432532 167.704314 112.969532 C 169.102314 109.444532 170.560314 106.528532 172.079314 104.219532 C 173.659314 101.911532 175.695314 100.057532 178.186314 98.660532 C 180.738314 97.201532 183.868314 96.471532 187.574314 96.471532 C 191.342314 96.471532 194.471314 97.201532 196.962314 98.660532 C 199.514314 100.057532 201.550314 101.879532 203.069314 104.128532 C 204.649314 106.376532 205.955314 108.807532 206.988314 111.419532 C 208.082314 113.971532 209.449314 117.405532 211.090314 121.719532 L 245.999314 207.943532 C 248.733314 214.505532 250.100314 219.275532 250.100314 222.253532 C 250.100314 225.352532 248.794314 228.209532 246.181314 230.822532 C 243.629314 233.373532 240.530314 234.649532 236.884314 234.649532 C 234.758314 234.649532 232.935314 234.254532 231.416314 233.464532 C 229.896314 232.735532 228.620314 231.732532 227.587314 230.456532 C 226.554314 229.119532 225.430314 227.115532 224.215314 224.440532 C 223.060314 221.706532 222.058314 219.306532 221.207314 217.240532 Z M 167.613314 180.143532 L 207.535314 180.143532 L 187.392314 125.000532 Z"
67212
+ }
67213
+ )
67214
+ ] });
67215
+ }
67216
+ function sectionBoxVisible({ height, width, fill: fill2, className }) {
67217
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { className, height, width, viewBox: "0 0 256 256", children: [
67218
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
67219
+ "path",
67220
+ {
67221
+ fill: fill2,
67222
+ d: "M 109.70368,2.190587 17.447731,55.710016 A 16.213,16.213 0 0 0 9.3632977,69.780402 L 9.6706253,176.28696 a 16.215,16.215 0 0 0 8.1654987,14.0235 l 95.269706,54.51732 c 1.35625,0.77609 3.04643,-0.20379 3.04192,-1.76478 L 115.79652,121.3395 221.23346,60.173007 c 1.35174,-0.783903 1.34611,-2.734895 -0.0101,-3.511985 L 125.95362,2.1436974 a 16.278,16.278 0 0 0 -16.24994,0.04689 z M 95.74464,211.51674 29.976783,173.88635 29.714025,82.825734 l 65.768857,37.630376 0.262761,91.06162 z m 9.95507,-107.77018 -65.766855,-37.629382 77.949835,-45.221114 65.76886,37.62938 -77.95084,45.221116 z"
67223
+ }
67224
+ ),
67225
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
67226
+ "path",
67227
+ {
67228
+ fill: fill2,
67229
+ d: "m 186.05204,115.30607 c -37.93016,0 -68.67906,39.581 -68.67906,59.64313 0,21.35677 30.7489,59.64312 68.67906,59.64312 37.93016,0 68.67906,-38.28635 68.67906,-59.64312 0,-20.06213 -30.7489,-59.64313 -68.67906,-59.64313 z m 40.42729,85.41349 c -6.9441,6.83951 -21.43002,18.31368 -40.42729,18.31368 -18.99727,0 -33.48265,-11.47417 -40.42728,-18.31368 -11.61642,-11.4411 -15.37445,-22.30263 -15.37445,-25.77036 0,-0.0305 0.0381,-3.14164 3.35186,-9.36916 2.8652,-5.38603 7.15818,-11.06056 12.08697,-15.97917 3.66628,-3.65833 9.40099,-8.61065 16.72067,-12.50626 -6.58514,7.55977 -10.6973,18.2333 -10.6973,30.07505 0,22.91463 15.37445,41.49087 34.33953,41.49087 18.96508,0 34.33953,-18.57624 34.33953,-41.49087 0,-5.71277 -0.95614,-11.15521 -2.68492,-16.10818 -0.0445,9.9792 -6.75148,18.05306 -15.0214,18.05306 -8.26992,0 -15.02354,-8.12702 -15.02354,-18.15225 0,-8.97953 5.39774,-16.43168 12.48617,-17.88905 11.9346,3.73548 21.13062,11.40091 26.2676,16.52763 4.92879,4.91861 9.22177,10.59379 12.08697,15.97917 3.31377,6.22752 3.35186,9.33869 3.35186,9.36916 0,3.46773 -3.75803,14.32926 -15.37445,25.77036 z"
67230
+ }
67231
+ )
67232
+ ] });
67233
+ }
67051
67234
  function sectionBox({ height, width, fill: fill2, className }) {
67052
67235
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { className, height, width, viewBox: "0 0 256 256", children: [
67053
67236
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -67066,6 +67249,31 @@ Averrage Date/Second ${avgDataRatePS} kb
67066
67249
  )
67067
67250
  ] });
67068
67251
  }
67252
+ function sectionBoxDisable({ height, width, fill: fill2, className }) {
67253
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { className, height, width, viewBox: "0 0 256 256", children: [
67254
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
67255
+ "path",
67256
+ {
67257
+ fill: fill2,
67258
+ d: "M 109.70368,2.190587 17.447731,55.710016 A 16.213,16.213 0 0 0 9.3632977,69.780402 L 9.6706253,176.28696 a 16.215,16.215 0 0 0 8.1654987,14.0235 l 95.269706,54.51732 c 1.35625,0.77609 3.04643,-0.20379 3.04192,-1.76478 L 115.79652,121.3395 221.23346,60.173007 c 1.35174,-0.783903 1.34611,-2.734895 -0.0101,-3.511985 L 125.95362,2.1436974 a 16.278,16.278 0 0 0 -16.24994,0.04689 z M 95.74464,211.51674 29.976783,173.88635 29.714025,82.825734 l 65.768857,37.630376 0.262761,91.06162 z m 9.95507,-107.77018 -65.766855,-37.629382 77.949835,-45.221114 65.76886,37.62938 -77.95084,45.221116 z"
67259
+ }
67260
+ ),
67261
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
67262
+ "path",
67263
+ {
67264
+ fill: fill2,
67265
+ d: "m 185.61601,192.28388 v -44.0883 c 0,-2.52838 -1.97182,-4.91709 -4.84542,-5.26996 -3.49833,-0.42965 -6.4956,1.9253 -6.4956,4.89027 v 44.08783 c 0,2.52885 1.97182,4.91756 4.84542,5.27043 3.49833,0.42965 6.4956,-1.92531 6.4956,-4.89027 z m 22.68149,0 v -44.0883 c 0,-2.52838 -1.97182,-4.91709 -4.84542,-5.26996 -3.49832,-0.42965 -6.49559,1.9253 -6.49559,4.89027 v 44.08783 c 0,2.52885 1.97182,4.91756 4.84542,5.27043 3.49832,0.42965 6.49559,-1.92531 6.49559,-4.89027 z m 38.18908,-71.6429 H 225.42553 V 105.9623 c 0,-2.80818 -2.61299,-5.08498 -5.83584,-5.08498 h -56.43703 c -3.22285,0 -5.83585,2.2768 -5.83585,5.08498 v 14.67868 h -21.23089 c -4.69044,0 -8.49236,3.31275 -8.49236,7.39969 v 0.0231 c 0,4.08694 3.80192,7.39969 8.49236,7.39969 h 110.40066 c 4.69044,0 8.49236,-3.31275 8.49236,-7.39969 v -0.0231 c 0,-4.08694 -3.80192,-7.39969 -8.49236,-7.39969 z m -35.23745,-6.4863 v 6.4863 h -39.75592 v -6.4863 a 1.0615448,0.92496161 0 0 1 1.06155,-0.92496 h 37.63282 a 1.0615448,0.92496161 0 0 1 1.06155,0.92496 z"
67266
+ }
67267
+ ),
67268
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
67269
+ "path",
67270
+ {
67271
+ fill: fill2,
67272
+ d: "m 227.42894,215.76405 c 0,5.6549 -4.47215,10.23953 -9.98832,10.23953 h -49.76957 c -5.51617,0 -9.98832,-4.58463 -9.98832,-10.23953 v -69.72083 a 4.9863693,5.1117785 0 0 0 -4.98637,-5.11178 h -10.00391 a 4.9863693,5.1117785 0 0 0 -4.98637,5.11178 v 73.13422 c 0,15.08038 11.92553,27.30584 26.63594,27.30584 h 56.42825 c 14.71041,0 26.63594,-12.22546 26.63594,-27.30584 v -73.13422 a 4.9863693,5.1117785 0 0 0 -4.98637,-5.11178 h -10.0039 a 4.9863693,5.1117785 0 0 0 -4.98637,5.11178 v 69.72147 z"
67273
+ }
67274
+ )
67275
+ ] });
67276
+ }
67069
67277
  function sectionBoxClip({ height, width, fill: fill2, className }) {
67070
67278
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { className, height, width, viewBox: "0 0 256 256", children: [
67071
67279
  /* @__PURE__ */ jsxRuntimeExports.jsx("path", { fill: "none", d: "M0 0h256v256H0z" }),
@@ -67147,6 +67355,24 @@ Averrage Date/Second ${avgDataRatePS} kb
67147
67355
  ) })
67148
67356
  ] });
67149
67357
  }
67358
+ function sectionBoxShrink2({ height, width, fill: fill2, className }) {
67359
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { className, height, width, viewBox: "0 0 256 256", children: [
67360
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
67361
+ "path",
67362
+ {
67363
+ fill: fill2,
67364
+ d: "M 109.70368,2.190587 17.447731,55.710016 A 16.213,16.213 0 0 0 9.3632977,69.780402 L 9.6706253,176.28696 a 16.215,16.215 0 0 0 8.1654987,14.0235 l 95.269706,54.51732 c 1.35625,0.77609 3.04643,-0.20379 3.04192,-1.76478 L 115.79652,121.3395 221.23346,60.173007 c 1.35174,-0.783903 1.34611,-2.734895 -0.0101,-3.511985 L 125.95362,2.1436974 a 16.278,16.278 0 0 0 -16.24994,0.04689 z M 95.74464,211.51674 29.976783,173.88635 29.714025,82.825734 l 65.768857,37.630376 0.262761,91.06162 z m 9.95507,-107.77018 -65.766855,-37.629382 77.949835,-45.221114 65.76886,37.62938 -77.95084,45.221116 z"
67365
+ }
67366
+ ),
67367
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
67368
+ "path",
67369
+ {
67370
+ fill: fill2,
67371
+ d: "m 223.41166,231.92815 -50.05,-51.82677 -21.39562,22.15515 -21.52251,-81.36695 78.57748,22.28655 -21.39561,22.15516 50.05002,51.82676 z"
67372
+ }
67373
+ )
67374
+ ] });
67375
+ }
67150
67376
  function ghost({ height, width, fill: fill2, className }) {
67151
67377
  return /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { className, width: height, height: width, viewBox: "0 0 20 20", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("g", { "data-name": "ICONS", children: [
67152
67378
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -67184,6 +67410,7 @@ Averrage Date/Second ${avgDataRatePS} kb
67184
67410
  const icons = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
67185
67411
  __proto__: null,
67186
67412
  arrowLeft,
67413
+ autoCamera,
67187
67414
  camera,
67188
67415
  checkmark,
67189
67416
  close,
@@ -67206,11 +67433,17 @@ Averrage Date/Second ${avgDataRatePS} kb
67206
67433
  pan,
67207
67434
  perspective,
67208
67435
  sectionBox,
67436
+ sectionBoxAuto,
67209
67437
  sectionBoxClip,
67438
+ sectionBoxDisable,
67210
67439
  sectionBoxIgnore,
67211
67440
  sectionBoxReset,
67441
+ sectionBoxSettings,
67212
67442
  sectionBoxShrink,
67443
+ sectionBoxShrink2,
67444
+ sectionBoxVisible,
67213
67445
  settings,
67446
+ slidersHoriz,
67214
67447
  toggleIsolation,
67215
67448
  trash,
67216
67449
  treeView,
@@ -67230,9 +67463,6 @@ Averrage Date/Second ${avgDataRatePS} kb
67230
67463
  function anyUiCursorButton(settings2) {
67231
67464
  return isTrue(settings2.ui.orbit) || isTrue(settings2.ui.lookAround) || isTrue(settings2.ui.pan) || isTrue(settings2.ui.zoom) || isTrue(settings2.ui.zoomWindow) || isTrue(settings2.ui.zoomToFit);
67232
67465
  }
67233
- function anyUiToolButton(settings2) {
67234
- return isTrue(settings2.ui.sectioningMode) || isTrue(settings2.ui.measuringMode) || isTrue(settings2.ui.toggleIsolation);
67235
- }
67236
67466
  function anyUiSettingButton(settings2) {
67237
67467
  return isTrue(settings2.ui.projectInspector) || isTrue(settings2.ui.settings) || isTrue(settings2.ui.help) || isTrue(settings2.ui.maximise);
67238
67468
  }
@@ -67327,7 +67557,7 @@ Averrage Date/Second ${avgDataRatePS} kb
67327
67557
  );
67328
67558
  };
67329
67559
  const onHomeBtn = () => {
67330
- props.camera.reset();
67560
+ props.camera.reset.call();
67331
67561
  };
67332
67562
  const btnStyle2 = "vim-axes-button vc-flex vc-items-center vc-justify-center vc-text-gray-medium vc-transition-all hover:vc-text-primary-royal";
67333
67563
  const btnIsolation = /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -67364,7 +67594,7 @@ Averrage Date/Second ${avgDataRatePS} kb
67364
67594
  }
67365
67595
  );
67366
67596
  const hidden2 = isTrue(props.settings.value.ui.axesPanel) ? "" : " vc-hidden";
67367
- const createBar2 = () => {
67597
+ const createBar = () => {
67368
67598
  if (!anyUiAxesButton(props.settings.value)) {
67369
67599
  return (
67370
67600
  // Keeps layout when all buttons are disabled.
@@ -67386,7 +67616,7 @@ Averrage Date/Second ${avgDataRatePS} kb
67386
67616
  className: "vim-axes-panel vc-pointer-events-none vc-absolute vc-overflow-hidden vc-z-20 vc-flex vc-flex-col vc-border vc-border-white vc-opacity-50 vc-shadow-lg vc-saturate-0 vc-transition-all hover:vc-opacity-100 hover:vc-saturate-100" + hidden2,
67387
67617
  children: [
67388
67618
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: gizmoDiv, className: "vim-axes-panel-gizmo vc-absolute vc-pointer-events-auto" }),
67389
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "vim-axes-panel-bar vc-absolute vc-top-[75%] vc-bottom-0 vc-right-0 vc-left-0", children: createBar2() })
67619
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "vim-axes-panel-bar vc-absolute vc-top-[75%] vc-bottom-0 vc-right-0 vc-left-0", children: createBar() })
67390
67620
  ]
67391
67621
  }
67392
67622
  );
@@ -67395,22 +67625,98 @@ Averrage Date/Second ${avgDataRatePS} kb
67395
67625
  function buttonDefaultStyle(on) {
67396
67626
  return on ? btnStyle + " vc-text-primary" : btnStyle + " vc-text-gray-medium";
67397
67627
  }
67628
+ function buttonExpandStyle(on) {
67629
+ return on ? btnStyle + " vc-text-white vc-bg-primary" : btnStyle + " vc-text-gray-medium";
67630
+ }
67631
+ function buttonDisableStyle(on) {
67632
+ return on ? btnStyle + " vc-text-gray-medium" : btnStyle + " vc-text-gray vc-pointer-events-none";
67633
+ }
67398
67634
  function buttonBlueStyle(on) {
67399
67635
  return btnStyle + " vc-text-white";
67400
67636
  }
67401
67637
  function createButton(button) {
67402
67638
  var _a2;
67403
67639
  if (button.enabled !== void 0 && !button.enabled()) return null;
67404
- const style = button.style((_a2 = button.isOn) == null ? void 0 : _a2.call(button));
67405
- return /* @__PURE__ */ jsxRuntimeExports.jsx("button", { "data-tip": button.tip, onClick: button.action, className: style, type: "button", children: button.icon({ height: "20", width: "20", fill: "currentColor", className: "vc-max-h-[80%]" }) }, button.id);
67640
+ const style = (button.style ?? buttonDefaultStyle)((_a2 = button.isOn) == null ? void 0 : _a2.call(button));
67641
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("button", { id: button.id, "data-tip": button.tip, onClick: button.action, className: style, type: "button", children: button.icon({ height: "20", width: "20", fill: "currentColor", className: "vc-max-h-[80%]" }) }, button.id);
67406
67642
  }
67407
- const sectionStyle = "vc-flex vc-items-center vc-rounded-full vc-mb-2 vc-px-2 vc-shadow-md";
67643
+ const sectionStyle = "vc-flex vc-items-center vc-rounded-full vc-mb-2 vc-shadow-md";
67408
67644
  const sectionDefaultStyle = sectionStyle + " vc-bg-white";
67409
67645
  const sectionBlueStyle = sectionStyle + " vc-bg-primary";
67646
+ const sectionNoPadStyle = sectionStyle.replace("vc-px-2", "") + " vc-bg-white";
67410
67647
  function createSection$1(section) {
67411
67648
  if (section.enable !== void 0 && !section.enable()) return null;
67412
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `vim-control-bar-section ${section.style}`, children: section.buttons.map((b) => createButton(b)) }, section.id);
67649
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `vim-control-bar-section ${section.style ?? sectionDefaultStyle}`, children: section.buttons.map((b) => createButton(b)) }, section.id);
67650
+ }
67651
+ const ids = {
67652
+ // Sections
67653
+ sectionCamera: "controlBar.sectionCamera",
67654
+ sectionInputs: "controlBar.sectionInputs",
67655
+ sectionActions: "controlBar.sectionActions",
67656
+ sectionTools: "controlBar.sectionTools",
67657
+ sectionSettings: "controlBar.sectionSettings",
67658
+ sectionMeasure: "controlBar.sectionMeasure",
67659
+ sectionSectionBox: "controlBar.sectionSectionBox",
67660
+ // Camera buttons
67661
+ buttonCameraAuto: "controlBar.camera.auto",
67662
+ buttonCameraOrbit: "controlBar.camera.orbit",
67663
+ buttonCameraLook: "controlBarcamera.look",
67664
+ buttonCameraPan: "controlBar.camera.pan",
67665
+ buttonCameraZoom: "controlBar.camera.zoom",
67666
+ buttonCameraZoomWindow: "controlBar.camera.zoomWindow",
67667
+ // Settings buttons
67668
+ buttonProjectInspector: "controlBar.projectInspector",
67669
+ buttonSettings: "controlBar.settings",
67670
+ buttonHelp: "controlBar.help",
67671
+ buttonMaximize: "controlBar.maximize",
67672
+ // Action Buttons
67673
+ buttonToggleIsolation: "controlBar.action.toggleIsolation",
67674
+ buttonZoomToFit: "controlBar.action.zoomToFit",
67675
+ // Tools buttons
67676
+ buttonSectionBox: "controlBar.sectionBox",
67677
+ buttonMeasure: "controlBar.measure",
67678
+ // Section box buttons
67679
+ buttonSectionBoxEnable: "controlBar.sectionBox.enable",
67680
+ buttonSectionBoxVisible: "controlBar.sectionBox.visible",
67681
+ buttonSectionBoxShrinkToSelection: "controlBar.sectionBox.shrinkToSelection",
67682
+ buttonSectionBoxAuto: "controlBar.sectionBox.auto",
67683
+ buttonSectionBoxReset: "controlBar.sectionBox.reset",
67684
+ buttonSectionBoxSettings: "controlBar.sectionBox.settings"
67685
+ };
67686
+ function ControlBar(props) {
67687
+ React2.useEffect(() => {
67688
+ ReactTooltip.rebuild();
67689
+ });
67690
+ if (!props.show) {
67691
+ return null;
67692
+ }
67693
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
67694
+ "div",
67695
+ {
67696
+ style: {
67697
+ gap: "min(10px, 2%)",
67698
+ bottom: "min(36px, 10%)"
67699
+ },
67700
+ id: "vim-control-bar",
67701
+ className: "vim-control-bar vc-pointer-events-auto vc-flex-wrap vc-mx-2 vc-min-w-0 vc-absolute vc-left-0 vc-right-0 vc-z-20 vc-flex vc-items-center vc-justify-center transition-all",
67702
+ children: props.content.map(createSection$1)
67703
+ }
67704
+ );
67413
67705
  }
67706
+ const controlBar = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
67707
+ __proto__: null,
67708
+ ControlBar,
67709
+ buttonBlueStyle,
67710
+ buttonDefaultStyle,
67711
+ buttonDisableStyle,
67712
+ buttonExpandStyle,
67713
+ createButton,
67714
+ createSection: createSection$1,
67715
+ ids,
67716
+ sectionBlueStyle,
67717
+ sectionDefaultStyle,
67718
+ sectionNoPadStyle
67719
+ }, Symbol.toStringTag, { value: "Module" }));
67414
67720
  function getPointerState(viewer) {
67415
67721
  const [mode, setMode] = React2.useState(viewer.inputs.pointerActive);
67416
67722
  React2.useEffect(() => {
@@ -67472,52 +67778,6 @@ Averrage Date/Second ${avgDataRatePS} kb
67472
67778
  }
67473
67779
  };
67474
67780
  }
67475
- function getSectionBoxState(viewer) {
67476
- const sectionGizmo = viewer.gizmos.section;
67477
- const first = React2.useRef(true);
67478
- const [section, setSection] = React2.useState({
67479
- clip: sectionGizmo.clip,
67480
- active: sectionGizmo.visible && sectionGizmo.interactive
67481
- });
67482
- React2.useEffect(() => {
67483
- const subSection = sectionGizmo.onStateChanged.subscribe(
67484
- () => setSection({
67485
- clip: sectionGizmo.clip,
67486
- active: sectionGizmo.visible && sectionGizmo.interactive
67487
- })
67488
- );
67489
- return () => subSection();
67490
- }, []);
67491
- const toggle = () => {
67492
- ReactTooltip.hide();
67493
- if (viewer.inputs.pointerActive === "rect") {
67494
- viewer.inputs.pointerActive = viewer.inputs.pointerFallback;
67495
- }
67496
- const next = !(sectionGizmo.visible && sectionGizmo.interactive);
67497
- sectionGizmo.interactive = next;
67498
- sectionGizmo.visible = next;
67499
- if (next && first.current) {
67500
- sectionGizmo.clip = true;
67501
- sectionGizmo.fitBox(viewer.renderer.getBoundingBox());
67502
- first.current = false;
67503
- }
67504
- };
67505
- return {
67506
- clip: section.clip,
67507
- active: section.active,
67508
- set: setSection,
67509
- toggle,
67510
- hide: () => {
67511
- sectionGizmo.visible = false;
67512
- sectionGizmo.interactive = false;
67513
- },
67514
- reset: () => sectionGizmo.fitBox(viewer.renderer.getBoundingBox()),
67515
- shrinkToSelection: () => sectionGizmo.fitBox(viewer.selection.getBoundingBox()),
67516
- toggleClip: () => {
67517
- sectionGizmo.clip = !section.clip;
67518
- }
67519
- };
67520
- }
67521
67781
  function pointerToCursor(pointer) {
67522
67782
  switch (pointer) {
67523
67783
  case "orbit":
@@ -67569,13 +67829,13 @@ Averrage Date/Second ${avgDataRatePS} kb
67569
67829
  const sub2 = this._viewer.inputs.onPointerOverrideChanged.subscribe(
67570
67830
  () => this._updateCursor()
67571
67831
  );
67572
- const sub3 = this._viewer.gizmos.section.onStateChanged.subscribe(() => {
67573
- if (!this._viewer.gizmos.section.visible) {
67832
+ const sub3 = this._viewer.gizmos.sectionBox.onStateChanged.subscribe(() => {
67833
+ if (!this._viewer.gizmos.sectionBox.visible) {
67574
67834
  this._boxHover = false;
67575
67835
  this._updateCursor();
67576
67836
  }
67577
67837
  });
67578
- const sub4 = this._viewer.gizmos.section.onHover.subscribe((hover) => {
67838
+ const sub4 = this._viewer.gizmos.sectionBox.onHover.subscribe((hover) => {
67579
67839
  this._boxHover = hover;
67580
67840
  this._updateCursor();
67581
67841
  });
@@ -67638,59 +67898,77 @@ Averrage Date/Second ${avgDataRatePS} kb
67638
67898
  clear
67639
67899
  };
67640
67900
  }
67641
- const elementIds = {
67642
- // Sections
67643
- sectionCamera: "controlBar.sectionCamera",
67644
- sectionTools: "controlBar.sectionTools",
67645
- sectionSettings: "controlBar.sectionSettings",
67646
- sectionMeasure: "controlBar.sectionMeasure",
67647
- sectionSectionBox: "controlBar.sectionSectionBox",
67648
- // Camera buttons
67649
- buttonCameraOrbit: "controlBar.camera.orbit",
67650
- buttonCameraLook: "controlBarcamera.look",
67651
- buttonCameraPan: "controlBar.camera.pan",
67652
- buttonCameraZoom: "controlBar.camera.zoom",
67653
- buttonCameraZoomWindow: "controlBar.camera.zoomWindow",
67654
- buttonCameraZoomToFit: "controlBar.camera.zoomToFit",
67655
- // Settings buttons
67656
- buttonProjectInspector: "controlBar.projectInspector",
67657
- buttonSettings: "controlBar.settings",
67658
- buttonHelp: "controlBar.help",
67659
- buttonMaximize: "controlBar.maximize",
67660
- // Tools buttons
67661
- buttonSectionBox: "controlBar.sectionBox",
67662
- buttonMeasure: "controlBar.measure",
67663
- buttonToggleIsolation: "controlBar.toggleIsolation",
67664
- // Measure buttons
67665
- buttonMeasureDelete: "controlBar.measure.delete",
67666
- buttonMeasureDone: "controlBar.measure.done",
67667
- // Section box buttons
67668
- buttonSectionBoxReset: "controlBar.sectionBox.reset",
67669
- buttonSectionBoxShrinkToSelection: "controlBar.sectionBox.shrinkToSelection",
67670
- buttonSectionBoxClip: "controlBar.sectionBox.clip",
67671
- buttonSectionBoxIgnore: "controlBar.sectionBox.ignore",
67672
- buttonSectionBoxDone: "controlBar.sectionBox.done"
67673
- };
67674
- function ControlBar(props) {
67675
- var _a2;
67676
- const pointer = getPointerState(props.viewer);
67677
- const fullScreen = getFullScreenState();
67678
- const section = getSectionBoxState(props.viewer);
67679
- const measure$1 = getMeasureState(props.viewer, props.cursor);
67680
- React2.useEffect(() => {
67681
- ReactTooltip.rebuild();
67682
- });
67683
- if (isFalse(props.settings.ui.controlBar)) {
67684
- return null;
67685
- }
67686
- const cameraSection = {
67687
- id: elementIds.sectionCamera,
67688
- enable: () => anyUiCursorButton(props.settings),
67901
+ function controlBarSectionBox(section, hasSelection) {
67902
+ return {
67903
+ id: ids.sectionSectionBox,
67904
+ style: section.enable.get() ? sectionNoPadStyle : sectionDefaultStyle,
67905
+ //enable: () => section.getEnable(),
67906
+ buttons: [
67907
+ {
67908
+ id: ids.buttonSectionBoxEnable,
67909
+ tip: "Enable Section Box",
67910
+ isOn: () => section.enable.get(),
67911
+ style: (on) => buttonExpandStyle(on),
67912
+ action: () => section.enable.set(!section.enable.get()),
67913
+ icon: sectionBox
67914
+ },
67915
+ {
67916
+ id: ids.buttonSectionBoxShrinkToSelection,
67917
+ tip: "Fit Section",
67918
+ enabled: () => section.enable.get(),
67919
+ isOn: () => hasSelection,
67920
+ style: (on) => buttonDisableStyle(on),
67921
+ action: () => section.sectionSelection.call(),
67922
+ icon: sectionBoxShrink
67923
+ },
67924
+ {
67925
+ id: ids.buttonSectionBoxReset,
67926
+ tip: "Reset Section",
67927
+ enabled: () => section.enable.get(),
67928
+ style: (on) => buttonDefaultStyle(on),
67929
+ action: () => section.sectionReset.call(),
67930
+ icon: sectionBoxReset
67931
+ },
67932
+ {
67933
+ id: ids.buttonSectionBoxVisible,
67934
+ tip: "Show Section Box",
67935
+ enabled: () => section.enable.get(),
67936
+ isOn: () => section.visible.get(),
67937
+ style: (on) => buttonDefaultStyle(on),
67938
+ action: () => section.visible.set(!section.visible.get()),
67939
+ icon: visible
67940
+ },
67941
+ {
67942
+ id: ids.buttonSectionBoxAuto,
67943
+ tip: "Auto Section",
67944
+ enabled: () => section.enable.get(),
67945
+ isOn: () => section.auto.get(),
67946
+ style: (on) => buttonDefaultStyle(on),
67947
+ action: () => section.auto.set(!section.auto.get()),
67948
+ icon: sectionBoxAuto
67949
+ },
67950
+ {
67951
+ id: ids.buttonSectionBoxSettings,
67952
+ tip: "Section Settings",
67953
+ enabled: () => section.enable.get(),
67954
+ isOn: () => section.showOffsetPanel.get(),
67955
+ style: (on) => buttonDefaultStyle(on),
67956
+ action: () => section.showOffsetPanel.set(!section.showOffsetPanel.get()),
67957
+ icon: slidersHoriz
67958
+ }
67959
+ ]
67960
+ };
67961
+ }
67962
+ function controlBarPointer(viewer, camera2, settings2, section) {
67963
+ const pointer = getPointerState(viewer);
67964
+ return {
67965
+ id: ids.sectionInputs,
67966
+ enable: () => anyUiCursorButton(settings2),
67689
67967
  style: sectionDefaultStyle,
67690
67968
  buttons: [
67691
67969
  {
67692
- id: elementIds.buttonCameraOrbit,
67693
- enabled: () => isTrue(props.settings.ui.orbit),
67970
+ id: ids.buttonCameraOrbit,
67971
+ enabled: () => isTrue(settings2.ui.orbit),
67694
67972
  tip: "Orbit",
67695
67973
  action: () => pointer.onButton("orbit"),
67696
67974
  icon: orbit,
@@ -67698,8 +67976,8 @@ Averrage Date/Second ${avgDataRatePS} kb
67698
67976
  style: buttonDefaultStyle
67699
67977
  },
67700
67978
  {
67701
- id: elementIds.buttonCameraLook,
67702
- enabled: () => isTrue(props.settings.ui.lookAround),
67979
+ id: ids.buttonCameraLook,
67980
+ enabled: () => isTrue(settings2.ui.lookAround),
67703
67981
  tip: "Look Around",
67704
67982
  action: () => pointer.onButton("look"),
67705
67983
  icon: look,
@@ -67707,8 +67985,8 @@ Averrage Date/Second ${avgDataRatePS} kb
67707
67985
  style: buttonDefaultStyle
67708
67986
  },
67709
67987
  {
67710
- id: elementIds.buttonCameraPan,
67711
- enabled: () => isTrue(props.settings.ui.pan),
67988
+ id: ids.buttonCameraPan,
67989
+ enabled: () => isTrue(settings2.ui.pan),
67712
67990
  tip: "Pan",
67713
67991
  action: () => pointer.onButton("pan"),
67714
67992
  icon: pan,
@@ -67716,8 +67994,8 @@ Averrage Date/Second ${avgDataRatePS} kb
67716
67994
  style: buttonDefaultStyle
67717
67995
  },
67718
67996
  {
67719
- id: elementIds.buttonCameraZoom,
67720
- enabled: () => isTrue(props.settings.ui.zoom),
67997
+ id: ids.buttonCameraZoom,
67998
+ enabled: () => isTrue(settings2.ui.zoom),
67721
67999
  tip: "Zoom",
67722
68000
  action: () => pointer.onButton("zoom"),
67723
68001
  icon: zoom,
@@ -67725,60 +68003,88 @@ Averrage Date/Second ${avgDataRatePS} kb
67725
68003
  style: buttonDefaultStyle
67726
68004
  },
67727
68005
  {
67728
- id: elementIds.buttonCameraZoomWindow,
67729
- enabled: () => isTrue(props.settings.ui.zoomWindow),
68006
+ id: ids.buttonCameraZoomWindow,
68007
+ enabled: () => isTrue(settings2.ui.zoomWindow),
67730
68008
  tip: "Zoom Window",
67731
68009
  action: () => {
67732
68010
  pointer.onButton("rect");
67733
- section.hide();
67734
68011
  },
67735
68012
  icon: frameRect,
67736
68013
  isOn: () => pointer.mode === "rect",
67737
68014
  style: buttonDefaultStyle
67738
- },
68015
+ }
68016
+ ]
68017
+ };
68018
+ }
68019
+ function controlBarActions(camera2, settings2, isolation, measure$1) {
68020
+ return {
68021
+ id: ids.sectionActions,
68022
+ enable: () => true,
68023
+ style: sectionDefaultStyle,
68024
+ buttons: [
67739
68025
  {
67740
- id: elementIds.buttonCameraZoomToFit,
67741
- enabled: () => isTrue(props.settings.ui.zoomToFit),
68026
+ id: ids.buttonZoomToFit,
68027
+ enabled: () => isTrue(settings2.ui.zoomToFit),
67742
68028
  tip: "Zoom to Fit",
67743
- action: () => props.camera.frameContext(),
68029
+ action: () => camera2.frameSelection.call(),
67744
68030
  icon: frameSelection,
67745
68031
  isOn: () => false,
67746
68032
  style: buttonDefaultStyle
68033
+ },
68034
+ {
68035
+ id: ids.buttonToggleIsolation,
68036
+ enabled: () => isTrue(settings2.ui.toggleIsolation),
68037
+ tip: "Toggle Isolation",
68038
+ action: () => isolation.toggle("controlBar"),
68039
+ icon: toggleIsolation,
68040
+ style: buttonDefaultStyle
68041
+ },
68042
+ {
68043
+ id: ids.buttonMeasure,
68044
+ enabled: () => isTrue(settings2.ui.measuringMode),
68045
+ isOn: () => measure$1.active,
68046
+ tip: "Measuring Mode",
68047
+ action: () => measure$1.toggle(),
68048
+ icon: measure,
68049
+ style: buttonDefaultStyle
67747
68050
  }
67748
68051
  ]
67749
68052
  };
67750
- const settingsSection = {
67751
- id: elementIds.sectionSettings,
67752
- enable: () => anyUiSettingButton(props.settings),
68053
+ }
68054
+ function controlBarSettings(modal, side, settings$1) {
68055
+ const fullScreen = getFullScreenState();
68056
+ return {
68057
+ id: ids.sectionSettings,
68058
+ enable: () => anyUiSettingButton(settings$1),
67753
68059
  style: sectionDefaultStyle,
67754
68060
  buttons: [
67755
68061
  {
67756
- id: elementIds.buttonProjectInspector,
67757
- enabled: () => isTrue(props.settings.ui.projectInspector) && (isTrue(props.settings.ui.bimTreePanel) || isTrue(props.settings.ui.bimInfoPanel)),
68062
+ id: ids.buttonProjectInspector,
68063
+ enabled: () => isTrue(settings$1.ui.projectInspector) && (isTrue(settings$1.ui.bimTreePanel) || isTrue(settings$1.ui.bimInfoPanel)),
67758
68064
  tip: "Project Inspector",
67759
- action: () => props.side.toggleContent("bim"),
68065
+ action: () => side.toggleContent("bim"),
67760
68066
  icon: treeView,
67761
68067
  style: buttonDefaultStyle
67762
68068
  },
67763
68069
  {
67764
- id: elementIds.buttonSettings,
67765
- enabled: () => isTrue(props.settings.ui.settings),
68070
+ id: ids.buttonSettings,
68071
+ enabled: () => isTrue(settings$1.ui.settings),
67766
68072
  tip: "Settings",
67767
- action: () => props.side.toggleContent("settings"),
68073
+ action: () => side.toggleContent("settings"),
67768
68074
  icon: settings,
67769
68075
  style: buttonDefaultStyle
67770
68076
  },
67771
68077
  {
67772
- id: elementIds.buttonHelp,
67773
- enabled: () => isTrue(props.settings.ui.help),
68078
+ id: ids.buttonHelp,
68079
+ enabled: () => isTrue(settings$1.ui.help),
67774
68080
  tip: "Help",
67775
- action: () => props.modal.help(true),
68081
+ action: () => modal.help(true),
67776
68082
  icon: help,
67777
68083
  style: buttonDefaultStyle
67778
68084
  },
67779
68085
  {
67780
- id: elementIds.buttonMaximize,
67781
- enabled: () => isTrue(props.settings.ui.maximise) && props.settings.capacity.canGoFullScreen,
68086
+ id: ids.buttonMaximize,
68087
+ enabled: () => isTrue(settings$1.ui.maximise) && settings$1.capacity.canGoFullScreen,
67782
68088
  tip: fullScreen.get() ? "Minimize" : "Fullscreen",
67783
68089
  action: () => fullScreen.toggle(),
67784
68090
  icon: fullScreen.get() ? minimize : fullsScreen,
@@ -67786,112 +68092,42 @@ Averrage Date/Second ${avgDataRatePS} kb
67786
68092
  }
67787
68093
  ]
67788
68094
  };
67789
- const sectionBoxSection = {
67790
- id: elementIds.sectionSectionBox,
67791
- enable: () => !measure$1.active && section.active,
67792
- style: sectionBlueStyle,
67793
- buttons: [
67794
- {
67795
- id: elementIds.buttonSectionBoxReset,
67796
- tip: "Reset Section Box",
67797
- action: () => section.reset(),
67798
- icon: sectionBoxReset,
67799
- style: buttonBlueStyle
67800
- },
67801
- {
67802
- id: elementIds.buttonSectionBoxShrinkToSelection,
67803
- tip: "Shrink to Selection",
67804
- action: () => section.shrinkToSelection(),
67805
- icon: sectionBoxShrink,
67806
- style: buttonBlueStyle
67807
- },
67808
- {
67809
- id: elementIds.buttonSectionBoxClip,
67810
- tip: section.clip ? "Ignore Section Box" : "Clip Section Box",
67811
- action: () => section.toggleClip(),
67812
- icon: section.clip ? sectionBoxIgnore : sectionBoxClip,
67813
- style: buttonBlueStyle
67814
- },
67815
- {
67816
- id: elementIds.buttonSectionBoxDone,
67817
- tip: "Done",
67818
- action: () => section.toggle(),
67819
- icon: checkmark,
67820
- style: buttonBlueStyle
67821
- }
67822
- ]
67823
- };
67824
- const measureSection = {
67825
- id: elementIds.sectionMeasure,
67826
- enable: () => measure$1.active && !section.active,
67827
- style: sectionBlueStyle,
67828
- buttons: [
67829
- {
67830
- id: elementIds.buttonMeasureDelete,
67831
- tip: "Delete",
67832
- action: () => measure$1.clear(),
67833
- icon: trash,
67834
- style: buttonBlueStyle
67835
- },
67836
- {
67837
- id: elementIds.buttonMeasureDone,
67838
- tip: "Done",
67839
- action: () => measure$1.toggle(),
67840
- icon: checkmark,
67841
- style: buttonBlueStyle
67842
- }
67843
- ]
67844
- };
67845
- const toolSections = {
67846
- id: elementIds.sectionTools,
67847
- enable: () => anyUiToolButton(props.settings) && !measure$1.active && !section.active,
67848
- style: measure$1.active || section.active ? sectionBlueStyle : sectionDefaultStyle,
68095
+ }
68096
+ function controlBarCamera(camera2) {
68097
+ return {
68098
+ id: ids.sectionCamera,
68099
+ enable: () => true,
68100
+ style: sectionDefaultStyle,
67849
68101
  buttons: [
67850
68102
  {
67851
- id: elementIds.buttonSectionBox,
67852
- enabled: () => isTrue(props.settings.ui.sectioningMode),
67853
- tip: "Sectioning Mode",
67854
- action: () => section.toggle(),
67855
- icon: sectionBox,
67856
- style: buttonDefaultStyle
67857
- },
67858
- {
67859
- id: elementIds.buttonMeasure,
67860
- enabled: () => isTrue(props.settings.ui.measuringMode),
67861
- tip: "Measuring Mode",
67862
- action: () => measure$1.toggle(),
67863
- icon: measure,
67864
- style: buttonDefaultStyle
67865
- },
67866
- {
67867
- id: elementIds.buttonToggleIsolation,
67868
- enabled: () => isTrue(props.settings.ui.toggleIsolation),
67869
- tip: "Toggle Isolation",
67870
- action: () => props.isolation.toggle("controlBar"),
67871
- icon: toggleIsolation,
68103
+ id: ids.buttonCameraAuto,
68104
+ tip: "Auto Camera",
68105
+ isOn: () => camera2.autoCamera.get(),
68106
+ action: () => camera2.autoCamera.set(!camera2.autoCamera.get()),
68107
+ icon: autoCamera,
67872
68108
  style: buttonDefaultStyle
67873
68109
  }
67874
68110
  ]
67875
68111
  };
67876
- let controlBar2 = [cameraSection, toolSections, measureSection, sectionBoxSection, settingsSection];
67877
- controlBar2 = ((_a2 = props.customization) == null ? void 0 : _a2.call(props, controlBar2)) ?? controlBar2;
67878
- return createBar(controlBar2);
67879
68112
  }
67880
- function createBar(sections) {
67881
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: {
67882
- gap: "min(10px, 2%)",
67883
- bottom: "min(36px, 10%)"
67884
- }, className: "vim-control-bar vc-pointer-events-auto vc-flex-wrap vc-mx-2 vc-min-w-0 vc-absolute vc-left-0 vc-right-0 vc-z-20 vc-flex vc-items-center vc-justify-center transition-all", children: sections.map(createSection$1) });
68113
+ function useControlBar(viewer, camera2, modal, side, isolation, cursor, settings2, section, customization) {
68114
+ const measure2 = getMeasureState(viewer, cursor);
68115
+ const pointerSection = controlBarPointer(viewer, camera2, settings2);
68116
+ const actionSection = controlBarActions(camera2, settings2, isolation, measure2);
68117
+ const sectionBoxSection = controlBarSectionBox(section, viewer.selection.count > 0);
68118
+ const settingsSection = controlBarSettings(modal, side, settings2);
68119
+ const cameraSection = controlBarCamera(camera2);
68120
+ let controlBarSections = [
68121
+ pointerSection,
68122
+ actionSection,
68123
+ cameraSection,
68124
+ sectionBoxSection,
68125
+ // Optional section
68126
+ settingsSection
68127
+ ];
68128
+ controlBarSections = (customization == null ? void 0 : customization(controlBarSections)) ?? controlBarSections;
68129
+ return controlBarSections;
67885
68130
  }
67886
- const controlBar = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
67887
- __proto__: null,
67888
- ControlBar,
67889
- buttonBlueStyle,
67890
- buttonDefaultStyle,
67891
- elementIds,
67892
- sectionBlueStyle,
67893
- sectionDefaultStyle
67894
- }, Symbol.toStringTag, { value: "Module" }));
67895
68131
  function RestOfScreen(props) {
67896
68132
  const [, setVersion] = React2.useState(0);
67897
68133
  const resizeObserver = React2.useRef();
@@ -71880,23 +72116,23 @@ Averrage Date/Second ${avgDataRatePS} kb
71880
72116
  const viewer = props.viewer;
71881
72117
  const camera2 = props.camera;
71882
72118
  const [section, setSection] = React2.useState({
71883
- visible: viewer.gizmos.section.visible,
71884
- clip: viewer.gizmos.section.clip
72119
+ visible: viewer.gizmos.sectionBox.visible,
72120
+ clip: viewer.gizmos.sectionBox.clip
71885
72121
  });
71886
72122
  const isClipping = () => {
71887
- return !viewer.gizmos.section.box.containsBox(viewer.renderer.getBoundingBox());
72123
+ return !viewer.gizmos.sectionBox.box.containsBox(viewer.renderer.getBoundingBox());
71888
72124
  };
71889
72125
  const [clipping, setClipping] = React2.useState(isClipping());
71890
72126
  const [, setVersion] = React2.useState(0);
71891
72127
  const hidden2 = props.isolation.isActive();
71892
72128
  React2.useEffect(() => {
71893
- const subState = viewer.gizmos.section.onStateChanged.subscribe(() => {
72129
+ const subState = viewer.gizmos.sectionBox.onStateChanged.subscribe(() => {
71894
72130
  setSection({
71895
- visible: viewer.gizmos.section.visible,
71896
- clip: viewer.gizmos.section.clip
72131
+ visible: viewer.gizmos.sectionBox.visible,
72132
+ clip: viewer.gizmos.sectionBox.clip
71897
72133
  });
71898
72134
  });
71899
- const subConfirm = viewer.gizmos.section.onBoxConfirm.subscribe(
72135
+ const subConfirm = viewer.gizmos.sectionBox.onBoxConfirm.subscribe(
71900
72136
  () => setClipping(isClipping())
71901
72137
  );
71902
72138
  props.isolation.onChanged.subscribe(() => setVersion((v) => v + 1));
@@ -71910,11 +72146,11 @@ Averrage Date/Second ${avgDataRatePS} kb
71910
72146
  e.stopPropagation();
71911
72147
  };
71912
72148
  const onCameraResetBtn = (e) => {
71913
- camera2.reset();
72149
+ camera2.reset.call();
71914
72150
  e.stopPropagation();
71915
72151
  };
71916
72152
  const onCameraFrameBtn = (e) => {
71917
- camera2.frameContext();
72153
+ camera2.frameSelection.call();
71918
72154
  e.stopPropagation();
71919
72155
  };
71920
72156
  const onSelectionIsolateBtn = (e) => {
@@ -71948,10 +72184,10 @@ Averrage Date/Second ${avgDataRatePS} kb
71948
72184
  e.stopPropagation();
71949
72185
  };
71950
72186
  const onSectionToggleBtn = (e) => {
71951
- viewer.gizmos.section.clip = !viewer.gizmos.section.clip;
72187
+ viewer.gizmos.sectionBox.clip = !viewer.gizmos.sectionBox.clip;
71952
72188
  };
71953
72189
  const onSectionResetBtn = (e) => {
71954
- viewer.gizmos.section.fitBox(viewer.renderer.getBoundingBox());
72190
+ viewer.gizmos.sectionBox.fitBox(viewer.renderer.getBoundingBox());
71955
72191
  e.stopPropagation();
71956
72192
  };
71957
72193
  const onMeasureDeleteBtn = (e) => {
@@ -71960,7 +72196,7 @@ Averrage Date/Second ${avgDataRatePS} kb
71960
72196
  const onFitSectionToSelectionBtn = (e) => {
71961
72197
  const box = viewer.selection.getBoundingBox();
71962
72198
  if (box) {
71963
- viewer.gizmos.section.fitBox(box);
72199
+ viewer.gizmos.sectionBox.fitBox(box);
71964
72200
  }
71965
72201
  };
71966
72202
  const createButton2 = (button) => {
@@ -72246,7 +72482,7 @@ Averrage Date/Second ${avgDataRatePS} kb
72246
72482
  createInteractiveElementProps: (item, treeId, actions, renderFlags) => ({
72247
72483
  onKeyUp: (e) => {
72248
72484
  if (e.key === "f") {
72249
- props.camera.frameContext();
72485
+ props.camera.frameSelection.call();
72250
72486
  }
72251
72487
  if (e.key === "Escape") {
72252
72488
  props.viewer.selection.clear();
@@ -72289,7 +72525,7 @@ Averrage Date/Second ${avgDataRatePS} kb
72289
72525
  },
72290
72526
  onPrimaryAction: (item, _) => {
72291
72527
  if (doubleClick.isDoubleClick(item.index)) {
72292
- props.camera.frameSelection();
72528
+ props.camera.frameSelection.call();
72293
72529
  }
72294
72530
  },
72295
72531
  onFocusItem: (item) => {
@@ -74580,7 +74816,7 @@ Averrage Date/Second ${avgDataRatePS} kb
74580
74816
  return true;
74581
74817
  }
74582
74818
  case KEYS.KEY_F: {
74583
- this._camera.frameContext();
74819
+ this._camera.frameSelection.call();
74584
74820
  return true;
74585
74821
  }
74586
74822
  case KEYS.KEY_I: {
@@ -74774,7 +75010,7 @@ Averrage Date/Second ${avgDataRatePS} kb
74774
75010
  if (!this._settings.isolation.enable) return;
74775
75011
  this._isolation = objects ?? [];
74776
75012
  this._apply(source);
74777
- this._camera.frameVisibleObjects();
75013
+ this._camera.frameScene.call();
74778
75014
  }
74779
75015
  /**
74780
75016
  * Toggles isolation by using the current selection.
@@ -74789,7 +75025,7 @@ Averrage Date/Second ${avgDataRatePS} kb
74789
75025
  if (!this._settings.isolation.enable) return;
74790
75026
  this._isolation = [...this._viewer.selection.objects].filter((o) => o.type === "Object3D");
74791
75027
  this._apply(source);
74792
- this._camera.frameVisibleObjects();
75028
+ this._camera.frameScene.call();
74793
75029
  this._viewer.selection.clear();
74794
75030
  }
74795
75031
  /**
@@ -74889,75 +75125,6 @@ Averrage Date/Second ${avgDataRatePS} kb
74889
75125
  return objects;
74890
75126
  }
74891
75127
  }
74892
- class ComponentCamera {
74893
- constructor(viewer) {
74894
- __publicField(this, "_viewer");
74895
- this._viewer = viewer;
74896
- }
74897
- /**
74898
- * Resets the camera to its initial position.
74899
- */
74900
- reset() {
74901
- this._viewer.camera.lerp(1).reset();
74902
- }
74903
- /**
74904
- * Frames selected elements if there is an active selection; otherwise, frames all visible objects.
74905
- * @param duration Optional duration of the camera movement animation (default: 1).
74906
- */
74907
- frameContext(duration = 1) {
74908
- if (this._viewer.selection.count > 0) {
74909
- this.frameSelection(duration);
74910
- } else {
74911
- this.frameVisibleObjects(void 0, duration);
74912
- }
74913
- }
74914
- /**
74915
- * Frames selected elements if there is an active selection; otherwise, does nothing.
74916
- * @param duration Optional duration of the camera movement animation (default: 1).
74917
- */
74918
- frameSelection(duration = 1) {
74919
- if (this._viewer.selection.count === 0) return;
74920
- const box = this._viewer.selection.getBoundingBox();
74921
- if (box && this._viewer.gizmos.section.box.intersectsBox(box)) {
74922
- const movement = duration === 0 ? this._viewer.camera.snap() : this._viewer.camera.lerp(duration);
74923
- movement.frame(box);
74924
- }
74925
- }
74926
- /**
74927
- * Frames all visible objects in the scene.
74928
- * @param source Optional VIM to specify the source of objects to frame.
74929
- * @param duration Duration of the camera movement animation (default: 1).
74930
- */
74931
- frameVisibleObjects(source, duration = 1) {
74932
- const movement = duration === 0 ? this._viewer.camera.snap() : this._viewer.camera.lerp(duration);
74933
- const box = this.getVisibleBoundingBox(source);
74934
- movement.frame(box);
74935
- }
74936
- /**
74937
- * Returns the bounding box of all visible objects.
74938
- * @param source Optional VIM to specify the source of visible objects.
74939
- * @returns The bounding box of all visible objects.
74940
- */
74941
- getVisibleBoundingBox(source) {
74942
- let box;
74943
- const vimBoxUnion = (vim) => {
74944
- for (const obj of vim.getObjects()) {
74945
- if (!obj.visible) continue;
74946
- const b = obj.getBoundingBox();
74947
- if (!b) continue;
74948
- box = box ? box.union(b) : b == null ? void 0 : b.clone();
74949
- }
74950
- };
74951
- if (source) {
74952
- vimBoxUnion(source);
74953
- } else {
74954
- for (const vim of this._viewer.vims) {
74955
- vimBoxUnion(vim);
74956
- }
74957
- }
74958
- return box;
74959
- }
74960
- }
74961
75128
  function createContainer(element) {
74962
75129
  let root = element;
74963
75130
  if (root === void 0) {
@@ -75567,6 +75734,345 @@ Averrage Date/Second ${avgDataRatePS} kb
75567
75734
  component.classList.remove("behind");
75568
75735
  }
75569
75736
  }
75737
+ function SectionBoxPanel(props) {
75738
+ const [panelPosition, setPanelPosition] = React2.useState({
75739
+ top: 0,
75740
+ left: 0
75741
+ });
75742
+ const panelRef = React2.useRef(null);
75743
+ React2.useLayoutEffect(() => {
75744
+ const updatePosition = () => {
75745
+ const { top, left } = computePosition(panelRef);
75746
+ setPanelPosition({ top, left });
75747
+ };
75748
+ updatePosition();
75749
+ let resizeObserver = null;
75750
+ if (panelRef.current) {
75751
+ resizeObserver = new ResizeObserver(updatePosition);
75752
+ resizeObserver.observe(panelRef.current.parentElement);
75753
+ }
75754
+ return () => {
75755
+ if (resizeObserver) {
75756
+ resizeObserver.disconnect();
75757
+ }
75758
+ };
75759
+ }, [props.state.showOffsetPanel.get()]);
75760
+ if (!props.state.showOffsetPanel.get()) return null;
75761
+ const renderField = (id2, label, field) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "vim-sectionbox-offsets-entry vc-text-xs vc-flex vc-items-center vc-justify-center vc-justify-between vc-my-2", children: [
75762
+ /* @__PURE__ */ jsxRuntimeExports.jsx("dt", { className: "vc-w-1/2 vc-inline", children: label }),
75763
+ /* @__PURE__ */ jsxRuntimeExports.jsx("dd", { className: "vc-w-1/3 vc-inline", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
75764
+ "input",
75765
+ {
75766
+ id: id2,
75767
+ type: "text",
75768
+ value: field.get(),
75769
+ onChange: (e) => field.set(e.target.value),
75770
+ className: "vc-border vc-inline vc-border-gray-300 vc-py-1 vc-w-full vc-px-1",
75771
+ onBlur: () => field.confirm()
75772
+ }
75773
+ ) })
75774
+ ] });
75775
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
75776
+ "div",
75777
+ {
75778
+ className: "vc-fixed vc-inset-0 vc-flex vc-pointer-events-none",
75779
+ children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
75780
+ "div",
75781
+ {
75782
+ ref: panelRef,
75783
+ style: { position: "absolute", top: panelPosition.top, left: panelPosition.left, width: "min(200px, 60%)" },
75784
+ className: "vim-sectionbox-offsets vc-pointer-events-auto vc-bg-white vc-relative",
75785
+ onClick: (e) => e.stopPropagation(),
75786
+ children: [
75787
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "vim-sectionbox-header vc-px-2 vc-bg-gray-light vc-flex vc-items-center vc-justify-between ", children: [
75788
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "vc-flex vim-sectionbox-offsets-title vc-title vc-block", children: "Section Box Offsets" }),
75789
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
75790
+ "button",
75791
+ {
75792
+ className: "vc-flex vc-border-none vc-bg-transparent vc-text-sm vc-cursor-pointer",
75793
+ onClick: () => props.state.showOffsetPanel.set(false),
75794
+ children: close({ height: 12, width: 12, fill: "currentColor" })
75795
+ }
75796
+ )
75797
+ ] }),
75798
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("dl", { className: "vc-text-xl vc-text-gray-darker vc-mb-2 vc-mx-2 ", children: [
75799
+ renderField("topOffset", "Top Offset", props.state.topOffset),
75800
+ renderField("sideOffseet", "Side Offset", props.state.sideOffset),
75801
+ renderField("bottomOffset", "Bottom Offset", props.state.bottomOffset)
75802
+ ] })
75803
+ ]
75804
+ }
75805
+ )
75806
+ }
75807
+ );
75808
+ }
75809
+ function computePosition(panelRef) {
75810
+ const origin = document.getElementById("vim-control-bar");
75811
+ if (origin && panelRef.current) {
75812
+ const originRect = origin.getBoundingClientRect();
75813
+ const panelRect = panelRef.current.getBoundingClientRect();
75814
+ let left = originRect.left + originRect.width / 2 - panelRect.width / 2;
75815
+ let top = originRect.top - 10 - panelRect.height;
75816
+ if (top < 10) {
75817
+ top = originRect.bottom + 10;
75818
+ }
75819
+ if (left < 10) {
75820
+ left = 10;
75821
+ }
75822
+ if (left + panelRect.width > window.innerWidth - 10) {
75823
+ left = window.innerWidth - panelRect.width - 10;
75824
+ }
75825
+ return { top, left };
75826
+ }
75827
+ return { top: 0, left: 0 };
75828
+ }
75829
+ function addBox(b1, b2) {
75830
+ const r = b1.clone();
75831
+ r.min.x += b2.min.x;
75832
+ r.min.y += b2.min.y;
75833
+ r.min.z += b2.min.z;
75834
+ r.max.x += b2.max.x;
75835
+ r.max.y += b2.max.y;
75836
+ r.max.z += b2.max.z;
75837
+ return r;
75838
+ }
75839
+ function useStateRef(initialValue) {
75840
+ const [value, setValue] = React2.useState(initialValue);
75841
+ const ref = React2.useRef(initialValue);
75842
+ const event = React2.useRef(new distExports.SimpleEventDispatcher());
75843
+ const validate = React2.useRef((value2) => value2);
75844
+ const confirm = React2.useRef((value2) => value2);
75845
+ const set2 = (value2) => {
75846
+ const finalValue = validate.current(value2) ?? value2;
75847
+ if (finalValue === void 0) return;
75848
+ if (finalValue === ref.current) return;
75849
+ ref.current = finalValue;
75850
+ setValue(finalValue);
75851
+ event.current.dispatch(finalValue);
75852
+ };
75853
+ return {
75854
+ get() {
75855
+ return ref.current;
75856
+ },
75857
+ set: set2,
75858
+ confirm() {
75859
+ set2(confirm.current(ref.current));
75860
+ },
75861
+ useOnChange(on) {
75862
+ React2.useEffect(() => {
75863
+ return event.current.subscribe(on);
75864
+ }, []);
75865
+ },
75866
+ useMemo(on, deps) {
75867
+ return React2.useMemo(() => on(value), [...deps || [], value]);
75868
+ },
75869
+ useValidate(on) {
75870
+ React2.useEffect(() => {
75871
+ validate.current = on;
75872
+ }, []);
75873
+ },
75874
+ useConfirm(on) {
75875
+ React2.useEffect(() => {
75876
+ confirm.current = on;
75877
+ }, []);
75878
+ }
75879
+ };
75880
+ }
75881
+ function useActionRef(action) {
75882
+ const ref = React2.useRef(action);
75883
+ return {
75884
+ call() {
75885
+ ref == null ? void 0 : ref.current();
75886
+ },
75887
+ set(func) {
75888
+ ref.current = func;
75889
+ }
75890
+ };
75891
+ }
75892
+ function useArgActionRef(action) {
75893
+ const ref = React2.useRef(action);
75894
+ return {
75895
+ call(arg) {
75896
+ ref == null ? void 0 : ref.current(arg);
75897
+ },
75898
+ set(func) {
75899
+ ref.current = func;
75900
+ }
75901
+ };
75902
+ }
75903
+ function useFuncRef(func) {
75904
+ const ref = React2.useRef(func);
75905
+ return {
75906
+ call() {
75907
+ return ref == null ? void 0 : ref.current();
75908
+ },
75909
+ set(func2) {
75910
+ ref.current = func2;
75911
+ }
75912
+ };
75913
+ }
75914
+ function useAsyncFuncRef(func) {
75915
+ const ref = React2.useRef(func);
75916
+ return {
75917
+ async call() {
75918
+ return ref == null ? void 0 : ref.current();
75919
+ },
75920
+ set(func2) {
75921
+ ref.current = func2;
75922
+ }
75923
+ };
75924
+ }
75925
+ function useSectionBox(adapter) {
75926
+ const enable = useStateRef(false);
75927
+ const visible2 = useStateRef(false);
75928
+ const showOffsetPanel = useStateRef(false);
75929
+ const auto = useStateRef(false);
75930
+ const topOffset = useStateRef("1");
75931
+ const sideOffset = useStateRef("1");
75932
+ const bottomOffset = useStateRef("1");
75933
+ const boxRef = React2.useRef(adapter.getBox());
75934
+ enable.useOnChange((v) => {
75935
+ visible2.set(v);
75936
+ showOffsetPanel.set(false);
75937
+ if (v && auto.get()) {
75938
+ sectionSelection.call();
75939
+ } else {
75940
+ sectionReset.call();
75941
+ }
75942
+ });
75943
+ visible2.useValidate((v) => enable.get() && v);
75944
+ showOffsetPanel.useValidate((v) => enable.get() && v);
75945
+ topOffset.useConfirm((v) => sanitize(v, true));
75946
+ sideOffset.useConfirm((v) => sanitize(v, true));
75947
+ bottomOffset.useConfirm((v) => sanitize(v, true));
75948
+ topOffset.useOnChange((v) => section.call(boxRef.current));
75949
+ sideOffset.useOnChange((v) => section.call(boxRef.current));
75950
+ bottomOffset.useOnChange((v) => section.call(boxRef.current));
75951
+ auto.useOnChange((v) => {
75952
+ if (v) sectionSelection.call();
75953
+ });
75954
+ visible2.useOnChange((v) => adapter.setVisible(v));
75955
+ React2.useEffect(() => {
75956
+ adapter.setVisible(false);
75957
+ return adapter.onSelectionChanged.sub(() => {
75958
+ if (auto.get() && enable.get()) sectionSelection.call();
75959
+ });
75960
+ }, []);
75961
+ const section = useArgActionRef((baseBox) => {
75962
+ boxRef.current = baseBox;
75963
+ const newBox = addBox(baseBox, offsetsToBox3(topOffset.get(), sideOffset.get(), bottomOffset.get()));
75964
+ adapter.fitBox(newBox);
75965
+ });
75966
+ const sectionSelection = useFuncRef(async () => {
75967
+ try {
75968
+ const box = await adapter.getSelectionBox() ?? await adapter.getRendererBox();
75969
+ section.call(box);
75970
+ } catch (e) {
75971
+ console.error(e);
75972
+ }
75973
+ });
75974
+ const sectionReset = useFuncRef(async () => {
75975
+ const box = await adapter.getRendererBox();
75976
+ section.call(box);
75977
+ });
75978
+ return {
75979
+ enable,
75980
+ visible: visible2,
75981
+ auto,
75982
+ showOffsetPanel,
75983
+ topOffset,
75984
+ sideOffset,
75985
+ bottomOffset,
75986
+ sectionSelection,
75987
+ sectionReset,
75988
+ section
75989
+ };
75990
+ }
75991
+ const sanitize = (value, strict) => {
75992
+ if (!strict) {
75993
+ if (value === "" || value === "-") return value;
75994
+ }
75995
+ const num = parseFloat(value);
75996
+ if (isNaN(num)) {
75997
+ return strict ? "1" : void 0;
75998
+ }
75999
+ return String(num);
76000
+ };
76001
+ function offsetsToBox3(top, side, bottom) {
76002
+ const getNumber = (s) => {
76003
+ const num = parseFloat(s);
76004
+ return isNaN(num) ? 0 : num;
76005
+ };
76006
+ return new Box3(
76007
+ new Vector3(-getNumber(side), -getNumber(side), -getNumber(bottom)),
76008
+ new Vector3(getNumber(side), getNumber(side), getNumber(top))
76009
+ );
76010
+ }
76011
+ function useWebglSectionBox(viewer) {
76012
+ const vimAdapter = {
76013
+ setVisible: (b) => {
76014
+ viewer.gizmos.sectionBox.visible = b;
76015
+ viewer.gizmos.sectionBox.interactive = b;
76016
+ },
76017
+ getBox: () => viewer.gizmos.sectionBox.box.clone(),
76018
+ fitBox: (box) => viewer.gizmos.sectionBox.fitBox(box),
76019
+ getSelectionBox: () => Promise.resolve(viewer.selection.getBoundingBox()),
76020
+ getRendererBox: () => Promise.resolve(viewer.renderer.getBoundingBox()),
76021
+ onSelectionChanged: viewer.selection.onValueChanged
76022
+ };
76023
+ viewer.gizmos.sectionBox.clip = true;
76024
+ return useSectionBox(vimAdapter);
76025
+ }
76026
+ function useCamera(adapter) {
76027
+ const autoCamera2 = useStateRef(false);
76028
+ autoCamera2.useOnChange((v) => {
76029
+ if (v) {
76030
+ frameSelection2.call();
76031
+ }
76032
+ });
76033
+ React2.useEffect(() => {
76034
+ adapter.onSelectionChanged.sub(() => {
76035
+ if (autoCamera2.get()) {
76036
+ frameSelection2.call();
76037
+ }
76038
+ });
76039
+ }, []);
76040
+ const reset = useActionRef(() => adapter.resetCamera(1));
76041
+ const frameSelection2 = useAsyncFuncRef(async () => {
76042
+ console.log("frameSelection");
76043
+ if (!adapter.hasSelection()) {
76044
+ frameScene.call();
76045
+ return;
76046
+ }
76047
+ const box = await adapter.getSelectionBox();
76048
+ if (!box) {
76049
+ return;
76050
+ }
76051
+ adapter.frameCamera(box, 1);
76052
+ });
76053
+ const frameScene = useAsyncFuncRef(async () => {
76054
+ adapter.frameAll(1);
76055
+ });
76056
+ return {
76057
+ autoCamera: autoCamera2,
76058
+ reset,
76059
+ frameSelection: frameSelection2,
76060
+ frameScene
76061
+ };
76062
+ }
76063
+ function useWebglCamera(viewer) {
76064
+ return useCamera({
76065
+ onSelectionChanged: viewer.selection.onValueChanged,
76066
+ frameCamera: (box, duration) => viewer.camera.lerp(duration).frame(box),
76067
+ resetCamera: (duration) => viewer.camera.lerp(duration).reset(),
76068
+ frameAll: (duration) => {
76069
+ const box = viewer.renderer.getBoundingBox();
76070
+ viewer.camera.lerp(duration).frame(box);
76071
+ },
76072
+ hasSelection: () => viewer.selection.count > 0,
76073
+ getSelectionBox: () => Promise.resolve(viewer.selection.getBoundingBox())
76074
+ });
76075
+ }
75570
76076
  function createWebglComponent(container, componentSettings = {}, viewerSettings = {}) {
75571
76077
  const promise2 = new DeferredPromise();
75572
76078
  const cmpContainer = container instanceof HTMLElement ? createContainer(container) : container ?? createContainer();
@@ -75598,7 +76104,7 @@ Averrage Date/Second ${avgDataRatePS} kb
75598
76104
  var _a2;
75599
76105
  const settings2 = useSettings(props.viewer, props.settings ?? {});
75600
76106
  const modal = useModal(settings2.value.capacity.canFollowUrl);
75601
- const camera2 = React2.useMemo(() => new ComponentCamera(props.viewer), []);
76107
+ const camera2 = useWebglCamera(props.viewer);
75602
76108
  const cursor = React2.useMemo(() => new CursorManager(props.viewer), []);
75603
76109
  const loader = React2.useRef(new ComponentLoader(props.viewer, modal));
75604
76110
  const [isolation] = React2.useState(() => new Isolation(props.viewer, camera2, settings2.value));
@@ -75608,11 +76114,13 @@ Averrage Date/Second ${avgDataRatePS} kb
75608
76114
  Math.min(props.container.root.clientWidth * 0.25, 340)
75609
76115
  );
75610
76116
  const [contextMenu2, setcontextMenu] = React2.useState();
75611
- const [controlBar2, setControlBar] = React2.useState();
76117
+ const [controlBarCustom, setControlBarCustom] = React2.useState();
75612
76118
  const bimInfoRef = useBimInfo();
75613
76119
  const viewerState = useViewerState(props.viewer);
75614
76120
  const treeRef = React2.useRef();
75615
76121
  const performanceRef = React2.useRef(null);
76122
+ const sectionBox2 = useWebglSectionBox(props.viewer);
76123
+ const controlBar2 = useControlBar(props.viewer, camera2, modal, side, isolation, cursor, settings2.value, sectionBox2, controlBarCustom);
75616
76124
  React2.useEffect(() => {
75617
76125
  var _a3;
75618
76126
  side.setHasBim(((_a3 = viewerState.vim) == null ? void 0 : _a3.bim) !== void 0);
@@ -75637,11 +76145,14 @@ Averrage Date/Second ${avgDataRatePS} kb
75637
76145
  isolation,
75638
76146
  camera: camera2,
75639
76147
  settings: settings2,
76148
+ get sectionBox() {
76149
+ return sectionBox2;
76150
+ },
75640
76151
  contextMenu: {
75641
76152
  customize: (v) => setcontextMenu(() => v)
75642
76153
  },
75643
76154
  controlBar: {
75644
- customize: (v) => setControlBar(() => v)
76155
+ customize: (v) => setControlBarCustom(() => v)
75645
76156
  },
75646
76157
  modal,
75647
76158
  bimInfo: bimInfoRef,
@@ -75695,16 +76206,11 @@ Averrage Date/Second ${avgDataRatePS} kb
75695
76206
  /* @__PURE__ */ jsxRuntimeExports.jsx(
75696
76207
  ControlBar,
75697
76208
  {
75698
- viewer: props.viewer,
75699
- camera: camera2,
75700
- modal,
75701
- side,
75702
- isolation,
75703
- cursor,
75704
- settings: settings2.value,
75705
- customization: controlBar2
76209
+ content: controlBar2,
76210
+ show: isTrue(settings2.value.ui.controlBar)
75706
76211
  }
75707
76212
  ),
76213
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SectionBoxPanel, { state: sectionBox2 }),
75708
76214
  /* @__PURE__ */ jsxRuntimeExports.jsx(
75709
76215
  AxesPanelMemo,
75710
76216
  {
@@ -76030,12 +76536,65 @@ Averrage Date/Second ${avgDataRatePS} kb
76030
76536
  return serverConnectionError(source.url);
76031
76537
  }
76032
76538
  }
76539
+ function updateModal(modal, state) {
76540
+ if (state.status === "connected") {
76541
+ modal.loading(void 0);
76542
+ modal.message(void 0);
76543
+ }
76544
+ if (state.status === "connecting") {
76545
+ if (modal.current === void 0 || modal.current.type === "loading") {
76546
+ modal.loading({ message: "Connecting to VIM Ultra server..." });
76547
+ }
76548
+ }
76549
+ if (state.status === "error") {
76550
+ console.log("Error loading vim", state);
76551
+ modal.message(getErrorMessage(state));
76552
+ }
76553
+ }
76554
+ async function updateProgress(request2, modal) {
76555
+ for await (const progress of request2.getProgress()) {
76556
+ if (request2.isCompleted) break;
76557
+ modal.loading({ message: "Loading File in VIM Ultra mode", progress });
76558
+ }
76559
+ }
76560
+ function useUltraSectionBox(viewer) {
76561
+ const ultraAdapter = {
76562
+ setVisible: (b) => {
76563
+ console.log("SetVisible!", b);
76564
+ viewer.sectionBox.visible = b;
76565
+ viewer.sectionBox.interactive = b;
76566
+ },
76567
+ getBox: () => viewer.sectionBox.getBox().clone(),
76568
+ fitBox: (box) => viewer.sectionBox.fitBox(box),
76569
+ getSelectionBox: () => viewer.selection.getBoundingBox(),
76570
+ getRendererBox: () => viewer.renderer.getBoundingBox(),
76571
+ onSelectionChanged: viewer.selection.onValueChanged
76572
+ };
76573
+ return useSectionBox(ultraAdapter);
76574
+ }
76575
+ function useUltraControlBar(viewer, section, camera2, customization) {
76576
+ const sectionSectionBox = controlBarSectionBox(section, viewer.selection.count > 0);
76577
+ const sectionCamera = controlBarCamera(camera2);
76578
+ let bar = [sectionCamera, sectionSectionBox];
76579
+ bar = (customization == null ? void 0 : customization(bar)) ?? bar;
76580
+ return bar;
76581
+ }
76582
+ function useUltraCamera(viewer) {
76583
+ return useCamera({
76584
+ onSelectionChanged: viewer.selection.onValueChanged,
76585
+ frameCamera: (box, duration) => void viewer.camera.frameBox(box, duration),
76586
+ frameAll: (duration) => viewer.camera.frameAll(duration),
76587
+ resetCamera: (duration) => viewer.camera.restoreSavedPosition(duration),
76588
+ hasSelection: () => viewer.selection.count > 0,
76589
+ getSelectionBox: () => viewer.selection.getBoundingBox()
76590
+ });
76591
+ }
76033
76592
  function createUltraComponent(container) {
76034
76593
  const promise2 = new DeferredPromise();
76035
76594
  const cmpContainer = container instanceof HTMLElement ? createContainer(container) : container ?? createContainer();
76036
76595
  const viewer = Viewer.createWithCanvas(cmpContainer.gfx);
76037
76596
  const reactRoot = clientExports.createRoot(cmpContainer.ui);
76038
- const patchRef = (cmp) => {
76597
+ const attachDispose = (cmp) => {
76039
76598
  cmp.dispose = () => {
76040
76599
  viewer.dispose();
76041
76600
  cmpContainer.dispose();
@@ -76049,7 +76608,7 @@ Averrage Date/Second ${avgDataRatePS} kb
76049
76608
  {
76050
76609
  container: cmpContainer,
76051
76610
  viewer,
76052
- onMount: (cmp) => promise2.resolve(patchRef(cmp))
76611
+ onMount: (cmp) => promise2.resolve(attachDispose(cmp))
76053
76612
  }
76054
76613
  )
76055
76614
  );
@@ -76057,32 +76616,60 @@ Averrage Date/Second ${avgDataRatePS} kb
76057
76616
  }
76058
76617
  function UltraComponent(props) {
76059
76618
  const modal = useModal(true);
76619
+ const sectionBox2 = useUltraSectionBox(props.viewer);
76620
+ const camera2 = useUltraCamera(props.viewer);
76621
+ const side = useSideState(true, 400);
76622
+ const [_, setSelectState] = React2.useState(0);
76623
+ const [controlBarCustom, setControlBarCustom] = React2.useState(() => (c) => c);
76624
+ const controlBar2 = useUltraControlBar(props.viewer, sectionBox2, camera2, (_2) => _2);
76060
76625
  React2.useEffect(() => {
76061
76626
  props.viewer.onStateChanged.subscribe((state) => updateModal(modal, state));
76062
- props.onMount(ToRef(props.viewer, modal));
76627
+ props.viewer.selection.onValueChanged.subscribe(() => {
76628
+ setSelectState((i2) => (i2 + 1) % 2);
76629
+ });
76630
+ props.onMount({
76631
+ viewer: props.viewer,
76632
+ modal,
76633
+ sectionBox: sectionBox2,
76634
+ camera: camera2,
76635
+ dispose: () => {
76636
+ },
76637
+ controlBar: {
76638
+ customize: (v) => setControlBarCustom(() => v)
76639
+ },
76640
+ load: patchLoad(props.viewer, modal)
76641
+ });
76063
76642
  }, []);
76064
76643
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
76065
- /* @__PURE__ */ jsxRuntimeExports.jsx(Overlay, { canvas: props.viewer.viewport.canvas }),
76066
- /* @__PURE__ */ jsxRuntimeExports.jsx(Modal, { state: modal })
76644
+ /* @__PURE__ */ jsxRuntimeExports.jsx(RestOfScreen, { side, content: () => {
76645
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
76646
+ whenTrue(true, /* @__PURE__ */ jsxRuntimeExports.jsx(LogoMemo, {})),
76647
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Overlay, { canvas: props.viewer.viewport.canvas }),
76648
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
76649
+ ControlBar,
76650
+ {
76651
+ content: controlBarCustom(controlBar2),
76652
+ show: true
76653
+ }
76654
+ ),
76655
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SectionBoxPanel, { state: sectionBox2 })
76656
+ ] });
76657
+ } }),
76658
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Modal, { state: modal }),
76659
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
76660
+ ReactTooltip,
76661
+ {
76662
+ multiline: true,
76663
+ arrowColor: "transparent",
76664
+ type: "light",
76665
+ className: "!vc-max-w-xs !vc-border !vc-border-solid !vc-border-gray-medium !vc-bg-white !vc-text-xs !vc-text-gray-darkest !vc-opacity-100 !vc-shadow-[2px_6px_15px_rgba(0,0,0,0.3)] !vc-transition-opacity",
76666
+ delayShow: 200
76667
+ }
76668
+ )
76067
76669
  ] });
76068
76670
  }
76069
- function updateModal(modal, state) {
76070
- if (state.status === "connected") {
76071
- modal.loading(void 0);
76072
- modal.message(void 0);
76073
- }
76074
- if (state.status === "connecting") {
76075
- if (modal.current === void 0 || modal.current.type === "loading") {
76076
- modal.loading({ message: "Connecting to VIM Ultra server..." });
76077
- }
76078
- }
76079
- if (state.status === "error") {
76080
- console.log("Error loading vim", state);
76081
- modal.message(getErrorMessage(state));
76082
- }
76083
- }
76084
- function ToRef(viewer, modal) {
76085
- function load(source) {
76671
+ function patchLoad(viewer, modal) {
76672
+ return function load(source) {
76086
76673
  const request2 = viewer.loadVim(source);
76087
76674
  void updateProgress(request2, modal);
76088
76675
  void request2.getResult().then(
@@ -76097,23 +76684,11 @@ Averrage Date/Second ${avgDataRatePS} kb
76097
76684
  }
76098
76685
  );
76099
76686
  return request2;
76100
- }
76101
- return {
76102
- viewer,
76103
- modal,
76104
- dispose: () => {
76105
- },
76106
- load
76107
76687
  };
76108
76688
  }
76109
- async function updateProgress(request2, modal) {
76110
- for await (const progress of request2.getProgress()) {
76111
- if (request2.isCompleted) break;
76112
- modal.loading({ message: "Loading File in VIM Ultra mode", progress });
76113
- }
76114
- }
76115
76689
  const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
76116
76690
  __proto__: null,
76691
+ ControlBar: controlBar,
76117
76692
  UltraComponent,
76118
76693
  createUltraComponent
76119
76694
  }, Symbol.toStringTag, { value: "Module" }));