@tresjs/core 4.2.0 → 4.2.2

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.
package/dist/tres.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * name: @tresjs/core
3
- * version: v4.2.0
3
+ * version: v4.2.2
4
4
  * (c) 2024
5
5
  * description: Declarative ThreeJS using Vue Components
6
6
  * author: Alvaro Saburido <hola@alvarosaburido.dev> (https://github.com/alvarosabu/)
@@ -8,11 +8,11 @@
8
8
  var bt = Object.defineProperty;
9
9
  var Pt = (e, t, n) => t in e ? bt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
10
10
  var me = (e, t, n) => Pt(e, typeof t != "symbol" ? t + "" : t, n);
11
- import { ref as I, computed as Y, watchEffect as Te, onUnmounted as Q, shallowRef as H, watch as le, readonly as ye, unref as K, provide as _e, inject as Mt, isRef as Ct, reactive as Et, defineComponent as Be, useSlots as Tt, getCurrentInstance as Ie, onMounted as St, openBlock as At, createElementBlock as kt, normalizeClass as xt, normalizeStyle as Lt, createRenderer as Rt, h as He, Fragment as Ot } from "vue";
11
+ import { ref as H, computed as V, watchEffect as Te, onUnmounted as K, shallowRef as $, watch as le, readonly as ye, unref as J, provide as _e, inject as Ct, isRef as Mt, reactive as Et, defineComponent as Be, useSlots as Tt, getCurrentInstance as Ie, onMounted as St, openBlock as At, createElementBlock as kt, normalizeClass as xt, normalizeStyle as Lt, createRenderer as Rt, h as He, Fragment as Ot } from "vue";
12
12
  import * as et from "three";
13
13
  import { PerspectiveCamera as we, Camera as Dt, Clock as tt, Vector3 as Se, Color as ce, Scene as nt, MathUtils as rt, MeshBasicMaterial as ot, DoubleSide as jt, REVISION as Bt, SRGBColorSpace as It, ACESFilmicToneMapping as st, PCFSoftShadowMap as Ht, NoToneMapping as $t, WebGLRenderer as he, TextureLoader as Ut, Vector2 as ge, Raycaster as Ft, BufferAttribute as Wt, Object3D as Nt, Line as zt, BufferGeometry as $e, Float32BufferAttribute as Ue, LineBasicMaterial as Gt, Mesh as Vt, BackSide as Yt, DirectionalLightHelper as qt, PointLightHelper as Jt, SpotLightHelper as Kt, HemisphereLightHelper as Qt, ArrowHelper as Xt } from "three";
14
14
  import { createEventHook as j, useRafFn as it, toValue as k, unrefElement as Zt, useDevicePixelRatio as en, usePointer as tn, useElementBounding as nn, useWindowSize as rn, useElementSize as on, refDebounced as Fe, tryOnScopeDispose as sn, useFps as an, useMemory as ln } from "@vueuse/core";
15
- const cn = "@tresjs/core", un = "module", fn = "4.2.0", dn = "pnpm@9.1.4", pn = "Declarative ThreeJS using Vue Components", mn = "Alvaro Saburido <hola@alvarosaburido.dev> (https://github.com/alvarosabu/)", hn = "MIT", gn = [
15
+ const cn = "@tresjs/core", un = "module", fn = "4.2.2", dn = "pnpm@9.1.4", pn = "Declarative ThreeJS using Vue Components", mn = "Alvaro Saburido <hola@alvarosaburido.dev> (https://github.com/alvarosabu/)", hn = "MIT", gn = [
16
16
  "vue",
17
17
  "3d",
18
18
  "threejs",
@@ -40,9 +40,9 @@ const cn = "@tresjs/core", un = "module", fn = "4.2.0", dn = "pnpm@9.1.4", pn =
40
40
  }, _n = "./dist/tres.js", wn = "./dist/tres.js", bn = "./dist/index.d.ts", Pn = [
41
41
  "*.d.ts",
42
42
  "dist"
43
- ], Mn = {
43
+ ], Cn = {
44
44
  access: "public"
45
- }, Cn = {
45
+ }, Mn = {
46
46
  dev: "cd playground && npm run dev",
47
47
  build: "vite build",
48
48
  playground: "cd playground && npm run dev",
@@ -122,8 +122,8 @@ const cn = "@tresjs/core", un = "module", fn = "4.2.0", dn = "pnpm@9.1.4", pn =
122
122
  module: wn,
123
123
  types: bn,
124
124
  files: Pn,
125
- publishConfig: Mn,
126
- scripts: Cn,
125
+ publishConfig: Cn,
126
+ scripts: Mn,
127
127
  peerDependencies: En,
128
128
  dependencies: Tn,
129
129
  devDependencies: Sn
@@ -140,11 +140,11 @@ function kn(e) {
140
140
  function at(e) {
141
141
  return typeof e == "string";
142
142
  }
143
- function V(e) {
143
+ function G(e) {
144
144
  return typeof e == "function";
145
145
  }
146
146
  function N(e) {
147
- return e === Object(e) && !de(e) && !V(e);
147
+ return e === Object(e) && !de(e) && !G(e);
148
148
  }
149
149
  function W(e) {
150
150
  return N(e) && "isObject3D" in e && !!e.isObject3D;
@@ -171,7 +171,7 @@ function Dn(e) {
171
171
  return N(e) && !!e.isPrimitive;
172
172
  }
173
173
  const jn = ({ sizes: e }) => {
174
- const t = I([]), n = Y(
174
+ const t = H([]), n = V(
175
175
  () => t.value[0]
176
176
  ), r = (i) => {
177
177
  const l = i instanceof Dt ? i : t.value.find((o) => o.uuid === i);
@@ -196,7 +196,7 @@ const jn = ({ sizes: e }) => {
196
196
  e.aspectRatio.value && t.value.forEach((i) => {
197
197
  !i.manual && (i instanceof we || Bn(i)) && (i instanceof we ? i.aspect = e.aspectRatio.value : (i.left = e.width.value * -0.5, i.right = e.width.value * 0.5, i.top = e.height.value * 0.5, i.bottom = e.height.value * -0.5), i.updateProjectionMatrix());
198
198
  });
199
- }), Q(() => {
199
+ }), K(() => {
200
200
  t.value = [];
201
201
  }), {
202
202
  camera: n,
@@ -209,16 +209,16 @@ const jn = ({ sizes: e }) => {
209
209
  function Bn(e) {
210
210
  return e.hasOwnProperty("isOrthographicCamera") && e.isOrthographicCamera;
211
211
  }
212
- const lt = j(), ct = j(), Ae = j(), ee = new tt();
212
+ const lt = j(), ct = j(), Ae = j(), Z = new tt();
213
213
  let ue = 0, fe = 0;
214
214
  const { pause: In, resume: Ne, isActive: Hn } = it(
215
215
  () => {
216
- lt.trigger({ delta: ue, elapsed: fe, clock: ee }), ct.trigger({ delta: ue, elapsed: fe, clock: ee }), Ae.trigger({ delta: ue, elapsed: fe, clock: ee });
216
+ lt.trigger({ delta: ue, elapsed: fe, clock: Z }), ct.trigger({ delta: ue, elapsed: fe, clock: Z }), Ae.trigger({ delta: ue, elapsed: fe, clock: Z });
217
217
  },
218
218
  { immediate: !1 }
219
219
  );
220
220
  Ae.on(() => {
221
- ue = ee.getDelta(), fe = ee.getElapsedTime();
221
+ ue = Z.getDelta(), fe = Z.getElapsedTime();
222
222
  });
223
223
  let ze = !1;
224
224
  const $r = () => (ze || (ze = !0, Ne()), {
@@ -229,7 +229,7 @@ const $r = () => (ze || (ze = !0, Ne()), {
229
229
  resume: Ne,
230
230
  isActive: Hn
231
231
  }), Ur = !0, oe = "[TresJS ▲ ■ ●] ";
232
- function z() {
232
+ function Y() {
233
233
  function e(...r) {
234
234
  typeof r[0] == "string" ? r[0] = oe + r[0] : r.unshift(oe), console.error(...r);
235
235
  }
@@ -323,9 +323,9 @@ function Jn(e, t, n, r) {
323
323
  if (c.uuid === t)
324
324
  return c;
325
325
  for (const o of c.children) {
326
- const f = s(o);
327
- if (f)
328
- return f;
326
+ const u = s(o);
327
+ if (u)
328
+ return u;
329
329
  }
330
330
  }, a = s(e);
331
331
  if (!a) {
@@ -402,12 +402,12 @@ function er(e, t, n) {
402
402
  if (!Array.isArray(i[l])) {
403
403
  const c = i[l], o = [];
404
404
  o.__tresDetach = () => {
405
- o.every((f) => be(f)) && (i[l] = c);
405
+ o.every((u) => be(u)) && (i[l] = c);
406
406
  }, i[l] = o;
407
407
  }
408
408
  }
409
409
  const { target: r, key: s } = Pe(e, n);
410
- t.__tres.previousAttach = r[s], r[s] = X(t);
410
+ t.__tres.previousAttach = r[s], r[s] = Q(t);
411
411
  } else
412
412
  t.__tres.previousAttach = n(e, t);
413
413
  }
@@ -420,7 +420,7 @@ function tr(e, t, n) {
420
420
  (s = (r = t.__tres) == null ? void 0 : r.previousAttach) == null || s.call(r, e, t);
421
421
  (a = t.__tres) == null || delete a.previousAttach;
422
422
  }
423
- function G(e, t, n) {
423
+ function z(e, t, n) {
424
424
  const r = e;
425
425
  return r.__tres = {
426
426
  type: "unknown",
@@ -441,7 +441,7 @@ function pt(e) {
441
441
  }
442
442
  function nr(e, t, n) {
443
443
  var s;
444
- if (!V(e.setPixelRatio))
444
+ if (!G(e.setPixelRatio))
445
445
  return;
446
446
  let r = 0;
447
447
  if (de(n) && n.length >= 2) {
@@ -451,28 +451,28 @@ function nr(e, t, n) {
451
451
  r !== ((s = e.getPixelRatio) == null ? void 0 : s.call(e)) && e.setPixelRatio(r);
452
452
  }
453
453
  function rr(e, t, n, r, s) {
454
- const a = [...t.__tres.objects], i = X(t);
455
- if (e = X(e), i === e)
454
+ const a = [...t.__tres.objects], i = Q(t);
455
+ if (e = Q(e), i === e)
456
456
  return !0;
457
- const l = G(e, t.__tres ?? {}, s), c = t.parent ?? t.__tres.parent ?? null, o = { ...t.__tres.memoizedProps };
457
+ const l = z(e, t.__tres ?? {}, s), c = t.parent ?? t.__tres.parent ?? null, o = { ...t.__tres.memoizedProps };
458
458
  delete o.object;
459
- for (const f of a)
460
- mt(f, s), ht(f, s);
459
+ for (const u of a)
460
+ mt(u, s), ht(u, s);
461
461
  i.__tres.objects = [], r.remove(t);
462
- for (const [f, v] of Object.entries(o))
463
- r.patchProp(l, f, l[f], v);
462
+ for (const [u, y] of Object.entries(o))
463
+ r.patchProp(l, u, l[u], y);
464
464
  n(e), r.insert(t, c);
465
- for (const f of a)
466
- r.insert(f, t);
465
+ for (const u of a)
466
+ r.insert(u, t);
467
467
  return !0;
468
468
  }
469
- function X(e) {
469
+ function Q(e) {
470
470
  return Dn(e) ? (e.object.__tres = e.__tres, e.object) : e;
471
471
  }
472
472
  function mt(e, t) {
473
473
  var r, s, a, i;
474
474
  const n = ((r = e.__tres) == null ? void 0 : r.parent) || t.scene.value;
475
- e.__tres && (e.__tres.parent = null), n && n.__tres && "objects" in n.__tres && Zn(n.__tres.objects, (l) => l !== e), (s = e.__tres) != null && s.attach ? tr(n, e, e.__tres.attach) : ((i = (a = e.parent) == null ? void 0 : a.remove) == null || i.call(a, X(e)), e.parent = null);
475
+ e.__tres && (e.__tres.parent = null), n && n.__tres && "objects" in n.__tres && Zn(n.__tres.objects, (l) => l !== e), (s = e.__tres) != null && s.attach ? tr(n, e, e.__tres.attach) : ((i = (a = e.parent) == null ? void 0 : a.remove) == null || i.call(a, Q(e)), e.parent = null);
476
476
  }
477
477
  function ht(e, t) {
478
478
  var n;
@@ -503,7 +503,7 @@ function sr({
503
503
  options: t,
504
504
  contextParts: { sizes: n, render: r, invalidate: s, advance: a }
505
505
  }) {
506
- const i = Y(() => ({
506
+ const i = V(() => ({
507
507
  alpha: k(t.alpha) ?? !0,
508
508
  depth: k(t.depth),
509
509
  canvas: Zt(e),
@@ -516,7 +516,7 @@ function sr({
516
516
  preserveDrawingBuffer: k(t.preserveDrawingBuffer),
517
517
  logarithmicDepthBuffer: k(t.logarithmicDepthBuffer),
518
518
  failIfMajorPerformanceCaveat: k(t.failIfMajorPerformanceCaveat)
519
- })), l = H(new he(i.value));
519
+ })), l = $(new he(i.value));
520
520
  function c() {
521
521
  t.renderMode === "on-demand" && s();
522
522
  }
@@ -527,40 +527,40 @@ function sr({
527
527
  }, {
528
528
  immediate: !0
529
529
  }), le(() => t.clearColor, c);
530
- const { pixelRatio: o } = en(), { logError: f } = z(), u = (() => {
531
- const p = new he(), P = {
530
+ const { pixelRatio: o } = en(), { logError: u } = Y(), f = (() => {
531
+ const v = new he(), b = {
532
532
  shadowMap: {
533
- enabled: p.shadowMap.enabled,
534
- type: p.shadowMap.type
533
+ enabled: v.shadowMap.enabled,
534
+ type: v.shadowMap.type
535
535
  },
536
- toneMapping: p.toneMapping,
537
- toneMappingExposure: p.toneMappingExposure,
538
- outputColorSpace: p.outputColorSpace
536
+ toneMapping: v.toneMapping,
537
+ toneMappingExposure: v.toneMappingExposure,
538
+ outputColorSpace: v.outputColorSpace
539
539
  };
540
- return p.dispose(), P;
541
- })(), _ = k(t.renderMode);
542
- return _ === "on-demand" && s(), _ === "manual" && setTimeout(() => {
540
+ return v.dispose(), b;
541
+ })(), g = k(t.renderMode);
542
+ return g === "on-demand" && s(), g === "manual" && setTimeout(() => {
543
543
  a();
544
544
  }, 100), Te(() => {
545
- const p = k(t.preset);
546
- p && (p in ie || f(`Renderer Preset must be one of these: ${Object.keys(ie).join(", ")}`), ut(l.value, ie[p])), nr(l.value, o.value, k(t.dpr)), _ === "always" && (r.frames.value = Math.max(1, r.frames.value));
547
- const P = (g, E) => {
548
- const C = k(g), T = () => {
549
- if (p)
550
- return Ve(ie[p], E);
545
+ const v = k(t.preset);
546
+ v && (v in ie || u(`Renderer Preset must be one of these: ${Object.keys(ie).join(", ")}`), ut(l.value, ie[v])), nr(l.value, o.value, k(t.dpr)), g === "always" && (r.frames.value = Math.max(1, r.frames.value));
547
+ const b = (M, E) => {
548
+ const P = k(M), S = () => {
549
+ if (v)
550
+ return Ve(ie[v], E);
551
551
  };
552
- if (C !== void 0)
553
- return C;
554
- const M = T();
555
- return M !== void 0 ? M : Ve(u, E);
556
- }, m = (g, E) => Vn(l.value, E, P(g, E));
552
+ if (P !== void 0)
553
+ return P;
554
+ const C = S();
555
+ return C !== void 0 ? C : Ve(f, E);
556
+ }, m = (M, E) => Vn(l.value, E, b(M, E));
557
557
  m(t.shadows, "shadowMap.enabled"), m(t.toneMapping ?? st, "toneMapping"), m(t.shadowMapType, "shadowMap.type"), or < 150 && m(!t.useLegacyLights, "physicallyCorrectLights"), m(t.outputColorSpace, "outputColorSpace"), m(t.toneMappingExposure, "toneMappingExposure");
558
- const y = P(t.clearColor, "clearColor");
559
- y && l.value.setClearColor(
560
- y ? $n(y) : new ce(0)
558
+ const d = b(t.clearColor, "clearColor");
559
+ d && l.value.setClearColor(
560
+ d ? $n(d) : new ce(0)
561
561
  // default clear color is not easily/efficiently retrievable from three
562
562
  );
563
- }), Q(() => {
563
+ }), K(() => {
564
564
  l.value.dispose(), l.value.forceContextLoss();
565
565
  }), {
566
566
  renderer: l
@@ -574,17 +574,18 @@ function ar(e) {
574
574
  }), t;
575
575
  }
576
576
  async function Wr(e, t, n, r, s) {
577
- const { logError: a } = z(), i = new e();
577
+ const { logError: a } = Y(), i = new e();
578
578
  s && s(i), n && n(i);
579
579
  const c = (Array.isArray(t) ? t : [t]).map(
580
- (o) => new Promise((f, v) => {
580
+ (o) => new Promise((u, y) => {
581
581
  i.load(
582
582
  o,
583
- (u) => {
584
- u.scene && Object.assign(u, ar(u.scene)), f(u);
583
+ (f) => {
584
+ const g = f;
585
+ g.scene && Object.assign(g, ar(g.scene)), u(g);
585
586
  },
586
587
  r,
587
- (u) => v(a("[useLoader] - Failed to load resource", u))
588
+ (f) => y(a("[useLoader] - Failed to load resource", f))
588
589
  );
589
590
  })
590
591
  );
@@ -612,8 +613,8 @@ async function Nr(e, t) {
612
613
  roughnessMap: l,
613
614
  metalnessMap: c,
614
615
  aoMap: o,
615
- alphaMap: f,
616
- matcap: v
616
+ alphaMap: u,
617
+ matcap: y
617
618
  } = e;
618
619
  return {
619
620
  map: s ? await r(s) : null,
@@ -622,39 +623,39 @@ async function Nr(e, t) {
622
623
  roughnessMap: l ? await r(l) : null,
623
624
  metalnessMap: c ? await r(c) : null,
624
625
  aoMap: o ? await r(o) : null,
625
- alphaMap: f ? await r(f) : null,
626
- matcap: v ? await r(v) : null
626
+ alphaMap: u ? await r(u) : null,
627
+ matcap: y ? await r(y) : null
627
628
  };
628
629
  }
629
630
  }
630
631
  const lr = (e, t) => {
631
- const n = Y(() => t.renderer.value.domElement), r = H([]), { x: s, y: a } = tn({ target: n });
632
+ const n = V(() => t.renderer.value.domElement), r = $([]), { x: s, y: a } = tn({ target: n });
632
633
  let i = 0;
633
- const { width: l, height: c, top: o, left: f } = nn(n), v = ({ x: h, y: S }) => {
634
+ const { width: l, height: c, top: o, left: u } = nn(n), y = ({ x: h, y: T }) => {
634
635
  if (n.value)
635
636
  return {
636
- x: (h - f.value) / l.value * 2 - 1,
637
- y: -((S - o.value) / c.value) * 2 + 1
637
+ x: (h - u.value) / l.value * 2 - 1,
638
+ y: -((T - o.value) / c.value) * 2 + 1
638
639
  };
639
- }, u = ({ x: h, y: S }) => {
640
+ }, f = ({ x: h, y: T }) => {
640
641
  if (t.camera.value)
641
- return t.raycaster.value.setFromCamera(new ge(h, S), t.camera.value), r.value = t.raycaster.value.intersectObjects(e.value, !0), r.value;
642
- }, _ = (h) => {
643
- const S = v({
642
+ return t.raycaster.value.setFromCamera(new ge(h, T), t.camera.value), r.value = t.raycaster.value.intersectObjects(e.value, !0), r.value;
643
+ }, g = (h) => {
644
+ const T = y({
644
645
  x: (h == null ? void 0 : h.clientX) ?? s.value,
645
646
  y: (h == null ? void 0 : h.clientY) ?? a.value
646
647
  });
647
- return S ? u(S) || [] : [];
648
- }, p = j(), P = j(), m = j(), y = j(), g = j(), E = j(), C = j(), T = j();
649
- function M(h) {
650
- const S = {};
648
+ return T ? f(T) || [] : [];
649
+ }, v = j(), b = j(), m = j(), d = j(), M = j(), E = j(), P = j(), S = j();
650
+ function C(h) {
651
+ const T = {};
651
652
  for (const U in h)
652
- typeof U != "function" && (S[U] = h[U]);
653
- return S;
653
+ typeof U != "function" && (T[U] = h[U]);
654
+ return T;
654
655
  }
655
- const w = (h, S) => {
656
+ const _ = (h, T) => {
656
657
  var Oe, De, je;
657
- const U = M(S), ne = new Se(S == null ? void 0 : S.clientX, S == null ? void 0 : S.clientY, 0).unproject((Oe = t.camera) == null ? void 0 : Oe.value);
658
+ const U = C(T), ne = new Se(T == null ? void 0 : T.clientX, T == null ? void 0 : T.clientY, 0).unproject((Oe = t.camera) == null ? void 0 : Oe.value);
658
659
  h.trigger({
659
660
  ...U,
660
661
  intersections: r.value,
@@ -662,52 +663,52 @@ const lr = (e, t) => {
662
663
  unprojectedPoint: ne,
663
664
  ray: (De = t.raycaster) == null ? void 0 : De.value.ray,
664
665
  camera: (je = t.camera) == null ? void 0 : je.value,
665
- sourceEvent: S,
666
+ sourceEvent: T,
666
667
  delta: i,
667
668
  stopPropagating: !1
668
669
  });
669
670
  };
670
671
  let L;
671
672
  const x = (h) => {
672
- _(h), w(m, h), L = h;
673
- }, d = () => {
673
+ g(h), _(m, h), L = h;
674
+ }, p = () => {
674
675
  L && x(L);
675
676
  };
676
- let b, A, D;
677
- const $ = (h) => {
678
- var S;
679
- b = (S = r.value[0]) == null ? void 0 : S.object, i = 0, A = new ge(
677
+ let w, A, D;
678
+ const O = (h) => {
679
+ var T;
680
+ w = (T = r.value[0]) == null ? void 0 : T.object, i = 0, A = new ge(
680
681
  (h == null ? void 0 : h.clientX) ?? s.value,
681
682
  (h == null ? void 0 : h.clientY) ?? a.value
682
- ), w(g, h);
683
+ ), _(M, h);
683
684
  };
684
- let R, O = !1;
685
- const q = (h) => {
686
- var S, U, ne;
687
- h instanceof PointerEvent && (r.value.length === 0 && w(E, h), b === ((S = r.value[0]) == null ? void 0 : S.object) && (D = new ge(
685
+ let B, R = !1;
686
+ const te = (h) => {
687
+ var T, U, ne;
688
+ h instanceof PointerEvent && (r.value.length === 0 && _(E, h), w === ((T = r.value[0]) == null ? void 0 : T.object) && (D = new ge(
688
689
  (h == null ? void 0 : h.clientX) ?? s.value,
689
690
  (h == null ? void 0 : h.clientY) ?? a.value
690
- ), i = A == null ? void 0 : A.distanceTo(D), h.button === 0 ? (w(p, h), R === ((U = r.value[0]) == null ? void 0 : U.object) ? O = !0 : (R = (ne = r.value[0]) == null ? void 0 : ne.object, O = !1)) : h.button === 2 && w(C, h)), w(y, h));
691
+ ), i = A == null ? void 0 : A.distanceTo(D), h.button === 0 ? (_(v, h), B === ((U = r.value[0]) == null ? void 0 : U.object) ? R = !0 : (B = (ne = r.value[0]) == null ? void 0 : ne.object, R = !1)) : h.button === 2 && _(P, h)), _(d, h));
691
692
  }, xe = (h) => {
692
- O && (w(P, h), R = void 0, O = !1);
693
- }, Le = (h) => w(m, h), Re = (h) => w(T, h);
694
- return n.value.addEventListener("pointerup", q), n.value.addEventListener("pointerdown", $), n.value.addEventListener("pointermove", x), n.value.addEventListener("pointerleave", Le), n.value.addEventListener("dblclick", xe), n.value.addEventListener("wheel", Re), Q(() => {
695
- n != null && n.value && (n.value.removeEventListener("pointerup", q), n.value.removeEventListener("pointerdown", $), n.value.removeEventListener("pointermove", x), n.value.removeEventListener("pointerleave", Le), n.value.removeEventListener("dblclick", xe), n.value.removeEventListener("wheel", Re));
693
+ R && (_(b, h), B = void 0, R = !1);
694
+ }, Le = (h) => _(m, h), Re = (h) => _(S, h);
695
+ return n.value.addEventListener("pointerup", te), n.value.addEventListener("pointerdown", O), n.value.addEventListener("pointermove", x), n.value.addEventListener("pointerleave", Le), n.value.addEventListener("dblclick", xe), n.value.addEventListener("wheel", Re), K(() => {
696
+ n != null && n.value && (n.value.removeEventListener("pointerup", te), n.value.removeEventListener("pointerdown", O), n.value.removeEventListener("pointermove", x), n.value.removeEventListener("pointerleave", Le), n.value.removeEventListener("dblclick", xe), n.value.removeEventListener("wheel", Re));
696
697
  }), {
697
698
  intersects: r,
698
- onClick: (h) => p.on(h).off,
699
- onDblClick: (h) => P.on(h).off,
700
- onContextMenu: (h) => C.on(h).off,
699
+ onClick: (h) => v.on(h).off,
700
+ onDblClick: (h) => b.on(h).off,
701
+ onContextMenu: (h) => P.on(h).off,
701
702
  onPointerMove: (h) => m.on(h).off,
702
- onPointerUp: (h) => y.on(h).off,
703
- onPointerDown: (h) => g.on(h).off,
703
+ onPointerUp: (h) => d.on(h).off,
704
+ onPointerDown: (h) => M.on(h).off,
704
705
  onPointerMissed: (h) => E.on(h).off,
705
- onWheel: (h) => T.on(h).off,
706
- forceUpdate: d
706
+ onWheel: (h) => S.on(h).off,
707
+ forceUpdate: p
707
708
  };
708
709
  };
709
710
  function zr() {
710
- const { logWarning: e } = z();
711
+ const { logWarning: e } = Y();
711
712
  function t(a, i, l) {
712
713
  let c = null;
713
714
  return a.traverse((o) => {
@@ -745,102 +746,102 @@ function ke(e) {
745
746
  function cr(e) {
746
747
  return (e / 1024).toFixed(2);
747
748
  }
748
- const Me = I({}), Ce = (e) => Object.assign(Me.value, e);
749
+ const Ce = H({}), Me = (e) => Object.assign(Ce.value, e);
749
750
  function ur(e, t, n) {
750
751
  var x;
751
- const r = H(), s = H();
752
+ const r = $(), s = $();
752
753
  e && (r.value = e), t && (s.value = t);
753
- const a = (d) => {
754
- var b;
755
- return ((b = d.__tres) == null ? void 0 : b.eventCount) > 0;
756
- }, i = (d) => {
757
- var b;
758
- return ((b = d.children) == null ? void 0 : b.some((A) => i(A))) || a(d);
759
- }, l = H(((x = r.value) == null ? void 0 : x.children).filter(i) || []);
760
- function c(d, b) {
761
- if (Array.isArray(d))
762
- for (const A of d)
763
- A(b);
764
- typeof d == "function" && d(b);
754
+ const a = (p) => {
755
+ var w;
756
+ return ((w = p.__tres) == null ? void 0 : w.eventCount) > 0;
757
+ }, i = (p) => {
758
+ var w;
759
+ return ((w = p.children) == null ? void 0 : w.some((A) => i(A))) || a(p);
760
+ }, l = $(((x = r.value) == null ? void 0 : x.children).filter(i) || []);
761
+ function c(p, w) {
762
+ if (Array.isArray(p))
763
+ for (const A of p)
764
+ A(w);
765
+ typeof p == "function" && p(w);
765
766
  }
766
- function o(d, b) {
767
- const A = [], D = () => b.stopPropagating = !0;
768
- b.stopPropagation = D;
769
- for (const $ of b == null ? void 0 : b.intersections) {
770
- if (b.stopPropagating)
767
+ function o(p, w) {
768
+ const A = [], D = () => w.stopPropagating = !0;
769
+ w.stopPropagation = D;
770
+ for (const O of w == null ? void 0 : w.intersections) {
771
+ if (w.stopPropagating)
771
772
  return;
772
- b = { ...b, ...$ };
773
- const { object: R } = $;
774
- b.eventObject = R, c(R[d], b), A.push(R);
775
- let O = R.parent;
776
- for (; O !== null && !b.stopPropagating && !A.includes(O); )
777
- b.eventObject = O, c(O[d], b), A.push(O), O = O.parent;
778
- const q = zn(d.slice(2));
779
- n(q, { intersection: $, event: b });
773
+ w = { ...w, ...O };
774
+ const { object: B } = O;
775
+ w.eventObject = B, c(B[p], w), A.push(B);
776
+ let R = B.parent;
777
+ for (; R !== null && !w.stopPropagating && !A.includes(R); )
778
+ w.eventObject = R, c(R[p], w), A.push(R), R = R.parent;
779
+ const te = zn(p.slice(2));
780
+ n(te, { intersection: O, event: w });
780
781
  }
781
782
  }
782
783
  const {
783
- onClick: f,
784
- onDblClick: v,
785
- onContextMenu: u,
786
- onPointerMove: _,
787
- onPointerDown: p,
788
- onPointerUp: P,
784
+ onClick: u,
785
+ onDblClick: y,
786
+ onContextMenu: f,
787
+ onPointerMove: g,
788
+ onPointerDown: v,
789
+ onPointerUp: b,
789
790
  onPointerMissed: m,
790
- onWheel: y,
791
- forceUpdate: g
791
+ onWheel: d,
792
+ forceUpdate: M
792
793
  } = lr(l, t);
793
- P((d) => o("onPointerUp", d)), p((d) => o("onPointerDown", d)), f((d) => o("onClick", d)), v((d) => o("onDoubleClick", d)), u((d) => o("onContextMenu", d)), y((d) => o("onWheel", d));
794
+ b((p) => o("onPointerUp", p)), v((p) => o("onPointerDown", p)), u((p) => o("onClick", p)), y((p) => o("onDoubleClick", p)), f((p) => o("onContextMenu", p)), d((p) => o("onWheel", p));
794
795
  let E = [];
795
- _((d) => {
796
- const b = d.intersections.map(({ object: D }) => D), A = d.intersections;
796
+ g((p) => {
797
+ const w = p.intersections.map(({ object: D }) => D), A = p.intersections;
797
798
  E.forEach(({ object: D }) => {
798
- b.includes(D) || (d.intersections = E, o("onPointerLeave", d), o("onPointerOut", d));
799
- }), d.intersections = A, d.intersections.forEach(({ object: D }) => {
800
- E.includes(D) || (o("onPointerEnter", d), o("onPointerOver", d));
801
- }), o("onPointerMove", d), E = d.intersections;
799
+ w.includes(D) || (p.intersections = E, o("onPointerLeave", p), o("onPointerOut", p));
800
+ }), p.intersections = A, p.intersections.forEach(({ object: D }) => {
801
+ E.includes(D) || (o("onPointerEnter", p), o("onPointerOver", p));
802
+ }), o("onPointerMove", p), E = p.intersections;
802
803
  });
803
- const C = [];
804
- m((d) => {
805
- const b = () => d.stopPropagating = !0;
806
- d.stopPropagation = b, C.forEach((A) => {
807
- d.stopPropagating || (d.eventObject = A, c(A.onPointerMissed, d));
808
- }), n("pointer-missed", { event: d });
804
+ const P = [];
805
+ m((p) => {
806
+ const w = () => p.stopPropagating = !0;
807
+ p.stopPropagation = w, P.forEach((A) => {
808
+ p.stopPropagating || (p.eventObject = A, c(A.onPointerMissed, p));
809
+ }), n("pointer-missed", { event: p });
809
810
  });
810
- function T(d) {
811
- re(d) && W(d) && l.value.push(d);
811
+ function S(p) {
812
+ re(p) && W(p) && l.value.push(p);
812
813
  }
813
- function M(d) {
814
- if (re(d) && W(d)) {
815
- const b = l.value.indexOf(d);
816
- b > -1 && l.value.splice(b, 1);
814
+ function C(p) {
815
+ if (re(p) && W(p)) {
816
+ const w = l.value.indexOf(p);
817
+ w > -1 && l.value.splice(w, 1);
817
818
  }
818
819
  }
819
- function w(d) {
820
- re(d) && W(d) && d.onPointerMissed && C.push(d);
820
+ function _(p) {
821
+ re(p) && W(p) && p.onPointerMissed && P.push(p);
821
822
  }
822
- function L(d) {
823
- if (re(d) && W(d)) {
824
- const b = C.indexOf(d);
825
- b > -1 && C.splice(b, 1);
823
+ function L(p) {
824
+ if (re(p) && W(p)) {
825
+ const w = P.indexOf(p);
826
+ w > -1 && P.splice(w, 1);
826
827
  }
827
828
  }
828
829
  return t.eventManager = {
829
- forceUpdate: g,
830
- registerObject: T,
831
- deregisterObject: M,
832
- registerPointerMissedObject: w,
830
+ forceUpdate: M,
831
+ registerObject: S,
832
+ deregisterObject: C,
833
+ registerPointerMissedObject: _,
833
834
  deregisterPointerMissedObject: L
834
835
  }, {
835
- forceUpdate: g,
836
- registerObject: T,
837
- deregisterObject: M,
838
- registerPointerMissedObject: w,
836
+ forceUpdate: M,
837
+ registerObject: S,
838
+ deregisterObject: C,
839
+ registerPointerMissedObject: _,
839
840
  deregisterPointerMissedObject: L
840
841
  };
841
842
  }
842
843
  function fr(e, t, n = 10) {
843
- const r = k(e) ? rn() : on(Y(() => k(t).parentElement)), s = ye(Fe(r.width, n)), a = ye(Fe(r.height, n)), i = Y(() => s.value / a.value);
844
+ const r = k(e) ? rn() : on(V(() => k(t).parentElement)), s = ye(Fe(r.width, n)), a = ye(Fe(r.height, n)), i = V(() => s.value / a.value);
844
845
  return {
845
846
  height: a,
846
847
  width: s,
@@ -851,22 +852,22 @@ function ve() {
851
852
  const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Set();
852
853
  let n = 0, r = !1;
853
854
  const s = () => {
854
- const o = Array.from(e.entries()).sort((f, v) => {
855
- const u = f[1].priority - v[1].priority;
856
- return u === 0 ? f[1].addI - v[1].addI : u;
855
+ const o = Array.from(e.entries()).sort((u, y) => {
856
+ const f = u[1].priority - y[1].priority;
857
+ return f === 0 ? u[1].addI - y[1].addI : f;
857
858
  });
858
- t.clear(), o.forEach((f) => t.add(f[0]));
859
+ t.clear(), o.forEach((u) => t.add(u[0]));
859
860
  }, a = (o) => {
860
861
  e.delete(o), t.delete(o);
861
862
  };
862
- return { on: (o, f = 0) => {
863
- e.set(o, { priority: f, addI: n++ });
864
- const v = () => a(o);
865
- return sn(v), r = !0, {
866
- off: v
863
+ return { on: (o, u = 0) => {
864
+ e.set(o, { priority: u, addI: n++ });
865
+ const y = () => a(o);
866
+ return sn(y), r = !0, {
867
+ off: y
867
868
  };
868
869
  }, off: a, trigger: (...o) => {
869
- r && (s(), r = !1), t.forEach((f) => f(...o));
870
+ r && (s(), r = !1), t.forEach((u) => u(...o));
870
871
  }, dispose: () => {
871
872
  e.clear(), t.clear();
872
873
  }, get count() {
@@ -875,77 +876,77 @@ function ve() {
875
876
  }
876
877
  function dr() {
877
878
  let e = !0, t = !0, n = !1;
878
- const r = new tt(!1), s = I(r.running), a = I(!1);
879
+ const r = new tt(!1), s = H(r.running), a = H(!1);
879
880
  let i;
880
881
  const l = rt.generateUUID();
881
882
  let c = null;
882
- const o = ve(), f = ve(), v = ve();
883
- M();
884
- let u = {};
885
- function _(w) {
886
- u = w;
883
+ const o = ve(), u = ve(), y = ve();
884
+ C();
885
+ let f = {};
886
+ function g(_) {
887
+ f = _;
887
888
  }
888
- function p(w, L, x = 0) {
889
+ function v(_, L, x = 0) {
889
890
  switch (L) {
890
891
  case "before":
891
- return o.on(w, x);
892
+ return o.on(_, x);
892
893
  case "render":
893
- return c || (c = w), f.dispose(), f.on(w);
894
+ return c || (c = _), u.dispose(), u.on(_);
894
895
  case "after":
895
- return v.on(w, x);
896
+ return y.on(_, x);
896
897
  }
897
898
  }
898
- function P() {
899
- t && (t = !1, M(), T());
899
+ function b() {
900
+ t && (t = !1, C(), S());
900
901
  }
901
902
  function m() {
902
- t = !0, M(), cancelAnimationFrame(i);
903
+ t = !0, C(), cancelAnimationFrame(i);
903
904
  }
904
- function y() {
905
- n = !1, M();
905
+ function d() {
906
+ n = !1, C();
906
907
  }
907
- function g() {
908
- n = !0, M();
908
+ function M() {
909
+ n = !0, C();
909
910
  }
910
911
  function E() {
911
912
  a.value = !0;
912
913
  }
913
- function C() {
914
+ function P() {
914
915
  a.value = !1;
915
916
  }
916
- function T() {
917
+ function S() {
917
918
  if (!e) {
918
- i = requestAnimationFrame(T);
919
+ i = requestAnimationFrame(S);
919
920
  return;
920
921
  }
921
- const w = r.getDelta(), L = r.getElapsedTime(), x = {
922
- camera: K(u.camera),
923
- scene: K(u.scene),
924
- renderer: K(u.renderer),
925
- raycaster: K(u.raycaster),
926
- controls: K(u.controls),
927
- invalidate: u.invalidate,
928
- advance: u.advance
929
- }, d = { delta: w, elapsed: L, clock: r, ...x };
930
- s.value && o.trigger(d), a.value || (f.count ? f.trigger(d) : c && c(d)), s.value && v.trigger(d), i = requestAnimationFrame(T);
922
+ const _ = r.getDelta(), L = r.getElapsedTime(), x = {
923
+ camera: J(f.camera),
924
+ scene: J(f.scene),
925
+ renderer: J(f.renderer),
926
+ raycaster: J(f.raycaster),
927
+ controls: J(f.controls),
928
+ invalidate: f.invalidate,
929
+ advance: f.advance
930
+ }, p = { delta: _, elapsed: L, clock: r, ...x };
931
+ s.value && o.trigger(p), a.value || (u.count ? u.trigger(p) : c && c(p)), s.value && y.trigger(p), i = requestAnimationFrame(S);
931
932
  }
932
- function M() {
933
- const w = !t && !n;
934
- r.running !== w && (r.running ? r.stop() : r.start()), s.value = r.running;
933
+ function C() {
934
+ const _ = !t && !n;
935
+ r.running !== _ && (r.running ? r.stop() : r.start()), s.value = r.running;
935
936
  }
936
937
  return {
937
938
  loopId: l,
938
- register: (w, L, x) => p(w, L, x),
939
- start: P,
939
+ register: (_, L, x) => v(_, L, x),
940
+ start: b,
940
941
  stop: m,
941
- pause: g,
942
- resume: y,
942
+ pause: M,
943
+ resume: d,
943
944
  pauseRender: E,
944
- resumeRender: C,
945
+ resumeRender: P,
945
946
  isRenderPaused: a,
946
947
  isActive: s,
947
- setContext: _,
948
- setReady: (w) => e = w
948
+ setContext: g,
949
+ setReady: (_) => e = _
949
950
  };
950
951
  }
951
952
  function pr(e, t, n = 100) {
@@ -953,23 +954,23 @@ function pr(e, t, n = 100) {
953
954
  const r = j(), s = /* @__PURE__ */ new Set();
954
955
  let a = !1, i = !1, l = null;
955
956
  function c() {
956
- l && clearTimeout(l), !i && !a && e() ? (r.trigger(t), s.forEach((u) => u()), s.clear(), a = !0) : !i && !a && (l = setTimeout(c, n));
957
+ l && clearTimeout(l), !i && !a && e() ? (r.trigger(t), s.forEach((f) => f()), s.clear(), a = !0) : !i && !a && (l = setTimeout(c, n));
957
958
  }
958
959
  function o() {
959
960
  i = !0, l && clearTimeout(l);
960
961
  }
961
962
  c();
962
- const f = (u, ..._) => {
963
- u(..._);
963
+ const u = (f, ...g) => {
964
+ f(...g);
964
965
  };
965
966
  return {
966
- on: (u) => {
967
+ on: (f) => {
967
968
  if (a)
968
- return f(u, t), { off: () => {
969
+ return u(f, t), { off: () => {
969
970
  } };
970
971
  {
971
- const _ = r.on(u);
972
- return s.add(_.off), r.on(u);
972
+ const g = r.on(f);
973
+ return s.add(g.off), r.on(f);
973
974
  }
974
975
  },
975
976
  off: r.off,
@@ -977,10 +978,10 @@ function pr(e, t, n = 100) {
977
978
  cancel: o
978
979
  };
979
980
  }
980
- const te = /* @__PURE__ */ new WeakMap();
981
+ const ee = /* @__PURE__ */ new WeakMap();
981
982
  function gt(e) {
982
- if (e = e || pe(), te.has(e))
983
- return te.get(e);
983
+ if (e = e || pe(), ee.has(e))
984
+ return ee.get(e);
984
985
  const t = 100, n = Date.now(), a = pr(() => {
985
986
  if (Date.now() - n >= t)
986
987
  return !0;
@@ -989,12 +990,12 @@ function gt(e) {
989
990
  return !!(i && l.width > 0 && l.height > 0);
990
991
  }
991
992
  }, e);
992
- return te.set(e, a), a;
993
+ return ee.set(e, a), a;
993
994
  }
994
995
  function Gr(e) {
995
996
  const t = pe();
996
997
  if (t)
997
- return te.has(t) ? te.get(t).on(e) : gt(t).on(e);
998
+ return ee.has(t) ? ee.get(t).on(e) : gt(t).on(e);
998
999
  }
999
1000
  function mr({
1000
1001
  scene: e,
@@ -1004,43 +1005,43 @@ function mr({
1004
1005
  rendererOptions: s,
1005
1006
  emit: a
1006
1007
  }) {
1007
- const { logWarning: i } = z(), l = H(e), c = fr(n, t), {
1008
- camera: o,
1009
- cameras: f,
1010
- registerCamera: v,
1011
- deregisterCamera: u,
1012
- setCameraActive: _
1013
- } = jn({ sizes: c, scene: e }), p = {
1014
- mode: I(s.renderMode || "always"),
1015
- priority: I(0),
1016
- frames: I(0),
1008
+ const i = $(e), l = fr(n, t), {
1009
+ camera: c,
1010
+ cameras: o,
1011
+ registerCamera: u,
1012
+ deregisterCamera: y,
1013
+ setCameraActive: f
1014
+ } = jn({ sizes: l, scene: e }), g = {
1015
+ mode: H(s.renderMode || "always"),
1016
+ priority: H(0),
1017
+ frames: H(0),
1017
1018
  maxFrames: 60,
1018
- canBeInvalidated: Y(() => p.mode.value === "on-demand" && p.frames.value === 0)
1019
+ canBeInvalidated: V(() => g.mode.value === "on-demand" && g.frames.value === 0)
1019
1020
  };
1020
- function P(R = 1) {
1021
- s.renderMode === "on-demand" ? p.frames.value = Math.min(p.maxFrames, p.frames.value + R) : i("`invalidate` can only be used when `renderMode` is set to `on-demand`");
1021
+ function v(O = 1) {
1022
+ s.renderMode === "on-demand" && (g.frames.value = Math.min(g.maxFrames, g.frames.value + O));
1022
1023
  }
1023
- function m() {
1024
- s.renderMode === "manual" ? p.frames.value = 1 : i("`advance` can only be used when `renderMode` is set to `manual`");
1024
+ function b() {
1025
+ s.renderMode === "manual" && (g.frames.value = 1);
1025
1026
  }
1026
- const { renderer: y } = sr(
1027
+ const { renderer: m } = sr(
1027
1028
  {
1028
1029
  scene: e,
1029
1030
  canvas: t,
1030
1031
  options: s,
1031
1032
  emit: a,
1032
1033
  // TODO: replace contextParts with full ctx at https://github.com/Tresjs/tres/issues/516
1033
- contextParts: { sizes: c, camera: o, render: p, invalidate: P, advance: m },
1034
+ contextParts: { sizes: l, camera: c, render: g, invalidate: v, advance: b },
1034
1035
  disableRender: r
1035
1036
  }
1036
- ), g = {
1037
- sizes: c,
1038
- scene: l,
1039
- camera: o,
1040
- cameras: ye(f),
1041
- renderer: y,
1042
- raycaster: H(new Ft()),
1043
- controls: I(null),
1037
+ ), d = {
1038
+ sizes: l,
1039
+ scene: i,
1040
+ camera: c,
1041
+ cameras: ye(o),
1042
+ renderer: m,
1043
+ raycaster: $(new Ft()),
1044
+ controls: H(null),
1044
1045
  perf: {
1045
1046
  maxFrames: 160,
1046
1047
  fps: {
@@ -1053,41 +1054,41 @@ function mr({
1053
1054
  accumulator: []
1054
1055
  }
1055
1056
  },
1056
- render: p,
1057
- advance: m,
1058
- extend: Ce,
1059
- invalidate: P,
1060
- registerCamera: v,
1061
- setCameraActive: _,
1062
- deregisterCamera: u,
1057
+ render: g,
1058
+ advance: b,
1059
+ extend: Me,
1060
+ invalidate: v,
1061
+ registerCamera: u,
1062
+ setCameraActive: f,
1063
+ deregisterCamera: y,
1063
1064
  loop: dr()
1064
1065
  };
1065
- _e("useTres", g), g.scene.value.__tres = {
1066
- root: g
1067
- }, g.loop.register(() => {
1068
- o.value && p.frames.value > 0 && (y.value.render(e, o.value), a("render", g.renderer.value)), p.priority.value = 0, p.mode.value === "always" ? p.frames.value = 1 : p.frames.value = Math.max(0, p.frames.value - 1);
1066
+ _e("useTres", d), d.scene.value.__tres = {
1067
+ root: d
1068
+ }, d.loop.register(() => {
1069
+ c.value && g.frames.value > 0 && (m.value.render(e, c.value), a("render", d.renderer.value)), g.priority.value = 0, g.mode.value === "always" ? g.frames.value = 1 : g.frames.value = Math.max(0, g.frames.value - 1);
1069
1070
  }, "render");
1070
- const { on: E, cancel: C } = gt(g);
1071
- g.loop.setReady(!1), g.loop.start(), E(() => {
1072
- a("ready", g), g.loop.setReady(!0), ur(e, g, a);
1073
- }), Q(() => {
1074
- C(), g.loop.stop();
1071
+ const { on: M, cancel: E } = gt(d);
1072
+ d.loop.setReady(!1), d.loop.start(), M(() => {
1073
+ a("ready", d), d.loop.setReady(!0), ur(e, d, a);
1074
+ }), K(() => {
1075
+ E(), d.loop.stop();
1075
1076
  });
1076
- const T = 100, M = an({ every: T }), { isSupported: w, memory: L } = ln({ interval: T }), x = 160;
1077
- let d = performance.now();
1078
- const b = ({ timestamp: R }) => {
1079
- g.scene.value && (g.perf.memory.allocatedMem = ke(g.scene.value)), R - d >= T && (d = R, g.perf.fps.accumulator.push(M.value), g.perf.fps.accumulator.length > x && g.perf.fps.accumulator.shift(), g.perf.fps.value = M.value, w.value && L.value && (g.perf.memory.accumulator.push(L.value.usedJSHeapSize / 1024 / 1024), g.perf.memory.accumulator.length > x && g.perf.memory.accumulator.shift(), g.perf.memory.currentMem = g.perf.memory.accumulator.reduce((O, q) => O + q, 0) / g.perf.memory.accumulator.length));
1077
+ const P = 100, S = an({ every: P }), { isSupported: C, memory: _ } = ln({ interval: P }), L = 160;
1078
+ let x = performance.now();
1079
+ const p = ({ timestamp: O }) => {
1080
+ d.scene.value && (d.perf.memory.allocatedMem = ke(d.scene.value)), O - x >= P && (x = O, d.perf.fps.accumulator.push(S.value), d.perf.fps.accumulator.length > L && d.perf.fps.accumulator.shift(), d.perf.fps.value = S.value, C.value && _.value && (d.perf.memory.accumulator.push(_.value.usedJSHeapSize / 1024 / 1024), d.perf.memory.accumulator.length > L && d.perf.memory.accumulator.shift(), d.perf.memory.currentMem = d.perf.memory.accumulator.reduce((B, R) => B + R, 0) / d.perf.memory.accumulator.length));
1080
1081
  };
1081
- let A = 0;
1082
- const D = 1, { pause: $ } = it(({ delta: R }) => {
1083
- window.__TRES__DEVTOOLS__ && (b({ timestamp: performance.now() }), A += R, A >= D && (window.__TRES__DEVTOOLS__.cb(g), A = 0));
1082
+ let w = 0;
1083
+ const A = 1, { pause: D } = it(({ delta: O }) => {
1084
+ window.__TRES__DEVTOOLS__ && (p({ timestamp: performance.now() }), w += O, w >= A && (window.__TRES__DEVTOOLS__.cb(d), w = 0));
1084
1085
  }, { immediate: !0 });
1085
- return Q(() => {
1086
- $();
1087
- }), g;
1086
+ return K(() => {
1087
+ D();
1088
+ }), d;
1088
1089
  }
1089
1090
  function pe() {
1090
- const e = Mt("useTres");
1091
+ const e = Ct("useTres");
1091
1092
  if (!e)
1092
1093
  throw new Error("useTresContext must be used together with useTresContextProvider");
1093
1094
  return e;
@@ -1113,14 +1114,14 @@ function Yr() {
1113
1114
  invalidate: i,
1114
1115
  advance: l
1115
1116
  });
1116
- function c(v, u = 0) {
1117
- return r.register(v, "before", u);
1117
+ function c(y, f = 0) {
1118
+ return r.register(y, "before", f);
1118
1119
  }
1119
- function o(v) {
1120
- return r.register(v, "render");
1120
+ function o(y) {
1121
+ return r.register(y, "render");
1121
1122
  }
1122
- function f(v, u = 0) {
1123
- return r.register(v, "after", u);
1123
+ function u(y, f = 0) {
1124
+ return r.register(y, "after", f);
1124
1125
  }
1125
1126
  return {
1126
1127
  pause: r.pause,
@@ -1130,7 +1131,7 @@ function Yr() {
1130
1131
  isActive: r.isActive,
1131
1132
  onBeforeRender: c,
1132
1133
  render: o,
1133
- onAfterRender: f
1134
+ onAfterRender: u
1134
1135
  };
1135
1136
  }
1136
1137
  function hr(e, t = {}, n = {}) {
@@ -1152,7 +1153,7 @@ function hr(e, t = {}, n = {}) {
1152
1153
  };
1153
1154
  return a = new Proxy({}, i), a;
1154
1155
  }
1155
- const { logError: Ke } = z(), Qe = [
1156
+ const { logError: Ke } = Y(), Qe = [
1156
1157
  "onClick",
1157
1158
  "onContextMenu",
1158
1159
  "onPointerMove",
@@ -1169,66 +1170,66 @@ const { logError: Ke } = z(), Qe = [
1169
1170
  "onWheel"
1170
1171
  ], gr = (e) => {
1171
1172
  const t = e.scene.value;
1172
- function n(o, f, v, u) {
1173
- if (u || (u = {}), u.args || (u.args = []), o === "template" || Wn(o))
1173
+ function n(o, u, y, f) {
1174
+ if (f || (f = {}), f.args || (f.args = []), o === "template" || Wn(o))
1174
1175
  return null;
1175
- let _ = o.replace("Tres", ""), p;
1176
+ let g = o.replace("Tres", ""), v;
1176
1177
  if (o === "primitive") {
1177
- (!N(u.object) || Ct(u.object)) && Ke(
1178
+ (!N(f.object) || Mt(f.object)) && Ke(
1178
1179
  "Tres primitives need an 'object' prop, whose value is an object or shallowRef<object>"
1179
- ), _ = u.object.type;
1180
- const P = {};
1181
- p = hr(
1182
- u.object,
1180
+ ), g = f.object.type;
1181
+ const b = {};
1182
+ v = hr(
1183
+ f.object,
1183
1184
  {
1184
- object: (y) => y,
1185
+ object: (d) => d,
1185
1186
  isPrimitive: () => !0,
1186
- __tres: () => P
1187
+ __tres: () => b
1187
1188
  },
1188
1189
  {
1189
- object: (y, g, E, C) => {
1190
- rr(y, E, C, { patchProp: a, remove: s, insert: r }, e);
1190
+ object: (d, M, E, P) => {
1191
+ rr(d, E, P, { patchProp: a, remove: s, insert: r }, e);
1191
1192
  },
1192
- __tres: (y) => {
1193
- Object.assign(P, y);
1193
+ __tres: (d) => {
1194
+ Object.assign(b, d);
1194
1195
  }
1195
1196
  }
1196
1197
  );
1197
1198
  } else {
1198
- const P = Me.value[_];
1199
- P || Ke(
1200
- `${_} is not defined on the THREE namespace. Use extend to add it to the catalog.`
1201
- ), p = new P(...u.args);
1199
+ const b = Ce.value[g];
1200
+ b || Ke(
1201
+ `${g} is not defined on the THREE namespace. Use extend to add it to the catalog.`
1202
+ ), v = new b(...f.args);
1202
1203
  }
1203
- return p ? (p.isCamera && (u != null && u.position || p.position.set(3, 3, 3), u != null && u.lookAt || p.lookAt(0, 0, 0)), p = G(p, {
1204
- ...p.__tres,
1205
- type: _,
1206
- memoizedProps: u,
1204
+ return v ? (v.isCamera && (f != null && f.position || v.position.set(3, 3, 3), f != null && f.lookAt || v.lookAt(0, 0, 0)), v = z(v, {
1205
+ ...v.__tres,
1206
+ type: g,
1207
+ memoizedProps: f,
1207
1208
  eventCount: 0,
1208
1209
  primitive: o === "primitive",
1209
- attach: u.attach
1210
- }, e), p) : null;
1210
+ attach: f.attach
1211
+ }, e), v) : null;
1211
1212
  }
1212
- function r(o, f) {
1213
- var _, p, P;
1213
+ function r(o, u) {
1214
+ var g, v, b;
1214
1215
  if (!o)
1215
1216
  return;
1216
- f = f || t;
1217
- const v = o.__tres ? o : G(o, {}, e), u = f.__tres ? f : G(f, {}, e);
1218
- o = X(v), f = X(u), o.__tres && ((_ = o.__tres) == null ? void 0 : _.eventCount) > 0 && ((p = e.eventManager) == null || p.registerObject(o)), e.registerCamera(o), (P = e.eventManager) == null || P.registerPointerMissedObject(o), v.__tres.attach ? er(u, v, v.__tres.attach) : W(o) && W(u) && (u.add(o), o.dispatchEvent({ type: "added" })), v.__tres.parent = u, u.__tres.objects && !u.__tres.objects.includes(v) && u.__tres.objects.push(v);
1217
+ u = u || t;
1218
+ const y = o.__tres ? o : z(o, {}, e), f = u.__tres ? u : z(u, {}, e);
1219
+ o = Q(y), u = Q(f), o.__tres && ((g = o.__tres) == null ? void 0 : g.eventCount) > 0 && ((v = e.eventManager) == null || v.registerObject(o)), e.registerCamera(o), (b = e.eventManager) == null || b.registerPointerMissedObject(o), y.__tres.attach ? er(f, y, y.__tres.attach) : W(o) && W(f) && (f.add(o), o.dispatchEvent({ type: "added" })), y.__tres.parent = f, f.__tres.objects && !f.__tres.objects.includes(y) && f.__tres.objects.push(y);
1219
1220
  }
1220
- function s(o, f) {
1221
- var p, P, m, y;
1221
+ function s(o, u) {
1222
+ var v, b, m, d;
1222
1223
  if (!o)
1223
1224
  return;
1224
- o != null && o.__tres && ((p = o.__tres) == null ? void 0 : p.eventCount) > 0 && ((P = e.eventManager) == null || P.deregisterObject(o)), f = be(f) ? "default" : f;
1225
- const v = (m = o.__tres) == null ? void 0 : m.dispose;
1226
- be(v) || (v === null ? f = !1 : f = v);
1227
- const u = (y = o.__tres) == null ? void 0 : y.primitive, _ = f === "default" ? !u : !!f;
1228
- if (o.__tres && "objects" in o.__tres && [...o.__tres.objects].forEach((g) => s(g, f)), _ && o.children && [...o.children].forEach((g) => s(g, f)), mt(o, e), ht(o, e), _ && !On(o)) {
1229
- if (V(f))
1230
- f(o);
1231
- else if (V(o.dispose))
1225
+ o != null && o.__tres && ((v = o.__tres) == null ? void 0 : v.eventCount) > 0 && ((b = e.eventManager) == null || b.deregisterObject(o)), u = be(u) ? "default" : u;
1226
+ const y = (m = o.__tres) == null ? void 0 : m.dispose;
1227
+ be(y) || (y === null ? u = !1 : u = y);
1228
+ const f = (d = o.__tres) == null ? void 0 : d.primitive, g = u === "default" ? !f : !!u;
1229
+ if (o.__tres && "objects" in o.__tres && [...o.__tres.objects].forEach((M) => s(M, u)), g && o.children && [...o.children].forEach((M) => s(M, u)), mt(o, e), ht(o, e), g && !On(o)) {
1230
+ if (G(u))
1231
+ u(o);
1232
+ else if (G(o.dispose))
1232
1233
  try {
1233
1234
  o.dispose();
1234
1235
  } catch {
@@ -1236,66 +1237,66 @@ const { logError: Ke } = z(), Qe = [
1236
1237
  }
1237
1238
  "__tres" in o && delete o.__tres;
1238
1239
  }
1239
- function a(o, f, v, u) {
1240
- var g, E;
1240
+ function a(o, u, y, f) {
1241
+ var M, E;
1241
1242
  if (!o)
1242
1243
  return;
1243
- let _ = o, p = f;
1244
- if (o.__tres && (o.__tres.memoizedProps[f] = u), f === "attach") {
1245
- const C = ((g = o.__tres) == null ? void 0 : g.parent) || o.parent;
1246
- s(o), G(o, { attach: u }, e), C && r(o, C);
1244
+ let g = o, v = u;
1245
+ if (o.__tres && (o.__tres.memoizedProps[u] = f), u === "attach") {
1246
+ const P = ((M = o.__tres) == null ? void 0 : M.parent) || o.parent;
1247
+ s(o), z(o, { attach: f }, e), P && r(o, P);
1247
1248
  return;
1248
1249
  }
1249
- if (f === "dispose") {
1250
- o.__tres || (o = G(o, {}, e)), o.__tres.dispose = u;
1250
+ if (u === "dispose") {
1251
+ o.__tres || (o = z(o, {}, e)), o.__tres.dispose = f;
1251
1252
  return;
1252
1253
  }
1253
- if (W(o) && p === "blocks-pointer-events") {
1254
- u || u === "" ? o[p] = u : delete o[p];
1254
+ if (W(o) && v === "blocks-pointer-events") {
1255
+ f || f === "" ? o[v] = f : delete o[v];
1255
1256
  return;
1256
1257
  }
1257
- Qe.includes(f) && o.__tres && (o.__tres.eventCount += 1);
1258
- let P = se(p), m = _ == null ? void 0 : _[P];
1259
- if (p === "args") {
1260
- const C = o, T = v ?? [], M = u ?? [], w = ((E = o.__tres) == null ? void 0 : E.type) || o.type;
1261
- w && T.length && !Yn(T, M) && (_ = Object.assign(
1262
- C,
1263
- new Me.value[w](...u)
1258
+ Qe.includes(u) && o.__tres && (o.__tres.eventCount += 1);
1259
+ let b = se(v), m = g == null ? void 0 : g[b];
1260
+ if (v === "args") {
1261
+ const P = o, S = y ?? [], C = f ?? [], _ = ((E = o.__tres) == null ? void 0 : E.type) || o.type;
1262
+ _ && S.length && !Yn(S, C) && (g = Object.assign(
1263
+ P,
1264
+ new Ce.value[_](...f)
1264
1265
  ));
1265
1266
  return;
1266
1267
  }
1267
- if (_.type === "BufferGeometry") {
1268
- if (p === "args")
1268
+ if (g.type === "BufferGeometry") {
1269
+ if (v === "args")
1269
1270
  return;
1270
- _.setAttribute(
1271
- se(p),
1272
- new Wt(...u)
1271
+ g.setAttribute(
1272
+ se(v),
1273
+ new Wt(...f)
1273
1274
  );
1274
1275
  return;
1275
1276
  }
1276
- if (p.includes("-") && m === void 0) {
1277
- const C = p.split("-");
1278
- m = C.reduce((T, M) => T[se(M)], _), p = C.pop(), P = p, m != null && m.set || (_ = C.reduce((T, M) => T[se(M)], _));
1277
+ if (v.includes("-") && m === void 0) {
1278
+ const P = v.split("-");
1279
+ m = P.reduce((S, C) => S[se(C)], g), v = P.pop(), b = v, m != null && m.set || (g = P.reduce((S, C) => S[se(C)], g));
1279
1280
  }
1280
- let y = u;
1281
- if (y === "" && (y = !0), V(m)) {
1282
- Qe.includes(f) || (de(y) ? o[P](...y) : o[P](y)), P.startsWith("on") && V(y) && (_[P] = y);
1281
+ let d = f;
1282
+ if (d === "" && (d = !0), G(m)) {
1283
+ Qe.includes(u) || (de(d) ? o[b](...d) : o[b](d)), b.startsWith("on") && G(d) && (g[b] = d);
1283
1284
  return;
1284
1285
  }
1285
- !(m != null && m.set) && !V(m) ? _[P] = y : m.constructor === y.constructor && (m != null && m.copy) ? m == null || m.copy(y) : de(y) ? m.set(...y) : !m.isColor && m.setScalar ? m.setScalar(y) : m.set(y), pt(o);
1286
+ !(m != null && m.set) && !G(m) ? g[b] = d : m.constructor === d.constructor && (m != null && m.copy) ? m == null || m.copy(d) : de(d) ? m.set(...d) : !m.isColor && m.setScalar ? m.setScalar(d) : m.set(d), pt(o);
1286
1287
  }
1287
1288
  function i(o) {
1288
- var f;
1289
- return ((f = o == null ? void 0 : o.__tres) == null ? void 0 : f.parent) || null;
1289
+ var u;
1290
+ return ((u = o == null ? void 0 : o.__tres) == null ? void 0 : u.parent) || null;
1290
1291
  }
1291
1292
  function l(o) {
1292
- const f = G(new Nt(), { type: "Comment" }, e);
1293
- return f.name = o, f;
1293
+ const u = z(new Nt(), { type: "Comment" }, e);
1294
+ return u.name = o, u;
1294
1295
  }
1295
1296
  function c(o) {
1296
- var _;
1297
- const f = i(o), v = ((_ = f == null ? void 0 : f.__tres) == null ? void 0 : _.objects) || [], u = v.indexOf(o);
1298
- return u < 0 || u >= v.length - 1 ? null : v[u + 1];
1297
+ var g;
1298
+ const u = i(o), y = ((g = u == null ? void 0 : u.__tres) == null ? void 0 : g.objects) || [], f = y.indexOf(o);
1299
+ return f < 0 || f >= y.length - 1 ? null : y[f + 1];
1299
1300
  }
1300
1301
  return {
1301
1302
  insert: r,
@@ -1321,15 +1322,15 @@ function vt() {
1321
1322
  return typeof navigator < "u" && typeof window < "u" ? window : typeof globalThis < "u" ? globalThis : {};
1322
1323
  }
1323
1324
  const yr = typeof Proxy == "function", _r = "devtools-plugin:setup", wr = "plugin:settings:set";
1324
- let J, Ee;
1325
+ let q, Ee;
1325
1326
  function br() {
1326
1327
  var e;
1327
- return J !== void 0 || (typeof window < "u" && window.performance ? (J = !0, Ee = window.performance) : typeof globalThis < "u" && (!((e = globalThis.perf_hooks) === null || e === void 0) && e.performance) ? (J = !0, Ee = globalThis.perf_hooks.performance) : J = !1), J;
1328
+ return q !== void 0 || (typeof window < "u" && window.performance ? (q = !0, Ee = window.performance) : typeof globalThis < "u" && (!((e = globalThis.perf_hooks) === null || e === void 0) && e.performance) ? (q = !0, Ee = globalThis.perf_hooks.performance) : q = !1), q;
1328
1329
  }
1329
1330
  function Pr() {
1330
1331
  return br() ? Ee.now() : Date.now();
1331
1332
  }
1332
- class Mr {
1333
+ class Cr {
1333
1334
  constructor(t, n) {
1334
1335
  this.target = null, this.targetQueue = [], this.onQueue = [], this.plugin = t, this.hook = n;
1335
1336
  const r = {};
@@ -1391,12 +1392,12 @@ class Mr {
1391
1392
  n.resolve(await this.target[n.method](...n.args));
1392
1393
  }
1393
1394
  }
1394
- function Cr(e, t) {
1395
+ function Mr(e, t) {
1395
1396
  const n = e, r = vt(), s = vr(), a = yr && n.enableEarlyProxy;
1396
1397
  if (s && (r.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !a))
1397
1398
  s.emit(_r, e, t);
1398
1399
  else {
1399
- const i = a ? new Mr(n, s) : null;
1400
+ const i = a ? new Cr(n, s) : null;
1400
1401
  (r.__VUE_DEVTOOLS_PLUGINS__ = r.__VUE_DEVTOOLS_PLUGINS__ || []).push({
1401
1402
  pluginDescriptor: n,
1402
1403
  setupFn: t,
@@ -1459,11 +1460,11 @@ function _t(e, t, n = "") {
1459
1460
  t.children.push(s), _t(r, s, n);
1460
1461
  });
1461
1462
  }
1462
- const Tr = [], Z = "tres:inspector", Sr = Et({
1463
+ const Tr = [], X = "tres:inspector", Sr = Et({
1463
1464
  sceneGraph: null
1464
1465
  });
1465
1466
  function Ar(e, t) {
1466
- Cr(
1467
+ Mr(
1467
1468
  {
1468
1469
  id: "dev.esm.tres",
1469
1470
  label: "TresJS 🪐",
@@ -1477,16 +1478,16 @@ function Ar(e, t) {
1477
1478
  typeof n.now != "function" && Er(
1478
1479
  "You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html."
1479
1480
  ), n.addInspector({
1480
- id: Z,
1481
+ id: X,
1481
1482
  label: "TresJS 🪐",
1482
1483
  icon: "account_tree",
1483
1484
  treeFilterPlaceholder: "Search instances"
1484
1485
  }), setInterval(() => {
1485
- n.sendInspectorTree(Z);
1486
+ n.sendInspectorTree(X);
1486
1487
  }, 1e3), setInterval(() => {
1487
1488
  n.notifyComponentUpdate();
1488
1489
  }, 5e3), n.on.getInspectorTree((a) => {
1489
- if (a.inspectorId === Z) {
1490
+ if (a.inspectorId === X) {
1490
1491
  const i = yt(t.scene.value);
1491
1492
  _t(t.scene.value, i, a.filter), Sr.sceneGraph = i, a.rootNodes = [i];
1492
1493
  }
@@ -1494,7 +1495,7 @@ function Ar(e, t) {
1494
1495
  let r = null, s = null;
1495
1496
  n.on.getInspectorState((a) => {
1496
1497
  var i;
1497
- if (a.inspectorId === Z) {
1498
+ if (a.inspectorId === X) {
1498
1499
  const [l] = t.scene.value.getObjectsByProperty("uuid", a.nodeId);
1499
1500
  if (!l)
1500
1501
  return;
@@ -1522,7 +1523,7 @@ function Ar(e, t) {
1522
1523
  }))) || []);
1523
1524
  }
1524
1525
  }), n.on.editInspectorState((a) => {
1525
- a.inspectorId === Z && Jn(t.scene.value, a.nodeId, a.path, a.state.value);
1526
+ a.inspectorId === X && Jn(t.scene.value, a.nodeId, a.path, a.state.value);
1526
1527
  });
1527
1528
  }
1528
1529
  );
@@ -1572,66 +1573,66 @@ const kr = ["data-scene", "data-tres"], xr = /* @__PURE__ */ Be({
1572
1573
  "ready"
1573
1574
  ],
1574
1575
  setup(e, { expose: t, emit: n }) {
1575
- var P;
1576
- const r = e, s = n, a = Tt(), { logWarning: i } = z(), l = I(), c = H(new nt()), o = (P = Ie()) == null ? void 0 : P.appContext.app;
1577
- Ce(et);
1578
- const f = (m) => Be({
1576
+ var b;
1577
+ const r = e, s = n, a = Tt(), { logWarning: i } = Y(), l = H(), c = $(new nt()), o = (b = Ie()) == null ? void 0 : b.appContext.app;
1578
+ Me(et);
1579
+ const u = (m) => Be({
1579
1580
  setup() {
1580
- var g;
1581
- const y = (g = Ie()) == null ? void 0 : g.appContext;
1582
- return y && (y.app = o), _e("useTres", m), _e("extend", Ce), typeof window < "u" && Ar(y == null ? void 0 : y.app, m), () => He(Ot, null, a != null && a.default ? a.default() : []);
1581
+ var M;
1582
+ const d = (M = Ie()) == null ? void 0 : M.appContext;
1583
+ return d && (d.app = o), _e("useTres", m), _e("extend", Me), typeof window < "u" && Ar(d == null ? void 0 : d.app, m), () => He(Ot, null, a != null && a.default ? a.default() : []);
1583
1584
  }
1584
- }), v = (m) => {
1585
- const y = f(m), { render: g } = Rt(gr(m));
1586
- g(He(y), c.value);
1587
- }, u = (m, y = !1) => {
1588
- dt(m.scene.value), y && (m.renderer.value.dispose(), m.renderer.value.renderLists.dispose(), m.renderer.value.forceContextLoss()), c.value.__tres = {
1585
+ }), y = (m) => {
1586
+ const d = u(m), { render: M } = Rt(gr(m));
1587
+ M(He(d), c.value);
1588
+ }, f = (m, d = !1) => {
1589
+ dt(m.scene.value), d && (m.renderer.value.dispose(), m.renderer.value.renderLists.dispose(), m.renderer.value.forceContextLoss()), c.value.__tres = {
1589
1590
  root: m
1590
- }, v(m);
1591
- }, _ = Y(() => r.disableRender), p = H(null);
1592
- return t({ context: p, dispose: () => u(p.value, !0) }), St(() => {
1591
+ }, y(m);
1592
+ }, g = V(() => r.disableRender), v = $(null);
1593
+ return t({ context: v, dispose: () => f(v.value, !0) }), St(() => {
1593
1594
  const m = l;
1594
- p.value = mr({
1595
+ v.value = mr({
1595
1596
  scene: c.value,
1596
1597
  canvas: m,
1597
1598
  windowSize: r.windowSize ?? !1,
1598
- disableRender: _.value ?? !1,
1599
+ disableRender: g.value ?? !1,
1599
1600
  rendererOptions: r,
1600
1601
  emit: s
1601
1602
  });
1602
- const { registerCamera: y, camera: g, cameras: E, deregisterCamera: C } = p.value;
1603
- v(p.value);
1604
- const T = () => {
1605
- const M = new we(
1603
+ const { registerCamera: d, camera: M, cameras: E, deregisterCamera: P } = v.value;
1604
+ y(v.value);
1605
+ const S = () => {
1606
+ const C = new we(
1606
1607
  45,
1607
1608
  window.innerWidth / window.innerHeight,
1608
1609
  0.1,
1609
1610
  1e3
1610
1611
  );
1611
- M.position.set(3, 3, 3), M.lookAt(0, 0, 0), y(M);
1612
- const w = Te(() => {
1613
- E.value.length >= 2 && (M.removeFromParent(), C(M), w == null || w());
1612
+ C.position.set(3, 3, 3), C.lookAt(0, 0, 0), d(C);
1613
+ const _ = Te(() => {
1614
+ E.value.length >= 2 && (C.removeFromParent(), P(C), _ == null || _());
1614
1615
  });
1615
1616
  };
1616
1617
  le(
1617
1618
  () => r.camera,
1618
- (M, w) => {
1619
- M && y(M), w && (w.removeFromParent(), C(w));
1619
+ (C, _) => {
1620
+ C && d(C), _ && (_.removeFromParent(), P(_));
1620
1621
  },
1621
1622
  {
1622
1623
  immediate: !0
1623
1624
  }
1624
- ), g.value || (i(
1625
+ ), M.value || (i(
1625
1626
  "No camera found. Creating a default perspective camera. To have full control over a camera, please add one to the scene."
1626
- ), T());
1627
- }), Q(() => {
1628
- u(p.value);
1629
- }), (m, y) => (At(), kt("canvas", {
1627
+ ), S());
1628
+ }), K(() => {
1629
+ f(v.value);
1630
+ }), (m, d) => (At(), kt("canvas", {
1630
1631
  ref_key: "canvas",
1631
1632
  ref: l,
1632
1633
  "data-scene": c.value.uuid,
1633
1634
  class: xt(m.$attrs.class),
1634
- "data-tres": `tresjs ${K(An).version}`,
1635
+ "data-tres": `tresjs ${J(An).version}`,
1635
1636
  style: Lt({
1636
1637
  display: "block",
1637
1638
  width: "100%",
@@ -1687,7 +1688,7 @@ class wt extends zt {
1687
1688
  this.geometry.dispose(), this.material.dispose(), this.children[0].geometry.dispose(), this.children[0].material.dispose();
1688
1689
  }
1689
1690
  }
1690
- const { logWarning: Ze } = z();
1691
+ const { logWarning: Ze } = Y();
1691
1692
  let ae, F;
1692
1693
  const Or = {
1693
1694
  DirectionalLight: qt,
@@ -1713,8 +1714,8 @@ const Or = {
1713
1714
  }
1714
1715
  F = e.parent.children.find((t) => t instanceof ae), F && F.dispose && F.dispose(), e.parent.remove(F);
1715
1716
  }
1716
- }, { logWarning: Dr } = z();
1717
- let B = null;
1717
+ }, { logWarning: Dr } = Y();
1718
+ let I = null;
1718
1719
  const Qr = {
1719
1720
  updated: (e, t) => {
1720
1721
  var s;
@@ -1723,9 +1724,9 @@ const Qr = {
1723
1724
  Dr(`v-distance-to: problem with binding value: ${t.value}`);
1724
1725
  return;
1725
1726
  }
1726
- B && (B.dispose(), e.parent.remove(B));
1727
+ I && (I.dispose(), e.parent.remove(I));
1727
1728
  const r = n.clone().sub(e.position);
1728
- r.normalize(), B = new Xt(r, e.position, e.position.distanceTo(n), 16776960), e.parent.add(B), console.table(
1729
+ r.normalize(), I = new Xt(r, e.position, e.position.distanceTo(n), 16776960), e.parent.add(I), console.table(
1729
1730
  [
1730
1731
  ["Distance:", e.position.distanceTo(n)],
1731
1732
  [`origin: ${e.name || e.type}`, `x:${e.position.x}, y:${e.position.y}, z:${(s = e.position) == null ? void 0 : s.z}`],
@@ -1734,7 +1735,7 @@ const Qr = {
1734
1735
  );
1735
1736
  },
1736
1737
  unmounted: (e) => {
1737
- B == null || B.dispose(), e.parent.remove(B);
1738
+ I == null || I.dispose(), e.parent.remove(I);
1738
1739
  }
1739
1740
  }, Xr = {
1740
1741
  install(e) {
@@ -1743,11 +1744,11 @@ const Qr = {
1743
1744
  };
1744
1745
  export {
1745
1746
  xr as TresCanvas,
1746
- Me as catalogue,
1747
+ Ce as catalogue,
1747
1748
  dr as createRenderLoop,
1748
1749
  Xr as default,
1749
1750
  dt as dispose,
1750
- Ce as extend,
1751
+ Me as extend,
1751
1752
  Ur as isProd,
1752
1753
  $n as normalizeColor,
1753
1754
  Fr as normalizeVectorFlexibleParam,
@@ -1756,7 +1757,7 @@ export {
1756
1757
  ar as trasverseObjects,
1757
1758
  jn as useCamera,
1758
1759
  Wr as useLoader,
1759
- z as useLogger,
1760
+ Y as useLogger,
1760
1761
  Yr as useLoop,
1761
1762
  lr as useRaycaster,
1762
1763
  $r as useRenderLoop,