@tomorrowevening/hermes 0.0.38 → 0.0.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,64 +1,63 @@
1
- import { PositionalAudio as Vn, EventDispatcher as un, Texture as dn, CubeTexture as Wn, RepeatWrapping as Kt, ShaderMaterial as hn, GLSL3 as Hn, DoubleSide as fn, Color as Tt, Mesh as qn, PlaneGeometry as Kn, FrontSide as Xn, BackSide as Zn, NoBlending as Jn, NormalBlending as Qn, AdditiveBlending as ea, SubtractiveBlending as ta, MultiplyBlending as na, CustomBlending as aa, AddEquation as ia, SubtractEquation as ra, ReverseSubtractEquation as sa, MinEquation as oa, MaxEquation as ca, ZeroFactor as pn, OneFactor as mn, SrcColorFactor as vn, OneMinusSrcColorFactor as gn, SrcAlphaFactor as bn, OneMinusSrcAlphaFactor as yn, DstAlphaFactor as En, OneMinusDstAlphaFactor as Cn, DstColorFactor as xn, OneMinusDstColorFactor as Sn, SrcAlphaSaturateFactor as la, ConstantColorFactor as wn, OneMinusConstantColorFactor as On, ConstantAlphaFactor as Mn, OneMinusConstantAlphaFactor as Tn, Matrix4 as ua, Vector3 as X, Euler as da, Ray as ha, Plane as fa, MathUtils as pa, MOUSE as Ve, TOUCH as We, Quaternion as Xt, Spherical as Zt, Vector2 as ue, PerspectiveCamera as zt, MeshDepthMaterial as ma, MeshNormalMaterial as va, MeshBasicMaterial as ga, OrthographicCamera as Rn, Scene as _n, Group as ba, AxesHelper as An, WebGLRenderer as ya, Raycaster as Ea, CameraHelper as Ca } from "three";
2
- import { getProject as xa, createRafDriver as Sa } from "@theatre/core";
1
+ import { PositionalAudio as Vn, EventDispatcher as ln, Texture as un, CubeTexture as Hn, RepeatWrapping as qt, ShaderMaterial as dn, GLSL3 as Wn, DoubleSide as hn, Color as Mt, Mesh as qn, PlaneGeometry as Kn, FrontSide as Xn, BackSide as Zn, NoBlending as Jn, NormalBlending as Qn, AdditiveBlending as ea, SubtractiveBlending as ta, MultiplyBlending as na, CustomBlending as aa, AddEquation as ia, SubtractEquation as ra, ReverseSubtractEquation as oa, MinEquation as sa, MaxEquation as ca, ZeroFactor as fn, OneFactor as pn, SrcColorFactor as mn, OneMinusSrcColorFactor as vn, SrcAlphaFactor as gn, OneMinusSrcAlphaFactor as bn, DstAlphaFactor as yn, OneMinusDstAlphaFactor as En, DstColorFactor as Cn, OneMinusDstColorFactor as xn, SrcAlphaSaturateFactor as la, ConstantColorFactor as wn, OneMinusConstantColorFactor as Sn, ConstantAlphaFactor as On, OneMinusConstantAlphaFactor as Mn, Matrix4 as ua, Vector3 as X, Euler as da, Ray as ha, Plane as fa, MathUtils as pa, MOUSE as Ve, TOUCH as He, Quaternion as Kt, Spherical as Xt, Vector2 as ue, PerspectiveCamera as $t, MeshDepthMaterial as ma, MeshNormalMaterial as va, MeshBasicMaterial as ga, OrthographicCamera as Tn, Scene as Rn, Group as ba, AxesHelper as _n, WebGLRenderer as ya, Raycaster as Ea, CameraHelper as Ca } from "three";
3
2
  import at from "@theatre/studio";
