@tomorrowevening/hermes 0.0.134 → 0.0.135

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/hermes.es.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Texture as Li, OrthographicCamera as ki, Scene as Vi, MeshBasicMaterial as Je, BufferGeometry as _t, Float32BufferAttribute as Ke, Mesh as M, LinearSRGBColorSpace as jt, ObjectLoader as Qn, AnimationMixer as Jn, AnimationClip as ea, EventDispatcher as Zi, Clock as qs, Group as ti, RepeatWrapping as ds, Color as et, ColorManagement as mt, WebGLRenderTarget as ta, FrontSide as ia, BackSide as Ks, DoubleSide as Wi, NoBlending as sa, NormalBlending as na, AdditiveBlending as aa, SubtractiveBlending as ra, MultiplyBlending as oa, CustomBlending as la, AddEquation as ca, SubtractEquation as ha, ReverseSubtractEquation as da, MinEquation as ua, MaxEquation as pa, ZeroFactor as Qs, OneFactor as Js, SrcColorFactor as en, OneMinusSrcColorFactor as tn, SrcAlphaFactor as sn, OneMinusSrcAlphaFactor as nn, DstAlphaFactor as an, OneMinusDstAlphaFactor as rn, DstColorFactor as on, OneMinusDstColorFactor as ln, SrcAlphaSaturateFactor as ma, ConstantColorFactor as cn, OneMinusConstantColorFactor as hn, ConstantAlphaFactor as dn, OneMinusConstantAlphaFactor as un, Line as Ie, LineBasicMaterial as Gi, Ray as fa, Plane as ga, MathUtils as _a, Vector3 as P, Controls as pn, MOUSE as gt, TOUCH as ft, Quaternion as Ce, Spherical as Ui, Vector2 as pe, ShaderMaterial as mn, GLSL3 as va, PlaneGeometry as fn, Raycaster as ai, Euler as gn, Matrix4 as hi, Object3D as vt, CylinderGeometry as ve, BoxGeometry as de, OctahedronGeometry as Zt, SphereGeometry as _n, TorusGeometry as Et, CatmullRomCurve3 as us, AxesHelper as ya, MeshDepthMaterial as ba, MeshNormalMaterial as Ea, WebGLRenderer as Ca, PerspectiveCamera as ps, CameraHelper as wa, SkinnedMesh as Sa, SpotLightHelper as xa, PointLightHelper as Oa, HemisphereLightHelper as Ta, DirectionalLightHelper as Ma, Vector4 as Pa, Box3 as Aa, Sphere as Da, SkeletonHelper as Ra, SRGBColorSpace as ms, NoToneMapping as fs, NoColorSpace as Ia, LinearToneMapping as La, ReinhardToneMapping as ka, CineonToneMapping as Ua, ACESFilmicToneMapping as ja, AgXToneMapping as Na, NeutralToneMapping as Fa, CustomToneMapping as za } from "three";
2
2
  import vn, { useState as B, useRef as J, useEffect as tt, useMemo as Ut, Component as Ft, createRef as Ve, forwardRef as Ha } from "react";
3
3
  const ri = () => {
4
- }, Fo = () => {
4
+ }, zo = () => {
5
5
  };
6
6
  function oi(i) {
7
7
  return i.substring(0, 1).toUpperCase() + i.substring(1);
@@ -20,30 +20,30 @@ function gs(i) {
20
20
  const e = Math.round(i.r * 255), t = Math.round(i.g * 255), s = Math.round(i.b * 255), n = (c) => {
21
21
  const l = c.toString(16);
22
22
  return l.length === 1 ? "0" + l : l;
23
- }, a = n(e), r = n(t), o = n(s);
24
- return "#" + a + r + o;
23
+ }, r = n(e), a = n(t), o = n(s);
24
+ return "#" + r + a + o;
25
25
  }
26
26
  function yi(i, e, t, s) {
27
- return new (t || (t = Promise))(function(n, a) {
28
- function r(l) {
27
+ return new (t || (t = Promise))(function(n, r) {
28
+ function a(l) {
29
29
  try {
30
30
  c(s.next(l));
31
31
  } catch (d) {
32
- a(d);
32
+ r(d);
33
33
  }
34
34
  }
35
35
  function o(l) {
36
36
  try {
37
37
  c(s.throw(l));
38
38
  } catch (d) {
39
- a(d);
39
+ r(d);
40
40
  }
41
41
  }
42
42
  function c(l) {
43
43
  var d;
44
44
  l.done ? n(l.value) : (d = l.value, d instanceof t ? d : new t(function(p) {
45
45
  p(d);
46
- })).then(r, o);
46
+ })).then(a, o);
47
47
  }
48
48
  c((s = s.apply(i, e || [])).next());
49
49
  });
@@ -89,7 +89,7 @@ function Wa(i, e, t) {
89
89
  l.vertexAttribPointer(x, 3, 5126, !1, 0, 0), l.enableVertexAttribArray(x), l.clearColor(1, 1, 1, 1), l.clear(16384), l.viewport(0, 0, 1, 1), l.drawArrays(4, 0, 3);
90
90
  const g = new Uint8Array(4);
91
91
  return l.readPixels(0, 0, 1, 1, 6408, 5121, g), l.deleteProgram(E), l.deleteBuffer(v), g.join("");
92
- }(i), n = "801621810", a = "8016218135", r = "80162181161", o = Le?.isIpad ? [["a7", r, 12], ["a8", a, 15], ["a8x", a, 15], ["a9", a, 15], ["a9x", a, 15], ["a10", a, 15], ["a10x", a, 15], ["a12", n, 15], ["a12x", n, 15], ["a12z", n, 15], ["a14", n, 15], ["a15", n, 15], ["m1", n, 15], ["m2", n, 15]] : [["a7", r, 12], ["a8", a, 12], ["a9", a, 15], ["a10", a, 15], ["a11", n, 15], ["a12", n, 15], ["a13", n, 15], ["a14", n, 15], ["a15", n, 15], ["a16", n, 15], ["a17", n, 15]];
92
+ }(i), n = "801621810", r = "8016218135", a = "80162181161", o = Le?.isIpad ? [["a7", a, 12], ["a8", r, 15], ["a8x", r, 15], ["a9", r, 15], ["a9x", r, 15], ["a10", r, 15], ["a10x", r, 15], ["a12", n, 15], ["a12x", n, 15], ["a12z", n, 15], ["a14", n, 15], ["a15", n, 15], ["m1", n, 15], ["m2", n, 15]] : [["a7", a, 12], ["a8", r, 12], ["a9", r, 15], ["a10", r, 15], ["a11", n, 15], ["a12", n, 15], ["a13", n, 15], ["a14", n, 15], ["a15", n, 15], ["a16", n, 15], ["a17", n, 15]];
93
93
  let c;
94
94
  return s === "80162181255" ? c = o.filter(([, , l]) => l >= 14) : (c = o.filter(([, l]) => l === s), c.length || (c = o)), c.map(([l]) => `apple ${l} gpu`);
95
95
  }
@@ -107,28 +107,28 @@ function Ga(i, e) {
107
107
  let s = i.length, n = e.length;
108
108
  for (; s > 0 && i.charCodeAt(~-s) === e.charCodeAt(~-n); )
109
109
  s--, n--;
110
- let a, r = 0;
111
- for (; r < s && i.charCodeAt(r) === e.charCodeAt(r); )
112
- r++;
113
- if (s -= r, n -= r, s === 0)
110
+ let r, a = 0;
111
+ for (; a < s && i.charCodeAt(a) === e.charCodeAt(a); )
112
+ a++;
113
+ if (s -= a, n -= a, s === 0)
114
114
  return n;
115
115
  let o, c, l = 0, d = 0, p = 0;
116
116
  for (; d < s; )
117
- ys[d] = i.charCodeAt(r + d), bi[d] = ++d;
117
+ ys[d] = i.charCodeAt(a + d), bi[d] = ++d;
118
118
  for (; p < n; )
119
- for (a = e.charCodeAt(r + p), o = p++, l = p, d = 0; d < s; d++)
120
- c = a === ys[d] ? o : o + 1, o = bi[d], l = bi[d] = o > l ? c > l ? l + 1 : c : c > o ? o + 1 : c;
119
+ for (r = e.charCodeAt(a + p), o = p++, l = p, d = 0; d < s; d++)
120
+ c = r === ys[d] ? o : o + 1, o = bi[d], l = bi[d] = o > l ? c > l ? l + 1 : c : c > o ? o + 1 : c;
121
121
  return l;
122
122
  }
123
123
  function Xa(i) {
124
124
  return i != null;
125
125
  }
