@tomorrowevening/hermes 0.0.46 → 0.0.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/hermes.es.js CHANGED
@@ -1,68 +1,75 @@
1
- import { EventDispatcher as en, Texture as tn, CubeTexture as kn, RepeatWrapping as Ut, Color as St, FrontSide as jn, BackSide as Dn, DoubleSide as nn, NoBlending as In, NormalBlending as Nn, AdditiveBlending as Ln, SubtractiveBlending as Fn, MultiplyBlending as Bn, CustomBlending as Un, AddEquation as $n, SubtractEquation as zn, ReverseSubtractEquation as Yn, MinEquation as Gn, MaxEquation as Vn, ZeroFactor as an, OneFactor as rn, SrcColorFactor as sn, OneMinusSrcColorFactor as on, SrcAlphaFactor as cn, OneMinusSrcAlphaFactor as ln, DstAlphaFactor as dn, OneMinusDstAlphaFactor as un, DstColorFactor as hn, OneMinusDstColorFactor as fn, SrcAlphaSaturateFactor as Hn, ConstantColorFactor as pn, OneMinusConstantColorFactor as mn, ConstantAlphaFactor as vn, OneMinusConstantAlphaFactor as gn, Matrix4 as Wn, Vector3 as W, Euler as qn, Ray as Kn, Plane as Xn, MathUtils as Zn, MOUSE as Xe, TOUCH as Ze, Quaternion as $t, Spherical as zt, Vector2 as fe, ShaderMaterial as bn, GLSL3 as Jn, Mesh as Qn, PlaneGeometry as ea, Scene as ta, Group as na, AxesHelper as Yt, MeshDepthMaterial as aa, MeshNormalMaterial as ia, MeshBasicMaterial as ra, PerspectiveCamera as Rt, WebGLRenderer as sa, Raycaster as oa, OrthographicCamera as Gt, CameraHelper as ca } from "three";
2
- import { Pane as la } from "tweakpane";
3
- import * as da from "@tweakpane/plugin-essentials";
4
- import yn, { useState as oe, useRef as Re, useEffect as _e, forwardRef as ua, useMemo as Se } from "react";
5
- import { Reorder as En } from "framer-motion";
6
- const Sn = () => {
7
- }, si = () => {
1
+ import { EventDispatcher as an, Texture as rn, CubeTexture as In, RepeatWrapping as $t, Color as Ct, FrontSide as Nn, BackSide as Ln, DoubleSide as sn, NoBlending as Fn, NormalBlending as Bn, AdditiveBlending as Un, SubtractiveBlending as $n, MultiplyBlending as zn, CustomBlending as Yn, AddEquation as Vn, SubtractEquation as Gn, ReverseSubtractEquation as Hn, MinEquation as Wn, MaxEquation as qn, ZeroFactor as on, OneFactor as cn, SrcColorFactor as ln, OneMinusSrcColorFactor as un, SrcAlphaFactor as dn, OneMinusSrcAlphaFactor as hn, DstAlphaFactor as fn, OneMinusDstAlphaFactor as pn, DstColorFactor as mn, OneMinusDstColorFactor as vn, SrcAlphaSaturateFactor as Kn, ConstantColorFactor as gn, OneMinusConstantColorFactor as bn, ConstantAlphaFactor as yn, OneMinusConstantAlphaFactor as En, Matrix4 as Xn, Vector3 as q, Euler as Zn, Ray as Jn, Plane as Qn, MathUtils as ea, MOUSE as et, TOUCH as tt, Quaternion as zt, Spherical as Yt, Vector2 as me, ShaderMaterial as xn, GLSL3 as ta, Mesh as na, PlaneGeometry as aa, Scene as ia, Group as ra, AxesHelper as Vt, MeshDepthMaterial as sa, MeshNormalMaterial as oa, MeshBasicMaterial as ca, WebGLRenderer as la, PerspectiveCamera as Pt, Raycaster as ua, OrthographicCamera as Gt, CameraHelper as da } from "three";
2
+ import { Pane as ha } from "tweakpane";
3
+ import * as fa from "@tweakpane/plugin-essentials";
4
+ import Cn, { useState as ae, useRef as fe, useEffect as ke, forwardRef as pa, useMemo as xe } from "react";
5
+ import { Reorder as Sn } from "framer-motion";
6
+ const wn = () => {
7
+ }, fi = () => {
8
8
  };
9
- function lt(t) {
9
+ function St(t) {
10
10
  return t.substring(0, 1).toUpperCase() + t.substring(1);
11
11
  }
12
- function oi(t, n, a) {
12
+ function Xe(t, n, a) {
13
13
  return Math.min(n, Math.max(t, a));
14
14
  }
15
- function ci(t, n) {
15
+ function Ht(t, n, a) {
16
+ return (a - t) / (n - t);
17
+ }
18
+ function Wt(t, n, a) {
19
+ return t * (1 - a) + n * a;
20
+ }
21
+ function pi(t, n) {
16
22
  const a = t - n;
17
23
  return Math.sqrt(a * a);
18
24
  }
19
- function ha() {
25
+ function ma() {
20
26
  return Math.round(Math.random() * 1e6).toString();
21
27
  }
22
- function fa(t) {
28
+ function va(t) {
23
29
  return t.r !== void 0 && t.g !== void 0 && t.b !== void 0;
24
30
  }
25
- function pa(t) {
26
- const n = Math.round(t.r * 255), a = Math.round(t.g * 255), e = Math.round(t.b * 255), i = (d) => {
27
- const u = d.toString(16);
28
- return u.length === 1 ? "0" + u : u;
29
- }, o = i(n), h = i(a), c = i(e);
30
- return "#" + o + h + c;
31
+ function ga(t) {
32
+ const n = Math.round(t.r * 255), a = Math.round(t.g * 255), e = Math.round(t.b * 255), i = (u) => {
33
+ const d = u.toString(16);
34
+ return d.length === 1 ? "0" + d : d;
35
+ }, c = i(n), h = i(a), o = i(e);
36
+ return "#" + c + h + o;
31
37
  }
32
- function _t(t, n = 1) {
38
+ function ht(t, n = 1) {
33
39
  return Number(t.toFixed(n));
34
40
  }
35
- let jt = 0;
36
- const ma = () => {
37
- jt = 0;
38
- }, Cn = (t) => {
41
+ let Dt = 0;
42
+ const ba = () => {
43
+ Dt = 0;
44
+ }, On = (t) => {
39
45
  if (!t)
40
46
  return;
41
47
  let n = t.name.replace(" ", "");
42
- n.length === 0 && (n = `obj_${jt}`, jt++), t.parent !== null && (n = `${t.parent.uuid}.${n}`), t.uuid = n, t.children.forEach((a) => {
43
- Cn(a);
48
+ n.length === 0 && (n = `obj_${Dt}`, Dt++), t.parent !== null && (n = `${t.parent.uuid}.${n}`), t.uuid = n, t.children.forEach((a) => {
49
+ On(a);
44
50
  });
45
- }, li = (t) => {
51
+ }, mi = (t) => {
46
52
  t?.dispose();
47
- }, va = (t) => {
53
+ }, ya = (t) => {
48
54
  t && (Array.isArray(t) ? t.forEach((n) => n.dispose()) : t.dispose());
49
- }, xn = (t) => {
55
+ }, Mn = (t) => {
50
56
  if (t) {
51
57
  for (; t.children.length > 0; ) {
52
58
  const n = t.children[0];
53
- n.type === "Audio" ? (n.pause(), n.parent && n.parent.remove(n)) : xn(n);
59
+ n.type === "Audio" ? (n.pause(), n.parent && n.parent.remove(n)) : Mn(n);
54
60
  }
55
61
  if (t.parent && t.parent.remove(t), t.isMesh) {
56
62
  const n = t;
57
- n.geometry?.dispose(), va(n.material);
63
+ n.geometry?.dispose(), ya(n.material);
58
64
  }
59
65
  t.dispose !== void 0 && t.dispose();
60
66
  }
61
67
  };
62
- class di {
68
+ class vi {
63
69
  components = /* @__PURE__ */ new Map();
64
70
  listen;
65
71
  // Protected
72
+ _appID = "";
66
73
  _debugEnabled;
67
74
  _broadcastChannel = void 0;
68
75
  _webSocket = void 0;
@@ -70,7 +77,7 @@ class di {
70
77
  _connected = !1;
71
78
  _useBC = !1;
72
79
  constructor(n, a, e = !0) {
73
- this._debugEnabled = a, a && (this._useBC = e, e ? (this._broadcastChannel = new BroadcastChannel(n), this._broadcastChannel.addEventListener("message", this.messageHandler)) : (this._webSocket = new WebSocket(n), this._webSocket.addEventListener("open", this.openHandler), this._webSocket.addEventListener("close", this.closeHandler), this._webSocket.addEventListener("message", this.messageHandler)));
80
+ this._appID = n, this._debugEnabled = a, a && (this._useBC = e, e ? (this._broadcastChannel = new BroadcastChannel(n), this._broadcastChannel.addEventListener("message", this.messageHandler)) : (this._webSocket = new WebSocket(n), this._webSocket.addEventListener("open", this.openHandler), this._webSocket.addEventListener("close", this.closeHandler), this._webSocket.addEventListener("message", this.messageHandler)));
74
81
  }
75
82
  addComponent(n, a) {
76
83
  this.components.set(n, a);
@@ -94,6 +101,9 @@ class di {
94
101
  this._connected = !1;
95
102
  };
96
103
  // Getters / Setters
104
+ get appID() {
105
+ return this._appID;
106
+ }
97
107
  get connected() {
98
108
  return this._connected;
99
109
  }
@@ -113,7 +123,7 @@ class di {
113
123
  n && (this._mode = "editor");
114
124
  }
115
125
  }
116
- const P = new en(), k = {
126
+ const D = new an(), I = {
117
127
  CUSTOM: "ToolEvents::custom",
118
128
  // Components
119
129
  SELECT_DROPDOWN: "ToolEvents::selectDropdown",
@@ -129,7 +139,7 @@ const P = new en(), k = {
129
139
  ADD_CAMERA: "ToolEvents::addCamera",
130
140
  REMOVE_CAMERA: "ToolEvents::removeCamera"
131
141
  };
132
- class Ct {
142
+ class wt {
133
143
  app;
134
144
  constructor(n) {
135
145
  this.app = n;
@@ -141,7 +151,7 @@ class Ct {
141
151
  handleEditor(n, a, e) {
142
152
  }
143
153
  }
144
- class ui extends Ct {
154
+ class gi extends wt {
145
155
  selectDropdown(n, a) {
146
156
  this.app.send({
147
157
  event: "selectComponent",
@@ -165,22 +175,22 @@ class ui extends Ct {
165
175
  handleApp(n, a, e) {
166
176
  switch (e.event) {
167
177
  case "selectComponent":
168
- P.dispatchEvent({ type: k.SELECT_DROPDOWN, value: e.data });
178
+ D.dispatchEvent({ type: I.SELECT_DROPDOWN, value: e.data });
169
179
  break;
170
180
  case "draggableListUpdate":
171
- P.dispatchEvent({ type: k.DRAG_UPDATE, value: e.data });
181
+ D.dispatchEvent({ type: I.DRAG_UPDATE, value: e.data });
172
182
  break;
173
183
  }
174
184
  }
175
185
  }
176
- class Nt extends Ct {
186
+ class Lt extends wt {
177
187
  project;
178
188
  sheets = /* @__PURE__ */ new Map();
179
189
  sheetObjects = /* @__PURE__ */ new Map();
180
190
  sheetObjectCBs = /* @__PURE__ */ new Map();
181
191
  sheetObjectUnsubscribe = /* @__PURE__ */ new Map();
182
192
  activeSheet;
183
- studio;
193
+ studio = void 0;
184
194
  static rafDriver = void 0;
185
195
  dispose() {
186
196
  this.project = void 0, this.sheets = /* @__PURE__ */ new Map(), this.sheetObjects = /* @__PURE__ */ new Map(), this.sheetObjectCBs = /* @__PURE__ */ new Map(), this.sheetObjectUnsubscribe = /* @__PURE__ */ new Map();
@@ -222,17 +232,17 @@ class Nt extends Ct {
222
232
  console.error("Theatre Project hasn't been created yet.");
223
233
  return;
224
234
  }
225
- const o = this.sheet(n);
226
- if (o === void 0)
235
+ const c = this.sheet(n);
236
+ if (c === void 0)
227
237
  return;
228
238
  const h = `${n}_${a}`;
229
- let c = this.sheetObjects.get(h);
230
- c !== void 0 ? c = o.object(a, { ...e, ...c.value }, { reconfigure: !0 }) : c = o.object(a, e), this.sheetObjects.set(h, c), this.sheetObjectCBs.set(h, i !== void 0 ? i : Sn);
231
- const d = c.onValuesChange((u) => {
239
+ let o = this.sheetObjects.get(h);
240
+ o !== void 0 ? o = c.object(a, { ...e, ...o.value }, { reconfigure: !0 }) : o = c.object(a, e), this.sheetObjects.set(h, o), this.sheetObjectCBs.set(h, i !== void 0 ? i : wn);
241
+ const u = o.onValuesChange((d) => {
232
242
  if (this.app.editor) {
233
- for (const b in u) {
234
- const E = u[b];
235
- typeof E == "object" && fa(E) && (u[b] = {
243
+ for (const b in d) {
244
+ const E = d[b];
245
+ typeof E == "object" && va(E) && (d[b] = {
236
246
  r: E.r,
237
247
  g: E.g,
238
248
  b: E.b,
@@ -245,14 +255,14 @@ class Nt extends Ct {
245
255
  data: {
246
256
  sheet: n,
247
257
  sheetObject: h,
248
- values: u
258
+ values: d
249
259
  }
250
260
  });
251
261
  }
252
- const v = this.sheetObjectCBs.get(h);
253
- v !== void 0 && v(u);
262
+ const f = this.sheetObjectCBs.get(h);
263
+ f !== void 0 && f(d);
254
264
  });
255
- return this.sheetObjectUnsubscribe.set(h, d), c;
265
+ return this.sheetObjectUnsubscribe.set(h, u), o;
256
266
  }
257
267
  unsubscribe(n) {
258
268
  if (this.project === void 0) {
@@ -261,24 +271,24 @@ class Nt extends Ct {
261
271
  }
262
272
  const a = n.address.sheetId, e = n.address.objectKey;
263
273
  this.sheets.get(a)?.detachObject(e);
264
- const o = `${a}_${e}`, h = this.sheetObjectUnsubscribe.get(o);
265
- h !== void 0 && (this.sheetObjects.delete(o), this.sheetObjectCBs.delete(o), this.sheetObjectUnsubscribe.delete(o), h());
274
+ const c = `${a}_${e}`, h = this.sheetObjectUnsubscribe.get(c);
275
+ h !== void 0 && (this.sheetObjects.delete(c), this.sheetObjectCBs.delete(c), this.sheetObjectUnsubscribe.delete(c), h());
266
276
  }
267
277
  handleApp(n, a, e) {
268
278
  const i = a;
269
- let o;
279
+ let c;
270
280
  switch (e.event) {
271
281
  case "setSheet":
272
- o = i.sheets.get(e.data.sheet), o !== void 0 && (i.activeSheet = o, this.studio.setSelection([o]));
282
+ c = i.sheets.get(e.data.sheet), c !== void 0 && (i.activeSheet = c, this.studio?.setSelection([c]));
273
283
  break;
274
284
  case "setSheetObject":
275
- o = i.sheetObjects.get(`${e.data.sheet}_${e.data.key}`), o !== void 0 && this.studio.setSelection([o]);
285
+ c = i.sheetObjects.get(`${e.data.sheet}_${e.data.key}`), c !== void 0 && this.studio?.setSelection([c]);
276
286
  break;
277
287
  case "updateSheetObject":
278
- o = i.sheets.get(e.data.sheet), o !== void 0 && o.sequence.pause(), o = i.sheetObjectCBs.get(e.data.sheetObject), o !== void 0 && o(e.data.values);
288
+ c = i.sheets.get(e.data.sheet), c !== void 0 && c.sequence.pause(), c = i.sheetObjectCBs.get(e.data.sheetObject), c !== void 0 && c(e.data.values);
279
289
  break;
280
290
  case "updateTimeline":
281
- o = i.sheets.get(e.data.sheet), i.activeSheet !== void 0 && (i.activeSheet.sequence.position = e.data.position);
291
+ c = i.sheets.get(e.data.sheet), i.activeSheet !== void 0 && (i.activeSheet.sequence.position = e.data.position);
282
292
  break;
283
293
  }
284
294
  }
@@ -297,29 +307,29 @@ class Nt extends Ct {
297
307
  }
298
308
  handleEditorApp(n, a) {
299
309
  if (n.editor) {
300
- this.studio.ui.restore(), this.studio.onSelectionChange((h) => {
301
- h.length < 1 || h.forEach((c) => {
302
- let d = c.address.sheetId, u = "setSheet", v = {};
303
- switch (c.type) {
310
+ this.studio?.ui.restore(), this.studio?.onSelectionChange((h) => {
311
+ h.length < 1 || h.forEach((o) => {
312
+ let u = o.address.sheetId, d = "setSheet", f = {};
313
+ switch (o.type) {
304
314
  case "Theatre_Sheet_PublicAPI":
305
- u = "setSheet", v = {
306
- sheet: c.address.sheetId
307
- }, a.activeSheet = a.sheets.get(c.address.sheetId);
315
+ d = "setSheet", f = {
316
+ sheet: o.address.sheetId
317
+ }, a.activeSheet = a.sheets.get(o.address.sheetId);
308
318
  break;
309
319
  case "Theatre_SheetObject_PublicAPI":
310
- u = "setSheetObject", d += `_${c.address.objectKey}`, v = {
311
- id: d,
312
- sheet: c.address.sheetId,
313
- key: c.address.objectKey
314
- }, a.activeSheet = a.sheets.get(c.address.sheetId);
320
+ d = "setSheetObject", u += `_${o.address.objectKey}`, f = {
321
+ id: u,
322
+ sheet: o.address.sheetId,
323
+ key: o.address.objectKey
324
+ }, a.activeSheet = a.sheets.get(o.address.sheetId);
315
325
  break;
316
326
  }
317
- n.send({ event: u, target: "app", data: v });
327
+ n.send({ event: d, target: "app", data: f });
318
328
  });
319
329
  });
320
330
  let e = -1;
321
331
  const i = () => {
322
- if (Nt.rafDriver?.tick(performance.now()), a.activeSheet !== void 0 && e !== a.activeSheet.sequence.position) {
332
+ if (Lt.rafDriver?.tick(performance.now()), a.activeSheet !== void 0 && e !== a.activeSheet.sequence.position) {
323
333
  e = a.activeSheet.sequence.position;
324
334
  const h = a.activeSheet;
325
335
  n.send({
@@ -331,39 +341,39 @@ class Nt extends Ct {
331
341
  }
332
342
  });
333
343
  }
334
- }, o = () => {
335
- i(), requestAnimationFrame(o);
344
+ }, c = () => {
345
+ i(), requestAnimationFrame(c);
336
346
  };
337
- i(), o();
347
+ i(), c();
338
348
  } else
339
- this.studio.ui.hide();
349
+ this.studio?.ui.hide();
340
350
  }
341
351
  }
342
- function hi(t, n, a) {
352
+ function bi(t, n, a) {
343
353
  if (t.editor) {
344
354
  a.ui.restore(), a.onSelectionChange((h) => {
345
- h.length < 1 || h.forEach((c) => {
346
- let d = c.address.sheetId, u = "setSheet", v = {};
347
- switch (c.type) {
355
+ h.length < 1 || h.forEach((o) => {
356
+ let u = o.address.sheetId, d = "setSheet", f = {};
357
+ switch (o.type) {
348
358
  case "Theatre_Sheet_PublicAPI":
349
- u = "setSheet", v = {
350
- sheet: c.address.sheetId
351
- }, n.activeSheet = n.sheets.get(c.address.sheetId);
359
+ d = "setSheet", f = {
360
+ sheet: o.address.sheetId
361
+ }, n.activeSheet = n.sheets.get(o.address.sheetId);
352
362
  break;
353
363
  case "Theatre_SheetObject_PublicAPI":
354
- u = "setSheetObject", d += `_${c.address.objectKey}`, v = {
355
- id: d,
356
- sheet: c.address.sheetId,
357
- key: c.address.objectKey
358
- }, n.activeSheet = n.sheets.get(c.address.sheetId);
364
+ d = "setSheetObject", u += `_${o.address.objectKey}`, f = {
365
+ id: u,
366
+ sheet: o.address.sheetId,
367
+ key: o.address.objectKey
368
+ }, n.activeSheet = n.sheets.get(o.address.sheetId);
359
369
  break;
360
370
  }
361
- t.send({ event: u, target: "app", data: v });
371
+ t.send({ event: d, target: "app", data: f });
362
372
  });
363
373
  });
364
374
  let e = -1;
365
375
  const i = () => {
366
- if (Nt.rafDriver?.tick(performance.now()), n.activeSheet !== void 0 && e !== n.activeSheet.sequence.position) {
376
+ if (Lt.rafDriver?.tick(performance.now()), n.activeSheet !== void 0 && e !== n.activeSheet.sequence.position) {
367
377
  e = n.activeSheet.sequence.position;
368
378
  const h = n.activeSheet;
369
379
  t.send({
@@ -375,14 +385,14 @@ function hi(t, n, a) {
375
385
  }
376
386
  });
377
387
  }
378
- }, o = () => {
379
- i(), requestAnimationFrame(o);
388
+ }, c = () => {
389
+ i(), requestAnimationFrame(c);
380
390
  };
381
- i(), o();
391
+ i(), c();
382
392
  } else
383
393
  a.ui.hide();
384
394
  }
385
- function ga(t) {
395
+ function Ea(t) {
386
396
  if (t.name === "cameras")
387
397
  return "camera";
388
398
  if (t.name === "interactive")
@@ -396,7 +406,7 @@ function ga(t) {
396
406
  const n = t.type;
397
407
  return n.search("Helper") > -1 ? "icon_utils" : n.search("Camera") > -1 ? "camera" : n.search("Light") > -1 ? "light" : "obj3D";
398
408
  }
399
- function wn(t) {
409
+ function Tn(t) {
400
410
  const n = {
401
411
  name: t.name,
402
412
  type: t.type,
@@ -404,10 +414,10 @@ function wn(t) {
404
414
  children: []
405
415
  };
406
416
  return t.children.forEach((a) => {
407
- n.children.push(wn(a));
417
+ n.children.push(Tn(a));
408
418
  }), n;
409
419
  }
410
- function ba(t) {
420
+ function xa(t) {
411
421
  const n = {};
412
422
  for (const a in t) {
413
423
  const e = t[a].value;
@@ -415,7 +425,7 @@ function ba(t) {
415
425
  }
416
426
  return n;
417
427
  }
418
- function ya(t) {
428
+ function Ca(t) {
419
429
  switch (t) {
420
430
  case "blendSrcAlpha":
421
431
  case "blendDstAlpha":
@@ -427,10 +437,10 @@ function ya(t) {
427
437
  }
428
438
  return !1;
429
439
  }
430
- function Je(t) {
440
+ function nt(t) {
431
441
  const n = {};
432
442
  for (const a in t) {
433
- if (a.substring(0, 1) === "_" || a.substring(0, 2) === "is" || ya(a))
443
+ if (a.substring(0, 1) === "_" || a.substring(0, 2) === "is" || Ca(a))
434
444
  continue;
435
445
  const e = typeof t[a], i = t[a];
436
446
  switch (e) {
@@ -442,13 +452,13 @@ function Je(t) {
442
452
  case "object":
443
453
  if (i !== null)
444
454
  if (n[a] = i, i.isTexture)
445
- if (i instanceof tn) {
446
- const o = i.source.toJSON();
447
- n[a] = { src: o.url };
455
+ if (i instanceof rn) {
456
+ const c = i.source.toJSON();
457
+ n[a] = { src: c.url };
448
458
  } else
449
- i instanceof kn && (console.log("env map"), console.log(i.source.data), console.log(i.source.toJSON()), n[a] = { src: "" });
459
+ i instanceof In && (console.log("env map"), console.log(i.source.data), console.log(i.source.toJSON()), n[a] = { src: "" });
450
460
  else
451
- a === "uniforms" && (n[a] = ba(n[a]));
461
+ a === "uniforms" && (n[a] = xa(n[a]));
452
462
  else
453
463
  n[a] = { src: "" };
454
464
  break;
@@ -482,29 +492,29 @@ function At(t) {
482
492
  const e = t;
483
493
  if (Array.isArray(e.material)) {
484
494
  const i = [];
485
- e.material.forEach((o) => {
486
- i.push(Je(o));
495
+ e.material.forEach((c) => {
496
+ i.push(nt(c));
487
497
  }), n.material = i;
488
498
  } else
489
- n.material = Je(e.material);
499
+ n.material = nt(e.material);
490
500
  } else if (a.search("points") > -1) {
491
501
  const e = t;
492
502
  if (Array.isArray(e.material)) {
493
503
  const i = [];
494
- e.material.forEach((o) => {
495
- i.push(Je(o));
504
+ e.material.forEach((c) => {
505
+ i.push(nt(c));
496
506
  }), n.material = i;
497
507
  } else
498
- n.material = Je(e.material);
508
+ n.material = nt(e.material);
499
509
  } else if (a.search("line") > -1) {
500
510
  const e = t;
501
511
  if (Array.isArray(e.material)) {
502
512
  const i = [];
503
- e.material.forEach((o) => {
504
- i.push(Je(o));
513
+ e.material.forEach((c) => {
514
+ i.push(nt(c));
505
515
  }), n.material = i;
506
516
  } else
507
- n.material = Je(e.material);
517
+ n.material = nt(e.material);
508
518
  } else
509
519
  a.search("camera") > -1 ? t.type === "PerspectiveCamera" ? n.perspectiveCameraInfo = {
510
520
  fov: t.fov,
@@ -534,7 +544,7 @@ function At(t) {
534
544
  });
535
545
  return n;
536
546
  }
537
- function Ea(t, n) {
547
+ function Sa(t, n) {
538
548
  const a = n.split(".");
539
549
  switch (a.length) {
540
550
  case 1:
@@ -551,7 +561,7 @@ function Ea(t, n) {
551
561
  return t[a[0]][a[1]][a[2]][a[3]][a[4]][a[5]];
552
562
  }
553
563
  }
554
- function ee(t, n, a) {
564
+ function K(t, n, a) {
555
565
  const e = n.split(".");
556
566
  switch (e.length) {
557
567
  case 1:
@@ -571,16 +581,16 @@ function ee(t, n, a) {
571
581
  break;
572
582
  }
573
583
  }
574
- function Dt(t) {
584
+ function It(t) {
575
585
  return new Promise((n, a) => {
576
586
  const e = new Image();
577
587
  e.onload = () => {
578
- const i = new tn(e);
579
- i.wrapS = Ut, i.wrapT = Ut, i.needsUpdate = !0, n(i);
588
+ const i = new rn(e);
589
+ i.wrapS = $t, i.wrapT = $t, i.needsUpdate = !0, n(i);
580
590
  }, e.onerror = a, e.src = t;
581
591
  });
582
592
  }
583
- class fi extends Ct {
593
+ class yi extends wt {
584
594
  scene = void 0;
585
595
  renderer = void 0;
586
596
  getObject(n) {
@@ -635,8 +645,8 @@ class fi extends Ct {
635
645
  setScene(n) {
636
646
  if (n === void 0 || (this.scene = n, !this.app.debugEnabled))
637
647
  return;
638
- ma(), Cn(this.scene);
639
- const a = wn(this.scene);
648
+ ba(), On(this.scene);
649
+ const a = Tn(this.scene);
640
650
  this.app.send({
641
651
  event: "setScene",
642
652
  target: "editor",
@@ -666,37 +676,56 @@ class fi extends Ct {
666
676
  handleApp(n, a, e) {
667
677
  switch (e.event) {
668
678
  case "getObject":
669
- P.dispatchEvent({ type: k.GET_OBJECT, value: e.data });
679
+ D.dispatchEvent({ type: I.GET_OBJECT, value: e.data });
670
680
  break;
671
681
  case "updateObject":
672
- P.dispatchEvent({ type: k.UPDATE_OBJECT, value: e.data });
682
+ D.dispatchEvent({ type: I.UPDATE_OBJECT, value: e.data });
673
683
  break;
674
684
  case "createTexture":
675
- P.dispatchEvent({ type: k.CREATE_TEXTURE, value: e.data });
685
+ D.dispatchEvent({ type: I.CREATE_TEXTURE, value: e.data });
676
686
  break;
677
687
  case "requestMethod":
678
- P.dispatchEvent({ type: k.REQUEST_METHOD, value: e.data });
688
+ D.dispatchEvent({ type: I.REQUEST_METHOD, value: e.data });
679
689
  break;
680
690
  }
681
691
  }
682
692
  handleEditor(n, a, e) {
683
693
  switch (e.event) {
684
694
  case "setObject":
685
- P.dispatchEvent({ type: k.SET_OBJECT, value: e.data });
695
+ D.dispatchEvent({ type: I.SET_OBJECT, value: e.data });
686
696
  break;
687
697
  case "setScene":
688
- P.dispatchEvent({ type: k.SET_SCENE, value: e.data });
698
+ D.dispatchEvent({ type: I.SET_SCENE, value: e.data });
689
699
  break;
690
700
  case "addCamera":
691
- P.dispatchEvent({ type: k.ADD_CAMERA, value: e.data });
701
+ D.dispatchEvent({ type: I.ADD_CAMERA, value: e.data });
692
702
  break;
693
703
  case "removeCamera":
694
- P.dispatchEvent({ type: k.REMOVE_CAMERA, value: e.data });
704
+ D.dispatchEvent({ type: I.REMOVE_CAMERA, value: e.data });
695
705
  break;
696
706
  }
697
707
  }
708
+ // Renderer
709
+ resize(n, a) {
710
+ this.renderer?.setSize(n, a);
711
+ }
712
+ set dpr(n) {
713
+ this.renderer?.setPixelRatio(Xe(1, 2, n));
714
+ }
715
+ get dpr() {
716
+ return this.renderer !== void 0 ? this.renderer?.getPixelRatio() : 1;
717
+ }
718
+ get width() {
719
+ return this.renderer !== void 0 ? this.renderer?.domElement.width / this.dpr : 0;
720
+ }
721
+ get height() {
722
+ return this.renderer !== void 0 ? this.renderer?.domElement.height / this.dpr : 0;
723
+ }
724
+ get canvas() {
725
+ return this.renderer !== void 0 ? this.renderer?.domElement : null;
726
+ }
698
727
  }
699
- class pi extends Ct {
728
+ class Ei extends wt {
700
729
  bindCBs;
701
730
  buttonCBs;
702
731
  pane = void 0;
@@ -707,7 +736,7 @@ class pi extends Ct {
707
736
  super(n), this.bindCBs = /* @__PURE__ */ new Map(), this.buttonCBs = /* @__PURE__ */ new Map(), n.editor && this.createGUI();
708
737
  }
709
738
  createGUI() {
710
- this.pane = new la({ title: "GUI" }), this.pane.registerPlugin(da);
739
+ this.pane = new ha({ title: "GUI" }), this.pane.registerPlugin(fa);
711
740
  }
712
741
  dispose() {
713
742
  this.bindCBs.clear(), this.buttonCBs.clear(), this.appCallbacks = 0, this.editorCallbacks = 0, this.app.editor && (this.pane?.dispose(), this.pane = void 0);
@@ -733,21 +762,21 @@ class pi extends Ct {
733
762
  }
734
763
  // Binding
735
764
  bind(n, a, e, i = void 0) {
736
- const o = this.bindID, h = e.onChange !== void 0 ? e.onChange : Sn;
737
- this.bindCBs.set(o, h), this.app.editor ? (this.pane === void 0 && this.createGUI(), (i !== void 0 ? i : this.pane).addBinding(n, a, e).on("change", (d) => {
765
+ const c = this.bindID, h = e.onChange !== void 0 ? e.onChange : wn;
766
+ this.bindCBs.set(c, h), this.app.editor ? (this.pane === void 0 && this.createGUI(), (i !== void 0 ? i : this.pane).addBinding(n, a, e).on("change", (u) => {
738
767
  this.app.send({
739
768
  event: "updateBind",
740
769
  target: "app",
741
770
  data: {
742
- id: o,
743
- value: d.value
771
+ id: c,
772
+ value: u.value
744
773
  }
745
774
  });
746
775
  }), this.editorCallbacks++) : (this.app.send({
747
776
  event: "bindObject",
748
777
  target: "app",
749
778
  data: {
750
- id: o,
779
+ id: c,
751
780
  name: a,
752
781
  params: e,
753
782
  parent: i
@@ -814,7 +843,7 @@ class pi extends Ct {
814
843
  }
815
844
  }
816
845
  }
817
- var It = { exports: {} }, rt = {};
846
+ var Nt = { exports: {} }, ct = {};
818
847
  /**
819
848
  * @license React
820
849
  * react-jsx-runtime.production.min.js
@@ -824,25 +853,25 @@ var It = { exports: {} }, rt = {};
824
853
  * This source code is licensed under the MIT license found in the
825
854
  * LICENSE file in the root directory of this source tree.
826
855
  */
827
- var Vt;
828
- function Sa() {
829
- if (Vt)
830
- return rt;
831
- Vt = 1;
832
- var t = yn, n = Symbol.for("react.element"), a = Symbol.for("react.fragment"), e = Object.prototype.hasOwnProperty, i = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, o = { key: !0, ref: !0, __self: !0, __source: !0 };
833
- function h(c, d, u) {
834
- var v, b = {}, E = null, S = null;
835
- u !== void 0 && (E = "" + u), d.key !== void 0 && (E = "" + d.key), d.ref !== void 0 && (S = d.ref);
836
- for (v in d)
837
- e.call(d, v) && !o.hasOwnProperty(v) && (b[v] = d[v]);
838
- if (c && c.defaultProps)
839
- for (v in d = c.defaultProps, d)
840
- b[v] === void 0 && (b[v] = d[v]);
841
- return { $$typeof: n, type: c, key: E, ref: S, props: b, _owner: i.current };
842
- }
843
- return rt.Fragment = a, rt.jsx = h, rt.jsxs = h, rt;
844
- }
845
- var st = {};
856
+ var qt;
857
+ function wa() {
858
+ if (qt)
859
+ return ct;
860
+ qt = 1;
861
+ var t = Cn, n = Symbol.for("react.element"), a = Symbol.for("react.fragment"), e = Object.prototype.hasOwnProperty, i = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, c = { key: !0, ref: !0, __self: !0, __source: !0 };
862
+ function h(o, u, d) {
863
+ var f, b = {}, E = null, x = null;
864
+ d !== void 0 && (E = "" + d), u.key !== void 0 && (E = "" + u.key), u.ref !== void 0 && (x = u.ref);
865
+ for (f in u)
866
+ e.call(u, f) && !c.hasOwnProperty(f) && (b[f] = u[f]);
867
+ if (o && o.defaultProps)
868
+ for (f in u = o.defaultProps, u)
869
+ b[f] === void 0 && (b[f] = u[f]);
870
+ return { $$typeof: n, type: o, key: E, ref: x, props: b, _owner: i.current };
871
+ }
872
+ return ct.Fragment = a, ct.jsx = h, ct.jsxs = h, ct;
873
+ }
874
+ var lt = {};
846
875
  /**
847
876
  * @license React
848
877
  * react-jsx-runtime.development.js
@@ -852,57 +881,57 @@ var st = {};
852
881
  * This source code is licensed under the MIT license found in the
853
882
  * LICENSE file in the root directory of this source tree.
854
883
  */
855
- var Ht;
856
- function Ca() {
857
- return Ht || (Ht = 1, process.env.NODE_ENV !== "production" && function() {
858
- var t = yn, n = Symbol.for("react.element"), a = Symbol.for("react.portal"), e = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), o = Symbol.for("react.profiler"), h = Symbol.for("react.provider"), c = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), u = Symbol.for("react.suspense"), v = Symbol.for("react.suspense_list"), b = Symbol.for("react.memo"), E = Symbol.for("react.lazy"), S = Symbol.for("react.offscreen"), D = Symbol.iterator, I = "@@iterator";
859
- function q(r) {
884
+ var Kt;
885
+ function Oa() {
886
+ return Kt || (Kt = 1, process.env.NODE_ENV !== "production" && function() {
887
+ var t = Cn, n = Symbol.for("react.element"), a = Symbol.for("react.portal"), e = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), c = Symbol.for("react.profiler"), h = Symbol.for("react.provider"), o = Symbol.for("react.context"), u = Symbol.for("react.forward_ref"), d = Symbol.for("react.suspense"), f = Symbol.for("react.suspense_list"), b = Symbol.for("react.memo"), E = Symbol.for("react.lazy"), x = Symbol.for("react.offscreen"), M = Symbol.iterator, P = "@@iterator";
888
+ function V(r) {
860
889
  if (r === null || typeof r != "object")
861
890
  return null;
862
- var f = D && r[D] || r[I];
863
- return typeof f == "function" ? f : null;
891
+ var m = M && r[M] || r[P];
892
+ return typeof m == "function" ? m : null;
864
893
  }
865
- var B = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
866
- function M(r) {
894
+ var U = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
895
+ function j(r) {
867
896
  {
868
- for (var f = arguments.length, g = new Array(f > 1 ? f - 1 : 0), C = 1; C < f; C++)
869
- g[C - 1] = arguments[C];
870
- z("error", r, g);
897
+ for (var m = arguments.length, g = new Array(m > 1 ? m - 1 : 0), w = 1; w < m; w++)
898
+ g[w - 1] = arguments[w];
899
+ O("error", r, g);
871
900
  }
872
901
  }
873
- function z(r, f, g) {
902
+ function O(r, m, g) {
874
903
  {
875
- var C = B.ReactDebugCurrentFrame, j = C.getStackAddendum();
876
- j !== "" && (f += "%s", g = g.concat([j]));
877
- var L = g.map(function(A) {
878
- return String(A);
904
+ var w = U.ReactDebugCurrentFrame, N = w.getStackAddendum();
905
+ N !== "" && (m += "%s", g = g.concat([N]));
906
+ var B = g.map(function(k) {
907
+ return String(k);
879
908
  });
880
- L.unshift("Warning: " + f), Function.prototype.apply.call(console[r], console, L);
909
+ B.unshift("Warning: " + m), Function.prototype.apply.call(console[r], console, B);
881
910
  }
882
911
  }
883
- var we = !1, ce = !1, Y = !1, Q = !1, x = !1, Ae;
884
- Ae = Symbol.for("react.module.reference");
885
- function Fe(r) {
886
- return !!(typeof r == "string" || typeof r == "function" || r === e || r === o || x || r === i || r === u || r === v || Q || r === S || we || ce || Y || typeof r == "object" && r !== null && (r.$$typeof === E || r.$$typeof === b || r.$$typeof === h || r.$$typeof === c || r.$$typeof === d || // This needs to include all possible module reference object
912
+ var re = !1, Q = !1, Ce = !1, G = !1, ee = !1, ve;
913
+ ve = Symbol.for("react.module.reference");
914
+ function ze(r) {
915
+ return !!(typeof r == "string" || typeof r == "function" || r === e || r === c || ee || r === i || r === d || r === f || G || r === x || re || Q || Ce || typeof r == "object" && r !== null && (r.$$typeof === E || r.$$typeof === b || r.$$typeof === h || r.$$typeof === o || r.$$typeof === u || // This needs to include all possible module reference object
887
916
  // types supported by any Flight configuration anywhere since
888
917
  // we don't know which Flight build this will end up being used
889
918
  // with.
890
- r.$$typeof === Ae || r.getModuleId !== void 0));
919
+ r.$$typeof === ve || r.getModuleId !== void 0));
891
920
  }
892
- function Oe(r, f, g) {
893
- var C = r.displayName;
894
- if (C)
895
- return C;
896
- var j = f.displayName || f.name || "";
897
- return j !== "" ? g + "(" + j + ")" : g;
921
+ function Me(r, m, g) {
922
+ var w = r.displayName;
923
+ if (w)
924
+ return w;
925
+ var N = m.displayName || m.name || "";
926
+ return N !== "" ? g + "(" + N + ")" : g;
898
927
  }
899
- function me(r) {
928
+ function $(r) {
900
929
  return r.displayName || "Context";
901
930
  }
902
- function te(r) {
931
+ function le(r) {
903
932
  if (r == null)
904
933
  return null;
905
- if (typeof r.tag == "number" && M("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof r == "function")
934
+ 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")
906
935
  return r.displayName || r.name || null;
907
936
  if (typeof r == "string")
908
937
  return r;
@@ -911,32 +940,32 @@ function Ca() {
911
940
  return "Fragment";
912
941
  case a:
913
942
  return "Portal";
914
- case o:
943
+ case c:
915
944
  return "Profiler";
916
945
  case i:
917
946
  return "StrictMode";
918
- case u:
947
+ case d:
919
948
  return "Suspense";
920
- case v:
949
+ case f:
921
950
  return "SuspenseList";
922
951
  }
923
952
  if (typeof r == "object")
924
953
  switch (r.$$typeof) {
925
- case c:
926
- var f = r;
927
- return me(f) + ".Consumer";
954
+ case o:
955
+ var m = r;
956
+ return $(m) + ".Consumer";
928
957
  case h:
929
958
  var g = r;
930
- return me(g._context) + ".Provider";
931
- case d:
932
- return Oe(r, r.render, "ForwardRef");
959
+ return $(g._context) + ".Provider";
960
+ case u:
961
+ return Me(r, r.render, "ForwardRef");
933
962
  case b:
934
- var C = r.displayName || null;
935
- return C !== null ? C : te(r.type) || "Memo";
963
+ var w = r.displayName || null;
964
+ return w !== null ? w : le(r.type) || "Memo";
936
965
  case E: {
937
- var j = r, L = j._payload, A = j._init;
966
+ var N = r, B = N._payload, k = N._init;
938
967
  try {
939
- return te(A(L));
968
+ return le(k(B));
940
969
  } catch {
941
970
  return null;
942
971
  }
@@ -944,18 +973,18 @@ function Ca() {
944
973
  }
945
974
  return null;
946
975
  }
947
- var ue = Object.assign, ve = 0, ge, K, pe, Pe, ke, he, p;
948
- function m() {
976
+ var S = Object.assign, Te = 0, ge, _e, je, Re, Pe, De, Ye;
977
+ function te() {
949
978
  }
950
- m.__reactDisabledLog = !0;
951
- function w() {
979
+ te.__reactDisabledLog = !0;
980
+ function Se() {
952
981
  {
953
- if (ve === 0) {
954
- ge = console.log, K = console.info, pe = console.warn, Pe = console.error, ke = console.group, he = console.groupCollapsed, p = console.groupEnd;
982
+ if (Te === 0) {
983
+ ge = console.log, _e = console.info, je = console.warn, Re = console.error, Pe = console.group, De = console.groupCollapsed, Ye = console.groupEnd;
955
984
  var r = {
956
985
  configurable: !0,
957
986
  enumerable: !0,
958
- value: m,
987
+ value: te,
959
988
  writable: !0
960
989
  };
961
990
  Object.defineProperties(console, {
@@ -968,254 +997,254 @@ function Ca() {
968
997
  groupEnd: r
969
998
  });
970
999
  }
971
- ve++;
1000
+ Te++;
972
1001
  }
973
1002
  }
974
- function R() {
1003
+ function it() {
975
1004
  {
976
- if (ve--, ve === 0) {
1005
+ if (Te--, Te === 0) {
977
1006
  var r = {
978
1007
  configurable: !0,
979
1008
  enumerable: !0,
980
1009
  writable: !0
981
1010
  };
982
1011
  Object.defineProperties(console, {
983
- log: ue({}, r, {
1012
+ log: S({}, r, {
984
1013
  value: ge
985
1014
  }),
986
- info: ue({}, r, {
987
- value: K
1015
+ info: S({}, r, {
1016
+ value: _e
988
1017
  }),
989
- warn: ue({}, r, {
990
- value: pe
1018
+ warn: S({}, r, {
1019
+ value: je
991
1020
  }),
992
- error: ue({}, r, {
993
- value: Pe
1021
+ error: S({}, r, {
1022
+ value: Re
994
1023
  }),
995
- group: ue({}, r, {
996
- value: ke
1024
+ group: S({}, r, {
1025
+ value: Pe
997
1026
  }),
998
- groupCollapsed: ue({}, r, {
999
- value: he
1027
+ groupCollapsed: S({}, r, {
1028
+ value: De
1000
1029
  }),
1001
- groupEnd: ue({}, r, {
1002
- value: p
1030
+ groupEnd: S({}, r, {
1031
+ value: Ye
1003
1032
  })
1004
1033
  });
1005
1034
  }
1006
- ve < 0 && M("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
1035
+ Te < 0 && j("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
1007
1036
  }
1008
1037
  }
1009
- var G = B.ReactCurrentDispatcher, V;
1010
- function ae(r, f, g) {
1038
+ var Ve = U.ReactCurrentDispatcher, pe;
1039
+ function p(r, m, g) {
1011
1040
  {
1012
- if (V === void 0)
1041
+ if (pe === void 0)
1013
1042
  try {
1014
1043
  throw Error();
1015
- } catch (j) {
1016
- var C = j.stack.trim().match(/\n( *(at )?)/);
1017
- V = C && C[1] || "";
1044
+ } catch (N) {
1045
+ var w = N.stack.trim().match(/\n( *(at )?)/);
1046
+ pe = w && w[1] || "";
1018
1047
  }
1019
1048
  return `
1020
- ` + V + r;
1049
+ ` + pe + r;
1021
1050
  }
1022
1051
  }
1023
- var U = !1, X;
1052
+ var v = !1, C;
1024
1053
  {
1025
- var ie = typeof WeakMap == "function" ? WeakMap : Map;
1026
- X = new ie();
1054
+ var _ = typeof WeakMap == "function" ? WeakMap : Map;
1055
+ C = new _();
1027
1056
  }
1028
- function _(r, f) {
1029
- if (!r || U)
1057
+ function H(r, m) {
1058
+ if (!r || v)
1030
1059
  return "";
1031
1060
  {
1032
- var g = X.get(r);
1061
+ var g = C.get(r);
1033
1062
  if (g !== void 0)
1034
1063
  return g;
1035
1064
  }
1036
- var C;
1037
- U = !0;
1038
- var j = Error.prepareStackTrace;
1065
+ var w;
1066
+ v = !0;
1067
+ var N = Error.prepareStackTrace;
1039
1068
  Error.prepareStackTrace = void 0;
1040
- var L;
1041
- L = G.current, G.current = null, w();
1069
+ var B;
1070
+ B = Ve.current, Ve.current = null, Se();
1042
1071
  try {
1043
- if (f) {
1044
- var A = function() {
1072
+ if (m) {
1073
+ var k = function() {
1045
1074
  throw Error();
1046
1075
  };
1047
- if (Object.defineProperty(A.prototype, "props", {
1076
+ if (Object.defineProperty(k.prototype, "props", {
1048
1077
  set: function() {
1049
1078
  throw Error();
1050
1079
  }
1051
1080
  }), typeof Reflect == "object" && Reflect.construct) {
1052
1081
  try {
1053
- Reflect.construct(A, []);
1054
- } catch (Te) {
1055
- C = Te;
1082
+ Reflect.construct(k, []);
1083
+ } catch (Ie) {
1084
+ w = Ie;
1056
1085
  }
1057
- Reflect.construct(r, [], A);
1086
+ Reflect.construct(r, [], k);
1058
1087
  } else {
1059
1088
  try {
1060
- A.call();
1061
- } catch (Te) {
1062
- C = Te;
1089
+ k.call();
1090
+ } catch (Ie) {
1091
+ w = Ie;
1063
1092
  }
1064
- r.call(A.prototype);
1093
+ r.call(k.prototype);
1065
1094
  }
1066
1095
  } else {
1067
1096
  try {
1068
1097
  throw Error();
1069
- } catch (Te) {
1070
- C = Te;
1098
+ } catch (Ie) {
1099
+ w = Ie;
1071
1100
  }
1072
1101
  r();
1073
1102
  }
1074
- } catch (Te) {
1075
- if (Te && C && typeof Te.stack == "string") {
1076
- for (var T = Te.stack.split(`
1077
- `), de = C.stack.split(`
1078
- `), Z = T.length - 1, J = de.length - 1; Z >= 1 && J >= 0 && T[Z] !== de[J]; )
1079
- J--;
1080
- for (; Z >= 1 && J >= 0; Z--, J--)
1081
- if (T[Z] !== de[J]) {
1082
- if (Z !== 1 || J !== 1)
1103
+ } catch (Ie) {
1104
+ if (Ie && w && typeof Ie.stack == "string") {
1105
+ for (var R = Ie.stack.split(`
1106
+ `), he = w.stack.split(`
1107
+ `), J = R.length - 1, ne = he.length - 1; J >= 1 && ne >= 0 && R[J] !== he[ne]; )
1108
+ ne--;
1109
+ for (; J >= 1 && ne >= 0; J--, ne--)
1110
+ if (R[J] !== he[ne]) {
1111
+ if (J !== 1 || ne !== 1)
1083
1112
  do
1084
- if (Z--, J--, J < 0 || T[Z] !== de[J]) {
1113
+ if (J--, ne--, ne < 0 || R[J] !== he[ne]) {
1085
1114
  var Ee = `
1086
- ` + T[Z].replace(" at new ", " at ");
1087
- return r.displayName && Ee.includes("<anonymous>") && (Ee = Ee.replace("<anonymous>", r.displayName)), typeof r == "function" && X.set(r, Ee), Ee;
1115
+ ` + R[J].replace(" at new ", " at ");
1116
+ return r.displayName && Ee.includes("<anonymous>") && (Ee = Ee.replace("<anonymous>", r.displayName)), typeof r == "function" && C.set(r, Ee), Ee;
1088
1117
  }
1089
- while (Z >= 1 && J >= 0);
1118
+ while (J >= 1 && ne >= 0);
1090
1119
  break;
1091
1120
  }
1092
1121
  }
1093
1122
  } finally {
1094
- U = !1, G.current = L, R(), Error.prepareStackTrace = j;
1123
+ v = !1, Ve.current = B, it(), Error.prepareStackTrace = N;
1095
1124
  }
1096
- var Ke = r ? r.displayName || r.name : "", Bt = Ke ? ae(Ke) : "";
1097
- return typeof r == "function" && X.set(r, Bt), Bt;
1125
+ var Qe = r ? r.displayName || r.name : "", Ut = Qe ? p(Qe) : "";
1126
+ return typeof r == "function" && C.set(r, Ut), Ut;
1098
1127
  }
1099
- function F(r, f, g) {
1100
- return _(r, !1);
1128
+ function X(r, m, g) {
1129
+ return H(r, !1);
1101
1130
  }
1102
- function ne(r) {
1103
- var f = r.prototype;
1104
- return !!(f && f.isReactComponent);
1131
+ function de(r) {
1132
+ var m = r.prototype;
1133
+ return !!(m && m.isReactComponent);
1105
1134
  }
1106
- function Ce(r, f, g) {
1135
+ function z(r, m, g) {
1107
1136
  if (r == null)
1108
1137
  return "";
1109
1138
  if (typeof r == "function")
1110
- return _(r, ne(r));
1139
+ return H(r, de(r));
1111
1140
  if (typeof r == "string")
1112
- return ae(r);
1141
+ return p(r);
1113
1142
  switch (r) {
1114
- case u:
1115
- return ae("Suspense");
1116
- case v:
1117
- return ae("SuspenseList");
1143
+ case d:
1144
+ return p("Suspense");
1145
+ case f:
1146
+ return p("SuspenseList");
1118
1147
  }
1119
1148
  if (typeof r == "object")
1120
1149
  switch (r.$$typeof) {
1121
- case d:
1122
- return F(r.render);
1150
+ case u:
1151
+ return X(r.render);
1123
1152
  case b:
1124
- return Ce(r.type, f, g);
1153
+ return z(r.type, m, g);
1125
1154
  case E: {
1126
- var C = r, j = C._payload, L = C._init;
1155
+ var w = r, N = w._payload, B = w._init;
1127
1156
  try {
1128
- return Ce(L(j), f, g);
1157
+ return z(B(N), m, g);
1129
1158
  } catch {
1130
1159
  }
1131
1160
  }
1132
1161
  }
1133
1162
  return "";
1134
1163
  }
1135
- var Me = Object.prototype.hasOwnProperty, dt = {}, ut = B.ReactDebugCurrentFrame;
1136
- function Be(r) {
1164
+ var Z = Object.prototype.hasOwnProperty, se = {}, A = U.ReactDebugCurrentFrame;
1165
+ function L(r) {
1137
1166
  if (r) {
1138
- var f = r._owner, g = Ce(r.type, r._source, f ? f.type : null);
1139
- ut.setExtraStackFrame(g);
1167
+ var m = r._owner, g = z(r.type, r._source, m ? m.type : null);
1168
+ A.setExtraStackFrame(g);
1140
1169
  } else
1141
- ut.setExtraStackFrame(null);
1170
+ A.setExtraStackFrame(null);
1142
1171
  }
1143
- function et(r, f, g, C, j) {
1172
+ function ie(r, m, g, w, N) {
1144
1173
  {
1145
- var L = Function.call.bind(Me);
1146
- for (var A in r)
1147
- if (L(r, A)) {
1148
- var T = void 0;
1174
+ var B = Function.call.bind(Z);
1175
+ for (var k in r)
1176
+ if (B(r, k)) {
1177
+ var R = void 0;
1149
1178
  try {
1150
- if (typeof r[A] != "function") {
1151
- var de = Error((C || "React class") + ": " + g + " type `" + A + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof r[A] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
1152
- throw de.name = "Invariant Violation", de;
1179
+ if (typeof r[k] != "function") {
1180
+ var he = Error((w || "React class") + ": " + g + " type `" + k + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof r[k] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
1181
+ throw he.name = "Invariant Violation", he;
1153
1182
  }
1154
- T = r[A](f, A, C, g, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
1155
- } catch (Z) {
1156
- T = Z;
1183
+ R = r[k](m, k, w, g, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
1184
+ } catch (J) {
1185
+ R = J;
1157
1186
  }
1158
- T && !(T instanceof Error) && (Be(j), M("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", C || "React class", g, A, typeof T), Be(null)), T instanceof Error && !(T.message in dt) && (dt[T.message] = !0, Be(j), M("Failed %s type: %s", g, T.message), Be(null));
1187
+ R && !(R instanceof Error) && (L(N), 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).", w || "React class", g, k, typeof R), L(null)), R instanceof Error && !(R.message in se) && (se[R.message] = !0, L(N), j("Failed %s type: %s", g, R.message), L(null));
1159
1188
  }
1160
1189
  }
1161
1190
  }
1162
- var Ue = Array.isArray;
1163
- function tt(r) {
1164
- return Ue(r);
1191
+ var we = Array.isArray;
1192
+ function Ne(r) {
1193
+ return we(r);
1165
1194
  }
1166
- function xt(r) {
1195
+ function Ot(r) {
1167
1196
  {
1168
- var f = typeof Symbol == "function" && Symbol.toStringTag, g = f && r[Symbol.toStringTag] || r.constructor.name || "Object";
1197
+ var m = typeof Symbol == "function" && Symbol.toStringTag, g = m && r[Symbol.toStringTag] || r.constructor.name || "Object";
1169
1198
  return g;
1170
1199
  }
1171
1200
  }
1172
- function ht(r) {
1201
+ function ft(r) {
1173
1202
  try {
1174
- return ft(r), !1;
1203
+ return pt(r), !1;
1175
1204
  } catch {
1176
1205
  return !0;
1177
1206
  }
1178
1207
  }
1179
- function ft(r) {
1208
+ function pt(r) {
1180
1209
  return "" + r;
1181
1210
  }
1182
- function pt(r) {
1183
- if (ht(r))
1184
- return M("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", xt(r)), ft(r);
1211
+ function mt(r) {
1212
+ if (ft(r))
1213
+ return j("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ot(r)), pt(r);
1185
1214
  }
1186
- var je = B.ReactCurrentOwner, nt = {
1215
+ var Le = U.ReactCurrentOwner, rt = {
1187
1216
  key: !0,
1188
1217
  ref: !0,
1189
1218
  __self: !0,
1190
1219
  __source: !0
1191
- }, at, mt, qe;
1192
- qe = {};
1193
- function wt(r) {
1194
- if (Me.call(r, "ref")) {
1195
- var f = Object.getOwnPropertyDescriptor(r, "ref").get;
1196
- if (f && f.isReactWarning)
1220
+ }, st, vt, Je;
1221
+ Je = {};
1222
+ function Mt(r) {
1223
+ if (Z.call(r, "ref")) {
1224
+ var m = Object.getOwnPropertyDescriptor(r, "ref").get;
1225
+ if (m && m.isReactWarning)
1197
1226
  return !1;
1198
1227
  }
1199
1228
  return r.ref !== void 0;
1200
1229
  }
1201
- function Ot(r) {
1202
- if (Me.call(r, "key")) {
1203
- var f = Object.getOwnPropertyDescriptor(r, "key").get;
1204
- if (f && f.isReactWarning)
1230
+ function Tt(r) {
1231
+ if (Z.call(r, "key")) {
1232
+ var m = Object.getOwnPropertyDescriptor(r, "key").get;
1233
+ if (m && m.isReactWarning)
1205
1234
  return !1;
1206
1235
  }
1207
1236
  return r.key !== void 0;
1208
1237
  }
1209
- function vt(r, f) {
1210
- if (typeof r.ref == "string" && je.current && f && je.current.stateNode !== f) {
1211
- var g = te(je.current.type);
1212
- qe[g] || (M('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(je.current.type), r.ref), qe[g] = !0);
1238
+ function gt(r, m) {
1239
+ if (typeof r.ref == "string" && Le.current && m && Le.current.stateNode !== m) {
1240
+ var g = le(Le.current.type);
1241
+ Je[g] || (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', le(Le.current.type), r.ref), Je[g] = !0);
1213
1242
  }
1214
1243
  }
1215
- function De(r, f) {
1244
+ function Fe(r, m) {
1216
1245
  {
1217
1246
  var g = function() {
1218
- at || (at = !0, M("%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)", f));
1247
+ st || (st = !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)", m));
1219
1248
  };
1220
1249
  g.isReactWarning = !0, Object.defineProperty(r, "key", {
1221
1250
  get: g,
@@ -1223,10 +1252,10 @@ function Ca() {
1223
1252
  });
1224
1253
  }
1225
1254
  }
1226
- function Ft(r, f) {
1255
+ function Bt(r, m) {
1227
1256
  {
1228
1257
  var g = function() {
1229
- mt || (mt = !0, M("%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)", f));
1258
+ vt || (vt = !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)", m));
1230
1259
  };
1231
1260
  g.isReactWarning = !0, Object.defineProperty(r, "ref", {
1232
1261
  get: g,
@@ -1234,70 +1263,70 @@ function Ca() {
1234
1263
  });
1235
1264
  }
1236
1265
  }
1237
- var s = function(r, f, g, C, j, L, A) {
1238
- var T = {
1266
+ var s = function(r, m, g, w, N, B, k) {
1267
+ var R = {
1239
1268
  // This tag allows us to uniquely identify this as a React Element
1240
1269
  $$typeof: n,
1241
1270
  // Built-in properties that belong on the element
1242
1271
  type: r,
1243
- key: f,
1272
+ key: m,
1244
1273
  ref: g,
1245
- props: A,
1274
+ props: k,
1246
1275
  // Record the component responsible for creating this element.
1247
- _owner: L
1276
+ _owner: B
1248
1277
  };
1249
- return T._store = {}, Object.defineProperty(T._store, "validated", {
1278
+ return R._store = {}, Object.defineProperty(R._store, "validated", {
1250
1279
  configurable: !1,
1251
1280
  enumerable: !1,
1252
1281
  writable: !0,
1253
1282
  value: !1
1254
- }), Object.defineProperty(T, "_self", {
1283
+ }), Object.defineProperty(R, "_self", {
1255
1284
  configurable: !1,
1256
1285
  enumerable: !1,
1257
1286
  writable: !1,
1258
- value: C
1259
- }), Object.defineProperty(T, "_source", {
1287
+ value: w
1288
+ }), Object.defineProperty(R, "_source", {
1260
1289
  configurable: !1,
1261
1290
  enumerable: !1,
1262
1291
  writable: !1,
1263
- value: j
1264
- }), Object.freeze && (Object.freeze(T.props), Object.freeze(T)), T;
1292
+ value: N
1293
+ }), Object.freeze && (Object.freeze(R.props), Object.freeze(R)), R;
1265
1294
  };
1266
- function y(r, f, g, C, j) {
1295
+ function y(r, m, g, w, N) {
1267
1296
  {
1268
- var L, A = {}, T = null, de = null;
1269
- g !== void 0 && (pt(g), T = "" + g), Ot(f) && (pt(f.key), T = "" + f.key), wt(f) && (de = f.ref, vt(f, j));
1270
- for (L in f)
1271
- Me.call(f, L) && !nt.hasOwnProperty(L) && (A[L] = f[L]);
1297
+ var B, k = {}, R = null, he = null;
1298
+ g !== void 0 && (mt(g), R = "" + g), Tt(m) && (mt(m.key), R = "" + m.key), Mt(m) && (he = m.ref, gt(m, N));
1299
+ for (B in m)
1300
+ Z.call(m, B) && !rt.hasOwnProperty(B) && (k[B] = m[B]);
1272
1301
  if (r && r.defaultProps) {
1273
- var Z = r.defaultProps;
1274
- for (L in Z)
1275
- A[L] === void 0 && (A[L] = Z[L]);
1302
+ var J = r.defaultProps;
1303
+ for (B in J)
1304
+ k[B] === void 0 && (k[B] = J[B]);
1276
1305
  }
1277
- if (T || de) {
1278
- var J = typeof r == "function" ? r.displayName || r.name || "Unknown" : r;
1279
- T && De(A, J), de && Ft(A, J);
1306
+ if (R || he) {
1307
+ var ne = typeof r == "function" ? r.displayName || r.name || "Unknown" : r;
1308
+ R && Fe(k, ne), he && Bt(k, ne);
1280
1309
  }
1281
- return s(r, T, de, j, C, je.current, A);
1310
+ return s(r, R, he, N, w, Le.current, k);
1282
1311
  }
1283
1312
  }
1284
- var O = B.ReactCurrentOwner, N = B.ReactDebugCurrentFrame;
1285
- function H(r) {
1313
+ var T = U.ReactCurrentOwner, F = U.ReactDebugCurrentFrame;
1314
+ function W(r) {
1286
1315
  if (r) {
1287
- var f = r._owner, g = Ce(r.type, r._source, f ? f.type : null);
1288
- N.setExtraStackFrame(g);
1316
+ var m = r._owner, g = z(r.type, r._source, m ? m.type : null);
1317
+ F.setExtraStackFrame(g);
1289
1318
  } else
1290
- N.setExtraStackFrame(null);
1319
+ F.setExtraStackFrame(null);
1291
1320
  }
1292
1321
  var be;
1293
1322
  be = !1;
1294
- function le(r) {
1323
+ function ue(r) {
1295
1324
  return typeof r == "object" && r !== null && r.$$typeof === n;
1296
1325
  }
1297
- function Mt() {
1326
+ function _t() {
1298
1327
  {
1299
- if (O.current) {
1300
- var r = te(O.current.type);
1328
+ if (T.current) {
1329
+ var r = le(T.current.type);
1301
1330
  if (r)
1302
1331
  return `
1303
1332
 
@@ -1306,149 +1335,149 @@ Check the render method of \`` + r + "`.";
1306
1335
  return "";
1307
1336
  }
1308
1337
  }
1309
- function Tt(r) {
1338
+ function Rt(r) {
1310
1339
  {
1311
1340
  if (r !== void 0) {
1312
- var f = r.fileName.replace(/^.*[\\\/]/, ""), g = r.lineNumber;
1341
+ var m = r.fileName.replace(/^.*[\\\/]/, ""), g = r.lineNumber;
1313
1342
  return `
1314
1343
 
1315
- Check your code at ` + f + ":" + g + ".";
1344
+ Check your code at ` + m + ":" + g + ".";
1316
1345
  }
1317
1346
  return "";
1318
1347
  }
1319
1348
  }
1320
- var it = {};
1321
- function xe(r) {
1349
+ var ot = {};
1350
+ function Oe(r) {
1322
1351
  {
1323
- var f = Mt();
1324
- if (!f) {
1352
+ var m = _t();
1353
+ if (!m) {
1325
1354
  var g = typeof r == "string" ? r : r.displayName || r.name;
1326
- g && (f = `
1355
+ g && (m = `
1327
1356
 
1328
1357
  Check the top-level render call using <` + g + ">.");
1329
1358
  }
1330
- return f;
1359
+ return m;
1331
1360
  }
1332
1361
  }
1333
- function ye(r, f) {
1362
+ function ye(r, m) {
1334
1363
  {
1335
1364
  if (!r._store || r._store.validated || r.key != null)
1336
1365
  return;
1337
1366
  r._store.validated = !0;
1338
- var g = xe(f);
1339
- if (it[g])
1367
+ var g = Oe(m);
1368
+ if (ot[g])
1340
1369
  return;
1341
- it[g] = !0;
1342
- var C = "";
1343
- r && r._owner && r._owner !== O.current && (C = " It was passed a child from " + te(r._owner.type) + "."), H(r), M('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', g, C), H(null);
1370
+ ot[g] = !0;
1371
+ var w = "";
1372
+ r && r._owner && r._owner !== T.current && (w = " It was passed a child from " + le(r._owner.type) + "."), W(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.', g, w), W(null);
1344
1373
  }
1345
1374
  }
1346
- function $e(r, f) {
1375
+ function Ge(r, m) {
1347
1376
  {
1348
1377
  if (typeof r != "object")
1349
1378
  return;
1350
- if (tt(r))
1379
+ if (Ne(r))
1351
1380
  for (var g = 0; g < r.length; g++) {
1352
- var C = r[g];
1353
- le(C) && ye(C, f);
1381
+ var w = r[g];
1382
+ ue(w) && ye(w, m);
1354
1383
  }
1355
- else if (le(r))
1384
+ else if (ue(r))
1356
1385
  r._store && (r._store.validated = !0);
1357
1386
  else if (r) {
1358
- var j = q(r);
1359
- if (typeof j == "function" && j !== r.entries)
1360
- for (var L = j.call(r), A; !(A = L.next()).done; )
1361
- le(A.value) && ye(A.value, f);
1387
+ var N = V(r);
1388
+ if (typeof N == "function" && N !== r.entries)
1389
+ for (var B = N.call(r), k; !(k = B.next()).done; )
1390
+ ue(k.value) && ye(k.value, m);
1362
1391
  }
1363
1392
  }
1364
1393
  }
1365
- function ze(r) {
1394
+ function He(r) {
1366
1395
  {
1367
- var f = r.type;
1368
- if (f == null || typeof f == "string")
1396
+ var m = r.type;
1397
+ if (m == null || typeof m == "string")
1369
1398
  return;
1370
1399
  var g;
1371
- if (typeof f == "function")
1372
- g = f.propTypes;
1373
- else if (typeof f == "object" && (f.$$typeof === d || // Note: Memo only checks outer props here.
1400
+ if (typeof m == "function")
1401
+ g = m.propTypes;
1402
+ else if (typeof m == "object" && (m.$$typeof === u || // Note: Memo only checks outer props here.
1374
1403
  // Inner props are checked in the reconciler.
1375
- f.$$typeof === b))
1376
- g = f.propTypes;
1404
+ m.$$typeof === b))
1405
+ g = m.propTypes;
1377
1406
  else
1378
1407
  return;
1379
1408
  if (g) {
1380
- var C = te(f);
1381
- et(g, r.props, "prop", C, r);
1382
- } else if (f.PropTypes !== void 0 && !be) {
1409
+ var w = le(m);
1410
+ ie(g, r.props, "prop", w, r);
1411
+ } else if (m.PropTypes !== void 0 && !be) {
1383
1412
  be = !0;
1384
- var j = te(f);
1385
- M("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", j || "Unknown");
1413
+ var N = le(m);
1414
+ j("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", N || "Unknown");
1386
1415
  }
1387
- typeof f.getDefaultProps == "function" && !f.getDefaultProps.isReactClassApproved && M("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
1416
+ typeof m.getDefaultProps == "function" && !m.getDefaultProps.isReactClassApproved && j("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
1388
1417
  }
1389
1418
  }
1390
- function Ye(r) {
1419
+ function We(r) {
1391
1420
  {
1392
- for (var f = Object.keys(r.props), g = 0; g < f.length; g++) {
1393
- var C = f[g];
1394
- if (C !== "children" && C !== "key") {
1395
- H(r), M("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", C), H(null);
1421
+ for (var m = Object.keys(r.props), g = 0; g < m.length; g++) {
1422
+ var w = m[g];
1423
+ if (w !== "children" && w !== "key") {
1424
+ W(r), j("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", w), W(null);
1396
1425
  break;
1397
1426
  }
1398
1427
  }
1399
- r.ref !== null && (H(r), M("Invalid attribute `ref` supplied to `React.Fragment`."), H(null));
1428
+ r.ref !== null && (W(r), j("Invalid attribute `ref` supplied to `React.Fragment`."), W(null));
1400
1429
  }
1401
1430
  }
1402
- function Ge(r, f, g, C, j, L) {
1431
+ function qe(r, m, g, w, N, B) {
1403
1432
  {
1404
- var A = Fe(r);
1405
- if (!A) {
1406
- var T = "";
1407
- (r === void 0 || typeof r == "object" && r !== null && Object.keys(r).length === 0) && (T += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
1408
- var de = Tt(j);
1409
- de ? T += de : T += Mt();
1410
- var Z;
1411
- r === null ? Z = "null" : tt(r) ? Z = "array" : r !== void 0 && r.$$typeof === n ? (Z = "<" + (te(r.type) || "Unknown") + " />", T = " Did you accidentally export a JSX literal instead of a component?") : Z = typeof r, M("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", Z, T);
1433
+ var k = ze(r);
1434
+ if (!k) {
1435
+ var R = "";
1436
+ (r === void 0 || typeof r == "object" && r !== null && Object.keys(r).length === 0) && (R += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
1437
+ var he = Rt(N);
1438
+ he ? R += he : R += _t();
1439
+ var J;
1440
+ r === null ? J = "null" : Ne(r) ? J = "array" : r !== void 0 && r.$$typeof === n ? (J = "<" + (le(r.type) || "Unknown") + " />", R = " Did you accidentally export a JSX literal instead of a component?") : J = 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", J, R);
1412
1441
  }
1413
- var J = y(r, f, g, j, L);
1414
- if (J == null)
1415
- return J;
1416
- if (A) {
1417
- var Ee = f.children;
1442
+ var ne = y(r, m, g, N, B);
1443
+ if (ne == null)
1444
+ return ne;
1445
+ if (k) {
1446
+ var Ee = m.children;
1418
1447
  if (Ee !== void 0)
1419
- if (C)
1420
- if (tt(Ee)) {
1421
- for (var Ke = 0; Ke < Ee.length; Ke++)
1422
- $e(Ee[Ke], r);
1448
+ if (w)
1449
+ if (Ne(Ee)) {
1450
+ for (var Qe = 0; Qe < Ee.length; Qe++)
1451
+ Ge(Ee[Qe], r);
1423
1452
  Object.freeze && Object.freeze(Ee);
1424
1453
  } else
1425
- M("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
1454
+ 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.");
1426
1455
  else
1427
- $e(Ee, r);
1456
+ Ge(Ee, r);
1428
1457
  }
1429
- return r === e ? Ye(J) : ze(J), J;
1458
+ return r === e ? We(ne) : He(ne), ne;
1430
1459
  }
1431
1460
  }
1432
- function Rn(r, f, g) {
1433
- return Ge(r, f, g, !0);
1461
+ function An(r, m, g) {
1462
+ return qe(r, m, g, !0);
1434
1463
  }
1435
- function _n(r, f, g) {
1436
- return Ge(r, f, g, !1);
1464
+ function kn(r, m, g) {
1465
+ return qe(r, m, g, !1);
1437
1466
  }
1438
- var An = _n, Pn = Rn;
1439
- st.Fragment = e, st.jsx = An, st.jsxs = Pn;
1440
- }()), st;
1467
+ var jn = kn, Dn = An;
1468
+ lt.Fragment = e, lt.jsx = jn, lt.jsxs = Dn;
1469
+ }()), lt;
1441
1470
  }
1442
- process.env.NODE_ENV === "production" ? It.exports = Sa() : It.exports = Ca();
1443
- var l = It.exports;
1444
- function On(t) {
1471
+ process.env.NODE_ENV === "production" ? Nt.exports = wa() : Nt.exports = Oa();
1472
+ var l = Nt.exports;
1473
+ function _n(t) {
1445
1474
  return t.title.search("<") > -1 ? /* @__PURE__ */ l.jsx("button", { className: "svg", dangerouslySetInnerHTML: { __html: t.title } }) : /* @__PURE__ */ l.jsx("button", { children: t.title });
1446
1475
  }
1447
- const xa = /* @__PURE__ */ l.jsxs("svg", { className: "closeIcon", width: "14", height: "14", fill: "none", stroke: "#666666", strokeMiterlimit: "10", children: [
1476
+ const Ma = /* @__PURE__ */ l.jsxs("svg", { className: "closeIcon", width: "14", height: "14", fill: "none", stroke: "#666666", strokeMiterlimit: "10", children: [
1448
1477
  /* @__PURE__ */ l.jsx("circle", { cx: "7", cy: "7", r: "6" }),
1449
1478
  /* @__PURE__ */ l.jsx("line", { x1: "4", y1: "4", x2: "10", y2: "10" }),
1450
1479
  /* @__PURE__ */ l.jsx("line", { x1: "4", y1: "10", x2: "10", y2: "4" })
1451
- ] }), wa = /* @__PURE__ */ l.jsx("svg", { className: "dragIcon", width: "14", height: "14", fill: "#666666", stroke: "none", children: /* @__PURE__ */ l.jsx(
1480
+ ] }), Ta = /* @__PURE__ */ l.jsx("svg", { className: "dragIcon", width: "14", height: "14", fill: "#666666", stroke: "none", children: /* @__PURE__ */ l.jsx(
1452
1481
  "path",
1453
1482
  {
1454
1483
  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
@@ -1456,35 +1485,35 @@ 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
1456
1485
  C11,8.22,10.74,8,10.43,8z`
1457
1486
  }
1458
1487
  ) });
1459
- function Oa(t) {
1460
- return /* @__PURE__ */ l.jsx(En.Item, { value: t.title, children: /* @__PURE__ */ l.jsxs("div", { children: [
1461
- wa,
1488
+ function _a(t) {
1489
+ return /* @__PURE__ */ l.jsx(Sn.Item, { value: t.title, children: /* @__PURE__ */ l.jsxs("div", { children: [
1490
+ Ta,
1462
1491
  /* @__PURE__ */ l.jsx("span", { children: t.title }),
1463
1492
  /* @__PURE__ */ l.jsx("button", { className: "closeIcon", onClick: () => {
1464
1493
  t.onDelete(t.index);
1465
- }, children: xa })
1494
+ }, children: Ma })
1466
1495
  ] }) }, t.title);
1467
1496
  }
1468
- function Ma(t) {
1469
- const [n, a] = oe(!1), [e, i] = oe(t.options), o = (u) => {
1470
- t.onDragComplete(u), i(u);
1471
- }, h = (u) => {
1472
- const v = [...e];
1473
- v.splice(u, 1), o(v);
1474
- }, c = [];
1475
- e.forEach((u, v) => {
1476
- c.push(/* @__PURE__ */ l.jsx(Oa, { index: v, title: u, onDelete: h }, u));
1497
+ function Ra(t) {
1498
+ const [n, a] = ae(!1), [e, i] = ae(t.options), c = (d) => {
1499
+ t.onDragComplete(d), i(d);
1500
+ }, h = (d) => {
1501
+ const f = [...e];
1502
+ f.splice(d, 1), c(f);
1503
+ }, o = [];
1504
+ e.forEach((d, f) => {
1505
+ o.push(/* @__PURE__ */ l.jsx(_a, { index: f, title: d, onDelete: h }, d));
1477
1506
  });
1478
- let d = "dropdown draggable";
1479
- return t.subdropdown && (d += " subdropdown"), /* @__PURE__ */ l.jsxs("div", { className: d, onMouseEnter: () => a(!0), onMouseLeave: () => a(!1), children: [
1480
- /* @__PURE__ */ l.jsx(On, { title: t.title }),
1481
- /* @__PURE__ */ l.jsx(En.Group, { axis: "y", values: e, onReorder: o, style: { visibility: n ? "visible" : "hidden" }, children: c })
1507
+ let u = "dropdown draggable";
1508
+ return t.subdropdown && (u += " subdropdown"), /* @__PURE__ */ l.jsxs("div", { className: u, onMouseEnter: () => a(!0), onMouseLeave: () => a(!1), children: [
1509
+ /* @__PURE__ */ l.jsx(_n, { title: t.title }),
1510
+ /* @__PURE__ */ l.jsx(Sn.Group, { axis: "y", values: e, onReorder: c, style: { visibility: n ? "visible" : "hidden" }, children: o })
1482
1511
  ] });
1483
1512
  }
1484
- function Ta(t) {
1485
- const [n, a] = oe(!1), e = [];
1486
- t.options.map((o, h) => {
1487
- t.onSelect !== void 0 && (o.onSelect = t.onSelect), e.push(/* @__PURE__ */ l.jsx(Ra, { option: o }, h));
1513
+ function Pa(t) {
1514
+ const [n, a] = ae(!1), e = [];
1515
+ t.options.map((c, h) => {
1516
+ t.onSelect !== void 0 && (c.onSelect = t.onSelect), e.push(/* @__PURE__ */ l.jsx(Aa, { option: c }, h));
1488
1517
  });
1489
1518
  let i = "dropdown";
1490
1519
  return t.subdropdown && (i += " subdropdown"), /* @__PURE__ */ l.jsxs(
@@ -1494,7 +1523,7 @@ function Ta(t) {
1494
1523
  onMouseEnter: () => a(!0),
1495
1524
  onMouseLeave: () => a(!1),
1496
1525
  children: [
1497
- /* @__PURE__ */ l.jsx(On, { title: t.title }),
1526
+ /* @__PURE__ */ l.jsx(_n, { title: t.title }),
1498
1527
  /* @__PURE__ */ l.jsx(
1499
1528
  "ul",
1500
1529
  {
@@ -1506,18 +1535,18 @@ function Ta(t) {
1506
1535
  }
1507
1536
  );
1508
1537
  }
1509
- function Ra(t) {
1510
- const { option: n } = t, [a, e] = oe("");
1538
+ function Aa(t) {
1539
+ const { option: n } = t, [a, e] = ae("");
1511
1540
  let i;
1512
1541
  switch (n.type) {
1513
1542
  case "draggable":
1514
1543
  i = /* @__PURE__ */ l.jsx(
1515
- Ma,
1544
+ Ra,
1516
1545
  {
1517
1546
  title: n.title,
1518
1547
  options: n.value,
1519
- onDragComplete: (o) => {
1520
- n.onDragComplete !== void 0 && n.onDragComplete(o);
1548
+ onDragComplete: (c) => {
1549
+ n.onDragComplete !== void 0 && n.onDragComplete(c);
1521
1550
  },
1522
1551
  subdropdown: !0
1523
1552
  }
@@ -1525,7 +1554,7 @@ function Ra(t) {
1525
1554
  break;
1526
1555
  case "dropdown":
1527
1556
  i = /* @__PURE__ */ l.jsx(
1528
- Ta,
1557
+ Pa,
1529
1558
  {
1530
1559
  title: n.title,
1531
1560
  options: n.value,
@@ -1546,33 +1575,33 @@ function Ra(t) {
1546
1575
  );
1547
1576
  break;
1548
1577
  }
1549
- return /* @__PURE__ */ l.jsx("li", { className: a === n.title ? "selected" : "", children: i }, ha());
1578
+ return /* @__PURE__ */ l.jsx("li", { className: a === n.title ? "selected" : "", children: i }, ma());
1550
1579
  }
1551
- function mi(t, n, a) {
1552
- function e(o) {
1580
+ function xi(t, n, a) {
1581
+ function e(c) {
1553
1582
  switch (n.forEach((h) => {
1554
- h.callback(t, h.remote, o);
1555
- }), o.event) {
1583
+ h.callback(t, h.remote, c);
1584
+ }), c.event) {
1556
1585
  case "custom":
1557
- P.dispatchEvent({ type: k.CUSTOM, value: o.data });
1586
+ D.dispatchEvent({ type: I.CUSTOM, value: c.data });
1558
1587
  break;
1559
1588
  }
1560
1589
  }
1561
- function i(o) {
1590
+ function i(c) {
1562
1591
  switch (a.forEach((h) => {
1563
- h.callback(t, h.remote, o);
1564
- }), o.event) {
1592
+ h.callback(t, h.remote, c);
1593
+ }), c.event) {
1565
1594
  case "custom":
1566
- P.dispatchEvent({ type: k.CUSTOM, value: o.data });
1595
+ D.dispatchEvent({ type: I.CUSTOM, value: c.data });
1567
1596
  break;
1568
1597
  }
1569
1598
  }
1570
- t.listen = (o) => {
1571
- o.target === "editor" ? i(o) : e(o);
1599
+ t.listen = (c) => {
1600
+ c.target === "editor" ? i(c) : e(c);
1572
1601
  };
1573
1602
  }
1574
- function Lt(t) {
1575
- const [n, a] = oe(t.open !== void 0 ? t.open : !0), e = !n || t.children === void 0;
1603
+ function Ft(t) {
1604
+ const [n, a] = ae(t.open !== void 0 ? t.open : !0), e = !n || t.children === void 0;
1576
1605
  return /* @__PURE__ */ l.jsxs("div", { className: `accordion ${e ? "hide" : ""}`, children: [
1577
1606
  /* @__PURE__ */ l.jsxs(
1578
1607
  "button",
@@ -1590,7 +1619,7 @@ function Lt(t) {
1590
1619
  children: "Toggle"
1591
1620
  }
1592
1621
  ),
1593
- /* @__PURE__ */ l.jsx("p", { className: "label", children: lt(t.label) })
1622
+ /* @__PURE__ */ l.jsx("p", { className: "label", children: St(t.label) })
1594
1623
  ]
1595
1624
  }
1596
1625
  ),
@@ -1598,10 +1627,10 @@ function Lt(t) {
1598
1627
  /* @__PURE__ */ l.jsx("div", { className: n ? "open" : "", children: /* @__PURE__ */ l.jsx("div", { children: t.children }) })
1599
1628
  ] });
1600
1629
  }
1601
- function Mn(t) {
1602
- const [n, a] = oe(!1), e = t.child !== void 0 && t.child.children.length > 0, i = [];
1603
- return t.child !== void 0 && t.child.children.length > 0 && t.child.children.map((o) => {
1604
- i.push(/* @__PURE__ */ l.jsx(Mn, { child: o, three: t.three }, Math.random()));
1630
+ function Rn(t) {
1631
+ const [n, a] = ae(!1), e = t.child !== void 0 && t.child.children.length > 0, i = [];
1632
+ return t.child !== void 0 && t.child.children.length > 0 && t.child.children.map((c) => {
1633
+ i.push(/* @__PURE__ */ l.jsx(Rn, { child: c, three: t.three }, Math.random()));
1605
1634
  }), /* @__PURE__ */ l.jsx(l.Fragment, { children: t.child !== void 0 && /* @__PURE__ */ l.jsxs("div", { className: "childObject", children: [
1606
1635
  /* @__PURE__ */ l.jsxs("div", { className: "child", children: [
1607
1636
  e ? /* @__PURE__ */ l.jsx(
@@ -1629,29 +1658,29 @@ function Mn(t) {
1629
1658
  children: t.child.name.length > 0 ? `${t.child.name} (${t.child.type})` : `${t.child.type}::${t.child.uuid}`
1630
1659
  }
1631
1660
  ),
1632
- /* @__PURE__ */ l.jsx("div", { className: `icon ${ga(t.child)}` })
1661
+ /* @__PURE__ */ l.jsx("div", { className: `icon ${Ea(t.child)}` })
1633
1662
  ] }),
1634
1663
  /* @__PURE__ */ l.jsx("div", { className: n ? "open" : "", children: /* @__PURE__ */ l.jsx("div", { className: "container", children: i }) })
1635
1664
  ] }, Math.random()) });
1636
1665
  }
1637
- function _a(t) {
1666
+ function ka(t) {
1638
1667
  const n = [];
1639
1668
  return t.child?.children.map((a) => {
1640
- n.push(/* @__PURE__ */ l.jsx(Mn, { child: a, three: t.three }, Math.random()));
1669
+ n.push(/* @__PURE__ */ l.jsx(Rn, { child: a, three: t.three }, Math.random()));
1641
1670
  }), /* @__PURE__ */ l.jsx("div", { className: `scene ${t.class !== void 0 ? t.class : ""}`, children: n });
1642
1671
  }
1643
- const Aa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA5klEQVRoge2Y0Q6EIAwE6cX//+X6cCFpSMEKVTdk501OpRNKiyelFC0b8Ps6gCwoggZF0KAIGhRBgyJoUAQNiqCxjciR9SLV//eZiAyvK3U8i/QVaQO2YyLSFVvlkdTKDjJCukh2ykR5ZEW+kHmlatl90RaBtDkK/w7CYhuRUEO0ee3l+J3m55Vm+17vtwjTnV1V3QA8qfbeUXCzRWDpiLLS+OyzvRW7IzW9R+okvclsqR09743bo0yUpc1+lSJvNsa002+Euk9GKzV7SmZDRIMiaFAEDYqgQRE0KIIGRdCgCBoUQeMEMERadX7YUz8AAAAASUVORK5CYII=";
1644
- function Pa(t) {
1672
+ const ja = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA5klEQVRoge2Y0Q6EIAwE6cX//+X6cCFpSMEKVTdk501OpRNKiyelFC0b8Ps6gCwoggZF0KAIGhRBgyJoUAQNiqCxjciR9SLV//eZiAyvK3U8i/QVaQO2YyLSFVvlkdTKDjJCukh2ykR5ZEW+kHmlatl90RaBtDkK/w7CYhuRUEO0ee3l+J3m55Vm+17vtwjTnV1V3QA8qfbeUXCzRWDpiLLS+OyzvRW7IzW9R+okvclsqR09743bo0yUpc1+lSJvNsa002+Euk9GKzV7SmZDRIMiaFAEDYqgQRE0KIIGRdCgCBoUQeMEMERadX7YUz8AAAAASUVORK5CYII=";
1673
+ function Da(t) {
1645
1674
  return "items" in t;
1646
1675
  }
1647
- function We(t) {
1676
+ function Ze(t) {
1648
1677
  const n = [];
1649
1678
  return t.items.forEach((a) => {
1650
- Pa(a) ? n.push(
1651
- /* @__PURE__ */ l.jsx(We, { title: lt(a.title), items: a.items }, Math.random())
1679
+ Da(a) ? n.push(
1680
+ /* @__PURE__ */ l.jsx(Ze, { title: St(a.title), items: a.items }, Math.random())
1652
1681
  ) : n.push(
1653
1682
  /* @__PURE__ */ l.jsx(
1654
- ct,
1683
+ dt,
1655
1684
  {
1656
1685
  title: a.title,
1657
1686
  prop: a.prop,
@@ -1669,12 +1698,12 @@ function We(t) {
1669
1698
  Math.random()
1670
1699
  )
1671
1700
  );
1672
- }), /* @__PURE__ */ l.jsx(Lt, { label: t.title, open: t.expanded === !0, children: n });
1701
+ }), /* @__PURE__ */ l.jsx(Ft, { label: t.title, open: t.expanded === !0, children: n });
1673
1702
  }
1674
- function ka(t) {
1703
+ function Ia(t) {
1675
1704
  return !(t === "alphaHash" || t === "alphaToCoverage" || t === "attenuationDistance" || t === "blendDstAlpha" || t === "colorWrite" || t === "combine" || t === "defaultAttributeValues" || t === "depthFunc" || t === "forceSinglePass" || t === "glslVersion" || t === "linecap" || t === "linejoin" || t === "linewidth" || t === "normalMapType" || t === "precision" || t === "premultipliedAlpha" || t === "shadowSide" || t === "toneMapped" || t === "uniformsGroups" || t === "uniformsNeedUpdate" || t === "userData" || t === "vertexColors" || t === "version" || t === "wireframeLinecap" || t === "wireframeLinejoin" || t === "wireframeLinewidth" || t.slice(0, 4) === "clip" || t.slice(0, 7) === "polygon" || t.slice(0, 7) === "stencil" || t.slice(0, 2) === "is");
1676
1705
  }
1677
- function Ve(t) {
1706
+ function Ae(t) {
1678
1707
  switch (t) {
1679
1708
  case "alphaMap":
1680
1709
  return "Alpha Map";
@@ -1847,10 +1876,10 @@ function Ve(t) {
1847
1876
  }
1848
1877
  return t;
1849
1878
  }
1850
- function ja(t) {
1879
+ function Na(t) {
1851
1880
  return t.toLowerCase().search("intensity") > -1 || t === "anisotropyRotation" || t === "blendAlpha" || t === "bumpScale" || t === "clearcoatRoughness" || t === "displacementBias" || t === "displacementScale" || t === "metalness" || t === "opacity" || t === "reflectivity" || t === "refractionRatio" || t === "roughness" || t === "sheenRoughness" || t === "thickness";
1852
1881
  }
1853
- function Da() {
1882
+ function La() {
1854
1883
  const t = document.createElement("input");
1855
1884
  return t.type = "file", new Promise((n, a) => {
1856
1885
  t.addEventListener("change", function() {
@@ -1858,426 +1887,468 @@ function Da() {
1858
1887
  a();
1859
1888
  else {
1860
1889
  const e = t.files[0], i = new FileReader();
1861
- i.onload = function(o) {
1862
- n(o.target.result);
1890
+ i.onload = function(c) {
1891
+ n(c.target.result);
1863
1892
  }, i.readAsDataURL(e);
1864
1893
  }
1865
1894
  }), t.click();
1866
1895
  });
1867
1896
  }
1868
- const Ia = [
1897
+ const Fa = [
1869
1898
  {
1870
1899
  title: "Front",
1871
- value: jn
1900
+ value: Nn
1872
1901
  },
1873
1902
  {
1874
1903
  title: "Back",
1875
- value: Dn
1904
+ value: Ln
1876
1905
  },
1877
1906
  {
1878
1907
  title: "Double",
1879
- value: nn
1908
+ value: sn
1880
1909
  }
1881
- ], Na = [
1910
+ ], Ba = [
1882
1911
  {
1883
1912
  title: "No Blending",
1884
- value: In
1913
+ value: Fn
1885
1914
  },
1886
1915
  {
1887
1916
  title: "Normal",
1888
- value: Nn
1917
+ value: Bn
1889
1918
  },
1890
1919
  {
1891
1920
  title: "Additive",
1892
- value: Ln
1921
+ value: Un
1893
1922
  },
1894
1923
  {
1895
1924
  title: "Subtractive",
1896
- value: Fn
1925
+ value: $n
1897
1926
  },
1898
1927
  {
1899
1928
  title: "Multiply",
1900
- value: Bn
1929
+ value: zn
1901
1930
  },
1902
1931
  {
1903
1932
  title: "Custom",
1904
- value: Un
1933
+ value: Yn
1905
1934
  }
1906
- ], La = [
1935
+ ], Ua = [
1907
1936
  {
1908
1937
  title: "Add",
1909
- value: $n
1938
+ value: Vn
1910
1939
  },
1911
1940
  {
1912
1941
  title: "Subtract",
1913
- value: zn
1942
+ value: Gn
1914
1943
  },
1915
1944
  {
1916
1945
  title: "Reverse Subtract",
1917
- value: Yn
1946
+ value: Hn
1918
1947
  },
1919
1948
  {
1920
1949
  title: "Min",
1921
- value: Gn
1950
+ value: Wn
1922
1951
  },
1923
1952
  {
1924
1953
  title: "Max",
1925
- value: Vn
1954
+ value: qn
1926
1955
  }
1927
- ], Fa = [
1956
+ ], $a = [
1928
1957
  {
1929
1958
  title: "Zero",
1930
- valye: an
1959
+ valye: on
1931
1960
  },
1932
1961
  {
1933
1962
  title: "One",
1934
- valye: rn
1963
+ valye: cn
1935
1964
  },
1936
1965
  {
1937
1966
  title: "Src Color",
1938
- valye: sn
1967
+ valye: ln
1939
1968
  },
1940
1969
  {
1941
1970
  title: "One Minus Src Color",
1942
- valye: on
1971
+ valye: un
1943
1972
  },
1944
1973
  {
1945
1974
  title: "Src Alpha",
1946
- valye: cn
1975
+ valye: dn
1947
1976
  },
1948
1977
  {
1949
1978
  title: "One Minus Src Alpha",
1950
- valye: ln
1979
+ valye: hn
1951
1980
  },
1952
1981
  {
1953
1982
  title: "Dst Alpha",
1954
- valye: dn
1983
+ valye: fn
1955
1984
  },
1956
1985
  {
1957
1986
  title: "One Minus Dst Alpha",
1958
- valye: un
1987
+ valye: pn
1959
1988
  },
1960
1989
  {
1961
1990
  title: "Dst Color",
1962
- valye: hn
1991
+ valye: mn
1963
1992
  },
1964
1993
  {
1965
1994
  title: "One Minus Dst Color",
1966
- valye: fn
1995
+ valye: vn
1967
1996
  },
1968
1997
  {
1969
1998
  title: "Src Alpha Saturate",
1970
- valye: Hn
1999
+ valye: Kn
1971
2000
  },
1972
2001
  {
1973
2002
  title: "Constant Color",
1974
- valye: pn
2003
+ valye: gn
1975
2004
  },
1976
2005
  {
1977
2006
  title: "One Minus Constant Color",
1978
- valye: mn
2007
+ valye: bn
1979
2008
  },
1980
2009
  {
1981
2010
  title: "Constant Alpha",
1982
- valye: vn
2011
+ valye: yn
1983
2012
  },
1984
2013
  {
1985
2014
  title: "One Minus Constant Alpha",
1986
- valye: gn
2015
+ valye: En
1987
2016
  }
1988
- ], Ba = [
2017
+ ], za = [
1989
2018
  {
1990
2019
  title: "Zero",
1991
- valye: an
2020
+ valye: on
1992
2021
  },
1993
2022
  {
1994
2023
  title: "One",
1995
- valye: rn
2024
+ valye: cn
1996
2025
  },
1997
2026
  {
1998
2027
  title: "Src Color",
1999
- valye: sn
2028
+ valye: ln
2000
2029
  },
2001
2030
  {
2002
2031
  title: "One Minus Src Color",
2003
- valye: on
2032
+ valye: un
2004
2033
  },
2005
2034
  {
2006
2035
  title: "Src Alpha",
2007
- valye: cn
2036
+ valye: dn
2008
2037
  },
2009
2038
  {
2010
2039
  title: "One Minus Src Alpha",
2011
- valye: ln
2040
+ valye: hn
2012
2041
  },
2013
2042
  {
2014
2043
  title: "Dst Alpha",
2015
- valye: dn
2044
+ valye: fn
2016
2045
  },
2017
2046
  {
2018
2047
  title: "One Minus Dst Alpha",
2019
- valye: un
2048
+ valye: pn
2020
2049
  },
2021
2050
  {
2022
2051
  title: "Dst Color",
2023
- valye: hn
2052
+ valye: mn
2024
2053
  },
2025
2054
  {
2026
2055
  title: "One Minus Dst Color",
2027
- valye: fn
2056
+ valye: vn
2028
2057
  },
2029
2058
  {
2030
2059
  title: "Constant Color",
2031
- valye: pn
2060
+ valye: gn
2032
2061
  },
2033
2062
  {
2034
2063
  title: "One Minus Constant Color",
2035
- valye: mn
2064
+ valye: bn
2036
2065
  },
2037
2066
  {
2038
2067
  title: "Constant Alpha",
2039
- valye: vn
2068
+ valye: yn
2040
2069
  },
2041
2070
  {
2042
2071
  title: "One Minus Constant Alpha",
2043
- valye: gn
2072
+ valye: En
2044
2073
  }
2045
2074
  ];
2046
- function ot(t, n) {
2075
+ function ut(t, n) {
2047
2076
  t.needsUpdate = !0, t.type = "option", t.options = n;
2048
2077
  }
2049
- function Wt(t, n, a) {
2078
+ function Ya(t, n, a, e) {
2079
+ return {
2080
+ type: "boolean",
2081
+ title: Ae(t),
2082
+ prop: t,
2083
+ value: n,
2084
+ needsUpdate: !0,
2085
+ onChange: (i, c) => {
2086
+ e.updateObject(a.uuid, `material.${t}`, c), e.updateObject(a.uuid, "material.needsUpdate", !0);
2087
+ const h = e.scene?.getObjectByProperty("uuid", a.uuid);
2088
+ h !== void 0 && K(h, `material.${t}`, c);
2089
+ }
2090
+ };
2091
+ }
2092
+ function Va(t, n, a, e) {
2093
+ const i = {
2094
+ type: "number",
2095
+ title: Ae(t),
2096
+ prop: t,
2097
+ value: n,
2098
+ min: void 0,
2099
+ max: void 0,
2100
+ step: 0.01,
2101
+ needsUpdate: !0,
2102
+ onChange: (c, h) => {
2103
+ e.updateObject(a.uuid, `material.${t}`, h), e.updateObject(a.uuid, "material.needsUpdate", !0);
2104
+ const o = e.scene?.getObjectByProperty("uuid", a.uuid);
2105
+ o !== void 0 && K(o, `material.${t}`, h);
2106
+ }
2107
+ };
2108
+ switch (t) {
2109
+ case "blending":
2110
+ ut(i, Ba);
2111
+ break;
2112
+ case "blendDst":
2113
+ ut(i, za);
2114
+ break;
2115
+ case "blendEquation":
2116
+ ut(i, Ua);
2117
+ break;
2118
+ case "blendSrc":
2119
+ ut(i, $a);
2120
+ break;
2121
+ case "side":
2122
+ ut(i, Fa);
2123
+ break;
2124
+ }
2125
+ return Na(t) && (i.value = Number(n), i.type = "range", i.min = 0, i.max = 1, i.step = 0.01), i;
2126
+ }
2127
+ function Ga(t, n, a, e) {
2128
+ const i = {
2129
+ type: "string",
2130
+ title: Ae(t),
2131
+ prop: t,
2132
+ value: n,
2133
+ needsUpdate: !0,
2134
+ onChange: (h, o) => {
2135
+ e.updateObject(a.uuid, `material.${t}`, o), e.updateObject(a.uuid, "material.needsUpdate", !0);
2136
+ const u = e.scene?.getObjectByProperty("uuid", a.uuid);
2137
+ u !== void 0 && K(u, `material.${t}`, o);
2138
+ }
2139
+ };
2140
+ return (t === "vertexShader" || t === "fragmentShader") && (i.disabled = !1, i.latest = i.value, i.onChange = (h, o) => {
2141
+ i.latest = o;
2142
+ }), i;
2143
+ }
2144
+ function Xt(t, n, a) {
2050
2145
  const e = [];
2051
2146
  for (const i in t) {
2052
- if (!ka(i))
2147
+ if (!Ia(i))
2053
2148
  continue;
2054
- const o = typeof t[i], h = t[i];
2055
- if (o === "boolean" || o === "number" || o === "string") {
2056
- const c = {
2057
- title: Ve(i),
2058
- prop: i,
2059
- type: o,
2060
- value: h,
2061
- min: void 0,
2062
- max: void 0,
2063
- needsUpdate: o === "boolean",
2064
- onChange: (u, v) => {
2065
- a.updateObject(n.uuid, `material.${u}`, v), c.needsUpdate && a.updateObject(n.uuid, "material.needsUpdate", !0);
2066
- const b = a.scene?.getObjectByProperty("uuid", n.uuid);
2067
- b !== void 0 && ee(b, `material.${u}`, v);
2068
- }
2069
- };
2070
- switch (i) {
2071
- case "blending":
2072
- ot(c, Na);
2073
- break;
2074
- case "blendDst":
2075
- ot(c, Ba);
2076
- break;
2077
- case "blendEquation":
2078
- ot(c, La);
2079
- break;
2080
- case "blendSrc":
2081
- ot(c, Fa);
2082
- break;
2083
- case "side":
2084
- ot(c, Ia);
2085
- break;
2086
- }
2087
- ja(i) && (c.value = Number(h), c.type = "range", c.min = 0, c.max = 1, c.step = 0.01);
2088
- const d = o === "string" && (i === "vertexShader" || i === "fragmentShader");
2089
- d && (c.disabled = !1, c.latest = c.value, c.onChange = (u, v) => {
2090
- c.latest = v;
2091
- }), e.push(c), d && e.push({
2092
- title: `${lt(i)} - Update`,
2093
- type: "button",
2094
- onChange: () => {
2095
- a.updateObject(n.uuid, `material.${i}`, c.latest), a.updateObject(n.uuid, "material.needsUpdate", !0);
2096
- const u = a.scene?.getObjectByProperty("uuid", n.uuid);
2097
- u !== void 0 && (ee(u, `material.${i}`, c.latest), u.material.needsUpdate = !0);
2098
- }
2099
- });
2100
- } else if (o === "object")
2149
+ const c = typeof t[i], h = t[i];
2150
+ if (c === "boolean")
2151
+ e.push(Ya(i, h, n, a));
2152
+ else if (c === "number")
2153
+ e.push(Va(i, h, n, a));
2154
+ else if (c === "string")
2155
+ e.push(Ga(i, h, n, a));
2156
+ else if (c === "object")
2101
2157
  if (h.isColor)
2102
2158
  e.push({
2103
- title: Ve(i),
2159
+ title: Ae(i),
2104
2160
  prop: i,
2105
2161
  type: "color",
2106
2162
  value: h,
2107
- onChange: (c, d) => {
2108
- const u = new St(d);
2109
- a.updateObject(n.uuid, `material.${c}`, u);
2110
- const v = a.scene?.getObjectByProperty("uuid", n.uuid);
2111
- v !== void 0 && ee(v, `material.${c}`, u);
2163
+ onChange: (o, u) => {
2164
+ const d = new Ct(u);
2165
+ a.updateObject(n.uuid, `material.${o}`, d);
2166
+ const f = a.scene?.getObjectByProperty("uuid", n.uuid);
2167
+ f !== void 0 && K(f, `material.${o}`, d);
2112
2168
  }
2113
2169
  });
2114
2170
  else if (Array.isArray(h)) {
2115
- const c = [];
2116
- for (const d in h)
2117
- c.push({
2118
- title: `${d}`,
2119
- type: `${typeof h[d]}`,
2120
- value: h[d],
2121
- onChange: (u, v) => {
2122
- a.updateObject(n.uuid, `material.${i}`, v);
2171
+ const o = [];
2172
+ for (const u in h)
2173
+ o.push({
2174
+ title: `${u}`,
2175
+ type: `${typeof h[u]}`,
2176
+ value: h[u],
2177
+ onChange: (d, f) => {
2178
+ a.updateObject(n.uuid, `material.${i}`, f);
2123
2179
  const b = a.scene?.getObjectByProperty("uuid", n.uuid);
2124
- b !== void 0 && ee(b, `material.${i}`, v);
2180
+ b !== void 0 && K(b, `material.${i}`, f);
2125
2181
  }
2126
2182
  });
2127
2183
  e.push({
2128
- title: Ve(i),
2129
- items: c
2184
+ title: Ae(i),
2185
+ items: o
2130
2186
  });
2131
- } else {
2132
- const c = [];
2133
- for (const d in h) {
2134
- const u = h[d];
2135
- switch (typeof u) {
2187
+ } else if (h.x !== void 0 && h.y !== void 0 && h.z === void 0)
2188
+ e.push({
2189
+ title: Ae(i),
2190
+ prop: i,
2191
+ type: "vector",
2192
+ value: h,
2193
+ onChange: (o, u) => {
2194
+ a.updateObject(n.uuid, `material.${o}`, u);
2195
+ const d = a.scene?.getObjectByProperty("uuid", n.uuid);
2196
+ d !== void 0 && K(d, `material.${o}`, u);
2197
+ }
2198
+ });
2199
+ else {
2200
+ const o = [];
2201
+ for (const u in h) {
2202
+ const d = h[u];
2203
+ switch (typeof d) {
2136
2204
  case "boolean":
2137
2205
  case "number":
2138
2206
  case "string":
2139
- d === "src" ? e.push({
2140
- title: Ve(i),
2207
+ u === "src" ? e.push({
2208
+ title: Ae(i),
2141
2209
  type: "image",
2142
- value: u,
2210
+ value: d,
2143
2211
  onChange: (b, E) => {
2144
2212
  a.createTexture(n.uuid, `material.${i}`, E);
2145
- const S = a.scene?.getObjectByProperty("uuid", n.uuid);
2146
- S !== void 0 && Dt(E).then((D) => {
2147
- ee(S, `material.${i}`, D), ee(S, "material.needsUpdate", !0);
2213
+ const x = a.scene?.getObjectByProperty("uuid", n.uuid);
2214
+ x !== void 0 && It(E).then((M) => {
2215
+ K(x, `material.${i}`, M), K(x, "material.needsUpdate", !0);
2148
2216
  });
2149
2217
  }
2150
- }) : c.push({
2151
- title: `${Ve(d)}`,
2152
- prop: `material.${i}.${d}`,
2153
- type: `${typeof t[i][d]}`,
2154
- value: h[d],
2218
+ }) : o.push({
2219
+ title: `${Ae(u)}`,
2220
+ prop: `material.${i}.${u}`,
2221
+ type: `${typeof t[i][u]}`,
2222
+ value: h[u],
2155
2223
  onChange: (b, E) => {
2156
- a.updateObject(n.uuid, `material.${i}.${d}`, E);
2157
- const S = a.scene?.getObjectByProperty("uuid", n.uuid);
2158
- S !== void 0 && ee(S, `material.${i}.${d}`, E);
2224
+ a.updateObject(n.uuid, `material.${i}.${u}`, E);
2225
+ const x = a.scene?.getObjectByProperty("uuid", n.uuid);
2226
+ x !== void 0 && K(x, `material.${i}.${u}`, E);
2159
2227
  }
2160
2228
  });
2161
2229
  break;
2162
2230
  case "object":
2163
- if (u.value !== void 0 && u.value.src !== void 0)
2164
- c.push({
2165
- title: Ve(d),
2231
+ if (d.value !== void 0 && d.value.src !== void 0)
2232
+ o.push({
2233
+ title: Ae(u),
2166
2234
  type: "image",
2167
- value: u.value.src,
2235
+ value: d.value.src,
2168
2236
  onChange: (b, E) => {
2169
- a.createTexture(n.uuid, `material.${i}.${d}.value`, h);
2170
- const S = a.scene?.getObjectByProperty("uuid", n.uuid);
2171
- S !== void 0 && Dt(E).then((D) => {
2172
- ee(S, `material.${i}.${d}.value`, D);
2237
+ a.createTexture(n.uuid, `material.${i}.${u}.value`, h);
2238
+ const x = a.scene?.getObjectByProperty("uuid", n.uuid);
2239
+ x !== void 0 && It(E).then((M) => {
2240
+ K(x, `material.${i}.${u}.value`, M);
2173
2241
  });
2174
2242
  }
2175
2243
  });
2176
2244
  else if (i === "uniforms") {
2177
- const b = u.value, E = (S, D, I) => ({
2178
- title: S,
2245
+ const b = d.value, E = (x, M, P) => ({
2246
+ title: x,
2179
2247
  type: "number",
2180
- value: I,
2248
+ value: P,
2181
2249
  step: 0.01,
2182
- onChange: (q, B) => {
2183
- const M = `material.uniforms.${d}.value.${D}`;
2184
- a.updateObject(n.uuid, M, B);
2185
- const z = a.scene?.getObjectByProperty("uuid", n.uuid);
2186
- z !== void 0 && ee(z, M, B);
2250
+ onChange: (V, U) => {
2251
+ const j = `material.uniforms.${u}.value.${M}`;
2252
+ a.updateObject(n.uuid, j, U);
2253
+ const O = a.scene?.getObjectByProperty("uuid", n.uuid);
2254
+ O !== void 0 && K(O, j, U);
2187
2255
  }
2188
2256
  });
2189
- if (typeof u.value == "number")
2190
- c.push({
2191
- title: d,
2257
+ if (typeof d.value == "number")
2258
+ o.push({
2259
+ title: u,
2192
2260
  type: "number",
2193
- value: u.value,
2194
- onChange: (S, D) => {
2195
- const I = `material.${i}.${S}.value`;
2196
- a.updateObject(n.uuid, I, D);
2197
- const q = a.scene?.getObjectByProperty("uuid", n.uuid);
2198
- q !== void 0 && ee(q, I, D);
2261
+ value: d.value,
2262
+ step: 0.01,
2263
+ onChange: (x, M) => {
2264
+ const P = `material.${i}.${x}.value`;
2265
+ a.updateObject(n.uuid, P, M);
2266
+ const V = a.scene?.getObjectByProperty("uuid", n.uuid);
2267
+ V !== void 0 && K(V, P, M);
2199
2268
  }
2200
2269
  });
2201
2270
  else if (b.r !== void 0 && b.g !== void 0 && b.b !== void 0)
2202
- c.push({
2203
- title: d,
2271
+ o.push({
2272
+ title: u,
2204
2273
  type: "color",
2205
- value: u.value,
2206
- onChange: (S, D) => {
2207
- const I = new St(D), q = `material.${i}.${S}.value`;
2208
- a.updateObject(n.uuid, q, I);
2209
- const B = a.scene?.getObjectByProperty("uuid", n.uuid);
2210
- B !== void 0 && ee(B, q, I);
2274
+ value: d.value,
2275
+ onChange: (x, M) => {
2276
+ const P = new Ct(M), V = `material.${i}.${x}.value`;
2277
+ a.updateObject(n.uuid, V, P);
2278
+ const U = a.scene?.getObjectByProperty("uuid", n.uuid);
2279
+ U !== void 0 && K(U, V, P);
2211
2280
  }
2212
2281
  });
2213
2282
  else if (b.x !== void 0 && b.y !== void 0 && b.z === void 0 && b.w === void 0)
2214
- c.push(
2215
- {
2216
- title: d,
2217
- items: [
2218
- E("X", "x", u.value.x),
2219
- E("Y", "y", u.value.y)
2220
- ]
2283
+ o.push({
2284
+ title: u,
2285
+ type: "vector",
2286
+ value: d.value,
2287
+ prop: `material.${i}.${u}.value`,
2288
+ onChange: (x, M) => {
2289
+ a.updateObject(n.uuid, x, M);
2290
+ const P = a.scene?.getObjectByProperty("uuid", n.uuid);
2291
+ P !== void 0 && K(P, x, M);
2221
2292
  }
2222
- );
2293
+ });
2223
2294
  else if (b.x !== void 0 && b.y !== void 0 && b.z !== void 0 && b.w === void 0)
2224
- c.push(
2295
+ o.push(
2225
2296
  {
2226
- title: d,
2297
+ title: u,
2227
2298
  items: [
2228
- E("X", "x", u.value.x),
2229
- E("Y", "y", u.value.y),
2230
- E("Z", "z", u.value.z)
2299
+ E("X", "x", d.value.x),
2300
+ E("Y", "y", d.value.y),
2301
+ E("Z", "z", d.value.z)
2231
2302
  ]
2232
2303
  }
2233
2304
  );
2234
2305
  else if (b.x !== void 0 && b.y !== void 0 && b.z !== void 0 && b.w !== void 0)
2235
- c.push(
2306
+ o.push(
2236
2307
  {
2237
- title: d,
2308
+ title: u,
2238
2309
  items: [
2239
- E("X", "x", u.value.x),
2240
- E("Y", "y", u.value.y),
2241
- E("Z", "z", u.value.z),
2242
- E("W", "w", u.value.w)
2310
+ E("X", "x", d.value.x),
2311
+ E("Y", "y", d.value.y),
2312
+ E("Z", "z", d.value.z),
2313
+ E("W", "w", d.value.w)
2243
2314
  ]
2244
2315
  }
2245
2316
  );
2246
2317
  else if (b.elements !== void 0) {
2247
- const S = b.elements, D = [];
2248
- for (let I = 0; I < S.length; I++)
2249
- D.push(E(I.toString(), I.toString(), S[I]));
2250
- c.push(
2318
+ const x = b.elements, M = [];
2319
+ for (let P = 0; P < x.length; P++)
2320
+ M.push(E(P.toString(), P.toString(), x[P]));
2321
+ o.push(
2251
2322
  {
2252
- title: d,
2253
- items: D
2323
+ title: u,
2324
+ items: M
2254
2325
  }
2255
2326
  );
2256
2327
  } else
2257
- console.log(">>> need to add this format:", d, b);
2328
+ console.log(">>> need to add this format:", u, b);
2258
2329
  } else
2259
- c.push({
2260
- title: d,
2261
- type: `${typeof u.value}`,
2262
- value: u.value,
2330
+ o.push({
2331
+ title: u,
2332
+ type: `${typeof d.value}`,
2333
+ value: d.value,
2263
2334
  onChange: (b, E) => {
2264
- a.updateObject(n.uuid, `material.${i}.${d}.value`, E);
2265
- const S = a.scene?.getObjectByProperty("uuid", n.uuid);
2266
- S !== void 0 && ee(S, `material.${i}.${d}.value`, E);
2335
+ a.updateObject(n.uuid, `material.${i}.${u}.value`, E);
2336
+ const x = a.scene?.getObjectByProperty("uuid", n.uuid);
2337
+ x !== void 0 && K(x, `material.${i}.${u}.value`, E);
2267
2338
  }
2268
2339
  });
2269
2340
  break;
2270
2341
  }
2271
2342
  }
2272
- c.length > 0 && e.push({
2273
- title: Ve(i),
2274
- items: c
2343
+ o.length > 0 && e.push({
2344
+ title: Ae(i),
2345
+ items: o
2275
2346
  });
2276
2347
  }
2277
2348
  else
2278
- h !== void 0 && console.log("other:", i, o, h);
2349
+ h !== void 0 && console.log("other:", i, c, h);
2279
2350
  }
2280
- return e.sort((i, o) => i.title < o.title ? -1 : i.title > o.title ? 1 : 0), e.push({
2351
+ return e.sort((i, c) => i.title < c.title ? -1 : i.title > c.title ? 1 : 0), e.push({
2281
2352
  title: "Update Material",
2282
2353
  type: "button",
2283
2354
  onChange: () => {
@@ -2285,76 +2356,169 @@ function Wt(t, n, a) {
2285
2356
  }
2286
2357
  }), e;
2287
2358
  }
2288
- function Ua(t, n) {
2359
+ function Ha(t, n) {
2289
2360
  const a = t.material;
2290
2361
  if (Array.isArray(a)) {
2291
2362
  const e = [], i = a.length;
2292
- for (let o = 0; o < i; o++)
2363
+ for (let c = 0; c < i; c++)
2293
2364
  e.push(
2294
2365
  /* @__PURE__ */ l.jsx(
2295
- We,
2366
+ Ze,
2296
2367
  {
2297
- title: `Material ${o}`,
2298
- items: Wt(a[o], t, n)
2368
+ title: `Material ${c}`,
2369
+ items: Xt(a[c], t, n)
2299
2370
  },
2300
- `Material ${o}`
2371
+ `Material ${c}`
2301
2372
  )
2302
2373
  );
2303
2374
  return /* @__PURE__ */ l.jsx(l.Fragment, { children: e });
2304
2375
  } else
2305
2376
  return /* @__PURE__ */ l.jsx(
2306
- We,
2377
+ Ze,
2307
2378
  {
2308
2379
  title: "Material",
2309
- items: Wt(a, t, n)
2380
+ items: Xt(a, t, n)
2310
2381
  }
2311
2382
  );
2312
2383
  }
2313
- function ct(t) {
2384
+ function Wa(t) {
2385
+ const n = fe(null), a = fe(null), e = fe(null), i = fe(null), c = fe(null), h = fe(null), [o, u] = ae(t.value), [d, f] = ae({ min: t.min, max: t.max }), [b, E] = ae(!1);
2386
+ function x() {
2387
+ b || (window.addEventListener("mousemove", P), window.addEventListener("mouseup", M), window.addEventListener("mouseup", M), E(!0));
2388
+ }
2389
+ function M() {
2390
+ window.removeEventListener("mousemove", P), window.removeEventListener("mouseup", M), E(!1);
2391
+ }
2392
+ function P(O) {
2393
+ const re = c.current.getBoundingClientRect(), Q = Xe(0, 99, O.clientX - re.left) / 99, Ce = Xe(0, 99, O.clientY - re.top) / 99, G = ht(Wt(d.min, d.max, Q), 3), ee = ht(Wt(d.min, d.max, Ce), 3);
2394
+ t.onChange({ target: { value: { x: G, y: ee } } }), u({ x: G, y: ee });
2395
+ }
2396
+ function V(O) {
2397
+ let re = o.x, Q = o.y;
2398
+ O.target === n.current ? re = Number(O.target.value) : Q = Number(O.target.value), u({ x: re, y: Q });
2399
+ }
2400
+ function U() {
2401
+ const O = Number(e.current.value);
2402
+ f({ min: O, max: d.max }), (o.x < O || o.y < O) && u({ x: Xe(O, d.max, o.x), y: Xe(O, d.max, o.y) });
2403
+ }
2404
+ function j() {
2405
+ const O = Number(i.current.value);
2406
+ f({ min: d.min, max: O }), (o.x > O || o.y > O) && u({ x: Xe(d.min, O, o.x), y: Xe(d.min, O, o.y) });
2407
+ }
2408
+ return ke(() => {
2409
+ const O = Ht(d.min, d.max, o.x), re = Ht(d.min, d.max, o.y);
2410
+ h.current.style.left = `${O * 100}%`, h.current.style.top = `${re * 100}%`;
2411
+ }, [d, o]), /* @__PURE__ */ l.jsxs("div", { className: "vector", children: [
2412
+ /* @__PURE__ */ l.jsxs("div", { className: "fields", children: [
2413
+ /* @__PURE__ */ l.jsxs("div", { children: [
2414
+ /* @__PURE__ */ l.jsx("label", { children: "X:" }),
2415
+ /* @__PURE__ */ l.jsx(
2416
+ "input",
2417
+ {
2418
+ ref: n,
2419
+ type: "number",
2420
+ value: o.x,
2421
+ min: d.min,
2422
+ max: d.max,
2423
+ step: 0.01,
2424
+ onChange: V
2425
+ }
2426
+ )
2427
+ ] }),
2428
+ /* @__PURE__ */ l.jsxs("div", { children: [
2429
+ /* @__PURE__ */ l.jsx("label", { children: "Y:" }),
2430
+ /* @__PURE__ */ l.jsx(
2431
+ "input",
2432
+ {
2433
+ ref: a,
2434
+ type: "number",
2435
+ value: o.y,
2436
+ min: d.min,
2437
+ max: d.max,
2438
+ step: 0.01,
2439
+ onChange: V
2440
+ }
2441
+ )
2442
+ ] }),
2443
+ /* @__PURE__ */ l.jsxs("div", { children: [
2444
+ /* @__PURE__ */ l.jsx("label", { children: "Min:" }),
2445
+ /* @__PURE__ */ l.jsx(
2446
+ "input",
2447
+ {
2448
+ ref: e,
2449
+ type: "number",
2450
+ value: d.min,
2451
+ step: 0.01,
2452
+ onChange: U
2453
+ }
2454
+ )
2455
+ ] }),
2456
+ /* @__PURE__ */ l.jsxs("div", { children: [
2457
+ /* @__PURE__ */ l.jsx("label", { children: "Max:" }),
2458
+ /* @__PURE__ */ l.jsx(
2459
+ "input",
2460
+ {
2461
+ ref: i,
2462
+ type: "number",
2463
+ value: d.max,
2464
+ step: 0.01,
2465
+ onChange: j
2466
+ }
2467
+ )
2468
+ ] })
2469
+ ] }),
2470
+ /* @__PURE__ */ l.jsxs("div", { className: "input", ref: c, onMouseDown: x, onMouseUp: M, children: [
2471
+ /* @__PURE__ */ l.jsx("div", { className: "x" }),
2472
+ /* @__PURE__ */ l.jsx("div", { className: "y" }),
2473
+ /* @__PURE__ */ l.jsx("div", { className: "pt", ref: h })
2474
+ ] })
2475
+ ] });
2476
+ }
2477
+ function dt(t) {
2314
2478
  let n = t.value;
2315
- n !== void 0 && n.isColor !== void 0 && (n = pa(t.value));
2316
- const [a, e] = oe(n), i = Re(null), o = Re(null), h = Re(null);
2317
- _e(() => {
2318
- let v = !1, b = -1, E = 0, S = Number(a);
2319
- const D = (z) => {
2320
- v = !0, E = S, b = z.clientX;
2321
- }, I = (z) => {
2322
- if (!v)
2479
+ n !== void 0 && n.isColor !== void 0 && (n = ga(t.value));
2480
+ const [a, e] = ae(n), i = fe(null), c = fe(null), h = fe(null);
2481
+ ke(() => {
2482
+ let f = !1, b = -1, E = 0, x = Number(a);
2483
+ const M = (O) => {
2484
+ f = !0, E = x, b = O.clientX;
2485
+ }, P = (O) => {
2486
+ if (!f)
2323
2487
  return;
2324
- const we = t.step !== void 0 ? t.step : 1, ce = (z.clientX - b) * we;
2325
- S = Number((E + ce).toFixed(4)), o.current !== null && (o.current.value = S.toString()), t.onChange !== void 0 && t.onChange(t.prop !== void 0 ? t.prop : t.title, S);
2326
- }, q = () => {
2327
- v = !1;
2328
- }, B = () => {
2329
- v = !1;
2330
- }, M = t.type === "number";
2331
- return M && (i.current?.addEventListener("mousedown", D, !1), document.addEventListener("mouseup", q, !1), document.addEventListener("mousemove", I, !1), document.addEventListener("contextmenu", B, !1)), () => {
2332
- M && (i.current?.removeEventListener("mousedown", D), document.removeEventListener("mouseup", q), document.removeEventListener("mousemove", I), document.removeEventListener("contextmenu", B));
2488
+ const re = t.step !== void 0 ? t.step : 1, Q = (O.clientX - b) * re;
2489
+ x = Number((E + Q).toFixed(4)), c.current !== null && (c.current.value = x.toString()), t.onChange !== void 0 && t.onChange(t.prop !== void 0 ? t.prop : t.title, x);
2490
+ }, V = () => {
2491
+ f = !1;
2492
+ }, U = () => {
2493
+ f = !1;
2494
+ }, j = t.type === "number";
2495
+ return j && (i.current?.addEventListener("mousedown", M, !1), document.addEventListener("mouseup", V, !1), document.addEventListener("mousemove", P, !1), document.addEventListener("contextmenu", U, !1)), () => {
2496
+ j && (i.current?.removeEventListener("mousedown", M), document.removeEventListener("mouseup", V), document.removeEventListener("mousemove", P), document.removeEventListener("contextmenu", U));
2333
2497
  };
2334
2498
  }, [a]);
2335
- const c = t.type === "string" && (a.length > 100 || a.search(`
2336
- `) > -1), d = c || t.type === "image", u = (v) => {
2337
- let b = v.target.value;
2338
- t.type === "boolean" ? b = v.target.checked : t.type === "option" && (b = t.options[b].value), e(b), t.onChange !== void 0 && t.onChange(t.prop !== void 0 ? t.prop : t.title, b);
2499
+ const o = t.type === "string" && (a.length > 100 || a.search(`
2500
+ `) > -1), u = o || t.type === "image" || t.type === "vector", d = (f) => {
2501
+ let b = f.target.value;
2502
+ t.type === "boolean" ? b = f.target.checked : t.type === "option" && (b = t.options[b].value), e(b), t.onChange !== void 0 && t.onChange(t.prop !== void 0 ? t.prop : t.title, b);
2339
2503
  };
2340
- return /* @__PURE__ */ l.jsxs("div", { className: `field ${d ? "block" : ""}`, children: [
2341
- t.type !== "button" && /* @__PURE__ */ l.jsx("label", { ref: i, children: lt(t.title) }, "fieldLabel"),
2342
- t.type === "string" && !c && /* @__PURE__ */ l.jsx(
2504
+ return /* @__PURE__ */ l.jsxs("div", { className: `field ${u ? "block" : ""}`, children: [
2505
+ t.type !== "button" && /* @__PURE__ */ l.jsx("label", { ref: i, children: St(t.title) }, "fieldLabel"),
2506
+ t.type === "string" && !o && /* @__PURE__ */ l.jsx(
2343
2507
  "input",
2344
2508
  {
2345
2509
  type: "text",
2346
2510
  disabled: t.disabled,
2347
- onChange: u,
2511
+ onChange: d,
2348
2512
  value: a
2349
2513
  }
2350
2514
  ),
2351
- t.type === "string" && c && /* @__PURE__ */ l.jsx(
2515
+ t.type === "string" && o && /* @__PURE__ */ l.jsx(
2352
2516
  "textarea",
2353
2517
  {
2354
2518
  cols: 50,
2355
2519
  rows: 10,
2356
2520
  disabled: t.disabled !== void 0 ? t.disabled : !0,
2357
- onChange: u,
2521
+ onChange: d,
2358
2522
  value: a
2359
2523
  }
2360
2524
  ),
@@ -2363,25 +2527,25 @@ function ct(t) {
2363
2527
  {
2364
2528
  type: "checkbox",
2365
2529
  disabled: t.disabled,
2366
- onChange: u,
2530
+ onChange: d,
2367
2531
  checked: a
2368
2532
  }
2369
2533
  ),
2370
2534
  t.type === "number" && /* @__PURE__ */ l.jsx(
2371
2535
  "input",
2372
2536
  {
2373
- ref: o,
2537
+ ref: c,
2374
2538
  type: "number",
2375
2539
  value: a,
2376
2540
  min: t.min,
2377
2541
  max: t.max,
2378
2542
  step: t.step,
2379
2543
  disabled: t.disabled,
2380
- onChange: u
2544
+ onChange: d
2381
2545
  }
2382
2546
  ),
2383
2547
  t.type === "range" && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
2384
- /* @__PURE__ */ l.jsx("input", { type: "text", value: a.toString(), onChange: u, disabled: t.disabled, className: "min" }),
2548
+ /* @__PURE__ */ l.jsx("input", { type: "text", value: a.toString(), onChange: d, disabled: t.disabled, className: "min" }),
2385
2549
  /* @__PURE__ */ l.jsx(
2386
2550
  "input",
2387
2551
  {
@@ -2391,13 +2555,13 @@ function ct(t) {
2391
2555
  min: t.min,
2392
2556
  max: t.max,
2393
2557
  step: t.step,
2394
- onChange: u
2558
+ onChange: d
2395
2559
  }
2396
2560
  )
2397
2561
  ] }),
2398
2562
  t.type === "color" && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
2399
- /* @__PURE__ */ l.jsx("input", { type: "text", value: a.toString(), onChange: u, disabled: t.disabled, className: "color" }),
2400
- /* @__PURE__ */ l.jsx("input", { type: "color", value: a, onChange: u, disabled: t.disabled })
2563
+ /* @__PURE__ */ l.jsx("input", { type: "text", value: a.toString(), onChange: d, disabled: t.disabled, className: "color" }),
2564
+ /* @__PURE__ */ l.jsx("input", { type: "color", value: a, onChange: d, disabled: t.disabled })
2401
2565
  ] }),
2402
2566
  t.type === "button" && /* @__PURE__ */ l.jsx(
2403
2567
  "button",
@@ -2410,14 +2574,15 @@ function ct(t) {
2410
2574
  }
2411
2575
  ),
2412
2576
  t.type === "image" && /* @__PURE__ */ l.jsx("img", { ref: h, onClick: () => {
2413
- Da().then((v) => {
2414
- h.current.src = v, t.onChange !== void 0 && t.onChange(t.prop !== void 0 ? t.prop : t.title, v);
2577
+ La().then((f) => {
2578
+ h.current.src = f, t.onChange !== void 0 && t.onChange(t.prop !== void 0 ? t.prop : t.title, f);
2415
2579
  });
2416
- }, src: a.length > 0 ? a : Aa }),
2417
- t.type === "option" && /* @__PURE__ */ l.jsx(l.Fragment, { children: /* @__PURE__ */ l.jsx("select", { onChange: u, disabled: t.disabled, defaultValue: t.value, children: t.options?.map((v, b) => /* @__PURE__ */ l.jsx("option", { value: v.value, children: lt(v.title) }, b)) }) })
2580
+ }, src: a.length > 0 ? a : ja }),
2581
+ t.type === "option" && /* @__PURE__ */ l.jsx(l.Fragment, { children: /* @__PURE__ */ l.jsx("select", { onChange: d, disabled: t.disabled, defaultValue: t.value, children: t.options?.map((f, b) => /* @__PURE__ */ l.jsx("option", { value: f.value, children: St(f.title) }, b)) }) }),
2582
+ t.type === "vector" && /* @__PURE__ */ l.jsx(Wa, { value: a, min: -1, max: 1, onChange: d })
2418
2583
  ] });
2419
2584
  }
2420
- function qt(t) {
2585
+ function Zt(t) {
2421
2586
  switch (t) {
2422
2587
  case "fov":
2423
2588
  return "FOV";
@@ -2446,68 +2611,68 @@ function qt(t) {
2446
2611
  }
2447
2612
  return t;
2448
2613
  }
2449
- function $a(t, n) {
2614
+ function qa(t, n) {
2450
2615
  const a = [];
2451
2616
  if (t.perspectiveCameraInfo !== void 0)
2452
2617
  for (const e in t.perspectiveCameraInfo)
2453
2618
  a.push({
2454
- title: qt(e),
2619
+ title: Zt(e),
2455
2620
  prop: e,
2456
2621
  type: "number",
2457
2622
  step: 0.01,
2458
2623
  value: t.perspectiveCameraInfo[e],
2459
- onChange: (i, o) => {
2460
- n.updateObject(t.uuid, i, o), n.requestMethod(t.uuid, "updateProjectionMatrix");
2624
+ onChange: (i, c) => {
2625
+ n.updateObject(t.uuid, i, c), n.requestMethod(t.uuid, "updateProjectionMatrix");
2461
2626
  const h = n.scene?.getObjectByProperty("uuid", t.uuid);
2462
- h !== void 0 && (ee(h, i, o), h.updateProjectionMatrix());
2627
+ h !== void 0 && (K(h, i, c), h.updateProjectionMatrix());
2463
2628
  }
2464
2629
  });
2465
2630
  else if (t.orthographicCameraInfo !== void 0)
2466
2631
  for (const e in t.orthographicCameraInfo)
2467
2632
  a.push({
2468
- title: qt(e),
2633
+ title: Zt(e),
2469
2634
  prop: e,
2470
2635
  type: "number",
2471
2636
  step: 0.01,
2472
2637
  value: t.perspectiveCameraInfo[e],
2473
- onChange: (i, o) => {
2474
- n.updateObject(t.uuid, i, o), n.requestMethod(t.uuid, "updateProjectionMatrix");
2638
+ onChange: (i, c) => {
2639
+ n.updateObject(t.uuid, i, c), n.requestMethod(t.uuid, "updateProjectionMatrix");
2475
2640
  const h = n.scene?.getObjectByProperty("uuid", t.uuid);
2476
- h !== void 0 && (ee(h, i, o), h.updateProjectionMatrix());
2641
+ h !== void 0 && (K(h, i, c), h.updateProjectionMatrix());
2477
2642
  }
2478
2643
  });
2479
2644
  return /* @__PURE__ */ l.jsx(
2480
- We,
2645
+ Ze,
2481
2646
  {
2482
2647
  title: "Camera",
2483
2648
  items: a
2484
2649
  }
2485
2650
  );
2486
2651
  }
2487
- const za = Math.PI / 180, Ya = 180 / Math.PI;
2488
- function Qe(t, n, a, e, i) {
2652
+ const Ka = Math.PI / 180, Xa = 180 / Math.PI;
2653
+ function at(t, n, a, e, i) {
2489
2654
  return e + (t - n) * (i - e) / (a - n);
2490
2655
  }
2491
- function Ga(t) {
2492
- return t * za;
2656
+ function Za(t) {
2657
+ return t * Ka;
2493
2658
  }
2494
- function Pt(t) {
2495
- return t * Ya;
2659
+ function kt(t) {
2660
+ return t * Xa;
2496
2661
  }
2497
- function Va(t, n) {
2498
- const a = new Wn();
2662
+ function Ja(t, n) {
2663
+ const a = new Xn();
2499
2664
  a.elements = t.matrix;
2500
- const e = new W(), i = new qn(), o = new W();
2501
- t.uuid.length > 0 && (e.setFromMatrixPosition(a), i.setFromRotationMatrix(a), o.setFromMatrixScale(a));
2502
- const h = (d, u) => {
2503
- n.updateObject(t.uuid, d, u);
2504
- const v = n.scene?.getObjectByProperty("uuid", t.uuid);
2505
- v !== void 0 && ee(v, d, u);
2506
- }, c = (d, u) => {
2507
- h(d, Ga(u));
2665
+ const e = new q(), i = new Zn(), c = new q();
2666
+ t.uuid.length > 0 && (e.setFromMatrixPosition(a), i.setFromRotationMatrix(a), c.setFromMatrixScale(a));
2667
+ const h = (u, d) => {
2668
+ n.updateObject(t.uuid, u, d);
2669
+ const f = n.scene?.getObjectByProperty("uuid", t.uuid);
2670
+ f !== void 0 && K(f, u, d);
2671
+ }, o = (u, d) => {
2672
+ h(u, Za(d));
2508
2673
  };
2509
2674
  return /* @__PURE__ */ l.jsx(
2510
- We,
2675
+ Ze,
2511
2676
  {
2512
2677
  title: "Transform",
2513
2678
  items: [
@@ -2536,37 +2701,37 @@ function Va(t, n) {
2536
2701
  title: "Rotation X",
2537
2702
  prop: "rotation.x",
2538
2703
  type: "number",
2539
- value: _t(Pt(i.x)),
2704
+ value: ht(kt(i.x)),
2540
2705
  min: -360,
2541
2706
  max: 360,
2542
2707
  step: 0.1,
2543
- onChange: c
2708
+ onChange: o
2544
2709
  },
2545
2710
  {
2546
2711
  title: "Rotation Y",
2547
2712
  prop: "rotation.y",
2548
2713
  type: "number",
2549
- value: _t(Pt(i.y)),
2714
+ value: ht(kt(i.y)),
2550
2715
  min: -360,
2551
2716
  max: 360,
2552
2717
  step: 0.1,
2553
- onChange: c
2718
+ onChange: o
2554
2719
  },
2555
2720
  {
2556
2721
  title: "Rotation Z",
2557
2722
  prop: "rotation.z",
2558
2723
  type: "number",
2559
- value: _t(Pt(i.z)),
2724
+ value: ht(kt(i.z)),
2560
2725
  min: -360,
2561
2726
  max: 360,
2562
2727
  step: 0.1,
2563
- onChange: c
2728
+ onChange: o
2564
2729
  },
2565
2730
  {
2566
2731
  title: "Scale X",
2567
2732
  prop: "scale.x",
2568
2733
  type: "number",
2569
- value: o.x,
2734
+ value: c.x,
2570
2735
  step: 0.01,
2571
2736
  onChange: h
2572
2737
  },
@@ -2574,7 +2739,7 @@ function Va(t, n) {
2574
2739
  title: "Scale Y",
2575
2740
  prop: "scale.y",
2576
2741
  type: "number",
2577
- value: o.y,
2742
+ value: c.y,
2578
2743
  step: 0.01,
2579
2744
  onChange: h
2580
2745
  },
@@ -2582,7 +2747,7 @@ function Va(t, n) {
2582
2747
  title: "Scale Z",
2583
2748
  prop: "scale.z",
2584
2749
  type: "number",
2585
- value: o.z,
2750
+ value: c.z,
2586
2751
  step: 0.01,
2587
2752
  onChange: h
2588
2753
  }
@@ -2590,7 +2755,7 @@ function Va(t, n) {
2590
2755
  }
2591
2756
  );
2592
2757
  }
2593
- function Kt(t) {
2758
+ function Jt(t) {
2594
2759
  switch (t) {
2595
2760
  case "color":
2596
2761
  return "Color";
@@ -2609,54 +2774,54 @@ function Kt(t) {
2609
2774
  }
2610
2775
  return t;
2611
2776
  }
2612
- function Ha(t, n) {
2777
+ function Qa(t, n) {
2613
2778
  const a = [];
2614
2779
  if (t.lightInfo !== void 0)
2615
2780
  for (const e in t.lightInfo) {
2616
2781
  const i = t.lightInfo[e];
2617
2782
  i !== void 0 && (i.isColor !== void 0 ? a.push({
2618
- title: Kt(e),
2783
+ title: Jt(e),
2619
2784
  prop: e,
2620
2785
  type: "color",
2621
2786
  value: i,
2622
- onChange: (o, h) => {
2623
- const c = new St(h);
2624
- n.updateObject(t.uuid, o, c);
2625
- const d = n.scene?.getObjectByProperty("uuid", t.uuid);
2626
- d !== void 0 && ee(d, o, c);
2787
+ onChange: (c, h) => {
2788
+ const o = new Ct(h);
2789
+ n.updateObject(t.uuid, c, o);
2790
+ const u = n.scene?.getObjectByProperty("uuid", t.uuid);
2791
+ u !== void 0 && K(u, c, o);
2627
2792
  }
2628
2793
  }) : a.push({
2629
- title: Kt(e),
2794
+ title: Jt(e),
2630
2795
  prop: e,
2631
2796
  type: typeof i,
2632
2797
  value: i,
2633
2798
  step: typeof i == "number" ? 0.01 : void 0,
2634
- onChange: (o, h) => {
2635
- n.updateObject(t.uuid, o, h);
2636
- const c = n.scene?.getObjectByProperty("uuid", t.uuid);
2637
- c !== void 0 && ee(c, o, h);
2799
+ onChange: (c, h) => {
2800
+ n.updateObject(t.uuid, c, h);
2801
+ const o = n.scene?.getObjectByProperty("uuid", t.uuid);
2802
+ o !== void 0 && K(o, c, h);
2638
2803
  }
2639
2804
  }));
2640
2805
  }
2641
2806
  return /* @__PURE__ */ l.jsx(
2642
- We,
2807
+ Ze,
2643
2808
  {
2644
2809
  title: "Light",
2645
2810
  items: a
2646
2811
  }
2647
2812
  );
2648
2813
  }
2649
- function Wa(t, n) {
2814
+ function ei(t, n) {
2650
2815
  const a = [], e = [];
2651
2816
  let i = 0;
2652
- t.animations.forEach((c) => {
2653
- i = Math.max(i, c.duration), c.duration > 0 && e.push({
2654
- title: c.name,
2817
+ t.animations.forEach((o) => {
2818
+ i = Math.max(i, o.duration), o.duration > 0 && e.push({
2819
+ title: o.name,
2655
2820
  items: [
2656
2821
  {
2657
2822
  title: "Duration",
2658
2823
  type: "number",
2659
- value: c.duration,
2824
+ value: o.duration,
2660
2825
  disabled: !0
2661
2826
  },
2662
2827
  {
@@ -2680,39 +2845,39 @@ function Wa(t, n) {
2680
2845
  title: "Animations",
2681
2846
  items: e
2682
2847
  });
2683
- const o = n.scene?.getObjectByProperty("uuid", t.uuid);
2848
+ const c = n.scene?.getObjectByProperty("uuid", t.uuid);
2684
2849
  let h = !1;
2685
- if (o !== void 0) {
2686
- const c = o.mixer;
2687
- if (h = c !== void 0, h) {
2688
- const d = [
2850
+ if (c !== void 0) {
2851
+ const o = c.mixer;
2852
+ if (h = o !== void 0, h) {
2853
+ const u = [
2689
2854
  {
2690
2855
  title: "Time Scale",
2691
2856
  type: "range",
2692
- value: c.timeScale,
2857
+ value: o.timeScale,
2693
2858
  step: 0.01,
2694
2859
  min: -1,
2695
2860
  max: 2,
2696
- onChange: (u, v) => {
2697
- c.timeScale = v, n.updateObject(t.uuid, "mixer.timeScale", v);
2861
+ onChange: (d, f) => {
2862
+ o.timeScale = f, n.updateObject(t.uuid, "mixer.timeScale", f);
2698
2863
  }
2699
2864
  }
2700
2865
  ];
2701
- d.push({
2866
+ u.push({
2702
2867
  title: "Stop All",
2703
2868
  type: "button",
2704
2869
  onChange: () => {
2705
- c.stopAllAction(), n.requestMethod(t.uuid, "stopAllAction", void 0, "mixer");
2870
+ o.stopAllAction(), n.requestMethod(t.uuid, "stopAllAction", void 0, "mixer");
2706
2871
  }
2707
2872
  }), a.push({
2708
2873
  title: "Mixer",
2709
- items: d
2874
+ items: u
2710
2875
  });
2711
2876
  }
2712
2877
  }
2713
- return /* @__PURE__ */ l.jsx(We, { title: "Animation", items: a });
2878
+ return /* @__PURE__ */ l.jsx(Ze, { title: "Animation", items: a });
2714
2879
  }
2715
- const Tn = {
2880
+ const Pn = {
2716
2881
  name: "",
2717
2882
  uuid: "",
2718
2883
  type: "",
@@ -2724,180 +2889,180 @@ const Tn = {
2724
2889
  orthographicCameraInfo: void 0,
2725
2890
  lightInfo: void 0
2726
2891
  };
2727
- let re = { ...Tn };
2728
- function qa(t) {
2729
- const [n, a] = oe(-1);
2730
- _e(() => {
2731
- function h(d) {
2732
- re = { ...d.value }, a(Date.now());
2733
- }
2734
- function c() {
2735
- re = { ...Tn }, a(Date.now());
2736
- }
2737
- return P.addEventListener(k.SET_SCENE, c), P.addEventListener(k.SET_OBJECT, h), () => {
2738
- P.removeEventListener(k.SET_SCENE, c), P.removeEventListener(k.SET_OBJECT, h);
2892
+ let oe = { ...Pn };
2893
+ function ti(t) {
2894
+ const [n, a] = ae(-1);
2895
+ ke(() => {
2896
+ function h(u) {
2897
+ oe = { ...u.value }, a(Date.now());
2898
+ }
2899
+ function o() {
2900
+ oe = { ...Pn }, a(Date.now());
2901
+ }
2902
+ return D.addEventListener(I.SET_SCENE, o), D.addEventListener(I.SET_OBJECT, h), () => {
2903
+ D.removeEventListener(I.SET_SCENE, o), D.removeEventListener(I.SET_OBJECT, h);
2739
2904
  };
2740
2905
  }, []);
2741
- const e = re.type.toLowerCase(), i = re.animations.length > 0 || re.mixer !== void 0, o = e.search("mesh") > -1 || e.search("line") > -1 || e.search("points") > -1;
2742
- return /* @__PURE__ */ l.jsx(Lt, { label: "Inspector", children: /* @__PURE__ */ l.jsx("div", { id: "Inspector", className: t.class, children: re.uuid.length > 0 && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
2906
+ const e = oe.type.toLowerCase(), i = oe.animations.length > 0 || oe.mixer !== void 0, c = e.search("mesh") > -1 || e.search("line") > -1 || e.search("points") > -1;
2907
+ return /* @__PURE__ */ l.jsx(Ft, { label: "Inspector", children: /* @__PURE__ */ l.jsx("div", { id: "Inspector", className: t.class, children: oe.uuid.length > 0 && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
2743
2908
  /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
2744
2909
  /* @__PURE__ */ l.jsx(
2745
- ct,
2910
+ dt,
2746
2911
  {
2747
2912
  type: "string",
2748
2913
  title: "Name",
2749
2914
  prop: "name",
2750
- value: re.name,
2915
+ value: oe.name,
2751
2916
  disabled: !0
2752
2917
  }
2753
2918
  ),
2754
2919
  /* @__PURE__ */ l.jsx(
2755
- ct,
2920
+ dt,
2756
2921
  {
2757
2922
  type: "string",
2758
2923
  title: "Type",
2759
2924
  prop: "type",
2760
- value: re.type,
2925
+ value: oe.type,
2761
2926
  disabled: !0
2762
2927
  }
2763
2928
  ),
2764
2929
  /* @__PURE__ */ l.jsx(
2765
- ct,
2930
+ dt,
2766
2931
  {
2767
2932
  type: "string",
2768
2933
  title: "UUID",
2769
2934
  prop: "uuid",
2770
- value: re.uuid,
2935
+ value: oe.uuid,
2771
2936
  disabled: !0
2772
2937
  }
2773
2938
  ),
2774
2939
  /* @__PURE__ */ l.jsx(
2775
- ct,
2940
+ dt,
2776
2941
  {
2777
2942
  type: "boolean",
2778
2943
  title: "Visible",
2779
2944
  prop: "visible",
2780
- value: re.visible,
2781
- onChange: (h, c) => {
2782
- t.three.updateObject(re.uuid, h, c);
2783
- const d = t.three.scene?.getObjectByProperty("uuid", re.uuid);
2784
- d !== void 0 && ee(d, h, c);
2945
+ value: oe.visible,
2946
+ onChange: (h, o) => {
2947
+ t.three.updateObject(oe.uuid, h, o);
2948
+ const u = t.three.scene?.getObjectByProperty("uuid", oe.uuid);
2949
+ u !== void 0 && K(u, h, o);
2785
2950
  }
2786
2951
  }
2787
2952
  )
2788
2953
  ] }),
2789
2954
  /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
2790
- Va(re, t.three),
2791
- i ? Wa(re, t.three) : null,
2792
- e.search("camera") > -1 ? $a(re, t.three) : null,
2793
- e.search("light") > -1 ? Ha(re, t.three) : null,
2794
- o ? Ua(re, t.three) : null
2955
+ Ja(oe, t.three),
2956
+ i ? ei(oe, t.three) : null,
2957
+ e.search("camera") > -1 ? qa(oe, t.three) : null,
2958
+ e.search("light") > -1 ? Qa(oe, t.three) : null,
2959
+ c ? Ha(oe, t.three) : null
2795
2960
  ] })
2796
2961
  ] }) }, n) }, "Inspector");
2797
2962
  }
2798
- function vi(t) {
2799
- const [n, a] = oe(t.scene);
2800
- _e(() => {
2801
- const o = (h) => {
2963
+ function Ci(t) {
2964
+ const [n, a] = ae(t.scene);
2965
+ ke(() => {
2966
+ const c = (h) => {
2802
2967
  a(h.value);
2803
2968
  };
2804
- return P.addEventListener(k.SET_SCENE, o), () => {
2805
- P.removeEventListener(k.SET_SCENE, o);
2969
+ return D.addEventListener(I.SET_SCENE, c), () => {
2970
+ D.removeEventListener(I.SET_SCENE, c);
2806
2971
  };
2807
2972
  }, []);
2808
2973
  const e = n !== null, i = "Hierarchy - " + (e ? `${n?.name}` : "No Scene");
2809
2974
  return /* @__PURE__ */ l.jsxs("div", { id: "SidePanel", children: [
2810
- /* @__PURE__ */ l.jsx(Lt, { label: i, open: !0, children: /* @__PURE__ */ l.jsx(l.Fragment, { children: e && /* @__PURE__ */ l.jsx(_a, { child: n, three: t.three }) }) }),
2811
- /* @__PURE__ */ l.jsx(qa, { three: t.three })
2975
+ /* @__PURE__ */ l.jsx(Ft, { label: i, open: !0, children: /* @__PURE__ */ l.jsx(l.Fragment, { children: e && /* @__PURE__ */ l.jsx(ka, { child: n, three: t.three }) }) }),
2976
+ /* @__PURE__ */ l.jsx(ti, { three: t.three })
2812
2977
  ] }, "SidePanel");
2813
2978
  }
2814
- function gi(t) {
2979
+ function Si(t) {
2815
2980
  function n() {
2816
2981
  return t.three.scene === void 0 ? (console.log("No scene:", t.three), !1) : !0;
2817
2982
  }
2818
- const a = (c) => {
2983
+ const a = (o) => {
2819
2984
  if (!n())
2820
2985
  return;
2821
- const d = t.three.scene?.getObjectByProperty("uuid", c.value);
2822
- d !== void 0 && t.three.setObject(d);
2823
- }, e = (c, d, u) => {
2986
+ const u = t.three.scene?.getObjectByProperty("uuid", o.value);
2987
+ u !== void 0 && t.three.setObject(u);
2988
+ }, e = (o, u, d) => {
2824
2989
  if (!n())
2825
2990
  return;
2826
- const v = t.three.scene?.getObjectByProperty("uuid", c);
2827
- v !== void 0 && ee(v, d, u);
2828
- }, i = (c) => {
2991
+ const f = t.three.scene?.getObjectByProperty("uuid", o);
2992
+ f !== void 0 && K(f, u, d);
2993
+ }, i = (o) => {
2829
2994
  if (!n())
2830
2995
  return;
2831
- const d = c.value, { key: u, value: v, uuid: b } = d;
2832
- e(b, u, v);
2833
- }, o = (c) => {
2996
+ const u = o.value, { key: d, value: f, uuid: b } = u;
2997
+ e(b, d, f);
2998
+ }, c = (o) => {
2834
2999
  if (!n())
2835
3000
  return;
2836
- const d = c.value;
2837
- Dt(d.value).then((u) => {
2838
- e(d.uuid, d.key, u), e(d.uuid, "material.needsUpdate", !0);
3001
+ const u = o.value;
3002
+ It(u.value).then((d) => {
3003
+ e(u.uuid, u.key, d), e(u.uuid, "material.needsUpdate", !0);
2839
3004
  });
2840
- }, h = (c) => {
3005
+ }, h = (o) => {
2841
3006
  if (!n())
2842
3007
  return;
2843
- const { key: d, uuid: u, value: v, subitem: b } = c.value, E = t.three.scene?.getObjectByProperty("uuid", u);
3008
+ const { key: u, uuid: d, value: f, subitem: b } = o.value, E = t.three.scene?.getObjectByProperty("uuid", d);
2844
3009
  if (E !== void 0)
2845
3010
  try {
2846
- b !== void 0 ? Ea(E, b)[d](v) : E[d](v);
2847
- } catch (S) {
2848
- console.log("Error requesting method:"), console.log(S), console.log(d), console.log(v);
3011
+ b !== void 0 ? Sa(E, b)[u](f) : E[u](f);
3012
+ } catch (x) {
3013
+ console.log("Error requesting method:"), console.log(x), console.log(u), console.log(f);
2849
3014
  }
2850
3015
  };
2851
- return _e(() => (P.addEventListener(k.GET_OBJECT, a), P.addEventListener(k.UPDATE_OBJECT, i), P.addEventListener(k.CREATE_TEXTURE, o), P.addEventListener(k.REQUEST_METHOD, h), () => {
2852
- P.removeEventListener(k.GET_OBJECT, a), P.removeEventListener(k.UPDATE_OBJECT, i), P.removeEventListener(k.CREATE_TEXTURE, o), P.removeEventListener(k.REQUEST_METHOD, h);
3016
+ return ke(() => (D.addEventListener(I.GET_OBJECT, a), D.addEventListener(I.UPDATE_OBJECT, i), D.addEventListener(I.CREATE_TEXTURE, c), D.addEventListener(I.REQUEST_METHOD, h), () => {
3017
+ D.removeEventListener(I.GET_OBJECT, a), D.removeEventListener(I.UPDATE_OBJECT, i), D.removeEventListener(I.CREATE_TEXTURE, c), D.removeEventListener(I.REQUEST_METHOD, h);
2853
3018
  }), []), null;
2854
3019
  }
2855
- const Xt = { type: "change" }, kt = { type: "start" }, Zt = { type: "end" }, gt = new Kn(), Jt = new Xn(), Ka = Math.cos(70 * Zn.DEG2RAD);
2856
- class Xa extends en {
3020
+ const Qt = { type: "change" }, jt = { type: "start" }, en = { type: "end" }, bt = new Jn(), tn = new Qn(), ni = Math.cos(70 * ea.DEG2RAD);
3021
+ class ai extends an {
2857
3022
  constructor(n, a) {
2858
- super(), this.object = n, this.domElement = a, this.domElement.style.touchAction = "none", this.enabled = !0, this.target = new W(), this.cursor = new W(), 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: Xe.ROTATE, MIDDLE: Xe.DOLLY, RIGHT: Xe.PAN }, this.touches = { ONE: Ze.ROTATE, TWO: Ze.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this.getPolarAngle = function() {
2859
- return c.phi;
3023
+ super(), this.object = n, this.domElement = a, this.domElement.style.touchAction = "none", this.enabled = !0, this.target = new q(), this.cursor = new q(), 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: et.ROTATE, MIDDLE: et.DOLLY, RIGHT: et.PAN }, this.touches = { ONE: tt.ROTATE, TWO: tt.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this.getPolarAngle = function() {
3024
+ return o.phi;
2860
3025
  }, this.getAzimuthalAngle = function() {
2861
- return c.theta;
3026
+ return o.theta;
2862
3027
  }, this.getDistance = function() {
2863
3028
  return this.object.position.distanceTo(this.target);
2864
3029
  }, this.listenToKeyEvents = function(s) {
2865
- s.addEventListener("keydown", nt), this._domElementKeyEvents = s;
3030
+ s.addEventListener("keydown", rt), this._domElementKeyEvents = s;
2866
3031
  }, this.stopListenToKeyEvents = function() {
2867
- this._domElementKeyEvents.removeEventListener("keydown", nt), this._domElementKeyEvents = null;
3032
+ this._domElementKeyEvents.removeEventListener("keydown", rt), this._domElementKeyEvents = null;
2868
3033
  }, this.saveState = function() {
2869
3034
  e.target0.copy(e.target), e.position0.copy(e.object.position), e.zoom0 = e.object.zoom;
2870
3035
  }, this.reset = function() {
2871
- e.target.copy(e.target0), e.object.position.copy(e.position0), e.object.zoom = e.zoom0, e.object.updateProjectionMatrix(), e.dispatchEvent(Xt), e.update(), o = i.NONE;
3036
+ e.target.copy(e.target0), e.object.position.copy(e.position0), e.object.zoom = e.zoom0, e.object.updateProjectionMatrix(), e.dispatchEvent(Qt), e.update(), c = i.NONE;
2872
3037
  }, this.update = function() {
2873
- const s = new W(), y = new $t().setFromUnitVectors(n.up, new W(0, 1, 0)), O = y.clone().invert(), N = new W(), H = new $t(), be = new W(), le = 2 * Math.PI;
2874
- return function(Tt = null) {
2875
- const it = e.object.position;
2876
- s.copy(it).sub(e.target), s.applyQuaternion(y), c.setFromVector3(s), e.autoRotate && o === i.NONE && me(Fe(Tt)), e.enableDamping ? (c.theta += d.theta * e.dampingFactor, c.phi += d.phi * e.dampingFactor) : (c.theta += d.theta, c.phi += d.phi);
2877
- let xe = e.minAzimuthAngle, ye = e.maxAzimuthAngle;
2878
- isFinite(xe) && isFinite(ye) && (xe < -Math.PI ? xe += le : xe > Math.PI && (xe -= le), ye < -Math.PI ? ye += le : ye > Math.PI && (ye -= le), xe <= ye ? c.theta = Math.max(xe, Math.min(ye, c.theta)) : c.theta = c.theta > (xe + ye) / 2 ? Math.max(xe, c.theta) : Math.min(ye, c.theta)), c.phi = Math.max(e.minPolarAngle, Math.min(e.maxPolarAngle, c.phi)), c.makeSafe(), e.enableDamping === !0 ? e.target.addScaledVector(v, e.dampingFactor) : e.target.add(v), e.target.sub(e.cursor), e.target.clampLength(e.minTargetRadius, e.maxTargetRadius), e.target.add(e.cursor), e.zoomToCursor && Y || e.object.isOrthographicCamera ? c.radius = ke(c.radius) : c.radius = ke(c.radius * u), s.setFromSpherical(c), s.applyQuaternion(O), it.copy(e.target).add(s), 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));
2879
- let $e = !1;
2880
- if (e.zoomToCursor && Y) {
2881
- let ze = null;
3038
+ const s = new q(), y = new zt().setFromUnitVectors(n.up, new q(0, 1, 0)), T = y.clone().invert(), F = new q(), W = new zt(), be = new q(), ue = 2 * Math.PI;
3039
+ return function(Rt = null) {
3040
+ const ot = e.object.position;
3041
+ s.copy(ot).sub(e.target), s.applyQuaternion(y), o.setFromVector3(s), e.autoRotate && c === i.NONE && $(ze(Rt)), e.enableDamping ? (o.theta += u.theta * e.dampingFactor, o.phi += u.phi * e.dampingFactor) : (o.theta += u.theta, o.phi += u.phi);
3042
+ let Oe = e.minAzimuthAngle, ye = e.maxAzimuthAngle;
3043
+ isFinite(Oe) && isFinite(ye) && (Oe < -Math.PI ? Oe += ue : Oe > Math.PI && (Oe -= ue), ye < -Math.PI ? ye += ue : ye > Math.PI && (ye -= ue), Oe <= ye ? o.theta = Math.max(Oe, Math.min(ye, o.theta)) : o.theta = o.theta > (Oe + ye) / 2 ? Math.max(Oe, o.theta) : Math.min(ye, o.theta)), o.phi = Math.max(e.minPolarAngle, Math.min(e.maxPolarAngle, o.phi)), o.makeSafe(), e.enableDamping === !0 ? e.target.addScaledVector(f, e.dampingFactor) : e.target.add(f), e.target.sub(e.cursor), e.target.clampLength(e.minTargetRadius, e.maxTargetRadius), e.target.add(e.cursor), e.zoomToCursor && Ce || e.object.isOrthographicCamera ? o.radius = Pe(o.radius) : o.radius = Pe(o.radius * d), s.setFromSpherical(o), s.applyQuaternion(T), ot.copy(e.target).add(s), e.object.lookAt(e.target), e.enableDamping === !0 ? (u.theta *= 1 - e.dampingFactor, u.phi *= 1 - e.dampingFactor, f.multiplyScalar(1 - e.dampingFactor)) : (u.set(0, 0, 0), f.set(0, 0, 0));
3044
+ let Ge = !1;
3045
+ if (e.zoomToCursor && Ce) {
3046
+ let He = null;
2882
3047
  if (e.object.isPerspectiveCamera) {
2883
- const Ye = s.length();
2884
- ze = ke(Ye * u);
2885
- const Ge = Ye - ze;
2886
- e.object.position.addScaledVector(we, Ge), e.object.updateMatrixWorld();
3048
+ const We = s.length();
3049
+ He = Pe(We * d);
3050
+ const qe = We - He;
3051
+ e.object.position.addScaledVector(re, qe), e.object.updateMatrixWorld();
2887
3052
  } else if (e.object.isOrthographicCamera) {
2888
- const Ye = new W(ce.x, ce.y, 0);
2889
- Ye.unproject(e.object), e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom / u)), e.object.updateProjectionMatrix(), $e = !0;
2890
- const Ge = new W(ce.x, ce.y, 0);
2891
- Ge.unproject(e.object), e.object.position.sub(Ge).add(Ye), e.object.updateMatrixWorld(), ze = s.length();
3053
+ const We = new q(Q.x, Q.y, 0);
3054
+ We.unproject(e.object), e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom / d)), e.object.updateProjectionMatrix(), Ge = !0;
3055
+ const qe = new q(Q.x, Q.y, 0);
3056
+ qe.unproject(e.object), e.object.position.sub(qe).add(We), e.object.updateMatrixWorld(), He = s.length();
2892
3057
  } else
2893
3058
  console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), e.zoomToCursor = !1;
2894
- ze !== null && (this.screenSpacePanning ? e.target.set(0, 0, -1).transformDirection(e.object.matrix).multiplyScalar(ze).add(e.object.position) : (gt.origin.copy(e.object.position), gt.direction.set(0, 0, -1).transformDirection(e.object.matrix), Math.abs(e.object.up.dot(gt.direction)) < Ka ? n.lookAt(e.target) : (Jt.setFromNormalAndCoplanarPoint(e.object.up, e.target), gt.intersectPlane(Jt, e.target))));
3059
+ He !== null && (this.screenSpacePanning ? e.target.set(0, 0, -1).transformDirection(e.object.matrix).multiplyScalar(He).add(e.object.position) : (bt.origin.copy(e.object.position), bt.direction.set(0, 0, -1).transformDirection(e.object.matrix), Math.abs(e.object.up.dot(bt.direction)) < ni ? n.lookAt(e.target) : (tn.setFromNormalAndCoplanarPoint(e.object.up, e.target), bt.intersectPlane(tn, e.target))));
2895
3060
  } else
2896
- e.object.isOrthographicCamera && ($e = u !== 1, $e && (e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom / u)), e.object.updateProjectionMatrix()));
2897
- return u = 1, Y = !1, $e || N.distanceToSquared(e.object.position) > h || 8 * (1 - H.dot(e.object.quaternion)) > h || be.distanceToSquared(e.target) > 0 ? (e.dispatchEvent(Xt), N.copy(e.object.position), H.copy(e.object.quaternion), be.copy(e.target), !0) : !1;
3061
+ e.object.isOrthographicCamera && (Ge = d !== 1, Ge && (e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom / d)), e.object.updateProjectionMatrix()));
3062
+ return d = 1, Ce = !1, Ge || F.distanceToSquared(e.object.position) > h || 8 * (1 - W.dot(e.object.quaternion)) > h || be.distanceToSquared(e.target) > 0 ? (e.dispatchEvent(Qt), F.copy(e.object.position), W.copy(e.object.quaternion), be.copy(e.target), !0) : !1;
2898
3063
  };
2899
3064
  }(), this.dispose = function() {
2900
- e.domElement.removeEventListener("contextmenu", qe), e.domElement.removeEventListener("pointerdown", Be), e.domElement.removeEventListener("pointercancel", Ue), e.domElement.removeEventListener("wheel", ht), e.domElement.removeEventListener("pointermove", et), e.domElement.removeEventListener("pointerup", Ue), e._domElementKeyEvents !== null && (e._domElementKeyEvents.removeEventListener("keydown", nt), e._domElementKeyEvents = null);
3065
+ e.domElement.removeEventListener("contextmenu", Je), e.domElement.removeEventListener("pointerdown", L), e.domElement.removeEventListener("pointercancel", we), e.domElement.removeEventListener("wheel", ft), e.domElement.removeEventListener("pointermove", ie), e.domElement.removeEventListener("pointerup", we), e._domElementKeyEvents !== null && (e._domElementKeyEvents.removeEventListener("keydown", rt), e._domElementKeyEvents = null);
2901
3066
  };
2902
3067
  const e = this, i = {
2903
3068
  NONE: -1,
@@ -2909,182 +3074,182 @@ class Xa extends en {
2909
3074
  TOUCH_DOLLY_PAN: 5,
2910
3075
  TOUCH_DOLLY_ROTATE: 6
2911
3076
  };
2912
- let o = i.NONE;
2913
- const h = 1e-6, c = new zt(), d = new zt();
2914
- let u = 1;
2915
- const v = new W(), b = new fe(), E = new fe(), S = new fe(), D = new fe(), I = new fe(), q = new fe(), B = new fe(), M = new fe(), z = new fe(), we = new W(), ce = new fe();
2916
- let Y = !1;
2917
- const Q = [], x = {};
2918
- let Ae = !1;
2919
- function Fe(s) {
3077
+ let c = i.NONE;
3078
+ const h = 1e-6, o = new Yt(), u = new Yt();
3079
+ let d = 1;
3080
+ const f = new q(), b = new me(), E = new me(), x = new me(), M = new me(), P = new me(), V = new me(), U = new me(), j = new me(), O = new me(), re = new q(), Q = new me();
3081
+ let Ce = !1;
3082
+ const G = [], ee = {};
3083
+ let ve = !1;
3084
+ function ze(s) {
2920
3085
  return s !== null ? 2 * Math.PI / 60 * e.autoRotateSpeed * s : 2 * Math.PI / 60 / 60 * e.autoRotateSpeed;
2921
3086
  }
2922
- function Oe(s) {
3087
+ function Me(s) {
2923
3088
  const y = Math.abs(s * 0.01);
2924
3089
  return Math.pow(0.95, e.zoomSpeed * y);
2925
3090
  }
2926
- function me(s) {
2927
- d.theta -= s;
3091
+ function $(s) {
3092
+ u.theta -= s;
2928
3093
  }
2929
- function te(s) {
2930
- d.phi -= s;
3094
+ function le(s) {
3095
+ u.phi -= s;
2931
3096
  }
2932
- const ue = function() {
2933
- const s = new W();
2934
- return function(O, N) {
2935
- s.setFromMatrixColumn(N, 0), s.multiplyScalar(-O), v.add(s);
3097
+ const S = function() {
3098
+ const s = new q();
3099
+ return function(T, F) {
3100
+ s.setFromMatrixColumn(F, 0), s.multiplyScalar(-T), f.add(s);
2936
3101
  };
2937
- }(), ve = function() {
2938
- const s = new W();
2939
- return function(O, N) {
2940
- e.screenSpacePanning === !0 ? s.setFromMatrixColumn(N, 1) : (s.setFromMatrixColumn(N, 0), s.crossVectors(e.object.up, s)), s.multiplyScalar(O), v.add(s);
3102
+ }(), Te = function() {
3103
+ const s = new q();
3104
+ return function(T, F) {
3105
+ e.screenSpacePanning === !0 ? s.setFromMatrixColumn(F, 1) : (s.setFromMatrixColumn(F, 0), s.crossVectors(e.object.up, s)), s.multiplyScalar(T), f.add(s);
2941
3106
  };
2942
3107
  }(), ge = function() {
2943
- const s = new W();
2944
- return function(O, N) {
2945
- const H = e.domElement;
3108
+ const s = new q();
3109
+ return function(T, F) {
3110
+ const W = e.domElement;
2946
3111
  if (e.object.isPerspectiveCamera) {
2947
3112
  const be = e.object.position;
2948
3113
  s.copy(be).sub(e.target);
2949
- let le = s.length();
2950
- le *= Math.tan(e.object.fov / 2 * Math.PI / 180), ue(2 * O * le / H.clientHeight, e.object.matrix), ve(2 * N * le / H.clientHeight, e.object.matrix);
3114
+ let ue = s.length();
3115
+ ue *= Math.tan(e.object.fov / 2 * Math.PI / 180), S(2 * T * ue / W.clientHeight, e.object.matrix), Te(2 * F * ue / W.clientHeight, e.object.matrix);
2951
3116
  } else
2952
- e.object.isOrthographicCamera ? (ue(O * (e.object.right - e.object.left) / e.object.zoom / H.clientWidth, e.object.matrix), ve(N * (e.object.top - e.object.bottom) / e.object.zoom / H.clientHeight, e.object.matrix)) : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."), e.enablePan = !1);
3117
+ e.object.isOrthographicCamera ? (S(T * (e.object.right - e.object.left) / e.object.zoom / W.clientWidth, e.object.matrix), Te(F * (e.object.top - e.object.bottom) / e.object.zoom / W.clientHeight, e.object.matrix)) : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."), e.enablePan = !1);
2953
3118
  };
2954
3119
  }();
2955
- function K(s) {
2956
- e.object.isPerspectiveCamera || e.object.isOrthographicCamera ? u /= s : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), e.enableZoom = !1);
3120
+ function _e(s) {
3121
+ e.object.isPerspectiveCamera || e.object.isOrthographicCamera ? d /= s : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), e.enableZoom = !1);
2957
3122
  }
2958
- function pe(s) {
2959
- e.object.isPerspectiveCamera || e.object.isOrthographicCamera ? u *= s : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), e.enableZoom = !1);
3123
+ function je(s) {
3124
+ e.object.isPerspectiveCamera || e.object.isOrthographicCamera ? d *= s : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), e.enableZoom = !1);
2960
3125
  }
2961
- function Pe(s, y) {
3126
+ function Re(s, y) {
2962
3127
  if (!e.zoomToCursor)
2963
3128
  return;
2964
- Y = !0;
2965
- const O = e.domElement.getBoundingClientRect(), N = s - O.left, H = y - O.top, be = O.width, le = O.height;
2966
- ce.x = N / be * 2 - 1, ce.y = -(H / le) * 2 + 1, we.set(ce.x, ce.y, 1).unproject(e.object).sub(e.object.position).normalize();
3129
+ Ce = !0;
3130
+ const T = e.domElement.getBoundingClientRect(), F = s - T.left, W = y - T.top, be = T.width, ue = T.height;
3131
+ Q.x = F / be * 2 - 1, Q.y = -(W / ue) * 2 + 1, re.set(Q.x, Q.y, 1).unproject(e.object).sub(e.object.position).normalize();
2967
3132
  }
2968
- function ke(s) {
3133
+ function Pe(s) {
2969
3134
  return Math.max(e.minDistance, Math.min(e.maxDistance, s));
2970
3135
  }
2971
- function he(s) {
3136
+ function De(s) {
2972
3137
  b.set(s.clientX, s.clientY);
2973
3138
  }
2974
- function p(s) {
2975
- Pe(s.clientX, s.clientX), B.set(s.clientX, s.clientY);
3139
+ function Ye(s) {
3140
+ Re(s.clientX, s.clientX), U.set(s.clientX, s.clientY);
2976
3141
  }
2977
- function m(s) {
2978
- D.set(s.clientX, s.clientY);
3142
+ function te(s) {
3143
+ M.set(s.clientX, s.clientY);
2979
3144
  }
2980
- function w(s) {
2981
- E.set(s.clientX, s.clientY), S.subVectors(E, b).multiplyScalar(e.rotateSpeed);
3145
+ function Se(s) {
3146
+ E.set(s.clientX, s.clientY), x.subVectors(E, b).multiplyScalar(e.rotateSpeed);
2982
3147
  const y = e.domElement;
2983
- me(2 * Math.PI * S.x / y.clientHeight), te(2 * Math.PI * S.y / y.clientHeight), b.copy(E), e.update();
3148
+ $(2 * Math.PI * x.x / y.clientHeight), le(2 * Math.PI * x.y / y.clientHeight), b.copy(E), e.update();
2984
3149
  }
2985
- function R(s) {
2986
- M.set(s.clientX, s.clientY), z.subVectors(M, B), z.y > 0 ? K(Oe(z.y)) : z.y < 0 && pe(Oe(z.y)), B.copy(M), e.update();
3150
+ function it(s) {
3151
+ j.set(s.clientX, s.clientY), O.subVectors(j, U), O.y > 0 ? _e(Me(O.y)) : O.y < 0 && je(Me(O.y)), U.copy(j), e.update();
2987
3152
  }
2988
- function G(s) {
2989
- I.set(s.clientX, s.clientY), q.subVectors(I, D).multiplyScalar(e.panSpeed), ge(q.x, q.y), D.copy(I), e.update();
3153
+ function Ve(s) {
3154
+ P.set(s.clientX, s.clientY), V.subVectors(P, M).multiplyScalar(e.panSpeed), ge(V.x, V.y), M.copy(P), e.update();
2990
3155
  }
2991
- function V(s) {
2992
- Pe(s.clientX, s.clientY), s.deltaY < 0 ? pe(Oe(s.deltaY)) : s.deltaY > 0 && K(Oe(s.deltaY)), e.update();
3156
+ function pe(s) {
3157
+ Re(s.clientX, s.clientY), s.deltaY < 0 ? je(Me(s.deltaY)) : s.deltaY > 0 && _e(Me(s.deltaY)), e.update();
2993
3158
  }
2994
- function ae(s) {
3159
+ function p(s) {
2995
3160
  let y = !1;
2996
3161
  switch (s.code) {
2997
3162
  case e.keys.UP:
2998
- s.ctrlKey || s.metaKey || s.shiftKey ? te(2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : ge(0, e.keyPanSpeed), y = !0;
3163
+ s.ctrlKey || s.metaKey || s.shiftKey ? le(2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : ge(0, e.keyPanSpeed), y = !0;
2999
3164
  break;
3000
3165
  case e.keys.BOTTOM:
3001
- s.ctrlKey || s.metaKey || s.shiftKey ? te(-2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : ge(0, -e.keyPanSpeed), y = !0;
3166
+ s.ctrlKey || s.metaKey || s.shiftKey ? le(-2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : ge(0, -e.keyPanSpeed), y = !0;
3002
3167
  break;
3003
3168
  case e.keys.LEFT:
3004
- s.ctrlKey || s.metaKey || s.shiftKey ? me(2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : ge(e.keyPanSpeed, 0), y = !0;
3169
+ s.ctrlKey || s.metaKey || s.shiftKey ? $(2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : ge(e.keyPanSpeed, 0), y = !0;
3005
3170
  break;
3006
3171
  case e.keys.RIGHT:
3007
- s.ctrlKey || s.metaKey || s.shiftKey ? me(-2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : ge(-e.keyPanSpeed, 0), y = !0;
3172
+ s.ctrlKey || s.metaKey || s.shiftKey ? $(-2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : ge(-e.keyPanSpeed, 0), y = !0;
3008
3173
  break;
3009
3174
  }
3010
3175
  y && (s.preventDefault(), e.update());
3011
3176
  }
3012
- function U(s) {
3013
- if (Q.length === 1)
3177
+ function v(s) {
3178
+ if (G.length === 1)
3014
3179
  b.set(s.pageX, s.pageY);
3015
3180
  else {
3016
- const y = De(s), O = 0.5 * (s.pageX + y.x), N = 0.5 * (s.pageY + y.y);
3017
- b.set(O, N);
3181
+ const y = Fe(s), T = 0.5 * (s.pageX + y.x), F = 0.5 * (s.pageY + y.y);
3182
+ b.set(T, F);
3018
3183
  }
3019
3184
  }
3020
- function X(s) {
3021
- if (Q.length === 1)
3022
- D.set(s.pageX, s.pageY);
3185
+ function C(s) {
3186
+ if (G.length === 1)
3187
+ M.set(s.pageX, s.pageY);
3023
3188
  else {
3024
- const y = De(s), O = 0.5 * (s.pageX + y.x), N = 0.5 * (s.pageY + y.y);
3025
- D.set(O, N);
3189
+ const y = Fe(s), T = 0.5 * (s.pageX + y.x), F = 0.5 * (s.pageY + y.y);
3190
+ M.set(T, F);
3026
3191
  }
3027
3192
  }
3028
- function ie(s) {
3029
- const y = De(s), O = s.pageX - y.x, N = s.pageY - y.y, H = Math.sqrt(O * O + N * N);
3030
- B.set(0, H);
3031
- }
3032
3193
  function _(s) {
3033
- e.enableZoom && ie(s), e.enablePan && X(s);
3194
+ const y = Fe(s), T = s.pageX - y.x, F = s.pageY - y.y, W = Math.sqrt(T * T + F * F);
3195
+ U.set(0, W);
3196
+ }
3197
+ function H(s) {
3198
+ e.enableZoom && _(s), e.enablePan && C(s);
3034
3199
  }
3035
- function F(s) {
3036
- e.enableZoom && ie(s), e.enableRotate && U(s);
3200
+ function X(s) {
3201
+ e.enableZoom && _(s), e.enableRotate && v(s);
3037
3202
  }
3038
- function ne(s) {
3039
- if (Q.length == 1)
3203
+ function de(s) {
3204
+ if (G.length == 1)
3040
3205
  E.set(s.pageX, s.pageY);
3041
3206
  else {
3042
- const O = De(s), N = 0.5 * (s.pageX + O.x), H = 0.5 * (s.pageY + O.y);
3043
- E.set(N, H);
3207
+ const T = Fe(s), F = 0.5 * (s.pageX + T.x), W = 0.5 * (s.pageY + T.y);
3208
+ E.set(F, W);
3044
3209
  }
3045
- S.subVectors(E, b).multiplyScalar(e.rotateSpeed);
3210
+ x.subVectors(E, b).multiplyScalar(e.rotateSpeed);
3046
3211
  const y = e.domElement;
3047
- me(2 * Math.PI * S.x / y.clientHeight), te(2 * Math.PI * S.y / y.clientHeight), b.copy(E);
3212
+ $(2 * Math.PI * x.x / y.clientHeight), le(2 * Math.PI * x.y / y.clientHeight), b.copy(E);
3048
3213
  }
3049
- function Ce(s) {
3050
- if (Q.length === 1)
3051
- I.set(s.pageX, s.pageY);
3214
+ function z(s) {
3215
+ if (G.length === 1)
3216
+ P.set(s.pageX, s.pageY);
3052
3217
  else {
3053
- const y = De(s), O = 0.5 * (s.pageX + y.x), N = 0.5 * (s.pageY + y.y);
3054
- I.set(O, N);
3218
+ const y = Fe(s), T = 0.5 * (s.pageX + y.x), F = 0.5 * (s.pageY + y.y);
3219
+ P.set(T, F);
3055
3220
  }
3056
- q.subVectors(I, D).multiplyScalar(e.panSpeed), ge(q.x, q.y), D.copy(I);
3221
+ V.subVectors(P, M).multiplyScalar(e.panSpeed), ge(V.x, V.y), M.copy(P);
3057
3222
  }
3058
- function Me(s) {
3059
- const y = De(s), O = s.pageX - y.x, N = s.pageY - y.y, H = Math.sqrt(O * O + N * N);
3060
- M.set(0, H), z.set(0, Math.pow(M.y / B.y, e.zoomSpeed)), K(z.y), B.copy(M);
3061
- const be = (s.pageX + y.x) * 0.5, le = (s.pageY + y.y) * 0.5;
3062
- Pe(be, le);
3223
+ function Z(s) {
3224
+ const y = Fe(s), T = s.pageX - y.x, F = s.pageY - y.y, W = Math.sqrt(T * T + F * F);
3225
+ j.set(0, W), O.set(0, Math.pow(j.y / U.y, e.zoomSpeed)), _e(O.y), U.copy(j);
3226
+ const be = (s.pageX + y.x) * 0.5, ue = (s.pageY + y.y) * 0.5;
3227
+ Re(be, ue);
3063
3228
  }
3064
- function dt(s) {
3065
- e.enableZoom && Me(s), e.enablePan && Ce(s);
3229
+ function se(s) {
3230
+ e.enableZoom && Z(s), e.enablePan && z(s);
3066
3231
  }
3067
- function ut(s) {
3068
- e.enableZoom && Me(s), e.enableRotate && ne(s);
3232
+ function A(s) {
3233
+ e.enableZoom && Z(s), e.enableRotate && de(s);
3069
3234
  }
3070
- function Be(s) {
3071
- e.enabled !== !1 && (Q.length === 0 && (e.domElement.setPointerCapture(s.pointerId), e.domElement.addEventListener("pointermove", et), e.domElement.addEventListener("pointerup", Ue)), wt(s), s.pointerType === "touch" ? at(s) : tt(s));
3235
+ function L(s) {
3236
+ e.enabled !== !1 && (G.length === 0 && (e.domElement.setPointerCapture(s.pointerId), e.domElement.addEventListener("pointermove", ie), e.domElement.addEventListener("pointerup", we)), Mt(s), s.pointerType === "touch" ? st(s) : Ne(s));
3072
3237
  }
3073
- function et(s) {
3074
- e.enabled !== !1 && (s.pointerType === "touch" ? mt(s) : xt(s));
3238
+ function ie(s) {
3239
+ e.enabled !== !1 && (s.pointerType === "touch" ? vt(s) : Ot(s));
3075
3240
  }
3076
- function Ue(s) {
3077
- switch (Ot(s), Q.length) {
3241
+ function we(s) {
3242
+ switch (Tt(s), G.length) {
3078
3243
  case 0:
3079
- e.domElement.releasePointerCapture(s.pointerId), e.domElement.removeEventListener("pointermove", et), e.domElement.removeEventListener("pointerup", Ue), e.dispatchEvent(Zt), o = i.NONE;
3244
+ e.domElement.releasePointerCapture(s.pointerId), e.domElement.removeEventListener("pointermove", ie), e.domElement.removeEventListener("pointerup", we), e.dispatchEvent(en), c = i.NONE;
3080
3245
  break;
3081
3246
  case 1:
3082
- const y = Q[0], O = x[y];
3083
- at({ pointerId: y, pageX: O.x, pageY: O.y });
3247
+ const y = G[0], T = ee[y];
3248
+ st({ pointerId: y, pageX: T.x, pageY: T.y });
3084
3249
  break;
3085
3250
  }
3086
3251
  }
3087
- function tt(s) {
3252
+ function Ne(s) {
3088
3253
  let y;
3089
3254
  switch (s.button) {
3090
3255
  case 0:
@@ -3100,195 +3265,195 @@ class Xa extends en {
3100
3265
  y = -1;
3101
3266
  }
3102
3267
  switch (y) {
3103
- case Xe.DOLLY:
3268
+ case et.DOLLY:
3104
3269
  if (e.enableZoom === !1)
3105
3270
  return;
3106
- p(s), o = i.DOLLY;
3271
+ Ye(s), c = i.DOLLY;
3107
3272
  break;
3108
- case Xe.ROTATE:
3273
+ case et.ROTATE:
3109
3274
  if (s.ctrlKey || s.metaKey || s.shiftKey) {
3110
3275
  if (e.enablePan === !1)
3111
3276
  return;
3112
- m(s), o = i.PAN;
3277
+ te(s), c = i.PAN;
3113
3278
  } else {
3114
3279
  if (e.enableRotate === !1)
3115
3280
  return;
3116
- he(s), o = i.ROTATE;
3281
+ De(s), c = i.ROTATE;
3117
3282
  }
3118
3283
  break;
3119
- case Xe.PAN:
3284
+ case et.PAN:
3120
3285
  if (s.ctrlKey || s.metaKey || s.shiftKey) {
3121
3286
  if (e.enableRotate === !1)
3122
3287
  return;
3123
- he(s), o = i.ROTATE;
3288
+ De(s), c = i.ROTATE;
3124
3289
  } else {
3125
3290
  if (e.enablePan === !1)
3126
3291
  return;
3127
- m(s), o = i.PAN;
3292
+ te(s), c = i.PAN;
3128
3293
  }
3129
3294
  break;
3130
3295
  default:
3131
- o = i.NONE;
3296
+ c = i.NONE;
3132
3297
  }
3133
- o !== i.NONE && e.dispatchEvent(kt);
3298
+ c !== i.NONE && e.dispatchEvent(jt);
3134
3299
  }
3135
- function xt(s) {
3136
- switch (o) {
3300
+ function Ot(s) {
3301
+ switch (c) {
3137
3302
  case i.ROTATE:
3138
3303
  if (e.enableRotate === !1)
3139
3304
  return;
3140
- w(s);
3305
+ Se(s);
3141
3306
  break;
3142
3307
  case i.DOLLY:
3143
3308
  if (e.enableZoom === !1)
3144
3309
  return;
3145
- R(s);
3310
+ it(s);
3146
3311
  break;
3147
3312
  case i.PAN:
3148
3313
  if (e.enablePan === !1)
3149
3314
  return;
3150
- G(s);
3315
+ Ve(s);
3151
3316
  break;
3152
3317
  }
3153
3318
  }
3154
- function ht(s) {
3155
- e.enabled === !1 || e.enableZoom === !1 || o !== i.NONE || (s.preventDefault(), e.dispatchEvent(kt), V(ft(s)), e.dispatchEvent(Zt));
3156
- }
3157
3319
  function ft(s) {
3158
- const y = s.deltaMode, O = {
3320
+ e.enabled === !1 || e.enableZoom === !1 || c !== i.NONE || (s.preventDefault(), e.dispatchEvent(jt), pe(pt(s)), e.dispatchEvent(en));
3321
+ }
3322
+ function pt(s) {
3323
+ const y = s.deltaMode, T = {
3159
3324
  clientX: s.clientX,
3160
3325
  clientY: s.clientY,
3161
3326
  deltaY: s.deltaY
3162
3327
  };
3163
3328
  switch (y) {
3164
3329
  case 1:
3165
- O.deltaY *= 16;
3330
+ T.deltaY *= 16;
3166
3331
  break;
3167
3332
  case 2:
3168
- O.deltaY *= 100;
3333
+ T.deltaY *= 100;
3169
3334
  break;
3170
3335
  }
3171
- return s.ctrlKey && !Ae && (O.deltaY *= 10), O;
3336
+ return s.ctrlKey && !ve && (T.deltaY *= 10), T;
3172
3337
  }
3173
- function pt(s) {
3174
- s.key === "Control" && (Ae = !0, e.domElement.getRootNode().addEventListener("keyup", je, { passive: !0, capture: !0 }));
3338
+ function mt(s) {
3339
+ s.key === "Control" && (ve = !0, e.domElement.getRootNode().addEventListener("keyup", Le, { passive: !0, capture: !0 }));
3175
3340
  }
3176
- function je(s) {
3177
- s.key === "Control" && (Ae = !1, e.domElement.getRootNode().removeEventListener("keyup", je, { passive: !0, capture: !0 }));
3341
+ function Le(s) {
3342
+ s.key === "Control" && (ve = !1, e.domElement.getRootNode().removeEventListener("keyup", Le, { passive: !0, capture: !0 }));
3178
3343
  }
3179
- function nt(s) {
3180
- e.enabled === !1 || e.enablePan === !1 || ae(s);
3344
+ function rt(s) {
3345
+ e.enabled === !1 || e.enablePan === !1 || p(s);
3181
3346
  }
3182
- function at(s) {
3183
- switch (vt(s), Q.length) {
3347
+ function st(s) {
3348
+ switch (gt(s), G.length) {
3184
3349
  case 1:
3185
3350
  switch (e.touches.ONE) {
3186
- case Ze.ROTATE:
3351
+ case tt.ROTATE:
3187
3352
  if (e.enableRotate === !1)
3188
3353
  return;
3189
- U(s), o = i.TOUCH_ROTATE;
3354
+ v(s), c = i.TOUCH_ROTATE;
3190
3355
  break;
3191
- case Ze.PAN:
3356
+ case tt.PAN:
3192
3357
  if (e.enablePan === !1)
3193
3358
  return;
3194
- X(s), o = i.TOUCH_PAN;
3359
+ C(s), c = i.TOUCH_PAN;
3195
3360
  break;
3196
3361
  default:
3197
- o = i.NONE;
3362
+ c = i.NONE;
3198
3363
  }
3199
3364
  break;
3200
3365
  case 2:
3201
3366
  switch (e.touches.TWO) {
3202
- case Ze.DOLLY_PAN:
3367
+ case tt.DOLLY_PAN:
3203
3368
  if (e.enableZoom === !1 && e.enablePan === !1)
3204
3369
  return;
3205
- _(s), o = i.TOUCH_DOLLY_PAN;
3370
+ H(s), c = i.TOUCH_DOLLY_PAN;
3206
3371
  break;
3207
- case Ze.DOLLY_ROTATE:
3372
+ case tt.DOLLY_ROTATE:
3208
3373
  if (e.enableZoom === !1 && e.enableRotate === !1)
3209
3374
  return;
3210
- F(s), o = i.TOUCH_DOLLY_ROTATE;
3375
+ X(s), c = i.TOUCH_DOLLY_ROTATE;
3211
3376
  break;
3212
3377
  default:
3213
- o = i.NONE;
3378
+ c = i.NONE;
3214
3379
  }
3215
3380
  break;
3216
3381
  default:
3217
- o = i.NONE;
3382
+ c = i.NONE;
3218
3383
  }
3219
- o !== i.NONE && e.dispatchEvent(kt);
3384
+ c !== i.NONE && e.dispatchEvent(jt);
3220
3385
  }
3221
- function mt(s) {
3222
- switch (vt(s), o) {
3386
+ function vt(s) {
3387
+ switch (gt(s), c) {
3223
3388
  case i.TOUCH_ROTATE:
3224
3389
  if (e.enableRotate === !1)
3225
3390
  return;
3226
- ne(s), e.update();
3391
+ de(s), e.update();
3227
3392
  break;
3228
3393
  case i.TOUCH_PAN:
3229
3394
  if (e.enablePan === !1)
3230
3395
  return;
3231
- Ce(s), e.update();
3396
+ z(s), e.update();
3232
3397
  break;
3233
3398
  case i.TOUCH_DOLLY_PAN:
3234
3399
  if (e.enableZoom === !1 && e.enablePan === !1)
3235
3400
  return;
3236
- dt(s), e.update();
3401
+ se(s), e.update();
3237
3402
  break;
3238
3403
  case i.TOUCH_DOLLY_ROTATE:
3239
3404
  if (e.enableZoom === !1 && e.enableRotate === !1)
3240
3405
  return;
3241
- ut(s), e.update();
3406
+ A(s), e.update();
3242
3407
  break;
3243
3408
  default:
3244
- o = i.NONE;
3409
+ c = i.NONE;
3245
3410
  }
3246
3411
  }
3247
- function qe(s) {
3412
+ function Je(s) {
3248
3413
  e.enabled !== !1 && s.preventDefault();
3249
3414
  }
3250
- function wt(s) {
3251
- Q.push(s.pointerId);
3415
+ function Mt(s) {
3416
+ G.push(s.pointerId);
3252
3417
  }
3253
- function Ot(s) {
3254
- delete x[s.pointerId];
3255
- for (let y = 0; y < Q.length; y++)
3256
- if (Q[y] == s.pointerId) {
3257
- Q.splice(y, 1);
3418
+ function Tt(s) {
3419
+ delete ee[s.pointerId];
3420
+ for (let y = 0; y < G.length; y++)
3421
+ if (G[y] == s.pointerId) {
3422
+ G.splice(y, 1);
3258
3423
  return;
3259
3424
  }
3260
3425
  }
3261
- function vt(s) {
3262
- let y = x[s.pointerId];
3263
- y === void 0 && (y = new fe(), x[s.pointerId] = y), y.set(s.pageX, s.pageY);
3426
+ function gt(s) {
3427
+ let y = ee[s.pointerId];
3428
+ y === void 0 && (y = new me(), ee[s.pointerId] = y), y.set(s.pageX, s.pageY);
3264
3429
  }
3265
- function De(s) {
3266
- const y = s.pointerId === Q[0] ? Q[1] : Q[0];
3267
- return x[y];
3430
+ function Fe(s) {
3431
+ const y = s.pointerId === G[0] ? G[1] : G[0];
3432
+ return ee[y];
3268
3433
  }
3269
- e.domElement.addEventListener("contextmenu", qe), e.domElement.addEventListener("pointerdown", Be), e.domElement.addEventListener("pointercancel", Ue), e.domElement.addEventListener("wheel", ht, { passive: !1 }), e.domElement.getRootNode().addEventListener("keydown", pt, { passive: !0, capture: !0 }), this.update();
3434
+ e.domElement.addEventListener("contextmenu", Je), e.domElement.addEventListener("pointerdown", L), e.domElement.addEventListener("pointercancel", we), e.domElement.addEventListener("wheel", ft, { passive: !1 }), e.domElement.getRootNode().addEventListener("keydown", mt, { passive: !0, capture: !0 }), this.update();
3270
3435
  }
3271
3436
  }
3272
- const Et = (t) => {
3273
- const [n, a] = oe(t.options[t.index]), e = () => {
3437
+ const xt = (t) => {
3438
+ const [n, a] = ae(t.options[t.index]), e = () => {
3274
3439
  t.onToggle(!t.open);
3275
- }, i = (o) => {
3276
- o !== n && (t.onSelect(o), a(o)), t.onToggle(!1);
3440
+ }, i = (c) => {
3441
+ c !== n && (t.onSelect(c), a(c)), t.onToggle(!1);
3277
3442
  };
3278
3443
  return /* @__PURE__ */ l.jsxs("div", { className: `dropdown ${t.up === !0 ? "up" : ""}`, children: [
3279
3444
  /* @__PURE__ */ l.jsx("div", { className: "dropdown-toggle", onClick: e, children: n }),
3280
- t.open && /* @__PURE__ */ l.jsx("ul", { className: "dropdown-menu", children: t.options.map((o) => /* @__PURE__ */ l.jsx("li", { onClick: () => i(o), children: o }, o)) })
3445
+ t.open && /* @__PURE__ */ l.jsx("ul", { className: "dropdown-menu", children: t.options.map((c) => /* @__PURE__ */ l.jsx("li", { onClick: () => i(c), children: c }, c)) })
3281
3446
  ] });
3282
- }, He = ua(function(n, a) {
3283
- const [e, i] = oe(!1), o = n.options.indexOf(n.camera.name);
3447
+ }, Ke = pa(function(n, a) {
3448
+ const [e, i] = ae(!1), c = n.options.indexOf(n.camera.name);
3284
3449
  return /* @__PURE__ */ l.jsxs("div", { className: "CameraWindow", children: [
3285
3450
  /* @__PURE__ */ l.jsx("div", { ref: a, className: "clickable", onClick: () => {
3286
3451
  e && i(!1);
3287
3452
  } }),
3288
3453
  /* @__PURE__ */ l.jsx(
3289
- Et,
3454
+ xt,
3290
3455
  {
3291
- index: o,
3456
+ index: c,
3292
3457
  open: e,
3293
3458
  options: n.options,
3294
3459
  onSelect: n.onSelect,
@@ -3300,14 +3465,14 @@ const Et = (t) => {
3300
3465
  )
3301
3466
  ] });
3302
3467
  });
3303
- class Za extends bn {
3468
+ class ii extends xn {
3304
3469
  constructor(n) {
3305
3470
  super({
3306
3471
  extensions: {
3307
3472
  derivatives: !0
3308
3473
  },
3309
- glslVersion: Jn,
3310
- side: nn,
3474
+ glslVersion: ta,
3475
+ side: sn,
3311
3476
  transparent: !0,
3312
3477
  uniforms: {
3313
3478
  uScale: {
@@ -3317,7 +3482,7 @@ class Za extends bn {
3317
3482
  value: n?.divisions !== void 0 ? n?.divisions : 10
3318
3483
  },
3319
3484
  uColor: {
3320
- value: n?.color !== void 0 ? n?.color : new St(16777215)
3485
+ value: n?.color !== void 0 ? n?.color : new Ct(16777215)
3321
3486
  },
3322
3487
  uDistance: {
3323
3488
  value: n?.distance !== void 0 ? n?.distance : 1e4
@@ -3412,17 +3577,17 @@ class Za extends bn {
3412
3577
  });
3413
3578
  }
3414
3579
  }
3415
- class Ja extends Qn {
3580
+ class ri extends na {
3416
3581
  gridMaterial;
3417
3582
  constructor() {
3418
- const n = new Za();
3419
- super(new ea(2, 2), n), this.gridMaterial = n, this.frustumCulled = !1, this.name = "InfiniteGridHelper", this.position.y = 0.1;
3583
+ const n = new ii();
3584
+ super(new aa(2, 2), n), this.gridMaterial = n, this.frustumCulled = !1, this.name = "InfiniteGridHelper", this.position.y = 0.1;
3420
3585
  }
3421
3586
  update() {
3422
3587
  this.gridMaterial.needsUpdate = !0;
3423
3588
  }
3424
3589
  }
3425
- const Qa = `#include <common>
3590
+ const si = `#include <common>
3426
3591
  #include <batching_pars_vertex>
3427
3592
  #include <uv_pars_vertex>
3428
3593
  #include <color_pars_vertex>
@@ -3452,7 +3617,7 @@ void main() {
3452
3617
  #include <logdepthbuf_vertex>
3453
3618
  #include <clipping_planes_vertex>
3454
3619
  #include <worldpos_vertex>
3455
- }`, ei = `
3620
+ }`, oi = `
3456
3621
  #include <common>
3457
3622
  #include <uv_pars_fragment>
3458
3623
  #include <clipping_planes_pars_fragment>
@@ -3461,320 +3626,320 @@ void main() {
3461
3626
  #include <clipping_planes_fragment>
3462
3627
  gl_FragColor = vec4(vec3(vUv, 0.0), 1.0);
3463
3628
  }`;
3464
- class ti extends bn {
3629
+ class ci extends xn {
3465
3630
  constructor() {
3466
3631
  super({
3467
3632
  defines: {
3468
3633
  USE_UV: ""
3469
3634
  },
3470
- vertexShader: Qa,
3471
- fragmentShader: ei
3635
+ vertexShader: si,
3636
+ fragmentShader: oi
3472
3637
  });
3473
3638
  }
3474
3639
  }
3475
- let bt = "Renderer", Ie, yt = !1, Qt = !1, $, se, Ne, Le;
3476
- function bi(t) {
3477
- const n = Se(() => /* @__PURE__ */ new Map(), []), a = Se(() => /* @__PURE__ */ new Map(), []), e = Se(() => /* @__PURE__ */ new Map(), []), i = Se(() => new ta(), []), o = Se(() => new na(), []), h = Se(() => new Ja(), []), c = Se(() => new Yt(500), []), d = Se(() => new Yt(100), []), u = Se(() => new aa(), []), v = Se(() => new ia(), []), b = Se(() => new ti(), []), E = Se(() => new ra({
3640
+ let yt = "Renderer", Be, Et = !1, nn = !1, Y = null, ce = null, Ue = null, $e = null;
3641
+ function wi(t) {
3642
+ const n = t.three.app.appID, a = localStorage.getItem(`${n}_mode`), e = localStorage.getItem(`${n}_tlCam`) !== null ? localStorage.getItem(`${n}_tlCam`) : "Debug", i = localStorage.getItem(`${n}_trCam`) !== null ? localStorage.getItem(`${n}_trCam`) : "Orthographic", c = localStorage.getItem(`${n}_blCam`) !== null ? localStorage.getItem(`${n}_blCam`) : "Front", h = localStorage.getItem(`${n}_brCam`) !== null ? localStorage.getItem(`${n}_brCam`) : "Top", o = xe(() => /* @__PURE__ */ new Map(), []), u = xe(() => /* @__PURE__ */ new Map(), []), d = xe(() => /* @__PURE__ */ new Map(), []), f = xe(() => new ia(), []), b = xe(() => new ra(), []), E = xe(() => new ri(), []), x = xe(() => new Vt(500), []), M = xe(() => new Vt(100), []), P = xe(() => new sa(), []), V = xe(() => new oa(), []), U = xe(() => new ci(), []), j = xe(() => new ca({
3478
3643
  opacity: 0.33,
3479
3644
  transparent: !0,
3480
3645
  wireframe: !0
3481
3646
  }), []);
3482
- function S(p, m) {
3483
- const w = new Gt(-100, 100, 100, -100, 50, 3e3);
3484
- return w.name = p, w.position.copy(m), w.lookAt(0, 0, 0), n.set(p, w), w;
3647
+ function O(p, v) {
3648
+ const C = new Gt(-100, 100, 100, -100, 50, 3e3);
3649
+ return C.name = p, C.position.copy(v), C.lookAt(0, 0, 0), o.set(p, C), C;
3485
3650
  }
3486
- const D = [
3651
+ const re = [
3487
3652
  "Renderer",
3488
3653
  "Depth",
3489
3654
  "Normals",
3490
3655
  "UVs",
3491
3656
  "Wireframe"
3492
- ], I = [
3657
+ ], Q = [
3493
3658
  "Single",
3494
3659
  "Side by Side",
3495
3660
  "Stacked",
3496
3661
  "Quad"
3497
- ];
3498
- _e(() => {
3499
- i.name = "Debug Scene", o.name = "helpers", i.add(o), o.add(h), c.name = "axisHelper", o.add(c), d.name = "interactionHelper", o.add(d), d.visible = !1, S("Top", new W(0, 1e3, 0)), S("Bottom", new W(0, -1e3, 0)), S("Left", new W(-1e3, 0, 0)), S("Right", new W(1e3, 0, 0)), S("Front", new W(0, 0, 1e3)), S("Back", new W(0, 0, -1e3)), S("Orthographic", new W(1e3, 1e3, 1e3));
3500
- const p = new Rt(60, 1, 50, 3e3);
3501
- p.name = "Debug", p.position.set(500, 500, 500), p.lookAt(0, 0, 0), n.set("Debug", p), $ = n.get("Debug"), se = n.get("Orthographic"), Ne = n.get("Front"), Le = n.get("Top");
3502
- }, []);
3503
- const q = Re(null), B = Re(null), M = Re(null), z = Re(null), we = Re(null), ce = Re(null), [Y, Q] = oe(t.mode !== void 0 ? t.mode : "Single"), [x, Ae] = oe(null), [Fe, Oe] = oe(!1), [me, te] = oe(!1), [ue, ve] = oe(!1), [, ge] = oe(Date.now()), K = (p, m) => {
3504
- const w = a.get(p.name);
3505
- w !== void 0 && w.dispose(), a.delete(p.name);
3506
- const R = e.get(p.name);
3507
- R !== void 0 && (i.remove(R), R.dispose()), e.delete(p.name);
3508
- const G = new Xa(p, m);
3509
- switch (G.enableDamping = !0, G.dampingFactor = 0.05, p.name) {
3662
+ ], Ce = fe(null), G = fe(null), ee = fe(null), ve = fe(null), ze = fe(null), Me = fe(null), [$, le] = ae(a !== null ? a : "Single"), [S, Te] = ae(null), [ge, _e] = ae(!1), [je, Re] = ae(!1), [Pe, De] = ae(!1), [, Ye] = ae(Date.now());
3663
+ localStorage.setItem(`${n}_mode`, $), localStorage.setItem(`${n}_tlCam`, e), localStorage.setItem(`${n}_trCam`, i), localStorage.setItem(`${n}_blCam`, c), localStorage.setItem(`${n}_brCam`, h);
3664
+ const te = (p, v) => {
3665
+ const C = u.get(p.name);
3666
+ C !== void 0 && C.dispose(), u.delete(p.name);
3667
+ const _ = d.get(p.name);
3668
+ _ !== void 0 && (f.remove(_), _.dispose()), d.delete(p.name);
3669
+ const H = new ai(p, v);
3670
+ switch (H.enableDamping = !0, H.dampingFactor = 0.05, p.name) {
3510
3671
  case "Top":
3511
3672
  case "Bottom":
3512
3673
  case "Left":
3513
3674
  case "Right":
3514
3675
  case "Front":
3515
3676
  case "Back":
3516
- G.enableRotate = !1;
3677
+ H.enableRotate = !1;
3517
3678
  break;
3518
3679
  }
3519
- if (a.set(p.name, G), p instanceof Rt) {
3520
- const V = new ca(p);
3521
- e.set(p.name, V), i.add(V);
3522
- }
3523
- }, pe = (p) => {
3524
- const m = e.get(p.name);
3525
- m !== void 0 && (i.remove(m), m.dispose(), e.delete(p.name));
3526
- const w = a.get(p.name);
3527
- w !== void 0 && (w.dispose(), a.delete(p.name));
3528
- }, Pe = () => {
3529
- a.forEach((p, m) => {
3680
+ if (u.set(p.name, H), p instanceof Pt) {
3681
+ const X = new da(p);
3682
+ d.set(p.name, X), f.add(X);
3683
+ }
3684
+ }, Se = (p) => {
3685
+ const v = d.get(p.name);
3686
+ v !== void 0 && (f.remove(v), v.dispose(), d.delete(p.name));
3687
+ const C = u.get(p.name);
3688
+ C !== void 0 && (C.dispose(), u.delete(p.name));
3689
+ }, it = () => {
3690
+ u.forEach((p, v) => {
3530
3691
  p.dispose();
3531
- const w = e.get(m);
3532
- w !== void 0 && (i.remove(w), w.dispose()), e.delete(m), a.delete(m);
3533
- }), a.clear(), e.clear();
3534
- }, ke = () => {
3535
- switch (Y) {
3692
+ const C = d.get(v);
3693
+ C !== void 0 && (f.remove(C), C.dispose()), d.delete(v), u.delete(v);
3694
+ }), u.clear(), d.clear();
3695
+ }, Ve = () => {
3696
+ switch ($) {
3536
3697
  case "Single":
3537
- K($, M.current);
3698
+ te(Y, ee.current);
3538
3699
  break;
3539
3700
  case "Side by Side":
3540
3701
  case "Stacked":
3541
- K($, M.current), K(se, z.current);
3702
+ te(Y, ee.current), te(ce, ve.current);
3542
3703
  break;
3543
3704
  case "Quad":
3544
- K($, M.current), K(se, z.current), K(Ne, we.current), K(Le, ce.current);
3705
+ te(Y, ee.current), te(ce, ve.current), te(Ue, ze.current), te($e, Me.current);
3545
3706
  break;
3546
3707
  }
3547
3708
  };
3548
- _e(() => {
3549
- const p = new sa({
3550
- canvas: q.current,
3709
+ ke(() => {
3710
+ const p = new la({
3711
+ canvas: Ce.current,
3551
3712
  stencil: !1
3552
3713
  });
3553
- p.autoClear = !1, p.shadowMap.enabled = !0, p.setPixelRatio(devicePixelRatio), p.setClearColor(0), t.three.renderer = p, Ae(p);
3554
- }, []), _e(() => {
3555
- const p = (R) => {
3556
- xn(Ie), i.remove(Ie);
3557
- const G = t.scenes.get(R.value.name);
3558
- if (G !== void 0) {
3559
- const V = new G();
3560
- t.onSceneSet !== void 0 && t.onSceneSet(V), Ie = V, t.three.scene = Ie, i.add(Ie), Qt = !0;
3561
- }
3562
- }, m = (R) => {
3563
- const G = R.value, V = t.three.scene?.getObjectByProperty("uuid", G.uuid);
3564
- V !== void 0 && n.set(G.name, V), ge(Date.now());
3565
- }, w = (R) => {
3566
- n.delete(R.value.name), ge(Date.now());
3714
+ p.autoClear = !1, p.shadowMap.enabled = !0, p.setPixelRatio(devicePixelRatio), p.setClearColor(0), t.three.renderer = p, Te(p);
3715
+ }, []), ke(() => {
3716
+ f.name = "Debug Scene", b.name = "helpers", f.add(b), b.add(E), x.name = "axisHelper", b.add(x), M.name = "interactionHelper", b.add(M), M.visible = !1, O("Top", new q(0, 1e3, 0)), O("Bottom", new q(0, -1e3, 0)), O("Left", new q(-1e3, 0, 0)), O("Right", new q(1e3, 0, 0)), O("Front", new q(0, 0, 1e3)), O("Back", new q(0, 0, -1e3)), O("Orthographic", new q(1e3, 1e3, 1e3));
3717
+ const p = new Pt(60, 1, 50, 3e3);
3718
+ p.name = "Debug", p.position.set(500, 500, 500), p.lookAt(0, 0, 0), o.set("Debug", p), Y = o.get(localStorage.getItem(`${n}_tlCam`)), ce = o.get(localStorage.getItem(`${n}_trCam`)), Ue = o.get(localStorage.getItem(`${n}_blCam`)), $e = o.get(localStorage.getItem(`${n}_brCam`));
3719
+ }, []), ke(() => {
3720
+ const p = (_) => {
3721
+ Mn(Be), f.remove(Be);
3722
+ const H = t.scenes.get(_.value.name);
3723
+ if (H !== void 0) {
3724
+ const X = new H();
3725
+ t.onSceneSet !== void 0 && t.onSceneSet(X), Be = X, t.three.scene = Be, f.add(Be), nn = !0;
3726
+ }
3727
+ }, v = (_) => {
3728
+ const H = _.value, X = t.three.scene?.getObjectByProperty("uuid", H.uuid);
3729
+ X !== void 0 && o.set(H.name, X), Ye(Date.now());
3730
+ }, C = (_) => {
3731
+ o.delete(_.value.name), Ye(Date.now());
3567
3732
  };
3568
- return P.addEventListener(k.SET_SCENE, p), P.addEventListener(k.ADD_CAMERA, m), P.addEventListener(k.REMOVE_CAMERA, w), () => {
3569
- P.removeEventListener(k.SET_SCENE, p), P.removeEventListener(k.ADD_CAMERA, m), P.removeEventListener(k.REMOVE_CAMERA, w);
3733
+ return D.addEventListener(I.SET_SCENE, p), D.addEventListener(I.ADD_CAMERA, v), D.addEventListener(I.REMOVE_CAMERA, C), () => {
3734
+ D.removeEventListener(I.SET_SCENE, p), D.removeEventListener(I.ADD_CAMERA, v), D.removeEventListener(I.REMOVE_CAMERA, C);
3570
3735
  };
3571
- }, []), _e(() => {
3572
- if (x === null)
3736
+ }, []), ke(() => {
3737
+ if (S === null)
3573
3738
  return;
3574
- let p = window.innerWidth, m = window.innerHeight, w = Math.floor(p / 2), R = Math.floor(m / 2), G = -1;
3575
- const V = () => {
3576
- p = window.innerWidth - 300, m = window.innerHeight, w = Math.floor(p / 2), R = Math.floor(m / 2), x.setSize(p, m);
3577
- let _ = p, F = m;
3578
- switch (Y) {
3739
+ let p = window.innerWidth, v = window.innerHeight, C = Math.floor(p / 2), _ = Math.floor(v / 2), H = -1;
3740
+ const X = () => {
3741
+ p = window.innerWidth - 300, v = window.innerHeight, C = Math.floor(p / 2), _ = Math.floor(v / 2), S.setSize(p, v);
3742
+ let A = p, L = v;
3743
+ switch ($) {
3579
3744
  case "Side by Side":
3580
- _ = w, F = m;
3745
+ A = C, L = v;
3581
3746
  break;
3582
3747
  case "Stacked":
3583
- _ = p, F = R;
3748
+ A = p, L = _;
3584
3749
  break;
3585
3750
  case "Quad":
3586
- _ = w, F = R;
3751
+ A = C, L = _;
3587
3752
  break;
3588
3753
  }
3589
- n.forEach((ne) => {
3590
- ne instanceof Gt ? (ne.left = _ / -2, ne.right = _ / 2, ne.top = F / 2, ne.bottom = F / -2, ne.updateProjectionMatrix()) : ne instanceof Rt && (ne.aspect = _ / F, ne.updateProjectionMatrix(), e.get(ne.name)?.update());
3754
+ o.forEach((ie) => {
3755
+ ie instanceof Gt ? (ie.left = A / -2, ie.right = A / 2, ie.top = L / 2, ie.bottom = L / -2, ie.updateProjectionMatrix()) : ie instanceof Pt && (ie.aspect = A / L, ie.updateProjectionMatrix(), d.get(ie.name)?.update());
3591
3756
  });
3592
- }, ae = () => {
3593
- x.setViewport(0, 0, p, m), x.setScissor(0, 0, p, m), x.render(i, $);
3594
- }, U = () => {
3595
- if (Y === "Side by Side")
3596
- x.setViewport(0, 0, w, m), x.setScissor(0, 0, w, m), x.render(i, $), x.setViewport(w, 0, w, m), x.setScissor(w, 0, w, m), x.render(i, se);
3757
+ }, de = () => {
3758
+ S.setViewport(0, 0, p, v), S.setScissor(0, 0, p, v), S.render(f, Y);
3759
+ }, z = () => {
3760
+ if ($ === "Side by Side")
3761
+ S.setViewport(0, 0, C, v), S.setScissor(0, 0, C, v), S.render(f, Y), S.setViewport(C, 0, C, v), S.setScissor(C, 0, C, v), S.render(f, ce);
3597
3762
  else {
3598
- const _ = m - R;
3599
- x.setViewport(0, _, p, R), x.setScissor(0, _, p, R), x.render(i, $), x.setViewport(0, 0, p, R), x.setScissor(0, 0, p, R), x.render(i, se);
3600
- }
3601
- }, X = () => {
3602
- let _ = 0, F = 0;
3603
- F = m - R, _ = 0, x.setViewport(_, F, w, R), x.setScissor(_, F, w, R), x.render(i, $), _ = w, x.setViewport(_, F, w, R), x.setScissor(_, F, w, R), x.render(i, se), F = 0, _ = 0, x.setViewport(_, F, w, R), x.setScissor(_, F, w, R), x.render(i, Ne), _ = w, x.setViewport(_, F, w, R), x.setScissor(_, F, w, R), x.render(i, Le);
3604
- }, ie = () => {
3605
- switch (a.forEach((_) => {
3606
- _.update();
3607
- }), t.onSceneUpdate !== void 0 && Qt && t.onSceneUpdate(Ie), x.clear(), Y) {
3763
+ const A = v - _;
3764
+ S.setViewport(0, A, p, _), S.setScissor(0, A, p, _), S.render(f, Y), S.setViewport(0, 0, p, _), S.setScissor(0, 0, p, _), S.render(f, ce);
3765
+ }
3766
+ }, Z = () => {
3767
+ let A = 0, L = 0;
3768
+ L = v - _, A = 0, S.setViewport(A, L, C, _), S.setScissor(A, L, C, _), S.render(f, Y), A = C, S.setViewport(A, L, C, _), S.setScissor(A, L, C, _), S.render(f, ce), L = 0, A = 0, S.setViewport(A, L, C, _), S.setScissor(A, L, C, _), S.render(f, Ue), A = C, S.setViewport(A, L, C, _), S.setScissor(A, L, C, _), S.render(f, $e);
3769
+ }, se = () => {
3770
+ switch (u.forEach((A) => {
3771
+ A.update();
3772
+ }), t.onSceneUpdate !== void 0 && nn && t.onSceneUpdate(Be), S.clear(), $) {
3608
3773
  case "Single":
3609
- ae();
3774
+ de();
3610
3775
  break;
3611
3776
  case "Side by Side":
3612
3777
  case "Stacked":
3613
- U();
3778
+ z();
3614
3779
  break;
3615
3780
  case "Quad":
3616
- X();
3781
+ Z();
3617
3782
  break;
3618
3783
  }
3619
- G = requestAnimationFrame(ie);
3784
+ H = requestAnimationFrame(se);
3620
3785
  };
3621
- return ke(), window.addEventListener("resize", V), V(), ie(), () => {
3622
- window.removeEventListener("resize", V), cancelAnimationFrame(G), G = -1;
3786
+ return Ve(), window.addEventListener("resize", X), X(), se(), () => {
3787
+ window.removeEventListener("resize", X), cancelAnimationFrame(H), H = -1;
3623
3788
  };
3624
- }, [Y, x]), _e(() => {
3625
- if (x !== null) {
3626
- const p = new oa(), m = new fe(), w = (ae, U, X, ie) => {
3627
- switch (Y) {
3789
+ }, [$, S]), ke(() => {
3790
+ if (S !== null) {
3791
+ const p = new ua(), v = new me(), C = (de, z, Z, se) => {
3792
+ switch ($) {
3628
3793
  case "Quad":
3629
- ae < X ? U < ie ? p.setFromCamera(m, $) : p.setFromCamera(m, Ne) : U < ie ? p.setFromCamera(m, se) : p.setFromCamera(m, Le);
3794
+ de < Z ? z < se ? p.setFromCamera(v, Y) : p.setFromCamera(v, Ue) : z < se ? p.setFromCamera(v, ce) : p.setFromCamera(v, $e);
3630
3795
  break;
3631
3796
  case "Side by Side":
3632
- ae < X ? p.setFromCamera(m, $) : p.setFromCamera(m, se);
3797
+ de < Z ? p.setFromCamera(v, Y) : p.setFromCamera(v, ce);
3633
3798
  break;
3634
3799
  case "Single":
3635
- p.setFromCamera(m, $);
3800
+ p.setFromCamera(v, Y);
3636
3801
  break;
3637
3802
  case "Stacked":
3638
- U < ie ? p.setFromCamera(m, $) : p.setFromCamera(m, se);
3803
+ z < se ? p.setFromCamera(v, Y) : p.setFromCamera(v, ce);
3639
3804
  break;
3640
3805
  }
3641
- }, R = (ae) => {
3642
- if (!yt)
3806
+ }, _ = (de) => {
3807
+ if (!Et)
3643
3808
  return;
3644
- const U = new fe();
3645
- x.getSize(U);
3646
- const X = Math.min(ae.clientX, U.x), ie = Math.min(ae.clientY, U.y);
3647
- m.x = Qe(X, 0, U.x, -1, 1), m.y = Qe(ie, 0, U.y, 1, -1);
3648
- const _ = U.x / 2, F = U.y / 2, ne = () => {
3649
- X < _ ? m.x = Qe(X, 0, _, -1, 1) : m.x = Qe(X, _, U.x, -1, 1);
3650
- }, Ce = () => {
3651
- ie < F ? m.y = Qe(ie, 0, F, 1, -1) : m.y = Qe(ie, F, U.y, 1, -1);
3809
+ const z = new me();
3810
+ S.getSize(z);
3811
+ const Z = Math.min(de.clientX, z.x), se = Math.min(de.clientY, z.y);
3812
+ v.x = at(Z, 0, z.x, -1, 1), v.y = at(se, 0, z.y, 1, -1);
3813
+ const A = z.x / 2, L = z.y / 2, ie = () => {
3814
+ Z < A ? v.x = at(Z, 0, A, -1, 1) : v.x = at(Z, A, z.x, -1, 1);
3815
+ }, we = () => {
3816
+ se < L ? v.y = at(se, 0, L, 1, -1) : v.y = at(se, L, z.y, 1, -1);
3652
3817
  };
3653
- switch (Y) {
3818
+ switch ($) {
3654
3819
  case "Quad":
3655
- ne(), Ce();
3820
+ ie(), we();
3656
3821
  break;
3657
3822
  case "Side by Side":
3658
- ne();
3823
+ ie();
3659
3824
  break;
3660
3825
  case "Stacked":
3661
- Ce(), Ce();
3826
+ we(), we();
3662
3827
  break;
3663
3828
  }
3664
- w(X, ie, _, F);
3665
- const Me = p.intersectObjects(Ie.children);
3666
- Me.length > 0 && d.position.copy(Me[0].point);
3667
- }, G = (ae) => {
3668
- if (!yt)
3829
+ C(Z, se, A, L);
3830
+ const Ne = p.intersectObjects(Be.children);
3831
+ Ne.length > 0 && M.position.copy(Ne[0].point);
3832
+ }, H = (de) => {
3833
+ if (!Et)
3669
3834
  return;
3670
- const U = new fe();
3671
- if (x.getSize(U), ae.clientX >= U.x)
3835
+ const z = new me();
3836
+ if (S.getSize(z), de.clientX >= z.x)
3672
3837
  return;
3673
- R(ae);
3674
- const X = p.intersectObjects(Ie.children);
3675
- X.length > 0 && t.three.getObject(X[0].object.uuid);
3676
- }, V = B.current;
3677
- return V.addEventListener("mousemove", R, !1), V.addEventListener("click", G, !1), () => {
3678
- V.removeEventListener("mousemove", R), V.removeEventListener("click", G);
3838
+ _(de);
3839
+ const Z = p.intersectObjects(Be.children);
3840
+ Z.length > 0 && t.three.getObject(Z[0].object.uuid);
3841
+ }, X = G.current;
3842
+ return X.addEventListener("mousemove", _, !1), X.addEventListener("click", H, !1), () => {
3843
+ X.removeEventListener("mousemove", _), X.removeEventListener("click", H);
3679
3844
  };
3680
3845
  }
3681
- }, [Y, x]);
3682
- const he = [];
3683
- return n.forEach((p, m) => {
3684
- he.push(m);
3846
+ }, [$, S]);
3847
+ const pe = [];
3848
+ return o.forEach((p, v) => {
3849
+ pe.push(v);
3685
3850
  }), /* @__PURE__ */ l.jsxs("div", { className: "multiview", children: [
3686
- /* @__PURE__ */ l.jsx("canvas", { ref: q }),
3687
- x !== null && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
3688
- /* @__PURE__ */ l.jsxs("div", { className: `cameras ${Y === "Single" || Y === "Stacked" ? "single" : ""}`, ref: B, children: [
3689
- Y === "Single" && /* @__PURE__ */ l.jsx(l.Fragment, { children: /* @__PURE__ */ l.jsx(He, { camera: $, options: he, ref: M, onSelect: (p) => {
3690
- a.get($.name)?.dispose();
3691
- const m = n.get(p);
3692
- m !== void 0 && (pe($), $ = m, K(m, M.current));
3851
+ /* @__PURE__ */ l.jsx("canvas", { ref: Ce }),
3852
+ S !== null && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
3853
+ /* @__PURE__ */ l.jsxs("div", { className: `cameras ${$ === "Single" || $ === "Stacked" ? "single" : ""}`, ref: G, children: [
3854
+ $ === "Single" && /* @__PURE__ */ l.jsx(l.Fragment, { children: /* @__PURE__ */ l.jsx(Ke, { camera: Y, options: pe, ref: ee, onSelect: (p) => {
3855
+ u.get(Y.name)?.dispose();
3856
+ const v = o.get(p);
3857
+ v !== void 0 && (Se(Y), Y = v, localStorage.setItem(`${n}_tlCam`, v.name), te(v, ee.current));
3693
3858
  } }) }),
3694
- (Y === "Side by Side" || Y === "Stacked") && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
3695
- /* @__PURE__ */ l.jsx(He, { camera: $, options: he, ref: M, onSelect: (p) => {
3696
- a.get($.name)?.dispose();
3697
- const m = n.get(p);
3698
- m !== void 0 && (pe($), $ = m, K(m, M.current));
3859
+ ($ === "Side by Side" || $ === "Stacked") && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
3860
+ /* @__PURE__ */ l.jsx(Ke, { camera: Y, options: pe, ref: ee, onSelect: (p) => {
3861
+ u.get(Y.name)?.dispose();
3862
+ const v = o.get(p);
3863
+ v !== void 0 && (Se(Y), Y = v, localStorage.setItem(`${n}_tlCam`, v.name), te(v, ee.current));
3699
3864
  } }),
3700
- /* @__PURE__ */ l.jsx(He, { camera: se, options: he, ref: z, onSelect: (p) => {
3701
- a.get(se.name)?.dispose();
3702
- const m = n.get(p);
3703
- m !== void 0 && (pe(se), se = m, K(m, z.current));
3865
+ /* @__PURE__ */ l.jsx(Ke, { camera: ce, options: pe, ref: ve, onSelect: (p) => {
3866
+ u.get(ce.name)?.dispose();
3867
+ const v = o.get(p);
3868
+ v !== void 0 && (Se(ce), ce = v, localStorage.setItem(`${n}_trCam`, v.name), te(v, ve.current));
3704
3869
  } })
3705
3870
  ] }),
3706
- Y === "Quad" && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
3707
- /* @__PURE__ */ l.jsx(He, { camera: $, options: he, ref: M, onSelect: (p) => {
3708
- a.get($.name)?.dispose();
3709
- const m = n.get(p);
3710
- m !== void 0 && (pe($), $ = m, K(m, M.current));
3871
+ $ === "Quad" && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
3872
+ /* @__PURE__ */ l.jsx(Ke, { camera: Y, options: pe, ref: ee, onSelect: (p) => {
3873
+ u.get(Y.name)?.dispose();
3874
+ const v = o.get(p);
3875
+ v !== void 0 && (Se(Y), Y = v, localStorage.setItem(`${n}_tlCam`, v.name), te(v, ee.current));
3711
3876
  } }),
3712
- /* @__PURE__ */ l.jsx(He, { camera: se, options: he, ref: z, onSelect: (p) => {
3713
- a.get(se.name)?.dispose();
3714
- const m = n.get(p);
3715
- m !== void 0 && (pe(se), se = m, K(m, z.current));
3877
+ /* @__PURE__ */ l.jsx(Ke, { camera: ce, options: pe, ref: ve, onSelect: (p) => {
3878
+ u.get(ce.name)?.dispose();
3879
+ const v = o.get(p);
3880
+ v !== void 0 && (Se(ce), ce = v, localStorage.setItem(`${n}_trCam`, v.name), te(v, ve.current));
3716
3881
  } }),
3717
- /* @__PURE__ */ l.jsx(He, { camera: Ne, options: he, ref: we, onSelect: (p) => {
3718
- a.get(Ne.name)?.dispose();
3719
- const m = n.get(p);
3720
- m !== void 0 && (pe(Ne), Ne = m, K(m, we.current));
3882
+ /* @__PURE__ */ l.jsx(Ke, { camera: Ue, options: pe, ref: ze, onSelect: (p) => {
3883
+ u.get(Ue.name)?.dispose();
3884
+ const v = o.get(p);
3885
+ v !== void 0 && (Se(Ue), Ue = v, localStorage.setItem(`${n}_blCam`, v.name), te(v, ze.current));
3721
3886
  } }),
3722
- /* @__PURE__ */ l.jsx(He, { camera: Le, options: he, ref: ce, onSelect: (p) => {
3723
- a.get(Le.name)?.dispose();
3724
- const m = n.get(p);
3725
- m !== void 0 && (pe(Le), Le = m, K(m, ce.current));
3887
+ /* @__PURE__ */ l.jsx(Ke, { camera: $e, options: pe, ref: Me, onSelect: (p) => {
3888
+ u.get($e.name)?.dispose();
3889
+ const v = o.get(p);
3890
+ v !== void 0 && (Se($e), $e = v, localStorage.setItem(`${n}_brCam`, v.name), te(v, Me.current));
3726
3891
  } })
3727
3892
  ] })
3728
3893
  ] }),
3729
3894
  /* @__PURE__ */ l.jsxs("div", { className: "settings", children: [
3730
3895
  /* @__PURE__ */ l.jsx(
3731
- Et,
3896
+ xt,
3732
3897
  {
3733
- index: I.indexOf(Y),
3734
- options: I,
3898
+ index: Q.indexOf($),
3899
+ options: Q,
3735
3900
  onSelect: (p) => {
3736
- p !== Y && (Pe(), Q(p));
3901
+ p !== $ && (it(), le(p));
3737
3902
  },
3738
- open: Fe,
3903
+ open: ge,
3739
3904
  onToggle: (p) => {
3740
- Oe(p), me && te(!1), ue && ve(!1);
3905
+ _e(p), je && Re(!1), Pe && De(!1);
3741
3906
  }
3742
3907
  }
3743
3908
  ),
3744
3909
  /* @__PURE__ */ l.jsx(
3745
- Et,
3910
+ xt,
3746
3911
  {
3747
- index: D.indexOf(bt),
3748
- options: D,
3912
+ index: re.indexOf(yt),
3913
+ options: re,
3749
3914
  onSelect: (p) => {
3750
- if (p !== bt)
3751
- switch (bt = p, bt) {
3915
+ if (p !== yt)
3916
+ switch (yt = p, yt) {
3752
3917
  case "Depth":
3753
- i.overrideMaterial = u;
3918
+ f.overrideMaterial = P;
3754
3919
  break;
3755
3920
  case "Normals":
3756
- i.overrideMaterial = v;
3921
+ f.overrideMaterial = V;
3757
3922
  break;
3758
3923
  default:
3759
3924
  case "Renderer":
3760
- i.overrideMaterial = null;
3925
+ f.overrideMaterial = null;
3761
3926
  break;
3762
3927
  case "Wireframe":
3763
- i.overrideMaterial = E;
3928
+ f.overrideMaterial = j;
3764
3929
  break;
3765
3930
  case "UVs":
3766
- i.overrideMaterial = b;
3931
+ f.overrideMaterial = U;
3767
3932
  break;
3768
3933
  }
3769
3934
  },
3770
- open: me,
3935
+ open: je,
3771
3936
  onToggle: (p) => {
3772
- Fe && Oe(!1), te(p), ue && ve(!1);
3937
+ ge && _e(!1), Re(p), Pe && De(!1);
3773
3938
  }
3774
3939
  }
3775
3940
  ),
3776
3941
  /* @__PURE__ */ l.jsx(
3777
- Et,
3942
+ xt,
3778
3943
  {
3779
3944
  index: 0,
3780
3945
  options: [
@@ -3782,11 +3947,11 @@ function bi(t) {
3782
3947
  "Selection Mode"
3783
3948
  ],
3784
3949
  onSelect: (p) => {
3785
- yt = p === "Selection Mode", d.visible = yt;
3950
+ Et = p === "Selection Mode", M.visible = Et;
3786
3951
  },
3787
- open: ue,
3952
+ open: Pe,
3788
3953
  onToggle: (p) => {
3789
- Fe && Oe(!1), me && te(!1), ve(p);
3954
+ ge && _e(!1), je && Re(!1), De(p);
3790
3955
  }
3791
3956
  }
3792
3957
  )
@@ -3794,7 +3959,7 @@ function bi(t) {
3794
3959
  ] })
3795
3960
  ] });
3796
3961
  }
3797
- function yi(t) {
3962
+ function Oi(t) {
3798
3963
  return /* @__PURE__ */ l.jsxs("div", { className: "editor", ref: t.ref, style: t.style, children: [
3799
3964
  /* @__PURE__ */ l.jsx("div", { className: "header", children: t.header }),
3800
3965
  t.children,
@@ -3802,42 +3967,44 @@ function yi(t) {
3802
3967
  ] });
3803
3968
  }
3804
3969
  export {
3805
- Lt as Accordion,
3806
- di as Application,
3807
- Ct as BaseRemote,
3808
- Mn as ChildObject,
3809
- _a as ContainerObject,
3810
- Ma as Draggable,
3811
- Oa as DraggableItem,
3812
- Ta as Dropdown,
3813
- Ra as DropdownItem,
3814
- yi as Editor,
3815
- qa as Inspector,
3816
- bi as MultiView,
3817
- On as NavButton,
3818
- ui as RemoteComponents,
3819
- mi as RemoteController,
3820
- Nt as RemoteTheatre,
3821
- fi as RemoteThree,
3822
- pi as RemoteTweakpane,
3823
- gi as SceneInspector,
3824
- vi as SidePanel,
3825
- k as ToolEvents,
3826
- lt as capitalize,
3827
- oi as clamp,
3828
- pa as colorToHex,
3829
- P as debugDispatcher,
3830
- si as defaultTheatreCallback,
3831
- xn as dispose,
3832
- va as disposeMaterial,
3833
- li as disposeTexture,
3834
- ci as distance,
3835
- Cn as hierarchyUUID,
3836
- fa as isColor,
3837
- Sn as noop,
3838
- ha as randomID,
3839
- ma as resetThreeObjects,
3840
- _t as round,
3841
- hi as theatreEditorApp,
3842
- jt as totalThreeObjects
3970
+ Ft as Accordion,
3971
+ vi as Application,
3972
+ wt as BaseRemote,
3973
+ Rn as ChildObject,
3974
+ ka as ContainerObject,
3975
+ Ra as Draggable,
3976
+ _a as DraggableItem,
3977
+ Pa as Dropdown,
3978
+ Aa as DropdownItem,
3979
+ Oi as Editor,
3980
+ ti as Inspector,
3981
+ wi as MultiView,
3982
+ _n as NavButton,
3983
+ gi as RemoteComponents,
3984
+ xi as RemoteController,
3985
+ Lt as RemoteTheatre,
3986
+ yi as RemoteThree,
3987
+ Ei as RemoteTweakpane,
3988
+ Si as SceneInspector,
3989
+ Ci as SidePanel,
3990
+ I as ToolEvents,
3991
+ St as capitalize,
3992
+ Xe as clamp,
3993
+ ga as colorToHex,
3994
+ D as debugDispatcher,
3995
+ fi as defaultTheatreCallback,
3996
+ Mn as dispose,
3997
+ ya as disposeMaterial,
3998
+ mi as disposeTexture,
3999
+ pi as distance,
4000
+ On as hierarchyUUID,
4001
+ va as isColor,
4002
+ Wt as mix,
4003
+ wn as noop,
4004
+ Ht as normalize,
4005
+ ma as randomID,
4006
+ ba as resetThreeObjects,
4007
+ ht as round,
4008
+ bi as theatreEditorApp,
4009
+ Dt as totalThreeObjects
3843
4010
  };