@tomorrowevening/hermes 0.0.8 → 0.0.9

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