126
- const $a = ({ mobileTiers: i = [0, 15, 30, 60], desktopTiers: e = [0, 15, 30, 60], override: t = {}, glContext: s, failIfMajorPerformanceCaveat: n = !1, benchmarksURL: a = "https://unpkg.com/detect-gpu@5.0.57/dist/benchmarks" } = {}) => yi(void 0, void 0, void 0, function* () {
127
- const r = {};
126
+ const $a = ({ mobileTiers: i = [0, 15, 30, 60], desktopTiers: e = [0, 15, 30, 60], override: t = {}, glContext: s, failIfMajorPerformanceCaveat: n = !1, benchmarksURL: r = "https://unpkg.com/detect-gpu@5.0.57/dist/benchmarks" } = {}) => yi(void 0, void 0, void 0, function* () {
127
+ const a = {};
128
128
  if (yn)
129
129
  return { tier: 0, type: "SSR" };
130
130
  const { isIpad: o = !!Le?.isIpad, isMobile: c = !!Le?.isMobile, screenSize: l = window.screen, loadBenchmarks: d = (S) => yi(void 0, void 0, void 0, function* () {
131
- const O = yield fetch(`${a}/${S}`).then((I) => I.json());
131
+ const O = yield fetch(`${r}/${S}`).then((I) => I.json());
132
132
  if (parseInt(O.shift().split(".")[0], 10) < 4)
133
133
  throw new vs("Detect GPU benchmark data is out of date. Please update to version 4x");
134
134
  return O;
@@ -165,7 +165,7 @@ const $a = ({ mobileTiers: i = [0, 15, 30, 60], desktopTiers: e = [0, 15, 30, 60
165
165
  })(S);
166
166
  if (!I)
167
167
  return;
168
- const U = `${c ? "m" : "d"}-${I}${o ? "-ipad" : ""}.json`, R = r[U] = (O = r[U]) !== null && O !== void 0 ? O : d(U);
168
+ const U = `${c ? "m" : "d"}-${I}${o ? "-ipad" : ""}.json`, R = a[U] = (O = a[U]) !== null && O !== void 0 ? O : d(U);
169
169
  let V;
170
170
  try {
171
171
  V = yield R;
@@ -211,18 +211,32 @@ const $a = ({ mobileTiers: i = [0, 15, 30, 60], desktopTiers: e = [0, 15, 30, 60
211
211
  return m(w, "BENCHMARK", g, x, y);
212
212
  });
213
213
  var qa = /* @__PURE__ */ ((i) => (i[i.High = 0] = "High", i[i.Medium = 1] = "Medium", i[i.Low = 2] = "Low", i))(qa || {});
214
- function zo(i) {
214
+ function Ka(i) {
215
+ let e = 0;
216
+ const t = performance.now();
217
+ function s() {
218
+ e++;
219
+ const n = performance.now();
220
+ if (n - t >= 40) {
221
+ const r = e / ((n - t) / 1e3), a = Math.round(r / 30) * 30;
222
+ i(a);
223
+ } else
224
+ requestAnimationFrame(s);
225
+ }
226
+ requestAnimationFrame(s);
227
+ }
228
+ function Ho(i) {
215
229
  return new Promise((e) => {
216
230
  $a().then((t) => {
217
231
  let s = !1;
218
232
  const n = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
219
233
  if (s = "transferControlToOffscreen" in i, n) {
220
- const r = navigator.userAgent.match(/version\/(\d+)/i);
221
- s = (r ? parseInt(r[1]) : 0) >= 17;
234
+ const a = navigator.userAgent.match(/version\/(\d+)/i);
235
+ s = (a ? parseInt(a[1]) : 0) >= 17;
222
236
  }
223
- const a = {
237
+ const r = {
224
238
  dpr: devicePixelRatio,
225
- fps: t.fps !== void 0 ? t.fps : 30,
239
+ fps: 30,
226
240
  width: innerWidth,
227
241
  height: innerHeight,
228
242
  mobile: t.isMobile !== void 0 ? t.isMobile : !1,
@@ -230,7 +244,9 @@ function zo(i) {
230
244
  quality: 2
231
245
  /* Low */
232
246
  };
233
- t.tier === 3 ? a.quality = 0 : t.tier === 2 && (a.quality = 1), e(a);
247
+ t.tier === 3 ? r.quality = 0 : t.tier === 2 && (r.quality = 1), Ka((a) => {
248
+ r.fps = a, e(r);
249
+ });
234
250
  });
235
251
  });
236
252
  }
@@ -243,50 +259,50 @@ function ji(i, e, t) {
243
259
  function Nt(i, e, t) {
244
260
  return i * (1 - t) + e * t;
245
261
  }
246
- function Ho(i, e, t, s, n) {
262
+ function Yo(i, e, t, s, n) {
247
263
  return Nt(t, s, ji(i, e, n));
248
264
  }
249
- function Yo(i, e) {
265
+ function Bo(i, e) {
250
266
  const t = i - e;
251
267
  return Math.sqrt(t * t);
252
268
  }
253
269
  function Pe(i, e = 1) {
254
270
  return Number(i.toFixed(e));
255
271
  }
256
- function Bo(i, e, t, s) {
272
+ function Vo(i, e, t, s) {
257
273
  return Nt(i, e, 1 - Math.exp(-t * s));
258
274
  }
259
- function Vo(i, e = 1) {
275
+ function Zo(i, e = 1) {
260
276
  return Number(i.toFixed(e));
261
277
  }
262
- function Ka(i, e, t, s) {
278
+ function Qa(i, e, t, s) {
263
279
  return i === e && t === s;
264
280
  }
265
- function Qa(i, e, t, s) {
281
+ function Ja(i, e, t, s) {
266
282
  return 1 / (3 * e * i * i + 2 * t * i + s);
267
283
  }
268
- function Ja(i, e, t, s, n) {
284
+ function er(i, e, t, s, n) {
269
285
  return e * (i * i * i) + t * (i * i) + s * i + n;
270
286
  }
271
- function er(i, e, t, s, n) {
272
- const a = i * i;
273
- return e * (a * i) + t * a + s * i + n;
287
+ function tr(i, e, t, s, n) {
288
+ const r = i * i;
289
+ return e * (r * i) + t * r + s * i + n;
274
290
  }
275
- function Zo(i, e, t, s, n) {
291
+ function Wo(i, e, t, s, n) {
276
292
  if (i <= 0)
277
293
  return 0;
278
294
  if (i >= 1)
279
295
  return 1;
280
- if (Ka(e, t, s, n))
296
+ if (Qa(e, t, s, n))
281
297
  return i;
282
- const a = 0, r = 0, o = e, c = t, l = s, d = n, p = 1, m = 1, f = p - 3 * l + 3 * o - a, E = 3 * l - 6 * o + 3 * a, v = 3 * o - 3 * a, x = a, g = m - 3 * d + 3 * c - r, y = 3 * d - 6 * c + 3 * r, C = 3 * c - 3 * r, w = r;
298
+ const r = 0, a = 0, o = e, c = t, l = s, d = n, p = 1, m = 1, f = p - 3 * l + 3 * o - r, E = 3 * l - 6 * o + 3 * r, v = 3 * o - 3 * r, x = r, g = m - 3 * d + 3 * c - a, y = 3 * d - 6 * c + 3 * a, C = 3 * c - 3 * a, w = a;
283
299
  let S = i;
284
300
  for (let O = 0; O < 5; O++) {
285
- const I = Ja(S, f, E, v, x);
286
- let U = Qa(S, f, E, v);
301
+ const I = er(S, f, E, v, x);
302
+ let U = Ja(S, f, E, v);
287
303
  U === 1 / 0 && (U = i), S -= (I - i) * U, S = Math.min(Math.max(S, 0), 1);
288
304
  }
289
- return er(S, g, y, C, w);
305
+ return tr(S, g, y, C, w);
290
306
  }
291
307
  const bs = (i) => {
292
308
  i?.dispose();
@@ -362,8 +378,8 @@ class ii {
362
378
  const n = e.image;
363
379
  if (n != null && n.width > 0) {
364
380
  this.canvas.title = e.sourceFile;
365
- const a = this.canvas.width / n.width, r = this.renderToCanvas(e);
366
- this.context.drawImage(r, 0, 0, n.width * a, n.height * a);
381
+ const r = this.canvas.width / n.width, a = this.renderToCanvas(e);
382
+ this.context.drawImage(a, 0, 0, n.width * r, n.height * r);
367
383
  }
368
384
  }
369
385
  return e.repeat.copy(t), e.offset.copy(s), this.canvas.toDataURL("image/png");
@@ -385,24 +401,24 @@ class ii {
385
401
  return this.renderer.domElement;
386
402
  }
387
403
  }
388
- function Wo(i) {
404
+ function Go(i) {
389
405
  return new Promise((e) => {
390
406
  const t = new Qn();
391
407
  t.parseAsync(i.scene).then((s) => {
392
408
  const n = new Jn(s);
393
409
  if (i.animations.length > 0) {
394
- const r = i.animations.map((c) => ea.parse(c));
395
- n.clipAction(r[0]).play(), n.getRoot().animations = i.animations, n.getRoot().mixer = n;
410
+ const a = i.animations.map((c) => ea.parse(c));
411
+ n.clipAction(a[0]).play(), n.getRoot().animations = i.animations, n.getRoot().mixer = n;
396
412
  }
397
- const a = [];
398
- i.cameras && i.cameras.length > 0 && i.cameras.forEach((r) => {
399
- const o = t.parse(r);
400
- a.push(o);
413
+ const r = [];
414
+ i.cameras && i.cameras.length > 0 && i.cameras.forEach((a) => {
415
+ const o = t.parse(a);
416
+ r.push(o);
401
417
  }), e({
402
418
  animations: i.animations,
403
419
  model: s,
404
420
  mixer: n,
405
- cameras: a
421
+ cameras: r
406
422
  });
407
423
  });
408
424
  });
@@ -418,46 +434,46 @@ const at = Xi([
418
434
  "clientY",
419
435
  "pageX",
420
436
  "pageY"
421
- ]), tr = Xi([
437
+ ]), ir = Xi([
422
438
  "clientX",
423
439
  "clientY",
424
440
  "deltaX",
425
441
  "deltaY",
426
442
  "deltaMode"
427
- ]), ir = Xi([
443
+ ]), sr = Xi([
428
444
  "ctrlKey",
429
445
  "metaKey",
430
446
  "shiftKey",
431
447
  "keyCode"
432
448
  ]);
433
- function sr(i, e) {
434
- i.preventDefault(), tr(i, e);
449
+ function nr(i, e) {
450
+ i.preventDefault(), ir(i, e);
435
451
  }
436
- function nr(i) {
452
+ function ar(i) {
437
453
  i.preventDefault();
438
454
  }
439
- function ar(i, e, t) {
455
+ function rr(i, e, t) {
440
456
  for (const s of e)
441
457
  t[s] = i[s];
442
458
  }
443
459
  function Xi(i) {
444
460
  return function(t, s) {
445
461
  const n = { type: t.type };
446
- ar(t, i, n), s(n);
462
+ rr(t, i, n), s(n);
447
463
  };
448
464
  }
449
465
  function Ei(i, e) {
450
466
  const t = [], s = { type: i.type, touches: t };
451
467
  for (let n = 0; n < i.touches.length; ++n) {
452
- const a = i.touches[n];
468
+ const r = i.touches[n];
453
469
  t.push({
454
- pageX: a.pageX,
455
- pageY: a.pageY
470
+ pageX: r.pageX,
471
+ pageY: r.pageY
456
472
  });
457
473
  }
458
474
  e(s);
459
475
  }
460
- const rr = {
476
+ const or = {
461
477
  37: !0,
462
478
  // left
463
479
  38: !0,
@@ -467,12 +483,12 @@ const rr = {
467
483
  40: !0
468
484
  // down
469
485
  };
470
- function or(i, e) {
486
+ function lr(i, e) {
471
487
  const { keyCode: t } = i;
472
- rr[t] && (i.preventDefault(), ir(i, e));
488
+ or[t] && (i.preventDefault(), sr(i, e));
473
489
  }
474
- const Go = {
475
- contextmenu: nr,
490
+ const Xo = {
491
+ contextmenu: ar,
476
492
  mousedown: at,
477
493
  mousemove: at,
478
494
  mouseup: at,
@@ -482,31 +498,31 @@ const Go = {
482
498
  touchstart: Ei,
483
499
  touchmove: Ei,
484
500
  touchend: Ei,
485
- wheel: sr,
486
- keydown: or
501
+ wheel: nr,
502
+ keydown: lr
487
503
  };
488
- let lr = 0;
489
- class Xo {
504
+ let cr = 0;
505
+ class $o {
490
506
  id;
491
507
  worker;
492
508
  constructor(e, t, s) {
493
- this.id = lr++, this.worker = t;
494
- const n = (r) => {
509
+ this.id = cr++, this.worker = t;
510
+ const n = (a) => {
495
511
  this.worker.postMessage({
496
512
  type: "event",
497
513
  id: this.id,
498
- data: r
514
+ data: a
499
515
  });
500
516
  };
501
517
  t.postMessage({
502
518
  type: "makeProxy",
503
519
  id: this.id
504
520
  });
505
- for (const [r, o] of Object.entries(s))
506
- e.addEventListener(r, (c) => {
521
+ for (const [a, o] of Object.entries(s))
522
+ e.addEventListener(a, (c) => {
507
523
  o(c, n);
508
524
  });
509
- function a() {
525
+ function r() {
510
526
  n({
511
527
  type: "resize",
512
528
  left: 0,
@@ -515,10 +531,10 @@ class Xo {
515
531
  height: innerHeight
516
532
  });
517
533
  }
518
- window.addEventListener("resize", a), a();
534
+ window.addEventListener("resize", r), r();
519
535
  }
520
536
  }
521
- class cr extends Zi {
537
+ class hr extends Zi {
522
538
  style = {};
523
539
  left = 0;
524
540
  top = 0;
@@ -572,13 +588,13 @@ class cr extends Zi {
572
588
  return this;
573
589
  }
574
590
  }
575
- class $o {
591
+ class qo {
576
592
  targets = {};
577
593
  constructor() {
578
594
  this.handleEvent = this.handleEvent.bind(this);
579
595
  }
580
596
  makeProxy(e) {
581
- const { id: t } = e, s = new cr();
597
+ const { id: t } = e, s = new hr();
582
598
  this.targets[t] = s;
583
599
  }
584
600
  getProxy(e) {
@@ -588,7 +604,7 @@ class $o {
588
604
  this.targets[e.id]?.handleEvent(e.data);
589
605
  }
590
606
  }
591
- class qo {
607
+ class Ko {
592
608
  components = /* @__PURE__ */ new Map();
593
609
  listen;
594
610
  // Protected
@@ -646,7 +662,7 @@ class qo {
646
662
  e && (this._mode = "editor");
647
663
  }
648
664
  }
649
- class Ko {
665
+ class Qo {
650
666
  canvas;
651
667
  inputElement;
652
668
  settings;
@@ -679,7 +695,7 @@ class Ko {
679
695
  this.update(), this.draw(), this.rafID = requestAnimationFrame(this.onUpdate);
680
696
  };
681
697
  }
682
- class Qo extends Vi {
698
+ class Jo extends Vi {
683
699
  clock;
684
700
  cameras;
685
701
  lights;
@@ -767,7 +783,7 @@ class $i {
767
783
  handleEditor(e, t, s) {
768
784
  }
769
785
  }
770
- class Jo extends $i {
786
+ class el extends $i {
771
787
  selectDropdown(e, t) {
772
788
  this.app.send({
773
789
  event: "selectComponent",
@@ -799,10 +815,10 @@ class Jo extends $i {
799
815
  }
800
816
  }
801
817
  }
802
- function el(i, e, t) {
818
+ function tl(i, e, t) {
803
819
  if (i.editor) {
804
- t.ui.restore(), t.onSelectionChange((r) => {
805
- r.length < 1 || r.forEach((o) => {
820
+ t.ui.restore(), t.onSelectionChange((a) => {
821
+ a.length < 1 || a.forEach((o) => {
806
822
  let c = o.address.sheetId, l = "setSheet", d = {};
807
823
  switch (o.type) {
808
824
  case "Theatre_Sheet_PublicAPI":
@@ -825,24 +841,24 @@ function el(i, e, t) {
825
841
  const n = () => {
826
842
  if (e.activeSheet !== void 0 && s !== e.activeSheet.sequence.position) {
827
843
  s = e.activeSheet.sequence.position;
828
- const r = e.activeSheet;
844
+ const a = e.activeSheet;
829
845
  i.send({
830
846
  event: "updateTimeline",
831
847
  target: "app",
832
848
  data: {
833
849
  position: s,
834
- sheet: r.address.sheetId
850
+ sheet: a.address.sheetId
835
851
  }
836
852
  });
837
853
  }
838
- }, a = () => {
839
- n(), requestAnimationFrame(a);
854
+ }, r = () => {
855
+ n(), requestAnimationFrame(r);
840
856
  };
841
- n(), a();
857
+ n(), r();
842
858
  } else
843
859
  t.ui.hide();
844
860
  }
845
- function tl() {
861
+ function il() {
846
862
  setTimeout(() => {
847
863
  const i = document.getElementById("theatrejs-studio-root");
848
864
  if (i === null || i.shadowRoot === null)
@@ -868,23 +884,23 @@ function tl() {
868
884
  }
869
885
  }, 1e3);
870
886
  }
871
- function hr(i, e, t, s, n) {
872
- const a = 1 - i;
873
- return a * a * a * e + 3 * a * a * i * t + 3 * a * i * i * s + i * i * i * n;
887
+ function dr(i, e, t, s, n) {
888
+ const r = 1 - i;
889
+ return r * r * r * e + 3 * r * r * i * t + 3 * r * i * i * s + i * i * i * n;
874
890
  }
875
- function dr(i, e, t) {
891
+ function ur(i, e, t) {
876
892
  if (i.type !== "bezier" || i.handles.length !== 4)
877
893
  throw new Error("Invalid keyframe data for Bézier interpolation.");
878
- const [s, n] = i.handles, a = (t - i.position) / (e.position - i.position);
879
- return hr(
880
- a,
894
+ const [s, n] = i.handles, r = (t - i.position) / (e.position - i.position);
895
+ return dr(
896
+ r,
881
897
  i.value,
882
898
  i.value + s,
883
899
  e.value + n,
884
900
  e.value
885
901
  );
886
902
  }
887
- class il extends $i {
903
+ class sl extends $i {
888
904
  project;
889
905
  sheets = /* @__PURE__ */ new Map();
890
906
  sheetObjects = /* @__PURE__ */ new Map();
@@ -909,8 +925,8 @@ class il extends $i {
909
925
  }
910
926
  playSheet(e, t, s) {
911
927
  return new Promise((n) => {
912
- const a = t !== void 0 ? { ...t } : {};
913
- this.sheet(e, s)?.sequence.play(a).then((r) => n(r)), this.app.send({
928
+ const r = t !== void 0 ? { ...t } : {};
929
+ this.sheet(e, s)?.sequence.play(r).then((a) => n(a)), this.app.send({
914
930
  event: "playSheet",
915
931
  target: "editor",
916
932
  data: {
@@ -936,17 +952,17 @@ class il extends $i {
936
952
  s.search(`${e}_`) > -1 && this.unsubscribe(t);
937
953
  });
938
954
  }
939
- sheetObject(e, t, s, n, a) {
955
+ sheetObject(e, t, s, n, r) {
940
956
  if (this.project === void 0) {
941
957
  console.error("Theatre Project hasn't been created yet.");
942
958
  return;
943
959
  }
944
- const r = this.sheet(e, a);
945
- if (r === void 0)
960
+ const a = this.sheet(e, r);
961
+ if (a === void 0)
946
962
  return;
947
- const c = `${this.getSheetInstance(e, a)}_${t}`;
963
+ const c = `${this.getSheetInstance(e, r)}_${t}`;
948
964
  let l = this.sheetObjects.get(c), d = s;
949
- l !== void 0 && (d = { ...s, ...l.value }), l = r.object(t, d), this.sheetObjects.set(c, l), this.sheetObjectCBs.set(c, n !== void 0 ? n : ri);
965
+ l !== void 0 && (d = { ...s, ...l.value }), l = a.object(t, d), this.sheetObjects.set(c, l), this.sheetObjectCBs.set(c, n !== void 0 ? n : ri);
950
966
  const p = l.onValuesChange((m) => {
951
967
  if (this.app.editor) {
952
968
  for (const E in m) {
@@ -977,17 +993,17 @@ class il extends $i {
977
993
  const n = this.sheet(e);
978
994
  if (n === void 0)
979
995
  return [];
980
- const a = `${e}_${t}`, r = this.sheetObjects.get(a);
981
- return r === void 0 ? [] : n.sequence.__experimental_getKeyframes(r.props[s]);
996
+ const r = `${e}_${t}`, a = this.sheetObjects.get(r);
997
+ return a === void 0 ? [] : n.sequence.__experimental_getKeyframes(a.props[s]);
982
998
  }
983
999
  getSheetObjectVectors(e, t) {
984
1000
  const s = this.sheet(e);
985
1001
  if (s === void 0)
986
1002
  return [];
987
- const n = `${e}_${t}`, a = this.sheetObjects.get(n);
988
- if (a === void 0)
1003
+ const n = `${e}_${t}`, r = this.sheetObjects.get(n);
1004
+ if (r === void 0)
989
1005
  return [];
990
- const r = [], o = s.sequence.__experimental_getKeyframes(a.props.x), c = s.sequence.__experimental_getKeyframes(a.props.y), l = s.sequence.__experimental_getKeyframes(a.props.z), d = /* @__PURE__ */ new Set();
1006
+ const a = [], o = s.sequence.__experimental_getKeyframes(r.props.x), c = s.sequence.__experimental_getKeyframes(r.props.y), l = s.sequence.__experimental_getKeyframes(r.props.z), d = /* @__PURE__ */ new Set();
991
1007
  return o.forEach((m) => d.add(m.position)), c.forEach((m) => d.add(m.position)), l.forEach((m) => d.add(m.position)), Array.from(d).sort((m, f) => m - f).forEach((m) => {
992
1008
  const f = (E, v) => {
993
1009
  const x = E.find((C, w) => C.position <= v && (E[w + 1]?.position || 1 / 0) > v), g = E.find((C) => C.position > v);
@@ -996,17 +1012,17 @@ class il extends $i {
996
1012
  if (!g || x.position === v)
997
1013
  return x.value;
998
1014
  if (x.type === "bezier")
999
- return dr(x, g, v);
1015
+ return ur(x, g, v);
1000
1016
  const y = (v - x.position) / (g.position - x.position);
1001
1017
  return x.value + y * (g.value - x.value);
1002
1018
  };
1003
- r.push({
1019
+ a.push({
1004
1020
  position: m,
1005
1021
  x: f(o, m),
1006
1022
  y: f(c, m),
1007
1023
  z: f(l, m)
1008
1024
  });
1009
- }), r;
1025
+ }), a;
1010
1026
  }
1011
1027
  unsubscribe(e) {
1012
1028
  if (this.project === void 0) {
@@ -1015,24 +1031,24 @@ class il extends $i {
1015
1031
  }
1016
1032
  const t = e.address.sheetId, s = e.address.objectKey;
1017
1033
  this.sheets.get(t)?.detachObject(s);
1018
- const a = `${t}_${s}`, r = this.sheetObjectUnsubscribe.get(a);
1019
- r !== void 0 && (this.sheetObjects.delete(a), this.sheetObjectCBs.delete(a), this.sheetObjectUnsubscribe.delete(a), r());
1034
+ const r = `${t}_${s}`, a = this.sheetObjectUnsubscribe.get(r);
1035
+ a !== void 0 && (this.sheetObjects.delete(r), this.sheetObjectCBs.delete(r), this.sheetObjectUnsubscribe.delete(r), a());
1020
1036
  }
1021
1037
  handleApp(e, t, s) {
1022
1038
  const n = t;
1023
- let a;
1039
+ let r;
1024
1040
  switch (s.event) {
1025
1041
  case "setSheet":
1026
- a = n.sheets.get(s.data.sheet), a !== void 0 && (n.activeSheet = a, this.studio?.setSelection([a]));
1042
+ r = n.sheets.get(s.data.sheet), r !== void 0 && (n.activeSheet = r, this.studio?.setSelection([r]));
1027
1043
  break;
1028
1044
  case "setSheetObject":
1029
- a = n.sheetObjects.get(`${s.data.sheet}_${s.data.key}`), a !== void 0 && this.studio?.setSelection([a]);
1045
+ r = n.sheetObjects.get(`${s.data.sheet}_${s.data.key}`), r !== void 0 && this.studio?.setSelection([r]);
1030
1046
  break;
1031
1047
  case "updateSheetObject":
1032
- a = n.sheets.get(s.data.sheet), a !== void 0 && a.sequence.pause(), a = n.sheetObjectCBs.get(s.data.sheetObject), a !== void 0 && a(s.data.values);
1048
+ r = n.sheets.get(s.data.sheet), r !== void 0 && r.sequence.pause(), r = n.sheetObjectCBs.get(s.data.sheetObject), r !== void 0 && r(s.data.values);
1033
1049
  break;
1034
1050
  case "updateTimeline":
1035
- a = n.sheets.get(s.data.sheet), n.activeSheet !== void 0 && (n.activeSheet.sequence.position = s.data.position);
1051
+ r = n.sheets.get(s.data.sheet), n.activeSheet !== void 0 && (n.activeSheet.sequence.position = s.data.position);
1036
1052
  break;
1037
1053
  }
1038
1054
  }
@@ -1051,8 +1067,8 @@ class il extends $i {
1051
1067
  }
1052
1068
  handleEditorApp(e, t) {
1053
1069
  if (e.editor) {
1054
- this.studio?.ui.restore(), this.studio?.onSelectionChange((r) => {
1055
- r.length < 1 || r.forEach((o) => {
1070
+ this.studio?.ui.restore(), this.studio?.onSelectionChange((a) => {
1071
+ a.length < 1 || a.forEach((o) => {
1056
1072
  let c = o.address.sheetId, l = "setSheet", d = {};
1057
1073
  switch (o.type) {
1058
1074
  case "Theatre_Sheet_PublicAPI":
@@ -1075,25 +1091,25 @@ class il extends $i {
1075
1091
  const n = () => {
1076
1092
  if (t.activeSheet !== void 0 && s !== t.activeSheet.sequence.position) {
1077
1093
  s = t.activeSheet.sequence.position;
1078
- const r = t.activeSheet;
1094
+ const a = t.activeSheet;
1079
1095
  e.send({
1080
1096
  event: "updateTimeline",
1081
1097
  target: "app",
1082
1098
  data: {
1083
1099
  position: s,
1084
- sheet: r.address.sheetId
1100
+ sheet: a.address.sheetId
1085
1101
  }
1086
1102
  });
1087
1103
  }
1088
- }, a = () => {
1089
- n(), requestAnimationFrame(a);
1104
+ }, r = () => {
1105
+ n(), requestAnimationFrame(r);
1090
1106
  };
1091
- n(), a();
1107
+ n(), r();
1092
1108
  } else
1093
1109
  this.studio?.ui.hide();
1094
1110
  }
1095
1111
  }
1096
- function ur(i) {
1112
+ function pr(i) {
1097
1113
  if (i.name === "cameras")
1098
1114
  return "camera";
1099
1115
  if (i.name === "interactive")
@@ -1118,7 +1134,7 @@ function pt(i) {
1118
1134
  e.children.push(pt(t));
1119
1135
  }), e;
1120
1136
  }
1121
- function pr(i) {
1137
+ function mr(i) {
1122
1138
  const e = {};
1123
1139
  for (const t in i) {
1124
1140
  const s = i[t].value;
@@ -1134,7 +1150,7 @@ function pr(i) {
1134
1150
  }
1135
1151
  return e;
1136
1152
  }
1137
- function mr(i) {
1153
+ function fr(i) {
1138
1154
  switch (i) {
1139
1155
  case "blendSrcAlpha":
1140
1156
  case "blendDstAlpha":
@@ -1149,7 +1165,7 @@ function mr(i) {
1149
1165
  function rt(i) {
1150
1166
  const e = {};
1151
1167
  for (const t in i) {
1152
- if (t.substring(0, 1) === "_" || t.substring(0, 2) === "is" || mr(t))
1168
+ if (t.substring(0, 1) === "_" || t.substring(0, 2) === "is" || fr(t))
1153
1169
  continue;
1154
1170
  const s = typeof i[t], n = i[t];
1155
1171
  switch (s) {
@@ -1163,7 +1179,7 @@ function rt(i) {
1163
1179
  src: ii.renderToBlob(n),
1164
1180
  offset: [n.offset.x, n.offset.y],
1165
1181
  repeat: [n.repeat.x, n.repeat.y]
1166
- } : t === "uniforms" && (e[t] = pr(e[t]))) : t === "glslVersion" ? e[t] = "" : e[t] = {
1182
+ } : t === "uniforms" && (e[t] = mr(e[t]))) : t === "glslVersion" ? e[t] = "" : e[t] = {
1167
1183
  src: "",
1168
1184
  offset: [0, 0],
1169
1185
  repeat: [1, 1]
@@ -1200,8 +1216,8 @@ function Ci(i) {
1200
1216
  const s = i;
1201
1217
  if (Array.isArray(s.material)) {
1202
1218
  const n = [];
1203
- s.material.forEach((a) => {
1204
- n.push(rt(a));
1219
+ s.material.forEach((r) => {
1220
+ n.push(rt(r));
1205
1221
  }), e.material = n;
1206
1222
  } else
1207
1223
  e.material = rt(s.material);
@@ -1209,8 +1225,8 @@ function Ci(i) {
1209
1225
  const s = i;
1210
1226
  if (Array.isArray(s.material)) {
1211
1227
  const n = [];
1212
- s.material.forEach((a) => {
1213
- n.push(rt(a));
1228
+ s.material.forEach((r) => {
1229
+ n.push(rt(r));
1214
1230
  }), e.material = n;
1215
1231
  } else
1216
1232
  e.material = rt(s.material);
@@ -1218,8 +1234,8 @@ function Ci(i) {
1218
1234
  const s = i;
1219
1235
  if (Array.isArray(s.material)) {
1220
1236
  const n = [];
1221
- s.material.forEach((a) => {
1222
- n.push(rt(a));
1237
+ s.material.forEach((r) => {
1238
+ n.push(rt(r));
1223
1239
  }), e.material = n;
1224
1240
  } else
1225
1241
  e.material = rt(s.material);
@@ -1254,7 +1270,7 @@ function Ci(i) {
1254
1270
  });
1255
1271
  return e;
1256
1272
  }
1257
- function fr(i, e) {
1273
+ function gr(i, e) {
1258
1274
  const t = e.split(".");
1259
1275
  switch (t.length) {
1260
1276
  case 1:
@@ -1271,7 +1287,7 @@ function fr(i, e) {
1271
1287
  return i[t[0]][t[1]][t[2]][t[3]][t[4]][t[5]];
1272
1288
  }
1273
1289
  }
1274
- function gr(i, e) {
1290
+ function _r(i, e) {
1275
1291
  for (const t in e)
1276
1292
  i[t] = e[t];
1277
1293
  }
@@ -1298,25 +1314,25 @@ function se(i, e, t) {
1298
1314
  break;
1299
1315
  }
1300
1316
  else {
1301
- let r;
1317
+ let a;
1302
1318
  switch (n) {
1303
1319
  case 1:
1304
- r = i[s[0]];
1320
+ a = i[s[0]];
1305
1321
  break;
1306
1322
  case 2:
1307
- r = i[s[0]][s[1]];
1323
+ a = i[s[0]][s[1]];
1308
1324
  break;
1309
1325
  case 3:
1310
- r = i[s[0]][s[1]][s[2]];
1326
+ a = i[s[0]][s[1]][s[2]];
1311
1327
  break;
1312
1328
  case 4:
1313
- r = i[s[0]][s[1]][s[2]][s[3]];
1329
+ a = i[s[0]][s[1]][s[2]][s[3]];
1314
1330
  break;
1315
1331
  case 5:
1316
- r = i[s[0]][s[1]][s[2]][s[3]][s[4]];
1332
+ a = i[s[0]][s[1]][s[2]][s[3]][s[4]];
1317
1333
  break;
1318
1334
  }
1319
- r != null && gr(r, t);
1335
+ a != null && _r(a, t);
1320
1336
  }
1321
1337
  }
1322
1338
  function En(i) {
@@ -1328,7 +1344,7 @@ function En(i) {
1328
1344
  }, s.onerror = t, s.src = i;
1329
1345
  });
1330
1346
  }
1331
- class sl extends $i {
1347
+ class nl extends $i {
1332
1348
  canvas = null;
1333
1349
  // Canvas or OffscreenCanvas
1334
1350
  inputElement = null;
@@ -1572,8 +1588,8 @@ class sl extends $i {
1572
1588
  break;
1573
1589
  }
1574
1590
  if (s.event === "updateGroup") {
1575
- const a = JSON.parse(s.data);
1576
- n.groups.get(a.group)?.onUpdate(a.prop, a.value);
1591
+ const r = JSON.parse(s.data);
1592
+ n.groups.get(r.group)?.onUpdate(r.prop, r.value);
1577
1593
  }
1578
1594
  }
1579
1595
  handleEditor(e, t, s) {
@@ -1619,8 +1635,8 @@ class sl extends $i {
1619
1635
  }
1620
1636
  resize(e, t) {
1621
1637
  const s = this.dpr;
1622
- this.renderTargets.forEach((a) => {
1623
- a.setSize(e * s, t * s);
1638
+ this.renderTargets.forEach((r) => {
1639
+ r.setSize(e * s, t * s);
1624
1640
  });
1625
1641
  const n = !(this.renderer?.domElement instanceof OffscreenCanvas);
1626
1642
  this.renderer?.setSize(e, t, n);
@@ -1649,22 +1665,22 @@ var zi = { exports: {} }, Ct = {};
1649
1665
  * LICENSE file in the root directory of this source tree.
1650
1666
  */
1651
1667
  var Cs;
1652
- function _r() {
1668
+ function vr() {
1653
1669
  if (Cs)
1654
1670
  return Ct;
1655
1671
  Cs = 1;
1656
- var i = vn, e = Symbol.for("react.element"), t = Symbol.for("react.fragment"), s = Object.prototype.hasOwnProperty, n = i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, a = { key: !0, ref: !0, __self: !0, __source: !0 };
1657
- function r(o, c, l) {
1672
+ var i = vn, e = Symbol.for("react.element"), t = Symbol.for("react.fragment"), s = Object.prototype.hasOwnProperty, n = i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, r = { key: !0, ref: !0, __self: !0, __source: !0 };
1673
+ function a(o, c, l) {
1658
1674
  var d, p = {}, m = null, f = null;
1659
1675
  l !== void 0 && (m = "" + l), c.key !== void 0 && (m = "" + c.key), c.ref !== void 0 && (f = c.ref);
1660
1676
  for (d in c)
1661
- s.call(c, d) && !a.hasOwnProperty(d) && (p[d] = c[d]);
1677
+ s.call(c, d) && !r.hasOwnProperty(d) && (p[d] = c[d]);
1662
1678
  if (o && o.defaultProps)
1663
1679
  for (d in c = o.defaultProps, c)
1664
1680
  p[d] === void 0 && (p[d] = c[d]);
1665
1681
  return { $$typeof: e, type: o, key: m, ref: f, props: p, _owner: n.current };
1666
1682
  }
1667
- return Ct.Fragment = t, Ct.jsx = r, Ct.jsxs = r, Ct;
1683
+ return Ct.Fragment = t, Ct.jsx = a, Ct.jsxs = a, Ct;
1668
1684
  }
1669
1685
  var wt = {};
1670
1686
  /**
@@ -1677,9 +1693,9 @@ var wt = {};
1677
1693
  * LICENSE file in the root directory of this source tree.
1678
1694
  */
1679
1695
  var ws;
1680
- function vr() {
1696
+ function yr() {
1681
1697
  return ws || (ws = 1, process.env.NODE_ENV !== "production" && function() {
1682
- var i = vn, e = Symbol.for("react.element"), t = Symbol.for("react.portal"), s = Symbol.for("react.fragment"), n = Symbol.for("react.strict_mode"), a = Symbol.for("react.profiler"), r = Symbol.for("react.provider"), o = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), l = Symbol.for("react.suspense"), d = Symbol.for("react.suspense_list"), p = Symbol.for("react.memo"), m = Symbol.for("react.lazy"), f = Symbol.for("react.offscreen"), E = Symbol.iterator, v = "@@iterator";
1698
+ var i = vn, e = Symbol.for("react.element"), t = Symbol.for("react.portal"), s = Symbol.for("react.fragment"), n = Symbol.for("react.strict_mode"), r = Symbol.for("react.profiler"), a = Symbol.for("react.provider"), o = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), l = Symbol.for("react.suspense"), d = Symbol.for("react.suspense_list"), p = Symbol.for("react.memo"), m = Symbol.for("react.lazy"), f = Symbol.for("react.offscreen"), E = Symbol.iterator, v = "@@iterator";
1683
1699
  function x(h) {
1684
1700
  if (h === null || typeof h != "object")
1685
1701
  return null;
@@ -1707,7 +1723,7 @@ function vr() {
1707
1723
  var w = !1, S = !1, O = !1, I = !1, U = !1, R;
1708
1724
  R = Symbol.for("react.module.reference");
1709
1725
  function V(h) {
1710
- return !!(typeof h == "string" || typeof h == "function" || h === s || h === a || U || h === n || h === l || h === d || I || h === f || w || S || O || typeof h == "object" && h !== null && (h.$$typeof === m || h.$$typeof === p || h.$$typeof === r || h.$$typeof === o || h.$$typeof === c || // This needs to include all possible module reference object
1726
+ return !!(typeof h == "string" || typeof h == "function" || h === s || h === r || U || h === n || h === l || h === d || I || h === f || w || S || O || typeof h == "object" && h !== null && (h.$$typeof === m || h.$$typeof === p || h.$$typeof === a || h.$$typeof === o || h.$$typeof === c || // This needs to include all possible module reference object
1711
1727
  // types supported by any Flight configuration anywhere since
1712
1728
  // we don't know which Flight build this will end up being used
1713
1729
  // with.
@@ -1735,7 +1751,7 @@ function vr() {
1735
1751
  return "Fragment";
1736
1752
  case t:
1737
1753
  return "Portal";
1738
- case a:
1754
+ case r:
1739
1755
  return "Profiler";
1740
1756
  case n:
1741
1757
  return "StrictMode";
@@ -1749,7 +1765,7 @@ function vr() {
1749
1765
  case o:
1750
1766
  var b = h;
1751
1767
  return _e(b) + ".Consumer";
1752
- case r:
1768
+ case a:
1753
1769
  var T = h;
1754
1770
  return _e(T._context) + ".Provider";
1755
1771
  case c:
@@ -2263,16 +2279,16 @@ Check the top-level render call using <` + T + ">.");
2263
2279
  wt.Fragment = s, wt.jsx = qn, wt.jsxs = Kn;
2264
2280
  }()), wt;
2265
2281
  }
2266
- process.env.NODE_ENV === "production" ? zi.exports = _r() : zi.exports = vr();
2282
+ process.env.NODE_ENV === "production" ? zi.exports = vr() : zi.exports = yr();
2267
2283
  var u = zi.exports;
2268
2284
  function Cn(i) {
2269
2285
  return i.title.search("<") > -1 ? /* @__PURE__ */ u.jsx("button", { className: "svg", dangerouslySetInnerHTML: { __html: i.title } }) : /* @__PURE__ */ u.jsx("button", { children: i.title });
2270
2286
  }
2271
- const yr = /* @__PURE__ */ u.jsxs("svg", { className: "closeIcon", width: "14", height: "14", fill: "none", stroke: "#666666", strokeMiterlimit: "10", children: [
2287
+ const br = /* @__PURE__ */ u.jsxs("svg", { className: "closeIcon", width: "14", height: "14", fill: "none", stroke: "#666666", strokeMiterlimit: "10", children: [
2272
2288
  /* @__PURE__ */ u.jsx("circle", { cx: "7", cy: "7", r: "6" }),
2273
2289
  /* @__PURE__ */ u.jsx("line", { x1: "4", y1: "4", x2: "10", y2: "10" }),
2274
2290
  /* @__PURE__ */ u.jsx("line", { x1: "4", y1: "10", x2: "10", y2: "4" })
2275
- ] }), br = /* @__PURE__ */ u.jsx("svg", { className: "dragIcon", width: "14", height: "14", fill: "#666666", stroke: "none", children: /* @__PURE__ */ u.jsx(
2291
+ ] }), Er = /* @__PURE__ */ u.jsx("svg", { className: "dragIcon", width: "14", height: "14", fill: "#666666", stroke: "none", children: /* @__PURE__ */ u.jsx(
2276
2292
  "path",
2277
2293
  {
2278
2294
  d: `M10.43,4H3.57C3.26,4,3,4.22,3,4.5v1C3,5.78,3.26,6,3.57,6h6.86C10.74,6,11,5.78,11,5.5v-1\r
@@ -2280,7 +2296,7 @@ C11,4.22,10.74,4,10.43,4z M10.43,8H3.57C3.26,8,3,8.22,3,8.5v1C3,9.78,3.26,10,3.5
2280
2296
  C11,8.22,10.74,8,10.43,8z`
2281
2297
  }
2282
2298
  ) });
2283
- function Er(i) {
2299
+ function Cr(i) {
2284
2300
  return /* @__PURE__ */ u.jsx(
2285
2301
  "li",
2286
2302
  {
@@ -2292,38 +2308,38 @@ function Er(i) {
2292
2308
  },
2293
2309
  onDragEnd: i.onDragEnd,
2294
2310
  children: /* @__PURE__ */ u.jsxs("div", { children: [
2295
- br,
2311
+ Er,
2296
2312
  /* @__PURE__ */ u.jsx("span", { children: i.title }),
2297
- /* @__PURE__ */ u.jsx("button", { className: "closeIcon", onClick: () => i.onDelete(i.index), children: yr })
2313
+ /* @__PURE__ */ u.jsx("button", { className: "closeIcon", onClick: () => i.onDelete(i.index), children: br })
2298
2314
  ] })
2299
2315
  }
2300
2316
  );
2301
2317
  }
2302
2318
  function wn(i) {
2303
- const [e, t] = B(!1), [s, n] = B(i.options), [a, r] = B(null), o = (f) => {
2319
+ const [e, t] = B(!1), [s, n] = B(i.options), [r, a] = B(null), o = (f) => {
2304
2320
  i.onDragComplete(f), n(f);
2305
2321
  }, c = (f) => {
2306
2322
  const E = [...s];
2307
2323
  E.splice(f, 1), o(E);
2308
2324
  }, l = (f) => {
2309
- r(f);
2325
+ a(f);
2310
2326
  }, d = (f) => {
2311
- if (a === f || a === null)
2327
+ if (r === f || r === null)
2312
2328
  return;
2313
- const E = [...s], v = E.splice(a, 1)[0];
2314
- E.splice(f, 0, v), r(f), n(E);
2329
+ const E = [...s], v = E.splice(r, 1)[0];
2330
+ E.splice(f, 0, v), a(f), n(E);
2315
2331
  }, p = () => {
2316
- i.onDragComplete(s), r(null);
2332
+ i.onDragComplete(s), a(null);
2317
2333
  };
2318
2334
  let m = "dropdown draggable";
2319
2335
  return i.subdropdown && (m += " subdropdown"), /* @__PURE__ */ u.jsxs("div", { className: m, onMouseEnter: () => t(!0), onMouseLeave: () => t(!1), children: [
2320
2336
  /* @__PURE__ */ u.jsx(Cn, { title: i.title }),
2321
2337
  /* @__PURE__ */ u.jsx("ul", { className: "reorder-list", style: { display: e ? "block" : "none" }, children: s.map((f, E) => /* @__PURE__ */ u.jsx(
2322
- Er,
2338
+ Cr,
2323
2339
  {
2324
2340
  title: f,
2325
2341
  index: E,
2326
- draggingIndex: a,
2342
+ draggingIndex: r,
2327
2343
  onDelete: c,
2328
2344
  onDragStart: l,
2329
2345
  onDragOver: d,
@@ -2335,8 +2351,8 @@ function wn(i) {
2335
2351
  }
2336
2352
  function Sn(i) {
2337
2353
  const [e, t] = B(!1), s = [];
2338
- i.options.map((a, r) => {
2339
- i.onSelect !== void 0 && (a.onSelect = i.onSelect), s.push(/* @__PURE__ */ u.jsx(Cr, { option: a }, r));
2354
+ i.options.map((r, a) => {
2355
+ i.onSelect !== void 0 && (r.onSelect = i.onSelect), s.push(/* @__PURE__ */ u.jsx(wr, { option: r }, a));
2340
2356
  });
2341
2357
  let n = "dropdown";
2342
2358
  return i.subdropdown && (n += " subdropdown"), /* @__PURE__ */ u.jsxs(
@@ -2358,7 +2374,7 @@ function Sn(i) {
2358
2374
  }
2359
2375
  );
2360
2376
  }
2361
- function Cr(i) {
2377
+ function wr(i) {
2362
2378
  const { option: e } = i, [t, s] = B("");
2363
2379
  let n;
2364
2380
  switch (e.type) {
@@ -2368,8 +2384,8 @@ function Cr(i) {
2368
2384
  {
2369
2385
  title: e.title,
2370
2386
  options: e.value,
2371
- onDragComplete: (a) => {
2372
- e.onDragComplete !== void 0 && e.onDragComplete(a);
2387
+ onDragComplete: (r) => {
2388
+ e.onDragComplete !== void 0 && e.onDragComplete(r);
2373
2389
  },
2374
2390
  subdropdown: !0
2375
2391
  }
@@ -2400,27 +2416,27 @@ function Cr(i) {
2400
2416
  }
2401
2417
  return /* @__PURE__ */ u.jsx("li", { className: t === e.title ? "selected" : "", children: n }, Ba());
2402
2418
  }
2403
- function nl(i, e, t) {
2404
- function s(a) {
2405
- switch (e.forEach((r) => {
2406
- r.callback(i, r.remote, a);
2407
- }), a.event) {
2419
+ function al(i, e, t) {
2420
+ function s(r) {
2421
+ switch (e.forEach((a) => {
2422
+ a.callback(i, a.remote, r);
2423
+ }), r.event) {
2408
2424
  case "custom":
2409
- D.dispatchEvent({ type: A.CUSTOM, value: a.data });
2425
+ D.dispatchEvent({ type: A.CUSTOM, value: r.data });
2410
2426
  break;
2411
2427
  }
2412
2428
  }
2413
- function n(a) {
2414
- switch (t.forEach((r) => {
2415
- r.callback(i, r.remote, a);
2416
- }), a.event) {
2429
+ function n(r) {
2430
+ switch (t.forEach((a) => {
2431
+ a.callback(i, a.remote, r);
2432
+ }), r.event) {
2417
2433
  case "custom":
2418
- D.dispatchEvent({ type: A.CUSTOM, value: a.data });
2434
+ D.dispatchEvent({ type: A.CUSTOM, value: r.data });
2419
2435
  break;
2420
2436
  }
2421
2437
  }
2422
- i.listen = (a) => {
2423
- a.target === "editor" ? n(a) : s(a);
2438
+ i.listen = (r) => {
2439
+ r.target === "editor" ? n(r) : s(r);
2424
2440
  };
2425
2441
  }
2426
2442
  function li(i) {
@@ -2433,8 +2449,8 @@ function li(i) {
2433
2449
  {
2434
2450
  className: "toggle",
2435
2451
  onClick: () => {
2436
- const a = !e;
2437
- i.onToggle !== void 0 && i.onToggle(a), t(a);
2452
+ const r = !e;
2453
+ i.onToggle !== void 0 && i.onToggle(r), t(r);
2438
2454
  },
2439
2455
  children: [
2440
2456
  /* @__PURE__ */ u.jsx(
@@ -2457,14 +2473,14 @@ function li(i) {
2457
2473
  ] });
2458
2474
  }
2459
2475
  function xn(i) {
2460
- const e = J(null), [t, s] = B(!1), n = i.child !== void 0 && i.child.children.length > 0, a = [];
2461
- return i.child !== void 0 && i.child.children.length > 0 && i.child.children.map((r, o) => {
2462
- a.push(/* @__PURE__ */ u.jsx(xn, { child: r, three: i.three }, o));
2476
+ const e = J(null), [t, s] = B(!1), n = i.child !== void 0 && i.child.children.length > 0, r = [];
2477
+ return i.child !== void 0 && i.child.children.length > 0 && i.child.children.map((a, o) => {
2478
+ r.push(/* @__PURE__ */ u.jsx(xn, { child: a, three: i.three }, o));
2463
2479
  }), tt(() => {
2464
2480
  if (i.child) {
2465
- const r = i.three.getScene(i.child.uuid);
2466
- if (r !== null) {
2467
- const o = r.getObjectByProperty("uuid", i.child.uuid);
2481
+ const a = i.three.getScene(i.child.uuid);
2482
+ if (a !== null) {
2483
+ const o = a.getObjectByProperty("uuid", i.child.uuid);
2468
2484
  o !== void 0 && (e.current.style.opacity = o.visible ? "1" : "0.25");
2469
2485
  }
2470
2486
  }
@@ -2502,9 +2518,9 @@ function xn(i) {
2502
2518
  ref: e,
2503
2519
  onClick: () => {
2504
2520
  if (i.child) {
2505
- const r = i.three.getScene(i.child.uuid);
2506
- if (r !== null) {
2507
- const o = r.getObjectByProperty("uuid", i.child.uuid);
2521
+ const a = i.three.getScene(i.child.uuid);
2522
+ if (a !== null) {
2523
+ const o = a.getObjectByProperty("uuid", i.child.uuid);
2508
2524
  if (o !== void 0) {
2509
2525
  const c = "visible", l = !o.visible;
2510
2526
  e.current.style.opacity = l ? "1" : "0.25", i.three.updateObject(i.child.uuid, c, l), se(o, c, l);
@@ -2514,9 +2530,9 @@ function xn(i) {
2514
2530
  }
2515
2531
  }
2516
2532
  ),
2517
- /* @__PURE__ */ u.jsx("div", { className: `icon ${ur(i.child)}` })
2533
+ /* @__PURE__ */ u.jsx("div", { className: `icon ${pr(i.child)}` })
2518
2534
  ] }),
2519
- /* @__PURE__ */ u.jsx("div", { className: t ? "open" : "", children: /* @__PURE__ */ u.jsx("div", { className: "container", children: a }) })
2535
+ /* @__PURE__ */ u.jsx("div", { className: t ? "open" : "", children: /* @__PURE__ */ u.jsx("div", { className: "container", children: r }) })
2520
2536
  ] }, Math.random()) });
2521
2537
  }
2522
2538
  function Ss(i) {
@@ -2528,16 +2544,16 @@ function Ss(i) {
2528
2544
  function Rt(i) {
2529
2545
  const [e, t] = B(i.defaultValue);
2530
2546
  return tt(() => {
2531
- let s = !1, n = -1, a = 0, r = i.defaultValue, o = !1;
2547
+ let s = !1, n = -1, r = 0, a = i.defaultValue, o = !1;
2532
2548
  const c = (f) => {
2533
2549
  o = f.ctrlKey;
2534
2550
  }, l = (f) => {
2535
- s = !0, a = Number(i.input.current?.value), n = f.clientX, document.addEventListener("mouseup", p, !1), document.addEventListener("mousemove", d, !1), document.addEventListener("contextmenu", p, !1);
2551
+ s = !0, r = Number(i.input.current?.value), n = f.clientX, document.addEventListener("mouseup", p, !1), document.addEventListener("mousemove", d, !1), document.addEventListener("contextmenu", p, !1);
2536
2552
  }, d = (f) => {
2537
2553
  if (!s)
2538
2554
  return;
2539
2555
  const E = i.step !== void 0 ? i.step : 1, v = (f.clientX - n) * E * (o ? 10 : 1);
2540
- r = Number((a + v).toFixed(4)), i.min !== void 0 && (r = Math.max(r, i.min)), i.max !== void 0 && (r = Math.min(r, i.max)), i.onChange !== void 0 && i.onChange(r), t(r);
2556
+ a = Number((r + v).toFixed(4)), i.min !== void 0 && (a = Math.max(a, i.min)), i.max !== void 0 && (a = Math.min(a, i.max)), i.onChange !== void 0 && i.onChange(a), t(a);
2541
2557
  }, p = () => {
2542
2558
  s = !1, document.removeEventListener("mouseup", p), document.removeEventListener("mousemove", d), document.removeEventListener("contextmenu", p);
2543
2559
  }, m = (f) => {
@@ -2559,8 +2575,8 @@ function Qe(i) {
2559
2575
  min: i.min,
2560
2576
  max: i.max,
2561
2577
  step: i.step,
2562
- onChange: (a) => {
2563
- n(a), i.onChange !== void 0 && i.onChange(i.prop, a);
2578
+ onChange: (r) => {
2579
+ n(r), i.onChange !== void 0 && i.onChange(i.prop, r);
2564
2580
  }
2565
2581
  }), /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
2566
2582
  i.type === "number" && /* @__PURE__ */ u.jsx(
@@ -2575,11 +2591,11 @@ function Qe(i) {
2575
2591
  max: i.max,
2576
2592
  step: i.step,
2577
2593
  disabled: i.disabled,
2578
- onChange: (a) => {
2579
- if (n(a.target.value), a.target.value.length === 0)
2594
+ onChange: (r) => {
2595
+ if (n(r.target.value), r.target.value.length === 0)
2580
2596
  return;
2581
- const r = Number(a.target.value);
2582
- isNaN(r) || i.onChange !== void 0 && i.onChange(i.prop, r);
2597
+ const a = Number(r.target.value);
2598
+ isNaN(a) || i.onChange !== void 0 && i.onChange(i.prop, a);
2583
2599
  }
2584
2600
  }
2585
2601
  ),
@@ -2592,11 +2608,11 @@ function Qe(i) {
2592
2608
  disabled: i.disabled,
2593
2609
  ref: e,
2594
2610
  className: "min",
2595
- onChange: (a) => {
2596
- if (a.target.value.length === 0)
2611
+ onChange: (r) => {
2612
+ if (r.target.value.length === 0)
2597
2613
  return;
2598
- const r = Number(a.target.value);
2599
- isNaN(r) || i.onChange !== void 0 && i.onChange(i.prop, r);
2614
+ const a = Number(r.target.value);
2615
+ isNaN(a) || i.onChange !== void 0 && i.onChange(i.prop, a);
2600
2616
  }
2601
2617
  }
2602
2618
  ),
@@ -2616,8 +2632,8 @@ function Qe(i) {
2616
2632
  ] })
2617
2633
  ] });
2618
2634
  }
2619
- function wr(i) {
2620
- const e = J(null), t = J(null), s = J(null), n = J(null), a = J(null), r = J(null), o = J(null), c = J(null), l = J(null), d = J(null), [p, m] = B(i.value.x), [f, E] = B(i.value.y), [v, x] = B({
2635
+ function Sr(i) {
2636
+ const e = J(null), t = J(null), s = J(null), n = J(null), r = J(null), a = J(null), o = J(null), c = J(null), l = J(null), d = J(null), [p, m] = B(i.value.x), [f, E] = B(i.value.y), [v, x] = B({
2621
2637
  min: Math.min(i.min, Math.min(i.value.x, i.value.y)),
2622
2638
  max: Math.max(i.max, Math.max(i.value.x, i.value.y))
2623
2639
  }), [g, y] = B(!1);
@@ -2669,7 +2685,7 @@ function wr(i) {
2669
2685
  window.removeEventListener("mousemove", S), window.removeEventListener("mouseup", w), y(!1);
2670
2686
  }
2671
2687
  function S(R) {
2672
- const V = a.current.getBoundingClientRect(), we = $e(0, 99, R.clientX - V.left) / 99, _e = 1 - $e(0, 99, R.clientY - V.top) / 99, re = Pe(Nt(v.min, v.max, we), 3), K = Pe(Nt(v.min, v.max, _e), 3);
2688
+ const V = r.current.getBoundingClientRect(), we = $e(0, 99, R.clientX - V.left) / 99, _e = 1 - $e(0, 99, R.clientY - V.top) / 99, re = Pe(Nt(v.min, v.max, we), 3), K = Pe(Nt(v.min, v.max, _e), 3);
2673
2689
  i.onChange({ target: { value: { x: re, y: K } } }), m(re), E(K);
2674
2690
  }
2675
2691
  function O() {
@@ -2681,7 +2697,7 @@ function wr(i) {
2681
2697
  x({ min: v.min, max: R }), p > R && m($e(v.min, R, p)), f > R && E($e(v.min, R, f));
2682
2698
  }
2683
2699
  tt(() => {
2684
- r.current.style.left = `${ji(v.min, v.max, p) * 100}%`, r.current.style.top = `${(1 - ji(v.min, v.max, f)) * 100}%`;
2700
+ a.current.style.left = `${ji(v.min, v.max, p) * 100}%`, a.current.style.top = `${(1 - ji(v.min, v.max, f)) * 100}%`;
2685
2701
  }, [v, p, f]);
2686
2702
  const U = i.step !== void 0 ? i.step : 0.01;
2687
2703
  return /* @__PURE__ */ u.jsxs("div", { className: "vector2", children: [
@@ -2753,14 +2769,14 @@ function wr(i) {
2753
2769
  )
2754
2770
  ] })
2755
2771
  ] }),
2756
- /* @__PURE__ */ u.jsxs("div", { className: "input", ref: a, onMouseDown: C, onMouseUp: w, children: [
2772
+ /* @__PURE__ */ u.jsxs("div", { className: "input", ref: r, onMouseDown: C, onMouseUp: w, children: [
2757
2773
  /* @__PURE__ */ u.jsx("div", { className: "x" }),
2758
2774
  /* @__PURE__ */ u.jsx("div", { className: "y" }),
2759
- /* @__PURE__ */ u.jsx("div", { className: "pt", ref: r })
2775
+ /* @__PURE__ */ u.jsx("div", { className: "pt", ref: a })
2760
2776
  ] })
2761
2777
  ] });
2762
2778
  }
2763
- const Sr = Math.PI / 180, xr = 180 / Math.PI;
2779
+ const xr = Math.PI / 180, Or = 180 / Math.PI;
2764
2780
  function ot(i, e, t, s, n) {
2765
2781
  return s + (i - e) * (n - s) / (t - e);
2766
2782
  }
@@ -2768,30 +2784,30 @@ function lt(i, e, t) {
2768
2784
  return (1 - t) * i + t * e;
2769
2785
  }
2770
2786
  function Hi(i) {
2771
- return i * Sr;
2772
- }
2773
- function Or(i) {
2774
2787
  return i * xr;
2775
2788
  }
2789
+ function Tr(i) {
2790
+ return i * Or;
2791
+ }
2776
2792
  function xs(i) {
2777
- const e = i.value.x !== void 0 && i.value.y !== void 0 && i.value.z !== void 0, t = i.value.isEuler !== void 0, s = i.value.elements !== void 0, n = i.step !== void 0 ? i.step : 0.01, a = [];
2793
+ const e = i.value.x !== void 0 && i.value.y !== void 0 && i.value.z !== void 0, t = i.value.isEuler !== void 0, s = i.value.elements !== void 0, n = i.step !== void 0 ? i.step : 0.01, r = [];
2778
2794
  if (t) {
2779
- const r = Ut(() => i.value, []);
2795
+ const a = Ut(() => i.value, []);
2780
2796
  ["_x", "_y", "_z"].forEach((c) => {
2781
2797
  const l = J(null);
2782
- a.push(
2798
+ r.push(
2783
2799
  /* @__PURE__ */ u.jsxs("div", { children: [
2784
2800
  /* @__PURE__ */ u.jsx("label", { ref: l, children: c.substring(1).toUpperCase() }),
2785
2801
  /* @__PURE__ */ u.jsx(
2786
2802
  Qe,
2787
2803
  {
2788
- value: Or(r[c]),
2804
+ value: Tr(a[c]),
2789
2805
  type: "number",
2790
2806
  prop: c,
2791
2807
  step: 0.1,
2792
2808
  labelRef: l,
2793
2809
  onChange: (d, p) => {
2794
- r[d] = Hi(p), i.onChange({ target: { value: r } });
2810
+ a[d] = Hi(p), i.onChange({ target: { value: a } });
2795
2811
  }
2796
2812
  }
2797
2813
  )
@@ -2799,18 +2815,18 @@ function xs(i) {
2799
2815
  );
2800
2816
  });
2801
2817
  } else if (e) {
2802
- const r = Ut(() => i.value, []), o = (l, d) => {
2803
- r[l] = d, i.onChange({ target: { value: r } });
2818
+ const a = Ut(() => i.value, []), o = (l, d) => {
2819
+ a[l] = d, i.onChange({ target: { value: a } });
2804
2820
  };
2805
2821
  ["x", "y", "z"].forEach((l) => {
2806
2822
  const d = J(null);
2807
- a.push(
2823
+ r.push(
2808
2824
  /* @__PURE__ */ u.jsxs("div", { children: [
2809
2825
  /* @__PURE__ */ u.jsx("label", { ref: d, children: l.toUpperCase() }),
2810
2826
  /* @__PURE__ */ u.jsx(
2811
2827
  Qe,
2812
2828
  {
2813
- value: r[l],
2829
+ value: a[l],
2814
2830
  type: "number",
2815
2831
  prop: l,
2816
2832
  step: n,
@@ -2822,19 +2838,19 @@ function xs(i) {
2822
2838
  );
2823
2839
  });
2824
2840
  } else if (s) {
2825
- const r = Ut(() => i.value, []), o = (c, l) => {
2841
+ const a = Ut(() => i.value, []), o = (c, l) => {
2826
2842
  const d = Number(c);
2827
- r.elements[d] = l, i.onChange({ target: { value: r } });
2843
+ a.elements[d] = l, i.onChange({ target: { value: a } });
2828
2844
  };
2829
2845
  for (let c = 0; c < 9; c++) {
2830
2846
  const l = J(null);
2831
- a.push(
2847
+ r.push(
2832
2848
  /* @__PURE__ */ u.jsxs("div", { children: [
2833
2849
  /* @__PURE__ */ u.jsx("label", { ref: l, children: c + 1 }),
2834
2850
  /* @__PURE__ */ u.jsx(
2835
2851
  Qe,
2836
2852
  {
2837
- value: r.elements[c],
2853
+ value: a.elements[c],
2838
2854
  type: "number",
2839
2855
  prop: c.toString(),
2840
2856
  step: n,
@@ -2846,12 +2862,12 @@ function xs(i) {
2846
2862
  );
2847
2863
  }
2848
2864
  }
2849
- return /* @__PURE__ */ u.jsx("div", { className: "grid3", children: a }, Math.random().toString());
2865
+ return /* @__PURE__ */ u.jsx("div", { className: "grid3", children: r }, Math.random().toString());
2850
2866
  }
2851
- function Tr(i) {
2867
+ function Mr(i) {
2852
2868
  const e = i.value.x !== void 0, t = i.step !== void 0 ? i.step : 0.01, s = [];
2853
2869
  if (e) {
2854
- const n = Ut(() => i.value, []), a = (o, c) => {
2870
+ const n = Ut(() => i.value, []), r = (o, c) => {
2855
2871
  n[o] = c, i.onChange({ target: { value: n } });
2856
2872
  };
2857
2873
  ["x", "y", "z", "w"].forEach((o) => {
@@ -2867,43 +2883,43 @@ function Tr(i) {
2867
2883
  prop: o,
2868
2884
  step: t,
2869
2885
  labelRef: c,
2870
- onChange: a
2886
+ onChange: r
2871
2887
  }
2872
2888
  )
2873
2889
  ] }, o)
2874
2890
  );
2875
2891
  });
2876
2892
  } else {
2877
- const n = Ut(() => i.value, []), a = (r, o) => {
2878
- const c = Number(r);
2893
+ const n = Ut(() => i.value, []), r = (a, o) => {
2894
+ const c = Number(a);
2879
2895
  n.elements[c] = o, i.onChange({ target: { value: n } });
2880
2896
  };
2881
- for (let r = 0; r < 16; r++) {
2897
+ for (let a = 0; a < 16; a++) {
2882
2898
  const o = J(null);
2883
2899
  s.push(
2884
2900
  /* @__PURE__ */ u.jsxs("div", { children: [
2885
- /* @__PURE__ */ u.jsx("label", { ref: o, children: r + 1 }),
2901
+ /* @__PURE__ */ u.jsx("label", { ref: o, children: a + 1 }),
2886
2902
  /* @__PURE__ */ u.jsx(
2887
2903
  Qe,
2888
2904
  {
2889
- value: n.elements[r],
2905
+ value: n.elements[a],
2890
2906
  type: "number",
2891
- prop: r.toString(),
2907
+ prop: a.toString(),
2892
2908
  step: t,
2893
2909
  labelRef: o,
2894
- onChange: a
2910
+ onChange: r
2895
2911
  }
2896
2912
  )
2897
- ] }, r.toString())
2913
+ ] }, a.toString())
2898
2914
  );
2899
2915
  }
2900
2916
  }
2901
2917
  return /* @__PURE__ */ u.jsx("div", { className: "grid4", children: s });
2902
2918
  }
2903
- function Mr(i) {
2919
+ function Pr(i) {
2904
2920
  return !(i === "defaultAttributeValues" || i === "forceSinglePass" || i === "linecap" || i === "linejoin" || i === "linewidth" || i === "normalMapType" || i === "precision" || i === "shadowSide" || i === "uniformsGroups" || i === "uniformsNeedUpdate" || i === "userData" || i === "version" || i === "wireframeLinecap" || i === "wireframeLinejoin" || i === "wireframeLinewidth" || i.slice(0, 4) === "clip" || i.slice(0, 7) === "polygon" || i.slice(0, 7) === "stencil" || i.slice(0, 2) === "is");
2905
2921
  }
2906
- function Pr(i) {
2922
+ function Ar(i) {
2907
2923
  switch (i) {
2908
2924
  case "Alpha Map":
2909
2925
  return "alphaMap";
@@ -3159,7 +3175,7 @@ function On(i) {
3159
3175
  const e = i.toLowerCase();
3160
3176
  return e.search("intensity") > -1 || e === "anisotropyrotation" || e === "blendalpha" || e === "bumpscale" || e === "clearcoatroughness" || e === "displacementbias" || e === "displacementscale" || e === "metalness" || e === "opacity" || e === "reflectivity" || e === "refractionratio" || e === "roughness" || e === "sheenroughness";
3161
3177
  }
3162
- function Ar() {
3178
+ function Dr() {
3163
3179
  const i = document.createElement("input");
3164
3180
  return i.type = "file", new Promise((e, t) => {
3165
3181
  i.addEventListener("change", function() {
@@ -3167,14 +3183,14 @@ function Ar() {
3167
3183
  t();
3168
3184
  else {
3169
3185
  const s = i.files[0], n = new FileReader();
3170
- n.onload = function(a) {
3171
- e(a.target.result);
3186
+ n.onload = function(r) {
3187
+ e(r.target.result);
3172
3188
  }, n.readAsDataURL(s);
3173
3189
  }
3174
3190
  }), i.click();
3175
3191
  });
3176
3192
  }
3177
- const Dr = [
3193
+ const Rr = [
3178
3194
  {
3179
3195
  title: "Front",
3180
3196
  value: ia
@@ -3187,7 +3203,7 @@ const Dr = [
3187
3203
  title: "Double",
3188
3204
  value: Wi
3189
3205
  }
3190
- ], Rr = [
3206
+ ], Ir = [
3191
3207
  {
3192
3208
  title: "No Blending",
3193
3209
  value: sa
@@ -3212,7 +3228,7 @@ const Dr = [
3212
3228
  title: "Custom",
3213
3229
  value: la
3214
3230
  }
3215
- ], Ir = [
3231
+ ], Lr = [
3216
3232
  {
3217
3233
  title: "Add",
3218
3234
  value: ca
@@ -3233,7 +3249,7 @@ const Dr = [
3233
3249
  title: "Max",
3234
3250
  value: pa
3235
3251
  }
3236
- ], Lr = [
3252
+ ], kr = [
3237
3253
  {
3238
3254
  title: "Zero",
3239
3255
  value: Qs
@@ -3294,7 +3310,7 @@ const Dr = [
3294
3310
  title: "One Minus Constant Alpha",
3295
3311
  value: un
3296
3312
  }
3297
- ], kr = [
3313
+ ], Ur = [
3298
3314
  {
3299
3315
  title: "Zero",
3300
3316
  value: Qs
@@ -3355,24 +3371,24 @@ const Dr = [
3355
3371
  function St(i, e) {
3356
3372
  i.needsUpdate = !0, i.type = "option", i.options = e;
3357
3373
  }
3358
- function Ur(i, e, t, s) {
3374
+ function jr(i, e, t, s) {
3359
3375
  return {
3360
3376
  type: "boolean",
3361
3377
  title: di(i),
3362
3378
  prop: i,
3363
3379
  value: e,
3364
3380
  needsUpdate: !0,
3365
- onChange: (n, a) => {
3366
- s.updateObject(t.uuid, `material.${i}`, a), s.updateObject(t.uuid, "material.needsUpdate", !0);
3367
- const r = s.getScene(t.uuid);
3368
- if (r !== null) {
3369
- const o = r.getObjectByProperty("uuid", t.uuid);
3370
- se(o, `material.${i}`, a);
3381
+ onChange: (n, r) => {
3382
+ s.updateObject(t.uuid, `material.${i}`, r), s.updateObject(t.uuid, "material.needsUpdate", !0);
3383
+ const a = s.getScene(t.uuid);
3384
+ if (a !== null) {
3385
+ const o = a.getObjectByProperty("uuid", t.uuid);
3386
+ se(o, `material.${i}`, r);
3371
3387
  }
3372
3388
  }
3373
3389
  };
3374
3390
  }
3375
- function jr(i, e, t, s) {
3391
+ function Nr(i, e, t, s) {
3376
3392
  const n = {
3377
3393
  type: "number",
3378
3394
  title: di(i),
@@ -3382,42 +3398,42 @@ function jr(i, e, t, s) {
3382
3398
  max: void 0,
3383
3399
  step: 0.01,
3384
3400
  needsUpdate: !0,
3385
- onChange: (a, r) => {
3386
- s.updateObject(t.uuid, `material.${i}`, r), s.updateObject(t.uuid, "material.needsUpdate", !0);
3401
+ onChange: (r, a) => {
3402
+ s.updateObject(t.uuid, `material.${i}`, a), s.updateObject(t.uuid, "material.needsUpdate", !0);
3387
3403
  const o = s.getScene(t.uuid);
3388
3404
  if (o !== null) {
3389
3405
  const c = o.getObjectByProperty("uuid", t.uuid);
3390
- se(c, `material.${i}`, r);
3406
+ se(c, `material.${i}`, a);
3391
3407
  }
3392
3408
  }
3393
3409
  };
3394
3410
  switch (i) {
3395
3411
  case "blending":
3396
- St(n, Rr);
3412
+ St(n, Ir);
3397
3413
  break;
3398
3414
  case "blendDst":
3399
- St(n, kr);
3415
+ St(n, Ur);
3400
3416
  break;
3401
3417
  case "blendEquation":
3402
- St(n, Ir);
3418
+ St(n, Lr);
3403
3419
  break;
3404
3420
  case "blendSrc":
3405
- St(n, Lr);
3421
+ St(n, kr);
3406
3422
  break;
3407
3423
  case "side":
3408
- St(n, Dr);
3424
+ St(n, Rr);
3409
3425
  break;
3410
3426
  }
3411
3427
  return On(i) && (n.value = Number(e), n.type = "range", n.min = Math.min(0, n.value), n.max = Math.max(1, n.value), n.step = 0.01), n;
3412
3428
  }
3413
- function Nr(i, e, t, s) {
3429
+ function Fr(i, e, t, s) {
3414
3430
  const n = {
3415
3431
  type: "string",
3416
3432
  title: di(i),
3417
3433
  prop: i,
3418
3434
  value: e,
3419
3435
  needsUpdate: !0,
3420
- onChange: (r, o) => {
3436
+ onChange: (a, o) => {
3421
3437
  s.updateObject(t.uuid, `material.${i}`, o), s.updateObject(t.uuid, "material.needsUpdate", !0);
3422
3438
  const c = s.getScene(t.uuid);
3423
3439
  if (c !== null) {
@@ -3425,18 +3441,18 @@ function Nr(i, e, t, s) {
3425
3441
  se(l, `material.${i}`, o);
3426
3442
  }
3427
3443
  },
3428
- onKeyDown: (r) => {
3444
+ onKeyDown: (a) => {
3429
3445
  }
3430
3446
  };
3431
- return (i === "vertexShader" || i === "fragmentShader") && (n.disabled = !1, n.latest = n.value, n.onChange = (r, o) => {
3447
+ return (i === "vertexShader" || i === "fragmentShader") && (n.disabled = !1, n.latest = n.value, n.onChange = (a, o) => {
3432
3448
  n.latest = o, s.updateObject(t.uuid, `material.${i}`, o);
3433
3449
  const c = s.getScene(t.uuid);
3434
3450
  if (c !== null) {
3435
3451
  const l = c.getObjectByProperty("uuid", t.uuid);
3436
3452
  se(l, `material.${i}`, o);
3437
3453
  }
3438
- }, n.onKeyDown = (r) => {
3439
- if (r.key === "Enter" && (r.altKey || r.metaKey)) {
3454
+ }, n.onKeyDown = (a) => {
3455
+ if (a.key === "Enter" && (a.altKey || a.metaKey)) {
3440
3456
  s.updateObject(t.uuid, "material.needsUpdate", !0);
3441
3457
  const o = s.getScene(t.uuid);
3442
3458
  if (o !== null) {
@@ -3446,27 +3462,27 @@ function Nr(i, e, t, s) {
3446
3462
  }
3447
3463
  }), n;
3448
3464
  }
3449
- function Fr(i) {
3465
+ function zr(i) {
3450
3466
  return i.x !== void 0 && i.y !== void 0 && i.z === void 0;
3451
3467
  }
3452
- function zr(i) {
3468
+ function Hr(i) {
3453
3469
  return i.x !== void 0 && i.y !== void 0 && i.z !== void 0 && i.w === void 0;
3454
3470
  }
3455
- function Hr(i) {
3471
+ function Yr(i) {
3456
3472
  return i.x !== void 0 && i.y !== void 0 && i.z !== void 0 && i.w !== void 0;
3457
3473
  }
3458
3474
  function Yi(i) {
3459
3475
  i.sort((e, t) => e.title < t.title ? -1 : e.title > t.title ? 1 : 0);
3460
3476
  }
3461
- function It(i, e, t, s, n = "", a = !1) {
3462
- const r = di(i).split(".")[0].replaceAll("[", "").replaceAll("]", ""), o = n.length > 0 ? `${n}.${i}` : i, c = typeof e;
3477
+ function It(i, e, t, s, n = "", r = !1) {
3478
+ const a = di(i).split(".")[0].replaceAll("[", "").replaceAll("]", ""), o = n.length > 0 ? `${n}.${i}` : i, c = typeof e;
3463
3479
  if (c === "boolean" || c === "string")
3464
3480
  return {
3465
- title: r,
3481
+ title: a,
3466
3482
  prop: o,
3467
3483
  type: c,
3468
3484
  value: e,
3469
- disabled: a,
3485
+ disabled: r,
3470
3486
  onChange: (l, d) => {
3471
3487
  s.updateObject(t.uuid, `material.${o}`, d);
3472
3488
  const p = s.getScene(t.uuid);
@@ -3478,12 +3494,12 @@ function It(i, e, t, s, n = "", a = !1) {
3478
3494
  };
3479
3495
  if (c === "number") {
3480
3496
  const l = {
3481
- title: r,
3497
+ title: a,
3482
3498
  prop: o,
3483
3499
  type: "number",
3484
3500
  value: e,
3485
3501
  step: 0.01,
3486
- disabled: a,
3502
+ disabled: r,
3487
3503
  onChange: (d, p) => {
3488
3504
  s.updateObject(t.uuid, `material.${o}`, p);
3489
3505
  const m = s.getScene(t.uuid);
@@ -3493,15 +3509,15 @@ function It(i, e, t, s, n = "", a = !1) {
3493
3509
  }
3494
3510
  }
3495
3511
  };
3496
- return On(r) && (l.type = "range", l.min = 0, l.max = 1), l;
3512
+ return On(a) && (l.type = "range", l.min = 0, l.max = 1), l;
3497
3513
  } else {
3498
3514
  if (e.isColor)
3499
3515
  return {
3500
- title: r,
3516
+ title: a,
3501
3517
  prop: o,
3502
3518
  type: "color",
3503
3519
  value: e,
3504
- disabled: a,
3520
+ disabled: r,
3505
3521
  onChange: (l, d) => {
3506
3522
  const p = new et(d);
3507
3523
  s.updateObject(t.uuid, `material.${o}`, p);
@@ -3517,26 +3533,26 @@ function It(i, e, t, s, n = "", a = !1) {
3517
3533
  for (const d in e) {
3518
3534
  const p = e[d], m = `[${d.toString()}]`;
3519
3535
  if (p.value !== void 0) {
3520
- const f = It(`${m}.value`, p.value, t, s, o, a);
3536
+ const f = It(`${m}.value`, p.value, t, s, o, r);
3521
3537
  f !== void 0 && l.push(f);
3522
3538
  } else {
3523
- const f = It(m, p, t, s, o, a);
3539
+ const f = It(m, p, t, s, o, r);
3524
3540
  f !== void 0 && l.push(f);
3525
3541
  }
3526
3542
  }
3527
3543
  if (l.length > 0)
3528
3544
  return Yi(l), {
3529
- title: r,
3545
+ title: a,
3530
3546
  items: l
3531
3547
  };
3532
3548
  } else {
3533
- if (Fr(e))
3549
+ if (zr(e))
3534
3550
  return {
3535
- title: r,
3551
+ title: a,
3536
3552
  prop: o,
3537
3553
  type: "vector2",
3538
3554
  value: e,
3539
- disabled: a,
3555
+ disabled: r,
3540
3556
  onChange: (l, d) => {
3541
3557
  s.updateObject(t.uuid, `material.${o}`, d);
3542
3558
  const p = s.getScene(t.uuid);
@@ -3546,13 +3562,13 @@ function It(i, e, t, s, n = "", a = !1) {
3546
3562
  }
3547
3563
  }
3548
3564
  };
3549
- if (zr(e))
3565
+ if (Hr(e))
3550
3566
  return {
3551
- title: r,
3567
+ title: a,
3552
3568
  prop: o,
3553
3569
  type: "grid3",
3554
3570
  value: e,
3555
- disabled: a,
3571
+ disabled: r,
3556
3572
  onChange: (l, d) => {
3557
3573
  s.updateObject(t.uuid, `material.${o}`, d);
3558
3574
  const p = s.getScene(t.uuid);
@@ -3562,13 +3578,13 @@ function It(i, e, t, s, n = "", a = !1) {
3562
3578
  }
3563
3579
  }
3564
3580
  };
3565
- if (Hr(e))
3581
+ if (Yr(e))
3566
3582
  return {
3567
- title: r,
3583
+ title: a,
3568
3584
  prop: o,
3569
3585
  type: "grid4",
3570
3586
  value: e,
3571
- disabled: a,
3587
+ disabled: r,
3572
3588
  onChange: (l, d) => {
3573
3589
  s.updateObject(t.uuid, `material.${o}`, d);
3574
3590
  const p = s.getScene(t.uuid);
@@ -3580,11 +3596,11 @@ function It(i, e, t, s, n = "", a = !1) {
3580
3596
  };
3581
3597
  if (e.isEuler)
3582
3598
  return {
3583
- title: r,
3599
+ title: a,
3584
3600
  prop: o,
3585
3601
  type: "euler",
3586
3602
  value: e,
3587
- disabled: a,
3603
+ disabled: r,
3588
3604
  onChange: (l, d) => {
3589
3605
  s.updateObject(t.uuid, `material.${o}`, d);
3590
3606
  const p = s.getScene(t.uuid);
@@ -3596,12 +3612,12 @@ function It(i, e, t, s, n = "", a = !1) {
3596
3612
  };
3597
3613
  if (e.src !== void 0)
3598
3614
  return {
3599
- title: r,
3615
+ title: a,
3600
3616
  type: "image",
3601
3617
  value: e,
3602
- disabled: a,
3618
+ disabled: r,
3603
3619
  onChange: (l, d) => {
3604
- const p = Pr(i), m = n.length > 0 ? `${n}.${p}` : p;
3620
+ const p = Ar(i), m = n.length > 0 ? `${n}.${p}` : p;
3605
3621
  s.createTexture(t.uuid, `material.${m}`, d);
3606
3622
  const f = s.getScene(t.uuid);
3607
3623
  if (f !== null) {
@@ -3637,11 +3653,11 @@ function It(i, e, t, s, n = "", a = !1) {
3637
3653
  };
3638
3654
  if (e.elements !== void 0)
3639
3655
  return {
3640
- title: r,
3656
+ title: a,
3641
3657
  prop: o,
3642
3658
  type: e.elements.length > 9 ? "grid4" : "grid3",
3643
3659
  value: e,
3644
- disabled: a,
3660
+ disabled: r,
3645
3661
  onChange: (l, d) => {
3646
3662
  s.updateObject(t.uuid, `material.${o}`, d);
3647
3663
  const p = s.getScene(t.uuid);
@@ -3670,7 +3686,7 @@ function It(i, e, t, s, n = "", a = !1) {
3670
3686
  }
3671
3687
  if (l.length > 0)
3672
3688
  return Yi(l), {
3673
- title: r,
3689
+ title: a,
3674
3690
  items: l
3675
3691
  };
3676
3692
  }
@@ -3680,20 +3696,20 @@ function It(i, e, t, s, n = "", a = !1) {
3680
3696
  function Os(i, e, t) {
3681
3697
  const s = [];
3682
3698
  for (const n in i) {
3683
- if (!Mr(n))
3699
+ if (!Pr(n))
3684
3700
  continue;
3685
- const a = typeof i[n], r = i[n];
3686
- if (a === "boolean")
3687
- s.push(Ur(n, r, e, t));
3688
- else if (a === "number")
3689
- s.push(jr(n, r, e, t));
3690
- else if (a === "string")
3691
- s.push(Nr(n, r, e, t));
3692
- else if (a === "object") {
3693
- const o = It(n, r, e, t);
3701
+ const r = typeof i[n], a = i[n];
3702
+ if (r === "boolean")
3703
+ s.push(jr(n, a, e, t));
3704
+ else if (r === "number")
3705
+ s.push(Nr(n, a, e, t));
3706
+ else if (r === "string")
3707
+ s.push(Fr(n, a, e, t));
3708
+ else if (r === "object") {
3709
+ const o = It(n, a, e, t);
3694
3710
  o !== void 0 && s.push(o);
3695
3711
  } else
3696
- r !== void 0 && console.log("other:", n, a, r);
3712
+ a !== void 0 && console.log("other:", n, r, a);
3697
3713
  }
3698
3714
  return Yi(s), s.push({
3699
3715
  title: "Update Material",
@@ -3702,30 +3718,30 @@ function Os(i, e, t) {
3702
3718
  t.updateObject(e.uuid, "material.needsUpdate", !0);
3703
3719
  const n = t.getScene(e.uuid);
3704
3720
  if (n !== null) {
3705
- const a = n.getObjectByProperty("uuid", e.uuid);
3706
- se(a, "material.needsUpdate", !0);
3721
+ const r = n.getObjectByProperty("uuid", e.uuid);
3722
+ se(r, "material.needsUpdate", !0);
3707
3723
  }
3708
3724
  }
3709
3725
  }), s;
3710
3726
  }
3711
- function Yr(i, e) {
3727
+ function Br(i, e) {
3712
3728
  function t() {
3713
3729
  return `${e.app.appID}_material`;
3714
3730
  }
3715
3731
  const s = localStorage.getItem(t()), n = s !== null ? s === "open" : !1;
3716
- function a(o) {
3732
+ function r(o) {
3717
3733
  localStorage.setItem(t(), o ? "open" : "closed");
3718
3734
  }
3719
- const r = i.material;
3720
- if (Array.isArray(r)) {
3721
- const o = [], c = r.length;
3735
+ const a = i.material;
3736
+ if (Array.isArray(a)) {
3737
+ const o = [], c = a.length;
3722
3738
  for (let l = 0; l < c; l++)
3723
3739
  o.push(
3724
3740
  /* @__PURE__ */ u.jsx(
3725
3741
  Oe,
3726
3742
  {
3727
3743
  title: `Material ${l}`,
3728
- items: Os(r[l], i, e)
3744
+ items: Os(a[l], i, e)
3729
3745
  },
3730
3746
  `Material ${l}`
3731
3747
  )
@@ -3736,17 +3752,17 @@ function Yr(i, e) {
3736
3752
  Oe,
3737
3753
  {
3738
3754
  title: "Material",
3739
- items: Os(r, i, e),
3755
+ items: Os(a, i, e),
3740
3756
  expanded: n,
3741
3757
  onToggle: (o) => {
3742
- a(o);
3758
+ r(o);
3743
3759
  }
3744
3760
  }
3745
3761
  );
3746
3762
  }
3747
3763
  const Ts = "data:image/gif;base64,R0lGODlhDgFkAIAAAP///wAAACH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgOS4xLWMwMDIgNzkuZGJhM2RhM2I1LCAyMDIzLzEyLzE1LTEwOjQyOjM3ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgMjUuNiAoTWFjaW50b3NoKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoyMDk3M0NEODAxQjQxMUVGODVGNENDMkUyMUExNDk1NSIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoyMDk3M0NEOTAxQjQxMUVGODVGNENDMkUyMUExNDk1NSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkE4ODc3Qzg5MDFCMzExRUY4NUY0Q0MyRTIxQTE0OTU1IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkE4ODc3QzhBMDFCMzExRUY4NUY0Q0MyRTIxQTE0OTU1Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+Af/+/fz7+vn49/b19PPy8fDv7u3s6+rp6Ofm5eTj4uHg397d3Nva2djX1tXU09LR0M/OzczLysnIx8bFxMPCwcC/vr28u7q5uLe2tbSzsrGwr66trKuqqainpqWko6KhoJ+enZybmpmYl5aVlJOSkZCPjo2Mi4qJiIeGhYSDgoGAf359fHt6eXh3dnV0c3JxcG9ubWxramloZ2ZlZGNiYWBfXl1cW1pZWFdWVVRTUlFQT05NTEtKSUhHRkVEQ0JBQD8+PTw7Ojk4NzY1NDMyMTAvLi0sKyopKCcmJSQjIiEgHx4dHBsaGRgXFhUUExIREA8ODQwLCgkIBwYFBAMCAQAAIfkEAAAAAAAsAAAAAA4BZAAAAv+Mj6nL7Q+jnLTai7PevPsPhuJIluaJpurKtu4Lx/JM1/aN5/rO9/4PDAqHxKLxiEwql8ym8wmNSqfUqvWKzWq33K73Cw6Lx+Sy+YxOq9fstvsNj8vn9Lr9js/r9/y+/w8YKDhIWGh4iJiouMjY6PgIGSk5SVlpeYmZqTkJAGDQ+dnpuekmGgAKejpKuiZqmprKqoZKGyrbOlqrejub6xvLGyw8TFzcprurGuvqybxq7ETbrItsCz0l7Zpc+6p9/cS967w9/S2FTF0u/mzehK4Oqz3eTl9vf4+fr7/P3+//DzCgwIEECxo8iDChwoUMGzp8CDGixIkUK1q8iDGjxo0XHDt6/AgypMiRJEuaPIkypcqVLFt+KwAAOw==";
3748
- function Br(i) {
3749
- const e = i.step !== void 0 ? i.step : 0.01, t = J(null), s = J(null), n = J(null), a = J(null), r = J(null), [o] = B(i.value), [c, l] = B(i.value.offset[0]), [d, p] = B(i.value.offset[1]), [m, f] = B(i.value.repeat[0]), [E, v] = B(i.value.repeat[1]);
3764
+ function Vr(i) {
3765
+ const e = i.step !== void 0 ? i.step : 0.01, t = J(null), s = J(null), n = J(null), r = J(null), a = J(null), [o] = B(i.value), [c, l] = B(i.value.offset[0]), [d, p] = B(i.value.offset[1]), [m, f] = B(i.value.repeat[0]), [E, v] = B(i.value.repeat[1]);
3750
3766
  function x(y, C, w, S, O) {
3751
3767
  if (i.onChange !== void 0) {
3752
3768
  const I = i.prop !== void 0 ? i.prop : i.title;
@@ -3766,17 +3782,17 @@ function Br(i) {
3766
3782
  case n.current:
3767
3783
  p(w), x(C, c, w, m, E);
3768
3784
  break;
3769
- case a.current:
3785
+ case r.current:
3770
3786
  f(w), x(C, c, d, w, E);
3771
3787
  break;
3772
- case r.current:
3788
+ case a.current:
3773
3789
  v(w), x(C, c, d, m, w);
3774
3790
  break;
3775
3791
  }
3776
3792
  }
3777
3793
  return /* @__PURE__ */ u.jsxs("div", { className: "imageField", children: [
3778
3794
  /* @__PURE__ */ u.jsx("img", { alt: i.title, ref: t, onClick: () => {
3779
- Ar().then((y) => {
3795
+ Dr().then((y) => {
3780
3796
  t.current.src = y, x(y, c, d, m, E);
3781
3797
  });
3782
3798
  }, src: o.src.length > 0 ? o.src : Ts }),
@@ -3809,7 +3825,7 @@ function Br(i) {
3809
3825
  /* @__PURE__ */ u.jsx(
3810
3826
  "input",
3811
3827
  {
3812
- ref: a,
3828
+ ref: r,
3813
3829
  type: "number",
3814
3830
  value: m,
3815
3831
  step: e,
@@ -3819,7 +3835,7 @@ function Br(i) {
3819
3835
  /* @__PURE__ */ u.jsx(
3820
3836
  "input",
3821
3837
  {
3822
- ref: r,
3838
+ ref: a,
3823
3839
  type: "number",
3824
3840
  value: E,
3825
3841
  step: e,
@@ -3836,7 +3852,7 @@ function Br(i) {
3836
3852
  function si(i) {
3837
3853
  let e = i.value;
3838
3854
  e !== void 0 && (e.isColor !== void 0 ? e = gs(i.value) : i.type === "color" && (e = gs(new et().setStyle(i.value, jt))));
3839
- const [t, s] = B(e), n = J(null), a = (l) => {
3855
+ const [t, s] = B(e), n = J(null), r = (l) => {
3840
3856
  let d = l.target.value;
3841
3857
  if (i.type === "boolean")
3842
3858
  d = l.target.checked;
@@ -3846,18 +3862,18 @@ function si(i) {
3846
3862
  ;
3847
3863
  }
3848
3864
  s(d), i.onChange !== void 0 && i.onChange(i.prop !== void 0 ? i.prop : i.title, d);
3849
- }, r = {};
3850
- i.disabled && (r.opacity = 0.8);
3865
+ }, a = {};
3866
+ i.disabled && (a.opacity = 0.8);
3851
3867
  const o = i.type === "string" && (t.length > 100 || t.search(`
3852
3868
  `) > -1), c = o || i.type === "image" || i.type === "vector2";
3853
- return /* @__PURE__ */ u.jsxs("div", { className: `field ${c ? "block" : ""}`, style: r, children: [
3869
+ return /* @__PURE__ */ u.jsxs("div", { className: `field ${c ? "block" : ""}`, style: a, children: [
3854
3870
  i.type !== "button" && /* @__PURE__ */ u.jsx("label", { ref: n, children: oi(i.title) }, "fieldLabel"),
3855
3871
  i.type === "string" && !o && /* @__PURE__ */ u.jsx(
3856
3872
  "input",
3857
3873
  {
3858
3874
  type: "text",
3859
3875
  disabled: i.disabled,
3860
- onChange: a,
3876
+ onChange: r,
3861
3877
  value: t
3862
3878
  }
3863
3879
  ),
@@ -3867,7 +3883,7 @@ function si(i) {
3867
3883
  cols: 50,
3868
3884
  rows: 10,
3869
3885
  disabled: i.disabled !== void 0 ? i.disabled : !0,
3870
- onChange: a,
3886
+ onChange: r,
3871
3887
  onKeyDown: (l) => {
3872
3888
  i.onKeyDown !== void 0 && i.onKeyDown(l);
3873
3889
  },
@@ -3879,7 +3895,7 @@ function si(i) {
3879
3895
  {
3880
3896
  type: "checkbox",
3881
3897
  disabled: i.disabled,
3882
- onChange: a,
3898
+ onChange: r,
3883
3899
  checked: t
3884
3900
  }
3885
3901
  ),
@@ -3912,8 +3928,8 @@ function si(i) {
3912
3928
  }
3913
3929
  ),
3914
3930
  i.type === "color" && /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
3915
- /* @__PURE__ */ u.jsx("input", { type: "text", value: t.toString(), onChange: a, disabled: i.disabled, className: "color" }),
3916
- /* @__PURE__ */ u.jsx("input", { type: "color", value: t, onChange: a, disabled: i.disabled })
3931
+ /* @__PURE__ */ u.jsx("input", { type: "text", value: t.toString(), onChange: r, disabled: i.disabled, className: "color" }),
3932
+ /* @__PURE__ */ u.jsx("input", { type: "color", value: t, onChange: r, disabled: i.disabled })
3917
3933
  ] }),
3918
3934
  i.type === "button" && /* @__PURE__ */ u.jsx(
3919
3935
  "button",
@@ -3925,15 +3941,15 @@ function si(i) {
3925
3941
  children: i.title
3926
3942
  }
3927
3943
  ),
3928
- i.type === "image" && /* @__PURE__ */ u.jsx(Br, { title: i.title, prop: i.prop, value: i.value, onChange: i.onChange }),
3929
- i.type === "option" && /* @__PURE__ */ u.jsx(u.Fragment, { children: /* @__PURE__ */ u.jsx("select", { onChange: a, disabled: i.disabled, defaultValue: i.value, children: i.options?.map((l, d) => /* @__PURE__ */ u.jsx("option", { value: l.value, children: oi(l.title) }, d)) }) }),
3930
- i.type === "vector2" && /* @__PURE__ */ u.jsx(wr, { step: i.step, value: t, min: 0, max: 1, onChange: a }),
3931
- i.type === "grid3" && /* @__PURE__ */ u.jsx(xs, { step: i.step, value: t, onChange: a }),
3932
- i.type === "grid4" && /* @__PURE__ */ u.jsx(Tr, { step: i.step, value: t, onChange: a }),
3933
- i.type === "euler" && /* @__PURE__ */ u.jsx(xs, { step: i.step, value: t, onChange: a })
3944
+ i.type === "image" && /* @__PURE__ */ u.jsx(Vr, { title: i.title, prop: i.prop, value: i.value, onChange: i.onChange }),
3945
+ i.type === "option" && /* @__PURE__ */ u.jsx(u.Fragment, { children: /* @__PURE__ */ u.jsx("select", { onChange: r, disabled: i.disabled, defaultValue: i.value, children: i.options?.map((l, d) => /* @__PURE__ */ u.jsx("option", { value: l.value, children: oi(l.title) }, d)) }) }),
3946
+ i.type === "vector2" && /* @__PURE__ */ u.jsx(Sr, { step: i.step, value: t, min: 0, max: 1, onChange: r }),
3947
+ i.type === "grid3" && /* @__PURE__ */ u.jsx(xs, { step: i.step, value: t, onChange: r }),
3948
+ i.type === "grid4" && /* @__PURE__ */ u.jsx(Mr, { step: i.step, value: t, onChange: r }),
3949
+ i.type === "euler" && /* @__PURE__ */ u.jsx(xs, { step: i.step, value: t, onChange: r })
3934
3950
  ] });
3935
3951
  }
3936
- function Vr(i) {
3952
+ function Zr(i) {
3937
3953
  return "items" in i;
3938
3954
  }
3939
3955
  class Oe extends Ft {
@@ -3945,19 +3961,19 @@ class Oe extends Ft {
3945
3961
  }
3946
3962
  addGroup(e) {
3947
3963
  const t = [];
3948
- e.items.forEach((a) => {
3964
+ e.items.forEach((r) => {
3949
3965
  t.push({
3950
- type: a.type,
3951
- prop: a.prop,
3952
- title: a.title !== void 0 ? a.title : a.prop,
3953
- value: a.value,
3954
- min: a.min,
3955
- max: a.max,
3956
- step: a.step,
3957
- options: a.options,
3958
- disabled: a.disabled,
3959
- onChange: (r, o) => {
3960
- e.onUpdate(r, o);
3966
+ type: r.type,
3967
+ prop: r.prop,
3968
+ title: r.title !== void 0 ? r.title : r.prop,
3969
+ value: r.value,
3970
+ min: r.min,
3971
+ max: r.max,
3972
+ step: r.step,
3973
+ options: r.options,
3974
+ disabled: r.disabled,
3975
+ onChange: (a, o) => {
3976
+ e.onUpdate(a, o);
3961
3977
  }
3962
3978
  });
3963
3979
  });
@@ -3988,7 +4004,7 @@ class Oe extends Ft {
3988
4004
  render() {
3989
4005
  const e = [];
3990
4006
  return this.props.items.forEach((t) => {
3991
- if (Vr(t))
4007
+ if (Zr(t))
3992
4008
  e.push(
3993
4009
  /* @__PURE__ */ u.jsx(Oe, { title: oi(t.title), items: t.items }, Math.random())
3994
4010
  );
@@ -4007,11 +4023,11 @@ class Oe extends Ft {
4007
4023
  step: t.step,
4008
4024
  disabled: t.disabled,
4009
4025
  options: t.options,
4010
- onChange: (a, r) => {
4011
- t.onChange !== void 0 && (this.valueOverrides.delete(t.title), t.onChange(a, r));
4026
+ onChange: (r, a) => {
4027
+ t.onChange !== void 0 && (this.valueOverrides.delete(t.title), t.onChange(r, a));
4012
4028
  },
4013
- onKeyDown: (a) => {
4014
- t.onKeyDown !== void 0 && t.onKeyDown(a);
4029
+ onKeyDown: (r) => {
4030
+ t.onKeyDown !== void 0 && t.onKeyDown(r);
4015
4031
  }
4016
4032
  },
4017
4033
  Math.random()
@@ -4059,8 +4075,8 @@ class te extends Ft {
4059
4075
  step: n.step,
4060
4076
  options: n.options,
4061
4077
  disabled: n.disabled,
4062
- onChange: (a, r) => {
4063
- this.props.three.updateGroup(t.title, a, r);
4078
+ onChange: (r, a) => {
4079
+ this.props.three.updateGroup(t.title, r, a);
4064
4080
  }
4065
4081
  });
4066
4082
  }), te.groups.push(
@@ -4085,19 +4101,19 @@ class te extends Ft {
4085
4101
  // Static
4086
4102
  static addEditorGroup(e) {
4087
4103
  const t = [];
4088
- e.items.forEach((a) => {
4104
+ e.items.forEach((r) => {
4089
4105
  t.push({
4090
- type: a.type,
4091
- prop: a.prop,
4092
- title: a.title !== void 0 ? a.title : a.prop,
4093
- value: a.value,
4094
- min: a.min,
4095
- max: a.max,
4096
- step: a.step,
4097
- options: a.options,
4098
- disabled: a.disabled,
4099
- onChange: (r, o) => {
4100
- e.onUpdate(r, o);
4106
+ type: r.type,
4107
+ prop: r.prop,
4108
+ title: r.title !== void 0 ? r.title : r.prop,
4109
+ value: r.value,
4110
+ min: r.min,
4111
+ max: r.max,
4112
+ step: r.step,
4113
+ options: r.options,
4114
+ disabled: r.disabled,
4115
+ onChange: (a, o) => {
4116
+ e.onUpdate(a, o);
4101
4117
  }
4102
4118
  });
4103
4119
  });
@@ -4150,18 +4166,18 @@ function Ms(i) {
4150
4166
  }
4151
4167
  return i;
4152
4168
  }
4153
- function Zr(i, e) {
4169
+ function Wr(i, e) {
4154
4170
  function t() {
4155
4171
  return `${e.app.appID}_camera`;
4156
4172
  }
4157
4173
  const s = localStorage.getItem(t()), n = s !== null ? s === "open" : !1;
4158
- function a(o) {
4174
+ function r(o) {
4159
4175
  localStorage.setItem(t(), o ? "open" : "closed");
4160
4176
  }
4161
- const r = [];
4177
+ const a = [];
4162
4178
  if (i.perspectiveCameraInfo !== void 0)
4163
4179
  for (const o in i.perspectiveCameraInfo)
4164
- r.push({
4180
+ a.push({
4165
4181
  title: Ms(o),
4166
4182
  prop: o,
4167
4183
  type: "number",
@@ -4178,7 +4194,7 @@ function Zr(i, e) {
4178
4194
  });
4179
4195
  else if (i.orthographicCameraInfo !== void 0)
4180
4196
  for (const o in i.orthographicCameraInfo)
4181
- r.push({
4197
+ a.push({
4182
4198
  title: Ms(o),
4183
4199
  prop: o,
4184
4200
  type: "number",
@@ -4197,22 +4213,22 @@ function Zr(i, e) {
4197
4213
  Oe,
4198
4214
  {
4199
4215
  title: "Camera",
4200
- items: r,
4216
+ items: a,
4201
4217
  expanded: n,
4202
4218
  onToggle: (o) => {
4203
- a(o);
4219
+ r(o);
4204
4220
  }
4205
4221
  }
4206
4222
  );
4207
4223
  }
4208
- class Wr extends Ie {
4224
+ class Gr extends Ie {
4209
4225
  constructor(e, t) {
4210
4226
  const s = [1, 1, 0, -1, 1, 0, -1, -1, 0, 1, -1, 0, 1, 1, 0], n = new _t();
4211
4227
  n.setAttribute("position", new Ke(s, 3)), n.computeBoundingSphere();
4212
- const a = new Gi({ fog: !1 });
4213
- super(n, a), this.light = e, this.color = t, this.type = "RectAreaLightHelper";
4214
- const r = [1, 1, 0, -1, 1, 0, -1, -1, 0, 1, 1, 0, -1, -1, 0, 1, -1, 0], o = new _t();
4215
- o.setAttribute("position", new Ke(r, 3)), o.computeBoundingSphere(), this.add(new M(o, new Je({ side: Ks, fog: !1 })));
4228
+ const r = new Gi({ fog: !1 });
4229
+ super(n, r), this.light = e, this.color = t, this.type = "RectAreaLightHelper";
4230
+ const a = [1, 1, 0, -1, 1, 0, -1, -1, 0, 1, 1, 0, -1, -1, 0, 1, -1, 0], o = new _t();
4231
+ o.setAttribute("position", new Ke(a, 3)), o.computeBoundingSphere(), this.add(new M(o, new Je({ side: Ks, fog: !1 })));
4216
4232
  }
4217
4233
  updateMatrixWorld() {
4218
4234
  if (this.scale.set(0.5 * this.light.width, 0.5 * this.light.height, 1), this.color !== void 0)
@@ -4228,7 +4244,7 @@ class Wr extends Ie {
4228
4244
  this.geometry.dispose(), this.material.dispose(), this.children[0].geometry.dispose(), this.children[0].material.dispose();
4229
4245
  }
4230
4246
  }
4231
- const Ps = { type: "change" }, qi = { type: "start" }, Tn = { type: "end" }, Wt = new fa(), As = new ga(), Gr = Math.cos(70 * _a.DEG2RAD), oe = new P(), ye = 2 * Math.PI, Z = {
4247
+ const Ps = { type: "change" }, qi = { type: "start" }, Tn = { type: "end" }, Wt = new fa(), As = new ga(), Xr = Math.cos(70 * _a.DEG2RAD), oe = new P(), ye = 2 * Math.PI, Z = {
4232
4248
  NONE: -1,
4233
4249
  ROTATE: 0,
4234
4250
  DOLLY: 1,
@@ -4238,9 +4254,9 @@ const Ps = { type: "change" }, qi = { type: "start" }, Tn = { type: "end" }, Wt
4238
4254
  TOUCH_DOLLY_PAN: 5,
4239
4255
  TOUCH_DOLLY_ROTATE: 6
4240
4256
  }, wi = 1e-6;
4241
- class Xr extends pn {
4257
+ class $r extends pn {
4242
4258
  constructor(e, t = null) {
4243
- super(e, t), this.state = Z.NONE, this.enabled = !0, this.target = new P(), this.cursor = new P(), this.minDistance = 0, this.maxDistance = 1 / 0, this.minZoom = 0, this.maxZoom = 1 / 0, this.minTargetRadius = 0, this.maxTargetRadius = 1 / 0, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.enableDamping = !1, this.dampingFactor = 0.05, this.enableZoom = !0, this.zoomSpeed = 1, this.enableRotate = !0, this.rotateSpeed = 1, this.enablePan = !0, this.panSpeed = 1, this.screenSpacePanning = !0, this.keyPanSpeed = 7, this.zoomToCursor = !1, this.autoRotate = !1, this.autoRotateSpeed = 2, this.keys = { LEFT: "ArrowLeft", UP: "ArrowUp", RIGHT: "ArrowRight", BOTTOM: "ArrowDown" }, this.mouseButtons = { LEFT: gt.ROTATE, MIDDLE: gt.DOLLY, RIGHT: gt.PAN }, this.touches = { ONE: ft.ROTATE, TWO: ft.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this._lastPosition = new P(), this._lastQuaternion = new Ce(), this._lastTargetPosition = new P(), this._quat = new Ce().setFromUnitVectors(e.up, new P(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new Ui(), this._sphericalDelta = new Ui(), this._scale = 1, this._panOffset = new P(), this._rotateStart = new pe(), this._rotateEnd = new pe(), this._rotateDelta = new pe(), this._panStart = new pe(), this._panEnd = new pe(), this._panDelta = new pe(), this._dollyStart = new pe(), this._dollyEnd = new pe(), this._dollyDelta = new pe(), this._dollyDirection = new P(), this._mouse = new pe(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = qr.bind(this), this._onPointerDown = $r.bind(this), this._onPointerUp = Kr.bind(this), this._onContextMenu = no.bind(this), this._onMouseWheel = eo.bind(this), this._onKeyDown = to.bind(this), this._onTouchStart = io.bind(this), this._onTouchMove = so.bind(this), this._onMouseDown = Qr.bind(this), this._onMouseMove = Jr.bind(this), this._interceptControlDown = ao.bind(this), this._interceptControlUp = ro.bind(this), this.domElement !== null && this.connect(), this.update();
4259
+ super(e, t), this.state = Z.NONE, this.enabled = !0, this.target = new P(), this.cursor = new P(), this.minDistance = 0, this.maxDistance = 1 / 0, this.minZoom = 0, this.maxZoom = 1 / 0, this.minTargetRadius = 0, this.maxTargetRadius = 1 / 0, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.enableDamping = !1, this.dampingFactor = 0.05, this.enableZoom = !0, this.zoomSpeed = 1, this.enableRotate = !0, this.rotateSpeed = 1, this.enablePan = !0, this.panSpeed = 1, this.screenSpacePanning = !0, this.keyPanSpeed = 7, this.zoomToCursor = !1, this.autoRotate = !1, this.autoRotateSpeed = 2, this.keys = { LEFT: "ArrowLeft", UP: "ArrowUp", RIGHT: "ArrowRight", BOTTOM: "ArrowDown" }, this.mouseButtons = { LEFT: gt.ROTATE, MIDDLE: gt.DOLLY, RIGHT: gt.PAN }, this.touches = { ONE: ft.ROTATE, TWO: ft.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this._lastPosition = new P(), this._lastQuaternion = new Ce(), this._lastTargetPosition = new P(), this._quat = new Ce().setFromUnitVectors(e.up, new P(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new Ui(), this._sphericalDelta = new Ui(), this._scale = 1, this._panOffset = new P(), this._rotateStart = new pe(), this._rotateEnd = new pe(), this._rotateDelta = new pe(), this._panStart = new pe(), this._panEnd = new pe(), this._panDelta = new pe(), this._dollyStart = new pe(), this._dollyEnd = new pe(), this._dollyDelta = new pe(), this._dollyDirection = new P(), this._mouse = new pe(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = Kr.bind(this), this._onPointerDown = qr.bind(this), this._onPointerUp = Qr.bind(this), this._onContextMenu = ao.bind(this), this._onMouseWheel = to.bind(this), this._onKeyDown = io.bind(this), this._onTouchStart = so.bind(this), this._onTouchMove = no.bind(this), this._onMouseDown = Jr.bind(this), this._onMouseMove = eo.bind(this), this._interceptControlDown = ro.bind(this), this._interceptControlUp = oo.bind(this), this.domElement !== null && this.connect(), this.update();
4244
4260
  }
4245
4261
  connect() {
4246
4262
  this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointercancel", this._onPointerUp), this.domElement.addEventListener("contextmenu", this._onContextMenu), this.domElement.addEventListener("wheel", this._onMouseWheel, { passive: !1 }), this.domElement.getRootNode().addEventListener("keydown", this._interceptControlDown, { passive: !0, capture: !0 }), this.domElement.style.touchAction = "none";
@@ -4277,35 +4293,35 @@ class Xr extends pn {
4277
4293
  oe.copy(t).sub(this.target), oe.applyQuaternion(this._quat), this._spherical.setFromVector3(oe), this.autoRotate && this.state === Z.NONE && this._rotateLeft(this._getAutoRotationAngle(e)), this.enableDamping ? (this._spherical.theta += this._sphericalDelta.theta * this.dampingFactor, this._spherical.phi += this._sphericalDelta.phi * this.dampingFactor) : (this._spherical.theta += this._sphericalDelta.theta, this._spherical.phi += this._sphericalDelta.phi);
4278
4294
  let s = this.minAzimuthAngle, n = this.maxAzimuthAngle;
4279
4295
  isFinite(s) && isFinite(n) && (s < -Math.PI ? s += ye : s > Math.PI && (s -= ye), n < -Math.PI ? n += ye : n > Math.PI && (n -= ye), s <= n ? this._spherical.theta = Math.max(s, Math.min(n, this._spherical.theta)) : this._spherical.theta = this._spherical.theta > (s + n) / 2 ? Math.max(s, this._spherical.theta) : Math.min(n, this._spherical.theta)), this._spherical.phi = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, this._spherical.phi)), this._spherical.makeSafe(), this.enableDamping === !0 ? this.target.addScaledVector(this._panOffset, this.dampingFactor) : this.target.add(this._panOffset), this.target.sub(this.cursor), this.target.clampLength(this.minTargetRadius, this.maxTargetRadius), this.target.add(this.cursor);
4280
- let a = !1;
4296
+ let r = !1;
4281
4297
  if (this.zoomToCursor && this._performCursorZoom || this.object.isOrthographicCamera)
4282
4298
  this._spherical.radius = this._clampDistance(this._spherical.radius);
4283
4299
  else {
4284
- const r = this._spherical.radius;
4285
- this._spherical.radius = this._clampDistance(this._spherical.radius * this._scale), a = r != this._spherical.radius;
4300
+ const a = this._spherical.radius;
4301
+ this._spherical.radius = this._clampDistance(this._spherical.radius * this._scale), r = a != this._spherical.radius;
4286
4302
  }
4287
4303
  if (oe.setFromSpherical(this._spherical), oe.applyQuaternion(this._quatInverse), t.copy(this.target).add(oe), this.object.lookAt(this.target), this.enableDamping === !0 ? (this._sphericalDelta.theta *= 1 - this.dampingFactor, this._sphericalDelta.phi *= 1 - this.dampingFactor, this._panOffset.multiplyScalar(1 - this.dampingFactor)) : (this._sphericalDelta.set(0, 0, 0), this._panOffset.set(0, 0, 0)), this.zoomToCursor && this._performCursorZoom) {
4288
- let r = null;
4304
+ let a = null;
4289
4305
  if (this.object.isPerspectiveCamera) {
4290
4306
  const o = oe.length();
4291
- r = this._clampDistance(o * this._scale);
4292
- const c = o - r;
4293
- this.object.position.addScaledVector(this._dollyDirection, c), this.object.updateMatrixWorld(), a = !!c;
4307
+ a = this._clampDistance(o * this._scale);
4308
+ const c = o - a;
4309
+ this.object.position.addScaledVector(this._dollyDirection, c), this.object.updateMatrixWorld(), r = !!c;
4294
4310
  } else if (this.object.isOrthographicCamera) {
4295
4311
  const o = new P(this._mouse.x, this._mouse.y, 0);
4296
4312
  o.unproject(this.object);
4297
4313
  const c = this.object.zoom;
4298
- this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), this.object.updateProjectionMatrix(), a = c !== this.object.zoom;
4314
+ this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), this.object.updateProjectionMatrix(), r = c !== this.object.zoom;
4299
4315
  const l = new P(this._mouse.x, this._mouse.y, 0);
4300
- l.unproject(this.object), this.object.position.sub(l).add(o), this.object.updateMatrixWorld(), r = oe.length();
4316
+ l.unproject(this.object), this.object.position.sub(l).add(o), this.object.updateMatrixWorld(), a = oe.length();
4301
4317
  } else
4302
4318
  console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), this.zoomToCursor = !1;
4303
- r !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(r).add(this.object.position) : (Wt.origin.copy(this.object.position), Wt.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(Wt.direction)) < Gr ? this.object.lookAt(this.target) : (As.setFromNormalAndCoplanarPoint(this.object.up, this.target), Wt.intersectPlane(As, this.target))));
4319
+ a !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(a).add(this.object.position) : (Wt.origin.copy(this.object.position), Wt.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(Wt.direction)) < Xr ? this.object.lookAt(this.target) : (As.setFromNormalAndCoplanarPoint(this.object.up, this.target), Wt.intersectPlane(As, this.target))));
4304
4320
  } else if (this.object.isOrthographicCamera) {
4305
- const r = this.object.zoom;
4306
- this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), r !== this.object.zoom && (this.object.updateProjectionMatrix(), a = !0);
4321
+ const a = this.object.zoom;
4322
+ this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), a !== this.object.zoom && (this.object.updateProjectionMatrix(), r = !0);
4307
4323
  }
4308
- return this._scale = 1, this._performCursorZoom = !1, a || this._lastPosition.distanceToSquared(this.object.position) > wi || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > wi || this._lastTargetPosition.distanceToSquared(this.target) > wi ? (this.dispatchEvent(Ps), this._lastPosition.copy(this.object.position), this._lastQuaternion.copy(this.object.quaternion), this._lastTargetPosition.copy(this.target), !0) : !1;
4324
+ return this._scale = 1, this._performCursorZoom = !1, r || this._lastPosition.distanceToSquared(this.object.position) > wi || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > wi || this._lastTargetPosition.distanceToSquared(this.target) > wi ? (this.dispatchEvent(Ps), this._lastPosition.copy(this.object.position), this._lastQuaternion.copy(this.object.quaternion), this._lastTargetPosition.copy(this.target), !0) : !1;
4309
4325
  }
4310
4326
  _getAutoRotationAngle(e) {
4311
4327
  return e !== null ? ye / 60 * this.autoRotateSpeed * e : ye / 60 / 60 * this.autoRotateSpeed;
@@ -4332,8 +4348,8 @@ class Xr extends pn {
4332
4348
  if (this.object.isPerspectiveCamera) {
4333
4349
  const n = this.object.position;
4334
4350
  oe.copy(n).sub(this.target);
4335
- let a = oe.length();
4336
- a *= Math.tan(this.object.fov / 2 * Math.PI / 180), this._panLeft(2 * e * a / s.clientHeight, this.object.matrix), this._panUp(2 * t * a / s.clientHeight, this.object.matrix);
4351
+ let r = oe.length();
4352
+ r *= Math.tan(this.object.fov / 2 * Math.PI / 180), this._panLeft(2 * e * r / s.clientHeight, this.object.matrix), this._panUp(2 * t * r / s.clientHeight, this.object.matrix);
4337
4353
  } else
4338
4354
  this.object.isOrthographicCamera ? (this._panLeft(e * (this.object.right - this.object.left) / this.object.zoom / s.clientWidth, this.object.matrix), this._panUp(t * (this.object.top - this.object.bottom) / this.object.zoom / s.clientHeight, this.object.matrix)) : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."), this.enablePan = !1);
4339
4355
  }
@@ -4347,8 +4363,8 @@ class Xr extends pn {
4347
4363
  if (!this.zoomToCursor)
4348
4364
  return;
4349
4365
  this._performCursorZoom = !0;
4350
- const s = this.domElement.getBoundingClientRect(), n = e - s.left, a = t - s.top, r = s.width, o = s.height;
4351
- this._mouse.x = n / r * 2 - 1, this._mouse.y = -(a / o) * 2 + 1, this._dollyDirection.set(this._mouse.x, this._mouse.y, 1).unproject(this.object).sub(this.object.position).normalize();
4366
+ const s = this.domElement.getBoundingClientRect(), n = e - s.left, r = t - s.top, a = s.width, o = s.height;
4367
+ this._mouse.x = n / a * 2 - 1, this._mouse.y = -(r / o) * 2 + 1, this._dollyDirection.set(this._mouse.x, this._mouse.y, 1).unproject(this.object).sub(this.object.position).normalize();
4352
4368
  }
4353
4369
  _clampDistance(e) {
4354
4370
  return Math.max(this.minDistance, Math.min(this.maxDistance, e));
@@ -4414,8 +4430,8 @@ class Xr extends pn {
4414
4430
  }
4415
4431
  }
4416
4432
  _handleTouchStartDolly(e) {
4417
- const t = this._getSecondPointerPosition(e), s = e.pageX - t.x, n = e.pageY - t.y, a = Math.sqrt(s * s + n * n);
4418
- this._dollyStart.set(0, a);
4433
+ const t = this._getSecondPointerPosition(e), s = e.pageX - t.x, n = e.pageY - t.y, r = Math.sqrt(s * s + n * n);
4434
+ this._dollyStart.set(0, r);
4419
4435
  }
4420
4436
  _handleTouchStartDollyPan(e) {
4421
4437
  this.enableZoom && this._handleTouchStartDolly(e), this.enablePan && this._handleTouchStartPan(e);
@@ -4427,8 +4443,8 @@ class Xr extends pn {
4427
4443
  if (this._pointers.length == 1)
4428
4444
  this._rotateEnd.set(e.pageX, e.pageY);
4429
4445
  else {
4430
- const s = this._getSecondPointerPosition(e), n = 0.5 * (e.pageX + s.x), a = 0.5 * (e.pageY + s.y);
4431
- this._rotateEnd.set(n, a);
4446
+ const s = this._getSecondPointerPosition(e), n = 0.5 * (e.pageX + s.x), r = 0.5 * (e.pageY + s.y);
4447
+ this._rotateEnd.set(n, r);
4432
4448
  }
4433
4449
  this._rotateDelta.subVectors(this._rotateEnd, this._rotateStart).multiplyScalar(this.rotateSpeed);
4434
4450
  const t = this.domElement;
@@ -4444,10 +4460,10 @@ class Xr extends pn {
4444
4460
  this._panDelta.subVectors(this._panEnd, this._panStart).multiplyScalar(this.panSpeed), this._pan(this._panDelta.x, this._panDelta.y), this._panStart.copy(this._panEnd);
4445
4461
  }
4446
4462
  _handleTouchMoveDolly(e) {
4447
- const t = this._getSecondPointerPosition(e), s = e.pageX - t.x, n = e.pageY - t.y, a = Math.sqrt(s * s + n * n);
4448
- this._dollyEnd.set(0, a), this._dollyDelta.set(0, Math.pow(this._dollyEnd.y / this._dollyStart.y, this.zoomSpeed)), this._dollyOut(this._dollyDelta.y), this._dollyStart.copy(this._dollyEnd);
4449
- const r = (e.pageX + t.x) * 0.5, o = (e.pageY + t.y) * 0.5;
4450
- this._updateZoomParameters(r, o);
4463
+ const t = this._getSecondPointerPosition(e), s = e.pageX - t.x, n = e.pageY - t.y, r = Math.sqrt(s * s + n * n);
4464
+ this._dollyEnd.set(0, r), this._dollyDelta.set(0, Math.pow(this._dollyEnd.y / this._dollyStart.y, this.zoomSpeed)), this._dollyOut(this._dollyDelta.y), this._dollyStart.copy(this._dollyEnd);
4465
+ const a = (e.pageX + t.x) * 0.5, o = (e.pageY + t.y) * 0.5;
4466
+ this._updateZoomParameters(a, o);
4451
4467
  }
4452
4468
  _handleTouchMoveDollyPan(e) {
4453
4469
  this.enableZoom && this._handleTouchMoveDolly(e), this.enablePan && this._handleTouchMovePan(e);
@@ -4499,13 +4515,13 @@ class Xr extends pn {
4499
4515
  return e.ctrlKey && !this._controlActive && (s.deltaY *= 10), s;
4500
4516
  }
4501
4517
  }
4502
- function $r(i) {
4518
+ function qr(i) {
4503
4519
  this.enabled !== !1 && (this._pointers.length === 0 && (this.domElement.setPointerCapture(i.pointerId), this.domElement.addEventListener("pointermove", this._onPointerMove), this.domElement.addEventListener("pointerup", this._onPointerUp)), !this._isTrackingPointer(i) && (this._addPointer(i), i.pointerType === "touch" ? this._onTouchStart(i) : this._onMouseDown(i)));
4504
4520
  }
4505
- function qr(i) {
4521
+ function Kr(i) {
4506
4522
  this.enabled !== !1 && (i.pointerType === "touch" ? this._onTouchMove(i) : this._onMouseMove(i));
4507
4523
  }
4508
- function Kr(i) {
4524
+ function Qr(i) {
4509
4525
  switch (this._removePointer(i), this._pointers.length) {
4510
4526
  case 0:
4511
4527
  this.domElement.releasePointerCapture(i.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(Tn), this.state = Z.NONE;
@@ -4516,7 +4532,7 @@ function Kr(i) {
4516
4532
  break;
4517
4533
  }
4518
4534
  }
4519
- function Qr(i) {
4535
+ function Jr(i) {
4520
4536
  let e;
4521
4537
  switch (i.button) {
4522
4538
  case 0:
@@ -4564,7 +4580,7 @@ function Qr(i) {
4564
4580
  }
4565
4581
  this.state !== Z.NONE && this.dispatchEvent(qi);
4566
4582
  }
4567
- function Jr(i) {
4583
+ function eo(i) {
4568
4584
  switch (this.state) {
4569
4585
  case Z.ROTATE:
4570
4586
  if (this.enableRotate === !1)
@@ -4583,13 +4599,13 @@ function Jr(i) {
4583
4599
  break;
4584
4600
  }
4585
4601
  }
4586
- function eo(i) {
4602
+ function to(i) {
4587
4603
  this.enabled === !1 || this.enableZoom === !1 || this.state !== Z.NONE || (i.preventDefault(), this.dispatchEvent(qi), this._handleMouseWheel(this._customWheelEvent(i)), this.dispatchEvent(Tn));
4588
4604
  }
4589
- function to(i) {
4605
+ function io(i) {
4590
4606
  this.enabled === !1 || this.enablePan === !1 || this._handleKeyDown(i);
4591
4607
  }
4592
- function io(i) {
4608
+ function so(i) {
4593
4609
  switch (this._trackPointer(i), this._pointers.length) {
4594
4610
  case 1:
4595
4611
  switch (this.touches.ONE) {
@@ -4628,7 +4644,7 @@ function io(i) {
4628
4644
  }
4629
4645
  this.state !== Z.NONE && this.dispatchEvent(qi);
4630
4646
  }
4631
- function so(i) {
4647
+ function no(i) {
4632
4648
  switch (this._trackPointer(i), this.state) {
4633
4649
  case Z.TOUCH_ROTATE:
4634
4650
  if (this.enableRotate === !1)
@@ -4654,13 +4670,13 @@ function so(i) {
4654
4670
  this.state = Z.NONE;
4655
4671
  }
4656
4672
  }
4657
- function no(i) {
4673
+ function ao(i) {
4658
4674
  this.enabled !== !1 && i.preventDefault();
4659
4675
  }
4660
- function ao(i) {
4676
+ function ro(i) {
4661
4677
  i.key === "Control" && (this._controlActive = !0, this.domElement.getRootNode().addEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
4662
4678
  }
4663
- function ro(i) {
4679
+ function oo(i) {
4664
4680
  i.key === "Control" && (this._controlActive = !1, this.domElement.getRootNode().removeEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
4665
4681
  }
4666
4682
  /*!
@@ -4721,20 +4737,20 @@ function Ot(i) {
4721
4737
  function Tt(i) {
4722
4738
  return Math.abs(i) < Number.MAX_VALUE ? i : i * (1 / 0);
4723
4739
  }
4724
- function Gt(i, e, t, s, n = 1 / 0, a) {
4740
+ function Gt(i, e, t, s, n = 1 / 0, r) {
4725
4741
  s = Math.max(1e-4, s);
4726
- const r = 2 / s, o = r * a, c = 1 / (1 + o + 0.48 * o * o + 0.235 * o * o * o);
4742
+ const a = 2 / s, o = a * r, c = 1 / (1 + o + 0.48 * o * o + 0.235 * o * o * o);
4727
4743
  let l = i - e;
4728
4744
  const d = e, p = n * s;
4729
4745
  l = Me(l, -p, p), e = i - l;
4730
- const m = (t.value + r * l) * a;
4731
- t.value = (t.value - r * m) * c;
4746
+ const m = (t.value + a * l) * r;
4747
+ t.value = (t.value - a * m) * c;
4732
4748
  let f = e + (l + m) * c;
4733
- return d - i > 0 == f > d && (f = d, t.value = (f - d) / a), f;
4749
+ return d - i > 0 == f > d && (f = d, t.value = (f - d) / r), f;
4734
4750
  }
4735
- function Is(i, e, t, s, n = 1 / 0, a, r) {
4751
+ function Is(i, e, t, s, n = 1 / 0, r, a) {
4736
4752
  s = Math.max(1e-4, s);
4737
- const o = 2 / s, c = o * a, l = 1 / (1 + c + 0.48 * c * c + 0.235 * c * c * c);
4753
+ const o = 2 / s, c = o * r, l = 1 / (1 + c + 0.48 * c * c + 0.235 * c * c * c);
4738
4754
  let d = e.x, p = e.y, m = e.z, f = i.x - d, E = i.y - p, v = i.z - m;
4739
4755
  const x = d, g = p, y = m, C = n * s, w = C * C, S = f * f + E * E + v * v;
4740
4756
  if (S > w) {
@@ -4742,10 +4758,10 @@ function Is(i, e, t, s, n = 1 / 0, a, r) {
4742
4758
  f = f / $ * C, E = E / $ * C, v = v / $ * C;
4743
4759
  }
4744
4760
  d = i.x - f, p = i.y - E, m = i.z - v;
4745
- const O = (t.x + o * f) * a, I = (t.y + o * E) * a, U = (t.z + o * v) * a;
4746
- t.x = (t.x - o * O) * l, t.y = (t.y - o * I) * l, t.z = (t.z - o * U) * l, r.x = d + (f + O) * l, r.y = p + (E + I) * l, r.z = m + (v + U) * l;
4747
- const R = x - i.x, V = g - i.y, we = y - i.z, _e = r.x - x, re = r.y - g, K = r.z - y;
4748
- return R * _e + V * re + we * K > 0 && (r.x = x, r.y = g, r.z = y, t.x = (r.x - x) / a, t.y = (r.y - g) / a, t.z = (r.z - y) / a), r;
4761
+ const O = (t.x + o * f) * r, I = (t.y + o * E) * r, U = (t.z + o * v) * r;
4762
+ t.x = (t.x - o * O) * l, t.y = (t.y - o * I) * l, t.z = (t.z - o * U) * l, a.x = d + (f + O) * l, a.y = p + (E + I) * l, a.z = m + (v + U) * l;
4763
+ const R = x - i.x, V = g - i.y, we = y - i.z, _e = a.x - x, re = a.y - g, K = a.z - y;
4764
+ return R * _e + V * re + we * K > 0 && (a.x = x, a.y = g, a.z = y, t.x = (a.x - x) / r, t.y = (a.y - g) / r, t.z = (a.z - y) / r), a;
4749
4765
  }
4750
4766
  function Si(i, e) {
4751
4767
  e.set(0, 0), i.forEach((t) => {
@@ -4755,7 +4771,7 @@ function Si(i, e) {
4755
4771
  function xi(i, e) {
4756
4772
  return Be(i) ? (console.warn(`${e} is not supported in OrthographicCamera`), !0) : !1;
4757
4773
  }
4758
- class oo {
4774
+ class lo {
4759
4775
  constructor() {
4760
4776
  this._listeners = {};
4761
4777
  }
@@ -4788,8 +4804,8 @@ class oo {
4788
4804
  removeEventListener(e, t) {
4789
4805
  const n = this._listeners[e];
4790
4806
  if (n !== void 0) {
4791
- const a = n.indexOf(t);
4792
- a !== -1 && n.splice(a, 1);
4807
+ const r = n.indexOf(t);
4808
+ r !== -1 && n.splice(r, 1);
4793
4809
  }
4794
4810
  }
4795
4811
  /**
@@ -4814,15 +4830,15 @@ class oo {
4814
4830
  if (s !== void 0) {
4815
4831
  e.target = this;
4816
4832
  const n = s.slice(0);
4817
- for (let a = 0, r = n.length; a < r; a++)
4818
- n[a].call(this, e);
4833
+ for (let r = 0, a = n.length; r < a; r++)
4834
+ n[r].call(this, e);
4819
4835
  }
4820
4836
  }
4821
4837
  }
4822
4838
  var Oi;
4823
- const lo = "2.9.0", Xt = 1 / 8, co = /Mac/.test((Oi = globalThis?.navigator) === null || Oi === void 0 ? void 0 : Oi.platform);
4839
+ const co = "2.9.0", Xt = 1 / 8, ho = /Mac/.test((Oi = globalThis?.navigator) === null || Oi === void 0 ? void 0 : Oi.platform);
4824
4840
  let L, Ls, $t, Ti, be, j, z, dt, Mt, Ae, De, We, ks, Us, xe, Pt, ut, js, Mi, Ns, Pi, Ai, qt;
4825
- class ke extends oo {
4841
+ class ke extends lo {
4826
4842
  /**
4827
4843
  * Injects THREE as the dependency. You can then proceed to use CameraControls.
4828
4844
  *
@@ -4927,7 +4943,7 @@ class ke extends oo {
4927
4943
  two: Ze(this._camera) ? _.TOUCH_DOLLY_TRUCK : Be(this._camera) ? _.TOUCH_ZOOM_TRUCK : _.NONE,
4928
4944
  three: _.TOUCH_TRUCK
4929
4945
  };
4930
- const s = new L.Vector2(), n = new L.Vector2(), a = new L.Vector2(), r = (g) => {
4946
+ const s = new L.Vector2(), n = new L.Vector2(), r = new L.Vector2(), a = (g) => {
4931
4947
  if (!this._enabled || !this._domElement)
4932
4948
  return;
4933
4949
  if (this._interactiveArea.left !== 0 || this._interactiveArea.top !== 0 || this._interactiveArea.width !== 1 || this._interactiveArea.height !== 1) {
@@ -5007,7 +5023,7 @@ class ke extends oo {
5007
5023
  const O = performance.now();
5008
5024
  l - O < 1e3 && this._getClientRect(this._elementRect), l = O;
5009
5025
  }
5010
- const y = co ? -1 : -3, C = g.deltaMode === 1 ? g.deltaY / y : g.deltaY / (y * 10), w = this.dollyToCursor ? (g.clientX - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, S = this.dollyToCursor ? (g.clientY - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0;
5026
+ const y = ho ? -1 : -3, C = g.deltaMode === 1 ? g.deltaY / y : g.deltaY / (y * 10), w = this.dollyToCursor ? (g.clientX - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, S = this.dollyToCursor ? (g.clientY - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0;
5011
5027
  switch (this.mouseButtons.wheel) {
5012
5028
  case _.ROTATE: {
5013
5029
  this._rotateInternal(g.deltaX, g.deltaY), this._isUserControllingRotate = !0;
@@ -5045,7 +5061,7 @@ class ke extends oo {
5045
5061
  return;
5046
5062
  if (Si(this._activePointers, be), this._getClientRect(this._elementRect), s.copy(be), n.copy(be), this._activePointers.length >= 2) {
5047
5063
  const C = be.x - this._activePointers[1].clientX, w = be.y - this._activePointers[1].clientY, S = Math.sqrt(C * C + w * w);
5048
- a.set(0, S);
5064
+ r.set(0, S);
5049
5065
  const O = (this._activePointers[0].clientX + this._activePointers[1].clientX) * 0.5, I = (this._activePointers[0].clientY + this._activePointers[1].clientY) * 0.5;
5050
5066
  n.set(O, I);
5051
5067
  }
@@ -5076,8 +5092,8 @@ class ke extends oo {
5076
5092
  (this._state & _.DOLLY) === _.DOLLY ? (this._dollyInternal(I * w * Xt, S, O), this._isUserControllingDolly = !0) : (this._zoomInternal(I * w * Xt, S, O), this._isUserControllingZoom = !0);
5077
5093
  }
5078
5094
  if ((this._state & _.TOUCH_DOLLY) === _.TOUCH_DOLLY || (this._state & _.TOUCH_ZOOM) === _.TOUCH_ZOOM || (this._state & _.TOUCH_DOLLY_TRUCK) === _.TOUCH_DOLLY_TRUCK || (this._state & _.TOUCH_ZOOM_TRUCK) === _.TOUCH_ZOOM_TRUCK || (this._state & _.TOUCH_DOLLY_OFFSET) === _.TOUCH_DOLLY_OFFSET || (this._state & _.TOUCH_ZOOM_OFFSET) === _.TOUCH_ZOOM_OFFSET || (this._state & _.TOUCH_DOLLY_ROTATE) === _.TOUCH_DOLLY_ROTATE || (this._state & _.TOUCH_ZOOM_ROTATE) === _.TOUCH_ZOOM_ROTATE) {
5079
- const S = be.x - this._activePointers[1].clientX, O = be.y - this._activePointers[1].clientY, I = Math.sqrt(S * S + O * O), U = a.y - I;
5080
- a.set(0, I);
5095
+ const S = be.x - this._activePointers[1].clientX, O = be.y - this._activePointers[1].clientY, I = Math.sqrt(S * S + O * O), U = r.y - I;
5096
+ r.set(0, I);
5081
5097
  const R = this.dollyToCursor ? (n.x - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, V = this.dollyToCursor ? (n.y - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0;
5082
5098
  (this._state & _.TOUCH_DOLLY) === _.TOUCH_DOLLY || (this._state & _.TOUCH_DOLLY_ROTATE) === _.TOUCH_DOLLY_ROTATE || (this._state & _.TOUCH_DOLLY_TRUCK) === _.TOUCH_DOLLY_TRUCK || (this._state & _.TOUCH_DOLLY_OFFSET) === _.TOUCH_DOLLY_OFFSET ? (this._dollyInternal(U * Xt, R, V), this._isUserControllingDolly = !0) : (this._zoomInternal(U * Xt, R, V), this._isUserControllingZoom = !0);
5083
5099
  }
@@ -5104,9 +5120,9 @@ class ke extends oo {
5104
5120
  this.unlockPointer();
5105
5121
  };
5106
5122
  this._addAllEventListeners = (g) => {
5107
- this._domElement = g, this._domElement.style.touchAction = "none", this._domElement.style.userSelect = "none", this._domElement.style.webkitUserSelect = "none", this._domElement.addEventListener("pointerdown", r), this._domElement.addEventListener("pointercancel", c), this._domElement.addEventListener("wheel", d, { passive: !1 }), this._domElement.addEventListener("contextmenu", p);
5123
+ this._domElement = g, this._domElement.style.touchAction = "none", this._domElement.style.userSelect = "none", this._domElement.style.webkitUserSelect = "none", this._domElement.addEventListener("pointerdown", a), this._domElement.addEventListener("pointercancel", c), this._domElement.addEventListener("wheel", d, { passive: !1 }), this._domElement.addEventListener("contextmenu", p);
5108
5124
  }, this._removeAllEventListeners = () => {
5109
- this._domElement && (this._domElement.style.touchAction = "", this._domElement.style.userSelect = "", this._domElement.style.webkitUserSelect = "", this._domElement.removeEventListener("pointerdown", r), this._domElement.removeEventListener("pointercancel", c), this._domElement.removeEventListener("wheel", d, { passive: !1 }), this._domElement.removeEventListener("contextmenu", p), this._domElement.ownerDocument.removeEventListener("pointermove", o, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("pointerup", c), this._domElement.ownerDocument.removeEventListener("pointerlockchange", v), this._domElement.ownerDocument.removeEventListener("pointerlockerror", x));
5125
+ this._domElement && (this._domElement.style.touchAction = "", this._domElement.style.userSelect = "", this._domElement.style.webkitUserSelect = "", this._domElement.removeEventListener("pointerdown", a), this._domElement.removeEventListener("pointercancel", c), this._domElement.removeEventListener("wheel", d, { passive: !1 }), this._domElement.removeEventListener("contextmenu", p), this._domElement.ownerDocument.removeEventListener("pointermove", o, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("pointerup", c), this._domElement.ownerDocument.removeEventListener("pointerlockchange", v), this._domElement.ownerDocument.removeEventListener("pointerlockerror", x));
5110
5126
  }, this.cancel = () => {
5111
5127
  this._state !== _.NONE && (this._state = _.NONE, this._activePointers.length = 0, E());
5112
5128
  }, t && this.connect(t), this.update(0);
@@ -5320,10 +5336,10 @@ class ke extends oo {
5320
5336
  */
5321
5337
  rotateTo(e, t, s = !1) {
5322
5338
  this._isUserControllingRotate = !1;
5323
- const n = Me(e, this.minAzimuthAngle, this.maxAzimuthAngle), a = Me(t, this.minPolarAngle, this.maxPolarAngle);
5324
- this._sphericalEnd.theta = n, this._sphericalEnd.phi = a, this._sphericalEnd.makeSafe(), this._needsUpdate = !0, s || (this._spherical.theta = this._sphericalEnd.theta, this._spherical.phi = this._sphericalEnd.phi);
5325
- const r = !s || Y(this._spherical.theta, this._sphericalEnd.theta, this.restThreshold) && Y(this._spherical.phi, this._sphericalEnd.phi, this.restThreshold);
5326
- return this._createOnRestPromise(r);
5339
+ const n = Me(e, this.minAzimuthAngle, this.maxAzimuthAngle), r = Me(t, this.minPolarAngle, this.maxPolarAngle);
5340
+ this._sphericalEnd.theta = n, this._sphericalEnd.phi = r, this._sphericalEnd.makeSafe(), this._needsUpdate = !0, s || (this._spherical.theta = this._sphericalEnd.theta, this._spherical.phi = this._sphericalEnd.phi);
5341
+ const a = !s || Y(this._spherical.theta, this._sphericalEnd.theta, this.restThreshold) && Y(this._spherical.phi, this._sphericalEnd.phi, this.restThreshold);
5342
+ return this._createOnRestPromise(a);
5327
5343
  }
5328
5344
  /**
5329
5345
  * Dolly in/out camera position.
@@ -5346,15 +5362,15 @@ class ke extends oo {
5346
5362
  _dollyToNoClamp(e, t = !1) {
5347
5363
  const s = this._sphericalEnd.radius;
5348
5364
  if (this.colliderMeshes.length >= 1) {
5349
- const r = this._collisionTest(), o = Y(r, this._spherical.radius);
5365
+ const a = this._collisionTest(), o = Y(a, this._spherical.radius);
5350
5366
  if (!(s > e) && o)
5351
5367
  return Promise.resolve();
5352
- this._sphericalEnd.radius = Math.min(e, r);
5368
+ this._sphericalEnd.radius = Math.min(e, a);
5353
5369
  } else
5354
5370
  this._sphericalEnd.radius = e;
5355
5371
  this._needsUpdate = !0, t || (this._spherical.radius = this._sphericalEnd.radius);
5356
- const a = !t || Y(this._spherical.radius, this._sphericalEnd.radius, this.restThreshold);
5357
- return this._createOnRestPromise(a);
5372
+ const r = !t || Y(this._spherical.radius, this._sphericalEnd.radius, this.restThreshold);
5373
+ return this._createOnRestPromise(r);
5358
5374
  }
5359
5375
  /**
5360
5376
  * Dolly in, but does not change the distance between the target and the camera, and moves the target position instead.
@@ -5406,8 +5422,8 @@ class ke extends oo {
5406
5422
  */
5407
5423
  truck(e, t, s = !1) {
5408
5424
  this._camera.updateMatrix(), Ae.setFromMatrixColumn(this._camera.matrix, 0), De.setFromMatrixColumn(this._camera.matrix, 1), Ae.multiplyScalar(e), De.multiplyScalar(-t);
5409
- const n = j.copy(Ae).add(De), a = z.copy(this._targetEnd).add(n);
5410
- return this.moveTo(a.x, a.y, a.z, s);
5425
+ const n = j.copy(Ae).add(De), r = z.copy(this._targetEnd).add(n);
5426
+ return this.moveTo(r.x, r.y, r.z, s);
5411
5427
  }
5412
5428
  /**
5413
5429
  * Move forward / backward.
@@ -5439,10 +5455,10 @@ class ke extends oo {
5439
5455
  */
5440
5456
  moveTo(e, t, s, n = !1) {
5441
5457
  this._isUserControllingTruck = !1;
5442
- const a = j.set(e, t, s).sub(this._targetEnd);
5443
- this._encloseToBoundary(this._targetEnd, a, this.boundaryFriction), this._needsUpdate = !0, n || this._target.copy(this._targetEnd);
5444
- const r = !n || Y(this._target.x, this._targetEnd.x, this.restThreshold) && Y(this._target.y, this._targetEnd.y, this.restThreshold) && Y(this._target.z, this._targetEnd.z, this.restThreshold);
5445
- return this._createOnRestPromise(r);
5458
+ const r = j.set(e, t, s).sub(this._targetEnd);
5459
+ this._encloseToBoundary(this._targetEnd, r, this.boundaryFriction), this._needsUpdate = !0, n || this._target.copy(this._targetEnd);
5460
+ const a = !n || Y(this._target.x, this._targetEnd.x, this.restThreshold) && Y(this._target.y, this._targetEnd.y, this.restThreshold) && Y(this._target.z, this._targetEnd.z, this.restThreshold);
5461
+ return this._createOnRestPromise(a);
5446
5462
  }
5447
5463
  /**
5448
5464
  * Look in the given point direction.
@@ -5470,7 +5486,7 @@ class ke extends oo {
5470
5486
  * @returns Transition end promise
5471
5487
  * @category Methods
5472
5488
  */
5473
- fitToBox(e, t, { cover: s = !1, paddingLeft: n = 0, paddingRight: a = 0, paddingBottom: r = 0, paddingTop: o = 0 } = {}) {
5489
+ fitToBox(e, t, { cover: s = !1, paddingLeft: n = 0, paddingRight: r = 0, paddingBottom: a = 0, paddingTop: o = 0 } = {}) {
5474
5490
  const c = [], l = e.isBox3 ? ut.copy(e) : ut.setFromObject(e);
5475
5491
  l.isEmpty() && (console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"), Promise.resolve());
5476
5492
  const d = Rs(this._sphericalEnd.theta, Ds), p = Rs(this._sphericalEnd.phi, Ds);
@@ -5478,7 +5494,7 @@ class ke extends oo {
5478
5494
  const m = j.setFromSpherical(this._sphericalEnd).normalize(), f = Ns.setFromUnitVectors(m, Ti), E = Y(Math.abs(m.y), 1);
5479
5495
  E && f.multiply(Pi.setFromAxisAngle($t, d)), f.multiply(this._yAxisUpSpaceInverse);
5480
5496
  const v = js.makeEmpty();
5481
- z.copy(l.min).applyQuaternion(f), v.expandByPoint(z), z.copy(l.min).setX(l.max.x).applyQuaternion(f), v.expandByPoint(z), z.copy(l.min).setY(l.max.y).applyQuaternion(f), v.expandByPoint(z), z.copy(l.max).setZ(l.min.z).applyQuaternion(f), v.expandByPoint(z), z.copy(l.min).setZ(l.max.z).applyQuaternion(f), v.expandByPoint(z), z.copy(l.max).setY(l.min.y).applyQuaternion(f), v.expandByPoint(z), z.copy(l.max).setX(l.min.x).applyQuaternion(f), v.expandByPoint(z), z.copy(l.max).applyQuaternion(f), v.expandByPoint(z), v.min.x -= n, v.min.y -= r, v.max.x += a, v.max.y += o, f.setFromUnitVectors(Ti, m), E && f.premultiply(Pi.invert()), f.premultiply(this._yAxisUpSpace);
5497
+ z.copy(l.min).applyQuaternion(f), v.expandByPoint(z), z.copy(l.min).setX(l.max.x).applyQuaternion(f), v.expandByPoint(z), z.copy(l.min).setY(l.max.y).applyQuaternion(f), v.expandByPoint(z), z.copy(l.max).setZ(l.min.z).applyQuaternion(f), v.expandByPoint(z), z.copy(l.min).setZ(l.max.z).applyQuaternion(f), v.expandByPoint(z), z.copy(l.max).setY(l.min.y).applyQuaternion(f), v.expandByPoint(z), z.copy(l.max).setX(l.min.x).applyQuaternion(f), v.expandByPoint(z), z.copy(l.max).applyQuaternion(f), v.expandByPoint(z), v.min.x -= n, v.min.y -= a, v.max.x += r, v.max.y += o, f.setFromUnitVectors(Ti, m), E && f.premultiply(Pi.invert()), f.premultiply(this._yAxisUpSpace);
5482
5498
  const x = v.getSize(j), g = v.getCenter(z).applyQuaternion(f);
5483
5499
  if (Ze(this._camera)) {
5484
5500
  const y = this.getDistanceToFitBox(x.x, x.y, x.z, s);
@@ -5496,12 +5512,12 @@ class ke extends oo {
5496
5512
  * @category Methods
5497
5513
  */
5498
5514
  fitToSphere(e, t) {
5499
- const s = [], a = "isObject3D" in e ? ke.createBoundingSphere(e, Mi) : Mi.copy(e);
5500
- if (s.push(this.moveTo(a.center.x, a.center.y, a.center.z, t)), Ze(this._camera)) {
5501
- const r = this.getDistanceToFitSphere(a.radius);
5502
- s.push(this.dollyTo(r, t));
5515
+ const s = [], r = "isObject3D" in e ? ke.createBoundingSphere(e, Mi) : Mi.copy(e);
5516
+ if (s.push(this.moveTo(r.center.x, r.center.y, r.center.z, t)), Ze(this._camera)) {
5517
+ const a = this.getDistanceToFitSphere(r.radius);
5518
+ s.push(this.dollyTo(a, t));
5503
5519
  } else if (Be(this._camera)) {
5504
- const r = this._camera.right - this._camera.left, o = this._camera.top - this._camera.bottom, c = 2 * a.radius, l = Math.min(r / c, o / c);
5520
+ const a = this._camera.right - this._camera.left, o = this._camera.top - this._camera.bottom, c = 2 * r.radius, l = Math.min(a / c, o / c);
5505
5521
  s.push(this.zoomTo(l, t));
5506
5522
  }
5507
5523
  return s.push(this.setFocalOffset(0, 0, 0, t)), Promise.all(s);
@@ -5517,9 +5533,9 @@ class ke extends oo {
5517
5533
  * @param enableTransition
5518
5534
  * @category Methods
5519
5535
  */
5520
- setLookAt(e, t, s, n, a, r, o = !1) {
5536
+ setLookAt(e, t, s, n, r, a, o = !1) {
5521
5537
  this._isUserControllingRotate = !1, this._isUserControllingDolly = !1, this._isUserControllingTruck = !1, this._lastDollyDirection = ct.NONE, this._changedDolly = 0;
5522
- const c = z.set(n, a, r), l = j.set(e, t, s);
5538
+ const c = z.set(n, r, a), l = j.set(e, t, s);
5523
5539
  this._targetEnd.copy(c), this._sphericalEnd.setFromVector3(l.sub(c).applyQuaternion(this._yAxisUpSpace)), this.normalizeRotations(), this._needsUpdate = !0, o || (this._target.copy(this._targetEnd), this._spherical.copy(this._sphericalEnd));
5524
5540
  const d = !o || Y(this._target.x, this._targetEnd.x, this.restThreshold) && Y(this._target.y, this._targetEnd.y, this.restThreshold) && Y(this._target.z, this._targetEnd.z, this.restThreshold) && Y(this._spherical.theta, this._sphericalEnd.theta, this.restThreshold) && Y(this._spherical.phi, this._sphericalEnd.phi, this.restThreshold) && Y(this._spherical.radius, this._sphericalEnd.radius, this.restThreshold);
5525
5541
  return this._createOnRestPromise(d);
@@ -5542,9 +5558,9 @@ class ke extends oo {
5542
5558
  * @param enableTransition
5543
5559
  * @category Methods
5544
5560
  */
5545
- lerpLookAt(e, t, s, n, a, r, o, c, l, d, p, m, f, E = !1) {
5561
+ lerpLookAt(e, t, s, n, r, a, o, c, l, d, p, m, f, E = !1) {
5546
5562
  this._isUserControllingRotate = !1, this._isUserControllingDolly = !1, this._isUserControllingTruck = !1, this._lastDollyDirection = ct.NONE, this._changedDolly = 0;
5547
- const v = j.set(n, a, r), x = z.set(e, t, s);
5563
+ const v = j.set(n, r, a), x = z.set(e, t, s);
5548
5564
  xe.setFromVector3(x.sub(v).applyQuaternion(this._yAxisUpSpace));
5549
5565
  const g = dt.set(d, p, m), y = z.set(o, c, l);
5550
5566
  Pt.setFromVector3(y.sub(g).applyQuaternion(this._yAxisUpSpace)), this._targetEnd.copy(v.lerp(g, f));
@@ -5575,8 +5591,8 @@ class ke extends oo {
5575
5591
  * @category Methods
5576
5592
  */
5577
5593
  setTarget(e, t, s, n = !1) {
5578
- const a = this.getPosition(j), r = this.setLookAt(a.x, a.y, a.z, e, t, s, n);
5579
- return this._sphericalEnd.phi = Me(this._sphericalEnd.phi, this.minPolarAngle, this.maxPolarAngle), r;
5594
+ const r = this.getPosition(j), a = this.setLookAt(r.x, r.y, r.z, e, t, s, n);
5595
+ return this._sphericalEnd.phi = Me(this._sphericalEnd.phi, this.minPolarAngle, this.maxPolarAngle), a;
5580
5596
  }
5581
5597
  /**
5582
5598
  * Set focal offset using the screen parallel coordinates. z doesn't affect in Orthographic as with Dolly.
@@ -5588,8 +5604,8 @@ class ke extends oo {
5588
5604
  */
5589
5605
  setFocalOffset(e, t, s, n = !1) {
5590
5606
  this._isUserControllingOffset = !1, this._focalOffsetEnd.set(e, t, s), this._needsUpdate = !0, n || this._focalOffset.copy(this._focalOffsetEnd);
5591
- const a = !n || Y(this._focalOffset.x, this._focalOffsetEnd.x, this.restThreshold) && Y(this._focalOffset.y, this._focalOffsetEnd.y, this.restThreshold) && Y(this._focalOffset.z, this._focalOffsetEnd.z, this.restThreshold);
5592
- return this._createOnRestPromise(a);
5607
+ const r = !n || Y(this._focalOffset.x, this._focalOffsetEnd.x, this.restThreshold) && Y(this._focalOffset.y, this._focalOffsetEnd.y, this.restThreshold) && Y(this._focalOffset.z, this._focalOffsetEnd.z, this.restThreshold);
5608
+ return this._createOnRestPromise(r);
5593
5609
  }
5594
5610
  /**
5595
5611
  * Set orbit point without moving the camera.
@@ -5601,8 +5617,8 @@ class ke extends oo {
5601
5617
  */
5602
5618
  setOrbitPoint(e, t, s) {
5603
5619
  this._camera.updateMatrixWorld(), Ae.setFromMatrixColumn(this._camera.matrixWorldInverse, 0), De.setFromMatrixColumn(this._camera.matrixWorldInverse, 1), We.setFromMatrixColumn(this._camera.matrixWorldInverse, 2);
5604
- const n = j.set(e, t, s), a = n.distanceTo(this._camera.position), r = n.sub(this._camera.position);
5605
- Ae.multiplyScalar(r.x), De.multiplyScalar(r.y), We.multiplyScalar(r.z), j.copy(Ae).add(De).add(We), j.z = j.z + a, this.dollyTo(a, !1), this.setFocalOffset(-j.x, j.y, -j.z, !1), this.moveTo(e, t, s, !1);
5620
+ const n = j.set(e, t, s), r = n.distanceTo(this._camera.position), a = n.sub(this._camera.position);
5621
+ Ae.multiplyScalar(a.x), De.multiplyScalar(a.y), We.multiplyScalar(a.z), j.copy(Ae).add(De).add(We), j.z = j.z + r, this.dollyTo(r, !1), this.setFocalOffset(-j.x, j.y, -j.z, !1), this.moveTo(e, t, s, !1);
5606
5622
  }
5607
5623
  /**
5608
5624
  * Set the boundary box that encloses the target of the camera. box3 is in THREE.Box3
@@ -5643,8 +5659,8 @@ class ke extends oo {
5643
5659
  getDistanceToFitBox(e, t, s, n = !1) {
5644
5660
  if (xi(this._camera, "getDistanceToFitBox"))
5645
5661
  return this._spherical.radius;
5646
- const a = e / t, r = this._camera.getEffectiveFOV() * xt, o = this._camera.aspect;
5647
- return ((n ? a > o : a < o) ? t : e / o) * 0.5 / Math.tan(r * 0.5) + s * 0.5;
5662
+ const r = e / t, a = this._camera.getEffectiveFOV() * xt, o = this._camera.aspect;
5663
+ return ((n ? r > o : r < o) ? t : e / o) * 0.5 / Math.tan(a * 0.5) + s * 0.5;
5648
5664
  }
5649
5665
  /**
5650
5666
  * Calculate the distance to fit the sphere.
@@ -5759,7 +5775,7 @@ class ke extends oo {
5759
5775
  * @category Methods
5760
5776
  */
5761
5777
  update(e) {
5762
- const t = this._sphericalEnd.theta - this._spherical.theta, s = this._sphericalEnd.phi - this._spherical.phi, n = this._sphericalEnd.radius - this._spherical.radius, a = ks.subVectors(this._targetEnd, this._target), r = Us.subVectors(this._focalOffsetEnd, this._focalOffset), o = this._zoomEnd - this._zoom;
5778
+ const t = this._sphericalEnd.theta - this._spherical.theta, s = this._sphericalEnd.phi - this._spherical.phi, n = this._sphericalEnd.radius - this._spherical.radius, r = ks.subVectors(this._targetEnd, this._target), a = Us.subVectors(this._focalOffsetEnd, this._focalOffset), o = this._zoomEnd - this._zoom;
5763
5779
  if (q(t))
5764
5780
  this._thetaVelocity.value = 0, this._spherical.theta = this._sphericalEnd.theta;
5765
5781
  else {
@@ -5778,13 +5794,13 @@ class ke extends oo {
5778
5794
  const p = this._isUserControllingDolly ? this.draggingSmoothTime : this.smoothTime;
5779
5795
  this._spherical.radius = Gt(this._spherical.radius, this._sphericalEnd.radius, this._radiusVelocity, p, this.maxSpeed, e), this._needsUpdate = !0;
5780
5796
  }
5781
- if (q(a.x) && q(a.y) && q(a.z))
5797
+ if (q(r.x) && q(r.y) && q(r.z))
5782
5798
  this._targetVelocity.set(0, 0, 0), this._target.copy(this._targetEnd);
5783
5799
  else {
5784
5800
  const p = this._isUserControllingTruck ? this.draggingSmoothTime : this.smoothTime;
5785
5801
  Is(this._target, this._targetEnd, this._targetVelocity, p, this.maxSpeed, e, this._target), this._needsUpdate = !0;
5786
5802
  }
5787
- if (q(r.x) && q(r.y) && q(r.z))
5803
+ if (q(a.x) && q(a.y) && q(a.z))
5788
5804
  this._focalOffsetVelocity.set(0, 0, 0), this._focalOffset.copy(this._focalOffsetEnd);
5789
5805
  else {
5790
5806
  const p = this._isUserControllingOffset ? this.draggingSmoothTime : this.smoothTime;
@@ -5820,7 +5836,7 @@ class ke extends oo {
5820
5836
  const c = this._collisionTest();
5821
5837
  this._spherical.radius = Math.min(this._spherical.radius, c), this._spherical.makeSafe(), this._camera.position.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(this._target), this._camera.lookAt(this._target), (!q(this._focalOffset.x) || !q(this._focalOffset.y) || !q(this._focalOffset.z)) && (this._camera.updateMatrixWorld(), Ae.setFromMatrixColumn(this._camera.matrix, 0), De.setFromMatrixColumn(this._camera.matrix, 1), We.setFromMatrixColumn(this._camera.matrix, 2), Ae.multiplyScalar(this._focalOffset.x), De.multiplyScalar(-this._focalOffset.y), We.multiplyScalar(this._focalOffset.z), j.copy(Ae).add(De).add(We), this._camera.position.add(j)), this._boundaryEnclosesCamera && this._encloseToBoundary(this._camera.position.copy(this._target), j.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse), 1);
5822
5838
  const d = this._needsUpdate;
5823
- return d && !this._updatedLastTime ? (this._hasRested = !1, this.dispatchEvent({ type: "wake" }), this.dispatchEvent({ type: "update" })) : d ? (this.dispatchEvent({ type: "update" }), q(t, this.restThreshold) && q(s, this.restThreshold) && q(n, this.restThreshold) && q(a.x, this.restThreshold) && q(a.y, this.restThreshold) && q(a.z, this.restThreshold) && q(r.x, this.restThreshold) && q(r.y, this.restThreshold) && q(r.z, this.restThreshold) && q(o, this.restThreshold) && !this._hasRested && (this._hasRested = !0, this.dispatchEvent({ type: "rest" }))) : !d && this._updatedLastTime && this.dispatchEvent({ type: "sleep" }), this._lastDistance = this._spherical.radius, this._lastZoom = this._zoom, this._updatedLastTime = d, this._needsUpdate = !1, d;
5839
+ return d && !this._updatedLastTime ? (this._hasRested = !1, this.dispatchEvent({ type: "wake" }), this.dispatchEvent({ type: "update" })) : d ? (this.dispatchEvent({ type: "update" }), q(t, this.restThreshold) && q(s, this.restThreshold) && q(n, this.restThreshold) && q(r.x, this.restThreshold) && q(r.y, this.restThreshold) && q(r.z, this.restThreshold) && q(a.x, this.restThreshold) && q(a.y, this.restThreshold) && q(a.z, this.restThreshold) && q(o, this.restThreshold) && !this._hasRested && (this._hasRested = !0, this.dispatchEvent({ type: "rest" }))) : !d && this._updatedLastTime && this.dispatchEvent({ type: "sleep" }), this._lastDistance = this._spherical.radius, this._lastZoom = this._zoom, this._updatedLastTime = d, this._needsUpdate = !1, d;
5824
5840
  }
5825
5841
  /**
5826
5842
  * Get all state in JSON string
@@ -5872,7 +5888,7 @@ class ke extends oo {
5872
5888
  console.warn("camera-controls is already connected.");
5873
5889
  return;
5874
5890
  }
5875
- e.setAttribute("data-camera-controls-version", lo), this._addAllEventListeners(e), this._getClientRect(this._elementRect);
5891
+ e.setAttribute("data-camera-controls-version", co), this._addAllEventListeners(e), this._getClientRect(this._elementRect);
5876
5892
  }
5877
5893
  /**
5878
5894
  * Detach all internal event handlers to disable drag control.
@@ -5908,7 +5924,7 @@ class ke extends oo {
5908
5924
  const n = t.lengthSq();
5909
5925
  if (n === 0)
5910
5926
  return e;
5911
- const a = z.copy(t).add(e), o = this._boundary.clampPoint(a, dt).sub(a), c = o.lengthSq();
5927
+ const r = z.copy(t).add(e), o = this._boundary.clampPoint(r, dt).sub(r), c = o.lengthSq();
5912
5928
  if (c === 0)
5913
5929
  return e.add(t);
5914
5930
  if (c === n)
@@ -5922,11 +5938,11 @@ class ke extends oo {
5922
5938
  }
5923
5939
  _updateNearPlaneCorners() {
5924
5940
  if (Ze(this._camera)) {
5925
- const e = this._camera, t = e.near, s = e.getEffectiveFOV() * xt, n = Math.tan(s * 0.5) * t, a = n * e.aspect;
5926
- this._nearPlaneCorners[0].set(-a, -n, 0), this._nearPlaneCorners[1].set(a, -n, 0), this._nearPlaneCorners[2].set(a, n, 0), this._nearPlaneCorners[3].set(-a, n, 0);
5941
+ const e = this._camera, t = e.near, s = e.getEffectiveFOV() * xt, n = Math.tan(s * 0.5) * t, r = n * e.aspect;
5942
+ this._nearPlaneCorners[0].set(-r, -n, 0), this._nearPlaneCorners[1].set(r, -n, 0), this._nearPlaneCorners[2].set(r, n, 0), this._nearPlaneCorners[3].set(-r, n, 0);
5927
5943
  } else if (Be(this._camera)) {
5928
- const e = this._camera, t = 1 / e.zoom, s = e.left * t, n = e.right * t, a = e.top * t, r = e.bottom * t;
5929
- this._nearPlaneCorners[0].set(s, a, 0), this._nearPlaneCorners[1].set(n, a, 0), this._nearPlaneCorners[2].set(n, r, 0), this._nearPlaneCorners[3].set(s, r, 0);
5944
+ const e = this._camera, t = 1 / e.zoom, s = e.left * t, n = e.right * t, r = e.top * t, a = e.bottom * t;
5945
+ this._nearPlaneCorners[0].set(s, r, 0), this._nearPlaneCorners[1].set(n, r, 0), this._nearPlaneCorners[2].set(n, a, 0), this._nearPlaneCorners[3].set(s, a, 0);
5930
5946
  }
5931
5947
  }
5932
5948
  // lateUpdate
@@ -5937,10 +5953,10 @@ class ke extends oo {
5937
5953
  const s = this._getTargetDirection(Mt);
5938
5954
  Ai.lookAt(Ls, s, this._camera.up);
5939
5955
  for (let n = 0; n < 4; n++) {
5940
- const a = z.copy(this._nearPlaneCorners[n]);
5941
- a.applyMatrix4(Ai);
5942
- const r = dt.addVectors(this._target, a);
5943
- qt.set(r, s), qt.far = this._spherical.radius + 1;
5956
+ const r = z.copy(this._nearPlaneCorners[n]);
5957
+ r.applyMatrix4(Ai);
5958
+ const a = dt.addVectors(this._target, r);
5959
+ qt.set(a, s), qt.far = this._spherical.radius + 1;
5944
5960
  const o = qt.intersectObjects(this.colliderMeshes);
5945
5961
  o.length !== 0 && o[0].distance < e && (e = o[0].distance);
5946
5962
  }
@@ -6002,30 +6018,30 @@ class ke extends oo {
6002
6018
  }
6003
6019
  static createBoundingSphere(e, t = new L.Sphere()) {
6004
6020
  const s = t, n = s.center;
6005
- ut.makeEmpty(), e.traverseVisible((r) => {
6006
- r.isMesh && ut.expandByObject(r);
6021
+ ut.makeEmpty(), e.traverseVisible((a) => {
6022
+ a.isMesh && ut.expandByObject(a);
6007
6023
  }), ut.getCenter(n);
6008
- let a = 0;
6009
- return e.traverseVisible((r) => {
6010
- if (!r.isMesh)
6024
+ let r = 0;
6025
+ return e.traverseVisible((a) => {
6026
+ if (!a.isMesh)
6011
6027
  return;
6012
- const o = r, c = o.geometry.clone();
6028
+ const o = a, c = o.geometry.clone();
6013
6029
  c.applyMatrix4(o.matrixWorld);
6014
6030
  const d = c.attributes.position;
6015
6031
  for (let p = 0, m = d.count; p < m; p++)
6016
- j.fromBufferAttribute(d, p), a = Math.max(a, n.distanceToSquared(j));
6017
- }), s.radius = Math.sqrt(a), s;
6032
+ j.fromBufferAttribute(d, p), r = Math.max(r, n.distanceToSquared(j));
6033
+ }), s.radius = Math.sqrt(r), s;
6018
6034
  }
6019
6035
  }
6020
6036
  const ci = (i) => {
6021
6037
  const [e, t] = B(i.options[i.index]), s = () => {
6022
6038
  i.onToggle(!i.open);
6023
- }, n = (a) => {
6024
- a !== e && (i.onSelect(a), t(a)), i.onToggle(!1);
6039
+ }, n = (r) => {
6040
+ r !== e && (i.onSelect(r), t(r)), i.onToggle(!1);
6025
6041
  };
6026
6042
  return /* @__PURE__ */ u.jsxs("div", { className: `dropdown ${i.up === !0 ? "up" : ""}`, children: [
6027
6043
  /* @__PURE__ */ u.jsx("div", { className: "dropdown-toggle", onClick: s, children: `${i.title}: ${e}` }),
6028
- i.open && /* @__PURE__ */ u.jsx("ul", { className: "dropdown-menu", children: i.options.map((a) => /* @__PURE__ */ u.jsx("li", { onClick: () => n(a), children: a }, a)) })
6044
+ i.open && /* @__PURE__ */ u.jsx("ul", { className: "dropdown-menu", children: i.options.map((r) => /* @__PURE__ */ u.jsx("li", { onClick: () => n(r), children: r }, r)) })
6029
6045
  ] });
6030
6046
  }, Ge = Ha(function(e, t) {
6031
6047
  const s = [
@@ -6034,7 +6050,7 @@ const ci = (i) => {
6034
6050
  "Normals",
6035
6051
  "UVs",
6036
6052
  "Wireframe"
6037
- ], [n, a] = B("Renderer"), [r, o] = B(!1), [c, l] = B(!1), [d, p] = B(!1);
6053
+ ], [n, r] = B("Renderer"), [a, o] = B(!1), [c, l] = B(!1), [d, p] = B(!1);
6038
6054
  return /* @__PURE__ */ u.jsxs("div", { className: `CameraWindow ${e.name}`, children: [
6039
6055
  /* @__PURE__ */ u.jsx("div", { ref: t, className: "clickable", onClick: () => {
6040
6056
  d && p(!1);
@@ -6065,17 +6081,17 @@ const ci = (i) => {
6065
6081
  if (m === n)
6066
6082
  return;
6067
6083
  const f = m;
6068
- e.onSelectRenderMode(f), a(f);
6084
+ e.onSelectRenderMode(f), r(f);
6069
6085
  },
6070
6086
  onToggle: (m) => {
6071
- r && o(!1), l(m);
6087
+ a && o(!1), l(m);
6072
6088
  },
6073
6089
  up: !0
6074
6090
  }
6075
6091
  )
6076
6092
  ] })
6077
6093
  ] });
6078
- }), ho = `out vec3 worldPosition;
6094
+ }), uo = `out vec3 worldPosition;
6079
6095
  uniform float uDistance;
6080
6096
 
6081
6097
  void main() {
@@ -6084,7 +6100,7 @@ void main() {
6084
6100
  worldPosition.xz += cameraPosition.xz;
6085
6101
 
6086
6102
  gl_Position = projectionMatrix * modelViewMatrix * vec4(worldPosition, 1.0);
6087
- }`, uo = `out vec4 fragColor;
6103
+ }`, po = `out vec4 fragColor;
6088
6104
  in vec3 worldPosition;
6089
6105
  uniform float uDivisions;
6090
6106
  uniform float uScale;
@@ -6151,7 +6167,7 @@ void main() {
6151
6167
 
6152
6168
  if (fragColor.a <= 0.0) discard;
6153
6169
  }`;
6154
- class po extends mn {
6170
+ class mo extends mn {
6155
6171
  constructor(e) {
6156
6172
  super({
6157
6173
  extensions: {
@@ -6182,15 +6198,15 @@ class po extends mn {
6182
6198
  side: Wi,
6183
6199
  transparent: !0,
6184
6200
  name: "InfiniteGrid",
6185
- vertexShader: ho,
6186
- fragmentShader: uo
6201
+ vertexShader: uo,
6202
+ fragmentShader: po
6187
6203
  });
6188
6204
  }
6189
6205
  }
6190
- class mo extends M {
6206
+ class fo extends M {
6191
6207
  gridMaterial;
6192
6208
  constructor(e) {
6193
- const t = new po(e);
6209
+ const t = new mo(e);
6194
6210
  super(new fn(), t), this.gridMaterial = t, this.frustumCulled = !1, this.name = "InfiniteGridHelper";
6195
6211
  }
6196
6212
  update() {
@@ -6216,7 +6232,7 @@ function Fs(i) {
6216
6232
  i.name
6217
6233
  );
6218
6234
  }
6219
- const fo = `#include <common>
6235
+ const go = `#include <common>
6220
6236
  #include <batching_pars_vertex>
6221
6237
  #include <uv_pars_vertex>
6222
6238
  #include <color_pars_vertex>
@@ -6246,7 +6262,7 @@ void main() {
6246
6262
  #include <logdepthbuf_vertex>
6247
6263
  #include <clipping_planes_vertex>
6248
6264
  #include <worldpos_vertex>
6249
- }`, go = `
6265
+ }`, _o = `
6250
6266
  #include <common>
6251
6267
  #include <uv_pars_fragment>
6252
6268
  #include <clipping_planes_pars_fragment>
@@ -6255,14 +6271,14 @@ void main() {
6255
6271
  #include <clipping_planes_fragment>
6256
6272
  gl_FragColor = vec4(vec3(vUv, 0.0), 1.0);
6257
6273
  }`;
6258
- class _o extends mn {
6274
+ class vo extends mn {
6259
6275
  constructor() {
6260
6276
  super({
6261
6277
  defines: {
6262
6278
  USE_UV: ""
6263
6279
  },
6264
- vertexShader: fo,
6265
- fragmentShader: go
6280
+ vertexShader: go,
6281
+ fragmentShader: _o
6266
6282
  });
6267
6283
  }
6268
6284
  }
@@ -6271,30 +6287,30 @@ const Xe = new ai(), ue = new P(), Ye = new P(), Q = new Ce(), zs = {
6271
6287
  Y: new P(0, 1, 0),
6272
6288
  Z: new P(0, 0, 1)
6273
6289
  }, Di = { type: "change" }, Hs = { type: "mouseDown", mode: null }, Ys = { type: "mouseUp", mode: null }, Bs = { type: "objectChange" };
6274
- class vo extends pn {
6290
+ class yo extends pn {
6275
6291
  constructor(e, t = null) {
6276
6292
  super(void 0, t);
6277
- const s = new So(this);
6293
+ const s = new xo(this);
6278
6294
  this._root = s;
6279
- const n = new xo();
6295
+ const n = new Oo();
6280
6296
  this._gizmo = n, s.add(n);
6281
- const a = new Oo();
6282
- this._plane = a, s.add(a);
6283
- const r = this;
6297
+ const r = new To();
6298
+ this._plane = r, s.add(r);
6299
+ const a = this;
6284
6300
  function o(C, w) {
6285
6301
  let S = w;
6286
- Object.defineProperty(r, C, {
6302
+ Object.defineProperty(a, C, {
6287
6303
  get: function() {
6288
6304
  return S !== void 0 ? S : w;
6289
6305
  },
6290
6306
  set: function(O) {
6291
- S !== O && (S = O, a[C] = O, n[C] = O, r.dispatchEvent({ type: C + "-changed", value: O }), r.dispatchEvent(Di));
6307
+ S !== O && (S = O, r[C] = O, n[C] = O, a.dispatchEvent({ type: C + "-changed", value: O }), a.dispatchEvent(Di));
6292
6308
  }
6293
- }), r[C] = w, a[C] = w, n[C] = w;
6309
+ }), a[C] = w, r[C] = w, n[C] = w;
6294
6310
  }
6295
6311
  o("camera", e), o("object", void 0), o("enabled", !0), o("axis", null), o("mode", "translate"), o("translationSnap", null), o("rotationSnap", null), o("scaleSnap", null), o("space", "world"), o("size", 1), o("dragging", !1), o("showX", !0), o("showY", !0), o("showZ", !0);
6296
6312
  const c = new P(), l = new P(), d = new Ce(), p = new Ce(), m = new P(), f = new Ce(), E = new P(), v = new P(), x = new P(), g = 0, y = new P();
6297
- o("worldPosition", c), o("worldPositionStart", l), o("worldQuaternion", d), o("worldQuaternionStart", p), o("cameraPosition", m), o("cameraQuaternion", f), o("pointStart", E), o("pointEnd", v), o("rotationAxis", x), o("rotationAngle", g), o("eye", y), this._offset = new P(), this._startNorm = new P(), this._endNorm = new P(), this._cameraScale = new P(), this._parentPosition = new P(), this._parentQuaternion = new Ce(), this._parentQuaternionInv = new Ce(), this._parentScale = new P(), this._worldScaleStart = new P(), this._worldQuaternionInv = new Ce(), this._worldScale = new P(), this._positionStart = new P(), this._quaternionStart = new Ce(), this._scaleStart = new P(), this._getPointer = yo.bind(this), this._onPointerDown = Eo.bind(this), this._onPointerHover = bo.bind(this), this._onPointerMove = Co.bind(this), this._onPointerUp = wo.bind(this), t !== null && this.connect();
6313
+ o("worldPosition", c), o("worldPositionStart", l), o("worldQuaternion", d), o("worldQuaternionStart", p), o("cameraPosition", m), o("cameraQuaternion", f), o("pointStart", E), o("pointEnd", v), o("rotationAxis", x), o("rotationAngle", g), o("eye", y), this._offset = new P(), this._startNorm = new P(), this._endNorm = new P(), this._cameraScale = new P(), this._parentPosition = new P(), this._parentQuaternion = new Ce(), this._parentQuaternionInv = new Ce(), this._parentScale = new P(), this._worldScaleStart = new P(), this._worldQuaternionInv = new Ce(), this._worldScale = new P(), this._positionStart = new P(), this._quaternionStart = new Ce(), this._scaleStart = new P(), this._getPointer = bo.bind(this), this._onPointerDown = Co.bind(this), this._onPointerHover = Eo.bind(this), this._onPointerMove = wo.bind(this), this._onPointerUp = So.bind(this), t !== null && this.connect();
6298
6314
  }
6299
6315
  connect() {
6300
6316
  this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointermove", this._onPointerHover), this.domElement.addEventListener("pointerup", this._onPointerUp), this.domElement.style.touchAction = "none";
@@ -6321,14 +6337,14 @@ class vo extends pn {
6321
6337
  }
6322
6338
  pointerMove(e) {
6323
6339
  const t = this.axis, s = this.mode, n = this.object;
6324
- let a = this.space;
6325
- if (s === "scale" ? a = "local" : (t === "E" || t === "XYZE" || t === "XYZ") && (a = "world"), n === void 0 || t === null || this.dragging === !1 || e !== null && e.button !== -1)
6340
+ let r = this.space;
6341
+ if (s === "scale" ? r = "local" : (t === "E" || t === "XYZE" || t === "XYZ") && (r = "world"), n === void 0 || t === null || this.dragging === !1 || e !== null && e.button !== -1)
6326
6342
  return;
6327
6343
  e !== null && Xe.setFromCamera(e, this.camera);
6328
- const r = Ri(this._plane, Xe, !0);
6329
- if (r) {
6330
- if (this.pointEnd.copy(r.point).sub(this.worldPositionStart), s === "translate")
6331
- this._offset.copy(this.pointEnd).sub(this.pointStart), a === "local" && t !== "XYZ" && this._offset.applyQuaternion(this._worldQuaternionInv), t.indexOf("X") === -1 && (this._offset.x = 0), t.indexOf("Y") === -1 && (this._offset.y = 0), t.indexOf("Z") === -1 && (this._offset.z = 0), a === "local" && t !== "XYZ" ? this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale) : this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale), n.position.copy(this._offset).add(this._positionStart), this.translationSnap && (a === "local" && (n.position.applyQuaternion(Q.copy(this._quaternionStart).invert()), t.search("X") !== -1 && (n.position.x = Math.round(n.position.x / this.translationSnap) * this.translationSnap), t.search("Y") !== -1 && (n.position.y = Math.round(n.position.y / this.translationSnap) * this.translationSnap), t.search("Z") !== -1 && (n.position.z = Math.round(n.position.z / this.translationSnap) * this.translationSnap), n.position.applyQuaternion(this._quaternionStart)), a === "world" && (n.parent && n.position.add(ue.setFromMatrixPosition(n.parent.matrixWorld)), t.search("X") !== -1 && (n.position.x = Math.round(n.position.x / this.translationSnap) * this.translationSnap), t.search("Y") !== -1 && (n.position.y = Math.round(n.position.y / this.translationSnap) * this.translationSnap), t.search("Z") !== -1 && (n.position.z = Math.round(n.position.z / this.translationSnap) * this.translationSnap), n.parent && n.position.sub(ue.setFromMatrixPosition(n.parent.matrixWorld))));
6344
+ const a = Ri(this._plane, Xe, !0);
6345
+ if (a) {
6346
+ if (this.pointEnd.copy(a.point).sub(this.worldPositionStart), s === "translate")
6347
+ this._offset.copy(this.pointEnd).sub(this.pointStart), r === "local" && t !== "XYZ" && this._offset.applyQuaternion(this._worldQuaternionInv), t.indexOf("X") === -1 && (this._offset.x = 0), t.indexOf("Y") === -1 && (this._offset.y = 0), t.indexOf("Z") === -1 && (this._offset.z = 0), r === "local" && t !== "XYZ" ? this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale) : this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale), n.position.copy(this._offset).add(this._positionStart), this.translationSnap && (r === "local" && (n.position.applyQuaternion(Q.copy(this._quaternionStart).invert()), t.search("X") !== -1 && (n.position.x = Math.round(n.position.x / this.translationSnap) * this.translationSnap), t.search("Y") !== -1 && (n.position.y = Math.round(n.position.y / this.translationSnap) * this.translationSnap), t.search("Z") !== -1 && (n.position.z = Math.round(n.position.z / this.translationSnap) * this.translationSnap), n.position.applyQuaternion(this._quaternionStart)), r === "world" && (n.parent && n.position.add(ue.setFromMatrixPosition(n.parent.matrixWorld)), t.search("X") !== -1 && (n.position.x = Math.round(n.position.x / this.translationSnap) * this.translationSnap), t.search("Y") !== -1 && (n.position.y = Math.round(n.position.y / this.translationSnap) * this.translationSnap), t.search("Z") !== -1 && (n.position.z = Math.round(n.position.z / this.translationSnap) * this.translationSnap), n.parent && n.position.sub(ue.setFromMatrixPosition(n.parent.matrixWorld))));
6332
6348
  else if (s === "scale") {
6333
6349
  if (t.search("XYZ") !== -1) {
6334
6350
  let o = this.pointEnd.length() / this.pointStart.length();
@@ -6340,7 +6356,7 @@ class vo extends pn {
6340
6356
  this._offset.copy(this.pointEnd).sub(this.pointStart);
6341
6357
  const o = 20 / this.worldPosition.distanceTo(ue.setFromMatrixPosition(this.camera.matrixWorld));
6342
6358
  let c = !1;
6343
- t === "XYZE" ? (this.rotationAxis.copy(this._offset).cross(this.eye).normalize(), this.rotationAngle = this._offset.dot(ue.copy(this.rotationAxis).cross(this.eye)) * o) : (t === "X" || t === "Y" || t === "Z") && (this.rotationAxis.copy(zs[t]), ue.copy(zs[t]), a === "local" && ue.applyQuaternion(this.worldQuaternion), ue.cross(this.eye), ue.length() === 0 ? c = !0 : this.rotationAngle = this._offset.dot(ue.normalize()) * o), (t === "E" || c) && (this.rotationAxis.copy(this.eye), this.rotationAngle = this.pointEnd.angleTo(this.pointStart), this._startNorm.copy(this.pointStart).normalize(), this._endNorm.copy(this.pointEnd).normalize(), this.rotationAngle *= this._endNorm.cross(this._startNorm).dot(this.eye) < 0 ? 1 : -1), this.rotationSnap && (this.rotationAngle = Math.round(this.rotationAngle / this.rotationSnap) * this.rotationSnap), a === "local" && t !== "E" && t !== "XYZE" ? (n.quaternion.copy(this._quaternionStart), n.quaternion.multiply(Q.setFromAxisAngle(this.rotationAxis, this.rotationAngle)).normalize()) : (this.rotationAxis.applyQuaternion(this._parentQuaternionInv), n.quaternion.copy(Q.setFromAxisAngle(this.rotationAxis, this.rotationAngle)), n.quaternion.multiply(this._quaternionStart).normalize());
6359
+ t === "XYZE" ? (this.rotationAxis.copy(this._offset).cross(this.eye).normalize(), this.rotationAngle = this._offset.dot(ue.copy(this.rotationAxis).cross(this.eye)) * o) : (t === "X" || t === "Y" || t === "Z") && (this.rotationAxis.copy(zs[t]), ue.copy(zs[t]), r === "local" && ue.applyQuaternion(this.worldQuaternion), ue.cross(this.eye), ue.length() === 0 ? c = !0 : this.rotationAngle = this._offset.dot(ue.normalize()) * o), (t === "E" || c) && (this.rotationAxis.copy(this.eye), this.rotationAngle = this.pointEnd.angleTo(this.pointStart), this._startNorm.copy(this.pointStart).normalize(), this._endNorm.copy(this.pointEnd).normalize(), this.rotationAngle *= this._endNorm.cross(this._startNorm).dot(this.eye) < 0 ? 1 : -1), this.rotationSnap && (this.rotationAngle = Math.round(this.rotationAngle / this.rotationSnap) * this.rotationSnap), r === "local" && t !== "E" && t !== "XYZE" ? (n.quaternion.copy(this._quaternionStart), n.quaternion.multiply(Q.setFromAxisAngle(this.rotationAxis, this.rotationAngle)).normalize()) : (this.rotationAxis.applyQuaternion(this._parentQuaternionInv), n.quaternion.copy(Q.setFromAxisAngle(this.rotationAxis, this.rotationAngle)), n.quaternion.multiply(this._quaternionStart).normalize());
6344
6360
  }
6345
6361
  this.dispatchEvent(Di), this.dispatchEvent(Bs);
6346
6362
  }
@@ -6390,7 +6406,7 @@ class vo extends pn {
6390
6406
  this.space = e;
6391
6407
  }
6392
6408
  }
6393
- function yo(i) {
6409
+ function bo(i) {
6394
6410
  if (this.domElement.ownerDocument.pointerLockElement)
6395
6411
  return {
6396
6412
  x: 0,
@@ -6406,7 +6422,7 @@ function yo(i) {
6406
6422
  };
6407
6423
  }
6408
6424
  }
6409
- function bo(i) {
6425
+ function Eo(i) {
6410
6426
  if (this.enabled)
6411
6427
  switch (i.pointerType) {
6412
6428
  case "mouse":
@@ -6415,13 +6431,13 @@ function bo(i) {
6415
6431
  break;
6416
6432
  }
6417
6433
  }
6418
- function Eo(i) {
6434
+ function Co(i) {
6419
6435
  this.enabled && (document.pointerLockElement || this.domElement.setPointerCapture(i.pointerId), this.domElement.addEventListener("pointermove", this._onPointerMove), this.pointerHover(this._getPointer(i)), this.pointerDown(this._getPointer(i)));
6420
6436
  }
6421
- function Co(i) {
6437
+ function wo(i) {
6422
6438
  this.enabled && this.pointerMove(this._getPointer(i));
6423
6439
  }
6424
- function wo(i) {
6440
+ function So(i) {
6425
6441
  this.enabled && (this.domElement.releasePointerCapture(i.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.pointerUp(this._getPointer(i)));
6426
6442
  }
6427
6443
  function Ri(i, e, t) {
@@ -6432,7 +6448,7 @@ function Ri(i, e, t) {
6432
6448
  return !1;
6433
6449
  }
6434
6450
  const Kt = new gn(), X = new P(0, 1, 0), Vs = new P(0, 0, 0), Zs = new hi(), Qt = new Ce(), ni = new Ce(), Re = new P(), Ws = new hi(), Lt = new P(1, 0, 0), qe = new P(0, 1, 0), kt = new P(0, 0, 1), Jt = new P(), At = new P(), Dt = new P();
6435
- class So extends vt {
6451
+ class xo extends vt {
6436
6452
  constructor(e) {
6437
6453
  super(), this.isTransformControlsRoot = !0, this.controls = e, this.visible = !1;
6438
6454
  }
@@ -6442,7 +6458,7 @@ class So extends vt {
6442
6458
  t.object !== void 0 && (t.object.updateMatrixWorld(), t.object.parent === null ? console.error("TransformControls: The attached 3D object must be a part of the scene graph.") : t.object.parent.matrixWorld.decompose(t._parentPosition, t._parentQuaternion, t._parentScale), t.object.matrixWorld.decompose(t.worldPosition, t.worldQuaternion, t._worldScale), t._parentQuaternionInv.copy(t._parentQuaternion).invert(), t._worldQuaternionInv.copy(t.worldQuaternion).invert()), t.camera.updateMatrixWorld(), t.camera.matrixWorld.decompose(t.cameraPosition, t.cameraQuaternion, t._cameraScale), t.camera.isOrthographicCamera ? t.camera.getWorldDirection(t.eye).negate() : t.eye.copy(t.cameraPosition).sub(t.worldPosition).normalize(), super.updateMatrixWorld(e);
6443
6459
  }
6444
6460
  }
6445
- class xo extends vt {
6461
+ class Oo extends vt {
6446
6462
  constructor() {
6447
6463
  super(), this.isTransformControlsGizmo = !0, this.type = "TransformControlsGizmo";
6448
6464
  const e = new Je({
@@ -6461,10 +6477,10 @@ class xo extends vt {
6461
6477
  s.opacity = 0.15;
6462
6478
  const n = t.clone();
6463
6479
  n.opacity = 0.5;
6464
- const a = e.clone();
6465
- a.color.setHex(16711680);
6466
6480
  const r = e.clone();
6467
- r.color.setHex(65280);
6481
+ r.color.setHex(16711680);
6482
+ const a = e.clone();
6483
+ a.color.setHex(65280);
6468
6484
  const o = e.clone();
6469
6485
  o.color.setHex(255);
6470
6486
  const c = e.clone();
@@ -6497,14 +6513,14 @@ class xo extends vt {
6497
6513
  }
6498
6514
  const S = {
6499
6515
  X: [
6500
- [new M(v, a), [0.5, 0, 0], [0, 0, -Math.PI / 2]],
6501
- [new M(v, a), [-0.5, 0, 0], [0, 0, Math.PI / 2]],
6502
- [new M(y, a), [0, 0, 0], [0, 0, -Math.PI / 2]]
6516
+ [new M(v, r), [0.5, 0, 0], [0, 0, -Math.PI / 2]],
6517
+ [new M(v, r), [-0.5, 0, 0], [0, 0, Math.PI / 2]],
6518
+ [new M(y, r), [0, 0, 0], [0, 0, -Math.PI / 2]]
6503
6519
  ],
6504
6520
  Y: [
6505
- [new M(v, r), [0, 0.5, 0]],
6506
- [new M(v, r), [0, -0.5, 0], [Math.PI, 0, 0]],
6507
- [new M(y, r)]
6521
+ [new M(v, a), [0, 0.5, 0]],
6522
+ [new M(v, a), [0, -0.5, 0], [Math.PI, 0, 0]],
6523
+ [new M(y, a)]
6508
6524
  ],
6509
6525
  Z: [
6510
6526
  [new M(v, o), [0, 0, 0.5], [Math.PI / 2, 0, 0]],
@@ -6572,10 +6588,10 @@ class xo extends vt {
6572
6588
  [new M(C(0.5, 1), E), null, [0, Math.PI / 2, 0]]
6573
6589
  ],
6574
6590
  X: [
6575
- [new M(C(0.5, 0.5), a)]
6591
+ [new M(C(0.5, 0.5), r)]
6576
6592
  ],
6577
6593
  Y: [
6578
- [new M(C(0.5, 0.5), r), null, [0, 0, -Math.PI / 2]]
6594
+ [new M(C(0.5, 0.5), a), null, [0, 0, -Math.PI / 2]]
6579
6595
  ],
6580
6596
  Z: [
6581
6597
  [new M(C(0.5, 0.5), o), null, [0, Math.PI / 2, 0]]
@@ -6605,14 +6621,14 @@ class xo extends vt {
6605
6621
  ]
6606
6622
  }, we = {
6607
6623
  X: [
6608
- [new M(x, a), [0.5, 0, 0], [0, 0, -Math.PI / 2]],
6609
- [new M(y, a), [0, 0, 0], [0, 0, -Math.PI / 2]],
6610
- [new M(x, a), [-0.5, 0, 0], [0, 0, Math.PI / 2]]
6624
+ [new M(x, r), [0.5, 0, 0], [0, 0, -Math.PI / 2]],
6625
+ [new M(y, r), [0, 0, 0], [0, 0, -Math.PI / 2]],
6626
+ [new M(x, r), [-0.5, 0, 0], [0, 0, Math.PI / 2]]
6611
6627
  ],
6612
6628
  Y: [
6613
- [new M(x, r), [0, 0.5, 0]],
6614
- [new M(y, r)],
6615
- [new M(x, r), [0, -0.5, 0], [0, 0, Math.PI]]
6629
+ [new M(x, a), [0, 0.5, 0]],
6630
+ [new M(y, a)],
6631
+ [new M(x, a), [0, -0.5, 0], [0, 0, Math.PI]]
6616
6632
  ],
6617
6633
  Z: [
6618
6634
  [new M(x, o), [0, 0, 0.5], [Math.PI / 2, 0, 0]],
@@ -6686,22 +6702,22 @@ class xo extends vt {
6686
6702
  this.gizmo.translate.visible = this.mode === "translate", this.gizmo.rotate.visible = this.mode === "rotate", this.gizmo.scale.visible = this.mode === "scale", this.helper.translate.visible = this.mode === "translate", this.helper.rotate.visible = this.mode === "rotate", this.helper.scale.visible = this.mode === "scale";
6687
6703
  let n = [];
6688
6704
  n = n.concat(this.picker[this.mode].children), n = n.concat(this.gizmo[this.mode].children), n = n.concat(this.helper[this.mode].children);
6689
- for (let a = 0; a < n.length; a++) {
6690
- const r = n[a];
6691
- r.visible = !0, r.rotation.set(0, 0, 0), r.position.copy(this.worldPosition);
6705
+ for (let r = 0; r < n.length; r++) {
6706
+ const a = n[r];
6707
+ a.visible = !0, a.rotation.set(0, 0, 0), a.position.copy(this.worldPosition);
6692
6708
  let o;
6693
- if (this.camera.isOrthographicCamera ? o = (this.camera.top - this.camera.bottom) / this.camera.zoom : o = this.worldPosition.distanceTo(this.cameraPosition) * Math.min(1.9 * Math.tan(Math.PI * this.camera.fov / 360) / this.camera.zoom, 7), r.scale.set(1, 1, 1).multiplyScalar(o * this.size / 4), r.tag === "helper") {
6694
- r.visible = !1, r.name === "AXIS" ? (r.visible = !!this.axis, this.axis === "X" && (Q.setFromEuler(Kt.set(0, 0, 0)), r.quaternion.copy(s).multiply(Q), Math.abs(X.copy(Lt).applyQuaternion(s).dot(this.eye)) > 0.9 && (r.visible = !1)), this.axis === "Y" && (Q.setFromEuler(Kt.set(0, 0, Math.PI / 2)), r.quaternion.copy(s).multiply(Q), Math.abs(X.copy(qe).applyQuaternion(s).dot(this.eye)) > 0.9 && (r.visible = !1)), this.axis === "Z" && (Q.setFromEuler(Kt.set(0, Math.PI / 2, 0)), r.quaternion.copy(s).multiply(Q), Math.abs(X.copy(kt).applyQuaternion(s).dot(this.eye)) > 0.9 && (r.visible = !1)), this.axis === "XYZE" && (Q.setFromEuler(Kt.set(0, Math.PI / 2, 0)), X.copy(this.rotationAxis), r.quaternion.setFromRotationMatrix(Zs.lookAt(Vs, X, qe)), r.quaternion.multiply(Q), r.visible = this.dragging), this.axis === "E" && (r.visible = !1)) : r.name === "START" ? (r.position.copy(this.worldPositionStart), r.visible = this.dragging) : r.name === "END" ? (r.position.copy(this.worldPosition), r.visible = this.dragging) : r.name === "DELTA" ? (r.position.copy(this.worldPositionStart), r.quaternion.copy(this.worldQuaternionStart), ue.set(1e-10, 1e-10, 1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1), ue.applyQuaternion(this.worldQuaternionStart.clone().invert()), r.scale.copy(ue), r.visible = this.dragging) : (r.quaternion.copy(s), this.dragging ? r.position.copy(this.worldPositionStart) : r.position.copy(this.worldPosition), this.axis && (r.visible = this.axis.search(r.name) !== -1));
6709
+ if (this.camera.isOrthographicCamera ? o = (this.camera.top - this.camera.bottom) / this.camera.zoom : o = this.worldPosition.distanceTo(this.cameraPosition) * Math.min(1.9 * Math.tan(Math.PI * this.camera.fov / 360) / this.camera.zoom, 7), a.scale.set(1, 1, 1).multiplyScalar(o * this.size / 4), a.tag === "helper") {
6710
+ a.visible = !1, a.name === "AXIS" ? (a.visible = !!this.axis, this.axis === "X" && (Q.setFromEuler(Kt.set(0, 0, 0)), a.quaternion.copy(s).multiply(Q), Math.abs(X.copy(Lt).applyQuaternion(s).dot(this.eye)) > 0.9 && (a.visible = !1)), this.axis === "Y" && (Q.setFromEuler(Kt.set(0, 0, Math.PI / 2)), a.quaternion.copy(s).multiply(Q), Math.abs(X.copy(qe).applyQuaternion(s).dot(this.eye)) > 0.9 && (a.visible = !1)), this.axis === "Z" && (Q.setFromEuler(Kt.set(0, Math.PI / 2, 0)), a.quaternion.copy(s).multiply(Q), Math.abs(X.copy(kt).applyQuaternion(s).dot(this.eye)) > 0.9 && (a.visible = !1)), this.axis === "XYZE" && (Q.setFromEuler(Kt.set(0, Math.PI / 2, 0)), X.copy(this.rotationAxis), a.quaternion.setFromRotationMatrix(Zs.lookAt(Vs, X, qe)), a.quaternion.multiply(Q), a.visible = this.dragging), this.axis === "E" && (a.visible = !1)) : a.name === "START" ? (a.position.copy(this.worldPositionStart), a.visible = this.dragging) : a.name === "END" ? (a.position.copy(this.worldPosition), a.visible = this.dragging) : a.name === "DELTA" ? (a.position.copy(this.worldPositionStart), a.quaternion.copy(this.worldQuaternionStart), ue.set(1e-10, 1e-10, 1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1), ue.applyQuaternion(this.worldQuaternionStart.clone().invert()), a.scale.copy(ue), a.visible = this.dragging) : (a.quaternion.copy(s), this.dragging ? a.position.copy(this.worldPositionStart) : a.position.copy(this.worldPosition), this.axis && (a.visible = this.axis.search(a.name) !== -1));
6695
6711
  continue;
6696
6712
  }
6697
- r.quaternion.copy(s), this.mode === "translate" || this.mode === "scale" ? (r.name === "X" && Math.abs(X.copy(Lt).applyQuaternion(s).dot(this.eye)) > 0.99 && (r.scale.set(1e-10, 1e-10, 1e-10), r.visible = !1), r.name === "Y" && Math.abs(X.copy(qe).applyQuaternion(s).dot(this.eye)) > 0.99 && (r.scale.set(1e-10, 1e-10, 1e-10), r.visible = !1), r.name === "Z" && Math.abs(X.copy(kt).applyQuaternion(s).dot(this.eye)) > 0.99 && (r.scale.set(1e-10, 1e-10, 1e-10), r.visible = !1), r.name === "XY" && Math.abs(X.copy(kt).applyQuaternion(s).dot(this.eye)) < 0.2 && (r.scale.set(1e-10, 1e-10, 1e-10), r.visible = !1), r.name === "YZ" && Math.abs(X.copy(Lt).applyQuaternion(s).dot(this.eye)) < 0.2 && (r.scale.set(1e-10, 1e-10, 1e-10), r.visible = !1), r.name === "XZ" && Math.abs(X.copy(qe).applyQuaternion(s).dot(this.eye)) < 0.2 && (r.scale.set(1e-10, 1e-10, 1e-10), r.visible = !1)) : this.mode === "rotate" && (Qt.copy(s), X.copy(this.eye).applyQuaternion(Q.copy(s).invert()), r.name.search("E") !== -1 && r.quaternion.setFromRotationMatrix(Zs.lookAt(this.eye, Vs, qe)), r.name === "X" && (Q.setFromAxisAngle(Lt, Math.atan2(-X.y, X.z)), Q.multiplyQuaternions(Qt, Q), r.quaternion.copy(Q)), r.name === "Y" && (Q.setFromAxisAngle(qe, Math.atan2(X.x, X.z)), Q.multiplyQuaternions(Qt, Q), r.quaternion.copy(Q)), r.name === "Z" && (Q.setFromAxisAngle(kt, Math.atan2(X.y, X.x)), Q.multiplyQuaternions(Qt, Q), r.quaternion.copy(Q))), r.visible = r.visible && (r.name.indexOf("X") === -1 || this.showX), r.visible = r.visible && (r.name.indexOf("Y") === -1 || this.showY), r.visible = r.visible && (r.name.indexOf("Z") === -1 || this.showZ), r.visible = r.visible && (r.name.indexOf("E") === -1 || this.showX && this.showY && this.showZ), r.material._color = r.material._color || r.material.color.clone(), r.material._opacity = r.material._opacity || r.material.opacity, r.material.color.copy(r.material._color), r.material.opacity = r.material._opacity, this.enabled && this.axis && (r.name === this.axis || this.axis.split("").some(function(c) {
6698
- return r.name === c;
6699
- })) && (r.material.color.setHex(16776960), r.material.opacity = 1);
6713
+ a.quaternion.copy(s), this.mode === "translate" || this.mode === "scale" ? (a.name === "X" && Math.abs(X.copy(Lt).applyQuaternion(s).dot(this.eye)) > 0.99 && (a.scale.set(1e-10, 1e-10, 1e-10), a.visible = !1), a.name === "Y" && Math.abs(X.copy(qe).applyQuaternion(s).dot(this.eye)) > 0.99 && (a.scale.set(1e-10, 1e-10, 1e-10), a.visible = !1), a.name === "Z" && Math.abs(X.copy(kt).applyQuaternion(s).dot(this.eye)) > 0.99 && (a.scale.set(1e-10, 1e-10, 1e-10), a.visible = !1), a.name === "XY" && Math.abs(X.copy(kt).applyQuaternion(s).dot(this.eye)) < 0.2 && (a.scale.set(1e-10, 1e-10, 1e-10), a.visible = !1), a.name === "YZ" && Math.abs(X.copy(Lt).applyQuaternion(s).dot(this.eye)) < 0.2 && (a.scale.set(1e-10, 1e-10, 1e-10), a.visible = !1), a.name === "XZ" && Math.abs(X.copy(qe).applyQuaternion(s).dot(this.eye)) < 0.2 && (a.scale.set(1e-10, 1e-10, 1e-10), a.visible = !1)) : this.mode === "rotate" && (Qt.copy(s), X.copy(this.eye).applyQuaternion(Q.copy(s).invert()), a.name.search("E") !== -1 && a.quaternion.setFromRotationMatrix(Zs.lookAt(this.eye, Vs, qe)), a.name === "X" && (Q.setFromAxisAngle(Lt, Math.atan2(-X.y, X.z)), Q.multiplyQuaternions(Qt, Q), a.quaternion.copy(Q)), a.name === "Y" && (Q.setFromAxisAngle(qe, Math.atan2(X.x, X.z)), Q.multiplyQuaternions(Qt, Q), a.quaternion.copy(Q)), a.name === "Z" && (Q.setFromAxisAngle(kt, Math.atan2(X.y, X.x)), Q.multiplyQuaternions(Qt, Q), a.quaternion.copy(Q))), a.visible = a.visible && (a.name.indexOf("X") === -1 || this.showX), a.visible = a.visible && (a.name.indexOf("Y") === -1 || this.showY), a.visible = a.visible && (a.name.indexOf("Z") === -1 || this.showZ), a.visible = a.visible && (a.name.indexOf("E") === -1 || this.showX && this.showY && this.showZ), a.material._color = a.material._color || a.material.color.clone(), a.material._opacity = a.material._opacity || a.material.opacity, a.material.color.copy(a.material._color), a.material.opacity = a.material._opacity, this.enabled && this.axis && (a.name === this.axis || this.axis.split("").some(function(c) {
6714
+ return a.name === c;
6715
+ })) && (a.material.color.setHex(16776960), a.material.opacity = 1);
6700
6716
  }
6701
6717
  super.updateMatrixWorld(e);
6702
6718
  }
6703
6719
  }
6704
- class Oo extends M {
6720
+ class To extends M {
6705
6721
  constructor() {
6706
6722
  super(
6707
6723
  new fn(1e5, 1e5, 2, 2),
@@ -6768,7 +6784,7 @@ class ge extends Zi {
6768
6784
  let t = this.controls.get(e);
6769
6785
  if (t === void 0) {
6770
6786
  const s = document.querySelector(".clickable");
6771
- t = new vo(this.activeCamera, s), t.getHelper().name = e, t.setSpace("local"), this.controls.set(e, t), this.visibility.set(e, !0), t.addEventListener("mouseDown", () => {
6787
+ t = new yo(this.activeCamera, s), t.getHelper().name = e, t.setSpace("local"), this.controls.set(e, t), this.visibility.set(e, !0), t.addEventListener("mouseDown", () => {
6772
6788
  this.dispatchEvent({ type: ge.DRAG_START });
6773
6789
  }), t.addEventListener("mouseUp", () => {
6774
6790
  this.dispatchEvent({ type: ge.DRAG_END });
@@ -6814,7 +6830,7 @@ class ge extends Zi {
6814
6830
  return ge._instance || (ge._instance = new ge()), ge._instance;
6815
6831
  }
6816
6832
  }
6817
- const To = new de(), Ii = new pe();
6833
+ const Mo = new de(), Ii = new pe();
6818
6834
  class Gs extends vt {
6819
6835
  curve = new us();
6820
6836
  line;
@@ -6878,7 +6894,7 @@ class Gs extends vt {
6878
6894
  this.addPoint(new P(-50, 0, 0), !1), this.addPoint(new P(50, 0, 0));
6879
6895
  };
6880
6896
  addPoint = (e, t = !0) => {
6881
- const s = this.draggable.children.length, n = new M(To, this.draggedMat);
6897
+ const s = this.draggable.children.length, n = new M(Mo, this.draggedMat);
6882
6898
  return n.name = `point_${s}`, n.position.copy(e), n.scale.setScalar(this._draggableScale), this.draggable.add(n), t && this.updateSpline(), n;
6883
6899
  };
6884
6900
  addNextPt = () => {
@@ -6917,8 +6933,8 @@ class Gs extends vt {
6917
6933
  Ii.x = (e.clientX - s.x) / s.width * 2 - 1, Ii.y = -((e.clientY - s.y) / s.height) * 2 + 1, this.raycaster.setFromCamera(Ii, this.camera);
6918
6934
  const n = this.raycaster.intersectObjects(this.draggable.children, !1);
6919
6935
  if (n.length > 0) {
6920
- const a = n[0].object;
6921
- a !== this._transform?.object && (this._transform?.attach(a), this.group.current?.setField("Current Point", a.position));
6936
+ const r = n[0].object;
6937
+ r !== this._transform?.object && (this._transform?.attach(r), this.group.current?.setField("Current Point", r.position));
6922
6938
  }
6923
6939
  };
6924
6940
  // Getters
@@ -7081,40 +7097,40 @@ class Gs extends vt {
7081
7097
  value: s
7082
7098
  }
7083
7099
  ],
7084
- onUpdate: (n, a) => {
7100
+ onUpdate: (n, r) => {
7085
7101
  switch (n) {
7086
7102
  case "Closed":
7087
- this.closed = a, this.updateSpline();
7103
+ this.closed = r, this.updateSpline();
7088
7104
  break;
7089
7105
  case "Visible":
7090
- this.visible = a;
7106
+ this.visible = r;
7091
7107
  break;
7092
7108
  case "Color":
7093
- this.lineMaterial.color.setStyle(a), this.draggedMat.color.setStyle(a);
7109
+ this.lineMaterial.color.setStyle(r), this.draggedMat.color.setStyle(r);
7094
7110
  break;
7095
7111
  case "Curve":
7096
- this.curveType = a, this.updateSpline();
7112
+ this.curveType = r, this.updateSpline();
7097
7113
  break;
7098
7114
  case "Draggable Scale":
7099
- this.draggableScale = a;
7115
+ this.draggableScale = r;
7100
7116
  break;
7101
7117
  case "Subdivide":
7102
- this.subdivide = a, this.updateSpline();
7118
+ this.subdivide = r, this.updateSpline();
7103
7119
  break;
7104
7120
  case "Tension":
7105
- this.tension = a, this.updateSpline();
7121
+ this.tension = r, this.updateSpline();
7106
7122
  break;
7107
7123
  case "New Pt Offset":
7108
- this.offset = a;
7124
+ this.offset = r;
7109
7125
  break;
7110
7126
  case "Curve At":
7111
- this.curvePos.position.copy(this.getPointAt(a));
7127
+ this.curvePos.position.copy(this.getPointAt(r));
7112
7128
  break;
7113
7129
  case "Show Position":
7114
- this.curvePos.visible = a;
7130
+ this.curvePos.visible = r;
7115
7131
  break;
7116
7132
  case "Show Points":
7117
- this.draggable.visible = a;
7133
+ this.draggable.visible = r;
7118
7134
  break;
7119
7135
  case "Toggle Transform":
7120
7136
  this._transform && (this._transform.getHelper().visible = !this._transform.getHelper().visible);
@@ -7133,8 +7149,8 @@ class Gs extends vt {
7133
7149
  break;
7134
7150
  case "Current Point":
7135
7151
  if (this.group.current && this._transform?.object) {
7136
- const r = this._transform?.object;
7137
- r.name.search("point") > -1 && (r.position.copy(a), this.updateSpline());
7152
+ const a = this._transform?.object;
7153
+ a.name.search("point") > -1 && (a.position.copy(r), this.updateSpline());
7138
7154
  }
7139
7155
  break;
7140
7156
  }
@@ -7148,7 +7164,7 @@ class Gs extends vt {
7148
7164
  };
7149
7165
  }
7150
7166
  let ei = 0;
7151
- class Mo extends vt {
7167
+ class Po extends vt {
7152
7168
  defaultScale = 10;
7153
7169
  _camera;
7154
7170
  group = null;
@@ -7228,11 +7244,11 @@ class Mo extends vt {
7228
7244
  };
7229
7245
  onAddSpline = (e) => {
7230
7246
  const t = JSON.parse(e.value), s = `Spline ${ei + 1}`, n = [];
7231
- t.points.forEach((r) => {
7232
- n.push(new P(r[0], r[1], r[2]));
7247
+ t.points.forEach((a) => {
7248
+ n.push(new P(a[0], a[1], a[2]));
7233
7249
  });
7234
- const a = new Gs(s, this.camera);
7235
- a.addPoints(n), this.addSpline(a), ei++;
7250
+ const r = new Gs(s, this.camera);
7251
+ r.addPoints(n), this.addSpline(r), ei++;
7236
7252
  };
7237
7253
  get camera() {
7238
7254
  return this._camera;
@@ -7249,7 +7265,7 @@ const Xs = [
7249
7265
  "Side by Side",
7250
7266
  "Stacked",
7251
7267
  "Quad"
7252
- ], Po = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAACXBIWXMAAAsTAAALEwEAmpwYAAAC60lEQVRYhe2YT4hNcRTHP48xpmYaNAvRyEQxEhnKQljYsRm9/EmSyJiMFAsMZWNhJYoNIUVJ2VGiyb9ZzIpMpkQSahbGv9GMYWrM+1rc2zjvzvvdd+99rzdvMd+6de75nd+5387vnN/v/G5KEuWMKRNNIB8mCRaKiiL5qQb2ApuBuUAV0Ad0AJeB3sSeJRX6LJbULTf6JTUn9Z+KWMUpPyp/Avoa4CNQZ3Sj/lNpdL/xottR7AjOkHRUUpekN5I6JbVLavDH75lIfZN0UFKTpCWS0pJem/HeJBEMG6yV1ONYtgFJbZJ+GF1jDh+zJb03NuliEuwMkMo4yErS2RA/LcbuYVyCrm1mA7Dal/8Cu4FG4JD/HsTTkCy6a+SVMTPQuc1sBKb78nHghi+/A+YBxwL2lbhRY+ThuARdEVxu5JdGFvACr0otdoZ8Y4+Rn0Sn5sFFsMvI6YB9MzA1YJ8mN8k1wAHzfj4uQVdyrpI0aJL7oqTtkq4FiqPLyCOSbktqlbRL0jlJQ2b8QdwCUZ4qvhRStZL0XFK1pMd57CRvq5mfhKBriRfiFUMY6oD7eOdwPlQAN4G10dfWg+uouwXsiOssAj4AC+JMcEWwvnAuOTEr7gTXPmg34zagOwkbIIOXAo9CbDYBrcBXYN+4UUdy2sRflyS5zVNlfPX7ugpJW5V9nI7mmh+lYU0lCZ2B3TOnAVuAk0BTwC5nuhWro46KauBOQJch5OpRaoIW34GreGf+YZdRqS9NAj4Bp4ClQDvwOWxCqSM4ADQEdKE5XvbXzlITrAVe4TW+M6NMKDXBFLAMuAD0ACfIc7pMZBXXA2cY3/xmodQRHAL2A2+NLtj8ZiEKwUL/z2WMPAJcAVYALWSf8dZuDFGWeBHwKxm3sWYhiGG8Tfo6sA2vSfiSy4GrH3wGrDcfKSSKKf6v1E9yF0XK9Q1XBPuMXMw8HXTonQFwETwNzMFr64v1jzgFHIk9ybHEZYPJo65QlD3Bf2/Q/eaHPiSWAAAAAElFTkSuQmCC", Ao = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAACXBIWXMAAAsTAAALEwEAmpwYAAAETklEQVRYhe2YXYhVVRTHf3d0/JhyUrMpFbImM+whSa3Mynww+4AeIgiKoozooQ+KyMyXIAujF6OXqHyI6iEKKYgIP/owsjSFqCkprdDUTEcjbWZ0HHV+Pex1ucfb9Z57Z9REXHA4Z++99l7/s/ZZ/7X2KaiczNLwfwPIk9MA+yunNMAG4DHgV+BvoB3YFff2TPstYEyfrajVroI6Sr1GvahsbJC63HzZq04pmztSvU5tVRuqYRiYg78JeBR4HPg5ntdmxovz9wJfA3uAxuibDLQCA+IqynnAQuBuYCnwMLC1rx48U12U8cZqdWqMDcx4cI16qTpYbVKHqa+ovWUeHKsujn7VL9ULq2HI+wY7gVeBJdGeFu3J4ZUiy/cAXeHRRuAQsC/GC0B3eG4BcH/0tUV7czUAeVsMsBF4Kha9HZgCvAncAuwPnXHA0wFuGLANuDrGuoGDwFxgTqzzQ7RX5FrP2eLsdb76vnogtme6+nE8H1YPlQXHwbi3q9eqn0e7Tb25VrsF68vFY0lb1AGcDTwItGQ8tQM4AIwGmqP/EPAu8A0wElgJfFGzxTo8mKWXu9Rd4ZF96jvqjSbauEC9Sn1O3R463epLaku99voCsFXdkAH3kNpcQW+IiT/bQne3eufxBtioPqP2mKhioXpWzpxb1T8C5Ifh4ZptVoriRmAIKdrI3Lujf3bobAPeJpF0NVkKrAFuI9HTOBIxnxFrF4OgQKKr/dnJlQA+AcwABgOHA4zAamA5cE7orQL+zAEHiWI+A2bFC7aSguheYCgpqAphZz3wSB7AecCICv2TgH8oFRib4gVqka0k0h8CXAxMBW6ooDejFoCvA9OBQUAvKWM0kDz4XUZvNKXtyZMWUl7vBbaQXq457PeEziDgx/KJlQAuIPFdMcEXv5OdYWBP9M8k8VpnDQCvB4aTSrCNJB5cSdrW3tBpIJVnR0qdUTxAfdGUOVTnmwqEanNmqltC/9OgqePKg5eom8PgdvW+oJ9Kupera0O3U50TL3lcAaI+oHaF4R3qa6Z822wq0Saq89T1lmSxOrxeW/Xm4uGkiqQDmECKuKHxHW0HdpMiewSpvGqKeR8Ay0iBsYIjg6261PE2o9Q3Yqv+MqWxO9R1Hl12qs+q49Vlppy82pSr+5xJKsko4AXgHlJ0t5NIeg3wLXAlqZhtIUV8J6nmWwX8QiLjdhL5TwMWkY4R6/rrwYKlMr1Y321QZ/vfwBijPqm+rF4Wc7PjE9QllurGVeoV5gRNHsAm9fnMom3qrKPoTjKdMXaYyrFygEWQ72XWW24qhPu8xcUc2UU6O8wFPjmK7jhgPHAuMJGUGQ6U6WwE5sfzTXGvei7KA9hFOiR9D/wOfFVFt4dS2tpfRe83Ur7/CPiJakfOGgBCypubatArl2r8VfOax/LfzABKtePAzHO/5FgC7KBEzB2kOrDfUm8mOeFySv9+OyFyGmB/5aQH+C9BVKmVCNuMZgAAAABJRU5ErkJggg==";
7268
+ ], Ao = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAACXBIWXMAAAsTAAALEwEAmpwYAAAC60lEQVRYhe2YT4hNcRTHP48xpmYaNAvRyEQxEhnKQljYsRm9/EmSyJiMFAsMZWNhJYoNIUVJ2VGiyb9ZzIpMpkQSahbGv9GMYWrM+1rc2zjvzvvdd+99rzdvMd+6de75nd+5387vnN/v/G5KEuWMKRNNIB8mCRaKiiL5qQb2ApuBuUAV0Ad0AJeB3sSeJRX6LJbULTf6JTUn9Z+KWMUpPyp/Avoa4CNQZ3Sj/lNpdL/xottR7AjOkHRUUpekN5I6JbVLavDH75lIfZN0UFKTpCWS0pJem/HeJBEMG6yV1ONYtgFJbZJ+GF1jDh+zJb03NuliEuwMkMo4yErS2RA/LcbuYVyCrm1mA7Dal/8Cu4FG4JD/HsTTkCy6a+SVMTPQuc1sBKb78nHghi+/A+YBxwL2lbhRY+ThuARdEVxu5JdGFvACr0otdoZ8Y4+Rn0Sn5sFFsMvI6YB9MzA1YJ8mN8k1wAHzfj4uQVdyrpI0aJL7oqTtkq4FiqPLyCOSbktqlbRL0jlJQ2b8QdwCUZ4qvhRStZL0XFK1pMd57CRvq5mfhKBriRfiFUMY6oD7eOdwPlQAN4G10dfWg+uouwXsiOssAj4AC+JMcEWwvnAuOTEr7gTXPmg34zagOwkbIIOXAo9CbDYBrcBXYN+4UUdy2sRflyS5zVNlfPX7ugpJW5V9nI7mmh+lYU0lCZ2B3TOnAVuAk0BTwC5nuhWro46KauBOQJch5OpRaoIW34GreGf+YZdRqS9NAj4Bp4ClQDvwOWxCqSM4ADQEdKE5XvbXzlITrAVe4TW+M6NMKDXBFLAMuAD0ACfIc7pMZBXXA2cY3/xmodQRHAL2A2+NLtj8ZiEKwUL/z2WMPAJcAVYALWSf8dZuDFGWeBHwKxm3sWYhiGG8Tfo6sA2vSfiSy4GrH3wGrDcfKSSKKf6v1E9yF0XK9Q1XBPuMXMw8HXTonQFwETwNzMFr64v1jzgFHIk9ybHEZYPJo65QlD3Bf2/Q/eaHPiSWAAAAAElFTkSuQmCC", Do = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAACXBIWXMAAAsTAAALEwEAmpwYAAAETklEQVRYhe2YXYhVVRTHf3d0/JhyUrMpFbImM+whSa3Mynww+4AeIgiKoozooQ+KyMyXIAujF6OXqHyI6iEKKYgIP/owsjSFqCkprdDUTEcjbWZ0HHV+Pex1ucfb9Z57Z9REXHA4Z++99l7/s/ZZ/7X2KaiczNLwfwPIk9MA+yunNMAG4DHgV+BvoB3YFff2TPstYEyfrajVroI6Sr1GvahsbJC63HzZq04pmztSvU5tVRuqYRiYg78JeBR4HPg5ntdmxovz9wJfA3uAxuibDLQCA+IqynnAQuBuYCnwMLC1rx48U12U8cZqdWqMDcx4cI16qTpYbVKHqa+ovWUeHKsujn7VL9ULq2HI+wY7gVeBJdGeFu3J4ZUiy/cAXeHRRuAQsC/GC0B3eG4BcH/0tUV7czUAeVsMsBF4Kha9HZgCvAncAuwPnXHA0wFuGLANuDrGuoGDwFxgTqzzQ7RX5FrP2eLsdb76vnogtme6+nE8H1YPlQXHwbi3q9eqn0e7Tb25VrsF68vFY0lb1AGcDTwItGQ8tQM4AIwGmqP/EPAu8A0wElgJfFGzxTo8mKWXu9Rd4ZF96jvqjSbauEC9Sn1O3R463epLaku99voCsFXdkAH3kNpcQW+IiT/bQne3eufxBtioPqP2mKhioXpWzpxb1T8C5Ifh4ZptVoriRmAIKdrI3Lujf3bobAPeJpF0NVkKrAFuI9HTOBIxnxFrF4OgQKKr/dnJlQA+AcwABgOHA4zAamA5cE7orQL+zAEHiWI+A2bFC7aSguheYCgpqAphZz3wSB7AecCICv2TgH8oFRib4gVqka0k0h8CXAxMBW6ooDejFoCvA9OBQUAvKWM0kDz4XUZvNKXtyZMWUl7vBbaQXq457PeEziDgx/KJlQAuIPFdMcEXv5OdYWBP9M8k8VpnDQCvB4aTSrCNJB5cSdrW3tBpIJVnR0qdUTxAfdGUOVTnmwqEanNmqltC/9OgqePKg5eom8PgdvW+oJ9Kupera0O3U50TL3lcAaI+oHaF4R3qa6Z822wq0Saq89T1lmSxOrxeW/Xm4uGkiqQDmECKuKHxHW0HdpMiewSpvGqKeR8Ay0iBsYIjg6261PE2o9Q3Yqv+MqWxO9R1Hl12qs+q49Vlppy82pSr+5xJKsko4AXgHlJ0t5NIeg3wLXAlqZhtIUV8J6nmWwX8QiLjdhL5TwMWkY4R6/rrwYKlMr1Y321QZ/vfwBijPqm+rF4Wc7PjE9QllurGVeoV5gRNHsAm9fnMom3qrKPoTjKdMXaYyrFygEWQ72XWW24qhPu8xcUc2UU6O8wFPjmK7jhgPHAuMJGUGQ6U6WwE5sfzTXGvei7KA9hFOiR9D/wOfFVFt4dS2tpfRe83Ur7/CPiJakfOGgBCypubatArl2r8VfOax/LfzABKtePAzHO/5FgC7KBEzB2kOrDfUm8mOeFySv9+OyFyGmB/5aQH+C9BVKmVCNuMZgAAAABJRU5ErkJggg==";
7253
7269
  class me extends Ft {
7254
7270
  static instance = null;
7255
7271
  scene = new Vi();
@@ -7263,7 +7279,7 @@ class me extends Ft {
7263
7279
  cameraHelpers = /* @__PURE__ */ new Map();
7264
7280
  lightHelpers = /* @__PURE__ */ new Map();
7265
7281
  helpersContainer = new ti();
7266
- grid = new mo();
7282
+ grid = new fo();
7267
7283
  interactionHelper = new ya(25);
7268
7284
  currentTransform;
7269
7285
  // Tools
@@ -7271,7 +7287,7 @@ class me extends Ft {
7271
7287
  // Override Materials
7272
7288
  depthMaterial = new ba();
7273
7289
  normalsMaterial = new Ea();
7274
- uvMaterial = new _o();
7290
+ uvMaterial = new vo();
7275
7291
  wireframeMaterial = new Je({
7276
7292
  opacity: 0.33,
7277
7293
  transparent: !0,
@@ -7319,7 +7335,7 @@ class me extends Ft {
7319
7335
  interactionModeOpen: !1,
7320
7336
  lastUpdate: Date.now()
7321
7337
  }, s.setItem(`${t}_mode`, this.state.mode), s.setItem(`${t}_tlCam`, s.getItem(`${t}_tlCam`) !== null ? s.getItem(`${t}_tlCam`) : "Debug"), s.setItem(`${t}_trCam`, s.getItem(`${t}_trCam`) !== null ? s.getItem(`${t}_trCam`) : "Orthographic"), s.setItem(`${t}_blCam`, s.getItem(`${t}_blCam`) !== null ? s.getItem(`${t}_blCam`) : "Front"), s.setItem(`${t}_brCam`, s.getItem(`${t}_brCam`) !== null ? s.getItem(`${t}_brCam`) : "Top"), s.setItem(`${t}_tlRender`, s.getItem(`${t}_tlRender`) !== null ? s.getItem(`${t}_tlRender`) : "Renderer"), s.setItem(`${t}_trRender`, s.getItem(`${t}_trRender`) !== null ? s.getItem(`${t}_trRender`) : "Renderer"), s.setItem(`${t}_blRender`, s.getItem(`${t}_blRender`) !== null ? s.getItem(`${t}_blRender`) : "Renderer"), s.setItem(`${t}_brRender`, s.getItem(`${t}_brRender`) !== null ? s.getItem(`${t}_brRender`) : "Renderer");
7322
- const a = {
7338
+ const r = {
7323
7339
  Vector2: pe,
7324
7340
  Vector3: P,
7325
7341
  Vector4: Pa,
@@ -7330,9 +7346,9 @@ class me extends Ft {
7330
7346
  Sphere: Da,
7331
7347
  Raycaster: ai
7332
7348
  };
7333
- ke.install({ THREE: a }), this.setupScene(), this.setupTools();
7334
- const r = localStorage.getItem(this.expandedCameraVisibility);
7335
- this.cameraVisibility = r !== null ? r === "open" : !1, this.saveExpandedCameraVisibility();
7349
+ ke.install({ THREE: r }), this.setupScene(), this.setupTools();
7350
+ const a = localStorage.getItem(this.expandedCameraVisibility);
7351
+ this.cameraVisibility = a !== null ? a === "open" : !1, this.saveExpandedCameraVisibility();
7336
7352
  const o = localStorage.getItem(this.expandedLightVisibility);
7337
7353
  this.lightVisibility = o !== null ? o === "open" : !1, this.saveExpandedLightVisibility(), me.instance = this;
7338
7354
  }
@@ -7522,7 +7538,7 @@ class me extends Ft {
7522
7538
  Fs,
7523
7539
  {
7524
7540
  name: "cameraHelper",
7525
- icon: Po,
7541
+ icon: Ao,
7526
7542
  selected: this.cameraVisibility,
7527
7543
  height: 24,
7528
7544
  top: 2,
@@ -7540,7 +7556,7 @@ class me extends Ft {
7540
7556
  Fs,
7541
7557
  {
7542
7558
  name: "lightHelper",
7543
- icon: Ao,
7559
+ icon: Do,
7544
7560
  selected: this.lightVisibility,
7545
7561
  height: 24,
7546
7562
  top: 4,
@@ -7566,9 +7582,9 @@ class me extends Ft {
7566
7582
  }
7567
7583
  setupScene() {
7568
7584
  this.scene.name = "Debug Scene", this.scene.uuid = "", this.helpersContainer.name = "helpers", this.scene.add(this.helpersContainer), this.grid.position.y = -1, this.helpersContainer.add(this.grid), this.interactionHelper.name = "interactionHelper", this.interactionHelper.visible = !1, this.helpersContainer.add(this.interactionHelper);
7569
- const e = (a, r) => {
7585
+ const e = (r, a) => {
7570
7586
  const o = new ki(-100, 100, 100, -100, 0, 3e3);
7571
- return o.name = a, o.position.copy(r), o.lookAt(0, 0, 0), this.cameras.set(a, o), o;
7587
+ return o.name = r, o.position.copy(a), o.lookAt(0, 0, 0), this.cameras.set(r, o), o;
7572
7588
  }, t = 1e3;
7573
7589
  e("Top", new P(0, t, 0)), e("Bottom", new P(0, -t, 0)), e("Left", new P(-t, 0, 0)), e("Right", new P(t, 0, 0)), e("Front", new P(0, 0, t)), e("Back", new P(0, 0, -t)), e("Orthographic", new P(t, t, t)), e("UI", new P()), this.debugCamera = new ps(60, 1, 50, 5e3), this.debugCamera.name = "Debug", this.debugCamera.position.set(500, 500, 500), this.debugCamera.lookAt(0, 0, 0), this.cameras.set("Debug", this.debugCamera), this.currentCamera = this.debugCamera;
7574
7590
  const s = localStorage, n = this.props.three.app.appID;
@@ -7591,7 +7607,7 @@ class me extends Ft {
7591
7607
  break;
7592
7608
  }
7593
7609
  }
7594
- }), this.splineEditor = new Mo(this.currentCamera), this.splineEditor.initDebug(), this.scene.add(this.splineEditor);
7610
+ }), this.splineEditor = new Po(this.currentCamera), this.splineEditor.initDebug(), this.scene.add(this.splineEditor);
7595
7611
  }
7596
7612
  // Public
7597
7613
  play() {
@@ -7653,9 +7669,9 @@ class me extends Ft {
7653
7669
  s = e, n = t;
7654
7670
  break;
7655
7671
  }
7656
- const a = s / n;
7657
- this.cameras.forEach((r) => {
7658
- r instanceof ki ? (r.left = s / -2, r.right = s / 2, r.top = n / 2, r.bottom = n / -2, r.name === "UI" && (r.position.x = this.width / 2, r.position.y = this.height / -2, r.position.z = 100), r.updateProjectionMatrix()) : r instanceof ps && (r.aspect = a, r.updateProjectionMatrix()), this.cameraHelpers.get(r.name)?.update();
7672
+ const r = s / n;
7673
+ this.cameras.forEach((a) => {
7674
+ a instanceof ki ? (a.left = s / -2, a.right = s / 2, a.top = n / 2, a.bottom = n / -2, a.name === "UI" && (a.position.x = this.width / 2, a.position.y = this.height / -2, a.position.z = 100), a.updateProjectionMatrix()) : a instanceof ps && (a.aspect = r, a.updateProjectionMatrix()), this.cameraHelpers.get(a.name)?.update();
7659
7675
  });
7660
7676
  };
7661
7677
  sceneUpdate = (e) => {
@@ -7671,8 +7687,8 @@ class me extends Ft {
7671
7687
  if (s !== void 0) {
7672
7688
  const n = s;
7673
7689
  this.cameras.set(t.name, n);
7674
- const a = new wa(n);
7675
- a.visible = this.cameraVisibility, this.cameraHelpers.set(n.name, a), this.scene.add(a), this.setState({ lastUpdate: Date.now() });
7690
+ const r = new wa(n);
7691
+ r.visible = this.cameraVisibility, this.cameraHelpers.set(n.name, r), this.scene.add(r), this.setState({ lastUpdate: Date.now() });
7676
7692
  }
7677
7693
  };
7678
7694
  removeCamera = (e) => {
@@ -7684,10 +7700,10 @@ class me extends Ft {
7684
7700
  this.renderer.getSize(t);
7685
7701
  const s = Math.min(e.clientX, t.x), n = Math.min(e.clientY, t.y);
7686
7702
  this.pointer.x = ot(s, 0, t.x, -1, 1), this.pointer.y = ot(n, 0, t.y, 1, -1);
7687
- const a = t.x / 2, r = t.y / 2, o = () => {
7688
- s < a ? this.pointer.x = ot(s, 0, a, -1, 1) : this.pointer.x = ot(s, a, t.x, -1, 1);
7703
+ const r = t.x / 2, a = t.y / 2, o = () => {
7704
+ s < r ? this.pointer.x = ot(s, 0, r, -1, 1) : this.pointer.x = ot(s, r, t.x, -1, 1);
7689
7705
  }, c = () => {
7690
- n < r ? this.pointer.y = ot(n, 0, r, 1, -1) : this.pointer.y = ot(n, r, t.y, 1, -1);
7706
+ n < a ? this.pointer.y = ot(n, 0, a, 1, -1) : this.pointer.y = ot(n, a, t.y, 1, -1);
7691
7707
  };
7692
7708
  switch (this.state.mode) {
7693
7709
  case "Quad":
@@ -7700,7 +7716,7 @@ class me extends Ft {
7700
7716
  c(), c();
7701
7717
  break;
7702
7718
  }
7703
- if (this.updateCamera(s, n, a, r), this.state.interactionMode === "Orbit")
7719
+ if (this.updateCamera(s, n, r, a), this.state.interactionMode === "Orbit")
7704
7720
  return;
7705
7721
  const l = this.raycaster.intersectObjects(this.currentScene.children);
7706
7722
  l.length > 0 && this.interactionHelper.position.copy(l[0].point);
@@ -7779,7 +7795,7 @@ class me extends Ft {
7779
7795
  t = new Ta(e, 250), t.name = `${e.name}Helper`, t.visible = this.lightVisibility, this.lightHelpers.set(e.name, t), this.helpersContainer.add(t);
7780
7796
  break;
7781
7797
  case "RectAreaLight":
7782
- t = new Wr(e), t.name = `${e.name}Helper`, t.visible = this.lightVisibility, this.lightHelpers.set(e.name, t), this.helpersContainer.add(t);
7798
+ t = new Gr(e), t.name = `${e.name}Helper`, t.visible = this.lightVisibility, this.lightHelpers.set(e.name, t), this.helpersContainer.add(t);
7783
7799
  break;
7784
7800
  case "PointLight":
7785
7801
  t = new Oa(e, 100), t.name = `${e.name}Helper`, t.visible = this.lightVisibility, this.lightHelpers.set(e.name, t), this.helpersContainer.add(t);
@@ -7795,7 +7811,7 @@ class me extends Ft {
7795
7811
  const s = this.controls.get(e.name);
7796
7812
  if (s !== void 0 && s.dispose(), this.controls.delete(e.name), e.name === "UI")
7797
7813
  return;
7798
- const n = new Xr(e, t);
7814
+ const n = new $r(e, t);
7799
7815
  switch (n.enableDamping = !0, n.dampingFactor = 0.05, e.name) {
7800
7816
  case "Top":
7801
7817
  case "Bottom":
@@ -7858,11 +7874,11 @@ class me extends Ft {
7858
7874
  cancelAnimationFrame(this.cameraControlsRafID), this.cameraControlsRafID = -1, this.cameraControls && (this.cameraControls.smoothTime = 0.1);
7859
7875
  const s = 0.15, n = new qs();
7860
7876
  n.start(), this.selectedItem.getWorldPosition(e.target0);
7861
- const a = () => {
7862
- const r = n.getDelta();
7863
- this.cameraControls && this.cameraControls.update(r), t && (e.target.lerp(e.target0, s), e.object.position.lerp(e.position0, s), e.object.zoom = Nt(e.object.zoom, e.zoom0, s), e.object.updateProjectionMatrix(), e.dispatchEvent({ type: "change" })), n.getElapsedTime() >= 0.5 ? (cancelAnimationFrame(this.cameraControlsRafID), this.cameraControlsRafID = -1, this.clearControls()) : this.cameraControlsRafID = requestAnimationFrame(a);
7877
+ const r = () => {
7878
+ const a = n.getDelta();
7879
+ this.cameraControls && this.cameraControls.update(a), t && (e.target.lerp(e.target0, s), e.object.position.lerp(e.position0, s), e.object.zoom = Nt(e.object.zoom, e.zoom0, s), e.object.updateProjectionMatrix(), e.dispatchEvent({ type: "change" })), n.getElapsedTime() >= 0.5 ? (cancelAnimationFrame(this.cameraControlsRafID), this.cameraControlsRafID = -1, this.clearControls()) : this.cameraControlsRafID = requestAnimationFrame(r);
7864
7880
  };
7865
- a();
7881
+ r();
7866
7882
  };
7867
7883
  clearControls = () => {
7868
7884
  this.cameraControls !== void 0 && (this.cameraControls.disconnect(), this.cameraControls.dispose(), this.cameraControls = void 0);
@@ -7889,8 +7905,8 @@ class me extends Ft {
7889
7905
  }
7890
7906
  return null;
7891
7907
  }
7892
- drawTo(e, t, s, n, a, r) {
7893
- switch (a.name) {
7908
+ drawTo(e, t, s, n, r, a) {
7909
+ switch (r.name) {
7894
7910
  case "Left":
7895
7911
  case "Right":
7896
7912
  this.grid.rotation.z = Math.PI / 2;
@@ -7900,7 +7916,7 @@ class me extends Ft {
7900
7916
  this.grid.rotation.x = Math.PI / 2;
7901
7917
  break;
7902
7918
  }
7903
- this.scene.overrideMaterial = r, this.renderer?.setViewport(e, t, s, n), this.renderer?.setScissor(e, t, s, n), this.renderer?.render(this.scene, a), this.grid.rotation.set(0, 0, 0);
7919
+ this.scene.overrideMaterial = a, this.renderer?.setViewport(e, t, s, n), this.renderer?.setScissor(e, t, s, n), this.renderer?.render(this.scene, r), this.grid.rotation.set(0, 0, 0);
7904
7920
  }
7905
7921
  drawSingle() {
7906
7922
  const e = this.getSceneOverride(this.tlRender);
@@ -7911,14 +7927,14 @@ class me extends Ft {
7911
7927
  if (this.state.mode === "Side by Side")
7912
7928
  this.drawTo(0, 0, s, this.height, this.tlCam, e), this.drawTo(s, 0, s, this.height, this.trCam, t);
7913
7929
  else {
7914
- const a = this.height - n;
7915
- this.drawTo(0, a, this.width, n, this.tlCam, e), this.drawTo(0, 0, this.width, n, this.trCam, t);
7930
+ const r = this.height - n;
7931
+ this.drawTo(0, r, this.width, n, this.tlCam, e), this.drawTo(0, 0, this.width, n, this.trCam, t);
7916
7932
  }
7917
7933
  };
7918
7934
  drawQuad = () => {
7919
- const e = this.getSceneOverride(this.tlRender), t = this.getSceneOverride(this.trRender), s = this.getSceneOverride(this.blRender), n = this.getSceneOverride(this.brRender), a = Math.floor(this.width / 2), r = Math.floor(this.height / 2);
7935
+ const e = this.getSceneOverride(this.tlRender), t = this.getSceneOverride(this.trRender), s = this.getSceneOverride(this.blRender), n = this.getSceneOverride(this.brRender), r = Math.floor(this.width / 2), a = Math.floor(this.height / 2);
7920
7936
  let o = 0, c = 0;
7921
- c = this.height - r, o = 0, this.drawTo(o, c, a, r, this.tlCam, e), o = a, this.drawTo(o, c, a, r, this.trCam, t), c = 0, o = 0, this.scene.overrideMaterial = s, this.drawTo(o, c, a, r, this.blCam, s), o = a, this.drawTo(o, c, a, r, this.brCam, n);
7937
+ c = this.height - a, o = 0, this.drawTo(o, c, r, a, this.tlCam, e), o = r, this.drawTo(o, c, r, a, this.trCam, t), c = 0, o = 0, this.scene.overrideMaterial = s, this.drawTo(o, c, r, a, this.blCam, s), o = r, this.drawTo(o, c, r, a, this.brCam, n);
7922
7938
  };
7923
7939
  // Getters
7924
7940
  get appID() {
@@ -8009,8 +8025,8 @@ class ui extends Ft {
8009
8025
  this.props.three.updateObject(this.props.object.uuid, e, s);
8010
8026
  const n = this.props.three.getScene(this.props.object.uuid);
8011
8027
  if (n) {
8012
- const a = n.getObjectByProperty("uuid", this.props.object.uuid);
8013
- se(a, e, s);
8028
+ const r = n.getObjectByProperty("uuid", this.props.object.uuid);
8029
+ se(r, e, s);
8014
8030
  }
8015
8031
  };
8016
8032
  saveExpanded() {
@@ -8043,19 +8059,19 @@ function $s(i) {
8043
8059
  }
8044
8060
  return i;
8045
8061
  }
8046
- function Do(i, e) {
8062
+ function Ro(i, e) {
8047
8063
  function t() {
8048
8064
  return `${e.app.appID}_light`;
8049
8065
  }
8050
8066
  const s = localStorage.getItem(t()), n = s !== null ? s === "open" : !1;
8051
- function a(o) {
8067
+ function r(o) {
8052
8068
  localStorage.setItem(t(), o ? "open" : "closed");
8053
8069
  }
8054
- const r = [];
8070
+ const a = [];
8055
8071
  if (i.lightInfo !== void 0)
8056
8072
  for (const o in i.lightInfo) {
8057
8073
  const c = i.lightInfo[o];
8058
- c !== void 0 && (c.isColor !== void 0 ? r.push({
8074
+ c !== void 0 && (c.isColor !== void 0 ? a.push({
8059
8075
  title: $s(o),
8060
8076
  prop: o,
8061
8077
  type: "color",
@@ -8069,7 +8085,7 @@ function Do(i, e) {
8069
8085
  se(f, l, p);
8070
8086
  }
8071
8087
  }
8072
- }) : r.push({
8088
+ }) : a.push({
8073
8089
  title: $s(o),
8074
8090
  prop: o,
8075
8091
  type: typeof c,
@@ -8089,21 +8105,21 @@ function Do(i, e) {
8089
8105
  Oe,
8090
8106
  {
8091
8107
  title: "Light",
8092
- items: r,
8108
+ items: a,
8093
8109
  expanded: n,
8094
8110
  onToggle: (o) => {
8095
- a(o);
8111
+ r(o);
8096
8112
  }
8097
8113
  }
8098
8114
  );
8099
8115
  }
8100
- function Ro(i) {
8116
+ function Io(i) {
8101
8117
  const e = i.object, t = i.three;
8102
8118
  function s() {
8103
8119
  return `${t.app.appID}_animation`;
8104
8120
  }
8105
- const n = localStorage.getItem(s()), a = n !== null ? n === "open" : !1;
8106
- function r(m) {
8121
+ const n = localStorage.getItem(s()), r = n !== null ? n === "open" : !1;
8122
+ function a(m) {
8107
8123
  localStorage.setItem(s(), m ? "open" : "closed");
8108
8124
  }
8109
8125
  const o = [], c = [];
@@ -8179,9 +8195,9 @@ function Ro(i) {
8179
8195
  {
8180
8196
  title: "Animation",
8181
8197
  items: o,
8182
- expanded: a,
8198
+ expanded: r,
8183
8199
  onToggle: (m) => {
8184
- r(m);
8200
+ a(m);
8185
8201
  }
8186
8202
  }
8187
8203
  );
@@ -8200,20 +8216,20 @@ const Bi = {
8200
8216
  children: []
8201
8217
  };
8202
8218
  let ce = { ...Bi };
8203
- function Io(i) {
8219
+ function Lo(i) {
8204
8220
  const [e, t] = B(-1);
8205
8221
  tt(() => {
8206
- function r(c) {
8222
+ function a(c) {
8207
8223
  ce = { ...c.value }, t(Date.now());
8208
8224
  }
8209
8225
  function o() {
8210
8226
  ce = { ...Bi }, t(Date.now());
8211
8227
  }
8212
- return D.addEventListener(A.SET_SCENE, o), D.addEventListener(A.SET_OBJECT, r), () => {
8213
- D.removeEventListener(A.SET_SCENE, o), D.removeEventListener(A.SET_OBJECT, r);
8228
+ return D.addEventListener(A.SET_SCENE, o), D.addEventListener(A.SET_OBJECT, a), () => {
8229
+ D.removeEventListener(A.SET_SCENE, o), D.removeEventListener(A.SET_OBJECT, a);
8214
8230
  };
8215
8231
  }, []);
8216
- const s = ce.type.toLowerCase(), n = ce.animations.length > 0 || ce.mixer !== void 0, a = s.search("mesh") > -1 || s.search("line") > -1 || s.search("points") > -1;
8232
+ const s = ce.type.toLowerCase(), n = ce.animations.length > 0 || ce.mixer !== void 0, r = s.search("mesh") > -1 || s.search("line") > -1 || s.search("points") > -1;
8217
8233
  return /* @__PURE__ */ u.jsx(
8218
8234
  li,
8219
8235
  {
@@ -8256,17 +8272,17 @@ function Io(i) {
8256
8272
  ] }),
8257
8273
  /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
8258
8274
  /* @__PURE__ */ u.jsx(ui, { object: ce, three: i.three }),
8259
- n ? /* @__PURE__ */ u.jsx(Ro, { object: ce, three: i.three }) : null,
8260
- s.search("camera") > -1 ? Zr(ce, i.three) : null,
8261
- s.search("light") > -1 ? Do(ce, i.three) : null,
8262
- a ? Yr(ce, i.three) : null
8275
+ n ? /* @__PURE__ */ u.jsx(Io, { object: ce, three: i.three }) : null,
8276
+ s.search("camera") > -1 ? Wr(ce, i.three) : null,
8277
+ s.search("light") > -1 ? Ro(ce, i.three) : null,
8278
+ r ? Br(ce, i.three) : null
8263
8279
  ] })
8264
8280
  ] }) }, e)
8265
8281
  },
8266
8282
  "Inspector"
8267
8283
  );
8268
8284
  }
8269
- class Lo extends Ft {
8285
+ class ko extends Ft {
8270
8286
  // Renderer
8271
8287
  autoClear = !0;
8272
8288
  autoClearColor = !0;
@@ -8483,8 +8499,8 @@ class Lo extends Ft {
8483
8499
  return `${this.props.three.app.appID}_renderer`;
8484
8500
  }
8485
8501
  }
8486
- function ko(i) {
8487
- const [e] = B([]), [t] = B([]), [s, n] = B(0), a = (c) => {
8502
+ function Uo(i) {
8503
+ const [e] = B([]), [t] = B([]), [s, n] = B(0), r = (c) => {
8488
8504
  const l = c.value;
8489
8505
  e.push(l), t.push(
8490
8506
  /* @__PURE__ */ u.jsx(
@@ -8501,7 +8517,7 @@ function ko(i) {
8501
8517
  Math.random()
8502
8518
  )
8503
8519
  ), n(Date.now());
8504
- }, r = (c) => {
8520
+ }, a = (c) => {
8505
8521
  const l = c.value;
8506
8522
  for (let d = 0; d < e.length; d++)
8507
8523
  if (l.uuid === e[d].uuid) {
@@ -8528,16 +8544,16 @@ function ko(i) {
8528
8544
  return;
8529
8545
  }
8530
8546
  };
8531
- return tt(() => (D.addEventListener(A.ADD_SCENE, a), D.addEventListener(A.REFRESH_SCENE, r), D.addEventListener(A.REMOVE_SCENE, o), () => {
8532
- D.removeEventListener(A.ADD_SCENE, a), D.removeEventListener(A.REFRESH_SCENE, r), D.removeEventListener(A.REMOVE_SCENE, o);
8547
+ return tt(() => (D.addEventListener(A.ADD_SCENE, r), D.addEventListener(A.REFRESH_SCENE, a), D.addEventListener(A.REMOVE_SCENE, o), () => {
8548
+ D.removeEventListener(A.ADD_SCENE, r), D.removeEventListener(A.REFRESH_SCENE, a), D.removeEventListener(A.REMOVE_SCENE, o);
8533
8549
  }), []), /* @__PURE__ */ u.jsxs("div", { id: "SidePanel", children: [
8534
8550
  /* @__PURE__ */ u.jsx("div", { className: "scenes", children: t }, s),
8535
- /* @__PURE__ */ u.jsx(Io, { three: i.three }),
8536
8551
  /* @__PURE__ */ u.jsx(Lo, { three: i.three }),
8552
+ /* @__PURE__ */ u.jsx(ko, { three: i.three }),
8537
8553
  /* @__PURE__ */ u.jsx(te, { three: i.three })
8538
8554
  ] });
8539
8555
  }
8540
- function al(i) {
8556
+ function rl(i) {
8541
8557
  return tt(() => {
8542
8558
  function e(o) {
8543
8559
  let c = null;
@@ -8554,7 +8570,7 @@ function al(i) {
8554
8570
  }, n = (o) => {
8555
8571
  const c = o.value, { key: l, value: d, uuid: p } = c;
8556
8572
  s(p, l, d);
8557
- }, a = (o) => {
8573
+ }, r = (o) => {
8558
8574
  const c = o.value, d = e(c.uuid)?.getObjectByProperty("uuid", c.uuid);
8559
8575
  if (d !== void 0) {
8560
8576
  const p = (m) => {
@@ -8582,30 +8598,30 @@ function al(i) {
8582
8598
  m.offset.set(c.value.offset[0], c.value.offset[1]), m.repeat.set(c.value.repeat[0], c.value.repeat[1]), p(m);
8583
8599
  }) : p(null);
8584
8600
  }
8585
- }, r = (o) => {
8601
+ }, a = (o) => {
8586
8602
  const { key: c, uuid: l, value: d, subitem: p } = o.value, f = e(l)?.getObjectByProperty("uuid", l);
8587
8603
  if (f !== void 0)
8588
8604
  try {
8589
- p !== void 0 ? fr(f, p)[c](d) : f[c](d);
8605
+ p !== void 0 ? gr(f, p)[c](d) : f[c](d);
8590
8606
  } catch (E) {
8591
8607
  console.log("Error requesting method:"), console.log(E), console.log(c), console.log(d);
8592
8608
  }
8593
8609
  };
8594
- return D.addEventListener(A.GET_OBJECT, t), D.addEventListener(A.UPDATE_OBJECT, n), D.addEventListener(A.CREATE_TEXTURE, a), D.addEventListener(A.REQUEST_METHOD, r), () => {
8595
- D.removeEventListener(A.GET_OBJECT, t), D.removeEventListener(A.UPDATE_OBJECT, n), D.removeEventListener(A.CREATE_TEXTURE, a), D.removeEventListener(A.REQUEST_METHOD, r);
8610
+ return D.addEventListener(A.GET_OBJECT, t), D.addEventListener(A.UPDATE_OBJECT, n), D.addEventListener(A.CREATE_TEXTURE, r), D.addEventListener(A.REQUEST_METHOD, a), () => {
8611
+ D.removeEventListener(A.GET_OBJECT, t), D.removeEventListener(A.UPDATE_OBJECT, n), D.removeEventListener(A.CREATE_TEXTURE, r), D.removeEventListener(A.REQUEST_METHOD, a);
8596
8612
  };
8597
8613
  }, []), null;
8598
8614
  }
8599
- function Uo(i) {
8615
+ function jo(i) {
8600
8616
  return /* @__PURE__ */ u.jsxs("div", { className: "editor", ref: i.ref, style: i.style, children: [
8601
8617
  /* @__PURE__ */ u.jsx("div", { className: "header", children: i.header }),
8602
8618
  i.children,
8603
8619
  /* @__PURE__ */ u.jsx("div", { className: "footer", children: i.footer })
8604
8620
  ] });
8605
8621
  }
8606
- function rl(i) {
8622
+ function ol(i) {
8607
8623
  return /* @__PURE__ */ u.jsx(
8608
- Uo,
8624
+ jo,
8609
8625
  {
8610
8626
  header: /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
8611
8627
  /* @__PURE__ */ u.jsx(
@@ -8662,69 +8678,69 @@ function rl(i) {
8662
8678
  onSceneUpdate: i.onSceneUpdate
8663
8679
  }
8664
8680
  ),
8665
- /* @__PURE__ */ u.jsx(ko, { three: i.three })
8681
+ /* @__PURE__ */ u.jsx(Uo, { three: i.three })
8666
8682
  ] })
8667
8683
  }
8668
8684
  );
8669
8685
  }
8670
8686
  export {
8671
8687
  li as Accordion,
8672
- Ko as AppRunner,
8673
- qo as Application,
8688
+ Qo as AppRunner,
8689
+ Ko as Application,
8674
8690
  $i as BaseRemote,
8675
- Qo as BaseScene,
8691
+ Jo as BaseScene,
8676
8692
  xn as ChildObject,
8677
8693
  Ss as ContainerObject,
8678
8694
  wn as Draggable,
8679
- Er as DraggableItem,
8695
+ Cr as DraggableItem,
8680
8696
  Sn as Dropdown,
8681
- Cr as DropdownItem,
8682
- Uo as Editor,
8683
- Xo as ElementProxy,
8684
- cr as ElementProxyReceiver,
8697
+ wr as DropdownItem,
8698
+ jo as Editor,
8699
+ $o as ElementProxy,
8700
+ hr as ElementProxyReceiver,
8685
8701
  ii as ExportTexture,
8686
- Io as Inspector,
8702
+ Lo as Inspector,
8687
8703
  me as MultiView,
8688
8704
  Cn as NavButton,
8689
- $o as ProxyManager,
8705
+ qo as ProxyManager,
8690
8706
  qa as QualityType,
8691
- Jo as RemoteComponents,
8692
- nl as RemoteController,
8693
- il as RemoteTheatre,
8694
- sl as RemoteThree,
8695
- al as SceneInspector,
8696
- ko as SidePanel,
8707
+ el as RemoteComponents,
8708
+ al as RemoteController,
8709
+ sl as RemoteTheatre,
8710
+ nl as RemoteThree,
8711
+ rl as SceneInspector,
8712
+ Uo as SidePanel,
8697
8713
  Gs as Spline,
8698
- Mo as SplineEditor,
8699
- rl as ThreeEditor,
8714
+ Po as SplineEditor,
8715
+ ol as ThreeEditor,
8700
8716
  A as ToolEvents,
8701
8717
  ge as Transform,
8702
- Go as WebworkerEventHandlers,
8718
+ Xo as WebworkerEventHandlers,
8703
8719
  oi as capitalize,
8704
8720
  $e as clamp,
8705
8721
  gs as colorToHex,
8706
8722
  Ya as copyToClipboard,
8707
- Zo as cubicBezier,
8708
- tl as customizeTheatreElements,
8709
- Bo as damp,
8723
+ Wo as cubicBezier,
8724
+ il as customizeTheatreElements,
8725
+ Vo as damp,
8710
8726
  D as debugDispatcher,
8711
- Fo as defaultTheatreCallback,
8712
- zo as detectSettings,
8727
+ zo as defaultTheatreCallback,
8728
+ Ho as detectSettings,
8713
8729
  He as dispose,
8714
8730
  bn as disposeMaterial,
8715
8731
  bs as disposeTexture,
8716
- Yo as distance,
8732
+ Bo as distance,
8717
8733
  Fi as hierarchyUUID,
8718
8734
  Va as isColor,
8719
- Ho as map,
8735
+ Yo as map,
8720
8736
  Nt as mix,
8721
8737
  ri as noop,
8722
8738
  ji as normalize,
8723
- Wo as parseModelLite,
8739
+ Go as parseModelLite,
8724
8740
  Ba as randomID,
8725
8741
  Es as resetThreeObjects,
8726
8742
  Pe as round,
8727
- Vo as roundTo,
8728
- el as theatreEditorApp,
8743
+ Zo as roundTo,
8744
+ tl as theatreEditorApp,
8729
8745
  Ni as totalThreeObjects
8730
8746
  };