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