@tomorrowevening/hermes 0.0.35 → 0.0.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hermes.cjs.js +144 -0
- package/dist/hermes.esm.js +3849 -0
- package/dist/hermes.umd.js +144 -0
- package/dist/style.css +1 -1
- package/package.json +20 -16
- package/src/core/Application.ts +111 -0
- package/src/core/RemoteController.ts +60 -0
- package/src/core/remote/BaseRemote.ts +16 -0
- package/src/core/remote/RemoteComponents.ts +45 -0
- package/src/core/remote/RemoteTheatre.ts +300 -0
- package/src/core/remote/RemoteThree.ts +143 -0
- package/src/core/remote/RemoteTweakpane.ts +194 -0
- package/src/core/types.ts +56 -0
- package/src/editor/Editor.tsx +20 -0
- package/src/editor/components/Draggable.tsx +40 -0
- package/src/editor/components/DraggableItem.tsx +22 -0
- package/src/editor/components/Dropdown.tsx +38 -0
- package/src/editor/components/DropdownItem.tsx +64 -0
- package/src/editor/components/NavButton.tsx +11 -0
- package/src/editor/components/content.ts +2 -0
- package/src/editor/components/icons/CloseIcon.tsx +7 -0
- package/src/editor/components/icons/DragIcon.tsx +9 -0
- package/src/editor/components/types.ts +41 -0
- package/src/editor/global.ts +20 -0
- package/src/editor/multiView/CameraWindow.tsx +74 -0
- package/src/editor/multiView/InfiniteGridHelper.ts +24 -0
- package/src/editor/multiView/InfiniteGridMaterial.ts +127 -0
- package/src/editor/multiView/MultiView.scss +101 -0
- package/src/editor/multiView/MultiView.tsx +636 -0
- package/src/editor/multiView/MultiViewData.ts +59 -0
- package/src/editor/multiView/UVMaterial.ts +55 -0
- package/src/editor/scss/_debug.scss +58 -0
- package/src/editor/scss/_draggable.scss +43 -0
- package/src/editor/scss/_dropdown.scss +84 -0
- package/src/editor/scss/_sidePanel.scss +278 -0
- package/src/editor/scss/_theme.scss +9 -0
- package/src/editor/scss/index.scss +67 -0
- package/src/editor/sidePanel/Accordion.tsx +41 -0
- package/src/editor/sidePanel/ChildObject.tsx +57 -0
- package/src/editor/sidePanel/ContainerObject.tsx +11 -0
- package/src/editor/sidePanel/SidePanel.tsx +64 -0
- package/src/editor/sidePanel/ToggleBtn.tsx +27 -0
- package/src/editor/sidePanel/inspector/Inspector.tsx +119 -0
- package/src/editor/sidePanel/inspector/InspectorField.tsx +198 -0
- package/src/editor/sidePanel/inspector/InspectorGroup.tsx +50 -0
- package/src/editor/sidePanel/inspector/SceneInspector.tsx +84 -0
- package/src/editor/sidePanel/inspector/inspector.scss +161 -0
- package/src/editor/sidePanel/inspector/utils/InspectAnimation.tsx +102 -0
- package/src/editor/sidePanel/inspector/utils/InspectCamera.tsx +75 -0
- package/src/editor/sidePanel/inspector/utils/InspectLight.tsx +62 -0
- package/src/editor/sidePanel/inspector/utils/InspectMaterial.tsx +710 -0
- package/src/editor/sidePanel/inspector/utils/InspectTransform.tsx +113 -0
- package/src/editor/sidePanel/types.ts +130 -0
- package/src/editor/sidePanel/utils.ts +278 -0
- package/src/editor/utils.ts +117 -0
- package/src/example/CustomEditor.tsx +78 -0
- package/src/example/components/App.css +6 -0
- package/src/example/components/App.tsx +246 -0
- package/src/example/constants.ts +52 -0
- package/src/example/index.scss +45 -0
- package/src/example/main.tsx +37 -0
- package/src/example/three/BaseScene.ts +42 -0
- package/src/example/three/CustomMaterial.ts +72 -0
- package/src/example/three/FBXAnimation.ts +26 -0
- package/src/example/three/Scene1.ts +225 -0
- package/src/example/three/Scene2.ts +138 -0
- package/src/example/three/loader.ts +110 -0
- package/src/index.ts +27 -0
- package/src/vite-env.d.ts +1 -0
- package/dist/hermes.js +0 -3901
- package/dist/hermes.umd.cjs +0 -144
package/dist/hermes.js
DELETED
@@ -1,3901 +0,0 @@
|
|
1
|
-
var qn = Object.defineProperty;
|
2
|
-
var Kn = (t, n, a) => n in t ? qn(t, n, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[n] = a;
|
3
|
-
var F = (t, n, a) => (Kn(t, typeof n != "symbol" ? n + "" : n, a), a);
|
4
|
-
import { PositionalAudio as Xn, EventDispatcher as fn, Texture as hn, CubeTexture as Zn, RepeatWrapping as Zt, ShaderMaterial as pn, GLSL3 as Jn, DoubleSide as mn, Color as Pt, Mesh as Qn, PlaneGeometry as ea, FrontSide as ta, BackSide as na, NoBlending as aa, NormalBlending as ia, AdditiveBlending as ra, SubtractiveBlending as oa, MultiplyBlending as sa, CustomBlending as ca, AddEquation as la, SubtractEquation as ua, ReverseSubtractEquation as da, MinEquation as fa, MaxEquation as ha, ZeroFactor as vn, OneFactor as gn, SrcColorFactor as bn, OneMinusSrcColorFactor as yn, SrcAlphaFactor as En, OneMinusSrcAlphaFactor as Cn, DstAlphaFactor as xn, OneMinusDstAlphaFactor as Sn, DstColorFactor as wn, OneMinusDstColorFactor as On, SrcAlphaSaturateFactor as pa, ConstantColorFactor as Mn, OneMinusConstantColorFactor as Tn, ConstantAlphaFactor as Rn, OneMinusConstantAlphaFactor as Pn, Matrix4 as ma, Vector3 as Z, Euler as va, Ray as ga, Plane as ba, MathUtils as ya, MOUSE as He, TOUCH as We, Quaternion as Jt, Spherical as Qt, Vector2 as de, PerspectiveCamera as Gt, MeshDepthMaterial as Ea, MeshNormalMaterial as Ca, MeshBasicMaterial as xa, OrthographicCamera as An, Scene as kn, Group as Sa, AxesHelper as _n, WebGLRenderer as wa, Raycaster as Oa, CameraHelper as Ma } from "three";
|
5
|
-
import { getProject as Ta, createRafDriver as Ra } from "@theatre/core";
|
6
|
-
import ut from "@theatre/studio";
|
7
|
-
import { Pane as Pa } from "tweakpane";
|
8
|
-
import * as Aa from "@tweakpane/plugin-essentials";
|
9
|
-
import jn, { useState as le, useRef as Ce, useEffect as Be, Component as ka, forwardRef as _a } from "react";
|
10
|
-
import { Reorder as Dn } from "framer-motion";
|
11
|
-
function dt(t) {
|
12
|
-
return t.substring(0, 1).toUpperCase() + t.substring(1);
|
13
|
-
}
|
14
|
-
function Hi(t, n, a) {
|
15
|
-
return Math.min(n, Math.max(t, a));
|
16
|
-
}
|
17
|
-
function Wi(t, n) {
|
18
|
-
const a = t - n;
|
19
|
-
return Math.sqrt(a * a);
|
20
|
-
}
|
21
|
-
function ja() {
|
22
|
-
return Math.round(Math.random() * 1e6).toString();
|
23
|
-
}
|
24
|
-
function Da(t) {
|
25
|
-
return t.r !== void 0 && t.g !== void 0 && t.b !== void 0;
|
26
|
-
}
|
27
|
-
function Ia(t) {
|
28
|
-
const n = Math.round(t.r * 255), a = Math.round(t.g * 255), e = Math.round(t.b * 255), r = (l) => {
|
29
|
-
const d = l.toString(16);
|
30
|
-
return d.length === 1 ? "0" + d : d;
|
31
|
-
}, s = r(n), h = r(a), c = r(e);
|
32
|
-
return "#" + s + h + c;
|
33
|
-
}
|
34
|
-
function Ut(t, n = 1) {
|
35
|
-
return Number(t.toFixed(n));
|
36
|
-
}
|
37
|
-
let Vt = 0;
|
38
|
-
const La = () => {
|
39
|
-
Vt = 0;
|
40
|
-
}, In = (t) => {
|
41
|
-
if (!t)
|
42
|
-
return;
|
43
|
-
let n = t.name.replace(" ", "");
|
44
|
-
n.length === 0 && (n = `obj_${Vt}`, Vt++), t.parent !== null && (n = `${t.parent.uuid}.${n}`), t.uuid = n, t.children.forEach((a) => {
|
45
|
-
In(a);
|
46
|
-
});
|
47
|
-
}, qi = (t) => {
|
48
|
-
t == null || t.dispose();
|
49
|
-
}, Na = (t) => {
|
50
|
-
t && (Array.isArray(t) ? t.forEach((n) => n.dispose()) : t.dispose());
|
51
|
-
}, Ln = (t) => {
|
52
|
-
var n;
|
53
|
-
if (t) {
|
54
|
-
for (; t.children.length > 0; ) {
|
55
|
-
const a = t.children[0];
|
56
|
-
a instanceof Xn ? (a.pause(), a.parent && a.parent.remove(a)) : Ln(a);
|
57
|
-
}
|
58
|
-
if (t.parent && t.parent.remove(t), t.isMesh) {
|
59
|
-
const a = t;
|
60
|
-
(n = a.geometry) == null || n.dispose(), Na(a.material);
|
61
|
-
}
|
62
|
-
t.dispose !== void 0 && t.dispose();
|
63
|
-
}
|
64
|
-
};
|
65
|
-
class Ki {
|
66
|
-
constructor(n, a, e = !0, r = "editor") {
|
67
|
-
F(this, "components", /* @__PURE__ */ new Map());
|
68
|
-
F(this, "listen");
|
69
|
-
// Protected
|
70
|
-
F(this, "_debugEnabled");
|
71
|
-
F(this, "broadcastChannel");
|
72
|
-
F(this, "webSocket");
|
73
|
-
F(this, "_mode", "app");
|
74
|
-
F(this, "_connected", !1);
|
75
|
-
F(this, "useBC", !1);
|
76
|
-
F(this, "messageHandler", (n) => {
|
77
|
-
this.listen !== void 0 && (this.useBC ? this.listen(n.data) : this.listen(JSON.parse(n.data)));
|
78
|
-
});
|
79
|
-
F(this, "openHandler", () => {
|
80
|
-
this._connected = !0;
|
81
|
-
});
|
82
|
-
F(this, "closeHandler", () => {
|
83
|
-
this._connected = !1;
|
84
|
-
});
|
85
|
-
this.editor = a && document.location.hash.search(r) > -1, this._debugEnabled = a, a && (this.useBC = e, e ? (this.broadcastChannel = new BroadcastChannel(n), this.broadcastChannel.addEventListener("message", this.messageHandler)) : (this.webSocket = new WebSocket(n), this.webSocket.addEventListener("open", this.openHandler), this.webSocket.addEventListener("close", this.closeHandler), this.webSocket.addEventListener("message", this.messageHandler)));
|
86
|
-
}
|
87
|
-
addComponent(n, a) {
|
88
|
-
this.components.set(n, a);
|
89
|
-
}
|
90
|
-
dispose() {
|
91
|
-
this.broadcastChannel !== void 0 && this.broadcastChannel.removeEventListener("message", this.messageHandler), this.webSocket !== void 0 && (this.webSocket.removeEventListener("open", this.openHandler), this.webSocket.removeEventListener("close", this.closeHandler), this.webSocket.removeEventListener("message", this.messageHandler)), this.components.forEach((n) => {
|
92
|
-
n.dispose();
|
93
|
-
}), this.components.clear();
|
94
|
-
}
|
95
|
-
// Remote
|
96
|
-
send(n) {
|
97
|
-
var a, e;
|
98
|
-
this._mode !== n.target && (this.useBC ? (a = this.broadcastChannel) == null || a.postMessage(n) : this._connected && ((e = this.webSocket) == null || e.send(JSON.stringify(n))));
|
99
|
-
}
|
100
|
-
// Getters / Setters
|
101
|
-
get connected() {
|
102
|
-
return this._connected;
|
103
|
-
}
|
104
|
-
get debugEnabled() {
|
105
|
-
return this._debugEnabled;
|
106
|
-
}
|
107
|
-
get mode() {
|
108
|
-
return this._mode;
|
109
|
-
}
|
110
|
-
get isApp() {
|
111
|
-
return this._mode === "app";
|
112
|
-
}
|
113
|
-
get editor() {
|
114
|
-
return this._mode === "editor";
|
115
|
-
}
|
116
|
-
set editor(n) {
|
117
|
-
n && (this._mode = "editor", document.title += " - Editor");
|
118
|
-
}
|
119
|
-
}
|
120
|
-
const _ = new fn(), j = {
|
121
|
-
CUSTOM: "ToolEvents::custom",
|
122
|
-
// Components
|
123
|
-
SELECT_DROPDOWN: "ToolEvents::selectDropdown",
|
124
|
-
DRAG_UPDATE: "ToolEvents::dragUpdate",
|
125
|
-
// SceneHierarchy
|
126
|
-
SET_SCENE: "ToolEvents::setScene",
|
127
|
-
GET_OBJECT: "ToolEvents::getObject",
|
128
|
-
SET_OBJECT: "ToolEvents::setObject",
|
129
|
-
UPDATE_OBJECT: "ToolEvents::updateObject",
|
130
|
-
CREATE_TEXTURE: "ToolEvents::createTexture",
|
131
|
-
REQUEST_METHOD: "ToolEvents::requestMethod",
|
132
|
-
// MultiView
|
133
|
-
ADD_CAMERA: "ToolEvents::addCamera",
|
134
|
-
REMOVE_CAMERA: "ToolEvents::removeCamera"
|
135
|
-
};
|
136
|
-
class At {
|
137
|
-
constructor(n) {
|
138
|
-
F(this, "app");
|
139
|
-
this.app = n;
|
140
|
-
}
|
141
|
-
dispose() {
|
142
|
-
}
|
143
|
-
}
|
144
|
-
class Fa extends At {
|
145
|
-
selectDropdown(n, a) {
|
146
|
-
this.app.send({
|
147
|
-
event: "selectComponent",
|
148
|
-
target: "app",
|
149
|
-
data: {
|
150
|
-
dropdown: n,
|
151
|
-
value: a
|
152
|
-
}
|
153
|
-
});
|
154
|
-
}
|
155
|
-
updateDropdown(n, a) {
|
156
|
-
this.app.send({
|
157
|
-
event: "draggableListUpdate",
|
158
|
-
target: "app",
|
159
|
-
data: {
|
160
|
-
dropdown: n,
|
161
|
-
value: a
|
162
|
-
}
|
163
|
-
});
|
164
|
-
}
|
165
|
-
}
|
166
|
-
function Ba(t, n) {
|
167
|
-
switch (n.event) {
|
168
|
-
case "selectComponent":
|
169
|
-
_.dispatchEvent({ type: j.SELECT_DROPDOWN, value: n.data });
|
170
|
-
break;
|
171
|
-
case "draggableListUpdate":
|
172
|
-
_.dispatchEvent({ type: j.DRAG_UPDATE, value: n.data });
|
173
|
-
break;
|
174
|
-
}
|
175
|
-
}
|
176
|
-
const Nn = () => {
|
177
|
-
}, Xe = class Xe extends At {
|
178
|
-
constructor() {
|
179
|
-
super(...arguments);
|
180
|
-
F(this, "project");
|
181
|
-
F(this, "sheets", /* @__PURE__ */ new Map());
|
182
|
-
F(this, "sheetObjects", /* @__PURE__ */ new Map());
|
183
|
-
F(this, "sheetObjectCBs", /* @__PURE__ */ new Map());
|
184
|
-
F(this, "sheetObjectUnsubscribe", /* @__PURE__ */ new Map());
|
185
|
-
}
|
186
|
-
init(a, e) {
|
187
|
-
return this.project = Ta(a, e), this.project.ready;
|
188
|
-
}
|
189
|
-
dispose() {
|
190
|
-
this.project = void 0, this.sheets = /* @__PURE__ */ new Map(), this.sheetObjects = /* @__PURE__ */ new Map(), this.sheetObjectCBs = /* @__PURE__ */ new Map(), this.sheetObjectUnsubscribe = /* @__PURE__ */ new Map();
|
191
|
-
}
|
192
|
-
sheet(a) {
|
193
|
-
var r;
|
194
|
-
if (this.project === void 0) {
|
195
|
-
console.error("Theatre Project hasn't been created yet.");
|
196
|
-
return;
|
197
|
-
}
|
198
|
-
let e = this.sheets.get(a);
|
199
|
-
return e !== void 0 || (e = (r = this.project) == null ? void 0 : r.sheet(a), this.sheets.set(a, e)), e;
|
200
|
-
}
|
201
|
-
playSheet(a, e) {
|
202
|
-
var r;
|
203
|
-
(r = this.sheet(a)) == null || r.sequence.play(e), this.app.send({
|
204
|
-
event: "playSheet",
|
205
|
-
target: "editor",
|
206
|
-
data: {
|
207
|
-
sheet: a,
|
208
|
-
value: e
|
209
|
-
}
|
210
|
-
});
|
211
|
-
}
|
212
|
-
pauseSheet(a) {
|
213
|
-
var e;
|
214
|
-
(e = this.sheet(a)) == null || e.sequence.pause(), this.app.send({
|
215
|
-
event: "pauseSheet",
|
216
|
-
target: "editor",
|
217
|
-
data: {
|
218
|
-
sheet: a
|
219
|
-
}
|
220
|
-
});
|
221
|
-
}
|
222
|
-
clearSheetObjects(a) {
|
223
|
-
this.sheetObjects.forEach((e, r) => {
|
224
|
-
r.search(`${a}_`) > -1 && this.unsubscribe(e);
|
225
|
-
});
|
226
|
-
}
|
227
|
-
sheetObject(a, e, r, s) {
|
228
|
-
if (this.project === void 0) {
|
229
|
-
console.error("Theatre Project hasn't been created yet.");
|
230
|
-
return;
|
231
|
-
}
|
232
|
-
const h = this.sheet(a);
|
233
|
-
if (h === void 0)
|
234
|
-
return;
|
235
|
-
const c = `${a}_${e}`;
|
236
|
-
let l = this.sheetObjects.get(c);
|
237
|
-
l !== void 0 ? l = h.object(e, { ...r, ...l.value }, { reconfigure: !0 }) : l = h.object(e, r), this.sheetObjects.set(c, l), this.sheetObjectCBs.set(c, s !== void 0 ? s : Nn);
|
238
|
-
const d = l.onValuesChange((b) => {
|
239
|
-
if (this.app.editor) {
|
240
|
-
for (const E in b) {
|
241
|
-
const S = b[E];
|
242
|
-
typeof S == "object" && Da(S) && (b[E] = {
|
243
|
-
r: S.r,
|
244
|
-
g: S.g,
|
245
|
-
b: S.b,
|
246
|
-
a: S.a
|
247
|
-
});
|
248
|
-
}
|
249
|
-
this.app.send({
|
250
|
-
event: "updateSheetObject",
|
251
|
-
target: "app",
|
252
|
-
data: {
|
253
|
-
sheet: a,
|
254
|
-
sheetObject: c,
|
255
|
-
values: b
|
256
|
-
}
|
257
|
-
});
|
258
|
-
}
|
259
|
-
const m = this.sheetObjectCBs.get(c);
|
260
|
-
m !== void 0 && m(b);
|
261
|
-
});
|
262
|
-
return this.sheetObjectUnsubscribe.set(c, d), l;
|
263
|
-
}
|
264
|
-
unsubscribe(a) {
|
265
|
-
if (this.project === void 0) {
|
266
|
-
console.error("Theatre Project hasn't been created yet.");
|
267
|
-
return;
|
268
|
-
}
|
269
|
-
const e = a.address.sheetId, r = a.address.objectKey, s = this.sheets.get(e);
|
270
|
-
s == null || s.detachObject(r);
|
271
|
-
const h = `${e}_${r}`, c = this.sheetObjectUnsubscribe.get(h);
|
272
|
-
c !== void 0 && (this.sheetObjects.delete(h), this.sheetObjectCBs.delete(h), this.sheetObjectUnsubscribe.delete(h), c());
|
273
|
-
}
|
274
|
-
static getRafDriver() {
|
275
|
-
return Xe.rafDriver || (Xe.rafDriver = Ra()), Xe.rafDriver;
|
276
|
-
}
|
277
|
-
};
|
278
|
-
F(Xe, "rafDriver", null);
|
279
|
-
let Ze = Xe, Oe;
|
280
|
-
function Ua(t, n) {
|
281
|
-
t.components.forEach((a) => {
|
282
|
-
if (a instanceof Ze) {
|
283
|
-
let e;
|
284
|
-
const r = a;
|
285
|
-
switch (n.event) {
|
286
|
-
case "setSheet":
|
287
|
-
e = r.sheets.get(n.data.sheet), e !== void 0 && (Oe = e, ut.setSelection([e]));
|
288
|
-
break;
|
289
|
-
case "setSheetObject":
|
290
|
-
e = r.sheetObjects.get(`${n.data.sheet}_${n.data.key}`), e !== void 0 && ut.setSelection([e]);
|
291
|
-
break;
|
292
|
-
case "updateSheetObject":
|
293
|
-
e = r.sheets.get(n.data.sheet), e !== void 0 && e.sequence.pause(), e = r.sheetObjectCBs.get(n.data.sheetObject), e !== void 0 && e(n.data.values);
|
294
|
-
break;
|
295
|
-
case "updateTimeline":
|
296
|
-
e = r.sheets.get(n.data.sheet), Oe !== void 0 && (Oe.sequence.position = n.data.position);
|
297
|
-
break;
|
298
|
-
}
|
299
|
-
}
|
300
|
-
});
|
301
|
-
}
|
302
|
-
function $a(t) {
|
303
|
-
if (t.editor) {
|
304
|
-
let n;
|
305
|
-
t.components.forEach((s) => {
|
306
|
-
s instanceof Ze && (n = s);
|
307
|
-
}), ut.ui.restore(), ut.onSelectionChange((s) => {
|
308
|
-
s.length < 1 || s.forEach((h) => {
|
309
|
-
let c = h.address.sheetId, l = "setSheet", d = {};
|
310
|
-
switch (h.type) {
|
311
|
-
case "Theatre_Sheet_PublicAPI":
|
312
|
-
l = "setSheet", d = {
|
313
|
-
sheet: h.address.sheetId
|
314
|
-
}, Oe = n.sheets.get(h.address.sheetId);
|
315
|
-
break;
|
316
|
-
case "Theatre_SheetObject_PublicAPI":
|
317
|
-
l = "setSheetObject", c += `_${h.address.objectKey}`, d = {
|
318
|
-
id: c,
|
319
|
-
sheet: h.address.sheetId,
|
320
|
-
key: h.address.objectKey
|
321
|
-
};
|
322
|
-
break;
|
323
|
-
}
|
324
|
-
t.send({ event: l, target: "app", data: d });
|
325
|
-
});
|
326
|
-
});
|
327
|
-
let a = 0;
|
328
|
-
const e = () => {
|
329
|
-
if (Oe !== void 0 && a !== Oe.sequence.position) {
|
330
|
-
a = Oe.sequence.position;
|
331
|
-
const s = Oe;
|
332
|
-
t.send({
|
333
|
-
event: "updateTimeline",
|
334
|
-
target: "app",
|
335
|
-
data: {
|
336
|
-
position: a,
|
337
|
-
sheet: s.address.sheetId
|
338
|
-
}
|
339
|
-
});
|
340
|
-
}
|
341
|
-
}, r = () => {
|
342
|
-
e(), requestAnimationFrame(r);
|
343
|
-
};
|
344
|
-
e(), r();
|
345
|
-
} else
|
346
|
-
ut.ui.hide();
|
347
|
-
}
|
348
|
-
function za(t, n) {
|
349
|
-
t.editor && t.components.forEach((a) => {
|
350
|
-
var e, r;
|
351
|
-
if (a instanceof Ze) {
|
352
|
-
const s = a;
|
353
|
-
switch (n.event) {
|
354
|
-
case "playSheet":
|
355
|
-
(e = s.sheet(n.data.sheet)) == null || e.sequence.play(n.data.value);
|
356
|
-
break;
|
357
|
-
case "pauseSheet":
|
358
|
-
(r = s.sheet(n.data.sheet)) == null || r.sequence.pause();
|
359
|
-
break;
|
360
|
-
}
|
361
|
-
return;
|
362
|
-
}
|
363
|
-
});
|
364
|
-
}
|
365
|
-
function Ya(t) {
|
366
|
-
if (t.name === "cameras")
|
367
|
-
return "camera";
|
368
|
-
if (t.name === "interactive")
|
369
|
-
return "interactive";
|
370
|
-
if (t.name === "lights")
|
371
|
-
return "light";
|
372
|
-
if (t.name === "ui")
|
373
|
-
return "ui";
|
374
|
-
if (t.name === "utils")
|
375
|
-
return "utils";
|
376
|
-
const n = t.type;
|
377
|
-
return n.search("Helper") > -1 ? "icon_utils" : n.search("Camera") > -1 ? "camera" : n.search("Light") > -1 ? "light" : "obj3D";
|
378
|
-
}
|
379
|
-
function Fn(t) {
|
380
|
-
const n = {
|
381
|
-
name: t.name,
|
382
|
-
type: t.type,
|
383
|
-
uuid: t.uuid,
|
384
|
-
children: []
|
385
|
-
};
|
386
|
-
return t.children.forEach((a) => {
|
387
|
-
n.children.push(Fn(a));
|
388
|
-
}), n;
|
389
|
-
}
|
390
|
-
function Ga(t) {
|
391
|
-
const n = {};
|
392
|
-
for (const a in t) {
|
393
|
-
const e = t[a].value;
|
394
|
-
n[a] = { value: e }, e === null ? n[a].value = { src: "" } : e.isTexture && (n[a].value = { src: e.image.src });
|
395
|
-
}
|
396
|
-
return n;
|
397
|
-
}
|
398
|
-
function Va(t) {
|
399
|
-
switch (t) {
|
400
|
-
case "blendSrcAlpha":
|
401
|
-
case "blendDstAlpha":
|
402
|
-
case "blendEquationAlpha":
|
403
|
-
case "clippingPlanes":
|
404
|
-
case "shadowSide":
|
405
|
-
case "precision":
|
406
|
-
return !0;
|
407
|
-
}
|
408
|
-
return !1;
|
409
|
-
}
|
410
|
-
function qe(t) {
|
411
|
-
const n = {};
|
412
|
-
for (const a in t) {
|
413
|
-
if (a.substring(0, 1) === "_" || a.substring(0, 2) === "is" || Va(a))
|
414
|
-
continue;
|
415
|
-
const e = typeof t[a], r = t[a];
|
416
|
-
switch (e) {
|
417
|
-
case "boolean":
|
418
|
-
case "number":
|
419
|
-
case "string":
|
420
|
-
n[a] = r;
|
421
|
-
break;
|
422
|
-
case "object":
|
423
|
-
if (r !== null)
|
424
|
-
if (n[a] = r, r.isTexture)
|
425
|
-
if (r instanceof hn) {
|
426
|
-
const s = r.source.toJSON();
|
427
|
-
n[a] = { src: s.url };
|
428
|
-
} else
|
429
|
-
r instanceof Zn && (console.log("env map"), console.log(r.source.data), console.log(r.source.toJSON()), n[a] = { src: "" });
|
430
|
-
else
|
431
|
-
a === "uniforms" && (n[a] = Ga(n[a]));
|
432
|
-
else
|
433
|
-
n[a] = { src: "" };
|
434
|
-
break;
|
435
|
-
}
|
436
|
-
}
|
437
|
-
return n;
|
438
|
-
}
|
439
|
-
function $t(t) {
|
440
|
-
t.updateMatrix();
|
441
|
-
const n = {
|
442
|
-
name: t.name,
|
443
|
-
type: t.type,
|
444
|
-
uuid: t.uuid,
|
445
|
-
visible: t.visible,
|
446
|
-
matrix: t.matrix.elements,
|
447
|
-
animations: [],
|
448
|
-
material: void 0,
|
449
|
-
perspectiveCameraInfo: void 0,
|
450
|
-
orthographicCameraInfo: void 0,
|
451
|
-
lightInfo: void 0
|
452
|
-
};
|
453
|
-
t.animations.forEach((e) => {
|
454
|
-
n.animations.push({
|
455
|
-
name: e.name,
|
456
|
-
duration: e.duration,
|
457
|
-
blendMode: e.blendMode
|
458
|
-
});
|
459
|
-
});
|
460
|
-
const a = t.type.toLowerCase();
|
461
|
-
if (a.search("mesh") > -1) {
|
462
|
-
const e = t;
|
463
|
-
if (Array.isArray(e.material)) {
|
464
|
-
const r = [];
|
465
|
-
e.material.forEach((s) => {
|
466
|
-
r.push(qe(s));
|
467
|
-
}), n.material = r;
|
468
|
-
} else
|
469
|
-
n.material = qe(e.material);
|
470
|
-
} else if (a.search("points") > -1) {
|
471
|
-
const e = t;
|
472
|
-
if (Array.isArray(e.material)) {
|
473
|
-
const r = [];
|
474
|
-
e.material.forEach((s) => {
|
475
|
-
r.push(qe(s));
|
476
|
-
}), n.material = r;
|
477
|
-
} else
|
478
|
-
n.material = qe(e.material);
|
479
|
-
} else if (a.search("line") > -1) {
|
480
|
-
const e = t;
|
481
|
-
if (Array.isArray(e.material)) {
|
482
|
-
const r = [];
|
483
|
-
e.material.forEach((s) => {
|
484
|
-
r.push(qe(s));
|
485
|
-
}), n.material = r;
|
486
|
-
} else
|
487
|
-
n.material = qe(e.material);
|
488
|
-
} else
|
489
|
-
a.search("camera") > -1 ? t.type === "PerspectiveCamera" ? n.perspectiveCameraInfo = {
|
490
|
-
fov: t.fov,
|
491
|
-
zoom: t.zoom,
|
492
|
-
near: t.near,
|
493
|
-
far: t.far,
|
494
|
-
focus: t.focus,
|
495
|
-
aspect: t.aspect,
|
496
|
-
filmGauge: t.filmGauge,
|
497
|
-
filmOffset: t.filmOffset
|
498
|
-
} : t.type === "OrthographicCamera" && (n.orthographicCameraInfo = {
|
499
|
-
zoom: t.zoom,
|
500
|
-
near: t.near,
|
501
|
-
far: t.far,
|
502
|
-
left: t.left,
|
503
|
-
right: t.right,
|
504
|
-
top: t.top,
|
505
|
-
bottom: t.bottom
|
506
|
-
}) : a.search("light") > -1 && (n.lightInfo = {
|
507
|
-
color: t.color,
|
508
|
-
intensity: t.intensity,
|
509
|
-
decay: t.decay,
|
510
|
-
distance: t.distance,
|
511
|
-
angle: t.angle,
|
512
|
-
penumbra: t.penumbra,
|
513
|
-
groundColor: t.groundColor
|
514
|
-
});
|
515
|
-
return n;
|
516
|
-
}
|
517
|
-
function Ha(t, n) {
|
518
|
-
const a = n.split(".");
|
519
|
-
switch (a.length) {
|
520
|
-
case 1:
|
521
|
-
return t[a[0]];
|
522
|
-
case 2:
|
523
|
-
return t[a[0]][a[1]];
|
524
|
-
case 3:
|
525
|
-
return t[a[0]][a[1]][a[2]];
|
526
|
-
case 4:
|
527
|
-
return t[a[0]][a[1]][a[2]][a[3]];
|
528
|
-
case 5:
|
529
|
-
return t[a[0]][a[1]][a[2]][a[3]][a[4]];
|
530
|
-
case 6:
|
531
|
-
return t[a[0]][a[1]][a[2]][a[3]][a[4]][a[5]];
|
532
|
-
}
|
533
|
-
}
|
534
|
-
function ne(t, n, a) {
|
535
|
-
const e = n.split(".");
|
536
|
-
switch (e.length) {
|
537
|
-
case 1:
|
538
|
-
t[e[0]] = a;
|
539
|
-
break;
|
540
|
-
case 2:
|
541
|
-
t[e[0]][e[1]] = a;
|
542
|
-
break;
|
543
|
-
case 3:
|
544
|
-
t[e[0]][e[1]][e[2]] = a;
|
545
|
-
break;
|
546
|
-
case 4:
|
547
|
-
t[e[0]][e[1]][e[2]][e[3]] = a;
|
548
|
-
break;
|
549
|
-
case 5:
|
550
|
-
t[e[0]][e[1]][e[2]][e[3]][e[4]] = a;
|
551
|
-
break;
|
552
|
-
}
|
553
|
-
}
|
554
|
-
function Ht(t) {
|
555
|
-
return new Promise((n, a) => {
|
556
|
-
const e = new Image();
|
557
|
-
e.onload = () => {
|
558
|
-
const r = new hn(e);
|
559
|
-
r.wrapS = Zt, r.wrapT = Zt, r.needsUpdate = !0, n(r);
|
560
|
-
}, e.onerror = a, e.src = t;
|
561
|
-
});
|
562
|
-
}
|
563
|
-
class Wa extends At {
|
564
|
-
constructor() {
|
565
|
-
super(...arguments);
|
566
|
-
F(this, "scene");
|
567
|
-
}
|
568
|
-
getObject(a) {
|
569
|
-
this.app.debugEnabled && this.app.send({
|
570
|
-
event: "getObject",
|
571
|
-
target: "app",
|
572
|
-
data: a
|
573
|
-
});
|
574
|
-
}
|
575
|
-
setObject(a) {
|
576
|
-
const e = $t(a);
|
577
|
-
this.app.send({
|
578
|
-
event: "setObject",
|
579
|
-
target: "editor",
|
580
|
-
data: e
|
581
|
-
});
|
582
|
-
}
|
583
|
-
requestMethod(a, e, r, s) {
|
584
|
-
this.app.send({
|
585
|
-
event: "requestMethod",
|
586
|
-
target: "app",
|
587
|
-
data: {
|
588
|
-
uuid: a,
|
589
|
-
key: e,
|
590
|
-
value: r,
|
591
|
-
subitem: s
|
592
|
-
}
|
593
|
-
});
|
594
|
-
}
|
595
|
-
updateObject(a, e, r) {
|
596
|
-
this.app.send({
|
597
|
-
event: "updateObject",
|
598
|
-
target: "app",
|
599
|
-
data: {
|
600
|
-
uuid: a,
|
601
|
-
key: e,
|
602
|
-
value: r
|
603
|
-
}
|
604
|
-
});
|
605
|
-
}
|
606
|
-
createTexture(a, e, r) {
|
607
|
-
this.app.send({
|
608
|
-
event: "createTexture",
|
609
|
-
target: "app",
|
610
|
-
data: {
|
611
|
-
uuid: a,
|
612
|
-
key: e,
|
613
|
-
value: r
|
614
|
-
}
|
615
|
-
});
|
616
|
-
}
|
617
|
-
setScene(a) {
|
618
|
-
if (a === void 0 || (this.scene = a, !this.app.debugEnabled))
|
619
|
-
return;
|
620
|
-
La(), In(this.scene);
|
621
|
-
const e = Fn(this.scene);
|
622
|
-
this.app.send({
|
623
|
-
event: "setScene",
|
624
|
-
target: "editor",
|
625
|
-
data: e
|
626
|
-
});
|
627
|
-
}
|
628
|
-
addCamera(a) {
|
629
|
-
if (!this.app.debugEnabled)
|
630
|
-
return;
|
631
|
-
const e = $t(a);
|
632
|
-
this.app.send({
|
633
|
-
event: "addCamera",
|
634
|
-
target: "editor",
|
635
|
-
data: e
|
636
|
-
});
|
637
|
-
}
|
638
|
-
removeCamera(a) {
|
639
|
-
if (!this.app.debugEnabled)
|
640
|
-
return;
|
641
|
-
const e = $t(a);
|
642
|
-
this.app.send({
|
643
|
-
event: "removeCamera",
|
644
|
-
target: "editor",
|
645
|
-
data: e
|
646
|
-
});
|
647
|
-
}
|
648
|
-
}
|
649
|
-
function qa(t, n) {
|
650
|
-
switch (n.event) {
|
651
|
-
case "getObject":
|
652
|
-
_.dispatchEvent({ type: j.GET_OBJECT, value: n.data });
|
653
|
-
break;
|
654
|
-
case "updateObject":
|
655
|
-
_.dispatchEvent({ type: j.UPDATE_OBJECT, value: n.data });
|
656
|
-
break;
|
657
|
-
case "createTexture":
|
658
|
-
_.dispatchEvent({ type: j.CREATE_TEXTURE, value: n.data });
|
659
|
-
break;
|
660
|
-
case "requestMethod":
|
661
|
-
_.dispatchEvent({ type: j.REQUEST_METHOD, value: n.data });
|
662
|
-
break;
|
663
|
-
}
|
664
|
-
}
|
665
|
-
function Ka(t, n) {
|
666
|
-
switch (n.event) {
|
667
|
-
case "setObject":
|
668
|
-
_.dispatchEvent({ type: j.SET_OBJECT, value: n.data });
|
669
|
-
break;
|
670
|
-
case "setScene":
|
671
|
-
_.dispatchEvent({ type: j.SET_SCENE, value: n.data });
|
672
|
-
break;
|
673
|
-
case "addCamera":
|
674
|
-
_.dispatchEvent({ type: j.ADD_CAMERA, value: n.data });
|
675
|
-
break;
|
676
|
-
case "removeCamera":
|
677
|
-
_.dispatchEvent({ type: j.REMOVE_CAMERA, value: n.data });
|
678
|
-
break;
|
679
|
-
}
|
680
|
-
}
|
681
|
-
class Bn extends At {
|
682
|
-
constructor(a) {
|
683
|
-
super(a);
|
684
|
-
F(this, "bindCBs");
|
685
|
-
F(this, "buttonCBs");
|
686
|
-
F(this, "pane");
|
687
|
-
F(this, "appCallbacks", 0);
|
688
|
-
F(this, "editorCallbacks", 0);
|
689
|
-
F(this, "inspectorFolder");
|
690
|
-
this.bindCBs = /* @__PURE__ */ new Map(), this.buttonCBs = /* @__PURE__ */ new Map(), a.editor && this.createGUI();
|
691
|
-
}
|
692
|
-
createGUI() {
|
693
|
-
this.pane = new Pa({ title: "GUI" }), this.pane.registerPlugin(Aa);
|
694
|
-
}
|
695
|
-
dispose() {
|
696
|
-
var a;
|
697
|
-
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);
|
698
|
-
}
|
699
|
-
addFolder(a, e = void 0, r = void 0) {
|
700
|
-
if (this.app.editor)
|
701
|
-
return this.pane === void 0 && this.createGUI(), (r !== void 0 ? r : this.pane).addFolder({
|
702
|
-
title: a,
|
703
|
-
...e
|
704
|
-
});
|
705
|
-
this.app.send({
|
706
|
-
event: "addFolder",
|
707
|
-
target: "app",
|
708
|
-
data: {
|
709
|
-
name: a,
|
710
|
-
params: e,
|
711
|
-
parent: r
|
712
|
-
}
|
713
|
-
});
|
714
|
-
}
|
715
|
-
get bindID() {
|
716
|
-
return `debug_${Math.max(this.appCallbacks, this.editorCallbacks)}`;
|
717
|
-
}
|
718
|
-
// Binding
|
719
|
-
bind(a, e, r, s = void 0) {
|
720
|
-
const h = this.bindID, c = r.onChange !== void 0 ? r.onChange : Nn;
|
721
|
-
this.bindCBs.set(h, c), this.app.editor ? (this.pane === void 0 && this.createGUI(), (s !== void 0 ? s : this.pane).addBinding(a, e, r).on("change", (d) => {
|
722
|
-
this.app.send({
|
723
|
-
event: "updateBind",
|
724
|
-
target: "app",
|
725
|
-
data: {
|
726
|
-
id: h,
|
727
|
-
value: d.value
|
728
|
-
}
|
729
|
-
});
|
730
|
-
}), this.editorCallbacks++) : (this.app.send({
|
731
|
-
event: "bindObject",
|
732
|
-
target: "app",
|
733
|
-
data: {
|
734
|
-
id: h,
|
735
|
-
name: e,
|
736
|
-
params: r,
|
737
|
-
parent: s
|
738
|
-
}
|
739
|
-
}), this.appCallbacks++);
|
740
|
-
}
|
741
|
-
triggerBind(a, e) {
|
742
|
-
const r = this.bindCBs.get(a);
|
743
|
-
r !== void 0 ? r(e) : console.warn(`No callback for: ${a}`, e);
|
744
|
-
}
|
745
|
-
// Buttons
|
746
|
-
button(a, e, r = void 0) {
|
747
|
-
const s = this.bindID;
|
748
|
-
this.buttonCBs.set(s, e), this.app.editor ? (this.pane === void 0 && this.createGUI(), (r !== void 0 ? r : this.pane).addButton({ title: a }).on("click", () => {
|
749
|
-
this.app.send({
|
750
|
-
event: "clickButton",
|
751
|
-
target: "app",
|
752
|
-
data: {
|
753
|
-
id: s
|
754
|
-
}
|
755
|
-
});
|
756
|
-
}), this.editorCallbacks++) : (this.app.send({
|
757
|
-
event: "addButton",
|
758
|
-
target: "app",
|
759
|
-
data: {
|
760
|
-
id: s,
|
761
|
-
name: a,
|
762
|
-
callback: e,
|
763
|
-
parent: r
|
764
|
-
}
|
765
|
-
}), this.appCallbacks++);
|
766
|
-
}
|
767
|
-
triggerButton(a) {
|
768
|
-
const e = this.buttonCBs.get(a);
|
769
|
-
e !== void 0 && e();
|
770
|
-
}
|
771
|
-
// Inspector
|
772
|
-
createInspector() {
|
773
|
-
this.inspectorFolder = this.addFolder("Inspector", this.pane);
|
774
|
-
}
|
775
|
-
clearInspector() {
|
776
|
-
const a = this.inspectorFolder.children.length - 1;
|
777
|
-
for (let e = a; e > -1; --e)
|
778
|
-
this.inspectorFolder.remove(this.inspectorFolder.children[e]);
|
779
|
-
}
|
780
|
-
}
|
781
|
-
function Xa(t, n) {
|
782
|
-
t.components.forEach((a) => {
|
783
|
-
if (a instanceof Bn) {
|
784
|
-
const e = a;
|
785
|
-
switch (n.event) {
|
786
|
-
case "addFolder":
|
787
|
-
e.addFolder(n.data.name, n.data.params, n.data.parent);
|
788
|
-
break;
|
789
|
-
case "bindObject":
|
790
|
-
e.bind(n.data.name, n.data.params, n.data.parent);
|
791
|
-
break;
|
792
|
-
case "updateBind":
|
793
|
-
e.triggerBind(n.data.id, n.data.value);
|
794
|
-
break;
|
795
|
-
case "addButton":
|
796
|
-
e.button(n.data.name, n.data.callback, n.data.parent);
|
797
|
-
break;
|
798
|
-
case "clickButton":
|
799
|
-
e.triggerButton(n.data.id);
|
800
|
-
break;
|
801
|
-
}
|
802
|
-
return;
|
803
|
-
}
|
804
|
-
});
|
805
|
-
}
|
806
|
-
var Wt = { exports: {} }, ot = {};
|
807
|
-
/**
|
808
|
-
* @license React
|
809
|
-
* react-jsx-runtime.production.min.js
|
810
|
-
*
|
811
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
812
|
-
*
|
813
|
-
* This source code is licensed under the MIT license found in the
|
814
|
-
* LICENSE file in the root directory of this source tree.
|
815
|
-
*/
|
816
|
-
var en;
|
817
|
-
function Za() {
|
818
|
-
if (en)
|
819
|
-
return ot;
|
820
|
-
en = 1;
|
821
|
-
var t = jn, n = Symbol.for("react.element"), a = Symbol.for("react.fragment"), e = Object.prototype.hasOwnProperty, r = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, s = { key: !0, ref: !0, __self: !0, __source: !0 };
|
822
|
-
function h(c, l, d) {
|
823
|
-
var b, m = {}, E = null, S = null;
|
824
|
-
d !== void 0 && (E = "" + d), l.key !== void 0 && (E = "" + l.key), l.ref !== void 0 && (S = l.ref);
|
825
|
-
for (b in l)
|
826
|
-
e.call(l, b) && !s.hasOwnProperty(b) && (m[b] = l[b]);
|
827
|
-
if (c && c.defaultProps)
|
828
|
-
for (b in l = c.defaultProps, l)
|
829
|
-
m[b] === void 0 && (m[b] = l[b]);
|
830
|
-
return { $$typeof: n, type: c, key: E, ref: S, props: m, _owner: r.current };
|
831
|
-
}
|
832
|
-
return ot.Fragment = a, ot.jsx = h, ot.jsxs = h, ot;
|
833
|
-
}
|
834
|
-
var st = {};
|
835
|
-
/**
|
836
|
-
* @license React
|
837
|
-
* react-jsx-runtime.development.js
|
838
|
-
*
|
839
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
840
|
-
*
|
841
|
-
* This source code is licensed under the MIT license found in the
|
842
|
-
* LICENSE file in the root directory of this source tree.
|
843
|
-
*/
|
844
|
-
var tn;
|
845
|
-
function Ja() {
|
846
|
-
return tn || (tn = 1, process.env.NODE_ENV !== "production" && function() {
|
847
|
-
var t = jn, n = Symbol.for("react.element"), a = Symbol.for("react.portal"), e = Symbol.for("react.fragment"), r = Symbol.for("react.strict_mode"), s = Symbol.for("react.profiler"), h = Symbol.for("react.provider"), c = Symbol.for("react.context"), l = Symbol.for("react.forward_ref"), d = Symbol.for("react.suspense"), b = Symbol.for("react.suspense_list"), m = Symbol.for("react.memo"), E = Symbol.for("react.lazy"), S = Symbol.for("react.offscreen"), x = Symbol.iterator, T = "@@iterator";
|
848
|
-
function W(i) {
|
849
|
-
if (i === null || typeof i != "object")
|
850
|
-
return null;
|
851
|
-
var p = x && i[x] || i[T];
|
852
|
-
return typeof p == "function" ? p : null;
|
853
|
-
}
|
854
|
-
var I = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
855
|
-
function w(i) {
|
856
|
-
{
|
857
|
-
for (var p = arguments.length, g = new Array(p > 1 ? p - 1 : 0), O = 1; O < p; O++)
|
858
|
-
g[O - 1] = arguments[O];
|
859
|
-
G("error", i, g);
|
860
|
-
}
|
861
|
-
}
|
862
|
-
function G(i, p, g) {
|
863
|
-
{
|
864
|
-
var O = I.ReactDebugCurrentFrame, D = O.getStackAddendum();
|
865
|
-
D !== "" && (p += "%s", g = g.concat([D]));
|
866
|
-
var $ = g.map(function(k) {
|
867
|
-
return String(k);
|
868
|
-
});
|
869
|
-
$.unshift("Warning: " + p), Function.prototype.apply.call(console[i], console, $);
|
870
|
-
}
|
871
|
-
}
|
872
|
-
var he = !1, te = !1, ae = !1, f = !1, v = !1, C;
|
873
|
-
C = Symbol.for("react.module.reference");
|
874
|
-
function A(i) {
|
875
|
-
return !!(typeof i == "string" || typeof i == "function" || i === e || i === s || v || i === r || i === d || i === b || f || i === S || he || te || ae || typeof i == "object" && i !== null && (i.$$typeof === E || i.$$typeof === m || i.$$typeof === h || i.$$typeof === c || i.$$typeof === l || // This needs to include all possible module reference object
|
876
|
-
// types supported by any Flight configuration anywhere since
|
877
|
-
// we don't know which Flight build this will end up being used
|
878
|
-
// with.
|
879
|
-
i.$$typeof === C || i.getModuleId !== void 0));
|
880
|
-
}
|
881
|
-
function Y(i, p, g) {
|
882
|
-
var O = i.displayName;
|
883
|
-
if (O)
|
884
|
-
return O;
|
885
|
-
var D = p.displayName || p.name || "";
|
886
|
-
return D !== "" ? g + "(" + D + ")" : g;
|
887
|
-
}
|
888
|
-
function z(i) {
|
889
|
-
return i.displayName || "Context";
|
890
|
-
}
|
891
|
-
function B(i) {
|
892
|
-
if (i == null)
|
893
|
-
return null;
|
894
|
-
if (typeof i.tag == "number" && w("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof i == "function")
|
895
|
-
return i.displayName || i.name || null;
|
896
|
-
if (typeof i == "string")
|
897
|
-
return i;
|
898
|
-
switch (i) {
|
899
|
-
case e:
|
900
|
-
return "Fragment";
|
901
|
-
case a:
|
902
|
-
return "Portal";
|
903
|
-
case s:
|
904
|
-
return "Profiler";
|
905
|
-
case r:
|
906
|
-
return "StrictMode";
|
907
|
-
case d:
|
908
|
-
return "Suspense";
|
909
|
-
case b:
|
910
|
-
return "SuspenseList";
|
911
|
-
}
|
912
|
-
if (typeof i == "object")
|
913
|
-
switch (i.$$typeof) {
|
914
|
-
case c:
|
915
|
-
var p = i;
|
916
|
-
return z(p) + ".Consumer";
|
917
|
-
case h:
|
918
|
-
var g = i;
|
919
|
-
return z(g._context) + ".Provider";
|
920
|
-
case l:
|
921
|
-
return Y(i, i.render, "ForwardRef");
|
922
|
-
case m:
|
923
|
-
var O = i.displayName || null;
|
924
|
-
return O !== null ? O : B(i.type) || "Memo";
|
925
|
-
case E: {
|
926
|
-
var D = i, $ = D._payload, k = D._init;
|
927
|
-
try {
|
928
|
-
return B(k($));
|
929
|
-
} catch {
|
930
|
-
return null;
|
931
|
-
}
|
932
|
-
}
|
933
|
-
}
|
934
|
-
return null;
|
935
|
-
}
|
936
|
-
var L = Object.assign, q = 0, K, R, U, Q, fe, xe, pt;
|
937
|
-
function Je() {
|
938
|
-
}
|
939
|
-
Je.__reactDisabledLog = !0;
|
940
|
-
function _t() {
|
941
|
-
{
|
942
|
-
if (q === 0) {
|
943
|
-
K = console.log, R = console.info, U = console.warn, Q = console.error, fe = console.group, xe = console.groupCollapsed, pt = console.groupEnd;
|
944
|
-
var i = {
|
945
|
-
configurable: !0,
|
946
|
-
enumerable: !0,
|
947
|
-
value: Je,
|
948
|
-
writable: !0
|
949
|
-
};
|
950
|
-
Object.defineProperties(console, {
|
951
|
-
info: i,
|
952
|
-
log: i,
|
953
|
-
warn: i,
|
954
|
-
error: i,
|
955
|
-
group: i,
|
956
|
-
groupCollapsed: i,
|
957
|
-
groupEnd: i
|
958
|
-
});
|
959
|
-
}
|
960
|
-
q++;
|
961
|
-
}
|
962
|
-
}
|
963
|
-
function jt() {
|
964
|
-
{
|
965
|
-
if (q--, q === 0) {
|
966
|
-
var i = {
|
967
|
-
configurable: !0,
|
968
|
-
enumerable: !0,
|
969
|
-
writable: !0
|
970
|
-
};
|
971
|
-
Object.defineProperties(console, {
|
972
|
-
log: L({}, i, {
|
973
|
-
value: K
|
974
|
-
}),
|
975
|
-
info: L({}, i, {
|
976
|
-
value: R
|
977
|
-
}),
|
978
|
-
warn: L({}, i, {
|
979
|
-
value: U
|
980
|
-
}),
|
981
|
-
error: L({}, i, {
|
982
|
-
value: Q
|
983
|
-
}),
|
984
|
-
group: L({}, i, {
|
985
|
-
value: fe
|
986
|
-
}),
|
987
|
-
groupCollapsed: L({}, i, {
|
988
|
-
value: xe
|
989
|
-
}),
|
990
|
-
groupEnd: L({}, i, {
|
991
|
-
value: pt
|
992
|
-
})
|
993
|
-
});
|
994
|
-
}
|
995
|
-
q < 0 && w("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
996
|
-
}
|
997
|
-
}
|
998
|
-
var Qe = I.ReactCurrentDispatcher, et;
|
999
|
-
function ze(i, p, g) {
|
1000
|
-
{
|
1001
|
-
if (et === void 0)
|
1002
|
-
try {
|
1003
|
-
throw Error();
|
1004
|
-
} catch (D) {
|
1005
|
-
var O = D.stack.trim().match(/\n( *(at )?)/);
|
1006
|
-
et = O && O[1] || "";
|
1007
|
-
}
|
1008
|
-
return `
|
1009
|
-
` + et + i;
|
1010
|
-
}
|
1011
|
-
}
|
1012
|
-
var Ye = !1, Me;
|
1013
|
-
{
|
1014
|
-
var mt = typeof WeakMap == "function" ? WeakMap : Map;
|
1015
|
-
Me = new mt();
|
1016
|
-
}
|
1017
|
-
function vt(i, p) {
|
1018
|
-
if (!i || Ye)
|
1019
|
-
return "";
|
1020
|
-
{
|
1021
|
-
var g = Me.get(i);
|
1022
|
-
if (g !== void 0)
|
1023
|
-
return g;
|
1024
|
-
}
|
1025
|
-
var O;
|
1026
|
-
Ye = !0;
|
1027
|
-
var D = Error.prepareStackTrace;
|
1028
|
-
Error.prepareStackTrace = void 0;
|
1029
|
-
var $;
|
1030
|
-
$ = Qe.current, Qe.current = null, _t();
|
1031
|
-
try {
|
1032
|
-
if (p) {
|
1033
|
-
var k = function() {
|
1034
|
-
throw Error();
|
1035
|
-
};
|
1036
|
-
if (Object.defineProperty(k.prototype, "props", {
|
1037
|
-
set: function() {
|
1038
|
-
throw Error();
|
1039
|
-
}
|
1040
|
-
}), typeof Reflect == "object" && Reflect.construct) {
|
1041
|
-
try {
|
1042
|
-
Reflect.construct(k, []);
|
1043
|
-
} catch (be) {
|
1044
|
-
O = be;
|
1045
|
-
}
|
1046
|
-
Reflect.construct(i, [], k);
|
1047
|
-
} else {
|
1048
|
-
try {
|
1049
|
-
k.call();
|
1050
|
-
} catch (be) {
|
1051
|
-
O = be;
|
1052
|
-
}
|
1053
|
-
i.call(k.prototype);
|
1054
|
-
}
|
1055
|
-
} else {
|
1056
|
-
try {
|
1057
|
-
throw Error();
|
1058
|
-
} catch (be) {
|
1059
|
-
O = be;
|
1060
|
-
}
|
1061
|
-
i();
|
1062
|
-
}
|
1063
|
-
} catch (be) {
|
1064
|
-
if (be && O && typeof be.stack == "string") {
|
1065
|
-
for (var P = be.stack.split(`
|
1066
|
-
`), ue = O.stack.split(`
|
1067
|
-
`), J = P.length - 1, ee = ue.length - 1; J >= 1 && ee >= 0 && P[J] !== ue[ee]; )
|
1068
|
-
ee--;
|
1069
|
-
for (; J >= 1 && ee >= 0; J--, ee--)
|
1070
|
-
if (P[J] !== ue[ee]) {
|
1071
|
-
if (J !== 1 || ee !== 1)
|
1072
|
-
do
|
1073
|
-
if (J--, ee--, ee < 0 || P[J] !== ue[ee]) {
|
1074
|
-
var ve = `
|
1075
|
-
` + P[J].replace(" at new ", " at ");
|
1076
|
-
return i.displayName && ve.includes("<anonymous>") && (ve = ve.replace("<anonymous>", i.displayName)), typeof i == "function" && Me.set(i, ve), ve;
|
1077
|
-
}
|
1078
|
-
while (J >= 1 && ee >= 0);
|
1079
|
-
break;
|
1080
|
-
}
|
1081
|
-
}
|
1082
|
-
} finally {
|
1083
|
-
Ye = !1, Qe.current = $, jt(), Error.prepareStackTrace = D;
|
1084
|
-
}
|
1085
|
-
var Ve = i ? i.displayName || i.name : "", Xt = Ve ? ze(Ve) : "";
|
1086
|
-
return typeof i == "function" && Me.set(i, Xt), Xt;
|
1087
|
-
}
|
1088
|
-
function Dt(i, p, g) {
|
1089
|
-
return vt(i, !1);
|
1090
|
-
}
|
1091
|
-
function gt(i) {
|
1092
|
-
var p = i.prototype;
|
1093
|
-
return !!(p && p.isReactComponent);
|
1094
|
-
}
|
1095
|
-
function Te(i, p, g) {
|
1096
|
-
if (i == null)
|
1097
|
-
return "";
|
1098
|
-
if (typeof i == "function")
|
1099
|
-
return vt(i, gt(i));
|
1100
|
-
if (typeof i == "string")
|
1101
|
-
return ze(i);
|
1102
|
-
switch (i) {
|
1103
|
-
case d:
|
1104
|
-
return ze("Suspense");
|
1105
|
-
case b:
|
1106
|
-
return ze("SuspenseList");
|
1107
|
-
}
|
1108
|
-
if (typeof i == "object")
|
1109
|
-
switch (i.$$typeof) {
|
1110
|
-
case l:
|
1111
|
-
return Dt(i.render);
|
1112
|
-
case m:
|
1113
|
-
return Te(i.type, p, g);
|
1114
|
-
case E: {
|
1115
|
-
var O = i, D = O._payload, $ = O._init;
|
1116
|
-
try {
|
1117
|
-
return Te($(D), p, g);
|
1118
|
-
} catch {
|
1119
|
-
}
|
1120
|
-
}
|
1121
|
-
}
|
1122
|
-
return "";
|
1123
|
-
}
|
1124
|
-
var Re = Object.prototype.hasOwnProperty, bt = {}, yt = I.ReactDebugCurrentFrame;
|
1125
|
-
function Pe(i) {
|
1126
|
-
if (i) {
|
1127
|
-
var p = i._owner, g = Te(i.type, i._source, p ? p.type : null);
|
1128
|
-
yt.setExtraStackFrame(g);
|
1129
|
-
} else
|
1130
|
-
yt.setExtraStackFrame(null);
|
1131
|
-
}
|
1132
|
-
function tt(i, p, g, O, D) {
|
1133
|
-
{
|
1134
|
-
var $ = Function.call.bind(Re);
|
1135
|
-
for (var k in i)
|
1136
|
-
if ($(i, k)) {
|
1137
|
-
var P = void 0;
|
1138
|
-
try {
|
1139
|
-
if (typeof i[k] != "function") {
|
1140
|
-
var ue = Error((O || "React class") + ": " + g + " type `" + k + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof i[k] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
1141
|
-
throw ue.name = "Invariant Violation", ue;
|
1142
|
-
}
|
1143
|
-
P = i[k](p, k, O, g, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
1144
|
-
} catch (J) {
|
1145
|
-
P = J;
|
1146
|
-
}
|
1147
|
-
P && !(P instanceof Error) && (Pe(D), 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).", O || "React class", g, k, typeof P), Pe(null)), P instanceof Error && !(P.message in bt) && (bt[P.message] = !0, Pe(D), w("Failed %s type: %s", g, P.message), Pe(null));
|
1148
|
-
}
|
1149
|
-
}
|
1150
|
-
}
|
1151
|
-
var Ae = Array.isArray;
|
1152
|
-
function nt(i) {
|
1153
|
-
return Ae(i);
|
1154
|
-
}
|
1155
|
-
function It(i) {
|
1156
|
-
{
|
1157
|
-
var p = typeof Symbol == "function" && Symbol.toStringTag, g = p && i[Symbol.toStringTag] || i.constructor.name || "Object";
|
1158
|
-
return g;
|
1159
|
-
}
|
1160
|
-
}
|
1161
|
-
function Et(i) {
|
1162
|
-
try {
|
1163
|
-
return Ct(i), !1;
|
1164
|
-
} catch {
|
1165
|
-
return !0;
|
1166
|
-
}
|
1167
|
-
}
|
1168
|
-
function Ct(i) {
|
1169
|
-
return "" + i;
|
1170
|
-
}
|
1171
|
-
function xt(i) {
|
1172
|
-
if (Et(i))
|
1173
|
-
return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", It(i)), Ct(i);
|
1174
|
-
}
|
1175
|
-
var Se = I.ReactCurrentOwner, at = {
|
1176
|
-
key: !0,
|
1177
|
-
ref: !0,
|
1178
|
-
__self: !0,
|
1179
|
-
__source: !0
|
1180
|
-
}, it, St, Ge;
|
1181
|
-
Ge = {};
|
1182
|
-
function Lt(i) {
|
1183
|
-
if (Re.call(i, "ref")) {
|
1184
|
-
var p = Object.getOwnPropertyDescriptor(i, "ref").get;
|
1185
|
-
if (p && p.isReactWarning)
|
1186
|
-
return !1;
|
1187
|
-
}
|
1188
|
-
return i.ref !== void 0;
|
1189
|
-
}
|
1190
|
-
function Nt(i) {
|
1191
|
-
if (Re.call(i, "key")) {
|
1192
|
-
var p = Object.getOwnPropertyDescriptor(i, "key").get;
|
1193
|
-
if (p && p.isReactWarning)
|
1194
|
-
return !1;
|
1195
|
-
}
|
1196
|
-
return i.key !== void 0;
|
1197
|
-
}
|
1198
|
-
function wt(i, p) {
|
1199
|
-
if (typeof i.ref == "string" && Se.current && p && Se.current.stateNode !== p) {
|
1200
|
-
var g = B(Se.current.type);
|
1201
|
-
Ge[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', B(Se.current.type), i.ref), Ge[g] = !0);
|
1202
|
-
}
|
1203
|
-
}
|
1204
|
-
function we(i, p) {
|
1205
|
-
{
|
1206
|
-
var g = function() {
|
1207
|
-
it || (it = !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)", p));
|
1208
|
-
};
|
1209
|
-
g.isReactWarning = !0, Object.defineProperty(i, "key", {
|
1210
|
-
get: g,
|
1211
|
-
configurable: !0
|
1212
|
-
});
|
1213
|
-
}
|
1214
|
-
}
|
1215
|
-
function Kt(i, p) {
|
1216
|
-
{
|
1217
|
-
var g = function() {
|
1218
|
-
St || (St = !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)", p));
|
1219
|
-
};
|
1220
|
-
g.isReactWarning = !0, Object.defineProperty(i, "ref", {
|
1221
|
-
get: g,
|
1222
|
-
configurable: !0
|
1223
|
-
});
|
1224
|
-
}
|
1225
|
-
}
|
1226
|
-
var o = function(i, p, g, O, D, $, k) {
|
1227
|
-
var P = {
|
1228
|
-
// This tag allows us to uniquely identify this as a React Element
|
1229
|
-
$$typeof: n,
|
1230
|
-
// Built-in properties that belong on the element
|
1231
|
-
type: i,
|
1232
|
-
key: p,
|
1233
|
-
ref: g,
|
1234
|
-
props: k,
|
1235
|
-
// Record the component responsible for creating this element.
|
1236
|
-
_owner: $
|
1237
|
-
};
|
1238
|
-
return P._store = {}, Object.defineProperty(P._store, "validated", {
|
1239
|
-
configurable: !1,
|
1240
|
-
enumerable: !1,
|
1241
|
-
writable: !0,
|
1242
|
-
value: !1
|
1243
|
-
}), Object.defineProperty(P, "_self", {
|
1244
|
-
configurable: !1,
|
1245
|
-
enumerable: !1,
|
1246
|
-
writable: !1,
|
1247
|
-
value: O
|
1248
|
-
}), Object.defineProperty(P, "_source", {
|
1249
|
-
configurable: !1,
|
1250
|
-
enumerable: !1,
|
1251
|
-
writable: !1,
|
1252
|
-
value: D
|
1253
|
-
}), Object.freeze && (Object.freeze(P.props), Object.freeze(P)), P;
|
1254
|
-
};
|
1255
|
-
function y(i, p, g, O, D) {
|
1256
|
-
{
|
1257
|
-
var $, k = {}, P = null, ue = null;
|
1258
|
-
g !== void 0 && (xt(g), P = "" + g), Nt(p) && (xt(p.key), P = "" + p.key), Lt(p) && (ue = p.ref, wt(p, D));
|
1259
|
-
for ($ in p)
|
1260
|
-
Re.call(p, $) && !at.hasOwnProperty($) && (k[$] = p[$]);
|
1261
|
-
if (i && i.defaultProps) {
|
1262
|
-
var J = i.defaultProps;
|
1263
|
-
for ($ in J)
|
1264
|
-
k[$] === void 0 && (k[$] = J[$]);
|
1265
|
-
}
|
1266
|
-
if (P || ue) {
|
1267
|
-
var ee = typeof i == "function" ? i.displayName || i.name || "Unknown" : i;
|
1268
|
-
P && we(k, ee), ue && Kt(k, ee);
|
1269
|
-
}
|
1270
|
-
return o(i, P, ue, D, O, Se.current, k);
|
1271
|
-
}
|
1272
|
-
}
|
1273
|
-
var M = I.ReactCurrentOwner, N = I.ReactDebugCurrentFrame;
|
1274
|
-
function X(i) {
|
1275
|
-
if (i) {
|
1276
|
-
var p = i._owner, g = Te(i.type, i._source, p ? p.type : null);
|
1277
|
-
N.setExtraStackFrame(g);
|
1278
|
-
} else
|
1279
|
-
N.setExtraStackFrame(null);
|
1280
|
-
}
|
1281
|
-
var pe;
|
1282
|
-
pe = !1;
|
1283
|
-
function oe(i) {
|
1284
|
-
return typeof i == "object" && i !== null && i.$$typeof === n;
|
1285
|
-
}
|
1286
|
-
function Ft() {
|
1287
|
-
{
|
1288
|
-
if (M.current) {
|
1289
|
-
var i = B(M.current.type);
|
1290
|
-
if (i)
|
1291
|
-
return `
|
1292
|
-
|
1293
|
-
Check the render method of \`` + i + "`.";
|
1294
|
-
}
|
1295
|
-
return "";
|
1296
|
-
}
|
1297
|
-
}
|
1298
|
-
function Bt(i) {
|
1299
|
-
{
|
1300
|
-
if (i !== void 0) {
|
1301
|
-
var p = i.fileName.replace(/^.*[\\\/]/, ""), g = i.lineNumber;
|
1302
|
-
return `
|
1303
|
-
|
1304
|
-
Check your code at ` + p + ":" + g + ".";
|
1305
|
-
}
|
1306
|
-
return "";
|
1307
|
-
}
|
1308
|
-
}
|
1309
|
-
var rt = {};
|
1310
|
-
function ge(i) {
|
1311
|
-
{
|
1312
|
-
var p = Ft();
|
1313
|
-
if (!p) {
|
1314
|
-
var g = typeof i == "string" ? i : i.displayName || i.name;
|
1315
|
-
g && (p = `
|
1316
|
-
|
1317
|
-
Check the top-level render call using <` + g + ">.");
|
1318
|
-
}
|
1319
|
-
return p;
|
1320
|
-
}
|
1321
|
-
}
|
1322
|
-
function me(i, p) {
|
1323
|
-
{
|
1324
|
-
if (!i._store || i._store.validated || i.key != null)
|
1325
|
-
return;
|
1326
|
-
i._store.validated = !0;
|
1327
|
-
var g = ge(p);
|
1328
|
-
if (rt[g])
|
1329
|
-
return;
|
1330
|
-
rt[g] = !0;
|
1331
|
-
var O = "";
|
1332
|
-
i && i._owner && i._owner !== M.current && (O = " It was passed a child from " + B(i._owner.type) + "."), X(i), 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, O), X(null);
|
1333
|
-
}
|
1334
|
-
}
|
1335
|
-
function ke(i, p) {
|
1336
|
-
{
|
1337
|
-
if (typeof i != "object")
|
1338
|
-
return;
|
1339
|
-
if (nt(i))
|
1340
|
-
for (var g = 0; g < i.length; g++) {
|
1341
|
-
var O = i[g];
|
1342
|
-
oe(O) && me(O, p);
|
1343
|
-
}
|
1344
|
-
else if (oe(i))
|
1345
|
-
i._store && (i._store.validated = !0);
|
1346
|
-
else if (i) {
|
1347
|
-
var D = W(i);
|
1348
|
-
if (typeof D == "function" && D !== i.entries)
|
1349
|
-
for (var $ = D.call(i), k; !(k = $.next()).done; )
|
1350
|
-
oe(k.value) && me(k.value, p);
|
1351
|
-
}
|
1352
|
-
}
|
1353
|
-
}
|
1354
|
-
function _e(i) {
|
1355
|
-
{
|
1356
|
-
var p = i.type;
|
1357
|
-
if (p == null || typeof p == "string")
|
1358
|
-
return;
|
1359
|
-
var g;
|
1360
|
-
if (typeof p == "function")
|
1361
|
-
g = p.propTypes;
|
1362
|
-
else if (typeof p == "object" && (p.$$typeof === l || // Note: Memo only checks outer props here.
|
1363
|
-
// Inner props are checked in the reconciler.
|
1364
|
-
p.$$typeof === m))
|
1365
|
-
g = p.propTypes;
|
1366
|
-
else
|
1367
|
-
return;
|
1368
|
-
if (g) {
|
1369
|
-
var O = B(p);
|
1370
|
-
tt(g, i.props, "prop", O, i);
|
1371
|
-
} else if (p.PropTypes !== void 0 && !pe) {
|
1372
|
-
pe = !0;
|
1373
|
-
var D = B(p);
|
1374
|
-
w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", D || "Unknown");
|
1375
|
-
}
|
1376
|
-
typeof p.getDefaultProps == "function" && !p.getDefaultProps.isReactClassApproved && w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
1377
|
-
}
|
1378
|
-
}
|
1379
|
-
function je(i) {
|
1380
|
-
{
|
1381
|
-
for (var p = Object.keys(i.props), g = 0; g < p.length; g++) {
|
1382
|
-
var O = p[g];
|
1383
|
-
if (O !== "children" && O !== "key") {
|
1384
|
-
X(i), w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", O), X(null);
|
1385
|
-
break;
|
1386
|
-
}
|
1387
|
-
}
|
1388
|
-
i.ref !== null && (X(i), w("Invalid attribute `ref` supplied to `React.Fragment`."), X(null));
|
1389
|
-
}
|
1390
|
-
}
|
1391
|
-
function De(i, p, g, O, D, $) {
|
1392
|
-
{
|
1393
|
-
var k = A(i);
|
1394
|
-
if (!k) {
|
1395
|
-
var P = "";
|
1396
|
-
(i === void 0 || typeof i == "object" && i !== null && Object.keys(i).length === 0) && (P += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
1397
|
-
var ue = Bt(D);
|
1398
|
-
ue ? P += ue : P += Ft();
|
1399
|
-
var J;
|
1400
|
-
i === null ? J = "null" : nt(i) ? J = "array" : i !== void 0 && i.$$typeof === n ? (J = "<" + (B(i.type) || "Unknown") + " />", P = " Did you accidentally export a JSX literal instead of a component?") : J = typeof i, w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", J, P);
|
1401
|
-
}
|
1402
|
-
var ee = y(i, p, g, D, $);
|
1403
|
-
if (ee == null)
|
1404
|
-
return ee;
|
1405
|
-
if (k) {
|
1406
|
-
var ve = p.children;
|
1407
|
-
if (ve !== void 0)
|
1408
|
-
if (O)
|
1409
|
-
if (nt(ve)) {
|
1410
|
-
for (var Ve = 0; Ve < ve.length; Ve++)
|
1411
|
-
ke(ve[Ve], i);
|
1412
|
-
Object.freeze && Object.freeze(ve);
|
1413
|
-
} else
|
1414
|
-
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.");
|
1415
|
-
else
|
1416
|
-
ke(ve, i);
|
1417
|
-
}
|
1418
|
-
return i === e ? je(ee) : _e(ee), ee;
|
1419
|
-
}
|
1420
|
-
}
|
1421
|
-
function Gn(i, p, g) {
|
1422
|
-
return De(i, p, g, !0);
|
1423
|
-
}
|
1424
|
-
function Vn(i, p, g) {
|
1425
|
-
return De(i, p, g, !1);
|
1426
|
-
}
|
1427
|
-
var Hn = Vn, Wn = Gn;
|
1428
|
-
st.Fragment = e, st.jsx = Hn, st.jsxs = Wn;
|
1429
|
-
}()), st;
|
1430
|
-
}
|
1431
|
-
process.env.NODE_ENV === "production" ? Wt.exports = Za() : Wt.exports = Ja();
|
1432
|
-
var u = Wt.exports;
|
1433
|
-
function Un(t) {
|
1434
|
-
return t.title.search("<") > -1 ? /* @__PURE__ */ u.jsx("button", { className: "svg", dangerouslySetInnerHTML: { __html: t.title } }) : /* @__PURE__ */ u.jsx("button", { children: t.title });
|
1435
|
-
}
|
1436
|
-
const Qa = /* @__PURE__ */ u.jsxs("svg", { className: "closeIcon", width: "14", height: "14", fill: "none", stroke: "#666666", strokeMiterlimit: "10", children: [
|
1437
|
-
/* @__PURE__ */ u.jsx("circle", { cx: "7", cy: "7", r: "6" }),
|
1438
|
-
/* @__PURE__ */ u.jsx("line", { x1: "4", y1: "4", x2: "10", y2: "10" }),
|
1439
|
-
/* @__PURE__ */ u.jsx("line", { x1: "4", y1: "10", x2: "10", y2: "4" })
|
1440
|
-
] }), ei = /* @__PURE__ */ u.jsx("svg", { className: "dragIcon", width: "14", height: "14", fill: "#666666", stroke: "none", children: /* @__PURE__ */ u.jsx(
|
1441
|
-
"path",
|
1442
|
-
{
|
1443
|
-
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
|
1444
|
-
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.57,10h6.86C10.74,10,11,9.78,11,9.5v-1
|
1445
|
-
C11,8.22,10.74,8,10.43,8z`
|
1446
|
-
}
|
1447
|
-
) });
|
1448
|
-
function ti(t) {
|
1449
|
-
return /* @__PURE__ */ u.jsx(Dn.Item, { value: t.title, children: /* @__PURE__ */ u.jsxs("div", { children: [
|
1450
|
-
ei,
|
1451
|
-
/* @__PURE__ */ u.jsx("span", { children: t.title }),
|
1452
|
-
/* @__PURE__ */ u.jsx("button", { className: "closeIcon", onClick: () => {
|
1453
|
-
t.onDelete(t.index);
|
1454
|
-
}, children: Qa })
|
1455
|
-
] }) }, t.title);
|
1456
|
-
}
|
1457
|
-
function ni(t) {
|
1458
|
-
const [n, a] = le(!1), [e, r] = le(t.options), s = (d) => {
|
1459
|
-
t.onDragComplete(d), r(d);
|
1460
|
-
}, h = (d) => {
|
1461
|
-
const b = [...e];
|
1462
|
-
b.splice(d, 1), s(b);
|
1463
|
-
}, c = [];
|
1464
|
-
e.forEach((d, b) => {
|
1465
|
-
c.push(/* @__PURE__ */ u.jsx(ti, { index: b, title: d, onDelete: h }, d));
|
1466
|
-
});
|
1467
|
-
let l = "dropdown draggable";
|
1468
|
-
return t.subdropdown && (l += " subdropdown"), /* @__PURE__ */ u.jsxs("div", { className: l, onMouseEnter: () => a(!0), onMouseLeave: () => a(!1), children: [
|
1469
|
-
/* @__PURE__ */ u.jsx(Un, { title: t.title }),
|
1470
|
-
/* @__PURE__ */ u.jsx(Dn.Group, { axis: "y", values: e, onReorder: s, style: { visibility: n ? "visible" : "hidden" }, children: c })
|
1471
|
-
] });
|
1472
|
-
}
|
1473
|
-
function ai(t) {
|
1474
|
-
const [n, a] = le(!1), e = [];
|
1475
|
-
t.options.map((s, h) => {
|
1476
|
-
t.onSelect !== void 0 && (s.onSelect = t.onSelect), e.push(/* @__PURE__ */ u.jsx(ii, { option: s }, h));
|
1477
|
-
});
|
1478
|
-
let r = "dropdown";
|
1479
|
-
return t.subdropdown && (r += " subdropdown"), /* @__PURE__ */ u.jsxs(
|
1480
|
-
"div",
|
1481
|
-
{
|
1482
|
-
className: r,
|
1483
|
-
onMouseEnter: () => a(!0),
|
1484
|
-
onMouseLeave: () => a(!1),
|
1485
|
-
children: [
|
1486
|
-
/* @__PURE__ */ u.jsx(Un, { title: t.title }),
|
1487
|
-
/* @__PURE__ */ u.jsx(
|
1488
|
-
"ul",
|
1489
|
-
{
|
1490
|
-
style: { visibility: n ? "visible" : "hidden" },
|
1491
|
-
children: e
|
1492
|
-
}
|
1493
|
-
)
|
1494
|
-
]
|
1495
|
-
}
|
1496
|
-
);
|
1497
|
-
}
|
1498
|
-
function ii(t) {
|
1499
|
-
const { option: n } = t, [a, e] = le("");
|
1500
|
-
let r;
|
1501
|
-
switch (n.type) {
|
1502
|
-
case "draggable":
|
1503
|
-
r = /* @__PURE__ */ u.jsx(
|
1504
|
-
ni,
|
1505
|
-
{
|
1506
|
-
title: n.title,
|
1507
|
-
options: n.value,
|
1508
|
-
onDragComplete: (s) => {
|
1509
|
-
n.onDragComplete !== void 0 && n.onDragComplete(s);
|
1510
|
-
},
|
1511
|
-
subdropdown: !0
|
1512
|
-
}
|
1513
|
-
);
|
1514
|
-
break;
|
1515
|
-
case "dropdown":
|
1516
|
-
r = /* @__PURE__ */ u.jsx(
|
1517
|
-
ai,
|
1518
|
-
{
|
1519
|
-
title: n.title,
|
1520
|
-
options: n.value,
|
1521
|
-
onSelect: n.onSelect,
|
1522
|
-
subdropdown: !0
|
1523
|
-
}
|
1524
|
-
);
|
1525
|
-
break;
|
1526
|
-
case "option":
|
1527
|
-
r = /* @__PURE__ */ u.jsx(
|
1528
|
-
"button",
|
1529
|
-
{
|
1530
|
-
onClick: () => {
|
1531
|
-
n.onSelect !== void 0 && n.onSelect(n.value), n.selectable && (a !== n.title ? e(n.title) : e(""));
|
1532
|
-
},
|
1533
|
-
children: n.title
|
1534
|
-
}
|
1535
|
-
);
|
1536
|
-
break;
|
1537
|
-
}
|
1538
|
-
return /* @__PURE__ */ u.jsx("li", { className: a === n.title ? "selected" : "", children: r }, ja());
|
1539
|
-
}
|
1540
|
-
function Xi(t) {
|
1541
|
-
const n = [], a = [];
|
1542
|
-
t.components.forEach((s) => {
|
1543
|
-
s instanceof Fa ? n.push(Ba) : s instanceof Ze ? (n.push(Ua), a.push(za), $a(t)) : s instanceof Wa ? (n.push(qa), a.push(Ka)) : s instanceof Bn && n.push(Xa);
|
1544
|
-
});
|
1545
|
-
function e(s) {
|
1546
|
-
switch (n.forEach((h) => h(t, s)), s.event) {
|
1547
|
-
case "custom":
|
1548
|
-
_.dispatchEvent({ type: j.CUSTOM, value: s.data });
|
1549
|
-
break;
|
1550
|
-
}
|
1551
|
-
}
|
1552
|
-
function r(s) {
|
1553
|
-
switch (a.forEach((h) => h(t, s)), s.event) {
|
1554
|
-
case "custom":
|
1555
|
-
_.dispatchEvent({ type: j.CUSTOM, value: s.data });
|
1556
|
-
break;
|
1557
|
-
}
|
1558
|
-
}
|
1559
|
-
t.listen = (s) => {
|
1560
|
-
s.target === "editor" ? r(s) : e(s);
|
1561
|
-
};
|
1562
|
-
}
|
1563
|
-
const ri = `out vec3 worldPosition;
|
1564
|
-
uniform float uDistance;
|
1565
|
-
|
1566
|
-
void main() {
|
1567
|
-
// Scale the plane by the drawing distance
|
1568
|
-
worldPosition = position.xzy * uDistance;
|
1569
|
-
worldPosition.xz += cameraPosition.xz;
|
1570
|
-
|
1571
|
-
gl_Position = projectionMatrix * modelViewMatrix * vec4(worldPosition, 1.0);
|
1572
|
-
}`, oi = `out vec4 fragColor;
|
1573
|
-
in vec3 worldPosition;
|
1574
|
-
|
1575
|
-
uniform float uDivisions;
|
1576
|
-
uniform float uScale;
|
1577
|
-
uniform vec3 uColor;
|
1578
|
-
uniform float uDistance;
|
1579
|
-
uniform float uSubgridOpacity;
|
1580
|
-
uniform float uGridOpacity;
|
1581
|
-
|
1582
|
-
float getGrid(float gapSize) {
|
1583
|
-
vec2 worldPositionByDivision = worldPosition.xz / gapSize;
|
1584
|
-
|
1585
|
-
// Inverted, 0 where line, >1 where there's no line
|
1586
|
-
// We use the worldPosition (which in this case we use similarly to UVs) differential to control the anti-aliasing
|
1587
|
-
// We need to do the -0.5)-0.5 trick because the result fades out from 0 to 1, and we want both
|
1588
|
-
// worldPositionByDivision == 0.3 and worldPositionByDivision == 0.7 to result in the same fade, i.e. 0.3,
|
1589
|
-
// otherwise only one side of the line will be anti-aliased
|
1590
|
-
vec2 grid = abs(fract(worldPositionByDivision-0.5)-0.5) / fwidth(worldPositionByDivision) / 2.0;
|
1591
|
-
float gridLine = min(grid.x, grid.y);
|
1592
|
-
|
1593
|
-
// Uninvert and clamp
|
1594
|
-
return 1.0 - min(gridLine, 1.0);
|
1595
|
-
}
|
1596
|
-
|
1597
|
-
void main() {
|
1598
|
-
float cameraDistanceToGridPlane = distance(cameraPosition.y, worldPosition.y);
|
1599
|
-
float cameraDistanceToFragmentOnGridPlane = distance(cameraPosition.xz, worldPosition.xz);
|
1600
|
-
|
1601
|
-
// The size of the grid and subgrid are powers of each other and they are determined based on camera distance.
|
1602
|
-
// The current grid will become the next subgrid when it becomes too small, and its next power becomes the new grid.
|
1603
|
-
float subGridPower = pow(uDivisions, floor(log(cameraDistanceToGridPlane) / log(uDivisions)));
|
1604
|
-
float gridPower = subGridPower * uDivisions;
|
1605
|
-
|
1606
|
-
// 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
|
1607
|
-
float nextGridPower = gridPower * uDivisions;
|
1608
|
-
|
1609
|
-
// 1 where grid, 0 where no grid
|
1610
|
-
float subgrid = getGrid(subGridPower * uScale);
|
1611
|
-
float grid = getGrid(gridPower * uScale);
|
1612
|
-
float nextGrid = getGrid(nextGridPower * uScale);
|
1613
|
-
|
1614
|
-
// Where we are between the introduction of the current grid power and when we switch to the next grid power
|
1615
|
-
float stepPercentage = (cameraDistanceToGridPlane - subGridPower)/(gridPower - subGridPower);
|
1616
|
-
|
1617
|
-
// The last x percentage of the current step over which we want to fade
|
1618
|
-
float fadeRange = 0.3;
|
1619
|
-
|
1620
|
-
// We calculate the fade percentage from the step percentage and the fade range
|
1621
|
-
float fadePercentage = max(stepPercentage - 1.0 + fadeRange, 0.0) / fadeRange;
|
1622
|
-
|
1623
|
-
// Set base opacity based on how close we are to the drawing distance, with a cubic falloff
|
1624
|
-
float baseOpacity = subgrid * pow(1.0 - min(cameraDistanceToFragmentOnGridPlane / uDistance, 1.0), 3.0);
|
1625
|
-
|
1626
|
-
// Shade the subgrid
|
1627
|
-
fragColor = vec4(uColor.rgb, (baseOpacity - fadePercentage) * uSubgridOpacity);
|
1628
|
-
|
1629
|
-
// Somewhat arbitrary additional fade coefficient to counter anti-aliasing popping when switching between grid powers
|
1630
|
-
float fadeCoefficient = 0.5;
|
1631
|
-
|
1632
|
-
// Shade the grid
|
1633
|
-
fragColor.a = mix(fragColor.a, baseOpacity * uGridOpacity - fadePercentage * (uGridOpacity - uSubgridOpacity) * fadeCoefficient, grid);
|
1634
|
-
|
1635
|
-
// Shade the next grid
|
1636
|
-
fragColor.a = mix(fragColor.a, baseOpacity * uGridOpacity, nextGrid);
|
1637
|
-
|
1638
|
-
if (fragColor.a <= 0.0) discard;
|
1639
|
-
}`;
|
1640
|
-
class si extends pn {
|
1641
|
-
constructor(n) {
|
1642
|
-
super({
|
1643
|
-
extensions: {
|
1644
|
-
derivatives: !0
|
1645
|
-
},
|
1646
|
-
glslVersion: Jn,
|
1647
|
-
side: mn,
|
1648
|
-
transparent: !0,
|
1649
|
-
uniforms: {
|
1650
|
-
uScale: {
|
1651
|
-
value: (n == null ? void 0 : n.scale) !== void 0 ? n == null ? void 0 : n.scale : 0.1
|
1652
|
-
},
|
1653
|
-
uDivisions: {
|
1654
|
-
value: (n == null ? void 0 : n.divisions) !== void 0 ? n == null ? void 0 : n.divisions : 10
|
1655
|
-
},
|
1656
|
-
uColor: {
|
1657
|
-
value: (n == null ? void 0 : n.color) !== void 0 ? n == null ? void 0 : n.color : new Pt(16777215)
|
1658
|
-
},
|
1659
|
-
uDistance: {
|
1660
|
-
value: (n == null ? void 0 : n.distance) !== void 0 ? n == null ? void 0 : n.distance : 1e4
|
1661
|
-
},
|
1662
|
-
uSubgridOpacity: {
|
1663
|
-
value: (n == null ? void 0 : n.subgridOpacity) !== void 0 ? n == null ? void 0 : n.subgridOpacity : 0.15
|
1664
|
-
},
|
1665
|
-
uGridOpacity: {
|
1666
|
-
value: (n == null ? void 0 : n.gridOpacity) !== void 0 ? n == null ? void 0 : n.gridOpacity : 0.25
|
1667
|
-
}
|
1668
|
-
},
|
1669
|
-
vertexShader: ri,
|
1670
|
-
fragmentShader: oi,
|
1671
|
-
name: "InfiniteGrid",
|
1672
|
-
depthWrite: !1
|
1673
|
-
});
|
1674
|
-
}
|
1675
|
-
}
|
1676
|
-
class ci extends Qn {
|
1677
|
-
constructor() {
|
1678
|
-
const a = new si();
|
1679
|
-
super(new ea(2, 2), a);
|
1680
|
-
F(this, "gridMaterial");
|
1681
|
-
this.gridMaterial = a, this.frustumCulled = !1, this.name = "InfiniteGridHelper", this.position.y = 0.1;
|
1682
|
-
}
|
1683
|
-
update() {
|
1684
|
-
this.gridMaterial.needsUpdate = !0;
|
1685
|
-
}
|
1686
|
-
}
|
1687
|
-
const li = `#include <common>
|
1688
|
-
#include <batching_pars_vertex>
|
1689
|
-
#include <uv_pars_vertex>
|
1690
|
-
#include <color_pars_vertex>
|
1691
|
-
#include <morphtarget_pars_vertex>
|
1692
|
-
#include <skinning_pars_vertex>
|
1693
|
-
#include <logdepthbuf_pars_vertex>
|
1694
|
-
#include <clipping_planes_pars_vertex>
|
1695
|
-
|
1696
|
-
void main() {
|
1697
|
-
#include <uv_vertex>
|
1698
|
-
#include <color_vertex>
|
1699
|
-
#include <morphcolor_vertex>
|
1700
|
-
#include <batching_vertex>
|
1701
|
-
|
1702
|
-
#if defined ( USE_SKINNING )
|
1703
|
-
#include <beginnormal_vertex>
|
1704
|
-
#include <morphnormal_vertex>
|
1705
|
-
#include <skinbase_vertex>
|
1706
|
-
#include <skinnormal_vertex>
|
1707
|
-
#include <defaultnormal_vertex>
|
1708
|
-
#endif
|
1709
|
-
|
1710
|
-
#include <begin_vertex>
|
1711
|
-
#include <morphtarget_vertex>
|
1712
|
-
#include <skinning_vertex>
|
1713
|
-
#include <project_vertex>
|
1714
|
-
#include <logdepthbuf_vertex>
|
1715
|
-
#include <clipping_planes_vertex>
|
1716
|
-
#include <worldpos_vertex>
|
1717
|
-
}`, ui = `
|
1718
|
-
#include <common>
|
1719
|
-
#include <uv_pars_fragment>
|
1720
|
-
#include <clipping_planes_pars_fragment>
|
1721
|
-
|
1722
|
-
void main() {
|
1723
|
-
#include <clipping_planes_fragment>
|
1724
|
-
gl_FragColor = vec4(vec3(vUv, 0.0), 1.0);
|
1725
|
-
}`;
|
1726
|
-
class di extends pn {
|
1727
|
-
constructor() {
|
1728
|
-
super({
|
1729
|
-
defines: {
|
1730
|
-
USE_UV: ""
|
1731
|
-
},
|
1732
|
-
vertexShader: li,
|
1733
|
-
fragmentShader: ui
|
1734
|
-
});
|
1735
|
-
}
|
1736
|
-
}
|
1737
|
-
function qt(t) {
|
1738
|
-
const [n, a] = le(t.open !== void 0 ? t.open : !0), e = !n || t.children === void 0;
|
1739
|
-
return /* @__PURE__ */ u.jsxs("div", { className: `accordion ${e ? "hide" : ""}`, children: [
|
1740
|
-
/* @__PURE__ */ u.jsxs(
|
1741
|
-
"button",
|
1742
|
-
{
|
1743
|
-
className: "toggle",
|
1744
|
-
onClick: () => {
|
1745
|
-
const r = !n;
|
1746
|
-
t.onToggle !== void 0 && t.onToggle(r), a(r);
|
1747
|
-
},
|
1748
|
-
children: [
|
1749
|
-
/* @__PURE__ */ u.jsx(
|
1750
|
-
"p",
|
1751
|
-
{
|
1752
|
-
className: `status ${n ? "open" : ""}`,
|
1753
|
-
children: "Toggle"
|
1754
|
-
}
|
1755
|
-
),
|
1756
|
-
/* @__PURE__ */ u.jsx("p", { className: "label", children: dt(t.label) })
|
1757
|
-
]
|
1758
|
-
}
|
1759
|
-
),
|
1760
|
-
t.button,
|
1761
|
-
/* @__PURE__ */ u.jsx("div", { className: n ? "open" : "", children: /* @__PURE__ */ u.jsx("div", { children: t.children }) })
|
1762
|
-
] });
|
1763
|
-
}
|
1764
|
-
function $n(t) {
|
1765
|
-
const [n, a] = le(!1), e = t.child.children.length > 0, r = [];
|
1766
|
-
return t.child.children.length > 0 && t.child.children.map((s) => {
|
1767
|
-
r.push(/* @__PURE__ */ u.jsx($n, { child: s, three: t.three }, Math.random()));
|
1768
|
-
}), /* @__PURE__ */ u.jsxs("div", { className: "childObject", children: [
|
1769
|
-
/* @__PURE__ */ u.jsxs("div", { className: "child", children: [
|
1770
|
-
e ? /* @__PURE__ */ u.jsx(
|
1771
|
-
"button",
|
1772
|
-
{
|
1773
|
-
className: "status",
|
1774
|
-
style: {
|
1775
|
-
backgroundPositionX: n ? "-14px" : "2px"
|
1776
|
-
},
|
1777
|
-
onClick: () => {
|
1778
|
-
a(!n);
|
1779
|
-
}
|
1780
|
-
}
|
1781
|
-
) : null,
|
1782
|
-
/* @__PURE__ */ u.jsx(
|
1783
|
-
"button",
|
1784
|
-
{
|
1785
|
-
className: "name",
|
1786
|
-
style: {
|
1787
|
-
left: e ? "20px" : "5px"
|
1788
|
-
},
|
1789
|
-
onClick: () => {
|
1790
|
-
t.three.getObject(t.child.uuid), n || a(!0);
|
1791
|
-
},
|
1792
|
-
children: t.child.name.length > 0 ? `${t.child.name} (${t.child.type})` : `${t.child.type}::${t.child.uuid}`
|
1793
|
-
}
|
1794
|
-
),
|
1795
|
-
/* @__PURE__ */ u.jsx("div", { className: `icon ${Ya(t.child)}` })
|
1796
|
-
] }),
|
1797
|
-
/* @__PURE__ */ u.jsx("div", { className: n ? "open" : "", children: /* @__PURE__ */ u.jsx("div", { className: "container", children: r }) })
|
1798
|
-
] }, Math.random());
|
1799
|
-
}
|
1800
|
-
function fi(t) {
|
1801
|
-
const n = [];
|
1802
|
-
return t.child.children.map((a) => {
|
1803
|
-
n.push(/* @__PURE__ */ u.jsx($n, { child: a, three: t.three }, Math.random()));
|
1804
|
-
}), /* @__PURE__ */ u.jsx("div", { className: `scene ${t.class !== void 0 ? t.class : ""}`, children: n });
|
1805
|
-
}
|
1806
|
-
const hi = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA5klEQVRoge2Y0Q6EIAwE6cX//+X6cCFpSMEKVTdk501OpRNKiyelFC0b8Ps6gCwoggZF0KAIGhRBgyJoUAQNiqCxjciR9SLV//eZiAyvK3U8i/QVaQO2YyLSFVvlkdTKDjJCukh2ykR5ZEW+kHmlatl90RaBtDkK/w7CYhuRUEO0ee3l+J3m55Vm+17vtwjTnV1V3QA8qfbeUXCzRWDpiLLS+OyzvRW7IzW9R+okvclsqR09743bo0yUpc1+lSJvNsa002+Euk9GKzV7SmZDRIMiaFAEDYqgQRE0KIIGRdCgCBoUQeMEMERadX7YUz8AAAAASUVORK5CYII=";
|
1807
|
-
function pi(t) {
|
1808
|
-
return "items" in t;
|
1809
|
-
}
|
1810
|
-
function Ue(t) {
|
1811
|
-
const n = [];
|
1812
|
-
return t.items.forEach((a) => {
|
1813
|
-
pi(a) ? n.push(
|
1814
|
-
/* @__PURE__ */ u.jsx(Ue, { title: dt(a.title), items: a.items }, Math.random())
|
1815
|
-
) : n.push(
|
1816
|
-
/* @__PURE__ */ u.jsx(
|
1817
|
-
lt,
|
1818
|
-
{
|
1819
|
-
title: a.title,
|
1820
|
-
prop: a.prop,
|
1821
|
-
value: a.value,
|
1822
|
-
type: a.type,
|
1823
|
-
min: a.min,
|
1824
|
-
max: a.max,
|
1825
|
-
step: a.step,
|
1826
|
-
disabled: a.disabled,
|
1827
|
-
options: a.options,
|
1828
|
-
onChange: (e, r) => {
|
1829
|
-
a.onChange !== void 0 && a.onChange(e, r);
|
1830
|
-
}
|
1831
|
-
},
|
1832
|
-
Math.random()
|
1833
|
-
)
|
1834
|
-
);
|
1835
|
-
}), /* @__PURE__ */ u.jsx(qt, { label: t.title, open: t.expanded === !0, children: n });
|
1836
|
-
}
|
1837
|
-
function mi(t) {
|
1838
|
-
return !(t === "alphaHash" || t === "alphaToCoverage" || t === "attenuationDistance" || t === "blendDstAlpha" || t === "colorWrite" || t === "combine" || t === "defaultAttributeValues" || t === "depthFunc" || t === "forceSinglePass" || t === "glslVersion" || t === "linecap" || t === "linejoin" || t === "linewidth" || t === "normalMapType" || t === "precision" || t === "premultipliedAlpha" || t === "shadowSide" || t === "toneMapped" || t === "uniformsGroups" || t === "uniformsNeedUpdate" || t === "userData" || t === "vertexColors" || t === "version" || t === "wireframeLinecap" || t === "wireframeLinejoin" || t === "wireframeLinewidth" || t.slice(0, 4) === "clip" || t.slice(0, 7) === "polygon" || t.slice(0, 7) === "stencil" || t.slice(0, 2) === "is");
|
1839
|
-
}
|
1840
|
-
function Ie(t) {
|
1841
|
-
switch (t) {
|
1842
|
-
case "alphaMap":
|
1843
|
-
return "Alpha Map";
|
1844
|
-
case "anisotropyMap":
|
1845
|
-
return "Anisotropy Map";
|
1846
|
-
case "anisotropyRotation":
|
1847
|
-
return "Anisotropy Rotation";
|
1848
|
-
case "aoMap":
|
1849
|
-
return "AO Map";
|
1850
|
-
case "aoMapIntensity":
|
1851
|
-
return "AO Map Intensity";
|
1852
|
-
case "attenuationColor":
|
1853
|
-
return "Attenuation Color";
|
1854
|
-
case "blendAlpha":
|
1855
|
-
return "Blend Alpha";
|
1856
|
-
case "blendColor":
|
1857
|
-
return "Blend Color";
|
1858
|
-
case "blendDst":
|
1859
|
-
return "Blend Dst";
|
1860
|
-
case "blendDstAlpha":
|
1861
|
-
return "Blend Dst Alha";
|
1862
|
-
case "blendEquation":
|
1863
|
-
return "Blend Equation";
|
1864
|
-
case "blendEquationAlpha":
|
1865
|
-
return "Blend Equation Alpha";
|
1866
|
-
case "blending":
|
1867
|
-
return "Blending";
|
1868
|
-
case "blendSrc":
|
1869
|
-
return "Blend Src";
|
1870
|
-
case "blendSrcAlpha":
|
1871
|
-
return "Blend Src Alpha";
|
1872
|
-
case "bumpMap":
|
1873
|
-
return "Bump Map";
|
1874
|
-
case "bumpScale":
|
1875
|
-
return "Bump Scale";
|
1876
|
-
case "clearcoatMap":
|
1877
|
-
return "Clearcoat Map";
|
1878
|
-
case "clearcoatNormalMap":
|
1879
|
-
return "Clearcoat Normal Map";
|
1880
|
-
case "clearcoatNormalScale":
|
1881
|
-
return "Clearcoat Normal Scale";
|
1882
|
-
case "clearcoatRoughness":
|
1883
|
-
return "Clearcoat Roughness";
|
1884
|
-
case "clearcoatRoughnessMap":
|
1885
|
-
return "Clearcoat Roughness Map";
|
1886
|
-
case "color":
|
1887
|
-
return "Color";
|
1888
|
-
case "defines":
|
1889
|
-
return "Defines";
|
1890
|
-
case "depthTest":
|
1891
|
-
return "Depth Test";
|
1892
|
-
case "depthWrite":
|
1893
|
-
return "Depth Write";
|
1894
|
-
case "displacementBias":
|
1895
|
-
return "Displacement Bias";
|
1896
|
-
case "displacementMap":
|
1897
|
-
return "Displacement Map";
|
1898
|
-
case "displacementScale":
|
1899
|
-
return "Displacement Scale";
|
1900
|
-
case "dithering":
|
1901
|
-
return "Dithering";
|
1902
|
-
case "emissive":
|
1903
|
-
return "Emissive";
|
1904
|
-
case "emissiveMap":
|
1905
|
-
return "Emissive Map";
|
1906
|
-
case "emissiveIntensity":
|
1907
|
-
return "Emissive Intensity";
|
1908
|
-
case "envMap":
|
1909
|
-
return "Environment Map";
|
1910
|
-
case "envMapIntensity":
|
1911
|
-
return "Environment Map Intensity";
|
1912
|
-
case "extensions":
|
1913
|
-
return "Extensions";
|
1914
|
-
case "flatShading":
|
1915
|
-
return "Flat Shading";
|
1916
|
-
case "fragmentShader":
|
1917
|
-
return "Fragment Shader";
|
1918
|
-
case "fog":
|
1919
|
-
return "Fog";
|
1920
|
-
case "gradientMap":
|
1921
|
-
return "Gradient Map";
|
1922
|
-
case "ior":
|
1923
|
-
return "IOR";
|
1924
|
-
case "iridescenceIOR":
|
1925
|
-
return "Iridescence IOR";
|
1926
|
-
case "iridescenceMap":
|
1927
|
-
return "Iridescence Map";
|
1928
|
-
case "iridescenceThicknessMap":
|
1929
|
-
return "Iridescence Thickness Map";
|
1930
|
-
case "iridescenceThicknessRange":
|
1931
|
-
return "Iridescence Thickness Range";
|
1932
|
-
case "lights":
|
1933
|
-
return "Lights";
|
1934
|
-
case "lightMap":
|
1935
|
-
return "Light Map";
|
1936
|
-
case "lightMapIntensity":
|
1937
|
-
return "Light Map Intensity";
|
1938
|
-
case "map":
|
1939
|
-
return "Map";
|
1940
|
-
case "matcap":
|
1941
|
-
return "Matcap";
|
1942
|
-
case "metalness":
|
1943
|
-
return "Metalness";
|
1944
|
-
case "metalnessMap":
|
1945
|
-
return "Metalness Map";
|
1946
|
-
case "name":
|
1947
|
-
return "Name";
|
1948
|
-
case "normalMap":
|
1949
|
-
return "Normal Map";
|
1950
|
-
case "normalScale":
|
1951
|
-
return "Normal Scale";
|
1952
|
-
case "opacity":
|
1953
|
-
return "Opacity";
|
1954
|
-
case "reflectivity":
|
1955
|
-
return "Reflectivity";
|
1956
|
-
case "refractionRatio":
|
1957
|
-
return "Refraction Ratio";
|
1958
|
-
case "roughness":
|
1959
|
-
return "Roughness";
|
1960
|
-
case "roughnessMap":
|
1961
|
-
return "Roughness Map";
|
1962
|
-
case "sheenColor":
|
1963
|
-
return "Sheen Color";
|
1964
|
-
case "sheenColorMap":
|
1965
|
-
return "Sheen Color Map";
|
1966
|
-
case "sheenRoughness":
|
1967
|
-
return "Sheen Roughness";
|
1968
|
-
case "sheenRoughnessMap":
|
1969
|
-
return "Sheen Roughness Map";
|
1970
|
-
case "shininess":
|
1971
|
-
return "Shininess";
|
1972
|
-
case "side":
|
1973
|
-
return "Side";
|
1974
|
-
case "size":
|
1975
|
-
return "Size";
|
1976
|
-
case "sizeAttenuation":
|
1977
|
-
return "Size Attenuation";
|
1978
|
-
case "specular":
|
1979
|
-
return "Specular";
|
1980
|
-
case "specularColor":
|
1981
|
-
return "Specular Color";
|
1982
|
-
case "specularColorMap":
|
1983
|
-
return "Specular Color Map";
|
1984
|
-
case "specularIntensity":
|
1985
|
-
return "Specular Intensity";
|
1986
|
-
case "specularIntensityMap":
|
1987
|
-
return "Specular Map Intensity";
|
1988
|
-
case "thickness":
|
1989
|
-
return "Thickness";
|
1990
|
-
case "thicknessMap":
|
1991
|
-
return "Thickness Map";
|
1992
|
-
case "transmission":
|
1993
|
-
return "Transmission";
|
1994
|
-
case "transmissionMap":
|
1995
|
-
return "Transmission Map";
|
1996
|
-
case "transparent":
|
1997
|
-
return "Transparent";
|
1998
|
-
case "type":
|
1999
|
-
return "Type";
|
2000
|
-
case "uuid":
|
2001
|
-
return "UUID";
|
2002
|
-
case "uniforms":
|
2003
|
-
return "Uniforms";
|
2004
|
-
case "vertexShader":
|
2005
|
-
return "Vertex Shader";
|
2006
|
-
case "visible":
|
2007
|
-
return "Visible";
|
2008
|
-
case "wireframe":
|
2009
|
-
return "Wireframe";
|
2010
|
-
}
|
2011
|
-
return t;
|
2012
|
-
}
|
2013
|
-
function vi(t) {
|
2014
|
-
return t.toLowerCase().search("intensity") > -1 || t === "anisotropyRotation" || t === "blendAlpha" || t === "bumpScale" || t === "clearcoatRoughness" || t === "displacementBias" || t === "displacementScale" || t === "metalness" || t === "opacity" || t === "reflectivity" || t === "refractionRatio" || t === "roughness" || t === "sheenRoughness" || t === "thickness";
|
2015
|
-
}
|
2016
|
-
function gi() {
|
2017
|
-
const t = document.createElement("input");
|
2018
|
-
return t.type = "file", new Promise((n, a) => {
|
2019
|
-
t.addEventListener("change", function() {
|
2020
|
-
if (t.files === null)
|
2021
|
-
a();
|
2022
|
-
else {
|
2023
|
-
const e = t.files[0], r = new FileReader();
|
2024
|
-
r.onload = function(s) {
|
2025
|
-
n(s.target.result);
|
2026
|
-
}, r.readAsDataURL(e);
|
2027
|
-
}
|
2028
|
-
}), t.click();
|
2029
|
-
});
|
2030
|
-
}
|
2031
|
-
const bi = [
|
2032
|
-
{
|
2033
|
-
title: "Front",
|
2034
|
-
value: ta
|
2035
|
-
},
|
2036
|
-
{
|
2037
|
-
title: "Back",
|
2038
|
-
value: na
|
2039
|
-
},
|
2040
|
-
{
|
2041
|
-
title: "Double",
|
2042
|
-
value: mn
|
2043
|
-
}
|
2044
|
-
], yi = [
|
2045
|
-
{
|
2046
|
-
title: "No Blending",
|
2047
|
-
value: aa
|
2048
|
-
},
|
2049
|
-
{
|
2050
|
-
title: "Normal",
|
2051
|
-
value: ia
|
2052
|
-
},
|
2053
|
-
{
|
2054
|
-
title: "Additive",
|
2055
|
-
value: ra
|
2056
|
-
},
|
2057
|
-
{
|
2058
|
-
title: "Subtractive",
|
2059
|
-
value: oa
|
2060
|
-
},
|
2061
|
-
{
|
2062
|
-
title: "Multiply",
|
2063
|
-
value: sa
|
2064
|
-
},
|
2065
|
-
{
|
2066
|
-
title: "Custom",
|
2067
|
-
value: ca
|
2068
|
-
}
|
2069
|
-
], Ei = [
|
2070
|
-
{
|
2071
|
-
title: "Add",
|
2072
|
-
value: la
|
2073
|
-
},
|
2074
|
-
{
|
2075
|
-
title: "Subtract",
|
2076
|
-
value: ua
|
2077
|
-
},
|
2078
|
-
{
|
2079
|
-
title: "Reverse Subtract",
|
2080
|
-
value: da
|
2081
|
-
},
|
2082
|
-
{
|
2083
|
-
title: "Min",
|
2084
|
-
value: fa
|
2085
|
-
},
|
2086
|
-
{
|
2087
|
-
title: "Max",
|
2088
|
-
value: ha
|
2089
|
-
}
|
2090
|
-
], Ci = [
|
2091
|
-
{
|
2092
|
-
title: "Zero",
|
2093
|
-
valye: vn
|
2094
|
-
},
|
2095
|
-
{
|
2096
|
-
title: "One",
|
2097
|
-
valye: gn
|
2098
|
-
},
|
2099
|
-
{
|
2100
|
-
title: "Src Color",
|
2101
|
-
valye: bn
|
2102
|
-
},
|
2103
|
-
{
|
2104
|
-
title: "One Minus Src Color",
|
2105
|
-
valye: yn
|
2106
|
-
},
|
2107
|
-
{
|
2108
|
-
title: "Src Alpha",
|
2109
|
-
valye: En
|
2110
|
-
},
|
2111
|
-
{
|
2112
|
-
title: "One Minus Src Alpha",
|
2113
|
-
valye: Cn
|
2114
|
-
},
|
2115
|
-
{
|
2116
|
-
title: "Dst Alpha",
|
2117
|
-
valye: xn
|
2118
|
-
},
|
2119
|
-
{
|
2120
|
-
title: "One Minus Dst Alpha",
|
2121
|
-
valye: Sn
|
2122
|
-
},
|
2123
|
-
{
|
2124
|
-
title: "Dst Color",
|
2125
|
-
valye: wn
|
2126
|
-
},
|
2127
|
-
{
|
2128
|
-
title: "One Minus Dst Color",
|
2129
|
-
valye: On
|
2130
|
-
},
|
2131
|
-
{
|
2132
|
-
title: "Src Alpha Saturate",
|
2133
|
-
valye: pa
|
2134
|
-
},
|
2135
|
-
{
|
2136
|
-
title: "Constant Color",
|
2137
|
-
valye: Mn
|
2138
|
-
},
|
2139
|
-
{
|
2140
|
-
title: "One Minus Constant Color",
|
2141
|
-
valye: Tn
|
2142
|
-
},
|
2143
|
-
{
|
2144
|
-
title: "Constant Alpha",
|
2145
|
-
valye: Rn
|
2146
|
-
},
|
2147
|
-
{
|
2148
|
-
title: "One Minus Constant Alpha",
|
2149
|
-
valye: Pn
|
2150
|
-
}
|
2151
|
-
], xi = [
|
2152
|
-
{
|
2153
|
-
title: "Zero",
|
2154
|
-
valye: vn
|
2155
|
-
},
|
2156
|
-
{
|
2157
|
-
title: "One",
|
2158
|
-
valye: gn
|
2159
|
-
},
|
2160
|
-
{
|
2161
|
-
title: "Src Color",
|
2162
|
-
valye: bn
|
2163
|
-
},
|
2164
|
-
{
|
2165
|
-
title: "One Minus Src Color",
|
2166
|
-
valye: yn
|
2167
|
-
},
|
2168
|
-
{
|
2169
|
-
title: "Src Alpha",
|
2170
|
-
valye: En
|
2171
|
-
},
|
2172
|
-
{
|
2173
|
-
title: "One Minus Src Alpha",
|
2174
|
-
valye: Cn
|
2175
|
-
},
|
2176
|
-
{
|
2177
|
-
title: "Dst Alpha",
|
2178
|
-
valye: xn
|
2179
|
-
},
|
2180
|
-
{
|
2181
|
-
title: "One Minus Dst Alpha",
|
2182
|
-
valye: Sn
|
2183
|
-
},
|
2184
|
-
{
|
2185
|
-
title: "Dst Color",
|
2186
|
-
valye: wn
|
2187
|
-
},
|
2188
|
-
{
|
2189
|
-
title: "One Minus Dst Color",
|
2190
|
-
valye: On
|
2191
|
-
},
|
2192
|
-
{
|
2193
|
-
title: "Constant Color",
|
2194
|
-
valye: Mn
|
2195
|
-
},
|
2196
|
-
{
|
2197
|
-
title: "One Minus Constant Color",
|
2198
|
-
valye: Tn
|
2199
|
-
},
|
2200
|
-
{
|
2201
|
-
title: "Constant Alpha",
|
2202
|
-
valye: Rn
|
2203
|
-
},
|
2204
|
-
{
|
2205
|
-
title: "One Minus Constant Alpha",
|
2206
|
-
valye: Pn
|
2207
|
-
}
|
2208
|
-
];
|
2209
|
-
function ct(t, n) {
|
2210
|
-
t.needsUpdate = !0, t.type = "option", t.options = n;
|
2211
|
-
}
|
2212
|
-
function nn(t, n, a) {
|
2213
|
-
const e = [];
|
2214
|
-
for (const r in t) {
|
2215
|
-
if (!mi(r))
|
2216
|
-
continue;
|
2217
|
-
const s = typeof t[r], h = t[r];
|
2218
|
-
if (s === "boolean" || s === "number" || s === "string") {
|
2219
|
-
const c = {
|
2220
|
-
title: Ie(r),
|
2221
|
-
prop: r,
|
2222
|
-
type: s,
|
2223
|
-
value: h,
|
2224
|
-
min: void 0,
|
2225
|
-
max: void 0,
|
2226
|
-
needsUpdate: s === "boolean",
|
2227
|
-
onChange: (d, b) => {
|
2228
|
-
var E;
|
2229
|
-
a.updateObject(n.uuid, `material.${d}`, b), c.needsUpdate && a.updateObject(n.uuid, "material.needsUpdate", !0);
|
2230
|
-
const m = (E = a.scene) == null ? void 0 : E.getObjectByProperty("uuid", n.uuid);
|
2231
|
-
m !== void 0 && ne(m, `material.${d}`, b);
|
2232
|
-
}
|
2233
|
-
};
|
2234
|
-
switch (r) {
|
2235
|
-
case "blending":
|
2236
|
-
ct(c, yi);
|
2237
|
-
break;
|
2238
|
-
case "blendDst":
|
2239
|
-
ct(c, xi);
|
2240
|
-
break;
|
2241
|
-
case "blendEquation":
|
2242
|
-
ct(c, Ei);
|
2243
|
-
break;
|
2244
|
-
case "blendSrc":
|
2245
|
-
ct(c, Ci);
|
2246
|
-
break;
|
2247
|
-
case "side":
|
2248
|
-
ct(c, bi);
|
2249
|
-
break;
|
2250
|
-
}
|
2251
|
-
vi(r) && (c.value = Number(h), c.type = "range", c.min = 0, c.max = 1, c.step = 0.01);
|
2252
|
-
const l = s === "string" && (r === "vertexShader" || r === "fragmentShader");
|
2253
|
-
l && (c.disabled = !1, c.latest = c.value, c.onChange = (d, b) => {
|
2254
|
-
c.latest = b;
|
2255
|
-
}), e.push(c), l && e.push({
|
2256
|
-
title: `${dt(r)} - Update`,
|
2257
|
-
type: "button",
|
2258
|
-
onChange: () => {
|
2259
|
-
var b;
|
2260
|
-
a.updateObject(n.uuid, `material.${r}`, c.latest), a.updateObject(n.uuid, "material.needsUpdate", !0);
|
2261
|
-
const d = (b = a.scene) == null ? void 0 : b.getObjectByProperty("uuid", n.uuid);
|
2262
|
-
d !== void 0 && (ne(d, `material.${r}`, c.latest), d.material.needsUpdate = !0);
|
2263
|
-
}
|
2264
|
-
});
|
2265
|
-
} else if (s === "object")
|
2266
|
-
if (h.isColor)
|
2267
|
-
e.push({
|
2268
|
-
title: Ie(r),
|
2269
|
-
prop: r,
|
2270
|
-
type: "color",
|
2271
|
-
value: h,
|
2272
|
-
onChange: (c, l) => {
|
2273
|
-
var m;
|
2274
|
-
const d = new Pt(l);
|
2275
|
-
a.updateObject(n.uuid, `material.${c}`, d);
|
2276
|
-
const b = (m = a.scene) == null ? void 0 : m.getObjectByProperty("uuid", n.uuid);
|
2277
|
-
b !== void 0 && ne(b, `material.${c}`, d);
|
2278
|
-
}
|
2279
|
-
});
|
2280
|
-
else if (Array.isArray(h)) {
|
2281
|
-
const c = [];
|
2282
|
-
for (const l in h)
|
2283
|
-
c.push({
|
2284
|
-
title: `${l}`,
|
2285
|
-
type: `${typeof h[l]}`,
|
2286
|
-
value: h[l],
|
2287
|
-
onChange: (d, b) => {
|
2288
|
-
var E;
|
2289
|
-
a.updateObject(n.uuid, `material.${r}`, b);
|
2290
|
-
const m = (E = a.scene) == null ? void 0 : E.getObjectByProperty("uuid", n.uuid);
|
2291
|
-
m !== void 0 && ne(m, `material.${r}`, b);
|
2292
|
-
}
|
2293
|
-
});
|
2294
|
-
e.push({
|
2295
|
-
title: Ie(r),
|
2296
|
-
items: c
|
2297
|
-
});
|
2298
|
-
} else {
|
2299
|
-
const c = [];
|
2300
|
-
for (const l in h) {
|
2301
|
-
const d = h[l];
|
2302
|
-
switch (typeof d) {
|
2303
|
-
case "boolean":
|
2304
|
-
case "number":
|
2305
|
-
case "string":
|
2306
|
-
l === "src" ? e.push({
|
2307
|
-
title: Ie(r),
|
2308
|
-
type: "image",
|
2309
|
-
value: d,
|
2310
|
-
onChange: (m, E) => {
|
2311
|
-
var x;
|
2312
|
-
a.createTexture(n.uuid, `material.${r}`, E);
|
2313
|
-
const S = (x = a.scene) == null ? void 0 : x.getObjectByProperty("uuid", n.uuid);
|
2314
|
-
S !== void 0 && Ht(E).then((T) => {
|
2315
|
-
ne(S, `material.${r}`, T), ne(S, "material.needsUpdate", !0);
|
2316
|
-
});
|
2317
|
-
}
|
2318
|
-
}) : c.push({
|
2319
|
-
title: `${Ie(l)}`,
|
2320
|
-
prop: `material.${r}.${l}`,
|
2321
|
-
type: `${typeof t[r][l]}`,
|
2322
|
-
value: h[l],
|
2323
|
-
onChange: (m, E) => {
|
2324
|
-
var x;
|
2325
|
-
a.updateObject(n.uuid, `material.${r}.${l}`, E);
|
2326
|
-
const S = (x = a.scene) == null ? void 0 : x.getObjectByProperty("uuid", n.uuid);
|
2327
|
-
S !== void 0 && ne(S, `material.${r}.${l}`, E);
|
2328
|
-
}
|
2329
|
-
});
|
2330
|
-
break;
|
2331
|
-
case "object":
|
2332
|
-
if (d.value !== void 0 && d.value.src !== void 0)
|
2333
|
-
c.push({
|
2334
|
-
title: Ie(l),
|
2335
|
-
type: "image",
|
2336
|
-
value: d.value.src,
|
2337
|
-
onChange: (m, E) => {
|
2338
|
-
var x;
|
2339
|
-
a.createTexture(n.uuid, `material.${r}.${l}.value`, h);
|
2340
|
-
const S = (x = a.scene) == null ? void 0 : x.getObjectByProperty("uuid", n.uuid);
|
2341
|
-
S !== void 0 && Ht(E).then((T) => {
|
2342
|
-
ne(S, `material.${r}.${l}.value`, T);
|
2343
|
-
});
|
2344
|
-
}
|
2345
|
-
});
|
2346
|
-
else if (r === "uniforms") {
|
2347
|
-
const m = d.value, E = (S, x, T) => ({
|
2348
|
-
title: S,
|
2349
|
-
type: "number",
|
2350
|
-
value: T,
|
2351
|
-
step: 0.01,
|
2352
|
-
onChange: (W, I) => {
|
2353
|
-
var he;
|
2354
|
-
const w = `material.uniforms.${l}.value.${x}`;
|
2355
|
-
a.updateObject(n.uuid, w, I);
|
2356
|
-
const G = (he = a.scene) == null ? void 0 : he.getObjectByProperty("uuid", n.uuid);
|
2357
|
-
G !== void 0 && ne(G, w, I);
|
2358
|
-
}
|
2359
|
-
});
|
2360
|
-
if (typeof d.value == "number")
|
2361
|
-
c.push({
|
2362
|
-
title: l,
|
2363
|
-
type: "number",
|
2364
|
-
value: d.value,
|
2365
|
-
onChange: (S, x) => {
|
2366
|
-
var I;
|
2367
|
-
const T = `material.${r}.${S}.value`;
|
2368
|
-
a.updateObject(n.uuid, T, x);
|
2369
|
-
const W = (I = a.scene) == null ? void 0 : I.getObjectByProperty("uuid", n.uuid);
|
2370
|
-
W !== void 0 && ne(W, T, x);
|
2371
|
-
}
|
2372
|
-
});
|
2373
|
-
else if (m.r !== void 0 && m.g !== void 0 && m.b !== void 0)
|
2374
|
-
c.push({
|
2375
|
-
title: l,
|
2376
|
-
type: "color",
|
2377
|
-
value: d.value,
|
2378
|
-
onChange: (S, x) => {
|
2379
|
-
var w;
|
2380
|
-
const T = new Pt(x), W = `material.${r}.${S}.value`;
|
2381
|
-
a.updateObject(n.uuid, W, T);
|
2382
|
-
const I = (w = a.scene) == null ? void 0 : w.getObjectByProperty("uuid", n.uuid);
|
2383
|
-
I !== void 0 && ne(I, W, T);
|
2384
|
-
}
|
2385
|
-
});
|
2386
|
-
else if (m.x !== void 0 && m.y !== void 0 && m.z === void 0 && m.w === void 0)
|
2387
|
-
c.push(
|
2388
|
-
{
|
2389
|
-
title: l,
|
2390
|
-
items: [
|
2391
|
-
E("X", "x", d.value.x),
|
2392
|
-
E("Y", "y", d.value.y)
|
2393
|
-
]
|
2394
|
-
}
|
2395
|
-
);
|
2396
|
-
else if (m.x !== void 0 && m.y !== void 0 && m.z !== void 0 && m.w === void 0)
|
2397
|
-
c.push(
|
2398
|
-
{
|
2399
|
-
title: l,
|
2400
|
-
items: [
|
2401
|
-
E("X", "x", d.value.x),
|
2402
|
-
E("Y", "y", d.value.y),
|
2403
|
-
E("Z", "z", d.value.z)
|
2404
|
-
]
|
2405
|
-
}
|
2406
|
-
);
|
2407
|
-
else if (m.x !== void 0 && m.y !== void 0 && m.z !== void 0 && m.w !== void 0)
|
2408
|
-
c.push(
|
2409
|
-
{
|
2410
|
-
title: l,
|
2411
|
-
items: [
|
2412
|
-
E("X", "x", d.value.x),
|
2413
|
-
E("Y", "y", d.value.y),
|
2414
|
-
E("Z", "z", d.value.z),
|
2415
|
-
E("W", "w", d.value.w)
|
2416
|
-
]
|
2417
|
-
}
|
2418
|
-
);
|
2419
|
-
else if (m.elements !== void 0) {
|
2420
|
-
const S = m.elements, x = [];
|
2421
|
-
for (let T = 0; T < S.length; T++)
|
2422
|
-
x.push(E(T.toString(), T.toString(), S[T]));
|
2423
|
-
c.push(
|
2424
|
-
{
|
2425
|
-
title: l,
|
2426
|
-
items: x
|
2427
|
-
}
|
2428
|
-
);
|
2429
|
-
} else
|
2430
|
-
console.log(">>> need to add this format:", l, m);
|
2431
|
-
} else
|
2432
|
-
c.push({
|
2433
|
-
title: l,
|
2434
|
-
type: `${typeof d.value}`,
|
2435
|
-
value: d.value,
|
2436
|
-
onChange: (m, E) => {
|
2437
|
-
var x;
|
2438
|
-
a.updateObject(n.uuid, `material.${r}.${l}.value`, E);
|
2439
|
-
const S = (x = a.scene) == null ? void 0 : x.getObjectByProperty("uuid", n.uuid);
|
2440
|
-
S !== void 0 && ne(S, `material.${r}.${l}.value`, E);
|
2441
|
-
}
|
2442
|
-
});
|
2443
|
-
break;
|
2444
|
-
}
|
2445
|
-
}
|
2446
|
-
c.length > 0 && e.push({
|
2447
|
-
title: Ie(r),
|
2448
|
-
items: c
|
2449
|
-
});
|
2450
|
-
}
|
2451
|
-
else
|
2452
|
-
h !== void 0 && console.log("other:", r, s, h);
|
2453
|
-
}
|
2454
|
-
return e.sort((r, s) => r.title < s.title ? -1 : r.title > s.title ? 1 : 0), e.push({
|
2455
|
-
title: "Update Material",
|
2456
|
-
type: "button",
|
2457
|
-
onChange: () => {
|
2458
|
-
a.updateObject(n.uuid, "material.needsUpdate", !0);
|
2459
|
-
}
|
2460
|
-
}), e;
|
2461
|
-
}
|
2462
|
-
function Si(t, n) {
|
2463
|
-
const a = t.material;
|
2464
|
-
if (Array.isArray(a)) {
|
2465
|
-
const e = [], r = a.length;
|
2466
|
-
for (let s = 0; s < r; s++)
|
2467
|
-
e.push(
|
2468
|
-
/* @__PURE__ */ u.jsx(
|
2469
|
-
Ue,
|
2470
|
-
{
|
2471
|
-
title: `Material ${s}`,
|
2472
|
-
items: nn(a[s], t, n)
|
2473
|
-
},
|
2474
|
-
`Material ${s}`
|
2475
|
-
)
|
2476
|
-
);
|
2477
|
-
return /* @__PURE__ */ u.jsx(u.Fragment, { children: e });
|
2478
|
-
} else
|
2479
|
-
return /* @__PURE__ */ u.jsx(
|
2480
|
-
Ue,
|
2481
|
-
{
|
2482
|
-
title: "Material",
|
2483
|
-
items: nn(a, t, n)
|
2484
|
-
}
|
2485
|
-
);
|
2486
|
-
}
|
2487
|
-
function lt(t) {
|
2488
|
-
var b;
|
2489
|
-
let n = t.value;
|
2490
|
-
n !== void 0 && n.isColor !== void 0 && (n = Ia(t.value));
|
2491
|
-
const [a, e] = le(n), r = Ce(null), s = Ce(null), h = Ce(null);
|
2492
|
-
Be(() => {
|
2493
|
-
var he;
|
2494
|
-
let m = !1, E = -1, S = 0, x = Number(a);
|
2495
|
-
const T = (te) => {
|
2496
|
-
m = !0, S = x, E = te.clientX;
|
2497
|
-
}, W = (te) => {
|
2498
|
-
if (!m)
|
2499
|
-
return;
|
2500
|
-
const ae = t.step !== void 0 ? t.step : 1, f = (te.clientX - E) * ae;
|
2501
|
-
x = Number((S + f).toFixed(4)), s.current !== null && (s.current.value = x.toString()), t.onChange !== void 0 && t.onChange(t.prop !== void 0 ? t.prop : t.title, x);
|
2502
|
-
}, I = () => {
|
2503
|
-
m = !1;
|
2504
|
-
}, w = () => {
|
2505
|
-
m = !1;
|
2506
|
-
}, G = t.type === "number";
|
2507
|
-
return G && ((he = r.current) == null || he.addEventListener("mousedown", T, !1), document.addEventListener("mouseup", I, !1), document.addEventListener("mousemove", W, !1), document.addEventListener("contextmenu", w, !1)), () => {
|
2508
|
-
var te;
|
2509
|
-
G && ((te = r.current) == null || te.removeEventListener("mousedown", T), document.removeEventListener("mouseup", I), document.removeEventListener("mousemove", W), document.removeEventListener("contextmenu", w));
|
2510
|
-
};
|
2511
|
-
}, [a]);
|
2512
|
-
const c = t.type === "string" && (a.length > 100 || a.search(`
|
2513
|
-
`) > -1), l = c || t.type === "image", d = (m) => {
|
2514
|
-
let E = m.target.value;
|
2515
|
-
t.type === "boolean" ? E = m.target.checked : t.type === "option" && (E = t.options[E].value), e(E), t.onChange !== void 0 && t.onChange(t.prop !== void 0 ? t.prop : t.title, E);
|
2516
|
-
};
|
2517
|
-
return /* @__PURE__ */ u.jsxs("div", { className: `field ${l ? "block" : ""}`, children: [
|
2518
|
-
t.type !== "button" && /* @__PURE__ */ u.jsx("label", { ref: r, children: dt(t.title) }, "fieldLabel"),
|
2519
|
-
t.type === "string" && !c && /* @__PURE__ */ u.jsx(
|
2520
|
-
"input",
|
2521
|
-
{
|
2522
|
-
type: "text",
|
2523
|
-
disabled: t.disabled,
|
2524
|
-
onChange: d,
|
2525
|
-
value: a
|
2526
|
-
}
|
2527
|
-
),
|
2528
|
-
t.type === "string" && c && /* @__PURE__ */ u.jsx(
|
2529
|
-
"textarea",
|
2530
|
-
{
|
2531
|
-
cols: 50,
|
2532
|
-
rows: 10,
|
2533
|
-
disabled: t.disabled !== void 0 ? t.disabled : !0,
|
2534
|
-
onChange: d,
|
2535
|
-
value: a
|
2536
|
-
}
|
2537
|
-
),
|
2538
|
-
t.type === "boolean" && /* @__PURE__ */ u.jsx(
|
2539
|
-
"input",
|
2540
|
-
{
|
2541
|
-
type: "checkbox",
|
2542
|
-
disabled: t.disabled,
|
2543
|
-
onChange: d,
|
2544
|
-
checked: a
|
2545
|
-
}
|
2546
|
-
),
|
2547
|
-
t.type === "number" && /* @__PURE__ */ u.jsx(
|
2548
|
-
"input",
|
2549
|
-
{
|
2550
|
-
ref: s,
|
2551
|
-
type: "number",
|
2552
|
-
value: a,
|
2553
|
-
min: t.min,
|
2554
|
-
max: t.max,
|
2555
|
-
step: t.step,
|
2556
|
-
disabled: t.disabled,
|
2557
|
-
onChange: d
|
2558
|
-
}
|
2559
|
-
),
|
2560
|
-
t.type === "range" && /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
|
2561
|
-
/* @__PURE__ */ u.jsx("input", { type: "text", value: a.toString(), onChange: d, disabled: t.disabled, className: "min" }),
|
2562
|
-
/* @__PURE__ */ u.jsx(
|
2563
|
-
"input",
|
2564
|
-
{
|
2565
|
-
disabled: t.disabled,
|
2566
|
-
type: "range",
|
2567
|
-
value: a,
|
2568
|
-
min: t.min,
|
2569
|
-
max: t.max,
|
2570
|
-
step: t.step,
|
2571
|
-
onChange: d
|
2572
|
-
}
|
2573
|
-
)
|
2574
|
-
] }),
|
2575
|
-
t.type === "color" && /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
|
2576
|
-
/* @__PURE__ */ u.jsx("input", { type: "text", value: a.toString(), onChange: d, disabled: t.disabled, className: "color" }),
|
2577
|
-
/* @__PURE__ */ u.jsx("input", { type: "color", value: a, onChange: d, disabled: t.disabled })
|
2578
|
-
] }),
|
2579
|
-
t.type === "button" && /* @__PURE__ */ u.jsx(
|
2580
|
-
"button",
|
2581
|
-
{
|
2582
|
-
disabled: t.disabled,
|
2583
|
-
onClick: () => {
|
2584
|
-
t.onChange !== void 0 && t.onChange(t.prop !== void 0 ? t.prop : t.title, !0);
|
2585
|
-
},
|
2586
|
-
children: t.title
|
2587
|
-
}
|
2588
|
-
),
|
2589
|
-
t.type === "image" && /* @__PURE__ */ u.jsx("img", { ref: h, onClick: () => {
|
2590
|
-
gi().then((m) => {
|
2591
|
-
h.current.src = m, t.onChange !== void 0 && t.onChange(t.prop !== void 0 ? t.prop : t.title, m);
|
2592
|
-
});
|
2593
|
-
}, src: a.length > 0 ? a : hi }),
|
2594
|
-
t.type === "option" && /* @__PURE__ */ u.jsx(u.Fragment, { children: /* @__PURE__ */ u.jsx("select", { onChange: d, disabled: t.disabled, defaultValue: t.value, children: (b = t.options) == null ? void 0 : b.map((m, E) => /* @__PURE__ */ u.jsx("option", { value: m.value, children: dt(m.title) }, E)) }) })
|
2595
|
-
] });
|
2596
|
-
}
|
2597
|
-
function an(t) {
|
2598
|
-
switch (t) {
|
2599
|
-
case "fov":
|
2600
|
-
return "FOV";
|
2601
|
-
case "zoom":
|
2602
|
-
return "Zoom";
|
2603
|
-
case "near":
|
2604
|
-
return "Near";
|
2605
|
-
case "far":
|
2606
|
-
return "Far";
|
2607
|
-
case "focus":
|
2608
|
-
return "Focus";
|
2609
|
-
case "aspect":
|
2610
|
-
return "Aspect";
|
2611
|
-
case "filmGauge":
|
2612
|
-
return "Film Gauge";
|
2613
|
-
case "filmOffset":
|
2614
|
-
return "Film Offset";
|
2615
|
-
case "left":
|
2616
|
-
return "Left";
|
2617
|
-
case "right":
|
2618
|
-
return "Right";
|
2619
|
-
case "top":
|
2620
|
-
return "Top";
|
2621
|
-
case "bottom":
|
2622
|
-
return "Bottom";
|
2623
|
-
}
|
2624
|
-
return t;
|
2625
|
-
}
|
2626
|
-
function wi(t, n) {
|
2627
|
-
const a = [];
|
2628
|
-
if (t.perspectiveCameraInfo !== void 0)
|
2629
|
-
for (const e in t.perspectiveCameraInfo)
|
2630
|
-
a.push({
|
2631
|
-
title: an(e),
|
2632
|
-
prop: e,
|
2633
|
-
type: "number",
|
2634
|
-
step: 0.01,
|
2635
|
-
value: t.perspectiveCameraInfo[e],
|
2636
|
-
onChange: (r, s) => {
|
2637
|
-
var c;
|
2638
|
-
n.updateObject(t.uuid, r, s), n.requestMethod(t.uuid, "updateProjectionMatrix");
|
2639
|
-
const h = (c = n.scene) == null ? void 0 : c.getObjectByProperty("uuid", t.uuid);
|
2640
|
-
h !== void 0 && (ne(h, r, s), h.updateProjectionMatrix());
|
2641
|
-
}
|
2642
|
-
});
|
2643
|
-
else if (t.orthographicCameraInfo !== void 0)
|
2644
|
-
for (const e in t.orthographicCameraInfo)
|
2645
|
-
a.push({
|
2646
|
-
title: an(e),
|
2647
|
-
prop: e,
|
2648
|
-
type: "number",
|
2649
|
-
step: 0.01,
|
2650
|
-
value: t.perspectiveCameraInfo[e],
|
2651
|
-
onChange: (r, s) => {
|
2652
|
-
var c;
|
2653
|
-
n.updateObject(t.uuid, r, s), n.requestMethod(t.uuid, "updateProjectionMatrix");
|
2654
|
-
const h = (c = n.scene) == null ? void 0 : c.getObjectByProperty("uuid", t.uuid);
|
2655
|
-
h !== void 0 && (ne(h, r, s), h.updateProjectionMatrix());
|
2656
|
-
}
|
2657
|
-
});
|
2658
|
-
return /* @__PURE__ */ u.jsx(
|
2659
|
-
Ue,
|
2660
|
-
{
|
2661
|
-
title: "Camera",
|
2662
|
-
items: a
|
2663
|
-
}
|
2664
|
-
);
|
2665
|
-
}
|
2666
|
-
const Oi = Math.PI / 180, Mi = 180 / Math.PI;
|
2667
|
-
function Ke(t, n, a, e, r) {
|
2668
|
-
return e + (t - n) * (r - e) / (a - n);
|
2669
|
-
}
|
2670
|
-
function Ti(t) {
|
2671
|
-
return t * Oi;
|
2672
|
-
}
|
2673
|
-
function zt(t) {
|
2674
|
-
return t * Mi;
|
2675
|
-
}
|
2676
|
-
function Ri(t, n) {
|
2677
|
-
const a = new ma();
|
2678
|
-
a.elements = t.matrix;
|
2679
|
-
const e = new Z(), r = new va(), s = new Z();
|
2680
|
-
t.uuid.length > 0 && (e.setFromMatrixPosition(a), r.setFromRotationMatrix(a), s.setFromMatrixScale(a));
|
2681
|
-
const h = (l, d) => {
|
2682
|
-
var m;
|
2683
|
-
n.updateObject(t.uuid, l, d);
|
2684
|
-
const b = (m = n.scene) == null ? void 0 : m.getObjectByProperty("uuid", t.uuid);
|
2685
|
-
b !== void 0 && ne(b, l, d);
|
2686
|
-
}, c = (l, d) => {
|
2687
|
-
h(l, Ti(d));
|
2688
|
-
};
|
2689
|
-
return /* @__PURE__ */ u.jsx(
|
2690
|
-
Ue,
|
2691
|
-
{
|
2692
|
-
title: "Transform",
|
2693
|
-
items: [
|
2694
|
-
{
|
2695
|
-
title: "Position X",
|
2696
|
-
prop: "position.x",
|
2697
|
-
type: "number",
|
2698
|
-
value: e.x,
|
2699
|
-
onChange: h
|
2700
|
-
},
|
2701
|
-
{
|
2702
|
-
title: "Position Y",
|
2703
|
-
prop: "position.y",
|
2704
|
-
type: "number",
|
2705
|
-
value: e.y,
|
2706
|
-
onChange: h
|
2707
|
-
},
|
2708
|
-
{
|
2709
|
-
title: "Position Z",
|
2710
|
-
prop: "position.z",
|
2711
|
-
type: "number",
|
2712
|
-
value: e.z,
|
2713
|
-
onChange: h
|
2714
|
-
},
|
2715
|
-
{
|
2716
|
-
title: "Rotation X",
|
2717
|
-
prop: "rotation.x",
|
2718
|
-
type: "number",
|
2719
|
-
value: Ut(zt(r.x)),
|
2720
|
-
min: -360,
|
2721
|
-
max: 360,
|
2722
|
-
step: 0.1,
|
2723
|
-
onChange: c
|
2724
|
-
},
|
2725
|
-
{
|
2726
|
-
title: "Rotation Y",
|
2727
|
-
prop: "rotation.y",
|
2728
|
-
type: "number",
|
2729
|
-
value: Ut(zt(r.y)),
|
2730
|
-
min: -360,
|
2731
|
-
max: 360,
|
2732
|
-
step: 0.1,
|
2733
|
-
onChange: c
|
2734
|
-
},
|
2735
|
-
{
|
2736
|
-
title: "Rotation Z",
|
2737
|
-
prop: "rotation.z",
|
2738
|
-
type: "number",
|
2739
|
-
value: Ut(zt(r.z)),
|
2740
|
-
min: -360,
|
2741
|
-
max: 360,
|
2742
|
-
step: 0.1,
|
2743
|
-
onChange: c
|
2744
|
-
},
|
2745
|
-
{
|
2746
|
-
title: "Scale X",
|
2747
|
-
prop: "scale.x",
|
2748
|
-
type: "number",
|
2749
|
-
value: s.x,
|
2750
|
-
step: 0.01,
|
2751
|
-
onChange: h
|
2752
|
-
},
|
2753
|
-
{
|
2754
|
-
title: "Scale Y",
|
2755
|
-
prop: "scale.y",
|
2756
|
-
type: "number",
|
2757
|
-
value: s.y,
|
2758
|
-
step: 0.01,
|
2759
|
-
onChange: h
|
2760
|
-
},
|
2761
|
-
{
|
2762
|
-
title: "Scale Z",
|
2763
|
-
prop: "scale.z",
|
2764
|
-
type: "number",
|
2765
|
-
value: s.z,
|
2766
|
-
step: 0.01,
|
2767
|
-
onChange: h
|
2768
|
-
}
|
2769
|
-
]
|
2770
|
-
}
|
2771
|
-
);
|
2772
|
-
}
|
2773
|
-
function rn(t) {
|
2774
|
-
switch (t) {
|
2775
|
-
case "color":
|
2776
|
-
return "Color";
|
2777
|
-
case "intensity":
|
2778
|
-
return "Intensity";
|
2779
|
-
case "decay":
|
2780
|
-
return "Decay";
|
2781
|
-
case "distance":
|
2782
|
-
return "Distance";
|
2783
|
-
case "angle":
|
2784
|
-
return "Angle";
|
2785
|
-
case "penumbra":
|
2786
|
-
return "Penumbra";
|
2787
|
-
case "groundColor":
|
2788
|
-
return "Ground Color";
|
2789
|
-
}
|
2790
|
-
return t;
|
2791
|
-
}
|
2792
|
-
function Pi(t, n) {
|
2793
|
-
const a = [];
|
2794
|
-
if (t.lightInfo !== void 0)
|
2795
|
-
for (const e in t.lightInfo) {
|
2796
|
-
const r = t.lightInfo[e];
|
2797
|
-
r !== void 0 && (r.isColor !== void 0 ? a.push({
|
2798
|
-
title: rn(e),
|
2799
|
-
prop: e,
|
2800
|
-
type: "color",
|
2801
|
-
value: r,
|
2802
|
-
onChange: (s, h) => {
|
2803
|
-
var d;
|
2804
|
-
const c = new Pt(h);
|
2805
|
-
n.updateObject(t.uuid, s, c);
|
2806
|
-
const l = (d = n.scene) == null ? void 0 : d.getObjectByProperty("uuid", t.uuid);
|
2807
|
-
l !== void 0 && ne(l, s, c);
|
2808
|
-
}
|
2809
|
-
}) : a.push({
|
2810
|
-
title: rn(e),
|
2811
|
-
prop: e,
|
2812
|
-
type: typeof r,
|
2813
|
-
value: r,
|
2814
|
-
step: typeof r == "number" ? 0.01 : void 0,
|
2815
|
-
onChange: (s, h) => {
|
2816
|
-
var l;
|
2817
|
-
n.updateObject(t.uuid, s, h);
|
2818
|
-
const c = (l = n.scene) == null ? void 0 : l.getObjectByProperty("uuid", t.uuid);
|
2819
|
-
c !== void 0 && ne(c, s, h);
|
2820
|
-
}
|
2821
|
-
}));
|
2822
|
-
}
|
2823
|
-
return /* @__PURE__ */ u.jsx(
|
2824
|
-
Ue,
|
2825
|
-
{
|
2826
|
-
title: "Light",
|
2827
|
-
items: a
|
2828
|
-
}
|
2829
|
-
);
|
2830
|
-
}
|
2831
|
-
function Ai(t, n) {
|
2832
|
-
var c;
|
2833
|
-
const a = [], e = [];
|
2834
|
-
let r = 0;
|
2835
|
-
t.animations.forEach((l) => {
|
2836
|
-
r = Math.max(r, l.duration), l.duration > 0 && e.push({
|
2837
|
-
title: l.name,
|
2838
|
-
items: [
|
2839
|
-
{
|
2840
|
-
title: "Duration",
|
2841
|
-
type: "number",
|
2842
|
-
value: l.duration,
|
2843
|
-
disabled: !0
|
2844
|
-
},
|
2845
|
-
{
|
2846
|
-
title: "Blend Mode",
|
2847
|
-
type: "option",
|
2848
|
-
disabled: !0,
|
2849
|
-
options: [
|
2850
|
-
{
|
2851
|
-
title: "Normal",
|
2852
|
-
value: 2500
|
2853
|
-
},
|
2854
|
-
{
|
2855
|
-
title: "Additive",
|
2856
|
-
value: 2501
|
2857
|
-
}
|
2858
|
-
]
|
2859
|
-
}
|
2860
|
-
]
|
2861
|
-
});
|
2862
|
-
}), a.push({
|
2863
|
-
title: "Animations",
|
2864
|
-
items: e
|
2865
|
-
});
|
2866
|
-
const s = (c = n.scene) == null ? void 0 : c.getObjectByProperty("uuid", t.uuid);
|
2867
|
-
let h = !1;
|
2868
|
-
if (s !== void 0) {
|
2869
|
-
const l = s.mixer;
|
2870
|
-
if (h = l !== void 0, h) {
|
2871
|
-
const d = [
|
2872
|
-
{
|
2873
|
-
title: "Time Scale",
|
2874
|
-
type: "range",
|
2875
|
-
value: l.timeScale,
|
2876
|
-
step: 0.01,
|
2877
|
-
min: -1,
|
2878
|
-
max: 2,
|
2879
|
-
onChange: (b, m) => {
|
2880
|
-
l.timeScale = m, n.updateObject(t.uuid, "mixer.timeScale", m);
|
2881
|
-
}
|
2882
|
-
}
|
2883
|
-
];
|
2884
|
-
d.push({
|
2885
|
-
title: "Stop All",
|
2886
|
-
type: "button",
|
2887
|
-
onChange: () => {
|
2888
|
-
l.stopAllAction(), n.requestMethod(t.uuid, "stopAllAction", void 0, "mixer");
|
2889
|
-
}
|
2890
|
-
}), a.push({
|
2891
|
-
title: "Mixer",
|
2892
|
-
items: d
|
2893
|
-
});
|
2894
|
-
}
|
2895
|
-
}
|
2896
|
-
return /* @__PURE__ */ u.jsx(Ue, { title: "Animation", items: a });
|
2897
|
-
}
|
2898
|
-
const zn = {
|
2899
|
-
name: "",
|
2900
|
-
uuid: "",
|
2901
|
-
type: "",
|
2902
|
-
visible: !1,
|
2903
|
-
matrix: [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1],
|
2904
|
-
animations: [],
|
2905
|
-
material: void 0,
|
2906
|
-
perspectiveCameraInfo: void 0,
|
2907
|
-
orthographicCameraInfo: void 0,
|
2908
|
-
lightInfo: void 0
|
2909
|
-
};
|
2910
|
-
let ie = { ...zn };
|
2911
|
-
function ki(t) {
|
2912
|
-
const [n, a] = le(-1);
|
2913
|
-
Be(() => {
|
2914
|
-
function h(l) {
|
2915
|
-
ie = { ...l.value }, a(Date.now());
|
2916
|
-
}
|
2917
|
-
function c() {
|
2918
|
-
ie = { ...zn }, a(Date.now());
|
2919
|
-
}
|
2920
|
-
return _.addEventListener(j.SET_SCENE, c), _.addEventListener(j.SET_OBJECT, h), () => {
|
2921
|
-
_.removeEventListener(j.SET_SCENE, c), _.removeEventListener(j.SET_OBJECT, h);
|
2922
|
-
};
|
2923
|
-
}, []);
|
2924
|
-
const e = ie.type.toLowerCase(), r = ie.animations.length > 0 || ie.mixer !== void 0, s = e.search("mesh") > -1 || e.search("line") > -1 || e.search("points") > -1;
|
2925
|
-
return /* @__PURE__ */ u.jsx(qt, { label: "Inspector", children: /* @__PURE__ */ u.jsx("div", { id: "Inspector", className: t.class, children: ie.uuid.length > 0 && /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
|
2926
|
-
/* @__PURE__ */ u.jsxs(u.Fragment, { children: [
|
2927
|
-
/* @__PURE__ */ u.jsx(
|
2928
|
-
lt,
|
2929
|
-
{
|
2930
|
-
type: "string",
|
2931
|
-
title: "Name",
|
2932
|
-
prop: "name",
|
2933
|
-
value: ie.name,
|
2934
|
-
disabled: !0
|
2935
|
-
}
|
2936
|
-
),
|
2937
|
-
/* @__PURE__ */ u.jsx(
|
2938
|
-
lt,
|
2939
|
-
{
|
2940
|
-
type: "string",
|
2941
|
-
title: "Type",
|
2942
|
-
prop: "type",
|
2943
|
-
value: ie.type,
|
2944
|
-
disabled: !0
|
2945
|
-
}
|
2946
|
-
),
|
2947
|
-
/* @__PURE__ */ u.jsx(
|
2948
|
-
lt,
|
2949
|
-
{
|
2950
|
-
type: "string",
|
2951
|
-
title: "UUID",
|
2952
|
-
prop: "uuid",
|
2953
|
-
value: ie.uuid,
|
2954
|
-
disabled: !0
|
2955
|
-
}
|
2956
|
-
),
|
2957
|
-
/* @__PURE__ */ u.jsx(
|
2958
|
-
lt,
|
2959
|
-
{
|
2960
|
-
type: "boolean",
|
2961
|
-
title: "Visible",
|
2962
|
-
prop: "visible",
|
2963
|
-
value: ie.visible,
|
2964
|
-
onChange: (h, c) => {
|
2965
|
-
var d;
|
2966
|
-
t.three.updateObject(ie.uuid, h, c);
|
2967
|
-
const l = (d = t.three.scene) == null ? void 0 : d.getObjectByProperty("uuid", ie.uuid);
|
2968
|
-
l !== void 0 && ne(l, h, c);
|
2969
|
-
}
|
2970
|
-
}
|
2971
|
-
)
|
2972
|
-
] }),
|
2973
|
-
/* @__PURE__ */ u.jsxs(u.Fragment, { children: [
|
2974
|
-
Ri(ie, t.three),
|
2975
|
-
r ? Ai(ie, t.three) : null,
|
2976
|
-
e.search("camera") > -1 ? wi(ie, t.three) : null,
|
2977
|
-
e.search("light") > -1 ? Pi(ie, t.three) : null,
|
2978
|
-
s ? Si(ie, t.three) : null
|
2979
|
-
] })
|
2980
|
-
] }) }, n) }, "Inspector");
|
2981
|
-
}
|
2982
|
-
class Zi extends ka {
|
2983
|
-
constructor(a) {
|
2984
|
-
super(a);
|
2985
|
-
F(this, "three");
|
2986
|
-
// Private
|
2987
|
-
F(this, "setScene", (a) => {
|
2988
|
-
this.setState(() => ({
|
2989
|
-
scene: a.value
|
2990
|
-
}));
|
2991
|
-
});
|
2992
|
-
this.state = {
|
2993
|
-
scene: a.scene !== void 0 ? a.scene : null
|
2994
|
-
}, this.three = a.three, _.addEventListener(j.SET_SCENE, this.setScene);
|
2995
|
-
}
|
2996
|
-
componentWillUnmount() {
|
2997
|
-
_.removeEventListener(j.SET_SCENE, this.setScene);
|
2998
|
-
}
|
2999
|
-
render() {
|
3000
|
-
var r;
|
3001
|
-
const a = this.componentState.scene !== null, e = "Hierarchy - " + (a ? `${(r = this.componentState.scene) == null ? void 0 : r.name}` : "No Scene");
|
3002
|
-
return /* @__PURE__ */ u.jsx("div", { id: "SidePanel", children: /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
|
3003
|
-
/* @__PURE__ */ u.jsx(qt, { label: e, open: !0, children: /* @__PURE__ */ u.jsx(u.Fragment, { children: a && /* @__PURE__ */ u.jsx(fi, { child: this.componentState.scene, three: this.three }) }) }),
|
3004
|
-
/* @__PURE__ */ u.jsx(ki, { three: this.three })
|
3005
|
-
] }) }, "SidePanel");
|
3006
|
-
}
|
3007
|
-
// Getters / Setters
|
3008
|
-
get componentState() {
|
3009
|
-
return this.state;
|
3010
|
-
}
|
3011
|
-
}
|
3012
|
-
function Ji(t) {
|
3013
|
-
function n() {
|
3014
|
-
return t.three.scene === void 0 ? (console.log("No scene:", t.three), !1) : !0;
|
3015
|
-
}
|
3016
|
-
const a = (c) => {
|
3017
|
-
var d;
|
3018
|
-
if (!n())
|
3019
|
-
return;
|
3020
|
-
const l = (d = t.three.scene) == null ? void 0 : d.getObjectByProperty("uuid", c.value);
|
3021
|
-
l !== void 0 && t.three.setObject(l);
|
3022
|
-
}, e = (c, l, d) => {
|
3023
|
-
var m;
|
3024
|
-
if (!n())
|
3025
|
-
return;
|
3026
|
-
const b = (m = t.three.scene) == null ? void 0 : m.getObjectByProperty("uuid", c);
|
3027
|
-
b !== void 0 && ne(b, l, d);
|
3028
|
-
}, r = (c) => {
|
3029
|
-
if (!n())
|
3030
|
-
return;
|
3031
|
-
const l = c.value, { key: d, value: b, uuid: m } = l;
|
3032
|
-
e(m, d, b);
|
3033
|
-
}, s = (c) => {
|
3034
|
-
if (!n())
|
3035
|
-
return;
|
3036
|
-
const l = c.value;
|
3037
|
-
Ht(l.value).then((d) => {
|
3038
|
-
e(l.uuid, l.key, d), e(l.uuid, "material.needsUpdate", !0);
|
3039
|
-
});
|
3040
|
-
}, h = (c) => {
|
3041
|
-
var S;
|
3042
|
-
if (!n())
|
3043
|
-
return;
|
3044
|
-
const { key: l, uuid: d, value: b, subitem: m } = c.value, E = (S = t.three.scene) == null ? void 0 : S.getObjectByProperty("uuid", d);
|
3045
|
-
if (E !== void 0)
|
3046
|
-
try {
|
3047
|
-
m !== void 0 ? Ha(E, m)[l](b) : E[l](b);
|
3048
|
-
} catch (x) {
|
3049
|
-
console.log("Error requesting method:"), console.log(x), console.log(l), console.log(b);
|
3050
|
-
}
|
3051
|
-
};
|
3052
|
-
return Be(() => (_.addEventListener(j.GET_OBJECT, a), _.addEventListener(j.UPDATE_OBJECT, r), _.addEventListener(j.CREATE_TEXTURE, s), _.addEventListener(j.REQUEST_METHOD, h), () => {
|
3053
|
-
_.removeEventListener(j.GET_OBJECT, a), _.removeEventListener(j.UPDATE_OBJECT, r), _.removeEventListener(j.CREATE_TEXTURE, s), _.removeEventListener(j.REQUEST_METHOD, h);
|
3054
|
-
}), []), null;
|
3055
|
-
}
|
3056
|
-
const on = { type: "change" }, Yt = { type: "start" }, sn = { type: "end" }, Ot = new ga(), cn = new ba(), _i = Math.cos(70 * ya.DEG2RAD);
|
3057
|
-
class ji extends fn {
|
3058
|
-
constructor(n, a) {
|
3059
|
-
super(), this.object = n, this.domElement = a, this.domElement.style.touchAction = "none", this.enabled = !0, this.target = new Z(), this.cursor = new Z(), 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: He.ROTATE, MIDDLE: He.DOLLY, RIGHT: He.PAN }, this.touches = { ONE: We.ROTATE, TWO: We.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this.getPolarAngle = function() {
|
3060
|
-
return c.phi;
|
3061
|
-
}, this.getAzimuthalAngle = function() {
|
3062
|
-
return c.theta;
|
3063
|
-
}, this.getDistance = function() {
|
3064
|
-
return this.object.position.distanceTo(this.target);
|
3065
|
-
}, this.listenToKeyEvents = function(o) {
|
3066
|
-
o.addEventListener("keydown", at), this._domElementKeyEvents = o;
|
3067
|
-
}, this.stopListenToKeyEvents = function() {
|
3068
|
-
this._domElementKeyEvents.removeEventListener("keydown", at), this._domElementKeyEvents = null;
|
3069
|
-
}, this.saveState = function() {
|
3070
|
-
e.target0.copy(e.target), e.position0.copy(e.object.position), e.zoom0 = e.object.zoom;
|
3071
|
-
}, this.reset = function() {
|
3072
|
-
e.target.copy(e.target0), e.object.position.copy(e.position0), e.object.zoom = e.zoom0, e.object.updateProjectionMatrix(), e.dispatchEvent(on), e.update(), s = r.NONE;
|
3073
|
-
}, this.update = function() {
|
3074
|
-
const o = new Z(), y = new Jt().setFromUnitVectors(n.up, new Z(0, 1, 0)), M = y.clone().invert(), N = new Z(), X = new Jt(), pe = new Z(), oe = 2 * Math.PI;
|
3075
|
-
return function(Bt = null) {
|
3076
|
-
const rt = e.object.position;
|
3077
|
-
o.copy(rt).sub(e.target), o.applyQuaternion(y), c.setFromVector3(o), e.autoRotate && s === r.NONE && z(A(Bt)), e.enableDamping ? (c.theta += l.theta * e.dampingFactor, c.phi += l.phi * e.dampingFactor) : (c.theta += l.theta, c.phi += l.phi);
|
3078
|
-
let ge = e.minAzimuthAngle, me = e.maxAzimuthAngle;
|
3079
|
-
isFinite(ge) && isFinite(me) && (ge < -Math.PI ? ge += oe : ge > Math.PI && (ge -= oe), me < -Math.PI ? me += oe : me > Math.PI && (me -= oe), ge <= me ? c.theta = Math.max(ge, Math.min(me, c.theta)) : c.theta = c.theta > (ge + me) / 2 ? Math.max(ge, c.theta) : Math.min(me, c.theta)), c.phi = Math.max(e.minPolarAngle, Math.min(e.maxPolarAngle, c.phi)), c.makeSafe(), e.enableDamping === !0 ? e.target.addScaledVector(b, e.dampingFactor) : e.target.add(b), e.target.sub(e.cursor), e.target.clampLength(e.minTargetRadius, e.maxTargetRadius), e.target.add(e.cursor), e.zoomToCursor && ae || e.object.isOrthographicCamera ? c.radius = fe(c.radius) : c.radius = fe(c.radius * d), o.setFromSpherical(c), o.applyQuaternion(M), rt.copy(e.target).add(o), e.object.lookAt(e.target), e.enableDamping === !0 ? (l.theta *= 1 - e.dampingFactor, l.phi *= 1 - e.dampingFactor, b.multiplyScalar(1 - e.dampingFactor)) : (l.set(0, 0, 0), b.set(0, 0, 0));
|
3080
|
-
let ke = !1;
|
3081
|
-
if (e.zoomToCursor && ae) {
|
3082
|
-
let _e = null;
|
3083
|
-
if (e.object.isPerspectiveCamera) {
|
3084
|
-
const je = o.length();
|
3085
|
-
_e = fe(je * d);
|
3086
|
-
const De = je - _e;
|
3087
|
-
e.object.position.addScaledVector(he, De), e.object.updateMatrixWorld();
|
3088
|
-
} else if (e.object.isOrthographicCamera) {
|
3089
|
-
const je = new Z(te.x, te.y, 0);
|
3090
|
-
je.unproject(e.object), e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom / d)), e.object.updateProjectionMatrix(), ke = !0;
|
3091
|
-
const De = new Z(te.x, te.y, 0);
|
3092
|
-
De.unproject(e.object), e.object.position.sub(De).add(je), e.object.updateMatrixWorld(), _e = o.length();
|
3093
|
-
} else
|
3094
|
-
console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), e.zoomToCursor = !1;
|
3095
|
-
_e !== null && (this.screenSpacePanning ? e.target.set(0, 0, -1).transformDirection(e.object.matrix).multiplyScalar(_e).add(e.object.position) : (Ot.origin.copy(e.object.position), Ot.direction.set(0, 0, -1).transformDirection(e.object.matrix), Math.abs(e.object.up.dot(Ot.direction)) < _i ? n.lookAt(e.target) : (cn.setFromNormalAndCoplanarPoint(e.object.up, e.target), Ot.intersectPlane(cn, e.target))));
|
3096
|
-
} else
|
3097
|
-
e.object.isOrthographicCamera && (ke = d !== 1, ke && (e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom / d)), e.object.updateProjectionMatrix()));
|
3098
|
-
return d = 1, ae = !1, ke || N.distanceToSquared(e.object.position) > h || 8 * (1 - X.dot(e.object.quaternion)) > h || pe.distanceToSquared(e.target) > 0 ? (e.dispatchEvent(on), N.copy(e.object.position), X.copy(e.object.quaternion), pe.copy(e.target), !0) : !1;
|
3099
|
-
};
|
3100
|
-
}(), this.dispose = function() {
|
3101
|
-
e.domElement.removeEventListener("contextmenu", Ge), e.domElement.removeEventListener("pointerdown", Pe), e.domElement.removeEventListener("pointercancel", Ae), e.domElement.removeEventListener("wheel", Et), e.domElement.removeEventListener("pointermove", tt), e.domElement.removeEventListener("pointerup", Ae), e._domElementKeyEvents !== null && (e._domElementKeyEvents.removeEventListener("keydown", at), e._domElementKeyEvents = null);
|
3102
|
-
};
|
3103
|
-
const e = this, r = {
|
3104
|
-
NONE: -1,
|
3105
|
-
ROTATE: 0,
|
3106
|
-
DOLLY: 1,
|
3107
|
-
PAN: 2,
|
3108
|
-
TOUCH_ROTATE: 3,
|
3109
|
-
TOUCH_PAN: 4,
|
3110
|
-
TOUCH_DOLLY_PAN: 5,
|
3111
|
-
TOUCH_DOLLY_ROTATE: 6
|
3112
|
-
};
|
3113
|
-
let s = r.NONE;
|
3114
|
-
const h = 1e-6, c = new Qt(), l = new Qt();
|
3115
|
-
let d = 1;
|
3116
|
-
const b = new Z(), m = new de(), E = new de(), S = new de(), x = new de(), T = new de(), W = new de(), I = new de(), w = new de(), G = new de(), he = new Z(), te = new de();
|
3117
|
-
let ae = !1;
|
3118
|
-
const f = [], v = {};
|
3119
|
-
let C = !1;
|
3120
|
-
function A(o) {
|
3121
|
-
return o !== null ? 2 * Math.PI / 60 * e.autoRotateSpeed * o : 2 * Math.PI / 60 / 60 * e.autoRotateSpeed;
|
3122
|
-
}
|
3123
|
-
function Y(o) {
|
3124
|
-
const y = Math.abs(o * 0.01);
|
3125
|
-
return Math.pow(0.95, e.zoomSpeed * y);
|
3126
|
-
}
|
3127
|
-
function z(o) {
|
3128
|
-
l.theta -= o;
|
3129
|
-
}
|
3130
|
-
function B(o) {
|
3131
|
-
l.phi -= o;
|
3132
|
-
}
|
3133
|
-
const L = function() {
|
3134
|
-
const o = new Z();
|
3135
|
-
return function(M, N) {
|
3136
|
-
o.setFromMatrixColumn(N, 0), o.multiplyScalar(-M), b.add(o);
|
3137
|
-
};
|
3138
|
-
}(), q = function() {
|
3139
|
-
const o = new Z();
|
3140
|
-
return function(M, N) {
|
3141
|
-
e.screenSpacePanning === !0 ? o.setFromMatrixColumn(N, 1) : (o.setFromMatrixColumn(N, 0), o.crossVectors(e.object.up, o)), o.multiplyScalar(M), b.add(o);
|
3142
|
-
};
|
3143
|
-
}(), K = function() {
|
3144
|
-
const o = new Z();
|
3145
|
-
return function(M, N) {
|
3146
|
-
const X = e.domElement;
|
3147
|
-
if (e.object.isPerspectiveCamera) {
|
3148
|
-
const pe = e.object.position;
|
3149
|
-
o.copy(pe).sub(e.target);
|
3150
|
-
let oe = o.length();
|
3151
|
-
oe *= Math.tan(e.object.fov / 2 * Math.PI / 180), L(2 * M * oe / X.clientHeight, e.object.matrix), q(2 * N * oe / X.clientHeight, e.object.matrix);
|
3152
|
-
} else
|
3153
|
-
e.object.isOrthographicCamera ? (L(M * (e.object.right - e.object.left) / e.object.zoom / X.clientWidth, e.object.matrix), q(N * (e.object.top - e.object.bottom) / e.object.zoom / X.clientHeight, e.object.matrix)) : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."), e.enablePan = !1);
|
3154
|
-
};
|
3155
|
-
}();
|
3156
|
-
function R(o) {
|
3157
|
-
e.object.isPerspectiveCamera || e.object.isOrthographicCamera ? d /= o : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), e.enableZoom = !1);
|
3158
|
-
}
|
3159
|
-
function U(o) {
|
3160
|
-
e.object.isPerspectiveCamera || e.object.isOrthographicCamera ? d *= o : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), e.enableZoom = !1);
|
3161
|
-
}
|
3162
|
-
function Q(o, y) {
|
3163
|
-
if (!e.zoomToCursor)
|
3164
|
-
return;
|
3165
|
-
ae = !0;
|
3166
|
-
const M = e.domElement.getBoundingClientRect(), N = o - M.left, X = y - M.top, pe = M.width, oe = M.height;
|
3167
|
-
te.x = N / pe * 2 - 1, te.y = -(X / oe) * 2 + 1, he.set(te.x, te.y, 1).unproject(e.object).sub(e.object.position).normalize();
|
3168
|
-
}
|
3169
|
-
function fe(o) {
|
3170
|
-
return Math.max(e.minDistance, Math.min(e.maxDistance, o));
|
3171
|
-
}
|
3172
|
-
function xe(o) {
|
3173
|
-
m.set(o.clientX, o.clientY);
|
3174
|
-
}
|
3175
|
-
function pt(o) {
|
3176
|
-
Q(o.clientX, o.clientX), I.set(o.clientX, o.clientY);
|
3177
|
-
}
|
3178
|
-
function Je(o) {
|
3179
|
-
x.set(o.clientX, o.clientY);
|
3180
|
-
}
|
3181
|
-
function _t(o) {
|
3182
|
-
E.set(o.clientX, o.clientY), S.subVectors(E, m).multiplyScalar(e.rotateSpeed);
|
3183
|
-
const y = e.domElement;
|
3184
|
-
z(2 * Math.PI * S.x / y.clientHeight), B(2 * Math.PI * S.y / y.clientHeight), m.copy(E), e.update();
|
3185
|
-
}
|
3186
|
-
function jt(o) {
|
3187
|
-
w.set(o.clientX, o.clientY), G.subVectors(w, I), G.y > 0 ? R(Y(G.y)) : G.y < 0 && U(Y(G.y)), I.copy(w), e.update();
|
3188
|
-
}
|
3189
|
-
function Qe(o) {
|
3190
|
-
T.set(o.clientX, o.clientY), W.subVectors(T, x).multiplyScalar(e.panSpeed), K(W.x, W.y), x.copy(T), e.update();
|
3191
|
-
}
|
3192
|
-
function et(o) {
|
3193
|
-
Q(o.clientX, o.clientY), o.deltaY < 0 ? U(Y(o.deltaY)) : o.deltaY > 0 && R(Y(o.deltaY)), e.update();
|
3194
|
-
}
|
3195
|
-
function ze(o) {
|
3196
|
-
let y = !1;
|
3197
|
-
switch (o.code) {
|
3198
|
-
case e.keys.UP:
|
3199
|
-
o.ctrlKey || o.metaKey || o.shiftKey ? B(2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : K(0, e.keyPanSpeed), y = !0;
|
3200
|
-
break;
|
3201
|
-
case e.keys.BOTTOM:
|
3202
|
-
o.ctrlKey || o.metaKey || o.shiftKey ? B(-2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : K(0, -e.keyPanSpeed), y = !0;
|
3203
|
-
break;
|
3204
|
-
case e.keys.LEFT:
|
3205
|
-
o.ctrlKey || o.metaKey || o.shiftKey ? z(2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : K(e.keyPanSpeed, 0), y = !0;
|
3206
|
-
break;
|
3207
|
-
case e.keys.RIGHT:
|
3208
|
-
o.ctrlKey || o.metaKey || o.shiftKey ? z(-2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : K(-e.keyPanSpeed, 0), y = !0;
|
3209
|
-
break;
|
3210
|
-
}
|
3211
|
-
y && (o.preventDefault(), e.update());
|
3212
|
-
}
|
3213
|
-
function Ye(o) {
|
3214
|
-
if (f.length === 1)
|
3215
|
-
m.set(o.pageX, o.pageY);
|
3216
|
-
else {
|
3217
|
-
const y = we(o), M = 0.5 * (o.pageX + y.x), N = 0.5 * (o.pageY + y.y);
|
3218
|
-
m.set(M, N);
|
3219
|
-
}
|
3220
|
-
}
|
3221
|
-
function Me(o) {
|
3222
|
-
if (f.length === 1)
|
3223
|
-
x.set(o.pageX, o.pageY);
|
3224
|
-
else {
|
3225
|
-
const y = we(o), M = 0.5 * (o.pageX + y.x), N = 0.5 * (o.pageY + y.y);
|
3226
|
-
x.set(M, N);
|
3227
|
-
}
|
3228
|
-
}
|
3229
|
-
function mt(o) {
|
3230
|
-
const y = we(o), M = o.pageX - y.x, N = o.pageY - y.y, X = Math.sqrt(M * M + N * N);
|
3231
|
-
I.set(0, X);
|
3232
|
-
}
|
3233
|
-
function vt(o) {
|
3234
|
-
e.enableZoom && mt(o), e.enablePan && Me(o);
|
3235
|
-
}
|
3236
|
-
function Dt(o) {
|
3237
|
-
e.enableZoom && mt(o), e.enableRotate && Ye(o);
|
3238
|
-
}
|
3239
|
-
function gt(o) {
|
3240
|
-
if (f.length == 1)
|
3241
|
-
E.set(o.pageX, o.pageY);
|
3242
|
-
else {
|
3243
|
-
const M = we(o), N = 0.5 * (o.pageX + M.x), X = 0.5 * (o.pageY + M.y);
|
3244
|
-
E.set(N, X);
|
3245
|
-
}
|
3246
|
-
S.subVectors(E, m).multiplyScalar(e.rotateSpeed);
|
3247
|
-
const y = e.domElement;
|
3248
|
-
z(2 * Math.PI * S.x / y.clientHeight), B(2 * Math.PI * S.y / y.clientHeight), m.copy(E);
|
3249
|
-
}
|
3250
|
-
function Te(o) {
|
3251
|
-
if (f.length === 1)
|
3252
|
-
T.set(o.pageX, o.pageY);
|
3253
|
-
else {
|
3254
|
-
const y = we(o), M = 0.5 * (o.pageX + y.x), N = 0.5 * (o.pageY + y.y);
|
3255
|
-
T.set(M, N);
|
3256
|
-
}
|
3257
|
-
W.subVectors(T, x).multiplyScalar(e.panSpeed), K(W.x, W.y), x.copy(T);
|
3258
|
-
}
|
3259
|
-
function Re(o) {
|
3260
|
-
const y = we(o), M = o.pageX - y.x, N = o.pageY - y.y, X = Math.sqrt(M * M + N * N);
|
3261
|
-
w.set(0, X), G.set(0, Math.pow(w.y / I.y, e.zoomSpeed)), R(G.y), I.copy(w);
|
3262
|
-
const pe = (o.pageX + y.x) * 0.5, oe = (o.pageY + y.y) * 0.5;
|
3263
|
-
Q(pe, oe);
|
3264
|
-
}
|
3265
|
-
function bt(o) {
|
3266
|
-
e.enableZoom && Re(o), e.enablePan && Te(o);
|
3267
|
-
}
|
3268
|
-
function yt(o) {
|
3269
|
-
e.enableZoom && Re(o), e.enableRotate && gt(o);
|
3270
|
-
}
|
3271
|
-
function Pe(o) {
|
3272
|
-
e.enabled !== !1 && (f.length === 0 && (e.domElement.setPointerCapture(o.pointerId), e.domElement.addEventListener("pointermove", tt), e.domElement.addEventListener("pointerup", Ae)), Lt(o), o.pointerType === "touch" ? it(o) : nt(o));
|
3273
|
-
}
|
3274
|
-
function tt(o) {
|
3275
|
-
e.enabled !== !1 && (o.pointerType === "touch" ? St(o) : It(o));
|
3276
|
-
}
|
3277
|
-
function Ae(o) {
|
3278
|
-
switch (Nt(o), f.length) {
|
3279
|
-
case 0:
|
3280
|
-
e.domElement.releasePointerCapture(o.pointerId), e.domElement.removeEventListener("pointermove", tt), e.domElement.removeEventListener("pointerup", Ae), e.dispatchEvent(sn), s = r.NONE;
|
3281
|
-
break;
|
3282
|
-
case 1:
|
3283
|
-
const y = f[0], M = v[y];
|
3284
|
-
it({ pointerId: y, pageX: M.x, pageY: M.y });
|
3285
|
-
break;
|
3286
|
-
}
|
3287
|
-
}
|
3288
|
-
function nt(o) {
|
3289
|
-
let y;
|
3290
|
-
switch (o.button) {
|
3291
|
-
case 0:
|
3292
|
-
y = e.mouseButtons.LEFT;
|
3293
|
-
break;
|
3294
|
-
case 1:
|
3295
|
-
y = e.mouseButtons.MIDDLE;
|
3296
|
-
break;
|
3297
|
-
case 2:
|
3298
|
-
y = e.mouseButtons.RIGHT;
|
3299
|
-
break;
|
3300
|
-
default:
|
3301
|
-
y = -1;
|
3302
|
-
}
|
3303
|
-
switch (y) {
|
3304
|
-
case He.DOLLY:
|
3305
|
-
if (e.enableZoom === !1)
|
3306
|
-
return;
|
3307
|
-
pt(o), s = r.DOLLY;
|
3308
|
-
break;
|
3309
|
-
case He.ROTATE:
|
3310
|
-
if (o.ctrlKey || o.metaKey || o.shiftKey) {
|
3311
|
-
if (e.enablePan === !1)
|
3312
|
-
return;
|
3313
|
-
Je(o), s = r.PAN;
|
3314
|
-
} else {
|
3315
|
-
if (e.enableRotate === !1)
|
3316
|
-
return;
|
3317
|
-
xe(o), s = r.ROTATE;
|
3318
|
-
}
|
3319
|
-
break;
|
3320
|
-
case He.PAN:
|
3321
|
-
if (o.ctrlKey || o.metaKey || o.shiftKey) {
|
3322
|
-
if (e.enableRotate === !1)
|
3323
|
-
return;
|
3324
|
-
xe(o), s = r.ROTATE;
|
3325
|
-
} else {
|
3326
|
-
if (e.enablePan === !1)
|
3327
|
-
return;
|
3328
|
-
Je(o), s = r.PAN;
|
3329
|
-
}
|
3330
|
-
break;
|
3331
|
-
default:
|
3332
|
-
s = r.NONE;
|
3333
|
-
}
|
3334
|
-
s !== r.NONE && e.dispatchEvent(Yt);
|
3335
|
-
}
|
3336
|
-
function It(o) {
|
3337
|
-
switch (s) {
|
3338
|
-
case r.ROTATE:
|
3339
|
-
if (e.enableRotate === !1)
|
3340
|
-
return;
|
3341
|
-
_t(o);
|
3342
|
-
break;
|
3343
|
-
case r.DOLLY:
|
3344
|
-
if (e.enableZoom === !1)
|
3345
|
-
return;
|
3346
|
-
jt(o);
|
3347
|
-
break;
|
3348
|
-
case r.PAN:
|
3349
|
-
if (e.enablePan === !1)
|
3350
|
-
return;
|
3351
|
-
Qe(o);
|
3352
|
-
break;
|
3353
|
-
}
|
3354
|
-
}
|
3355
|
-
function Et(o) {
|
3356
|
-
e.enabled === !1 || e.enableZoom === !1 || s !== r.NONE || (o.preventDefault(), e.dispatchEvent(Yt), et(Ct(o)), e.dispatchEvent(sn));
|
3357
|
-
}
|
3358
|
-
function Ct(o) {
|
3359
|
-
const y = o.deltaMode, M = {
|
3360
|
-
clientX: o.clientX,
|
3361
|
-
clientY: o.clientY,
|
3362
|
-
deltaY: o.deltaY
|
3363
|
-
};
|
3364
|
-
switch (y) {
|
3365
|
-
case 1:
|
3366
|
-
M.deltaY *= 16;
|
3367
|
-
break;
|
3368
|
-
case 2:
|
3369
|
-
M.deltaY *= 100;
|
3370
|
-
break;
|
3371
|
-
}
|
3372
|
-
return o.ctrlKey && !C && (M.deltaY *= 10), M;
|
3373
|
-
}
|
3374
|
-
function xt(o) {
|
3375
|
-
o.key === "Control" && (C = !0, e.domElement.getRootNode().addEventListener("keyup", Se, { passive: !0, capture: !0 }));
|
3376
|
-
}
|
3377
|
-
function Se(o) {
|
3378
|
-
o.key === "Control" && (C = !1, e.domElement.getRootNode().removeEventListener("keyup", Se, { passive: !0, capture: !0 }));
|
3379
|
-
}
|
3380
|
-
function at(o) {
|
3381
|
-
e.enabled === !1 || e.enablePan === !1 || ze(o);
|
3382
|
-
}
|
3383
|
-
function it(o) {
|
3384
|
-
switch (wt(o), f.length) {
|
3385
|
-
case 1:
|
3386
|
-
switch (e.touches.ONE) {
|
3387
|
-
case We.ROTATE:
|
3388
|
-
if (e.enableRotate === !1)
|
3389
|
-
return;
|
3390
|
-
Ye(o), s = r.TOUCH_ROTATE;
|
3391
|
-
break;
|
3392
|
-
case We.PAN:
|
3393
|
-
if (e.enablePan === !1)
|
3394
|
-
return;
|
3395
|
-
Me(o), s = r.TOUCH_PAN;
|
3396
|
-
break;
|
3397
|
-
default:
|
3398
|
-
s = r.NONE;
|
3399
|
-
}
|
3400
|
-
break;
|
3401
|
-
case 2:
|
3402
|
-
switch (e.touches.TWO) {
|
3403
|
-
case We.DOLLY_PAN:
|
3404
|
-
if (e.enableZoom === !1 && e.enablePan === !1)
|
3405
|
-
return;
|
3406
|
-
vt(o), s = r.TOUCH_DOLLY_PAN;
|
3407
|
-
break;
|
3408
|
-
case We.DOLLY_ROTATE:
|
3409
|
-
if (e.enableZoom === !1 && e.enableRotate === !1)
|
3410
|
-
return;
|
3411
|
-
Dt(o), s = r.TOUCH_DOLLY_ROTATE;
|
3412
|
-
break;
|
3413
|
-
default:
|
3414
|
-
s = r.NONE;
|
3415
|
-
}
|
3416
|
-
break;
|
3417
|
-
default:
|
3418
|
-
s = r.NONE;
|
3419
|
-
}
|
3420
|
-
s !== r.NONE && e.dispatchEvent(Yt);
|
3421
|
-
}
|
3422
|
-
function St(o) {
|
3423
|
-
switch (wt(o), s) {
|
3424
|
-
case r.TOUCH_ROTATE:
|
3425
|
-
if (e.enableRotate === !1)
|
3426
|
-
return;
|
3427
|
-
gt(o), e.update();
|
3428
|
-
break;
|
3429
|
-
case r.TOUCH_PAN:
|
3430
|
-
if (e.enablePan === !1)
|
3431
|
-
return;
|
3432
|
-
Te(o), e.update();
|
3433
|
-
break;
|
3434
|
-
case r.TOUCH_DOLLY_PAN:
|
3435
|
-
if (e.enableZoom === !1 && e.enablePan === !1)
|
3436
|
-
return;
|
3437
|
-
bt(o), e.update();
|
3438
|
-
break;
|
3439
|
-
case r.TOUCH_DOLLY_ROTATE:
|
3440
|
-
if (e.enableZoom === !1 && e.enableRotate === !1)
|
3441
|
-
return;
|
3442
|
-
yt(o), e.update();
|
3443
|
-
break;
|
3444
|
-
default:
|
3445
|
-
s = r.NONE;
|
3446
|
-
}
|
3447
|
-
}
|
3448
|
-
function Ge(o) {
|
3449
|
-
e.enabled !== !1 && o.preventDefault();
|
3450
|
-
}
|
3451
|
-
function Lt(o) {
|
3452
|
-
f.push(o.pointerId);
|
3453
|
-
}
|
3454
|
-
function Nt(o) {
|
3455
|
-
delete v[o.pointerId];
|
3456
|
-
for (let y = 0; y < f.length; y++)
|
3457
|
-
if (f[y] == o.pointerId) {
|
3458
|
-
f.splice(y, 1);
|
3459
|
-
return;
|
3460
|
-
}
|
3461
|
-
}
|
3462
|
-
function wt(o) {
|
3463
|
-
let y = v[o.pointerId];
|
3464
|
-
y === void 0 && (y = new de(), v[o.pointerId] = y), y.set(o.pageX, o.pageY);
|
3465
|
-
}
|
3466
|
-
function we(o) {
|
3467
|
-
const y = o.pointerId === f[0] ? f[1] : f[0];
|
3468
|
-
return v[y];
|
3469
|
-
}
|
3470
|
-
e.domElement.addEventListener("contextmenu", Ge), e.domElement.addEventListener("pointerdown", Pe), e.domElement.addEventListener("pointercancel", Ae), e.domElement.addEventListener("wheel", Et, { passive: !1 }), e.domElement.getRootNode().addEventListener("keydown", xt, { passive: !0, capture: !0 }), this.update();
|
3471
|
-
}
|
3472
|
-
}
|
3473
|
-
const Rt = (t) => {
|
3474
|
-
const [n, a] = le(t.options[t.index]), e = () => {
|
3475
|
-
t.onToggle(!t.open);
|
3476
|
-
}, r = (s) => {
|
3477
|
-
s !== n && (t.onSelect(s), a(s)), t.onToggle(!1);
|
3478
|
-
};
|
3479
|
-
return /* @__PURE__ */ u.jsxs("div", { className: `dropdown ${t.up === !0 ? "up" : ""}`, children: [
|
3480
|
-
/* @__PURE__ */ u.jsx("div", { className: "dropdown-toggle", onClick: e, children: n }),
|
3481
|
-
t.open && /* @__PURE__ */ u.jsx("ul", { className: "dropdown-menu", children: t.options.map((s) => /* @__PURE__ */ u.jsx("li", { onClick: () => r(s), children: s }, s)) })
|
3482
|
-
] });
|
3483
|
-
}, Le = _a(function(n, a) {
|
3484
|
-
const [e, r] = le(!1), s = n.options.indexOf(n.camera.name);
|
3485
|
-
return /* @__PURE__ */ u.jsxs("div", { className: "CameraWindow", children: [
|
3486
|
-
/* @__PURE__ */ u.jsx("div", { ref: a, className: "clickable", onClick: () => {
|
3487
|
-
e && r(!1);
|
3488
|
-
} }),
|
3489
|
-
/* @__PURE__ */ u.jsx(
|
3490
|
-
Rt,
|
3491
|
-
{
|
3492
|
-
index: s,
|
3493
|
-
open: e,
|
3494
|
-
options: n.options,
|
3495
|
-
onSelect: n.onSelect,
|
3496
|
-
onToggle: (h) => {
|
3497
|
-
r(h);
|
3498
|
-
},
|
3499
|
-
up: !0
|
3500
|
-
}
|
3501
|
-
)
|
3502
|
-
] });
|
3503
|
-
}), ln = [
|
3504
|
-
"Single",
|
3505
|
-
"Side by Side",
|
3506
|
-
"Stacked",
|
3507
|
-
"Quad"
|
3508
|
-
], re = /* @__PURE__ */ new Map(), se = /* @__PURE__ */ new Map(), ye = /* @__PURE__ */ new Map();
|
3509
|
-
function $e(t, n) {
|
3510
|
-
const a = new An(-100, 100, 100, -100, 50, 3e3);
|
3511
|
-
return a.name = t, a.position.copy(n), a.lookAt(0, 0, 0), re.set(t, a), a;
|
3512
|
-
}
|
3513
|
-
$e("Top", new Z(0, 1e3, 0));
|
3514
|
-
$e("Bottom", new Z(0, -1e3, 0));
|
3515
|
-
$e("Left", new Z(-1e3, 0, 0));
|
3516
|
-
$e("Right", new Z(1e3, 0, 0));
|
3517
|
-
$e("Front", new Z(0, 0, 1e3));
|
3518
|
-
$e("Back", new Z(0, 0, -1e3));
|
3519
|
-
$e("Orthographic", new Z(1e3, 1e3, 1e3));
|
3520
|
-
const kt = new Gt(60, 1, 50, 3e3);
|
3521
|
-
kt.name = "Debug";
|
3522
|
-
kt.position.set(500, 500, 500);
|
3523
|
-
kt.lookAt(0, 0, 0);
|
3524
|
-
re.set("Debug", kt);
|
3525
|
-
const un = [
|
3526
|
-
"Renderer",
|
3527
|
-
"Depth",
|
3528
|
-
"Normals",
|
3529
|
-
"UVs",
|
3530
|
-
"Wireframe"
|
3531
|
-
], Di = new Ea(), Ii = new Ca(), Li = new di(), Ni = new xa({
|
3532
|
-
opacity: 0.33,
|
3533
|
-
transparent: !0,
|
3534
|
-
wireframe: !0
|
3535
|
-
});
|
3536
|
-
let Mt = "Renderer";
|
3537
|
-
const H = new kn();
|
3538
|
-
H.name = "Debug Scene";
|
3539
|
-
let Ee = new kn();
|
3540
|
-
H.add(Ee);
|
3541
|
-
const ht = new Sa();
|
3542
|
-
ht.name = "helpers";
|
3543
|
-
H.add(ht);
|
3544
|
-
const Fi = new ci();
|
3545
|
-
ht.add(Fi);
|
3546
|
-
const Yn = new _n(500);
|
3547
|
-
Yn.name = "axisHelper";
|
3548
|
-
ht.add(Yn);
|
3549
|
-
const ft = new _n(100);
|
3550
|
-
ft.name = "interactionHelper";
|
3551
|
-
ht.add(ft);
|
3552
|
-
ft.visible = !1;
|
3553
|
-
let Tt = !1, V = re.get("Debug"), ce = re.get("Orthographic"), Ne = re.get("Front"), Fe = re.get("Top"), dn = !1;
|
3554
|
-
function Qi(t) {
|
3555
|
-
const [n, a] = le(t.mode !== void 0 ? t.mode : "Single"), [e, r] = le(null), [s, h] = le(!1), [c, l] = le(!1), [d, b] = le(!1), [, m] = le(Date.now()), E = Ce(null), S = Ce(null), x = Ce(null), T = Ce(null), W = Ce(null), I = Ce(null), w = (f, v) => {
|
3556
|
-
const C = se.get(f.name);
|
3557
|
-
C !== void 0 && C.dispose(), se.delete(f.name);
|
3558
|
-
const A = ye.get(f.name);
|
3559
|
-
A !== void 0 && (H.remove(A), A.dispose()), ye.delete(f.name);
|
3560
|
-
const Y = new ji(f, v);
|
3561
|
-
switch (Y.enableDamping = !0, Y.dampingFactor = 0.05, f.name) {
|
3562
|
-
case "Top":
|
3563
|
-
case "Bottom":
|
3564
|
-
case "Left":
|
3565
|
-
case "Right":
|
3566
|
-
case "Front":
|
3567
|
-
case "Back":
|
3568
|
-
Y.enableRotate = !1;
|
3569
|
-
break;
|
3570
|
-
}
|
3571
|
-
if (se.set(f.name, Y), f instanceof Gt) {
|
3572
|
-
const z = new Ma(f);
|
3573
|
-
ye.set(f.name, z), H.add(z);
|
3574
|
-
}
|
3575
|
-
}, G = (f) => {
|
3576
|
-
const v = ye.get(f.name);
|
3577
|
-
v !== void 0 && (H.remove(v), v.dispose(), ye.delete(f.name));
|
3578
|
-
const C = se.get(f.name);
|
3579
|
-
C !== void 0 && (C.dispose(), se.delete(f.name));
|
3580
|
-
}, he = () => {
|
3581
|
-
se.forEach((f, v) => {
|
3582
|
-
f.dispose();
|
3583
|
-
const C = ye.get(v);
|
3584
|
-
C !== void 0 && (H.remove(C), C.dispose()), ye.delete(v), se.delete(v);
|
3585
|
-
}), se.clear(), ye.clear();
|
3586
|
-
}, te = () => {
|
3587
|
-
switch (n) {
|
3588
|
-
case "Single":
|
3589
|
-
w(V, x.current);
|
3590
|
-
break;
|
3591
|
-
case "Side by Side":
|
3592
|
-
case "Stacked":
|
3593
|
-
w(V, x.current), w(ce, T.current);
|
3594
|
-
break;
|
3595
|
-
case "Quad":
|
3596
|
-
w(V, x.current), w(ce, T.current), w(Ne, W.current), w(Fe, I.current);
|
3597
|
-
break;
|
3598
|
-
}
|
3599
|
-
};
|
3600
|
-
Be(() => {
|
3601
|
-
const f = new wa({
|
3602
|
-
canvas: E.current,
|
3603
|
-
stencil: !1
|
3604
|
-
});
|
3605
|
-
f.autoClear = !1, f.shadowMap.enabled = !0, f.setPixelRatio(devicePixelRatio), f.setClearColor(0), r(f);
|
3606
|
-
}, []), Be(() => {
|
3607
|
-
const f = (A) => {
|
3608
|
-
Ln(Ee), H.remove(Ee);
|
3609
|
-
const Y = t.scenes.get(A.value.name);
|
3610
|
-
if (Y !== void 0) {
|
3611
|
-
const z = new Y();
|
3612
|
-
t.onSceneSet !== void 0 && t.onSceneSet(z), Ee = z, t.three.scene = Ee, H.add(Ee), dn = !0;
|
3613
|
-
}
|
3614
|
-
}, v = (A) => {
|
3615
|
-
var B;
|
3616
|
-
const Y = A.value, z = (B = t.three.scene) == null ? void 0 : B.getObjectByProperty("uuid", Y.uuid);
|
3617
|
-
z !== void 0 && re.set(Y.name, z), m(Date.now());
|
3618
|
-
}, C = (A) => {
|
3619
|
-
re.delete(A.value.name), m(Date.now());
|
3620
|
-
};
|
3621
|
-
return _.addEventListener(j.SET_SCENE, f), _.addEventListener(j.ADD_CAMERA, v), _.addEventListener(j.REMOVE_CAMERA, C), () => {
|
3622
|
-
_.removeEventListener(j.SET_SCENE, f), _.removeEventListener(j.ADD_CAMERA, v), _.removeEventListener(j.REMOVE_CAMERA, C);
|
3623
|
-
};
|
3624
|
-
}, []), Be(() => {
|
3625
|
-
if (e === null)
|
3626
|
-
return;
|
3627
|
-
let f = window.innerWidth, v = window.innerHeight, C = Math.floor(f / 2), A = Math.floor(v / 2), Y = -1;
|
3628
|
-
const z = () => {
|
3629
|
-
f = window.innerWidth - 300, v = window.innerHeight, C = Math.floor(f / 2), A = Math.floor(v / 2), e.setSize(f, v);
|
3630
|
-
let R = f, U = v;
|
3631
|
-
switch (n) {
|
3632
|
-
case "Side by Side":
|
3633
|
-
R = C, U = v;
|
3634
|
-
break;
|
3635
|
-
case "Stacked":
|
3636
|
-
R = f, U = A;
|
3637
|
-
break;
|
3638
|
-
case "Quad":
|
3639
|
-
R = C, U = A;
|
3640
|
-
break;
|
3641
|
-
}
|
3642
|
-
re.forEach((Q) => {
|
3643
|
-
var fe;
|
3644
|
-
Q instanceof An ? (Q.left = R / -2, Q.right = R / 2, Q.top = U / 2, Q.bottom = U / -2, Q.updateProjectionMatrix()) : Q instanceof Gt && (Q.aspect = R / U, Q.updateProjectionMatrix(), (fe = ye.get(Q.name)) == null || fe.update());
|
3645
|
-
});
|
3646
|
-
}, B = () => {
|
3647
|
-
e.setViewport(0, 0, f, v), e.setScissor(0, 0, f, v), e.render(H, V);
|
3648
|
-
}, L = () => {
|
3649
|
-
if (n === "Side by Side")
|
3650
|
-
e.setViewport(0, 0, C, v), e.setScissor(0, 0, C, v), e.render(H, V), e.setViewport(C, 0, C, v), e.setScissor(C, 0, C, v), e.render(H, ce);
|
3651
|
-
else {
|
3652
|
-
const R = v - A;
|
3653
|
-
e.setViewport(0, R, f, A), e.setScissor(0, R, f, A), e.render(H, V), e.setViewport(0, 0, f, A), e.setScissor(0, 0, f, A), e.render(H, ce);
|
3654
|
-
}
|
3655
|
-
}, q = () => {
|
3656
|
-
let R = 0, U = 0;
|
3657
|
-
U = v - A, R = 0, e.setViewport(R, U, C, A), e.setScissor(R, U, C, A), e.render(H, V), R = C, e.setViewport(R, U, C, A), e.setScissor(R, U, C, A), e.render(H, ce), U = 0, R = 0, e.setViewport(R, U, C, A), e.setScissor(R, U, C, A), e.render(H, Ne), R = C, e.setViewport(R, U, C, A), e.setScissor(R, U, C, A), e.render(H, Fe);
|
3658
|
-
}, K = () => {
|
3659
|
-
switch (se.forEach((R) => {
|
3660
|
-
R.update();
|
3661
|
-
}), t.onSceneUpdate !== void 0 && dn && t.onSceneUpdate(Ee), e.clear(), n) {
|
3662
|
-
case "Single":
|
3663
|
-
B();
|
3664
|
-
break;
|
3665
|
-
case "Side by Side":
|
3666
|
-
case "Stacked":
|
3667
|
-
L();
|
3668
|
-
break;
|
3669
|
-
case "Quad":
|
3670
|
-
q();
|
3671
|
-
break;
|
3672
|
-
}
|
3673
|
-
Y = requestAnimationFrame(K);
|
3674
|
-
};
|
3675
|
-
return te(), window.addEventListener("resize", z), z(), K(), () => {
|
3676
|
-
window.removeEventListener("resize", z), cancelAnimationFrame(Y), Y = -1;
|
3677
|
-
};
|
3678
|
-
}, [n, e]), Be(() => {
|
3679
|
-
if (e !== null) {
|
3680
|
-
const f = new Oa(), v = new de(), C = (B, L, q, K) => {
|
3681
|
-
switch (n) {
|
3682
|
-
case "Quad":
|
3683
|
-
B < q ? L < K ? f.setFromCamera(v, V) : f.setFromCamera(v, Ne) : L < K ? f.setFromCamera(v, ce) : f.setFromCamera(v, Fe);
|
3684
|
-
break;
|
3685
|
-
case "Side by Side":
|
3686
|
-
B < q ? f.setFromCamera(v, V) : f.setFromCamera(v, ce);
|
3687
|
-
break;
|
3688
|
-
case "Single":
|
3689
|
-
f.setFromCamera(v, V);
|
3690
|
-
break;
|
3691
|
-
case "Stacked":
|
3692
|
-
L < K ? f.setFromCamera(v, V) : f.setFromCamera(v, ce);
|
3693
|
-
break;
|
3694
|
-
}
|
3695
|
-
}, A = (B) => {
|
3696
|
-
if (!Tt)
|
3697
|
-
return;
|
3698
|
-
const L = new de();
|
3699
|
-
e.getSize(L);
|
3700
|
-
const q = Math.min(B.clientX, L.x), K = Math.min(B.clientY, L.y);
|
3701
|
-
v.x = Ke(q, 0, L.x, -1, 1), v.y = Ke(K, 0, L.y, 1, -1);
|
3702
|
-
const R = L.x / 2, U = L.y / 2, Q = () => {
|
3703
|
-
q < R ? v.x = Ke(q, 0, R, -1, 1) : v.x = Ke(q, R, L.x, -1, 1);
|
3704
|
-
}, fe = () => {
|
3705
|
-
K < U ? v.y = Ke(K, 0, U, 1, -1) : v.y = Ke(K, U, L.y, 1, -1);
|
3706
|
-
};
|
3707
|
-
switch (n) {
|
3708
|
-
case "Quad":
|
3709
|
-
Q(), fe();
|
3710
|
-
break;
|
3711
|
-
case "Side by Side":
|
3712
|
-
Q();
|
3713
|
-
break;
|
3714
|
-
case "Stacked":
|
3715
|
-
fe(), fe();
|
3716
|
-
break;
|
3717
|
-
}
|
3718
|
-
C(q, K, R, U);
|
3719
|
-
const xe = f.intersectObjects(Ee.children);
|
3720
|
-
xe.length > 0 && ft.position.copy(xe[0].point);
|
3721
|
-
}, Y = (B) => {
|
3722
|
-
if (!Tt)
|
3723
|
-
return;
|
3724
|
-
const L = new de();
|
3725
|
-
if (e.getSize(L), B.clientX >= L.x)
|
3726
|
-
return;
|
3727
|
-
A(B);
|
3728
|
-
const q = f.intersectObjects(Ee.children);
|
3729
|
-
q.length > 0 && t.three.getObject(q[0].object.uuid);
|
3730
|
-
}, z = S.current;
|
3731
|
-
return z.addEventListener("mousemove", A, !1), z.addEventListener("click", Y, !1), () => {
|
3732
|
-
z.removeEventListener("mousemove", A), z.removeEventListener("click", Y);
|
3733
|
-
};
|
3734
|
-
}
|
3735
|
-
}, [n, e]);
|
3736
|
-
const ae = [];
|
3737
|
-
return re.forEach((f, v) => {
|
3738
|
-
ae.push(v);
|
3739
|
-
}), /* @__PURE__ */ u.jsxs("div", { className: "multiview", children: [
|
3740
|
-
/* @__PURE__ */ u.jsx("canvas", { ref: E }),
|
3741
|
-
/* @__PURE__ */ u.jsxs("div", { className: `cameras ${n === "Single" || n === "Stacked" ? "single" : ""}`, ref: S, children: [
|
3742
|
-
n === "Single" && /* @__PURE__ */ u.jsx(u.Fragment, { children: /* @__PURE__ */ u.jsx(Le, { camera: V, options: ae, ref: x, onSelect: (f) => {
|
3743
|
-
var C;
|
3744
|
-
(C = se.get(V.name)) == null || C.dispose();
|
3745
|
-
const v = re.get(f);
|
3746
|
-
v !== void 0 && (G(V), V = v, w(v, x.current));
|
3747
|
-
} }) }),
|
3748
|
-
(n === "Side by Side" || n === "Stacked") && /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
|
3749
|
-
/* @__PURE__ */ u.jsx(Le, { camera: V, options: ae, ref: x, onSelect: (f) => {
|
3750
|
-
var C;
|
3751
|
-
(C = se.get(V.name)) == null || C.dispose();
|
3752
|
-
const v = re.get(f);
|
3753
|
-
v !== void 0 && (G(V), V = v, w(v, x.current));
|
3754
|
-
} }),
|
3755
|
-
/* @__PURE__ */ u.jsx(Le, { camera: ce, options: ae, ref: T, onSelect: (f) => {
|
3756
|
-
var C;
|
3757
|
-
(C = se.get(ce.name)) == null || C.dispose();
|
3758
|
-
const v = re.get(f);
|
3759
|
-
v !== void 0 && (G(ce), ce = v, w(v, T.current));
|
3760
|
-
} })
|
3761
|
-
] }),
|
3762
|
-
n === "Quad" && /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
|
3763
|
-
/* @__PURE__ */ u.jsx(Le, { camera: V, options: ae, ref: x, onSelect: (f) => {
|
3764
|
-
var C;
|
3765
|
-
(C = se.get(V.name)) == null || C.dispose();
|
3766
|
-
const v = re.get(f);
|
3767
|
-
v !== void 0 && (G(V), V = v, w(v, x.current));
|
3768
|
-
} }),
|
3769
|
-
/* @__PURE__ */ u.jsx(Le, { camera: ce, options: ae, ref: T, onSelect: (f) => {
|
3770
|
-
var C;
|
3771
|
-
(C = se.get(ce.name)) == null || C.dispose();
|
3772
|
-
const v = re.get(f);
|
3773
|
-
v !== void 0 && (G(ce), ce = v, w(v, T.current));
|
3774
|
-
} }),
|
3775
|
-
/* @__PURE__ */ u.jsx(Le, { camera: Ne, options: ae, ref: W, onSelect: (f) => {
|
3776
|
-
var C;
|
3777
|
-
(C = se.get(Ne.name)) == null || C.dispose();
|
3778
|
-
const v = re.get(f);
|
3779
|
-
v !== void 0 && (G(Ne), Ne = v, w(v, W.current));
|
3780
|
-
} }),
|
3781
|
-
/* @__PURE__ */ u.jsx(Le, { camera: Fe, options: ae, ref: I, onSelect: (f) => {
|
3782
|
-
var C;
|
3783
|
-
(C = se.get(Fe.name)) == null || C.dispose();
|
3784
|
-
const v = re.get(f);
|
3785
|
-
v !== void 0 && (G(Fe), Fe = v, w(v, I.current));
|
3786
|
-
} })
|
3787
|
-
] })
|
3788
|
-
] }),
|
3789
|
-
/* @__PURE__ */ u.jsxs("div", { className: "settings", children: [
|
3790
|
-
/* @__PURE__ */ u.jsx(
|
3791
|
-
Rt,
|
3792
|
-
{
|
3793
|
-
index: ln.indexOf(n),
|
3794
|
-
options: ln,
|
3795
|
-
onSelect: (f) => {
|
3796
|
-
f !== n && (he(), a(f));
|
3797
|
-
},
|
3798
|
-
open: s,
|
3799
|
-
onToggle: (f) => {
|
3800
|
-
h(f), c && l(!1), d && b(!1);
|
3801
|
-
}
|
3802
|
-
}
|
3803
|
-
),
|
3804
|
-
/* @__PURE__ */ u.jsx(
|
3805
|
-
Rt,
|
3806
|
-
{
|
3807
|
-
index: un.indexOf(Mt),
|
3808
|
-
options: un,
|
3809
|
-
onSelect: (f) => {
|
3810
|
-
if (f !== Mt)
|
3811
|
-
switch (Mt = f, Mt) {
|
3812
|
-
case "Depth":
|
3813
|
-
H.overrideMaterial = Di;
|
3814
|
-
break;
|
3815
|
-
case "Normals":
|
3816
|
-
H.overrideMaterial = Ii;
|
3817
|
-
break;
|
3818
|
-
default:
|
3819
|
-
case "Renderer":
|
3820
|
-
H.overrideMaterial = null;
|
3821
|
-
break;
|
3822
|
-
case "Wireframe":
|
3823
|
-
H.overrideMaterial = Ni;
|
3824
|
-
break;
|
3825
|
-
case "UVs":
|
3826
|
-
H.overrideMaterial = Li;
|
3827
|
-
break;
|
3828
|
-
}
|
3829
|
-
},
|
3830
|
-
open: c,
|
3831
|
-
onToggle: (f) => {
|
3832
|
-
s && h(!1), l(f), d && b(!1);
|
3833
|
-
}
|
3834
|
-
}
|
3835
|
-
),
|
3836
|
-
/* @__PURE__ */ u.jsx(
|
3837
|
-
Rt,
|
3838
|
-
{
|
3839
|
-
index: 0,
|
3840
|
-
options: [
|
3841
|
-
"Orbit Mode",
|
3842
|
-
"Selection Mode"
|
3843
|
-
],
|
3844
|
-
onSelect: (f) => {
|
3845
|
-
Tt = f === "Selection Mode", ft.visible = Tt;
|
3846
|
-
},
|
3847
|
-
open: d,
|
3848
|
-
onToggle: (f) => {
|
3849
|
-
s && h(!1), c && l(!1), b(f);
|
3850
|
-
}
|
3851
|
-
}
|
3852
|
-
)
|
3853
|
-
] })
|
3854
|
-
] });
|
3855
|
-
}
|
3856
|
-
function er(t) {
|
3857
|
-
return /* @__PURE__ */ u.jsxs("div", { className: "editor", ref: t.ref, style: t.style, children: [
|
3858
|
-
/* @__PURE__ */ u.jsx("header", { children: t.header }),
|
3859
|
-
t.children,
|
3860
|
-
/* @__PURE__ */ u.jsx("footer", { children: t.footer })
|
3861
|
-
] });
|
3862
|
-
}
|
3863
|
-
export {
|
3864
|
-
qt as Accordion,
|
3865
|
-
Ki as Application,
|
3866
|
-
At as BaseRemote,
|
3867
|
-
$n as ChildObject,
|
3868
|
-
fi as ContainerObject,
|
3869
|
-
ni as Draggable,
|
3870
|
-
ti as DraggableItem,
|
3871
|
-
ai as Dropdown,
|
3872
|
-
ii as DropdownItem,
|
3873
|
-
er as Editor,
|
3874
|
-
ci as InfiniteGridHelper,
|
3875
|
-
ki as Inspector,
|
3876
|
-
Qi as MultiView,
|
3877
|
-
Un as NavButton,
|
3878
|
-
Fa as RemoteComponents,
|
3879
|
-
Xi as RemoteController,
|
3880
|
-
Ze as RemoteTheatre,
|
3881
|
-
Wa as RemoteThree,
|
3882
|
-
Bn as RemoteTweakpane,
|
3883
|
-
Ji as SceneInspector,
|
3884
|
-
Zi as SidePanel,
|
3885
|
-
j as ToolEvents,
|
3886
|
-
di as UVMaterial,
|
3887
|
-
dt as capitalize,
|
3888
|
-
Hi as clamp,
|
3889
|
-
Ia as colorToHex,
|
3890
|
-
_ as debugDispatcher,
|
3891
|
-
Ln as dispose,
|
3892
|
-
Na as disposeMaterial,
|
3893
|
-
qi as disposeTexture,
|
3894
|
-
Wi as distance,
|
3895
|
-
In as hierarchyUUID,
|
3896
|
-
Da as isColor,
|
3897
|
-
ja as randomID,
|
3898
|
-
La as resetThreeObjects,
|
3899
|
-
Ut as round,
|
3900
|
-
Vt as totalThreeObjects
|
3901
|
-
};
|