@figurosity/consumer-three-dimension-tool 0.8.0 → 0.9.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,44 +1,44 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode(".tool-reset-button .qbtn{color:#333;font-weight:700}:has(>.frozen-overlay){position:relative}.frozen-overlay{position:absolute;z-index:10;top:0;left:0;bottom:0;right:0}.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(o)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
- import { watch as j, ref as pe, nextTick as ls, onUnmounted as Ut, computed as C, onMounted as $t, openBlock as at, createElementBlock as cs, createCommentVNode as wt, createElementVNode as us, onBeforeMount as ds, defineComponent as V, h as d, withDirectives as ps, vShow as ms, inject as Ze, useModel as fs, onBeforeUnmount as hs, createBlock as vt, unref as bt, withCtx as yt, createVNode as gs, mergeModels as vs } from "vue";
3
- import { Platform as Ct, useQuasar as bs, QBtn as qt, QSeparator as ve } from "quasar";
4
- import { CBaseButton as me, CColorPickerPopup as ys, CExpansion as Ve, CToggle as Ht, CSlider as We, CBaseButtons as Jt, CDraggableDrawer as De, CDraggableDrawers as Ss, CToolPage as xs } from "@figurosity/consumer-controls";
5
- import { defineStore as Ye, storeToRefs as N, getActivePinia as ws } from "pinia";
6
- import * as I from "three";
1
+ (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".tool-reset-button .qbtn{color:var(--grey-800);font-weight:700}:has(>.frozen-overlay){position:relative}.frozen-overlay{position:absolute;z-index:10;top:0;left:0;bottom:0;right:0}.debug-color{max-width:100px}.debug-color .swatch{height:20px;width:20px;border-radius:10px;border:1px solid var(--grey-800)}.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 var(--grey-800);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 var(--grey-400);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 { watch as G, ref as he, nextTick as cs, onUnmounted as Ut, computed as C, onMounted as $t, openBlock as at, createElementBlock as us, createCommentVNode as wt, createElementVNode as ds, onBeforeMount as ps, defineComponent as V, h as d, withDirectives as ms, vShow as fs, inject as Ze, useModel as hs, onBeforeUnmount as gs, createBlock as vt, unref as bt, withCtx as yt, createVNode as vs, mergeModels as bs } from "vue";
3
+ import { Platform as Ct, useQuasar as ys, QBtn as qt, QSeparator as ye } from "quasar";
4
+ import { CBaseButton as ie, CColorPickerPopup as Ss, CExpansion as Ve, CToggle as Ht, CSlider as We, CBaseButtons as Jt, CDraggableDrawer as Te, CDraggableDrawers as xs, CToolPage as ws } from "@figurosity/consumer-controls";
5
+ import { defineStore as Ye, storeToRefs as O, getActivePinia as Cs } from "pinia";
6
+ import * as k from "three";
7
7
  import Qe from "lodash.isequal";
8
- import { DEFAULT as lt, SKINS as xe, COLORS as oe, GRID as we, LIGHTS as de, RELATED as Ce, getConfig as Cs, useDynamicImages as Es } from "@figurosity/toolbox";
8
+ import { DEFAULT as lt, SKINS as ee, COLORS as ne, GRID as Ce, LIGHTS as fe, RELATED as Ee, getConfig as Es, useDynamicImages as ks } from "@figurosity/toolbox";
9
9
  import "three/examples/jsm/loaders/RGBELoader.js";
10
10
  import { RoomEnvironment as Is } from "three/examples/jsm/environments/RoomEnvironment.js";
11
- import { OrbitControls as Ds } from "three/examples/jsm/controls/OrbitControls.js";
12
- import { mergeVertices as Rt, mergeGeometries as ks } from "three/examples/jsm/utils/BufferGeometryUtils.js";
13
- import { RoundedBoxGeometry as Ts } from "three/examples/jsm/geometries/RoundedBoxGeometry.js";
14
- import { GLTFLoader as Ms } from "three/examples/jsm/loaders/GLTFLoader.js";
11
+ import { OrbitControls as Ts } from "three/examples/jsm/controls/OrbitControls.js";
12
+ import { mergeVertices as Rt, mergeGeometries as Ds } from "three/examples/jsm/utils/BufferGeometryUtils.js";
13
+ import { RoundedBoxGeometry as Ms } from "three/examples/jsm/geometries/RoundedBoxGeometry.js";
14
+ import { GLTFLoader as Bs } from "three/examples/jsm/loaders/GLTFLoader.js";
15
15
  import { DRACOLoader as As } from "three/examples/jsm/loaders/DRACOLoader.js";
16
- const Bs = "tool:switched", zs = "pose:viewed", Ps = "skin:changed", St = new I.Vector3(), Vt = (e) => {
17
- const t = new I.Box3().setFromObject(e);
16
+ const zs = "tool:switched", Ps = "pose:viewed", Ls = "skin:changed", St = new k.Vector3(), Vt = (e) => {
17
+ const t = new k.Box3().setFromObject(e);
18
18
  console.log("box", t);
19
- const s = t.getSize(new I.Vector3()), n = new I.Vector3(
19
+ const s = t.getSize(new k.Vector3()), o = new k.Vector3(
20
20
  (t.min.x + t.max.x) / 2,
21
21
  (t.min.y + t.max.y) / 2,
22
22
  (t.min.z + t.max.z) / 2
23
23
  );
24
- console.log("center", n);
25
- let r = t.min.y;
26
- return console.log("bottom", r), Math.abs(r) < -0.01 && (r = Ls(e)), console.log("bottom", r), {
24
+ console.log("center", o);
25
+ let n = t.min.y;
26
+ return console.log("bottom", n), Math.abs(n) < -0.01 && (n = Rs(e)), console.log("bottom", n), {
27
27
  box: t,
28
28
  size: s,
29
- center: n,
30
- bottom: r,
29
+ center: o,
30
+ bottom: n,
31
31
  top: t.max.y
32
32
  };
33
- }, Ls = (e) => {
33
+ }, Rs = (e) => {
34
34
  let t = 1 / 0;
35
35
  return e.updateMatrixWorld(!0), e.traverse((s) => {
36
- var r, i;
36
+ var n, i;
37
37
  if (!s.isMesh) return;
38
- const n = (i = (r = s.geometry) == null ? void 0 : r.attributes) == null ? void 0 : i.position;
39
- if (n)
40
- for (let o = 0; o < n.count; o++)
41
- St.fromBufferAttribute(n, o), St.applyMatrix4(s.matrixWorld), t = Math.min(t, St.y);
38
+ const o = (i = (n = s.geometry) == null ? void 0 : n.attributes) == null ? void 0 : i.position;
39
+ if (o)
40
+ for (let r = 0; r < o.count; r++)
41
+ St.fromBufferAttribute(o, r), St.applyMatrix4(s.matrixWorld), t = Math.min(t, St.y);
42
42
  }), t;
43
43
  }, Kt = (e) => ({
44
44
  box: {
@@ -65,7 +65,7 @@ const Bs = "tool:switched", zs = "pose:viewed", Ps = "skin:changed", St = new I.
65
65
  },
66
66
  bottom: e.bottom,
67
67
  top: e.top
68
- }), Wt = "smooth", Rs = (e) => ({
68
+ }), Wt = "smooth", Vs = (e) => ({
69
69
  id: e.id,
70
70
  uuid: e.uuid ?? null,
71
71
  basePoseId: e.basePoseId ?? null,
@@ -77,21 +77,21 @@ const Bs = "tool:switched", zs = "pose:viewed", Ps = "skin:changed", St = new I.
77
77
  poseId: e.poseId ?? null,
78
78
  url: e.glbPathWebp || e.glbPath || null,
79
79
  bounds: e.bounds ?? null
80
- }), fe = Ye("3d-glbs", {
80
+ }), ae = Ye("3d-glbs", {
81
81
  state: () => ({
82
82
  models: {}
83
83
  }),
84
84
  getters: {
85
85
  selectedId() {
86
- return M().selected;
86
+ return T().selected;
87
87
  },
88
88
  poseId(e) {
89
- var s, n;
90
- const t = M().selected;
91
- return (n = (s = e.models) == null ? void 0 : s[t]) == null ? void 0 : n.poseId;
89
+ var s, o;
90
+ const t = T().selected;
91
+ return (o = (s = e.models) == null ? void 0 : s[t]) == null ? void 0 : o.poseId;
92
92
  },
93
93
  model(e) {
94
- const t = M().selected;
94
+ const t = T().selected;
95
95
  return t && e.models[t] ? e.models[t] : null;
96
96
  },
97
97
  url() {
@@ -105,25 +105,25 @@ const Bs = "tool:switched", zs = "pose:viewed", Ps = "skin:changed", St = new I.
105
105
  },
106
106
  actions: {
107
107
  setBounds(e) {
108
- const t = M().selected;
108
+ const t = T().selected;
109
109
  this.models[t] && (this.models[t].bounds = Kt(e));
110
110
  },
111
111
  setSubjectsFromResponse(e) {
112
- var n;
113
- const t = ((n = e == null ? void 0 : e.entities) == null ? void 0 : n.glb) || {}, s = {};
114
- return Object.keys(t).forEach((r) => {
115
- s[r] = Rs(t[r]);
112
+ var o;
113
+ const t = ((o = e == null ? void 0 : e.entities) == null ? void 0 : o.glb) || {}, s = {};
114
+ return Object.keys(t).forEach((n) => {
115
+ s[n] = Vs(t[n]);
116
116
  }), this.models = { ...this.models, ...s }, this.selectDefaultGlbId(e);
117
117
  },
118
118
  // Picks the GLB id whose skin slug matches DEFAULT_SKIN_SLUG, falls
119
119
  // back to result.glb[0], or null when no GLBs are available.
120
120
  selectDefaultGlbId(e) {
121
- var o, c, a;
122
- const t = Array.isArray((o = e == null ? void 0 : e.result) == null ? void 0 : o.glb) ? e.result.glb : [];
121
+ var r, c, a;
122
+ const t = Array.isArray((r = e == null ? void 0 : e.result) == null ? void 0 : r.glb) ? e.result.glb : [];
123
123
  if (t.length === 0) return null;
124
- const s = ((c = e == null ? void 0 : e.entities) == null ? void 0 : c.skins) || {}, n = ((a = e == null ? void 0 : e.entities) == null ? void 0 : a.glb) || {}, i = t.find((u) => {
124
+ const s = ((c = e == null ? void 0 : e.entities) == null ? void 0 : c.skins) || {}, o = ((a = e == null ? void 0 : e.entities) == null ? void 0 : a.glb) || {}, i = t.find((u) => {
125
125
  var P, w;
126
- const p = (P = n[u]) == null ? void 0 : P.skinId;
126
+ const p = (P = o[u]) == null ? void 0 : P.skinId;
127
127
  return p != null && ((w = s[p]) == null ? void 0 : w.slug) === Wt;
128
128
  }) ?? t[0];
129
129
  return typeof i == "string" ? parseInt(i, 10) : i;
@@ -134,15 +134,15 @@ function et(e) {
134
134
  const t = e.startsWith("#") ? e.slice(1) : e;
135
135
  return parseInt(t, 16);
136
136
  }
137
- function ue(e) {
137
+ function me(e) {
138
138
  return `#${e.toString(16).padStart(6, "0")}`;
139
139
  }
140
140
  const tt = ({
141
141
  storeId: e,
142
142
  defaultValues: t = {},
143
143
  state: s = {},
144
- getters: n = {},
145
- actions: r = {},
144
+ getters: o = {},
145
+ actions: n = {},
146
146
  keyBy: i = "selected"
147
147
  }) => Ye(e, {
148
148
  state: () => ({
@@ -161,78 +161,78 @@ const tt = ({
161
161
  }),
162
162
  getters: {
163
163
  keyId() {
164
- return M()[i];
164
+ return T()[i];
165
165
  },
166
- model(o) {
167
- return o.models[M()[i]];
166
+ model(r) {
167
+ return r.models[T()[i]];
168
168
  },
169
- exists(o) {
170
- return typeof o.models[M()[i]] < "u";
169
+ exists(r) {
170
+ return typeof r.models[T()[i]] < "u";
171
171
  },
172
- selectedModel(o) {
173
- return o.models[M()[i]] ?? null;
172
+ selectedModel(r) {
173
+ return r.models[T()[i]] ?? null;
174
174
  },
175
175
  mergedModel() {
176
176
  return { ...t, ...this.selectedModel ?? {} };
177
177
  },
178
- propertyById(o) {
179
- return (c, a, u = null) => o.models[c] && a in o.models[c] ? o.models[c][a] : u;
178
+ propertyById(r) {
179
+ return (c, a, u = null) => r.models[c] && a in r.models[c] ? r.models[c][a] : u;
180
180
  },
181
181
  propertyChangedById() {
182
- return (o, c) => this.propertyById(o, c) !== t[c];
182
+ return (r, c) => this.propertyById(r, c) !== t[c];
183
183
  },
184
- propertyChanged(o) {
185
- const c = M()[i];
186
- return (a) => o.models[c] ? this.propertyById(c, a) !== t[a] : !1;
184
+ propertyChanged(r) {
185
+ const c = T()[i];
186
+ return (a) => r.models[c] ? this.propertyById(c, a) !== t[a] : !1;
187
187
  },
188
188
  property() {
189
- const o = M()[i];
190
- return (c, a = t[c]) => this.propertyById(o, c, a);
189
+ const r = T()[i];
190
+ return (c, a = t[c]) => this.propertyById(r, c, a);
191
191
  },
192
- ...n
192
+ ...o
193
193
  },
194
194
  actions: {
195
- initModel(o) {
196
- o != null && (typeof this.models[o] < "u" || this.$patch((c) => {
197
- c.models[o] = { ...t };
195
+ initModel(r) {
196
+ r != null && (typeof this.models[r] < "u" || this.$patch((c) => {
197
+ c.models[r] = { ...t };
198
198
  }));
199
199
  },
200
200
  ensureSelectedModel() {
201
- const o = M()[i];
202
- return o == null ? null : (this.models[o] || (this.models[o] = { ...t }), this.models[o]);
201
+ const r = T()[i];
202
+ return r == null ? null : (this.models[r] || (this.models[r] = { ...t }), this.models[r]);
203
203
  },
204
- setPropertyById(o, c, a) {
205
- o != null && (this.models[o] || this.initModel(o), this.$patch({
204
+ setPropertyById(r, c, a) {
205
+ r != null && (this.models[r] || this.initModel(r), this.$patch({
206
206
  models: {
207
- [o]: { ...this.models[o], [c]: a }
207
+ [r]: { ...this.models[r], [c]: a }
208
208
  }
209
209
  }));
210
210
  },
211
- setProperty(o, c) {
212
- const a = M()[i];
211
+ setProperty(r, c) {
212
+ const a = T()[i];
213
213
  a != null && (this.models[a] || this.initModel(a), this.$patch({
214
214
  models: {
215
- [a]: { ...this.models[a], [o]: c }
215
+ [a]: { ...this.models[a], [r]: c }
216
216
  }
217
217
  }));
218
218
  },
219
- patchSelected(o) {
219
+ patchSelected(r) {
220
220
  const c = this.ensureSelectedModel();
221
- c && Object.assign(c, o);
221
+ c && Object.assign(c, r);
222
222
  },
223
223
  reset() {
224
- const o = M()[i];
225
- o != null && this.$patch((c) => {
226
- c.models[o] = { ...t };
224
+ const r = T()[i];
225
+ r != null && this.$patch((c) => {
226
+ c.models[r] = { ...t };
227
227
  });
228
228
  },
229
- resetProperty(o) {
230
- const c = M()[i];
229
+ resetProperty(r) {
230
+ const c = T()[i];
231
231
  c != null && this.models[c] && this.$patch({
232
232
  models: {
233
233
  [c]: {
234
234
  ...this.models[c],
235
- [o]: t[o]
235
+ [r]: t[r]
236
236
  }
237
237
  }
238
238
  });
@@ -243,29 +243,29 @@ const tt = ({
243
243
  // Returns null when there's no active bucket so the caller can omit
244
244
  // the slot from the payload rather than encode a stale snapshot.
245
245
  snapshot() {
246
- const o = M()[i];
247
- return o == null || !this.models[o] ? null : JSON.parse(JSON.stringify(this.models[o]));
246
+ const r = T()[i];
247
+ return r == null || !this.models[r] ? null : JSON.parse(JSON.stringify(this.models[r]));
248
248
  },
249
249
  // Apply a snapshot from the save+freeze payload back onto the
250
250
  // active bucket. Missing keys fall through to defaultValues; the
251
251
  // caller passes the same shape `snapshot()` produced.
252
- restore(o) {
253
- if (o == null || typeof o != "object") return;
254
- const c = M()[i];
252
+ restore(r) {
253
+ if (r == null || typeof r != "object") return;
254
+ const c = T()[i];
255
255
  if (c == null) return;
256
- const a = JSON.parse(JSON.stringify(o));
256
+ const a = JSON.parse(JSON.stringify(r));
257
257
  this.$patch((u) => {
258
258
  u.models[c] = { ...t, ...a }, u.framed && (u.framed[c] = !0), u.applyRevision = (u.applyRevision || 0) + 1;
259
259
  });
260
260
  },
261
- ...r
261
+ ...n
262
262
  }
263
263
  }), Xt = {
264
264
  visible: !0,
265
265
  opacity: 1,
266
266
  color: 16711422,
267
267
  texture: "none"
268
- }, Vs = {
268
+ }, Fs = {
269
269
  changed() {
270
270
  return this.exists ? !Qe(this.mergedModel, Xt) : !1;
271
271
  },
@@ -273,7 +273,7 @@ const tt = ({
273
273
  return this.property("color");
274
274
  },
275
275
  colorHex() {
276
- return ue(this.property("color"));
276
+ return me(this.property("color"));
277
277
  },
278
278
  opacity() {
279
279
  return this.property("opacity");
@@ -284,7 +284,7 @@ const tt = ({
284
284
  visible() {
285
285
  return this.property("visible");
286
286
  }
287
- }, Fs = {
287
+ }, _s = {
288
288
  init() {
289
289
  this.initModel(this.keyId);
290
290
  },
@@ -304,29 +304,29 @@ const tt = ({
304
304
  storeId: "3d-ground",
305
305
  defaultValues: Xt,
306
306
  state: { offset: -0.75 },
307
- getters: Vs,
308
- actions: Fs,
307
+ getters: Fs,
308
+ actions: _s,
309
309
  keyBy: "basePoseId"
310
- }), _s = {
310
+ }), js = {
311
311
  color: 16777215,
312
312
  visible: !0,
313
313
  debug: !1,
314
314
  shadow: !0,
315
315
  visualization: !0
316
- }, Pe = 0, se = 1, Et = 1.25, It = 3, ot = (e, t, s) => Math.max(t, Math.min(s, e)), Gs = 1.25, Le = (e = {}) => ({ ..._s, ...e }), ze = {
316
+ }, Pe = 0, oe = 1, Et = 1.25, kt = 3, ot = (e, t, s) => Math.max(t, Math.min(s, e)), Gs = 1.25, Le = (e = {}) => ({ ...js, ...e }), ze = {
317
317
  advanced: !1,
318
318
  move: !1,
319
319
  position: { x: 0, y: 0, z: 1.5 },
320
320
  quaternion: { x: 0, y: 0, z: 0, w: 1 },
321
321
  target: { x: 0, y: 0, z: 0 }
322
- }, Ft = ["advanced", "move"], nt = (e = {}) => ({ ...ze, ...e }), js = {
323
- ambientScale: se,
324
- userScale: se
325
- }, rt = (e = {}) => ({ ...js, ...e }), xt = () => ({
322
+ }, Ft = ["advanced", "move"], nt = (e = {}) => ({ ...ze, ...e }), Os = {
323
+ ambientScale: oe,
324
+ userScale: oe
325
+ }, rt = (e = {}) => ({ ...Os, ...e }), xt = () => ({
326
326
  key: Le(),
327
327
  fill: Le({ shadow: !0 }),
328
328
  back: Le({ shadow: !0 })
329
- }), he = Ye("3d-lights", {
329
+ }), ge = Ye("3d-lights", {
330
330
  state: () => ({
331
331
  lights: {},
332
332
  options: {},
@@ -351,10 +351,10 @@ const tt = ({
351
351
  }),
352
352
  getters: {
353
353
  bpId() {
354
- return M().basePoseId;
354
+ return T().basePoseId;
355
355
  },
356
356
  skinId() {
357
- return M().selected;
357
+ return T().selected;
358
358
  },
359
359
  // The reset button reflects "user has tweaked something on the
360
360
  // active skin." Toggles + rig are per-basePose; sliders are
@@ -364,10 +364,10 @@ const tt = ({
364
364
  // toggles + the active skin's slider values count.
365
365
  changed(e) {
366
366
  const t = e.options[this.bpId];
367
- if (t && Ft.some((n) => !Qe(t[n], ze[n])))
367
+ if (t && Ft.some((o) => !Qe(t[o], ze[o])))
368
368
  return !0;
369
369
  const s = e.scales[this.skinId];
370
- return !!(s && (s.ambientScale !== se || s.userScale !== se));
370
+ return !!(s && (s.ambientScale !== oe || s.userScale !== oe));
371
371
  },
372
372
  // Has frameToBounds + syncToStore landed on this basePose's
373
373
  // lights rig? Set by markFramed() from the bounds watcher in
@@ -390,13 +390,13 @@ const tt = ({
390
390
  // above the new AMBIENT_SCALE_MAX / USER_SCALE_MAX.
391
391
  ambientScale(e) {
392
392
  var s;
393
- const t = ((s = e.scales[this.skinId]) == null ? void 0 : s.ambientScale) ?? se;
393
+ const t = ((s = e.scales[this.skinId]) == null ? void 0 : s.ambientScale) ?? oe;
394
394
  return ot(t, Pe, Et);
395
395
  },
396
396
  userScale(e) {
397
397
  var s;
398
- const t = ((s = e.scales[this.skinId]) == null ? void 0 : s.userScale) ?? se;
399
- return ot(t, Pe, It);
398
+ const t = ((s = e.scales[this.skinId]) == null ? void 0 : s.userScale) ?? oe;
399
+ return ot(t, Pe, kt);
400
400
  },
401
401
  position(e) {
402
402
  var t;
@@ -415,15 +415,15 @@ const tt = ({
415
415
  return (t = e.options[this.bpId]) == null ? void 0 : t.radius;
416
416
  },
417
417
  property(e) {
418
- return (t, s = null, n = null) => {
419
- const r = e.lights[this.bpId];
420
- return !r || !r[t] || !(s in r[t]) ? n : r[t][s];
418
+ return (t, s = null, o = null) => {
419
+ const n = e.lights[this.bpId];
420
+ return !n || !n[t] || !(s in n[t]) ? o : n[t][s];
421
421
  };
422
422
  },
423
423
  colorHex(e) {
424
424
  return (t) => {
425
425
  const s = e.lights[this.bpId];
426
- return !s || !s[t] ? "#ffffff" : ue(s[t].color);
426
+ return !s || !s[t] ? "#ffffff" : me(s[t].color);
427
427
  };
428
428
  },
429
429
  lightKeys(e) {
@@ -437,7 +437,7 @@ const tt = ({
437
437
  reset() {
438
438
  const e = this.bpId, t = this.skinId;
439
439
  if (e == null) return;
440
- this.options[e] || (this.options[e] = nt()), Ft.forEach((n) => this.options[e][n] = ze[n]), t != null && (this.scales[t] || (this.scales[t] = rt()), this.scales[t].ambientScale = se, this.scales[t].userScale = se);
440
+ this.options[e] || (this.options[e] = nt()), Ft.forEach((o) => this.options[e][o] = ze[o]), t != null && (this.scales[t] || (this.scales[t] = rt()), this.scales[t].ambientScale = oe, this.scales[t].userScale = oe);
441
441
  const s = this.seeds[t];
442
442
  s ? this.lights[e] = {
443
443
  key: { ...s.key },
@@ -453,13 +453,13 @@ const tt = ({
453
453
  // survives subsequent skin swaps within the same basePose.
454
454
  // scales[skinId] is per-skin and warmed once per skin.
455
455
  seedFromRecipe(e, t) {
456
- const s = ((t == null ? void 0 : t.spotIntensity) ?? 1) * Gs, n = (t == null ? void 0 : t.ambientIntensity) ?? 0, r = (t == null ? void 0 : t.envIntensity) ?? 1;
456
+ const s = ((t == null ? void 0 : t.spotIntensity) ?? 1) * Gs, o = (t == null ? void 0 : t.ambientIntensity) ?? 0, n = (t == null ? void 0 : t.envIntensity) ?? 1;
457
457
  this.seeds[e] = {
458
458
  key: Le({ intensity: s }),
459
459
  fill: Le({ intensity: s, shadow: !0 }),
460
460
  back: Le({ intensity: s, shadow: !0 }),
461
- ambient: { intensity: n },
462
- env: { intensity: r }
461
+ ambient: { intensity: o },
462
+ env: { intensity: n }
463
463
  }, e != null && !this.scales[e] && (this.scales[e] = rt());
464
464
  const i = this.bpId;
465
465
  i != null && (this.lights[i] || (this.lights[i] = xt()), this.options[i] || (this.options[i] = nt()));
@@ -503,11 +503,11 @@ const tt = ({
503
503
  return;
504
504
  }
505
505
  s.advanced = !1;
506
- const n = this.lights[t];
507
- if (!n) return;
508
- const r = n.key;
506
+ const o = this.lights[t];
507
+ if (!o) return;
508
+ const n = o.key;
509
509
  this.collection.forEach((i) => {
510
- i !== "key" && (n[i].color = r.color);
510
+ i !== "key" && (o[i].color = n.color);
511
511
  });
512
512
  },
513
513
  setColorHex(e, t) {
@@ -515,23 +515,23 @@ const tt = ({
515
515
  this.initLights();
516
516
  const s = this.bpId;
517
517
  if (s == null) return;
518
- const n = this.lights[s];
519
- if (!n) return;
520
- const r = et(t);
518
+ const o = this.lights[s];
519
+ if (!o) return;
520
+ const n = et(t);
521
521
  if (((i = this.options[s]) == null ? void 0 : i.advanced) === !0) {
522
- n[e].color = r;
522
+ o[e].color = n;
523
523
  return;
524
524
  }
525
- this.collection.forEach((o) => {
526
- n[o].color = r;
525
+ this.collection.forEach((r) => {
526
+ o[r].color = n;
527
527
  });
528
528
  },
529
529
  setProperty(e, t, s) {
530
530
  this.initLights();
531
- const n = this.bpId;
532
- if (n == null) return;
533
- const r = this.lights[n];
534
- r && (r[e][t] = s);
531
+ const o = this.bpId;
532
+ if (o == null) return;
533
+ const n = this.lights[o];
534
+ n && (n[e][t] = s);
535
535
  },
536
536
  setAmbientScale(e) {
537
537
  this.initLights();
@@ -541,7 +541,7 @@ const tt = ({
541
541
  setUserScale(e) {
542
542
  this.initLights();
543
543
  const t = this.ensureSelectedScales();
544
- t && (t.userScale = ot(e, Pe, It));
544
+ t && (t.userScale = ot(e, Pe, kt));
545
545
  },
546
546
  initLights() {
547
547
  const e = this.bpId, t = this.skinId;
@@ -565,8 +565,8 @@ const tt = ({
565
565
  snapshot() {
566
566
  const e = this.bpId, t = this.skinId;
567
567
  if (e == null) return null;
568
- const s = this.lights[e] ? JSON.parse(JSON.stringify(this.lights[e])) : null, n = this.options[e] ? JSON.parse(JSON.stringify(this.options[e])) : null, r = t != null && this.scales[t] ? JSON.parse(JSON.stringify(this.scales[t])) : null;
569
- return !s && !n && !r ? null : { lights: s, options: n, scales: r };
568
+ const s = this.lights[e] ? JSON.parse(JSON.stringify(this.lights[e])) : null, o = this.options[e] ? JSON.parse(JSON.stringify(this.options[e])) : null, n = t != null && this.scales[t] ? JSON.parse(JSON.stringify(this.scales[t])) : null;
569
+ return !s && !o && !n ? null : { lights: s, options: o, scales: n };
570
570
  },
571
571
  restore(e) {
572
572
  if (e == null || typeof e != "object") return;
@@ -579,7 +579,7 @@ const tt = ({
579
579
  quaternion: { x: -0.12993279108591813, y: 0, z: 0, w: 0.9915228034698058 },
580
580
  target: { x: 0, y: 0, z: 0 },
581
581
  radius: 1.5
582
- }, Os = {
582
+ }, Ns = {
583
583
  changed() {
584
584
  return this.exists ? !Qe(this.mergedModel, Zt) : !1;
585
585
  },
@@ -607,7 +607,7 @@ const tt = ({
607
607
  radius() {
608
608
  return this.mergedModel.radius;
609
609
  }
610
- }, Ns = {
610
+ }, Us = {
611
611
  initControls() {
612
612
  this.initModel(this.keyId);
613
613
  },
@@ -631,19 +631,19 @@ const tt = ({
631
631
  storeId: "3d-controls",
632
632
  defaultValues: Zt,
633
633
  state: { framed: {} },
634
- getters: Os,
635
- actions: Ns,
634
+ getters: Ns,
635
+ actions: Us,
636
636
  keyBy: "basePoseId"
637
- }), Us = {
637
+ }), $s = {
638
638
  color: 16711422
639
- }, $s = {
639
+ }, qs = {
640
640
  changed() {
641
641
  return this.propertyChanged("color");
642
642
  },
643
643
  colorHex() {
644
- return ue(this.property("color"));
644
+ return me(this.property("color"));
645
645
  }
646
- }, qs = {
646
+ }, Hs = {
647
647
  init() {
648
648
  this.initModel(this.keyId);
649
649
  },
@@ -652,9 +652,9 @@ const tt = ({
652
652
  }
653
653
  }, mt = tt({
654
654
  storeId: "3d-scene",
655
- defaultValues: Us,
656
- getters: $s,
657
- actions: qs,
655
+ defaultValues: $s,
656
+ getters: qs,
657
+ actions: Hs,
658
658
  keyBy: "basePoseId"
659
659
  }), Yt = {
660
660
  show: !1,
@@ -667,7 +667,7 @@ const tt = ({
667
667
  divisions: 6,
668
668
  opacity: 0.5,
669
669
  size: 2
670
- }, Hs = {
670
+ }, Js = {
671
671
  changed() {
672
672
  return !Qe(this.mergedModel, Yt);
673
673
  },
@@ -683,17 +683,17 @@ const tt = ({
683
683
  divisions() {
684
684
  return this.property("divisions");
685
685
  }
686
- }, Js = {
686
+ }, Ks = {
687
687
  init() {
688
688
  this.initModel(this.keyId);
689
689
  }
690
- }, ke = tt({
690
+ }, ve = tt({
691
691
  storeId: "3d-grid",
692
692
  defaultValues: Yt,
693
- getters: Hs,
694
- actions: Js,
693
+ getters: Js,
694
+ actions: Ks,
695
695
  keyBy: "basePoseId"
696
- }), Ks = [
696
+ }), Ws = [
697
697
  "#141111",
698
698
  "#3E251E",
699
699
  "#633C30",
@@ -734,154 +734,154 @@ const tt = ({
734
734
  "#BDACA8",
735
735
  "#DACDC9",
736
736
  "#E5E4E3"
737
- ], Dt = "background", kt = "subject", Tt = "ground", Qt = {
738
- [kt]: 16711422,
739
- [Dt]: 16777215,
740
- [Tt]: 12961221
741
- }, Ws = {
737
+ ], It = "background", Tt = "subject", Dt = "ground", Qt = {
738
+ [Tt]: 16711422,
739
+ [It]: 16777215,
740
+ [Dt]: 12961221
741
+ }, Xs = {
742
742
  changed() {
743
743
  return this.exists ? !Qe(this.mergedModel, Qt) : !1;
744
744
  },
745
745
  subjectHex() {
746
- return ue(this.property(kt));
746
+ return me(this.property(Tt));
747
747
  },
748
748
  groundHex() {
749
- return ue(this.property(Tt));
749
+ return me(this.property(Dt));
750
750
  },
751
751
  backgroundHex() {
752
- return ue(this.property(Dt));
752
+ return me(this.property(It));
753
753
  },
754
754
  getHexColor() {
755
- return (e) => ue(this.property(e, "#F0F0F0"));
755
+ return (e) => me(this.property(e, "#F0F0F0"));
756
756
  }
757
- }, Xs = {
757
+ }, Zs = {
758
758
  setHexColor(e, t) {
759
759
  this.setProperty(e, et(t));
760
760
  },
761
761
  setSubjectHex(e) {
762
- this.setHexColor(kt, e);
762
+ this.setHexColor(Tt, e);
763
763
  },
764
764
  setGroundHex(e) {
765
- this.setHexColor(Tt, e);
765
+ this.setHexColor(Dt, e);
766
766
  },
767
767
  setBackgroundHex(e) {
768
- this.setHexColor(Dt, e);
768
+ this.setHexColor(It, e);
769
769
  }
770
770
  }, Mt = tt({
771
771
  storeId: "3d-colors",
772
772
  defaultValues: Qt,
773
- state: { palette: Ks },
774
- getters: Ws,
775
- actions: Xs,
773
+ state: { palette: Ws },
774
+ getters: Xs,
775
+ actions: Zs,
776
776
  keyBy: "basePoseId"
777
777
  });
778
- let ee = null, Ge = null;
778
+ let te = null, je = null;
779
779
  const Re = () => {
780
- const e = M(), { aspect: t, width: s, height: n } = N(e), r = (c = { x: 0, y: 0.8, z: 1.5 }) => (console.debug("useCamera init"), ee ? (console.debug("view camera already inited"), ee) : (ee = new I.PerspectiveCamera(75, t.value, 0.1, 100), e.loaded.camera = !0, ee)), i = () => {
781
- if (ee)
782
- return ee;
780
+ const e = T(), { aspect: t, width: s, height: o } = O(e), n = (c = { x: 0, y: 0.8, z: 1.5 }) => (console.debug("useCamera init"), te ? (console.debug("view camera already inited"), te) : (te = new k.PerspectiveCamera(75, t.value, 0.1, 100), e.loaded.camera = !0, te)), i = () => {
781
+ if (te)
782
+ return te;
783
783
  };
784
- return Ge = j(
784
+ return je = G(
785
785
  () => t.value,
786
786
  (c) => {
787
- if (!ee) {
788
- r();
787
+ if (!te) {
788
+ n();
789
789
  return;
790
790
  }
791
- ee.aspect = c, ee.updateProjectionMatrix();
791
+ te.aspect = c, te.updateProjectionMatrix();
792
792
  }
793
793
  ), {
794
- init: r,
794
+ init: n,
795
795
  getCamera: i,
796
796
  dispose: () => {
797
- Ge == null || Ge(), Ge = null, ee = null;
797
+ je == null || je(), je = null, te = null;
798
798
  }
799
799
  };
800
800
  };
801
- let W = null, be = null, ye = null, je = null;
801
+ let W = null, Se = null, xe = null, Ge = null;
802
802
  const Ie = () => {
803
- const e = mt(), t = M(), { colorHex: s } = N(e), n = () => (console.debug("useScene init"), W ? (console.debug("scene already inited"), W) : (W = new I.Scene(), i(s.value), t.loaded.scene = !0, W)), r = () => {
803
+ const e = mt(), t = T(), { colorHex: s } = O(e), o = () => (console.debug("useScene init"), W ? (console.debug("scene already inited"), W) : (W = new k.Scene(), i(s.value), t.loaded.scene = !0, W)), n = () => {
804
804
  if (W)
805
805
  return W;
806
806
  }, i = (a) => {
807
807
  if (!W) throw new Error("Scene has not been initialized");
808
- W.background = new I.Color(a);
809
- }, o = (a) => {
808
+ W.background = new k.Color(a);
809
+ }, r = (a) => {
810
810
  if (!W) throw new Error("Scene has not been initialized");
811
811
  if (!a) throw new Error("Renderer required to build environment");
812
- be || (ye = new I.PMREMGenerator(a), ye.compileEquirectangularShader(), be = ye.fromScene(new Is(), 0.04).texture, W.environment = be);
812
+ Se || (xe = new k.PMREMGenerator(a), xe.compileEquirectangularShader(), Se = xe.fromScene(new Is(), 0.04).texture, W.environment = Se);
813
813
  };
814
- return je = j(
814
+ return Ge = G(
815
815
  () => s.value,
816
816
  (a) => i(a)
817
817
  ), {
818
- init: n,
819
- get: r,
818
+ init: o,
819
+ get: n,
820
820
  dispose: () => {
821
- t.loaded.scene = !1, je == null || je(), je = null, W && (W.traverse((a) => {
821
+ t.loaded.scene = !1, Ge == null || Ge(), Ge = null, W && (W.traverse((a) => {
822
822
  var u, p;
823
823
  a.isMesh && ((u = a.geometry) == null || u.dispose(), Array.isArray(a.material) ? a.material.forEach((P) => P == null ? void 0 : P.dispose()) : (p = a.material) == null || p.dispose());
824
- }), W.clear(), W = null, be == null || be.dispose(), ye == null || ye.dispose(), be = null, ye = null);
824
+ }), W.clear(), W = null, Se == null || Se.dispose(), xe == null || xe.dispose(), Se = null, xe = null);
825
825
  },
826
826
  setBackgroundColor: i,
827
- setEnvironment: o
827
+ setEnvironment: r
828
828
  };
829
829
  };
830
- let L = null, Oe = null, Ne = null;
830
+ let R = null, Oe = null, Ne = null;
831
831
  const Xe = () => {
832
- const e = M(), { get: t } = Ie(), { getCamera: s } = Re(), { width: n, height: r, subjectLoaded: i } = N(e);
833
- function o(w) {
834
- return console.debug("useRenderer init"), L ? (console.debug("renderer already inited"), L) : (L = new I.WebGLRenderer({ antialias: !0, alpha: !0, preserveDrawingBuffer: !0 }), L.setSize(n.value, r.value), L.toneMapping = I.ACESFilmicToneMapping, L.toneMappingExposure = 0.8, L.shadowMap.enabled = !0, L.shadowMap.type = I.PCFSoftShadowMap, L.outputColorSpace = I.SRGBColorSpace, w && w.appendChild(L.domElement), e.loaded.renderer = !0, L);
832
+ const e = T(), { get: t } = Ie(), { getCamera: s } = Re(), { width: o, height: n, subjectLoaded: i } = O(e);
833
+ function r(w) {
834
+ return console.debug("useRenderer init"), R ? (console.debug("renderer already inited"), R) : (R = new k.WebGLRenderer({ antialias: !0, alpha: !0, preserveDrawingBuffer: !0 }), R.setSize(o.value, n.value), R.toneMapping = k.ACESFilmicToneMapping, R.toneMappingExposure = 0.8, R.shadowMap.enabled = !0, R.shadowMap.type = k.PCFSoftShadowMap, R.outputColorSpace = k.SRGBColorSpace, w && w.appendChild(R.domElement), e.loaded.renderer = !0, R);
835
835
  }
836
836
  const c = () => {
837
- if (!L) throw new Error("Renderer has not been initialized");
838
- return L;
837
+ if (!R) throw new Error("Renderer has not been initialized");
838
+ return R;
839
839
  }, a = (w) => {
840
- L && (L.toneMappingExposure = w);
840
+ R && (R.toneMappingExposure = w);
841
841
  }, u = () => {
842
842
  const w = t(), m = s();
843
- !w || !m || L.render(w, m);
843
+ !w || !m || R.render(w, m);
844
844
  };
845
845
  async function p({ size: w = 1024, format: m = "jpeg", quality: g = 0.85 } = {}) {
846
- if (!L) throw new Error("Renderer has not been initialized");
846
+ if (!R) throw new Error("Renderer has not been initialized");
847
847
  const y = t(), x = s();
848
848
  if (!y || !x) throw new Error("Scene or camera not ready");
849
- const v = L.getSize(new I.Vector2()), k = L.getPixelRatio(), R = x.aspect;
849
+ const b = R.getSize(new k.Vector2()), D = R.getPixelRatio(), L = x.aspect;
850
850
  try {
851
- L.setPixelRatio(1), L.setSize(w, w, !1), x.aspect = 1, x.updateProjectionMatrix(), L.render(y, x);
851
+ R.setPixelRatio(1), R.setSize(w, w, !1), x.aspect = 1, x.updateProjectionMatrix(), R.render(y, x);
852
852
  const F = m === "png" ? "image/png" : "image/jpeg";
853
- return await new Promise(($, K) => {
854
- L.domElement.toBlob(
855
- (b) => b ? $(b) : K(new Error("toBlob returned null")),
853
+ return await new Promise((N, K) => {
854
+ R.domElement.toBlob(
855
+ (v) => v ? N(v) : K(new Error("toBlob returned null")),
856
856
  F,
857
857
  m === "jpeg" ? g : void 0
858
858
  );
859
859
  });
860
860
  } finally {
861
- L.setPixelRatio(k), L.setSize(v.x, v.y, !1), x.aspect = R, x.updateProjectionMatrix(), L.render(y, x);
861
+ R.setPixelRatio(D), R.setSize(b.x, b.y, !1), x.aspect = L, x.updateProjectionMatrix(), R.render(y, x);
862
862
  }
863
863
  }
864
- Oe = j(
865
- () => [n.value, r.value],
864
+ Oe = G(
865
+ () => [o.value, n.value],
866
866
  ([w, m]) => {
867
- !w || !m || !L || L.setSize(w, m);
867
+ !w || !m || !R || R.setSize(w, m);
868
868
  }
869
- ), Ne = j(
869
+ ), Ne = G(
870
870
  () => i.value,
871
871
  () => u()
872
872
  );
873
873
  function P() {
874
- console.debug("renderer disposed"), e.loaded.renderer = !1, Oe == null || Oe(), Ne == null || Ne(), Oe = null, Ne = null, L && (L.domElement.parentElement && L.domElement.parentElement.removeChild(L.domElement), L.dispose(), L = null);
874
+ console.debug("renderer disposed"), e.loaded.renderer = !1, Oe == null || Oe(), Ne == null || Ne(), Oe = null, Ne = null, R && (R.domElement.parentElement && R.domElement.parentElement.removeChild(R.domElement), R.dispose(), R = null);
875
875
  }
876
876
  return {
877
- init: o,
877
+ init: r,
878
878
  get: c,
879
879
  dispose: P,
880
880
  render: u,
881
881
  setExposure: a,
882
882
  captureSnapshot: p
883
883
  };
884
- }, M = Ye("3d", {
884
+ }, T = Ye("3d", {
885
885
  state: () => ({
886
886
  // models: {},
887
887
  selected: null,
@@ -913,9 +913,9 @@ const Xe = () => {
913
913
  }),
914
914
  getters: {
915
915
  active(e) {
916
- var s, n;
917
- const t = Ct.is.mobile ? lt : xe;
918
- return ((n = (s = this.models) == null ? void 0 : s[e.selected]) == null ? void 0 : n.active) || t;
916
+ var s, o;
917
+ const t = Ct.is.mobile ? lt : ee;
918
+ return ((o = (s = this.models) == null ? void 0 : s[e.selected]) == null ? void 0 : o.active) || t;
919
919
  },
920
920
  aspect(e) {
921
921
  return e.height > 0 ? e.width / e.height : 0;
@@ -955,18 +955,18 @@ const Xe = () => {
955
955
  },
956
956
  setFromResponse(e) {
957
957
  var u, p, P;
958
- const t = Mt(), s = pt(), n = ke(), r = Fe(), i = he(), o = mt(), a = fe().setSubjectsFromResponse(e);
958
+ const t = Mt(), s = pt(), o = ve(), n = Fe(), i = ge(), r = mt(), a = ae().setSubjectsFromResponse(e);
959
959
  if (this.setUuid = ((u = e == null ? void 0 : e.result) == null ? void 0 : u.setUuid) ?? null, this.basePoseId = ((p = e == null ? void 0 : e.result) == null ? void 0 : p.basePoseId) ?? null, a == null) {
960
960
  this.selected = null;
961
961
  return;
962
962
  }
963
- this.selected = a, t.initModel(this.basePoseId), i.initLights(), r.init(), s.initControls(), n.init(), o.init(), this.models[a] || (this.models[a] = {}), (P = this.models[a]) != null && P.active || (this.models[a].active = Ct.is.mobile ? lt : xe);
963
+ this.selected = a, t.initModel(this.basePoseId), i.initLights(), n.init(), s.initControls(), o.init(), r.init(), this.models[a] || (this.models[a] = {}), (P = this.models[a]) != null && P.active || (this.models[a].active = Ct.is.mobile ? lt : ee);
964
964
  }
965
965
  }
966
966
  });
967
967
  let Q = null;
968
968
  const ct = () => {
969
- const e = pe(!1), t = pe({
969
+ const e = he(!1), t = he({
970
970
  mode: null,
971
971
  camera: null,
972
972
  // camera (or your lights-camera)
@@ -975,71 +975,71 @@ const ct = () => {
975
975
  }), s = (m, g = {}) => {
976
976
  if (console.debug("useOrbitControlsBase init"), Q)
977
977
  return console.debug("controls already inited"), Q;
978
- const y = new I.Object3D();
979
- return Q = new Ds(y, m.domElement), r(g), Q;
980
- }, n = () => {
978
+ const y = new k.Object3D();
979
+ return Q = new Ts(y, m.domElement), n(g), Q;
980
+ }, o = () => {
981
981
  if (!Q) throw new Error("OrbitControls not initialized");
982
982
  return Q;
983
- }, r = (m = {}) => {
984
- const g = n();
983
+ }, n = (m = {}) => {
984
+ const g = o();
985
985
  g.enableDamping = m.enableDamping ?? !0, g.dampingFactor = m.dampingFactor ?? 0.5, g.rotateSpeed = m.rotateSpeed ?? 0.2, g.enableZoom = m.enableZoom ?? !0, g.minDistance = m.minDistance ?? 0.5, g.maxDistance = m.maxDistance ?? 6, g.panSpeed = m.panSpeed ?? 1;
986
986
  }, i = ({ mode: m, camera: g, store: y, options: x }) => {
987
- const v = n();
987
+ const b = o();
988
988
  if (!g) throw new Error(`setMode(${m}): camera is required`);
989
989
  if (!y) throw new Error(`setMode(${m}): store is required`);
990
- v.object = g, r(x), t.value = { mode: m, camera: g, store: y }, a(), v.update();
991
- }, o = () => {
990
+ b.object = g, n(x), t.value = { mode: m, camera: g, store: y }, a(), b.update();
991
+ }, r = () => {
992
992
  Q && Q.update();
993
993
  }, c = () => {
994
- const m = n(), { camera: g, store: y } = t.value;
994
+ const m = o(), { camera: g, store: y } = t.value;
995
995
  !g || !y || e.value || (y.setPosition({ ...g.position }), y.setQuaternion({ ...g.quaternion }), y.setTarget({ ...m.target }), y.setRadius(g.position.distanceTo(m.target)));
996
996
  }, a = () => {
997
- const m = n(), { camera: g, store: y } = t.value;
997
+ const m = o(), { camera: g, store: y } = t.value;
998
998
  if (!g || !y) return;
999
999
  e.value = !0;
1000
- const { position: x, quaternion: v, target: k, radius: R } = y;
1001
- m.target.set(k.x, k.y, k.z);
1002
- const F = new I.Vector3(
1003
- x.x - k.x,
1004
- x.y - k.y,
1005
- x.z - k.z
1000
+ const { position: x, quaternion: b, target: D, radius: L } = y;
1001
+ m.target.set(D.x, D.y, D.z);
1002
+ const F = new k.Vector3(
1003
+ x.x - D.x,
1004
+ x.y - D.y,
1005
+ x.z - D.z
1006
1006
  ).normalize();
1007
- g.position.copy(m.target).add(F.multiplyScalar(R)), g.quaternion.set(
1008
- v.x,
1009
- v.y,
1010
- v.z,
1011
- v.w
1007
+ g.position.copy(m.target).add(F.multiplyScalar(L)), g.quaternion.set(
1008
+ b.x,
1009
+ b.y,
1010
+ b.z,
1011
+ b.w
1012
1012
  ), m.update(), e.value = !1;
1013
1013
  }, u = 0, p = 0.1;
1014
1014
  return {
1015
1015
  init: s,
1016
- get: n,
1016
+ get: o,
1017
1017
  setMode: i,
1018
- update: o,
1018
+ update: r,
1019
1019
  syncToStore: c,
1020
1020
  applyFromStore: a,
1021
1021
  frameToBounds: (m, g = 1.75) => {
1022
- const y = n(), { camera: x } = t.value;
1022
+ const y = o(), { camera: x } = t.value;
1023
1023
  if (!x || !m) return;
1024
- const v = new I.Vector3(
1024
+ const b = new k.Vector3(
1025
1025
  m.center.x,
1026
1026
  m.center.y + m.size.y * u,
1027
1027
  m.center.z
1028
1028
  );
1029
1029
  console.log("bounds", m);
1030
- const k = Math.max(m.size.x, m.size.y, m.size.z), R = I.MathUtils.degToRad(x.fov);
1031
- let F = k / 2 / Math.tan(R / 2) * g;
1032
- y.target.copy(v), x.position.set(
1033
- v.x,
1034
- v.y + m.size.y * p,
1035
- v.z + F
1030
+ const D = Math.max(m.size.x, m.size.y, m.size.z), L = k.MathUtils.degToRad(x.fov);
1031
+ let F = D / 2 / Math.tan(L / 2) * g;
1032
+ y.target.copy(b), x.position.set(
1033
+ b.x,
1034
+ b.y + m.size.y * p,
1035
+ b.z + F
1036
1036
  ), x.near = F / 100, x.far = F * 100, x.updateProjectionMatrix(), y.update();
1037
1037
  },
1038
1038
  dispose: () => {
1039
1039
  console.debug("controls disposed"), Q && (Q.dispose(), Q = null, t.value = { mode: null, camera: null, store: null });
1040
1040
  }
1041
1041
  };
1042
- }, At = () => {
1042
+ }, Bt = () => {
1043
1043
  const { getCamera: e } = Re(), t = pt(), s = ct();
1044
1044
  return {
1045
1045
  activate: () => {
@@ -1058,7 +1058,7 @@ const ct = () => {
1058
1058
  syncToStore: s.syncToStore,
1059
1059
  applyFromStore: s.applyFromStore
1060
1060
  };
1061
- }, Zs = {
1061
+ }, Ys = {
1062
1062
  asphalt: {
1063
1063
  ao: "ao.jpg",
1064
1064
  color: "color.jpg",
@@ -1094,98 +1094,98 @@ const ct = () => {
1094
1094
  repeat: 100
1095
1095
  }
1096
1096
  };
1097
- let A = null, Ue = null, $e = null, qe = null;
1097
+ let B = null, Ue = null, $e = null, qe = null;
1098
1098
  const _t = () => {
1099
1099
  const e = Fe(), { get: t } = Ie(), { getCamera: s } = Re(), {
1100
- visible: n,
1101
- color: r,
1100
+ visible: o,
1101
+ color: n,
1102
1102
  texture: i,
1103
- offset: o
1104
- } = N(e), c = () => {
1105
- if (console.debug("useGround init"), A)
1106
- return console.debug("ground already inited"), A;
1107
- const g = t(), y = new I.PlaneGeometry(100, 100), x = new I.Color(r.value || 16777215), v = new I.MeshStandardMaterial({
1103
+ offset: r
1104
+ } = O(e), c = () => {
1105
+ if (console.debug("useGround init"), B)
1106
+ return console.debug("ground already inited"), B;
1107
+ const g = t(), y = new k.PlaneGeometry(100, 100), x = new k.Color(n.value || 16777215), b = new k.MeshStandardMaterial({
1108
1108
  color: x,
1109
1109
  // Default to white
1110
- side: I.DoubleSide,
1110
+ side: k.DoubleSide,
1111
1111
  roughness: 0.4,
1112
1112
  metalness: 0.3,
1113
1113
  emissive: x,
1114
1114
  emissiveIntensity: 0.05
1115
1115
  // tweak 0.1–0.6
1116
1116
  });
1117
- return A = new I.Mesh(y, v), A.rotation.x = -Math.PI / 2, A.receiveShadow = !0, A.visible = n.value, g.add(A), Ue = j(
1118
- () => n.value,
1117
+ return B = new k.Mesh(y, b), B.rotation.x = -Math.PI / 2, B.receiveShadow = !0, B.visible = o.value, g.add(B), Ue = G(
1118
+ () => o.value,
1119
1119
  () => a()
1120
- ), $e = j(
1121
- () => r.value,
1122
- (k) => w(k)
1123
- ), qe = j(
1120
+ ), $e = G(
1121
+ () => n.value,
1122
+ (D) => w(D)
1123
+ ), qe = G(
1124
1124
  () => i.value,
1125
- (k) => p(k)
1126
- ), A;
1125
+ (D) => p(D)
1126
+ ), B;
1127
1127
  };
1128
1128
  function a() {
1129
- if (s().position.y < A.position.y) {
1130
- A.visible = !1;
1129
+ if (s().position.y < B.position.y) {
1130
+ B.visible = !1;
1131
1131
  return;
1132
1132
  }
1133
- A.visible = n.value;
1133
+ B.visible = o.value;
1134
1134
  }
1135
1135
  function u(g, y = 1, x = 1) {
1136
- return new I.TextureLoader().load(g, (R) => {
1137
- R.wrapS = I.RepeatWrapping, R.wrapT = I.RepeatWrapping, R.repeat.set(y, x), R.needsUpdate = !0;
1136
+ return new k.TextureLoader().load(g, (L) => {
1137
+ L.wrapS = k.RepeatWrapping, L.wrapT = k.RepeatWrapping, L.repeat.set(y, x), L.needsUpdate = !0;
1138
1138
  });
1139
1139
  }
1140
1140
  const p = (g) => {
1141
- if (!A) throw new Error("Ground has not been initialized");
1142
- const y = Zs[g];
1141
+ if (!B) throw new Error("Ground has not been initialized");
1142
+ const y = Ys[g];
1143
1143
  if (!y)
1144
- A.material.map = null, A.material.normalMap = null, A.material.displacementMap = null, A.material.roughnessMap = null, A.material.aoMap = null, A.material.metalnessMap = null, A.material.needsUpdate = !0;
1144
+ B.material.map = null, B.material.normalMap = null, B.material.displacementMap = null, B.material.roughnessMap = null, B.material.aoMap = null, B.material.metalnessMap = null, B.material.needsUpdate = !0;
1145
1145
  else {
1146
- const x = `https://static.figurosity.com/3d/textures/${g}/`, v = y.repeat;
1147
- A.material.map = u(
1146
+ const x = `https://static.figurosity.com/3d/textures/${g}/`, b = y.repeat;
1147
+ B.material.map = u(
1148
1148
  `${x}${y.color}`,
1149
- v,
1150
- v
1151
- ), A.material.normalMap = u(
1149
+ b,
1150
+ b
1151
+ ), B.material.normalMap = u(
1152
1152
  `${x}${y.normal}`,
1153
- v,
1154
- v
1155
- ), A.material.displacementMap = u(
1153
+ b,
1154
+ b
1155
+ ), B.material.displacementMap = u(
1156
1156
  `${x}${y.displacement}`,
1157
- v,
1158
- v
1159
- ), A.material.roughnessMap = u(
1157
+ b,
1158
+ b
1159
+ ), B.material.roughnessMap = u(
1160
1160
  `${x}${y.roughness}`,
1161
- v,
1162
- v
1163
- ), A.material.aoMap = u(
1161
+ b,
1162
+ b
1163
+ ), B.material.aoMap = u(
1164
1164
  `${x}${y.ao}`,
1165
- v,
1166
- v
1167
- ), y.metalness && (A.material.metalnessMap = u(
1165
+ b,
1166
+ b
1167
+ ), y.metalness && (B.material.metalnessMap = u(
1168
1168
  `${x}${y.metalness}`,
1169
- v,
1170
- v
1171
- )), A.material.displacementScale = 0.1, A.material.displacementBias = -0.05, A.material.needsUpdate = !0;
1169
+ b,
1170
+ b
1171
+ )), B.material.displacementScale = 0.1, B.material.displacementBias = -0.05, B.material.needsUpdate = !0;
1172
1172
  }
1173
- A.position.y = o.value, A.geometry.computeBoundingBox(), A.geometry.computeVertexNormals();
1173
+ B.position.y = r.value, B.geometry.computeBoundingBox(), B.geometry.computeVertexNormals();
1174
1174
  }, P = () => {
1175
- if (!A) throw new Error("Ground has not been initialized");
1176
- return A;
1175
+ if (!B) throw new Error("Ground has not been initialized");
1176
+ return B;
1177
1177
  }, w = (g) => {
1178
- if (!A) throw new Error("Ground has not been initialized");
1179
- A.material.color.set(g);
1178
+ if (!B) throw new Error("Ground has not been initialized");
1179
+ B.material.color.set(g);
1180
1180
  };
1181
1181
  return { init: c, get: P, setColor: w, updateVisibility: a, dispose: () => {
1182
1182
  var y, x;
1183
- if (Ue == null || Ue(), $e == null || $e(), qe == null || qe(), Ue = null, $e = null, qe = null, !A) return;
1183
+ if (Ue == null || Ue(), $e == null || $e(), qe == null || qe(), Ue = null, $e = null, qe = null, !B) return;
1184
1184
  const g = t();
1185
- g == null || g.remove(A), (y = A.geometry) == null || y.dispose(), Array.isArray(A.material) ? A.material.forEach((v) => v == null ? void 0 : v.dispose()) : (x = A.material) == null || x.dispose(), A = null;
1185
+ g == null || g.remove(B), (y = B.geometry) == null || y.dispose(), Array.isArray(B.material) ? B.material.forEach((b) => b == null ? void 0 : b.dispose()) : (x = B.material) == null || x.dispose(), B = null;
1186
1186
  } };
1187
- }, Ys = (e, t = 16711422) => {
1188
- const s = new Ts(0.1, 0.1, 0.1, 6, 0.01), n = 0.1, r = 0.05, i = new I.ConeGeometry(r, n, 32);
1187
+ }, Qs = (e, t = 16711422) => {
1188
+ const s = new Ms(0.1, 0.1, 0.1, 6, 0.01), o = 0.1, n = 0.05, i = new k.ConeGeometry(n, o, 32);
1189
1189
  s.index || s.setIndex(
1190
1190
  Array.from(
1191
1191
  { length: s.attributes.position.count },
@@ -1196,157 +1196,157 @@ const _t = () => {
1196
1196
  { length: i.attributes.position.count },
1197
1197
  (u, p) => p
1198
1198
  )
1199
- ), i.rotateX(-Math.PI / 2), i.translate(0, 0, n / 2), Rt(s), Rt(i);
1200
- const o = ks([s, i]), c = new I.MeshBasicMaterial({
1199
+ ), i.rotateX(-Math.PI / 2), i.translate(0, 0, o / 2), Rt(s), Rt(i);
1200
+ const r = Ds([s, i]), c = new k.MeshBasicMaterial({
1201
1201
  color: t,
1202
1202
  transparent: !0,
1203
1203
  opacity: 0.8
1204
- }), a = new I.Mesh(o, c);
1204
+ }), a = new k.Mesh(r, c);
1205
1205
  if (a.position.set(0, 0, 0), a.rotateX(Math.PI), e && e.target) {
1206
- const u = new I.Vector3();
1206
+ const u = new k.Vector3();
1207
1207
  e.target.getWorldPosition(u), a.lookAt(u);
1208
1208
  }
1209
1209
  return a.position.copy(e.position), a;
1210
1210
  };
1211
- let it = {}, ne = {}, q = {}, ie = {}, Te = null, ae = null, Me = [], Ae = /* @__PURE__ */ new Map();
1211
+ let it = {}, re = {}, H = {}, ce = {}, De = null, ue = null, Me = [], Be = /* @__PURE__ */ new Map();
1212
1212
  const ut = () => {
1213
- const e = M(), t = he(), s = fe();
1214
- pe(!1);
1215
- const { subjectLoaded: n, width: r, height: i, selected: o, basePoseId: c } = N(e), { debug: a, collection: u, advancedMode: p, move: P } = N(t), { get: w } = Ie(), m = t.property, g = () => {
1216
- if (ae)
1217
- return console.warn("lights camera already inited"), ae;
1213
+ const e = T(), t = ge(), s = ae();
1214
+ he(!1);
1215
+ const { subjectLoaded: o, width: n, height: i, selected: r, basePoseId: c } = O(e), { debug: a, collection: u, advancedMode: p, move: P } = O(t), { get: w } = Ie(), m = t.property, g = () => {
1216
+ if (ue)
1217
+ return console.warn("lights camera already inited"), ue;
1218
1218
  const S = w();
1219
- return Te = v(), ae = k(), u.value.forEach((l) => {
1220
- const f = l === "key" ? ae : S, { group: T, light: D, visualization: E } = R(l, f);
1221
- q[l] = D, it[l] = T, ie[l] = E, q[l].castShadow = !0, q[l].angle = Math.PI / 4, q[l].penumbra = 0.5, q[l].shadow.camera.near = 0.5, q[l].shadow.camera.far = 12, q[l].shadow.focus = 0.9, q[l].shadow.mapSize.set(4096, 4096), q[l].shadow.bias = -2e-4, q[l].shadow.normalBias = 0.02, q[l].shadow.radius = 2, q[l].shadow.camera.updateProjectionMatrix();
1222
- }), G(), Y(), ae;
1219
+ return De = b(), ue = D(), u.value.forEach((l) => {
1220
+ const f = l === "key" ? ue : S, { group: M, light: I, visualization: E } = L(l, f);
1221
+ H[l] = I, it[l] = M, ce[l] = E, H[l].castShadow = !0, H[l].angle = Math.PI / 4, H[l].penumbra = 0.5, H[l].shadow.camera.near = 0.5, H[l].shadow.camera.far = 12, H[l].shadow.focus = 0.9, H[l].shadow.mapSize.set(4096, 4096), H[l].shadow.bias = -2e-4, H[l].shadow.normalBias = 0.02, H[l].shadow.radius = 2, H[l].shadow.camera.updateProjectionMatrix();
1222
+ }), j(), Y(), ue;
1223
1223
  }, y = () => {
1224
- if (!ae)
1224
+ if (!ue)
1225
1225
  throw new Error("Light camera not initialized.");
1226
- return ae;
1226
+ return ue;
1227
1227
  }, x = (S) => {
1228
- S && (Object.values(q).forEach((l) => l == null ? void 0 : l.color.set(S)), Object.values(ie).forEach((l) => {
1228
+ S && (Object.values(H).forEach((l) => l == null ? void 0 : l.color.set(S)), Object.values(ce).forEach((l) => {
1229
1229
  var f;
1230
1230
  return (f = l == null ? void 0 : l.material) == null ? void 0 : f.color.set(S);
1231
1231
  }));
1232
- }, v = () => {
1233
- const S = w(), l = new I.AmbientLight(16777215, 0.2);
1232
+ }, b = () => {
1233
+ const S = w(), l = new k.AmbientLight(16777215, 0.2);
1234
1234
  return S.add(l), l;
1235
- }, k = () => {
1236
- const S = w(), l = new I.PerspectiveCamera(
1235
+ }, D = () => {
1236
+ const S = w(), l = new k.PerspectiveCamera(
1237
1237
  75,
1238
- r.value / i.value,
1238
+ n.value / i.value,
1239
1239
  0.1,
1240
1240
  100
1241
1241
  );
1242
1242
  return l.position.set(0, 0, 1.5), S.add(l), l;
1243
1243
  };
1244
- function R(S, l = null) {
1245
- const f = w(), T = new I.Group(), D = new I.SpotLight(
1244
+ function L(S, l = null) {
1245
+ const f = w(), M = new k.Group(), I = new k.SpotLight(
1246
1246
  m(S, "color"),
1247
1247
  m(S, "intensity")
1248
1248
  );
1249
- D.position.set(0, 0, 0), $(), D.target.position.set(0, 1, 0), D.target.updateMatrixWorld(), f.add(D.target), T.add(D);
1250
- const E = Ys(
1251
- D,
1249
+ I.position.set(0, 0, 0), N(), I.target.position.set(0, 1, 0), I.target.updateMatrixWorld(), f.add(I.target), M.add(I);
1250
+ const E = Qs(
1251
+ I,
1252
1252
  m(S, "visualizationColor")
1253
- ), O = t.isVisible(S);
1254
- return E.visible = O, T.add(E), l.add(T), { group: T, light: D, visualization: E };
1253
+ ), U = t.isVisible(S);
1254
+ return E.visible = U, M.add(E), l.add(M), { group: M, light: I, visualization: E };
1255
1255
  }
1256
1256
  const F = () => {
1257
- $(), K(), b();
1258
- }, $ = () => {
1257
+ N(), K(), v();
1258
+ }, N = () => {
1259
1259
  if (!t.lights[c.value]) return;
1260
- const l = t.seeds[o.value], f = t.ambientScale, T = t.userScale;
1261
- if (Te && (l != null && l.ambient) && (Te.intensity = l.ambient.intensity * f), l != null && l.env) {
1262
- const D = w();
1263
- D && (D.environmentIntensity = l.env.intensity * f);
1260
+ const l = t.seeds[r.value], f = t.ambientScale, M = t.userScale;
1261
+ if (De && (l != null && l.ambient) && (De.intensity = l.ambient.intensity * f), l != null && l.env) {
1262
+ const I = w();
1263
+ I && (I.environmentIntensity = l.env.intensity * f);
1264
1264
  }
1265
- u.value.forEach((D) => {
1266
- const E = q[D];
1265
+ u.value.forEach((I) => {
1266
+ const E = H[I];
1267
1267
  if (!E) return;
1268
- const O = m(D, "color"), ge = m(D, "visible"), J = m(D, "shadow") || !1;
1269
- if (O && E.color.set(O), E.visible = ge, l != null && l[D] && (E.intensity = l[D].intensity * T), E.castShadow = J, J) {
1270
- const re = m(D, "shadowSettings", {});
1268
+ const U = m(I, "color"), be = m(I, "visible"), J = m(I, "shadow") || !1;
1269
+ if (U && E.color.set(U), E.visible = be, l != null && l[I] && (E.intensity = l[I].intensity * M), E.castShadow = J, J) {
1270
+ const le = m(I, "shadowSettings", {});
1271
1271
  E.shadow.mapSize.set(
1272
- re.width || 1024,
1273
- re.height || 1024
1274
- ), E.shadow.camera.near = re.near || 0.5, E.shadow.camera.far = re.far || 50, E.shadow.needsUpdate = !0;
1272
+ le.width || 1024,
1273
+ le.height || 1024
1274
+ ), E.shadow.camera.near = le.near || 0.5, E.shadow.camera.far = le.far || 50, E.shadow.needsUpdate = !0;
1275
1275
  }
1276
1276
  });
1277
1277
  }, K = () => {
1278
1278
  t.lights[c.value] && u.value.forEach((l) => {
1279
- if (!ie[l]) return console.warn(`${l} does not exist`);
1279
+ if (!ce[l]) return console.warn(`${l} does not exist`);
1280
1280
  const f = t.isVisible(l);
1281
- ie[l].visible = f, ie[l].material.color.set(m(l, "color"));
1281
+ ce[l].visible = f, ce[l].material.color.set(m(l, "color"));
1282
1282
  });
1283
- }, b = () => {
1283
+ }, v = () => {
1284
1284
  t.lights[c.value] && u.value.forEach((l) => {
1285
1285
  const f = m(l, "debug") || a.value;
1286
- !ne[l] && f && (ne[l] = h(l, q[l]), q[l].add(ne[l])), ne[l] && !f && (ne[l] = B(ne[l]));
1286
+ !re[l] && f && (re[l] = h(l, H[l]), H[l].add(re[l])), re[l] && !f && (re[l] = A(re[l]));
1287
1287
  });
1288
1288
  }, h = (S, l) => {
1289
- const f = w(), T = new I.SpotLightHelper(
1289
+ const f = w(), M = new k.SpotLightHelper(
1290
1290
  l,
1291
1291
  m(S, "visualizationColor")
1292
1292
  );
1293
- return f.add(T), T;
1294
- }, B = (S) => {
1293
+ return f.add(M), M;
1294
+ }, A = (S) => {
1295
1295
  const l = w();
1296
1296
  if (!(!l || !S))
1297
1297
  return l.remove(S), S.dispose(), S = null, S;
1298
- }, G = () => {
1298
+ }, j = () => {
1299
1299
  const S = y();
1300
1300
  if (!s.bounds) return;
1301
- const f = t.target, T = new I.Vector3(f.x, f.y, f.z), D = new I.Vector3().subVectors(T, S.position).normalize(), E = new I.Vector3(
1302
- D.x,
1301
+ const f = t.target, M = new k.Vector3(f.x, f.y, f.z), I = new k.Vector3().subVectors(M, S.position).normalize(), E = new k.Vector3(
1302
+ I.x,
1303
1303
  0,
1304
- D.z
1305
- ).normalize(), O = new I.Vector3(
1304
+ I.z
1305
+ ).normalize(), U = new k.Vector3(
1306
1306
  -E.z,
1307
1307
  0,
1308
1308
  E.x
1309
- ), J = 2 * S.position.distanceTo(T) / Math.sqrt(3), re = 1, _e = T.clone().add(O.clone().multiplyScalar(-J / re)).add(D.clone().multiplyScalar(Math.sqrt(3) * J / 2)), as = T.clone().add(O.clone().multiplyScalar(J / re)).add(D.clone().multiplyScalar(Math.sqrt(3) * J / 2));
1310
- it.fill.position.copy(_e), it.back.position.copy(as), u.value.forEach((ht) => {
1309
+ ), J = 2 * S.position.distanceTo(M) / Math.sqrt(3), le = 1, _e = M.clone().add(U.clone().multiplyScalar(-J / le)).add(I.clone().multiplyScalar(Math.sqrt(3) * J / 2)), ls = M.clone().add(U.clone().multiplyScalar(J / le)).add(I.clone().multiplyScalar(Math.sqrt(3) * J / 2));
1310
+ it.fill.position.copy(_e), it.back.position.copy(ls), u.value.forEach((ht) => {
1311
1311
  var Pt, st, Lt;
1312
- const gt = q[ht];
1313
- gt.shadow.needsUpdate = !0, gt.target.position.copy(T), gt.target.updateMatrixWorld(), (Pt = ie[ht]) == null || Pt.lookAt(T), (Lt = (st = ne[ht]) == null ? void 0 : st.update) == null || Lt.call(st);
1312
+ const gt = H[ht];
1313
+ gt.shadow.needsUpdate = !0, gt.target.position.copy(M), gt.target.updateMatrixWorld(), (Pt = ce[ht]) == null || Pt.lookAt(M), (Lt = (st = re[ht]) == null ? void 0 : st.update) == null || Lt.call(st);
1314
1314
  });
1315
1315
  }, z = (S) => {
1316
1316
  const l = `watcher-${S}`;
1317
- if (Ae.has(l)) return;
1318
- const f = j(
1317
+ if (Be.has(l)) return;
1318
+ const f = G(
1319
1319
  () => [t.lights[S], t.options[S]],
1320
1320
  F,
1321
1321
  { deep: !0 }
1322
1322
  );
1323
- Ae.set(l, f);
1324
- }, U = (S) => {
1325
- const l = `watcher-${S}`, f = Ae.get(l);
1326
- f && (f(), Ae.delete(l));
1323
+ Be.set(l, f);
1324
+ }, $ = (S) => {
1325
+ const l = `watcher-${S}`, f = Be.get(l);
1326
+ f && (f(), Be.delete(l));
1327
1327
  }, Y = () => {
1328
1328
  Me.push(
1329
- j(
1330
- () => [p.value, o.value, P.value],
1329
+ G(
1330
+ () => [p.value, r.value, P.value],
1331
1331
  () => F()
1332
1332
  )
1333
1333
  ), Me.push(
1334
- j(
1334
+ G(
1335
1335
  () => [t.ambientScale, t.userScale],
1336
1336
  () => F()
1337
1337
  )
1338
1338
  ), Me.push(
1339
- j(
1340
- () => n.value,
1339
+ G(
1340
+ () => o.value,
1341
1341
  (S) => {
1342
- S === !0 && G();
1342
+ S === !0 && j();
1343
1343
  }
1344
1344
  )
1345
1345
  ), Me.push(
1346
- j(
1346
+ G(
1347
1347
  () => c.value,
1348
1348
  (S, l) => {
1349
- l && U(l), S != null && (z(S), ls(F));
1349
+ l && $(l), S != null && (z(S), cs(F));
1350
1350
  },
1351
1351
  { immediate: !0 }
1352
1352
  )
@@ -1354,20 +1354,20 @@ const ut = () => {
1354
1354
  };
1355
1355
  return {
1356
1356
  init: g,
1357
- updatePosition: G,
1357
+ updatePosition: j,
1358
1358
  getCamera: y,
1359
1359
  dispose: () => {
1360
1360
  const S = w();
1361
- S && (Me.forEach((l) => l()), Me = [], Ae.forEach((l) => l()), Ae.clear(), Object.values(q).forEach((l) => S.remove(l)), Object.values(ne).forEach((l) => S.remove(l)), Object.values(ie).forEach((l) => {
1362
- var f, T, D, E;
1363
- S.remove(l), (T = (f = l.geometry) == null ? void 0 : f.dispose) == null || T.call(f), (E = (D = l.material) == null ? void 0 : D.dispose) == null || E.call(D);
1364
- }), Te && S.remove(Te), it = {}, ne = {}, q = {}, ie = {}, Te = null, ae = null);
1361
+ S && (Me.forEach((l) => l()), Me = [], Be.forEach((l) => l()), Be.clear(), Object.values(H).forEach((l) => S.remove(l)), Object.values(re).forEach((l) => S.remove(l)), Object.values(ce).forEach((l) => {
1362
+ var f, M, I, E;
1363
+ S.remove(l), (M = (f = l.geometry) == null ? void 0 : f.dispose) == null || M.call(f), (E = (I = l.material) == null ? void 0 : I.dispose) == null || E.call(I);
1364
+ }), De && S.remove(De), it = {}, re = {}, H = {}, ce = {}, De = null, ue = null);
1365
1365
  },
1366
1366
  applyColorPreview: x,
1367
1367
  applyFromStore: F
1368
1368
  };
1369
- }, Qs = 0.4, eo = 0.25, Bt = () => {
1370
- const e = he(), t = ct(), { getCamera: s } = ut();
1369
+ }, eo = 0.4, to = 0.25, At = () => {
1370
+ const e = ge(), t = ct(), { getCamera: s } = ut();
1371
1371
  return {
1372
1372
  activate: () => {
1373
1373
  t.setMode({
@@ -1385,45 +1385,45 @@ const ut = () => {
1385
1385
  }
1386
1386
  });
1387
1387
  },
1388
- frameToBounds: (i, o = 1.75) => {
1388
+ frameToBounds: (i, r = 1.75) => {
1389
1389
  if (!i) return;
1390
- const c = t.get(), a = s(), u = new I.Vector3(
1390
+ const c = t.get(), a = s(), u = new k.Vector3(
1391
1391
  i.center.x,
1392
- i.center.y + i.size.y * Qs,
1392
+ i.center.y + i.size.y * eo,
1393
1393
  i.center.z
1394
- ), p = Math.max(i.size.x, i.size.y, i.size.z), P = I.MathUtils.degToRad(a.fov), w = p / 2 / Math.tan(P / 2) * o;
1395
- c.target.copy(u), a.position.set(u.x, u.y + i.size.y * eo, u.z + w), a.near = w / 100, a.far = w * 100, a.updateProjectionMatrix(), c.update();
1394
+ ), p = Math.max(i.size.x, i.size.y, i.size.z), P = k.MathUtils.degToRad(a.fov), w = p / 2 / Math.tan(P / 2) * r;
1395
+ c.target.copy(u), a.position.set(u.x, u.y + i.size.y * to, u.z + w), a.near = w / 100, a.far = w * 100, a.updateProjectionMatrix(), c.update();
1396
1396
  },
1397
1397
  syncToStore: t.syncToStore,
1398
1398
  applyFromStore: t.applyFromStore
1399
1399
  };
1400
1400
  };
1401
- let le = null;
1402
- const to = () => {
1401
+ let de = null;
1402
+ const so = () => {
1403
1403
  const e = () => {
1404
- const s = M();
1405
- return le = new I.LoadingManager(), le.onStart = function(n) {
1406
- s.loading.active = !0, s.loading.url = n, s.loading.percent = 0;
1407
- }, le.onError = () => {
1404
+ const s = T();
1405
+ return de = new k.LoadingManager(), de.onStart = function(o) {
1406
+ s.loading.active = !0, s.loading.url = o, s.loading.percent = 0;
1407
+ }, de.onError = () => {
1408
1408
  s.loading.active = !1, s.loading.url = null;
1409
- }, le.onLoad = function() {
1409
+ }, de.onLoad = function() {
1410
1410
  s.loading.active = !1, s.loading.url = null, s.loading.percent = 100;
1411
- }, le.onProgress = function(n, r, i) {
1412
- s.loading.percent = Math.round(r / i * 100);
1413
- }, le;
1411
+ }, de.onProgress = function(o, n, i) {
1412
+ s.loading.percent = Math.round(n / i * 100);
1413
+ }, de;
1414
1414
  };
1415
- return { get: () => (le || e(), le) };
1416
- }, so = /hair|lash|brow|eye|cornea|sclera|iris|pupil|tear|teeth|tongue|mouth|gum|lip|nail/i, oo = (e, t, s = {}) => {
1417
- const { removeSpecular: n = !1, removeShininess: r = !1 } = s;
1415
+ return { get: () => (de || e(), de) };
1416
+ }, oo = /hair|lash|brow|eye|cornea|sclera|iris|pupil|tear|teeth|tongue|mouth|gum|lip|nail/i, no = (e, t, s = {}) => {
1417
+ const { removeSpecular: o = !1, removeShininess: n = !1 } = s;
1418
1418
  e && e.traverse((i) => {
1419
1419
  if (!i.isMesh) return;
1420
1420
  (Array.isArray(i.material) ? i.material : [i.material]).forEach((c) => {
1421
1421
  if (!c) return;
1422
1422
  const a = `${i.name} ${c.name || ""}`;
1423
- so.test(a) || (c.color && c.color.set(t), n && c.specular && c.specular.set(0), r && typeof c.shininess == "number" && (c.shininess = 0), c.needsUpdate = !0);
1423
+ oo.test(a) || (c.color && c.color.set(t), o && c.specular && c.specular.set(0), n && typeof c.shininess == "number" && (c.shininess = 0), c.needsUpdate = !0);
1424
1424
  });
1425
1425
  });
1426
- }, no = 1, ro = "https://www.gstatic.com/draco/v1/decoders/", dt = {
1426
+ }, ro = 1, io = "https://www.gstatic.com/draco/v1/decoders/", dt = {
1427
1427
  roughnessFloor: 0.85,
1428
1428
  metalness: null,
1429
1429
  envMapIntensity: null,
@@ -1432,7 +1432,7 @@ const to = () => {
1432
1432
  ambientIntensity: 0.2,
1433
1433
  spotIntensity: 1,
1434
1434
  envIntensity: 1
1435
- }, io = {
1435
+ }, ao = {
1436
1436
  nude: { ...dt },
1437
1437
  // Smooth ships with no texture maps — pure-white sculpting reference.
1438
1438
  // All "detail" has to come from form-revealing shading on the
@@ -1460,194 +1460,194 @@ const to = () => {
1460
1460
  envIntensity: 1
1461
1461
  }
1462
1462
  };
1463
- let Se = null, ce = null, Be, Gt = 0, te = dt;
1464
- const jt = () => {
1465
- const { get: e } = to(), t = fe(), s = M(), n = Fe(), r = Mt(), { selected: i } = N(s), { url: o } = N(t), { subjectHex: c } = N(r), { offset: a } = N(n), { getCamera: u } = Re(), { get: p } = Ie(), { render: P } = Xe(), w = (v) => {
1466
- const { setExposure: k } = Xe(), R = he(), F = ++Gt;
1463
+ let we = null, pe = null, Ae, jt = 0, se = dt;
1464
+ const Gt = () => {
1465
+ const { get: e } = so(), t = ae(), s = T(), o = Fe(), n = Mt(), { selected: i } = O(s), { url: r } = O(t), { subjectHex: c } = O(n), { offset: a } = O(o), { getCamera: u } = Re(), { get: p } = Ie(), { render: P } = Xe(), w = (b) => {
1466
+ const { setExposure: D } = Xe(), L = ge(), F = ++jt;
1467
1467
  s.subjectLoaded = !1, m();
1468
- const $ = e();
1469
- ce || (ce = new As($), ce.setDecoderPath(ro));
1470
- const K = new Ms($);
1471
- K.setDRACOLoader(ce), K.setWithCredentials(!0), K.manager.setURLModifier((b) => b), K.load(v, (b) => {
1468
+ const N = e();
1469
+ pe || (pe = new As(N), pe.setDecoderPath(io));
1470
+ const K = new Bs(N);
1471
+ K.setDRACOLoader(pe), K.setWithCredentials(!0), K.manager.setURLModifier((v) => v), K.load(b, (v) => {
1472
1472
  var S;
1473
- const h = b == null ? void 0 : b.scene;
1474
- if (F !== Gt) {
1473
+ const h = v == null ? void 0 : v.scene;
1474
+ if (F !== jt) {
1475
1475
  h == null || h.traverse((l) => {
1476
- var T;
1476
+ var M;
1477
1477
  if (!l.isMesh) return;
1478
- (T = l.geometry) == null || T.dispose();
1478
+ (M = l.geometry) == null || M.dispose();
1479
1479
  const f = l.material;
1480
- Array.isArray(f) ? f.forEach((D) => D == null ? void 0 : D.dispose()) : f == null || f.dispose();
1480
+ Array.isArray(f) ? f.forEach((I) => I == null ? void 0 : I.dispose()) : f == null || f.dispose();
1481
1481
  });
1482
1482
  return;
1483
1483
  }
1484
1484
  if (!h)
1485
1485
  return;
1486
- Se = h, te = io[(S = t.model) == null ? void 0 : S.slug] || dt, k(te.exposure), R.seedFromRecipe(s.selected, te);
1487
- const B = p(), G = u(), z = new I.Group();
1486
+ we = h, se = ao[(S = t.model) == null ? void 0 : S.slug] || dt, D(se.exposure), L.seedFromRecipe(s.selected, se);
1487
+ const A = p(), j = u(), z = new k.Group();
1488
1488
  z.name = "GLBSubject", z.add(h);
1489
- const U = /brow|lash/i;
1489
+ const $ = /brow|lash/i;
1490
1490
  h.traverse((l) => {
1491
1491
  if (!l.isMesh) return;
1492
1492
  l.castShadow = !0, l.receiveShadow = !0;
1493
- const f = Array.isArray(l.material) ? l.material : [l.material], T = `${l.name} ${f.map((E) => E == null ? void 0 : E.name).join(" ")}`, D = U.test(T);
1493
+ const f = Array.isArray(l.material) ? l.material : [l.material], M = `${l.name} ${f.map((E) => E == null ? void 0 : E.name).join(" ")}`, I = $.test(M);
1494
1494
  f.forEach((E) => {
1495
- E && (te.roughnessFloor !== null && typeof E.roughness == "number" && (E.roughness = Math.max(
1495
+ E && (se.roughnessFloor !== null && typeof E.roughness == "number" && (E.roughness = Math.max(
1496
1496
  E.roughness,
1497
- te.roughnessFloor
1498
- )), te.metalness !== null && typeof E.metalness == "number" && (E.metalness = te.metalness), te.envMapIntensity !== null && typeof E.envMapIntensity == "number" && (E.envMapIntensity = te.envMapIntensity), E.transparent && D && (E.alphaTest = 0.2, E.depthWrite = !0), E.needsUpdate = !0);
1497
+ se.roughnessFloor
1498
+ )), se.metalness !== null && typeof E.metalness == "number" && (E.metalness = se.metalness), se.envMapIntensity !== null && typeof E.envMapIntensity == "number" && (E.envMapIntensity = se.envMapIntensity), E.transparent && I && (E.alphaTest = 0.2, E.depthWrite = !0), E.needsUpdate = !0);
1499
1499
  });
1500
- }), te.applyTint && oo(h, c.value), h.scale.setScalar(no), h.updateMatrixWorld(!0);
1500
+ }), se.applyTint && no(h, c.value), h.scale.setScalar(ro), h.updateMatrixWorld(!0);
1501
1501
  const Y = Vt(h);
1502
- z.position.y -= Y.bottom, z.updateMatrixWorld(!0), B.add(z), Se = z;
1503
- const X = Vt(z);
1504
- t.setBounds(X), P(B, G), s.subjectLoaded = !0;
1502
+ z.position.y -= Y.bottom, z.updateMatrixWorld(!0), A.add(z), we = z;
1503
+ const Z = Vt(z);
1504
+ t.setBounds(Z), P(A, j), s.subjectLoaded = !0;
1505
1505
  });
1506
1506
  }, m = () => {
1507
- if (!Se) return;
1508
- p().remove(Se), Se.traverse((k) => {
1507
+ if (!we) return;
1508
+ p().remove(we), we.traverse((D) => {
1509
1509
  var F;
1510
- if (!k.isMesh) return;
1511
- (F = k.geometry) == null || F.dispose();
1512
- const R = k.material;
1513
- Array.isArray(R) ? R.forEach(($) => $ == null ? void 0 : $.dispose()) : R == null || R.dispose();
1514
- }), Se = null, s.subjectLoaded = !1;
1515
- }, g = () => Se, y = () => {
1516
- if (Be) {
1510
+ if (!D.isMesh) return;
1511
+ (F = D.geometry) == null || F.dispose();
1512
+ const L = D.material;
1513
+ Array.isArray(L) ? L.forEach((N) => N == null ? void 0 : N.dispose()) : L == null || L.dispose();
1514
+ }), we = null, s.subjectLoaded = !1;
1515
+ }, g = () => we, y = () => {
1516
+ if (Ae) {
1517
1517
  console.warn("useGLB.init() called more than once");
1518
1518
  return;
1519
1519
  }
1520
- Be = j(
1520
+ Ae = G(
1521
1521
  () => i.value,
1522
- (v, k) => {
1523
- !v || v === k || o.value && w(o.value);
1522
+ (b, D) => {
1523
+ !b || b === D || r.value && w(r.value);
1524
1524
  },
1525
1525
  { immediate: !0 }
1526
1526
  );
1527
1527
  }, x = () => {
1528
- Be == null || Be(), Be = null, m(), ce == null || ce.dispose(), ce = null;
1528
+ Ae == null || Ae(), Ae = null, m(), pe == null || pe.dispose(), pe = null;
1529
1529
  };
1530
1530
  return Ut(() => {
1531
1531
  x();
1532
1532
  }), { init: y, get: g, dispose: x };
1533
- }, ao = (e, t, s = 500) => {
1534
- const n = e.material;
1535
- n.transparent = !0;
1536
- const r = n.opacity, i = performance.now(), o = (c) => {
1537
- const a = c - i, u = Math.min(a / s, 1), p = r + (t - r) * u;
1538
- n.opacity = p, u < 1 && requestAnimationFrame(o);
1533
+ }, lo = (e, t, s = 500) => {
1534
+ const o = e.material;
1535
+ o.transparent = !0;
1536
+ const n = o.opacity, i = performance.now(), r = (c) => {
1537
+ const a = c - i, u = Math.min(a / s, 1), p = n + (t - n) * u;
1538
+ o.opacity = p, u < 1 && requestAnimationFrame(r);
1539
1539
  };
1540
- requestAnimationFrame(o);
1541
- }, lo = 34815;
1540
+ requestAnimationFrame(r);
1541
+ }, co = 34815;
1542
1542
  let _ = null, He = null, Je = null, Ke = null;
1543
1543
  const Ot = () => {
1544
- const e = ke(), t = Fe(), s = fe(), { show: n, divisions: r, size: i, opacity: o } = N(e), { offset: c } = N(t), { bounds: a } = N(s), { get: u } = Ie(), p = () => {
1545
- const b = k(lo), h = b, { positions: B, colors: G } = P({
1544
+ const e = ve(), t = Fe(), s = ae(), { show: o, divisions: n, size: i, opacity: r } = O(e), { offset: c } = O(t), { bounds: a } = O(s), { get: u } = Ie(), p = () => {
1545
+ const v = D(co), h = v, { positions: A, colors: j } = P({
1546
1546
  size: i.value,
1547
- divisions: r.value,
1548
- color: b,
1547
+ divisions: n.value,
1548
+ color: v,
1549
1549
  centerColor: h
1550
- }), z = w(B, G), U = m(o.value);
1551
- return new I.LineSegments(z, U);
1552
- }, P = ({ size: b, divisions: h, color: B, centerColor: G }) => {
1553
- const z = b / 2, U = b / h, Y = [], X = [], S = Math.floor(h / 2), l = (f, T, D, E) => {
1554
- Y.push(f, T, D);
1555
- const O = E ? G : B;
1556
- X.push(O.r, O.g, O.b);
1550
+ }), z = w(A, j), $ = m(r.value);
1551
+ return new k.LineSegments(z, $);
1552
+ }, P = ({ size: v, divisions: h, color: A, centerColor: j }) => {
1553
+ const z = v / 2, $ = v / h, Y = [], Z = [], S = Math.floor(h / 2), l = (f, M, I, E) => {
1554
+ Y.push(f, M, I);
1555
+ const U = E ? j : A;
1556
+ Z.push(U.r, U.g, U.b);
1557
1557
  };
1558
1558
  for (let f = 0; f <= h; f++) {
1559
- const T = -z + f * U, D = f === S;
1559
+ const M = -z + f * $, I = f === S;
1560
1560
  for (let E = 0; E <= h; E++) {
1561
- const O = -z + E * U, J = D || E === S;
1562
- l(-z, T, O, J), l(+z, T, O, J);
1561
+ const U = -z + E * $, J = I || E === S;
1562
+ l(-z, M, U, J), l(+z, M, U, J);
1563
1563
  }
1564
1564
  }
1565
1565
  for (let f = 0; f <= h; f++) {
1566
- const T = -z + f * U, D = f === S;
1566
+ const M = -z + f * $, I = f === S;
1567
1567
  for (let E = 0; E <= h; E++) {
1568
- const O = -z + E * U, J = D || E === S;
1569
- l(T, -z, O, J), l(T, +z, O, J);
1568
+ const U = -z + E * $, J = I || E === S;
1569
+ l(M, -z, U, J), l(M, +z, U, J);
1570
1570
  }
1571
1571
  }
1572
1572
  for (let f = 0; f <= h; f++) {
1573
- const T = -z + f * U, D = f === S;
1573
+ const M = -z + f * $, I = f === S;
1574
1574
  for (let E = 0; E <= h; E++) {
1575
- const O = -z + E * U, J = D || E === S;
1576
- l(T, O, -z, J), l(T, O, +z, J);
1575
+ const U = -z + E * $, J = I || E === S;
1576
+ l(M, U, -z, J), l(M, U, +z, J);
1577
1577
  }
1578
1578
  }
1579
- return { positions: Y, colors: X };
1580
- }, w = (b, h) => {
1581
- const B = new I.BufferGeometry();
1582
- return B.setAttribute(
1579
+ return { positions: Y, colors: Z };
1580
+ }, w = (v, h) => {
1581
+ const A = new k.BufferGeometry();
1582
+ return A.setAttribute(
1583
1583
  "position",
1584
- new I.Float32BufferAttribute(b, 3)
1585
- ), B.setAttribute("color", new I.Float32BufferAttribute(h, 3)), B;
1586
- }, m = (b) => new I.LineBasicMaterial({
1584
+ new k.Float32BufferAttribute(v, 3)
1585
+ ), A.setAttribute("color", new k.Float32BufferAttribute(h, 3)), A;
1586
+ }, m = (v) => new k.LineBasicMaterial({
1587
1587
  transparent: !0,
1588
- opacity: b,
1588
+ opacity: v,
1589
1589
  depthWrite: !1,
1590
- blending: I.NormalBlending,
1590
+ blending: k.NormalBlending,
1591
1591
  vertexColors: !0
1592
1592
  }), g = () => {
1593
- _ && v(n.value);
1593
+ _ && b(o.value);
1594
1594
  }, y = () => {
1595
- const b = u();
1596
- _ = p(), $(), b.add(_), x(0);
1597
- }, x = (b) => {
1598
- _ && (_.material.transparent = !0, b = n.value ? b : 0, _.material.opacity = b);
1599
- }, v = (b) => {
1600
- const h = b ? o.value : 0;
1601
- ao(_, h, 500);
1602
- }, k = (b) => ({
1603
- r: (b >> 16 & 255) / 255,
1604
- g: (b >> 8 & 255) / 255,
1605
- b: (b & 255) / 255
1606
- }), R = (b, h) => {
1595
+ const v = u();
1596
+ _ = p(), N(), v.add(_), x(0);
1597
+ }, x = (v) => {
1598
+ _ && (_.material.transparent = !0, v = o.value ? v : 0, _.material.opacity = v);
1599
+ }, b = (v) => {
1600
+ const h = v ? r.value : 0;
1601
+ lo(_, h, 500);
1602
+ }, D = (v) => ({
1603
+ r: (v >> 16 & 255) / 255,
1604
+ g: (v >> 8 & 255) / 255,
1605
+ b: (v & 255) / 255
1606
+ }), L = (v, h) => {
1607
1607
  if (!_) return;
1608
- const B = k(b), G = k(h), z = _.geometry.attributes.color, U = _.geometry.attributes.position, Y = U.count, X = i.value / 2, S = i.value / r.value, l = Math.floor(r.value / 2);
1608
+ const A = D(v), j = D(h), z = _.geometry.attributes.color, $ = _.geometry.attributes.position, Y = $.count, Z = i.value / 2, S = i.value / n.value, l = Math.floor(n.value / 2);
1609
1609
  for (let f = 0; f < Y; f++) {
1610
- const T = U.getX(f), D = U.getY(f), E = U.getZ(f), O = Math.round((T + X) / S), ge = Math.round((D + X) / S), J = Math.round((E + X) / S), _e = O === l || ge === l || J === l ? B : G;
1610
+ const M = $.getX(f), I = $.getY(f), E = $.getZ(f), U = Math.round((M + Z) / S), be = Math.round((I + Z) / S), J = Math.round((E + Z) / S), _e = U === l || be === l || J === l ? A : j;
1611
1611
  z.setXYZ(f, _e.r, _e.g, _e.b);
1612
1612
  }
1613
1613
  z.needsUpdate = !0;
1614
1614
  }, F = () => {
1615
- const b = u();
1616
- _ && (b.remove(_), _.geometry.dispose(), _.material.dispose(), _ = null), _ = p(), $(), b.add(_);
1617
- }, $ = () => {
1615
+ const v = u();
1616
+ _ && (v.remove(_), _.geometry.dispose(), _.material.dispose(), _ = null), _ = p(), N(), v.add(_);
1617
+ }, N = () => {
1618
1618
  var h;
1619
- const b = ((h = a.value) == null ? void 0 : h.bottom) || 0;
1620
- _.position.set(0, b + i.value / 2 + 7e-3, 0);
1619
+ const v = ((h = a.value) == null ? void 0 : h.bottom) || 0;
1620
+ _.position.set(0, v + i.value / 2 + 7e-3, 0);
1621
1621
  };
1622
- return He = j(
1623
- () => [i.value, r.value],
1624
- ([b, h], [B, G]) => {
1625
- b === B && h === G || (F(), g());
1622
+ return He = G(
1623
+ () => [i.value, n.value],
1624
+ ([v, h], [A, j]) => {
1625
+ v === A && h === j || (F(), g());
1626
1626
  },
1627
1627
  { flush: "post" }
1628
- ), Je = j(
1629
- () => n.value,
1628
+ ), Je = G(
1629
+ () => o.value,
1630
1630
  () => {
1631
1631
  g();
1632
1632
  },
1633
1633
  { flush: "post" }
1634
- ), Ke = j(
1635
- () => o.value,
1636
- (b) => {
1637
- x(b);
1634
+ ), Ke = G(
1635
+ () => r.value,
1636
+ (v) => {
1637
+ x(v);
1638
1638
  },
1639
1639
  { flush: "post" }
1640
1640
  ), {
1641
1641
  init: y,
1642
- showHideGrid: v,
1643
- updateGridColors: R,
1642
+ showHideGrid: b,
1643
+ updateGridColors: L,
1644
1644
  dispose: () => {
1645
- var h, B;
1646
- const b = u();
1647
- He == null || He(), Je == null || Je(), Ke == null || Ke(), He = null, Je = null, Ke = null, _ && (b.remove(_), (h = _.geometry) == null || h.dispose(), Array.isArray(_.material) ? _.material.forEach((G) => G == null ? void 0 : G.dispose()) : (B = _.material) == null || B.dispose(), _ = null);
1645
+ var h, A;
1646
+ const v = u();
1647
+ He == null || He(), Je == null || Je(), Ke == null || Ke(), He = null, Je = null, Ke = null, _ && (v.remove(_), (h = _.geometry) == null || h.dispose(), Array.isArray(_.material) ? _.material.forEach((j) => j == null ? void 0 : j.dispose()) : (A = _.material) == null || A.dispose(), _ = null);
1648
1648
  }
1649
1649
  };
1650
- }, co = { class: "three-dimension-tool" }, uo = ["data-id"], po = /* @__PURE__ */ Object.assign({
1650
+ }, uo = { class: "three-dimension-tool" }, po = ["data-id"], mo = /* @__PURE__ */ Object.assign({
1651
1651
  name: "ThreeDimensionTool",
1652
1652
  slug: "three-dimension-tool",
1653
1653
  inheritAttrs: !1
@@ -1659,94 +1659,94 @@ const Ot = () => {
1659
1659
  setup(e) {
1660
1660
  const t = e;
1661
1661
  let s = null;
1662
- const n = C(() => Number(t.id)), r = M(), i = pt(), o = he(), c = fe(), { move: a } = N(o), { isFrozen: u } = N(r), p = pe(null), P = pe(!1);
1662
+ const o = C(() => Number(t.id)), n = T(), i = pt(), r = ge(), c = ae(), { move: a } = O(r), { isFrozen: u } = O(n), p = he(null), P = he(!1);
1663
1663
  let w, m, g;
1664
- const y = ct(), x = At(), v = Bt(), { init: k, setEnvironment: R } = Ie(), { init: F } = Xe(), { init: $ } = Re(), { init: K, updateVisibility: b } = _t(), { init: h, updatePosition: B } = ut(), { init: G } = jt(), { init: z } = Ot(), U = () => {
1664
+ const y = ct(), x = Bt(), b = At(), { init: D, setEnvironment: L } = Ie(), { init: F } = Xe(), { init: N } = Re(), { init: K, updateVisibility: v } = _t(), { init: h, updatePosition: A } = ut(), { init: j } = Gt(), { init: z } = Ot(), $ = () => {
1665
1665
  if (!p.value || P.value) {
1666
1666
  console.warn("Canvas element not found");
1667
1667
  return;
1668
1668
  }
1669
- P.value = !0, g = k(), m = F(p.value), R(m), G(), w = $(), h(), z(), K(), y.init(m), Y();
1669
+ P.value = !0, g = D(), m = F(p.value), L(m), j(), w = N(), h(), z(), K(), y.init(m), Y();
1670
1670
  }, Y = () => {
1671
- P.value && (a.value !== s && (s = a.value, a.value ? v.activate() : x.activate()), y.update(), a.value ? (B(), v.syncToStore()) : x.syncToStore(), b(), m.render(g, w), requestAnimationFrame(Y));
1672
- }, X = () => {
1671
+ P.value && (a.value !== s && (s = a.value, a.value ? b.activate() : x.activate()), y.update(), a.value ? (A(), b.syncToStore()) : x.syncToStore(), v(), m.render(g, w), requestAnimationFrame(Y));
1672
+ }, Z = () => {
1673
1673
  if (p.value) {
1674
1674
  const l = window.innerWidth, f = window.innerHeight;
1675
- r.$patch({ width: l, height: f }), p.value.style.height = f + "px";
1675
+ n.$patch({ width: l, height: f }), p.value.style.height = f + "px";
1676
1676
  }
1677
1677
  }, S = () => {
1678
- u.value && r.pokeFreeze();
1678
+ u.value && n.pokeFreeze();
1679
1679
  };
1680
- return j(u, (l) => {
1681
- var T;
1682
- const f = (T = y.get) == null ? void 0 : T.call(y);
1680
+ return G(u, (l) => {
1681
+ var M;
1682
+ const f = (M = y.get) == null ? void 0 : M.call(y);
1683
1683
  f && (f.enabled = !l);
1684
- }), j(
1685
- () => [i.applyRevision, o.applyRevision],
1684
+ }), G(
1685
+ () => [i.applyRevision, r.applyRevision],
1686
1686
  () => {
1687
- P.value && (v.activate(), B(), x.activate());
1687
+ P.value && (b.activate(), A(), x.activate());
1688
1688
  }
1689
1689
  ), $t(() => {
1690
1690
  var l;
1691
- console.log("onMounted", p.value), U(), window.addEventListener("resize", X), X(), (l = p.value) == null || l.addEventListener("pointerdown", S, !0);
1692
- }), j(
1691
+ console.log("onMounted", p.value), $(), window.addEventListener("resize", Z), Z(), (l = p.value) == null || l.addEventListener("pointerdown", S, !0);
1692
+ }), G(
1693
1693
  () => c.bounds,
1694
1694
  (l) => {
1695
- l && (v.activate(), o.hasRig || (v.frameToBounds(l), v.syncToStore(), o.markFramed()), x.activate(), i.hasRig || (x.frameToBounds(l), x.syncToStore(), i.markFramed()));
1695
+ l && (b.activate(), r.hasRig || (b.frameToBounds(l), b.syncToStore(), r.markFramed()), x.activate(), i.hasRig || (x.frameToBounds(l), x.syncToStore(), i.markFramed()));
1696
1696
  }
1697
- ), j(
1698
- () => r.subjectLoaded,
1697
+ ), G(
1698
+ () => n.subjectLoaded,
1699
1699
  (l) => {
1700
1700
  if (!l) return;
1701
1701
  const f = c.bounds;
1702
1702
  if (!f) return;
1703
1703
  i.hasRig || (y.frameToBounds(f), i.markFramed());
1704
- const T = y.get();
1705
- T.update(), T.saveState();
1704
+ const M = y.get();
1705
+ M.update(), M.saveState();
1706
1706
  }
1707
1707
  ), Ut(() => {
1708
1708
  var l;
1709
- console.debug("ThreeDimensionTool unMounted"), window.removeEventListener("resize", this), (l = p.value) == null || l.removeEventListener("pointerdown", S, !0), P.value = !1, jt().dispose(), Ot().dispose(), _t().dispose(), ut().dispose(), ct().dispose(), Re().dispose(), Ie().dispose(), Xe().dispose();
1710
- }), (l, f) => (at(), cs("div", co, [
1709
+ console.debug("ThreeDimensionTool unMounted"), window.removeEventListener("resize", this), (l = p.value) == null || l.removeEventListener("pointerdown", S, !0), P.value = !1, Gt().dispose(), Ot().dispose(), _t().dispose(), ut().dispose(), ct().dispose(), Re().dispose(), Ie().dispose(), Xe().dispose();
1710
+ }), (l, f) => (at(), us("div", uo, [
1711
1711
  wt("", !0),
1712
- us("div", {
1712
+ ds("div", {
1713
1713
  class: "tres",
1714
1714
  ref_key: "tres",
1715
1715
  ref: p,
1716
- "data-id": n.value
1717
- }, null, 8, uo)
1716
+ "data-id": o.value
1717
+ }, null, 8, po)
1718
1718
  ]));
1719
1719
  }
1720
- }), Nt = /* @__PURE__ */ Object.assign({ "../i18n/en-US/index.js": () => import("./index-CwHAnjEe.js") }), H = (e = "../i18n") => {
1721
- const t = bs(), s = pe({}), n = C(() => t.lang.isoName || "en-US"), r = async () => {
1722
- const i = `${e}/${n.value}/index.js`;
1720
+ }), Nt = /* @__PURE__ */ Object.assign({ "../i18n/en-US/index.js": () => import("./index-CwHAnjEe.js") }), q = (e = "../i18n") => {
1721
+ const t = ys(), s = he({}), o = C(() => t.lang.isoName || "en-US"), n = async () => {
1722
+ const i = `${e}/${o.value}/index.js`;
1723
1723
  if (Nt[i])
1724
1724
  try {
1725
- const o = await Nt[i]();
1726
- o.default && Object.assign(s.value, o.default);
1727
- } catch (o) {
1728
- console.error(`Error loading i18n for ${n.value}`, o);
1725
+ const r = await Nt[i]();
1726
+ r.default && Object.assign(s.value, r.default);
1727
+ } catch (r) {
1728
+ console.error(`Error loading i18n for ${o.value}`, r);
1729
1729
  }
1730
1730
  else
1731
1731
  console.error(`Module not found: ${i}`);
1732
1732
  };
1733
- return j(
1734
- () => n.value,
1733
+ return G(
1734
+ () => o.value,
1735
1735
  () => {
1736
- r();
1736
+ n();
1737
1737
  },
1738
1738
  { immediate: !0 }
1739
- ), ds(() => {
1740
- r();
1739
+ ), ps(() => {
1740
+ n();
1741
1741
  }), { lang: s };
1742
- }, Ee = 26, Z = ({ tab: e = oe, store: t, options: s = [] }) => {
1743
- const n = ws(), r = M(n), i = C({
1744
- get: () => r.isExpanded(s),
1742
+ }, ke = 26, X = ({ tab: e = ne, store: t, options: s = [] }) => {
1743
+ const o = Cs(), n = T(o), i = C({
1744
+ get: () => n.isExpanded(s),
1745
1745
  set: (a) => {
1746
- a && r.setActive(e);
1746
+ a && n.setActive(e);
1747
1747
  }
1748
- }), o = C(() => t && t.changed);
1749
- return { click: () => r.setActive(e), expanded: i, selected: o };
1748
+ }), r = C(() => t && t.changed);
1749
+ return { click: () => n.setActive(e), expanded: i, selected: r };
1750
1750
  }, zt = V({
1751
1751
  name: "ToolResetButton",
1752
1752
  props: {
@@ -1755,45 +1755,45 @@ const Ot = () => {
1755
1755
  },
1756
1756
  emits: ["click"],
1757
1757
  setup(e, { slots: t, emit: s }) {
1758
- function n() {
1758
+ function o() {
1759
1759
  s("click");
1760
1760
  }
1761
- function r() {
1761
+ function n() {
1762
1762
  const i = {
1763
1763
  label: e.label,
1764
1764
  class: "full-width",
1765
1765
  flat: !0,
1766
- onClick: n,
1766
+ onClick: o,
1767
1767
  disable: e.disable
1768
1768
  };
1769
1769
  return d("div", { class: "tool-reset-button q-pa-md" }, d(qt, i));
1770
1770
  }
1771
- return () => r();
1771
+ return () => n();
1772
1772
  }
1773
1773
  }), ft = V({
1774
1774
  name: "FrozenOverlay",
1775
1775
  setup() {
1776
- const e = M(), { isFrozen: t } = N(e);
1776
+ const e = T(), { isFrozen: t } = O(e);
1777
1777
  function s() {
1778
- return ps(d("div", {
1778
+ return ms(d("div", {
1779
1779
  class: "frozen-overlay",
1780
1780
  onClick: () => e.pokeFreeze()
1781
- }, []), [[ms, t.value]]);
1781
+ }, []), [[fs, t.value]]);
1782
1782
  }
1783
1783
  return () => s();
1784
1784
  }
1785
1785
  }), es = V({
1786
1786
  name: "TdColorsSection",
1787
1787
  setup(e, { slots: t, emit: s }) {
1788
- const { lang: n } = H(), r = M(), i = mt(), o = Fe(), { active: c } = N(r), a = pe(!1), u = pe(!1), p = C(
1788
+ const { lang: o } = q(), n = T(), i = mt(), r = Fe(), { active: c } = O(n), a = he(!1), u = he(!1), p = C(
1789
1789
  () => {
1790
- var b;
1791
- return (b = n.value.td) == null ? void 0 : b.components.colors.items.background;
1790
+ var v;
1791
+ return (v = o.value.td) == null ? void 0 : v.components.colors.items.background;
1792
1792
  }
1793
1793
  ), P = C(
1794
1794
  () => {
1795
- var b;
1796
- return (b = n.value.td) == null ? void 0 : b.components.colors.items.ground;
1795
+ var v;
1796
+ return (v = o.value.td) == null ? void 0 : v.components.colors.items.ground;
1797
1797
  }
1798
1798
  ), w = C(() => ({
1799
1799
  key: p.value,
@@ -1809,39 +1809,39 @@ const Ot = () => {
1809
1809
  type: "none",
1810
1810
  icon: "f_ground",
1811
1811
  size: "sm",
1812
- color: o.colorHex,
1812
+ color: r.colorHex,
1813
1813
  onClick: () => u.value = !0
1814
1814
  })), g = C({
1815
1815
  get: () => u.value || a.value,
1816
- set: (b) => u.value = a.value = !1
1816
+ set: (v) => u.value = a.value = !1
1817
1817
  }), y = C({
1818
- get: () => u.value ? o.colorHex : i.colorHex,
1819
- set: (b) => {
1818
+ get: () => u.value ? r.colorHex : i.colorHex,
1819
+ set: (v) => {
1820
1820
  if (u.value) {
1821
- o.setColorHex(b);
1821
+ r.setColorHex(v);
1822
1822
  return;
1823
1823
  }
1824
- i.setColorHex(b);
1824
+ i.setColorHex(v);
1825
1825
  }
1826
1826
  }), x = C(() => ({
1827
1827
  class: "td-colors-tool q-pa-xs row justify-center items-center q-gutter-md",
1828
1828
  style: g.value ? "display: none" : ""
1829
- })), v = C(() => ({
1829
+ })), b = C(() => ({
1830
1830
  modelValue: y.value,
1831
- "onUpdate:modelValue": (b) => y.value = b,
1831
+ "onUpdate:modelValue": (v) => y.value = v,
1832
1832
  show: g.value,
1833
- "onUpdate:show": (b) => g.value = b,
1834
- label: k.value
1835
- })), k = C(() => u.value ? P.value : p.value), R = () => {
1836
- i.reset(), o.reset();
1837
- }, F = C(() => o.changed || i.changed), $ = C(() => ({
1833
+ "onUpdate:show": (v) => g.value = v,
1834
+ label: D.value
1835
+ })), D = C(() => u.value ? P.value : p.value), L = () => {
1836
+ i.reset(), r.reset();
1837
+ }, F = C(() => r.changed || i.changed), N = C(() => ({
1838
1838
  label: "Reset Colors",
1839
- onClick: R,
1839
+ onClick: L,
1840
1840
  style: g.value ? "display: none" : "",
1841
1841
  disable: !F.value
1842
1842
  }));
1843
- j(c, (b) => {
1844
- b !== oe && (g.value = !1);
1843
+ G(c, (v) => {
1844
+ v !== ne && (g.value = !1);
1845
1845
  });
1846
1846
  function K() {
1847
1847
  return d("div", {
@@ -1849,16 +1849,16 @@ const Ot = () => {
1849
1849
  }, [
1850
1850
  d(ft),
1851
1851
  d("div", x.value, [
1852
- d(me, w.value),
1853
- d(me, m.value)
1852
+ d(ie, w.value),
1853
+ d(ie, m.value)
1854
1854
  ]),
1855
- d(zt, $.value),
1856
- d(ys, v.value)
1855
+ d(zt, N.value),
1856
+ d(Ss, b.value)
1857
1857
  ]);
1858
1858
  }
1859
1859
  return () => K();
1860
1860
  }
1861
- }), mo = V({
1861
+ }), fo = V({
1862
1862
  name: "TdColorsExpansion",
1863
1863
  props: {
1864
1864
  modelValue: { type: Number, default: 0 },
@@ -1867,13 +1867,13 @@ const Ot = () => {
1867
1867
  },
1868
1868
  emits: ["click", "update:modelValue"],
1869
1869
  setup(e, { slots: t, emit: s }) {
1870
- const { lang: n } = H(), r = Mt(), { expanded: i, selected: o } = Z({
1871
- store: r,
1872
- options: oe,
1873
- tab: oe
1870
+ const { lang: o } = q(), n = Mt(), { expanded: i, selected: r } = X({
1871
+ store: n,
1872
+ options: ne,
1873
+ tab: ne
1874
1874
  }), c = C(() => {
1875
1875
  var u;
1876
- return (u = n.value.td) == null ? void 0 : u.components.colors.title;
1876
+ return (u = o.value.td) == null ? void 0 : u.components.colors.title;
1877
1877
  });
1878
1878
  C({
1879
1879
  get: () => e.modelValue,
@@ -1886,7 +1886,7 @@ const Ot = () => {
1886
1886
  modelValue: i.value,
1887
1887
  "onUpdate:modelValue": (p) => i.value = p,
1888
1888
  label: c.value,
1889
- selected: o.value,
1889
+ selected: r.value,
1890
1890
  icon: "f_palette"
1891
1891
  };
1892
1892
  return d(Ve, u, () => d(es));
@@ -1896,27 +1896,27 @@ const Ot = () => {
1896
1896
  }), ts = V({
1897
1897
  name: "TdGridSection",
1898
1898
  setup(e, { slots: t, emit: s }) {
1899
- const { lang: n } = H(), r = ke(), i = C(
1899
+ const { lang: o } = q(), n = ve(), i = C(
1900
1900
  () => {
1901
1901
  var w, m;
1902
- return o.value ? ((w = n.value.td) == null ? void 0 : w.components.grid.toggle.off) || "" : ((m = n.value.td) == null ? void 0 : m.components.grid.toggle.on) || "";
1902
+ return r.value ? ((w = o.value.td) == null ? void 0 : w.components.grid.toggle.off) || "" : ((m = o.value.td) == null ? void 0 : m.components.grid.toggle.on) || "";
1903
1903
  }
1904
- ), o = C({
1905
- get: () => r.show,
1906
- set: (w) => r.setProperty("show", w)
1904
+ ), r = C({
1905
+ get: () => n.show,
1906
+ set: (w) => n.setProperty("show", w)
1907
1907
  }), c = C({
1908
- get: () => r.opacity,
1909
- set: (w) => r.setProperty("opacity", w)
1908
+ get: () => n.opacity,
1909
+ set: (w) => n.setProperty("opacity", w)
1910
1910
  }), a = C({
1911
- get: () => r.size,
1912
- set: (w) => r.setProperty("size", w)
1911
+ get: () => n.size,
1912
+ set: (w) => n.setProperty("size", w)
1913
1913
  }), u = C({
1914
- get: () => r.divisions,
1915
- set: (w) => r.setProperty("divisions", w)
1914
+ get: () => n.divisions,
1915
+ set: (w) => n.setProperty("divisions", w)
1916
1916
  }), p = C(() => ({
1917
1917
  label: "Reset Grid",
1918
- disable: !r.changed,
1919
- onClick: r.reset
1918
+ disable: !n.changed,
1919
+ onClick: n.reset
1920
1920
  }));
1921
1921
  function P() {
1922
1922
  const w = {
@@ -1924,8 +1924,8 @@ const Ot = () => {
1924
1924
  }, m = {
1925
1925
  access: "grd",
1926
1926
  // drawer: !props.noIcons,
1927
- modelValue: o.value,
1928
- "onUpdate:modelValue": (k) => o.value = k,
1927
+ modelValue: r.value,
1928
+ "onUpdate:modelValue": (D) => r.value = D,
1929
1929
  label: i.value
1930
1930
  // dark: props.dark,
1931
1931
  // disable: props.disable,
@@ -1938,7 +1938,7 @@ const Ot = () => {
1938
1938
  max: 100,
1939
1939
  initial: 50,
1940
1940
  modelValue: c.value * 100,
1941
- "onUpdate:modelValue": (k) => c.value = k / 100
1941
+ "onUpdate:modelValue": (D) => c.value = D / 100
1942
1942
  }, y = {
1943
1943
  title: "Size",
1944
1944
  icon: "f_size",
@@ -1946,7 +1946,7 @@ const Ot = () => {
1946
1946
  max: 300,
1947
1947
  initial: 200,
1948
1948
  modelValue: a.value * 100,
1949
- "onUpdate:modelValue": (k) => a.value = k / 100
1949
+ "onUpdate:modelValue": (D) => a.value = D / 100
1950
1950
  }, x = {
1951
1951
  title: "Number of lines",
1952
1952
  icon: "f_grid",
@@ -1956,13 +1956,13 @@ const Ot = () => {
1956
1956
  step: 2,
1957
1957
  initial: 6,
1958
1958
  modelValue: u.value,
1959
- "onUpdate:modelValue": (k) => u.value = k
1960
- }, v = [d(ft), d(Ht, m)];
1961
- return o.value && (v.push(d(We, y)), v.push(d(We, x)), v.push(d(We, g)), v.push(d(zt, p.value))), d("div", w, v);
1959
+ "onUpdate:modelValue": (D) => u.value = D
1960
+ }, b = [d(ft), d(Ht, m)];
1961
+ return r.value && (b.push(d(We, y)), b.push(d(We, x)), b.push(d(We, g)), b.push(d(zt, p.value))), d("div", w, b);
1962
1962
  }
1963
1963
  return () => P();
1964
1964
  }
1965
- }), fo = V({
1965
+ }), ho = V({
1966
1966
  name: "TdGridExpansion",
1967
1967
  props: {
1968
1968
  modelValue: { type: Number, default: 0 },
@@ -1971,13 +1971,13 @@ const Ot = () => {
1971
1971
  },
1972
1972
  emits: ["click", "update:modelValue"],
1973
1973
  setup(e, { slots: t, emit: s }) {
1974
- const { lang: n } = H(), r = ke(), { expanded: i, selected: o } = Z({
1975
- store: r,
1976
- options: we,
1977
- tab: we
1974
+ const { lang: o } = q(), n = ve(), { expanded: i, selected: r } = X({
1975
+ store: n,
1976
+ options: Ce,
1977
+ tab: Ce
1978
1978
  }), c = C(() => {
1979
1979
  var u;
1980
- return (u = n.value.td) == null ? void 0 : u.components.grid.title;
1980
+ return (u = o.value.td) == null ? void 0 : u.components.grid.title;
1981
1981
  });
1982
1982
  C({
1983
1983
  get: () => e.modelValue,
@@ -1990,7 +1990,7 @@ const Ot = () => {
1990
1990
  modelValue: i.value,
1991
1991
  "onUpdate:modelValue": (p) => i.value = p,
1992
1992
  label: c.value,
1993
- selected: o.value,
1993
+ selected: r.value,
1994
1994
  icon: "f_grid"
1995
1995
  };
1996
1996
  return d(Ve, u, () => d(ts));
@@ -2006,13 +2006,13 @@ const Ot = () => {
2006
2006
  },
2007
2007
  emits: ["click", "update:modelValue"],
2008
2008
  setup() {
2009
- const { lang: e } = H(), t = he(), s = M(), n = fe(), r = ut(), i = Bt(), o = At(), { active: c } = N(s), a = C({
2009
+ const { lang: e } = q(), t = ge(), s = T(), o = ae(), n = ut(), i = At(), r = Bt(), { active: c } = O(s), a = C({
2010
2010
  get: () => t.move,
2011
2011
  set: (h) => t.setMove(h)
2012
2012
  }), u = C(
2013
2013
  () => {
2014
- var h, B;
2015
- return t.move ? ((h = e.value.td) == null ? void 0 : h.components.lights.toggles.position.off) || "" : ((B = e.value.td) == null ? void 0 : B.components.lights.toggles.position.on) || "";
2014
+ var h, A;
2015
+ return t.move ? ((h = e.value.td) == null ? void 0 : h.components.lights.toggles.position.off) || "" : ((A = e.value.td) == null ? void 0 : A.components.lights.toggles.position.on) || "";
2016
2016
  }
2017
2017
  ), p = C(() => ({
2018
2018
  modelValue: a.value,
@@ -2028,37 +2028,37 @@ const Ot = () => {
2028
2028
  var h;
2029
2029
  return ((h = e.value.td) == null ? void 0 : h.components.lights.userIntensity) || "";
2030
2030
  }
2031
- ), m = 0, g = 50, y = 100, x = (h, B, G) => ({
2032
- toSlider: (z) => z <= B ? m + (z - h) / (B - h) * (g - m) : g + (z - B) / (G - B) * (y - g),
2033
- fromSlider: (z) => z <= g ? h + (z - m) / (g - m) * (B - h) : B + (z - g) / (y - g) * (G - B)
2034
- }), v = x(
2031
+ ), m = 0, g = 50, y = 100, x = (h, A, j) => ({
2032
+ toSlider: (z) => z <= A ? m + (z - h) / (A - h) * (g - m) : g + (z - A) / (j - A) * (y - g),
2033
+ fromSlider: (z) => z <= g ? h + (z - m) / (g - m) * (A - h) : A + (z - g) / (y - g) * (j - A)
2034
+ }), b = x(
2035
2035
  Pe,
2036
- se,
2036
+ oe,
2037
2037
  Et
2038
- ), k = x(
2038
+ ), D = x(
2039
2039
  Pe,
2040
- se,
2041
- It
2042
- ), R = (h, B, G, z) => ({
2040
+ oe,
2041
+ kt
2042
+ ), L = (h, A, j, z) => ({
2043
2043
  title: h,
2044
2044
  icon: "f_brightness",
2045
2045
  min: m,
2046
2046
  max: y,
2047
- modelValue: B.toSlider(G),
2048
- "onUpdate:modelValue": (U) => {
2049
- z(B.fromSlider(U));
2047
+ modelValue: A.toSlider(j),
2048
+ "onUpdate:modelValue": ($) => {
2049
+ z(A.fromSlider($));
2050
2050
  }
2051
2051
  }), F = C(
2052
- () => R(
2052
+ () => L(
2053
2053
  P.value,
2054
- v,
2054
+ b,
2055
2055
  t.ambientScale,
2056
2056
  (h) => t.setAmbientScale(h)
2057
2057
  )
2058
- ), $ = C(
2059
- () => R(
2058
+ ), N = C(
2059
+ () => L(
2060
2060
  w.value,
2061
- k,
2061
+ D,
2062
2062
  t.userScale,
2063
2063
  (h) => t.setUserScale(h)
2064
2064
  )
@@ -2066,30 +2066,30 @@ const Ot = () => {
2066
2066
  label: "Reset Lights",
2067
2067
  disable: !t.changed,
2068
2068
  onClick: () => {
2069
- var B;
2069
+ var A;
2070
2070
  t.reset();
2071
- const h = n.bounds;
2072
- h && (i.activate(), i.frameToBounds(h), i.syncToStore(), o.activate()), (B = r.applyFromStore) == null || B.call(r);
2071
+ const h = o.bounds;
2072
+ h && (i.activate(), i.frameToBounds(h), i.syncToStore(), r.activate()), (A = n.applyFromStore) == null || A.call(n);
2073
2073
  }
2074
2074
  }));
2075
- j(c, (h) => {
2076
- h !== de && (a.value = !1);
2075
+ G(c, (h) => {
2076
+ h !== fe && (a.value = !1);
2077
2077
  });
2078
- function b() {
2078
+ function v() {
2079
2079
  const h = {
2080
2080
  class: "td-lights-tool"
2081
- }, B = [
2081
+ }, A = [
2082
2082
  d(ft),
2083
2083
  d(Ht, p.value),
2084
2084
  d(We, F.value),
2085
- d(We, $.value),
2085
+ d(We, N.value),
2086
2086
  d(zt, K.value)
2087
2087
  ];
2088
- return d("div", h, B);
2088
+ return d("div", h, A);
2089
2089
  }
2090
- return () => b();
2090
+ return () => v();
2091
2091
  }
2092
- }), ho = V({
2092
+ }), go = V({
2093
2093
  name: "TdLightExpansion",
2094
2094
  props: {
2095
2095
  modelValue: { type: Number, default: 0 },
@@ -2098,13 +2098,13 @@ const Ot = () => {
2098
2098
  },
2099
2099
  emits: ["click", "update:modelValue"],
2100
2100
  setup(e, { slots: t, emit: s }) {
2101
- const { lang: n } = H(), r = he(), { expanded: i, selected: o } = Z({
2102
- store: r,
2103
- options: de,
2104
- tab: de
2101
+ const { lang: o } = q(), n = ge(), { expanded: i, selected: r } = X({
2102
+ store: n,
2103
+ options: fe,
2104
+ tab: fe
2105
2105
  }), c = C(() => {
2106
2106
  var u;
2107
- return (u = n.value.td) == null ? void 0 : u.components.lights.title;
2107
+ return (u = o.value.td) == null ? void 0 : u.components.lights.title;
2108
2108
  });
2109
2109
  C({
2110
2110
  get: () => e.modelValue,
@@ -2117,7 +2117,7 @@ const Ot = () => {
2117
2117
  modelValue: i.value,
2118
2118
  "onUpdate:modelValue": (p) => i.value = p,
2119
2119
  label: c.value,
2120
- selected: o.value,
2120
+ selected: r.value,
2121
2121
  icon: "f_bulb_light"
2122
2122
  };
2123
2123
  return d(Ve, u, () => d(ss));
@@ -2129,29 +2129,29 @@ const Ot = () => {
2129
2129
  setup() {
2130
2130
  const e = Symbol.for("RelatedSection"), t = Ze(e);
2131
2131
  function s() {
2132
- const n = {
2132
+ const o = {
2133
2133
  class: "td-related-section q-mx-lg q-my-sm"
2134
- }, r = [];
2135
- return t && r.push(d(t)), d("div", n, r);
2134
+ }, n = [];
2135
+ return t && n.push(d(t)), d("div", o, n);
2136
2136
  }
2137
2137
  return () => s();
2138
2138
  }
2139
- }), go = V({
2139
+ }), vo = V({
2140
2140
  name: "TdRelatedExpansion",
2141
2141
  setup(e, { slots: t, emit: s }) {
2142
- const { expanded: n } = Z({
2143
- options: Ce,
2144
- tab: Ce
2145
- }), r = C(() => "Related");
2142
+ const { expanded: o } = X({
2143
+ options: Ee,
2144
+ tab: Ee
2145
+ }), n = C(() => "Related");
2146
2146
  function i() {
2147
- const o = {
2147
+ const r = {
2148
2148
  class: "td-related-expansion",
2149
- modelValue: n.value,
2150
- "onUpdate:modelValue": (c) => n.value = c,
2151
- label: r.value,
2149
+ modelValue: o.value,
2150
+ "onUpdate:modelValue": (c) => o.value = c,
2151
+ label: n.value,
2152
2152
  icon: "f_related"
2153
2153
  };
2154
- return d(Ve, o, () => d(os));
2154
+ return d(Ve, r, () => d(os));
2155
2155
  }
2156
2156
  return () => i();
2157
2157
  }
@@ -2166,53 +2166,53 @@ const Ot = () => {
2166
2166
  }
2167
2167
  return () => s();
2168
2168
  }
2169
- }), vo = V({
2169
+ }), bo = V({
2170
2170
  name: "TdSavedExpansion",
2171
2171
  setup() {
2172
- const { expanded: e } = Z({
2173
- options: Ee,
2174
- tab: Ee
2172
+ const { expanded: e } = X({
2173
+ options: ke,
2174
+ tab: ke
2175
2175
  }), t = C(() => "Saved");
2176
2176
  function s() {
2177
- const n = {
2177
+ const o = {
2178
2178
  class: "td-saved-expansion",
2179
2179
  modelValue: e.value,
2180
- "onUpdate:modelValue": (r) => e.value = r,
2180
+ "onUpdate:modelValue": (n) => e.value = n,
2181
2181
  label: t.value,
2182
2182
  icon: "f_save"
2183
2183
  };
2184
- return d(Ve, n, () => d(ns));
2184
+ return d(Ve, o, () => d(ns));
2185
2185
  }
2186
2186
  return () => s();
2187
2187
  }
2188
2188
  });
2189
- function bo() {
2190
- const { freeServer: e, paidServer: t } = Cs();
2191
- return Es({ freeServer: e, paidServer: t });
2189
+ function yo() {
2190
+ const { freeServer: e, paidServer: t } = Es();
2191
+ return ks({ freeServer: e, paidServer: t });
2192
2192
  }
2193
- const yo = Symbol.for("activity-tracking"), So = ["nude", "muscle", "smooth"];
2194
- function xo() {
2195
- const e = M(), t = fe(), s = Ze(yo, null), { getThumbnail: n } = bo();
2193
+ const So = Symbol.for("activity-tracking"), xo = ["nude", "muscle", "smooth"];
2194
+ function wo() {
2195
+ const e = T(), t = ae(), s = Ze(So, null), { getThumbnail: o } = yo();
2196
2196
  return { skins: C(() => {
2197
- const i = e.setUuid, o = e.selected, c = {};
2197
+ const i = e.setUuid, r = e.selected, c = {};
2198
2198
  return Object.values(t.models).forEach((a) => {
2199
2199
  !(a != null && a.slug) || c[a.slug] || (c[a.slug] = a);
2200
- }), So.filter((a) => c[a]).map((a) => {
2200
+ }), xo.filter((a) => c[a]).map((a) => {
2201
2201
  const u = c[a];
2202
2202
  return {
2203
2203
  id: u.id,
2204
2204
  slug: a,
2205
2205
  name: a,
2206
- imageUrl: i ? n({ type: "sets", uuid: i, image: a }) : null,
2207
- selected: u.id === o,
2206
+ imageUrl: i ? o({ type: "sets", uuid: i, image: a }) : null,
2207
+ selected: u.id === r,
2208
2208
  click: () => {
2209
- e.selected = u.id, s == null || s.trackEvent(Ps, { value: a });
2209
+ e.selected = u.id, s == null || s.trackEvent(Ls, { value: a });
2210
2210
  }
2211
2211
  };
2212
2212
  });
2213
2213
  }) };
2214
2214
  }
2215
- const wo = V({
2215
+ const Co = V({
2216
2216
  name: "TdSkinButton",
2217
2217
  props: {
2218
2218
  id: { type: Number, required: !0 },
@@ -2228,8 +2228,8 @@ const wo = V({
2228
2228
  margin: "3px",
2229
2229
  marginBottom: e.size === "sm" ? "40px" : "30px"
2230
2230
  }));
2231
- function n() {
2232
- const r = {
2231
+ function o() {
2232
+ const n = {
2233
2233
  class: `td-${e.slug}-button td-skin-button`,
2234
2234
  key: e.id,
2235
2235
  label: e.label,
@@ -2241,63 +2241,63 @@ const wo = V({
2241
2241
  selected: e.selected,
2242
2242
  onClick: () => t("click")
2243
2243
  };
2244
- return d(me, r);
2244
+ return d(ie, n);
2245
2245
  }
2246
- return () => n();
2246
+ return () => o();
2247
2247
  }
2248
2248
  }), rs = V({
2249
2249
  name: "TdSkinsSection",
2250
2250
  props: { size: { type: String, default: "sm" } },
2251
2251
  setup(e) {
2252
- const { skins: t } = xo(), { lang: s } = H();
2253
- function n() {
2254
- const r = [d(ft)];
2252
+ const { skins: t } = wo(), { lang: s } = q();
2253
+ function o() {
2254
+ const n = [d(ft)];
2255
2255
  return t.value.forEach((i) => {
2256
- var o, c;
2257
- r.push(
2258
- d(wo, {
2256
+ var r, c;
2257
+ n.push(
2258
+ d(Co, {
2259
2259
  id: i.id,
2260
2260
  slug: i.slug,
2261
- label: ((c = (o = s.value.td) == null ? void 0 : o.components.skins.items) == null ? void 0 : c[i.slug]) ?? i.slug,
2261
+ label: ((c = (r = s.value.td) == null ? void 0 : r.components.skins.items) == null ? void 0 : c[i.slug]) ?? i.slug,
2262
2262
  image: i.imageUrl,
2263
2263
  selected: i.selected,
2264
2264
  size: e.size,
2265
2265
  onClick: i.click
2266
2266
  })
2267
2267
  );
2268
- }), d(Jt, {}, () => r);
2268
+ }), d(Jt, {}, () => n);
2269
2269
  }
2270
- return () => n();
2270
+ return () => o();
2271
2271
  }
2272
- }), Co = V({
2272
+ }), Eo = V({
2273
2273
  name: "TdSkinsExpansion",
2274
2274
  setup() {
2275
- const { lang: e } = H(), t = fe(), { expanded: s } = Z({
2276
- options: xe,
2277
- tab: xe
2278
- }), n = C(() => {
2275
+ const { lang: e } = q(), t = ae(), { expanded: s } = X({
2276
+ options: ee,
2277
+ tab: ee
2278
+ }), o = C(() => {
2279
2279
  var c;
2280
- const o = (c = t.model) == null ? void 0 : c.slug;
2281
- return !!o && o !== Wt;
2282
- }), r = C(() => {
2283
- var o;
2284
- return (o = e.value.td) == null ? void 0 : o.components.skins.title;
2280
+ const r = (c = t.model) == null ? void 0 : c.slug;
2281
+ return !!r && r !== Wt;
2282
+ }), n = C(() => {
2283
+ var r;
2284
+ return (r = e.value.td) == null ? void 0 : r.components.skins.title;
2285
2285
  });
2286
2286
  function i() {
2287
- const o = {
2287
+ const r = {
2288
2288
  class: "td-skins-expansion",
2289
2289
  "data-cy": "td-skins-expansion",
2290
2290
  modelValue: s.value,
2291
2291
  "onUpdate:modelValue": (c) => s.value = c,
2292
- label: r.value,
2293
- selected: n.value,
2292
+ label: n.value,
2293
+ selected: o.value,
2294
2294
  icon: "f_shirt"
2295
2295
  };
2296
- return d(Ve, o, () => d(rs, { size: "sm", class: "q-py-sm" }));
2296
+ return d(Ve, r, () => d(rs, { size: "sm", class: "q-py-sm" }));
2297
2297
  }
2298
2298
  return () => i();
2299
2299
  }
2300
- }), Eo = V({
2300
+ }), is = V({
2301
2301
  name: "TdButtons",
2302
2302
  props: {
2303
2303
  modelValue: { type: Number, default: 0 },
@@ -2309,167 +2309,169 @@ const wo = V({
2309
2309
  }
2310
2310
  },
2311
2311
  emits: ["click", "update:modelValue"],
2312
- setup(e, { slots: t, emit: s }) {
2313
- const n = At(), r = Bt(), i = pt(), o = Fe(), c = he(), a = mt(), { changed: u } = N(i), { changed: p } = N(o), { changed: P } = N(c), { changed: w } = N(a), m = C(() => !(u.value || p.value || P.value || w.value));
2314
- function g() {
2315
- i.reset(), o.reset(), c.reset(), a.reset(), n.applyFromStore(), r.applyFromStore();
2316
- }
2317
- const y = (v) => v.preventDefault();
2312
+ setup(e, { emit: t }) {
2313
+ const s = Bt(), o = At(), n = pt(), i = ae(), r = ve(), c = Fe(), a = ge(), u = mt(), { changed: p } = O(n), { changed: P } = O(r), { changed: w } = O(c), { changed: m } = O(a), { changed: g } = O(u), y = C(() => !(p.value || P.value || w.value || m.value || g.value));
2318
2314
  function x() {
2319
- const k = {
2320
- style: C(() => e.fixed ? "position: fixed;bottom: 0; left: 0; right: 0;border-top: 1px solid var(--grey-300)" : ""),
2321
- class: "row justify-center items-center q-pa-md"
2322
- }, R = {
2315
+ n.reset(), r.reset(), c.reset(), a.reset(), u.reset();
2316
+ const L = i.bounds;
2317
+ L ? (o.activate(), o.frameToBounds(L), o.syncToStore(), s.activate(), s.frameToBounds(L), s.syncToStore()) : (s.applyFromStore(), o.applyFromStore());
2318
+ }
2319
+ const b = (L) => L.preventDefault();
2320
+ function D() {
2321
+ const F = {
2322
+ style: e.fixed ? "position: fixed;bottom: 0; left: 0; right: 0;border-top: 1px solid var(--grey-300)" : "",
2323
+ class: e.fixed ? "row justify-center items-center q-pa-md glass-background" : "row justify-center items-center q-pa-md"
2324
+ }, N = {
2323
2325
  class: "td-reset-button",
2324
2326
  label: "Reset All",
2325
- onClick: g,
2326
- onKeyup: y,
2327
+ onClick: x,
2328
+ onKeyup: b,
2327
2329
  rounded: !0,
2328
2330
  unelevated: !0,
2329
2331
  outline: !0,
2330
- disable: m.value
2332
+ disable: y.value
2331
2333
  };
2332
- return d("div", k, [d(qt, R)]);
2334
+ return d("div", F, [d(qt, N)]);
2333
2335
  }
2334
- return () => x();
2336
+ return () => D();
2335
2337
  }
2336
- }), is = V({
2338
+ }), as = V({
2337
2339
  name: "TdPoseButtonsSection",
2338
2340
  setup() {
2339
2341
  const e = Symbol.for("PoseButtonsSection"), t = Ze(e, null);
2340
2342
  function s() {
2341
- const n = {
2343
+ const o = {
2342
2344
  class: "td-pose-buttons-section"
2343
- }, r = [];
2344
- return t && r.push(d(t)), d("div", n, r);
2345
+ }, n = [];
2346
+ return t && n.push(d(t)), d("div", o, n);
2345
2347
  }
2346
2348
  return () => s();
2347
2349
  }
2348
- }), Io = V({
2350
+ }), ko = V({
2349
2351
  name: "TdExpansions",
2350
2352
  setup(e, { slots: t, emit: s }) {
2351
- function n() {
2353
+ function o() {
2352
2354
  return d("div", {
2353
2355
  class: "td-expansions",
2354
2356
  onClick: (i) => i.stopPropagation(),
2355
2357
  style: "padding-bottom: 60px; position: relative "
2356
2358
  }, [
2357
- d(is),
2358
- d(ve),
2359
- d(Co),
2360
- d(ve),
2361
- d(mo),
2362
- d(ve),
2359
+ d(as),
2360
+ d(ye),
2361
+ d(Eo),
2362
+ d(ye),
2363
2363
  d(fo),
2364
- d(ve),
2364
+ d(ye),
2365
2365
  d(ho),
2366
- d(ve),
2366
+ d(ye),
2367
+ d(go),
2368
+ d(ye),
2367
2369
  // h(TsGridExpansion),
2368
2370
  // h(QSeparator),
2369
2371
  // h(TsAdjustmentExpansion),
2370
- d(go),
2371
- d(ve),
2372
2372
  d(vo),
2373
- d(ve),
2373
+ d(ye),
2374
+ d(bo),
2375
+ d(ye),
2374
2376
  // h('div', {}, store.loading.percent),
2375
- d(Eo)
2377
+ d(is)
2376
2378
  ]);
2377
2379
  }
2378
- return () => n();
2380
+ return () => o();
2379
2381
  }
2380
- }), Do = V({
2382
+ }), Io = V({
2381
2383
  name: "TdColorsButton",
2382
2384
  props: { size: String },
2383
2385
  setup(e, {}) {
2384
- const t = ke(), s = M(), n = C(() => (s == null ? void 0 : s.hasAccess("grd")) || !1), { lang: r } = H(), i = C(() => {
2386
+ const t = ve(), s = T(), o = C(() => (s == null ? void 0 : s.hasAccess("grd")) || !1), { lang: n } = q(), i = C(() => {
2385
2387
  var p;
2386
- return (p = r.value.td) == null ? void 0 : p.controls.colors.iconTitle;
2387
- }), { click: o, selected: c } = Z({
2388
+ return (p = n.value.td) == null ? void 0 : p.controls.colors.iconTitle;
2389
+ }), { click: r, selected: c } = X({
2388
2390
  store: t,
2389
- options: oe,
2390
- tab: oe
2391
+ options: ne,
2392
+ tab: ne
2391
2393
  });
2392
2394
  function a(p) {
2393
2395
  return s.block(p);
2394
2396
  }
2395
2397
  function u() {
2396
2398
  const p = {
2397
- hasAccess: n.value,
2399
+ hasAccess: o.value,
2398
2400
  selected: c.value,
2399
- onClick: o,
2401
+ onClick: r,
2400
2402
  onBlockAccess: a,
2401
2403
  size: e.size,
2402
- "data-id": oe,
2404
+ "data-id": ne,
2403
2405
  name: "colors",
2404
2406
  type: "none",
2405
2407
  icon: "f_palette",
2406
2408
  label: i.value
2407
2409
  };
2408
- return d(me, p, () => []);
2410
+ return d(ie, p, () => []);
2409
2411
  }
2410
2412
  return () => u();
2411
2413
  }
2412
- }), ko = V({
2414
+ }), To = V({
2413
2415
  name: "TdGridButton",
2414
2416
  props: { size: String },
2415
2417
  setup(e, {}) {
2416
- const t = ke(), s = M(), n = C(() => (s == null ? void 0 : s.hasAccess("grd")) || !1), { lang: r } = H(), i = C(() => {
2418
+ const t = ve(), s = T(), o = C(() => (s == null ? void 0 : s.hasAccess("grd")) || !1), { lang: n } = q(), i = C(() => {
2417
2419
  var p;
2418
- return (p = r.value.td) == null ? void 0 : p.controls.grid.iconTitle;
2419
- }), { click: o, selected: c } = Z({
2420
+ return (p = n.value.td) == null ? void 0 : p.controls.grid.iconTitle;
2421
+ }), { click: r, selected: c } = X({
2420
2422
  store: t,
2421
- options: we,
2422
- tab: we
2423
+ options: Ce,
2424
+ tab: Ce
2423
2425
  });
2424
2426
  function a(p) {
2425
2427
  return s.block(p);
2426
2428
  }
2427
2429
  function u() {
2428
2430
  const p = {
2429
- hasAccess: n.value,
2431
+ hasAccess: o.value,
2430
2432
  selected: c.value,
2431
- onClick: o,
2433
+ onClick: r,
2432
2434
  onBlockAccess: a,
2433
2435
  size: e.size,
2434
- "data-id": we,
2436
+ "data-id": Ce,
2435
2437
  name: "grid",
2436
2438
  type: "none",
2437
2439
  icon: "f_grid",
2438
2440
  label: i.value
2439
2441
  };
2440
- return d(me, p, () => []);
2442
+ return d(ie, p, () => []);
2441
2443
  }
2442
2444
  return () => u();
2443
2445
  }
2444
- }), To = V({
2446
+ }), Do = V({
2445
2447
  name: "TdLightsButton",
2446
2448
  props: { size: String },
2447
2449
  setup(e, {}) {
2448
- const t = ke(), s = M(), n = C(() => (s == null ? void 0 : s.hasAccess("grd")) || !1), { lang: r } = H(), i = C(() => {
2450
+ const t = ve(), s = T(), o = C(() => (s == null ? void 0 : s.hasAccess("grd")) || !1), { lang: n } = q(), i = C(() => {
2449
2451
  var p;
2450
- return (p = r.value.td) == null ? void 0 : p.controls.lights.iconTitle;
2451
- }), { click: o, selected: c } = Z({
2452
+ return (p = n.value.td) == null ? void 0 : p.controls.lights.iconTitle;
2453
+ }), { click: r, selected: c } = X({
2452
2454
  store: t,
2453
- options: de,
2454
- tab: de
2455
+ options: fe,
2456
+ tab: fe
2455
2457
  });
2456
2458
  function a(p) {
2457
2459
  return s.block(p);
2458
2460
  }
2459
2461
  function u() {
2460
2462
  const p = {
2461
- hasAccess: n.value,
2463
+ hasAccess: o.value,
2462
2464
  selected: c.value,
2463
- onClick: o,
2465
+ onClick: r,
2464
2466
  onBlockAccess: a,
2465
2467
  size: e.size,
2466
- "data-id": de,
2468
+ "data-id": fe,
2467
2469
  name: "lights",
2468
2470
  type: "none",
2469
2471
  icon: "f_bulb_light",
2470
2472
  label: i.value
2471
2473
  };
2472
- return d(me, p, () => []);
2474
+ return d(ie, p, () => []);
2473
2475
  }
2474
2476
  return () => u();
2475
2477
  }
@@ -2477,232 +2479,264 @@ const wo = V({
2477
2479
  name: "TsAdjustmentsButton",
2478
2480
  props: { size: String },
2479
2481
  setup(e, {}) {
2480
- const t = M(), { lang: s } = H(), n = C(() => {
2482
+ const t = T(), { lang: s } = q(), o = C(() => {
2481
2483
  var a;
2482
2484
  return (a = s.value.td) == null ? void 0 : a.controls.related.iconTitle;
2483
- }), { click: r, selected: i } = Z({
2484
- options: Ce,
2485
- tab: Ce
2485
+ }), { click: n, selected: i } = X({
2486
+ options: Ee,
2487
+ tab: Ee
2486
2488
  });
2487
- function o(a) {
2489
+ function r(a) {
2488
2490
  return t.block(a);
2489
2491
  }
2490
2492
  function c() {
2491
2493
  const a = {
2492
2494
  hasAccess: !0,
2493
2495
  selected: i.value,
2494
- onClick: r,
2495
- onBlockAccess: o,
2496
- "data-id": Ce,
2496
+ onClick: n,
2497
+ onBlockAccess: r,
2498
+ "data-id": Ee,
2497
2499
  size: e.size,
2498
2500
  name: "related",
2499
2501
  icon: "f_related",
2500
2502
  type: "none",
2501
- label: n.value
2503
+ label: o.value
2502
2504
  };
2503
- return d(me, a, () => []);
2505
+ return d(ie, a, () => []);
2504
2506
  }
2505
2507
  return () => c();
2506
2508
  }
2507
- }), Ao = V({
2509
+ }), Bo = V({
2508
2510
  name: "TdSavedButton",
2509
2511
  props: { size: String },
2510
2512
  setup(e) {
2511
- const t = M(), { lang: s } = H(), n = C(
2513
+ const t = T(), { lang: s } = q(), o = C(
2512
2514
  () => {
2513
2515
  var a, u;
2514
2516
  return ((u = (a = s.value.td) == null ? void 0 : a.controls.saved) == null ? void 0 : u.iconTitle) || "Saved";
2515
2517
  }
2516
- ), { click: r, selected: i } = Z({
2517
- options: Ee,
2518
- tab: Ee
2518
+ ), { click: n, selected: i } = X({
2519
+ options: ke,
2520
+ tab: ke
2519
2521
  });
2520
- function o(a) {
2522
+ function r(a) {
2521
2523
  return t.block(a);
2522
2524
  }
2523
2525
  function c() {
2524
2526
  const a = {
2525
2527
  hasAccess: !0,
2526
2528
  selected: i.value,
2527
- onClick: r,
2528
- onBlockAccess: o,
2529
- "data-id": Ee,
2529
+ onClick: n,
2530
+ onBlockAccess: r,
2531
+ "data-id": ke,
2530
2532
  size: e.size,
2531
2533
  name: "saved",
2532
2534
  icon: "f_save",
2533
2535
  type: "none",
2534
- label: n.value
2536
+ label: o.value
2535
2537
  };
2536
- return d(me, a, () => []);
2538
+ return d(ie, a, () => []);
2537
2539
  }
2538
2540
  return () => c();
2539
2541
  }
2540
- }), Bo = V({
2542
+ }), Ao = V({
2543
+ name: "TdSkinsButton",
2544
+ props: { size: String },
2545
+ setup(e) {
2546
+ const t = T(), { lang: s } = q(), o = C(() => {
2547
+ var a;
2548
+ return (a = s.value.td) == null ? void 0 : a.controls.skins.iconTitle;
2549
+ }), { click: n, selected: i } = X({
2550
+ options: ee,
2551
+ tab: ee
2552
+ });
2553
+ function r(a) {
2554
+ return t.block(a);
2555
+ }
2556
+ function c() {
2557
+ const a = {
2558
+ hasAccess: !0,
2559
+ selected: i.value,
2560
+ onClick: n,
2561
+ onBlockAccess: r,
2562
+ "data-id": ee,
2563
+ size: e.size,
2564
+ name: "skins",
2565
+ icon: "f_shirt",
2566
+ type: "none",
2567
+ label: o.value
2568
+ };
2569
+ return d(ie, a, () => []);
2570
+ }
2571
+ return () => c();
2572
+ }
2573
+ }), zo = V({
2541
2574
  name: "TdDefaultDrawer",
2542
2575
  props: {},
2543
2576
  emits: ["click"],
2544
2577
  setup() {
2545
- const e = M(), t = "q-ma-xs";
2546
- function s(n) {
2578
+ const e = T(), t = "q-ma-xs";
2579
+ function s(o) {
2547
2580
  return {
2548
2581
  class: t,
2549
- size: "sm",
2550
- onClick: () => e.setActive(n)
2582
+ size: "xs",
2583
+ onClick: () => e.setActive(o)
2551
2584
  };
2552
2585
  }
2553
2586
  return () => d(
2554
- De,
2587
+ Te,
2555
2588
  { name: lt },
2556
2589
  {
2557
2590
  default: () => d(Jt, {}, () => [
2558
- d(Do, s(oe)),
2559
- d(ko, s(we)),
2560
- d(To, s(de)),
2561
- d(Mo, s(Ce)),
2562
- d(Ao, s(Ee))
2591
+ d(Ao, s(ee)),
2592
+ d(Io, s(ne)),
2593
+ d(To, s(Ce)),
2594
+ d(Do, s(fe)),
2595
+ d(Mo, s(Ee)),
2596
+ d(Bo, s(ke))
2563
2597
  ]),
2564
- secondary: () => d(is)
2598
+ secondary: () => [d(as), d(is, { fixed: !1 })]
2565
2599
  }
2566
2600
  );
2567
2601
  }
2568
- }), zo = V({
2602
+ }), Po = V({
2569
2603
  name: "TdGridDrawer",
2570
2604
  setup(e, { slots: t, emit: s }) {
2571
- const { lang: n } = H(), r = C(() => {
2572
- var o;
2573
- return (o = n.value.td) == null ? void 0 : o.controls.grid.title;
2605
+ const { lang: o } = q(), n = C(() => {
2606
+ var r;
2607
+ return (r = o.value.td) == null ? void 0 : r.controls.grid.title;
2574
2608
  });
2575
2609
  function i() {
2576
- const o = {
2610
+ const r = {
2577
2611
  class: "td-grid-drawer",
2578
- name: we,
2579
- label: r.value
2612
+ name: Ce,
2613
+ label: n.value
2580
2614
  };
2581
- return d(De, o, () => d(ts));
2615
+ return d(Te, r, () => d(ts));
2582
2616
  }
2583
2617
  return () => i();
2584
2618
  }
2585
- }), Po = V({
2619
+ }), Lo = V({
2586
2620
  name: "TdRelatedDrawer",
2587
2621
  setup(e, { slots: t, emit: s }) {
2588
- const { lang: n } = H(), r = C(() => {
2589
- var o;
2590
- return (o = n.value.td) == null ? void 0 : o.controls.related.title;
2622
+ const { lang: o } = q(), n = C(() => {
2623
+ var r;
2624
+ return (r = o.value.td) == null ? void 0 : r.controls.related.title;
2591
2625
  });
2592
2626
  function i() {
2593
- const o = {
2627
+ const r = {
2594
2628
  class: "td-related-drawer",
2595
- name: Ce,
2596
- label: r.value
2629
+ name: Ee,
2630
+ label: n.value
2597
2631
  };
2598
- return d(De, o, () => d(os));
2632
+ return d(Te, r, () => d(os));
2599
2633
  }
2600
2634
  return () => i();
2601
2635
  }
2602
- }), Lo = V({
2636
+ }), Ro = V({
2603
2637
  name: "TdSavedDrawer",
2604
2638
  setup() {
2605
- const { lang: e } = H(), t = C(() => {
2606
- var n, r;
2607
- return ((r = (n = e.value.td) == null ? void 0 : n.controls.saved) == null ? void 0 : r.title) || "Saved";
2639
+ const { lang: e } = q(), t = C(() => {
2640
+ var o, n;
2641
+ return ((n = (o = e.value.td) == null ? void 0 : o.controls.saved) == null ? void 0 : n.title) || "Saved";
2608
2642
  });
2609
2643
  function s() {
2610
- const n = {
2644
+ const o = {
2611
2645
  class: "td-saved-drawer",
2612
- name: Ee,
2646
+ name: ke,
2613
2647
  label: t.value
2614
2648
  };
2615
- return d(De, n, () => d(ns));
2649
+ return d(Te, o, () => d(ns));
2616
2650
  }
2617
2651
  return () => s();
2618
2652
  }
2619
- }), Ro = V({
2653
+ }), Vo = V({
2620
2654
  name: "TdLightsDrawer",
2621
2655
  setup(e, { slots: t, emit: s }) {
2622
- const { lang: n } = H(), r = C(() => {
2623
- var o;
2624
- return (o = n.value.td) == null ? void 0 : o.controls.lights.title;
2656
+ const { lang: o } = q(), n = C(() => {
2657
+ var r;
2658
+ return (r = o.value.td) == null ? void 0 : r.controls.lights.title;
2625
2659
  });
2626
2660
  function i() {
2627
- const o = {
2661
+ const r = {
2628
2662
  class: "td-lights-drawer",
2629
- name: de,
2630
- label: r.value
2663
+ name: fe,
2664
+ label: n.value
2631
2665
  };
2632
- return d(De, o, () => d(ss));
2666
+ return d(Te, r, () => d(ss));
2633
2667
  }
2634
2668
  return () => i();
2635
2669
  }
2636
- }), Vo = V({
2670
+ }), Fo = V({
2637
2671
  name: "TdLightsDrawer",
2638
2672
  setup(e, { slots: t, emit: s }) {
2639
- const { lang: n } = H(), r = C(() => {
2640
- var o;
2641
- return (o = n.value.td) == null ? void 0 : o.controls.colors.title;
2673
+ const { lang: o } = q(), n = C(() => {
2674
+ var r;
2675
+ return (r = o.value.td) == null ? void 0 : r.controls.colors.title;
2642
2676
  });
2643
2677
  function i() {
2644
- const o = {
2678
+ const r = {
2645
2679
  class: "td-colors-drawer",
2646
- name: oe,
2647
- label: r.value
2680
+ name: ne,
2681
+ label: n.value
2648
2682
  };
2649
- return d(De, o, () => d(es));
2683
+ return d(Te, r, () => d(es));
2650
2684
  }
2651
2685
  return () => i();
2652
2686
  }
2653
- }), Fo = V({
2687
+ }), _o = V({
2654
2688
  name: "TdSkinsDrawer",
2655
2689
  setup() {
2656
- const { lang: e } = H(), { expanded: t } = Z({
2657
- options: xe,
2658
- tab: xe
2690
+ const { lang: e } = q(), { expanded: t } = X({
2691
+ options: ee,
2692
+ tab: ee
2659
2693
  }), s = C(() => {
2660
- var r;
2661
- return (r = e.value.td) == null ? void 0 : r.controls.skins.title;
2694
+ var n;
2695
+ return (n = e.value.td) == null ? void 0 : n.controls.skins.title;
2662
2696
  });
2663
- function n() {
2664
- const r = {
2697
+ function o() {
2698
+ const n = {
2665
2699
  class: "td-skins-drawer",
2666
- name: xe,
2700
+ name: ee,
2667
2701
  label: s.value,
2668
2702
  modelValue: t.value,
2669
2703
  "onUpdate:modelValue": (i) => t.value = i
2670
2704
  };
2671
- return d(De, r, () => d(rs));
2705
+ return d(Te, n, () => d(rs));
2672
2706
  }
2673
- return () => n();
2707
+ return () => o();
2674
2708
  }
2675
- }), _o = V({
2709
+ }), jo = V({
2676
2710
  name: "TsDrawers",
2677
2711
  setup(e, { slots: t, emit: s }) {
2678
- const n = M(), r = C({
2679
- get: () => n.active,
2680
- set: (o) => n.setActive(o)
2712
+ const o = T(), n = C({
2713
+ get: () => o.active,
2714
+ set: (r) => o.setActive(r)
2681
2715
  });
2682
2716
  function i() {
2683
- const o = {
2684
- modelValue: r.value,
2685
- "onUpdate:modelValue": (c) => r.value = c
2717
+ const r = {
2718
+ modelValue: n.value,
2719
+ "onUpdate:modelValue": (c) => n.value = c
2686
2720
  };
2687
- return d(Ss, o, () => [
2688
- d(Bo),
2689
- d(Fo),
2690
- d(Ro),
2691
- d(Vo),
2721
+ return d(xs, r, () => [
2692
2722
  d(zo),
2723
+ d(_o),
2724
+ d(Vo),
2725
+ d(Fo),
2693
2726
  d(Po),
2694
- d(Lo)
2727
+ d(Lo),
2728
+ d(Ro)
2695
2729
  ]);
2696
2730
  }
2697
2731
  return () => i();
2698
2732
  }
2699
- }), Qo = /* @__PURE__ */ Object.assign({
2733
+ }), en = /* @__PURE__ */ Object.assign({
2700
2734
  name: "TdPage",
2701
2735
  slug: "td-page",
2702
2736
  inheritAttrs: !1
2703
2737
  }, {
2704
2738
  __name: "TdPage",
2705
- props: /* @__PURE__ */ vs({
2739
+ props: /* @__PURE__ */ bs({
2706
2740
  id: Number
2707
2741
  }, {
2708
2742
  miniState: { type: Boolean },
@@ -2710,36 +2744,36 @@ const wo = V({
2710
2744
  }),
2711
2745
  emits: ["update:miniState"],
2712
2746
  setup(e) {
2713
- const t = e, s = Symbol.for("activity-tracking"), n = M(), r = Ze(s, null), i = C(() => Number(t.id)), o = fs(e, "miniState"), c = (a) => {
2714
- a && (r == null || r.trackEvent(zs, {
2715
- glb_id: n.selected || null,
2747
+ const t = e, s = Symbol.for("activity-tracking"), o = T(), n = Ze(s, null), i = C(() => Number(t.id)), r = hs(e, "miniState"), c = (a) => {
2748
+ a && (n == null || n.trackEvent(Ps, {
2749
+ glb_id: o.selected || null,
2716
2750
  base_pose_id: a
2717
2751
  }));
2718
2752
  };
2719
2753
  return $t(async () => {
2720
- r && (await r.beginExplore(), r.trackEvent(Bs, { from: null, to: "3d" }), n.basePoseId && (r.beginSegment(String(n.basePoseId)), c(n.basePoseId)));
2721
- }), j(
2722
- () => n.basePoseId,
2754
+ n && (await n.beginExplore(), n.trackEvent(zs, { from: null, to: "3d" }), o.basePoseId && (n.beginSegment(String(o.basePoseId)), c(o.basePoseId)));
2755
+ }), G(
2756
+ () => o.basePoseId,
2723
2757
  (a, u) => {
2724
- !a || a === u || (r == null || r.beginSegment(String(a)), c(a));
2758
+ !a || a === u || (n == null || n.beginSegment(String(a)), c(a));
2725
2759
  }
2726
- ), hs(() => {
2727
- n.setActive(Ct.is.mobile ? lt : oe), r == null || r.end();
2728
- }), (a, u) => (at(), vt(bt(xs), {
2760
+ ), gs(() => {
2761
+ o.setActive(Ct.is.mobile ? lt : ne), n == null || n.end();
2762
+ }), (a, u) => (at(), vt(bt(ws), {
2729
2763
  class: "three-dimension-page",
2730
- miniState: o.value,
2731
- "onUpdate:miniState": u[0] || (u[0] = (p) => o.value = p),
2764
+ miniState: r.value,
2765
+ "onUpdate:miniState": u[0] || (u[0] = (p) => r.value = p),
2732
2766
  "no-drawer-padding": !0,
2733
2767
  title: "3D Viewer"
2734
2768
  }, {
2735
2769
  toolDrawer: yt(() => [
2736
- a.$q.platform.is.mobile ? wt("", !0) : (at(), vt(bt(Io), { key: 0 }))
2770
+ a.$q.platform.is.mobile ? wt("", !0) : (at(), vt(bt(ko), { key: 0 }))
2737
2771
  ]),
2738
2772
  bottomDrawer: yt(() => [
2739
- a.$q.platform.is.mobile ? (at(), vt(bt(_o), { key: 0 })) : wt("", !0)
2773
+ a.$q.platform.is.mobile ? (at(), vt(bt(jo), { key: 0 })) : wt("", !0)
2740
2774
  ]),
2741
2775
  default: yt(() => [
2742
- gs(po, { id: i.value }, null, 8, ["id"])
2776
+ vs(mo, { id: i.value }, null, 8, ["id"])
2743
2777
  ]),
2744
2778
  _: 1
2745
2779
  }, 8, ["miniState"]));
@@ -2785,7 +2819,7 @@ const wo = V({
2785
2819
  "#BDACA8",
2786
2820
  "#DACDC9",
2787
2821
  "#E5E4E3"
2788
- ], en = Ye("3d-fbxs", {
2822
+ ], tn = Ye("3d-fbxs", {
2789
2823
  state: () => ({
2790
2824
  models: {},
2791
2825
  loadingUrl: null,
@@ -2793,20 +2827,20 @@ const wo = V({
2793
2827
  }),
2794
2828
  getters: {
2795
2829
  changed(e) {
2796
- var n, r, i, o, c;
2797
- const s = M().selected;
2798
- return console.log("fbx model", (n = e.models) == null ? void 0 : n[s]), (i = (r = e.models) == null ? void 0 : r[s]) != null && i.color ? ((c = (o = e.models) == null ? void 0 : o[s]) == null ? void 0 : c.color) !== 16777215 : !1;
2830
+ var o, n, i, r, c;
2831
+ const s = T().selected;
2832
+ return console.log("fbx model", (o = e.models) == null ? void 0 : o[s]), (i = (n = e.models) == null ? void 0 : n[s]) != null && i.color ? ((c = (r = e.models) == null ? void 0 : r[s]) == null ? void 0 : c.color) !== 16777215 : !1;
2799
2833
  },
2800
2834
  selectedId() {
2801
- return M().selected;
2835
+ return T().selected;
2802
2836
  },
2803
2837
  poseId(e) {
2804
- var n, r;
2805
- const s = M().selected;
2806
- return (r = (n = e.models) == null ? void 0 : n[s]) == null ? void 0 : r.poseId;
2838
+ var o, n;
2839
+ const s = T().selected;
2840
+ return (n = (o = e.models) == null ? void 0 : o[s]) == null ? void 0 : n.poseId;
2807
2841
  },
2808
2842
  model(e) {
2809
- const s = M().selected;
2843
+ const s = T().selected;
2810
2844
  return s && e.models[s] ? e.models[s] : null;
2811
2845
  },
2812
2846
  url() {
@@ -2823,16 +2857,16 @@ const wo = V({
2823
2857
  },
2824
2858
  colorHex() {
2825
2859
  var e;
2826
- return (e = this.model) != null && e.color ? ue(this.model.color) : "#fefefe";
2860
+ return (e = this.model) != null && e.color ? me(this.model.color) : "#fefefe";
2827
2861
  }
2828
2862
  },
2829
2863
  actions: {
2830
2864
  resetColor() {
2831
- const t = M().selected;
2865
+ const t = T().selected;
2832
2866
  this.models[t].color = 16777215;
2833
2867
  },
2834
2868
  setBounds(e) {
2835
- const s = M().selected;
2869
+ const s = T().selected;
2836
2870
  this.models[s].bounds = Kt(e);
2837
2871
  },
2838
2872
  setSubjectsFromResponse(e) {
@@ -2840,20 +2874,20 @@ const wo = V({
2840
2874
  this.models = { ...this.models, ...t };
2841
2875
  },
2842
2876
  setColorHex(e) {
2843
- const s = M().selected;
2877
+ const s = T().selected;
2844
2878
  this.models[s].color = et(e);
2845
2879
  }
2846
2880
  }
2847
2881
  });
2848
2882
  export {
2849
- Qo as TdPage,
2850
- M as use3dStore,
2883
+ en as TdPage,
2884
+ T as use3dStore,
2851
2885
  Mt as useColorsStore,
2852
2886
  pt as useControlsStore,
2853
- en as useFBXStore,
2854
- fe as useGLBStore,
2855
- ke as useGridStore,
2887
+ tn as useFBXStore,
2888
+ ae as useGLBStore,
2889
+ ve as useGridStore,
2856
2890
  Fe as useGroundStore,
2857
- he as useLightsStore,
2891
+ ge as useLightsStore,
2858
2892
  mt as useSceneStore
2859
2893
  };