@figurosity/consumer-three-dimension-tool 0.1.0 → 0.2.0
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/consumer-three-dimension-tool.js +1238 -1130
- package/package.json +1 -1
|
@@ -1,51 +1,52 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".tool-reset-button .qbtn{color:#333;font-weight:700}.debug-color{max-width:100px}.debug-color .swatch{height:20px;width:20px;border-radius:10px;border:1px solid #333}.debug-color .label{font-weight:700}.debug-value span{margin-top:2px;min-width:60px;font-size:11px}.debug-vector{min-width:130px}.debug-vector>div{font-size:10px}.debug-vector>div>span{min-width:20px;font-weight:700}.debug-boolean .indicator{margin-top:6px;margin-right:4px;height:10px;width:10px;border-radius:10px;border:1px solid #333;display:inline-block;background:red}.debug-boolean .indicator.on{background:#adff2f}.debug3D{position:absolute;z-index:14400;top:20px;left:40px;padding:20px;border:1px solid #ccc;border-radius:10px;background-color:#ffffffb3}.debug3D .color-square{display:inline-block;height:15px;width:15px;margin-bottom:-3px;border:1px dotted black}.three-dimension-tool{position:fixed;top:0;left:0;right:0;bottom:0;z-index:100}.three-dimension-tool .tres{width:100%;height:100vh}")),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
|
|
2
|
-
import { nextTick as Ht, watch as
|
|
3
|
-
import { Platform as ft, useQuasar as
|
|
4
|
-
import { CBaseButton as
|
|
5
|
-
import { defineStore as
|
|
6
|
-
import * as
|
|
2
|
+
import { nextTick as Ht, watch as O, ref as ee, onUnmounted as Rt, computed as v, onMounted as Xt, openBlock as Je, createElementBlock as Yt, createCommentVNode as ht, createElementVNode as Qt, onBeforeMount as Wt, defineComponent as $, h, inject as Jt, useModel as eo, onBeforeUnmount as to, createBlock as it, unref as at, withCtx as ct, createVNode as oo, mergeModels as so } from "vue";
|
|
3
|
+
import { Platform as ft, useQuasar as no, QBtn as Ot, QSeparator as Fe } from "quasar";
|
|
4
|
+
import { CBaseButton as ne, CColorPickerPopup as qt, CExpansion as rt, CToggle as Ke, CSlider as dt, CDraggableDrawer as Qe, CBaseButtons as ro, CDraggableDrawers as lo, CToolPage as io } from "@figurosity/consumer-controls";
|
|
5
|
+
import { defineStore as de, storeToRefs as I, getActivePinia as ao } from "pinia";
|
|
6
|
+
import * as M from "three";
|
|
7
7
|
import tt from "lodash.isequal";
|
|
8
8
|
import "three/examples/jsm/loaders/RGBELoader.js";
|
|
9
|
-
import { DEFAULT as ot, COLORS as
|
|
10
|
-
import { OrbitControls as
|
|
11
|
-
import { mergeVertices as Bt, mergeGeometries as
|
|
12
|
-
import { RoundedBoxGeometry as
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
import { DEFAULT as ot, COLORS as oe, GRID as xe, LIGHTS as ve, RELATED as we } from "@figurosity/toolbox";
|
|
10
|
+
import { OrbitControls as co } from "three/examples/jsm/controls/OrbitControls.js";
|
|
11
|
+
import { mergeVertices as Bt, mergeGeometries as uo } from "three/examples/jsm/utils/BufferGeometryUtils.js";
|
|
12
|
+
import { RoundedBoxGeometry as po } from "three/examples/jsm/geometries/RoundedBoxGeometry.js";
|
|
13
|
+
import { GLTFLoader as mo } from "three/examples/jsm/loaders/GLTFLoader.js";
|
|
14
|
+
import { DRACOLoader as ho } from "three/examples/jsm/loaders/DRACOLoader.js";
|
|
15
|
+
function be(e) {
|
|
16
|
+
const t = e.startsWith("#") ? e.slice(1) : e;
|
|
17
|
+
return parseInt(t, 16);
|
|
17
18
|
}
|
|
18
|
-
function
|
|
19
|
+
function ce(e) {
|
|
19
20
|
return `#${e.toString(16).padStart(6, "0")}`;
|
|
20
21
|
}
|
|
21
|
-
const ut = new
|
|
22
|
-
const
|
|
23
|
-
console.log("box",
|
|
24
|
-
const
|
|
25
|
-
(
|
|
26
|
-
(
|
|
27
|
-
(
|
|
22
|
+
const ut = new M.Vector3(), Mt = (e) => {
|
|
23
|
+
const t = new M.Box3().setFromObject(e);
|
|
24
|
+
console.log("box", t);
|
|
25
|
+
const o = t.getSize(new M.Vector3()), s = new M.Vector3(
|
|
26
|
+
(t.min.x + t.max.x) / 2,
|
|
27
|
+
(t.min.y + t.max.y) / 2,
|
|
28
|
+
(t.min.z + t.max.z) / 2
|
|
28
29
|
);
|
|
29
30
|
console.log("center", s);
|
|
30
|
-
let n =
|
|
31
|
-
return console.log("bottom", n), Math.abs(n) < -0.01 && (n =
|
|
32
|
-
box:
|
|
33
|
-
size:
|
|
31
|
+
let n = t.min.y;
|
|
32
|
+
return console.log("bottom", n), Math.abs(n) < -0.01 && (n = fo(e)), console.log("bottom", n), {
|
|
33
|
+
box: t,
|
|
34
|
+
size: o,
|
|
34
35
|
center: s,
|
|
35
36
|
bottom: n,
|
|
36
|
-
top:
|
|
37
|
+
top: t.max.y
|
|
37
38
|
};
|
|
38
|
-
},
|
|
39
|
-
let
|
|
40
|
-
return e.updateMatrixWorld(!0), e.traverse((
|
|
39
|
+
}, fo = (e) => {
|
|
40
|
+
let t = 1 / 0;
|
|
41
|
+
return e.updateMatrixWorld(!0), e.traverse((o) => {
|
|
41
42
|
var n, r;
|
|
42
|
-
if (!
|
|
43
|
-
const s = (r = (n =
|
|
43
|
+
if (!o.isMesh) return;
|
|
44
|
+
const s = (r = (n = o.geometry) == null ? void 0 : n.attributes) == null ? void 0 : r.position;
|
|
44
45
|
if (s)
|
|
45
46
|
for (let l = 0; l < s.count; l++)
|
|
46
|
-
ut.fromBufferAttribute(s, l), ut.applyMatrix4(
|
|
47
|
-
}),
|
|
48
|
-
},
|
|
47
|
+
ut.fromBufferAttribute(s, l), ut.applyMatrix4(o.matrixWorld), t = Math.min(t, ut.y);
|
|
48
|
+
}), t;
|
|
49
|
+
}, _t = (e) => ({
|
|
49
50
|
box: {
|
|
50
51
|
min: {
|
|
51
52
|
x: e.box.min.x,
|
|
@@ -70,7 +71,7 @@ const ut = new S.Vector3(), Dt = (e) => {
|
|
|
70
71
|
},
|
|
71
72
|
bottom: e.bottom,
|
|
72
73
|
top: e.top
|
|
73
|
-
}), go = [
|
|
74
|
+
}), go = "smooth", vo = [
|
|
74
75
|
"#141111",
|
|
75
76
|
"#3E251E",
|
|
76
77
|
"#633C30",
|
|
@@ -111,28 +112,31 @@ const ut = new S.Vector3(), Dt = (e) => {
|
|
|
111
112
|
"#BDACA8",
|
|
112
113
|
"#DACDC9",
|
|
113
114
|
"#E5E4E3"
|
|
114
|
-
],
|
|
115
|
+
], bo = (e) => ({
|
|
116
|
+
id: e.id,
|
|
117
|
+
uuid: e.uuid ?? null,
|
|
118
|
+
basePoseId: e.basePoseId ?? null,
|
|
119
|
+
skinId: e.skinId ?? null,
|
|
120
|
+
poseId: e.poseId ?? null,
|
|
121
|
+
url: e.glbPathWebp || e.glbPath || null,
|
|
122
|
+
color: e.color ?? 16777215,
|
|
123
|
+
bounds: e.bounds ?? null
|
|
124
|
+
}), ye = de("3d-glbs", {
|
|
115
125
|
state: () => ({
|
|
116
126
|
models: {},
|
|
117
|
-
|
|
118
|
-
palette: go
|
|
127
|
+
palette: vo
|
|
119
128
|
}),
|
|
120
129
|
getters: {
|
|
121
|
-
changed(e) {
|
|
122
|
-
var s, n, r, l, i;
|
|
123
|
-
const t = b().selected;
|
|
124
|
-
return console.log("fbx model", (s = e.models) == null ? void 0 : s[t]), (r = (n = e.models) == null ? void 0 : n[t]) != null && r.color ? ((i = (l = e.models) == null ? void 0 : l[t]) == null ? void 0 : i.color) !== 16777215 : !1;
|
|
125
|
-
},
|
|
126
130
|
selectedId() {
|
|
127
|
-
return
|
|
131
|
+
return p().selected;
|
|
128
132
|
},
|
|
129
133
|
poseId(e) {
|
|
130
|
-
var
|
|
131
|
-
const t =
|
|
132
|
-
return (
|
|
134
|
+
var o, s;
|
|
135
|
+
const t = p().selected;
|
|
136
|
+
return (s = (o = e.models) == null ? void 0 : o[t]) == null ? void 0 : s.poseId;
|
|
133
137
|
},
|
|
134
138
|
model(e) {
|
|
135
|
-
const t =
|
|
139
|
+
const t = p().selected;
|
|
136
140
|
return t && e.models[t] ? e.models[t] : null;
|
|
137
141
|
},
|
|
138
142
|
url() {
|
|
@@ -149,63 +153,84 @@ const ut = new S.Vector3(), Dt = (e) => {
|
|
|
149
153
|
},
|
|
150
154
|
colorHex() {
|
|
151
155
|
var e;
|
|
152
|
-
return (e = this.model) != null && e.color ?
|
|
156
|
+
return (e = this.model) != null && e.color ? ce(this.model.color) : "#fefefe";
|
|
157
|
+
},
|
|
158
|
+
changed(e) {
|
|
159
|
+
var o, s, n, r;
|
|
160
|
+
const t = p().selected;
|
|
161
|
+
return (s = (o = e.models) == null ? void 0 : o[t]) != null && s.color ? ((r = (n = e.models) == null ? void 0 : n[t]) == null ? void 0 : r.color) !== 16777215 : !1;
|
|
153
162
|
}
|
|
154
163
|
},
|
|
155
164
|
actions: {
|
|
156
165
|
resetColor() {
|
|
157
|
-
const
|
|
158
|
-
this.models[
|
|
166
|
+
const e = p().selected;
|
|
167
|
+
this.models[e] && (this.models[e].color = 16777215);
|
|
159
168
|
},
|
|
160
169
|
setBounds(e) {
|
|
161
|
-
const t =
|
|
162
|
-
this.models[t].bounds =
|
|
163
|
-
},
|
|
164
|
-
setSubjectsFromResponse(e) {
|
|
165
|
-
const o = e.entities.fbx;
|
|
166
|
-
this.models = { ...this.models, ...o };
|
|
170
|
+
const t = p().selected;
|
|
171
|
+
this.models[t] && (this.models[t].bounds = _t(e));
|
|
167
172
|
},
|
|
168
173
|
setColorHex(e) {
|
|
169
|
-
const t =
|
|
170
|
-
this.models[t].color =
|
|
174
|
+
const t = p().selected;
|
|
175
|
+
this.models[t] && (this.models[t].color = be(e));
|
|
176
|
+
},
|
|
177
|
+
setSubjectsFromResponse(e) {
|
|
178
|
+
var s;
|
|
179
|
+
const t = ((s = e == null ? void 0 : e.entities) == null ? void 0 : s.glb) || {}, o = {};
|
|
180
|
+
return Object.keys(t).forEach((n) => {
|
|
181
|
+
o[n] = bo(t[n]);
|
|
182
|
+
}), this.models = { ...this.models, ...o }, this.selectDefaultGlbId(e);
|
|
183
|
+
},
|
|
184
|
+
// Picks the GLB id whose skin slug matches DEFAULT_SKIN_SLUG, falls
|
|
185
|
+
// back to result.glb[0], or null when no GLBs are available.
|
|
186
|
+
selectDefaultGlbId(e) {
|
|
187
|
+
var l, a, c;
|
|
188
|
+
const t = Array.isArray((l = e == null ? void 0 : e.result) == null ? void 0 : l.glb) ? e.result.glb : [];
|
|
189
|
+
if (t.length === 0) return null;
|
|
190
|
+
const o = ((a = e == null ? void 0 : e.entities) == null ? void 0 : a.skins) || {}, s = ((c = e == null ? void 0 : e.entities) == null ? void 0 : c.glb) || {}, r = t.find((u) => {
|
|
191
|
+
var b, f;
|
|
192
|
+
const g = (b = s[u]) == null ? void 0 : b.skinId;
|
|
193
|
+
return g != null && ((f = o[g]) == null ? void 0 : f.slug) === go;
|
|
194
|
+
}) ?? t[0];
|
|
195
|
+
return typeof r == "string" ? parseInt(r, 10) : r;
|
|
171
196
|
}
|
|
172
197
|
}
|
|
173
|
-
}),
|
|
198
|
+
}), gt = { visible: !0, opacity: 1, color: 16711422, texture: "none" }, kt = (e = {}) => ({ ...gt, ...e }), Ve = de("3d-ground", {
|
|
174
199
|
state: () => ({
|
|
175
200
|
models: {},
|
|
176
201
|
offset: -0.75
|
|
177
202
|
}),
|
|
178
203
|
getters: {
|
|
179
204
|
changed(e) {
|
|
180
|
-
var
|
|
181
|
-
const
|
|
182
|
-
return ((s = (
|
|
205
|
+
var o, s;
|
|
206
|
+
const t = p().selected;
|
|
207
|
+
return ((s = (o = e.models) == null ? void 0 : o[t]) == null ? void 0 : s.color) !== 16711422;
|
|
183
208
|
},
|
|
184
209
|
property() {
|
|
185
|
-
return (e,
|
|
186
|
-
var
|
|
187
|
-
return ((
|
|
210
|
+
return (e, t = null) => {
|
|
211
|
+
var o;
|
|
212
|
+
return ((o = this.selectedModel) == null ? void 0 : o[e]) ?? t;
|
|
188
213
|
};
|
|
189
214
|
},
|
|
190
215
|
selectedId() {
|
|
191
|
-
return
|
|
216
|
+
return p().selected;
|
|
192
217
|
},
|
|
193
218
|
selectedModel(e) {
|
|
194
|
-
const
|
|
195
|
-
return e.models[
|
|
219
|
+
const t = this.selectedId;
|
|
220
|
+
return e.models[t] ?? null;
|
|
196
221
|
},
|
|
197
222
|
mergedModel() {
|
|
198
|
-
return { ...
|
|
223
|
+
return { ...gt, ...this.selectedModel ?? {} };
|
|
199
224
|
},
|
|
200
225
|
model(e) {
|
|
201
|
-
const
|
|
202
|
-
return
|
|
226
|
+
const o = p().selected;
|
|
227
|
+
return o && e.models[o] ? e.models[o] : null;
|
|
203
228
|
},
|
|
204
229
|
color() {
|
|
205
230
|
return this.mergedModel.color;
|
|
206
231
|
},
|
|
207
232
|
colorHex() {
|
|
208
|
-
return
|
|
233
|
+
return ce(this.mergedModel.color);
|
|
209
234
|
},
|
|
210
235
|
opacity() {
|
|
211
236
|
return this.mergedModel.opacity;
|
|
@@ -219,26 +244,26 @@ const ut = new S.Vector3(), Dt = (e) => {
|
|
|
219
244
|
},
|
|
220
245
|
actions: {
|
|
221
246
|
reset() {
|
|
222
|
-
const e =
|
|
223
|
-
this.models[e] =
|
|
247
|
+
const e = p().selected;
|
|
248
|
+
this.models[e] = kt();
|
|
224
249
|
},
|
|
225
250
|
ensureSelectedModel() {
|
|
226
|
-
const e =
|
|
227
|
-
return this.models[e] || (this.models[e] = { ...
|
|
251
|
+
const e = p().selected;
|
|
252
|
+
return this.models[e] || (this.models[e] = { ...gt }), this.models[e];
|
|
228
253
|
},
|
|
229
254
|
patchSelected(e) {
|
|
230
|
-
const o = this.ensureSelectedModel();
|
|
231
|
-
Object.assign(o, e);
|
|
232
|
-
},
|
|
233
|
-
setProperty(e, o) {
|
|
234
255
|
const t = this.ensureSelectedModel();
|
|
235
|
-
t
|
|
256
|
+
Object.assign(t, e);
|
|
257
|
+
},
|
|
258
|
+
setProperty(e, t) {
|
|
259
|
+
const o = this.ensureSelectedModel();
|
|
260
|
+
o[e] = t;
|
|
236
261
|
},
|
|
237
262
|
setColor(e) {
|
|
238
263
|
this.setProperty("color", e);
|
|
239
264
|
},
|
|
240
265
|
setColorHex(e) {
|
|
241
|
-
this.setProperty("color",
|
|
266
|
+
this.setProperty("color", be(e));
|
|
242
267
|
},
|
|
243
268
|
setTexture(e) {
|
|
244
269
|
this.setProperty("texture", e);
|
|
@@ -247,23 +272,23 @@ const ut = new S.Vector3(), Dt = (e) => {
|
|
|
247
272
|
this.setProperty("visible", e);
|
|
248
273
|
},
|
|
249
274
|
setGroundFromResponse(e) {
|
|
250
|
-
this.models[e] || (this.models[e] =
|
|
275
|
+
this.models[e] || (this.models[e] = kt());
|
|
251
276
|
}
|
|
252
277
|
}
|
|
253
|
-
}),
|
|
278
|
+
}), Xe = {
|
|
254
279
|
color: 16777215,
|
|
255
280
|
visible: !0,
|
|
256
281
|
debug: !1,
|
|
257
282
|
shadow: !0,
|
|
258
283
|
opacity: 1,
|
|
259
284
|
visualization: !0
|
|
260
|
-
}, pt = (e = {}) => ({ ...
|
|
285
|
+
}, pt = (e = {}) => ({ ...Xe, ...e }), ge = {
|
|
261
286
|
advanced: !1,
|
|
262
287
|
move: !1,
|
|
263
288
|
position: { x: 0, y: 0, z: 1.5 },
|
|
264
289
|
quaternion: { x: 0, y: 0, z: 0, w: 1 },
|
|
265
290
|
target: { x: 0, y: 0, z: 0 }
|
|
266
|
-
}, Et = (e = {}) => ({ ...
|
|
291
|
+
}, Et = (e = {}) => ({ ...ge, ...e }), Be = de("3d-lights", {
|
|
267
292
|
state: () => ({
|
|
268
293
|
lights: {},
|
|
269
294
|
options: {},
|
|
@@ -272,81 +297,81 @@ const ut = new S.Vector3(), Dt = (e) => {
|
|
|
272
297
|
}),
|
|
273
298
|
getters: {
|
|
274
299
|
changed(e) {
|
|
275
|
-
const
|
|
276
|
-
key: { ...
|
|
277
|
-
fill: { ...
|
|
278
|
-
back: { ...
|
|
279
|
-
}, r = !tt(e.lights[
|
|
300
|
+
const o = p().selected, s = !tt(e.options[o], ge), n = {
|
|
301
|
+
key: { ...Xe },
|
|
302
|
+
fill: { ...Xe },
|
|
303
|
+
back: { ...Xe }
|
|
304
|
+
}, r = !tt(e.lights[o], n);
|
|
280
305
|
return s || r;
|
|
281
306
|
},
|
|
282
307
|
move(e) {
|
|
283
308
|
var s;
|
|
284
|
-
const
|
|
285
|
-
return ((s = e.options[
|
|
309
|
+
const o = p().selected;
|
|
310
|
+
return ((s = e.options[o]) == null ? void 0 : s.move) || !1;
|
|
286
311
|
},
|
|
287
312
|
advancedMode(e) {
|
|
288
313
|
var s;
|
|
289
|
-
const
|
|
290
|
-
return ((s = e.options[
|
|
314
|
+
const o = p().selected;
|
|
315
|
+
return ((s = e.options[o]) == null ? void 0 : s.advanced) || !1;
|
|
291
316
|
},
|
|
292
317
|
position(e) {
|
|
293
318
|
var s;
|
|
294
|
-
const
|
|
295
|
-
return ((s = e.options[
|
|
319
|
+
const o = p().selected;
|
|
320
|
+
return ((s = e.options[o]) == null ? void 0 : s.position) || ge.position;
|
|
296
321
|
},
|
|
297
322
|
quaternion(e) {
|
|
298
323
|
var s;
|
|
299
|
-
const
|
|
300
|
-
return ((s = e.options[
|
|
324
|
+
const o = p().selected;
|
|
325
|
+
return ((s = e.options[o]) == null ? void 0 : s.quaternion) || ge.quaternion;
|
|
301
326
|
},
|
|
302
327
|
target(e) {
|
|
303
328
|
var s;
|
|
304
|
-
const
|
|
305
|
-
return ((s = e.options[
|
|
329
|
+
const o = p().selected;
|
|
330
|
+
return ((s = e.options[o]) == null ? void 0 : s.target) || ge.target;
|
|
306
331
|
},
|
|
307
332
|
radius(e) {
|
|
308
333
|
var s;
|
|
309
|
-
const
|
|
310
|
-
return ((s = e.options[
|
|
334
|
+
const o = p().selected;
|
|
335
|
+
return ((s = e.options[o]) == null ? void 0 : s.radius) || ge.radius;
|
|
311
336
|
},
|
|
312
337
|
property(e) {
|
|
313
|
-
return (
|
|
314
|
-
const r =
|
|
315
|
-
return !e.lights[r] || !e.lights[r][
|
|
338
|
+
return (t, o = null, s = null) => {
|
|
339
|
+
const r = p().selected;
|
|
340
|
+
return !e.lights[r] || !e.lights[r][t] || !(o in e.lights[r][t]) ? s : e.lights[r][t][o];
|
|
316
341
|
};
|
|
317
342
|
},
|
|
318
343
|
colorHex(e) {
|
|
319
|
-
return (
|
|
320
|
-
const s =
|
|
321
|
-
return !e.lights[s] || !e.lights[s][
|
|
344
|
+
return (t) => {
|
|
345
|
+
const s = p().selected;
|
|
346
|
+
return !e.lights[s] || !e.lights[s][t] ? "#ffffff" : ce(e.lights[s][t].color);
|
|
322
347
|
};
|
|
323
348
|
},
|
|
324
349
|
lightKeys(e) {
|
|
325
|
-
const
|
|
326
|
-
return Object.keys(e.lights[
|
|
350
|
+
const o = p().selected;
|
|
351
|
+
return Object.keys(e.lights[o]);
|
|
327
352
|
},
|
|
328
353
|
isVisible(e) {
|
|
329
|
-
return (
|
|
354
|
+
return (t) => e.move && (this.advancedMode === !0 && this.property(t, "visible") || t === "key");
|
|
330
355
|
}
|
|
331
356
|
},
|
|
332
357
|
actions: {
|
|
333
358
|
reset() {
|
|
334
|
-
const e =
|
|
335
|
-
this.options[e] = { ...
|
|
336
|
-
(
|
|
359
|
+
const e = p().selected;
|
|
360
|
+
this.options[e] = { ...ge }, this.collection.forEach(
|
|
361
|
+
(t) => this.lights[e][t] = { ...Xe }
|
|
337
362
|
);
|
|
338
363
|
},
|
|
339
364
|
ensureSelectedOptions() {
|
|
340
|
-
const e =
|
|
341
|
-
return this.options[e] || (this.options[e] = { ...
|
|
365
|
+
const e = p().selected;
|
|
366
|
+
return this.options[e] || (this.options[e] = { ...ge }), this.options[e];
|
|
342
367
|
},
|
|
343
368
|
patchSelected(e) {
|
|
344
|
-
const o = this.ensureSelectedOptions();
|
|
345
|
-
Object.assign(o, e);
|
|
346
|
-
},
|
|
347
|
-
setControlProperty(e, o) {
|
|
348
369
|
const t = this.ensureSelectedOptions();
|
|
349
|
-
t
|
|
370
|
+
Object.assign(t, e);
|
|
371
|
+
},
|
|
372
|
+
setControlProperty(e, t) {
|
|
373
|
+
const o = this.ensureSelectedOptions();
|
|
374
|
+
o[e] = t;
|
|
350
375
|
},
|
|
351
376
|
setPosition(e) {
|
|
352
377
|
this.setControlProperty("position", e);
|
|
@@ -361,48 +386,48 @@ const ut = new S.Vector3(), Dt = (e) => {
|
|
|
361
386
|
this.setControlProperty("radius", e);
|
|
362
387
|
},
|
|
363
388
|
setMove(e = !1) {
|
|
364
|
-
const
|
|
365
|
-
this.options[
|
|
389
|
+
const o = p().selected;
|
|
390
|
+
this.options[o].move = e;
|
|
366
391
|
},
|
|
367
392
|
setAdvanced(e = !1) {
|
|
368
|
-
const
|
|
393
|
+
const o = p().selected;
|
|
369
394
|
if (e === !0) {
|
|
370
|
-
this.options[
|
|
395
|
+
this.options[o].advanced = !0;
|
|
371
396
|
return;
|
|
372
397
|
}
|
|
373
|
-
this.options[
|
|
374
|
-
const s = this.lights[
|
|
398
|
+
this.options[o].advanced = !1;
|
|
399
|
+
const s = this.lights[o].key;
|
|
375
400
|
this.lightKeys.forEach((n) => {
|
|
376
|
-
n !== "key" && (this.lights[
|
|
401
|
+
n !== "key" && (this.lights[o][n].color = s.color);
|
|
377
402
|
});
|
|
378
403
|
},
|
|
379
|
-
setControlOptions(e,
|
|
380
|
-
|
|
381
|
-
const s = e.position.clone(), n = e.quaternion.clone(), r =
|
|
382
|
-
this.options[
|
|
404
|
+
setControlOptions(e, t, o = null) {
|
|
405
|
+
o === null && (o = p().selected), this.options[o] || (this.options[o] = Et());
|
|
406
|
+
const s = e.position.clone(), n = e.quaternion.clone(), r = t.target.clone();
|
|
407
|
+
this.options[o].position = { x: s.x, y: s.y, z: s.z }, this.options[o].quaternion = { x: n.x, y: n.y, z: n.z, w: n.w }, this.options[o].target = { x: r.x, y: r.y, z: r.z };
|
|
383
408
|
},
|
|
384
|
-
setColorHex(e,
|
|
409
|
+
setColorHex(e, t) {
|
|
385
410
|
var l;
|
|
386
|
-
const s =
|
|
411
|
+
const s = p().selected, n = this.lights[s], r = be(t);
|
|
387
412
|
if (((l = this.options[s]) == null ? void 0 : l.advanced) === !0) {
|
|
388
413
|
n[e].color = r;
|
|
389
414
|
return;
|
|
390
415
|
}
|
|
391
|
-
this.collection.forEach((
|
|
392
|
-
n[
|
|
416
|
+
this.collection.forEach((a) => {
|
|
417
|
+
n[a].color = r;
|
|
393
418
|
});
|
|
394
419
|
},
|
|
395
|
-
setProperty(e,
|
|
396
|
-
const n =
|
|
397
|
-
this.lights[n][e][
|
|
420
|
+
setProperty(e, t, o) {
|
|
421
|
+
const n = p().selected;
|
|
422
|
+
this.lights[n][e][t] = o;
|
|
398
423
|
},
|
|
399
424
|
initLights() {
|
|
400
|
-
const
|
|
401
|
-
this.lights[
|
|
425
|
+
const t = p().selected;
|
|
426
|
+
this.lights[t] || (this.lights[t] = {
|
|
402
427
|
key: pt(),
|
|
403
428
|
fill: pt({ shadow: !0 }),
|
|
404
429
|
back: pt({ shadow: !0 })
|
|
405
|
-
}), this.options[
|
|
430
|
+
}), this.options[t] || (this.options[t] = Et());
|
|
406
431
|
}
|
|
407
432
|
}
|
|
408
433
|
}), Ye = {
|
|
@@ -410,28 +435,28 @@ const ut = new S.Vector3(), Dt = (e) => {
|
|
|
410
435
|
quaternion: { x: -0.12993279108591813, y: 0, z: 0, w: 0.9915228034698058 },
|
|
411
436
|
target: { x: 0, y: 0, z: 0 },
|
|
412
437
|
radius: 1.5
|
|
413
|
-
},
|
|
438
|
+
}, At = (e = {}) => ({ ...Ye, ...e }), Ct = de("3d-controls", {
|
|
414
439
|
state: () => ({
|
|
415
440
|
models: {}
|
|
416
441
|
}),
|
|
417
442
|
getters: {
|
|
418
443
|
changed(e) {
|
|
419
444
|
var s;
|
|
420
|
-
const
|
|
421
|
-
return (s = e.models) != null && s[
|
|
445
|
+
const o = p().selected;
|
|
446
|
+
return (s = e.models) != null && s[o] ? !tt(e.models[o], Ye) : !1;
|
|
422
447
|
},
|
|
423
448
|
property() {
|
|
424
|
-
return (e,
|
|
425
|
-
var
|
|
426
|
-
return ((
|
|
449
|
+
return (e, t = null) => {
|
|
450
|
+
var o;
|
|
451
|
+
return ((o = this.selectedModel) == null ? void 0 : o[e]) ?? t;
|
|
427
452
|
};
|
|
428
453
|
},
|
|
429
454
|
selectedId() {
|
|
430
|
-
return
|
|
455
|
+
return p().selected;
|
|
431
456
|
},
|
|
432
457
|
selectedModel(e) {
|
|
433
|
-
const
|
|
434
|
-
return e.models[
|
|
458
|
+
const t = this.selectedId;
|
|
459
|
+
return e.models[t] ?? null;
|
|
435
460
|
},
|
|
436
461
|
mergedModel() {
|
|
437
462
|
return { ...Ye, ...this.selectedModel ?? {} };
|
|
@@ -451,20 +476,20 @@ const ut = new S.Vector3(), Dt = (e) => {
|
|
|
451
476
|
},
|
|
452
477
|
actions: {
|
|
453
478
|
reset() {
|
|
454
|
-
const e =
|
|
479
|
+
const e = p().selected;
|
|
455
480
|
this.models[e] = { ...Ye };
|
|
456
481
|
},
|
|
457
482
|
ensureSelectedModel() {
|
|
458
|
-
const e =
|
|
483
|
+
const e = p().selected;
|
|
459
484
|
return this.models[e] || (this.models[e] = { ...Ye }), this.models[e];
|
|
460
485
|
},
|
|
461
486
|
patchSelected(e) {
|
|
462
|
-
const o = this.ensureSelectedModel();
|
|
463
|
-
Object.assign(o, e);
|
|
464
|
-
},
|
|
465
|
-
setProperty(e, o) {
|
|
466
487
|
const t = this.ensureSelectedModel();
|
|
467
|
-
t
|
|
488
|
+
Object.assign(t, e);
|
|
489
|
+
},
|
|
490
|
+
setProperty(e, t) {
|
|
491
|
+
const o = this.ensureSelectedModel();
|
|
492
|
+
o[e] = t;
|
|
468
493
|
},
|
|
469
494
|
setPosition(e) {
|
|
470
495
|
this.setProperty("position", e);
|
|
@@ -478,49 +503,49 @@ const ut = new S.Vector3(), Dt = (e) => {
|
|
|
478
503
|
setRadius(e) {
|
|
479
504
|
this.setProperty("radius", e);
|
|
480
505
|
},
|
|
481
|
-
setControlOptions(e,
|
|
482
|
-
|
|
483
|
-
const s = e.position.clone(), n = e.quaternion.clone(), r =
|
|
484
|
-
this.models[
|
|
506
|
+
setControlOptions(e, t, o = null) {
|
|
507
|
+
o === null && (o = p().selected), this.models[o] || (this.models[o] = At());
|
|
508
|
+
const s = e.position.clone(), n = e.quaternion.clone(), r = t.target.clone();
|
|
509
|
+
this.models[o].position = { x: s.x, y: s.y, z: s.z }, this.models[o].quaternion = { x: n.x, y: n.y, z: n.z, w: n.w }, this.models[o].target = { x: r.x, y: r.y, z: r.z };
|
|
485
510
|
},
|
|
486
511
|
initControls() {
|
|
487
|
-
const
|
|
488
|
-
|
|
512
|
+
const t = p().selected;
|
|
513
|
+
t && !this.models[t] && (this.models[t] = At());
|
|
489
514
|
}
|
|
490
515
|
}
|
|
491
|
-
}),
|
|
516
|
+
}), vt = {
|
|
492
517
|
color: 16711422
|
|
493
|
-
},
|
|
518
|
+
}, zt = (e = {}) => ({ ...vt, ...e }), lt = de("3d-scene", {
|
|
494
519
|
state: () => ({
|
|
495
520
|
models: {}
|
|
496
521
|
}),
|
|
497
522
|
getters: {
|
|
498
523
|
changed(e) {
|
|
499
524
|
var s, n;
|
|
500
|
-
const
|
|
501
|
-
return ((n = (s = e.models) == null ? void 0 : s[
|
|
525
|
+
const o = p().selected;
|
|
526
|
+
return ((n = (s = e.models) == null ? void 0 : s[o]) == null ? void 0 : n.color) !== 16711422;
|
|
502
527
|
},
|
|
503
528
|
colorHex(e) {
|
|
504
529
|
var n;
|
|
505
|
-
const
|
|
506
|
-
return
|
|
530
|
+
const o = p().selected, s = (n = e.models[o]) == null ? void 0 : n.color;
|
|
531
|
+
return ce(s || vt.color);
|
|
507
532
|
}
|
|
508
533
|
},
|
|
509
534
|
actions: {
|
|
510
535
|
reset() {
|
|
511
|
-
const
|
|
512
|
-
this.models[
|
|
536
|
+
const t = p().selected;
|
|
537
|
+
this.models[t] = { ...vt };
|
|
513
538
|
},
|
|
514
539
|
selectedId() {
|
|
515
|
-
return
|
|
540
|
+
return p().selected;
|
|
516
541
|
},
|
|
517
542
|
setColorHex(e) {
|
|
518
|
-
const
|
|
519
|
-
this.models[
|
|
543
|
+
const o = p().selected;
|
|
544
|
+
this.models[o] || (this.models[o] = zt()), this.models[o].color = be(e);
|
|
520
545
|
},
|
|
521
546
|
init() {
|
|
522
|
-
const
|
|
523
|
-
this.models[
|
|
547
|
+
const t = p().selected;
|
|
548
|
+
this.models[t] || (this.models[t] = zt());
|
|
524
549
|
}
|
|
525
550
|
}
|
|
526
551
|
}), Te = {
|
|
@@ -536,27 +561,27 @@ const ut = new S.Vector3(), Dt = (e) => {
|
|
|
536
561
|
size: 2,
|
|
537
562
|
lineColor: 13421772,
|
|
538
563
|
centerLineColor: 16711680
|
|
539
|
-
},
|
|
564
|
+
}, yo = (e = {}) => ({ ...Te, ...e }), Me = de("3d-grid", {
|
|
540
565
|
state: () => ({
|
|
541
566
|
models: {}
|
|
542
567
|
}),
|
|
543
568
|
getters: {
|
|
544
569
|
changed(e) {
|
|
545
|
-
const
|
|
546
|
-
return console.log("state.models[id]", e.models[
|
|
570
|
+
const o = p().selected;
|
|
571
|
+
return console.log("state.models[id]", e.models[o]), console.log("defaults", Te), !tt(e.models[o], Te);
|
|
547
572
|
},
|
|
548
573
|
property() {
|
|
549
|
-
return (e,
|
|
550
|
-
var
|
|
551
|
-
return ((
|
|
574
|
+
return (e, t = null) => {
|
|
575
|
+
var o;
|
|
576
|
+
return ((o = this.selectedModel) == null ? void 0 : o[e]) ?? t;
|
|
552
577
|
};
|
|
553
578
|
},
|
|
554
579
|
selectedId() {
|
|
555
|
-
return
|
|
580
|
+
return p().selected;
|
|
556
581
|
},
|
|
557
582
|
selectedModel(e) {
|
|
558
|
-
const
|
|
559
|
-
return e.models[
|
|
583
|
+
const t = this.selectedId;
|
|
584
|
+
return e.models[t] ?? null;
|
|
560
585
|
},
|
|
561
586
|
mergedModel() {
|
|
562
587
|
return { ...Te, ...this.selectedModel ?? {} };
|
|
@@ -580,43 +605,43 @@ const ut = new S.Vector3(), Dt = (e) => {
|
|
|
580
605
|
return this.mergedModel.divisions;
|
|
581
606
|
},
|
|
582
607
|
lineColorHex() {
|
|
583
|
-
return
|
|
608
|
+
return ce(this.mergedModel.lineColor);
|
|
584
609
|
},
|
|
585
610
|
centerLineColorHex() {
|
|
586
|
-
return
|
|
611
|
+
return ce(this.mergedModel.centerLineColor);
|
|
587
612
|
}
|
|
588
613
|
},
|
|
589
614
|
actions: {
|
|
590
615
|
reset() {
|
|
591
|
-
const
|
|
592
|
-
this.models[
|
|
593
|
-
this.models[
|
|
616
|
+
const t = p().selected;
|
|
617
|
+
this.models[t] = { ...Te }, Ht(() => {
|
|
618
|
+
this.models[t].show = !1;
|
|
594
619
|
});
|
|
595
620
|
},
|
|
596
621
|
ensureSelectedModel() {
|
|
597
|
-
const e =
|
|
622
|
+
const e = p().selected;
|
|
598
623
|
return this.models[e] || (this.models[e] = { ...Te }), this.models[e];
|
|
599
624
|
},
|
|
600
625
|
patchSelected(e) {
|
|
601
|
-
const o = this.ensureSelectedModel();
|
|
602
|
-
Object.assign(o, e);
|
|
603
|
-
},
|
|
604
|
-
setProperty(e, o) {
|
|
605
626
|
const t = this.ensureSelectedModel();
|
|
606
|
-
t
|
|
627
|
+
Object.assign(t, e);
|
|
628
|
+
},
|
|
629
|
+
setProperty(e, t) {
|
|
630
|
+
const o = this.ensureSelectedModel();
|
|
631
|
+
o[e] = t;
|
|
607
632
|
},
|
|
608
633
|
setLineColorHex(e) {
|
|
609
|
-
this.setProperty("lineColor",
|
|
634
|
+
this.setProperty("lineColor", be(e));
|
|
610
635
|
},
|
|
611
636
|
setCenterLineColorHex(e) {
|
|
612
|
-
this.setProperty("centerLineColor",
|
|
637
|
+
this.setProperty("centerLineColor", be(e));
|
|
613
638
|
},
|
|
614
639
|
init() {
|
|
615
|
-
const
|
|
616
|
-
this.models[
|
|
640
|
+
const t = p().selected;
|
|
641
|
+
this.models[t] || (this.models[t] = yo());
|
|
617
642
|
}
|
|
618
643
|
}
|
|
619
|
-
}),
|
|
644
|
+
}), So = [
|
|
620
645
|
"#141111",
|
|
621
646
|
"#3E251E",
|
|
622
647
|
"#633C30",
|
|
@@ -657,71 +682,71 @@ const ut = new S.Vector3(), Dt = (e) => {
|
|
|
657
682
|
"#BDACA8",
|
|
658
683
|
"#DACDC9",
|
|
659
684
|
"#E5E4E3"
|
|
660
|
-
],
|
|
685
|
+
], bt = "background", et = "subject", yt = "ground", Tt = {
|
|
661
686
|
[et]: 16711422,
|
|
662
|
-
[
|
|
663
|
-
[
|
|
664
|
-
}, Ut =
|
|
687
|
+
[bt]: 16777215,
|
|
688
|
+
[yt]: 12961221
|
|
689
|
+
}, Ut = de("3d-colors", {
|
|
665
690
|
state: () => ({
|
|
666
691
|
models: {},
|
|
667
|
-
palette:
|
|
692
|
+
palette: So
|
|
668
693
|
}),
|
|
669
694
|
getters: {
|
|
670
695
|
property() {
|
|
671
|
-
return (e,
|
|
672
|
-
var
|
|
673
|
-
return ((
|
|
696
|
+
return (e, t = null) => {
|
|
697
|
+
var o;
|
|
698
|
+
return ((o = this.selectedModel) == null ? void 0 : o[e]) ?? t;
|
|
674
699
|
};
|
|
675
700
|
},
|
|
676
701
|
selectedId() {
|
|
677
|
-
return
|
|
702
|
+
return p().selected;
|
|
678
703
|
},
|
|
679
704
|
selectedModel(e) {
|
|
680
|
-
const
|
|
681
|
-
return e.models[
|
|
705
|
+
const t = this.selectedId;
|
|
706
|
+
return e.models[t] ?? null;
|
|
682
707
|
},
|
|
683
708
|
mergedModel() {
|
|
684
|
-
return { ...
|
|
709
|
+
return { ...Tt, ...this.selectedModel ?? {} };
|
|
685
710
|
},
|
|
686
711
|
model(e) {
|
|
687
|
-
const
|
|
688
|
-
return
|
|
712
|
+
const o = p().selected;
|
|
713
|
+
return o && e.models[o] ? e.models[o] : null;
|
|
689
714
|
},
|
|
690
715
|
subjectHex() {
|
|
691
716
|
return this.getHexColor(et);
|
|
692
717
|
},
|
|
693
718
|
groundHex() {
|
|
694
|
-
return this.getHexColor(
|
|
719
|
+
return this.getHexColor(yt);
|
|
695
720
|
},
|
|
696
721
|
backgroundHex() {
|
|
697
|
-
return this.getHexColor(
|
|
722
|
+
return this.getHexColor(bt);
|
|
698
723
|
}
|
|
699
724
|
},
|
|
700
725
|
actions: {
|
|
701
726
|
initModel(e) {
|
|
702
|
-
this.models[e] = { ...
|
|
727
|
+
this.models[e] = { ...Tt };
|
|
703
728
|
},
|
|
704
729
|
getHexColor(e) {
|
|
705
|
-
const
|
|
706
|
-
if (!this.models[
|
|
707
|
-
const s = this.models[
|
|
708
|
-
return
|
|
730
|
+
const o = p().selected;
|
|
731
|
+
if (!this.models[o] || !this.models[o][e]) return "#F0F0F0";
|
|
732
|
+
const s = this.models[o][e];
|
|
733
|
+
return ce(s);
|
|
709
734
|
},
|
|
710
|
-
setHexColor(e = et,
|
|
711
|
-
const s =
|
|
712
|
-
!this.models[s] || !this.models[s][e] || (this.models[s][e] =
|
|
735
|
+
setHexColor(e = et, t = "#e6e6e6") {
|
|
736
|
+
const s = p().selected;
|
|
737
|
+
!this.models[s] || !this.models[s][e] || (this.models[s][e] = be(t));
|
|
713
738
|
},
|
|
714
739
|
setSubjectHex(e) {
|
|
715
740
|
this.setHexColor(et, e);
|
|
716
741
|
},
|
|
717
742
|
setGroundHex(e) {
|
|
718
|
-
this.setHexColor(
|
|
743
|
+
this.setHexColor(yt, e);
|
|
719
744
|
},
|
|
720
745
|
setBackgroundHex(e) {
|
|
721
|
-
this.setHexColor(
|
|
746
|
+
this.setHexColor(bt, e);
|
|
722
747
|
}
|
|
723
748
|
}
|
|
724
|
-
}),
|
|
749
|
+
}), p = de("3d", {
|
|
725
750
|
state: () => ({
|
|
726
751
|
// models: {},
|
|
727
752
|
selected: null,
|
|
@@ -743,9 +768,9 @@ const ut = new S.Vector3(), Dt = (e) => {
|
|
|
743
768
|
}),
|
|
744
769
|
getters: {
|
|
745
770
|
active(e) {
|
|
746
|
-
var
|
|
747
|
-
const
|
|
748
|
-
return ((s = (
|
|
771
|
+
var o, s;
|
|
772
|
+
const t = ft.is.mobile ? ot : oe;
|
|
773
|
+
return ((s = (o = this.models) == null ? void 0 : o[e.selected]) == null ? void 0 : s.active) || t;
|
|
749
774
|
},
|
|
750
775
|
aspect(e) {
|
|
751
776
|
return e.height > 0 ? e.width / e.height : 0;
|
|
@@ -753,135 +778,138 @@ const ut = new S.Vector3(), Dt = (e) => {
|
|
|
753
778
|
},
|
|
754
779
|
actions: {
|
|
755
780
|
hasAccess(e) {
|
|
756
|
-
var
|
|
757
|
-
return ((
|
|
781
|
+
var t;
|
|
782
|
+
return ((t = this.appAccessStore) == null ? void 0 : t.hasAccess(e)) || !1;
|
|
758
783
|
},
|
|
759
784
|
block(e) {
|
|
760
|
-
var
|
|
761
|
-
return ((
|
|
785
|
+
var t;
|
|
786
|
+
return ((t = this.appPaywallStore) == null ? void 0 : t.block(e)) || !0;
|
|
762
787
|
},
|
|
763
788
|
isExpanded(e = []) {
|
|
764
789
|
return e = Array.isArray(e) ? e : [e], e.includes(this.active);
|
|
765
790
|
},
|
|
766
|
-
setActive(e,
|
|
791
|
+
setActive(e, t = 0) {
|
|
767
792
|
this.models[this.selected] || (this.models[this.selected] = {}), this.models[this.selected].active !== e && (this.models[this.selected].active = e);
|
|
768
793
|
},
|
|
769
794
|
subscribe(e) {
|
|
770
|
-
const
|
|
771
|
-
e.$on("
|
|
772
|
-
|
|
795
|
+
const t = this;
|
|
796
|
+
e.$on("glb:loaded", (o) => {
|
|
797
|
+
t.setFromResponse(o);
|
|
773
798
|
});
|
|
774
799
|
},
|
|
775
800
|
setFromResponse(e) {
|
|
776
801
|
var u;
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
802
|
+
const t = Ut(), o = Ct(), s = Me(), n = Ve(), r = Be(), l = lt(), c = ye().setSubjectsFromResponse(e);
|
|
803
|
+
if (c == null) {
|
|
804
|
+
this.selected = null;
|
|
805
|
+
return;
|
|
806
|
+
}
|
|
807
|
+
this.selected = c, t.initModel(c), r.initLights(), n.setGroundFromResponse(c), o.initControls(), s.init(), l.init(), this.models[c] || (this.models[c] = {}), (u = this.models[c]) != null && u.active || (this.models[c].active = ft.is.mobile ? ot : oe);
|
|
780
808
|
}
|
|
781
809
|
}
|
|
782
810
|
});
|
|
783
|
-
let
|
|
784
|
-
const
|
|
785
|
-
const e =
|
|
786
|
-
if (
|
|
787
|
-
return
|
|
811
|
+
let ie = null, Pe = null;
|
|
812
|
+
const Le = () => {
|
|
813
|
+
const e = p(), { aspect: t, width: o, height: s } = I(e), n = (a = { x: 0, y: 0.8, z: 1.5 }) => (console.debug("useCamera init"), ie ? (console.debug("view camera already inited"), ie) : (ie = new M.PerspectiveCamera(75, t.value, 0.1, 100), e.loaded.camera = !0, ie)), r = () => {
|
|
814
|
+
if (ie)
|
|
815
|
+
return ie;
|
|
788
816
|
};
|
|
789
|
-
return
|
|
790
|
-
() =>
|
|
791
|
-
(
|
|
792
|
-
if (!
|
|
817
|
+
return Pe = O(
|
|
818
|
+
() => t.value,
|
|
819
|
+
(a) => {
|
|
820
|
+
if (!ie) {
|
|
793
821
|
n();
|
|
794
822
|
return;
|
|
795
823
|
}
|
|
796
|
-
|
|
824
|
+
ie.aspect = a, ie.updateProjectionMatrix();
|
|
797
825
|
}
|
|
798
826
|
), {
|
|
799
827
|
init: n,
|
|
800
828
|
getCamera: r,
|
|
801
829
|
dispose: () => {
|
|
802
|
-
|
|
830
|
+
Pe == null || Pe(), Pe = null, ie = null;
|
|
803
831
|
}
|
|
804
832
|
};
|
|
805
833
|
};
|
|
806
|
-
let
|
|
834
|
+
let se = null;
|
|
807
835
|
const st = () => {
|
|
808
|
-
const e =
|
|
836
|
+
const e = ee(!1), t = ee({
|
|
809
837
|
mode: null,
|
|
810
838
|
camera: null,
|
|
811
839
|
// camera (or your lights-camera)
|
|
812
840
|
store: null
|
|
813
841
|
// pinia store with position/quaternion/target
|
|
814
|
-
}),
|
|
815
|
-
if (console.debug("useOrbitControlsBase init"),
|
|
816
|
-
return console.debug("controls already inited"),
|
|
817
|
-
const
|
|
818
|
-
return
|
|
842
|
+
}), o = (b, f = {}) => {
|
|
843
|
+
if (console.debug("useOrbitControlsBase init"), se)
|
|
844
|
+
return console.debug("controls already inited"), se;
|
|
845
|
+
const E = new M.Object3D();
|
|
846
|
+
return se = new co(E, b.domElement), n(f), se;
|
|
819
847
|
}, s = () => {
|
|
820
|
-
if (!
|
|
821
|
-
return
|
|
822
|
-
}, n = (
|
|
848
|
+
if (!se) throw new Error("OrbitControls not initialized");
|
|
849
|
+
return se;
|
|
850
|
+
}, n = (b = {}) => {
|
|
823
851
|
const f = s();
|
|
824
|
-
f.enableDamping =
|
|
825
|
-
}, r = ({ mode:
|
|
852
|
+
f.enableDamping = b.enableDamping ?? !0, f.dampingFactor = b.dampingFactor ?? 0.5, f.rotateSpeed = b.rotateSpeed ?? 0.2, f.enableZoom = b.enableZoom ?? !0, f.minDistance = b.minDistance ?? 0.5, f.maxDistance = b.maxDistance ?? 6;
|
|
853
|
+
}, r = ({ mode: b, camera: f, store: E, options: D }) => {
|
|
826
854
|
const y = s();
|
|
827
|
-
if (!f) throw new Error(`setMode(${
|
|
828
|
-
if (!
|
|
829
|
-
y.object = f, n(
|
|
855
|
+
if (!f) throw new Error(`setMode(${b}): camera is required`);
|
|
856
|
+
if (!E) throw new Error(`setMode(${b}): store is required`);
|
|
857
|
+
y.object = f, n(D), t.value = { mode: b, camera: f, store: E }, c(), y.update();
|
|
830
858
|
}, l = () => {
|
|
831
|
-
|
|
832
|
-
},
|
|
833
|
-
const
|
|
834
|
-
!f || !
|
|
835
|
-
},
|
|
836
|
-
const
|
|
837
|
-
if (!f || !
|
|
859
|
+
se && se.update();
|
|
860
|
+
}, a = () => {
|
|
861
|
+
const b = s(), { camera: f, store: E } = t.value;
|
|
862
|
+
!f || !E || e.value || (E.setPosition({ ...f.position }), E.setQuaternion({ ...f.quaternion }), E.setTarget({ ...b.target }), E.setRadius(f.position.distanceTo(b.target)));
|
|
863
|
+
}, c = () => {
|
|
864
|
+
const b = s(), { camera: f, store: E } = t.value;
|
|
865
|
+
if (!f || !E) return;
|
|
838
866
|
e.value = !0;
|
|
839
|
-
const { position:
|
|
840
|
-
|
|
841
|
-
const
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
867
|
+
const { position: D, quaternion: y, target: k, radius: S } = E;
|
|
868
|
+
b.target.set(k.x, k.y, k.z);
|
|
869
|
+
const w = new M.Vector3(
|
|
870
|
+
D.x - k.x,
|
|
871
|
+
D.y - k.y,
|
|
872
|
+
D.z - k.z
|
|
845
873
|
).normalize();
|
|
846
|
-
f.position.copy(
|
|
874
|
+
f.position.copy(b.target).add(w.multiplyScalar(S)), f.quaternion.set(
|
|
847
875
|
y.x,
|
|
848
876
|
y.y,
|
|
849
877
|
y.z,
|
|
850
878
|
y.w
|
|
851
|
-
),
|
|
879
|
+
), b.update(), e.value = !1;
|
|
852
880
|
};
|
|
853
881
|
return {
|
|
854
|
-
init:
|
|
882
|
+
init: o,
|
|
855
883
|
get: s,
|
|
856
884
|
setMode: r,
|
|
857
885
|
update: l,
|
|
858
|
-
syncToStore:
|
|
859
|
-
applyFromStore:
|
|
860
|
-
frameToBounds: (
|
|
861
|
-
const
|
|
862
|
-
if (!y || !
|
|
863
|
-
const
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
886
|
+
syncToStore: a,
|
|
887
|
+
applyFromStore: c,
|
|
888
|
+
frameToBounds: (b, f = 1.75, E = 0.02) => {
|
|
889
|
+
const D = s(), { camera: y } = t.value;
|
|
890
|
+
if (!y || !b) return;
|
|
891
|
+
const k = new M.Vector3(
|
|
892
|
+
b.center.x,
|
|
893
|
+
b.center.y + b.size.y * E,
|
|
894
|
+
b.center.z
|
|
867
895
|
);
|
|
868
|
-
console.log("bounds",
|
|
869
|
-
const
|
|
870
|
-
let
|
|
871
|
-
|
|
896
|
+
console.log("bounds", b);
|
|
897
|
+
const S = Math.max(b.size.x, b.size.y, b.size.z), w = M.MathUtils.degToRad(y.fov);
|
|
898
|
+
let F = S / 2 / Math.tan(w / 2) * f;
|
|
899
|
+
D.target.copy(k), y.position.set(k.x, k.y, k.z + F), y.near = F / 100, y.far = F * 100, y.updateProjectionMatrix(), D.update();
|
|
872
900
|
},
|
|
873
901
|
dispose: () => {
|
|
874
|
-
console.debug("controls disposed"),
|
|
902
|
+
console.debug("controls disposed"), se && (se.dispose(), se = null, t.value = { mode: null, camera: null, store: null });
|
|
875
903
|
}
|
|
876
904
|
};
|
|
877
|
-
},
|
|
878
|
-
const { getCamera: e } =
|
|
905
|
+
}, xt = () => {
|
|
906
|
+
const { getCamera: e } = Le(), t = Ct(), o = st();
|
|
879
907
|
return {
|
|
880
908
|
activate: () => {
|
|
881
|
-
|
|
909
|
+
o.setMode({
|
|
882
910
|
mode: "camera",
|
|
883
911
|
camera: e(),
|
|
884
|
-
store:
|
|
912
|
+
store: t,
|
|
885
913
|
options: {
|
|
886
914
|
enableZoom: !0,
|
|
887
915
|
minDistance: 0.5,
|
|
@@ -889,35 +917,35 @@ const st = () => {
|
|
|
889
917
|
}
|
|
890
918
|
});
|
|
891
919
|
},
|
|
892
|
-
frameToBounds:
|
|
893
|
-
syncToStore:
|
|
894
|
-
applyFromStore:
|
|
920
|
+
frameToBounds: o.frameToBounds,
|
|
921
|
+
syncToStore: o.syncToStore,
|
|
922
|
+
applyFromStore: o.applyFromStore
|
|
895
923
|
};
|
|
896
924
|
};
|
|
897
|
-
let
|
|
898
|
-
const
|
|
899
|
-
const e = lt(),
|
|
900
|
-
if (
|
|
901
|
-
return
|
|
902
|
-
}, r = (
|
|
903
|
-
if (!
|
|
904
|
-
|
|
925
|
+
let te = null, Ge = null;
|
|
926
|
+
const De = () => {
|
|
927
|
+
const e = lt(), t = p(), { colorHex: o } = I(e), s = () => (console.debug("useScene init"), te ? (console.debug("scene already inited"), te) : (te = new M.Scene(), r(o.value), t.loaded.scene = !0, te)), n = () => {
|
|
928
|
+
if (te)
|
|
929
|
+
return te;
|
|
930
|
+
}, r = (a) => {
|
|
931
|
+
if (!te) throw new Error("Scene has not been initialized");
|
|
932
|
+
te.background = new M.Color(a);
|
|
905
933
|
};
|
|
906
|
-
return
|
|
907
|
-
() =>
|
|
908
|
-
(
|
|
934
|
+
return Ge = O(
|
|
935
|
+
() => o.value,
|
|
936
|
+
(a) => r(a)
|
|
909
937
|
), {
|
|
910
938
|
init: s,
|
|
911
939
|
get: n,
|
|
912
940
|
dispose: () => {
|
|
913
|
-
|
|
914
|
-
var
|
|
915
|
-
|
|
916
|
-
}),
|
|
941
|
+
t.loaded.scene = !1, Ge == null || Ge(), Ge = null, te && (te.traverse((a) => {
|
|
942
|
+
var c, u;
|
|
943
|
+
a.isMesh && ((c = a.geometry) == null || c.dispose(), Array.isArray(a.material) ? a.material.forEach((g) => g == null ? void 0 : g.dispose()) : (u = a.material) == null || u.dispose());
|
|
944
|
+
}), te.clear(), te = null);
|
|
917
945
|
},
|
|
918
946
|
setBackgroundColor: r
|
|
919
947
|
};
|
|
920
|
-
},
|
|
948
|
+
}, Co = {
|
|
921
949
|
asphalt: {
|
|
922
950
|
ao: "ao.jpg",
|
|
923
951
|
color: "color.jpg",
|
|
@@ -953,101 +981,101 @@ const we = () => {
|
|
|
953
981
|
repeat: 100
|
|
954
982
|
}
|
|
955
983
|
};
|
|
956
|
-
let
|
|
984
|
+
let z = null, He = null, Re = null, Oe = null;
|
|
957
985
|
const Lt = () => {
|
|
958
|
-
const e = Ve(), { get:
|
|
986
|
+
const e = Ve(), { get: t } = De(), { getCamera: o } = Le(), {
|
|
959
987
|
visible: s,
|
|
960
988
|
color: n,
|
|
961
989
|
texture: r,
|
|
962
990
|
offset: l
|
|
963
|
-
} =
|
|
964
|
-
if (console.debug("useGround init"),
|
|
965
|
-
return console.debug("ground already inited"),
|
|
966
|
-
const
|
|
967
|
-
color:
|
|
991
|
+
} = I(e), a = () => {
|
|
992
|
+
if (console.debug("useGround init"), z)
|
|
993
|
+
return console.debug("ground already inited"), z;
|
|
994
|
+
const D = t(), y = new M.PlaneGeometry(100, 100), k = new M.Color(n.value || 16777215), S = new M.MeshStandardMaterial({
|
|
995
|
+
color: k,
|
|
968
996
|
// Default to white
|
|
969
|
-
side:
|
|
997
|
+
side: M.DoubleSide,
|
|
970
998
|
roughness: 0.4,
|
|
971
999
|
metalness: 0.3,
|
|
972
|
-
emissive:
|
|
1000
|
+
emissive: k,
|
|
973
1001
|
emissiveIntensity: 0.05
|
|
974
1002
|
// tweak 0.1–0.6
|
|
975
1003
|
});
|
|
976
|
-
return
|
|
1004
|
+
return z = new M.Mesh(y, S), z.rotation.x = -Math.PI / 2, z.receiveShadow = !0, z.visible = s.value, D.add(z), He = O(
|
|
977
1005
|
() => s.value,
|
|
978
|
-
() =>
|
|
979
|
-
),
|
|
1006
|
+
() => c()
|
|
1007
|
+
), Re = O(
|
|
980
1008
|
() => n.value,
|
|
981
|
-
(
|
|
982
|
-
),
|
|
1009
|
+
(w) => f(w)
|
|
1010
|
+
), Oe = O(
|
|
983
1011
|
() => r.value,
|
|
984
|
-
(
|
|
985
|
-
),
|
|
1012
|
+
(w) => g(w)
|
|
1013
|
+
), z;
|
|
986
1014
|
};
|
|
987
|
-
function
|
|
988
|
-
if (
|
|
989
|
-
|
|
1015
|
+
function c() {
|
|
1016
|
+
if (o().position.y < z.position.y) {
|
|
1017
|
+
z.visible = !1;
|
|
990
1018
|
return;
|
|
991
1019
|
}
|
|
992
|
-
|
|
1020
|
+
z.visible = s.value;
|
|
993
1021
|
}
|
|
994
|
-
function u(
|
|
995
|
-
return new
|
|
996
|
-
|
|
1022
|
+
function u(D, y = 1, k = 1) {
|
|
1023
|
+
return new M.TextureLoader().load(D, (F) => {
|
|
1024
|
+
F.wrapS = M.RepeatWrapping, F.wrapT = M.RepeatWrapping, F.repeat.set(y, k), F.needsUpdate = !0;
|
|
997
1025
|
});
|
|
998
1026
|
}
|
|
999
|
-
const g = (
|
|
1000
|
-
if (!
|
|
1001
|
-
const y =
|
|
1027
|
+
const g = (D) => {
|
|
1028
|
+
if (!z) throw new Error("Ground has not been initialized");
|
|
1029
|
+
const y = Co[D];
|
|
1002
1030
|
if (!y)
|
|
1003
|
-
|
|
1031
|
+
z.material.map = null, z.material.normalMap = null, z.material.displacementMap = null, z.material.roughnessMap = null, z.material.aoMap = null, z.material.metalnessMap = null, z.material.needsUpdate = !0;
|
|
1004
1032
|
else {
|
|
1005
|
-
const
|
|
1006
|
-
|
|
1007
|
-
`${
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
),
|
|
1011
|
-
`${
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
),
|
|
1015
|
-
`${
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
),
|
|
1019
|
-
`${
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
),
|
|
1023
|
-
`${
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
), y.metalness && (
|
|
1027
|
-
`${
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
)),
|
|
1033
|
+
const k = `https://static.figurosity.com/3d/textures/${D}/`, S = y.repeat;
|
|
1034
|
+
z.material.map = u(
|
|
1035
|
+
`${k}${y.color}`,
|
|
1036
|
+
S,
|
|
1037
|
+
S
|
|
1038
|
+
), z.material.normalMap = u(
|
|
1039
|
+
`${k}${y.normal}`,
|
|
1040
|
+
S,
|
|
1041
|
+
S
|
|
1042
|
+
), z.material.displacementMap = u(
|
|
1043
|
+
`${k}${y.displacement}`,
|
|
1044
|
+
S,
|
|
1045
|
+
S
|
|
1046
|
+
), z.material.roughnessMap = u(
|
|
1047
|
+
`${k}${y.roughness}`,
|
|
1048
|
+
S,
|
|
1049
|
+
S
|
|
1050
|
+
), z.material.aoMap = u(
|
|
1051
|
+
`${k}${y.ao}`,
|
|
1052
|
+
S,
|
|
1053
|
+
S
|
|
1054
|
+
), y.metalness && (z.material.metalnessMap = u(
|
|
1055
|
+
`${k}${y.metalness}`,
|
|
1056
|
+
S,
|
|
1057
|
+
S
|
|
1058
|
+
)), z.material.displacementScale = 0.1, z.material.displacementBias = -0.05, z.material.needsUpdate = !0;
|
|
1031
1059
|
}
|
|
1032
|
-
|
|
1033
|
-
},
|
|
1034
|
-
if (!
|
|
1035
|
-
return
|
|
1036
|
-
}, f = (
|
|
1037
|
-
if (!
|
|
1038
|
-
|
|
1060
|
+
z.position.y = l.value, z.geometry.computeBoundingBox(), z.geometry.computeVertexNormals();
|
|
1061
|
+
}, b = () => {
|
|
1062
|
+
if (!z) throw new Error("Ground has not been initialized");
|
|
1063
|
+
return z;
|
|
1064
|
+
}, f = (D) => {
|
|
1065
|
+
if (!z) throw new Error("Ground has not been initialized");
|
|
1066
|
+
z.material.color.set(D);
|
|
1039
1067
|
};
|
|
1040
|
-
return { init:
|
|
1041
|
-
var y,
|
|
1042
|
-
if (
|
|
1043
|
-
const
|
|
1044
|
-
|
|
1068
|
+
return { init: a, get: b, setColor: f, updateVisibility: c, dispose: () => {
|
|
1069
|
+
var y, k;
|
|
1070
|
+
if (He == null || He(), Re == null || Re(), Oe == null || Oe(), He = null, Re = null, Oe = null, !z) return;
|
|
1071
|
+
const D = t();
|
|
1072
|
+
D == null || D.remove(z), (y = z.geometry) == null || y.dispose(), Array.isArray(z.material) ? z.material.forEach((S) => S == null ? void 0 : S.dispose()) : (k = z.material) == null || k.dispose(), z = null;
|
|
1045
1073
|
} };
|
|
1046
|
-
},
|
|
1047
|
-
const
|
|
1048
|
-
|
|
1074
|
+
}, xo = (e, t = 16711422) => {
|
|
1075
|
+
const o = new po(0.1, 0.1, 0.1, 6, 0.01), s = 0.1, n = 0.05, r = new M.ConeGeometry(n, s, 32);
|
|
1076
|
+
o.index || o.setIndex(
|
|
1049
1077
|
Array.from(
|
|
1050
|
-
{ length:
|
|
1078
|
+
{ length: o.attributes.position.count },
|
|
1051
1079
|
(u, g) => g
|
|
1052
1080
|
)
|
|
1053
1081
|
), r.index || r.setIndex(
|
|
@@ -1055,186 +1083,186 @@ const Lt = () => {
|
|
|
1055
1083
|
{ length: r.attributes.position.count },
|
|
1056
1084
|
(u, g) => g
|
|
1057
1085
|
)
|
|
1058
|
-
), r.rotateX(-Math.PI / 2), r.translate(0, 0, s / 2), Bt(
|
|
1059
|
-
const l =
|
|
1060
|
-
color:
|
|
1086
|
+
), r.rotateX(-Math.PI / 2), r.translate(0, 0, s / 2), Bt(o), Bt(r);
|
|
1087
|
+
const l = uo([o, r]), a = new M.MeshBasicMaterial({
|
|
1088
|
+
color: t,
|
|
1061
1089
|
transparent: !0,
|
|
1062
1090
|
opacity: 0.8
|
|
1063
|
-
}),
|
|
1064
|
-
if (
|
|
1065
|
-
const u = new
|
|
1066
|
-
e.target.getWorldPosition(u),
|
|
1091
|
+
}), c = new M.Mesh(l, a);
|
|
1092
|
+
if (c.position.set(0, 0, 0), c.rotateX(Math.PI), e && e.target) {
|
|
1093
|
+
const u = new M.Vector3();
|
|
1094
|
+
e.target.getWorldPosition(u), c.lookAt(u);
|
|
1067
1095
|
}
|
|
1068
|
-
return
|
|
1096
|
+
return c.position.copy(e.position), c;
|
|
1069
1097
|
};
|
|
1070
|
-
let We = {},
|
|
1098
|
+
let We = {}, ae = {}, X = {}, mt = {}, Ce = {}, ke = null, pe = null, qe = [], Ee = /* @__PURE__ */ new Map();
|
|
1071
1099
|
const nt = () => {
|
|
1072
|
-
const e =
|
|
1073
|
-
|
|
1074
|
-
const { subjectLoaded: s, width: n, height: r, selected: l } =
|
|
1100
|
+
const e = p(), t = Be(), o = ye();
|
|
1101
|
+
ee(!1);
|
|
1102
|
+
const { subjectLoaded: s, width: n, height: r, selected: l } = I(e), { debug: a, collection: c, advancedMode: u, move: g } = I(t), { get: b } = De(), f = t.property, E = () => {
|
|
1075
1103
|
if (pe)
|
|
1076
1104
|
return console.warn("lights camera already inited"), pe;
|
|
1077
|
-
const
|
|
1078
|
-
return
|
|
1079
|
-
const
|
|
1080
|
-
|
|
1081
|
-
|
|
1105
|
+
const d = b();
|
|
1106
|
+
return ke = y(), pe = k(), c.value.forEach((i) => {
|
|
1107
|
+
const x = i === "key" ? pe : d, { group: V, light: A, directional: j, visualization: L } = S(
|
|
1108
|
+
i,
|
|
1109
|
+
x
|
|
1082
1110
|
);
|
|
1083
|
-
|
|
1084
|
-
}),
|
|
1085
|
-
},
|
|
1111
|
+
X[i] = A, We[i] = V, mt[i] = j, Ce[i] = L, X[i].castShadow = !0, X[i].angle = Math.PI / 8, X[i].penumbra = 0.2, X[i].shadow.camera.near = 0.5, X[i].shadow.camera.far = 12, X[i].shadow.focus = 0.9, X[i].shadow.mapSize.set(4096, 4096), X[i].shadow.bias = -2e-4, X[i].shadow.normalBias = 0.02, X[i].shadow.radius = 2, X[i].shadow.camera.updateProjectionMatrix();
|
|
1112
|
+
}), q(), C(), pe;
|
|
1113
|
+
}, D = () => {
|
|
1086
1114
|
if (!pe)
|
|
1087
1115
|
throw new Error("Light camera not initialized.");
|
|
1088
1116
|
return pe;
|
|
1089
1117
|
}, y = () => {
|
|
1090
|
-
const
|
|
1091
|
-
return
|
|
1092
|
-
},
|
|
1093
|
-
const
|
|
1118
|
+
const d = b(), i = new M.AmbientLight(f("key", "color"), 0.75);
|
|
1119
|
+
return d.add(i), i;
|
|
1120
|
+
}, k = () => {
|
|
1121
|
+
const d = b(), i = new M.PerspectiveCamera(
|
|
1094
1122
|
75,
|
|
1095
1123
|
n.value / r.value,
|
|
1096
1124
|
0.1,
|
|
1097
1125
|
100
|
|
1098
1126
|
);
|
|
1099
|
-
return
|
|
1127
|
+
return i.position.set(0, 0, 1.5), d.add(i), i;
|
|
1100
1128
|
};
|
|
1101
|
-
function
|
|
1102
|
-
const
|
|
1103
|
-
f(
|
|
1104
|
-
f(
|
|
1129
|
+
function S(d, i = null) {
|
|
1130
|
+
const x = b(), V = new M.Group(), A = new M.SpotLight(
|
|
1131
|
+
f(d, "color"),
|
|
1132
|
+
f(d, "opacity")
|
|
1105
1133
|
);
|
|
1106
|
-
|
|
1107
|
-
const j = new
|
|
1108
|
-
j.position.set(0, 0, 4),
|
|
1109
|
-
const
|
|
1110
|
-
|
|
1111
|
-
f(
|
|
1112
|
-
),
|
|
1113
|
-
return
|
|
1134
|
+
A.position.set(0, 0, 0);
|
|
1135
|
+
const j = new M.DirectionalLight(f(d, "color"), 0.2);
|
|
1136
|
+
j.position.set(0, 0, 4), F(), A.target.position.set(0, 1, 0), A.target.updateMatrixWorld(), x.add(A.target), V.add(A), V.add(j);
|
|
1137
|
+
const L = xo(
|
|
1138
|
+
A,
|
|
1139
|
+
f(d, "visualizationColor")
|
|
1140
|
+
), P = t.isVisible(d);
|
|
1141
|
+
return L.visible = P, V.add(L), i.add(V), { group: V, light: A, directional: j, visualization: L };
|
|
1114
1142
|
}
|
|
1115
|
-
const
|
|
1116
|
-
|
|
1117
|
-
},
|
|
1118
|
-
|
|
1119
|
-
const
|
|
1120
|
-
|
|
1121
|
-
const
|
|
1122
|
-
if (!
|
|
1123
|
-
const
|
|
1124
|
-
if (
|
|
1125
|
-
const
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
),
|
|
1143
|
+
const w = () => {
|
|
1144
|
+
F(), Z(), U();
|
|
1145
|
+
}, F = () => {
|
|
1146
|
+
ke && ke.color.set(f("key", "color"));
|
|
1147
|
+
const d = t.lights[l.value];
|
|
1148
|
+
d && Object.keys(d).forEach((i) => {
|
|
1149
|
+
const x = X[i];
|
|
1150
|
+
if (!x) return;
|
|
1151
|
+
const V = f(i, "color"), A = f(i, "visible"), j = f(i, "opacity"), L = f(i, "shadow") || !1;
|
|
1152
|
+
if (V && x.color.set(V), x.visible = A, j != null && (x.intensity = j), x.castShadow = L, L) {
|
|
1153
|
+
const P = f(i, "shadowSettings", {});
|
|
1154
|
+
x.shadow.mapSize.set(
|
|
1155
|
+
P.width || 1024,
|
|
1156
|
+
P.height || 1024
|
|
1157
|
+
), x.shadow.camera.near = P.near || 0.5, x.shadow.camera.far = P.far || 50, x.shadow.needsUpdate = !0;
|
|
1130
1158
|
}
|
|
1131
1159
|
});
|
|
1132
|
-
},
|
|
1133
|
-
const
|
|
1134
|
-
|
|
1135
|
-
if (!
|
|
1136
|
-
const
|
|
1137
|
-
|
|
1160
|
+
}, Z = () => {
|
|
1161
|
+
const d = t.lights[l.value];
|
|
1162
|
+
d && Object.keys(d).forEach((i) => {
|
|
1163
|
+
if (!Ce[i]) return console.warn(`${i} does not exist`);
|
|
1164
|
+
const x = t.isVisible(i);
|
|
1165
|
+
Ce[i].visible = x, Ce[i].material.color.set(f(i, "color"));
|
|
1138
1166
|
});
|
|
1139
|
-
},
|
|
1140
|
-
const
|
|
1141
|
-
|
|
1142
|
-
const
|
|
1143
|
-
!
|
|
1167
|
+
}, U = () => {
|
|
1168
|
+
const d = t.lights[l.value];
|
|
1169
|
+
d && Object.keys(d).forEach((i) => {
|
|
1170
|
+
const x = f(i, "debug") || a.value;
|
|
1171
|
+
!ae[i] && x && (ae[i] = Y(i, X[i]), X[i].add(ae[i])), ae[i] && !x && (ae[i] = Q(ae[i]));
|
|
1144
1172
|
});
|
|
1145
|
-
},
|
|
1146
|
-
const
|
|
1147
|
-
|
|
1148
|
-
f(
|
|
1173
|
+
}, Y = (d, i) => {
|
|
1174
|
+
const x = b(), V = new M.SpotLightHelper(
|
|
1175
|
+
i,
|
|
1176
|
+
f(d, "visualizationColor")
|
|
1149
1177
|
);
|
|
1150
|
-
return
|
|
1151
|
-
},
|
|
1152
|
-
const
|
|
1153
|
-
if (!(!
|
|
1154
|
-
return
|
|
1155
|
-
},
|
|
1156
|
-
const
|
|
1157
|
-
if (!
|
|
1158
|
-
const
|
|
1159
|
-
|
|
1160
|
-
|
|
1178
|
+
return x.add(V), V;
|
|
1179
|
+
}, Q = (d) => {
|
|
1180
|
+
const i = b();
|
|
1181
|
+
if (!(!i || !d))
|
|
1182
|
+
return i.remove(d), d.dispose(), d = null, d;
|
|
1183
|
+
}, q = () => {
|
|
1184
|
+
const d = D(), i = o.bounds;
|
|
1185
|
+
if (!i) return;
|
|
1186
|
+
const x = new M.Vector3(
|
|
1187
|
+
i.center.x,
|
|
1188
|
+
i.center.y,
|
|
1161
1189
|
// + bounds.size.y + 0.05,
|
|
1162
|
-
|
|
1163
|
-
),
|
|
1164
|
-
|
|
1190
|
+
i.center.z
|
|
1191
|
+
), V = new M.Vector3().subVectors(x, d.position).normalize(), A = new M.Vector3(
|
|
1192
|
+
V.x,
|
|
1165
1193
|
0,
|
|
1166
|
-
|
|
1167
|
-
).normalize(), j = new
|
|
1168
|
-
-
|
|
1194
|
+
V.z
|
|
1195
|
+
).normalize(), j = new M.Vector3(
|
|
1196
|
+
-A.z,
|
|
1169
1197
|
0,
|
|
1170
|
-
|
|
1171
|
-
),
|
|
1172
|
-
We.fill.position.copy(
|
|
1173
|
-
var
|
|
1174
|
-
const
|
|
1175
|
-
|
|
1198
|
+
A.x
|
|
1199
|
+
), P = 2 * d.position.distanceTo(x) / Math.sqrt(3), W = 1, _ = x.clone().add(j.clone().multiplyScalar(-P / W)).add(V.clone().multiplyScalar(Math.sqrt(3) * P / 2)), K = x.clone().add(j.clone().multiplyScalar(P / W)).add(V.clone().multiplyScalar(Math.sqrt(3) * P / 2));
|
|
1200
|
+
We.fill.position.copy(_), We.back.position.copy(K), c.value.forEach((re) => {
|
|
1201
|
+
var N, le, ue;
|
|
1202
|
+
const m = X[re];
|
|
1203
|
+
m.shadow.needsUpdate = !0, m.target.position.copy(x), m.target.updateMatrixWorld(), (N = Ce[re]) == null || N.lookAt(x), (ue = (le = ae[re]) == null ? void 0 : le.update) == null || ue.call(le);
|
|
1176
1204
|
});
|
|
1177
|
-
},
|
|
1178
|
-
const
|
|
1179
|
-
if (!
|
|
1180
|
-
const
|
|
1181
|
-
if (
|
|
1182
|
-
const
|
|
1183
|
-
Object.keys(
|
|
1184
|
-
var
|
|
1185
|
-
(
|
|
1205
|
+
}, B = (d) => {
|
|
1206
|
+
const i = t.lights[d];
|
|
1207
|
+
if (!i) return;
|
|
1208
|
+
const x = `watcher-${d}`;
|
|
1209
|
+
if (Ee.has(x)) return;
|
|
1210
|
+
const V = [];
|
|
1211
|
+
Object.keys(i).forEach((j) => {
|
|
1212
|
+
var L, P;
|
|
1213
|
+
(L = i[j]) != null && L.color && V.push(() => i[j].color), (P = i[j]) != null && P.visible && V.push(() => i[j].visible);
|
|
1186
1214
|
});
|
|
1187
|
-
const
|
|
1188
|
-
() =>
|
|
1189
|
-
|
|
1215
|
+
const A = O(
|
|
1216
|
+
() => V.map((j) => j()),
|
|
1217
|
+
w,
|
|
1190
1218
|
{ deep: !0 }
|
|
1191
1219
|
);
|
|
1192
|
-
|
|
1193
|
-
},
|
|
1194
|
-
const
|
|
1195
|
-
|
|
1196
|
-
},
|
|
1220
|
+
Ee.set(x, A);
|
|
1221
|
+
}, T = (d) => {
|
|
1222
|
+
const i = `watcher-${d}`, x = Ee.get(i);
|
|
1223
|
+
x && (x(), Ee.delete(i));
|
|
1224
|
+
}, C = () => {
|
|
1197
1225
|
qe.push(
|
|
1198
|
-
|
|
1226
|
+
O(
|
|
1199
1227
|
() => [u.value, l.value, g.value],
|
|
1200
|
-
() =>
|
|
1228
|
+
() => w()
|
|
1201
1229
|
)
|
|
1202
1230
|
), qe.push(
|
|
1203
|
-
|
|
1231
|
+
O(
|
|
1204
1232
|
() => s.value,
|
|
1205
|
-
(
|
|
1206
|
-
|
|
1233
|
+
(d) => {
|
|
1234
|
+
d === !0 && q();
|
|
1207
1235
|
}
|
|
1208
1236
|
)
|
|
1209
1237
|
), qe.push(
|
|
1210
|
-
|
|
1238
|
+
O(
|
|
1211
1239
|
() => l.value,
|
|
1212
|
-
(
|
|
1213
|
-
|
|
1240
|
+
(d, i) => {
|
|
1241
|
+
i && T(i), d != null && (B(d), Ht(w));
|
|
1214
1242
|
},
|
|
1215
1243
|
{ immediate: !0 }
|
|
1216
1244
|
)
|
|
1217
1245
|
);
|
|
1218
1246
|
};
|
|
1219
1247
|
return {
|
|
1220
|
-
init:
|
|
1221
|
-
updatePosition:
|
|
1222
|
-
getCamera:
|
|
1248
|
+
init: E,
|
|
1249
|
+
updatePosition: q,
|
|
1250
|
+
getCamera: D,
|
|
1223
1251
|
dispose: () => {
|
|
1224
|
-
const
|
|
1225
|
-
|
|
1226
|
-
var
|
|
1227
|
-
|
|
1228
|
-
}),
|
|
1252
|
+
const d = b();
|
|
1253
|
+
d && (qe.forEach((i) => i()), qe = [], Ee.forEach((i) => i()), Ee.clear(), Object.values(X).forEach((i) => d.remove(i)), Object.values(mt).forEach((i) => d.remove(i)), Object.values(ae).forEach((i) => d.remove(i)), Object.values(Ce).forEach((i) => {
|
|
1254
|
+
var x, V, A, j;
|
|
1255
|
+
d.remove(i), (V = (x = i.geometry) == null ? void 0 : x.dispose) == null || V.call(x), (j = (A = i.material) == null ? void 0 : A.dispose) == null || j.call(A);
|
|
1256
|
+
}), ke && d.remove(ke), We = {}, ae = {}, X = {}, mt = {}, Ce = {}, ke = null, pe = null);
|
|
1229
1257
|
}
|
|
1230
1258
|
};
|
|
1231
|
-
},
|
|
1232
|
-
const e =
|
|
1259
|
+
}, wt = () => {
|
|
1260
|
+
const e = Be(), t = st(), { getCamera: o } = nt();
|
|
1233
1261
|
return {
|
|
1234
1262
|
activate: () => {
|
|
1235
|
-
|
|
1263
|
+
t.setMode({
|
|
1236
1264
|
mode: "lights",
|
|
1237
|
-
camera:
|
|
1265
|
+
camera: o(),
|
|
1238
1266
|
store: e,
|
|
1239
1267
|
options: {
|
|
1240
1268
|
enableZoom: !0,
|
|
@@ -1243,275 +1271,254 @@ const nt = () => {
|
|
|
1243
1271
|
}
|
|
1244
1272
|
});
|
|
1245
1273
|
},
|
|
1246
|
-
frameToBounds:
|
|
1247
|
-
syncToStore:
|
|
1248
|
-
applyFromStore:
|
|
1274
|
+
frameToBounds: t.frameToBounds,
|
|
1275
|
+
syncToStore: t.syncToStore,
|
|
1276
|
+
applyFromStore: t.applyFromStore
|
|
1249
1277
|
};
|
|
1250
1278
|
};
|
|
1251
1279
|
let me = null;
|
|
1252
|
-
const
|
|
1280
|
+
const wo = () => {
|
|
1253
1281
|
const e = () => {
|
|
1254
|
-
const
|
|
1255
|
-
return
|
|
1256
|
-
|
|
1282
|
+
const o = p();
|
|
1283
|
+
return me = new M.LoadingManager(), me.onStart = function(s) {
|
|
1284
|
+
o.loading.active = !0, o.loading.url = s, o.loading.percent = 0;
|
|
1257
1285
|
}, me.onError = () => {
|
|
1258
|
-
|
|
1286
|
+
o.loading.active = !1, o.loading.url = null;
|
|
1259
1287
|
}, me.onLoad = function() {
|
|
1260
|
-
|
|
1261
|
-
}, me.onProgress = function(
|
|
1262
|
-
|
|
1288
|
+
o.loading.active = !1, o.loading.url = null, o.loading.percent = 100;
|
|
1289
|
+
}, me.onProgress = function(s, n, r) {
|
|
1290
|
+
o.loading.percent = Math.round(n / r * 100);
|
|
1263
1291
|
}, me;
|
|
1264
1292
|
};
|
|
1265
1293
|
return { get: () => (me || e(), me) };
|
|
1266
1294
|
};
|
|
1267
|
-
let
|
|
1268
|
-
const
|
|
1269
|
-
const e =
|
|
1295
|
+
let R = null, _e = null, Ue = null;
|
|
1296
|
+
const St = () => {
|
|
1297
|
+
const e = p(), { get: t } = De(), { getCamera: o } = Le(), { width: s, height: n, subjectLoaded: r } = I(e);
|
|
1270
1298
|
function l(g) {
|
|
1271
|
-
return console.debug("useRenderer init"),
|
|
1299
|
+
return console.debug("useRenderer init"), R ? (console.debug("renderer already inited"), R) : (R = new M.WebGLRenderer({ antialias: !0, alpha: !0 }), R.setSize(s.value, n.value), R.toneMapping = M.ACESFilmicToneMapping, R.toneMappingExposure = 1.2, R.shadowMap.enabled = !0, R.shadowMap.type = M.PCFSoftShadowMap, R.gammaFactor = 2.2, R.gammaOutput = !0, R.outputColorSpace = M.SRGBColorSpace, g && g.appendChild(R.domElement), e.loaded.renderer = !0, R);
|
|
1272
1300
|
}
|
|
1273
|
-
const
|
|
1274
|
-
if (!
|
|
1275
|
-
return
|
|
1276
|
-
},
|
|
1277
|
-
const g =
|
|
1278
|
-
!g || !
|
|
1301
|
+
const a = () => {
|
|
1302
|
+
if (!R) throw new Error("Renderer has not been initialized");
|
|
1303
|
+
return R;
|
|
1304
|
+
}, c = () => {
|
|
1305
|
+
const g = t(), b = o();
|
|
1306
|
+
!g || !b || R.render(g, b);
|
|
1279
1307
|
};
|
|
1280
|
-
|
|
1308
|
+
_e = O(
|
|
1281
1309
|
() => [s.value, n.value],
|
|
1282
|
-
([g,
|
|
1283
|
-
!g || !
|
|
1310
|
+
([g, b]) => {
|
|
1311
|
+
!g || !b || !R || R.setSize(g, b);
|
|
1284
1312
|
}
|
|
1285
|
-
), Ue =
|
|
1313
|
+
), Ue = O(
|
|
1286
1314
|
() => r.value,
|
|
1287
|
-
() =>
|
|
1315
|
+
() => c()
|
|
1288
1316
|
);
|
|
1289
1317
|
function u() {
|
|
1290
|
-
console.debug("renderer disposed"), e.loaded.renderer = !1,
|
|
1318
|
+
console.debug("renderer disposed"), e.loaded.renderer = !1, _e == null || _e(), Ue == null || Ue(), _e = null, Ue = null, R && (R.domElement.parentElement && R.domElement.parentElement.removeChild(R.domElement), R.dispose(), R = null);
|
|
1291
1319
|
}
|
|
1292
1320
|
return {
|
|
1293
1321
|
init: l,
|
|
1294
|
-
get:
|
|
1322
|
+
get: a,
|
|
1295
1323
|
dispose: u,
|
|
1296
|
-
render:
|
|
1324
|
+
render: c
|
|
1297
1325
|
};
|
|
1298
|
-
},
|
|
1299
|
-
const { removeSpecular: s = !1, removeShininess: n = !1 } =
|
|
1326
|
+
}, Vt = (e, t, o = {}) => {
|
|
1327
|
+
const { removeSpecular: s = !1, removeShininess: n = !1 } = o;
|
|
1300
1328
|
e && e.traverse((r) => {
|
|
1301
1329
|
if (!r.isMesh) return;
|
|
1302
|
-
(Array.isArray(r.material) ? r.material : [r.material]).forEach((
|
|
1303
|
-
|
|
1330
|
+
(Array.isArray(r.material) ? r.material : [r.material]).forEach((a) => {
|
|
1331
|
+
a && (a.color && a.color.set(t), s && a.specular && a.specular.set(0), n && typeof a.shininess == "number" && (a.shininess = 0), a.needsUpdate = !0);
|
|
1304
1332
|
});
|
|
1305
1333
|
});
|
|
1306
|
-
};
|
|
1307
|
-
let
|
|
1334
|
+
}, Do = 1, Bo = "https://www.gstatic.com/draco/v1/decoders/";
|
|
1335
|
+
let he = null, fe = null, Ae, ze, jt = 0;
|
|
1308
1336
|
const Ft = () => {
|
|
1309
|
-
const { get: e } =
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
const
|
|
1313
|
-
|
|
1314
|
-
);
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
P.setWithCredentials(!0), P.manager.setURLModifier((c) => c), P.load(R, (c) => {
|
|
1325
|
-
if (W !== ht) {
|
|
1326
|
-
c.traverse((_) => {
|
|
1327
|
-
var X;
|
|
1328
|
-
if (!_.isMesh) return;
|
|
1329
|
-
(X = _.geometry) == null || X.dispose();
|
|
1330
|
-
const G = _.material;
|
|
1331
|
-
Array.isArray(G) ? G.forEach((J) => J == null ? void 0 : J.dispose()) : G == null || G.dispose();
|
|
1337
|
+
const { get: e } = wo(), t = ye(), o = p(), s = Ve(), { selected: n } = I(o), { color: r, url: l } = I(t), { offset: a } = I(s), { getCamera: c } = Le(), { get: u } = De(), { render: g } = St(), b = (S) => {
|
|
1338
|
+
const { frameToBounds: w } = xt(), { frameToBounds: F } = wt(), Z = ++jt;
|
|
1339
|
+
o.subjectLoaded = !1, f();
|
|
1340
|
+
const U = e();
|
|
1341
|
+
fe || (fe = new ho(U), fe.setDecoderPath(Bo));
|
|
1342
|
+
const Y = new mo(U);
|
|
1343
|
+
Y.setDRACOLoader(fe), Y.setWithCredentials(!0), Y.manager.setURLModifier((Q) => Q), Y.load(S, (Q) => {
|
|
1344
|
+
const q = Q == null ? void 0 : Q.scene;
|
|
1345
|
+
if (Z !== jt) {
|
|
1346
|
+
q == null || q.traverse((i) => {
|
|
1347
|
+
var V;
|
|
1348
|
+
if (!i.isMesh) return;
|
|
1349
|
+
(V = i.geometry) == null || V.dispose();
|
|
1350
|
+
const x = i.material;
|
|
1351
|
+
Array.isArray(x) ? x.forEach((A) => A == null ? void 0 : A.dispose()) : x == null || x.dispose();
|
|
1332
1352
|
});
|
|
1333
1353
|
return;
|
|
1334
|
-
} else
|
|
1335
|
-
console.debug("currentLoad === loadVersion"), console.debug(`${W} === ${ht}`);
|
|
1336
|
-
if (!c) {
|
|
1337
|
-
console.debug("model not loaded");
|
|
1338
|
-
return;
|
|
1339
1354
|
}
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
E.position.y -= D.bottom, E.updateMatrixWorld(!0), a.add(E), ce = E;
|
|
1352
|
-
const F = Dt(E);
|
|
1353
|
-
o.setBounds(F), f(a, w), I(F), N(F), t.subjectLoaded = !0;
|
|
1354
|
-
});
|
|
1355
|
-
}, y = () => {
|
|
1356
|
-
if (console.log("removeSubject", ce), !ce) return;
|
|
1357
|
-
g().remove(ce), ce.traverse((I) => {
|
|
1358
|
-
var W;
|
|
1359
|
-
if (!I.isMesh) return;
|
|
1360
|
-
(W = I.geometry) == null || W.dispose();
|
|
1361
|
-
const N = I.material;
|
|
1362
|
-
Array.isArray(N) ? N.forEach((x) => x == null ? void 0 : x.dispose()) : N == null || N.dispose();
|
|
1363
|
-
}), ce = null, t.subjectLoaded = !1;
|
|
1364
|
-
}, B = () => {
|
|
1365
|
-
_e && (_e.dispose(), _e = null);
|
|
1366
|
-
}, M = (R) => {
|
|
1367
|
-
jt(ce, R, {
|
|
1368
|
-
removeSpecular: !0,
|
|
1369
|
-
removeShininess: !0
|
|
1355
|
+
if (!q)
|
|
1356
|
+
return;
|
|
1357
|
+
he = q;
|
|
1358
|
+
const B = u(), T = c(), C = new M.Group();
|
|
1359
|
+
C.name = "GLBSubject", C.add(q), q.traverse((i) => {
|
|
1360
|
+
i.isMesh && (i.castShadow = !0, i.receiveShadow = !0);
|
|
1361
|
+
}), Vt(q, r.value), q.scale.setScalar(Do), q.updateMatrixWorld(!0);
|
|
1362
|
+
const G = Mt(q);
|
|
1363
|
+
C.position.y -= G.bottom, C.updateMatrixWorld(!0), B.add(C), he = C;
|
|
1364
|
+
const d = Mt(C);
|
|
1365
|
+
t.setBounds(d), g(B, T), w(d), F(d), o.subjectLoaded = !0;
|
|
1370
1366
|
});
|
|
1371
|
-
},
|
|
1372
|
-
if (
|
|
1373
|
-
|
|
1367
|
+
}, f = () => {
|
|
1368
|
+
if (!he) return;
|
|
1369
|
+
u().remove(he), he.traverse((w) => {
|
|
1370
|
+
var Z;
|
|
1371
|
+
if (!w.isMesh) return;
|
|
1372
|
+
(Z = w.geometry) == null || Z.dispose();
|
|
1373
|
+
const F = w.material;
|
|
1374
|
+
Array.isArray(F) ? F.forEach((U) => U == null ? void 0 : U.dispose()) : F == null || F.dispose();
|
|
1375
|
+
}), he = null, o.subjectLoaded = !1;
|
|
1376
|
+
}, E = (S) => {
|
|
1377
|
+
Vt(he, S);
|
|
1378
|
+
}, D = () => he, y = () => {
|
|
1379
|
+
if (Ae || ze) {
|
|
1380
|
+
console.warn("useGLB.init() called more than once");
|
|
1374
1381
|
return;
|
|
1375
1382
|
}
|
|
1376
|
-
|
|
1383
|
+
Ae = O(
|
|
1377
1384
|
() => n.value,
|
|
1378
|
-
(
|
|
1379
|
-
!
|
|
1385
|
+
(S, w) => {
|
|
1386
|
+
!S || S === w || l.value && b(l.value);
|
|
1380
1387
|
},
|
|
1381
1388
|
{ immediate: !0 }
|
|
1382
|
-
),
|
|
1389
|
+
), ze = O(
|
|
1383
1390
|
() => r.value,
|
|
1384
|
-
(
|
|
1391
|
+
(S) => E(S)
|
|
1385
1392
|
);
|
|
1386
|
-
},
|
|
1387
|
-
|
|
1393
|
+
}, k = () => {
|
|
1394
|
+
Ae == null || Ae(), ze == null || ze(), Ae = null, ze = null, f(), fe == null || fe.dispose(), fe = null;
|
|
1388
1395
|
};
|
|
1389
1396
|
return Rt(() => {
|
|
1390
|
-
|
|
1391
|
-
}), { init:
|
|
1392
|
-
},
|
|
1397
|
+
k();
|
|
1398
|
+
}), { init: y, get: D, dispose: k, updateColor: E };
|
|
1399
|
+
}, Mo = (e, t, o = 500) => {
|
|
1393
1400
|
const s = e.material;
|
|
1394
1401
|
s.transparent = !0;
|
|
1395
|
-
const n = s.opacity, r = performance.now(), l = (
|
|
1396
|
-
const
|
|
1402
|
+
const n = s.opacity, r = performance.now(), l = (a) => {
|
|
1403
|
+
const c = a - r, u = Math.min(c / o, 1), g = n + (t - n) * u;
|
|
1397
1404
|
s.opacity = g, u < 1 && requestAnimationFrame(l);
|
|
1398
1405
|
};
|
|
1399
1406
|
requestAnimationFrame(l);
|
|
1400
1407
|
};
|
|
1401
|
-
let
|
|
1408
|
+
let H = null, Ie = null, $e = null, Ne = null, Ze = null;
|
|
1402
1409
|
const Pt = () => {
|
|
1403
|
-
const e =
|
|
1404
|
-
const
|
|
1405
|
-
size:
|
|
1410
|
+
const e = Me(), t = Ve(), o = ye(), { show: s, lineColor: n, centerLineColor: r, divisions: l, size: a, opacity: c } = I(e), { offset: u } = I(t), { bounds: g } = I(o), { get: b } = De(), f = () => {
|
|
1411
|
+
const B = Z(n.value), T = Z(r.value), { positions: C, colors: G } = E({
|
|
1412
|
+
size: a.value,
|
|
1406
1413
|
divisions: l.value,
|
|
1407
|
-
color:
|
|
1408
|
-
centerColor:
|
|
1409
|
-
}),
|
|
1410
|
-
return new
|
|
1411
|
-
},
|
|
1412
|
-
const
|
|
1413
|
-
|
|
1414
|
-
const
|
|
1415
|
-
|
|
1414
|
+
color: B,
|
|
1415
|
+
centerColor: T
|
|
1416
|
+
}), d = D(C, G), i = y(c.value);
|
|
1417
|
+
return new M.LineSegments(d, i);
|
|
1418
|
+
}, E = ({ size: B, divisions: T, color: C, centerColor: G }) => {
|
|
1419
|
+
const d = B / 2, i = B / T, x = [], V = [], A = Math.floor(T / 2), j = (L, P, W, _) => {
|
|
1420
|
+
x.push(L, P, W);
|
|
1421
|
+
const K = _ ? G : C;
|
|
1422
|
+
V.push(K.r, K.g, K.b);
|
|
1416
1423
|
};
|
|
1417
|
-
for (let
|
|
1418
|
-
const
|
|
1419
|
-
for (let
|
|
1420
|
-
const
|
|
1421
|
-
j(-
|
|
1424
|
+
for (let L = 0; L <= T; L++) {
|
|
1425
|
+
const P = -d + L * i, W = L === A;
|
|
1426
|
+
for (let _ = 0; _ <= T; _++) {
|
|
1427
|
+
const K = -d + _ * i, m = W || _ === A;
|
|
1428
|
+
j(-d, P, K, m), j(+d, P, K, m);
|
|
1422
1429
|
}
|
|
1423
1430
|
}
|
|
1424
|
-
for (let
|
|
1425
|
-
const
|
|
1426
|
-
for (let
|
|
1427
|
-
const
|
|
1428
|
-
j(
|
|
1431
|
+
for (let L = 0; L <= T; L++) {
|
|
1432
|
+
const P = -d + L * i, W = L === A;
|
|
1433
|
+
for (let _ = 0; _ <= T; _++) {
|
|
1434
|
+
const K = -d + _ * i, m = W || _ === A;
|
|
1435
|
+
j(P, -d, K, m), j(P, +d, K, m);
|
|
1429
1436
|
}
|
|
1430
1437
|
}
|
|
1431
|
-
for (let
|
|
1432
|
-
const
|
|
1433
|
-
for (let
|
|
1434
|
-
const
|
|
1435
|
-
j(
|
|
1438
|
+
for (let L = 0; L <= T; L++) {
|
|
1439
|
+
const P = -d + L * i, W = L === A;
|
|
1440
|
+
for (let _ = 0; _ <= T; _++) {
|
|
1441
|
+
const K = -d + _ * i, m = W || _ === A;
|
|
1442
|
+
j(P, K, -d, m), j(P, K, +d, m);
|
|
1436
1443
|
}
|
|
1437
1444
|
}
|
|
1438
|
-
return { positions:
|
|
1439
|
-
},
|
|
1440
|
-
const
|
|
1441
|
-
return
|
|
1445
|
+
return { positions: x, colors: V };
|
|
1446
|
+
}, D = (B, T) => {
|
|
1447
|
+
const C = new M.BufferGeometry();
|
|
1448
|
+
return C.setAttribute(
|
|
1442
1449
|
"position",
|
|
1443
|
-
new
|
|
1444
|
-
),
|
|
1445
|
-
}, y = (
|
|
1450
|
+
new M.Float32BufferAttribute(B, 3)
|
|
1451
|
+
), C.setAttribute("color", new M.Float32BufferAttribute(T, 3)), C;
|
|
1452
|
+
}, y = (B) => new M.LineBasicMaterial({
|
|
1446
1453
|
transparent: !0,
|
|
1447
|
-
opacity:
|
|
1454
|
+
opacity: B,
|
|
1448
1455
|
depthWrite: !1,
|
|
1449
|
-
blending:
|
|
1456
|
+
blending: M.NormalBlending,
|
|
1450
1457
|
vertexColors: !1
|
|
1451
|
-
}),
|
|
1452
|
-
|
|
1453
|
-
},
|
|
1454
|
-
const
|
|
1455
|
-
|
|
1456
|
-
},
|
|
1457
|
-
|
|
1458
|
-
},
|
|
1459
|
-
const
|
|
1460
|
-
|
|
1461
|
-
},
|
|
1462
|
-
r: (
|
|
1463
|
-
g: (
|
|
1464
|
-
b: (
|
|
1465
|
-
}),
|
|
1466
|
-
if (!
|
|
1467
|
-
const
|
|
1468
|
-
for (let
|
|
1469
|
-
const
|
|
1470
|
-
|
|
1458
|
+
}), k = () => {
|
|
1459
|
+
H && F(s.value);
|
|
1460
|
+
}, S = () => {
|
|
1461
|
+
const B = b();
|
|
1462
|
+
H = f(n.value), Q(), B.add(H), w(0);
|
|
1463
|
+
}, w = (B) => {
|
|
1464
|
+
H && (H.material.transparent = !0, B = s.value ? B : 0, H.material.opacity = B);
|
|
1465
|
+
}, F = (B) => {
|
|
1466
|
+
const T = B ? c.value : 0;
|
|
1467
|
+
Mo(H, T, 500);
|
|
1468
|
+
}, Z = (B) => ({
|
|
1469
|
+
r: (B >> 16 & 255) / 255,
|
|
1470
|
+
g: (B >> 8 & 255) / 255,
|
|
1471
|
+
b: (B & 255) / 255
|
|
1472
|
+
}), U = (B, T) => {
|
|
1473
|
+
if (!H) return;
|
|
1474
|
+
const C = Z(B), G = Z(T), d = H.geometry.attributes.color, i = H.geometry.attributes.position, x = i.count, V = a.value / 2, A = a.value / l.value, j = Math.floor(l.value / 2);
|
|
1475
|
+
for (let L = 0; L < x; L++) {
|
|
1476
|
+
const P = i.getX(L), W = i.getY(L), _ = i.getZ(L), K = Math.round((P + V) / A), re = Math.round((W + V) / A), m = Math.round((_ + V) / A), le = K === j || re === j || m === j ? C : G;
|
|
1477
|
+
d.setXYZ(L, le.r, le.g, le.b);
|
|
1471
1478
|
}
|
|
1472
|
-
|
|
1473
|
-
},
|
|
1474
|
-
const
|
|
1475
|
-
|
|
1476
|
-
},
|
|
1477
|
-
var
|
|
1478
|
-
const
|
|
1479
|
-
|
|
1479
|
+
d.needsUpdate = !0;
|
|
1480
|
+
}, Y = () => {
|
|
1481
|
+
const B = b();
|
|
1482
|
+
H && (B.remove(H), H.geometry.dispose(), H.material.dispose(), H = null), H = f(n.value), Q(), B.add(H);
|
|
1483
|
+
}, Q = () => {
|
|
1484
|
+
var T;
|
|
1485
|
+
const B = ((T = g.value) == null ? void 0 : T.bottom) || 0;
|
|
1486
|
+
H.position.set(0, B + a.value / 2 + 7e-3, 0);
|
|
1480
1487
|
};
|
|
1481
|
-
return
|
|
1482
|
-
() => [
|
|
1483
|
-
([
|
|
1484
|
-
|
|
1488
|
+
return Ie = O(
|
|
1489
|
+
() => [a.value, l.value],
|
|
1490
|
+
([B, T], [C, G]) => {
|
|
1491
|
+
B === C && T === G || (Y(), k());
|
|
1485
1492
|
},
|
|
1486
1493
|
{ flush: "post" }
|
|
1487
|
-
),
|
|
1494
|
+
), $e = O(
|
|
1488
1495
|
() => s.value,
|
|
1489
1496
|
() => {
|
|
1490
|
-
|
|
1497
|
+
k();
|
|
1491
1498
|
},
|
|
1492
1499
|
{ flush: "post" }
|
|
1493
|
-
), Ne =
|
|
1494
|
-
() =>
|
|
1495
|
-
(
|
|
1496
|
-
|
|
1500
|
+
), Ne = O(
|
|
1501
|
+
() => c.value,
|
|
1502
|
+
(B) => {
|
|
1503
|
+
w(B);
|
|
1497
1504
|
},
|
|
1498
1505
|
{ flush: "post" }
|
|
1499
|
-
),
|
|
1506
|
+
), Ze = O(
|
|
1500
1507
|
() => [n.value, r.value],
|
|
1501
|
-
([
|
|
1502
|
-
|
|
1508
|
+
([B, T]) => {
|
|
1509
|
+
U(T, B);
|
|
1503
1510
|
}
|
|
1504
1511
|
), {
|
|
1505
|
-
init:
|
|
1506
|
-
showHideGrid:
|
|
1507
|
-
updateGridColors:
|
|
1512
|
+
init: S,
|
|
1513
|
+
showHideGrid: F,
|
|
1514
|
+
updateGridColors: U,
|
|
1508
1515
|
dispose: () => {
|
|
1509
|
-
var
|
|
1510
|
-
const
|
|
1511
|
-
|
|
1516
|
+
var T, C;
|
|
1517
|
+
const B = b();
|
|
1518
|
+
Ie == null || Ie(), $e == null || $e(), Ne == null || Ne(), Ze == null || Ze(), Ie = null, $e = null, Ne = null, Ze = null, H && (B.remove(H), (T = H.geometry) == null || T.dispose(), Array.isArray(H.material) ? H.material.forEach((G) => G == null ? void 0 : G.dispose()) : (C = H.material) == null || C.dispose(), H = null);
|
|
1512
1519
|
}
|
|
1513
1520
|
};
|
|
1514
|
-
},
|
|
1521
|
+
}, ko = { class: "three-dimension-tool" }, Eo = ["data-id"], Ao = /* @__PURE__ */ Object.assign({
|
|
1515
1522
|
name: "ThreeDimensionTool",
|
|
1516
1523
|
slug: "three-dimension-tool",
|
|
1517
1524
|
inheritAttrs: !1
|
|
@@ -1521,93 +1528,93 @@ const Pt = () => {
|
|
|
1521
1528
|
id: Number
|
|
1522
1529
|
},
|
|
1523
1530
|
setup(e) {
|
|
1524
|
-
const
|
|
1525
|
-
let
|
|
1526
|
-
const s =
|
|
1527
|
-
let g,
|
|
1528
|
-
const
|
|
1529
|
-
if (!
|
|
1531
|
+
const t = e;
|
|
1532
|
+
let o = null;
|
|
1533
|
+
const s = v(() => Number(t.id)), n = p(), r = Be(), l = ye(), { move: a } = I(r), c = ee(null), u = ee(!1);
|
|
1534
|
+
let g, b, f;
|
|
1535
|
+
const E = st(), D = xt(), y = wt(), { init: k } = De(), { init: S } = St(), { init: w } = Le(), { init: F, updateVisibility: Z } = Lt(), { init: U, updatePosition: Y } = nt(), { init: Q } = Ft(), { init: q } = Pt(), B = () => {
|
|
1536
|
+
if (!c.value || u.value) {
|
|
1530
1537
|
console.warn("Canvas element not found");
|
|
1531
1538
|
return;
|
|
1532
1539
|
}
|
|
1533
|
-
u.value = !0, f =
|
|
1534
|
-
},
|
|
1535
|
-
u.value && (
|
|
1536
|
-
},
|
|
1537
|
-
if (
|
|
1538
|
-
const
|
|
1539
|
-
n.$patch({ width:
|
|
1540
|
+
u.value = !0, f = k(), b = S(c.value), Q(), g = w(), U(), q(), F(), E.init(b), T();
|
|
1541
|
+
}, T = () => {
|
|
1542
|
+
u.value && (a.value !== o && (o = a.value, a.value ? y.activate() : D.activate()), E.update(), a.value ? (Y(), y.syncToStore()) : D.syncToStore(), Z(), b.render(f, g), requestAnimationFrame(T));
|
|
1543
|
+
}, C = () => {
|
|
1544
|
+
if (c.value) {
|
|
1545
|
+
const G = window.innerWidth, d = window.innerHeight;
|
|
1546
|
+
n.$patch({ width: G, height: d }), c.value.style.height = d + "px";
|
|
1540
1547
|
}
|
|
1541
1548
|
};
|
|
1542
|
-
return
|
|
1543
|
-
console.log("onMounted",
|
|
1544
|
-
}),
|
|
1549
|
+
return Xt(() => {
|
|
1550
|
+
console.log("onMounted", c.value), B(), window.addEventListener("resize", C), C();
|
|
1551
|
+
}), O(
|
|
1545
1552
|
() => l.bounds,
|
|
1546
|
-
(
|
|
1547
|
-
|
|
1553
|
+
(G) => {
|
|
1554
|
+
G && (E.frameToBounds(G), y.activate(), y.frameToBounds(G), y.syncToStore(), D.activate(), D.frameToBounds(G), D.syncToStore());
|
|
1548
1555
|
}
|
|
1549
|
-
),
|
|
1556
|
+
), O(
|
|
1550
1557
|
() => n.subjectLoaded,
|
|
1551
|
-
(
|
|
1552
|
-
if (!
|
|
1553
|
-
const
|
|
1554
|
-
if (!
|
|
1555
|
-
|
|
1556
|
-
const
|
|
1557
|
-
|
|
1558
|
+
(G) => {
|
|
1559
|
+
if (!G) return;
|
|
1560
|
+
const d = l.bounds;
|
|
1561
|
+
if (!d) return;
|
|
1562
|
+
E.frameToBounds(d);
|
|
1563
|
+
const i = E.get();
|
|
1564
|
+
i.update(), i.saveState();
|
|
1558
1565
|
}
|
|
1559
1566
|
), Rt(() => {
|
|
1560
|
-
console.debug("ThreeDimensionTool unMounted"), window.removeEventListener("resize", this), u.value = !1, Ft().dispose(), Pt().dispose(), Lt().dispose(), nt().dispose(), st().dispose(),
|
|
1561
|
-
}), (
|
|
1562
|
-
|
|
1563
|
-
|
|
1567
|
+
console.debug("ThreeDimensionTool unMounted"), window.removeEventListener("resize", this), u.value = !1, Ft().dispose(), Pt().dispose(), Lt().dispose(), nt().dispose(), st().dispose(), Le().dispose(), De().dispose(), St().dispose();
|
|
1568
|
+
}), (G, d) => (Je(), Yt("div", ko, [
|
|
1569
|
+
ht("", !0),
|
|
1570
|
+
Qt("div", {
|
|
1564
1571
|
class: "tres",
|
|
1565
1572
|
ref_key: "tres",
|
|
1566
|
-
ref:
|
|
1573
|
+
ref: c,
|
|
1567
1574
|
"data-id": s.value
|
|
1568
|
-
}, null, 8,
|
|
1575
|
+
}, null, 8, Eo)
|
|
1569
1576
|
]));
|
|
1570
1577
|
}
|
|
1571
|
-
}), Gt = /* @__PURE__ */ Object.assign({ "../i18n/en-US/index.js": () => import("./index-CIql5zKW.js") }),
|
|
1572
|
-
const
|
|
1578
|
+
}), Gt = /* @__PURE__ */ Object.assign({ "../i18n/en-US/index.js": () => import("./index-CIql5zKW.js") }), J = (e = "../i18n") => {
|
|
1579
|
+
const t = no(), o = ee({}), s = v(() => t.lang.isoName || "en-US"), n = async () => {
|
|
1573
1580
|
const r = `${e}/${s.value}/index.js`;
|
|
1574
1581
|
if (Gt[r])
|
|
1575
1582
|
try {
|
|
1576
1583
|
const l = await Gt[r]();
|
|
1577
|
-
l.default && Object.assign(
|
|
1584
|
+
l.default && Object.assign(o.value, l.default);
|
|
1578
1585
|
} catch (l) {
|
|
1579
1586
|
console.error(`Error loading i18n for ${s.value}`, l);
|
|
1580
1587
|
}
|
|
1581
1588
|
else
|
|
1582
1589
|
console.error(`Module not found: ${r}`);
|
|
1583
1590
|
};
|
|
1584
|
-
return
|
|
1591
|
+
return O(
|
|
1585
1592
|
() => s.value,
|
|
1586
1593
|
() => {
|
|
1587
1594
|
n();
|
|
1588
1595
|
},
|
|
1589
1596
|
{ immediate: !0 }
|
|
1590
|
-
),
|
|
1597
|
+
), Wt(() => {
|
|
1591
1598
|
n();
|
|
1592
|
-
}), { lang:
|
|
1593
|
-
},
|
|
1594
|
-
const s = ao(), n =
|
|
1595
|
-
get: () => n.isExpanded(
|
|
1596
|
-
set: (
|
|
1597
|
-
|
|
1599
|
+
}), { lang: o };
|
|
1600
|
+
}, Se = ({ tab: e = oe, store: t, options: o = [] }) => {
|
|
1601
|
+
const s = ao(), n = p(s), r = v({
|
|
1602
|
+
get: () => n.isExpanded(o),
|
|
1603
|
+
set: (c) => {
|
|
1604
|
+
c && n.setActive(e);
|
|
1598
1605
|
}
|
|
1599
|
-
}), l =
|
|
1606
|
+
}), l = v(() => t && t.changed);
|
|
1600
1607
|
return { click: () => n.setActive(e), expanded: r, selected: l };
|
|
1601
|
-
},
|
|
1608
|
+
}, Dt = $({
|
|
1602
1609
|
name: "ToolResetButton",
|
|
1603
1610
|
props: {
|
|
1604
1611
|
label: { type: String, required: !1, default: "Reset" },
|
|
1605
1612
|
disable: Boolean
|
|
1606
1613
|
},
|
|
1607
1614
|
emits: ["click"],
|
|
1608
|
-
setup(e, { slots:
|
|
1615
|
+
setup(e, { slots: t, emit: o }) {
|
|
1609
1616
|
function s() {
|
|
1610
|
-
|
|
1617
|
+
o("click");
|
|
1611
1618
|
}
|
|
1612
1619
|
function n() {
|
|
1613
1620
|
const r = {
|
|
@@ -1617,37 +1624,37 @@ const Pt = () => {
|
|
|
1617
1624
|
onClick: s,
|
|
1618
1625
|
disable: e.disable
|
|
1619
1626
|
};
|
|
1620
|
-
return
|
|
1627
|
+
return h("div", { class: "tool-reset-button q-pa-md" }, h(Ot, r));
|
|
1621
1628
|
}
|
|
1622
1629
|
return () => n();
|
|
1623
1630
|
}
|
|
1624
|
-
}),
|
|
1631
|
+
}), It = $({
|
|
1625
1632
|
name: "TdColorsSection",
|
|
1626
|
-
setup(e, { slots:
|
|
1627
|
-
const { lang: s } =
|
|
1633
|
+
setup(e, { slots: t, emit: o }) {
|
|
1634
|
+
const { lang: s } = J(), n = p(), r = lt(), l = ye(), a = Ve(), { active: c } = I(n), u = ee(!1), g = ee(!1), b = ee(!1), f = v(
|
|
1628
1635
|
() => {
|
|
1629
|
-
var
|
|
1630
|
-
return (
|
|
1636
|
+
var C;
|
|
1637
|
+
return (C = s.value.td) == null ? void 0 : C.components.colors.items.background;
|
|
1631
1638
|
}
|
|
1632
|
-
),
|
|
1639
|
+
), E = v(
|
|
1633
1640
|
() => {
|
|
1634
|
-
var
|
|
1635
|
-
return (
|
|
1641
|
+
var C;
|
|
1642
|
+
return (C = s.value.td) == null ? void 0 : C.components.colors.items.subject;
|
|
1636
1643
|
}
|
|
1637
|
-
),
|
|
1644
|
+
), D = v(
|
|
1638
1645
|
() => {
|
|
1639
|
-
var
|
|
1640
|
-
return (
|
|
1646
|
+
var C;
|
|
1647
|
+
return (C = s.value.td) == null ? void 0 : C.components.colors.items.ground;
|
|
1641
1648
|
}
|
|
1642
|
-
), y =
|
|
1643
|
-
key:
|
|
1644
|
-
label:
|
|
1649
|
+
), y = v(() => ({
|
|
1650
|
+
key: E.value,
|
|
1651
|
+
label: E.value,
|
|
1645
1652
|
type: "none",
|
|
1646
1653
|
icon: "f_subject",
|
|
1647
1654
|
size: "sm",
|
|
1648
1655
|
color: l.colorHex,
|
|
1649
1656
|
onClick: () => g.value = !0
|
|
1650
|
-
})),
|
|
1657
|
+
})), k = v(() => ({
|
|
1651
1658
|
key: f.value,
|
|
1652
1659
|
label: f.value,
|
|
1653
1660
|
type: "none",
|
|
@@ -1655,67 +1662,67 @@ const Pt = () => {
|
|
|
1655
1662
|
size: "sm",
|
|
1656
1663
|
color: r.colorHex,
|
|
1657
1664
|
onClick: () => u.value = !0
|
|
1658
|
-
})),
|
|
1659
|
-
key:
|
|
1660
|
-
label:
|
|
1665
|
+
})), S = v(() => ({
|
|
1666
|
+
key: D.value,
|
|
1667
|
+
label: D.value,
|
|
1661
1668
|
type: "none",
|
|
1662
1669
|
icon: "f_ground",
|
|
1663
1670
|
size: "sm",
|
|
1664
|
-
color:
|
|
1665
|
-
onClick: () =>
|
|
1666
|
-
})),
|
|
1667
|
-
get: () =>
|
|
1668
|
-
set: (
|
|
1669
|
-
}),
|
|
1670
|
-
get: () =>
|
|
1671
|
-
set: (
|
|
1672
|
-
if (console.log("showGround",
|
|
1673
|
-
console.log("val",
|
|
1671
|
+
color: a.colorHex,
|
|
1672
|
+
onClick: () => b.value = !0
|
|
1673
|
+
})), w = v({
|
|
1674
|
+
get: () => b.value || u.value || g.value,
|
|
1675
|
+
set: (C) => b.value = u.value = g.value = !1
|
|
1676
|
+
}), F = v({
|
|
1677
|
+
get: () => b.value ? a.colorHex : u.value ? r.colorHex : l.colorHex,
|
|
1678
|
+
set: (C) => {
|
|
1679
|
+
if (console.log("showGround", b.value), b.value) {
|
|
1680
|
+
console.log("val", C), a.setColorHex(C);
|
|
1674
1681
|
return;
|
|
1675
1682
|
}
|
|
1676
1683
|
if (u.value) {
|
|
1677
|
-
r.setColorHex(
|
|
1684
|
+
r.setColorHex(C);
|
|
1678
1685
|
return;
|
|
1679
1686
|
}
|
|
1680
|
-
l.setColorHex(
|
|
1687
|
+
l.setColorHex(C);
|
|
1681
1688
|
}
|
|
1682
|
-
}),
|
|
1689
|
+
}), Z = v(() => ({
|
|
1683
1690
|
class: "td-colors-tool q-pa-xs row justify-center items-center q-gutter-md",
|
|
1684
|
-
style:
|
|
1685
|
-
})),
|
|
1686
|
-
modelValue:
|
|
1687
|
-
"onUpdate:modelValue": (
|
|
1688
|
-
show:
|
|
1689
|
-
"onUpdate:show": (
|
|
1690
|
-
label:
|
|
1691
|
-
})),
|
|
1692
|
-
r.reset(), l.resetColor(),
|
|
1693
|
-
},
|
|
1691
|
+
style: w.value ? "display: none" : ""
|
|
1692
|
+
})), U = v(() => ({
|
|
1693
|
+
modelValue: F.value,
|
|
1694
|
+
"onUpdate:modelValue": (C) => F.value = C,
|
|
1695
|
+
show: w.value,
|
|
1696
|
+
"onUpdate:show": (C) => w.value = C,
|
|
1697
|
+
label: Y.value
|
|
1698
|
+
})), Y = v(() => b.value ? D.value : u.value ? f.value : E.value), Q = () => {
|
|
1699
|
+
r.reset(), l.resetColor(), a.reset();
|
|
1700
|
+
}, q = v(() => l.changed || a.changed || r.changed), B = v(() => ({
|
|
1694
1701
|
label: "Reset Colors",
|
|
1695
|
-
onClick:
|
|
1696
|
-
style:
|
|
1697
|
-
disable: !
|
|
1702
|
+
onClick: Q,
|
|
1703
|
+
style: w.value ? "display: none" : "",
|
|
1704
|
+
disable: !q.value
|
|
1698
1705
|
}));
|
|
1699
|
-
|
|
1700
|
-
|
|
1706
|
+
O(c, (C) => {
|
|
1707
|
+
C !== oe && (w.value = !1);
|
|
1701
1708
|
});
|
|
1702
|
-
function
|
|
1703
|
-
return
|
|
1709
|
+
function T() {
|
|
1710
|
+
return h("div", {
|
|
1704
1711
|
class: "full-width"
|
|
1705
1712
|
// style: pickerShow.value ? 'display: none' : '',
|
|
1706
1713
|
}, [
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1714
|
+
h("div", Z.value, [
|
|
1715
|
+
h(ne, y.value),
|
|
1716
|
+
h(ne, k.value),
|
|
1717
|
+
h(ne, S.value)
|
|
1711
1718
|
]),
|
|
1712
|
-
|
|
1713
|
-
|
|
1719
|
+
h(Dt, B.value),
|
|
1720
|
+
h(qt, U.value)
|
|
1714
1721
|
]);
|
|
1715
1722
|
}
|
|
1716
|
-
return () =>
|
|
1723
|
+
return () => T();
|
|
1717
1724
|
}
|
|
1718
|
-
}),
|
|
1725
|
+
}), zo = $({
|
|
1719
1726
|
name: "TdColorsExpansion",
|
|
1720
1727
|
props: {
|
|
1721
1728
|
modelValue: { type: Number, default: 0 },
|
|
@@ -1723,101 +1730,101 @@ const Pt = () => {
|
|
|
1723
1730
|
label: { type: String, required: !1 }
|
|
1724
1731
|
},
|
|
1725
1732
|
emits: ["click", "update:modelValue"],
|
|
1726
|
-
setup(e, { slots:
|
|
1727
|
-
const { lang: s } =
|
|
1733
|
+
setup(e, { slots: t, emit: o }) {
|
|
1734
|
+
const { lang: s } = J(), n = Ut(), { expanded: r, selected: l } = Se({
|
|
1728
1735
|
store: n,
|
|
1729
|
-
options:
|
|
1730
|
-
tab:
|
|
1731
|
-
}),
|
|
1736
|
+
options: oe,
|
|
1737
|
+
tab: oe
|
|
1738
|
+
}), a = v(() => {
|
|
1732
1739
|
var u;
|
|
1733
1740
|
return (u = s.value.td) == null ? void 0 : u.components.colors.title;
|
|
1734
1741
|
});
|
|
1735
|
-
|
|
1742
|
+
v({
|
|
1736
1743
|
get: () => e.modelValue,
|
|
1737
|
-
set: (u) =>
|
|
1744
|
+
set: (u) => o("update:modelValue", u)
|
|
1738
1745
|
});
|
|
1739
|
-
function
|
|
1746
|
+
function c() {
|
|
1740
1747
|
const u = {
|
|
1741
1748
|
class: "td-colors-expansion",
|
|
1742
1749
|
"data-cy": "td-colors-expansion",
|
|
1743
1750
|
modelValue: r.value,
|
|
1744
1751
|
"onUpdate:modelValue": (g) => r.value = g,
|
|
1745
|
-
label:
|
|
1752
|
+
label: a.value,
|
|
1746
1753
|
selected: l.value,
|
|
1747
1754
|
icon: "f_palette"
|
|
1748
1755
|
};
|
|
1749
|
-
return
|
|
1756
|
+
return h(rt, u, () => h(It));
|
|
1750
1757
|
}
|
|
1751
|
-
return () =>
|
|
1758
|
+
return () => c();
|
|
1752
1759
|
}
|
|
1753
|
-
}), $t =
|
|
1760
|
+
}), $t = $({
|
|
1754
1761
|
name: "TdGridSection",
|
|
1755
|
-
setup(e, { slots:
|
|
1756
|
-
const { lang: s } =
|
|
1762
|
+
setup(e, { slots: t, emit: o }) {
|
|
1763
|
+
const { lang: s } = J(), n = Me(), r = v(
|
|
1757
1764
|
() => {
|
|
1758
|
-
var f,
|
|
1759
|
-
return l.value ? ((f = s.value.td) == null ? void 0 : f.components.grid.toggle.off) || "" : ((
|
|
1765
|
+
var f, E;
|
|
1766
|
+
return l.value ? ((f = s.value.td) == null ? void 0 : f.components.grid.toggle.off) || "" : ((E = s.value.td) == null ? void 0 : E.components.grid.toggle.on) || "";
|
|
1760
1767
|
}
|
|
1761
|
-
), l =
|
|
1768
|
+
), l = v({
|
|
1762
1769
|
get: () => n.show,
|
|
1763
1770
|
set: (f) => n.setProperty("show", f)
|
|
1764
|
-
}),
|
|
1771
|
+
}), a = v({
|
|
1765
1772
|
get: () => n.opacity,
|
|
1766
1773
|
set: (f) => n.setProperty("opacity", f)
|
|
1767
|
-
}),
|
|
1774
|
+
}), c = v({
|
|
1768
1775
|
get: () => n.size,
|
|
1769
1776
|
set: (f) => n.setProperty("size", f)
|
|
1770
|
-
}), u =
|
|
1777
|
+
}), u = v({
|
|
1771
1778
|
get: () => n.divisions,
|
|
1772
1779
|
set: (f) => n.setProperty("divisions", f)
|
|
1773
|
-
}), g =
|
|
1780
|
+
}), g = v(() => ({
|
|
1774
1781
|
label: "Reset Grid",
|
|
1775
1782
|
disable: !n.changed,
|
|
1776
1783
|
onClick: n.reset
|
|
1777
1784
|
}));
|
|
1778
|
-
function
|
|
1785
|
+
function b() {
|
|
1779
1786
|
const f = {
|
|
1780
1787
|
class: "td-grid-tool"
|
|
1781
|
-
},
|
|
1788
|
+
}, E = {
|
|
1782
1789
|
access: "grd",
|
|
1783
1790
|
// drawer: !props.noIcons,
|
|
1784
1791
|
modelValue: l.value,
|
|
1785
|
-
"onUpdate:modelValue": (
|
|
1792
|
+
"onUpdate:modelValue": (w) => l.value = w,
|
|
1786
1793
|
label: r.value
|
|
1787
1794
|
// dark: props.dark,
|
|
1788
1795
|
// disable: props.disable,
|
|
1789
1796
|
// hasAccess: props.hasAccess,
|
|
1790
1797
|
// onBlockAccess: emitBlockAccess,
|
|
1791
|
-
},
|
|
1798
|
+
}, D = {
|
|
1792
1799
|
title: "Opacity",
|
|
1793
1800
|
icon: "f_opacity",
|
|
1794
1801
|
min: 1,
|
|
1795
1802
|
max: 100,
|
|
1796
1803
|
initial: 50,
|
|
1797
|
-
modelValue:
|
|
1798
|
-
"onUpdate:modelValue": (
|
|
1804
|
+
modelValue: a.value * 100,
|
|
1805
|
+
"onUpdate:modelValue": (w) => a.value = w / 100
|
|
1799
1806
|
}, y = {
|
|
1800
1807
|
title: "Size",
|
|
1801
1808
|
icon: "f_size",
|
|
1802
1809
|
min: 100,
|
|
1803
1810
|
max: 300,
|
|
1804
1811
|
initial: 200,
|
|
1805
|
-
modelValue:
|
|
1806
|
-
"onUpdate:modelValue": (
|
|
1807
|
-
},
|
|
1812
|
+
modelValue: c.value * 100,
|
|
1813
|
+
"onUpdate:modelValue": (w) => c.value = w / 100
|
|
1814
|
+
}, k = {
|
|
1808
1815
|
title: "Number of lines",
|
|
1809
1816
|
icon: "f_grid",
|
|
1810
1817
|
min: 2,
|
|
1811
1818
|
max: 10,
|
|
1812
1819
|
initial: 6,
|
|
1813
1820
|
modelValue: u.value,
|
|
1814
|
-
"onUpdate:modelValue": (
|
|
1815
|
-
},
|
|
1816
|
-
return l.value && (
|
|
1821
|
+
"onUpdate:modelValue": (w) => u.value = w
|
|
1822
|
+
}, S = [h(Ke, E)];
|
|
1823
|
+
return l.value && (S.push(h(dt, y)), S.push(h(dt, k)), S.push(h(dt, D)), S.push(h(Dt, g.value))), h("div", f, S);
|
|
1817
1824
|
}
|
|
1818
|
-
return () =>
|
|
1825
|
+
return () => b();
|
|
1819
1826
|
}
|
|
1820
|
-
}),
|
|
1827
|
+
}), To = $({
|
|
1821
1828
|
name: "TdGridExpansion",
|
|
1822
1829
|
props: {
|
|
1823
1830
|
modelValue: { type: Number, default: 0 },
|
|
@@ -1825,34 +1832,34 @@ const Pt = () => {
|
|
|
1825
1832
|
label: { type: String, required: !1 }
|
|
1826
1833
|
},
|
|
1827
1834
|
emits: ["click", "update:modelValue"],
|
|
1828
|
-
setup(e, { slots:
|
|
1829
|
-
const { lang: s } =
|
|
1835
|
+
setup(e, { slots: t, emit: o }) {
|
|
1836
|
+
const { lang: s } = J(), n = Me(), { expanded: r, selected: l } = Se({
|
|
1830
1837
|
store: n,
|
|
1831
|
-
options:
|
|
1832
|
-
tab:
|
|
1833
|
-
}),
|
|
1838
|
+
options: xe,
|
|
1839
|
+
tab: xe
|
|
1840
|
+
}), a = v(() => {
|
|
1834
1841
|
var u;
|
|
1835
1842
|
return (u = s.value.td) == null ? void 0 : u.components.grid.title;
|
|
1836
1843
|
});
|
|
1837
|
-
|
|
1844
|
+
v({
|
|
1838
1845
|
get: () => e.modelValue,
|
|
1839
|
-
set: (u) =>
|
|
1846
|
+
set: (u) => o("update:modelValue", u)
|
|
1840
1847
|
});
|
|
1841
|
-
function
|
|
1848
|
+
function c() {
|
|
1842
1849
|
const u = {
|
|
1843
1850
|
class: "td-colors-expansion",
|
|
1844
1851
|
"data-cy": "td-colors-expansion",
|
|
1845
1852
|
modelValue: r.value,
|
|
1846
1853
|
"onUpdate:modelValue": (g) => r.value = g,
|
|
1847
|
-
label:
|
|
1854
|
+
label: a.value,
|
|
1848
1855
|
selected: l.value,
|
|
1849
1856
|
icon: "f_grid"
|
|
1850
1857
|
};
|
|
1851
|
-
return
|
|
1858
|
+
return h(rt, u, () => h($t));
|
|
1852
1859
|
}
|
|
1853
|
-
return () =>
|
|
1860
|
+
return () => c();
|
|
1854
1861
|
}
|
|
1855
|
-
}),
|
|
1862
|
+
}), Nt = $({
|
|
1856
1863
|
name: "TdLightsSection",
|
|
1857
1864
|
props: {
|
|
1858
1865
|
modelValue: { type: Number, default: 0 },
|
|
@@ -1860,172 +1867,172 @@ const Pt = () => {
|
|
|
1860
1867
|
label: { type: String, required: !1 }
|
|
1861
1868
|
},
|
|
1862
1869
|
emits: ["click", "update:modelValue"],
|
|
1863
|
-
setup(e, { slots:
|
|
1864
|
-
const { lang: s } =
|
|
1870
|
+
setup(e, { slots: t, emit: o }) {
|
|
1871
|
+
const { lang: s } = J(), n = Be(), r = p(), l = nt(), { active: a } = I(r), c = v({
|
|
1865
1872
|
get: () => n.advancedMode,
|
|
1866
|
-
set: (
|
|
1867
|
-
}), u =
|
|
1873
|
+
set: (m) => n.setAdvanced(m)
|
|
1874
|
+
}), u = v({
|
|
1868
1875
|
get: () => n.move,
|
|
1869
|
-
set: (
|
|
1870
|
-
}), g =
|
|
1876
|
+
set: (m) => n.setMove(m)
|
|
1877
|
+
}), g = v(
|
|
1871
1878
|
() => {
|
|
1872
|
-
var
|
|
1873
|
-
return n.advancedMode ? ((
|
|
1879
|
+
var m, N;
|
|
1880
|
+
return n.advancedMode ? ((m = s.value.td) == null ? void 0 : m.components.lights.toggles.advanced.off) || "" : ((N = s.value.td) == null ? void 0 : N.components.lights.toggles.advanced.on) || "";
|
|
1874
1881
|
}
|
|
1875
|
-
),
|
|
1876
|
-
modelValue:
|
|
1877
|
-
"onUpdate:modelValue": (
|
|
1882
|
+
), b = v(() => ({
|
|
1883
|
+
modelValue: c.value,
|
|
1884
|
+
"onUpdate:modelValue": (m) => c.value = m,
|
|
1878
1885
|
label: g.value
|
|
1879
|
-
})), f =
|
|
1886
|
+
})), f = v(
|
|
1880
1887
|
() => {
|
|
1881
|
-
var
|
|
1882
|
-
return n.move ? ((
|
|
1888
|
+
var m, N;
|
|
1889
|
+
return n.move ? ((m = s.value.td) == null ? void 0 : m.components.lights.toggles.position.off) || "" : ((N = s.value.td) == null ? void 0 : N.components.lights.toggles.position.on) || "";
|
|
1883
1890
|
}
|
|
1884
|
-
),
|
|
1891
|
+
), E = v(() => ({
|
|
1885
1892
|
modelValue: u.value,
|
|
1886
|
-
"onUpdate:modelValue": (
|
|
1893
|
+
"onUpdate:modelValue": (m) => u.value = m,
|
|
1887
1894
|
label: f.value
|
|
1888
|
-
})),
|
|
1895
|
+
})), D = v(
|
|
1889
1896
|
() => {
|
|
1890
|
-
var
|
|
1891
|
-
return ((
|
|
1897
|
+
var m;
|
|
1898
|
+
return ((m = s.value.td) == null ? void 0 : m.components.lights.color) || "";
|
|
1892
1899
|
}
|
|
1893
|
-
), y =
|
|
1894
|
-
key:
|
|
1895
|
-
label:
|
|
1900
|
+
), y = ee(!1), k = v(() => ({
|
|
1901
|
+
key: D.value,
|
|
1902
|
+
label: D.value,
|
|
1896
1903
|
type: "none",
|
|
1897
1904
|
icon: "f_bulb_light",
|
|
1898
1905
|
size: "sm",
|
|
1899
1906
|
color: n.colorHex("key"),
|
|
1900
1907
|
onClick: () => y.value = !0
|
|
1901
|
-
})),
|
|
1908
|
+
})), S = v(
|
|
1902
1909
|
() => {
|
|
1903
|
-
var
|
|
1904
|
-
return ((
|
|
1910
|
+
var m;
|
|
1911
|
+
return ((m = s.value.td) == null ? void 0 : m.components.lights.labels.key) || "";
|
|
1905
1912
|
}
|
|
1906
|
-
),
|
|
1913
|
+
), w = ee(!1), F = v({
|
|
1907
1914
|
get: () => n.colorHex("key"),
|
|
1908
|
-
set: (
|
|
1909
|
-
}),
|
|
1910
|
-
key:
|
|
1911
|
-
label:
|
|
1915
|
+
set: (m) => n.setColorHex("key", m)
|
|
1916
|
+
}), Z = v(() => ({
|
|
1917
|
+
key: S.value,
|
|
1918
|
+
label: S.value,
|
|
1912
1919
|
type: "none",
|
|
1913
1920
|
icon: "f_bulb_key",
|
|
1914
1921
|
size: "sm",
|
|
1915
|
-
color:
|
|
1916
|
-
onClick: () =>
|
|
1917
|
-
})),
|
|
1922
|
+
color: F.value,
|
|
1923
|
+
onClick: () => w.value = !0
|
|
1924
|
+
})), U = v(
|
|
1918
1925
|
() => {
|
|
1919
|
-
var
|
|
1920
|
-
return ((
|
|
1926
|
+
var m;
|
|
1927
|
+
return ((m = s.value.td) == null ? void 0 : m.components.lights.labels.back) || "";
|
|
1921
1928
|
}
|
|
1922
|
-
),
|
|
1929
|
+
), Y = ee(!1), Q = v({
|
|
1923
1930
|
get: () => n.colorHex("back"),
|
|
1924
|
-
set: (
|
|
1925
|
-
}),
|
|
1926
|
-
key:
|
|
1927
|
-
label:
|
|
1931
|
+
set: (m) => n.setColorHex("back", m)
|
|
1932
|
+
}), q = v(() => ({
|
|
1933
|
+
key: U.value,
|
|
1934
|
+
label: U.value,
|
|
1928
1935
|
type: "none",
|
|
1929
1936
|
icon: "f_bulb_back",
|
|
1930
1937
|
size: "sm",
|
|
1931
|
-
color:
|
|
1932
|
-
onClick: () =>
|
|
1933
|
-
disable: !
|
|
1934
|
-
})),
|
|
1938
|
+
color: Q.value,
|
|
1939
|
+
onClick: () => Y.value = !0,
|
|
1940
|
+
disable: !T.value
|
|
1941
|
+
})), B = v(
|
|
1935
1942
|
() => {
|
|
1936
|
-
var
|
|
1937
|
-
return
|
|
1943
|
+
var m, N;
|
|
1944
|
+
return T.value ? ((m = s.value.td) == null ? void 0 : m.components.lights.toggles.back.off) || "" : ((N = s.value.td) == null ? void 0 : N.components.lights.toggles.back.on) || "";
|
|
1938
1945
|
}
|
|
1939
|
-
),
|
|
1946
|
+
), T = v({
|
|
1940
1947
|
get: () => n.property("back", "visible", !0),
|
|
1941
|
-
set: (
|
|
1942
|
-
}),
|
|
1943
|
-
modelValue:
|
|
1944
|
-
"onUpdate:modelValue": (
|
|
1945
|
-
label:
|
|
1946
|
-
})),
|
|
1948
|
+
set: (m) => n.setProperty("back", "visible", m)
|
|
1949
|
+
}), C = v(() => ({
|
|
1950
|
+
modelValue: T.value,
|
|
1951
|
+
"onUpdate:modelValue": (m) => T.value = m,
|
|
1952
|
+
label: B.value
|
|
1953
|
+
})), G = v(
|
|
1947
1954
|
() => {
|
|
1948
|
-
var
|
|
1949
|
-
return ((
|
|
1955
|
+
var m;
|
|
1956
|
+
return ((m = s.value.td) == null ? void 0 : m.components.lights.labels.fill) || "";
|
|
1950
1957
|
}
|
|
1951
|
-
),
|
|
1958
|
+
), d = ee(!1), i = v({
|
|
1952
1959
|
get: () => n.colorHex("fill"),
|
|
1953
|
-
set: (
|
|
1954
|
-
}),
|
|
1955
|
-
key:
|
|
1956
|
-
label:
|
|
1960
|
+
set: (m) => n.setColorHex("fill", m)
|
|
1961
|
+
}), x = v(() => ({
|
|
1962
|
+
key: G.value,
|
|
1963
|
+
label: G.value,
|
|
1957
1964
|
type: "none",
|
|
1958
1965
|
icon: "f_bulb_fill",
|
|
1959
1966
|
size: "sm",
|
|
1960
|
-
color:
|
|
1961
|
-
onClick: () =>
|
|
1962
|
-
disable: !
|
|
1963
|
-
})),
|
|
1967
|
+
color: i.value,
|
|
1968
|
+
onClick: () => d.value = !0,
|
|
1969
|
+
disable: !A.value
|
|
1970
|
+
})), V = v(
|
|
1964
1971
|
() => {
|
|
1965
|
-
var
|
|
1966
|
-
return
|
|
1972
|
+
var m, N;
|
|
1973
|
+
return A.value ? ((m = s.value.td) == null ? void 0 : m.components.lights.toggles.fill.off) || "" : ((N = s.value.td) == null ? void 0 : N.components.lights.toggles.fill.on) || "";
|
|
1967
1974
|
}
|
|
1968
|
-
),
|
|
1975
|
+
), A = v({
|
|
1969
1976
|
get: () => n.property("fill", "visible", !0),
|
|
1970
|
-
set: (
|
|
1971
|
-
}), j =
|
|
1972
|
-
modelValue:
|
|
1973
|
-
"onUpdate:modelValue": (
|
|
1974
|
-
label:
|
|
1975
|
-
})),
|
|
1976
|
-
get: () => y.value ||
|
|
1977
|
-
set: (
|
|
1978
|
-
}),
|
|
1979
|
-
get: () => y.value ||
|
|
1980
|
-
set: (
|
|
1981
|
-
if (y.value ||
|
|
1982
|
-
n.setColorHex("key",
|
|
1977
|
+
set: (m) => n.setProperty("fill", "visible", m)
|
|
1978
|
+
}), j = v(() => ({
|
|
1979
|
+
modelValue: A.value,
|
|
1980
|
+
"onUpdate:modelValue": (m) => A.value = m,
|
|
1981
|
+
label: V.value
|
|
1982
|
+
})), L = v({
|
|
1983
|
+
get: () => y.value || w.value || d.value || Y.value,
|
|
1984
|
+
set: (m) => y.value = w.value = d.value = Y.value = !1
|
|
1985
|
+
}), P = v({
|
|
1986
|
+
get: () => y.value || w.value ? n.colorHex("key") : d.value ? n.colorHex("fill") : n.colorHex("back"),
|
|
1987
|
+
set: (m) => {
|
|
1988
|
+
if (y.value || w.value) {
|
|
1989
|
+
n.setColorHex("key", m);
|
|
1983
1990
|
return;
|
|
1984
1991
|
}
|
|
1985
|
-
if (
|
|
1986
|
-
n.setColorHex("fill",
|
|
1992
|
+
if (d.value) {
|
|
1993
|
+
n.setColorHex("fill", m);
|
|
1987
1994
|
return;
|
|
1988
1995
|
}
|
|
1989
|
-
n.setColorHex("back",
|
|
1996
|
+
n.setColorHex("back", m);
|
|
1990
1997
|
}
|
|
1991
|
-
}),
|
|
1992
|
-
modelValue:
|
|
1993
|
-
"onUpdate:modelValue": (
|
|
1994
|
-
show:
|
|
1995
|
-
"onUpdate:show": (
|
|
1996
|
-
label:
|
|
1997
|
-
})),
|
|
1998
|
+
}), W = v(() => ({
|
|
1999
|
+
modelValue: P.value,
|
|
2000
|
+
"onUpdate:modelValue": (m) => P.value = m,
|
|
2001
|
+
show: L.value,
|
|
2002
|
+
"onUpdate:show": (m) => L.value = m,
|
|
2003
|
+
label: _.value
|
|
2004
|
+
})), _ = v(() => y.value ? D.value : w.value ? S.value : d.value ? G.value : U.value), K = v(() => ({
|
|
1998
2005
|
label: "Reset Lights",
|
|
1999
2006
|
disable: !n.changed,
|
|
2000
2007
|
onClick: () => {
|
|
2001
2008
|
n.reset(), l.applyFromStore();
|
|
2002
2009
|
}
|
|
2003
2010
|
}));
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
}),
|
|
2007
|
-
|
|
2011
|
+
O(c, (m) => {
|
|
2012
|
+
m || (A.value = !0, T.value = !0);
|
|
2013
|
+
}), O(a, (m) => {
|
|
2014
|
+
m !== ve && (L.value = !1, u.value = !1);
|
|
2008
2015
|
});
|
|
2009
|
-
function
|
|
2010
|
-
const
|
|
2016
|
+
function re() {
|
|
2017
|
+
const m = {
|
|
2011
2018
|
class: "td-lights-tool"
|
|
2012
2019
|
};
|
|
2013
|
-
let
|
|
2014
|
-
if (
|
|
2015
|
-
|
|
2020
|
+
let N = [];
|
|
2021
|
+
if (L.value)
|
|
2022
|
+
N = [h(qt, W.value)];
|
|
2016
2023
|
else {
|
|
2017
2024
|
const le = {
|
|
2018
2025
|
class: "td-colors-tool q-pa-xs row justify-center items-center q-gutter-md"
|
|
2019
2026
|
}, ue = [];
|
|
2020
|
-
|
|
2021
|
-
const
|
|
2022
|
-
|
|
2027
|
+
c.value ? (ue.push(h(ne, Z.value)), ue.push(h(ne, x.value)), ue.push(h(ne, q.value))) : ue.push(h(ne, k.value));
|
|
2028
|
+
const je = [];
|
|
2029
|
+
je.push(h(Ke, E.value)), c.value && (je.push(h(Ke, j.value)), je.push(h(Ke, C.value))), je.push(h(Ke, b.value)), N = [h("div", le, ue), ...je], N.push(h(Dt, K.value));
|
|
2023
2030
|
}
|
|
2024
|
-
return
|
|
2031
|
+
return h("div", m, N);
|
|
2025
2032
|
}
|
|
2026
|
-
return () =>
|
|
2033
|
+
return () => re();
|
|
2027
2034
|
}
|
|
2028
|
-
}),
|
|
2035
|
+
}), Lo = $({
|
|
2029
2036
|
name: "TdLightExpansion",
|
|
2030
2037
|
props: {
|
|
2031
2038
|
modelValue: { type: Number, default: 0 },
|
|
@@ -2033,70 +2040,70 @@ const Pt = () => {
|
|
|
2033
2040
|
label: { type: String, required: !1 }
|
|
2034
2041
|
},
|
|
2035
2042
|
emits: ["click", "update:modelValue"],
|
|
2036
|
-
setup(e, { slots:
|
|
2037
|
-
const { lang: s } =
|
|
2043
|
+
setup(e, { slots: t, emit: o }) {
|
|
2044
|
+
const { lang: s } = J(), n = Be(), { expanded: r, selected: l } = Se({
|
|
2038
2045
|
store: n,
|
|
2039
|
-
options:
|
|
2040
|
-
tab:
|
|
2041
|
-
}),
|
|
2046
|
+
options: ve,
|
|
2047
|
+
tab: ve
|
|
2048
|
+
}), a = v(() => {
|
|
2042
2049
|
var u;
|
|
2043
2050
|
return (u = s.value.td) == null ? void 0 : u.components.lights.title;
|
|
2044
2051
|
});
|
|
2045
|
-
|
|
2052
|
+
v({
|
|
2046
2053
|
get: () => e.modelValue,
|
|
2047
|
-
set: (u) =>
|
|
2054
|
+
set: (u) => o("update:modelValue", u)
|
|
2048
2055
|
});
|
|
2049
|
-
function
|
|
2056
|
+
function c() {
|
|
2050
2057
|
const u = {
|
|
2051
2058
|
class: "td-lights-expansion",
|
|
2052
2059
|
"data-cy": "td-lights-expansion",
|
|
2053
2060
|
modelValue: r.value,
|
|
2054
2061
|
"onUpdate:modelValue": (g) => r.value = g,
|
|
2055
|
-
label:
|
|
2062
|
+
label: a.value,
|
|
2056
2063
|
selected: l.value,
|
|
2057
2064
|
icon: "f_bulb_light"
|
|
2058
2065
|
};
|
|
2059
|
-
return
|
|
2066
|
+
return h(rt, u, () => h(Nt));
|
|
2060
2067
|
}
|
|
2061
|
-
return () =>
|
|
2068
|
+
return () => c();
|
|
2062
2069
|
}
|
|
2063
|
-
}),
|
|
2070
|
+
}), Zt = $({
|
|
2064
2071
|
name: "TdRelatedSection",
|
|
2065
|
-
setup(e, { slots:
|
|
2066
|
-
const s = Symbol.for("RelatedThreeDSection"), n =
|
|
2067
|
-
function
|
|
2072
|
+
setup(e, { slots: t, emit: o }) {
|
|
2073
|
+
const s = Symbol.for("RelatedThreeDSection"), n = Jt(s), r = p(), l = ye(), { poseId: a } = I(l);
|
|
2074
|
+
function c() {
|
|
2068
2075
|
const u = {
|
|
2069
2076
|
class: "td-related-section q-mx-lg q-my-sm"
|
|
2070
2077
|
}, g = [];
|
|
2071
|
-
return n &&
|
|
2072
|
-
|
|
2073
|
-
id:
|
|
2074
|
-
|
|
2078
|
+
return n && a.value && g.push(
|
|
2079
|
+
h(n, {
|
|
2080
|
+
id: a.value,
|
|
2081
|
+
glbId: r.selected
|
|
2075
2082
|
})
|
|
2076
|
-
),
|
|
2083
|
+
), h("div", u, g);
|
|
2077
2084
|
}
|
|
2078
|
-
return () =>
|
|
2085
|
+
return () => c();
|
|
2079
2086
|
}
|
|
2080
|
-
}),
|
|
2087
|
+
}), Vo = $({
|
|
2081
2088
|
name: "TdRelatedExpansion",
|
|
2082
|
-
setup(e, { slots:
|
|
2083
|
-
const { expanded: s } =
|
|
2084
|
-
options:
|
|
2085
|
-
tab:
|
|
2086
|
-
}), n =
|
|
2089
|
+
setup(e, { slots: t, emit: o }) {
|
|
2090
|
+
const { expanded: s } = Se({
|
|
2091
|
+
options: we,
|
|
2092
|
+
tab: we
|
|
2093
|
+
}), n = v(() => "Related");
|
|
2087
2094
|
function r() {
|
|
2088
2095
|
const l = {
|
|
2089
2096
|
class: "td-related-expansion",
|
|
2090
2097
|
modelValue: s.value,
|
|
2091
|
-
"onUpdate:modelValue": (
|
|
2098
|
+
"onUpdate:modelValue": (a) => s.value = a,
|
|
2092
2099
|
label: n.value,
|
|
2093
2100
|
icon: "f_related"
|
|
2094
2101
|
};
|
|
2095
|
-
return
|
|
2102
|
+
return h(rt, l, () => h(Zt));
|
|
2096
2103
|
}
|
|
2097
2104
|
return () => r();
|
|
2098
2105
|
}
|
|
2099
|
-
}),
|
|
2106
|
+
}), Kt = $({
|
|
2100
2107
|
name: "TdButtons",
|
|
2101
2108
|
props: {
|
|
2102
2109
|
modelValue: { type: Number, default: 0 },
|
|
@@ -2108,191 +2115,191 @@ const Pt = () => {
|
|
|
2108
2115
|
}
|
|
2109
2116
|
},
|
|
2110
2117
|
emits: ["click", "update:modelValue"],
|
|
2111
|
-
setup(e, { slots:
|
|
2112
|
-
const s =
|
|
2113
|
-
function
|
|
2114
|
-
r.reset(), l.reset(),
|
|
2118
|
+
setup(e, { slots: t, emit: o }) {
|
|
2119
|
+
const s = xt(), n = wt(), r = Ct(), l = Ve(), a = Be(), c = lt(), u = ye(), { changed: g } = I(r), { changed: b } = I(l), { changed: f } = I(a), { changed: E } = I(c), { changed: D } = I(u), y = v(() => !(g.value || b.value || f.value || E.value || D.value));
|
|
2120
|
+
function k() {
|
|
2121
|
+
r.reset(), l.reset(), a.reset(), c.reset(), u.resetColor(), s.applyFromStore(), n.applyFromStore();
|
|
2115
2122
|
}
|
|
2116
|
-
const
|
|
2117
|
-
function
|
|
2118
|
-
const
|
|
2119
|
-
style:
|
|
2123
|
+
const S = (F) => F.preventDefault();
|
|
2124
|
+
function w() {
|
|
2125
|
+
const Z = {
|
|
2126
|
+
style: v(() => e.fixed ? "position: fixed;bottom: 0; left: 0; right: 0;border-top: 1px solid var(--grey-300)" : ""),
|
|
2120
2127
|
class: "row justify-center items-center q-pa-md"
|
|
2121
|
-
},
|
|
2128
|
+
}, U = {
|
|
2122
2129
|
class: "td-reset-button",
|
|
2123
2130
|
label: "Reset All",
|
|
2124
|
-
onClick:
|
|
2125
|
-
onKeyup:
|
|
2131
|
+
onClick: k,
|
|
2132
|
+
onKeyup: S,
|
|
2126
2133
|
rounded: !0,
|
|
2127
2134
|
unelevated: !0,
|
|
2128
2135
|
outline: !0,
|
|
2129
2136
|
disable: y.value
|
|
2130
2137
|
};
|
|
2131
|
-
return
|
|
2138
|
+
return h("div", Z, [h(Ot, U)]);
|
|
2132
2139
|
}
|
|
2133
|
-
return () =>
|
|
2140
|
+
return () => w();
|
|
2134
2141
|
}
|
|
2135
|
-
}),
|
|
2142
|
+
}), jo = $({
|
|
2136
2143
|
name: "TdExpansions",
|
|
2137
|
-
setup(e, { slots:
|
|
2144
|
+
setup(e, { slots: t, emit: o }) {
|
|
2138
2145
|
function s() {
|
|
2139
|
-
return
|
|
2146
|
+
return h("div", {
|
|
2140
2147
|
class: "td-expansions",
|
|
2141
2148
|
onClick: (r) => r.stopPropagation(),
|
|
2142
2149
|
style: "padding-bottom: 60px; position: relative "
|
|
2143
2150
|
}, [
|
|
2144
2151
|
// h(TsPoseButtonsSection),
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
+
h(Fe),
|
|
2153
|
+
h(zo),
|
|
2154
|
+
h(Fe),
|
|
2155
|
+
h(To),
|
|
2156
|
+
h(Fe),
|
|
2157
|
+
h(Lo),
|
|
2158
|
+
h(Fe),
|
|
2152
2159
|
// h(TsGridExpansion),
|
|
2153
2160
|
// h(QSeparator),
|
|
2154
2161
|
// h(TsAdjustmentExpansion),
|
|
2155
|
-
|
|
2156
|
-
|
|
2162
|
+
h(Vo),
|
|
2163
|
+
h(Fe),
|
|
2157
2164
|
// h('div', {}, store.loading.percent),
|
|
2158
|
-
|
|
2165
|
+
h(Kt)
|
|
2159
2166
|
]);
|
|
2160
2167
|
}
|
|
2161
2168
|
return () => s();
|
|
2162
2169
|
}
|
|
2163
|
-
}),
|
|
2170
|
+
}), Fo = $({
|
|
2164
2171
|
name: "TdColorsButton",
|
|
2165
2172
|
props: { size: String },
|
|
2166
2173
|
setup(e, {}) {
|
|
2167
|
-
const
|
|
2174
|
+
const t = Me(), o = p(), s = v(() => (o == null ? void 0 : o.hasAccess("grd")) || !1), { lang: n } = J(), r = v(() => {
|
|
2168
2175
|
var g;
|
|
2169
2176
|
return (g = n.value.td) == null ? void 0 : g.controls.colors.iconTitle;
|
|
2170
|
-
}), { click: l, selected:
|
|
2171
|
-
store:
|
|
2172
|
-
options:
|
|
2173
|
-
tab:
|
|
2177
|
+
}), { click: l, selected: a } = Se({
|
|
2178
|
+
store: t,
|
|
2179
|
+
options: oe,
|
|
2180
|
+
tab: oe
|
|
2174
2181
|
});
|
|
2175
|
-
function
|
|
2176
|
-
return
|
|
2182
|
+
function c(g) {
|
|
2183
|
+
return o.block(g);
|
|
2177
2184
|
}
|
|
2178
2185
|
function u() {
|
|
2179
2186
|
const g = {
|
|
2180
2187
|
hasAccess: s.value,
|
|
2181
|
-
selected:
|
|
2188
|
+
selected: a.value,
|
|
2182
2189
|
onClick: l,
|
|
2183
|
-
onBlockAccess:
|
|
2190
|
+
onBlockAccess: c,
|
|
2184
2191
|
size: e.size,
|
|
2185
|
-
"data-id":
|
|
2192
|
+
"data-id": oe,
|
|
2186
2193
|
name: "colors",
|
|
2187
2194
|
type: "none",
|
|
2188
2195
|
icon: "f_palette",
|
|
2189
2196
|
label: r.value
|
|
2190
2197
|
};
|
|
2191
|
-
return
|
|
2198
|
+
return h(ne, g, () => []);
|
|
2192
2199
|
}
|
|
2193
2200
|
return () => u();
|
|
2194
2201
|
}
|
|
2195
|
-
}),
|
|
2202
|
+
}), Po = $({
|
|
2196
2203
|
name: "TdGridButton",
|
|
2197
2204
|
props: { size: String },
|
|
2198
2205
|
setup(e, {}) {
|
|
2199
|
-
const
|
|
2206
|
+
const t = Me(), o = p(), s = v(() => (o == null ? void 0 : o.hasAccess("grd")) || !1), { lang: n } = J(), r = v(() => {
|
|
2200
2207
|
var g;
|
|
2201
2208
|
return (g = n.value.td) == null ? void 0 : g.controls.grid.iconTitle;
|
|
2202
|
-
}), { click: l, selected:
|
|
2203
|
-
store:
|
|
2204
|
-
options:
|
|
2205
|
-
tab:
|
|
2209
|
+
}), { click: l, selected: a } = Se({
|
|
2210
|
+
store: t,
|
|
2211
|
+
options: xe,
|
|
2212
|
+
tab: xe
|
|
2206
2213
|
});
|
|
2207
|
-
function
|
|
2208
|
-
return
|
|
2214
|
+
function c(g) {
|
|
2215
|
+
return o.block(g);
|
|
2209
2216
|
}
|
|
2210
2217
|
function u() {
|
|
2211
2218
|
const g = {
|
|
2212
2219
|
hasAccess: s.value,
|
|
2213
|
-
selected:
|
|
2220
|
+
selected: a.value,
|
|
2214
2221
|
onClick: l,
|
|
2215
|
-
onBlockAccess:
|
|
2222
|
+
onBlockAccess: c,
|
|
2216
2223
|
size: e.size,
|
|
2217
|
-
"data-id":
|
|
2224
|
+
"data-id": xe,
|
|
2218
2225
|
name: "grid",
|
|
2219
2226
|
type: "none",
|
|
2220
2227
|
icon: "f_grid",
|
|
2221
2228
|
label: r.value
|
|
2222
2229
|
};
|
|
2223
|
-
return
|
|
2230
|
+
return h(ne, g, () => []);
|
|
2224
2231
|
}
|
|
2225
2232
|
return () => u();
|
|
2226
2233
|
}
|
|
2227
|
-
}),
|
|
2234
|
+
}), Go = $({
|
|
2228
2235
|
name: "TdLightsButton",
|
|
2229
2236
|
props: { size: String },
|
|
2230
2237
|
setup(e, {}) {
|
|
2231
|
-
const
|
|
2238
|
+
const t = Me(), o = p(), s = v(() => (o == null ? void 0 : o.hasAccess("grd")) || !1), { lang: n } = J(), r = v(() => {
|
|
2232
2239
|
var g;
|
|
2233
2240
|
return (g = n.value.td) == null ? void 0 : g.controls.lights.iconTitle;
|
|
2234
|
-
}), { click: l, selected:
|
|
2235
|
-
store:
|
|
2236
|
-
options:
|
|
2237
|
-
tab:
|
|
2241
|
+
}), { click: l, selected: a } = Se({
|
|
2242
|
+
store: t,
|
|
2243
|
+
options: ve,
|
|
2244
|
+
tab: ve
|
|
2238
2245
|
});
|
|
2239
|
-
function
|
|
2240
|
-
return
|
|
2246
|
+
function c(g) {
|
|
2247
|
+
return o.block(g);
|
|
2241
2248
|
}
|
|
2242
2249
|
function u() {
|
|
2243
2250
|
const g = {
|
|
2244
2251
|
hasAccess: s.value,
|
|
2245
|
-
selected:
|
|
2252
|
+
selected: a.value,
|
|
2246
2253
|
onClick: l,
|
|
2247
|
-
onBlockAccess:
|
|
2254
|
+
onBlockAccess: c,
|
|
2248
2255
|
size: e.size,
|
|
2249
|
-
"data-id":
|
|
2256
|
+
"data-id": ve,
|
|
2250
2257
|
name: "lights",
|
|
2251
2258
|
type: "none",
|
|
2252
2259
|
icon: "f_bulb_light",
|
|
2253
2260
|
label: r.value
|
|
2254
2261
|
};
|
|
2255
|
-
return
|
|
2262
|
+
return h(ne, g, () => []);
|
|
2256
2263
|
}
|
|
2257
2264
|
return () => u();
|
|
2258
2265
|
}
|
|
2259
|
-
}),
|
|
2266
|
+
}), Ho = $({
|
|
2260
2267
|
name: "TsAdjustmentsButton",
|
|
2261
2268
|
props: { size: String },
|
|
2262
2269
|
setup(e, {}) {
|
|
2263
|
-
const
|
|
2264
|
-
var
|
|
2265
|
-
return (
|
|
2266
|
-
}), { click: n, selected: r } =
|
|
2267
|
-
options:
|
|
2268
|
-
tab:
|
|
2270
|
+
const t = p(), { lang: o } = J(), s = v(() => {
|
|
2271
|
+
var c;
|
|
2272
|
+
return (c = o.value.td) == null ? void 0 : c.controls.related.iconTitle;
|
|
2273
|
+
}), { click: n, selected: r } = Se({
|
|
2274
|
+
options: we,
|
|
2275
|
+
tab: we
|
|
2269
2276
|
});
|
|
2270
|
-
function l(
|
|
2271
|
-
return
|
|
2277
|
+
function l(c) {
|
|
2278
|
+
return t.block(c);
|
|
2272
2279
|
}
|
|
2273
|
-
function
|
|
2274
|
-
const
|
|
2280
|
+
function a() {
|
|
2281
|
+
const c = {
|
|
2275
2282
|
hasAccess: !0,
|
|
2276
2283
|
selected: r.value,
|
|
2277
2284
|
onClick: n,
|
|
2278
2285
|
onBlockAccess: l,
|
|
2279
|
-
"data-id":
|
|
2286
|
+
"data-id": we,
|
|
2280
2287
|
size: e.size,
|
|
2281
2288
|
name: "related",
|
|
2282
2289
|
icon: "f_related",
|
|
2283
2290
|
type: "none",
|
|
2284
2291
|
label: s.value
|
|
2285
2292
|
};
|
|
2286
|
-
return
|
|
2293
|
+
return h(ne, c, () => []);
|
|
2287
2294
|
}
|
|
2288
|
-
return () =>
|
|
2295
|
+
return () => a();
|
|
2289
2296
|
}
|
|
2290
|
-
}),
|
|
2297
|
+
}), Ro = $({
|
|
2291
2298
|
name: "TsDefaultDrawer",
|
|
2292
2299
|
props: {},
|
|
2293
2300
|
emits: ["click"],
|
|
2294
|
-
setup(e, { slots:
|
|
2295
|
-
const s =
|
|
2301
|
+
setup(e, { slots: t, emit: o }) {
|
|
2302
|
+
const s = p(), n = "q-ma-xs";
|
|
2296
2303
|
function r(l) {
|
|
2297
2304
|
return {
|
|
2298
2305
|
class: n,
|
|
@@ -2300,117 +2307,117 @@ const Pt = () => {
|
|
|
2300
2307
|
onClick: () => s.setActive(l)
|
|
2301
2308
|
};
|
|
2302
2309
|
}
|
|
2303
|
-
return () =>
|
|
2310
|
+
return () => h(
|
|
2304
2311
|
Qe,
|
|
2305
2312
|
{ name: ot },
|
|
2306
2313
|
{
|
|
2307
|
-
default: () =>
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2314
|
+
default: () => h(ro, {}, () => [
|
|
2315
|
+
h(Fo, r(oe)),
|
|
2316
|
+
h(Po, r(xe)),
|
|
2317
|
+
h(Go, r(ve)),
|
|
2318
|
+
h(Ho, r(we))
|
|
2312
2319
|
]),
|
|
2313
|
-
secondary: () =>
|
|
2320
|
+
secondary: () => h(Kt, { fixed: !1 })
|
|
2314
2321
|
}
|
|
2315
2322
|
);
|
|
2316
2323
|
}
|
|
2317
|
-
}),
|
|
2324
|
+
}), Oo = $({
|
|
2318
2325
|
name: "TdGridDrawer",
|
|
2319
|
-
setup(e, { slots:
|
|
2320
|
-
const { lang: s } =
|
|
2326
|
+
setup(e, { slots: t, emit: o }) {
|
|
2327
|
+
const { lang: s } = J(), n = v(() => {
|
|
2321
2328
|
var l;
|
|
2322
2329
|
return (l = s.value.td) == null ? void 0 : l.controls.grid.title;
|
|
2323
2330
|
});
|
|
2324
2331
|
function r() {
|
|
2325
2332
|
const l = {
|
|
2326
2333
|
class: "td-grid-drawer",
|
|
2327
|
-
name:
|
|
2334
|
+
name: xe,
|
|
2328
2335
|
label: n.value
|
|
2329
2336
|
};
|
|
2330
|
-
return
|
|
2337
|
+
return h(Qe, l, () => h($t));
|
|
2331
2338
|
}
|
|
2332
2339
|
return () => r();
|
|
2333
2340
|
}
|
|
2334
|
-
}),
|
|
2341
|
+
}), qo = $({
|
|
2335
2342
|
name: "TdRelatedDrawer",
|
|
2336
|
-
setup(e, { slots:
|
|
2337
|
-
const { lang: s } =
|
|
2343
|
+
setup(e, { slots: t, emit: o }) {
|
|
2344
|
+
const { lang: s } = J(), n = v(() => {
|
|
2338
2345
|
var l;
|
|
2339
2346
|
return (l = s.value.td) == null ? void 0 : l.controls.related.title;
|
|
2340
2347
|
});
|
|
2341
2348
|
function r() {
|
|
2342
2349
|
const l = {
|
|
2343
2350
|
class: "td-related-drawer",
|
|
2344
|
-
name:
|
|
2351
|
+
name: we,
|
|
2345
2352
|
label: n.value
|
|
2346
2353
|
};
|
|
2347
|
-
return
|
|
2354
|
+
return h(Qe, l, () => h(Zt));
|
|
2348
2355
|
}
|
|
2349
2356
|
return () => r();
|
|
2350
2357
|
}
|
|
2351
|
-
}),
|
|
2358
|
+
}), _o = $({
|
|
2352
2359
|
name: "TdLightsDrawer",
|
|
2353
|
-
setup(e, { slots:
|
|
2354
|
-
const { lang: s } =
|
|
2360
|
+
setup(e, { slots: t, emit: o }) {
|
|
2361
|
+
const { lang: s } = J(), n = v(() => {
|
|
2355
2362
|
var l;
|
|
2356
2363
|
return (l = s.value.td) == null ? void 0 : l.controls.lights.title;
|
|
2357
2364
|
});
|
|
2358
2365
|
function r() {
|
|
2359
2366
|
const l = {
|
|
2360
2367
|
class: "td-lights-drawer",
|
|
2361
|
-
name:
|
|
2368
|
+
name: ve,
|
|
2362
2369
|
label: n.value
|
|
2363
2370
|
};
|
|
2364
|
-
return
|
|
2371
|
+
return h(Qe, l, () => h(Nt));
|
|
2365
2372
|
}
|
|
2366
2373
|
return () => r();
|
|
2367
2374
|
}
|
|
2368
|
-
}),
|
|
2375
|
+
}), Uo = $({
|
|
2369
2376
|
name: "TdLightsDrawer",
|
|
2370
|
-
setup(e, { slots:
|
|
2371
|
-
const { lang: s } =
|
|
2377
|
+
setup(e, { slots: t, emit: o }) {
|
|
2378
|
+
const { lang: s } = J(), n = v(() => {
|
|
2372
2379
|
var l;
|
|
2373
2380
|
return (l = s.value.td) == null ? void 0 : l.controls.colors.title;
|
|
2374
2381
|
});
|
|
2375
2382
|
function r() {
|
|
2376
2383
|
const l = {
|
|
2377
2384
|
class: "td-colors-drawer",
|
|
2378
|
-
name:
|
|
2385
|
+
name: oe,
|
|
2379
2386
|
label: n.value
|
|
2380
2387
|
};
|
|
2381
|
-
return
|
|
2388
|
+
return h(Qe, l, () => h(It));
|
|
2382
2389
|
}
|
|
2383
2390
|
return () => r();
|
|
2384
2391
|
}
|
|
2385
|
-
}),
|
|
2392
|
+
}), Io = $({
|
|
2386
2393
|
name: "TsDrawers",
|
|
2387
|
-
setup(e, { slots:
|
|
2388
|
-
const s =
|
|
2394
|
+
setup(e, { slots: t, emit: o }) {
|
|
2395
|
+
const s = p(), n = v({
|
|
2389
2396
|
get: () => s.active,
|
|
2390
2397
|
set: (l) => s.setActive(l)
|
|
2391
2398
|
});
|
|
2392
2399
|
function r() {
|
|
2393
2400
|
const l = {
|
|
2394
2401
|
modelValue: n.value,
|
|
2395
|
-
"onUpdate:modelValue": (
|
|
2402
|
+
"onUpdate:modelValue": (a) => n.value = a
|
|
2396
2403
|
};
|
|
2397
|
-
return
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2404
|
+
return h(lo, l, () => [
|
|
2405
|
+
h(Ro),
|
|
2406
|
+
h(_o),
|
|
2407
|
+
h(Uo),
|
|
2408
|
+
h(Oo),
|
|
2409
|
+
h(qo)
|
|
2403
2410
|
]);
|
|
2404
2411
|
}
|
|
2405
2412
|
return () => r();
|
|
2406
2413
|
}
|
|
2407
|
-
}),
|
|
2414
|
+
}), ns = /* @__PURE__ */ Object.assign({
|
|
2408
2415
|
name: "TdPage",
|
|
2409
2416
|
slug: "td-page",
|
|
2410
2417
|
inheritAttrs: !1
|
|
2411
2418
|
}, {
|
|
2412
2419
|
__name: "TdPage",
|
|
2413
|
-
props: /* @__PURE__ */
|
|
2420
|
+
props: /* @__PURE__ */ so({
|
|
2414
2421
|
id: Number
|
|
2415
2422
|
}, {
|
|
2416
2423
|
miniState: { type: Boolean },
|
|
@@ -2418,37 +2425,138 @@ const Pt = () => {
|
|
|
2418
2425
|
}),
|
|
2419
2426
|
emits: ["update:miniState"],
|
|
2420
2427
|
setup(e) {
|
|
2421
|
-
const
|
|
2422
|
-
return
|
|
2423
|
-
|
|
2424
|
-
}), (r, l) => (Je(), at(
|
|
2428
|
+
const t = e, o = p(), s = v(() => Number(t.id)), n = eo(e, "miniState");
|
|
2429
|
+
return to(() => {
|
|
2430
|
+
o.setActive(ft.is.mobile ? ot : oe);
|
|
2431
|
+
}), (r, l) => (Je(), it(at(io), {
|
|
2425
2432
|
class: "three-dimension-page",
|
|
2426
2433
|
miniState: n.value,
|
|
2427
|
-
"onUpdate:miniState": l[0] || (l[0] = (
|
|
2434
|
+
"onUpdate:miniState": l[0] || (l[0] = (a) => n.value = a),
|
|
2428
2435
|
"no-drawer-padding": !0,
|
|
2429
2436
|
title: "3D Viewer"
|
|
2430
2437
|
}, {
|
|
2431
2438
|
toolDrawer: ct(() => [
|
|
2432
|
-
r.$q.platform.is.mobile ?
|
|
2439
|
+
r.$q.platform.is.mobile ? ht("", !0) : (Je(), it(at(jo), { key: 0 }))
|
|
2433
2440
|
]),
|
|
2434
2441
|
bottomDrawer: ct(() => [
|
|
2435
|
-
r.$q.platform.is.mobile ? (Je(), at(
|
|
2442
|
+
r.$q.platform.is.mobile ? (Je(), it(at(Io), { key: 0 })) : ht("", !0)
|
|
2436
2443
|
]),
|
|
2437
2444
|
default: ct(() => [
|
|
2438
|
-
|
|
2445
|
+
oo(Ao, { id: s.value }, null, 8, ["id"])
|
|
2439
2446
|
]),
|
|
2440
2447
|
_: 1
|
|
2441
2448
|
}, 8, ["miniState"]));
|
|
2442
2449
|
}
|
|
2450
|
+
}), $o = [
|
|
2451
|
+
"#141111",
|
|
2452
|
+
"#3E251E",
|
|
2453
|
+
"#633C30",
|
|
2454
|
+
"#A56F57",
|
|
2455
|
+
"#CC9E86",
|
|
2456
|
+
"#543F2E",
|
|
2457
|
+
"#7C5B48",
|
|
2458
|
+
"#98775B",
|
|
2459
|
+
"#AD8B6B",
|
|
2460
|
+
"#BFA282",
|
|
2461
|
+
"#794524",
|
|
2462
|
+
"#8F603E",
|
|
2463
|
+
"#B08057",
|
|
2464
|
+
"#D7A56F",
|
|
2465
|
+
"#F7DBA2",
|
|
2466
|
+
"#673E28",
|
|
2467
|
+
"#C5815E",
|
|
2468
|
+
"#D59671",
|
|
2469
|
+
"#EFB698",
|
|
2470
|
+
"#F5D2C0",
|
|
2471
|
+
"#6E453A",
|
|
2472
|
+
"#996C5E",
|
|
2473
|
+
"#C88D7D",
|
|
2474
|
+
"#E7B09E",
|
|
2475
|
+
"#EEC1AE",
|
|
2476
|
+
"#432B26",
|
|
2477
|
+
"#88635A",
|
|
2478
|
+
"#BA8C82",
|
|
2479
|
+
"#EBBAB6",
|
|
2480
|
+
"#F7D2C8",
|
|
2481
|
+
"#796362",
|
|
2482
|
+
"#8F7277",
|
|
2483
|
+
"#C399A0",
|
|
2484
|
+
"#E3C7CB",
|
|
2485
|
+
"#E6D1D2",
|
|
2486
|
+
"#684C4B",
|
|
2487
|
+
"#98807B",
|
|
2488
|
+
"#BDACA8",
|
|
2489
|
+
"#DACDC9",
|
|
2490
|
+
"#E5E4E3"
|
|
2491
|
+
], rs = de("3d-fbxs", {
|
|
2492
|
+
state: () => ({
|
|
2493
|
+
models: {},
|
|
2494
|
+
loadingUrl: null,
|
|
2495
|
+
palette: $o
|
|
2496
|
+
}),
|
|
2497
|
+
getters: {
|
|
2498
|
+
changed(e) {
|
|
2499
|
+
var s, n, r, l, a;
|
|
2500
|
+
const o = p().selected;
|
|
2501
|
+
return console.log("fbx model", (s = e.models) == null ? void 0 : s[o]), (r = (n = e.models) == null ? void 0 : n[o]) != null && r.color ? ((a = (l = e.models) == null ? void 0 : l[o]) == null ? void 0 : a.color) !== 16777215 : !1;
|
|
2502
|
+
},
|
|
2503
|
+
selectedId() {
|
|
2504
|
+
return p().selected;
|
|
2505
|
+
},
|
|
2506
|
+
poseId(e) {
|
|
2507
|
+
var s, n;
|
|
2508
|
+
const o = p().selected;
|
|
2509
|
+
return (n = (s = e.models) == null ? void 0 : s[o]) == null ? void 0 : n.poseId;
|
|
2510
|
+
},
|
|
2511
|
+
model(e) {
|
|
2512
|
+
const o = p().selected;
|
|
2513
|
+
return o && e.models[o] ? e.models[o] : null;
|
|
2514
|
+
},
|
|
2515
|
+
url() {
|
|
2516
|
+
var e;
|
|
2517
|
+
return ((e = this.model) == null ? void 0 : e.url) || null;
|
|
2518
|
+
},
|
|
2519
|
+
bounds() {
|
|
2520
|
+
var e;
|
|
2521
|
+
return (e = this.model) == null ? void 0 : e.bounds;
|
|
2522
|
+
},
|
|
2523
|
+
color() {
|
|
2524
|
+
var e;
|
|
2525
|
+
return ((e = this.model) == null ? void 0 : e.color) || 16777215;
|
|
2526
|
+
},
|
|
2527
|
+
colorHex() {
|
|
2528
|
+
var e;
|
|
2529
|
+
return (e = this.model) != null && e.color ? ce(this.model.color) : "#fefefe";
|
|
2530
|
+
}
|
|
2531
|
+
},
|
|
2532
|
+
actions: {
|
|
2533
|
+
resetColor() {
|
|
2534
|
+
const t = p().selected;
|
|
2535
|
+
this.models[t].color = 16777215;
|
|
2536
|
+
},
|
|
2537
|
+
setBounds(e) {
|
|
2538
|
+
const o = p().selected;
|
|
2539
|
+
this.models[o].bounds = _t(e);
|
|
2540
|
+
},
|
|
2541
|
+
setSubjectsFromResponse(e) {
|
|
2542
|
+
const t = e.entities.fbx;
|
|
2543
|
+
this.models = { ...this.models, ...t };
|
|
2544
|
+
},
|
|
2545
|
+
setColorHex(e) {
|
|
2546
|
+
const o = p().selected;
|
|
2547
|
+
this.models[o].color = be(e);
|
|
2548
|
+
}
|
|
2549
|
+
}
|
|
2443
2550
|
});
|
|
2444
2551
|
export {
|
|
2445
|
-
|
|
2446
|
-
|
|
2552
|
+
ns as TdPage,
|
|
2553
|
+
p as use3dStore,
|
|
2447
2554
|
Ut as useColorsStore,
|
|
2448
2555
|
Ct as useControlsStore,
|
|
2449
|
-
|
|
2450
|
-
|
|
2556
|
+
rs as useFBXStore,
|
|
2557
|
+
ye as useGLBStore,
|
|
2558
|
+
Me as useGridStore,
|
|
2451
2559
|
Ve as useGroundStore,
|
|
2452
|
-
|
|
2560
|
+
Be as useLightsStore,
|
|
2453
2561
|
lt as useSceneStore
|
|
2454
2562
|
};
|