@tresjs/leches 0.3.0 → 0.4.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,65 +1,65 @@
1
1
  /**
2
2
  * name: @tresjs/leches
3
- * version: v0.3.0
3
+ * version: v0.4.0
4
4
  * (c) 2023
5
5
  * description: Tasty GUI for Vue controls 🍰
6
6
  * author: Alvaro Saburido <hola@alvarosaburido.dev> (https://github.com/alvarosabu/)
7
7
  */
8
- import { unref as T, getCurrentScope as ct, onScopeDispose as yt, toRef as _t, readonly as xt, customRef as pt, ref as g, defineComponent as v, computed as I, reactive as tt, h as dt, watch as A, isReactive as ft, toRefs as gt, onUnmounted as mt, isRef as V, openBlock as d, createElementBlock as b, createElementVNode as p, toDisplayString as C, normalizeClass as k, withDirectives as et, vShow as st, createTextVNode as bt, normalizeStyle as zt, Fragment as D, renderList as R, createCommentVNode as nt, createVNode as Mt, Transition as wt, withCtx as it, createBlock as w } from "vue";
9
- import { useStorage as vt, isClient as Ct, useDraggable as St, useMouse as Y, useFps as kt, useRafFn as $t, useWindowSize as It } from "@vueuse/core";
10
- function rt(r) {
11
- return ct() ? (yt(r), !0) : !1;
8
+ import { unref as j, getCurrentScope as ct, onScopeDispose as yt, toRef as _t, readonly as xt, customRef as pt, ref as m, defineComponent as C, computed as E, reactive as tt, h as dt, watch as I, provide as ft, isReactive as gt, toRefs as mt, onUnmounted as bt, isRef as V, openBlock as d, createElementBlock as g, createElementVNode as p, toDisplayString as v, normalizeClass as k, withDirectives as et, vShow as st, createTextVNode as zt, normalizeStyle as Mt, Fragment as P, renderList as L, createCommentVNode as nt, createVNode as wt, Transition as vt, withCtx as it, createBlock as w } from "vue";
9
+ import { useStorage as Ct, isClient as St, useDraggable as kt, useMouse as F, useFps as $t, useRafFn as Et, useWindowSize as Tt } from "@vueuse/core";
10
+ function ot(o) {
11
+ return ct() ? (yt(o), !0) : !1;
12
12
  }
13
- function q(r) {
14
- return typeof r == "function" ? r() : T(r);
13
+ function q(o) {
14
+ return typeof o == "function" ? o() : j(o);
15
15
  }
16
- const ot = typeof window < "u", ht = () => {
17
- }, Z = /* @__PURE__ */ At();
18
- function At() {
19
- var r;
20
- return ot && ((r = window == null ? void 0 : window.navigator) == null ? void 0 : r.userAgent) && /* @__PURE__ */ /iP(ad|hone|od)/.test(window.navigator.userAgent);
16
+ const rt = typeof window < "u", ht = () => {
17
+ }, N = /* @__PURE__ */ It();
18
+ function It() {
19
+ var o;
20
+ return rt && ((o = window == null ? void 0 : window.navigator) == null ? void 0 : o.userAgent) && /* @__PURE__ */ /iP(ad|hone|od)/.test(window.navigator.userAgent);
21
21
  }
22
- function Et(...r) {
23
- if (r.length !== 1)
24
- return _t(...r);
25
- const t = r[0];
26
- return typeof t == "function" ? xt(pt(() => ({ get: t, set: ht }))) : g(t);
22
+ function At(...o) {
23
+ if (o.length !== 1)
24
+ return _t(...o);
25
+ const t = o[0];
26
+ return typeof t == "function" ? xt(pt(() => ({ get: t, set: ht }))) : m(t);
27
27
  }
28
- function Tt(r) {
28
+ function jt(o) {
29
29
  var t;
30
- const e = q(r);
30
+ const e = q(o);
31
31
  return (t = e == null ? void 0 : e.$el) != null ? t : e;
32
32
  }
33
- const jt = ot ? window : void 0;
34
- function qt(...r) {
33
+ const qt = rt ? window : void 0;
34
+ function Pt(...o) {
35
35
  let t, e, s, n;
36
- if (typeof r[0] == "string" || Array.isArray(r[0]) ? ([e, s, n] = r, t = jt) : [t, e, s, n] = r, !t)
36
+ if (typeof o[0] == "string" || Array.isArray(o[0]) ? ([e, s, n] = o, t = qt) : [t, e, s, n] = o, !t)
37
37
  return ht;
38
38
  Array.isArray(e) || (e = [e]), Array.isArray(s) || (s = [s]);
39
- const i = [], h = () => {
40
- i.forEach((a) => a()), i.length = 0;
41
- }, l = (a, o, y, u) => (a.addEventListener(o, y, u), () => a.removeEventListener(o, y, u)), _ = A(
42
- () => [Tt(t), q(n)],
43
- ([a, o]) => {
44
- h(), a && i.push(
45
- ...e.flatMap((y) => s.map((u) => l(a, y, u, o)))
39
+ const i = [], a = () => {
40
+ i.forEach((h) => h()), i.length = 0;
41
+ }, l = (h, r, _, u) => (h.addEventListener(r, _, u), () => h.removeEventListener(r, _, u)), y = I(
42
+ () => [jt(t), q(n)],
43
+ ([h, r]) => {
44
+ a(), h && i.push(
45
+ ...e.flatMap((_) => s.map((u) => l(h, _, u, r)))
46
46
  );
47
47
  },
48
48
  { immediate: !0, flush: "post" }
49
49
  ), c = () => {
50
- _(), h();
50
+ y(), a();
51
51
  };
52
- return rt(c), c;
52
+ return ot(c), c;
53
53
  }
54
- var Pt = Object.defineProperty, Dt = Object.defineProperties, Vt = Object.getOwnPropertyDescriptors, B = Object.getOwnPropertySymbols, Lt = Object.prototype.hasOwnProperty, Xt = Object.prototype.propertyIsEnumerable, U = (r, t, e) => t in r ? Pt(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e, Ft = (r, t) => {
54
+ var Dt = Object.defineProperty, Lt = Object.defineProperties, Vt = Object.getOwnPropertyDescriptors, B = Object.getOwnPropertySymbols, Xt = Object.prototype.hasOwnProperty, Rt = Object.prototype.propertyIsEnumerable, U = (o, t, e) => t in o ? Dt(o, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[t] = e, Yt = (o, t) => {
55
55
  for (var e in t || (t = {}))
56
- Lt.call(t, e) && U(r, e, t[e]);
56
+ Xt.call(t, e) && U(o, e, t[e]);
57
57
  if (B)
58
58
  for (var e of B(t))
59
- Xt.call(t, e) && U(r, e, t[e]);
60
- return r;
61
- }, Rt = (r, t) => Dt(r, Vt(t));
62
- const Yt = /* @__PURE__ */ v({
59
+ Rt.call(t, e) && U(o, e, t[e]);
60
+ return o;
61
+ }, Ft = (o, t) => Lt(o, Vt(t));
62
+ const Ht = /* @__PURE__ */ C({
63
63
  name: "UseDraggable",
64
64
  props: [
65
65
  "storageKey",
@@ -71,100 +71,104 @@ const Yt = /* @__PURE__ */ v({
71
71
  "pointerTypes",
72
72
  "as",
73
73
  "handle",
74
- "axis"
74
+ "axis",
75
+ "onStart",
76
+ "onMove",
77
+ "onEnd"
75
78
  ],
76
- setup(r, { slots: t }) {
77
- const e = g(), s = I(() => {
78
- var _;
79
- return (_ = r.handle) != null ? _ : e.value;
80
- }), n = r.storageKey && vt(
81
- r.storageKey,
82
- q(r.initialValue) || { x: 0, y: 0 },
83
- Ct ? r.storageType === "session" ? sessionStorage : localStorage : void 0
84
- ), i = n || r.initialValue || { x: 0, y: 0 }, h = (_) => {
85
- n && (n.value.x = _.x, n.value.y = _.y);
86
- }, l = tt(St(e, Rt(Ft({}, r), {
79
+ setup(o, { slots: t }) {
80
+ const e = m(), s = E(() => {
81
+ var y;
82
+ return (y = o.handle) != null ? y : e.value;
83
+ }), n = o.storageKey && Ct(
84
+ o.storageKey,
85
+ q(o.initialValue) || { x: 0, y: 0 },
86
+ St ? o.storageType === "session" ? sessionStorage : localStorage : void 0
87
+ ), i = n || o.initialValue || { x: 0, y: 0 }, a = (y, c) => {
88
+ var h;
89
+ (h = o.onEnd) == null || h.call(o, y, c), n && (n.value.x = y.x, n.value.y = y.y);
90
+ }, l = tt(kt(e, Ft(Yt({}, o), {
87
91
  handle: s,
88
92
  initialValue: i,
89
- onEnd: h
93
+ onEnd: a
90
94
  })));
91
95
  return () => {
92
96
  if (t.default)
93
- return dt(r.as || "div", { ref: e, style: `touch-action:none;${l.style}` }, t.default(l));
97
+ return dt(o.as || "div", { ref: e, style: `touch-action:none;${l.style}` }, t.default(l));
94
98
  };
95
99
  }
96
100
  });
97
- function at(r) {
98
- const t = window.getComputedStyle(r);
99
- if (t.overflowX === "scroll" || t.overflowY === "scroll" || t.overflowX === "auto" && r.clientHeight < r.scrollHeight || t.overflowY === "auto" && r.clientWidth < r.scrollWidth)
101
+ function at(o) {
102
+ const t = window.getComputedStyle(o);
103
+ if (t.overflowX === "scroll" || t.overflowY === "scroll" || t.overflowX === "auto" && o.clientWidth < o.scrollWidth || t.overflowY === "auto" && o.clientHeight < o.scrollHeight)
100
104
  return !0;
101
105
  {
102
- const e = r.parentNode;
106
+ const e = o.parentNode;
103
107
  return !e || e.tagName === "BODY" ? !1 : at(e);
104
108
  }
105
109
  }
106
- function Nt(r) {
107
- const t = r || window.event, e = t.target;
110
+ function Qt(o) {
111
+ const t = o || window.event, e = t.target;
108
112
  return at(e) ? !1 : t.touches.length > 1 ? !0 : (t.preventDefault && t.preventDefault(), !1);
109
113
  }
110
- function Ht(r, t = !1) {
111
- const e = g(t);
114
+ function Wt(o, t = !1) {
115
+ const e = m(t);
112
116
  let s = null, n;
113
- A(Et(r), (l) => {
117
+ I(At(o), (l) => {
114
118
  if (l) {
115
- const _ = l;
116
- n = _.style.overflow, e.value && (_.style.overflow = "hidden");
119
+ const y = l;
120
+ n = y.style.overflow, e.value && (y.style.overflow = "hidden");
117
121
  }
118
122
  }, {
119
123
  immediate: !0
120
124
  });
121
125
  const i = () => {
122
- const l = q(r);
123
- !l || e.value || (Z && (s = qt(
126
+ const l = q(o);
127
+ !l || e.value || (N && (s = Pt(
124
128
  l,
125
129
  "touchmove",
126
- (_) => {
127
- Nt(_);
130
+ (y) => {
131
+ Qt(y);
128
132
  },
129
133
  { passive: !1 }
130
134
  )), l.style.overflow = "hidden", e.value = !0);
131
- }, h = () => {
132
- const l = q(r);
133
- !l || !e.value || (Z && (s == null || s()), l.style.overflow = n, e.value = !1);
135
+ }, a = () => {
136
+ const l = q(o);
137
+ !l || !e.value || (N && (s == null || s()), l.style.overflow = n, e.value = !1);
134
138
  };
135
- return rt(h), I({
139
+ return ot(a), E({
136
140
  get() {
137
141
  return e.value;
138
142
  },
139
143
  set(l) {
140
- l ? i() : h();
144
+ l ? i() : a();
141
145
  }
142
146
  });
143
147
  }
144
- function Qt() {
145
- let r = !1;
146
- const t = g(!1);
148
+ function Zt() {
149
+ let o = !1;
150
+ const t = m(!1);
147
151
  return (e, s) => {
148
- if (t.value = s.value, r)
152
+ if (t.value = s.value, o)
149
153
  return;
150
- r = !0;
151
- const n = Ht(e, s.value);
152
- A(t, (i) => n.value = i);
154
+ o = !0;
155
+ const n = Wt(e, s.value);
156
+ I(t, (i) => n.value = i);
153
157
  };
154
158
  }
155
- Qt();
159
+ Zt();
156
160
  /**
157
161
  * @license
158
162
  * Copyright 2010-2023 Three.js Authors
159
163
  * SPDX-License-Identifier: MIT
160
164
  */
161
- const lt = "152";
162
- function N(r, t, e) {
163
- return Math.max(t, Math.min(e, r));
165
+ const lt = "153";
166
+ function H(o, t, e) {
167
+ return Math.max(t, Math.min(e, o));
164
168
  }
165
- class H {
169
+ class Q {
166
170
  constructor(t = 0, e = 0) {
167
- H.prototype.isVector2 = !0, this.x = t, this.y = e;
171
+ Q.prototype.isVector2 = !0, this.x = t, this.y = e;
168
172
  }
169
173
  get width() {
170
174
  return this.x;
@@ -313,7 +317,7 @@ class H {
313
317
  if (e === 0)
314
318
  return Math.PI / 2;
315
319
  const s = this.dot(t) / e;
316
- return Math.acos(N(s, -1, 1));
320
+ return Math.acos(H(s, -1, 1));
317
321
  }
318
322
  distanceTo(t) {
319
323
  return Math.sqrt(this.distanceToSquared(t));
@@ -347,8 +351,8 @@ class H {
347
351
  return this.x = t.getX(e), this.y = t.getY(e), this;
348
352
  }
349
353
  rotateAround(t, e) {
350
- const s = Math.cos(e), n = Math.sin(e), i = this.x - t.x, h = this.y - t.y;
351
- return this.x = i * s - h * n + t.x, this.y = i * n + h * s + t.y, this;
354
+ const s = Math.cos(e), n = Math.sin(e), i = this.x - t.x, a = this.y - t.y;
355
+ return this.x = i * s - a * n + t.x, this.y = i * n + a * s + t.y, this;
352
356
  }
353
357
  random() {
354
358
  return this.x = Math.random(), this.y = Math.random(), this;
@@ -357,39 +361,39 @@ class H {
357
361
  yield this.x, yield this.y;
358
362
  }
359
363
  }
360
- class Wt {
364
+ class Nt {
361
365
  constructor(t = 0, e = 0, s = 0, n = 1) {
362
366
  this.isQuaternion = !0, this._x = t, this._y = e, this._z = s, this._w = n;
363
367
  }
364
- static slerpFlat(t, e, s, n, i, h, l) {
365
- let _ = s[n + 0], c = s[n + 1], a = s[n + 2], o = s[n + 3];
366
- const y = i[h + 0], u = i[h + 1], x = i[h + 2], m = i[h + 3];
368
+ static slerpFlat(t, e, s, n, i, a, l) {
369
+ let y = s[n + 0], c = s[n + 1], h = s[n + 2], r = s[n + 3];
370
+ const _ = i[a + 0], u = i[a + 1], x = i[a + 2], b = i[a + 3];
367
371
  if (l === 0) {
368
- t[e + 0] = _, t[e + 1] = c, t[e + 2] = a, t[e + 3] = o;
372
+ t[e + 0] = y, t[e + 1] = c, t[e + 2] = h, t[e + 3] = r;
369
373
  return;
370
374
  }
371
375
  if (l === 1) {
372
- t[e + 0] = y, t[e + 1] = u, t[e + 2] = x, t[e + 3] = m;
376
+ t[e + 0] = _, t[e + 1] = u, t[e + 2] = x, t[e + 3] = b;
373
377
  return;
374
378
  }
375
- if (o !== m || _ !== y || c !== u || a !== x) {
379
+ if (r !== b || y !== _ || c !== u || h !== x) {
376
380
  let z = 1 - l;
377
- const f = _ * y + c * u + a * x + o * m, M = f >= 0 ? 1 : -1, Q = 1 - f * f;
378
- if (Q > Number.EPSILON) {
379
- const S = Math.sqrt(Q), W = Math.atan2(S, f * M);
380
- z = Math.sin(z * W) / S, l = Math.sin(l * W) / S;
381
+ const f = y * _ + c * u + h * x + r * b, M = f >= 0 ? 1 : -1, W = 1 - f * f;
382
+ if (W > Number.EPSILON) {
383
+ const S = Math.sqrt(W), Z = Math.atan2(S, f * M);
384
+ z = Math.sin(z * Z) / S, l = Math.sin(l * Z) / S;
381
385
  }
382
- const P = l * M;
383
- if (_ = _ * z + y * P, c = c * z + u * P, a = a * z + x * P, o = o * z + m * P, z === 1 - l) {
384
- const S = 1 / Math.sqrt(_ * _ + c * c + a * a + o * o);
385
- _ *= S, c *= S, a *= S, o *= S;
386
+ const D = l * M;
387
+ if (y = y * z + _ * D, c = c * z + u * D, h = h * z + x * D, r = r * z + b * D, z === 1 - l) {
388
+ const S = 1 / Math.sqrt(y * y + c * c + h * h + r * r);
389
+ y *= S, c *= S, h *= S, r *= S;
386
390
  }
387
391
  }
388
- t[e] = _, t[e + 1] = c, t[e + 2] = a, t[e + 3] = o;
392
+ t[e] = y, t[e + 1] = c, t[e + 2] = h, t[e + 3] = r;
389
393
  }
390
- static multiplyQuaternionsFlat(t, e, s, n, i, h) {
391
- const l = s[n], _ = s[n + 1], c = s[n + 2], a = s[n + 3], o = i[h], y = i[h + 1], u = i[h + 2], x = i[h + 3];
392
- return t[e] = l * x + a * o + _ * u - c * y, t[e + 1] = _ * x + a * y + c * o - l * u, t[e + 2] = c * x + a * u + l * y - _ * o, t[e + 3] = a * x - l * o - _ * y - c * u, t;
394
+ static multiplyQuaternionsFlat(t, e, s, n, i, a) {
395
+ const l = s[n], y = s[n + 1], c = s[n + 2], h = s[n + 3], r = i[a], _ = i[a + 1], u = i[a + 2], x = i[a + 3];
396
+ return t[e] = l * x + h * r + y * u - c * _, t[e + 1] = y * x + h * _ + c * r - l * u, t[e + 2] = c * x + h * u + l * _ - y * r, t[e + 3] = h * x - l * r - y * _ - c * u, t;
393
397
  }
394
398
  get x() {
395
399
  return this._x;
@@ -425,28 +429,28 @@ class Wt {
425
429
  return this._x = t.x, this._y = t.y, this._z = t.z, this._w = t.w, this._onChangeCallback(), this;
426
430
  }
427
431
  setFromEuler(t, e) {
428
- const s = t._x, n = t._y, i = t._z, h = t._order, l = Math.cos, _ = Math.sin, c = l(s / 2), a = l(n / 2), o = l(i / 2), y = _(s / 2), u = _(n / 2), x = _(i / 2);
429
- switch (h) {
432
+ const s = t._x, n = t._y, i = t._z, a = t._order, l = Math.cos, y = Math.sin, c = l(s / 2), h = l(n / 2), r = l(i / 2), _ = y(s / 2), u = y(n / 2), x = y(i / 2);
433
+ switch (a) {
430
434
  case "XYZ":
431
- this._x = y * a * o + c * u * x, this._y = c * u * o - y * a * x, this._z = c * a * x + y * u * o, this._w = c * a * o - y * u * x;
435
+ this._x = _ * h * r + c * u * x, this._y = c * u * r - _ * h * x, this._z = c * h * x + _ * u * r, this._w = c * h * r - _ * u * x;
432
436
  break;
433
437
  case "YXZ":
434
- this._x = y * a * o + c * u * x, this._y = c * u * o - y * a * x, this._z = c * a * x - y * u * o, this._w = c * a * o + y * u * x;
438
+ this._x = _ * h * r + c * u * x, this._y = c * u * r - _ * h * x, this._z = c * h * x - _ * u * r, this._w = c * h * r + _ * u * x;
435
439
  break;
436
440
  case "ZXY":
437
- this._x = y * a * o - c * u * x, this._y = c * u * o + y * a * x, this._z = c * a * x + y * u * o, this._w = c * a * o - y * u * x;
441
+ this._x = _ * h * r - c * u * x, this._y = c * u * r + _ * h * x, this._z = c * h * x + _ * u * r, this._w = c * h * r - _ * u * x;
438
442
  break;
439
443
  case "ZYX":
440
- this._x = y * a * o - c * u * x, this._y = c * u * o + y * a * x, this._z = c * a * x - y * u * o, this._w = c * a * o + y * u * x;
444
+ this._x = _ * h * r - c * u * x, this._y = c * u * r + _ * h * x, this._z = c * h * x - _ * u * r, this._w = c * h * r + _ * u * x;
441
445
  break;
442
446
  case "YZX":
443
- this._x = y * a * o + c * u * x, this._y = c * u * o + y * a * x, this._z = c * a * x - y * u * o, this._w = c * a * o - y * u * x;
447
+ this._x = _ * h * r + c * u * x, this._y = c * u * r + _ * h * x, this._z = c * h * x - _ * u * r, this._w = c * h * r - _ * u * x;
444
448
  break;
445
449
  case "XZY":
446
- this._x = y * a * o - c * u * x, this._y = c * u * o - y * a * x, this._z = c * a * x + y * u * o, this._w = c * a * o + y * u * x;
450
+ this._x = _ * h * r - c * u * x, this._y = c * u * r - _ * h * x, this._z = c * h * x + _ * u * r, this._w = c * h * r + _ * u * x;
447
451
  break;
448
452
  default:
449
- console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: " + h);
453
+ console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: " + a);
450
454
  }
451
455
  return e !== !1 && this._onChangeCallback(), this;
452
456
  }
@@ -455,19 +459,19 @@ class Wt {
455
459
  return this._x = t.x * n, this._y = t.y * n, this._z = t.z * n, this._w = Math.cos(s), this._onChangeCallback(), this;
456
460
  }
457
461
  setFromRotationMatrix(t) {
458
- const e = t.elements, s = e[0], n = e[4], i = e[8], h = e[1], l = e[5], _ = e[9], c = e[2], a = e[6], o = e[10], y = s + l + o;
459
- if (y > 0) {
460
- const u = 0.5 / Math.sqrt(y + 1);
461
- this._w = 0.25 / u, this._x = (a - _) * u, this._y = (i - c) * u, this._z = (h - n) * u;
462
- } else if (s > l && s > o) {
463
- const u = 2 * Math.sqrt(1 + s - l - o);
464
- this._w = (a - _) / u, this._x = 0.25 * u, this._y = (n + h) / u, this._z = (i + c) / u;
465
- } else if (l > o) {
466
- const u = 2 * Math.sqrt(1 + l - s - o);
467
- this._w = (i - c) / u, this._x = (n + h) / u, this._y = 0.25 * u, this._z = (_ + a) / u;
462
+ const e = t.elements, s = e[0], n = e[4], i = e[8], a = e[1], l = e[5], y = e[9], c = e[2], h = e[6], r = e[10], _ = s + l + r;
463
+ if (_ > 0) {
464
+ const u = 0.5 / Math.sqrt(_ + 1);
465
+ this._w = 0.25 / u, this._x = (h - y) * u, this._y = (i - c) * u, this._z = (a - n) * u;
466
+ } else if (s > l && s > r) {
467
+ const u = 2 * Math.sqrt(1 + s - l - r);
468
+ this._w = (h - y) / u, this._x = 0.25 * u, this._y = (n + a) / u, this._z = (i + c) / u;
469
+ } else if (l > r) {
470
+ const u = 2 * Math.sqrt(1 + l - s - r);
471
+ this._w = (i - c) / u, this._x = (n + a) / u, this._y = 0.25 * u, this._z = (y + h) / u;
468
472
  } else {
469
- const u = 2 * Math.sqrt(1 + o - s - l);
470
- this._w = (h - n) / u, this._x = (i + c) / u, this._y = (_ + a) / u, this._z = 0.25 * u;
473
+ const u = 2 * Math.sqrt(1 + r - s - l);
474
+ this._w = (a - n) / u, this._x = (i + c) / u, this._y = (y + h) / u, this._z = 0.25 * u;
471
475
  }
472
476
  return this._onChangeCallback(), this;
473
477
  }
@@ -476,7 +480,7 @@ class Wt {
476
480
  return s < Number.EPSILON ? (s = 0, Math.abs(t.x) > Math.abs(t.z) ? (this._x = -t.y, this._y = t.x, this._z = 0, this._w = s) : (this._x = 0, this._y = -t.z, this._z = t.y, this._w = s)) : (this._x = t.y * e.z - t.z * e.y, this._y = t.z * e.x - t.x * e.z, this._z = t.x * e.y - t.y * e.x, this._w = s), this.normalize();
477
481
  }
478
482
  angleTo(t) {
479
- return 2 * Math.acos(Math.abs(N(this.dot(t), -1, 1)));
483
+ return 2 * Math.acos(Math.abs(H(this.dot(t), -1, 1)));
480
484
  }
481
485
  rotateTowards(t, e) {
482
486
  const s = this.angleTo(t);
@@ -514,25 +518,25 @@ class Wt {
514
518
  return this.multiplyQuaternions(t, this);
515
519
  }
516
520
  multiplyQuaternions(t, e) {
517
- const s = t._x, n = t._y, i = t._z, h = t._w, l = e._x, _ = e._y, c = e._z, a = e._w;
518
- return this._x = s * a + h * l + n * c - i * _, this._y = n * a + h * _ + i * l - s * c, this._z = i * a + h * c + s * _ - n * l, this._w = h * a - s * l - n * _ - i * c, this._onChangeCallback(), this;
521
+ const s = t._x, n = t._y, i = t._z, a = t._w, l = e._x, y = e._y, c = e._z, h = e._w;
522
+ return this._x = s * h + a * l + n * c - i * y, this._y = n * h + a * y + i * l - s * c, this._z = i * h + a * c + s * y - n * l, this._w = a * h - s * l - n * y - i * c, this._onChangeCallback(), this;
519
523
  }
520
524
  slerp(t, e) {
521
525
  if (e === 0)
522
526
  return this;
523
527
  if (e === 1)
524
528
  return this.copy(t);
525
- const s = this._x, n = this._y, i = this._z, h = this._w;
526
- let l = h * t._w + s * t._x + n * t._y + i * t._z;
529
+ const s = this._x, n = this._y, i = this._z, a = this._w;
530
+ let l = a * t._w + s * t._x + n * t._y + i * t._z;
527
531
  if (l < 0 ? (this._w = -t._w, this._x = -t._x, this._y = -t._y, this._z = -t._z, l = -l) : this.copy(t), l >= 1)
528
- return this._w = h, this._x = s, this._y = n, this._z = i, this;
529
- const _ = 1 - l * l;
530
- if (_ <= Number.EPSILON) {
532
+ return this._w = a, this._x = s, this._y = n, this._z = i, this;
533
+ const y = 1 - l * l;
534
+ if (y <= Number.EPSILON) {
531
535
  const u = 1 - e;
532
- return this._w = u * h + e * this._w, this._x = u * s + e * this._x, this._y = u * n + e * this._y, this._z = u * i + e * this._z, this.normalize(), this._onChangeCallback(), this;
536
+ return this._w = u * a + e * this._w, this._x = u * s + e * this._x, this._y = u * n + e * this._y, this._z = u * i + e * this._z, this.normalize(), this._onChangeCallback(), this;
533
537
  }
534
- const c = Math.sqrt(_), a = Math.atan2(c, l), o = Math.sin((1 - e) * a) / c, y = Math.sin(e * a) / c;
535
- return this._w = h * o + this._w * y, this._x = s * o + this._x * y, this._y = n * o + this._y * y, this._z = i * o + this._z * y, this._onChangeCallback(), this;
538
+ const c = Math.sqrt(y), h = Math.atan2(c, l), r = Math.sin((1 - e) * h) / c, _ = Math.sin(e * h) / c;
539
+ return this._w = a * r + this._w * _, this._x = s * r + this._x * _, this._y = n * r + this._y * _, this._z = i * r + this._z * _, this._onChangeCallback(), this;
536
540
  }
537
541
  slerpQuaternions(t, e, s) {
538
542
  return this.copy(t).slerp(e, s);
@@ -667,12 +671,12 @@ class $ {
667
671
  return this.applyMatrix3(t).normalize();
668
672
  }
669
673
  applyMatrix4(t) {
670
- const e = this.x, s = this.y, n = this.z, i = t.elements, h = 1 / (i[3] * e + i[7] * s + i[11] * n + i[15]);
671
- return this.x = (i[0] * e + i[4] * s + i[8] * n + i[12]) * h, this.y = (i[1] * e + i[5] * s + i[9] * n + i[13]) * h, this.z = (i[2] * e + i[6] * s + i[10] * n + i[14]) * h, this;
674
+ const e = this.x, s = this.y, n = this.z, i = t.elements, a = 1 / (i[3] * e + i[7] * s + i[11] * n + i[15]);
675
+ return this.x = (i[0] * e + i[4] * s + i[8] * n + i[12]) * a, this.y = (i[1] * e + i[5] * s + i[9] * n + i[13]) * a, this.z = (i[2] * e + i[6] * s + i[10] * n + i[14]) * a, this;
672
676
  }
673
677
  applyQuaternion(t) {
674
- const e = this.x, s = this.y, n = this.z, i = t.x, h = t.y, l = t.z, _ = t.w, c = _ * e + h * n - l * s, a = _ * s + l * e - i * n, o = _ * n + i * s - h * e, y = -i * e - h * s - l * n;
675
- return this.x = c * _ + y * -i + a * -l - o * -h, this.y = a * _ + y * -h + o * -i - c * -l, this.z = o * _ + y * -l + c * -h - a * -i, this;
678
+ const e = this.x, s = this.y, n = this.z, i = t.x, a = t.y, l = t.z, y = t.w, c = y * e + a * n - l * s, h = y * s + l * e - i * n, r = y * n + i * s - a * e, _ = -i * e - a * s - l * n;
679
+ return this.x = c * y + _ * -i + h * -l - r * -a, this.y = h * y + _ * -a + r * -i - c * -l, this.z = r * y + _ * -l + c * -a - h * -i, this;
676
680
  }
677
681
  project(t) {
678
682
  return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix);
@@ -750,8 +754,8 @@ class $ {
750
754
  return this.crossVectors(this, t);
751
755
  }
752
756
  crossVectors(t, e) {
753
- const s = t.x, n = t.y, i = t.z, h = e.x, l = e.y, _ = e.z;
754
- return this.x = n * _ - i * l, this.y = i * h - s * _, this.z = s * l - n * h, this;
757
+ const s = t.x, n = t.y, i = t.z, a = e.x, l = e.y, y = e.z;
758
+ return this.x = n * y - i * l, this.y = i * a - s * y, this.z = s * l - n * a, this;
755
759
  }
756
760
  projectOnVector(t) {
757
761
  const e = t.lengthSq();
@@ -761,17 +765,17 @@ class $ {
761
765
  return this.copy(t).multiplyScalar(s);
762
766
  }
763
767
  projectOnPlane(t) {
764
- return L.copy(this).projectOnVector(t), this.sub(L);
768
+ return X.copy(this).projectOnVector(t), this.sub(X);
765
769
  }
766
770
  reflect(t) {
767
- return this.sub(L.copy(t).multiplyScalar(2 * this.dot(t)));
771
+ return this.sub(X.copy(t).multiplyScalar(2 * this.dot(t)));
768
772
  }
769
773
  angleTo(t) {
770
774
  const e = Math.sqrt(this.lengthSq() * t.lengthSq());
771
775
  if (e === 0)
772
776
  return Math.PI / 2;
773
777
  const s = this.dot(t) / e;
774
- return Math.acos(N(s, -1, 1));
778
+ return Math.acos(H(s, -1, 1));
775
779
  }
776
780
  distanceTo(t) {
777
781
  return Math.sqrt(this.distanceToSquared(t));
@@ -839,19 +843,19 @@ class $ {
839
843
  yield this.x, yield this.y, yield this.z;
840
844
  }
841
845
  }
842
- const L = /* @__PURE__ */ new $(), K = /* @__PURE__ */ new Wt();
846
+ const X = /* @__PURE__ */ new $(), K = /* @__PURE__ */ new Nt();
843
847
  typeof __THREE_DEVTOOLS__ < "u" && __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register", { detail: {
844
848
  revision: lt
845
849
  } }));
846
850
  typeof window < "u" && (window.__THREE__ ? console.warn("WARNING: Multiple instances of Three.js being imported.") : window.__THREE__ = lt);
847
- const j = tt({
851
+ const Bt = Symbol("CONTROLS_CONTEXT_KEY"), T = tt({
848
852
  controls: []
849
853
  });
850
- function Zt() {
851
- return j;
854
+ function Ut() {
855
+ return ft(Bt, T), T;
852
856
  }
853
- function X(r) {
854
- return Object.entries(r).map(([t, e]) => {
857
+ function R(o) {
858
+ return Object.entries(o).map(([t, e]) => {
855
859
  let s = "string", n;
856
860
  const i = /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$|^0x([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;
857
861
  return !V(e) && e.value || V(e) ? (s = typeof e.value, n = e.value) : (s = typeof e, n = e), s === "number" && (e.step || e.max || e.min) && (s = "range"), s === "string" && i.test(n) && (s = "color"), (n instanceof $ || n instanceof $ || n instanceof Array) && (s = "vector"), !V(e) && e.value ? {
@@ -868,118 +872,128 @@ function X(r) {
868
872
  };
869
873
  });
870
874
  }
871
- function Bt() {
872
- j.controls = [];
875
+ function Kt() {
876
+ T.controls = [];
873
877
  }
874
- function He(r, t, e) {
878
+ function Ge(o, t, e) {
875
879
  let s = [];
876
- if (typeof r == "string")
877
- r === "fpsgraph" ? s.push({
880
+ if (typeof o == "string")
881
+ o === "fpsgraph" ? s.push({
878
882
  label: "fpsgraph",
879
883
  visible: !0,
880
884
  type: "fpsgraph"
881
885
  }) : s.push({
882
- label: r,
886
+ label: o,
883
887
  visible: !0,
884
888
  type: "folder",
885
- controls: X(t)
889
+ controls: R(t)
890
+ });
891
+ else if (typeof o == "object" && o.options)
892
+ s.push({
893
+ ...e,
894
+ label: o.label || "Dropdown",
895
+ visible: !0,
896
+ value: o.value,
897
+ type: "select",
898
+ ref: o,
899
+ options: o.options
886
900
  });
887
- else if (typeof r == "object" && typeof t == "string")
901
+ else if (typeof o == "object" && typeof t == "string")
888
902
  s.push({
889
903
  ...e,
890
904
  label: t,
891
905
  visible: !0,
892
- value: r[t],
893
- type: typeof r[t],
894
- ref: r
906
+ value: o[t],
907
+ type: typeof o[t],
908
+ ref: o
895
909
  });
896
- else if (ft(r)) {
897
- const n = gt(r);
898
- s = X(n);
910
+ else if (gt(o)) {
911
+ const n = mt(o);
912
+ s = R(n);
899
913
  } else
900
- s = X(r);
901
- return j.controls = [...j.controls, ...s], mt(Bt), { state: j, controls: s };
914
+ s = R(o);
915
+ return T.controls = [...T.controls, ...s], bt(Kt), { state: T, controls: s };
902
916
  }
903
- const Ut = { class: "flex px-4 justify-between gap-4 items-center mb-2" }, Kt = { class: "text-gray-500 w-1/3" }, Gt = ["value", "min", "max", "step"], Jt = /* @__PURE__ */ v({
917
+ const Gt = { class: "flex px-4 justify-between gap-4 items-center mb-2" }, Jt = { class: "text-gray-500 w-1/3" }, Ot = ["value", "min", "max", "step"], te = /* @__PURE__ */ C({
904
918
  __name: "NumberControl",
905
919
  props: {
906
920
  label: {},
907
921
  control: {}
908
922
  },
909
923
  emits: ["change"],
910
- setup(r, { emit: t }) {
911
- const e = r;
912
- function s(a) {
913
- const { target: o } = a;
914
- t("change", o.valueAsNumber);
924
+ setup(o, { emit: t }) {
925
+ const e = o;
926
+ function s(h) {
927
+ const { target: r } = h;
928
+ t("change", r.valueAsNumber);
915
929
  }
916
- const n = Y(), i = g(0), h = g(!1), l = (a) => {
917
- i.value = a.clientX, h.value = !0;
918
- }, _ = () => {
919
- h.value = !1;
920
- }, c = (a) => Math.floor(Math.abs(a) / 10);
921
- return A(n.x, (a) => {
922
- if (h.value) {
923
- const o = a - i.value, y = c(o);
924
- o > 0 ? t("change", e.control.value + 1 + y) : o < 0 && t("change", e.control.value - 1 + y), e.control.min !== void 0 && e.control.value < e.control.min && t("change", e.control.min), e.control.max !== void 0 && e.control.value > e.control.max && t("change", e.control.max), i.value = a;
930
+ const n = F(), i = m(0), a = m(!1), l = (h) => {
931
+ i.value = h.clientX, a.value = !0;
932
+ }, y = () => {
933
+ a.value = !1;
934
+ }, c = (h) => Math.floor(Math.abs(h) / 10);
935
+ return I(n.x, (h) => {
936
+ if (a.value) {
937
+ const r = h - i.value, _ = c(r);
938
+ r > 0 ? t("change", e.control.value + 1 + _) : r < 0 && t("change", e.control.value - 1 + _), e.control.min !== void 0 && e.control.value < e.control.min && t("change", e.control.min), e.control.max !== void 0 && e.control.value > e.control.max && t("change", e.control.max), i.value = h;
925
939
  }
926
- }), (a, o) => (d(), b("div", Ut, [
927
- p("label", Kt, C(a.label), 1),
940
+ }), (h, r) => (d(), g("div", Gt, [
941
+ p("label", Jt, v(h.label), 1),
928
942
  p("input", {
929
- value: a.control.value,
930
- class: k(["p-2 w-1/3 rounded text-right text-xs text-gray-400 bg-gray-100 focus:border-gray-200 outline-none border-none font-sans", { "cursor-ew-resize": h.value }]),
943
+ value: h.control.value,
944
+ class: k(["p-2 w-1/3 rounded text-right text-xs text-gray-400 bg-gray-100 focus:border-gray-200 outline-none border-none font-sans", { "cursor-ew-resize": a.value }]),
931
945
  type: "number",
932
- min: a.control.min,
933
- max: a.control.max,
934
- step: a.control.step,
946
+ min: h.control.min,
947
+ max: h.control.max,
948
+ step: h.control.step,
935
949
  onInput: s,
936
950
  onMousedown: l,
937
- onMouseup: _
938
- }, null, 42, Gt)
951
+ onMouseup: y
952
+ }, null, 42, Ot)
939
953
  ]));
940
954
  }
941
- }), Ot = { class: "flex px-4 justify-between gap-4 items-center mb-2 min-h-32px" }, te = { class: "text-gray-500 w-1/3" }, ee = ["value"], se = /* @__PURE__ */ v({
955
+ }), ee = { class: "flex px-4 justify-between gap-4 items-center mb-2 min-h-32px" }, se = { class: "text-gray-500 w-1/3" }, ne = ["value"], ie = /* @__PURE__ */ C({
942
956
  __name: "TextControl",
943
957
  props: {
944
958
  label: {},
945
959
  control: {}
946
960
  },
947
961
  emits: ["change"],
948
- setup(r, { emit: t }) {
962
+ setup(o, { emit: t }) {
949
963
  function e(s) {
950
964
  t("change", s);
951
965
  }
952
- return (s, n) => (d(), b("div", Ot, [
953
- p("label", te, C(s.label), 1),
966
+ return (s, n) => (d(), g("div", ee, [
967
+ p("label", se, v(s.label), 1),
954
968
  p("input", {
955
969
  value: s.control.value,
956
970
  type: "string",
957
971
  class: "p-2 w-2/3 rounded text-right text-xs text-gray-400 bg-gray-100 focus:border-gray-200 outline-none border-none font-sans",
958
972
  onChange: e
959
- }, null, 40, ee)
973
+ }, null, 40, ne)
960
974
  ]));
961
975
  }
962
- }), ne = { class: "flex px-4 justify-start gap-2 items-center mb-2 min-h-32px" }, ie = { class: "text-gray-500 w-1/3" }, re = ["id", "checked"], oe = ["for"], he = { class: "i-ic:baseline-check text-light" }, ae = /* @__PURE__ */ v({
976
+ }), oe = { class: "flex px-4 justify-start gap-2 items-center mb-2 min-h-32px" }, re = { class: "text-gray-500 w-1/3" }, he = ["id", "checked"], ae = ["for"], le = { class: "i-ic:baseline-check text-light" }, ue = /* @__PURE__ */ C({
963
977
  __name: "BooleanControl",
964
978
  props: {
965
979
  label: {},
966
980
  control: {}
967
981
  },
968
982
  emits: ["change"],
969
- setup(r, { emit: t }) {
983
+ setup(o, { emit: t }) {
970
984
  function e(s) {
971
985
  const { target: n } = s;
972
986
  t("change", n.checked);
973
987
  }
974
- return (s, n) => (d(), b("div", ne, [
975
- p("label", ie, C(s.label), 1),
988
+ return (s, n) => (d(), g("div", oe, [
989
+ p("label", re, v(s.label), 1),
976
990
  p("input", {
977
991
  id: s.control.label,
978
992
  checked: s.control.value,
979
993
  class: "hidden",
980
994
  type: "checkbox",
981
995
  onInput: e
982
- }, null, 40, re),
996
+ }, null, 40, he),
983
997
  p("label", {
984
998
  for: s.control.label,
985
999
  class: "inline-flex items-center cursor-pointer"
@@ -987,185 +1001,185 @@ const Ut = { class: "flex px-4 justify-between gap-4 items-center mb-2" }, Kt =
987
1001
  p("span", {
988
1002
  class: k([{ "bg-dark-500": s.control.value, "bg-gray-200": !s.control.value }, "w-4 h-4 flex justify-center items-center rounded border border-gray-300 mr-2 transition-colors duration-200"])
989
1003
  }, [
990
- et(p("i", he, null, 512), [
1004
+ et(p("i", le, null, 512), [
991
1005
  [st, s.control.value]
992
1006
  ])
993
1007
  ], 2)
994
- ], 8, oe)
1008
+ ], 8, ae)
995
1009
  ]));
996
1010
  }
997
- }), le = { class: "px-4 relative flex justify-between gap-4 items-center mb-2" }, ue = ["value", "min", "max", "step"], ce = ["value", "min", "max", "step"], ye = /* @__PURE__ */ v({
1011
+ }), ce = { class: "px-4 relative flex justify-between gap-4 items-center mb-2" }, ye = ["value", "min", "max", "step"], _e = ["value", "min", "max", "step"], xe = /* @__PURE__ */ C({
998
1012
  __name: "SliderControl",
999
1013
  props: {
1000
1014
  label: {},
1001
1015
  control: {}
1002
1016
  },
1003
1017
  emits: ["change"],
1004
- setup(r, { emit: t }) {
1005
- const e = r;
1006
- function s(o) {
1007
- const { target: y } = o;
1008
- t("change", y.valueAsNumber);
1018
+ setup(o, { emit: t }) {
1019
+ const e = o;
1020
+ function s(r) {
1021
+ const { target: _ } = r;
1022
+ t("change", _.valueAsNumber);
1009
1023
  }
1010
- const n = I(() => ({
1024
+ const n = E(() => ({
1011
1025
  backgroundImage: `linear-gradient(to right, #333 0% ${100 * (e.control.value - (e.control.min || 0)) / ((e.control.max || 100) - (e.control.min || 0))}%, #e2e2e2 0%)`
1012
- })), i = Y(), h = g(0), l = g(!1), _ = (o) => {
1013
- h.value = o.clientX, l.value = !0;
1026
+ })), i = F(), a = m(0), l = m(!1), y = (r) => {
1027
+ a.value = r.clientX, l.value = !0;
1014
1028
  }, c = () => {
1015
1029
  l.value = !1;
1016
- }, a = (o) => Math.floor(Math.abs(o) / 10);
1017
- return A(i.x, (o) => {
1030
+ }, h = (r) => Math.floor(Math.abs(r) / 10);
1031
+ return I(i.x, (r) => {
1018
1032
  if (l.value) {
1019
- const y = o - h.value, u = a(y);
1020
- y > 0 ? t("change", e.control.value + 1 + u) : y < 0 && t("change", e.control.value - 1 + u), e.control.min !== void 0 && e.control.value < e.control.min && t("change", e.control.min), e.control.max !== void 0 && e.control.value > e.control.max && t("change", e.control.max), h.value = o;
1033
+ const _ = r - a.value, u = h(_);
1034
+ _ > 0 ? t("change", e.control.value + 1 + u) : _ < 0 && t("change", e.control.value - 1 + u), e.control.min !== void 0 && e.control.value < e.control.min && t("change", e.control.min), e.control.max !== void 0 && e.control.value > e.control.max && t("change", e.control.max), a.value = r;
1021
1035
  }
1022
- }), (o, y) => (d(), b("div", le, [
1036
+ }), (r, _) => (d(), g("div", ce, [
1023
1037
  p("label", {
1024
- class: k(["text-gray-500 w-1/3", { "flex justify-between items-center": o.control.icon }])
1038
+ class: k(["text-gray-500 w-1/3", { "flex justify-between items-center": r.control.icon }])
1025
1039
  }, [
1026
- bt(C(o.label) + " ", 1),
1040
+ zt(v(r.label) + " ", 1),
1027
1041
  p("i", {
1028
- class: k(`i-${o.control.icon}`)
1042
+ class: k(`i-${r.control.icon}`)
1029
1043
  }, null, 2)
1030
1044
  ], 2),
1031
1045
  p("input", {
1032
- value: o.control.value,
1046
+ value: r.control.value,
1033
1047
  class: "w-1/2 h-0.75 bg-dark-200 rounded-full appearance-none",
1034
- style: zt(n.value),
1048
+ style: Mt(n.value),
1035
1049
  type: "range",
1036
- min: o.control.min,
1037
- max: o.control.max,
1038
- step: o.control.step,
1050
+ min: r.control.min,
1051
+ max: r.control.max,
1052
+ step: r.control.step,
1039
1053
  onInput: s
1040
- }, null, 44, ue),
1054
+ }, null, 44, ye),
1041
1055
  p("input", {
1042
- value: o.control.value,
1056
+ value: r.control.value,
1043
1057
  class: k(["p-2 w-1/4 rounded text-right text-xs text-gray-400 bg-gray-100 focus:border-gray-200 outline-none border-none font-sans", { "cursor-ew-resize": l.value }]),
1044
1058
  type: "number",
1045
- min: o.control.min,
1046
- max: o.control.max,
1047
- step: o.control.step,
1059
+ min: r.control.min,
1060
+ max: r.control.max,
1061
+ step: r.control.step,
1048
1062
  onInput: s,
1049
- onMousedown: _,
1063
+ onMousedown: y,
1050
1064
  onMouseup: c
1051
- }, null, 42, ce)
1065
+ }, null, 42, _e)
1052
1066
  ]));
1053
1067
  }
1054
1068
  });
1055
- const _e = (r, t) => {
1056
- const e = r.__vccOpts || r;
1069
+ const pe = (o, t) => {
1070
+ const e = o.__vccOpts || o;
1057
1071
  for (const [s, n] of t)
1058
1072
  e[s] = n;
1059
1073
  return e;
1060
- }, xe = /* @__PURE__ */ _e(ye, [["__scopeId", "data-v-743fd350"]]), pe = { class: "flex px-4 justify-between gap-4 items-center mb-2" }, de = { class: "text-gray-500 w-1/3" }, fe = ["value"], ge = ["value"], me = /* @__PURE__ */ v({
1074
+ }, de = /* @__PURE__ */ pe(xe, [["__scopeId", "data-v-743fd350"]]), fe = { class: "flex px-4 justify-between gap-4 items-center mb-2" }, ge = { class: "text-gray-500 w-1/3" }, me = ["value"], be = ["value"], ze = /* @__PURE__ */ C({
1061
1075
  __name: "ColorControl",
1062
1076
  props: {
1063
1077
  label: {},
1064
1078
  control: {}
1065
1079
  },
1066
1080
  emits: ["change"],
1067
- setup(r, { emit: t }) {
1081
+ setup(o, { emit: t }) {
1068
1082
  function e(s) {
1069
1083
  const { target: n } = s;
1070
1084
  t("change", n.value);
1071
1085
  }
1072
- return (s, n) => (d(), b("div", pe, [
1073
- p("label", de, C(s.label), 1),
1086
+ return (s, n) => (d(), g("div", fe, [
1087
+ p("label", ge, v(s.label), 1),
1074
1088
  p("input", {
1075
1089
  value: s.control.value,
1076
1090
  type: "color",
1077
1091
  onInput: e
1078
- }, null, 40, fe),
1092
+ }, null, 40, me),
1079
1093
  p("input", {
1080
1094
  value: s.control.value,
1081
1095
  class: "p-2 w-2/3 rounded text-right text-xs text-gray-400 bg-gray-100 focus:border-gray-200 outline-none border-none font-sans",
1082
1096
  type: "text",
1083
1097
  onInput: e
1084
- }, null, 40, ge)
1098
+ }, null, 40, be)
1085
1099
  ]));
1086
1100
  }
1087
1101
  });
1088
- function be(r) {
1089
- return typeof r == "number" ? [r, r, r] : r instanceof $ ? [r.x, r.y, r.z] : r;
1102
+ function Me(o) {
1103
+ return typeof o == "number" ? [o, o, o] : o instanceof $ ? [o.x, o.y, o.z] : o;
1090
1104
  }
1091
- const ze = { class: "flex px-4 justify-between gap-2 items-center mb-2" }, Me = { class: "text-gray-500 w-1/3" }, we = { class: "w-2/3 flex justify-between gap-1" }, ve = {
1105
+ const we = { class: "flex px-4 justify-between gap-2 items-center mb-2" }, ve = { class: "text-gray-500 w-1/3" }, Ce = { class: "w-2/3 flex justify-between gap-1" }, Se = {
1092
1106
  key: 0,
1093
1107
  class: "font-bold px-0.5 py-1 text-0.65rem text-gray-300"
1094
- }, Ce = ["value", "onInput", "onMousedown", "onMouseup"], Se = /* @__PURE__ */ v({
1108
+ }, ke = ["value", "onInput", "onMousedown", "onMouseup"], $e = /* @__PURE__ */ C({
1095
1109
  __name: "VectorControl",
1096
1110
  props: {
1097
1111
  label: {},
1098
1112
  control: {}
1099
1113
  },
1100
1114
  emits: ["change"],
1101
- setup(r, { emit: t }) {
1102
- const e = r, s = Y(), n = g(0), i = g(!1), h = g(0), l = (x, m) => {
1103
- h.value = m, n.value = x.clientX, i.value = !0;
1104
- }, _ = (x, m) => {
1105
- h.value = m, i.value = !1;
1106
- }, c = (x) => Math.floor(Math.abs(x) / 10), a = I(() => be(e.control.value)), o = I(() => Object.keys(e.control.value)), y = I(() => e.control.value instanceof H || e.control.value instanceof $);
1107
- function u(x, m) {
1115
+ setup(o, { emit: t }) {
1116
+ const e = o, s = F(), n = m(0), i = m(!1), a = m(0), l = (x, b) => {
1117
+ a.value = b, n.value = x.clientX, i.value = !0;
1118
+ }, y = (x, b) => {
1119
+ a.value = b, i.value = !1;
1120
+ }, c = (x) => Math.floor(Math.abs(x) / 10), h = E(() => Me(e.control.value)), r = E(() => Object.keys(e.control.value)), _ = E(() => e.control.value instanceof Q || e.control.value instanceof $);
1121
+ function u(x, b) {
1108
1122
  const { value: z } = e.control, { target: f } = x;
1109
- h.value = m, z[y.value ? o.value[h.value] : h.value] = parseInt(f.value, 10), t("change", z);
1123
+ a.value = b, z[_.value ? r.value[a.value] : a.value] = parseInt(f.value, 10), t("change", z);
1110
1124
  }
1111
- return A(s.x, (x) => {
1125
+ return I(s.x, (x) => {
1112
1126
  if (i.value) {
1113
- const m = x - n.value, z = c(m), { value: f } = e.control, M = y.value ? o.value[h.value] : h.value;
1114
- m > 0 ? f[M] += 1 + z : m < 0 && (f[M] -= 1 + z), e.control.min !== void 0 && f < e.control.min && (f[M] = e.control.min), e.control.max !== void 0 && f > e.control.max && (f[M] = e.control.max), t("change", f), n.value = x;
1127
+ const b = x - n.value, z = c(b), { value: f } = e.control, M = _.value ? r.value[a.value] : a.value;
1128
+ b > 0 ? f[M] += 1 + z : b < 0 && (f[M] -= 1 + z), e.control.min !== void 0 && f < e.control.min && (f[M] = e.control.min), e.control.max !== void 0 && f > e.control.max && (f[M] = e.control.max), t("change", f), n.value = x;
1115
1129
  }
1116
- }), (x, m) => (d(), b("div", ze, [
1117
- p("label", Me, C(x.label), 1),
1118
- p("div", we, [
1119
- (d(!0), b(D, null, R(a.value, (z, f) => (d(), b("div", {
1130
+ }), (x, b) => (d(), g("div", we, [
1131
+ p("label", ve, v(x.label), 1),
1132
+ p("div", Ce, [
1133
+ (d(!0), g(P, null, L(h.value, (z, f) => (d(), g("div", {
1120
1134
  key: x.label + f,
1121
1135
  class: "flex items-center w-1/3 bg-gray-100 rounded"
1122
1136
  }, [
1123
- o.value[f] && y.value ? (d(), b("span", ve, C(o.value[f]), 1)) : nt("", !0),
1137
+ r.value[f] && _.value ? (d(), g("span", Se, v(r.value[f]), 1)) : nt("", !0),
1124
1138
  p("input", {
1125
1139
  type: "text",
1126
1140
  class: k(["w-full pl-0 p-1 text-right text-0.65rem text-gray-400 bg-transparent focus:border-gray-200 outline-none border-none font-sans", { "cursor-ew-resize": i.value }]),
1127
- value: a.value[f].toFixed(2),
1141
+ value: h.value[f].toFixed(2),
1128
1142
  onInput: (M) => u(M, f),
1129
1143
  onMousedown: (M) => l(M, f),
1130
- onMouseup: (M) => _(M, f)
1131
- }, null, 42, Ce)
1144
+ onMouseup: (M) => y(M, f)
1145
+ }, null, 42, ke)
1132
1146
  ]))), 128))
1133
1147
  ])
1134
1148
  ]));
1135
1149
  }
1136
- }), ke = { class: "mb-4" }, $e = { class: "bg-white rounded-b pt-4" }, Ie = /* @__PURE__ */ v({
1150
+ }), Ee = { class: "mb-4" }, Te = { class: "bg-white rounded-b pt-4" }, Ie = /* @__PURE__ */ C({
1137
1151
  __name: "Folder",
1138
1152
  props: {
1139
1153
  control: {}
1140
1154
  },
1141
- setup(r) {
1155
+ setup(o) {
1142
1156
  function t(n, i) {
1143
1157
  i.value = n;
1144
1158
  }
1145
- const e = g(!1), s = () => {
1159
+ const e = m(!1), s = () => {
1146
1160
  e.value = !e.value;
1147
1161
  };
1148
- return (n, i) => (d(), b("div", ke, [
1162
+ return (n, i) => (d(), g("div", Ee, [
1149
1163
  p("button", {
1150
1164
  class: "flex items-center justify-between w-full p-4 bg-gray-100 border-none text-gray-400 font-bold text-xs focus:outline-none font-sans cursor-pointer",
1151
1165
  onClick: s
1152
1166
  }, [
1153
- p("span", null, C(n.control.label), 1),
1167
+ p("span", null, v(n.control.label), 1),
1154
1168
  p("i", {
1155
1169
  class: k(e.value ? "i-ic:baseline-keyboard-arrow-up" : "i-ic:baseline-keyboard-arrow-down")
1156
1170
  }, null, 2)
1157
1171
  ]),
1158
- Mt(wt, {
1172
+ wt(vt, {
1159
1173
  name: "slide",
1160
1174
  "enter-active-class": " animate-fade-in animate-duration-200 animate-ease-in-out",
1161
1175
  "leave-active-class": " animate-fade-out animate-duration-200 animate-ease-in-out"
1162
1176
  }, {
1163
1177
  default: it(() => [
1164
- et(p("div", $e, [
1165
- (d(!0), b(D, null, R(n.control.controls, (h) => (d(), w(ut, {
1166
- key: h.label,
1167
- control: h,
1168
- onChange: (l) => t(l, h)
1178
+ et(p("div", Te, [
1179
+ (d(!0), g(P, null, L(n.control.controls, (a) => (d(), w(ut, {
1180
+ key: a.label,
1181
+ control: a,
1182
+ onChange: (l) => t(l, a)
1169
1183
  }, null, 8, ["control", "onChange"]))), 128))
1170
1184
  ], 512), [
1171
1185
  [st, e.value]
@@ -1175,26 +1189,26 @@ const ze = { class: "flex px-4 justify-between gap-2 items-center mb-2" }, Me =
1175
1189
  })
1176
1190
  ]));
1177
1191
  }
1178
- }), Ae = { class: "flex px-4 justify-between gap-4 items-center mb-2" }, Ee = { class: "text-gray-500 w-1/3" }, Te = { class: "relative w-2/3 p-1 rounded text-right text-xs text-gray-400 bg-gray-100 focus:border-gray-200 outline-none border-none font-sans" }, je = { class: "absolute bottom-0.5 right-0.5 font-sans text-xs" }, qe = ["points"], G = 160, F = 40, E = 2, J = 100, O = 20, Pe = /* @__PURE__ */ v({
1192
+ }), Ae = { class: "flex px-4 justify-between gap-4 items-center mb-2" }, je = { class: "text-gray-500 w-1/3" }, qe = { class: "relative w-2/3 p-1 rounded text-right text-xs text-gray-400 bg-gray-100 focus:border-gray-200 outline-none border-none font-sans" }, Pe = { class: "absolute bottom-0.5 right-0.5 font-sans text-xs" }, De = ["points"], G = 160, Y = 40, A = 2, J = 100, O = 20, Le = /* @__PURE__ */ C({
1179
1193
  __name: "FPSGraph",
1180
1194
  props: {
1181
1195
  label: {},
1182
1196
  control: {}
1183
1197
  },
1184
- setup(r) {
1185
- const t = kt({ every: J }), e = g(""), s = g([]), n = g(G / E);
1198
+ setup(o) {
1199
+ const t = $t({ every: J }), e = m(""), s = m([]), n = m(G / A);
1186
1200
  let i = performance.now();
1187
- return $t(({ timestamp: h }) => {
1188
- h - i >= J && (i = h, s.value.push(t.value), s.value.length > n.value && s.value.shift(), e.value = s.value.map(
1189
- (l, _) => `${_ * E},${F + O - E / 2 - l * (F + O - E) / 120}`
1201
+ return Et(({ timestamp: a }) => {
1202
+ a - i >= J && (i = a, s.value.push(t.value), s.value.length > n.value && s.value.shift(), e.value = s.value.map(
1203
+ (l, y) => `${y * A},${Y + O - A / 2 - l * (Y + O - A) / 120}`
1190
1204
  ).join(" "));
1191
- }), (h, l) => (d(), b("div", Ae, [
1192
- p("label", Ee, C(h.label), 1),
1193
- p("div", Te, [
1194
- p("div", je, C(Math.round(T(t))) + " FPS", 1),
1195
- (d(), b("svg", {
1205
+ }), (a, l) => (d(), g("div", Ae, [
1206
+ p("label", je, v(a.label), 1),
1207
+ p("div", qe, [
1208
+ p("div", Pe, v(Math.round(j(t))) + " FPS", 1),
1209
+ (d(), g("svg", {
1196
1210
  width: G,
1197
- height: F,
1211
+ height: Y,
1198
1212
  xmlns: "http://www.w3.org/2000/svg",
1199
1213
  class: "bg-gray-100"
1200
1214
  }, [
@@ -1202,41 +1216,66 @@ const ze = { class: "flex px-4 justify-between gap-2 items-center mb-2" }, Me =
1202
1216
  points: e.value,
1203
1217
  fill: "none",
1204
1218
  stroke: "lightgray",
1205
- "stroke-width": E,
1219
+ "stroke-width": A,
1206
1220
  "stroke-linecap": "round",
1207
1221
  "stroke-linejoin": "round"
1208
- }, null, 8, qe)
1222
+ }, null, 8, De)
1209
1223
  ]))
1210
1224
  ])
1211
1225
  ]));
1212
1226
  }
1213
- }), ut = /* @__PURE__ */ v({
1227
+ }), Ve = { class: "flex px-4 justify-between gap-4 items-center mb-2 min-h-32px" }, Xe = { class: "text-gray-500 w-1/3" }, Re = ["value"], Ye = ["value"], Fe = /* @__PURE__ */ C({
1228
+ __name: "SelectControl",
1229
+ props: {
1230
+ label: {},
1231
+ control: {}
1232
+ },
1233
+ emits: ["change"],
1234
+ setup(o, { emit: t }) {
1235
+ function e(s) {
1236
+ t("change", s.target.value);
1237
+ }
1238
+ return (s, n) => (d(), g("div", Ve, [
1239
+ p("label", Xe, v(s.label), 1),
1240
+ p("select", {
1241
+ value: s.control.value,
1242
+ class: "p-2 w-2/3 rounded text-left text-xs text-gray-400 bg-gray-100 focus:border-gray-200 outline-none border-none font-sans",
1243
+ onChange: e
1244
+ }, [
1245
+ (d(!0), g(P, null, L(s.control.options, (i) => (d(), g("option", {
1246
+ key: i.value,
1247
+ value: i.value
1248
+ }, v(i.text), 9, Ye))), 128))
1249
+ ], 40, Re)
1250
+ ]));
1251
+ }
1252
+ }), ut = /* @__PURE__ */ C({
1214
1253
  __name: "ControlInput",
1215
1254
  props: {
1216
1255
  control: {}
1217
1256
  },
1218
1257
  emits: ["change"],
1219
- setup(r, { emit: t }) {
1258
+ setup(o, { emit: t }) {
1220
1259
  function e(s) {
1221
1260
  t("change", s);
1222
1261
  }
1223
- return (s, n) => s.control.visible ? (d(), b(D, { key: 0 }, [
1224
- s.control.type === "color" ? (d(), w(me, {
1262
+ return (s, n) => s.control.visible ? (d(), g(P, { key: 0 }, [
1263
+ s.control.type === "color" ? (d(), w(ze, {
1225
1264
  key: 0,
1226
1265
  label: s.control.label,
1227
1266
  control: s.control,
1228
1267
  onChange: e
1229
- }, null, 8, ["label", "control"])) : s.control.type === "vector" ? (d(), w(Se, {
1268
+ }, null, 8, ["label", "control"])) : s.control.type === "vector" ? (d(), w($e, {
1230
1269
  key: 1,
1231
1270
  label: s.control.label,
1232
1271
  control: s.control,
1233
1272
  onChange: e
1234
- }, null, 8, ["label", "control"])) : s.control.type === "boolean" ? (d(), w(ae, {
1273
+ }, null, 8, ["label", "control"])) : s.control.type === "boolean" ? (d(), w(ue, {
1235
1274
  key: 2,
1236
1275
  label: s.control.label,
1237
1276
  control: s.control,
1238
1277
  onChange: e
1239
- }, null, 8, ["label", "control"])) : s.control.type === "fpsgraph" ? (d(), w(Pe, {
1278
+ }, null, 8, ["label", "control"])) : s.control.type === "fpsgraph" ? (d(), w(Le, {
1240
1279
  key: 3,
1241
1280
  label: s.control.label,
1242
1281
  control: s.control
@@ -1244,55 +1283,60 @@ const ze = { class: "flex px-4 justify-between gap-2 items-center mb-2" }, Me =
1244
1283
  key: 4,
1245
1284
  label: s.control.label,
1246
1285
  control: s.control
1247
- }, null, 8, ["label", "control"])) : s.control.type === "number" ? (d(), w(Jt, {
1286
+ }, null, 8, ["label", "control"])) : s.control.type === "number" ? (d(), w(te, {
1248
1287
  key: 5,
1249
1288
  label: s.control.label,
1250
1289
  control: s.control,
1251
1290
  onChange: e
1252
- }, null, 8, ["label", "control"])) : s.control.type === "range" ? (d(), w(xe, {
1291
+ }, null, 8, ["label", "control"])) : s.control.type === "range" ? (d(), w(de, {
1253
1292
  key: 6,
1254
1293
  label: s.control.label,
1255
1294
  control: s.control,
1256
1295
  onChange: e
1257
- }, null, 8, ["label", "control"])) : (d(), w(se, {
1296
+ }, null, 8, ["label", "control"])) : s.control.type === "select" ? (d(), w(Fe, {
1258
1297
  key: 7,
1259
1298
  label: s.control.label,
1260
1299
  control: s.control,
1261
1300
  onChange: e
1301
+ }, null, 8, ["label", "control"])) : (d(), w(ie, {
1302
+ key: 8,
1303
+ label: s.control.label,
1304
+ control: s.control,
1305
+ onChange: e
1262
1306
  }, null, 8, ["label", "control"]))
1263
1307
  ], 64)) : nt("", !0);
1264
1308
  }
1265
- }), De = { class: "bg-white shadow-xl rounded border-4 border-solid border-black" }, Ve = /* @__PURE__ */ p("i", { class: "h-4 w-4 p-1.5 flex items-center line-height-0 rounded-full bg-gray-100 text-xs" }, "🍰", -1), Le = /* @__PURE__ */ p("div", null, [
1309
+ }), He = { class: "bg-white shadow-xl rounded border-4 border-solid border-black" }, Qe = /* @__PURE__ */ p("i", { class: "h-4 w-4 p-1.5 flex items-center line-height-0 rounded-full bg-gray-100 text-xs" }, "🍰", -1), We = /* @__PURE__ */ p("div", null, [
1266
1310
  /* @__PURE__ */ p("i", { class: "i-ic-baseline-drag-indicator" }),
1267
1311
  /* @__PURE__ */ p("i", { class: "i-ic-baseline-drag-indicator" }),
1268
1312
  /* @__PURE__ */ p("i", { class: "i-ic-baseline-drag-indicator" })
1269
- ], -1), Xe = /* @__PURE__ */ p("div", null, null, -1), Fe = [
1270
- Ve,
1271
- Le,
1272
- Xe
1273
- ], Re = 280, Qe = /* @__PURE__ */ v({
1313
+ ], -1), Ze = /* @__PURE__ */ p("div", null, null, -1), Ne = [
1314
+ Qe,
1315
+ We,
1316
+ Ze
1317
+ ], Be = 280, Je = /* @__PURE__ */ C({
1274
1318
  __name: "TresLeches",
1275
- setup(r) {
1276
- const { width: t } = It(), e = g(null), s = Zt();
1277
- function n(i, h) {
1278
- h.ref && (h.ref[h.label] = i), h.value = i;
1319
+ setup(o) {
1320
+ const { width: t } = Tt(), e = m(null), s = Ut();
1321
+ function n(i, a) {
1322
+ a.ref && (a.ref[a.label] = i), a.value = i;
1279
1323
  }
1280
- return (i, h) => (d(), w(T(Yt), {
1281
- "initial-value": { x: T(t) - Re - 20, y: 10 },
1324
+ return (i, a) => (d(), w(j(Ht), {
1325
+ "initial-value": { x: j(t) - Be - 20, y: 10 },
1282
1326
  class: "fixed select-none z-24 w-280px font-sans text-xs",
1283
1327
  handle: e.value
1284
1328
  }, {
1285
1329
  default: it(() => [
1286
- p("div", De, [
1330
+ p("div", He, [
1287
1331
  p("header", {
1288
1332
  ref_key: "handle",
1289
1333
  ref: e,
1290
1334
  class: "relative cursor-grabbing p-4 flex justify-between text-gray-200 relative"
1291
- }, Fe, 512),
1292
- (d(!0), b(D, null, R(T(s).controls, (l) => (d(), w(ut, {
1335
+ }, Ne, 512),
1336
+ (d(!0), g(P, null, L(j(s).controls, (l) => (d(), w(ut, {
1293
1337
  key: l.label,
1294
1338
  control: l,
1295
- onChange: (_) => n(_, l)
1339
+ onChange: (y) => n(y, l)
1296
1340
  }, null, 8, ["control", "onChange"]))), 128))
1297
1341
  ])
1298
1342
  ]),
@@ -1301,6 +1345,6 @@ const ze = { class: "flex px-4 justify-between gap-2 items-center mb-2" }, Me =
1301
1345
  }
1302
1346
  });
1303
1347
  export {
1304
- Qe as TresLeches,
1305
- He as useControls
1348
+ Je as TresLeches,
1349
+ Ge as useControls
1306
1350
  };