4
- import { Pane as wa } from "tweakpane";
5
- import * as Oa from "@tweakpane/plugin-essentials";
6
- import Pn, { useState as se, useRef as Ee, useEffect as Fe, Component as Ma, forwardRef as Ta } from "react";
7
- import { Reorder as kn } from "framer-motion";
8
- function lt(t) {
3
+ import { Pane as xa } from "tweakpane";
4
+ import * as wa from "@tweakpane/plugin-essentials";
5
+ import An, { useState as ae, useRef as Ee, useEffect as Oe, forwardRef as Sa } from "react";
6
+ import { Reorder as Pn } from "framer-motion";
7
+ function ct(t) {
9
8
  return t.substring(0, 1).toUpperCase() + t.substring(1);
10
9
  }
11
- function Pi(t, n, a) {
10
+ function Ti(t, n, a) {
12
11
  return Math.min(n, Math.max(t, a));
13
12
  }
14
- function ki(t, n) {
13
+ function Ri(t, n) {
15
14
  const a = t - n;
16
15
  return Math.sqrt(a * a);
17
16
  }
18
- function Ra() {
17
+ function Oa() {
19
18
  return Math.round(Math.random() * 1e6).toString();
20
19
  }
21
- function _a(t) {
20
+ function Ma(t) {
22
21
  return t.r !== void 0 && t.g !== void 0 && t.b !== void 0;
23
22
  }
24
- function Aa(t) {
25
- const n = Math.round(t.r * 255), a = Math.round(t.g * 255), e = Math.round(t.b * 255), s = (u) => {
23
+ function Ta(t) {
24
+ const n = Math.round(t.r * 255), a = Math.round(t.g * 255), e = Math.round(t.b * 255), o = (u) => {
26
25
  const f = u.toString(16);
27
26
  return f.length === 1 ? "0" + f : f;
28
- }, o = s(n), p = s(a), c = s(e);
29
- return "#" + o + p + c;
27
+ }, s = o(n), p = o(a), c = o(e);
28
+ return "#" + s + p + c;
30
29
  }
31
- function Ft(t, n = 1) {
30
+ function Nt(t, n = 1) {
32
31
  return Number(t.toFixed(n));
33
32
  }
34
- let Yt = 0;
35
- const Pa = () => {
36
- Yt = 0;
37
- }, jn = (t) => {
33
+ let zt = 0;
34
+ const Ra = () => {
35
+ zt = 0;
36
+ }, kn = (t) => {
38
37
  if (!t)
39
38
  return;
40
39
  let n = t.name.replace(" ", "");
41
- n.length === 0 && (n = `obj_${Yt}`, Yt++), t.parent !== null && (n = `${t.parent.uuid}.${n}`), t.uuid = n, t.children.forEach((a) => {
42
- jn(a);
40
+ n.length === 0 && (n = `obj_${zt}`, zt++), t.parent !== null && (n = `${t.parent.uuid}.${n}`), t.uuid = n, t.children.forEach((a) => {
41
+ kn(a);
43
42
  });
44
- }, ji = (t) => {
43
+ }, _i = (t) => {
45
44
  t?.dispose();
46
- }, ka = (t) => {
45
+ }, _a = (t) => {
47
46
  t && (Array.isArray(t) ? t.forEach((n) => n.dispose()) : t.dispose());
48
- }, Dn = (t) => {
47
+ }, jn = (t) => {
49
48
  if (t) {
50
49
  for (; t.children.length > 0; ) {
51
50
  const n = t.children[0];
52
- n instanceof Vn ? (n.pause(), n.parent && n.parent.remove(n)) : Dn(n);
51
+ n instanceof Vn ? (n.pause(), n.parent && n.parent.remove(n)) : jn(n);
53
52
  }
54
53
  if (t.parent && t.parent.remove(t), t.isMesh) {
55
54
  const n = t;
56
- n.geometry?.dispose(), ka(n.material);
55
+ n.geometry?.dispose(), _a(n.material);
57
56
  }
58
57
  t.dispose !== void 0 && t.dispose();
59
58
  }
60
59
  };
61
- class Di {
60
+ class Ai {
62
61
  components = /* @__PURE__ */ new Map();
63
62
  listen;
64
63
  // Protected
@@ -120,7 +119,7 @@ class Di {
120
119
  n && (this._mode = "editor");
121
120
  }
122
121
  }
123
- const k = new un(), j = {
122
+ const k = new ln(), j = {
124
123
  CUSTOM: "ToolEvents::custom",
125
124
  // Components
126
125
  SELECT_DROPDOWN: "ToolEvents::selectDropdown",
@@ -136,7 +135,7 @@ const k = new un(), j = {
136
135
  ADD_CAMERA: "ToolEvents::addCamera",
137
136
  REMOVE_CAMERA: "ToolEvents::removeCamera"
138
137
  };
139
- class Rt {
138
+ class Tt {
140
139
  app;
141
140
  constructor(n) {
142
141
  this.app = n;
@@ -154,7 +153,7 @@ class Rt {
154
153
  handleEditorApp() {
155
154
  }
156
155
  }
157
- class Ii extends Rt {
156
+ class Pi extends Tt {
158
157
  selectDropdown(n, a) {
159
158
  this.app.send({
160
159
  event: "selectComponent",
@@ -188,19 +187,16 @@ class Ii extends Rt {
188
187
  }
189
188
  }
190
189
  }
191
- const In = () => {
190
+ const Dn = () => {
192
191
  };
193
192
  let ge;
194
- class ot extends Rt {
193
+ class In extends Tt {
195
194
  project;
196
195
  sheets = /* @__PURE__ */ new Map();
197
196
  sheetObjects = /* @__PURE__ */ new Map();
198
197
  sheetObjectCBs = /* @__PURE__ */ new Map();
199
198
  sheetObjectUnsubscribe = /* @__PURE__ */ new Map();
200
- static rafDriver = null;
201
- init(n, a) {
202
- return this.project = xa(n, a), this.project.ready;
203
- }
199
+ static rafDriver = void 0;
204
200
  dispose() {
205
201
  this.project = void 0, this.sheets = /* @__PURE__ */ new Map(), this.sheetObjects = /* @__PURE__ */ new Map(), this.sheetObjectCBs = /* @__PURE__ */ new Map(), this.sheetObjectUnsubscribe = /* @__PURE__ */ new Map();
206
202
  }
@@ -236,22 +232,22 @@ class ot extends Rt {
236
232
  e.search(`${n}_`) > -1 && this.unsubscribe(a);
237
233
  });
238
234
  }
239
- sheetObject(n, a, e, s) {
235
+ sheetObject(n, a, e, o) {
240
236
  if (this.project === void 0) {
241
237
  console.error("Theatre Project hasn't been created yet.");
242
238
  return;
243
239
  }
244
- const o = this.sheet(n);
245
- if (o === void 0)
240
+ const s = this.sheet(n);
241
+ if (s === void 0)
246
242
  return;
247
243
  const p = `${n}_${a}`;
248
244
  let c = this.sheetObjects.get(p);
249
- c !== void 0 ? c = o.object(a, { ...e, ...c.value }, { reconfigure: !0 }) : c = o.object(a, e), this.sheetObjects.set(p, c), this.sheetObjectCBs.set(p, s !== void 0 ? s : In);
245
+ c !== void 0 ? c = s.object(a, { ...e, ...c.value }, { reconfigure: !0 }) : c = s.object(a, e), this.sheetObjects.set(p, c), this.sheetObjectCBs.set(p, o !== void 0 ? o : Dn);
250
246
  const u = c.onValuesChange((f) => {
251
247
  if (this.app.editor) {
252
248
  for (const b in f) {
253
249
  const E = f[b];
254
- typeof E == "object" && _a(E) && (f[b] = {
250
+ typeof E == "object" && Ma(E) && (f[b] = {
255
251
  r: E.r,
256
252
  g: E.g,
257
253
  b: E.b,
@@ -280,8 +276,8 @@ class ot extends Rt {
280
276
  }
281
277
  const a = n.address.sheetId, e = n.address.objectKey;
282
278
  this.sheets.get(a)?.detachObject(e);
283
- const o = `${a}_${e}`, p = this.sheetObjectUnsubscribe.get(o);
284
- p !== void 0 && (this.sheetObjects.delete(o), this.sheetObjectCBs.delete(o), this.sheetObjectUnsubscribe.delete(o), p());
279
+ const s = `${a}_${e}`, p = this.sheetObjectUnsubscribe.get(s);
280
+ p !== void 0 && (this.sheetObjects.delete(s), this.sheetObjectCBs.delete(s), this.sheetObjectUnsubscribe.delete(s), p());
285
281
  }
286
282
  // Remote Controller
287
283
  // Receives App events
@@ -317,21 +313,21 @@ class ot extends Rt {
317
313
  // Runs only in-editor
318
314
  handleEditorApp() {
319
315
  if (this.app.editor) {
320
- at.ui.restore(), at.onSelectionChange((s) => {
321
- s.length < 1 || s.forEach((o) => {
322
- let p = o.address.sheetId, c = "setSheet", u = {};
323
- switch (o.type) {
316
+ at.ui.restore(), at.onSelectionChange((o) => {
317
+ o.length < 1 || o.forEach((s) => {
318
+ let p = s.address.sheetId, c = "setSheet", u = {};
319
+ switch (s.type) {
324
320
  case "Theatre_Sheet_PublicAPI":
325
321
  c = "setSheet", u = {
326
- sheet: o.address.sheetId
327
- }, ge = this.sheets.get(o.address.sheetId);
322
+ sheet: s.address.sheetId
323
+ }, ge = this.sheets.get(s.address.sheetId);
328
324
  break;
329
325
  case "Theatre_SheetObject_PublicAPI":
330
- c = "setSheetObject", p += `_${o.address.objectKey}`, u = {
326
+ c = "setSheetObject", p += `_${s.address.objectKey}`, u = {
331
327
  id: p,
332
- sheet: o.address.sheetId,
333
- key: o.address.objectKey
334
- }, ge = this.sheets.get(o.address.sheetId);
328
+ sheet: s.address.sheetId,
329
+ key: s.address.objectKey
330
+ }, ge = this.sheets.get(s.address.sheetId);
335
331
  break;
336
332
  }
337
333
  this.app.send({ event: c, target: "app", data: u });
@@ -339,15 +335,15 @@ class ot extends Rt {
339
335
  });
340
336
  let n = -1;
341
337
  const a = () => {
342
- if (ot.getRafDriver().tick(performance.now()), ge !== void 0 && n !== ge.sequence.position) {
338
+ if (In.rafDriver?.tick(performance.now()), ge !== void 0 && n !== ge.sequence.position) {
343
339
  n = ge.sequence.position;
344
- const s = ge;
340
+ const o = ge;
345
341
  this.app.send({
346
342
  event: "updateTimeline",
347
343
  target: "app",
348
344
  data: {
349
345
  position: n,
350
- sheet: s.address.sheetId
346
+ sheet: o.address.sheetId
351
347
  }
352
348
  });
353
349
  }
@@ -358,11 +354,8 @@ class ot extends Rt {
358
354
  } else
359
355
  at.ui.hide();
360
356
  }
361
- static getRafDriver() {
362
- return ot.rafDriver || (ot.rafDriver = Sa()), ot.rafDriver;
363
- }
364
357
  }
365
- function ja(t) {
358
+ function Aa(t) {
366
359
  if (t.name === "cameras")
367
360
  return "camera";
368
361
  if (t.name === "interactive")
@@ -387,7 +380,7 @@ function Ln(t) {
387
380
  n.children.push(Ln(a));
388
381
  }), n;
389
382
  }
390
- function Da(t) {
383
+ function Pa(t) {
391
384
  const n = {};
392
385
  for (const a in t) {
393
386
  const e = t[a].value;
@@ -395,7 +388,7 @@ function Da(t) {
395
388
  }
396
389
  return n;
397
390
  }
398
- function Ia(t) {
391
+ function ka(t) {
399
392
  switch (t) {
400
393
  case "blendSrcAlpha":
401
394
  case "blendDstAlpha":
@@ -407,28 +400,28 @@ function Ia(t) {
407
400
  }
408
401
  return !1;
409
402
  }
410
- function He(t) {
403
+ function We(t) {
411
404
  const n = {};
412
405
  for (const a in t) {
413
- if (a.substring(0, 1) === "_" || a.substring(0, 2) === "is" || Ia(a))
406
+ if (a.substring(0, 1) === "_" || a.substring(0, 2) === "is" || ka(a))
414
407
  continue;
415
- const e = typeof t[a], s = t[a];
408
+ const e = typeof t[a], o = t[a];
416
409
  switch (e) {
417
410
  case "boolean":
418
411
  case "number":
419
412
  case "string":
420
- n[a] = s;
413
+ n[a] = o;
421
414
  break;
422
415
  case "object":
423
- if (s !== null)
424
- if (n[a] = s, s.isTexture)
425
- if (s instanceof dn) {
426
- const o = s.source.toJSON();
427
- n[a] = { src: o.url };
416
+ if (o !== null)
417
+ if (n[a] = o, o.isTexture)
418
+ if (o instanceof un) {
419
+ const s = o.source.toJSON();
420
+ n[a] = { src: s.url };
428
421
  } else
429
- s instanceof Wn && (console.log("env map"), console.log(s.source.data), console.log(s.source.toJSON()), n[a] = { src: "" });
422
+ o instanceof Hn && (console.log("env map"), console.log(o.source.data), console.log(o.source.toJSON()), n[a] = { src: "" });
430
423
  else
431
- a === "uniforms" && (n[a] = Da(n[a]));
424
+ a === "uniforms" && (n[a] = Pa(n[a]));
432
425
  else
433
426
  n[a] = { src: "" };
434
427
  break;
@@ -436,7 +429,7 @@ function He(t) {
436
429
  }
437
430
  return n;
438
431
  }
439
- function Bt(t) {
432
+ function Ft(t) {
440
433
  t.updateMatrix();
441
434
  const n = {
442
435
  name: t.name,
@@ -461,30 +454,30 @@ function Bt(t) {
461
454
  if (a.search("mesh") > -1) {
462
455
  const e = t;
463
456
  if (Array.isArray(e.material)) {
464
- const s = [];
465
- e.material.forEach((o) => {
466
- s.push(He(o));
467
- }), n.material = s;
457
+ const o = [];
458
+ e.material.forEach((s) => {
459
+ o.push(We(s));
460
+ }), n.material = o;
468
461
  } else
469
- n.material = He(e.material);
462
+ n.material = We(e.material);
470
463
  } else if (a.search("points") > -1) {
471
464
  const e = t;
472
465
  if (Array.isArray(e.material)) {
473
- const s = [];
474
- e.material.forEach((o) => {
475
- s.push(He(o));
476
- }), n.material = s;
466
+ const o = [];
467
+ e.material.forEach((s) => {
468
+ o.push(We(s));
469
+ }), n.material = o;
477
470
  } else
478
- n.material = He(e.material);
471
+ n.material = We(e.material);
479
472
  } else if (a.search("line") > -1) {
480
473
  const e = t;
481
474
  if (Array.isArray(e.material)) {
482
- const s = [];
483
- e.material.forEach((o) => {
484
- s.push(He(o));
485
- }), n.material = s;
475
+ const o = [];
476
+ e.material.forEach((s) => {
477
+ o.push(We(s));
478
+ }), n.material = o;
486
479
  } else
487
- n.material = He(e.material);
480
+ n.material = We(e.material);
488
481
  } else
489
482
  a.search("camera") > -1 ? t.type === "PerspectiveCamera" ? n.perspectiveCameraInfo = {
490
483
  fov: t.fov,
@@ -514,7 +507,7 @@ function Bt(t) {
514
507
  });
515
508
  return n;
516
509
  }
517
- function La(t, n) {
510
+ function ja(t, n) {
518
511
  const a = n.split(".");
519
512
  switch (a.length) {
520
513
  case 1:
@@ -551,16 +544,16 @@ function ee(t, n, a) {
551
544
  break;
552
545
  }
553
546
  }
554
- function Gt(t) {
547
+ function Yt(t) {
555
548
  return new Promise((n, a) => {
556
549
  const e = new Image();
557
550
  e.onload = () => {
558
- const s = new dn(e);
559
- s.wrapS = Kt, s.wrapT = Kt, s.needsUpdate = !0, n(s);
551
+ const o = new un(e);
552
+ o.wrapS = qt, o.wrapT = qt, o.needsUpdate = !0, n(o);
560
553
  }, e.onerror = a, e.src = t;
561
554
  });
562
555
  }
563
- class Li extends Rt {
556
+ class ki extends Tt {
564
557
  scene = void 0;
565
558
  getObject(n) {
566
559
  this.app.debugEnabled && this.app.send({
@@ -570,14 +563,14 @@ class Li extends Rt {
570
563
  });
571
564
  }
572
565
  setObject(n) {
573
- const a = Bt(n);
566
+ const a = Ft(n);
574
567
  this.app.send({
575
568
  event: "setObject",
576
569
  target: "editor",
577
570
  data: a
578
571
  });
579
572
  }
580
- requestMethod(n, a, e, s) {
573
+ requestMethod(n, a, e, o) {
581
574
  this.app.send({
582
575
  event: "requestMethod",
583
576
  target: "app",
@@ -585,7 +578,7 @@ class Li extends Rt {
585
578
  uuid: n,
586
579
  key: a,
587
580
  value: e,
588
- subitem: s
581
+ subitem: o
589
582
  }
590
583
  });
591
584
  }
@@ -614,7 +607,7 @@ class Li extends Rt {
614
607
  setScene(n) {
615
608
  if (n === void 0 || (this.scene = n, !this.app.debugEnabled))
616
609
  return;
617
- Pa(), jn(this.scene);
610
+ Ra(), kn(this.scene);
618
611
  const a = Ln(this.scene);
619
612
  this.app.send({
620
613
  event: "setScene",
@@ -625,7 +618,7 @@ class Li extends Rt {
625
618
  addCamera(n) {
626
619
  if (!this.app.debugEnabled)
627
620
  return;
628
- const a = Bt(n);
621
+ const a = Ft(n);
629
622
  this.app.send({
630
623
  event: "addCamera",
631
624
  target: "editor",
@@ -635,7 +628,7 @@ class Li extends Rt {
635
628
  removeCamera(n) {
636
629
  if (!this.app.debugEnabled)
637
630
  return;
638
- const a = Bt(n);
631
+ const a = Ft(n);
639
632
  this.app.send({
640
633
  event: "removeCamera",
641
634
  target: "editor",
@@ -678,7 +671,7 @@ class Li extends Rt {
678
671
  }
679
672
  }
680
673
  }
681
- class Ni extends Rt {
674
+ class ji extends Tt {
682
675
  bindCBs;
683
676
  buttonCBs;
684
677
  pane = void 0;
@@ -689,7 +682,7 @@ class Ni extends Rt {
689
682
  super(n), this.bindCBs = /* @__PURE__ */ new Map(), this.buttonCBs = /* @__PURE__ */ new Map(), n.editor && this.createGUI();
690
683
  }
691
684
  createGUI() {
692
- this.pane = new wa({ title: "GUI" }), this.pane.registerPlugin(Oa);
685
+ this.pane = new xa({ title: "GUI" }), this.pane.registerPlugin(wa);
693
686
  }
694
687
  dispose() {
695
688
  this.bindCBs.clear(), this.buttonCBs.clear(), this.appCallbacks = 0, this.editorCallbacks = 0, this.app.editor && (this.pane?.dispose(), this.pane = void 0);
@@ -714,14 +707,14 @@ class Ni extends Rt {
714
707
  return `debug_${Math.max(this.appCallbacks, this.editorCallbacks)}`;
715
708
  }
716
709
  // Binding
717
- bind(n, a, e, s = void 0) {
718
- const o = this.bindID, p = e.onChange !== void 0 ? e.onChange : In;
719
- this.bindCBs.set(o, p), this.app.editor ? (this.pane === void 0 && this.createGUI(), (s !== void 0 ? s : this.pane).addBinding(n, a, e).on("change", (u) => {
710
+ bind(n, a, e, o = void 0) {
711
+ const s = this.bindID, p = e.onChange !== void 0 ? e.onChange : Dn;
712
+ this.bindCBs.set(s, p), this.app.editor ? (this.pane === void 0 && this.createGUI(), (o !== void 0 ? o : this.pane).addBinding(n, a, e).on("change", (u) => {
720
713
  this.app.send({
721
714
  event: "updateBind",
722
715
  target: "app",
723
716
  data: {
724
- id: o,
717
+ id: s,
725
718
  value: u.value
726
719
  }
727
720
  });
@@ -729,10 +722,10 @@ class Ni extends Rt {
729
722
  event: "bindObject",
730
723
  target: "app",
731
724
  data: {
732
- id: o,
725
+ id: s,
733
726
  name: a,
734
727
  params: e,
735
- parent: s
728
+ parent: o
736
729
  }
737
730
  }), this.appCallbacks++);
738
731
  }
@@ -742,20 +735,20 @@ class Ni extends Rt {
742
735
  }
743
736
  // Buttons
744
737
  button(n, a, e = void 0) {
745
- const s = this.bindID;
746
- this.buttonCBs.set(s, a), this.app.editor ? (this.pane === void 0 && this.createGUI(), (e !== void 0 ? e : this.pane).addButton({ title: n }).on("click", () => {
738
+ const o = this.bindID;
739
+ this.buttonCBs.set(o, a), this.app.editor ? (this.pane === void 0 && this.createGUI(), (e !== void 0 ? e : this.pane).addButton({ title: n }).on("click", () => {
747
740
  this.app.send({
748
741
  event: "clickButton",
749
742
  target: "app",
750
743
  data: {
751
- id: s
744
+ id: o
752
745
  }
753
746
  });
754
747
  }), this.editorCallbacks++) : (this.app.send({
755
748
  event: "addButton",
756
749
  target: "app",
757
750
  data: {
758
- id: s,
751
+ id: o,
759
752
  name: n,
760
753
  callback: a,
761
754
  parent: e
@@ -797,7 +790,7 @@ class Ni extends Rt {
797
790
  }
798
791
  }
799
792
  }
800
- var Vt = { exports: {} }, it = {};
793
+ var Gt = { exports: {} }, it = {};
801
794
  /**
802
795
  * @license React
803
796
  * react-jsx-runtime.production.min.js
@@ -807,21 +800,21 @@ var Vt = { exports: {} }, it = {};
807
800
  * This source code is licensed under the MIT license found in the
808
801
  * LICENSE file in the root directory of this source tree.
809
802
  */
810
- var Jt;
811
- function Na() {
812
- if (Jt)
803
+ var Zt;
804
+ function Da() {
805
+ if (Zt)
813
806
  return it;
814
- Jt = 1;
815
- var t = Pn, n = Symbol.for("react.element"), a = Symbol.for("react.fragment"), e = Object.prototype.hasOwnProperty, s = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, o = { key: !0, ref: !0, __self: !0, __source: !0 };
807
+ Zt = 1;
808
+ var t = An, n = Symbol.for("react.element"), a = Symbol.for("react.fragment"), e = Object.prototype.hasOwnProperty, o = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, s = { key: !0, ref: !0, __self: !0, __source: !0 };
816
809
  function p(c, u, f) {
817
810
  var v, b = {}, E = null, x = null;
818
811
  f !== void 0 && (E = "" + f), u.key !== void 0 && (E = "" + u.key), u.ref !== void 0 && (x = u.ref);
819
812
  for (v in u)
820
- e.call(u, v) && !o.hasOwnProperty(v) && (b[v] = u[v]);
813
+ e.call(u, v) && !s.hasOwnProperty(v) && (b[v] = u[v]);
821
814
  if (c && c.defaultProps)
822
815
  for (v in u = c.defaultProps, u)
823
816
  b[v] === void 0 && (b[v] = u[v]);
824
- return { $$typeof: n, type: c, key: E, ref: x, props: b, _owner: s.current };
817
+ return { $$typeof: n, type: c, key: E, ref: x, props: b, _owner: o.current };
825
818
  }
826
819
  return it.Fragment = a, it.jsx = p, it.jsxs = p, it;
827
820
  }
@@ -835,18 +828,18 @@ var rt = {};
835
828
  * This source code is licensed under the MIT license found in the
836
829
  * LICENSE file in the root directory of this source tree.
837
830
  */
838
- var Qt;
839
- function Fa() {
840
- return Qt || (Qt = 1, process.env.NODE_ENV !== "production" && function() {
841
- var t = Pn, n = Symbol.for("react.element"), a = Symbol.for("react.portal"), e = Symbol.for("react.fragment"), s = Symbol.for("react.strict_mode"), o = Symbol.for("react.profiler"), p = Symbol.for("react.provider"), c = Symbol.for("react.context"), u = Symbol.for("react.forward_ref"), f = Symbol.for("react.suspense"), v = Symbol.for("react.suspense_list"), b = Symbol.for("react.memo"), E = Symbol.for("react.lazy"), x = Symbol.for("react.offscreen"), M = Symbol.iterator, P = "@@iterator";
842
- function W(i) {
831
+ var Jt;
832
+ function Ia() {
833
+ return Jt || (Jt = 1, process.env.NODE_ENV !== "production" && function() {
834
+ var t = An, n = Symbol.for("react.element"), a = Symbol.for("react.portal"), e = Symbol.for("react.fragment"), o = Symbol.for("react.strict_mode"), s = Symbol.for("react.profiler"), p = Symbol.for("react.provider"), c = Symbol.for("react.context"), u = Symbol.for("react.forward_ref"), f = Symbol.for("react.suspense"), v = Symbol.for("react.suspense_list"), b = Symbol.for("react.memo"), E = Symbol.for("react.lazy"), x = Symbol.for("react.offscreen"), M = Symbol.iterator, P = "@@iterator";
835
+ function H(i) {
843
836
  if (i === null || typeof i != "object")
844
837
  return null;
845
838
  var h = M && i[M] || i[P];
846
839
  return typeof h == "function" ? h : null;
847
840
  }
848
841
  var B = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
849
- function S(i) {
842
+ function w(i) {
850
843
  {
851
844
  for (var h = arguments.length, g = new Array(h > 1 ? h - 1 : 0), C = 1; C < h; C++)
852
845
  g[C - 1] = arguments[C];
@@ -863,14 +856,14 @@ function Fa() {
863
856
  F.unshift("Warning: " + h), Function.prototype.apply.call(console[i], console, F);
864
857
  }
865
858
  }
866
- var Ce = !1, le = !1, oe = !1, d = !1, m = !1, w;
867
- w = Symbol.for("react.module.reference");
859
+ var Ce = !1, le = !1, se = !1, d = !1, m = !1, S;
860
+ S = Symbol.for("react.module.reference");
868
861
  function _(i) {
869
- return !!(typeof i == "string" || typeof i == "function" || i === e || i === o || m || i === s || i === f || i === v || d || i === x || Ce || le || oe || typeof i == "object" && i !== null && (i.$$typeof === E || i.$$typeof === b || i.$$typeof === p || i.$$typeof === c || i.$$typeof === u || // This needs to include all possible module reference object
862
+ return !!(typeof i == "string" || typeof i == "function" || i === e || i === s || m || i === o || i === f || i === v || d || i === x || Ce || le || se || typeof i == "object" && i !== null && (i.$$typeof === E || i.$$typeof === b || i.$$typeof === p || i.$$typeof === c || i.$$typeof === u || // This needs to include all possible module reference object
870
863
  // types supported by any Flight configuration anywhere since
871
864
  // we don't know which Flight build this will end up being used
872
865
  // with.
873
- i.$$typeof === w || i.getModuleId !== void 0));
866
+ i.$$typeof === S || i.getModuleId !== void 0));
874
867
  }
875
868
  function Y(i, h, g) {
876
869
  var C = i.displayName;
@@ -885,7 +878,7 @@ function Fa() {
885
878
  function $(i) {
886
879
  if (i == null)
887
880
  return null;
888
- if (typeof i.tag == "number" && S("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof i == "function")
881
+ if (typeof i.tag == "number" && w("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof i == "function")
889
882
  return i.displayName || i.name || null;
890
883
  if (typeof i == "string")
891
884
  return i;
@@ -894,9 +887,9 @@ function Fa() {
894
887
  return "Fragment";
895
888
  case a:
896
889
  return "Portal";
897
- case o:
898
- return "Profiler";
899
890
  case s:
891
+ return "Profiler";
892
+ case o:
900
893
  return "StrictMode";
901
894
  case f:
902
895
  return "Suspense";
@@ -927,14 +920,14 @@ function Fa() {
927
920
  }
928
921
  return null;
929
922
  }
930
- var I = Object.assign, H = 0, q, T, N, J, me, xe, ht;
923
+ var I = Object.assign, W = 0, q, T, N, J, me, xe, dt;
931
924
  function Ke() {
932
925
  }
933
926
  Ke.__reactDisabledLog = !0;
934
- function At() {
927
+ function _t() {
935
928
  {
936
- if (H === 0) {
937
- q = console.log, T = console.info, N = console.warn, J = console.error, me = console.group, xe = console.groupCollapsed, ht = console.groupEnd;
929
+ if (W === 0) {
930
+ q = console.log, T = console.info, N = console.warn, J = console.error, me = console.group, xe = console.groupCollapsed, dt = console.groupEnd;
938
931
  var i = {
939
932
  configurable: !0,
940
933
  enumerable: !0,
@@ -951,12 +944,12 @@ function Fa() {
951
944
  groupEnd: i
952
945
  });
953
946
  }
954
- H++;
947
+ W++;
955
948
  }
956
949
  }
957
- function Pt() {
950
+ function At() {
958
951
  {
959
- if (H--, H === 0) {
952
+ if (W--, W === 0) {
960
953
  var i = {
961
954
  configurable: !0,
962
955
  enumerable: !0,
@@ -982,11 +975,11 @@ function Fa() {
982
975
  value: xe
983
976
  }),
984
977
  groupEnd: I({}, i, {
985
- value: ht
978
+ value: dt
986
979
  })
987
980
  });
988
981
  }
989
- H < 0 && S("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
982
+ W < 0 && w("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
990
983
  }
991
984
  }
992
985
  var Xe = B.ReactCurrentDispatcher, Ze;
@@ -1003,16 +996,16 @@ function Fa() {
1003
996
  ` + Ze + i;
1004
997
  }
1005
998
  }
1006
- var ze = !1, Oe;
999
+ var ze = !1, Me;
1007
1000
  {
1008
- var ft = typeof WeakMap == "function" ? WeakMap : Map;
1009
- Oe = new ft();
1001
+ var ht = typeof WeakMap == "function" ? WeakMap : Map;
1002
+ Me = new ht();
1010
1003
  }
1011
- function pt(i, h) {
1004
+ function ft(i, h) {
1012
1005
  if (!i || ze)
1013
1006
  return "";
1014
1007
  {
1015
- var g = Oe.get(i);
1008
+ var g = Me.get(i);
1016
1009
  if (g !== void 0)
1017
1010
  return g;
1018
1011
  }
@@ -1021,7 +1014,7 @@ function Fa() {
1021
1014
  var D = Error.prepareStackTrace;
1022
1015
  Error.prepareStackTrace = void 0;
1023
1016
  var F;
1024
- F = Xe.current, Xe.current = null, At();
1017
+ F = Xe.current, Xe.current = null, _t();
1025
1018
  try {
1026
1019
  if (h) {
1027
1020
  var A = function() {
@@ -1067,30 +1060,30 @@ function Fa() {
1067
1060
  if (Z--, Q--, Q < 0 || R[Z] !== ce[Q]) {
1068
1061
  var fe = `
1069
1062
  ` + R[Z].replace(" at new ", " at ");
1070
- return i.displayName && fe.includes("<anonymous>") && (fe = fe.replace("<anonymous>", i.displayName)), typeof i == "function" && Oe.set(i, fe), fe;
1063
+ return i.displayName && fe.includes("<anonymous>") && (fe = fe.replace("<anonymous>", i.displayName)), typeof i == "function" && Me.set(i, fe), fe;
1071
1064
  }
1072
1065
  while (Z >= 1 && Q >= 0);
1073
1066
  break;
1074
1067
  }
1075
1068
  }
1076
1069
  } finally {
1077
- ze = !1, Xe.current = F, Pt(), Error.prepareStackTrace = D;
1070
+ ze = !1, Xe.current = F, At(), Error.prepareStackTrace = D;
1078
1071
  }
1079
- var Ge = i ? i.displayName || i.name : "", qt = Ge ? $e(Ge) : "";
1080
- return typeof i == "function" && Oe.set(i, qt), qt;
1072
+ var Ge = i ? i.displayName || i.name : "", Wt = Ge ? $e(Ge) : "";
1073
+ return typeof i == "function" && Me.set(i, Wt), Wt;
1081
1074
  }
1082
- function kt(i, h, g) {
1083
- return pt(i, !1);
1075
+ function Pt(i, h, g) {
1076
+ return ft(i, !1);
1084
1077
  }
1085
- function mt(i) {
1078
+ function pt(i) {
1086
1079
  var h = i.prototype;
1087
1080
  return !!(h && h.isReactComponent);
1088
1081
  }
1089
- function Me(i, h, g) {
1082
+ function Te(i, h, g) {
1090
1083
  if (i == null)
1091
1084
  return "";
1092
1085
  if (typeof i == "function")
1093
- return pt(i, mt(i));
1086
+ return ft(i, pt(i));
1094
1087
  if (typeof i == "string")
1095
1088
  return $e(i);
1096
1089
  switch (i) {
@@ -1102,30 +1095,30 @@ function Fa() {
1102
1095
  if (typeof i == "object")
1103
1096
  switch (i.$$typeof) {
1104
1097
  case u:
1105
- return kt(i.render);
1098
+ return Pt(i.render);
1106
1099
  case b:
1107
- return Me(i.type, h, g);
1100
+ return Te(i.type, h, g);
1108
1101
  case E: {
1109
1102
  var C = i, D = C._payload, F = C._init;
1110
1103
  try {
1111
- return Me(F(D), h, g);
1104
+ return Te(F(D), h, g);
1112
1105
  } catch {
1113
1106
  }
1114
1107
  }
1115
1108
  }
1116
1109
  return "";
1117
1110
  }
1118
- var Te = Object.prototype.hasOwnProperty, vt = {}, gt = B.ReactDebugCurrentFrame;
1119
- function Re(i) {
1111
+ var Re = Object.prototype.hasOwnProperty, mt = {}, vt = B.ReactDebugCurrentFrame;
1112
+ function _e(i) {
1120
1113
  if (i) {
1121
- var h = i._owner, g = Me(i.type, i._source, h ? h.type : null);
1122
- gt.setExtraStackFrame(g);
1114
+ var h = i._owner, g = Te(i.type, i._source, h ? h.type : null);
1115
+ vt.setExtraStackFrame(g);
1123
1116
  } else
1124
- gt.setExtraStackFrame(null);
1117
+ vt.setExtraStackFrame(null);
1125
1118
  }
1126
1119
  function Je(i, h, g, C, D) {
1127
1120
  {
1128
- var F = Function.call.bind(Te);
1121
+ var F = Function.call.bind(Re);
1129
1122
  for (var A in i)
1130
1123
  if (F(i, A)) {
1131
1124
  var R = void 0;
@@ -1138,67 +1131,67 @@ function Fa() {
1138
1131
  } catch (Z) {
1139
1132
  R = Z;
1140
1133
  }
1141
- R && !(R instanceof Error) && (Re(D), S("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", C || "React class", g, A, typeof R), Re(null)), R instanceof Error && !(R.message in vt) && (vt[R.message] = !0, Re(D), S("Failed %s type: %s", g, R.message), Re(null));
1134
+ R && !(R instanceof Error) && (_e(D), w("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", C || "React class", g, A, typeof R), _e(null)), R instanceof Error && !(R.message in mt) && (mt[R.message] = !0, _e(D), w("Failed %s type: %s", g, R.message), _e(null));
1142
1135
  }
1143
1136
  }
1144
1137
  }
1145
- var _e = Array.isArray;
1138
+ var Ae = Array.isArray;
1146
1139
  function Qe(i) {
1147
- return _e(i);
1140
+ return Ae(i);
1148
1141
  }
1149
- function jt(i) {
1142
+ function kt(i) {
1150
1143
  {
1151
1144
  var h = typeof Symbol == "function" && Symbol.toStringTag, g = h && i[Symbol.toStringTag] || i.constructor.name || "Object";
1152
1145
  return g;
1153
1146
  }
1154
1147
  }
1155
- function bt(i) {
1148
+ function gt(i) {
1156
1149
  try {
1157
- return yt(i), !1;
1150
+ return bt(i), !1;
1158
1151
  } catch {
1159
1152
  return !0;
1160
1153
  }
1161
1154
  }
1162
- function yt(i) {
1155
+ function bt(i) {
1163
1156
  return "" + i;
1164
1157
  }
1165
- function Et(i) {
1166
- if (bt(i))
1167
- return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", jt(i)), yt(i);
1158
+ function yt(i) {
1159
+ if (gt(i))
1160
+ return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", kt(i)), bt(i);
1168
1161
  }
1169
- var Se = B.ReactCurrentOwner, et = {
1162
+ var we = B.ReactCurrentOwner, et = {
1170
1163
  key: !0,
1171
1164
  ref: !0,
1172
1165
  __self: !0,
1173
1166
  __source: !0
1174
- }, tt, Ct, Ye;
1167
+ }, tt, Et, Ye;
1175
1168
  Ye = {};
1176
- function Dt(i) {
1177
- if (Te.call(i, "ref")) {
1169
+ function jt(i) {
1170
+ if (Re.call(i, "ref")) {
1178
1171
  var h = Object.getOwnPropertyDescriptor(i, "ref").get;
1179
1172
  if (h && h.isReactWarning)
1180
1173
  return !1;
1181
1174
  }
1182
1175
  return i.ref !== void 0;
1183
1176
  }
1184
- function It(i) {
1185
- if (Te.call(i, "key")) {
1177
+ function Dt(i) {
1178
+ if (Re.call(i, "key")) {
1186
1179
  var h = Object.getOwnPropertyDescriptor(i, "key").get;
1187
1180
  if (h && h.isReactWarning)
1188
1181
  return !1;
1189
1182
  }
1190
1183
  return i.key !== void 0;
1191
1184
  }
1192
- function xt(i, h) {
1193
- if (typeof i.ref == "string" && Se.current && h && Se.current.stateNode !== h) {
1194
- var g = $(Se.current.type);
1195
- Ye[g] || (S('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', $(Se.current.type), i.ref), Ye[g] = !0);
1185
+ function Ct(i, h) {
1186
+ if (typeof i.ref == "string" && we.current && h && we.current.stateNode !== h) {
1187
+ var g = $(we.current.type);
1188
+ Ye[g] || (w('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', $(we.current.type), i.ref), Ye[g] = !0);
1196
1189
  }
1197
1190
  }
1198
- function we(i, h) {
1191
+ function Se(i, h) {
1199
1192
  {
1200
1193
  var g = function() {
1201
- tt || (tt = !0, S("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", h));
1194
+ tt || (tt = !0, w("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", h));
1202
1195
  };
1203
1196
  g.isReactWarning = !0, Object.defineProperty(i, "key", {
1204
1197
  get: g,
@@ -1209,7 +1202,7 @@ function Fa() {
1209
1202
  function Ht(i, h) {
1210
1203
  {
1211
1204
  var g = function() {
1212
- Ct || (Ct = !0, S("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", h));
1205
+ Et || (Et = !0, w("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", h));
1213
1206
  };
1214
1207
  g.isReactWarning = !0, Object.defineProperty(i, "ref", {
1215
1208
  get: g,
@@ -1249,9 +1242,9 @@ function Fa() {
1249
1242
  function y(i, h, g, C, D) {
1250
1243
  {
1251
1244
  var F, A = {}, R = null, ce = null;
1252
- g !== void 0 && (Et(g), R = "" + g), It(h) && (Et(h.key), R = "" + h.key), Dt(h) && (ce = h.ref, xt(h, D));
1245
+ g !== void 0 && (yt(g), R = "" + g), Dt(h) && (yt(h.key), R = "" + h.key), jt(h) && (ce = h.ref, Ct(h, D));
1253
1246
  for (F in h)
1254
- Te.call(h, F) && !et.hasOwnProperty(F) && (A[F] = h[F]);
1247
+ Re.call(h, F) && !et.hasOwnProperty(F) && (A[F] = h[F]);
1255
1248
  if (i && i.defaultProps) {
1256
1249
  var Z = i.defaultProps;
1257
1250
  for (F in Z)
@@ -1259,25 +1252,25 @@ function Fa() {
1259
1252
  }
1260
1253
  if (R || ce) {
1261
1254
  var Q = typeof i == "function" ? i.displayName || i.name || "Unknown" : i;
1262
- R && we(A, Q), ce && Ht(A, Q);
1255
+ R && Se(A, Q), ce && Ht(A, Q);
1263
1256
  }
1264
- return r(i, R, ce, D, C, Se.current, A);
1257
+ return r(i, R, ce, D, C, we.current, A);
1265
1258
  }
1266
1259
  }
1267
1260
  var O = B.ReactCurrentOwner, L = B.ReactDebugCurrentFrame;
1268
1261
  function K(i) {
1269
1262
  if (i) {
1270
- var h = i._owner, g = Me(i.type, i._source, h ? h.type : null);
1263
+ var h = i._owner, g = Te(i.type, i._source, h ? h.type : null);
1271
1264
  L.setExtraStackFrame(g);
1272
1265
  } else
1273
1266
  L.setExtraStackFrame(null);
1274
1267
  }
1275
1268
  var de;
1276
1269
  de = !1;
1277
- function ae(i) {
1270
+ function ie(i) {
1278
1271
  return typeof i == "object" && i !== null && i.$$typeof === n;
1279
1272
  }
1280
- function Lt() {
1273
+ function It() {
1281
1274
  {
1282
1275
  if (O.current) {
1283
1276
  var i = $(O.current.type);
@@ -1289,7 +1282,7 @@ Check the render method of \`` + i + "`.";
1289
1282
  return "";
1290
1283
  }
1291
1284
  }
1292
- function Nt(i) {
1285
+ function Lt(i) {
1293
1286
  {
1294
1287
  if (i !== void 0) {
1295
1288
  var h = i.fileName.replace(/^.*[\\\/]/, ""), g = i.lineNumber;
@@ -1303,7 +1296,7 @@ Check your code at ` + h + ":" + g + ".";
1303
1296
  var nt = {};
1304
1297
  function pe(i) {
1305
1298
  {
1306
- var h = Lt();
1299
+ var h = It();
1307
1300
  if (!h) {
1308
1301
  var g = typeof i == "string" ? i : i.displayName || i.name;
1309
1302
  g && (h = `
@@ -1323,29 +1316,29 @@ Check the top-level render call using <` + g + ">.");
1323
1316
  return;
1324
1317
  nt[g] = !0;
1325
1318
  var C = "";
1326
- i && i._owner && i._owner !== O.current && (C = " It was passed a child from " + $(i._owner.type) + "."), K(i), S('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', g, C), K(null);
1319
+ i && i._owner && i._owner !== O.current && (C = " It was passed a child from " + $(i._owner.type) + "."), K(i), w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', g, C), K(null);
1327
1320
  }
1328
1321
  }
1329
- function Ae(i, h) {
1322
+ function Pe(i, h) {
1330
1323
  {
1331
1324
  if (typeof i != "object")
1332
1325
  return;
1333
1326
  if (Qe(i))
1334
1327
  for (var g = 0; g < i.length; g++) {
1335
1328
  var C = i[g];
1336
- ae(C) && he(C, h);
1329
+ ie(C) && he(C, h);
1337
1330
  }
1338
- else if (ae(i))
1331
+ else if (ie(i))
1339
1332
  i._store && (i._store.validated = !0);
1340
1333
  else if (i) {
1341
- var D = W(i);
1334
+ var D = H(i);
1342
1335
  if (typeof D == "function" && D !== i.entries)
1343
1336
  for (var F = D.call(i), A; !(A = F.next()).done; )
1344
- ae(A.value) && he(A.value, h);
1337
+ ie(A.value) && he(A.value, h);
1345
1338
  }
1346
1339
  }
1347
1340
  }
1348
- function Pe(i) {
1341
+ function ke(i) {
1349
1342
  {
1350
1343
  var h = i.type;
1351
1344
  if (h == null || typeof h == "string")
@@ -1365,33 +1358,33 @@ Check the top-level render call using <` + g + ">.");
1365
1358
  } else if (h.PropTypes !== void 0 && !de) {
1366
1359
  de = !0;
1367
1360
  var D = $(h);
1368
- S("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", D || "Unknown");
1361
+ w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", D || "Unknown");
1369
1362
  }
1370
- typeof h.getDefaultProps == "function" && !h.getDefaultProps.isReactClassApproved && S("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
1363
+ typeof h.getDefaultProps == "function" && !h.getDefaultProps.isReactClassApproved && w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
1371
1364
  }
1372
1365
  }
1373
- function ke(i) {
1366
+ function je(i) {
1374
1367
  {
1375
1368
  for (var h = Object.keys(i.props), g = 0; g < h.length; g++) {
1376
1369
  var C = h[g];
1377
1370
  if (C !== "children" && C !== "key") {
1378
- K(i), S("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", C), K(null);
1371
+ K(i), w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", C), K(null);
1379
1372
  break;
1380
1373
  }
1381
1374
  }
1382
- i.ref !== null && (K(i), S("Invalid attribute `ref` supplied to `React.Fragment`."), K(null));
1375
+ i.ref !== null && (K(i), w("Invalid attribute `ref` supplied to `React.Fragment`."), K(null));
1383
1376
  }
1384
1377
  }
1385
- function je(i, h, g, C, D, F) {
1378
+ function De(i, h, g, C, D, F) {
1386
1379
  {
1387
1380
  var A = _(i);
1388
1381
  if (!A) {
1389
1382
  var R = "";
1390
1383
  (i === void 0 || typeof i == "object" && i !== null && Object.keys(i).length === 0) && (R += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
1391
- var ce = Nt(D);
1392
- ce ? R += ce : R += Lt();
1384
+ var ce = Lt(D);
1385
+ ce ? R += ce : R += It();
1393
1386
  var Z;
1394
- i === null ? Z = "null" : Qe(i) ? Z = "array" : i !== void 0 && i.$$typeof === n ? (Z = "<" + ($(i.type) || "Unknown") + " />", R = " Did you accidentally export a JSX literal instead of a component?") : Z = typeof i, S("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", Z, R);
1387
+ i === null ? Z = "null" : Qe(i) ? Z = "array" : i !== void 0 && i.$$typeof === n ? (Z = "<" + ($(i.type) || "Unknown") + " />", R = " Did you accidentally export a JSX literal instead of a component?") : Z = typeof i, w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", Z, R);
1395
1388
  }
1396
1389
  var Q = y(i, h, g, D, F);
1397
1390
  if (Q == null)
@@ -1402,36 +1395,36 @@ Check the top-level render call using <` + g + ">.");
1402
1395
  if (C)
1403
1396
  if (Qe(fe)) {
1404
1397
  for (var Ge = 0; Ge < fe.length; Ge++)
1405
- Ae(fe[Ge], i);
1398
+ Pe(fe[Ge], i);
1406
1399
  Object.freeze && Object.freeze(fe);
1407
1400
  } else
1408
- S("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
1401
+ w("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
1409
1402
  else
1410
- Ae(fe, i);
1403
+ Pe(fe, i);
1411
1404
  }
1412
- return i === e ? ke(Q) : Pe(Q), Q;
1405
+ return i === e ? je(Q) : ke(Q), Q;
1413
1406
  }
1414
1407
  }
1415
1408
  function $n(i, h, g) {
1416
- return je(i, h, g, !0);
1409
+ return De(i, h, g, !0);
1417
1410
  }
1418
1411
  function zn(i, h, g) {
1419
- return je(i, h, g, !1);
1412
+ return De(i, h, g, !1);
1420
1413
  }
1421
1414
  var Yn = zn, Gn = $n;
1422
1415
  rt.Fragment = e, rt.jsx = Yn, rt.jsxs = Gn;
1423
1416
  }()), rt;
1424
1417
  }
1425
- process.env.NODE_ENV === "production" ? Vt.exports = Na() : Vt.exports = Fa();
1426
- var l = Vt.exports;
1418
+ process.env.NODE_ENV === "production" ? Gt.exports = Da() : Gt.exports = Ia();
1419
+ var l = Gt.exports;
1427
1420
  function Nn(t) {
1428
1421
  return t.title.search("<") > -1 ? /* @__PURE__ */ l.jsx("button", { className: "svg", dangerouslySetInnerHTML: { __html: t.title } }) : /* @__PURE__ */ l.jsx("button", { children: t.title });
1429
1422
  }
1430
- const Ba = /* @__PURE__ */ l.jsxs("svg", { className: "closeIcon", width: "14", height: "14", fill: "none", stroke: "#666666", strokeMiterlimit: "10", children: [
1423
+ const La = /* @__PURE__ */ l.jsxs("svg", { className: "closeIcon", width: "14", height: "14", fill: "none", stroke: "#666666", strokeMiterlimit: "10", children: [
1431
1424
  /* @__PURE__ */ l.jsx("circle", { cx: "7", cy: "7", r: "6" }),
1432
1425
  /* @__PURE__ */ l.jsx("line", { x1: "4", y1: "4", x2: "10", y2: "10" }),
1433
1426
  /* @__PURE__ */ l.jsx("line", { x1: "4", y1: "10", x2: "10", y2: "4" })
1434
- ] }), Ua = /* @__PURE__ */ l.jsx("svg", { className: "dragIcon", width: "14", height: "14", fill: "#666666", stroke: "none", children: /* @__PURE__ */ l.jsx(
1427
+ ] }), Na = /* @__PURE__ */ l.jsx("svg", { className: "dragIcon", width: "14", height: "14", fill: "#666666", stroke: "none", children: /* @__PURE__ */ l.jsx(
1435
1428
  "path",
1436
1429
  {
1437
1430
  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
@@ -1439,41 +1432,41 @@ 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
1439
1432
  C11,8.22,10.74,8,10.43,8z`
1440
1433
  }
1441
1434
  ) });
1442
- function $a(t) {
1443
- return /* @__PURE__ */ l.jsx(kn.Item, { value: t.title, children: /* @__PURE__ */ l.jsxs("div", { children: [
1444
- Ua,
1435
+ function Fa(t) {
1436
+ return /* @__PURE__ */ l.jsx(Pn.Item, { value: t.title, children: /* @__PURE__ */ l.jsxs("div", { children: [
1437
+ Na,
1445
1438
  /* @__PURE__ */ l.jsx("span", { children: t.title }),
1446
1439
  /* @__PURE__ */ l.jsx("button", { className: "closeIcon", onClick: () => {
1447
1440
  t.onDelete(t.index);
1448
- }, children: Ba })
1441
+ }, children: La })
1449
1442
  ] }) }, t.title);
1450
1443
  }
1451
- function za(t) {
1452
- const [n, a] = se(!1), [e, s] = se(t.options), o = (f) => {
1453
- t.onDragComplete(f), s(f);
1444
+ function Ba(t) {
1445
+ const [n, a] = ae(!1), [e, o] = ae(t.options), s = (f) => {
1446
+ t.onDragComplete(f), o(f);
1454
1447
  }, p = (f) => {
1455
1448
  const v = [...e];
1456
- v.splice(f, 1), o(v);
1449
+ v.splice(f, 1), s(v);
1457
1450
  }, c = [];
1458
1451
  e.forEach((f, v) => {
1459
- c.push(/* @__PURE__ */ l.jsx($a, { index: v, title: f, onDelete: p }, f));
1452
+ c.push(/* @__PURE__ */ l.jsx(Fa, { index: v, title: f, onDelete: p }, f));
1460
1453
  });
1461
1454
  let u = "dropdown draggable";
1462
1455
  return t.subdropdown && (u += " subdropdown"), /* @__PURE__ */ l.jsxs("div", { className: u, onMouseEnter: () => a(!0), onMouseLeave: () => a(!1), children: [
1463
1456
  /* @__PURE__ */ l.jsx(Nn, { title: t.title }),
1464
- /* @__PURE__ */ l.jsx(kn.Group, { axis: "y", values: e, onReorder: o, style: { visibility: n ? "visible" : "hidden" }, children: c })
1457
+ /* @__PURE__ */ l.jsx(Pn.Group, { axis: "y", values: e, onReorder: s, style: { visibility: n ? "visible" : "hidden" }, children: c })
1465
1458
  ] });
1466
1459
  }
1467
- function Ya(t) {
1468
- const [n, a] = se(!1), e = [];
1469
- t.options.map((o, p) => {
1470
- t.onSelect !== void 0 && (o.onSelect = t.onSelect), e.push(/* @__PURE__ */ l.jsx(Ga, { option: o }, p));
1460
+ function Ua(t) {
1461
+ const [n, a] = ae(!1), e = [];
1462
+ t.options.map((s, p) => {
1463
+ t.onSelect !== void 0 && (s.onSelect = t.onSelect), e.push(/* @__PURE__ */ l.jsx($a, { option: s }, p));
1471
1464
  });
1472
- let s = "dropdown";
1473
- return t.subdropdown && (s += " subdropdown"), /* @__PURE__ */ l.jsxs(
1465
+ let o = "dropdown";
1466
+ return t.subdropdown && (o += " subdropdown"), /* @__PURE__ */ l.jsxs(
1474
1467
  "div",
1475
1468
  {
1476
- className: s,
1469
+ className: o,
1477
1470
  onMouseEnter: () => a(!0),
1478
1471
  onMouseLeave: () => a(!1),
1479
1472
  children: [
@@ -1489,26 +1482,26 @@ function Ya(t) {
1489
1482
  }
1490
1483
  );
1491
1484
  }
1492
- function Ga(t) {
1493
- const { option: n } = t, [a, e] = se("");
1494
- let s;
1485
+ function $a(t) {
1486
+ const { option: n } = t, [a, e] = ae("");
1487
+ let o;
1495
1488
  switch (n.type) {
1496
1489
  case "draggable":
1497
- s = /* @__PURE__ */ l.jsx(
1498
- za,
1490
+ o = /* @__PURE__ */ l.jsx(
1491
+ Ba,
1499
1492
  {
1500
1493
  title: n.title,
1501
1494
  options: n.value,
1502
- onDragComplete: (o) => {
1503
- n.onDragComplete !== void 0 && n.onDragComplete(o);
1495
+ onDragComplete: (s) => {
1496
+ n.onDragComplete !== void 0 && n.onDragComplete(s);
1504
1497
  },
1505
1498
  subdropdown: !0
1506
1499
  }
1507
1500
  );
1508
1501
  break;
1509
1502
  case "dropdown":
1510
- s = /* @__PURE__ */ l.jsx(
1511
- Ya,
1503
+ o = /* @__PURE__ */ l.jsx(
1504
+ Ua,
1512
1505
  {
1513
1506
  title: n.title,
1514
1507
  options: n.value,
@@ -1518,7 +1511,7 @@ function Ga(t) {
1518
1511
  );
1519
1512
  break;
1520
1513
  case "option":
1521
- s = /* @__PURE__ */ l.jsx(
1514
+ o = /* @__PURE__ */ l.jsx(
1522
1515
  "button",
1523
1516
  {
1524
1517
  onClick: () => {
@@ -1529,12 +1522,12 @@ function Ga(t) {
1529
1522
  );
1530
1523
  break;
1531
1524
  }
1532
- return /* @__PURE__ */ l.jsx("li", { className: a === n.title ? "selected" : "", children: s }, Ra());
1525
+ return /* @__PURE__ */ l.jsx("li", { className: a === n.title ? "selected" : "", children: o }, Oa());
1533
1526
  }
1534
- function Fi(t) {
1527
+ function Di(t) {
1535
1528
  function n(e) {
1536
- switch (t.components.forEach((s) => {
1537
- s.handleApp(e);
1529
+ switch (t.components.forEach((o) => {
1530
+ o.handleApp(e);
1538
1531
  }), e.event) {
1539
1532
  case "custom":
1540
1533
  k.dispatchEvent({ type: j.CUSTOM, value: e.data });
@@ -1542,8 +1535,8 @@ function Fi(t) {
1542
1535
  }
1543
1536
  }
1544
1537
  function a(e) {
1545
- switch (t.components.forEach((s) => {
1546
- s.handleEditor(e);
1538
+ switch (t.components.forEach((o) => {
1539
+ o.handleEditor(e);
1547
1540
  }), e.event) {
1548
1541
  case "custom":
1549
1542
  k.dispatchEvent({ type: j.CUSTOM, value: e.data });
@@ -1554,7 +1547,7 @@ function Fi(t) {
1554
1547
  e.target === "editor" ? a(e) : n(e);
1555
1548
  };
1556
1549
  }
1557
- const Va = `out vec3 worldPosition;
1550
+ const za = `out vec3 worldPosition;
1558
1551
  uniform float uDistance;
1559
1552
 
1560
1553
  void main() {
@@ -1563,7 +1556,7 @@ void main() {
1563
1556
  worldPosition.xz += cameraPosition.xz;
1564
1557
 
1565
1558
  gl_Position = projectionMatrix * modelViewMatrix * vec4(worldPosition, 1.0);
1566
- }`, Wa = `out vec4 fragColor;
1559
+ }`, Ya = `out vec4 fragColor;
1567
1560
  in vec3 worldPosition;
1568
1561
 
1569
1562
  uniform float uDivisions;
@@ -1631,14 +1624,14 @@ void main() {
1631
1624
 
1632
1625
  if (fragColor.a <= 0.0) discard;
1633
1626
  }`;
1634
- class Ha extends hn {
1627
+ class Ga extends dn {
1635
1628
  constructor(n) {
1636
1629
  super({
1637
1630
  extensions: {
1638
1631
  derivatives: !0
1639
1632
  },
1640
- glslVersion: Hn,
1641
- side: fn,
1633
+ glslVersion: Wn,
1634
+ side: hn,
1642
1635
  transparent: !0,
1643
1636
  uniforms: {
1644
1637
  uScale: {
@@ -1648,7 +1641,7 @@ class Ha extends hn {
1648
1641
  value: n?.divisions !== void 0 ? n?.divisions : 10
1649
1642
  },
1650
1643
  uColor: {
1651
- value: n?.color !== void 0 ? n?.color : new Tt(16777215)
1644
+ value: n?.color !== void 0 ? n?.color : new Mt(16777215)
1652
1645
  },
1653
1646
  uDistance: {
1654
1647
  value: n?.distance !== void 0 ? n?.distance : 1e4
@@ -1660,24 +1653,24 @@ class Ha extends hn {
1660
1653
  value: n?.gridOpacity !== void 0 ? n?.gridOpacity : 0.25
1661
1654
  }
1662
1655
  },
1663
- vertexShader: Va,
1664
- fragmentShader: Wa,
1656
+ vertexShader: za,
1657
+ fragmentShader: Ya,
1665
1658
  name: "InfiniteGrid",
1666
1659
  depthWrite: !1
1667
1660
  });
1668
1661
  }
1669
1662
  }
1670
- class qa extends qn {
1663
+ class Va extends qn {
1671
1664
  gridMaterial;
1672
1665
  constructor() {
1673
- const n = new Ha();
1666
+ const n = new Ga();
1674
1667
  super(new Kn(2, 2), n), this.gridMaterial = n, this.frustumCulled = !1, this.name = "InfiniteGridHelper", this.position.y = 0.1;
1675
1668
  }
1676
1669
  update() {
1677
1670
  this.gridMaterial.needsUpdate = !0;
1678
1671
  }
1679
1672
  }
1680
- const Ka = `#include <common>
1673
+ const Ha = `#include <common>
1681
1674
  #include <batching_pars_vertex>
1682
1675
  #include <uv_pars_vertex>
1683
1676
  #include <color_pars_vertex>
@@ -1707,7 +1700,7 @@ void main() {
1707
1700
  #include <logdepthbuf_vertex>
1708
1701
  #include <clipping_planes_vertex>
1709
1702
  #include <worldpos_vertex>
1710
- }`, Xa = `
1703
+ }`, Wa = `
1711
1704
  #include <common>
1712
1705
  #include <uv_pars_fragment>
1713
1706
  #include <clipping_planes_pars_fragment>
@@ -1716,27 +1709,27 @@ void main() {
1716
1709
  #include <clipping_planes_fragment>
1717
1710
  gl_FragColor = vec4(vec3(vUv, 0.0), 1.0);
1718
1711
  }`;
1719
- class Za extends hn {
1712
+ class qa extends dn {
1720
1713
  constructor() {
1721
1714
  super({
1722
1715
  defines: {
1723
1716
  USE_UV: ""
1724
1717
  },
1725
- vertexShader: Ka,
1726
- fragmentShader: Xa
1718
+ vertexShader: Ha,
1719
+ fragmentShader: Wa
1727
1720
  });
1728
1721
  }
1729
1722
  }
1730
- function Wt(t) {
1731
- const [n, a] = se(t.open !== void 0 ? t.open : !0), e = !n || t.children === void 0;
1723
+ function Vt(t) {
1724
+ const [n, a] = ae(t.open !== void 0 ? t.open : !0), e = !n || t.children === void 0;
1732
1725
  return /* @__PURE__ */ l.jsxs("div", { className: `accordion ${e ? "hide" : ""}`, children: [
1733
1726
  /* @__PURE__ */ l.jsxs(
1734
1727
  "button",
1735
1728
  {
1736
1729
  className: "toggle",
1737
1730
  onClick: () => {
1738
- const s = !n;
1739
- t.onToggle !== void 0 && t.onToggle(s), a(s);
1731
+ const o = !n;
1732
+ t.onToggle !== void 0 && t.onToggle(o), a(o);
1740
1733
  },
1741
1734
  children: [
1742
1735
  /* @__PURE__ */ l.jsx(
@@ -1746,7 +1739,7 @@ function Wt(t) {
1746
1739
  children: "Toggle"
1747
1740
  }
1748
1741
  ),
1749
- /* @__PURE__ */ l.jsx("p", { className: "label", children: lt(t.label) })
1742
+ /* @__PURE__ */ l.jsx("p", { className: "label", children: ct(t.label) })
1750
1743
  ]
1751
1744
  }
1752
1745
  ),
@@ -1755,10 +1748,10 @@ function Wt(t) {
1755
1748
  ] });
1756
1749
  }
1757
1750
  function Fn(t) {
1758
- const [n, a] = se(!1), e = t.child.children.length > 0, s = [];
1759
- return t.child.children.length > 0 && t.child.children.map((o) => {
1760
- s.push(/* @__PURE__ */ l.jsx(Fn, { child: o, three: t.three }, Math.random()));
1761
- }), /* @__PURE__ */ l.jsxs("div", { className: "childObject", children: [
1751
+ const [n, a] = ae(!1), e = t.child !== void 0 && t.child.children.length > 0, o = [];
1752
+ return t.child !== void 0 && t.child.children.length > 0 && t.child.children.map((s) => {
1753
+ o.push(/* @__PURE__ */ l.jsx(Fn, { child: s, three: t.three }, Math.random()));
1754
+ }), /* @__PURE__ */ l.jsx(l.Fragment, { children: t.child !== void 0 && /* @__PURE__ */ l.jsxs("div", { className: "childObject", children: [
1762
1755
  /* @__PURE__ */ l.jsxs("div", { className: "child", children: [
1763
1756
  e ? /* @__PURE__ */ l.jsx(
1764
1757
  "button",
@@ -1780,34 +1773,34 @@ function Fn(t) {
1780
1773
  left: e ? "20px" : "5px"
1781
1774
  },
1782
1775
  onClick: () => {
1783
- t.three.getObject(t.child.uuid), n || a(!0);
1776
+ t.child !== void 0 && (t.three.getObject(t.child.uuid), n || a(!0));
1784
1777
  },
1785
1778
  children: t.child.name.length > 0 ? `${t.child.name} (${t.child.type})` : `${t.child.type}::${t.child.uuid}`
1786
1779
  }
1787
1780
  ),
1788
- /* @__PURE__ */ l.jsx("div", { className: `icon ${ja(t.child)}` })
1781
+ /* @__PURE__ */ l.jsx("div", { className: `icon ${Aa(t.child)}` })
1789
1782
  ] }),
1790
- /* @__PURE__ */ l.jsx("div", { className: n ? "open" : "", children: /* @__PURE__ */ l.jsx("div", { className: "container", children: s }) })
1791
- ] }, Math.random());
1783
+ /* @__PURE__ */ l.jsx("div", { className: n ? "open" : "", children: /* @__PURE__ */ l.jsx("div", { className: "container", children: o }) })
1784
+ ] }, Math.random()) });
1792
1785
  }
1793
- function Ja(t) {
1786
+ function Ka(t) {
1794
1787
  const n = [];
1795
- return t.child.children.map((a) => {
1788
+ return t.child?.children.map((a) => {
1796
1789
  n.push(/* @__PURE__ */ l.jsx(Fn, { child: a, three: t.three }, Math.random()));
1797
1790
  }), /* @__PURE__ */ l.jsx("div", { className: `scene ${t.class !== void 0 ? t.class : ""}`, children: n });
1798
1791
  }
1799
- const Qa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA5klEQVRoge2Y0Q6EIAwE6cX//+X6cCFpSMEKVTdk501OpRNKiyelFC0b8Ps6gCwoggZF0KAIGhRBgyJoUAQNiqCxjciR9SLV//eZiAyvK3U8i/QVaQO2YyLSFVvlkdTKDjJCukh2ykR5ZEW+kHmlatl90RaBtDkK/w7CYhuRUEO0ee3l+J3m55Vm+17vtwjTnV1V3QA8qfbeUXCzRWDpiLLS+OyzvRW7IzW9R+okvclsqR09743bo0yUpc1+lSJvNsa002+Euk9GKzV7SmZDRIMiaFAEDYqgQRE0KIIGRdCgCBoUQeMEMERadX7YUz8AAAAASUVORK5CYII=";
1800
- function ei(t) {
1792
+ const Xa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA5klEQVRoge2Y0Q6EIAwE6cX//+X6cCFpSMEKVTdk501OpRNKiyelFC0b8Ps6gCwoggZF0KAIGhRBgyJoUAQNiqCxjciR9SLV//eZiAyvK3U8i/QVaQO2YyLSFVvlkdTKDjJCukh2ykR5ZEW+kHmlatl90RaBtDkK/w7CYhuRUEO0ee3l+J3m55Vm+17vtwjTnV1V3QA8qfbeUXCzRWDpiLLS+OyzvRW7IzW9R+okvclsqR09743bo0yUpc1+lSJvNsa002+Euk9GKzV7SmZDRIMiaFAEDYqgQRE0KIIGRdCgCBoUQeMEMERadX7YUz8AAAAASUVORK5CYII=";
1793
+ function Za(t) {
1801
1794
  return "items" in t;
1802
1795
  }
1803
1796
  function Be(t) {
1804
1797
  const n = [];
1805
1798
  return t.items.forEach((a) => {
1806
- ei(a) ? n.push(
1807
- /* @__PURE__ */ l.jsx(Be, { title: lt(a.title), items: a.items }, Math.random())
1799
+ Za(a) ? n.push(
1800
+ /* @__PURE__ */ l.jsx(Be, { title: ct(a.title), items: a.items }, Math.random())
1808
1801
  ) : n.push(
1809
1802
  /* @__PURE__ */ l.jsx(
1810
- ct,
1803
+ st,
1811
1804
  {
1812
1805
  title: a.title,
1813
1806
  prop: a.prop,
@@ -1818,19 +1811,19 @@ function Be(t) {
1818
1811
  step: a.step,
1819
1812
  disabled: a.disabled,
1820
1813
  options: a.options,
1821
- onChange: (e, s) => {
1822
- a.onChange !== void 0 && a.onChange(e, s);
1814
+ onChange: (e, o) => {
1815
+ a.onChange !== void 0 && a.onChange(e, o);
1823
1816
  }
1824
1817
  },
1825
1818
  Math.random()
1826
1819
  )
1827
1820
  );
1828
- }), /* @__PURE__ */ l.jsx(Wt, { label: t.title, open: t.expanded === !0, children: n });
1821
+ }), /* @__PURE__ */ l.jsx(Vt, { label: t.title, open: t.expanded === !0, children: n });
1829
1822
  }
1830
- function ti(t) {
1823
+ function Ja(t) {
1831
1824
  return !(t === "alphaHash" || t === "alphaToCoverage" || t === "attenuationDistance" || t === "blendDstAlpha" || t === "colorWrite" || t === "combine" || t === "defaultAttributeValues" || t === "depthFunc" || t === "forceSinglePass" || t === "glslVersion" || t === "linecap" || t === "linejoin" || t === "linewidth" || t === "normalMapType" || t === "precision" || t === "premultipliedAlpha" || t === "shadowSide" || t === "toneMapped" || t === "uniformsGroups" || t === "uniformsNeedUpdate" || t === "userData" || t === "vertexColors" || t === "version" || t === "wireframeLinecap" || t === "wireframeLinejoin" || t === "wireframeLinewidth" || t.slice(0, 4) === "clip" || t.slice(0, 7) === "polygon" || t.slice(0, 7) === "stencil" || t.slice(0, 2) === "is");
1832
1825
  }
1833
- function De(t) {
1826
+ function Ie(t) {
1834
1827
  switch (t) {
1835
1828
  case "alphaMap":
1836
1829
  return "Alpha Map";
@@ -2003,25 +1996,25 @@ function De(t) {
2003
1996
  }
2004
1997
  return t;
2005
1998
  }
2006
- function ni(t) {
1999
+ function Qa(t) {
2007
2000
  return t.toLowerCase().search("intensity") > -1 || t === "anisotropyRotation" || t === "blendAlpha" || t === "bumpScale" || t === "clearcoatRoughness" || t === "displacementBias" || t === "displacementScale" || t === "metalness" || t === "opacity" || t === "reflectivity" || t === "refractionRatio" || t === "roughness" || t === "sheenRoughness" || t === "thickness";
2008
2001
  }
2009
- function ai() {
2002
+ function ei() {
2010
2003
  const t = document.createElement("input");
2011
2004
  return t.type = "file", new Promise((n, a) => {
2012
2005
  t.addEventListener("change", function() {
2013
2006
  if (t.files === null)
2014
2007
  a();
2015
2008
  else {
2016
- const e = t.files[0], s = new FileReader();
2017
- s.onload = function(o) {
2018
- n(o.target.result);
2019
- }, s.readAsDataURL(e);
2009
+ const e = t.files[0], o = new FileReader();
2010
+ o.onload = function(s) {
2011
+ n(s.target.result);
2012
+ }, o.readAsDataURL(e);
2020
2013
  }
2021
2014
  }), t.click();
2022
2015
  });
2023
2016
  }
2024
- const ii = [
2017
+ const ti = [
2025
2018
  {
2026
2019
  title: "Front",
2027
2020
  value: Xn
@@ -2032,9 +2025,9 @@ const ii = [
2032
2025
  },
2033
2026
  {
2034
2027
  title: "Double",
2035
- value: fn
2028
+ value: hn
2036
2029
  }
2037
- ], ri = [
2030
+ ], ni = [
2038
2031
  {
2039
2032
  title: "No Blending",
2040
2033
  value: Jn
@@ -2059,7 +2052,7 @@ const ii = [
2059
2052
  title: "Custom",
2060
2053
  value: aa
2061
2054
  }
2062
- ], si = [
2055
+ ], ai = [
2063
2056
  {
2064
2057
  title: "Add",
2065
2058
  value: ia
@@ -2070,56 +2063,56 @@ const ii = [
2070
2063
  },
2071
2064
  {
2072
2065
  title: "Reverse Subtract",
2073
- value: sa
2066
+ value: oa
2074
2067
  },
2075
2068
  {
2076
2069
  title: "Min",
2077
- value: oa
2070
+ value: sa
2078
2071
  },
2079
2072
  {
2080
2073
  title: "Max",
2081
2074
  value: ca
2082
2075
  }
2083
- ], oi = [
2076
+ ], ii = [
2084
2077
  {
2085
2078
  title: "Zero",
2086
- valye: pn
2079
+ valye: fn
2087
2080
  },
2088
2081
  {
2089
2082
  title: "One",
2090
- valye: mn
2083
+ valye: pn
2091
2084
  },
2092
2085
  {
2093
2086
  title: "Src Color",
2094
- valye: vn
2087
+ valye: mn
2095
2088
  },
2096
2089
  {
2097
2090
  title: "One Minus Src Color",
2098
- valye: gn
2091
+ valye: vn
2099
2092
  },
2100
2093
  {
2101
2094
  title: "Src Alpha",
2102
- valye: bn
2095
+ valye: gn
2103
2096
  },
2104
2097
  {
2105
2098
  title: "One Minus Src Alpha",
2106
- valye: yn
2099
+ valye: bn
2107
2100
  },
2108
2101
  {
2109
2102
  title: "Dst Alpha",
2110
- valye: En
2103
+ valye: yn
2111
2104
  },
2112
2105
  {
2113
2106
  title: "One Minus Dst Alpha",
2114
- valye: Cn
2107
+ valye: En
2115
2108
  },
2116
2109
  {
2117
2110
  title: "Dst Color",
2118
- valye: xn
2111
+ valye: Cn
2119
2112
  },
2120
2113
  {
2121
2114
  title: "One Minus Dst Color",
2122
- valye: Sn
2115
+ valye: xn
2123
2116
  },
2124
2117
  {
2125
2118
  title: "Src Alpha Saturate",
@@ -2131,56 +2124,56 @@ const ii = [
2131
2124
  },
2132
2125
  {
2133
2126
  title: "One Minus Constant Color",
2134
- valye: On
2127
+ valye: Sn
2135
2128
  },
2136
2129
  {
2137
2130
  title: "Constant Alpha",
2138
- valye: Mn
2131
+ valye: On
2139
2132
  },
2140
2133
  {
2141
2134
  title: "One Minus Constant Alpha",
2142
- valye: Tn
2135
+ valye: Mn
2143
2136
  }
2144
- ], ci = [
2137
+ ], ri = [
2145
2138
  {
2146
2139
  title: "Zero",
2147
- valye: pn
2140
+ valye: fn
2148
2141
  },
2149
2142
  {
2150
2143
  title: "One",
2151
- valye: mn
2144
+ valye: pn
2152
2145
  },
2153
2146
  {
2154
2147
  title: "Src Color",
2155
- valye: vn
2148
+ valye: mn
2156
2149
  },
2157
2150
  {
2158
2151
  title: "One Minus Src Color",
2159
- valye: gn
2152
+ valye: vn
2160
2153
  },
2161
2154
  {
2162
2155
  title: "Src Alpha",
2163
- valye: bn
2156
+ valye: gn
2164
2157
  },
2165
2158
  {
2166
2159
  title: "One Minus Src Alpha",
2167
- valye: yn
2160
+ valye: bn
2168
2161
  },
2169
2162
  {
2170
2163
  title: "Dst Alpha",
2171
- valye: En
2164
+ valye: yn
2172
2165
  },
2173
2166
  {
2174
2167
  title: "One Minus Dst Alpha",
2175
- valye: Cn
2168
+ valye: En
2176
2169
  },
2177
2170
  {
2178
2171
  title: "Dst Color",
2179
- valye: xn
2172
+ valye: Cn
2180
2173
  },
2181
2174
  {
2182
2175
  title: "One Minus Dst Color",
2183
- valye: Sn
2176
+ valye: xn
2184
2177
  },
2185
2178
  {
2186
2179
  title: "Constant Color",
@@ -2188,80 +2181,80 @@ const ii = [
2188
2181
  },
2189
2182
  {
2190
2183
  title: "One Minus Constant Color",
2191
- valye: On
2184
+ valye: Sn
2192
2185
  },
2193
2186
  {
2194
2187
  title: "Constant Alpha",
2195
- valye: Mn
2188
+ valye: On
2196
2189
  },
2197
2190
  {
2198
2191
  title: "One Minus Constant Alpha",
2199
- valye: Tn
2192
+ valye: Mn
2200
2193
  }
2201
2194
  ];
2202
- function st(t, n) {
2195
+ function ot(t, n) {
2203
2196
  t.needsUpdate = !0, t.type = "option", t.options = n;
2204
2197
  }
2205
- function en(t, n, a) {
2198
+ function Qt(t, n, a) {
2206
2199
  const e = [];
2207
- for (const s in t) {
2208
- if (!ti(s))
2200
+ for (const o in t) {
2201
+ if (!Ja(o))
2209
2202
  continue;
2210
- const o = typeof t[s], p = t[s];
2211
- if (o === "boolean" || o === "number" || o === "string") {
2203
+ const s = typeof t[o], p = t[o];
2204
+ if (s === "boolean" || s === "number" || s === "string") {
2212
2205
  const c = {
2213
- title: De(s),
2214
- prop: s,
2215
- type: o,
2206
+ title: Ie(o),
2207
+ prop: o,
2208
+ type: s,
2216
2209
  value: p,
2217
2210
  min: void 0,
2218
2211
  max: void 0,
2219
- needsUpdate: o === "boolean",
2212
+ needsUpdate: s === "boolean",
2220
2213
  onChange: (f, v) => {
2221
2214
  a.updateObject(n.uuid, `material.${f}`, v), c.needsUpdate && a.updateObject(n.uuid, "material.needsUpdate", !0);
2222
2215
  const b = a.scene?.getObjectByProperty("uuid", n.uuid);
2223
2216
  b !== void 0 && ee(b, `material.${f}`, v);
2224
2217
  }
2225
2218
  };
2226
- switch (s) {
2219
+ switch (o) {
2227
2220
  case "blending":
2228
- st(c, ri);
2221
+ ot(c, ni);
2229
2222
  break;
2230
2223
  case "blendDst":
2231
- st(c, ci);
2224
+ ot(c, ri);
2232
2225
  break;
2233
2226
  case "blendEquation":
2234
- st(c, si);
2227
+ ot(c, ai);
2235
2228
  break;
2236
2229
  case "blendSrc":
2237
- st(c, oi);
2230
+ ot(c, ii);
2238
2231
  break;
2239
2232
  case "side":
2240
- st(c, ii);
2233
+ ot(c, ti);
2241
2234
  break;
2242
2235
  }
2243
- ni(s) && (c.value = Number(p), c.type = "range", c.min = 0, c.max = 1, c.step = 0.01);
2244
- const u = o === "string" && (s === "vertexShader" || s === "fragmentShader");
2236
+ Qa(o) && (c.value = Number(p), c.type = "range", c.min = 0, c.max = 1, c.step = 0.01);
2237
+ const u = s === "string" && (o === "vertexShader" || o === "fragmentShader");
2245
2238
  u && (c.disabled = !1, c.latest = c.value, c.onChange = (f, v) => {
2246
2239
  c.latest = v;
2247
2240
  }), e.push(c), u && e.push({
2248
- title: `${lt(s)} - Update`,
2241
+ title: `${ct(o)} - Update`,
2249
2242
  type: "button",
2250
2243
  onChange: () => {
2251
- a.updateObject(n.uuid, `material.${s}`, c.latest), a.updateObject(n.uuid, "material.needsUpdate", !0);
2244
+ a.updateObject(n.uuid, `material.${o}`, c.latest), a.updateObject(n.uuid, "material.needsUpdate", !0);
2252
2245
  const f = a.scene?.getObjectByProperty("uuid", n.uuid);
2253
- f !== void 0 && (ee(f, `material.${s}`, c.latest), f.material.needsUpdate = !0);
2246
+ f !== void 0 && (ee(f, `material.${o}`, c.latest), f.material.needsUpdate = !0);
2254
2247
  }
2255
2248
  });
2256
- } else if (o === "object")
2249
+ } else if (s === "object")
2257
2250
  if (p.isColor)
2258
2251
  e.push({
2259
- title: De(s),
2260
- prop: s,
2252
+ title: Ie(o),
2253
+ prop: o,
2261
2254
  type: "color",
2262
2255
  value: p,
2263
2256
  onChange: (c, u) => {
2264
- const f = new Tt(u);
2257
+ const f = new Mt(u);
2265
2258
  a.updateObject(n.uuid, `material.${c}`, f);
2266
2259
  const v = a.scene?.getObjectByProperty("uuid", n.uuid);
2267
2260
  v !== void 0 && ee(v, `material.${c}`, f);
@@ -2275,13 +2268,13 @@ function en(t, n, a) {
2275
2268
  type: `${typeof p[u]}`,
2276
2269
  value: p[u],
2277
2270
  onChange: (f, v) => {
2278
- a.updateObject(n.uuid, `material.${s}`, v);
2271
+ a.updateObject(n.uuid, `material.${o}`, v);
2279
2272
  const b = a.scene?.getObjectByProperty("uuid", n.uuid);
2280
- b !== void 0 && ee(b, `material.${s}`, v);
2273
+ b !== void 0 && ee(b, `material.${o}`, v);
2281
2274
  }
2282
2275
  });
2283
2276
  e.push({
2284
- title: De(s),
2277
+ title: Ie(o),
2285
2278
  items: c
2286
2279
  });
2287
2280
  } else {
@@ -2293,53 +2286,53 @@ function en(t, n, a) {
2293
2286
  case "number":
2294
2287
  case "string":
2295
2288
  u === "src" ? e.push({
2296
- title: De(s),
2289
+ title: Ie(o),
2297
2290
  type: "image",
2298
2291
  value: f,
2299
2292
  onChange: (b, E) => {
2300
- a.createTexture(n.uuid, `material.${s}`, E);
2293
+ a.createTexture(n.uuid, `material.${o}`, E);
2301
2294
  const x = a.scene?.getObjectByProperty("uuid", n.uuid);
2302
- x !== void 0 && Gt(E).then((M) => {
2303
- ee(x, `material.${s}`, M), ee(x, "material.needsUpdate", !0);
2295
+ x !== void 0 && Yt(E).then((M) => {
2296
+ ee(x, `material.${o}`, M), ee(x, "material.needsUpdate", !0);
2304
2297
  });
2305
2298
  }
2306
2299
  }) : c.push({
2307
- title: `${De(u)}`,
2308
- prop: `material.${s}.${u}`,
2309
- type: `${typeof t[s][u]}`,
2300
+ title: `${Ie(u)}`,
2301
+ prop: `material.${o}.${u}`,
2302
+ type: `${typeof t[o][u]}`,
2310
2303
  value: p[u],
2311
2304
  onChange: (b, E) => {
2312
- a.updateObject(n.uuid, `material.${s}.${u}`, E);
2305
+ a.updateObject(n.uuid, `material.${o}.${u}`, E);
2313
2306
  const x = a.scene?.getObjectByProperty("uuid", n.uuid);
2314
- x !== void 0 && ee(x, `material.${s}.${u}`, E);
2307
+ x !== void 0 && ee(x, `material.${o}.${u}`, E);
2315
2308
  }
2316
2309
  });
2317
2310
  break;
2318
2311
  case "object":
2319
2312
  if (f.value !== void 0 && f.value.src !== void 0)
2320
2313
  c.push({
2321
- title: De(u),
2314
+ title: Ie(u),
2322
2315
  type: "image",
2323
2316
  value: f.value.src,
2324
2317
  onChange: (b, E) => {
2325
- a.createTexture(n.uuid, `material.${s}.${u}.value`, p);
2318
+ a.createTexture(n.uuid, `material.${o}.${u}.value`, p);
2326
2319
  const x = a.scene?.getObjectByProperty("uuid", n.uuid);
2327
- x !== void 0 && Gt(E).then((M) => {
2328
- ee(x, `material.${s}.${u}.value`, M);
2320
+ x !== void 0 && Yt(E).then((M) => {
2321
+ ee(x, `material.${o}.${u}.value`, M);
2329
2322
  });
2330
2323
  }
2331
2324
  });
2332
- else if (s === "uniforms") {
2325
+ else if (o === "uniforms") {
2333
2326
  const b = f.value, E = (x, M, P) => ({
2334
2327
  title: x,
2335
2328
  type: "number",
2336
2329
  value: P,
2337
2330
  step: 0.01,
2338
- onChange: (W, B) => {
2339
- const S = `material.uniforms.${u}.value.${M}`;
2340
- a.updateObject(n.uuid, S, B);
2331
+ onChange: (H, B) => {
2332
+ const w = `material.uniforms.${u}.value.${M}`;
2333
+ a.updateObject(n.uuid, w, B);
2341
2334
  const z = a.scene?.getObjectByProperty("uuid", n.uuid);
2342
- z !== void 0 && ee(z, S, B);
2335
+ z !== void 0 && ee(z, w, B);
2343
2336
  }
2344
2337
  });
2345
2338
  if (typeof f.value == "number")
@@ -2348,10 +2341,10 @@ function en(t, n, a) {
2348
2341
  type: "number",
2349
2342
  value: f.value,
2350
2343
  onChange: (x, M) => {
2351
- const P = `material.${s}.${x}.value`;
2344
+ const P = `material.${o}.${x}.value`;
2352
2345
  a.updateObject(n.uuid, P, M);
2353
- const W = a.scene?.getObjectByProperty("uuid", n.uuid);
2354
- W !== void 0 && ee(W, P, M);
2346
+ const H = a.scene?.getObjectByProperty("uuid", n.uuid);
2347
+ H !== void 0 && ee(H, P, M);
2355
2348
  }
2356
2349
  });
2357
2350
  else if (b.r !== void 0 && b.g !== void 0 && b.b !== void 0)
@@ -2360,10 +2353,10 @@ function en(t, n, a) {
2360
2353
  type: "color",
2361
2354
  value: f.value,
2362
2355
  onChange: (x, M) => {
2363
- const P = new Tt(M), W = `material.${s}.${x}.value`;
2364
- a.updateObject(n.uuid, W, P);
2356
+ const P = new Mt(M), H = `material.${o}.${x}.value`;
2357
+ a.updateObject(n.uuid, H, P);
2365
2358
  const B = a.scene?.getObjectByProperty("uuid", n.uuid);
2366
- B !== void 0 && ee(B, W, P);
2359
+ B !== void 0 && ee(B, H, P);
2367
2360
  }
2368
2361
  });
2369
2362
  else if (b.x !== void 0 && b.y !== void 0 && b.z === void 0 && b.w === void 0)
@@ -2417,23 +2410,23 @@ function en(t, n, a) {
2417
2410
  type: `${typeof f.value}`,
2418
2411
  value: f.value,
2419
2412
  onChange: (b, E) => {
2420
- a.updateObject(n.uuid, `material.${s}.${u}.value`, E);
2413
+ a.updateObject(n.uuid, `material.${o}.${u}.value`, E);
2421
2414
  const x = a.scene?.getObjectByProperty("uuid", n.uuid);
2422
- x !== void 0 && ee(x, `material.${s}.${u}.value`, E);
2415
+ x !== void 0 && ee(x, `material.${o}.${u}.value`, E);
2423
2416
  }
2424
2417
  });
2425
2418
  break;
2426
2419
  }
2427
2420
  }
2428
2421
  c.length > 0 && e.push({
2429
- title: De(s),
2422
+ title: Ie(o),
2430
2423
  items: c
2431
2424
  });
2432
2425
  }
2433
2426
  else
2434
- p !== void 0 && console.log("other:", s, o, p);
2427
+ p !== void 0 && console.log("other:", o, s, p);
2435
2428
  }
2436
- return e.sort((s, o) => s.title < o.title ? -1 : s.title > o.title ? 1 : 0), e.push({
2429
+ return e.sort((o, s) => o.title < s.title ? -1 : o.title > s.title ? 1 : 0), e.push({
2437
2430
  title: "Update Material",
2438
2431
  type: "button",
2439
2432
  onChange: () => {
@@ -2441,19 +2434,19 @@ function en(t, n, a) {
2441
2434
  }
2442
2435
  }), e;
2443
2436
  }
2444
- function li(t, n) {
2437
+ function oi(t, n) {
2445
2438
  const a = t.material;
2446
2439
  if (Array.isArray(a)) {
2447
- const e = [], s = a.length;
2448
- for (let o = 0; o < s; o++)
2440
+ const e = [], o = a.length;
2441
+ for (let s = 0; s < o; s++)
2449
2442
  e.push(
2450
2443
  /* @__PURE__ */ l.jsx(
2451
2444
  Be,
2452
2445
  {
2453
- title: `Material ${o}`,
2454
- items: en(a[o], t, n)
2446
+ title: `Material ${s}`,
2447
+ items: Qt(a[s], t, n)
2455
2448
  },
2456
- `Material ${o}`
2449
+ `Material ${s}`
2457
2450
  )
2458
2451
  );
2459
2452
  return /* @__PURE__ */ l.jsx(l.Fragment, { children: e });
@@ -2462,15 +2455,15 @@ function li(t, n) {
2462
2455
  Be,
2463
2456
  {
2464
2457
  title: "Material",
2465
- items: en(a, t, n)
2458
+ items: Qt(a, t, n)
2466
2459
  }
2467
2460
  );
2468
2461
  }
2469
- function ct(t) {
2462
+ function st(t) {
2470
2463
  let n = t.value;
2471
- n !== void 0 && n.isColor !== void 0 && (n = Aa(t.value));
2472
- const [a, e] = se(n), s = Ee(null), o = Ee(null), p = Ee(null);
2473
- Fe(() => {
2464
+ n !== void 0 && n.isColor !== void 0 && (n = Ta(t.value));
2465
+ const [a, e] = ae(n), o = Ee(null), s = Ee(null), p = Ee(null);
2466
+ Oe(() => {
2474
2467
  let v = !1, b = -1, E = 0, x = Number(a);
2475
2468
  const M = (z) => {
2476
2469
  v = !0, E = x, b = z.clientX;
@@ -2478,14 +2471,14 @@ function ct(t) {
2478
2471
  if (!v)
2479
2472
  return;
2480
2473
  const Ce = t.step !== void 0 ? t.step : 1, le = (z.clientX - b) * Ce;
2481
- x = Number((E + le).toFixed(4)), o.current !== null && (o.current.value = x.toString()), t.onChange !== void 0 && t.onChange(t.prop !== void 0 ? t.prop : t.title, x);
2482
- }, W = () => {
2474
+ x = Number((E + le).toFixed(4)), s.current !== null && (s.current.value = x.toString()), t.onChange !== void 0 && t.onChange(t.prop !== void 0 ? t.prop : t.title, x);
2475
+ }, H = () => {
2483
2476
  v = !1;
2484
2477
  }, B = () => {
2485
2478
  v = !1;
2486
- }, S = t.type === "number";
2487
- return S && (s.current?.addEventListener("mousedown", M, !1), document.addEventListener("mouseup", W, !1), document.addEventListener("mousemove", P, !1), document.addEventListener("contextmenu", B, !1)), () => {
2488
- S && (s.current?.removeEventListener("mousedown", M), document.removeEventListener("mouseup", W), document.removeEventListener("mousemove", P), document.removeEventListener("contextmenu", B));
2479
+ }, w = t.type === "number";
2480
+ return w && (o.current?.addEventListener("mousedown", M, !1), document.addEventListener("mouseup", H, !1), document.addEventListener("mousemove", P, !1), document.addEventListener("contextmenu", B, !1)), () => {
2481
+ w && (o.current?.removeEventListener("mousedown", M), document.removeEventListener("mouseup", H), document.removeEventListener("mousemove", P), document.removeEventListener("contextmenu", B));
2489
2482
  };
2490
2483
  }, [a]);
2491
2484
  const c = t.type === "string" && (a.length > 100 || a.search(`
@@ -2494,7 +2487,7 @@ function ct(t) {
2494
2487
  t.type === "boolean" ? b = v.target.checked : t.type === "option" && (b = t.options[b].value), e(b), t.onChange !== void 0 && t.onChange(t.prop !== void 0 ? t.prop : t.title, b);
2495
2488
  };
2496
2489
  return /* @__PURE__ */ l.jsxs("div", { className: `field ${u ? "block" : ""}`, children: [
2497
- t.type !== "button" && /* @__PURE__ */ l.jsx("label", { ref: s, children: lt(t.title) }, "fieldLabel"),
2490
+ t.type !== "button" && /* @__PURE__ */ l.jsx("label", { ref: o, children: ct(t.title) }, "fieldLabel"),
2498
2491
  t.type === "string" && !c && /* @__PURE__ */ l.jsx(
2499
2492
  "input",
2500
2493
  {
@@ -2526,7 +2519,7 @@ function ct(t) {
2526
2519
  t.type === "number" && /* @__PURE__ */ l.jsx(
2527
2520
  "input",
2528
2521
  {
2529
- ref: o,
2522
+ ref: s,
2530
2523
  type: "number",
2531
2524
  value: a,
2532
2525
  min: t.min,
@@ -2566,14 +2559,14 @@ function ct(t) {
2566
2559
  }
2567
2560
  ),
2568
2561
  t.type === "image" && /* @__PURE__ */ l.jsx("img", { ref: p, onClick: () => {
2569
- ai().then((v) => {
2562
+ ei().then((v) => {
2570
2563
  p.current.src = v, t.onChange !== void 0 && t.onChange(t.prop !== void 0 ? t.prop : t.title, v);
2571
2564
  });
2572
- }, src: a.length > 0 ? a : Qa }),
2573
- t.type === "option" && /* @__PURE__ */ l.jsx(l.Fragment, { children: /* @__PURE__ */ l.jsx("select", { onChange: f, disabled: t.disabled, defaultValue: t.value, children: t.options?.map((v, b) => /* @__PURE__ */ l.jsx("option", { value: v.value, children: lt(v.title) }, b)) }) })
2565
+ }, src: a.length > 0 ? a : Xa }),
2566
+ t.type === "option" && /* @__PURE__ */ l.jsx(l.Fragment, { children: /* @__PURE__ */ l.jsx("select", { onChange: f, disabled: t.disabled, defaultValue: t.value, children: t.options?.map((v, b) => /* @__PURE__ */ l.jsx("option", { value: v.value, children: ct(v.title) }, b)) }) })
2574
2567
  ] });
2575
2568
  }
2576
- function tn(t) {
2569
+ function en(t) {
2577
2570
  switch (t) {
2578
2571
  case "fov":
2579
2572
  return "FOV";
@@ -2602,34 +2595,34 @@ function tn(t) {
2602
2595
  }
2603
2596
  return t;
2604
2597
  }
2605
- function ui(t, n) {
2598
+ function si(t, n) {
2606
2599
  const a = [];
2607
2600
  if (t.perspectiveCameraInfo !== void 0)
2608
2601
  for (const e in t.perspectiveCameraInfo)
2609
2602
  a.push({
2610
- title: tn(e),
2603
+ title: en(e),
2611
2604
  prop: e,
2612
2605
  type: "number",
2613
2606
  step: 0.01,
2614
2607
  value: t.perspectiveCameraInfo[e],
2615
- onChange: (s, o) => {
2616
- n.updateObject(t.uuid, s, o), n.requestMethod(t.uuid, "updateProjectionMatrix");
2608
+ onChange: (o, s) => {
2609
+ n.updateObject(t.uuid, o, s), n.requestMethod(t.uuid, "updateProjectionMatrix");
2617
2610
  const p = n.scene?.getObjectByProperty("uuid", t.uuid);
2618
- p !== void 0 && (ee(p, s, o), p.updateProjectionMatrix());
2611
+ p !== void 0 && (ee(p, o, s), p.updateProjectionMatrix());
2619
2612
  }
2620
2613
  });
2621
2614
  else if (t.orthographicCameraInfo !== void 0)
2622
2615
  for (const e in t.orthographicCameraInfo)
2623
2616
  a.push({
2624
- title: tn(e),
2617
+ title: en(e),
2625
2618
  prop: e,
2626
2619
  type: "number",
2627
2620
  step: 0.01,
2628
2621
  value: t.perspectiveCameraInfo[e],
2629
- onChange: (s, o) => {
2630
- n.updateObject(t.uuid, s, o), n.requestMethod(t.uuid, "updateProjectionMatrix");
2622
+ onChange: (o, s) => {
2623
+ n.updateObject(t.uuid, o, s), n.requestMethod(t.uuid, "updateProjectionMatrix");
2631
2624
  const p = n.scene?.getObjectByProperty("uuid", t.uuid);
2632
- p !== void 0 && (ee(p, s, o), p.updateProjectionMatrix());
2625
+ p !== void 0 && (ee(p, o, s), p.updateProjectionMatrix());
2633
2626
  }
2634
2627
  });
2635
2628
  return /* @__PURE__ */ l.jsx(
@@ -2640,27 +2633,27 @@ function ui(t, n) {
2640
2633
  }
2641
2634
  );
2642
2635
  }
2643
- const di = Math.PI / 180, hi = 180 / Math.PI;
2644
- function qe(t, n, a, e, s) {
2645
- return e + (t - n) * (s - e) / (a - n);
2636
+ const ci = Math.PI / 180, li = 180 / Math.PI;
2637
+ function qe(t, n, a, e, o) {
2638
+ return e + (t - n) * (o - e) / (a - n);
2646
2639
  }
2647
- function fi(t) {
2648
- return t * di;
2640
+ function ui(t) {
2641
+ return t * ci;
2649
2642
  }
2650
- function Ut(t) {
2651
- return t * hi;
2643
+ function Bt(t) {
2644
+ return t * li;
2652
2645
  }
2653
- function pi(t, n) {
2646
+ function di(t, n) {
2654
2647
  const a = new ua();
2655
2648
  a.elements = t.matrix;
2656
- const e = new X(), s = new da(), o = new X();
2657
- t.uuid.length > 0 && (e.setFromMatrixPosition(a), s.setFromRotationMatrix(a), o.setFromMatrixScale(a));
2649
+ const e = new X(), o = new da(), s = new X();
2650
+ t.uuid.length > 0 && (e.setFromMatrixPosition(a), o.setFromRotationMatrix(a), s.setFromMatrixScale(a));
2658
2651
  const p = (u, f) => {
2659
2652
  n.updateObject(t.uuid, u, f);
2660
2653
  const v = n.scene?.getObjectByProperty("uuid", t.uuid);
2661
2654
  v !== void 0 && ee(v, u, f);
2662
2655
  }, c = (u, f) => {
2663
- p(u, fi(f));
2656
+ p(u, ui(f));
2664
2657
  };
2665
2658
  return /* @__PURE__ */ l.jsx(
2666
2659
  Be,
@@ -2692,7 +2685,7 @@ function pi(t, n) {
2692
2685
  title: "Rotation X",
2693
2686
  prop: "rotation.x",
2694
2687
  type: "number",
2695
- value: Ft(Ut(s.x)),
2688
+ value: Nt(Bt(o.x)),
2696
2689
  min: -360,
2697
2690
  max: 360,
2698
2691
  step: 0.1,
@@ -2702,7 +2695,7 @@ function pi(t, n) {
2702
2695
  title: "Rotation Y",
2703
2696
  prop: "rotation.y",
2704
2697
  type: "number",
2705
- value: Ft(Ut(s.y)),
2698
+ value: Nt(Bt(o.y)),
2706
2699
  min: -360,
2707
2700
  max: 360,
2708
2701
  step: 0.1,
@@ -2712,7 +2705,7 @@ function pi(t, n) {
2712
2705
  title: "Rotation Z",
2713
2706
  prop: "rotation.z",
2714
2707
  type: "number",
2715
- value: Ft(Ut(s.z)),
2708
+ value: Nt(Bt(o.z)),
2716
2709
  min: -360,
2717
2710
  max: 360,
2718
2711
  step: 0.1,
@@ -2722,7 +2715,7 @@ function pi(t, n) {
2722
2715
  title: "Scale X",
2723
2716
  prop: "scale.x",
2724
2717
  type: "number",
2725
- value: o.x,
2718
+ value: s.x,
2726
2719
  step: 0.01,
2727
2720
  onChange: p
2728
2721
  },
@@ -2730,7 +2723,7 @@ function pi(t, n) {
2730
2723
  title: "Scale Y",
2731
2724
  prop: "scale.y",
2732
2725
  type: "number",
2733
- value: o.y,
2726
+ value: s.y,
2734
2727
  step: 0.01,
2735
2728
  onChange: p
2736
2729
  },
@@ -2738,7 +2731,7 @@ function pi(t, n) {
2738
2731
  title: "Scale Z",
2739
2732
  prop: "scale.z",
2740
2733
  type: "number",
2741
- value: o.z,
2734
+ value: s.z,
2742
2735
  step: 0.01,
2743
2736
  onChange: p
2744
2737
  }
@@ -2746,7 +2739,7 @@ function pi(t, n) {
2746
2739
  }
2747
2740
  );
2748
2741
  }
2749
- function nn(t) {
2742
+ function tn(t) {
2750
2743
  switch (t) {
2751
2744
  case "color":
2752
2745
  return "Color";
@@ -2765,32 +2758,32 @@ function nn(t) {
2765
2758
  }
2766
2759
  return t;
2767
2760
  }
2768
- function mi(t, n) {
2761
+ function hi(t, n) {
2769
2762
  const a = [];
2770
2763
  if (t.lightInfo !== void 0)
2771
2764
  for (const e in t.lightInfo) {
2772
- const s = t.lightInfo[e];
2773
- s !== void 0 && (s.isColor !== void 0 ? a.push({
2774
- title: nn(e),
2765
+ const o = t.lightInfo[e];
2766
+ o !== void 0 && (o.isColor !== void 0 ? a.push({
2767
+ title: tn(e),
2775
2768
  prop: e,
2776
2769
  type: "color",
2777
- value: s,
2778
- onChange: (o, p) => {
2779
- const c = new Tt(p);
2780
- n.updateObject(t.uuid, o, c);
2770
+ value: o,
2771
+ onChange: (s, p) => {
2772
+ const c = new Mt(p);
2773
+ n.updateObject(t.uuid, s, c);
2781
2774
  const u = n.scene?.getObjectByProperty("uuid", t.uuid);
2782
- u !== void 0 && ee(u, o, c);
2775
+ u !== void 0 && ee(u, s, c);
2783
2776
  }
2784
2777
  }) : a.push({
2785
- title: nn(e),
2778
+ title: tn(e),
2786
2779
  prop: e,
2787
- type: typeof s,
2788
- value: s,
2789
- step: typeof s == "number" ? 0.01 : void 0,
2790
- onChange: (o, p) => {
2791
- n.updateObject(t.uuid, o, p);
2780
+ type: typeof o,
2781
+ value: o,
2782
+ step: typeof o == "number" ? 0.01 : void 0,
2783
+ onChange: (s, p) => {
2784
+ n.updateObject(t.uuid, s, p);
2792
2785
  const c = n.scene?.getObjectByProperty("uuid", t.uuid);
2793
- c !== void 0 && ee(c, o, p);
2786
+ c !== void 0 && ee(c, s, p);
2794
2787
  }
2795
2788
  }));
2796
2789
  }
@@ -2802,11 +2795,11 @@ function mi(t, n) {
2802
2795
  }
2803
2796
  );
2804
2797
  }
2805
- function vi(t, n) {
2798
+ function fi(t, n) {
2806
2799
  const a = [], e = [];
2807
- let s = 0;
2800
+ let o = 0;
2808
2801
  t.animations.forEach((c) => {
2809
- s = Math.max(s, c.duration), c.duration > 0 && e.push({
2802
+ o = Math.max(o, c.duration), c.duration > 0 && e.push({
2810
2803
  title: c.name,
2811
2804
  items: [
2812
2805
  {
@@ -2836,10 +2829,10 @@ function vi(t, n) {
2836
2829
  title: "Animations",
2837
2830
  items: e
2838
2831
  });
2839
- const o = n.scene?.getObjectByProperty("uuid", t.uuid);
2832
+ const s = n.scene?.getObjectByProperty("uuid", t.uuid);
2840
2833
  let p = !1;
2841
- if (o !== void 0) {
2842
- const c = o.mixer;
2834
+ if (s !== void 0) {
2835
+ const c = s.mixer;
2843
2836
  if (p = c !== void 0, p) {
2844
2837
  const u = [
2845
2838
  {
@@ -2881,9 +2874,9 @@ const Bn = {
2881
2874
  lightInfo: void 0
2882
2875
  };
2883
2876
  let te = { ...Bn };
2884
- function gi(t) {
2885
- const [n, a] = se(-1);
2886
- Fe(() => {
2877
+ function pi(t) {
2878
+ const [n, a] = ae(-1);
2879
+ Oe(() => {
2887
2880
  function p(u) {
2888
2881
  te = { ...u.value }, a(Date.now());
2889
2882
  }
@@ -2894,11 +2887,11 @@ function gi(t) {
2894
2887
  k.removeEventListener(j.SET_SCENE, c), k.removeEventListener(j.SET_OBJECT, p);
2895
2888
  };
2896
2889
  }, []);
2897
- const e = te.type.toLowerCase(), s = te.animations.length > 0 || te.mixer !== void 0, o = e.search("mesh") > -1 || e.search("line") > -1 || e.search("points") > -1;
2898
- return /* @__PURE__ */ l.jsx(Wt, { label: "Inspector", children: /* @__PURE__ */ l.jsx("div", { id: "Inspector", className: t.class, children: te.uuid.length > 0 && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
2890
+ const e = te.type.toLowerCase(), o = te.animations.length > 0 || te.mixer !== void 0, s = e.search("mesh") > -1 || e.search("line") > -1 || e.search("points") > -1;
2891
+ return /* @__PURE__ */ l.jsx(Vt, { label: "Inspector", children: /* @__PURE__ */ l.jsx("div", { id: "Inspector", className: t.class, children: te.uuid.length > 0 && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
2899
2892
  /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
2900
2893
  /* @__PURE__ */ l.jsx(
2901
- ct,
2894
+ st,
2902
2895
  {
2903
2896
  type: "string",
2904
2897
  title: "Name",
@@ -2908,7 +2901,7 @@ function gi(t) {
2908
2901
  }
2909
2902
  ),
2910
2903
  /* @__PURE__ */ l.jsx(
2911
- ct,
2904
+ st,
2912
2905
  {
2913
2906
  type: "string",
2914
2907
  title: "Type",
@@ -2918,7 +2911,7 @@ function gi(t) {
2918
2911
  }
2919
2912
  ),
2920
2913
  /* @__PURE__ */ l.jsx(
2921
- ct,
2914
+ st,
2922
2915
  {
2923
2916
  type: "string",
2924
2917
  title: "UUID",
@@ -2928,7 +2921,7 @@ function gi(t) {
2928
2921
  }
2929
2922
  ),
2930
2923
  /* @__PURE__ */ l.jsx(
2931
- ct,
2924
+ st,
2932
2925
  {
2933
2926
  type: "boolean",
2934
2927
  title: "Visible",
@@ -2943,43 +2936,31 @@ function gi(t) {
2943
2936
  )
2944
2937
  ] }),
2945
2938
  /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
2946
- pi(te, t.three),
2947
- s ? vi(te, t.three) : null,
2948
- e.search("camera") > -1 ? ui(te, t.three) : null,
2949
- e.search("light") > -1 ? mi(te, t.three) : null,
2950
- o ? li(te, t.three) : null
2939
+ di(te, t.three),
2940
+ o ? fi(te, t.three) : null,
2941
+ e.search("camera") > -1 ? si(te, t.three) : null,
2942
+ e.search("light") > -1 ? hi(te, t.three) : null,
2943
+ s ? oi(te, t.three) : null
2951
2944
  ] })
2952
2945
  ] }) }, n) }, "Inspector");
2953
2946
  }
2954
- class Bi extends Ma {
2955
- three;
2956
- constructor(n) {
2957
- super(n), this.state = {
2958
- scene: n.scene !== void 0 ? n.scene : null
2959
- }, this.three = n.three, k.addEventListener(j.SET_SCENE, this.setScene);
2960
- }
2961
- componentWillUnmount() {
2962
- k.removeEventListener(j.SET_SCENE, this.setScene);
2963
- }
2964
- render() {
2965
- const n = this.componentState.scene !== null, a = "Hierarchy - " + (n ? `${this.componentState.scene?.name}` : "No Scene");
2966
- return /* @__PURE__ */ l.jsx("div", { id: "SidePanel", children: /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
2967
- /* @__PURE__ */ l.jsx(Wt, { label: a, open: !0, children: /* @__PURE__ */ l.jsx(l.Fragment, { children: n && /* @__PURE__ */ l.jsx(Ja, { child: this.componentState.scene, three: this.three }) }) }),
2968
- /* @__PURE__ */ l.jsx(gi, { three: this.three })
2969
- ] }) }, "SidePanel");
2970
- }
2971
- // Private
2972
- setScene = (n) => {
2973
- this.setState(() => ({
2974
- scene: n.value
2975
- }));
2976
- };
2977
- // Getters / Setters
2978
- get componentState() {
2979
- return this.state;
2980
- }
2947
+ function Ii(t) {
2948
+ const [n, a] = ae(t.scene);
2949
+ Oe(() => {
2950
+ const s = (p) => {
2951
+ a(p.value);
2952
+ };
2953
+ return k.addEventListener(j.SET_SCENE, s), () => {
2954
+ k.removeEventListener(j.SET_SCENE, s);
2955
+ };
2956
+ }, []);
2957
+ const e = n !== null, o = "Hierarchy - " + (e ? `${n?.name}` : "No Scene");
2958
+ return /* @__PURE__ */ l.jsxs("div", { id: "SidePanel", children: [
2959
+ /* @__PURE__ */ l.jsx(Vt, { label: o, open: !0, children: /* @__PURE__ */ l.jsx(l.Fragment, { children: e && /* @__PURE__ */ l.jsx(Ka, { child: n, three: t.three }) }) }),
2960
+ /* @__PURE__ */ l.jsx(pi, { three: t.three })
2961
+ ] }, "SidePanel");
2981
2962
  }
2982
- function Ui(t) {
2963
+ function Li(t) {
2983
2964
  function n() {
2984
2965
  return t.three.scene === void 0 ? (console.log("No scene:", t.three), !1) : !0;
2985
2966
  }
@@ -2993,16 +2974,16 @@ function Ui(t) {
2993
2974
  return;
2994
2975
  const v = t.three.scene?.getObjectByProperty("uuid", c);
2995
2976
  v !== void 0 && ee(v, u, f);
2996
- }, s = (c) => {
2977
+ }, o = (c) => {
2997
2978
  if (!n())
2998
2979
  return;
2999
2980
  const u = c.value, { key: f, value: v, uuid: b } = u;
3000
2981
  e(b, f, v);
3001
- }, o = (c) => {
2982
+ }, s = (c) => {
3002
2983
  if (!n())
3003
2984
  return;
3004
2985
  const u = c.value;
3005
- Gt(u.value).then((f) => {
2986
+ Yt(u.value).then((f) => {
3006
2987
  e(u.uuid, u.key, f), e(u.uuid, "material.needsUpdate", !0);
3007
2988
  });
3008
2989
  }, p = (c) => {
@@ -3011,19 +2992,19 @@ function Ui(t) {
3011
2992
  const { key: u, uuid: f, value: v, subitem: b } = c.value, E = t.three.scene?.getObjectByProperty("uuid", f);
3012
2993
  if (E !== void 0)
3013
2994
  try {
3014
- b !== void 0 ? La(E, b)[u](v) : E[u](v);
2995
+ b !== void 0 ? ja(E, b)[u](v) : E[u](v);
3015
2996
  } catch (x) {
3016
2997
  console.log("Error requesting method:"), console.log(x), console.log(u), console.log(v);
3017
2998
  }
3018
2999
  };
3019
- return Fe(() => (k.addEventListener(j.GET_OBJECT, a), k.addEventListener(j.UPDATE_OBJECT, s), k.addEventListener(j.CREATE_TEXTURE, o), k.addEventListener(j.REQUEST_METHOD, p), () => {
3020
- k.removeEventListener(j.GET_OBJECT, a), k.removeEventListener(j.UPDATE_OBJECT, s), k.removeEventListener(j.CREATE_TEXTURE, o), k.removeEventListener(j.REQUEST_METHOD, p);
3000
+ return Oe(() => (k.addEventListener(j.GET_OBJECT, a), k.addEventListener(j.UPDATE_OBJECT, o), k.addEventListener(j.CREATE_TEXTURE, s), k.addEventListener(j.REQUEST_METHOD, p), () => {
3001
+ k.removeEventListener(j.GET_OBJECT, a), k.removeEventListener(j.UPDATE_OBJECT, o), k.removeEventListener(j.CREATE_TEXTURE, s), k.removeEventListener(j.REQUEST_METHOD, p);
3021
3002
  }), []), null;
3022
3003
  }
3023
- const an = { type: "change" }, $t = { type: "start" }, rn = { type: "end" }, St = new ha(), sn = new fa(), bi = Math.cos(70 * pa.DEG2RAD);
3024
- class yi extends un {
3004
+ const nn = { type: "change" }, Ut = { type: "start" }, an = { type: "end" }, xt = new ha(), rn = new fa(), mi = Math.cos(70 * pa.DEG2RAD);
3005
+ class vi extends ln {
3025
3006
  constructor(n, a) {
3026
- super(), this.object = n, this.domElement = a, this.domElement.style.touchAction = "none", this.enabled = !0, this.target = new X(), this.cursor = new X(), 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: Ve.ROTATE, MIDDLE: Ve.DOLLY, RIGHT: Ve.PAN }, this.touches = { ONE: We.ROTATE, TWO: We.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this.getPolarAngle = function() {
3007
+ super(), this.object = n, this.domElement = a, this.domElement.style.touchAction = "none", this.enabled = !0, this.target = new X(), this.cursor = new X(), 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: Ve.ROTATE, MIDDLE: Ve.DOLLY, RIGHT: Ve.PAN }, this.touches = { ONE: He.ROTATE, TWO: He.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this.getPolarAngle = function() {
3027
3008
  return c.phi;
3028
3009
  }, this.getAzimuthalAngle = function() {
3029
3010
  return c.theta;
@@ -3036,38 +3017,38 @@ class yi extends un {
3036
3017
  }, this.saveState = function() {
3037
3018
  e.target0.copy(e.target), e.position0.copy(e.object.position), e.zoom0 = e.object.zoom;
3038
3019
  }, this.reset = function() {
3039
- e.target.copy(e.target0), e.object.position.copy(e.position0), e.object.zoom = e.zoom0, e.object.updateProjectionMatrix(), e.dispatchEvent(an), e.update(), o = s.NONE;
3020
+ e.target.copy(e.target0), e.object.position.copy(e.position0), e.object.zoom = e.zoom0, e.object.updateProjectionMatrix(), e.dispatchEvent(nn), e.update(), s = o.NONE;
3040
3021
  }, this.update = function() {
3041
- const r = new X(), y = new Xt().setFromUnitVectors(n.up, new X(0, 1, 0)), O = y.clone().invert(), L = new X(), K = new Xt(), de = new X(), ae = 2 * Math.PI;
3042
- return function(Nt = null) {
3022
+ const r = new X(), y = new Kt().setFromUnitVectors(n.up, new X(0, 1, 0)), O = y.clone().invert(), L = new X(), K = new Kt(), de = new X(), ie = 2 * Math.PI;
3023
+ return function(Lt = null) {
3043
3024
  const nt = e.object.position;
3044
- r.copy(nt).sub(e.target), r.applyQuaternion(y), c.setFromVector3(r), e.autoRotate && o === s.NONE && U(_(Nt)), e.enableDamping ? (c.theta += u.theta * e.dampingFactor, c.phi += u.phi * e.dampingFactor) : (c.theta += u.theta, c.phi += u.phi);
3025
+ r.copy(nt).sub(e.target), r.applyQuaternion(y), c.setFromVector3(r), e.autoRotate && s === o.NONE && U(_(Lt)), e.enableDamping ? (c.theta += u.theta * e.dampingFactor, c.phi += u.phi * e.dampingFactor) : (c.theta += u.theta, c.phi += u.phi);
3045
3026
  let pe = e.minAzimuthAngle, he = e.maxAzimuthAngle;
3046
- isFinite(pe) && isFinite(he) && (pe < -Math.PI ? pe += ae : pe > Math.PI && (pe -= ae), he < -Math.PI ? he += ae : he > Math.PI && (he -= ae), pe <= he ? c.theta = Math.max(pe, Math.min(he, c.theta)) : c.theta = c.theta > (pe + he) / 2 ? Math.max(pe, c.theta) : Math.min(he, c.theta)), c.phi = Math.max(e.minPolarAngle, Math.min(e.maxPolarAngle, c.phi)), c.makeSafe(), e.enableDamping === !0 ? e.target.addScaledVector(v, e.dampingFactor) : e.target.add(v), e.target.sub(e.cursor), e.target.clampLength(e.minTargetRadius, e.maxTargetRadius), e.target.add(e.cursor), e.zoomToCursor && oe || e.object.isOrthographicCamera ? c.radius = me(c.radius) : c.radius = me(c.radius * f), r.setFromSpherical(c), r.applyQuaternion(O), nt.copy(e.target).add(r), e.object.lookAt(e.target), e.enableDamping === !0 ? (u.theta *= 1 - e.dampingFactor, u.phi *= 1 - e.dampingFactor, v.multiplyScalar(1 - e.dampingFactor)) : (u.set(0, 0, 0), v.set(0, 0, 0));
3047
- let Ae = !1;
3048
- if (e.zoomToCursor && oe) {
3049
- let Pe = null;
3027
+ isFinite(pe) && isFinite(he) && (pe < -Math.PI ? pe += ie : pe > Math.PI && (pe -= ie), he < -Math.PI ? he += ie : he > Math.PI && (he -= ie), pe <= he ? c.theta = Math.max(pe, Math.min(he, c.theta)) : c.theta = c.theta > (pe + he) / 2 ? Math.max(pe, c.theta) : Math.min(he, c.theta)), c.phi = Math.max(e.minPolarAngle, Math.min(e.maxPolarAngle, c.phi)), c.makeSafe(), e.enableDamping === !0 ? e.target.addScaledVector(v, e.dampingFactor) : e.target.add(v), e.target.sub(e.cursor), e.target.clampLength(e.minTargetRadius, e.maxTargetRadius), e.target.add(e.cursor), e.zoomToCursor && se || e.object.isOrthographicCamera ? c.radius = me(c.radius) : c.radius = me(c.radius * f), r.setFromSpherical(c), r.applyQuaternion(O), nt.copy(e.target).add(r), e.object.lookAt(e.target), e.enableDamping === !0 ? (u.theta *= 1 - e.dampingFactor, u.phi *= 1 - e.dampingFactor, v.multiplyScalar(1 - e.dampingFactor)) : (u.set(0, 0, 0), v.set(0, 0, 0));
3028
+ let Pe = !1;
3029
+ if (e.zoomToCursor && se) {
3030
+ let ke = null;
3050
3031
  if (e.object.isPerspectiveCamera) {
3051
- const ke = r.length();
3052
- Pe = me(ke * f);
3053
- const je = ke - Pe;
3054
- e.object.position.addScaledVector(Ce, je), e.object.updateMatrixWorld();
3032
+ const je = r.length();
3033
+ ke = me(je * f);
3034
+ const De = je - ke;
3035
+ e.object.position.addScaledVector(Ce, De), e.object.updateMatrixWorld();
3055
3036
  } else if (e.object.isOrthographicCamera) {
3056
- const ke = new X(le.x, le.y, 0);
3057
- ke.unproject(e.object), e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom / f)), e.object.updateProjectionMatrix(), Ae = !0;
3058
3037
  const je = new X(le.x, le.y, 0);
3059
- je.unproject(e.object), e.object.position.sub(je).add(ke), e.object.updateMatrixWorld(), Pe = r.length();
3038
+ je.unproject(e.object), e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom / f)), e.object.updateProjectionMatrix(), Pe = !0;
3039
+ const De = new X(le.x, le.y, 0);
3040
+ De.unproject(e.object), e.object.position.sub(De).add(je), e.object.updateMatrixWorld(), ke = r.length();
3060
3041
  } else
3061
3042
  console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), e.zoomToCursor = !1;
3062
- Pe !== null && (this.screenSpacePanning ? e.target.set(0, 0, -1).transformDirection(e.object.matrix).multiplyScalar(Pe).add(e.object.position) : (St.origin.copy(e.object.position), St.direction.set(0, 0, -1).transformDirection(e.object.matrix), Math.abs(e.object.up.dot(St.direction)) < bi ? n.lookAt(e.target) : (sn.setFromNormalAndCoplanarPoint(e.object.up, e.target), St.intersectPlane(sn, e.target))));
3043
+ ke !== null && (this.screenSpacePanning ? e.target.set(0, 0, -1).transformDirection(e.object.matrix).multiplyScalar(ke).add(e.object.position) : (xt.origin.copy(e.object.position), xt.direction.set(0, 0, -1).transformDirection(e.object.matrix), Math.abs(e.object.up.dot(xt.direction)) < mi ? n.lookAt(e.target) : (rn.setFromNormalAndCoplanarPoint(e.object.up, e.target), xt.intersectPlane(rn, e.target))));
3063
3044
  } else
3064
- e.object.isOrthographicCamera && (Ae = f !== 1, Ae && (e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom / f)), e.object.updateProjectionMatrix()));
3065
- return f = 1, oe = !1, Ae || L.distanceToSquared(e.object.position) > p || 8 * (1 - K.dot(e.object.quaternion)) > p || de.distanceToSquared(e.target) > 0 ? (e.dispatchEvent(an), L.copy(e.object.position), K.copy(e.object.quaternion), de.copy(e.target), !0) : !1;
3045
+ e.object.isOrthographicCamera && (Pe = f !== 1, Pe && (e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom / f)), e.object.updateProjectionMatrix()));
3046
+ return f = 1, se = !1, Pe || L.distanceToSquared(e.object.position) > p || 8 * (1 - K.dot(e.object.quaternion)) > p || de.distanceToSquared(e.target) > 0 ? (e.dispatchEvent(nn), L.copy(e.object.position), K.copy(e.object.quaternion), de.copy(e.target), !0) : !1;
3066
3047
  };
3067
3048
  }(), this.dispose = function() {
3068
- e.domElement.removeEventListener("contextmenu", Ye), e.domElement.removeEventListener("pointerdown", Re), e.domElement.removeEventListener("pointercancel", _e), e.domElement.removeEventListener("wheel", bt), e.domElement.removeEventListener("pointermove", Je), e.domElement.removeEventListener("pointerup", _e), e._domElementKeyEvents !== null && (e._domElementKeyEvents.removeEventListener("keydown", et), e._domElementKeyEvents = null);
3049
+ e.domElement.removeEventListener("contextmenu", Ye), e.domElement.removeEventListener("pointerdown", _e), e.domElement.removeEventListener("pointercancel", Ae), e.domElement.removeEventListener("wheel", gt), e.domElement.removeEventListener("pointermove", Je), e.domElement.removeEventListener("pointerup", Ae), e._domElementKeyEvents !== null && (e._domElementKeyEvents.removeEventListener("keydown", et), e._domElementKeyEvents = null);
3069
3050
  };
3070
- const e = this, s = {
3051
+ const e = this, o = {
3071
3052
  NONE: -1,
3072
3053
  ROTATE: 0,
3073
3054
  DOLLY: 1,
@@ -3077,13 +3058,13 @@ class yi extends un {
3077
3058
  TOUCH_DOLLY_PAN: 5,
3078
3059
  TOUCH_DOLLY_ROTATE: 6
3079
3060
  };
3080
- let o = s.NONE;
3081
- const p = 1e-6, c = new Zt(), u = new Zt();
3061
+ let s = o.NONE;
3062
+ const p = 1e-6, c = new Xt(), u = new Xt();
3082
3063
  let f = 1;
3083
- const v = new X(), b = new ue(), E = new ue(), x = new ue(), M = new ue(), P = new ue(), W = new ue(), B = new ue(), S = new ue(), z = new ue(), Ce = new X(), le = new ue();
3084
- let oe = !1;
3064
+ const v = new X(), b = new ue(), E = new ue(), x = new ue(), M = new ue(), P = new ue(), H = new ue(), B = new ue(), w = new ue(), z = new ue(), Ce = new X(), le = new ue();
3065
+ let se = !1;
3085
3066
  const d = [], m = {};
3086
- let w = !1;
3067
+ let S = !1;
3087
3068
  function _(r) {
3088
3069
  return r !== null ? 2 * Math.PI / 60 * e.autoRotateSpeed * r : 2 * Math.PI / 60 / 60 * e.autoRotateSpeed;
3089
3070
  }
@@ -3102,7 +3083,7 @@ class yi extends un {
3102
3083
  return function(O, L) {
3103
3084
  r.setFromMatrixColumn(L, 0), r.multiplyScalar(-O), v.add(r);
3104
3085
  };
3105
- }(), H = function() {
3086
+ }(), W = function() {
3106
3087
  const r = new X();
3107
3088
  return function(O, L) {
3108
3089
  e.screenSpacePanning === !0 ? r.setFromMatrixColumn(L, 1) : (r.setFromMatrixColumn(L, 0), r.crossVectors(e.object.up, r)), r.multiplyScalar(O), v.add(r);
@@ -3114,10 +3095,10 @@ class yi extends un {
3114
3095
  if (e.object.isPerspectiveCamera) {
3115
3096
  const de = e.object.position;
3116
3097
  r.copy(de).sub(e.target);
3117
- let ae = r.length();
3118
- ae *= Math.tan(e.object.fov / 2 * Math.PI / 180), I(2 * O * ae / K.clientHeight, e.object.matrix), H(2 * L * ae / K.clientHeight, e.object.matrix);
3098
+ let ie = r.length();
3099
+ ie *= Math.tan(e.object.fov / 2 * Math.PI / 180), I(2 * O * ie / K.clientHeight, e.object.matrix), W(2 * L * ie / K.clientHeight, e.object.matrix);
3119
3100
  } else
3120
- e.object.isOrthographicCamera ? (I(O * (e.object.right - e.object.left) / e.object.zoom / K.clientWidth, e.object.matrix), H(L * (e.object.top - e.object.bottom) / e.object.zoom / K.clientHeight, e.object.matrix)) : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."), e.enablePan = !1);
3101
+ e.object.isOrthographicCamera ? (I(O * (e.object.right - e.object.left) / e.object.zoom / K.clientWidth, e.object.matrix), W(L * (e.object.top - e.object.bottom) / e.object.zoom / K.clientHeight, e.object.matrix)) : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."), e.enablePan = !1);
3121
3102
  };
3122
3103
  }();
3123
3104
  function T(r) {
@@ -3129,9 +3110,9 @@ class yi extends un {
3129
3110
  function J(r, y) {
3130
3111
  if (!e.zoomToCursor)
3131
3112
  return;
3132
- oe = !0;
3133
- const O = e.domElement.getBoundingClientRect(), L = r - O.left, K = y - O.top, de = O.width, ae = O.height;
3134
- le.x = L / de * 2 - 1, le.y = -(K / ae) * 2 + 1, Ce.set(le.x, le.y, 1).unproject(e.object).sub(e.object.position).normalize();
3113
+ se = !0;
3114
+ const O = e.domElement.getBoundingClientRect(), L = r - O.left, K = y - O.top, de = O.width, ie = O.height;
3115
+ le.x = L / de * 2 - 1, le.y = -(K / ie) * 2 + 1, Ce.set(le.x, le.y, 1).unproject(e.object).sub(e.object.position).normalize();
3135
3116
  }
3136
3117
  function me(r) {
3137
3118
  return Math.max(e.minDistance, Math.min(e.maxDistance, r));
@@ -3139,22 +3120,22 @@ class yi extends un {
3139
3120
  function xe(r) {
3140
3121
  b.set(r.clientX, r.clientY);
3141
3122
  }
3142
- function ht(r) {
3123
+ function dt(r) {
3143
3124
  J(r.clientX, r.clientX), B.set(r.clientX, r.clientY);
3144
3125
  }
3145
3126
  function Ke(r) {
3146
3127
  M.set(r.clientX, r.clientY);
3147
3128
  }
3148
- function At(r) {
3129
+ function _t(r) {
3149
3130
  E.set(r.clientX, r.clientY), x.subVectors(E, b).multiplyScalar(e.rotateSpeed);
3150
3131
  const y = e.domElement;
3151
3132
  U(2 * Math.PI * x.x / y.clientHeight), $(2 * Math.PI * x.y / y.clientHeight), b.copy(E), e.update();
3152
3133
  }
3153
- function Pt(r) {
3154
- S.set(r.clientX, r.clientY), z.subVectors(S, B), z.y > 0 ? T(Y(z.y)) : z.y < 0 && N(Y(z.y)), B.copy(S), e.update();
3134
+ function At(r) {
3135
+ w.set(r.clientX, r.clientY), z.subVectors(w, B), z.y > 0 ? T(Y(z.y)) : z.y < 0 && N(Y(z.y)), B.copy(w), e.update();
3155
3136
  }
3156
3137
  function Xe(r) {
3157
- P.set(r.clientX, r.clientY), W.subVectors(P, M).multiplyScalar(e.panSpeed), q(W.x, W.y), M.copy(P), e.update();
3138
+ P.set(r.clientX, r.clientY), H.subVectors(P, M).multiplyScalar(e.panSpeed), q(H.x, H.y), M.copy(P), e.update();
3158
3139
  }
3159
3140
  function Ze(r) {
3160
3141
  J(r.clientX, r.clientY), r.deltaY < 0 ? N(Y(r.deltaY)) : r.deltaY > 0 && T(Y(r.deltaY)), e.update();
@@ -3181,70 +3162,70 @@ class yi extends un {
3181
3162
  if (d.length === 1)
3182
3163
  b.set(r.pageX, r.pageY);
3183
3164
  else {
3184
- const y = we(r), O = 0.5 * (r.pageX + y.x), L = 0.5 * (r.pageY + y.y);
3165
+ const y = Se(r), O = 0.5 * (r.pageX + y.x), L = 0.5 * (r.pageY + y.y);
3185
3166
  b.set(O, L);
3186
3167
  }
3187
3168
  }
3188
- function Oe(r) {
3169
+ function Me(r) {
3189
3170
  if (d.length === 1)
3190
3171
  M.set(r.pageX, r.pageY);
3191
3172
  else {
3192
- const y = we(r), O = 0.5 * (r.pageX + y.x), L = 0.5 * (r.pageY + y.y);
3173
+ const y = Se(r), O = 0.5 * (r.pageX + y.x), L = 0.5 * (r.pageY + y.y);
3193
3174
  M.set(O, L);
3194
3175
  }
3195
3176
  }
3196
- function ft(r) {
3197
- const y = we(r), O = r.pageX - y.x, L = r.pageY - y.y, K = Math.sqrt(O * O + L * L);
3177
+ function ht(r) {
3178
+ const y = Se(r), O = r.pageX - y.x, L = r.pageY - y.y, K = Math.sqrt(O * O + L * L);
3198
3179
  B.set(0, K);
3199
3180
  }
3200
- function pt(r) {
3201
- e.enableZoom && ft(r), e.enablePan && Oe(r);
3181
+ function ft(r) {
3182
+ e.enableZoom && ht(r), e.enablePan && Me(r);
3202
3183
  }
3203
- function kt(r) {
3204
- e.enableZoom && ft(r), e.enableRotate && ze(r);
3184
+ function Pt(r) {
3185
+ e.enableZoom && ht(r), e.enableRotate && ze(r);
3205
3186
  }
3206
- function mt(r) {
3187
+ function pt(r) {
3207
3188
  if (d.length == 1)
3208
3189
  E.set(r.pageX, r.pageY);
3209
3190
  else {
3210
- const O = we(r), L = 0.5 * (r.pageX + O.x), K = 0.5 * (r.pageY + O.y);
3191
+ const O = Se(r), L = 0.5 * (r.pageX + O.x), K = 0.5 * (r.pageY + O.y);
3211
3192
  E.set(L, K);
3212
3193
  }
3213
3194
  x.subVectors(E, b).multiplyScalar(e.rotateSpeed);
3214
3195
  const y = e.domElement;
3215
3196
  U(2 * Math.PI * x.x / y.clientHeight), $(2 * Math.PI * x.y / y.clientHeight), b.copy(E);
3216
3197
  }
3217
- function Me(r) {
3198
+ function Te(r) {
3218
3199
  if (d.length === 1)
3219
3200
  P.set(r.pageX, r.pageY);
3220
3201
  else {
3221
- const y = we(r), O = 0.5 * (r.pageX + y.x), L = 0.5 * (r.pageY + y.y);
3202
+ const y = Se(r), O = 0.5 * (r.pageX + y.x), L = 0.5 * (r.pageY + y.y);
3222
3203
  P.set(O, L);
3223
3204
  }
3224
- W.subVectors(P, M).multiplyScalar(e.panSpeed), q(W.x, W.y), M.copy(P);
3205
+ H.subVectors(P, M).multiplyScalar(e.panSpeed), q(H.x, H.y), M.copy(P);
3225
3206
  }
3226
- function Te(r) {
3227
- const y = we(r), O = r.pageX - y.x, L = r.pageY - y.y, K = Math.sqrt(O * O + L * L);
3228
- S.set(0, K), z.set(0, Math.pow(S.y / B.y, e.zoomSpeed)), T(z.y), B.copy(S);
3229
- const de = (r.pageX + y.x) * 0.5, ae = (r.pageY + y.y) * 0.5;
3230
- J(de, ae);
3207
+ function Re(r) {
3208
+ const y = Se(r), O = r.pageX - y.x, L = r.pageY - y.y, K = Math.sqrt(O * O + L * L);
3209
+ w.set(0, K), z.set(0, Math.pow(w.y / B.y, e.zoomSpeed)), T(z.y), B.copy(w);
3210
+ const de = (r.pageX + y.x) * 0.5, ie = (r.pageY + y.y) * 0.5;
3211
+ J(de, ie);
3231
3212
  }
3232
- function vt(r) {
3233
- e.enableZoom && Te(r), e.enablePan && Me(r);
3213
+ function mt(r) {
3214
+ e.enableZoom && Re(r), e.enablePan && Te(r);
3234
3215
  }
3235
- function gt(r) {
3236
- e.enableZoom && Te(r), e.enableRotate && mt(r);
3216
+ function vt(r) {
3217
+ e.enableZoom && Re(r), e.enableRotate && pt(r);
3237
3218
  }
3238
- function Re(r) {
3239
- e.enabled !== !1 && (d.length === 0 && (e.domElement.setPointerCapture(r.pointerId), e.domElement.addEventListener("pointermove", Je), e.domElement.addEventListener("pointerup", _e)), Dt(r), r.pointerType === "touch" ? tt(r) : Qe(r));
3219
+ function _e(r) {
3220
+ e.enabled !== !1 && (d.length === 0 && (e.domElement.setPointerCapture(r.pointerId), e.domElement.addEventListener("pointermove", Je), e.domElement.addEventListener("pointerup", Ae)), jt(r), r.pointerType === "touch" ? tt(r) : Qe(r));
3240
3221
  }
3241
3222
  function Je(r) {
3242
- e.enabled !== !1 && (r.pointerType === "touch" ? Ct(r) : jt(r));
3223
+ e.enabled !== !1 && (r.pointerType === "touch" ? Et(r) : kt(r));
3243
3224
  }
3244
- function _e(r) {
3245
- switch (It(r), d.length) {
3225
+ function Ae(r) {
3226
+ switch (Dt(r), d.length) {
3246
3227
  case 0:
3247
- e.domElement.releasePointerCapture(r.pointerId), e.domElement.removeEventListener("pointermove", Je), e.domElement.removeEventListener("pointerup", _e), e.dispatchEvent(rn), o = s.NONE;
3228
+ e.domElement.releasePointerCapture(r.pointerId), e.domElement.removeEventListener("pointermove", Je), e.domElement.removeEventListener("pointerup", Ae), e.dispatchEvent(an), s = o.NONE;
3248
3229
  break;
3249
3230
  case 1:
3250
3231
  const y = d[0], O = m[y];
@@ -3271,58 +3252,58 @@ class yi extends un {
3271
3252
  case Ve.DOLLY:
3272
3253
  if (e.enableZoom === !1)
3273
3254
  return;
3274
- ht(r), o = s.DOLLY;
3255
+ dt(r), s = o.DOLLY;
3275
3256
  break;
3276
3257
  case Ve.ROTATE:
3277
3258
  if (r.ctrlKey || r.metaKey || r.shiftKey) {
3278
3259
  if (e.enablePan === !1)
3279
3260
  return;
3280
- Ke(r), o = s.PAN;
3261
+ Ke(r), s = o.PAN;
3281
3262
  } else {
3282
3263
  if (e.enableRotate === !1)
3283
3264
  return;
3284
- xe(r), o = s.ROTATE;
3265
+ xe(r), s = o.ROTATE;
3285
3266
  }
3286
3267
  break;
3287
3268
  case Ve.PAN:
3288
3269
  if (r.ctrlKey || r.metaKey || r.shiftKey) {
3289
3270
  if (e.enableRotate === !1)
3290
3271
  return;
3291
- xe(r), o = s.ROTATE;
3272
+ xe(r), s = o.ROTATE;
3292
3273
  } else {
3293
3274
  if (e.enablePan === !1)
3294
3275
  return;
3295
- Ke(r), o = s.PAN;
3276
+ Ke(r), s = o.PAN;
3296
3277
  }
3297
3278
  break;
3298
3279
  default:
3299
- o = s.NONE;
3280
+ s = o.NONE;
3300
3281
  }
3301
- o !== s.NONE && e.dispatchEvent($t);
3282
+ s !== o.NONE && e.dispatchEvent(Ut);
3302
3283
  }
3303
- function jt(r) {
3304
- switch (o) {
3305
- case s.ROTATE:
3284
+ function kt(r) {
3285
+ switch (s) {
3286
+ case o.ROTATE:
3306
3287
  if (e.enableRotate === !1)
3307
3288
  return;
3308
- At(r);
3289
+ _t(r);
3309
3290
  break;
3310
- case s.DOLLY:
3291
+ case o.DOLLY:
3311
3292
  if (e.enableZoom === !1)
3312
3293
  return;
3313
- Pt(r);
3294
+ At(r);
3314
3295
  break;
3315
- case s.PAN:
3296
+ case o.PAN:
3316
3297
  if (e.enablePan === !1)
3317
3298
  return;
3318
3299
  Xe(r);
3319
3300
  break;
3320
3301
  }
3321
3302
  }
3322
- function bt(r) {
3323
- e.enabled === !1 || e.enableZoom === !1 || o !== s.NONE || (r.preventDefault(), e.dispatchEvent($t), Ze(yt(r)), e.dispatchEvent(rn));
3303
+ function gt(r) {
3304
+ e.enabled === !1 || e.enableZoom === !1 || s !== o.NONE || (r.preventDefault(), e.dispatchEvent(Ut), Ze(bt(r)), e.dispatchEvent(an));
3324
3305
  }
3325
- function yt(r) {
3306
+ function bt(r) {
3326
3307
  const y = r.deltaMode, O = {
3327
3308
  clientX: r.clientX,
3328
3309
  clientY: r.clientY,
@@ -3336,89 +3317,89 @@ class yi extends un {
3336
3317
  O.deltaY *= 100;
3337
3318
  break;
3338
3319
  }
3339
- return r.ctrlKey && !w && (O.deltaY *= 10), O;
3320
+ return r.ctrlKey && !S && (O.deltaY *= 10), O;
3340
3321
  }
3341
- function Et(r) {
3342
- r.key === "Control" && (w = !0, e.domElement.getRootNode().addEventListener("keyup", Se, { passive: !0, capture: !0 }));
3322
+ function yt(r) {
3323
+ r.key === "Control" && (S = !0, e.domElement.getRootNode().addEventListener("keyup", we, { passive: !0, capture: !0 }));
3343
3324
  }
3344
- function Se(r) {
3345
- r.key === "Control" && (w = !1, e.domElement.getRootNode().removeEventListener("keyup", Se, { passive: !0, capture: !0 }));
3325
+ function we(r) {
3326
+ r.key === "Control" && (S = !1, e.domElement.getRootNode().removeEventListener("keyup", we, { passive: !0, capture: !0 }));
3346
3327
  }
3347
3328
  function et(r) {
3348
3329
  e.enabled === !1 || e.enablePan === !1 || $e(r);
3349
3330
  }
3350
3331
  function tt(r) {
3351
- switch (xt(r), d.length) {
3332
+ switch (Ct(r), d.length) {
3352
3333
  case 1:
3353
3334
  switch (e.touches.ONE) {
3354
- case We.ROTATE:
3335
+ case He.ROTATE:
3355
3336
  if (e.enableRotate === !1)
3356
3337
  return;
3357
- ze(r), o = s.TOUCH_ROTATE;
3338
+ ze(r), s = o.TOUCH_ROTATE;
3358
3339
  break;
3359
- case We.PAN:
3340
+ case He.PAN:
3360
3341
  if (e.enablePan === !1)
3361
3342
  return;
3362
- Oe(r), o = s.TOUCH_PAN;
3343
+ Me(r), s = o.TOUCH_PAN;
3363
3344
  break;
3364
3345
  default:
3365
- o = s.NONE;
3346
+ s = o.NONE;
3366
3347
  }
3367
3348
  break;
3368
3349
  case 2:
3369
3350
  switch (e.touches.TWO) {
3370
- case We.DOLLY_PAN:
3351
+ case He.DOLLY_PAN:
3371
3352
  if (e.enableZoom === !1 && e.enablePan === !1)
3372
3353
  return;
3373
- pt(r), o = s.TOUCH_DOLLY_PAN;
3354
+ ft(r), s = o.TOUCH_DOLLY_PAN;
3374
3355
  break;
3375
- case We.DOLLY_ROTATE:
3356
+ case He.DOLLY_ROTATE:
3376
3357
  if (e.enableZoom === !1 && e.enableRotate === !1)
3377
3358
  return;
3378
- kt(r), o = s.TOUCH_DOLLY_ROTATE;
3359
+ Pt(r), s = o.TOUCH_DOLLY_ROTATE;
3379
3360
  break;
3380
3361
  default:
3381
- o = s.NONE;
3362
+ s = o.NONE;
3382
3363
  }
3383
3364
  break;
3384
3365
  default:
3385
- o = s.NONE;
3366
+ s = o.NONE;
3386
3367
  }
3387
- o !== s.NONE && e.dispatchEvent($t);
3368
+ s !== o.NONE && e.dispatchEvent(Ut);
3388
3369
  }
3389
- function Ct(r) {
3390
- switch (xt(r), o) {
3391
- case s.TOUCH_ROTATE:
3370
+ function Et(r) {
3371
+ switch (Ct(r), s) {
3372
+ case o.TOUCH_ROTATE:
3392
3373
  if (e.enableRotate === !1)
3393
3374
  return;
3394
- mt(r), e.update();
3375
+ pt(r), e.update();
3395
3376
  break;
3396
- case s.TOUCH_PAN:
3377
+ case o.TOUCH_PAN:
3397
3378
  if (e.enablePan === !1)
3398
3379
  return;
3399
- Me(r), e.update();
3380
+ Te(r), e.update();
3400
3381
  break;
3401
- case s.TOUCH_DOLLY_PAN:
3382
+ case o.TOUCH_DOLLY_PAN:
3402
3383
  if (e.enableZoom === !1 && e.enablePan === !1)
3403
3384
  return;
3404
- vt(r), e.update();
3385
+ mt(r), e.update();
3405
3386
  break;
3406
- case s.TOUCH_DOLLY_ROTATE:
3387
+ case o.TOUCH_DOLLY_ROTATE:
3407
3388
  if (e.enableZoom === !1 && e.enableRotate === !1)
3408
3389
  return;
3409
- gt(r), e.update();
3390
+ vt(r), e.update();
3410
3391
  break;
3411
3392
  default:
3412
- o = s.NONE;
3393
+ s = o.NONE;
3413
3394
  }
3414
3395
  }
3415
3396
  function Ye(r) {
3416
3397
  e.enabled !== !1 && r.preventDefault();
3417
3398
  }
3418
- function Dt(r) {
3399
+ function jt(r) {
3419
3400
  d.push(r.pointerId);
3420
3401
  }
3421
- function It(r) {
3402
+ function Dt(r) {
3422
3403
  delete m[r.pointerId];
3423
3404
  for (let y = 0; y < d.length; y++)
3424
3405
  if (d[y] == r.pointerId) {
@@ -3426,42 +3407,42 @@ class yi extends un {
3426
3407
  return;
3427
3408
  }
3428
3409
  }
3429
- function xt(r) {
3410
+ function Ct(r) {
3430
3411
  let y = m[r.pointerId];
3431
3412
  y === void 0 && (y = new ue(), m[r.pointerId] = y), y.set(r.pageX, r.pageY);
3432
3413
  }
3433
- function we(r) {
3414
+ function Se(r) {
3434
3415
  const y = r.pointerId === d[0] ? d[1] : d[0];
3435
3416
  return m[y];
3436
3417
  }
3437
- e.domElement.addEventListener("contextmenu", Ye), e.domElement.addEventListener("pointerdown", Re), e.domElement.addEventListener("pointercancel", _e), e.domElement.addEventListener("wheel", bt, { passive: !1 }), e.domElement.getRootNode().addEventListener("keydown", Et, { passive: !0, capture: !0 }), this.update();
3418
+ e.domElement.addEventListener("contextmenu", Ye), e.domElement.addEventListener("pointerdown", _e), e.domElement.addEventListener("pointercancel", Ae), e.domElement.addEventListener("wheel", gt, { passive: !1 }), e.domElement.getRootNode().addEventListener("keydown", yt, { passive: !0, capture: !0 }), this.update();
3438
3419
  }
3439
3420
  }
3440
- const Mt = (t) => {
3441
- const [n, a] = se(t.options[t.index]), e = () => {
3421
+ const Ot = (t) => {
3422
+ const [n, a] = ae(t.options[t.index]), e = () => {
3442
3423
  t.onToggle(!t.open);
3443
- }, s = (o) => {
3444
- o !== n && (t.onSelect(o), a(o)), t.onToggle(!1);
3424
+ }, o = (s) => {
3425
+ s !== n && (t.onSelect(s), a(s)), t.onToggle(!1);
3445
3426
  };
3446
3427
  return /* @__PURE__ */ l.jsxs("div", { className: `dropdown ${t.up === !0 ? "up" : ""}`, children: [
3447
3428
  /* @__PURE__ */ l.jsx("div", { className: "dropdown-toggle", onClick: e, children: n }),
3448
- t.open && /* @__PURE__ */ l.jsx("ul", { className: "dropdown-menu", children: t.options.map((o) => /* @__PURE__ */ l.jsx("li", { onClick: () => s(o), children: o }, o)) })
3429
+ t.open && /* @__PURE__ */ l.jsx("ul", { className: "dropdown-menu", children: t.options.map((s) => /* @__PURE__ */ l.jsx("li", { onClick: () => o(s), children: s }, s)) })
3449
3430
  ] });
3450
- }, Ie = Ta(function(n, a) {
3451
- const [e, s] = se(!1), o = n.options.indexOf(n.camera.name);
3431
+ }, Le = Sa(function(n, a) {
3432
+ const [e, o] = ae(!1), s = n.options.indexOf(n.camera.name);
3452
3433
  return /* @__PURE__ */ l.jsxs("div", { className: "CameraWindow", children: [
3453
3434
  /* @__PURE__ */ l.jsx("div", { ref: a, className: "clickable", onClick: () => {
3454
- e && s(!1);
3435
+ e && o(!1);
3455
3436
  } }),
3456
3437
  /* @__PURE__ */ l.jsx(
3457
- Mt,
3438
+ Ot,
3458
3439
  {
3459
- index: o,
3440
+ index: s,
3460
3441
  open: e,
3461
3442
  options: n.options,
3462
3443
  onSelect: n.onSelect,
3463
3444
  onToggle: (p) => {
3464
- s(p);
3445
+ o(p);
3465
3446
  },
3466
3447
  up: !0
3467
3448
  }
@@ -3472,9 +3453,9 @@ const Mt = (t) => {
3472
3453
  "Side by Side",
3473
3454
  "Stacked",
3474
3455
  "Quad"
3475
- ], ne = /* @__PURE__ */ new Map(), ie = /* @__PURE__ */ new Map(), be = /* @__PURE__ */ new Map();
3456
+ ], ne = /* @__PURE__ */ new Map(), re = /* @__PURE__ */ new Map(), be = /* @__PURE__ */ new Map();
3476
3457
  function Ue(t, n) {
3477
- const a = new Rn(-100, 100, 100, -100, 50, 3e3);
3458
+ const a = new Tn(-100, 100, 100, -100, 50, 3e3);
3478
3459
  return a.name = t, a.position.copy(n), a.lookAt(0, 0, 0), ne.set(t, a), a;
3479
3460
  }
3480
3461
  Ue("Top", new X(0, 1e3, 0));
@@ -3484,47 +3465,47 @@ Ue("Right", new X(1e3, 0, 0));
3484
3465
  Ue("Front", new X(0, 0, 1e3));
3485
3466
  Ue("Back", new X(0, 0, -1e3));
3486
3467
  Ue("Orthographic", new X(1e3, 1e3, 1e3));
3487
- const _t = new zt(60, 1, 50, 3e3);
3488
- _t.name = "Debug";
3489
- _t.position.set(500, 500, 500);
3490
- _t.lookAt(0, 0, 0);
3491
- ne.set("Debug", _t);
3492
- const cn = [
3468
+ const Rt = new $t(60, 1, 50, 3e3);
3469
+ Rt.name = "Debug";
3470
+ Rt.position.set(500, 500, 500);
3471
+ Rt.lookAt(0, 0, 0);
3472
+ ne.set("Debug", Rt);
3473
+ const sn = [
3493
3474
  "Renderer",
3494
3475
  "Depth",
3495
3476
  "Normals",
3496
3477
  "UVs",
3497
3478
  "Wireframe"
3498
- ], Ei = new ma(), Ci = new va(), xi = new Za(), Si = new ga({
3479
+ ], gi = new ma(), bi = new va(), yi = new qa(), Ei = new ga({
3499
3480
  opacity: 0.33,
3500
3481
  transparent: !0,
3501
3482
  wireframe: !0
3502
3483
  });
3503
3484
  let wt = "Renderer";
3504
- const V = new _n();
3485
+ const V = new Rn();
3505
3486
  V.name = "Debug Scene";
3506
- let ye = new _n();
3487
+ let ye = new Rn();
3507
3488
  V.add(ye);
3508
- const dt = new ba();
3509
- dt.name = "helpers";
3510
- V.add(dt);
3511
- const wi = new qa();
3512
- dt.add(wi);
3513
- const Un = new An(500);
3489
+ const ut = new ba();
3490
+ ut.name = "helpers";
3491
+ V.add(ut);
3492
+ const Ci = new Va();
3493
+ ut.add(Ci);
3494
+ const Un = new _n(500);
3514
3495
  Un.name = "axisHelper";
3515
- dt.add(Un);
3516
- const ut = new An(100);
3517
- ut.name = "interactionHelper";
3518
- dt.add(ut);
3519
- ut.visible = !1;
3520
- let Ot = !1, G = ne.get("Debug"), re = ne.get("Orthographic"), Le = ne.get("Front"), Ne = ne.get("Top"), ln = !1;
3521
- function $i(t) {
3522
- const [n, a] = se(t.mode !== void 0 ? t.mode : "Single"), [e, s] = se(null), [o, p] = se(!1), [c, u] = se(!1), [f, v] = se(!1), [, b] = se(Date.now()), E = Ee(null), x = Ee(null), M = Ee(null), P = Ee(null), W = Ee(null), B = Ee(null), S = (d, m) => {
3523
- const w = ie.get(d.name);
3524
- w !== void 0 && w.dispose(), ie.delete(d.name);
3496
+ ut.add(Un);
3497
+ const lt = new _n(100);
3498
+ lt.name = "interactionHelper";
3499
+ ut.add(lt);
3500
+ lt.visible = !1;
3501
+ let St = !1, G = ne.get("Debug"), oe = ne.get("Orthographic"), Ne = ne.get("Front"), Fe = ne.get("Top"), cn = !1;
3502
+ function Ni(t) {
3503
+ const [n, a] = ae(t.mode !== void 0 ? t.mode : "Single"), [e, o] = ae(null), [s, p] = ae(!1), [c, u] = ae(!1), [f, v] = ae(!1), [, b] = ae(Date.now()), E = Ee(null), x = Ee(null), M = Ee(null), P = Ee(null), H = Ee(null), B = Ee(null), w = (d, m) => {
3504
+ const S = re.get(d.name);
3505
+ S !== void 0 && S.dispose(), re.delete(d.name);
3525
3506
  const _ = be.get(d.name);
3526
3507
  _ !== void 0 && (V.remove(_), _.dispose()), be.delete(d.name);
3527
- const Y = new yi(d, m);
3508
+ const Y = new vi(d, m);
3528
3509
  switch (Y.enableDamping = !0, Y.dampingFactor = 0.05, d.name) {
3529
3510
  case "Top":
3530
3511
  case "Bottom":
@@ -3535,95 +3516,95 @@ function $i(t) {
3535
3516
  Y.enableRotate = !1;
3536
3517
  break;
3537
3518
  }
3538
- if (ie.set(d.name, Y), d instanceof zt) {
3519
+ if (re.set(d.name, Y), d instanceof $t) {
3539
3520
  const U = new Ca(d);
3540
3521
  be.set(d.name, U), V.add(U);
3541
3522
  }
3542
3523
  }, z = (d) => {
3543
3524
  const m = be.get(d.name);
3544
3525
  m !== void 0 && (V.remove(m), m.dispose(), be.delete(d.name));
3545
- const w = ie.get(d.name);
3546
- w !== void 0 && (w.dispose(), ie.delete(d.name));
3526
+ const S = re.get(d.name);
3527
+ S !== void 0 && (S.dispose(), re.delete(d.name));
3547
3528
  }, Ce = () => {
3548
- ie.forEach((d, m) => {
3529
+ re.forEach((d, m) => {
3549
3530
  d.dispose();
3550
- const w = be.get(m);
3551
- w !== void 0 && (V.remove(w), w.dispose()), be.delete(m), ie.delete(m);
3552
- }), ie.clear(), be.clear();
3531
+ const S = be.get(m);
3532
+ S !== void 0 && (V.remove(S), S.dispose()), be.delete(m), re.delete(m);
3533
+ }), re.clear(), be.clear();
3553
3534
  }, le = () => {
3554
3535
  switch (n) {
3555
3536
  case "Single":
3556
- S(G, M.current);
3537
+ w(G, M.current);
3557
3538
  break;
3558
3539
  case "Side by Side":
3559
3540
  case "Stacked":
3560
- S(G, M.current), S(re, P.current);
3541
+ w(G, M.current), w(oe, P.current);
3561
3542
  break;
3562
3543
  case "Quad":
3563
- S(G, M.current), S(re, P.current), S(Le, W.current), S(Ne, B.current);
3544
+ w(G, M.current), w(oe, P.current), w(Ne, H.current), w(Fe, B.current);
3564
3545
  break;
3565
3546
  }
3566
3547
  };
3567
- Fe(() => {
3548
+ Oe(() => {
3568
3549
  const d = new ya({
3569
3550
  canvas: E.current,
3570
3551
  stencil: !1
3571
3552
  });
3572
- d.autoClear = !1, d.shadowMap.enabled = !0, d.setPixelRatio(devicePixelRatio), d.setClearColor(0), s(d);
3573
- }, []), Fe(() => {
3553
+ d.autoClear = !1, d.shadowMap.enabled = !0, d.setPixelRatio(devicePixelRatio), d.setClearColor(0), o(d);
3554
+ }, []), Oe(() => {
3574
3555
  const d = (_) => {
3575
- Dn(ye), V.remove(ye);
3556
+ jn(ye), V.remove(ye);
3576
3557
  const Y = t.scenes.get(_.value.name);
3577
3558
  if (Y !== void 0) {
3578
3559
  const U = new Y();
3579
- t.onSceneSet !== void 0 && t.onSceneSet(U), ye = U, t.three.scene = ye, V.add(ye), ln = !0;
3560
+ t.onSceneSet !== void 0 && t.onSceneSet(U), ye = U, t.three.scene = ye, V.add(ye), cn = !0;
3580
3561
  }
3581
3562
  }, m = (_) => {
3582
3563
  const Y = _.value, U = t.three.scene?.getObjectByProperty("uuid", Y.uuid);
3583
3564
  U !== void 0 && ne.set(Y.name, U), b(Date.now());
3584
- }, w = (_) => {
3565
+ }, S = (_) => {
3585
3566
  ne.delete(_.value.name), b(Date.now());
3586
3567
  };
3587
- return k.addEventListener(j.SET_SCENE, d), k.addEventListener(j.ADD_CAMERA, m), k.addEventListener(j.REMOVE_CAMERA, w), () => {
3588
- k.removeEventListener(j.SET_SCENE, d), k.removeEventListener(j.ADD_CAMERA, m), k.removeEventListener(j.REMOVE_CAMERA, w);
3568
+ return k.addEventListener(j.SET_SCENE, d), k.addEventListener(j.ADD_CAMERA, m), k.addEventListener(j.REMOVE_CAMERA, S), () => {
3569
+ k.removeEventListener(j.SET_SCENE, d), k.removeEventListener(j.ADD_CAMERA, m), k.removeEventListener(j.REMOVE_CAMERA, S);
3589
3570
  };
3590
- }, []), Fe(() => {
3571
+ }, []), Oe(() => {
3591
3572
  if (e === null)
3592
3573
  return;
3593
- let d = window.innerWidth, m = window.innerHeight, w = Math.floor(d / 2), _ = Math.floor(m / 2), Y = -1;
3574
+ let d = window.innerWidth, m = window.innerHeight, S = Math.floor(d / 2), _ = Math.floor(m / 2), Y = -1;
3594
3575
  const U = () => {
3595
- d = window.innerWidth - 300, m = window.innerHeight, w = Math.floor(d / 2), _ = Math.floor(m / 2), e.setSize(d, m);
3576
+ d = window.innerWidth - 300, m = window.innerHeight, S = Math.floor(d / 2), _ = Math.floor(m / 2), e.setSize(d, m);
3596
3577
  let T = d, N = m;
3597
3578
  switch (n) {
3598
3579
  case "Side by Side":
3599
- T = w, N = m;
3580
+ T = S, N = m;
3600
3581
  break;
3601
3582
  case "Stacked":
3602
3583
  T = d, N = _;
3603
3584
  break;
3604
3585
  case "Quad":
3605
- T = w, N = _;
3586
+ T = S, N = _;
3606
3587
  break;
3607
3588
  }
3608
3589
  ne.forEach((J) => {
3609
- J instanceof Rn ? (J.left = T / -2, J.right = T / 2, J.top = N / 2, J.bottom = N / -2, J.updateProjectionMatrix()) : J instanceof zt && (J.aspect = T / N, J.updateProjectionMatrix(), be.get(J.name)?.update());
3590
+ J instanceof Tn ? (J.left = T / -2, J.right = T / 2, J.top = N / 2, J.bottom = N / -2, J.updateProjectionMatrix()) : J instanceof $t && (J.aspect = T / N, J.updateProjectionMatrix(), be.get(J.name)?.update());
3610
3591
  });
3611
3592
  }, $ = () => {
3612
3593
  e.setViewport(0, 0, d, m), e.setScissor(0, 0, d, m), e.render(V, G);
3613
3594
  }, I = () => {
3614
3595
  if (n === "Side by Side")
3615
- e.setViewport(0, 0, w, m), e.setScissor(0, 0, w, m), e.render(V, G), e.setViewport(w, 0, w, m), e.setScissor(w, 0, w, m), e.render(V, re);
3596
+ e.setViewport(0, 0, S, m), e.setScissor(0, 0, S, m), e.render(V, G), e.setViewport(S, 0, S, m), e.setScissor(S, 0, S, m), e.render(V, oe);
3616
3597
  else {
3617
3598
  const T = m - _;
3618
- e.setViewport(0, T, d, _), e.setScissor(0, T, d, _), e.render(V, G), e.setViewport(0, 0, d, _), e.setScissor(0, 0, d, _), e.render(V, re);
3599
+ e.setViewport(0, T, d, _), e.setScissor(0, T, d, _), e.render(V, G), e.setViewport(0, 0, d, _), e.setScissor(0, 0, d, _), e.render(V, oe);
3619
3600
  }
3620
- }, H = () => {
3601
+ }, W = () => {
3621
3602
  let T = 0, N = 0;
3622
- N = m - _, T = 0, e.setViewport(T, N, w, _), e.setScissor(T, N, w, _), e.render(V, G), T = w, e.setViewport(T, N, w, _), e.setScissor(T, N, w, _), e.render(V, re), N = 0, T = 0, e.setViewport(T, N, w, _), e.setScissor(T, N, w, _), e.render(V, Le), T = w, e.setViewport(T, N, w, _), e.setScissor(T, N, w, _), e.render(V, Ne);
3603
+ N = m - _, T = 0, e.setViewport(T, N, S, _), e.setScissor(T, N, S, _), e.render(V, G), T = S, e.setViewport(T, N, S, _), e.setScissor(T, N, S, _), e.render(V, oe), N = 0, T = 0, e.setViewport(T, N, S, _), e.setScissor(T, N, S, _), e.render(V, Ne), T = S, e.setViewport(T, N, S, _), e.setScissor(T, N, S, _), e.render(V, Fe);
3623
3604
  }, q = () => {
3624
- switch (ie.forEach((T) => {
3605
+ switch (re.forEach((T) => {
3625
3606
  T.update();
3626
- }), t.onSceneUpdate !== void 0 && ln && t.onSceneUpdate(ye), e.clear(), n) {
3607
+ }), t.onSceneUpdate !== void 0 && cn && t.onSceneUpdate(ye), e.clear(), n) {
3627
3608
  case "Single":
3628
3609
  $();
3629
3610
  break;
@@ -3632,7 +3613,7 @@ function $i(t) {
3632
3613
  I();
3633
3614
  break;
3634
3615
  case "Quad":
3635
- H();
3616
+ W();
3636
3617
  break;
3637
3618
  }
3638
3619
  Y = requestAnimationFrame(q);
@@ -3640,32 +3621,32 @@ function $i(t) {
3640
3621
  return le(), window.addEventListener("resize", U), U(), q(), () => {
3641
3622
  window.removeEventListener("resize", U), cancelAnimationFrame(Y), Y = -1;
3642
3623
  };
3643
- }, [n, e]), Fe(() => {
3624
+ }, [n, e]), Oe(() => {
3644
3625
  if (e !== null) {
3645
- const d = new Ea(), m = new ue(), w = ($, I, H, q) => {
3626
+ const d = new Ea(), m = new ue(), S = ($, I, W, q) => {
3646
3627
  switch (n) {
3647
3628
  case "Quad":
3648
- $ < H ? I < q ? d.setFromCamera(m, G) : d.setFromCamera(m, Le) : I < q ? d.setFromCamera(m, re) : d.setFromCamera(m, Ne);
3629
+ $ < W ? I < q ? d.setFromCamera(m, G) : d.setFromCamera(m, Ne) : I < q ? d.setFromCamera(m, oe) : d.setFromCamera(m, Fe);
3649
3630
  break;
3650
3631
  case "Side by Side":
3651
- $ < H ? d.setFromCamera(m, G) : d.setFromCamera(m, re);
3632
+ $ < W ? d.setFromCamera(m, G) : d.setFromCamera(m, oe);
3652
3633
  break;
3653
3634
  case "Single":
3654
3635
  d.setFromCamera(m, G);
3655
3636
  break;
3656
3637
  case "Stacked":
3657
- I < q ? d.setFromCamera(m, G) : d.setFromCamera(m, re);
3638
+ I < q ? d.setFromCamera(m, G) : d.setFromCamera(m, oe);
3658
3639
  break;
3659
3640
  }
3660
3641
  }, _ = ($) => {
3661
- if (!Ot)
3642
+ if (!St)
3662
3643
  return;
3663
3644
  const I = new ue();
3664
3645
  e.getSize(I);
3665
- const H = Math.min($.clientX, I.x), q = Math.min($.clientY, I.y);
3666
- m.x = qe(H, 0, I.x, -1, 1), m.y = qe(q, 0, I.y, 1, -1);
3646
+ const W = Math.min($.clientX, I.x), q = Math.min($.clientY, I.y);
3647
+ m.x = qe(W, 0, I.x, -1, 1), m.y = qe(q, 0, I.y, 1, -1);
3667
3648
  const T = I.x / 2, N = I.y / 2, J = () => {
3668
- H < T ? m.x = qe(H, 0, T, -1, 1) : m.x = qe(H, T, I.x, -1, 1);
3649
+ W < T ? m.x = qe(W, 0, T, -1, 1) : m.x = qe(W, T, I.x, -1, 1);
3669
3650
  }, me = () => {
3670
3651
  q < N ? m.y = qe(q, 0, N, 1, -1) : m.y = qe(q, N, I.y, 1, -1);
3671
3652
  };
@@ -3680,119 +3661,119 @@ function $i(t) {
3680
3661
  me(), me();
3681
3662
  break;
3682
3663
  }
3683
- w(H, q, T, N);
3664
+ S(W, q, T, N);
3684
3665
  const xe = d.intersectObjects(ye.children);
3685
- xe.length > 0 && ut.position.copy(xe[0].point);
3666
+ xe.length > 0 && lt.position.copy(xe[0].point);
3686
3667
  }, Y = ($) => {
3687
- if (!Ot)
3668
+ if (!St)
3688
3669
  return;
3689
3670
  const I = new ue();
3690
3671
  if (e.getSize(I), $.clientX >= I.x)
3691
3672
  return;
3692
3673
  _($);
3693
- const H = d.intersectObjects(ye.children);
3694
- H.length > 0 && t.three.getObject(H[0].object.uuid);
3674
+ const W = d.intersectObjects(ye.children);
3675
+ W.length > 0 && t.three.getObject(W[0].object.uuid);
3695
3676
  }, U = x.current;
3696
3677
  return U.addEventListener("mousemove", _, !1), U.addEventListener("click", Y, !1), () => {
3697
3678
  U.removeEventListener("mousemove", _), U.removeEventListener("click", Y);
3698
3679
  };
3699
3680
  }
3700
3681
  }, [n, e]);
3701
- const oe = [];
3682
+ const se = [];
3702
3683
  return ne.forEach((d, m) => {
3703
- oe.push(m);
3684
+ se.push(m);
3704
3685
  }), /* @__PURE__ */ l.jsxs("div", { className: "multiview", children: [
3705
3686
  /* @__PURE__ */ l.jsx("canvas", { ref: E }),
3706
3687
  /* @__PURE__ */ l.jsxs("div", { className: `cameras ${n === "Single" || n === "Stacked" ? "single" : ""}`, ref: x, children: [
3707
- n === "Single" && /* @__PURE__ */ l.jsx(l.Fragment, { children: /* @__PURE__ */ l.jsx(Ie, { camera: G, options: oe, ref: M, onSelect: (d) => {
3708
- ie.get(G.name)?.dispose();
3688
+ n === "Single" && /* @__PURE__ */ l.jsx(l.Fragment, { children: /* @__PURE__ */ l.jsx(Le, { camera: G, options: se, ref: M, onSelect: (d) => {
3689
+ re.get(G.name)?.dispose();
3709
3690
  const m = ne.get(d);
3710
- m !== void 0 && (z(G), G = m, S(m, M.current));
3691
+ m !== void 0 && (z(G), G = m, w(m, M.current));
3711
3692
  } }) }),
3712
3693
  (n === "Side by Side" || n === "Stacked") && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
3713
- /* @__PURE__ */ l.jsx(Ie, { camera: G, options: oe, ref: M, onSelect: (d) => {
3714
- ie.get(G.name)?.dispose();
3694
+ /* @__PURE__ */ l.jsx(Le, { camera: G, options: se, ref: M, onSelect: (d) => {
3695
+ re.get(G.name)?.dispose();
3715
3696
  const m = ne.get(d);
3716
- m !== void 0 && (z(G), G = m, S(m, M.current));
3697
+ m !== void 0 && (z(G), G = m, w(m, M.current));
3717
3698
  } }),
3718
- /* @__PURE__ */ l.jsx(Ie, { camera: re, options: oe, ref: P, onSelect: (d) => {
3719
- ie.get(re.name)?.dispose();
3699
+ /* @__PURE__ */ l.jsx(Le, { camera: oe, options: se, ref: P, onSelect: (d) => {
3700
+ re.get(oe.name)?.dispose();
3720
3701
  const m = ne.get(d);
3721
- m !== void 0 && (z(re), re = m, S(m, P.current));
3702
+ m !== void 0 && (z(oe), oe = m, w(m, P.current));
3722
3703
  } })
3723
3704
  ] }),
3724
3705
  n === "Quad" && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
3725
- /* @__PURE__ */ l.jsx(Ie, { camera: G, options: oe, ref: M, onSelect: (d) => {
3726
- ie.get(G.name)?.dispose();
3706
+ /* @__PURE__ */ l.jsx(Le, { camera: G, options: se, ref: M, onSelect: (d) => {
3707
+ re.get(G.name)?.dispose();
3727
3708
  const m = ne.get(d);
3728
- m !== void 0 && (z(G), G = m, S(m, M.current));
3709
+ m !== void 0 && (z(G), G = m, w(m, M.current));
3729
3710
  } }),
3730
- /* @__PURE__ */ l.jsx(Ie, { camera: re, options: oe, ref: P, onSelect: (d) => {
3731
- ie.get(re.name)?.dispose();
3711
+ /* @__PURE__ */ l.jsx(Le, { camera: oe, options: se, ref: P, onSelect: (d) => {
3712
+ re.get(oe.name)?.dispose();
3732
3713
  const m = ne.get(d);
3733
- m !== void 0 && (z(re), re = m, S(m, P.current));
3714
+ m !== void 0 && (z(oe), oe = m, w(m, P.current));
3734
3715
  } }),
3735
- /* @__PURE__ */ l.jsx(Ie, { camera: Le, options: oe, ref: W, onSelect: (d) => {
3736
- ie.get(Le.name)?.dispose();
3716
+ /* @__PURE__ */ l.jsx(Le, { camera: Ne, options: se, ref: H, onSelect: (d) => {
3717
+ re.get(Ne.name)?.dispose();
3737
3718
  const m = ne.get(d);
3738
- m !== void 0 && (z(Le), Le = m, S(m, W.current));
3719
+ m !== void 0 && (z(Ne), Ne = m, w(m, H.current));
3739
3720
  } }),
3740
- /* @__PURE__ */ l.jsx(Ie, { camera: Ne, options: oe, ref: B, onSelect: (d) => {
3741
- ie.get(Ne.name)?.dispose();
3721
+ /* @__PURE__ */ l.jsx(Le, { camera: Fe, options: se, ref: B, onSelect: (d) => {
3722
+ re.get(Fe.name)?.dispose();
3742
3723
  const m = ne.get(d);
3743
- m !== void 0 && (z(Ne), Ne = m, S(m, B.current));
3724
+ m !== void 0 && (z(Fe), Fe = m, w(m, B.current));
3744
3725
  } })
3745
3726
  ] })
3746
3727
  ] }),
3747
3728
  /* @__PURE__ */ l.jsxs("div", { className: "settings", children: [
3748
3729
  /* @__PURE__ */ l.jsx(
3749
- Mt,
3730
+ Ot,
3750
3731
  {
3751
3732
  index: on.indexOf(n),
3752
3733
  options: on,
3753
3734
  onSelect: (d) => {
3754
3735
  d !== n && (Ce(), a(d));
3755
3736
  },
3756
- open: o,
3737
+ open: s,
3757
3738
  onToggle: (d) => {
3758
3739
  p(d), c && u(!1), f && v(!1);
3759
3740
  }
3760
3741
  }
3761
3742
  ),
3762
3743
  /* @__PURE__ */ l.jsx(
3763
- Mt,
3744
+ Ot,
3764
3745
  {
3765
- index: cn.indexOf(wt),
3766
- options: cn,
3746
+ index: sn.indexOf(wt),
3747
+ options: sn,
3767
3748
  onSelect: (d) => {
3768
3749
  if (d !== wt)
3769
3750
  switch (wt = d, wt) {
3770
3751
  case "Depth":
3771
- V.overrideMaterial = Ei;
3752
+ V.overrideMaterial = gi;
3772
3753
  break;
3773
3754
  case "Normals":
3774
- V.overrideMaterial = Ci;
3755
+ V.overrideMaterial = bi;
3775
3756
  break;
3776
3757
  default:
3777
3758
  case "Renderer":
3778
3759
  V.overrideMaterial = null;
3779
3760
  break;
3780
3761
  case "Wireframe":
3781
- V.overrideMaterial = Si;
3762
+ V.overrideMaterial = Ei;
3782
3763
  break;
3783
3764
  case "UVs":
3784
- V.overrideMaterial = xi;
3765
+ V.overrideMaterial = yi;
3785
3766
  break;
3786
3767
  }
3787
3768
  },
3788
3769
  open: c,
3789
3770
  onToggle: (d) => {
3790
- o && p(!1), u(d), f && v(!1);
3771
+ s && p(!1), u(d), f && v(!1);
3791
3772
  }
3792
3773
  }
3793
3774
  ),
3794
3775
  /* @__PURE__ */ l.jsx(
3795
- Mt,
3776
+ Ot,
3796
3777
  {
3797
3778
  index: 0,
3798
3779
  options: [
@@ -3800,18 +3781,18 @@ function $i(t) {
3800
3781
  "Selection Mode"
3801
3782
  ],
3802
3783
  onSelect: (d) => {
3803
- Ot = d === "Selection Mode", ut.visible = Ot;
3784
+ St = d === "Selection Mode", lt.visible = St;
3804
3785
  },
3805
3786
  open: f,
3806
3787
  onToggle: (d) => {
3807
- o && p(!1), c && u(!1), v(d);
3788
+ s && p(!1), c && u(!1), v(d);
3808
3789
  }
3809
3790
  }
3810
3791
  )
3811
3792
  ] })
3812
3793
  ] });
3813
3794
  }
3814
- function zi(t) {
3795
+ function Fi(t) {
3815
3796
  return /* @__PURE__ */ l.jsxs("div", { className: "editor", ref: t.ref, style: t.style, children: [
3816
3797
  /* @__PURE__ */ l.jsx("header", { children: t.header }),
3817
3798
  t.children,
@@ -3819,41 +3800,41 @@ function zi(t) {
3819
3800
  ] });
3820
3801
  }
3821
3802
  export {
3822
- Wt as Accordion,
3823
- Di as Application,
3824
- Rt as BaseRemote,
3803
+ Vt as Accordion,
3804
+ Ai as Application,
3805
+ Tt as BaseRemote,
3825
3806
  Fn as ChildObject,
3826
- Ja as ContainerObject,
3827
- za as Draggable,
3828
- $a as DraggableItem,
3829
- Ya as Dropdown,
3830
- Ga as DropdownItem,
3831
- zi as Editor,
3832
- qa as InfiniteGridHelper,
3833
- gi as Inspector,
3834
- $i as MultiView,
3807
+ Ka as ContainerObject,
3808
+ Ba as Draggable,
3809
+ Fa as DraggableItem,
3810
+ Ua as Dropdown,
3811
+ $a as DropdownItem,
3812
+ Fi as Editor,
3813
+ Va as InfiniteGridHelper,
3814
+ pi as Inspector,
3815
+ Ni as MultiView,
3835
3816
  Nn as NavButton,
3836
- Ii as RemoteComponents,
3837
- Fi as RemoteController,
3838
- ot as RemoteTheatre,
3839
- Li as RemoteThree,
3840
- Ni as RemoteTweakpane,
3841
- Ui as SceneInspector,
3842
- Bi as SidePanel,
3817
+ Pi as RemoteComponents,
3818
+ Di as RemoteController,
3819
+ In as RemoteTheatre,
3820
+ ki as RemoteThree,
3821
+ ji as RemoteTweakpane,
3822
+ Li as SceneInspector,
3823
+ Ii as SidePanel,
3843
3824
  j as ToolEvents,
3844
- Za as UVMaterial,
3845
- lt as capitalize,
3846
- Pi as clamp,
3847
- Aa as colorToHex,
3825
+ qa as UVMaterial,
3826
+ ct as capitalize,
3827
+ Ti as clamp,
3828
+ Ta as colorToHex,
3848
3829
  k as debugDispatcher,
3849
- Dn as dispose,
3850
- ka as disposeMaterial,
3851
- ji as disposeTexture,
3852
- ki as distance,
3853
- jn as hierarchyUUID,
3854
- _a as isColor,
3855
- Ra as randomID,
3856
- Pa as resetThreeObjects,
3857
- Ft as round,
3858
- Yt as totalThreeObjects
3830
+ jn as dispose,
3831
+ _a as disposeMaterial,
3832
+ _i as disposeTexture,
3833
+ Ri as distance,
3834
+ kn as hierarchyUUID,
3835
+ Ma as isColor,
3836
+ Oa as randomID,
3837
+ Ra as resetThreeObjects,
3838
+ Nt as round,
3839
+ zt as totalThreeObjects
3859
3840
  };