@tresjs/leches 0.3.1 → 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.1
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 E, reactive as tt, h as dt, watch as I, 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 Et } 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__ */ It();
16
+ const rt = typeof window < "u", ht = () => {
17
+ }, N = /* @__PURE__ */ It();
18
18
  function It() {
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);
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 At(...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
39
  const i = [], a = () => {
40
40
  i.forEach((h) => h()), i.length = 0;
41
- }, l = (h, o, _, u) => (h.addEventListener(o, _, u), () => h.removeEventListener(o, _, u)), y = I(
42
- () => [Tt(t), q(n)],
43
- ([h, o]) => {
41
+ }, l = (h, r, _, u) => (h.addEventListener(r, _, u), () => h.removeEventListener(r, _, u)), y = I(
42
+ () => [jt(t), q(n)],
43
+ ([h, r]) => {
44
44
  a(), h && i.push(
45
- ...e.flatMap((_) => s.map((u) => l(h, _, u, o)))
45
+ ...e.flatMap((_) => s.map((u) => l(h, _, u, r)))
46
46
  );
47
47
  },
48
48
  { immediate: !0, flush: "post" }
49
49
  ), c = () => {
50
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",
@@ -76,45 +76,45 @@ const Yt = /* @__PURE__ */ v({
76
76
  "onMove",
77
77
  "onEnd"
78
78
  ],
79
- setup(r, { slots: t }) {
80
- const e = g(), s = E(() => {
79
+ setup(o, { slots: t }) {
80
+ const e = m(), s = E(() => {
81
81
  var y;
82
- return (y = r.handle) != null ? y : e.value;
83
- }), n = r.storageKey && vt(
84
- r.storageKey,
85
- q(r.initialValue) || { x: 0, y: 0 },
86
- Ct ? r.storageType === "session" ? sessionStorage : localStorage : void 0
87
- ), i = n || r.initialValue || { x: 0, y: 0 }, a = (y, c) => {
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
88
  var h;
89
- (h = r.onEnd) == null || h.call(r, y, c), n && (n.value.x = y.x, n.value.y = y.y);
90
- }, l = tt(St(e, Rt(Ft({}, r), {
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), {
91
91
  handle: s,
92
92
  initialValue: i,
93
93
  onEnd: a
94
94
  })));
95
95
  return () => {
96
96
  if (t.default)
97
- 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));
98
98
  };
99
99
  }
100
100
  });
101
- function at(r) {
102
- const t = window.getComputedStyle(r);
103
- if (t.overflowX === "scroll" || t.overflowY === "scroll" || t.overflowX === "auto" && r.clientWidth < r.scrollWidth || t.overflowY === "auto" && r.clientHeight < r.scrollHeight)
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)
104
104
  return !0;
105
105
  {
106
- const e = r.parentNode;
106
+ const e = o.parentNode;
107
107
  return !e || e.tagName === "BODY" ? !1 : at(e);
108
108
  }
109
109
  }
110
- function Nt(r) {
111
- const t = r || window.event, e = t.target;
110
+ function Qt(o) {
111
+ const t = o || window.event, e = t.target;
112
112
  return at(e) ? !1 : t.touches.length > 1 ? !0 : (t.preventDefault && t.preventDefault(), !1);
113
113
  }
114
- function Ht(r, t = !1) {
115
- const e = g(t);
114
+ function Wt(o, t = !1) {
115
+ const e = m(t);
116
116
  let s = null, n;
117
- I(At(r), (l) => {
117
+ I(At(o), (l) => {
118
118
  if (l) {
119
119
  const y = l;
120
120
  n = y.style.overflow, e.value && (y.style.overflow = "hidden");
@@ -123,20 +123,20 @@ function Ht(r, t = !1) {
123
123
  immediate: !0
124
124
  });
125
125
  const i = () => {
126
- const l = q(r);
127
- !l || e.value || (Z && (s = qt(
126
+ const l = q(o);
127
+ !l || e.value || (N && (s = Pt(
128
128
  l,
129
129
  "touchmove",
130
130
  (y) => {
131
- Nt(y);
131
+ Qt(y);
132
132
  },
133
133
  { passive: !1 }
134
134
  )), l.style.overflow = "hidden", e.value = !0);
135
135
  }, a = () => {
136
- const l = q(r);
137
- !l || !e.value || (Z && (s == null || s()), l.style.overflow = n, e.value = !1);
136
+ const l = q(o);
137
+ !l || !e.value || (N && (s == null || s()), l.style.overflow = n, e.value = !1);
138
138
  };
139
- return rt(a), E({
139
+ return ot(a), E({
140
140
  get() {
141
141
  return e.value;
142
142
  },
@@ -145,30 +145,30 @@ function Ht(r, t = !1) {
145
145
  }
146
146
  });
147
147
  }
148
- function Qt() {
149
- let r = !1;
150
- const t = g(!1);
148
+ function Zt() {
149
+ let o = !1;
150
+ const t = m(!1);
151
151
  return (e, s) => {
152
- if (t.value = s.value, r)
152
+ if (t.value = s.value, o)
153
153
  return;
154
- r = !0;
155
- const n = Ht(e, s.value);
154
+ o = !0;
155
+ const n = Wt(e, s.value);
156
156
  I(t, (i) => n.value = i);
157
157
  };
158
158
  }
159
- Qt();
159
+ Zt();
160
160
  /**
161
161
  * @license
162
162
  * Copyright 2010-2023 Three.js Authors
163
163
  * SPDX-License-Identifier: MIT
164
164
  */
165
165
  const lt = "153";
166
- function N(r, t, e) {
167
- return Math.max(t, Math.min(e, r));
166
+ function H(o, t, e) {
167
+ return Math.max(t, Math.min(e, o));
168
168
  }
169
- class H {
169
+ class Q {
170
170
  constructor(t = 0, e = 0) {
171
- H.prototype.isVector2 = !0, this.x = t, this.y = e;
171
+ Q.prototype.isVector2 = !0, this.x = t, this.y = e;
172
172
  }
173
173
  get width() {
174
174
  return this.x;
@@ -317,7 +317,7 @@ class H {
317
317
  if (e === 0)
318
318
  return Math.PI / 2;
319
319
  const s = this.dot(t) / e;
320
- return Math.acos(N(s, -1, 1));
320
+ return Math.acos(H(s, -1, 1));
321
321
  }
322
322
  distanceTo(t) {
323
323
  return Math.sqrt(this.distanceToSquared(t));
@@ -361,39 +361,39 @@ class H {
361
361
  yield this.x, yield this.y;
362
362
  }
363
363
  }
364
- class Wt {
364
+ class Nt {
365
365
  constructor(t = 0, e = 0, s = 0, n = 1) {
366
366
  this.isQuaternion = !0, this._x = t, this._y = e, this._z = s, this._w = n;
367
367
  }
368
368
  static slerpFlat(t, e, s, n, i, a, l) {
369
- let y = s[n + 0], c = s[n + 1], h = s[n + 2], o = s[n + 3];
370
- const _ = i[a + 0], u = i[a + 1], x = i[a + 2], m = i[a + 3];
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];
371
371
  if (l === 0) {
372
- t[e + 0] = y, t[e + 1] = c, t[e + 2] = h, t[e + 3] = o;
372
+ t[e + 0] = y, t[e + 1] = c, t[e + 2] = h, t[e + 3] = r;
373
373
  return;
374
374
  }
375
375
  if (l === 1) {
376
- t[e + 0] = _, 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;
377
377
  return;
378
378
  }
379
- if (o !== m || y !== _ || c !== u || h !== x) {
379
+ if (r !== b || y !== _ || c !== u || h !== x) {
380
380
  let z = 1 - l;
381
- const f = y * _ + c * u + h * x + o * m, M = f >= 0 ? 1 : -1, Q = 1 - f * f;
382
- if (Q > Number.EPSILON) {
383
- const S = Math.sqrt(Q), W = Math.atan2(S, f * M);
384
- 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;
385
385
  }
386
- const P = l * M;
387
- if (y = y * z + _ * P, c = c * z + u * P, h = h * z + x * P, o = o * z + m * P, z === 1 - l) {
388
- const S = 1 / Math.sqrt(y * y + c * c + h * h + o * o);
389
- y *= S, c *= S, h *= 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;
390
390
  }
391
391
  }
392
- t[e] = y, t[e + 1] = c, t[e + 2] = h, t[e + 3] = o;
392
+ t[e] = y, t[e + 1] = c, t[e + 2] = h, t[e + 3] = r;
393
393
  }
394
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], o = i[a], _ = i[a + 1], u = i[a + 2], x = i[a + 3];
396
- return t[e] = l * x + h * o + y * u - c * _, t[e + 1] = y * x + h * _ + c * o - l * u, t[e + 2] = c * x + h * u + l * _ - y * o, t[e + 3] = h * x - l * o - y * _ - c * u, t;
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;
397
397
  }
398
398
  get x() {
399
399
  return this._x;
@@ -429,25 +429,25 @@ class Wt {
429
429
  return this._x = t.x, this._y = t.y, this._z = t.z, this._w = t.w, this._onChangeCallback(), this;
430
430
  }
431
431
  setFromEuler(t, e) {
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), o = l(i / 2), _ = y(s / 2), u = y(n / 2), x = y(i / 2);
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
433
  switch (a) {
434
434
  case "XYZ":
435
- this._x = _ * h * o + c * u * x, this._y = c * u * o - _ * h * x, this._z = c * h * x + _ * u * o, this._w = c * h * o - _ * 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;
436
436
  break;
437
437
  case "YXZ":
438
- this._x = _ * h * o + c * u * x, this._y = c * u * o - _ * h * x, this._z = c * h * x - _ * u * o, this._w = c * h * o + _ * 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;
439
439
  break;
440
440
  case "ZXY":
441
- this._x = _ * h * o - c * u * x, this._y = c * u * o + _ * h * x, this._z = c * h * x + _ * u * o, this._w = c * h * o - _ * 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;
442
442
  break;
443
443
  case "ZYX":
444
- this._x = _ * h * o - c * u * x, this._y = c * u * o + _ * h * x, this._z = c * h * x - _ * u * o, this._w = c * h * o + _ * 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;
445
445
  break;
446
446
  case "YZX":
447
- this._x = _ * h * o + c * u * x, this._y = c * u * o + _ * h * x, this._z = c * h * x - _ * u * o, this._w = c * h * o - _ * 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;
448
448
  break;
449
449
  case "XZY":
450
- this._x = _ * h * o - c * u * x, this._y = c * u * o - _ * h * x, this._z = c * h * x + _ * u * o, this._w = c * h * o + _ * 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;
451
451
  break;
452
452
  default:
453
453
  console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: " + a);
@@ -459,18 +459,18 @@ class Wt {
459
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;
460
460
  }
461
461
  setFromRotationMatrix(t) {
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], o = e[10], _ = s + l + o;
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
463
  if (_ > 0) {
464
464
  const u = 0.5 / Math.sqrt(_ + 1);
465
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 > o) {
467
- const u = 2 * Math.sqrt(1 + s - l - o);
466
+ } else if (s > l && s > r) {
467
+ const u = 2 * Math.sqrt(1 + s - l - r);
468
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 > o) {
470
- const u = 2 * Math.sqrt(1 + l - s - o);
469
+ } else if (l > r) {
470
+ const u = 2 * Math.sqrt(1 + l - s - r);
471
471
  this._w = (i - c) / u, this._x = (n + a) / u, this._y = 0.25 * u, this._z = (y + h) / u;
472
472
  } else {
473
- const u = 2 * Math.sqrt(1 + o - s - l);
473
+ const u = 2 * Math.sqrt(1 + r - s - l);
474
474
  this._w = (a - n) / u, this._x = (i + c) / u, this._y = (y + h) / u, this._z = 0.25 * u;
475
475
  }
476
476
  return this._onChangeCallback(), this;
@@ -480,7 +480,7 @@ class Wt {
480
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();
481
481
  }
482
482
  angleTo(t) {
483
- 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)));
484
484
  }
485
485
  rotateTowards(t, e) {
486
486
  const s = this.angleTo(t);
@@ -535,8 +535,8 @@ class Wt {
535
535
  const u = 1 - e;
536
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;
537
537
  }
538
- const c = Math.sqrt(y), h = Math.atan2(c, l), o = Math.sin((1 - e) * h) / c, _ = Math.sin(e * h) / c;
539
- return this._w = a * o + this._w * _, this._x = s * o + this._x * _, this._y = n * o + this._y * _, this._z = i * o + this._z * _, 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;
540
540
  }
541
541
  slerpQuaternions(t, e, s) {
542
542
  return this.copy(t).slerp(e, s);
@@ -675,8 +675,8 @@ class $ {
675
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;
676
676
  }
677
677
  applyQuaternion(t) {
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, o = y * n + i * s - a * e, _ = -i * e - a * s - l * n;
679
- return this.x = c * y + _ * -i + h * -l - o * -a, this.y = h * y + _ * -a + o * -i - c * -l, this.z = o * y + _ * -l + c * -a - h * -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;
680
680
  }
681
681
  project(t) {
682
682
  return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix);
@@ -765,17 +765,17 @@ class $ {
765
765
  return this.copy(t).multiplyScalar(s);
766
766
  }
767
767
  projectOnPlane(t) {
768
- return L.copy(this).projectOnVector(t), this.sub(L);
768
+ return X.copy(this).projectOnVector(t), this.sub(X);
769
769
  }
770
770
  reflect(t) {
771
- return this.sub(L.copy(t).multiplyScalar(2 * this.dot(t)));
771
+ return this.sub(X.copy(t).multiplyScalar(2 * this.dot(t)));
772
772
  }
773
773
  angleTo(t) {
774
774
  const e = Math.sqrt(this.lengthSq() * t.lengthSq());
775
775
  if (e === 0)
776
776
  return Math.PI / 2;
777
777
  const s = this.dot(t) / e;
778
- return Math.acos(N(s, -1, 1));
778
+ return Math.acos(H(s, -1, 1));
779
779
  }
780
780
  distanceTo(t) {
781
781
  return Math.sqrt(this.distanceToSquared(t));
@@ -843,19 +843,19 @@ class $ {
843
843
  yield this.x, yield this.y, yield this.z;
844
844
  }
845
845
  }
846
- const L = /* @__PURE__ */ new $(), K = /* @__PURE__ */ new Wt();
846
+ const X = /* @__PURE__ */ new $(), K = /* @__PURE__ */ new Nt();
847
847
  typeof __THREE_DEVTOOLS__ < "u" && __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register", { detail: {
848
848
  revision: lt
849
849
  } }));
850
850
  typeof window < "u" && (window.__THREE__ ? console.warn("WARNING: Multiple instances of Three.js being imported.") : window.__THREE__ = lt);
851
- const j = tt({
851
+ const Bt = Symbol("CONTROLS_CONTEXT_KEY"), T = tt({
852
852
  controls: []
853
853
  });
854
- function Zt() {
855
- return j;
854
+ function Ut() {
855
+ return ft(Bt, T), T;
856
856
  }
857
- function X(r) {
858
- return Object.entries(r).map(([t, e]) => {
857
+ function R(o) {
858
+ return Object.entries(o).map(([t, e]) => {
859
859
  let s = "string", n;
860
860
  const i = /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$|^0x([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;
861
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 ? {
@@ -872,63 +872,73 @@ function X(r) {
872
872
  };
873
873
  });
874
874
  }
875
- function Bt() {
876
- j.controls = [];
875
+ function Kt() {
876
+ T.controls = [];
877
877
  }
878
- function He(r, t, e) {
878
+ function Ge(o, t, e) {
879
879
  let s = [];
880
- if (typeof r == "string")
881
- r === "fpsgraph" ? s.push({
880
+ if (typeof o == "string")
881
+ o === "fpsgraph" ? s.push({
882
882
  label: "fpsgraph",
883
883
  visible: !0,
884
884
  type: "fpsgraph"
885
885
  }) : s.push({
886
- label: r,
886
+ label: o,
887
887
  visible: !0,
888
888
  type: "folder",
889
- 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
890
900
  });
891
- else if (typeof r == "object" && typeof t == "string")
901
+ else if (typeof o == "object" && typeof t == "string")
892
902
  s.push({
893
903
  ...e,
894
904
  label: t,
895
905
  visible: !0,
896
- value: r[t],
897
- type: typeof r[t],
898
- ref: r
906
+ value: o[t],
907
+ type: typeof o[t],
908
+ ref: o
899
909
  });
900
- else if (ft(r)) {
901
- const n = gt(r);
902
- s = X(n);
910
+ else if (gt(o)) {
911
+ const n = mt(o);
912
+ s = R(n);
903
913
  } else
904
- s = X(r);
905
- 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 };
906
916
  }
907
- 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({
908
918
  __name: "NumberControl",
909
919
  props: {
910
920
  label: {},
911
921
  control: {}
912
922
  },
913
923
  emits: ["change"],
914
- setup(r, { emit: t }) {
915
- const e = r;
924
+ setup(o, { emit: t }) {
925
+ const e = o;
916
926
  function s(h) {
917
- const { target: o } = h;
918
- t("change", o.valueAsNumber);
927
+ const { target: r } = h;
928
+ t("change", r.valueAsNumber);
919
929
  }
920
- const n = Y(), i = g(0), a = g(!1), l = (h) => {
930
+ const n = F(), i = m(0), a = m(!1), l = (h) => {
921
931
  i.value = h.clientX, a.value = !0;
922
932
  }, y = () => {
923
933
  a.value = !1;
924
934
  }, c = (h) => Math.floor(Math.abs(h) / 10);
925
935
  return I(n.x, (h) => {
926
936
  if (a.value) {
927
- const o = h - i.value, _ = c(o);
928
- o > 0 ? t("change", e.control.value + 1 + _) : o < 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;
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;
929
939
  }
930
- }), (h, o) => (d(), b("div", Ut, [
931
- p("label", Kt, C(h.label), 1),
940
+ }), (h, r) => (d(), g("div", Gt, [
941
+ p("label", Jt, v(h.label), 1),
932
942
  p("input", {
933
943
  value: h.control.value,
934
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 }]),
@@ -939,51 +949,51 @@ const Ut = { class: "flex px-4 justify-between gap-4 items-center mb-2" }, Kt =
939
949
  onInput: s,
940
950
  onMousedown: l,
941
951
  onMouseup: y
942
- }, null, 42, Gt)
952
+ }, null, 42, Ot)
943
953
  ]));
944
954
  }
945
- }), 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({
946
956
  __name: "TextControl",
947
957
  props: {
948
958
  label: {},
949
959
  control: {}
950
960
  },
951
961
  emits: ["change"],
952
- setup(r, { emit: t }) {
962
+ setup(o, { emit: t }) {
953
963
  function e(s) {
954
964
  t("change", s);
955
965
  }
956
- return (s, n) => (d(), b("div", Ot, [
957
- p("label", te, C(s.label), 1),
966
+ return (s, n) => (d(), g("div", ee, [
967
+ p("label", se, v(s.label), 1),
958
968
  p("input", {
959
969
  value: s.control.value,
960
970
  type: "string",
961
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",
962
972
  onChange: e
963
- }, null, 40, ee)
973
+ }, null, 40, ne)
964
974
  ]));
965
975
  }
966
- }), 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({
967
977
  __name: "BooleanControl",
968
978
  props: {
969
979
  label: {},
970
980
  control: {}
971
981
  },
972
982
  emits: ["change"],
973
- setup(r, { emit: t }) {
983
+ setup(o, { emit: t }) {
974
984
  function e(s) {
975
985
  const { target: n } = s;
976
986
  t("change", n.checked);
977
987
  }
978
- return (s, n) => (d(), b("div", ne, [
979
- p("label", ie, C(s.label), 1),
988
+ return (s, n) => (d(), g("div", oe, [
989
+ p("label", re, v(s.label), 1),
980
990
  p("input", {
981
991
  id: s.control.label,
982
992
  checked: s.control.value,
983
993
  class: "hidden",
984
994
  type: "checkbox",
985
995
  onInput: e
986
- }, null, 40, re),
996
+ }, null, 40, he),
987
997
  p("label", {
988
998
  for: s.control.label,
989
999
  class: "inline-flex items-center cursor-pointer"
@@ -991,140 +1001,140 @@ const Ut = { class: "flex px-4 justify-between gap-4 items-center mb-2" }, Kt =
991
1001
  p("span", {
992
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"])
993
1003
  }, [
994
- et(p("i", he, null, 512), [
1004
+ et(p("i", le, null, 512), [
995
1005
  [st, s.control.value]
996
1006
  ])
997
1007
  ], 2)
998
- ], 8, oe)
1008
+ ], 8, ae)
999
1009
  ]));
1000
1010
  }
1001
- }), 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({
1002
1012
  __name: "SliderControl",
1003
1013
  props: {
1004
1014
  label: {},
1005
1015
  control: {}
1006
1016
  },
1007
1017
  emits: ["change"],
1008
- setup(r, { emit: t }) {
1009
- const e = r;
1010
- function s(o) {
1011
- const { target: _ } = o;
1018
+ setup(o, { emit: t }) {
1019
+ const e = o;
1020
+ function s(r) {
1021
+ const { target: _ } = r;
1012
1022
  t("change", _.valueAsNumber);
1013
1023
  }
1014
1024
  const n = E(() => ({
1015
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%)`
1016
- })), i = Y(), a = g(0), l = g(!1), y = (o) => {
1017
- a.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;
1018
1028
  }, c = () => {
1019
1029
  l.value = !1;
1020
- }, h = (o) => Math.floor(Math.abs(o) / 10);
1021
- return I(i.x, (o) => {
1030
+ }, h = (r) => Math.floor(Math.abs(r) / 10);
1031
+ return I(i.x, (r) => {
1022
1032
  if (l.value) {
1023
- const _ = o - a.value, u = h(_);
1024
- _ > 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 = 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;
1025
1035
  }
1026
- }), (o, _) => (d(), b("div", le, [
1036
+ }), (r, _) => (d(), g("div", ce, [
1027
1037
  p("label", {
1028
- 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 }])
1029
1039
  }, [
1030
- bt(C(o.label) + " ", 1),
1040
+ zt(v(r.label) + " ", 1),
1031
1041
  p("i", {
1032
- class: k(`i-${o.control.icon}`)
1042
+ class: k(`i-${r.control.icon}`)
1033
1043
  }, null, 2)
1034
1044
  ], 2),
1035
1045
  p("input", {
1036
- value: o.control.value,
1046
+ value: r.control.value,
1037
1047
  class: "w-1/2 h-0.75 bg-dark-200 rounded-full appearance-none",
1038
- style: zt(n.value),
1048
+ style: Mt(n.value),
1039
1049
  type: "range",
1040
- min: o.control.min,
1041
- max: o.control.max,
1042
- step: o.control.step,
1050
+ min: r.control.min,
1051
+ max: r.control.max,
1052
+ step: r.control.step,
1043
1053
  onInput: s
1044
- }, null, 44, ue),
1054
+ }, null, 44, ye),
1045
1055
  p("input", {
1046
- value: o.control.value,
1056
+ value: r.control.value,
1047
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 }]),
1048
1058
  type: "number",
1049
- min: o.control.min,
1050
- max: o.control.max,
1051
- step: o.control.step,
1059
+ min: r.control.min,
1060
+ max: r.control.max,
1061
+ step: r.control.step,
1052
1062
  onInput: s,
1053
1063
  onMousedown: y,
1054
1064
  onMouseup: c
1055
- }, null, 42, ce)
1065
+ }, null, 42, _e)
1056
1066
  ]));
1057
1067
  }
1058
1068
  });
1059
- const _e = (r, t) => {
1060
- const e = r.__vccOpts || r;
1069
+ const pe = (o, t) => {
1070
+ const e = o.__vccOpts || o;
1061
1071
  for (const [s, n] of t)
1062
1072
  e[s] = n;
1063
1073
  return e;
1064
- }, 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({
1065
1075
  __name: "ColorControl",
1066
1076
  props: {
1067
1077
  label: {},
1068
1078
  control: {}
1069
1079
  },
1070
1080
  emits: ["change"],
1071
- setup(r, { emit: t }) {
1081
+ setup(o, { emit: t }) {
1072
1082
  function e(s) {
1073
1083
  const { target: n } = s;
1074
1084
  t("change", n.value);
1075
1085
  }
1076
- return (s, n) => (d(), b("div", pe, [
1077
- p("label", de, C(s.label), 1),
1086
+ return (s, n) => (d(), g("div", fe, [
1087
+ p("label", ge, v(s.label), 1),
1078
1088
  p("input", {
1079
1089
  value: s.control.value,
1080
1090
  type: "color",
1081
1091
  onInput: e
1082
- }, null, 40, fe),
1092
+ }, null, 40, me),
1083
1093
  p("input", {
1084
1094
  value: s.control.value,
1085
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",
1086
1096
  type: "text",
1087
1097
  onInput: e
1088
- }, null, 40, ge)
1098
+ }, null, 40, be)
1089
1099
  ]));
1090
1100
  }
1091
1101
  });
1092
- function be(r) {
1093
- 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;
1094
1104
  }
1095
- 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 = {
1096
1106
  key: 0,
1097
1107
  class: "font-bold px-0.5 py-1 text-0.65rem text-gray-300"
1098
- }, Ce = ["value", "onInput", "onMousedown", "onMouseup"], Se = /* @__PURE__ */ v({
1108
+ }, ke = ["value", "onInput", "onMousedown", "onMouseup"], $e = /* @__PURE__ */ C({
1099
1109
  __name: "VectorControl",
1100
1110
  props: {
1101
1111
  label: {},
1102
1112
  control: {}
1103
1113
  },
1104
1114
  emits: ["change"],
1105
- setup(r, { emit: t }) {
1106
- const e = r, s = Y(), n = g(0), i = g(!1), a = g(0), l = (x, m) => {
1107
- a.value = m, n.value = x.clientX, i.value = !0;
1108
- }, y = (x, m) => {
1109
- a.value = m, i.value = !1;
1110
- }, c = (x) => Math.floor(Math.abs(x) / 10), h = E(() => be(e.control.value)), o = E(() => Object.keys(e.control.value)), _ = E(() => e.control.value instanceof H || e.control.value instanceof $);
1111
- 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) {
1112
1122
  const { value: z } = e.control, { target: f } = x;
1113
- a.value = m, z[_.value ? o.value[a.value] : a.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);
1114
1124
  }
1115
1125
  return I(s.x, (x) => {
1116
1126
  if (i.value) {
1117
- const m = x - n.value, z = c(m), { value: f } = e.control, M = _.value ? o.value[a.value] : a.value;
1118
- 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;
1119
1129
  }
1120
- }), (x, m) => (d(), b("div", ze, [
1121
- p("label", Me, C(x.label), 1),
1122
- p("div", we, [
1123
- (d(!0), b(D, null, R(h.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", {
1124
1134
  key: x.label + f,
1125
1135
  class: "flex items-center w-1/3 bg-gray-100 rounded"
1126
1136
  }, [
1127
- o.value[f] && _.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),
1128
1138
  p("input", {
1129
1139
  type: "text",
1130
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 }]),
@@ -1132,41 +1142,41 @@ const ze = { class: "flex px-4 justify-between gap-2 items-center mb-2" }, Me =
1132
1142
  onInput: (M) => u(M, f),
1133
1143
  onMousedown: (M) => l(M, f),
1134
1144
  onMouseup: (M) => y(M, f)
1135
- }, null, 42, Ce)
1145
+ }, null, 42, ke)
1136
1146
  ]))), 128))
1137
1147
  ])
1138
1148
  ]));
1139
1149
  }
1140
- }), ke = { class: "mb-4" }, $e = { class: "bg-white rounded-b pt-4" }, Ee = /* @__PURE__ */ v({
1150
+ }), Ee = { class: "mb-4" }, Te = { class: "bg-white rounded-b pt-4" }, Ie = /* @__PURE__ */ C({
1141
1151
  __name: "Folder",
1142
1152
  props: {
1143
1153
  control: {}
1144
1154
  },
1145
- setup(r) {
1155
+ setup(o) {
1146
1156
  function t(n, i) {
1147
1157
  i.value = n;
1148
1158
  }
1149
- const e = g(!1), s = () => {
1159
+ const e = m(!1), s = () => {
1150
1160
  e.value = !e.value;
1151
1161
  };
1152
- return (n, i) => (d(), b("div", ke, [
1162
+ return (n, i) => (d(), g("div", Ee, [
1153
1163
  p("button", {
1154
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",
1155
1165
  onClick: s
1156
1166
  }, [
1157
- p("span", null, C(n.control.label), 1),
1167
+ p("span", null, v(n.control.label), 1),
1158
1168
  p("i", {
1159
1169
  class: k(e.value ? "i-ic:baseline-keyboard-arrow-up" : "i-ic:baseline-keyboard-arrow-down")
1160
1170
  }, null, 2)
1161
1171
  ]),
1162
- Mt(wt, {
1172
+ wt(vt, {
1163
1173
  name: "slide",
1164
1174
  "enter-active-class": " animate-fade-in animate-duration-200 animate-ease-in-out",
1165
1175
  "leave-active-class": " animate-fade-out animate-duration-200 animate-ease-in-out"
1166
1176
  }, {
1167
1177
  default: it(() => [
1168
- et(p("div", $e, [
1169
- (d(!0), b(D, null, R(n.control.controls, (a) => (d(), w(ut, {
1178
+ et(p("div", Te, [
1179
+ (d(!0), g(P, null, L(n.control.controls, (a) => (d(), w(ut, {
1170
1180
  key: a.label,
1171
1181
  control: a,
1172
1182
  onChange: (l) => t(l, a)
@@ -1179,26 +1189,26 @@ const ze = { class: "flex px-4 justify-between gap-2 items-center mb-2" }, Me =
1179
1189
  })
1180
1190
  ]));
1181
1191
  }
1182
- }), Ie = { class: "flex px-4 justify-between gap-4 items-center mb-2" }, Ae = { 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, A = 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({
1183
1193
  __name: "FPSGraph",
1184
1194
  props: {
1185
1195
  label: {},
1186
1196
  control: {}
1187
1197
  },
1188
- setup(r) {
1189
- const t = kt({ every: J }), e = g(""), s = g([]), n = g(G / A);
1198
+ setup(o) {
1199
+ const t = $t({ every: J }), e = m(""), s = m([]), n = m(G / A);
1190
1200
  let i = performance.now();
1191
- return $t(({ timestamp: a }) => {
1201
+ return Et(({ timestamp: a }) => {
1192
1202
  a - i >= J && (i = a, s.value.push(t.value), s.value.length > n.value && s.value.shift(), e.value = s.value.map(
1193
- (l, y) => `${y * A},${F + O - A / 2 - l * (F + O - A) / 120}`
1203
+ (l, y) => `${y * A},${Y + O - A / 2 - l * (Y + O - A) / 120}`
1194
1204
  ).join(" "));
1195
- }), (a, l) => (d(), b("div", Ie, [
1196
- p("label", Ae, C(a.label), 1),
1197
- p("div", Te, [
1198
- p("div", je, C(Math.round(T(t))) + " FPS", 1),
1199
- (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", {
1200
1210
  width: G,
1201
- height: F,
1211
+ height: Y,
1202
1212
  xmlns: "http://www.w3.org/2000/svg",
1203
1213
  class: "bg-gray-100"
1204
1214
  }, [
@@ -1209,91 +1219,121 @@ const ze = { class: "flex px-4 justify-between gap-2 items-center mb-2" }, Me =
1209
1219
  "stroke-width": A,
1210
1220
  "stroke-linecap": "round",
1211
1221
  "stroke-linejoin": "round"
1212
- }, null, 8, qe)
1222
+ }, null, 8, De)
1213
1223
  ]))
1214
1224
  ])
1215
1225
  ]));
1216
1226
  }
1217
- }), 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({
1218
1253
  __name: "ControlInput",
1219
1254
  props: {
1220
1255
  control: {}
1221
1256
  },
1222
1257
  emits: ["change"],
1223
- setup(r, { emit: t }) {
1258
+ setup(o, { emit: t }) {
1224
1259
  function e(s) {
1225
1260
  t("change", s);
1226
1261
  }
1227
- return (s, n) => s.control.visible ? (d(), b(D, { key: 0 }, [
1228
- 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, {
1229
1264
  key: 0,
1230
1265
  label: s.control.label,
1231
1266
  control: s.control,
1232
1267
  onChange: e
1233
- }, null, 8, ["label", "control"])) : s.control.type === "vector" ? (d(), w(Se, {
1268
+ }, null, 8, ["label", "control"])) : s.control.type === "vector" ? (d(), w($e, {
1234
1269
  key: 1,
1235
1270
  label: s.control.label,
1236
1271
  control: s.control,
1237
1272
  onChange: e
1238
- }, null, 8, ["label", "control"])) : s.control.type === "boolean" ? (d(), w(ae, {
1273
+ }, null, 8, ["label", "control"])) : s.control.type === "boolean" ? (d(), w(ue, {
1239
1274
  key: 2,
1240
1275
  label: s.control.label,
1241
1276
  control: s.control,
1242
1277
  onChange: e
1243
- }, null, 8, ["label", "control"])) : s.control.type === "fpsgraph" ? (d(), w(Pe, {
1278
+ }, null, 8, ["label", "control"])) : s.control.type === "fpsgraph" ? (d(), w(Le, {
1244
1279
  key: 3,
1245
1280
  label: s.control.label,
1246
1281
  control: s.control
1247
- }, null, 8, ["label", "control"])) : s.control.type === "folder" ? (d(), w(Ee, {
1282
+ }, null, 8, ["label", "control"])) : s.control.type === "folder" ? (d(), w(Ie, {
1248
1283
  key: 4,
1249
1284
  label: s.control.label,
1250
1285
  control: s.control
1251
- }, null, 8, ["label", "control"])) : s.control.type === "number" ? (d(), w(Jt, {
1286
+ }, null, 8, ["label", "control"])) : s.control.type === "number" ? (d(), w(te, {
1252
1287
  key: 5,
1253
1288
  label: s.control.label,
1254
1289
  control: s.control,
1255
1290
  onChange: e
1256
- }, null, 8, ["label", "control"])) : s.control.type === "range" ? (d(), w(xe, {
1291
+ }, null, 8, ["label", "control"])) : s.control.type === "range" ? (d(), w(de, {
1257
1292
  key: 6,
1258
1293
  label: s.control.label,
1259
1294
  control: s.control,
1260
1295
  onChange: e
1261
- }, null, 8, ["label", "control"])) : (d(), w(se, {
1296
+ }, null, 8, ["label", "control"])) : s.control.type === "select" ? (d(), w(Fe, {
1262
1297
  key: 7,
1263
1298
  label: s.control.label,
1264
1299
  control: s.control,
1265
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
1266
1306
  }, null, 8, ["label", "control"]))
1267
1307
  ], 64)) : nt("", !0);
1268
1308
  }
1269
- }), 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, [
1270
1310
  /* @__PURE__ */ p("i", { class: "i-ic-baseline-drag-indicator" }),
1271
1311
  /* @__PURE__ */ p("i", { class: "i-ic-baseline-drag-indicator" }),
1272
1312
  /* @__PURE__ */ p("i", { class: "i-ic-baseline-drag-indicator" })
1273
- ], -1), Xe = /* @__PURE__ */ p("div", null, null, -1), Fe = [
1274
- Ve,
1275
- Le,
1276
- Xe
1277
- ], 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({
1278
1318
  __name: "TresLeches",
1279
- setup(r) {
1280
- const { width: t } = Et(), e = g(null), s = Zt();
1319
+ setup(o) {
1320
+ const { width: t } = Tt(), e = m(null), s = Ut();
1281
1321
  function n(i, a) {
1282
1322
  a.ref && (a.ref[a.label] = i), a.value = i;
1283
1323
  }
1284
- return (i, a) => (d(), w(T(Yt), {
1285
- "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 },
1286
1326
  class: "fixed select-none z-24 w-280px font-sans text-xs",
1287
1327
  handle: e.value
1288
1328
  }, {
1289
1329
  default: it(() => [
1290
- p("div", De, [
1330
+ p("div", He, [
1291
1331
  p("header", {
1292
1332
  ref_key: "handle",
1293
1333
  ref: e,
1294
1334
  class: "relative cursor-grabbing p-4 flex justify-between text-gray-200 relative"
1295
- }, Fe, 512),
1296
- (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, {
1297
1337
  key: l.label,
1298
1338
  control: l,
1299
1339
  onChange: (y) => n(y, l)
@@ -1305,6 +1345,6 @@ const ze = { class: "flex px-4 justify-between gap-2 items-center mb-2" }, Me =
1305
1345
  }
1306
1346
  });
1307
1347
  export {
1308
- Qe as TresLeches,
1309
- He as useControls
1348
+ Je as TresLeches,
1349
+ Ge as useControls
1310
1350
  };