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