@tomorrowevening/hermes 0.0.9 → 0.0.12

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.
Files changed (66) hide show
  1. package/dist/hermes.js +1608 -1382
  2. package/dist/hermes.umd.cjs +16 -16
  3. package/dist/style.css +1 -1
  4. package/package.json +1 -1
  5. package/src/core/RemoteController.ts +7 -3
  6. package/src/core/remote/RemoteThree.ts +24 -11
  7. package/src/core/types.ts +2 -1
  8. package/src/editor/global.ts +3 -1
  9. package/src/editor/{sceneHierarchy/inspector/MultiView → multiView}/CameraWindow.tsx +20 -7
  10. package/src/editor/{sceneHierarchy/inspector/MultiView → multiView}/MultiView.scss +8 -0
  11. package/src/editor/{sceneHierarchy/inspector/MultiView → multiView}/MultiView.tsx +286 -56
  12. package/src/editor/{sceneHierarchy/inspector/MultiView → multiView}/MultiViewData.ts +7 -15
  13. package/src/editor/scss/{_sceneHierarchy.scss → _sidePanel.scss} +1 -1
  14. package/src/editor/scss/index.scss +1 -1
  15. package/src/editor/sidePanel/SidePanel.tsx +64 -0
  16. package/src/editor/sidePanel/inspector/Inspector.tsx +114 -0
  17. package/src/editor/{sceneHierarchy → sidePanel}/inspector/SceneInspector.tsx +16 -11
  18. package/src/editor/sidePanel/inspector/utils/InspectAnimation.tsx +51 -0
  19. package/src/editor/{sceneHierarchy → sidePanel}/inspector/utils/InspectMaterial.tsx +1 -0
  20. package/src/editor/{sceneHierarchy → sidePanel}/inspector/utils/InspectTransform.tsx +35 -46
  21. package/src/editor/{sceneHierarchy → sidePanel}/types.ts +10 -1
  22. package/src/editor/{sceneHierarchy → sidePanel}/utils.ts +11 -2
  23. package/src/editor/utils.ts +60 -4
  24. package/src/index.ts +9 -9
  25. package/types/core/remote/RemoteThree.d.ts +3 -2
  26. package/types/core/types.d.ts +1 -1
  27. package/types/editor/global.d.ts +2 -1
  28. package/types/editor/{sceneHierarchy/inspector/MultiView → multiView}/CameraWindow.d.ts +2 -0
  29. package/types/editor/{sceneHierarchy/inspector/MultiView → multiView}/MultiView.d.ts +2 -4
  30. package/types/editor/{sceneHierarchy/inspector/MultiView → multiView}/MultiViewData.d.ts +4 -4
  31. package/types/editor/sidePanel/SidePanel.d.ts +11 -0
  32. package/types/editor/{sceneHierarchy → sidePanel}/inspector/SceneInspector.d.ts +0 -2
  33. package/types/editor/sidePanel/inspector/utils/InspectAnimation.d.ts +3 -0
  34. package/types/editor/{sceneHierarchy → sidePanel}/types.d.ts +7 -1
  35. package/types/editor/utils.d.ts +7 -1
  36. package/types/index.d.ts +9 -9
  37. package/src/editor/sceneHierarchy/SceneHierarchy.tsx +0 -80
  38. package/src/editor/sceneHierarchy/inspector/Inspector.tsx +0 -97
  39. package/types/editor/sceneHierarchy/SceneHierarchy.d.ts +0 -13
  40. /package/src/editor/{sceneHierarchy/inspector/MultiView → multiView}/InfiniteGridHelper.ts +0 -0
  41. /package/src/editor/{sceneHierarchy/inspector/MultiView → multiView}/InfiniteGridMaterial.ts +0 -0
  42. /package/src/editor/{sceneHierarchy/inspector/MultiView → multiView}/UVMaterial.ts +0 -0
  43. /package/src/editor/{sceneHierarchy → sidePanel}/Accordion.tsx +0 -0
  44. /package/src/editor/{sceneHierarchy → sidePanel}/ChildObject.tsx +0 -0
  45. /package/src/editor/{sceneHierarchy → sidePanel}/ContainerObject.tsx +0 -0
  46. /package/src/editor/{sceneHierarchy → sidePanel}/ToggleBtn.tsx +0 -0
  47. /package/src/editor/{sceneHierarchy → sidePanel}/inspector/InspectorField.tsx +0 -0
  48. /package/src/editor/{sceneHierarchy → sidePanel}/inspector/InspectorGroup.tsx +0 -0
  49. /package/src/editor/{sceneHierarchy → sidePanel}/inspector/inspector.scss +0 -0
  50. /package/src/editor/{sceneHierarchy → sidePanel}/inspector/utils/InspectCamera.tsx +0 -0
  51. /package/src/editor/{sceneHierarchy → sidePanel}/inspector/utils/InspectLight.tsx +0 -0
  52. /package/types/editor/{sceneHierarchy/inspector/MultiView → multiView}/InfiniteGridHelper.d.ts +0 -0
  53. /package/types/editor/{sceneHierarchy/inspector/MultiView → multiView}/InfiniteGridMaterial.d.ts +0 -0
  54. /package/types/editor/{sceneHierarchy/inspector/MultiView → multiView}/UVMaterial.d.ts +0 -0
  55. /package/types/editor/{sceneHierarchy → sidePanel}/Accordion.d.ts +0 -0
  56. /package/types/editor/{sceneHierarchy → sidePanel}/ChildObject.d.ts +0 -0
  57. /package/types/editor/{sceneHierarchy → sidePanel}/ContainerObject.d.ts +0 -0
  58. /package/types/editor/{sceneHierarchy → sidePanel}/ToggleBtn.d.ts +0 -0
  59. /package/types/editor/{sceneHierarchy → sidePanel}/inspector/Inspector.d.ts +0 -0
  60. /package/types/editor/{sceneHierarchy → sidePanel}/inspector/InspectorField.d.ts +0 -0
  61. /package/types/editor/{sceneHierarchy → sidePanel}/inspector/InspectorGroup.d.ts +0 -0
  62. /package/types/editor/{sceneHierarchy → sidePanel}/inspector/utils/InspectCamera.d.ts +0 -0
  63. /package/types/editor/{sceneHierarchy → sidePanel}/inspector/utils/InspectLight.d.ts +0 -0
  64. /package/types/editor/{sceneHierarchy → sidePanel}/inspector/utils/InspectMaterial.d.ts +0 -0
  65. /package/types/editor/{sceneHierarchy → sidePanel}/inspector/utils/InspectTransform.d.ts +0 -0
  66. /package/types/editor/{sceneHierarchy → sidePanel}/utils.d.ts +0 -0
