@tomorrowevening/hermes 0.0.63 → 0.0.65
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.cjs.js +13 -13
- package/dist/hermes.es.js +784 -773
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/types/core/remote/RemoteTheatre.d.ts +5 -4
package/dist/hermes.es.js
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
import { EventDispatcher as hn, Texture as fn, CubeTexture as Wn, RepeatWrapping as Yt, WebGLRenderTarget as Hn, Color as Bt, FrontSide as Yn, BackSide as mn, DoubleSide as pn, NoBlending as Vn, NormalBlending as qn, AdditiveBlending as Kn, SubtractiveBlending as Zn, MultiplyBlending as Xn, CustomBlending as Jn, AddEquation as Qn, SubtractEquation as ea, ReverseSubtractEquation as ta, MinEquation as na, MaxEquation as aa, ZeroFactor as gn, OneFactor as vn, SrcColorFactor as bn, OneMinusSrcColorFactor as yn, SrcAlphaFactor as xn, OneMinusSrcAlphaFactor as En, DstAlphaFactor as Cn, OneMinusDstAlphaFactor as Sn, DstColorFactor as wn, OneMinusDstColorFactor as Mn, SrcAlphaSaturateFactor as ia, ConstantColorFactor as On, OneMinusConstantColorFactor as Tn, ConstantAlphaFactor as _n, OneMinusConstantAlphaFactor as Rn, Matrix4 as ra, Vector3 as Y, Euler as sa, Line as oa, BufferGeometry as Vt, Float32BufferAttribute as qt, LineBasicMaterial as ca, Mesh as
|
1
|
+
import { EventDispatcher as hn, Texture as fn, CubeTexture as Wn, RepeatWrapping as Yt, WebGLRenderTarget as Hn, Color as Bt, FrontSide as Yn, BackSide as mn, DoubleSide as pn, NoBlending as Vn, NormalBlending as qn, AdditiveBlending as Kn, SubtractiveBlending as Zn, MultiplyBlending as Xn, CustomBlending as Jn, AddEquation as Qn, SubtractEquation as ea, ReverseSubtractEquation as ta, MinEquation as na, MaxEquation as aa, ZeroFactor as gn, OneFactor as vn, SrcColorFactor as bn, OneMinusSrcColorFactor as yn, SrcAlphaFactor as xn, OneMinusSrcAlphaFactor as En, DstAlphaFactor as Cn, OneMinusDstAlphaFactor as Sn, DstColorFactor as wn, OneMinusDstColorFactor as Mn, SrcAlphaSaturateFactor as ia, ConstantColorFactor as On, OneMinusConstantColorFactor as Tn, ConstantAlphaFactor as _n, OneMinusConstantAlphaFactor as Rn, Matrix4 as ra, Vector3 as Y, Euler as sa, Line as oa, BufferGeometry as Vt, Float32BufferAttribute as qt, LineBasicMaterial as ca, Mesh as kn, MeshBasicMaterial as Pn, Ray as la, Plane as ua, MathUtils as da, MOUSE as nt, TOUCH as at, Quaternion as Kt, Spherical as Zt, Vector2 as fe, ShaderMaterial as jn, GLSL3 as ha, PlaneGeometry as fa, Scene as ma, Group as pa, AxesHelper as Xt, MeshDepthMaterial as ga, MeshNormalMaterial as va, WebGLRenderer as ba, PerspectiveCamera as Pt, Raycaster as ya, OrthographicCamera as Jt, CameraHelper as xa, SpotLightHelper as Ea, PointLightHelper as Ca, HemisphereLightHelper as Sa, DirectionalLightHelper as wa } from "three";
|
2
2
|
import { Pane as Ma } from "tweakpane";
|
3
3
|
import * as Oa from "@tweakpane/plugin-essentials";
|
4
|
-
import
|
5
|
-
import { Reorder as
|
4
|
+
import Dn, { useState as X, useRef as q, useEffect as _e, useMemo as ie, forwardRef as Ta } from "react";
|
5
|
+
import { Reorder as An } from "framer-motion";
|
6
6
|
const Ft = () => {
|
7
|
-
},
|
7
|
+
}, ki = () => {
|
8
8
|
};
|
9
9
|
function Mt(e) {
|
10
10
|
return e.substring(0, 1).toUpperCase() + e.substring(1);
|
@@ -18,7 +18,7 @@ function Qt(e, n, a) {
|
|
18
18
|
function en(e, n, a) {
|
19
19
|
return e * (1 - a) + n * a;
|
20
20
|
}
|
21
|
-
function
|
21
|
+
function Pi(e, n) {
|
22
22
|
const a = e - n;
|
23
23
|
return Math.sqrt(a * a);
|
24
24
|
}
|
@@ -28,18 +28,18 @@ function _a() {
|
|
28
28
|
function Ra(e) {
|
29
29
|
return e.r !== void 0 && e.g !== void 0 && e.b !== void 0;
|
30
30
|
}
|
31
|
-
function
|
31
|
+
function ka(e) {
|
32
32
|
const n = Math.round(e.r * 255), a = Math.round(e.g * 255), t = Math.round(e.b * 255), i = (d) => {
|
33
33
|
const h = d.toString(16);
|
34
34
|
return h.length === 1 ? "0" + h : h;
|
35
|
-
},
|
36
|
-
return "#" +
|
35
|
+
}, o = i(n), u = i(a), c = i(t);
|
36
|
+
return "#" + o + u + c;
|
37
37
|
}
|
38
38
|
function tn(e, n = 1) {
|
39
39
|
return Number(e.toFixed(n));
|
40
40
|
}
|
41
41
|
let It = 0;
|
42
|
-
const
|
42
|
+
const Pa = () => {
|
43
43
|
It = 0;
|
44
44
|
}, In = (e) => {
|
45
45
|
if (!e)
|
@@ -65,7 +65,7 @@ const ka = () => {
|
|
65
65
|
e.dispose !== void 0 && e.dispose();
|
66
66
|
}
|
67
67
|
};
|
68
|
-
class
|
68
|
+
class Di {
|
69
69
|
components = /* @__PURE__ */ new Map();
|
70
70
|
listen;
|
71
71
|
// Protected
|
@@ -123,7 +123,7 @@ class Ai {
|
|
123
123
|
n && (this._mode = "editor");
|
124
124
|
}
|
125
125
|
}
|
126
|
-
const j = new hn(),
|
126
|
+
const j = new hn(), D = {
|
127
127
|
CUSTOM: "ToolEvents::custom",
|
128
128
|
// Components
|
129
129
|
SELECT_DROPDOWN: "ToolEvents::selectDropdown",
|
@@ -151,7 +151,7 @@ class Ot {
|
|
151
151
|
handleEditor(n, a, t) {
|
152
152
|
}
|
153
153
|
}
|
154
|
-
class
|
154
|
+
class Ai extends Ot {
|
155
155
|
selectDropdown(n, a) {
|
156
156
|
this.app.send({
|
157
157
|
event: "selectComponent",
|
@@ -175,10 +175,10 @@ class Di extends Ot {
|
|
175
175
|
handleApp(n, a, t) {
|
176
176
|
switch (t.event) {
|
177
177
|
case "selectComponent":
|
178
|
-
j.dispatchEvent({ type:
|
178
|
+
j.dispatchEvent({ type: D.SELECT_DROPDOWN, value: t.data });
|
179
179
|
break;
|
180
180
|
case "draggableListUpdate":
|
181
|
-
j.dispatchEvent({ type:
|
181
|
+
j.dispatchEvent({ type: D.DRAG_UPDATE, value: t.data });
|
182
182
|
break;
|
183
183
|
}
|
184
184
|
}
|
@@ -195,30 +195,36 @@ class $t extends Ot {
|
|
195
195
|
dispose() {
|
196
196
|
this.project = void 0, this.sheets = /* @__PURE__ */ new Map(), this.sheetObjects = /* @__PURE__ */ new Map(), this.sheetObjectCBs = /* @__PURE__ */ new Map(), this.sheetObjectUnsubscribe = /* @__PURE__ */ new Map();
|
197
197
|
}
|
198
|
+
getSheetInstance(n, a) {
|
199
|
+
return a !== void 0 ? `${n}-${a}` : n;
|
200
|
+
}
|
198
201
|
sheet(n, a) {
|
199
202
|
if (this.project === void 0) {
|
200
203
|
console.error("Theatre Project hasn't been created yet.");
|
201
204
|
return;
|
202
205
|
}
|
203
|
-
|
204
|
-
|
206
|
+
const t = this.getSheetInstance(n, a);
|
207
|
+
let i = this.sheets.get(t);
|
208
|
+
return i !== void 0 || (i = this.project?.sheet(n, a), this.sheets.set(t, i)), i;
|
205
209
|
}
|
206
|
-
playSheet(n, a) {
|
207
|
-
this.sheet(n)?.sequence.play(a), this.app.send({
|
210
|
+
playSheet(n, a, t) {
|
211
|
+
this.sheet(n, t)?.sequence.play(a), this.app.send({
|
208
212
|
event: "playSheet",
|
209
213
|
target: "editor",
|
210
214
|
data: {
|
211
215
|
sheet: n,
|
216
|
+
instance: t,
|
212
217
|
value: a
|
213
218
|
}
|
214
219
|
});
|
215
220
|
}
|
216
|
-
pauseSheet(n) {
|
221
|
+
pauseSheet(n, a) {
|
217
222
|
this.sheet(n)?.sequence.pause(), this.app.send({
|
218
223
|
event: "pauseSheet",
|
219
224
|
target: "editor",
|
220
225
|
data: {
|
221
|
-
sheet: n
|
226
|
+
sheet: n,
|
227
|
+
instance: a
|
222
228
|
}
|
223
229
|
});
|
224
230
|
}
|
@@ -227,26 +233,26 @@ class $t extends Ot {
|
|
227
233
|
t.search(`${n}_`) > -1 && this.unsubscribe(a);
|
228
234
|
});
|
229
235
|
}
|
230
|
-
sheetObject(n, a, t, i) {
|
236
|
+
sheetObject(n, a, t, i, o) {
|
231
237
|
if (this.project === void 0) {
|
232
238
|
console.error("Theatre Project hasn't been created yet.");
|
233
239
|
return;
|
234
240
|
}
|
235
|
-
const
|
236
|
-
if (
|
241
|
+
const u = this.sheet(n, o);
|
242
|
+
if (u === void 0)
|
237
243
|
return;
|
238
|
-
const
|
239
|
-
let
|
240
|
-
|
241
|
-
const
|
244
|
+
const d = `${this.getSheetInstance(n, o)}_${a}`;
|
245
|
+
let h = this.sheetObjects.get(d);
|
246
|
+
h !== void 0 ? h = u.object(a, { ...t, ...h.value }, { reconfigure: !0 }) : h = u.object(a, t), this.sheetObjects.set(d, h), this.sheetObjectCBs.set(d, i !== void 0 ? i : Ft);
|
247
|
+
const f = h.onValuesChange((m) => {
|
242
248
|
if (this.app.editor) {
|
243
|
-
for (const
|
244
|
-
const
|
245
|
-
typeof
|
246
|
-
r:
|
247
|
-
g:
|
248
|
-
b:
|
249
|
-
a:
|
249
|
+
for (const M in m) {
|
250
|
+
const L = m[M];
|
251
|
+
typeof L == "object" && Ra(L) && (m[M] = {
|
252
|
+
r: L.r,
|
253
|
+
g: L.g,
|
254
|
+
b: L.b,
|
255
|
+
a: L.a
|
250
256
|
});
|
251
257
|
}
|
252
258
|
this.app.send({
|
@@ -254,15 +260,15 @@ class $t extends Ot {
|
|
254
260
|
target: "app",
|
255
261
|
data: {
|
256
262
|
sheet: n,
|
257
|
-
sheetObject:
|
258
|
-
values:
|
263
|
+
sheetObject: d,
|
264
|
+
values: m
|
259
265
|
}
|
260
266
|
});
|
261
267
|
}
|
262
|
-
const
|
263
|
-
|
268
|
+
const x = this.sheetObjectCBs.get(d);
|
269
|
+
x !== void 0 && x(m);
|
264
270
|
});
|
265
|
-
return this.sheetObjectUnsubscribe.set(
|
271
|
+
return this.sheetObjectUnsubscribe.set(d, f), h;
|
266
272
|
}
|
267
273
|
unsubscribe(n) {
|
268
274
|
if (this.project === void 0) {
|
@@ -271,24 +277,24 @@ class $t extends Ot {
|
|
271
277
|
}
|
272
278
|
const a = n.address.sheetId, t = n.address.objectKey;
|
273
279
|
this.sheets.get(a)?.detachObject(t);
|
274
|
-
const
|
275
|
-
u !== void 0 && (this.sheetObjects.delete(
|
280
|
+
const o = `${a}_${t}`, u = this.sheetObjectUnsubscribe.get(o);
|
281
|
+
u !== void 0 && (this.sheetObjects.delete(o), this.sheetObjectCBs.delete(o), this.sheetObjectUnsubscribe.delete(o), u());
|
276
282
|
}
|
277
283
|
handleApp(n, a, t) {
|
278
284
|
const i = a;
|
279
|
-
let
|
285
|
+
let o;
|
280
286
|
switch (t.event) {
|
281
287
|
case "setSheet":
|
282
|
-
|
288
|
+
o = i.sheets.get(t.data.sheet), o !== void 0 && (i.activeSheet = o, this.studio?.setSelection([o]));
|
283
289
|
break;
|
284
290
|
case "setSheetObject":
|
285
|
-
|
291
|
+
o = i.sheetObjects.get(`${t.data.sheet}_${t.data.key}`), o !== void 0 && this.studio?.setSelection([o]);
|
286
292
|
break;
|
287
293
|
case "updateSheetObject":
|
288
|
-
|
294
|
+
o = i.sheets.get(t.data.sheet), o !== void 0 && o.sequence.pause(), o = i.sheetObjectCBs.get(t.data.sheetObject), o !== void 0 && o(t.data.values);
|
289
295
|
break;
|
290
296
|
case "updateTimeline":
|
291
|
-
|
297
|
+
o = i.sheets.get(t.data.sheet), i.activeSheet !== void 0 && (i.activeSheet.sequence.position = t.data.position);
|
292
298
|
break;
|
293
299
|
}
|
294
300
|
}
|
@@ -297,10 +303,10 @@ class $t extends Ot {
|
|
297
303
|
const i = a;
|
298
304
|
switch (t.event) {
|
299
305
|
case "playSheet":
|
300
|
-
i.sheet(t.data.sheet)?.sequence.play(t.data.value);
|
306
|
+
i.sheet(t.data.sheet, t.data.instance)?.sequence.play(t.data.value);
|
301
307
|
break;
|
302
308
|
case "pauseSheet":
|
303
|
-
i.sheet(t.data.sheet)?.sequence.pause();
|
309
|
+
i.sheet(t.data.sheet, t.data.instance)?.sequence.pause();
|
304
310
|
break;
|
305
311
|
}
|
306
312
|
}
|
@@ -308,20 +314,20 @@ class $t extends Ot {
|
|
308
314
|
handleEditorApp(n, a) {
|
309
315
|
if (n.editor) {
|
310
316
|
this.studio?.ui.restore(), this.studio?.onSelectionChange((u) => {
|
311
|
-
u.length < 1 || u.forEach((
|
312
|
-
let d =
|
313
|
-
switch (
|
317
|
+
u.length < 1 || u.forEach((c) => {
|
318
|
+
let d = c.address.sheetId, h = "setSheet", f = {};
|
319
|
+
switch (c.type) {
|
314
320
|
case "Theatre_Sheet_PublicAPI":
|
315
321
|
h = "setSheet", f = {
|
316
|
-
sheet:
|
317
|
-
}, a.activeSheet = a.sheets.get(
|
322
|
+
sheet: c.address.sheetId
|
323
|
+
}, a.activeSheet = a.sheets.get(c.address.sheetId);
|
318
324
|
break;
|
319
325
|
case "Theatre_SheetObject_PublicAPI":
|
320
|
-
h = "setSheetObject", d += `_${
|
326
|
+
h = "setSheetObject", d += `_${c.address.objectKey}`, f = {
|
321
327
|
id: d,
|
322
|
-
sheet:
|
323
|
-
key:
|
324
|
-
}, a.activeSheet = a.sheets.get(
|
328
|
+
sheet: c.address.sheetId,
|
329
|
+
key: c.address.objectKey
|
330
|
+
}, a.activeSheet = a.sheets.get(c.address.sheetId);
|
325
331
|
break;
|
326
332
|
}
|
327
333
|
n.send({ event: h, target: "app", data: f });
|
@@ -341,10 +347,10 @@ class $t extends Ot {
|
|
341
347
|
}
|
342
348
|
});
|
343
349
|
}
|
344
|
-
},
|
345
|
-
i(), requestAnimationFrame(
|
350
|
+
}, o = () => {
|
351
|
+
i(), requestAnimationFrame(o);
|
346
352
|
};
|
347
|
-
i(),
|
353
|
+
i(), o();
|
348
354
|
} else
|
349
355
|
this.studio?.ui.hide();
|
350
356
|
}
|
@@ -352,20 +358,20 @@ class $t extends Ot {
|
|
352
358
|
function Ii(e, n, a) {
|
353
359
|
if (e.editor) {
|
354
360
|
a.ui.restore(), a.onSelectionChange((u) => {
|
355
|
-
u.length < 1 || u.forEach((
|
356
|
-
let d =
|
357
|
-
switch (
|
361
|
+
u.length < 1 || u.forEach((c) => {
|
362
|
+
let d = c.address.sheetId, h = "setSheet", f = {};
|
363
|
+
switch (c.type) {
|
358
364
|
case "Theatre_Sheet_PublicAPI":
|
359
365
|
h = "setSheet", f = {
|
360
|
-
sheet:
|
361
|
-
}, n.activeSheet = n.sheets.get(
|
366
|
+
sheet: c.address.sheetId
|
367
|
+
}, n.activeSheet = n.sheets.get(c.address.sheetId);
|
362
368
|
break;
|
363
369
|
case "Theatre_SheetObject_PublicAPI":
|
364
|
-
h = "setSheetObject", d += `_${
|
370
|
+
h = "setSheetObject", d += `_${c.address.objectKey}`, f = {
|
365
371
|
id: d,
|
366
|
-
sheet:
|
367
|
-
key:
|
368
|
-
}, n.activeSheet = n.sheets.get(
|
372
|
+
sheet: c.address.sheetId,
|
373
|
+
key: c.address.objectKey
|
374
|
+
}, n.activeSheet = n.sheets.get(c.address.sheetId);
|
369
375
|
break;
|
370
376
|
}
|
371
377
|
e.send({ event: h, target: "app", data: f });
|
@@ -385,14 +391,14 @@ function Ii(e, n, a) {
|
|
385
391
|
}
|
386
392
|
});
|
387
393
|
}
|
388
|
-
},
|
389
|
-
i(), requestAnimationFrame(
|
394
|
+
}, o = () => {
|
395
|
+
i(), requestAnimationFrame(o);
|
390
396
|
};
|
391
|
-
i(),
|
397
|
+
i(), o();
|
392
398
|
} else
|
393
399
|
a.ui.hide();
|
394
400
|
}
|
395
|
-
function
|
401
|
+
function Da(e) {
|
396
402
|
if (e.name === "cameras")
|
397
403
|
return "camera";
|
398
404
|
if (e.name === "interactive")
|
@@ -417,7 +423,7 @@ function Nn(e) {
|
|
417
423
|
n.children.push(Nn(a));
|
418
424
|
}), n;
|
419
425
|
}
|
420
|
-
function
|
426
|
+
function Aa(e) {
|
421
427
|
const n = {};
|
422
428
|
for (const a in e) {
|
423
429
|
const t = e[a].value;
|
@@ -453,12 +459,12 @@ function it(e) {
|
|
453
459
|
if (i !== null)
|
454
460
|
if (n[a] = i, i.isTexture)
|
455
461
|
if (i instanceof fn) {
|
456
|
-
const
|
457
|
-
n[a] = { src:
|
462
|
+
const o = i.source.toJSON();
|
463
|
+
n[a] = { src: o.url };
|
458
464
|
} else
|
459
465
|
i instanceof Wn && (console.log("env map"), console.log(i.source.data), console.log(i.source.toJSON()), n[a] = { src: "" });
|
460
466
|
else
|
461
|
-
a === "uniforms" && (n[a] =
|
467
|
+
a === "uniforms" && (n[a] = Aa(n[a]));
|
462
468
|
else
|
463
469
|
n[a] = { src: "" };
|
464
470
|
break;
|
@@ -492,8 +498,8 @@ function jt(e) {
|
|
492
498
|
const t = e;
|
493
499
|
if (Array.isArray(t.material)) {
|
494
500
|
const i = [];
|
495
|
-
t.material.forEach((
|
496
|
-
i.push(it(
|
501
|
+
t.material.forEach((o) => {
|
502
|
+
i.push(it(o));
|
497
503
|
}), n.material = i;
|
498
504
|
} else
|
499
505
|
n.material = it(t.material);
|
@@ -501,8 +507,8 @@ function jt(e) {
|
|
501
507
|
const t = e;
|
502
508
|
if (Array.isArray(t.material)) {
|
503
509
|
const i = [];
|
504
|
-
t.material.forEach((
|
505
|
-
i.push(it(
|
510
|
+
t.material.forEach((o) => {
|
511
|
+
i.push(it(o));
|
506
512
|
}), n.material = i;
|
507
513
|
} else
|
508
514
|
n.material = it(t.material);
|
@@ -510,8 +516,8 @@ function jt(e) {
|
|
510
516
|
const t = e;
|
511
517
|
if (Array.isArray(t.material)) {
|
512
518
|
const i = [];
|
513
|
-
t.material.forEach((
|
514
|
-
i.push(it(
|
519
|
+
t.material.forEach((o) => {
|
520
|
+
i.push(it(o));
|
515
521
|
}), n.material = i;
|
516
522
|
} else
|
517
523
|
n.material = it(t.material);
|
@@ -679,7 +685,7 @@ class Ni extends Ot {
|
|
679
685
|
setScene(n) {
|
680
686
|
if (n === void 0 || (this.scene = n, !this.app.debugEnabled))
|
681
687
|
return;
|
682
|
-
|
688
|
+
Pa(), In(this.scene);
|
683
689
|
const a = Nn(this.scene);
|
684
690
|
this.app.send({
|
685
691
|
event: "setScene",
|
@@ -710,32 +716,32 @@ class Ni extends Ot {
|
|
710
716
|
handleApp(n, a, t) {
|
711
717
|
switch (t.event) {
|
712
718
|
case "getObject":
|
713
|
-
j.dispatchEvent({ type:
|
719
|
+
j.dispatchEvent({ type: D.GET_OBJECT, value: t.data });
|
714
720
|
break;
|
715
721
|
case "updateObject":
|
716
|
-
j.dispatchEvent({ type:
|
722
|
+
j.dispatchEvent({ type: D.UPDATE_OBJECT, value: t.data });
|
717
723
|
break;
|
718
724
|
case "createTexture":
|
719
|
-
j.dispatchEvent({ type:
|
725
|
+
j.dispatchEvent({ type: D.CREATE_TEXTURE, value: t.data });
|
720
726
|
break;
|
721
727
|
case "requestMethod":
|
722
|
-
j.dispatchEvent({ type:
|
728
|
+
j.dispatchEvent({ type: D.REQUEST_METHOD, value: t.data });
|
723
729
|
break;
|
724
730
|
}
|
725
731
|
}
|
726
732
|
handleEditor(n, a, t) {
|
727
733
|
switch (t.event) {
|
728
734
|
case "setObject":
|
729
|
-
j.dispatchEvent({ type:
|
735
|
+
j.dispatchEvent({ type: D.SET_OBJECT, value: t.data });
|
730
736
|
break;
|
731
737
|
case "setScene":
|
732
|
-
j.dispatchEvent({ type:
|
738
|
+
j.dispatchEvent({ type: D.SET_SCENE, value: t.data });
|
733
739
|
break;
|
734
740
|
case "addCamera":
|
735
|
-
j.dispatchEvent({ type:
|
741
|
+
j.dispatchEvent({ type: D.ADD_CAMERA, value: t.data });
|
736
742
|
break;
|
737
743
|
case "removeCamera":
|
738
|
-
j.dispatchEvent({ type:
|
744
|
+
j.dispatchEvent({ type: D.REMOVE_CAMERA, value: t.data });
|
739
745
|
break;
|
740
746
|
}
|
741
747
|
}
|
@@ -805,13 +811,13 @@ class Li extends Ot {
|
|
805
811
|
}
|
806
812
|
// Binding
|
807
813
|
bind(n, a, t, i = void 0) {
|
808
|
-
const
|
809
|
-
this.bindCBs.set(
|
814
|
+
const o = this.bindID, u = t.onChange !== void 0 ? t.onChange : Ft;
|
815
|
+
this.bindCBs.set(o, u), this.app.editor ? (this.pane === void 0 && this.createGUI(), (i !== void 0 ? i : this.pane).addBinding(n, a, t).on("change", (d) => {
|
810
816
|
this.app.send({
|
811
817
|
event: "updateBind",
|
812
818
|
target: "app",
|
813
819
|
data: {
|
814
|
-
id:
|
820
|
+
id: o,
|
815
821
|
value: d.value
|
816
822
|
}
|
817
823
|
});
|
@@ -819,7 +825,7 @@ class Li extends Ot {
|
|
819
825
|
event: "bindObject",
|
820
826
|
target: "app",
|
821
827
|
data: {
|
822
|
-
id:
|
828
|
+
id: o,
|
823
829
|
name: a,
|
824
830
|
params: t,
|
825
831
|
parent: i
|
@@ -901,16 +907,16 @@ function Ba() {
|
|
901
907
|
if (nn)
|
902
908
|
return lt;
|
903
909
|
nn = 1;
|
904
|
-
var e =
|
905
|
-
function u(
|
906
|
-
var f, m = {}, x = null,
|
907
|
-
h !== void 0 && (x = "" + h), d.key !== void 0 && (x = "" + d.key), d.ref !== void 0 && (
|
910
|
+
var e = Dn, n = Symbol.for("react.element"), a = Symbol.for("react.fragment"), t = Object.prototype.hasOwnProperty, i = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, o = { key: !0, ref: !0, __self: !0, __source: !0 };
|
911
|
+
function u(c, d, h) {
|
912
|
+
var f, m = {}, x = null, M = null;
|
913
|
+
h !== void 0 && (x = "" + h), d.key !== void 0 && (x = "" + d.key), d.ref !== void 0 && (M = d.ref);
|
908
914
|
for (f in d)
|
909
|
-
t.call(d, f) && !
|
910
|
-
if (
|
911
|
-
for (f in d =
|
915
|
+
t.call(d, f) && !o.hasOwnProperty(f) && (m[f] = d[f]);
|
916
|
+
if (c && c.defaultProps)
|
917
|
+
for (f in d = c.defaultProps, d)
|
912
918
|
m[f] === void 0 && (m[f] = d[f]);
|
913
|
-
return { $$typeof: n, type:
|
919
|
+
return { $$typeof: n, type: c, key: x, ref: M, props: m, _owner: i.current };
|
914
920
|
}
|
915
921
|
return lt.Fragment = a, lt.jsx = u, lt.jsxs = u, lt;
|
916
922
|
}
|
@@ -927,15 +933,15 @@ var ut = {};
|
|
927
933
|
var an;
|
928
934
|
function Fa() {
|
929
935
|
return an || (an = 1, process.env.NODE_ENV !== "production" && function() {
|
930
|
-
var e =
|
936
|
+
var e = Dn, n = Symbol.for("react.element"), a = Symbol.for("react.portal"), t = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), o = Symbol.for("react.profiler"), u = Symbol.for("react.provider"), c = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), h = Symbol.for("react.suspense"), f = Symbol.for("react.suspense_list"), m = Symbol.for("react.memo"), x = Symbol.for("react.lazy"), M = Symbol.for("react.offscreen"), L = Symbol.iterator, te = "@@iterator";
|
931
937
|
function me(r) {
|
932
938
|
if (r === null || typeof r != "object")
|
933
939
|
return null;
|
934
|
-
var p =
|
940
|
+
var p = L && r[L] || r[te];
|
935
941
|
return typeof p == "function" ? p : null;
|
936
942
|
}
|
937
943
|
var re = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
938
|
-
function
|
944
|
+
function z(r) {
|
939
945
|
{
|
940
946
|
for (var p = arguments.length, b = new Array(p > 1 ? p - 1 : 0), S = 1; S < p; S++)
|
941
947
|
b[S - 1] = arguments[S];
|
@@ -944,29 +950,29 @@ function Fa() {
|
|
944
950
|
}
|
945
951
|
function I(r, p, b) {
|
946
952
|
{
|
947
|
-
var S = re.ReactDebugCurrentFrame,
|
948
|
-
|
949
|
-
var
|
950
|
-
return String(
|
953
|
+
var S = re.ReactDebugCurrentFrame, B = S.getStackAddendum();
|
954
|
+
B !== "" && (p += "%s", b = b.concat([B]));
|
955
|
+
var $ = b.map(function(P) {
|
956
|
+
return String(P);
|
951
957
|
});
|
952
|
-
|
958
|
+
$.unshift("Warning: " + p), Function.prototype.apply.call(console[r], console, $);
|
953
959
|
}
|
954
960
|
}
|
955
|
-
var
|
956
|
-
|
957
|
-
function
|
958
|
-
return !!(typeof r == "string" || typeof r == "function" || r === t || r ===
|
961
|
+
var K = !1, ne = !1, Se = !1, G = !1, pe = !1, oe;
|
962
|
+
oe = Symbol.for("react.module.reference");
|
963
|
+
function Re(r) {
|
964
|
+
return !!(typeof r == "string" || typeof r == "function" || r === t || r === o || pe || r === i || r === h || r === f || G || r === M || K || ne || Se || typeof r == "object" && r !== null && (r.$$typeof === x || r.$$typeof === m || r.$$typeof === u || r.$$typeof === c || r.$$typeof === d || // This needs to include all possible module reference object
|
959
965
|
// types supported by any Flight configuration anywhere since
|
960
966
|
// we don't know which Flight build this will end up being used
|
961
967
|
// with.
|
962
|
-
r.$$typeof ===
|
968
|
+
r.$$typeof === oe || r.getModuleId !== void 0));
|
963
969
|
}
|
964
|
-
function
|
970
|
+
function ke(r, p, b) {
|
965
971
|
var S = r.displayName;
|
966
972
|
if (S)
|
967
973
|
return S;
|
968
|
-
var
|
969
|
-
return
|
974
|
+
var B = p.displayName || p.name || "";
|
975
|
+
return B !== "" ? b + "(" + B + ")" : b;
|
970
976
|
}
|
971
977
|
function ve(r) {
|
972
978
|
return r.displayName || "Context";
|
@@ -974,7 +980,7 @@ function Fa() {
|
|
974
980
|
function N(r) {
|
975
981
|
if (r == null)
|
976
982
|
return null;
|
977
|
-
if (typeof r.tag == "number" &&
|
983
|
+
if (typeof r.tag == "number" && z("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof r == "function")
|
978
984
|
return r.displayName || r.name || null;
|
979
985
|
if (typeof r == "string")
|
980
986
|
return r;
|
@@ -983,7 +989,7 @@ function Fa() {
|
|
983
989
|
return "Fragment";
|
984
990
|
case a:
|
985
991
|
return "Portal";
|
986
|
-
case
|
992
|
+
case o:
|
987
993
|
return "Profiler";
|
988
994
|
case i:
|
989
995
|
return "StrictMode";
|
@@ -994,21 +1000,21 @@ function Fa() {
|
|
994
1000
|
}
|
995
1001
|
if (typeof r == "object")
|
996
1002
|
switch (r.$$typeof) {
|
997
|
-
case
|
1003
|
+
case c:
|
998
1004
|
var p = r;
|
999
1005
|
return ve(p) + ".Consumer";
|
1000
1006
|
case u:
|
1001
1007
|
var b = r;
|
1002
1008
|
return ve(b._context) + ".Provider";
|
1003
1009
|
case d:
|
1004
|
-
return
|
1010
|
+
return ke(r, r.render, "ForwardRef");
|
1005
1011
|
case m:
|
1006
1012
|
var S = r.displayName || null;
|
1007
1013
|
return S !== null ? S : N(r.type) || "Memo";
|
1008
1014
|
case x: {
|
1009
|
-
var
|
1015
|
+
var B = r, $ = B._payload, P = B._init;
|
1010
1016
|
try {
|
1011
|
-
return N(
|
1017
|
+
return N(P($));
|
1012
1018
|
} catch {
|
1013
1019
|
return null;
|
1014
1020
|
}
|
@@ -1016,14 +1022,14 @@ function Fa() {
|
|
1016
1022
|
}
|
1017
1023
|
return null;
|
1018
1024
|
}
|
1019
|
-
var be = Object.assign,
|
1025
|
+
var be = Object.assign, O = 0, we, Pe, Ae, je, De, Ie, Be;
|
1020
1026
|
function Fe() {
|
1021
1027
|
}
|
1022
1028
|
Fe.__reactDisabledLog = !0;
|
1023
1029
|
function ae() {
|
1024
1030
|
{
|
1025
|
-
if (
|
1026
|
-
we = console.log, Pe = console.info,
|
1031
|
+
if (O === 0) {
|
1032
|
+
we = console.log, Pe = console.info, Ae = console.warn, je = console.error, De = console.group, Ie = console.groupCollapsed, Be = console.groupEnd;
|
1027
1033
|
var r = {
|
1028
1034
|
configurable: !0,
|
1029
1035
|
enumerable: !0,
|
@@ -1040,12 +1046,12 @@ function Fa() {
|
|
1040
1046
|
groupEnd: r
|
1041
1047
|
});
|
1042
1048
|
}
|
1043
|
-
|
1049
|
+
O++;
|
1044
1050
|
}
|
1045
1051
|
}
|
1046
1052
|
function Me() {
|
1047
1053
|
{
|
1048
|
-
if (
|
1054
|
+
if (O--, O === 0) {
|
1049
1055
|
var r = {
|
1050
1056
|
configurable: !0,
|
1051
1057
|
enumerable: !0,
|
@@ -1059,13 +1065,13 @@ function Fa() {
|
|
1059
1065
|
value: Pe
|
1060
1066
|
}),
|
1061
1067
|
warn: be({}, r, {
|
1062
|
-
value:
|
1068
|
+
value: Ae
|
1063
1069
|
}),
|
1064
1070
|
error: be({}, r, {
|
1065
|
-
value:
|
1071
|
+
value: je
|
1066
1072
|
}),
|
1067
1073
|
group: be({}, r, {
|
1068
|
-
value:
|
1074
|
+
value: De
|
1069
1075
|
}),
|
1070
1076
|
groupCollapsed: be({}, r, {
|
1071
1077
|
value: Ie
|
@@ -1075,17 +1081,17 @@ function Fa() {
|
|
1075
1081
|
})
|
1076
1082
|
});
|
1077
1083
|
}
|
1078
|
-
|
1084
|
+
O < 0 && z("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
1079
1085
|
}
|
1080
1086
|
}
|
1081
1087
|
var He = re.ReactCurrentDispatcher, Ye;
|
1082
|
-
function
|
1088
|
+
function le(r, p, b) {
|
1083
1089
|
{
|
1084
1090
|
if (Ye === void 0)
|
1085
1091
|
try {
|
1086
1092
|
throw Error();
|
1087
|
-
} catch (
|
1088
|
-
var S =
|
1093
|
+
} catch (B) {
|
1094
|
+
var S = B.stack.trim().match(/\n( *(at )?)/);
|
1089
1095
|
Ye = S && S[1] || "";
|
1090
1096
|
}
|
1091
1097
|
return `
|
@@ -1097,7 +1103,7 @@ function Fa() {
|
|
1097
1103
|
var w = typeof WeakMap == "function" ? WeakMap : Map;
|
1098
1104
|
v = new w();
|
1099
1105
|
}
|
1100
|
-
function
|
1106
|
+
function k(r, p) {
|
1101
1107
|
if (!r || g)
|
1102
1108
|
return "";
|
1103
1109
|
{
|
@@ -1107,33 +1113,33 @@ function Fa() {
|
|
1107
1113
|
}
|
1108
1114
|
var S;
|
1109
1115
|
g = !0;
|
1110
|
-
var
|
1116
|
+
var B = Error.prepareStackTrace;
|
1111
1117
|
Error.prepareStackTrace = void 0;
|
1112
|
-
var
|
1113
|
-
|
1118
|
+
var $;
|
1119
|
+
$ = He.current, He.current = null, ae();
|
1114
1120
|
try {
|
1115
1121
|
if (p) {
|
1116
|
-
var
|
1122
|
+
var P = function() {
|
1117
1123
|
throw Error();
|
1118
1124
|
};
|
1119
|
-
if (Object.defineProperty(
|
1125
|
+
if (Object.defineProperty(P.prototype, "props", {
|
1120
1126
|
set: function() {
|
1121
1127
|
throw Error();
|
1122
1128
|
}
|
1123
1129
|
}), typeof Reflect == "object" && Reflect.construct) {
|
1124
1130
|
try {
|
1125
|
-
Reflect.construct(
|
1131
|
+
Reflect.construct(P, []);
|
1126
1132
|
} catch (Le) {
|
1127
1133
|
S = Le;
|
1128
1134
|
}
|
1129
|
-
Reflect.construct(r, [],
|
1135
|
+
Reflect.construct(r, [], P);
|
1130
1136
|
} else {
|
1131
1137
|
try {
|
1132
|
-
|
1138
|
+
P.call();
|
1133
1139
|
} catch (Le) {
|
1134
1140
|
S = Le;
|
1135
1141
|
}
|
1136
|
-
r.call(
|
1142
|
+
r.call(P.prototype);
|
1137
1143
|
}
|
1138
1144
|
} else {
|
1139
1145
|
try {
|
@@ -1146,32 +1152,32 @@ function Fa() {
|
|
1146
1152
|
} catch (Le) {
|
1147
1153
|
if (Le && S && typeof Le.stack == "string") {
|
1148
1154
|
for (var R = Le.stack.split(`
|
1149
|
-
`),
|
1150
|
-
`),
|
1155
|
+
`), de = S.stack.split(`
|
1156
|
+
`), Z = R.length - 1, Q = de.length - 1; Z >= 1 && Q >= 0 && R[Z] !== de[Q]; )
|
1151
1157
|
Q--;
|
1152
|
-
for (;
|
1153
|
-
if (R[
|
1154
|
-
if (
|
1158
|
+
for (; Z >= 1 && Q >= 0; Z--, Q--)
|
1159
|
+
if (R[Z] !== de[Q]) {
|
1160
|
+
if (Z !== 1 || Q !== 1)
|
1155
1161
|
do
|
1156
|
-
if (
|
1162
|
+
if (Z--, Q--, Q < 0 || R[Z] !== de[Q]) {
|
1157
1163
|
var Ce = `
|
1158
|
-
` + R[
|
1164
|
+
` + R[Z].replace(" at new ", " at ");
|
1159
1165
|
return r.displayName && Ce.includes("<anonymous>") && (Ce = Ce.replace("<anonymous>", r.displayName)), typeof r == "function" && v.set(r, Ce), Ce;
|
1160
1166
|
}
|
1161
|
-
while (
|
1167
|
+
while (Z >= 1 && Q >= 0);
|
1162
1168
|
break;
|
1163
1169
|
}
|
1164
1170
|
}
|
1165
1171
|
} finally {
|
1166
|
-
g = !1, He.current =
|
1172
|
+
g = !1, He.current = $, Me(), Error.prepareStackTrace = B;
|
1167
1173
|
}
|
1168
|
-
var tt = r ? r.displayName || r.name : "", Ht = tt ?
|
1174
|
+
var tt = r ? r.displayName || r.name : "", Ht = tt ? le(tt) : "";
|
1169
1175
|
return typeof r == "function" && v.set(r, Ht), Ht;
|
1170
1176
|
}
|
1171
1177
|
function ge(r, p, b) {
|
1172
|
-
return
|
1178
|
+
return k(r, !1);
|
1173
1179
|
}
|
1174
|
-
function
|
1180
|
+
function ce(r) {
|
1175
1181
|
var p = r.prototype;
|
1176
1182
|
return !!(p && p.isReactComponent);
|
1177
1183
|
}
|
@@ -1179,14 +1185,14 @@ function Fa() {
|
|
1179
1185
|
if (r == null)
|
1180
1186
|
return "";
|
1181
1187
|
if (typeof r == "function")
|
1182
|
-
return
|
1188
|
+
return k(r, ce(r));
|
1183
1189
|
if (typeof r == "string")
|
1184
|
-
return
|
1190
|
+
return le(r);
|
1185
1191
|
switch (r) {
|
1186
1192
|
case h:
|
1187
|
-
return
|
1193
|
+
return le("Suspense");
|
1188
1194
|
case f:
|
1189
|
-
return
|
1195
|
+
return le("SuspenseList");
|
1190
1196
|
}
|
1191
1197
|
if (typeof r == "object")
|
1192
1198
|
switch (r.$$typeof) {
|
@@ -1195,45 +1201,45 @@ function Fa() {
|
|
1195
1201
|
case m:
|
1196
1202
|
return C(r.type, p, b);
|
1197
1203
|
case x: {
|
1198
|
-
var S = r,
|
1204
|
+
var S = r, B = S._payload, $ = S._init;
|
1199
1205
|
try {
|
1200
|
-
return C(
|
1206
|
+
return C($(B), p, b);
|
1201
1207
|
} catch {
|
1202
1208
|
}
|
1203
1209
|
}
|
1204
1210
|
}
|
1205
1211
|
return "";
|
1206
1212
|
}
|
1207
|
-
var E = Object.prototype.hasOwnProperty,
|
1208
|
-
function
|
1213
|
+
var E = Object.prototype.hasOwnProperty, U = {}, J = re.ReactDebugCurrentFrame;
|
1214
|
+
function T(r) {
|
1209
1215
|
if (r) {
|
1210
1216
|
var p = r._owner, b = C(r.type, r._source, p ? p.type : null);
|
1211
1217
|
J.setExtraStackFrame(b);
|
1212
1218
|
} else
|
1213
1219
|
J.setExtraStackFrame(null);
|
1214
1220
|
}
|
1215
|
-
function
|
1221
|
+
function F(r, p, b, S, B) {
|
1216
1222
|
{
|
1217
|
-
var
|
1218
|
-
for (var
|
1219
|
-
if (
|
1223
|
+
var $ = Function.call.bind(E);
|
1224
|
+
for (var P in r)
|
1225
|
+
if ($(r, P)) {
|
1220
1226
|
var R = void 0;
|
1221
1227
|
try {
|
1222
|
-
if (typeof r[
|
1223
|
-
var
|
1224
|
-
throw
|
1228
|
+
if (typeof r[P] != "function") {
|
1229
|
+
var de = Error((S || "React class") + ": " + b + " type `" + P + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof r[P] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
1230
|
+
throw de.name = "Invariant Violation", de;
|
1225
1231
|
}
|
1226
|
-
R = r[
|
1227
|
-
} catch (
|
1228
|
-
R =
|
1232
|
+
R = r[P](p, P, S, b, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
1233
|
+
} catch (Z) {
|
1234
|
+
R = Z;
|
1229
1235
|
}
|
1230
|
-
R && !(R instanceof Error) && (
|
1236
|
+
R && !(R instanceof Error) && (T(B), z("%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).", S || "React class", b, P, typeof R), T(null)), R instanceof Error && !(R.message in U) && (U[R.message] = !0, T(B), z("Failed %s type: %s", b, R.message), T(null));
|
1231
1237
|
}
|
1232
1238
|
}
|
1233
1239
|
}
|
1234
|
-
var
|
1240
|
+
var W = Array.isArray;
|
1235
1241
|
function Ne(r) {
|
1236
|
-
return
|
1242
|
+
return W(r);
|
1237
1243
|
}
|
1238
1244
|
function Je(r) {
|
1239
1245
|
{
|
@@ -1241,26 +1247,26 @@ function Fa() {
|
|
1241
1247
|
return b;
|
1242
1248
|
}
|
1243
1249
|
}
|
1244
|
-
function
|
1250
|
+
function ft(r) {
|
1245
1251
|
try {
|
1246
|
-
return
|
1252
|
+
return mt(r), !1;
|
1247
1253
|
} catch {
|
1248
1254
|
return !0;
|
1249
1255
|
}
|
1250
1256
|
}
|
1251
|
-
function
|
1257
|
+
function mt(r) {
|
1252
1258
|
return "" + r;
|
1253
1259
|
}
|
1254
1260
|
function st(r) {
|
1255
|
-
if (
|
1256
|
-
return
|
1261
|
+
if (ft(r))
|
1262
|
+
return z("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Je(r)), mt(r);
|
1257
1263
|
}
|
1258
1264
|
var Ue = re.ReactCurrentOwner, ot = {
|
1259
1265
|
key: !0,
|
1260
1266
|
ref: !0,
|
1261
1267
|
__self: !0,
|
1262
1268
|
__source: !0
|
1263
|
-
}, ct,
|
1269
|
+
}, ct, pt, Qe;
|
1264
1270
|
Qe = {};
|
1265
1271
|
function _t(r) {
|
1266
1272
|
if (E.call(r, "ref")) {
|
@@ -1278,16 +1284,16 @@ function Fa() {
|
|
1278
1284
|
}
|
1279
1285
|
return r.key !== void 0;
|
1280
1286
|
}
|
1281
|
-
function
|
1287
|
+
function kt(r, p) {
|
1282
1288
|
if (typeof r.ref == "string" && Ue.current && p && Ue.current.stateNode !== p) {
|
1283
1289
|
var b = N(Ue.current.type);
|
1284
|
-
Qe[b] || (
|
1290
|
+
Qe[b] || (z('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', N(Ue.current.type), r.ref), Qe[b] = !0);
|
1285
1291
|
}
|
1286
1292
|
}
|
1287
|
-
function
|
1293
|
+
function gt(r, p) {
|
1288
1294
|
{
|
1289
1295
|
var b = function() {
|
1290
|
-
ct || (ct = !0,
|
1296
|
+
ct || (ct = !0, z("%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));
|
1291
1297
|
};
|
1292
1298
|
b.isReactWarning = !0, Object.defineProperty(r, "key", {
|
1293
1299
|
get: b,
|
@@ -1298,7 +1304,7 @@ function Fa() {
|
|
1298
1304
|
function $e(r, p) {
|
1299
1305
|
{
|
1300
1306
|
var b = function() {
|
1301
|
-
|
1307
|
+
pt || (pt = !0, z("%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));
|
1302
1308
|
};
|
1303
1309
|
b.isReactWarning = !0, Object.defineProperty(r, "ref", {
|
1304
1310
|
get: b,
|
@@ -1306,7 +1312,7 @@ function Fa() {
|
|
1306
1312
|
});
|
1307
1313
|
}
|
1308
1314
|
}
|
1309
|
-
var Gt = function(r, p, b, S,
|
1315
|
+
var Gt = function(r, p, b, S, B, $, P) {
|
1310
1316
|
var R = {
|
1311
1317
|
// This tag allows us to uniquely identify this as a React Element
|
1312
1318
|
$$typeof: n,
|
@@ -1314,9 +1320,9 @@ function Fa() {
|
|
1314
1320
|
type: r,
|
1315
1321
|
key: p,
|
1316
1322
|
ref: b,
|
1317
|
-
props:
|
1323
|
+
props: P,
|
1318
1324
|
// Record the component responsible for creating this element.
|
1319
|
-
_owner:
|
1325
|
+
_owner: $
|
1320
1326
|
};
|
1321
1327
|
return R._store = {}, Object.defineProperty(R._store, "validated", {
|
1322
1328
|
configurable: !1,
|
@@ -1332,29 +1338,29 @@ function Fa() {
|
|
1332
1338
|
configurable: !1,
|
1333
1339
|
enumerable: !1,
|
1334
1340
|
writable: !1,
|
1335
|
-
value:
|
1341
|
+
value: B
|
1336
1342
|
}), Object.freeze && (Object.freeze(R.props), Object.freeze(R)), R;
|
1337
1343
|
};
|
1338
|
-
function s(r, p, b, S,
|
1344
|
+
function s(r, p, b, S, B) {
|
1339
1345
|
{
|
1340
|
-
var
|
1341
|
-
b !== void 0 && (st(b), R = "" + b), Rt(p) && (st(p.key), R = "" + p.key), _t(p) && (
|
1342
|
-
for (
|
1343
|
-
E.call(p,
|
1346
|
+
var $, P = {}, R = null, de = null;
|
1347
|
+
b !== void 0 && (st(b), R = "" + b), Rt(p) && (st(p.key), R = "" + p.key), _t(p) && (de = p.ref, kt(p, B));
|
1348
|
+
for ($ in p)
|
1349
|
+
E.call(p, $) && !ot.hasOwnProperty($) && (P[$] = p[$]);
|
1344
1350
|
if (r && r.defaultProps) {
|
1345
|
-
var
|
1346
|
-
for (
|
1347
|
-
|
1351
|
+
var Z = r.defaultProps;
|
1352
|
+
for ($ in Z)
|
1353
|
+
P[$] === void 0 && (P[$] = Z[$]);
|
1348
1354
|
}
|
1349
|
-
if (R ||
|
1355
|
+
if (R || de) {
|
1350
1356
|
var Q = typeof r == "function" ? r.displayName || r.name || "Unknown" : r;
|
1351
|
-
R &&
|
1357
|
+
R && gt(P, Q), de && $e(P, Q);
|
1352
1358
|
}
|
1353
|
-
return Gt(r, R,
|
1359
|
+
return Gt(r, R, de, B, S, Ue.current, P);
|
1354
1360
|
}
|
1355
1361
|
}
|
1356
1362
|
var y = re.ReactCurrentOwner, _ = re.ReactDebugCurrentFrame;
|
1357
|
-
function
|
1363
|
+
function A(r) {
|
1358
1364
|
if (r) {
|
1359
1365
|
var p = r._owner, b = C(r.type, r._source, p ? p.type : null);
|
1360
1366
|
_.setExtraStackFrame(b);
|
@@ -1366,7 +1372,7 @@ function Fa() {
|
|
1366
1372
|
function ye(r) {
|
1367
1373
|
return typeof r == "object" && r !== null && r.$$typeof === n;
|
1368
1374
|
}
|
1369
|
-
function
|
1375
|
+
function ue() {
|
1370
1376
|
{
|
1371
1377
|
if (y.current) {
|
1372
1378
|
var r = N(y.current.type);
|
@@ -1389,10 +1395,10 @@ Check your code at ` + p + ":" + b + ".";
|
|
1389
1395
|
return "";
|
1390
1396
|
}
|
1391
1397
|
}
|
1392
|
-
var
|
1393
|
-
function
|
1398
|
+
var vt = {};
|
1399
|
+
function bt(r) {
|
1394
1400
|
{
|
1395
|
-
var p =
|
1401
|
+
var p = ue();
|
1396
1402
|
if (!p) {
|
1397
1403
|
var b = typeof r == "string" ? r : r.displayName || r.name;
|
1398
1404
|
b && (p = `
|
@@ -1407,12 +1413,12 @@ Check the top-level render call using <` + b + ">.");
|
|
1407
1413
|
if (!r._store || r._store.validated || r.key != null)
|
1408
1414
|
return;
|
1409
1415
|
r._store.validated = !0;
|
1410
|
-
var b =
|
1411
|
-
if (
|
1416
|
+
var b = bt(p);
|
1417
|
+
if (vt[b])
|
1412
1418
|
return;
|
1413
|
-
|
1419
|
+
vt[b] = !0;
|
1414
1420
|
var S = "";
|
1415
|
-
r && r._owner && r._owner !== y.current && (S = " It was passed a child from " + N(r._owner.type) + "."),
|
1421
|
+
r && r._owner && r._owner !== y.current && (S = " It was passed a child from " + N(r._owner.type) + "."), A(r), z('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', b, S), A(null);
|
1416
1422
|
}
|
1417
1423
|
}
|
1418
1424
|
function Ee(r, p) {
|
@@ -1427,10 +1433,10 @@ Check the top-level render call using <` + b + ">.");
|
|
1427
1433
|
else if (ye(r))
|
1428
1434
|
r._store && (r._store.validated = !0);
|
1429
1435
|
else if (r) {
|
1430
|
-
var
|
1431
|
-
if (typeof
|
1432
|
-
for (var
|
1433
|
-
ye(
|
1436
|
+
var B = me(r);
|
1437
|
+
if (typeof B == "function" && B !== r.entries)
|
1438
|
+
for (var $ = B.call(r), P; !(P = $.next()).done; )
|
1439
|
+
ye(P.value) && xe(P.value, p);
|
1434
1440
|
}
|
1435
1441
|
}
|
1436
1442
|
}
|
@@ -1450,13 +1456,13 @@ Check the top-level render call using <` + b + ">.");
|
|
1450
1456
|
return;
|
1451
1457
|
if (b) {
|
1452
1458
|
var S = N(p);
|
1453
|
-
|
1459
|
+
F(b, r.props, "prop", S, r);
|
1454
1460
|
} else if (p.PropTypes !== void 0 && !ee) {
|
1455
1461
|
ee = !0;
|
1456
|
-
var
|
1457
|
-
|
1462
|
+
var B = N(p);
|
1463
|
+
z("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", B || "Unknown");
|
1458
1464
|
}
|
1459
|
-
typeof p.getDefaultProps == "function" && !p.getDefaultProps.isReactClassApproved &&
|
1465
|
+
typeof p.getDefaultProps == "function" && !p.getDefaultProps.isReactClassApproved && z("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
1460
1466
|
}
|
1461
1467
|
}
|
1462
1468
|
function Oe(r) {
|
@@ -1464,28 +1470,28 @@ Check the top-level render call using <` + b + ">.");
|
|
1464
1470
|
for (var p = Object.keys(r.props), b = 0; b < p.length; b++) {
|
1465
1471
|
var S = p[b];
|
1466
1472
|
if (S !== "children" && S !== "key") {
|
1467
|
-
|
1473
|
+
A(r), z("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", S), A(null);
|
1468
1474
|
break;
|
1469
1475
|
}
|
1470
1476
|
}
|
1471
|
-
r.ref !== null && (
|
1477
|
+
r.ref !== null && (A(r), z("Invalid attribute `ref` supplied to `React.Fragment`."), A(null));
|
1472
1478
|
}
|
1473
1479
|
}
|
1474
|
-
function ze(r, p, b, S,
|
1480
|
+
function ze(r, p, b, S, B, $) {
|
1475
1481
|
{
|
1476
|
-
var
|
1477
|
-
if (!
|
1482
|
+
var P = Re(r);
|
1483
|
+
if (!P) {
|
1478
1484
|
var R = "";
|
1479
1485
|
(r === void 0 || typeof r == "object" && r !== null && Object.keys(r).length === 0) && (R += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
1480
|
-
var
|
1481
|
-
|
1482
|
-
var
|
1483
|
-
r === null ?
|
1486
|
+
var de = Wt(B);
|
1487
|
+
de ? R += de : R += ue();
|
1488
|
+
var Z;
|
1489
|
+
r === null ? Z = "null" : Ne(r) ? Z = "array" : r !== void 0 && r.$$typeof === n ? (Z = "<" + (N(r.type) || "Unknown") + " />", R = " Did you accidentally export a JSX literal instead of a component?") : Z = typeof r, z("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", Z, R);
|
1484
1490
|
}
|
1485
|
-
var Q = s(r, p, b,
|
1491
|
+
var Q = s(r, p, b, B, $);
|
1486
1492
|
if (Q == null)
|
1487
1493
|
return Q;
|
1488
|
-
if (
|
1494
|
+
if (P) {
|
1489
1495
|
var Ce = p.children;
|
1490
1496
|
if (Ce !== void 0)
|
1491
1497
|
if (S)
|
@@ -1494,7 +1500,7 @@ Check the top-level render call using <` + b + ">.");
|
|
1494
1500
|
Ee(Ce[tt], r);
|
1495
1501
|
Object.freeze && Object.freeze(Ce);
|
1496
1502
|
} else
|
1497
|
-
|
1503
|
+
z("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
1498
1504
|
else
|
1499
1505
|
Ee(Ce, r);
|
1500
1506
|
}
|
@@ -1504,10 +1510,10 @@ Check the top-level render call using <` + b + ">.");
|
|
1504
1510
|
function et(r, p, b) {
|
1505
1511
|
return ze(r, p, b, !0);
|
1506
1512
|
}
|
1507
|
-
function
|
1513
|
+
function yt(r, p, b) {
|
1508
1514
|
return ze(r, p, b, !1);
|
1509
1515
|
}
|
1510
|
-
var zn =
|
1516
|
+
var zn = yt, Gn = et;
|
1511
1517
|
ut.Fragment = t, ut.jsx = zn, ut.jsxs = Gn;
|
1512
1518
|
}()), ut;
|
1513
1519
|
}
|
@@ -1529,7 +1535,7 @@ C11,8.22,10.74,8,10.43,8z`
|
|
1529
1535
|
}
|
1530
1536
|
) });
|
1531
1537
|
function za(e) {
|
1532
|
-
return /* @__PURE__ */ l.jsx(
|
1538
|
+
return /* @__PURE__ */ l.jsx(An.Item, { value: e.title, children: /* @__PURE__ */ l.jsxs("div", { children: [
|
1533
1539
|
$a,
|
1534
1540
|
/* @__PURE__ */ l.jsx("span", { children: e.title }),
|
1535
1541
|
/* @__PURE__ */ l.jsx("button", { className: "closeIcon", onClick: () => {
|
@@ -1538,25 +1544,25 @@ function za(e) {
|
|
1538
1544
|
] }) }, e.title);
|
1539
1545
|
}
|
1540
1546
|
function Ga(e) {
|
1541
|
-
const [n, a] =
|
1547
|
+
const [n, a] = X(!1), [t, i] = X(e.options), o = (h) => {
|
1542
1548
|
e.onDragComplete(h), i(h);
|
1543
1549
|
}, u = (h) => {
|
1544
1550
|
const f = [...t];
|
1545
|
-
f.splice(h, 1),
|
1546
|
-
},
|
1551
|
+
f.splice(h, 1), o(f);
|
1552
|
+
}, c = [];
|
1547
1553
|
t.forEach((h, f) => {
|
1548
|
-
|
1554
|
+
c.push(/* @__PURE__ */ l.jsx(za, { index: f, title: h, onDelete: u }, h));
|
1549
1555
|
});
|
1550
1556
|
let d = "dropdown draggable";
|
1551
1557
|
return e.subdropdown && (d += " subdropdown"), /* @__PURE__ */ l.jsxs("div", { className: d, onMouseEnter: () => a(!0), onMouseLeave: () => a(!1), children: [
|
1552
1558
|
/* @__PURE__ */ l.jsx(Bn, { title: e.title }),
|
1553
|
-
/* @__PURE__ */ l.jsx(
|
1559
|
+
/* @__PURE__ */ l.jsx(An.Group, { axis: "y", values: t, onReorder: o, style: { visibility: n ? "visible" : "hidden" }, children: c })
|
1554
1560
|
] });
|
1555
1561
|
}
|
1556
1562
|
function Wa(e) {
|
1557
|
-
const [n, a] =
|
1558
|
-
e.options.map((
|
1559
|
-
e.onSelect !== void 0 && (
|
1563
|
+
const [n, a] = X(!1), t = [];
|
1564
|
+
e.options.map((o, u) => {
|
1565
|
+
e.onSelect !== void 0 && (o.onSelect = e.onSelect), t.push(/* @__PURE__ */ l.jsx(Ha, { option: o }, u));
|
1560
1566
|
});
|
1561
1567
|
let i = "dropdown";
|
1562
1568
|
return e.subdropdown && (i += " subdropdown"), /* @__PURE__ */ l.jsxs(
|
@@ -1579,7 +1585,7 @@ function Wa(e) {
|
|
1579
1585
|
);
|
1580
1586
|
}
|
1581
1587
|
function Ha(e) {
|
1582
|
-
const { option: n } = e, [a, t] =
|
1588
|
+
const { option: n } = e, [a, t] = X("");
|
1583
1589
|
let i;
|
1584
1590
|
switch (n.type) {
|
1585
1591
|
case "draggable":
|
@@ -1588,8 +1594,8 @@ function Ha(e) {
|
|
1588
1594
|
{
|
1589
1595
|
title: n.title,
|
1590
1596
|
options: n.value,
|
1591
|
-
onDragComplete: (
|
1592
|
-
n.onDragComplete !== void 0 && n.onDragComplete(
|
1597
|
+
onDragComplete: (o) => {
|
1598
|
+
n.onDragComplete !== void 0 && n.onDragComplete(o);
|
1593
1599
|
},
|
1594
1600
|
subdropdown: !0
|
1595
1601
|
}
|
@@ -1621,30 +1627,30 @@ function Ha(e) {
|
|
1621
1627
|
return /* @__PURE__ */ l.jsx("li", { className: a === n.title ? "selected" : "", children: i }, _a());
|
1622
1628
|
}
|
1623
1629
|
function Bi(e, n, a) {
|
1624
|
-
function t(
|
1630
|
+
function t(o) {
|
1625
1631
|
switch (n.forEach((u) => {
|
1626
|
-
u.callback(e, u.remote,
|
1627
|
-
}),
|
1632
|
+
u.callback(e, u.remote, o);
|
1633
|
+
}), o.event) {
|
1628
1634
|
case "custom":
|
1629
|
-
j.dispatchEvent({ type:
|
1635
|
+
j.dispatchEvent({ type: D.CUSTOM, value: o.data });
|
1630
1636
|
break;
|
1631
1637
|
}
|
1632
1638
|
}
|
1633
|
-
function i(
|
1639
|
+
function i(o) {
|
1634
1640
|
switch (a.forEach((u) => {
|
1635
|
-
u.callback(e, u.remote,
|
1636
|
-
}),
|
1641
|
+
u.callback(e, u.remote, o);
|
1642
|
+
}), o.event) {
|
1637
1643
|
case "custom":
|
1638
|
-
j.dispatchEvent({ type:
|
1644
|
+
j.dispatchEvent({ type: D.CUSTOM, value: o.data });
|
1639
1645
|
break;
|
1640
1646
|
}
|
1641
1647
|
}
|
1642
|
-
e.listen = (
|
1643
|
-
|
1648
|
+
e.listen = (o) => {
|
1649
|
+
o.target === "editor" ? i(o) : t(o);
|
1644
1650
|
};
|
1645
1651
|
}
|
1646
1652
|
function zt(e) {
|
1647
|
-
const [n, a] =
|
1653
|
+
const [n, a] = X(e.open !== void 0 ? e.open : !0), t = !n || e.children === void 0;
|
1648
1654
|
return /* @__PURE__ */ l.jsxs("div", { className: `accordion ${t ? "hide" : ""}`, children: [
|
1649
1655
|
/* @__PURE__ */ l.jsxs(
|
1650
1656
|
"button",
|
@@ -1671,20 +1677,23 @@ function zt(e) {
|
|
1671
1677
|
] });
|
1672
1678
|
}
|
1673
1679
|
function Fn(e) {
|
1674
|
-
const
|
1675
|
-
return e.child !== void 0 && e.child.children.length > 0 && e.child.children.map((
|
1676
|
-
|
1677
|
-
}),
|
1680
|
+
const n = q(null), [a, t] = X(!1), i = e.child !== void 0 && e.child.children.length > 0, o = [];
|
1681
|
+
return e.child !== void 0 && e.child.children.length > 0 && e.child.children.map((u) => {
|
1682
|
+
o.push(/* @__PURE__ */ l.jsx(Fn, { child: u, three: e.three }, Math.random()));
|
1683
|
+
}), _e(() => {
|
1684
|
+
const u = e.three.scene?.getObjectByProperty("uuid", e.child.uuid);
|
1685
|
+
u !== void 0 && (n.current.style.opacity = u.visible ? "1" : "0.25");
|
1686
|
+
}, []), /* @__PURE__ */ l.jsx(l.Fragment, { children: e.child !== void 0 && /* @__PURE__ */ l.jsxs("div", { className: "childObject", children: [
|
1678
1687
|
/* @__PURE__ */ l.jsxs("div", { className: "child", children: [
|
1679
|
-
|
1688
|
+
i ? /* @__PURE__ */ l.jsx(
|
1680
1689
|
"button",
|
1681
1690
|
{
|
1682
1691
|
className: "status",
|
1683
1692
|
style: {
|
1684
|
-
backgroundPositionX:
|
1693
|
+
backgroundPositionX: a ? "-14px" : "2px"
|
1685
1694
|
},
|
1686
1695
|
onClick: () => {
|
1687
|
-
|
1696
|
+
t(!a);
|
1688
1697
|
}
|
1689
1698
|
}
|
1690
1699
|
) : null,
|
@@ -1693,17 +1702,33 @@ function Fn(e) {
|
|
1693
1702
|
{
|
1694
1703
|
className: "name",
|
1695
1704
|
style: {
|
1696
|
-
left:
|
1705
|
+
left: i ? "20px" : "5px"
|
1697
1706
|
},
|
1698
1707
|
onClick: () => {
|
1699
|
-
e.child !== void 0 && (e.three.getObject(e.child.uuid),
|
1708
|
+
e.child !== void 0 && (e.three.getObject(e.child.uuid), a || t(!0));
|
1700
1709
|
},
|
1701
1710
|
children: e.child.name.length > 0 ? `${e.child.name} (${e.child.type})` : `${e.child.type}::${e.child.uuid}`
|
1702
1711
|
}
|
1703
1712
|
),
|
1704
|
-
/* @__PURE__ */ l.jsx(
|
1713
|
+
/* @__PURE__ */ l.jsx(
|
1714
|
+
"button",
|
1715
|
+
{
|
1716
|
+
className: "visibility",
|
1717
|
+
ref: n,
|
1718
|
+
onClick: () => {
|
1719
|
+
if (e.child) {
|
1720
|
+
const u = e.three.scene?.getObjectByProperty("uuid", e.child.uuid);
|
1721
|
+
if (u !== void 0) {
|
1722
|
+
const c = "visible", d = !u.visible;
|
1723
|
+
n.current.style.opacity = d ? "1" : "0.25", e.three.updateObject(e.child.uuid, c, d), V(u, c, d);
|
1724
|
+
}
|
1725
|
+
}
|
1726
|
+
}
|
1727
|
+
}
|
1728
|
+
),
|
1729
|
+
/* @__PURE__ */ l.jsx("div", { className: `icon ${Da(e.child)}` })
|
1705
1730
|
] }),
|
1706
|
-
/* @__PURE__ */ l.jsx("div", { className:
|
1731
|
+
/* @__PURE__ */ l.jsx("div", { className: a ? "open" : "", children: /* @__PURE__ */ l.jsx("div", { className: "container", children: o }) })
|
1707
1732
|
] }, Math.random()) });
|
1708
1733
|
}
|
1709
1734
|
function Ya(e) {
|
@@ -1723,7 +1748,7 @@ function Xe(e) {
|
|
1723
1748
|
/* @__PURE__ */ l.jsx(Xe, { title: Mt(a.title), items: a.items }, Math.random())
|
1724
1749
|
) : n.push(
|
1725
1750
|
/* @__PURE__ */ l.jsx(
|
1726
|
-
|
1751
|
+
St,
|
1727
1752
|
{
|
1728
1753
|
title: a.title,
|
1729
1754
|
prop: a.prop,
|
@@ -1981,8 +2006,8 @@ function Xa() {
|
|
1981
2006
|
a();
|
1982
2007
|
else {
|
1983
2008
|
const t = e.files[0], i = new FileReader();
|
1984
|
-
i.onload = function(
|
1985
|
-
n(
|
2009
|
+
i.onload = function(o) {
|
2010
|
+
n(o.target.result);
|
1986
2011
|
}, i.readAsDataURL(t);
|
1987
2012
|
}
|
1988
2013
|
}), e.click();
|
@@ -2176,10 +2201,10 @@ function ai(e, n, a, t) {
|
|
2176
2201
|
prop: e,
|
2177
2202
|
value: n,
|
2178
2203
|
needsUpdate: !0,
|
2179
|
-
onChange: (i,
|
2180
|
-
t.updateObject(a.uuid, `material.${e}`,
|
2204
|
+
onChange: (i, o) => {
|
2205
|
+
t.updateObject(a.uuid, `material.${e}`, o), t.updateObject(a.uuid, "material.needsUpdate", !0);
|
2181
2206
|
const u = t.scene?.getObjectByProperty("uuid", a.uuid);
|
2182
|
-
u !== void 0 && V(u, `material.${e}`,
|
2207
|
+
u !== void 0 && V(u, `material.${e}`, o);
|
2183
2208
|
}
|
2184
2209
|
};
|
2185
2210
|
}
|
@@ -2193,10 +2218,10 @@ function ii(e, n, a, t) {
|
|
2193
2218
|
max: void 0,
|
2194
2219
|
step: 0.01,
|
2195
2220
|
needsUpdate: !0,
|
2196
|
-
onChange: (
|
2221
|
+
onChange: (o, u) => {
|
2197
2222
|
t.updateObject(a.uuid, `material.${e}`, u), t.updateObject(a.uuid, "material.needsUpdate", !0);
|
2198
|
-
const
|
2199
|
-
|
2223
|
+
const c = t.scene?.getObjectByProperty("uuid", a.uuid);
|
2224
|
+
c !== void 0 && V(c, `material.${e}`, u);
|
2200
2225
|
}
|
2201
2226
|
};
|
2202
2227
|
switch (e) {
|
@@ -2225,23 +2250,23 @@ function ri(e, n, a, t) {
|
|
2225
2250
|
prop: e,
|
2226
2251
|
value: n,
|
2227
2252
|
needsUpdate: !0,
|
2228
|
-
onChange: (u,
|
2229
|
-
t.updateObject(a.uuid, `material.${e}`,
|
2253
|
+
onChange: (u, c) => {
|
2254
|
+
t.updateObject(a.uuid, `material.${e}`, c), t.updateObject(a.uuid, "material.needsUpdate", !0);
|
2230
2255
|
const d = t.scene?.getObjectByProperty("uuid", a.uuid);
|
2231
|
-
d !== void 0 && V(d, `material.${e}`,
|
2256
|
+
d !== void 0 && V(d, `material.${e}`, c);
|
2232
2257
|
},
|
2233
2258
|
onKeyDown: (u) => {
|
2234
2259
|
}
|
2235
2260
|
};
|
2236
|
-
return (e === "vertexShader" || e === "fragmentShader") && (i.disabled = !1, i.latest = i.value, i.onChange = (u,
|
2237
|
-
i.latest =
|
2261
|
+
return (e === "vertexShader" || e === "fragmentShader") && (i.disabled = !1, i.latest = i.value, i.onChange = (u, c) => {
|
2262
|
+
i.latest = c, t.updateObject(a.uuid, `material.${e}`, c);
|
2238
2263
|
const d = t.scene?.getObjectByProperty("uuid", a.uuid);
|
2239
|
-
d !== void 0 && V(d, `material.${e}`,
|
2264
|
+
d !== void 0 && V(d, `material.${e}`, c);
|
2240
2265
|
}, i.onKeyDown = (u) => {
|
2241
2266
|
if (u.key === "Enter" && (u.altKey || u.metaKey)) {
|
2242
2267
|
t.updateObject(a.uuid, "material.needsUpdate", !0);
|
2243
|
-
const
|
2244
|
-
|
2268
|
+
const c = t.scene?.getObjectByProperty("uuid", a.uuid);
|
2269
|
+
c !== void 0 && V(c, "material.needsUpdate", !0);
|
2245
2270
|
}
|
2246
2271
|
}), i;
|
2247
2272
|
}
|
@@ -2257,33 +2282,33 @@ function ci(e) {
|
|
2257
2282
|
function Lt(e) {
|
2258
2283
|
e.sort((n, a) => n.title < a.title ? -1 : n.title > a.title ? 1 : 0);
|
2259
2284
|
}
|
2260
|
-
function ht(e, n, a, t, i = "",
|
2261
|
-
const u = Tt(e).split(".")[0].replaceAll("[", "").replaceAll("]", ""),
|
2285
|
+
function ht(e, n, a, t, i = "", o = !1) {
|
2286
|
+
const u = Tt(e).split(".")[0].replaceAll("[", "").replaceAll("]", ""), c = i.length > 0 ? `${i}.${e}` : e, d = typeof n;
|
2262
2287
|
if (d === "boolean" || d === "string")
|
2263
2288
|
return {
|
2264
2289
|
title: u,
|
2265
|
-
prop:
|
2290
|
+
prop: c,
|
2266
2291
|
type: d,
|
2267
2292
|
value: n,
|
2268
|
-
disabled:
|
2293
|
+
disabled: o,
|
2269
2294
|
onChange: (h, f) => {
|
2270
|
-
t.updateObject(a.uuid, `material.${
|
2295
|
+
t.updateObject(a.uuid, `material.${c}`, f);
|
2271
2296
|
const m = t.scene?.getObjectByProperty("uuid", a.uuid);
|
2272
|
-
m !== void 0 && V(m, `material.${
|
2297
|
+
m !== void 0 && V(m, `material.${c}`, f);
|
2273
2298
|
}
|
2274
2299
|
};
|
2275
2300
|
if (d === "number") {
|
2276
2301
|
const h = {
|
2277
2302
|
title: u,
|
2278
|
-
prop:
|
2303
|
+
prop: c,
|
2279
2304
|
type: "number",
|
2280
2305
|
value: n,
|
2281
2306
|
step: 0.01,
|
2282
|
-
disabled:
|
2307
|
+
disabled: o,
|
2283
2308
|
onChange: (f, m) => {
|
2284
|
-
t.updateObject(a.uuid, `material.${
|
2309
|
+
t.updateObject(a.uuid, `material.${c}`, m);
|
2285
2310
|
const x = t.scene?.getObjectByProperty("uuid", a.uuid);
|
2286
|
-
x !== void 0 && V(x, `material.${
|
2311
|
+
x !== void 0 && V(x, `material.${c}`, m);
|
2287
2312
|
}
|
2288
2313
|
};
|
2289
2314
|
return Un(u) && (h.type = "range", h.min = 0, h.max = 1), h;
|
@@ -2291,15 +2316,15 @@ function ht(e, n, a, t, i = "", c = !1) {
|
|
2291
2316
|
if (n.isColor)
|
2292
2317
|
return {
|
2293
2318
|
title: u,
|
2294
|
-
prop:
|
2319
|
+
prop: c,
|
2295
2320
|
type: "color",
|
2296
2321
|
value: n,
|
2297
|
-
disabled:
|
2322
|
+
disabled: o,
|
2298
2323
|
onChange: (h, f) => {
|
2299
2324
|
const m = new Bt(f);
|
2300
|
-
t.updateObject(a.uuid, `material.${
|
2325
|
+
t.updateObject(a.uuid, `material.${c}`, m);
|
2301
2326
|
const x = t.scene?.getObjectByProperty("uuid", a.uuid);
|
2302
|
-
x !== void 0 && V(x, `material.${
|
2327
|
+
x !== void 0 && V(x, `material.${c}`, m);
|
2303
2328
|
}
|
2304
2329
|
};
|
2305
2330
|
if (Array.isArray(n)) {
|
@@ -2307,11 +2332,11 @@ function ht(e, n, a, t, i = "", c = !1) {
|
|
2307
2332
|
for (const f in n) {
|
2308
2333
|
const m = n[f], x = `[${f.toString()}]`;
|
2309
2334
|
if (m.value !== void 0) {
|
2310
|
-
const
|
2311
|
-
|
2335
|
+
const M = ht(`${x}.value`, m.value, a, t, c, o);
|
2336
|
+
M !== void 0 && h.push(M);
|
2312
2337
|
} else {
|
2313
|
-
const
|
2314
|
-
|
2338
|
+
const M = ht(x, m, a, t, c, o);
|
2339
|
+
M !== void 0 && h.push(M);
|
2315
2340
|
}
|
2316
2341
|
}
|
2317
2342
|
if (h.length > 0)
|
@@ -2323,53 +2348,53 @@ function ht(e, n, a, t, i = "", c = !1) {
|
|
2323
2348
|
if (si(n))
|
2324
2349
|
return {
|
2325
2350
|
title: u,
|
2326
|
-
prop:
|
2351
|
+
prop: c,
|
2327
2352
|
type: "vector2",
|
2328
2353
|
value: n,
|
2329
|
-
disabled:
|
2354
|
+
disabled: o,
|
2330
2355
|
onChange: (h, f) => {
|
2331
|
-
t.updateObject(a.uuid, `material.${
|
2356
|
+
t.updateObject(a.uuid, `material.${c}`, f);
|
2332
2357
|
const m = t.scene?.getObjectByProperty("uuid", a.uuid);
|
2333
|
-
m !== void 0 && V(m, `material.${
|
2358
|
+
m !== void 0 && V(m, `material.${c}`, f);
|
2334
2359
|
}
|
2335
2360
|
};
|
2336
2361
|
if (oi(n))
|
2337
2362
|
return {
|
2338
2363
|
title: u,
|
2339
|
-
prop:
|
2364
|
+
prop: c,
|
2340
2365
|
type: "grid3",
|
2341
2366
|
value: n,
|
2342
|
-
disabled:
|
2367
|
+
disabled: o,
|
2343
2368
|
onChange: (h, f) => {
|
2344
|
-
t.updateObject(a.uuid, `material.${
|
2369
|
+
t.updateObject(a.uuid, `material.${c}`, f);
|
2345
2370
|
const m = t.scene?.getObjectByProperty("uuid", a.uuid);
|
2346
|
-
m !== void 0 && V(m, `material.${
|
2371
|
+
m !== void 0 && V(m, `material.${c}`, f);
|
2347
2372
|
}
|
2348
2373
|
};
|
2349
2374
|
if (ci(n))
|
2350
2375
|
return {
|
2351
2376
|
title: u,
|
2352
|
-
prop:
|
2377
|
+
prop: c,
|
2353
2378
|
type: "grid4",
|
2354
2379
|
value: n,
|
2355
|
-
disabled:
|
2380
|
+
disabled: o,
|
2356
2381
|
onChange: (h, f) => {
|
2357
|
-
t.updateObject(a.uuid, `material.${
|
2382
|
+
t.updateObject(a.uuid, `material.${c}`, f);
|
2358
2383
|
const m = t.scene?.getObjectByProperty("uuid", a.uuid);
|
2359
|
-
m !== void 0 && V(m, `material.${
|
2384
|
+
m !== void 0 && V(m, `material.${c}`, f);
|
2360
2385
|
}
|
2361
2386
|
};
|
2362
2387
|
if (n.isEuler)
|
2363
2388
|
return {
|
2364
2389
|
title: u,
|
2365
|
-
prop:
|
2390
|
+
prop: c,
|
2366
2391
|
type: "euler",
|
2367
2392
|
value: n,
|
2368
|
-
disabled:
|
2393
|
+
disabled: o,
|
2369
2394
|
onChange: (h, f) => {
|
2370
|
-
t.updateObject(a.uuid, `material.${
|
2395
|
+
t.updateObject(a.uuid, `material.${c}`, f);
|
2371
2396
|
const m = t.scene?.getObjectByProperty("uuid", a.uuid);
|
2372
|
-
m !== void 0 && V(m, `material.${
|
2397
|
+
m !== void 0 && V(m, `material.${c}`, f);
|
2373
2398
|
}
|
2374
2399
|
};
|
2375
2400
|
if (n.src !== void 0)
|
@@ -2377,27 +2402,27 @@ function ht(e, n, a, t, i = "", c = !1) {
|
|
2377
2402
|
title: u,
|
2378
2403
|
type: "image",
|
2379
2404
|
value: n,
|
2380
|
-
disabled:
|
2405
|
+
disabled: o,
|
2381
2406
|
onChange: (h, f) => {
|
2382
2407
|
const m = Za(e), x = i.length > 0 ? `${i}.${m}` : m;
|
2383
2408
|
t.createTexture(a.uuid, `material.${x}`, f);
|
2384
|
-
const
|
2385
|
-
|
2386
|
-
V(
|
2409
|
+
const M = t.scene?.getObjectByProperty("uuid", a.uuid);
|
2410
|
+
M !== void 0 && Ln(f).then((L) => {
|
2411
|
+
V(M, `material.${x}`, L), V(M, "material.needsUpdate", !0);
|
2387
2412
|
});
|
2388
2413
|
}
|
2389
2414
|
};
|
2390
2415
|
if (n.elements !== void 0)
|
2391
2416
|
return {
|
2392
2417
|
title: u,
|
2393
|
-
prop:
|
2418
|
+
prop: c,
|
2394
2419
|
type: n.elements.length > 9 ? "grid4" : "grid3",
|
2395
2420
|
value: n,
|
2396
|
-
disabled:
|
2421
|
+
disabled: o,
|
2397
2422
|
onChange: (h, f) => {
|
2398
|
-
t.updateObject(a.uuid, `material.${
|
2423
|
+
t.updateObject(a.uuid, `material.${c}`, f);
|
2399
2424
|
const m = t.scene?.getObjectByProperty("uuid", a.uuid);
|
2400
|
-
m !== void 0 && V(m, `material.${
|
2425
|
+
m !== void 0 && V(m, `material.${c}`, f);
|
2401
2426
|
}
|
2402
2427
|
};
|
2403
2428
|
{
|
@@ -2407,11 +2432,11 @@ function ht(e, n, a, t, i = "", c = !1) {
|
|
2407
2432
|
const x = n[m];
|
2408
2433
|
if (x !== void 0)
|
2409
2434
|
if (x.value !== void 0) {
|
2410
|
-
const
|
2411
|
-
|
2435
|
+
const M = ht(`${m}.value`, x.value, a, t, c, f);
|
2436
|
+
M !== void 0 && h.push(M);
|
2412
2437
|
} else {
|
2413
|
-
const
|
2414
|
-
|
2438
|
+
const M = ht(m, x, a, t, c, f);
|
2439
|
+
M !== void 0 && h.push(M);
|
2415
2440
|
}
|
2416
2441
|
}
|
2417
2442
|
} catch {
|
@@ -2431,18 +2456,18 @@ function rn(e, n, a) {
|
|
2431
2456
|
for (const i in e) {
|
2432
2457
|
if (!Ka(i))
|
2433
2458
|
continue;
|
2434
|
-
const
|
2435
|
-
if (
|
2459
|
+
const o = typeof e[i], u = e[i];
|
2460
|
+
if (o === "boolean")
|
2436
2461
|
t.push(ai(i, u, n, a));
|
2437
|
-
else if (
|
2462
|
+
else if (o === "number")
|
2438
2463
|
t.push(ii(i, u, n, a));
|
2439
|
-
else if (
|
2464
|
+
else if (o === "string")
|
2440
2465
|
t.push(ri(i, u, n, a));
|
2441
|
-
else if (
|
2442
|
-
const
|
2443
|
-
|
2466
|
+
else if (o === "object") {
|
2467
|
+
const c = ht(i, u, n, a);
|
2468
|
+
c !== void 0 && t.push(c);
|
2444
2469
|
} else
|
2445
|
-
u !== void 0 && console.log("other:", i,
|
2470
|
+
u !== void 0 && console.log("other:", i, o, u);
|
2446
2471
|
}
|
2447
2472
|
return Lt(t), t.push({
|
2448
2473
|
title: "Update Material",
|
@@ -2458,15 +2483,15 @@ function li(e, n) {
|
|
2458
2483
|
const a = e.material;
|
2459
2484
|
if (Array.isArray(a)) {
|
2460
2485
|
const t = [], i = a.length;
|
2461
|
-
for (let
|
2486
|
+
for (let o = 0; o < i; o++)
|
2462
2487
|
t.push(
|
2463
2488
|
/* @__PURE__ */ l.jsx(
|
2464
2489
|
Xe,
|
2465
2490
|
{
|
2466
|
-
title: `Material ${
|
2467
|
-
items: rn(a[
|
2491
|
+
title: `Material ${o}`,
|
2492
|
+
items: rn(a[o], e, n)
|
2468
2493
|
},
|
2469
|
-
`Material ${
|
2494
|
+
`Material ${o}`
|
2470
2495
|
)
|
2471
2496
|
);
|
2472
2497
|
return /* @__PURE__ */ l.jsx(l.Fragment, { children: t });
|
@@ -2480,32 +2505,32 @@ function li(e, n) {
|
|
2480
2505
|
);
|
2481
2506
|
}
|
2482
2507
|
function ui(e) {
|
2483
|
-
const [n, a] =
|
2484
|
-
return
|
2485
|
-
let t = !1, i = -1,
|
2486
|
-
const
|
2487
|
-
t = !0,
|
2508
|
+
const [n, a] = X(e.defaultValue);
|
2509
|
+
return _e(() => {
|
2510
|
+
let t = !1, i = -1, o = 0, u = e.defaultValue;
|
2511
|
+
const c = (x) => {
|
2512
|
+
t = !0, o = Number(e.input.current?.value), i = x.clientX, document.addEventListener("mouseup", h, !1), document.addEventListener("mousemove", d, !1), document.addEventListener("contextmenu", h, !1);
|
2488
2513
|
}, d = (x) => {
|
2489
2514
|
if (!t)
|
2490
2515
|
return;
|
2491
|
-
const
|
2492
|
-
u = Number((
|
2516
|
+
const M = e.step !== void 0 ? e.step : 1, L = (x.clientX - i) * M;
|
2517
|
+
u = Number((o + L).toFixed(4)), e.min !== void 0 && (u = Math.max(u, e.min)), e.max !== void 0 && (u = Math.min(u, e.max)), e.onChange !== void 0 && e.onChange(u), a(u);
|
2493
2518
|
}, h = () => {
|
2494
2519
|
t = !1, document.removeEventListener("mouseup", h), document.removeEventListener("mousemove", d), document.removeEventListener("contextmenu", h);
|
2495
2520
|
}, f = (x) => {
|
2496
|
-
const
|
2497
|
-
a(
|
2521
|
+
const M = Number(x.target.value);
|
2522
|
+
a(M);
|
2498
2523
|
}, m = (x) => {
|
2499
|
-
const
|
2500
|
-
e.onChange !== void 0 && e.onChange(
|
2524
|
+
const M = Number(x.target.value);
|
2525
|
+
e.onChange !== void 0 && e.onChange(M), a(M);
|
2501
2526
|
};
|
2502
|
-
return e.input.current?.addEventListener("input", f), e.label.current?.addEventListener("mousedown",
|
2503
|
-
e.input.current?.removeEventListener("input", f), e.label.current?.removeEventListener("mousedown",
|
2527
|
+
return e.input.current?.addEventListener("input", f), e.label.current?.addEventListener("mousedown", c, !1), e.sliderRef !== void 0 && e.sliderRef.current?.addEventListener("input", m), () => {
|
2528
|
+
e.input.current?.removeEventListener("input", f), e.label.current?.removeEventListener("mousedown", c), e.sliderRef !== void 0 && e.sliderRef.current?.removeEventListener("input", m), document.removeEventListener("mouseup", h), document.removeEventListener("mousemove", d), document.removeEventListener("contextmenu", h);
|
2504
2529
|
};
|
2505
2530
|
}, []), n;
|
2506
2531
|
}
|
2507
2532
|
function Ze(e) {
|
2508
|
-
const n =
|
2533
|
+
const n = q(null), a = q(null), t = ui({
|
2509
2534
|
label: e.labelRef,
|
2510
2535
|
input: n,
|
2511
2536
|
sliderRef: a,
|
@@ -2531,8 +2556,8 @@ function Ze(e) {
|
|
2531
2556
|
step: e.step,
|
2532
2557
|
disabled: e.disabled,
|
2533
2558
|
onChange: (i) => {
|
2534
|
-
const
|
2535
|
-
e.onChange !== void 0 && e.onChange(e.prop,
|
2559
|
+
const o = Number(i.target.value);
|
2560
|
+
e.onChange !== void 0 && e.onChange(e.prop, o);
|
2536
2561
|
}
|
2537
2562
|
}
|
2538
2563
|
),
|
@@ -2546,8 +2571,8 @@ function Ze(e) {
|
|
2546
2571
|
ref: n,
|
2547
2572
|
className: "min",
|
2548
2573
|
onChange: (i) => {
|
2549
|
-
const
|
2550
|
-
e.onChange !== void 0 && e.onChange(e.prop,
|
2574
|
+
const o = Number(i.target.value);
|
2575
|
+
e.onChange !== void 0 && e.onChange(e.prop, o);
|
2551
2576
|
}
|
2552
2577
|
}
|
2553
2578
|
),
|
@@ -2568,36 +2593,36 @@ function Ze(e) {
|
|
2568
2593
|
] });
|
2569
2594
|
}
|
2570
2595
|
function di(e) {
|
2571
|
-
const n =
|
2596
|
+
const n = q(null), a = q(null), t = q(null), i = q(null), o = q(null), u = q(null), [c, d] = X(e.value), [h, f] = X({
|
2572
2597
|
min: Math.min(e.min, Math.min(e.value.x, e.value.y)),
|
2573
2598
|
max: Math.max(e.max, Math.max(e.value.x, e.value.y))
|
2574
|
-
}), [m, x] =
|
2575
|
-
function
|
2576
|
-
m || (window.addEventListener("mousemove", te), window.addEventListener("mouseup",
|
2599
|
+
}), [m, x] = X(!1);
|
2600
|
+
function M() {
|
2601
|
+
m || (window.addEventListener("mousemove", te), window.addEventListener("mouseup", L), window.addEventListener("mouseup", L), x(!0));
|
2577
2602
|
}
|
2578
|
-
function
|
2579
|
-
window.removeEventListener("mousemove", te), window.removeEventListener("mouseup",
|
2603
|
+
function L() {
|
2604
|
+
window.removeEventListener("mousemove", te), window.removeEventListener("mouseup", L), x(!1);
|
2580
2605
|
}
|
2581
2606
|
function te(I) {
|
2582
|
-
const
|
2583
|
-
e.onChange({ target: { value: { x:
|
2607
|
+
const K = o.current.getBoundingClientRect(), ne = Ke(0, 99, I.clientX - K.left) / 99, Se = Ke(0, 99, I.clientY - K.top) / 99, G = tn(en(h.min, h.max, ne), 3), pe = tn(en(h.min, h.max, Se), 3);
|
2608
|
+
e.onChange({ target: { value: { x: G, y: pe } } }), d({ x: G, y: pe });
|
2584
2609
|
}
|
2585
2610
|
function me(I) {
|
2586
|
-
let
|
2587
|
-
I.target === n.current ?
|
2611
|
+
let K = c.x, ne = c.y;
|
2612
|
+
I.target === n.current ? K = Number(I.target.value) : ne = Number(I.target.value), d({ x: K, y: ne });
|
2588
2613
|
}
|
2589
2614
|
function re() {
|
2590
2615
|
const I = Number(t.current.value);
|
2591
|
-
f({ min: I, max: h.max }), (
|
2616
|
+
f({ min: I, max: h.max }), (c.x < I || c.y < I) && d({ x: Ke(I, h.max, c.x), y: Ke(I, h.max, c.y) });
|
2592
2617
|
}
|
2593
|
-
function
|
2618
|
+
function z() {
|
2594
2619
|
const I = Number(i.current.value);
|
2595
|
-
f({ min: h.min, max: I }), (
|
2620
|
+
f({ min: h.min, max: I }), (c.x > I || c.y > I) && d({ x: Ke(h.min, I, c.x), y: Ke(h.min, I, c.y) });
|
2596
2621
|
}
|
2597
|
-
return
|
2598
|
-
const I = Qt(h.min, h.max,
|
2599
|
-
u.current.style.left = `${I * 100}%`, u.current.style.top = `${
|
2600
|
-
}, [h,
|
2622
|
+
return _e(() => {
|
2623
|
+
const I = Qt(h.min, h.max, c.x), K = Qt(h.min, h.max, c.y);
|
2624
|
+
u.current.style.left = `${I * 100}%`, u.current.style.top = `${K * 100}%`;
|
2625
|
+
}, [h, c]), /* @__PURE__ */ l.jsxs("div", { className: "vector2", children: [
|
2601
2626
|
/* @__PURE__ */ l.jsxs("div", { className: "fields", children: [
|
2602
2627
|
/* @__PURE__ */ l.jsxs("div", { children: [
|
2603
2628
|
/* @__PURE__ */ l.jsx("label", { children: "X:" }),
|
@@ -2606,7 +2631,7 @@ function di(e) {
|
|
2606
2631
|
{
|
2607
2632
|
ref: n,
|
2608
2633
|
type: "number",
|
2609
|
-
value:
|
2634
|
+
value: c.x,
|
2610
2635
|
min: h.min,
|
2611
2636
|
max: h.max,
|
2612
2637
|
step: 0.01,
|
@@ -2621,7 +2646,7 @@ function di(e) {
|
|
2621
2646
|
{
|
2622
2647
|
ref: a,
|
2623
2648
|
type: "number",
|
2624
|
-
value:
|
2649
|
+
value: c.y,
|
2625
2650
|
min: h.min,
|
2626
2651
|
max: h.max,
|
2627
2652
|
step: 0.01,
|
@@ -2651,12 +2676,12 @@ function di(e) {
|
|
2651
2676
|
type: "number",
|
2652
2677
|
value: h.max,
|
2653
2678
|
step: 0.01,
|
2654
|
-
onChange:
|
2679
|
+
onChange: z
|
2655
2680
|
}
|
2656
2681
|
)
|
2657
2682
|
] })
|
2658
2683
|
] }),
|
2659
|
-
/* @__PURE__ */ l.jsxs("div", { className: "input", ref:
|
2684
|
+
/* @__PURE__ */ l.jsxs("div", { className: "input", ref: o, onMouseDown: M, onMouseUp: L, children: [
|
2660
2685
|
/* @__PURE__ */ l.jsx("div", { className: "x" }),
|
2661
2686
|
/* @__PURE__ */ l.jsx("div", { className: "y" }),
|
2662
2687
|
/* @__PURE__ */ l.jsx("div", { className: "pt", ref: u })
|
@@ -2666,18 +2691,18 @@ function di(e) {
|
|
2666
2691
|
function sn(e) {
|
2667
2692
|
const n = e.value.isVector3 !== void 0, a = e.value.isEuler !== void 0, t = e.value.elements !== void 0, i = [];
|
2668
2693
|
if (n) {
|
2669
|
-
const
|
2670
|
-
|
2694
|
+
const o = ie(() => e.value, []), u = (d, h) => {
|
2695
|
+
o[d] = h, e.onChange({ target: { value: o } });
|
2671
2696
|
};
|
2672
2697
|
["x", "y", "z"].forEach((d) => {
|
2673
|
-
const h =
|
2698
|
+
const h = q(null);
|
2674
2699
|
i.push(
|
2675
2700
|
/* @__PURE__ */ l.jsxs("div", { children: [
|
2676
2701
|
/* @__PURE__ */ l.jsx("label", { ref: h, children: d.toUpperCase() }),
|
2677
2702
|
/* @__PURE__ */ l.jsx(
|
2678
2703
|
Ze,
|
2679
2704
|
{
|
2680
|
-
value:
|
2705
|
+
value: o[d],
|
2681
2706
|
type: "number",
|
2682
2707
|
prop: d,
|
2683
2708
|
step: 0.01,
|
@@ -2689,18 +2714,18 @@ function sn(e) {
|
|
2689
2714
|
);
|
2690
2715
|
});
|
2691
2716
|
} else if (a) {
|
2692
|
-
const
|
2693
|
-
|
2717
|
+
const o = ie(() => e.value, []), u = (d, h) => {
|
2718
|
+
o[d] = h, e.onChange({ target: { value: o } });
|
2694
2719
|
};
|
2695
2720
|
["_x", "_y", "_z"].forEach((d) => {
|
2696
|
-
const h =
|
2721
|
+
const h = q(null);
|
2697
2722
|
i.push(
|
2698
2723
|
/* @__PURE__ */ l.jsxs("div", { children: [
|
2699
2724
|
/* @__PURE__ */ l.jsx("label", { ref: h, children: d.substring(1).toUpperCase() }),
|
2700
2725
|
/* @__PURE__ */ l.jsx(
|
2701
2726
|
Ze,
|
2702
2727
|
{
|
2703
|
-
value:
|
2728
|
+
value: o[d],
|
2704
2729
|
type: "number",
|
2705
2730
|
prop: d,
|
2706
2731
|
step: 0.01,
|
@@ -2712,27 +2737,27 @@ function sn(e) {
|
|
2712
2737
|
);
|
2713
2738
|
});
|
2714
2739
|
} else if (t) {
|
2715
|
-
const
|
2716
|
-
const h = Number(
|
2717
|
-
|
2740
|
+
const o = ie(() => e.value, []), u = (c, d) => {
|
2741
|
+
const h = Number(c);
|
2742
|
+
o.elements[h] = d, e.onChange({ target: { value: o } });
|
2718
2743
|
};
|
2719
|
-
for (let
|
2720
|
-
const d =
|
2744
|
+
for (let c = 0; c < 9; c++) {
|
2745
|
+
const d = q(null);
|
2721
2746
|
i.push(
|
2722
2747
|
/* @__PURE__ */ l.jsxs("div", { children: [
|
2723
|
-
/* @__PURE__ */ l.jsx("label", { ref: d, children:
|
2748
|
+
/* @__PURE__ */ l.jsx("label", { ref: d, children: c + 1 }),
|
2724
2749
|
/* @__PURE__ */ l.jsx(
|
2725
2750
|
Ze,
|
2726
2751
|
{
|
2727
|
-
value:
|
2752
|
+
value: o.elements[c],
|
2728
2753
|
type: "number",
|
2729
|
-
prop:
|
2754
|
+
prop: c.toString(),
|
2730
2755
|
step: 0.01,
|
2731
2756
|
labelRef: d,
|
2732
2757
|
onChange: u
|
2733
2758
|
}
|
2734
2759
|
)
|
2735
|
-
] },
|
2760
|
+
] }, c.toString())
|
2736
2761
|
);
|
2737
2762
|
}
|
2738
2763
|
}
|
@@ -2741,14 +2766,14 @@ function sn(e) {
|
|
2741
2766
|
function hi(e) {
|
2742
2767
|
const n = e.value.x !== void 0, a = [];
|
2743
2768
|
if (n) {
|
2744
|
-
const t = ie(() => e.value, []), i = (u,
|
2745
|
-
t[u] =
|
2769
|
+
const t = ie(() => e.value, []), i = (u, c) => {
|
2770
|
+
t[u] = c, e.onChange({ target: { value: t } });
|
2746
2771
|
};
|
2747
2772
|
["x", "y", "z", "w"].forEach((u) => {
|
2748
|
-
const
|
2773
|
+
const c = q(null);
|
2749
2774
|
a.push(
|
2750
2775
|
/* @__PURE__ */ l.jsxs("div", { children: [
|
2751
|
-
/* @__PURE__ */ l.jsx("label", { ref:
|
2776
|
+
/* @__PURE__ */ l.jsx("label", { ref: c, children: u.toUpperCase() }),
|
2752
2777
|
/* @__PURE__ */ l.jsx(
|
2753
2778
|
Ze,
|
2754
2779
|
{
|
@@ -2756,7 +2781,7 @@ function hi(e) {
|
|
2756
2781
|
type: "number",
|
2757
2782
|
prop: u,
|
2758
2783
|
step: 0.01,
|
2759
|
-
labelRef:
|
2784
|
+
labelRef: c,
|
2760
2785
|
onChange: i
|
2761
2786
|
}
|
2762
2787
|
)
|
@@ -2764,43 +2789,43 @@ function hi(e) {
|
|
2764
2789
|
);
|
2765
2790
|
});
|
2766
2791
|
} else {
|
2767
|
-
const t = ie(() => e.value, []), i = (
|
2768
|
-
const
|
2769
|
-
t.elements[
|
2792
|
+
const t = ie(() => e.value, []), i = (o, u) => {
|
2793
|
+
const c = Number(o);
|
2794
|
+
t.elements[c] = u, e.onChange({ target: { value: t } });
|
2770
2795
|
};
|
2771
|
-
for (let
|
2772
|
-
const u =
|
2796
|
+
for (let o = 0; o < 16; o++) {
|
2797
|
+
const u = q(null);
|
2773
2798
|
a.push(
|
2774
2799
|
/* @__PURE__ */ l.jsxs("div", { children: [
|
2775
|
-
/* @__PURE__ */ l.jsx("label", { ref: u, children:
|
2800
|
+
/* @__PURE__ */ l.jsx("label", { ref: u, children: o + 1 }),
|
2776
2801
|
/* @__PURE__ */ l.jsx(
|
2777
2802
|
Ze,
|
2778
2803
|
{
|
2779
|
-
value: t.elements[
|
2804
|
+
value: t.elements[o],
|
2780
2805
|
type: "number",
|
2781
|
-
prop:
|
2806
|
+
prop: o.toString(),
|
2782
2807
|
step: 0.01,
|
2783
2808
|
labelRef: u,
|
2784
2809
|
onChange: i
|
2785
2810
|
}
|
2786
2811
|
)
|
2787
|
-
] },
|
2812
|
+
] }, o.toString())
|
2788
2813
|
);
|
2789
2814
|
}
|
2790
2815
|
}
|
2791
2816
|
return /* @__PURE__ */ l.jsx("div", { className: "grid4", children: a });
|
2792
2817
|
}
|
2793
|
-
function
|
2818
|
+
function St(e) {
|
2794
2819
|
let n = e.value;
|
2795
|
-
n !== void 0 && n.isColor !== void 0 && (n =
|
2796
|
-
const [a, t] =
|
2820
|
+
n !== void 0 && n.isColor !== void 0 && (n = ka(e.value));
|
2821
|
+
const [a, t] = X(n), i = q(null), o = q(null), u = (f) => {
|
2797
2822
|
let m = f.target.value;
|
2798
2823
|
e.type === "boolean" ? m = f.target.checked : e.type === "option" && (m = e.options[m].value), t(m), e.onChange !== void 0 && e.onChange(e.prop !== void 0 ? e.prop : e.title, m);
|
2799
|
-
},
|
2800
|
-
e.disabled && (
|
2824
|
+
}, c = {};
|
2825
|
+
e.disabled && (c.opacity = 0.8);
|
2801
2826
|
const d = e.type === "string" && (a.length > 100 || a.search(`
|
2802
2827
|
`) > -1), h = d || e.type === "image" || e.type === "vector2";
|
2803
|
-
return /* @__PURE__ */ l.jsxs("div", { className: `field ${h ? "block" : ""}`, style:
|
2828
|
+
return /* @__PURE__ */ l.jsxs("div", { className: `field ${h ? "block" : ""}`, style: c, children: [
|
2804
2829
|
e.type !== "button" && /* @__PURE__ */ l.jsx("label", { ref: i, children: Mt(e.title) }, "fieldLabel"),
|
2805
2830
|
e.type === "string" && !d && /* @__PURE__ */ l.jsx(
|
2806
2831
|
"input",
|
@@ -2875,9 +2900,9 @@ function ft(e) {
|
|
2875
2900
|
children: e.title
|
2876
2901
|
}
|
2877
2902
|
),
|
2878
|
-
e.type === "image" && /* @__PURE__ */ l.jsx("img", { alt: e.title, ref:
|
2903
|
+
e.type === "image" && /* @__PURE__ */ l.jsx("img", { alt: e.title, ref: o, onClick: () => {
|
2879
2904
|
Xa().then((f) => {
|
2880
|
-
|
2905
|
+
o.current.src = f, e.onChange !== void 0 && e.onChange(e.prop !== void 0 ? e.prop : e.title, f);
|
2881
2906
|
});
|
2882
2907
|
}, src: a.src.length > 0 ? a.src : Va }),
|
2883
2908
|
e.type === "option" && /* @__PURE__ */ l.jsx(l.Fragment, { children: /* @__PURE__ */ l.jsx("select", { onChange: u, disabled: e.disabled, defaultValue: e.value, children: e.options?.map((f, m) => /* @__PURE__ */ l.jsx("option", { value: f.value, children: Mt(f.title) }, m)) }) }),
|
@@ -2926,10 +2951,10 @@ function fi(e, n) {
|
|
2926
2951
|
type: "number",
|
2927
2952
|
step: 0.01,
|
2928
2953
|
value: e.perspectiveCameraInfo[t],
|
2929
|
-
onChange: (i,
|
2930
|
-
n.updateObject(e.uuid, i,
|
2954
|
+
onChange: (i, o) => {
|
2955
|
+
n.updateObject(e.uuid, i, o), n.requestMethod(e.uuid, "updateProjectionMatrix");
|
2931
2956
|
const u = n.scene?.getObjectByProperty("uuid", e.uuid);
|
2932
|
-
u !== void 0 && (V(u, i,
|
2957
|
+
u !== void 0 && (V(u, i, o), u.updateProjectionMatrix());
|
2933
2958
|
}
|
2934
2959
|
});
|
2935
2960
|
else if (e.orthographicCameraInfo !== void 0)
|
@@ -2940,10 +2965,10 @@ function fi(e, n) {
|
|
2940
2965
|
type: "number",
|
2941
2966
|
step: 0.01,
|
2942
2967
|
value: e.perspectiveCameraInfo[t],
|
2943
|
-
onChange: (i,
|
2944
|
-
n.updateObject(e.uuid, i,
|
2968
|
+
onChange: (i, o) => {
|
2969
|
+
n.updateObject(e.uuid, i, o), n.requestMethod(e.uuid, "updateProjectionMatrix");
|
2945
2970
|
const u = n.scene?.getObjectByProperty("uuid", e.uuid);
|
2946
|
-
u !== void 0 && (V(u, i,
|
2971
|
+
u !== void 0 && (V(u, i, o), u.updateProjectionMatrix());
|
2947
2972
|
}
|
2948
2973
|
});
|
2949
2974
|
return /* @__PURE__ */ l.jsx(
|
@@ -2957,13 +2982,13 @@ function fi(e, n) {
|
|
2957
2982
|
function mi(e, n) {
|
2958
2983
|
const a = new ra();
|
2959
2984
|
a.elements = e.matrix;
|
2960
|
-
const t = new Y(), i = new sa(),
|
2961
|
-
e.uuid.length > 0 && (t.setFromMatrixPosition(a), i.setFromRotationMatrix(a),
|
2962
|
-
const u = (
|
2963
|
-
const h =
|
2964
|
-
n.updateObject(e.uuid,
|
2985
|
+
const t = new Y(), i = new sa(), o = new Y();
|
2986
|
+
e.uuid.length > 0 && (t.setFromMatrixPosition(a), i.setFromRotationMatrix(a), o.setFromMatrixScale(a));
|
2987
|
+
const u = (c, d) => {
|
2988
|
+
const h = c === "rotation" ? { x: d._x, y: d._y, z: d._z } : d;
|
2989
|
+
n.updateObject(e.uuid, c, h);
|
2965
2990
|
const f = n.scene?.getObjectByProperty("uuid", e.uuid);
|
2966
|
-
f !== void 0 && V(f,
|
2991
|
+
f !== void 0 && V(f, c, h);
|
2967
2992
|
};
|
2968
2993
|
return /* @__PURE__ */ l.jsx(
|
2969
2994
|
Xe,
|
@@ -2988,7 +3013,7 @@ function mi(e, n) {
|
|
2988
3013
|
title: "Scale",
|
2989
3014
|
prop: "scale",
|
2990
3015
|
type: "grid3",
|
2991
|
-
value:
|
3016
|
+
value: o,
|
2992
3017
|
onChange: u
|
2993
3018
|
}
|
2994
3019
|
]
|
@@ -3028,11 +3053,11 @@ function pi(e, n) {
|
|
3028
3053
|
prop: t,
|
3029
3054
|
type: "color",
|
3030
3055
|
value: i,
|
3031
|
-
onChange: (
|
3032
|
-
const
|
3033
|
-
n.updateObject(e.uuid,
|
3056
|
+
onChange: (o, u) => {
|
3057
|
+
const c = new Bt(u);
|
3058
|
+
n.updateObject(e.uuid, o, c);
|
3034
3059
|
const d = n.scene?.getObjectByProperty("uuid", e.uuid);
|
3035
|
-
d !== void 0 && V(d,
|
3060
|
+
d !== void 0 && V(d, o, c);
|
3036
3061
|
}
|
3037
3062
|
}) : a.push({
|
3038
3063
|
title: cn(t),
|
@@ -3040,10 +3065,10 @@ function pi(e, n) {
|
|
3040
3065
|
type: typeof i,
|
3041
3066
|
value: i,
|
3042
3067
|
step: typeof i == "number" ? 0.01 : void 0,
|
3043
|
-
onChange: (
|
3044
|
-
n.updateObject(e.uuid,
|
3045
|
-
const
|
3046
|
-
|
3068
|
+
onChange: (o, u) => {
|
3069
|
+
n.updateObject(e.uuid, o, u);
|
3070
|
+
const c = n.scene?.getObjectByProperty("uuid", e.uuid);
|
3071
|
+
c !== void 0 && V(c, o, u);
|
3047
3072
|
}
|
3048
3073
|
}));
|
3049
3074
|
}
|
@@ -3058,14 +3083,14 @@ function pi(e, n) {
|
|
3058
3083
|
function gi(e, n) {
|
3059
3084
|
const a = [], t = [];
|
3060
3085
|
let i = 0;
|
3061
|
-
e.animations.forEach((
|
3062
|
-
i = Math.max(i,
|
3063
|
-
title:
|
3086
|
+
e.animations.forEach((c) => {
|
3087
|
+
i = Math.max(i, c.duration), c.duration > 0 && t.push({
|
3088
|
+
title: c.name,
|
3064
3089
|
items: [
|
3065
3090
|
{
|
3066
3091
|
title: "Duration",
|
3067
3092
|
type: "number",
|
3068
|
-
value:
|
3093
|
+
value: c.duration,
|
3069
3094
|
disabled: !0
|
3070
3095
|
},
|
3071
3096
|
{
|
@@ -3089,21 +3114,21 @@ function gi(e, n) {
|
|
3089
3114
|
title: "Animations",
|
3090
3115
|
items: t
|
3091
3116
|
});
|
3092
|
-
const
|
3117
|
+
const o = n.scene?.getObjectByProperty("uuid", e.uuid);
|
3093
3118
|
let u = !1;
|
3094
|
-
if (
|
3095
|
-
const
|
3096
|
-
if (u =
|
3119
|
+
if (o !== void 0) {
|
3120
|
+
const c = o.mixer;
|
3121
|
+
if (u = c !== void 0, u) {
|
3097
3122
|
const d = [
|
3098
3123
|
{
|
3099
3124
|
title: "Time Scale",
|
3100
3125
|
type: "range",
|
3101
|
-
value:
|
3126
|
+
value: c.timeScale,
|
3102
3127
|
step: 0.01,
|
3103
3128
|
min: -1,
|
3104
3129
|
max: 2,
|
3105
3130
|
onChange: (h, f) => {
|
3106
|
-
|
3131
|
+
c.timeScale = f, n.updateObject(e.uuid, "mixer.timeScale", f);
|
3107
3132
|
}
|
3108
3133
|
}
|
3109
3134
|
];
|
@@ -3111,7 +3136,7 @@ function gi(e, n) {
|
|
3111
3136
|
title: "Stop All",
|
3112
3137
|
type: "button",
|
3113
3138
|
onChange: () => {
|
3114
|
-
|
3139
|
+
c.stopAllAction(), n.requestMethod(e.uuid, "stopAllAction", void 0, "mixer");
|
3115
3140
|
}
|
3116
3141
|
}), a.push({
|
3117
3142
|
title: "Mixer",
|
@@ -3133,85 +3158,71 @@ const $n = {
|
|
3133
3158
|
orthographicCameraInfo: void 0,
|
3134
3159
|
lightInfo: void 0
|
3135
3160
|
};
|
3136
|
-
let
|
3161
|
+
let he = { ...$n };
|
3137
3162
|
function vi(e) {
|
3138
|
-
const [n, a] =
|
3139
|
-
|
3163
|
+
const [n, a] = X(-1);
|
3164
|
+
_e(() => {
|
3140
3165
|
function u(d) {
|
3141
|
-
|
3166
|
+
he = { ...d.value }, a(Date.now());
|
3142
3167
|
}
|
3143
|
-
function
|
3144
|
-
|
3168
|
+
function c() {
|
3169
|
+
he = { ...$n }, a(Date.now());
|
3145
3170
|
}
|
3146
|
-
return j.addEventListener(
|
3147
|
-
j.removeEventListener(
|
3171
|
+
return j.addEventListener(D.SET_SCENE, c), j.addEventListener(D.SET_OBJECT, u), () => {
|
3172
|
+
j.removeEventListener(D.SET_SCENE, c), j.removeEventListener(D.SET_OBJECT, u);
|
3148
3173
|
};
|
3149
3174
|
}, []);
|
3150
|
-
const t =
|
3151
|
-
return /* @__PURE__ */ l.jsx(zt, { label: "Inspector", children: /* @__PURE__ */ l.jsx("div", { id: "Inspector", className: e.class, children:
|
3175
|
+
const t = he.type.toLowerCase(), i = he.animations.length > 0 || he.mixer !== void 0, o = t.search("mesh") > -1 || t.search("line") > -1 || t.search("points") > -1;
|
3176
|
+
return /* @__PURE__ */ l.jsx(zt, { label: "Inspector", children: /* @__PURE__ */ l.jsx("div", { id: "Inspector", className: e.class, children: he.uuid.length > 0 && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
3152
3177
|
/* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
3153
3178
|
/* @__PURE__ */ l.jsx(
|
3154
|
-
|
3179
|
+
St,
|
3155
3180
|
{
|
3156
3181
|
type: "string",
|
3157
3182
|
title: "Name",
|
3158
3183
|
prop: "name",
|
3159
|
-
value:
|
3184
|
+
value: he.name,
|
3160
3185
|
disabled: !0
|
3161
3186
|
}
|
3162
3187
|
),
|
3163
3188
|
/* @__PURE__ */ l.jsx(
|
3164
|
-
|
3189
|
+
St,
|
3165
3190
|
{
|
3166
3191
|
type: "string",
|
3167
3192
|
title: "Type",
|
3168
3193
|
prop: "type",
|
3169
|
-
value:
|
3194
|
+
value: he.type,
|
3170
3195
|
disabled: !0
|
3171
3196
|
}
|
3172
3197
|
),
|
3173
3198
|
/* @__PURE__ */ l.jsx(
|
3174
|
-
|
3199
|
+
St,
|
3175
3200
|
{
|
3176
3201
|
type: "string",
|
3177
3202
|
title: "UUID",
|
3178
3203
|
prop: "uuid",
|
3179
|
-
value:
|
3204
|
+
value: he.uuid,
|
3180
3205
|
disabled: !0
|
3181
3206
|
}
|
3182
|
-
),
|
3183
|
-
/* @__PURE__ */ l.jsx(
|
3184
|
-
ft,
|
3185
|
-
{
|
3186
|
-
type: "boolean",
|
3187
|
-
title: "Visible",
|
3188
|
-
prop: "visible",
|
3189
|
-
value: se.visible,
|
3190
|
-
onChange: (u, o) => {
|
3191
|
-
e.three.updateObject(se.uuid, u, o);
|
3192
|
-
const d = e.three.scene?.getObjectByProperty("uuid", se.uuid);
|
3193
|
-
d !== void 0 && V(d, u, o);
|
3194
|
-
}
|
3195
|
-
}
|
3196
3207
|
)
|
3197
3208
|
] }),
|
3198
3209
|
/* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
3199
|
-
mi(
|
3200
|
-
i ? gi(
|
3201
|
-
t.search("camera") > -1 ? fi(
|
3202
|
-
t.search("light") > -1 ? pi(
|
3203
|
-
|
3210
|
+
mi(he, e.three),
|
3211
|
+
i ? gi(he, e.three) : null,
|
3212
|
+
t.search("camera") > -1 ? fi(he, e.three) : null,
|
3213
|
+
t.search("light") > -1 ? pi(he, e.three) : null,
|
3214
|
+
o ? li(he, e.three) : null
|
3204
3215
|
] })
|
3205
3216
|
] }) }, n) }, "Inspector");
|
3206
3217
|
}
|
3207
3218
|
function Fi(e) {
|
3208
|
-
const [n, a] =
|
3209
|
-
|
3210
|
-
const
|
3219
|
+
const [n, a] = X(e.scene);
|
3220
|
+
_e(() => {
|
3221
|
+
const o = (u) => {
|
3211
3222
|
a(u.value);
|
3212
3223
|
};
|
3213
|
-
return j.addEventListener(
|
3214
|
-
j.removeEventListener(
|
3224
|
+
return j.addEventListener(D.SET_SCENE, o), () => {
|
3225
|
+
j.removeEventListener(D.SET_SCENE, o);
|
3215
3226
|
};
|
3216
3227
|
}, []);
|
3217
3228
|
const t = n !== null, i = "Hierarchy - " + (t ? `${n?.name}` : "No Scene");
|
@@ -3224,51 +3235,51 @@ function Ui(e) {
|
|
3224
3235
|
function n() {
|
3225
3236
|
return e.three.scene === void 0 ? (console.log("No scene:", e.three), !1) : !0;
|
3226
3237
|
}
|
3227
|
-
const a = (
|
3238
|
+
const a = (c) => {
|
3228
3239
|
if (!n())
|
3229
3240
|
return;
|
3230
|
-
const d = e.three.scene?.getObjectByProperty("uuid",
|
3241
|
+
const d = e.three.scene?.getObjectByProperty("uuid", c.value);
|
3231
3242
|
d !== void 0 && e.three.setObject(d);
|
3232
|
-
}, t = (
|
3243
|
+
}, t = (c, d, h) => {
|
3233
3244
|
if (!n())
|
3234
3245
|
return;
|
3235
|
-
const f = e.three.scene?.getObjectByProperty("uuid",
|
3246
|
+
const f = e.three.scene?.getObjectByProperty("uuid", c);
|
3236
3247
|
f !== void 0 && V(f, d, h);
|
3237
|
-
}, i = (
|
3248
|
+
}, i = (c) => {
|
3238
3249
|
if (!n())
|
3239
3250
|
return;
|
3240
|
-
const d =
|
3251
|
+
const d = c.value, { key: h, value: f, uuid: m } = d;
|
3241
3252
|
t(m, h, f);
|
3242
|
-
},
|
3253
|
+
}, o = (c) => {
|
3243
3254
|
if (!n())
|
3244
3255
|
return;
|
3245
|
-
const d =
|
3256
|
+
const d = c.value;
|
3246
3257
|
Ln(d.value).then((h) => {
|
3247
3258
|
t(d.uuid, d.key, h), t(d.uuid, "material.needsUpdate", !0);
|
3248
3259
|
});
|
3249
|
-
}, u = (
|
3260
|
+
}, u = (c) => {
|
3250
3261
|
if (!n())
|
3251
3262
|
return;
|
3252
|
-
const { key: d, uuid: h, value: f, subitem: m } =
|
3263
|
+
const { key: d, uuid: h, value: f, subitem: m } = c.value, x = e.three.scene?.getObjectByProperty("uuid", h);
|
3253
3264
|
if (x !== void 0)
|
3254
3265
|
try {
|
3255
3266
|
m !== void 0 ? Na(x, m)[d](f) : x[d](f);
|
3256
|
-
} catch (
|
3257
|
-
console.log("Error requesting method:"), console.log(
|
3267
|
+
} catch (M) {
|
3268
|
+
console.log("Error requesting method:"), console.log(M), console.log(d), console.log(f);
|
3258
3269
|
}
|
3259
3270
|
};
|
3260
|
-
return
|
3261
|
-
j.removeEventListener(
|
3271
|
+
return _e(() => (j.addEventListener(D.GET_OBJECT, a), j.addEventListener(D.UPDATE_OBJECT, i), j.addEventListener(D.CREATE_TEXTURE, o), j.addEventListener(D.REQUEST_METHOD, u), () => {
|
3272
|
+
j.removeEventListener(D.GET_OBJECT, a), j.removeEventListener(D.UPDATE_OBJECT, i), j.removeEventListener(D.CREATE_TEXTURE, o), j.removeEventListener(D.REQUEST_METHOD, u);
|
3262
3273
|
}), []), null;
|
3263
3274
|
}
|
3264
3275
|
class bi extends oa {
|
3265
3276
|
constructor(n, a) {
|
3266
3277
|
const t = [1, 1, 0, -1, 1, 0, -1, -1, 0, 1, -1, 0, 1, 1, 0], i = new Vt();
|
3267
3278
|
i.setAttribute("position", new qt(t, 3)), i.computeBoundingSphere();
|
3268
|
-
const
|
3269
|
-
super(i,
|
3270
|
-
const u = [1, 1, 0, -1, 1, 0, -1, -1, 0, 1, 1, 0, -1, -1, 0, 1, -1, 0],
|
3271
|
-
|
3279
|
+
const o = new ca({ fog: !1 });
|
3280
|
+
super(i, o), this.light = n, this.color = a, this.type = "RectAreaLightHelper";
|
3281
|
+
const u = [1, 1, 0, -1, 1, 0, -1, -1, 0, 1, 1, 0, -1, -1, 0, 1, -1, 0], c = new Vt();
|
3282
|
+
c.setAttribute("position", new qt(u, 3)), c.computeBoundingSphere(), this.add(new kn(c, new Pn({ side: mn, fog: !1 })));
|
3272
3283
|
}
|
3273
3284
|
updateMatrixWorld() {
|
3274
3285
|
if (this.scale.set(0.5 * this.light.width, 0.5 * this.light.height, 1), this.color !== void 0)
|
@@ -3284,13 +3295,13 @@ class bi extends oa {
|
|
3284
3295
|
this.geometry.dispose(), this.material.dispose(), this.children[0].geometry.dispose(), this.children[0].material.dispose();
|
3285
3296
|
}
|
3286
3297
|
}
|
3287
|
-
const ln = { type: "change" },
|
3298
|
+
const ln = { type: "change" }, Dt = { type: "start" }, un = { type: "end" }, xt = new la(), dn = new ua(), yi = Math.cos(70 * da.DEG2RAD);
|
3288
3299
|
class xi extends hn {
|
3289
3300
|
constructor(n, a) {
|
3290
3301
|
super(), this.object = n, this.domElement = a, this.domElement.style.touchAction = "none", this.enabled = !0, this.target = new Y(), this.cursor = new Y(), this.minDistance = 0, this.maxDistance = 1 / 0, this.minZoom = 0, this.maxZoom = 1 / 0, this.minTargetRadius = 0, this.maxTargetRadius = 1 / 0, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.enableDamping = !1, this.dampingFactor = 0.05, this.enableZoom = !0, this.zoomSpeed = 1, this.enableRotate = !0, this.rotateSpeed = 1, this.enablePan = !0, this.panSpeed = 1, this.screenSpacePanning = !0, this.keyPanSpeed = 7, this.zoomToCursor = !1, this.autoRotate = !1, this.autoRotateSpeed = 2, this.keys = { LEFT: "ArrowLeft", UP: "ArrowUp", RIGHT: "ArrowRight", BOTTOM: "ArrowDown" }, this.mouseButtons = { LEFT: nt.ROTATE, MIDDLE: nt.DOLLY, RIGHT: nt.PAN }, this.touches = { ONE: at.ROTATE, TWO: at.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this.getPolarAngle = function() {
|
3291
|
-
return
|
3302
|
+
return c.phi;
|
3292
3303
|
}, this.getAzimuthalAngle = function() {
|
3293
|
-
return
|
3304
|
+
return c.theta;
|
3294
3305
|
}, this.getDistance = function() {
|
3295
3306
|
return this.object.position.distanceTo(this.target);
|
3296
3307
|
}, this.listenToKeyEvents = function(s) {
|
@@ -3300,46 +3311,46 @@ class xi extends hn {
|
|
3300
3311
|
}, this.saveState = function() {
|
3301
3312
|
t.target0.copy(t.target), t.position0.copy(t.object.position), t.zoom0 = t.object.zoom;
|
3302
3313
|
}, this.reset = function() {
|
3303
|
-
t.target.copy(t.target0), t.object.position.copy(t.position0), t.object.zoom = t.zoom0, t.object.updateProjectionMatrix(), t.dispatchEvent(ln), t.update(),
|
3314
|
+
t.target.copy(t.target0), t.object.position.copy(t.position0), t.object.zoom = t.zoom0, t.object.updateProjectionMatrix(), t.dispatchEvent(ln), t.update(), o = i.NONE;
|
3304
3315
|
}, this.update = function() {
|
3305
|
-
const s = new Y(), y = new Kt().setFromUnitVectors(n.up, new Y(0, 1, 0)), _ = y.clone().invert(),
|
3306
|
-
return function(
|
3307
|
-
const
|
3308
|
-
s.copy(
|
3316
|
+
const s = new Y(), y = new Kt().setFromUnitVectors(n.up, new Y(0, 1, 0)), _ = y.clone().invert(), A = new Y(), ee = new Kt(), ye = new Y(), ue = 2 * Math.PI;
|
3317
|
+
return function(vt = null) {
|
3318
|
+
const bt = t.object.position;
|
3319
|
+
s.copy(bt).sub(t.target), s.applyQuaternion(y), c.setFromVector3(s), t.autoRotate && o === i.NONE && ve(Re(vt)), t.enableDamping ? (c.theta += d.theta * t.dampingFactor, c.phi += d.phi * t.dampingFactor) : (c.theta += d.theta, c.phi += d.phi);
|
3309
3320
|
let xe = t.minAzimuthAngle, Ee = t.maxAzimuthAngle;
|
3310
|
-
isFinite(xe) && isFinite(Ee) && (xe < -Math.PI ? xe +=
|
3321
|
+
isFinite(xe) && isFinite(Ee) && (xe < -Math.PI ? xe += ue : xe > Math.PI && (xe -= ue), Ee < -Math.PI ? Ee += ue : Ee > Math.PI && (Ee -= ue), xe <= Ee ? c.theta = Math.max(xe, Math.min(Ee, c.theta)) : c.theta = c.theta > (xe + Ee) / 2 ? Math.max(xe, c.theta) : Math.min(Ee, c.theta)), c.phi = Math.max(t.minPolarAngle, Math.min(t.maxPolarAngle, c.phi)), c.makeSafe(), t.enableDamping === !0 ? t.target.addScaledVector(f, t.dampingFactor) : t.target.add(f), t.target.sub(t.cursor), t.target.clampLength(t.minTargetRadius, t.maxTargetRadius), t.target.add(t.cursor);
|
3311
3322
|
let Ve = !1;
|
3312
3323
|
if (t.zoomToCursor && Se || t.object.isOrthographicCamera)
|
3313
|
-
|
3324
|
+
c.radius = De(c.radius);
|
3314
3325
|
else {
|
3315
|
-
const Oe =
|
3316
|
-
|
3326
|
+
const Oe = c.radius;
|
3327
|
+
c.radius = De(c.radius * h), Ve = Oe != c.radius;
|
3317
3328
|
}
|
3318
|
-
if (s.setFromSpherical(
|
3329
|
+
if (s.setFromSpherical(c), s.applyQuaternion(_), bt.copy(t.target).add(s), t.object.lookAt(t.target), t.enableDamping === !0 ? (d.theta *= 1 - t.dampingFactor, d.phi *= 1 - t.dampingFactor, f.multiplyScalar(1 - t.dampingFactor)) : (d.set(0, 0, 0), f.set(0, 0, 0)), t.zoomToCursor && Se) {
|
3319
3330
|
let Oe = null;
|
3320
3331
|
if (t.object.isPerspectiveCamera) {
|
3321
3332
|
const ze = s.length();
|
3322
|
-
Oe =
|
3333
|
+
Oe = De(ze * h);
|
3323
3334
|
const et = ze - Oe;
|
3324
|
-
t.object.position.addScaledVector(
|
3335
|
+
t.object.position.addScaledVector(K, et), t.object.updateMatrixWorld(), Ve = !!et;
|
3325
3336
|
} else if (t.object.isOrthographicCamera) {
|
3326
3337
|
const ze = new Y(ne.x, ne.y, 0);
|
3327
3338
|
ze.unproject(t.object);
|
3328
3339
|
const et = t.object.zoom;
|
3329
3340
|
t.object.zoom = Math.max(t.minZoom, Math.min(t.maxZoom, t.object.zoom / h)), t.object.updateProjectionMatrix(), Ve = et !== t.object.zoom;
|
3330
|
-
const
|
3331
|
-
|
3341
|
+
const yt = new Y(ne.x, ne.y, 0);
|
3342
|
+
yt.unproject(t.object), t.object.position.sub(yt).add(ze), t.object.updateMatrixWorld(), Oe = s.length();
|
3332
3343
|
} else
|
3333
3344
|
console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), t.zoomToCursor = !1;
|
3334
|
-
Oe !== null && (this.screenSpacePanning ? t.target.set(0, 0, -1).transformDirection(t.object.matrix).multiplyScalar(Oe).add(t.object.position) : (
|
3345
|
+
Oe !== null && (this.screenSpacePanning ? t.target.set(0, 0, -1).transformDirection(t.object.matrix).multiplyScalar(Oe).add(t.object.position) : (xt.origin.copy(t.object.position), xt.direction.set(0, 0, -1).transformDirection(t.object.matrix), Math.abs(t.object.up.dot(xt.direction)) < yi ? n.lookAt(t.target) : (dn.setFromNormalAndCoplanarPoint(t.object.up, t.target), xt.intersectPlane(dn, t.target))));
|
3335
3346
|
} else if (t.object.isOrthographicCamera) {
|
3336
3347
|
const Oe = t.object.zoom;
|
3337
3348
|
t.object.zoom = Math.max(t.minZoom, Math.min(t.maxZoom, t.object.zoom / h)), Oe !== t.object.zoom && (t.object.updateProjectionMatrix(), Ve = !0);
|
3338
3349
|
}
|
3339
|
-
return h = 1, Se = !1, Ve ||
|
3350
|
+
return h = 1, Se = !1, Ve || A.distanceToSquared(t.object.position) > u || 8 * (1 - ee.dot(t.object.quaternion)) > u || ye.distanceToSquared(t.target) > u ? (t.dispatchEvent(ln), A.copy(t.object.position), ee.copy(t.object.quaternion), ye.copy(t.target), !0) : !1;
|
3340
3351
|
};
|
3341
3352
|
}(), this.dispose = function() {
|
3342
|
-
t.domElement.removeEventListener("contextmenu", Qe), t.domElement.removeEventListener("pointerdown",
|
3353
|
+
t.domElement.removeEventListener("contextmenu", Qe), t.domElement.removeEventListener("pointerdown", T), t.domElement.removeEventListener("pointercancel", W), t.domElement.removeEventListener("wheel", ft), t.domElement.removeEventListener("pointermove", F), t.domElement.removeEventListener("pointerup", W), t.domElement.getRootNode().removeEventListener("keydown", st, { capture: !0 }), t._domElementKeyEvents !== null && (t._domElementKeyEvents.removeEventListener("keydown", ot), t._domElementKeyEvents = null);
|
3343
3354
|
};
|
3344
3355
|
const t = this, i = {
|
3345
3356
|
NONE: -1,
|
@@ -3351,17 +3362,17 @@ class xi extends hn {
|
|
3351
3362
|
TOUCH_DOLLY_PAN: 5,
|
3352
3363
|
TOUCH_DOLLY_ROTATE: 6
|
3353
3364
|
};
|
3354
|
-
let
|
3355
|
-
const u = 1e-6,
|
3365
|
+
let o = i.NONE;
|
3366
|
+
const u = 1e-6, c = new Zt(), d = new Zt();
|
3356
3367
|
let h = 1;
|
3357
|
-
const f = new Y(), m = new fe(), x = new fe(),
|
3368
|
+
const f = new Y(), m = new fe(), x = new fe(), M = new fe(), L = new fe(), te = new fe(), me = new fe(), re = new fe(), z = new fe(), I = new fe(), K = new Y(), ne = new fe();
|
3358
3369
|
let Se = !1;
|
3359
|
-
const
|
3360
|
-
let
|
3361
|
-
function
|
3370
|
+
const G = [], pe = {};
|
3371
|
+
let oe = !1;
|
3372
|
+
function Re(s) {
|
3362
3373
|
return s !== null ? 2 * Math.PI / 60 * t.autoRotateSpeed * s : 2 * Math.PI / 60 / 60 * t.autoRotateSpeed;
|
3363
3374
|
}
|
3364
|
-
function
|
3375
|
+
function ke(s) {
|
3365
3376
|
const y = Math.abs(s * 0.01);
|
3366
3377
|
return Math.pow(0.95, t.zoomSpeed * y);
|
3367
3378
|
}
|
@@ -3373,67 +3384,67 @@ class xi extends hn {
|
|
3373
3384
|
}
|
3374
3385
|
const be = function() {
|
3375
3386
|
const s = new Y();
|
3376
|
-
return function(_,
|
3377
|
-
s.setFromMatrixColumn(
|
3387
|
+
return function(_, A) {
|
3388
|
+
s.setFromMatrixColumn(A, 0), s.multiplyScalar(-_), f.add(s);
|
3378
3389
|
};
|
3379
|
-
}(),
|
3390
|
+
}(), O = function() {
|
3380
3391
|
const s = new Y();
|
3381
|
-
return function(_,
|
3382
|
-
t.screenSpacePanning === !0 ? s.setFromMatrixColumn(
|
3392
|
+
return function(_, A) {
|
3393
|
+
t.screenSpacePanning === !0 ? s.setFromMatrixColumn(A, 1) : (s.setFromMatrixColumn(A, 0), s.crossVectors(t.object.up, s)), s.multiplyScalar(_), f.add(s);
|
3383
3394
|
};
|
3384
3395
|
}(), we = function() {
|
3385
3396
|
const s = new Y();
|
3386
|
-
return function(_,
|
3397
|
+
return function(_, A) {
|
3387
3398
|
const ee = t.domElement;
|
3388
3399
|
if (t.object.isPerspectiveCamera) {
|
3389
3400
|
const ye = t.object.position;
|
3390
3401
|
s.copy(ye).sub(t.target);
|
3391
|
-
let
|
3392
|
-
|
3402
|
+
let ue = s.length();
|
3403
|
+
ue *= Math.tan(t.object.fov / 2 * Math.PI / 180), be(2 * _ * ue / ee.clientHeight, t.object.matrix), O(2 * A * ue / ee.clientHeight, t.object.matrix);
|
3393
3404
|
} else
|
3394
|
-
t.object.isOrthographicCamera ? (be(_ * (t.object.right - t.object.left) / t.object.zoom / ee.clientWidth, t.object.matrix),
|
3405
|
+
t.object.isOrthographicCamera ? (be(_ * (t.object.right - t.object.left) / t.object.zoom / ee.clientWidth, t.object.matrix), O(A * (t.object.top - t.object.bottom) / t.object.zoom / ee.clientHeight, t.object.matrix)) : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."), t.enablePan = !1);
|
3395
3406
|
};
|
3396
3407
|
}();
|
3397
3408
|
function Pe(s) {
|
3398
3409
|
t.object.isPerspectiveCamera || t.object.isOrthographicCamera ? h /= s : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), t.enableZoom = !1);
|
3399
3410
|
}
|
3400
|
-
function
|
3411
|
+
function Ae(s) {
|
3401
3412
|
t.object.isPerspectiveCamera || t.object.isOrthographicCamera ? h *= s : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), t.enableZoom = !1);
|
3402
3413
|
}
|
3403
|
-
function
|
3414
|
+
function je(s, y) {
|
3404
3415
|
if (!t.zoomToCursor)
|
3405
3416
|
return;
|
3406
3417
|
Se = !0;
|
3407
|
-
const _ = t.domElement.getBoundingClientRect(),
|
3408
|
-
ne.x =
|
3418
|
+
const _ = t.domElement.getBoundingClientRect(), A = s - _.left, ee = y - _.top, ye = _.width, ue = _.height;
|
3419
|
+
ne.x = A / ye * 2 - 1, ne.y = -(ee / ue) * 2 + 1, K.set(ne.x, ne.y, 1).unproject(t.object).sub(t.object.position).normalize();
|
3409
3420
|
}
|
3410
|
-
function
|
3421
|
+
function De(s) {
|
3411
3422
|
return Math.max(t.minDistance, Math.min(t.maxDistance, s));
|
3412
3423
|
}
|
3413
3424
|
function Ie(s) {
|
3414
3425
|
m.set(s.clientX, s.clientY);
|
3415
3426
|
}
|
3416
3427
|
function Be(s) {
|
3417
|
-
|
3428
|
+
je(s.clientX, s.clientX), re.set(s.clientX, s.clientY);
|
3418
3429
|
}
|
3419
3430
|
function Fe(s) {
|
3420
|
-
|
3431
|
+
L.set(s.clientX, s.clientY);
|
3421
3432
|
}
|
3422
3433
|
function ae(s) {
|
3423
|
-
x.set(s.clientX, s.clientY),
|
3434
|
+
x.set(s.clientX, s.clientY), M.subVectors(x, m).multiplyScalar(t.rotateSpeed);
|
3424
3435
|
const y = t.domElement;
|
3425
|
-
ve(2 * Math.PI *
|
3436
|
+
ve(2 * Math.PI * M.x / y.clientHeight), N(2 * Math.PI * M.y / y.clientHeight), m.copy(x), t.update();
|
3426
3437
|
}
|
3427
3438
|
function Me(s) {
|
3428
|
-
|
3439
|
+
z.set(s.clientX, s.clientY), I.subVectors(z, re), I.y > 0 ? Pe(ke(I.y)) : I.y < 0 && Ae(ke(I.y)), re.copy(z), t.update();
|
3429
3440
|
}
|
3430
3441
|
function He(s) {
|
3431
|
-
te.set(s.clientX, s.clientY), me.subVectors(te,
|
3442
|
+
te.set(s.clientX, s.clientY), me.subVectors(te, L).multiplyScalar(t.panSpeed), we(me.x, me.y), L.copy(te), t.update();
|
3432
3443
|
}
|
3433
3444
|
function Ye(s) {
|
3434
|
-
|
3445
|
+
je(s.clientX, s.clientY), s.deltaY < 0 ? Ae(ke(s.deltaY)) : s.deltaY > 0 && Pe(ke(s.deltaY)), t.update();
|
3435
3446
|
}
|
3436
|
-
function
|
3447
|
+
function le(s) {
|
3437
3448
|
let y = !1;
|
3438
3449
|
switch (s.code) {
|
3439
3450
|
case t.keys.UP:
|
@@ -3452,76 +3463,76 @@ class xi extends hn {
|
|
3452
3463
|
y && (s.preventDefault(), t.update());
|
3453
3464
|
}
|
3454
3465
|
function g(s) {
|
3455
|
-
if (
|
3466
|
+
if (G.length === 1)
|
3456
3467
|
m.set(s.pageX, s.pageY);
|
3457
3468
|
else {
|
3458
|
-
const y = $e(s), _ = 0.5 * (s.pageX + y.x),
|
3459
|
-
m.set(_,
|
3469
|
+
const y = $e(s), _ = 0.5 * (s.pageX + y.x), A = 0.5 * (s.pageY + y.y);
|
3470
|
+
m.set(_, A);
|
3460
3471
|
}
|
3461
3472
|
}
|
3462
3473
|
function v(s) {
|
3463
|
-
if (
|
3464
|
-
|
3474
|
+
if (G.length === 1)
|
3475
|
+
L.set(s.pageX, s.pageY);
|
3465
3476
|
else {
|
3466
|
-
const y = $e(s), _ = 0.5 * (s.pageX + y.x),
|
3467
|
-
|
3477
|
+
const y = $e(s), _ = 0.5 * (s.pageX + y.x), A = 0.5 * (s.pageY + y.y);
|
3478
|
+
L.set(_, A);
|
3468
3479
|
}
|
3469
3480
|
}
|
3470
3481
|
function w(s) {
|
3471
|
-
const y = $e(s), _ = s.pageX - y.x,
|
3482
|
+
const y = $e(s), _ = s.pageX - y.x, A = s.pageY - y.y, ee = Math.sqrt(_ * _ + A * A);
|
3472
3483
|
re.set(0, ee);
|
3473
3484
|
}
|
3474
|
-
function
|
3485
|
+
function k(s) {
|
3475
3486
|
t.enableZoom && w(s), t.enablePan && v(s);
|
3476
3487
|
}
|
3477
3488
|
function ge(s) {
|
3478
3489
|
t.enableZoom && w(s), t.enableRotate && g(s);
|
3479
3490
|
}
|
3480
|
-
function
|
3481
|
-
if (
|
3491
|
+
function ce(s) {
|
3492
|
+
if (G.length == 1)
|
3482
3493
|
x.set(s.pageX, s.pageY);
|
3483
3494
|
else {
|
3484
|
-
const _ = $e(s),
|
3485
|
-
x.set(
|
3495
|
+
const _ = $e(s), A = 0.5 * (s.pageX + _.x), ee = 0.5 * (s.pageY + _.y);
|
3496
|
+
x.set(A, ee);
|
3486
3497
|
}
|
3487
|
-
|
3498
|
+
M.subVectors(x, m).multiplyScalar(t.rotateSpeed);
|
3488
3499
|
const y = t.domElement;
|
3489
|
-
ve(2 * Math.PI *
|
3500
|
+
ve(2 * Math.PI * M.x / y.clientHeight), N(2 * Math.PI * M.y / y.clientHeight), m.copy(x);
|
3490
3501
|
}
|
3491
3502
|
function C(s) {
|
3492
|
-
if (
|
3503
|
+
if (G.length === 1)
|
3493
3504
|
te.set(s.pageX, s.pageY);
|
3494
3505
|
else {
|
3495
|
-
const y = $e(s), _ = 0.5 * (s.pageX + y.x),
|
3496
|
-
te.set(_,
|
3506
|
+
const y = $e(s), _ = 0.5 * (s.pageX + y.x), A = 0.5 * (s.pageY + y.y);
|
3507
|
+
te.set(_, A);
|
3497
3508
|
}
|
3498
|
-
me.subVectors(te,
|
3509
|
+
me.subVectors(te, L).multiplyScalar(t.panSpeed), we(me.x, me.y), L.copy(te);
|
3499
3510
|
}
|
3500
3511
|
function E(s) {
|
3501
|
-
const y = $e(s), _ = s.pageX - y.x,
|
3502
|
-
|
3503
|
-
const ye = (s.pageX + y.x) * 0.5,
|
3504
|
-
|
3512
|
+
const y = $e(s), _ = s.pageX - y.x, A = s.pageY - y.y, ee = Math.sqrt(_ * _ + A * A);
|
3513
|
+
z.set(0, ee), I.set(0, Math.pow(z.y / re.y, t.zoomSpeed)), Pe(I.y), re.copy(z);
|
3514
|
+
const ye = (s.pageX + y.x) * 0.5, ue = (s.pageY + y.y) * 0.5;
|
3515
|
+
je(ye, ue);
|
3505
3516
|
}
|
3506
|
-
function
|
3517
|
+
function U(s) {
|
3507
3518
|
t.enableZoom && E(s), t.enablePan && C(s);
|
3508
3519
|
}
|
3509
3520
|
function J(s) {
|
3510
|
-
t.enableZoom && E(s), t.enableRotate &&
|
3521
|
+
t.enableZoom && E(s), t.enableRotate && ce(s);
|
3511
3522
|
}
|
3512
|
-
function
|
3513
|
-
t.enabled !== !1 && (
|
3523
|
+
function T(s) {
|
3524
|
+
t.enabled !== !1 && (G.length === 0 && (t.domElement.setPointerCapture(s.pointerId), t.domElement.addEventListener("pointermove", F), t.domElement.addEventListener("pointerup", W)), !kt(s) && (_t(s), s.pointerType === "touch" ? ct(s) : Ne(s)));
|
3514
3525
|
}
|
3515
|
-
function
|
3516
|
-
t.enabled !== !1 && (s.pointerType === "touch" ?
|
3526
|
+
function F(s) {
|
3527
|
+
t.enabled !== !1 && (s.pointerType === "touch" ? pt(s) : Je(s));
|
3517
3528
|
}
|
3518
|
-
function
|
3519
|
-
switch (Rt(s),
|
3529
|
+
function W(s) {
|
3530
|
+
switch (Rt(s), G.length) {
|
3520
3531
|
case 0:
|
3521
|
-
t.domElement.releasePointerCapture(s.pointerId), t.domElement.removeEventListener("pointermove",
|
3532
|
+
t.domElement.releasePointerCapture(s.pointerId), t.domElement.removeEventListener("pointermove", F), t.domElement.removeEventListener("pointerup", W), t.dispatchEvent(un), o = i.NONE;
|
3522
3533
|
break;
|
3523
3534
|
case 1:
|
3524
|
-
const y =
|
3535
|
+
const y = G[0], _ = pe[y];
|
3525
3536
|
ct({ pointerId: y, pageX: _.x, pageY: _.y });
|
3526
3537
|
break;
|
3527
3538
|
}
|
@@ -3545,37 +3556,37 @@ class xi extends hn {
|
|
3545
3556
|
case nt.DOLLY:
|
3546
3557
|
if (t.enableZoom === !1)
|
3547
3558
|
return;
|
3548
|
-
Be(s),
|
3559
|
+
Be(s), o = i.DOLLY;
|
3549
3560
|
break;
|
3550
3561
|
case nt.ROTATE:
|
3551
3562
|
if (s.ctrlKey || s.metaKey || s.shiftKey) {
|
3552
3563
|
if (t.enablePan === !1)
|
3553
3564
|
return;
|
3554
|
-
Fe(s),
|
3565
|
+
Fe(s), o = i.PAN;
|
3555
3566
|
} else {
|
3556
3567
|
if (t.enableRotate === !1)
|
3557
3568
|
return;
|
3558
|
-
Ie(s),
|
3569
|
+
Ie(s), o = i.ROTATE;
|
3559
3570
|
}
|
3560
3571
|
break;
|
3561
3572
|
case nt.PAN:
|
3562
3573
|
if (s.ctrlKey || s.metaKey || s.shiftKey) {
|
3563
3574
|
if (t.enableRotate === !1)
|
3564
3575
|
return;
|
3565
|
-
Ie(s),
|
3576
|
+
Ie(s), o = i.ROTATE;
|
3566
3577
|
} else {
|
3567
3578
|
if (t.enablePan === !1)
|
3568
3579
|
return;
|
3569
|
-
Fe(s),
|
3580
|
+
Fe(s), o = i.PAN;
|
3570
3581
|
}
|
3571
3582
|
break;
|
3572
3583
|
default:
|
3573
|
-
|
3584
|
+
o = i.NONE;
|
3574
3585
|
}
|
3575
|
-
|
3586
|
+
o !== i.NONE && t.dispatchEvent(Dt);
|
3576
3587
|
}
|
3577
3588
|
function Je(s) {
|
3578
|
-
switch (
|
3589
|
+
switch (o) {
|
3579
3590
|
case i.ROTATE:
|
3580
3591
|
if (t.enableRotate === !1)
|
3581
3592
|
return;
|
@@ -3593,10 +3604,10 @@ class xi extends hn {
|
|
3593
3604
|
break;
|
3594
3605
|
}
|
3595
3606
|
}
|
3596
|
-
function
|
3597
|
-
t.enabled === !1 || t.enableZoom === !1 ||
|
3607
|
+
function ft(s) {
|
3608
|
+
t.enabled === !1 || t.enableZoom === !1 || o !== i.NONE || (s.preventDefault(), t.dispatchEvent(Dt), Ye(mt(s)), t.dispatchEvent(un));
|
3598
3609
|
}
|
3599
|
-
function
|
3610
|
+
function mt(s) {
|
3600
3611
|
const y = s.deltaMode, _ = {
|
3601
3612
|
clientX: s.clientX,
|
3602
3613
|
clientY: s.clientY,
|
@@ -3610,33 +3621,33 @@ class xi extends hn {
|
|
3610
3621
|
_.deltaY *= 100;
|
3611
3622
|
break;
|
3612
3623
|
}
|
3613
|
-
return s.ctrlKey && !
|
3624
|
+
return s.ctrlKey && !oe && (_.deltaY *= 10), _;
|
3614
3625
|
}
|
3615
3626
|
function st(s) {
|
3616
|
-
s.key === "Control" && (
|
3627
|
+
s.key === "Control" && (oe = !0, t.domElement.getRootNode().addEventListener("keyup", Ue, { passive: !0, capture: !0 }));
|
3617
3628
|
}
|
3618
3629
|
function Ue(s) {
|
3619
|
-
s.key === "Control" && (
|
3630
|
+
s.key === "Control" && (oe = !1, t.domElement.getRootNode().removeEventListener("keyup", Ue, { passive: !0, capture: !0 }));
|
3620
3631
|
}
|
3621
3632
|
function ot(s) {
|
3622
|
-
t.enabled === !1 || t.enablePan === !1 ||
|
3633
|
+
t.enabled === !1 || t.enablePan === !1 || le(s);
|
3623
3634
|
}
|
3624
3635
|
function ct(s) {
|
3625
|
-
switch (
|
3636
|
+
switch (gt(s), G.length) {
|
3626
3637
|
case 1:
|
3627
3638
|
switch (t.touches.ONE) {
|
3628
3639
|
case at.ROTATE:
|
3629
3640
|
if (t.enableRotate === !1)
|
3630
3641
|
return;
|
3631
|
-
g(s),
|
3642
|
+
g(s), o = i.TOUCH_ROTATE;
|
3632
3643
|
break;
|
3633
3644
|
case at.PAN:
|
3634
3645
|
if (t.enablePan === !1)
|
3635
3646
|
return;
|
3636
|
-
v(s),
|
3647
|
+
v(s), o = i.TOUCH_PAN;
|
3637
3648
|
break;
|
3638
3649
|
default:
|
3639
|
-
|
3650
|
+
o = i.NONE;
|
3640
3651
|
}
|
3641
3652
|
break;
|
3642
3653
|
case 2:
|
@@ -3644,28 +3655,28 @@ class xi extends hn {
|
|
3644
3655
|
case at.DOLLY_PAN:
|
3645
3656
|
if (t.enableZoom === !1 && t.enablePan === !1)
|
3646
3657
|
return;
|
3647
|
-
|
3658
|
+
k(s), o = i.TOUCH_DOLLY_PAN;
|
3648
3659
|
break;
|
3649
3660
|
case at.DOLLY_ROTATE:
|
3650
3661
|
if (t.enableZoom === !1 && t.enableRotate === !1)
|
3651
3662
|
return;
|
3652
|
-
ge(s),
|
3663
|
+
ge(s), o = i.TOUCH_DOLLY_ROTATE;
|
3653
3664
|
break;
|
3654
3665
|
default:
|
3655
|
-
|
3666
|
+
o = i.NONE;
|
3656
3667
|
}
|
3657
3668
|
break;
|
3658
3669
|
default:
|
3659
|
-
|
3670
|
+
o = i.NONE;
|
3660
3671
|
}
|
3661
|
-
|
3672
|
+
o !== i.NONE && t.dispatchEvent(Dt);
|
3662
3673
|
}
|
3663
|
-
function
|
3664
|
-
switch (
|
3674
|
+
function pt(s) {
|
3675
|
+
switch (gt(s), o) {
|
3665
3676
|
case i.TOUCH_ROTATE:
|
3666
3677
|
if (t.enableRotate === !1)
|
3667
3678
|
return;
|
3668
|
-
|
3679
|
+
ce(s), t.update();
|
3669
3680
|
break;
|
3670
3681
|
case i.TOUCH_PAN:
|
3671
3682
|
if (t.enablePan === !1)
|
@@ -3675,7 +3686,7 @@ class xi extends hn {
|
|
3675
3686
|
case i.TOUCH_DOLLY_PAN:
|
3676
3687
|
if (t.enableZoom === !1 && t.enablePan === !1)
|
3677
3688
|
return;
|
3678
|
-
|
3689
|
+
U(s), t.update();
|
3679
3690
|
break;
|
3680
3691
|
case i.TOUCH_DOLLY_ROTATE:
|
3681
3692
|
if (t.enableZoom === !1 && t.enableRotate === !1)
|
@@ -3683,55 +3694,55 @@ class xi extends hn {
|
|
3683
3694
|
J(s), t.update();
|
3684
3695
|
break;
|
3685
3696
|
default:
|
3686
|
-
|
3697
|
+
o = i.NONE;
|
3687
3698
|
}
|
3688
3699
|
}
|
3689
3700
|
function Qe(s) {
|
3690
3701
|
t.enabled !== !1 && s.preventDefault();
|
3691
3702
|
}
|
3692
3703
|
function _t(s) {
|
3693
|
-
|
3704
|
+
G.push(s.pointerId);
|
3694
3705
|
}
|
3695
3706
|
function Rt(s) {
|
3696
3707
|
delete pe[s.pointerId];
|
3697
|
-
for (let y = 0; y <
|
3698
|
-
if (
|
3699
|
-
|
3708
|
+
for (let y = 0; y < G.length; y++)
|
3709
|
+
if (G[y] == s.pointerId) {
|
3710
|
+
G.splice(y, 1);
|
3700
3711
|
return;
|
3701
3712
|
}
|
3702
3713
|
}
|
3703
|
-
function
|
3704
|
-
for (let y = 0; y <
|
3705
|
-
if (
|
3714
|
+
function kt(s) {
|
3715
|
+
for (let y = 0; y < G.length; y++)
|
3716
|
+
if (G[y] == s.pointerId)
|
3706
3717
|
return !0;
|
3707
3718
|
return !1;
|
3708
3719
|
}
|
3709
|
-
function
|
3720
|
+
function gt(s) {
|
3710
3721
|
let y = pe[s.pointerId];
|
3711
3722
|
y === void 0 && (y = new fe(), pe[s.pointerId] = y), y.set(s.pageX, s.pageY);
|
3712
3723
|
}
|
3713
3724
|
function $e(s) {
|
3714
|
-
const y = s.pointerId ===
|
3725
|
+
const y = s.pointerId === G[0] ? G[1] : G[0];
|
3715
3726
|
return pe[y];
|
3716
3727
|
}
|
3717
|
-
t.domElement.addEventListener("contextmenu", Qe), t.domElement.addEventListener("pointerdown",
|
3728
|
+
t.domElement.addEventListener("contextmenu", Qe), t.domElement.addEventListener("pointerdown", T), t.domElement.addEventListener("pointercancel", W), t.domElement.addEventListener("wheel", ft, { passive: !1 }), t.domElement.getRootNode().addEventListener("keydown", st, { passive: !0, capture: !0 }), this.update();
|
3718
3729
|
}
|
3719
3730
|
}
|
3720
3731
|
function rt(e, n, a, t, i) {
|
3721
3732
|
return t + (e - n) * (i - t) / (a - n);
|
3722
3733
|
}
|
3723
3734
|
const wt = (e) => {
|
3724
|
-
const [n, a] =
|
3735
|
+
const [n, a] = X(e.options[e.index]), t = () => {
|
3725
3736
|
e.onToggle(!e.open);
|
3726
|
-
}, i = (
|
3727
|
-
|
3737
|
+
}, i = (o) => {
|
3738
|
+
o !== n && (e.onSelect(o), a(o)), e.onToggle(!1);
|
3728
3739
|
};
|
3729
3740
|
return /* @__PURE__ */ l.jsxs("div", { className: `dropdown ${e.up === !0 ? "up" : ""}`, children: [
|
3730
3741
|
/* @__PURE__ */ l.jsx("div", { className: "dropdown-toggle", onClick: t, children: n }),
|
3731
|
-
e.open && /* @__PURE__ */ l.jsx("ul", { className: "dropdown-menu", children: e.options.map((
|
3742
|
+
e.open && /* @__PURE__ */ l.jsx("ul", { className: "dropdown-menu", children: e.options.map((o) => /* @__PURE__ */ l.jsx("li", { onClick: () => i(o), children: o }, o)) })
|
3732
3743
|
] });
|
3733
3744
|
}, qe = Ta(function(n, a) {
|
3734
|
-
const [t, i] =
|
3745
|
+
const [t, i] = X(!1), o = n.options.indexOf(n.camera.name);
|
3735
3746
|
return /* @__PURE__ */ l.jsxs("div", { className: "CameraWindow", children: [
|
3736
3747
|
/* @__PURE__ */ l.jsx("div", { ref: a, className: "clickable", onClick: () => {
|
3737
3748
|
t && i(!1);
|
@@ -3739,7 +3750,7 @@ const wt = (e) => {
|
|
3739
3750
|
/* @__PURE__ */ l.jsx(
|
3740
3751
|
wt,
|
3741
3752
|
{
|
3742
|
-
index:
|
3753
|
+
index: o,
|
3743
3754
|
open: t,
|
3744
3755
|
options: n.options,
|
3745
3756
|
onSelect: n.onSelect,
|
@@ -3864,7 +3875,7 @@ class Ei extends jn {
|
|
3864
3875
|
});
|
3865
3876
|
}
|
3866
3877
|
}
|
3867
|
-
class Ci extends
|
3878
|
+
class Ci extends kn {
|
3868
3879
|
gridMaterial;
|
3869
3880
|
constructor() {
|
3870
3881
|
const n = new Ei();
|
@@ -3924,16 +3935,16 @@ class Mi extends jn {
|
|
3924
3935
|
});
|
3925
3936
|
}
|
3926
3937
|
}
|
3927
|
-
let
|
3938
|
+
let Et = "Renderer", Te, Ct = !1, At = !1, H = null, se = null, Ge = null, We = null;
|
3928
3939
|
function $i(e) {
|
3929
|
-
const n = e.three.app.appID, a = localStorage.getItem(`${n}_mode`), t = localStorage.getItem(`${n}_tlCam`) !== null ? localStorage.getItem(`${n}_tlCam`) : "Debug", i = localStorage.getItem(`${n}_trCam`) !== null ? localStorage.getItem(`${n}_trCam`) : "Orthographic",
|
3940
|
+
const n = e.three.app.appID, a = localStorage.getItem(`${n}_mode`), t = localStorage.getItem(`${n}_tlCam`) !== null ? localStorage.getItem(`${n}_tlCam`) : "Debug", i = localStorage.getItem(`${n}_trCam`) !== null ? localStorage.getItem(`${n}_trCam`) : "Orthographic", o = localStorage.getItem(`${n}_blCam`) !== null ? localStorage.getItem(`${n}_blCam`) : "Front", u = localStorage.getItem(`${n}_brCam`) !== null ? localStorage.getItem(`${n}_brCam`) : "Top", c = ie(() => /* @__PURE__ */ new Map(), []), d = ie(() => /* @__PURE__ */ new Map(), []), h = ie(() => /* @__PURE__ */ new Map(), []), f = ie(() => /* @__PURE__ */ new Map(), []), m = ie(() => new ma(), []), x = ie(() => new pa(), []), M = ie(() => new Ci(), []), L = ie(() => new Xt(500), []), te = ie(() => new Xt(100), []), me = ie(() => new ga(), []), re = ie(() => new va(), []), z = ie(() => new Mi(), []), I = ie(() => new Pn({
|
3930
3941
|
opacity: 0.33,
|
3931
3942
|
transparent: !0,
|
3932
3943
|
wireframe: !0
|
3933
3944
|
}), []);
|
3934
|
-
function
|
3945
|
+
function K(g, v) {
|
3935
3946
|
const w = new Jt(-100, 100, 100, -100, 50, 5e3);
|
3936
|
-
return w.name = g, w.position.copy(v), w.lookAt(0, 0, 0),
|
3947
|
+
return w.name = g, w.position.copy(v), w.lookAt(0, 0, 0), c.set(g, w), w;
|
3937
3948
|
}
|
3938
3949
|
const ne = [
|
3939
3950
|
"Renderer",
|
@@ -3946,24 +3957,24 @@ function $i(e) {
|
|
3946
3957
|
"Side by Side",
|
3947
3958
|
"Stacked",
|
3948
3959
|
"Quad"
|
3949
|
-
],
|
3950
|
-
localStorage.setItem(`${n}_mode`, N), localStorage.setItem(`${n}_tlCam`, t), localStorage.setItem(`${n}_trCam`, i), localStorage.setItem(`${n}_blCam`,
|
3960
|
+
], G = q(null), pe = q(null), oe = q(null), Re = q(null), ke = q(null), ve = q(null), [N, be] = X(a !== null ? a : "Single"), [O, we] = X(null), [Pe, Ae] = X(!1), [je, De] = X(!1), [Ie, Be] = X(!1), [, Fe] = X(Date.now());
|
3961
|
+
localStorage.setItem(`${n}_mode`, N), localStorage.setItem(`${n}_tlCam`, t), localStorage.setItem(`${n}_trCam`, i), localStorage.setItem(`${n}_blCam`, o), localStorage.setItem(`${n}_brCam`, u);
|
3951
3962
|
const ae = (g, v) => {
|
3952
3963
|
const w = d.get(g.name);
|
3953
3964
|
if (w !== void 0 && w.dispose(), d.delete(g.name), g.name === "UI")
|
3954
3965
|
return;
|
3955
|
-
const
|
3956
|
-
switch (
|
3966
|
+
const k = new xi(g, v);
|
3967
|
+
switch (k.enableDamping = !0, k.dampingFactor = 0.05, g.name) {
|
3957
3968
|
case "Top":
|
3958
3969
|
case "Bottom":
|
3959
3970
|
case "Left":
|
3960
3971
|
case "Right":
|
3961
3972
|
case "Front":
|
3962
3973
|
case "Back":
|
3963
|
-
|
3974
|
+
k.enableRotate = !1;
|
3964
3975
|
break;
|
3965
3976
|
}
|
3966
|
-
d.set(g.name,
|
3977
|
+
d.set(g.name, k);
|
3967
3978
|
}, Me = (g) => {
|
3968
3979
|
const v = h.get(g.name);
|
3969
3980
|
v !== void 0 && (m.remove(v), v.dispose(), h.delete(g.name));
|
@@ -3978,28 +3989,28 @@ function $i(e) {
|
|
3978
3989
|
}, Ye = () => {
|
3979
3990
|
switch (N) {
|
3980
3991
|
case "Single":
|
3981
|
-
ae(H,
|
3992
|
+
ae(H, oe.current);
|
3982
3993
|
break;
|
3983
3994
|
case "Side by Side":
|
3984
3995
|
case "Stacked":
|
3985
|
-
ae(H,
|
3996
|
+
ae(H, oe.current), ae(se, Re.current);
|
3986
3997
|
break;
|
3987
3998
|
case "Quad":
|
3988
|
-
ae(H,
|
3999
|
+
ae(H, oe.current), ae(se, Re.current), ae(Ge, ke.current), ae(We, ve.current);
|
3989
4000
|
break;
|
3990
4001
|
}
|
3991
4002
|
};
|
3992
|
-
|
4003
|
+
_e(() => {
|
3993
4004
|
const g = new ba({
|
3994
|
-
canvas:
|
4005
|
+
canvas: G.current,
|
3995
4006
|
stencil: !1
|
3996
4007
|
});
|
3997
4008
|
g.autoClear = !1, g.shadowMap.enabled = !0, g.setPixelRatio(devicePixelRatio), g.setClearColor(0), e.three.renderer = g, we(g);
|
3998
|
-
}, []),
|
3999
|
-
m.name = "Debug Scene", m.uuid = "", x.name = "helpers", m.add(x), x.add(
|
4000
|
-
const g = new
|
4001
|
-
g.name = "Debug", g.position.set(500, 500, 500), g.lookAt(0, 0, 0),
|
4002
|
-
}, []),
|
4009
|
+
}, []), _e(() => {
|
4010
|
+
m.name = "Debug Scene", m.uuid = "", x.name = "helpers", m.add(x), x.add(M), L.name = "axisHelper", x.add(L), te.name = "interactionHelper", x.add(te), te.visible = !1, K("Top", new Y(0, 1e3, 0)), K("Bottom", new Y(0, -1e3, 0)), K("Left", new Y(-1e3, 0, 0)), K("Right", new Y(1e3, 0, 0)), K("Front", new Y(0, 0, 1e3)), K("Back", new Y(0, 0, -1e3)), K("Orthographic", new Y(1e3, 1e3, 1e3)), K("UI", new Y());
|
4011
|
+
const g = new Pt(60, 1, 50, 5e3);
|
4012
|
+
g.name = "Debug", g.position.set(500, 500, 500), g.lookAt(0, 0, 0), c.set("Debug", g), H = c.get(localStorage.getItem(`${n}_tlCam`)), se = c.get(localStorage.getItem(`${n}_trCam`)), Ge = c.get(localStorage.getItem(`${n}_blCam`)), We = c.get(localStorage.getItem(`${n}_brCam`));
|
4013
|
+
}, []), _e(() => {
|
4003
4014
|
const g = () => {
|
4004
4015
|
f.forEach((C) => {
|
4005
4016
|
x.remove(C), C.dispose();
|
@@ -4028,70 +4039,70 @@ function $i(e) {
|
|
4028
4039
|
}
|
4029
4040
|
});
|
4030
4041
|
}, w = (C) => {
|
4031
|
-
x.add(
|
4042
|
+
x.add(L), g(), Ut(Te), m.remove(Te);
|
4032
4043
|
const E = e.scenes.get(C.value.name);
|
4033
4044
|
if (E !== void 0) {
|
4034
|
-
const
|
4035
|
-
e.onSceneSet !== void 0 && e.onSceneSet(
|
4045
|
+
const U = new E();
|
4046
|
+
e.onSceneSet !== void 0 && e.onSceneSet(U), Te = U, e.three.scene = Te, m.add(Te), At = !0, v();
|
4036
4047
|
}
|
4037
|
-
},
|
4038
|
-
const E = C.value,
|
4039
|
-
if (
|
4040
|
-
const J = new xa(
|
4041
|
-
h.set(
|
4048
|
+
}, k = (C) => {
|
4049
|
+
const E = C.value, U = e.three.scene?.getObjectByProperty("uuid", E.uuid);
|
4050
|
+
if (U !== void 0 && c.set(E.name, U), U instanceof Pt) {
|
4051
|
+
const J = new xa(U);
|
4052
|
+
h.set(U.name, J), m.add(J);
|
4042
4053
|
}
|
4043
4054
|
Fe(Date.now());
|
4044
4055
|
}, ge = (C) => {
|
4045
4056
|
const E = h.get(C.value.name);
|
4046
|
-
E !== void 0 && (m.remove(E), E.dispose()),
|
4047
|
-
},
|
4057
|
+
E !== void 0 && (m.remove(E), E.dispose()), c.delete(C.value.name), Fe(Date.now());
|
4058
|
+
}, ce = (C) => {
|
4048
4059
|
const E = Te.getObjectByProperty("uuid", C.value.uuid);
|
4049
|
-
E && E.add(
|
4060
|
+
E && E.add(L);
|
4050
4061
|
};
|
4051
|
-
return j.addEventListener(
|
4052
|
-
j.removeEventListener(
|
4062
|
+
return j.addEventListener(D.SET_SCENE, w), j.addEventListener(D.ADD_CAMERA, k), j.addEventListener(D.REMOVE_CAMERA, ge), j.addEventListener(D.SET_OBJECT, ce), () => {
|
4063
|
+
j.removeEventListener(D.SET_SCENE, w), j.removeEventListener(D.ADD_CAMERA, k), j.removeEventListener(D.REMOVE_CAMERA, ge), j.removeEventListener(D.SET_OBJECT, ce);
|
4053
4064
|
};
|
4054
|
-
}, []),
|
4055
|
-
if (
|
4065
|
+
}, []), _e(() => {
|
4066
|
+
if (O === null)
|
4056
4067
|
return;
|
4057
|
-
let g = window.innerWidth, v = window.innerHeight, w = Math.floor(g / 2),
|
4058
|
-
const
|
4059
|
-
g = window.innerWidth - 300, v = window.innerHeight, w = Math.floor(g / 2),
|
4060
|
-
let
|
4068
|
+
let g = window.innerWidth, v = window.innerHeight, w = Math.floor(g / 2), k = Math.floor(v / 2), ge = -1;
|
4069
|
+
const ce = () => {
|
4070
|
+
g = window.innerWidth - 300, v = window.innerHeight, w = Math.floor(g / 2), k = Math.floor(v / 2), e.three.resize(g, v), e.onSceneResize !== void 0 && At && e.onSceneResize(Te, g, v);
|
4071
|
+
let T = g, F = v;
|
4061
4072
|
switch (N) {
|
4062
4073
|
case "Side by Side":
|
4063
|
-
|
4074
|
+
T = w, F = v;
|
4064
4075
|
break;
|
4065
4076
|
case "Stacked":
|
4066
|
-
|
4077
|
+
T = g, F = k;
|
4067
4078
|
break;
|
4068
4079
|
case "Quad":
|
4069
|
-
|
4080
|
+
T = w, F = k;
|
4070
4081
|
break;
|
4071
4082
|
}
|
4072
|
-
|
4073
|
-
|
4083
|
+
c.forEach((W) => {
|
4084
|
+
W instanceof Jt ? (W.left = T / -2, W.right = T / 2, W.top = F / 2, W.bottom = F / -2, W.name === "UI" && (W.position.x = g / 2, W.position.y = v / -2, W.position.z = 100), W.updateProjectionMatrix()) : W instanceof Pt && (W.aspect = T / F, W.updateProjectionMatrix(), h.get(W.name)?.update());
|
4074
4085
|
});
|
4075
4086
|
}, C = () => {
|
4076
|
-
|
4087
|
+
O.setViewport(0, 0, g, v), O.setScissor(0, 0, g, v), O.render(m, H);
|
4077
4088
|
}, E = () => {
|
4078
4089
|
if (N === "Side by Side")
|
4079
|
-
|
4090
|
+
O.setViewport(0, 0, w, v), O.setScissor(0, 0, w, v), O.render(m, H), O.setViewport(w, 0, w, v), O.setScissor(w, 0, w, v), O.render(m, se);
|
4080
4091
|
else {
|
4081
|
-
const
|
4082
|
-
|
4092
|
+
const T = v - k;
|
4093
|
+
O.setViewport(0, T, g, k), O.setScissor(0, T, g, k), O.render(m, H), O.setViewport(0, 0, g, k), O.setScissor(0, 0, g, k), O.render(m, se);
|
4083
4094
|
}
|
4084
|
-
},
|
4085
|
-
let
|
4086
|
-
|
4095
|
+
}, U = () => {
|
4096
|
+
let T = 0, F = 0;
|
4097
|
+
F = v - k, T = 0, O.setViewport(T, F, w, k), O.setScissor(T, F, w, k), O.render(m, H), T = w, O.setViewport(T, F, w, k), O.setScissor(T, F, w, k), O.render(m, se), F = 0, T = 0, O.setViewport(T, F, w, k), O.setScissor(T, F, w, k), O.render(m, Ge), T = w, O.setViewport(T, F, w, k), O.setScissor(T, F, w, k), O.render(m, We);
|
4087
4098
|
}, J = () => {
|
4088
|
-
switch (d.forEach((
|
4089
|
-
|
4090
|
-
}), h.forEach((
|
4091
|
-
|
4092
|
-
}), f.forEach((
|
4093
|
-
|
4094
|
-
}), e.onSceneUpdate !== void 0 &&
|
4099
|
+
switch (d.forEach((T) => {
|
4100
|
+
T.update();
|
4101
|
+
}), h.forEach((T) => {
|
4102
|
+
T.update();
|
4103
|
+
}), f.forEach((T) => {
|
4104
|
+
T.update !== void 0 && T.update();
|
4105
|
+
}), e.onSceneUpdate !== void 0 && At && e.onSceneUpdate(Te), O.clear(), N) {
|
4095
4106
|
case "Single":
|
4096
4107
|
C();
|
4097
4108
|
break;
|
@@ -4100,115 +4111,115 @@ function $i(e) {
|
|
4100
4111
|
E();
|
4101
4112
|
break;
|
4102
4113
|
case "Quad":
|
4103
|
-
|
4114
|
+
U();
|
4104
4115
|
break;
|
4105
4116
|
}
|
4106
4117
|
ge = requestAnimationFrame(J);
|
4107
4118
|
};
|
4108
|
-
return Ye(), window.addEventListener("resize",
|
4109
|
-
window.removeEventListener("resize",
|
4119
|
+
return Ye(), window.addEventListener("resize", ce), ce(), J(), () => {
|
4120
|
+
window.removeEventListener("resize", ce), cancelAnimationFrame(ge), ge = -1;
|
4110
4121
|
};
|
4111
|
-
}, [N,
|
4112
|
-
if (
|
4113
|
-
const g = new ya(), v = new fe(), w = (C, E,
|
4122
|
+
}, [N, O]), _e(() => {
|
4123
|
+
if (O !== null) {
|
4124
|
+
const g = new ya(), v = new fe(), w = (C, E, U, J) => {
|
4114
4125
|
switch (N) {
|
4115
4126
|
case "Quad":
|
4116
|
-
C <
|
4127
|
+
C < U ? E < J ? g.setFromCamera(v, H) : g.setFromCamera(v, Ge) : E < J ? g.setFromCamera(v, se) : g.setFromCamera(v, We);
|
4117
4128
|
break;
|
4118
4129
|
case "Side by Side":
|
4119
|
-
C <
|
4130
|
+
C < U ? g.setFromCamera(v, H) : g.setFromCamera(v, se);
|
4120
4131
|
break;
|
4121
4132
|
case "Single":
|
4122
4133
|
g.setFromCamera(v, H);
|
4123
4134
|
break;
|
4124
4135
|
case "Stacked":
|
4125
|
-
E < J ? g.setFromCamera(v, H) : g.setFromCamera(v,
|
4136
|
+
E < J ? g.setFromCamera(v, H) : g.setFromCamera(v, se);
|
4126
4137
|
break;
|
4127
4138
|
}
|
4128
|
-
},
|
4129
|
-
if (!
|
4139
|
+
}, k = (C) => {
|
4140
|
+
if (!Ct)
|
4130
4141
|
return;
|
4131
4142
|
const E = new fe();
|
4132
|
-
|
4133
|
-
const
|
4134
|
-
v.x = rt(
|
4135
|
-
const
|
4136
|
-
|
4143
|
+
O.getSize(E);
|
4144
|
+
const U = Math.min(C.clientX, E.x), J = Math.min(C.clientY, E.y);
|
4145
|
+
v.x = rt(U, 0, E.x, -1, 1), v.y = rt(J, 0, E.y, 1, -1);
|
4146
|
+
const T = E.x / 2, F = E.y / 2, W = () => {
|
4147
|
+
U < T ? v.x = rt(U, 0, T, -1, 1) : v.x = rt(U, T, E.x, -1, 1);
|
4137
4148
|
}, Ne = () => {
|
4138
|
-
J <
|
4149
|
+
J < F ? v.y = rt(J, 0, F, 1, -1) : v.y = rt(J, F, E.y, 1, -1);
|
4139
4150
|
};
|
4140
4151
|
switch (N) {
|
4141
4152
|
case "Quad":
|
4142
|
-
|
4153
|
+
W(), Ne();
|
4143
4154
|
break;
|
4144
4155
|
case "Side by Side":
|
4145
|
-
|
4156
|
+
W();
|
4146
4157
|
break;
|
4147
4158
|
case "Stacked":
|
4148
4159
|
Ne(), Ne();
|
4149
4160
|
break;
|
4150
4161
|
}
|
4151
|
-
w(
|
4162
|
+
w(U, J, T, F);
|
4152
4163
|
const Je = g.intersectObjects(Te.children);
|
4153
4164
|
Je.length > 0 && te.position.copy(Je[0].point);
|
4154
4165
|
}, ge = (C) => {
|
4155
|
-
if (!
|
4166
|
+
if (!Ct)
|
4156
4167
|
return;
|
4157
4168
|
const E = new fe();
|
4158
|
-
if (
|
4169
|
+
if (O.getSize(E), C.clientX >= E.x)
|
4159
4170
|
return;
|
4160
|
-
|
4161
|
-
const
|
4162
|
-
|
4163
|
-
},
|
4164
|
-
return
|
4165
|
-
|
4171
|
+
k(C);
|
4172
|
+
const U = g.intersectObjects(Te.children);
|
4173
|
+
U.length > 0 && e.three.getObject(U[0].object.uuid);
|
4174
|
+
}, ce = pe.current;
|
4175
|
+
return ce.addEventListener("mousemove", k, !1), ce.addEventListener("click", ge, !1), () => {
|
4176
|
+
ce.removeEventListener("mousemove", k), ce.removeEventListener("click", ge);
|
4166
4177
|
};
|
4167
4178
|
}
|
4168
|
-
}, [N,
|
4169
|
-
const
|
4170
|
-
return
|
4171
|
-
|
4179
|
+
}, [N, O]);
|
4180
|
+
const le = [];
|
4181
|
+
return c.forEach((g, v) => {
|
4182
|
+
le.push(v);
|
4172
4183
|
}), /* @__PURE__ */ l.jsxs("div", { className: "multiview", children: [
|
4173
|
-
/* @__PURE__ */ l.jsx("canvas", { ref:
|
4174
|
-
|
4184
|
+
/* @__PURE__ */ l.jsx("canvas", { ref: G }),
|
4185
|
+
O !== null && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
4175
4186
|
/* @__PURE__ */ l.jsxs("div", { className: `cameras ${N === "Single" || N === "Stacked" ? "single" : ""}`, ref: pe, children: [
|
4176
|
-
N === "Single" && /* @__PURE__ */ l.jsx(l.Fragment, { children: /* @__PURE__ */ l.jsx(qe, { camera: H, options:
|
4187
|
+
N === "Single" && /* @__PURE__ */ l.jsx(l.Fragment, { children: /* @__PURE__ */ l.jsx(qe, { camera: H, options: le, ref: oe, onSelect: (g) => {
|
4177
4188
|
d.get(H.name)?.dispose();
|
4178
|
-
const v =
|
4179
|
-
v !== void 0 && (Me(H), H = v, localStorage.setItem(`${n}_tlCam`, v.name), ae(v,
|
4189
|
+
const v = c.get(g);
|
4190
|
+
v !== void 0 && (Me(H), H = v, localStorage.setItem(`${n}_tlCam`, v.name), ae(v, oe.current));
|
4180
4191
|
} }) }),
|
4181
4192
|
(N === "Side by Side" || N === "Stacked") && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
4182
|
-
/* @__PURE__ */ l.jsx(qe, { camera: H, options:
|
4193
|
+
/* @__PURE__ */ l.jsx(qe, { camera: H, options: le, ref: oe, onSelect: (g) => {
|
4183
4194
|
d.get(H.name)?.dispose();
|
4184
|
-
const v =
|
4185
|
-
v !== void 0 && (Me(H), H = v, localStorage.setItem(`${n}_tlCam`, v.name), ae(v,
|
4195
|
+
const v = c.get(g);
|
4196
|
+
v !== void 0 && (Me(H), H = v, localStorage.setItem(`${n}_tlCam`, v.name), ae(v, oe.current));
|
4186
4197
|
} }),
|
4187
|
-
/* @__PURE__ */ l.jsx(qe, { camera:
|
4188
|
-
d.get(
|
4189
|
-
const v =
|
4190
|
-
v !== void 0 && (Me(
|
4198
|
+
/* @__PURE__ */ l.jsx(qe, { camera: se, options: le, ref: Re, onSelect: (g) => {
|
4199
|
+
d.get(se.name)?.dispose();
|
4200
|
+
const v = c.get(g);
|
4201
|
+
v !== void 0 && (Me(se), se = v, localStorage.setItem(`${n}_trCam`, v.name), ae(v, Re.current));
|
4191
4202
|
} })
|
4192
4203
|
] }),
|
4193
4204
|
N === "Quad" && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
4194
|
-
/* @__PURE__ */ l.jsx(qe, { camera: H, options:
|
4205
|
+
/* @__PURE__ */ l.jsx(qe, { camera: H, options: le, ref: oe, onSelect: (g) => {
|
4195
4206
|
d.get(H.name)?.dispose();
|
4196
|
-
const v =
|
4197
|
-
v !== void 0 && (Me(H), H = v, localStorage.setItem(`${n}_tlCam`, v.name), ae(v,
|
4207
|
+
const v = c.get(g);
|
4208
|
+
v !== void 0 && (Me(H), H = v, localStorage.setItem(`${n}_tlCam`, v.name), ae(v, oe.current));
|
4198
4209
|
} }),
|
4199
|
-
/* @__PURE__ */ l.jsx(qe, { camera:
|
4200
|
-
d.get(
|
4201
|
-
const v =
|
4202
|
-
v !== void 0 && (Me(
|
4210
|
+
/* @__PURE__ */ l.jsx(qe, { camera: se, options: le, ref: Re, onSelect: (g) => {
|
4211
|
+
d.get(se.name)?.dispose();
|
4212
|
+
const v = c.get(g);
|
4213
|
+
v !== void 0 && (Me(se), se = v, localStorage.setItem(`${n}_trCam`, v.name), ae(v, Re.current));
|
4203
4214
|
} }),
|
4204
|
-
/* @__PURE__ */ l.jsx(qe, { camera: Ge, options:
|
4215
|
+
/* @__PURE__ */ l.jsx(qe, { camera: Ge, options: le, ref: ke, onSelect: (g) => {
|
4205
4216
|
d.get(Ge.name)?.dispose();
|
4206
|
-
const v =
|
4207
|
-
v !== void 0 && (Me(Ge), Ge = v, localStorage.setItem(`${n}_blCam`, v.name), ae(v,
|
4217
|
+
const v = c.get(g);
|
4218
|
+
v !== void 0 && (Me(Ge), Ge = v, localStorage.setItem(`${n}_blCam`, v.name), ae(v, ke.current));
|
4208
4219
|
} }),
|
4209
|
-
/* @__PURE__ */ l.jsx(qe, { camera: We, options:
|
4220
|
+
/* @__PURE__ */ l.jsx(qe, { camera: We, options: le, ref: ve, onSelect: (g) => {
|
4210
4221
|
d.get(We.name)?.dispose();
|
4211
|
-
const v =
|
4222
|
+
const v = c.get(g);
|
4212
4223
|
v !== void 0 && (Me(We), We = v, localStorage.setItem(`${n}_brCam`, v.name), ae(v, ve.current));
|
4213
4224
|
} })
|
4214
4225
|
] })
|
@@ -4224,18 +4235,18 @@ function $i(e) {
|
|
4224
4235
|
},
|
4225
4236
|
open: Pe,
|
4226
4237
|
onToggle: (g) => {
|
4227
|
-
|
4238
|
+
Ae(g), je && De(!1), Ie && Be(!1);
|
4228
4239
|
}
|
4229
4240
|
}
|
4230
4241
|
),
|
4231
4242
|
/* @__PURE__ */ l.jsx(
|
4232
4243
|
wt,
|
4233
4244
|
{
|
4234
|
-
index: ne.indexOf(
|
4245
|
+
index: ne.indexOf(Et),
|
4235
4246
|
options: ne,
|
4236
4247
|
onSelect: (g) => {
|
4237
|
-
if (g !==
|
4238
|
-
switch (
|
4248
|
+
if (g !== Et)
|
4249
|
+
switch (Et = g, Et) {
|
4239
4250
|
case "Depth":
|
4240
4251
|
m.overrideMaterial = me;
|
4241
4252
|
break;
|
@@ -4250,13 +4261,13 @@ function $i(e) {
|
|
4250
4261
|
m.overrideMaterial = I;
|
4251
4262
|
break;
|
4252
4263
|
case "UVs":
|
4253
|
-
m.overrideMaterial =
|
4264
|
+
m.overrideMaterial = z;
|
4254
4265
|
break;
|
4255
4266
|
}
|
4256
4267
|
},
|
4257
|
-
open:
|
4268
|
+
open: je,
|
4258
4269
|
onToggle: (g) => {
|
4259
|
-
Pe &&
|
4270
|
+
Pe && Ae(!1), De(g), Ie && Be(!1);
|
4260
4271
|
}
|
4261
4272
|
}
|
4262
4273
|
),
|
@@ -4269,11 +4280,11 @@ function $i(e) {
|
|
4269
4280
|
"Selection Mode"
|
4270
4281
|
],
|
4271
4282
|
onSelect: (g) => {
|
4272
|
-
|
4283
|
+
Ct = g === "Selection Mode", te.visible = Ct;
|
4273
4284
|
},
|
4274
4285
|
open: Ie,
|
4275
4286
|
onToggle: (g) => {
|
4276
|
-
Pe &&
|
4287
|
+
Pe && Ae(!1), je && De(!1), Be(g);
|
4277
4288
|
}
|
4278
4289
|
}
|
4279
4290
|
)
|
@@ -4290,7 +4301,7 @@ function zi(e) {
|
|
4290
4301
|
}
|
4291
4302
|
export {
|
4292
4303
|
zt as Accordion,
|
4293
|
-
|
4304
|
+
Di as Application,
|
4294
4305
|
Ot as BaseRemote,
|
4295
4306
|
Fn as ChildObject,
|
4296
4307
|
Ya as ContainerObject,
|
@@ -4302,30 +4313,30 @@ export {
|
|
4302
4313
|
vi as Inspector,
|
4303
4314
|
$i as MultiView,
|
4304
4315
|
Bn as NavButton,
|
4305
|
-
|
4316
|
+
Ai as RemoteComponents,
|
4306
4317
|
Bi as RemoteController,
|
4307
4318
|
$t as RemoteTheatre,
|
4308
4319
|
Ni as RemoteThree,
|
4309
4320
|
Li as RemoteTweakpane,
|
4310
4321
|
Ui as SceneInspector,
|
4311
4322
|
Fi as SidePanel,
|
4312
|
-
|
4323
|
+
D as ToolEvents,
|
4313
4324
|
Mt as capitalize,
|
4314
4325
|
Ke as clamp,
|
4315
|
-
|
4326
|
+
ka as colorToHex,
|
4316
4327
|
j as debugDispatcher,
|
4317
|
-
|
4328
|
+
ki as defaultTheatreCallback,
|
4318
4329
|
Ut as dispose,
|
4319
4330
|
ja as disposeMaterial,
|
4320
4331
|
ji as disposeTexture,
|
4321
|
-
|
4332
|
+
Pi as distance,
|
4322
4333
|
In as hierarchyUUID,
|
4323
4334
|
Ra as isColor,
|
4324
4335
|
en as mix,
|
4325
4336
|
Ft as noop,
|
4326
4337
|
Qt as normalize,
|
4327
4338
|
_a as randomID,
|
4328
|
-
|
4339
|
+
Pa as resetThreeObjects,
|
4329
4340
|
tn as round,
|
4330
4341
|
Ii as theatreEditorApp,
|
4331
4342
|
It as totalThreeObjects
|