@tomorrowevening/hermes 0.0.58 → 0.0.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/hermes.es.js
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
import { EventDispatcher as
|
2
|
-
import { Pane as
|
3
|
-
import * as
|
4
|
-
import
|
5
|
-
import { Reorder as
|
6
|
-
const
|
7
|
-
},
|
1
|
+
import { EventDispatcher as hn, Texture as fn, CubeTexture as Wn, RepeatWrapping as Ht, WebGLRenderTarget as Hn, Color as Lt, 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 Yt, Float32BufferAttribute as Vt, LineBasicMaterial as ca, Mesh as Pn, MeshBasicMaterial as kn, Ray as la, Plane as ua, MathUtils as da, MOUSE as nt, TOUCH as at, Quaternion as qt, Spherical as Kt, Vector2 as fe, ShaderMaterial as jn, GLSL3 as ha, PlaneGeometry as fa, Scene as ma, Group as pa, AxesHelper as Zt, MeshDepthMaterial as ga, MeshNormalMaterial as va, WebGLRenderer as ba, PerspectiveCamera as kt, Raycaster as ya, OrthographicCamera as Xt, CameraHelper as xa, SpotLightHelper as Ea, PointLightHelper as Ca, HemisphereLightHelper as Sa, DirectionalLightHelper as wa } from "three";
|
2
|
+
import { Pane as Ma } from "tweakpane";
|
3
|
+
import * as Oa from "@tweakpane/plugin-essentials";
|
4
|
+
import An, { useState as Z, useEffect as Ae, useRef as X, useMemo as ie, forwardRef as Ta } from "react";
|
5
|
+
import { Reorder as Dn } from "framer-motion";
|
6
|
+
const Bt = () => {
|
7
|
+
}, Pi = () => {
|
8
8
|
};
|
9
9
|
function Mt(e) {
|
10
10
|
return e.substring(0, 1).toUpperCase() + e.substring(1);
|
@@ -12,60 +12,60 @@ function Mt(e) {
|
|
12
12
|
function Ke(e, n, a) {
|
13
13
|
return Math.min(n, Math.max(e, a));
|
14
14
|
}
|
15
|
-
function
|
15
|
+
function Jt(e, n, a) {
|
16
16
|
return (a - e) / (n - e);
|
17
17
|
}
|
18
|
-
function
|
18
|
+
function Qt(e, n, a) {
|
19
19
|
return e * (1 - a) + n * a;
|
20
20
|
}
|
21
|
-
function
|
21
|
+
function ki(e, n) {
|
22
22
|
const a = e - n;
|
23
23
|
return Math.sqrt(a * a);
|
24
24
|
}
|
25
25
|
function _a() {
|
26
26
|
return Math.round(Math.random() * 1e6).toString();
|
27
27
|
}
|
28
|
-
function
|
28
|
+
function Ra(e) {
|
29
29
|
return e.r !== void 0 && e.g !== void 0 && e.b !== void 0;
|
30
30
|
}
|
31
|
-
function
|
32
|
-
const n = Math.round(e.r * 255), a = Math.round(e.g * 255), t = Math.round(e.b * 255), i = (
|
33
|
-
const
|
34
|
-
return
|
35
|
-
},
|
36
|
-
return "#" +
|
31
|
+
function Pa(e) {
|
32
|
+
const n = Math.round(e.r * 255), a = Math.round(e.g * 255), t = Math.round(e.b * 255), i = (d) => {
|
33
|
+
const h = d.toString(16);
|
34
|
+
return h.length === 1 ? "0" + h : h;
|
35
|
+
}, c = i(n), u = i(a), o = i(t);
|
36
|
+
return "#" + c + u + o;
|
37
37
|
}
|
38
|
-
function
|
38
|
+
function en(e, n = 1) {
|
39
39
|
return Number(e.toFixed(n));
|
40
40
|
}
|
41
41
|
let Dt = 0;
|
42
|
-
const
|
42
|
+
const ka = () => {
|
43
43
|
Dt = 0;
|
44
|
-
},
|
44
|
+
}, In = (e) => {
|
45
45
|
if (!e)
|
46
46
|
return;
|
47
47
|
let n = e.name.replace(" ", "");
|
48
48
|
n.length === 0 && (n = `obj_${Dt}`, Dt++), e.parent !== null && e.parent.uuid.length > 0 && (n = `${e.parent.uuid}.${n}`), e.uuid = n, e.children.forEach((a) => {
|
49
|
-
|
49
|
+
In(a);
|
50
50
|
});
|
51
|
-
},
|
51
|
+
}, ji = (e) => {
|
52
52
|
e?.dispose();
|
53
|
-
},
|
53
|
+
}, ja = (e) => {
|
54
54
|
e && (Array.isArray(e) ? e.forEach((n) => n.dispose()) : e.dispose());
|
55
|
-
},
|
55
|
+
}, Ft = (e) => {
|
56
56
|
if (e) {
|
57
57
|
for (; e.children.length > 0; ) {
|
58
58
|
const n = e.children[0];
|
59
|
-
n.type === "Audio" ? (n.pause(), n.parent && n.parent.remove(n)) :
|
59
|
+
n.type === "Audio" ? (n.pause(), n.parent && n.parent.remove(n)) : Ft(n);
|
60
60
|
}
|
61
61
|
if (e.parent && e.parent.remove(e), e.isMesh) {
|
62
62
|
const n = e;
|
63
|
-
n.geometry?.dispose(),
|
63
|
+
n.geometry?.dispose(), ja(n.material);
|
64
64
|
}
|
65
65
|
e.dispose !== void 0 && e.dispose();
|
66
66
|
}
|
67
67
|
};
|
68
|
-
class
|
68
|
+
class Ai {
|
69
69
|
components = /* @__PURE__ */ new Map();
|
70
70
|
listen;
|
71
71
|
// Protected
|
@@ -123,7 +123,7 @@ class Pi {
|
|
123
123
|
n && (this._mode = "editor");
|
124
124
|
}
|
125
125
|
}
|
126
|
-
const
|
126
|
+
const j = new hn(), A = {
|
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 Di extends Ot {
|
155
155
|
selectDropdown(n, a) {
|
156
156
|
this.app.send({
|
157
157
|
event: "selectComponent",
|
@@ -175,15 +175,15 @@ class ji extends Ot {
|
|
175
175
|
handleApp(n, a, t) {
|
176
176
|
switch (t.event) {
|
177
177
|
case "selectComponent":
|
178
|
-
|
178
|
+
j.dispatchEvent({ type: A.SELECT_DROPDOWN, value: t.data });
|
179
179
|
break;
|
180
180
|
case "draggableListUpdate":
|
181
|
-
|
181
|
+
j.dispatchEvent({ type: A.DRAG_UPDATE, value: t.data });
|
182
182
|
break;
|
183
183
|
}
|
184
184
|
}
|
185
185
|
}
|
186
|
-
class
|
186
|
+
class Ut extends Ot {
|
187
187
|
project;
|
188
188
|
sheets = /* @__PURE__ */ new Map();
|
189
189
|
sheetObjects = /* @__PURE__ */ new Map();
|
@@ -232,17 +232,17 @@ class Bt extends Ot {
|
|
232
232
|
console.error("Theatre Project hasn't been created yet.");
|
233
233
|
return;
|
234
234
|
}
|
235
|
-
const
|
236
|
-
if (
|
235
|
+
const c = this.sheet(n);
|
236
|
+
if (c === void 0)
|
237
237
|
return;
|
238
238
|
const u = `${n}_${a}`;
|
239
|
-
let
|
240
|
-
|
241
|
-
const
|
239
|
+
let o = this.sheetObjects.get(u);
|
240
|
+
o !== void 0 ? o = c.object(a, { ...t, ...o.value }, { reconfigure: !0 }) : o = c.object(a, t), this.sheetObjects.set(u, o), this.sheetObjectCBs.set(u, i !== void 0 ? i : Bt);
|
241
|
+
const d = o.onValuesChange((h) => {
|
242
242
|
if (this.app.editor) {
|
243
|
-
for (const m in
|
244
|
-
const x =
|
245
|
-
typeof x == "object" &&
|
243
|
+
for (const m in h) {
|
244
|
+
const x = h[m];
|
245
|
+
typeof x == "object" && Ra(x) && (h[m] = {
|
246
246
|
r: x.r,
|
247
247
|
g: x.g,
|
248
248
|
b: x.b,
|
@@ -255,14 +255,14 @@ class Bt extends Ot {
|
|
255
255
|
data: {
|
256
256
|
sheet: n,
|
257
257
|
sheetObject: u,
|
258
|
-
values:
|
258
|
+
values: h
|
259
259
|
}
|
260
260
|
});
|
261
261
|
}
|
262
262
|
const f = this.sheetObjectCBs.get(u);
|
263
|
-
f !== void 0 && f(
|
263
|
+
f !== void 0 && f(h);
|
264
264
|
});
|
265
|
-
return this.sheetObjectUnsubscribe.set(u,
|
265
|
+
return this.sheetObjectUnsubscribe.set(u, d), o;
|
266
266
|
}
|
267
267
|
unsubscribe(n) {
|
268
268
|
if (this.project === void 0) {
|
@@ -271,24 +271,24 @@ class Bt extends Ot {
|
|
271
271
|
}
|
272
272
|
const a = n.address.sheetId, t = n.address.objectKey;
|
273
273
|
this.sheets.get(a)?.detachObject(t);
|
274
|
-
const
|
275
|
-
u !== void 0 && (this.sheetObjects.delete(
|
274
|
+
const c = `${a}_${t}`, u = this.sheetObjectUnsubscribe.get(c);
|
275
|
+
u !== void 0 && (this.sheetObjects.delete(c), this.sheetObjectCBs.delete(c), this.sheetObjectUnsubscribe.delete(c), u());
|
276
276
|
}
|
277
277
|
handleApp(n, a, t) {
|
278
278
|
const i = a;
|
279
|
-
let
|
279
|
+
let c;
|
280
280
|
switch (t.event) {
|
281
281
|
case "setSheet":
|
282
|
-
|
282
|
+
c = i.sheets.get(t.data.sheet), c !== void 0 && (i.activeSheet = c, this.studio?.setSelection([c]));
|
283
283
|
break;
|
284
284
|
case "setSheetObject":
|
285
|
-
|
285
|
+
c = i.sheetObjects.get(`${t.data.sheet}_${t.data.key}`), c !== void 0 && this.studio?.setSelection([c]);
|
286
286
|
break;
|
287
287
|
case "updateSheetObject":
|
288
|
-
|
288
|
+
c = i.sheets.get(t.data.sheet), c !== void 0 && c.sequence.pause(), c = i.sheetObjectCBs.get(t.data.sheetObject), c !== void 0 && c(t.data.values);
|
289
289
|
break;
|
290
290
|
case "updateTimeline":
|
291
|
-
|
291
|
+
c = i.sheets.get(t.data.sheet), i.activeSheet !== void 0 && (i.activeSheet.sequence.position = t.data.position);
|
292
292
|
break;
|
293
293
|
}
|
294
294
|
}
|
@@ -308,28 +308,28 @@ class Bt extends Ot {
|
|
308
308
|
handleEditorApp(n, a) {
|
309
309
|
if (n.editor) {
|
310
310
|
this.studio?.ui.restore(), this.studio?.onSelectionChange((u) => {
|
311
|
-
u.length < 1 || u.forEach((
|
312
|
-
let
|
313
|
-
switch (
|
311
|
+
u.length < 1 || u.forEach((o) => {
|
312
|
+
let d = o.address.sheetId, h = "setSheet", f = {};
|
313
|
+
switch (o.type) {
|
314
314
|
case "Theatre_Sheet_PublicAPI":
|
315
|
-
|
316
|
-
sheet:
|
317
|
-
}, a.activeSheet = a.sheets.get(
|
315
|
+
h = "setSheet", f = {
|
316
|
+
sheet: o.address.sheetId
|
317
|
+
}, a.activeSheet = a.sheets.get(o.address.sheetId);
|
318
318
|
break;
|
319
319
|
case "Theatre_SheetObject_PublicAPI":
|
320
|
-
|
321
|
-
id:
|
322
|
-
sheet:
|
323
|
-
key:
|
324
|
-
}, a.activeSheet = a.sheets.get(
|
320
|
+
h = "setSheetObject", d += `_${o.address.objectKey}`, f = {
|
321
|
+
id: d,
|
322
|
+
sheet: o.address.sheetId,
|
323
|
+
key: o.address.objectKey
|
324
|
+
}, a.activeSheet = a.sheets.get(o.address.sheetId);
|
325
325
|
break;
|
326
326
|
}
|
327
|
-
n.send({ event:
|
327
|
+
n.send({ event: h, target: "app", data: f });
|
328
328
|
});
|
329
329
|
});
|
330
330
|
let t = -1;
|
331
331
|
const i = () => {
|
332
|
-
if (
|
332
|
+
if (Ut.rafDriver?.tick(performance.now()), a.activeSheet !== void 0 && t !== a.activeSheet.sequence.position) {
|
333
333
|
t = a.activeSheet.sequence.position;
|
334
334
|
const u = a.activeSheet;
|
335
335
|
n.send({
|
@@ -341,39 +341,39 @@ class Bt extends Ot {
|
|
341
341
|
}
|
342
342
|
});
|
343
343
|
}
|
344
|
-
},
|
345
|
-
i(), requestAnimationFrame(
|
344
|
+
}, c = () => {
|
345
|
+
i(), requestAnimationFrame(c);
|
346
346
|
};
|
347
|
-
i(),
|
347
|
+
i(), c();
|
348
348
|
} else
|
349
349
|
this.studio?.ui.hide();
|
350
350
|
}
|
351
351
|
}
|
352
|
-
function
|
352
|
+
function Ii(e, n, a) {
|
353
353
|
if (e.editor) {
|
354
354
|
a.ui.restore(), a.onSelectionChange((u) => {
|
355
|
-
u.length < 1 || u.forEach((
|
356
|
-
let
|
357
|
-
switch (
|
355
|
+
u.length < 1 || u.forEach((o) => {
|
356
|
+
let d = o.address.sheetId, h = "setSheet", f = {};
|
357
|
+
switch (o.type) {
|
358
358
|
case "Theatre_Sheet_PublicAPI":
|
359
|
-
|
360
|
-
sheet:
|
361
|
-
}, n.activeSheet = n.sheets.get(
|
359
|
+
h = "setSheet", f = {
|
360
|
+
sheet: o.address.sheetId
|
361
|
+
}, n.activeSheet = n.sheets.get(o.address.sheetId);
|
362
362
|
break;
|
363
363
|
case "Theatre_SheetObject_PublicAPI":
|
364
|
-
|
365
|
-
id:
|
366
|
-
sheet:
|
367
|
-
key:
|
368
|
-
}, n.activeSheet = n.sheets.get(
|
364
|
+
h = "setSheetObject", d += `_${o.address.objectKey}`, f = {
|
365
|
+
id: d,
|
366
|
+
sheet: o.address.sheetId,
|
367
|
+
key: o.address.objectKey
|
368
|
+
}, n.activeSheet = n.sheets.get(o.address.sheetId);
|
369
369
|
break;
|
370
370
|
}
|
371
|
-
e.send({ event:
|
371
|
+
e.send({ event: h, target: "app", data: f });
|
372
372
|
});
|
373
373
|
});
|
374
374
|
let t = -1;
|
375
375
|
const i = () => {
|
376
|
-
if (
|
376
|
+
if (Ut.rafDriver?.tick(performance.now()), n.activeSheet !== void 0 && t !== n.activeSheet.sequence.position) {
|
377
377
|
t = n.activeSheet.sequence.position;
|
378
378
|
const u = n.activeSheet;
|
379
379
|
e.send({
|
@@ -385,14 +385,14 @@ function Di(e, n, a) {
|
|
385
385
|
}
|
386
386
|
});
|
387
387
|
}
|
388
|
-
},
|
389
|
-
i(), requestAnimationFrame(
|
388
|
+
}, c = () => {
|
389
|
+
i(), requestAnimationFrame(c);
|
390
390
|
};
|
391
|
-
i(),
|
391
|
+
i(), c();
|
392
392
|
} else
|
393
393
|
a.ui.hide();
|
394
394
|
}
|
395
|
-
function
|
395
|
+
function Aa(e) {
|
396
396
|
if (e.name === "cameras")
|
397
397
|
return "camera";
|
398
398
|
if (e.name === "interactive")
|
@@ -417,7 +417,7 @@ function Nn(e) {
|
|
417
417
|
n.children.push(Nn(a));
|
418
418
|
}), n;
|
419
419
|
}
|
420
|
-
function
|
420
|
+
function Da(e) {
|
421
421
|
const n = {};
|
422
422
|
for (const a in e) {
|
423
423
|
const t = e[a].value;
|
@@ -425,7 +425,7 @@ function ja(e) {
|
|
425
425
|
}
|
426
426
|
return n;
|
427
427
|
}
|
428
|
-
function
|
428
|
+
function Ia(e) {
|
429
429
|
switch (e) {
|
430
430
|
case "blendSrcAlpha":
|
431
431
|
case "blendDstAlpha":
|
@@ -440,7 +440,7 @@ function Da(e) {
|
|
440
440
|
function it(e) {
|
441
441
|
const n = {};
|
442
442
|
for (const a in e) {
|
443
|
-
if (a.substring(0, 1) === "_" || a.substring(0, 2) === "is" ||
|
443
|
+
if (a.substring(0, 1) === "_" || a.substring(0, 2) === "is" || Ia(a))
|
444
444
|
continue;
|
445
445
|
const t = typeof e[a], i = e[a];
|
446
446
|
switch (t) {
|
@@ -452,13 +452,13 @@ function it(e) {
|
|
452
452
|
case "object":
|
453
453
|
if (i !== null)
|
454
454
|
if (n[a] = i, i.isTexture)
|
455
|
-
if (i instanceof
|
456
|
-
const
|
457
|
-
n[a] = { src:
|
455
|
+
if (i instanceof fn) {
|
456
|
+
const c = i.source.toJSON();
|
457
|
+
n[a] = { src: c.url };
|
458
458
|
} else
|
459
|
-
i instanceof
|
459
|
+
i instanceof Wn && (console.log("env map"), console.log(i.source.data), console.log(i.source.toJSON()), n[a] = { src: "" });
|
460
460
|
else
|
461
|
-
a === "uniforms" && (n[a] =
|
461
|
+
a === "uniforms" && (n[a] = Da(n[a]));
|
462
462
|
else
|
463
463
|
n[a] = { src: "" };
|
464
464
|
break;
|
@@ -466,7 +466,7 @@ function it(e) {
|
|
466
466
|
}
|
467
467
|
return n;
|
468
468
|
}
|
469
|
-
function
|
469
|
+
function jt(e) {
|
470
470
|
e.updateMatrix();
|
471
471
|
const n = {
|
472
472
|
name: e.name,
|
@@ -492,8 +492,8 @@ function Pt(e) {
|
|
492
492
|
const t = e;
|
493
493
|
if (Array.isArray(t.material)) {
|
494
494
|
const i = [];
|
495
|
-
t.material.forEach((
|
496
|
-
i.push(it(
|
495
|
+
t.material.forEach((c) => {
|
496
|
+
i.push(it(c));
|
497
497
|
}), n.material = i;
|
498
498
|
} else
|
499
499
|
n.material = it(t.material);
|
@@ -501,8 +501,8 @@ function Pt(e) {
|
|
501
501
|
const t = e;
|
502
502
|
if (Array.isArray(t.material)) {
|
503
503
|
const i = [];
|
504
|
-
t.material.forEach((
|
505
|
-
i.push(it(
|
504
|
+
t.material.forEach((c) => {
|
505
|
+
i.push(it(c));
|
506
506
|
}), n.material = i;
|
507
507
|
} else
|
508
508
|
n.material = it(t.material);
|
@@ -510,8 +510,8 @@ function Pt(e) {
|
|
510
510
|
const t = e;
|
511
511
|
if (Array.isArray(t.material)) {
|
512
512
|
const i = [];
|
513
|
-
t.material.forEach((
|
514
|
-
i.push(it(
|
513
|
+
t.material.forEach((c) => {
|
514
|
+
i.push(it(c));
|
515
515
|
}), n.material = i;
|
516
516
|
} else
|
517
517
|
n.material = it(t.material);
|
@@ -546,7 +546,7 @@ function Pt(e) {
|
|
546
546
|
});
|
547
547
|
return n;
|
548
548
|
}
|
549
|
-
function
|
549
|
+
function Na(e, n) {
|
550
550
|
const a = n.split(".");
|
551
551
|
switch (a.length) {
|
552
552
|
case 1:
|
@@ -563,11 +563,11 @@ function Ia(e, n) {
|
|
563
563
|
return e[a[0]][a[1]][a[2]][a[3]][a[4]][a[5]];
|
564
564
|
}
|
565
565
|
}
|
566
|
-
function
|
566
|
+
function La(e, n) {
|
567
567
|
for (const a in n)
|
568
568
|
e[a] = n[a];
|
569
569
|
}
|
570
|
-
function
|
570
|
+
function V(e, n, a) {
|
571
571
|
const t = n.split("."), i = t.length;
|
572
572
|
if (typeof a != "object")
|
573
573
|
switch (i) {
|
@@ -606,21 +606,27 @@ function Q(e, n, a) {
|
|
606
606
|
u = e[t[0]][t[1]][t[2]][t[3]][t[4]];
|
607
607
|
break;
|
608
608
|
}
|
609
|
-
u !== void 0 &&
|
609
|
+
u !== void 0 && La(u, a);
|
610
610
|
}
|
611
611
|
}
|
612
612
|
function Ln(e) {
|
613
613
|
return new Promise((n, a) => {
|
614
614
|
const t = new Image();
|
615
615
|
t.onload = () => {
|
616
|
-
const i = new
|
616
|
+
const i = new fn(t);
|
617
617
|
i.wrapS = Ht, i.wrapT = Ht, i.needsUpdate = !0, n(i);
|
618
618
|
}, t.onerror = a, t.src = e;
|
619
619
|
});
|
620
620
|
}
|
621
|
-
class
|
621
|
+
class Ni extends Ot {
|
622
622
|
scene = void 0;
|
623
623
|
renderer = void 0;
|
624
|
+
renderTargets = /* @__PURE__ */ new Map();
|
625
|
+
dispose() {
|
626
|
+
this.renderTargets.forEach((n) => {
|
627
|
+
n.dispose();
|
628
|
+
}), this.renderTargets.clear(), this.scene && Ft(this.scene), this.renderer?.dispose();
|
629
|
+
}
|
624
630
|
getObject(n) {
|
625
631
|
this.app.debugEnabled && this.app.send({
|
626
632
|
event: "getObject",
|
@@ -629,7 +635,7 @@ class Ii extends Ot {
|
|
629
635
|
});
|
630
636
|
}
|
631
637
|
setObject(n) {
|
632
|
-
const a =
|
638
|
+
const a = jt(n);
|
633
639
|
this.app.send({
|
634
640
|
event: "setObject",
|
635
641
|
target: "editor",
|
@@ -673,7 +679,7 @@ class Ii extends Ot {
|
|
673
679
|
setScene(n) {
|
674
680
|
if (n === void 0 || (this.scene = n, !this.app.debugEnabled))
|
675
681
|
return;
|
676
|
-
|
682
|
+
ka(), In(this.scene);
|
677
683
|
const a = Nn(this.scene);
|
678
684
|
this.app.send({
|
679
685
|
event: "setScene",
|
@@ -684,7 +690,7 @@ class Ii extends Ot {
|
|
684
690
|
addCamera(n) {
|
685
691
|
if (!this.app.debugEnabled)
|
686
692
|
return;
|
687
|
-
const a =
|
693
|
+
const a = jt(n);
|
688
694
|
this.app.send({
|
689
695
|
event: "addCamera",
|
690
696
|
target: "editor",
|
@@ -694,7 +700,7 @@ class Ii extends Ot {
|
|
694
700
|
removeCamera(n) {
|
695
701
|
if (!this.app.debugEnabled)
|
696
702
|
return;
|
697
|
-
const a =
|
703
|
+
const a = jt(n);
|
698
704
|
this.app.send({
|
699
705
|
event: "removeCamera",
|
700
706
|
target: "editor",
|
@@ -704,38 +710,47 @@ class Ii extends Ot {
|
|
704
710
|
handleApp(n, a, t) {
|
705
711
|
switch (t.event) {
|
706
712
|
case "getObject":
|
707
|
-
|
713
|
+
j.dispatchEvent({ type: A.GET_OBJECT, value: t.data });
|
708
714
|
break;
|
709
715
|
case "updateObject":
|
710
|
-
|
716
|
+
j.dispatchEvent({ type: A.UPDATE_OBJECT, value: t.data });
|
711
717
|
break;
|
712
718
|
case "createTexture":
|
713
|
-
|
719
|
+
j.dispatchEvent({ type: A.CREATE_TEXTURE, value: t.data });
|
714
720
|
break;
|
715
721
|
case "requestMethod":
|
716
|
-
|
722
|
+
j.dispatchEvent({ type: A.REQUEST_METHOD, value: t.data });
|
717
723
|
break;
|
718
724
|
}
|
719
725
|
}
|
720
726
|
handleEditor(n, a, t) {
|
721
727
|
switch (t.event) {
|
722
728
|
case "setObject":
|
723
|
-
|
729
|
+
j.dispatchEvent({ type: A.SET_OBJECT, value: t.data });
|
724
730
|
break;
|
725
731
|
case "setScene":
|
726
|
-
|
732
|
+
j.dispatchEvent({ type: A.SET_SCENE, value: t.data });
|
727
733
|
break;
|
728
734
|
case "addCamera":
|
729
|
-
|
735
|
+
j.dispatchEvent({ type: A.ADD_CAMERA, value: t.data });
|
730
736
|
break;
|
731
737
|
case "removeCamera":
|
732
|
-
|
738
|
+
j.dispatchEvent({ type: A.REMOVE_CAMERA, value: t.data });
|
733
739
|
break;
|
734
740
|
}
|
735
741
|
}
|
736
742
|
// Renderer
|
743
|
+
rendererWidth = 0;
|
744
|
+
rendererHeight = 0;
|
745
|
+
addRT(n, a) {
|
746
|
+
const t = new Hn(32, 32, a);
|
747
|
+
t.texture.name = n, this.renderTargets.set(n, t);
|
748
|
+
}
|
737
749
|
resize(n, a) {
|
738
|
-
this.
|
750
|
+
const t = this.dpr;
|
751
|
+
this.rendererWidth = n, this.rendererHeight = a, this.renderTargets.forEach((i) => {
|
752
|
+
i.setSize(n * t, a * t);
|
753
|
+
}), this.renderer?.setSize(n, a);
|
739
754
|
}
|
740
755
|
set dpr(n) {
|
741
756
|
this.renderer?.setPixelRatio(Ke(1, 2, n));
|
@@ -744,16 +759,16 @@ class Ii extends Ot {
|
|
744
759
|
return this.renderer !== void 0 ? this.renderer?.getPixelRatio() : 1;
|
745
760
|
}
|
746
761
|
get width() {
|
747
|
-
return this.
|
762
|
+
return this.rendererWidth;
|
748
763
|
}
|
749
764
|
get height() {
|
750
|
-
return this.
|
765
|
+
return this.rendererHeight;
|
751
766
|
}
|
752
767
|
get canvas() {
|
753
768
|
return this.renderer !== void 0 ? this.renderer?.domElement : null;
|
754
769
|
}
|
755
770
|
}
|
756
|
-
class
|
771
|
+
class Li extends Ot {
|
757
772
|
bindCBs;
|
758
773
|
buttonCBs;
|
759
774
|
pane = void 0;
|
@@ -764,7 +779,7 @@ class Ni extends Ot {
|
|
764
779
|
super(n), this.bindCBs = /* @__PURE__ */ new Map(), this.buttonCBs = /* @__PURE__ */ new Map(), n.editor && this.createGUI();
|
765
780
|
}
|
766
781
|
createGUI() {
|
767
|
-
this.pane = new
|
782
|
+
this.pane = new Ma({ title: "GUI" }), this.pane.registerPlugin(Oa);
|
768
783
|
}
|
769
784
|
dispose() {
|
770
785
|
this.bindCBs.clear(), this.buttonCBs.clear(), this.appCallbacks = 0, this.editorCallbacks = 0, this.app.editor && (this.pane?.dispose(), this.pane = void 0);
|
@@ -790,21 +805,21 @@ class Ni extends Ot {
|
|
790
805
|
}
|
791
806
|
// Binding
|
792
807
|
bind(n, a, t, i = void 0) {
|
793
|
-
const
|
794
|
-
this.bindCBs.set(
|
808
|
+
const c = this.bindID, u = t.onChange !== void 0 ? t.onChange : Bt;
|
809
|
+
this.bindCBs.set(c, u), this.app.editor ? (this.pane === void 0 && this.createGUI(), (i !== void 0 ? i : this.pane).addBinding(n, a, t).on("change", (d) => {
|
795
810
|
this.app.send({
|
796
811
|
event: "updateBind",
|
797
812
|
target: "app",
|
798
813
|
data: {
|
799
|
-
id:
|
800
|
-
value:
|
814
|
+
id: c,
|
815
|
+
value: d.value
|
801
816
|
}
|
802
817
|
});
|
803
818
|
}), this.editorCallbacks++) : (this.app.send({
|
804
819
|
event: "bindObject",
|
805
820
|
target: "app",
|
806
821
|
data: {
|
807
|
-
id:
|
822
|
+
id: c,
|
808
823
|
name: a,
|
809
824
|
params: t,
|
810
825
|
parent: i
|
@@ -881,21 +896,21 @@ var It = { exports: {} }, lt = {};
|
|
881
896
|
* This source code is licensed under the MIT license found in the
|
882
897
|
* LICENSE file in the root directory of this source tree.
|
883
898
|
*/
|
884
|
-
var
|
885
|
-
function
|
886
|
-
if (
|
899
|
+
var tn;
|
900
|
+
function Ba() {
|
901
|
+
if (tn)
|
887
902
|
return lt;
|
888
|
-
|
889
|
-
var e =
|
890
|
-
function u(
|
891
|
-
var f, m = {}, x = null,
|
892
|
-
|
893
|
-
for (f in
|
894
|
-
t.call(
|
895
|
-
if (
|
896
|
-
for (f in
|
897
|
-
m[f] === void 0 && (m[f] =
|
898
|
-
return { $$typeof: n, type:
|
903
|
+
tn = 1;
|
904
|
+
var e = An, 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, c = { key: !0, ref: !0, __self: !0, __source: !0 };
|
905
|
+
function u(o, d, h) {
|
906
|
+
var f, m = {}, x = null, T = null;
|
907
|
+
h !== void 0 && (x = "" + h), d.key !== void 0 && (x = "" + d.key), d.ref !== void 0 && (T = d.ref);
|
908
|
+
for (f in d)
|
909
|
+
t.call(d, f) && !c.hasOwnProperty(f) && (m[f] = d[f]);
|
910
|
+
if (o && o.defaultProps)
|
911
|
+
for (f in d = o.defaultProps, d)
|
912
|
+
m[f] === void 0 && (m[f] = d[f]);
|
913
|
+
return { $$typeof: n, type: o, key: x, ref: T, props: m, _owner: i.current };
|
899
914
|
}
|
900
915
|
return lt.Fragment = a, lt.jsx = u, lt.jsxs = u, lt;
|
901
916
|
}
|
@@ -909,54 +924,54 @@ var ut = {};
|
|
909
924
|
* This source code is licensed under the MIT license found in the
|
910
925
|
* LICENSE file in the root directory of this source tree.
|
911
926
|
*/
|
912
|
-
var
|
927
|
+
var nn;
|
913
928
|
function Fa() {
|
914
|
-
return
|
915
|
-
var e =
|
929
|
+
return nn || (nn = 1, process.env.NODE_ENV !== "production" && function() {
|
930
|
+
var e = An, n = Symbol.for("react.element"), a = Symbol.for("react.portal"), t = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), c = Symbol.for("react.profiler"), u = Symbol.for("react.provider"), o = 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"), T = Symbol.for("react.offscreen"), W = Symbol.iterator, te = "@@iterator";
|
916
931
|
function me(r) {
|
917
932
|
if (r === null || typeof r != "object")
|
918
933
|
return null;
|
919
|
-
var p =
|
934
|
+
var p = W && r[W] || r[te];
|
920
935
|
return typeof p == "function" ? p : null;
|
921
936
|
}
|
922
937
|
var re = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
923
938
|
function $(r) {
|
924
939
|
{
|
925
|
-
for (var p = arguments.length, b = new Array(p > 1 ? p - 1 : 0),
|
926
|
-
b[
|
927
|
-
|
940
|
+
for (var p = arguments.length, b = new Array(p > 1 ? p - 1 : 0), S = 1; S < p; S++)
|
941
|
+
b[S - 1] = arguments[S];
|
942
|
+
I("error", r, b);
|
928
943
|
}
|
929
944
|
}
|
930
|
-
function
|
945
|
+
function I(r, p, b) {
|
931
946
|
{
|
932
|
-
var
|
933
|
-
|
934
|
-
var U = b.map(function(
|
935
|
-
return String(
|
947
|
+
var S = re.ReactDebugCurrentFrame, L = S.getStackAddendum();
|
948
|
+
L !== "" && (p += "%s", b = b.concat([L]));
|
949
|
+
var U = b.map(function(k) {
|
950
|
+
return String(k);
|
936
951
|
});
|
937
952
|
U.unshift("Warning: " + p), Function.prototype.apply.call(console[r], console, U);
|
938
953
|
}
|
939
954
|
}
|
940
|
-
var
|
941
|
-
|
942
|
-
function
|
943
|
-
return !!(typeof r == "string" || typeof r == "function" || r === t || r ===
|
955
|
+
var q = !1, ne = !1, Se = !1, z = !1, pe = !1, ce;
|
956
|
+
ce = Symbol.for("react.module.reference");
|
957
|
+
function Te(r) {
|
958
|
+
return !!(typeof r == "string" || typeof r == "function" || r === t || r === c || pe || r === i || r === h || r === f || z || r === T || q || ne || Se || typeof r == "object" && r !== null && (r.$$typeof === x || r.$$typeof === m || r.$$typeof === u || r.$$typeof === o || r.$$typeof === d || // This needs to include all possible module reference object
|
944
959
|
// types supported by any Flight configuration anywhere since
|
945
960
|
// we don't know which Flight build this will end up being used
|
946
961
|
// with.
|
947
|
-
r.$$typeof ===
|
962
|
+
r.$$typeof === ce || r.getModuleId !== void 0));
|
948
963
|
}
|
949
|
-
function
|
950
|
-
var
|
951
|
-
if (
|
952
|
-
return
|
953
|
-
var
|
954
|
-
return
|
964
|
+
function _e(r, p, b) {
|
965
|
+
var S = r.displayName;
|
966
|
+
if (S)
|
967
|
+
return S;
|
968
|
+
var L = p.displayName || p.name || "";
|
969
|
+
return L !== "" ? b + "(" + L + ")" : b;
|
955
970
|
}
|
956
971
|
function ve(r) {
|
957
972
|
return r.displayName || "Context";
|
958
973
|
}
|
959
|
-
function
|
974
|
+
function N(r) {
|
960
975
|
if (r == null)
|
961
976
|
return null;
|
962
977
|
if (typeof r.tag == "number" && $("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof r == "function")
|
@@ -968,32 +983,32 @@ function Fa() {
|
|
968
983
|
return "Fragment";
|
969
984
|
case a:
|
970
985
|
return "Portal";
|
971
|
-
case
|
986
|
+
case c:
|
972
987
|
return "Profiler";
|
973
988
|
case i:
|
974
989
|
return "StrictMode";
|
975
|
-
case
|
990
|
+
case h:
|
976
991
|
return "Suspense";
|
977
992
|
case f:
|
978
993
|
return "SuspenseList";
|
979
994
|
}
|
980
995
|
if (typeof r == "object")
|
981
996
|
switch (r.$$typeof) {
|
982
|
-
case
|
997
|
+
case o:
|
983
998
|
var p = r;
|
984
999
|
return ve(p) + ".Consumer";
|
985
1000
|
case u:
|
986
1001
|
var b = r;
|
987
1002
|
return ve(b._context) + ".Provider";
|
988
|
-
case
|
989
|
-
return
|
1003
|
+
case d:
|
1004
|
+
return _e(r, r.render, "ForwardRef");
|
990
1005
|
case m:
|
991
|
-
var
|
992
|
-
return
|
1006
|
+
var S = r.displayName || null;
|
1007
|
+
return S !== null ? S : N(r.type) || "Memo";
|
993
1008
|
case x: {
|
994
|
-
var
|
1009
|
+
var L = r, U = L._payload, k = L._init;
|
995
1010
|
try {
|
996
|
-
return
|
1011
|
+
return N(k(U));
|
997
1012
|
} catch {
|
998
1013
|
return null;
|
999
1014
|
}
|
@@ -1001,18 +1016,18 @@ function Fa() {
|
|
1001
1016
|
}
|
1002
1017
|
return null;
|
1003
1018
|
}
|
1004
|
-
var be = Object.assign,
|
1005
|
-
function
|
1019
|
+
var be = Object.assign, w = 0, we, Re, De, Pe, ke, Ie, Be;
|
1020
|
+
function Fe() {
|
1006
1021
|
}
|
1007
|
-
|
1022
|
+
Fe.__reactDisabledLog = !0;
|
1008
1023
|
function ae() {
|
1009
1024
|
{
|
1010
|
-
if (
|
1011
|
-
we = console.log, Re = console.info,
|
1025
|
+
if (w === 0) {
|
1026
|
+
we = console.log, Re = console.info, De = console.warn, Pe = console.error, ke = console.group, Ie = console.groupCollapsed, Be = console.groupEnd;
|
1012
1027
|
var r = {
|
1013
1028
|
configurable: !0,
|
1014
1029
|
enumerable: !0,
|
1015
|
-
value:
|
1030
|
+
value: Fe,
|
1016
1031
|
writable: !0
|
1017
1032
|
};
|
1018
1033
|
Object.defineProperties(console, {
|
@@ -1025,12 +1040,12 @@ function Fa() {
|
|
1025
1040
|
groupEnd: r
|
1026
1041
|
});
|
1027
1042
|
}
|
1028
|
-
|
1043
|
+
w++;
|
1029
1044
|
}
|
1030
1045
|
}
|
1031
1046
|
function Me() {
|
1032
1047
|
{
|
1033
|
-
if (
|
1048
|
+
if (w--, w === 0) {
|
1034
1049
|
var r = {
|
1035
1050
|
configurable: !0,
|
1036
1051
|
enumerable: !0,
|
@@ -1044,45 +1059,45 @@ function Fa() {
|
|
1044
1059
|
value: Re
|
1045
1060
|
}),
|
1046
1061
|
warn: be({}, r, {
|
1047
|
-
value:
|
1062
|
+
value: De
|
1048
1063
|
}),
|
1049
1064
|
error: be({}, r, {
|
1050
|
-
value:
|
1065
|
+
value: Pe
|
1051
1066
|
}),
|
1052
1067
|
group: be({}, r, {
|
1053
1068
|
value: ke
|
1054
1069
|
}),
|
1055
1070
|
groupCollapsed: be({}, r, {
|
1056
|
-
value:
|
1071
|
+
value: Ie
|
1057
1072
|
}),
|
1058
1073
|
groupEnd: be({}, r, {
|
1059
|
-
value:
|
1074
|
+
value: Be
|
1060
1075
|
})
|
1061
1076
|
});
|
1062
1077
|
}
|
1063
|
-
|
1078
|
+
w < 0 && $("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
1064
1079
|
}
|
1065
1080
|
}
|
1066
|
-
var
|
1081
|
+
var He = re.ReactCurrentDispatcher, Ye;
|
1067
1082
|
function ue(r, p, b) {
|
1068
1083
|
{
|
1069
|
-
if (
|
1084
|
+
if (Ye === void 0)
|
1070
1085
|
try {
|
1071
1086
|
throw Error();
|
1072
|
-
} catch (
|
1073
|
-
var
|
1074
|
-
|
1087
|
+
} catch (L) {
|
1088
|
+
var S = L.stack.trim().match(/\n( *(at )?)/);
|
1089
|
+
Ye = S && S[1] || "";
|
1075
1090
|
}
|
1076
1091
|
return `
|
1077
|
-
` +
|
1092
|
+
` + Ye + r;
|
1078
1093
|
}
|
1079
1094
|
}
|
1080
1095
|
var g = !1, v;
|
1081
1096
|
{
|
1082
|
-
var
|
1083
|
-
v = new
|
1097
|
+
var M = typeof WeakMap == "function" ? WeakMap : Map;
|
1098
|
+
v = new M();
|
1084
1099
|
}
|
1085
|
-
function
|
1100
|
+
function P(r, p) {
|
1086
1101
|
if (!r || g)
|
1087
1102
|
return "";
|
1088
1103
|
{
|
@@ -1090,135 +1105,135 @@ function Fa() {
|
|
1090
1105
|
if (b !== void 0)
|
1091
1106
|
return b;
|
1092
1107
|
}
|
1093
|
-
var
|
1108
|
+
var S;
|
1094
1109
|
g = !0;
|
1095
|
-
var
|
1110
|
+
var L = Error.prepareStackTrace;
|
1096
1111
|
Error.prepareStackTrace = void 0;
|
1097
1112
|
var U;
|
1098
|
-
U =
|
1113
|
+
U = He.current, He.current = null, ae();
|
1099
1114
|
try {
|
1100
1115
|
if (p) {
|
1101
|
-
var
|
1116
|
+
var k = function() {
|
1102
1117
|
throw Error();
|
1103
1118
|
};
|
1104
|
-
if (Object.defineProperty(
|
1119
|
+
if (Object.defineProperty(k.prototype, "props", {
|
1105
1120
|
set: function() {
|
1106
1121
|
throw Error();
|
1107
1122
|
}
|
1108
1123
|
}), typeof Reflect == "object" && Reflect.construct) {
|
1109
1124
|
try {
|
1110
|
-
Reflect.construct(
|
1111
|
-
} catch (
|
1112
|
-
|
1125
|
+
Reflect.construct(k, []);
|
1126
|
+
} catch (Le) {
|
1127
|
+
S = Le;
|
1113
1128
|
}
|
1114
|
-
Reflect.construct(r, [],
|
1129
|
+
Reflect.construct(r, [], k);
|
1115
1130
|
} else {
|
1116
1131
|
try {
|
1117
|
-
|
1118
|
-
} catch (
|
1119
|
-
|
1132
|
+
k.call();
|
1133
|
+
} catch (Le) {
|
1134
|
+
S = Le;
|
1120
1135
|
}
|
1121
|
-
r.call(
|
1136
|
+
r.call(k.prototype);
|
1122
1137
|
}
|
1123
1138
|
} else {
|
1124
1139
|
try {
|
1125
1140
|
throw Error();
|
1126
|
-
} catch (
|
1127
|
-
|
1141
|
+
} catch (Le) {
|
1142
|
+
S = Le;
|
1128
1143
|
}
|
1129
1144
|
r();
|
1130
1145
|
}
|
1131
|
-
} catch (
|
1132
|
-
if (
|
1133
|
-
for (var R =
|
1134
|
-
`), he =
|
1135
|
-
`),
|
1136
|
-
|
1137
|
-
for (;
|
1138
|
-
if (R[
|
1139
|
-
if (
|
1146
|
+
} catch (Le) {
|
1147
|
+
if (Le && S && typeof Le.stack == "string") {
|
1148
|
+
for (var R = Le.stack.split(`
|
1149
|
+
`), he = S.stack.split(`
|
1150
|
+
`), K = R.length - 1, Q = he.length - 1; K >= 1 && Q >= 0 && R[K] !== he[Q]; )
|
1151
|
+
Q--;
|
1152
|
+
for (; K >= 1 && Q >= 0; K--, Q--)
|
1153
|
+
if (R[K] !== he[Q]) {
|
1154
|
+
if (K !== 1 || Q !== 1)
|
1140
1155
|
do
|
1141
|
-
if (
|
1156
|
+
if (K--, Q--, Q < 0 || R[K] !== he[Q]) {
|
1142
1157
|
var Ce = `
|
1143
|
-
` + R[
|
1158
|
+
` + R[K].replace(" at new ", " at ");
|
1144
1159
|
return r.displayName && Ce.includes("<anonymous>") && (Ce = Ce.replace("<anonymous>", r.displayName)), typeof r == "function" && v.set(r, Ce), Ce;
|
1145
1160
|
}
|
1146
|
-
while (
|
1161
|
+
while (K >= 1 && Q >= 0);
|
1147
1162
|
break;
|
1148
1163
|
}
|
1149
1164
|
}
|
1150
1165
|
} finally {
|
1151
|
-
g = !1,
|
1166
|
+
g = !1, He.current = U, Me(), Error.prepareStackTrace = L;
|
1152
1167
|
}
|
1153
|
-
var tt = r ? r.displayName || r.name : "",
|
1154
|
-
return typeof r == "function" && v.set(r,
|
1168
|
+
var tt = r ? r.displayName || r.name : "", Wt = tt ? ue(tt) : "";
|
1169
|
+
return typeof r == "function" && v.set(r, Wt), Wt;
|
1155
1170
|
}
|
1156
1171
|
function ge(r, p, b) {
|
1157
|
-
return
|
1172
|
+
return P(r, !1);
|
1158
1173
|
}
|
1159
|
-
function
|
1174
|
+
function le(r) {
|
1160
1175
|
var p = r.prototype;
|
1161
1176
|
return !!(p && p.isReactComponent);
|
1162
1177
|
}
|
1163
|
-
function
|
1178
|
+
function C(r, p, b) {
|
1164
1179
|
if (r == null)
|
1165
1180
|
return "";
|
1166
1181
|
if (typeof r == "function")
|
1167
|
-
return
|
1182
|
+
return P(r, le(r));
|
1168
1183
|
if (typeof r == "string")
|
1169
1184
|
return ue(r);
|
1170
1185
|
switch (r) {
|
1171
|
-
case
|
1186
|
+
case h:
|
1172
1187
|
return ue("Suspense");
|
1173
1188
|
case f:
|
1174
1189
|
return ue("SuspenseList");
|
1175
1190
|
}
|
1176
1191
|
if (typeof r == "object")
|
1177
1192
|
switch (r.$$typeof) {
|
1178
|
-
case
|
1193
|
+
case d:
|
1179
1194
|
return ge(r.render);
|
1180
1195
|
case m:
|
1181
|
-
return
|
1196
|
+
return C(r.type, p, b);
|
1182
1197
|
case x: {
|
1183
|
-
var
|
1198
|
+
var S = r, L = S._payload, U = S._init;
|
1184
1199
|
try {
|
1185
|
-
return
|
1200
|
+
return C(U(L), p, b);
|
1186
1201
|
} catch {
|
1187
1202
|
}
|
1188
1203
|
}
|
1189
1204
|
}
|
1190
1205
|
return "";
|
1191
1206
|
}
|
1192
|
-
var
|
1193
|
-
function
|
1207
|
+
var E = Object.prototype.hasOwnProperty, F = {}, J = re.ReactDebugCurrentFrame;
|
1208
|
+
function O(r) {
|
1194
1209
|
if (r) {
|
1195
|
-
var p = r._owner, b =
|
1196
|
-
|
1210
|
+
var p = r._owner, b = C(r.type, r._source, p ? p.type : null);
|
1211
|
+
J.setExtraStackFrame(b);
|
1197
1212
|
} else
|
1198
|
-
|
1213
|
+
J.setExtraStackFrame(null);
|
1199
1214
|
}
|
1200
|
-
function B(r, p, b,
|
1215
|
+
function B(r, p, b, S, L) {
|
1201
1216
|
{
|
1202
|
-
var U = Function.call.bind(
|
1203
|
-
for (var
|
1204
|
-
if (U(r,
|
1217
|
+
var U = Function.call.bind(E);
|
1218
|
+
for (var k in r)
|
1219
|
+
if (U(r, k)) {
|
1205
1220
|
var R = void 0;
|
1206
1221
|
try {
|
1207
|
-
if (typeof r[
|
1208
|
-
var he = Error((
|
1222
|
+
if (typeof r[k] != "function") {
|
1223
|
+
var he = Error((S || "React class") + ": " + b + " type `" + k + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof r[k] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
1209
1224
|
throw he.name = "Invariant Violation", he;
|
1210
1225
|
}
|
1211
|
-
R = r[
|
1212
|
-
} catch (
|
1213
|
-
R =
|
1226
|
+
R = r[k](p, k, S, b, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
1227
|
+
} catch (K) {
|
1228
|
+
R = K;
|
1214
1229
|
}
|
1215
|
-
R && !(R instanceof Error) && (
|
1230
|
+
R && !(R instanceof Error) && (O(L), $("%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, k, typeof R), O(null)), R instanceof Error && !(R.message in F) && (F[R.message] = !0, O(L), $("Failed %s type: %s", b, R.message), O(null));
|
1216
1231
|
}
|
1217
1232
|
}
|
1218
1233
|
}
|
1219
|
-
var
|
1220
|
-
function
|
1221
|
-
return
|
1234
|
+
var G = Array.isArray;
|
1235
|
+
function Ne(r) {
|
1236
|
+
return G(r);
|
1222
1237
|
}
|
1223
1238
|
function Je(r) {
|
1224
1239
|
{
|
@@ -1247,8 +1262,8 @@ function Fa() {
|
|
1247
1262
|
__source: !0
|
1248
1263
|
}, ct, gt, Qe;
|
1249
1264
|
Qe = {};
|
1250
|
-
function
|
1251
|
-
if (
|
1265
|
+
function _t(r) {
|
1266
|
+
if (E.call(r, "ref")) {
|
1252
1267
|
var p = Object.getOwnPropertyDescriptor(r, "ref").get;
|
1253
1268
|
if (p && p.isReactWarning)
|
1254
1269
|
return !1;
|
@@ -1256,17 +1271,17 @@ function Fa() {
|
|
1256
1271
|
return r.ref !== void 0;
|
1257
1272
|
}
|
1258
1273
|
function Rt(r) {
|
1259
|
-
if (
|
1274
|
+
if (E.call(r, "key")) {
|
1260
1275
|
var p = Object.getOwnPropertyDescriptor(r, "key").get;
|
1261
1276
|
if (p && p.isReactWarning)
|
1262
1277
|
return !1;
|
1263
1278
|
}
|
1264
1279
|
return r.key !== void 0;
|
1265
1280
|
}
|
1266
|
-
function
|
1281
|
+
function Pt(r, p) {
|
1267
1282
|
if (typeof r.ref == "string" && Ue.current && p && Ue.current.stateNode !== p) {
|
1268
|
-
var b =
|
1269
|
-
Qe[b] || ($('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',
|
1283
|
+
var b = N(Ue.current.type);
|
1284
|
+
Qe[b] || ($('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);
|
1270
1285
|
}
|
1271
1286
|
}
|
1272
1287
|
function vt(r, p) {
|
@@ -1291,7 +1306,7 @@ function Fa() {
|
|
1291
1306
|
});
|
1292
1307
|
}
|
1293
1308
|
}
|
1294
|
-
var
|
1309
|
+
var zt = function(r, p, b, S, L, U, k) {
|
1295
1310
|
var R = {
|
1296
1311
|
// This tag allows us to uniquely identify this as a React Element
|
1297
1312
|
$$typeof: n,
|
@@ -1299,7 +1314,7 @@ function Fa() {
|
|
1299
1314
|
type: r,
|
1300
1315
|
key: p,
|
1301
1316
|
ref: b,
|
1302
|
-
props:
|
1317
|
+
props: k,
|
1303
1318
|
// Record the component responsible for creating this element.
|
1304
1319
|
_owner: U
|
1305
1320
|
};
|
@@ -1312,39 +1327,39 @@ function Fa() {
|
|
1312
1327
|
configurable: !1,
|
1313
1328
|
enumerable: !1,
|
1314
1329
|
writable: !1,
|
1315
|
-
value:
|
1330
|
+
value: S
|
1316
1331
|
}), Object.defineProperty(R, "_source", {
|
1317
1332
|
configurable: !1,
|
1318
1333
|
enumerable: !1,
|
1319
1334
|
writable: !1,
|
1320
|
-
value:
|
1335
|
+
value: L
|
1321
1336
|
}), Object.freeze && (Object.freeze(R.props), Object.freeze(R)), R;
|
1322
1337
|
};
|
1323
|
-
function s(r, p, b,
|
1338
|
+
function s(r, p, b, S, L) {
|
1324
1339
|
{
|
1325
|
-
var U,
|
1326
|
-
b !== void 0 && (st(b), R = "" + b), Rt(p) && (st(p.key), R = "" + p.key),
|
1340
|
+
var U, k = {}, R = null, he = null;
|
1341
|
+
b !== void 0 && (st(b), R = "" + b), Rt(p) && (st(p.key), R = "" + p.key), _t(p) && (he = p.ref, Pt(p, L));
|
1327
1342
|
for (U in p)
|
1328
|
-
|
1343
|
+
E.call(p, U) && !ot.hasOwnProperty(U) && (k[U] = p[U]);
|
1329
1344
|
if (r && r.defaultProps) {
|
1330
|
-
var
|
1331
|
-
for (U in
|
1332
|
-
|
1345
|
+
var K = r.defaultProps;
|
1346
|
+
for (U in K)
|
1347
|
+
k[U] === void 0 && (k[U] = K[U]);
|
1333
1348
|
}
|
1334
1349
|
if (R || he) {
|
1335
|
-
var
|
1336
|
-
R && vt(
|
1350
|
+
var Q = typeof r == "function" ? r.displayName || r.name || "Unknown" : r;
|
1351
|
+
R && vt(k, Q), he && $e(k, Q);
|
1337
1352
|
}
|
1338
|
-
return
|
1353
|
+
return zt(r, R, he, L, S, Ue.current, k);
|
1339
1354
|
}
|
1340
1355
|
}
|
1341
|
-
var y = re.ReactCurrentOwner,
|
1342
|
-
function
|
1356
|
+
var y = re.ReactCurrentOwner, _ = re.ReactDebugCurrentFrame;
|
1357
|
+
function D(r) {
|
1343
1358
|
if (r) {
|
1344
|
-
var p = r._owner, b =
|
1345
|
-
|
1359
|
+
var p = r._owner, b = C(r.type, r._source, p ? p.type : null);
|
1360
|
+
_.setExtraStackFrame(b);
|
1346
1361
|
} else
|
1347
|
-
|
1362
|
+
_.setExtraStackFrame(null);
|
1348
1363
|
}
|
1349
1364
|
var ee;
|
1350
1365
|
ee = !1;
|
@@ -1354,7 +1369,7 @@ function Fa() {
|
|
1354
1369
|
function de() {
|
1355
1370
|
{
|
1356
1371
|
if (y.current) {
|
1357
|
-
var r =
|
1372
|
+
var r = N(y.current.type);
|
1358
1373
|
if (r)
|
1359
1374
|
return `
|
1360
1375
|
|
@@ -1363,7 +1378,7 @@ Check the render method of \`` + r + "`.";
|
|
1363
1378
|
return "";
|
1364
1379
|
}
|
1365
1380
|
}
|
1366
|
-
function
|
1381
|
+
function Gt(r) {
|
1367
1382
|
{
|
1368
1383
|
if (r !== void 0) {
|
1369
1384
|
var p = r.fileName.replace(/^.*[\\\/]/, ""), b = r.lineNumber;
|
@@ -1396,30 +1411,30 @@ Check the top-level render call using <` + b + ">.");
|
|
1396
1411
|
if (bt[b])
|
1397
1412
|
return;
|
1398
1413
|
bt[b] = !0;
|
1399
|
-
var
|
1400
|
-
r && r._owner && r._owner !== y.current && (
|
1414
|
+
var S = "";
|
1415
|
+
r && r._owner && r._owner !== y.current && (S = " It was passed a child from " + N(r._owner.type) + "."), D(r), $('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), D(null);
|
1401
1416
|
}
|
1402
1417
|
}
|
1403
1418
|
function Ee(r, p) {
|
1404
1419
|
{
|
1405
1420
|
if (typeof r != "object")
|
1406
1421
|
return;
|
1407
|
-
if (
|
1422
|
+
if (Ne(r))
|
1408
1423
|
for (var b = 0; b < r.length; b++) {
|
1409
|
-
var
|
1410
|
-
ye(
|
1424
|
+
var S = r[b];
|
1425
|
+
ye(S) && xe(S, p);
|
1411
1426
|
}
|
1412
1427
|
else if (ye(r))
|
1413
1428
|
r._store && (r._store.validated = !0);
|
1414
1429
|
else if (r) {
|
1415
|
-
var
|
1416
|
-
if (typeof
|
1417
|
-
for (var U =
|
1418
|
-
ye(
|
1430
|
+
var L = me(r);
|
1431
|
+
if (typeof L == "function" && L !== r.entries)
|
1432
|
+
for (var U = L.call(r), k; !(k = U.next()).done; )
|
1433
|
+
ye(k.value) && xe(k.value, p);
|
1419
1434
|
}
|
1420
1435
|
}
|
1421
1436
|
}
|
1422
|
-
function
|
1437
|
+
function Ve(r) {
|
1423
1438
|
{
|
1424
1439
|
var p = r.type;
|
1425
1440
|
if (p == null || typeof p == "string")
|
@@ -1427,19 +1442,19 @@ Check the top-level render call using <` + b + ">.");
|
|
1427
1442
|
var b;
|
1428
1443
|
if (typeof p == "function")
|
1429
1444
|
b = p.propTypes;
|
1430
|
-
else if (typeof p == "object" && (p.$$typeof ===
|
1445
|
+
else if (typeof p == "object" && (p.$$typeof === d || // Note: Memo only checks outer props here.
|
1431
1446
|
// Inner props are checked in the reconciler.
|
1432
1447
|
p.$$typeof === m))
|
1433
1448
|
b = p.propTypes;
|
1434
1449
|
else
|
1435
1450
|
return;
|
1436
1451
|
if (b) {
|
1437
|
-
var
|
1438
|
-
B(b, r.props, "prop",
|
1452
|
+
var S = N(p);
|
1453
|
+
B(b, r.props, "prop", S, r);
|
1439
1454
|
} else if (p.PropTypes !== void 0 && !ee) {
|
1440
1455
|
ee = !0;
|
1441
|
-
var
|
1442
|
-
$("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",
|
1456
|
+
var L = N(p);
|
1457
|
+
$("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", L || "Unknown");
|
1443
1458
|
}
|
1444
1459
|
typeof p.getDefaultProps == "function" && !p.getDefaultProps.isReactClassApproved && $("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
1445
1460
|
}
|
@@ -1447,34 +1462,34 @@ Check the top-level render call using <` + b + ">.");
|
|
1447
1462
|
function Oe(r) {
|
1448
1463
|
{
|
1449
1464
|
for (var p = Object.keys(r.props), b = 0; b < p.length; b++) {
|
1450
|
-
var
|
1451
|
-
if (
|
1452
|
-
|
1465
|
+
var S = p[b];
|
1466
|
+
if (S !== "children" && S !== "key") {
|
1467
|
+
D(r), $("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", S), D(null);
|
1453
1468
|
break;
|
1454
1469
|
}
|
1455
1470
|
}
|
1456
|
-
r.ref !== null && (
|
1471
|
+
r.ref !== null && (D(r), $("Invalid attribute `ref` supplied to `React.Fragment`."), D(null));
|
1457
1472
|
}
|
1458
1473
|
}
|
1459
|
-
function
|
1474
|
+
function ze(r, p, b, S, L, U) {
|
1460
1475
|
{
|
1461
|
-
var
|
1462
|
-
if (!
|
1476
|
+
var k = Te(r);
|
1477
|
+
if (!k) {
|
1463
1478
|
var R = "";
|
1464
1479
|
(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.");
|
1465
|
-
var he =
|
1480
|
+
var he = Gt(L);
|
1466
1481
|
he ? R += he : R += de();
|
1467
|
-
var
|
1468
|
-
r === null ?
|
1482
|
+
var K;
|
1483
|
+
r === null ? K = "null" : Ne(r) ? K = "array" : r !== void 0 && r.$$typeof === n ? (K = "<" + (N(r.type) || "Unknown") + " />", R = " Did you accidentally export a JSX literal instead of a component?") : K = typeof r, $("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", K, R);
|
1469
1484
|
}
|
1470
|
-
var
|
1471
|
-
if (
|
1472
|
-
return
|
1473
|
-
if (
|
1485
|
+
var Q = s(r, p, b, L, U);
|
1486
|
+
if (Q == null)
|
1487
|
+
return Q;
|
1488
|
+
if (k) {
|
1474
1489
|
var Ce = p.children;
|
1475
1490
|
if (Ce !== void 0)
|
1476
|
-
if (
|
1477
|
-
if (
|
1491
|
+
if (S)
|
1492
|
+
if (Ne(Ce)) {
|
1478
1493
|
for (var tt = 0; tt < Ce.length; tt++)
|
1479
1494
|
Ee(Ce[tt], r);
|
1480
1495
|
Object.freeze && Object.freeze(Ce);
|
@@ -1483,29 +1498,29 @@ Check the top-level render call using <` + b + ">.");
|
|
1483
1498
|
else
|
1484
1499
|
Ee(Ce, r);
|
1485
1500
|
}
|
1486
|
-
return r === t ? Oe(
|
1501
|
+
return r === t ? Oe(Q) : Ve(Q), Q;
|
1487
1502
|
}
|
1488
1503
|
}
|
1489
1504
|
function et(r, p, b) {
|
1490
|
-
return
|
1505
|
+
return ze(r, p, b, !0);
|
1491
1506
|
}
|
1492
1507
|
function xt(r, p, b) {
|
1493
|
-
return
|
1508
|
+
return ze(r, p, b, !1);
|
1494
1509
|
}
|
1495
|
-
var
|
1496
|
-
ut.Fragment = t, ut.jsx =
|
1510
|
+
var zn = xt, Gn = et;
|
1511
|
+
ut.Fragment = t, ut.jsx = zn, ut.jsxs = Gn;
|
1497
1512
|
}()), ut;
|
1498
1513
|
}
|
1499
|
-
process.env.NODE_ENV === "production" ? It.exports =
|
1514
|
+
process.env.NODE_ENV === "production" ? It.exports = Ba() : It.exports = Fa();
|
1500
1515
|
var l = It.exports;
|
1501
|
-
function
|
1516
|
+
function Bn(e) {
|
1502
1517
|
return e.title.search("<") > -1 ? /* @__PURE__ */ l.jsx("button", { className: "svg", dangerouslySetInnerHTML: { __html: e.title } }) : /* @__PURE__ */ l.jsx("button", { children: e.title });
|
1503
1518
|
}
|
1504
|
-
const
|
1519
|
+
const Ua = /* @__PURE__ */ l.jsxs("svg", { className: "closeIcon", width: "14", height: "14", fill: "none", stroke: "#666666", strokeMiterlimit: "10", children: [
|
1505
1520
|
/* @__PURE__ */ l.jsx("circle", { cx: "7", cy: "7", r: "6" }),
|
1506
1521
|
/* @__PURE__ */ l.jsx("line", { x1: "4", y1: "4", x2: "10", y2: "10" }),
|
1507
1522
|
/* @__PURE__ */ l.jsx("line", { x1: "4", y1: "10", x2: "10", y2: "4" })
|
1508
|
-
] }),
|
1523
|
+
] }), $a = /* @__PURE__ */ l.jsx("svg", { className: "dragIcon", width: "14", height: "14", fill: "#666666", stroke: "none", children: /* @__PURE__ */ l.jsx(
|
1509
1524
|
"path",
|
1510
1525
|
{
|
1511
1526
|
d: `M10.43,4H3.57C3.26,4,3,4.22,3,4.5v1C3,5.78,3.26,6,3.57,6h6.86C10.74,6,11,5.78,11,5.5v-1
|
@@ -1513,35 +1528,35 @@ C11,4.22,10.74,4,10.43,4z M10.43,8H3.57C3.26,8,3,8.22,3,8.5v1C3,9.78,3.26,10,3.5
|
|
1513
1528
|
C11,8.22,10.74,8,10.43,8z`
|
1514
1529
|
}
|
1515
1530
|
) });
|
1516
|
-
function
|
1517
|
-
return /* @__PURE__ */ l.jsx(
|
1518
|
-
|
1531
|
+
function za(e) {
|
1532
|
+
return /* @__PURE__ */ l.jsx(Dn.Item, { value: e.title, children: /* @__PURE__ */ l.jsxs("div", { children: [
|
1533
|
+
$a,
|
1519
1534
|
/* @__PURE__ */ l.jsx("span", { children: e.title }),
|
1520
1535
|
/* @__PURE__ */ l.jsx("button", { className: "closeIcon", onClick: () => {
|
1521
1536
|
e.onDelete(e.index);
|
1522
|
-
}, children:
|
1537
|
+
}, children: Ua })
|
1523
1538
|
] }) }, e.title);
|
1524
1539
|
}
|
1525
|
-
function
|
1526
|
-
const [n, a] =
|
1527
|
-
e.onDragComplete(
|
1528
|
-
}, u = (
|
1540
|
+
function Ga(e) {
|
1541
|
+
const [n, a] = Z(!1), [t, i] = Z(e.options), c = (h) => {
|
1542
|
+
e.onDragComplete(h), i(h);
|
1543
|
+
}, u = (h) => {
|
1529
1544
|
const f = [...t];
|
1530
|
-
f.splice(
|
1531
|
-
},
|
1532
|
-
t.forEach((
|
1533
|
-
|
1545
|
+
f.splice(h, 1), c(f);
|
1546
|
+
}, o = [];
|
1547
|
+
t.forEach((h, f) => {
|
1548
|
+
o.push(/* @__PURE__ */ l.jsx(za, { index: f, title: h, onDelete: u }, h));
|
1534
1549
|
});
|
1535
|
-
let
|
1536
|
-
return e.subdropdown && (
|
1537
|
-
/* @__PURE__ */ l.jsx(
|
1538
|
-
/* @__PURE__ */ l.jsx(
|
1550
|
+
let d = "dropdown draggable";
|
1551
|
+
return e.subdropdown && (d += " subdropdown"), /* @__PURE__ */ l.jsxs("div", { className: d, onMouseEnter: () => a(!0), onMouseLeave: () => a(!1), children: [
|
1552
|
+
/* @__PURE__ */ l.jsx(Bn, { title: e.title }),
|
1553
|
+
/* @__PURE__ */ l.jsx(Dn.Group, { axis: "y", values: t, onReorder: c, style: { visibility: n ? "visible" : "hidden" }, children: o })
|
1539
1554
|
] });
|
1540
1555
|
}
|
1541
|
-
function
|
1542
|
-
const [n, a] =
|
1543
|
-
e.options.map((
|
1544
|
-
e.onSelect !== void 0 && (
|
1556
|
+
function Wa(e) {
|
1557
|
+
const [n, a] = Z(!1), t = [];
|
1558
|
+
e.options.map((c, u) => {
|
1559
|
+
e.onSelect !== void 0 && (c.onSelect = e.onSelect), t.push(/* @__PURE__ */ l.jsx(Ha, { option: c }, u));
|
1545
1560
|
});
|
1546
1561
|
let i = "dropdown";
|
1547
1562
|
return e.subdropdown && (i += " subdropdown"), /* @__PURE__ */ l.jsxs(
|
@@ -1551,7 +1566,7 @@ function za(e) {
|
|
1551
1566
|
onMouseEnter: () => a(!0),
|
1552
1567
|
onMouseLeave: () => a(!1),
|
1553
1568
|
children: [
|
1554
|
-
/* @__PURE__ */ l.jsx(
|
1569
|
+
/* @__PURE__ */ l.jsx(Bn, { title: e.title }),
|
1555
1570
|
/* @__PURE__ */ l.jsx(
|
1556
1571
|
"ul",
|
1557
1572
|
{
|
@@ -1564,17 +1579,17 @@ function za(e) {
|
|
1564
1579
|
);
|
1565
1580
|
}
|
1566
1581
|
function Ha(e) {
|
1567
|
-
const { option: n } = e, [a, t] =
|
1582
|
+
const { option: n } = e, [a, t] = Z("");
|
1568
1583
|
let i;
|
1569
1584
|
switch (n.type) {
|
1570
1585
|
case "draggable":
|
1571
1586
|
i = /* @__PURE__ */ l.jsx(
|
1572
|
-
|
1587
|
+
Ga,
|
1573
1588
|
{
|
1574
1589
|
title: n.title,
|
1575
1590
|
options: n.value,
|
1576
|
-
onDragComplete: (
|
1577
|
-
n.onDragComplete !== void 0 && n.onDragComplete(
|
1591
|
+
onDragComplete: (c) => {
|
1592
|
+
n.onDragComplete !== void 0 && n.onDragComplete(c);
|
1578
1593
|
},
|
1579
1594
|
subdropdown: !0
|
1580
1595
|
}
|
@@ -1582,7 +1597,7 @@ function Ha(e) {
|
|
1582
1597
|
break;
|
1583
1598
|
case "dropdown":
|
1584
1599
|
i = /* @__PURE__ */ l.jsx(
|
1585
|
-
|
1600
|
+
Wa,
|
1586
1601
|
{
|
1587
1602
|
title: n.title,
|
1588
1603
|
options: n.value,
|
@@ -1605,31 +1620,31 @@ function Ha(e) {
|
|
1605
1620
|
}
|
1606
1621
|
return /* @__PURE__ */ l.jsx("li", { className: a === n.title ? "selected" : "", children: i }, _a());
|
1607
1622
|
}
|
1608
|
-
function
|
1609
|
-
function t(
|
1623
|
+
function Bi(e, n, a) {
|
1624
|
+
function t(c) {
|
1610
1625
|
switch (n.forEach((u) => {
|
1611
|
-
u.callback(e, u.remote,
|
1612
|
-
}),
|
1626
|
+
u.callback(e, u.remote, c);
|
1627
|
+
}), c.event) {
|
1613
1628
|
case "custom":
|
1614
|
-
|
1629
|
+
j.dispatchEvent({ type: A.CUSTOM, value: c.data });
|
1615
1630
|
break;
|
1616
1631
|
}
|
1617
1632
|
}
|
1618
|
-
function i(
|
1633
|
+
function i(c) {
|
1619
1634
|
switch (a.forEach((u) => {
|
1620
|
-
u.callback(e, u.remote,
|
1621
|
-
}),
|
1635
|
+
u.callback(e, u.remote, c);
|
1636
|
+
}), c.event) {
|
1622
1637
|
case "custom":
|
1623
|
-
|
1638
|
+
j.dispatchEvent({ type: A.CUSTOM, value: c.data });
|
1624
1639
|
break;
|
1625
1640
|
}
|
1626
1641
|
}
|
1627
|
-
e.listen = (
|
1628
|
-
|
1642
|
+
e.listen = (c) => {
|
1643
|
+
c.target === "editor" ? i(c) : t(c);
|
1629
1644
|
};
|
1630
1645
|
}
|
1631
|
-
function
|
1632
|
-
const [n, a] =
|
1646
|
+
function $t(e) {
|
1647
|
+
const [n, a] = Z(e.open !== void 0 ? e.open : !0), t = !n || e.children === void 0;
|
1633
1648
|
return /* @__PURE__ */ l.jsxs("div", { className: `accordion ${t ? "hide" : ""}`, children: [
|
1634
1649
|
/* @__PURE__ */ l.jsxs(
|
1635
1650
|
"button",
|
@@ -1655,10 +1670,10 @@ function Ut(e) {
|
|
1655
1670
|
/* @__PURE__ */ l.jsx("div", { className: n ? "open" : "", children: /* @__PURE__ */ l.jsx("div", { children: e.children }) })
|
1656
1671
|
] });
|
1657
1672
|
}
|
1658
|
-
function
|
1659
|
-
const [n, a] =
|
1660
|
-
return e.child !== void 0 && e.child.children.length > 0 && e.child.children.map((
|
1661
|
-
i.push(/* @__PURE__ */ l.jsx(
|
1673
|
+
function Fn(e) {
|
1674
|
+
const [n, a] = Z(!1), t = e.child !== void 0 && e.child.children.length > 0, i = [];
|
1675
|
+
return e.child !== void 0 && e.child.children.length > 0 && e.child.children.map((c) => {
|
1676
|
+
i.push(/* @__PURE__ */ l.jsx(Fn, { child: c, three: e.three }, Math.random()));
|
1662
1677
|
}), /* @__PURE__ */ l.jsx(l.Fragment, { children: e.child !== void 0 && /* @__PURE__ */ l.jsxs("div", { className: "childObject", children: [
|
1663
1678
|
/* @__PURE__ */ l.jsxs("div", { className: "child", children: [
|
1664
1679
|
t ? /* @__PURE__ */ l.jsx(
|
@@ -1686,7 +1701,7 @@ function Bn(e) {
|
|
1686
1701
|
children: e.child.name.length > 0 ? `${e.child.name} (${e.child.type})` : `${e.child.type}::${e.child.uuid}`
|
1687
1702
|
}
|
1688
1703
|
),
|
1689
|
-
/* @__PURE__ */ l.jsx("div", { className: `icon ${
|
1704
|
+
/* @__PURE__ */ l.jsx("div", { className: `icon ${Aa(e.child)}` })
|
1690
1705
|
] }),
|
1691
1706
|
/* @__PURE__ */ l.jsx("div", { className: n ? "open" : "", children: /* @__PURE__ */ l.jsx("div", { className: "container", children: i }) })
|
1692
1707
|
] }, Math.random()) });
|
@@ -1694,18 +1709,18 @@ function Bn(e) {
|
|
1694
1709
|
function Ya(e) {
|
1695
1710
|
const n = [];
|
1696
1711
|
return e.child?.children.map((a) => {
|
1697
|
-
n.push(/* @__PURE__ */ l.jsx(
|
1712
|
+
n.push(/* @__PURE__ */ l.jsx(Fn, { child: a, three: e.three }, Math.random()));
|
1698
1713
|
}), /* @__PURE__ */ l.jsx("div", { className: `scene ${e.class !== void 0 ? e.class : ""}`, children: n });
|
1699
1714
|
}
|
1700
|
-
const
|
1701
|
-
function
|
1715
|
+
const Va = "data:image/gif;base64,R0lGODlhDgFkAIAAAP///wAAACH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgOS4xLWMwMDIgNzkuZGJhM2RhM2I1LCAyMDIzLzEyLzE1LTEwOjQyOjM3ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgMjUuNiAoTWFjaW50b3NoKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoyMDk3M0NEODAxQjQxMUVGODVGNENDMkUyMUExNDk1NSIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoyMDk3M0NEOTAxQjQxMUVGODVGNENDMkUyMUExNDk1NSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkE4ODc3Qzg5MDFCMzExRUY4NUY0Q0MyRTIxQTE0OTU1IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkE4ODc3QzhBMDFCMzExRUY4NUY0Q0MyRTIxQTE0OTU1Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+Af/+/fz7+vn49/b19PPy8fDv7u3s6+rp6Ofm5eTj4uHg397d3Nva2djX1tXU09LR0M/OzczLysnIx8bFxMPCwcC/vr28u7q5uLe2tbSzsrGwr66trKuqqainpqWko6KhoJ+enZybmpmYl5aVlJOSkZCPjo2Mi4qJiIeGhYSDgoGAf359fHt6eXh3dnV0c3JxcG9ubWxramloZ2ZlZGNiYWBfXl1cW1pZWFdWVVRTUlFQT05NTEtKSUhHRkVEQ0JBQD8+PTw7Ojk4NzY1NDMyMTAvLi0sKyopKCcmJSQjIiEgHx4dHBsaGRgXFhUUExIREA8ODQwLCgkIBwYFBAMCAQAAIfkEAAAAAAAsAAAAAA4BZAAAAv+Mj6nL7Q+jnLTai7PevPsPhuJIluaJpurKtu4Lx/JM1/aN5/rO9/4PDAqHxKLxiEwql8ym8wmNSqfUqvWKzWq33K73Cw6Lx+Sy+YxOq9fstvsNj8vn9Lr9js/r9/y+/w8YKDhIWGh4iJiouMjY6PgIGSk5SVlpeYmZqTkJAGDQ+dnpuekmGgAKejpKuiZqmprKqoZKGyrbOlqrejub6xvLGyw8TFzcprurGuvqybxq7ETbrItsCz0l7Zpc+6p9/cS967w9/S2FTF0u/mzehK4Oqz3eTl9vf4+fr7/P3+//DzCgwIEECxo8iDChwoUMGzp8CDGixIkUK1q8iDGjxo0XHDt6/AgypMiRJEuaPIkypcqVLFt+KwAAOw==";
|
1716
|
+
function qa(e) {
|
1702
1717
|
return "items" in e;
|
1703
1718
|
}
|
1704
|
-
function
|
1719
|
+
function Xe(e) {
|
1705
1720
|
const n = [];
|
1706
1721
|
return e.items.forEach((a) => {
|
1707
|
-
|
1708
|
-
/* @__PURE__ */ l.jsx(
|
1722
|
+
qa(a) ? n.push(
|
1723
|
+
/* @__PURE__ */ l.jsx(Xe, { title: Mt(a.title), items: a.items }, Math.random())
|
1709
1724
|
) : n.push(
|
1710
1725
|
/* @__PURE__ */ l.jsx(
|
1711
1726
|
ft,
|
@@ -1721,17 +1736,20 @@ function Ze(e) {
|
|
1721
1736
|
options: a.options,
|
1722
1737
|
onChange: (t, i) => {
|
1723
1738
|
a.onChange !== void 0 && a.onChange(t, i);
|
1739
|
+
},
|
1740
|
+
onKeyDown: (t) => {
|
1741
|
+
a.onKeyDown !== void 0 && a.onKeyDown(t);
|
1724
1742
|
}
|
1725
1743
|
},
|
1726
1744
|
Math.random()
|
1727
1745
|
)
|
1728
1746
|
);
|
1729
|
-
}), /* @__PURE__ */ l.jsx(
|
1747
|
+
}), /* @__PURE__ */ l.jsx($t, { label: e.title, open: e.expanded === !0, children: n });
|
1730
1748
|
}
|
1731
|
-
function
|
1749
|
+
function Ka(e) {
|
1732
1750
|
return !(e === "alphaHash" || e === "alphaToCoverage" || e === "attenuationDistance" || e === "blendAlpha" || e === "blendColor" || e === "blendDstAlpha" || e === "colorWrite" || e === "combine" || e === "defaultAttributeValues" || e === "depthFunc" || e === "forceSinglePass" || e === "glslVersion" || e === "linecap" || e === "linejoin" || e === "linewidth" || e === "normalMapType" || e === "precision" || e === "premultipliedAlpha" || e === "shadowSide" || e === "toneMapped" || e === "uniformsGroups" || e === "uniformsNeedUpdate" || e === "userData" || e === "vertexColors" || e === "version" || e === "wireframeLinecap" || e === "wireframeLinejoin" || e === "wireframeLinewidth" || e.slice(0, 4) === "clip" || e.slice(0, 7) === "polygon" || e.slice(0, 7) === "stencil" || e.slice(0, 2) === "is");
|
1733
1751
|
}
|
1734
|
-
function
|
1752
|
+
function Za(e) {
|
1735
1753
|
switch (e) {
|
1736
1754
|
case "Alpha Map":
|
1737
1755
|
return "alphaMap";
|
@@ -1778,7 +1796,7 @@ function Ka(e) {
|
|
1778
1796
|
}
|
1779
1797
|
return e;
|
1780
1798
|
}
|
1781
|
-
function
|
1799
|
+
function Tt(e) {
|
1782
1800
|
switch (e) {
|
1783
1801
|
case "alphaMap":
|
1784
1802
|
return "Alpha Map";
|
@@ -1963,42 +1981,42 @@ function Xa() {
|
|
1963
1981
|
a();
|
1964
1982
|
else {
|
1965
1983
|
const t = e.files[0], i = new FileReader();
|
1966
|
-
i.onload = function(
|
1967
|
-
n(
|
1984
|
+
i.onload = function(c) {
|
1985
|
+
n(c.target.result);
|
1968
1986
|
}, i.readAsDataURL(t);
|
1969
1987
|
}
|
1970
1988
|
}), e.click();
|
1971
1989
|
});
|
1972
1990
|
}
|
1973
|
-
const
|
1991
|
+
const Ja = [
|
1974
1992
|
{
|
1975
1993
|
title: "Front",
|
1976
1994
|
value: Yn
|
1977
1995
|
},
|
1978
1996
|
{
|
1979
1997
|
title: "Back",
|
1980
|
-
value:
|
1998
|
+
value: mn
|
1981
1999
|
},
|
1982
2000
|
{
|
1983
2001
|
title: "Double",
|
1984
|
-
value:
|
2002
|
+
value: pn
|
1985
2003
|
}
|
1986
|
-
],
|
2004
|
+
], Qa = [
|
1987
2005
|
{
|
1988
2006
|
title: "No Blending",
|
1989
|
-
value:
|
2007
|
+
value: Vn
|
1990
2008
|
},
|
1991
2009
|
{
|
1992
2010
|
title: "Normal",
|
1993
|
-
value:
|
2011
|
+
value: qn
|
1994
2012
|
},
|
1995
2013
|
{
|
1996
2014
|
title: "Additive",
|
1997
|
-
value:
|
2015
|
+
value: Kn
|
1998
2016
|
},
|
1999
2017
|
{
|
2000
2018
|
title: "Subtractive",
|
2001
|
-
value:
|
2019
|
+
value: Zn
|
2002
2020
|
},
|
2003
2021
|
{
|
2004
2022
|
title: "Multiply",
|
@@ -2006,81 +2024,81 @@ const Za = [
|
|
2006
2024
|
},
|
2007
2025
|
{
|
2008
2026
|
title: "Custom",
|
2009
|
-
value:
|
2027
|
+
value: Jn
|
2010
2028
|
}
|
2011
|
-
],
|
2029
|
+
], ei = [
|
2012
2030
|
{
|
2013
2031
|
title: "Add",
|
2014
|
-
value:
|
2032
|
+
value: Qn
|
2015
2033
|
},
|
2016
2034
|
{
|
2017
2035
|
title: "Subtract",
|
2018
|
-
value:
|
2036
|
+
value: ea
|
2019
2037
|
},
|
2020
2038
|
{
|
2021
2039
|
title: "Reverse Subtract",
|
2022
|
-
value:
|
2040
|
+
value: ta
|
2023
2041
|
},
|
2024
2042
|
{
|
2025
2043
|
title: "Min",
|
2026
|
-
value:
|
2044
|
+
value: na
|
2027
2045
|
},
|
2028
2046
|
{
|
2029
2047
|
title: "Max",
|
2030
|
-
value:
|
2048
|
+
value: aa
|
2031
2049
|
}
|
2032
|
-
],
|
2050
|
+
], ti = [
|
2033
2051
|
{
|
2034
2052
|
title: "Zero",
|
2035
|
-
valye:
|
2053
|
+
valye: gn
|
2036
2054
|
},
|
2037
2055
|
{
|
2038
2056
|
title: "One",
|
2039
|
-
valye:
|
2057
|
+
valye: vn
|
2040
2058
|
},
|
2041
2059
|
{
|
2042
2060
|
title: "Src Color",
|
2043
|
-
valye:
|
2061
|
+
valye: bn
|
2044
2062
|
},
|
2045
2063
|
{
|
2046
2064
|
title: "One Minus Src Color",
|
2047
|
-
valye:
|
2065
|
+
valye: yn
|
2048
2066
|
},
|
2049
2067
|
{
|
2050
2068
|
title: "Src Alpha",
|
2051
|
-
valye:
|
2069
|
+
valye: xn
|
2052
2070
|
},
|
2053
2071
|
{
|
2054
2072
|
title: "One Minus Src Alpha",
|
2055
|
-
valye:
|
2073
|
+
valye: En
|
2056
2074
|
},
|
2057
2075
|
{
|
2058
2076
|
title: "Dst Alpha",
|
2059
|
-
valye:
|
2077
|
+
valye: Cn
|
2060
2078
|
},
|
2061
2079
|
{
|
2062
2080
|
title: "One Minus Dst Alpha",
|
2063
|
-
valye:
|
2081
|
+
valye: Sn
|
2064
2082
|
},
|
2065
2083
|
{
|
2066
2084
|
title: "Dst Color",
|
2067
|
-
valye:
|
2085
|
+
valye: wn
|
2068
2086
|
},
|
2069
2087
|
{
|
2070
2088
|
title: "One Minus Dst Color",
|
2071
|
-
valye:
|
2089
|
+
valye: Mn
|
2072
2090
|
},
|
2073
2091
|
{
|
2074
2092
|
title: "Src Alpha Saturate",
|
2075
|
-
valye:
|
2093
|
+
valye: ia
|
2076
2094
|
},
|
2077
2095
|
{
|
2078
2096
|
title: "Constant Color",
|
2079
|
-
valye:
|
2097
|
+
valye: On
|
2080
2098
|
},
|
2081
2099
|
{
|
2082
2100
|
title: "One Minus Constant Color",
|
2083
|
-
valye:
|
2101
|
+
valye: Tn
|
2084
2102
|
},
|
2085
2103
|
{
|
2086
2104
|
title: "Constant Alpha",
|
@@ -2088,56 +2106,56 @@ const Za = [
|
|
2088
2106
|
},
|
2089
2107
|
{
|
2090
2108
|
title: "One Minus Constant Alpha",
|
2091
|
-
valye:
|
2109
|
+
valye: Rn
|
2092
2110
|
}
|
2093
|
-
],
|
2111
|
+
], ni = [
|
2094
2112
|
{
|
2095
2113
|
title: "Zero",
|
2096
|
-
valye:
|
2114
|
+
valye: gn
|
2097
2115
|
},
|
2098
2116
|
{
|
2099
2117
|
title: "One",
|
2100
|
-
valye:
|
2118
|
+
valye: vn
|
2101
2119
|
},
|
2102
2120
|
{
|
2103
2121
|
title: "Src Color",
|
2104
|
-
valye:
|
2122
|
+
valye: bn
|
2105
2123
|
},
|
2106
2124
|
{
|
2107
2125
|
title: "One Minus Src Color",
|
2108
|
-
valye:
|
2126
|
+
valye: yn
|
2109
2127
|
},
|
2110
2128
|
{
|
2111
2129
|
title: "Src Alpha",
|
2112
|
-
valye:
|
2130
|
+
valye: xn
|
2113
2131
|
},
|
2114
2132
|
{
|
2115
2133
|
title: "One Minus Src Alpha",
|
2116
|
-
valye:
|
2134
|
+
valye: En
|
2117
2135
|
},
|
2118
2136
|
{
|
2119
2137
|
title: "Dst Alpha",
|
2120
|
-
valye:
|
2138
|
+
valye: Cn
|
2121
2139
|
},
|
2122
2140
|
{
|
2123
2141
|
title: "One Minus Dst Alpha",
|
2124
|
-
valye:
|
2142
|
+
valye: Sn
|
2125
2143
|
},
|
2126
2144
|
{
|
2127
2145
|
title: "Dst Color",
|
2128
|
-
valye:
|
2146
|
+
valye: wn
|
2129
2147
|
},
|
2130
2148
|
{
|
2131
2149
|
title: "One Minus Dst Color",
|
2132
|
-
valye:
|
2150
|
+
valye: Mn
|
2133
2151
|
},
|
2134
2152
|
{
|
2135
2153
|
title: "Constant Color",
|
2136
|
-
valye:
|
2154
|
+
valye: On
|
2137
2155
|
},
|
2138
2156
|
{
|
2139
2157
|
title: "One Minus Constant Color",
|
2140
|
-
valye:
|
2158
|
+
valye: Tn
|
2141
2159
|
},
|
2142
2160
|
{
|
2143
2161
|
title: "Constant Alpha",
|
@@ -2145,203 +2163,213 @@ const Za = [
|
|
2145
2163
|
},
|
2146
2164
|
{
|
2147
2165
|
title: "One Minus Constant Alpha",
|
2148
|
-
valye:
|
2166
|
+
valye: Rn
|
2149
2167
|
}
|
2150
2168
|
];
|
2151
2169
|
function dt(e, n) {
|
2152
2170
|
e.needsUpdate = !0, e.type = "option", e.options = n;
|
2153
2171
|
}
|
2154
|
-
function
|
2172
|
+
function ai(e, n, a, t) {
|
2155
2173
|
return {
|
2156
2174
|
type: "boolean",
|
2157
|
-
title:
|
2175
|
+
title: Tt(e),
|
2158
2176
|
prop: e,
|
2159
2177
|
value: n,
|
2160
2178
|
needsUpdate: !0,
|
2161
|
-
onChange: (i,
|
2162
|
-
t.updateObject(a.uuid, `material.${e}`,
|
2179
|
+
onChange: (i, c) => {
|
2180
|
+
t.updateObject(a.uuid, `material.${e}`, c), t.updateObject(a.uuid, "material.needsUpdate", !0);
|
2163
2181
|
const u = t.scene?.getObjectByProperty("uuid", a.uuid);
|
2164
|
-
u !== void 0 &&
|
2182
|
+
u !== void 0 && V(u, `material.${e}`, c);
|
2165
2183
|
}
|
2166
2184
|
};
|
2167
2185
|
}
|
2168
|
-
function
|
2186
|
+
function ii(e, n, a, t) {
|
2169
2187
|
const i = {
|
2170
2188
|
type: "number",
|
2171
|
-
title:
|
2189
|
+
title: Tt(e),
|
2172
2190
|
prop: e,
|
2173
2191
|
value: n,
|
2174
2192
|
min: void 0,
|
2175
2193
|
max: void 0,
|
2176
2194
|
step: 0.01,
|
2177
2195
|
needsUpdate: !0,
|
2178
|
-
onChange: (
|
2196
|
+
onChange: (c, u) => {
|
2179
2197
|
t.updateObject(a.uuid, `material.${e}`, u), t.updateObject(a.uuid, "material.needsUpdate", !0);
|
2180
|
-
const
|
2181
|
-
|
2198
|
+
const o = t.scene?.getObjectByProperty("uuid", a.uuid);
|
2199
|
+
o !== void 0 && V(o, `material.${e}`, u);
|
2182
2200
|
}
|
2183
2201
|
};
|
2184
2202
|
switch (e) {
|
2185
2203
|
case "blending":
|
2186
|
-
dt(i,
|
2204
|
+
dt(i, Qa);
|
2187
2205
|
break;
|
2188
2206
|
case "blendDst":
|
2189
|
-
dt(i,
|
2207
|
+
dt(i, ni);
|
2190
2208
|
break;
|
2191
2209
|
case "blendEquation":
|
2192
|
-
dt(i,
|
2210
|
+
dt(i, ei);
|
2193
2211
|
break;
|
2194
2212
|
case "blendSrc":
|
2195
|
-
dt(i,
|
2213
|
+
dt(i, ti);
|
2196
2214
|
break;
|
2197
2215
|
case "side":
|
2198
|
-
dt(i,
|
2216
|
+
dt(i, Ja);
|
2199
2217
|
break;
|
2200
2218
|
}
|
2201
2219
|
return Un(e) && (i.value = Number(n), i.type = "range", i.min = Math.min(0, i.value), i.max = Math.max(1, i.value), i.step = 0.01), i;
|
2202
2220
|
}
|
2203
|
-
function
|
2221
|
+
function ri(e, n, a, t) {
|
2204
2222
|
const i = {
|
2205
2223
|
type: "string",
|
2206
|
-
title:
|
2224
|
+
title: Tt(e),
|
2207
2225
|
prop: e,
|
2208
2226
|
value: n,
|
2209
2227
|
needsUpdate: !0,
|
2210
|
-
onChange: (u,
|
2211
|
-
t.updateObject(a.uuid, `material.${e}`,
|
2212
|
-
const
|
2213
|
-
|
2228
|
+
onChange: (u, o) => {
|
2229
|
+
t.updateObject(a.uuid, `material.${e}`, o), t.updateObject(a.uuid, "material.needsUpdate", !0);
|
2230
|
+
const d = t.scene?.getObjectByProperty("uuid", a.uuid);
|
2231
|
+
d !== void 0 && V(d, `material.${e}`, o);
|
2232
|
+
},
|
2233
|
+
onKeyDown: (u) => {
|
2214
2234
|
}
|
2215
2235
|
};
|
2216
|
-
return (e === "vertexShader" || e === "fragmentShader") && (i.disabled = !1, i.latest = i.value, i.onChange = (u,
|
2217
|
-
i.latest =
|
2236
|
+
return (e === "vertexShader" || e === "fragmentShader") && (i.disabled = !1, i.latest = i.value, i.onChange = (u, o) => {
|
2237
|
+
i.latest = o, t.updateObject(a.uuid, `material.${e}`, o);
|
2238
|
+
const d = t.scene?.getObjectByProperty("uuid", a.uuid);
|
2239
|
+
d !== void 0 && V(d, `material.${e}`, o);
|
2240
|
+
}, i.onKeyDown = (u) => {
|
2241
|
+
if (u.key === "Enter" && (u.altKey || u.metaKey)) {
|
2242
|
+
t.updateObject(a.uuid, "material.needsUpdate", !0);
|
2243
|
+
const o = t.scene?.getObjectByProperty("uuid", a.uuid);
|
2244
|
+
o !== void 0 && V(o, "material.needsUpdate", !0);
|
2245
|
+
}
|
2218
2246
|
}), i;
|
2219
2247
|
}
|
2220
|
-
function
|
2248
|
+
function si(e) {
|
2221
2249
|
return e.x !== void 0 && e.y !== void 0 && e.z === void 0;
|
2222
2250
|
}
|
2223
|
-
function
|
2251
|
+
function oi(e) {
|
2224
2252
|
return e.x !== void 0 && e.y !== void 0 && e.z !== void 0 && e.w === void 0;
|
2225
2253
|
}
|
2226
|
-
function
|
2254
|
+
function ci(e) {
|
2227
2255
|
return e.x !== void 0 && e.y !== void 0 && e.z !== void 0 && e.w !== void 0;
|
2228
2256
|
}
|
2229
2257
|
function Nt(e) {
|
2230
2258
|
e.sort((n, a) => n.title < a.title ? -1 : n.title > a.title ? 1 : 0);
|
2231
2259
|
}
|
2232
|
-
function ht(e, n, a, t, i = "",
|
2233
|
-
const u =
|
2234
|
-
if (
|
2260
|
+
function ht(e, n, a, t, i = "", c = !1) {
|
2261
|
+
const u = Tt(e).split(".")[0].replaceAll("[", "").replaceAll("]", ""), o = i.length > 0 ? `${i}.${e}` : e, d = typeof n;
|
2262
|
+
if (d === "boolean" || d === "string")
|
2235
2263
|
return {
|
2236
2264
|
title: u,
|
2237
|
-
prop:
|
2238
|
-
type:
|
2265
|
+
prop: o,
|
2266
|
+
type: d,
|
2239
2267
|
value: n,
|
2240
|
-
disabled:
|
2241
|
-
onChange: (
|
2242
|
-
t.updateObject(a.uuid, `material.${
|
2268
|
+
disabled: c,
|
2269
|
+
onChange: (h, f) => {
|
2270
|
+
t.updateObject(a.uuid, `material.${o}`, f);
|
2243
2271
|
const m = t.scene?.getObjectByProperty("uuid", a.uuid);
|
2244
|
-
m !== void 0 &&
|
2272
|
+
m !== void 0 && V(m, `material.${o}`, f);
|
2245
2273
|
}
|
2246
2274
|
};
|
2247
|
-
if (
|
2248
|
-
const
|
2275
|
+
if (d === "number") {
|
2276
|
+
const h = {
|
2249
2277
|
title: u,
|
2250
|
-
prop:
|
2278
|
+
prop: o,
|
2251
2279
|
type: "number",
|
2252
2280
|
value: n,
|
2253
2281
|
step: 0.01,
|
2254
|
-
disabled:
|
2282
|
+
disabled: c,
|
2255
2283
|
onChange: (f, m) => {
|
2256
|
-
t.updateObject(a.uuid, `material.${
|
2284
|
+
t.updateObject(a.uuid, `material.${o}`, m);
|
2257
2285
|
const x = t.scene?.getObjectByProperty("uuid", a.uuid);
|
2258
|
-
x !== void 0 &&
|
2286
|
+
x !== void 0 && V(x, `material.${o}`, m);
|
2259
2287
|
}
|
2260
2288
|
};
|
2261
|
-
return Un(u) && (
|
2289
|
+
return Un(u) && (h.type = "range", h.min = 0, h.max = 1), h;
|
2262
2290
|
} else {
|
2263
2291
|
if (n.isColor)
|
2264
2292
|
return {
|
2265
2293
|
title: u,
|
2266
|
-
prop:
|
2294
|
+
prop: o,
|
2267
2295
|
type: "color",
|
2268
2296
|
value: n,
|
2269
|
-
disabled:
|
2270
|
-
onChange: (
|
2297
|
+
disabled: c,
|
2298
|
+
onChange: (h, f) => {
|
2271
2299
|
const m = new Lt(f);
|
2272
|
-
t.updateObject(a.uuid, `material.${
|
2300
|
+
t.updateObject(a.uuid, `material.${o}`, m);
|
2273
2301
|
const x = t.scene?.getObjectByProperty("uuid", a.uuid);
|
2274
|
-
x !== void 0 &&
|
2302
|
+
x !== void 0 && V(x, `material.${o}`, m);
|
2275
2303
|
}
|
2276
2304
|
};
|
2277
2305
|
if (Array.isArray(n)) {
|
2278
|
-
const
|
2306
|
+
const h = [];
|
2279
2307
|
for (const f in n) {
|
2280
2308
|
const m = n[f], x = `[${f.toString()}]`;
|
2281
2309
|
if (m.value !== void 0) {
|
2282
|
-
const
|
2283
|
-
|
2310
|
+
const T = ht(`${x}.value`, m.value, a, t, o, c);
|
2311
|
+
T !== void 0 && h.push(T);
|
2284
2312
|
} else {
|
2285
|
-
const
|
2286
|
-
|
2313
|
+
const T = ht(x, m, a, t, o, c);
|
2314
|
+
T !== void 0 && h.push(T);
|
2287
2315
|
}
|
2288
2316
|
}
|
2289
|
-
if (
|
2290
|
-
return Nt(
|
2317
|
+
if (h.length > 0)
|
2318
|
+
return Nt(h), {
|
2291
2319
|
title: u,
|
2292
|
-
items:
|
2320
|
+
items: h
|
2293
2321
|
};
|
2294
2322
|
} else {
|
2295
|
-
if (
|
2323
|
+
if (si(n))
|
2296
2324
|
return {
|
2297
2325
|
title: u,
|
2298
|
-
prop:
|
2326
|
+
prop: o,
|
2299
2327
|
type: "vector2",
|
2300
2328
|
value: n,
|
2301
|
-
disabled:
|
2302
|
-
onChange: (
|
2303
|
-
t.updateObject(a.uuid, `material.${
|
2329
|
+
disabled: c,
|
2330
|
+
onChange: (h, f) => {
|
2331
|
+
t.updateObject(a.uuid, `material.${o}`, f);
|
2304
2332
|
const m = t.scene?.getObjectByProperty("uuid", a.uuid);
|
2305
|
-
m !== void 0 &&
|
2333
|
+
m !== void 0 && V(m, `material.${o}`, f);
|
2306
2334
|
}
|
2307
2335
|
};
|
2308
|
-
if (
|
2336
|
+
if (oi(n))
|
2309
2337
|
return {
|
2310
2338
|
title: u,
|
2311
|
-
prop:
|
2339
|
+
prop: o,
|
2312
2340
|
type: "grid3",
|
2313
2341
|
value: n,
|
2314
|
-
disabled:
|
2315
|
-
onChange: (
|
2316
|
-
t.updateObject(a.uuid, `material.${
|
2342
|
+
disabled: c,
|
2343
|
+
onChange: (h, f) => {
|
2344
|
+
t.updateObject(a.uuid, `material.${o}`, f);
|
2317
2345
|
const m = t.scene?.getObjectByProperty("uuid", a.uuid);
|
2318
|
-
m !== void 0 &&
|
2346
|
+
m !== void 0 && V(m, `material.${o}`, f);
|
2319
2347
|
}
|
2320
2348
|
};
|
2321
|
-
if (
|
2349
|
+
if (ci(n))
|
2322
2350
|
return {
|
2323
2351
|
title: u,
|
2324
|
-
prop:
|
2352
|
+
prop: o,
|
2325
2353
|
type: "grid4",
|
2326
2354
|
value: n,
|
2327
|
-
disabled:
|
2328
|
-
onChange: (
|
2329
|
-
t.updateObject(a.uuid, `material.${
|
2355
|
+
disabled: c,
|
2356
|
+
onChange: (h, f) => {
|
2357
|
+
t.updateObject(a.uuid, `material.${o}`, f);
|
2330
2358
|
const m = t.scene?.getObjectByProperty("uuid", a.uuid);
|
2331
|
-
m !== void 0 &&
|
2359
|
+
m !== void 0 && V(m, `material.${o}`, f);
|
2332
2360
|
}
|
2333
2361
|
};
|
2334
2362
|
if (n.isEuler)
|
2335
2363
|
return {
|
2336
2364
|
title: u,
|
2337
|
-
prop:
|
2365
|
+
prop: o,
|
2338
2366
|
type: "euler",
|
2339
2367
|
value: n,
|
2340
|
-
disabled:
|
2341
|
-
onChange: (
|
2342
|
-
t.updateObject(a.uuid, `material.${
|
2368
|
+
disabled: c,
|
2369
|
+
onChange: (h, f) => {
|
2370
|
+
t.updateObject(a.uuid, `material.${o}`, f);
|
2343
2371
|
const m = t.scene?.getObjectByProperty("uuid", a.uuid);
|
2344
|
-
m !== void 0 &&
|
2372
|
+
m !== void 0 && V(m, `material.${o}`, f);
|
2345
2373
|
}
|
2346
2374
|
};
|
2347
2375
|
if (n.src !== void 0)
|
@@ -2349,133 +2377,135 @@ function ht(e, n, a, t, i = "", o = !1) {
|
|
2349
2377
|
title: u,
|
2350
2378
|
type: "image",
|
2351
2379
|
value: n,
|
2352
|
-
disabled:
|
2353
|
-
onChange: (
|
2354
|
-
const m =
|
2380
|
+
disabled: c,
|
2381
|
+
onChange: (h, f) => {
|
2382
|
+
const m = Za(e), x = i.length > 0 ? `${i}.${m}` : m;
|
2355
2383
|
t.createTexture(a.uuid, `material.${x}`, f);
|
2356
|
-
const
|
2357
|
-
|
2358
|
-
|
2384
|
+
const T = t.scene?.getObjectByProperty("uuid", a.uuid);
|
2385
|
+
T !== void 0 && Ln(f).then((W) => {
|
2386
|
+
V(T, `material.${x}`, W), V(T, "material.needsUpdate", !0);
|
2359
2387
|
});
|
2360
2388
|
}
|
2361
2389
|
};
|
2362
2390
|
if (n.elements !== void 0)
|
2363
2391
|
return {
|
2364
2392
|
title: u,
|
2365
|
-
prop:
|
2393
|
+
prop: o,
|
2366
2394
|
type: n.elements.length > 9 ? "grid4" : "grid3",
|
2367
2395
|
value: n,
|
2368
|
-
disabled:
|
2369
|
-
onChange: (
|
2370
|
-
t.updateObject(a.uuid, `material.${
|
2396
|
+
disabled: c,
|
2397
|
+
onChange: (h, f) => {
|
2398
|
+
t.updateObject(a.uuid, `material.${o}`, f);
|
2371
2399
|
const m = t.scene?.getObjectByProperty("uuid", a.uuid);
|
2372
|
-
m !== void 0 &&
|
2400
|
+
m !== void 0 && V(m, `material.${o}`, f);
|
2373
2401
|
}
|
2374
2402
|
};
|
2375
2403
|
{
|
2376
|
-
const
|
2404
|
+
const h = [], f = e === "defines" || e === "extensions";
|
2377
2405
|
try {
|
2378
2406
|
for (const m in n) {
|
2379
2407
|
const x = n[m];
|
2380
2408
|
if (x !== void 0)
|
2381
2409
|
if (x.value !== void 0) {
|
2382
|
-
const
|
2383
|
-
|
2410
|
+
const T = ht(`${m}.value`, x.value, a, t, o, f);
|
2411
|
+
T !== void 0 && h.push(T);
|
2384
2412
|
} else {
|
2385
|
-
const
|
2386
|
-
|
2413
|
+
const T = ht(m, x, a, t, o, f);
|
2414
|
+
T !== void 0 && h.push(T);
|
2387
2415
|
}
|
2388
2416
|
}
|
2389
2417
|
} catch {
|
2390
2418
|
console.log("Issue cycling through material object:", e, n);
|
2391
2419
|
}
|
2392
|
-
if (
|
2393
|
-
return Nt(
|
2420
|
+
if (h.length > 0)
|
2421
|
+
return Nt(h), {
|
2394
2422
|
title: u,
|
2395
|
-
items:
|
2423
|
+
items: h
|
2396
2424
|
};
|
2397
2425
|
}
|
2398
2426
|
}
|
2399
2427
|
}
|
2400
2428
|
}
|
2401
|
-
function
|
2429
|
+
function an(e, n, a) {
|
2402
2430
|
const t = [];
|
2403
2431
|
for (const i in e) {
|
2404
|
-
if (!
|
2432
|
+
if (!Ka(i))
|
2405
2433
|
continue;
|
2406
|
-
const
|
2407
|
-
if (
|
2408
|
-
t.push(ni(i, u, n, a));
|
2409
|
-
else if (o === "number")
|
2434
|
+
const c = typeof e[i], u = e[i];
|
2435
|
+
if (c === "boolean")
|
2410
2436
|
t.push(ai(i, u, n, a));
|
2411
|
-
else if (
|
2437
|
+
else if (c === "number")
|
2412
2438
|
t.push(ii(i, u, n, a));
|
2413
|
-
else if (
|
2414
|
-
|
2415
|
-
|
2439
|
+
else if (c === "string")
|
2440
|
+
t.push(ri(i, u, n, a));
|
2441
|
+
else if (c === "object") {
|
2442
|
+
const o = ht(i, u, n, a);
|
2443
|
+
o !== void 0 && t.push(o);
|
2416
2444
|
} else
|
2417
|
-
u !== void 0 && console.log("other:", i,
|
2445
|
+
u !== void 0 && console.log("other:", i, c, u);
|
2418
2446
|
}
|
2419
2447
|
return Nt(t), t.push({
|
2420
2448
|
title: "Update Material",
|
2421
2449
|
type: "button",
|
2422
2450
|
onChange: () => {
|
2423
2451
|
a.updateObject(n.uuid, "material.needsUpdate", !0);
|
2452
|
+
const i = a.scene?.getObjectByProperty("uuid", n.uuid);
|
2453
|
+
i !== void 0 && V(i, "material.needsUpdate", !0);
|
2424
2454
|
}
|
2425
2455
|
}), t;
|
2426
2456
|
}
|
2427
|
-
function
|
2457
|
+
function li(e, n) {
|
2428
2458
|
const a = e.material;
|
2429
2459
|
if (Array.isArray(a)) {
|
2430
2460
|
const t = [], i = a.length;
|
2431
|
-
for (let
|
2461
|
+
for (let c = 0; c < i; c++)
|
2432
2462
|
t.push(
|
2433
2463
|
/* @__PURE__ */ l.jsx(
|
2434
|
-
|
2464
|
+
Xe,
|
2435
2465
|
{
|
2436
|
-
title: `Material ${
|
2437
|
-
items:
|
2466
|
+
title: `Material ${c}`,
|
2467
|
+
items: an(a[c], e, n)
|
2438
2468
|
},
|
2439
|
-
`Material ${
|
2469
|
+
`Material ${c}`
|
2440
2470
|
)
|
2441
2471
|
);
|
2442
2472
|
return /* @__PURE__ */ l.jsx(l.Fragment, { children: t });
|
2443
2473
|
} else
|
2444
2474
|
return /* @__PURE__ */ l.jsx(
|
2445
|
-
|
2475
|
+
Xe,
|
2446
2476
|
{
|
2447
2477
|
title: "Material",
|
2448
|
-
items:
|
2478
|
+
items: an(a, e, n)
|
2449
2479
|
}
|
2450
2480
|
);
|
2451
2481
|
}
|
2452
|
-
function
|
2453
|
-
const [n, a] =
|
2454
|
-
return
|
2455
|
-
let t = !1, i = -1,
|
2456
|
-
const
|
2457
|
-
t = !0,
|
2458
|
-
},
|
2482
|
+
function ui(e) {
|
2483
|
+
const [n, a] = Z(e.defaultValue);
|
2484
|
+
return Ae(() => {
|
2485
|
+
let t = !1, i = -1, c = 0, u = e.defaultValue;
|
2486
|
+
const o = (x) => {
|
2487
|
+
t = !0, c = Number(e.input.current?.value), i = x.clientX, document.addEventListener("mouseup", h, !1), document.addEventListener("mousemove", d, !1), document.addEventListener("contextmenu", h, !1);
|
2488
|
+
}, d = (x) => {
|
2459
2489
|
if (!t)
|
2460
2490
|
return;
|
2461
|
-
const
|
2462
|
-
u = Number((
|
2463
|
-
},
|
2464
|
-
t = !1, document.removeEventListener("mouseup",
|
2491
|
+
const T = e.step !== void 0 ? e.step : 1, W = (x.clientX - i) * T;
|
2492
|
+
u = Number((c + W).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
|
+
}, h = () => {
|
2494
|
+
t = !1, document.removeEventListener("mouseup", h), document.removeEventListener("mousemove", d), document.removeEventListener("contextmenu", h);
|
2465
2495
|
}, f = (x) => {
|
2466
|
-
const
|
2467
|
-
a(
|
2496
|
+
const T = Number(x.target.value);
|
2497
|
+
a(T);
|
2468
2498
|
}, m = (x) => {
|
2469
|
-
const
|
2470
|
-
e.onChange !== void 0 && e.onChange(
|
2499
|
+
const T = Number(x.target.value);
|
2500
|
+
e.onChange !== void 0 && e.onChange(T), a(T);
|
2471
2501
|
};
|
2472
|
-
return e.input.current?.addEventListener("input", f), e.label.current?.addEventListener("mousedown",
|
2473
|
-
e.input.current?.removeEventListener("input", f), e.label.current?.removeEventListener("mousedown",
|
2502
|
+
return e.input.current?.addEventListener("input", f), e.label.current?.addEventListener("mousedown", o, !1), e.sliderRef !== void 0 && e.sliderRef.current?.addEventListener("input", m), () => {
|
2503
|
+
e.input.current?.removeEventListener("input", f), e.label.current?.removeEventListener("mousedown", o), e.sliderRef !== void 0 && e.sliderRef.current?.removeEventListener("input", m), document.removeEventListener("mouseup", h), document.removeEventListener("mousemove", d), document.removeEventListener("contextmenu", h);
|
2474
2504
|
};
|
2475
2505
|
}, []), n;
|
2476
2506
|
}
|
2477
|
-
function
|
2478
|
-
const n = X(null), a = X(null), t =
|
2507
|
+
function Ze(e) {
|
2508
|
+
const n = X(null), a = X(null), t = ui({
|
2479
2509
|
label: e.labelRef,
|
2480
2510
|
input: n,
|
2481
2511
|
sliderRef: a,
|
@@ -2501,8 +2531,8 @@ function Xe(e) {
|
|
2501
2531
|
step: e.step,
|
2502
2532
|
disabled: e.disabled,
|
2503
2533
|
onChange: (i) => {
|
2504
|
-
const
|
2505
|
-
e.onChange !== void 0 && e.onChange(e.prop,
|
2534
|
+
const c = Number(i.target.value);
|
2535
|
+
e.onChange !== void 0 && e.onChange(e.prop, c);
|
2506
2536
|
}
|
2507
2537
|
}
|
2508
2538
|
),
|
@@ -2516,8 +2546,8 @@ function Xe(e) {
|
|
2516
2546
|
ref: n,
|
2517
2547
|
className: "min",
|
2518
2548
|
onChange: (i) => {
|
2519
|
-
const
|
2520
|
-
e.onChange !== void 0 && e.onChange(e.prop,
|
2549
|
+
const c = Number(i.target.value);
|
2550
|
+
e.onChange !== void 0 && e.onChange(e.prop, c);
|
2521
2551
|
}
|
2522
2552
|
}
|
2523
2553
|
),
|
@@ -2531,43 +2561,43 @@ function Xe(e) {
|
|
2531
2561
|
max: e.max,
|
2532
2562
|
step: e.step,
|
2533
2563
|
ref: a,
|
2534
|
-
onChange:
|
2564
|
+
onChange: Bt
|
2535
2565
|
}
|
2536
2566
|
)
|
2537
2567
|
] })
|
2538
2568
|
] });
|
2539
2569
|
}
|
2540
|
-
function
|
2541
|
-
const n = X(null), a = X(null), t = X(null), i = X(null),
|
2570
|
+
function di(e) {
|
2571
|
+
const n = X(null), a = X(null), t = X(null), i = X(null), c = X(null), u = X(null), [o, d] = Z(e.value), [h, f] = Z({
|
2542
2572
|
min: Math.min(e.min, Math.min(e.value.x, e.value.y)),
|
2543
2573
|
max: Math.max(e.max, Math.max(e.value.x, e.value.y))
|
2544
|
-
}), [m, x] =
|
2545
|
-
function
|
2546
|
-
m || (window.addEventListener("mousemove", te), window.addEventListener("mouseup",
|
2574
|
+
}), [m, x] = Z(!1);
|
2575
|
+
function T() {
|
2576
|
+
m || (window.addEventListener("mousemove", te), window.addEventListener("mouseup", W), window.addEventListener("mouseup", W), x(!0));
|
2547
2577
|
}
|
2548
|
-
function
|
2549
|
-
window.removeEventListener("mousemove", te), window.removeEventListener("mouseup",
|
2578
|
+
function W() {
|
2579
|
+
window.removeEventListener("mousemove", te), window.removeEventListener("mouseup", W), x(!1);
|
2550
2580
|
}
|
2551
|
-
function te(
|
2552
|
-
const
|
2553
|
-
e.onChange({ target: { value: { x:
|
2581
|
+
function te(I) {
|
2582
|
+
const q = c.current.getBoundingClientRect(), ne = Ke(0, 99, I.clientX - q.left) / 99, Se = Ke(0, 99, I.clientY - q.top) / 99, z = en(Qt(h.min, h.max, ne), 3), pe = en(Qt(h.min, h.max, Se), 3);
|
2583
|
+
e.onChange({ target: { value: { x: z, y: pe } } }), d({ x: z, y: pe });
|
2554
2584
|
}
|
2555
|
-
function me(
|
2556
|
-
let
|
2557
|
-
|
2585
|
+
function me(I) {
|
2586
|
+
let q = o.x, ne = o.y;
|
2587
|
+
I.target === n.current ? q = Number(I.target.value) : ne = Number(I.target.value), d({ x: q, y: ne });
|
2558
2588
|
}
|
2559
2589
|
function re() {
|
2560
|
-
const
|
2561
|
-
f({ min:
|
2590
|
+
const I = Number(t.current.value);
|
2591
|
+
f({ min: I, max: h.max }), (o.x < I || o.y < I) && d({ x: Ke(I, h.max, o.x), y: Ke(I, h.max, o.y) });
|
2562
2592
|
}
|
2563
2593
|
function $() {
|
2564
|
-
const
|
2565
|
-
f({ min:
|
2594
|
+
const I = Number(i.current.value);
|
2595
|
+
f({ min: h.min, max: I }), (o.x > I || o.y > I) && d({ x: Ke(h.min, I, o.x), y: Ke(h.min, I, o.y) });
|
2566
2596
|
}
|
2567
|
-
return
|
2568
|
-
const
|
2569
|
-
u.current.style.left = `${
|
2570
|
-
}, [
|
2597
|
+
return Ae(() => {
|
2598
|
+
const I = Jt(h.min, h.max, o.x), q = Jt(h.min, h.max, o.y);
|
2599
|
+
u.current.style.left = `${I * 100}%`, u.current.style.top = `${q * 100}%`;
|
2600
|
+
}, [h, o]), /* @__PURE__ */ l.jsxs("div", { className: "vector2", children: [
|
2571
2601
|
/* @__PURE__ */ l.jsxs("div", { className: "fields", children: [
|
2572
2602
|
/* @__PURE__ */ l.jsxs("div", { children: [
|
2573
2603
|
/* @__PURE__ */ l.jsx("label", { children: "X:" }),
|
@@ -2576,9 +2606,9 @@ function ui(e) {
|
|
2576
2606
|
{
|
2577
2607
|
ref: n,
|
2578
2608
|
type: "number",
|
2579
|
-
value:
|
2580
|
-
min:
|
2581
|
-
max:
|
2609
|
+
value: o.x,
|
2610
|
+
min: h.min,
|
2611
|
+
max: h.max,
|
2582
2612
|
step: 0.01,
|
2583
2613
|
onChange: me
|
2584
2614
|
}
|
@@ -2591,9 +2621,9 @@ function ui(e) {
|
|
2591
2621
|
{
|
2592
2622
|
ref: a,
|
2593
2623
|
type: "number",
|
2594
|
-
value:
|
2595
|
-
min:
|
2596
|
-
max:
|
2624
|
+
value: o.y,
|
2625
|
+
min: h.min,
|
2626
|
+
max: h.max,
|
2597
2627
|
step: 0.01,
|
2598
2628
|
onChange: me
|
2599
2629
|
}
|
@@ -2606,7 +2636,7 @@ function ui(e) {
|
|
2606
2636
|
{
|
2607
2637
|
ref: t,
|
2608
2638
|
type: "number",
|
2609
|
-
value:
|
2639
|
+
value: h.min,
|
2610
2640
|
step: 0.01,
|
2611
2641
|
onChange: re
|
2612
2642
|
}
|
@@ -2619,114 +2649,114 @@ function ui(e) {
|
|
2619
2649
|
{
|
2620
2650
|
ref: i,
|
2621
2651
|
type: "number",
|
2622
|
-
value:
|
2652
|
+
value: h.max,
|
2623
2653
|
step: 0.01,
|
2624
2654
|
onChange: $
|
2625
2655
|
}
|
2626
2656
|
)
|
2627
2657
|
] })
|
2628
2658
|
] }),
|
2629
|
-
/* @__PURE__ */ l.jsxs("div", { className: "input", ref:
|
2659
|
+
/* @__PURE__ */ l.jsxs("div", { className: "input", ref: c, onMouseDown: T, onMouseUp: W, children: [
|
2630
2660
|
/* @__PURE__ */ l.jsx("div", { className: "x" }),
|
2631
2661
|
/* @__PURE__ */ l.jsx("div", { className: "y" }),
|
2632
2662
|
/* @__PURE__ */ l.jsx("div", { className: "pt", ref: u })
|
2633
2663
|
] })
|
2634
2664
|
] });
|
2635
2665
|
}
|
2636
|
-
function
|
2666
|
+
function rn(e) {
|
2637
2667
|
const n = e.value.isVector3 !== void 0, a = e.value.isEuler !== void 0, t = e.value.elements !== void 0, i = [];
|
2638
2668
|
if (n) {
|
2639
|
-
const
|
2640
|
-
|
2669
|
+
const c = ie(() => e.value, []), u = (d, h) => {
|
2670
|
+
c[d] = h, e.onChange({ target: { value: c } });
|
2641
2671
|
};
|
2642
|
-
["x", "y", "z"].forEach((
|
2643
|
-
const
|
2672
|
+
["x", "y", "z"].forEach((d) => {
|
2673
|
+
const h = X(null);
|
2644
2674
|
i.push(
|
2645
2675
|
/* @__PURE__ */ l.jsxs("div", { children: [
|
2646
|
-
/* @__PURE__ */ l.jsx("label", { ref:
|
2676
|
+
/* @__PURE__ */ l.jsx("label", { ref: h, children: d.toUpperCase() }),
|
2647
2677
|
/* @__PURE__ */ l.jsx(
|
2648
|
-
|
2678
|
+
Ze,
|
2649
2679
|
{
|
2650
|
-
value:
|
2680
|
+
value: c[d],
|
2651
2681
|
type: "number",
|
2652
|
-
prop:
|
2682
|
+
prop: d,
|
2653
2683
|
step: 0.01,
|
2654
|
-
labelRef:
|
2684
|
+
labelRef: h,
|
2655
2685
|
onChange: u
|
2656
2686
|
}
|
2657
2687
|
)
|
2658
|
-
] },
|
2688
|
+
] }, d)
|
2659
2689
|
);
|
2660
2690
|
});
|
2661
2691
|
} else if (a) {
|
2662
|
-
const
|
2663
|
-
|
2692
|
+
const c = ie(() => e.value, []), u = (d, h) => {
|
2693
|
+
c[d] = h, e.onChange({ target: { value: c } });
|
2664
2694
|
};
|
2665
|
-
["_x", "_y", "_z"].forEach((
|
2666
|
-
const
|
2695
|
+
["_x", "_y", "_z"].forEach((d) => {
|
2696
|
+
const h = X(null);
|
2667
2697
|
i.push(
|
2668
2698
|
/* @__PURE__ */ l.jsxs("div", { children: [
|
2669
|
-
/* @__PURE__ */ l.jsx("label", { ref:
|
2699
|
+
/* @__PURE__ */ l.jsx("label", { ref: h, children: d.substring(1).toUpperCase() }),
|
2670
2700
|
/* @__PURE__ */ l.jsx(
|
2671
|
-
|
2701
|
+
Ze,
|
2672
2702
|
{
|
2673
|
-
value:
|
2703
|
+
value: c[d],
|
2674
2704
|
type: "number",
|
2675
|
-
prop:
|
2705
|
+
prop: d,
|
2676
2706
|
step: 0.01,
|
2677
|
-
labelRef:
|
2707
|
+
labelRef: h,
|
2678
2708
|
onChange: u
|
2679
2709
|
}
|
2680
2710
|
)
|
2681
|
-
] },
|
2711
|
+
] }, d)
|
2682
2712
|
);
|
2683
2713
|
});
|
2684
2714
|
} else if (t) {
|
2685
|
-
const
|
2686
|
-
const
|
2687
|
-
|
2715
|
+
const c = ie(() => e.value, []), u = (o, d) => {
|
2716
|
+
const h = Number(o);
|
2717
|
+
c.elements[h] = d, e.onChange({ target: { value: c } });
|
2688
2718
|
};
|
2689
|
-
for (let
|
2690
|
-
const
|
2719
|
+
for (let o = 0; o < 9; o++) {
|
2720
|
+
const d = X(null);
|
2691
2721
|
i.push(
|
2692
2722
|
/* @__PURE__ */ l.jsxs("div", { children: [
|
2693
|
-
/* @__PURE__ */ l.jsx("label", { ref:
|
2723
|
+
/* @__PURE__ */ l.jsx("label", { ref: d, children: o + 1 }),
|
2694
2724
|
/* @__PURE__ */ l.jsx(
|
2695
|
-
|
2725
|
+
Ze,
|
2696
2726
|
{
|
2697
|
-
value:
|
2727
|
+
value: c.elements[o],
|
2698
2728
|
type: "number",
|
2699
|
-
prop:
|
2729
|
+
prop: o.toString(),
|
2700
2730
|
step: 0.01,
|
2701
|
-
labelRef:
|
2731
|
+
labelRef: d,
|
2702
2732
|
onChange: u
|
2703
2733
|
}
|
2704
2734
|
)
|
2705
|
-
] },
|
2735
|
+
] }, o.toString())
|
2706
2736
|
);
|
2707
2737
|
}
|
2708
2738
|
}
|
2709
2739
|
return /* @__PURE__ */ l.jsx("div", { className: "grid3", children: i }, Math.random().toString());
|
2710
2740
|
}
|
2711
|
-
function
|
2741
|
+
function hi(e) {
|
2712
2742
|
const n = e.value.x !== void 0, a = [];
|
2713
2743
|
if (n) {
|
2714
|
-
const t = ie(() => e.value, []), i = (u,
|
2715
|
-
t[u] =
|
2744
|
+
const t = ie(() => e.value, []), i = (u, o) => {
|
2745
|
+
t[u] = o, e.onChange({ target: { value: t } });
|
2716
2746
|
};
|
2717
2747
|
["x", "y", "z", "w"].forEach((u) => {
|
2718
|
-
const
|
2748
|
+
const o = X(null);
|
2719
2749
|
a.push(
|
2720
2750
|
/* @__PURE__ */ l.jsxs("div", { children: [
|
2721
|
-
/* @__PURE__ */ l.jsx("label", { ref:
|
2751
|
+
/* @__PURE__ */ l.jsx("label", { ref: o, children: u.toUpperCase() }),
|
2722
2752
|
/* @__PURE__ */ l.jsx(
|
2723
|
-
|
2753
|
+
Ze,
|
2724
2754
|
{
|
2725
2755
|
value: t.x,
|
2726
2756
|
type: "number",
|
2727
2757
|
prop: u,
|
2728
2758
|
step: 0.01,
|
2729
|
-
labelRef:
|
2759
|
+
labelRef: o,
|
2730
2760
|
onChange: i
|
2731
2761
|
}
|
2732
2762
|
)
|
@@ -2734,27 +2764,27 @@ function di(e) {
|
|
2734
2764
|
);
|
2735
2765
|
});
|
2736
2766
|
} else {
|
2737
|
-
const t = ie(() => e.value, []), i = (
|
2738
|
-
const
|
2739
|
-
t.elements[
|
2767
|
+
const t = ie(() => e.value, []), i = (c, u) => {
|
2768
|
+
const o = Number(c);
|
2769
|
+
t.elements[o] = u, e.onChange({ target: { value: t } });
|
2740
2770
|
};
|
2741
|
-
for (let
|
2771
|
+
for (let c = 0; c < 16; c++) {
|
2742
2772
|
const u = X(null);
|
2743
2773
|
a.push(
|
2744
2774
|
/* @__PURE__ */ l.jsxs("div", { children: [
|
2745
|
-
/* @__PURE__ */ l.jsx("label", { ref: u, children:
|
2775
|
+
/* @__PURE__ */ l.jsx("label", { ref: u, children: c + 1 }),
|
2746
2776
|
/* @__PURE__ */ l.jsx(
|
2747
|
-
|
2777
|
+
Ze,
|
2748
2778
|
{
|
2749
|
-
value: t.elements[
|
2779
|
+
value: t.elements[c],
|
2750
2780
|
type: "number",
|
2751
|
-
prop:
|
2781
|
+
prop: c.toString(),
|
2752
2782
|
step: 0.01,
|
2753
2783
|
labelRef: u,
|
2754
2784
|
onChange: i
|
2755
2785
|
}
|
2756
2786
|
)
|
2757
|
-
] },
|
2787
|
+
] }, c.toString())
|
2758
2788
|
);
|
2759
2789
|
}
|
2760
2790
|
}
|
@@ -2762,17 +2792,17 @@ function di(e) {
|
|
2762
2792
|
}
|
2763
2793
|
function ft(e) {
|
2764
2794
|
let n = e.value;
|
2765
|
-
n !== void 0 && n.isColor !== void 0 && (n =
|
2766
|
-
const [a, t] =
|
2795
|
+
n !== void 0 && n.isColor !== void 0 && (n = Pa(e.value));
|
2796
|
+
const [a, t] = Z(n), i = X(null), c = X(null), u = (f) => {
|
2767
2797
|
let m = f.target.value;
|
2768
2798
|
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);
|
2769
|
-
},
|
2770
|
-
e.disabled && (
|
2771
|
-
const
|
2772
|
-
`) > -1),
|
2773
|
-
return /* @__PURE__ */ l.jsxs("div", { className: `field ${
|
2799
|
+
}, o = {};
|
2800
|
+
e.disabled && (o.opacity = 0.8);
|
2801
|
+
const d = e.type === "string" && (a.length > 100 || a.search(`
|
2802
|
+
`) > -1), h = d || e.type === "image" || e.type === "vector2";
|
2803
|
+
return /* @__PURE__ */ l.jsxs("div", { className: `field ${h ? "block" : ""}`, style: o, children: [
|
2774
2804
|
e.type !== "button" && /* @__PURE__ */ l.jsx("label", { ref: i, children: Mt(e.title) }, "fieldLabel"),
|
2775
|
-
e.type === "string" && !
|
2805
|
+
e.type === "string" && !d && /* @__PURE__ */ l.jsx(
|
2776
2806
|
"input",
|
2777
2807
|
{
|
2778
2808
|
type: "text",
|
@@ -2781,13 +2811,16 @@ function ft(e) {
|
|
2781
2811
|
value: a
|
2782
2812
|
}
|
2783
2813
|
),
|
2784
|
-
e.type === "string" &&
|
2814
|
+
e.type === "string" && d && /* @__PURE__ */ l.jsx(
|
2785
2815
|
"textarea",
|
2786
2816
|
{
|
2787
2817
|
cols: 50,
|
2788
2818
|
rows: 10,
|
2789
2819
|
disabled: e.disabled !== void 0 ? e.disabled : !0,
|
2790
2820
|
onChange: u,
|
2821
|
+
onKeyDown: (f) => {
|
2822
|
+
e.onKeyDown !== void 0 && e.onKeyDown(f);
|
2823
|
+
},
|
2791
2824
|
value: a
|
2792
2825
|
}
|
2793
2826
|
),
|
@@ -2801,7 +2834,7 @@ function ft(e) {
|
|
2801
2834
|
}
|
2802
2835
|
),
|
2803
2836
|
e.type === "number" && /* @__PURE__ */ l.jsx(
|
2804
|
-
|
2837
|
+
Ze,
|
2805
2838
|
{
|
2806
2839
|
value: a,
|
2807
2840
|
type: e.type,
|
@@ -2815,7 +2848,7 @@ function ft(e) {
|
|
2815
2848
|
}
|
2816
2849
|
),
|
2817
2850
|
e.type === "range" && /* @__PURE__ */ l.jsx(
|
2818
|
-
|
2851
|
+
Ze,
|
2819
2852
|
{
|
2820
2853
|
value: a,
|
2821
2854
|
type: e.type,
|
@@ -2842,19 +2875,19 @@ function ft(e) {
|
|
2842
2875
|
children: e.title
|
2843
2876
|
}
|
2844
2877
|
),
|
2845
|
-
e.type === "image" && /* @__PURE__ */ l.jsx("img", { ref:
|
2878
|
+
e.type === "image" && /* @__PURE__ */ l.jsx("img", { alt: e.title, ref: c, onClick: () => {
|
2846
2879
|
Xa().then((f) => {
|
2847
|
-
|
2880
|
+
c.current.src = f, e.onChange !== void 0 && e.onChange(e.prop !== void 0 ? e.prop : e.title, f);
|
2848
2881
|
});
|
2849
|
-
}, src: a.length > 0 ? a :
|
2882
|
+
}, src: a.src.length > 0 ? a.src : Va }),
|
2850
2883
|
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)) }) }),
|
2851
|
-
e.type === "vector2" && /* @__PURE__ */ l.jsx(
|
2852
|
-
e.type === "grid3" && /* @__PURE__ */ l.jsx(
|
2853
|
-
e.type === "grid4" && /* @__PURE__ */ l.jsx(
|
2854
|
-
e.type === "euler" && /* @__PURE__ */ l.jsx(
|
2884
|
+
e.type === "vector2" && /* @__PURE__ */ l.jsx(di, { value: a, min: 0, max: 1, onChange: u }),
|
2885
|
+
e.type === "grid3" && /* @__PURE__ */ l.jsx(rn, { value: a, onChange: u }),
|
2886
|
+
e.type === "grid4" && /* @__PURE__ */ l.jsx(hi, { value: a, onChange: u }),
|
2887
|
+
e.type === "euler" && /* @__PURE__ */ l.jsx(rn, { value: a, onChange: u })
|
2855
2888
|
] });
|
2856
2889
|
}
|
2857
|
-
function
|
2890
|
+
function sn(e) {
|
2858
2891
|
switch (e) {
|
2859
2892
|
case "fov":
|
2860
2893
|
return "FOV";
|
@@ -2883,57 +2916,57 @@ function rn(e) {
|
|
2883
2916
|
}
|
2884
2917
|
return e;
|
2885
2918
|
}
|
2886
|
-
function
|
2919
|
+
function fi(e, n) {
|
2887
2920
|
const a = [];
|
2888
2921
|
if (e.perspectiveCameraInfo !== void 0)
|
2889
2922
|
for (const t in e.perspectiveCameraInfo)
|
2890
2923
|
a.push({
|
2891
|
-
title:
|
2924
|
+
title: sn(t),
|
2892
2925
|
prop: t,
|
2893
2926
|
type: "number",
|
2894
2927
|
step: 0.01,
|
2895
2928
|
value: e.perspectiveCameraInfo[t],
|
2896
|
-
onChange: (i,
|
2897
|
-
n.updateObject(e.uuid, i,
|
2929
|
+
onChange: (i, c) => {
|
2930
|
+
n.updateObject(e.uuid, i, c), n.requestMethod(e.uuid, "updateProjectionMatrix");
|
2898
2931
|
const u = n.scene?.getObjectByProperty("uuid", e.uuid);
|
2899
|
-
u !== void 0 && (
|
2932
|
+
u !== void 0 && (V(u, i, c), u.updateProjectionMatrix());
|
2900
2933
|
}
|
2901
2934
|
});
|
2902
2935
|
else if (e.orthographicCameraInfo !== void 0)
|
2903
2936
|
for (const t in e.orthographicCameraInfo)
|
2904
2937
|
a.push({
|
2905
|
-
title:
|
2938
|
+
title: sn(t),
|
2906
2939
|
prop: t,
|
2907
2940
|
type: "number",
|
2908
2941
|
step: 0.01,
|
2909
2942
|
value: e.perspectiveCameraInfo[t],
|
2910
|
-
onChange: (i,
|
2911
|
-
n.updateObject(e.uuid, i,
|
2943
|
+
onChange: (i, c) => {
|
2944
|
+
n.updateObject(e.uuid, i, c), n.requestMethod(e.uuid, "updateProjectionMatrix");
|
2912
2945
|
const u = n.scene?.getObjectByProperty("uuid", e.uuid);
|
2913
|
-
u !== void 0 && (
|
2946
|
+
u !== void 0 && (V(u, i, c), u.updateProjectionMatrix());
|
2914
2947
|
}
|
2915
2948
|
});
|
2916
2949
|
return /* @__PURE__ */ l.jsx(
|
2917
|
-
|
2950
|
+
Xe,
|
2918
2951
|
{
|
2919
2952
|
title: "Camera",
|
2920
2953
|
items: a
|
2921
2954
|
}
|
2922
2955
|
);
|
2923
2956
|
}
|
2924
|
-
function
|
2925
|
-
const a = new
|
2957
|
+
function mi(e, n) {
|
2958
|
+
const a = new ra();
|
2926
2959
|
a.elements = e.matrix;
|
2927
|
-
const t = new Y(), i = new
|
2928
|
-
e.uuid.length > 0 && (t.setFromMatrixPosition(a), i.setFromRotationMatrix(a),
|
2929
|
-
const u = (
|
2930
|
-
const
|
2931
|
-
n.updateObject(e.uuid,
|
2960
|
+
const t = new Y(), i = new sa(), c = new Y();
|
2961
|
+
e.uuid.length > 0 && (t.setFromMatrixPosition(a), i.setFromRotationMatrix(a), c.setFromMatrixScale(a));
|
2962
|
+
const u = (o, d) => {
|
2963
|
+
const h = o === "rotation" ? { x: d._x, y: d._y, z: d._z } : d;
|
2964
|
+
n.updateObject(e.uuid, o, h);
|
2932
2965
|
const f = n.scene?.getObjectByProperty("uuid", e.uuid);
|
2933
|
-
f !== void 0 &&
|
2966
|
+
f !== void 0 && V(f, o, h);
|
2934
2967
|
};
|
2935
2968
|
return /* @__PURE__ */ l.jsx(
|
2936
|
-
|
2969
|
+
Xe,
|
2937
2970
|
{
|
2938
2971
|
title: "Transform",
|
2939
2972
|
items: [
|
@@ -2955,14 +2988,14 @@ function fi(e, n) {
|
|
2955
2988
|
title: "Scale",
|
2956
2989
|
prop: "scale",
|
2957
2990
|
type: "grid3",
|
2958
|
-
value:
|
2991
|
+
value: c,
|
2959
2992
|
onChange: u
|
2960
2993
|
}
|
2961
2994
|
]
|
2962
2995
|
}
|
2963
2996
|
);
|
2964
2997
|
}
|
2965
|
-
function
|
2998
|
+
function on(e) {
|
2966
2999
|
switch (e) {
|
2967
3000
|
case "color":
|
2968
3001
|
return "Color";
|
@@ -2985,54 +3018,54 @@ function sn(e) {
|
|
2985
3018
|
}
|
2986
3019
|
return e;
|
2987
3020
|
}
|
2988
|
-
function
|
3021
|
+
function pi(e, n) {
|
2989
3022
|
const a = [];
|
2990
3023
|
if (e.lightInfo !== void 0)
|
2991
3024
|
for (const t in e.lightInfo) {
|
2992
3025
|
const i = e.lightInfo[t];
|
2993
3026
|
i !== void 0 && (i.isColor !== void 0 ? a.push({
|
2994
|
-
title:
|
3027
|
+
title: on(t),
|
2995
3028
|
prop: t,
|
2996
3029
|
type: "color",
|
2997
3030
|
value: i,
|
2998
|
-
onChange: (
|
2999
|
-
const
|
3000
|
-
n.updateObject(e.uuid,
|
3001
|
-
const
|
3002
|
-
|
3031
|
+
onChange: (c, u) => {
|
3032
|
+
const o = new Lt(u);
|
3033
|
+
n.updateObject(e.uuid, c, o);
|
3034
|
+
const d = n.scene?.getObjectByProperty("uuid", e.uuid);
|
3035
|
+
d !== void 0 && V(d, c, o);
|
3003
3036
|
}
|
3004
3037
|
}) : a.push({
|
3005
|
-
title:
|
3038
|
+
title: on(t),
|
3006
3039
|
prop: t,
|
3007
3040
|
type: typeof i,
|
3008
3041
|
value: i,
|
3009
3042
|
step: typeof i == "number" ? 0.01 : void 0,
|
3010
|
-
onChange: (
|
3011
|
-
n.updateObject(e.uuid,
|
3012
|
-
const
|
3013
|
-
|
3043
|
+
onChange: (c, u) => {
|
3044
|
+
n.updateObject(e.uuid, c, u);
|
3045
|
+
const o = n.scene?.getObjectByProperty("uuid", e.uuid);
|
3046
|
+
o !== void 0 && V(o, c, u);
|
3014
3047
|
}
|
3015
3048
|
}));
|
3016
3049
|
}
|
3017
3050
|
return /* @__PURE__ */ l.jsx(
|
3018
|
-
|
3051
|
+
Xe,
|
3019
3052
|
{
|
3020
3053
|
title: "Light",
|
3021
3054
|
items: a
|
3022
3055
|
}
|
3023
3056
|
);
|
3024
3057
|
}
|
3025
|
-
function
|
3058
|
+
function gi(e, n) {
|
3026
3059
|
const a = [], t = [];
|
3027
3060
|
let i = 0;
|
3028
|
-
e.animations.forEach((
|
3029
|
-
i = Math.max(i,
|
3030
|
-
title:
|
3061
|
+
e.animations.forEach((o) => {
|
3062
|
+
i = Math.max(i, o.duration), o.duration > 0 && t.push({
|
3063
|
+
title: o.name,
|
3031
3064
|
items: [
|
3032
3065
|
{
|
3033
3066
|
title: "Duration",
|
3034
3067
|
type: "number",
|
3035
|
-
value:
|
3068
|
+
value: o.duration,
|
3036
3069
|
disabled: !0
|
3037
3070
|
},
|
3038
3071
|
{
|
@@ -3056,37 +3089,37 @@ function pi(e, n) {
|
|
3056
3089
|
title: "Animations",
|
3057
3090
|
items: t
|
3058
3091
|
});
|
3059
|
-
const
|
3092
|
+
const c = n.scene?.getObjectByProperty("uuid", e.uuid);
|
3060
3093
|
let u = !1;
|
3061
|
-
if (
|
3062
|
-
const
|
3063
|
-
if (u =
|
3064
|
-
const
|
3094
|
+
if (c !== void 0) {
|
3095
|
+
const o = c.mixer;
|
3096
|
+
if (u = o !== void 0, u) {
|
3097
|
+
const d = [
|
3065
3098
|
{
|
3066
3099
|
title: "Time Scale",
|
3067
3100
|
type: "range",
|
3068
|
-
value:
|
3101
|
+
value: o.timeScale,
|
3069
3102
|
step: 0.01,
|
3070
3103
|
min: -1,
|
3071
3104
|
max: 2,
|
3072
|
-
onChange: (
|
3073
|
-
|
3105
|
+
onChange: (h, f) => {
|
3106
|
+
o.timeScale = f, n.updateObject(e.uuid, "mixer.timeScale", f);
|
3074
3107
|
}
|
3075
3108
|
}
|
3076
3109
|
];
|
3077
|
-
|
3110
|
+
d.push({
|
3078
3111
|
title: "Stop All",
|
3079
3112
|
type: "button",
|
3080
3113
|
onChange: () => {
|
3081
|
-
|
3114
|
+
o.stopAllAction(), n.requestMethod(e.uuid, "stopAllAction", void 0, "mixer");
|
3082
3115
|
}
|
3083
3116
|
}), a.push({
|
3084
3117
|
title: "Mixer",
|
3085
|
-
items:
|
3118
|
+
items: d
|
3086
3119
|
});
|
3087
3120
|
}
|
3088
3121
|
}
|
3089
|
-
return /* @__PURE__ */ l.jsx(
|
3122
|
+
return /* @__PURE__ */ l.jsx(Xe, { title: "Animation", items: a });
|
3090
3123
|
}
|
3091
3124
|
const $n = {
|
3092
3125
|
name: "",
|
@@ -3100,22 +3133,22 @@ const $n = {
|
|
3100
3133
|
orthographicCameraInfo: void 0,
|
3101
3134
|
lightInfo: void 0
|
3102
3135
|
};
|
3103
|
-
let
|
3104
|
-
function
|
3105
|
-
const [n, a] =
|
3106
|
-
|
3107
|
-
function u(
|
3108
|
-
|
3136
|
+
let se = { ...$n };
|
3137
|
+
function vi(e) {
|
3138
|
+
const [n, a] = Z(-1);
|
3139
|
+
Ae(() => {
|
3140
|
+
function u(d) {
|
3141
|
+
se = { ...d.value }, a(Date.now());
|
3109
3142
|
}
|
3110
|
-
function
|
3111
|
-
|
3143
|
+
function o() {
|
3144
|
+
se = { ...$n }, a(Date.now());
|
3112
3145
|
}
|
3113
|
-
return
|
3114
|
-
|
3146
|
+
return j.addEventListener(A.SET_SCENE, o), j.addEventListener(A.SET_OBJECT, u), () => {
|
3147
|
+
j.removeEventListener(A.SET_SCENE, o), j.removeEventListener(A.SET_OBJECT, u);
|
3115
3148
|
};
|
3116
3149
|
}, []);
|
3117
|
-
const t =
|
3118
|
-
return /* @__PURE__ */ l.jsx(
|
3150
|
+
const t = se.type.toLowerCase(), i = se.animations.length > 0 || se.mixer !== void 0, c = t.search("mesh") > -1 || t.search("line") > -1 || t.search("points") > -1;
|
3151
|
+
return /* @__PURE__ */ l.jsx($t, { label: "Inspector", children: /* @__PURE__ */ l.jsx("div", { id: "Inspector", className: e.class, children: se.uuid.length > 0 && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
3119
3152
|
/* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
3120
3153
|
/* @__PURE__ */ l.jsx(
|
3121
3154
|
ft,
|
@@ -3123,7 +3156,7 @@ function gi(e) {
|
|
3123
3156
|
type: "string",
|
3124
3157
|
title: "Name",
|
3125
3158
|
prop: "name",
|
3126
|
-
value:
|
3159
|
+
value: se.name,
|
3127
3160
|
disabled: !0
|
3128
3161
|
}
|
3129
3162
|
),
|
@@ -3133,7 +3166,7 @@ function gi(e) {
|
|
3133
3166
|
type: "string",
|
3134
3167
|
title: "Type",
|
3135
3168
|
prop: "type",
|
3136
|
-
value:
|
3169
|
+
value: se.type,
|
3137
3170
|
disabled: !0
|
3138
3171
|
}
|
3139
3172
|
),
|
@@ -3143,7 +3176,7 @@ function gi(e) {
|
|
3143
3176
|
type: "string",
|
3144
3177
|
title: "UUID",
|
3145
3178
|
prop: "uuid",
|
3146
|
-
value:
|
3179
|
+
value: se.uuid,
|
3147
3180
|
disabled: !0
|
3148
3181
|
}
|
3149
3182
|
),
|
@@ -3153,89 +3186,89 @@ function gi(e) {
|
|
3153
3186
|
type: "boolean",
|
3154
3187
|
title: "Visible",
|
3155
3188
|
prop: "visible",
|
3156
|
-
value:
|
3157
|
-
onChange: (u,
|
3158
|
-
e.three.updateObject(
|
3159
|
-
const
|
3160
|
-
|
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);
|
3161
3194
|
}
|
3162
3195
|
}
|
3163
3196
|
)
|
3164
3197
|
] }),
|
3165
3198
|
/* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
3166
|
-
|
3167
|
-
i ?
|
3168
|
-
t.search("camera") > -1 ?
|
3169
|
-
t.search("light") > -1 ?
|
3170
|
-
|
3199
|
+
mi(se, e.three),
|
3200
|
+
i ? gi(se, e.three) : null,
|
3201
|
+
t.search("camera") > -1 ? fi(se, e.three) : null,
|
3202
|
+
t.search("light") > -1 ? pi(se, e.three) : null,
|
3203
|
+
c ? li(se, e.three) : null
|
3171
3204
|
] })
|
3172
3205
|
] }) }, n) }, "Inspector");
|
3173
3206
|
}
|
3174
3207
|
function Fi(e) {
|
3175
|
-
const [n, a] =
|
3176
|
-
|
3177
|
-
const
|
3208
|
+
const [n, a] = Z(e.scene);
|
3209
|
+
Ae(() => {
|
3210
|
+
const c = (u) => {
|
3178
3211
|
a(u.value);
|
3179
3212
|
};
|
3180
|
-
return
|
3181
|
-
|
3213
|
+
return j.addEventListener(A.SET_SCENE, c), () => {
|
3214
|
+
j.removeEventListener(A.SET_SCENE, c);
|
3182
3215
|
};
|
3183
3216
|
}, []);
|
3184
3217
|
const t = n !== null, i = "Hierarchy - " + (t ? `${n?.name}` : "No Scene");
|
3185
3218
|
return /* @__PURE__ */ l.jsxs("div", { id: "SidePanel", children: [
|
3186
|
-
/* @__PURE__ */ l.jsx(
|
3187
|
-
/* @__PURE__ */ l.jsx(
|
3219
|
+
/* @__PURE__ */ l.jsx($t, { label: i, open: !0, children: /* @__PURE__ */ l.jsx(l.Fragment, { children: t && /* @__PURE__ */ l.jsx(Ya, { child: n, three: e.three }) }) }),
|
3220
|
+
/* @__PURE__ */ l.jsx(vi, { three: e.three })
|
3188
3221
|
] }, "SidePanel");
|
3189
3222
|
}
|
3190
|
-
function
|
3223
|
+
function Ui(e) {
|
3191
3224
|
function n() {
|
3192
3225
|
return e.three.scene === void 0 ? (console.log("No scene:", e.three), !1) : !0;
|
3193
3226
|
}
|
3194
|
-
const a = (
|
3227
|
+
const a = (o) => {
|
3195
3228
|
if (!n())
|
3196
3229
|
return;
|
3197
|
-
const
|
3198
|
-
|
3199
|
-
}, t = (
|
3230
|
+
const d = e.three.scene?.getObjectByProperty("uuid", o.value);
|
3231
|
+
d !== void 0 && e.three.setObject(d);
|
3232
|
+
}, t = (o, d, h) => {
|
3200
3233
|
if (!n())
|
3201
3234
|
return;
|
3202
|
-
const f = e.three.scene?.getObjectByProperty("uuid",
|
3203
|
-
f !== void 0 &&
|
3204
|
-
}, i = (
|
3235
|
+
const f = e.three.scene?.getObjectByProperty("uuid", o);
|
3236
|
+
f !== void 0 && V(f, d, h);
|
3237
|
+
}, i = (o) => {
|
3205
3238
|
if (!n())
|
3206
3239
|
return;
|
3207
|
-
const
|
3208
|
-
t(m,
|
3209
|
-
},
|
3240
|
+
const d = o.value, { key: h, value: f, uuid: m } = d;
|
3241
|
+
t(m, h, f);
|
3242
|
+
}, c = (o) => {
|
3210
3243
|
if (!n())
|
3211
3244
|
return;
|
3212
|
-
const
|
3213
|
-
Ln(
|
3214
|
-
t(
|
3245
|
+
const d = o.value;
|
3246
|
+
Ln(d.value).then((h) => {
|
3247
|
+
t(d.uuid, d.key, h), t(d.uuid, "material.needsUpdate", !0);
|
3215
3248
|
});
|
3216
|
-
}, u = (
|
3249
|
+
}, u = (o) => {
|
3217
3250
|
if (!n())
|
3218
3251
|
return;
|
3219
|
-
const { key:
|
3252
|
+
const { key: d, uuid: h, value: f, subitem: m } = o.value, x = e.three.scene?.getObjectByProperty("uuid", h);
|
3220
3253
|
if (x !== void 0)
|
3221
3254
|
try {
|
3222
|
-
m !== void 0 ?
|
3223
|
-
} catch (
|
3224
|
-
console.log("Error requesting method:"), console.log(
|
3255
|
+
m !== void 0 ? Na(x, m)[d](f) : x[d](f);
|
3256
|
+
} catch (T) {
|
3257
|
+
console.log("Error requesting method:"), console.log(T), console.log(d), console.log(f);
|
3225
3258
|
}
|
3226
3259
|
};
|
3227
|
-
return
|
3228
|
-
|
3260
|
+
return Ae(() => (j.addEventListener(A.GET_OBJECT, a), j.addEventListener(A.UPDATE_OBJECT, i), j.addEventListener(A.CREATE_TEXTURE, c), j.addEventListener(A.REQUEST_METHOD, u), () => {
|
3261
|
+
j.removeEventListener(A.GET_OBJECT, a), j.removeEventListener(A.UPDATE_OBJECT, i), j.removeEventListener(A.CREATE_TEXTURE, c), j.removeEventListener(A.REQUEST_METHOD, u);
|
3229
3262
|
}), []), null;
|
3230
3263
|
}
|
3231
|
-
class
|
3264
|
+
class bi extends oa {
|
3232
3265
|
constructor(n, a) {
|
3233
3266
|
const t = [1, 1, 0, -1, 1, 0, -1, -1, 0, 1, -1, 0, 1, 1, 0], i = new Yt();
|
3234
|
-
i.setAttribute("position", new
|
3235
|
-
const
|
3236
|
-
super(i,
|
3237
|
-
const u = [1, 1, 0, -1, 1, 0, -1, -1, 0, 1, 1, 0, -1, -1, 0, 1, -1, 0],
|
3238
|
-
|
3267
|
+
i.setAttribute("position", new Vt(t, 3)), i.computeBoundingSphere();
|
3268
|
+
const c = new ca({ fog: !1 });
|
3269
|
+
super(i, c), this.light = n, this.color = a, this.type = "RectAreaLightHelper";
|
3270
|
+
const u = [1, 1, 0, -1, 1, 0, -1, -1, 0, 1, 1, 0, -1, -1, 0, 1, -1, 0], o = new Yt();
|
3271
|
+
o.setAttribute("position", new Vt(u, 3)), o.computeBoundingSphere(), this.add(new Pn(o, new kn({ side: mn, fog: !1 })));
|
3239
3272
|
}
|
3240
3273
|
updateMatrixWorld() {
|
3241
3274
|
if (this.scale.set(0.5 * this.light.width, 0.5 * this.light.height, 1), this.color !== void 0)
|
@@ -3251,13 +3284,13 @@ class vi extends sa {
|
|
3251
3284
|
this.geometry.dispose(), this.material.dispose(), this.children[0].geometry.dispose(), this.children[0].material.dispose();
|
3252
3285
|
}
|
3253
3286
|
}
|
3254
|
-
const
|
3255
|
-
class
|
3287
|
+
const cn = { type: "change" }, At = { type: "start" }, ln = { type: "end" }, Et = new la(), un = new ua(), yi = Math.cos(70 * da.DEG2RAD);
|
3288
|
+
class xi extends hn {
|
3256
3289
|
constructor(n, a) {
|
3257
3290
|
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() {
|
3258
|
-
return
|
3291
|
+
return o.phi;
|
3259
3292
|
}, this.getAzimuthalAngle = function() {
|
3260
|
-
return
|
3293
|
+
return o.theta;
|
3261
3294
|
}, this.getDistance = function() {
|
3262
3295
|
return this.object.position.distanceTo(this.target);
|
3263
3296
|
}, this.listenToKeyEvents = function(s) {
|
@@ -3267,46 +3300,46 @@ class yi extends dn {
|
|
3267
3300
|
}, this.saveState = function() {
|
3268
3301
|
t.target0.copy(t.target), t.position0.copy(t.object.position), t.zoom0 = t.object.zoom;
|
3269
3302
|
}, this.reset = function() {
|
3270
|
-
t.target.copy(t.target0), t.object.position.copy(t.position0), t.object.zoom = t.zoom0, t.object.updateProjectionMatrix(), t.dispatchEvent(
|
3303
|
+
t.target.copy(t.target0), t.object.position.copy(t.position0), t.object.zoom = t.zoom0, t.object.updateProjectionMatrix(), t.dispatchEvent(cn), t.update(), c = i.NONE;
|
3271
3304
|
}, this.update = function() {
|
3272
|
-
const s = new Y(), y = new
|
3305
|
+
const s = new Y(), y = new qt().setFromUnitVectors(n.up, new Y(0, 1, 0)), _ = y.clone().invert(), D = new Y(), ee = new qt(), ye = new Y(), de = 2 * Math.PI;
|
3273
3306
|
return function(bt = null) {
|
3274
3307
|
const yt = t.object.position;
|
3275
|
-
s.copy(yt).sub(t.target), s.applyQuaternion(y),
|
3308
|
+
s.copy(yt).sub(t.target), s.applyQuaternion(y), o.setFromVector3(s), t.autoRotate && c === i.NONE && ve(Te(bt)), t.enableDamping ? (o.theta += d.theta * t.dampingFactor, o.phi += d.phi * t.dampingFactor) : (o.theta += d.theta, o.phi += d.phi);
|
3276
3309
|
let xe = t.minAzimuthAngle, Ee = t.maxAzimuthAngle;
|
3277
|
-
isFinite(xe) && isFinite(Ee) && (xe < -Math.PI ? xe += de : xe > Math.PI && (xe -= de), Ee < -Math.PI ? Ee += de : Ee > Math.PI && (Ee -= de), xe <= Ee ?
|
3278
|
-
let
|
3310
|
+
isFinite(xe) && isFinite(Ee) && (xe < -Math.PI ? xe += de : xe > Math.PI && (xe -= de), Ee < -Math.PI ? Ee += de : Ee > Math.PI && (Ee -= de), xe <= Ee ? o.theta = Math.max(xe, Math.min(Ee, o.theta)) : o.theta = o.theta > (xe + Ee) / 2 ? Math.max(xe, o.theta) : Math.min(Ee, o.theta)), o.phi = Math.max(t.minPolarAngle, Math.min(t.maxPolarAngle, o.phi)), o.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
|
+
let Ve = !1;
|
3279
3312
|
if (t.zoomToCursor && Se || t.object.isOrthographicCamera)
|
3280
|
-
|
3313
|
+
o.radius = ke(o.radius);
|
3281
3314
|
else {
|
3282
|
-
const Oe =
|
3283
|
-
|
3315
|
+
const Oe = o.radius;
|
3316
|
+
o.radius = ke(o.radius * h), Ve = Oe != o.radius;
|
3284
3317
|
}
|
3285
|
-
if (s.setFromSpherical(
|
3318
|
+
if (s.setFromSpherical(o), s.applyQuaternion(_), yt.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) {
|
3286
3319
|
let Oe = null;
|
3287
3320
|
if (t.object.isPerspectiveCamera) {
|
3288
|
-
const
|
3289
|
-
Oe = ke(
|
3290
|
-
const et =
|
3291
|
-
t.object.position.addScaledVector(
|
3321
|
+
const ze = s.length();
|
3322
|
+
Oe = ke(ze * h);
|
3323
|
+
const et = ze - Oe;
|
3324
|
+
t.object.position.addScaledVector(q, et), t.object.updateMatrixWorld(), Ve = !!et;
|
3292
3325
|
} else if (t.object.isOrthographicCamera) {
|
3293
|
-
const
|
3294
|
-
|
3326
|
+
const ze = new Y(ne.x, ne.y, 0);
|
3327
|
+
ze.unproject(t.object);
|
3295
3328
|
const et = t.object.zoom;
|
3296
|
-
t.object.zoom = Math.max(t.minZoom, Math.min(t.maxZoom, t.object.zoom /
|
3329
|
+
t.object.zoom = Math.max(t.minZoom, Math.min(t.maxZoom, t.object.zoom / h)), t.object.updateProjectionMatrix(), Ve = et !== t.object.zoom;
|
3297
3330
|
const xt = new Y(ne.x, ne.y, 0);
|
3298
|
-
xt.unproject(t.object), t.object.position.sub(xt).add(
|
3331
|
+
xt.unproject(t.object), t.object.position.sub(xt).add(ze), t.object.updateMatrixWorld(), Oe = s.length();
|
3299
3332
|
} else
|
3300
3333
|
console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), t.zoomToCursor = !1;
|
3301
|
-
Oe !== null && (this.screenSpacePanning ? t.target.set(0, 0, -1).transformDirection(t.object.matrix).multiplyScalar(Oe).add(t.object.position) : (Et.origin.copy(t.object.position), Et.direction.set(0, 0, -1).transformDirection(t.object.matrix), Math.abs(t.object.up.dot(Et.direction)) <
|
3334
|
+
Oe !== null && (this.screenSpacePanning ? t.target.set(0, 0, -1).transformDirection(t.object.matrix).multiplyScalar(Oe).add(t.object.position) : (Et.origin.copy(t.object.position), Et.direction.set(0, 0, -1).transformDirection(t.object.matrix), Math.abs(t.object.up.dot(Et.direction)) < yi ? n.lookAt(t.target) : (un.setFromNormalAndCoplanarPoint(t.object.up, t.target), Et.intersectPlane(un, t.target))));
|
3302
3335
|
} else if (t.object.isOrthographicCamera) {
|
3303
3336
|
const Oe = t.object.zoom;
|
3304
|
-
t.object.zoom = Math.max(t.minZoom, Math.min(t.maxZoom, t.object.zoom /
|
3337
|
+
t.object.zoom = Math.max(t.minZoom, Math.min(t.maxZoom, t.object.zoom / h)), Oe !== t.object.zoom && (t.object.updateProjectionMatrix(), Ve = !0);
|
3305
3338
|
}
|
3306
|
-
return
|
3339
|
+
return h = 1, Se = !1, Ve || D.distanceToSquared(t.object.position) > u || 8 * (1 - ee.dot(t.object.quaternion)) > u || ye.distanceToSquared(t.target) > u ? (t.dispatchEvent(cn), D.copy(t.object.position), ee.copy(t.object.quaternion), ye.copy(t.target), !0) : !1;
|
3307
3340
|
};
|
3308
3341
|
}(), this.dispose = function() {
|
3309
|
-
t.domElement.removeEventListener("contextmenu", Qe), t.domElement.removeEventListener("pointerdown",
|
3342
|
+
t.domElement.removeEventListener("contextmenu", Qe), t.domElement.removeEventListener("pointerdown", O), t.domElement.removeEventListener("pointercancel", G), t.domElement.removeEventListener("wheel", mt), t.domElement.removeEventListener("pointermove", B), t.domElement.removeEventListener("pointerup", G), t.domElement.getRootNode().removeEventListener("keydown", st, { capture: !0 }), t._domElementKeyEvents !== null && (t._domElementKeyEvents.removeEventListener("keydown", ot), t._domElementKeyEvents = null);
|
3310
3343
|
};
|
3311
3344
|
const t = this, i = {
|
3312
3345
|
NONE: -1,
|
@@ -3318,96 +3351,96 @@ class yi extends dn {
|
|
3318
3351
|
TOUCH_DOLLY_PAN: 5,
|
3319
3352
|
TOUCH_DOLLY_ROTATE: 6
|
3320
3353
|
};
|
3321
|
-
let
|
3322
|
-
const u = 1e-6,
|
3323
|
-
let
|
3324
|
-
const f = new Y(), m = new fe(), x = new fe(),
|
3354
|
+
let c = i.NONE;
|
3355
|
+
const u = 1e-6, o = new Kt(), d = new Kt();
|
3356
|
+
let h = 1;
|
3357
|
+
const f = new Y(), m = new fe(), x = new fe(), T = new fe(), W = new fe(), te = new fe(), me = new fe(), re = new fe(), $ = new fe(), I = new fe(), q = new Y(), ne = new fe();
|
3325
3358
|
let Se = !1;
|
3326
|
-
const
|
3327
|
-
let
|
3328
|
-
function
|
3359
|
+
const z = [], pe = {};
|
3360
|
+
let ce = !1;
|
3361
|
+
function Te(s) {
|
3329
3362
|
return s !== null ? 2 * Math.PI / 60 * t.autoRotateSpeed * s : 2 * Math.PI / 60 / 60 * t.autoRotateSpeed;
|
3330
3363
|
}
|
3331
|
-
function
|
3364
|
+
function _e(s) {
|
3332
3365
|
const y = Math.abs(s * 0.01);
|
3333
3366
|
return Math.pow(0.95, t.zoomSpeed * y);
|
3334
3367
|
}
|
3335
3368
|
function ve(s) {
|
3336
|
-
|
3369
|
+
d.theta -= s;
|
3337
3370
|
}
|
3338
|
-
function
|
3339
|
-
|
3371
|
+
function N(s) {
|
3372
|
+
d.phi -= s;
|
3340
3373
|
}
|
3341
3374
|
const be = function() {
|
3342
3375
|
const s = new Y();
|
3343
|
-
return function(
|
3344
|
-
s.setFromMatrixColumn(
|
3376
|
+
return function(_, D) {
|
3377
|
+
s.setFromMatrixColumn(D, 0), s.multiplyScalar(-_), f.add(s);
|
3345
3378
|
};
|
3346
|
-
}(),
|
3379
|
+
}(), w = function() {
|
3347
3380
|
const s = new Y();
|
3348
|
-
return function(
|
3349
|
-
t.screenSpacePanning === !0 ? s.setFromMatrixColumn(
|
3381
|
+
return function(_, D) {
|
3382
|
+
t.screenSpacePanning === !0 ? s.setFromMatrixColumn(D, 1) : (s.setFromMatrixColumn(D, 0), s.crossVectors(t.object.up, s)), s.multiplyScalar(_), f.add(s);
|
3350
3383
|
};
|
3351
3384
|
}(), we = function() {
|
3352
3385
|
const s = new Y();
|
3353
|
-
return function(
|
3386
|
+
return function(_, D) {
|
3354
3387
|
const ee = t.domElement;
|
3355
3388
|
if (t.object.isPerspectiveCamera) {
|
3356
3389
|
const ye = t.object.position;
|
3357
3390
|
s.copy(ye).sub(t.target);
|
3358
3391
|
let de = s.length();
|
3359
|
-
de *= Math.tan(t.object.fov / 2 * Math.PI / 180), be(2 *
|
3392
|
+
de *= Math.tan(t.object.fov / 2 * Math.PI / 180), be(2 * _ * de / ee.clientHeight, t.object.matrix), w(2 * D * de / ee.clientHeight, t.object.matrix);
|
3360
3393
|
} else
|
3361
|
-
t.object.isOrthographicCamera ? (be(
|
3394
|
+
t.object.isOrthographicCamera ? (be(_ * (t.object.right - t.object.left) / t.object.zoom / ee.clientWidth, t.object.matrix), w(D * (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);
|
3362
3395
|
};
|
3363
3396
|
}();
|
3364
3397
|
function Re(s) {
|
3365
|
-
t.object.isPerspectiveCamera || t.object.isOrthographicCamera ?
|
3398
|
+
t.object.isPerspectiveCamera || t.object.isOrthographicCamera ? h /= s : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), t.enableZoom = !1);
|
3366
3399
|
}
|
3367
|
-
function
|
3368
|
-
t.object.isPerspectiveCamera || t.object.isOrthographicCamera ?
|
3400
|
+
function De(s) {
|
3401
|
+
t.object.isPerspectiveCamera || t.object.isOrthographicCamera ? h *= s : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), t.enableZoom = !1);
|
3369
3402
|
}
|
3370
|
-
function
|
3403
|
+
function Pe(s, y) {
|
3371
3404
|
if (!t.zoomToCursor)
|
3372
3405
|
return;
|
3373
3406
|
Se = !0;
|
3374
|
-
const
|
3375
|
-
ne.x =
|
3407
|
+
const _ = t.domElement.getBoundingClientRect(), D = s - _.left, ee = y - _.top, ye = _.width, de = _.height;
|
3408
|
+
ne.x = D / ye * 2 - 1, ne.y = -(ee / de) * 2 + 1, q.set(ne.x, ne.y, 1).unproject(t.object).sub(t.object.position).normalize();
|
3376
3409
|
}
|
3377
3410
|
function ke(s) {
|
3378
3411
|
return Math.max(t.minDistance, Math.min(t.maxDistance, s));
|
3379
3412
|
}
|
3380
|
-
function
|
3413
|
+
function Ie(s) {
|
3381
3414
|
m.set(s.clientX, s.clientY);
|
3382
3415
|
}
|
3383
|
-
function Fe(s) {
|
3384
|
-
Ae(s.clientX, s.clientX), re.set(s.clientX, s.clientY);
|
3385
|
-
}
|
3386
3416
|
function Be(s) {
|
3387
|
-
|
3417
|
+
Pe(s.clientX, s.clientX), re.set(s.clientX, s.clientY);
|
3418
|
+
}
|
3419
|
+
function Fe(s) {
|
3420
|
+
W.set(s.clientX, s.clientY);
|
3388
3421
|
}
|
3389
3422
|
function ae(s) {
|
3390
|
-
x.set(s.clientX, s.clientY),
|
3423
|
+
x.set(s.clientX, s.clientY), T.subVectors(x, m).multiplyScalar(t.rotateSpeed);
|
3391
3424
|
const y = t.domElement;
|
3392
|
-
ve(2 * Math.PI *
|
3425
|
+
ve(2 * Math.PI * T.x / y.clientHeight), N(2 * Math.PI * T.y / y.clientHeight), m.copy(x), t.update();
|
3393
3426
|
}
|
3394
3427
|
function Me(s) {
|
3395
|
-
$.set(s.clientX, s.clientY),
|
3428
|
+
$.set(s.clientX, s.clientY), I.subVectors($, re), I.y > 0 ? Re(_e(I.y)) : I.y < 0 && De(_e(I.y)), re.copy($), t.update();
|
3396
3429
|
}
|
3397
|
-
function
|
3398
|
-
te.set(s.clientX, s.clientY), me.subVectors(te,
|
3430
|
+
function He(s) {
|
3431
|
+
te.set(s.clientX, s.clientY), me.subVectors(te, W).multiplyScalar(t.panSpeed), we(me.x, me.y), W.copy(te), t.update();
|
3399
3432
|
}
|
3400
|
-
function
|
3401
|
-
|
3433
|
+
function Ye(s) {
|
3434
|
+
Pe(s.clientX, s.clientY), s.deltaY < 0 ? De(_e(s.deltaY)) : s.deltaY > 0 && Re(_e(s.deltaY)), t.update();
|
3402
3435
|
}
|
3403
3436
|
function ue(s) {
|
3404
3437
|
let y = !1;
|
3405
3438
|
switch (s.code) {
|
3406
3439
|
case t.keys.UP:
|
3407
|
-
s.ctrlKey || s.metaKey || s.shiftKey ?
|
3440
|
+
s.ctrlKey || s.metaKey || s.shiftKey ? N(2 * Math.PI * t.rotateSpeed / t.domElement.clientHeight) : we(0, t.keyPanSpeed), y = !0;
|
3408
3441
|
break;
|
3409
3442
|
case t.keys.BOTTOM:
|
3410
|
-
s.ctrlKey || s.metaKey || s.shiftKey ?
|
3443
|
+
s.ctrlKey || s.metaKey || s.shiftKey ? N(-2 * Math.PI * t.rotateSpeed / t.domElement.clientHeight) : we(0, -t.keyPanSpeed), y = !0;
|
3411
3444
|
break;
|
3412
3445
|
case t.keys.LEFT:
|
3413
3446
|
s.ctrlKey || s.metaKey || s.shiftKey ? ve(2 * Math.PI * t.rotateSpeed / t.domElement.clientHeight) : we(t.keyPanSpeed, 0), y = !0;
|
@@ -3419,81 +3452,81 @@ class yi extends dn {
|
|
3419
3452
|
y && (s.preventDefault(), t.update());
|
3420
3453
|
}
|
3421
3454
|
function g(s) {
|
3422
|
-
if (
|
3455
|
+
if (z.length === 1)
|
3423
3456
|
m.set(s.pageX, s.pageY);
|
3424
3457
|
else {
|
3425
|
-
const y = $e(s),
|
3426
|
-
m.set(
|
3458
|
+
const y = $e(s), _ = 0.5 * (s.pageX + y.x), D = 0.5 * (s.pageY + y.y);
|
3459
|
+
m.set(_, D);
|
3427
3460
|
}
|
3428
3461
|
}
|
3429
3462
|
function v(s) {
|
3430
|
-
if (
|
3431
|
-
|
3463
|
+
if (z.length === 1)
|
3464
|
+
W.set(s.pageX, s.pageY);
|
3432
3465
|
else {
|
3433
|
-
const y = $e(s),
|
3434
|
-
|
3466
|
+
const y = $e(s), _ = 0.5 * (s.pageX + y.x), D = 0.5 * (s.pageY + y.y);
|
3467
|
+
W.set(_, D);
|
3435
3468
|
}
|
3436
3469
|
}
|
3437
|
-
function
|
3438
|
-
const y = $e(s),
|
3470
|
+
function M(s) {
|
3471
|
+
const y = $e(s), _ = s.pageX - y.x, D = s.pageY - y.y, ee = Math.sqrt(_ * _ + D * D);
|
3439
3472
|
re.set(0, ee);
|
3440
3473
|
}
|
3441
|
-
function
|
3442
|
-
t.enableZoom &&
|
3474
|
+
function P(s) {
|
3475
|
+
t.enableZoom && M(s), t.enablePan && v(s);
|
3443
3476
|
}
|
3444
3477
|
function ge(s) {
|
3445
|
-
t.enableZoom &&
|
3478
|
+
t.enableZoom && M(s), t.enableRotate && g(s);
|
3446
3479
|
}
|
3447
|
-
function
|
3448
|
-
if (
|
3480
|
+
function le(s) {
|
3481
|
+
if (z.length == 1)
|
3449
3482
|
x.set(s.pageX, s.pageY);
|
3450
3483
|
else {
|
3451
|
-
const
|
3452
|
-
x.set(
|
3484
|
+
const _ = $e(s), D = 0.5 * (s.pageX + _.x), ee = 0.5 * (s.pageY + _.y);
|
3485
|
+
x.set(D, ee);
|
3453
3486
|
}
|
3454
|
-
|
3487
|
+
T.subVectors(x, m).multiplyScalar(t.rotateSpeed);
|
3455
3488
|
const y = t.domElement;
|
3456
|
-
ve(2 * Math.PI *
|
3489
|
+
ve(2 * Math.PI * T.x / y.clientHeight), N(2 * Math.PI * T.y / y.clientHeight), m.copy(x);
|
3457
3490
|
}
|
3458
|
-
function
|
3459
|
-
if (
|
3491
|
+
function C(s) {
|
3492
|
+
if (z.length === 1)
|
3460
3493
|
te.set(s.pageX, s.pageY);
|
3461
3494
|
else {
|
3462
|
-
const y = $e(s),
|
3463
|
-
te.set(
|
3495
|
+
const y = $e(s), _ = 0.5 * (s.pageX + y.x), D = 0.5 * (s.pageY + y.y);
|
3496
|
+
te.set(_, D);
|
3464
3497
|
}
|
3465
|
-
me.subVectors(te,
|
3498
|
+
me.subVectors(te, W).multiplyScalar(t.panSpeed), we(me.x, me.y), W.copy(te);
|
3466
3499
|
}
|
3467
|
-
function
|
3468
|
-
const y = $e(s),
|
3469
|
-
$.set(0, ee),
|
3500
|
+
function E(s) {
|
3501
|
+
const y = $e(s), _ = s.pageX - y.x, D = s.pageY - y.y, ee = Math.sqrt(_ * _ + D * D);
|
3502
|
+
$.set(0, ee), I.set(0, Math.pow($.y / re.y, t.zoomSpeed)), Re(I.y), re.copy($);
|
3470
3503
|
const ye = (s.pageX + y.x) * 0.5, de = (s.pageY + y.y) * 0.5;
|
3471
|
-
|
3504
|
+
Pe(ye, de);
|
3472
3505
|
}
|
3473
|
-
function
|
3474
|
-
t.enableZoom &&
|
3506
|
+
function F(s) {
|
3507
|
+
t.enableZoom && E(s), t.enablePan && C(s);
|
3475
3508
|
}
|
3476
|
-
function
|
3477
|
-
t.enableZoom &&
|
3509
|
+
function J(s) {
|
3510
|
+
t.enableZoom && E(s), t.enableRotate && le(s);
|
3478
3511
|
}
|
3479
|
-
function
|
3480
|
-
t.enabled !== !1 && (
|
3512
|
+
function O(s) {
|
3513
|
+
t.enabled !== !1 && (z.length === 0 && (t.domElement.setPointerCapture(s.pointerId), t.domElement.addEventListener("pointermove", B), t.domElement.addEventListener("pointerup", G)), !Pt(s) && (_t(s), s.pointerType === "touch" ? ct(s) : Ne(s)));
|
3481
3514
|
}
|
3482
3515
|
function B(s) {
|
3483
3516
|
t.enabled !== !1 && (s.pointerType === "touch" ? gt(s) : Je(s));
|
3484
3517
|
}
|
3485
|
-
function
|
3486
|
-
switch (Rt(s),
|
3518
|
+
function G(s) {
|
3519
|
+
switch (Rt(s), z.length) {
|
3487
3520
|
case 0:
|
3488
|
-
t.domElement.releasePointerCapture(s.pointerId), t.domElement.removeEventListener("pointermove", B), t.domElement.removeEventListener("pointerup",
|
3521
|
+
t.domElement.releasePointerCapture(s.pointerId), t.domElement.removeEventListener("pointermove", B), t.domElement.removeEventListener("pointerup", G), t.dispatchEvent(ln), c = i.NONE;
|
3489
3522
|
break;
|
3490
3523
|
case 1:
|
3491
|
-
const y =
|
3492
|
-
ct({ pointerId: y, pageX:
|
3524
|
+
const y = z[0], _ = pe[y];
|
3525
|
+
ct({ pointerId: y, pageX: _.x, pageY: _.y });
|
3493
3526
|
break;
|
3494
3527
|
}
|
3495
3528
|
}
|
3496
|
-
function
|
3529
|
+
function Ne(s) {
|
3497
3530
|
let y;
|
3498
3531
|
switch (s.button) {
|
3499
3532
|
case 0:
|
@@ -3512,37 +3545,37 @@ class yi extends dn {
|
|
3512
3545
|
case nt.DOLLY:
|
3513
3546
|
if (t.enableZoom === !1)
|
3514
3547
|
return;
|
3515
|
-
|
3548
|
+
Be(s), c = i.DOLLY;
|
3516
3549
|
break;
|
3517
3550
|
case nt.ROTATE:
|
3518
3551
|
if (s.ctrlKey || s.metaKey || s.shiftKey) {
|
3519
3552
|
if (t.enablePan === !1)
|
3520
3553
|
return;
|
3521
|
-
|
3554
|
+
Fe(s), c = i.PAN;
|
3522
3555
|
} else {
|
3523
3556
|
if (t.enableRotate === !1)
|
3524
3557
|
return;
|
3525
|
-
|
3558
|
+
Ie(s), c = i.ROTATE;
|
3526
3559
|
}
|
3527
3560
|
break;
|
3528
3561
|
case nt.PAN:
|
3529
3562
|
if (s.ctrlKey || s.metaKey || s.shiftKey) {
|
3530
3563
|
if (t.enableRotate === !1)
|
3531
3564
|
return;
|
3532
|
-
|
3565
|
+
Ie(s), c = i.ROTATE;
|
3533
3566
|
} else {
|
3534
3567
|
if (t.enablePan === !1)
|
3535
3568
|
return;
|
3536
|
-
|
3569
|
+
Fe(s), c = i.PAN;
|
3537
3570
|
}
|
3538
3571
|
break;
|
3539
3572
|
default:
|
3540
|
-
|
3573
|
+
c = i.NONE;
|
3541
3574
|
}
|
3542
|
-
|
3575
|
+
c !== i.NONE && t.dispatchEvent(At);
|
3543
3576
|
}
|
3544
3577
|
function Je(s) {
|
3545
|
-
switch (
|
3578
|
+
switch (c) {
|
3546
3579
|
case i.ROTATE:
|
3547
3580
|
if (t.enableRotate === !1)
|
3548
3581
|
return;
|
@@ -3556,54 +3589,54 @@ class yi extends dn {
|
|
3556
3589
|
case i.PAN:
|
3557
3590
|
if (t.enablePan === !1)
|
3558
3591
|
return;
|
3559
|
-
|
3592
|
+
He(s);
|
3560
3593
|
break;
|
3561
3594
|
}
|
3562
3595
|
}
|
3563
3596
|
function mt(s) {
|
3564
|
-
t.enabled === !1 || t.enableZoom === !1 ||
|
3597
|
+
t.enabled === !1 || t.enableZoom === !1 || c !== i.NONE || (s.preventDefault(), t.dispatchEvent(At), Ye(pt(s)), t.dispatchEvent(ln));
|
3565
3598
|
}
|
3566
3599
|
function pt(s) {
|
3567
|
-
const y = s.deltaMode,
|
3600
|
+
const y = s.deltaMode, _ = {
|
3568
3601
|
clientX: s.clientX,
|
3569
3602
|
clientY: s.clientY,
|
3570
3603
|
deltaY: s.deltaY
|
3571
3604
|
};
|
3572
3605
|
switch (y) {
|
3573
3606
|
case 1:
|
3574
|
-
|
3607
|
+
_.deltaY *= 16;
|
3575
3608
|
break;
|
3576
3609
|
case 2:
|
3577
|
-
|
3610
|
+
_.deltaY *= 100;
|
3578
3611
|
break;
|
3579
3612
|
}
|
3580
|
-
return s.ctrlKey && !
|
3613
|
+
return s.ctrlKey && !ce && (_.deltaY *= 10), _;
|
3581
3614
|
}
|
3582
3615
|
function st(s) {
|
3583
|
-
s.key === "Control" && (
|
3616
|
+
s.key === "Control" && (ce = !0, t.domElement.getRootNode().addEventListener("keyup", Ue, { passive: !0, capture: !0 }));
|
3584
3617
|
}
|
3585
3618
|
function Ue(s) {
|
3586
|
-
s.key === "Control" && (
|
3619
|
+
s.key === "Control" && (ce = !1, t.domElement.getRootNode().removeEventListener("keyup", Ue, { passive: !0, capture: !0 }));
|
3587
3620
|
}
|
3588
3621
|
function ot(s) {
|
3589
3622
|
t.enabled === !1 || t.enablePan === !1 || ue(s);
|
3590
3623
|
}
|
3591
3624
|
function ct(s) {
|
3592
|
-
switch (vt(s),
|
3625
|
+
switch (vt(s), z.length) {
|
3593
3626
|
case 1:
|
3594
3627
|
switch (t.touches.ONE) {
|
3595
3628
|
case at.ROTATE:
|
3596
3629
|
if (t.enableRotate === !1)
|
3597
3630
|
return;
|
3598
|
-
g(s),
|
3631
|
+
g(s), c = i.TOUCH_ROTATE;
|
3599
3632
|
break;
|
3600
3633
|
case at.PAN:
|
3601
3634
|
if (t.enablePan === !1)
|
3602
3635
|
return;
|
3603
|
-
v(s),
|
3636
|
+
v(s), c = i.TOUCH_PAN;
|
3604
3637
|
break;
|
3605
3638
|
default:
|
3606
|
-
|
3639
|
+
c = i.NONE;
|
3607
3640
|
}
|
3608
3641
|
break;
|
3609
3642
|
case 2:
|
@@ -3611,65 +3644,65 @@ class yi extends dn {
|
|
3611
3644
|
case at.DOLLY_PAN:
|
3612
3645
|
if (t.enableZoom === !1 && t.enablePan === !1)
|
3613
3646
|
return;
|
3614
|
-
|
3647
|
+
P(s), c = i.TOUCH_DOLLY_PAN;
|
3615
3648
|
break;
|
3616
3649
|
case at.DOLLY_ROTATE:
|
3617
3650
|
if (t.enableZoom === !1 && t.enableRotate === !1)
|
3618
3651
|
return;
|
3619
|
-
ge(s),
|
3652
|
+
ge(s), c = i.TOUCH_DOLLY_ROTATE;
|
3620
3653
|
break;
|
3621
3654
|
default:
|
3622
|
-
|
3655
|
+
c = i.NONE;
|
3623
3656
|
}
|
3624
3657
|
break;
|
3625
3658
|
default:
|
3626
|
-
|
3659
|
+
c = i.NONE;
|
3627
3660
|
}
|
3628
|
-
|
3661
|
+
c !== i.NONE && t.dispatchEvent(At);
|
3629
3662
|
}
|
3630
3663
|
function gt(s) {
|
3631
|
-
switch (vt(s),
|
3664
|
+
switch (vt(s), c) {
|
3632
3665
|
case i.TOUCH_ROTATE:
|
3633
3666
|
if (t.enableRotate === !1)
|
3634
3667
|
return;
|
3635
|
-
|
3668
|
+
le(s), t.update();
|
3636
3669
|
break;
|
3637
3670
|
case i.TOUCH_PAN:
|
3638
3671
|
if (t.enablePan === !1)
|
3639
3672
|
return;
|
3640
|
-
|
3673
|
+
C(s), t.update();
|
3641
3674
|
break;
|
3642
3675
|
case i.TOUCH_DOLLY_PAN:
|
3643
3676
|
if (t.enableZoom === !1 && t.enablePan === !1)
|
3644
3677
|
return;
|
3645
|
-
|
3678
|
+
F(s), t.update();
|
3646
3679
|
break;
|
3647
3680
|
case i.TOUCH_DOLLY_ROTATE:
|
3648
3681
|
if (t.enableZoom === !1 && t.enableRotate === !1)
|
3649
3682
|
return;
|
3650
|
-
|
3683
|
+
J(s), t.update();
|
3651
3684
|
break;
|
3652
3685
|
default:
|
3653
|
-
|
3686
|
+
c = i.NONE;
|
3654
3687
|
}
|
3655
3688
|
}
|
3656
3689
|
function Qe(s) {
|
3657
3690
|
t.enabled !== !1 && s.preventDefault();
|
3658
3691
|
}
|
3659
|
-
function
|
3660
|
-
|
3692
|
+
function _t(s) {
|
3693
|
+
z.push(s.pointerId);
|
3661
3694
|
}
|
3662
3695
|
function Rt(s) {
|
3663
3696
|
delete pe[s.pointerId];
|
3664
|
-
for (let y = 0; y <
|
3665
|
-
if (
|
3666
|
-
|
3697
|
+
for (let y = 0; y < z.length; y++)
|
3698
|
+
if (z[y] == s.pointerId) {
|
3699
|
+
z.splice(y, 1);
|
3667
3700
|
return;
|
3668
3701
|
}
|
3669
3702
|
}
|
3670
|
-
function
|
3671
|
-
for (let y = 0; y <
|
3672
|
-
if (
|
3703
|
+
function Pt(s) {
|
3704
|
+
for (let y = 0; y < z.length; y++)
|
3705
|
+
if (z[y] == s.pointerId)
|
3673
3706
|
return !0;
|
3674
3707
|
return !1;
|
3675
3708
|
}
|
@@ -3678,27 +3711,27 @@ class yi extends dn {
|
|
3678
3711
|
y === void 0 && (y = new fe(), pe[s.pointerId] = y), y.set(s.pageX, s.pageY);
|
3679
3712
|
}
|
3680
3713
|
function $e(s) {
|
3681
|
-
const y = s.pointerId ===
|
3714
|
+
const y = s.pointerId === z[0] ? z[1] : z[0];
|
3682
3715
|
return pe[y];
|
3683
3716
|
}
|
3684
|
-
t.domElement.addEventListener("contextmenu", Qe), t.domElement.addEventListener("pointerdown",
|
3717
|
+
t.domElement.addEventListener("contextmenu", Qe), t.domElement.addEventListener("pointerdown", O), t.domElement.addEventListener("pointercancel", G), t.domElement.addEventListener("wheel", mt, { passive: !1 }), t.domElement.getRootNode().addEventListener("keydown", st, { passive: !0, capture: !0 }), this.update();
|
3685
3718
|
}
|
3686
3719
|
}
|
3687
3720
|
function rt(e, n, a, t, i) {
|
3688
3721
|
return t + (e - n) * (i - t) / (a - n);
|
3689
3722
|
}
|
3690
3723
|
const wt = (e) => {
|
3691
|
-
const [n, a] =
|
3724
|
+
const [n, a] = Z(e.options[e.index]), t = () => {
|
3692
3725
|
e.onToggle(!e.open);
|
3693
|
-
}, i = (
|
3694
|
-
|
3726
|
+
}, i = (c) => {
|
3727
|
+
c !== n && (e.onSelect(c), a(c)), e.onToggle(!1);
|
3695
3728
|
};
|
3696
3729
|
return /* @__PURE__ */ l.jsxs("div", { className: `dropdown ${e.up === !0 ? "up" : ""}`, children: [
|
3697
3730
|
/* @__PURE__ */ l.jsx("div", { className: "dropdown-toggle", onClick: t, children: n }),
|
3698
|
-
e.open && /* @__PURE__ */ l.jsx("ul", { className: "dropdown-menu", children: e.options.map((
|
3731
|
+
e.open && /* @__PURE__ */ l.jsx("ul", { className: "dropdown-menu", children: e.options.map((c) => /* @__PURE__ */ l.jsx("li", { onClick: () => i(c), children: c }, c)) })
|
3699
3732
|
] });
|
3700
|
-
}, qe =
|
3701
|
-
const [t, i] =
|
3733
|
+
}, qe = Ta(function(n, a) {
|
3734
|
+
const [t, i] = Z(!1), c = n.options.indexOf(n.camera.name);
|
3702
3735
|
return /* @__PURE__ */ l.jsxs("div", { className: "CameraWindow", children: [
|
3703
3736
|
/* @__PURE__ */ l.jsx("div", { ref: a, className: "clickable", onClick: () => {
|
3704
3737
|
t && i(!1);
|
@@ -3706,7 +3739,7 @@ const wt = (e) => {
|
|
3706
3739
|
/* @__PURE__ */ l.jsx(
|
3707
3740
|
wt,
|
3708
3741
|
{
|
3709
|
-
index:
|
3742
|
+
index: c,
|
3710
3743
|
open: t,
|
3711
3744
|
options: n.options,
|
3712
3745
|
onSelect: n.onSelect,
|
@@ -3718,15 +3751,15 @@ const wt = (e) => {
|
|
3718
3751
|
)
|
3719
3752
|
] });
|
3720
3753
|
});
|
3721
|
-
class
|
3754
|
+
class Ei extends jn {
|
3722
3755
|
constructor(n) {
|
3723
3756
|
super({
|
3724
3757
|
extensions: {
|
3725
3758
|
// @ts-ignore
|
3726
3759
|
derivatives: !0
|
3727
3760
|
},
|
3728
|
-
glslVersion:
|
3729
|
-
side:
|
3761
|
+
glslVersion: ha,
|
3762
|
+
side: pn,
|
3730
3763
|
transparent: !0,
|
3731
3764
|
uniforms: {
|
3732
3765
|
uScale: {
|
@@ -3831,17 +3864,17 @@ class xi extends kn {
|
|
3831
3864
|
});
|
3832
3865
|
}
|
3833
3866
|
}
|
3834
|
-
class
|
3867
|
+
class Ci extends Pn {
|
3835
3868
|
gridMaterial;
|
3836
3869
|
constructor() {
|
3837
|
-
const n = new
|
3838
|
-
super(new
|
3870
|
+
const n = new Ei();
|
3871
|
+
super(new fa(2, 2), n), this.gridMaterial = n, this.frustumCulled = !1, this.name = "InfiniteGridHelper", this.position.y = 0.1;
|
3839
3872
|
}
|
3840
3873
|
update() {
|
3841
3874
|
this.gridMaterial.needsUpdate = !0;
|
3842
3875
|
}
|
3843
3876
|
}
|
3844
|
-
const
|
3877
|
+
const Si = `#include <common>
|
3845
3878
|
#include <batching_pars_vertex>
|
3846
3879
|
#include <uv_pars_vertex>
|
3847
3880
|
#include <color_pars_vertex>
|
@@ -3871,7 +3904,7 @@ void main() {
|
|
3871
3904
|
#include <logdepthbuf_vertex>
|
3872
3905
|
#include <clipping_planes_vertex>
|
3873
3906
|
#include <worldpos_vertex>
|
3874
|
-
}`,
|
3907
|
+
}`, wi = `
|
3875
3908
|
#include <common>
|
3876
3909
|
#include <uv_pars_fragment>
|
3877
3910
|
#include <clipping_planes_pars_fragment>
|
@@ -3880,27 +3913,27 @@ void main() {
|
|
3880
3913
|
#include <clipping_planes_fragment>
|
3881
3914
|
gl_FragColor = vec4(vec3(vUv, 0.0), 1.0);
|
3882
3915
|
}`;
|
3883
|
-
class
|
3916
|
+
class Mi extends jn {
|
3884
3917
|
constructor() {
|
3885
3918
|
super({
|
3886
3919
|
defines: {
|
3887
3920
|
USE_UV: ""
|
3888
3921
|
},
|
3889
|
-
vertexShader:
|
3890
|
-
fragmentShader:
|
3922
|
+
vertexShader: Si,
|
3923
|
+
fragmentShader: wi
|
3891
3924
|
});
|
3892
3925
|
}
|
3893
3926
|
}
|
3894
|
-
let Ct = "Renderer",
|
3895
|
-
function
|
3896
|
-
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",
|
3927
|
+
let Ct = "Renderer", je, St = !1, dn = !1, H = null, oe = null, Ge = null, We = null;
|
3928
|
+
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", c = localStorage.getItem(`${n}_blCam`) !== null ? localStorage.getItem(`${n}_blCam`) : "Front", u = localStorage.getItem(`${n}_brCam`) !== null ? localStorage.getItem(`${n}_brCam`) : "Top", o = 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(), []), T = ie(() => new Ci(), []), W = ie(() => new Zt(500), []), te = ie(() => new Zt(100), []), me = ie(() => new ga(), []), re = ie(() => new va(), []), $ = ie(() => new Mi(), []), I = ie(() => new kn({
|
3897
3930
|
opacity: 0.33,
|
3898
3931
|
transparent: !0,
|
3899
3932
|
wireframe: !0
|
3900
3933
|
}), []);
|
3901
|
-
function
|
3902
|
-
const
|
3903
|
-
return
|
3934
|
+
function q(g, v) {
|
3935
|
+
const M = new Xt(-100, 100, 100, -100, 50, 5e3);
|
3936
|
+
return M.name = g, M.position.copy(v), M.lookAt(0, 0, 0), o.set(g, M), M;
|
3904
3937
|
}
|
3905
3938
|
const ne = [
|
3906
3939
|
"Renderer",
|
@@ -3913,266 +3946,270 @@ function Ui(e) {
|
|
3913
3946
|
"Side by Side",
|
3914
3947
|
"Stacked",
|
3915
3948
|
"Quad"
|
3916
|
-
],
|
3917
|
-
localStorage.setItem(`${n}_mode`,
|
3949
|
+
], z = X(null), pe = X(null), ce = X(null), Te = X(null), _e = X(null), ve = X(null), [N, be] = Z(a !== null ? a : "Single"), [w, we] = Z(null), [Re, De] = Z(!1), [Pe, ke] = Z(!1), [Ie, Be] = Z(!1), [, Fe] = Z(Date.now());
|
3950
|
+
localStorage.setItem(`${n}_mode`, N), localStorage.setItem(`${n}_tlCam`, t), localStorage.setItem(`${n}_trCam`, i), localStorage.setItem(`${n}_blCam`, c), localStorage.setItem(`${n}_brCam`, u);
|
3918
3951
|
const ae = (g, v) => {
|
3919
|
-
const
|
3920
|
-
|
3921
|
-
|
3922
|
-
|
3952
|
+
const M = d.get(g.name);
|
3953
|
+
if (M !== void 0 && M.dispose(), d.delete(g.name), g.name === "UI")
|
3954
|
+
return;
|
3955
|
+
const P = new xi(g, v);
|
3956
|
+
switch (P.enableDamping = !0, P.dampingFactor = 0.05, g.name) {
|
3923
3957
|
case "Top":
|
3924
3958
|
case "Bottom":
|
3925
3959
|
case "Left":
|
3926
3960
|
case "Right":
|
3927
3961
|
case "Front":
|
3928
3962
|
case "Back":
|
3929
|
-
|
3963
|
+
P.enableRotate = !1;
|
3930
3964
|
break;
|
3931
3965
|
}
|
3932
|
-
|
3966
|
+
d.set(g.name, P);
|
3933
3967
|
}, Me = (g) => {
|
3934
|
-
const v =
|
3935
|
-
v !== void 0 && (m.remove(v), v.dispose(),
|
3936
|
-
const
|
3937
|
-
|
3938
|
-
},
|
3939
|
-
|
3968
|
+
const v = h.get(g.name);
|
3969
|
+
v !== void 0 && (m.remove(v), v.dispose(), h.delete(g.name));
|
3970
|
+
const M = d.get(g.name);
|
3971
|
+
M !== void 0 && (M.dispose(), d.delete(g.name));
|
3972
|
+
}, He = () => {
|
3973
|
+
d.forEach((g, v) => {
|
3940
3974
|
g.dispose();
|
3941
|
-
const
|
3942
|
-
|
3943
|
-
}),
|
3944
|
-
},
|
3945
|
-
switch (
|
3975
|
+
const M = h.get(v);
|
3976
|
+
M !== void 0 && (m.remove(M), M.dispose()), h.delete(v), d.delete(v);
|
3977
|
+
}), d.clear(), h.clear();
|
3978
|
+
}, Ye = () => {
|
3979
|
+
switch (N) {
|
3946
3980
|
case "Single":
|
3947
|
-
ae(
|
3981
|
+
ae(H, ce.current);
|
3948
3982
|
break;
|
3949
3983
|
case "Side by Side":
|
3950
3984
|
case "Stacked":
|
3951
|
-
ae(
|
3985
|
+
ae(H, ce.current), ae(oe, Te.current);
|
3952
3986
|
break;
|
3953
3987
|
case "Quad":
|
3954
|
-
ae(
|
3988
|
+
ae(H, ce.current), ae(oe, Te.current), ae(Ge, _e.current), ae(We, ve.current);
|
3955
3989
|
break;
|
3956
3990
|
}
|
3957
3991
|
};
|
3958
|
-
|
3959
|
-
const g = new
|
3960
|
-
canvas:
|
3992
|
+
Ae(() => {
|
3993
|
+
const g = new ba({
|
3994
|
+
canvas: z.current,
|
3961
3995
|
stencil: !1
|
3962
3996
|
});
|
3963
3997
|
g.autoClear = !1, g.shadowMap.enabled = !0, g.setPixelRatio(devicePixelRatio), g.setClearColor(0), e.three.renderer = g, we(g);
|
3964
|
-
}, []),
|
3965
|
-
m.name = "Debug Scene", m.uuid = "", x.name = "helpers", m.add(x), x.add(
|
3966
|
-
const g = new kt(60, 1, 50,
|
3967
|
-
g.name = "Debug", g.position.set(500, 500, 500), g.lookAt(0, 0, 0),
|
3968
|
-
}, []),
|
3998
|
+
}, []), Ae(() => {
|
3999
|
+
m.name = "Debug Scene", m.uuid = "", x.name = "helpers", m.add(x), x.add(T), W.name = "axisHelper", x.add(W), te.name = "interactionHelper", x.add(te), te.visible = !1, q("Top", new Y(0, 1e3, 0)), q("Bottom", new Y(0, -1e3, 0)), q("Left", new Y(-1e3, 0, 0)), q("Right", new Y(1e3, 0, 0)), q("Front", new Y(0, 0, 1e3)), q("Back", new Y(0, 0, -1e3)), q("Orthographic", new Y(1e3, 1e3, 1e3)), q("UI", new Y());
|
4000
|
+
const g = new kt(60, 1, 50, 5e3);
|
4001
|
+
g.name = "Debug", g.position.set(500, 500, 500), g.lookAt(0, 0, 0), o.set("Debug", g), H = o.get(localStorage.getItem(`${n}_tlCam`)), oe = o.get(localStorage.getItem(`${n}_trCam`)), Ge = o.get(localStorage.getItem(`${n}_blCam`)), We = o.get(localStorage.getItem(`${n}_brCam`));
|
4002
|
+
}, []), Ae(() => {
|
3969
4003
|
const g = () => {
|
3970
|
-
f.forEach((
|
3971
|
-
x.remove(
|
4004
|
+
f.forEach((C) => {
|
4005
|
+
x.remove(C), C.dispose();
|
3972
4006
|
}), f.clear();
|
3973
4007
|
}, v = () => {
|
3974
|
-
|
3975
|
-
if (
|
4008
|
+
je.traverse((C) => {
|
4009
|
+
if (C.type.search("Light") > -1) {
|
3976
4010
|
let E;
|
3977
|
-
switch (
|
4011
|
+
switch (C.type) {
|
3978
4012
|
case "DirectionalLight":
|
3979
|
-
E = new
|
4013
|
+
E = new wa(C, 100), E.name = `${C.name}Helper`, f.set(C.name, E), x.add(E);
|
3980
4014
|
break;
|
3981
4015
|
case "HemisphereLight":
|
3982
|
-
E = new
|
4016
|
+
E = new Sa(C, 250), E.name = `${C.name}Helper`, f.set(C.name, E), x.add(E);
|
3983
4017
|
break;
|
3984
4018
|
case "RectAreaLight":
|
3985
|
-
E = new
|
4019
|
+
E = new bi(C), E.name = `${C.name}Helper`, f.set(C.name, E), x.add(E);
|
3986
4020
|
break;
|
3987
4021
|
case "PointLight":
|
3988
|
-
E = new
|
4022
|
+
E = new Ca(C, 100), E.name = `${C.name}Helper`, f.set(C.name, E), x.add(E);
|
3989
4023
|
break;
|
3990
4024
|
case "SpotLight":
|
3991
|
-
E = new
|
4025
|
+
E = new Ea(C), E.name = `${C.name}Helper`, f.set(C.name, E), x.add(E);
|
3992
4026
|
break;
|
3993
4027
|
}
|
3994
4028
|
}
|
3995
4029
|
});
|
3996
|
-
},
|
3997
|
-
g(),
|
3998
|
-
const E = e.scenes.get(
|
4030
|
+
}, M = (C) => {
|
4031
|
+
x.add(W), g(), Ft(je), m.remove(je);
|
4032
|
+
const E = e.scenes.get(C.value.name);
|
3999
4033
|
if (E !== void 0) {
|
4000
|
-
const
|
4001
|
-
e.onSceneSet !== void 0 && e.onSceneSet(
|
4034
|
+
const F = new E();
|
4035
|
+
e.onSceneSet !== void 0 && e.onSceneSet(F), je = F, e.three.scene = je, m.add(je), dn = !0, v();
|
4002
4036
|
}
|
4003
|
-
},
|
4004
|
-
const E =
|
4005
|
-
if (
|
4006
|
-
const
|
4007
|
-
|
4037
|
+
}, P = (C) => {
|
4038
|
+
const E = C.value, F = e.three.scene?.getObjectByProperty("uuid", E.uuid);
|
4039
|
+
if (F !== void 0 && o.set(E.name, F), F instanceof kt) {
|
4040
|
+
const J = new xa(F);
|
4041
|
+
h.set(F.name, J), m.add(J);
|
4008
4042
|
}
|
4009
|
-
|
4010
|
-
}, ge = (
|
4011
|
-
const E =
|
4012
|
-
E !== void 0 && (m.remove(E), E.dispose()),
|
4043
|
+
Fe(Date.now());
|
4044
|
+
}, ge = (C) => {
|
4045
|
+
const E = h.get(C.value.name);
|
4046
|
+
E !== void 0 && (m.remove(E), E.dispose()), o.delete(C.value.name), Fe(Date.now());
|
4047
|
+
}, le = (C) => {
|
4048
|
+
const E = je.getObjectByProperty("uuid", C.value.uuid);
|
4049
|
+
E && E.add(W);
|
4013
4050
|
};
|
4014
|
-
return
|
4015
|
-
|
4051
|
+
return j.addEventListener(A.SET_SCENE, M), j.addEventListener(A.ADD_CAMERA, P), j.addEventListener(A.REMOVE_CAMERA, ge), j.addEventListener(A.SET_OBJECT, le), () => {
|
4052
|
+
j.removeEventListener(A.SET_SCENE, M), j.removeEventListener(A.ADD_CAMERA, P), j.removeEventListener(A.REMOVE_CAMERA, ge), j.removeEventListener(A.SET_OBJECT, le);
|
4016
4053
|
};
|
4017
|
-
}, []),
|
4018
|
-
if (
|
4054
|
+
}, []), Ae(() => {
|
4055
|
+
if (w === null)
|
4019
4056
|
return;
|
4020
|
-
let g = window.innerWidth, v = window.innerHeight,
|
4021
|
-
const
|
4022
|
-
g = window.innerWidth - 300, v = window.innerHeight,
|
4023
|
-
let
|
4024
|
-
switch (
|
4057
|
+
let g = window.innerWidth, v = window.innerHeight, M = Math.floor(g / 2), P = Math.floor(v / 2), ge = -1;
|
4058
|
+
const le = () => {
|
4059
|
+
g = window.innerWidth - 300, v = window.innerHeight, M = Math.floor(g / 2), P = Math.floor(v / 2), w.setSize(g, v);
|
4060
|
+
let O = g, B = v;
|
4061
|
+
switch (N) {
|
4025
4062
|
case "Side by Side":
|
4026
|
-
|
4063
|
+
O = M, B = v;
|
4027
4064
|
break;
|
4028
4065
|
case "Stacked":
|
4029
|
-
|
4066
|
+
O = g, B = P;
|
4030
4067
|
break;
|
4031
4068
|
case "Quad":
|
4032
|
-
|
4069
|
+
O = M, B = P;
|
4033
4070
|
break;
|
4034
4071
|
}
|
4035
|
-
|
4036
|
-
|
4072
|
+
o.forEach((G) => {
|
4073
|
+
G instanceof Xt ? (G.left = O / -2, G.right = O / 2, G.top = B / 2, G.bottom = B / -2, G.name === "UI" && (G.position.x = g / 2, G.position.y = v / -2, G.position.z = 100), G.updateProjectionMatrix()) : G instanceof kt && (G.aspect = O / B, G.updateProjectionMatrix(), h.get(G.name)?.update());
|
4037
4074
|
});
|
4075
|
+
}, C = () => {
|
4076
|
+
w.setViewport(0, 0, g, v), w.setScissor(0, 0, g, v), w.render(m, H);
|
4038
4077
|
}, E = () => {
|
4039
|
-
|
4040
|
-
|
4041
|
-
if (I === "Side by Side")
|
4042
|
-
S.setViewport(0, 0, w, v), S.setScissor(0, 0, w, v), S.render(m, z), S.setViewport(w, 0, w, v), S.setScissor(w, 0, w, v), S.render(m, ce);
|
4078
|
+
if (N === "Side by Side")
|
4079
|
+
w.setViewport(0, 0, M, v), w.setScissor(0, 0, M, v), w.render(m, H), w.setViewport(M, 0, M, v), w.setScissor(M, 0, M, v), w.render(m, oe);
|
4043
4080
|
else {
|
4044
|
-
const
|
4045
|
-
|
4081
|
+
const O = v - P;
|
4082
|
+
w.setViewport(0, O, g, P), w.setScissor(0, O, g, P), w.render(m, H), w.setViewport(0, 0, g, P), w.setScissor(0, 0, g, P), w.render(m, oe);
|
4046
4083
|
}
|
4047
|
-
},
|
4048
|
-
let
|
4049
|
-
B = v -
|
4050
|
-
},
|
4051
|
-
switch (
|
4052
|
-
|
4053
|
-
}),
|
4054
|
-
|
4055
|
-
}), f.forEach((
|
4056
|
-
|
4057
|
-
}), e.onSceneUpdate !== void 0 &&
|
4084
|
+
}, F = () => {
|
4085
|
+
let O = 0, B = 0;
|
4086
|
+
B = v - P, O = 0, w.setViewport(O, B, M, P), w.setScissor(O, B, M, P), w.render(m, H), O = M, w.setViewport(O, B, M, P), w.setScissor(O, B, M, P), w.render(m, oe), B = 0, O = 0, w.setViewport(O, B, M, P), w.setScissor(O, B, M, P), w.render(m, Ge), O = M, w.setViewport(O, B, M, P), w.setScissor(O, B, M, P), w.render(m, We);
|
4087
|
+
}, J = () => {
|
4088
|
+
switch (d.forEach((O) => {
|
4089
|
+
O.update();
|
4090
|
+
}), h.forEach((O) => {
|
4091
|
+
O.update();
|
4092
|
+
}), f.forEach((O) => {
|
4093
|
+
O.update !== void 0 && O.update();
|
4094
|
+
}), e.onSceneUpdate !== void 0 && dn && e.onSceneUpdate(je), w.clear(), N) {
|
4058
4095
|
case "Single":
|
4059
|
-
|
4096
|
+
C();
|
4060
4097
|
break;
|
4061
4098
|
case "Side by Side":
|
4062
4099
|
case "Stacked":
|
4063
|
-
|
4100
|
+
E();
|
4064
4101
|
break;
|
4065
4102
|
case "Quad":
|
4066
|
-
|
4103
|
+
F();
|
4067
4104
|
break;
|
4068
4105
|
}
|
4069
|
-
ge = requestAnimationFrame(
|
4106
|
+
ge = requestAnimationFrame(J);
|
4070
4107
|
};
|
4071
|
-
return
|
4072
|
-
window.removeEventListener("resize",
|
4108
|
+
return Ye(), window.addEventListener("resize", le), le(), J(), () => {
|
4109
|
+
window.removeEventListener("resize", le), cancelAnimationFrame(ge), ge = -1;
|
4073
4110
|
};
|
4074
|
-
}, [
|
4075
|
-
if (
|
4076
|
-
const g = new
|
4077
|
-
switch (
|
4111
|
+
}, [N, w]), Ae(() => {
|
4112
|
+
if (w !== null) {
|
4113
|
+
const g = new ya(), v = new fe(), M = (C, E, F, J) => {
|
4114
|
+
switch (N) {
|
4078
4115
|
case "Quad":
|
4079
|
-
|
4116
|
+
C < F ? E < J ? g.setFromCamera(v, H) : g.setFromCamera(v, Ge) : E < J ? g.setFromCamera(v, oe) : g.setFromCamera(v, We);
|
4080
4117
|
break;
|
4081
4118
|
case "Side by Side":
|
4082
|
-
|
4119
|
+
C < F ? g.setFromCamera(v, H) : g.setFromCamera(v, oe);
|
4083
4120
|
break;
|
4084
4121
|
case "Single":
|
4085
|
-
g.setFromCamera(v,
|
4122
|
+
g.setFromCamera(v, H);
|
4086
4123
|
break;
|
4087
4124
|
case "Stacked":
|
4088
|
-
|
4125
|
+
E < J ? g.setFromCamera(v, H) : g.setFromCamera(v, oe);
|
4089
4126
|
break;
|
4090
4127
|
}
|
4091
|
-
},
|
4128
|
+
}, P = (C) => {
|
4092
4129
|
if (!St)
|
4093
4130
|
return;
|
4094
|
-
const
|
4095
|
-
|
4096
|
-
const
|
4097
|
-
v.x = rt(
|
4098
|
-
const
|
4099
|
-
|
4100
|
-
},
|
4101
|
-
|
4131
|
+
const E = new fe();
|
4132
|
+
w.getSize(E);
|
4133
|
+
const F = Math.min(C.clientX, E.x), J = Math.min(C.clientY, E.y);
|
4134
|
+
v.x = rt(F, 0, E.x, -1, 1), v.y = rt(J, 0, E.y, 1, -1);
|
4135
|
+
const O = E.x / 2, B = E.y / 2, G = () => {
|
4136
|
+
F < O ? v.x = rt(F, 0, O, -1, 1) : v.x = rt(F, O, E.x, -1, 1);
|
4137
|
+
}, Ne = () => {
|
4138
|
+
J < B ? v.y = rt(J, 0, B, 1, -1) : v.y = rt(J, B, E.y, 1, -1);
|
4102
4139
|
};
|
4103
|
-
switch (
|
4140
|
+
switch (N) {
|
4104
4141
|
case "Quad":
|
4105
|
-
|
4142
|
+
G(), Ne();
|
4106
4143
|
break;
|
4107
4144
|
case "Side by Side":
|
4108
|
-
|
4145
|
+
G();
|
4109
4146
|
break;
|
4110
4147
|
case "Stacked":
|
4111
|
-
|
4148
|
+
Ne(), Ne();
|
4112
4149
|
break;
|
4113
4150
|
}
|
4114
|
-
|
4115
|
-
const Je = g.intersectObjects(
|
4151
|
+
M(F, J, O, B);
|
4152
|
+
const Je = g.intersectObjects(je.children);
|
4116
4153
|
Je.length > 0 && te.position.copy(Je[0].point);
|
4117
|
-
}, ge = (
|
4154
|
+
}, ge = (C) => {
|
4118
4155
|
if (!St)
|
4119
4156
|
return;
|
4120
|
-
const
|
4121
|
-
if (
|
4157
|
+
const E = new fe();
|
4158
|
+
if (w.getSize(E), C.clientX >= E.x)
|
4122
4159
|
return;
|
4123
|
-
|
4124
|
-
const
|
4125
|
-
|
4126
|
-
},
|
4127
|
-
return
|
4128
|
-
|
4160
|
+
P(C);
|
4161
|
+
const F = g.intersectObjects(je.children);
|
4162
|
+
F.length > 0 && e.three.getObject(F[0].object.uuid);
|
4163
|
+
}, le = pe.current;
|
4164
|
+
return le.addEventListener("mousemove", P, !1), le.addEventListener("click", ge, !1), () => {
|
4165
|
+
le.removeEventListener("mousemove", P), le.removeEventListener("click", ge);
|
4129
4166
|
};
|
4130
4167
|
}
|
4131
|
-
}, [
|
4168
|
+
}, [N, w]);
|
4132
4169
|
const ue = [];
|
4133
|
-
return
|
4170
|
+
return o.forEach((g, v) => {
|
4134
4171
|
ue.push(v);
|
4135
4172
|
}), /* @__PURE__ */ l.jsxs("div", { className: "multiview", children: [
|
4136
|
-
/* @__PURE__ */ l.jsx("canvas", { ref:
|
4137
|
-
|
4138
|
-
/* @__PURE__ */ l.jsxs("div", { className: `cameras ${
|
4139
|
-
|
4140
|
-
|
4141
|
-
const v =
|
4142
|
-
v !== void 0 && (Me(
|
4173
|
+
/* @__PURE__ */ l.jsx("canvas", { ref: z }),
|
4174
|
+
w !== null && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
4175
|
+
/* @__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: ue, ref: ce, onSelect: (g) => {
|
4177
|
+
d.get(H.name)?.dispose();
|
4178
|
+
const v = o.get(g);
|
4179
|
+
v !== void 0 && (Me(H), H = v, localStorage.setItem(`${n}_tlCam`, v.name), ae(v, ce.current));
|
4143
4180
|
} }) }),
|
4144
|
-
(
|
4145
|
-
/* @__PURE__ */ l.jsx(qe, { camera:
|
4146
|
-
|
4147
|
-
const v =
|
4148
|
-
v !== void 0 && (Me(
|
4181
|
+
(N === "Side by Side" || N === "Stacked") && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
4182
|
+
/* @__PURE__ */ l.jsx(qe, { camera: H, options: ue, ref: ce, onSelect: (g) => {
|
4183
|
+
d.get(H.name)?.dispose();
|
4184
|
+
const v = o.get(g);
|
4185
|
+
v !== void 0 && (Me(H), H = v, localStorage.setItem(`${n}_tlCam`, v.name), ae(v, ce.current));
|
4149
4186
|
} }),
|
4150
|
-
/* @__PURE__ */ l.jsx(qe, { camera:
|
4151
|
-
|
4152
|
-
const v =
|
4153
|
-
v !== void 0 && (Me(
|
4187
|
+
/* @__PURE__ */ l.jsx(qe, { camera: oe, options: ue, ref: Te, onSelect: (g) => {
|
4188
|
+
d.get(oe.name)?.dispose();
|
4189
|
+
const v = o.get(g);
|
4190
|
+
v !== void 0 && (Me(oe), oe = v, localStorage.setItem(`${n}_trCam`, v.name), ae(v, Te.current));
|
4154
4191
|
} })
|
4155
4192
|
] }),
|
4156
|
-
|
4157
|
-
/* @__PURE__ */ l.jsx(qe, { camera:
|
4158
|
-
|
4159
|
-
const v =
|
4160
|
-
v !== void 0 && (Me(
|
4193
|
+
N === "Quad" && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
4194
|
+
/* @__PURE__ */ l.jsx(qe, { camera: H, options: ue, ref: ce, onSelect: (g) => {
|
4195
|
+
d.get(H.name)?.dispose();
|
4196
|
+
const v = o.get(g);
|
4197
|
+
v !== void 0 && (Me(H), H = v, localStorage.setItem(`${n}_tlCam`, v.name), ae(v, ce.current));
|
4161
4198
|
} }),
|
4162
|
-
/* @__PURE__ */ l.jsx(qe, { camera:
|
4163
|
-
|
4164
|
-
const v =
|
4165
|
-
v !== void 0 && (Me(
|
4199
|
+
/* @__PURE__ */ l.jsx(qe, { camera: oe, options: ue, ref: Te, onSelect: (g) => {
|
4200
|
+
d.get(oe.name)?.dispose();
|
4201
|
+
const v = o.get(g);
|
4202
|
+
v !== void 0 && (Me(oe), oe = v, localStorage.setItem(`${n}_trCam`, v.name), ae(v, Te.current));
|
4166
4203
|
} }),
|
4167
|
-
/* @__PURE__ */ l.jsx(qe, { camera:
|
4168
|
-
|
4169
|
-
const v =
|
4170
|
-
v !== void 0 && (Me(
|
4204
|
+
/* @__PURE__ */ l.jsx(qe, { camera: Ge, options: ue, ref: _e, onSelect: (g) => {
|
4205
|
+
d.get(Ge.name)?.dispose();
|
4206
|
+
const v = o.get(g);
|
4207
|
+
v !== void 0 && (Me(Ge), Ge = v, localStorage.setItem(`${n}_blCam`, v.name), ae(v, _e.current));
|
4171
4208
|
} }),
|
4172
|
-
/* @__PURE__ */ l.jsx(qe, { camera:
|
4173
|
-
|
4174
|
-
const v =
|
4175
|
-
v !== void 0 && (Me(
|
4209
|
+
/* @__PURE__ */ l.jsx(qe, { camera: We, options: ue, ref: ve, onSelect: (g) => {
|
4210
|
+
d.get(We.name)?.dispose();
|
4211
|
+
const v = o.get(g);
|
4212
|
+
v !== void 0 && (Me(We), We = v, localStorage.setItem(`${n}_brCam`, v.name), ae(v, ve.current));
|
4176
4213
|
} })
|
4177
4214
|
] })
|
4178
4215
|
] }),
|
@@ -4180,14 +4217,14 @@ function Ui(e) {
|
|
4180
4217
|
/* @__PURE__ */ l.jsx(
|
4181
4218
|
wt,
|
4182
4219
|
{
|
4183
|
-
index: Se.indexOf(
|
4220
|
+
index: Se.indexOf(N),
|
4184
4221
|
options: Se,
|
4185
4222
|
onSelect: (g) => {
|
4186
|
-
g !==
|
4223
|
+
g !== N && (He(), be(g));
|
4187
4224
|
},
|
4188
4225
|
open: Re,
|
4189
4226
|
onToggle: (g) => {
|
4190
|
-
|
4227
|
+
De(g), Pe && ke(!1), Ie && Be(!1);
|
4191
4228
|
}
|
4192
4229
|
}
|
4193
4230
|
),
|
@@ -4210,16 +4247,16 @@ function Ui(e) {
|
|
4210
4247
|
m.overrideMaterial = null;
|
4211
4248
|
break;
|
4212
4249
|
case "Wireframe":
|
4213
|
-
m.overrideMaterial =
|
4250
|
+
m.overrideMaterial = I;
|
4214
4251
|
break;
|
4215
4252
|
case "UVs":
|
4216
4253
|
m.overrideMaterial = $;
|
4217
4254
|
break;
|
4218
4255
|
}
|
4219
4256
|
},
|
4220
|
-
open:
|
4257
|
+
open: Pe,
|
4221
4258
|
onToggle: (g) => {
|
4222
|
-
Re &&
|
4259
|
+
Re && De(!1), ke(g), Ie && Be(!1);
|
4223
4260
|
}
|
4224
4261
|
}
|
4225
4262
|
),
|
@@ -4234,9 +4271,9 @@ function Ui(e) {
|
|
4234
4271
|
onSelect: (g) => {
|
4235
4272
|
St = g === "Selection Mode", te.visible = St;
|
4236
4273
|
},
|
4237
|
-
open:
|
4274
|
+
open: Ie,
|
4238
4275
|
onToggle: (g) => {
|
4239
|
-
Re &&
|
4276
|
+
Re && De(!1), Pe && ke(!1), Be(g);
|
4240
4277
|
}
|
4241
4278
|
}
|
4242
4279
|
)
|
@@ -4244,7 +4281,7 @@ function Ui(e) {
|
|
4244
4281
|
] })
|
4245
4282
|
] });
|
4246
4283
|
}
|
4247
|
-
function
|
4284
|
+
function zi(e) {
|
4248
4285
|
return /* @__PURE__ */ l.jsxs("div", { className: "editor", ref: e.ref, style: e.style, children: [
|
4249
4286
|
/* @__PURE__ */ l.jsx("div", { className: "header", children: e.header }),
|
4250
4287
|
e.children,
|
@@ -4252,44 +4289,44 @@ function $i(e) {
|
|
4252
4289
|
] });
|
4253
4290
|
}
|
4254
4291
|
export {
|
4255
|
-
|
4256
|
-
|
4292
|
+
$t as Accordion,
|
4293
|
+
Ai as Application,
|
4257
4294
|
Ot as BaseRemote,
|
4258
|
-
|
4295
|
+
Fn as ChildObject,
|
4259
4296
|
Ya as ContainerObject,
|
4260
|
-
|
4261
|
-
|
4262
|
-
|
4297
|
+
Ga as Draggable,
|
4298
|
+
za as DraggableItem,
|
4299
|
+
Wa as Dropdown,
|
4263
4300
|
Ha as DropdownItem,
|
4264
|
-
|
4265
|
-
|
4266
|
-
|
4267
|
-
|
4268
|
-
|
4269
|
-
|
4270
|
-
|
4271
|
-
|
4272
|
-
|
4273
|
-
|
4301
|
+
zi as Editor,
|
4302
|
+
vi as Inspector,
|
4303
|
+
$i as MultiView,
|
4304
|
+
Bn as NavButton,
|
4305
|
+
Di as RemoteComponents,
|
4306
|
+
Bi as RemoteController,
|
4307
|
+
Ut as RemoteTheatre,
|
4308
|
+
Ni as RemoteThree,
|
4309
|
+
Li as RemoteTweakpane,
|
4310
|
+
Ui as SceneInspector,
|
4274
4311
|
Fi as SidePanel,
|
4275
|
-
|
4312
|
+
A as ToolEvents,
|
4276
4313
|
Mt as capitalize,
|
4277
4314
|
Ke as clamp,
|
4278
|
-
|
4279
|
-
|
4280
|
-
|
4281
|
-
|
4282
|
-
|
4283
|
-
|
4284
|
-
|
4285
|
-
|
4286
|
-
|
4287
|
-
|
4288
|
-
|
4289
|
-
|
4315
|
+
Pa as colorToHex,
|
4316
|
+
j as debugDispatcher,
|
4317
|
+
Pi as defaultTheatreCallback,
|
4318
|
+
Ft as dispose,
|
4319
|
+
ja as disposeMaterial,
|
4320
|
+
ji as disposeTexture,
|
4321
|
+
ki as distance,
|
4322
|
+
In as hierarchyUUID,
|
4323
|
+
Ra as isColor,
|
4324
|
+
Qt as mix,
|
4325
|
+
Bt as noop,
|
4326
|
+
Jt as normalize,
|
4290
4327
|
_a as randomID,
|
4291
|
-
|
4292
|
-
|
4293
|
-
|
4328
|
+
ka as resetThreeObjects,
|
4329
|
+
en as round,
|
4330
|
+
Ii as theatreEditorApp,
|
4294
4331
|
Dt as totalThreeObjects
|
4295
4332
|
};
|