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