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