package/dist/hermes.js CHANGED
@@ -1,48 +1,70 @@
1
- var fn = Object.defineProperty;
2
- var hn = (t, n, a) => n in t ? fn(t, n, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[n] = a;
3
- var L = (t, n, a) => (hn(t, typeof n != "symbol" ? n + "" : n, a), a);
4
- import { EventDispatcher as Kt, Texture as Xt, CubeTexture as pn, RepeatWrapping as It, ShaderMaterial as qt, GLSL3 as mn, DoubleSide as gn, Color as Pt, Mesh as vn, PlaneGeometry as bn, Matrix4 as yn, Vector3 as I, Euler as En, Ray as xn, Plane as wn, MathUtils as Cn, MOUSE as Le, TOUCH as Fe, Quaternion as At, Spherical as Nt, Vector2 as ae, PerspectiveCamera as St, MeshNormalMaterial as Sn, MeshBasicMaterial as Tn, OrthographicCamera as Zt, Scene as On, AxesHelper as Mn, CameraHelper as Rn } from "three";
5
- import { getProject as Pn } from "@theatre/core";
6
- import { Pane as jn } from "tweakpane";
7
- import * as _n from "@tweakpane/plugin-essentials";
8
- import Jt, { useState as ie, useRef as Oe, useEffect as tt, Component as kn, forwardRef as Dn } from "react";
9
- import { Reorder as Qt } from "framer-motion";
10
- import Ze from "@theatre/studio";
11
- function Or(t, n, a) {
1
+ var Sn = Object.defineProperty;
2
+ var On = (t, n, a) => n in t ? Sn(t, n, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[n] = a;
3
+ var Z = (t, n, a) => (On(t, typeof n != "symbol" ? n + "" : n, a), a);
4
+ import { PositionalAudio as Tn, EventDispatcher as nn, Texture as an, CubeTexture as Mn, RepeatWrapping as Gt, ShaderMaterial as rn, GLSL3 as Rn, DoubleSide as Pn, Color as Nt, Mesh as jn, PlaneGeometry as _n, Matrix4 as kn, Vector3 as Y, Euler as An, AnimationMixer as Dn, Ray as In, Plane as Nn, MathUtils as Ln, MOUSE as ze, TOUCH as Ye, Quaternion as Vt, Spherical as zt, Vector2 as ue, PerspectiveCamera as kt, MeshDepthMaterial as Fn, MeshNormalMaterial as Un, MeshBasicMaterial as Bn, OrthographicCamera as on, Scene as sn, Group as $n, AxesHelper as cn, WebGLRenderer as Gn, Raycaster as Vn, CameraHelper as zn } from "three";
5
+ import { getProject as Yn } from "@theatre/core";
6
+ import { Pane as Wn } from "tweakpane";
7
+ import * as Hn from "@tweakpane/plugin-essentials";
8
+ import ln, { useState as ie, useRef as xe, useEffect as Ne, Component as Kn, forwardRef as Xn } from "react";
9
+ import { Reorder as un } from "framer-motion";
10
+ import et from "@theatre/studio";
11
+ function Ka(t, n, a) {
12
12
  return Math.min(n, Math.max(t, a));
13
13
  }
14
- function Mr(t, n) {
14
+ function Xa(t, n) {
15
15
  const a = t - n;
16
16
  return Math.sqrt(a * a);
17
17
  }
18
- function In() {
18
+ function qn() {
19
19
  return Math.round(Math.random() * 1e6).toString();
20
20
  }
21
- function An(t) {
21
+ function Zn(t) {
22
22
  return t.r !== void 0 && t.g !== void 0 && t.b !== void 0;
23
23
  }
24
- function Nn(t) {
25
- const n = Math.round(t.r * 255), a = Math.round(t.g * 255), e = Math.round(t.b * 255), o = (d) => {
26
- const m = d.toString(16);
27
- return m.length === 1 ? "0" + m : m;
28
- }, u = o(n), c = o(a), s = o(e);
29
- return "#" + u + c + s;
24
+ function Jn(t) {
25
+ const n = Math.round(t.r * 255), a = Math.round(t.g * 255), e = Math.round(t.b * 255), r = (d) => {
26
+ const p = d.toString(16);
27
+ return p.length === 1 ? "0" + p : p;
28
+ }, s = r(n), c = r(a), l = r(e);
29
+ return "#" + s + c + l;
30
30
  }
31
- let Lt = 0;
32
- const en = (t) => {
31
+ function Rt(t, n = 1) {
32
+ return Number(t.toFixed(n));
33
+ }
34
+ let At = 0;
35
+ const Qn = () => {
36
+ At = 0;
37
+ }, dn = (t) => {
33
38
  if (!t)
34
39
  return;
35
40
  let n = t.name.replace(" ", "");
36
- n.length === 0 && (n = `obj_${Lt}`), t.parent !== null && (n = `${t.parent.uuid}.${n}`), t.uuid = n, Lt++, t.children.forEach((a) => {
37
- en(a);
41
+ n.length === 0 && (n = `obj_${At}`, At++), t.parent !== null && (n = `${t.parent.uuid}.${n}`), t.uuid = n, t.children.forEach((a) => {
42
+ dn(a);
38
43
  });
44
+ }, qa = (t) => {
45
+ t == null || t.dispose();
46
+ }, ea = (t) => {
47
+ t && (Array.isArray(t) ? t.forEach((n) => n.dispose()) : t.dispose());
48
+ }, fn = (t) => {
49
+ var n;
50
+ if (t) {
51
+ for (; t.children.length > 0; ) {
52
+ const a = t.children[0];
53
+ a instanceof Tn ? (a.pause(), a.parent && a.parent.remove(a)) : fn(a);
54
+ }
55
+ if (t.parent && t.parent.remove(t), t.isMesh) {
56
+ const a = t;
57
+ (n = a.geometry) == null || n.dispose(), ea(a.material);
58
+ }
59
+ t.dispose !== void 0 && t.dispose();
60
+ }
39
61
  };
40
- class Rr {
62
+ class Za {
41
63
  constructor(n, a, e) {
42
- L(this, "channel");
43
- L(this, "components", /* @__PURE__ */ new Map());
64
+ Z(this, "channel");
65
+ Z(this, "components", /* @__PURE__ */ new Map());
44
66
  // Protected
45
- L(this, "_mode", "app");
67
+ Z(this, "_mode", "app");
46
68
  this.editor = a && document.location.hash.search(e) > -1, a && (this.channel = new BroadcastChannel(n));
47
69
  }
48
70
  addComponent(n, a) {
@@ -73,29 +95,31 @@ class Rr {
73
95
  n && (this._mode = "editor", document.title += " - Editor");
74
96
  }
75
97
  }
76
- const k = new Kt(), D = {
98
+ const k = new nn(), A = {
77
99
  CUSTOM: "ToolEvents::custom",
78
100
  // Components
79
101
  SELECT_DROPDOWN: "ToolEvents::selectDropdown",
80
102
  DRAG_UPDATE: "ToolEvents::dragUpdate",
81
103
  // SceneHierarchy
82
- GET_SCENE: "ToolEvents::getScene",
83
104
  SET_SCENE: "ToolEvents::setScene",
84
105
  GET_OBJECT: "ToolEvents::getObject",
85
106
  SET_OBJECT: "ToolEvents::setObject",
86
107
  UPDATE_OBJECT: "ToolEvents::updateObject",
87
108
  CREATE_TEXTURE: "ToolEvents::createTexture",
88
- REQUEST_METHOD: "ToolEvents::requestMethod"
109
+ REQUEST_METHOD: "ToolEvents::requestMethod",
110
+ // MultiView
111
+ ADD_CAMERA: "ToolEvents::addCamera",
112
+ REMOVE_CAMERA: "ToolEvents::removeCamera"
89
113
  };
90
- class mt {
114
+ class xt {
91
115
  constructor(n) {
92
- L(this, "app");
116
+ Z(this, "app");
93
117
  this.app = n;
94
118
  }
95
119
  dispose() {
96
120
  }
97
121
  }
98
- class Pr extends mt {
122
+ class Ja extends xt {
99
123
  selectDropdown(n, a) {
100
124
  this.app.send({
101
125
  event: "selectComponent",
@@ -117,31 +141,31 @@ class Pr extends mt {
117
141
  });
118
142
  }
119
143
  }
120
- const tn = () => {
144
+ const hn = () => {
121
145
  };
122
- class jr extends mt {
123
- constructor(a, e, o) {
146
+ class Qa extends xt {
147
+ constructor(a, e, r) {
124
148
  super(a);
125
- L(this, "project");
126
- L(this, "sheets");
127
- L(this, "sheetObjects");
128
- L(this, "sheetObjectCBs");
129
- L(this, "sheetObjectUnsubscribe");
130
- this.project = Pn(e, o), this.sheets = /* @__PURE__ */ new Map(), this.sheetObjects = /* @__PURE__ */ new Map(), this.sheetObjectCBs = /* @__PURE__ */ new Map(), this.sheetObjectUnsubscribe = /* @__PURE__ */ new Map();
149
+ Z(this, "project");
150
+ Z(this, "sheets");
151
+ Z(this, "sheetObjects");
152
+ Z(this, "sheetObjectCBs");
153
+ Z(this, "sheetObjectUnsubscribe");
154
+ this.project = Yn(e, r), this.sheets = /* @__PURE__ */ new Map(), this.sheetObjects = /* @__PURE__ */ new Map(), this.sheetObjectCBs = /* @__PURE__ */ new Map(), this.sheetObjectUnsubscribe = /* @__PURE__ */ new Map();
131
155
  }
132
156
  dispose() {
133
157
  this.project = void 0, this.sheets = /* @__PURE__ */ new Map(), this.sheetObjects = /* @__PURE__ */ new Map(), this.sheetObjectCBs = /* @__PURE__ */ new Map(), this.sheetObjectUnsubscribe = /* @__PURE__ */ new Map();
134
158
  }
135
159
  sheet(a) {
136
- var o;
160
+ var r;
137
161
  if (this.project === void 0) {
138
162
  console.error("Theatre Project hasn't been created yet.");
139
163
  return;
140
164
  }
141
165
  let e = this.sheets.get(a);
142
- return e !== void 0 || (e = (o = this.project) == null ? void 0 : o.sheet(a), this.sheets.set(a, e)), e;
166
+ return e !== void 0 || (e = (r = this.project) == null ? void 0 : r.sheet(a), this.sheets.set(a, e)), e;
143
167
  }
144
- sheetObject(a, e, o, u) {
168
+ sheetObject(a, e, r, s) {
145
169
  if (this.project === void 0) {
146
170
  console.error("Theatre Project hasn't been created yet.");
147
171
  return;
@@ -149,47 +173,47 @@ class jr extends mt {
149
173
  const c = this.sheets.get(a);
150
174
  if (c === void 0)
151
175
  return;
152
- const s = `${a}_${e}`;
153
- let d = this.sheetObjects.get(s);
176
+ const l = `${a}_${e}`;
177
+ let d = this.sheetObjects.get(l);
154
178
  if (d !== void 0)
155
- return d = c.object(e, { ...o, ...d.value }, { reconfigure: !0 }), d;
156
- d = c.object(e, o), this.sheetObjects.set(s, d), this.sheetObjectCBs.set(s, u !== void 0 ? u : tn);
157
- const m = d.onValuesChange((v) => {
179
+ return d = c.object(e, { ...r, ...d.value }, { reconfigure: !0 }), d;
180
+ d = c.object(e, r), this.sheetObjects.set(l, d), this.sheetObjectCBs.set(l, s !== void 0 ? s : hn);
181
+ const p = d.onValuesChange((m) => {
158
182
  if (this.app.editor) {
159
- for (const f in v) {
160
- const h = v[f];
161
- typeof h == "object" && An(h) && (v[f] = {
162
- r: h.r,
163
- g: h.g,
164
- b: h.b,
165
- a: h.a
183
+ for (const b in m) {
184
+ const x = m[b];
185
+ typeof x == "object" && Zn(x) && (m[b] = {
186
+ r: x.r,
187
+ g: x.g,
188
+ b: x.b,
189
+ a: x.a
166
190
  });
167
191
  }
168
192
  this.app.send({
169
193
  event: "updateSheetObject",
170
194
  target: "app",
171
195
  data: {
172
- sheetObject: s,
173
- values: v
196
+ sheetObject: l,
197
+ values: m
174
198
  }
175
199
  });
176
200
  } else {
177
- const f = this.sheetObjectCBs.get(s);
178
- f !== void 0 && f(v);
201
+ const b = this.sheetObjectCBs.get(l);
202
+ b !== void 0 && b(m);
179
203
  }
180
204
  });
181
- return this.sheetObjectUnsubscribe.set(s, m), d;
205
+ return this.sheetObjectUnsubscribe.set(l, p), d;
182
206
  }
183
207
  unsubscribe(a) {
184
208
  if (this.project === void 0) {
185
209
  console.error("Theatre Project hasn't been created yet.");
186
210
  return;
187
211
  }
188
- const e = `${a.address.sheetId}_${a.address.objectKey}`, o = this.sheetObjectUnsubscribe.get(e);
189
- o !== void 0 && o();
212
+ const e = `${a.address.sheetId}_${a.address.objectKey}`, r = this.sheetObjectUnsubscribe.get(e);
213
+ r !== void 0 && r();
190
214
  }
191
215
  }
192
- function Ln(t) {
216
+ function ta(t) {
193
217
  if (t.name === "cameras")
194
218
  return "camera";
195
219
  if (t.name === "interactive")
@@ -203,7 +227,7 @@ function Ln(t) {
203
227
  const n = t.type;
204
228
  return n.search("Helper") > -1 ? "icon_utils" : n.search("Camera") > -1 ? "camera" : n.search("Light") > -1 ? "light" : "obj3D";
205
229
  }
206
- function nn(t) {
230
+ function pn(t) {
207
231
  const n = {
208
232
  name: t.name,
209
233
  type: t.type,
@@ -211,10 +235,10 @@ function nn(t) {
211
235
  children: []
212
236
  };
213
237
  return t.children.forEach((a) => {
214
- n.children.push(nn(a));
238
+ n.children.push(pn(a));
215
239
  }), n;
216
240
  }
217
- function Fn(t) {
241
+ function na(t) {
218
242
  const n = {};
219
243
  for (const a in t) {
220
244
  const e = t[a].value;
@@ -222,7 +246,7 @@ function Fn(t) {
222
246
  }
223
247
  return n;
224
248
  }
225
- function Un(t) {
249
+ function aa(t) {
226
250
  switch (t) {
227
251
  case "blendSrcAlpha":
228
252
  case "blendDstAlpha":
@@ -234,28 +258,28 @@ function Un(t) {
234
258
  }
235
259
  return !1;
236
260
  }
237
- function Ft(t) {
261
+ function Yt(t) {
238
262
  const n = {};
239
263
  for (const a in t) {
240
- if (a.substring(0, 1) === "_" || a.substring(0, 2) === "is" || Un(a))
264
+ if (a.substring(0, 1) === "_" || a.substring(0, 2) === "is" || aa(a))
241
265
  continue;
242
- const e = typeof t[a], o = t[a];
266
+ const e = typeof t[a], r = t[a];
243
267
  switch (e) {
244
268
  case "boolean":
245
269
  case "number":
246
270
  case "string":
247
- n[a] = o;
271
+ n[a] = r;
248
272
  break;
249
273
  case "object":
250
- if (o !== null)
251
- if (n[a] = o, o.isTexture)
252
- if (o instanceof Xt) {
253
- const u = o.source.toJSON();
254
- n[a] = { src: u.url };
274
+ if (r !== null)
275
+ if (n[a] = r, r.isTexture)
276
+ if (r instanceof an) {
277
+ const s = r.source.toJSON();
278
+ n[a] = { src: s.url };
255
279
  } else
256
- o instanceof pn && (console.log("env map"), console.log(o.source.data), console.log(o.source.toJSON()), n[a] = { src: "" });
280
+ r instanceof Mn && (console.log("env map"), console.log(r.source.data), console.log(r.source.toJSON()), n[a] = { src: "" });
257
281
  else
258
- a === "uniforms" && (n[a] = Fn(n[a]));
282
+ a === "uniforms" && (n[a] = na(n[a]));
259
283
  else
260
284
  n[a] = { src: "" };
261
285
  break;
@@ -263,7 +287,7 @@ function Ft(t) {
263
287
  }
264
288
  return n;
265
289
  }
266
- function Bn(t) {
290
+ function Pt(t) {
267
291
  t.updateMatrix();
268
292
  const n = {
269
293
  name: t.name,
@@ -271,20 +295,29 @@ function Bn(t) {
271
295
  uuid: t.uuid,
272
296
  visible: t.visible,
273
297
  matrix: t.matrix.elements,
298
+ animations: [],
274
299
  material: void 0,
275
300
  perspectiveCameraInfo: void 0,
276
301
  orthographicCameraInfo: void 0,
277
302
  lightInfo: void 0
278
- }, a = t.type.toLowerCase();
303
+ };
304
+ t.animations.forEach((e) => {
305
+ n.animations.push({
306
+ name: e.name,
307
+ duration: e.duration,
308
+ blendMode: e.blendMode
309
+ });
310
+ });
311
+ const a = t.type.toLowerCase();
279
312
  if (a.search("mesh") > -1) {
280
313
  const e = t;
281
314
  if (Array.isArray(e.material)) {
282
- const o = [];
283
- e.material.forEach((u) => {
284
- o.push(Ft(u));
285
- }), n.material = o;
315
+ const r = [];
316
+ e.material.forEach((s) => {
317
+ r.push(Yt(s));
318
+ }), n.material = r;
286
319
  } else
287
- n.material = Ft(e.material);
320
+ n.material = Yt(e.material);
288
321
  } else
289
322
  a.search("camera") > -1 ? t.type === "PerspectiveCamera" ? n.perspectiveCameraInfo = {
290
323
  fov: t.fov,
@@ -314,7 +347,7 @@ function Bn(t) {
314
347
  });
315
348
  return n;
316
349
  }
317
- function K(t, n, a) {
350
+ function ee(t, n, a) {
318
351
  const e = n.split(".");
319
352
  switch (e.length) {
320
353
  case 1:
@@ -334,19 +367,19 @@ function K(t, n, a) {
334
367
  break;
335
368
  }
336
369
  }
337
- function Tt(t) {
370
+ function Dt(t) {
338
371
  return new Promise((n, a) => {
339
372
  const e = new Image();
340
373
  e.onload = () => {
341
- const o = new Xt(e);
342
- o.wrapS = It, o.wrapT = It, o.needsUpdate = !0, n(o);
374
+ const r = new an(e);
375
+ r.wrapS = Gt, r.wrapT = Gt, r.needsUpdate = !0, n(r);
343
376
  }, e.onerror = a, e.src = t;
344
377
  });
345
378
  }
346
- class _r extends mt {
379
+ class ei extends xt {
347
380
  constructor() {
348
381
  super(...arguments);
349
- L(this, "scene");
382
+ Z(this, "scene");
350
383
  }
351
384
  getObject(a) {
352
385
  this.app.send({
@@ -356,83 +389,95 @@ class _r extends mt {
356
389
  });
357
390
  }
358
391
  setObject(a) {
359
- const e = Bn(a);
392
+ const e = Pt(a);
360
393
  this.app.send({
361
394
  event: "setObject",
362
395
  target: "editor",
363
396
  data: e
364
397
  });
365
398
  }
366
- requestMethod(a, e, o) {
399
+ requestMethod(a, e, r) {
367
400
  this.app.send({
368
401
  event: "requestMethod",
369
402
  target: "app",
370
403
  data: {
371
404
  uuid: a,
372
405
  key: e,
373
- value: o
406
+ value: r
374
407
  }
375
408
  });
376
409
  }
377
- updateObject(a, e, o) {
410
+ updateObject(a, e, r) {
378
411
  this.app.send({
379
412
  event: "updateObject",
380
413
  target: "app",
381
414
  data: {
382
415
  uuid: a,
383
416
  key: e,
384
- value: o
417
+ value: r
385
418
  }
386
419
  });
387
420
  }
388
- createTexture(a, e, o) {
421
+ createTexture(a, e, r) {
389
422
  this.app.send({
390
423
  event: "createTexture",
391
424
  target: "app",
392
425
  data: {
393
426
  uuid: a,
394
427
  key: e,
395
- value: o
428
+ value: r
396
429
  }
397
430
  });
398
431
  }
399
- getScene() {
432
+ setScene(a) {
433
+ if (a === void 0)
434
+ return;
435
+ this.scene = a, Qn(), dn(this.scene);
436
+ const e = pn(this.scene);
400
437
  this.app.send({
401
- event: "getScene",
402
- target: "app"
438
+ event: "setScene",
439
+ target: "editor",
440
+ data: e
403
441
  });
404
442
  }
405
- setScene(a) {
406
- this.scene = a, en(a);
407
- const e = nn(a);
443
+ addCamera(a) {
444
+ const e = Pt(a);
408
445
  this.app.send({
409
- event: "setScene",
446
+ event: "addCamera",
447
+ target: "editor",
448
+ data: e
449
+ });
450
+ }
451
+ removeCamera(a) {
452
+ const e = Pt(a);
453
+ this.app.send({
454
+ event: "removeCamera",
410
455
  target: "editor",
411
456
  data: e
412
457
  });
413
458
  }
414
459
  }
415
- class kr extends mt {
460
+ class ti extends xt {
416
461
  constructor(a) {
417
462
  super(a);
418
- L(this, "bindCBs");
419
- L(this, "buttonCBs");
420
- L(this, "pane");
421
- L(this, "appCallbacks", 0);
422
- L(this, "editorCallbacks", 0);
423
- L(this, "inspectorFolder");
463
+ Z(this, "bindCBs");
464
+ Z(this, "buttonCBs");
465
+ Z(this, "pane");
466
+ Z(this, "appCallbacks", 0);
467
+ Z(this, "editorCallbacks", 0);
468
+ Z(this, "inspectorFolder");
424
469
  this.bindCBs = /* @__PURE__ */ new Map(), this.buttonCBs = /* @__PURE__ */ new Map(), a.editor && this.createGUI();
425
470
  }
426
471
  createGUI() {
427
- this.pane = new jn({ title: "GUI" }), this.pane.registerPlugin(_n);
472
+ this.pane = new Wn({ title: "GUI" }), this.pane.registerPlugin(Hn);
428
473
  }
429
474
  dispose() {
430
475
  var a;
431
476
  this.bindCBs.clear(), this.buttonCBs.clear(), this.appCallbacks = 0, this.editorCallbacks = 0, this.app.editor && ((a = this.pane) == null || a.dispose(), this.pane = void 0);
432
477
  }
433
- addFolder(a, e = void 0, o = void 0) {
478
+ addFolder(a, e = void 0, r = void 0) {
434
479
  if (this.app.editor)
435
- return this.pane === void 0 && this.createGUI(), (o !== void 0 ? o : this.pane).addFolder({
480
+ return this.pane === void 0 && this.createGUI(), (r !== void 0 ? r : this.pane).addFolder({
436
481
  title: a,
437
482
  ...e
438
483
  });
@@ -442,7 +487,7 @@ class kr extends mt {
442
487
  data: {
443
488
  name: a,
444
489
  params: e,
445
- parent: o
490
+ parent: r
446
491
  }
447
492
  });
448
493
  }
@@ -450,15 +495,15 @@ class kr extends mt {
450
495
  return `debug_${Math.max(this.appCallbacks, this.editorCallbacks)}`;
451
496
  }
452
497
  // Binding
453
- bind(a, e, o, u = void 0) {
454
- const c = this.bindID, s = o.onChange !== void 0 ? o.onChange : tn;
455
- this.bindCBs.set(c, s), this.app.editor ? (this.pane === void 0 && this.createGUI(), (u !== void 0 ? u : this.pane).addBinding(a, e, o).on("change", (m) => {
498
+ bind(a, e, r, s = void 0) {
499
+ const c = this.bindID, l = r.onChange !== void 0 ? r.onChange : hn;
500
+ this.bindCBs.set(c, l), this.app.editor ? (this.pane === void 0 && this.createGUI(), (s !== void 0 ? s : this.pane).addBinding(a, e, r).on("change", (p) => {
456
501
  this.app.send({
457
502
  event: "updateBind",
458
503
  target: "app",
459
504
  data: {
460
505
  id: c,
461
- value: m.value
506
+ value: p.value
462
507
  }
463
508
  });
464
509
  }), this.editorCallbacks++) : (this.app.send({
@@ -467,34 +512,34 @@ class kr extends mt {
467
512
  data: {
468
513
  id: c,
469
514
  name: e,
470
- params: o,
471
- parent: u
515
+ params: r,
516
+ parent: s
472
517
  }
473
518
  }), this.appCallbacks++);
474
519
  }
475
520
  triggerBind(a, e) {
476
- const o = this.bindCBs.get(a);
477
- o !== void 0 ? o(e) : console.warn(`No callback for: ${a}`, e);
521
+ const r = this.bindCBs.get(a);
522
+ r !== void 0 ? r(e) : console.warn(`No callback for: ${a}`, e);
478
523
  }
479
524
  // Buttons
480
- button(a, e, o = void 0) {
481
- const u = this.bindID;
482
- this.buttonCBs.set(u, e), this.app.editor ? (this.pane === void 0 && this.createGUI(), (o !== void 0 ? o : this.pane).addButton({ title: a }).on("click", () => {
525
+ button(a, e, r = void 0) {
526
+ const s = this.bindID;
527
+ this.buttonCBs.set(s, e), this.app.editor ? (this.pane === void 0 && this.createGUI(), (r !== void 0 ? r : this.pane).addButton({ title: a }).on("click", () => {
483
528
  this.app.send({
484
529
  event: "clickButton",
485
530
  target: "app",
486
531
  data: {
487
- id: u
532
+ id: s
488
533
  }
489
534
  });
490
535
  }), this.editorCallbacks++) : (this.app.send({
491
536
  event: "addButton",
492
537
  target: "app",
493
538
  data: {
494
- id: u,
539
+ id: s,
495
540
  name: a,
496
541
  callback: e,
497
- parent: o
542
+ parent: r
498
543
  }
499
544
  }), this.appCallbacks++);
500
545
  }
@@ -512,7 +557,7 @@ class kr extends mt {
512
557
  this.inspectorFolder.remove(this.inspectorFolder.children[e]);
513
558
  }
514
559
  }
515
- var Ot = { exports: {} }, Je = {};
560
+ var It = { exports: {} }, tt = {};
516
561
  /**
517
562
  * @license React
518
563
  * react-jsx-runtime.production.min.js
@@ -522,25 +567,25 @@ var Ot = { exports: {} }, Je = {};
522
567
  * This source code is licensed under the MIT license found in the
523
568
  * LICENSE file in the root directory of this source tree.
524
569
  */
525
- var Ut;
526
- function $n() {
527
- if (Ut)
528
- return Je;
529
- Ut = 1;
530
- var t = Jt, 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, u = { key: !0, ref: !0, __self: !0, __source: !0 };
531
- function c(s, d, m) {
532
- var v, f = {}, h = null, g = null;
533
- m !== void 0 && (h = "" + m), d.key !== void 0 && (h = "" + d.key), d.ref !== void 0 && (g = d.ref);
534
- for (v in d)
535
- e.call(d, v) && !u.hasOwnProperty(v) && (f[v] = d[v]);
536
- if (s && s.defaultProps)
537
- for (v in d = s.defaultProps, d)
538
- f[v] === void 0 && (f[v] = d[v]);
539
- return { $$typeof: n, type: s, key: h, ref: g, props: f, _owner: o.current };
540
- }
541
- return Je.Fragment = a, Je.jsx = c, Je.jsxs = c, Je;
570
+ var Wt;
571
+ function ia() {
572
+ if (Wt)
573
+ return tt;
574
+ Wt = 1;
575
+ var t = ln, n = Symbol.for("react.element"), a = Symbol.for("react.fragment"), e = Object.prototype.hasOwnProperty, r = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, s = { key: !0, ref: !0, __self: !0, __source: !0 };
576
+ function c(l, d, p) {
577
+ var m, b = {}, x = null, C = null;
578
+ p !== void 0 && (x = "" + p), d.key !== void 0 && (x = "" + d.key), d.ref !== void 0 && (C = d.ref);
579
+ for (m in d)
580
+ e.call(d, m) && !s.hasOwnProperty(m) && (b[m] = d[m]);
581
+ if (l && l.defaultProps)
582
+ for (m in d = l.defaultProps, d)
583
+ b[m] === void 0 && (b[m] = d[m]);
584
+ return { $$typeof: n, type: l, key: x, ref: C, props: b, _owner: r.current };
585
+ }
586
+ return tt.Fragment = a, tt.jsx = c, tt.jsxs = c, tt;
542
587
  }
543
- var Qe = {};
588
+ var nt = {};
544
589
  /**
545
590
  * @license React
546
591
  * react-jsx-runtime.development.js
@@ -550,91 +595,91 @@ var Qe = {};
550
595
  * This source code is licensed under the MIT license found in the
551
596
  * LICENSE file in the root directory of this source tree.
552
597
  */
553
- var Bt;
554
- function Gn() {
555
- return Bt || (Bt = 1, process.env.NODE_ENV !== "production" && function() {
556
- var t = Jt, n = Symbol.for("react.element"), a = Symbol.for("react.portal"), e = Symbol.for("react.fragment"), o = Symbol.for("react.strict_mode"), u = Symbol.for("react.profiler"), c = Symbol.for("react.provider"), s = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), m = Symbol.for("react.suspense"), v = Symbol.for("react.suspense_list"), f = Symbol.for("react.memo"), h = Symbol.for("react.lazy"), g = Symbol.for("react.offscreen"), E = Symbol.iterator, w = "@@iterator";
557
- function A(r) {
558
- if (r === null || typeof r != "object")
598
+ var Ht;
599
+ function ra() {
600
+ return Ht || (Ht = 1, process.env.NODE_ENV !== "production" && function() {
601
+ var t = ln, n = Symbol.for("react.element"), a = Symbol.for("react.portal"), e = Symbol.for("react.fragment"), r = Symbol.for("react.strict_mode"), s = Symbol.for("react.profiler"), c = Symbol.for("react.provider"), l = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), p = Symbol.for("react.suspense"), m = Symbol.for("react.suspense_list"), b = Symbol.for("react.memo"), x = Symbol.for("react.lazy"), C = Symbol.for("react.offscreen"), S = Symbol.iterator, F = "@@iterator";
602
+ function Q(i) {
603
+ if (i === null || typeof i != "object")
559
604
  return null;
560
- var p = E && r[E] || r[w];
561
- return typeof p == "function" ? p : null;
605
+ var h = S && i[S] || i[F];
606
+ return typeof h == "function" ? h : null;
562
607
  }
563
- var U = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
564
- function j(r) {
608
+ var H = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
609
+ function O(i) {
565
610
  {
566
- for (var p = arguments.length, b = new Array(p > 1 ? p - 1 : 0), x = 1; x < p; x++)
567
- b[x - 1] = arguments[x];
568
- X("error", r, b);
611
+ for (var h = arguments.length, v = new Array(h > 1 ? h - 1 : 0), w = 1; w < h; w++)
612
+ v[w - 1] = arguments[w];
613
+ K("error", i, v);
569
614
  }
570
615
  }
571
- function X(r, p, b) {
616
+ function K(i, h, v) {
572
617
  {
573
- var x = U.ReactDebugCurrentFrame, M = x.getStackAddendum();
574
- M !== "" && (p += "%s", b = b.concat([M]));
575
- var _ = b.map(function(T) {
576
- return String(T);
618
+ var w = H.ReactDebugCurrentFrame, j = w.getStackAddendum();
619
+ j !== "" && (h += "%s", v = v.concat([j]));
620
+ var L = v.map(function(P) {
621
+ return String(P);
577
622
  });
578
- _.unshift("Warning: " + p), Function.prototype.apply.call(console[r], console, _);
623
+ L.unshift("Warning: " + h), Function.prototype.apply.call(console[i], console, L);
579
624
  }
580
625
  }
581
- var Z = !1, z = !1, O = !1, S = !1, G = !1, ge;
582
- ge = Symbol.for("react.module.reference");
583
- function Re(r) {
584
- return !!(typeof r == "string" || typeof r == "function" || r === e || r === u || G || r === o || r === m || r === v || S || r === g || Z || z || O || typeof r == "object" && r !== null && (r.$$typeof === h || r.$$typeof === f || r.$$typeof === c || r.$$typeof === s || r.$$typeof === d || // This needs to include all possible module reference object
626
+ var de = !1, ce = !1, te = !1, f = !1, g = !1, y;
627
+ y = Symbol.for("react.module.reference");
628
+ function T(i) {
629
+ return !!(typeof i == "string" || typeof i == "function" || i === e || i === s || g || i === r || i === p || i === m || f || i === C || de || ce || te || typeof i == "object" && i !== null && (i.$$typeof === x || i.$$typeof === b || i.$$typeof === c || i.$$typeof === l || i.$$typeof === d || // This needs to include all possible module reference object
585
630
  // types supported by any Flight configuration anywhere since
586
631
  // we don't know which Flight build this will end up being used
587
632
  // with.
588
- r.$$typeof === ge || r.getModuleId !== void 0));
633
+ i.$$typeof === y || i.getModuleId !== void 0));
589
634
  }
590
- function ve(r, p, b) {
591
- var x = r.displayName;
592
- if (x)
593
- return x;
594
- var M = p.displayName || p.name || "";
595
- return M !== "" ? b + "(" + M + ")" : b;
635
+ function V(i, h, v) {
636
+ var w = i.displayName;
637
+ if (w)
638
+ return w;
639
+ var j = h.displayName || h.name || "";
640
+ return j !== "" ? v + "(" + j + ")" : v;
596
641
  }
597
- function be(r) {
598
- return r.displayName || "Context";
642
+ function z(i) {
643
+ return i.displayName || "Context";
599
644
  }
600
- function te(r) {
601
- if (r == null)
645
+ function U(i) {
646
+ if (i == null)
602
647
  return null;
603
- if (typeof r.tag == "number" && j("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof r == "function")
604
- return r.displayName || r.name || null;
605
- if (typeof r == "string")
606
- return r;
607
- switch (r) {
648
+ if (typeof i.tag == "number" && O("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof i == "function")
649
+ return i.displayName || i.name || null;
650
+ if (typeof i == "string")
651
+ return i;
652
+ switch (i) {
608
653
  case e:
609
654
  return "Fragment";
610
655
  case a:
611
656
  return "Portal";
612
- case u:
657
+ case s:
613
658
  return "Profiler";
614
- case o:
659
+ case r:
615
660
  return "StrictMode";
616
- case m:
661
+ case p:
617
662
  return "Suspense";
618
- case v:
663
+ case m:
619
664
  return "SuspenseList";
620
665
  }
621
- if (typeof r == "object")
622
- switch (r.$$typeof) {
623
- case s:
624
- var p = r;
625
- return be(p) + ".Consumer";
666
+ if (typeof i == "object")
667
+ switch (i.$$typeof) {
668
+ case l:
669
+ var h = i;
670
+ return z(h) + ".Consumer";
626
671
  case c:
627
- var b = r;
628
- return be(b._context) + ".Provider";
672
+ var v = i;
673
+ return z(v._context) + ".Provider";
629
674
  case d:
630
- return ve(r, r.render, "ForwardRef");
631
- case f:
632
- var x = r.displayName || null;
633
- return x !== null ? x : te(r.type) || "Memo";
634
- case h: {
635
- var M = r, _ = M._payload, T = M._init;
675
+ return V(i, i.render, "ForwardRef");
676
+ case b:
677
+ var w = i.displayName || null;
678
+ return w !== null ? w : U(i.type) || "Memo";
679
+ case x: {
680
+ var j = i, L = j._payload, P = j._init;
636
681
  try {
637
- return te(T(_));
682
+ return U(P(L));
638
683
  } catch {
639
684
  return null;
640
685
  }
@@ -642,511 +687,511 @@ function Gn() {
642
687
  }
643
688
  return null;
644
689
  }
645
- var oe = Object.assign, ne = 0, Pe, Ge, je, _e, Ve, nt, Ye;
646
- function rt() {
690
+ var D = Object.assign, B = 0, J, R, I, X, pe, Oe, He;
691
+ function ot() {
647
692
  }
648
- rt.__reactDisabledLog = !0;
649
- function vt() {
693
+ ot.__reactDisabledLog = !0;
694
+ function Ct() {
650
695
  {
651
- if (ne === 0) {
652
- Pe = console.log, Ge = console.info, je = console.warn, _e = console.error, Ve = console.group, nt = console.groupCollapsed, Ye = console.groupEnd;
653
- var r = {
696
+ if (B === 0) {
697
+ J = console.log, R = console.info, I = console.warn, X = console.error, pe = console.group, Oe = console.groupCollapsed, He = console.groupEnd;
698
+ var i = {
654
699
  configurable: !0,
655
700
  enumerable: !0,
656
- value: rt,
701
+ value: ot,
657
702
  writable: !0
658
703
  };
659
704
  Object.defineProperties(console, {
660
- info: r,
661
- log: r,
662
- warn: r,
663
- error: r,
664
- group: r,
665
- groupCollapsed: r,
666
- groupEnd: r
705
+ info: i,
706
+ log: i,
707
+ warn: i,
708
+ error: i,
709
+ group: i,
710
+ groupCollapsed: i,
711
+ groupEnd: i
667
712
  });
668
713
  }
669
- ne++;
714
+ B++;
670
715
  }
671
716
  }
672
- function bt() {
717
+ function St() {
673
718
  {
674
- if (ne--, ne === 0) {
675
- var r = {
719
+ if (B--, B === 0) {
720
+ var i = {
676
721
  configurable: !0,
677
722
  enumerable: !0,
678
723
  writable: !0
679
724
  };
680
725
  Object.defineProperties(console, {
681
- log: oe({}, r, {
682
- value: Pe
726
+ log: D({}, i, {
727
+ value: J
683
728
  }),
684
- info: oe({}, r, {
685
- value: Ge
729
+ info: D({}, i, {
730
+ value: R
686
731
  }),
687
- warn: oe({}, r, {
688
- value: je
732
+ warn: D({}, i, {
733
+ value: I
689
734
  }),
690
- error: oe({}, r, {
691
- value: _e
735
+ error: D({}, i, {
736
+ value: X
692
737
  }),
693
- group: oe({}, r, {
694
- value: Ve
738
+ group: D({}, i, {
739
+ value: pe
695
740
  }),
696
- groupCollapsed: oe({}, r, {
697
- value: nt
741
+ groupCollapsed: D({}, i, {
742
+ value: Oe
698
743
  }),
699
- groupEnd: oe({}, r, {
700
- value: Ye
744
+ groupEnd: D({}, i, {
745
+ value: He
701
746
  })
702
747
  });
703
748
  }
704
- ne < 0 && j("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
749
+ B < 0 && O("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
705
750
  }
706
751
  }
707
- var ze = U.ReactCurrentDispatcher, We;
708
- function ye(r, p, b) {
752
+ var Ke = H.ReactCurrentDispatcher, Xe;
753
+ function Te(i, h, v) {
709
754
  {
710
- if (We === void 0)
755
+ if (Xe === void 0)
711
756
  try {
712
757
  throw Error();
713
- } catch (M) {
714
- var x = M.stack.trim().match(/\n( *(at )?)/);
715
- We = x && x[1] || "";
758
+ } catch (j) {
759
+ var w = j.stack.trim().match(/\n( *(at )?)/);
760
+ Xe = w && w[1] || "";
716
761
  }
717
762
  return `
718
- ` + We + r;
763
+ ` + Xe + i;
719
764
  }
720
765
  }
721
- var ke = !1, Ee;
766
+ var Ue = !1, Me;
722
767
  {
723
- var yt = typeof WeakMap == "function" ? WeakMap : Map;
724
- Ee = new yt();
768
+ var Ot = typeof WeakMap == "function" ? WeakMap : Map;
769
+ Me = new Ot();
725
770
  }
726
- function at(r, p) {
727
- if (!r || ke)
771
+ function st(i, h) {
772
+ if (!i || Ue)
728
773
  return "";
729
774
  {
730
- var b = Ee.get(r);
731
- if (b !== void 0)
732
- return b;
775
+ var v = Me.get(i);
776
+ if (v !== void 0)
777
+ return v;
733
778
  }
734
- var x;
735
- ke = !0;
736
- var M = Error.prepareStackTrace;
779
+ var w;
780
+ Ue = !0;
781
+ var j = Error.prepareStackTrace;
737
782
  Error.prepareStackTrace = void 0;
738
- var _;
739
- _ = ze.current, ze.current = null, vt();
783
+ var L;
784
+ L = Ke.current, Ke.current = null, Ct();
740
785
  try {
741
- if (p) {
742
- var T = function() {
786
+ if (h) {
787
+ var P = function() {
743
788
  throw Error();
744
789
  };
745
- if (Object.defineProperty(T.prototype, "props", {
790
+ if (Object.defineProperty(P.prototype, "props", {
746
791
  set: function() {
747
792
  throw Error();
748
793
  }
749
794
  }), typeof Reflect == "object" && Reflect.construct) {
750
795
  try {
751
- Reflect.construct(T, []);
752
- } catch (ue) {
753
- x = ue;
796
+ Reflect.construct(P, []);
797
+ } catch (ye) {
798
+ w = ye;
754
799
  }
755
- Reflect.construct(r, [], T);
800
+ Reflect.construct(i, [], P);
756
801
  } else {
757
802
  try {
758
- T.call();
759
- } catch (ue) {
760
- x = ue;
803
+ P.call();
804
+ } catch (ye) {
805
+ w = ye;
761
806
  }
762
- r.call(T.prototype);
807
+ i.call(P.prototype);
763
808
  }
764
809
  } else {
765
810
  try {
766
811
  throw Error();
767
- } catch (ue) {
768
- x = ue;
812
+ } catch (ye) {
813
+ w = ye;
769
814
  }
770
- r();
815
+ i();
771
816
  }
772
- } catch (ue) {
773
- if (ue && x && typeof ue.stack == "string") {
774
- for (var C = ue.stack.split(`
775
- `), W = x.stack.split(`
776
- `), N = C.length - 1, B = W.length - 1; N >= 1 && B >= 0 && C[N] !== W[B]; )
777
- B--;
778
- for (; N >= 1 && B >= 0; N--, B--)
779
- if (C[N] !== W[B]) {
780
- if (N !== 1 || B !== 1)
817
+ } catch (ye) {
818
+ if (ye && w && typeof ye.stack == "string") {
819
+ for (var M = ye.stack.split(`
820
+ `), se = w.stack.split(`
821
+ `), W = M.length - 1, q = se.length - 1; W >= 1 && q >= 0 && M[W] !== se[q]; )
822
+ q--;
823
+ for (; W >= 1 && q >= 0; W--, q--)
824
+ if (M[W] !== se[q]) {
825
+ if (W !== 1 || q !== 1)
781
826
  do
782
- if (N--, B--, B < 0 || C[N] !== W[B]) {
783
- var re = `
784
- ` + C[N].replace(" at new ", " at ");
785
- return r.displayName && re.includes("<anonymous>") && (re = re.replace("<anonymous>", r.displayName)), typeof r == "function" && Ee.set(r, re), re;
827
+ if (W--, q--, q < 0 || M[W] !== se[q]) {
828
+ var me = `
829
+ ` + M[W].replace(" at new ", " at ");
830
+ return i.displayName && me.includes("<anonymous>") && (me = me.replace("<anonymous>", i.displayName)), typeof i == "function" && Me.set(i, me), me;
786
831
  }
787
- while (N >= 1 && B >= 0);
832
+ while (W >= 1 && q >= 0);
788
833
  break;
789
834
  }
790
835
  }
791
836
  } finally {
792
- ke = !1, ze.current = _, bt(), Error.prepareStackTrace = M;
837
+ Ue = !1, Ke.current = L, St(), Error.prepareStackTrace = j;
793
838
  }
794
- var Ne = r ? r.displayName || r.name : "", Dt = Ne ? ye(Ne) : "";
795
- return typeof r == "function" && Ee.set(r, Dt), Dt;
839
+ var Ve = i ? i.displayName || i.name : "", $t = Ve ? Te(Ve) : "";
840
+ return typeof i == "function" && Me.set(i, $t), $t;
796
841
  }
797
- function it(r, p, b) {
798
- return at(r, !1);
842
+ function ct(i, h, v) {
843
+ return st(i, !1);
799
844
  }
800
- function ot(r) {
801
- var p = r.prototype;
802
- return !!(p && p.isReactComponent);
845
+ function lt(i) {
846
+ var h = i.prototype;
847
+ return !!(h && h.isReactComponent);
803
848
  }
804
- function xe(r, p, b) {
805
- if (r == null)
849
+ function Re(i, h, v) {
850
+ if (i == null)
806
851
  return "";
807
- if (typeof r == "function")
808
- return at(r, ot(r));
809
- if (typeof r == "string")
810
- return ye(r);
811
- switch (r) {
852
+ if (typeof i == "function")
853
+ return st(i, lt(i));
854
+ if (typeof i == "string")
855
+ return Te(i);
856
+ switch (i) {
857
+ case p:
858
+ return Te("Suspense");
812
859
  case m:
813
- return ye("Suspense");
814
- case v:
815
- return ye("SuspenseList");
860
+ return Te("SuspenseList");
816
861
  }
817
- if (typeof r == "object")
818
- switch (r.$$typeof) {
862
+ if (typeof i == "object")
863
+ switch (i.$$typeof) {
819
864
  case d:
820
- return it(r.render);
821
- case f:
822
- return xe(r.type, p, b);
823
- case h: {
824
- var x = r, M = x._payload, _ = x._init;
865
+ return ct(i.render);
866
+ case b:
867
+ return Re(i.type, h, v);
868
+ case x: {
869
+ var w = i, j = w._payload, L = w._init;
825
870
  try {
826
- return xe(_(M), p, b);
871
+ return Re(L(j), h, v);
827
872
  } catch {
828
873
  }
829
874
  }
830
875
  }
831
876
  return "";
832
877
  }
833
- var De = Object.prototype.hasOwnProperty, st = {}, He = U.ReactDebugCurrentFrame;
834
- function fe(r) {
835
- if (r) {
836
- var p = r._owner, b = xe(r.type, r._source, p ? p.type : null);
837
- He.setExtraStackFrame(b);
878
+ var Be = Object.prototype.hasOwnProperty, ut = {}, qe = H.ReactDebugCurrentFrame;
879
+ function we(i) {
880
+ if (i) {
881
+ var h = i._owner, v = Re(i.type, i._source, h ? h.type : null);
882
+ qe.setExtraStackFrame(v);
838
883
  } else
839
- He.setExtraStackFrame(null);
884
+ qe.setExtraStackFrame(null);
840
885
  }
841
- function we(r, p, b, x, M) {
886
+ function Pe(i, h, v, w, j) {
842
887
  {
843
- var _ = Function.call.bind(De);
844
- for (var T in r)
845
- if (_(r, T)) {
846
- var C = void 0;
888
+ var L = Function.call.bind(Be);
889
+ for (var P in i)
890
+ if (L(i, P)) {
891
+ var M = void 0;
847
892
  try {
848
- if (typeof r[T] != "function") {
849
- var W = Error((x || "React class") + ": " + b + " type `" + T + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof r[T] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
850
- throw W.name = "Invariant Violation", W;
893
+ if (typeof i[P] != "function") {
894
+ var se = Error((w || "React class") + ": " + v + " type `" + P + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof i[P] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
895
+ throw se.name = "Invariant Violation", se;
851
896
  }
852
- C = r[T](p, T, x, b, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
853
- } catch (N) {
854
- C = N;
897
+ M = i[P](h, P, w, v, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
898
+ } catch (W) {
899
+ M = W;
855
900
  }
856
- C && !(C instanceof Error) && (fe(M), j("%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).", x || "React class", b, T, typeof C), fe(null)), C instanceof Error && !(C.message in st) && (st[C.message] = !0, fe(M), j("Failed %s type: %s", b, C.message), fe(null));
901
+ M && !(M instanceof Error) && (we(j), O("%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).", w || "React class", v, P, typeof M), we(null)), M instanceof Error && !(M.message in ut) && (ut[M.message] = !0, we(j), O("Failed %s type: %s", v, M.message), we(null));
857
902
  }
858
903
  }
859
904
  }
860
- var Et = Array.isArray;
861
- function Ke(r) {
862
- return Et(r);
905
+ var Tt = Array.isArray;
906
+ function Ze(i) {
907
+ return Tt(i);
863
908
  }
864
- function ct(r) {
909
+ function dt(i) {
865
910
  {
866
- var p = typeof Symbol == "function" && Symbol.toStringTag, b = p && r[Symbol.toStringTag] || r.constructor.name || "Object";
867
- return b;
911
+ var h = typeof Symbol == "function" && Symbol.toStringTag, v = h && i[Symbol.toStringTag] || i.constructor.name || "Object";
912
+ return v;
868
913
  }
869
914
  }
870
- function Xe(r) {
915
+ function Je(i) {
871
916
  try {
872
- return lt(r), !1;
917
+ return ft(i), !1;
873
918
  } catch {
874
919
  return !0;
875
920
  }
876
921
  }
877
- function lt(r) {
878
- return "" + r;
922
+ function ft(i) {
923
+ return "" + i;
879
924
  }
880
- function ut(r) {
881
- if (Xe(r))
882
- return j("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", ct(r)), lt(r);
925
+ function ht(i) {
926
+ if (Je(i))
927
+ return O("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", dt(i)), ft(i);
883
928
  }
884
- var he = U.ReactCurrentOwner, xt = {
929
+ var Ce = H.ReactCurrentOwner, Mt = {
885
930
  key: !0,
886
931
  ref: !0,
887
932
  __self: !0,
888
933
  __source: !0
889
- }, dt, qe, se;
890
- se = {};
891
- function i(r) {
892
- if (De.call(r, "ref")) {
893
- var p = Object.getOwnPropertyDescriptor(r, "ref").get;
894
- if (p && p.isReactWarning)
934
+ }, pt, Qe, ge;
935
+ ge = {};
936
+ function o(i) {
937
+ if (Be.call(i, "ref")) {
938
+ var h = Object.getOwnPropertyDescriptor(i, "ref").get;
939
+ if (h && h.isReactWarning)
895
940
  return !1;
896
941
  }
897
- return r.ref !== void 0;
942
+ return i.ref !== void 0;
898
943
  }
899
- function y(r) {
900
- if (De.call(r, "key")) {
901
- var p = Object.getOwnPropertyDescriptor(r, "key").get;
902
- if (p && p.isReactWarning)
944
+ function E(i) {
945
+ if (Be.call(i, "key")) {
946
+ var h = Object.getOwnPropertyDescriptor(i, "key").get;
947
+ if (h && h.isReactWarning)
903
948
  return !1;
904
949
  }
905
- return r.key !== void 0;
950
+ return i.key !== void 0;
906
951
  }
907
- function R(r, p) {
908
- if (typeof r.ref == "string" && he.current && p && he.current.stateNode !== p) {
909
- var b = te(he.current.type);
910
- se[b] || (j('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', te(he.current.type), r.ref), se[b] = !0);
952
+ function _(i, h) {
953
+ if (typeof i.ref == "string" && Ce.current && h && Ce.current.stateNode !== h) {
954
+ var v = U(Ce.current.type);
955
+ ge[v] || (O('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', U(Ce.current.type), i.ref), ge[v] = !0);
911
956
  }
912
957
  }
913
- function P(r, p) {
958
+ function N(i, h) {
914
959
  {
915
- var b = function() {
916
- dt || (dt = !0, j("%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)", p));
960
+ var v = function() {
961
+ pt || (pt = !0, O("%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));
917
962
  };
918
- b.isReactWarning = !0, Object.defineProperty(r, "key", {
919
- get: b,
963
+ v.isReactWarning = !0, Object.defineProperty(i, "key", {
964
+ get: v,
920
965
  configurable: !0
921
966
  });
922
967
  }
923
968
  }
924
- function V(r, p) {
969
+ function ne(i, h) {
925
970
  {
926
- var b = function() {
927
- qe || (qe = !0, j("%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)", p));
971
+ var v = function() {
972
+ Qe || (Qe = !0, O("%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));
928
973
  };
929
- b.isReactWarning = !0, Object.defineProperty(r, "ref", {
930
- get: b,
974
+ v.isReactWarning = !0, Object.defineProperty(i, "ref", {
975
+ get: v,
931
976
  configurable: !0
932
977
  });
933
978
  }
934
979
  }
935
- var ce = function(r, p, b, x, M, _, T) {
936
- var C = {
980
+ var ve = function(i, h, v, w, j, L, P) {
981
+ var M = {
937
982
  // This tag allows us to uniquely identify this as a React Element
938
983
  $$typeof: n,
939
984
  // Built-in properties that belong on the element
940
- type: r,
941
- key: p,
942
- ref: b,
943
- props: T,
985
+ type: i,
986
+ key: h,
987
+ ref: v,
988
+ props: P,
944
989
  // Record the component responsible for creating this element.
945
- _owner: _
990
+ _owner: L
946
991
  };
947
- return C._store = {}, Object.defineProperty(C._store, "validated", {
992
+ return M._store = {}, Object.defineProperty(M._store, "validated", {
948
993
  configurable: !1,
949
994
  enumerable: !1,
950
995
  writable: !0,
951
996
  value: !1
952
- }), Object.defineProperty(C, "_self", {
997
+ }), Object.defineProperty(M, "_self", {
953
998
  configurable: !1,
954
999
  enumerable: !1,
955
1000
  writable: !1,
956
- value: x
957
- }), Object.defineProperty(C, "_source", {
1001
+ value: w
1002
+ }), Object.defineProperty(M, "_source", {
958
1003
  configurable: !1,
959
1004
  enumerable: !1,
960
1005
  writable: !1,
961
- value: M
962
- }), Object.freeze && (Object.freeze(C.props), Object.freeze(C)), C;
1006
+ value: j
1007
+ }), Object.freeze && (Object.freeze(M.props), Object.freeze(M)), M;
963
1008
  };
964
- function q(r, p, b, x, M) {
1009
+ function le(i, h, v, w, j) {
965
1010
  {
966
- var _, T = {}, C = null, W = null;
967
- b !== void 0 && (ut(b), C = "" + b), y(p) && (ut(p.key), C = "" + p.key), i(p) && (W = p.ref, R(p, M));
968
- for (_ in p)
969
- De.call(p, _) && !xt.hasOwnProperty(_) && (T[_] = p[_]);
970
- if (r && r.defaultProps) {
971
- var N = r.defaultProps;
972
- for (_ in N)
973
- T[_] === void 0 && (T[_] = N[_]);
1011
+ var L, P = {}, M = null, se = null;
1012
+ v !== void 0 && (ht(v), M = "" + v), E(h) && (ht(h.key), M = "" + h.key), o(h) && (se = h.ref, _(h, j));
1013
+ for (L in h)
1014
+ Be.call(h, L) && !Mt.hasOwnProperty(L) && (P[L] = h[L]);
1015
+ if (i && i.defaultProps) {
1016
+ var W = i.defaultProps;
1017
+ for (L in W)
1018
+ P[L] === void 0 && (P[L] = W[L]);
974
1019
  }
975
- if (C || W) {
976
- var B = typeof r == "function" ? r.displayName || r.name || "Unknown" : r;
977
- C && P(T, B), W && V(T, B);
1020
+ if (M || se) {
1021
+ var q = typeof i == "function" ? i.displayName || i.name || "Unknown" : i;
1022
+ M && N(P, q), se && ne(P, q);
978
1023
  }
979
- return ce(r, C, W, M, x, he.current, T);
1024
+ return ve(i, M, se, j, w, Ce.current, P);
980
1025
  }
981
1026
  }
982
- var ft = U.ReactCurrentOwner, ht = U.ReactDebugCurrentFrame;
983
- function le(r) {
984
- if (r) {
985
- var p = r._owner, b = xe(r.type, r._source, p ? p.type : null);
986
- ht.setExtraStackFrame(b);
1027
+ var mt = H.ReactCurrentOwner, gt = H.ReactDebugCurrentFrame;
1028
+ function be(i) {
1029
+ if (i) {
1030
+ var h = i._owner, v = Re(i.type, i._source, h ? h.type : null);
1031
+ gt.setExtraStackFrame(v);
987
1032
  } else
988
- ht.setExtraStackFrame(null);
1033
+ gt.setExtraStackFrame(null);
989
1034
  }
990
- var J;
991
- J = !1;
992
- function Q(r) {
993
- return typeof r == "object" && r !== null && r.$$typeof === n;
1035
+ var fe;
1036
+ fe = !1;
1037
+ function he(i) {
1038
+ return typeof i == "object" && i !== null && i.$$typeof === n;
994
1039
  }
995
- function Ie() {
1040
+ function $e() {
996
1041
  {
997
- if (ft.current) {
998
- var r = te(ft.current.type);
999
- if (r)
1042
+ if (mt.current) {
1043
+ var i = U(mt.current.type);
1044
+ if (i)
1000
1045
  return `
1001
1046
 
1002
- Check the render method of \`` + r + "`.";
1047
+ Check the render method of \`` + i + "`.";
1003
1048
  }
1004
1049
  return "";
1005
1050
  }
1006
1051
  }
1007
- function Ce(r) {
1052
+ function je(i) {
1008
1053
  {
1009
- if (r !== void 0) {
1010
- var p = r.fileName.replace(/^.*[\\\/]/, ""), b = r.lineNumber;
1054
+ if (i !== void 0) {
1055
+ var h = i.fileName.replace(/^.*[\\\/]/, ""), v = i.lineNumber;
1011
1056
  return `
1012
1057
 
1013
- Check your code at ` + p + ":" + b + ".";
1058
+ Check your code at ` + h + ":" + v + ".";
1014
1059
  }
1015
1060
  return "";
1016
1061
  }
1017
1062
  }
1018
- var pe = {};
1019
- function Ae(r) {
1063
+ var Se = {};
1064
+ function Ge(i) {
1020
1065
  {
1021
- var p = Ie();
1022
- if (!p) {
1023
- var b = typeof r == "string" ? r : r.displayName || r.name;
1024
- b && (p = `
1066
+ var h = $e();
1067
+ if (!h) {
1068
+ var v = typeof i == "string" ? i : i.displayName || i.name;
1069
+ v && (h = `
1025
1070
 
1026
- Check the top-level render call using <` + b + ">.");
1071
+ Check the top-level render call using <` + v + ">.");
1027
1072
  }
1028
- return p;
1073
+ return h;
1029
1074
  }
1030
1075
  }
1031
- function jt(r, p) {
1076
+ function Ft(i, h) {
1032
1077
  {
1033
- if (!r._store || r._store.validated || r.key != null)
1078
+ if (!i._store || i._store.validated || i.key != null)
1034
1079
  return;
1035
- r._store.validated = !0;
1036
- var b = Ae(p);
1037
- if (pe[b])
1080
+ i._store.validated = !0;
1081
+ var v = Ge(h);
1082
+ if (Se[v])
1038
1083
  return;
1039
- pe[b] = !0;
1040
- var x = "";
1041
- r && r._owner && r._owner !== ft.current && (x = " It was passed a child from " + te(r._owner.type) + "."), le(r), j('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', b, x), le(null);
1084
+ Se[v] = !0;
1085
+ var w = "";
1086
+ i && i._owner && i._owner !== mt.current && (w = " It was passed a child from " + U(i._owner.type) + "."), be(i), O('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', v, w), be(null);
1042
1087
  }
1043
1088
  }
1044
- function _t(r, p) {
1089
+ function Ut(i, h) {
1045
1090
  {
1046
- if (typeof r != "object")
1091
+ if (typeof i != "object")
1047
1092
  return;
1048
- if (Ke(r))
1049
- for (var b = 0; b < r.length; b++) {
1050
- var x = r[b];
1051
- Q(x) && jt(x, p);
1093
+ if (Ze(i))
1094
+ for (var v = 0; v < i.length; v++) {
1095
+ var w = i[v];
1096
+ he(w) && Ft(w, h);
1052
1097
  }
1053
- else if (Q(r))
1054
- r._store && (r._store.validated = !0);
1055
- else if (r) {
1056
- var M = A(r);
1057
- if (typeof M == "function" && M !== r.entries)
1058
- for (var _ = M.call(r), T; !(T = _.next()).done; )
1059
- Q(T.value) && jt(T.value, p);
1098
+ else if (he(i))
1099
+ i._store && (i._store.validated = !0);
1100
+ else if (i) {
1101
+ var j = Q(i);
1102
+ if (typeof j == "function" && j !== i.entries)
1103
+ for (var L = j.call(i), P; !(P = L.next()).done; )
1104
+ he(P.value) && Ft(P.value, h);
1060
1105
  }
1061
1106
  }
1062
1107
  }
1063
- function on(r) {
1108
+ function bn(i) {
1064
1109
  {
1065
- var p = r.type;
1066
- if (p == null || typeof p == "string")
1110
+ var h = i.type;
1111
+ if (h == null || typeof h == "string")
1067
1112
  return;
1068
- var b;
1069
- if (typeof p == "function")
1070
- b = p.propTypes;
1071
- else if (typeof p == "object" && (p.$$typeof === d || // Note: Memo only checks outer props here.
1113
+ var v;
1114
+ if (typeof h == "function")
1115
+ v = h.propTypes;
1116
+ else if (typeof h == "object" && (h.$$typeof === d || // Note: Memo only checks outer props here.
1072
1117
  // Inner props are checked in the reconciler.
1073
- p.$$typeof === f))
1074
- b = p.propTypes;
1118
+ h.$$typeof === b))
1119
+ v = h.propTypes;
1075
1120
  else
1076
1121
  return;
1077
- if (b) {
1078
- var x = te(p);
1079
- we(b, r.props, "prop", x, r);
1080
- } else if (p.PropTypes !== void 0 && !J) {
1081
- J = !0;
1082
- var M = te(p);
1083
- j("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", M || "Unknown");
1122
+ if (v) {
1123
+ var w = U(h);
1124
+ Pe(v, i.props, "prop", w, i);
1125
+ } else if (h.PropTypes !== void 0 && !fe) {
1126
+ fe = !0;
1127
+ var j = U(h);
1128
+ O("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", j || "Unknown");
1084
1129
  }
1085
- typeof p.getDefaultProps == "function" && !p.getDefaultProps.isReactClassApproved && j("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
1130
+ typeof h.getDefaultProps == "function" && !h.getDefaultProps.isReactClassApproved && O("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
1086
1131
  }
1087
1132
  }
1088
- function sn(r) {
1133
+ function yn(i) {
1089
1134
  {
1090
- for (var p = Object.keys(r.props), b = 0; b < p.length; b++) {
1091
- var x = p[b];
1092
- if (x !== "children" && x !== "key") {
1093
- le(r), j("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", x), le(null);
1135
+ for (var h = Object.keys(i.props), v = 0; v < h.length; v++) {
1136
+ var w = h[v];
1137
+ if (w !== "children" && w !== "key") {
1138
+ be(i), O("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", w), be(null);
1094
1139
  break;
1095
1140
  }
1096
1141
  }
1097
- r.ref !== null && (le(r), j("Invalid attribute `ref` supplied to `React.Fragment`."), le(null));
1142
+ i.ref !== null && (be(i), O("Invalid attribute `ref` supplied to `React.Fragment`."), be(null));
1098
1143
  }
1099
1144
  }
1100
- function kt(r, p, b, x, M, _) {
1145
+ function Bt(i, h, v, w, j, L) {
1101
1146
  {
1102
- var T = Re(r);
1103
- if (!T) {
1104
- var C = "";
1105
- (r === void 0 || typeof r == "object" && r !== null && Object.keys(r).length === 0) && (C += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
1106
- var W = Ce(M);
1107
- W ? C += W : C += Ie();
1108
- var N;
1109
- r === null ? N = "null" : Ke(r) ? N = "array" : r !== void 0 && r.$$typeof === n ? (N = "<" + (te(r.type) || "Unknown") + " />", C = " Did you accidentally export a JSX literal instead of a component?") : N = typeof r, j("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", N, C);
1147
+ var P = T(i);
1148
+ if (!P) {
1149
+ var M = "";
1150
+ (i === void 0 || typeof i == "object" && i !== null && Object.keys(i).length === 0) && (M += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
1151
+ var se = je(j);
1152
+ se ? M += se : M += $e();
1153
+ var W;
1154
+ i === null ? W = "null" : Ze(i) ? W = "array" : i !== void 0 && i.$$typeof === n ? (W = "<" + (U(i.type) || "Unknown") + " />", M = " Did you accidentally export a JSX literal instead of a component?") : W = typeof i, O("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", W, M);
1110
1155
  }
1111
- var B = q(r, p, b, M, _);
1112
- if (B == null)
1113
- return B;
1114
- if (T) {
1115
- var re = p.children;
1116
- if (re !== void 0)
1117
- if (x)
1118
- if (Ke(re)) {
1119
- for (var Ne = 0; Ne < re.length; Ne++)
1120
- _t(re[Ne], r);
1121
- Object.freeze && Object.freeze(re);
1156
+ var q = le(i, h, v, j, L);
1157
+ if (q == null)
1158
+ return q;
1159
+ if (P) {
1160
+ var me = h.children;
1161
+ if (me !== void 0)
1162
+ if (w)
1163
+ if (Ze(me)) {
1164
+ for (var Ve = 0; Ve < me.length; Ve++)
1165
+ Ut(me[Ve], i);
1166
+ Object.freeze && Object.freeze(me);
1122
1167
  } else
1123
- j("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
1168
+ O("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
1124
1169
  else
1125
- _t(re, r);
1170
+ Ut(me, i);
1126
1171
  }
1127
- return r === e ? sn(B) : on(B), B;
1172
+ return i === e ? yn(q) : bn(q), q;
1128
1173
  }
1129
1174
  }
1130
- function cn(r, p, b) {
1131
- return kt(r, p, b, !0);
1175
+ function En(i, h, v) {
1176
+ return Bt(i, h, v, !0);
1132
1177
  }
1133
- function ln(r, p, b) {
1134
- return kt(r, p, b, !1);
1178
+ function xn(i, h, v) {
1179
+ return Bt(i, h, v, !1);
1135
1180
  }
1136
- var un = ln, dn = cn;
1137
- Qe.Fragment = e, Qe.jsx = un, Qe.jsxs = dn;
1138
- }()), Qe;
1181
+ var wn = xn, Cn = En;
1182
+ nt.Fragment = e, nt.jsx = wn, nt.jsxs = Cn;
1183
+ }()), nt;
1139
1184
  }
1140
- process.env.NODE_ENV === "production" ? Ot.exports = $n() : Ot.exports = Gn();
1141
- var l = Ot.exports;
1142
- function rn(t) {
1143
- return t.title.search("<") > -1 ? /* @__PURE__ */ l.jsx("button", { className: "svg", dangerouslySetInnerHTML: { __html: t.title } }) : /* @__PURE__ */ l.jsx("button", { children: t.title });
1185
+ process.env.NODE_ENV === "production" ? It.exports = ia() : It.exports = ra();
1186
+ var u = It.exports;
1187
+ function mn(t) {
1188
+ return t.title.search("<") > -1 ? /* @__PURE__ */ u.jsx("button", { className: "svg", dangerouslySetInnerHTML: { __html: t.title } }) : /* @__PURE__ */ u.jsx("button", { children: t.title });
1144
1189
  }
1145
- const Vn = /* @__PURE__ */ l.jsxs("svg", { className: "closeIcon", width: "14", height: "14", fill: "none", stroke: "#666666", strokeMiterlimit: "10", children: [
1146
- /* @__PURE__ */ l.jsx("circle", { cx: "7", cy: "7", r: "6" }),
1147
- /* @__PURE__ */ l.jsx("line", { x1: "4", y1: "4", x2: "10", y2: "10" }),
1148
- /* @__PURE__ */ l.jsx("line", { x1: "4", y1: "10", x2: "10", y2: "4" })
1149
- ] }), Yn = /* @__PURE__ */ l.jsx("svg", { className: "dragIcon", width: "14", height: "14", fill: "#666666", stroke: "none", children: /* @__PURE__ */ l.jsx(
1190
+ const oa = /* @__PURE__ */ u.jsxs("svg", { className: "closeIcon", width: "14", height: "14", fill: "none", stroke: "#666666", strokeMiterlimit: "10", children: [
1191
+ /* @__PURE__ */ u.jsx("circle", { cx: "7", cy: "7", r: "6" }),
1192
+ /* @__PURE__ */ u.jsx("line", { x1: "4", y1: "4", x2: "10", y2: "10" }),
1193
+ /* @__PURE__ */ u.jsx("line", { x1: "4", y1: "10", x2: "10", y2: "4" })
1194
+ ] }), sa = /* @__PURE__ */ u.jsx("svg", { className: "dragIcon", width: "14", height: "14", fill: "#666666", stroke: "none", children: /* @__PURE__ */ u.jsx(
1150
1195
  "path",
1151
1196
  {
1152
1197
  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
@@ -1154,46 +1199,46 @@ 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
1154
1199
  C11,8.22,10.74,8,10.43,8z`
1155
1200
  }
1156
1201
  ) });
1157
- function zn(t) {
1158
- return /* @__PURE__ */ l.jsx(Qt.Item, { value: t.title, children: /* @__PURE__ */ l.jsxs("div", { children: [
1159
- Yn,
1160
- /* @__PURE__ */ l.jsx("span", { children: t.title }),
1161
- /* @__PURE__ */ l.jsx("button", { className: "closeIcon", onClick: () => {
1202
+ function ca(t) {
1203
+ return /* @__PURE__ */ u.jsx(un.Item, { value: t.title, children: /* @__PURE__ */ u.jsxs("div", { children: [
1204
+ sa,
1205
+ /* @__PURE__ */ u.jsx("span", { children: t.title }),
1206
+ /* @__PURE__ */ u.jsx("button", { className: "closeIcon", onClick: () => {
1162
1207
  t.onDelete(t.index);
1163
- }, children: Vn })
1208
+ }, children: oa })
1164
1209
  ] }) }, t.title);
1165
1210
  }
1166
- function Wn(t) {
1167
- const [n, a] = ie(!1), [e, o] = ie(t.options), u = (m) => {
1168
- t.onDragComplete(m), o(m);
1169
- }, c = (m) => {
1170
- const v = [...e];
1171
- v.splice(m, 1), u(v);
1172
- }, s = [];
1173
- e.forEach((m, v) => {
1174
- s.push(/* @__PURE__ */ l.jsx(zn, { index: v, title: m, onDelete: c }, m));
1211
+ function la(t) {
1212
+ const [n, a] = ie(!1), [e, r] = ie(t.options), s = (p) => {
1213
+ t.onDragComplete(p), r(p);
1214
+ }, c = (p) => {
1215
+ const m = [...e];
1216
+ m.splice(p, 1), s(m);
1217
+ }, l = [];
1218
+ e.forEach((p, m) => {
1219
+ l.push(/* @__PURE__ */ u.jsx(ca, { index: m, title: p, onDelete: c }, p));
1175
1220
  });
1176
1221
  let d = "dropdown draggable";
1177
- return t.subdropdown && (d += " subdropdown"), /* @__PURE__ */ l.jsxs("div", { className: d, onMouseEnter: () => a(!0), onMouseLeave: () => a(!1), children: [
1178
- /* @__PURE__ */ l.jsx(rn, { title: t.title }),
1179
- /* @__PURE__ */ l.jsx(Qt.Group, { axis: "y", values: e, onReorder: u, style: { visibility: n ? "visible" : "hidden" }, children: s })
1222
+ return t.subdropdown && (d += " subdropdown"), /* @__PURE__ */ u.jsxs("div", { className: d, onMouseEnter: () => a(!0), onMouseLeave: () => a(!1), children: [
1223
+ /* @__PURE__ */ u.jsx(mn, { title: t.title }),
1224
+ /* @__PURE__ */ u.jsx(un.Group, { axis: "y", values: e, onReorder: s, style: { visibility: n ? "visible" : "hidden" }, children: l })
1180
1225
  ] });
1181
1226
  }
1182
- function Hn(t) {
1227
+ function ua(t) {
1183
1228
  const [n, a] = ie(!1), e = [];
1184
- t.options.map((u, c) => {
1185
- t.onSelect !== void 0 && (u.onSelect = t.onSelect), e.push(/* @__PURE__ */ l.jsx(Kn, { option: u }, c));
1229
+ t.options.map((s, c) => {
1230
+ t.onSelect !== void 0 && (s.onSelect = t.onSelect), e.push(/* @__PURE__ */ u.jsx(da, { option: s }, c));
1186
1231
  });
1187
- let o = "dropdown";
1188
- return t.subdropdown && (o += " subdropdown"), /* @__PURE__ */ l.jsxs(
1232
+ let r = "dropdown";
1233
+ return t.subdropdown && (r += " subdropdown"), /* @__PURE__ */ u.jsxs(
1189
1234
  "div",
1190
1235
  {
1191
- className: o,
1236
+ className: r,
1192
1237
  onMouseEnter: () => a(!0),
1193
1238
  onMouseLeave: () => a(!1),
1194
1239
  children: [
1195
- /* @__PURE__ */ l.jsx(rn, { title: t.title }),
1196
- /* @__PURE__ */ l.jsx(
1240
+ /* @__PURE__ */ u.jsx(mn, { title: t.title }),
1241
+ /* @__PURE__ */ u.jsx(
1197
1242
  "ul",
1198
1243
  {
1199
1244
  style: { visibility: n ? "visible" : "hidden" },
@@ -1204,26 +1249,26 @@ function Hn(t) {
1204
1249
  }
1205
1250
  );
1206
1251
  }
1207
- function Kn(t) {
1252
+ function da(t) {
1208
1253
  const { option: n } = t, [a, e] = ie("");
1209
- let o;
1254
+ let r;
1210
1255
  switch (n.type) {
1211
1256
  case "draggable":
1212
- o = /* @__PURE__ */ l.jsx(
1213
- Wn,
1257
+ r = /* @__PURE__ */ u.jsx(
1258
+ la,
1214
1259
  {
1215
1260
  title: n.title,
1216
1261
  options: n.value,
1217
- onDragComplete: (u) => {
1218
- n.onDragComplete !== void 0 && n.onDragComplete(u);
1262
+ onDragComplete: (s) => {
1263
+ n.onDragComplete !== void 0 && n.onDragComplete(s);
1219
1264
  },
1220
1265
  subdropdown: !0
1221
1266
  }
1222
1267
  );
1223
1268
  break;
1224
1269
  case "dropdown":
1225
- o = /* @__PURE__ */ l.jsx(
1226
- Hn,
1270
+ r = /* @__PURE__ */ u.jsx(
1271
+ ua,
1227
1272
  {
1228
1273
  title: n.title,
1229
1274
  options: n.value,
@@ -1233,7 +1278,7 @@ function Kn(t) {
1233
1278
  );
1234
1279
  break;
1235
1280
  case "option":
1236
- o = /* @__PURE__ */ l.jsx(
1281
+ r = /* @__PURE__ */ u.jsx(
1237
1282
  "button",
1238
1283
  {
1239
1284
  onClick: () => {
@@ -1244,129 +1289,132 @@ function Kn(t) {
1244
1289
  );
1245
1290
  break;
1246
1291
  }
1247
- return /* @__PURE__ */ l.jsx("li", { className: a === n.title ? "selected" : "", children: o }, In());
1292
+ return /* @__PURE__ */ u.jsx("li", { className: a === n.title ? "selected" : "", children: r }, qn());
1248
1293
  }
1249
- function Dr(t) {
1294
+ function ni(t) {
1250
1295
  let n;
1251
1296
  function a(c) {
1252
- var d, m, v, f, h, g, E, w, A;
1253
- let s;
1297
+ var d, p, m, b, x, C, S, F, Q;
1298
+ let l;
1254
1299
  switch (c.event) {
1255
1300
  case "custom":
1256
- k.dispatchEvent({ type: D.CUSTOM, value: c.data });
1301
+ k.dispatchEvent({ type: A.CUSTOM, value: c.data });
1257
1302
  break;
1258
1303
  case "selectComponent":
1259
- k.dispatchEvent({ type: D.SELECT_DROPDOWN, value: c.data });
1304
+ k.dispatchEvent({ type: A.SELECT_DROPDOWN, value: c.data });
1260
1305
  break;
1261
1306
  case "draggableListUpdate":
1262
- k.dispatchEvent({ type: D.DRAG_UPDATE, value: c.data });
1307
+ k.dispatchEvent({ type: A.DRAG_UPDATE, value: c.data });
1263
1308
  break;
1264
1309
  case "addFolder":
1265
1310
  (d = t.components.get("debug")) == null || d.addFolder(c.data.name, c.data.params, c.data.parent);
1266
1311
  break;
1267
1312
  case "bindObject":
1268
- (m = t.components.get("debug")) == null || m.bind(c.data.name, c.data.params, c.data.parent);
1313
+ (p = t.components.get("debug")) == null || p.bind(c.data.name, c.data.params, c.data.parent);
1269
1314
  break;
1270
1315
  case "updateBind":
1271
- (v = t.components.get("debug")) == null || v.triggerBind(c.data.id, c.data.value);
1316
+ (m = t.components.get("debug")) == null || m.triggerBind(c.data.id, c.data.value);
1272
1317
  break;
1273
1318
  case "addButton":
1274
- (f = t.components.get("debug")) == null || f.button(c.data.name, c.data.callback, c.data.parent);
1319
+ (b = t.components.get("debug")) == null || b.button(c.data.name, c.data.callback, c.data.parent);
1275
1320
  break;
1276
1321
  case "clickButton":
1277
- (h = t.components.get("debug")) == null || h.triggerButton(c.data.id);
1322
+ (x = t.components.get("debug")) == null || x.triggerButton(c.data.id);
1278
1323
  break;
1279
1324
  case "setSheet":
1280
- s = (g = t.components.get("theatre")) == null ? void 0 : g.sheets.get(c.data.sheet), s !== void 0 && (n = s, Ze.setSelection([s]));
1325
+ l = (C = t.components.get("theatre")) == null ? void 0 : C.sheets.get(c.data.sheet), l !== void 0 && (n = l, et.setSelection([l]));
1281
1326
  break;
1282
1327
  case "setSheetObject":
1283
- s = (E = t.components.get("theatre")) == null ? void 0 : E.sheetObjects.get(`${c.data.sheet}_${c.data.key}`), s !== void 0 && Ze.setSelection([s]);
1328
+ l = (S = t.components.get("theatre")) == null ? void 0 : S.sheetObjects.get(`${c.data.sheet}_${c.data.key}`), l !== void 0 && et.setSelection([l]);
1284
1329
  break;
1285
1330
  case "updateSheetObject":
1286
- s = (w = t.components.get("theatre")) == null ? void 0 : w.sheetObjectCBs.get(c.data.sheetObject), s !== void 0 && s(c.data.values);
1331
+ l = (F = t.components.get("theatre")) == null ? void 0 : F.sheetObjectCBs.get(c.data.sheetObject), l !== void 0 && l(c.data.values);
1287
1332
  break;
1288
1333
  case "updateTimeline":
1289
- n = (A = t.components.get("theatre")) == null ? void 0 : A.sheets.get(c.data.sheet), n !== void 0 && (n.sequence.position = c.data.position);
1290
- break;
1291
- case "getScene":
1292
- k.dispatchEvent({ type: D.GET_SCENE });
1334
+ n = (Q = t.components.get("theatre")) == null ? void 0 : Q.sheets.get(c.data.sheet), n !== void 0 && (n.sequence.position = c.data.position);
1293
1335
  break;
1294
1336
  case "getObject":
1295
- k.dispatchEvent({ type: D.GET_OBJECT, value: c.data });
1337
+ k.dispatchEvent({ type: A.GET_OBJECT, value: c.data });
1296
1338
  break;
1297
1339
  case "updateObject":
1298
- k.dispatchEvent({ type: D.UPDATE_OBJECT, value: c.data });
1340
+ k.dispatchEvent({ type: A.UPDATE_OBJECT, value: c.data });
1299
1341
  break;
1300
1342
  case "createTexture":
1301
- k.dispatchEvent({ type: D.CREATE_TEXTURE, value: c.data });
1343
+ k.dispatchEvent({ type: A.CREATE_TEXTURE, value: c.data });
1302
1344
  break;
1303
1345
  case "requestMethod":
1304
- k.dispatchEvent({ type: D.REQUEST_METHOD, value: c.data });
1346
+ k.dispatchEvent({ type: A.REQUEST_METHOD, value: c.data });
1305
1347
  break;
1306
1348
  }
1307
1349
  }
1308
1350
  function e(c) {
1309
1351
  switch (c.event) {
1310
1352
  case "custom":
1311
- k.dispatchEvent({ type: D.CUSTOM, value: c.data });
1353
+ k.dispatchEvent({ type: A.CUSTOM, value: c.data });
1312
1354
  break;
1313
1355
  case "setObject":
1314
- k.dispatchEvent({ type: D.SET_OBJECT, value: c.data });
1356
+ k.dispatchEvent({ type: A.SET_OBJECT, value: c.data });
1315
1357
  break;
1316
1358
  case "setScene":
1317
- k.dispatchEvent({ type: D.SET_SCENE, value: c.data });
1359
+ k.dispatchEvent({ type: A.SET_SCENE, value: c.data });
1360
+ break;
1361
+ case "addCamera":
1362
+ k.dispatchEvent({ type: A.ADD_CAMERA, value: c.data });
1363
+ break;
1364
+ case "removeCamera":
1365
+ k.dispatchEvent({ type: A.REMOVE_CAMERA, value: c.data });
1318
1366
  break;
1319
1367
  }
1320
1368
  }
1321
- function o() {
1322
- Ze.ui.hide();
1369
+ function r() {
1370
+ et.ui.hide();
1323
1371
  }
1324
- function u() {
1325
- Ze.ui.restore(), Ze.onSelectionChange((m) => {
1326
- m.length < 1 || m.forEach((v) => {
1327
- var E;
1328
- let f = v.address.sheetId, h = "setSheet", g = {};
1329
- switch (v.type) {
1372
+ function s() {
1373
+ et.ui.restore(), et.onSelectionChange((p) => {
1374
+ p.length < 1 || p.forEach((m) => {
1375
+ var S;
1376
+ let b = m.address.sheetId, x = "setSheet", C = {};
1377
+ switch (m.type) {
1330
1378
  case "Theatre_Sheet_PublicAPI":
1331
- h = "setSheet", g = {
1332
- sheet: v.address.sheetId
1333
- }, n = (E = t.components.get("theatre")) == null ? void 0 : E.sheets.get(v.address.sheetId);
1379
+ x = "setSheet", C = {
1380
+ sheet: m.address.sheetId
1381
+ }, n = (S = t.components.get("theatre")) == null ? void 0 : S.sheets.get(m.address.sheetId);
1334
1382
  break;
1335
1383
  case "Theatre_SheetObject_PublicAPI":
1336
- h = "setSheetObject", f += `_${v.address.objectKey}`, g = {
1337
- id: f,
1338
- sheet: v.address.sheetId,
1339
- key: v.address.objectKey
1384
+ x = "setSheetObject", b += `_${m.address.objectKey}`, C = {
1385
+ id: b,
1386
+ sheet: m.address.sheetId,
1387
+ key: m.address.objectKey
1340
1388
  };
1341
1389
  break;
1342
1390
  }
1343
- t.send({ event: h, target: "app", data: g });
1391
+ t.send({ event: x, target: "app", data: C });
1344
1392
  });
1345
1393
  });
1346
1394
  let c = 0;
1347
- const s = () => {
1395
+ const l = () => {
1348
1396
  if (n !== void 0 && c !== n.sequence.position) {
1349
1397
  c = n.sequence.position;
1350
- const m = n;
1398
+ const p = n;
1351
1399
  t.send({
1352
1400
  event: "updateTimeline",
1353
1401
  target: "app",
1354
1402
  data: {
1355
1403
  position: c,
1356
- sheet: m.address.sheetId
1404
+ sheet: p.address.sheetId
1357
1405
  }
1358
1406
  });
1359
1407
  }
1360
1408
  }, d = () => {
1361
- s(), requestAnimationFrame(d);
1409
+ l(), requestAnimationFrame(d);
1362
1410
  };
1363
- s(), d();
1411
+ l(), d();
1364
1412
  }
1365
1413
  t.listen((c) => {
1366
1414
  t.editor ? e(c) : a(c);
1367
- }), t.editor ? u() : o();
1415
+ }), t.editor ? s() : r();
1368
1416
  }
1369
- const Xn = `out vec3 worldPosition;
1417
+ const fa = `out vec3 worldPosition;
1370
1418
  uniform float uDistance;
1371
1419
 
1372
1420
  void main() {
@@ -1375,7 +1423,7 @@ void main() {
1375
1423
  worldPosition.xz += cameraPosition.xz;
1376
1424
 
1377
1425
  gl_Position = projectionMatrix * modelViewMatrix * vec4(worldPosition, 1.0);
1378
- }`, qn = `out vec4 fragColor;
1426
+ }`, ha = `out vec4 fragColor;
1379
1427
  in vec3 worldPosition;
1380
1428
 
1381
1429
  uniform float uDivisions;
@@ -1443,14 +1491,14 @@ void main() {
1443
1491
 
1444
1492
  if (fragColor.a <= 0.0) discard;
1445
1493
  }`;
1446
- class Zn extends qt {
1494
+ class pa extends rn {
1447
1495
  constructor(n) {
1448
1496
  super({
1449
1497
  extensions: {
1450
1498
  derivatives: !0
1451
1499
  },
1452
- glslVersion: mn,
1453
- side: gn,
1500
+ glslVersion: Rn,
1501
+ side: Pn,
1454
1502
  transparent: !0,
1455
1503
  uniforms: {
1456
1504
  uScale: {
@@ -1460,7 +1508,7 @@ class Zn extends qt {
1460
1508
  value: (n == null ? void 0 : n.divisions) !== void 0 ? n == null ? void 0 : n.divisions : 10
1461
1509
  },
1462
1510
  uColor: {
1463
- value: (n == null ? void 0 : n.color) !== void 0 ? n == null ? void 0 : n.color : new Pt(16777215)
1511
+ value: (n == null ? void 0 : n.color) !== void 0 ? n == null ? void 0 : n.color : new Nt(16777215)
1464
1512
  },
1465
1513
  uDistance: {
1466
1514
  value: (n == null ? void 0 : n.distance) !== void 0 ? n == null ? void 0 : n.distance : 1e4
@@ -1472,25 +1520,25 @@ class Zn extends qt {
1472
1520
  value: (n == null ? void 0 : n.gridOpacity) !== void 0 ? n == null ? void 0 : n.gridOpacity : 0.25
1473
1521
  }
1474
1522
  },
1475
- vertexShader: Xn,
1476
- fragmentShader: qn,
1523
+ vertexShader: fa,
1524
+ fragmentShader: ha,
1477
1525
  name: "InfiniteGrid",
1478
1526
  depthWrite: !1
1479
1527
  });
1480
1528
  }
1481
1529
  }
1482
- class Jn extends vn {
1530
+ class ma extends jn {
1483
1531
  constructor() {
1484
- const a = new Zn();
1485
- super(new bn(2, 2), a);
1486
- L(this, "gridMaterial");
1532
+ const a = new pa();
1533
+ super(new _n(2, 2), a);
1534
+ Z(this, "gridMaterial");
1487
1535
  this.gridMaterial = a, this.frustumCulled = !1, this.name = "InfiniteGridHelper", this.position.y = 0.1;
1488
1536
  }
1489
1537
  update() {
1490
1538
  this.gridMaterial.needsUpdate = !0;
1491
1539
  }
1492
1540
  }
1493
- const Qn = `#include <common>
1541
+ const ga = `#include <common>
1494
1542
  #include <batching_pars_vertex>
1495
1543
  #include <uv_pars_vertex>
1496
1544
  #include <color_pars_vertex>
@@ -1520,7 +1568,7 @@ void main() {
1520
1568
  #include <logdepthbuf_vertex>
1521
1569
  #include <clipping_planes_vertex>
1522
1570
  #include <worldpos_vertex>
1523
- }`, er = `
1571
+ }`, va = `
1524
1572
  #include <common>
1525
1573
  #include <uv_pars_fragment>
1526
1574
  #include <clipping_planes_pars_fragment>
@@ -1529,51 +1577,51 @@ void main() {
1529
1577
  #include <clipping_planes_fragment>
1530
1578
  gl_FragColor = vec4(vec3(vUv, 0.0), 1.0);
1531
1579
  }`;
1532
- class tr extends qt {
1580
+ class ba extends rn {
1533
1581
  constructor() {
1534
1582
  super({
1535
1583
  defines: {
1536
1584
  USE_UV: ""
1537
1585
  },
1538
- vertexShader: Qn,
1539
- fragmentShader: er
1586
+ vertexShader: ga,
1587
+ fragmentShader: va
1540
1588
  });
1541
1589
  }
1542
1590
  }
1543
- function Mt(t) {
1591
+ function Lt(t) {
1544
1592
  const [n, a] = ie(t.open !== void 0 ? t.open : !0), e = !n || t.children === void 0;
1545
- return /* @__PURE__ */ l.jsxs("div", { className: `accordion ${e ? "hide" : ""}`, children: [
1546
- /* @__PURE__ */ l.jsxs(
1593
+ return /* @__PURE__ */ u.jsxs("div", { className: `accordion ${e ? "hide" : ""}`, children: [
1594
+ /* @__PURE__ */ u.jsxs(
1547
1595
  "button",
1548
1596
  {
1549
1597
  className: "toggle",
1550
1598
  onClick: () => {
1551
- const o = !n;
1552
- t.onToggle !== void 0 && t.onToggle(o), a(o);
1599
+ const r = !n;
1600
+ t.onToggle !== void 0 && t.onToggle(r), a(r);
1553
1601
  },
1554
1602
  children: [
1555
- /* @__PURE__ */ l.jsx(
1603
+ /* @__PURE__ */ u.jsx(
1556
1604
  "p",
1557
1605
  {
1558
1606
  className: `status ${n ? "open" : ""}`,
1559
1607
  children: "Toggle"
1560
1608
  }
1561
1609
  ),
1562
- /* @__PURE__ */ l.jsx("p", { className: "label", children: t.label })
1610
+ /* @__PURE__ */ u.jsx("p", { className: "label", children: t.label })
1563
1611
  ]
1564
1612
  }
1565
1613
  ),
1566
1614
  t.button,
1567
- /* @__PURE__ */ l.jsx("div", { className: n ? "open" : "", children: /* @__PURE__ */ l.jsx("div", { children: t.children }) })
1615
+ /* @__PURE__ */ u.jsx("div", { className: n ? "open" : "", children: /* @__PURE__ */ u.jsx("div", { children: t.children }) })
1568
1616
  ] });
1569
1617
  }
1570
- function an(t) {
1571
- const [n, a] = ie(!1), e = t.child.children.length > 0, o = [];
1572
- return t.child.children.length > 0 && t.child.children.map((u) => {
1573
- o.push(/* @__PURE__ */ l.jsx(an, { child: u, three: t.three }, Math.random()));
1574
- }), /* @__PURE__ */ l.jsxs("div", { className: "childObject", children: [
1575
- /* @__PURE__ */ l.jsxs("div", { className: "child", children: [
1576
- e ? /* @__PURE__ */ l.jsx(
1618
+ function gn(t) {
1619
+ const [n, a] = ie(!1), e = t.child.children.length > 0, r = [];
1620
+ return t.child.children.length > 0 && t.child.children.map((s) => {
1621
+ r.push(/* @__PURE__ */ u.jsx(gn, { child: s, three: t.three }, Math.random()));
1622
+ }), /* @__PURE__ */ u.jsxs("div", { className: "childObject", children: [
1623
+ /* @__PURE__ */ u.jsxs("div", { className: "child", children: [
1624
+ e ? /* @__PURE__ */ u.jsx(
1577
1625
  "button",
1578
1626
  {
1579
1627
  className: "status",
@@ -1585,7 +1633,7 @@ function an(t) {
1585
1633
  }
1586
1634
  }
1587
1635
  ) : null,
1588
- /* @__PURE__ */ l.jsx(
1636
+ /* @__PURE__ */ u.jsx(
1589
1637
  "button",
1590
1638
  {
1591
1639
  className: "name",
@@ -1598,32 +1646,32 @@ function an(t) {
1598
1646
  children: t.child.name.length > 0 ? `${t.child.name} (${t.child.type})` : `${t.child.type}::${t.child.uuid}`
1599
1647
  }
1600
1648
  ),
1601
- /* @__PURE__ */ l.jsx("div", { className: `icon ${Ln(t.child)}` })
1649
+ /* @__PURE__ */ u.jsx("div", { className: `icon ${ta(t.child)}` })
1602
1650
  ] }),
1603
- /* @__PURE__ */ l.jsx("div", { className: n ? "open" : "", children: /* @__PURE__ */ l.jsx("div", { className: "container", children: o }) })
1651
+ /* @__PURE__ */ u.jsx("div", { className: n ? "open" : "", children: /* @__PURE__ */ u.jsx("div", { className: "container", children: r }) })
1604
1652
  ] }, Math.random());
1605
1653
  }
1606
- function nr(t) {
1654
+ function ya(t) {
1607
1655
  const n = [];
1608
1656
  return t.child.children.map((a) => {
1609
- n.push(/* @__PURE__ */ l.jsx(an, { child: a, three: t.three }, Math.random()));
1610
- }), /* @__PURE__ */ l.jsx("div", { className: `scene ${t.class !== void 0 ? t.class : ""}`, children: n });
1657
+ n.push(/* @__PURE__ */ u.jsx(gn, { child: a, three: t.three }, Math.random()));
1658
+ }), /* @__PURE__ */ u.jsx("div", { className: `scene ${t.class !== void 0 ? t.class : ""}`, children: n });
1611
1659
  }
1612
- const rr = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA5klEQVRoge2Y0Q6EIAwE6cX//+X6cCFpSMEKVTdk501OpRNKiyelFC0b8Ps6gCwoggZF0KAIGhRBgyJoUAQNiqCxjciR9SLV//eZiAyvK3U8i/QVaQO2YyLSFVvlkdTKDjJCukh2ykR5ZEW+kHmlatl90RaBtDkK/w7CYhuRUEO0ee3l+J3m55Vm+17vtwjTnV1V3QA8qfbeUXCzRWDpiLLS+OyzvRW7IzW9R+okvclsqR09743bo0yUpc1+lSJvNsa002+Euk9GKzV7SmZDRIMiaFAEDYqgQRE0KIIGRdCgCBoUQeMEMERadX7YUz8AAAAASUVORK5CYII=";
1613
- function ar(t) {
1660
+ const Ea = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA5klEQVRoge2Y0Q6EIAwE6cX//+X6cCFpSMEKVTdk501OpRNKiyelFC0b8Ps6gCwoggZF0KAIGhRBgyJoUAQNiqCxjciR9SLV//eZiAyvK3U8i/QVaQO2YyLSFVvlkdTKDjJCukh2ykR5ZEW+kHmlatl90RaBtDkK/w7CYhuRUEO0ee3l+J3m55Vm+17vtwjTnV1V3QA8qfbeUXCzRWDpiLLS+OyzvRW7IzW9R+okvclsqR09743bo0yUpc1+lSJvNsa002+Euk9GKzV7SmZDRIMiaFAEDYqgQRE0KIIGRdCgCBoUQeMEMERadX7YUz8AAAAASUVORK5CYII=";
1661
+ function xa(t) {
1614
1662
  return "items" in t;
1615
1663
  }
1616
- function $e(t) {
1617
- function n(e, o) {
1618
- console.log("onChange:", e, o);
1664
+ function Le(t) {
1665
+ function n(e, r) {
1666
+ console.log("onChange:", e, r);
1619
1667
  }
1620
1668
  const a = [];
1621
1669
  return t.items.forEach((e) => {
1622
- ar(e) ? a.push(
1623
- /* @__PURE__ */ l.jsx($e, { title: e.title, items: e.items }, Math.random())
1670
+ xa(e) ? a.push(
1671
+ /* @__PURE__ */ u.jsx(Le, { title: e.title, items: e.items }, Math.random())
1624
1672
  ) : a.push(
1625
- /* @__PURE__ */ l.jsx(
1626
- et,
1673
+ /* @__PURE__ */ u.jsx(
1674
+ at,
1627
1675
  {
1628
1676
  title: e.title,
1629
1677
  prop: e.prop,
@@ -1633,19 +1681,19 @@ function $e(t) {
1633
1681
  max: e.max,
1634
1682
  step: e.step,
1635
1683
  disabled: e.disabled,
1636
- onChange: (o, u) => {
1637
- e.onChange !== void 0 ? e.onChange(o, u) : n(o, u);
1684
+ onChange: (r, s) => {
1685
+ e.onChange !== void 0 ? e.onChange(r, s) : n(r, s);
1638
1686
  }
1639
1687
  },
1640
1688
  Math.random()
1641
1689
  )
1642
1690
  );
1643
- }), /* @__PURE__ */ l.jsx(Mt, { label: t.title, open: !1, children: a });
1691
+ }), /* @__PURE__ */ u.jsx(Lt, { label: t.title, open: !1, children: a });
1644
1692
  }
1645
- function ir(t) {
1693
+ function wa(t) {
1646
1694
  return !(t === "alphaHash" || t === "alphaToCoverage" || t === "attenuationDistance" || t === "colorWrite" || t === "combine" || t === "defaultAttributeValues" || t === "depthFunc" || t === "forceSinglePass" || t === "glslVersion" || t === "linewidth" || t === "normalMapType" || t === "precision" || t === "premultipliedAlpha" || t === "shadowSide" || t === "side" || t === "toneMapped" || t === "uniformsGroups" || t === "uniformsNeedUpdate" || t === "userData" || t === "vertexColors" || t === "version" || t === "wireframeLinecap" || t === "wireframeLinejoin" || t === "wireframeLinewidth" || t.slice(0, 5) === "blend" || t.slice(0, 4) === "clip" || t.slice(0, 7) === "polygon" || t.slice(0, 7) === "stencil" || t.slice(0, 2) === "is");
1647
1695
  }
1648
- function Se(t) {
1696
+ function _e(t) {
1649
1697
  switch (t) {
1650
1698
  case "alphaMap":
1651
1699
  return "Alpha Map";
@@ -1794,148 +1842,148 @@ function Se(t) {
1794
1842
  }
1795
1843
  return t;
1796
1844
  }
1797
- function or(t) {
1845
+ function Ca(t) {
1798
1846
  return t.toLowerCase().search("intensity") > -1 || t === "anisotropyRotation" || t === "bumpScale" || t === "clearcoatRoughness" || t === "displacementBias" || t === "displacementScale" || t === "metalness" || t === "opacity" || t === "reflectivity" || t === "refractionRatio" || t === "roughness" || t === "sheenRoughness" || t === "thickness";
1799
1847
  }
1800
- function sr() {
1848
+ function Sa() {
1801
1849
  const t = document.createElement("input");
1802
1850
  return t.type = "file", new Promise((n, a) => {
1803
1851
  t.addEventListener("change", function() {
1804
1852
  if (t.files === null)
1805
1853
  a();
1806
1854
  else {
1807
- const e = t.files[0], o = new FileReader();
1808
- o.onload = function(u) {
1809
- n(u.target.result);
1810
- }, o.readAsDataURL(e);
1855
+ const e = t.files[0], r = new FileReader();
1856
+ r.onload = function(s) {
1857
+ n(s.target.result);
1858
+ }, r.readAsDataURL(e);
1811
1859
  }
1812
1860
  }), t.click();
1813
1861
  });
1814
1862
  }
1815
- function $t(t, n, a) {
1863
+ function Kt(t, n, a) {
1816
1864
  const e = [];
1817
- for (const o in t) {
1818
- if (!ir(o))
1865
+ for (const r in t) {
1866
+ if (!wa(r))
1819
1867
  continue;
1820
- const u = typeof t[o], c = t[o];
1821
- if (u === "boolean" || u === "number" || u === "string") {
1822
- const s = {
1823
- title: Se(o),
1824
- prop: o,
1825
- type: u,
1868
+ const s = typeof t[r], c = t[r];
1869
+ if (s === "boolean" || s === "number" || s === "string") {
1870
+ const l = {
1871
+ title: _e(r),
1872
+ prop: r,
1873
+ type: s,
1826
1874
  value: c,
1827
1875
  min: void 0,
1828
1876
  max: void 0,
1829
- onChange: (d, m) => {
1830
- var f;
1831
- a.updateObject(n.uuid, `material.${d}`, m), u === "boolean" && a.updateObject(n.uuid, "material.needsUpdate", !0);
1832
- const v = (f = a.scene) == null ? void 0 : f.getObjectByProperty("uuid", n.uuid);
1833
- v !== void 0 && K(v, `material.${d}`, m);
1877
+ onChange: (d, p) => {
1878
+ var b;
1879
+ a.updateObject(n.uuid, `material.${d}`, p), s === "boolean" && a.updateObject(n.uuid, "material.needsUpdate", !0);
1880
+ const m = (b = a.scene) == null ? void 0 : b.getObjectByProperty("uuid", n.uuid);
1881
+ m !== void 0 && ee(m, `material.${d}`, p);
1834
1882
  }
1835
1883
  };
1836
- or(o) && (s.value = Number(c), s.type = "range", s.min = 0, s.max = 1, s.step = 0.01), e.push(s);
1837
- } else if (u === "object")
1884
+ Ca(r) && (l.value = Number(c), l.type = "range", l.min = 0, l.max = 1, l.step = 0.01), e.push(l);
1885
+ } else if (s === "object")
1838
1886
  if (c.isColor)
1839
1887
  e.push({
1840
- title: Se(o),
1841
- prop: o,
1888
+ title: _e(r),
1889
+ prop: r,
1842
1890
  type: "color",
1843
1891
  value: c,
1844
- onChange: (s, d) => {
1845
- var f;
1846
- const m = new Pt(d);
1847
- a.updateObject(n.uuid, `material.${s}`, m);
1848
- const v = (f = a.scene) == null ? void 0 : f.getObjectByProperty("uuid", n.uuid);
1849
- v !== void 0 && K(v, `material.${s}`, m);
1892
+ onChange: (l, d) => {
1893
+ var b;
1894
+ const p = new Nt(d);
1895
+ a.updateObject(n.uuid, `material.${l}`, p);
1896
+ const m = (b = a.scene) == null ? void 0 : b.getObjectByProperty("uuid", n.uuid);
1897
+ m !== void 0 && ee(m, `material.${l}`, p);
1850
1898
  }
1851
1899
  });
1852
1900
  else if (Array.isArray(c)) {
1853
- const s = [];
1901
+ const l = [];
1854
1902
  for (const d in c)
1855
- s.push({
1903
+ l.push({
1856
1904
  title: `${d}`,
1857
1905
  type: `${typeof c[d]}`,
1858
1906
  value: c[d],
1859
- onChange: (m, v) => {
1860
- var h;
1861
- a.updateObject(n.uuid, `material.${o}`, v);
1862
- const f = (h = a.scene) == null ? void 0 : h.getObjectByProperty("uuid", n.uuid);
1863
- f !== void 0 && K(f, `material.${o}`, v);
1907
+ onChange: (p, m) => {
1908
+ var x;
1909
+ a.updateObject(n.uuid, `material.${r}`, m);
1910
+ const b = (x = a.scene) == null ? void 0 : x.getObjectByProperty("uuid", n.uuid);
1911
+ b !== void 0 && ee(b, `material.${r}`, m);
1864
1912
  }
1865
1913
  });
1866
1914
  e.push({
1867
- title: Se(o),
1868
- items: s
1915
+ title: _e(r),
1916
+ items: l
1869
1917
  });
1870
1918
  } else {
1871
- const s = [];
1919
+ const l = [];
1872
1920
  for (const d in c) {
1873
- const m = c[d];
1874
- switch (typeof m) {
1921
+ const p = c[d];
1922
+ switch (typeof p) {
1875
1923
  case "boolean":
1876
1924
  case "number":
1877
1925
  case "string":
1878
1926
  d === "src" ? e.push({
1879
- title: Se(o),
1927
+ title: _e(r),
1880
1928
  type: "image",
1881
- value: m,
1882
- onChange: (f, h) => {
1883
- var E;
1884
- a.createTexture(n.uuid, `material.${o}`, h);
1885
- const g = (E = a.scene) == null ? void 0 : E.getObjectByProperty("uuid", n.uuid);
1886
- g !== void 0 && Tt(h).then((w) => {
1887
- K(g, `material.${o}`, w), K(g, "material.needsUpdate", !0);
1929
+ value: p,
1930
+ onChange: (b, x) => {
1931
+ var S;
1932
+ a.createTexture(n.uuid, `material.${r}`, x);
1933
+ const C = (S = a.scene) == null ? void 0 : S.getObjectByProperty("uuid", n.uuid);
1934
+ C !== void 0 && Dt(x).then((F) => {
1935
+ ee(C, `material.${r}`, F), ee(C, "material.needsUpdate", !0);
1888
1936
  });
1889
1937
  }
1890
- }) : s.push({
1891
- title: `${Se(d)}`,
1892
- prop: `material.${o}.${d}`,
1893
- type: `${typeof t[o][d]}`,
1938
+ }) : l.push({
1939
+ title: `${_e(d)}`,
1940
+ prop: `material.${r}.${d}`,
1941
+ type: `${typeof t[r][d]}`,
1894
1942
  value: c[d],
1895
- onChange: (f, h) => {
1896
- var E;
1897
- a.updateObject(n.uuid, `material.${o}.${d}`, h);
1898
- const g = (E = a.scene) == null ? void 0 : E.getObjectByProperty("uuid", n.uuid);
1899
- g !== void 0 && K(g, `material.${o}.${d}`, h);
1943
+ onChange: (b, x) => {
1944
+ var S;
1945
+ a.updateObject(n.uuid, `material.${r}.${d}`, x);
1946
+ const C = (S = a.scene) == null ? void 0 : S.getObjectByProperty("uuid", n.uuid);
1947
+ C !== void 0 && ee(C, `material.${r}.${d}`, x);
1900
1948
  }
1901
1949
  });
1902
1950
  break;
1903
1951
  case "object":
1904
- m.value !== void 0 && m.value.src !== void 0 ? s.push({
1905
- title: Se(d),
1952
+ p.value !== void 0 && p.value.src !== void 0 ? l.push({
1953
+ title: _e(d),
1906
1954
  type: "image",
1907
- value: m.value.src,
1908
- onChange: (f, h) => {
1909
- var E;
1910
- a.createTexture(n.uuid, `material.${o}.${d}.value`, h);
1911
- const g = (E = a.scene) == null ? void 0 : E.getObjectByProperty("uuid", n.uuid);
1912
- g !== void 0 && Tt(h).then((w) => {
1913
- K(g, `material.${o}.${d}.value`, w);
1955
+ value: p.value.src,
1956
+ onChange: (b, x) => {
1957
+ var S;
1958
+ a.createTexture(n.uuid, `material.${r}.${d}.value`, x);
1959
+ const C = (S = a.scene) == null ? void 0 : S.getObjectByProperty("uuid", n.uuid);
1960
+ C !== void 0 && Dt(x).then((F) => {
1961
+ ee(C, `material.${r}.${d}.value`, F);
1914
1962
  });
1915
1963
  }
1916
- }) : s.push({
1964
+ }) : l.push({
1917
1965
  title: d,
1918
- type: `${typeof m.value}`,
1919
- value: m.value,
1920
- onChange: (f, h) => {
1921
- var E;
1922
- a.updateObject(n.uuid, `material.${o}.${d}.value`, h);
1923
- const g = (E = a.scene) == null ? void 0 : E.getObjectByProperty("uuid", n.uuid);
1924
- g !== void 0 && K(g, `material.${o}.${d}.value`, h);
1966
+ type: `${typeof p.value}`,
1967
+ value: p.value,
1968
+ onChange: (b, x) => {
1969
+ var S;
1970
+ a.updateObject(n.uuid, `material.${r}.${d}.value`, x);
1971
+ const C = (S = a.scene) == null ? void 0 : S.getObjectByProperty("uuid", n.uuid);
1972
+ C !== void 0 && ee(C, `material.${r}.${d}.value`, x);
1925
1973
  }
1926
1974
  });
1927
1975
  break;
1928
1976
  }
1929
1977
  }
1930
- s.length > 0 && e.push({
1931
- title: Se(o),
1932
- items: s
1978
+ l.length > 0 && e.push({
1979
+ title: _e(r),
1980
+ items: l
1933
1981
  });
1934
1982
  }
1935
1983
  else
1936
- c !== void 0 && console.log("other:", o, u, c);
1984
+ c !== void 0 && console.log("other:", r, s, c);
1937
1985
  }
1938
- return e.sort((o, u) => o.title < u.title ? -1 : o.title > u.title ? 1 : 0), e.push({
1986
+ return e.sort((r, s) => r.title < s.title ? -1 : r.title > s.title ? 1 : 0), e.push({
1939
1987
  title: "Update Material",
1940
1988
  type: "button",
1941
1989
  onChange: () => {
@@ -1943,104 +1991,105 @@ function $t(t, n, a) {
1943
1991
  }
1944
1992
  }), e;
1945
1993
  }
1946
- function cr(t, n) {
1994
+ function Oa(t, n) {
1947
1995
  const a = t.material;
1948
1996
  if (Array.isArray(a)) {
1949
- const e = [], o = a.length;
1950
- for (let u = 0; u < o; u++)
1997
+ const e = [], r = a.length;
1998
+ for (let s = 0; s < r; s++)
1951
1999
  e.push(
1952
- /* @__PURE__ */ l.jsx(
1953
- $e,
2000
+ /* @__PURE__ */ u.jsx(
2001
+ Le,
1954
2002
  {
1955
- title: `Material ${u}`,
1956
- items: $t(a[u], t, n)
1957
- }
2003
+ title: `Material ${s}`,
2004
+ items: Kt(a[s], t, n)
2005
+ },
2006
+ `Material ${s}`
1958
2007
  )
1959
2008
  );
1960
- return /* @__PURE__ */ l.jsx(l.Fragment, { children: e });
2009
+ return /* @__PURE__ */ u.jsx(u.Fragment, { children: e });
1961
2010
  } else
1962
- return /* @__PURE__ */ l.jsx(
1963
- $e,
2011
+ return /* @__PURE__ */ u.jsx(
2012
+ Le,
1964
2013
  {
1965
2014
  title: "Material",
1966
- items: $t(a, t, n)
2015
+ items: Kt(a, t, n)
1967
2016
  }
1968
2017
  );
1969
2018
  }
1970
- function et(t) {
2019
+ function at(t) {
1971
2020
  let n = t.value;
1972
- n !== void 0 && n.isColor !== void 0 && (n = Nn(t.value));
1973
- const [a, e] = ie(n), o = Oe(null), u = Oe(null), c = Oe(null);
1974
- tt(() => {
1975
- var X;
1976
- let v = !1, f = -1, h = 0, g = Number(a);
1977
- const E = (Z) => {
1978
- v = !0, h = g, f = Z.clientX;
1979
- }, w = (Z) => {
1980
- if (!v)
2021
+ n !== void 0 && n.isColor !== void 0 && (n = Jn(t.value));
2022
+ const [a, e] = ie(n), r = xe(null), s = xe(null), c = xe(null);
2023
+ Ne(() => {
2024
+ var K;
2025
+ let m = !1, b = -1, x = 0, C = Number(a);
2026
+ const S = (de) => {
2027
+ m = !0, x = C, b = de.clientX;
2028
+ }, F = (de) => {
2029
+ if (!m)
1981
2030
  return;
1982
- const z = t.step !== void 0 ? t.step : 1, O = (Z.clientX - f) * z;
1983
- g = Number((h + O).toFixed(4)), u.current !== null && (u.current.value = g.toString()), t.onChange !== void 0 && t.onChange(t.prop !== void 0 ? t.prop : t.title, g);
1984
- }, A = () => {
1985
- v = !1;
1986
- }, U = () => {
1987
- v = !1;
1988
- }, j = t.type === "number";
1989
- return j && ((X = o.current) == null || X.addEventListener("mousedown", E, !1), document.addEventListener("mouseup", A, !1), document.addEventListener("mousemove", w, !1), document.addEventListener("contextmenu", U, !1)), () => {
1990
- var Z;
1991
- j && ((Z = o.current) == null || Z.removeEventListener("mousedown", E), document.removeEventListener("mouseup", A), document.removeEventListener("mousemove", w), document.removeEventListener("contextmenu", U));
2031
+ const ce = t.step !== void 0 ? t.step : 1, te = (de.clientX - b) * ce;
2032
+ C = Number((x + te).toFixed(4)), s.current !== null && (s.current.value = C.toString()), t.onChange !== void 0 && t.onChange(t.prop !== void 0 ? t.prop : t.title, C);
2033
+ }, Q = () => {
2034
+ m = !1;
2035
+ }, H = () => {
2036
+ m = !1;
2037
+ }, O = t.type === "number";
2038
+ return O && ((K = r.current) == null || K.addEventListener("mousedown", S, !1), document.addEventListener("mouseup", Q, !1), document.addEventListener("mousemove", F, !1), document.addEventListener("contextmenu", H, !1)), () => {
2039
+ var de;
2040
+ O && ((de = r.current) == null || de.removeEventListener("mousedown", S), document.removeEventListener("mouseup", Q), document.removeEventListener("mousemove", F), document.removeEventListener("contextmenu", H));
1992
2041
  };
1993
2042
  }, [a]);
1994
- const s = t.type === "string" && (a.length > 100 || a.search(`
1995
- `) > -1), d = s || t.type === "image", m = (v) => {
1996
- let f = v.target.value;
1997
- t.type === "boolean" && (f = v.target.checked), e(f), t.onChange !== void 0 && t.onChange(t.prop !== void 0 ? t.prop : t.title, f);
2043
+ const l = t.type === "string" && (a.length > 100 || a.search(`
2044
+ `) > -1), d = l || t.type === "image", p = (m) => {
2045
+ let b = m.target.value;
2046
+ t.type === "boolean" && (b = m.target.checked), e(b), t.onChange !== void 0 && t.onChange(t.prop !== void 0 ? t.prop : t.title, b);
1998
2047
  };
1999
- return /* @__PURE__ */ l.jsxs("div", { className: `field ${d ? "block" : ""}`, children: [
2000
- t.type !== "button" && /* @__PURE__ */ l.jsx("label", { ref: o, children: t.title }, "fieldLabel"),
2001
- t.type === "string" && !s && /* @__PURE__ */ l.jsx(
2048
+ return /* @__PURE__ */ u.jsxs("div", { className: `field ${d ? "block" : ""}`, children: [
2049
+ t.type !== "button" && /* @__PURE__ */ u.jsx("label", { ref: r, children: t.title }, "fieldLabel"),
2050
+ t.type === "string" && !l && /* @__PURE__ */ u.jsx(
2002
2051
  "input",
2003
2052
  {
2004
2053
  type: "text",
2005
2054
  disabled: t.disabled,
2006
- onChange: m,
2055
+ onChange: p,
2007
2056
  value: a
2008
2057
  }
2009
2058
  ),
2010
- t.type === "string" && s && /* @__PURE__ */ l.jsx(
2059
+ t.type === "string" && l && /* @__PURE__ */ u.jsx(
2011
2060
  "textarea",
2012
2061
  {
2013
2062
  cols: 50,
2014
2063
  rows: 10,
2015
2064
  disabled: !0,
2016
- onChange: m,
2065
+ onChange: p,
2017
2066
  value: a
2018
2067
  }
2019
2068
  ),
2020
- t.type === "boolean" && /* @__PURE__ */ l.jsx(
2069
+ t.type === "boolean" && /* @__PURE__ */ u.jsx(
2021
2070
  "input",
2022
2071
  {
2023
2072
  type: "checkbox",
2024
2073
  disabled: t.disabled,
2025
- onChange: m,
2074
+ onChange: p,
2026
2075
  checked: a
2027
2076
  }
2028
2077
  ),
2029
- t.type === "number" && /* @__PURE__ */ l.jsx(
2078
+ t.type === "number" && /* @__PURE__ */ u.jsx(
2030
2079
  "input",
2031
2080
  {
2032
- ref: u,
2081
+ ref: s,
2033
2082
  type: "number",
2034
2083
  value: a,
2035
2084
  min: t.min,
2036
2085
  max: t.max,
2037
2086
  step: t.step,
2038
- onChange: m
2087
+ onChange: p
2039
2088
  }
2040
2089
  ),
2041
- t.type === "range" && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
2042
- /* @__PURE__ */ l.jsx("input", { type: "text", value: a.toString(), onChange: m, className: "min" }),
2043
- /* @__PURE__ */ l.jsx(
2090
+ t.type === "range" && /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
2091
+ /* @__PURE__ */ u.jsx("input", { type: "text", value: a.toString(), onChange: p, className: "min" }),
2092
+ /* @__PURE__ */ u.jsx(
2044
2093
  "input",
2045
2094
  {
2046
2095
  disabled: t.disabled,
@@ -2049,15 +2098,15 @@ function et(t) {
2049
2098
  min: t.min,
2050
2099
  max: t.max,
2051
2100
  step: t.step,
2052
- onChange: m
2101
+ onChange: p
2053
2102
  }
2054
2103
  )
2055
2104
  ] }),
2056
- t.type === "color" && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
2057
- /* @__PURE__ */ l.jsx("input", { type: "text", value: a.toString(), onChange: m, className: "color" }),
2058
- /* @__PURE__ */ l.jsx("input", { type: "color", value: a, onChange: m })
2105
+ t.type === "color" && /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
2106
+ /* @__PURE__ */ u.jsx("input", { type: "text", value: a.toString(), onChange: p, className: "color" }),
2107
+ /* @__PURE__ */ u.jsx("input", { type: "color", value: a, onChange: p })
2059
2108
  ] }),
2060
- t.type === "button" && /* @__PURE__ */ l.jsx(
2109
+ t.type === "button" && /* @__PURE__ */ u.jsx(
2061
2110
  "button",
2062
2111
  {
2063
2112
  onClick: () => {
@@ -2066,14 +2115,14 @@ function et(t) {
2066
2115
  children: t.title
2067
2116
  }
2068
2117
  ),
2069
- t.type === "image" && /* @__PURE__ */ l.jsx("img", { ref: c, onClick: () => {
2070
- sr().then((v) => {
2071
- c.current.src = v, t.onChange !== void 0 && t.onChange(t.prop !== void 0 ? t.prop : t.title, v);
2118
+ t.type === "image" && /* @__PURE__ */ u.jsx("img", { ref: c, onClick: () => {
2119
+ Sa().then((m) => {
2120
+ c.current.src = m, t.onChange !== void 0 && t.onChange(t.prop !== void 0 ? t.prop : t.title, m);
2072
2121
  });
2073
- }, src: a.length > 0 ? a : rr })
2122
+ }, src: a.length > 0 ? a : Ea })
2074
2123
  ] });
2075
2124
  }
2076
- function Gt(t) {
2125
+ function Xt(t) {
2077
2126
  switch (t) {
2078
2127
  case "fov":
2079
2128
  return "FOV";
@@ -2102,157 +2151,154 @@ function Gt(t) {
2102
2151
  }
2103
2152
  return t;
2104
2153
  }
2105
- function lr(t, n) {
2154
+ function Ta(t, n) {
2106
2155
  const a = [];
2107
2156
  if (t.perspectiveCameraInfo !== void 0)
2108
2157
  for (const e in t.perspectiveCameraInfo)
2109
2158
  a.push({
2110
- title: Gt(e),
2159
+ title: Xt(e),
2111
2160
  prop: e,
2112
2161
  type: "number",
2113
2162
  step: 0.01,
2114
2163
  value: t.perspectiveCameraInfo[e],
2115
- onChange: (o, u) => {
2116
- var s;
2117
- n.updateObject(t.uuid, o, u), n.requestMethod(t.uuid, "updateProjectionMatrix");
2118
- const c = (s = n.scene) == null ? void 0 : s.getObjectByProperty("uuid", t.uuid);
2119
- c !== void 0 && (K(c, o, u), c.updateProjectionMatrix());
2164
+ onChange: (r, s) => {
2165
+ var l;
2166
+ n.updateObject(t.uuid, r, s), n.requestMethod(t.uuid, "updateProjectionMatrix");
2167
+ const c = (l = n.scene) == null ? void 0 : l.getObjectByProperty("uuid", t.uuid);
2168
+ c !== void 0 && (ee(c, r, s), c.updateProjectionMatrix());
2120
2169
  }
2121
2170
  });
2122
2171
  else if (t.orthographicCameraInfo !== void 0)
2123
2172
  for (const e in t.orthographicCameraInfo)
2124
2173
  a.push({
2125
- title: Gt(e),
2174
+ title: Xt(e),
2126
2175
  prop: e,
2127
2176
  type: "number",
2128
2177
  step: 0.01,
2129
2178
  value: t.perspectiveCameraInfo[e],
2130
- onChange: (o, u) => {
2131
- var s;
2132
- n.updateObject(t.uuid, o, u), n.requestMethod(t.uuid, "updateProjectionMatrix");
2133
- const c = (s = n.scene) == null ? void 0 : s.getObjectByProperty("uuid", t.uuid);
2134
- c !== void 0 && (K(c, o, u), c.updateProjectionMatrix());
2179
+ onChange: (r, s) => {
2180
+ var l;
2181
+ n.updateObject(t.uuid, r, s), n.requestMethod(t.uuid, "updateProjectionMatrix");
2182
+ const c = (l = n.scene) == null ? void 0 : l.getObjectByProperty("uuid", t.uuid);
2183
+ c !== void 0 && (ee(c, r, s), c.updateProjectionMatrix());
2135
2184
  }
2136
2185
  });
2137
- return /* @__PURE__ */ l.jsx(
2138
- $e,
2186
+ return /* @__PURE__ */ u.jsx(
2187
+ Le,
2139
2188
  {
2140
2189
  title: "Camera",
2141
2190
  items: a
2142
2191
  }
2143
2192
  );
2144
2193
  }
2145
- function ur(t, n) {
2146
- const a = new yn();
2194
+ const Ma = Math.PI / 180, Ra = 180 / Math.PI;
2195
+ function We(t, n, a, e, r) {
2196
+ return e + (t - n) * (r - e) / (a - n);
2197
+ }
2198
+ function Pa(t) {
2199
+ return t * Ma;
2200
+ }
2201
+ function jt(t) {
2202
+ return t * Ra;
2203
+ }
2204
+ function ja(t, n) {
2205
+ const a = new kn();
2147
2206
  a.elements = t.matrix;
2148
- const e = new I(), o = new En(), u = new I();
2149
- t.uuid.length > 0 && (e.setFromMatrixPosition(a), o.setFromRotationMatrix(a), u.setFromMatrixScale(a));
2150
- const c = (d, m) => {
2151
- var f;
2152
- n.updateObject(t.uuid, d, m);
2153
- const v = (f = n.scene) == null ? void 0 : f.getObjectByProperty("uuid", t.uuid);
2154
- v !== void 0 && K(v, d, m);
2155
- }, s = [
2207
+ const e = new Y(), r = new An(), s = new Y();
2208
+ t.uuid.length > 0 && (e.setFromMatrixPosition(a), r.setFromRotationMatrix(a), s.setFromMatrixScale(a));
2209
+ const c = (d, p) => {
2210
+ var b;
2211
+ n.updateObject(t.uuid, d, p);
2212
+ const m = (b = n.scene) == null ? void 0 : b.getObjectByProperty("uuid", t.uuid);
2213
+ m !== void 0 && ee(m, d, p);
2214
+ }, l = (d, p) => {
2215
+ c(d, Pa(p));
2216
+ };
2217
+ return /* @__PURE__ */ u.jsx(
2218
+ Le,
2156
2219
  {
2157
- title: "Position",
2220
+ title: "Transform",
2158
2221
  items: [
2159
2222
  {
2160
- title: "X",
2223
+ title: "Position X",
2161
2224
  prop: "position.x",
2162
2225
  type: "number",
2163
2226
  value: e.x,
2164
2227
  onChange: c
2165
2228
  },
2166
2229
  {
2167
- title: "Y",
2230
+ title: "Position Y",
2168
2231
  prop: "position.y",
2169
2232
  type: "number",
2170
2233
  value: e.y,
2171
2234
  onChange: c
2172
2235
  },
2173
2236
  {
2174
- title: "Z",
2237
+ title: "Position Z",
2175
2238
  prop: "position.z",
2176
2239
  type: "number",
2177
2240
  value: e.z,
2178
2241
  onChange: c
2179
- }
2180
- ]
2181
- },
2182
- {
2183
- title: "Rotation",
2184
- items: [
2242
+ },
2185
2243
  {
2186
- title: "X",
2244
+ title: "Rotation X",
2187
2245
  prop: "rotation.x",
2188
2246
  type: "number",
2189
- value: o.x,
2190
- min: -Math.PI,
2191
- max: Math.PI,
2192
- step: 0.01,
2193
- onChange: c
2247
+ value: Rt(jt(r.x)),
2248
+ min: -360,
2249
+ max: 360,
2250
+ step: 0.1,
2251
+ onChange: l
2194
2252
  },
2195
2253
  {
2196
- title: "Y",
2254
+ title: "Rotation Y",
2197
2255
  prop: "rotation.y",
2198
2256
  type: "number",
2199
- value: o.y,
2200
- min: -Math.PI,
2201
- max: Math.PI,
2202
- step: 0.01,
2203
- onChange: c
2257
+ value: Rt(jt(r.y)),
2258
+ min: -360,
2259
+ max: 360,
2260
+ step: 0.1,
2261
+ onChange: l
2204
2262
  },
2205
2263
  {
2206
- title: "Z",
2264
+ title: "Rotation Z",
2207
2265
  prop: "rotation.z",
2208
2266
  type: "number",
2209
- value: o.z,
2210
- min: -Math.PI,
2211
- max: Math.PI,
2212
- step: 0.01,
2213
- onChange: c
2214
- }
2215
- ]
2216
- },
2217
- {
2218
- title: "Scale",
2219
- items: [
2267
+ value: Rt(jt(r.z)),
2268
+ min: -360,
2269
+ max: 360,
2270
+ step: 0.1,
2271
+ onChange: l
2272
+ },
2220
2273
  {
2221
- title: "X",
2274
+ title: "Scale X",
2222
2275
  prop: "scale.x",
2223
2276
  type: "number",
2224
- value: u.x,
2277
+ value: s.x,
2225
2278
  step: 0.01,
2226
2279
  onChange: c
2227
2280
  },
2228
2281
  {
2229
- title: "Y",
2282
+ title: "Scale Y",
2230
2283
  prop: "scale.y",
2231
2284
  type: "number",
2232
- value: u.y,
2285
+ value: s.y,
2233
2286
  step: 0.01,
2234
2287
  onChange: c
2235
2288
  },
2236
2289
  {
2237
- title: "Z",
2290
+ title: "Scale Z",
2238
2291
  prop: "scale.z",
2239
2292
  type: "number",
2240
- value: u.z,
2293
+ value: s.z,
2241
2294
  step: 0.01,
2242
2295
  onChange: c
2243
2296
  }
2244
2297
  ]
2245
2298
  }
2246
- ];
2247
- return /* @__PURE__ */ l.jsx(
2248
- $e,
2249
- {
2250
- title: "Transform",
2251
- items: s
2252
- }
2253
2299
  );
2254
2300
  }
2255
- function Vt(t) {
2301
+ function qt(t) {
2256
2302
  switch (t) {
2257
2303
  case "color":
2258
2304
  return "Color";
@@ -2271,71 +2317,120 @@ function Vt(t) {
2271
2317
  }
2272
2318
  return t;
2273
2319
  }
2274
- function dr(t, n) {
2320
+ function _a(t, n) {
2275
2321
  const a = [];
2276
2322
  if (t.lightInfo !== void 0)
2277
2323
  for (const e in t.lightInfo) {
2278
- const o = t.lightInfo[e];
2279
- o !== void 0 && (o.isColor !== void 0 ? a.push({
2280
- title: Vt(e),
2324
+ const r = t.lightInfo[e];
2325
+ r !== void 0 && (r.isColor !== void 0 ? a.push({
2326
+ title: qt(e),
2281
2327
  prop: e,
2282
2328
  type: "color",
2283
- value: o,
2284
- onChange: (u, c) => {
2285
- var m;
2286
- const s = new Pt(c);
2287
- n.updateObject(t.uuid, u, s);
2288
- const d = (m = n.scene) == null ? void 0 : m.getObjectByProperty("uuid", t.uuid);
2289
- d !== void 0 && K(d, u, s);
2329
+ value: r,
2330
+ onChange: (s, c) => {
2331
+ var p;
2332
+ const l = new Nt(c);
2333
+ n.updateObject(t.uuid, s, l);
2334
+ const d = (p = n.scene) == null ? void 0 : p.getObjectByProperty("uuid", t.uuid);
2335
+ d !== void 0 && ee(d, s, l);
2290
2336
  }
2291
2337
  }) : a.push({
2292
- title: Vt(e),
2338
+ title: qt(e),
2293
2339
  prop: e,
2294
- type: typeof o,
2295
- value: o,
2296
- step: typeof o == "number" ? 0.01 : void 0,
2297
- onChange: (u, c) => {
2340
+ type: typeof r,
2341
+ value: r,
2342
+ step: typeof r == "number" ? 0.01 : void 0,
2343
+ onChange: (s, c) => {
2298
2344
  var d;
2299
- n.updateObject(t.uuid, u, c);
2300
- const s = (d = n.scene) == null ? void 0 : d.getObjectByProperty("uuid", t.uuid);
2301
- s !== void 0 && K(s, u, c);
2345
+ n.updateObject(t.uuid, s, c);
2346
+ const l = (d = n.scene) == null ? void 0 : d.getObjectByProperty("uuid", t.uuid);
2347
+ l !== void 0 && ee(l, s, c);
2302
2348
  }
2303
2349
  }));
2304
2350
  }
2305
- return /* @__PURE__ */ l.jsx(
2306
- $e,
2351
+ return /* @__PURE__ */ u.jsx(
2352
+ Le,
2307
2353
  {
2308
2354
  title: "Light",
2309
2355
  items: a
2310
2356
  }
2311
2357
  );
2312
2358
  }
2313
- function fr(t) {
2314
- const [n, a] = ie(-1), [e, o] = ie({
2359
+ function ka(t, n) {
2360
+ const a = [];
2361
+ return t.animations.forEach((e) => {
2362
+ a.push({
2363
+ title: "Name",
2364
+ type: "string",
2365
+ prop: "name",
2366
+ value: e.name,
2367
+ disabled: !0,
2368
+ onChange: (r, s) => {
2369
+ var l;
2370
+ n.updateObject(t.uuid, r, s);
2371
+ const c = (l = n.scene) == null ? void 0 : l.getObjectByProperty("uuid", t.uuid);
2372
+ c !== void 0 && ee(c, r, s);
2373
+ }
2374
+ }), a.push({
2375
+ title: "Duration",
2376
+ type: "number",
2377
+ prop: "duration",
2378
+ value: e.duration,
2379
+ disabled: !0,
2380
+ onChange: (r, s) => {
2381
+ var l;
2382
+ n.updateObject(t.uuid, r, s);
2383
+ const c = (l = n.scene) == null ? void 0 : l.getObjectByProperty("uuid", t.uuid);
2384
+ c !== void 0 && ee(c, r, s);
2385
+ }
2386
+ }), a.push({
2387
+ title: "Blend Mode",
2388
+ type: "number",
2389
+ prop: "blendMode",
2390
+ value: e.blendMode,
2391
+ disabled: !0,
2392
+ onChange: (r, s) => {
2393
+ var l;
2394
+ n.updateObject(t.uuid, r, s);
2395
+ const c = (l = n.scene) == null ? void 0 : l.getObjectByProperty("uuid", t.uuid);
2396
+ c !== void 0 && ee(c, r, s);
2397
+ }
2398
+ });
2399
+ }), /* @__PURE__ */ u.jsx(Le, { title: "Animations", items: a });
2400
+ }
2401
+ function Aa(t) {
2402
+ const [n, a] = ie(-1), [e, r] = ie({
2315
2403
  name: "",
2316
2404
  uuid: "",
2317
2405
  type: "",
2318
2406
  visible: !1,
2319
2407
  matrix: [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1],
2408
+ animations: [],
2320
2409
  material: void 0,
2321
2410
  perspectiveCameraInfo: void 0,
2322
2411
  orthographicCameraInfo: void 0,
2323
2412
  lightInfo: void 0
2324
2413
  });
2325
- tt(() => {
2326
- function c(s) {
2327
- const d = s.value;
2328
- o(d), a(Date.now());
2414
+ Ne(() => {
2415
+ function c(l) {
2416
+ const d = l.value;
2417
+ if (r(d), a(Date.now()), t.three.scene !== void 0) {
2418
+ const p = t.three.scene.getObjectByProperty("uuid", d.uuid);
2419
+ if (p !== void 0 && p.animations.length > 0) {
2420
+ const m = new Dn(p);
2421
+ console.log(m), console.log(p.animations);
2422
+ }
2423
+ }
2329
2424
  }
2330
- return k.addEventListener(D.SET_OBJECT, c), () => {
2331
- k.removeEventListener(D.SET_OBJECT, c);
2425
+ return k.addEventListener(A.SET_OBJECT, c), () => {
2426
+ k.removeEventListener(A.SET_OBJECT, c);
2332
2427
  };
2333
2428
  }, []);
2334
- const u = e.type.toLowerCase();
2335
- return /* @__PURE__ */ l.jsx("div", { id: "Inspector", className: t.class, children: e.uuid.length > 0 && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
2336
- /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
2337
- /* @__PURE__ */ l.jsx(
2338
- et,
2429
+ const s = e.type.toLowerCase();
2430
+ return /* @__PURE__ */ u.jsx(Lt, { label: "Inspector", children: /* @__PURE__ */ u.jsx("div", { id: "Inspector", className: t.class, children: e.uuid.length > 0 && /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
2431
+ /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
2432
+ /* @__PURE__ */ u.jsx(
2433
+ at,
2339
2434
  {
2340
2435
  type: "string",
2341
2436
  title: "Name",
@@ -2344,8 +2439,8 @@ function fr(t) {
2344
2439
  disabled: !0
2345
2440
  }
2346
2441
  ),
2347
- /* @__PURE__ */ l.jsx(
2348
- et,
2442
+ /* @__PURE__ */ u.jsx(
2443
+ at,
2349
2444
  {
2350
2445
  type: "string",
2351
2446
  title: "Type",
@@ -2354,8 +2449,8 @@ function fr(t) {
2354
2449
  disabled: !0
2355
2450
  }
2356
2451
  ),
2357
- /* @__PURE__ */ l.jsx(
2358
- et,
2452
+ /* @__PURE__ */ u.jsx(
2453
+ at,
2359
2454
  {
2360
2455
  type: "string",
2361
2456
  title: "UUID",
@@ -2364,152 +2459,153 @@ function fr(t) {
2364
2459
  disabled: !0
2365
2460
  }
2366
2461
  ),
2367
- /* @__PURE__ */ l.jsx(
2368
- et,
2462
+ /* @__PURE__ */ u.jsx(
2463
+ at,
2369
2464
  {
2370
2465
  type: "boolean",
2371
2466
  title: "Visible",
2372
2467
  prop: "visible",
2373
2468
  value: e.visible,
2374
- onChange: (c, s) => {
2375
- var m;
2376
- t.three.updateObject(e.uuid, c, s);
2377
- const d = (m = t.three.scene) == null ? void 0 : m.getObjectByProperty("uuid", e.uuid);
2378
- d !== void 0 && K(d, c, s);
2469
+ onChange: (c, l) => {
2470
+ var p;
2471
+ t.three.updateObject(e.uuid, c, l);
2472
+ const d = (p = t.three.scene) == null ? void 0 : p.getObjectByProperty("uuid", e.uuid);
2473
+ d !== void 0 && ee(d, c, l);
2379
2474
  }
2380
2475
  }
2381
2476
  )
2382
2477
  ] }),
2383
- /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
2384
- ur(e, t.three),
2385
- u.search("camera") > -1 ? lr(e, t.three) : null,
2386
- u.search("light") > -1 ? dr(e, t.three) : null,
2387
- u.search("mesh") > -1 ? cr(e, t.three) : null
2478
+ /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
2479
+ ja(e, t.three),
2480
+ e.animations.length > 0 ? ka(e, t.three) : null,
2481
+ s.search("camera") > -1 ? Ta(e, t.three) : null,
2482
+ s.search("light") > -1 ? _a(e, t.three) : null,
2483
+ s.search("mesh") > -1 ? Oa(e, t.three) : null
2388
2484
  ] })
2389
- ] }) }, n);
2485
+ ] }) }, n) }, "Inspector");
2390
2486
  }
2391
- class Ir extends kn {
2487
+ class ai extends Kn {
2392
2488
  constructor(a) {
2393
2489
  super(a);
2394
- L(this, "three");
2490
+ Z(this, "three");
2395
2491
  // Private
2396
- L(this, "onRefresh", () => {
2397
- this.three.getScene();
2398
- });
2399
- L(this, "setScene", (a) => {
2492
+ Z(this, "setScene", (a) => {
2400
2493
  this.setState(() => ({
2401
2494
  scene: a.value
2402
2495
  }));
2403
2496
  });
2404
2497
  this.state = {
2405
2498
  scene: a.scene !== void 0 ? a.scene : null
2406
- }, this.three = a.three, k.addEventListener(D.SET_SCENE, this.setScene);
2407
- }
2408
- componentDidMount() {
2409
- this.onRefresh();
2499
+ }, this.three = a.three, k.addEventListener(A.SET_SCENE, this.setScene);
2410
2500
  }
2411
2501
  componentWillUnmount() {
2412
- k.removeEventListener(D.SET_SCENE, this.setScene);
2502
+ k.removeEventListener(A.SET_SCENE, this.setScene);
2413
2503
  }
2414
2504
  render() {
2415
- var o;
2416
- const a = this.componentState.scene !== null, e = "Hierarchy" + (a ? `: ${(o = this.componentState.scene) == null ? void 0 : o.name}` : "");
2417
- return /* @__PURE__ */ l.jsx("div", { id: "SceneHierarchy", children: /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
2418
- a && /* @__PURE__ */ l.jsx(
2419
- Mt,
2420
- {
2421
- label: e,
2422
- button: /* @__PURE__ */ l.jsx("button", { className: "icon refresh hideText", onClick: this.onRefresh, children: "Refresh" }),
2423
- open: !0,
2424
- children: /* @__PURE__ */ l.jsx(nr, { child: this.componentState.scene, three: this.three })
2425
- }
2426
- ),
2427
- /* @__PURE__ */ l.jsx(Mt, { label: "Inspector", children: /* @__PURE__ */ l.jsx(fr, { three: this.three }, "Inspector") })
2428
- ] }) }, "SceneHierarchy");
2505
+ var r;
2506
+ const a = this.componentState.scene !== null, e = "Hierarchy - " + (a ? `${(r = this.componentState.scene) == null ? void 0 : r.name}` : "No Scene");
2507
+ return /* @__PURE__ */ u.jsx("div", { id: "SidePanel", children: /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
2508
+ /* @__PURE__ */ u.jsx(Lt, { label: e, open: !0, children: /* @__PURE__ */ u.jsx(u.Fragment, { children: a && /* @__PURE__ */ u.jsx(ya, { child: this.componentState.scene, three: this.three }) }) }),
2509
+ /* @__PURE__ */ u.jsx(Aa, { three: this.three })
2510
+ ] }) }, "SidePanel");
2429
2511
  }
2430
2512
  // Getters / Setters
2431
2513
  get componentState() {
2432
2514
  return this.state;
2433
2515
  }
2434
2516
  }
2435
- function Ar(t) {
2436
- const n = (s) => {
2437
- const d = t.scene.getObjectByProperty("uuid", s.value);
2517
+ function ii(t) {
2518
+ function n() {
2519
+ return t.three.scene === void 0 ? (console.log("No scene:", t.three), !1) : !0;
2520
+ }
2521
+ const a = (l) => {
2522
+ var p;
2523
+ if (!n())
2524
+ return;
2525
+ const d = (p = t.three.scene) == null ? void 0 : p.getObjectByProperty("uuid", l.value);
2438
2526
  d !== void 0 && t.three.setObject(d);
2439
- }, a = (s, d, m) => {
2440
- const v = t.scene.getObjectByProperty("uuid", s);
2441
- v !== void 0 && K(v, d, m);
2442
- }, e = (s) => {
2443
- const d = s.value, { key: m, value: v, uuid: f } = d;
2444
- a(f, m, v);
2445
- }, o = (s) => {
2446
- const d = s.value;
2447
- Tt(d.value).then((m) => {
2448
- a(d.uuid, d.key, m), a(d.uuid, "material.needsUpdate", !0);
2527
+ }, e = (l, d, p) => {
2528
+ var b;
2529
+ if (!n())
2530
+ return;
2531
+ const m = (b = t.three.scene) == null ? void 0 : b.getObjectByProperty("uuid", l);
2532
+ m !== void 0 && ee(m, d, p);
2533
+ }, r = (l) => {
2534
+ if (!n())
2535
+ return;
2536
+ const d = l.value, { key: p, value: m, uuid: b } = d;
2537
+ e(b, p, m);
2538
+ }, s = (l) => {
2539
+ if (!n())
2540
+ return;
2541
+ const d = l.value;
2542
+ Dt(d.value).then((p) => {
2543
+ e(d.uuid, d.key, p), e(d.uuid, "material.needsUpdate", !0);
2449
2544
  });
2450
- }, u = () => {
2451
- t.three.setScene(t.scene);
2452
- }, c = (s) => {
2453
- const { key: d, uuid: m, value: v } = s.value, f = t.scene.getObjectByProperty("uuid", m);
2454
- if (f !== void 0)
2545
+ }, c = (l) => {
2546
+ var x;
2547
+ if (!n())
2548
+ return;
2549
+ const { key: d, uuid: p, value: m } = l.value, b = (x = t.three.scene) == null ? void 0 : x.getObjectByProperty("uuid", p);
2550
+ if (b !== void 0)
2455
2551
  try {
2456
- f[d](v);
2457
- } catch (h) {
2458
- console.log("Error requesting method:"), console.log(h), console.log(d), console.log(v);
2552
+ b[d](m);
2553
+ } catch (C) {
2554
+ console.log("Error requesting method:"), console.log(C), console.log(d), console.log(m);
2459
2555
  }
2460
2556
  };
2461
- return tt(() => (k.addEventListener(D.GET_OBJECT, n), k.addEventListener(D.GET_SCENE, u), k.addEventListener(D.UPDATE_OBJECT, e), k.addEventListener(D.CREATE_TEXTURE, o), k.addEventListener(D.REQUEST_METHOD, c), () => {
2462
- k.removeEventListener(D.GET_OBJECT, n), k.removeEventListener(D.GET_SCENE, u), k.removeEventListener(D.UPDATE_OBJECT, e), k.removeEventListener(D.CREATE_TEXTURE, o), k.removeEventListener(D.REQUEST_METHOD, c);
2557
+ return Ne(() => (k.addEventListener(A.GET_OBJECT, a), k.addEventListener(A.UPDATE_OBJECT, r), k.addEventListener(A.CREATE_TEXTURE, s), k.addEventListener(A.REQUEST_METHOD, c), () => {
2558
+ k.removeEventListener(A.GET_OBJECT, a), k.removeEventListener(A.UPDATE_OBJECT, r), k.removeEventListener(A.CREATE_TEXTURE, s), k.removeEventListener(A.REQUEST_METHOD, c);
2463
2559
  }), []), null;
2464
2560
  }
2465
- const Yt = { type: "change" }, wt = { type: "start" }, zt = { type: "end" }, pt = new xn(), Wt = new wn(), hr = Math.cos(70 * Cn.DEG2RAD);
2466
- class pr extends Kt {
2561
+ const Zt = { type: "change" }, _t = { type: "start" }, Jt = { type: "end" }, vt = new In(), Qt = new Nn(), Da = Math.cos(70 * Ln.DEG2RAD);
2562
+ class Ia extends nn {
2467
2563
  constructor(n, a) {
2468
- super(), this.object = n, this.domElement = a, this.domElement.style.touchAction = "none", this.enabled = !0, this.target = new I(), this.cursor = new I(), 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: Le.ROTATE, MIDDLE: Le.DOLLY, RIGHT: Le.PAN }, this.touches = { ONE: Fe.ROTATE, TWO: Fe.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this.getPolarAngle = function() {
2469
- return s.phi;
2564
+ super(), this.object = n, this.domElement = a, this.domElement.style.touchAction = "none", this.enabled = !0, this.target = new Y(), this.cursor = new Y(), 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: ze.ROTATE, MIDDLE: ze.DOLLY, RIGHT: ze.PAN }, this.touches = { ONE: Ye.ROTATE, TWO: Ye.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this.getPolarAngle = function() {
2565
+ return l.phi;
2470
2566
  }, this.getAzimuthalAngle = function() {
2471
- return s.theta;
2567
+ return l.theta;
2472
2568
  }, this.getDistance = function() {
2473
2569
  return this.object.position.distanceTo(this.target);
2474
- }, this.listenToKeyEvents = function(i) {
2475
- i.addEventListener("keydown", Xe), this._domElementKeyEvents = i;
2570
+ }, this.listenToKeyEvents = function(o) {
2571
+ o.addEventListener("keydown", Je), this._domElementKeyEvents = o;
2476
2572
  }, this.stopListenToKeyEvents = function() {
2477
- this._domElementKeyEvents.removeEventListener("keydown", Xe), this._domElementKeyEvents = null;
2573
+ this._domElementKeyEvents.removeEventListener("keydown", Je), this._domElementKeyEvents = null;
2478
2574
  }, this.saveState = function() {
2479
2575
  e.target0.copy(e.target), e.position0.copy(e.object.position), e.zoom0 = e.object.zoom;
2480
2576
  }, this.reset = function() {
2481
- e.target.copy(e.target0), e.object.position.copy(e.position0), e.object.zoom = e.zoom0, e.object.updateProjectionMatrix(), e.dispatchEvent(Yt), e.update(), u = o.NONE;
2577
+ e.target.copy(e.target0), e.object.position.copy(e.position0), e.object.zoom = e.zoom0, e.object.updateProjectionMatrix(), e.dispatchEvent(Zt), e.update(), s = r.NONE;
2482
2578
  }, this.update = function() {
2483
- const i = new I(), y = new At().setFromUnitVectors(n.up, new I(0, 1, 0)), R = y.clone().invert(), P = new I(), V = new At(), ce = new I(), q = 2 * Math.PI;
2484
- return function(ht = null) {
2485
- const le = e.object.position;
2486
- i.copy(le).sub(e.target), i.applyQuaternion(y), s.setFromVector3(i), e.autoRotate && u === o.NONE && ve(ge(ht)), e.enableDamping ? (s.theta += d.theta * e.dampingFactor, s.phi += d.phi * e.dampingFactor) : (s.theta += d.theta, s.phi += d.phi);
2487
- let J = e.minAzimuthAngle, Q = e.maxAzimuthAngle;
2488
- isFinite(J) && isFinite(Q) && (J < -Math.PI ? J += q : J > Math.PI && (J -= q), Q < -Math.PI ? Q += q : Q > Math.PI && (Q -= q), J <= Q ? s.theta = Math.max(J, Math.min(Q, s.theta)) : s.theta = s.theta > (J + Q) / 2 ? Math.max(J, s.theta) : Math.min(Q, s.theta)), s.phi = Math.max(e.minPolarAngle, Math.min(e.maxPolarAngle, s.phi)), s.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 && O || e.object.isOrthographicCamera ? s.radius = _e(s.radius) : s.radius = _e(s.radius * m), i.setFromSpherical(s), i.applyQuaternion(R), le.copy(e.target).add(i), e.object.lookAt(e.target), e.enableDamping === !0 ? (d.theta *= 1 - e.dampingFactor, d.phi *= 1 - e.dampingFactor, v.multiplyScalar(1 - e.dampingFactor)) : (d.set(0, 0, 0), v.set(0, 0, 0));
2489
- let Ie = !1;
2490
- if (e.zoomToCursor && O) {
2491
- let Ce = null;
2579
+ const o = new Y(), E = new Vt().setFromUnitVectors(n.up, new Y(0, 1, 0)), _ = E.clone().invert(), N = new Y(), ne = new Vt(), ve = new Y(), le = 2 * Math.PI;
2580
+ return function(gt = null) {
2581
+ const be = e.object.position;
2582
+ o.copy(be).sub(e.target), o.applyQuaternion(E), l.setFromVector3(o), e.autoRotate && s === r.NONE && V(y(gt)), e.enableDamping ? (l.theta += d.theta * e.dampingFactor, l.phi += d.phi * e.dampingFactor) : (l.theta += d.theta, l.phi += d.phi);
2583
+ let fe = e.minAzimuthAngle, he = e.maxAzimuthAngle;
2584
+ isFinite(fe) && isFinite(he) && (fe < -Math.PI ? fe += le : fe > Math.PI && (fe -= le), he < -Math.PI ? he += le : he > Math.PI && (he -= le), fe <= he ? l.theta = Math.max(fe, Math.min(he, l.theta)) : l.theta = l.theta > (fe + he) / 2 ? Math.max(fe, l.theta) : Math.min(he, l.theta)), l.phi = Math.max(e.minPolarAngle, Math.min(e.maxPolarAngle, l.phi)), l.makeSafe(), e.enableDamping === !0 ? e.target.addScaledVector(m, e.dampingFactor) : e.target.add(m), e.target.sub(e.cursor), e.target.clampLength(e.minTargetRadius, e.maxTargetRadius), e.target.add(e.cursor), e.zoomToCursor && te || e.object.isOrthographicCamera ? l.radius = X(l.radius) : l.radius = X(l.radius * p), o.setFromSpherical(l), o.applyQuaternion(_), be.copy(e.target).add(o), e.object.lookAt(e.target), e.enableDamping === !0 ? (d.theta *= 1 - e.dampingFactor, d.phi *= 1 - e.dampingFactor, m.multiplyScalar(1 - e.dampingFactor)) : (d.set(0, 0, 0), m.set(0, 0, 0));
2585
+ let $e = !1;
2586
+ if (e.zoomToCursor && te) {
2587
+ let je = null;
2492
2588
  if (e.object.isPerspectiveCamera) {
2493
- const pe = i.length();
2494
- Ce = _e(pe * m);
2495
- const Ae = pe - Ce;
2496
- e.object.position.addScaledVector(Z, Ae), e.object.updateMatrixWorld();
2589
+ const Se = o.length();
2590
+ je = X(Se * p);
2591
+ const Ge = Se - je;
2592
+ e.object.position.addScaledVector(de, Ge), e.object.updateMatrixWorld();
2497
2593
  } else if (e.object.isOrthographicCamera) {
2498
- const pe = new I(z.x, z.y, 0);
2499
- pe.unproject(e.object), e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom / m)), e.object.updateProjectionMatrix(), Ie = !0;
2500
- const Ae = new I(z.x, z.y, 0);
2501
- Ae.unproject(e.object), e.object.position.sub(Ae).add(pe), e.object.updateMatrixWorld(), Ce = i.length();
2594
+ const Se = new Y(ce.x, ce.y, 0);
2595
+ Se.unproject(e.object), e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom / p)), e.object.updateProjectionMatrix(), $e = !0;
2596
+ const Ge = new Y(ce.x, ce.y, 0);
2597
+ Ge.unproject(e.object), e.object.position.sub(Ge).add(Se), e.object.updateMatrixWorld(), je = o.length();
2502
2598
  } else
2503
2599
  console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), e.zoomToCursor = !1;
2504
- Ce !== null && (this.screenSpacePanning ? e.target.set(0, 0, -1).transformDirection(e.object.matrix).multiplyScalar(Ce).add(e.object.position) : (pt.origin.copy(e.object.position), pt.direction.set(0, 0, -1).transformDirection(e.object.matrix), Math.abs(e.object.up.dot(pt.direction)) < hr ? n.lookAt(e.target) : (Wt.setFromNormalAndCoplanarPoint(e.object.up, e.target), pt.intersectPlane(Wt, e.target))));
2600
+ je !== null && (this.screenSpacePanning ? e.target.set(0, 0, -1).transformDirection(e.object.matrix).multiplyScalar(je).add(e.object.position) : (vt.origin.copy(e.object.position), vt.direction.set(0, 0, -1).transformDirection(e.object.matrix), Math.abs(e.object.up.dot(vt.direction)) < Da ? n.lookAt(e.target) : (Qt.setFromNormalAndCoplanarPoint(e.object.up, e.target), vt.intersectPlane(Qt, e.target))));
2505
2601
  } else
2506
- e.object.isOrthographicCamera && (e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom / m)), e.object.updateProjectionMatrix(), Ie = !0);
2507
- return m = 1, O = !1, Ie || P.distanceToSquared(e.object.position) > c || 8 * (1 - V.dot(e.object.quaternion)) > c || ce.distanceToSquared(e.target) > 0 ? (e.dispatchEvent(Yt), P.copy(e.object.position), V.copy(e.object.quaternion), ce.copy(e.target), !0) : !1;
2602
+ e.object.isOrthographicCamera && (e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom / p)), e.object.updateProjectionMatrix(), $e = !0);
2603
+ return p = 1, te = !1, $e || N.distanceToSquared(e.object.position) > c || 8 * (1 - ne.dot(e.object.quaternion)) > c || ve.distanceToSquared(e.target) > 0 ? (e.dispatchEvent(Zt), N.copy(e.object.position), ne.copy(e.object.quaternion), ve.copy(e.target), !0) : !1;
2508
2604
  };
2509
2605
  }(), this.dispose = function() {
2510
- e.domElement.removeEventListener("contextmenu", he), e.domElement.removeEventListener("pointerdown", He), e.domElement.removeEventListener("pointercancel", we), e.domElement.removeEventListener("wheel", ct), e.domElement.removeEventListener("pointermove", fe), e.domElement.removeEventListener("pointerup", we), e._domElementKeyEvents !== null && (e._domElementKeyEvents.removeEventListener("keydown", Xe), e._domElementKeyEvents = null);
2606
+ e.domElement.removeEventListener("contextmenu", Ce), e.domElement.removeEventListener("pointerdown", qe), e.domElement.removeEventListener("pointercancel", Pe), e.domElement.removeEventListener("wheel", dt), e.domElement.removeEventListener("pointermove", we), e.domElement.removeEventListener("pointerup", Pe), e._domElementKeyEvents !== null && (e._domElementKeyEvents.removeEventListener("keydown", Je), e._domElementKeyEvents = null);
2511
2607
  };
2512
- const e = this, o = {
2608
+ const e = this, r = {
2513
2609
  NONE: -1,
2514
2610
  ROTATE: 0,
2515
2611
  DOLLY: 1,
@@ -2519,625 +2615,755 @@ class pr extends Kt {
2519
2615
  TOUCH_DOLLY_PAN: 5,
2520
2616
  TOUCH_DOLLY_ROTATE: 6
2521
2617
  };
2522
- let u = o.NONE;
2523
- const c = 1e-6, s = new Nt(), d = new Nt();
2524
- let m = 1;
2525
- const v = new I(), f = new ae(), h = new ae(), g = new ae(), E = new ae(), w = new ae(), A = new ae(), U = new ae(), j = new ae(), X = new ae(), Z = new I(), z = new ae();
2526
- let O = !1;
2527
- const S = [], G = {};
2528
- function ge(i) {
2529
- return i !== null ? 2 * Math.PI / 60 * e.autoRotateSpeed * i : 2 * Math.PI / 60 / 60 * e.autoRotateSpeed;
2530
- }
2531
- function Re(i) {
2532
- const y = Math.abs(i) / (100 * (window.devicePixelRatio | 0));
2533
- return Math.pow(0.95, e.zoomSpeed * y);
2534
- }
2535
- function ve(i) {
2536
- d.theta -= i;
2537
- }
2538
- function be(i) {
2539
- d.phi -= i;
2540
- }
2541
- const te = function() {
2542
- const i = new I();
2543
- return function(R, P) {
2544
- i.setFromMatrixColumn(P, 0), i.multiplyScalar(-R), v.add(i);
2618
+ let s = r.NONE;
2619
+ const c = 1e-6, l = new zt(), d = new zt();
2620
+ let p = 1;
2621
+ const m = new Y(), b = new ue(), x = new ue(), C = new ue(), S = new ue(), F = new ue(), Q = new ue(), H = new ue(), O = new ue(), K = new ue(), de = new Y(), ce = new ue();
2622
+ let te = !1;
2623
+ const f = [], g = {};
2624
+ function y(o) {
2625
+ return o !== null ? 2 * Math.PI / 60 * e.autoRotateSpeed * o : 2 * Math.PI / 60 / 60 * e.autoRotateSpeed;
2626
+ }
2627
+ function T(o) {
2628
+ const E = Math.abs(o) / (100 * (window.devicePixelRatio | 0));
2629
+ return Math.pow(0.95, e.zoomSpeed * E);
2630
+ }
2631
+ function V(o) {
2632
+ d.theta -= o;
2633
+ }
2634
+ function z(o) {
2635
+ d.phi -= o;
2636
+ }
2637
+ const U = function() {
2638
+ const o = new Y();
2639
+ return function(_, N) {
2640
+ o.setFromMatrixColumn(N, 0), o.multiplyScalar(-_), m.add(o);
2545
2641
  };
2546
- }(), oe = function() {
2547
- const i = new I();
2548
- return function(R, P) {
2549
- e.screenSpacePanning === !0 ? i.setFromMatrixColumn(P, 1) : (i.setFromMatrixColumn(P, 0), i.crossVectors(e.object.up, i)), i.multiplyScalar(R), v.add(i);
2642
+ }(), D = function() {
2643
+ const o = new Y();
2644
+ return function(_, N) {
2645
+ e.screenSpacePanning === !0 ? o.setFromMatrixColumn(N, 1) : (o.setFromMatrixColumn(N, 0), o.crossVectors(e.object.up, o)), o.multiplyScalar(_), m.add(o);
2550
2646
  };
2551
- }(), ne = function() {
2552
- const i = new I();
2553
- return function(R, P) {
2554
- const V = e.domElement;
2647
+ }(), B = function() {
2648
+ const o = new Y();
2649
+ return function(_, N) {
2650
+ const ne = e.domElement;
2555
2651
  if (e.object.isPerspectiveCamera) {
2556
- const ce = e.object.position;
2557
- i.copy(ce).sub(e.target);
2558
- let q = i.length();
2559
- q *= Math.tan(e.object.fov / 2 * Math.PI / 180), te(2 * R * q / V.clientHeight, e.object.matrix), oe(2 * P * q / V.clientHeight, e.object.matrix);
2652
+ const ve = e.object.position;
2653
+ o.copy(ve).sub(e.target);
2654
+ let le = o.length();
2655
+ le *= Math.tan(e.object.fov / 2 * Math.PI / 180), U(2 * _ * le / ne.clientHeight, e.object.matrix), D(2 * N * le / ne.clientHeight, e.object.matrix);
2560
2656
  } else
2561
- e.object.isOrthographicCamera ? (te(R * (e.object.right - e.object.left) / e.object.zoom / V.clientWidth, e.object.matrix), oe(P * (e.object.top - e.object.bottom) / e.object.zoom / V.clientHeight, e.object.matrix)) : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."), e.enablePan = !1);
2657
+ e.object.isOrthographicCamera ? (U(_ * (e.object.right - e.object.left) / e.object.zoom / ne.clientWidth, e.object.matrix), D(N * (e.object.top - e.object.bottom) / e.object.zoom / ne.clientHeight, e.object.matrix)) : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."), e.enablePan = !1);
2562
2658
  };
2563
2659
  }();
2564
- function Pe(i) {
2565
- e.object.isPerspectiveCamera || e.object.isOrthographicCamera ? m /= i : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), e.enableZoom = !1);
2660
+ function J(o) {
2661
+ e.object.isPerspectiveCamera || e.object.isOrthographicCamera ? p /= o : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), e.enableZoom = !1);
2566
2662
  }
2567
- function Ge(i) {
2568
- e.object.isPerspectiveCamera || e.object.isOrthographicCamera ? m *= i : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), e.enableZoom = !1);
2663
+ function R(o) {
2664
+ e.object.isPerspectiveCamera || e.object.isOrthographicCamera ? p *= o : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), e.enableZoom = !1);
2569
2665
  }
2570
- function je(i, y) {
2666
+ function I(o, E) {
2571
2667
  if (!e.zoomToCursor)
2572
2668
  return;
2573
- O = !0;
2574
- const R = e.domElement.getBoundingClientRect(), P = i - R.left, V = y - R.top, ce = R.width, q = R.height;
2575
- z.x = P / ce * 2 - 1, z.y = -(V / q) * 2 + 1, Z.set(z.x, z.y, 1).unproject(e.object).sub(e.object.position).normalize();
2669
+ te = !0;
2670
+ const _ = e.domElement.getBoundingClientRect(), N = o - _.left, ne = E - _.top, ve = _.width, le = _.height;
2671
+ ce.x = N / ve * 2 - 1, ce.y = -(ne / le) * 2 + 1, de.set(ce.x, ce.y, 1).unproject(e.object).sub(e.object.position).normalize();
2576
2672
  }
2577
- function _e(i) {
2578
- return Math.max(e.minDistance, Math.min(e.maxDistance, i));
2673
+ function X(o) {
2674
+ return Math.max(e.minDistance, Math.min(e.maxDistance, o));
2579
2675
  }
2580
- function Ve(i) {
2581
- f.set(i.clientX, i.clientY);
2676
+ function pe(o) {
2677
+ b.set(o.clientX, o.clientY);
2582
2678
  }
2583
- function nt(i) {
2584
- je(i.clientX, i.clientX), U.set(i.clientX, i.clientY);
2679
+ function Oe(o) {
2680
+ I(o.clientX, o.clientX), H.set(o.clientX, o.clientY);
2585
2681
  }
2586
- function Ye(i) {
2587
- E.set(i.clientX, i.clientY);
2682
+ function He(o) {
2683
+ S.set(o.clientX, o.clientY);
2588
2684
  }
2589
- function rt(i) {
2590
- h.set(i.clientX, i.clientY), g.subVectors(h, f).multiplyScalar(e.rotateSpeed);
2591
- const y = e.domElement;
2592
- ve(2 * Math.PI * g.x / y.clientHeight), be(2 * Math.PI * g.y / y.clientHeight), f.copy(h), e.update();
2685
+ function ot(o) {
2686
+ x.set(o.clientX, o.clientY), C.subVectors(x, b).multiplyScalar(e.rotateSpeed);
2687
+ const E = e.domElement;
2688
+ V(2 * Math.PI * C.x / E.clientHeight), z(2 * Math.PI * C.y / E.clientHeight), b.copy(x), e.update();
2593
2689
  }
2594
- function vt(i) {
2595
- j.set(i.clientX, i.clientY), X.subVectors(j, U), X.y > 0 ? Pe(Re(X.y)) : X.y < 0 && Ge(Re(X.y)), U.copy(j), e.update();
2690
+ function Ct(o) {
2691
+ O.set(o.clientX, o.clientY), K.subVectors(O, H), K.y > 0 ? J(T(K.y)) : K.y < 0 && R(T(K.y)), H.copy(O), e.update();
2596
2692
  }
2597
- function bt(i) {
2598
- w.set(i.clientX, i.clientY), A.subVectors(w, E).multiplyScalar(e.panSpeed), ne(A.x, A.y), E.copy(w), e.update();
2693
+ function St(o) {
2694
+ F.set(o.clientX, o.clientY), Q.subVectors(F, S).multiplyScalar(e.panSpeed), B(Q.x, Q.y), S.copy(F), e.update();
2599
2695
  }
2600
- function ze(i) {
2601
- je(i.clientX, i.clientY), i.deltaY < 0 ? Ge(Re(i.deltaY)) : i.deltaY > 0 && Pe(Re(i.deltaY)), e.update();
2696
+ function Ke(o) {
2697
+ I(o.clientX, o.clientY), o.deltaY < 0 ? R(T(o.deltaY)) : o.deltaY > 0 && J(T(o.deltaY)), e.update();
2602
2698
  }
2603
- function We(i) {
2604
- let y = !1;
2605
- switch (i.code) {
2699
+ function Xe(o) {
2700
+ let E = !1;
2701
+ switch (o.code) {
2606
2702
  case e.keys.UP:
2607
- i.ctrlKey || i.metaKey || i.shiftKey ? be(2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : ne(0, e.keyPanSpeed), y = !0;
2703
+ o.ctrlKey || o.metaKey || o.shiftKey ? z(2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : B(0, e.keyPanSpeed), E = !0;
2608
2704
  break;
2609
2705
  case e.keys.BOTTOM:
2610
- i.ctrlKey || i.metaKey || i.shiftKey ? be(-2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : ne(0, -e.keyPanSpeed), y = !0;
2706
+ o.ctrlKey || o.metaKey || o.shiftKey ? z(-2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : B(0, -e.keyPanSpeed), E = !0;
2611
2707
  break;
2612
2708
  case e.keys.LEFT:
2613
- i.ctrlKey || i.metaKey || i.shiftKey ? ve(2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : ne(e.keyPanSpeed, 0), y = !0;
2709
+ o.ctrlKey || o.metaKey || o.shiftKey ? V(2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : B(e.keyPanSpeed, 0), E = !0;
2614
2710
  break;
2615
2711
  case e.keys.RIGHT:
2616
- i.ctrlKey || i.metaKey || i.shiftKey ? ve(-2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : ne(-e.keyPanSpeed, 0), y = !0;
2712
+ o.ctrlKey || o.metaKey || o.shiftKey ? V(-2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : B(-e.keyPanSpeed, 0), E = !0;
2617
2713
  break;
2618
2714
  }
2619
- y && (i.preventDefault(), e.update());
2715
+ E && (o.preventDefault(), e.update());
2620
2716
  }
2621
- function ye(i) {
2622
- if (S.length === 1)
2623
- f.set(i.pageX, i.pageY);
2717
+ function Te(o) {
2718
+ if (f.length === 1)
2719
+ b.set(o.pageX, o.pageY);
2624
2720
  else {
2625
- const y = se(i), R = 0.5 * (i.pageX + y.x), P = 0.5 * (i.pageY + y.y);
2626
- f.set(R, P);
2721
+ const E = ge(o), _ = 0.5 * (o.pageX + E.x), N = 0.5 * (o.pageY + E.y);
2722
+ b.set(_, N);
2627
2723
  }
2628
2724
  }
2629
- function ke(i) {
2630
- if (S.length === 1)
2631
- E.set(i.pageX, i.pageY);
2725
+ function Ue(o) {
2726
+ if (f.length === 1)
2727
+ S.set(o.pageX, o.pageY);
2632
2728
  else {
2633
- const y = se(i), R = 0.5 * (i.pageX + y.x), P = 0.5 * (i.pageY + y.y);
2634
- E.set(R, P);
2729
+ const E = ge(o), _ = 0.5 * (o.pageX + E.x), N = 0.5 * (o.pageY + E.y);
2730
+ S.set(_, N);
2635
2731
  }
2636
2732
  }
2637
- function Ee(i) {
2638
- const y = se(i), R = i.pageX - y.x, P = i.pageY - y.y, V = Math.sqrt(R * R + P * P);
2639
- U.set(0, V);
2733
+ function Me(o) {
2734
+ const E = ge(o), _ = o.pageX - E.x, N = o.pageY - E.y, ne = Math.sqrt(_ * _ + N * N);
2735
+ H.set(0, ne);
2640
2736
  }
2641
- function yt(i) {
2642
- e.enableZoom && Ee(i), e.enablePan && ke(i);
2737
+ function Ot(o) {
2738
+ e.enableZoom && Me(o), e.enablePan && Ue(o);
2643
2739
  }
2644
- function at(i) {
2645
- e.enableZoom && Ee(i), e.enableRotate && ye(i);
2740
+ function st(o) {
2741
+ e.enableZoom && Me(o), e.enableRotate && Te(o);
2646
2742
  }
2647
- function it(i) {
2648
- if (S.length == 1)
2649
- h.set(i.pageX, i.pageY);
2743
+ function ct(o) {
2744
+ if (f.length == 1)
2745
+ x.set(o.pageX, o.pageY);
2650
2746
  else {
2651
- const R = se(i), P = 0.5 * (i.pageX + R.x), V = 0.5 * (i.pageY + R.y);
2652
- h.set(P, V);
2747
+ const _ = ge(o), N = 0.5 * (o.pageX + _.x), ne = 0.5 * (o.pageY + _.y);
2748
+ x.set(N, ne);
2653
2749
  }
2654
- g.subVectors(h, f).multiplyScalar(e.rotateSpeed);
2655
- const y = e.domElement;
2656
- ve(2 * Math.PI * g.x / y.clientHeight), be(2 * Math.PI * g.y / y.clientHeight), f.copy(h);
2750
+ C.subVectors(x, b).multiplyScalar(e.rotateSpeed);
2751
+ const E = e.domElement;
2752
+ V(2 * Math.PI * C.x / E.clientHeight), z(2 * Math.PI * C.y / E.clientHeight), b.copy(x);
2657
2753
  }
2658
- function ot(i) {
2659
- if (S.length === 1)
2660
- w.set(i.pageX, i.pageY);
2754
+ function lt(o) {
2755
+ if (f.length === 1)
2756
+ F.set(o.pageX, o.pageY);
2661
2757
  else {
2662
- const y = se(i), R = 0.5 * (i.pageX + y.x), P = 0.5 * (i.pageY + y.y);
2663
- w.set(R, P);
2758
+ const E = ge(o), _ = 0.5 * (o.pageX + E.x), N = 0.5 * (o.pageY + E.y);
2759
+ F.set(_, N);
2664
2760
  }
2665
- A.subVectors(w, E).multiplyScalar(e.panSpeed), ne(A.x, A.y), E.copy(w);
2761
+ Q.subVectors(F, S).multiplyScalar(e.panSpeed), B(Q.x, Q.y), S.copy(F);
2666
2762
  }
2667
- function xe(i) {
2668
- const y = se(i), R = i.pageX - y.x, P = i.pageY - y.y, V = Math.sqrt(R * R + P * P);
2669
- j.set(0, V), X.set(0, Math.pow(j.y / U.y, e.zoomSpeed)), Pe(X.y), U.copy(j);
2670
- const ce = (i.pageX + y.x) * 0.5, q = (i.pageY + y.y) * 0.5;
2671
- je(ce, q);
2763
+ function Re(o) {
2764
+ const E = ge(o), _ = o.pageX - E.x, N = o.pageY - E.y, ne = Math.sqrt(_ * _ + N * N);
2765
+ O.set(0, ne), K.set(0, Math.pow(O.y / H.y, e.zoomSpeed)), J(K.y), H.copy(O);
2766
+ const ve = (o.pageX + E.x) * 0.5, le = (o.pageY + E.y) * 0.5;
2767
+ I(ve, le);
2672
2768
  }
2673
- function De(i) {
2674
- e.enableZoom && xe(i), e.enablePan && ot(i);
2769
+ function Be(o) {
2770
+ e.enableZoom && Re(o), e.enablePan && lt(o);
2675
2771
  }
2676
- function st(i) {
2677
- e.enableZoom && xe(i), e.enableRotate && it(i);
2772
+ function ut(o) {
2773
+ e.enableZoom && Re(o), e.enableRotate && ct(o);
2678
2774
  }
2679
- function He(i) {
2680
- e.enabled !== !1 && (S.length === 0 && (e.domElement.setPointerCapture(i.pointerId), e.domElement.addEventListener("pointermove", fe), e.domElement.addEventListener("pointerup", we)), xt(i), i.pointerType === "touch" ? lt(i) : Et(i));
2775
+ function qe(o) {
2776
+ e.enabled !== !1 && (f.length === 0 && (e.domElement.setPointerCapture(o.pointerId), e.domElement.addEventListener("pointermove", we), e.domElement.addEventListener("pointerup", Pe)), Mt(o), o.pointerType === "touch" ? ft(o) : Tt(o));
2681
2777
  }
2682
- function fe(i) {
2683
- e.enabled !== !1 && (i.pointerType === "touch" ? ut(i) : Ke(i));
2778
+ function we(o) {
2779
+ e.enabled !== !1 && (o.pointerType === "touch" ? ht(o) : Ze(o));
2684
2780
  }
2685
- function we(i) {
2686
- dt(i), S.length === 0 && (e.domElement.releasePointerCapture(i.pointerId), e.domElement.removeEventListener("pointermove", fe), e.domElement.removeEventListener("pointerup", we)), e.dispatchEvent(zt), u = o.NONE;
2781
+ function Pe(o) {
2782
+ pt(o), f.length === 0 && (e.domElement.releasePointerCapture(o.pointerId), e.domElement.removeEventListener("pointermove", we), e.domElement.removeEventListener("pointerup", Pe)), e.dispatchEvent(Jt), s = r.NONE;
2687
2783
  }
2688
- function Et(i) {
2689
- let y;
2690
- switch (i.button) {
2784
+ function Tt(o) {
2785
+ let E;
2786
+ switch (o.button) {
2691
2787
  case 0:
2692
- y = e.mouseButtons.LEFT;
2788
+ E = e.mouseButtons.LEFT;
2693
2789
  break;
2694
2790
  case 1:
2695
- y = e.mouseButtons.MIDDLE;
2791
+ E = e.mouseButtons.MIDDLE;
2696
2792
  break;
2697
2793
  case 2:
2698
- y = e.mouseButtons.RIGHT;
2794
+ E = e.mouseButtons.RIGHT;
2699
2795
  break;
2700
2796
  default:
2701
- y = -1;
2797
+ E = -1;
2702
2798
  }
2703
- switch (y) {
2704
- case Le.DOLLY:
2799
+ switch (E) {
2800
+ case ze.DOLLY:
2705
2801
  if (e.enableZoom === !1)
2706
2802
  return;
2707
- nt(i), u = o.DOLLY;
2803
+ Oe(o), s = r.DOLLY;
2708
2804
  break;
2709
- case Le.ROTATE:
2710
- if (i.ctrlKey || i.metaKey || i.shiftKey) {
2805
+ case ze.ROTATE:
2806
+ if (o.ctrlKey || o.metaKey || o.shiftKey) {
2711
2807
  if (e.enablePan === !1)
2712
2808
  return;
2713
- Ye(i), u = o.PAN;
2809
+ He(o), s = r.PAN;
2714
2810
  } else {
2715
2811
  if (e.enableRotate === !1)
2716
2812
  return;
2717
- Ve(i), u = o.ROTATE;
2813
+ pe(o), s = r.ROTATE;
2718
2814
  }
2719
2815
  break;
2720
- case Le.PAN:
2721
- if (i.ctrlKey || i.metaKey || i.shiftKey) {
2816
+ case ze.PAN:
2817
+ if (o.ctrlKey || o.metaKey || o.shiftKey) {
2722
2818
  if (e.enableRotate === !1)
2723
2819
  return;
2724
- Ve(i), u = o.ROTATE;
2820
+ pe(o), s = r.ROTATE;
2725
2821
  } else {
2726
2822
  if (e.enablePan === !1)
2727
2823
  return;
2728
- Ye(i), u = o.PAN;
2824
+ He(o), s = r.PAN;
2729
2825
  }
2730
2826
  break;
2731
2827
  default:
2732
- u = o.NONE;
2828
+ s = r.NONE;
2733
2829
  }
2734
- u !== o.NONE && e.dispatchEvent(wt);
2830
+ s !== r.NONE && e.dispatchEvent(_t);
2735
2831
  }
2736
- function Ke(i) {
2737
- switch (u) {
2738
- case o.ROTATE:
2832
+ function Ze(o) {
2833
+ switch (s) {
2834
+ case r.ROTATE:
2739
2835
  if (e.enableRotate === !1)
2740
2836
  return;
2741
- rt(i);
2837
+ ot(o);
2742
2838
  break;
2743
- case o.DOLLY:
2839
+ case r.DOLLY:
2744
2840
  if (e.enableZoom === !1)
2745
2841
  return;
2746
- vt(i);
2842
+ Ct(o);
2747
2843
  break;
2748
- case o.PAN:
2844
+ case r.PAN:
2749
2845
  if (e.enablePan === !1)
2750
2846
  return;
2751
- bt(i);
2847
+ St(o);
2752
2848
  break;
2753
2849
  }
2754
2850
  }
2755
- function ct(i) {
2756
- e.enabled === !1 || e.enableZoom === !1 || u !== o.NONE || (i.preventDefault(), e.dispatchEvent(wt), ze(i), e.dispatchEvent(zt));
2851
+ function dt(o) {
2852
+ e.enabled === !1 || e.enableZoom === !1 || s !== r.NONE || (o.preventDefault(), e.dispatchEvent(_t), Ke(o), e.dispatchEvent(Jt));
2757
2853
  }
2758
- function Xe(i) {
2759
- e.enabled === !1 || e.enablePan === !1 || We(i);
2854
+ function Je(o) {
2855
+ e.enabled === !1 || e.enablePan === !1 || Xe(o);
2760
2856
  }
2761
- function lt(i) {
2762
- switch (qe(i), S.length) {
2857
+ function ft(o) {
2858
+ switch (Qe(o), f.length) {
2763
2859
  case 1:
2764
2860
  switch (e.touches.ONE) {
2765
- case Fe.ROTATE:
2861
+ case Ye.ROTATE:
2766
2862
  if (e.enableRotate === !1)
2767
2863
  return;
2768
- ye(i), u = o.TOUCH_ROTATE;
2864
+ Te(o), s = r.TOUCH_ROTATE;
2769
2865
  break;
2770
- case Fe.PAN:
2866
+ case Ye.PAN:
2771
2867
  if (e.enablePan === !1)
2772
2868
  return;
2773
- ke(i), u = o.TOUCH_PAN;
2869
+ Ue(o), s = r.TOUCH_PAN;
2774
2870
  break;
2775
2871
  default:
2776
- u = o.NONE;
2872
+ s = r.NONE;
2777
2873
  }
2778
2874
  break;
2779
2875
  case 2:
2780
2876
  switch (e.touches.TWO) {
2781
- case Fe.DOLLY_PAN:
2877
+ case Ye.DOLLY_PAN:
2782
2878
  if (e.enableZoom === !1 && e.enablePan === !1)
2783
2879
  return;
2784
- yt(i), u = o.TOUCH_DOLLY_PAN;
2880
+ Ot(o), s = r.TOUCH_DOLLY_PAN;
2785
2881
  break;
2786
- case Fe.DOLLY_ROTATE:
2882
+ case Ye.DOLLY_ROTATE:
2787
2883
  if (e.enableZoom === !1 && e.enableRotate === !1)
2788
2884
  return;
2789
- at(i), u = o.TOUCH_DOLLY_ROTATE;
2885
+ st(o), s = r.TOUCH_DOLLY_ROTATE;
2790
2886
  break;
2791
2887
  default:
2792
- u = o.NONE;
2888
+ s = r.NONE;
2793
2889
  }
2794
2890
  break;
2795
2891
  default:
2796
- u = o.NONE;
2892
+ s = r.NONE;
2797
2893
  }
2798
- u !== o.NONE && e.dispatchEvent(wt);
2894
+ s !== r.NONE && e.dispatchEvent(_t);
2799
2895
  }
2800
- function ut(i) {
2801
- switch (qe(i), u) {
2802
- case o.TOUCH_ROTATE:
2896
+ function ht(o) {
2897
+ switch (Qe(o), s) {
2898
+ case r.TOUCH_ROTATE:
2803
2899
  if (e.enableRotate === !1)
2804
2900
  return;
2805
- it(i), e.update();
2901
+ ct(o), e.update();
2806
2902
  break;
2807
- case o.TOUCH_PAN:
2903
+ case r.TOUCH_PAN:
2808
2904
  if (e.enablePan === !1)
2809
2905
  return;
2810
- ot(i), e.update();
2906
+ lt(o), e.update();
2811
2907
  break;
2812
- case o.TOUCH_DOLLY_PAN:
2908
+ case r.TOUCH_DOLLY_PAN:
2813
2909
  if (e.enableZoom === !1 && e.enablePan === !1)
2814
2910
  return;
2815
- De(i), e.update();
2911
+ Be(o), e.update();
2816
2912
  break;
2817
- case o.TOUCH_DOLLY_ROTATE:
2913
+ case r.TOUCH_DOLLY_ROTATE:
2818
2914
  if (e.enableZoom === !1 && e.enableRotate === !1)
2819
2915
  return;
2820
- st(i), e.update();
2916
+ ut(o), e.update();
2821
2917
  break;
2822
2918
  default:
2823
- u = o.NONE;
2919
+ s = r.NONE;
2824
2920
  }
2825
2921
  }
2826
- function he(i) {
2827
- e.enabled !== !1 && i.preventDefault();
2922
+ function Ce(o) {
2923
+ e.enabled !== !1 && o.preventDefault();
2828
2924
  }
2829
- function xt(i) {
2830
- S.push(i.pointerId);
2925
+ function Mt(o) {
2926
+ f.push(o.pointerId);
2831
2927
  }
2832
- function dt(i) {
2833
- delete G[i.pointerId];
2834
- for (let y = 0; y < S.length; y++)
2835
- if (S[y] == i.pointerId) {
2836
- S.splice(y, 1);
2928
+ function pt(o) {
2929
+ delete g[o.pointerId];
2930
+ for (let E = 0; E < f.length; E++)
2931
+ if (f[E] == o.pointerId) {
2932
+ f.splice(E, 1);
2837
2933
  return;
2838
2934
  }
2839
2935
  }
2840
- function qe(i) {
2841
- let y = G[i.pointerId];
2842
- y === void 0 && (y = new ae(), G[i.pointerId] = y), y.set(i.pageX, i.pageY);
2936
+ function Qe(o) {
2937
+ let E = g[o.pointerId];
2938
+ E === void 0 && (E = new ue(), g[o.pointerId] = E), E.set(o.pageX, o.pageY);
2843
2939
  }
2844
- function se(i) {
2845
- const y = i.pointerId === S[0] ? S[1] : S[0];
2846
- return G[y];
2940
+ function ge(o) {
2941
+ const E = o.pointerId === f[0] ? f[1] : f[0];
2942
+ return g[E];
2847
2943
  }
2848
- e.domElement.addEventListener("contextmenu", he), e.domElement.addEventListener("pointerdown", He), e.domElement.addEventListener("pointercancel", we), e.domElement.addEventListener("wheel", ct, { passive: !1 }), this.update();
2944
+ e.domElement.addEventListener("contextmenu", Ce), e.domElement.addEventListener("pointerdown", qe), e.domElement.addEventListener("pointercancel", Pe), e.domElement.addEventListener("wheel", dt, { passive: !1 }), this.update();
2849
2945
  }
2850
2946
  }
2851
- const Rt = (t) => {
2852
- const [n, a] = ie(!1), [e, o] = ie(t.options[t.index]), u = () => {
2853
- a(!n);
2854
- }, c = (s) => {
2855
- s !== e && (t.onSelect(s), o(s)), a(!1);
2947
+ const Et = (t) => {
2948
+ const [n, a] = ie(t.options[t.index]), e = () => {
2949
+ t.onToggle(!t.open);
2950
+ }, r = (s) => {
2951
+ s !== n && (t.onSelect(s), a(s)), t.onToggle(!1);
2856
2952
  };
2857
- return /* @__PURE__ */ l.jsxs("div", { className: `dropdown ${t.up === !0 ? "up" : ""}`, children: [
2858
- /* @__PURE__ */ l.jsx("div", { className: "dropdown-toggle", onClick: u, children: e }),
2859
- n && /* @__PURE__ */ l.jsx("ul", { className: "dropdown-menu", children: t.options.map((s) => /* @__PURE__ */ l.jsx("li", { onClick: () => c(s), children: s }, s)) })
2953
+ return /* @__PURE__ */ u.jsxs("div", { className: `dropdown ${t.up === !0 ? "up" : ""}`, children: [
2954
+ /* @__PURE__ */ u.jsx("div", { className: "dropdown-toggle", onClick: e, children: n }),
2955
+ t.open && /* @__PURE__ */ u.jsx("ul", { className: "dropdown-menu", children: t.options.map((s) => /* @__PURE__ */ u.jsx("li", { onClick: () => r(s), children: s }, s)) })
2860
2956
  ] });
2861
- }, Te = Dn(function(n, a) {
2862
- const e = n.options.indexOf(n.camera.name);
2863
- return /* @__PURE__ */ l.jsxs("div", { className: "CameraWindow", children: [
2864
- /* @__PURE__ */ l.jsx("div", { ref: a, className: "clickable" }),
2865
- /* @__PURE__ */ l.jsx(Rt, { index: e, options: n.options, onSelect: n.onSelect, up: !0 })
2957
+ }, ke = Xn(function(n, a) {
2958
+ const [e, r] = ie(!1), s = n.options.indexOf(n.camera.name);
2959
+ return /* @__PURE__ */ u.jsxs("div", { className: "CameraWindow", children: [
2960
+ /* @__PURE__ */ u.jsx("div", { ref: a, className: "clickable", onClick: () => {
2961
+ e && r(!1);
2962
+ } }),
2963
+ /* @__PURE__ */ u.jsx(
2964
+ Et,
2965
+ {
2966
+ index: s,
2967
+ open: e,
2968
+ options: n.options,
2969
+ onSelect: n.onSelect,
2970
+ onToggle: (c) => {
2971
+ r(c);
2972
+ },
2973
+ up: !0
2974
+ }
2975
+ )
2866
2976
  ] });
2867
- }), Ht = [
2977
+ }), en = [
2868
2978
  "Single",
2869
2979
  "Side by Side",
2870
2980
  "Stacked",
2871
2981
  "Quad"
2872
- ], H = /* @__PURE__ */ new Map(), Y = /* @__PURE__ */ new Map(), de = /* @__PURE__ */ new Map(), me = [
2873
- "Top",
2874
- "Bottom",
2875
- "Left",
2876
- "Right",
2877
- "Front",
2878
- "Back",
2879
- "Orthographic",
2880
- "Debug"
2881
- ];
2882
- function Me(t, n) {
2883
- const a = new Zt(-100, 100, 100, -100, 50, 3e3);
2884
- return a.name = t, a.position.copy(n), a.lookAt(0, 0, 0), H.set(t, a), a;
2982
+ ], ae = /* @__PURE__ */ new Map(), re = /* @__PURE__ */ new Map(), Ee = /* @__PURE__ */ new Map();
2983
+ function Fe(t, n) {
2984
+ const a = new on(-100, 100, 100, -100, 50, 3e3);
2985
+ return a.name = t, a.position.copy(n), a.lookAt(0, 0, 0), ae.set(t, a), a;
2885
2986
  }
2886
- Me("Top", new I(0, 1e3, 0));
2887
- Me("Bottom", new I(0, -1e3, 0));
2888
- Me("Left", new I(-1e3, 0, 0));
2889
- Me("Right", new I(1e3, 0, 0));
2890
- Me("Front", new I(0, 0, 1e3));
2891
- Me("Back", new I(0, 0, -1e3));
2892
- Me("Orthographic", new I(1e3, 1e3, 1e3));
2893
- const gt = new St(60, 1, 50, 3e3);
2894
- gt.name = "Debug";
2895
- gt.position.set(500, 500, 500);
2896
- gt.lookAt(0, 0, 0);
2897
- H.set("Debug", gt);
2898
- const mr = [
2899
- "Default",
2987
+ Fe("Top", new Y(0, 1e3, 0));
2988
+ Fe("Bottom", new Y(0, -1e3, 0));
2989
+ Fe("Left", new Y(-1e3, 0, 0));
2990
+ Fe("Right", new Y(1e3, 0, 0));
2991
+ Fe("Front", new Y(0, 0, 1e3));
2992
+ Fe("Back", new Y(0, 0, -1e3));
2993
+ Fe("Orthographic", new Y(1e3, 1e3, 1e3));
2994
+ const wt = new kt(60, 1, 50, 3e3);
2995
+ wt.name = "Debug";
2996
+ wt.position.set(500, 500, 500);
2997
+ wt.lookAt(0, 0, 0);
2998
+ ae.set("Debug", wt);
2999
+ const tn = [
3000
+ "Renderer",
3001
+ "Depth",
2900
3002
  "Normals",
2901
- "Wireframe",
2902
- "UVs"
2903
- ], gr = new Sn(), vr = new Tn({
3003
+ "UVs",
3004
+ "Wireframe"
3005
+ ], Na = new Fn(), La = new Un(), Fa = new ba(), Ua = new Bn({
2904
3006
  opacity: 0.33,
2905
3007
  transparent: !0,
2906
3008
  wireframe: !0
2907
- }), br = new tr();
2908
- let Ct = "Default";
2909
- const F = new On();
2910
- let $ = H.get("Debug"), ee = H.get("Orthographic"), Ue = H.get("Front"), Be = H.get("Top");
2911
- function Nr(t) {
2912
- const [n, a] = ie(t.mode !== void 0 ? t.mode : "Quad"), e = Oe(null), o = Oe(null), u = Oe(null), c = Oe(null), s = (f, h) => {
2913
- const g = Y.get(f.name);
2914
- g !== void 0 && g.dispose(), Y.delete(f.name);
2915
- const E = de.get(f.name);
2916
- E !== void 0 && (F.remove(E), E.dispose()), de.delete(f.name);
2917
- const w = new pr(f, h);
2918
- switch (f.name) {
3009
+ });
3010
+ let bt = "Renderer";
3011
+ const G = new sn();
3012
+ G.name = "Debug Scene";
3013
+ let Ie = new sn();
3014
+ G.add(Ie);
3015
+ const rt = new $n();
3016
+ rt.name = "helpers";
3017
+ G.add(rt);
3018
+ const Ba = new ma();
3019
+ rt.add(Ba);
3020
+ const vn = new cn(500);
3021
+ vn.name = "axisHelper";
3022
+ rt.add(vn);
3023
+ const it = new cn(100);
3024
+ it.name = "interactionHelper";
3025
+ rt.add(it);
3026
+ it.visible = !1;
3027
+ let yt = !1, $ = ae.get("Debug"), oe = ae.get("Orthographic"), Ae = ae.get("Front"), De = ae.get("Top");
3028
+ function ri(t) {
3029
+ const [n, a] = ie(t.mode !== void 0 ? t.mode : "Quad"), [e, r] = ie(null), [s, c] = ie(!1), [l, d] = ie(!1), [p, m] = ie(!1), [, b] = ie(Date.now()), x = xe(null), C = xe(null), S = xe(null), F = xe(null), Q = xe(null), H = xe(null), O = (f, g) => {
3030
+ const y = re.get(f.name);
3031
+ y !== void 0 && y.dispose(), re.delete(f.name);
3032
+ const T = Ee.get(f.name);
3033
+ T !== void 0 && (G.remove(T), T.dispose()), Ee.delete(f.name);
3034
+ const V = new Ia(f, g);
3035
+ switch (V.enableDamping = !0, V.dampingFactor = 0.05, f.name) {
2919
3036
  case "Top":
2920
3037
  case "Bottom":
2921
3038
  case "Left":
2922
3039
  case "Right":
2923
3040
  case "Front":
2924
3041
  case "Back":
2925
- w.enableRotate = !1;
3042
+ V.enableRotate = !1;
2926
3043
  break;
2927
3044
  }
2928
- if (Y.set(f.name, w), f instanceof St) {
2929
- const A = new Rn(f);
2930
- de.set(f.name, A), F.add(A);
2931
- }
2932
- }, d = (f) => {
2933
- const h = de.get(f.name);
2934
- h !== void 0 && (F.remove(h), h.dispose(), de.delete(f.name));
2935
- const g = Y.get(f.name);
2936
- g !== void 0 && (g.dispose(), Y.delete(f.name));
2937
- }, m = () => {
2938
- Y.forEach((f, h) => {
3045
+ if (re.set(f.name, V), f instanceof kt) {
3046
+ const z = new zn(f);
3047
+ Ee.set(f.name, z), G.add(z);
3048
+ }
3049
+ }, K = (f) => {
3050
+ const g = Ee.get(f.name);
3051
+ g !== void 0 && (G.remove(g), g.dispose(), Ee.delete(f.name));
3052
+ const y = re.get(f.name);
3053
+ y !== void 0 && (y.dispose(), re.delete(f.name));
3054
+ }, de = () => {
3055
+ re.forEach((f, g) => {
2939
3056
  f.dispose();
2940
- const g = de.get(h);
2941
- g !== void 0 && (F.remove(g), g.dispose()), de.delete(h), Y.delete(h);
2942
- }), Y.clear(), de.clear();
2943
- }, v = () => {
3057
+ const y = Ee.get(g);
3058
+ y !== void 0 && (G.remove(y), y.dispose()), Ee.delete(g), re.delete(g);
3059
+ }), re.clear(), Ee.clear();
3060
+ }, ce = () => {
2944
3061
  switch (n) {
2945
3062
  case "Single":
2946
- s($, e.current);
3063
+ O($, S.current);
2947
3064
  break;
2948
3065
  case "Side by Side":
2949
3066
  case "Stacked":
2950
- s($, e.current), s(ee, o.current);
3067
+ O($, S.current), O(oe, F.current);
2951
3068
  break;
2952
3069
  case "Quad":
2953
- s($, e.current), s(ee, o.current), s(Ue, u.current), s(Be, c.current);
3070
+ O($, S.current), O(oe, F.current), O(Ae, Q.current), O(De, H.current);
2954
3071
  break;
2955
3072
  }
2956
3073
  };
2957
- return tt(() => {
2958
- F.name = "Debug Scene", F.add(t.scene);
2959
- const f = new Jn();
2960
- F.add(f);
2961
- const h = new Mn(500);
2962
- h.name = "axisHelper", F.add(h);
2963
- }, []), tt(() => {
2964
- const f = t.renderer.getSize(new ae());
2965
- let h = f.x, g = f.y, E = Math.floor(h / 2), w = Math.floor(g / 2), A = -1;
2966
- const U = () => {
2967
- h = window.innerWidth - 300, g = window.innerHeight, E = Math.floor(h / 2), w = Math.floor(g / 2);
2968
- let O = h, S = g;
3074
+ Ne(() => {
3075
+ const f = new Gn({
3076
+ canvas: x.current,
3077
+ stencil: !1
3078
+ });
3079
+ f.autoClear = !1, f.shadowMap.enabled = !0, f.setPixelRatio(devicePixelRatio), f.setClearColor(0), r(f);
3080
+ }, []), Ne(() => {
3081
+ const f = () => {
3082
+ fn(Ie), G.remove(Ie), t.three.scene !== void 0 && (Ie = t.three.scene, G.add(Ie));
3083
+ }, g = (T) => {
3084
+ var U;
3085
+ const V = T.value, z = (U = t.three.scene) == null ? void 0 : U.getObjectByProperty("uuid", V.uuid);
3086
+ z !== void 0 && ae.set(V.name, z), b(Date.now());
3087
+ }, y = (T) => {
3088
+ ae.delete(T.value.name), b(Date.now());
3089
+ };
3090
+ return k.addEventListener(A.SET_SCENE, f), k.addEventListener(A.ADD_CAMERA, g), k.addEventListener(A.REMOVE_CAMERA, y), () => {
3091
+ k.removeEventListener(A.SET_SCENE, f), k.removeEventListener(A.ADD_CAMERA, g), k.removeEventListener(A.REMOVE_CAMERA, y);
3092
+ };
3093
+ }, []), Ne(() => {
3094
+ if (e === null)
3095
+ return;
3096
+ let f = window.innerWidth, g = window.innerHeight, y = Math.floor(f / 2), T = Math.floor(g / 2), V = -1;
3097
+ const z = () => {
3098
+ f = window.innerWidth - 300, g = window.innerHeight, y = Math.floor(f / 2), T = Math.floor(g / 2), e.setSize(f, g);
3099
+ let R = f, I = g;
2969
3100
  switch (n) {
2970
3101
  case "Side by Side":
2971
- O = E, S = g;
3102
+ R = y, I = g;
2972
3103
  break;
2973
3104
  case "Stacked":
2974
- O = h, S = w;
3105
+ R = f, I = T;
2975
3106
  break;
2976
3107
  case "Quad":
2977
- O = E, S = w;
3108
+ R = y, I = T;
2978
3109
  break;
2979
3110
  }
2980
- H.forEach((G) => {
2981
- var ge;
2982
- G instanceof Zt ? (G.left = O / -2, G.right = O / 2, G.top = S / 2, G.bottom = S / -2, G.updateProjectionMatrix()) : G instanceof St && (G.aspect = O / S, G.updateProjectionMatrix(), (ge = de.get(G.name)) == null || ge.update());
3111
+ ae.forEach((X) => {
3112
+ var pe;
3113
+ X instanceof on ? (X.left = R / -2, X.right = R / 2, X.top = I / 2, X.bottom = I / -2, X.updateProjectionMatrix()) : X instanceof kt && (X.aspect = R / I, X.updateProjectionMatrix(), (pe = Ee.get(X.name)) == null || pe.update());
2983
3114
  });
2984
- }, j = () => {
2985
- t.renderer.setViewport(0, 0, h, g), t.renderer.setScissor(0, 0, h, g), t.renderer.render(F, $);
2986
- }, X = () => {
3115
+ }, U = () => {
3116
+ e.setViewport(0, 0, f, g), e.setScissor(0, 0, f, g), e.render(G, $);
3117
+ }, D = () => {
2987
3118
  if (n === "Side by Side")
2988
- t.renderer.setViewport(0, 0, E, g), t.renderer.setScissor(0, 0, E, g), t.renderer.render(F, $), t.renderer.setViewport(E, 0, E, g), t.renderer.setScissor(E, 0, E, g), t.renderer.render(F, ee);
3119
+ e.setViewport(0, 0, y, g), e.setScissor(0, 0, y, g), e.render(G, $), e.setViewport(y, 0, y, g), e.setScissor(y, 0, y, g), e.render(G, oe);
2989
3120
  else {
2990
- const O = g - w;
2991
- t.renderer.setViewport(0, O, h, w), t.renderer.setScissor(0, O, h, w), t.renderer.render(F, $), t.renderer.setViewport(0, 0, h, w), t.renderer.setScissor(0, 0, h, w), t.renderer.render(F, ee);
2992
- }
2993
- }, Z = () => {
2994
- let O = 0, S = 0;
2995
- S = g - w, O = 0, t.renderer.setViewport(O, S, E, w), t.renderer.setScissor(O, S, E, w), t.renderer.render(F, $), O = E, t.renderer.setViewport(O, S, E, w), t.renderer.setScissor(O, S, E, w), t.renderer.render(F, ee), S = 0, O = 0, t.renderer.setViewport(O, S, E, w), t.renderer.setScissor(O, S, E, w), t.renderer.render(F, Ue), O = E, t.renderer.setViewport(O, S, E, w), t.renderer.setScissor(O, S, E, w), t.renderer.render(F, Be);
2996
- }, z = () => {
2997
- switch (Y.forEach((O) => {
2998
- O.update();
2999
- }), t.scene.update(), t.renderer.clear(), n) {
3121
+ const R = g - T;
3122
+ e.setViewport(0, R, f, T), e.setScissor(0, R, f, T), e.render(G, $), e.setViewport(0, 0, f, T), e.setScissor(0, 0, f, T), e.render(G, oe);
3123
+ }
3124
+ }, B = () => {
3125
+ let R = 0, I = 0;
3126
+ I = g - T, R = 0, e.setViewport(R, I, y, T), e.setScissor(R, I, y, T), e.render(G, $), R = y, e.setViewport(R, I, y, T), e.setScissor(R, I, y, T), e.render(G, oe), I = 0, R = 0, e.setViewport(R, I, y, T), e.setScissor(R, I, y, T), e.render(G, Ae), R = y, e.setViewport(R, I, y, T), e.setScissor(R, I, y, T), e.render(G, De);
3127
+ }, J = () => {
3128
+ switch (re.forEach((R) => {
3129
+ R.update();
3130
+ }), e.clear(), n) {
3000
3131
  case "Single":
3001
- j();
3132
+ U();
3002
3133
  break;
3003
3134
  case "Side by Side":
3004
3135
  case "Stacked":
3005
- X();
3136
+ D();
3006
3137
  break;
3007
3138
  case "Quad":
3008
- Z();
3139
+ B();
3009
3140
  break;
3010
3141
  }
3011
- A = requestAnimationFrame(z);
3142
+ V = requestAnimationFrame(J);
3012
3143
  };
3013
- return v(), window.addEventListener("resize", U), U(), z(), () => {
3014
- window.removeEventListener("resize", U), cancelAnimationFrame(A), A = -1;
3144
+ return ce(), window.addEventListener("resize", z), z(), J(), () => {
3145
+ window.removeEventListener("resize", z), cancelAnimationFrame(V), V = -1;
3015
3146
  };
3016
- }, [n]), t.cameras.forEach((f) => {
3017
- H.set(f.name, f), me.push(f.name);
3018
- }), /* @__PURE__ */ l.jsxs("div", { className: "multiview", children: [
3019
- /* @__PURE__ */ l.jsxs("div", { className: `cameras ${n === "Single" || n === "Stacked" ? "single" : ""}`, children: [
3020
- n === "Single" && /* @__PURE__ */ l.jsx(l.Fragment, { children: /* @__PURE__ */ l.jsx(Te, { camera: $, options: me, ref: e, onSelect: (f) => {
3021
- var g;
3022
- (g = Y.get($.name)) == null || g.dispose();
3023
- const h = H.get(f);
3024
- h !== void 0 && (d($), $ = h, s(h, e.current));
3147
+ }, [n, e]), Ne(() => {
3148
+ if (e !== null) {
3149
+ const f = new Vn(), g = new ue(), y = (U, D, B, J) => {
3150
+ switch (n) {
3151
+ case "Quad":
3152
+ U < B ? D < J ? f.setFromCamera(g, $) : f.setFromCamera(g, Ae) : D < J ? f.setFromCamera(g, oe) : f.setFromCamera(g, De);
3153
+ break;
3154
+ case "Side by Side":
3155
+ U < B ? f.setFromCamera(g, $) : f.setFromCamera(g, oe);
3156
+ break;
3157
+ case "Single":
3158
+ f.setFromCamera(g, $);
3159
+ break;
3160
+ case "Stacked":
3161
+ D < J ? f.setFromCamera(g, $) : f.setFromCamera(g, oe);
3162
+ break;
3163
+ }
3164
+ }, T = (U) => {
3165
+ if (!yt)
3166
+ return;
3167
+ const D = new ue();
3168
+ e.getSize(D);
3169
+ const B = Math.min(U.clientX, D.x), J = Math.min(U.clientY, D.y);
3170
+ g.x = We(B, 0, D.x, -1, 1), g.y = We(J, 0, D.y, 1, -1);
3171
+ const R = D.x / 2, I = D.y / 2, X = () => {
3172
+ B < R ? g.x = We(B, 0, R, -1, 1) : g.x = We(B, R, D.x, -1, 1);
3173
+ }, pe = () => {
3174
+ J < I ? g.y = We(J, 0, I, 1, -1) : g.y = We(J, I, D.y, 1, -1);
3175
+ };
3176
+ switch (n) {
3177
+ case "Quad":
3178
+ X(), pe();
3179
+ break;
3180
+ case "Side by Side":
3181
+ X();
3182
+ break;
3183
+ case "Stacked":
3184
+ pe(), pe();
3185
+ break;
3186
+ }
3187
+ y(B, J, R, I);
3188
+ const Oe = f.intersectObjects(Ie.children);
3189
+ Oe.length > 0 && it.position.copy(Oe[0].point);
3190
+ }, V = (U) => {
3191
+ if (!yt)
3192
+ return;
3193
+ const D = new ue();
3194
+ if (e.getSize(D), U.clientX >= D.x)
3195
+ return;
3196
+ T(U);
3197
+ const B = f.intersectObjects(Ie.children);
3198
+ B.length > 0 && t.three.getObject(B[0].object.uuid);
3199
+ }, z = C.current;
3200
+ return z.addEventListener("mousemove", T, !1), z.addEventListener("click", V, !1), () => {
3201
+ z.removeEventListener("mousemove", T), z.removeEventListener("click", V);
3202
+ };
3203
+ }
3204
+ }, [n, e]);
3205
+ const te = [];
3206
+ return ae.forEach((f, g) => {
3207
+ te.push(g);
3208
+ }), /* @__PURE__ */ u.jsxs("div", { className: "multiview", children: [
3209
+ /* @__PURE__ */ u.jsx("canvas", { ref: x }),
3210
+ /* @__PURE__ */ u.jsxs("div", { className: `cameras ${n === "Single" || n === "Stacked" ? "single" : ""}`, ref: C, children: [
3211
+ n === "Single" && /* @__PURE__ */ u.jsx(u.Fragment, { children: /* @__PURE__ */ u.jsx(ke, { camera: $, options: te, ref: S, onSelect: (f) => {
3212
+ var y;
3213
+ (y = re.get($.name)) == null || y.dispose();
3214
+ const g = ae.get(f);
3215
+ g !== void 0 && (K($), $ = g, O(g, S.current));
3025
3216
  } }) }),
3026
- (n === "Side by Side" || n === "Stacked") && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
3027
- /* @__PURE__ */ l.jsx(Te, { camera: $, options: me, ref: e, onSelect: (f) => {
3028
- var g;
3029
- (g = Y.get($.name)) == null || g.dispose();
3030
- const h = H.get(f);
3031
- h !== void 0 && (d($), $ = h, s(h, e.current));
3217
+ (n === "Side by Side" || n === "Stacked") && /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
3218
+ /* @__PURE__ */ u.jsx(ke, { camera: $, options: te, ref: S, onSelect: (f) => {
3219
+ var y;
3220
+ (y = re.get($.name)) == null || y.dispose();
3221
+ const g = ae.get(f);
3222
+ g !== void 0 && (K($), $ = g, O(g, S.current));
3032
3223
  } }),
3033
- /* @__PURE__ */ l.jsx(Te, { camera: ee, options: me, ref: o, onSelect: (f) => {
3034
- var g;
3035
- (g = Y.get(ee.name)) == null || g.dispose();
3036
- const h = H.get(f);
3037
- h !== void 0 && (d(ee), ee = h, s(h, o.current));
3224
+ /* @__PURE__ */ u.jsx(ke, { camera: oe, options: te, ref: F, onSelect: (f) => {
3225
+ var y;
3226
+ (y = re.get(oe.name)) == null || y.dispose();
3227
+ const g = ae.get(f);
3228
+ g !== void 0 && (K(oe), oe = g, O(g, F.current));
3038
3229
  } })
3039
3230
  ] }),
3040
- n === "Quad" && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
3041
- /* @__PURE__ */ l.jsx(Te, { camera: $, options: me, ref: e, onSelect: (f) => {
3042
- var g;
3043
- (g = Y.get($.name)) == null || g.dispose();
3044
- const h = H.get(f);
3045
- h !== void 0 && (d($), $ = h, s(h, e.current));
3231
+ n === "Quad" && /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
3232
+ /* @__PURE__ */ u.jsx(ke, { camera: $, options: te, ref: S, onSelect: (f) => {
3233
+ var y;
3234
+ (y = re.get($.name)) == null || y.dispose();
3235
+ const g = ae.get(f);
3236
+ g !== void 0 && (K($), $ = g, O(g, S.current));
3046
3237
  } }),
3047
- /* @__PURE__ */ l.jsx(Te, { camera: ee, options: me, ref: o, onSelect: (f) => {
3048
- var g;
3049
- (g = Y.get(ee.name)) == null || g.dispose();
3050
- const h = H.get(f);
3051
- h !== void 0 && (d(ee), ee = h, s(h, o.current));
3238
+ /* @__PURE__ */ u.jsx(ke, { camera: oe, options: te, ref: F, onSelect: (f) => {
3239
+ var y;
3240
+ (y = re.get(oe.name)) == null || y.dispose();
3241
+ const g = ae.get(f);
3242
+ g !== void 0 && (K(oe), oe = g, O(g, F.current));
3052
3243
  } }),
3053
- /* @__PURE__ */ l.jsx(Te, { camera: Ue, options: me, ref: u, onSelect: (f) => {
3054
- var g;
3055
- (g = Y.get(Ue.name)) == null || g.dispose();
3056
- const h = H.get(f);
3057
- h !== void 0 && (d(Ue), Ue = h, s(h, u.current));
3244
+ /* @__PURE__ */ u.jsx(ke, { camera: Ae, options: te, ref: Q, onSelect: (f) => {
3245
+ var y;
3246
+ (y = re.get(Ae.name)) == null || y.dispose();
3247
+ const g = ae.get(f);
3248
+ g !== void 0 && (K(Ae), Ae = g, O(g, Q.current));
3058
3249
  } }),
3059
- /* @__PURE__ */ l.jsx(Te, { camera: Be, options: me, ref: c, onSelect: (f) => {
3060
- var g;
3061
- (g = Y.get(Be.name)) == null || g.dispose();
3062
- const h = H.get(f);
3063
- h !== void 0 && (d(Be), Be = h, s(h, c.current));
3250
+ /* @__PURE__ */ u.jsx(ke, { camera: De, options: te, ref: H, onSelect: (f) => {
3251
+ var y;
3252
+ (y = re.get(De.name)) == null || y.dispose();
3253
+ const g = ae.get(f);
3254
+ g !== void 0 && (K(De), De = g, O(g, H.current));
3064
3255
  } })
3065
3256
  ] })
3066
3257
  ] }),
3067
- /* @__PURE__ */ l.jsxs("div", { className: "settings", children: [
3068
- /* @__PURE__ */ l.jsx(
3069
- Rt,
3258
+ /* @__PURE__ */ u.jsxs("div", { className: "settings", children: [
3259
+ /* @__PURE__ */ u.jsx(
3260
+ Et,
3070
3261
  {
3071
- index: Ht.indexOf(n),
3072
- options: Ht,
3262
+ index: en.indexOf(n),
3263
+ options: en,
3073
3264
  onSelect: (f) => {
3074
- f !== n && (m(), a(f));
3265
+ f !== n && (de(), a(f));
3266
+ },
3267
+ open: s,
3268
+ onToggle: (f) => {
3269
+ c(f), l && d(!1), p && m(!1);
3075
3270
  }
3076
3271
  }
3077
3272
  ),
3078
- /* @__PURE__ */ l.jsx(
3079
- Rt,
3273
+ /* @__PURE__ */ u.jsx(
3274
+ Et,
3080
3275
  {
3081
- index: 0,
3082
- options: mr,
3276
+ index: tn.indexOf(bt),
3277
+ options: tn,
3083
3278
  onSelect: (f) => {
3084
- if (f !== Ct)
3085
- switch (Ct = f, Ct) {
3086
- case "Default":
3087
- F.overrideMaterial = null;
3279
+ if (f !== bt)
3280
+ switch (bt = f, bt) {
3281
+ case "Depth":
3282
+ G.overrideMaterial = Na;
3088
3283
  break;
3089
3284
  case "Normals":
3090
- F.overrideMaterial = gr;
3285
+ G.overrideMaterial = La;
3286
+ break;
3287
+ default:
3288
+ case "Renderer":
3289
+ G.overrideMaterial = null;
3091
3290
  break;
3092
3291
  case "Wireframe":
3093
- F.overrideMaterial = vr;
3292
+ G.overrideMaterial = Ua;
3094
3293
  break;
3095
3294
  case "UVs":
3096
- F.overrideMaterial = br;
3295
+ G.overrideMaterial = Fa;
3097
3296
  break;
3098
3297
  }
3298
+ },
3299
+ open: l,
3300
+ onToggle: (f) => {
3301
+ s && c(!1), d(f), p && m(!1);
3302
+ }
3303
+ }
3304
+ ),
3305
+ /* @__PURE__ */ u.jsx(
3306
+ Et,
3307
+ {
3308
+ index: 0,
3309
+ options: [
3310
+ "Orbit Mode",
3311
+ "Selection Mode"
3312
+ ],
3313
+ onSelect: (f) => {
3314
+ yt = f === "Selection Mode", it.visible = yt;
3315
+ },
3316
+ open: p,
3317
+ onToggle: (f) => {
3318
+ s && c(!1), l && d(!1), m(f);
3099
3319
  }
3100
3320
  }
3101
3321
  )
3102
3322
  ] })
3103
3323
  ] });
3104
3324
  }
3105
- function Lr(t) {
3106
- return /* @__PURE__ */ l.jsxs("div", { className: "editor", ref: t.ref, style: t.style, children: [
3107
- /* @__PURE__ */ l.jsx("header", { children: t.header }),
3325
+ function oi(t) {
3326
+ return /* @__PURE__ */ u.jsxs("div", { className: "editor", ref: t.ref, style: t.style, children: [
3327
+ /* @__PURE__ */ u.jsx("header", { children: t.header }),
3108
3328
  t.children,
3109
- /* @__PURE__ */ l.jsx("footer", { children: t.footer })
3329
+ /* @__PURE__ */ u.jsx("footer", { children: t.footer })
3110
3330
  ] });
3111
3331
  }
3112
3332
  export {
3113
- Mt as Accordion,
3114
- Rr as Application,
3115
- mt as BaseRemote,
3116
- an as ChildObject,
3117
- nr as ContainerObject,
3118
- Wn as Draggable,
3119
- zn as DraggableItem,
3120
- Hn as Dropdown,
3121
- Kn as DropdownItem,
3122
- Lr as Editor,
3123
- Jn as InfiniteGridHelper,
3124
- fr as Inspector,
3125
- Nr as MultiView,
3126
- rn as NavButton,
3127
- Pr as RemoteComponents,
3128
- Dr as RemoteController,
3129
- jr as RemoteTheatre,
3130
- _r as RemoteThree,
3131
- kr as RemoteTweakpane,
3132
- Ir as SceneHierarchy,
3133
- Ar as SceneInspector,
3134
- D as ToolEvents,
3135
- tr as UVMaterial,
3136
- Or as clamp,
3137
- Nn as colorToHex,
3333
+ Lt as Accordion,
3334
+ Za as Application,
3335
+ xt as BaseRemote,
3336
+ gn as ChildObject,
3337
+ ya as ContainerObject,
3338
+ la as Draggable,
3339
+ ca as DraggableItem,
3340
+ ua as Dropdown,
3341
+ da as DropdownItem,
3342
+ oi as Editor,
3343
+ ma as InfiniteGridHelper,
3344
+ Aa as Inspector,
3345
+ ri as MultiView,
3346
+ mn as NavButton,
3347
+ Ja as RemoteComponents,
3348
+ ni as RemoteController,
3349
+ Qa as RemoteTheatre,
3350
+ ei as RemoteThree,
3351
+ ti as RemoteTweakpane,
3352
+ ii as SceneInspector,
3353
+ ai as SidePanel,
3354
+ A as ToolEvents,
3355
+ ba as UVMaterial,
3356
+ Ka as clamp,
3357
+ Jn as colorToHex,
3138
3358
  k as debugDispatcher,
3139
- Mr as distance,
3140
- en as hierarchyUUID,
3141
- An as isColor,
3142
- In as randomID
3359
+ fn as dispose,
3360
+ ea as disposeMaterial,
3361
+ qa as disposeTexture,
3362
+ Xa as distance,
3363
+ dn as hierarchyUUID,
3364
+ Zn as isColor,
3365
+ qn as randomID,
3366
+ Qn as resetThreeObjects,
3367
+ Rt as round,
3368
+ At as totalThreeObjects
3143
3369
  };