@tresjs/leches 0.4.0 → 0.5.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,20 +1,20 @@
1
1
  /**
2
2
  * name: @tresjs/leches
3
- * version: v0.4.0
3
+ * version: v0.5.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 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";
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 S, computed as T, 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 C, normalizeClass as $, withDirectives as et, vShow as st, createTextVNode as zt, normalizeStyle as wt, Fragment as P, renderList as L, createCommentVNode as nt, createVNode as Mt, Transition as vt, withCtx as it, createBlock as v } from "vue";
9
+ import { useStorage as Ct, isClient as St, useDraggable as kt, useMouse as H, useFps as $t, useRafFn as Et, useWindowSize as Tt } from "@vueuse/core";
10
10
  function ot(o) {
11
11
  return ct() ? (yt(o), !0) : !1;
12
12
  }
13
13
  function q(o) {
14
14
  return typeof o == "function" ? o() : j(o);
15
15
  }
16
- const rt = typeof window < "u", ht = () => {
17
- }, N = /* @__PURE__ */ It();
16
+ const rt = typeof window < "u", at = () => {
17
+ }, U = /* @__PURE__ */ It();
18
18
  function It() {
19
19
  var o;
20
20
  return rt && ((o = window == null ? void 0 : window.navigator) == null ? void 0 : o.userAgent) && /* @__PURE__ */ /iP(ad|hone|od)/.test(window.navigator.userAgent);
@@ -23,7 +23,7 @@ function At(...o) {
23
23
  if (o.length !== 1)
24
24
  return _t(...o);
25
25
  const t = o[0];
26
- return typeof t == "function" ? xt(pt(() => ({ get: t, set: ht }))) : m(t);
26
+ return typeof t == "function" ? xt(pt(() => ({ get: t, set: at }))) : m(t);
27
27
  }
28
28
  function jt(o) {
29
29
  var t;
@@ -34,7 +34,7 @@ const qt = rt ? window : void 0;
34
34
  function Pt(...o) {
35
35
  let t, e, s, n;
36
36
  if (typeof o[0] == "string" || Array.isArray(o[0]) ? ([e, s, n] = o, t = qt) : [t, e, s, n] = o, !t)
37
- return ht;
37
+ return at;
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;
@@ -51,15 +51,15 @@ function Pt(...o) {
51
51
  };
52
52
  return ot(c), c;
53
53
  }
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) => {
54
+ var Dt = Object.defineProperty, Lt = Object.defineProperties, Vt = Object.getOwnPropertyDescriptors, F = Object.getOwnPropertySymbols, Xt = Object.prototype.hasOwnProperty, Rt = Object.prototype.propertyIsEnumerable, K = (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
- Xt.call(t, e) && U(o, e, t[e]);
57
- if (B)
58
- for (var e of B(t))
59
- Rt.call(t, e) && U(o, e, t[e]);
56
+ Xt.call(t, e) && K(o, e, t[e]);
57
+ if (F)
58
+ for (var e of F(t))
59
+ Rt.call(t, e) && K(o, e, t[e]);
60
60
  return o;
61
- }, Ft = (o, t) => Lt(o, Vt(t));
62
- const Ht = /* @__PURE__ */ C({
61
+ }, Ht = (o, t) => Lt(o, Vt(t));
62
+ const Qt = /* @__PURE__ */ S({
63
63
  name: "UseDraggable",
64
64
  props: [
65
65
  "storageKey",
@@ -77,7 +77,7 @@ const Ht = /* @__PURE__ */ C({
77
77
  "onEnd"
78
78
  ],
79
79
  setup(o, { slots: t }) {
80
- const e = m(), s = E(() => {
80
+ const e = m(), s = T(() => {
81
81
  var y;
82
82
  return (y = o.handle) != null ? y : e.value;
83
83
  }), n = o.storageKey && Ct(
@@ -87,7 +87,7 @@ const Ht = /* @__PURE__ */ C({
87
87
  ), i = n || o.initialValue || { x: 0, y: 0 }, a = (y, c) => {
88
88
  var h;
89
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), {
90
+ }, l = tt(kt(e, Ht(Yt({}, o), {
91
91
  handle: s,
92
92
  initialValue: i,
93
93
  onEnd: a
@@ -98,20 +98,20 @@ const Ht = /* @__PURE__ */ C({
98
98
  };
99
99
  }
100
100
  });
101
- function at(o) {
101
+ function ht(o) {
102
102
  const t = window.getComputedStyle(o);
103
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
106
  const e = o.parentNode;
107
- return !e || e.tagName === "BODY" ? !1 : at(e);
107
+ return !e || e.tagName === "BODY" ? !1 : ht(e);
108
108
  }
109
109
  }
110
- function Qt(o) {
110
+ function Wt(o) {
111
111
  const t = o || window.event, e = t.target;
112
- return at(e) ? !1 : t.touches.length > 1 ? !0 : (t.preventDefault && t.preventDefault(), !1);
112
+ return ht(e) ? !1 : t.touches.length > 1 ? !0 : (t.preventDefault && t.preventDefault(), !1);
113
113
  }
114
- function Wt(o, t = !1) {
114
+ function Zt(o, t = !1) {
115
115
  const e = m(t);
116
116
  let s = null, n;
117
117
  I(At(o), (l) => {
@@ -124,19 +124,19 @@ function Wt(o, t = !1) {
124
124
  });
125
125
  const i = () => {
126
126
  const l = q(o);
127
- !l || e.value || (N && (s = Pt(
127
+ !l || e.value || (U && (s = Pt(
128
128
  l,
129
129
  "touchmove",
130
130
  (y) => {
131
- Qt(y);
131
+ Wt(y);
132
132
  },
133
133
  { passive: !1 }
134
134
  )), l.style.overflow = "hidden", e.value = !0);
135
135
  }, a = () => {
136
136
  const l = q(o);
137
- !l || !e.value || (N && (s == null || s()), l.style.overflow = n, e.value = !1);
137
+ !l || !e.value || (U && (s == null || s()), l.style.overflow = n, e.value = !1);
138
138
  };
139
- return ot(a), E({
139
+ return ot(a), T({
140
140
  get() {
141
141
  return e.value;
142
142
  },
@@ -145,30 +145,30 @@ function Wt(o, t = !1) {
145
145
  }
146
146
  });
147
147
  }
148
- function Zt() {
148
+ function Bt() {
149
149
  let o = !1;
150
150
  const t = m(!1);
151
151
  return (e, s) => {
152
152
  if (t.value = s.value, o)
153
153
  return;
154
154
  o = !0;
155
- const n = Wt(e, s.value);
155
+ const n = Zt(e, s.value);
156
156
  I(t, (i) => n.value = i);
157
157
  };
158
158
  }
159
- Zt();
159
+ Bt();
160
160
  /**
161
161
  * @license
162
162
  * Copyright 2010-2023 Three.js Authors
163
163
  * SPDX-License-Identifier: MIT
164
164
  */
165
- const lt = "153";
166
- function H(o, t, e) {
165
+ const lt = "155";
166
+ function Q(o, t, e) {
167
167
  return Math.max(t, Math.min(e, o));
168
168
  }
169
- class Q {
169
+ class W {
170
170
  constructor(t = 0, e = 0) {
171
- Q.prototype.isVector2 = !0, this.x = t, this.y = e;
171
+ W.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 Q {
317
317
  if (e === 0)
318
318
  return Math.PI / 2;
319
319
  const s = this.dot(t) / e;
320
- return Math.acos(H(s, -1, 1));
320
+ return Math.acos(Q(s, -1, 1));
321
321
  }
322
322
  distanceTo(t) {
323
323
  return Math.sqrt(this.distanceToSquared(t));
@@ -361,7 +361,7 @@ class Q {
361
361
  yield this.x, yield this.y;
362
362
  }
363
363
  }
364
- class Nt {
364
+ class Ut {
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
  }
@@ -378,15 +378,15 @@ class Nt {
378
378
  }
379
379
  if (r !== b || y !== _ || c !== u || h !== x) {
380
380
  let z = 1 - l;
381
- const f = y * _ + c * u + h * x + r * b, M = f >= 0 ? 1 : -1, W = 1 - f * f;
382
- if (W > Number.EPSILON) {
383
- const S = Math.sqrt(W), Z = Math.atan2(S, f * M);
384
- z = Math.sin(z * Z) / S, l = Math.sin(l * Z) / S;
381
+ const f = y * _ + c * u + h * x + r * b, M = f >= 0 ? 1 : -1, Z = 1 - f * f;
382
+ if (Z > Number.EPSILON) {
383
+ const k = Math.sqrt(Z), B = Math.atan2(k, f * M);
384
+ z = Math.sin(z * B) / k, l = Math.sin(l * B) / k;
385
385
  }
386
386
  const D = l * M;
387
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;
388
+ const k = 1 / Math.sqrt(y * y + c * c + h * h + r * r);
389
+ y *= k, c *= k, h *= k, r *= k;
390
390
  }
391
391
  }
392
392
  t[e] = y, t[e + 1] = c, t[e + 2] = h, t[e + 3] = r;
@@ -480,7 +480,7 @@ class Nt {
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(H(this.dot(t), -1, 1)));
483
+ return 2 * Math.acos(Math.abs(Q(this.dot(t), -1, 1)));
484
484
  }
485
485
  rotateTowards(t, e) {
486
486
  const s = this.angleTo(t);
@@ -574,9 +574,9 @@ class Nt {
574
574
  yield this._x, yield this._y, yield this._z, yield this._w;
575
575
  }
576
576
  }
577
- class $ {
577
+ class E {
578
578
  constructor(t = 0, e = 0, s = 0) {
579
- $.prototype.isVector3 = !0, this.x = t, this.y = e, this.z = s;
579
+ E.prototype.isVector3 = !0, this.x = t, this.y = e, this.z = s;
580
580
  }
581
581
  set(t, e, s) {
582
582
  return s === void 0 && (s = this.z), this.x = t, this.y = e, this.z = s, this;
@@ -658,10 +658,10 @@ class $ {
658
658
  return this.x = t.x * e.x, this.y = t.y * e.y, this.z = t.z * e.z, this;
659
659
  }
660
660
  applyEuler(t) {
661
- return this.applyQuaternion(K.setFromEuler(t));
661
+ return this.applyQuaternion(N.setFromEuler(t));
662
662
  }
663
663
  applyAxisAngle(t, e) {
664
- return this.applyQuaternion(K.setFromAxisAngle(t, e));
664
+ return this.applyQuaternion(N.setFromAxisAngle(t, e));
665
665
  }
666
666
  applyMatrix3(t) {
667
667
  const e = this.x, s = this.y, n = this.z, i = t.elements;
@@ -775,7 +775,7 @@ class $ {
775
775
  if (e === 0)
776
776
  return Math.PI / 2;
777
777
  const s = this.dot(t) / e;
778
- return Math.acos(H(s, -1, 1));
778
+ return Math.acos(Q(s, -1, 1));
779
779
  }
780
780
  distanceTo(t) {
781
781
  return Math.sqrt(this.distanceToSquared(t));
@@ -843,22 +843,20 @@ class $ {
843
843
  yield this.x, yield this.y, yield this.z;
844
844
  }
845
845
  }
846
- const X = /* @__PURE__ */ new $(), K = /* @__PURE__ */ new Nt();
846
+ const X = /* @__PURE__ */ new E(), N = /* @__PURE__ */ new Ut();
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 Bt = Symbol("CONTROLS_CONTEXT_KEY"), T = tt({
852
- controls: []
853
- });
854
- function Ut() {
855
- return ft(Bt, T), T;
851
+ const Ft = Symbol("CONTROLS_CONTEXT_KEY"), w = tt({});
852
+ function Kt() {
853
+ return ft(Ft, w), w;
856
854
  }
857
855
  function R(o) {
858
856
  return Object.entries(o).map(([t, e]) => {
859
857
  let s = "string", n;
860
858
  const i = /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$|^0x([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;
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 ? {
859
+ 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 E || n instanceof E || n instanceof Array) && (s = "vector"), !V(e) && e.value ? {
862
860
  ...e,
863
861
  label: e.label || t,
864
862
  value: e.value,
@@ -872,24 +870,25 @@ function R(o) {
872
870
  };
873
871
  });
874
872
  }
875
- function Kt() {
876
- T.controls = [];
873
+ function Nt() {
874
+ for (const o in w)
875
+ delete w[o];
877
876
  }
878
877
  function Ge(o, t, e) {
879
- let s = [];
878
+ const s = m();
880
879
  if (typeof o == "string")
881
- o === "fpsgraph" ? s.push({
880
+ o === "fpsgraph" ? (w[o] = {
882
881
  label: "fpsgraph",
883
882
  visible: !0,
884
883
  type: "fpsgraph"
885
- }) : s.push({
884
+ }, s.value = w[o]) : (w[o] = {
886
885
  label: o,
887
886
  visible: !0,
888
887
  type: "folder",
889
888
  controls: R(t)
890
- });
889
+ }, s.value = w[o]);
891
890
  else if (typeof o == "object" && o.options)
892
- s.push({
891
+ w[o.label || "Dropdown"] = {
893
892
  ...e,
894
893
  label: o.label || "Dropdown",
895
894
  visible: !0,
@@ -897,24 +896,30 @@ function Ge(o, t, e) {
897
896
  type: "select",
898
897
  ref: o,
899
898
  options: o.options
900
- });
899
+ }, s.value = w[o.label || "Dropdown"];
901
900
  else if (typeof o == "object" && typeof t == "string")
902
- s.push({
901
+ w[t] = {
903
902
  ...e,
904
903
  label: t,
905
904
  visible: !0,
906
905
  value: o[t],
907
906
  type: typeof o[t],
908
907
  ref: o
909
- });
908
+ }, s.value = w[t];
910
909
  else if (gt(o)) {
911
- const n = mt(o);
912
- s = R(n);
913
- } else
914
- s = R(o);
915
- return T.controls = [...T.controls, ...s], bt(Kt), { state: T, controls: s };
910
+ const n = mt(o), i = R(n);
911
+ for (const a of i)
912
+ w[a.label] = a;
913
+ s.value = i;
914
+ } else {
915
+ const n = R(o);
916
+ for (const i of n)
917
+ w[i.label] = i;
918
+ s.value = n;
919
+ }
920
+ return bt(Nt), s;
916
921
  }
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({
922
+ 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__ */ S({
918
923
  __name: "NumberControl",
919
924
  props: {
920
925
  label: {},
@@ -927,7 +932,7 @@ const Gt = { class: "flex px-4 justify-between gap-4 items-center mb-2" }, Jt =
927
932
  const { target: r } = h;
928
933
  t("change", r.valueAsNumber);
929
934
  }
930
- const n = F(), i = m(0), a = m(!1), l = (h) => {
935
+ const n = H(), i = m(0), a = m(!1), l = (h) => {
931
936
  i.value = h.clientX, a.value = !0;
932
937
  }, y = () => {
933
938
  a.value = !1;
@@ -938,10 +943,10 @@ const Gt = { class: "flex px-4 justify-between gap-4 items-center mb-2" }, Jt =
938
943
  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;
939
944
  }
940
945
  }), (h, r) => (d(), g("div", Gt, [
941
- p("label", Jt, v(h.label), 1),
946
+ p("label", Jt, C(h.label), 1),
942
947
  p("input", {
943
948
  value: h.control.value,
944
- class: k(["p-2 w-1/3 rounded text-right text-xs text-gray-400 bg-gray-100 focus:border-gray-200 outline-none border-none font-sans", { "cursor-ew-resize": a.value }]),
949
+ class: $(["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 }]),
945
950
  type: "number",
946
951
  min: h.control.min,
947
952
  max: h.control.max,
@@ -952,7 +957,7 @@ const Gt = { class: "flex px-4 justify-between gap-4 items-center mb-2" }, Jt =
952
957
  }, null, 42, Ot)
953
958
  ]));
954
959
  }
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({
960
+ }), 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__ */ S({
956
961
  __name: "TextControl",
957
962
  props: {
958
963
  label: {},
@@ -964,7 +969,7 @@ const Gt = { class: "flex px-4 justify-between gap-4 items-center mb-2" }, Jt =
964
969
  t("change", s);
965
970
  }
966
971
  return (s, n) => (d(), g("div", ee, [
967
- p("label", se, v(s.label), 1),
972
+ p("label", se, C(s.label), 1),
968
973
  p("input", {
969
974
  value: s.control.value,
970
975
  type: "string",
@@ -973,7 +978,7 @@ const Gt = { class: "flex px-4 justify-between gap-4 items-center mb-2" }, Jt =
973
978
  }, null, 40, ne)
974
979
  ]));
975
980
  }
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({
981
+ }), oe = { class: "flex px-4 justify-start gap-2 items-center mb-2 min-h-32px" }, re = { class: "text-gray-500 w-1/3" }, ae = ["id", "checked"], he = ["for"], le = { class: "i-ic:baseline-check text-light" }, ue = /* @__PURE__ */ S({
977
982
  __name: "BooleanControl",
978
983
  props: {
979
984
  label: {},
@@ -986,29 +991,29 @@ const Gt = { class: "flex px-4 justify-between gap-4 items-center mb-2" }, Jt =
986
991
  t("change", n.checked);
987
992
  }
988
993
  return (s, n) => (d(), g("div", oe, [
989
- p("label", re, v(s.label), 1),
994
+ p("label", re, C(s.label), 1),
990
995
  p("input", {
991
996
  id: s.control.label,
992
997
  checked: s.control.value,
993
998
  class: "hidden",
994
999
  type: "checkbox",
995
1000
  onInput: e
996
- }, null, 40, he),
1001
+ }, null, 40, ae),
997
1002
  p("label", {
998
1003
  for: s.control.label,
999
1004
  class: "inline-flex items-center cursor-pointer"
1000
1005
  }, [
1001
1006
  p("span", {
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"])
1007
+ class: $([{ "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"])
1003
1008
  }, [
1004
1009
  et(p("i", le, null, 512), [
1005
1010
  [st, s.control.value]
1006
1011
  ])
1007
1012
  ], 2)
1008
- ], 8, ae)
1013
+ ], 8, he)
1009
1014
  ]));
1010
1015
  }
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({
1016
+ }), 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__ */ S({
1012
1017
  __name: "SliderControl",
1013
1018
  props: {
1014
1019
  label: {},
@@ -1021,9 +1026,9 @@ const Gt = { class: "flex px-4 justify-between gap-4 items-center mb-2" }, Jt =
1021
1026
  const { target: _ } = r;
1022
1027
  t("change", _.valueAsNumber);
1023
1028
  }
1024
- const n = E(() => ({
1029
+ const n = T(() => ({
1025
1030
  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%)`
1026
- })), i = F(), a = m(0), l = m(!1), y = (r) => {
1031
+ })), i = H(), a = m(0), l = m(!1), y = (r) => {
1027
1032
  a.value = r.clientX, l.value = !0;
1028
1033
  }, c = () => {
1029
1034
  l.value = !1;
@@ -1035,17 +1040,17 @@ const Gt = { class: "flex px-4 justify-between gap-4 items-center mb-2" }, Jt =
1035
1040
  }
1036
1041
  }), (r, _) => (d(), g("div", ce, [
1037
1042
  p("label", {
1038
- class: k(["text-gray-500 w-1/3", { "flex justify-between items-center": r.control.icon }])
1043
+ class: $(["text-gray-500 w-1/3", { "flex justify-between items-center": r.control.icon }])
1039
1044
  }, [
1040
- zt(v(r.label) + " ", 1),
1045
+ zt(C(r.label) + " ", 1),
1041
1046
  p("i", {
1042
- class: k(`i-${r.control.icon}`)
1047
+ class: $(`i-${r.control.icon}`)
1043
1048
  }, null, 2)
1044
1049
  ], 2),
1045
1050
  p("input", {
1046
1051
  value: r.control.value,
1047
1052
  class: "w-1/2 h-0.75 bg-dark-200 rounded-full appearance-none",
1048
- style: Mt(n.value),
1053
+ style: wt(n.value),
1049
1054
  type: "range",
1050
1055
  min: r.control.min,
1051
1056
  max: r.control.max,
@@ -1054,7 +1059,7 @@ const Gt = { class: "flex px-4 justify-between gap-4 items-center mb-2" }, Jt =
1054
1059
  }, null, 44, ye),
1055
1060
  p("input", {
1056
1061
  value: r.control.value,
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 }]),
1062
+ class: $(["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 }]),
1058
1063
  type: "number",
1059
1064
  min: r.control.min,
1060
1065
  max: r.control.max,
@@ -1071,7 +1076,7 @@ const pe = (o, t) => {
1071
1076
  for (const [s, n] of t)
1072
1077
  e[s] = n;
1073
1078
  return e;
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({
1079
+ }, 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__ */ S({
1075
1080
  __name: "ColorControl",
1076
1081
  props: {
1077
1082
  label: {},
@@ -1084,7 +1089,7 @@ const pe = (o, t) => {
1084
1089
  t("change", n.value);
1085
1090
  }
1086
1091
  return (s, n) => (d(), g("div", fe, [
1087
- p("label", ge, v(s.label), 1),
1092
+ p("label", ge, C(s.label), 1),
1088
1093
  p("input", {
1089
1094
  value: s.control.value,
1090
1095
  type: "color",
@@ -1099,13 +1104,13 @@ const pe = (o, t) => {
1099
1104
  ]));
1100
1105
  }
1101
1106
  });
1102
- function Me(o) {
1103
- return typeof o == "number" ? [o, o, o] : o instanceof $ ? [o.x, o.y, o.z] : o;
1107
+ function we(o) {
1108
+ return typeof o == "number" ? [o, o, o] : o instanceof E ? [o.x, o.y, o.z] : o;
1104
1109
  }
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 = {
1110
+ const Me = { 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 = {
1106
1111
  key: 0,
1107
1112
  class: "font-bold px-0.5 py-1 text-0.65rem text-gray-300"
1108
- }, ke = ["value", "onInput", "onMousedown", "onMouseup"], $e = /* @__PURE__ */ C({
1113
+ }, ke = ["value", "onInput", "onMousedown", "onMouseup"], $e = /* @__PURE__ */ S({
1109
1114
  __name: "VectorControl",
1110
1115
  props: {
1111
1116
  label: {},
@@ -1113,11 +1118,11 @@ const we = { class: "flex px-4 justify-between gap-2 items-center mb-2" }, ve =
1113
1118
  },
1114
1119
  emits: ["change"],
1115
1120
  setup(o, { emit: t }) {
1116
- const e = o, s = F(), n = m(0), i = m(!1), a = m(0), l = (x, b) => {
1121
+ const e = o, s = H(), n = m(0), i = m(!1), a = m(0), l = (x, b) => {
1117
1122
  a.value = b, n.value = x.clientX, i.value = !0;
1118
1123
  }, y = (x, b) => {
1119
1124
  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 $);
1125
+ }, c = (x) => Math.floor(Math.abs(x) / 10), h = T(() => we(e.control.value)), r = T(() => Object.keys(e.control.value)), _ = T(() => e.control.value instanceof W || e.control.value instanceof E);
1121
1126
  function u(x, b) {
1122
1127
  const { value: z } = e.control, { target: f } = x;
1123
1128
  a.value = b, z[_.value ? r.value[a.value] : a.value] = parseInt(f.value, 10), t("change", z);
@@ -1127,17 +1132,17 @@ const we = { class: "flex px-4 justify-between gap-2 items-center mb-2" }, ve =
1127
1132
  const b = x - n.value, z = c(b), { value: f } = e.control, M = _.value ? r.value[a.value] : a.value;
1128
1133
  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;
1129
1134
  }
1130
- }), (x, b) => (d(), g("div", we, [
1131
- p("label", ve, v(x.label), 1),
1135
+ }), (x, b) => (d(), g("div", Me, [
1136
+ p("label", ve, C(x.label), 1),
1132
1137
  p("div", Ce, [
1133
1138
  (d(!0), g(P, null, L(h.value, (z, f) => (d(), g("div", {
1134
1139
  key: x.label + f,
1135
1140
  class: "flex items-center w-1/3 bg-gray-100 rounded"
1136
1141
  }, [
1137
- r.value[f] && _.value ? (d(), g("span", Se, v(r.value[f]), 1)) : nt("", !0),
1142
+ r.value[f] && _.value ? (d(), g("span", Se, C(r.value[f]), 1)) : nt("", !0),
1138
1143
  p("input", {
1139
1144
  type: "text",
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 }]),
1145
+ class: $(["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 }]),
1141
1146
  value: h.value[f].toFixed(2),
1142
1147
  onInput: (M) => u(M, f),
1143
1148
  onMousedown: (M) => l(M, f),
@@ -1147,7 +1152,7 @@ const we = { class: "flex px-4 justify-between gap-2 items-center mb-2" }, ve =
1147
1152
  ])
1148
1153
  ]));
1149
1154
  }
1150
- }), Ee = { class: "mb-4" }, Te = { class: "bg-white rounded-b pt-4" }, Ie = /* @__PURE__ */ C({
1155
+ }), Ee = { class: "mb-4" }, Te = { class: "bg-white rounded-b pt-4" }, Ie = /* @__PURE__ */ S({
1151
1156
  __name: "Folder",
1152
1157
  props: {
1153
1158
  control: {}
@@ -1164,19 +1169,19 @@ const we = { class: "flex px-4 justify-between gap-2 items-center mb-2" }, ve =
1164
1169
  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",
1165
1170
  onClick: s
1166
1171
  }, [
1167
- p("span", null, v(n.control.label), 1),
1172
+ p("span", null, C(n.control.label), 1),
1168
1173
  p("i", {
1169
- class: k(e.value ? "i-ic:baseline-keyboard-arrow-up" : "i-ic:baseline-keyboard-arrow-down")
1174
+ class: $(e.value ? "i-ic:baseline-keyboard-arrow-up" : "i-ic:baseline-keyboard-arrow-down")
1170
1175
  }, null, 2)
1171
1176
  ]),
1172
- wt(vt, {
1177
+ Mt(vt, {
1173
1178
  name: "slide",
1174
1179
  "enter-active-class": " animate-fade-in animate-duration-200 animate-ease-in-out",
1175
1180
  "leave-active-class": " animate-fade-out animate-duration-200 animate-ease-in-out"
1176
1181
  }, {
1177
1182
  default: it(() => [
1178
1183
  et(p("div", Te, [
1179
- (d(!0), g(P, null, L(n.control.controls, (a) => (d(), w(ut, {
1184
+ (d(!0), g(P, null, L(n.control.controls, (a) => (d(), v(ut, {
1180
1185
  key: a.label,
1181
1186
  control: a,
1182
1187
  onChange: (l) => t(l, a)
@@ -1189,7 +1194,7 @@ const we = { class: "flex px-4 justify-between gap-2 items-center mb-2" }, ve =
1189
1194
  })
1190
1195
  ]));
1191
1196
  }
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({
1197
+ }), 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__ */ S({
1193
1198
  __name: "FPSGraph",
1194
1199
  props: {
1195
1200
  label: {},
@@ -1203,9 +1208,9 @@ const we = { class: "flex px-4 justify-between gap-2 items-center mb-2" }, ve =
1203
1208
  (l, y) => `${y * A},${Y + O - A / 2 - l * (Y + O - A) / 120}`
1204
1209
  ).join(" "));
1205
1210
  }), (a, l) => (d(), g("div", Ae, [
1206
- p("label", je, v(a.label), 1),
1211
+ p("label", je, C(a.label), 1),
1207
1212
  p("div", qe, [
1208
- p("div", Pe, v(Math.round(j(t))) + " FPS", 1),
1213
+ p("div", Pe, C(Math.round(j(t))) + " FPS", 1),
1209
1214
  (d(), g("svg", {
1210
1215
  width: G,
1211
1216
  height: Y,
@@ -1224,7 +1229,7 @@ const we = { class: "flex px-4 justify-between gap-2 items-center mb-2" }, ve =
1224
1229
  ])
1225
1230
  ]));
1226
1231
  }
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({
1232
+ }), 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"], He = /* @__PURE__ */ S({
1228
1233
  __name: "SelectControl",
1229
1234
  props: {
1230
1235
  label: {},
@@ -1236,7 +1241,7 @@ const we = { class: "flex px-4 justify-between gap-2 items-center mb-2" }, ve =
1236
1241
  t("change", s.target.value);
1237
1242
  }
1238
1243
  return (s, n) => (d(), g("div", Ve, [
1239
- p("label", Xe, v(s.label), 1),
1244
+ p("label", Xe, C(s.label), 1),
1240
1245
  p("select", {
1241
1246
  value: s.control.value,
1242
1247
  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",
@@ -1245,11 +1250,11 @@ const we = { class: "flex px-4 justify-between gap-2 items-center mb-2" }, ve =
1245
1250
  (d(!0), g(P, null, L(s.control.options, (i) => (d(), g("option", {
1246
1251
  key: i.value,
1247
1252
  value: i.value
1248
- }, v(i.text), 9, Ye))), 128))
1253
+ }, C(i.text), 9, Ye))), 128))
1249
1254
  ], 40, Re)
1250
1255
  ]));
1251
1256
  }
1252
- }), ut = /* @__PURE__ */ C({
1257
+ }), ut = /* @__PURE__ */ S({
1253
1258
  __name: "ControlInput",
1254
1259
  props: {
1255
1260
  control: {}
@@ -1260,45 +1265,45 @@ const we = { class: "flex px-4 justify-between gap-2 items-center mb-2" }, ve =
1260
1265
  t("change", s);
1261
1266
  }
1262
1267
  return (s, n) => s.control.visible ? (d(), g(P, { key: 0 }, [
1263
- s.control.type === "color" ? (d(), w(ze, {
1268
+ s.control.type === "color" ? (d(), v(ze, {
1264
1269
  key: 0,
1265
1270
  label: s.control.label,
1266
1271
  control: s.control,
1267
1272
  onChange: e
1268
- }, null, 8, ["label", "control"])) : s.control.type === "vector" ? (d(), w($e, {
1273
+ }, null, 8, ["label", "control"])) : s.control.type === "vector" ? (d(), v($e, {
1269
1274
  key: 1,
1270
1275
  label: s.control.label,
1271
1276
  control: s.control,
1272
1277
  onChange: e
1273
- }, null, 8, ["label", "control"])) : s.control.type === "boolean" ? (d(), w(ue, {
1278
+ }, null, 8, ["label", "control"])) : s.control.type === "boolean" ? (d(), v(ue, {
1274
1279
  key: 2,
1275
1280
  label: s.control.label,
1276
1281
  control: s.control,
1277
1282
  onChange: e
1278
- }, null, 8, ["label", "control"])) : s.control.type === "fpsgraph" ? (d(), w(Le, {
1283
+ }, null, 8, ["label", "control"])) : s.control.type === "fpsgraph" ? (d(), v(Le, {
1279
1284
  key: 3,
1280
1285
  label: s.control.label,
1281
1286
  control: s.control
1282
- }, null, 8, ["label", "control"])) : s.control.type === "folder" ? (d(), w(Ie, {
1287
+ }, null, 8, ["label", "control"])) : s.control.type === "folder" ? (d(), v(Ie, {
1283
1288
  key: 4,
1284
1289
  label: s.control.label,
1285
1290
  control: s.control
1286
- }, null, 8, ["label", "control"])) : s.control.type === "number" ? (d(), w(te, {
1291
+ }, null, 8, ["label", "control"])) : s.control.type === "number" ? (d(), v(te, {
1287
1292
  key: 5,
1288
1293
  label: s.control.label,
1289
1294
  control: s.control,
1290
1295
  onChange: e
1291
- }, null, 8, ["label", "control"])) : s.control.type === "range" ? (d(), w(de, {
1296
+ }, null, 8, ["label", "control"])) : s.control.type === "range" ? (d(), v(de, {
1292
1297
  key: 6,
1293
1298
  label: s.control.label,
1294
1299
  control: s.control,
1295
1300
  onChange: e
1296
- }, null, 8, ["label", "control"])) : s.control.type === "select" ? (d(), w(Fe, {
1301
+ }, null, 8, ["label", "control"])) : s.control.type === "select" ? (d(), v(He, {
1297
1302
  key: 7,
1298
1303
  label: s.control.label,
1299
1304
  control: s.control,
1300
1305
  onChange: e
1301
- }, null, 8, ["label", "control"])) : (d(), w(ie, {
1306
+ }, null, 8, ["label", "control"])) : (d(), v(ie, {
1302
1307
  key: 8,
1303
1308
  label: s.control.label,
1304
1309
  control: s.control,
@@ -1306,34 +1311,34 @@ const we = { class: "flex px-4 justify-between gap-2 items-center mb-2" }, ve =
1306
1311
  }, null, 8, ["label", "control"]))
1307
1312
  ], 64)) : nt("", !0);
1308
1313
  }
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, [
1314
+ }), Qe = { class: "bg-white shadow-xl rounded border-4 border-solid border-black" }, We = /* @__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), Ze = /* @__PURE__ */ p("div", null, [
1310
1315
  /* @__PURE__ */ p("i", { class: "i-ic-baseline-drag-indicator" }),
1311
1316
  /* @__PURE__ */ p("i", { class: "i-ic-baseline-drag-indicator" }),
1312
1317
  /* @__PURE__ */ p("i", { class: "i-ic-baseline-drag-indicator" })
1313
- ], -1), Ze = /* @__PURE__ */ p("div", null, null, -1), Ne = [
1314
- Qe,
1318
+ ], -1), Be = /* @__PURE__ */ p("div", null, null, -1), Ue = [
1315
1319
  We,
1316
- Ze
1317
- ], Be = 280, Je = /* @__PURE__ */ C({
1320
+ Ze,
1321
+ Be
1322
+ ], Fe = 280, Je = /* @__PURE__ */ S({
1318
1323
  __name: "TresLeches",
1319
1324
  setup(o) {
1320
- const { width: t } = Tt(), e = m(null), s = Ut();
1325
+ const { width: t } = Tt(), e = m(null), s = Kt();
1321
1326
  function n(i, a) {
1322
1327
  a.ref && (a.ref[a.label] = i), a.value = i;
1323
1328
  }
1324
- return (i, a) => (d(), w(j(Ht), {
1325
- "initial-value": { x: j(t) - Be - 20, y: 10 },
1329
+ return (i, a) => (d(), v(j(Qt), {
1330
+ "initial-value": { x: j(t) - Fe - 20, y: 10 },
1326
1331
  class: "fixed select-none z-24 w-280px font-sans text-xs",
1327
1332
  handle: e.value
1328
1333
  }, {
1329
1334
  default: it(() => [
1330
- p("div", He, [
1335
+ p("div", Qe, [
1331
1336
  p("header", {
1332
1337
  ref_key: "handle",
1333
1338
  ref: e,
1334
1339
  class: "relative cursor-grabbing p-4 flex justify-between text-gray-200 relative"
1335
- }, Ne, 512),
1336
- (d(!0), g(P, null, L(j(s).controls, (l) => (d(), w(ut, {
1340
+ }, Ue, 512),
1341
+ (d(!0), g(P, null, L(j(s), (l) => (d(), v(ut, {
1337
1342
  key: l.label,
1338
1343
  control: l,
1339
1344
  onChange: (y) => n(y, l)