@tomorrowevening/hermes 0.0.12 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hermes.js +1345 -1446
- package/dist/hermes.umd.cjs +15 -15
- package/package.json +3 -2
- package/src/core/Application.ts +1 -1
- package/src/core/RemoteController.ts +4 -158
- package/src/core/remote/RemoteComponents.ts +15 -1
- package/src/core/remote/RemoteTheatre.ts +114 -3
- package/src/core/remote/RemoteThree.ts +37 -0
- package/src/core/remote/RemoteTweakpane.ts +28 -2
- package/src/editor/multiView/MultiView.tsx +16 -4
- package/src/editor/sidePanel/inspector/Inspector.tsx +21 -24
- package/types/core/Application.d.ts +1 -1
- package/types/core/RemoteController.d.ts +1 -1
- package/types/core/remote/RemoteComponents.d.ts +3 -0
- package/types/core/remote/RemoteTheatre.d.ts +3 -0
- package/types/core/remote/RemoteThree.d.ts +4 -0
- package/types/core/remote/RemoteTweakpane.d.ts +2 -0
- package/types/editor/multiView/MultiView.d.ts +4 -0
package/dist/hermes.js
CHANGED
@@ -1,74 +1,74 @@
|
|
1
|
-
var
|
2
|
-
var
|
3
|
-
var
|
4
|
-
import { PositionalAudio as
|
1
|
+
var On = Object.defineProperty;
|
2
|
+
var Tn = (t, n, i) => n in t ? On(t, n, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[n] = i;
|
3
|
+
var q = (t, n, i) => (Tn(t, typeof n != "symbol" ? n + "" : n, i), i);
|
4
|
+
import { PositionalAudio as Mn, EventDispatcher as rn, Texture as an, CubeTexture as Rn, RepeatWrapping as $t, ShaderMaterial as on, GLSL3 as Pn, DoubleSide as jn, Color as It, Mesh as _n, PlaneGeometry as Dn, Matrix4 as kn, Vector3 as G, Euler as An, Ray as In, Plane as Nn, MathUtils as Ln, MOUSE as ze, TOUCH as Ye, Quaternion as Vt, Spherical as Gt, Vector2 as ue, PerspectiveCamera as _t, MeshDepthMaterial as Fn, MeshNormalMaterial as Un, MeshBasicMaterial as Bn, OrthographicCamera as sn, Scene as cn, Group as $n, AxesHelper as ln, WebGLRenderer as Vn, Raycaster as Gn, CameraHelper as zn } from "three";
|
5
5
|
import { getProject as Yn } from "@theatre/core";
|
6
|
+
import "@theatre/studio";
|
6
7
|
import { Pane as Wn } from "tweakpane";
|
7
8
|
import * as Hn from "@tweakpane/plugin-essentials";
|
8
|
-
import
|
9
|
-
import { Reorder as
|
10
|
-
|
11
|
-
|
12
|
-
return Math.min(n, Math.max(t, a));
|
9
|
+
import un, { useState as ae, useRef as we, useEffect as Ne, Component as Kn, forwardRef as Xn } from "react";
|
10
|
+
import { Reorder as dn } from "framer-motion";
|
11
|
+
function Ki(t, n, i) {
|
12
|
+
return Math.min(n, Math.max(t, i));
|
13
13
|
}
|
14
|
-
function
|
15
|
-
const
|
16
|
-
return Math.sqrt(
|
14
|
+
function Xi(t, n) {
|
15
|
+
const i = t - n;
|
16
|
+
return Math.sqrt(i * i);
|
17
17
|
}
|
18
|
-
function
|
18
|
+
function Zn() {
|
19
19
|
return Math.round(Math.random() * 1e6).toString();
|
20
20
|
}
|
21
|
-
function
|
21
|
+
function qn(t) {
|
22
22
|
return t.r !== void 0 && t.g !== void 0 && t.b !== void 0;
|
23
23
|
}
|
24
|
-
function
|
25
|
-
const n = Math.round(t.r * 255),
|
26
|
-
const
|
27
|
-
return
|
28
|
-
}, s =
|
29
|
-
return "#" + s +
|
24
|
+
function Qn(t) {
|
25
|
+
const n = Math.round(t.r * 255), i = Math.round(t.g * 255), e = Math.round(t.b * 255), a = (d) => {
|
26
|
+
const m = d.toString(16);
|
27
|
+
return m.length === 1 ? "0" + m : m;
|
28
|
+
}, s = a(n), h = a(i), l = a(e);
|
29
|
+
return "#" + s + h + l;
|
30
30
|
}
|
31
|
-
function
|
31
|
+
function Mt(t, n = 1) {
|
32
32
|
return Number(t.toFixed(n));
|
33
33
|
}
|
34
|
-
let
|
35
|
-
const
|
36
|
-
|
37
|
-
},
|
34
|
+
let Dt = 0;
|
35
|
+
const Jn = () => {
|
36
|
+
Dt = 0;
|
37
|
+
}, fn = (t) => {
|
38
38
|
if (!t)
|
39
39
|
return;
|
40
40
|
let n = t.name.replace(" ", "");
|
41
|
-
n.length === 0 && (n = `obj_${
|
42
|
-
|
41
|
+
n.length === 0 && (n = `obj_${Dt}`, Dt++), t.parent !== null && (n = `${t.parent.uuid}.${n}`), t.uuid = n, t.children.forEach((i) => {
|
42
|
+
fn(i);
|
43
43
|
});
|
44
|
-
},
|
44
|
+
}, Zi = (t) => {
|
45
45
|
t == null || t.dispose();
|
46
|
-
},
|
46
|
+
}, ei = (t) => {
|
47
47
|
t && (Array.isArray(t) ? t.forEach((n) => n.dispose()) : t.dispose());
|
48
|
-
},
|
48
|
+
}, hn = (t) => {
|
49
49
|
var n;
|
50
50
|
if (t) {
|
51
51
|
for (; t.children.length > 0; ) {
|
52
|
-
const
|
53
|
-
|
52
|
+
const i = t.children[0];
|
53
|
+
i instanceof Mn ? (i.pause(), i.parent && i.parent.remove(i)) : hn(i);
|
54
54
|
}
|
55
55
|
if (t.parent && t.parent.remove(t), t.isMesh) {
|
56
|
-
const
|
57
|
-
(n =
|
56
|
+
const i = t;
|
57
|
+
(n = i.geometry) == null || n.dispose(), ei(i.material);
|
58
58
|
}
|
59
59
|
t.dispose !== void 0 && t.dispose();
|
60
60
|
}
|
61
61
|
};
|
62
|
-
class
|
63
|
-
constructor(n,
|
64
|
-
|
65
|
-
|
62
|
+
class qi {
|
63
|
+
constructor(n, i, e = "editor") {
|
64
|
+
q(this, "channel");
|
65
|
+
q(this, "components", /* @__PURE__ */ new Map());
|
66
66
|
// Protected
|
67
|
-
|
68
|
-
this.editor =
|
67
|
+
q(this, "_mode", "app");
|
68
|
+
this.editor = i && document.location.hash.search(e) > -1, i && (this.channel = new BroadcastChannel(n));
|
69
69
|
}
|
70
|
-
addComponent(n,
|
71
|
-
this.components.set(n,
|
70
|
+
addComponent(n, i) {
|
71
|
+
this.components.set(n, i);
|
72
72
|
}
|
73
73
|
dispose() {
|
74
74
|
this.components.forEach((n) => {
|
@@ -80,8 +80,8 @@ class Za {
|
|
80
80
|
this.channel !== void 0 && this._mode !== n.target && this.channel.postMessage(n);
|
81
81
|
}
|
82
82
|
listen(n) {
|
83
|
-
this.channel !== void 0 && (this.channel.onmessage = (
|
84
|
-
n(
|
83
|
+
this.channel !== void 0 && (this.channel.onmessage = (i) => {
|
84
|
+
n(i.data);
|
85
85
|
});
|
86
86
|
}
|
87
87
|
// Getters / Setters
|
@@ -95,7 +95,7 @@ class Za {
|
|
95
95
|
n && (this._mode = "editor", document.title += " - Editor");
|
96
96
|
}
|
97
97
|
}
|
98
|
-
const
|
98
|
+
const z = new rn(), Y = {
|
99
99
|
CUSTOM: "ToolEvents::custom",
|
100
100
|
// Components
|
101
101
|
SELECT_DROPDOWN: "ToolEvents::selectDropdown",
|
@@ -111,78 +111,78 @@ const k = new nn(), A = {
|
|
111
111
|
ADD_CAMERA: "ToolEvents::addCamera",
|
112
112
|
REMOVE_CAMERA: "ToolEvents::removeCamera"
|
113
113
|
};
|
114
|
-
class
|
114
|
+
class Et {
|
115
115
|
constructor(n) {
|
116
|
-
|
116
|
+
q(this, "app");
|
117
117
|
this.app = n;
|
118
118
|
}
|
119
119
|
dispose() {
|
120
120
|
}
|
121
121
|
}
|
122
|
-
class
|
123
|
-
selectDropdown(n,
|
122
|
+
class Qi extends Et {
|
123
|
+
selectDropdown(n, i) {
|
124
124
|
this.app.send({
|
125
125
|
event: "selectComponent",
|
126
126
|
target: "app",
|
127
127
|
data: {
|
128
128
|
dropdown: n,
|
129
|
-
value:
|
129
|
+
value: i
|
130
130
|
}
|
131
131
|
});
|
132
132
|
}
|
133
|
-
updateDropdown(n,
|
133
|
+
updateDropdown(n, i) {
|
134
134
|
this.app.send({
|
135
135
|
event: "draggableListUpdate",
|
136
136
|
target: "app",
|
137
137
|
data: {
|
138
138
|
dropdown: n,
|
139
|
-
value:
|
139
|
+
value: i
|
140
140
|
}
|
141
141
|
});
|
142
142
|
}
|
143
143
|
}
|
144
|
-
const
|
144
|
+
const pn = () => {
|
145
145
|
};
|
146
|
-
class
|
147
|
-
constructor(
|
148
|
-
super(
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
this.project = Yn(e,
|
146
|
+
class Ji extends Et {
|
147
|
+
constructor(i, e, a) {
|
148
|
+
super(i);
|
149
|
+
q(this, "project");
|
150
|
+
q(this, "sheets");
|
151
|
+
q(this, "sheetObjects");
|
152
|
+
q(this, "sheetObjectCBs");
|
153
|
+
q(this, "sheetObjectUnsubscribe");
|
154
|
+
this.project = Yn(e, a), this.sheets = /* @__PURE__ */ new Map(), this.sheetObjects = /* @__PURE__ */ new Map(), this.sheetObjectCBs = /* @__PURE__ */ new Map(), this.sheetObjectUnsubscribe = /* @__PURE__ */ new Map();
|
155
155
|
}
|
156
156
|
dispose() {
|
157
157
|
this.project = void 0, this.sheets = /* @__PURE__ */ new Map(), this.sheetObjects = /* @__PURE__ */ new Map(), this.sheetObjectCBs = /* @__PURE__ */ new Map(), this.sheetObjectUnsubscribe = /* @__PURE__ */ new Map();
|
158
158
|
}
|
159
|
-
sheet(
|
160
|
-
var
|
159
|
+
sheet(i) {
|
160
|
+
var a;
|
161
161
|
if (this.project === void 0) {
|
162
162
|
console.error("Theatre Project hasn't been created yet.");
|
163
163
|
return;
|
164
164
|
}
|
165
|
-
let e = this.sheets.get(
|
166
|
-
return e !== void 0 || (e = (
|
165
|
+
let e = this.sheets.get(i);
|
166
|
+
return e !== void 0 || (e = (a = this.project) == null ? void 0 : a.sheet(i), this.sheets.set(i, e)), e;
|
167
167
|
}
|
168
|
-
sheetObject(
|
168
|
+
sheetObject(i, e, a, s) {
|
169
169
|
if (this.project === void 0) {
|
170
170
|
console.error("Theatre Project hasn't been created yet.");
|
171
171
|
return;
|
172
172
|
}
|
173
|
-
const
|
174
|
-
if (
|
173
|
+
const h = this.sheets.get(i);
|
174
|
+
if (h === void 0)
|
175
175
|
return;
|
176
|
-
const l = `${
|
176
|
+
const l = `${i}_${e}`;
|
177
177
|
let d = this.sheetObjects.get(l);
|
178
178
|
if (d !== void 0)
|
179
|
-
return d =
|
180
|
-
d =
|
181
|
-
const
|
179
|
+
return d = h.object(e, { ...a, ...d.value }, { reconfigure: !0 }), d;
|
180
|
+
d = h.object(e, a), this.sheetObjects.set(l, d), this.sheetObjectCBs.set(l, s !== void 0 ? s : pn);
|
181
|
+
const m = d.onValuesChange((v) => {
|
182
182
|
if (this.app.editor) {
|
183
|
-
for (const
|
184
|
-
const x =
|
185
|
-
typeof x == "object" &&
|
183
|
+
for (const E in v) {
|
184
|
+
const x = v[E];
|
185
|
+
typeof x == "object" && qn(x) && (v[E] = {
|
186
186
|
r: x.r,
|
187
187
|
g: x.g,
|
188
188
|
b: x.b,
|
@@ -194,26 +194,26 @@ class Qa extends xt {
|
|
194
194
|
target: "app",
|
195
195
|
data: {
|
196
196
|
sheetObject: l,
|
197
|
-
values:
|
197
|
+
values: v
|
198
198
|
}
|
199
199
|
});
|
200
200
|
} else {
|
201
|
-
const
|
202
|
-
|
201
|
+
const E = this.sheetObjectCBs.get(l);
|
202
|
+
E !== void 0 && E(v);
|
203
203
|
}
|
204
204
|
});
|
205
|
-
return this.sheetObjectUnsubscribe.set(l,
|
205
|
+
return this.sheetObjectUnsubscribe.set(l, m), d;
|
206
206
|
}
|
207
|
-
unsubscribe(
|
207
|
+
unsubscribe(i) {
|
208
208
|
if (this.project === void 0) {
|
209
209
|
console.error("Theatre Project hasn't been created yet.");
|
210
210
|
return;
|
211
211
|
}
|
212
|
-
const e = `${
|
213
|
-
|
212
|
+
const e = `${i.address.sheetId}_${i.address.objectKey}`, a = this.sheetObjectUnsubscribe.get(e);
|
213
|
+
a !== void 0 && a();
|
214
214
|
}
|
215
215
|
}
|
216
|
-
function
|
216
|
+
function ti(t) {
|
217
217
|
if (t.name === "cameras")
|
218
218
|
return "camera";
|
219
219
|
if (t.name === "interactive")
|
@@ -227,26 +227,26 @@ function ta(t) {
|
|
227
227
|
const n = t.type;
|
228
228
|
return n.search("Helper") > -1 ? "icon_utils" : n.search("Camera") > -1 ? "camera" : n.search("Light") > -1 ? "light" : "obj3D";
|
229
229
|
}
|
230
|
-
function
|
230
|
+
function mn(t) {
|
231
231
|
const n = {
|
232
232
|
name: t.name,
|
233
233
|
type: t.type,
|
234
234
|
uuid: t.uuid,
|
235
235
|
children: []
|
236
236
|
};
|
237
|
-
return t.children.forEach((
|
238
|
-
n.children.push(
|
237
|
+
return t.children.forEach((i) => {
|
238
|
+
n.children.push(mn(i));
|
239
239
|
}), n;
|
240
240
|
}
|
241
|
-
function
|
241
|
+
function ni(t) {
|
242
242
|
const n = {};
|
243
|
-
for (const
|
244
|
-
const e = t[
|
245
|
-
n[
|
243
|
+
for (const i in t) {
|
244
|
+
const e = t[i].value;
|
245
|
+
n[i] = { value: e }, e === null ? n[i].value = { src: "" } : e.isTexture && (n[i].value = { src: e.image.src });
|
246
246
|
}
|
247
247
|
return n;
|
248
248
|
}
|
249
|
-
function
|
249
|
+
function ii(t) {
|
250
250
|
switch (t) {
|
251
251
|
case "blendSrcAlpha":
|
252
252
|
case "blendDstAlpha":
|
@@ -258,36 +258,36 @@ function aa(t) {
|
|
258
258
|
}
|
259
259
|
return !1;
|
260
260
|
}
|
261
|
-
function
|
261
|
+
function zt(t) {
|
262
262
|
const n = {};
|
263
|
-
for (const
|
264
|
-
if (
|
263
|
+
for (const i in t) {
|
264
|
+
if (i.substring(0, 1) === "_" || i.substring(0, 2) === "is" || ii(i))
|
265
265
|
continue;
|
266
|
-
const e = typeof t[
|
266
|
+
const e = typeof t[i], a = t[i];
|
267
267
|
switch (e) {
|
268
268
|
case "boolean":
|
269
269
|
case "number":
|
270
270
|
case "string":
|
271
|
-
n[
|
271
|
+
n[i] = a;
|
272
272
|
break;
|
273
273
|
case "object":
|
274
|
-
if (
|
275
|
-
if (n[
|
276
|
-
if (
|
277
|
-
const s =
|
278
|
-
n[
|
274
|
+
if (a !== null)
|
275
|
+
if (n[i] = a, a.isTexture)
|
276
|
+
if (a instanceof an) {
|
277
|
+
const s = a.source.toJSON();
|
278
|
+
n[i] = { src: s.url };
|
279
279
|
} else
|
280
|
-
|
280
|
+
a instanceof Rn && (console.log("env map"), console.log(a.source.data), console.log(a.source.toJSON()), n[i] = { src: "" });
|
281
281
|
else
|
282
|
-
|
282
|
+
i === "uniforms" && (n[i] = ni(n[i]));
|
283
283
|
else
|
284
|
-
n[
|
284
|
+
n[i] = { src: "" };
|
285
285
|
break;
|
286
286
|
}
|
287
287
|
}
|
288
288
|
return n;
|
289
289
|
}
|
290
|
-
function
|
290
|
+
function Rt(t) {
|
291
291
|
t.updateMatrix();
|
292
292
|
const n = {
|
293
293
|
name: t.name,
|
@@ -308,18 +308,18 @@ function Pt(t) {
|
|
308
308
|
blendMode: e.blendMode
|
309
309
|
});
|
310
310
|
});
|
311
|
-
const
|
312
|
-
if (
|
311
|
+
const i = t.type.toLowerCase();
|
312
|
+
if (i.search("mesh") > -1) {
|
313
313
|
const e = t;
|
314
314
|
if (Array.isArray(e.material)) {
|
315
|
-
const
|
315
|
+
const a = [];
|
316
316
|
e.material.forEach((s) => {
|
317
|
-
|
318
|
-
}), n.material =
|
317
|
+
a.push(zt(s));
|
318
|
+
}), n.material = a;
|
319
319
|
} else
|
320
|
-
n.material =
|
320
|
+
n.material = zt(e.material);
|
321
321
|
} else
|
322
|
-
|
322
|
+
i.search("camera") > -1 ? t.type === "PerspectiveCamera" ? n.perspectiveCameraInfo = {
|
323
323
|
fov: t.fov,
|
324
324
|
zoom: t.zoom,
|
325
325
|
near: t.near,
|
@@ -336,7 +336,7 @@ function Pt(t) {
|
|
336
336
|
right: t.right,
|
337
337
|
top: t.top,
|
338
338
|
bottom: t.bottom
|
339
|
-
}) :
|
339
|
+
}) : i.search("light") > -1 && (n.lightInfo = {
|
340
340
|
color: t.color,
|
341
341
|
intensity: t.intensity,
|
342
342
|
decay: t.decay,
|
@@ -347,109 +347,109 @@ function Pt(t) {
|
|
347
347
|
});
|
348
348
|
return n;
|
349
349
|
}
|
350
|
-
function
|
350
|
+
function J(t, n, i) {
|
351
351
|
const e = n.split(".");
|
352
352
|
switch (e.length) {
|
353
353
|
case 1:
|
354
|
-
t[e[0]] =
|
354
|
+
t[e[0]] = i;
|
355
355
|
break;
|
356
356
|
case 2:
|
357
|
-
t[e[0]][e[1]] =
|
357
|
+
t[e[0]][e[1]] = i;
|
358
358
|
break;
|
359
359
|
case 3:
|
360
|
-
t[e[0]][e[1]][e[2]] =
|
360
|
+
t[e[0]][e[1]][e[2]] = i;
|
361
361
|
break;
|
362
362
|
case 4:
|
363
|
-
t[e[0]][e[1]][e[2]][e[3]] =
|
363
|
+
t[e[0]][e[1]][e[2]][e[3]] = i;
|
364
364
|
break;
|
365
365
|
case 5:
|
366
|
-
t[e[0]][e[1]][e[2]][e[3]][e[4]] =
|
366
|
+
t[e[0]][e[1]][e[2]][e[3]][e[4]] = i;
|
367
367
|
break;
|
368
368
|
}
|
369
369
|
}
|
370
|
-
function
|
371
|
-
return new Promise((n,
|
370
|
+
function kt(t) {
|
371
|
+
return new Promise((n, i) => {
|
372
372
|
const e = new Image();
|
373
373
|
e.onload = () => {
|
374
|
-
const
|
375
|
-
|
376
|
-
}, e.onerror =
|
374
|
+
const a = new an(e);
|
375
|
+
a.wrapS = $t, a.wrapT = $t, a.needsUpdate = !0, n(a);
|
376
|
+
}, e.onerror = i, e.src = t;
|
377
377
|
});
|
378
378
|
}
|
379
|
-
class
|
379
|
+
class er extends Et {
|
380
380
|
constructor() {
|
381
381
|
super(...arguments);
|
382
|
-
|
382
|
+
q(this, "scene");
|
383
383
|
}
|
384
|
-
getObject(
|
384
|
+
getObject(i) {
|
385
385
|
this.app.send({
|
386
386
|
event: "getObject",
|
387
387
|
target: "app",
|
388
|
-
data:
|
388
|
+
data: i
|
389
389
|
});
|
390
390
|
}
|
391
|
-
setObject(
|
392
|
-
const e =
|
391
|
+
setObject(i) {
|
392
|
+
const e = Rt(i);
|
393
393
|
this.app.send({
|
394
394
|
event: "setObject",
|
395
395
|
target: "editor",
|
396
396
|
data: e
|
397
397
|
});
|
398
398
|
}
|
399
|
-
requestMethod(
|
399
|
+
requestMethod(i, e, a) {
|
400
400
|
this.app.send({
|
401
401
|
event: "requestMethod",
|
402
402
|
target: "app",
|
403
403
|
data: {
|
404
|
-
uuid:
|
404
|
+
uuid: i,
|
405
405
|
key: e,
|
406
|
-
value:
|
406
|
+
value: a
|
407
407
|
}
|
408
408
|
});
|
409
409
|
}
|
410
|
-
updateObject(
|
410
|
+
updateObject(i, e, a) {
|
411
411
|
this.app.send({
|
412
412
|
event: "updateObject",
|
413
413
|
target: "app",
|
414
414
|
data: {
|
415
|
-
uuid:
|
415
|
+
uuid: i,
|
416
416
|
key: e,
|
417
|
-
value:
|
417
|
+
value: a
|
418
418
|
}
|
419
419
|
});
|
420
420
|
}
|
421
|
-
createTexture(
|
421
|
+
createTexture(i, e, a) {
|
422
422
|
this.app.send({
|
423
423
|
event: "createTexture",
|
424
424
|
target: "app",
|
425
425
|
data: {
|
426
|
-
uuid:
|
426
|
+
uuid: i,
|
427
427
|
key: e,
|
428
|
-
value:
|
428
|
+
value: a
|
429
429
|
}
|
430
430
|
});
|
431
431
|
}
|
432
|
-
setScene(
|
433
|
-
if (
|
432
|
+
setScene(i) {
|
433
|
+
if (i === void 0)
|
434
434
|
return;
|
435
|
-
this.scene =
|
436
|
-
const e =
|
435
|
+
this.scene = i, Jn(), fn(this.scene);
|
436
|
+
const e = mn(this.scene);
|
437
437
|
this.app.send({
|
438
438
|
event: "setScene",
|
439
439
|
target: "editor",
|
440
440
|
data: e
|
441
441
|
});
|
442
442
|
}
|
443
|
-
addCamera(
|
444
|
-
const e =
|
443
|
+
addCamera(i) {
|
444
|
+
const e = Rt(i);
|
445
445
|
this.app.send({
|
446
446
|
event: "addCamera",
|
447
447
|
target: "editor",
|
448
448
|
data: e
|
449
449
|
});
|
450
450
|
}
|
451
|
-
removeCamera(
|
452
|
-
const e =
|
451
|
+
removeCamera(i) {
|
452
|
+
const e = Rt(i);
|
453
453
|
this.app.send({
|
454
454
|
event: "removeCamera",
|
455
455
|
target: "editor",
|
@@ -457,37 +457,37 @@ class ei extends xt {
|
|
457
457
|
});
|
458
458
|
}
|
459
459
|
}
|
460
|
-
class
|
461
|
-
constructor(
|
462
|
-
super(
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
this.bindCBs = /* @__PURE__ */ new Map(), this.buttonCBs = /* @__PURE__ */ new Map(),
|
460
|
+
class tr extends Et {
|
461
|
+
constructor(i) {
|
462
|
+
super(i);
|
463
|
+
q(this, "bindCBs");
|
464
|
+
q(this, "buttonCBs");
|
465
|
+
q(this, "pane");
|
466
|
+
q(this, "appCallbacks", 0);
|
467
|
+
q(this, "editorCallbacks", 0);
|
468
|
+
q(this, "inspectorFolder");
|
469
|
+
this.bindCBs = /* @__PURE__ */ new Map(), this.buttonCBs = /* @__PURE__ */ new Map(), i.editor && this.createGUI();
|
470
470
|
}
|
471
471
|
createGUI() {
|
472
472
|
this.pane = new Wn({ title: "GUI" }), this.pane.registerPlugin(Hn);
|
473
473
|
}
|
474
474
|
dispose() {
|
475
|
-
var
|
476
|
-
this.bindCBs.clear(), this.buttonCBs.clear(), this.appCallbacks = 0, this.editorCallbacks = 0, this.app.editor && ((
|
475
|
+
var i;
|
476
|
+
this.bindCBs.clear(), this.buttonCBs.clear(), this.appCallbacks = 0, this.editorCallbacks = 0, this.app.editor && ((i = this.pane) == null || i.dispose(), this.pane = void 0);
|
477
477
|
}
|
478
|
-
addFolder(
|
478
|
+
addFolder(i, e = void 0, a = void 0) {
|
479
479
|
if (this.app.editor)
|
480
|
-
return this.pane === void 0 && this.createGUI(), (
|
481
|
-
title:
|
480
|
+
return this.pane === void 0 && this.createGUI(), (a !== void 0 ? a : this.pane).addFolder({
|
481
|
+
title: i,
|
482
482
|
...e
|
483
483
|
});
|
484
484
|
this.app.send({
|
485
485
|
event: "addFolder",
|
486
486
|
target: "app",
|
487
487
|
data: {
|
488
|
-
name:
|
488
|
+
name: i,
|
489
489
|
params: e,
|
490
|
-
parent:
|
490
|
+
parent: a
|
491
491
|
}
|
492
492
|
});
|
493
493
|
}
|
@@ -495,36 +495,36 @@ class ti extends xt {
|
|
495
495
|
return `debug_${Math.max(this.appCallbacks, this.editorCallbacks)}`;
|
496
496
|
}
|
497
497
|
// Binding
|
498
|
-
bind(
|
499
|
-
const
|
500
|
-
this.bindCBs.set(
|
498
|
+
bind(i, e, a, s = void 0) {
|
499
|
+
const h = this.bindID, l = a.onChange !== void 0 ? a.onChange : pn;
|
500
|
+
this.bindCBs.set(h, l), this.app.editor ? (this.pane === void 0 && this.createGUI(), (s !== void 0 ? s : this.pane).addBinding(i, e, a).on("change", (m) => {
|
501
501
|
this.app.send({
|
502
502
|
event: "updateBind",
|
503
503
|
target: "app",
|
504
504
|
data: {
|
505
|
-
id:
|
506
|
-
value:
|
505
|
+
id: h,
|
506
|
+
value: m.value
|
507
507
|
}
|
508
508
|
});
|
509
509
|
}), this.editorCallbacks++) : (this.app.send({
|
510
510
|
event: "bindObject",
|
511
511
|
target: "app",
|
512
512
|
data: {
|
513
|
-
id:
|
513
|
+
id: h,
|
514
514
|
name: e,
|
515
|
-
params:
|
515
|
+
params: a,
|
516
516
|
parent: s
|
517
517
|
}
|
518
518
|
}), this.appCallbacks++);
|
519
519
|
}
|
520
|
-
triggerBind(
|
521
|
-
const
|
522
|
-
|
520
|
+
triggerBind(i, e) {
|
521
|
+
const a = this.bindCBs.get(i);
|
522
|
+
a !== void 0 ? a(e) : console.warn(`No callback for: ${i}`, e);
|
523
523
|
}
|
524
524
|
// Buttons
|
525
|
-
button(
|
525
|
+
button(i, e, a = void 0) {
|
526
526
|
const s = this.bindID;
|
527
|
-
this.buttonCBs.set(s, e), this.app.editor ? (this.pane === void 0 && this.createGUI(), (
|
527
|
+
this.buttonCBs.set(s, e), this.app.editor ? (this.pane === void 0 && this.createGUI(), (a !== void 0 ? a : this.pane).addButton({ title: i }).on("click", () => {
|
528
528
|
this.app.send({
|
529
529
|
event: "clickButton",
|
530
530
|
target: "app",
|
@@ -537,14 +537,14 @@ class ti extends xt {
|
|
537
537
|
target: "app",
|
538
538
|
data: {
|
539
539
|
id: s,
|
540
|
-
name:
|
540
|
+
name: i,
|
541
541
|
callback: e,
|
542
|
-
parent:
|
542
|
+
parent: a
|
543
543
|
}
|
544
544
|
}), this.appCallbacks++);
|
545
545
|
}
|
546
|
-
triggerButton(
|
547
|
-
const e = this.buttonCBs.get(
|
546
|
+
triggerButton(i) {
|
547
|
+
const e = this.buttonCBs.get(i);
|
548
548
|
e !== void 0 && e();
|
549
549
|
}
|
550
550
|
// Inspector
|
@@ -552,12 +552,12 @@ class ti extends xt {
|
|
552
552
|
this.inspectorFolder = this.addFolder("Inspector", this.pane);
|
553
553
|
}
|
554
554
|
clearInspector() {
|
555
|
-
const
|
556
|
-
for (let e =
|
555
|
+
const i = this.inspectorFolder.children.length - 1;
|
556
|
+
for (let e = i; e > -1; --e)
|
557
557
|
this.inspectorFolder.remove(this.inspectorFolder.children[e]);
|
558
558
|
}
|
559
559
|
}
|
560
|
-
var
|
560
|
+
var At = { exports: {} }, et = {};
|
561
561
|
/**
|
562
562
|
* @license React
|
563
563
|
* react-jsx-runtime.production.min.js
|
@@ -567,25 +567,25 @@ var It = { exports: {} }, tt = {};
|
|
567
567
|
* This source code is licensed under the MIT license found in the
|
568
568
|
* LICENSE file in the root directory of this source tree.
|
569
569
|
*/
|
570
|
-
var
|
571
|
-
function
|
572
|
-
if (
|
573
|
-
return
|
574
|
-
|
575
|
-
var t =
|
576
|
-
function
|
577
|
-
var
|
578
|
-
|
579
|
-
for (
|
580
|
-
e.call(d,
|
570
|
+
var Yt;
|
571
|
+
function ri() {
|
572
|
+
if (Yt)
|
573
|
+
return et;
|
574
|
+
Yt = 1;
|
575
|
+
var t = un, n = Symbol.for("react.element"), i = Symbol.for("react.fragment"), e = Object.prototype.hasOwnProperty, a = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, s = { key: !0, ref: !0, __self: !0, __source: !0 };
|
576
|
+
function h(l, d, m) {
|
577
|
+
var v, E = {}, x = null, R = null;
|
578
|
+
m !== void 0 && (x = "" + m), d.key !== void 0 && (x = "" + d.key), d.ref !== void 0 && (R = d.ref);
|
579
|
+
for (v in d)
|
580
|
+
e.call(d, v) && !s.hasOwnProperty(v) && (E[v] = d[v]);
|
581
581
|
if (l && l.defaultProps)
|
582
|
-
for (
|
583
|
-
|
584
|
-
return { $$typeof: n, type: l, key: x, ref:
|
582
|
+
for (v in d = l.defaultProps, d)
|
583
|
+
E[v] === void 0 && (E[v] = d[v]);
|
584
|
+
return { $$typeof: n, type: l, key: x, ref: R, props: E, _owner: a.current };
|
585
585
|
}
|
586
|
-
return
|
586
|
+
return et.Fragment = i, et.jsx = h, et.jsxs = h, et;
|
587
587
|
}
|
588
|
-
var
|
588
|
+
var tt = {};
|
589
589
|
/**
|
590
590
|
* @license React
|
591
591
|
* react-jsx-runtime.development.js
|
@@ -595,91 +595,91 @@ var nt = {};
|
|
595
595
|
* This source code is licensed under the MIT license found in the
|
596
596
|
* LICENSE file in the root directory of this source tree.
|
597
597
|
*/
|
598
|
-
var
|
599
|
-
function
|
600
|
-
return
|
601
|
-
var t =
|
602
|
-
function
|
603
|
-
if (
|
598
|
+
var Wt;
|
599
|
+
function ai() {
|
600
|
+
return Wt || (Wt = 1, process.env.NODE_ENV !== "production" && function() {
|
601
|
+
var t = un, n = Symbol.for("react.element"), i = Symbol.for("react.portal"), e = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), s = Symbol.for("react.profiler"), h = Symbol.for("react.provider"), l = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), m = Symbol.for("react.suspense"), v = Symbol.for("react.suspense_list"), E = Symbol.for("react.memo"), x = Symbol.for("react.lazy"), R = Symbol.for("react.offscreen"), T = Symbol.iterator, B = "@@iterator";
|
602
|
+
function oe(r) {
|
603
|
+
if (r === null || typeof r != "object")
|
604
604
|
return null;
|
605
|
-
var
|
606
|
-
return typeof
|
605
|
+
var f = T && r[T] || r[B];
|
606
|
+
return typeof f == "function" ? f : null;
|
607
607
|
}
|
608
608
|
var H = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
609
|
-
function
|
609
|
+
function C(r) {
|
610
610
|
{
|
611
|
-
for (var
|
612
|
-
|
613
|
-
K("error",
|
611
|
+
for (var f = arguments.length, g = new Array(f > 1 ? f - 1 : 0), w = 1; w < f; w++)
|
612
|
+
g[w - 1] = arguments[w];
|
613
|
+
K("error", r, g);
|
614
614
|
}
|
615
615
|
}
|
616
|
-
function K(
|
616
|
+
function K(r, f, g) {
|
617
617
|
{
|
618
618
|
var w = H.ReactDebugCurrentFrame, j = w.getStackAddendum();
|
619
|
-
j !== "" && (
|
620
|
-
var
|
619
|
+
j !== "" && (f += "%s", g = g.concat([j]));
|
620
|
+
var I = g.map(function(P) {
|
621
621
|
return String(P);
|
622
622
|
});
|
623
|
-
|
623
|
+
I.unshift("Warning: " + f), Function.prototype.apply.call(console[r], console, I);
|
624
624
|
}
|
625
625
|
}
|
626
|
-
var de = !1, ce = !1,
|
627
|
-
|
628
|
-
function
|
629
|
-
return !!(typeof
|
626
|
+
var de = !1, ce = !1, ee = !1, u = !1, p = !1, b;
|
627
|
+
b = Symbol.for("react.module.reference");
|
628
|
+
function S(r) {
|
629
|
+
return !!(typeof r == "string" || typeof r == "function" || r === e || r === s || p || r === a || r === m || r === v || u || r === R || de || ce || ee || typeof r == "object" && r !== null && (r.$$typeof === x || r.$$typeof === E || r.$$typeof === h || r.$$typeof === l || r.$$typeof === d || // This needs to include all possible module reference object
|
630
630
|
// types supported by any Flight configuration anywhere since
|
631
631
|
// we don't know which Flight build this will end up being used
|
632
632
|
// with.
|
633
|
-
|
633
|
+
r.$$typeof === b || r.getModuleId !== void 0));
|
634
634
|
}
|
635
|
-
function
|
636
|
-
var w =
|
635
|
+
function F(r, f, g) {
|
636
|
+
var w = r.displayName;
|
637
637
|
if (w)
|
638
638
|
return w;
|
639
|
-
var j =
|
640
|
-
return j !== "" ?
|
639
|
+
var j = f.displayName || f.name || "";
|
640
|
+
return j !== "" ? g + "(" + j + ")" : g;
|
641
641
|
}
|
642
|
-
function
|
643
|
-
return
|
642
|
+
function U(r) {
|
643
|
+
return r.displayName || "Context";
|
644
644
|
}
|
645
|
-
function
|
646
|
-
if (
|
645
|
+
function N(r) {
|
646
|
+
if (r == null)
|
647
647
|
return null;
|
648
|
-
if (typeof
|
649
|
-
return
|
650
|
-
if (typeof
|
651
|
-
return
|
652
|
-
switch (
|
648
|
+
if (typeof r.tag == "number" && C("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof r == "function")
|
649
|
+
return r.displayName || r.name || null;
|
650
|
+
if (typeof r == "string")
|
651
|
+
return r;
|
652
|
+
switch (r) {
|
653
653
|
case e:
|
654
654
|
return "Fragment";
|
655
|
-
case
|
655
|
+
case i:
|
656
656
|
return "Portal";
|
657
657
|
case s:
|
658
658
|
return "Profiler";
|
659
|
-
case
|
659
|
+
case a:
|
660
660
|
return "StrictMode";
|
661
|
-
case p:
|
662
|
-
return "Suspense";
|
663
661
|
case m:
|
662
|
+
return "Suspense";
|
663
|
+
case v:
|
664
664
|
return "SuspenseList";
|
665
665
|
}
|
666
|
-
if (typeof
|
667
|
-
switch (
|
666
|
+
if (typeof r == "object")
|
667
|
+
switch (r.$$typeof) {
|
668
668
|
case l:
|
669
|
-
var
|
670
|
-
return
|
671
|
-
case
|
672
|
-
var
|
673
|
-
return
|
669
|
+
var f = r;
|
670
|
+
return U(f) + ".Consumer";
|
671
|
+
case h:
|
672
|
+
var g = r;
|
673
|
+
return U(g._context) + ".Provider";
|
674
674
|
case d:
|
675
|
-
return
|
676
|
-
case
|
677
|
-
var w =
|
678
|
-
return w !== null ? w :
|
675
|
+
return F(r, r.render, "ForwardRef");
|
676
|
+
case E:
|
677
|
+
var w = r.displayName || null;
|
678
|
+
return w !== null ? w : N(r.type) || "Memo";
|
679
679
|
case x: {
|
680
|
-
var j =
|
680
|
+
var j = r, I = j._payload, P = j._init;
|
681
681
|
try {
|
682
|
-
return
|
682
|
+
return N(P(I));
|
683
683
|
} catch {
|
684
684
|
return null;
|
685
685
|
}
|
@@ -687,70 +687,70 @@ function ra() {
|
|
687
687
|
}
|
688
688
|
return null;
|
689
689
|
}
|
690
|
-
var D = Object.assign,
|
691
|
-
function
|
690
|
+
var D = Object.assign, L = 0, Q, M, k, X, pe, Te, He;
|
691
|
+
function at() {
|
692
692
|
}
|
693
|
-
|
694
|
-
function
|
693
|
+
at.__reactDisabledLog = !0;
|
694
|
+
function wt() {
|
695
695
|
{
|
696
|
-
if (
|
697
|
-
|
698
|
-
var
|
696
|
+
if (L === 0) {
|
697
|
+
Q = console.log, M = console.info, k = console.warn, X = console.error, pe = console.group, Te = console.groupCollapsed, He = console.groupEnd;
|
698
|
+
var r = {
|
699
699
|
configurable: !0,
|
700
700
|
enumerable: !0,
|
701
|
-
value:
|
701
|
+
value: at,
|
702
702
|
writable: !0
|
703
703
|
};
|
704
704
|
Object.defineProperties(console, {
|
705
|
-
info:
|
706
|
-
log:
|
707
|
-
warn:
|
708
|
-
error:
|
709
|
-
group:
|
710
|
-
groupCollapsed:
|
711
|
-
groupEnd:
|
705
|
+
info: r,
|
706
|
+
log: r,
|
707
|
+
warn: r,
|
708
|
+
error: r,
|
709
|
+
group: r,
|
710
|
+
groupCollapsed: r,
|
711
|
+
groupEnd: r
|
712
712
|
});
|
713
713
|
}
|
714
|
-
|
714
|
+
L++;
|
715
715
|
}
|
716
716
|
}
|
717
|
-
function
|
717
|
+
function Ct() {
|
718
718
|
{
|
719
|
-
if (
|
720
|
-
var
|
719
|
+
if (L--, L === 0) {
|
720
|
+
var r = {
|
721
721
|
configurable: !0,
|
722
722
|
enumerable: !0,
|
723
723
|
writable: !0
|
724
724
|
};
|
725
725
|
Object.defineProperties(console, {
|
726
|
-
log: D({},
|
727
|
-
value:
|
726
|
+
log: D({}, r, {
|
727
|
+
value: Q
|
728
728
|
}),
|
729
|
-
info: D({},
|
730
|
-
value:
|
729
|
+
info: D({}, r, {
|
730
|
+
value: M
|
731
731
|
}),
|
732
|
-
warn: D({},
|
733
|
-
value:
|
732
|
+
warn: D({}, r, {
|
733
|
+
value: k
|
734
734
|
}),
|
735
|
-
error: D({},
|
735
|
+
error: D({}, r, {
|
736
736
|
value: X
|
737
737
|
}),
|
738
|
-
group: D({},
|
738
|
+
group: D({}, r, {
|
739
739
|
value: pe
|
740
740
|
}),
|
741
|
-
groupCollapsed: D({},
|
742
|
-
value:
|
741
|
+
groupCollapsed: D({}, r, {
|
742
|
+
value: Te
|
743
743
|
}),
|
744
|
-
groupEnd: D({},
|
744
|
+
groupEnd: D({}, r, {
|
745
745
|
value: He
|
746
746
|
})
|
747
747
|
});
|
748
748
|
}
|
749
|
-
|
749
|
+
L < 0 && C("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
750
750
|
}
|
751
751
|
}
|
752
752
|
var Ke = H.ReactCurrentDispatcher, Xe;
|
753
|
-
function
|
753
|
+
function Me(r, f, g) {
|
754
754
|
{
|
755
755
|
if (Xe === void 0)
|
756
756
|
try {
|
@@ -760,30 +760,30 @@ function ra() {
|
|
760
760
|
Xe = w && w[1] || "";
|
761
761
|
}
|
762
762
|
return `
|
763
|
-
` + Xe +
|
763
|
+
` + Xe + r;
|
764
764
|
}
|
765
765
|
}
|
766
|
-
var Ue = !1,
|
766
|
+
var Ue = !1, Re;
|
767
767
|
{
|
768
|
-
var
|
769
|
-
|
768
|
+
var St = typeof WeakMap == "function" ? WeakMap : Map;
|
769
|
+
Re = new St();
|
770
770
|
}
|
771
|
-
function
|
772
|
-
if (!
|
771
|
+
function ot(r, f) {
|
772
|
+
if (!r || Ue)
|
773
773
|
return "";
|
774
774
|
{
|
775
|
-
var
|
776
|
-
if (
|
777
|
-
return
|
775
|
+
var g = Re.get(r);
|
776
|
+
if (g !== void 0)
|
777
|
+
return g;
|
778
778
|
}
|
779
779
|
var w;
|
780
780
|
Ue = !0;
|
781
781
|
var j = Error.prepareStackTrace;
|
782
782
|
Error.prepareStackTrace = void 0;
|
783
|
-
var
|
784
|
-
|
783
|
+
var I;
|
784
|
+
I = Ke.current, Ke.current = null, wt();
|
785
785
|
try {
|
786
|
-
if (
|
786
|
+
if (f) {
|
787
787
|
var P = function() {
|
788
788
|
throw Error();
|
789
789
|
};
|
@@ -797,14 +797,14 @@ function ra() {
|
|
797
797
|
} catch (ye) {
|
798
798
|
w = ye;
|
799
799
|
}
|
800
|
-
Reflect.construct(
|
800
|
+
Reflect.construct(r, [], P);
|
801
801
|
} else {
|
802
802
|
try {
|
803
803
|
P.call();
|
804
804
|
} catch (ye) {
|
805
805
|
w = ye;
|
806
806
|
}
|
807
|
-
|
807
|
+
r.call(P.prototype);
|
808
808
|
}
|
809
809
|
} else {
|
810
810
|
try {
|
@@ -812,386 +812,386 @@ function ra() {
|
|
812
812
|
} catch (ye) {
|
813
813
|
w = ye;
|
814
814
|
}
|
815
|
-
|
815
|
+
r();
|
816
816
|
}
|
817
817
|
} catch (ye) {
|
818
818
|
if (ye && w && typeof ye.stack == "string") {
|
819
|
-
for (var
|
819
|
+
for (var O = ye.stack.split(`
|
820
820
|
`), se = w.stack.split(`
|
821
|
-
`), W =
|
822
|
-
|
823
|
-
for (; W >= 1 &&
|
824
|
-
if (
|
825
|
-
if (W !== 1 ||
|
821
|
+
`), W = O.length - 1, Z = se.length - 1; W >= 1 && Z >= 0 && O[W] !== se[Z]; )
|
822
|
+
Z--;
|
823
|
+
for (; W >= 1 && Z >= 0; W--, Z--)
|
824
|
+
if (O[W] !== se[Z]) {
|
825
|
+
if (W !== 1 || Z !== 1)
|
826
826
|
do
|
827
|
-
if (W--,
|
827
|
+
if (W--, Z--, Z < 0 || O[W] !== se[Z]) {
|
828
828
|
var me = `
|
829
|
-
` +
|
830
|
-
return
|
829
|
+
` + O[W].replace(" at new ", " at ");
|
830
|
+
return r.displayName && me.includes("<anonymous>") && (me = me.replace("<anonymous>", r.displayName)), typeof r == "function" && Re.set(r, me), me;
|
831
831
|
}
|
832
|
-
while (W >= 1 &&
|
832
|
+
while (W >= 1 && Z >= 0);
|
833
833
|
break;
|
834
834
|
}
|
835
835
|
}
|
836
836
|
} finally {
|
837
|
-
Ue = !1, Ke.current =
|
837
|
+
Ue = !1, Ke.current = I, Ct(), Error.prepareStackTrace = j;
|
838
838
|
}
|
839
|
-
var
|
840
|
-
return typeof
|
839
|
+
var Ge = r ? r.displayName || r.name : "", Bt = Ge ? Me(Ge) : "";
|
840
|
+
return typeof r == "function" && Re.set(r, Bt), Bt;
|
841
841
|
}
|
842
|
-
function
|
843
|
-
return
|
842
|
+
function st(r, f, g) {
|
843
|
+
return ot(r, !1);
|
844
844
|
}
|
845
|
-
function
|
846
|
-
var
|
847
|
-
return !!(
|
845
|
+
function ct(r) {
|
846
|
+
var f = r.prototype;
|
847
|
+
return !!(f && f.isReactComponent);
|
848
848
|
}
|
849
|
-
function
|
850
|
-
if (
|
849
|
+
function Pe(r, f, g) {
|
850
|
+
if (r == null)
|
851
851
|
return "";
|
852
|
-
if (typeof
|
853
|
-
return
|
854
|
-
if (typeof
|
855
|
-
return
|
856
|
-
switch (
|
857
|
-
case p:
|
858
|
-
return Te("Suspense");
|
852
|
+
if (typeof r == "function")
|
853
|
+
return ot(r, ct(r));
|
854
|
+
if (typeof r == "string")
|
855
|
+
return Me(r);
|
856
|
+
switch (r) {
|
859
857
|
case m:
|
860
|
-
return
|
858
|
+
return Me("Suspense");
|
859
|
+
case v:
|
860
|
+
return Me("SuspenseList");
|
861
861
|
}
|
862
|
-
if (typeof
|
863
|
-
switch (
|
862
|
+
if (typeof r == "object")
|
863
|
+
switch (r.$$typeof) {
|
864
864
|
case d:
|
865
|
-
return
|
866
|
-
case
|
867
|
-
return
|
865
|
+
return st(r.render);
|
866
|
+
case E:
|
867
|
+
return Pe(r.type, f, g);
|
868
868
|
case x: {
|
869
|
-
var w =
|
869
|
+
var w = r, j = w._payload, I = w._init;
|
870
870
|
try {
|
871
|
-
return
|
871
|
+
return Pe(I(j), f, g);
|
872
872
|
} catch {
|
873
873
|
}
|
874
874
|
}
|
875
875
|
}
|
876
876
|
return "";
|
877
877
|
}
|
878
|
-
var Be = Object.prototype.hasOwnProperty,
|
879
|
-
function
|
880
|
-
if (
|
881
|
-
var
|
882
|
-
|
878
|
+
var Be = Object.prototype.hasOwnProperty, lt = {}, Ze = H.ReactDebugCurrentFrame;
|
879
|
+
function Ce(r) {
|
880
|
+
if (r) {
|
881
|
+
var f = r._owner, g = Pe(r.type, r._source, f ? f.type : null);
|
882
|
+
Ze.setExtraStackFrame(g);
|
883
883
|
} else
|
884
|
-
|
884
|
+
Ze.setExtraStackFrame(null);
|
885
885
|
}
|
886
|
-
function
|
886
|
+
function je(r, f, g, w, j) {
|
887
887
|
{
|
888
|
-
var
|
889
|
-
for (var P in
|
890
|
-
if (
|
891
|
-
var
|
888
|
+
var I = Function.call.bind(Be);
|
889
|
+
for (var P in r)
|
890
|
+
if (I(r, P)) {
|
891
|
+
var O = void 0;
|
892
892
|
try {
|
893
|
-
if (typeof
|
894
|
-
var se = Error((w || "React class") + ": " +
|
893
|
+
if (typeof r[P] != "function") {
|
894
|
+
var se = Error((w || "React class") + ": " + g + " 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`.");
|
895
895
|
throw se.name = "Invariant Violation", se;
|
896
896
|
}
|
897
|
-
|
897
|
+
O = r[P](f, P, w, g, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
898
898
|
} catch (W) {
|
899
|
-
|
899
|
+
O = W;
|
900
900
|
}
|
901
|
-
|
901
|
+
O && !(O instanceof Error) && (Ce(j), C("%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).", w || "React class", g, P, typeof O), Ce(null)), O instanceof Error && !(O.message in lt) && (lt[O.message] = !0, Ce(j), C("Failed %s type: %s", g, O.message), Ce(null));
|
902
902
|
}
|
903
903
|
}
|
904
904
|
}
|
905
|
-
var
|
906
|
-
function
|
907
|
-
return
|
905
|
+
var Ot = Array.isArray;
|
906
|
+
function qe(r) {
|
907
|
+
return Ot(r);
|
908
908
|
}
|
909
|
-
function
|
909
|
+
function ut(r) {
|
910
910
|
{
|
911
|
-
var
|
912
|
-
return
|
911
|
+
var f = typeof Symbol == "function" && Symbol.toStringTag, g = f && r[Symbol.toStringTag] || r.constructor.name || "Object";
|
912
|
+
return g;
|
913
913
|
}
|
914
914
|
}
|
915
|
-
function
|
915
|
+
function Qe(r) {
|
916
916
|
try {
|
917
|
-
return
|
917
|
+
return dt(r), !1;
|
918
918
|
} catch {
|
919
919
|
return !0;
|
920
920
|
}
|
921
921
|
}
|
922
|
-
function
|
923
|
-
return "" +
|
922
|
+
function dt(r) {
|
923
|
+
return "" + r;
|
924
924
|
}
|
925
|
-
function
|
926
|
-
if (
|
927
|
-
return
|
925
|
+
function ft(r) {
|
926
|
+
if (Qe(r))
|
927
|
+
return C("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", ut(r)), dt(r);
|
928
928
|
}
|
929
|
-
var
|
929
|
+
var Se = H.ReactCurrentOwner, Tt = {
|
930
930
|
key: !0,
|
931
931
|
ref: !0,
|
932
932
|
__self: !0,
|
933
933
|
__source: !0
|
934
|
-
},
|
934
|
+
}, ht, Je, ge;
|
935
935
|
ge = {};
|
936
|
-
function o(
|
937
|
-
if (Be.call(
|
938
|
-
var
|
939
|
-
if (
|
936
|
+
function o(r) {
|
937
|
+
if (Be.call(r, "ref")) {
|
938
|
+
var f = Object.getOwnPropertyDescriptor(r, "ref").get;
|
939
|
+
if (f && f.isReactWarning)
|
940
940
|
return !1;
|
941
941
|
}
|
942
|
-
return
|
942
|
+
return r.ref !== void 0;
|
943
943
|
}
|
944
|
-
function
|
945
|
-
if (Be.call(
|
946
|
-
var
|
947
|
-
if (
|
944
|
+
function y(r) {
|
945
|
+
if (Be.call(r, "key")) {
|
946
|
+
var f = Object.getOwnPropertyDescriptor(r, "key").get;
|
947
|
+
if (f && f.isReactWarning)
|
948
948
|
return !1;
|
949
949
|
}
|
950
|
-
return
|
950
|
+
return r.key !== void 0;
|
951
951
|
}
|
952
|
-
function _(
|
953
|
-
if (typeof
|
954
|
-
var
|
955
|
-
ge[
|
952
|
+
function _(r, f) {
|
953
|
+
if (typeof r.ref == "string" && Se.current && f && Se.current.stateNode !== f) {
|
954
|
+
var g = N(Se.current.type);
|
955
|
+
ge[g] || (C('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(Se.current.type), r.ref), ge[g] = !0);
|
956
956
|
}
|
957
957
|
}
|
958
|
-
function
|
958
|
+
function A(r, f) {
|
959
959
|
{
|
960
|
-
var
|
961
|
-
|
960
|
+
var g = function() {
|
961
|
+
ht || (ht = !0, C("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", f));
|
962
962
|
};
|
963
|
-
|
964
|
-
get:
|
963
|
+
g.isReactWarning = !0, Object.defineProperty(r, "key", {
|
964
|
+
get: g,
|
965
965
|
configurable: !0
|
966
966
|
});
|
967
967
|
}
|
968
968
|
}
|
969
|
-
function
|
969
|
+
function te(r, f) {
|
970
970
|
{
|
971
|
-
var
|
972
|
-
|
971
|
+
var g = function() {
|
972
|
+
Je || (Je = !0, C("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", f));
|
973
973
|
};
|
974
|
-
|
975
|
-
get:
|
974
|
+
g.isReactWarning = !0, Object.defineProperty(r, "ref", {
|
975
|
+
get: g,
|
976
976
|
configurable: !0
|
977
977
|
});
|
978
978
|
}
|
979
979
|
}
|
980
|
-
var ve = function(
|
981
|
-
var
|
980
|
+
var ve = function(r, f, g, w, j, I, P) {
|
981
|
+
var O = {
|
982
982
|
// This tag allows us to uniquely identify this as a React Element
|
983
983
|
$$typeof: n,
|
984
984
|
// Built-in properties that belong on the element
|
985
|
-
type:
|
986
|
-
key:
|
987
|
-
ref:
|
985
|
+
type: r,
|
986
|
+
key: f,
|
987
|
+
ref: g,
|
988
988
|
props: P,
|
989
989
|
// Record the component responsible for creating this element.
|
990
|
-
_owner:
|
990
|
+
_owner: I
|
991
991
|
};
|
992
|
-
return
|
992
|
+
return O._store = {}, Object.defineProperty(O._store, "validated", {
|
993
993
|
configurable: !1,
|
994
994
|
enumerable: !1,
|
995
995
|
writable: !0,
|
996
996
|
value: !1
|
997
|
-
}), Object.defineProperty(
|
997
|
+
}), Object.defineProperty(O, "_self", {
|
998
998
|
configurable: !1,
|
999
999
|
enumerable: !1,
|
1000
1000
|
writable: !1,
|
1001
1001
|
value: w
|
1002
|
-
}), Object.defineProperty(
|
1002
|
+
}), Object.defineProperty(O, "_source", {
|
1003
1003
|
configurable: !1,
|
1004
1004
|
enumerable: !1,
|
1005
1005
|
writable: !1,
|
1006
1006
|
value: j
|
1007
|
-
}), Object.freeze && (Object.freeze(
|
1007
|
+
}), Object.freeze && (Object.freeze(O.props), Object.freeze(O)), O;
|
1008
1008
|
};
|
1009
|
-
function le(
|
1009
|
+
function le(r, f, g, w, j) {
|
1010
1010
|
{
|
1011
|
-
var
|
1012
|
-
|
1013
|
-
for (
|
1014
|
-
Be.call(
|
1015
|
-
if (
|
1016
|
-
var W =
|
1017
|
-
for (
|
1018
|
-
P[
|
1011
|
+
var I, P = {}, O = null, se = null;
|
1012
|
+
g !== void 0 && (ft(g), O = "" + g), y(f) && (ft(f.key), O = "" + f.key), o(f) && (se = f.ref, _(f, j));
|
1013
|
+
for (I in f)
|
1014
|
+
Be.call(f, I) && !Tt.hasOwnProperty(I) && (P[I] = f[I]);
|
1015
|
+
if (r && r.defaultProps) {
|
1016
|
+
var W = r.defaultProps;
|
1017
|
+
for (I in W)
|
1018
|
+
P[I] === void 0 && (P[I] = W[I]);
|
1019
1019
|
}
|
1020
|
-
if (
|
1021
|
-
var
|
1022
|
-
|
1020
|
+
if (O || se) {
|
1021
|
+
var Z = typeof r == "function" ? r.displayName || r.name || "Unknown" : r;
|
1022
|
+
O && A(P, Z), se && te(P, Z);
|
1023
1023
|
}
|
1024
|
-
return ve(
|
1024
|
+
return ve(r, O, se, j, w, Se.current, P);
|
1025
1025
|
}
|
1026
1026
|
}
|
1027
|
-
var
|
1028
|
-
function be(
|
1029
|
-
if (
|
1030
|
-
var
|
1031
|
-
|
1027
|
+
var pt = H.ReactCurrentOwner, mt = H.ReactDebugCurrentFrame;
|
1028
|
+
function be(r) {
|
1029
|
+
if (r) {
|
1030
|
+
var f = r._owner, g = Pe(r.type, r._source, f ? f.type : null);
|
1031
|
+
mt.setExtraStackFrame(g);
|
1032
1032
|
} else
|
1033
|
-
|
1033
|
+
mt.setExtraStackFrame(null);
|
1034
1034
|
}
|
1035
1035
|
var fe;
|
1036
1036
|
fe = !1;
|
1037
|
-
function he(
|
1038
|
-
return typeof
|
1037
|
+
function he(r) {
|
1038
|
+
return typeof r == "object" && r !== null && r.$$typeof === n;
|
1039
1039
|
}
|
1040
1040
|
function $e() {
|
1041
1041
|
{
|
1042
|
-
if (
|
1043
|
-
var
|
1044
|
-
if (
|
1042
|
+
if (pt.current) {
|
1043
|
+
var r = N(pt.current.type);
|
1044
|
+
if (r)
|
1045
1045
|
return `
|
1046
1046
|
|
1047
|
-
Check the render method of \`` +
|
1047
|
+
Check the render method of \`` + r + "`.";
|
1048
1048
|
}
|
1049
1049
|
return "";
|
1050
1050
|
}
|
1051
1051
|
}
|
1052
|
-
function
|
1052
|
+
function _e(r) {
|
1053
1053
|
{
|
1054
|
-
if (
|
1055
|
-
var
|
1054
|
+
if (r !== void 0) {
|
1055
|
+
var f = r.fileName.replace(/^.*[\\\/]/, ""), g = r.lineNumber;
|
1056
1056
|
return `
|
1057
1057
|
|
1058
|
-
Check your code at ` +
|
1058
|
+
Check your code at ` + f + ":" + g + ".";
|
1059
1059
|
}
|
1060
1060
|
return "";
|
1061
1061
|
}
|
1062
1062
|
}
|
1063
|
-
var
|
1064
|
-
function
|
1063
|
+
var Oe = {};
|
1064
|
+
function Ve(r) {
|
1065
1065
|
{
|
1066
|
-
var
|
1067
|
-
if (!
|
1068
|
-
var
|
1069
|
-
|
1066
|
+
var f = $e();
|
1067
|
+
if (!f) {
|
1068
|
+
var g = typeof r == "string" ? r : r.displayName || r.name;
|
1069
|
+
g && (f = `
|
1070
1070
|
|
1071
|
-
Check the top-level render call using <` +
|
1071
|
+
Check the top-level render call using <` + g + ">.");
|
1072
1072
|
}
|
1073
|
-
return
|
1073
|
+
return f;
|
1074
1074
|
}
|
1075
1075
|
}
|
1076
|
-
function
|
1076
|
+
function Lt(r, f) {
|
1077
1077
|
{
|
1078
|
-
if (!
|
1078
|
+
if (!r._store || r._store.validated || r.key != null)
|
1079
1079
|
return;
|
1080
|
-
|
1081
|
-
var
|
1082
|
-
if (
|
1080
|
+
r._store.validated = !0;
|
1081
|
+
var g = Ve(f);
|
1082
|
+
if (Oe[g])
|
1083
1083
|
return;
|
1084
|
-
|
1084
|
+
Oe[g] = !0;
|
1085
1085
|
var w = "";
|
1086
|
-
|
1086
|
+
r && r._owner && r._owner !== pt.current && (w = " It was passed a child from " + N(r._owner.type) + "."), be(r), C('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', g, w), be(null);
|
1087
1087
|
}
|
1088
1088
|
}
|
1089
|
-
function
|
1089
|
+
function Ft(r, f) {
|
1090
1090
|
{
|
1091
|
-
if (typeof
|
1091
|
+
if (typeof r != "object")
|
1092
1092
|
return;
|
1093
|
-
if (
|
1094
|
-
for (var
|
1095
|
-
var w =
|
1096
|
-
he(w) &&
|
1093
|
+
if (qe(r))
|
1094
|
+
for (var g = 0; g < r.length; g++) {
|
1095
|
+
var w = r[g];
|
1096
|
+
he(w) && Lt(w, f);
|
1097
1097
|
}
|
1098
|
-
else if (he(
|
1099
|
-
|
1100
|
-
else if (
|
1101
|
-
var j =
|
1102
|
-
if (typeof j == "function" && j !==
|
1103
|
-
for (var
|
1104
|
-
he(P.value) &&
|
1098
|
+
else if (he(r))
|
1099
|
+
r._store && (r._store.validated = !0);
|
1100
|
+
else if (r) {
|
1101
|
+
var j = oe(r);
|
1102
|
+
if (typeof j == "function" && j !== r.entries)
|
1103
|
+
for (var I = j.call(r), P; !(P = I.next()).done; )
|
1104
|
+
he(P.value) && Lt(P.value, f);
|
1105
1105
|
}
|
1106
1106
|
}
|
1107
1107
|
}
|
1108
|
-
function
|
1108
|
+
function yn(r) {
|
1109
1109
|
{
|
1110
|
-
var
|
1111
|
-
if (
|
1110
|
+
var f = r.type;
|
1111
|
+
if (f == null || typeof f == "string")
|
1112
1112
|
return;
|
1113
|
-
var
|
1114
|
-
if (typeof
|
1115
|
-
|
1116
|
-
else if (typeof
|
1113
|
+
var g;
|
1114
|
+
if (typeof f == "function")
|
1115
|
+
g = f.propTypes;
|
1116
|
+
else if (typeof f == "object" && (f.$$typeof === d || // Note: Memo only checks outer props here.
|
1117
1117
|
// Inner props are checked in the reconciler.
|
1118
|
-
|
1119
|
-
|
1118
|
+
f.$$typeof === E))
|
1119
|
+
g = f.propTypes;
|
1120
1120
|
else
|
1121
1121
|
return;
|
1122
|
-
if (
|
1123
|
-
var w =
|
1124
|
-
|
1125
|
-
} else if (
|
1122
|
+
if (g) {
|
1123
|
+
var w = N(f);
|
1124
|
+
je(g, r.props, "prop", w, r);
|
1125
|
+
} else if (f.PropTypes !== void 0 && !fe) {
|
1126
1126
|
fe = !0;
|
1127
|
-
var j =
|
1128
|
-
|
1127
|
+
var j = N(f);
|
1128
|
+
C("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", j || "Unknown");
|
1129
1129
|
}
|
1130
|
-
typeof
|
1130
|
+
typeof f.getDefaultProps == "function" && !f.getDefaultProps.isReactClassApproved && C("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
1131
1131
|
}
|
1132
1132
|
}
|
1133
|
-
function
|
1133
|
+
function En(r) {
|
1134
1134
|
{
|
1135
|
-
for (var
|
1136
|
-
var w =
|
1135
|
+
for (var f = Object.keys(r.props), g = 0; g < f.length; g++) {
|
1136
|
+
var w = f[g];
|
1137
1137
|
if (w !== "children" && w !== "key") {
|
1138
|
-
be(
|
1138
|
+
be(r), C("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", w), be(null);
|
1139
1139
|
break;
|
1140
1140
|
}
|
1141
1141
|
}
|
1142
|
-
|
1142
|
+
r.ref !== null && (be(r), C("Invalid attribute `ref` supplied to `React.Fragment`."), be(null));
|
1143
1143
|
}
|
1144
1144
|
}
|
1145
|
-
function
|
1145
|
+
function Ut(r, f, g, w, j, I) {
|
1146
1146
|
{
|
1147
|
-
var P =
|
1147
|
+
var P = S(r);
|
1148
1148
|
if (!P) {
|
1149
|
-
var
|
1150
|
-
(
|
1151
|
-
var se =
|
1152
|
-
se ?
|
1149
|
+
var O = "";
|
1150
|
+
(r === void 0 || typeof r == "object" && r !== null && Object.keys(r).length === 0) && (O += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
1151
|
+
var se = _e(j);
|
1152
|
+
se ? O += se : O += $e();
|
1153
1153
|
var W;
|
1154
|
-
|
1154
|
+
r === null ? W = "null" : qe(r) ? W = "array" : r !== void 0 && r.$$typeof === n ? (W = "<" + (N(r.type) || "Unknown") + " />", O = " Did you accidentally export a JSX literal instead of a component?") : W = typeof r, C("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", W, O);
|
1155
1155
|
}
|
1156
|
-
var
|
1157
|
-
if (
|
1158
|
-
return
|
1156
|
+
var Z = le(r, f, g, j, I);
|
1157
|
+
if (Z == null)
|
1158
|
+
return Z;
|
1159
1159
|
if (P) {
|
1160
|
-
var me =
|
1160
|
+
var me = f.children;
|
1161
1161
|
if (me !== void 0)
|
1162
1162
|
if (w)
|
1163
|
-
if (
|
1164
|
-
for (var
|
1165
|
-
|
1163
|
+
if (qe(me)) {
|
1164
|
+
for (var Ge = 0; Ge < me.length; Ge++)
|
1165
|
+
Ft(me[Ge], r);
|
1166
1166
|
Object.freeze && Object.freeze(me);
|
1167
1167
|
} else
|
1168
|
-
|
1168
|
+
C("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
1169
1169
|
else
|
1170
|
-
|
1170
|
+
Ft(me, r);
|
1171
1171
|
}
|
1172
|
-
return
|
1172
|
+
return r === e ? En(Z) : yn(Z), Z;
|
1173
1173
|
}
|
1174
1174
|
}
|
1175
|
-
function
|
1176
|
-
return
|
1175
|
+
function xn(r, f, g) {
|
1176
|
+
return Ut(r, f, g, !0);
|
1177
1177
|
}
|
1178
|
-
function
|
1179
|
-
return
|
1178
|
+
function wn(r, f, g) {
|
1179
|
+
return Ut(r, f, g, !1);
|
1180
1180
|
}
|
1181
|
-
var
|
1182
|
-
|
1183
|
-
}()),
|
1181
|
+
var Cn = wn, Sn = xn;
|
1182
|
+
tt.Fragment = e, tt.jsx = Cn, tt.jsxs = Sn;
|
1183
|
+
}()), tt;
|
1184
1184
|
}
|
1185
|
-
process.env.NODE_ENV === "production" ?
|
1186
|
-
var
|
1187
|
-
function
|
1188
|
-
return t.title.search("<") > -1 ? /* @__PURE__ */
|
1185
|
+
process.env.NODE_ENV === "production" ? At.exports = ri() : At.exports = ai();
|
1186
|
+
var c = At.exports;
|
1187
|
+
function gn(t) {
|
1188
|
+
return t.title.search("<") > -1 ? /* @__PURE__ */ c.jsx("button", { className: "svg", dangerouslySetInnerHTML: { __html: t.title } }) : /* @__PURE__ */ c.jsx("button", { children: t.title });
|
1189
1189
|
}
|
1190
|
-
const
|
1191
|
-
/* @__PURE__ */
|
1192
|
-
/* @__PURE__ */
|
1193
|
-
/* @__PURE__ */
|
1194
|
-
] }),
|
1190
|
+
const oi = /* @__PURE__ */ c.jsxs("svg", { className: "closeIcon", width: "14", height: "14", fill: "none", stroke: "#666666", strokeMiterlimit: "10", children: [
|
1191
|
+
/* @__PURE__ */ c.jsx("circle", { cx: "7", cy: "7", r: "6" }),
|
1192
|
+
/* @__PURE__ */ c.jsx("line", { x1: "4", y1: "4", x2: "10", y2: "10" }),
|
1193
|
+
/* @__PURE__ */ c.jsx("line", { x1: "4", y1: "10", x2: "10", y2: "4" })
|
1194
|
+
] }), si = /* @__PURE__ */ c.jsx("svg", { className: "dragIcon", width: "14", height: "14", fill: "#666666", stroke: "none", children: /* @__PURE__ */ c.jsx(
|
1195
1195
|
"path",
|
1196
1196
|
{
|
1197
1197
|
d: `M10.43,4H3.57C3.26,4,3,4.22,3,4.5v1C3,5.78,3.26,6,3.57,6h6.86C10.74,6,11,5.78,11,5.5v-1
|
@@ -1199,46 +1199,46 @@ C11,4.22,10.74,4,10.43,4z M10.43,8H3.57C3.26,8,3,8.22,3,8.5v1C3,9.78,3.26,10,3.5
|
|
1199
1199
|
C11,8.22,10.74,8,10.43,8z`
|
1200
1200
|
}
|
1201
1201
|
) });
|
1202
|
-
function
|
1203
|
-
return /* @__PURE__ */
|
1204
|
-
|
1205
|
-
/* @__PURE__ */
|
1206
|
-
/* @__PURE__ */
|
1202
|
+
function ci(t) {
|
1203
|
+
return /* @__PURE__ */ c.jsx(dn.Item, { value: t.title, children: /* @__PURE__ */ c.jsxs("div", { children: [
|
1204
|
+
si,
|
1205
|
+
/* @__PURE__ */ c.jsx("span", { children: t.title }),
|
1206
|
+
/* @__PURE__ */ c.jsx("button", { className: "closeIcon", onClick: () => {
|
1207
1207
|
t.onDelete(t.index);
|
1208
|
-
}, children:
|
1208
|
+
}, children: oi })
|
1209
1209
|
] }) }, t.title);
|
1210
1210
|
}
|
1211
|
-
function
|
1212
|
-
const [n,
|
1213
|
-
t.onDragComplete(
|
1214
|
-
},
|
1215
|
-
const
|
1216
|
-
|
1211
|
+
function li(t) {
|
1212
|
+
const [n, i] = ae(!1), [e, a] = ae(t.options), s = (m) => {
|
1213
|
+
t.onDragComplete(m), a(m);
|
1214
|
+
}, h = (m) => {
|
1215
|
+
const v = [...e];
|
1216
|
+
v.splice(m, 1), s(v);
|
1217
1217
|
}, l = [];
|
1218
|
-
e.forEach((
|
1219
|
-
l.push(/* @__PURE__ */
|
1218
|
+
e.forEach((m, v) => {
|
1219
|
+
l.push(/* @__PURE__ */ c.jsx(ci, { index: v, title: m, onDelete: h }, m));
|
1220
1220
|
});
|
1221
1221
|
let d = "dropdown draggable";
|
1222
|
-
return t.subdropdown && (d += " subdropdown"), /* @__PURE__ */
|
1223
|
-
/* @__PURE__ */
|
1224
|
-
/* @__PURE__ */
|
1222
|
+
return t.subdropdown && (d += " subdropdown"), /* @__PURE__ */ c.jsxs("div", { className: d, onMouseEnter: () => i(!0), onMouseLeave: () => i(!1), children: [
|
1223
|
+
/* @__PURE__ */ c.jsx(gn, { title: t.title }),
|
1224
|
+
/* @__PURE__ */ c.jsx(dn.Group, { axis: "y", values: e, onReorder: s, style: { visibility: n ? "visible" : "hidden" }, children: l })
|
1225
1225
|
] });
|
1226
1226
|
}
|
1227
|
-
function
|
1228
|
-
const [n,
|
1229
|
-
t.options.map((s,
|
1230
|
-
t.onSelect !== void 0 && (s.onSelect = t.onSelect), e.push(/* @__PURE__ */
|
1227
|
+
function ui(t) {
|
1228
|
+
const [n, i] = ae(!1), e = [];
|
1229
|
+
t.options.map((s, h) => {
|
1230
|
+
t.onSelect !== void 0 && (s.onSelect = t.onSelect), e.push(/* @__PURE__ */ c.jsx(di, { option: s }, h));
|
1231
1231
|
});
|
1232
|
-
let
|
1233
|
-
return t.subdropdown && (
|
1232
|
+
let a = "dropdown";
|
1233
|
+
return t.subdropdown && (a += " subdropdown"), /* @__PURE__ */ c.jsxs(
|
1234
1234
|
"div",
|
1235
1235
|
{
|
1236
|
-
className:
|
1237
|
-
onMouseEnter: () =>
|
1238
|
-
onMouseLeave: () =>
|
1236
|
+
className: a,
|
1237
|
+
onMouseEnter: () => i(!0),
|
1238
|
+
onMouseLeave: () => i(!1),
|
1239
1239
|
children: [
|
1240
|
-
/* @__PURE__ */
|
1241
|
-
/* @__PURE__ */
|
1240
|
+
/* @__PURE__ */ c.jsx(gn, { title: t.title }),
|
1241
|
+
/* @__PURE__ */ c.jsx(
|
1242
1242
|
"ul",
|
1243
1243
|
{
|
1244
1244
|
style: { visibility: n ? "visible" : "hidden" },
|
@@ -1249,13 +1249,13 @@ function ua(t) {
|
|
1249
1249
|
}
|
1250
1250
|
);
|
1251
1251
|
}
|
1252
|
-
function
|
1253
|
-
const { option: n } = t, [
|
1254
|
-
let
|
1252
|
+
function di(t) {
|
1253
|
+
const { option: n } = t, [i, e] = ae("");
|
1254
|
+
let a;
|
1255
1255
|
switch (n.type) {
|
1256
1256
|
case "draggable":
|
1257
|
-
|
1258
|
-
|
1257
|
+
a = /* @__PURE__ */ c.jsx(
|
1258
|
+
li,
|
1259
1259
|
{
|
1260
1260
|
title: n.title,
|
1261
1261
|
options: n.value,
|
@@ -1267,8 +1267,8 @@ function da(t) {
|
|
1267
1267
|
);
|
1268
1268
|
break;
|
1269
1269
|
case "dropdown":
|
1270
|
-
|
1271
|
-
|
1270
|
+
a = /* @__PURE__ */ c.jsx(
|
1271
|
+
ui,
|
1272
1272
|
{
|
1273
1273
|
title: n.title,
|
1274
1274
|
options: n.value,
|
@@ -1278,143 +1278,39 @@ function da(t) {
|
|
1278
1278
|
);
|
1279
1279
|
break;
|
1280
1280
|
case "option":
|
1281
|
-
|
1281
|
+
a = /* @__PURE__ */ c.jsx(
|
1282
1282
|
"button",
|
1283
1283
|
{
|
1284
1284
|
onClick: () => {
|
1285
|
-
n.onSelect !== void 0 && n.onSelect(n.value), n.selectable && (
|
1285
|
+
n.onSelect !== void 0 && n.onSelect(n.value), n.selectable && (i !== n.title ? e(n.title) : e(""));
|
1286
1286
|
},
|
1287
1287
|
children: n.title
|
1288
1288
|
}
|
1289
1289
|
);
|
1290
1290
|
break;
|
1291
1291
|
}
|
1292
|
-
return /* @__PURE__ */
|
1292
|
+
return /* @__PURE__ */ c.jsx("li", { className: i === n.title ? "selected" : "", children: a }, Zn());
|
1293
1293
|
}
|
1294
|
-
function
|
1295
|
-
|
1296
|
-
|
1297
|
-
var d, p, m, b, x, C, S, F, Q;
|
1298
|
-
let l;
|
1299
|
-
switch (c.event) {
|
1294
|
+
function nr(t, n, i) {
|
1295
|
+
function e(s) {
|
1296
|
+
switch (n.forEach((h) => h(t, s)), s.event) {
|
1300
1297
|
case "custom":
|
1301
|
-
|
1302
|
-
break;
|
1303
|
-
case "selectComponent":
|
1304
|
-
k.dispatchEvent({ type: A.SELECT_DROPDOWN, value: c.data });
|
1305
|
-
break;
|
1306
|
-
case "draggableListUpdate":
|
1307
|
-
k.dispatchEvent({ type: A.DRAG_UPDATE, value: c.data });
|
1308
|
-
break;
|
1309
|
-
case "addFolder":
|
1310
|
-
(d = t.components.get("debug")) == null || d.addFolder(c.data.name, c.data.params, c.data.parent);
|
1311
|
-
break;
|
1312
|
-
case "bindObject":
|
1313
|
-
(p = t.components.get("debug")) == null || p.bind(c.data.name, c.data.params, c.data.parent);
|
1314
|
-
break;
|
1315
|
-
case "updateBind":
|
1316
|
-
(m = t.components.get("debug")) == null || m.triggerBind(c.data.id, c.data.value);
|
1317
|
-
break;
|
1318
|
-
case "addButton":
|
1319
|
-
(b = t.components.get("debug")) == null || b.button(c.data.name, c.data.callback, c.data.parent);
|
1320
|
-
break;
|
1321
|
-
case "clickButton":
|
1322
|
-
(x = t.components.get("debug")) == null || x.triggerButton(c.data.id);
|
1323
|
-
break;
|
1324
|
-
case "setSheet":
|
1325
|
-
l = (C = t.components.get("theatre")) == null ? void 0 : C.sheets.get(c.data.sheet), l !== void 0 && (n = l, et.setSelection([l]));
|
1326
|
-
break;
|
1327
|
-
case "setSheetObject":
|
1328
|
-
l = (S = t.components.get("theatre")) == null ? void 0 : S.sheetObjects.get(`${c.data.sheet}_${c.data.key}`), l !== void 0 && et.setSelection([l]);
|
1329
|
-
break;
|
1330
|
-
case "updateSheetObject":
|
1331
|
-
l = (F = t.components.get("theatre")) == null ? void 0 : F.sheetObjectCBs.get(c.data.sheetObject), l !== void 0 && l(c.data.values);
|
1332
|
-
break;
|
1333
|
-
case "updateTimeline":
|
1334
|
-
n = (Q = t.components.get("theatre")) == null ? void 0 : Q.sheets.get(c.data.sheet), n !== void 0 && (n.sequence.position = c.data.position);
|
1335
|
-
break;
|
1336
|
-
case "getObject":
|
1337
|
-
k.dispatchEvent({ type: A.GET_OBJECT, value: c.data });
|
1338
|
-
break;
|
1339
|
-
case "updateObject":
|
1340
|
-
k.dispatchEvent({ type: A.UPDATE_OBJECT, value: c.data });
|
1341
|
-
break;
|
1342
|
-
case "createTexture":
|
1343
|
-
k.dispatchEvent({ type: A.CREATE_TEXTURE, value: c.data });
|
1344
|
-
break;
|
1345
|
-
case "requestMethod":
|
1346
|
-
k.dispatchEvent({ type: A.REQUEST_METHOD, value: c.data });
|
1298
|
+
z.dispatchEvent({ type: Y.CUSTOM, value: s.data });
|
1347
1299
|
break;
|
1348
1300
|
}
|
1349
1301
|
}
|
1350
|
-
function
|
1351
|
-
switch (
|
1302
|
+
function a(s) {
|
1303
|
+
switch (i.forEach((h) => h(t, s)), s.event) {
|
1352
1304
|
case "custom":
|
1353
|
-
|
1354
|
-
break;
|
1355
|
-
case "setObject":
|
1356
|
-
k.dispatchEvent({ type: A.SET_OBJECT, value: c.data });
|
1357
|
-
break;
|
1358
|
-
case "setScene":
|
1359
|
-
k.dispatchEvent({ type: A.SET_SCENE, value: c.data });
|
1360
|
-
break;
|
1361
|
-
case "addCamera":
|
1362
|
-
k.dispatchEvent({ type: A.ADD_CAMERA, value: c.data });
|
1363
|
-
break;
|
1364
|
-
case "removeCamera":
|
1365
|
-
k.dispatchEvent({ type: A.REMOVE_CAMERA, value: c.data });
|
1305
|
+
z.dispatchEvent({ type: Y.CUSTOM, value: s.data });
|
1366
1306
|
break;
|
1367
1307
|
}
|
1368
1308
|
}
|
1369
|
-
|
1370
|
-
|
1371
|
-
}
|
1372
|
-
function s() {
|
1373
|
-
et.ui.restore(), et.onSelectionChange((p) => {
|
1374
|
-
p.length < 1 || p.forEach((m) => {
|
1375
|
-
var S;
|
1376
|
-
let b = m.address.sheetId, x = "setSheet", C = {};
|
1377
|
-
switch (m.type) {
|
1378
|
-
case "Theatre_Sheet_PublicAPI":
|
1379
|
-
x = "setSheet", C = {
|
1380
|
-
sheet: m.address.sheetId
|
1381
|
-
}, n = (S = t.components.get("theatre")) == null ? void 0 : S.sheets.get(m.address.sheetId);
|
1382
|
-
break;
|
1383
|
-
case "Theatre_SheetObject_PublicAPI":
|
1384
|
-
x = "setSheetObject", b += `_${m.address.objectKey}`, C = {
|
1385
|
-
id: b,
|
1386
|
-
sheet: m.address.sheetId,
|
1387
|
-
key: m.address.objectKey
|
1388
|
-
};
|
1389
|
-
break;
|
1390
|
-
}
|
1391
|
-
t.send({ event: x, target: "app", data: C });
|
1392
|
-
});
|
1393
|
-
});
|
1394
|
-
let c = 0;
|
1395
|
-
const l = () => {
|
1396
|
-
if (n !== void 0 && c !== n.sequence.position) {
|
1397
|
-
c = n.sequence.position;
|
1398
|
-
const p = n;
|
1399
|
-
t.send({
|
1400
|
-
event: "updateTimeline",
|
1401
|
-
target: "app",
|
1402
|
-
data: {
|
1403
|
-
position: c,
|
1404
|
-
sheet: p.address.sheetId
|
1405
|
-
}
|
1406
|
-
});
|
1407
|
-
}
|
1408
|
-
}, d = () => {
|
1409
|
-
l(), requestAnimationFrame(d);
|
1410
|
-
};
|
1411
|
-
l(), d();
|
1412
|
-
}
|
1413
|
-
t.listen((c) => {
|
1414
|
-
t.editor ? e(c) : a(c);
|
1415
|
-
}), t.editor ? s() : r();
|
1309
|
+
t.listen((s) => {
|
1310
|
+
t.editor ? a(s) : e(s);
|
1311
|
+
});
|
1416
1312
|
}
|
1417
|
-
const
|
1313
|
+
const fi = `out vec3 worldPosition;
|
1418
1314
|
uniform float uDistance;
|
1419
1315
|
|
1420
1316
|
void main() {
|
@@ -1423,7 +1319,7 @@ void main() {
|
|
1423
1319
|
worldPosition.xz += cameraPosition.xz;
|
1424
1320
|
|
1425
1321
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(worldPosition, 1.0);
|
1426
|
-
}`,
|
1322
|
+
}`, hi = `out vec4 fragColor;
|
1427
1323
|
in vec3 worldPosition;
|
1428
1324
|
|
1429
1325
|
uniform float uDivisions;
|
@@ -1491,14 +1387,14 @@ void main() {
|
|
1491
1387
|
|
1492
1388
|
if (fragColor.a <= 0.0) discard;
|
1493
1389
|
}`;
|
1494
|
-
class
|
1390
|
+
class pi extends on {
|
1495
1391
|
constructor(n) {
|
1496
1392
|
super({
|
1497
1393
|
extensions: {
|
1498
1394
|
derivatives: !0
|
1499
1395
|
},
|
1500
|
-
glslVersion:
|
1501
|
-
side:
|
1396
|
+
glslVersion: Pn,
|
1397
|
+
side: jn,
|
1502
1398
|
transparent: !0,
|
1503
1399
|
uniforms: {
|
1504
1400
|
uScale: {
|
@@ -1508,7 +1404,7 @@ class pa extends rn {
|
|
1508
1404
|
value: (n == null ? void 0 : n.divisions) !== void 0 ? n == null ? void 0 : n.divisions : 10
|
1509
1405
|
},
|
1510
1406
|
uColor: {
|
1511
|
-
value: (n == null ? void 0 : n.color) !== void 0 ? n == null ? void 0 : n.color : new
|
1407
|
+
value: (n == null ? void 0 : n.color) !== void 0 ? n == null ? void 0 : n.color : new It(16777215)
|
1512
1408
|
},
|
1513
1409
|
uDistance: {
|
1514
1410
|
value: (n == null ? void 0 : n.distance) !== void 0 ? n == null ? void 0 : n.distance : 1e4
|
@@ -1520,25 +1416,25 @@ class pa extends rn {
|
|
1520
1416
|
value: (n == null ? void 0 : n.gridOpacity) !== void 0 ? n == null ? void 0 : n.gridOpacity : 0.25
|
1521
1417
|
}
|
1522
1418
|
},
|
1523
|
-
vertexShader:
|
1524
|
-
fragmentShader:
|
1419
|
+
vertexShader: fi,
|
1420
|
+
fragmentShader: hi,
|
1525
1421
|
name: "InfiniteGrid",
|
1526
1422
|
depthWrite: !1
|
1527
1423
|
});
|
1528
1424
|
}
|
1529
1425
|
}
|
1530
|
-
class
|
1426
|
+
class mi extends _n {
|
1531
1427
|
constructor() {
|
1532
|
-
const
|
1533
|
-
super(new
|
1534
|
-
|
1535
|
-
this.gridMaterial =
|
1428
|
+
const i = new pi();
|
1429
|
+
super(new Dn(2, 2), i);
|
1430
|
+
q(this, "gridMaterial");
|
1431
|
+
this.gridMaterial = i, this.frustumCulled = !1, this.name = "InfiniteGridHelper", this.position.y = 0.1;
|
1536
1432
|
}
|
1537
1433
|
update() {
|
1538
1434
|
this.gridMaterial.needsUpdate = !0;
|
1539
1435
|
}
|
1540
1436
|
}
|
1541
|
-
const
|
1437
|
+
const gi = `#include <common>
|
1542
1438
|
#include <batching_pars_vertex>
|
1543
1439
|
#include <uv_pars_vertex>
|
1544
1440
|
#include <color_pars_vertex>
|
@@ -1568,7 +1464,7 @@ void main() {
|
|
1568
1464
|
#include <logdepthbuf_vertex>
|
1569
1465
|
#include <clipping_planes_vertex>
|
1570
1466
|
#include <worldpos_vertex>
|
1571
|
-
}`,
|
1467
|
+
}`, vi = `
|
1572
1468
|
#include <common>
|
1573
1469
|
#include <uv_pars_fragment>
|
1574
1470
|
#include <clipping_planes_pars_fragment>
|
@@ -1577,51 +1473,51 @@ void main() {
|
|
1577
1473
|
#include <clipping_planes_fragment>
|
1578
1474
|
gl_FragColor = vec4(vec3(vUv, 0.0), 1.0);
|
1579
1475
|
}`;
|
1580
|
-
class
|
1476
|
+
class bi extends on {
|
1581
1477
|
constructor() {
|
1582
1478
|
super({
|
1583
1479
|
defines: {
|
1584
1480
|
USE_UV: ""
|
1585
1481
|
},
|
1586
|
-
vertexShader:
|
1587
|
-
fragmentShader:
|
1482
|
+
vertexShader: gi,
|
1483
|
+
fragmentShader: vi
|
1588
1484
|
});
|
1589
1485
|
}
|
1590
1486
|
}
|
1591
|
-
function
|
1592
|
-
const [n,
|
1593
|
-
return /* @__PURE__ */
|
1594
|
-
/* @__PURE__ */
|
1487
|
+
function Nt(t) {
|
1488
|
+
const [n, i] = ae(t.open !== void 0 ? t.open : !0), e = !n || t.children === void 0;
|
1489
|
+
return /* @__PURE__ */ c.jsxs("div", { className: `accordion ${e ? "hide" : ""}`, children: [
|
1490
|
+
/* @__PURE__ */ c.jsxs(
|
1595
1491
|
"button",
|
1596
1492
|
{
|
1597
1493
|
className: "toggle",
|
1598
1494
|
onClick: () => {
|
1599
|
-
const
|
1600
|
-
t.onToggle !== void 0 && t.onToggle(
|
1495
|
+
const a = !n;
|
1496
|
+
t.onToggle !== void 0 && t.onToggle(a), i(a);
|
1601
1497
|
},
|
1602
1498
|
children: [
|
1603
|
-
/* @__PURE__ */
|
1499
|
+
/* @__PURE__ */ c.jsx(
|
1604
1500
|
"p",
|
1605
1501
|
{
|
1606
1502
|
className: `status ${n ? "open" : ""}`,
|
1607
1503
|
children: "Toggle"
|
1608
1504
|
}
|
1609
1505
|
),
|
1610
|
-
/* @__PURE__ */
|
1506
|
+
/* @__PURE__ */ c.jsx("p", { className: "label", children: t.label })
|
1611
1507
|
]
|
1612
1508
|
}
|
1613
1509
|
),
|
1614
1510
|
t.button,
|
1615
|
-
/* @__PURE__ */
|
1511
|
+
/* @__PURE__ */ c.jsx("div", { className: n ? "open" : "", children: /* @__PURE__ */ c.jsx("div", { children: t.children }) })
|
1616
1512
|
] });
|
1617
1513
|
}
|
1618
|
-
function
|
1619
|
-
const [n,
|
1514
|
+
function vn(t) {
|
1515
|
+
const [n, i] = ae(!1), e = t.child.children.length > 0, a = [];
|
1620
1516
|
return t.child.children.length > 0 && t.child.children.map((s) => {
|
1621
|
-
|
1622
|
-
}), /* @__PURE__ */
|
1623
|
-
/* @__PURE__ */
|
1624
|
-
e ? /* @__PURE__ */
|
1517
|
+
a.push(/* @__PURE__ */ c.jsx(vn, { child: s, three: t.three }, Math.random()));
|
1518
|
+
}), /* @__PURE__ */ c.jsxs("div", { className: "childObject", children: [
|
1519
|
+
/* @__PURE__ */ c.jsxs("div", { className: "child", children: [
|
1520
|
+
e ? /* @__PURE__ */ c.jsx(
|
1625
1521
|
"button",
|
1626
1522
|
{
|
1627
1523
|
className: "status",
|
@@ -1629,11 +1525,11 @@ function gn(t) {
|
|
1629
1525
|
backgroundPositionX: n ? "-14px" : "2px"
|
1630
1526
|
},
|
1631
1527
|
onClick: () => {
|
1632
|
-
|
1528
|
+
i(!n);
|
1633
1529
|
}
|
1634
1530
|
}
|
1635
1531
|
) : null,
|
1636
|
-
/* @__PURE__ */
|
1532
|
+
/* @__PURE__ */ c.jsx(
|
1637
1533
|
"button",
|
1638
1534
|
{
|
1639
1535
|
className: "name",
|
@@ -1646,32 +1542,32 @@ function gn(t) {
|
|
1646
1542
|
children: t.child.name.length > 0 ? `${t.child.name} (${t.child.type})` : `${t.child.type}::${t.child.uuid}`
|
1647
1543
|
}
|
1648
1544
|
),
|
1649
|
-
/* @__PURE__ */
|
1545
|
+
/* @__PURE__ */ c.jsx("div", { className: `icon ${ti(t.child)}` })
|
1650
1546
|
] }),
|
1651
|
-
/* @__PURE__ */
|
1547
|
+
/* @__PURE__ */ c.jsx("div", { className: n ? "open" : "", children: /* @__PURE__ */ c.jsx("div", { className: "container", children: a }) })
|
1652
1548
|
] }, Math.random());
|
1653
1549
|
}
|
1654
|
-
function
|
1550
|
+
function yi(t) {
|
1655
1551
|
const n = [];
|
1656
|
-
return t.child.children.map((
|
1657
|
-
n.push(/* @__PURE__ */
|
1658
|
-
}), /* @__PURE__ */
|
1552
|
+
return t.child.children.map((i) => {
|
1553
|
+
n.push(/* @__PURE__ */ c.jsx(vn, { child: i, three: t.three }, Math.random()));
|
1554
|
+
}), /* @__PURE__ */ c.jsx("div", { className: `scene ${t.class !== void 0 ? t.class : ""}`, children: n });
|
1659
1555
|
}
|
1660
|
-
const
|
1661
|
-
function
|
1556
|
+
const Ei = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA5klEQVRoge2Y0Q6EIAwE6cX//+X6cCFpSMEKVTdk501OpRNKiyelFC0b8Ps6gCwoggZF0KAIGhRBgyJoUAQNiqCxjciR9SLV//eZiAyvK3U8i/QVaQO2YyLSFVvlkdTKDjJCukh2ykR5ZEW+kHmlatl90RaBtDkK/w7CYhuRUEO0ee3l+J3m55Vm+17vtwjTnV1V3QA8qfbeUXCzRWDpiLLS+OyzvRW7IzW9R+okvclsqR09743bo0yUpc1+lSJvNsa002+Euk9GKzV7SmZDRIMiaFAEDYqgQRE0KIIGRdCgCBoUQeMEMERadX7YUz8AAAAASUVORK5CYII=";
|
1557
|
+
function xi(t) {
|
1662
1558
|
return "items" in t;
|
1663
1559
|
}
|
1664
1560
|
function Le(t) {
|
1665
|
-
function n(e,
|
1666
|
-
console.log("onChange:", e,
|
1561
|
+
function n(e, a) {
|
1562
|
+
console.log("onChange:", e, a);
|
1667
1563
|
}
|
1668
|
-
const
|
1564
|
+
const i = [];
|
1669
1565
|
return t.items.forEach((e) => {
|
1670
|
-
|
1671
|
-
/* @__PURE__ */
|
1672
|
-
) :
|
1673
|
-
/* @__PURE__ */
|
1674
|
-
|
1566
|
+
xi(e) ? i.push(
|
1567
|
+
/* @__PURE__ */ c.jsx(Le, { title: e.title, items: e.items }, Math.random())
|
1568
|
+
) : i.push(
|
1569
|
+
/* @__PURE__ */ c.jsx(
|
1570
|
+
nt,
|
1675
1571
|
{
|
1676
1572
|
title: e.title,
|
1677
1573
|
prop: e.prop,
|
@@ -1681,19 +1577,19 @@ function Le(t) {
|
|
1681
1577
|
max: e.max,
|
1682
1578
|
step: e.step,
|
1683
1579
|
disabled: e.disabled,
|
1684
|
-
onChange: (
|
1685
|
-
e.onChange !== void 0 ? e.onChange(
|
1580
|
+
onChange: (a, s) => {
|
1581
|
+
e.onChange !== void 0 ? e.onChange(a, s) : n(a, s);
|
1686
1582
|
}
|
1687
1583
|
},
|
1688
1584
|
Math.random()
|
1689
1585
|
)
|
1690
1586
|
);
|
1691
|
-
}), /* @__PURE__ */
|
1587
|
+
}), /* @__PURE__ */ c.jsx(Nt, { label: t.title, open: !1, children: i });
|
1692
1588
|
}
|
1693
|
-
function
|
1589
|
+
function wi(t) {
|
1694
1590
|
return !(t === "alphaHash" || t === "alphaToCoverage" || t === "attenuationDistance" || t === "colorWrite" || t === "combine" || t === "defaultAttributeValues" || t === "depthFunc" || t === "forceSinglePass" || t === "glslVersion" || t === "linewidth" || t === "normalMapType" || t === "precision" || t === "premultipliedAlpha" || t === "shadowSide" || t === "side" || t === "toneMapped" || t === "uniformsGroups" || t === "uniformsNeedUpdate" || t === "userData" || t === "vertexColors" || t === "version" || t === "wireframeLinecap" || t === "wireframeLinejoin" || t === "wireframeLinewidth" || t.slice(0, 5) === "blend" || t.slice(0, 4) === "clip" || t.slice(0, 7) === "polygon" || t.slice(0, 7) === "stencil" || t.slice(0, 2) === "is");
|
1695
1591
|
}
|
1696
|
-
function
|
1592
|
+
function De(t) {
|
1697
1593
|
switch (t) {
|
1698
1594
|
case "alphaMap":
|
1699
1595
|
return "Alpha Map";
|
@@ -1842,271 +1738,271 @@ function _e(t) {
|
|
1842
1738
|
}
|
1843
1739
|
return t;
|
1844
1740
|
}
|
1845
|
-
function
|
1741
|
+
function Ci(t) {
|
1846
1742
|
return t.toLowerCase().search("intensity") > -1 || t === "anisotropyRotation" || t === "bumpScale" || t === "clearcoatRoughness" || t === "displacementBias" || t === "displacementScale" || t === "metalness" || t === "opacity" || t === "reflectivity" || t === "refractionRatio" || t === "roughness" || t === "sheenRoughness" || t === "thickness";
|
1847
1743
|
}
|
1848
|
-
function
|
1744
|
+
function Si() {
|
1849
1745
|
const t = document.createElement("input");
|
1850
|
-
return t.type = "file", new Promise((n,
|
1746
|
+
return t.type = "file", new Promise((n, i) => {
|
1851
1747
|
t.addEventListener("change", function() {
|
1852
1748
|
if (t.files === null)
|
1853
|
-
|
1749
|
+
i();
|
1854
1750
|
else {
|
1855
|
-
const e = t.files[0],
|
1856
|
-
|
1751
|
+
const e = t.files[0], a = new FileReader();
|
1752
|
+
a.onload = function(s) {
|
1857
1753
|
n(s.target.result);
|
1858
|
-
},
|
1754
|
+
}, a.readAsDataURL(e);
|
1859
1755
|
}
|
1860
1756
|
}), t.click();
|
1861
1757
|
});
|
1862
1758
|
}
|
1863
|
-
function
|
1759
|
+
function Ht(t, n, i) {
|
1864
1760
|
const e = [];
|
1865
|
-
for (const
|
1866
|
-
if (!
|
1761
|
+
for (const a in t) {
|
1762
|
+
if (!wi(a))
|
1867
1763
|
continue;
|
1868
|
-
const s = typeof t[
|
1764
|
+
const s = typeof t[a], h = t[a];
|
1869
1765
|
if (s === "boolean" || s === "number" || s === "string") {
|
1870
1766
|
const l = {
|
1871
|
-
title:
|
1872
|
-
prop:
|
1767
|
+
title: De(a),
|
1768
|
+
prop: a,
|
1873
1769
|
type: s,
|
1874
|
-
value:
|
1770
|
+
value: h,
|
1875
1771
|
min: void 0,
|
1876
1772
|
max: void 0,
|
1877
|
-
onChange: (d,
|
1878
|
-
var
|
1879
|
-
|
1880
|
-
const
|
1881
|
-
|
1773
|
+
onChange: (d, m) => {
|
1774
|
+
var E;
|
1775
|
+
i.updateObject(n.uuid, `material.${d}`, m), s === "boolean" && i.updateObject(n.uuid, "material.needsUpdate", !0);
|
1776
|
+
const v = (E = i.scene) == null ? void 0 : E.getObjectByProperty("uuid", n.uuid);
|
1777
|
+
v !== void 0 && J(v, `material.${d}`, m);
|
1882
1778
|
}
|
1883
1779
|
};
|
1884
|
-
|
1780
|
+
Ci(a) && (l.value = Number(h), l.type = "range", l.min = 0, l.max = 1, l.step = 0.01), e.push(l);
|
1885
1781
|
} else if (s === "object")
|
1886
|
-
if (
|
1782
|
+
if (h.isColor)
|
1887
1783
|
e.push({
|
1888
|
-
title:
|
1889
|
-
prop:
|
1784
|
+
title: De(a),
|
1785
|
+
prop: a,
|
1890
1786
|
type: "color",
|
1891
|
-
value:
|
1787
|
+
value: h,
|
1892
1788
|
onChange: (l, d) => {
|
1893
|
-
var
|
1894
|
-
const
|
1895
|
-
|
1896
|
-
const
|
1897
|
-
|
1789
|
+
var E;
|
1790
|
+
const m = new It(d);
|
1791
|
+
i.updateObject(n.uuid, `material.${l}`, m);
|
1792
|
+
const v = (E = i.scene) == null ? void 0 : E.getObjectByProperty("uuid", n.uuid);
|
1793
|
+
v !== void 0 && J(v, `material.${l}`, m);
|
1898
1794
|
}
|
1899
1795
|
});
|
1900
|
-
else if (Array.isArray(
|
1796
|
+
else if (Array.isArray(h)) {
|
1901
1797
|
const l = [];
|
1902
|
-
for (const d in
|
1798
|
+
for (const d in h)
|
1903
1799
|
l.push({
|
1904
1800
|
title: `${d}`,
|
1905
|
-
type: `${typeof
|
1906
|
-
value:
|
1907
|
-
onChange: (
|
1801
|
+
type: `${typeof h[d]}`,
|
1802
|
+
value: h[d],
|
1803
|
+
onChange: (m, v) => {
|
1908
1804
|
var x;
|
1909
|
-
|
1910
|
-
const
|
1911
|
-
|
1805
|
+
i.updateObject(n.uuid, `material.${a}`, v);
|
1806
|
+
const E = (x = i.scene) == null ? void 0 : x.getObjectByProperty("uuid", n.uuid);
|
1807
|
+
E !== void 0 && J(E, `material.${a}`, v);
|
1912
1808
|
}
|
1913
1809
|
});
|
1914
1810
|
e.push({
|
1915
|
-
title:
|
1811
|
+
title: De(a),
|
1916
1812
|
items: l
|
1917
1813
|
});
|
1918
1814
|
} else {
|
1919
1815
|
const l = [];
|
1920
|
-
for (const d in
|
1921
|
-
const
|
1922
|
-
switch (typeof
|
1816
|
+
for (const d in h) {
|
1817
|
+
const m = h[d];
|
1818
|
+
switch (typeof m) {
|
1923
1819
|
case "boolean":
|
1924
1820
|
case "number":
|
1925
1821
|
case "string":
|
1926
1822
|
d === "src" ? e.push({
|
1927
|
-
title:
|
1823
|
+
title: De(a),
|
1928
1824
|
type: "image",
|
1929
|
-
value:
|
1930
|
-
onChange: (
|
1931
|
-
var
|
1932
|
-
|
1933
|
-
const
|
1934
|
-
|
1935
|
-
|
1825
|
+
value: m,
|
1826
|
+
onChange: (E, x) => {
|
1827
|
+
var T;
|
1828
|
+
i.createTexture(n.uuid, `material.${a}`, x);
|
1829
|
+
const R = (T = i.scene) == null ? void 0 : T.getObjectByProperty("uuid", n.uuid);
|
1830
|
+
R !== void 0 && kt(x).then((B) => {
|
1831
|
+
J(R, `material.${a}`, B), J(R, "material.needsUpdate", !0);
|
1936
1832
|
});
|
1937
1833
|
}
|
1938
1834
|
}) : l.push({
|
1939
|
-
title: `${
|
1940
|
-
prop: `material.${
|
1941
|
-
type: `${typeof t[
|
1942
|
-
value:
|
1943
|
-
onChange: (
|
1944
|
-
var
|
1945
|
-
|
1946
|
-
const
|
1947
|
-
|
1835
|
+
title: `${De(d)}`,
|
1836
|
+
prop: `material.${a}.${d}`,
|
1837
|
+
type: `${typeof t[a][d]}`,
|
1838
|
+
value: h[d],
|
1839
|
+
onChange: (E, x) => {
|
1840
|
+
var T;
|
1841
|
+
i.updateObject(n.uuid, `material.${a}.${d}`, x);
|
1842
|
+
const R = (T = i.scene) == null ? void 0 : T.getObjectByProperty("uuid", n.uuid);
|
1843
|
+
R !== void 0 && J(R, `material.${a}.${d}`, x);
|
1948
1844
|
}
|
1949
1845
|
});
|
1950
1846
|
break;
|
1951
1847
|
case "object":
|
1952
|
-
|
1953
|
-
title:
|
1848
|
+
m.value !== void 0 && m.value.src !== void 0 ? l.push({
|
1849
|
+
title: De(d),
|
1954
1850
|
type: "image",
|
1955
|
-
value:
|
1956
|
-
onChange: (
|
1957
|
-
var
|
1958
|
-
|
1959
|
-
const
|
1960
|
-
|
1961
|
-
|
1851
|
+
value: m.value.src,
|
1852
|
+
onChange: (E, x) => {
|
1853
|
+
var T;
|
1854
|
+
i.createTexture(n.uuid, `material.${a}.${d}.value`, x);
|
1855
|
+
const R = (T = i.scene) == null ? void 0 : T.getObjectByProperty("uuid", n.uuid);
|
1856
|
+
R !== void 0 && kt(x).then((B) => {
|
1857
|
+
J(R, `material.${a}.${d}.value`, B);
|
1962
1858
|
});
|
1963
1859
|
}
|
1964
1860
|
}) : l.push({
|
1965
1861
|
title: d,
|
1966
|
-
type: `${typeof
|
1967
|
-
value:
|
1968
|
-
onChange: (
|
1969
|
-
var
|
1970
|
-
|
1971
|
-
const
|
1972
|
-
|
1862
|
+
type: `${typeof m.value}`,
|
1863
|
+
value: m.value,
|
1864
|
+
onChange: (E, x) => {
|
1865
|
+
var T;
|
1866
|
+
i.updateObject(n.uuid, `material.${a}.${d}.value`, x);
|
1867
|
+
const R = (T = i.scene) == null ? void 0 : T.getObjectByProperty("uuid", n.uuid);
|
1868
|
+
R !== void 0 && J(R, `material.${a}.${d}.value`, x);
|
1973
1869
|
}
|
1974
1870
|
});
|
1975
1871
|
break;
|
1976
1872
|
}
|
1977
1873
|
}
|
1978
1874
|
l.length > 0 && e.push({
|
1979
|
-
title:
|
1875
|
+
title: De(a),
|
1980
1876
|
items: l
|
1981
1877
|
});
|
1982
1878
|
}
|
1983
1879
|
else
|
1984
|
-
|
1880
|
+
h !== void 0 && console.log("other:", a, s, h);
|
1985
1881
|
}
|
1986
|
-
return e.sort((
|
1882
|
+
return e.sort((a, s) => a.title < s.title ? -1 : a.title > s.title ? 1 : 0), e.push({
|
1987
1883
|
title: "Update Material",
|
1988
1884
|
type: "button",
|
1989
1885
|
onChange: () => {
|
1990
|
-
|
1886
|
+
i.updateObject(n.uuid, "material.needsUpdate", !0);
|
1991
1887
|
}
|
1992
1888
|
}), e;
|
1993
1889
|
}
|
1994
|
-
function
|
1995
|
-
const
|
1996
|
-
if (Array.isArray(
|
1997
|
-
const e = [],
|
1998
|
-
for (let s = 0; s <
|
1890
|
+
function Oi(t, n) {
|
1891
|
+
const i = t.material;
|
1892
|
+
if (Array.isArray(i)) {
|
1893
|
+
const e = [], a = i.length;
|
1894
|
+
for (let s = 0; s < a; s++)
|
1999
1895
|
e.push(
|
2000
|
-
/* @__PURE__ */
|
1896
|
+
/* @__PURE__ */ c.jsx(
|
2001
1897
|
Le,
|
2002
1898
|
{
|
2003
1899
|
title: `Material ${s}`,
|
2004
|
-
items:
|
1900
|
+
items: Ht(i[s], t, n)
|
2005
1901
|
},
|
2006
1902
|
`Material ${s}`
|
2007
1903
|
)
|
2008
1904
|
);
|
2009
|
-
return /* @__PURE__ */
|
1905
|
+
return /* @__PURE__ */ c.jsx(c.Fragment, { children: e });
|
2010
1906
|
} else
|
2011
|
-
return /* @__PURE__ */
|
1907
|
+
return /* @__PURE__ */ c.jsx(
|
2012
1908
|
Le,
|
2013
1909
|
{
|
2014
1910
|
title: "Material",
|
2015
|
-
items:
|
1911
|
+
items: Ht(i, t, n)
|
2016
1912
|
}
|
2017
1913
|
);
|
2018
1914
|
}
|
2019
|
-
function
|
1915
|
+
function nt(t) {
|
2020
1916
|
let n = t.value;
|
2021
|
-
n !== void 0 && n.isColor !== void 0 && (n =
|
2022
|
-
const [
|
1917
|
+
n !== void 0 && n.isColor !== void 0 && (n = Qn(t.value));
|
1918
|
+
const [i, e] = ae(n), a = we(null), s = we(null), h = we(null);
|
2023
1919
|
Ne(() => {
|
2024
1920
|
var K;
|
2025
|
-
let
|
2026
|
-
const
|
2027
|
-
|
2028
|
-
},
|
2029
|
-
if (!
|
1921
|
+
let v = !1, E = -1, x = 0, R = Number(i);
|
1922
|
+
const T = (de) => {
|
1923
|
+
v = !0, x = R, E = de.clientX;
|
1924
|
+
}, B = (de) => {
|
1925
|
+
if (!v)
|
2030
1926
|
return;
|
2031
|
-
const ce = t.step !== void 0 ? t.step : 1,
|
2032
|
-
|
2033
|
-
},
|
2034
|
-
|
1927
|
+
const ce = t.step !== void 0 ? t.step : 1, ee = (de.clientX - E) * ce;
|
1928
|
+
R = Number((x + ee).toFixed(4)), s.current !== null && (s.current.value = R.toString()), t.onChange !== void 0 && t.onChange(t.prop !== void 0 ? t.prop : t.title, R);
|
1929
|
+
}, oe = () => {
|
1930
|
+
v = !1;
|
2035
1931
|
}, H = () => {
|
2036
|
-
|
2037
|
-
},
|
2038
|
-
return
|
1932
|
+
v = !1;
|
1933
|
+
}, C = t.type === "number";
|
1934
|
+
return C && ((K = a.current) == null || K.addEventListener("mousedown", T, !1), document.addEventListener("mouseup", oe, !1), document.addEventListener("mousemove", B, !1), document.addEventListener("contextmenu", H, !1)), () => {
|
2039
1935
|
var de;
|
2040
|
-
|
1936
|
+
C && ((de = a.current) == null || de.removeEventListener("mousedown", T), document.removeEventListener("mouseup", oe), document.removeEventListener("mousemove", B), document.removeEventListener("contextmenu", H));
|
2041
1937
|
};
|
2042
|
-
}, [
|
2043
|
-
const l = t.type === "string" && (
|
2044
|
-
`) > -1), d = l || t.type === "image",
|
2045
|
-
let
|
2046
|
-
t.type === "boolean" && (
|
1938
|
+
}, [i]);
|
1939
|
+
const l = t.type === "string" && (i.length > 100 || i.search(`
|
1940
|
+
`) > -1), d = l || t.type === "image", m = (v) => {
|
1941
|
+
let E = v.target.value;
|
1942
|
+
t.type === "boolean" && (E = v.target.checked), e(E), t.onChange !== void 0 && t.onChange(t.prop !== void 0 ? t.prop : t.title, E);
|
2047
1943
|
};
|
2048
|
-
return /* @__PURE__ */
|
2049
|
-
t.type !== "button" && /* @__PURE__ */
|
2050
|
-
t.type === "string" && !l && /* @__PURE__ */
|
1944
|
+
return /* @__PURE__ */ c.jsxs("div", { className: `field ${d ? "block" : ""}`, children: [
|
1945
|
+
t.type !== "button" && /* @__PURE__ */ c.jsx("label", { ref: a, children: t.title }, "fieldLabel"),
|
1946
|
+
t.type === "string" && !l && /* @__PURE__ */ c.jsx(
|
2051
1947
|
"input",
|
2052
1948
|
{
|
2053
1949
|
type: "text",
|
2054
1950
|
disabled: t.disabled,
|
2055
|
-
onChange:
|
2056
|
-
value:
|
1951
|
+
onChange: m,
|
1952
|
+
value: i
|
2057
1953
|
}
|
2058
1954
|
),
|
2059
|
-
t.type === "string" && l && /* @__PURE__ */
|
1955
|
+
t.type === "string" && l && /* @__PURE__ */ c.jsx(
|
2060
1956
|
"textarea",
|
2061
1957
|
{
|
2062
1958
|
cols: 50,
|
2063
1959
|
rows: 10,
|
2064
1960
|
disabled: !0,
|
2065
|
-
onChange:
|
2066
|
-
value:
|
1961
|
+
onChange: m,
|
1962
|
+
value: i
|
2067
1963
|
}
|
2068
1964
|
),
|
2069
|
-
t.type === "boolean" && /* @__PURE__ */
|
1965
|
+
t.type === "boolean" && /* @__PURE__ */ c.jsx(
|
2070
1966
|
"input",
|
2071
1967
|
{
|
2072
1968
|
type: "checkbox",
|
2073
1969
|
disabled: t.disabled,
|
2074
|
-
onChange:
|
2075
|
-
checked:
|
1970
|
+
onChange: m,
|
1971
|
+
checked: i
|
2076
1972
|
}
|
2077
1973
|
),
|
2078
|
-
t.type === "number" && /* @__PURE__ */
|
1974
|
+
t.type === "number" && /* @__PURE__ */ c.jsx(
|
2079
1975
|
"input",
|
2080
1976
|
{
|
2081
1977
|
ref: s,
|
2082
1978
|
type: "number",
|
2083
|
-
value:
|
1979
|
+
value: i,
|
2084
1980
|
min: t.min,
|
2085
1981
|
max: t.max,
|
2086
1982
|
step: t.step,
|
2087
|
-
onChange:
|
1983
|
+
onChange: m
|
2088
1984
|
}
|
2089
1985
|
),
|
2090
|
-
t.type === "range" && /* @__PURE__ */
|
2091
|
-
/* @__PURE__ */
|
2092
|
-
/* @__PURE__ */
|
1986
|
+
t.type === "range" && /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
|
1987
|
+
/* @__PURE__ */ c.jsx("input", { type: "text", value: i.toString(), onChange: m, className: "min" }),
|
1988
|
+
/* @__PURE__ */ c.jsx(
|
2093
1989
|
"input",
|
2094
1990
|
{
|
2095
1991
|
disabled: t.disabled,
|
2096
1992
|
type: "range",
|
2097
|
-
value:
|
1993
|
+
value: i,
|
2098
1994
|
min: t.min,
|
2099
1995
|
max: t.max,
|
2100
1996
|
step: t.step,
|
2101
|
-
onChange:
|
1997
|
+
onChange: m
|
2102
1998
|
}
|
2103
1999
|
)
|
2104
2000
|
] }),
|
2105
|
-
t.type === "color" && /* @__PURE__ */
|
2106
|
-
/* @__PURE__ */
|
2107
|
-
/* @__PURE__ */
|
2001
|
+
t.type === "color" && /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
|
2002
|
+
/* @__PURE__ */ c.jsx("input", { type: "text", value: i.toString(), onChange: m, className: "color" }),
|
2003
|
+
/* @__PURE__ */ c.jsx("input", { type: "color", value: i, onChange: m })
|
2108
2004
|
] }),
|
2109
|
-
t.type === "button" && /* @__PURE__ */
|
2005
|
+
t.type === "button" && /* @__PURE__ */ c.jsx(
|
2110
2006
|
"button",
|
2111
2007
|
{
|
2112
2008
|
onClick: () => {
|
@@ -2115,14 +2011,14 @@ function at(t) {
|
|
2115
2011
|
children: t.title
|
2116
2012
|
}
|
2117
2013
|
),
|
2118
|
-
t.type === "image" && /* @__PURE__ */
|
2119
|
-
|
2120
|
-
|
2014
|
+
t.type === "image" && /* @__PURE__ */ c.jsx("img", { ref: h, onClick: () => {
|
2015
|
+
Si().then((v) => {
|
2016
|
+
h.current.src = v, t.onChange !== void 0 && t.onChange(t.prop !== void 0 ? t.prop : t.title, v);
|
2121
2017
|
});
|
2122
|
-
}, src:
|
2018
|
+
}, src: i.length > 0 ? i : Ei })
|
2123
2019
|
] });
|
2124
2020
|
}
|
2125
|
-
function
|
2021
|
+
function Kt(t) {
|
2126
2022
|
switch (t) {
|
2127
2023
|
case "fov":
|
2128
2024
|
return "FOV";
|
@@ -2151,70 +2047,70 @@ function Xt(t) {
|
|
2151
2047
|
}
|
2152
2048
|
return t;
|
2153
2049
|
}
|
2154
|
-
function
|
2155
|
-
const
|
2050
|
+
function Ti(t, n) {
|
2051
|
+
const i = [];
|
2156
2052
|
if (t.perspectiveCameraInfo !== void 0)
|
2157
2053
|
for (const e in t.perspectiveCameraInfo)
|
2158
|
-
|
2159
|
-
title:
|
2054
|
+
i.push({
|
2055
|
+
title: Kt(e),
|
2160
2056
|
prop: e,
|
2161
2057
|
type: "number",
|
2162
2058
|
step: 0.01,
|
2163
2059
|
value: t.perspectiveCameraInfo[e],
|
2164
|
-
onChange: (
|
2060
|
+
onChange: (a, s) => {
|
2165
2061
|
var l;
|
2166
|
-
n.updateObject(t.uuid,
|
2167
|
-
const
|
2168
|
-
|
2062
|
+
n.updateObject(t.uuid, a, s), n.requestMethod(t.uuid, "updateProjectionMatrix");
|
2063
|
+
const h = (l = n.scene) == null ? void 0 : l.getObjectByProperty("uuid", t.uuid);
|
2064
|
+
h !== void 0 && (J(h, a, s), h.updateProjectionMatrix());
|
2169
2065
|
}
|
2170
2066
|
});
|
2171
2067
|
else if (t.orthographicCameraInfo !== void 0)
|
2172
2068
|
for (const e in t.orthographicCameraInfo)
|
2173
|
-
|
2174
|
-
title:
|
2069
|
+
i.push({
|
2070
|
+
title: Kt(e),
|
2175
2071
|
prop: e,
|
2176
2072
|
type: "number",
|
2177
2073
|
step: 0.01,
|
2178
2074
|
value: t.perspectiveCameraInfo[e],
|
2179
|
-
onChange: (
|
2075
|
+
onChange: (a, s) => {
|
2180
2076
|
var l;
|
2181
|
-
n.updateObject(t.uuid,
|
2182
|
-
const
|
2183
|
-
|
2077
|
+
n.updateObject(t.uuid, a, s), n.requestMethod(t.uuid, "updateProjectionMatrix");
|
2078
|
+
const h = (l = n.scene) == null ? void 0 : l.getObjectByProperty("uuid", t.uuid);
|
2079
|
+
h !== void 0 && (J(h, a, s), h.updateProjectionMatrix());
|
2184
2080
|
}
|
2185
2081
|
});
|
2186
|
-
return /* @__PURE__ */
|
2082
|
+
return /* @__PURE__ */ c.jsx(
|
2187
2083
|
Le,
|
2188
2084
|
{
|
2189
2085
|
title: "Camera",
|
2190
|
-
items:
|
2086
|
+
items: i
|
2191
2087
|
}
|
2192
2088
|
);
|
2193
2089
|
}
|
2194
|
-
const
|
2195
|
-
function We(t, n,
|
2196
|
-
return e + (t - n) * (
|
2090
|
+
const Mi = Math.PI / 180, Ri = 180 / Math.PI;
|
2091
|
+
function We(t, n, i, e, a) {
|
2092
|
+
return e + (t - n) * (a - e) / (i - n);
|
2197
2093
|
}
|
2198
|
-
function
|
2199
|
-
return t *
|
2094
|
+
function Pi(t) {
|
2095
|
+
return t * Mi;
|
2200
2096
|
}
|
2201
|
-
function
|
2202
|
-
return t *
|
2097
|
+
function Pt(t) {
|
2098
|
+
return t * Ri;
|
2203
2099
|
}
|
2204
|
-
function
|
2205
|
-
const
|
2206
|
-
|
2207
|
-
const e = new
|
2208
|
-
t.uuid.length > 0 && (e.setFromMatrixPosition(
|
2209
|
-
const
|
2210
|
-
var
|
2211
|
-
n.updateObject(t.uuid, d,
|
2212
|
-
const
|
2213
|
-
|
2214
|
-
}, l = (d,
|
2215
|
-
|
2100
|
+
function ji(t, n) {
|
2101
|
+
const i = new kn();
|
2102
|
+
i.elements = t.matrix;
|
2103
|
+
const e = new G(), a = new An(), s = new G();
|
2104
|
+
t.uuid.length > 0 && (e.setFromMatrixPosition(i), a.setFromRotationMatrix(i), s.setFromMatrixScale(i));
|
2105
|
+
const h = (d, m) => {
|
2106
|
+
var E;
|
2107
|
+
n.updateObject(t.uuid, d, m);
|
2108
|
+
const v = (E = n.scene) == null ? void 0 : E.getObjectByProperty("uuid", t.uuid);
|
2109
|
+
v !== void 0 && J(v, d, m);
|
2110
|
+
}, l = (d, m) => {
|
2111
|
+
h(d, Pi(m));
|
2216
2112
|
};
|
2217
|
-
return /* @__PURE__ */
|
2113
|
+
return /* @__PURE__ */ c.jsx(
|
2218
2114
|
Le,
|
2219
2115
|
{
|
2220
2116
|
title: "Transform",
|
@@ -2224,27 +2120,27 @@ function ja(t, n) {
|
|
2224
2120
|
prop: "position.x",
|
2225
2121
|
type: "number",
|
2226
2122
|
value: e.x,
|
2227
|
-
onChange:
|
2123
|
+
onChange: h
|
2228
2124
|
},
|
2229
2125
|
{
|
2230
2126
|
title: "Position Y",
|
2231
2127
|
prop: "position.y",
|
2232
2128
|
type: "number",
|
2233
2129
|
value: e.y,
|
2234
|
-
onChange:
|
2130
|
+
onChange: h
|
2235
2131
|
},
|
2236
2132
|
{
|
2237
2133
|
title: "Position Z",
|
2238
2134
|
prop: "position.z",
|
2239
2135
|
type: "number",
|
2240
2136
|
value: e.z,
|
2241
|
-
onChange:
|
2137
|
+
onChange: h
|
2242
2138
|
},
|
2243
2139
|
{
|
2244
2140
|
title: "Rotation X",
|
2245
2141
|
prop: "rotation.x",
|
2246
2142
|
type: "number",
|
2247
|
-
value:
|
2143
|
+
value: Mt(Pt(a.x)),
|
2248
2144
|
min: -360,
|
2249
2145
|
max: 360,
|
2250
2146
|
step: 0.1,
|
@@ -2254,7 +2150,7 @@ function ja(t, n) {
|
|
2254
2150
|
title: "Rotation Y",
|
2255
2151
|
prop: "rotation.y",
|
2256
2152
|
type: "number",
|
2257
|
-
value:
|
2153
|
+
value: Mt(Pt(a.y)),
|
2258
2154
|
min: -360,
|
2259
2155
|
max: 360,
|
2260
2156
|
step: 0.1,
|
@@ -2264,7 +2160,7 @@ function ja(t, n) {
|
|
2264
2160
|
title: "Rotation Z",
|
2265
2161
|
prop: "rotation.z",
|
2266
2162
|
type: "number",
|
2267
|
-
value:
|
2163
|
+
value: Mt(Pt(a.z)),
|
2268
2164
|
min: -360,
|
2269
2165
|
max: 360,
|
2270
2166
|
step: 0.1,
|
@@ -2276,7 +2172,7 @@ function ja(t, n) {
|
|
2276
2172
|
type: "number",
|
2277
2173
|
value: s.x,
|
2278
2174
|
step: 0.01,
|
2279
|
-
onChange:
|
2175
|
+
onChange: h
|
2280
2176
|
},
|
2281
2177
|
{
|
2282
2178
|
title: "Scale Y",
|
@@ -2284,7 +2180,7 @@ function ja(t, n) {
|
|
2284
2180
|
type: "number",
|
2285
2181
|
value: s.y,
|
2286
2182
|
step: 0.01,
|
2287
|
-
onChange:
|
2183
|
+
onChange: h
|
2288
2184
|
},
|
2289
2185
|
{
|
2290
2186
|
title: "Scale Z",
|
@@ -2292,13 +2188,13 @@ function ja(t, n) {
|
|
2292
2188
|
type: "number",
|
2293
2189
|
value: s.z,
|
2294
2190
|
step: 0.01,
|
2295
|
-
onChange:
|
2191
|
+
onChange: h
|
2296
2192
|
}
|
2297
2193
|
]
|
2298
2194
|
}
|
2299
2195
|
);
|
2300
2196
|
}
|
2301
|
-
function
|
2197
|
+
function Xt(t) {
|
2302
2198
|
switch (t) {
|
2303
2199
|
case "color":
|
2304
2200
|
return "Color";
|
@@ -2317,196 +2213,194 @@ function qt(t) {
|
|
2317
2213
|
}
|
2318
2214
|
return t;
|
2319
2215
|
}
|
2320
|
-
function
|
2321
|
-
const
|
2216
|
+
function _i(t, n) {
|
2217
|
+
const i = [];
|
2322
2218
|
if (t.lightInfo !== void 0)
|
2323
2219
|
for (const e in t.lightInfo) {
|
2324
|
-
const
|
2325
|
-
|
2326
|
-
title:
|
2220
|
+
const a = t.lightInfo[e];
|
2221
|
+
a !== void 0 && (a.isColor !== void 0 ? i.push({
|
2222
|
+
title: Xt(e),
|
2327
2223
|
prop: e,
|
2328
2224
|
type: "color",
|
2329
|
-
value:
|
2330
|
-
onChange: (s,
|
2331
|
-
var
|
2332
|
-
const l = new
|
2225
|
+
value: a,
|
2226
|
+
onChange: (s, h) => {
|
2227
|
+
var m;
|
2228
|
+
const l = new It(h);
|
2333
2229
|
n.updateObject(t.uuid, s, l);
|
2334
|
-
const d = (
|
2335
|
-
d !== void 0 &&
|
2230
|
+
const d = (m = n.scene) == null ? void 0 : m.getObjectByProperty("uuid", t.uuid);
|
2231
|
+
d !== void 0 && J(d, s, l);
|
2336
2232
|
}
|
2337
|
-
}) :
|
2338
|
-
title:
|
2233
|
+
}) : i.push({
|
2234
|
+
title: Xt(e),
|
2339
2235
|
prop: e,
|
2340
|
-
type: typeof
|
2341
|
-
value:
|
2342
|
-
step: typeof
|
2343
|
-
onChange: (s,
|
2236
|
+
type: typeof a,
|
2237
|
+
value: a,
|
2238
|
+
step: typeof a == "number" ? 0.01 : void 0,
|
2239
|
+
onChange: (s, h) => {
|
2344
2240
|
var d;
|
2345
|
-
n.updateObject(t.uuid, s,
|
2241
|
+
n.updateObject(t.uuid, s, h);
|
2346
2242
|
const l = (d = n.scene) == null ? void 0 : d.getObjectByProperty("uuid", t.uuid);
|
2347
|
-
l !== void 0 &&
|
2243
|
+
l !== void 0 && J(l, s, h);
|
2348
2244
|
}
|
2349
2245
|
}));
|
2350
2246
|
}
|
2351
|
-
return /* @__PURE__ */
|
2247
|
+
return /* @__PURE__ */ c.jsx(
|
2352
2248
|
Le,
|
2353
2249
|
{
|
2354
2250
|
title: "Light",
|
2355
|
-
items:
|
2251
|
+
items: i
|
2356
2252
|
}
|
2357
2253
|
);
|
2358
2254
|
}
|
2359
|
-
function
|
2360
|
-
const
|
2255
|
+
function Di(t, n) {
|
2256
|
+
const i = [];
|
2361
2257
|
return t.animations.forEach((e) => {
|
2362
|
-
|
2258
|
+
i.push({
|
2363
2259
|
title: "Name",
|
2364
2260
|
type: "string",
|
2365
2261
|
prop: "name",
|
2366
2262
|
value: e.name,
|
2367
2263
|
disabled: !0,
|
2368
|
-
onChange: (
|
2264
|
+
onChange: (a, s) => {
|
2369
2265
|
var l;
|
2370
|
-
n.updateObject(t.uuid,
|
2371
|
-
const
|
2372
|
-
|
2266
|
+
n.updateObject(t.uuid, a, s);
|
2267
|
+
const h = (l = n.scene) == null ? void 0 : l.getObjectByProperty("uuid", t.uuid);
|
2268
|
+
h !== void 0 && J(h, a, s);
|
2373
2269
|
}
|
2374
|
-
}),
|
2270
|
+
}), i.push({
|
2375
2271
|
title: "Duration",
|
2376
2272
|
type: "number",
|
2377
2273
|
prop: "duration",
|
2378
2274
|
value: e.duration,
|
2379
2275
|
disabled: !0,
|
2380
|
-
onChange: (
|
2276
|
+
onChange: (a, s) => {
|
2381
2277
|
var l;
|
2382
|
-
n.updateObject(t.uuid,
|
2383
|
-
const
|
2384
|
-
|
2278
|
+
n.updateObject(t.uuid, a, s);
|
2279
|
+
const h = (l = n.scene) == null ? void 0 : l.getObjectByProperty("uuid", t.uuid);
|
2280
|
+
h !== void 0 && J(h, a, s);
|
2385
2281
|
}
|
2386
|
-
}),
|
2282
|
+
}), i.push({
|
2387
2283
|
title: "Blend Mode",
|
2388
2284
|
type: "number",
|
2389
2285
|
prop: "blendMode",
|
2390
2286
|
value: e.blendMode,
|
2391
2287
|
disabled: !0,
|
2392
|
-
onChange: (
|
2288
|
+
onChange: (a, s) => {
|
2393
2289
|
var l;
|
2394
|
-
n.updateObject(t.uuid,
|
2395
|
-
const
|
2396
|
-
|
2290
|
+
n.updateObject(t.uuid, a, s);
|
2291
|
+
const h = (l = n.scene) == null ? void 0 : l.getObjectByProperty("uuid", t.uuid);
|
2292
|
+
h !== void 0 && J(h, a, s);
|
2397
2293
|
}
|
2398
2294
|
});
|
2399
|
-
}), /* @__PURE__ */
|
2295
|
+
}), /* @__PURE__ */ c.jsx(Le, { title: "Animations", items: i });
|
2400
2296
|
}
|
2401
|
-
|
2402
|
-
|
2403
|
-
|
2404
|
-
|
2405
|
-
|
2406
|
-
|
2407
|
-
|
2408
|
-
|
2409
|
-
|
2410
|
-
|
2411
|
-
|
2412
|
-
|
2413
|
-
|
2297
|
+
const Zt = {
|
2298
|
+
name: "",
|
2299
|
+
uuid: "",
|
2300
|
+
type: "",
|
2301
|
+
visible: !1,
|
2302
|
+
matrix: [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1],
|
2303
|
+
animations: [],
|
2304
|
+
material: void 0,
|
2305
|
+
perspectiveCameraInfo: void 0,
|
2306
|
+
orthographicCameraInfo: void 0,
|
2307
|
+
lightInfo: void 0
|
2308
|
+
};
|
2309
|
+
function ki(t) {
|
2310
|
+
const [n, i] = ae(Zt);
|
2414
2311
|
Ne(() => {
|
2415
|
-
function
|
2416
|
-
const
|
2417
|
-
|
2418
|
-
|
2419
|
-
|
2420
|
-
|
2421
|
-
console.log(m), console.log(p.animations);
|
2422
|
-
}
|
2423
|
-
}
|
2312
|
+
function a(h) {
|
2313
|
+
const l = h.value;
|
2314
|
+
i(l);
|
2315
|
+
}
|
2316
|
+
function s() {
|
2317
|
+
i(Zt);
|
2424
2318
|
}
|
2425
|
-
return
|
2426
|
-
|
2319
|
+
return z.addEventListener(Y.SET_SCENE, s), z.addEventListener(Y.SET_OBJECT, a), () => {
|
2320
|
+
z.removeEventListener(Y.SET_SCENE, s), z.removeEventListener(Y.SET_OBJECT, a);
|
2427
2321
|
};
|
2428
2322
|
}, []);
|
2429
|
-
const
|
2430
|
-
return /* @__PURE__ */
|
2431
|
-
/* @__PURE__ */
|
2432
|
-
/* @__PURE__ */
|
2433
|
-
|
2323
|
+
const e = n.type.toLowerCase();
|
2324
|
+
return /* @__PURE__ */ c.jsx(Nt, { label: "Inspector", children: /* @__PURE__ */ c.jsx("div", { id: "Inspector", className: t.class, children: n.uuid.length > 0 && /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
|
2325
|
+
/* @__PURE__ */ c.jsxs(c.Fragment, { children: [
|
2326
|
+
/* @__PURE__ */ c.jsx(
|
2327
|
+
nt,
|
2434
2328
|
{
|
2435
2329
|
type: "string",
|
2436
2330
|
title: "Name",
|
2437
2331
|
prop: "name",
|
2438
|
-
value:
|
2332
|
+
value: n.name,
|
2439
2333
|
disabled: !0
|
2440
2334
|
}
|
2441
2335
|
),
|
2442
|
-
/* @__PURE__ */
|
2443
|
-
|
2336
|
+
/* @__PURE__ */ c.jsx(
|
2337
|
+
nt,
|
2444
2338
|
{
|
2445
2339
|
type: "string",
|
2446
2340
|
title: "Type",
|
2447
2341
|
prop: "type",
|
2448
|
-
value:
|
2342
|
+
value: n.type,
|
2449
2343
|
disabled: !0
|
2450
2344
|
}
|
2451
2345
|
),
|
2452
|
-
/* @__PURE__ */
|
2453
|
-
|
2346
|
+
/* @__PURE__ */ c.jsx(
|
2347
|
+
nt,
|
2454
2348
|
{
|
2455
2349
|
type: "string",
|
2456
2350
|
title: "UUID",
|
2457
2351
|
prop: "uuid",
|
2458
|
-
value:
|
2352
|
+
value: n.uuid,
|
2459
2353
|
disabled: !0
|
2460
2354
|
}
|
2461
2355
|
),
|
2462
|
-
/* @__PURE__ */
|
2463
|
-
|
2356
|
+
/* @__PURE__ */ c.jsx(
|
2357
|
+
nt,
|
2464
2358
|
{
|
2465
2359
|
type: "boolean",
|
2466
2360
|
title: "Visible",
|
2467
2361
|
prop: "visible",
|
2468
|
-
value:
|
2469
|
-
onChange: (
|
2470
|
-
var
|
2471
|
-
t.three.updateObject(
|
2472
|
-
const
|
2473
|
-
|
2362
|
+
value: n.visible,
|
2363
|
+
onChange: (a, s) => {
|
2364
|
+
var l;
|
2365
|
+
t.three.updateObject(n.uuid, a, s);
|
2366
|
+
const h = (l = t.three.scene) == null ? void 0 : l.getObjectByProperty("uuid", n.uuid);
|
2367
|
+
h !== void 0 && J(h, a, s);
|
2474
2368
|
}
|
2475
2369
|
}
|
2476
2370
|
)
|
2477
2371
|
] }),
|
2478
|
-
/* @__PURE__ */
|
2479
|
-
|
2480
|
-
|
2481
|
-
|
2482
|
-
|
2483
|
-
|
2372
|
+
/* @__PURE__ */ c.jsxs(c.Fragment, { children: [
|
2373
|
+
ji(n, t.three),
|
2374
|
+
n.animations.length > 0 ? Di(n, t.three) : null,
|
2375
|
+
e.search("camera") > -1 ? Ti(n, t.three) : null,
|
2376
|
+
e.search("light") > -1 ? _i(n, t.three) : null,
|
2377
|
+
e.search("mesh") > -1 ? Oi(n, t.three) : null
|
2484
2378
|
] })
|
2485
|
-
] }) }
|
2379
|
+
] }) }) }, "Inspector");
|
2486
2380
|
}
|
2487
|
-
class
|
2488
|
-
constructor(
|
2489
|
-
super(
|
2490
|
-
|
2381
|
+
class ir extends Kn {
|
2382
|
+
constructor(i) {
|
2383
|
+
super(i);
|
2384
|
+
q(this, "three");
|
2491
2385
|
// Private
|
2492
|
-
|
2386
|
+
q(this, "setScene", (i) => {
|
2493
2387
|
this.setState(() => ({
|
2494
|
-
scene:
|
2388
|
+
scene: i.value
|
2495
2389
|
}));
|
2496
2390
|
});
|
2497
2391
|
this.state = {
|
2498
|
-
scene:
|
2499
|
-
}, this.three =
|
2392
|
+
scene: i.scene !== void 0 ? i.scene : null
|
2393
|
+
}, this.three = i.three, z.addEventListener(Y.SET_SCENE, this.setScene);
|
2500
2394
|
}
|
2501
2395
|
componentWillUnmount() {
|
2502
|
-
|
2396
|
+
z.removeEventListener(Y.SET_SCENE, this.setScene);
|
2503
2397
|
}
|
2504
2398
|
render() {
|
2505
|
-
var
|
2506
|
-
const
|
2507
|
-
return /* @__PURE__ */
|
2508
|
-
/* @__PURE__ */
|
2509
|
-
/* @__PURE__ */
|
2399
|
+
var a;
|
2400
|
+
const i = this.componentState.scene !== null, e = "Hierarchy - " + (i ? `${(a = this.componentState.scene) == null ? void 0 : a.name}` : "No Scene");
|
2401
|
+
return /* @__PURE__ */ c.jsx("div", { id: "SidePanel", children: /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
|
2402
|
+
/* @__PURE__ */ c.jsx(Nt, { label: e, open: !0, children: /* @__PURE__ */ c.jsx(c.Fragment, { children: i && /* @__PURE__ */ c.jsx(yi, { child: this.componentState.scene, three: this.three }) }) }),
|
2403
|
+
/* @__PURE__ */ c.jsx(ki, { three: this.three })
|
2510
2404
|
] }) }, "SidePanel");
|
2511
2405
|
}
|
2512
2406
|
// Getters / Setters
|
@@ -2514,98 +2408,98 @@ class ai extends Kn {
|
|
2514
2408
|
return this.state;
|
2515
2409
|
}
|
2516
2410
|
}
|
2517
|
-
function
|
2411
|
+
function rr(t) {
|
2518
2412
|
function n() {
|
2519
2413
|
return t.three.scene === void 0 ? (console.log("No scene:", t.three), !1) : !0;
|
2520
2414
|
}
|
2521
|
-
const
|
2522
|
-
var
|
2415
|
+
const i = (l) => {
|
2416
|
+
var m;
|
2523
2417
|
if (!n())
|
2524
2418
|
return;
|
2525
|
-
const d = (
|
2419
|
+
const d = (m = t.three.scene) == null ? void 0 : m.getObjectByProperty("uuid", l.value);
|
2526
2420
|
d !== void 0 && t.three.setObject(d);
|
2527
|
-
}, e = (l, d,
|
2528
|
-
var
|
2421
|
+
}, e = (l, d, m) => {
|
2422
|
+
var E;
|
2529
2423
|
if (!n())
|
2530
2424
|
return;
|
2531
|
-
const
|
2532
|
-
|
2533
|
-
},
|
2425
|
+
const v = (E = t.three.scene) == null ? void 0 : E.getObjectByProperty("uuid", l);
|
2426
|
+
v !== void 0 && J(v, d, m);
|
2427
|
+
}, a = (l) => {
|
2534
2428
|
if (!n())
|
2535
2429
|
return;
|
2536
|
-
const d = l.value, { key:
|
2537
|
-
e(
|
2430
|
+
const d = l.value, { key: m, value: v, uuid: E } = d;
|
2431
|
+
e(E, m, v);
|
2538
2432
|
}, s = (l) => {
|
2539
2433
|
if (!n())
|
2540
2434
|
return;
|
2541
2435
|
const d = l.value;
|
2542
|
-
|
2543
|
-
e(d.uuid, d.key,
|
2436
|
+
kt(d.value).then((m) => {
|
2437
|
+
e(d.uuid, d.key, m), e(d.uuid, "material.needsUpdate", !0);
|
2544
2438
|
});
|
2545
|
-
},
|
2439
|
+
}, h = (l) => {
|
2546
2440
|
var x;
|
2547
2441
|
if (!n())
|
2548
2442
|
return;
|
2549
|
-
const { key: d, uuid:
|
2550
|
-
if (
|
2443
|
+
const { key: d, uuid: m, value: v } = l.value, E = (x = t.three.scene) == null ? void 0 : x.getObjectByProperty("uuid", m);
|
2444
|
+
if (E !== void 0)
|
2551
2445
|
try {
|
2552
|
-
|
2553
|
-
} catch (
|
2554
|
-
console.log("Error requesting method:"), console.log(
|
2446
|
+
E[d](v);
|
2447
|
+
} catch (R) {
|
2448
|
+
console.log("Error requesting method:"), console.log(R), console.log(d), console.log(v);
|
2555
2449
|
}
|
2556
2450
|
};
|
2557
|
-
return Ne(() => (
|
2558
|
-
|
2451
|
+
return Ne(() => (z.addEventListener(Y.GET_OBJECT, i), z.addEventListener(Y.UPDATE_OBJECT, a), z.addEventListener(Y.CREATE_TEXTURE, s), z.addEventListener(Y.REQUEST_METHOD, h), () => {
|
2452
|
+
z.removeEventListener(Y.GET_OBJECT, i), z.removeEventListener(Y.UPDATE_OBJECT, a), z.removeEventListener(Y.CREATE_TEXTURE, s), z.removeEventListener(Y.REQUEST_METHOD, h);
|
2559
2453
|
}), []), null;
|
2560
2454
|
}
|
2561
|
-
const
|
2562
|
-
class
|
2563
|
-
constructor(n,
|
2564
|
-
super(), this.object = n, this.domElement =
|
2455
|
+
const qt = { type: "change" }, jt = { type: "start" }, Qt = { type: "end" }, gt = new In(), Jt = new Nn(), Ai = Math.cos(70 * Ln.DEG2RAD);
|
2456
|
+
class Ii extends rn {
|
2457
|
+
constructor(n, i) {
|
2458
|
+
super(), this.object = n, this.domElement = i, this.domElement.style.touchAction = "none", this.enabled = !0, this.target = new G(), this.cursor = new G(), 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: ze.ROTATE, MIDDLE: ze.DOLLY, RIGHT: ze.PAN }, this.touches = { ONE: Ye.ROTATE, TWO: Ye.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this.getPolarAngle = function() {
|
2565
2459
|
return l.phi;
|
2566
2460
|
}, this.getAzimuthalAngle = function() {
|
2567
2461
|
return l.theta;
|
2568
2462
|
}, this.getDistance = function() {
|
2569
2463
|
return this.object.position.distanceTo(this.target);
|
2570
2464
|
}, this.listenToKeyEvents = function(o) {
|
2571
|
-
o.addEventListener("keydown",
|
2465
|
+
o.addEventListener("keydown", Qe), this._domElementKeyEvents = o;
|
2572
2466
|
}, this.stopListenToKeyEvents = function() {
|
2573
|
-
this._domElementKeyEvents.removeEventListener("keydown",
|
2467
|
+
this._domElementKeyEvents.removeEventListener("keydown", Qe), this._domElementKeyEvents = null;
|
2574
2468
|
}, this.saveState = function() {
|
2575
2469
|
e.target0.copy(e.target), e.position0.copy(e.object.position), e.zoom0 = e.object.zoom;
|
2576
2470
|
}, this.reset = function() {
|
2577
|
-
e.target.copy(e.target0), e.object.position.copy(e.position0), e.object.zoom = e.zoom0, e.object.updateProjectionMatrix(), e.dispatchEvent(
|
2471
|
+
e.target.copy(e.target0), e.object.position.copy(e.position0), e.object.zoom = e.zoom0, e.object.updateProjectionMatrix(), e.dispatchEvent(qt), e.update(), s = a.NONE;
|
2578
2472
|
}, this.update = function() {
|
2579
|
-
const o = new
|
2580
|
-
return function(
|
2473
|
+
const o = new G(), y = new Vt().setFromUnitVectors(n.up, new G(0, 1, 0)), _ = y.clone().invert(), A = new G(), te = new Vt(), ve = new G(), le = 2 * Math.PI;
|
2474
|
+
return function(mt = null) {
|
2581
2475
|
const be = e.object.position;
|
2582
|
-
o.copy(be).sub(e.target), o.applyQuaternion(
|
2476
|
+
o.copy(be).sub(e.target), o.applyQuaternion(y), l.setFromVector3(o), e.autoRotate && s === a.NONE && F(b(mt)), e.enableDamping ? (l.theta += d.theta * e.dampingFactor, l.phi += d.phi * e.dampingFactor) : (l.theta += d.theta, l.phi += d.phi);
|
2583
2477
|
let fe = e.minAzimuthAngle, he = e.maxAzimuthAngle;
|
2584
|
-
isFinite(fe) && isFinite(he) && (fe < -Math.PI ? fe += le : fe > Math.PI && (fe -= le), he < -Math.PI ? he += le : he > Math.PI && (he -= le), fe <= he ? l.theta = Math.max(fe, Math.min(he, l.theta)) : l.theta = l.theta > (fe + he) / 2 ? Math.max(fe, l.theta) : Math.min(he, l.theta)), l.phi = Math.max(e.minPolarAngle, Math.min(e.maxPolarAngle, l.phi)), l.makeSafe(), e.enableDamping === !0 ? e.target.addScaledVector(
|
2478
|
+
isFinite(fe) && isFinite(he) && (fe < -Math.PI ? fe += le : fe > Math.PI && (fe -= le), he < -Math.PI ? he += le : he > Math.PI && (he -= le), fe <= he ? l.theta = Math.max(fe, Math.min(he, l.theta)) : l.theta = l.theta > (fe + he) / 2 ? Math.max(fe, l.theta) : Math.min(he, l.theta)), l.phi = Math.max(e.minPolarAngle, Math.min(e.maxPolarAngle, l.phi)), l.makeSafe(), e.enableDamping === !0 ? e.target.addScaledVector(v, e.dampingFactor) : e.target.add(v), e.target.sub(e.cursor), e.target.clampLength(e.minTargetRadius, e.maxTargetRadius), e.target.add(e.cursor), e.zoomToCursor && ee || e.object.isOrthographicCamera ? l.radius = X(l.radius) : l.radius = X(l.radius * m), o.setFromSpherical(l), o.applyQuaternion(_), be.copy(e.target).add(o), e.object.lookAt(e.target), e.enableDamping === !0 ? (d.theta *= 1 - e.dampingFactor, d.phi *= 1 - e.dampingFactor, v.multiplyScalar(1 - e.dampingFactor)) : (d.set(0, 0, 0), v.set(0, 0, 0));
|
2585
2479
|
let $e = !1;
|
2586
|
-
if (e.zoomToCursor &&
|
2587
|
-
let
|
2480
|
+
if (e.zoomToCursor && ee) {
|
2481
|
+
let _e = null;
|
2588
2482
|
if (e.object.isPerspectiveCamera) {
|
2589
|
-
const
|
2590
|
-
|
2591
|
-
const
|
2592
|
-
e.object.position.addScaledVector(de,
|
2483
|
+
const Oe = o.length();
|
2484
|
+
_e = X(Oe * m);
|
2485
|
+
const Ve = Oe - _e;
|
2486
|
+
e.object.position.addScaledVector(de, Ve), e.object.updateMatrixWorld();
|
2593
2487
|
} else if (e.object.isOrthographicCamera) {
|
2594
|
-
const
|
2595
|
-
|
2596
|
-
const
|
2597
|
-
|
2488
|
+
const Oe = new G(ce.x, ce.y, 0);
|
2489
|
+
Oe.unproject(e.object), e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom / m)), e.object.updateProjectionMatrix(), $e = !0;
|
2490
|
+
const Ve = new G(ce.x, ce.y, 0);
|
2491
|
+
Ve.unproject(e.object), e.object.position.sub(Ve).add(Oe), e.object.updateMatrixWorld(), _e = o.length();
|
2598
2492
|
} else
|
2599
2493
|
console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), e.zoomToCursor = !1;
|
2600
|
-
|
2494
|
+
_e !== null && (this.screenSpacePanning ? e.target.set(0, 0, -1).transformDirection(e.object.matrix).multiplyScalar(_e).add(e.object.position) : (gt.origin.copy(e.object.position), gt.direction.set(0, 0, -1).transformDirection(e.object.matrix), Math.abs(e.object.up.dot(gt.direction)) < Ai ? n.lookAt(e.target) : (Jt.setFromNormalAndCoplanarPoint(e.object.up, e.target), gt.intersectPlane(Jt, e.target))));
|
2601
2495
|
} else
|
2602
|
-
e.object.isOrthographicCamera && (e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom /
|
2603
|
-
return
|
2496
|
+
e.object.isOrthographicCamera && (e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom / m)), e.object.updateProjectionMatrix(), $e = !0);
|
2497
|
+
return m = 1, ee = !1, $e || A.distanceToSquared(e.object.position) > h || 8 * (1 - te.dot(e.object.quaternion)) > h || ve.distanceToSquared(e.target) > 0 ? (e.dispatchEvent(qt), A.copy(e.object.position), te.copy(e.object.quaternion), ve.copy(e.target), !0) : !1;
|
2604
2498
|
};
|
2605
2499
|
}(), this.dispose = function() {
|
2606
|
-
e.domElement.removeEventListener("contextmenu",
|
2500
|
+
e.domElement.removeEventListener("contextmenu", Se), e.domElement.removeEventListener("pointerdown", Ze), e.domElement.removeEventListener("pointercancel", je), e.domElement.removeEventListener("wheel", ut), e.domElement.removeEventListener("pointermove", Ce), e.domElement.removeEventListener("pointerup", je), e._domElementKeyEvents !== null && (e._domElementKeyEvents.removeEventListener("keydown", Qe), e._domElementKeyEvents = null);
|
2607
2501
|
};
|
2608
|
-
const e = this,
|
2502
|
+
const e = this, a = {
|
2609
2503
|
NONE: -1,
|
2610
2504
|
ROTATE: 0,
|
2611
2505
|
DOLLY: 1,
|
@@ -2615,261 +2509,261 @@ class Ia extends nn {
|
|
2615
2509
|
TOUCH_DOLLY_PAN: 5,
|
2616
2510
|
TOUCH_DOLLY_ROTATE: 6
|
2617
2511
|
};
|
2618
|
-
let s =
|
2619
|
-
const
|
2620
|
-
let
|
2621
|
-
const
|
2622
|
-
let
|
2623
|
-
const
|
2624
|
-
function
|
2512
|
+
let s = a.NONE;
|
2513
|
+
const h = 1e-6, l = new Gt(), d = new Gt();
|
2514
|
+
let m = 1;
|
2515
|
+
const v = new G(), E = new ue(), x = new ue(), R = new ue(), T = new ue(), B = new ue(), oe = new ue(), H = new ue(), C = new ue(), K = new ue(), de = new G(), ce = new ue();
|
2516
|
+
let ee = !1;
|
2517
|
+
const u = [], p = {};
|
2518
|
+
function b(o) {
|
2625
2519
|
return o !== null ? 2 * Math.PI / 60 * e.autoRotateSpeed * o : 2 * Math.PI / 60 / 60 * e.autoRotateSpeed;
|
2626
2520
|
}
|
2627
|
-
function
|
2628
|
-
const
|
2629
|
-
return Math.pow(0.95, e.zoomSpeed *
|
2521
|
+
function S(o) {
|
2522
|
+
const y = Math.abs(o) / (100 * (window.devicePixelRatio | 0));
|
2523
|
+
return Math.pow(0.95, e.zoomSpeed * y);
|
2630
2524
|
}
|
2631
|
-
function
|
2525
|
+
function F(o) {
|
2632
2526
|
d.theta -= o;
|
2633
2527
|
}
|
2634
|
-
function
|
2528
|
+
function U(o) {
|
2635
2529
|
d.phi -= o;
|
2636
2530
|
}
|
2637
|
-
const
|
2638
|
-
const o = new
|
2639
|
-
return function(_,
|
2640
|
-
o.setFromMatrixColumn(
|
2531
|
+
const N = function() {
|
2532
|
+
const o = new G();
|
2533
|
+
return function(_, A) {
|
2534
|
+
o.setFromMatrixColumn(A, 0), o.multiplyScalar(-_), v.add(o);
|
2641
2535
|
};
|
2642
2536
|
}(), D = function() {
|
2643
|
-
const o = new
|
2644
|
-
return function(_,
|
2645
|
-
e.screenSpacePanning === !0 ? o.setFromMatrixColumn(
|
2537
|
+
const o = new G();
|
2538
|
+
return function(_, A) {
|
2539
|
+
e.screenSpacePanning === !0 ? o.setFromMatrixColumn(A, 1) : (o.setFromMatrixColumn(A, 0), o.crossVectors(e.object.up, o)), o.multiplyScalar(_), v.add(o);
|
2646
2540
|
};
|
2647
|
-
}(),
|
2648
|
-
const o = new
|
2649
|
-
return function(_,
|
2650
|
-
const
|
2541
|
+
}(), L = function() {
|
2542
|
+
const o = new G();
|
2543
|
+
return function(_, A) {
|
2544
|
+
const te = e.domElement;
|
2651
2545
|
if (e.object.isPerspectiveCamera) {
|
2652
2546
|
const ve = e.object.position;
|
2653
2547
|
o.copy(ve).sub(e.target);
|
2654
2548
|
let le = o.length();
|
2655
|
-
le *= Math.tan(e.object.fov / 2 * Math.PI / 180),
|
2549
|
+
le *= Math.tan(e.object.fov / 2 * Math.PI / 180), N(2 * _ * le / te.clientHeight, e.object.matrix), D(2 * A * le / te.clientHeight, e.object.matrix);
|
2656
2550
|
} else
|
2657
|
-
e.object.isOrthographicCamera ? (
|
2551
|
+
e.object.isOrthographicCamera ? (N(_ * (e.object.right - e.object.left) / e.object.zoom / te.clientWidth, e.object.matrix), D(A * (e.object.top - e.object.bottom) / e.object.zoom / te.clientHeight, e.object.matrix)) : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."), e.enablePan = !1);
|
2658
2552
|
};
|
2659
2553
|
}();
|
2660
|
-
function
|
2661
|
-
e.object.isPerspectiveCamera || e.object.isOrthographicCamera ?
|
2554
|
+
function Q(o) {
|
2555
|
+
e.object.isPerspectiveCamera || e.object.isOrthographicCamera ? m /= o : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), e.enableZoom = !1);
|
2662
2556
|
}
|
2663
|
-
function
|
2664
|
-
e.object.isPerspectiveCamera || e.object.isOrthographicCamera ?
|
2557
|
+
function M(o) {
|
2558
|
+
e.object.isPerspectiveCamera || e.object.isOrthographicCamera ? m *= o : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), e.enableZoom = !1);
|
2665
2559
|
}
|
2666
|
-
function
|
2560
|
+
function k(o, y) {
|
2667
2561
|
if (!e.zoomToCursor)
|
2668
2562
|
return;
|
2669
|
-
|
2670
|
-
const _ = e.domElement.getBoundingClientRect(),
|
2671
|
-
ce.x =
|
2563
|
+
ee = !0;
|
2564
|
+
const _ = e.domElement.getBoundingClientRect(), A = o - _.left, te = y - _.top, ve = _.width, le = _.height;
|
2565
|
+
ce.x = A / ve * 2 - 1, ce.y = -(te / le) * 2 + 1, de.set(ce.x, ce.y, 1).unproject(e.object).sub(e.object.position).normalize();
|
2672
2566
|
}
|
2673
2567
|
function X(o) {
|
2674
2568
|
return Math.max(e.minDistance, Math.min(e.maxDistance, o));
|
2675
2569
|
}
|
2676
2570
|
function pe(o) {
|
2677
|
-
|
2571
|
+
E.set(o.clientX, o.clientY);
|
2678
2572
|
}
|
2679
|
-
function
|
2680
|
-
|
2573
|
+
function Te(o) {
|
2574
|
+
k(o.clientX, o.clientX), H.set(o.clientX, o.clientY);
|
2681
2575
|
}
|
2682
2576
|
function He(o) {
|
2683
|
-
|
2577
|
+
T.set(o.clientX, o.clientY);
|
2684
2578
|
}
|
2685
|
-
function
|
2686
|
-
x.set(o.clientX, o.clientY),
|
2687
|
-
const
|
2688
|
-
|
2579
|
+
function at(o) {
|
2580
|
+
x.set(o.clientX, o.clientY), R.subVectors(x, E).multiplyScalar(e.rotateSpeed);
|
2581
|
+
const y = e.domElement;
|
2582
|
+
F(2 * Math.PI * R.x / y.clientHeight), U(2 * Math.PI * R.y / y.clientHeight), E.copy(x), e.update();
|
2689
2583
|
}
|
2690
|
-
function
|
2691
|
-
|
2584
|
+
function wt(o) {
|
2585
|
+
C.set(o.clientX, o.clientY), K.subVectors(C, H), K.y > 0 ? Q(S(K.y)) : K.y < 0 && M(S(K.y)), H.copy(C), e.update();
|
2692
2586
|
}
|
2693
|
-
function
|
2694
|
-
|
2587
|
+
function Ct(o) {
|
2588
|
+
B.set(o.clientX, o.clientY), oe.subVectors(B, T).multiplyScalar(e.panSpeed), L(oe.x, oe.y), T.copy(B), e.update();
|
2695
2589
|
}
|
2696
2590
|
function Ke(o) {
|
2697
|
-
|
2591
|
+
k(o.clientX, o.clientY), o.deltaY < 0 ? M(S(o.deltaY)) : o.deltaY > 0 && Q(S(o.deltaY)), e.update();
|
2698
2592
|
}
|
2699
2593
|
function Xe(o) {
|
2700
|
-
let
|
2594
|
+
let y = !1;
|
2701
2595
|
switch (o.code) {
|
2702
2596
|
case e.keys.UP:
|
2703
|
-
o.ctrlKey || o.metaKey || o.shiftKey ?
|
2597
|
+
o.ctrlKey || o.metaKey || o.shiftKey ? U(2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : L(0, e.keyPanSpeed), y = !0;
|
2704
2598
|
break;
|
2705
2599
|
case e.keys.BOTTOM:
|
2706
|
-
o.ctrlKey || o.metaKey || o.shiftKey ?
|
2600
|
+
o.ctrlKey || o.metaKey || o.shiftKey ? U(-2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : L(0, -e.keyPanSpeed), y = !0;
|
2707
2601
|
break;
|
2708
2602
|
case e.keys.LEFT:
|
2709
|
-
o.ctrlKey || o.metaKey || o.shiftKey ?
|
2603
|
+
o.ctrlKey || o.metaKey || o.shiftKey ? F(2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : L(e.keyPanSpeed, 0), y = !0;
|
2710
2604
|
break;
|
2711
2605
|
case e.keys.RIGHT:
|
2712
|
-
o.ctrlKey || o.metaKey || o.shiftKey ?
|
2606
|
+
o.ctrlKey || o.metaKey || o.shiftKey ? F(-2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : L(-e.keyPanSpeed, 0), y = !0;
|
2713
2607
|
break;
|
2714
2608
|
}
|
2715
|
-
|
2609
|
+
y && (o.preventDefault(), e.update());
|
2716
2610
|
}
|
2717
|
-
function
|
2718
|
-
if (
|
2719
|
-
|
2611
|
+
function Me(o) {
|
2612
|
+
if (u.length === 1)
|
2613
|
+
E.set(o.pageX, o.pageY);
|
2720
2614
|
else {
|
2721
|
-
const
|
2722
|
-
|
2615
|
+
const y = ge(o), _ = 0.5 * (o.pageX + y.x), A = 0.5 * (o.pageY + y.y);
|
2616
|
+
E.set(_, A);
|
2723
2617
|
}
|
2724
2618
|
}
|
2725
2619
|
function Ue(o) {
|
2726
|
-
if (
|
2727
|
-
|
2620
|
+
if (u.length === 1)
|
2621
|
+
T.set(o.pageX, o.pageY);
|
2728
2622
|
else {
|
2729
|
-
const
|
2730
|
-
|
2623
|
+
const y = ge(o), _ = 0.5 * (o.pageX + y.x), A = 0.5 * (o.pageY + y.y);
|
2624
|
+
T.set(_, A);
|
2731
2625
|
}
|
2732
2626
|
}
|
2733
|
-
function
|
2734
|
-
const
|
2735
|
-
H.set(0,
|
2627
|
+
function Re(o) {
|
2628
|
+
const y = ge(o), _ = o.pageX - y.x, A = o.pageY - y.y, te = Math.sqrt(_ * _ + A * A);
|
2629
|
+
H.set(0, te);
|
2736
2630
|
}
|
2737
|
-
function
|
2738
|
-
e.enableZoom &&
|
2631
|
+
function St(o) {
|
2632
|
+
e.enableZoom && Re(o), e.enablePan && Ue(o);
|
2739
2633
|
}
|
2740
|
-
function
|
2741
|
-
e.enableZoom &&
|
2634
|
+
function ot(o) {
|
2635
|
+
e.enableZoom && Re(o), e.enableRotate && Me(o);
|
2742
2636
|
}
|
2743
|
-
function
|
2744
|
-
if (
|
2637
|
+
function st(o) {
|
2638
|
+
if (u.length == 1)
|
2745
2639
|
x.set(o.pageX, o.pageY);
|
2746
2640
|
else {
|
2747
|
-
const _ = ge(o),
|
2748
|
-
x.set(
|
2641
|
+
const _ = ge(o), A = 0.5 * (o.pageX + _.x), te = 0.5 * (o.pageY + _.y);
|
2642
|
+
x.set(A, te);
|
2749
2643
|
}
|
2750
|
-
|
2751
|
-
const
|
2752
|
-
|
2644
|
+
R.subVectors(x, E).multiplyScalar(e.rotateSpeed);
|
2645
|
+
const y = e.domElement;
|
2646
|
+
F(2 * Math.PI * R.x / y.clientHeight), U(2 * Math.PI * R.y / y.clientHeight), E.copy(x);
|
2753
2647
|
}
|
2754
|
-
function
|
2755
|
-
if (
|
2756
|
-
|
2648
|
+
function ct(o) {
|
2649
|
+
if (u.length === 1)
|
2650
|
+
B.set(o.pageX, o.pageY);
|
2757
2651
|
else {
|
2758
|
-
const
|
2759
|
-
|
2652
|
+
const y = ge(o), _ = 0.5 * (o.pageX + y.x), A = 0.5 * (o.pageY + y.y);
|
2653
|
+
B.set(_, A);
|
2760
2654
|
}
|
2761
|
-
|
2655
|
+
oe.subVectors(B, T).multiplyScalar(e.panSpeed), L(oe.x, oe.y), T.copy(B);
|
2762
2656
|
}
|
2763
|
-
function
|
2764
|
-
const
|
2765
|
-
|
2766
|
-
const ve = (o.pageX +
|
2767
|
-
|
2657
|
+
function Pe(o) {
|
2658
|
+
const y = ge(o), _ = o.pageX - y.x, A = o.pageY - y.y, te = Math.sqrt(_ * _ + A * A);
|
2659
|
+
C.set(0, te), K.set(0, Math.pow(C.y / H.y, e.zoomSpeed)), Q(K.y), H.copy(C);
|
2660
|
+
const ve = (o.pageX + y.x) * 0.5, le = (o.pageY + y.y) * 0.5;
|
2661
|
+
k(ve, le);
|
2768
2662
|
}
|
2769
2663
|
function Be(o) {
|
2770
|
-
e.enableZoom &&
|
2664
|
+
e.enableZoom && Pe(o), e.enablePan && ct(o);
|
2771
2665
|
}
|
2772
|
-
function
|
2773
|
-
e.enableZoom &&
|
2666
|
+
function lt(o) {
|
2667
|
+
e.enableZoom && Pe(o), e.enableRotate && st(o);
|
2774
2668
|
}
|
2775
|
-
function
|
2776
|
-
e.enabled !== !1 && (
|
2669
|
+
function Ze(o) {
|
2670
|
+
e.enabled !== !1 && (u.length === 0 && (e.domElement.setPointerCapture(o.pointerId), e.domElement.addEventListener("pointermove", Ce), e.domElement.addEventListener("pointerup", je)), Tt(o), o.pointerType === "touch" ? dt(o) : Ot(o));
|
2777
2671
|
}
|
2778
|
-
function
|
2779
|
-
e.enabled !== !1 && (o.pointerType === "touch" ?
|
2672
|
+
function Ce(o) {
|
2673
|
+
e.enabled !== !1 && (o.pointerType === "touch" ? ft(o) : qe(o));
|
2780
2674
|
}
|
2781
|
-
function
|
2782
|
-
|
2675
|
+
function je(o) {
|
2676
|
+
ht(o), u.length === 0 && (e.domElement.releasePointerCapture(o.pointerId), e.domElement.removeEventListener("pointermove", Ce), e.domElement.removeEventListener("pointerup", je)), e.dispatchEvent(Qt), s = a.NONE;
|
2783
2677
|
}
|
2784
|
-
function
|
2785
|
-
let
|
2678
|
+
function Ot(o) {
|
2679
|
+
let y;
|
2786
2680
|
switch (o.button) {
|
2787
2681
|
case 0:
|
2788
|
-
|
2682
|
+
y = e.mouseButtons.LEFT;
|
2789
2683
|
break;
|
2790
2684
|
case 1:
|
2791
|
-
|
2685
|
+
y = e.mouseButtons.MIDDLE;
|
2792
2686
|
break;
|
2793
2687
|
case 2:
|
2794
|
-
|
2688
|
+
y = e.mouseButtons.RIGHT;
|
2795
2689
|
break;
|
2796
2690
|
default:
|
2797
|
-
|
2691
|
+
y = -1;
|
2798
2692
|
}
|
2799
|
-
switch (
|
2693
|
+
switch (y) {
|
2800
2694
|
case ze.DOLLY:
|
2801
2695
|
if (e.enableZoom === !1)
|
2802
2696
|
return;
|
2803
|
-
|
2697
|
+
Te(o), s = a.DOLLY;
|
2804
2698
|
break;
|
2805
2699
|
case ze.ROTATE:
|
2806
2700
|
if (o.ctrlKey || o.metaKey || o.shiftKey) {
|
2807
2701
|
if (e.enablePan === !1)
|
2808
2702
|
return;
|
2809
|
-
He(o), s =
|
2703
|
+
He(o), s = a.PAN;
|
2810
2704
|
} else {
|
2811
2705
|
if (e.enableRotate === !1)
|
2812
2706
|
return;
|
2813
|
-
pe(o), s =
|
2707
|
+
pe(o), s = a.ROTATE;
|
2814
2708
|
}
|
2815
2709
|
break;
|
2816
2710
|
case ze.PAN:
|
2817
2711
|
if (o.ctrlKey || o.metaKey || o.shiftKey) {
|
2818
2712
|
if (e.enableRotate === !1)
|
2819
2713
|
return;
|
2820
|
-
pe(o), s =
|
2714
|
+
pe(o), s = a.ROTATE;
|
2821
2715
|
} else {
|
2822
2716
|
if (e.enablePan === !1)
|
2823
2717
|
return;
|
2824
|
-
He(o), s =
|
2718
|
+
He(o), s = a.PAN;
|
2825
2719
|
}
|
2826
2720
|
break;
|
2827
2721
|
default:
|
2828
|
-
s =
|
2722
|
+
s = a.NONE;
|
2829
2723
|
}
|
2830
|
-
s !==
|
2724
|
+
s !== a.NONE && e.dispatchEvent(jt);
|
2831
2725
|
}
|
2832
|
-
function
|
2726
|
+
function qe(o) {
|
2833
2727
|
switch (s) {
|
2834
|
-
case
|
2728
|
+
case a.ROTATE:
|
2835
2729
|
if (e.enableRotate === !1)
|
2836
2730
|
return;
|
2837
|
-
|
2731
|
+
at(o);
|
2838
2732
|
break;
|
2839
|
-
case
|
2733
|
+
case a.DOLLY:
|
2840
2734
|
if (e.enableZoom === !1)
|
2841
2735
|
return;
|
2842
|
-
|
2736
|
+
wt(o);
|
2843
2737
|
break;
|
2844
|
-
case
|
2738
|
+
case a.PAN:
|
2845
2739
|
if (e.enablePan === !1)
|
2846
2740
|
return;
|
2847
|
-
|
2741
|
+
Ct(o);
|
2848
2742
|
break;
|
2849
2743
|
}
|
2850
2744
|
}
|
2851
|
-
function
|
2852
|
-
e.enabled === !1 || e.enableZoom === !1 || s !==
|
2745
|
+
function ut(o) {
|
2746
|
+
e.enabled === !1 || e.enableZoom === !1 || s !== a.NONE || (o.preventDefault(), e.dispatchEvent(jt), Ke(o), e.dispatchEvent(Qt));
|
2853
2747
|
}
|
2854
|
-
function
|
2748
|
+
function Qe(o) {
|
2855
2749
|
e.enabled === !1 || e.enablePan === !1 || Xe(o);
|
2856
2750
|
}
|
2857
|
-
function
|
2858
|
-
switch (
|
2751
|
+
function dt(o) {
|
2752
|
+
switch (Je(o), u.length) {
|
2859
2753
|
case 1:
|
2860
2754
|
switch (e.touches.ONE) {
|
2861
2755
|
case Ye.ROTATE:
|
2862
2756
|
if (e.enableRotate === !1)
|
2863
2757
|
return;
|
2864
|
-
|
2758
|
+
Me(o), s = a.TOUCH_ROTATE;
|
2865
2759
|
break;
|
2866
2760
|
case Ye.PAN:
|
2867
2761
|
if (e.enablePan === !1)
|
2868
2762
|
return;
|
2869
|
-
Ue(o), s =
|
2763
|
+
Ue(o), s = a.TOUCH_PAN;
|
2870
2764
|
break;
|
2871
2765
|
default:
|
2872
|
-
s =
|
2766
|
+
s = a.NONE;
|
2873
2767
|
}
|
2874
2768
|
break;
|
2875
2769
|
case 2:
|
@@ -2877,98 +2771,98 @@ class Ia extends nn {
|
|
2877
2771
|
case Ye.DOLLY_PAN:
|
2878
2772
|
if (e.enableZoom === !1 && e.enablePan === !1)
|
2879
2773
|
return;
|
2880
|
-
|
2774
|
+
St(o), s = a.TOUCH_DOLLY_PAN;
|
2881
2775
|
break;
|
2882
2776
|
case Ye.DOLLY_ROTATE:
|
2883
2777
|
if (e.enableZoom === !1 && e.enableRotate === !1)
|
2884
2778
|
return;
|
2885
|
-
|
2779
|
+
ot(o), s = a.TOUCH_DOLLY_ROTATE;
|
2886
2780
|
break;
|
2887
2781
|
default:
|
2888
|
-
s =
|
2782
|
+
s = a.NONE;
|
2889
2783
|
}
|
2890
2784
|
break;
|
2891
2785
|
default:
|
2892
|
-
s =
|
2786
|
+
s = a.NONE;
|
2893
2787
|
}
|
2894
|
-
s !==
|
2788
|
+
s !== a.NONE && e.dispatchEvent(jt);
|
2895
2789
|
}
|
2896
|
-
function
|
2897
|
-
switch (
|
2898
|
-
case
|
2790
|
+
function ft(o) {
|
2791
|
+
switch (Je(o), s) {
|
2792
|
+
case a.TOUCH_ROTATE:
|
2899
2793
|
if (e.enableRotate === !1)
|
2900
2794
|
return;
|
2901
|
-
|
2795
|
+
st(o), e.update();
|
2902
2796
|
break;
|
2903
|
-
case
|
2797
|
+
case a.TOUCH_PAN:
|
2904
2798
|
if (e.enablePan === !1)
|
2905
2799
|
return;
|
2906
|
-
|
2800
|
+
ct(o), e.update();
|
2907
2801
|
break;
|
2908
|
-
case
|
2802
|
+
case a.TOUCH_DOLLY_PAN:
|
2909
2803
|
if (e.enableZoom === !1 && e.enablePan === !1)
|
2910
2804
|
return;
|
2911
2805
|
Be(o), e.update();
|
2912
2806
|
break;
|
2913
|
-
case
|
2807
|
+
case a.TOUCH_DOLLY_ROTATE:
|
2914
2808
|
if (e.enableZoom === !1 && e.enableRotate === !1)
|
2915
2809
|
return;
|
2916
|
-
|
2810
|
+
lt(o), e.update();
|
2917
2811
|
break;
|
2918
2812
|
default:
|
2919
|
-
s =
|
2813
|
+
s = a.NONE;
|
2920
2814
|
}
|
2921
2815
|
}
|
2922
|
-
function
|
2816
|
+
function Se(o) {
|
2923
2817
|
e.enabled !== !1 && o.preventDefault();
|
2924
2818
|
}
|
2925
|
-
function
|
2926
|
-
|
2819
|
+
function Tt(o) {
|
2820
|
+
u.push(o.pointerId);
|
2927
2821
|
}
|
2928
|
-
function
|
2929
|
-
delete
|
2930
|
-
for (let
|
2931
|
-
if (
|
2932
|
-
|
2822
|
+
function ht(o) {
|
2823
|
+
delete p[o.pointerId];
|
2824
|
+
for (let y = 0; y < u.length; y++)
|
2825
|
+
if (u[y] == o.pointerId) {
|
2826
|
+
u.splice(y, 1);
|
2933
2827
|
return;
|
2934
2828
|
}
|
2935
2829
|
}
|
2936
|
-
function
|
2937
|
-
let
|
2938
|
-
|
2830
|
+
function Je(o) {
|
2831
|
+
let y = p[o.pointerId];
|
2832
|
+
y === void 0 && (y = new ue(), p[o.pointerId] = y), y.set(o.pageX, o.pageY);
|
2939
2833
|
}
|
2940
2834
|
function ge(o) {
|
2941
|
-
const
|
2942
|
-
return
|
2835
|
+
const y = o.pointerId === u[0] ? u[1] : u[0];
|
2836
|
+
return p[y];
|
2943
2837
|
}
|
2944
|
-
e.domElement.addEventListener("contextmenu",
|
2838
|
+
e.domElement.addEventListener("contextmenu", Se), e.domElement.addEventListener("pointerdown", Ze), e.domElement.addEventListener("pointercancel", je), e.domElement.addEventListener("wheel", ut, { passive: !1 }), this.update();
|
2945
2839
|
}
|
2946
2840
|
}
|
2947
|
-
const
|
2948
|
-
const [n,
|
2841
|
+
const yt = (t) => {
|
2842
|
+
const [n, i] = ae(t.options[t.index]), e = () => {
|
2949
2843
|
t.onToggle(!t.open);
|
2950
|
-
},
|
2951
|
-
s !== n && (t.onSelect(s),
|
2844
|
+
}, a = (s) => {
|
2845
|
+
s !== n && (t.onSelect(s), i(s)), t.onToggle(!1);
|
2952
2846
|
};
|
2953
|
-
return /* @__PURE__ */
|
2954
|
-
/* @__PURE__ */
|
2955
|
-
t.open && /* @__PURE__ */
|
2847
|
+
return /* @__PURE__ */ c.jsxs("div", { className: `dropdown ${t.up === !0 ? "up" : ""}`, children: [
|
2848
|
+
/* @__PURE__ */ c.jsx("div", { className: "dropdown-toggle", onClick: e, children: n }),
|
2849
|
+
t.open && /* @__PURE__ */ c.jsx("ul", { className: "dropdown-menu", children: t.options.map((s) => /* @__PURE__ */ c.jsx("li", { onClick: () => a(s), children: s }, s)) })
|
2956
2850
|
] });
|
2957
|
-
}, ke = Xn(function(n,
|
2958
|
-
const [e,
|
2959
|
-
return /* @__PURE__ */
|
2960
|
-
/* @__PURE__ */
|
2961
|
-
e &&
|
2851
|
+
}, ke = Xn(function(n, i) {
|
2852
|
+
const [e, a] = ae(!1), s = n.options.indexOf(n.camera.name);
|
2853
|
+
return /* @__PURE__ */ c.jsxs("div", { className: "CameraWindow", children: [
|
2854
|
+
/* @__PURE__ */ c.jsx("div", { ref: i, className: "clickable", onClick: () => {
|
2855
|
+
e && a(!1);
|
2962
2856
|
} }),
|
2963
|
-
/* @__PURE__ */
|
2964
|
-
|
2857
|
+
/* @__PURE__ */ c.jsx(
|
2858
|
+
yt,
|
2965
2859
|
{
|
2966
2860
|
index: s,
|
2967
2861
|
open: e,
|
2968
2862
|
options: n.options,
|
2969
2863
|
onSelect: n.onSelect,
|
2970
|
-
onToggle: (
|
2971
|
-
|
2864
|
+
onToggle: (h) => {
|
2865
|
+
a(h);
|
2972
2866
|
},
|
2973
2867
|
up: !0
|
2974
2868
|
}
|
@@ -2979,199 +2873,204 @@ const Et = (t) => {
|
|
2979
2873
|
"Side by Side",
|
2980
2874
|
"Stacked",
|
2981
2875
|
"Quad"
|
2982
|
-
],
|
2876
|
+
], ne = /* @__PURE__ */ new Map(), ie = /* @__PURE__ */ new Map(), Ee = /* @__PURE__ */ new Map();
|
2983
2877
|
function Fe(t, n) {
|
2984
|
-
const
|
2985
|
-
return
|
2878
|
+
const i = new sn(-100, 100, 100, -100, 50, 3e3);
|
2879
|
+
return i.name = t, i.position.copy(n), i.lookAt(0, 0, 0), ne.set(t, i), i;
|
2986
2880
|
}
|
2987
|
-
Fe("Top", new
|
2988
|
-
Fe("Bottom", new
|
2989
|
-
Fe("Left", new
|
2990
|
-
Fe("Right", new
|
2991
|
-
Fe("Front", new
|
2992
|
-
Fe("Back", new
|
2993
|
-
Fe("Orthographic", new
|
2994
|
-
const
|
2995
|
-
|
2996
|
-
|
2997
|
-
|
2998
|
-
|
2881
|
+
Fe("Top", new G(0, 1e3, 0));
|
2882
|
+
Fe("Bottom", new G(0, -1e3, 0));
|
2883
|
+
Fe("Left", new G(-1e3, 0, 0));
|
2884
|
+
Fe("Right", new G(1e3, 0, 0));
|
2885
|
+
Fe("Front", new G(0, 0, 1e3));
|
2886
|
+
Fe("Back", new G(0, 0, -1e3));
|
2887
|
+
Fe("Orthographic", new G(1e3, 1e3, 1e3));
|
2888
|
+
const xt = new _t(60, 1, 50, 3e3);
|
2889
|
+
xt.name = "Debug";
|
2890
|
+
xt.position.set(500, 500, 500);
|
2891
|
+
xt.lookAt(0, 0, 0);
|
2892
|
+
ne.set("Debug", xt);
|
2999
2893
|
const tn = [
|
3000
2894
|
"Renderer",
|
3001
2895
|
"Depth",
|
3002
2896
|
"Normals",
|
3003
2897
|
"UVs",
|
3004
2898
|
"Wireframe"
|
3005
|
-
],
|
2899
|
+
], Ni = new Fn(), Li = new Un(), Fi = new bi(), Ui = new Bn({
|
3006
2900
|
opacity: 0.33,
|
3007
2901
|
transparent: !0,
|
3008
2902
|
wireframe: !0
|
3009
2903
|
});
|
3010
|
-
let
|
3011
|
-
const
|
3012
|
-
|
3013
|
-
let
|
3014
|
-
|
2904
|
+
let vt = "Renderer";
|
2905
|
+
const V = new cn();
|
2906
|
+
V.name = "Debug Scene";
|
2907
|
+
let xe = new cn();
|
2908
|
+
V.add(xe);
|
3015
2909
|
const rt = new $n();
|
3016
2910
|
rt.name = "helpers";
|
3017
|
-
|
3018
|
-
const
|
3019
|
-
rt.add(
|
3020
|
-
const
|
3021
|
-
|
3022
|
-
rt.add(
|
3023
|
-
const it = new
|
2911
|
+
V.add(rt);
|
2912
|
+
const Bi = new mi();
|
2913
|
+
rt.add(Bi);
|
2914
|
+
const bn = new ln(500);
|
2915
|
+
bn.name = "axisHelper";
|
2916
|
+
rt.add(bn);
|
2917
|
+
const it = new ln(100);
|
3024
2918
|
it.name = "interactionHelper";
|
3025
2919
|
rt.add(it);
|
3026
2920
|
it.visible = !1;
|
3027
|
-
let
|
3028
|
-
function
|
3029
|
-
const [n,
|
3030
|
-
const
|
3031
|
-
|
3032
|
-
const
|
3033
|
-
|
3034
|
-
const
|
3035
|
-
switch (
|
2921
|
+
let bt = !1, $ = ne.get("Debug"), re = ne.get("Orthographic"), Ae = ne.get("Front"), Ie = ne.get("Top"), nn = !1;
|
2922
|
+
function ar(t) {
|
2923
|
+
const [n, i] = ae(t.mode !== void 0 ? t.mode : "Single"), [e, a] = ae(null), [s, h] = ae(!1), [l, d] = ae(!1), [m, v] = ae(!1), [, E] = ae(Date.now()), x = we(null), R = we(null), T = we(null), B = we(null), oe = we(null), H = we(null), C = (u, p) => {
|
2924
|
+
const b = ie.get(u.name);
|
2925
|
+
b !== void 0 && b.dispose(), ie.delete(u.name);
|
2926
|
+
const S = Ee.get(u.name);
|
2927
|
+
S !== void 0 && (V.remove(S), S.dispose()), Ee.delete(u.name);
|
2928
|
+
const F = new Ii(u, p);
|
2929
|
+
switch (F.enableDamping = !0, F.dampingFactor = 0.05, u.name) {
|
3036
2930
|
case "Top":
|
3037
2931
|
case "Bottom":
|
3038
2932
|
case "Left":
|
3039
2933
|
case "Right":
|
3040
2934
|
case "Front":
|
3041
2935
|
case "Back":
|
3042
|
-
|
2936
|
+
F.enableRotate = !1;
|
3043
2937
|
break;
|
3044
2938
|
}
|
3045
|
-
if (
|
3046
|
-
const
|
3047
|
-
Ee.set(
|
2939
|
+
if (ie.set(u.name, F), u instanceof _t) {
|
2940
|
+
const U = new zn(u);
|
2941
|
+
Ee.set(u.name, U), V.add(U);
|
3048
2942
|
}
|
3049
|
-
}, K = (
|
3050
|
-
const
|
3051
|
-
|
3052
|
-
const
|
3053
|
-
|
2943
|
+
}, K = (u) => {
|
2944
|
+
const p = Ee.get(u.name);
|
2945
|
+
p !== void 0 && (V.remove(p), p.dispose(), Ee.delete(u.name));
|
2946
|
+
const b = ie.get(u.name);
|
2947
|
+
b !== void 0 && (b.dispose(), ie.delete(u.name));
|
3054
2948
|
}, de = () => {
|
3055
|
-
|
3056
|
-
|
3057
|
-
const
|
3058
|
-
|
3059
|
-
}),
|
2949
|
+
ie.forEach((u, p) => {
|
2950
|
+
u.dispose();
|
2951
|
+
const b = Ee.get(p);
|
2952
|
+
b !== void 0 && (V.remove(b), b.dispose()), Ee.delete(p), ie.delete(p);
|
2953
|
+
}), ie.clear(), Ee.clear();
|
3060
2954
|
}, ce = () => {
|
3061
2955
|
switch (n) {
|
3062
2956
|
case "Single":
|
3063
|
-
|
2957
|
+
C($, T.current);
|
3064
2958
|
break;
|
3065
2959
|
case "Side by Side":
|
3066
2960
|
case "Stacked":
|
3067
|
-
|
2961
|
+
C($, T.current), C(re, B.current);
|
3068
2962
|
break;
|
3069
2963
|
case "Quad":
|
3070
|
-
|
2964
|
+
C($, T.current), C(re, B.current), C(Ae, oe.current), C(Ie, H.current);
|
3071
2965
|
break;
|
3072
2966
|
}
|
3073
2967
|
};
|
3074
2968
|
Ne(() => {
|
3075
|
-
const
|
2969
|
+
const u = new Vn({
|
3076
2970
|
canvas: x.current,
|
3077
2971
|
stencil: !1
|
3078
2972
|
});
|
3079
|
-
|
2973
|
+
u.autoClear = !1, u.shadowMap.enabled = !0, u.setPixelRatio(devicePixelRatio), u.setClearColor(0), a(u);
|
3080
2974
|
}, []), Ne(() => {
|
3081
|
-
const
|
3082
|
-
|
3083
|
-
|
3084
|
-
|
3085
|
-
|
3086
|
-
|
3087
|
-
|
3088
|
-
|
2975
|
+
const u = (S) => {
|
2976
|
+
hn(xe), V.remove(xe);
|
2977
|
+
const F = t.scenes.get(S.value.name);
|
2978
|
+
if (F !== void 0) {
|
2979
|
+
const U = new F();
|
2980
|
+
t.onSceneSet !== void 0 && t.onSceneSet(U), xe = U, t.three.scene = xe, V.add(xe), nn = !0;
|
2981
|
+
}
|
2982
|
+
}, p = (S) => {
|
2983
|
+
var N;
|
2984
|
+
const F = S.value, U = (N = t.three.scene) == null ? void 0 : N.getObjectByProperty("uuid", F.uuid);
|
2985
|
+
U !== void 0 && ne.set(F.name, U), E(Date.now());
|
2986
|
+
}, b = (S) => {
|
2987
|
+
ne.delete(S.value.name), E(Date.now());
|
3089
2988
|
};
|
3090
|
-
return
|
3091
|
-
|
2989
|
+
return z.addEventListener(Y.SET_SCENE, u), z.addEventListener(Y.ADD_CAMERA, p), z.addEventListener(Y.REMOVE_CAMERA, b), () => {
|
2990
|
+
z.removeEventListener(Y.SET_SCENE, u), z.removeEventListener(Y.ADD_CAMERA, p), z.removeEventListener(Y.REMOVE_CAMERA, b);
|
3092
2991
|
};
|
3093
2992
|
}, []), Ne(() => {
|
3094
2993
|
if (e === null)
|
3095
2994
|
return;
|
3096
|
-
let
|
3097
|
-
const
|
3098
|
-
|
3099
|
-
let
|
2995
|
+
let u = window.innerWidth, p = window.innerHeight, b = Math.floor(u / 2), S = Math.floor(p / 2), F = -1;
|
2996
|
+
const U = () => {
|
2997
|
+
u = window.innerWidth - 300, p = window.innerHeight, b = Math.floor(u / 2), S = Math.floor(p / 2), e.setSize(u, p);
|
2998
|
+
let M = u, k = p;
|
3100
2999
|
switch (n) {
|
3101
3000
|
case "Side by Side":
|
3102
|
-
|
3001
|
+
M = b, k = p;
|
3103
3002
|
break;
|
3104
3003
|
case "Stacked":
|
3105
|
-
|
3004
|
+
M = u, k = S;
|
3106
3005
|
break;
|
3107
3006
|
case "Quad":
|
3108
|
-
|
3007
|
+
M = b, k = S;
|
3109
3008
|
break;
|
3110
3009
|
}
|
3111
|
-
|
3010
|
+
ne.forEach((X) => {
|
3112
3011
|
var pe;
|
3113
|
-
X instanceof
|
3012
|
+
X instanceof sn ? (X.left = M / -2, X.right = M / 2, X.top = k / 2, X.bottom = k / -2, X.updateProjectionMatrix()) : X instanceof _t && (X.aspect = M / k, X.updateProjectionMatrix(), (pe = Ee.get(X.name)) == null || pe.update());
|
3114
3013
|
});
|
3115
|
-
},
|
3116
|
-
e.setViewport(0, 0,
|
3014
|
+
}, N = () => {
|
3015
|
+
e.setViewport(0, 0, u, p), e.setScissor(0, 0, u, p), e.render(V, $);
|
3117
3016
|
}, D = () => {
|
3118
3017
|
if (n === "Side by Side")
|
3119
|
-
e.setViewport(0, 0,
|
3018
|
+
e.setViewport(0, 0, b, p), e.setScissor(0, 0, b, p), e.render(V, $), e.setViewport(b, 0, b, p), e.setScissor(b, 0, b, p), e.render(V, re);
|
3120
3019
|
else {
|
3121
|
-
const
|
3122
|
-
e.setViewport(0,
|
3020
|
+
const M = p - S;
|
3021
|
+
e.setViewport(0, M, u, S), e.setScissor(0, M, u, S), e.render(V, $), e.setViewport(0, 0, u, S), e.setScissor(0, 0, u, S), e.render(V, re);
|
3123
3022
|
}
|
3124
|
-
},
|
3125
|
-
let
|
3126
|
-
|
3127
|
-
},
|
3128
|
-
switch (
|
3129
|
-
|
3130
|
-
}), e.clear(), n) {
|
3023
|
+
}, L = () => {
|
3024
|
+
let M = 0, k = 0;
|
3025
|
+
k = p - S, M = 0, e.setViewport(M, k, b, S), e.setScissor(M, k, b, S), e.render(V, $), M = b, e.setViewport(M, k, b, S), e.setScissor(M, k, b, S), e.render(V, re), k = 0, M = 0, e.setViewport(M, k, b, S), e.setScissor(M, k, b, S), e.render(V, Ae), M = b, e.setViewport(M, k, b, S), e.setScissor(M, k, b, S), e.render(V, Ie);
|
3026
|
+
}, Q = () => {
|
3027
|
+
switch (ie.forEach((M) => {
|
3028
|
+
M.update();
|
3029
|
+
}), t.onSceneUpdate !== void 0 && nn && t.onSceneUpdate(xe), e.clear(), n) {
|
3131
3030
|
case "Single":
|
3132
|
-
|
3031
|
+
N();
|
3133
3032
|
break;
|
3134
3033
|
case "Side by Side":
|
3135
3034
|
case "Stacked":
|
3136
3035
|
D();
|
3137
3036
|
break;
|
3138
3037
|
case "Quad":
|
3139
|
-
|
3038
|
+
L();
|
3140
3039
|
break;
|
3141
3040
|
}
|
3142
|
-
|
3041
|
+
F = requestAnimationFrame(Q);
|
3143
3042
|
};
|
3144
|
-
return ce(), window.addEventListener("resize",
|
3145
|
-
window.removeEventListener("resize",
|
3043
|
+
return ce(), window.addEventListener("resize", U), U(), Q(), () => {
|
3044
|
+
window.removeEventListener("resize", U), cancelAnimationFrame(F), F = -1;
|
3146
3045
|
};
|
3147
3046
|
}, [n, e]), Ne(() => {
|
3148
3047
|
if (e !== null) {
|
3149
|
-
const
|
3048
|
+
const u = new Gn(), p = new ue(), b = (N, D, L, Q) => {
|
3150
3049
|
switch (n) {
|
3151
3050
|
case "Quad":
|
3152
|
-
|
3051
|
+
N < L ? D < Q ? u.setFromCamera(p, $) : u.setFromCamera(p, Ae) : D < Q ? u.setFromCamera(p, re) : u.setFromCamera(p, Ie);
|
3153
3052
|
break;
|
3154
3053
|
case "Side by Side":
|
3155
|
-
|
3054
|
+
N < L ? u.setFromCamera(p, $) : u.setFromCamera(p, re);
|
3156
3055
|
break;
|
3157
3056
|
case "Single":
|
3158
|
-
|
3057
|
+
u.setFromCamera(p, $);
|
3159
3058
|
break;
|
3160
3059
|
case "Stacked":
|
3161
|
-
D <
|
3060
|
+
D < Q ? u.setFromCamera(p, $) : u.setFromCamera(p, re);
|
3162
3061
|
break;
|
3163
3062
|
}
|
3164
|
-
},
|
3165
|
-
if (!
|
3063
|
+
}, S = (N) => {
|
3064
|
+
if (!bt)
|
3166
3065
|
return;
|
3167
3066
|
const D = new ue();
|
3168
3067
|
e.getSize(D);
|
3169
|
-
const
|
3170
|
-
|
3171
|
-
const
|
3172
|
-
|
3068
|
+
const L = Math.min(N.clientX, D.x), Q = Math.min(N.clientY, D.y);
|
3069
|
+
p.x = We(L, 0, D.x, -1, 1), p.y = We(Q, 0, D.y, 1, -1);
|
3070
|
+
const M = D.x / 2, k = D.y / 2, X = () => {
|
3071
|
+
L < M ? p.x = We(L, 0, M, -1, 1) : p.x = We(L, M, D.x, -1, 1);
|
3173
3072
|
}, pe = () => {
|
3174
|
-
|
3073
|
+
Q < k ? p.y = We(Q, 0, k, 1, -1) : p.y = We(Q, k, D.y, 1, -1);
|
3175
3074
|
};
|
3176
3075
|
switch (n) {
|
3177
3076
|
case "Quad":
|
@@ -3184,186 +3083,186 @@ function ri(t) {
|
|
3184
3083
|
pe(), pe();
|
3185
3084
|
break;
|
3186
3085
|
}
|
3187
|
-
|
3188
|
-
const
|
3189
|
-
|
3190
|
-
},
|
3191
|
-
if (!
|
3086
|
+
b(L, Q, M, k);
|
3087
|
+
const Te = u.intersectObjects(xe.children);
|
3088
|
+
Te.length > 0 && it.position.copy(Te[0].point);
|
3089
|
+
}, F = (N) => {
|
3090
|
+
if (!bt)
|
3192
3091
|
return;
|
3193
3092
|
const D = new ue();
|
3194
|
-
if (e.getSize(D),
|
3093
|
+
if (e.getSize(D), N.clientX >= D.x)
|
3195
3094
|
return;
|
3196
|
-
|
3197
|
-
const
|
3198
|
-
|
3199
|
-
},
|
3200
|
-
return
|
3201
|
-
|
3095
|
+
S(N);
|
3096
|
+
const L = u.intersectObjects(xe.children);
|
3097
|
+
L.length > 0 && t.three.getObject(L[0].object.uuid);
|
3098
|
+
}, U = R.current;
|
3099
|
+
return U.addEventListener("mousemove", S, !1), U.addEventListener("click", F, !1), () => {
|
3100
|
+
U.removeEventListener("mousemove", S), U.removeEventListener("click", F);
|
3202
3101
|
};
|
3203
3102
|
}
|
3204
3103
|
}, [n, e]);
|
3205
|
-
const
|
3206
|
-
return
|
3207
|
-
|
3208
|
-
}), /* @__PURE__ */
|
3209
|
-
/* @__PURE__ */
|
3210
|
-
/* @__PURE__ */
|
3211
|
-
n === "Single" && /* @__PURE__ */
|
3212
|
-
var
|
3213
|
-
(
|
3214
|
-
const
|
3215
|
-
|
3104
|
+
const ee = [];
|
3105
|
+
return ne.forEach((u, p) => {
|
3106
|
+
ee.push(p);
|
3107
|
+
}), /* @__PURE__ */ c.jsxs("div", { className: "multiview", children: [
|
3108
|
+
/* @__PURE__ */ c.jsx("canvas", { ref: x }),
|
3109
|
+
/* @__PURE__ */ c.jsxs("div", { className: `cameras ${n === "Single" || n === "Stacked" ? "single" : ""}`, ref: R, children: [
|
3110
|
+
n === "Single" && /* @__PURE__ */ c.jsx(c.Fragment, { children: /* @__PURE__ */ c.jsx(ke, { camera: $, options: ee, ref: T, onSelect: (u) => {
|
3111
|
+
var b;
|
3112
|
+
(b = ie.get($.name)) == null || b.dispose();
|
3113
|
+
const p = ne.get(u);
|
3114
|
+
p !== void 0 && (K($), $ = p, C(p, T.current));
|
3216
3115
|
} }) }),
|
3217
|
-
(n === "Side by Side" || n === "Stacked") && /* @__PURE__ */
|
3218
|
-
/* @__PURE__ */
|
3219
|
-
var
|
3220
|
-
(
|
3221
|
-
const
|
3222
|
-
|
3116
|
+
(n === "Side by Side" || n === "Stacked") && /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
|
3117
|
+
/* @__PURE__ */ c.jsx(ke, { camera: $, options: ee, ref: T, onSelect: (u) => {
|
3118
|
+
var b;
|
3119
|
+
(b = ie.get($.name)) == null || b.dispose();
|
3120
|
+
const p = ne.get(u);
|
3121
|
+
p !== void 0 && (K($), $ = p, C(p, T.current));
|
3223
3122
|
} }),
|
3224
|
-
/* @__PURE__ */
|
3225
|
-
var
|
3226
|
-
(
|
3227
|
-
const
|
3228
|
-
|
3123
|
+
/* @__PURE__ */ c.jsx(ke, { camera: re, options: ee, ref: B, onSelect: (u) => {
|
3124
|
+
var b;
|
3125
|
+
(b = ie.get(re.name)) == null || b.dispose();
|
3126
|
+
const p = ne.get(u);
|
3127
|
+
p !== void 0 && (K(re), re = p, C(p, B.current));
|
3229
3128
|
} })
|
3230
3129
|
] }),
|
3231
|
-
n === "Quad" && /* @__PURE__ */
|
3232
|
-
/* @__PURE__ */
|
3233
|
-
var
|
3234
|
-
(
|
3235
|
-
const
|
3236
|
-
|
3130
|
+
n === "Quad" && /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
|
3131
|
+
/* @__PURE__ */ c.jsx(ke, { camera: $, options: ee, ref: T, onSelect: (u) => {
|
3132
|
+
var b;
|
3133
|
+
(b = ie.get($.name)) == null || b.dispose();
|
3134
|
+
const p = ne.get(u);
|
3135
|
+
p !== void 0 && (K($), $ = p, C(p, T.current));
|
3237
3136
|
} }),
|
3238
|
-
/* @__PURE__ */
|
3239
|
-
var
|
3240
|
-
(
|
3241
|
-
const
|
3242
|
-
|
3137
|
+
/* @__PURE__ */ c.jsx(ke, { camera: re, options: ee, ref: B, onSelect: (u) => {
|
3138
|
+
var b;
|
3139
|
+
(b = ie.get(re.name)) == null || b.dispose();
|
3140
|
+
const p = ne.get(u);
|
3141
|
+
p !== void 0 && (K(re), re = p, C(p, B.current));
|
3243
3142
|
} }),
|
3244
|
-
/* @__PURE__ */
|
3245
|
-
var
|
3246
|
-
(
|
3247
|
-
const
|
3248
|
-
|
3143
|
+
/* @__PURE__ */ c.jsx(ke, { camera: Ae, options: ee, ref: oe, onSelect: (u) => {
|
3144
|
+
var b;
|
3145
|
+
(b = ie.get(Ae.name)) == null || b.dispose();
|
3146
|
+
const p = ne.get(u);
|
3147
|
+
p !== void 0 && (K(Ae), Ae = p, C(p, oe.current));
|
3249
3148
|
} }),
|
3250
|
-
/* @__PURE__ */
|
3251
|
-
var
|
3252
|
-
(
|
3253
|
-
const
|
3254
|
-
|
3149
|
+
/* @__PURE__ */ c.jsx(ke, { camera: Ie, options: ee, ref: H, onSelect: (u) => {
|
3150
|
+
var b;
|
3151
|
+
(b = ie.get(Ie.name)) == null || b.dispose();
|
3152
|
+
const p = ne.get(u);
|
3153
|
+
p !== void 0 && (K(Ie), Ie = p, C(p, H.current));
|
3255
3154
|
} })
|
3256
3155
|
] })
|
3257
3156
|
] }),
|
3258
|
-
/* @__PURE__ */
|
3259
|
-
/* @__PURE__ */
|
3260
|
-
|
3157
|
+
/* @__PURE__ */ c.jsxs("div", { className: "settings", children: [
|
3158
|
+
/* @__PURE__ */ c.jsx(
|
3159
|
+
yt,
|
3261
3160
|
{
|
3262
3161
|
index: en.indexOf(n),
|
3263
3162
|
options: en,
|
3264
|
-
onSelect: (
|
3265
|
-
|
3163
|
+
onSelect: (u) => {
|
3164
|
+
u !== n && (de(), i(u));
|
3266
3165
|
},
|
3267
3166
|
open: s,
|
3268
|
-
onToggle: (
|
3269
|
-
|
3167
|
+
onToggle: (u) => {
|
3168
|
+
h(u), l && d(!1), m && v(!1);
|
3270
3169
|
}
|
3271
3170
|
}
|
3272
3171
|
),
|
3273
|
-
/* @__PURE__ */
|
3274
|
-
|
3172
|
+
/* @__PURE__ */ c.jsx(
|
3173
|
+
yt,
|
3275
3174
|
{
|
3276
|
-
index: tn.indexOf(
|
3175
|
+
index: tn.indexOf(vt),
|
3277
3176
|
options: tn,
|
3278
|
-
onSelect: (
|
3279
|
-
if (
|
3280
|
-
switch (
|
3177
|
+
onSelect: (u) => {
|
3178
|
+
if (u !== vt)
|
3179
|
+
switch (vt = u, vt) {
|
3281
3180
|
case "Depth":
|
3282
|
-
|
3181
|
+
V.overrideMaterial = Ni;
|
3283
3182
|
break;
|
3284
3183
|
case "Normals":
|
3285
|
-
|
3184
|
+
V.overrideMaterial = Li;
|
3286
3185
|
break;
|
3287
3186
|
default:
|
3288
3187
|
case "Renderer":
|
3289
|
-
|
3188
|
+
V.overrideMaterial = null;
|
3290
3189
|
break;
|
3291
3190
|
case "Wireframe":
|
3292
|
-
|
3191
|
+
V.overrideMaterial = Ui;
|
3293
3192
|
break;
|
3294
3193
|
case "UVs":
|
3295
|
-
|
3194
|
+
V.overrideMaterial = Fi;
|
3296
3195
|
break;
|
3297
3196
|
}
|
3298
3197
|
},
|
3299
3198
|
open: l,
|
3300
|
-
onToggle: (
|
3301
|
-
s &&
|
3199
|
+
onToggle: (u) => {
|
3200
|
+
s && h(!1), d(u), m && v(!1);
|
3302
3201
|
}
|
3303
3202
|
}
|
3304
3203
|
),
|
3305
|
-
/* @__PURE__ */
|
3306
|
-
|
3204
|
+
/* @__PURE__ */ c.jsx(
|
3205
|
+
yt,
|
3307
3206
|
{
|
3308
3207
|
index: 0,
|
3309
3208
|
options: [
|
3310
3209
|
"Orbit Mode",
|
3311
3210
|
"Selection Mode"
|
3312
3211
|
],
|
3313
|
-
onSelect: (
|
3314
|
-
|
3212
|
+
onSelect: (u) => {
|
3213
|
+
bt = u === "Selection Mode", it.visible = bt;
|
3315
3214
|
},
|
3316
|
-
open:
|
3317
|
-
onToggle: (
|
3318
|
-
s &&
|
3215
|
+
open: m,
|
3216
|
+
onToggle: (u) => {
|
3217
|
+
s && h(!1), l && d(!1), v(u);
|
3319
3218
|
}
|
3320
3219
|
}
|
3321
3220
|
)
|
3322
3221
|
] })
|
3323
3222
|
] });
|
3324
3223
|
}
|
3325
|
-
function
|
3326
|
-
return /* @__PURE__ */
|
3327
|
-
/* @__PURE__ */
|
3224
|
+
function or(t) {
|
3225
|
+
return /* @__PURE__ */ c.jsxs("div", { className: "editor", ref: t.ref, style: t.style, children: [
|
3226
|
+
/* @__PURE__ */ c.jsx("header", { children: t.header }),
|
3328
3227
|
t.children,
|
3329
|
-
/* @__PURE__ */
|
3228
|
+
/* @__PURE__ */ c.jsx("footer", { children: t.footer })
|
3330
3229
|
] });
|
3331
3230
|
}
|
3332
3231
|
export {
|
3333
|
-
|
3334
|
-
|
3335
|
-
|
3336
|
-
|
3337
|
-
|
3338
|
-
|
3339
|
-
|
3340
|
-
|
3341
|
-
|
3342
|
-
|
3343
|
-
|
3344
|
-
|
3345
|
-
|
3346
|
-
|
3347
|
-
|
3348
|
-
|
3349
|
-
|
3350
|
-
|
3351
|
-
|
3352
|
-
|
3353
|
-
|
3354
|
-
|
3355
|
-
|
3356
|
-
|
3357
|
-
|
3358
|
-
|
3359
|
-
|
3360
|
-
|
3361
|
-
|
3362
|
-
|
3363
|
-
|
3364
|
-
|
3365
|
-
|
3366
|
-
|
3367
|
-
|
3368
|
-
|
3232
|
+
Nt as Accordion,
|
3233
|
+
qi as Application,
|
3234
|
+
Et as BaseRemote,
|
3235
|
+
vn as ChildObject,
|
3236
|
+
yi as ContainerObject,
|
3237
|
+
li as Draggable,
|
3238
|
+
ci as DraggableItem,
|
3239
|
+
ui as Dropdown,
|
3240
|
+
di as DropdownItem,
|
3241
|
+
or as Editor,
|
3242
|
+
mi as InfiniteGridHelper,
|
3243
|
+
ki as Inspector,
|
3244
|
+
ar as MultiView,
|
3245
|
+
gn as NavButton,
|
3246
|
+
Qi as RemoteComponents,
|
3247
|
+
nr as RemoteController,
|
3248
|
+
Ji as RemoteTheatre,
|
3249
|
+
er as RemoteThree,
|
3250
|
+
tr as RemoteTweakpane,
|
3251
|
+
rr as SceneInspector,
|
3252
|
+
ir as SidePanel,
|
3253
|
+
Y as ToolEvents,
|
3254
|
+
bi as UVMaterial,
|
3255
|
+
Ki as clamp,
|
3256
|
+
Qn as colorToHex,
|
3257
|
+
z as debugDispatcher,
|
3258
|
+
hn as dispose,
|
3259
|
+
ei as disposeMaterial,
|
3260
|
+
Zi as disposeTexture,
|
3261
|
+
Xi as distance,
|
3262
|
+
fn as hierarchyUUID,
|
3263
|
+
qn as isColor,
|
3264
|
+
Zn as randomID,
|
3265
|
+
Jn as resetThreeObjects,
|
3266
|
+
Mt as round,
|
3267
|
+
Dt as totalThreeObjects
|
3369
3268
|
};
|