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