@tresjs/leches 0.8.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,98 +1,99 @@
1
1
  /**
2
2
  * name: @tresjs/leches
3
- * version: v0.8.0
3
+ * version: v0.9.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 D, isRef as O, toRefs as K, customRef as ae, watch as P, ref as v, computed as A, defineComponent as M, reactive as Y, h as ce, openBlock as d, createElementBlock as m, createElementVNode as c, toDisplayString as k, normalizeClass as I, withDirectives as q, vShow as J, createTextVNode as ue, normalizeStyle as ie, Fragment as S, renderList as U, createCommentVNode as L, createBlock as C, createVNode as pe, Transition as de, withCtx as Q, provide as fe } from "vue";
9
- import { useWindowSize as Z, useEventListener as N, useStorage as ve, isClient as ge, useMouse as j, useFps as he, useRafFn as ye } from "@vueuse/core";
10
- function T(n) {
11
- return typeof n == "function" ? n() : D(n);
8
+ import { unref as T, isRef as P, toRefs as E, customRef as ae, ref as h, watch as W, computed as D, defineComponent as M, reactive as U, h as ce, provide as ie, isReactive as ue, openBlock as f, createElementBlock as m, createElementVNode as c, toDisplayString as k, normalizeClass as S, withDirectives as q, vShow as J, createTextVNode as pe, normalizeStyle as fe, Fragment as A, renderList as X, createCommentVNode as N, createBlock as C, createVNode as de, Transition as ve, withCtx as Q } from "vue";
9
+ import { useWindowSize as Z, useEventListener as B, useStorage as ge, isClient as he, useMouse as j, useFps as ye, useRafFn as be } from "@vueuse/core";
10
+ function I(e) {
11
+ return typeof e == "function" ? e() : T(e);
12
12
  }
13
13
  const ee = typeof window < "u" && typeof document < "u";
14
- function be(n, o = {}) {
15
- if (!O(n))
16
- return K(n);
17
- const t = Array.isArray(n.value) ? Array.from({ length: n.value.length }) : {};
18
- for (const e in n.value)
19
- t[e] = ae(() => ({
14
+ function me(e, l = {}) {
15
+ if (!P(e))
16
+ return E(e);
17
+ const n = Array.isArray(e.value) ? Array.from({ length: e.value.length }) : {};
18
+ for (const t in e.value)
19
+ n[t] = ae(() => ({
20
20
  get() {
21
- return n.value[e];
21
+ return e.value[t];
22
22
  },
23
- set(l) {
24
- var u;
25
- if ((u = T(o.replaceRef)) != null ? u : !0)
26
- if (Array.isArray(n.value)) {
27
- const p = [...n.value];
28
- p[e] = l, n.value = p;
23
+ set(s) {
24
+ var r;
25
+ if ((r = I(l.replaceRef)) != null ? r : !0)
26
+ if (Array.isArray(e.value)) {
27
+ const p = [...e.value];
28
+ p[t] = s, e.value = p;
29
29
  } else {
30
- const p = { ...n.value, [e]: l };
31
- Object.setPrototypeOf(p, Object.getPrototypeOf(n.value)), n.value = p;
30
+ const p = { ...e.value, [t]: s };
31
+ Object.setPrototypeOf(p, Object.getPrototypeOf(e.value)), e.value = p;
32
32
  }
33
33
  else
34
- n.value[e] = l;
34
+ e.value[t] = s;
35
35
  }
36
36
  }));
37
- return t;
37
+ return n;
38
38
  }
39
- const me = ee ? window : void 0;
40
- function _e(n, o = {}) {
39
+ const _e = ee ? window : void 0;
40
+ function xe(e, l = {}) {
41
41
  const {
42
- pointerTypes: t,
43
- preventDefault: e,
44
- stopPropagation: l,
45
- exact: u,
42
+ pointerTypes: n,
43
+ preventDefault: t,
44
+ stopPropagation: s,
45
+ exact: r,
46
46
  onMove: a,
47
47
  onEnd: p,
48
- onStart: f,
49
- initialValue: g,
50
- axis: r = "both",
51
- draggingElement: s = me,
52
- handle: i = n
53
- } = o, { width: $ } = Z();
54
- let _ = $.value;
55
- P($, () => {
56
- const y = $.value - _;
57
- h.value.x += y, _ = $.value;
48
+ onStart: d,
49
+ initialValue: _,
50
+ axis: i = "both",
51
+ draggingElement: o = _e,
52
+ handle: u = e
53
+ } = l, { width: w } = Z();
54
+ let v = w.value;
55
+ const b = h(
56
+ I(_) ?? { x: 0, y: 0 }
57
+ );
58
+ W(w, () => {
59
+ const y = w.value - v;
60
+ b.value.x += y, v = w.value;
58
61
  });
59
- const h = v(
60
- T(g) ?? { x: 0, y: 0 }
61
- ), x = v(), b = (y) => t ? t.includes(y.pointerType) : !0, w = (y) => {
62
- T(e) && y.preventDefault(), T(l) && y.stopPropagation();
62
+ const x = h(), g = (y) => n ? n.includes(y.pointerType) : !0, $ = (y) => {
63
+ I(t) && y.preventDefault(), I(s) && y.stopPropagation();
63
64
  }, le = (y) => {
64
- if (!b(y) || T(u) && y.target !== T(n))
65
+ if (!g(y) || I(r) && y.target !== I(e))
65
66
  return;
66
- const F = T(n).getBoundingClientRect(), V = {
67
- x: y.clientX - F.left,
68
- y: y.clientY - F.top
67
+ const V = I(e).getBoundingClientRect(), z = {
68
+ x: y.clientX - V.left,
69
+ y: y.clientY - V.top
69
70
  };
70
- (f == null ? void 0 : f(V, y)) !== !1 && (x.value = V, w(y));
71
- }, re = (y) => {
72
- if (!b(y) || !x.value)
73
- return;
74
- let { x: F, y: V } = h.value;
75
- (r === "x" || r === "both") && (F = y.clientX - x.value.x), (r === "y" || r === "both") && (V = y.clientY - x.value.y), h.value = {
76
- x: F,
77
- y: V
78
- }, a == null || a(h.value, y), w(y);
71
+ (d == null ? void 0 : d(z, y)) !== !1 && (x.value = z, $(y));
79
72
  }, se = (y) => {
80
- b(y) && x.value && (x.value = void 0, p == null || p(h.value, y), w(y));
73
+ if (!g(y) || !x.value)
74
+ return;
75
+ let { x: V, y: z } = b.value;
76
+ (i === "x" || i === "both") && (V = y.clientX - x.value.x), (i === "y" || i === "both") && (z = y.clientY - x.value.y), b.value = {
77
+ x: V,
78
+ y: z
79
+ }, a == null || a(b.value, y), $(y);
80
+ }, re = (y) => {
81
+ g(y) && x.value && (x.value = void 0, p == null || p(b.value, y), $(y));
81
82
  };
82
83
  if (ee) {
83
- const y = { capture: o.capture ?? !0 };
84
- N(i, "pointerdown", le, y), N(s, "pointermove", re, y), N(s, "pointerup", se, y);
84
+ const y = { capture: l.capture ?? !0 };
85
+ B(u, "pointerdown", le, y), B(o, "pointermove", se, y), B(o, "pointerup", re, y);
85
86
  }
86
87
  return {
87
- ...be(h),
88
- position: h,
89
- isDragging: A(() => !!x.value),
90
- style: A(
91
- () => `left:${h.value.x}px;top:${h.value.y}px;`
88
+ ...me(b),
89
+ position: b,
90
+ isDragging: D(() => !!x.value),
91
+ style: D(
92
+ () => `left:${b.value.x}px;top:${b.value.y}px;`
92
93
  )
93
94
  };
94
95
  }
95
- const xe = /* @__PURE__ */ M({
96
+ const we = /* @__PURE__ */ M({
96
97
  name: "UseDraggable",
97
98
  props: [
98
99
  "storageKey",
@@ -109,520 +110,520 @@ const xe = /* @__PURE__ */ M({
109
110
  "onMove",
110
111
  "onEnd"
111
112
  ],
112
- setup(n, { slots: o }) {
113
- const t = v(), e = A(() => n.handle ?? t.value), l = n.storageKey && ve(
114
- n.storageKey,
115
- T(n.initialValue) || { x: 0, y: 0 },
116
- ge ? n.storageType === "session" ? sessionStorage : localStorage : void 0
117
- ), u = l || n.initialValue || { x: 0, y: 0 }, p = Y(_e(t, {
118
- ...n,
119
- handle: e,
120
- initialValue: u,
121
- onEnd: (f, g) => {
122
- var r;
123
- (r = n.onEnd) == null || r.call(n, f, g), l && (l.value.x = f.x, l.value.y = f.y);
113
+ setup(e, { slots: l }) {
114
+ const n = h(), t = D(() => e.handle ?? n.value), s = e.storageKey && ge(
115
+ e.storageKey,
116
+ I(e.initialValue) || { x: 0, y: 0 },
117
+ he ? e.storageType === "session" ? sessionStorage : localStorage : void 0
118
+ ), r = s || e.initialValue || { x: 0, y: 0 }, p = U(xe(n, {
119
+ ...e,
120
+ handle: t,
121
+ initialValue: r,
122
+ onEnd: (d, _) => {
123
+ var i;
124
+ (i = e.onEnd) == null || i.call(e, d, _), s && (s.value.x = d.x, s.value.y = d.y);
124
125
  }
125
126
  }));
126
127
  return () => {
127
- if (o.default)
128
- return ce(n.as || "div", { ref: t, style: `touch-action:none;${p.style}` }, o.default(p));
128
+ if (l.default)
129
+ return ce(e.as || "div", { ref: n, style: `touch-action:none;${p.style}` }, l.default(p));
129
130
  };
130
131
  }
131
- }), we = { class: "flex px-4 justify-between gap-4 items-center mb-2" }, $e = { class: "text-gray-500 w-1/3" }, Ce = ["value", "min", "max", "step"], ke = /* @__PURE__ */ M({
132
+ }), $e = Symbol("CONTROLS_CONTEXT_KEY"), te = "default", F = U({});
133
+ function Ce(e = te) {
134
+ return ie($e, F), F[e];
135
+ }
136
+ const K = (e) => {
137
+ const l = /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$|^0x([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;
138
+ return typeof e == "boolean" ? "boolean" : typeof e == "number" ? "number" : typeof e == "string" && l.test(e) ? "color" : typeof e == "string" ? "string" : e.isVector3 || e.isVector2 || e.isEuler || e instanceof Array ? "vector" : e.min !== void 0 || e.max !== void 0 || e.step !== void 0 ? "range" : e.options && Array.isArray(e.options) && e.options.every((n) => "text" in n && "value" in n) ? "select" : "unknown";
139
+ }, L = (e, l, n, t) => {
140
+ const s = {
141
+ label: h(e),
142
+ name: h(e),
143
+ type: h(n),
144
+ value: h(l),
145
+ visible: h(!0),
146
+ [e]: h(l)
147
+ };
148
+ return t && (s.folder = h(t)), s;
149
+ }, Mt = (e, l, n) => {
150
+ const t = {}, s = typeof e == "string" ? e : null, r = s ? l : e, a = s && s !== "fpsgraph" ? n : l, p = (a == null ? void 0 : a.uuid) || te;
151
+ if (F[p] || (F[p] = U({})), e === "fpsgraph") {
152
+ const o = L("fpsgraph", null, "fpsgraph", null);
153
+ return F[p].fpsgraph = o, t.fpsgraph = o, E(U(t));
154
+ }
155
+ const d = F[p], _ = ue(r), i = _ ? E(r) : {};
156
+ for (const o in r) {
157
+ let u = r[o];
158
+ if (_ && i[o] && (u = i[o]), typeof u == "object" && !P(u) && !Array.isArray(u) && u.value !== void 0) {
159
+ const v = u, b = P(v.value) ? v.value : h(v.value), x = K(v), g = L(o, b, x, s);
160
+ x === "select" && (g.options = h(v.options)), x === "range" && (g.min = h(v.min), g.max = h(v.max), g.step = h(v.step)), d[o] = g, t[o] = g;
161
+ continue;
162
+ }
163
+ if (P(u)) {
164
+ const v = L(o, u, K(u.value), s);
165
+ d[o] = v, t[o] = v;
166
+ continue;
167
+ } else if (typeof u == "object" && !Array.isArray(u)) {
168
+ const v = E(u);
169
+ v[o] && (u = v[o]);
170
+ }
171
+ const w = L(o, u, K(u), s);
172
+ d[o] = w, t[o] = w;
173
+ }
174
+ return Object.keys(t).length > 1 ? E(U(t)) : Object.values(t)[0];
175
+ }, ke = { class: "flex px-4 justify-between gap-4 items-center mb-2" }, Me = { class: "text-gray-500 w-1/3" }, Te = ["value", "min", "max", "step"], Ie = /* @__PURE__ */ M({
132
176
  __name: "NumberControl",
133
177
  props: {
134
178
  label: {},
135
179
  control: {}
136
180
  },
137
181
  emits: ["change"],
138
- setup(n, { emit: o }) {
139
- const t = n;
140
- function e(r) {
141
- const { target: s } = r;
142
- o("change", s.valueAsNumber);
182
+ setup(e, { emit: l }) {
183
+ const n = e;
184
+ function t(i) {
185
+ const { target: o } = i;
186
+ l("change", o.valueAsNumber);
143
187
  }
144
- const l = j(), u = v(0), a = v(!1), p = (r) => {
145
- u.value = r.clientX, a.value = !0;
146
- }, f = () => {
188
+ const s = j(), r = h(0), a = h(!1), p = (i) => {
189
+ r.value = i.clientX, a.value = !0;
190
+ }, d = () => {
147
191
  a.value = !1;
148
- }, g = (r) => Math.floor(Math.abs(r) / 10);
149
- return P(l.x, (r) => {
192
+ }, _ = (i) => Math.floor(Math.abs(i) / 10);
193
+ return W(s.x, (i) => {
150
194
  if (a.value) {
151
- const s = r - u.value, i = g(s);
152
- s > 0 ? o("change", t.control.value + 1 + i) : s < 0 && o("change", t.control.value - 1 + i), t.control.min !== void 0 && t.control.value < t.control.min && o("change", t.control.min), t.control.max !== void 0 && t.control.value > t.control.max && o("change", t.control.max), u.value = r;
195
+ const o = i - r.value, u = _(o);
196
+ o > 0 ? l("change", n.control.value + 1 + u) : o < 0 && l("change", n.control.value - 1 + u), n.control.min !== void 0 && n.control.value < n.control.min && l("change", n.control.min), n.control.max !== void 0 && n.control.value > n.control.max && l("change", n.control.max), r.value = i;
153
197
  }
154
- }), (r, s) => (d(), m("div", we, [
155
- c("label", $e, k(r.label), 1),
198
+ }), (i, o) => (f(), m("div", ke, [
199
+ c("label", Me, k(i.label), 1),
156
200
  c("input", {
157
- value: r.control.value,
158
- class: I(["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 }]),
201
+ value: i.control.value,
202
+ class: S(["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 }]),
159
203
  type: "number",
160
- min: r.control.min,
161
- max: r.control.max,
162
- step: r.control.step,
163
- onInput: e,
204
+ min: i.control.min,
205
+ max: i.control.max,
206
+ step: i.control.step,
207
+ onInput: t,
164
208
  onMousedown: p,
165
- onMouseup: f
166
- }, null, 42, Ce)
209
+ onMouseup: d
210
+ }, null, 42, Te)
167
211
  ]));
168
212
  }
169
- }), Me = { class: "flex px-4 justify-between gap-4 items-center mb-2 min-h-32px" }, Te = { class: "text-gray-500 w-1/3" }, Ie = ["value"], Se = /* @__PURE__ */ M({
213
+ }), Se = { class: "flex px-4 justify-between gap-4 items-center mb-2 min-h-32px" }, Ae = { class: "text-gray-500 w-1/3" }, De = ["value"], Ee = /* @__PURE__ */ M({
170
214
  __name: "TextControl",
171
215
  props: {
172
216
  label: {},
173
217
  control: {}
174
218
  },
175
219
  emits: ["change"],
176
- setup(n, { emit: o }) {
177
- function t(e) {
178
- const { target: l } = e;
179
- o("change", l.value);
220
+ setup(e, { emit: l }) {
221
+ function n(t) {
222
+ const { target: s } = t;
223
+ l("change", s.value);
180
224
  }
181
- return (e, l) => (d(), m("div", Me, [
182
- c("label", Te, k(e.label), 1),
225
+ return (t, s) => (f(), m("div", Se, [
226
+ c("label", Ae, k(t.label), 1),
183
227
  c("input", {
184
- value: e.control.value,
228
+ value: t.control.value,
185
229
  type: "text",
186
230
  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",
187
- onChange: t
188
- }, null, 40, Ie)
231
+ onChange: n
232
+ }, null, 40, De)
189
233
  ]));
190
234
  }
191
- }), Ae = { class: "flex px-4 justify-start gap-2 items-center mb-2 min-h-32px" }, De = { class: "text-gray-500 w-1/3" }, Ee = ["id", "checked"], Fe = ["for"], Ve = { class: "i-ic:baseline-check text-light" }, ze = /* @__PURE__ */ M({
235
+ }), Fe = { class: "flex px-4 justify-start gap-2 items-center mb-2 min-h-32px" }, Ve = { class: "text-gray-500 w-1/3" }, ze = ["id", "checked"], Oe = ["for"], Ue = { class: "i-ic:baseline-check text-light" }, Xe = /* @__PURE__ */ M({
192
236
  __name: "BooleanControl",
193
237
  props: {
194
238
  label: {},
195
239
  control: {}
196
240
  },
197
241
  emits: ["change"],
198
- setup(n, { emit: o }) {
199
- function t(e) {
200
- const { target: l } = e;
201
- o("change", l.checked);
242
+ setup(e, { emit: l }) {
243
+ function n(t) {
244
+ const { target: s } = t;
245
+ l("change", s.checked);
202
246
  }
203
- return (e, l) => (d(), m("div", Ae, [
204
- c("label", De, k(e.label), 1),
247
+ return (t, s) => (f(), m("div", Fe, [
248
+ c("label", Ve, k(t.label), 1),
205
249
  c("input", {
206
- id: e.control.label,
207
- checked: e.control.value,
250
+ id: t.control.label,
251
+ checked: t.control.value,
208
252
  class: "hidden",
209
253
  type: "checkbox",
210
- onInput: t
211
- }, null, 40, Ee),
254
+ onInput: n
255
+ }, null, 40, ze),
212
256
  c("label", {
213
- for: e.control.label,
257
+ for: t.control.label,
214
258
  class: "inline-flex items-center cursor-pointer"
215
259
  }, [
216
260
  c("span", {
217
- class: I([{ "bg-dark-500": e.control.value, "bg-gray-200": !e.control.value }, "w-4 h-4 flex justify-center items-center rounded border border-gray-300 mr-2 transition-colors duration-200"])
261
+ class: S([{ "bg-dark-500": t.control.value, "bg-gray-200": !t.control.value }, "w-4 h-4 flex justify-center items-center rounded border border-gray-300 mr-2 transition-colors duration-200"])
218
262
  }, [
219
- q(c("i", Ve, null, 512), [
220
- [J, e.control.value]
263
+ q(c("i", Ue, null, 512), [
264
+ [J, t.control.value]
221
265
  ])
222
266
  ], 2)
223
- ], 8, Fe)
267
+ ], 8, Oe)
224
268
  ]));
225
269
  }
226
- }), Ue = { class: "px-4 relative flex justify-between gap-4 items-center mb-2" }, Xe = ["value", "min", "max", "step"], Oe = ["value", "min", "max", "step"], Le = /* @__PURE__ */ M({
270
+ }), Le = { class: "px-4 relative flex justify-between gap-4 items-center mb-2" }, Pe = ["value", "min", "max", "step"], Ne = ["value", "min", "max", "step"], We = /* @__PURE__ */ M({
227
271
  __name: "SliderControl",
228
272
  props: {
229
273
  label: {},
230
274
  control: {}
231
275
  },
232
276
  emits: ["change"],
233
- setup(n, { emit: o }) {
234
- const t = n;
235
- function e(s) {
236
- const { target: i } = s;
237
- o("change", i.valueAsNumber);
277
+ setup(e, { emit: l }) {
278
+ const n = e;
279
+ function t(o) {
280
+ const { target: u } = o;
281
+ l("change", u.valueAsNumber);
238
282
  }
239
- const l = A(() => ({
240
- backgroundImage: `linear-gradient(to right, #333 0% ${100 * (t.control.value - (t.control.min || 0)) / ((t.control.max || 100) - (t.control.min || 0))}%, #e2e2e2 0%)`
241
- })), u = j(), a = v(0), p = v(!1), f = (s) => {
242
- a.value = s.clientX, p.value = !0;
243
- }, g = () => {
283
+ const s = D(() => ({
284
+ backgroundImage: `linear-gradient(to right, #333 0% ${100 * (n.control.value - (n.control.min || 0)) / ((n.control.max || 100) - (n.control.min || 0))}%, #e2e2e2 0%)`
285
+ })), r = j(), a = h(0), p = h(!1), d = (o) => {
286
+ a.value = o.clientX, p.value = !0;
287
+ }, _ = () => {
244
288
  p.value = !1;
245
- }, r = (s) => Math.floor(Math.abs(s) / 10);
246
- return P(u.x, (s) => {
289
+ }, i = (o) => Math.floor(Math.abs(o) / 10);
290
+ return W(r.x, (o) => {
247
291
  if (p.value) {
248
- const i = s - a.value, $ = r(i);
249
- i > 0 ? o("change", t.control.value + 1 + $) : i < 0 && o("change", t.control.value - 1 + $), t.control.min !== void 0 && t.control.value < t.control.min && o("change", t.control.min), t.control.max !== void 0 && t.control.value > t.control.max && o("change", t.control.max), a.value = s;
292
+ const u = o - a.value, w = i(u);
293
+ u > 0 ? l("change", n.control.value + 1 + w) : u < 0 && l("change", n.control.value - 1 + w), n.control.min !== void 0 && n.control.value < n.control.min && l("change", n.control.min), n.control.max !== void 0 && n.control.value > n.control.max && l("change", n.control.max), a.value = o;
250
294
  }
251
- }), (s, i) => (d(), m("div", Ue, [
295
+ }), (o, u) => (f(), m("div", Le, [
252
296
  c("label", {
253
- class: I(["text-gray-500 w-1/3", { "flex justify-between items-center": s.control.icon }])
297
+ class: S(["text-gray-500 w-1/3", { "flex justify-between items-center": o.control.icon }])
254
298
  }, [
255
- ue(k(s.label) + " ", 1),
299
+ pe(k(o.label) + " ", 1),
256
300
  c("i", {
257
- class: I(`i-${s.control.icon}`)
301
+ class: S(`i-${o.control.icon}`)
258
302
  }, null, 2)
259
303
  ], 2),
260
304
  c("input", {
261
- value: s.control.value,
305
+ value: o.control.value,
262
306
  class: "w-1/2 h-0.75 bg-dark-200 rounded-full appearance-none",
263
- style: ie(l.value),
307
+ style: fe(s.value),
264
308
  type: "range",
265
- min: s.control.min,
266
- max: s.control.max,
267
- step: s.control.step,
268
- onInput: e
269
- }, null, 44, Xe),
309
+ min: o.control.min,
310
+ max: o.control.max,
311
+ step: o.control.step,
312
+ onInput: t
313
+ }, null, 44, Pe),
270
314
  c("input", {
271
- value: s.control.value,
272
- class: I(["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": p.value }]),
315
+ value: o.control.value,
316
+ class: S(["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": p.value }]),
273
317
  type: "number",
274
- min: s.control.min,
275
- max: s.control.max,
276
- step: s.control.step,
277
- onInput: e,
278
- onMousedown: f,
279
- onMouseup: g
280
- }, null, 42, Oe)
318
+ min: o.control.min,
319
+ max: o.control.max,
320
+ step: o.control.step,
321
+ onInput: t,
322
+ onMousedown: d,
323
+ onMouseup: _
324
+ }, null, 42, Ne)
281
325
  ]));
282
326
  }
283
327
  });
284
- const Pe = (n, o) => {
285
- const t = n.__vccOpts || n;
286
- for (const [e, l] of o)
287
- t[e] = l;
288
- return t;
289
- }, Ne = /* @__PURE__ */ Pe(Le, [["__scopeId", "data-v-743fd350"]]), We = { class: "flex px-4 justify-between gap-4 items-center mb-2" }, Be = { class: "text-gray-500 w-1/3" }, Ke = ["value"], Ye = ["value"], je = /* @__PURE__ */ M({
328
+ const Be = (e, l) => {
329
+ const n = e.__vccOpts || e;
330
+ for (const [t, s] of l)
331
+ n[t] = s;
332
+ return n;
333
+ }, Ke = /* @__PURE__ */ Be(We, [["__scopeId", "data-v-9e6267fe"]]), Re = { class: "flex px-4 justify-between gap-4 items-center mb-2" }, je = { class: "text-gray-500 w-1/3" }, Ye = ["value"], He = ["value"], Ge = /* @__PURE__ */ M({
290
334
  __name: "ColorControl",
291
335
  props: {
292
336
  label: {},
293
337
  control: {}
294
338
  },
295
339
  emits: ["change"],
296
- setup(n, { emit: o }) {
297
- function t(e) {
298
- const { target: l } = e;
299
- o("change", l.value);
340
+ setup(e, { emit: l }) {
341
+ function n(t) {
342
+ const { target: s } = t;
343
+ l("change", s.value);
300
344
  }
301
- return (e, l) => (d(), m("div", We, [
302
- c("label", Be, k(e.label), 1),
345
+ return (t, s) => (f(), m("div", Re, [
346
+ c("label", je, k(t.label), 1),
303
347
  c("input", {
304
- value: e.control.value,
348
+ value: t.control.value,
305
349
  type: "color",
306
- onInput: t
307
- }, null, 40, Ke),
350
+ onInput: n
351
+ }, null, 40, Ye),
308
352
  c("input", {
309
- value: e.control.value,
353
+ value: t.control.value,
310
354
  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",
311
355
  type: "text",
312
- onInput: t
313
- }, null, 40, Ye)
356
+ onInput: n
357
+ }, null, 40, He)
314
358
  ]));
315
359
  }
316
360
  });
317
- function He(n) {
318
- if (typeof n == "number")
319
- return [n, n, n];
320
- if (ne(n)) {
321
- const { x: o, y: t, z: e } = n;
322
- return [o, t, e];
361
+ function qe(e) {
362
+ if (typeof e == "number")
363
+ return [e, e, e];
364
+ if (ne(e)) {
365
+ const { x: l, y: n, z: t } = e;
366
+ return [l, n, t];
323
367
  }
324
- return n;
368
+ return e;
325
369
  }
326
- function Re(n) {
327
- return n && typeof n.x == "number" && typeof n.y == "number" && typeof n.z > "u";
370
+ function Je(e) {
371
+ return e && typeof e.x == "number" && typeof e.y == "number" && typeof e.z > "u";
328
372
  }
329
- function ne(n) {
330
- return n && typeof n.x == "number" && typeof n.y == "number" && typeof n.z == "number";
373
+ function ne(e) {
374
+ return e && typeof e.x == "number" && typeof e.y == "number" && typeof e.z == "number";
331
375
  }
332
- const Ge = { class: "flex px-4 justify-between gap-1 items-center mb-2" }, qe = { class: "text-gray-500 w-1/3" }, Je = { class: "w-2/3 flex justify-between gap-0.5" }, Qe = {
376
+ const Qe = { class: "flex px-4 justify-between gap-1 items-center mb-2" }, Ze = { class: "text-gray-500 w-1/3" }, et = { class: "w-2/3 flex justify-between gap-0.5" }, tt = {
333
377
  key: 0,
334
378
  class: "font-bold px-1 py-1 text-0.65rem text-gray-300"
335
- }, Ze = ["value", "onInput", "onMousedown", "onMouseup"], en = /* @__PURE__ */ M({
379
+ }, nt = ["value", "onInput", "onMousedown", "onMouseup"], ot = /* @__PURE__ */ M({
336
380
  __name: "VectorControl",
337
381
  props: {
338
382
  label: {},
339
383
  control: {}
340
384
  },
341
385
  emits: ["change"],
342
- setup(n, { emit: o }) {
343
- const t = n, e = j(), l = v(0), u = v(!1), a = v(0), p = (_, h) => {
344
- a.value = h, l.value = _.clientX, u.value = !0;
345
- }, f = (_, h) => {
346
- a.value = h, u.value = !1;
347
- }, g = (_) => Math.floor(Math.abs(_) / 10), r = A(() => He(t.control.value)), s = v(["x", "y", "z"]), i = A(() => Re(t.control.value) || ne(t.control.value));
348
- function $(_, h) {
349
- const { value: x } = t.control, { target: b } = _;
350
- a.value = h, x[i.value ? s.value[a.value] : a.value] = parseInt(b.value, 10), o("change", x);
386
+ setup(e, { emit: l }) {
387
+ const n = e, t = j(), s = h(0), r = h(!1), a = h(0), p = (v, b) => {
388
+ a.value = b, s.value = v.clientX, r.value = !0;
389
+ }, d = (v, b) => {
390
+ a.value = b, r.value = !1;
391
+ }, _ = (v) => Math.floor(Math.abs(v) / 10), i = D(() => qe(n.control.value)), o = h(["x", "y", "z"]), u = D(() => Je(n.control.value) || ne(n.control.value));
392
+ function w(v, b) {
393
+ const { value: x } = n.control, { target: g } = v;
394
+ a.value = b, x[u.value ? o.value[a.value] : a.value] = parseInt(g.value, 10), l("change", x);
351
395
  }
352
- return P(e.x, (_) => {
353
- if (u.value) {
354
- const h = _ - l.value, x = g(h), { value: b } = t.control, w = i.value ? s.value[a.value] : a.value;
355
- h > 0 ? b[w] += 0.1 + x : h < 0 && (b[w] -= 0.1 + x), t.control.min !== void 0 && b < t.control.min && (b[w] = t.control.min), t.control.max !== void 0 && b > t.control.max && (b[w] = t.control.max), o("change", b), l.value = _;
396
+ return W(t.x, (v) => {
397
+ if (r.value) {
398
+ const b = v - s.value, x = _(b), { value: g } = n.control, $ = u.value ? o.value[a.value] : a.value;
399
+ b > 0 ? g[$] += 0.1 + x : b < 0 && (g[$] -= 0.1 + x), n.control.min !== void 0 && g < n.control.min && (g[$] = n.control.min), n.control.max !== void 0 && g > n.control.max && (g[$] = n.control.max), l("change", g), s.value = v;
356
400
  }
357
- }), (_, h) => (d(), m("div", Ge, [
358
- c("label", qe, k(_.label), 1),
359
- c("div", Je, [
360
- (d(!0), m(S, null, U(r.value, (x, b) => (d(), m("div", {
361
- key: _.label + b,
401
+ }), (v, b) => (f(), m("div", Qe, [
402
+ c("label", Ze, k(v.label), 1),
403
+ c("div", et, [
404
+ (f(!0), m(A, null, X(i.value, (x, g) => (f(), m("div", {
405
+ key: v.label + g,
362
406
  class: "flex items-center w-1/3 bg-gray-100 rounded"
363
407
  }, [
364
- s.value[b] && i.value ? (d(), m("span", Qe, k(s.value[b]), 1)) : L("", !0),
408
+ o.value[g] && u.value ? (f(), m("span", tt, k(o.value[g]), 1)) : N("", !0),
365
409
  c("input", {
366
410
  type: "text",
367
- class: I(["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": u.value }]),
368
- value: r.value[b].toFixed(2),
369
- onInput: (w) => $(w, b),
370
- onMousedown: (w) => p(w, b),
371
- onMouseup: (w) => f(w, b)
372
- }, null, 42, Ze)
411
+ class: S(["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": r.value }]),
412
+ value: i.value[g].toFixed(2),
413
+ onInput: ($) => w($, g),
414
+ onMousedown: ($) => p($, g),
415
+ onMouseup: ($) => d($, g)
416
+ }, null, 42, nt)
373
417
  ]))), 128))
374
418
  ])
375
419
  ]));
376
420
  }
377
- }), nn = { class: "flex px-4 justify-between gap-4 items-center mb-2" }, tn = { class: "text-gray-500 w-1/3" }, on = { 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" }, ln = { class: "absolute bottom-0.5 right-0.5 font-sans text-xs" }, rn = ["points"], H = 160, W = 40, z = 2, R = 100, G = 20, sn = /* @__PURE__ */ M({
421
+ }), lt = { class: "flex px-4 justify-between gap-4 items-center mb-2" }, st = { class: "text-gray-500 w-1/3" }, rt = { 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" }, at = { class: "absolute bottom-0.5 right-0.5 font-sans text-xs" }, ct = ["points"], Y = 160, R = 40, O = 2, H = 100, G = 20, it = /* @__PURE__ */ M({
378
422
  __name: "FPSGraph",
379
423
  props: {
380
424
  label: {},
381
425
  control: {}
382
426
  },
383
- setup(n) {
384
- const o = he({ every: R }), t = v(""), e = v([]), l = v(H / z);
385
- let u = performance.now();
386
- return ye(({ timestamp: a }) => {
387
- a - u >= R && (u = a, e.value.push(o.value), e.value.length > l.value && e.value.shift(), t.value = e.value.map(
388
- (p, f) => `${f * z},${W + G - z / 2 - p * (W + G - z) / 120}`
427
+ setup(e) {
428
+ const l = ye({ every: H }), n = h(""), t = h([]), s = h(Y / O);
429
+ let r = performance.now();
430
+ return be(({ timestamp: a }) => {
431
+ a - r >= H && (r = a, t.value.push(l.value), t.value.length > s.value && t.value.shift(), n.value = t.value.map(
432
+ (p, d) => `${d * O},${R + G - O / 2 - p * (R + G - O) / 120}`
389
433
  ).join(" "));
390
- }), (a, p) => (d(), m("div", nn, [
391
- c("label", tn, k(a.label), 1),
392
- c("div", on, [
393
- c("div", ln, k(Math.round(D(o))) + " FPS", 1),
394
- (d(), m("svg", {
395
- width: H,
396
- height: W,
434
+ }), (a, p) => (f(), m("div", lt, [
435
+ c("label", st, k(a.label), 1),
436
+ c("div", rt, [
437
+ c("div", at, k(Math.round(T(l))) + " FPS ", 1),
438
+ (f(), m("svg", {
439
+ width: Y,
440
+ height: R,
397
441
  xmlns: "http://www.w3.org/2000/svg",
398
442
  class: "bg-gray-100"
399
443
  }, [
400
444
  c("polyline", {
401
- points: t.value,
445
+ points: n.value,
402
446
  fill: "none",
403
447
  stroke: "lightgray",
404
- "stroke-width": z,
448
+ "stroke-width": O,
405
449
  "stroke-linecap": "round",
406
450
  "stroke-linejoin": "round"
407
- }, null, 8, rn)
451
+ }, null, 8, ct)
408
452
  ]))
409
453
  ])
410
454
  ]));
411
455
  }
412
- }), an = { class: "flex px-4 justify-between gap-4 items-center mb-2 min-h-32px" }, cn = { class: "text-gray-500 w-1/3" }, un = ["value"], pn = ["value"], dn = /* @__PURE__ */ M({
456
+ }), ut = { class: "flex px-4 justify-between gap-4 items-center mb-2 min-h-32px" }, pt = { class: "text-gray-500 w-1/3" }, ft = ["value"], dt = ["value"], vt = /* @__PURE__ */ M({
413
457
  __name: "SelectControl",
414
458
  props: {
415
459
  label: {},
416
460
  control: {}
417
461
  },
418
462
  emits: ["change"],
419
- setup(n, { emit: o }) {
420
- function t(e) {
421
- o("change", e.target.value);
463
+ setup(e, { emit: l }) {
464
+ function n(t) {
465
+ l("change", t.target.value);
422
466
  }
423
- return (e, l) => (d(), m("div", an, [
424
- c("label", cn, k(e.label), 1),
467
+ return (t, s) => (f(), m("div", ut, [
468
+ c("label", pt, k(t.label), 1),
425
469
  c("select", {
426
- value: e.control.value,
470
+ value: t.control.value,
427
471
  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",
428
- onChange: t
472
+ onChange: n
429
473
  }, [
430
- (d(!0), m(S, null, U(e.control.options, (u) => (d(), m("option", {
431
- key: u.value,
432
- value: u.value
433
- }, k(u.text), 9, pn))), 128))
434
- ], 40, un)
474
+ (f(!0), m(A, null, X(t.control.options, (r) => (f(), m("option", {
475
+ key: r.value,
476
+ value: r.value
477
+ }, k(r.text), 9, dt))), 128))
478
+ ], 40, ft)
435
479
  ]));
436
480
  }
437
- }), te = /* @__PURE__ */ M({
481
+ }), oe = /* @__PURE__ */ M({
438
482
  __name: "ControlInput",
439
483
  props: {
440
484
  control: {}
441
485
  },
442
486
  emits: ["change"],
443
- setup(n, { emit: o }) {
444
- function t(e) {
445
- o("change", e);
487
+ setup(e, { emit: l }) {
488
+ function n(t) {
489
+ l("change", t);
446
490
  }
447
- return (e, l) => e.control.visible ? (d(), m(S, { key: 0 }, [
448
- e.control.type === "color" ? (d(), C(je, {
491
+ return (t, s) => t.control.visible ? (f(), m(A, { key: 0 }, [
492
+ t.control.type === "color" ? (f(), C(Ge, {
449
493
  key: 0,
450
- label: e.control.label,
451
- control: e.control,
452
- onChange: t
453
- }, null, 8, ["label", "control"])) : e.control.type === "select" ? (d(), C(dn, {
494
+ label: t.control.label,
495
+ control: t.control,
496
+ onChange: n
497
+ }, null, 8, ["label", "control"])) : t.control.type === "select" ? (f(), C(vt, {
454
498
  key: 1,
455
- label: e.control.label,
456
- control: e.control,
457
- onChange: t
458
- }, null, 8, ["label", "control"])) : e.control.type === "vector" ? (d(), C(en, {
499
+ label: t.control.label,
500
+ control: t.control,
501
+ onChange: n
502
+ }, null, 8, ["label", "control"])) : t.control.type === "vector" ? (f(), C(ot, {
459
503
  key: 2,
460
- label: e.control.label,
461
- control: e.control,
462
- onChange: t
463
- }, null, 8, ["label", "control"])) : e.control.type === "boolean" ? (d(), C(ze, {
504
+ label: t.control.label,
505
+ control: t.control,
506
+ onChange: n
507
+ }, null, 8, ["label", "control"])) : t.control.type === "boolean" ? (f(), C(Xe, {
464
508
  key: 3,
465
- label: e.control.label,
466
- control: e.control,
467
- onChange: t
468
- }, null, 8, ["label", "control"])) : e.control.type === "fpsgraph" ? (d(), C(sn, {
509
+ label: t.control.label,
510
+ control: t.control,
511
+ onChange: n
512
+ }, null, 8, ["label", "control"])) : t.control.type === "fpsgraph" ? (f(), C(it, {
469
513
  key: 4,
470
- label: e.control.label,
471
- control: e.control
472
- }, null, 8, ["label", "control"])) : e.control.type === "number" ? (d(), C(ke, {
514
+ label: t.control.label,
515
+ control: t.control
516
+ }, null, 8, ["label", "control"])) : t.control.type === "number" ? (f(), C(Ie, {
473
517
  key: 5,
474
- label: e.control.label,
475
- control: e.control,
476
- onChange: t
477
- }, null, 8, ["label", "control"])) : e.control.type === "range" ? (d(), C(Ne, {
518
+ label: t.control.label,
519
+ control: t.control,
520
+ onChange: n
521
+ }, null, 8, ["label", "control"])) : t.control.type === "range" ? (f(), C(Ke, {
478
522
  key: 6,
479
- label: e.control.label,
480
- control: e.control,
481
- onChange: t
482
- }, null, 8, ["label", "control"])) : (d(), C(Se, {
523
+ label: t.control.label,
524
+ control: t.control,
525
+ onChange: n
526
+ }, null, 8, ["label", "control"])) : (f(), C(Ee, {
483
527
  key: 7,
484
- label: e.control.label,
485
- control: e.control,
486
- onChange: t
528
+ label: t.control.label,
529
+ control: t.control,
530
+ onChange: n
487
531
  }, null, 8, ["label", "control"]))
488
- ], 64)) : L("", !0);
532
+ ], 64)) : N("", !0);
489
533
  }
490
- }), fn = { class: "mb-4" }, vn = { class: "bg-white rounded-b pt-4" }, gn = /* @__PURE__ */ M({
534
+ }), gt = { class: "mb-4" }, ht = { class: "bg-white rounded-b pt-4" }, yt = /* @__PURE__ */ M({
491
535
  __name: "Folder",
492
536
  props: {
493
537
  controls: {},
494
538
  label: {}
495
539
  },
496
- setup(n) {
497
- function o(l, u) {
498
- u.value = l;
540
+ setup(e) {
541
+ function l(s, r) {
542
+ r.value = s;
499
543
  }
500
- const t = v(!1), e = () => {
501
- t.value = !t.value;
544
+ const n = h(!1), t = () => {
545
+ n.value = !n.value;
502
546
  };
503
- return (l, u) => (d(), m("div", fn, [
547
+ return (s, r) => (f(), m("div", gt, [
504
548
  c("button", {
505
549
  class: "flex items-center justify-between w-full py-2 px-4 bg-gray-100 border-none text-gray-400 font-bold text-xs focus:outline-none font-sans cursor-pointer",
506
- onClick: e
550
+ onClick: t
507
551
  }, [
508
- c("span", null, k(l.label), 1),
552
+ c("span", null, k(s.label), 1),
509
553
  c("i", {
510
- class: I(t.value ? "i-ic:baseline-keyboard-arrow-up" : "i-ic:baseline-keyboard-arrow-down")
554
+ class: S(n.value ? "i-ic:baseline-keyboard-arrow-up" : "i-ic:baseline-keyboard-arrow-down")
511
555
  }, null, 2)
512
556
  ]),
513
- pe(de, {
557
+ de(ve, {
514
558
  name: "slide",
515
559
  "enter-active-class": " animate-fade-in animate-duration-200 animate-ease-in-out",
516
560
  "leave-active-class": " animate-fade-out animate-duration-200 animate-ease-in-out"
517
561
  }, {
518
562
  default: Q(() => [
519
- q(c("div", vn, [
520
- (d(!0), m(S, null, U(l.controls, (a) => (d(), C(te, {
563
+ q(c("div", ht, [
564
+ (f(!0), m(A, null, X(s.controls, (a) => (f(), C(oe, {
521
565
  key: a.label,
522
566
  control: a,
523
- onChange: (p) => o(p, a)
567
+ onChange: (p) => l(p, a)
524
568
  }, null, 8, ["control", "onChange"]))), 128))
525
569
  ], 512), [
526
- [J, t.value]
570
+ [J, n.value]
527
571
  ])
528
572
  ]),
529
573
  _: 1
530
574
  })
531
575
  ]));
532
576
  }
533
- }), hn = Symbol("CONTROLS_CONTEXT_KEY"), oe = "default";
534
- function yn(n = oe) {
535
- return fe(hn, E), E[n];
536
- }
537
- const E = Y({}), B = (n) => {
538
- const o = /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$|^0x([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;
539
- return typeof n == "boolean" ? "boolean" : typeof n == "number" ? "number" : typeof n == "string" && o.test(n) ? "color" : typeof n == "string" ? "string" : n.isVector3 || n.isVector2 || n.isEuler || n instanceof Array ? "vector" : n.min !== void 0 || n.max !== void 0 || n.step !== void 0 ? "range" : n.options && Array.isArray(n.options) && n.options.every((t) => "text" in t && "value" in t) ? "select" : "unknown";
540
- }, X = (n, o, t, e) => {
541
- const l = {
542
- label: v(n),
543
- name: v(n),
544
- type: v(t),
545
- value: v(o),
546
- visible: v(!0),
547
- [n]: v(o)
548
- };
549
- return e && (l.folder = v(e)), l;
550
- }, Mn = (n, o, t) => {
551
- const e = [], l = typeof n == "string" ? n : null, u = l ? o : n, a = l && l !== "fpsgraph" ? t : o, p = (a == null ? void 0 : a.uuid) || oe;
552
- if (E[p] || (E[p] = Y({})), n === "fpsgraph") {
553
- const g = X("fpsgraph", null, "fpsgraph", null);
554
- return E[p].fpsgraph = g, e.push(g), e.length === 1 ? e[0] : e;
555
- }
556
- const f = E[p];
557
- for (const g in u) {
558
- let r = u[g];
559
- if (typeof r == "object" && !O(r) && !Array.isArray(r) && r.value !== void 0) {
560
- const i = r, $ = O(i.value) ? i.value : v(i.value), _ = B(i), h = X(g, $, _, l);
561
- _ === "select" && (h.options = v(i.options)), _ === "range" && (h.min = v(i.min), h.max = v(i.max), h.step = v(i.step)), f[g] = h, e.push(h);
562
- continue;
563
- }
564
- if (O(r)) {
565
- const i = X(g, r, B(r.value), l);
566
- f[g] = i, e.push(i);
567
- continue;
568
- } else if (typeof r == "object" && !Array.isArray(r)) {
569
- const i = K(r);
570
- i[g] && (r = i[g]);
571
- }
572
- const s = X(g, r, B(r), l);
573
- f[g] = s, e.push(s);
574
- }
575
- return e.length === 1 ? e[0] : e;
576
- }, bn = { class: "bg-white shadow-xl rounded border-4 border-solid border-black" }, mn = /* @__PURE__ */ c("i", { class: "h-4 w-4 p-1.5 flex items-center line-height-0 rounded-full bg-gray-100 text-xs" }, "🍰", -1), _n = /* @__PURE__ */ c("div", null, [
577
+ }), bt = { class: "bg-white shadow-xl rounded border-4 border-solid border-black" }, mt = /* @__PURE__ */ c("i", { class: "h-4 w-4 p-1.5 flex items-center line-height-0 rounded-full bg-gray-100 text-xs" }, "🍰", -1), _t = /* @__PURE__ */ c("div", null, [
577
578
  /* @__PURE__ */ c("i", { class: "i-ic-baseline-drag-indicator" }),
578
579
  /* @__PURE__ */ c("i", { class: "i-ic-baseline-drag-indicator" }),
579
580
  /* @__PURE__ */ c("i", { class: "i-ic-baseline-drag-indicator" })
580
- ], -1), xn = /* @__PURE__ */ c("div", null, null, -1), wn = [
581
- mn,
582
- _n,
583
- xn
584
- ], $n = 280, Tn = /* @__PURE__ */ M({
581
+ ], -1), xt = /* @__PURE__ */ c("div", null, null, -1), wt = [
582
+ mt,
583
+ _t,
584
+ xt
585
+ ], $t = 280, Tt = /* @__PURE__ */ M({
585
586
  __name: "TresLeches",
586
587
  props: {
587
588
  uuid: {}
588
589
  },
589
- setup(n) {
590
- const o = n, { uuid: t } = K(o), { width: e } = Z(), l = v(null), u = yn(t == null ? void 0 : t.value);
591
- function a(f, g) {
592
- u[D(f)].value = g;
590
+ setup(e) {
591
+ const l = e, { uuid: n } = E(l), { width: t } = Z(), s = h(null), r = Ce(n == null ? void 0 : n.value);
592
+ function a(d, _) {
593
+ r[T(d)].value = _, r[T(d)][T(d)] = _;
593
594
  }
594
- const p = A(() => {
595
- const f = {};
596
- for (const g in u) {
597
- const r = u[g], s = r.folder || "default";
598
- f[s] || (f[s] = []), f[s].push(r);
595
+ const p = D(() => {
596
+ const d = {};
597
+ for (const _ in r) {
598
+ const i = r[_], o = i.folder || "default";
599
+ d[o] || (d[o] = []), d[o].push(i);
599
600
  }
600
- return f;
601
+ return d;
601
602
  });
602
- return (f, g) => (d(), C(D(xe), {
603
- id: D(t),
604
- "initial-value": { x: D(e) - $n - 40, y: 10 },
605
- class: I(["absolute select-none z-24 w-280px font-sans text-xs", f.$attrs.class]),
606
- handle: l.value
603
+ return (d, _) => (f(), C(T(we), {
604
+ id: T(n),
605
+ "initial-value": { x: T(t) - $t - 40, y: 10 },
606
+ class: S(["absolute select-none z-24 w-280px font-sans text-xs", d.$attrs.class]),
607
+ handle: s.value
607
608
  }, {
608
609
  default: Q(() => [
609
- c("div", bn, [
610
+ c("div", bt, [
610
611
  c("header", {
611
612
  ref_key: "handle",
612
- ref: l,
613
+ ref: s,
613
614
  class: "relative cursor-grabbing p-4 flex justify-between text-gray-200 relative"
614
- }, wn, 512),
615
- (d(!0), m(S, null, U(p.value, (r, s) => (d(), m(S, { key: s }, [
616
- s !== "default" ? (d(), C(gn, {
615
+ }, wt, 512),
616
+ (f(!0), m(A, null, X(p.value, (i, o) => (f(), m(A, { key: o }, [
617
+ o !== "default" ? (f(), C(yt, {
617
618
  key: 0,
618
- label: s,
619
- controls: r
620
- }, null, 8, ["label", "controls"])) : L("", !0),
621
- s === "default" ? (d(!0), m(S, { key: 1 }, U(r, (i) => (d(), C(te, {
622
- key: i.label,
623
- control: i,
624
- onChange: ($) => a(i.label, $)
625
- }, null, 8, ["control", "onChange"]))), 128)) : L("", !0)
619
+ label: o,
620
+ controls: i
621
+ }, null, 8, ["label", "controls"])) : N("", !0),
622
+ o === "default" ? (f(!0), m(A, { key: 1 }, X(i, (u) => (f(), C(oe, {
623
+ key: u.label,
624
+ control: u,
625
+ onChange: (w) => a(u.label, w)
626
+ }, null, 8, ["control", "onChange"]))), 128)) : N("", !0)
626
627
  ], 64))), 128))
627
628
  ])
628
629
  ]),
@@ -631,7 +632,7 @@ const E = Y({}), B = (n) => {
631
632
  }
632
633
  });
633
634
  export {
634
- Tn as TresLeches,
635
- Mn as useControls,
636
- yn as useControlsProvider
635
+ Tt as TresLeches,
636
+ Mt as useControls,
637
+ Ce as useControlsProvider
637
638
  };