@tresjs/core 4.1.0-next.0 → 4.1.0

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,24 +1,24 @@
1
1
  /**
2
2
  * name: @tresjs/core
3
- * version: v4.1.0-next.0
3
+ * version: v4.1.0
4
4
  * (c) 2024
5
5
  * description: Declarative ThreeJS using Vue Components
6
6
  * author: Alvaro Saburido <hola@alvarosaburido.dev> (https://github.com/alvarosabu/)
7
7
  */
8
- var at = Object.defineProperty;
9
- var lt = (e, t, r) => t in e ? at(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
10
- var ie = (e, t, r) => (lt(e, typeof t != "symbol" ? t + "" : t, r), r);
11
- import { ref as L, computed as D, watchEffect as ve, onUnmounted as N, shallowRef as H, watch as G, reactive as ze, readonly as ue, unref as W, provide as fe, inject as ct, defineComponent as xe, useSlots as ut, getCurrentInstance as ke, onMounted as ft, openBlock as pt, createElementBlock as dt, normalizeClass as mt, normalizeStyle as gt, createRenderer as vt, h as Oe, Fragment as ht } from "vue";
12
- import * as Ge from "three";
13
- import { PerspectiveCamera as pe, Camera as yt, Clock as Ve, Vector3 as he, Color as re, Scene as qe, MeshBasicMaterial as Ye, DoubleSide as wt, REVISION as bt, SRGBColorSpace as Mt, ACESFilmicToneMapping as Je, PCFSoftShadowMap as Pt, NoToneMapping as _t, WebGLRenderer as ae, TextureLoader as Ct, Vector2 as le, MathUtils as Et, Raycaster as St, BufferAttribute as Tt, Object3D as xt, Line as kt, BufferGeometry as Ae, Float32BufferAttribute as Le, LineBasicMaterial as Ot, Mesh as At, BackSide as Lt, DirectionalLightHelper as Dt, PointLightHelper as Bt, SpotLightHelper as jt, HemisphereLightHelper as Rt, ArrowHelper as It } from "three";
14
- import { createEventHook as A, useRafFn as Qe, toValue as T, unrefElement as Ht, useDevicePixelRatio as $t, usePointer as Ft, useElementBounding as Ut, useWindowSize as Wt, useElementSize as Nt, refDebounced as De, tryOnScopeDispose as zt, useFps as Gt, useMemory as Vt } from "@vueuse/core";
15
- const qt = "@tresjs/core", Yt = "module", Jt = "4.1.0-next.0", Qt = "pnpm@9.1.4", Kt = "Declarative ThreeJS using Vue Components", Xt = "Alvaro Saburido <hola@alvarosaburido.dev> (https://github.com/alvarosabu/)", Zt = "MIT", er = [
8
+ var gt = Object.defineProperty;
9
+ var ht = (e, t, n) => t in e ? gt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
10
+ var ue = (e, t, n) => (ht(e, typeof t != "symbol" ? t + "" : t, n), n);
11
+ import { ref as D, computed as j, watchEffect as Me, onUnmounted as Y, shallowRef as $, watch as J, reactive as Ke, readonly as me, unref as V, provide as ge, inject as vt, defineComponent as Le, useSlots as yt, getCurrentInstance as Re, onMounted as wt, openBlock as bt, createElementBlock as Mt, normalizeClass as _t, normalizeStyle as Pt, createRenderer as Ct, h as De, Fragment as Et } from "vue";
12
+ import * as Xe from "three";
13
+ import { PerspectiveCamera as he, Camera as kt, Clock as Ze, Vector3 as _e, Color as se, Scene as et, MeshBasicMaterial as tt, DoubleSide as St, REVISION as Tt, SRGBColorSpace as At, ACESFilmicToneMapping as nt, PCFSoftShadowMap as Ot, NoToneMapping as xt, WebGLRenderer as fe, TextureLoader as Lt, Vector2 as de, MathUtils as Rt, Raycaster as Dt, BufferAttribute as Bt, Object3D as jt, Line as It, BufferGeometry as Be, Float32BufferAttribute as je, LineBasicMaterial as Ht, Mesh as Ut, BackSide as $t, DirectionalLightHelper as Ft, PointLightHelper as Wt, SpotLightHelper as Nt, HemisphereLightHelper as Gt, ArrowHelper as zt } from "three";
14
+ import { createEventHook as L, useRafFn as rt, toValue as A, unrefElement as Vt, useDevicePixelRatio as Yt, usePointer as qt, useElementBounding as Jt, useWindowSize as Qt, useElementSize as Kt, refDebounced as Ie, tryOnScopeDispose as Xt, useFps as Zt, useMemory as en } from "@vueuse/core";
15
+ const tn = "@tresjs/core", nn = "module", rn = "4.1.0", on = "pnpm@9.1.4", sn = "Declarative ThreeJS using Vue Components", an = "Alvaro Saburido <hola@alvarosaburido.dev> (https://github.com/alvarosabu/)", ln = "MIT", cn = [
16
16
  "vue",
17
17
  "3d",
18
18
  "threejs",
19
19
  "three",
20
20
  "threejs-vue"
21
- ], tr = !1, rr = {
21
+ ], un = !1, fn = {
22
22
  ".": {
23
23
  types: "./dist/index.d.ts",
24
24
  import: "./dist/tres.js",
@@ -37,12 +37,12 @@ const qt = "@tresjs/core", Yt = "module", Jt = "4.1.0-next.0", Qt = "pnpm@9.1.4"
37
37
  types: "./dist/src/utils/index.d.ts"
38
38
  },
39
39
  "./*": "./*"
40
- }, nr = "./dist/tres.js", or = "./dist/tres.js", sr = "./dist/index.d.ts", ir = [
40
+ }, dn = "./dist/tres.js", pn = "./dist/tres.js", mn = "./dist/index.d.ts", gn = [
41
41
  "*.d.ts",
42
42
  "dist"
43
- ], ar = {
43
+ ], hn = {
44
44
  access: "public"
45
- }, lr = {
45
+ }, vn = {
46
46
  dev: "cd playground && npm run dev",
47
47
  build: "vite build",
48
48
  playground: "cd playground && npm run dev",
@@ -59,14 +59,14 @@ const qt = "@tresjs/core", Yt = "module", Jt = "4.1.0-next.0", Qt = "pnpm@9.1.4"
59
59
  "docs:preview": "vitepress preview docs",
60
60
  "docs:contributors": "esno scripts/update-contributors.ts",
61
61
  prepare: "node .husky/install.mjs"
62
- }, cr = {
62
+ }, yn = {
63
63
  three: ">=0.133",
64
64
  vue: ">=3.4"
65
- }, ur = {
65
+ }, wn = {
66
66
  "@alvarosabu/utils": "^3.2.0",
67
67
  "@vue/devtools-api": "^6.6.2",
68
68
  "@vueuse/core": "^10.10.0"
69
- }, fr = {
69
+ }, bn = {
70
70
  "@release-it/conventional-changelog": "^8.0.1",
71
71
  "@stackblitz/sdk": "^1.10.0",
72
72
  "@tresjs/cientos": "3.9.0",
@@ -92,6 +92,7 @@ const qt = "@tresjs/core", Yt = "module", Jt = "4.1.0-next.0", Qt = "pnpm@9.1.4"
92
92
  "rollup-plugin-analyzer": "^4.0.0",
93
93
  "rollup-plugin-copy": "^3.5.0",
94
94
  "rollup-plugin-visualizer": "^5.12.0",
95
+ sponsorkit: "^0.14.6",
95
96
  three: "^0.165.0",
96
97
  unocss: "^0.60.4",
97
98
  unplugin: "^1.10.1",
@@ -106,686 +107,784 @@ const qt = "@tresjs/core", Yt = "module", Jt = "4.1.0-next.0", Qt = "pnpm@9.1.4"
106
107
  vitest: "^1.6.0",
107
108
  vue: "^3.4.27",
108
109
  "vue-demi": "^0.14.8"
109
- }, pr = {
110
- name: qt,
111
- type: Yt,
112
- version: Jt,
113
- packageManager: Qt,
114
- description: Kt,
115
- author: Xt,
116
- license: Zt,
117
- keywords: er,
118
- sideEffects: tr,
119
- exports: rr,
120
- main: nr,
121
- module: or,
122
- types: sr,
123
- files: ir,
124
- publishConfig: ar,
125
- scripts: lr,
126
- peerDependencies: cr,
127
- dependencies: ur,
128
- devDependencies: fr
129
- }, dr = ({ sizes: e }) => {
130
- const t = L([]), r = D(
110
+ }, Mn = {
111
+ name: tn,
112
+ type: nn,
113
+ version: rn,
114
+ packageManager: on,
115
+ description: sn,
116
+ author: an,
117
+ license: ln,
118
+ keywords: cn,
119
+ sideEffects: un,
120
+ exports: fn,
121
+ main: dn,
122
+ module: pn,
123
+ types: mn,
124
+ files: gn,
125
+ publishConfig: hn,
126
+ scripts: vn,
127
+ peerDependencies: yn,
128
+ dependencies: wn,
129
+ devDependencies: bn
130
+ };
131
+ function ve(e) {
132
+ return Array.isArray(e);
133
+ }
134
+ function Q(e) {
135
+ return typeof e == "function";
136
+ }
137
+ function Z(e) {
138
+ return e === Object(e) && !ve(e) && !Q(e);
139
+ }
140
+ function W(e) {
141
+ return Z(e) && "isObject3D" in e && !!e.isObject3D;
142
+ }
143
+ function He(e) {
144
+ return Z(e) && "isCamera" in e && !!e.isCamera;
145
+ }
146
+ function _n(e) {
147
+ return Z(e) && "isBufferGeometry" in e && !!e.isBufferGeometry;
148
+ }
149
+ function Pn(e) {
150
+ return Z(e) && "isMaterial" in e && !!e.isMaterial;
151
+ }
152
+ function ot(e) {
153
+ return Z(e) && "isFog" in e && !!e.isFog;
154
+ }
155
+ function Ue(e) {
156
+ return W(e) || _n(e) || Pn(e) || ot(e);
157
+ }
158
+ const Cn = ({ sizes: e }) => {
159
+ const t = D([]), n = j(
131
160
  () => t.value[0]
132
- ), o = (i) => {
133
- const a = i instanceof yt ? i : t.value.find((f) => f.uuid === i);
161
+ ), r = (i) => {
162
+ const a = i instanceof kt ? i : t.value.find((o) => o.uuid === i);
134
163
  if (!a)
135
164
  return;
136
- const n = t.value.filter(({ uuid: f }) => f !== a.uuid);
137
- t.value = [a, ...n];
165
+ const d = t.value.filter(({ uuid: o }) => o !== a.uuid);
166
+ t.value = [a, ...d];
138
167
  }, s = (i, a = !1) => {
139
- t.value.some(({ uuid: n }) => n === i.uuid) || (a ? o(i) : t.value.push(i));
140
- }, c = (i) => {
141
- t.value = t.value.filter(({ uuid: a }) => a !== i.uuid);
168
+ if (He(i)) {
169
+ const d = i;
170
+ if (t.value.some(({ uuid: o }) => o === d.uuid))
171
+ return;
172
+ a ? r(d) : t.value.push(d);
173
+ }
174
+ }, l = (i) => {
175
+ if (He(i)) {
176
+ const a = i;
177
+ t.value = t.value.filter(({ uuid: d }) => d !== a.uuid);
178
+ }
142
179
  };
143
- return ve(() => {
180
+ return Me(() => {
144
181
  e.aspectRatio.value && t.value.forEach((i) => {
145
- !i.manual && (i instanceof pe || mr(i)) && (i instanceof pe ? 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());
182
+ !i.manual && (i instanceof he || En(i)) && (i instanceof he ? 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());
146
183
  });
147
- }), N(() => {
184
+ }), Y(() => {
148
185
  t.value = [];
149
186
  }), {
150
- camera: r,
187
+ camera: n,
151
188
  cameras: t,
152
189
  registerCamera: s,
153
- deregisterCamera: c,
154
- setCameraActive: o
190
+ deregisterCamera: l,
191
+ setCameraActive: r
155
192
  };
156
193
  };
157
- function mr(e) {
194
+ function En(e) {
158
195
  return e.hasOwnProperty("isOrthographicCamera") && e.isOrthographicCamera;
159
196
  }
160
- const Ke = A(), Xe = A(), ye = A(), V = new Ve();
161
- let ne = 0, oe = 0;
162
- const { pause: gr, resume: Be, isActive: vr } = Qe(
197
+ const it = L(), st = L(), Pe = L(), K = new Ze();
198
+ let ae = 0, le = 0;
199
+ const { pause: kn, resume: $e, isActive: Sn } = rt(
163
200
  () => {
164
- Ke.trigger({ delta: ne, elapsed: oe, clock: V }), Xe.trigger({ delta: ne, elapsed: oe, clock: V }), ye.trigger({ delta: ne, elapsed: oe, clock: V });
201
+ it.trigger({ delta: ae, elapsed: le, clock: K }), st.trigger({ delta: ae, elapsed: le, clock: K }), Pe.trigger({ delta: ae, elapsed: le, clock: K });
165
202
  },
166
203
  { immediate: !1 }
167
204
  );
168
- ye.on(() => {
169
- ne = V.getDelta(), oe = V.getElapsedTime();
205
+ Pe.on(() => {
206
+ ae = K.getDelta(), le = K.getElapsedTime();
170
207
  });
171
- let je = !1;
172
- const fn = () => (je || (je = !0, Be()), {
173
- onBeforeLoop: Ke.on,
174
- onLoop: Xe.on,
175
- onAfterLoop: ye.on,
176
- pause: gr,
177
- resume: Be,
178
- isActive: vr
179
- }), pn = !0, K = "[TresJS ▲ ■ ●] ";
180
- function $() {
181
- function e(...o) {
182
- typeof o[0] == "string" ? o[0] = K + o[0] : o.unshift(K), console.error(...o);
208
+ let Fe = !1;
209
+ const Pr = () => (Fe || (Fe = !0, $e()), {
210
+ onBeforeLoop: it.on,
211
+ onLoop: st.on,
212
+ onAfterLoop: Pe.on,
213
+ pause: kn,
214
+ resume: $e,
215
+ isActive: Sn
216
+ }), Cr = !0, ne = "[TresJS ▲ ■ ●] ";
217
+ function F() {
218
+ function e(...r) {
219
+ typeof r[0] == "string" ? r[0] = ne + r[0] : r.unshift(ne), console.error(...r);
183
220
  }
184
- function t(...o) {
185
- typeof o[0] == "string" ? o[0] = K + o[0] : o.unshift(K), console.warn(...o);
221
+ function t(...r) {
222
+ typeof r[0] == "string" ? r[0] = ne + r[0] : r.unshift(ne), console.warn(...r);
186
223
  }
187
- function r(o, s) {
224
+ function n(r, s) {
188
225
  }
189
226
  return {
190
227
  logError: e,
191
228
  logWarning: t,
192
- logMessage: r
229
+ logMessage: n
193
230
  };
194
231
  }
195
- function dn(e) {
196
- return typeof e == "number" ? [e, e, e] : e instanceof he ? [e.x, e.y, e.z] : e;
232
+ function Er(e) {
233
+ return typeof e == "number" ? [e, e, e] : e instanceof _e ? [e.x, e.y, e.z] : e;
197
234
  }
198
- function hr(e) {
199
- return e instanceof re ? e : Array.isArray(e) ? new re(...e) : new re(e);
235
+ function Tn(e) {
236
+ return e instanceof se ? e : Array.isArray(e) ? new se(...e) : new se(e);
200
237
  }
201
- class yr extends Ge.Mesh {
202
- constructor(...r) {
203
- super(...r);
204
- ie(this, "type", "HightlightMesh");
205
- ie(this, "createTime");
238
+ class An extends Xe.Mesh {
239
+ constructor(...n) {
240
+ super(...n);
241
+ ue(this, "type", "HightlightMesh");
242
+ ue(this, "createTime");
206
243
  this.createTime = Date.now();
207
244
  }
208
245
  onBeforeRender() {
209
- const o = (Date.now() - this.createTime) / 1e3, i = 1 + 0.07 * Math.sin(2.5 * o);
246
+ const r = (Date.now() - this.createTime) / 1e3, i = 1 + 0.07 * Math.sin(2.5 * r);
210
247
  this.scale.set(i, i, i);
211
248
  }
212
249
  }
213
- const Ze = (e, t) => {
214
- for (const r of Object.keys(t))
215
- t[r] instanceof Object && Object.assign(t[r], Ze(e[r], t[r]));
250
+ const at = (e, t) => {
251
+ for (const n of Object.keys(t))
252
+ t[n] instanceof Object && Object.assign(t[n], at(e[n], t[n]));
216
253
  return Object.assign(e || {}, t), e;
217
- }, wr = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot", br = /* @__PURE__ */ _r(wr);
218
- function Re(e) {
254
+ }, On = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot", xn = /* @__PURE__ */ Dn(On);
255
+ function We(e) {
219
256
  return e && e.nodeType === 1;
220
257
  }
221
- function X(e) {
222
- return e.replace(/-([a-z])/g, (t, r) => r.toUpperCase());
258
+ function re(e) {
259
+ return e.replace(/-([a-z])/g, (t, n) => n.toUpperCase());
223
260
  }
224
- const Mr = /\B([A-Z])/g;
225
- function Pr(e) {
226
- return e.replace(Mr, "-$1").toLowerCase();
261
+ const Ln = /\B([A-Z])/g;
262
+ function Rn(e) {
263
+ return e.replace(Ln, "-$1").toLowerCase();
227
264
  }
228
- function _r(e, t) {
229
- const r = /* @__PURE__ */ Object.create(null), o = e.split(",");
230
- for (let s = 0; s < o.length; s++)
231
- r[o[s]] = !0;
232
- return (s) => !!r[s];
265
+ function Dn(e, t) {
266
+ const n = /* @__PURE__ */ Object.create(null), r = e.split(",");
267
+ for (let s = 0; s < r.length; s++)
268
+ n[r[s]] = !0;
269
+ return (s) => !!n[s];
233
270
  }
234
- const Cr = (e, t) => {
235
- const r = /* @__PURE__ */ new Set(), o = [];
271
+ const Bn = (e, t) => {
272
+ const n = /* @__PURE__ */ new Set(), r = [];
236
273
  for (const s of e) {
237
- const c = t(s);
238
- r.has(c) || (r.add(c), o.push(s));
274
+ const l = t(s);
275
+ n.has(l) || (n.add(l), r.push(s));
239
276
  }
240
- return o;
241
- }, Ie = (e, t) => {
277
+ return r;
278
+ }, Ne = (e, t) => {
242
279
  if (!t)
243
280
  return;
281
+ const n = Array.isArray(t) ? t : t.match(/([^[.\]])+/g);
282
+ return n == null ? void 0 : n.reduce((r, s) => r && r[s], e);
283
+ }, jn = (e, t, n) => {
244
284
  const r = Array.isArray(t) ? t : t.match(/([^[.\]])+/g);
245
- return r == null ? void 0 : r.reduce((o, s) => o && o[s], e);
246
- }, Er = (e, t, r) => {
247
- const o = Array.isArray(t) ? t : t.match(/([^[.\]])+/g);
248
- o && o.reduce((s, c, i) => (s[c] === void 0 && (s[c] = {}), i === o.length - 1 && (s[c] = r), s[c]), e);
285
+ r && r.reduce((s, l, i) => (s[l] === void 0 && (s[l] = {}), i === r.length - 1 && (s[l] = n), s[l]), e);
249
286
  };
250
- function et(e, t) {
251
- if (Re(e) && Re(t)) {
252
- const s = e.attributes, c = t.attributes;
253
- return s.length !== c.length ? !1 : Array.from(s).every(({ name: i, value: a }) => t.getAttribute(i) === a);
287
+ function lt(e, t) {
288
+ if (We(e) && We(t)) {
289
+ const s = e.attributes, l = t.attributes;
290
+ return s.length !== l.length ? !1 : Array.from(s).every(({ name: i, value: a }) => t.getAttribute(i) === a);
254
291
  }
255
292
  if (e === t)
256
293
  return !0;
257
294
  if (e === null || typeof e != "object" || t === null || typeof t != "object")
258
295
  return !1;
259
- const r = Object.keys(e), o = Object.keys(t);
260
- if (r.length !== o.length)
296
+ const n = Object.keys(e), r = Object.keys(t);
297
+ if (n.length !== r.length)
261
298
  return !1;
262
- for (const s of r)
263
- if (!o.includes(s) || !et(e[s], t[s]))
299
+ for (const s of n)
300
+ if (!r.includes(s) || !lt(e[s], t[s]))
264
301
  return !1;
265
302
  return !0;
266
303
  }
267
- function Sr(e, t) {
304
+ function In(e, t) {
268
305
  if (!Array.isArray(e) || !Array.isArray(t) || e.length !== t.length)
269
306
  return !1;
270
- for (let r = 0; r < e.length; r++)
271
- if (!et(e[r], t[r]))
307
+ for (let n = 0; n < e.length; n++)
308
+ if (!lt(e[n], t[n]))
272
309
  return !1;
273
310
  return !0;
274
311
  }
275
- const Tr = Array.isArray;
276
- function xr(e, t, r, o) {
277
- const s = (n) => {
278
- if (n.uuid === t)
279
- return n;
280
- for (const f of n.children) {
281
- const h = s(f);
312
+ const Hn = Array.isArray;
313
+ function Un(e, t, n, r) {
314
+ const s = (d) => {
315
+ if (d.uuid === t)
316
+ return d;
317
+ for (const o of d.children) {
318
+ const h = s(o);
282
319
  if (h)
283
320
  return h;
284
321
  }
285
- }, c = s(e);
286
- if (!c) {
322
+ }, l = s(e);
323
+ if (!l) {
287
324
  console.warn("Object with UUID not found in the scene.");
288
325
  return;
289
326
  }
290
- let i = c;
291
- for (let n = 0; n < r.length - 1; n++)
292
- if (i[r[n]] !== void 0)
293
- i = i[r[n]];
327
+ let i = l;
328
+ for (let d = 0; d < n.length - 1; d++)
329
+ if (i[n[d]] !== void 0)
330
+ i = i[n[d]];
294
331
  else {
295
- console.warn(`Property path is not valid: ${r.join(".")}`);
332
+ console.warn(`Property path is not valid: ${n.join(".")}`);
296
333
  return;
297
334
  }
298
- const a = r[r.length - 1];
299
- i[a] !== void 0 ? i[a] = o : console.warn(`Property path is not valid: ${r.join(".")}`);
335
+ const a = n[n.length - 1];
336
+ i[a] !== void 0 ? i[a] = r : console.warn(`Property path is not valid: ${n.join(".")}`);
300
337
  }
301
- function kr(e) {
302
- const t = new Ye({
338
+ function $n(e) {
339
+ const t = new tt({
303
340
  color: 11003607,
304
341
  // Highlight color, e.g., yellow
305
342
  transparent: !0,
306
343
  opacity: 0.2,
307
344
  depthTest: !1,
308
345
  // So the highlight is always visible
309
- side: wt
346
+ side: St
310
347
  // To e
311
348
  });
312
- return new yr(e.geometry.clone(), t);
349
+ return new An(e.geometry.clone(), t);
313
350
  }
314
- function Or(e) {
315
- var r;
351
+ function Fn(e) {
352
+ var n;
316
353
  let t = e.value;
317
- return e.value && ((r = e.value) != null && r.isMesh) && (t = e.value.position), Array.isArray(e.value) && (t = new he(...t)), t;
354
+ return e.value && ((n = e.value) != null && n.isMesh) && (t = e.value.position), Array.isArray(e.value) && (t = new _e(...t)), t;
318
355
  }
319
- function Ar(e) {
356
+ function Wn(e) {
320
357
  return "map" in e;
321
358
  }
322
- function He(e) {
323
- Ar(e) && e.map && e.map.dispose(), e.dispose();
359
+ function Ge(e) {
360
+ Wn(e) && e.map && e.map.dispose(), e.dispose();
324
361
  }
325
- function we(e) {
326
- var r, o;
327
- if (e.parent && ((r = e.removeFromParent) == null || r.call(e)), delete e.__tres, [...e.children].forEach((s) => we(s)), !(e instanceof qe)) {
362
+ function Ce(e) {
363
+ var n, r;
364
+ if (e.parent && ((n = e.removeFromParent) == null || n.call(e)), delete e.__tres, [...e.children].forEach((s) => Ce(s)), !(e instanceof et)) {
328
365
  const s = e;
329
- e && ((o = e.dispose) == null || o.call(e)), s.geometry && (s.geometry.dispose(), delete s.geometry), Array.isArray(s.material) ? (s.material.forEach((c) => He(c)), delete s.material) : s.material && (He(s.material), delete s.material);
366
+ e && ((r = e.dispose) == null || r.call(e)), s.geometry && (s.geometry.dispose(), delete s.geometry), Array.isArray(s.material) ? (s.material.forEach((l) => Ge(l)), delete s.material) : s.material && (Ge(s.material), delete s.material);
330
367
  }
331
368
  }
332
- const Lr = Number.parseInt(bt.replace("dev", "")), Z = {
369
+ function Nn(e, t) {
370
+ let n = 0;
371
+ for (let r = 0; r < e.length; r++)
372
+ t(e[r], r) && (e[n] = e[r], n++);
373
+ return e.length = n, e;
374
+ }
375
+ const Gn = Number.parseInt(Tt.replace("dev", "")), oe = {
333
376
  realistic: {
334
377
  shadows: !0,
335
378
  physicallyCorrectLights: !0,
336
- outputColorSpace: Mt,
337
- toneMapping: Je,
379
+ outputColorSpace: At,
380
+ toneMapping: nt,
338
381
  toneMappingExposure: 3,
339
382
  shadowMap: {
340
383
  enabled: !0,
341
- type: Pt
384
+ type: Ot
342
385
  }
343
386
  },
344
387
  flat: {
345
- toneMapping: _t,
388
+ toneMapping: xt,
346
389
  toneMappingExposure: 1
347
390
  }
348
391
  };
349
- function Dr({
392
+ function zn({
350
393
  canvas: e,
351
394
  options: t,
352
- contextParts: { sizes: r, render: o, invalidate: s, advance: c }
395
+ contextParts: { sizes: n, render: r, invalidate: s, advance: l }
353
396
  }) {
354
- const i = D(() => ({
355
- alpha: T(t.alpha) ?? !0,
356
- depth: T(t.depth),
357
- canvas: Ht(e),
358
- context: T(t.context),
359
- stencil: T(t.stencil),
360
- antialias: T(t.antialias) ?? !0,
361
- precision: T(t.precision),
362
- powerPreference: T(t.powerPreference),
363
- premultipliedAlpha: T(t.premultipliedAlpha),
364
- preserveDrawingBuffer: T(t.preserveDrawingBuffer),
365
- logarithmicDepthBuffer: T(t.logarithmicDepthBuffer),
366
- failIfMajorPerformanceCaveat: T(t.failIfMajorPerformanceCaveat)
367
- })), a = H(new ae(i.value));
368
- function n() {
397
+ const i = j(() => ({
398
+ alpha: A(t.alpha) ?? !0,
399
+ depth: A(t.depth),
400
+ canvas: Vt(e),
401
+ context: A(t.context),
402
+ stencil: A(t.stencil),
403
+ antialias: A(t.antialias) ?? !0,
404
+ precision: A(t.precision),
405
+ powerPreference: A(t.powerPreference),
406
+ premultipliedAlpha: A(t.premultipliedAlpha),
407
+ preserveDrawingBuffer: A(t.preserveDrawingBuffer),
408
+ logarithmicDepthBuffer: A(t.logarithmicDepthBuffer),
409
+ failIfMajorPerformanceCaveat: A(t.failIfMajorPerformanceCaveat)
410
+ })), a = $(new fe(i.value));
411
+ function d() {
369
412
  t.renderMode === "on-demand" && s();
370
413
  }
371
- G(i, () => {
372
- a.value.dispose(), a.value = new ae(i.value), n();
373
- }), G([r.width, r.height], () => {
374
- a.value.setSize(r.width.value, r.height.value), n();
414
+ J(i, () => {
415
+ a.value.dispose(), a.value = new fe(i.value), d();
416
+ }), J([n.width, n.height], () => {
417
+ a.value.setSize(n.width.value, n.height.value), d();
375
418
  }, {
376
419
  immediate: !0
377
- }), G(() => t.clearColor, n);
378
- const { pixelRatio: f } = $t();
379
- G(f, () => {
380
- a.value.setPixelRatio(f.value);
420
+ }), J(() => t.clearColor, d);
421
+ const { pixelRatio: o } = Yt();
422
+ J(o, () => {
423
+ a.value.setPixelRatio(o.value);
381
424
  });
382
- const { logError: h } = $(), w = (() => {
383
- const p = new ae(), P = {
425
+ const { logError: h } = F(), c = (() => {
426
+ const f = new fe(), _ = {
384
427
  shadowMap: {
385
- enabled: p.shadowMap.enabled,
386
- type: p.shadowMap.type
428
+ enabled: f.shadowMap.enabled,
429
+ type: f.shadowMap.type
387
430
  },
388
- toneMapping: p.toneMapping,
389
- toneMappingExposure: p.toneMappingExposure,
390
- outputColorSpace: p.outputColorSpace
431
+ toneMapping: f.toneMapping,
432
+ toneMappingExposure: f.toneMappingExposure,
433
+ outputColorSpace: f.outputColorSpace
391
434
  };
392
- return p.dispose(), P;
393
- })(), b = T(t.renderMode);
394
- return b === "on-demand" && s(), b === "manual" && setTimeout(() => {
395
- c();
396
- }, 100), ve(() => {
397
- const p = T(t.preset);
398
- p && (p in Z || h(`Renderer Preset must be one of these: ${Object.keys(Z).join(", ")}`), Ze(a.value, Z[p])), b === "always" && (o.frames.value = Math.max(1, o.frames.value));
399
- const P = (d, M) => {
400
- const _ = T(d), u = () => {
401
- if (p)
402
- return Ie(Z[p], M);
435
+ return f.dispose(), _;
436
+ })(), v = A(t.renderMode);
437
+ return v === "on-demand" && s(), v === "manual" && setTimeout(() => {
438
+ l();
439
+ }, 100), Me(() => {
440
+ const f = A(t.preset);
441
+ f && (f in oe || h(`Renderer Preset must be one of these: ${Object.keys(oe).join(", ")}`), at(a.value, oe[f])), v === "always" && (r.frames.value = Math.max(1, r.frames.value));
442
+ const _ = (y, k) => {
443
+ const P = A(y), C = () => {
444
+ if (f)
445
+ return Ne(oe[f], k);
403
446
  };
404
- if (_ !== void 0)
405
- return _;
406
- const v = u();
407
- return v !== void 0 ? v : Ie(w, M);
408
- }, y = (d, M) => Er(a.value, M, P(d, M));
409
- y(t.shadows, "shadowMap.enabled"), y(t.toneMapping ?? Je, "toneMapping"), y(t.shadowMapType, "shadowMap.type"), Lr < 150 && y(!t.useLegacyLights, "physicallyCorrectLights"), y(t.outputColorSpace, "outputColorSpace"), y(t.toneMappingExposure, "toneMappingExposure");
410
- const g = P(t.clearColor, "clearColor");
411
- g && a.value.setClearColor(
412
- g ? hr(g) : new re(0)
447
+ if (P !== void 0)
448
+ return P;
449
+ const b = C();
450
+ return b !== void 0 ? b : Ne(c, k);
451
+ }, m = (y, k) => jn(a.value, k, _(y, k));
452
+ m(t.shadows, "shadowMap.enabled"), m(t.toneMapping ?? nt, "toneMapping"), m(t.shadowMapType, "shadowMap.type"), Gn < 150 && m(!t.useLegacyLights, "physicallyCorrectLights"), m(t.outputColorSpace, "outputColorSpace"), m(t.toneMappingExposure, "toneMappingExposure");
453
+ const w = _(t.clearColor, "clearColor");
454
+ w && a.value.setClearColor(
455
+ w ? Tn(w) : new se(0)
413
456
  // default clear color is not easily/efficiently retrievable from three
414
457
  );
415
- }), N(() => {
458
+ }), Y(() => {
416
459
  a.value.dispose(), a.value.forceContextLoss();
417
460
  }), {
418
461
  renderer: a
419
462
  };
420
463
  }
421
- const ee = (e) => typeof e == "function", Br = (e) => !!e && e.constructor === Array;
422
- function jr(e) {
464
+ const Vn = (e) => !!e && e.constructor === Array;
465
+ function Yn(e) {
423
466
  const t = { nodes: {}, materials: {} };
424
- return e && e.traverse((r) => {
425
- r.name && (t.nodes[r.name] = r), r.material && !t.materials[r.material.name] && (t.materials[r.material.name] = r.material);
467
+ return e && e.traverse((n) => {
468
+ n.name && (t.nodes[n.name] = n), n.material && !t.materials[n.material.name] && (t.materials[n.material.name] = n.material);
426
469
  }), t;
427
470
  }
428
- async function mn(e, t, r, o, s) {
429
- const { logError: c } = $(), i = new e();
430
- s && s(i), r && r(i);
431
- const n = (Array.isArray(t) ? t : [t]).map(
432
- (f) => new Promise((h, l) => {
471
+ async function kr(e, t, n, r, s) {
472
+ const { logError: l } = F(), i = new e();
473
+ s && s(i), n && n(i);
474
+ const d = (Array.isArray(t) ? t : [t]).map(
475
+ (o) => new Promise((h, p) => {
433
476
  i.load(
434
- f,
435
- (w) => {
436
- w.scene && Object.assign(w, jr(w.scene)), h(w);
437
- },
438
477
  o,
439
- (w) => l(c("[useLoader] - Failed to load resource", w))
478
+ (c) => {
479
+ c.scene && Object.assign(c, Yn(c.scene)), h(c);
480
+ },
481
+ r,
482
+ (c) => p(l("[useLoader] - Failed to load resource", c))
440
483
  );
441
484
  })
442
485
  );
443
- return Br(t) ? await Promise.all(n) : await n[0];
486
+ return Vn(t) ? await Promise.all(d) : await d[0];
444
487
  }
445
- async function gn(e, t) {
446
- const r = new Ct(t), o = (s) => new Promise((c, i) => {
447
- r.load(
488
+ async function Sr(e, t) {
489
+ const n = new Lt(t), r = (s) => new Promise((l, i) => {
490
+ n.load(
448
491
  s,
449
- (a) => c(a),
492
+ (a) => l(a),
450
493
  () => null,
451
494
  () => {
452
495
  i(new Error("[useTextures] - Failed to load texture"));
453
496
  }
454
497
  );
455
498
  });
456
- if (Tr(e)) {
457
- const s = await Promise.all(e.map((c) => o(c)));
499
+ if (Hn(e)) {
500
+ const s = await Promise.all(e.map((l) => r(l)));
458
501
  return e.length > 1 ? s : s[0];
459
502
  } else {
460
503
  const {
461
504
  map: s,
462
- displacementMap: c,
505
+ displacementMap: l,
463
506
  normalMap: i,
464
507
  roughnessMap: a,
465
- metalnessMap: n,
466
- aoMap: f,
508
+ metalnessMap: d,
509
+ aoMap: o,
467
510
  alphaMap: h,
468
- matcap: l
511
+ matcap: p
469
512
  } = e;
470
513
  return {
471
- map: s ? await o(s) : null,
472
- displacementMap: c ? await o(c) : null,
473
- normalMap: i ? await o(i) : null,
474
- roughnessMap: a ? await o(a) : null,
475
- metalnessMap: n ? await o(n) : null,
476
- aoMap: f ? await o(f) : null,
477
- alphaMap: h ? await o(h) : null,
478
- matcap: l ? await o(l) : null
514
+ map: s ? await r(s) : null,
515
+ displacementMap: l ? await r(l) : null,
516
+ normalMap: i ? await r(i) : null,
517
+ roughnessMap: a ? await r(a) : null,
518
+ metalnessMap: d ? await r(d) : null,
519
+ aoMap: o ? await r(o) : null,
520
+ alphaMap: h ? await r(h) : null,
521
+ matcap: p ? await r(p) : null
479
522
  };
480
523
  }
481
524
  }
482
- const tt = (e, t) => {
483
- const r = D(() => t.renderer.value.domElement), o = H([]), { x: s, y: c } = Ft({ target: r }), i = D(() => e.value.filter((m) => {
484
- var C;
485
- return ((C = m.__tres) == null ? void 0 : C.eventCount) > 0;
486
- }));
487
- let a = 0;
488
- const { width: n, height: f, top: h, left: l } = Ut(r), w = ({ x: m, y: C }) => {
489
- if (r.value)
525
+ const ct = (e, t) => {
526
+ const n = j(() => t.renderer.value.domElement), r = $([]), { x: s, y: l } = qt({ target: n });
527
+ let i = 0;
528
+ const { width: a, height: d, top: o, left: h } = Jt(n), p = ({ x: g, y: S }) => {
529
+ if (n.value)
490
530
  return {
491
- x: (m - l.value) / n.value * 2 - 1,
492
- y: -((C - h.value) / f.value) * 2 + 1
531
+ x: (g - h.value) / a.value * 2 - 1,
532
+ y: -((S - o.value) / d.value) * 2 + 1
493
533
  };
494
- }, b = ({ x: m, y: C }) => {
534
+ }, c = ({ x: g, y: S }) => {
495
535
  if (t.camera.value)
496
- return t.raycaster.value.setFromCamera(new le(m, C), t.camera.value), o.value = t.raycaster.value.intersectObjects(i.value, !0), o.value;
497
- }, p = (m) => {
498
- const C = w({
499
- x: (m == null ? void 0 : m.clientX) ?? s.value,
500
- y: (m == null ? void 0 : m.clientY) ?? c.value
536
+ return t.raycaster.value.setFromCamera(new de(g, S), t.camera.value), r.value = t.raycaster.value.intersectObjects(e.value, !0), r.value;
537
+ }, v = (g) => {
538
+ const S = p({
539
+ x: (g == null ? void 0 : g.clientX) ?? s.value,
540
+ y: (g == null ? void 0 : g.clientY) ?? l.value
501
541
  });
502
- return C ? b(C) || [] : [];
503
- }, P = A(), y = A(), g = A(), d = A(), M = A(), _ = A(), u = A(), v = A();
504
- function E(m) {
505
- const C = {};
506
- for (const R in m)
507
- typeof R != "function" && (C[R] = m[R]);
508
- return C;
542
+ return S ? c(S) || [] : [];
543
+ }, f = L(), _ = L(), m = L(), w = L(), y = L(), k = L(), P = L(), C = L();
544
+ function b(g) {
545
+ const S = {};
546
+ for (const H in g)
547
+ typeof H != "function" && (S[H] = g[H]);
548
+ return S;
509
549
  }
510
- const S = (m, C) => {
511
- var Ee, Se, Te;
512
- const R = E(C), Q = new he(C == null ? void 0 : C.clientX, C == null ? void 0 : C.clientY, 0).unproject((Ee = t.camera) == null ? void 0 : Ee.value);
513
- m.trigger({
514
- ...R,
515
- intersections: o.value,
550
+ const u = (g, S) => {
551
+ var Ae, Oe, xe;
552
+ const H = b(S), te = new _e(S == null ? void 0 : S.clientX, S == null ? void 0 : S.clientY, 0).unproject((Ae = t.camera) == null ? void 0 : Ae.value);
553
+ g.trigger({
554
+ ...H,
555
+ intersections: r.value,
516
556
  // The unprojectedPoint is wrong, math needs to be fixed
517
- unprojectedPoint: Q,
518
- ray: (Se = t.raycaster) == null ? void 0 : Se.value.ray,
519
- camera: (Te = t.camera) == null ? void 0 : Te.value,
520
- sourceEvent: C,
521
- delta: a,
557
+ unprojectedPoint: te,
558
+ ray: (Oe = t.raycaster) == null ? void 0 : Oe.value.ray,
559
+ camera: (xe = t.camera) == null ? void 0 : xe.value,
560
+ sourceEvent: S,
561
+ delta: i,
522
562
  stopPropagating: !1
523
563
  });
524
564
  };
525
- let B;
526
- const x = (m) => {
527
- p(m), S(g, m), B = m;
528
- }, k = () => {
529
- B && x(B);
565
+ let M;
566
+ const E = (g) => {
567
+ v(g), u(m, g), M = g;
568
+ }, T = () => {
569
+ M && E(M);
530
570
  };
531
- let F, O, q;
532
- const Y = (m) => {
533
- var C;
534
- F = (C = o.value[0]) == null ? void 0 : C.object, a = 0, O = new le(
535
- (m == null ? void 0 : m.clientX) ?? s.value,
536
- (m == null ? void 0 : m.clientY) ?? c.value
537
- ), S(M, m);
571
+ let I, O, x;
572
+ const N = (g) => {
573
+ var S;
574
+ I = (S = r.value[0]) == null ? void 0 : S.object, i = 0, O = new de(
575
+ (g == null ? void 0 : g.clientX) ?? s.value,
576
+ (g == null ? void 0 : g.clientY) ?? l.value
577
+ ), u(y, g);
538
578
  };
539
- let se, J = !1;
540
- const Me = (m) => {
541
- var C, R, Q;
542
- m instanceof PointerEvent && (o.value.length === 0 && S(_, m), F === ((C = o.value[0]) == null ? void 0 : C.object) && (q = new le(
543
- (m == null ? void 0 : m.clientX) ?? s.value,
544
- (m == null ? void 0 : m.clientY) ?? c.value
545
- ), a = O == null ? void 0 : O.distanceTo(q), m.button === 0 ? (S(P, m), se === ((R = o.value[0]) == null ? void 0 : R.object) ? J = !0 : (se = (Q = o.value[0]) == null ? void 0 : Q.object, J = !1)) : m.button === 2 && S(u, m)), S(d, m));
546
- }, Pe = (m) => {
547
- J && (S(y, m), se = void 0, J = !1);
548
- }, _e = (m) => S(g, m), Ce = (m) => S(v, m);
549
- return r.value.addEventListener("pointerup", Me), r.value.addEventListener("pointerdown", Y), r.value.addEventListener("pointermove", x), r.value.addEventListener("pointerleave", _e), r.value.addEventListener("dblclick", Pe), r.value.addEventListener("wheel", Ce), N(() => {
550
- r != null && r.value && (r.value.removeEventListener("pointerup", Me), r.value.removeEventListener("pointerdown", Y), r.value.removeEventListener("pointermove", x), r.value.removeEventListener("pointerleave", _e), r.value.removeEventListener("dblclick", Pe), r.value.removeEventListener("wheel", Ce));
579
+ let R, G = !1;
580
+ const ee = (g) => {
581
+ var S, H, te;
582
+ g instanceof PointerEvent && (r.value.length === 0 && u(k, g), I === ((S = r.value[0]) == null ? void 0 : S.object) && (x = new de(
583
+ (g == null ? void 0 : g.clientX) ?? s.value,
584
+ (g == null ? void 0 : g.clientY) ?? l.value
585
+ ), i = O == null ? void 0 : O.distanceTo(x), g.button === 0 ? (u(f, g), R === ((H = r.value[0]) == null ? void 0 : H.object) ? G = !0 : (R = (te = r.value[0]) == null ? void 0 : te.object, G = !1)) : g.button === 2 && u(P, g)), u(w, g));
586
+ }, ke = (g) => {
587
+ G && (u(_, g), R = void 0, G = !1);
588
+ }, Se = (g) => u(m, g), Te = (g) => u(C, g);
589
+ return n.value.addEventListener("pointerup", ee), n.value.addEventListener("pointerdown", N), n.value.addEventListener("pointermove", E), n.value.addEventListener("pointerleave", Se), n.value.addEventListener("dblclick", ke), n.value.addEventListener("wheel", Te), Y(() => {
590
+ n != null && n.value && (n.value.removeEventListener("pointerup", ee), n.value.removeEventListener("pointerdown", N), n.value.removeEventListener("pointermove", E), n.value.removeEventListener("pointerleave", Se), n.value.removeEventListener("dblclick", ke), n.value.removeEventListener("wheel", Te));
551
591
  }), {
552
- intersects: o,
553
- onClick: (m) => P.on(m).off,
554
- onDblClick: (m) => y.on(m).off,
555
- onContextMenu: (m) => u.on(m).off,
556
- onPointerMove: (m) => g.on(m).off,
557
- onPointerUp: (m) => d.on(m).off,
558
- onPointerDown: (m) => M.on(m).off,
559
- onPointerMissed: (m) => _.on(m).off,
560
- onWheel: (m) => v.on(m).off,
561
- forceUpdate: k
592
+ intersects: r,
593
+ onClick: (g) => f.on(g).off,
594
+ onDblClick: (g) => _.on(g).off,
595
+ onContextMenu: (g) => P.on(g).off,
596
+ onPointerMove: (g) => m.on(g).off,
597
+ onPointerUp: (g) => w.on(g).off,
598
+ onPointerDown: (g) => y.on(g).off,
599
+ onPointerMissed: (g) => k.on(g).off,
600
+ onWheel: (g) => C.on(g).off,
601
+ forceUpdate: T
562
602
  };
563
603
  };
564
- function vn() {
565
- const { logWarning: e } = $();
566
- function t(c, i, a) {
567
- let n = null;
568
- return c.traverse((f) => {
569
- f[i] === a && (n = f);
570
- }), n || e(`Child with ${i} '${a}' not found.`), n;
604
+ function Tr() {
605
+ const { logWarning: e } = F();
606
+ function t(l, i, a) {
607
+ let d = null;
608
+ return l.traverse((o) => {
609
+ o[i] === a && (d = o);
610
+ }), d || e(`Child with ${i} '${a}' not found.`), d;
571
611
  }
572
- function r(c, i, a) {
573
- const n = [];
574
- return c.traverse((f) => {
575
- f[i].includes(a) && n.push(f);
576
- }), n.length || e(`Children with ${i} '${a}' not found.`), n;
612
+ function n(l, i, a) {
613
+ const d = [];
614
+ return l.traverse((o) => {
615
+ o[i].includes(a) && d.push(o);
616
+ }), d.length || e(`Children with ${i} '${a}' not found.`), d;
577
617
  }
578
- function o(c, i) {
579
- return t(c, "name", i);
618
+ function r(l, i) {
619
+ return t(l, "name", i);
580
620
  }
581
- function s(c, i) {
582
- return r(c, "name", i);
621
+ function s(l, i) {
622
+ return n(l, "name", i);
583
623
  }
584
624
  return {
585
625
  seek: t,
586
- seekByName: o,
587
- seekAll: r,
626
+ seekByName: r,
627
+ seekAll: n,
588
628
  seekAllByName: s
589
629
  };
590
630
  }
591
- const hn = (e) => {
592
- const t = ze({
631
+ const Ar = (e) => {
632
+ const t = Ke({
593
633
  click: /* @__PURE__ */ new Map(),
594
634
  pointerMove: /* @__PURE__ */ new Map(),
595
635
  pointerEnter: /* @__PURE__ */ new Map(),
596
636
  pointerLeave: /* @__PURE__ */ new Map()
597
- }), r = L(/* @__PURE__ */ new Set()), o = (l) => {
598
- r.value.add(l);
599
- }, s = (l) => {
600
- r.value.delete(l);
601
- }, c = (l) => {
602
- Object.values(t).forEach((w) => w.delete(l)), s(l);
603
- }, i = (l) => {
604
- const { onClick: w, onPointerMove: b, onPointerEnter: p, onPointerLeave: P } = l;
605
- w && t.click.set(l, w), b && t.pointerMove.set(l, b), p && t.pointerEnter.set(l, p), P && t.pointerLeave.set(l, P);
606
- }, a = D(
607
- () => Cr(
637
+ }), n = D(/* @__PURE__ */ new Set()), r = (p) => {
638
+ n.value.add(p);
639
+ }, s = (p) => {
640
+ n.value.delete(p);
641
+ }, l = (p) => {
642
+ Object.values(t).forEach((c) => c.delete(p)), s(p);
643
+ }, i = (p) => {
644
+ const { onClick: c, onPointerMove: v, onPointerEnter: f, onPointerLeave: _ } = p;
645
+ c && t.click.set(p, c), v && t.pointerMove.set(p, v), f && t.pointerEnter.set(p, f), _ && t.pointerLeave.set(p, _);
646
+ }, a = j(
647
+ () => Bn(
608
648
  [
609
- ...Array.from(r.value),
610
- ...Object.values(t).map((l) => Array.from(l.keys())).flat()
649
+ ...Array.from(n.value),
650
+ ...Object.values(t).map((p) => Array.from(p.keys())).flat()
611
651
  ],
612
- ({ uuid: l }) => l
652
+ ({ uuid: p }) => p
613
653
  )
614
654
  );
615
- e.registerObjectAtPointerEventHandler = i, e.deregisterObjectAtPointerEventHandler = c, e.registerBlockingObjectAtPointerEventHandler = o, e.deregisterBlockingObjectAtPointerEventHandler = s;
616
- const { onClick: n, onPointerMove: f } = tt(a, e);
617
- n(({ intersects: l, event: w }) => {
618
- var b;
619
- l.length && ((b = t.click.get(l[0].object)) == null || b(l[0], w));
655
+ e.registerObjectAtPointerEventHandler = i, e.deregisterObjectAtPointerEventHandler = l, e.registerBlockingObjectAtPointerEventHandler = r, e.deregisterBlockingObjectAtPointerEventHandler = s;
656
+ const { onClick: d, onPointerMove: o } = ct(a, e);
657
+ d(({ intersects: p, event: c }) => {
658
+ var v;
659
+ p.length && ((v = t.click.get(p[0].object)) == null || v(p[0], c));
620
660
  });
621
661
  let h;
622
- return f(({ intersects: l, event: w }) => {
623
- var g, d, M, _;
624
- const b = (g = l == null ? void 0 : l[0]) == null ? void 0 : g.object, { pointerLeave: p, pointerEnter: P, pointerMove: y } = t;
625
- h && h !== b && ((d = p.get(h)) == null || d(h, w)), b && (h !== b && ((M = P.get(b)) == null || M(l[0], w)), (_ = y.get(b)) == null || _(l[0], w)), h = b || null;
662
+ return o(({ intersects: p, event: c }) => {
663
+ var w, y, k, P;
664
+ const v = (w = p == null ? void 0 : p[0]) == null ? void 0 : w.object, { pointerLeave: f, pointerEnter: _, pointerMove: m } = t;
665
+ h && h !== v && ((y = f.get(h)) == null || y(h, c)), v && (h !== v && ((k = _.get(v)) == null || k(p[0], c)), (P = m.get(v)) == null || P(p[0], c)), h = v || null;
626
666
  }), {
627
667
  registerObject: i,
628
- deregisterObject: c,
629
- registerBlockingObject: o,
668
+ deregisterObject: l,
669
+ registerBlockingObject: r,
630
670
  deregisterBlockingObject: s
631
671
  };
632
672
  };
633
- function be(e) {
673
+ function Ee(e) {
634
674
  let t = 0;
635
- return e.traverse((r) => {
636
- if (r.isMesh && r.geometry) {
637
- const o = r.geometry, s = o.attributes.position.count * 3 * Float32Array.BYTES_PER_ELEMENT, c = o.index ? o.index.count * Uint32Array.BYTES_PER_ELEMENT : 0, i = o.attributes.normal ? o.attributes.normal.count * 3 * Float32Array.BYTES_PER_ELEMENT : 0, a = o.attributes.uv ? o.attributes.uv.count * 2 * Float32Array.BYTES_PER_ELEMENT : 0, n = s + c + i + a;
638
- t += n;
675
+ return e.traverse((n) => {
676
+ if (n.isMesh && n.geometry) {
677
+ const r = n.geometry, s = r.attributes.position.count * 3 * Float32Array.BYTES_PER_ELEMENT, l = r.index ? r.index.count * Uint32Array.BYTES_PER_ELEMENT : 0, i = r.attributes.normal ? r.attributes.normal.count * 3 * Float32Array.BYTES_PER_ELEMENT : 0, a = r.attributes.uv ? r.attributes.uv.count * 2 * Float32Array.BYTES_PER_ELEMENT : 0, d = s + l + i + a;
678
+ t += d;
639
679
  }
640
680
  }), t;
641
681
  }
642
- function Rr(e) {
682
+ function qn(e) {
643
683
  return (e / 1024).toFixed(2);
644
684
  }
645
- const de = L({}), me = (e) => Object.assign(de.value, e);
646
- function Ir(e, t, r = 10) {
647
- const o = T(e) ? Wt() : Nt(D(() => T(t).parentElement)), s = ue(De(o.width, r)), c = ue(De(o.height, r)), i = D(() => s.value / c.value);
685
+ const ye = D({}), we = (e) => Object.assign(ye.value, e);
686
+ function Jn(e, t, n = 10) {
687
+ const r = A(e) ? Qt() : Kt(j(() => A(t).parentElement)), s = me(Ie(r.width, n)), l = me(Ie(r.height, n)), i = j(() => s.value / l.value);
648
688
  return {
649
- height: c,
689
+ height: l,
650
690
  width: s,
651
691
  aspectRatio: i
652
692
  };
653
693
  }
654
- function ce() {
694
+ function pe() {
655
695
  const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Set();
656
- let r = 0, o = !1;
696
+ let n = 0, r = !1;
657
697
  const s = () => {
658
- const f = Array.from(e.entries()).sort((h, l) => {
659
- const w = h[1].priority - l[1].priority;
660
- return w === 0 ? h[1].addI - l[1].addI : w;
698
+ const o = Array.from(e.entries()).sort((h, p) => {
699
+ const c = h[1].priority - p[1].priority;
700
+ return c === 0 ? h[1].addI - p[1].addI : c;
661
701
  });
662
- t.clear(), f.forEach((h) => t.add(h[0]));
663
- }, c = (f) => {
664
- e.delete(f), t.delete(f);
702
+ t.clear(), o.forEach((h) => t.add(h[0]));
703
+ }, l = (o) => {
704
+ e.delete(o), t.delete(o);
665
705
  };
666
- return { on: (f, h = 0) => {
667
- e.set(f, { priority: h, addI: r++ });
668
- const l = () => c(f);
669
- return zt(l), o = !0, {
670
- off: l
706
+ return { on: (o, h = 0) => {
707
+ e.set(o, { priority: h, addI: n++ });
708
+ const p = () => l(o);
709
+ return Xt(p), r = !0, {
710
+ off: p
671
711
  };
672
- }, off: c, trigger: (...f) => {
673
- o && (s(), o = !1), t.forEach((h) => h(...f));
712
+ }, off: l, trigger: (...o) => {
713
+ r && (s(), r = !1), t.forEach((h) => h(...o));
674
714
  }, dispose: () => {
675
715
  e.clear(), t.clear();
676
716
  }, get count() {
677
717
  return e.size;
678
718
  } };
679
719
  }
680
- function Hr() {
681
- const e = new Ve(!1), t = L(!1), r = L(!1);
682
- let o;
683
- const s = Et.generateUUID();
684
- let c = null;
685
- const i = ce(), a = ce(), n = ce();
686
- let f = {};
687
- function h(M) {
688
- f = M;
720
+ function Qn() {
721
+ let e = !0, t = !0, n = !1;
722
+ const r = new Ze(!1), s = D(r.running), l = D(!1);
723
+ let i;
724
+ const a = Rt.generateUUID();
725
+ let d = null;
726
+ const o = pe(), h = pe(), p = pe();
727
+ b();
728
+ let c = {};
729
+ function v(u) {
730
+ c = u;
689
731
  }
690
- function l(M, _, u = 0) {
691
- switch (_) {
732
+ function f(u, M, E = 0) {
733
+ switch (M) {
692
734
  case "before":
693
- return i.on(M, u);
735
+ return o.on(u, E);
694
736
  case "render":
695
- return c || (c = M), a.dispose(), a.on(M);
737
+ return d || (d = u), h.dispose(), h.on(u);
696
738
  case "after":
697
- return n.on(M, u);
739
+ return p.on(u, E);
698
740
  }
699
741
  }
742
+ function _() {
743
+ t && (t = !1, b(), C());
744
+ }
745
+ function m() {
746
+ t = !0, b(), cancelAnimationFrame(i);
747
+ }
700
748
  function w() {
701
- t.value || (e.start(), t.value = !0, d());
749
+ n = !1, b();
702
750
  }
703
- function b() {
704
- t.value && (e.stop(), cancelAnimationFrame(o), t.value = !1);
751
+ function y() {
752
+ n = !0, b();
705
753
  }
706
- function p() {
707
- e.stop(), t.value = !1;
754
+ function k() {
755
+ l.value = !0;
708
756
  }
709
757
  function P() {
710
- e.start(), t.value = !0;
758
+ l.value = !1;
711
759
  }
712
- function y() {
713
- r.value = !0;
760
+ function C() {
761
+ if (!e) {
762
+ i = requestAnimationFrame(C);
763
+ return;
764
+ }
765
+ const u = r.getDelta(), M = r.getElapsedTime(), E = {
766
+ camera: V(c.camera),
767
+ scene: V(c.scene),
768
+ renderer: V(c.renderer),
769
+ raycaster: V(c.raycaster),
770
+ controls: V(c.controls),
771
+ invalidate: c.invalidate,
772
+ advance: c.advance
773
+ }, T = { delta: u, elapsed: M, clock: r, ...E };
774
+ s.value && o.trigger(T), l.value || (h.count ? h.trigger(T) : d && d(T)), s.value && p.trigger(T), i = requestAnimationFrame(C);
714
775
  }
715
- function g() {
716
- r.value = !1;
776
+ function b() {
777
+ const u = !t && !n;
778
+ r.running !== u && (r.running ? r.stop() : r.start()), s.value = r.running;
717
779
  }
780
+ return {
781
+ loopId: a,
782
+ register: (u, M, E) => f(u, M, E),
783
+ start: _,
784
+ stop: m,
785
+ pause: y,
786
+ resume: w,
787
+ pauseRender: k,
788
+ resumeRender: P,
789
+ isRenderPaused: l,
790
+ isActive: s,
791
+ setContext: v,
792
+ setReady: (u) => e = u
793
+ };
794
+ }
795
+ function Kn(e, t, n = 100) {
796
+ n = n <= 0 ? 100 : n;
797
+ const r = L(), s = /* @__PURE__ */ new Set();
798
+ let l = !1, i = !1, a = null;
718
799
  function d() {
719
- const M = e.getDelta(), _ = e.getElapsedTime(), u = {
720
- camera: W(f.camera),
721
- scene: W(f.scene),
722
- renderer: W(f.renderer),
723
- raycaster: W(f.raycaster),
724
- controls: W(f.controls),
725
- invalidate: f.invalidate,
726
- advance: f.advance
727
- }, v = { delta: M, elapsed: _, clock: e, ...u };
728
- t.value && i.trigger(v), r.value || (a.count ? a.trigger(v) : c && c(v)), t.value && n.trigger(v), o = requestAnimationFrame(d);
800
+ a && clearTimeout(a), !i && !l && e() ? (r.trigger(t), s.forEach((c) => c()), s.clear(), l = !0) : !i && !l && (a = setTimeout(d, n));
729
801
  }
802
+ function o() {
803
+ i = !0, a && clearTimeout(a);
804
+ }
805
+ d();
806
+ const h = (c, ...v) => {
807
+ c(...v);
808
+ };
730
809
  return {
731
- loopId: s,
732
- register: (M, _, u) => l(M, _, u),
733
- start: w,
734
- stop: b,
735
- pause: p,
736
- resume: P,
737
- pauseRender: y,
738
- resumeRender: g,
739
- isRenderPaused: r,
740
- isActive: t,
741
- setContext: h
810
+ on: (c) => {
811
+ if (l)
812
+ return h(c, t), { off: () => {
813
+ } };
814
+ {
815
+ const v = r.on(c);
816
+ return s.add(v.off), r.on(c);
817
+ }
818
+ },
819
+ off: r.off,
820
+ trigger: r.trigger,
821
+ cancel: o
742
822
  };
743
823
  }
744
- function $r({
824
+ const X = /* @__PURE__ */ new WeakMap();
825
+ function ut(e) {
826
+ if (e = e || ce(), X.has(e))
827
+ return X.get(e);
828
+ const t = 100, n = Date.now(), l = Kn(() => {
829
+ if (Date.now() - n >= t)
830
+ return !0;
831
+ {
832
+ const i = e.renderer.value, a = (i == null ? void 0 : i.domElement) || { width: 0, height: 0 };
833
+ return !!(i && a.width > 0 && a.height > 0);
834
+ }
835
+ }, e);
836
+ return X.set(e, l), l;
837
+ }
838
+ function Or(e) {
839
+ const t = ce();
840
+ if (t)
841
+ return X.has(t) ? X.get(t).on(e) : ut(t).on(e);
842
+ }
843
+ function Xn({
745
844
  scene: e,
746
845
  canvas: t,
747
- windowSize: r,
748
- disableRender: o,
846
+ windowSize: n,
847
+ disableRender: r,
749
848
  rendererOptions: s,
750
- emit: c
849
+ emit: l
751
850
  }) {
752
- const { logWarning: i } = $(), a = H(e), n = Ir(r, t), {
753
- camera: f,
851
+ const { logWarning: i } = F(), a = $(e), d = Jn(n, t), {
852
+ camera: o,
754
853
  cameras: h,
755
- registerCamera: l,
756
- deregisterCamera: w,
757
- setCameraActive: b
758
- } = dr({ sizes: n, scene: e }), p = {
759
- mode: L(s.renderMode || "always"),
760
- priority: L(0),
761
- frames: L(0),
854
+ registerCamera: p,
855
+ deregisterCamera: c,
856
+ setCameraActive: v
857
+ } = Cn({ sizes: d, scene: e }), f = {
858
+ mode: D(s.renderMode || "always"),
859
+ priority: D(0),
860
+ frames: D(0),
762
861
  maxFrames: 60,
763
- canBeInvalidated: D(() => p.mode.value === "on-demand" && p.frames.value === 0)
862
+ canBeInvalidated: j(() => f.mode.value === "on-demand" && f.frames.value === 0)
764
863
  };
765
- function P(O = 1) {
766
- s.renderMode === "on-demand" ? p.frames.value = Math.min(p.maxFrames, p.frames.value + O) : i("`invalidate` can only be used when `renderMode` is set to `on-demand`");
864
+ function _(R = 1) {
865
+ s.renderMode === "on-demand" ? f.frames.value = Math.min(f.maxFrames, f.frames.value + R) : i("`invalidate` can only be used when `renderMode` is set to `on-demand`");
767
866
  }
768
- function y() {
769
- s.renderMode === "manual" ? p.frames.value = 1 : i("`advance` can only be used when `renderMode` is set to `manual`");
867
+ function m() {
868
+ s.renderMode === "manual" ? f.frames.value = 1 : i("`advance` can only be used when `renderMode` is set to `manual`");
770
869
  }
771
- const { renderer: g } = Dr(
870
+ const { renderer: w } = zn(
772
871
  {
773
872
  scene: e,
774
873
  canvas: t,
775
874
  options: s,
776
- emit: c,
875
+ emit: l,
777
876
  // TODO: replace contextParts with full ctx at https://github.com/Tresjs/tres/issues/516
778
- contextParts: { sizes: n, camera: f, render: p, invalidate: P, advance: y },
779
- disableRender: o
877
+ contextParts: { sizes: d, camera: o, render: f, invalidate: _, advance: m },
878
+ disableRender: r
780
879
  }
781
- ), d = {
782
- sizes: n,
880
+ ), y = {
881
+ sizes: d,
783
882
  scene: a,
784
- camera: f,
785
- cameras: ue(h),
786
- renderer: g,
787
- raycaster: H(new St()),
788
- controls: L(null),
883
+ camera: o,
884
+ cameras: me(h),
885
+ renderer: w,
886
+ raycaster: $(new Dt()),
887
+ controls: D(null),
789
888
  perf: {
790
889
  maxFrames: 160,
791
890
  fps: {
@@ -798,152 +897,183 @@ function $r({
798
897
  accumulator: []
799
898
  }
800
899
  },
801
- render: p,
802
- advance: y,
803
- extend: me,
804
- invalidate: P,
805
- registerCamera: l,
806
- setCameraActive: b,
807
- deregisterCamera: w,
808
- loop: Hr()
900
+ render: f,
901
+ advance: m,
902
+ extend: we,
903
+ invalidate: _,
904
+ registerCamera: p,
905
+ setCameraActive: v,
906
+ deregisterCamera: c,
907
+ loop: Qn()
809
908
  };
810
- fe("useTres", d), d.scene.value.__tres = {
811
- root: d
812
- }, d.loop.register(() => {
813
- f.value && p.frames.value > 0 && (g.value.render(e, f.value), c("render", d.renderer.value)), p.priority.value = 0, p.mode.value === "always" ? p.frames.value = 1 : p.frames.value = Math.max(0, p.frames.value - 1);
814
- }, "render"), d.loop.start(), N(() => {
815
- d.loop.stop();
909
+ ge("useTres", y), y.scene.value.__tres = {
910
+ root: y
911
+ }, y.loop.register(() => {
912
+ o.value && f.frames.value > 0 && (w.value.render(e, o.value), l("render", y.renderer.value)), f.priority.value = 0, f.mode.value === "always" ? f.frames.value = 1 : f.frames.value = Math.max(0, f.frames.value - 1);
913
+ }, "render");
914
+ const { on: k, cancel: P } = ut(y);
915
+ y.loop.setReady(!1), y.loop.start(), k(() => {
916
+ l("ready", y), y.loop.setReady(!0);
917
+ }), Y(() => {
918
+ P(), y.loop.stop();
816
919
  });
817
- const M = 100, _ = Gt({ every: M }), { isSupported: u, memory: v } = Vt({ interval: M }), E = 160;
818
- let S = performance.now();
819
- const B = ({ timestamp: O }) => {
820
- d.scene.value && (d.perf.memory.allocatedMem = be(d.scene.value)), O - S >= M && (S = O, d.perf.fps.accumulator.push(_.value), d.perf.fps.accumulator.length > E && d.perf.fps.accumulator.shift(), d.perf.fps.value = _.value, u.value && v.value && (d.perf.memory.accumulator.push(v.value.usedJSHeapSize / 1024 / 1024), d.perf.memory.accumulator.length > E && d.perf.memory.accumulator.shift(), d.perf.memory.currentMem = d.perf.memory.accumulator.reduce((q, Y) => q + Y, 0) / d.perf.memory.accumulator.length));
920
+ const C = 100, b = Zt({ every: C }), { isSupported: u, memory: M } = en({ interval: C }), E = 160;
921
+ let T = performance.now();
922
+ const I = ({ timestamp: R }) => {
923
+ y.scene.value && (y.perf.memory.allocatedMem = Ee(y.scene.value)), R - T >= C && (T = R, y.perf.fps.accumulator.push(b.value), y.perf.fps.accumulator.length > E && y.perf.fps.accumulator.shift(), y.perf.fps.value = b.value, u.value && M.value && (y.perf.memory.accumulator.push(M.value.usedJSHeapSize / 1024 / 1024), y.perf.memory.accumulator.length > E && y.perf.memory.accumulator.shift(), y.perf.memory.currentMem = y.perf.memory.accumulator.reduce((G, ee) => G + ee, 0) / y.perf.memory.accumulator.length));
821
924
  };
822
- let x = 0;
823
- const k = 1, { pause: F } = Qe(({ delta: O }) => {
824
- window.__TRES__DEVTOOLS__ && (B({ timestamp: performance.now() }), x += O, x >= k && (window.__TRES__DEVTOOLS__.cb(d), x = 0));
925
+ let O = 0;
926
+ const x = 1, { pause: N } = rt(({ delta: R }) => {
927
+ window.__TRES__DEVTOOLS__ && (I({ timestamp: performance.now() }), O += R, O >= x && (window.__TRES__DEVTOOLS__.cb(y), O = 0));
825
928
  }, { immediate: !0 });
826
- return N(() => {
827
- F();
828
- }), d;
929
+ return Y(() => {
930
+ N();
931
+ }), y;
829
932
  }
830
- function rt() {
831
- const e = ct("useTres");
933
+ function ce() {
934
+ const e = vt("useTres");
832
935
  if (!e)
833
936
  throw new Error("useTresContext must be used together with useTresContextProvider");
834
937
  return e;
835
938
  }
836
- const yn = rt;
837
- function wn() {
939
+ const xr = ce;
940
+ function Lr() {
838
941
  const {
839
942
  camera: e,
840
943
  scene: t,
841
- renderer: r,
842
- loop: o,
944
+ renderer: n,
945
+ loop: r,
843
946
  raycaster: s,
844
- controls: c,
947
+ controls: l,
845
948
  invalidate: i,
846
949
  advance: a
847
- } = rt();
848
- o.setContext({
950
+ } = ce();
951
+ r.setContext({
849
952
  camera: e,
850
953
  scene: t,
851
- renderer: r,
954
+ renderer: n,
852
955
  raycaster: s,
853
- controls: c,
956
+ controls: l,
854
957
  invalidate: i,
855
958
  advance: a
856
959
  });
857
- function n(l, w = 0) {
858
- return o.register(l, "before", w);
960
+ function d(p, c = 0) {
961
+ return r.register(p, "before", c);
859
962
  }
860
- function f(l) {
861
- return o.register(l, "render");
963
+ function o(p) {
964
+ return r.register(p, "render");
862
965
  }
863
- function h(l, w = 0) {
864
- return o.register(l, "after", w);
966
+ function h(p, c = 0) {
967
+ return r.register(p, "after", c);
865
968
  }
866
969
  return {
867
- pause: o.pause,
868
- resume: o.resume,
869
- pauseRender: o.pauseRender,
870
- resumeRender: o.resumeRender,
871
- isActive: o.isActive,
872
- onBeforeRender: n,
873
- render: f,
970
+ pause: r.pause,
971
+ resume: r.resume,
972
+ pauseRender: r.pauseRender,
973
+ resumeRender: r.resumeRender,
974
+ isActive: r.isActive,
975
+ onBeforeRender: d,
976
+ render: o,
874
977
  onAfterRender: h
875
978
  };
876
979
  }
877
- function Fr(e, t, r) {
878
- const o = H(), s = H();
879
- e && (o.value = e), t && (s.value = t);
880
- const c = D(
881
- () => o.value ? o.value.children : []
882
- );
883
- function i(u, v) {
980
+ function Zn(e, t, n) {
981
+ const r = $(), s = $();
982
+ e && (r.value = e), t && (s.value = t);
983
+ const l = (u) => {
984
+ var M;
985
+ return ((M = u.__tres) == null ? void 0 : M.eventCount) > 0;
986
+ }, i = (u) => {
987
+ var M;
988
+ return ((M = u.children) == null ? void 0 : M.some((E) => i(E))) || l(u);
989
+ }, a = j(() => {
990
+ var u, M;
991
+ return ((M = (u = r.value) == null ? void 0 : u.children) == null ? void 0 : M.filter(i)) || [];
992
+ });
993
+ function d(u, M) {
884
994
  if (Array.isArray(u))
885
995
  for (const E of u)
886
- E(v);
887
- typeof u == "function" && u(v);
996
+ E(M);
997
+ typeof u == "function" && u(M);
888
998
  }
889
- function a(u, v) {
890
- const E = [], S = () => v.stopPropagating = !0;
891
- v.stopPropagation = S;
892
- for (const B of v == null ? void 0 : v.intersections) {
893
- if (v.stopPropagating)
999
+ function o(u, M) {
1000
+ const E = [], T = () => M.stopPropagating = !0;
1001
+ M.stopPropagation = T;
1002
+ for (const I of M == null ? void 0 : M.intersections) {
1003
+ if (M.stopPropagating)
894
1004
  return;
895
- v = { ...v, ...B };
896
- const { object: x } = B;
897
- v.eventObject = x, i(x[u], v), E.push(x);
898
- let k = x.parent;
899
- for (; k !== null && !v.stopPropagating && !E.includes(k); )
900
- v.eventObject = k, i(k[u], v), E.push(k), k = k.parent;
901
- const F = Pr(u.slice(2));
902
- r(F, { intersection: B, event: v });
1005
+ M = { ...M, ...I };
1006
+ const { object: O } = I;
1007
+ M.eventObject = O, d(O[u], M), E.push(O);
1008
+ let x = O.parent;
1009
+ for (; x !== null && !M.stopPropagating && !E.includes(x); )
1010
+ M.eventObject = x, d(x[u], M), E.push(x), x = x.parent;
1011
+ const N = Rn(u.slice(2));
1012
+ n(N, { intersection: I, event: M });
903
1013
  }
904
1014
  }
905
1015
  const {
906
- onClick: n,
907
- onDblClick: f,
908
- onContextMenu: h,
909
- onPointerMove: l,
910
- onPointerDown: w,
911
- onPointerUp: b,
912
- onPointerMissed: p,
913
- onWheel: P,
1016
+ onClick: h,
1017
+ onDblClick: p,
1018
+ onContextMenu: c,
1019
+ onPointerMove: v,
1020
+ onPointerDown: f,
1021
+ onPointerUp: _,
1022
+ onPointerMissed: m,
1023
+ onWheel: w,
914
1024
  forceUpdate: y
915
- } = tt(c, t);
916
- b((u) => a("onPointerUp", u)), w((u) => a("onPointerDown", u)), n((u) => a("onClick", u)), f((u) => a("onDoubleClick", u)), h((u) => a("onContextMenu", u)), P((u) => a("onWheel", u));
917
- let g = [];
918
- l((u) => {
919
- const v = u.intersections.map(({ object: S }) => S), E = u.intersections;
920
- g.forEach(({ object: S }) => {
921
- v.includes(S) || (u.intersections = g, a("onPointerLeave", u), a("onPointerOut", u));
922
- }), u.intersections = E, u.intersections.forEach(({ object: S }) => {
923
- g.includes(S) || (a("onPointerEnter", u), a("onPointerOver", u));
924
- }), a("onPointerMove", u), g = u.intersections;
1025
+ } = ct(a, t);
1026
+ _((u) => o("onPointerUp", u)), f((u) => o("onPointerDown", u)), h((u) => o("onClick", u)), p((u) => o("onDoubleClick", u)), c((u) => o("onContextMenu", u)), w((u) => o("onWheel", u));
1027
+ let k = [];
1028
+ v((u) => {
1029
+ const M = u.intersections.map(({ object: T }) => T), E = u.intersections;
1030
+ k.forEach(({ object: T }) => {
1031
+ M.includes(T) || (u.intersections = k, o("onPointerLeave", u), o("onPointerOut", u));
1032
+ }), u.intersections = E, u.intersections.forEach(({ object: T }) => {
1033
+ k.includes(T) || (o("onPointerEnter", u), o("onPointerOver", u));
1034
+ }), o("onPointerMove", u), k = u.intersections;
925
1035
  });
926
- const d = [];
927
- p((u) => {
928
- const v = () => u.stopPropagating = !0;
929
- u.stopPropagation = v, d.forEach((E) => {
930
- u.stopPropagating || (u.eventObject = E, i(E.onPointerMissed, u));
931
- }), r("pointer-missed", { event: u });
1036
+ const P = [];
1037
+ m((u) => {
1038
+ const M = () => u.stopPropagating = !0;
1039
+ u.stopPropagation = M, P.forEach((E) => {
1040
+ u.stopPropagating || (u.eventObject = E, d(E.onPointerMissed, u));
1041
+ }), n("pointer-missed", { event: u });
932
1042
  });
933
- function M(u) {
934
- d.push(u);
1043
+ function C(u) {
1044
+ Ue(u) && W(u) && u.onPointerMissed && P.push(u);
935
1045
  }
936
- function _(u) {
937
- const v = d.indexOf(u);
938
- v > -1 && d.splice(v, 1);
1046
+ function b(u) {
1047
+ if (Ue(u) && W(u)) {
1048
+ const M = P.indexOf(u);
1049
+ M > -1 && P.splice(M, 1);
1050
+ }
939
1051
  }
940
1052
  return t.eventManager = {
941
1053
  forceUpdate: y,
942
- registerPointerMissedObject: M,
943
- deregisterPointerMissedObject: _
944
- }, { forceUpdate: y, registerPointerMissedObject: M, deregisterPointerMissedObject: _ };
1054
+ registerPointerMissedObject: C,
1055
+ deregisterPointerMissedObject: b
1056
+ }, { forceUpdate: y, registerPointerMissedObject: C, deregisterPointerMissedObject: b };
945
1057
  }
946
- const { logError: $e } = $(), Fe = [
1058
+ function ze(e, t, n) {
1059
+ const r = e;
1060
+ return r.__tres = {
1061
+ type: "unknown",
1062
+ eventCount: 0,
1063
+ root: n,
1064
+ handlers: {},
1065
+ memoizedProps: {},
1066
+ objects: [],
1067
+ parent: null,
1068
+ ...t
1069
+ }, r;
1070
+ }
1071
+ function Ve(e) {
1072
+ var n;
1073
+ const t = (n = e == null ? void 0 : e.__tres) == null ? void 0 : n.root;
1074
+ t && t.render && t.render.canBeInvalidated.value && t.invalidate();
1075
+ }
1076
+ const { logError: Ye } = F(), qe = [
947
1077
  "onClick",
948
1078
  "onContextMenu",
949
1079
  "onPointerMove",
@@ -958,245 +1088,230 @@ const { logError: $e } = $(), Fe = [
958
1088
  "onPointerMissed",
959
1089
  "onLostPointerCapture",
960
1090
  "onWheel"
961
- ];
962
- function Ue(e) {
963
- var r;
964
- const t = (r = e == null ? void 0 : e.__tres) == null ? void 0 : r.root;
965
- t && t.render && t.render.canBeInvalidated.value && t.invalidate();
966
- }
967
- const Ur = () => {
968
- let e = null;
969
- function t(n, f, h, l) {
970
- if (l || (l = {}), l.args || (l.args = []), n === "template" || br(n))
1091
+ ], er = (e) => {
1092
+ const t = e.scene.value;
1093
+ function n(o, h, p, c) {
1094
+ if (c || (c = {}), c.args || (c.args = []), o === "template" || xn(o))
971
1095
  return null;
972
- let w = n.replace("Tres", ""), b;
973
- if (n === "primitive") {
974
- (l == null ? void 0 : l.object) === void 0 && $e("Tres primitives need a prop 'object'");
975
- const p = l.object;
976
- w = p.type, b = Object.assign(p.clone(), { type: w });
1096
+ let v = o.replace("Tres", ""), f;
1097
+ if (o === "primitive") {
1098
+ (c == null ? void 0 : c.object) === void 0 && Ye("Tres primitives need a prop 'object'");
1099
+ const _ = c.object;
1100
+ v = _.type, f = Object.assign(_.clone(), { type: v });
977
1101
  } else {
978
- const p = de.value[w];
979
- p || $e(
980
- `${w} is not defined on the THREE namespace. Use extend to add it to the catalog.`
981
- ), b = new p(...l.args);
1102
+ const _ = ye.value[v];
1103
+ _ || Ye(
1104
+ `${v} is not defined on the THREE namespace. Use extend to add it to the catalog.`
1105
+ ), f = new _(...c.args);
982
1106
  }
983
- return b ? (b.isCamera && (l != null && l.position || b.position.set(3, 3, 3), l != null && l.lookAt || b.lookAt(0, 0, 0)), (l == null ? void 0 : l.attach) === void 0 && (b.isMaterial ? b.attach = "material" : b.isBufferGeometry && (b.attach = "geometry")), b.__tres = {
984
- ...b.__tres,
985
- type: w,
986
- memoizedProps: l,
1107
+ return f ? (f.isCamera && (c != null && c.position || f.position.set(3, 3, 3), c != null && c.lookAt || f.lookAt(0, 0, 0)), (c == null ? void 0 : c.attach) === void 0 && (f.isMaterial ? f.attach = "material" : f.isBufferGeometry && (f.attach = "geometry")), f = ze(f, {
1108
+ ...f.__tres,
1109
+ type: v,
1110
+ memoizedProps: c,
987
1111
  eventCount: 0,
988
1112
  disposable: !0,
989
- primitive: n === "primitive"
990
- }, b.isObject3D && b.__tres && (l != null && l.material || l != null && l.geometry) && (b.__tres.disposable = !1), b) : null;
1113
+ primitive: o === "primitive"
1114
+ }, e), f.isObject3D && f.__tres && (c != null && c.material || c != null && c.geometry) && (f.__tres.disposable = !1), f) : null;
991
1115
  }
992
- function r(n, f) {
993
- var l, w, b, p, P;
994
- if (!n)
1116
+ function r(o, h) {
1117
+ var f, _;
1118
+ if (!o)
995
1119
  return;
996
- f && f.isScene && (e = f), e && n.__tres && (n.__tres.root = e.__tres.root);
997
- const h = f || e;
998
- if (n != null && n.isObject3D) {
999
- const { registerCamera: y } = (l = n == null ? void 0 : n.__tres) == null ? void 0 : l.root;
1000
- n != null && n.isCamera && y(n), n.onPointerMissed && ((w = n == null ? void 0 : n.__tres) != null && w.root) && ((P = (p = (b = n == null ? void 0 : n.__tres) == null ? void 0 : b.root) == null ? void 0 : p.eventManager) == null || P.registerPointerMissedObject(n));
1001
- }
1002
- n != null && n.isObject3D && (h != null && h.isObject3D) ? (h.add(n), n.dispatchEvent({ type: "added" })) : n != null && n.isFog ? h.fog = n : typeof (n == null ? void 0 : n.attach) == "string" && (n.__previousAttach = n[h == null ? void 0 : h.attach], h && (h[n.attach] = n));
1120
+ const p = o.__tres ? o : ze(o, {}), c = h || t;
1121
+ e.registerCamera(o), (f = e.eventManager) == null || f.registerPointerMissedObject(o);
1122
+ let v = !1;
1123
+ W(o) && W(c) ? (c.add(o), v = !0, o.dispatchEvent({ type: "added" })) : ot(o) ? c.fog = o : typeof o.attach == "string" && (o.__previousAttach = o[c == null ? void 0 : c.attach], c && (c[o.attach] = o)), p.__tres.parent = c, (_ = c.__tres) != null && _.objects && !v && (c.__tres.objects.includes(o) || c.__tres.objects.push(o));
1003
1124
  }
1004
- function o(n) {
1005
- var h, l, w, b;
1006
- if (!n)
1125
+ function s(o) {
1126
+ var p, c, v, f, _;
1127
+ if (!o)
1007
1128
  return;
1008
- const f = n.__tres;
1009
- if (n.parent = n.parent || e, n.isObject3D) {
1010
- const p = (y) => {
1011
- var d, M;
1012
- const g = (M = (d = n == null ? void 0 : n.__tres) == null ? void 0 : d.root) == null ? void 0 : M.deregisterCamera;
1013
- y.isCamera && (g == null || g(y));
1014
- };
1015
- (h = n.removeFromParent) == null || h.call(n), n.traverse((y) => {
1016
- var g, d;
1017
- p(y), y.onPointerMissed && ((d = (g = f == null ? void 0 : f.root) == null ? void 0 : g.eventManager) == null || d.deregisterPointerMissedObject(y));
1018
- }), p(n), Ue(n), !((l = n.__tres) == null ? void 0 : l.primitive) && ((w = n.__tres) != null && w.disposable) && we(n), (b = n.dispose) == null || b.call(n);
1019
- }
1129
+ o.parent = o.parent || t;
1130
+ const h = ((p = o.__tres) == null ? void 0 : p.parent) || t;
1131
+ o.__tres && (o.__tres.parent = null), h.__tres && "objects" in h.__tres && Nn(h.__tres.objects, (m) => m !== o), W(o) && ((c = o.removeFromParent) == null || c.call(o), o.traverse((w) => {
1132
+ var y;
1133
+ e.deregisterCamera(w), (y = e.eventManager) == null || y.deregisterPointerMissedObject(w);
1134
+ }), e.deregisterCamera(o), Ve(o), !((v = o.__tres) != null && v.primitive) && ((f = o.__tres) != null && f.disposable) && Ce(o), (_ = o.dispose) == null || _.call(o));
1020
1135
  }
1021
- function s(n, f, h, l) {
1022
- var w, b;
1023
- if (n) {
1024
- let p = n, P = f;
1025
- if ((w = n == null ? void 0 : n.__tres) != null && w.primitive && P === "object" && h !== null) {
1026
- const M = t("primitive", void 0, void 0, {
1027
- object: l
1028
- });
1029
- for (const _ in M) {
1030
- if (_ === "uuid")
1031
- continue;
1032
- const u = n[_], v = M[_];
1033
- !(u != null && u.set) && !ee(u) ? n[_] = v : u.constructor === v.constructor && (u != null && u.copy) ? u == null || u.copy(v) : Array.isArray(v) ? u.set(...v) : !u.isColor && u.setScalar ? u.setScalar(v) : u.set(v);
1034
- }
1035
- M != null && M.__tres && (M.__tres.root = e == null ? void 0 : e.__tres.root), M != null && M.isGroup ? (n.geometry = void 0, n.material = void 0) : delete n.isGroup;
1036
- }
1037
- if (n != null && n.isObject3D && P === "blocks-pointer-events") {
1038
- l || l === "" ? n[P] = l : delete n[P];
1039
- return;
1040
- }
1041
- Fe.includes(f) && (n.__tres.eventCount += 1);
1042
- let y = X(P), g = p == null ? void 0 : p[y];
1043
- if (P === "args") {
1044
- const M = n, _ = h ?? [], u = l ?? [], v = ((b = n == null ? void 0 : n.__tres) == null ? void 0 : b.type) || n.type;
1045
- v && _.length && !Sr(_, u) && (p = Object.assign(
1046
- M,
1047
- new de.value[v](...l)
1048
- ));
1049
- return;
1050
- }
1051
- if (p.type === "BufferGeometry") {
1052
- if (P === "args")
1053
- return;
1054
- p.setAttribute(
1055
- X(P),
1056
- new Tt(...l)
1057
- );
1058
- return;
1059
- }
1060
- if (P.includes("-") && g === void 0) {
1061
- const M = P.split("-");
1062
- g = M.reduce((_, u) => _[X(u)], p), P = M.pop(), y = P, g != null && g.set || (p = M.reduce((_, u) => _[X(u)], p));
1136
+ function l(o, h, p, c) {
1137
+ var y, k;
1138
+ if (!o)
1139
+ return;
1140
+ let v = o, f = h;
1141
+ if ((y = o.__tres) != null && y.primitive && f === "object" && p !== null) {
1142
+ const P = n("primitive", void 0, void 0, {
1143
+ object: c
1144
+ });
1145
+ for (const C in P) {
1146
+ if (C === "uuid")
1147
+ continue;
1148
+ const b = o[C], u = P[C];
1149
+ !(b != null && b.set) && !Q(b) ? o[C] = u : b.constructor === u.constructor && (b != null && b.copy) ? b == null || b.copy(u) : Array.isArray(u) ? b.set(...u) : !b.isColor && b.setScalar ? b.setScalar(u) : b.set(u);
1063
1150
  }
1064
- let d = l;
1065
- if (d === "" && (d = !0), ee(g)) {
1066
- Fe.includes(f) || (Array.isArray(d) ? n[y](...d) : n[y](d)), y.startsWith("on") && ee(d) && (p[y] = d);
1151
+ P != null && P.__tres && (P.__tres.root = e), P != null && P.isGroup ? (o.geometry = void 0, o.material = void 0) : delete o.isGroup;
1152
+ }
1153
+ if (W(o) && f === "blocks-pointer-events") {
1154
+ c || c === "" ? o[f] = c : delete o[f];
1155
+ return;
1156
+ }
1157
+ qe.includes(h) && (o.__tres.eventCount += 1);
1158
+ let _ = re(f), m = v == null ? void 0 : v[_];
1159
+ if (f === "args") {
1160
+ const P = o, C = p ?? [], b = c ?? [], u = ((k = o.__tres) == null ? void 0 : k.type) || o.type;
1161
+ u && C.length && !In(C, b) && (v = Object.assign(
1162
+ P,
1163
+ new ye.value[u](...c)
1164
+ ));
1165
+ return;
1166
+ }
1167
+ if (v.type === "BufferGeometry") {
1168
+ if (f === "args")
1067
1169
  return;
1068
- }
1069
- !(g != null && g.set) && !ee(g) ? p[y] = d : g.constructor === d.constructor && (g != null && g.copy) ? g == null || g.copy(d) : Array.isArray(d) ? g.set(...d) : !g.isColor && g.setScalar ? g.setScalar(d) : g.set(d), Ue(n);
1170
+ v.setAttribute(
1171
+ re(f),
1172
+ new Bt(...c)
1173
+ );
1174
+ return;
1175
+ }
1176
+ if (f.includes("-") && m === void 0) {
1177
+ const P = f.split("-");
1178
+ m = P.reduce((C, b) => C[re(b)], v), f = P.pop(), _ = f, m != null && m.set || (v = P.reduce((C, b) => C[re(b)], v));
1179
+ }
1180
+ let w = c;
1181
+ if (w === "" && (w = !0), Q(m)) {
1182
+ qe.includes(h) || (ve(w) ? o[_](...w) : o[_](w)), _.startsWith("on") && Q(w) && (v[_] = w);
1183
+ return;
1070
1184
  }
1185
+ !(m != null && m.set) && !Q(m) ? v[_] = w : m.constructor === w.constructor && (m != null && m.copy) ? m == null || m.copy(w) : ve(w) ? m.set(...w) : !m.isColor && m.setScalar ? m.setScalar(w) : m.set(w), Ve(o);
1071
1186
  }
1072
- function c(n) {
1073
- return (n == null ? void 0 : n.parent) || null;
1187
+ function i(o) {
1188
+ return (o == null ? void 0 : o.parent) || null;
1074
1189
  }
1075
- function i(n) {
1076
- const f = new xt();
1077
- return f.name = n, f.__tres = { type: "Comment" }, f.__tres.root = e == null ? void 0 : e.__tres.root, f;
1190
+ function a(o) {
1191
+ const h = new jt();
1192
+ return h.name = o, h.__tres = { type: "Comment" }, h.__tres.root = t == null ? void 0 : t.__tres.root, h;
1078
1193
  }
1079
- function a(n) {
1080
- if (!n)
1194
+ function d(o) {
1195
+ if (!o)
1081
1196
  return null;
1082
- const f = n.parent || e, h = f.children.indexOf(n);
1083
- return f.children[h + 1] || null;
1197
+ const h = o.parent || t, p = h.children.indexOf(o);
1198
+ return h.children[p + 1] || null;
1084
1199
  }
1085
1200
  return {
1086
1201
  insert: r,
1087
- remove: o,
1088
- createElement: t,
1089
- patchProp: s,
1090
- parentNode: c,
1202
+ remove: s,
1203
+ createElement: n,
1204
+ patchProp: l,
1205
+ parentNode: i,
1091
1206
  createText: () => void 0,
1092
- createComment: i,
1207
+ createComment: a,
1093
1208
  setText: () => void 0,
1094
1209
  setElementText: () => void 0,
1095
- nextSibling: a,
1210
+ nextSibling: d,
1096
1211
  querySelector: () => void 0,
1097
1212
  setScopeId: () => void 0,
1098
1213
  cloneNode: () => void 0,
1099
1214
  insertStaticContent: () => void 0
1100
1215
  };
1101
1216
  };
1102
- function Wr() {
1103
- return nt().__VUE_DEVTOOLS_GLOBAL_HOOK__;
1217
+ function tr() {
1218
+ return ft().__VUE_DEVTOOLS_GLOBAL_HOOK__;
1104
1219
  }
1105
- function nt() {
1220
+ function ft() {
1106
1221
  return typeof navigator < "u" && typeof window < "u" ? window : typeof globalThis < "u" ? globalThis : {};
1107
1222
  }
1108
- const Nr = typeof Proxy == "function", zr = "devtools-plugin:setup", Gr = "plugin:settings:set";
1109
- let U, ge;
1110
- function Vr() {
1223
+ const nr = typeof Proxy == "function", rr = "devtools-plugin:setup", or = "plugin:settings:set";
1224
+ let z, be;
1225
+ function ir() {
1111
1226
  var e;
1112
- return U !== void 0 || (typeof window < "u" && window.performance ? (U = !0, ge = window.performance) : typeof globalThis < "u" && (!((e = globalThis.perf_hooks) === null || e === void 0) && e.performance) ? (U = !0, ge = globalThis.perf_hooks.performance) : U = !1), U;
1227
+ return z !== void 0 || (typeof window < "u" && window.performance ? (z = !0, be = window.performance) : typeof globalThis < "u" && (!((e = globalThis.perf_hooks) === null || e === void 0) && e.performance) ? (z = !0, be = globalThis.perf_hooks.performance) : z = !1), z;
1113
1228
  }
1114
- function qr() {
1115
- return Vr() ? ge.now() : Date.now();
1229
+ function sr() {
1230
+ return ir() ? be.now() : Date.now();
1116
1231
  }
1117
- class Yr {
1118
- constructor(t, r) {
1119
- this.target = null, this.targetQueue = [], this.onQueue = [], this.plugin = t, this.hook = r;
1120
- const o = {};
1232
+ class ar {
1233
+ constructor(t, n) {
1234
+ this.target = null, this.targetQueue = [], this.onQueue = [], this.plugin = t, this.hook = n;
1235
+ const r = {};
1121
1236
  if (t.settings)
1122
1237
  for (const i in t.settings) {
1123
1238
  const a = t.settings[i];
1124
- o[i] = a.defaultValue;
1239
+ r[i] = a.defaultValue;
1125
1240
  }
1126
1241
  const s = `__vue-devtools-plugin-settings__${t.id}`;
1127
- let c = Object.assign({}, o);
1242
+ let l = Object.assign({}, r);
1128
1243
  try {
1129
1244
  const i = localStorage.getItem(s), a = JSON.parse(i);
1130
- Object.assign(c, a);
1245
+ Object.assign(l, a);
1131
1246
  } catch {
1132
1247
  }
1133
1248
  this.fallbacks = {
1134
1249
  getSettings() {
1135
- return c;
1250
+ return l;
1136
1251
  },
1137
1252
  setSettings(i) {
1138
1253
  try {
1139
1254
  localStorage.setItem(s, JSON.stringify(i));
1140
1255
  } catch {
1141
1256
  }
1142
- c = i;
1257
+ l = i;
1143
1258
  },
1144
1259
  now() {
1145
- return qr();
1260
+ return sr();
1146
1261
  }
1147
- }, r && r.on(Gr, (i, a) => {
1262
+ }, n && n.on(or, (i, a) => {
1148
1263
  i === this.plugin.id && this.fallbacks.setSettings(a);
1149
1264
  }), this.proxiedOn = new Proxy({}, {
1150
- get: (i, a) => this.target ? this.target.on[a] : (...n) => {
1265
+ get: (i, a) => this.target ? this.target.on[a] : (...d) => {
1151
1266
  this.onQueue.push({
1152
1267
  method: a,
1153
- args: n
1268
+ args: d
1154
1269
  });
1155
1270
  }
1156
1271
  }), this.proxiedTarget = new Proxy({}, {
1157
- get: (i, a) => this.target ? this.target[a] : a === "on" ? this.proxiedOn : Object.keys(this.fallbacks).includes(a) ? (...n) => (this.targetQueue.push({
1272
+ get: (i, a) => this.target ? this.target[a] : a === "on" ? this.proxiedOn : Object.keys(this.fallbacks).includes(a) ? (...d) => (this.targetQueue.push({
1158
1273
  method: a,
1159
- args: n,
1274
+ args: d,
1160
1275
  resolve: () => {
1161
1276
  }
1162
- }), this.fallbacks[a](...n)) : (...n) => new Promise((f) => {
1277
+ }), this.fallbacks[a](...d)) : (...d) => new Promise((o) => {
1163
1278
  this.targetQueue.push({
1164
1279
  method: a,
1165
- args: n,
1166
- resolve: f
1280
+ args: d,
1281
+ resolve: o
1167
1282
  });
1168
1283
  })
1169
1284
  });
1170
1285
  }
1171
1286
  async setRealTarget(t) {
1172
1287
  this.target = t;
1173
- for (const r of this.onQueue)
1174
- this.target.on[r.method](...r.args);
1175
- for (const r of this.targetQueue)
1176
- r.resolve(await this.target[r.method](...r.args));
1288
+ for (const n of this.onQueue)
1289
+ this.target.on[n.method](...n.args);
1290
+ for (const n of this.targetQueue)
1291
+ n.resolve(await this.target[n.method](...n.args));
1177
1292
  }
1178
1293
  }
1179
- function Jr(e, t) {
1180
- const r = e, o = nt(), s = Wr(), c = Nr && r.enableEarlyProxy;
1181
- if (s && (o.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !c))
1182
- s.emit(zr, e, t);
1294
+ function lr(e, t) {
1295
+ const n = e, r = ft(), s = tr(), l = nr && n.enableEarlyProxy;
1296
+ if (s && (r.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !l))
1297
+ s.emit(rr, e, t);
1183
1298
  else {
1184
- const i = c ? new Yr(r, s) : null;
1185
- (o.__VUE_DEVTOOLS_PLUGINS__ = o.__VUE_DEVTOOLS_PLUGINS__ || []).push({
1186
- pluginDescriptor: r,
1299
+ const i = l ? new ar(n, s) : null;
1300
+ (r.__VUE_DEVTOOLS_PLUGINS__ = r.__VUE_DEVTOOLS_PLUGINS__ || []).push({
1301
+ pluginDescriptor: n,
1187
1302
  setupFn: t,
1188
1303
  proxy: i
1189
1304
  }), i && t(i.proxiedTarget);
1190
1305
  }
1191
1306
  }
1192
- function Qr(e, t) {
1193
- const r = `▲ ■ ●${e}`;
1194
- typeof We == "function" ? We(r, t) : console.log(r);
1307
+ function cr(e, t) {
1308
+ const n = `▲ ■ ●${e}`;
1309
+ typeof Je == "function" ? Je(n, t) : console.log(n);
1195
1310
  }
1196
- function We(e, t) {
1311
+ function Je(e, t) {
1197
1312
  throw new Error(e + t);
1198
1313
  }
1199
- const ot = (e) => {
1314
+ const dt = (e) => {
1200
1315
  const t = {
1201
1316
  id: e.uuid,
1202
1317
  label: e.type,
@@ -1208,9 +1323,9 @@ const ot = (e) => {
1208
1323
  textColor: 5750629,
1209
1324
  backgroundColor: 15793395
1210
1325
  });
1211
- const r = be(e);
1212
- return r > 0 && t.tags.push({
1213
- label: `${Rr(r)} KB`,
1326
+ const n = Ee(e);
1327
+ return n > 0 && t.tags.push({
1328
+ label: `${qn(n)} KB`,
1214
1329
  textColor: 15707189,
1215
1330
  backgroundColor: 16775644,
1216
1331
  tooltip: "Memory usage"
@@ -1236,87 +1351,166 @@ const ot = (e) => {
1236
1351
  tooltip: "Position"
1237
1352
  })), t;
1238
1353
  };
1239
- function st(e, t, r = "") {
1240
- e.children.forEach((o) => {
1241
- if (o.type === "HightlightMesh" || r && !o.type.includes(r) && !o.name.includes(r))
1354
+ function pt(e, t, n = "") {
1355
+ e.children.forEach((r) => {
1356
+ if (r.type === "HightlightMesh" || n && !r.type.includes(n) && !r.name.includes(n))
1242
1357
  return;
1243
- const s = ot(o);
1244
- t.children.push(s), st(o, s, r);
1358
+ const s = dt(r);
1359
+ t.children.push(s), pt(r, s, n);
1245
1360
  });
1246
1361
  }
1247
- const Kr = [], z = "tres:inspector", Xr = ze({
1362
+ const ur = [], q = "tres:inspector", fr = Ke({
1248
1363
  sceneGraph: null
1249
1364
  });
1250
- function Zr(e, t) {
1251
- Jr(
1365
+ function dr(e, t) {
1366
+ lr(
1252
1367
  {
1253
1368
  id: "dev.esm.tres",
1254
1369
  label: "TresJS 🪐",
1255
1370
  logo: "https://raw.githubusercontent.com/Tresjs/tres/main/public/favicon.svg",
1256
1371
  packageName: "tresjs",
1257
1372
  homepage: "https://tresjs.org",
1258
- componentStateTypes: Kr,
1373
+ componentStateTypes: ur,
1259
1374
  app: e
1260
1375
  },
1261
- (r) => {
1262
- typeof r.now != "function" && Qr(
1376
+ (n) => {
1377
+ typeof n.now != "function" && cr(
1263
1378
  "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."
1264
- ), r.addInspector({
1265
- id: z,
1379
+ ), n.addInspector({
1380
+ id: q,
1266
1381
  label: "TresJS 🪐",
1267
1382
  icon: "account_tree",
1268
1383
  treeFilterPlaceholder: "Search instances"
1269
1384
  }), setInterval(() => {
1270
- r.sendInspectorTree(z);
1385
+ n.sendInspectorTree(q);
1271
1386
  }, 1e3), setInterval(() => {
1272
- r.notifyComponentUpdate();
1273
- }, 5e3), r.on.getInspectorTree((c) => {
1274
- if (c.inspectorId === z) {
1275
- const i = ot(t.scene.value);
1276
- st(t.scene.value, i, c.filter), Xr.sceneGraph = i, c.rootNodes = [i];
1387
+ n.notifyComponentUpdate();
1388
+ }, 5e3), n.on.getInspectorTree((l) => {
1389
+ if (l.inspectorId === q) {
1390
+ const i = dt(t.scene.value);
1391
+ pt(t.scene.value, i, l.filter), fr.sceneGraph = i, l.rootNodes = [i];
1277
1392
  }
1278
1393
  });
1279
- let o = null, s = null;
1280
- r.on.getInspectorState((c) => {
1394
+ let r = null, s = null;
1395
+ n.on.getInspectorState((l) => {
1281
1396
  var i;
1282
- if (c.inspectorId === z) {
1283
- const [a] = t.scene.value.getObjectsByProperty("uuid", c.nodeId);
1397
+ if (l.inspectorId === q) {
1398
+ const [a] = t.scene.value.getObjectsByProperty("uuid", l.nodeId);
1284
1399
  if (!a)
1285
1400
  return;
1286
- if (s && o && o.parent && s.remove(o), a.isMesh) {
1287
- const n = kr(a);
1288
- a.add(n), o = n, s = a;
1401
+ if (s && r && r.parent && s.remove(r), a.isMesh) {
1402
+ const d = $n(a);
1403
+ a.add(d), r = d, s = a;
1289
1404
  }
1290
- c.state = {
1291
- object: Object.entries(a).map(([n, f]) => ({
1292
- key: n,
1293
- value: f,
1294
- editable: !0
1295
- })).filter(({ key: n }) => n !== "parent")
1296
- }, a.isScene && (c.state.info = {
1297
- memory: be(a),
1405
+ l.state = {
1406
+ object: [
1407
+ {
1408
+ key: "uuid",
1409
+ editable: !0,
1410
+ value: a.uuid
1411
+ },
1412
+ {
1413
+ key: "name",
1414
+ editable: !0,
1415
+ value: a.name
1416
+ },
1417
+ {
1418
+ key: "type",
1419
+ editable: !0,
1420
+ value: a.type
1421
+ },
1422
+ {
1423
+ key: "position",
1424
+ editable: !0,
1425
+ value: a.position
1426
+ },
1427
+ {
1428
+ key: "rotation",
1429
+ editable: !0,
1430
+ value: a.rotation
1431
+ },
1432
+ {
1433
+ key: "scale",
1434
+ editable: !0,
1435
+ value: a.scale
1436
+ },
1437
+ {
1438
+ key: "geometry",
1439
+ value: a.geometry
1440
+ },
1441
+ {
1442
+ key: "material",
1443
+ value: a.material
1444
+ },
1445
+ {
1446
+ key: "color",
1447
+ editable: !0,
1448
+ value: a.color
1449
+ },
1450
+ {
1451
+ key: "intensity",
1452
+ editable: !0,
1453
+ value: a.intensity
1454
+ },
1455
+ {
1456
+ key: "castShadow",
1457
+ editable: !0,
1458
+ value: a.castShadow
1459
+ },
1460
+ {
1461
+ key: "receiveShadow",
1462
+ editable: !0,
1463
+ value: a.receiveShadow
1464
+ },
1465
+ {
1466
+ key: "frustumCulled",
1467
+ editable: !0,
1468
+ value: a.frustumCulled
1469
+ },
1470
+ {
1471
+ key: "matrixAutoUpdate",
1472
+ editable: !0,
1473
+ value: a.matrixAutoUpdate
1474
+ },
1475
+ {
1476
+ key: "matrixWorldNeedsUpdate",
1477
+ editable: !0,
1478
+ value: a.matrixWorldNeedsUpdate
1479
+ },
1480
+ {
1481
+ key: "matrixWorld",
1482
+ value: a.matrixWorld
1483
+ },
1484
+ {
1485
+ key: "visible",
1486
+ editable: !0,
1487
+ value: a.visible
1488
+ }
1489
+ ]
1490
+ }, a.isScene && (l.state.info = {
1491
+ memory: Ee(a),
1298
1492
  objects: a.children.length,
1299
1493
  calls: t.renderer.value.info.render.calls,
1300
1494
  triangles: t.renderer.value.info.render.triangles,
1301
1495
  points: t.renderer.value.info.render.points,
1302
1496
  lines: t.renderer.value.info.render.lines
1303
- }, c.state.programs = ((i = t.renderer.value.info.programs) == null ? void 0 : i.map((n) => ({
1304
- key: n.name,
1497
+ }, l.state.programs = ((i = t.renderer.value.info.programs) == null ? void 0 : i.map((d) => ({
1498
+ key: d.name,
1305
1499
  value: {
1306
- ...n,
1307
- vertexShader: n.vertexShader,
1308
- attributes: n.getAttributes(),
1309
- uniforms: n.getUniforms()
1500
+ ...d,
1501
+ vertexShader: d.vertexShader,
1502
+ attributes: d.getAttributes(),
1503
+ uniforms: d.getUniforms()
1310
1504
  }
1311
1505
  }))) || []);
1312
1506
  }
1313
- }), r.on.editInspectorState((c) => {
1314
- c.inspectorId === z && xr(t.scene.value, c.nodeId, c.path, c.state.value);
1507
+ }), n.on.editInspectorState((l) => {
1508
+ l.inspectorId === q && Un(t.scene.value, l.nodeId, l.path, l.state.value);
1315
1509
  });
1316
1510
  }
1317
1511
  );
1318
1512
  }
1319
- const en = ["data-scene", "data-tres"], tn = /* @__PURE__ */ xe({
1513
+ const pr = ["data-scene", "data-tres"], mr = /* @__PURE__ */ Le({
1320
1514
  __name: "TresCanvas",
1321
1515
  props: {
1322
1516
  shadows: { type: Boolean, default: void 0 },
@@ -1356,93 +1550,94 @@ const en = ["data-scene", "data-tres"], tn = /* @__PURE__ */ xe({
1356
1550
  "pointer-over",
1357
1551
  "pointer-out",
1358
1552
  "pointer-missed",
1359
- "wheel"
1553
+ "wheel",
1554
+ "ready"
1360
1555
  ],
1361
- setup(e, { expose: t, emit: r }) {
1362
- var P;
1363
- const o = e, s = r, c = ut(), { logWarning: i } = $(), a = L(), n = H(new qe()), f = (P = ke()) == null ? void 0 : P.appContext.app;
1364
- me(Ge);
1365
- const h = (y) => xe({
1556
+ setup(e, { expose: t, emit: n }) {
1557
+ var _;
1558
+ const r = e, s = n, l = yt(), { logWarning: i } = F(), a = D(), d = $(new et()), o = (_ = Re()) == null ? void 0 : _.appContext.app;
1559
+ we(Xe);
1560
+ const h = (m) => Le({
1366
1561
  setup() {
1367
- var d;
1368
- const g = (d = ke()) == null ? void 0 : d.appContext;
1369
- return g && (g.app = f), fe("useTres", y), fe("extend", me), typeof window < "u" && Zr(g == null ? void 0 : g.app, y), () => Oe(ht, null, c != null && c.default ? c.default() : []);
1562
+ var y;
1563
+ const w = (y = Re()) == null ? void 0 : y.appContext;
1564
+ return w && (w.app = o), ge("useTres", m), ge("extend", we), typeof window < "u" && dr(w == null ? void 0 : w.app, m), () => De(Et, null, l != null && l.default ? l.default() : []);
1370
1565
  }
1371
- }), l = (y) => {
1372
- const g = h(y), { render: d } = vt(Ur());
1373
- d(Oe(g), n.value);
1374
- }, w = (y, g = !1) => {
1375
- we(y.scene.value), g && (y.renderer.value.dispose(), y.renderer.value.renderLists.dispose(), y.renderer.value.forceContextLoss()), n.value.__tres = {
1376
- root: y
1377
- }, l(y);
1378
- }, b = D(() => o.disableRender), p = H(null);
1379
- return t({ context: p, dispose: () => w(p.value, !0) }), ft(() => {
1380
- const y = a;
1381
- p.value = $r({
1382
- scene: n.value,
1383
- canvas: y,
1384
- windowSize: o.windowSize ?? !1,
1385
- disableRender: b.value ?? !1,
1386
- rendererOptions: o,
1566
+ }), p = (m) => {
1567
+ const w = h(m), { render: y } = Ct(er(m));
1568
+ y(De(w), d.value);
1569
+ }, c = (m, w = !1) => {
1570
+ Ce(m.scene.value), w && (m.renderer.value.dispose(), m.renderer.value.renderLists.dispose(), m.renderer.value.forceContextLoss()), d.value.__tres = {
1571
+ root: m
1572
+ }, p(m);
1573
+ }, v = j(() => r.disableRender), f = $(null);
1574
+ return t({ context: f, dispose: () => c(f.value, !0) }), wt(() => {
1575
+ const m = a;
1576
+ f.value = Xn({
1577
+ scene: d.value,
1578
+ canvas: m,
1579
+ windowSize: r.windowSize ?? !1,
1580
+ disableRender: v.value ?? !1,
1581
+ rendererOptions: r,
1387
1582
  emit: s
1388
- }), Fr(n.value, p.value, s);
1389
- const { registerCamera: g, camera: d, cameras: M, deregisterCamera: _ } = p.value;
1390
- l(p.value);
1391
- const u = () => {
1392
- const v = new pe(
1583
+ }), Zn(d.value, f.value, s);
1584
+ const { registerCamera: w, camera: y, cameras: k, deregisterCamera: P } = f.value;
1585
+ p(f.value);
1586
+ const C = () => {
1587
+ const b = new he(
1393
1588
  45,
1394
1589
  window.innerWidth / window.innerHeight,
1395
1590
  0.1,
1396
1591
  1e3
1397
1592
  );
1398
- v.position.set(3, 3, 3), v.lookAt(0, 0, 0), g(v);
1399
- const E = ve(() => {
1400
- M.value.length >= 2 && (v.removeFromParent(), _(v), E == null || E());
1593
+ b.position.set(3, 3, 3), b.lookAt(0, 0, 0), w(b);
1594
+ const u = Me(() => {
1595
+ k.value.length >= 2 && (b.removeFromParent(), P(b), u == null || u());
1401
1596
  });
1402
1597
  };
1403
- G(
1404
- () => o.camera,
1405
- (v, E) => {
1406
- v && g(v), E && (E.removeFromParent(), _(E));
1598
+ J(
1599
+ () => r.camera,
1600
+ (b, u) => {
1601
+ b && w(b), u && (u.removeFromParent(), P(u));
1407
1602
  },
1408
1603
  {
1409
1604
  immediate: !0
1410
1605
  }
1411
- ), d.value || (i(
1606
+ ), y.value || (i(
1412
1607
  "No camera found. Creating a default perspective camera. To have full control over a camera, please add one to the scene."
1413
- ), u());
1414
- }), N(() => {
1415
- w(p.value);
1416
- }), (y, g) => (pt(), dt("canvas", {
1608
+ ), C());
1609
+ }), Y(() => {
1610
+ c(f.value);
1611
+ }), (m, w) => (bt(), Mt("canvas", {
1417
1612
  ref_key: "canvas",
1418
1613
  ref: a,
1419
- "data-scene": n.value.uuid,
1420
- class: mt(y.$attrs.class),
1421
- "data-tres": `tresjs ${W(pr).version}`,
1422
- style: gt({
1614
+ "data-scene": d.value.uuid,
1615
+ class: _t(m.$attrs.class),
1616
+ "data-tres": `tresjs ${V(Mn).version}`,
1617
+ style: Pt({
1423
1618
  display: "block",
1424
1619
  width: "100%",
1425
1620
  height: "100%",
1426
- position: y.windowSize ? "fixed" : "relative",
1621
+ position: m.windowSize ? "fixed" : "relative",
1427
1622
  top: 0,
1428
1623
  left: 0,
1429
1624
  pointerEvents: "auto",
1430
1625
  touchAction: "none",
1431
- ...y.$attrs.style
1626
+ ...m.$attrs.style
1432
1627
  })
1433
- }, null, 14, en));
1628
+ }, null, 14, pr));
1434
1629
  }
1435
- }), rn = [
1630
+ }), gr = [
1436
1631
  "TresCanvas",
1437
1632
  "TresLeches",
1438
1633
  "TresScene"
1439
- ], nn = {
1634
+ ], hr = {
1440
1635
  template: {
1441
1636
  compilerOptions: {
1442
- isCustomElement: (e) => e.startsWith("Tres") && !rn.includes(e) || e === "primitive"
1637
+ isCustomElement: (e) => e.startsWith("Tres") && !gr.includes(e) || e === "primitive"
1443
1638
  }
1444
1639
  }
1445
- }, bn = nn, Mn = {
1640
+ }, Rr = hr, Dr = {
1446
1641
  mounted: (e, t) => {
1447
1642
  if (t.arg) {
1448
1643
  console.log(`v-log:${t.arg}`, e[t.arg]);
@@ -1451,22 +1646,22 @@ const en = ["data-scene", "data-tres"], tn = /* @__PURE__ */ xe({
1451
1646
  console.log("v-log", e);
1452
1647
  }
1453
1648
  };
1454
- class it extends kt {
1455
- constructor(t, r) {
1456
- const o = [1, 1, 0, -1, 1, 0, -1, -1, 0, 1, -1, 0, 1, 1, 0], s = new Ae();
1457
- s.setAttribute("position", new Le(o, 3)), s.computeBoundingSphere();
1458
- const c = new Ot({ fog: !1 });
1459
- super(s, c), this.light = t, this.color = r, this.type = "RectAreaLightHelper";
1460
- const i = [1, 1, 0, -1, 1, 0, -1, -1, 0, 1, 1, 0, -1, -1, 0, 1, -1, 0], a = new Ae();
1461
- a.setAttribute("position", new Le(i, 3)), a.computeBoundingSphere(), this.add(new At(a, new Ye({ side: Lt, fog: !1 })));
1649
+ class mt extends It {
1650
+ constructor(t, n) {
1651
+ const r = [1, 1, 0, -1, 1, 0, -1, -1, 0, 1, -1, 0, 1, 1, 0], s = new Be();
1652
+ s.setAttribute("position", new je(r, 3)), s.computeBoundingSphere();
1653
+ const l = new Ht({ fog: !1 });
1654
+ super(s, l), this.light = t, this.color = n, this.type = "RectAreaLightHelper";
1655
+ const i = [1, 1, 0, -1, 1, 0, -1, -1, 0, 1, 1, 0, -1, -1, 0, 1, -1, 0], a = new Be();
1656
+ a.setAttribute("position", new je(i, 3)), a.computeBoundingSphere(), this.add(new Ut(a, new tt({ side: $t, fog: !1 })));
1462
1657
  }
1463
1658
  updateMatrixWorld() {
1464
1659
  if (this.scale.set(0.5 * this.light.width, 0.5 * this.light.height, 1), this.color !== void 0)
1465
1660
  this.material.color.set(this.color), this.children[0].material.color.set(this.color);
1466
1661
  else {
1467
1662
  this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);
1468
- const t = this.material.color, r = Math.max(t.r, t.g, t.b);
1469
- r > 1 && t.multiplyScalar(1 / r), this.children[0].material.color.copy(this.material.color);
1663
+ const t = this.material.color, n = Math.max(t.r, t.g, t.b);
1664
+ n > 1 && t.multiplyScalar(1 / n), this.children[0].material.color.copy(this.material.color);
1470
1665
  }
1471
1666
  this.matrixWorld.extractRotation(this.light.matrixWorld).scale(this.scale).copyPosition(this.light.matrixWorld), this.children[0].matrixWorld.copy(this.matrixWorld);
1472
1667
  }
@@ -1474,87 +1669,88 @@ class it extends kt {
1474
1669
  this.geometry.dispose(), this.material.dispose(), this.children[0].geometry.dispose(), this.children[0].material.dispose();
1475
1670
  }
1476
1671
  }
1477
- const { logWarning: Ne } = $();
1478
- let te, I;
1479
- const on = {
1480
- DirectionalLight: Dt,
1481
- PointLight: Bt,
1482
- SpotLight: jt,
1483
- HemisphereLight: Rt,
1484
- RectAreaLight: it
1485
- }, Pn = {
1672
+ const { logWarning: Qe } = F();
1673
+ let ie, U;
1674
+ const vr = {
1675
+ DirectionalLight: Ft,
1676
+ PointLight: Wt,
1677
+ SpotLight: Nt,
1678
+ HemisphereLight: Gt,
1679
+ RectAreaLight: mt
1680
+ }, Br = {
1486
1681
  mounted: (e) => {
1487
1682
  if (!e.isLight) {
1488
- Ne(`${e.type} is not a light`);
1683
+ Qe(`${e.type} is not a light`);
1489
1684
  return;
1490
1685
  }
1491
- te = on[e.type], e.parent.add(new te(e, 1, e.color.getHex()));
1686
+ ie = vr[e.type], e.parent.add(new ie(e, 1, e.color.getHex()));
1492
1687
  },
1493
1688
  updated: (e) => {
1494
- I = e.parent.children.find((t) => t instanceof te), !(I instanceof it) && I.update();
1689
+ U = e.parent.children.find((t) => t instanceof ie), !(U instanceof mt) && U.update();
1495
1690
  },
1496
1691
  unmounted: (e) => {
1497
1692
  if (!e.isLight) {
1498
- Ne(`${e.type} is not a light`);
1693
+ Qe(`${e.type} is not a light`);
1499
1694
  return;
1500
1695
  }
1501
- I = e.parent.children.find((t) => t instanceof te), I && I.dispose && I.dispose(), e.parent.remove(I);
1696
+ U = e.parent.children.find((t) => t instanceof ie), U && U.dispose && U.dispose(), e.parent.remove(U);
1502
1697
  }
1503
- }, { logWarning: sn } = $();
1504
- let j = null;
1505
- const _n = {
1698
+ }, { logWarning: yr } = F();
1699
+ let B = null;
1700
+ const jr = {
1506
1701
  updated: (e, t) => {
1507
1702
  var s;
1508
- const r = Or(t);
1509
- if (!r) {
1510
- sn(`v-distance-to: problem with binding value: ${t.value}`);
1703
+ const n = Fn(t);
1704
+ if (!n) {
1705
+ yr(`v-distance-to: problem with binding value: ${t.value}`);
1511
1706
  return;
1512
1707
  }
1513
- j && (j.dispose(), e.parent.remove(j));
1514
- const o = r.clone().sub(e.position);
1515
- o.normalize(), j = new It(o, e.position, e.position.distanceTo(r), 16776960), e.parent.add(j), console.table(
1708
+ B && (B.dispose(), e.parent.remove(B));
1709
+ const r = n.clone().sub(e.position);
1710
+ r.normalize(), B = new zt(r, e.position, e.position.distanceTo(n), 16776960), e.parent.add(B), console.table(
1516
1711
  [
1517
- ["Distance:", e.position.distanceTo(r)],
1712
+ ["Distance:", e.position.distanceTo(n)],
1518
1713
  [`origin: ${e.name || e.type}`, `x:${e.position.x}, y:${e.position.y}, z:${(s = e.position) == null ? void 0 : s.z}`],
1519
- [`Destiny: ${e.name || e.type}`, `x:${r.x}, y:${r.y}, z:${r == null ? void 0 : r.z}`]
1714
+ [`Destiny: ${e.name || e.type}`, `x:${n.x}, y:${n.y}, z:${n == null ? void 0 : n.z}`]
1520
1715
  ]
1521
1716
  );
1522
1717
  },
1523
1718
  unmounted: (e) => {
1524
- j == null || j.dispose(), e.parent.remove(j);
1719
+ B == null || B.dispose(), e.parent.remove(B);
1525
1720
  }
1526
- }, Cn = {
1721
+ }, Ir = {
1527
1722
  install(e) {
1528
- e.component("TresCanvas", tn);
1723
+ e.component("TresCanvas", mr);
1529
1724
  }
1530
1725
  };
1531
1726
  export {
1532
- tn as TresCanvas,
1533
- de as catalogue,
1534
- Hr as createRenderLoop,
1535
- Cn as default,
1536
- we as dispose,
1537
- me as extend,
1538
- pn as isProd,
1539
- hr as normalizeColor,
1540
- dn as normalizeVectorFlexibleParam,
1541
- bn as templateCompilerOptions,
1542
- jr as trasverseObjects,
1543
- dr as useCamera,
1544
- mn as useLoader,
1545
- $ as useLogger,
1546
- wn as useLoop,
1547
- hn as usePointerEventHandler,
1548
- tt as useRaycaster,
1549
- fn as useRenderLoop,
1550
- Dr as useRenderer,
1551
- vn as useSeek,
1552
- gn as useTexture,
1553
- yn as useTres,
1554
- rt as useTresContext,
1555
- $r as useTresContextProvider,
1556
- Fr as useTresEventManager,
1557
- _n as vDistanceTo,
1558
- Pn as vLightHelper,
1559
- Mn as vLog
1727
+ mr as TresCanvas,
1728
+ ye as catalogue,
1729
+ Qn as createRenderLoop,
1730
+ Ir as default,
1731
+ Ce as dispose,
1732
+ we as extend,
1733
+ Cr as isProd,
1734
+ Tn as normalizeColor,
1735
+ Er as normalizeVectorFlexibleParam,
1736
+ Or as onTresReady,
1737
+ Rr as templateCompilerOptions,
1738
+ Yn as trasverseObjects,
1739
+ Cn as useCamera,
1740
+ kr as useLoader,
1741
+ F as useLogger,
1742
+ Lr as useLoop,
1743
+ Ar as usePointerEventHandler,
1744
+ ct as useRaycaster,
1745
+ Pr as useRenderLoop,
1746
+ zn as useRenderer,
1747
+ Tr as useSeek,
1748
+ Sr as useTexture,
1749
+ xr as useTres,
1750
+ ce as useTresContext,
1751
+ Xn as useTresContextProvider,
1752
+ Zn as useTresEventManager,
1753
+ jr as vDistanceTo,
1754
+ Br as vLightHelper,
1755
+ Dr as vLog
1560
1756
  };