@tresjs/leches 0.14.0 → 0.14.1

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,100 +1,97 @@
1
1
  /**
2
2
  * name: @tresjs/leches
3
- * version: v0.14.0
4
- * (c) 2023
3
+ * version: v0.14.1
4
+ * (c) 2025
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 K, isRef as G, toRefs as B, customRef as gt, ref as d, watch as O, computed as z, defineComponent as k, reactive as N, h as mt, provide as yt, isReactive as ht, openBlock as p, createElementBlock as h, normalizeClass as M, Fragment as V, createTextVNode as st, toDisplayString as F, createVNode as X, createElementVNode as f, withDirectives as ct, vShow as it, normalizeStyle as _t, renderList as j, createCommentVNode as H, createBlock as C, Transition as wt, withCtx as ut } from "vue";
9
- import { useWindowSize as pt, useEventListener as J, useStorage as xt, isClient as $t, useMouse as lt, useMousePressed as kt, useKeyModifier as nt, useFps as Ct, useRafFn as Mt } from "@vueuse/core";
10
- function E(e) {
11
- return typeof e == "function" ? e() : K(e);
12
- }
13
- const dt = typeof window < "u" && typeof document < "u";
8
+ import { toValue as se, isRef as G, toRefs as B, customRef as me, ref as d, watch as U, computed as V, defineComponent as $, reactive as N, h as ye, provide as he, isReactive as _e, openBlock as p, createElementBlock as h, normalizeClass as M, Fragment as O, createTextVNode as ue, toDisplayString as F, createVNode as X, createElementVNode as f, withDirectives as ce, vShow as ie, normalizeStyle as we, renderList as j, unref as D, createCommentVNode as H, createBlock as C, Transition as xe, withCtx as pe } from "vue";
9
+ import { useWindowSize as de, useEventListener as J, useStorage as ke, isClient as $e, useMouse as le, useMousePressed as Ce, useKeyModifier as ne, useFps as Me, useRafFn as Se } from "@vueuse/core";
10
+ const fe = typeof window < "u" && typeof document < "u";
14
11
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
15
- function St(e, o = {}) {
16
- if (!G(e))
17
- return B(e);
18
- const l = Array.isArray(e.value) ? Array.from({ length: e.value.length }) : {};
19
- for (const n in e.value)
20
- l[n] = gt(() => ({
12
+ function Ae(t, o = {}) {
13
+ if (!G(t))
14
+ return B(t);
15
+ const l = Array.isArray(t.value) ? Array.from({ length: t.value.length }) : {};
16
+ for (const n in t.value)
17
+ l[n] = me(() => ({
21
18
  get() {
22
- return e.value[n];
19
+ return t.value[n];
23
20
  },
24
- set(t) {
25
- var i;
26
- if ((i = E(o.replaceRef)) != null ? i : !0)
27
- if (Array.isArray(e.value)) {
28
- const c = [...e.value];
29
- c[n] = t, e.value = c;
21
+ set(e) {
22
+ var c;
23
+ if ((c = se(o.replaceRef)) != null ? c : !0)
24
+ if (Array.isArray(t.value)) {
25
+ const u = [...t.value];
26
+ u[n] = e, t.value = u;
30
27
  } else {
31
- const c = { ...e.value, [n]: t };
32
- Object.setPrototypeOf(c, Object.getPrototypeOf(e.value)), e.value = c;
28
+ const u = { ...t.value, [n]: e };
29
+ Object.setPrototypeOf(u, Object.getPrototypeOf(t.value)), t.value = u;
33
30
  }
34
31
  else
35
- e.value[n] = t;
32
+ t.value[n] = e;
36
33
  }
37
34
  }));
38
35
  return l;
39
36
  }
40
- const Tt = dt ? window : void 0;
41
- function At(e, o = {}) {
37
+ const q = se, Te = fe ? window : void 0;
38
+ function Ie(t, o = {}) {
42
39
  const {
43
40
  pointerTypes: l,
44
41
  preventDefault: n,
45
- stopPropagation: t,
46
- exact: i,
42
+ stopPropagation: e,
43
+ exact: c,
47
44
  onMove: r,
48
- onEnd: c,
49
- onStart: u,
45
+ onEnd: u,
46
+ onStart: i,
50
47
  initialValue: _,
51
48
  axis: y = "both",
52
- draggingElement: s = Tt,
53
- handle: a = e
54
- } = o, { width: m } = pt();
49
+ draggingElement: s = Te,
50
+ handle: a = t
51
+ } = o, { width: m } = de();
55
52
  let S = m.value;
56
53
  const v = d(
57
- E(_) ?? { x: 0, y: 0 }
54
+ q(_) ?? { x: 0, y: 0 }
58
55
  );
59
- O(m, () => {
56
+ U(m, () => {
60
57
  const g = m.value - S;
61
58
  v.value.x += g, S = m.value;
62
59
  });
63
- const T = d(), D = (g) => l ? l.includes(g.pointerType) : !0, $ = (g) => {
64
- E(n) && g.preventDefault(), E(t) && g.stopPropagation();
65
- }, A = (g) => {
66
- if (!D(g) || E(i) && g.target !== E(e))
60
+ const A = d(), K = (g) => l ? l.includes(g.pointerType) : !0, k = (g) => {
61
+ q(n) && g.preventDefault(), q(e) && g.stopPropagation();
62
+ }, T = (g) => {
63
+ if (!K(g) || q(c) && g.target !== q(t))
67
64
  return;
68
- const b = E(e).getBoundingClientRect(), x = {
65
+ const b = q(t).getBoundingClientRect(), x = {
69
66
  x: g.clientX - b.left,
70
67
  y: g.clientY - b.top
71
68
  };
72
- (u == null ? void 0 : u(x, g)) !== !1 && (T.value = x, $(g));
73
- }, q = (g) => {
74
- if (!D(g) || !T.value)
69
+ (i == null ? void 0 : i(x, g)) !== !1 && (A.value = x, k(g));
70
+ }, E = (g) => {
71
+ if (!K(g) || !A.value)
75
72
  return;
76
73
  let { x: b, y: x } = v.value;
77
- (y === "x" || y === "both") && (b = g.clientX - T.value.x), (y === "y" || y === "both") && (x = g.clientY - T.value.y), v.value = {
74
+ (y === "x" || y === "both") && (b = g.clientX - A.value.x), (y === "y" || y === "both") && (x = g.clientY - A.value.y), v.value = {
78
75
  x: b,
79
76
  y: x
80
- }, r == null || r(v.value, g), $(g);
77
+ }, r == null || r(v.value, g), k(g);
81
78
  }, P = (g) => {
82
- D(g) && T.value && (T.value = void 0, c == null || c(v.value, g), $(g));
79
+ K(g) && A.value && (A.value = void 0, u == null || u(v.value, g), k(g));
83
80
  };
84
- if (dt) {
81
+ if (fe) {
85
82
  const g = { capture: o.capture ?? !0 };
86
- J(a, "pointerdown", A, g), J(s, "pointermove", q, g), J(s, "pointerup", P, g);
83
+ J(a, "pointerdown", T, g), J(s, "pointermove", E, g), J(s, "pointerup", P, g);
87
84
  }
88
85
  return {
89
- ...St(v),
86
+ ...Ae(v),
90
87
  position: v,
91
- isDragging: z(() => !!T.value),
92
- style: z(
88
+ isDragging: V(() => !!A.value),
89
+ style: V(
93
90
  () => `left:${v.value.x}px;top:${v.value.y}px;`
94
91
  )
95
92
  };
96
93
  }
97
- const It = /* @__PURE__ */ k({
94
+ const Ke = /* @__PURE__ */ $({
98
95
  name: "UseDraggable",
99
96
  props: [
100
97
  "storageKey",
@@ -111,81 +108,81 @@ const It = /* @__PURE__ */ k({
111
108
  "onMove",
112
109
  "onEnd"
113
110
  ],
114
- setup(e, { slots: o }) {
115
- const l = d(), n = z(() => e.handle ?? l.value), t = e.storageKey && xt(
116
- e.storageKey,
117
- E(e.initialValue) || { x: 0, y: 0 },
118
- $t ? e.storageType === "session" ? sessionStorage : localStorage : void 0
119
- ), i = t || e.initialValue || { x: 0, y: 0 }, c = N(At(l, {
120
- ...e,
111
+ setup(t, { slots: o }) {
112
+ const l = d(), n = V(() => t.handle ?? l.value), e = t.storageKey && ke(
113
+ t.storageKey,
114
+ q(t.initialValue) || { x: 0, y: 0 },
115
+ $e ? t.storageType === "session" ? sessionStorage : localStorage : void 0
116
+ ), c = e || t.initialValue || { x: 0, y: 0 }, u = N(Ie(l, {
117
+ ...t,
121
118
  handle: n,
122
- initialValue: i,
123
- onEnd: (u, _) => {
119
+ initialValue: c,
120
+ onEnd: (i, _) => {
124
121
  var y;
125
- (y = e.onEnd) == null || y.call(e, u, _), t && (t.value.x = u.x, t.value.y = u.y);
122
+ (y = t.onEnd) == null || y.call(t, i, _), e && (e.value.x = i.x, e.value.y = i.y);
126
123
  }
127
124
  }));
128
125
  return () => {
129
126
  if (o.default)
130
- return mt(e.as || "div", { ref: l, style: `touch-action:none;${c.style}` }, o.default(c));
127
+ return ye(t.as || "div", { ref: l, style: `touch-action:none;${u.style}` }, o.default(u));
131
128
  };
132
129
  }
133
- }), Kt = Symbol("CONTROLS_CONTEXT_KEY"), ft = "default", L = N({});
134
- function Dt(e = ft) {
135
- return yt(Kt, L), L[e];
130
+ }), De = Symbol("CONTROLS_CONTEXT_KEY"), ve = "default", L = N({});
131
+ function Fe(t = ve) {
132
+ return he(De, L), L[t];
136
133
  }
137
- const Q = (e) => {
138
- const o = /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$|^0x([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;
139
- return typeof e == "boolean" ? "boolean" : typeof e == "number" ? "number" : typeof e == "string" && o.test(e) ? "color" : typeof e == "string" ? "string" : e.isVector3 || e.isVector2 || e.isEuler || e.value instanceof Array || e.value.isVector3 || e.value.isVector2 || e.value.isEuler || e.value.value instanceof Array ? "vector" : e.min !== void 0 || e.max !== void 0 || e.step !== void 0 ? "range" : e.options && Array.isArray(e.options) ? "select" : "unknown";
140
- }, Y = (e, o, l, n) => {
141
- const t = {
142
- key: d(e),
143
- label: d(e),
144
- name: d(e),
134
+ const Q = (t) => {
135
+ const o = /^#(?:[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$|^0x(?:[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;
136
+ return typeof t == "boolean" ? "boolean" : typeof t == "number" ? "number" : typeof t == "string" && o.test(t) ? "color" : typeof t == "string" ? "string" : t.isVector3 || t.isVector2 || t.isEuler || Array.isArray(t.value) || t.value.isVector3 || t.value.isVector2 || t.value.isEuler || Array.isArray(t.value.value) ? "vector" : t.min !== void 0 || t.max !== void 0 || t.step !== void 0 ? "range" : t.options && Array.isArray(t.options) ? "select" : "unknown";
137
+ }, Y = (t, o, l, n) => {
138
+ const e = {
139
+ key: d(t),
140
+ label: d(t),
141
+ name: d(t),
145
142
  type: d(l),
146
143
  value: d(o),
147
144
  visible: d(!0),
148
145
  icon: d(),
149
- uniqueKey: d(e),
150
- [e]: d(o)
146
+ uniqueKey: d(t),
147
+ [t]: d(o)
151
148
  };
152
- return n && (t.folder = d(n)), t;
153
- }, De = (e, o, l) => {
154
- const n = {}, t = typeof e == "string" ? e : null, i = t ? o : e, r = t && t !== "fpsgraph" ? l : o, c = (r == null ? void 0 : r.uuid) || ft;
155
- if (L[c] || (L[c] = N({})), e === "fpsgraph") {
149
+ return n && (e.folder = d(n)), e;
150
+ }, It = (t, o, l) => {
151
+ const n = {}, e = typeof t == "string" ? t : null, c = e ? o : t, r = e && e !== "fpsgraph" ? l : o, u = (r == null ? void 0 : r.uuid) || ve;
152
+ if (L[u] || (L[u] = N({})), t === "fpsgraph") {
156
153
  const s = Y("fpsgraph", null, "fpsgraph", null);
157
- return L[c].fpsgraph = s, n.fpsgraph = s, B(N(n));
154
+ return L[u].fpsgraph = s, n.fpsgraph = s, B(N(n));
158
155
  }
159
- const u = L[c], _ = ht(i), y = _ ? B(i) : {};
160
- for (const s in i) {
161
- let a = i[s], m = s;
162
- if (_ && y[s] && (a = y[s]), t && (m = `${t}${s.charAt(0).toUpperCase() + s.slice(1)}`), typeof a == "object" && !G(a) && !Array.isArray(a) && a.value !== void 0) {
163
- const v = a, T = G(v.value) ? v.value : d(v.value), D = v.type || Q(v), $ = Y(s, T, D, t);
164
- D === "select" && ($.options = d(v.options.map((A) => typeof A == "object" && A.text && A.value ? A : {
165
- text: A,
166
- value: A
167
- }))), D === "range" && ($.min = d(v.min || 0), $.max = d(v.max || 1), $.step = d(v.step || 0.1)), $.label.value = v.label || s, $.icon.value = v.icon, $.visible.value = v.visible !== void 0 ? v.visible : !0, $.uniqueKey.value = m, u[m] = $, n[m] = $;
156
+ const i = L[u], _ = _e(c), y = _ ? B(c) : {};
157
+ for (const s in c) {
158
+ let a = c[s], m = s;
159
+ if (_ && y[s] && (a = y[s]), e && (m = `${e}${s.charAt(0).toUpperCase() + s.slice(1)}`), typeof a == "object" && !G(a) && !Array.isArray(a) && a.value !== void 0) {
160
+ const v = a, A = G(v.value) ? v.value : d(v.value), K = v.type || Q(v), k = Y(s, A, K, e);
161
+ K === "select" && (k.options = d(v.options.map((T) => typeof T == "object" && T.text && T.value ? T : {
162
+ text: T,
163
+ value: T
164
+ }))), K === "range" && (k.min = d(v.min || 0), k.max = d(v.max || 1), k.step = d(v.step || 0.1)), k.label.value = v.label || s, k.icon.value = v.icon, k.visible.value = v.visible !== void 0 ? v.visible : !0, k.uniqueKey.value = m, i[m] = k, n[m] = k;
168
165
  continue;
169
166
  }
170
167
  if (G(a)) {
171
- const v = Y(s, a, a.value.type || Q(a.value), t);
172
- u[m] = v, n[m] = v;
168
+ const v = Y(s, a, a.value.type || Q(a.value), e);
169
+ i[m] = v, n[m] = v;
173
170
  continue;
174
171
  } else if (typeof a == "object" && !Array.isArray(a)) {
175
172
  const v = B(a);
176
173
  v[s] && (a = v[s]);
177
174
  }
178
- const S = Y(s, a, a.type || Q(a), t);
179
- u[m] = S, n[m] = S, S.uniqueKey.value = m;
175
+ const S = Y(s, a, a.type || Q(a), e);
176
+ i[m] = S, n[m] = S, S.uniqueKey.value = m;
180
177
  }
181
178
  return Object.keys(n).length > 1 ? B(N(n)) : Object.values(n)[0];
182
- }, Ft = ["for", "title"], R = /* @__PURE__ */ k({
179
+ }, Ve = ["for", "title"], R = /* @__PURE__ */ $({
183
180
  __name: "ControlLabel",
184
181
  props: {
185
182
  label: {},
186
183
  control: {}
187
184
  },
188
- setup(e) {
185
+ setup(t) {
189
186
  return (o, l) => (p(), h("label", {
190
187
  for: o.control.uniqueKey,
191
188
  title: o.label,
@@ -194,35 +191,35 @@ const Q = (e) => {
194
191
  o.control.icon ? (p(), h("i", {
195
192
  key: 0,
196
193
  class: M(o.control.icon)
197
- }, null, 2)) : (p(), h(V, { key: 1 }, [
198
- st(F(o.label), 1)
194
+ }, null, 2)) : (p(), h(O, { key: 1 }, [
195
+ ue(F(o.label), 1)
199
196
  ], 64))
200
- ], 8, Ft));
197
+ ], 8, Ve));
201
198
  }
202
- }), Et = { class: "tl-flex tl-px-4 tl-justify-between tl-gap-4 tl-items-center tl-mb-2" }, Vt = ["id", "value", "min", "max", "step"], zt = /* @__PURE__ */ k({
199
+ }), Ee = { class: "tl-flex tl-px-4 tl-justify-between tl-gap-4 tl-items-center tl-mb-2" }, ze = ["id", "value", "min", "max", "step"], qe = /* @__PURE__ */ $({
203
200
  __name: "NumberControl",
204
201
  props: {
205
202
  label: {},
206
203
  control: {}
207
204
  },
208
205
  emits: ["change"],
209
- setup(e, { emit: o }) {
210
- const l = e, n = o;
211
- function t(s) {
206
+ setup(t, { emit: o }) {
207
+ const l = t, n = o;
208
+ function e(s) {
212
209
  const { target: a } = s;
213
210
  n("change", a.valueAsNumber);
214
211
  }
215
- const i = lt(), r = d(0), c = d(!1), u = (s) => {
216
- r.value = s.clientX, c.value = !0;
212
+ const c = le(), r = d(0), u = d(!1), i = (s) => {
213
+ r.value = s.clientX, u.value = !0;
217
214
  }, _ = () => {
218
- c.value = !1;
215
+ u.value = !1;
219
216
  }, y = (s) => Math.floor(Math.abs(s) / 10);
220
- return O(i.x, (s) => {
221
- if (c.value) {
217
+ return U(c.x, (s) => {
218
+ if (u.value) {
222
219
  const a = s - r.value, m = y(a);
223
220
  a > 0 ? n("change", l.control.value + 1 + m) : a < 0 && n("change", l.control.value - 1 + m), l.control.min !== void 0 && l.control.value < l.control.min && n("change", l.control.min), l.control.max !== void 0 && l.control.value > l.control.max && n("change", l.control.max), r.value = s;
224
221
  }
225
- }), (s, a) => (p(), h("div", Et, [
222
+ }), (s, a) => (p(), h("div", Ee, [
226
223
  X(R, {
227
224
  label: s.label,
228
225
  control: s.control
@@ -230,72 +227,72 @@ const Q = (e) => {
230
227
  f("input", {
231
228
  id: s.control.uniqueKey,
232
229
  value: s.control.value,
233
- class: M(["tl-p-2 tl-w-1/3 tl-rounded tl-text-right tl-text-xs tl-text-gray-400 tl-bg-gray-100 tl-focus:border-gray-200 tl-outline-none tl-border-none tl-font-sans", { "tl-cursor-ew-resize": c.value }]),
230
+ class: M(["tl-p-2 tl-w-1/3 tl-rounded tl-text-right tl-text-xs tl-text-gray-400 tl-bg-gray-100 tl-focus:border-gray-200 tl-outline-none tl-border-none tl-font-sans", { "tl-cursor-ew-resize": u.value }]),
234
231
  type: "number",
235
232
  min: s.control.min,
236
233
  max: s.control.max,
237
234
  step: s.control.step,
238
- onInput: t,
239
- onMousedown: u,
235
+ onInput: e,
236
+ onMousedown: i,
240
237
  onMouseup: _
241
- }, null, 42, Vt)
238
+ }, null, 42, ze)
242
239
  ]));
243
240
  }
244
- }), qt = { class: "tl-flex tl-px-4 tl-justify-between tl-gap-4 tl-items-center tl-mb-2 tl-min-h-32px" }, Ut = ["id", "value", "aria-label"], Ot = /* @__PURE__ */ k({
241
+ }), Ue = { class: "tl-flex tl-px-4 tl-justify-between tl-gap-4 tl-items-center tl-mb-2 tl-min-h-32px" }, Oe = ["id", "value", "aria-label"], Xe = /* @__PURE__ */ $({
245
242
  __name: "TextControl",
246
243
  props: {
247
244
  label: {},
248
245
  control: {}
249
246
  },
250
247
  emits: ["change"],
251
- setup(e, { emit: o }) {
248
+ setup(t, { emit: o }) {
252
249
  const l = o;
253
- function n(t) {
254
- const { target: i } = t;
255
- l("change", i.value);
250
+ function n(e) {
251
+ const { target: c } = e;
252
+ l("change", c.value);
256
253
  }
257
- return (t, i) => (p(), h("div", qt, [
254
+ return (e, c) => (p(), h("div", Ue, [
258
255
  X(R, {
259
- label: t.label,
260
- control: t.control
256
+ label: e.label,
257
+ control: e.control
261
258
  }, null, 8, ["label", "control"]),
262
259
  f("input", {
263
- id: t.control.uniqueKey,
264
- value: t.control.value,
260
+ id: e.control.uniqueKey,
261
+ value: e.control.value,
265
262
  type: "text",
266
263
  tabindex: "0",
267
264
  class: "tl-p-2 tl-w-2/3 tl-rounded tl-text-right tl-text-xs tl-text-gray-400 tl-bg-gray-100 focus:tl-border-gray-200 tl-border-none tl-font-sans",
268
- "aria-label": t.label,
265
+ "aria-label": e.label,
269
266
  placeholder: "Enter value here...",
270
267
  onChange: n
271
- }, null, 40, Ut)
268
+ }, null, 40, Oe)
272
269
  ]));
273
270
  }
274
- }), Xt = { class: "tl-flex tl-px-4 tl-justify-start tl-gap-2 tl-items-center tl-mb-2 tl-min-h-32px" }, Bt = { class: "tl-text-gray-500 tl-w-1/3" }, Lt = ["id", "checked"], Pt = ["for"], Wt = ["aria-checked"], Nt = { class: "i-ic:baseline-check tl-text-light" }, jt = /* @__PURE__ */ k({
271
+ }), Be = { class: "tl-flex tl-px-4 tl-justify-start tl-gap-2 tl-items-center tl-mb-2 tl-min-h-32px" }, Le = { class: "tl-text-gray-500 tl-w-1/3" }, Pe = ["id", "checked"], We = ["for"], Ne = ["aria-checked"], je = { class: "i-ic:baseline-check tl-text-light" }, Re = /* @__PURE__ */ $({
275
272
  __name: "BooleanControl",
276
273
  props: {
277
274
  label: {},
278
275
  control: {}
279
276
  },
280
277
  emits: ["change"],
281
- setup(e, { emit: o }) {
282
- const l = e, n = o;
283
- function t(r) {
284
- const { target: c } = r;
285
- n("change", c.checked);
278
+ setup(t, { emit: o }) {
279
+ const l = t, n = o;
280
+ function e(r) {
281
+ const { target: u } = r;
282
+ n("change", u.checked);
286
283
  }
287
- function i(r) {
284
+ function c(r) {
288
285
  (r.code === "Space" || r.code === "Enter") && (r.preventDefault(), n("change", !l.control.value));
289
286
  }
290
- return (r, c) => (p(), h("div", Xt, [
291
- f("label", Bt, F(r.label), 1),
287
+ return (r, u) => (p(), h("div", Be, [
288
+ f("label", Le, F(r.label), 1),
292
289
  f("input", {
293
290
  id: r.control.uniqueKey,
294
291
  checked: r.control.value,
295
292
  class: "tl-hidden",
296
293
  type: "checkbox",
297
- onInput: t
298
- }, null, 40, Lt),
294
+ onInput: e
295
+ }, null, 40, Pe),
299
296
  f("label", {
300
297
  for: r.control.uniqueKey,
301
298
  class: "tl-inline-flex tl-items-center tl-cursor-pointer"
@@ -305,41 +302,41 @@ const Q = (e) => {
305
302
  role: "checkbox",
306
303
  "aria-checked": r.control.value.toString(),
307
304
  class: M([{ "tl-bg-dark-500": r.control.value, "tl-bg-gray-200": !r.control.value }, "tl-w-4 tl-h-4 tl-flex tl-justify-center tl-items-center tl-rounded tl-border tl-border-gray-300 tl-mr-2 tl-transition-colors tl-duration-200"]),
308
- onKeydown: i
305
+ onKeydown: c
309
306
  }, [
310
- ct(f("i", Nt, null, 512), [
311
- [it, r.control.value]
307
+ ce(f("i", je, null, 512), [
308
+ [ie, r.control.value]
312
309
  ])
313
- ], 42, Wt)
314
- ], 8, Pt)
310
+ ], 42, Ne)
311
+ ], 8, We)
315
312
  ]));
316
313
  }
317
- }), Rt = { class: "tl-px-4 tl-relative tl-flex tl-justify-between tl-gap-4 tl-items-center tl-mb-2" }, Yt = ["value", "min", "max", "step"], Gt = ["value", "min", "max", "step"], Ht = /* @__PURE__ */ k({
314
+ }), Ye = { class: "tl-px-4 tl-relative tl-flex tl-justify-between tl-gap-4 tl-items-center tl-mb-2" }, Ge = ["value", "min", "max", "step"], He = ["value", "min", "max", "step"], Je = /* @__PURE__ */ $({
318
315
  __name: "SliderControl",
319
316
  props: {
320
317
  label: {},
321
318
  control: {}
322
319
  },
323
320
  emits: ["change"],
324
- setup(e, { emit: o }) {
325
- const l = e, n = o;
326
- function t(a) {
321
+ setup(t, { emit: o }) {
322
+ const l = t, n = o;
323
+ function e(a) {
327
324
  const { target: m } = a;
328
325
  n("change", m.valueAsNumber);
329
326
  }
330
- const i = z(() => ({
327
+ const c = V(() => ({
331
328
  backgroundImage: `linear-gradient(to right, #333 0% ${100 * (l.control.value - (l.control.min || 0)) / ((l.control.max || 100) - (l.control.min || 0))}%, #e2e2e2 0%)`
332
- })), r = lt(), c = d(0), u = d(!1), _ = (a) => {
333
- c.value = a.clientX, u.value = !0;
329
+ })), r = le(), u = d(0), i = d(!1), _ = (a) => {
330
+ u.value = a.clientX, i.value = !0;
334
331
  }, y = () => {
335
- u.value = !1;
332
+ i.value = !1;
336
333
  }, s = (a) => Math.floor(Math.abs(a) / 10);
337
- return O(r.x, (a) => {
338
- if (u.value) {
339
- const m = a - c.value, S = s(m);
340
- m > 0 ? n("change", l.control.value + 1 + S) : m < 0 && n("change", l.control.value - 1 + S), l.control.min !== void 0 && l.control.value < l.control.min && n("change", l.control.min), l.control.max !== void 0 && l.control.value > l.control.max && n("change", l.control.max), c.value = a;
334
+ return U(r.x, (a) => {
335
+ if (i.value) {
336
+ const m = a - u.value, S = s(m);
337
+ m > 0 ? n("change", l.control.value + 1 + S) : m < 0 && n("change", l.control.value - 1 + S), l.control.min !== void 0 && l.control.value < l.control.min && n("change", l.control.min), l.control.max !== void 0 && l.control.value > l.control.max && n("change", l.control.max), u.value = a;
341
338
  }
342
- }), (a, m) => (p(), h("div", Rt, [
339
+ }), (a, m) => (p(), h("div", Ye, [
343
340
  X(R, {
344
341
  label: a.label,
345
342
  control: a.control
@@ -347,101 +344,101 @@ const Q = (e) => {
347
344
  f("input", {
348
345
  value: a.control.value,
349
346
  class: "tl-w-1/2 tl-h-0.75 tl-bg-dark-200 tl-rounded-full tl-appearance-none",
350
- style: _t(i.value),
347
+ style: we(c.value),
351
348
  type: "range",
352
349
  min: a.control.min,
353
350
  max: a.control.max,
354
351
  step: a.control.step,
355
- onInput: t
356
- }, null, 44, Yt),
352
+ onInput: e
353
+ }, null, 44, Ge),
357
354
  f("input", {
358
355
  value: a.control.value,
359
- class: M(["tl-p-2 tl-w-1/4 tl-rounded tl-text-right tl-text-xs tl-text-gray-400 tl-bg-gray-100 tl-focus:border-gray-200 tl-outline-none tl-border-none tl-font-sans", { "tl-cursor-ew-resize": u.value }]),
356
+ class: M(["tl-p-2 tl-w-1/4 tl-rounded tl-text-right tl-text-xs tl-text-gray-400 tl-bg-gray-100 tl-focus:border-gray-200 tl-outline-none tl-border-none tl-font-sans", { "tl-cursor-ew-resize": i.value }]),
360
357
  type: "number",
361
358
  min: a.control.min,
362
359
  max: a.control.max,
363
360
  step: a.control.step,
364
- onInput: t,
361
+ onInput: e,
365
362
  onMousedown: _,
366
363
  onMouseup: y
367
- }, null, 42, Gt)
364
+ }, null, 42, He)
368
365
  ]));
369
366
  }
370
- }), vt = (e, o) => {
371
- const l = e.__vccOpts || e;
372
- for (const [n, t] of o)
373
- l[n] = t;
367
+ }), be = (t, o) => {
368
+ const l = t.__vccOpts || t;
369
+ for (const [n, e] of o)
370
+ l[n] = e;
374
371
  return l;
375
- }, Jt = /* @__PURE__ */ vt(Ht, [["__scopeId", "data-v-e775088a"]]), Qt = { class: "tl-flex tl-px-4 tl-justify-between tl-gap-4 tl-items-center tl-mb-2" }, Zt = { class: "tl-text-gray-500 tl-w-1/3" }, te = ["id", "value", "aria-label"], ee = ["id", "aria-label", "value"], le = /* @__PURE__ */ k({
372
+ }, Qe = /* @__PURE__ */ be(Je, [["__scopeId", "data-v-207d19a7"]]), Ze = { class: "tl-flex tl-px-4 tl-justify-between tl-gap-4 tl-items-center tl-mb-2" }, et = { class: "tl-text-gray-500 tl-w-1/3" }, tt = ["id", "value", "aria-label"], lt = ["id", "aria-label", "value"], nt = /* @__PURE__ */ $({
376
373
  __name: "ColorControl",
377
374
  props: {
378
375
  label: {},
379
376
  control: {}
380
377
  },
381
378
  emits: ["change"],
382
- setup(e, { emit: o }) {
379
+ setup(t, { emit: o }) {
383
380
  const l = o;
384
- function n(t) {
385
- const { target: i } = t;
386
- l("change", i.value);
381
+ function n(e) {
382
+ const { target: c } = e;
383
+ l("change", c.value);
387
384
  }
388
- return (t, i) => (p(), h("div", Qt, [
389
- f("label", Zt, F(t.label), 1),
385
+ return (e, c) => (p(), h("div", Ze, [
386
+ f("label", et, F(e.label), 1),
390
387
  f("input", {
391
- id: t.control.uniqueKey,
388
+ id: e.control.uniqueKey,
392
389
  tabindex: "0",
393
- value: t.control.value,
394
- "aria-label": t.label,
395
- class: M(["focus:tl-outline-none focus:tl-ring-2 focus:tl-ring-blue-600", { "important-tl-outline-gray-200": t.control.value === "#ffffff" }]),
390
+ value: e.control.value,
391
+ "aria-label": e.label,
392
+ class: M(["focus:tl-outline-none focus:tl-ring-2 focus:tl-ring-blue-600", { "important-tl-outline-gray-200": e.control.value === "#ffffff" }]),
396
393
  type: "color",
397
394
  onInput: n
398
- }, null, 42, te),
395
+ }, null, 42, tt),
399
396
  f("input", {
400
- id: t.control.uniqueKey,
397
+ id: e.control.uniqueKey,
401
398
  tabindex: "0",
402
- "aria-label": t.label,
403
- value: t.control.value,
399
+ "aria-label": e.label,
400
+ value: e.control.value,
404
401
  class: "tl-p-2 tl-w-2/3 tl-rounded tl-text-right tl-text-xs tl-text-gray-400 tl-bg-gray-100 tl-border-none tl-font-sans",
405
402
  type: "text",
406
403
  onInput: n
407
- }, null, 40, ee)
404
+ }, null, 40, lt)
408
405
  ]));
409
406
  }
410
407
  });
411
- function ne(e) {
412
- if (typeof e == "number")
413
- return [e, e, e];
414
- if (et(e)) {
415
- const { x: o, y: l, z: n } = e;
408
+ function ee(t) {
409
+ return t && typeof t.x == "number" && typeof t.y == "number";
410
+ }
411
+ function te(t) {
412
+ return t && typeof t.x == "number" && typeof t.y == "number" && typeof t.z == "number";
413
+ }
414
+ function ot(t) {
415
+ if (typeof t == "number")
416
+ return [t, t, t];
417
+ if (te(t)) {
418
+ const { x: o, y: l, z: n } = t;
416
419
  return [o, l, n];
417
420
  }
418
- if (tt(e)) {
419
- const { x: o, y: l } = e;
421
+ if (ee(t)) {
422
+ const { x: o, y: l } = t;
420
423
  return [o, l];
421
424
  }
422
- return e;
423
- }
424
- function tt(e) {
425
- return e && typeof e.x == "number" && typeof e.y == "number";
426
- }
427
- function et(e) {
428
- return e && typeof e.x == "number" && typeof e.y == "number" && typeof e.z == "number";
425
+ return t;
429
426
  }
430
- const oe = { class: "tl-relative tl-w-2/3 tl-flex tl-justify-between tl-gap-0.5" }, ae = {
427
+ const at = { class: "tl-relative tl-w-2/3 tl-flex tl-justify-between tl-gap-0.5" }, rt = {
431
428
  key: 0,
432
429
  class: "tl-font-bold tl-px-1 tl-py-1 tl-text-0.65rem tl-text-gray-300"
433
- }, re = ["id", "step", "value", "onInput", "onMousedown", "onMouseup", "onFocus"], se = /* @__PURE__ */ k({
430
+ }, st = ["id", "step", "value", "onInput", "onMousedown", "onMouseup", "onFocus"], ut = /* @__PURE__ */ $({
434
431
  __name: "VectorControl",
435
432
  props: {
436
433
  label: {},
437
434
  control: {}
438
435
  },
439
436
  emits: ["change"],
440
- setup(e, { emit: o }) {
441
- const l = e, n = o, t = lt(), { pressed: i } = kt(), r = d(0), c = d(!1), u = d(0), _ = d(null), y = d(1), s = nt("Shift"), a = nt("Alt");
442
- O(s, (b) => {
437
+ setup(t, { emit: o }) {
438
+ const l = t, n = o, e = le(), { pressed: c } = Ce(), r = d(0), u = d(!1), i = d(0), _ = d(null), y = d(1), s = ne("Shift"), a = ne("Alt");
439
+ U(s, (b) => {
443
440
  y.value = b ? 10 : 1;
444
- }), O(a, (b) => {
441
+ }), U(a, (b) => {
445
442
  y.value = b ? 0.1 : 1;
446
443
  });
447
444
  const m = (b) => {
@@ -449,78 +446,78 @@ const oe = { class: "tl-relative tl-w-2/3 tl-flex tl-justify-between tl-gap-0.5"
449
446
  }, S = () => {
450
447
  _.value = null;
451
448
  }, v = (b, x) => {
452
- u.value = x, r.value = b.clientX, c.value = !0;
453
- }, T = (b, x) => {
454
- u.value = x, c.value = !1;
455
- }, D = () => {
456
- c.value = !1;
449
+ i.value = x, r.value = b.clientX, u.value = !0;
450
+ }, A = (b, x) => {
451
+ i.value = x, u.value = !1;
452
+ }, K = () => {
453
+ u.value = !1;
457
454
  };
458
- O(i, (b) => {
459
- b || (c.value = !1);
455
+ U(c, (b) => {
456
+ b || (u.value = !1);
460
457
  });
461
- const $ = (b) => Math.floor(Math.abs(b) / 10), A = z(() => ne(l.control.value)), q = d(["x", "y", "z"]), P = z(() => tt(l.control.value) || et(l.control.value));
458
+ const k = (b) => Math.floor(Math.abs(b) / 10), T = V(() => ot(l.control.value)), E = d(["x", "y", "z"]), P = V(() => ee(l.control.value) || te(l.control.value));
462
459
  function g(b, x) {
463
- const { value: U } = l.control, { target: w } = b;
464
- u.value = x, U[P.value ? q.value[u.value] : u.value] = parseFloat(w.value), n("change", U);
460
+ const { value: z } = l.control, { target: w } = b;
461
+ i.value = x, z[P.value ? E.value[i.value] : i.value] = Number.parseFloat(w.value), n("change", z);
465
462
  }
466
- return O(t.x, (b) => {
467
- if (c.value) {
468
- const x = b - r.value, U = $(x), { value: w } = l.control, I = P.value ? q.value[u.value] : u.value;
469
- x > 0 ? w[I] += y.value + U : x < 0 && (w[I] -= y.value + U), l.control.min !== void 0 && w < l.control.min && (w[I] = l.control.min), l.control.max !== void 0 && w > l.control.max && (w[I] = l.control.max), n("change", w), r.value = b;
463
+ return U(e.x, (b) => {
464
+ if (u.value) {
465
+ const x = b - r.value, z = k(x), { value: w } = l.control, I = P.value ? E.value[i.value] : i.value;
466
+ x > 0 ? w[I] += y.value + z : x < 0 && (w[I] -= y.value + z), l.control.min !== void 0 && w < l.control.min && (w[I] = l.control.min), l.control.max !== void 0 && w > l.control.max && (w[I] = l.control.max), n("change", w), r.value = b;
470
467
  }
471
468
  }), (b, x) => (p(), h("div", {
472
469
  class: "tl-flex tl-px-4 tl-justify-between tl-gap-1 tl-items-center tl-mb-2",
473
- onMouseup: x[0] || (x[0] = (U) => D())
470
+ onMouseup: x[0] || (x[0] = (z) => K())
474
471
  }, [
475
472
  X(R, {
476
473
  label: b.label,
477
474
  control: b.control
478
475
  }, null, 8, ["label", "control"]),
479
- f("div", oe, [
480
- (p(!0), h(V, null, j(A.value, (U, w) => (p(), h("div", {
476
+ f("div", at, [
477
+ (p(!0), h(O, null, j(T.value, (z, w) => (p(), h("div", {
481
478
  key: b.label + w,
482
479
  class: M(["tl-flex tl-items-center tl-bg-gray-100 tl-rounded", {
483
480
  "tl-w-2/5": _.value === w,
484
- "tl-w-1/3": K(et)(b.control.value),
485
- "tl-w-1/2": K(tt)(b.control.value)
481
+ "tl-w-1/3": D(te)(b.control.value),
482
+ "tl-w-1/2": D(ee)(b.control.value)
486
483
  }])
487
484
  }, [
488
- q.value[w] && P.value ? (p(), h("span", ae, F(q.value[w]), 1)) : H("", !0),
485
+ E.value[w] && P.value ? (p(), h("span", rt, F(E.value[w]), 1)) : H("", !0),
489
486
  f("input", {
490
- id: `${b.control.uniqueKey}-${q.value[w]}`,
487
+ id: `${b.control.uniqueKey}-${E.value[w]}`,
491
488
  type: "number",
492
489
  step: y.value,
493
- class: M(["tl-w-full tl-px-0 tl-p-1 tl-text-right tl-text-0.65rem tl-text-gray-400 tl-bg-transparent focus:tl-border-gray-200 tl-outline-none tl-border-none tl-font-sans tl-appearence-none", { "tl-cursor-ew-resize": c.value }]),
494
- value: A.value[w].toFixed(2),
490
+ class: M(["tl-w-full tl-px-0 tl-p-1 tl-text-right tl-text-0.65rem tl-text-gray-400 tl-bg-transparent focus:tl-border-gray-200 tl-outline-none tl-border-none tl-font-sans tl-appearence-none", { "tl-cursor-ew-resize": u.value }]),
491
+ value: T.value[w].toFixed(2),
495
492
  onInput: (I) => g(I, w),
496
493
  onMousedown: (I) => v(I, w),
497
- onMouseup: (I) => T(I, w),
494
+ onMouseup: (I) => A(I, w),
498
495
  onFocus: (I) => m(w),
499
496
  onBlur: S
500
- }, null, 42, re)
497
+ }, null, 42, st)
501
498
  ], 2))), 128))
502
499
  ])
503
500
  ], 32));
504
501
  }
505
- }), ce = { class: "tl-flex tl-px-4 tl-justify-between tl-gap-4 tl-items-center tl-mb-2" }, ie = { class: "tl-text-gray-500 tl-w-1/3" }, ue = { class: "tl-relative tl-w-2/3 tl-p-1 tl-rounded tl-text-right tl-text-xs tl-text-gray-400 tl-bg-gray-100 tl-focus:border-gray-200 tl-outline-none tl-border-none tl-font-sans" }, pe = { class: "tl-absolute tl-bottom-0.5 tl-right-0.5 tl-font-sans tl-text-xs" }, de = ["points"], ot = 160, Z = 40, W = 2, at = 100, rt = 20, fe = /* @__PURE__ */ k({
502
+ }), ct = { class: "tl-flex tl-px-4 tl-justify-between tl-gap-4 tl-items-center tl-mb-2" }, it = { class: "tl-text-gray-500 tl-w-1/3" }, pt = { class: "tl-relative tl-w-2/3 tl-p-1 tl-rounded tl-text-right tl-text-xs tl-text-gray-400 tl-bg-gray-100 tl-focus:border-gray-200 tl-outline-none tl-border-none tl-font-sans" }, dt = { class: "tl-absolute tl-bottom-0.5 tl-right-0.5 tl-font-sans tl-text-xs" }, ft = ["points"], oe = 160, Z = 40, W = 2, ae = 100, re = 20, vt = /* @__PURE__ */ $({
506
503
  __name: "FPSGraph",
507
504
  props: {
508
505
  label: {},
509
506
  control: {}
510
507
  },
511
- setup(e) {
512
- const o = Ct({ every: at }), l = d(""), n = d([]), t = d(ot / W);
513
- let i = performance.now();
514
- return Mt(({ timestamp: r }) => {
515
- r - i >= at && (i = r, n.value.push(o.value), n.value.length > t.value && n.value.shift(), l.value = n.value.map(
516
- (c, u) => `${u * W},${Z + rt - W / 2 - c * (Z + rt - W) / 120}`
508
+ setup(t) {
509
+ const o = Me({ every: ae }), l = d(""), n = d([]), e = d(oe / W);
510
+ let c = performance.now();
511
+ return Se(({ timestamp: r }) => {
512
+ r - c >= ae && (c = r, n.value.push(o.value), n.value.length > e.value && n.value.shift(), l.value = n.value.map(
513
+ (u, i) => `${i * W},${Z + re - W / 2 - u * (Z + re - W) / 120}`
517
514
  ).join(" "));
518
- }), (r, c) => (p(), h("div", ce, [
519
- f("label", ie, F(r.label), 1),
520
- f("div", ue, [
521
- f("div", pe, F(Math.round(K(o))) + " FPS ", 1),
515
+ }), (r, u) => (p(), h("div", ct, [
516
+ f("label", it, F(r.label), 1),
517
+ f("div", pt, [
518
+ f("div", dt, F(Math.round(D(o))) + " FPS ", 1),
522
519
  (p(), h("svg", {
523
- width: ot,
520
+ width: oe,
524
521
  height: Z,
525
522
  xmlns: "http://www.w3.org/2000/svg",
526
523
  class: "tl-bg-gray-100"
@@ -532,226 +529,226 @@ const oe = { class: "tl-relative tl-w-2/3 tl-flex tl-justify-between tl-gap-0.5"
532
529
  "stroke-width": W,
533
530
  "stroke-linecap": "round",
534
531
  "stroke-linejoin": "round"
535
- }, null, 8, de)
532
+ }, null, 8, ft)
536
533
  ]))
537
534
  ])
538
535
  ]));
539
536
  }
540
- }), ve = { class: "tl-flex tl-px-4 tl-justify-between tl-gap-4 tl-items-center tl-mb-2 tl-min-h-32px" }, be = ["id", "value"], ge = ["value"], me = /* @__PURE__ */ k({
537
+ }), bt = { class: "tl-flex tl-px-4 tl-justify-between tl-gap-4 tl-items-center tl-mb-2 tl-min-h-32px" }, gt = ["id", "value"], mt = ["value"], yt = /* @__PURE__ */ $({
541
538
  __name: "SelectControl",
542
539
  props: {
543
540
  label: {},
544
541
  control: {}
545
542
  },
546
543
  emits: ["change"],
547
- setup(e, { emit: o }) {
544
+ setup(t, { emit: o }) {
548
545
  const l = o;
549
- function n(t) {
550
- l("change", t.target.value);
546
+ function n(e) {
547
+ l("change", e.target.value);
551
548
  }
552
- return (t, i) => (p(), h("div", ve, [
549
+ return (e, c) => (p(), h("div", bt, [
553
550
  X(R, {
554
- label: t.label,
555
- control: t.control
551
+ label: e.label,
552
+ control: e.control
556
553
  }, null, 8, ["label", "control"]),
557
554
  f("select", {
558
- id: t.control.uniqueKey,
559
- value: t.control.value,
555
+ id: e.control.uniqueKey,
556
+ value: e.control.value,
560
557
  class: "tl-p-2 tl-w-2/3 tl-rounded tl-text-left tl-text-xs tl-text-gray-400 tl-bg-gray-100 focus:tl-border-gray-200 tl-outline-none tl-border-none tl-font-sans",
561
558
  onChange: n
562
559
  }, [
563
- (p(!0), h(V, null, j(t.control.options, (r) => (p(), h("option", {
560
+ (p(!0), h(O, null, j(e.control.options, (r) => (p(), h("option", {
564
561
  key: r.value,
565
562
  value: r.value
566
- }, F(r.text), 9, ge))), 128))
567
- ], 40, be)
563
+ }, F(r.text), 9, mt))), 128))
564
+ ], 40, gt)
568
565
  ]));
569
566
  }
570
- }), ye = /* @__PURE__ */ k({
567
+ }), ht = /* @__PURE__ */ $({
571
568
  __name: "ButtonControl",
572
569
  props: {
573
570
  label: {},
574
571
  control: {}
575
572
  },
576
- setup(e) {
577
- const o = e, l = z(() => {
578
- const n = "leches-btn", t = `leches-btn-${o.control.value.variant || "primary"}`, i = `leches-btn-${o.control.value.size || "sm"}`;
579
- return [n, t, i];
573
+ setup(t) {
574
+ const o = t, l = V(() => {
575
+ const n = "leches-btn", e = `leches-btn-${o.control.value.variant || "primary"}`, c = `leches-btn-${o.control.value.size || "sm"}`;
576
+ return [n, e, c];
580
577
  });
581
- return (n, t) => (p(), h("button", {
578
+ return (n, e) => (p(), h("button", {
582
579
  class: M(l.value),
583
- onClick: t[0] || (t[0] = //@ts-ignore
584
- (...i) => n.control.value.onClick && n.control.value.onClick(...i))
580
+ onClick: e[0] || (e[0] = //@ts-ignore
581
+ (...c) => n.control.value.onClick && n.control.value.onClick(...c))
585
582
  }, [
586
583
  f("i", {
587
584
  class: M([n.control.value.icon, n.control.value.label ? "mr-1" : ""])
588
585
  }, null, 2),
589
- st(" " + F(n.control.value.label), 1)
586
+ ue(" " + F(n.control.value.label), 1)
590
587
  ], 2));
591
588
  }
592
- }), he = /* @__PURE__ */ vt(ye, [["__scopeId", "data-v-6a95ac59"]]), bt = /* @__PURE__ */ k({
589
+ }), _t = /* @__PURE__ */ be(ht, [["__scopeId", "data-v-926dfadc"]]), wt = { key: 0 }, ge = /* @__PURE__ */ $({
593
590
  __name: "ControlInput",
594
591
  props: {
595
592
  control: {}
596
593
  },
597
594
  emits: ["change"],
598
- setup(e, { emit: o }) {
595
+ setup(t, { emit: o }) {
599
596
  const l = o;
600
- function n(t) {
601
- l("change", t);
597
+ function n(e) {
598
+ l("change", e);
602
599
  }
603
- return (t, i) => t.control.visible ? (p(), h(V, { key: 0 }, [
604
- t.control.type === "color" ? (p(), C(le, {
600
+ return (e, c) => e.control.visible ? (p(), h("div", wt, [
601
+ e.control.type === "color" ? (p(), C(nt, {
605
602
  key: 0,
606
- label: t.control.label,
607
- control: t.control,
603
+ label: e.control.label,
604
+ control: e.control,
608
605
  onChange: n
609
- }, null, 8, ["label", "control"])) : t.control.type === "select" ? (p(), C(me, {
606
+ }, null, 8, ["label", "control"])) : e.control.type === "select" ? (p(), C(yt, {
610
607
  key: 1,
611
- label: t.control.label,
612
- control: t.control,
608
+ label: e.control.label,
609
+ control: e.control,
613
610
  onChange: n
614
- }, null, 8, ["label", "control"])) : t.control.type === "vector" ? (p(), C(se, {
611
+ }, null, 8, ["label", "control"])) : e.control.type === "vector" ? (p(), C(ut, {
615
612
  key: 2,
616
- label: t.control.label,
617
- control: t.control,
613
+ label: e.control.label,
614
+ control: e.control,
618
615
  onChange: n
619
- }, null, 8, ["label", "control"])) : t.control.type === "boolean" ? (p(), C(jt, {
616
+ }, null, 8, ["label", "control"])) : e.control.type === "boolean" ? (p(), C(Re, {
620
617
  key: 3,
621
- label: t.control.label,
622
- control: t.control,
618
+ label: e.control.label,
619
+ control: e.control,
623
620
  onChange: n
624
- }, null, 8, ["label", "control"])) : t.control.type === "fpsgraph" ? (p(), C(fe, {
621
+ }, null, 8, ["label", "control"])) : e.control.type === "fpsgraph" ? (p(), C(vt, {
625
622
  key: 4,
626
- label: t.control.label,
627
- control: t.control
628
- }, null, 8, ["label", "control"])) : t.control.type === "number" ? (p(), C(zt, {
623
+ label: e.control.label,
624
+ control: e.control
625
+ }, null, 8, ["label", "control"])) : e.control.type === "number" ? (p(), C(qe, {
629
626
  key: 5,
630
- label: t.control.label,
631
- control: t.control,
627
+ label: e.control.label,
628
+ control: e.control,
632
629
  onChange: n
633
- }, null, 8, ["label", "control"])) : t.control.type === "range" ? (p(), C(Jt, {
630
+ }, null, 8, ["label", "control"])) : e.control.type === "range" ? (p(), C(Qe, {
634
631
  key: 6,
635
- label: t.control.label,
636
- control: t.control,
632
+ label: e.control.label,
633
+ control: e.control,
637
634
  onChange: n
638
- }, null, 8, ["label", "control"])) : t.control.type === "button" ? (p(), h("div", {
635
+ }, null, 8, ["label", "control"])) : e.control.type === "button" ? (p(), h("div", {
639
636
  key: 7,
640
- class: M(["tl-p-2", t.control.value.size === "tl-block" ? "tl-flex" : "tl-inline-flex"])
637
+ class: M(["tl-p-2", e.control.value.size === "tl-block" ? "tl-flex" : "tl-inline-flex"])
641
638
  }, [
642
- X(he, {
643
- label: t.control.label,
644
- control: t.control
639
+ X(_t, {
640
+ label: e.control.label,
641
+ control: e.control
645
642
  }, null, 8, ["label", "control"])
646
- ], 2)) : (p(), C(Ot, {
643
+ ], 2)) : (p(), C(Xe, {
647
644
  key: 8,
648
- label: t.control.label,
649
- control: t.control,
645
+ label: e.control.label,
646
+ control: e.control,
650
647
  onChange: n
651
648
  }, null, 8, ["label", "control"]))
652
- ], 64)) : H("", !0);
649
+ ])) : H("", !0);
653
650
  }
654
- }), _e = { class: "tl-mb-4" }, we = ["aria-expanded", "data-folder"], xe = {
651
+ }), xt = { class: "tl-mb-4" }, kt = ["aria-expanded", "data-folder"], $t = {
655
652
  class: "tl-bg-white tl-rounded-b tl-pt-4",
656
653
  role: "menu"
657
- }, $e = /* @__PURE__ */ k({
654
+ }, Ct = /* @__PURE__ */ $({
658
655
  __name: "Folder",
659
656
  props: {
660
657
  controls: {},
661
658
  label: {}
662
659
  },
663
- setup(e) {
664
- function o(t, i) {
665
- i.value = t;
660
+ setup(t) {
661
+ function o(e, c) {
662
+ c.value = e;
666
663
  }
667
664
  const l = d(!1), n = () => {
668
665
  l.value = !l.value;
669
666
  };
670
- return (t, i) => (p(), h("div", _e, [
667
+ return (e, c) => (p(), h("div", xt, [
671
668
  f("button", {
672
669
  class: "tl-flex tl-items-center tl-justify-between tl-w-full tl-py-2 tl-px-4 tl-bg-gray-100 tl-border-none tl-text-gray-400 tl-font-bold tl-text-xs tl-font-sans tl-cursor-pointer",
673
670
  "aria-expanded": l.value,
674
671
  "aria-haspopup": "true",
675
672
  role: "button",
676
- "data-folder": t.label,
673
+ "data-folder": e.label,
677
674
  tabindex: "0",
678
675
  onClick: n
679
676
  }, [
680
- f("span", null, F(t.label), 1),
677
+ f("span", null, F(e.label), 1),
681
678
  f("i", {
682
679
  class: M(l.value ? "i-ic:baseline-keyboard-arrow-up" : "i-ic:baseline-keyboard-arrow-down")
683
680
  }, null, 2)
684
- ], 8, we),
685
- X(wt, {
681
+ ], 8, kt),
682
+ X(xe, {
686
683
  name: "slide",
687
684
  "enter-active-class": "tl-animate-fade-in tl-animate-duration-200 tl-animate-ease-in-out",
688
685
  "leave-active-class": "tl-animate-fade-out tl-animate-duration-200 tl-animate-ease-in-out"
689
686
  }, {
690
- default: ut(() => [
691
- ct(f("div", xe, [
692
- (p(!0), h(V, null, j(t.controls, (r) => (p(), C(bt, {
687
+ default: pe(() => [
688
+ ce(f("div", $t, [
689
+ (p(!0), h(O, null, j(e.controls, (r) => (p(), C(ge, {
693
690
  key: r.label,
694
691
  control: r,
695
692
  role: "menuitem",
696
- onChange: (c) => o(c, r)
693
+ onChange: (u) => o(u, r)
697
694
  }, null, 8, ["control", "onChange"]))), 128))
698
695
  ], 512), [
699
- [it, l.value]
696
+ [ie, l.value]
700
697
  ])
701
698
  ]),
702
699
  _: 1
703
700
  })
704
701
  ]));
705
702
  }
706
- }), ke = {
703
+ }), Mt = {
707
704
  tabindex: "0",
708
705
  class: "tl-bg-white tl-shadow-xl tl-rounded tl-border-4 tl-border-solid tl-border-black"
709
- }, Ce = /* @__PURE__ */ f("i", { class: "tl-h-4 tl-w-4 tl-p-1.5 tl-flex tl-items-center tl-line-height-0 tl-rounded-full tl-bg-gray-100 tl-text-xs" }, "🍰", -1), Me = /* @__PURE__ */ f("div", null, [
710
- /* @__PURE__ */ f("i", { class: "i-ic-baseline-drag-indicator" }),
711
- /* @__PURE__ */ f("i", { class: "i-ic-baseline-drag-indicator" }),
712
- /* @__PURE__ */ f("i", { class: "i-ic-baseline-drag-indicator" })
713
- ], -1), Se = /* @__PURE__ */ f("div", null, null, -1), Te = [
714
- Ce,
715
- Me,
716
- Se
717
- ], Ae = 280, Fe = /* @__PURE__ */ k({
706
+ }, St = 280, Kt = /* @__PURE__ */ $({
718
707
  __name: "TresLeches",
719
708
  props: {
720
709
  uuid: {}
721
710
  },
722
- setup(e) {
723
- const o = e, { uuid: l } = B(o), { width: n } = pt(), t = d(null), i = Dt(l == null ? void 0 : l.value);
724
- function r(u, _) {
725
- i[K(u)].value = _, i[K(u)][K(u)] = _;
711
+ setup(t) {
712
+ const o = t, { uuid: l } = B(o), { width: n } = de(), e = d(null), c = Fe(l == null ? void 0 : l.value);
713
+ function r(i, _) {
714
+ c[D(i)].value = _, c[D(i)][D(i)] = _;
726
715
  }
727
- const c = z(() => {
728
- const u = {};
729
- for (const _ in i) {
730
- const y = i[_], s = y.folder || "default";
731
- u[s] || (u[s] = []), u[s].push(y);
716
+ const u = V(() => {
717
+ const i = {};
718
+ for (const _ in c) {
719
+ const y = c[_], s = y.folder || "default";
720
+ i[s] || (i[s] = []), i[s].push(y);
732
721
  }
733
- return u;
722
+ return i;
734
723
  });
735
- return (u, _) => (p(), C(K(It), {
736
- id: K(l),
737
- "initial-value": { x: K(n) - Ae - 40, y: 10 },
738
- class: M(["tl-absolute tl-select-none tl-z-24 tl-w-280px tl-font-sans tl-text-xs", u.$attrs.class]),
739
- handle: t.value
724
+ return (i, _) => (p(), C(D(Ke), {
725
+ id: D(l),
726
+ "initial-value": { x: D(n) - St - 40, y: 10 },
727
+ class: M(["tl-absolute tl-select-none tl-z-24 tl-w-280px tl-font-sans tl-text-xs", i.$attrs.class]),
728
+ handle: e.value
740
729
  }, {
741
- default: ut(() => [
742
- f("div", ke, [
730
+ default: pe(() => [
731
+ f("div", Mt, [
743
732
  f("header", {
744
733
  ref_key: "handle",
745
- ref: t,
734
+ ref: e,
746
735
  class: "tl-relative tl-cursor-grabbing tl-p-4 tl-flex tl-justify-between tl-text-gray-200 tl-relative"
747
- }, Te, 512),
748
- (p(!0), h(V, null, j(c.value, (y, s) => (p(), h(V, { key: s }, [
749
- s !== "default" ? (p(), C($e, {
736
+ }, _[0] || (_[0] = [
737
+ f("i", { class: "tl-h-4 tl-w-4 tl-p-1.5 tl-flex tl-items-center tl-line-height-0 tl-rounded-full tl-bg-gray-100 tl-text-xs" }, "🍰", -1),
738
+ f("div", null, [
739
+ f("i", { class: "i-ic-baseline-drag-indicator" }),
740
+ f("i", { class: "i-ic-baseline-drag-indicator" }),
741
+ f("i", { class: "i-ic-baseline-drag-indicator" })
742
+ ], -1),
743
+ f("div", null, null, -1)
744
+ ]), 512),
745
+ (p(!0), h(O, null, j(u.value, (y, s) => (p(), h(O, { key: s }, [
746
+ s !== "default" ? (p(), C(Ct, {
750
747
  key: 0,
751
748
  label: s,
752
749
  controls: y
753
750
  }, null, 8, ["label", "controls"])) : H("", !0),
754
- s === "default" ? (p(!0), h(V, { key: 1 }, j(y, (a) => (p(), C(bt, {
751
+ s === "default" ? (p(!0), h(O, { key: 1 }, j(y, (a) => (p(), C(ge, {
755
752
  key: a.label,
756
753
  control: a,
757
754
  onChange: (m) => r(a.key, m)
@@ -764,7 +761,7 @@ const oe = { class: "tl-relative tl-w-2/3 tl-flex tl-justify-between tl-gap-0.5"
764
761
  }
765
762
  });
766
763
  export {
767
- Fe as TresLeches,
768
- De as useControls,
769
- Dt as useControlsProvider
764
+ Kt as TresLeches,
765
+ It as useControls,
766
+ Fe as useControlsProvider
770
767
  };