@figurosity/consumer-three-dimension-tool 0.1.0 → 0.2.0

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