iflow-engine-base 4.0.12 → 4.0.13

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.
@@ -1,10 +1,10 @@
1
- import { bl as $s, bm as qe, bn as qi, bo as Js, bp as Zs, bq as eo, br as to, bs as io, bt as no, bu as so, bv as oo, a_ as nn, bw as ro, bx as ao, by as lo, bz as co, bA as ho, bB as uo, bC as ns, V as d, bD as Jt, bE as po, bF as xt, bG as go, bH as mo, bI as fo, bJ as sn, bK as yo, n as li, bL as vo, bM as Mo, K as Zt, O as Ve, a as O, U as Ze, _ as bo, $ as ot, b as K, Q as Re, q as ss, R as be, E as Xe, G as Pe, a0 as os, r as R, a1 as Gi, a2 as rs, M as z, f as ui, ao as St, an as At, t as Pt, H as ve, j as V, I as G, C as de, i as Ge, d as as, ae as ls, af as cs, D as Ee, ag as xo, ah as hs, B as ue, ai as wo, u as Tt, m as Ti, ak as Co, al as ds, am as Eo, v as Be, h as le, ap as ei, p as us, X as So, bN as Ao, Y as Po, Z as Wi, bO as To, W as ps, T as pt, ar as on, L as et, o as gs, as as Io, at as Do, k as Ii, z as ti, au as _o, av as dt, aw as ko, ax as Lo, bP as ms, F as Di, g as ii, bQ as Ro, az as ni, aB as Bo, aF as zo, aG as Oo, a4 as No, a5 as Fo, a6 as rn, bR as mt, bS as an, bT as ft, bU as ln, bV as pi, bW as Ho, bX as Vo, bY as gi, aH as Uo, aI as qo, aJ as Go, aK as Wo, aL as Ko, aM as jo, aN as Yo, aO as fs, c as Qo, aP as Xo, aQ as $o, J as ys, w as Jo, x as Zo, y as er, aR as tr, aS as ir, aT as nr, aq as sr } from "./three-vendor-DviDCxmZ.js";
2
- import { a as si, J as _i, c as or, b as rr, P as mi, q as ar, k as lr, n as cn, E as hn, S as cr } from "./sdk-vendor-DXennwpt.js";
3
- import { W as Me, b as wt, B as dn, C as hr, g as ze, L as dr, E as ur, r as pr } from "./sdk-runtime-CJ-_AbdZ.js";
4
- import { E as se, S as gr, c as mr, d as fr } from "./engine-3d-DTgYyZJM.js";
5
- import { r as Z, g as yr } from "./sdk-assets-Cmg-KxYC.js";
6
- import { D as Qe, g as Te, E as oe, a as _e, b as it, c as Ki, d as ji, f as Yi, e as ut, h as oi, s as vr, i as ki, j as un, k as Bt, l as pn, m as Li, n as gn, A as Mr, M as br } from "./index-1dEeNoV9.js";
7
- import { L as xr } from "./engine-2d-CHAlWyo6.js";
1
+ import { bl as $s, bm as qe, bn as qi, bo as Js, bp as Zs, bq as eo, br as to, bs as io, bt as no, bu as so, bv as oo, a_ as nn, bw as ro, bx as ao, by as lo, bz as co, bA as ho, bB as uo, bC as ns, V as d, bD as Jt, bE as po, bF as wt, bG as go, bH as mo, bI as fo, bJ as sn, bK as yo, n as li, bL as vo, bM as Mo, K as Zt, O as Ve, a as B, U as Ze, _ as bo, $ as rt, b as K, Q as Re, q as ss, R as be, E as Xe, G as Pe, a0 as os, r as R, a1 as Gi, a2 as rs, M as O, f as ui, ao as At, an as et, t as Pt, H as ve, j as V, I as G, C as de, i as Ge, d as as, ae as ls, af as cs, D as Ee, ag as xo, ah as hs, B as ue, ai as wo, u as Tt, m as Ti, ak as Co, al as ds, am as Eo, v as Be, h as le, ap as ei, p as us, X as So, bN as Ao, Y as Po, Z as Wi, bO as To, W as ps, T as gt, ar as on, L as tt, o as gs, as as Io, at as Do, k as Ii, z as ti, bP as _o, av as ut, aw as ko, ax as Lo, bQ as ms, F as Di, g as ii, bR as Ro, az as ni, aB as Bo, aF as zo, aG as Oo, a4 as No, a5 as Fo, a6 as rn, bS as ft, bT as an, bU as yt, bV as ln, bW as pi, bX as Ho, bY as Vo, bZ as gi, aH as Uo, aI as qo, aJ as Go, aK as Wo, aL as Ko, aM as jo, aN as Yo, aO as fs, c as Qo, aP as Xo, aQ as $o, J as ys, w as Jo, x as Zo, y as er, aR as tr, aS as ir, aT as nr, aq as sr } from "./three-vendor-DHr-97HU.js";
2
+ import { a as si, J as _i, c as or, b as rr, P as mi, q as ar, k as lr, n as cn, E as hn, S as cr } from "./sdk-vendor-B4nKsNHU.js";
3
+ import { W as Me, b as Ct, B as dn, C as hr, g as ze, L as dr, E as ur, r as pr } from "./sdk-runtime-vrArGN3k.js";
4
+ import { E as se, S as gr, c as mr, d as fr } from "./engine-3d-42Tf3vJ_.js";
5
+ import { r as Z, g as yr } from "./sdk-assets-mAj_i35q.js";
6
+ import { D as Qe, g as Te, E as oe, a as _e, b as nt, c as Ki, d as ji, f as Yi, e as pt, h as oi, s as vr, i as ki, j as un, k as Bt, l as pn, m as Li, n as gn, A as Mr, M as br } from "./index-CViEDde1.js";
7
+ import { L as xr } from "./engine-2d-D4sNfssD.js";
8
8
  function wr(a) {
9
9
  const { camera: e, depthNode: t, inputNode: i, normalNode: n, parameters: s } = a, o = s.gtao, r = $s(t, n, e);
10
10
  return r.resolutionScale = o.resolutionScale, r.radius.value = o.radius, r.thickness.value = o.thickness, r.distanceExponent.value = o.distanceExponent, r.distanceFallOff.value = o.distanceFallOff, r.scale.value = o.scale, r.samples.value = o.samples, r.useTemporalFiltering = o.useTemporalFiltering && a.temporalFiltering, {
@@ -80,7 +80,7 @@ function Pr(a, e) {
80
80
  return { outputNode: a, node: null, dispose: () => {
81
81
  } };
82
82
  const r = Jt(t.x, t.y, t.z), l = ns(() => {
83
- const h = a.rgb.mul(r), u = Jt(po(h)), g = xt(u, h, i).sub(0.5).mul(n).add(0.5);
83
+ const h = a.rgb.mul(r), u = Jt(po(h)), g = wt(u, h, i).sub(0.5).mul(n).add(0.5);
84
84
  return qe(g.max(0), a.a);
85
85
  })();
86
86
  if (s === 0)
@@ -314,7 +314,7 @@ class Lr {
314
314
  }
315
315
  const o = qi(this.overlayScene, this.camera), r = o.getTextureNode("output");
316
316
  return s = qe(
317
- xt(s.rgb, r.rgb, r.a),
317
+ wt(s.rgb, r.rgb, r.a),
318
318
  Mo(s.a, r.a)
319
319
  ), { outputNode: s, pipelines: i, scenePassInputs: t, overlayPass: o, passes: n };
320
320
  }
@@ -537,7 +537,7 @@ class te {
537
537
  const i = Math.max(
538
538
  e.position.distanceTo(t),
539
539
  te.MIN_CAMERA_DISTANCE
540
- ), n = O.degToRad(e.getEffectiveFOV() * 0.5);
540
+ ), n = B.degToRad(e.getEffectiveFOV() * 0.5);
541
541
  return Math.max(
542
542
  2 * i * Math.tan(n),
543
543
  te.MIN_VISIBLE_HEIGHT
@@ -656,7 +656,7 @@ class te {
656
656
  if (t?.adjustDistance !== !1 && this.engine.camera === i && this.engine.controls?.target) {
657
657
  const r = this.engine.controls.target.clone(), l = i.position.clone(), c = l.distanceTo(r);
658
658
  if (c > 1e-6) {
659
- const h = O.degToRad(n * 0.5), u = O.degToRad(s * 0.5), p = Math.tan(h) / Math.tan(u), g = c * p, y = new d().subVectors(l, r).normalize();
659
+ const h = B.degToRad(n * 0.5), u = B.degToRad(s * 0.5), p = Math.tan(h) / Math.tan(u), g = c * p, y = new d().subVectors(l, r).normalize();
660
660
  i.position.copy(r).add(y.multiplyScalar(g));
661
661
  }
662
662
  }
@@ -669,7 +669,7 @@ class te {
669
669
  const e = this.engine.camera;
670
670
  if (!e)
671
671
  return;
672
- const t = e.position.clone(), i = this.engine.controls.target.clone(), n = e.quaternion.clone(), s = e.up.clone(), o = this.perspectiveCamera, r = this.getViewDirection(t, i, n), l = e instanceof Ve ? this.getOrthographicVisibleHeight(e) : this.getPerspectiveVisibleHeight(e, i), c = O.degToRad(o.getEffectiveFOV() * 0.5), h = Math.max(
672
+ const t = e.position.clone(), i = this.engine.controls.target.clone(), n = e.quaternion.clone(), s = e.up.clone(), o = this.perspectiveCamera, r = this.getViewDirection(t, i, n), l = e instanceof Ve ? this.getOrthographicVisibleHeight(e) : this.getPerspectiveVisibleHeight(e, i), c = B.degToRad(o.getEffectiveFOV() * 0.5), h = Math.max(
673
673
  l / (2 * Math.tan(c)),
674
674
  te.MIN_CAMERA_DISTANCE
675
675
  );
@@ -682,7 +682,7 @@ class te {
682
682
  const e = this.engine.camera;
683
683
  if (!e)
684
684
  return;
685
- const t = e.position.clone(), i = this.engine.controls.target.clone(), n = e.quaternion.clone(), s = e.up.clone(), o = this.orthographicCamera, r = this.getViewDirection(t, i, n), l = e instanceof Zt ? this.getPerspectiveVisibleHeight(e, i) : this.getOrthographicVisibleHeight(e), c = O.degToRad(e.getEffectiveFOV() * 0.5), h = Math.max(
685
+ const t = e.position.clone(), i = this.engine.controls.target.clone(), n = e.quaternion.clone(), s = e.up.clone(), o = this.orthographicCamera, r = this.getViewDirection(t, i, n), l = e instanceof Zt ? this.getPerspectiveVisibleHeight(e, i) : this.getOrthographicVisibleHeight(e), c = B.degToRad(e.getEffectiveFOV() * 0.5), h = Math.max(
686
686
  l / (2 * Math.tan(c)),
687
687
  te.MIN_CAMERA_DISTANCE
688
688
  );
@@ -844,7 +844,7 @@ const Nr = { type: "change" }, mn = { type: "start" }, fn = { type: "end" }, $ =
844
844
  DOLLY: 2,
845
845
  TOUCH_ROTATE: 3,
846
846
  TOUCH_DOLLY_PAN: 4
847
- }, vi = new d(1, 0, 0), Fr = new d(0, 1, 0), Hr = new d(0, 0, 1), rt = new d(), zt = new d(), Ce = new d(), Y = new d(), Ie = new d(), ce = new d(), De = new d(), Vr = new d(), Ot = new Re(), Mi = new Re(), yn = /* @__PURE__ */ new Set([
847
+ }, vi = new d(1, 0, 0), Fr = new d(0, 1, 0), Hr = new d(0, 0, 1), at = new d(), zt = new d(), Ce = new d(), Y = new d(), Ie = new d(), ce = new d(), De = new d(), Vr = new d(), Ot = new Re(), Mi = new Re(), yn = /* @__PURE__ */ new Set([
848
848
  "KeyW",
849
849
  "KeyA",
850
850
  "KeyS",
@@ -882,9 +882,9 @@ class vs extends bo {
882
882
  RIGHT: "ArrowRight",
883
883
  BOTTOM: "ArrowDown"
884
884
  }, this.mouseButtons = {
885
- LEFT: ot.ROTATE,
886
- MIDDLE: ot.DOLLY,
887
- RIGHT: ot.PAN
885
+ LEFT: rt.ROTATE,
886
+ MIDDLE: rt.DOLLY,
887
+ RIGHT: rt.PAN
888
888
  }, this.state = ae.NONE, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this.up0 = this.object.up.clone(), this.origin0 = this.origin.clone(), this._lastZoom = this.object.zoom, this._lastPosition = this.object.position.clone(), this._lastTarget = this.target.clone(), this._lastUp = this.object.up.clone(), this._lastQuaternion = this.object.quaternion.clone(), this._referenceUp = this.object.up.clone().normalize(), this._viewRight = new d(1, 0, 0).applyQuaternion(this.object.quaternion).normalize(), this._rotateVelocity = new K(), this._panVelocity = new K(), this._zoomVelocity = 0, this._mouseStart = new K(), this._touchCenter = new K(), this._touchDistance = 0, this._pointers = /* @__PURE__ */ new Map(), this._pressedKeys = /* @__PURE__ */ new Set(), this._keyboardAnimationId = null, this._lastKeyboardMoveTime = 0, this._isInteracting = !1, this._keyDomElement = null, this._touchAction = "", this._onContextMenu = this._handleContextMenu.bind(this), this._onPointerDown = this._handlePointerDown.bind(this), this._onPointerMove = this._handlePointerMove.bind(this), this._onPointerUp = this._handlePointerUp.bind(this), this._onPointerCancel = this._handlePointerUp.bind(this), this._onWheel = this._handleWheel.bind(this), this._onKeyDown = this._handleKeyDown.bind(this), this._onKeyUp = this._handleKeyUp.bind(this), this.domElement && this.connect(this.domElement), this.update(), this.saveState();
889
889
  }
890
890
  connect(e) {
@@ -976,14 +976,14 @@ class vs extends bo {
976
976
  }
977
977
  _applyRotation(e, t) {
978
978
  const i = this._getRotatePivot(), n = this.object.position;
979
- rt.copy(n).sub(i), rt.lengthSq() < $ && rt.set(0, 0, Math.max(this.minDistance, 1)), zt.copy(this.target).sub(i), ce.copy(this.target).sub(n).normalize(), Math.abs(e) > $ && (Ot.setFromAxisAngle(this._referenceUp, -e), rt.applyQuaternion(Ot), zt.applyQuaternion(Ot), ce.applyQuaternion(Ot).normalize()), Y.copy(this._getStableRightAxis(ce)), Math.abs(t) > $ && Y.lengthSq() > $ && (Mi.setFromAxisAngle(Y, -t), rt.applyQuaternion(Mi), zt.applyQuaternion(Mi)), n.copy(i).add(rt), this.target.copy(i).add(zt);
979
+ at.copy(n).sub(i), at.lengthSq() < $ && at.set(0, 0, Math.max(this.minDistance, 1)), zt.copy(this.target).sub(i), ce.copy(this.target).sub(n).normalize(), Math.abs(e) > $ && (Ot.setFromAxisAngle(this._referenceUp, -e), at.applyQuaternion(Ot), zt.applyQuaternion(Ot), ce.applyQuaternion(Ot).normalize()), Y.copy(this._getStableRightAxis(ce)), Math.abs(t) > $ && Y.lengthSq() > $ && (Mi.setFromAxisAngle(Y, -t), at.applyQuaternion(Mi), zt.applyQuaternion(Mi)), n.copy(i).add(at), this.target.copy(i).add(zt);
980
980
  }
981
981
  _applyPan(e, t) {
982
982
  const { width: i, height: n } = vn(this.domElement);
983
983
  Y.copy(vi).applyQuaternion(this.object.quaternion).normalize(), Ie.copy(Fr).applyQuaternion(this.object.quaternion).normalize();
984
984
  let s = 0, o = 0;
985
985
  if (this.object.isPerspectiveCamera) {
986
- const l = 2 * Math.max(this.object.position.distanceTo(this.target), $) * Math.tan(O.degToRad(this.object.getEffectiveFOV() * 0.5)), c = l * this.object.aspect;
986
+ const l = 2 * Math.max(this.object.position.distanceTo(this.target), $) * Math.tan(B.degToRad(this.object.getEffectiveFOV() * 0.5)), c = l * this.object.aspect;
987
987
  s = e / i * c * this.panSpeed, o = t / n * l * this.panSpeed;
988
988
  } else if (this.object.isOrthographicCamera) {
989
989
  const r = (this.object.right - this.object.left) / this.object.zoom, l = (this.object.top - this.object.bottom) / this.object.zoom;
@@ -1141,7 +1141,7 @@ class vs extends bo {
1141
1141
  }
1142
1142
  _resolveMouseAction(e) {
1143
1143
  let t = null;
1144
- return e.button === 0 ? t = e.ctrlKey || e.metaKey || e.shiftKey ? this.mouseButtons.RIGHT : this.mouseButtons.LEFT : e.button === 1 ? t = this.mouseButtons.MIDDLE : e.button === 2 && (t = this.mouseButtons.RIGHT), t === ot.ROTATE && this.enableRotate ? ae.ROTATE : t === ot.PAN && this.enablePan ? ae.PAN : t === ot.DOLLY && this.enableZoom ? ae.DOLLY : null;
1144
+ return e.button === 0 ? t = e.ctrlKey || e.metaKey || e.shiftKey ? this.mouseButtons.RIGHT : this.mouseButtons.LEFT : e.button === 1 ? t = this.mouseButtons.MIDDLE : e.button === 2 && (t = this.mouseButtons.RIGHT), t === rt.ROTATE && this.enableRotate ? ae.ROTATE : t === rt.PAN && this.enablePan ? ae.PAN : t === rt.DOLLY && this.enableZoom ? ae.DOLLY : null;
1145
1145
  }
1146
1146
  _queueRotate(e, t) {
1147
1147
  if (!this.enableRotate || !this.domElement)
@@ -1389,7 +1389,7 @@ class bn extends ss {
1389
1389
  this.camera && (this.object = this.camera, this.camera.updateMatrixWorld?.(), this._euler.setFromQuaternion(this.camera.quaternion, "YZX"));
1390
1390
  }
1391
1391
  sanitizeCameraOrientation() {
1392
- this.camera && (this.syncRotationStateFromCamera(), this._euler.x = O.clamp(this._euler.x, -this.maxRotateX, this.maxRotateX), this._euler.z = 0, this.camera.up.set(0, 1, 0), this.camera.quaternion.setFromEuler(this._euler), this.camera.updateMatrixWorld?.(!0));
1392
+ this.camera && (this.syncRotationStateFromCamera(), this._euler.x = B.clamp(this._euler.x, -this.maxRotateX, this.maxRotateX), this._euler.z = 0, this.camera.up.set(0, 1, 0), this.camera.quaternion.setFromEuler(this._euler), this.camera.updateMatrixWorld?.(!0));
1393
1393
  }
1394
1394
  syncSharedTargetFromCamera() {
1395
1395
  if (!this.camera)
@@ -1702,7 +1702,7 @@ class xn extends ss {
1702
1702
  this.avatarRoot.rotation.y = this.getAvatarFacingYaw();
1703
1703
  }
1704
1704
  setViewPitch(e) {
1705
- this._pitch = O.clamp(e, this.minPitch, this.maxRotateX);
1705
+ this._pitch = B.clamp(e, this.minPitch, this.maxRotateX);
1706
1706
  }
1707
1707
  rotateByPointerDelta(e, t) {
1708
1708
  this.setViewYaw(this._yaw + e * this.lookHorizontalFlag * this.lookSpeed), this.setViewPitch(this._pitch + t * this.lookflag * this.lookSpeed), this.updateCameraFromAvatar(), this.dispatchCameraChange();
@@ -1872,7 +1872,7 @@ class xn extends ss {
1872
1872
  const i = this.camera.position.clone().sub(e), n = Math.hypot(i.x, i.z);
1873
1873
  if (n > 1e-6 && this.setViewYaw(Math.atan2(-i.x, i.z)), t.preserveCameraDistance !== !1) {
1874
1874
  const s = i.y - this.cameraHeight, o = Math.hypot(n, s);
1875
- Number.isFinite(o) && o > 1e-6 && (this.cameraDistance = o, this._pitch = O.clamp(
1875
+ Number.isFinite(o) && o > 1e-6 && (this.cameraDistance = o, this._pitch = B.clamp(
1876
1876
  Math.atan2(s, n),
1877
1877
  this.minPitch,
1878
1878
  this.maxRotateX
@@ -2001,7 +2001,7 @@ class Wr {
2001
2001
  r || (r = [0, 0, []]);
2002
2002
  const l = Te(n, s), c = this.getModelSnapCache(s, o, r);
2003
2003
  n.camera.updateMatrixWorld(!0);
2004
- const h = new z().multiplyMatrices(n.camera.projectionMatrix, n.camera.matrixWorldInverse), u = n.renderer.domElement.clientWidth, p = n.renderer.domElement.clientHeight, g = new K(t.offsetX, t.offsetY), y = new ui(), M = new d(), w = new d(), f = new K(), C = new K(), S = new d();
2004
+ const h = new O().multiplyMatrices(n.camera.projectionMatrix, n.camera.matrixWorldInverse), u = n.renderer.domElement.clientWidth, p = n.renderer.domElement.clientHeight, g = new K(t.offsetX, t.offsetY), y = new ui(), M = new d(), w = new d(), f = new K(), C = new K(), S = new d();
2005
2005
  let P = "face", _ = null, I = null, F = 100;
2006
2006
  if (i != null) {
2007
2007
  const k = e.point.clone(), N = e.normal || (e.face ? e.face.normal : null);
@@ -2124,17 +2124,17 @@ class Wr {
2124
2124
  if (s < 1e-10)
2125
2125
  return 0;
2126
2126
  const o = new K().subVectors(e, t);
2127
- return O.clamp(o.dot(n) / s, 0, 1);
2127
+ return B.clamp(o.dot(n) / s, 0, 1);
2128
2128
  }
2129
2129
  /**
2130
2130
  * 透视相机下需要根据裁剪空间的 w 反推三维插值比例,保证线捕捉点正确。
2131
2131
  */
2132
2132
  pointToLineProjection3D(e, t, i, n, s) {
2133
- const o = O.clamp(e, 0, 1);
2133
+ const o = B.clamp(e, 0, 1);
2134
2134
  if (!this.engine.camera.isPerspectiveCamera)
2135
2135
  return s.lerpVectors(t, i, o);
2136
2136
  const r = new ui(t.x, t.y, t.z, 1).applyMatrix4(n), c = new ui(i.x, i.y, i.z, 1).applyMatrix4(n).w * (1 - o) + o * r.w, h = Math.abs(c) > 1e-10 ? o * r.w / c : o;
2137
- return s.lerpVectors(t, i, O.clamp(h, 0, 1));
2137
+ return s.lerpVectors(t, i, B.clamp(h, 0, 1));
2138
2138
  }
2139
2139
  /**
2140
2140
  * 渲染点捕捉指示器,并复用原有的图形语义。
@@ -2233,9 +2233,9 @@ function Qi(a) {
2233
2233
  e.mouseMoveFrame != null && (cancelAnimationFrame(e.mouseMoveFrame), e.mouseMoveFrame = null), e.latestMouseMoveEvent = null;
2234
2234
  }
2235
2235
  e.active = function() {
2236
- a.renderer.domElement.addEventListener("mousedown", re), a.renderer.domElement.addEventListener("mouseup", ne), a.renderer.domElement.addEventListener("mousemove", ie), a.renderer.domElement.addEventListener("touchstart", T, { capture: !0, passive: !1 }), a.renderer.domElement.addEventListener("touchend", A, { capture: !0, passive: !1 }), a.renderer.domElement.addEventListener("touchcancel", A, { capture: !0, passive: !1 }), a.renderer.domElement.addEventListener("touchmove", D, { capture: !0, passive: !1 }), a.renderer.domElement.addEventListener("pointerdown", B, !0), a.renderer.domElement.addEventListener("pointermove", U, !0), a.renderer.domElement.addEventListener("pointerup", q, !0), a.renderer.domElement.addEventListener("pointercancel", q, !0), window.addEventListener("keydown", c), window.addEventListener("keyup", h);
2236
+ a.renderer.domElement.addEventListener("mousedown", re), a.renderer.domElement.addEventListener("mouseup", ne), a.renderer.domElement.addEventListener("mousemove", ie), a.renderer.domElement.addEventListener("touchstart", T, { capture: !0, passive: !1 }), a.renderer.domElement.addEventListener("touchend", A, { capture: !0, passive: !1 }), a.renderer.domElement.addEventListener("touchcancel", A, { capture: !0, passive: !1 }), a.renderer.domElement.addEventListener("touchmove", D, { capture: !0, passive: !1 }), a.renderer.domElement.addEventListener("pointerdown", z, !0), a.renderer.domElement.addEventListener("pointermove", U, !0), a.renderer.domElement.addEventListener("pointerup", q, !0), a.renderer.domElement.addEventListener("pointercancel", q, !0), window.addEventListener("keydown", c), window.addEventListener("keyup", h);
2237
2237
  }, e.disActive = function() {
2238
- f(), l(), N(), a.renderer.domElement.removeEventListener("mousedown", re), a.renderer.domElement.removeEventListener("mouseup", ne), a.renderer.domElement.removeEventListener("mousemove", ie), a.renderer.domElement.removeEventListener("touchstart", T, !0), a.renderer.domElement.removeEventListener("touchend", A, !0), a.renderer.domElement.removeEventListener("touchcancel", A, !0), a.renderer.domElement.removeEventListener("touchmove", D, !0), a.renderer.domElement.removeEventListener("pointerdown", B, !0), a.renderer.domElement.removeEventListener("pointermove", U, !0), a.renderer.domElement.removeEventListener("pointerup", q, !0), a.renderer.domElement.removeEventListener("pointercancel", q, !0), window.removeEventListener("keydown", c), window.removeEventListener("keyup", h);
2238
+ f(), l(), N(), a.renderer.domElement.removeEventListener("mousedown", re), a.renderer.domElement.removeEventListener("mouseup", ne), a.renderer.domElement.removeEventListener("mousemove", ie), a.renderer.domElement.removeEventListener("touchstart", T, !0), a.renderer.domElement.removeEventListener("touchend", A, !0), a.renderer.domElement.removeEventListener("touchcancel", A, !0), a.renderer.domElement.removeEventListener("touchmove", D, !0), a.renderer.domElement.removeEventListener("pointerdown", z, !0), a.renderer.domElement.removeEventListener("pointermove", U, !0), a.renderer.domElement.removeEventListener("pointerup", q, !0), a.renderer.domElement.removeEventListener("pointercancel", q, !0), window.removeEventListener("keydown", c), window.removeEventListener("keyup", h);
2239
2239
  };
2240
2240
  function c(v) {
2241
2241
  (v.keyCode === 8 || v.keyCode === 46) && e.self && e.self.handelKeyDeleteDown != null && e.self.handelKeyDeleteDown(), v.keyCode === 27 && e.self && e.self.handelKeyEscDown != null && e.self.handelKeyEscDown(), v.keyCode === 13 && e.self && e.self.handelKeyEnterDown != null && e.self.handelKeyEnterDown(), v.keyCode === 32 && e.self && e.self.handelKeySpaceDown != null && e.self.handelKeySpaceDown(v), v.key === "Tab" && e.self && e.self.handelKeyTabDown != null && e.self.handelKeyTabDown(v), v.key === "Control" && e.self && e.self.handelKeyCtrlDown != null && e.self.handelKeyCtrlDown(), v.key === "Delete" && e.self && e.self.handelKeyDeleteDown != null && e.self.handelKeyDeleteDown(), v.key === "Shift" && e.self && e.self.handelKeyShiftDown != null && e.self.handelKeyShiftDown(), v.key === "Meta" && e.self && e.self.handelKeyMetaDown != null && e.self.handelKeyMetaDown();
@@ -2304,13 +2304,13 @@ function Qi(a) {
2304
2304
  function Q(v, E, L, H, j, xe) {
2305
2305
  const fe = a?.catchSvg;
2306
2306
  if (!fe?.childElementCount) return;
2307
- const ke = a?.reactBoundingClientRect ?? E.getBoundingClientRect(), nt = (we) => {
2307
+ const ke = a?.reactBoundingClientRect ?? E.getBoundingClientRect(), st = (we) => {
2308
2308
  const [Oe, Ne] = we.split(",").map(Number);
2309
2309
  return Number.isFinite(Oe) && Number.isFinite(Ne) ? [(Oe - ke.left - L) / j * n * xe, (Ne - ke.top - H) / j * n * xe] : null;
2310
2310
  };
2311
2311
  Array.from(fe.children).forEach((we) => {
2312
- const Oe = we.tagName.toLowerCase(), ye = (Oe === "line" ? [`${we.getAttribute("x1")},${we.getAttribute("y1")}`, `${we.getAttribute("x2")},${we.getAttribute("y2")}`].map(nt) : (we.getAttribute("points") || "").trim().split(/\s+/).map(nt)).filter(Boolean);
2313
- ye.length < 2 || (v.beginPath(), v.strokeStyle = we.getAttribute("stroke") || "rgb(8, 223, 215)", v.fillStyle = we.getAttribute("fill") || "transparent", v.lineWidth = Number(we.getAttribute("stroke-width") || 2) * xe, v.moveTo(ye[0][0], ye[0][1]), ye.slice(1).forEach(([st, Fe]) => v.lineTo(st, Fe)), Oe === "polygon" && (v.closePath(), ["none", "transparent"].includes(String(v.fillStyle)) || v.fill()), v.stroke());
2312
+ const Oe = we.tagName.toLowerCase(), ye = (Oe === "line" ? [`${we.getAttribute("x1")},${we.getAttribute("y1")}`, `${we.getAttribute("x2")},${we.getAttribute("y2")}`].map(st) : (we.getAttribute("points") || "").trim().split(/\s+/).map(st)).filter(Boolean);
2313
+ ye.length < 2 || (v.beginPath(), v.strokeStyle = we.getAttribute("stroke") || "rgb(8, 223, 215)", v.fillStyle = we.getAttribute("fill") || "transparent", v.lineWidth = Number(we.getAttribute("stroke-width") || 2) * xe, v.moveTo(ye[0][0], ye[0][1]), ye.slice(1).forEach(([ot, Fe]) => v.lineTo(ot, Fe)), Oe === "polygon" && (v.closePath(), ["none", "transparent"].includes(String(v.fillStyle)) || v.fill()), v.stroke());
2314
2314
  });
2315
2315
  }
2316
2316
  function ee(v) {
@@ -2322,18 +2322,18 @@ function Qi(a) {
2322
2322
  k();
2323
2323
  return;
2324
2324
  }
2325
- const ke = L.width / n, nt = Math.min(
2325
+ const ke = L.width / n, st = Math.min(
2326
2326
  window.innerWidth - n / 2 - 8,
2327
2327
  Math.max(n / 2 + 8, v.clientX)
2328
2328
  ), we = Math.min(
2329
2329
  window.innerHeight - n - 8,
2330
2330
  Math.max(8, v.clientY - o)
2331
2331
  );
2332
- L.style.left = `${nt - n / 2}px`, L.style.top = `${we}px`, L.style.display = "block";
2333
- const Oe = E.width / Math.max(1, E.clientWidth), Ne = E.height / Math.max(1, E.clientHeight), ye = s, st = Math.max(0, Math.min(E.clientWidth - ye, fe.x - ye / 2)), Fe = Math.max(0, Math.min(E.clientHeight - ye, fe.y - ye / 2));
2332
+ L.style.left = `${st - n / 2}px`, L.style.top = `${we}px`, L.style.display = "block";
2333
+ const Oe = E.width / Math.max(1, E.clientWidth), Ne = E.height / Math.max(1, E.clientHeight), ye = s, ot = Math.max(0, Math.min(E.clientWidth - ye, fe.x - ye / 2)), Fe = Math.max(0, Math.min(E.clientHeight - ye, fe.y - ye / 2));
2334
2334
  H.save(), H.clearRect(0, 0, L.width, L.height), H.beginPath(), H.arc(L.width / 2, L.height / 2, L.width / 2, 0, Math.PI * 2), H.clip(), H.fillStyle = window.getComputedStyle(E.parentElement ?? document.body).backgroundColor || "#dfe8f2", H.fillRect(0, 0, L.width, L.height);
2335
2335
  try {
2336
- H.drawImage(E, st * Oe, Fe * Ne, ye * Oe, ye * Ne, 0, 0, L.width, L.height), Q(H, E, st, Fe, ye, ke);
2336
+ H.drawImage(E, ot * Oe, Fe * Ne, ye * Oe, ye * Ne, 0, 0, L.width, L.height), Q(H, E, ot, Fe, ye, ke);
2337
2337
  } catch {
2338
2338
  k(), H.restore();
2339
2339
  return;
@@ -2448,7 +2448,7 @@ function Qi(a) {
2448
2448
  ne(E);
2449
2449
  }
2450
2450
  }
2451
- function B(v) {
2451
+ function z(v) {
2452
2452
  if (v.pointerType !== "touch" || !y() || v.isPrimary === !1)
2453
2453
  return;
2454
2454
  const E = Se(v);
@@ -2944,7 +2944,7 @@ class $r {
2944
2944
  }
2945
2945
  /** 创建参考项目使用的环境光和主定向光。 */
2946
2946
  init() {
2947
- const e = new St(16777215, 1), t = new At(16777215, 3);
2947
+ const e = new At(16777215, 1), t = new et(16777215, 3);
2948
2948
  t.position.copy(Qr), t.castShadow = !0, t.shadow.mapSize.set(2048, 2048), t.shadow.bias = -2e-4, t.shadow.normalBias = 0.2, t.shadow.intensity = Yt, t.shadow.autoUpdate = !1, t.shadow.needsUpdate = !0, this.engine.scene.add(e), this.engine.scene.add(t, t.target), this.directionalLight = t, this.engine.scene.dirLight = t, this.engine.scene.dirLightShadow = t, this.engine.scene.dirLightShodow = t;
2949
2949
  }
2950
2950
  /** 兼容旧调用名,按当前模型范围更新阴影视锥。 */
@@ -3007,7 +3007,7 @@ class Jr {
3007
3007
  selectionEnd = new K();
3008
3008
  suppressClickOnce = !1;
3009
3009
  selectionThreshold = 5;
3010
- tempInstanceMatrix = new z();
3010
+ tempInstanceMatrix = new O();
3011
3011
  tempScale = new d();
3012
3012
  constructor(e) {
3013
3013
  this.engine = e;
@@ -3440,7 +3440,7 @@ function Zr(a, e, t, i) {
3440
3440
  const r = a.models.find((w) => w.url == t);
3441
3441
  if (r == null)
3442
3442
  return;
3443
- const l = it(a, t), c = [], h = e.circularMeps, u = e.rectMeps?.filter((w) => w.type === "风管"), p = e.rectMeps?.filter((w) => w.type === "桥架"), g = e.ellipseMeps, y = (w) => (w.color = w.color.split(",").map((f) => parseInt(f) / 255), w.color = new de().setRGB(w.color[0], w.color[1], w.color[2], Ge), w.position = {
3443
+ const l = nt(a, t), c = [], h = e.circularMeps, u = e.rectMeps?.filter((w) => w.type === "风管"), p = e.rectMeps?.filter((w) => w.type === "桥架"), g = e.ellipseMeps, y = (w) => (w.color = w.color.split(",").map((f) => parseInt(f) / 255), w.color = new de().setRGB(w.color[0], w.color[1], w.color[2], Ge), w.position = {
3444
3444
  x: w.startPoint.X * 0.3048 + 0,
3445
3445
  y: w.startPoint.Z * 0.3048 + 0,
3446
3446
  z: -w.startPoint.Y * 0.3048 + 0
@@ -3511,7 +3511,7 @@ function ta(a, e, t, i, n) {
3511
3511
  }
3512
3512
  } else
3513
3513
  P = (w.clone().sub(M.clone()).cross(new d(0, 0, 1)).y > 0 ? -1 : 1) * w.clone().sub(M.clone()).angleTo(new d(0, 0, 1)), S = (y.startPoint.Z > y.endPoint.Z ? 1 : -1) * w.clone().sub(M.clone()).angleTo(C.clone().sub(f.clone()));
3514
- const I = new z(), F = new Xe(S, P, _, "YXZ"), k = I.clone().makeRotationFromEuler(F);
3514
+ const I = new O(), F = new Xe(S, P, _, "YXZ"), k = I.clone().makeRotationFromEuler(F);
3515
3515
  let N, Q;
3516
3516
  a === "Circle" ? (N = y.diameter, Q = y.diameter) : (N = y.width, Q = y.height);
3517
3517
  const ee = I.clone().makeScale(N, Q, y.length);
@@ -3623,7 +3623,7 @@ function ha(a, e = {}) {
3623
3623
  i.userData = i.userData ?? {}, i.userData[Ms] = !0, console.warn("[raycastAcceleration] failed to build bounds tree", n);
3624
3624
  }
3625
3625
  }
3626
- const xs = 1e6, da = 8, Cn = 50, ua = 100, bi = "__ordinaryMeshDistanceCullingRegistry", xi = "__instanceMeshDistanceCullingRegistry", Qt = "__instanceMeshDistanceCullingScheduler", yt = new d(), En = /* @__PURE__ */ new WeakMap();
3626
+ const xs = 1e6, da = 8, Cn = 50, ua = 100, bi = "__ordinaryMeshDistanceCullingRegistry", xi = "__instanceMeshDistanceCullingRegistry", Qt = "__instanceMeshDistanceCullingScheduler", vt = new d(), En = /* @__PURE__ */ new WeakMap();
3627
3627
  function _t(a) {
3628
3628
  const e = a?.options?.ordinaryMeshOptimization;
3629
3629
  return {
@@ -3686,7 +3686,7 @@ function fa(a, e, t) {
3686
3686
  box: e.geometry.boundingBox?.clone() ?? null,
3687
3687
  worldCenter: new d(),
3688
3688
  worldBox: e.geometry.boundingBox == null ? null : new R(),
3689
- worldMatrix: new z(),
3689
+ worldMatrix: new O(),
3690
3690
  worldBoundsInitialized: !1,
3691
3691
  ranges: n,
3692
3692
  currentCount: s,
@@ -3701,7 +3701,7 @@ function ya(a, e, t) {
3701
3701
  box: e.boundingBox?.clone() ?? null,
3702
3702
  worldCenter: new d(),
3703
3703
  worldBox: e.boundingBox == null ? null : new R(),
3704
- worldMatrix: new z(),
3704
+ worldMatrix: new O(),
3705
3705
  worldBoundsInitialized: !1,
3706
3706
  maxSize: t.reduce((n, s) => Number.isFinite(s) ? Math.max(n, s) : n, 0),
3707
3707
  instanceCount: t.length,
@@ -3718,7 +3718,7 @@ function va(a, e, t, i = typeof performance > "u" ? Date.now() : performance.now
3718
3718
  let p = !1;
3719
3719
  return s.forEach((g) => {
3720
3720
  const y = g.userData.ordinaryMeshDistanceCulling;
3721
- y != null && (g.isSplit === !0 ? p = at(g, y, y.ranges.length, !1) || p : p = at(g, y, y.ranges.length) || p);
3721
+ y != null && (g.isSplit === !0 ? p = lt(g, y, y.ranges.length, !1) || p : p = lt(g, y, y.ranges.length) || p);
3722
3722
  }), o.forEach((g) => {
3723
3723
  const y = g.userData.instanceDistanceCulling;
3724
3724
  y != null && (p = Ht(g, y, !0) || p);
@@ -3728,7 +3728,7 @@ function va(a, e, t, i = typeof performance > "u" ? Date.now() : performance.now
3728
3728
  if (c == null)
3729
3729
  return !1;
3730
3730
  const h = xa(a, n, i);
3731
- e.getWorldPosition(yt);
3731
+ e.getWorldPosition(vt);
3732
3732
  let u = !1;
3733
3733
  return s.forEach((p) => {
3734
3734
  if (p.parent == null) {
@@ -3741,19 +3741,19 @@ function va(a, e, t, i = typeof performance > "u" ? Date.now() : performance.now
3741
3741
  return;
3742
3742
  }
3743
3743
  if (!r) {
3744
- u = at(p, g, g.ranges.length, p.isSplit !== !0) || u;
3744
+ u = lt(p, g, g.ranges.length, p.isSplit !== !0) || u;
3745
3745
  return;
3746
3746
  }
3747
3747
  if (p.isSplit === !0) {
3748
- u = at(p, g, g.ranges.length, !1) || u;
3748
+ u = lt(p, g, g.ranges.length, !1) || u;
3749
3749
  return;
3750
3750
  }
3751
- if (An(p, g), g.worldBox != null && g.worldBox.containsPoint(yt)) {
3752
- u = at(p, g, g.ranges.length) || u;
3751
+ if (An(p, g), g.worldBox != null && g.worldBox.containsPoint(vt)) {
3752
+ u = lt(p, g, g.ranges.length) || u;
3753
3753
  return;
3754
3754
  }
3755
- const y = c.isPerspective ? g.minProjectedSizePx * Math.max(yt.distanceTo(g.worldCenter), 1e-3) / c.scale : g.minProjectedSizePx / c.scale, M = Sa(g.ranges, y);
3756
- u = at(p, g, M) || u;
3755
+ const y = c.isPerspective ? g.minProjectedSizePx * Math.max(vt.distanceTo(g.worldCenter), 1e-3) / c.scale : g.minProjectedSizePx / c.scale, M = Sa(g.ranges, y);
3756
+ u = lt(p, g, M) || u;
3757
3757
  }), h && o.forEach((p) => {
3758
3758
  if (p.parent == null) {
3759
3759
  o.delete(p);
@@ -3768,11 +3768,11 @@ function va(a, e, t, i = typeof performance > "u" ? Date.now() : performance.now
3768
3768
  u = Ht(p, g, !0) || u;
3769
3769
  return;
3770
3770
  }
3771
- if (An(p, g), g.worldBox != null && g.worldBox.containsPoint(yt)) {
3771
+ if (An(p, g), g.worldBox != null && g.worldBox.containsPoint(vt)) {
3772
3772
  u = Ht(p, g, !0) || u;
3773
3773
  return;
3774
3774
  }
3775
- const y = c.isPerspective ? g.minProjectedSizePx * Math.max(yt.distanceTo(g.worldCenter), 1e-3) / c.scale : g.minProjectedSizePx / c.scale;
3775
+ const y = c.isPerspective ? g.minProjectedSizePx * Math.max(vt.distanceTo(g.worldCenter), 1e-3) / c.scale : g.minProjectedSizePx / c.scale;
3776
3776
  u = Ht(p, g, g.maxSize >= y) || u;
3777
3777
  }), u;
3778
3778
  }
@@ -3818,7 +3818,7 @@ function Ri(a) {
3818
3818
  }
3819
3819
  function Ea(a, e) {
3820
3820
  if (a instanceof Zt) {
3821
- const t = e / (2 * Math.tan(O.degToRad(a.fov) / 2));
3821
+ const t = e / (2 * Math.tan(B.degToRad(a.fov) / 2));
3822
3822
  return t > 0 ? { isPerspective: !0, scale: t } : null;
3823
3823
  }
3824
3824
  if (a instanceof Ve) {
@@ -3838,7 +3838,7 @@ function Sa(a, e) {
3838
3838
  }
3839
3839
  return t;
3840
3840
  }
3841
- function at(a, e, t, i = !0) {
3841
+ function lt(a, e, t, i = !0) {
3842
3842
  const n = t > 0 ? e.ranges[t - 1].end : 0, s = n !== e.currentCount, o = e.visibleComponentCount !== t;
3843
3843
  let r = !1;
3844
3844
  if (s && (a.geometry.setDrawRange(0, n), i)) {
@@ -3863,7 +3863,7 @@ function Pa(a, e) {
3863
3863
  const t = Number(a);
3864
3864
  return Number.isFinite(t) && t >= 0 ? t : e;
3865
3865
  }
3866
- let vt = null, Mt = null, Pn = null;
3866
+ let Mt = null, bt = null, Pn = null;
3867
3867
  const Tn = 2048, In = /* @__PURE__ */ new WeakSet();
3868
3868
  function Es() {
3869
3869
  return Z("draco/", import.meta.url);
@@ -3872,10 +3872,10 @@ function Ss() {
3872
3872
  return Z("basis/", import.meta.url);
3873
3873
  }
3874
3874
  function Ta() {
3875
- return vt == null && (vt = new ds(), vt.setDecoderPath(Es()), vt.preload()), vt;
3875
+ return Mt == null && (Mt = new ds(), Mt.setDecoderPath(Es()), Mt.preload()), Mt;
3876
3876
  }
3877
3877
  function Ia(a) {
3878
- return Mt == null && (Mt = new Eo(), Mt.setTranscoderPath(Ss())), Pn !== a && (Mt.detectSupport(a), Pn = a), Mt;
3878
+ return bt == null && (bt = new Eo(), bt.setTranscoderPath(Ss())), Pn !== a && (bt.detectSupport(a), Pn = a), bt;
3879
3879
  }
3880
3880
  function Da(a) {
3881
3881
  const e = new Gi();
@@ -3883,7 +3883,7 @@ function Da(a) {
3883
3883
  }
3884
3884
  function Dn(a, e) {
3885
3885
  return new Promise((t, i) => {
3886
- wt(a, (n) => {
3886
+ Ct(a, (n) => {
3887
3887
  if (n == null) {
3888
3888
  i(new Error(`[loadLightModel] empty zip json: ${a}`));
3889
3889
  return;
@@ -3947,9 +3947,9 @@ function Ba(a, e) {
3947
3947
  Da(a).parse(e, yr(import.meta.url), t, i);
3948
3948
  });
3949
3949
  }
3950
- function gt(a, e) {
3950
+ function mt(a, e) {
3951
3951
  const t = a.models?.find?.((i) => i.url == e);
3952
- return t != null && t.group == null && (t.group = oi(a, e) ?? it(a, e)), t;
3952
+ return t != null && t.group == null && (t.group = oi(a, e) ?? nt(a, e)), t;
3953
3953
  }
3954
3954
  function he(a, e, t) {
3955
3955
  return Number.isFinite(t) && typeof a?.loaderModule?.isModelLoadActive == "function" ? a.loaderModule.isModelLoadActive(e, t) !== !0 : a?.loaderModule?.isModelUnloadRequested?.(e) === !0;
@@ -3977,7 +3977,7 @@ function za(a) {
3977
3977
  }), t.forEach((n) => n.dispose()), i.forEach((n) => n.dispose());
3978
3978
  }
3979
3979
  function Oa(a, e) {
3980
- const t = gt(a, e);
3980
+ const t = mt(a, e);
3981
3981
  return Array.isArray(t?.lods) ? t.lods : [];
3982
3982
  }
3983
3983
  function Is(a) {
@@ -4005,7 +4005,7 @@ function Na(a) {
4005
4005
  function Fa(a, e, t) {
4006
4006
  if (he(a, e.url, e.loadVersion))
4007
4007
  return [];
4008
- const i = gt(a, e.url);
4008
+ const i = mt(a, e.url);
4009
4009
  if (i?.nodesMap == null)
4010
4010
  return [];
4011
4011
  const n = a.filterLoaderModel?.getContinueIdSet?.(e.url) ?? /* @__PURE__ */ new Set(), s = Na(t), o = [], r = a?.deviceModule?.isMobile?.() !== !0;
@@ -4019,7 +4019,7 @@ function Fa(a, e, t) {
4019
4019
  const p = t.glbs?.[u.glb]?.[u.mesh];
4020
4020
  if (p?.geometry == null || p.material == null)
4021
4021
  continue;
4022
- const g = new z();
4022
+ const g = new O();
4023
4023
  g.elements = u.matrix;
4024
4024
  const y = p.geometry.clone(), M = y.getAttribute("position");
4025
4025
  if (M == null) {
@@ -4059,7 +4059,7 @@ function qa(a, e, t, i, n) {
4059
4059
  if (s == null)
4060
4060
  throw new Error(`[loadLightModel] 普通构件合批失败: ${t}`);
4061
4061
  const o = Xi(n), r = new V(s, o), l = i.reduce((p, g) => Math.max(p, Ua(g.geometry)), 0), c = Math.floor(Is(s) / 3);
4062
- r.castShadow = vr(l, c), r.receiveShadow = !0, it(e, a).add(r);
4062
+ r.castShadow = vr(l, c), r.receiveShadow = !0, nt(e, a).add(r);
4063
4063
  const u = Ki(e, r);
4064
4064
  return e.options?.modelDepthBias !== !1 && ji(r, u), r.url = a, r.glb = t, r.materialClone = o, r.geometrys = i.map((p) => p.geometry), r.geometry.computeVertexNormals(), fa(e, r, i), Yi(r), r;
4065
4065
  }
@@ -4069,7 +4069,7 @@ function Ga(a, e, t) {
4069
4069
  const r = pa(o), l = i.get(r) ?? { glb: String(o.glb ?? ""), meshes: [] };
4070
4070
  l.meshes.push(o), i.set(r, l);
4071
4071
  }
4072
- const n = gt(e, a), s = _t(e);
4072
+ const n = mt(e, a), s = _t(e);
4073
4073
  for (const o of i.values()) {
4074
4074
  const r = s.enabled && s.meshDistanceCullingEnabled ? ga(o.meshes) : o.meshes, l = s.enabled ? Sn(r, s.maxTrianglesPerMesh) : Sn(r, Number.MAX_SAFE_INTEGER);
4075
4075
  for (const c of l) {
@@ -4098,7 +4098,7 @@ function Ka(a, e) {
4098
4098
  }
4099
4099
  function ja(a, e, t, i, n, s) {
4100
4100
  const o = $i(Xi(i.material), t), r = new G(i.geometry, o, s.length);
4101
- r.castShadow = !1, r.receiveShadow = !1, it(t, a).add(r);
4101
+ r.castShadow = !1, r.receiveShadow = !1, nt(t, a).add(r);
4102
4102
  const c = Ki(t, r);
4103
4103
  t.options?.modelDepthBias !== !1 && ji(r, c);
4104
4104
  const h = [];
@@ -4122,12 +4122,12 @@ function ja(a, e, t, i, n, s) {
4122
4122
  function Ya(a, e, t, i, n) {
4123
4123
  if (i == null || n == null || n.length === 0)
4124
4124
  return;
4125
- const s = gt(t, a);
4125
+ const s = mt(t, a);
4126
4126
  if (s == null)
4127
4127
  return;
4128
4128
  i.geometry.computeVertexNormals();
4129
4129
  const o = n.filter((c) => Array.isArray(c?.matrix) && c.matrix.length === 16 && c.matrix.every(Number.isFinite)).map((c) => {
4130
- const h = new z().fromArray(c.matrix), u = Wa(i, h), p = Ka(i.geometry, h);
4130
+ const h = new O().fromArray(c.matrix), u = Wa(i, h), p = Ka(i.geometry, h);
4131
4131
  return {
4132
4132
  node: c,
4133
4133
  matrix: h,
@@ -4193,14 +4193,14 @@ async function $a(a, e, t) {
4193
4193
  t.preparePromise = (async () => {
4194
4194
  t.glbs = t.glbs ?? {};
4195
4195
  const i = e.url + t.path;
4196
- ut(a, e.url, i);
4196
+ pt(a, e.url, i);
4197
4197
  const n = await As(i, e.key);
4198
4198
  if (he(a, e.url, e.loadVersion))
4199
4199
  return;
4200
4200
  const s = await kn(n, ["/nodes.json", "nodes.json"]);
4201
4201
  if (s == null)
4202
4202
  return;
4203
- const o = Dt(s), r = gt(a, e.url);
4203
+ const o = Dt(s), r = mt(a, e.url);
4204
4204
  if (r == null)
4205
4205
  return;
4206
4206
  r.nodesMap == null && (r.nodesMap = /* @__PURE__ */ new Map());
@@ -4273,7 +4273,7 @@ async function Ja(a, e, t) {
4273
4273
  function Za(a, e) {
4274
4274
  if (he(a, e.url, e.loadVersion) || e.loadStatus.modelMep === !0)
4275
4275
  return;
4276
- const t = gt(a, e.url);
4276
+ const t = mt(a, e.url);
4277
4277
  if (t == null)
4278
4278
  throw new Error(`[loadLightModel] runtime model not found: ${e.url}`);
4279
4279
  e.loadStatus.modelMep = "loading";
@@ -4285,7 +4285,7 @@ function Za(a, e) {
4285
4285
  }
4286
4286
  }
4287
4287
  async function el(a, e, t, i) {
4288
- const n = it(a, e);
4288
+ const n = nt(a, e);
4289
4289
  a.models || (a.models = []);
4290
4290
  const s = t?.loadQuotaList ?? !1, o = t?.loadEdge !== !1, r = "WDDsBNtzVz6aSh/bCFh3CmjjANEDRryoXF1XCJvJjeE=", l = await Dn(e + "/info", r);
4291
4291
  if (he(a, e, i))
@@ -4330,7 +4330,7 @@ async function el(a, e, t, i) {
4330
4330
  a.models.push(g), a.loaderModule?.onModelInfoReady?.();
4331
4331
  try {
4332
4332
  if (s) {
4333
- if (ut(a, e, e + "/property"), p.properties = Dt(await Dn(e + "/property", r)), he(a, e, i))
4333
+ if (pt(a, e, e + "/property"), p.properties = Dt(await Dn(e + "/property", r)), he(a, e, i))
4334
4334
  return;
4335
4335
  a.filterLoaderModel?.buildContinueIds?.(e);
4336
4336
  const M = await La(e + "/quota_list", r);
@@ -4599,7 +4599,7 @@ class me {
4599
4599
  async collectSourceEntries(e) {
4600
4600
  const t = [];
4601
4601
  for (const i of e) {
4602
- const n = Le(i.webkitRelativePath || i.name), s = Ct(n);
4602
+ const n = Le(i.webkitRelativePath || i.name), s = Et(n);
4603
4603
  if (Ln(s)) {
4604
4604
  t.push({ path: n, blob: i });
4605
4605
  continue;
@@ -4621,7 +4621,7 @@ class me {
4621
4621
  * 识别已经打好的模型包文件,例如 `info`、`lod0.zip`。
4622
4622
  */
4623
4623
  parseDirectPackageEntry(e) {
4624
- const t = wi(e), i = Ct(e);
4624
+ const t = wi(e), i = Et(e);
4625
4625
  return Ln(i) ? {
4626
4626
  modelKey: t,
4627
4627
  packageName: ml(i)
@@ -4644,7 +4644,7 @@ class me {
4644
4644
  innerPath: o.join("/")
4645
4645
  };
4646
4646
  }
4647
- const i = Ct(e).toLowerCase();
4647
+ const i = Et(e).toLowerCase();
4648
4648
  return i === "info.json" || i === "property.json" || i === "edge.json" || i === "quota_list.json" ? {
4649
4649
  modelKey: wi(e),
4650
4650
  packageName: i.replace(".json", ""),
@@ -4814,7 +4814,7 @@ function ul(a) {
4814
4814
  function Le(a) {
4815
4815
  return a.replace(/\\/g, "/").replace(/^\/+/, "").replace(/\/+/g, "/");
4816
4816
  }
4817
- function Ct(a) {
4817
+ function Et(a) {
4818
4818
  const e = Le(a), t = e.lastIndexOf("/");
4819
4819
  return t >= 0 ? e.slice(t + 1) : e;
4820
4820
  }
@@ -4825,9 +4825,9 @@ function wi(a) {
4825
4825
  function pl(a, e) {
4826
4826
  try {
4827
4827
  const t = new URL(a, window.location.origin);
4828
- return decodeURIComponent(Ct(t.pathname)) || `model-package-${e + 1}.zip`;
4828
+ return decodeURIComponent(Et(t.pathname)) || `model-package-${e + 1}.zip`;
4829
4829
  } catch {
4830
- return Ct(a.split("?")[0].split("#")[0]) || `model-package-${e + 1}.zip`;
4830
+ return Et(a.split("?")[0].split("#")[0]) || `model-package-${e + 1}.zip`;
4831
4831
  }
4832
4832
  }
4833
4833
  function gl(a, e) {
@@ -4905,7 +4905,7 @@ class yl {
4905
4905
  return this.engine.models.forEach((o) => {
4906
4906
  if (!(o?.nodesMap instanceof Map) || !o.url)
4907
4907
  return;
4908
- const r = it(this.engine, o.url);
4908
+ const r = nt(this.engine, o.url);
4909
4909
  o.nodesMap.forEach((l, c) => {
4910
4910
  const h = String(l?.name ?? l?.info?.name ?? l?.infos?.[0]?.name ?? "");
4911
4911
  if (!i.some((f) => h.includes(f)) || l?.pickBoxMesh instanceof V || l?.indexes?.some((f) => _e(this.engine, f?.[0]) instanceof G))
@@ -5426,14 +5426,14 @@ class yl {
5426
5426
  return e.__customColorMaterialIndexes.set(n, l), l;
5427
5427
  }
5428
5428
  hideOriginalInstance(e, t) {
5429
- const i = new z();
5429
+ const i = new O();
5430
5430
  i.makeScale(0, 0, 0), e.setMatrixAt(t, i), e.instanceMatrix.needsUpdate = !0;
5431
5431
  }
5432
5432
  getOriginalInstanceMatrix(e, t) {
5433
5433
  const i = e.matrixs?.[t] ?? e.matrixsClone?.[t];
5434
- if (i instanceof z)
5434
+ if (i instanceof O)
5435
5435
  return i.clone();
5436
- const n = new z();
5436
+ const n = new O();
5437
5437
  return e.getMatrixAt(t, n), n;
5438
5438
  }
5439
5439
  isModelHighlighted(e, t) {
@@ -5624,12 +5624,12 @@ function vl(a, e) {
5624
5624
  r.name = "highlightModel", r.key = i, r.ids = [], r.matrixs = [], r.url = n.url, t.forEach((u) => {
5625
5625
  r.ids.push(n.ids[u]), r.matrixs.push(n.matrixs[u]);
5626
5626
  });
5627
- const l = /* @__PURE__ */ new Map(), c = new z(), h = new z();
5627
+ const l = /* @__PURE__ */ new Map(), c = new O(), h = new O();
5628
5628
  h.makeScale(0, 0, 0), t.forEach((u, p) => {
5629
5629
  const g = kt(e, i, u);
5630
5630
  Lt(g, !1);
5631
5631
  const y = g?.matrix ?? n.matrixs?.[u] ?? n.matrixsClone?.[u];
5632
- y instanceof z ? c.copy(y) : n.getMatrixAt(u, c), l.set(u, c.clone()), n.setMatrixAt(u, h), r.setMatrixAt(p, c);
5632
+ y instanceof O ? c.copy(y) : n.getMatrixAt(u, c), l.set(u, c.clone()), n.setMatrixAt(u, h), r.setMatrixAt(p, c);
5633
5633
  }), n.instanceMatrix.needsUpdate = !0, r.instanceMatrix.needsUpdate = !0, (n.parent ?? e.scene).add(r);
5634
5634
  });
5635
5635
  }
@@ -5641,7 +5641,7 @@ function zn(a, e, t) {
5641
5641
  i.forEach((r) => {
5642
5642
  const l = kt(e, n, r);
5643
5643
  if (l != null) {
5644
- s.setMatrixAt(r, new z().makeScale(0, 0, 0)), Lt(l, !0);
5644
+ s.setMatrixAt(r, new O().makeScale(0, 0, 0)), Lt(l, !0);
5645
5645
  return;
5646
5646
  }
5647
5647
  const c = s.matrixsClone[r];
@@ -5673,12 +5673,12 @@ function Ml(a, e, t = 0.05) {
5673
5673
  r.clippingPlanes = e.sectionPlane;
5674
5674
  const l = new G(o, r, i.length);
5675
5675
  l.name = "translucentModel", l.key = n;
5676
- const c = /* @__PURE__ */ new Map(), h = new z(), u = new z();
5676
+ const c = /* @__PURE__ */ new Map(), h = new O(), u = new O();
5677
5677
  u.makeScale(0, 0, 0), i.forEach((p, g) => {
5678
5678
  const y = kt(e, n, p);
5679
5679
  Lt(y, !1);
5680
5680
  const M = y?.matrix ?? s.matrixs?.[p] ?? s.matrixsClone?.[p];
5681
- M instanceof z ? h.copy(M) : s.getMatrixAt(p, h), c.set(p, h.clone()), s.setMatrixAt(p, u), l.setMatrixAt(g, h);
5681
+ M instanceof O ? h.copy(M) : s.getMatrixAt(p, h), c.set(p, h.clone()), s.setMatrixAt(p, u), l.setMatrixAt(g, h);
5682
5682
  }), s.instanceMatrix.needsUpdate = !0, l.instanceMatrix.needsUpdate = !0, (s.parent ?? e.scene).add(l);
5683
5683
  });
5684
5684
  }
@@ -5692,12 +5692,12 @@ function bl(a, e) {
5692
5692
  const s = Rt(e, n);
5693
5693
  if (!(s instanceof G))
5694
5694
  return;
5695
- const o = /* @__PURE__ */ new Map(), r = new z(), l = new z();
5695
+ const o = /* @__PURE__ */ new Map(), r = new O(), l = new O();
5696
5696
  l.makeScale(0, 0, 0), i.forEach((c) => {
5697
5697
  const h = kt(e, n, c);
5698
5698
  Lt(h, !1);
5699
5699
  const u = h?.matrix ?? s.matrixs?.[c] ?? s.matrixsClone?.[c];
5700
- u instanceof z ? r.copy(u) : s.getMatrixAt(c, r), o.set(c, r.clone()), s.setMatrixAt(c, l);
5700
+ u instanceof O ? r.copy(u) : s.getMatrixAt(c, r), o.set(c, r.clone()), s.setMatrixAt(c, l);
5701
5701
  }), s.instanceMatrix.needsUpdate = !0;
5702
5702
  });
5703
5703
  }
@@ -5707,7 +5707,7 @@ function On(a, e) {
5707
5707
  n instanceof G && (t.forEach((s) => {
5708
5708
  const o = kt(e, i, s);
5709
5709
  if (o != null) {
5710
- n.setMatrixAt(s, new z().makeScale(0, 0, 0)), Lt(o, !0);
5710
+ n.setMatrixAt(s, new O().makeScale(0, 0, 0)), Lt(o, !0);
5711
5711
  return;
5712
5712
  }
5713
5713
  const r = n.matrixs[s];
@@ -5989,8 +5989,8 @@ function Pl(a, e, t) {
5989
5989
  p();
5990
5990
  var m = new d(0, 0, 0), x = null;
5991
5991
  b == "top" ? (m = new d(0, 1, 0), x = new d(0, 0, -1)) : b == "down" || b == "button" ? (m = new d(0, -1, 0), x = new d(0, 0, 1)) : b == "front" ? m = new d(0, 0, 1) : b == "left" ? m = new d(-1, 0, 0) : b == "back" ? m = new d(0, 0, -1) : b == "right" ? m = new d(1, 0, 0) : b == "top_front" ? m = new d(1, 1, 0) : b == "top_left" ? m = new d(0, 1, -1) : b == "top_back" ? m = new d(-1, 1, 0) : b == "top_right" ? m = new d(0, 1, 1) : b == "down_front" ? m = new d(1, -1, 0) : b == "down_left" ? m = new d(0, -1, -1) : b == "down_back" ? m = new d(-1, -1, 0) : b == "down_right" ? m = new d(0, -1, 1) : b == "front_right" ? m = new d(1, 0, 1) : b == "right_back" ? m = new d(-1, 0, 1) : b == "back_left" ? m = new d(-1, 0, -1) : b == "left_front" ? m = new d(1, 0, -1) : b == "top_left_front" ? m = new d(1, 1, -1) : b == "top_front_right" ? m = new d(1, 1, 1) : b == "top_right_back" ? m = new d(-1, 1, 1) : b == "top_back_left" ? m = new d(-1, 1, -1) : b == "button_left_front" ? m = new d(1, -1, -1) : b == "button_front_right" ? m = new d(1, -1, 1) : b == "button_right_back" ? m = new d(-1, 1, 1) : b == "button_back_left" && (m = new d(-1, -1, -1));
5992
- var T = a.octreeBox.getBoundingBox(), D = T.min, A = T.max, B = D.clone().add(A.clone()).multiplyScalar(0.5), U = B.clone().add(m.multiplyScalar(1 * A.distanceTo(D)));
5993
- I(e.camera.position, U, a.controls.target.clone(), B, null, null, 1e3, null, x);
5992
+ var T = a.octreeBox.getBoundingBox(), D = T.min, A = T.max, z = D.clone().add(A.clone()).multiplyScalar(0.5), U = z.clone().add(m.multiplyScalar(1 * A.distanceTo(D)));
5993
+ I(e.camera.position, U, a.controls.target.clone(), z, null, null, 1e3, null, x);
5994
5994
  }, i.GetCameraPose = function() {
5995
5995
  var b = e.camera.quaternion, m = e.camera.position, x = a.controls.target, T = {
5996
5996
  quaternion: b,
@@ -6006,7 +6006,7 @@ function Pl(a, e, t) {
6006
6006
  b.quaternion._z,
6007
6007
  b.quaternion._w
6008
6008
  ), D = new d(b.position.x, b.position.y, b.position.z), A = new d(b.target.x, b.target.y, b.target.z);
6009
- let B = !1;
6009
+ let z = !1;
6010
6010
  I(
6011
6011
  e.camera.position,
6012
6012
  D,
@@ -6016,18 +6016,18 @@ function Pl(a, e, t) {
6016
6016
  T,
6017
6017
  m,
6018
6018
  (U) => {
6019
- x && (B || (x(U), B = !0));
6019
+ x && (z || (x(U), z = !0));
6020
6020
  }
6021
6021
  ), x && setTimeout(() => {
6022
- B || (x(!0), B = !0);
6022
+ z || (x(!0), z = !0);
6023
6023
  }, m + 10);
6024
6024
  }, i.CameraGoHome = function(b = 1e3) {
6025
6025
  p();
6026
6026
  const m = new d(0, 1, 0);
6027
6027
  w(m), f(m);
6028
6028
  var x = a.octreeBox.getBoundingBox(), T = a.clipping?.getClippedBoundingBox?.(x), D = T && !T.isEmpty() ? T : x, A = D.min.clone().add(D.max.clone()).multiplyScalar(0.5);
6029
- let B = new d(1, 1, 1);
6030
- var U = x.max.distanceTo(x.min), q = D.max.distanceTo(D.min), W = A.clone().add(B.multiplyScalar(q * 0.8));
6029
+ let z = new d(1, 1, 1);
6030
+ var U = x.max.distanceTo(x.min), q = D.max.distanceTo(D.min), W = A.clone().add(z.multiplyScalar(q * 0.8));
6031
6031
  if (e.camera.isOrthographicCamera) {
6032
6032
  var v = a.container.clientWidth / a.container.clientHeight, E = q * 0.5;
6033
6033
  e.camera.left = -E * v, e.camera.right = E * v, e.camera.top = E, e.camera.bottom = -E, e.camera.zoom = 1, e.camera.far = U * 3, e.camera.updateProjectionMatrix();
@@ -6050,7 +6050,7 @@ function Pl(a, e, t) {
6050
6050
  let di = function() {
6051
6051
  n = requestAnimationFrame(di), Fe.update();
6052
6052
  };
6053
- var x = b.min.clone().add(b.max.clone()).multiplyScalar(0.5), T = e.camera.position.clone().sub(a.controls.target.clone()).normalize(), D = e.camera.position.distanceTo(a.controls.target), A = x.clone().add(T.multiplyScalar(D)), B = e.camera.zoom, U = new d(1, 0, 0).applyQuaternion(e.camera.quaternion), q = new d(0, 1, 0).applyQuaternion(e.camera.quaternion), W = [
6053
+ var x = b.min.clone().add(b.max.clone()).multiplyScalar(0.5), T = e.camera.position.clone().sub(a.controls.target.clone()).normalize(), D = e.camera.position.distanceTo(a.controls.target), A = x.clone().add(T.multiplyScalar(D)), z = e.camera.zoom, U = new d(1, 0, 0).applyQuaternion(e.camera.quaternion), q = new d(0, 1, 0).applyQuaternion(e.camera.quaternion), W = [
6054
6054
  new d(b.min.x, b.min.y, b.min.z),
6055
6055
  new d(b.max.x, b.min.y, b.min.z),
6056
6056
  new d(b.min.x, b.max.y, b.min.z),
@@ -6064,16 +6064,16 @@ function Pl(a, e, t) {
6064
6064
  var xe = j.dot(U), fe = j.dot(q);
6065
6065
  v = Math.min(v, xe), E = Math.max(E, xe), L = Math.min(L, fe), H = Math.max(H, fe);
6066
6066
  }
6067
- var ke = (E - v) / 2, nt = (H - L) / 2, we = (e.camera.right - e.camera.left) / 2, Oe = (e.camera.top - e.camera.bottom) / 2;
6068
- B = Math.min(we / ke, Oe / nt) * 0.75;
6069
- var Ne = e.camera.position.clone(), ye = a.controls.target.clone(), st = e.camera.zoom, Fe = new Ze.Tween({
6067
+ var ke = (E - v) / 2, st = (H - L) / 2, we = (e.camera.right - e.camera.left) / 2, Oe = (e.camera.top - e.camera.bottom) / 2;
6068
+ z = Math.min(we / ke, Oe / st) * 0.75;
6069
+ var Ne = e.camera.position.clone(), ye = a.controls.target.clone(), ot = e.camera.zoom, Fe = new Ze.Tween({
6070
6070
  x1: Ne.x,
6071
6071
  y1: Ne.y,
6072
6072
  z1: Ne.z,
6073
6073
  x2: ye.x,
6074
6074
  y2: ye.y,
6075
6075
  z2: ye.z,
6076
- zoom: st
6076
+ zoom: ot
6077
6077
  }).to({
6078
6078
  x1: A.x,
6079
6079
  y1: A.y,
@@ -6081,7 +6081,7 @@ function Pl(a, e, t) {
6081
6081
  x2: x.x,
6082
6082
  y2: x.y,
6083
6083
  z2: x.z,
6084
- zoom: B
6084
+ zoom: z
6085
6085
  }, m);
6086
6086
  Fe.onUpdate(function(je) {
6087
6087
  a.controls && (e.camera.position.set(je.x1, je.y1, je.z1), a.controls.target.set(je.x2, je.y2, je.z2), e.camera.isOrthographicCamera && (e.camera.zoom = je.zoom, e.camera.updateProjectionMatrix()), a.controls.auto = !0, a.controls.update(), i.RenderScene());
@@ -6099,7 +6099,7 @@ function Pl(a, e, t) {
6099
6099
  I(e.camera.position, A, a.controls.target.clone(), x, null, null, m);
6100
6100
  }
6101
6101
  };
6102
- function I(b, m, x, T, D, A, B = 1e3, U, q) {
6102
+ function I(b, m, x, T, D, A, z = 1e3, U, q) {
6103
6103
  var W;
6104
6104
  D && A ? (W = new Ze.Tween({
6105
6105
  x1: b.x,
@@ -6145,7 +6145,7 @@ function Pl(a, e, t) {
6145
6145
  _w: A._w
6146
6146
  // 新的相机quaternion
6147
6147
  },
6148
- B
6148
+ z
6149
6149
  )) : (W = new Ze.Tween({
6150
6150
  x1: b.x,
6151
6151
  // 相机当前位置x
@@ -6174,7 +6174,7 @@ function Pl(a, e, t) {
6174
6174
  z2: T.z
6175
6175
  // 新的控制中心点位置x
6176
6176
  },
6177
- B
6177
+ z
6178
6178
  )), W.onUpdate(function(E) {
6179
6179
  a.controls && (D && A ? (e.camera.quaternion._x = E._x, e.camera.quaternion._y = E._y, e.camera.quaternion._z = E._z, e.camera.quaternion._w = E._w) : a.controls.auto = !0, e.camera.position.x = E.x1, e.camera.position.y = E.y1, e.camera.position.z = E.z1, a.controls.target.x = E.x2, a.controls.target.y = E.y2, a.controls.target.z = E.z2, a.controls.update(), i.RenderScene());
6180
6180
  }), W.onComplete(function(E) {
@@ -6222,7 +6222,7 @@ function Pl(a, e, t) {
6222
6222
  alpha: !0
6223
6223
  });
6224
6224
  D.setSize(x, T), D.setClearAlpha(0), i.sceneOrtho.renderer = D;
6225
- let A = new St(16777215, 0.8);
6225
+ let A = new At(16777215, 0.8);
6226
6226
  i.sceneOrtho.add(A), Al(o, D), i.orbitControls = new vs(a, i.camera, o), i.orbitControls.enableZoom = !1, i.orbitControls.enablePan = !1, i.orbitControls.enableDamping = !0, i.orbitControls.dampingFactor = 0.1, i.orbitControls.rotateSpeed = 0.5, i.orbitControls.addEventListener("start", Q), i.orbitControls.addEventListener("change", ee), i.orbitControls.addEventListener("end", X);
6227
6227
  }
6228
6228
  let N = !1;
@@ -6275,30 +6275,30 @@ function Pl(a, e, t) {
6275
6275
  icon: Je.back
6276
6276
  }
6277
6277
  ];
6278
- const m = new pt(), T = (await Promise.all(
6279
- b.map((B) => ie(m, B.icon))
6280
- )).map((B) => new le({
6278
+ const m = new gt(), T = (await Promise.all(
6279
+ b.map((z) => ie(m, z.icon))
6280
+ )).map((z) => new le({
6281
6281
  color: 16777215,
6282
- map: B
6282
+ map: z
6283
6283
  }));
6284
6284
  var D = new V(new ei(110, 110, 110), T);
6285
6285
  i.sceneOrtho.add(D), pe(122), i.RenderScene();
6286
6286
  let A = { x: 0, y: 0 };
6287
- o.addEventListener("mousedown", (B) => {
6288
- A.x = B.clientX, A.y = B.clientY;
6289
- }), o.addEventListener("mouseup", (B) => {
6287
+ o.addEventListener("mousedown", (z) => {
6288
+ A.x = z.clientX, A.y = z.clientY;
6289
+ }), o.addEventListener("mouseup", (z) => {
6290
6290
  if (N) return;
6291
- const U = B.clientX - A.x, q = B.clientY - A.y;
6291
+ const U = z.clientX - A.x, q = z.clientY - A.y;
6292
6292
  if (Math.sqrt(U * U + q * q) > 5) return;
6293
6293
  var v = {};
6294
- v.x = B.offsetX / o.clientWidth * 2 - 1, v.y = -(B.offsetY / o.clientHeight) * 2 + 1;
6294
+ v.x = z.offsetX / o.clientWidth * 2 - 1, v.y = -(z.offsetY / o.clientHeight) * 2 + 1;
6295
6295
  var E = new be();
6296
6296
  E.setFromCamera(v, i.camera);
6297
6297
  const L = E.intersectObjects(l, !1);
6298
6298
  L.length > 0 && i.ToggleDirectionView(L[0].object.name);
6299
- }), o.addEventListener("mousemove", (B) => {
6299
+ }), o.addEventListener("mousemove", (z) => {
6300
6300
  var U = {};
6301
- U.x = B.offsetX / o.clientWidth * 2 - 1, U.y = -(B.offsetY / o.clientHeight) * 2 + 1;
6301
+ U.x = z.offsetX / o.clientWidth * 2 - 1, U.y = -(z.offsetY / o.clientHeight) * 2 + 1;
6302
6302
  var q = new be();
6303
6303
  q.setFromCamera(U, i.camera);
6304
6304
  const W = q.intersectObjects(l, !1);
@@ -6505,7 +6505,7 @@ function Pl(a, e, t) {
6505
6505
  color: "blue",
6506
6506
  transparent: !0,
6507
6507
  opacity: 0.01
6508
- }), T = new z().makeTranslation(b.point.x, b.point.y, b.point.z);
6508
+ }), T = new O().makeTranslation(b.point.x, b.point.y, b.point.z);
6509
6509
  let D = m.applyMatrix4(T), A = new V(D, x);
6510
6510
  return A.name = b.name, i.sceneOrtho.add(A), A;
6511
6511
  }
@@ -6727,8 +6727,8 @@ function Il(a) {
6727
6727
  let q = new d(x.min.X * 0.3048, x.min.Z * 0.3048, -x.min.Y * 0.3048), W = new d(x.max.X * 0.3048, x.max.Z * 0.3048, -x.max.Y * 0.3048), v = new d(Math.min(q.x, W.x), Math.min(q.y, W.y), Math.min(q.z, W.z)), E = new d(Math.max(W.x, q.x), Math.max(W.y, q.y), Math.max(W.z, q.z));
6728
6728
  x.threeBox = new R(v, E).applyMatrix4(A);
6729
6729
  }
6730
- const B = x.threeBox, U = m.ray.intersectsBox(B);
6731
- if (!(U == null || U == !1) && !(o && u?.doesBoxIntersectClippingRange?.(B) === !1))
6730
+ const z = x.threeBox, U = m.ray.intersectsBox(z);
6731
+ if (!(U == null || U == !1) && !(o && u?.doesBoxIntersectClippingRange?.(z) === !1))
6732
6732
  if (x.children == null || x.children.length == 0) {
6733
6733
  if (x.elements != null)
6734
6734
  for (let q of x.elements)
@@ -6747,9 +6747,9 @@ function Il(a) {
6747
6747
  const A = T.nodesMap.get(m);
6748
6748
  if (A == null)
6749
6749
  return;
6750
- const B = F(A.indexes);
6751
- if (B.length > 0) {
6752
- B.forEach((U) => {
6750
+ const z = F(A.indexes);
6751
+ if (z.length > 0) {
6752
+ z.forEach((U) => {
6753
6753
  const q = ee(A, D, U);
6754
6754
  if (q == null || o && u?.doesBoxIntersectClippingRange?.(q) === !1)
6755
6755
  return;
@@ -6814,17 +6814,17 @@ function Il(a) {
6814
6814
  const A = _e(a, x[0]);
6815
6815
  if (!(A instanceof G) || A.geometry == null)
6816
6816
  return null;
6817
- const B = x[1], U = X(A, B);
6817
+ const z = x[1], U = X(A, z);
6818
6818
  if (U == null)
6819
6819
  return null;
6820
6820
  const q = D.clone().multiply(U), W = m.info ?? m;
6821
6821
  W.__pickMeshes instanceof Map || (W.__pickMeshes = /* @__PURE__ */ new Map());
6822
- const v = `${x[0]}:${B}`;
6822
+ const v = `${x[0]}:${z}`;
6823
6823
  let E = W.__pickMeshes.get(v);
6824
6824
  return E instanceof V || (E = new V(A.geometry, A.material), W.__pickMeshes.set(v, E)), b(E, q), E.userData.__instancePickMeta = {
6825
6825
  url: T,
6826
6826
  id: m.info?.id ?? m.id ?? m.infos[0].id,
6827
- instanceId: B,
6827
+ instanceId: z,
6828
6828
  matrix: U.clone()
6829
6829
  }, E;
6830
6830
  }
@@ -6839,10 +6839,10 @@ function Il(a) {
6839
6839
  return D.geometry.boundingBox == null || A == null ? null : D.geometry.boundingBox.clone().applyMatrix4(A).applyMatrix4(x);
6840
6840
  }
6841
6841
  function X(m, x) {
6842
- const T = new z();
6842
+ const T = new O();
6843
6843
  if (typeof m.getMatrixAt == "function")
6844
6844
  m.getMatrixAt(x, T);
6845
- else if (m.matrixs?.[x] instanceof z)
6845
+ else if (m.matrixs?.[x] instanceof O)
6846
6846
  T.copy(m.matrixs[x]);
6847
6847
  else
6848
6848
  return null;
@@ -6901,7 +6901,7 @@ class Dl {
6901
6901
  // 加载模型属性,并进行回调
6902
6902
  loadProperties(e, t) {
6903
6903
  let i = this.engine.engineStatus.models.find((n) => n.url === e);
6904
- i.properties == null && (ut(this.engine, e, e + "/property"), wt(
6904
+ i.properties == null && (pt(this.engine, e, e + "/property"), Ct(
6905
6905
  e + "/property",
6906
6906
  (n) => {
6907
6907
  let s = JSON.parse(n);
@@ -6915,7 +6915,7 @@ class Dl {
6915
6915
  // 通过构件,属性名获取构件属性
6916
6916
  getModelPropertiesWithName(e, t, i, n) {
6917
6917
  let s = this.extended‌.get(e), o = this.engine.engineStatus.models.find((l) => l.url === e);
6918
- o.properties == null ? (ut(this.engine, e, e + "/property"), wt(
6918
+ o.properties == null ? (pt(this.engine, e, e + "/property"), Ct(
6919
6919
  e + "/property",
6920
6920
  (l) => {
6921
6921
  let c = JSON.parse(l);
@@ -6940,7 +6940,7 @@ class Dl {
6940
6940
  // 查询构件属性
6941
6941
  getModelProperties(e, t, i) {
6942
6942
  let n = this.extended‌.get(e), s = this.engine.engineStatus.models.find((r) => r.url === e);
6943
- return s.properties == null && (ut(this.engine, e, e + "/property"), wt(
6943
+ return s.properties == null && (pt(this.engine, e, e + "/property"), Ct(
6944
6944
  e + "/property",
6945
6945
  (r) => {
6946
6946
  let l = JSON.parse(r);
@@ -7384,7 +7384,7 @@ class Ll {
7384
7384
  return e === "resolution" || e === "maxVelocityLength" ? 512 : e.includes("Count") || e === "samples" || e === "blurQuality" ? 64 : e.toLowerCase().includes("intensity") ? 10 : Math.max(10, Math.ceil(Math.abs(t) * 4));
7385
7385
  }
7386
7386
  }
7387
- function ct(a) {
7387
+ function ht(a) {
7388
7388
  const e = typeof a == "number" ? a : Number(a), t = Number.isFinite(e) ? Math.round(e) : 6;
7389
7389
  return Math.min(12, Math.max(1, t));
7390
7390
  }
@@ -7395,7 +7395,7 @@ class zl {
7395
7395
  this.presets.set(t.level, Bt(t));
7396
7396
  }), pn.forEach((t) => {
7397
7397
  this.lightingPresets.set(t.id, { ...t });
7398
- }), this.currentLevel = ct(
7398
+ }), this.currentLevel = ht(
7399
7399
  e.options?.renderQualityLevel ?? zs
7400
7400
  ), this.pixelRatio = this.normalizePixelRatio(e.renderer?.getPixelRatio?.() ?? 1), this.panel = new Ll(e, this);
7401
7401
  }
@@ -7412,7 +7412,7 @@ class zl {
7412
7412
  }
7413
7413
  /** 手动切换 1 至 12 级渲染质量。 */
7414
7414
  setQualityLevel(e) {
7415
- const t = ct(e), i = this.getQualityPreset(t);
7415
+ const t = ht(e), i = this.getQualityPreset(t);
7416
7416
  this.applyQualityPreset(i), this.currentLevel = t, this.panel.refresh(), this.engine.updateVersionDisplay?.();
7417
7417
  }
7418
7418
  /** 返回当前数字渲染等级。 */
@@ -7421,18 +7421,18 @@ class zl {
7421
7421
  }
7422
7422
  /** 返回指定等级的深拷贝,调用方可以安全地编辑草稿。 */
7423
7423
  getQualityPreset(e) {
7424
- const t = ct(e), i = this.presets.get(t);
7424
+ const t = ht(e), i = this.presets.get(t);
7425
7425
  if (!i) throw new Error(`[EngineModelModule] 渲染等级 ${t} 不存在`);
7426
7426
  return Bt(i);
7427
7427
  }
7428
7428
  /** 保存指定等级的完整参数,并按需立即应用。 */
7429
7429
  updateQualityPreset(e, t, i = !1) {
7430
- const n = ct(e), s = Bt({ ...t, level: n });
7430
+ const n = ht(e), s = Bt({ ...t, level: n });
7431
7431
  this.presets.set(n, s), i && n === this.currentLevel && this.applyQualityPreset(s), this.panel.refresh();
7432
7432
  }
7433
7433
  /** 恢复指定等级的内置参数。 */
7434
7434
  resetQualityPreset(e) {
7435
- const t = ct(e), i = un.find((n) => n.level === t);
7435
+ const t = ht(e), i = un.find((n) => n.level === t);
7436
7436
  i && (this.presets.set(t, Bt(i)), t === this.currentLevel && this.applyQualityPreset(i));
7437
7437
  }
7438
7438
  /** 设置独立于质量等级的渲染像素比。 */
@@ -7492,7 +7492,7 @@ class zl {
7492
7492
  if (!t) throw new Error(`[EngineModelModule] 光环境预设 ${e} 不存在`);
7493
7493
  const i = ++this.lightingApplyVersion;
7494
7494
  this.engine.skyManager?.close?.(!0), await this.engine.hdr?.setHdr?.(t.hdrId), i === this.lightingApplyVersion && (this.engine.hdr?.setIntensity?.(t.hdrIntensity), this.engine.scene?.children?.forEach((n) => {
7495
- n instanceof St && (n.intensity = t.ambientIntensity), n instanceof At && (n.intensity = t.directionalIntensity);
7495
+ n instanceof At && (n.intensity = t.ambientIntensity), n instanceof et && (n.intensity = t.directionalIntensity);
7496
7496
  }), this.lightingPresetId = t.id, this.engine.requestShadowUpdate?.(), this.engine.requestComposerRender?.(), this.panel.refresh());
7497
7497
  }
7498
7498
  /** 返回 UI 和外部调用方需要的当前状态副本。 */
@@ -7534,7 +7534,7 @@ class zl {
7534
7534
  }
7535
7535
  applyShadowPreset(e, t) {
7536
7536
  this.engine.renderer?.shadowMap && (this.engine.renderer.shadowMap.enabled = e), this.engine.scene?.children?.forEach((i) => {
7537
- i instanceof At && (i.castShadow = e, (i.shadow.mapSize.width !== t || i.shadow.mapSize.height !== t) && (i.shadow.mapSize.set(t, t), i.shadow.map?.dispose?.(), i.shadow.map = null), i.shadow.needsUpdate = e);
7537
+ i instanceof et && (i.castShadow = e, (i.shadow.mapSize.width !== t || i.shadow.mapSize.height !== t) && (i.shadow.mapSize.set(t, t), i.shadow.map?.dispose?.(), i.shadow.map = null), i.shadow.needsUpdate = e);
7538
7538
  });
7539
7539
  }
7540
7540
  normalizePixelRatio(e) {
@@ -7724,7 +7724,7 @@ class Ol {
7724
7724
  this.disActive(), this.selectionBox?.remove(), this.selectionBox = null, this.worldToScreen = null, this.isDrawing = !1;
7725
7725
  }
7726
7726
  }
7727
- const Nl = O.degToRad(10), Fn = 1e-3, zi = !1, Fl = [];
7727
+ const Nl = B.degToRad(10), Fn = 1e-3, zi = !1, Fl = [];
7728
7728
  class Hl {
7729
7729
  engine;
7730
7730
  rootGroup = null;
@@ -7814,7 +7814,7 @@ class Hl {
7814
7814
  return;
7815
7815
  const t = this.coordinateMapper(e.data.Points[0]), i = this.coordinateMapper(e.data.Points[1]), n = new Pe();
7816
7816
  n.name = `GridAxis_${e.data.Id}`;
7817
- const s = new ue().setFromPoints([t, i]), o = new et({
7817
+ const s = new ue().setFromPoints([t, i]), o = new tt({
7818
7818
  color: 1609983,
7819
7819
  depthTest: !1
7820
7820
  }), r = new gs(s, o);
@@ -8013,7 +8013,7 @@ class Hl {
8013
8013
  return e instanceof d ? e.clone() : new d(e.x, e.y, e.z);
8014
8014
  }
8015
8015
  }
8016
- const Os = "0", Ns = 0, Fs = !1;
8016
+ const Os = "0", Ns = 0, Fs = !0, Vl = "animated-water-surface";
8017
8017
  class Zi {
8018
8018
  engine;
8019
8019
  currentId = Os;
@@ -8021,8 +8021,12 @@ class Zi {
8021
8021
  groundMesh = null;
8022
8022
  /** 当前为官方 Water 水面时为 true,用于 update/dispose 分支 */
8023
8023
  isWaterAddon = !1;
8024
+ /** 未显式配置太阳方向时,使水面高光跟随场景主定向光。 */
8025
+ syncWaterSunDirection = !1;
8024
8026
  groundY = Ns;
8025
- /** 默认水面法线贴图路径(项目内为 public/textture/waternormals.jpg) */
8027
+ lightWorldPosition = new d();
8028
+ lightTargetWorldPosition = new d();
8029
+ /** 官网案例使用的水面法线贴图。 */
8026
8030
  static DEFAULT_WATER_NORMALS = "/texture/waternormals.jpg";
8027
8031
  groundList = [
8028
8032
  { id: "0", names: ["无", "無", "None"] },
@@ -8039,7 +8043,9 @@ class Zi {
8039
8043
  { id: "10", names: ["木板", "木板", "Wood Board"], color: 15790320, roughness: 0.55, metalness: 0.1, map: "/texture/ground/wood01.jpg" },
8040
8044
  { id: "11", names: ["地砖1", "地磚1", "Floor Tile 1"], color: 15790320, roughness: 0.55, metalness: 0.1, map: "/texture/ground/z01.jpg" },
8041
8045
  { id: "12", names: ["地砖2", "地磚2", "Floor Tile 2"], color: 15790320, roughness: 0.55, metalness: 0.1, map: "/texture/ground/z02.jpg" },
8042
- { id: "13", names: ["湖面", "湖面", "Lake Surface"], water: !0, waterColor: 5929582, distortionScale: 2.5, size: 1 },
8046
+ // 水面参数与 three.js webgpu_ocean 官方案例保持一致。
8047
+ { id: "13", names: ["湖面", "湖面", "Lake Surface"], water: !0, waterColor: 7695, distortionScale: 3.7, size: 1 },
8048
+ // 海面沿用相同渲染方案,仅使用蓝色水体区分湖面预设。
8043
8049
  { id: "14", names: ["海面", "海面", "Sea Surface"], water: !0, waterColor: 28062, distortionScale: 3.7, size: 1 }
8044
8050
  ];
8045
8051
  constructor(e) {
@@ -8050,29 +8056,27 @@ class Zi {
8050
8056
  }
8051
8057
  /**
8052
8058
  * 切换地面类型
8053
- * @param id 地面 id:"0" 无 | "1" 草地 | "2" 混凝土 | "3" 地砖 | "4" 湖面 | "5" 海面
8059
+ * @param id 地面预设 ID,其中“13”为湖面,“14”为海面。
8054
8060
  */
8055
8061
  setGround(e, t) {
8056
8062
  if (this._dispose(), this.currentId = e, e === "0") return;
8057
8063
  const i = this.groundList.find((s) => s.id === e);
8058
- debugger;
8059
8064
  if (!i) return;
8060
- const n = t?.size ?? 3e4;
8065
+ const n = t?.size ?? (i.water ? 1e4 : 3e4);
8061
8066
  if (i.water) {
8062
- const s = new Ii(n, n), o = t?.waterNormalsUrl ?? Z(Zi.DEFAULT_WATER_NORMALS, import.meta.url), r = new pt().load(o, (g) => {
8067
+ const s = new Ii(n, n), o = t?.waterNormalsUrl ?? Z(Zi.DEFAULT_WATER_NORMALS, import.meta.url), r = new gt().load(o, (g) => {
8063
8068
  g.wrapS = g.wrapT = ti;
8064
- }), l = t?.sunDirection ?? new d(0.5, 0.8, 0.5).normalize(), c = t?.distortionScale ?? i.distortionScale ?? 3.7, h = t?.waterSize ?? i.size ?? 1, u = t?.opacity ?? 0.92, p = new _o(s, {
8065
- textureWidth: 512,
8066
- textureHeight: 512,
8069
+ }), l = t?.sunDirection?.clone().normalize() ?? this.getSceneSunDirection().clone(), c = t?.waterSize ?? i.size ?? 1, h = t?.distortionScale ?? i.distortionScale ?? 3.7, u = B.clamp(t?.opacity ?? 0.92, 0, 1), p = new _o(s, {
8070
+ resolutionScale: B.clamp(t?.resolutionScale ?? 0.5, 0.1, 1),
8067
8071
  waterNormals: r,
8068
- sunDirection: l.clone(),
8069
- sunColor: 16777215,
8070
- waterColor: i.waterColor ?? 28062,
8071
- distortionScale: c,
8072
8072
  alpha: u,
8073
- fog: !!this.engine.scene?.fog
8073
+ size: c,
8074
+ sunDirection: l,
8075
+ sunColor: t?.sunColor ?? 16777215,
8076
+ waterColor: t?.waterColor ?? i.waterColor ?? 7695,
8077
+ distortionScale: h
8074
8078
  });
8075
- p.rotation.x = -Math.PI / 2, p.position.y = -0.01, p.name = "groundMesh", p.receiveShadow = !0, p.castShadow = !1, this.ensureWaterShadowUniforms(p.material), p.material.uniforms.size.value = h, this.groundMesh = p, this.isWaterAddon = !0, this.groundGroup.add(p);
8079
+ p.rotation.x = -Math.PI / 2, p.position.y = -0.01, p.name = "groundMesh", p.renderOrder = 1 / 0, p.receiveShadow = !0, p.castShadow = !1, p.material.depthWrite = u >= 1, this.groundMesh = p, this.isWaterAddon = !0, this.syncWaterSunDirection = t?.sunDirection === void 0, this.groundGroup.add(p), this.updateWaterFrameRateExemption();
8076
8080
  } else {
8077
8081
  const s = new Ii(n, n, 1, 1);
8078
8082
  s.rotateX(-Math.PI / 2);
@@ -8081,7 +8085,7 @@ class Zi {
8081
8085
  roughness: i.roughness,
8082
8086
  metalness: i.metalness
8083
8087
  }), r = t?.textureUrl ?? (i.map ? Z(i.map, import.meta.url) : void 0);
8084
- r && new pt().load(
8088
+ r && new gt().load(
8085
8089
  r,
8086
8090
  (c) => {
8087
8091
  c.wrapS = c.wrapT = ti, c.repeat.set(1e4, 1e4), o.map = c, o.needsUpdate = !0;
@@ -8106,16 +8110,11 @@ class Zi {
8106
8110
  getHeight() {
8107
8111
  return this.groundY;
8108
8112
  }
8109
- /** 每帧调用,驱动水面动画并与场景阳光/相机同步 */
8113
+ /** 每帧同步场景主光;水面动画和相机位置由 TSL 节点自动更新。 */
8110
8114
  update() {
8111
- if (!this.groundMesh || !this.isWaterAddon) return;
8112
- const t = this.groundMesh.material?.uniforms;
8113
- if (!t) return;
8114
- t.time.value += 1 / 60;
8115
- const i = this.engine.scene?.dirLight;
8116
- i && t.sunDirection && t.sunDirection.value.copy(i.position).normalize();
8117
- const n = this.engine.camera;
8118
- n && t.eye && t.eye.value.setFromMatrixPosition(n.matrixWorld);
8115
+ if (!this.groundMesh || !this.isWaterAddon || !this.syncWaterSunDirection) return;
8116
+ const e = this.groundMesh;
8117
+ this.engine.scene?.dirLight instanceof et && e.sunDirection.value.copy(this.getSceneSunDirection());
8119
8118
  }
8120
8119
  /** 获取地面列表(id + 名称) */
8121
8120
  getGroundList() {
@@ -8129,35 +8128,38 @@ class Zi {
8129
8128
  return this.groundGroup.visible;
8130
8129
  }
8131
8130
  show() {
8132
- this.groundGroup.visible = !0;
8131
+ this.groundGroup.visible = !0, this.updateWaterFrameRateExemption(), this.engine.requestComposerRender?.();
8133
8132
  }
8134
8133
  hide() {
8135
- this.groundGroup.visible = !1;
8134
+ this.groundGroup.visible = !1, this.updateWaterFrameRateExemption(), this.engine.requestComposerRender?.();
8136
8135
  }
8137
8136
  dispose() {
8138
8137
  this._dispose(), this.engine.scene.remove(this.groundGroup);
8139
8138
  }
8140
- /**
8141
- * 兼容项目内本地 three 渲染器。
8142
- * 本地渲染器会向 lights uniforms 写入 directional/spot/point 的 shadowMap,
8143
- * 但 npm Water 使用的 three 版本没有把这些 sampler 挂到 UniformsLib['lights'] 上。
8144
- */
8145
- ensureWaterShadowUniforms(e) {
8146
- const t = e.uniforms;
8147
- t.directionalShadowMap || (t.directionalShadowMap = { value: [] }), t.spotShadowMap || (t.spotShadowMap = { value: [] }), t.pointShadowMap || (t.pointShadowMap = { value: [] }), e.uniformsNeedUpdate = !0;
8148
- }
8149
8139
  _dispose() {
8150
8140
  if (!this.groundMesh) return;
8151
- this.groundMesh.geometry.dispose();
8152
- const e = this.groundMesh.material;
8153
- Array.isArray(e) ? e.forEach((t) => t.dispose()) : e.dispose(), this.groundGroup.remove(this.groundMesh), this.groundMesh = null, this.isWaterAddon = !1;
8141
+ (this.isWaterAddon ? this.groundMesh.waterNormals.value : null)?.dispose(), this.groundMesh.geometry.dispose();
8142
+ const t = this.groundMesh.material;
8143
+ Array.isArray(t) ? t.forEach((i) => i.dispose()) : t.dispose(), this.groundGroup.remove(this.groundMesh), this.groundMesh = null, this.isWaterAddon = !1, this.syncWaterSunDirection = !1, this.updateWaterFrameRateExemption();
8144
+ }
8145
+ /** 计算从定向光目标指向光源的单位向量,作为水面的太阳方向。 */
8146
+ getSceneSunDirection() {
8147
+ const e = this.engine.scene?.dirLight;
8148
+ return e instanceof et ? (e.getWorldPosition(this.lightWorldPosition), e.target.getWorldPosition(this.lightTargetWorldPosition), this.lightWorldPosition.sub(this.lightTargetWorldPosition).normalize()) : this.lightWorldPosition.set(0.5, 0.8, 0.5).normalize();
8149
+ }
8150
+ /** 水面可见时关闭空闲限帧,保证 TSL 时间节点持续产生平滑波纹。 */
8151
+ updateWaterFrameRateExemption() {
8152
+ this.engine.setIdleFrameRateExempt?.(
8153
+ Vl,
8154
+ this.isWaterAddon && this.groundGroup.visible
8155
+ );
8154
8156
  }
8155
8157
  }
8156
- const Ue = "0", Vl = !0, Oi = 0.2, Ni = 1, Ul = 0.35;
8157
- class ql {
8158
+ const Ue = "0", Ul = !0, Oi = 0.2, Ni = 1, ql = 0.35;
8159
+ class Gl {
8158
8160
  engine;
8159
8161
  currentHdrId = Ue;
8160
- isVisible = Vl;
8162
+ isVisible = Ul;
8161
8163
  currentIntensity = Oi;
8162
8164
  currentBackgroundIntensity = Ni;
8163
8165
  currentTexture = null;
@@ -8168,7 +8170,7 @@ class ql {
8168
8170
  previousBackgroundIntensity = 1;
8169
8171
  previousEnvironmentIntensity = 1;
8170
8172
  previousAmbientLightIntensity = 1;
8171
- previousToneMapping = dt;
8173
+ previousToneMapping = ut;
8172
8174
  previousToneMappingExposure = 1;
8173
8175
  hdrList = [
8174
8176
  { id: "0", names: ["无", "無", "None"] },
@@ -8267,35 +8269,35 @@ class ql {
8267
8269
  t.dispose(), this.currentEnvironmentTexture = i, this.engine.scene.background = this.isVisible ? e : this.previousBackground, this.engine.scene.backgroundIntensity = this.isVisible ? this.currentBackgroundIntensity : this.previousBackgroundIntensity, this.engine.scene.environment = i, this.engine.scene.environmentIntensity = this.currentIntensity, this.engine.renderer.toneMapping = Wi, this.engine.renderer.toneMappingExposure = this.previousToneMappingExposure > 0 ? this.previousToneMappingExposure : Ji, this._setAmbientLightIntensity(this._getHdrAmbientLightIntensity()), this.engine.composerModule?.rebuild?.();
8268
8270
  }
8269
8271
  _captureSceneState() {
8270
- this.currentHdrId !== Ue || !this.engine.scene || (this.previousBackground = this.engine.scene.background, this.previousEnvironment = this.engine.scene.environment, this.previousBackgroundIntensity = this.engine.scene.backgroundIntensity ?? 1, this.previousEnvironmentIntensity = this.engine.scene.environmentIntensity ?? 1, this.previousAmbientLightIntensity = this._getAmbientLightIntensity(), this.previousToneMapping = this.engine.renderer?.toneMapping ?? dt, this.previousToneMappingExposure = this.engine.renderer?.toneMappingExposure ?? 1);
8272
+ this.currentHdrId !== Ue || !this.engine.scene || (this.previousBackground = this.engine.scene.background, this.previousEnvironment = this.engine.scene.environment, this.previousBackgroundIntensity = this.engine.scene.backgroundIntensity ?? 1, this.previousEnvironmentIntensity = this.engine.scene.environmentIntensity ?? 1, this.previousAmbientLightIntensity = this._getAmbientLightIntensity(), this.previousToneMapping = this.engine.renderer?.toneMapping ?? ut, this.previousToneMappingExposure = this.engine.renderer?.toneMappingExposure ?? 1);
8271
8273
  }
8272
8274
  _clearHdr() {
8273
- this.currentTexture = null, this.engine.scene && (this.currentEnvironmentTexture?.dispose(), this.currentEnvironmentTexture = null, this.engine.scene.background = this.previousBackground, this.engine.scene.environment = this.previousEnvironment, this.engine.scene.backgroundIntensity = this.previousBackgroundIntensity, this.engine.scene.environmentIntensity = this.previousEnvironmentIntensity, this._setAmbientLightIntensity(this.previousAmbientLightIntensity), this.engine.renderer && (this.engine.renderer.toneMapping = this.previousToneMapping, this.engine.renderer.toneMappingExposure = this.previousToneMappingExposure), this.previousBackground = null, this.previousEnvironment = null, this.previousBackgroundIntensity = 1, this.previousEnvironmentIntensity = 1, this.previousAmbientLightIntensity = 1, this.previousToneMapping = dt, this.previousToneMappingExposure = 1);
8275
+ this.currentTexture = null, this.engine.scene && (this.currentEnvironmentTexture?.dispose(), this.currentEnvironmentTexture = null, this.engine.scene.background = this.previousBackground, this.engine.scene.environment = this.previousEnvironment, this.engine.scene.backgroundIntensity = this.previousBackgroundIntensity, this.engine.scene.environmentIntensity = this.previousEnvironmentIntensity, this._setAmbientLightIntensity(this.previousAmbientLightIntensity), this.engine.renderer && (this.engine.renderer.toneMapping = this.previousToneMapping, this.engine.renderer.toneMappingExposure = this.previousToneMappingExposure), this.previousBackground = null, this.previousEnvironment = null, this.previousBackgroundIntensity = 1, this.previousEnvironmentIntensity = 1, this.previousAmbientLightIntensity = 1, this.previousToneMapping = ut, this.previousToneMappingExposure = 1);
8274
8276
  }
8275
8277
  _getAmbientLightIntensity() {
8276
8278
  return this.engine.scene?.children.find(
8277
- (t) => t instanceof St
8279
+ (t) => t instanceof At
8278
8280
  )?.intensity ?? 1;
8279
8281
  }
8280
8282
  _setAmbientLightIntensity(e) {
8281
8283
  const t = this.engine.scene?.children.find(
8282
- (i) => i instanceof St
8284
+ (i) => i instanceof At
8283
8285
  );
8284
8286
  t && (t.intensity = e);
8285
8287
  }
8286
8288
  _getHdrAmbientLightIntensity() {
8287
- return Math.max(this.previousAmbientLightIntensity * Ul, 0);
8289
+ return Math.max(this.previousAmbientLightIntensity * ql, 0);
8288
8290
  }
8289
8291
  _requestRender() {
8290
8292
  this.engine?.requestComposerRender?.();
8291
8293
  }
8292
8294
  }
8293
- const Gl = 1e-3, Hs = !1, Wl = [
8295
+ const Wl = 1e-3, Hs = !1, Kl = [
8294
8296
  { Id: "339", Name: "L1", Elevation: -0.32808398950131235 },
8295
8297
  { Id: "2787", Name: "L2", Elevation: 16.896325459317584 },
8296
8298
  { Id: "236633", Name: "L3", Elevation: 36.745406824146976 }
8297
8299
  ];
8298
- class Kl {
8300
+ class jl {
8299
8301
  engine;
8300
8302
  isVisible = Hs;
8301
8303
  levels = [];
@@ -8315,7 +8317,7 @@ class Kl {
8315
8317
  }
8316
8318
  setMockData() {
8317
8319
  const e = this.engine.models?.[0]?.levels, t = this.engine.models?.[0]?.boundingBox;
8318
- this.setData(Array.isArray(e) && e.length > 0 ? e : Wl, t);
8320
+ this.setData(Array.isArray(e) && e.length > 0 ? e : Kl, t);
8319
8321
  }
8320
8322
  show() {
8321
8323
  this.isVisible = !0, this.svgContainer && (this.svgContainer.style.display = "block"), this.levels.forEach((e) => {
@@ -8348,7 +8350,7 @@ class Kl {
8348
8350
  const { url: i, targetPoint: n } = this.resolvePointLookupArgs(e, t), s = this.getLevelData(i).slice().sort((g, y) => g.Elevation - y.Elevation);
8349
8351
  if (s.length === 0)
8350
8352
  return null;
8351
- const o = (n instanceof d, n.y), r = s.find((g) => Math.abs(g.Elevation - o) <= Gl) ?? null;
8353
+ const o = (n instanceof d, n.y), r = s.find((g) => Math.abs(g.Elevation - o) <= Wl) ?? null;
8352
8354
  if (r)
8353
8355
  return {
8354
8356
  pointY: o,
@@ -8420,7 +8422,7 @@ class Kl {
8420
8422
  new d(this.halfSize, s, this.halfSize),
8421
8423
  new d(-this.halfSize, s, this.halfSize),
8422
8424
  new d(-this.halfSize, s, -this.halfSize)
8423
- ], u = new ue().setFromPoints(h), p = new et({
8425
+ ], u = new ue().setFromPoints(h), p = new tt({
8424
8426
  color: this.COLOR,
8425
8427
  transparent: !0,
8426
8428
  opacity: 0.7
@@ -8522,33 +8524,33 @@ class Kl {
8522
8524
  };
8523
8525
  }
8524
8526
  }
8525
- const Xt = !0, Fi = 0.5, jl = 32, Yl = 0.05, Ql = 0.02, Xl = 0.06, $l = 0.01;
8526
- function Jl(a) {
8527
+ const Xt = !0, Fi = 0.5, Yl = 32, Ql = 0.05, Xl = 0.02, $l = 0.06, Jl = 0.01;
8528
+ function Zl(a) {
8527
8529
  return !a?.min || !a?.max ? 0 : a.min.distanceTo(a.max);
8528
8530
  }
8529
- function Zl(a, e) {
8531
+ function ec(a, e) {
8530
8532
  return a instanceof d ? a.clone() : e?.min && e?.max ? e.min.clone().add(e.max).multiplyScalar(0.5) : new d();
8531
8533
  }
8532
- function ec(a, e, t) {
8534
+ function tc(a, e, t) {
8533
8535
  if (a instanceof Ve)
8534
8536
  return Math.max((a.top - a.bottom) / Math.max(a.zoom, 1e-6), 1);
8535
- const i = a, n = Zl(e, t), s = i.position.distanceTo(n), o = typeof i.getEffectiveFOV == "function" ? i.getEffectiveFOV() : i.fov, r = O.degToRad(o * 0.5);
8537
+ const i = a, n = ec(e, t), s = i.position.distanceTo(n), o = typeof i.getEffectiveFOV == "function" ? i.getEffectiveFOV() : i.fov, r = B.degToRad(o * 0.5);
8536
8538
  return Math.max(2 * s * Math.tan(r), 1);
8537
8539
  }
8538
- function tc(a, e, t, i) {
8540
+ function ic(a, e, t, i) {
8539
8541
  if (a == null)
8540
8542
  return i;
8541
- const n = Jl(t);
8543
+ const n = Zl(t);
8542
8544
  if (n <= 0)
8543
8545
  return i;
8544
- const s = ec(a, e, t), o = Math.max(n * Ql, 1), r = Math.max(n * Xl, o + 1), l = O.clamp(
8546
+ const s = tc(a, e, t), o = Math.max(n * Xl, 1), r = Math.max(n * $l, o + 1), l = B.clamp(
8545
8547
  (s - o) / (r - o),
8546
8548
  0,
8547
8549
  1
8548
8550
  );
8549
- return O.lerp(i, 0, l);
8551
+ return B.lerp(i, 0, l);
8550
8552
  }
8551
- class ic {
8553
+ class nc {
8552
8554
  engine;
8553
8555
  isActive = Xt;
8554
8556
  groupEdge;
@@ -8620,13 +8622,13 @@ class ic {
8620
8622
  }), this.highlightIndexes.set(e, s), s;
8621
8623
  }
8622
8624
  constructor(e) {
8623
- this.engine = e, this.groupEdge = this.engine.scene.getObjectByName("groupEdge"), Li(this.groupEdge, this.engine.sectionPlane), this.groupEdge.userData.excludeFromAutoExposure = !0, this.highlightEdgeGroup = new Pe(), this.highlightEdgeGroup.name = "highlightModelEdgeGroup", Li(this.highlightEdgeGroup, this.engine.sectionPlane), this.highlightEdgeGroup.userData.excludeFromAutoExposure = !0, this.highlightEdgeGroup.renderOrder = 999, this.engine.scene.add(this.highlightEdgeGroup), this.material = new et({
8625
+ this.engine = e, this.groupEdge = this.engine.scene.getObjectByName("groupEdge"), Li(this.groupEdge, this.engine.sectionPlane), this.groupEdge.userData.excludeFromAutoExposure = !0, this.highlightEdgeGroup = new Pe(), this.highlightEdgeGroup.name = "highlightModelEdgeGroup", Li(this.highlightEdgeGroup, this.engine.sectionPlane), this.highlightEdgeGroup.userData.excludeFromAutoExposure = !0, this.highlightEdgeGroup.renderOrder = 999, this.engine.scene.add(this.highlightEdgeGroup), this.material = new tt({
8624
8626
  color: 0,
8625
8627
  transparent: !0,
8626
8628
  opacity: Fi,
8627
8629
  depthTest: !0,
8628
8630
  depthWrite: !1
8629
- }), this.material.clippingPlanes = this.engine.sectionPlane, this.highlightEdgeMaterial = new et({
8631
+ }), this.material.clippingPlanes = this.engine.sectionPlane, this.highlightEdgeMaterial = new tt({
8630
8632
  color: 16777215,
8631
8633
  transparent: !0,
8632
8634
  opacity: 1,
@@ -8660,20 +8662,20 @@ class ic {
8660
8662
  update() {
8661
8663
  if (!this.isActive || !this.material)
8662
8664
  return;
8663
- const e = tc(
8665
+ const e = ic(
8664
8666
  this.engine?.camera,
8665
8667
  this.engine?.controls?.target,
8666
8668
  this.engine?.octreeBox?.getBoundingBox?.(),
8667
8669
  this.baseOpacity
8668
8670
  );
8669
- (this.lastReportedOpacity === null || Math.abs(this.lastReportedOpacity - e) > 1e-3) && (console.log("[ModelEdge] 实时透明度:", Number(e.toFixed(4))), this.lastReportedOpacity = e), !(e > 0 && Math.abs(this.material.opacity - e) <= $l) && (this.material.opacity = e, this.material.needsUpdate = !0);
8671
+ (this.lastReportedOpacity === null || Math.abs(this.lastReportedOpacity - e) > 1e-3) && (console.log("[ModelEdge] 实时透明度:", Number(e.toFixed(4))), this.lastReportedOpacity = e), !(e > 0 && Math.abs(this.material.opacity - e) <= Jl) && (this.material.opacity = e, this.material.needsUpdate = !0);
8670
8672
  }
8671
8673
  hasPendingModelEdges() {
8672
8674
  return (this.engine?.models ?? []).some((t) => this.shouldLoadModelEdge(t) && !Array.isArray(t?.modelEdge));
8673
8675
  }
8674
8676
  loadZipJsonAsync(e, t) {
8675
8677
  return new Promise((i, n) => {
8676
- wt(
8678
+ Ct(
8677
8679
  e,
8678
8680
  (s) => {
8679
8681
  if (s == null) {
@@ -8696,7 +8698,7 @@ class ic {
8696
8698
  return e.modelEdge;
8697
8699
  try {
8698
8700
  const t = this.engine.engineStatus.models.find((s) => s.url == e.url);
8699
- ut(this.engine, e.url, e.url + "/edge");
8701
+ pt(this.engine, e.url, e.url + "/edge");
8700
8702
  const i = await this.loadZipJsonAsync(e.url + "/edge", t?.key ?? e?.key), n = JSON.parse(i);
8701
8703
  if (Array.isArray(n)) {
8702
8704
  const s = this.getFilteredIdSet(e.url);
@@ -8799,7 +8801,7 @@ class ic {
8799
8801
  if (i.ids.forEach((l) => {
8800
8802
  const c = n?.get(Number(l)), h = typeof c == "number" ? this.getEdgePointsByIndex(i.url, c) : null;
8801
8803
  if (Array.isArray(h)) {
8802
- if (h.length > jl)
8804
+ if (h.length > Yl)
8803
8805
  return;
8804
8806
  this.appendEdgePositions(s, h);
8805
8807
  }
@@ -8858,7 +8860,7 @@ class ic {
8858
8860
  }
8859
8861
  // 设置边线材质透明度
8860
8862
  setOpacity(e) {
8861
- this.baseOpacity = O.clamp(e, Yl, 1), this.update();
8863
+ this.baseOpacity = B.clamp(e, Ql, 1), this.update();
8862
8864
  }
8863
8865
  // 显示边线
8864
8866
  showModelEdge(e, t) {
@@ -9078,7 +9080,7 @@ const Hn = {
9078
9080
  ], Vn = Vi.reduce(
9079
9081
  (a, e) => (a[e.id] = e, a),
9080
9082
  {}
9081
- ), Un = 2e6, qn = 45e4, nc = 64, sc = 32, oc = 128, rc = 100, Gn = "v3-sky-clouds", Wn = {
9083
+ ), Un = 2e6, qn = 45e4, sc = 64, oc = 32, rc = 128, ac = 100, Gn = "v3-sky-clouds", Wn = {
9082
9084
  turbidity: [0, 20],
9083
9085
  rayleigh: [0, 4],
9084
9086
  mieCoefficient: [0, 0.1],
@@ -9093,7 +9095,7 @@ const Hn = {
9093
9095
  cloudDensity: [0, 1],
9094
9096
  cloudElevation: [0, 1]
9095
9097
  };
9096
- class ac {
9098
+ class lc {
9097
9099
  engine;
9098
9100
  sky = null;
9099
9101
  sun = new d();
@@ -9108,7 +9110,7 @@ class ac {
9108
9110
  previousEnvironment = null;
9109
9111
  previousBackgroundIntensity = 1;
9110
9112
  previousEnvironmentIntensity = 1;
9111
- previousToneMapping = dt;
9113
+ previousToneMapping = ut;
9112
9114
  previousToneMappingExposure = 1;
9113
9115
  hasCapturedSceneState = !1;
9114
9116
  constructor(e) {
@@ -9167,8 +9169,8 @@ class ac {
9167
9169
  _createSeamlessSky() {
9168
9170
  const e = new Ro(), t = new ni(
9169
9171
  1,
9170
- nc,
9171
- sc
9172
+ sc,
9173
+ oc
9172
9174
  );
9173
9175
  return e.geometry.copy(t), t.dispose(), e.scale.setScalar(qn), e.frustumCulled = !1, e;
9174
9176
  }
@@ -9192,19 +9194,19 @@ class ac {
9192
9194
  _applyParamsToSky() {
9193
9195
  if (!this.sky) return;
9194
9196
  this.sky.turbidity.value = this.params.turbidity, this.sky.rayleigh.value = this.params.rayleigh, this.sky.mieCoefficient.value = this.params.mieCoefficient, this.sky.mieDirectionalG.value = this.params.mieDirectionalG, this.sky.cloudScale.value = this.params.cloudScale, this.sky.cloudSpeed.value = this.params.cloudSpeed, this.sky.cloudCoverage.value = this.params.cloudCoverage, this.sky.cloudDensity.value = this.params.cloudDensity, this.sky.cloudElevation.value = this.params.cloudElevation, this.sky.showSunDisc.value = this.params.showSunDisc;
9195
- const e = O.degToRad(90 - this.params.elevation), t = O.degToRad(this.params.azimuth);
9197
+ const e = B.degToRad(90 - this.params.elevation), t = B.degToRad(this.params.azimuth);
9196
9198
  this.sun.setFromSphericalCoords(1, e, t), this.sky.sunPosition.value.copy(this.sun), this.engine?.renderer && (this.engine.renderer.toneMapping = Bo, this.engine.renderer.toneMappingExposure = this._getEffectiveExposure()), this._updateAnimationState(), this.isActive() && this._scheduleEnvironmentRefresh();
9197
9199
  }
9198
9200
  _captureSceneState() {
9199
- this.hasCapturedSceneState || !this.engine?.scene || (this.previousBackground = this.engine.scene.background, this.previousEnvironment = this.engine.scene.environment, this.previousBackgroundIntensity = this.engine.scene.backgroundIntensity ?? 1, this.previousEnvironmentIntensity = this.engine.scene.environmentIntensity ?? 1, this.previousToneMapping = this.engine.renderer?.toneMapping ?? dt, this.previousToneMappingExposure = this.engine.renderer?.toneMappingExposure ?? 1, this.hasCapturedSceneState = !0);
9201
+ this.hasCapturedSceneState || !this.engine?.scene || (this.previousBackground = this.engine.scene.background, this.previousEnvironment = this.engine.scene.environment, this.previousBackgroundIntensity = this.engine.scene.backgroundIntensity ?? 1, this.previousEnvironmentIntensity = this.engine.scene.environmentIntensity ?? 1, this.previousToneMapping = this.engine.renderer?.toneMapping ?? ut, this.previousToneMappingExposure = this.engine.renderer?.toneMappingExposure ?? 1, this.hasCapturedSceneState = !0);
9200
9202
  }
9201
9203
  _restoreSceneState() {
9202
- !this.hasCapturedSceneState || !this.engine?.scene || (this.engine.scene.background = this.previousBackground, this.engine.scene.environment = this.previousEnvironment, this.engine.scene.backgroundIntensity = this.previousBackgroundIntensity, this.engine.scene.environmentIntensity = this.previousEnvironmentIntensity, this.engine.renderer && (this.engine.renderer.toneMapping = this.previousToneMapping, this.engine.renderer.toneMappingExposure = this.previousToneMappingExposure), this.previousBackground = null, this.previousEnvironment = null, this.previousBackgroundIntensity = 1, this.previousEnvironmentIntensity = 1, this.previousToneMapping = dt, this.previousToneMappingExposure = 1, this.hasCapturedSceneState = !1);
9204
+ !this.hasCapturedSceneState || !this.engine?.scene || (this.engine.scene.background = this.previousBackground, this.engine.scene.environment = this.previousEnvironment, this.engine.scene.backgroundIntensity = this.previousBackgroundIntensity, this.engine.scene.environmentIntensity = this.previousEnvironmentIntensity, this.engine.renderer && (this.engine.renderer.toneMapping = this.previousToneMapping, this.engine.renderer.toneMappingExposure = this.previousToneMappingExposure), this.previousBackground = null, this.previousEnvironment = null, this.previousBackgroundIntensity = 1, this.previousEnvironmentIntensity = 1, this.previousToneMapping = ut, this.previousToneMappingExposure = 1, this.hasCapturedSceneState = !1);
9203
9205
  }
9204
9206
  _scheduleEnvironmentRefresh() {
9205
9207
  !this.isActive() || !this.engine?.renderer || (this._cancelEnvironmentRefresh(), this.environmentRefreshTimer = setTimeout(() => {
9206
9208
  this.environmentRefreshTimer = null, this._refreshEnvironmentMap();
9207
- }, rc));
9209
+ }, ac));
9208
9210
  }
9209
9211
  _cancelEnvironmentRefresh() {
9210
9212
  this.environmentRefreshTimer != null && (clearTimeout(this.environmentRefreshTimer), this.environmentRefreshTimer = null);
@@ -9220,7 +9222,7 @@ class ac {
9220
9222
  0,
9221
9223
  0.1,
9222
9224
  qn * 2,
9223
- { size: oc }
9225
+ { size: rc }
9224
9226
  ), s = this.currentEnvironmentTarget;
9225
9227
  this.currentEnvironmentTarget = n, this.engine.scene.environment = n.texture, this.engine.scene.environmentIntensity = this.currentIntensity, s?.dispose(), this._requestRender();
9226
9228
  } catch (n) {
@@ -9242,7 +9244,7 @@ class ac {
9242
9244
  const n = Wn[i], s = t[i];
9243
9245
  if (!n || typeof s != "number") return;
9244
9246
  const o = Number.isFinite(s) ? s : Hn[i];
9245
- t[i] = O.clamp(
9247
+ t[i] = B.clamp(
9246
9248
  o,
9247
9249
  n[0],
9248
9250
  n[1]
@@ -9253,7 +9255,7 @@ class ac {
9253
9255
  this.engine?.requestComposerRender?.();
9254
9256
  }
9255
9257
  }
9256
- class lc {
9258
+ class cc {
9257
9259
  /** 寮曟搸瀹炰緥寮曠敤 */
9258
9260
  engine;
9259
9261
  defaultSettings;
@@ -9459,7 +9461,7 @@ class lc {
9459
9461
  };
9460
9462
  }
9461
9463
  _toRenderMode(e) {
9462
- return e == null ? zs : ct(e);
9464
+ return e == null ? zs : ht(e);
9463
9465
  }
9464
9466
  _uniformToPercent(e, t) {
9465
9467
  const i = typeof e == "number" ? e : t;
@@ -9482,7 +9484,7 @@ class lc {
9482
9484
  }
9483
9485
  _getDirectionalLightShadowIntensity() {
9484
9486
  const e = this.engine.scene?.children?.filter(
9485
- (i) => i instanceof At
9487
+ (i) => i instanceof et
9486
9488
  );
9487
9489
  return !e || e.length === 0 ? Yt : (e.find((i) => i.castShadow) ?? e[0]).shadow?.intensity ?? Yt;
9488
9490
  }
@@ -9521,7 +9523,7 @@ class lc {
9521
9523
  }
9522
9524
  _updateDirectionalLight(e) {
9523
9525
  const t = this.engine.scene?.children.find(
9524
- (i) => i instanceof At
9526
+ (i) => i instanceof et
9525
9527
  );
9526
9528
  t && e(t);
9527
9529
  }
@@ -9812,7 +9814,7 @@ class We {
9812
9814
  }
9813
9815
  }
9814
9816
  }
9815
- class cc {
9817
+ class hc {
9816
9818
  engine;
9817
9819
  isActive = !1;
9818
9820
  tools;
@@ -9916,7 +9918,7 @@ class cc {
9916
9918
  }
9917
9919
  }
9918
9920
  }
9919
- class hc {
9921
+ class dc {
9920
9922
  engine;
9921
9923
  tools;
9922
9924
  isActive = !1;
@@ -9972,7 +9974,7 @@ class hc {
9972
9974
  }
9973
9975
  // 按下esc
9974
9976
  }
9975
- class dc {
9977
+ class uc {
9976
9978
  engine;
9977
9979
  isActive = !1;
9978
9980
  tools;
@@ -10027,7 +10029,7 @@ class dc {
10027
10029
  t.point1 = s.point, t.point2 = n[0].point, t.text = t.point1.clone().distanceTo(t.point2.clone()), this.engine.events.trigger(oe.MeasureChanged, t);
10028
10030
  }
10029
10031
  }
10030
- class uc {
10032
+ class pc {
10031
10033
  engine;
10032
10034
  isActive = !1;
10033
10035
  tools;
@@ -10072,7 +10074,7 @@ class uc {
10072
10074
  t.point = e.catch.point.clone(), t.text = e.catch.point.y, t.isSelect = !1, this.engine.events.trigger(oe.MeasureChanged, t);
10073
10075
  }
10074
10076
  }
10075
- class pc {
10077
+ class gc {
10076
10078
  engine;
10077
10079
  isActive = !1;
10078
10080
  tools;
@@ -10124,7 +10126,7 @@ class pc {
10124
10126
  e != null && (e.isSelect = !1, this.engine.events.trigger(oe.MeasureChanged, e));
10125
10127
  }
10126
10128
  }
10127
- class gc {
10129
+ class mc {
10128
10130
  engine;
10129
10131
  tools;
10130
10132
  // 存储三个点:起点、顶点(中间点)、终点
@@ -10192,7 +10194,7 @@ class gc {
10192
10194
  }
10193
10195
  }
10194
10196
  }
10195
- class mc {
10197
+ class fc {
10196
10198
  engine;
10197
10199
  tools;
10198
10200
  points = [];
@@ -10265,7 +10267,7 @@ class mc {
10265
10267
  e != null && this.points.length >= 3 ? (e.points = this.points.map((t) => t.clone()), e.area = this.calculateArea(e.points), e.text = e.area, e.isSelect = !1, this.points = [], this.engine.events.trigger(oe.MeasureChanged, e)) : this.engine.measure.tools.handelKeyEscDown();
10266
10268
  }
10267
10269
  }
10268
- class Et {
10270
+ class St {
10269
10271
  engine;
10270
10272
  tools;
10271
10273
  static WORLD_UP = new d(0, 1, 0);
@@ -10324,7 +10326,7 @@ class Et {
10324
10326
  const t = this.getWorldFaceNormal(e);
10325
10327
  if (t == null)
10326
10328
  return null;
10327
- const i = new d().crossVectors(t, Et.WORLD_UP);
10329
+ const i = new d().crossVectors(t, St.WORLD_UP);
10328
10330
  if (i.lengthSq() < 1e-10)
10329
10331
  return null;
10330
10332
  const n = new d().crossVectors(i.normalize(), t);
@@ -10352,9 +10354,9 @@ class Et {
10352
10354
  t.clone().multiplyScalar(c)
10353
10355
  ), u = o.worldToScreenIfVisible(h);
10354
10356
  if (u != null)
10355
- return this.pointToScreenLineDistance(l, r, u) <= Et.SLOPE_DIRECTION_SNAP_DISTANCE;
10357
+ return this.pointToScreenLineDistance(l, r, u) <= St.SLOPE_DIRECTION_SNAP_DISTANCE;
10356
10358
  const p = o.worldToScreenIfVisible(i);
10357
- return p != null && l.distanceTo(p) <= Et.SLOPE_DIRECTION_SNAP_DISTANCE;
10359
+ return p != null && l.distanceTo(p) <= St.SLOPE_DIRECTION_SNAP_DISTANCE;
10358
10360
  }
10359
10361
  getSlopeSnappedPoint(e, t, i) {
10360
10362
  const n = t?.point;
@@ -10419,7 +10421,7 @@ class Et {
10419
10421
  }
10420
10422
  }
10421
10423
  }
10422
- class fc {
10424
+ class yc {
10423
10425
  engine;
10424
10426
  isActive = !1;
10425
10427
  points = [];
@@ -10500,7 +10502,7 @@ class fc {
10500
10502
  };
10501
10503
  }
10502
10504
  }
10503
- class yc {
10505
+ class vc {
10504
10506
  isActive = !1;
10505
10507
  engine;
10506
10508
  clearHeightMeasure;
@@ -10526,7 +10528,7 @@ class yc {
10526
10528
  volumeAnnotation: []
10527
10529
  };
10528
10530
  constructor(e) {
10529
- this.engine = e, this.clearHeightMeasure = new cc(e), this.distanceMeasure = new hc(e), this.clearDistanceMeasure = new dc(e), this.elevationMeasure = new uc(e), this.pointMeasure = new pc(e), this.angleMeasure = new gc(e), this.areaMeasure = new mc(e), this.slopeMeasure = new Et(e), this.faceDistanceMeasure = new fc(e), this.tools = new We(e), this.annotationContainer = document.createElement("div"), this.annotationContainer.className = "annotation-container", e.container.appendChild(this.annotationContainer);
10531
+ this.engine = e, this.clearHeightMeasure = new hc(e), this.distanceMeasure = new dc(e), this.clearDistanceMeasure = new uc(e), this.elevationMeasure = new pc(e), this.pointMeasure = new gc(e), this.angleMeasure = new mc(e), this.areaMeasure = new fc(e), this.slopeMeasure = new St(e), this.faceDistanceMeasure = new yc(e), this.tools = new We(e), this.annotationContainer = document.createElement("div"), this.annotationContainer.className = "annotation-container", e.container.appendChild(this.annotationContainer);
10530
10532
  }
10531
10533
  setContextMenuDisabled(e) {
10532
10534
  this.engine?.engineStatus != null && (this.engine.engineStatus.isDisableContextMenu = e);
@@ -10585,7 +10587,7 @@ function qs(a) {
10585
10587
  });
10586
10588
  });
10587
10589
  }
10588
- class vc {
10590
+ class Mc {
10589
10591
  planes;
10590
10592
  mode = "";
10591
10593
  fillCutFace = !0;
@@ -10610,7 +10612,7 @@ class vc {
10610
10612
  return this.mode === "box" || this.mode === "viewRange" ? this.planes.slice(0, 6) : this.mode === "x" || this.mode === "y" || this.mode === "z" || this.mode === "face" ? [this.planes[6]] : [];
10611
10613
  }
10612
10614
  }
10613
- class Mc extends gr {
10615
+ class bc extends gr {
10614
10616
  webgpuState;
10615
10617
  interactionScene;
10616
10618
  constructor(e, t) {
@@ -10634,7 +10636,7 @@ class Mc extends gr {
10634
10636
  }), s.forEach((o) => o.removeFromParent()), this.webgpuState.apply();
10635
10637
  }
10636
10638
  }
10637
- class bc extends mr {
10639
+ class xc extends mr {
10638
10640
  webgpuState;
10639
10641
  interactionScene;
10640
10642
  constructor(e, t) {
@@ -10656,15 +10658,15 @@ class bc extends mr {
10656
10658
  }), t.forEach((i) => i.removeFromParent()), this.webgpuState.apply();
10657
10659
  }
10658
10660
  }
10659
- class xc extends fr {
10661
+ class wc extends fr {
10660
10662
  }
10661
- function wc() {
10663
+ function Cc() {
10662
10664
  return { clear() {
10663
10665
  }, updataFace() {
10664
10666
  }, updataFaces() {
10665
10667
  } };
10666
10668
  }
10667
- class Cc {
10669
+ class Ec {
10668
10670
  engine;
10669
10671
  state;
10670
10672
  viewRangePlanes = null;
@@ -10687,7 +10689,7 @@ class Cc {
10687
10689
  new ve(new d(0, 0, 1), 1e5)
10688
10690
  ], this.sectionPlane.forEach((t, i) => {
10689
10691
  t.name = ["前", "左", "后", "右", "顶", "底", "face"][i];
10690
- }), this.engine.sectionPlane = this.sectionPlane, this.state = new vc(e, this.sectionPlane), this.engine.__getActiveWebGPUClippingPlanes = () => this.state.getActivePlanes(), this.sectionBox = new Mc(e, this.state), this.sectionFace = new bc(e, this.state), this.sectionCatchFace = new xc(e), this.clippingCSGSimple = wc();
10692
+ }), this.engine.sectionPlane = this.sectionPlane, this.state = new Mc(e, this.sectionPlane), this.engine.__getActiveWebGPUClippingPlanes = () => this.state.getActivePlanes(), this.sectionBox = new bc(e, this.state), this.sectionFace = new xc(e, this.state), this.sectionCatchFace = new wc(e), this.clippingCSGSimple = Cc();
10691
10693
  }
10692
10694
  init() {
10693
10695
  this.state.apply();
@@ -10719,12 +10721,12 @@ class Cc {
10719
10721
  updateClippingValue(e) {
10720
10722
  const t = this.sectionBox.maxBox;
10721
10723
  !t || !e || this.sectionBox.setboxXyz({
10722
- minX: O.lerp(t.min.x, t.max.x, e.x.min * 0.01),
10723
- minY: O.lerp(t.min.y, t.max.y, e.y.min * 0.01),
10724
- minZ: O.lerp(t.min.z, t.max.z, e.z.min * 0.01),
10725
- maxX: O.lerp(t.min.x, t.max.x, e.x.max * 0.01),
10726
- maxY: O.lerp(t.min.y, t.max.y, e.y.max * 0.01),
10727
- maxZ: O.lerp(t.min.z, t.max.z, e.z.max * 0.01)
10724
+ minX: B.lerp(t.min.x, t.max.x, e.x.min * 0.01),
10725
+ minY: B.lerp(t.min.y, t.max.y, e.y.min * 0.01),
10726
+ minZ: B.lerp(t.min.z, t.max.z, e.z.min * 0.01),
10727
+ maxX: B.lerp(t.min.x, t.max.x, e.x.max * 0.01),
10728
+ maxY: B.lerp(t.min.y, t.max.y, e.y.max * 0.01),
10729
+ maxZ: B.lerp(t.min.z, t.max.z, e.z.max * 0.01)
10728
10730
  });
10729
10731
  }
10730
10732
  active(e) {
@@ -10826,7 +10828,7 @@ class Cc {
10826
10828
  return Math.abs(s) < 1e-8 ? null : new d().crossVectors(t.normal, i.normal).multiplyScalar(-e.constant).add(new d().crossVectors(i.normal, e.normal).multiplyScalar(-t.constant)).add(n.multiplyScalar(-i.constant)).divideScalar(s);
10827
10829
  }
10828
10830
  }
10829
- class Ec {
10831
+ class Sc {
10830
10832
  engine;
10831
10833
  constructor(e) {
10832
10834
  this.engine = e;
@@ -10865,7 +10867,7 @@ class Ec {
10865
10867
  }), e;
10866
10868
  }
10867
10869
  }
10868
- class Sc {
10870
+ class Ac {
10869
10871
  engine;
10870
10872
  constructor(e) {
10871
10873
  this.engine = e;
@@ -10903,8 +10905,8 @@ class Sc {
10903
10905
  });
10904
10906
  }
10905
10907
  }
10906
- const Ac = '<svg width="18" height="18" viewBox="0 0 24 24" fill="none" aria-hidden="true"><circle cx="10.8" cy="10.8" r="6.5" stroke="currentColor" stroke-width="2"/><path d="m16 16 4.3 4.3" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>';
10907
- class Pc {
10908
+ const Pc = '<svg width="18" height="18" viewBox="0 0 24 24" fill="none" aria-hidden="true"><circle cx="10.8" cy="10.8" r="6.5" stroke="currentColor" stroke-width="2"/><path d="m16 16 4.3 4.3" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>';
10909
+ class Tc {
10908
10910
  manager;
10909
10911
  wrapper;
10910
10912
  input;
@@ -10920,7 +10922,7 @@ class Pc {
10920
10922
  this.manager = t, this.wrapper = document.createElement("div"), this.wrapper.className = "engine-3d-search", this.wrapper.innerHTML = `
10921
10923
  <section class="engine-3d-search__box" role="dialog" aria-label="模型检索">
10922
10924
  <div class="engine-3d-search__input-row">
10923
- <span class="engine-3d-search__icon">${Ac}</span>
10925
+ <span class="engine-3d-search__icon">${Pc}</span>
10924
10926
  <input class="engine-3d-search__input" type="search" placeholder="检索模型名称、构件 ID、房间" autocomplete="off" spellcheck="false" />
10925
10927
  <button class="engine-3d-search__clear" type="button" aria-label="关闭检索框">×</button>
10926
10928
  </div>
@@ -11023,13 +11025,13 @@ class Pc {
11023
11025
  this.input.removeEventListener("input", this.onInput), this.input.removeEventListener("keydown", this.onKeyDown), this.wrapper.querySelector(".engine-3d-search__clear")?.removeEventListener("click", this.onCloseClick), this.pagination.removeEventListener("click", this.onPageClick), document.removeEventListener("mousedown", this.onDocumentMouseDown), document.removeEventListener("keydown", this.onDocumentKeyDown), this.debounceTimer !== null && clearTimeout(this.debounceTimer), this.wrapper.remove();
11024
11026
  }
11025
11027
  }
11026
- class Tc {
11028
+ class Ic {
11027
11029
  engine;
11028
11030
  searchUI = null;
11029
11031
  constructor(e) {
11030
11032
  this.engine = e;
11031
11033
  const t = e?.container;
11032
- t && (this.searchUI = new Pc(t, this), this.setTheme(e?.options?.searchTheme === "light" ? "light" : "dark"));
11034
+ t && (this.searchUI = new Tc(t, this), this.setTheme(e?.options?.searchTheme === "light" ? "light" : "dark"));
11033
11035
  }
11034
11036
  /** 按名称、ID、房间名称/编号检索已加载模型。 */
11035
11037
  search(e, t = {}) {
@@ -11167,7 +11169,7 @@ class Tc {
11167
11169
  return s < 0 ? null : (s === 0 ? 1e3 : 500) - s - Math.max(0, n.length - t.length) * 0.01;
11168
11170
  }
11169
11171
  }
11170
- class Ic {
11172
+ class Dc {
11171
11173
  engine;
11172
11174
  constructor(e) {
11173
11175
  this.engine = e;
@@ -11260,8 +11262,8 @@ class Ic {
11260
11262
  }), t && t(i), i;
11261
11263
  }
11262
11264
  }
11263
- const Kn = !1, Dc = 51283, _c = 2718207;
11264
- class kc {
11265
+ const Kn = !1, _c = 51283, kc = 2718207;
11266
+ class Lc {
11265
11267
  engine;
11266
11268
  rootGroup;
11267
11269
  meshMaterial;
@@ -11275,7 +11277,7 @@ class kc {
11275
11277
  showInstance: !0
11276
11278
  };
11277
11279
  constructor(e) {
11278
- this.engine = e, this.rootGroup = new Pe(), this.rootGroup.name = "nodeBoxGroup", this.rootGroup.visible = Kn, this.engine.scene?.add(this.rootGroup), this.meshMaterial = this.createMaterial(Dc), this.instanceMaterial = this.createMaterial(_c), this.handleLoadingCompleted = () => {
11280
+ this.engine = e, this.rootGroup = new Pe(), this.rootGroup.name = "nodeBoxGroup", this.rootGroup.visible = Kn, this.engine.scene?.add(this.rootGroup), this.meshMaterial = this.createMaterial(_c), this.instanceMaterial = this.createMaterial(kc), this.handleLoadingCompleted = () => {
11279
11281
  this.isVisible && this.rebuild();
11280
11282
  }, this.engine.events?.on?.(se.LoadingCompleted, this.handleLoadingCompleted);
11281
11283
  }
@@ -11339,7 +11341,7 @@ class kc {
11339
11341
  this.engine.events?.off?.(se.LoadingCompleted, this.handleLoadingCompleted), this.clear(), this.rootGroup.parent && this.rootGroup.parent.remove(this.rootGroup), this.meshMaterial.dispose(), this.instanceMaterial.dispose();
11340
11342
  }
11341
11343
  createMaterial(e) {
11342
- const t = new et({
11344
+ const t = new tt({
11343
11345
  color: e,
11344
11346
  transparent: !0,
11345
11347
  opacity: 0.45,
@@ -11406,8 +11408,8 @@ class kc {
11406
11408
  e.matrixAutoUpdate = !1, e.matrix.copy(t), e.matrixWorldNeedsUpdate = !0, e.updateMatrixWorld(!0);
11407
11409
  }
11408
11410
  }
11409
- const Lc = "path-roaming-animation", Rc = 8e3, Bc = 100, Vt = 16;
11410
- class zc {
11411
+ const Rc = "path-roaming-animation", Bc = 8e3, zc = 100, Vt = 16;
11412
+ class Oc {
11411
11413
  engine;
11412
11414
  points = [];
11413
11415
  status = "idle";
@@ -11534,14 +11536,14 @@ class zc {
11534
11536
  seek(e, t = !1) {
11535
11537
  if (this.segments.length === 0 || !Number.isFinite(e)) return !1;
11536
11538
  const i = this.playhead;
11537
- return this.playhead = O.clamp(e, 0, 1) * this.totalTime, t && this.playhead >= i ? this.reportCompletedSegments(i, this.playhead) : this.playhead < i && this.rebuildCompletedSegments(this.playhead), this.applyPlayhead(this.playhead), this.emitUpdate(), !0;
11539
+ return this.playhead = B.clamp(e, 0, 1) * this.totalTime, t && this.playhead >= i ? this.reportCompletedSegments(i, this.playhead) : this.playhead < i && this.rebuildCompletedSegments(this.playhead), this.applyPlayhead(this.playhead), this.emitUpdate(), !0;
11538
11540
  }
11539
11541
  /** 获取当前播放状态快照。 */
11540
11542
  getState() {
11541
11543
  const e = this.findSegment(this.playhead);
11542
11544
  return {
11543
11545
  status: this.status,
11544
- progress: this.totalTime > 0 ? O.clamp(this.playhead / this.totalTime, 0, 1) : 0,
11546
+ progress: this.totalTime > 0 ? B.clamp(this.playhead / this.totalTime, 0, 1) : 0,
11545
11547
  currentTime: this.playhead,
11546
11548
  totalTime: this.totalTime,
11547
11549
  playbackRate: this.options.playbackRate,
@@ -11644,7 +11646,7 @@ class zc {
11644
11646
  applyPlayhead(e) {
11645
11647
  const t = this.findSegment(e);
11646
11648
  if (!t) return;
11647
- const n = e >= t.motionEndTime ? 1 : O.clamp((e - t.startTime) / t.duration, 0, 1), s = this.interpolateSegment(t, n);
11649
+ const n = e >= t.motionEndTime ? 1 : B.clamp((e - t.startTime) / t.duration, 0, 1), s = this.interpolateSegment(t, n);
11648
11650
  this.currentPose = s, this.applyPose(s);
11649
11651
  }
11650
11652
  /** 位置、目标点和方向向量全部按同一个线性进度插值。 */
@@ -11710,7 +11712,7 @@ class zc {
11710
11712
  s.copy(n).cross(c);
11711
11713
  }
11712
11714
  s.normalize();
11713
- const o = s.clone().cross(n).normalize(), r = n.clone().negate(), l = new z().makeBasis(s, o, r);
11715
+ const o = s.clone().cross(n).normalize(), r = n.clone().negate(), l = new O().makeBasis(s, o, r);
11714
11716
  return new Re().setFromRotationMatrix(l).normalize();
11715
11717
  }
11716
11718
  /** 直接更新相机;只有相机类型切换时才调用完整恢复流程。 */
@@ -11729,7 +11731,7 @@ class zc {
11729
11731
  /** 返回给定播放时间所在片段,停留时间属于其前面的运动片段。 */
11730
11732
  findSegment(e) {
11731
11733
  if (this.segments.length === 0) return;
11732
- const t = O.clamp(e, 0, this.totalTime);
11734
+ const t = B.clamp(e, 0, this.totalTime);
11733
11735
  let i = 0, n = this.segments.length - 1;
11734
11736
  for (; i < n; ) {
11735
11737
  const s = Math.floor((i + n) / 2);
@@ -11757,17 +11759,17 @@ class zc {
11757
11759
  const t = e.loopMode ?? (e.loop ? "repeat" : "none");
11758
11760
  return {
11759
11761
  ...e,
11760
- duration: this.toPositiveNumber(e.duration, Rc),
11762
+ duration: this.toPositiveNumber(e.duration, Bc),
11761
11763
  playbackRate: this.toPositiveNumber(e.playbackRate, 1),
11762
11764
  timing: "distance",
11763
11765
  positionInterpolation: "linear",
11764
11766
  rotationInterpolation: "direction",
11765
11767
  easing: "linear",
11766
- smoothTension: O.clamp(this.toFiniteNumber(e.smoothTension, 0.5), 0, 1),
11768
+ smoothTension: B.clamp(this.toFiniteNumber(e.smoothTension, 0.5), 0, 1),
11767
11769
  loopMode: t,
11768
11770
  loopCount: e.loopCount === void 0 ? Number.POSITIVE_INFINITY : Math.max(Math.floor(this.toNonNegativeNumber(e.loopCount, 0)), 0),
11769
11771
  direction: e.direction ?? "forward",
11770
- maxFrameDelta: this.toPositiveNumber(e.maxFrameDelta, Bc)
11772
+ maxFrameDelta: this.toPositiveNumber(e.maxFrameDelta, zc)
11771
11773
  };
11772
11774
  }
11773
11775
  /** 规范化外部关键帧,并以四元数作为旋转的权威数据。 */
@@ -11861,7 +11863,7 @@ class zc {
11861
11863
  }
11862
11864
  /** 播放期间解除引擎空闲限帧。 */
11863
11865
  setFrameRateExempt(e) {
11864
- this.engine.setIdleFrameRateExempt?.(Lc, e);
11866
+ this.engine.setIdleFrameRateExempt?.(Rc, e);
11865
11867
  }
11866
11868
  isValidPointIndex(e) {
11867
11869
  return Number.isInteger(e) && e >= 0 && e < this.points.length;
@@ -11871,7 +11873,7 @@ class zc {
11871
11873
  }
11872
11874
  interpolateOptionalNumber(e, t, i) {
11873
11875
  if (!(e === void 0 && t === void 0))
11874
- return e === void 0 ? t : t === void 0 ? e : O.lerp(e, t, i);
11876
+ return e === void 0 ? t : t === void 0 ? e : B.lerp(e, t, i);
11875
11877
  }
11876
11878
  clonePoint(e) {
11877
11879
  return {
@@ -11922,7 +11924,7 @@ class zc {
11922
11924
  return { x: e.x, y: e.y, z: e.z, w: e.w };
11923
11925
  }
11924
11926
  }
11925
- class Oc {
11927
+ class Nc {
11926
11928
  engine;
11927
11929
  miniMapCamera = null;
11928
11930
  miniMapRenderer = null;
@@ -12383,7 +12385,7 @@ class Oc {
12383
12385
  this.miniMapContainer && (this.miniMapContainer.removeEventListener("wheel", this.onWheel), this.miniMapContainer.removeEventListener("mousedown", this.onMouseDown), this.miniMapContainer.removeEventListener("mousemove", this.onMouseMove), this.miniMapContainer.removeEventListener("mouseup", this.onMouseUp), this.miniMapContainer.removeEventListener("pointerdown", this.onMouseDown), this.miniMapContainer.removeEventListener("pointermove", this.onMouseMove), this.miniMapContainer.removeEventListener("pointerup", this.onMouseUp), this.miniMapContainer.removeEventListener("pointercancel", this.onMouseUp), this.miniMapContainer.removeEventListener("mouseenter", this.onMouseEnter), this.miniMapContainer.removeEventListener("mouseleave", this.onMouseLeave)), window.removeEventListener("mousemove", this.onMouseMove), window.removeEventListener("mouseup", this.onMouseUp), window.removeEventListener("pointermove", this.onMouseMove), window.removeEventListener("pointerup", this.onMouseUp), window.removeEventListener("pointercancel", this.onMouseUp), window.removeEventListener("resize", this.onWindowResize), this.sizeToggleButton?.removeEventListener("click", this.onSizeToggleClick), this.resizeHandle?.removeEventListener("mousedown", this.onResizeHandleMouseDown), this.resizeHandle?.removeEventListener("pointerdown", this.onResizeHandleMouseDown), this.modelSelect?.removeEventListener("change", this.onModelChange), this.levelSelect?.removeEventListener("change", this.onLevelChange), this.engine.events?.off?.(this.loadingCompletedEventName, this.onLoadingCompleted), this.miniMapRenderer && (this.miniMapRenderer.dispose(), this.miniMapRenderer = null), this.miniMapContainer && (this.miniMapContainer.remove(), this.miniMapContainer = null), this.miniMapCamera = null, this.overlayCtx = null, this.overlayCanvas = null, this.levelToolbar = null, this.sizeToggleButton = null, this.resizeHandle = null, this.modelSelect = null, this.levelSelect = null, this.levelModels = [], this.levelDataSignature = "", this.selectedModelUrl = null;
12384
12386
  }
12385
12387
  }
12386
- class Nc {
12388
+ class Fc {
12387
12389
  engine;
12388
12390
  constructor(e) {
12389
12391
  this.engine = e;
@@ -12680,7 +12682,7 @@ class Nc {
12680
12682
  return Math.abs(s.dot(e)) < 0.999 ? s : new d(1, 0, 0);
12681
12683
  }
12682
12684
  }
12683
- class Fc {
12685
+ class Hc {
12684
12686
  engine;
12685
12687
  constructor(e) {
12686
12688
  }
@@ -12688,7 +12690,7 @@ class Fc {
12688
12690
  }
12689
12691
  }
12690
12692
  const jn = "bim-engine:link-element-2d3d-state", Yn = "link-element-2d3d";
12691
- class Hc {
12693
+ class Vc {
12692
12694
  engine;
12693
12695
  constructor(e) {
12694
12696
  this.engine = e, this.active();
@@ -12722,7 +12724,7 @@ class Hc {
12722
12724
  this.engine?.setIdleFrameRateExempt?.(Yn, t);
12723
12725
  };
12724
12726
  }
12725
- class Vc {
12727
+ class Uc {
12726
12728
  engine;
12727
12729
  constructor(e) {
12728
12730
  this.engine = e, this.active();
@@ -12771,12 +12773,12 @@ class Vc {
12771
12773
  i?.target ? (i.target.copy(l), i.update(), i.dispatchEvent?.({ type: "change" })) : t.lookAt(l);
12772
12774
  }
12773
12775
  }
12774
- const lt = {
12776
+ const ct = {
12775
12777
  EncodingStart: "encoding-start",
12776
12778
  EncodingComplete: "encoding-complete",
12777
12779
  EncodingError: "encoding-error"
12778
12780
  };
12779
- class Uc {
12781
+ class qc {
12780
12782
  engine;
12781
12783
  apiKey;
12782
12784
  baseURL = "https://api.deepseek.com";
@@ -12857,14 +12859,14 @@ class Uc {
12857
12859
  // 开始编码
12858
12860
  async start() {
12859
12861
  let e = ["注释", "族名称"], t = ["梁", "墩", "桩", "墙", "面", "台", "石", "支"];
12860
- this.engine.events.trigger(lt.EncodingStart, { message: "编码开始" });
12862
+ this.engine.events.trigger(ct.EncodingStart, { message: "编码开始" });
12861
12863
  let i = [], n = "";
12862
12864
  if (this.engine.models.forEach((c) => {
12863
12865
  n = c.url, c.nodesMap.forEach((h, u) => {
12864
12866
  t.some((p) => h.infos[0].name.includes(p)) && i.push({ id: u, url: c.url });
12865
12867
  });
12866
12868
  }), i.length === 0) {
12867
- this.engine.events.trigger(lt.EncodingComplete, { message: "无匹配构件", results: [] });
12869
+ this.engine.events.trigger(ct.EncodingComplete, { message: "无匹配构件", results: [] });
12868
12870
  return;
12869
12871
  }
12870
12872
  let s = await this.queryProperties(i, e);
@@ -12872,7 +12874,7 @@ class Uc {
12872
12874
  let r = [], l = Math.ceil(s.length / o);
12873
12875
  for (let c = 0; c < s.length; c += o) {
12874
12876
  let h = s.slice(c, c + o), u = Math.floor(c / o) + 1;
12875
- this.engine.events.trigger(lt.EncodingStart, {
12877
+ this.engine.events.trigger(ct.EncodingStart, {
12876
12878
  message: `正在编码第 ${u}/${l} 批`,
12877
12879
  batch: u,
12878
12880
  totalBatches: l
@@ -12881,13 +12883,13 @@ class Uc {
12881
12883
  let p = await this.startChat(n, JSON.stringify(h));
12882
12884
  r = r.concat(p);
12883
12885
  } catch (p) {
12884
- this.engine.events.trigger(lt.EncodingError, {
12886
+ this.engine.events.trigger(ct.EncodingError, {
12885
12887
  message: `第 ${u} 批编码失败`,
12886
12888
  error: p
12887
12889
  });
12888
12890
  }
12889
12891
  }
12890
- this.engine.events.trigger(lt.EncodingComplete, {
12892
+ this.engine.events.trigger(ct.EncodingComplete, {
12891
12893
  message: "编码完成",
12892
12894
  url: n,
12893
12895
  results: r,
@@ -12928,7 +12930,7 @@ class Uc {
12928
12930
  r.set(l.id, c);
12929
12931
  }), this.engine.modelProperties.updateExtended(e, r), this.savaModelCodeToStoge(e), o;
12930
12932
  } catch (i) {
12931
- return console.error("编码失败:", i), this.engine.events.trigger(lt.EncodingError, {
12933
+ return console.error("编码失败:", i), this.engine.events.trigger(ct.EncodingError, {
12932
12934
  message: "编码失败",
12933
12935
  error: i
12934
12936
  }), [];
@@ -12964,12 +12966,12 @@ class Uc {
12964
12966
  }
12965
12967
  }
12966
12968
  }
12967
- const Ci = 1 / 0.3048, qc = 1, Gc = 1.8, Qn = /* @__PURE__ */ new Set([
12969
+ const Ci = 1 / 0.3048, Gc = 1, Wc = 1.8, Qn = /* @__PURE__ */ new Set([
12968
12970
  "dynamic-elevation-bar-area",
12969
12971
  "dynamic-elevation-guest-area",
12970
12972
  "dynamic-elevation-door-head-area"
12971
- ]), Wc = ["台面"], Kc = ["咖啡机"], jc = ["门店编号"], Yc = ["发光logo", "发光Logo"];
12972
- class Qc {
12973
+ ]), Kc = ["台面"], jc = ["咖啡机"], Yc = ["门店编号"], Qc = ["发光logo", "发光Logo"];
12974
+ class Xc {
12973
12975
  engine;
12974
12976
  constructor(e) {
12975
12977
  this.engine = e;
@@ -13003,7 +13005,7 @@ class Qc {
13003
13005
  generate(e) {
13004
13006
  if (!(e?.nodesMap instanceof Map) || e.nodesMap.size === 0)
13005
13007
  return [];
13006
- const t = this.collectMergedWorldBoxByKeywords(e, Wc), i = this.collectMergedWorldBoxByKeywords(e, Kc), n = this.collectMergedWorldBoxByKeywords(e, jc), s = this.collectWorldBoxesByKeywords(e, Yc), o = [];
13008
+ const t = this.collectMergedWorldBoxByKeywords(e, Kc), i = this.collectMergedWorldBoxByKeywords(e, jc), n = this.collectMergedWorldBoxByKeywords(e, Yc), s = this.collectWorldBoxesByKeywords(e, Qc), o = [];
13007
13009
  if (t && i && n) {
13008
13010
  const r = this.createBarAreaView(t, i, n), l = this.createGuestAreaView(t, i, n);
13009
13011
  r && o.push(r), l && o.push(l);
@@ -13094,8 +13096,8 @@ class Qc {
13094
13096
  * 相机始终在观察面外侧偏移固定距离,且高度统一锁定为 1.8 米。
13095
13097
  */
13096
13098
  createCameraPosition(e, t) {
13097
- const i = e.clone().add(t.clone().multiplyScalar(qc));
13098
- return i.y = Gc, i;
13099
+ const i = e.clone().add(t.clone().multiplyScalar(Gc));
13100
+ return i.y = Wc, i;
13099
13101
  }
13100
13102
  /**
13101
13103
  * 将 three.js 空间中的观察参数转换成运行时立面视图结构。
@@ -13270,7 +13272,7 @@ class Qc {
13270
13272
  };
13271
13273
  }
13272
13274
  }
13273
- const Xn = 16, $n = 0.02, Ei = 1e-6, Xc = 600;
13275
+ const Xn = 16, $n = 0.02, Ei = 1e-6, $c = 600;
13274
13276
  function Gs() {
13275
13277
  return {
13276
13278
  ceilingPlans: [],
@@ -13287,7 +13289,7 @@ function Ws(a, e) {
13287
13289
  url: e
13288
13290
  };
13289
13291
  }
13290
- class $c {
13292
+ class Jc {
13291
13293
  engine;
13292
13294
  resolveViewTree;
13293
13295
  openView;
@@ -13366,7 +13368,7 @@ class $c {
13366
13368
  if (!t?.projectionMatrix || !t.matrixWorldInverse)
13367
13369
  return;
13368
13370
  t.updateProjectionMatrix?.(), t.updateMatrixWorld(!0);
13369
- const i = new z().multiplyMatrices(
13371
+ const i = new O().multiplyMatrices(
13370
13372
  t.projectionMatrix,
13371
13373
  t.matrixWorldInverse
13372
13374
  );
@@ -13377,7 +13379,7 @@ class $c {
13377
13379
  o.call(
13378
13380
  this.engine.cameraModule,
13379
13381
  s,
13380
- Xc,
13382
+ $c,
13381
13383
  () => this.syncControlRotationState()
13382
13384
  );
13383
13385
  return;
@@ -13408,9 +13410,9 @@ class $c {
13408
13410
  return o;
13409
13411
  for (o.push(i.getCenter(new d())); o.length < Xn; )
13410
13412
  o.push(new d(
13411
- O.lerp(i.min.x, i.max.x, n()),
13412
- O.lerp(i.min.y, i.max.y, n()),
13413
- O.lerp(i.min.z, i.max.z, n())
13413
+ B.lerp(i.min.x, i.max.x, n()),
13414
+ B.lerp(i.min.y, i.max.y, n()),
13415
+ B.lerp(i.min.z, i.max.z, n())
13414
13416
  ));
13415
13417
  return o;
13416
13418
  }
@@ -13432,7 +13434,7 @@ class $c {
13432
13434
  if (s.has(l))
13433
13435
  return;
13434
13436
  s.add(l);
13435
- const c = new z();
13437
+ const c = new O();
13436
13438
  r.getMatrixAt(o[1], c), i.push({
13437
13439
  geometry: r.geometry,
13438
13440
  worldMatrix: n.clone().multiply(c)
@@ -13500,12 +13502,12 @@ const Ut = {
13500
13502
  floorPlan: "楼层平面",
13501
13503
  elevation: "立面视图",
13502
13504
  section: "剖面视图"
13503
- }, Jc = {
13505
+ }, Zc = {
13504
13506
  ceilingPlan: [Ut.ceilingPlan, "天花"],
13505
13507
  floorPlan: [Ut.floorPlan, "楼层"],
13506
13508
  elevation: [Ut.elevation, "立面"],
13507
13509
  section: [Ut.section, "剖面"]
13508
- }, Zc = [
13510
+ }, eh = [
13509
13511
  ["CeilingPlans", "ceilingPlans"],
13510
13512
  ["Elevations", "elevations"],
13511
13513
  ["DynamicViews", "dynamicViews"],
@@ -13519,7 +13521,7 @@ class en {
13519
13521
  dynamicViewVisibility;
13520
13522
  /** 管理模型原生视图与运行时动态视图的统一入口。 */
13521
13523
  constructor(e) {
13522
- this.engine = e, this.dynamicElevationViewGenerator = new Qc(e), this.dynamicViewVisibility = new $c(
13524
+ this.engine = e, this.dynamicElevationViewGenerator = new Xc(e), this.dynamicViewVisibility = new Jc(
13523
13525
  e,
13524
13526
  (t) => this.getResolvedViewTree(t),
13525
13527
  (t, i, n) => this.openViewInternal(t, i, n)
@@ -13539,7 +13541,7 @@ class en {
13539
13541
  /** 获取单个模型的视图树数据,并补充运行时生成的动态视图分类。 */
13540
13542
  getViewTreeData(e) {
13541
13543
  const t = this.getResolvedViewTree(e), i = Gs();
13542
- return t && Zc.forEach(([n, s]) => {
13544
+ return t && eh.forEach(([n, s]) => {
13543
13545
  (t[n] ?? []).forEach((o) => {
13544
13546
  i[s].push(Ws(o, e));
13545
13547
  });
@@ -13654,7 +13656,7 @@ class en {
13654
13656
  const t = String(e ?? "").replace(/\s+/g, "");
13655
13657
  if (!t)
13656
13658
  return "unknown";
13657
- const i = Object.entries(Jc);
13659
+ const i = Object.entries(Zc);
13658
13660
  for (const [n, s] of i)
13659
13661
  if (s.some((o) => t.includes(o)))
13660
13662
  return n;
@@ -13691,7 +13693,7 @@ class en {
13691
13693
  !t || t.isEmpty?.() || this.engine.viewCube?.zoomToModel?.(t, e);
13692
13694
  }
13693
13695
  }
13694
- class eh {
13696
+ class th {
13695
13697
  engine;
13696
13698
  sectionPlaneGroup = null;
13697
13699
  loaderModule2d;
@@ -13725,12 +13727,12 @@ class eh {
13725
13727
  getMatrix(e, t) {
13726
13728
  const i = new d(e.x, e.y, e.z), n = new Xe(t.x, t.y, t.z), s = new d(1, 1, 1), o = new Re();
13727
13729
  o.setFromEuler(n);
13728
- const r = new z();
13730
+ const r = new O();
13729
13731
  return r.compose(i, o, s), r;
13730
13732
  }
13731
13733
  // 计算Matrix
13732
13734
  computeMatrixFromOriginAndDirection(e, t) {
13733
- const i = new z(), n = t.clone().normalize();
13735
+ const i = new O(), n = t.clone().normalize();
13734
13736
  if (n.length() === 0)
13735
13737
  return console.warn("方向向量长度为零,返回单位矩阵"), i.identity();
13736
13738
  const s = new d(0, 1, 0);
@@ -13740,7 +13742,7 @@ class eh {
13740
13742
  o = new d().crossVectors(c, n).normalize();
13741
13743
  } else
13742
13744
  o.normalize();
13743
- const r = new d().crossVectors(o, n).normalize(), l = new z();
13745
+ const r = new d().crossVectors(o, n).normalize(), l = new O();
13744
13746
  return l.set(
13745
13747
  o.x,
13746
13748
  n.x,
@@ -13761,16 +13763,16 @@ class eh {
13761
13763
  ), l.setPosition(e), l;
13762
13764
  }
13763
13765
  }
13764
- function th(a, e, t = "bim-snapshot.png") {
13766
+ function ih(a, e, t = "bim-snapshot.png") {
13765
13767
  const i = a?.renderer, n = i?.domElement;
13766
13768
  if (!i || !n || !e)
13767
13769
  return null;
13768
13770
  const s = n.width || n.clientWidth, o = n.height || n.clientHeight;
13769
13771
  if (s <= 0 || o <= 0)
13770
13772
  return null;
13771
- let r = ih(n, s, o);
13772
- if (!nh(r)) {
13773
- const p = sh(a, s, o);
13773
+ let r = nh(n, s, o);
13774
+ if (!sh(r)) {
13775
+ const p = oh(a, s, o);
13774
13776
  p && (r = p);
13775
13777
  }
13776
13778
  const l = document.createElement("canvas");
@@ -13782,13 +13784,13 @@ function th(a, e, t = "bim-snapshot.png") {
13782
13784
  const h = l.toDataURL("image/png"), u = document.createElement("a");
13783
13785
  return u.href = h, u.download = t.toLowerCase().endsWith(".png") ? t : `${t}.png`, u.click(), h;
13784
13786
  }
13785
- function ih(a, e, t) {
13787
+ function nh(a, e, t) {
13786
13788
  const i = document.createElement("canvas");
13787
13789
  i.width = e, i.height = t;
13788
13790
  const n = i.getContext("2d");
13789
13791
  return n && n.drawImage(a, 0, 0, e, t), i;
13790
13792
  }
13791
- function nh(a) {
13793
+ function sh(a) {
13792
13794
  const e = a.getContext("2d");
13793
13795
  if (!e || a.width <= 0 || a.height <= 0)
13794
13796
  return !1;
@@ -13801,7 +13803,7 @@ function nh(a) {
13801
13803
  }
13802
13804
  return !1;
13803
13805
  }
13804
- function sh(a, e, t) {
13806
+ function oh(a, e, t) {
13805
13807
  const i = a?.renderer, n = a?.scene, s = a?.camera;
13806
13808
  if (!i || !n || !s)
13807
13809
  return null;
@@ -13815,14 +13817,14 @@ function sh(a, e, t) {
13815
13817
  try {
13816
13818
  i.xr && (i.xr.enabled = !1), i.autoClear = !0, i.setRenderTarget(o), i.clear(!0, !0, !0), i.render(n, s);
13817
13819
  const h = new Uint8Array(e * t * 4);
13818
- return i.readRenderTargetPixels(o, 0, 0, e, t, h), oh(h, e, t);
13820
+ return i.readRenderTargetPixels(o, 0, 0, e, t, h), rh(h, e, t);
13819
13821
  } catch {
13820
13822
  return null;
13821
13823
  } finally {
13822
13824
  i.setRenderTarget(r), i.autoClear = l, i.xr && (i.xr.enabled = c), o.dispose();
13823
13825
  }
13824
13826
  }
13825
- function oh(a, e, t) {
13827
+ function rh(a, e, t) {
13826
13828
  const i = document.createElement("canvas");
13827
13829
  i.width = e, i.height = t;
13828
13830
  const n = i.getContext("2d");
@@ -13836,7 +13838,7 @@ function oh(a, e, t) {
13836
13838
  }
13837
13839
  return n.putImageData(s, 0, 0), i;
13838
13840
  }
13839
- const rh = [
13841
+ const ah = [
13840
13842
  "#ffffff",
13841
13843
  "#000000",
13842
13844
  "#ff4d4f",
@@ -13847,7 +13849,7 @@ const rh = [
13847
13849
  "#1677ff",
13848
13850
  "#722ed1",
13849
13851
  "#eb2f96"
13850
- ], ah = {
13852
+ ], lh = {
13851
13853
  none: Z("/assets/icon/选择.svg", import.meta.url),
13852
13854
  line: Z("/assets/icon/线.svg", import.meta.url),
13853
13855
  arrow: Z("/assets/icon/箭头.svg", import.meta.url),
@@ -13855,7 +13857,7 @@ const rh = [
13855
13857
  circle: Z("/assets/icon/圆形.svg", import.meta.url),
13856
13858
  text: Z("/assets/icon/文字.svg", import.meta.url),
13857
13859
  cloudline: Z("/assets/icon/云线.svg", import.meta.url)
13858
- }, lh = Z("/assets/icon/测距.svg", import.meta.url), ch = Z("/assets/icon/截图.svg", import.meta.url), hh = Z("/assets/icon/线宽.svg", import.meta.url), dh = Z("/assets/icon/字号.svg", import.meta.url), uh = `data:image/svg+xml;utf8,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2l4 8-4 12-4-12 4-8z" fill="#1677ff"/><circle cx="12" cy="10" r="2.5" fill="#fff"/></svg>')}`, ph = [
13860
+ }, ch = Z("/assets/icon/测距.svg", import.meta.url), hh = Z("/assets/icon/截图.svg", import.meta.url), dh = Z("/assets/icon/线宽.svg", import.meta.url), uh = Z("/assets/icon/字号.svg", import.meta.url), ph = `data:image/svg+xml;utf8,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2l4 8-4 12-4-12 4-8z" fill="#1677ff"/><circle cx="12" cy="10" r="2.5" fill="#fff"/></svg>')}`, gh = [
13859
13861
  { type: "distance", label: "距离" },
13860
13862
  { type: "clearDistance", label: "净距" },
13861
13863
  { type: "clearHeight", label: "净高" },
@@ -13864,7 +13866,7 @@ const rh = [
13864
13866
  { type: "angle", label: "角度" },
13865
13867
  { type: "area", label: "面积" },
13866
13868
  { type: "slope", label: "坡度" }
13867
- ], gh = {
13869
+ ], mh = {
13868
13870
  distance: Z("/assets/icon/距离.svg", import.meta.url),
13869
13871
  clearDistance: Z("/assets/icon/净距.svg", import.meta.url),
13870
13872
  clearHeight: Z("/assets/icon/净高.svg", import.meta.url),
@@ -13874,7 +13876,7 @@ const rh = [
13874
13876
  area: Z("/assets/icon/面积.svg", import.meta.url),
13875
13877
  slope: Z("/assets/icon/坡度.svg", import.meta.url)
13876
13878
  };
13877
- class mh {
13879
+ class fh {
13878
13880
  constructor(e, t) {
13879
13881
  this.handlers = e, this.root = document.createElement("div"), this.root.style.position = "absolute", this.root.style.top = "8px", this.root.style.left = "50%", this.root.style.transform = "translateX(-50%)", this.root.style.display = "none", this.root.style.padding = "6px", this.root.style.background = "#ffffff", this.root.style.border = "1px solid #d9d9d9", this.root.style.borderRadius = "8px", this.root.style.pointerEvents = "auto", this.root.style.userSelect = "none", this.root.style.boxShadow = "0 4px 14px rgba(0, 0, 0, 0.12)", this.root.style.zIndex = "1300", this.root.style.overflow = "visible", this.editPanel = document.createElement("div"), this.editPanel.style.display = "flex", this.editPanel.style.flexDirection = "column", this.editPanel.style.gap = "6px", this.viewPanel = document.createElement("div"), this.viewPanel.style.display = "none", this.viewPanel.style.alignItems = "center", this.viewPanel.style.gap = "6px";
13880
13882
  const i = document.createElement("div");
@@ -13887,7 +13889,7 @@ class mh {
13887
13889
  { type: "text", label: "文字" },
13888
13890
  { type: "cloudline", label: "云线" }
13889
13891
  ].forEach((y) => {
13890
- const M = this.createIconButton(y.label, ah[y.type]);
13892
+ const M = this.createIconButton(y.label, lh[y.type]);
13891
13893
  M.onclick = () => this.handlers.onDrawTypeChange(y.type), this.drawButtons[y.type] = M, i.appendChild(M);
13892
13894
  });
13893
13895
  const s = document.createElement("div");
@@ -13897,23 +13899,23 @@ class mh {
13897
13899
  this.updateColorControl(this.colorInput.value), this.handlers.onColorChange(this.colorInput.value), this.setColorPresetVisible(!1);
13898
13900
  }, s.appendChild(this.colorInput), this.colorPresetPanel = document.createElement("div"), this.colorPresetPanel.style.position = "absolute", this.colorPresetPanel.style.top = "30px", this.colorPresetPanel.style.left = "0", this.colorPresetPanel.style.display = "none", this.colorPresetPanel.style.padding = "8px", this.colorPresetPanel.style.background = "#ffffff", this.colorPresetPanel.style.border = "1px solid #d9d9d9", this.colorPresetPanel.style.borderRadius = "6px", this.colorPresetPanel.style.boxShadow = "0 6px 18px rgba(0, 0, 0, 0.14)", this.colorPresetPanel.style.zIndex = "20", this.colorPresetPanel.style.width = "152px";
13899
13901
  const r = document.createElement("div");
13900
- r.style.display = "grid", r.style.gridTemplateColumns = "repeat(5, 1fr)", r.style.gap = "6px", rh.forEach((y) => {
13902
+ r.style.display = "grid", r.style.gridTemplateColumns = "repeat(5, 1fr)", r.style.gap = "6px", ah.forEach((y) => {
13901
13903
  const M = document.createElement("button");
13902
13904
  M.type = "button", M.title = y, M.style.width = "22px", M.style.height = "22px", M.style.padding = "0", M.style.border = "1px solid #d9d9d9", M.style.borderRadius = "4px", M.style.background = y, M.style.cursor = "pointer", M.onclick = () => {
13903
13905
  this.updateColorControl(y), this.handlers.onColorChange(y), this.setColorPresetVisible(!1);
13904
13906
  }, r.appendChild(M);
13905
13907
  }), this.colorPresetPanel.appendChild(r);
13906
13908
  const l = document.createElement("button");
13907
- l.type = "button", l.textContent = "自定义", l.style.marginTop = "8px", l.style.width = "100%", l.style.height = "26px", l.style.border = "1px solid #d9d9d9", l.style.borderRadius = "4px", l.style.background = "#ffffff", l.style.color = "#333333", l.style.cursor = "pointer", l.onclick = () => this.openNativeColorPicker(), this.colorPresetPanel.appendChild(l), s.appendChild(this.colorPresetPanel), this.updateColorControl(t.stroke), i.appendChild(this.createField("", s)), this.strokeWidthInput = document.createElement("input"), this.strokeWidthInput.type = "number", this.strokeWidthInput.min = "1", this.strokeWidthInput.max = "20", this.strokeWidthInput.step = "1", this.strokeWidthInput.value = String(t.strokeWidth), this.strokeWidthInput.style.width = "46px", this.strokeWidthInput.oninput = () => this.handlers.onStrokeWidthChange(this.strokeWidthInput.value), i.appendChild(this.createField("", this.strokeWidthInput, hh, "线宽")), this.fontSizeInput = document.createElement("input"), this.fontSizeInput.type = "number", this.fontSizeInput.min = "10", this.fontSizeInput.max = "96", this.fontSizeInput.step = "1", this.fontSizeInput.value = String(t.fontSize), this.fontSizeInput.style.width = "46px", this.fontSizeInput.oninput = () => this.handlers.onFontSizeChange(this.fontSizeInput.value), i.appendChild(this.createField("", this.fontSizeInput, dh, "字号")), this.distanceButton = this.createIconButton("测量", lh), this.distanceButton.onclick = () => this.handlers.onMeasureToggle(), i.appendChild(this.distanceButton);
13908
- const c = this.createIconButton("截图", ch);
13909
+ l.type = "button", l.textContent = "自定义", l.style.marginTop = "8px", l.style.width = "100%", l.style.height = "26px", l.style.border = "1px solid #d9d9d9", l.style.borderRadius = "4px", l.style.background = "#ffffff", l.style.color = "#333333", l.style.cursor = "pointer", l.onclick = () => this.openNativeColorPicker(), this.colorPresetPanel.appendChild(l), s.appendChild(this.colorPresetPanel), this.updateColorControl(t.stroke), i.appendChild(this.createField("", s)), this.strokeWidthInput = document.createElement("input"), this.strokeWidthInput.type = "number", this.strokeWidthInput.min = "1", this.strokeWidthInput.max = "20", this.strokeWidthInput.step = "1", this.strokeWidthInput.value = String(t.strokeWidth), this.strokeWidthInput.style.width = "46px", this.strokeWidthInput.oninput = () => this.handlers.onStrokeWidthChange(this.strokeWidthInput.value), i.appendChild(this.createField("", this.strokeWidthInput, dh, "线宽")), this.fontSizeInput = document.createElement("input"), this.fontSizeInput.type = "number", this.fontSizeInput.min = "10", this.fontSizeInput.max = "96", this.fontSizeInput.step = "1", this.fontSizeInput.value = String(t.fontSize), this.fontSizeInput.style.width = "46px", this.fontSizeInput.oninput = () => this.handlers.onFontSizeChange(this.fontSizeInput.value), i.appendChild(this.createField("", this.fontSizeInput, uh, "字号")), this.distanceButton = this.createIconButton("测量", ch), this.distanceButton.onclick = () => this.handlers.onMeasureToggle(), i.appendChild(this.distanceButton);
13910
+ const c = this.createIconButton("截图", hh);
13909
13911
  c.onclick = () => this.handlers.onScreenshot(), i.appendChild(c);
13910
- const h = this.createIconButton("捕捉点", uh);
13912
+ const h = this.createIconButton("捕捉点", ph);
13911
13913
  h.onclick = () => this.handlers.onPickPoint(), i.appendChild(h);
13912
13914
  const u = this.createTextButton("×", "取消");
13913
13915
  u.onclick = () => this.handlers.onCancel(), u.style.background = "#ff4d4f", u.style.borderColor = "#ff4d4f", u.style.color = "#ffffff", i.appendChild(u);
13914
13916
  const p = this.createTextButton("✔", "确定");
13915
- p.onclick = () => this.handlers.onConfirm(), p.style.background = "#52c41a", p.style.borderColor = "#52c41a", p.style.color = "#ffffff", i.appendChild(p), this.measureSubPanel = document.createElement("div"), this.measureSubPanel.style.display = "none", this.measureSubPanel.style.alignItems = "center", this.measureSubPanel.style.gap = "6px", this.measureSubPanel.style.flexWrap = "wrap", this.measureSubPanel.style.paddingTop = "2px", ph.forEach((y) => {
13916
- const M = this.createSmallIconButton(y.label, gh[y.type]);
13917
+ p.onclick = () => this.handlers.onConfirm(), p.style.background = "#52c41a", p.style.borderColor = "#52c41a", p.style.color = "#ffffff", i.appendChild(p), this.measureSubPanel = document.createElement("div"), this.measureSubPanel.style.display = "none", this.measureSubPanel.style.alignItems = "center", this.measureSubPanel.style.gap = "6px", this.measureSubPanel.style.flexWrap = "wrap", this.measureSubPanel.style.paddingTop = "2px", gh.forEach((y) => {
13918
+ const M = this.createSmallIconButton(y.label, mh[y.type]);
13917
13919
  M.onclick = () => this.handlers.onMeasureTypeChange(y.type), this.measureTypeButtons[y.type] = M, this.measureSubPanel.appendChild(M);
13918
13920
  }), this.editPanel.appendChild(i), this.editPanel.appendChild(this.measureSubPanel);
13919
13921
  const g = this.createTextButton("关闭", "关闭");
@@ -14038,7 +14040,7 @@ class mh {
14038
14040
  return i.type = "button", i.title = t, i.textContent = e, i.style.width = "28px", i.style.height = "28px", i.style.padding = "0 10px", i.style.border = "1px solid #d9d9d9", i.style.borderRadius = "4px", i.style.background = "#ffffff", i.style.color = "#333333", i.style.fontSize = "13px", i.style.lineHeight = "1", i.style.cursor = "pointer", i;
14039
14041
  }
14040
14042
  }
14041
- class fh {
14043
+ class yh {
14042
14044
  engine;
14043
14045
  wrapper;
14044
14046
  canvasEl;
@@ -14077,7 +14079,7 @@ class fh {
14077
14079
  const t = this.engine.container;
14078
14080
  if (!t)
14079
14081
  throw new Error("FabricDraw: engine container not found.");
14080
- this.wrapper = document.createElement("div"), this.wrapper.className = "fabric-draw-layer", this.wrapper.style.position = "absolute", this.wrapper.style.left = "0", this.wrapper.style.top = "0", this.wrapper.style.right = "0", this.wrapper.style.bottom = "0", this.wrapper.style.pointerEvents = "none", this.canvasEl = document.createElement("canvas"), this.canvasEl.style.width = "100%", this.canvasEl.style.height = "100%", this.wrapper.appendChild(this.canvasEl), this.toolbar = new mh({
14082
+ this.wrapper = document.createElement("div"), this.wrapper.className = "fabric-draw-layer", this.wrapper.style.position = "absolute", this.wrapper.style.left = "0", this.wrapper.style.top = "0", this.wrapper.style.right = "0", this.wrapper.style.bottom = "0", this.wrapper.style.pointerEvents = "none", this.canvasEl = document.createElement("canvas"), this.canvasEl.style.width = "100%", this.canvasEl.style.height = "100%", this.wrapper.appendChild(this.canvasEl), this.toolbar = new fh({
14081
14083
  onDrawTypeChange: (n) => this.setDrawType(n),
14082
14084
  onMeasureToggle: () => this.toggleMeasurePanel(),
14083
14085
  onMeasureTypeChange: (n) => this.activateDistanceMeasure(n),
@@ -14226,7 +14228,7 @@ class fh {
14226
14228
  * 鎴浘淇濆瓨锛堟ā鍨?Fabric鎵规敞鍚堟垚锛夈€? */
14227
14229
  saveScreenshot(e = "bim-snapshot.png") {
14228
14230
  const t = this.canvas.lowerCanvasEl;
14229
- return t ? th(this.engine, t, e) : null;
14231
+ return t ? ih(this.engine, t, e) : null;
14230
14232
  }
14231
14233
  /**
14232
14234
  * 鍚屾鐢诲竷灏哄銆? */
@@ -14710,7 +14712,7 @@ class fh {
14710
14712
  return JSON.parse(JSON.stringify(e));
14711
14713
  }
14712
14714
  }
14713
- class yh {
14715
+ class vh {
14714
14716
  engine;
14715
14717
  capturePoint = null;
14716
14718
  labelPrefix = "drawing-pin-label-";
@@ -15160,7 +15162,7 @@ class yh {
15160
15162
  return e;
15161
15163
  }
15162
15164
  }
15163
- const Si = "bim-engine:model-link-3d", vh = "default-model-link-3d-group", Jn = "model-link-3d", Zn = {
15165
+ const Si = "bim-engine:model-link-3d", Mh = "default-model-link-3d-group", Jn = "model-link-3d", Zn = {
15164
15166
  enabled: !1,
15165
15167
  highlight: !0,
15166
15168
  visibility: !0,
@@ -15169,7 +15171,7 @@ const Si = "bim-engine:model-link-3d", vh = "default-model-link-3d-group", Jn =
15169
15171
  cameraMode: "onStop",
15170
15172
  cameraThrottleMs: 50
15171
15173
  };
15172
- class Mh {
15174
+ class bh {
15173
15175
  viewerGuid;
15174
15176
  engine;
15175
15177
  options;
@@ -15233,7 +15235,7 @@ class Mh {
15233
15235
  return {
15234
15236
  ...Zn,
15235
15237
  ...e,
15236
- groupId: e.groupId ?? this.engine?.options?.linkGroupId ?? vh,
15238
+ groupId: e.groupId ?? this.engine?.options?.linkGroupId ?? Mh,
15237
15239
  modelId: e.modelId ?? this.engine?.options?.modelLinkId
15238
15240
  };
15239
15241
  }
@@ -15473,7 +15475,7 @@ class Mh {
15473
15475
  }).filter((n) => n.ids.length > 0);
15474
15476
  }
15475
15477
  }
15476
- class bh {
15478
+ class xh {
15477
15479
  engine;
15478
15480
  manager;
15479
15481
  worldToScreen;
@@ -15541,7 +15543,7 @@ class bh {
15541
15543
  return e = this.engine.clipping?.filterIntersectionsByClipping?.(e) ?? e, e.filter((i) => i?.point instanceof d).sort((i, n) => i.distance - n.distance)[0] ?? null;
15542
15544
  }
15543
15545
  }
15544
- class xh {
15546
+ class wh {
15545
15547
  /** 推进当前标记注册的材质与独立点动画。 */
15546
15548
  updateRecord(e, t) {
15547
15549
  const i = t + e.timeSeed;
@@ -15552,7 +15554,7 @@ class xh {
15552
15554
  const s = n.userData.annotationTimeUniform;
15553
15555
  s && (s.value = i);
15554
15556
  }), e.rippleMeshes.forEach((n, s) => {
15555
- const o = n.userData.rippleSpeed ?? 0.9, r = n.userData.rippleStartRadius ?? 0.2, l = Math.max(n.userData.rippleMaxRadius ?? 8, 1e-3), c = n.userData.ripplePhase ?? s / Math.max(e.rippleMeshes.length, 1), h = (i * o + c) % 1, u = O.lerp(r, l, h);
15557
+ const o = n.userData.rippleSpeed ?? 0.9, r = n.userData.rippleStartRadius ?? 0.2, l = Math.max(n.userData.rippleMaxRadius ?? 8, 1e-3), c = n.userData.ripplePhase ?? s / Math.max(e.rippleMeshes.length, 1), h = (i * o + c) % 1, u = B.lerp(r, l, h);
15556
15558
  n.scale.setScalar(u / l);
15557
15559
  const p = n.material;
15558
15560
  p.opacity = (1 - h) * (n.userData.rippleBaseOpacity ?? 0.55);
@@ -15566,7 +15568,7 @@ class xh {
15566
15568
  });
15567
15569
  }
15568
15570
  }
15569
- class wh {
15571
+ class Ch {
15570
15572
  engine;
15571
15573
  rootGroup;
15572
15574
  records;
@@ -15873,7 +15875,7 @@ const Ae = {
15873
15875
  showBottom: !1,
15874
15876
  edgeColor: "#d9ffff"
15875
15877
  }
15876
- }, Ch = {
15878
+ }, Eh = {
15877
15879
  background: "rgba(10, 18, 28, 0.92)",
15878
15880
  color: "#ffffff",
15879
15881
  border: "1px solid rgba(127, 252, 255, 0.72)",
@@ -15882,7 +15884,7 @@ const Ae = {
15882
15884
  boxShadow: "0 10px 30px rgba(0, 0, 0, 0.32)",
15883
15885
  minWidth: "120px",
15884
15886
  pointerEvents: "auto"
15885
- }, Eh = "bim-engine-annotation3d-panels";
15887
+ }, Sh = "bim-engine-annotation3d-panels";
15886
15888
  function $t(a) {
15887
15889
  return a.map((e) => ({ x: e.x, y: e.y, z: e.z }));
15888
15890
  }
@@ -15893,7 +15895,7 @@ function qt(a) {
15893
15895
  const e = new d();
15894
15896
  return a.length === 0 ? e : (a.forEach((t) => e.add(J(t))), e.multiplyScalar(1 / a.length));
15895
15897
  }
15896
- function Sh(a) {
15898
+ function Ah(a) {
15897
15899
  const e = new d();
15898
15900
  for (let t = 0; t < a.length; t += 1) {
15899
15901
  const i = a[t], n = a[(t + 1) % a.length];
@@ -15903,12 +15905,12 @@ function Sh(a) {
15903
15905
  }
15904
15906
  function Ks(a) {
15905
15907
  const e = a.map((c) => J(c)), t = e[0].clone(), i = e.length > 1 ? e[1].clone().sub(t).normalize() : new d(1, 0, 0);
15906
- let n = Sh(e);
15908
+ let n = Ah(e);
15907
15909
  n.lengthSq() < 1e-8 && (n = new d(0, 1, 0));
15908
15910
  const s = new d().crossVectors(n, i).normalize(), o = new d().crossVectors(s, n).normalize(), r = e.map((c) => {
15909
15911
  const h = c.clone().sub(t);
15910
15912
  return new K(h.dot(o), h.dot(s));
15911
- }), l = new z().makeBasis(o, s, n).setPosition(t);
15913
+ }), l = new O().makeBasis(o, s, n).setPosition(t);
15912
15914
  return { origin: t, normal: n, matrix: l, localPoints: r };
15913
15915
  }
15914
15916
  function js(a) {
@@ -15921,12 +15923,12 @@ function js(a) {
15921
15923
  e.lineTo(t.x, t.y);
15922
15924
  }), e.closePath(), e;
15923
15925
  }
15924
- function Ah(a, e) {
15926
+ function Ph(a, e) {
15925
15927
  a.traverse((t) => {
15926
15928
  t.userData = t.userData ?? {}, t.userData.annotationId = e;
15927
15929
  });
15928
15930
  }
15929
- function Ph(a) {
15931
+ function Th(a) {
15930
15932
  a.traverse((e) => {
15931
15933
  const t = e;
15932
15934
  t.geometry?.dispose?.();
@@ -15938,21 +15940,21 @@ function Ph(a) {
15938
15940
  i?.dispose?.();
15939
15941
  });
15940
15942
  }
15941
- function Th(a) {
15943
+ function Ih(a) {
15942
15944
  return a.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
15943
15945
  }
15944
- function Ih(a) {
15946
+ function Dh(a) {
15945
15947
  return a === "polyline" || a === "curve3d" ? "center" : a === "polygon" ? "centroid" : "top";
15946
15948
  }
15947
- class Dh {
15949
+ class _h {
15948
15950
  render(e) {
15949
- const t = e.instance.style.leaderPoint ?? {}, i = t.strokeColor || e.instance.style.color || "#7ffcff", n = t.backgroundColor || e.instance.style.fillColor || i, s = t.borderColor || i, o = t.anchorColor || n, r = t.anchorRingColor || i, l = t.iconBackgroundColor || n, c = t.side ?? "right", h = t.icon ? this.escapeXmlAttribute(t.icon) : "", u = Math.max(t.iconWidth ?? 22, 1), p = Math.max(t.iconHeight ?? 22, 1), g = (t.text ?? "").trim(), y = Math.max(t.fontSize ?? 14, 10), M = t.textColor || e.instance.style.color || "#ffffff", w = t.fontWeight ?? 500, f = Math.max(Math.round((t.height ?? 8) * 12), 48), C = Math.max(Math.round(Math.abs(t.offsetX ?? t.armLength ?? 4) * 18), 56), S = this.getBoardWidth(e, g, y), P = Math.max(Math.round((t.boardHeight ?? 1.8) * 22), y + 18, 34), _ = Math.max(Math.round((t.stemWidth ?? e.instance.style.lineWidth ?? 0.12) * 20), 2), I = t.borderWidth ?? 2.5, F = t.variant ?? "elbow", k = c === "right" ? 22 + C - 8 : 22 - C - S + 8, N = 8, Q = Math.min(22, k) - 16, ee = Math.max(22, k + S) + 16, X = Math.max(ee - Q, 140), re = Math.max(f + P + 36, 120), ie = 22 - Q, ne = k - Q, pe = re - 18, Se = Math.max(pe - f, 14), b = c === "right" ? ne : ne + S, m = N + Math.round(P * 0.5), x = F === "vertical" ? [`${ie},${pe}`, `${ie},${Se}`] : [`${ie},${pe}`, `${ie},${m}`, `${b},${m}`], T = e.instance.selectable !== !1, D = T ? "visiblePainted" : "none", A = T ? "pointer" : "default", B = ne + (h || !g ? 38 : 12), U = t.showBoard === !1 ? "" : `
15951
+ const t = e.instance.style.leaderPoint ?? {}, i = t.strokeColor || e.instance.style.color || "#7ffcff", n = t.backgroundColor || e.instance.style.fillColor || i, s = t.borderColor || i, o = t.anchorColor || n, r = t.anchorRingColor || i, l = t.iconBackgroundColor || n, c = t.side ?? "right", h = t.icon ? this.escapeXmlAttribute(t.icon) : "", u = Math.max(t.iconWidth ?? 22, 1), p = Math.max(t.iconHeight ?? 22, 1), g = (t.text ?? "").trim(), y = Math.max(t.fontSize ?? 14, 10), M = t.textColor || e.instance.style.color || "#ffffff", w = t.fontWeight ?? 500, f = Math.max(Math.round((t.height ?? 8) * 12), 48), C = Math.max(Math.round(Math.abs(t.offsetX ?? t.armLength ?? 4) * 18), 56), S = this.getBoardWidth(e, g, y), P = Math.max(Math.round((t.boardHeight ?? 1.8) * 22), y + 18, 34), _ = Math.max(Math.round((t.stemWidth ?? e.instance.style.lineWidth ?? 0.12) * 20), 2), I = t.borderWidth ?? 2.5, F = t.variant ?? "elbow", k = c === "right" ? 22 + C - 8 : 22 - C - S + 8, N = 8, Q = Math.min(22, k) - 16, ee = Math.max(22, k + S) + 16, X = Math.max(ee - Q, 140), re = Math.max(f + P + 36, 120), ie = 22 - Q, ne = k - Q, pe = re - 18, Se = Math.max(pe - f, 14), b = c === "right" ? ne : ne + S, m = N + Math.round(P * 0.5), x = F === "vertical" ? [`${ie},${pe}`, `${ie},${Se}`] : [`${ie},${pe}`, `${ie},${m}`, `${b},${m}`], T = e.instance.selectable !== !1, D = T ? "visiblePainted" : "none", A = T ? "pointer" : "default", z = ne + (h || !g ? 38 : 12), U = t.showBoard === !1 ? "" : `
15950
15952
  <rect x="${ne}" y="${N}" width="${S}" height="${P}" rx="10"
15951
15953
  fill="${n}" fill-opacity="${t.backgroundOpacity ?? t.boardOpacity ?? 0.18}"
15952
15954
  stroke="${s}" stroke-width="${I}" />
15953
15955
  ${t.iconBackgroundOpacity && t.iconBackgroundOpacity > 0 ? `<circle cx="${ne + 19}" cy="${N + 17}" r="11" fill="${l}" fill-opacity="${t.iconBackgroundOpacity}" />` : ""}
15954
15956
  ${h ? `<image href="${h}" x="${ne + 8}" y="${N + 6}" width="${u}" height="${p}" preserveAspectRatio="xMidYMid meet" />` : g ? "" : `<circle cx="${ne + 19}" cy="${N + 17}" r="8" fill="${i}" />`}
15955
- ${g ? `<text x="${B}" y="${m}" fill="${M}" font-size="${y}" font-weight="${this.escapeXmlAttribute(String(w))}" dominant-baseline="middle">${this.escapeXmlText(g)}</text>` : ""}
15957
+ ${g ? `<text x="${z}" y="${m}" fill="${M}" font-size="${y}" font-weight="${this.escapeXmlAttribute(String(w))}" dominant-baseline="middle">${this.escapeXmlText(g)}</text>` : ""}
15956
15958
  `, q = t.showAnchor === !1 ? "" : `
15957
15959
  <circle cx="${ie}" cy="${pe}" r="7" fill="${o}" fill-opacity="0.92" />
15958
15960
  <circle cx="${ie}" cy="${pe}" r="10" fill="none" stroke="${r}" stroke-width="2" stroke-opacity="0.9" />
@@ -15998,7 +16000,7 @@ class Dh {
15998
16000
  return Math.max(Math.round((n.boardWidth ?? 4.6) * 22), Math.ceil(r), 78);
15999
16001
  }
16000
16002
  }
16001
- class _h {
16003
+ class kh {
16002
16004
  /** 按标记类型重建内容,并返回相对三维锚点的布局参数。 */
16003
16005
  render(e, t) {
16004
16006
  const i = t.instance.type === "iconPoint" ? t.instance.style.iconPoint ?? {} : t.instance.type === "textPoint" ? t.instance.style.textPoint ?? {} : t.instance.style.iconTextPoint ?? {}, n = JSON.stringify({
@@ -16071,10 +16073,10 @@ class _h {
16071
16073
  return `rgba(${r >> 16 & 255}, ${r >> 8 & 255}, ${r & 255}, ${i})`;
16072
16074
  }
16073
16075
  }
16074
- const kh = /* @__PURE__ */ new Set(["iconPoint", "textPoint", "iconTextPoint"]), Lh = /* @__PURE__ */ new Set(["iconPoint", "textPoint", "iconTextPoint", "ripplePoint", "pillarPoint", "leaderPoint"]);
16075
- class Rh {
16076
+ const Lh = /* @__PURE__ */ new Set(["iconPoint", "textPoint", "iconTextPoint"]), Rh = /* @__PURE__ */ new Set(["iconPoint", "textPoint", "iconTextPoint", "ripplePoint", "pillarPoint", "leaderPoint"]);
16077
+ class Bh {
16076
16078
  constructor(e, t) {
16077
- this.engine = e, this.isAnchorOccluded = t, this.container = document.createElement("div"), this.container.className = Eh, this.container.style.cssText = [
16079
+ this.engine = e, this.isAnchorOccluded = t, this.container = document.createElement("div"), this.container.className = Sh, this.container.style.cssText = [
16078
16080
  "position:absolute",
16079
16081
  "left:0",
16080
16082
  "top:0",
@@ -16087,8 +16089,8 @@ class Rh {
16087
16089
  }
16088
16090
  container;
16089
16091
  worldToScreen;
16090
- leaderMarker = new Dh();
16091
- pointContentMarker = new _h();
16092
+ leaderMarker = new _h();
16093
+ pointContentMarker = new kh();
16092
16094
  updateProjectionState() {
16093
16095
  this.worldToScreen.updateCamera(this.engine.camera), this.worldToScreen.updateRenderer(this.engine.renderer), this.worldToScreen.updateScene(this.engine.scene);
16094
16096
  }
@@ -16101,7 +16103,7 @@ class Rh {
16101
16103
  "transform:translate(-50%, -100%)",
16102
16104
  "display:none",
16103
16105
  t.interactive === !1 ? "pointer-events:none" : "pointer-events:auto"
16104
- ].join(";"), t.mode === "html" ? i.innerHTML = t.html ?? "" : i.textContent = t.text ?? "", Object.entries(t.style ?? {}).forEach(([n, s]) => i.style.setProperty(Th(n), s)), i;
16106
+ ].join(";"), t.mode === "html" ? i.innerHTML = t.html ?? "" : i.textContent = t.text ?? "", Object.entries(t.style ?? {}).forEach(([n, s]) => i.style.setProperty(Ih(n), s)), i;
16105
16107
  }
16106
16108
  createLeaderMarkerElement(e) {
16107
16109
  const t = document.createElement("div");
@@ -16113,7 +16115,7 @@ class Rh {
16113
16115
  return t.className = "bim-annotation3d-marker bim-annotation3d-point-marker", t.dataset.annotationId = e.id, t.style.cssText = ["position:absolute", "left:0", "top:0", "display:none", "pointer-events:none"].join(";"), t;
16114
16116
  }
16115
16117
  updateRecord(e) {
16116
- if (e.markerElement && e.instance.type === "leaderPoint" ? this.updateLeaderMarker(e) : e.markerElement && kh.has(e.instance.type) && this.updatePointMarker(e), !e.panelElement || !e.instance.panel)
16118
+ if (e.markerElement && e.instance.type === "leaderPoint" ? this.updateLeaderMarker(e) : e.markerElement && Lh.has(e.instance.type) && this.updatePointMarker(e), !e.panelElement || !e.instance.panel)
16117
16119
  return;
16118
16120
  const t = e.instance.panel;
16119
16121
  if (!(t.visible !== !1 && this.shouldShowPanel(e)) || !e.instance.visible) {
@@ -16172,9 +16174,9 @@ class Rh {
16172
16174
  const t = e.instance.panel?.offset ?? {};
16173
16175
  if (e.panelAnchorPoint)
16174
16176
  return e.panelAnchorPoint.clone().add(new d(t.x ?? 0, t.y ?? 0, t.z ?? 0));
16175
- const i = e.instance.panel?.anchor ?? Ih(e.instance.type);
16177
+ const i = e.instance.panel?.anchor ?? Dh(e.instance.type);
16176
16178
  let n = new d();
16177
- if (Lh.has(e.instance.type))
16179
+ if (Rh.has(e.instance.type))
16178
16180
  n.copy(J(e.instance.points[0])), i === "top" && (n.y += e.volumeHeight ?? 0);
16179
16181
  else if (e.instance.type === "polyline" || e.instance.type === "curve3d")
16180
16182
  i === "start" ? n.copy(J(e.instance.points[0])) : i === "end" ? n.copy(J(e.instance.points[e.instance.points.length - 1])) : e.anchorCurve ? n.copy(e.anchorCurve.getPoint(0.5)) : n.copy(qt(e.instance.points));
@@ -16189,39 +16191,39 @@ class Rh {
16189
16191
  return n.add(new d(t.x ?? 0, t.y ?? 0, t.z ?? 0)), n;
16190
16192
  }
16191
16193
  }
16192
- class Bh {
16194
+ class zh {
16193
16195
  apply(e, t) {
16194
16196
  e.instance.root.visible = e.instance.visible, e.instance.style.alwaysOnTop && e.instance.root.traverse((i) => {
16195
16197
  i.renderOrder = Math.max(i.renderOrder, 1200);
16196
16198
  }), t(e);
16197
16199
  }
16198
16200
  }
16199
- class zh {
16201
+ class Oh {
16200
16202
  constructor(e) {
16201
16203
  this.engine = e;
16202
16204
  }
16203
16205
  createSurfaceMaterial(e) {
16204
- const t = e.style ?? {}, i = e.effect ?? {}, n = this.getGradientStops(e.color, i.gradient?.stops), s = i.glow?.enabled ? i.glow.intensity ?? 0.9 : 0, o = i.flow?.direction === "backward" ? -1 : 1, r = mt(0), l = this.getAxisNode(e.axisMode), c = e.axisMode === "uvx" || e.axisMode === "uvy", h = c ? 0 : e.axisMin ?? 0, u = c ? 1 : e.axisMax ?? 1, p = Math.max(Math.abs(u - h), 1e-4), g = an(l.sub(h).div(p), 0, 1);
16205
- let y = mt(new de(e.color)), M = mt(e.opacity);
16206
- if (i.gradient?.enabled === !0 && (y = xt(
16207
- mt(new de(n[0].color)),
16208
- mt(new de(n[1].color)),
16206
+ const t = e.style ?? {}, i = e.effect ?? {}, n = this.getGradientStops(e.color, i.gradient?.stops), s = i.glow?.enabled ? i.glow.intensity ?? 0.9 : 0, o = i.flow?.direction === "backward" ? -1 : 1, r = ft(0), l = this.getAxisNode(e.axisMode), c = e.axisMode === "uvx" || e.axisMode === "uvy", h = c ? 0 : e.axisMin ?? 0, u = c ? 1 : e.axisMax ?? 1, p = Math.max(Math.abs(u - h), 1e-4), g = an(l.sub(h).div(p), 0, 1);
16207
+ let y = ft(new de(e.color)), M = ft(e.opacity);
16208
+ if (i.gradient?.enabled === !0 && (y = wt(
16209
+ ft(new de(n[0].color)),
16210
+ ft(new de(n[1].color)),
16209
16211
  g
16210
- ), M = M.mul(xt(
16212
+ ), M = M.mul(wt(
16211
16213
  n[0].alpha ?? 1,
16212
16214
  n[1].alpha ?? 0.1,
16213
16215
  g
16214
16216
  ))), i.flow?.enabled === !0) {
16215
- const f = Math.max(i.flow.width ?? 0.18, 1e-4), C = i.flow.direction === "up" ? ft().y.oneMinus() : ft().x, S = ln(C.mul(o).sub(r.mul(i.flow.speed ?? 0.6))), P = pi(0, f, S).mul(pi(f, f * 2, S).oneMinus());
16217
+ const f = Math.max(i.flow.width ?? 0.18, 1e-4), C = i.flow.direction === "up" ? yt().y.oneMinus() : yt().x, S = ln(C.mul(o).sub(r.mul(i.flow.speed ?? 0.6))), P = pi(0, f, S).mul(pi(f, f * 2, S).oneMinus());
16216
16218
  y = y.add(Jt(0.55).mul(P).mul(Math.max(s, 0.25))), M = M.add(P.mul(0.18));
16217
16219
  }
16218
16220
  if (i.scan?.enabled === !0) {
16219
- const f = Math.max(i.scan.width ?? 0.18, 1e-4), C = ln(ft().y.sub(r.mul(i.scan.speed ?? 0.8))).sub(0.5).abs().mul(2), S = pi(0, f, C).oneMinus();
16221
+ const f = Math.max(i.scan.width ?? 0.18, 1e-4), C = ln(yt().y.sub(r.mul(i.scan.speed ?? 0.8))).sub(0.5).abs().mul(2), S = pi(0, f, C).oneMinus();
16220
16222
  y = y.add(Jt(0.28).mul(S)), M = M.add(S.mul(0.12));
16221
16223
  }
16222
16224
  if (s > 0.01 && (y = y.mul(1 + s * 0.25)), i.pulse?.enabled === !0) {
16223
16225
  const f = Ho(r.mul(i.pulse.speed ?? 1.4)).mul(0.5).add(0.5);
16224
- M = M.mul(xt(
16226
+ M = M.mul(wt(
16225
16227
  i.pulse.minOpacity ?? 0.55,
16226
16228
  i.pulse.maxOpacity ?? 1,
16227
16229
  f
@@ -16255,7 +16257,7 @@ class zh {
16255
16257
  });
16256
16258
  }
16257
16259
  getAxisNode(e) {
16258
- return e === "x" ? gi.x : e === "y" ? gi.y : e === "z" ? gi.z : e === "uvx" ? ft().x : ft().y;
16260
+ return e === "x" ? gi.x : e === "y" ? gi.y : e === "z" ? gi.z : e === "uvx" ? yt().x : yt().y;
16259
16261
  }
16260
16262
  getGradientStops(e, t) {
16261
16263
  if (!Array.isArray(t) || t.length === 0)
@@ -16295,7 +16297,7 @@ class Ke {
16295
16297
  return e.animatedMaterials.push(u), p;
16296
16298
  }
16297
16299
  createLoopLine(e, t, i) {
16298
- const n = new ue().setFromPoints(e.map((r) => J(r))), s = new et({
16300
+ const n = new ue().setFromPoints(e.map((r) => J(r))), s = new tt({
16299
16301
  color: t,
16300
16302
  transparent: !0,
16301
16303
  opacity: 0.94,
@@ -16306,7 +16308,7 @@ class Ke {
16306
16308
  return o.renderOrder = 998, o;
16307
16309
  }
16308
16310
  }
16309
- class Oh extends Ke {
16311
+ class Nh extends Ke {
16310
16312
  type = "box";
16311
16313
  build(e) {
16312
16314
  if (e.instance.points.length < 2)
@@ -16326,7 +16328,7 @@ class Oh extends Ke {
16326
16328
  axisMax: c.max.y
16327
16329
  }), u = new V(l, h);
16328
16330
  u.position.copy(r), e.instance.root.add(u);
16329
- const p = new et({
16331
+ const p = new tt({
16330
16332
  color: e.instance.style.volume?.edgeColor ?? "#d9ffff",
16331
16333
  transparent: !0,
16332
16334
  opacity: 0.88,
@@ -16337,7 +16339,7 @@ class Oh extends Ke {
16337
16339
  g.position.copy(r), e.instance.root.add(g), e.volumeHeight = o.y, e.animatedMaterials.push(h);
16338
16340
  }
16339
16341
  }
16340
- class Nh extends Ke {
16342
+ class Fh extends Ke {
16341
16343
  type = "curve3d";
16342
16344
  build(e) {
16343
16345
  const t = e.instance.points.map((r) => J(r)), i = e.instance.style.curve ?? {}, n = i.interpolation ?? "catmullRom", s = new jo(
@@ -16358,7 +16360,7 @@ class Nh extends Ke {
16358
16360
  e.instance.root.add(o), e.anchorCurve = s, e.panelAnchorPoint = s.getPoint(0.5);
16359
16361
  }
16360
16362
  }
16361
- class Fh extends Ke {
16363
+ class Hh extends Ke {
16362
16364
  type = "extrudePolygon";
16363
16365
  build(e) {
16364
16366
  const t = Ks(e.instance.points), i = js(t.localPoints), n = e.instance.style.volume?.height ?? 10, s = new ls(i, {
@@ -16406,21 +16408,21 @@ class tn extends Ke {
16406
16408
  e.instance.root.position.copy(t), e.panelAnchorPoint = t.clone();
16407
16409
  }
16408
16410
  }
16409
- class Hh extends tn {
16411
+ class Vh extends tn {
16410
16412
  type = "iconPoint";
16411
16413
  /** 将图标点绑定到首个世界坐标。 */
16412
16414
  build(e) {
16413
16415
  this.buildDomAnchor(e);
16414
16416
  }
16415
16417
  }
16416
- class Vh extends tn {
16418
+ class Uh extends tn {
16417
16419
  type = "iconTextPoint";
16418
16420
  /** 将图文组合点绑定到首个世界坐标。 */
16419
16421
  build(e) {
16420
16422
  this.buildDomAnchor(e);
16421
16423
  }
16422
16424
  }
16423
- class Uh extends Ke {
16425
+ class qh extends Ke {
16424
16426
  type = "leaderPoint";
16425
16427
  build(e) {
16426
16428
  const t = J(e.instance.points[0]), i = e.instance.style.leaderPoint ?? {}, n = Math.max(i.height ?? 8, 0.5), s = i.offsetX ?? i.armLength ?? 4, o = i.offsetZ ?? 0, r = this.createLeaderPathPoints(i.variant ?? "elbow", n, s, o), l = r[r.length - 1].clone();
@@ -16440,7 +16442,7 @@ class Uh extends Ke {
16440
16442
  ];
16441
16443
  }
16442
16444
  }
16443
- class qh extends Ke {
16445
+ class Gh extends Ke {
16444
16446
  type = "pillarPoint";
16445
16447
  /** 根据光柱专属参数创建柱体与可选底环。 */
16446
16448
  build(e) {
@@ -16455,7 +16457,7 @@ class qh extends Ke {
16455
16457
  t.openEnded ?? !0
16456
16458
  ), r = t.color ?? "#7ffcff", l = this.materialFactory.createSurfaceMaterial({
16457
16459
  color: r,
16458
- opacity: O.clamp(t.opacity ?? 0.35, 0, 1),
16460
+ opacity: B.clamp(t.opacity ?? 0.35, 0, 1),
16459
16461
  style: e.instance.style,
16460
16462
  effect: {
16461
16463
  gradient: {
@@ -16482,7 +16484,7 @@ class qh extends Ke {
16482
16484
  const h = new le({
16483
16485
  color: t.baseRingColor ?? r,
16484
16486
  transparent: !0,
16485
- opacity: O.clamp(t.baseRingOpacity ?? 0.72, 0, 1),
16487
+ opacity: B.clamp(t.baseRingOpacity ?? 0.72, 0, 1),
16486
16488
  side: Ee,
16487
16489
  depthTest: e.instance.style.alwaysOnTop ? !1 : e.instance.style.depthTest !== !1,
16488
16490
  depthWrite: !1
@@ -16500,7 +16502,7 @@ class qh extends Ke {
16500
16502
  }
16501
16503
  }
16502
16504
  }
16503
- class Gh extends Ke {
16505
+ class Wh extends Ke {
16504
16506
  type = "polygon";
16505
16507
  build(e) {
16506
16508
  const t = Ks(e.instance.points), i = js(t.localPoints), n = new Qo(i);
@@ -16523,7 +16525,7 @@ class Gh extends Ke {
16523
16525
  ), e.animatedMaterials.push(o);
16524
16526
  }
16525
16527
  }
16526
- class Wh extends Ke {
16528
+ class Kh extends Ke {
16527
16529
  type = "polyline";
16528
16530
  build(e) {
16529
16531
  const t = e.instance.points.map((s) => J(s)), i = this.createSegmentCurve(t), n = this.createTubeMesh(
@@ -16537,7 +16539,7 @@ class Wh extends Ke {
16537
16539
  e.instance.root.add(n), e.anchorCurve = i, e.panelAnchorPoint = i.getPoint(0.5);
16538
16540
  }
16539
16541
  }
16540
- class Kh extends Ke {
16542
+ class jh extends Ke {
16541
16543
  type = "ripplePoint";
16542
16544
  /** 根据波纹参数创建中心点和错相扩散圆环。 */
16543
16545
  build(e) {
@@ -16546,7 +16548,7 @@ class Kh extends Ke {
16546
16548
  const c = new le({
16547
16549
  color: t.centerColor ?? t.color ?? "#7ffcff",
16548
16550
  transparent: !0,
16549
- opacity: O.clamp(t.centerOpacity ?? 0.92, 0, 1),
16551
+ opacity: B.clamp(t.centerOpacity ?? 0.92, 0, 1),
16550
16552
  depthTest: e.instance.style.alwaysOnTop ? !1 : e.instance.style.depthTest !== !1,
16551
16553
  depthWrite: !1
16552
16554
  });
@@ -16557,12 +16559,12 @@ class Kh extends Ke {
16557
16559
  );
16558
16560
  e.instance.root.add(h);
16559
16561
  }
16560
- const s = Math.max(1, Math.floor(t.count ?? 3)), o = Math.max(t.maxRadius ?? 8, 0.02), r = O.clamp(t.ringWidth ?? 0.12, 1e-3, o), l = Math.max(12, Math.floor(t.segments ?? 48));
16562
+ const s = Math.max(1, Math.floor(t.count ?? 3)), o = Math.max(t.maxRadius ?? 8, 0.02), r = B.clamp(t.ringWidth ?? 0.12, 1e-3, o), l = Math.max(12, Math.floor(t.segments ?? 48));
16561
16563
  for (let c = 0; c < s; c += 1) {
16562
16564
  const h = new le({
16563
16565
  color: t.color ?? "#7ffcff",
16564
16566
  transparent: !0,
16565
- opacity: O.clamp(t.opacity ?? 0.55, 0, 1),
16567
+ opacity: B.clamp(t.opacity ?? 0.55, 0, 1),
16566
16568
  side: Ee,
16567
16569
  depthTest: e.instance.style.alwaysOnTop ? !1 : e.instance.style.depthTest !== !1,
16568
16570
  depthWrite: !1
@@ -16576,29 +16578,29 @@ class Kh extends Ke {
16576
16578
  }
16577
16579
  }
16578
16580
  }
16579
- class jh extends tn {
16581
+ class Yh extends tn {
16580
16582
  type = "textPoint";
16581
16583
  /** 将文字点绑定到首个世界坐标。 */
16582
16584
  build(e) {
16583
16585
  this.buildDomAnchor(e);
16584
16586
  }
16585
16587
  }
16586
- function Yh(a, e) {
16588
+ function Qh(a, e) {
16587
16589
  return [
16588
- new Hh(a, e),
16589
- new jh(a, e),
16590
16590
  new Vh(a, e),
16591
- new Kh(a, e),
16592
- new qh(a, e),
16591
+ new Yh(a, e),
16593
16592
  new Uh(a, e),
16594
- new Wh(a, e),
16595
- new Nh(a, e),
16593
+ new jh(a, e),
16596
16594
  new Gh(a, e),
16595
+ new qh(a, e),
16596
+ new Kh(a, e),
16597
16597
  new Fh(a, e),
16598
- new Oh(a, e)
16598
+ new Wh(a, e),
16599
+ new Hh(a, e),
16600
+ new Nh(a, e)
16599
16601
  ];
16600
16602
  }
16601
- function Qh(a, e, t) {
16603
+ function Xh(a, e, t) {
16602
16604
  const i = a.camera;
16603
16605
  if (!i)
16604
16606
  return !1;
@@ -16611,7 +16613,7 @@ function Qh(a, e, t) {
16611
16613
  const r = o.sort((l, c) => l.distance - c.distance)[0];
16612
16614
  return !!(r && r.distance < s - 0.05);
16613
16615
  }
16614
- class Xh {
16616
+ class $h {
16615
16617
  /** 归一化外部数据,并在创建几何前校验类型对应的必要输入。 */
16616
16618
  normalizeData(e) {
16617
16619
  const t = {
@@ -16745,7 +16747,7 @@ class Xh {
16745
16747
  offset: { ...e.offset ?? {} },
16746
16748
  screenOffset: { ...e.screenOffset ?? {} },
16747
16749
  className: e.className,
16748
- style: { ...Ch, ...e.style ?? {} },
16750
+ style: { ...Eh, ...e.style ?? {} },
16749
16751
  interactive: e.interactive ?? !0,
16750
16752
  occlusion: e.occlusion ?? "show",
16751
16753
  actions: e.actions
@@ -16784,11 +16786,11 @@ class Xh {
16784
16786
  }
16785
16787
  }
16786
16788
  }
16787
- function $h(a) {
16789
+ function Jh(a) {
16788
16790
  const { actions: e, ...t } = a;
16789
16791
  return t;
16790
16792
  }
16791
- function Jh(a) {
16793
+ function Zh(a) {
16792
16794
  return {
16793
16795
  id: a.instance.id,
16794
16796
  type: a.instance.type,
@@ -16804,7 +16806,7 @@ function Jh(a) {
16804
16806
  function Gt(a) {
16805
16807
  return a === void 0 ? a : JSON.parse(JSON.stringify(a));
16806
16808
  }
16807
- class Zh {
16809
+ class ed {
16808
16810
  builders = /* @__PURE__ */ new Map();
16809
16811
  constructor(e) {
16810
16812
  e.forEach((t) => this.builders.set(t.type, t));
@@ -16816,8 +16818,8 @@ class Zh {
16816
16818
  t.build(e);
16817
16819
  }
16818
16820
  }
16819
- const ed = /* @__PURE__ */ new Set(["iconPoint", "textPoint", "iconTextPoint"]);
16820
- class td {
16821
+ const td = /* @__PURE__ */ new Set(["iconPoint", "textPoint", "iconTextPoint"]);
16822
+ class id {
16821
16823
  constructor(e, t) {
16822
16824
  this.markerRegistry = e, this.overlayController = t;
16823
16825
  }
@@ -16832,7 +16834,7 @@ class td {
16832
16834
  selectable: e.selectable ?? !0,
16833
16835
  style: e.style,
16834
16836
  effect: e.effect ?? {},
16835
- panel: e.panel ? $h(e.panel) : void 0,
16837
+ panel: e.panel ? Jh(e.panel) : void 0,
16836
16838
  data: e.data,
16837
16839
  panelVisible: e.panel?.trigger === "always",
16838
16840
  hovered: !1,
@@ -16841,37 +16843,37 @@ class td {
16841
16843
  instance: i,
16842
16844
  actions: e.panel?.actions,
16843
16845
  panelElement: e.panel ? this.overlayController.createPanelElement(i, e.panel) : null,
16844
- markerElement: e.type === "leaderPoint" ? this.overlayController.createLeaderMarkerElement(i) : ed.has(e.type) ? this.overlayController.createPointMarkerElement(i) : null,
16846
+ markerElement: e.type === "leaderPoint" ? this.overlayController.createLeaderMarkerElement(i) : td.has(e.type) ? this.overlayController.createPointMarkerElement(i) : null,
16845
16847
  timeSeed: Math.random() * Math.PI * 2,
16846
16848
  pulseMaterials: [],
16847
16849
  rippleMeshes: [],
16848
16850
  baseRingMeshes: [],
16849
16851
  animatedMaterials: []
16850
16852
  };
16851
- return this.markerRegistry.build(n), Ah(t, i.id), n;
16853
+ return this.markerRegistry.build(n), Ph(t, i.id), n;
16852
16854
  }
16853
16855
  }
16854
- class id {
16856
+ class nd {
16855
16857
  engine;
16856
16858
  rootGroup;
16857
16859
  records = /* @__PURE__ */ new Map();
16858
16860
  occlusionRaycaster = new be();
16859
- normalizer = new Xh();
16861
+ normalizer = new $h();
16860
16862
  materialFactory;
16861
16863
  overlayController;
16862
16864
  interactionController;
16863
16865
  effectsController;
16864
- visibilityController = new Bh();
16866
+ visibilityController = new zh();
16865
16867
  markerRegistry;
16866
16868
  recordFactory;
16867
16869
  currentTime = 0;
16868
16870
  constructor(e) {
16869
- this.engine = e, this.rootGroup = new Pe(), this.rootGroup.name = "Annotation3dRoot", this.engine.scene.add(this.rootGroup), this.materialFactory = new zh(this.engine), this.overlayController = new Rh(
16871
+ this.engine = e, this.rootGroup = new Pe(), this.rootGroup.name = "Annotation3dRoot", this.engine.scene.add(this.rootGroup), this.materialFactory = new Oh(this.engine), this.overlayController = new Bh(
16870
16872
  this.engine,
16871
- (t) => Qh(this.engine, this.occlusionRaycaster, t)
16872
- ), this.markerRegistry = new Zh(
16873
- Yh(this.engine, this.materialFactory)
16874
- ), this.recordFactory = new td(this.markerRegistry, this.overlayController), this.effectsController = new xh(), this.interactionController = new wh({
16873
+ (t) => Xh(this.engine, this.occlusionRaycaster, t)
16874
+ ), this.markerRegistry = new ed(
16875
+ Qh(this.engine, this.materialFactory)
16876
+ ), this.recordFactory = new id(this.markerRegistry, this.overlayController), this.effectsController = new wh(), this.interactionController = new Ch({
16875
16877
  engine: this.engine,
16876
16878
  rootGroup: this.rootGroup,
16877
16879
  records: this.records,
@@ -16972,7 +16974,7 @@ class id {
16972
16974
  return this.update(e, { panel: n });
16973
16975
  }
16974
16976
  getData() {
16975
- return Array.from(this.records.values()).map((e) => Jh(e));
16977
+ return Array.from(this.records.values()).map((e) => Zh(e));
16976
16978
  }
16977
16979
  restoreData(e) {
16978
16980
  this.clear(), e.forEach((t) => this.add(t));
@@ -16990,7 +16992,7 @@ class id {
16990
16992
  }
16991
16993
  removeInternal(e, t) {
16992
16994
  const i = this.records.get(e);
16993
- return i ? (this.interactionController.handleRecordRemoved(e), Ph(i.instance.root), i.instance.root.removeFromParent(), i.panelElement?.remove(), i.markerElement?.remove(), this.records.delete(e), t && this.emit("annotation3d-removed", { id: e }), !0) : !1;
16995
+ return i ? (this.interactionController.handleRecordRemoved(e), Th(i.instance.root), i.instance.root.removeFromParent(), i.panelElement?.remove(), i.markerElement?.remove(), this.records.delete(e), t && this.emit("annotation3d-removed", { id: e }), !0) : !1;
16994
16996
  }
16995
16997
  toEventPayload(e, t) {
16996
16998
  return { id: e.instance.id, annotation: e.instance, originalEvent: t };
@@ -16999,7 +17001,7 @@ class id {
16999
17001
  this.engine.events?.trigger?.(e, t);
17000
17002
  }
17001
17003
  }
17002
- class ht {
17004
+ class dt {
17003
17005
  constructor(e) {
17004
17006
  this.engine = e, typeof window < "u" && window.addEventListener("keydown", this.onKeyDown);
17005
17007
  }
@@ -17033,7 +17035,7 @@ class ht {
17033
17035
  applyInternal(e, t) {
17034
17036
  if (!e?.url || e.matrix == null)
17035
17037
  return !1;
17036
- const i = this.toThreeMatrix(e.matrix), n = this.getMatrix(e.url), s = it(this.engine, e.url);
17038
+ const i = this.toThreeMatrix(e.matrix), n = this.getMatrix(e.url), s = nt(this.engine, e.url);
17037
17039
  return t.saveHistory !== !1 && this.pushHistory(e.url, n), s.matrixAutoUpdate = !1, s.matrix.copy(i), s.matrixWorldNeedsUpdate = !0, s.updateMatrixWorld(!0), this.clearRuntimeWorldBoxCache(s), this.engine.octreeBox?.invalidateModelWorldCache?.(e.url), this.matrices.set(e.url, i.clone()), this.updateCachedModelBox(e.url, s), this.engine.modelEdge?.setModelEdgeTransform?.(e.url, i), this.engine.nodeBox?.setModelBoxTransform?.(e.url, i), this.engine.requestComposerRender?.(), this.notifyChange(e.url, i, n, t), !0;
17038
17040
  }
17039
17041
  /**
@@ -17053,9 +17055,9 @@ class ht {
17053
17055
  if (o.lengthSq() < 1e-10 || r.lengthSq() < 1e-10)
17054
17056
  throw new Error("[Calibration] source and target segments must have valid length");
17055
17057
  o.normalize(), r.normalize();
17056
- const l = new z().makeRotationFromQuaternion(
17058
+ const l = new O().makeRotationFromQuaternion(
17057
17059
  new Re().setFromUnitVectors(o, r)
17058
- ), c = new z().makeTranslation(n.x, n.y, n.z).multiply(l).multiply(new z().makeTranslation(-t.x, -t.y, -t.z)), h = this.getMatrix(e.url);
17060
+ ), c = new O().makeTranslation(n.x, n.y, n.z).multiply(l).multiply(new O().makeTranslation(-t.x, -t.y, -t.z)), h = this.getMatrix(e.url);
17059
17061
  return this.applyInternal({
17060
17062
  url: e.url,
17061
17063
  matrix: c.multiply(h),
@@ -17084,9 +17086,9 @@ class ht {
17084
17086
  if (r.lengthSq() < 1e-10 || l.lengthSq() < 1e-10)
17085
17087
  throw new Error("[Calibration] source and target segments must have valid length");
17086
17088
  r.normalize(), l.normalize();
17087
- const c = new z().makeRotationFromQuaternion(
17089
+ const c = new O().makeRotationFromQuaternion(
17088
17090
  new Re().setFromUnitVectors(r, l)
17089
- ), h = new z().makeTranslation(s.x, s.y, s.z).multiply(c).multiply(new z().makeTranslation(-i.x, -i.y, -i.z)), u = this.getMatrix(this.pointCalibrationUrl);
17091
+ ), h = new O().makeTranslation(s.x, s.y, s.z).multiply(c).multiply(new O().makeTranslation(-i.x, -i.y, -i.z)), u = this.getMatrix(this.pointCalibrationUrl);
17090
17092
  this.applyInternal({
17091
17093
  url: this.pointCalibrationUrl,
17092
17094
  matrix: h.multiply(u),
@@ -17130,12 +17132,12 @@ class ht {
17130
17132
  this.drawCalibrationSegment(
17131
17133
  t,
17132
17134
  n,
17133
- ht.sourceColor,
17135
+ dt.sourceColor,
17134
17136
  i.length < 2 ? e : null
17135
17137
  ), this.drawCalibrationSegment(
17136
17138
  t,
17137
17139
  s,
17138
- ht.targetColor,
17140
+ dt.targetColor,
17139
17141
  i.length >= 2 && i.length < 4 ? e : null
17140
17142
  );
17141
17143
  }
@@ -17157,12 +17159,12 @@ class ht {
17157
17159
  }
17158
17160
  /** 向捕捉 SVG 追加线段。 */
17159
17161
  appendSvgLine(e, t, i, n, s = !1) {
17160
- const o = document.createElementNS(ht.svgNamespace, "line");
17162
+ const o = document.createElementNS(dt.svgNamespace, "line");
17161
17163
  o.setAttribute("x1", `${t.x}`), o.setAttribute("y1", `${t.y}`), o.setAttribute("x2", `${i.x}`), o.setAttribute("y2", `${i.y}`), o.setAttribute("stroke", n), o.setAttribute("stroke-width", s ? "2" : "3"), s && o.setAttribute("stroke-dasharray", "6 4"), e.appendChild(o);
17162
17164
  }
17163
17165
  /** 向捕捉 SVG 追加确认点或半透明的当前捕捉预览点。 */
17164
17166
  appendSvgPoint(e, t, i, n = !1) {
17165
- const s = document.createElementNS(ht.svgNamespace, "circle");
17167
+ const s = document.createElementNS(dt.svgNamespace, "circle");
17166
17168
  s.setAttribute("cx", `${t.x}`), s.setAttribute("cy", `${t.y}`), s.setAttribute("r", n ? "6" : "5"), s.setAttribute("fill", n ? "transparent" : i), s.setAttribute("fill-opacity", n ? "0" : "1"), s.setAttribute("stroke", i), s.setAttribute("stroke-width", n ? "2" : "1"), n && s.setAttribute("stroke-dasharray", "3 2"), e.appendChild(s);
17167
17169
  }
17168
17170
  /** 清理四点校准留下的 SVG 覆盖元素。 */
@@ -17177,7 +17179,7 @@ class ht {
17177
17179
  if (t != null)
17178
17180
  return t.clone();
17179
17181
  const i = oi(this.engine, e);
17180
- return i == null ? new z() : i.matrix.clone();
17182
+ return i == null ? new O() : i.matrix.clone();
17181
17183
  }
17182
17184
  /**
17183
17185
  * 清除指定模型的校准。
@@ -17188,7 +17190,7 @@ class ht {
17188
17190
  return !1;
17189
17191
  const n = this.getMatrix(e);
17190
17192
  this.pushHistory(e, n), i.matrixAutoUpdate = !1, i.matrix.identity(), i.matrixWorldNeedsUpdate = !0, i.updateMatrixWorld(!0), this.clearRuntimeWorldBoxCache(i), this.engine.octreeBox?.invalidateModelWorldCache?.(e), this.matrices.delete(e), this.updateCachedModelBox(e, i);
17191
- const s = new z();
17193
+ const s = new O();
17192
17194
  return this.engine.modelEdge?.setModelEdgeTransform?.(e, s), this.engine.nodeBox?.setModelBoxTransform?.(e, s), this.engine.requestComposerRender?.(), this.notifyChange(e, s, n, { source: "clear", onChange: t }), !0;
17193
17195
  }
17194
17196
  /** 撤回最近一次模型校准;传 url 时只撤回指定模型,不传时撤回最后变更的模型。 */
@@ -17234,9 +17236,9 @@ class ht {
17234
17236
  const s = new d(), o = new Re(), r = new d();
17235
17237
  t.decompose(s, o, r);
17236
17238
  const l = new Xe().setFromQuaternion(o, "XYZ"), c = [
17237
- O.radToDeg(l.x),
17238
- O.radToDeg(l.y),
17239
- O.radToDeg(l.z)
17239
+ B.radToDeg(l.x),
17240
+ B.radToDeg(l.y),
17241
+ B.radToDeg(l.z)
17240
17242
  ];
17241
17243
  return {
17242
17244
  url: e,
@@ -17284,13 +17286,13 @@ class ht {
17284
17286
  });
17285
17287
  }
17286
17288
  toThreeMatrix(e) {
17287
- if (e instanceof z)
17289
+ if (e instanceof O)
17288
17290
  return e.clone();
17289
17291
  if (Array.isArray(e) && Array.isArray(e[0])) {
17290
17292
  const i = e;
17291
17293
  if (i.length !== 4 || i.some((n) => !Array.isArray(n) || n.length !== 4))
17292
17294
  throw new Error("[Calibration] matrix must be a 4x4 array");
17293
- return new z().set(
17295
+ return new O().set(
17294
17296
  i[0][0],
17295
17297
  i[0][1],
17296
17298
  i[0][2],
@@ -17312,7 +17314,7 @@ class ht {
17312
17314
  const t = Array.from(e);
17313
17315
  if (t.length !== 16)
17314
17316
  throw new Error("[Calibration] matrix must contain 16 numbers");
17315
- return new z().fromArray(t);
17317
+ return new O().fromArray(t);
17316
17318
  }
17317
17319
  toVector3(e) {
17318
17320
  if (e instanceof d)
@@ -17325,8 +17327,8 @@ class ht {
17325
17327
  return "x" in e ? new d(e.x, e.y, e.z) : new d(e.X, e.Y, e.Z);
17326
17328
  }
17327
17329
  }
17328
- const nd = 1e-3, sd = 0.65, od = 1;
17329
- class rd {
17330
+ const sd = 1e-3, od = 0.65, rd = 1;
17331
+ class ad {
17330
17332
  engine;
17331
17333
  loader;
17332
17334
  dracoLoader;
@@ -17464,7 +17466,7 @@ class rd {
17464
17466
  throw new Error(`替换材质失败:模型不存在材质${r}。`);
17465
17467
  }
17466
17468
  this.saveHistory(), await Promise.all(o.map(async (r) => {
17467
- const l = s[r], c = await new pt().loadAsync(i);
17469
+ const l = s[r], c = await new gt().loadAsync(i);
17468
17470
  c.colorSpace = Ge, l.map = c, l.needsUpdate = !0;
17469
17471
  const h = n.data.materials.find((u) => u.materialIndex === r);
17470
17472
  h ? (h.materialName = l.name || void 0, h.mapUrl = i) : n.data.materials.push({ materialIndex: r, materialName: l.name || void 0, mapUrl: i });
@@ -17624,7 +17626,7 @@ class rd {
17624
17626
  async applyTexture(e, t, i) {
17625
17627
  const n = this.getMaterials(e.object), s = t.materialName ? n.find((r) => r.name === t.materialName) ?? n[t.materialIndex] : n[t.materialIndex];
17626
17628
  if (!s) return;
17627
- const o = await new pt().loadAsync(i);
17629
+ const o = await new gt().loadAsync(i);
17628
17630
  o.colorSpace = Ge, s.map = o, s.needsUpdate = !0;
17629
17631
  }
17630
17632
  ensureTransformControl() {
@@ -17638,7 +17640,7 @@ class rd {
17638
17640
  }
17639
17641
  /** 透视相机使用更小的屏幕尺寸系数,正交相机维持原有尺寸。 */
17640
17642
  syncTransformControlCamera() {
17641
- !this.transformControl || !this.engine.camera || (this.transformControl.camera = this.engine.camera, this.transformControl.size = this.engine.camera.isPerspectiveCamera ? sd : od);
17643
+ !this.transformControl || !this.engine.camera || (this.transformControl.camera = this.engine.camera, this.transformControl.size = this.engine.camera.isPerspectiveCamera ? od : rd);
17642
17644
  }
17643
17645
  /** 使用引擎统一的捕捉器等待用户单击,并在取消或完成后恢复常规交互。 */
17644
17646
  pickPlacementPoint(e, t) {
@@ -17677,7 +17679,7 @@ class rd {
17677
17679
  const i = t.clone(), n = e?.normal ?? e?.face?.normal;
17678
17680
  if (n == null) return { position: i, normal: null };
17679
17681
  const s = n.clone(), o = e?.matrix ?? e?.object?.matrixWorld;
17680
- return o && s.transformDirection(o), s.lengthSq() < 1e-10 ? { position: i, normal: null } : (s.normalize(), i.addScaledVector(s, nd), { position: i, normal: s });
17682
+ return o && s.transformDirection(o), s.lengthSq() < 1e-10 ? { position: i, normal: null } : (s.normalize(), i.addScaledVector(s, sd), { position: i, normal: s });
17681
17683
  }
17682
17684
  handlePointerDown(e) {
17683
17685
  if (!(!this.editingEnabled || !this.engine.camera || !this.engine.renderer)) {
@@ -17835,7 +17837,7 @@ class Ai extends Error {
17835
17837
  super("模型对比已取消"), this.name = "ModelComparisonCancelledError";
17836
17838
  }
17837
17839
  }
17838
- class ad {
17840
+ class ld {
17839
17841
  constructor(e) {
17840
17842
  this.engine = e;
17841
17843
  }
@@ -18273,8 +18275,8 @@ class ad {
18273
18275
  });
18274
18276
  }
18275
18277
  }
18276
- const es = "__modelExplodeProxy", ts = new z().makeScale(0, 0, 0);
18277
- class ld {
18278
+ const es = "__modelExplodeProxy", ts = new O().makeScale(0, 0, 0);
18279
+ class cd {
18278
18280
  engine;
18279
18281
  /** 当前是否处于炸开模式;供外部滑块、交互模块判断是否需要走代理逻辑。 */
18280
18282
  active = !1;
@@ -18371,7 +18373,7 @@ class ld {
18371
18373
  if (this.animation == null)
18372
18374
  return;
18373
18375
  const e = performance.now() - this.animation.startTime, t = this.animation.duration, i = t <= 0 ? 1 : Math.min(1, e / t), n = i < 0.5 ? 2 * i * i : 1 - Math.pow(-2 * i + 2, 2) / 2;
18374
- this.setFactor(O.lerp(this.animation.from, this.animation.to, n)), i >= 1 && (this.animation = null);
18376
+ this.setFactor(B.lerp(this.animation.from, this.animation.to, n)), i >= 1 && (this.animation = null);
18375
18377
  }
18376
18378
  /**
18377
18379
  * 清理炸开代理并按当前构件状态恢复原始渲染对象。
@@ -18594,7 +18596,7 @@ class ld {
18594
18596
  restoreSource(e) {
18595
18597
  if (e.kind === "instance") {
18596
18598
  const s = this.shouldKeepOriginalInstanceHidden(e) ? ts : e.originalMatrix;
18597
- s instanceof z && (e.sourceMesh.setMatrixAt(e.subIndex, s), e.sourceMesh.instanceMatrix.needsUpdate = !0);
18599
+ s instanceof O && (e.sourceMesh.setMatrixAt(e.subIndex, s), e.sourceMesh.instanceMatrix.needsUpdate = !0);
18598
18600
  return;
18599
18601
  }
18600
18602
  const t = e.sourceMesh?.__splitComponentStates;
@@ -18745,11 +18747,11 @@ class ld {
18745
18747
  */
18746
18748
  getInstanceMatrix(e, t) {
18747
18749
  const i = e?.matrixsClone?.[t] ?? e?.matrixs?.[t];
18748
- if (i instanceof z)
18750
+ if (i instanceof O)
18749
18751
  return i.clone();
18750
18752
  if (typeof e?.getMatrixAt != "function")
18751
18753
  return;
18752
- const n = new z();
18754
+ const n = new O();
18753
18755
  return e.getMatrixAt(t, n), n;
18754
18756
  }
18755
18757
  /**
@@ -18797,7 +18799,7 @@ class ld {
18797
18799
  return Math.abs(i);
18798
18800
  }
18799
18801
  }
18800
- const is = "bim-material-editor-style", tt = [
18802
+ const is = "bim-material-editor-style", it = [
18801
18803
  "map",
18802
18804
  "normalMap",
18803
18805
  "roughnessMap",
@@ -18816,7 +18818,7 @@ const is = "bim-material-editor-style", tt = [
18816
18818
  bumpMap: "凹凸贴图",
18817
18819
  emissiveMap: "自发光贴图"
18818
18820
  };
18819
- class cd {
18821
+ class hd {
18820
18822
  constructor(e) {
18821
18823
  this.engine = e;
18822
18824
  }
@@ -18915,14 +18917,14 @@ function Ys(a) {
18915
18917
  t[i] instanceof de && (e[i] = `#${t[i].getHexString()}`);
18916
18918
  }), ["roughness", "metalness", "emissiveIntensity", "wireframe"].forEach((i) => {
18917
18919
  i in t && (e[i] = t[i]);
18918
- }), tt.forEach((i) => {
18920
+ }), it.forEach((i) => {
18919
18921
  i in t && (e[i] = t[i] ?? null);
18920
18922
  }), e;
18921
18923
  }
18922
- function bt(a) {
18924
+ function xt(a) {
18923
18925
  return a instanceof Be ? ri(a) || a.uuid : a;
18924
18926
  }
18925
- function hd(a) {
18927
+ function dd(a) {
18926
18928
  const e = a, t = {
18927
18929
  type: a.type,
18928
18930
  name: a.name || a.type,
@@ -18934,17 +18936,17 @@ function hd(a) {
18934
18936
  };
18935
18937
  return ["roughness", "metalness", "emissiveIntensity", "wireframe"].forEach((i) => {
18936
18938
  i in e && (t[i] = e[i]);
18937
- }), tt.forEach((i) => {
18938
- i in e && (t[i] = bt(e[i]) ?? null);
18939
+ }), it.forEach((i) => {
18940
+ i in e && (t[i] = xt(e[i]) ?? null);
18939
18941
  }), JSON.stringify(t);
18940
18942
  }
18941
- function dd(a, e) {
18943
+ function ud(a, e) {
18942
18944
  const t = Ys(a), i = {};
18943
18945
  return Object.entries(e.values).forEach(([n, s]) => {
18944
18946
  const o = t[n];
18945
- bt(s) !== bt(o) && (i[n] = {
18946
- before: bt(s),
18947
- after: bt(o)
18947
+ xt(s) !== xt(o) && (i[n] = {
18948
+ before: xt(s),
18949
+ after: xt(o)
18948
18950
  });
18949
18951
  }), i;
18950
18952
  }
@@ -18954,7 +18956,7 @@ function Qs(a, e, t) {
18954
18956
  i[e].set(t);
18955
18957
  return;
18956
18958
  }
18957
- if (tt.includes(e)) {
18959
+ if (it.includes(e)) {
18958
18960
  i[e] = t instanceof Be ? t : null;
18959
18961
  return;
18960
18962
  }
@@ -18975,7 +18977,7 @@ function Wt(a) {
18975
18977
  emissiveIntensity: typeof e.emissiveIntensity == "number" ? e.emissiveIntensity : void 0,
18976
18978
  side: a.side,
18977
18979
  wireframe: typeof e.wireframe == "boolean" ? e.wireframe : void 0,
18978
- textures: tt.filter((t) => t in e).map((t) => ({
18980
+ textures: it.filter((t) => t in e).map((t) => ({
18979
18981
  slot: t,
18980
18982
  name: Ui[t],
18981
18983
  url: ri(e[t]),
@@ -18983,7 +18985,7 @@ function Wt(a) {
18983
18985
  }))
18984
18986
  };
18985
18987
  }
18986
- class ud {
18988
+ class pd {
18987
18989
  constructor(e, t) {
18988
18990
  this.engine = e, this.host = t;
18989
18991
  }
@@ -19083,7 +19085,7 @@ class ud {
19083
19085
  const t = this.createElement("div", "bim-material-editor__section");
19084
19086
  t.appendChild(this.createElement("div", "bim-material-editor__section-title", "贴图"));
19085
19087
  const i = e;
19086
- return tt.filter((n) => n in i).forEach((n) => {
19088
+ return it.filter((n) => n in i).forEach((n) => {
19087
19089
  const s = this.createElement("div", "bim-material-editor__texture-row"), o = this.createElement("label", "", Ui[n]), r = document.createElement("input");
19088
19090
  r.type = "text", r.placeholder = "输入贴图 URL", r.value = ri(i[n]), r.addEventListener("change", () => {
19089
19091
  this.host.setTexture(e.uuid, n, r.value.trim() || null);
@@ -19101,7 +19103,7 @@ class ud {
19101
19103
  }
19102
19104
  /** 材质卡片预览优先显示贴图,没有贴图时用材质颜色兜底。 */
19103
19105
  createMaterialPreview(e) {
19104
- const t = this.createElement("div", "bim-material-editor__material-preview"), i = e, n = i.map instanceof Be ? i.map : tt.map((r) => i[r]).find((r) => r instanceof Be), s = ri(n);
19106
+ const t = this.createElement("div", "bim-material-editor__material-preview"), i = e, n = i.map instanceof Be ? i.map : it.map((r) => i[r]).find((r) => r instanceof Be), s = ri(n);
19105
19107
  if (s)
19106
19108
  return t.style.backgroundImage = `url(${JSON.stringify(s)})`, t.classList.add("has-texture"), t;
19107
19109
  const o = i.color instanceof de ? `#${i.color.getHexString()}` : "#c7ced8";
@@ -19190,7 +19192,7 @@ class ud {
19190
19192
  `, document.head.appendChild(e);
19191
19193
  }
19192
19194
  }
19193
- class pd {
19195
+ class gd {
19194
19196
  constructor(e) {
19195
19197
  this.collectSceneMaterials = e;
19196
19198
  }
@@ -19221,7 +19223,7 @@ class pd {
19221
19223
  const i = this.baselineSnapshots.get(t.material.uuid);
19222
19224
  if (i == null)
19223
19225
  return;
19224
- const n = dd(t.material, i);
19226
+ const n = ud(t.material, i);
19225
19227
  Object.keys(n).length !== 0 && e.push({
19226
19228
  id: t.material.uuid,
19227
19229
  name: t.material.name || i.name,
@@ -19238,20 +19240,20 @@ class pd {
19238
19240
  }), e.needsUpdate = !0, !0);
19239
19241
  }
19240
19242
  }
19241
- class gd {
19243
+ class md {
19242
19244
  constructor(e, t = {}) {
19243
19245
  this.engine = e, this.options = {
19244
19246
  visible: t.visible ?? !1,
19245
19247
  title: t.title ?? "材质编辑器",
19246
19248
  width: t.width ?? 340
19247
- }, this.visible = this.options.visible, this.collector = new cd(e), this.snapshots = new pd(() => this.collectSceneMaterials()), this.panel = new ud(e, this);
19249
+ }, this.visible = this.options.visible, this.collector = new hd(e), this.snapshots = new gd(() => this.collectSceneMaterials()), this.panel = new pd(e, this);
19248
19250
  }
19249
19251
  options;
19250
19252
  selectedMaterials = [];
19251
19253
  selectedMaterialId = null;
19252
19254
  targetText = "";
19253
19255
  visible = !1;
19254
- textureLoader = new pt();
19256
+ textureLoader = new gt();
19255
19257
  ownedTextures = /* @__PURE__ */ new Set();
19256
19258
  objectUrls = /* @__PURE__ */ new Set();
19257
19259
  collector;
@@ -19334,7 +19336,7 @@ class gd {
19334
19336
  /** 通过 URL 或 File 修改指定贴图槽;传入 null 时清除贴图。 */
19335
19337
  async setTexture(e, t, i) {
19336
19338
  const n = this.findMaterialGroupById(e);
19337
- if (n.length === 0 || !tt.includes(t))
19339
+ if (n.length === 0 || !it.includes(t))
19338
19340
  return;
19339
19341
  if (n.forEach((r) => this.snapshots.ensure(r, this.collector.findOwners(r))), i == null) {
19340
19342
  n.forEach((r) => this.replaceTexture(r, t, null)), this.render();
@@ -19386,7 +19388,7 @@ class gd {
19386
19388
  dedupeMaterials(e) {
19387
19389
  const t = /* @__PURE__ */ new Map();
19388
19390
  return e.forEach((i) => {
19389
- const n = hd(i.material), s = t.get(n);
19391
+ const n = dd(i.material), s = t.get(n);
19390
19392
  if (s == null) {
19391
19393
  t.set(n, { material: i.material, materials: [i.material], owners: [...i.owners] });
19392
19394
  return;
@@ -19437,16 +19439,16 @@ const Kt = {
19437
19439
  sampleCount: 64,
19438
19440
  roundedRadius: 1,
19439
19441
  historyLimit: 100
19440
- }, md = {
19442
+ }, fd = {
19441
19443
  bezier: "贝塞尔曲线",
19442
19444
  straight: "直线",
19443
19445
  rounded: "圆角直线"
19444
- }, fd = {
19446
+ }, yd = {
19445
19447
  bezier: "∿",
19446
19448
  straight: "╱",
19447
19449
  rounded: "⌁"
19448
19450
  };
19449
- class yd {
19451
+ class vd {
19450
19452
  type = "path-draw";
19451
19453
  engine;
19452
19454
  root = new Pe();
@@ -19812,7 +19814,7 @@ class yd {
19812
19814
  t.append(i, n, s), e.appendChild(t), this.statusElement = n;
19813
19815
  const o = document.createElement("div");
19814
19816
  Object.assign(o.style, { display: "grid", gridTemplateColumns: "repeat(3, 1fr)", gap: "4px", padding: "8px" }), ["bezier", "straight", "rounded"].forEach((w) => {
19815
- const f = this.createIconButton(fd[w], md[w], () => this.setLineType(w));
19817
+ const f = this.createIconButton(yd[w], fd[w], () => this.setLineType(w));
19816
19818
  f.dataset.lineType = w, f.style.width = "100%", f.style.fontSize = "18px", o.appendChild(f);
19817
19819
  }), e.appendChild(o);
19818
19820
  const r = document.createElement("label");
@@ -19930,14 +19932,14 @@ class yd {
19930
19932
  return { x: e.x, y: e.y, z: e.z };
19931
19933
  }
19932
19934
  }
19933
- class vd {
19935
+ class Md {
19934
19936
  engine;
19935
19937
  constructor(e) {
19936
19938
  this.engine = e;
19937
19939
  }
19938
19940
  // 定义一些实用的方法
19939
19941
  }
19940
- class Md {
19942
+ class bd {
19941
19943
  // 引擎本体
19942
19944
  engine;
19943
19945
  // 初始化
@@ -19945,7 +19947,7 @@ class Md {
19945
19947
  this.engine = e;
19946
19948
  }
19947
19949
  }
19948
- class bd {
19950
+ class xd {
19949
19951
  engine;
19950
19952
  constructor(e) {
19951
19953
  this.engine = e;
@@ -19961,7 +19963,7 @@ class bd {
19961
19963
  ];
19962
19964
  }
19963
19965
  }
19964
- class xd {
19966
+ class wd {
19965
19967
  engine;
19966
19968
  constructor(e) {
19967
19969
  this.engine = e;
@@ -20008,9 +20010,9 @@ class ai {
20008
20010
  opacity: 0,
20009
20011
  blending: sr,
20010
20012
  // 反向深度下同位置覆盖层的深度比较可能因精度差异失败,高亮应始终绘制在可见结果之上。
20011
- depthTest: !1,
20013
+ depthTest: !0,
20012
20014
  depthWrite: !1
20013
- }), this.overlayMaterial.clippingPlanes = this.engine.sectionPlane;
20015
+ }), this.overlayMaterial.clippingPlanes = [];
20014
20016
  }
20015
20017
  /**
20016
20018
  * 高亮一个或多个网格,在原模型同位置叠加亮化覆盖层(原模型不受修改)
@@ -20030,7 +20032,7 @@ class ai {
20030
20032
  let o = s.geometry.clone();
20031
20033
  o.computeVertexNormals();
20032
20034
  const r = new V(o, this.overlayMaterial);
20033
- r.renderOrder = 1e3, s.updateWorldMatrix(!0, !1), r.matrix.copy(s.matrixWorld), r.matrixAutoUpdate = !1, this.engine.scene.add(r), this.overlayMeshes.push(r);
20035
+ r.renderOrder = 1e3, s.updateWorldMatrix(!0, !1), r.matrix.copy(s.matrixWorld), r.matrixAutoUpdate = !1, (this.engine.composerModule?.postProcessingOverlayScene ?? this.engine.scene).add(r), this.overlayMeshes.push(r);
20034
20036
  }
20035
20037
  this.animState = "fadeIn", this.animStartTime = performance.now(), this.setAnimationFrameRateExempt(!0);
20036
20038
  }
@@ -20061,7 +20063,7 @@ class ai {
20061
20063
  /** 从场景中移除所有覆盖层(不 dispose geometry,因为与原始 mesh 共享) */
20062
20064
  removeOverlayMeshes() {
20063
20065
  for (const e of this.overlayMeshes)
20064
- this.engine.scene.remove(e), e.geometry?.dispose?.();
20066
+ (this.engine.composerModule?.postProcessingOverlayScene ?? this.engine.scene).remove(e), e.geometry?.dispose?.();
20065
20067
  this.overlayMeshes = [];
20066
20068
  }
20067
20069
  /** 缓出二次方 */
@@ -20073,7 +20075,7 @@ class ai {
20073
20075
  this.setAnimationFrameRateExempt(!1), this.removeOverlayMeshes(), this.overlayMaterial.dispose(), this.tagDiv?.remove?.(), this.tagDiv = null, this.animState = "idle";
20074
20076
  }
20075
20077
  }
20076
- function wd(a) {
20078
+ function Cd(a) {
20077
20079
  const e = a.postProcessing ?? {}, t = (i) => i === !0 || i != null && typeof i == "object" && i.enabled === !0 ? i : !1;
20078
20080
  a.postProcessing = {
20079
20081
  ...e,
@@ -20092,7 +20094,7 @@ function wd(a) {
20092
20094
  }
20093
20095
  };
20094
20096
  }
20095
- class Dd {
20097
+ class _d {
20096
20098
  version = ur;
20097
20099
  options;
20098
20100
  container;
@@ -20188,15 +20190,15 @@ class Dd {
20188
20190
  renderDrawCallsValueEl = null;
20189
20191
  versionEl = null;
20190
20192
  constructor(e) {
20191
- window.THREE = us, oa(), this.options = e, this.container = this.resolveContainer(e), this.rxQuotaListMapper = new _l(this), this.filterLoaderModel = new Cl(this), this.deviceModule = new jr(this), this.deviceModule.isMobile() && wd(this.options), this.cameraModule = new te(this), this.sceneModule = new wl(this), this.scene = this.sceneModule.scene, this.renderModule = new xl(this), this.renderer = this.renderModule.createRenderer(), this.autoExposureModule = new Mr(this), this.camera = this.cameraModule.perspectiveCamera, this.scene.camera = this.camera;
20193
+ window.THREE = us, oa(), this.options = e, this.container = this.resolveContainer(e), this.rxQuotaListMapper = new _l(this), this.filterLoaderModel = new Cl(this), this.deviceModule = new jr(this), this.deviceModule.isMobile() && Cd(this.options), this.cameraModule = new te(this), this.sceneModule = new wl(this), this.scene = this.sceneModule.scene, this.renderModule = new xl(this), this.renderer = this.renderModule.createRenderer(), this.autoExposureModule = new Mr(this), this.camera = this.cameraModule.perspectiveCamera, this.scene.camera = this.camera;
20192
20194
  const t = this.renderer;
20193
- t.interactionCullingEnabled = !0, t.interactionActive = !1, t.interactionRenderScene = this.scene, t.interactionFrameBudgetMs = this.options.interactionFrameBudgetMs ?? 6, t.interactionSkipShadows = this.options.interactionSkipShadows ?? !0, this.controlModule = new Kr(this), this.controlModule.switchDefaultMode(), this.controls = this.controlModule.orbitControls, this.composerModule = new Or(this), this.composerModule.init(), this.engineModelModule = new zl(this), this.clipping = new Cc(this), this.clipping.init(), this.events = new Yr();
20195
+ t.interactionCullingEnabled = !0, t.interactionActive = !1, t.interactionRenderScene = this.scene, t.interactionFrameBudgetMs = this.options.interactionFrameBudgetMs ?? 6, t.interactionSkipShadows = this.options.interactionSkipShadows ?? !0, this.controlModule = new Kr(this), this.controlModule.switchDefaultMode(), this.controls = this.controlModule.orbitControls, this.composerModule = new Or(this), this.composerModule.init(), this.engineModelModule = new zl(this), this.clipping = new Ec(this), this.clipping.init(), this.events = new Yr();
20194
20196
  const i = this.events.trigger.bind(this.events);
20195
20197
  this.events.trigger = ((n, s) => {
20196
20198
  i(n, s), String(n) !== String(se.EngineBusy) && this.requestComposerRender(), this.updateTemporalFrameRateExemption();
20197
- }), this.engineStatus = new El(this), this.engineStatus.init(), this.updateTemporalFrameRateExemption(), this.materialReplacement = new br(this, this.options.materialReplacementOptions), this.materialReplacement.init(), this.loaderModule = new me(this), this.lightModule = new $r(this), this.lightModule.init(), this.engineModelModule.init(), this.initializeVersionDisplay(), this.viewCube = new Tl(this), this.viewCube.init(), this.options.showViewCube === !1 && this.viewCube.hide(), this.octreeBox = Il(this), this.handelBehaved = Qi(this), this.modelToolModule = new yl(this), this.modelProperties = new Dl(this), this.rangeScale = new Ol(this), this.rangeScale.init(), this.setting = new lc(this), this.modelMapperBatch = new Ic(this), this.measure = new yc(this), this.modelLink3d = new Mh(this, this.options.linkOptions ?? {}), this.modelLink3d.init(), this.search = new Tc(this), this.modelEdge = new ic(this), this.events.on(se.LoadingCompleted, () => {
20199
+ }), this.engineStatus = new El(this), this.engineStatus.init(), this.updateTemporalFrameRateExemption(), this.materialReplacement = new br(this, this.options.materialReplacementOptions), this.materialReplacement.init(), this.loaderModule = new me(this), this.lightModule = new $r(this), this.lightModule.init(), this.engineModelModule.init(), this.initializeVersionDisplay(), this.viewCube = new Tl(this), this.viewCube.init(), this.options.showViewCube === !1 && this.viewCube.hide(), this.octreeBox = Il(this), this.handelBehaved = Qi(this), this.modelToolModule = new yl(this), this.modelProperties = new Dl(this), this.rangeScale = new Ol(this), this.rangeScale.init(), this.setting = new cc(this), this.modelMapperBatch = new Dc(this), this.measure = new vc(this), this.modelLink3d = new bh(this, this.options.linkOptions ?? {}), this.modelLink3d.init(), this.search = new Ic(this), this.modelEdge = new nc(this), this.events.on(se.LoadingCompleted, () => {
20198
20200
  this.modelEdge.active(), this.composerModule.markSceneDirty();
20199
- }), this.nodeBox = new kc(this), this.modelTree = new Ec(this), this.viewTree = new en(this), this.merge2d = new eh(this), this.engineInfo = new Sc(this), this.pathRoaming = new zc(this), this.pathRoaming.init(), this.oneClickEncoding = new Uc(this), this.minMap = new Oc(this), this.linkElement2d3d = new Hc(this), this.linkView2d3d = new Vc(this), this.grid = new Hl(this), this.level = new Kl(this), this.issueReport = new Nc(this), this.fabricDraw = new fh(this), this.drawingPin = new yh(this), this.label = new bh(this), this.annotation3d = new id(this), this.calibration = new ht(this), this.modelPlace = new rd(this), this.modelComparison = new ad(this), this.modelExplode = new ld(this), this.materialTool = new gd(this, this.options.materialEditorOptions ?? {}), this.materialTool.init(), this.pathDraw = new yd(this), this.collector = new vd(this), this.modelEditor = new Md(this), this.modelQuantityList = new bd(this), this.roomSpace = new xd(this), this.text = new Fc(this), this.hdr = new ql(this), this.ground = new Zi(this), this.ground.init(), this.skyManager = new ac(this), this.setting.init(), this.interactionModule = new Jr(this), this.interactionModule.init(), this.interactionModule.active(), this.hoverHighLight = new ai(this), this.worldToScreen = new Me(this.camera, this.renderer, this.scene), this.catchSvg = this.createCatchSvg(), this.initializeStats(), this.bindControlEvents(this.controls), this.resizeObserver = typeof ResizeObserver > "u" ? null : new ResizeObserver((n) => {
20201
+ }), this.nodeBox = new Lc(this), this.modelTree = new Sc(this), this.viewTree = new en(this), this.merge2d = new th(this), this.engineInfo = new Ac(this), this.pathRoaming = new Oc(this), this.pathRoaming.init(), this.oneClickEncoding = new qc(this), this.minMap = new Nc(this), this.linkElement2d3d = new Vc(this), this.linkView2d3d = new Uc(this), this.grid = new Hl(this), this.level = new jl(this), this.issueReport = new Fc(this), this.fabricDraw = new yh(this), this.drawingPin = new vh(this), this.label = new xh(this), this.annotation3d = new nd(this), this.calibration = new dt(this), this.modelPlace = new ad(this), this.modelComparison = new ld(this), this.modelExplode = new cd(this), this.materialTool = new md(this, this.options.materialEditorOptions ?? {}), this.materialTool.init(), this.pathDraw = new vd(this), this.collector = new Md(this), this.modelEditor = new bd(this), this.modelQuantityList = new xd(this), this.roomSpace = new wd(this), this.text = new Hc(this), this.hdr = new Gl(this), this.ground = new Zi(this), this.ground.init(), this.skyManager = new lc(this), this.setting.init(), this.interactionModule = new Jr(this), this.interactionModule.init(), this.interactionModule.active(), this.hoverHighLight = new ai(this), this.worldToScreen = new Me(this.camera, this.renderer, this.scene), this.catchSvg = this.createCatchSvg(), this.initializeStats(), this.bindControlEvents(this.controls), this.resizeObserver = typeof ResizeObserver > "u" ? null : new ResizeObserver((n) => {
20200
20202
  const s = n[0];
20201
20203
  s && this.handleWindowResize(s.contentRect.width, s.contentRect.height);
20202
20204
  }), this.resizeObserver?.observe(this.container), this.ready = this.initialize().catch((n) => {
@@ -20376,5 +20378,5 @@ class Dd {
20376
20378
  }
20377
20379
  }
20378
20380
  export {
20379
- Dd as EngineKernelV3
20381
+ _d as EngineKernelV3
20380
20382
  };