exodeui 6.3.30 → 6.3.31

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.
Files changed (3) hide show
  1. package/dist/index.js +14 -14
  2. package/dist/index.mjs +714 -714
  3. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -40,15 +40,15 @@ function us(g) {
40
40
  lineHeight: n = 1.2,
41
41
  width: a = 200,
42
42
  letterSpacing: r = 0,
43
- paragraphSpacing: l = 0,
44
- paragraphIndent: c = 0,
43
+ paragraphSpacing: c = 0,
44
+ paragraphIndent: l = 0,
45
45
  textCase: f = "none",
46
46
  segments: u = [],
47
47
  enableSegments: h = !1
48
48
  } = g;
49
49
  let d = String(t || "");
50
50
  f === "uppercase" ? d = d.toUpperCase() : f === "lowercase" ? d = d.toLowerCase() : f === "capitalize" && (d = d.replace(/\b\w/g, (k) => k.toUpperCase())), g.hyphenation === !0 && (d = Ts(d));
51
- const p = `${s} ${e} ${o}px "${i}", sans-serif`, y = `${d}|${p}|${r}|${l}|${c}|${h}|${JSON.stringify(u)}|hyp:${!!g.hyphenation}|comp:${g.composer}|bal:${!!g.balanceRaggedLines}`;
51
+ const p = `${s} ${e} ${o}px "${i}", sans-serif`, y = `${d}|${p}|${r}|${c}|${l}|${h}|${JSON.stringify(u)}|hyp:${!!g.hyphenation}|comp:${g.composer}|bal:${!!g.balanceRaggedLines}`;
52
52
  let m = Ye.get(y);
53
53
  const b = typeof CanvasRenderingContext2D < "u" ? CanvasRenderingContext2D.prototype.measureText : null, v = function(k) {
54
54
  if (!b) return { width: 0, fontBoundingBoxAscent: 0, fontBoundingBoxDescent: 0 };
@@ -62,19 +62,19 @@ function us(g) {
62
62
  try {
63
63
  if (r !== 0 && typeof CanvasRenderingContext2D < "u" && (CanvasRenderingContext2D.prototype.measureText = v), h && u && u.length > 0) {
64
64
  const k = u.map((T) => {
65
- let R = T.text || "";
65
+ let x = T.text || "";
66
66
  const P = T.textCase || f || "none";
67
- return P === "uppercase" ? R.toUpperCase() : P === "lowercase" ? R.toLowerCase() : P === "capitalize" ? R.replace(/\b\w/g, (E) => E.toUpperCase()) : R;
67
+ return P === "uppercase" ? x.toUpperCase() : P === "lowercase" ? x.toLowerCase() : P === "capitalize" ? x.replace(/\b\w/g, (E) => E.toUpperCase()) : x;
68
68
  }).join("");
69
69
  if (m = Qe(k, p), m) {
70
- let T = 0, R = o;
70
+ let T = 0, x = o;
71
71
  for (const P of u) {
72
72
  let E = P.text || "";
73
73
  if (!E) continue;
74
- const x = P.textCase || f || "none";
75
- x === "uppercase" ? E = E.toUpperCase() : x === "lowercase" ? E = E.toLowerCase() : x === "capitalize" && (E = E.replace(/\b\w/g, ($) => $.toUpperCase()));
74
+ const R = P.textCase || f || "none";
75
+ R === "uppercase" ? E = E.toUpperCase() : R === "lowercase" ? E = E.toLowerCase() : R === "capitalize" && (E = E.replace(/\b\w/g, ($) => $.toUpperCase()));
76
76
  const O = P.fontSize || o;
77
- O > R && (R = O);
77
+ O > x && (x = O);
78
78
  const W = `${P.fontStyle || s} ${P.fontWeight || e} ${O}px "${P.fontFamily || i}", sans-serif`, B = Qe(E, W);
79
79
  if (B && B.widths)
80
80
  for (let $ = 0; $ < B.widths.length; $++) {
@@ -92,7 +92,7 @@ function us(g) {
92
92
  }
93
93
  T += E.length;
94
94
  }
95
- m.fullText = k, m.maxFontSize = R;
95
+ m.fullText = k, m.maxFontSize = x;
96
96
  }
97
97
  } else
98
98
  m = Qe(d, p);
@@ -107,12 +107,12 @@ function us(g) {
107
107
  k && Ye.delete(k);
108
108
  }
109
109
  }
110
- if (c > 0 && m && m.widths && !m.indentApplied) {
110
+ if (l > 0 && m && m.widths && !m.indentApplied) {
111
111
  const k = [...m.widths], T = m.fullText || d;
112
- let R = !0;
112
+ let x = !0;
113
113
  for (let P = 0; P < T.length; P++)
114
- R && k[P] !== void 0 && (k[P] += c, R = !1), (T[P] === `
115
- ` || T[P] === "\r") && (R = !0, T[P] === "\r" && T[P + 1] === `
114
+ x && k[P] !== void 0 && (k[P] += l, x = !1), (T[P] === `
115
+ ` || T[P] === "\r") && (x = !0, T[P] === "\r" && T[P + 1] === `
116
116
  ` && P++);
117
117
  m = { ...m, widths: k, indentApplied: !0 };
118
118
  }
@@ -125,7 +125,7 @@ function us(g) {
125
125
  if (a >= 1e5) {
126
126
  const T = d.split(/\r\n|\r|\n/);
127
127
  C = {
128
- lines: T.map((R) => ({ text: R, width: 0 })),
128
+ lines: T.map((x) => ({ text: x, width: 0 })),
129
129
  // Width will be measured below
130
130
  height: T.length * (S * k),
131
131
  lineCount: T.length
@@ -136,12 +136,12 @@ function us(g) {
136
136
  r !== 0 && b && (CanvasRenderingContext2D.prototype.measureText = b);
137
137
  }
138
138
  let w = (C == null ? void 0 : C.height) !== void 0 && C.height > 0 ? C.height : (((M = C == null ? void 0 : C.lines) == null ? void 0 : M.length) || 0) * S * o;
139
- if (l > 0 && C && C.lines && C.lines.length > 1) {
139
+ if (c > 0 && C && C.lines && C.lines.length > 1) {
140
140
  let k = 0;
141
141
  const T = m.fullText || t;
142
- for (let R = 0; R < C.lines.length - 1; R++)
143
- k += C.lines[R].text.length, (T[k] === `
144
- ` || T[k] === "\r") && (w += l, k++, T[k - 1] === "\r" && T[k] === `
142
+ for (let x = 0; x < C.lines.length - 1; x++)
143
+ k += C.lines[x].text.length, (T[k] === `
144
+ ` || T[k] === "\r") && (w += c, k++, T[k - 1] === "\r" && T[k] === `
145
145
  ` && k++);
146
146
  }
147
147
  let I = (C == null ? void 0 : C.lines) || [];
@@ -160,15 +160,15 @@ function es(g, t, i) {
160
160
  }
161
161
  const e = o.split(/\s+/).filter(Boolean), s = new Array(e.length).fill(0);
162
162
  let n = t - (e.length - 1) * i, a = 0;
163
- if (e.forEach((r, l) => {
163
+ if (e.forEach((r, c) => {
164
164
  if (r.endsWith("px")) {
165
- const c = parseFloat(r);
166
- s[l] = c, n -= c;
167
- } else r.endsWith("fr") ? a += parseFloat(r) : r === "auto" && (s[l] = 100, n -= 100);
165
+ const l = parseFloat(r);
166
+ s[c] = l, n -= l;
167
+ } else r.endsWith("fr") ? a += parseFloat(r) : r === "auto" && (s[c] = 100, n -= 100);
168
168
  }), a > 0 && n > 0) {
169
169
  const r = n / a;
170
- e.forEach((l, c) => {
171
- l.endsWith("fr") && (s[c] = r * parseFloat(l));
170
+ e.forEach((c, l) => {
171
+ c.endsWith("fr") && (s[l] = r * parseFloat(c));
172
172
  });
173
173
  }
174
174
  return s;
@@ -182,8 +182,8 @@ function ss(g, t, i) {
182
182
  }
183
183
  }
184
184
  function Es(g, t, i) {
185
- var E, x;
186
- const o = g.autoLayout, { direction: e, spacing: s, padding: n, align: a, wrap: r } = o, l = e === "vertical", c = t.map((O) => {
185
+ var E, R;
186
+ const o = g.autoLayout, { direction: e, spacing: s, padding: n, align: a, wrap: r } = o, c = e === "vertical", l = t.map((O) => {
187
187
  const W = i(O.id), B = O.geometry;
188
188
  let $ = (W == null ? void 0 : W.width) ?? B.width ?? 100, Y = (W == null ? void 0 : W.height) ?? B.height ?? 100;
189
189
  if (B.type === "Ellipse" || B.type === "Polygon" || B.type === "Star") {
@@ -210,46 +210,46 @@ function Es(g, t, i) {
210
210
  return $ *= O.transform.scale_x || 1, Y *= O.transform.scale_y || 1, { id: O.id, w: $, h: Y, original: O };
211
211
  });
212
212
  let f = g.width, u = g.height;
213
- const h = ((E = g.layoutProps) == null ? void 0 : E.width) === "hug", d = ((x = g.layoutProps) == null ? void 0 : x.height) === "hug", p = [];
213
+ const h = ((E = g.layoutProps) == null ? void 0 : E.width) === "hug", d = ((R = g.layoutProps) == null ? void 0 : R.height) === "hug", p = [];
214
214
  let y = [], m = 0, b = 0;
215
215
  const v = f - n.left - n.right, S = u - n.top - n.bottom;
216
- c.forEach((O) => {
217
- r && y.length > 0 && (l ? b + s + O.h > S : m + s + O.w > v) ? (p.push({ children: y, width: m, height: b }), y = [O], m = O.w, b = O.h) : (y.push(O), l ? (m = Math.max(m, O.w), b += (y.length > 1 ? s : 0) + O.h) : (m += (y.length > 1 ? s : 0) + O.w, b = Math.max(b, O.h)));
218
- }), y.length > 0 && p.push({ children: y, width: m, height: b }), h && !l && (f = Math.max(...p.map((O) => O.width), 0) + n.left + n.right), d && l && (u = Math.max(...p.map((O) => O.height), 0) + n.top + n.bottom);
216
+ l.forEach((O) => {
217
+ r && y.length > 0 && (c ? b + s + O.h > S : m + s + O.w > v) ? (p.push({ children: y, width: m, height: b }), y = [O], m = O.w, b = O.h) : (y.push(O), c ? (m = Math.max(m, O.w), b += (y.length > 1 ? s : 0) + O.h) : (m += (y.length > 1 ? s : 0) + O.w, b = Math.max(b, O.h)));
218
+ }), y.length > 0 && p.push({ children: y, width: m, height: b }), h && !c && (f = Math.max(...p.map((O) => O.width), 0) + n.left + n.right), d && c && (u = Math.max(...p.map((O) => O.height), 0) + n.top + n.bottom);
219
219
  const C = [];
220
220
  let w = n.left, I = n.top;
221
- const M = a.toLowerCase(), k = M === "center" || M.endsWith("-center"), T = M.endsWith("-right"), R = M === "center" || M.startsWith("center-"), P = M.startsWith("bottom-");
221
+ const M = a.toLowerCase(), k = M === "center" || M.endsWith("-center"), T = M.endsWith("-right"), x = M === "center" || M.startsWith("center-"), P = M.startsWith("bottom-");
222
222
  return p.forEach((O) => {
223
223
  let W = w, B = I;
224
- l ? R ? B = n.top + (u - n.top - n.bottom - O.height) / 2 : P && (B = u - n.bottom - O.height) : k ? W = n.left + (f - n.left - n.right - O.width) / 2 : T && (W = f - n.right - O.width), O.children.forEach(($) => {
224
+ c ? x ? B = n.top + (u - n.top - n.bottom - O.height) / 2 : P && (B = u - n.bottom - O.height) : k ? W = n.left + (f - n.left - n.right - O.width) / 2 : T && (W = f - n.right - O.width), O.children.forEach(($) => {
225
225
  var _, L;
226
226
  let Y = W, H = B;
227
- l ? k ? Y += (O.width - $.w) / 2 : T && (Y += O.width - $.w) : R ? H += (O.height - $.h) / 2 : P && (H += O.height - $.h);
227
+ c ? k ? Y += (O.width - $.w) / 2 : T && (Y += O.width - $.w) : x ? H += (O.height - $.h) / 2 : P && (H += O.height - $.h);
228
228
  const K = ((_ = $.original.layoutProps) == null ? void 0 : _.width) === "fill", A = ((L = $.original.layoutProps) == null ? void 0 : L.height) === "fill";
229
229
  C.push({
230
230
  id: $.id,
231
231
  x: Y + $.w / 2 - f / 2,
232
232
  y: H + $.h / 2 - u / 2,
233
- width: K && l ? O.width : void 0,
234
- height: A ? l ? void 0 : O.height : void 0
235
- }), l ? B += $.h + s : W += $.w + s;
236
- }), l ? w += O.width + s : I += O.height + s;
233
+ width: K && c ? O.width : void 0,
234
+ height: A ? c ? void 0 : O.height : void 0
235
+ }), c ? B += $.h + s : W += $.w + s;
236
+ }), c ? w += O.width + s : I += O.height + s;
237
237
  }), { frameWidth: h ? f : void 0, frameHeight: d ? u : void 0, childUpdates: C };
238
238
  }
239
239
  function As(g, t, i) {
240
240
  const o = g.autoLayout;
241
241
  if (!o) return { childUpdates: [] };
242
- const { gridColumns: e, gridRows: s, columnGap: n = 0, rowGap: a = 0, padding: r, align: l } = o;
243
- let c = g.width, f = g.height;
244
- const u = c - r.left - r.right, h = f - r.top - r.bottom, d = es(e || "1fr", u, n), p = es(s || "auto", h, a), y = d.length > 0 ? d.reduce((T, R) => T + R, 0) + (d.length - 1) * n : 0, m = p.length > 0 ? p.reduce((T, R) => T + R, 0) + (p.length - 1) * a : 0, b = l.toLowerCase(), v = b === "center" || b.endsWith("-center"), S = b.endsWith("-right"), C = b === "center" || b.startsWith("center-"), w = b.startsWith("bottom-");
242
+ const { gridColumns: e, gridRows: s, columnGap: n = 0, rowGap: a = 0, padding: r, align: c } = o;
243
+ let l = g.width, f = g.height;
244
+ const u = l - r.left - r.right, h = f - r.top - r.bottom, d = es(e || "1fr", u, n), p = es(s || "auto", h, a), y = d.length > 0 ? d.reduce((T, x) => T + x, 0) + (d.length - 1) * n : 0, m = p.length > 0 ? p.reduce((T, x) => T + x, 0) + (p.length - 1) * a : 0, b = c.toLowerCase(), v = b === "center" || b.endsWith("-center"), S = b.endsWith("-right"), C = b === "center" || b.startsWith("center-"), w = b.startsWith("bottom-");
245
245
  let I = 0, M = 0;
246
246
  v ? I = (u - y) / 2 : S && (I = u - y), C ? M = (h - m) / 2 : w && (M = h - m);
247
247
  const k = [];
248
- return t.forEach((T, R) => {
248
+ return t.forEach((T, x) => {
249
249
  var L, X;
250
- const P = R % d.length || 0, E = Math.floor(R / d.length) || 0;
250
+ const P = x % d.length || 0, E = Math.floor(x / d.length) || 0;
251
251
  E >= p.length && p.push(100);
252
- const x = d[P], O = p[E];
252
+ const R = d[P], O = p[E];
253
253
  let W = r.left + I + d.slice(0, P).reduce((V, it) => V + it + n, 0), B = r.top + M + p.slice(0, E).reduce((V, it) => V + it + a, 0);
254
254
  const $ = i(T.id), Y = T.geometry;
255
255
  let H = ($ == null ? void 0 : $.width) ?? Y.width ?? 100, K = ($ == null ? void 0 : $.height) ?? Y.height ?? 100;
@@ -259,11 +259,11 @@ function As(g, t, i) {
259
259
  }
260
260
  H *= T.transform.scale_x || 1, K *= T.transform.scale_y || 1;
261
261
  let A = W, _ = B;
262
- v ? A += (x - H) / 2 : S && (A += x - H), C ? _ += (O - K) / 2 : w && (_ += O - K), k.push({
262
+ v ? A += (R - H) / 2 : S && (A += R - H), C ? _ += (O - K) / 2 : w && (_ += O - K), k.push({
263
263
  id: T.id,
264
- x: A + H / 2 - c / 2,
264
+ x: A + H / 2 - l / 2,
265
265
  y: _ + K / 2 - f / 2,
266
- width: ((L = T.layoutProps) == null ? void 0 : L.width) === "fill" ? x : void 0,
266
+ width: ((L = T.layoutProps) == null ? void 0 : L.width) === "fill" ? R : void 0,
267
267
  height: ((X = T.layoutProps) == null ? void 0 : X.height) === "fill" ? O : void 0
268
268
  });
269
269
  }), { childUpdates: k };
@@ -404,8 +404,8 @@ class Os {
404
404
  const e = new Jt.Vector2(t.anchorA.x, t.anchorA.y), s = new Jt.Vector2(t.anchorB.x, t.anchorB.y);
405
405
  let n;
406
406
  if (t.type === "Distance") {
407
- const a = t.length ?? 100, r = t.stiffness ?? 100, l = t.damping ?? 10;
408
- n = Jt.JointData.spring(a, r, l, e, s);
407
+ const a = t.length ?? 100, r = t.stiffness ?? 100, c = t.damping ?? 10;
408
+ n = Jt.JointData.spring(a, r, c, e, s);
409
409
  } else
410
410
  n = Jt.JointData.revolute(e, s);
411
411
  try {
@@ -427,21 +427,21 @@ class Os {
427
427
  }
428
428
  }
429
429
  }
430
- const ps = (g) => g, Rs = (g) => g > 0 ? 1 : 0, xs = (g) => g < 1 ? 0 : 1, is = (g) => g * g, ns = (g) => g * (2 - g), os = (g) => g < 0.5 ? 2 * g * g : -1 + (4 - 2 * g) * g, Ls = (g) => g * g * g, Fs = (g) => --g * g * g + 1, $s = (g) => g < 0.5 ? 4 * g * g * g : (g - 1) * (2 * g - 2) * (2 * g - 2) + 1, Ws = (g) => g * g * g * g, Bs = (g) => 1 - --g * g * g * g, Ys = (g) => g < 0.5 ? 8 * g * g * g * g : 1 - 8 * --g * g * g * g, Xs = (g) => g * g * g * g * g, Gs = (g) => 1 + --g * g * g * g * g, Ds = (g) => g < 0.5 ? 16 * g * g * g * g * g : 1 + 16 * --g * g * g * g * g, zs = (g) => 1 - Math.cos(g * Math.PI / 2), Vs = (g) => Math.sin(g * Math.PI / 2), Ns = (g) => -(Math.cos(Math.PI * g) - 1) / 2, Hs = (g) => g === 0 ? 0 : Math.pow(2, 10 * (g - 1)), Us = (g) => g === 1 ? 1 : 1 - Math.pow(2, -10 * g), qs = (g) => g === 0 ? 0 : g === 1 ? 1 : g < 0.5 ? Math.pow(2, 20 * g - 10) / 2 : (2 - Math.pow(2, -20 * g + 10)) / 2, Js = (g) => 1 - Math.sqrt(1 - g * g), Qs = (g) => Math.sqrt(1 - --g * g), Ks = (g) => g < 0.5 ? (1 - Math.sqrt(1 - 4 * g * g)) / 2 : (Math.sqrt(1 - (-2 * g + 2) * (-2 * g + 2)) + 1) / 2, Je = 1.70158, He = Je * 1.525, gs = Je + 1, Zs = (g) => gs * g * g * g - Je * g * g, js = (g) => 1 + gs * Math.pow(g - 1, 3) + Je * Math.pow(g - 1, 2), ti = (g) => g < 0.5 ? Math.pow(2 * g, 2) * ((He + 1) * 2 * g - He) / 2 : (Math.pow(2 * g - 2, 2) * ((He + 1) * (g * 2 - 2) + He) + 2) / 2, ms = 2 * Math.PI / 3, as = 2 * Math.PI / 4.5, ei = (g) => g === 0 ? 0 : g === 1 ? 1 : -Math.pow(2, 10 * g - 10) * Math.sin((g * 10 - 10.75) * ms), si = (g) => g === 0 ? 0 : g === 1 ? 1 : Math.pow(2, -10 * g) * Math.sin((g * 10 - 0.75) * ms) + 1, ii = (g) => g === 0 ? 0 : g === 1 ? 1 : g < 0.5 ? -(Math.pow(2, 20 * g - 10) * Math.sin((20 * g - 11.125) * as)) / 2 : Math.pow(2, -20 * g + 10) * Math.sin((20 * g - 11.125) * as) / 2 + 1, qe = (g) => g < 1 / 2.75 ? 7.5625 * g * g : g < 2 / 2.75 ? 7.5625 * (g -= 1.5 / 2.75) * g + 0.75 : g < 2.5 / 2.75 ? 7.5625 * (g -= 2.25 / 2.75) * g + 0.9375 : 7.5625 * (g -= 2.625 / 2.75) * g + 0.984375, ni = (g) => 1 - qe(1 - g), oi = qe, ai = (g) => g < 0.5 ? (1 - qe(1 - 2 * g)) / 2 : (1 + qe(2 * g - 1)) / 2, Ke = /* @__PURE__ */ new Map(), Xe = (g, t, i, o) => {
430
+ const ps = (g) => g, xs = (g) => g > 0 ? 1 : 0, Rs = (g) => g < 1 ? 0 : 1, is = (g) => g * g, ns = (g) => g * (2 - g), os = (g) => g < 0.5 ? 2 * g * g : -1 + (4 - 2 * g) * g, Ls = (g) => g * g * g, Fs = (g) => --g * g * g + 1, $s = (g) => g < 0.5 ? 4 * g * g * g : (g - 1) * (2 * g - 2) * (2 * g - 2) + 1, Ws = (g) => g * g * g * g, Bs = (g) => 1 - --g * g * g * g, Ys = (g) => g < 0.5 ? 8 * g * g * g * g : 1 - 8 * --g * g * g * g, Xs = (g) => g * g * g * g * g, Gs = (g) => 1 + --g * g * g * g * g, Ds = (g) => g < 0.5 ? 16 * g * g * g * g * g : 1 + 16 * --g * g * g * g * g, zs = (g) => 1 - Math.cos(g * Math.PI / 2), Vs = (g) => Math.sin(g * Math.PI / 2), Ns = (g) => -(Math.cos(Math.PI * g) - 1) / 2, Hs = (g) => g === 0 ? 0 : Math.pow(2, 10 * (g - 1)), Us = (g) => g === 1 ? 1 : 1 - Math.pow(2, -10 * g), qs = (g) => g === 0 ? 0 : g === 1 ? 1 : g < 0.5 ? Math.pow(2, 20 * g - 10) / 2 : (2 - Math.pow(2, -20 * g + 10)) / 2, Js = (g) => 1 - Math.sqrt(1 - g * g), Qs = (g) => Math.sqrt(1 - --g * g), Ks = (g) => g < 0.5 ? (1 - Math.sqrt(1 - 4 * g * g)) / 2 : (Math.sqrt(1 - (-2 * g + 2) * (-2 * g + 2)) + 1) / 2, Je = 1.70158, He = Je * 1.525, gs = Je + 1, Zs = (g) => gs * g * g * g - Je * g * g, js = (g) => 1 + gs * Math.pow(g - 1, 3) + Je * Math.pow(g - 1, 2), ti = (g) => g < 0.5 ? Math.pow(2 * g, 2) * ((He + 1) * 2 * g - He) / 2 : (Math.pow(2 * g - 2, 2) * ((He + 1) * (g * 2 - 2) + He) + 2) / 2, ms = 2 * Math.PI / 3, as = 2 * Math.PI / 4.5, ei = (g) => g === 0 ? 0 : g === 1 ? 1 : -Math.pow(2, 10 * g - 10) * Math.sin((g * 10 - 10.75) * ms), si = (g) => g === 0 ? 0 : g === 1 ? 1 : Math.pow(2, -10 * g) * Math.sin((g * 10 - 0.75) * ms) + 1, ii = (g) => g === 0 ? 0 : g === 1 ? 1 : g < 0.5 ? -(Math.pow(2, 20 * g - 10) * Math.sin((20 * g - 11.125) * as)) / 2 : Math.pow(2, -20 * g + 10) * Math.sin((20 * g - 11.125) * as) / 2 + 1, qe = (g) => g < 1 / 2.75 ? 7.5625 * g * g : g < 2 / 2.75 ? 7.5625 * (g -= 1.5 / 2.75) * g + 0.75 : g < 2.5 / 2.75 ? 7.5625 * (g -= 2.25 / 2.75) * g + 0.9375 : 7.5625 * (g -= 2.625 / 2.75) * g + 0.984375, ni = (g) => 1 - qe(1 - g), oi = qe, ai = (g) => g < 0.5 ? (1 - qe(1 - 2 * g)) / 2 : (1 + qe(2 * g - 1)) / 2, Ke = /* @__PURE__ */ new Map(), Xe = (g, t, i, o) => {
431
431
  const e = `${g},${t},${i},${o}`;
432
432
  if (Ke.has(e)) return Ke.get(e);
433
- const s = (c) => (1 - 3 * i + 3 * g) * c * c * c + (3 * i - 6 * g) * c * c + 3 * g * c, n = (c) => (1 - 3 * o + 3 * t) * c * c * c + (3 * o - 6 * t) * c * c + 3 * t * c, a = (c) => 3 * (1 - 3 * i + 3 * g) * c * c + 2 * (3 * i - 6 * g) * c + 3 * g, r = (c) => {
434
- let f = c;
433
+ const s = (l) => (1 - 3 * i + 3 * g) * l * l * l + (3 * i - 6 * g) * l * l + 3 * g * l, n = (l) => (1 - 3 * o + 3 * t) * l * l * l + (3 * o - 6 * t) * l * l + 3 * t * l, a = (l) => 3 * (1 - 3 * i + 3 * g) * l * l + 2 * (3 * i - 6 * g) * l + 3 * g, r = (l) => {
434
+ let f = l;
435
435
  for (let u = 0; u < 8; u++) {
436
- const h = s(f) - c;
436
+ const h = s(f) - l;
437
437
  if (Math.abs(h) < 1e-6) return f;
438
438
  const d = a(f);
439
439
  if (Math.abs(d) < 1e-6) break;
440
440
  f = f - h / d;
441
441
  }
442
442
  return f;
443
- }, l = (c) => c === 0 ? 0 : c === 1 ? 1 : n(r(c));
444
- return Ke.set(e, l), l;
443
+ }, c = (l) => l === 0 ? 0 : l === 1 ? 1 : n(r(l));
444
+ return Ke.set(e, c), c;
445
445
  }, rs = (g) => {
446
446
  const t = g.match(/cubic-bezier\s*\(\s*([-?\d.]+)\s*,\s*([-?\d.]+)\s*,\s*([-?\d.]+)\s*,\s*([-?\d.]+)\s*\)/);
447
447
  if (!t) return null;
@@ -500,8 +500,8 @@ const ps = (g) => g, Rs = (g) => g > 0 ? 1 : 0, xs = (g) => g < 1 ? 0 : 1, is =
500
500
  EaseOut: ns,
501
501
  EaseInOut: os,
502
502
  // Discrete
503
- StepStart: Rs,
504
- StepEnd: xs
503
+ StepStart: xs,
504
+ StepEnd: Rs
505
505
  }, ri = (g) => {
506
506
  const t = g.trim(), i = t.toLowerCase();
507
507
  if (Ue[t]) return Ue[t];
@@ -572,10 +572,10 @@ const ps = (g) => g, Rs = (g) => g > 0 ? 1 : 0, xs = (g) => g < 1 ? 0 : 1, is =
572
572
  }
573
573
  }, li = (g, t, i, o, e) => {
574
574
  if (!g || !t || !i) return g;
575
- const s = o.scale_x ?? 1, n = o.scale_y ?? 1, a = (r, l, c) => {
575
+ const s = o.scale_x ?? 1, n = o.scale_y ?? 1, a = (r, c, l) => {
576
576
  let f = 0, u = 0;
577
- const h = o.rotation * Math.PI / 180, d = Math.cos(h), p = Math.sin(h), y = r * s * d - l * n * p + o.x, m = r * s * p + l * n * d + o.y;
578
- c.forEach((M) => {
577
+ const h = o.rotation * Math.PI / 180, d = Math.cos(h), p = Math.sin(h), y = r * s * d - c * n * p + o.x, m = r * s * p + c * n * d + o.y;
578
+ l.forEach((M) => {
579
579
  const k = e(M.boneId);
580
580
  if (!k) return;
581
581
  const T = {
@@ -584,14 +584,14 @@ const ps = (g) => g, Rs = (g) => g > 0 ? 1 : 0, xs = (g) => g < 1 ? 0 : 1, is =
584
584
  rotation: k.rotation,
585
585
  scaleX: k.scale_x ?? 1,
586
586
  scaleY: k.scale_y ?? 1
587
- }, R = i[M.boneId] || [1, 0, 0, 1, 0, 0], P = y * R[0] + m * R[2] + R[4], E = y * R[1] + m * R[3] + R[5], x = T.rotation * Math.PI / 180, O = Math.cos(x), W = Math.sin(x), B = P * T.scaleX * O - E * T.scaleY * W + T.x, $ = P * T.scaleX * W + E * T.scaleY * O + T.y;
587
+ }, x = i[M.boneId] || [1, 0, 0, 1, 0, 0], P = y * x[0] + m * x[2] + x[4], E = y * x[1] + m * x[3] + x[5], R = T.rotation * Math.PI / 180, O = Math.cos(R), W = Math.sin(R), B = P * T.scaleX * O - E * T.scaleY * W + T.x, $ = P * T.scaleX * W + E * T.scaleY * O + T.y;
588
588
  f += B * M.amount, u += $ * M.amount;
589
589
  });
590
- const b = [...c].sort((M, k) => k.amount - M.amount);
590
+ const b = [...l].sort((M, k) => k.amount - M.amount);
591
591
  if (b.length >= 2 && b[0].amount > 0 && b[1].amount > 0) {
592
592
  const M = e(b[0].boneId), k = e(b[1].boneId);
593
593
  if (M && k && M.length !== void 0 && k.length !== void 0) {
594
- const T = M.length * (M.scale_y ?? 1), R = M.rotation * Math.PI / 180, P = M.x - T * Math.sin(R), E = M.y + T * Math.cos(R), x = k.length * (k.scale_y ?? 1), O = k.rotation * Math.PI / 180, W = k.x - x * Math.sin(O), B = k.y + x * Math.cos(O);
594
+ const T = M.length * (M.scale_y ?? 1), x = M.rotation * Math.PI / 180, P = M.x - T * Math.sin(x), E = M.y + T * Math.cos(x), R = k.length * (k.scale_y ?? 1), O = k.rotation * Math.PI / 180, W = k.x - R * Math.sin(O), B = k.y + R * Math.cos(O);
595
595
  let $ = null, Y = null, H = !1;
596
596
  const K = 1;
597
597
  if (Math.hypot(M.x - k.x, M.y - k.y) < K || Math.hypot(M.x - W, M.y - B) < K ? ($ = M.x, Y = M.y) : (Math.hypot(P - k.x, E - k.y) < K || Math.hypot(P - W, E - B) < K) && ($ = P, Y = E, H = !0), $ !== null && Y !== null) {
@@ -620,16 +620,16 @@ const ps = (g) => g, Rs = (g) => g > 0 ? 1 : 0, xs = (g) => g < 1 ? 0 : 1, is =
620
620
  y: (-w * C + I * S) / n
621
621
  };
622
622
  };
623
- return g.map((r, l) => {
624
- const c = t[l];
625
- if (!c || c.length === 0) return { ...r };
626
- const f = { ...r, ...a(r.x, r.y, c) };
623
+ return g.map((r, c) => {
624
+ const l = t[c];
625
+ if (!l || l.length === 0) return { ...r };
626
+ const f = { ...r, ...a(r.x, r.y, l) };
627
627
  if (r.in_x !== void 0 && r.in_y !== void 0) {
628
- const u = a(r.in_x, r.in_y, c);
628
+ const u = a(r.in_x, r.in_y, l);
629
629
  f.in_x = u.x, f.in_y = u.y;
630
630
  }
631
631
  if (r.out_x !== void 0 && r.out_y !== void 0) {
632
- const u = a(r.out_x, r.out_y, c);
632
+ const u = a(r.out_x, r.out_y, l);
633
633
  f.out_x = u.x, f.out_y = u.y;
634
634
  }
635
635
  return f;
@@ -905,7 +905,7 @@ class ci {
905
905
  }
906
906
  svgPathToPoints(t) {
907
907
  const i = /([MLHVCSQTAZmlhvcsqtaz])([^MLHVCSQTAZmlhvcsqtaz]*)/g, o = /[-+]?(?:\d*\.\d+|\d+)(?:[eE][-+]?\d+)?/g, e = [];
908
- let s = !1, n = 0, a = 0, r = 0, l = 0, c = 0, f = 0, u;
908
+ let s = !1, n = 0, a = 0, r = 0, c = 0, l = 0, f = 0, u;
909
909
  for (; (u = i.exec(t)) !== null; ) {
910
910
  const h = u[1], d = (u[2].match(o) || []).map(parseFloat), p = h === h.toLowerCase(), y = h.toUpperCase();
911
911
  let m = 0;
@@ -916,7 +916,7 @@ class ci {
916
916
  switch (y) {
917
917
  case "M": {
918
918
  const S = v();
919
- for (c = n = S.x, f = a = S.y, e.push({ x: n, y: a, in_x: n, in_y: a, out_x: n, out_y: a, moveTo: !0 }); m < d.length; ) {
919
+ for (l = n = S.x, f = a = S.y, e.push({ x: n, y: a, in_x: n, in_y: a, out_x: n, out_y: a, moveTo: !0 }); m < d.length; ) {
920
920
  const C = v();
921
921
  n = C.x, a = C.y, e.push({ x: n, y: a, in_x: n, in_y: a, out_x: n, out_y: a });
922
922
  }
@@ -943,17 +943,17 @@ class ci {
943
943
  const I = e[e.length - 1];
944
944
  I.out_x = S.x, I.out_y = S.y;
945
945
  }
946
- n = w.x, a = w.y, e.push({ x: n, y: a, in_x: C.x, in_y: C.y, out_x: n, out_y: a }), r = C.x, l = C.y;
946
+ n = w.x, a = w.y, e.push({ x: n, y: a, in_x: C.x, in_y: C.y, out_x: n, out_y: a }), r = C.x, c = C.y;
947
947
  }
948
948
  break;
949
949
  case "S":
950
950
  for (; m < d.length; ) {
951
- const S = { x: 2 * n - r, y: 2 * a - l }, C = v(), w = v();
951
+ const S = { x: 2 * n - r, y: 2 * a - c }, C = v(), w = v();
952
952
  if (e.length > 0) {
953
953
  const I = e[e.length - 1];
954
954
  I.out_x = S.x, I.out_y = S.y;
955
955
  }
956
- n = w.x, a = w.y, e.push({ x: n, y: a, in_x: C.x, in_y: C.y, out_x: n, out_y: a }), r = C.x, l = C.y;
956
+ n = w.x, a = w.y, e.push({ x: n, y: a, in_x: C.x, in_y: C.y, out_x: n, out_y: a }), r = C.x, c = C.y;
957
957
  }
958
958
  break;
959
959
  case "Q":
@@ -963,17 +963,17 @@ class ci {
963
963
  const w = e[e.length - 1];
964
964
  w.out_x = w.x + 2 / 3 * (S.x - w.x), w.out_y = w.y + 2 / 3 * (S.y - w.y);
965
965
  }
966
- n = C.x, a = C.y, e.push({ x: n, y: a, in_x: n + 2 / 3 * (S.x - n), in_y: a + 2 / 3 * (S.y - a), out_x: n, out_y: a }), r = S.x, l = S.y;
966
+ n = C.x, a = C.y, e.push({ x: n, y: a, in_x: n + 2 / 3 * (S.x - n), in_y: a + 2 / 3 * (S.y - a), out_x: n, out_y: a }), r = S.x, c = S.y;
967
967
  }
968
968
  break;
969
969
  case "T":
970
970
  for (; m < d.length; ) {
971
- const S = { x: 2 * n - r, y: 2 * a - l }, C = v();
971
+ const S = { x: 2 * n - r, y: 2 * a - c }, C = v();
972
972
  if (e.length > 0) {
973
973
  const w = e[e.length - 1];
974
974
  w.out_x = w.x + 2 / 3 * (S.x - w.x), w.out_y = w.y + 2 / 3 * (S.y - w.y);
975
975
  }
976
- n = C.x, a = C.y, e.push({ x: n, y: a, in_x: n + 2 / 3 * (S.x - n), in_y: a + 2 / 3 * (S.y - a), out_x: n, out_y: a }), r = S.x, l = S.y;
976
+ n = C.x, a = C.y, e.push({ x: n, y: a, in_x: n + 2 / 3 * (S.x - n), in_y: a + 2 / 3 * (S.y - a), out_x: n, out_y: a }), r = S.x, c = S.y;
977
977
  }
978
978
  break;
979
979
  case "Z":
@@ -983,7 +983,7 @@ class ci {
983
983
  const C = [...e].reverse().find((w) => w.moveTo) || e[0];
984
984
  C && Math.hypot(C.x - S.x, C.y - S.y) < 0.1 && (C.in_x = S.in_x, C.in_y = S.in_y, e.pop(), e.length > 0 && (e[e.length - 1].closePath = !0));
985
985
  }
986
- n = c, a = f;
986
+ n = l, a = f;
987
987
  break;
988
988
  default:
989
989
  if (d.length >= 2) {
@@ -1060,20 +1060,20 @@ class ci {
1060
1060
  if (!t) return;
1061
1061
  let i = this.decompressStrings(t);
1062
1062
  const o = [], e = /* @__PURE__ */ new Set(), s = (r) => {
1063
- r && r.forEach((l) => {
1064
- if (e.has(l.id)) return;
1065
- const c = { ...l }, f = c.childrenObjects || [];
1066
- e.add(c.id), o.push(c), s(f);
1063
+ r && r.forEach((c) => {
1064
+ if (e.has(c.id)) return;
1065
+ const l = { ...c }, f = l.childrenObjects || [];
1066
+ e.add(l.id), o.push(l), s(f);
1067
1067
  });
1068
1068
  };
1069
1069
  if (s(i.objects || []), o.length > (i.objects || []).length && this.log(`[Engine] Flattened artboard from ${(i.objects || []).length} to ${o.length} objects.`), i.objects = o, this.artboard = i, this.currentTime = 0, this.objectStates.clear(), this.log(`[ExodeUIEngine] Loading artboard: "${(n = this.artboard) == null ? void 0 : n.name}" with ${(a = this.artboard) == null ? void 0 : a.objects.length} objects`), this.artboard && this.artboard.objects) {
1070
1070
  const r = /* @__PURE__ */ new Map();
1071
- this.artboard.objects.forEach((l) => {
1072
- r.set(l.id, l), l.children || (l.children = []);
1073
- }), this.artboard.objects.forEach((l) => {
1074
- if (l.parentId) {
1075
- const c = r.get(l.parentId);
1076
- c && (c.children || (c.children = []), c.children.includes(l.id) || c.children.push(l.id));
1071
+ this.artboard.objects.forEach((c) => {
1072
+ r.set(c.id, c), c.children || (c.children = []);
1073
+ }), this.artboard.objects.forEach((c) => {
1074
+ if (c.parentId) {
1075
+ const l = r.get(c.parentId);
1076
+ l && (l.children || (l.children = []), l.children.includes(c.id) || l.children.push(c.id));
1077
1077
  }
1078
1078
  });
1079
1079
  }
@@ -1123,11 +1123,11 @@ class ci {
1123
1123
  reset() {
1124
1124
  if (!this.artboard) return;
1125
1125
  if (this.objectStates.clear(), this.objectVelocities.clear(), this.currentTime = 0, this.inputs.clear(), this.inputNameMap.clear(), this.layerStates.clear(), this.logicNodeValues.clear(), this.justFiredTriggers.clear(), this.inputs.set("mouseX", 0), this.inputs.set("mouseY", 0), this.inputs.set("scrollX", 0), this.inputs.set("scrollY", 0), this.inputs.set("isMouseDown", !1), this.physicsEngine && (this.physicsEngine.destroy(), this.physicsEngine = null), this._layoutAnimCache.clear(), this._springChainState.clear(), this._emitterPools.clear(), this.artboard.objects.forEach((i) => {
1126
- var n, a, r, l, c, f, u;
1127
- const o = i.width ?? ((n = i.geometry) == null ? void 0 : n.width) ?? 0, e = i.height ?? ((a = i.geometry) == null ? void 0 : a.height) ?? 0, s = i.cornerRadius ?? i.corner_radius ?? ((r = i.geometry) == null ? void 0 : r.corner_radius) ?? ((l = i.geometry) == null ? void 0 : l.cornerRadius) ?? 0;
1126
+ var n, a, r, c, l, f, u;
1127
+ const o = i.width ?? ((n = i.geometry) == null ? void 0 : n.width) ?? 0, e = i.height ?? ((a = i.geometry) == null ? void 0 : a.height) ?? 0, s = i.cornerRadius ?? i.corner_radius ?? ((r = i.geometry) == null ? void 0 : r.corner_radius) ?? ((c = i.geometry) == null ? void 0 : c.cornerRadius) ?? 0;
1128
1128
  this.objectStates.set(i.id, {
1129
1129
  ...i.transform || {},
1130
- x: ((c = i.transform) == null ? void 0 : c.x) ?? i.x ?? 0,
1130
+ x: ((l = i.transform) == null ? void 0 : l.x) ?? i.x ?? 0,
1131
1131
  y: ((f = i.transform) == null ? void 0 : f.y) ?? i.y ?? 0,
1132
1132
  width: o,
1133
1133
  height: e,
@@ -1164,14 +1164,14 @@ class ci {
1164
1164
  if ((s = e.physics) != null && s.enabled && e.type === "Shape") {
1165
1165
  const a = this.objectStates.get(e.id);
1166
1166
  if (!a) return;
1167
- const r = e.geometry.width || 100, l = e.geometry.height || 100;
1167
+ const r = e.geometry.width || 100, c = e.geometry.height || 100;
1168
1168
  this.physicsEngine.createBody({
1169
1169
  id: e.id,
1170
1170
  type: ((n = e.geometry) == null ? void 0 : n.type) || "Rectangle",
1171
1171
  x: a.x,
1172
1172
  y: a.y,
1173
1173
  width: r,
1174
- height: l,
1174
+ height: c,
1175
1175
  rotation: a.rotation * (Math.PI / 180),
1176
1176
  // Convert deg to rad
1177
1177
  isStatic: e.physics.bodyType === "Static",
@@ -1208,8 +1208,8 @@ class ci {
1208
1208
  n.forEach((a) => {
1209
1209
  const r = this.objectStates.get(a.id);
1210
1210
  if (r) {
1211
- const l = Math.abs(r.x - a.x), c = Math.abs(r.y - a.y);
1212
- !t && (l > 20 || c > 20) ? (r.x += (a.x - r.x) * o, r.y += (a.y - r.y) * o) : (r.x = a.x, r.y = a.y), a.width !== void 0 && (r.width = a.width), a.height !== void 0 && (r.height = a.height);
1211
+ const c = Math.abs(r.x - a.x), l = Math.abs(r.y - a.y);
1212
+ !t && (c > 20 || l > 20) ? (r.x += (a.x - r.x) * o, r.y += (a.y - r.y) * o) : (r.x = a.x, r.y = a.y), a.width !== void 0 && (r.width = a.width), a.height !== void 0 && (r.height = a.height);
1213
1213
  }
1214
1214
  });
1215
1215
  };
@@ -1220,10 +1220,10 @@ class ci {
1220
1220
  this.artboard.objects.forEach((n) => {
1221
1221
  var a;
1222
1222
  if (n.type === "Frame" && ((a = n.autoLayout) != null && a.enabled) && n.children && n.children.length > 0) {
1223
- const r = n.children.map((f) => i.get(f)).filter((f) => !!f), l = this.objectStates.get(n.id);
1224
- if (!l) return;
1225
- const c = ss(l, r, (f) => this.objectStates.get(f));
1226
- c.frameWidth !== void 0 && (l.width = c.frameWidth), c.frameHeight !== void 0 && (l.height = c.frameHeight), e(c.childUpdates);
1223
+ const r = n.children.map((f) => i.get(f)).filter((f) => !!f), c = this.objectStates.get(n.id);
1224
+ if (!c) return;
1225
+ const l = ss(c, r, (f) => this.objectStates.get(f));
1226
+ l.frameWidth !== void 0 && (c.width = l.frameWidth), l.frameHeight !== void 0 && (c.height = l.frameHeight), e(l.childUpdates);
1227
1227
  }
1228
1228
  });
1229
1229
  }
@@ -1274,21 +1274,21 @@ class ci {
1274
1274
  const a = this.activeStateMachine.layers.find((r) => r.name === t);
1275
1275
  if (a)
1276
1276
  for (const r of i) {
1277
- const l = a.states.find((c) => c.id === r);
1278
- if (l)
1279
- if (l.isBlendState && l.blendAnimations && l.blendAnimations.length > 0)
1280
- e.push({ animation: null, state: l }), l.blendAnimations.forEach((c) => {
1281
- const f = this.artboard.animations.find((u) => u.id === c.animationId);
1277
+ const c = a.states.find((l) => l.id === r);
1278
+ if (c)
1279
+ if (c.isBlendState && c.blendAnimations && c.blendAnimations.length > 0)
1280
+ e.push({ animation: null, state: c }), c.blendAnimations.forEach((l) => {
1281
+ const f = this.artboard.animations.find((u) => u.id === l.animationId);
1282
1282
  f && (s = Math.max(s, f.duration));
1283
1283
  });
1284
1284
  else {
1285
- let c = null;
1286
- l.animationId && (c = this.artboard.animations.find((f) => f.id === l.animationId) || null), c || (c = this.artboard.animations.find(
1285
+ let l = null;
1286
+ c.animationId && (l = this.artboard.animations.find((f) => f.id === c.animationId) || null), l || (l = this.artboard.animations.find(
1287
1287
  (f) => {
1288
1288
  var u, h;
1289
- return f.name === l.name || f.id === l.name || (l.name === "Entry" || l.id === "entry") && (((u = f.name) == null ? void 0 : u.toLowerCase()) === "onload" || ((h = f.name) == null ? void 0 : h.toLowerCase()) === "intro");
1289
+ return f.name === c.name || f.id === c.name || (c.name === "Entry" || c.id === "entry") && (((u = f.name) == null ? void 0 : u.toLowerCase()) === "onload" || ((h = f.name) == null ? void 0 : h.toLowerCase()) === "intro");
1290
1290
  }
1291
- ) || null), c && ((n = this.artboard.animationFlow) != null && n.some((u) => (u.trigger === "on_load" || u.trigger === "after_delay") && u.targetAnimationId === (c == null ? void 0 : c.id)) || (e.push({ animation: c, state: l }), s = Math.max(s, c.duration)));
1291
+ ) || null), l && ((n = this.artboard.animationFlow) != null && n.some((u) => (u.trigger === "on_load" || u.trigger === "after_delay") && u.targetAnimationId === (l == null ? void 0 : l.id)) || (e.push({ animation: l, state: c }), s = Math.max(s, l.duration)));
1292
1292
  }
1293
1293
  }
1294
1294
  }
@@ -1334,22 +1334,22 @@ class ci {
1334
1334
  var n, a, r;
1335
1335
  let o;
1336
1336
  if (this.inputs.has(t)) {
1337
- const l = (n = this.activeStateMachine) == null ? void 0 : n.inputs.find((c) => c.id === t);
1338
- l && typeof l.value == "object" && (o = l.value.type);
1337
+ const c = (n = this.activeStateMachine) == null ? void 0 : n.inputs.find((l) => l.id === t);
1338
+ c && typeof c.value == "object" && (o = c.value.type);
1339
1339
  } else {
1340
- const l = this.inputNameMap.get(t);
1341
- if (l && l.length > 0) {
1342
- const c = (a = this.activeStateMachine) == null ? void 0 : a.inputs.find((f) => f.id === l[0]);
1343
- c && typeof c.value == "object" && (o = c.value.type);
1340
+ const c = this.inputNameMap.get(t);
1341
+ if (c && c.length > 0) {
1342
+ const l = (a = this.activeStateMachine) == null ? void 0 : a.inputs.find((f) => f.id === c[0]);
1343
+ l && typeof l.value == "object" && (o = l.value.type);
1344
1344
  }
1345
1345
  }
1346
1346
  let e = i;
1347
1347
  o === "Trigger" && (i === 1 ? e = !0 : i === 0 && (e = !1)), this.inputs.has(t) && this.setInternalInput(t, e);
1348
1348
  const s = this.inputNameMap.get(t);
1349
- s && s.forEach((l) => this.setInternalInput(l, e)), o === "Trigger" && e === !0 && (this.justFiredTriggers.add(t), s && s.forEach((l) => this.justFiredTriggers.add(l))), Array.isArray(e) && ((r = this.artboard) == null || r.objects.forEach((l) => {
1350
- if (l.inputId === t || l.name === t) {
1351
- const c = this.objectStates.get(l.id);
1352
- c && c.options && (l.type === "ListView" || l.variant === "listview" ? c.options.items = e : (l.type === "Dropdown" || l.variant === "dropdown") && (c.options.optionsList = e));
1349
+ s && s.forEach((c) => this.setInternalInput(c, e)), o === "Trigger" && e === !0 && (this.justFiredTriggers.add(t), s && s.forEach((c) => this.justFiredTriggers.add(c))), Array.isArray(e) && ((r = this.artboard) == null || r.objects.forEach((c) => {
1350
+ if (c.inputId === t || c.name === t) {
1351
+ const l = this.objectStates.get(c.id);
1352
+ l && l.options && (c.type === "ListView" || c.variant === "listview" ? l.options.items = e : (c.type === "Dropdown" || c.variant === "dropdown") && (l.options.optionsList = e));
1353
1353
  }
1354
1354
  })), this.evaluateTransitions(), this.evaluateVariableTriggers(t, e);
1355
1355
  }
@@ -1359,42 +1359,42 @@ class ci {
1359
1359
  o.forEach((s) => {
1360
1360
  if (s.trigger === "variable" && s.conditionVariableId && s.targetAnimationId && (s.conditionVariableId === t || e && e.includes(s.conditionVariableId))) {
1361
1361
  const a = s.conditionOperator || "IsTrue", r = s.conditionValue;
1362
- let l = !1;
1362
+ let c = !1;
1363
1363
  switch (a) {
1364
1364
  case "Equal":
1365
1365
  case "==":
1366
- l = i == r;
1366
+ c = i == r;
1367
1367
  break;
1368
1368
  case "NotEqual":
1369
1369
  case "!=":
1370
- l = i != r;
1370
+ c = i != r;
1371
1371
  break;
1372
1372
  case "GreaterThan":
1373
1373
  case ">":
1374
- l = i > r;
1374
+ c = i > r;
1375
1375
  break;
1376
1376
  case "LessThan":
1377
1377
  case "<":
1378
- l = i < r;
1378
+ c = i < r;
1379
1379
  break;
1380
1380
  case "GreaterEqual":
1381
1381
  case ">=":
1382
- l = i >= r;
1382
+ c = i >= r;
1383
1383
  break;
1384
1384
  case "LessEqual":
1385
1385
  case "<=":
1386
- l = i <= r;
1386
+ c = i <= r;
1387
1387
  break;
1388
1388
  case "IsTrue":
1389
- l = !!i;
1389
+ c = !!i;
1390
1390
  break;
1391
1391
  case "IsFalse":
1392
- l = !i;
1392
+ c = !i;
1393
1393
  break;
1394
1394
  }
1395
- if (l) {
1396
- const c = s.delay || 0;
1397
- c <= 0 ? this.triggerGlobalAnimation(s.targetAnimationId, s.subAnimationIds, s.loop, s.id) : setTimeout(() => this.triggerGlobalAnimation(s.targetAnimationId, s.subAnimationIds, s.loop, s.id), c);
1395
+ if (c) {
1396
+ const l = s.delay || 0;
1397
+ l <= 0 ? this.triggerGlobalAnimation(s.targetAnimationId, s.subAnimationIds, s.loop, s.id) : setTimeout(() => this.triggerGlobalAnimation(s.targetAnimationId, s.subAnimationIds, s.loop, s.id), l);
1398
1398
  }
1399
1399
  }
1400
1400
  });
@@ -1417,7 +1417,7 @@ class ci {
1417
1417
  const s = this.findGlobalTransition(t, i.currentStateIds);
1418
1418
  s && (o.length = 0, o.push(s.targetStateId), e = !0, s.conditions && (s.conditions || []).forEach((n) => {
1419
1419
  var r;
1420
- const a = (r = this.activeStateMachine) == null ? void 0 : r.inputs.find((l) => l.id === n.inputId);
1420
+ const a = (r = this.activeStateMachine) == null ? void 0 : r.inputs.find((c) => c.id === n.inputId);
1421
1421
  a && typeof a.value == "object" && a.value.type === "Trigger" && this.setInternalInput(n.inputId, !1);
1422
1422
  }));
1423
1423
  }
@@ -1494,7 +1494,7 @@ class ci {
1494
1494
  });
1495
1495
  }
1496
1496
  evaluateLogicTree(t, i = null, o = /* @__PURE__ */ new Set()) {
1497
- var a, r, l, c, f, u;
1497
+ var a, r, c, l, f, u;
1498
1498
  if (o.has(t))
1499
1499
  return this.inputs.get(t) ?? this.logicNodeValues.get(t) ?? 0;
1500
1500
  o.add(t);
@@ -1704,7 +1704,7 @@ class ci {
1704
1704
  }
1705
1705
  case St.SPRING_PULL: {
1706
1706
  const p = h("objectId", ""), y = h("forceX", 0), m = h("forceY", 0);
1707
- p && ((l = this.artboard) == null || l.objects.forEach((b) => {
1707
+ p && ((c = this.artboard) == null || c.objects.forEach((b) => {
1708
1708
  b.behaviors && b.behaviors.forEach((v) => {
1709
1709
  var S;
1710
1710
  if (v.type === N.SpringChain && ((S = v.settings) != null && S.connections) && (v.settings.connections.some((w) => w.targetId === p) || b.id === p)) {
@@ -1741,7 +1741,7 @@ class ci {
1741
1741
  }
1742
1742
  case St.EMIT: {
1743
1743
  const p = h("objectId", ""), y = h("count", 20);
1744
- p && ((c = this.artboard) == null || c.objects.forEach((m) => {
1744
+ p && ((l = this.artboard) == null || l.objects.forEach((m) => {
1745
1745
  m.behaviors && m.behaviors.forEach((b) => {
1746
1746
  b.type === N.ParticleEmitter && m.id === p && (b._pendingBurst = (b._pendingBurst || 0) + y);
1747
1747
  });
@@ -1837,11 +1837,11 @@ class ci {
1837
1837
  }), i.forEach((o) => {
1838
1838
  this.layerStates.delete(o), this.debugLog(`[Engine] Cleaned up completed global layer: ${o}`);
1839
1839
  }), this.solveConstraints(t), this.solveBehaviors(t), this.activeTriggers.forEach((o, e) => {
1840
- var s, n, a, r, l, c, f;
1840
+ var s, n, a, r, c, l, f;
1841
1841
  if (o.phase === "entry")
1842
1842
  o.time += t, o.time >= o.animation.duration && ((a = (n = (s = this.artboard) == null ? void 0 : s.objects.find((u) => u.id === e)) == null ? void 0 : n.triggers) == null || a.find((u) => u.id === o.triggerId), o.phase = "hold", o.elapsedHold = 0, o.time = o.animation.duration), this.applyAnimation(o.animation, o.time, o.filterObjectIds || o.filterObjectId || void 0);
1843
1843
  else if (o.phase === "hold") {
1844
- const u = (c = (l = (r = this.artboard) == null ? void 0 : r.objects.find((p) => p.id === e)) == null ? void 0 : l.triggers) == null ? void 0 : c.find((p) => p.id === o.triggerId), h = (u == null ? void 0 : u.duration) || 0;
1844
+ const u = (l = (c = (r = this.artboard) == null ? void 0 : r.objects.find((p) => p.id === e)) == null ? void 0 : c.triggers) == null ? void 0 : l.find((p) => p.id === o.triggerId), h = (u == null ? void 0 : u.duration) || 0;
1845
1845
  o.elapsedHold += t * 1e3;
1846
1846
  let d = o.elapsedHold >= h;
1847
1847
  if ((u == null ? void 0 : u.eventType) === "hover" && !this.activeHoverIds.has(e) && (d = !0), ((u == null ? void 0 : u.eventType) === "onHold" || (u == null ? void 0 : u.eventType) === "pointerDown") && !this.isMouseDown && (d = !0), d)
@@ -1860,7 +1860,7 @@ class ci {
1860
1860
  if (o && o.isEnabled && o.triggerType === "visible") {
1861
1861
  const a = this.objectStates.get(i.id);
1862
1862
  if (a && a.visible !== !1) {
1863
- const r = this.getGlobalTransform(i.id), l = (((s = i.geometry) == null ? void 0 : s.width) || 100) * (r.scale_x || 1), c = (((n = i.geometry) == null ? void 0 : n.height) || 100) * (r.scale_y || 1), f = 50, u = r.x + l / 2 >= -this.canvasWidth / 2 - f && r.x - l / 2 <= this.canvasWidth / 2 + f && r.y + c / 2 >= -this.canvasHeight / 2 - f && r.y - c / 2 <= this.canvasHeight / 2 + f, h = `analytics_${i.id}`, d = this.wasInView.has(h);
1863
+ const r = this.getGlobalTransform(i.id), c = (((s = i.geometry) == null ? void 0 : s.width) || 100) * (r.scale_x || 1), l = (((n = i.geometry) == null ? void 0 : n.height) || 100) * (r.scale_y || 1), f = 50, u = r.x + c / 2 >= -this.canvasWidth / 2 - f && r.x - c / 2 <= this.canvasWidth / 2 + f && r.y + l / 2 >= -this.canvasHeight / 2 - f && r.y - l / 2 <= this.canvasHeight / 2 + f, h = `analytics_${i.id}`, d = this.wasInView.has(h);
1864
1864
  u && !d && this.fireAnalyticsEvent(i.id, "visible"), u ? this.wasInView.add(h) : this.wasInView.delete(h);
1865
1865
  }
1866
1866
  }
@@ -1869,7 +1869,7 @@ class ci {
1869
1869
  o.length !== 0 && o.forEach((e) => {
1870
1870
  const s = e.triggers || [e.event || e.trigger];
1871
1871
  s && s.forEach((n) => {
1872
- var r, l, c;
1872
+ var r, c, l;
1873
1873
  const a = n.toLowerCase();
1874
1874
  if (a === "on interval" || a === "oninterval") {
1875
1875
  const f = e.intervalValue || 2e3, u = this.periodicTriggerTimes.get(e.id) || 0;
@@ -1882,12 +1882,12 @@ class ci {
1882
1882
  if (a === "scroll into view" || a === "scrollintoview") {
1883
1883
  const f = this.objectStates.get(i.id);
1884
1884
  if (f && f.visible !== !1) {
1885
- const u = this.getGlobalTransform(i.id), h = (((r = i.geometry) == null ? void 0 : r.width) || 100) * (u.scale_x || 1), d = (((l = i.geometry) == null ? void 0 : l.height) || 100) * (u.scale_y || 1), p = 50, y = u.x + h / 2 >= -this.canvasWidth / 2 - p && u.x - h / 2 <= this.canvasWidth / 2 + p && u.y + d / 2 >= -this.canvasHeight / 2 - p && u.y - d / 2 <= this.canvasHeight / 2 + p, m = this.wasInView.has(i.id);
1885
+ const u = this.getGlobalTransform(i.id), h = (((r = i.geometry) == null ? void 0 : r.width) || 100) * (u.scale_x || 1), d = (((c = i.geometry) == null ? void 0 : c.height) || 100) * (u.scale_y || 1), p = 50, y = u.x + h / 2 >= -this.canvasWidth / 2 - p && u.x - h / 2 <= this.canvasWidth / 2 + p && u.y + d / 2 >= -this.canvasHeight / 2 - p && u.y - d / 2 <= this.canvasHeight / 2 + p, m = this.wasInView.has(i.id);
1886
1886
  y && !m && (!e.conditions || this.checkConditions(e.conditions)) && this.fireEventForObject(i.id, "Scroll Into View"), y ? this.wasInView.add(i.id) : this.wasInView.delete(i.id);
1887
1887
  }
1888
1888
  }
1889
1889
  if (a === "scroll progress" || a === "scrollprogress") {
1890
- const f = Math.abs(this.scrollOffset.y) / (((c = this.artboard) == null ? void 0 : c.height) || 1e3), u = this.scrollProgressLastValue.get(e.id) || 0;
1890
+ const f = Math.abs(this.scrollOffset.y) / (((l = this.artboard) == null ? void 0 : l.height) || 1e3), u = this.scrollProgressLastValue.get(e.id) || 0;
1891
1891
  Math.abs(f - u) > 1e-3 && (this.scrollProgressLastValue.set(e.id, f), (e.action === "Set Input" || e.action === "setInput") && this.updateInput(e.targetInputId, f));
1892
1892
  }
1893
1893
  });
@@ -1901,17 +1901,17 @@ class ci {
1901
1901
  if (!o) return;
1902
1902
  const e = this.getGlobalTransform(i.id);
1903
1903
  if (i.constraints.forEach((s, n) => {
1904
- var c, f, u, h, d, p, y, m, b;
1905
- const a = ((c = o.constraints) == null ? void 0 : c[n]) || {}, r = { ...s, ...a }, l = r.strength ?? 1;
1904
+ var l, f, u, h, d, p, y, m, b;
1905
+ const a = ((l = o.constraints) == null ? void 0 : l[n]) || {}, r = { ...s, ...a }, c = r.strength ?? 1;
1906
1906
  if (r.type === "Translation") {
1907
1907
  const v = this.getGlobalTransform(r.targetId);
1908
1908
  if (v) {
1909
1909
  const S = r.offsetX || 0, C = r.offsetY || 0, w = v.x + S, I = v.y + C, M = r.useSpring;
1910
1910
  if (M) {
1911
- const T = this.objectVelocities.get(i.id) || { vx: 0, vy: 0 }, { x: R, y: P, vx: E, vy: x } = this.computeSpring(e.x, e.y, T.vx, T.vy, w, I, r, t);
1912
- r.copyX && (e.x = e.x + (R - e.x) * l), r.copyY && (e.y = e.y + (P - e.y) * l), this.objectVelocities.set(i.id, { vx: E, vy: x });
1911
+ const T = this.objectVelocities.get(i.id) || { vx: 0, vy: 0 }, { x, y: P, vx: E, vy: R } = this.computeSpring(e.x, e.y, T.vx, T.vy, w, I, r, t);
1912
+ r.copyX && (e.x = e.x + (x - e.x) * c), r.copyY && (e.y = e.y + (P - e.y) * c), this.objectVelocities.set(i.id, { vx: E, vy: R });
1913
1913
  } else
1914
- r.copyX && (e.x = e.x + (w - e.x) * l), r.copyY && (e.y = e.y + (I - e.y) * l);
1914
+ r.copyX && (e.x = e.x + (w - e.x) * c), r.copyY && (e.y = e.y + (I - e.y) * c);
1915
1915
  let k = !1;
1916
1916
  if ((f = r.limitX) != null && f.enabled) {
1917
1917
  const T = e.x;
@@ -1927,25 +1927,25 @@ class ci {
1927
1927
  const v = this.getGlobalTransform(r.targetId);
1928
1928
  if (v) {
1929
1929
  let C = (v.rotation + (r.offset || 0) - e.rotation) % 360;
1930
- C > 180 && (C -= 360), C < -180 && (C += 360), e.rotation = e.rotation + C * l;
1930
+ C > 180 && (C -= 360), C < -180 && (C += 360), e.rotation = e.rotation + C * c;
1931
1931
  }
1932
1932
  } else if (r.type === "Scale") {
1933
1933
  const v = this.getGlobalTransform(r.targetId);
1934
- v && (r.copyX && (e.scale_x = e.scale_x + (v.scale_x - e.scale_x) * l), r.copyY && (e.scale_y = e.scale_y + (v.scale_y - e.scale_y) * l));
1934
+ v && (r.copyX && (e.scale_x = e.scale_x + (v.scale_x - e.scale_x) * c), r.copyY && (e.scale_y = e.scale_y + (v.scale_y - e.scale_y) * c));
1935
1935
  } else if (r.type === "Transform") {
1936
1936
  const v = this.getGlobalTransform(r.targetId);
1937
1937
  if (v) {
1938
- e.x = e.x + (v.x - e.x) * l, e.y = e.y + (v.y - e.y) * l;
1938
+ e.x = e.x + (v.x - e.x) * c, e.y = e.y + (v.y - e.y) * c;
1939
1939
  let S = (v.rotation - e.rotation) % 360;
1940
- S > 180 && (S -= 360), S < -180 && (S += 360), e.rotation = e.rotation + S * l, e.scale_x = e.scale_x + (v.scale_x - e.scale_x) * l, e.scale_y = e.scale_y + (v.scale_y - e.scale_y) * l;
1940
+ S > 180 && (S -= 360), S < -180 && (S += 360), e.rotation = e.rotation + S * c, e.scale_x = e.scale_x + (v.scale_x - e.scale_x) * c, e.scale_y = e.scale_y + (v.scale_y - e.scale_y) * c;
1941
1941
  }
1942
1942
  } else if (r.type === "FollowPointer") {
1943
1943
  const v = ((h = this._lastPointerPos) == null ? void 0 : h.x) ?? e.x, S = ((d = this._lastPointerPos) == null ? void 0 : d.y) ?? e.y, C = r.useSpring;
1944
1944
  if (C) {
1945
- const I = this.objectVelocities.get(i.id) || { vx: 0, vy: 0 }, { x: M, y: k, vx: T, vy: R } = this.computeSpring(e.x, e.y, I.vx, I.vy, v, S, r, t);
1946
- e.x = M, e.y = k, this.objectVelocities.set(i.id, { vx: T, vy: R });
1945
+ const I = this.objectVelocities.get(i.id) || { vx: 0, vy: 0 }, { x: M, y: k, vx: T, vy: x } = this.computeSpring(e.x, e.y, I.vx, I.vy, v, S, r, t);
1946
+ e.x = M, e.y = k, this.objectVelocities.set(i.id, { vx: T, vy: x });
1947
1947
  } else
1948
- e.x = e.x + (v - e.x) * l, e.y = e.y + (S - e.y) * l;
1948
+ e.x = e.x + (v - e.x) * c, e.y = e.y + (S - e.y) * c;
1949
1949
  let w = !1;
1950
1950
  if ((p = r.limitX) != null && p.enabled) {
1951
1951
  const I = e.x;
@@ -1977,7 +1977,7 @@ class ci {
1977
1977
  }
1978
1978
  if (w > 0) {
1979
1979
  const k = e.x === v.x && e.y === v.y ? 1 : M / w;
1980
- e.x = e.x + (v.x + S * k - e.x) * l, e.y = e.y + (v.y + C * k - e.y) * l;
1980
+ e.x = e.x + (v.x + S * k - e.x) * c, e.y = e.y + (v.y + C * k - e.y) * c;
1981
1981
  }
1982
1982
  }
1983
1983
  } else if (r.type === "FollowPath") {
@@ -1993,22 +1993,22 @@ class ci {
1993
1993
  _ && (C = _.geometry);
1994
1994
  }
1995
1995
  if (!C) return;
1996
- const w = (r.distance || 0) / 100, I = S.width || C.width || 0, M = S.height || C.height || 0, k = this.getPointOnPath(C, I, M, w), T = S.rotation * Math.PI / 180, R = Math.cos(T), P = Math.sin(T), E = k.x * S.scale_x * R - k.y * S.scale_y * P, x = k.x * S.scale_x * P + k.y * S.scale_y * R;
1996
+ const w = (r.distance || 0) / 100, I = S.width || C.width || 0, M = S.height || C.height || 0, k = this.getPointOnPath(C, I, M, w), T = S.rotation * Math.PI / 180, x = Math.cos(T), P = Math.sin(T), E = k.x * S.scale_x * x - k.y * S.scale_y * P, R = k.x * S.scale_x * P + k.y * S.scale_y * x;
1997
1997
  let O = S.rotation + (r.offsetRotation || 0);
1998
1998
  if (r.orient) {
1999
- const _ = Math.cos(k.angle), L = Math.sin(k.angle), X = _ * S.scale_x * R - L * S.scale_y * P, V = _ * S.scale_x * P + L * S.scale_y * R;
1999
+ const _ = Math.cos(k.angle), L = Math.sin(k.angle), X = _ * S.scale_x * x - L * S.scale_y * P, V = _ * S.scale_x * P + L * S.scale_y * x;
2000
2000
  O = Math.atan2(V, X) * 180 / Math.PI + (r.offsetRotation || 0);
2001
2001
  }
2002
- const W = O * Math.PI / 180, B = Math.cos(W), $ = Math.sin(W), Y = (r.offsetX || 0) * B - (r.offsetY || 0) * $, H = (r.offsetX || 0) * $ + (r.offsetY || 0) * B, K = S.x + E + Y, A = S.y + x + H;
2003
- if (e.x = e.x + (K - e.x) * l, e.y = e.y + (A - e.y) * l, r.orient) {
2002
+ const W = O * Math.PI / 180, B = Math.cos(W), $ = Math.sin(W), Y = (r.offsetX || 0) * B - (r.offsetY || 0) * $, H = (r.offsetX || 0) * $ + (r.offsetY || 0) * B, K = S.x + E + Y, A = S.y + R + H;
2003
+ if (e.x = e.x + (K - e.x) * c, e.y = e.y + (A - e.y) * c, r.orient) {
2004
2004
  let _ = (O - e.rotation) % 360;
2005
- _ > 180 && (_ -= 360), _ < -180 && (_ += 360), e.rotation = e.rotation + _ * l;
2005
+ _ > 180 && (_ -= 360), _ < -180 && (_ += 360), e.rotation = e.rotation + _ * c;
2006
2006
  }
2007
2007
  }
2008
2008
  }
2009
2009
  } else if (r.type === "IK") {
2010
2010
  const v = this.getGlobalTransform(r.targetId);
2011
- v && this.solveIK(i, v, r.boneCount || 2, l);
2011
+ v && this.solveIK(i, v, r.boneCount || 2, c);
2012
2012
  }
2013
2013
  }), i.constraints.some((s) => s.type !== "IK")) {
2014
2014
  const s = this.globalToLocal(i.parentId, e);
@@ -2030,10 +2030,10 @@ class ci {
2030
2030
  scale_y: (i.scale_y ?? 1) * (i.flip_y ? -1 : 1),
2031
2031
  length: e
2032
2032
  };
2033
- const s = this.getGlobalTransform(o.parentId), n = s.rotation * Math.PI / 180, a = Math.cos(n), r = Math.sin(n), l = s.x + (i.x * s.scale_x * a - i.y * s.scale_y * r), c = s.y + (i.x * s.scale_x * r + i.y * s.scale_y * a);
2033
+ const s = this.getGlobalTransform(o.parentId), n = s.rotation * Math.PI / 180, a = Math.cos(n), r = Math.sin(n), c = s.x + (i.x * s.scale_x * a - i.y * s.scale_y * r), l = s.y + (i.x * s.scale_x * r + i.y * s.scale_y * a);
2034
2034
  return {
2035
- x: l,
2036
- y: c,
2035
+ x: c,
2036
+ y: l,
2037
2037
  rotation: s.rotation + i.rotation,
2038
2038
  scale_x: s.scale_x * (i.scale_x ?? 1) * (i.flip_x ? -1 : 1),
2039
2039
  scale_y: s.scale_y * (i.scale_y ?? 1) * (i.flip_y ? -1 : 1),
@@ -2042,7 +2042,7 @@ class ci {
2042
2042
  }
2043
2043
  globalToLocal(t, i) {
2044
2044
  if (!t) return i;
2045
- const o = this.getGlobalTransform(t), e = o.scale_x === 0 ? 0 : 1 / o.scale_x, s = o.scale_y === 0 ? 0 : 1 / o.scale_y, n = -o.rotation * Math.PI / 180, a = Math.cos(n), r = Math.sin(n), l = i.x - o.x, c = i.y - o.y, f = (l * a - c * r) * e, u = (l * r + c * a) * s;
2045
+ const o = this.getGlobalTransform(t), e = o.scale_x === 0 ? 0 : 1 / o.scale_x, s = o.scale_y === 0 ? 0 : 1 / o.scale_y, n = -o.rotation * Math.PI / 180, a = Math.cos(n), r = Math.sin(n), c = i.x - o.x, l = i.y - o.y, f = (c * a - l * r) * e, u = (c * r + l * a) * s;
2046
2046
  return {
2047
2047
  x: f,
2048
2048
  y: u,
@@ -2052,11 +2052,11 @@ class ci {
2052
2052
  };
2053
2053
  }
2054
2054
  solveIK(t, i, o, e) {
2055
- var l;
2055
+ var c;
2056
2056
  const s = [];
2057
2057
  let n = t.id;
2058
- for (let c = 0; c < o && n; c++) {
2059
- const f = (l = this.artboard) == null ? void 0 : l.objects.find((u) => u.id === n);
2058
+ for (let l = 0; l < o && n; l++) {
2059
+ const f = (c = this.artboard) == null ? void 0 : c.objects.find((u) => u.id === n);
2060
2060
  if (!f) break;
2061
2061
  s.push({
2062
2062
  id: n,
@@ -2066,7 +2066,7 @@ class ci {
2066
2066
  }
2067
2067
  if (s.length < 2) return;
2068
2068
  const a = s.reverse(), r = 5;
2069
- for (let c = 0; c < r; c++) {
2069
+ for (let l = 0; l < r; l++) {
2070
2070
  const f = this.getGlobalTransform(t.id);
2071
2071
  for (let u = a.length - 2; u >= 0; u--) {
2072
2072
  const h = a[u], d = this.getGlobalTransform(h.id), p = f.x - d.x, y = f.y - d.y, m = i.x - d.x, b = i.y - d.y, v = Math.sqrt(p * p + y * y), S = Math.sqrt(m * m + b * b);
@@ -2081,7 +2081,7 @@ class ci {
2081
2081
  }
2082
2082
  }
2083
2083
  computeSpring(t, i, o, e, s, n, a, r) {
2084
- const l = a.stiffness ?? 100, c = a.damping ?? 10, f = a.mass ?? 1, u = -l * (t - s), h = -l * (i - n), d = -c * o, p = -c * e, y = (u + d) / f, m = (h + p) / f, b = o + y * r, v = e + m * r, S = t + b * r, C = i + v * r;
2084
+ const c = a.stiffness ?? 100, l = a.damping ?? 10, f = a.mass ?? 1, u = -c * (t - s), h = -c * (i - n), d = -l * o, p = -l * e, y = (u + d) / f, m = (h + p) / f, b = o + y * r, v = e + m * r, S = t + b * r, C = i + v * r;
2085
2085
  return { x: S, y: C, vx: b, vy: v };
2086
2086
  }
2087
2087
  handlePointerInput(t, i, o, e, s) {
@@ -2105,7 +2105,7 @@ class ci {
2105
2105
  this._totalScroll.x += t, this._totalScroll.y += i, this.scrollOffset = { x: this._totalScroll.x, y: this._totalScroll.y }, this.updateInput("scrollX", this._totalScroll.x), this.updateInput("scrollY", this._totalScroll.y);
2106
2106
  }
2107
2107
  handlePointerEvent(t, i, o) {
2108
- var r, l, c, f, u;
2108
+ var r, c, l, f, u;
2109
2109
  if (!this.artboard) return;
2110
2110
  t === "down" ? (this.isMouseDown = !0, this.updateInput("isMouseDown", !0)) : (t === "up" || t === "blur") && (this.isMouseDown = !1, this.updateInput("isMouseDown", !1));
2111
2111
  let e = null;
@@ -2152,9 +2152,9 @@ class ci {
2152
2152
  })) : t === "blur" && this.activeHoverIds.clear(), this.activeDropdownId && t === "down") {
2153
2153
  const h = this.artboard.objects.find((d) => d.id === this.activeDropdownId);
2154
2154
  if (h && (h.type === "Dropdown" || h.variant === "dropdown")) {
2155
- const d = this.objectStates.get(h.id), p = (d == null ? void 0 : d.options) || h.options || {}, y = h.geometry || {}, m = y.width ?? h.width ?? 200, b = y.height ?? h.height ?? 40, v = p.optionsList || [], S = p.itemHeight || 32, C = p.listPadding ?? 4, w = v.length * S + C * 2, I = this.getWorldTransform(h.id), M = m * Math.abs(I.scaleX), k = b * Math.abs(I.scaleY), T = I.y + k / 2 + 4, R = Math.abs(i - I.x) <= M / 2, P = o >= T && o <= T + w * Math.abs(I.scaleY);
2156
- if (R && P) {
2157
- const E = Math.abs(I.scaleY), x = o - (T + C * E), O = Math.floor(x / (S * E));
2155
+ const d = this.objectStates.get(h.id), p = (d == null ? void 0 : d.options) || h.options || {}, y = h.geometry || {}, m = y.width ?? h.width ?? 200, b = y.height ?? h.height ?? 40, v = p.optionsList || [], S = p.itemHeight || 32, C = p.listPadding ?? 4, w = v.length * S + C * 2, I = this.getWorldTransform(h.id), M = m * Math.abs(I.scaleX), k = b * Math.abs(I.scaleY), T = I.y + k / 2 + 4, x = Math.abs(i - I.x) <= M / 2, P = o >= T && o <= T + w * Math.abs(I.scaleY);
2156
+ if (x && P) {
2157
+ const E = Math.abs(I.scaleY), R = o - (T + C * E), O = Math.floor(R / (S * E));
2158
2158
  if (O >= 0 && O < v.length) {
2159
2159
  const W = v[O];
2160
2160
  p.selectedOption = W, p.isOpen = !1, this.activeDropdownId = null, h.inputId && this.setInternalInput(h.inputId, W), this.onComponentChange && this.onComponentChange({
@@ -2273,24 +2273,24 @@ class ci {
2273
2273
  const y = h.geometry, m = (y == null ? void 0 : y.datasets) || [], b = this.objectStates.get(h.id), v = (b == null ? void 0 : b.width) || (y == null ? void 0 : y.width) || 200, S = (b == null ? void 0 : b.height) || (y == null ? void 0 : y.height) || 150, C = this.getWorldTransform(h.id), w = 30, I = 20, M = v - w, k = S - I;
2274
2274
  let T = 1;
2275
2275
  m.forEach((E) => {
2276
- const x = Math.max(...E.data || [0]);
2277
- x > T && (T = x);
2276
+ const R = Math.max(...E.data || [0]);
2277
+ R > T && (T = R);
2278
2278
  });
2279
- let R = 1 / 0, P = null;
2280
- m.forEach((E, x) => {
2279
+ let x = 1 / 0, P = null;
2280
+ m.forEach((E, R) => {
2281
2281
  const O = E.data || [], W = M / Math.max(O.length - 1, 1);
2282
2282
  O.forEach((B, $) => {
2283
2283
  const Y = C.x - v / 2 + w + $ * W, H = C.y + S / 2 - I - B / T * k, K = Math.sqrt((i - Y) ** 2 + (o - H) ** 2);
2284
- K < R && (R = K, P = { dIdx: x, pIdx: $, val: B, label: E.label || `Dataset ${x + 1}` });
2284
+ K < x && (x = K, P = { dIdx: R, pIdx: $, val: B, label: E.label || `Dataset ${R + 1}` });
2285
2285
  });
2286
- }), P && R < 20 && this.onGraphPointClick && this.onGraphPointClick({ objectId: h.id, componentName: h.name, datasetIndex: P.dIdx, pointIndex: P.pIdx, value: P.val, label: P.label }), this.onComponentChange && this.onComponentChange({ objectId: h.id, componentName: h.name, variant: "linegraph", property: "click", value: (P == null ? void 0 : P.val) ?? null });
2286
+ }), P && x < 20 && this.onGraphPointClick && this.onGraphPointClick({ objectId: h.id, componentName: h.name, datasetIndex: P.dIdx, pointIndex: P.pIdx, value: P.val, label: P.label }), this.onComponentChange && this.onComponentChange({ objectId: h.id, componentName: h.name, variant: "linegraph", property: "click", value: (P == null ? void 0 : P.val) ?? null });
2287
2287
  }
2288
2288
  if (t === "click") {
2289
- const y = (l = this.artboard) == null ? void 0 : l.objects.find((v) => v.id === e.id), m = this.focusedId, b = (y == null ? void 0 : y.type) === "InputBox" || (y == null ? void 0 : y.type) === "Component" && y.variant === "inputbox";
2289
+ const y = (c = this.artboard) == null ? void 0 : c.objects.find((v) => v.id === e.id), m = this.focusedId, b = (y == null ? void 0 : y.type) === "InputBox" || (y == null ? void 0 : y.type) === "Component" && y.variant === "inputbox";
2290
2290
  if (y && b) {
2291
2291
  if (this.focusedId = e.id, this.log(`[Engine] Focus set to: ${e.id}`), m !== this.focusedId) {
2292
2292
  if (m) {
2293
- const v = (c = this.artboard) == null ? void 0 : c.objects.find((S) => S.id === m);
2293
+ const v = (l = this.artboard) == null ? void 0 : l.objects.find((S) => S.id === m);
2294
2294
  v && this.onInputBlur && this.onInputBlur(v.name);
2295
2295
  }
2296
2296
  this.onInputFocus && this.onInputFocus(y.name);
@@ -2342,8 +2342,8 @@ class ci {
2342
2342
  this.artboard && (this.activeKeys.delete(t.key.toLowerCase()), this.activeKeys.delete(t.code));
2343
2343
  }
2344
2344
  fireEventForObject(t, i) {
2345
- var c, f, u, h, d;
2346
- const o = (c = this.artboard) == null ? void 0 : c.objects.find((p) => p.id === t);
2345
+ var l, f, u, h, d;
2346
+ const o = (l = this.artboard) == null ? void 0 : l.objects.find((p) => p.id === t);
2347
2347
  if (!o) return;
2348
2348
  const e = /* @__PURE__ */ new Set([i, i.toLowerCase()]), s = i.toLowerCase();
2349
2349
  s === "onclick" || s === "click" || s === "onpointerdown" || s === "pointerdown" ? this.fireAnalyticsEvent(t, "click") : (s === "onpointerenter" || s === "hover" || s === "move") && this.fireAnalyticsEvent(t, "hover"), s === "onclick" || s === "click" ? (e.add("click"), e.add("onclick")) : s === "onpointerdown" || s === "pointerdown" ? (e.add("pointerdown"), e.add("onpointerdown")) : s === "onpointerup" || s === "pointerup" ? (e.add("pointerup"), e.add("onpointerup")) : s === "onpointerenter" || s === "hover" || s === "move" ? (e.add("hover"), e.add("onpointerenter")) : s === "onpointerleave" || s === "blur" ? (e.add("onpointerleave"), e.add("blur")) : s === "drag" || s === "ondrag" ? (e.add("drag"), e.add("ondrag")) : s === "toggle" || s === "ontoggle" ? (e.add("toggle"), e.add("ontoggle")) : s === "toggle true" || s === "toggle_true" || s === "toggletrue" ? (e.add("toggle true"), e.add("toggle_true"), e.add("toggletrue")) : (s === "toggle false" || s === "toggle_false" || s === "togglefalse") && (e.add("toggle false"), e.add("toggle_false"), e.add("togglefalse"));
@@ -2390,51 +2390,51 @@ class ci {
2390
2390
  }
2391
2391
  this.onTrigger && this.onTrigger(i, a.action);
2392
2392
  }
2393
- const l = (o.triggers || []).find((p) => {
2393
+ const c = (o.triggers || []).find((p) => {
2394
2394
  const y = p.eventType.toLowerCase();
2395
2395
  let m = !1;
2396
2396
  return (e.has(y) || y === "click" && e.has("onclick") || y === "hover" && (e.has("onpointerenter") || e.has("hover")) || y === "pointerdown" && e.has("onpointerdown") || y === "pointerup" && e.has("onpointerup")) && (m = !0), m && p.conditions && p.conditions.length > 0 ? this.checkConditions(p.conditions) : m;
2397
2397
  });
2398
- if (l && l.entryAnimationId) {
2399
- this.log(`[Engine] Trigger matched: ${i} (as ${l.eventType}) -> Animation ${l.entryAnimationId}`);
2400
- const p = (d = (h = this.artboard) == null ? void 0 : h.animations) == null ? void 0 : d.find((y) => y.id === l.entryAnimationId);
2398
+ if (c && c.entryAnimationId) {
2399
+ this.log(`[Engine] Trigger matched: ${i} (as ${c.eventType}) -> Animation ${c.entryAnimationId}`);
2400
+ const p = (d = (h = this.artboard) == null ? void 0 : h.animations) == null ? void 0 : d.find((y) => y.id === c.entryAnimationId);
2401
2401
  p && (this.activeTriggers.set(o.id, {
2402
- triggerId: l.id,
2402
+ triggerId: c.id,
2403
2403
  animation: p,
2404
2404
  time: 0,
2405
2405
  phase: "entry",
2406
2406
  elapsedHold: 0,
2407
- filterObjectId: l.targetObjectId
2408
- }), this.onTrigger && this.onTrigger(l.name, p.name));
2407
+ filterObjectId: c.targetObjectId
2408
+ }), this.onTrigger && this.onTrigger(c.name, p.name));
2409
2409
  }
2410
2410
  }
2411
2411
  fireAnalyticsEvent(t, i) {
2412
- var r, l;
2413
- const o = (r = this.artboard) == null ? void 0 : r.objects.find((c) => c.id === t);
2412
+ var r, c;
2413
+ const o = (r = this.artboard) == null ? void 0 : r.objects.find((l) => l.id === t);
2414
2414
  if (!o) return;
2415
- const e = (l = o.style) == null ? void 0 : l.analytics;
2415
+ const e = (c = o.style) == null ? void 0 : c.analytics;
2416
2416
  if (!e || !e.isEnabled || e.triggerType !== i) return;
2417
2417
  const s = e.eventName || `${o.name.toLowerCase().replace(/\s+/g, "_")}_interacted`, n = {};
2418
- e.parameters && Array.isArray(e.parameters) && e.parameters.forEach((c) => {
2419
- if (c.type === "literal")
2420
- n[c.key] = c.value;
2421
- else if (c.type === "variable") {
2422
- const f = this.inputs.get(c.value);
2423
- n[c.key] = f !== void 0 ? f : "";
2418
+ e.parameters && Array.isArray(e.parameters) && e.parameters.forEach((l) => {
2419
+ if (l.type === "literal")
2420
+ n[l.key] = l.value;
2421
+ else if (l.type === "variable") {
2422
+ const f = this.inputs.get(l.value);
2423
+ n[l.key] = f !== void 0 ? f : "";
2424
2424
  }
2425
2425
  }), this.log(`[ExodeUI Analytics] Dispatching event "${s}" via ${i} trigger:`, n);
2426
2426
  const a = e.platforms || { ga4: !0, meta: !0, mixpanel: !1 };
2427
2427
  if (a.ga4) {
2428
- const c = window;
2429
- typeof c.gtag == "function" ? (c.gtag("event", s, n), this.log(`[ExodeUI Analytics] GA4: Event "${s}" sent successfully.`)) : this.warn(`[ExodeUI Analytics] GA4: window.gtag is not a function. Event "${s}" skipped.`);
2428
+ const l = window;
2429
+ typeof l.gtag == "function" ? (l.gtag("event", s, n), this.log(`[ExodeUI Analytics] GA4: Event "${s}" sent successfully.`)) : this.warn(`[ExodeUI Analytics] GA4: window.gtag is not a function. Event "${s}" skipped.`);
2430
2430
  }
2431
2431
  if (a.meta) {
2432
- const c = window;
2433
- typeof c.fbq == "function" ? (c.fbq("track", s, n), this.log(`[ExodeUI Analytics] Meta Pixel: Event "${s}" sent successfully.`)) : this.warn(`[ExodeUI Analytics] Meta Pixel: window.fbq is not a function. Event "${s}" skipped.`);
2432
+ const l = window;
2433
+ typeof l.fbq == "function" ? (l.fbq("track", s, n), this.log(`[ExodeUI Analytics] Meta Pixel: Event "${s}" sent successfully.`)) : this.warn(`[ExodeUI Analytics] Meta Pixel: window.fbq is not a function. Event "${s}" skipped.`);
2434
2434
  }
2435
2435
  if (a.mixpanel) {
2436
- const c = window;
2437
- c.mixpanel && typeof c.mixpanel.track == "function" ? (c.mixpanel.track(s, n), this.log(`[ExodeUI Analytics] Mixpanel: Event "${s}" sent successfully.`)) : this.warn(`[ExodeUI Analytics] Mixpanel: window.mixpanel.track is not a function. Event "${s}" skipped.`);
2436
+ const l = window;
2437
+ l.mixpanel && typeof l.mixpanel.track == "function" ? (l.mixpanel.track(s, n), this.log(`[ExodeUI Analytics] Mixpanel: Event "${s}" sent successfully.`)) : this.warn(`[ExodeUI Analytics] Mixpanel: window.mixpanel.track is not a function. Event "${s}" skipped.`);
2438
2438
  }
2439
2439
  }
2440
2440
  initGlobalAnimationTriggers() {
@@ -2484,9 +2484,9 @@ class ci {
2484
2484
  scaleY: i.scale_y ?? 1,
2485
2485
  rotation: i.rotation ?? 0
2486
2486
  };
2487
- const e = this.getWorldTransform(o.parentId), s = e.rotation * (Math.PI / 180), n = Math.cos(s), a = Math.sin(s), r = i.x * e.scaleX, l = i.y * e.scaleY, c = e.x + (r * n - l * a), f = e.y + (r * a + l * n);
2487
+ const e = this.getWorldTransform(o.parentId), s = e.rotation * (Math.PI / 180), n = Math.cos(s), a = Math.sin(s), r = i.x * e.scaleX, c = i.y * e.scaleY, l = e.x + (r * n - c * a), f = e.y + (r * a + c * n);
2488
2488
  return {
2489
- x: c,
2489
+ x: l,
2490
2490
  y: f,
2491
2491
  scaleX: (i.scale_x ?? 1) * e.scaleX,
2492
2492
  scaleY: (i.scale_y ?? 1) * e.scaleY,
@@ -2496,14 +2496,14 @@ class ci {
2496
2496
  hitTest(t, i, o) {
2497
2497
  var v, S;
2498
2498
  if (!this.objectStates.get(t.id)) return !1;
2499
- const s = ((v = t.geometry) == null ? void 0 : v.width) ?? t.width ?? 100, n = ((S = t.geometry) == null ? void 0 : S.height) ?? t.height ?? 100, a = this.getWorldTransform(t.id), r = i - a.x, l = o - a.y, c = -a.rotation * (Math.PI / 180), f = Math.cos(c), u = Math.sin(c), h = r * f - l * u, d = r * u + l * f, p = a.scaleX, y = a.scaleY, m = s * Math.abs(p), b = n * Math.abs(y);
2499
+ const s = ((v = t.geometry) == null ? void 0 : v.width) ?? t.width ?? 100, n = ((S = t.geometry) == null ? void 0 : S.height) ?? t.height ?? 100, a = this.getWorldTransform(t.id), r = i - a.x, c = o - a.y, l = -a.rotation * (Math.PI / 180), f = Math.cos(l), u = Math.sin(l), h = r * f - c * u, d = r * u + c * f, p = a.scaleX, y = a.scaleY, m = s * Math.abs(p), b = n * Math.abs(y);
2500
2500
  return Math.abs(h) <= m / 2 && Math.abs(d) <= b / 2;
2501
2501
  }
2502
2502
  updateSliderValueFromPointer(t, i, o) {
2503
2503
  var I;
2504
2504
  const e = this.objectStates.get(t.id);
2505
2505
  if (!e) return;
2506
- const s = t.options || {}, n = ((I = t.geometry) == null ? void 0 : I.width) ?? t.width ?? 200, a = this.getWorldTransform(t.id), r = i - a.x, l = o - a.y, c = -a.rotation * (Math.PI / 180), f = Math.cos(c), u = Math.sin(c), h = r * f - l * u, d = s.thumbWidth ?? 16, p = n - d;
2506
+ const s = t.options || {}, n = ((I = t.geometry) == null ? void 0 : I.width) ?? t.width ?? 200, a = this.getWorldTransform(t.id), r = i - a.x, c = o - a.y, l = -a.rotation * (Math.PI / 180), f = Math.cos(l), u = Math.sin(l), h = r * f - c * u, d = s.thumbWidth ?? 16, p = n - d;
2507
2507
  let m = (h + p / 2) / p;
2508
2508
  m = Math.max(0, Math.min(1, m));
2509
2509
  const b = s.min ?? 0, v = s.max ?? 100, S = s.step || 1;
@@ -2522,8 +2522,8 @@ class ci {
2522
2522
  var I, M;
2523
2523
  const e = this.objectStates.get(t.id);
2524
2524
  if (!e) return;
2525
- const s = (e == null ? void 0 : e.width) !== void 0 ? e.width : ((I = t.geometry) == null ? void 0 : I.width) ?? t.width ?? 100, n = (e == null ? void 0 : e.height) !== void 0 ? e.height : ((M = t.geometry) == null ? void 0 : M.height) ?? t.height ?? 100, a = this.getWorldTransform(t.id), r = i - a.x, l = o - a.y, c = -a.rotation * (Math.PI / 180), f = Math.cos(c), u = Math.sin(c);
2526
- let h = (r * f - l * u) / Math.max(1e-3, Math.abs(a.scaleX || 1)), d = (r * u + l * f) / Math.max(1e-3, Math.abs(a.scaleY || 1));
2525
+ const s = (e == null ? void 0 : e.width) !== void 0 ? e.width : ((I = t.geometry) == null ? void 0 : I.width) ?? t.width ?? 100, n = (e == null ? void 0 : e.height) !== void 0 ? e.height : ((M = t.geometry) == null ? void 0 : M.height) ?? t.height ?? 100, a = this.getWorldTransform(t.id), r = i - a.x, c = o - a.y, l = -a.rotation * (Math.PI / 180), f = Math.cos(l), u = Math.sin(l);
2526
+ let h = (r * f - c * u) / Math.max(1e-3, Math.abs(a.scaleX || 1)), d = (r * u + c * f) / Math.max(1e-3, Math.abs(a.scaleY || 1));
2527
2527
  t.handleOrigin === "top-left" ? (h -= s / 2, d -= n / 2) : t.handleOrigin === "bottom-right" && (h += s / 2, d += n / 2);
2528
2528
  const p = Math.min(s, n) * 0.45, y = Math.min(s, n) * 0.15, m = p - y;
2529
2529
  let b = h / m, v = d / m;
@@ -2541,39 +2541,39 @@ class ci {
2541
2541
  let s = e.handleX ?? o.handleX ?? 0, n = e.handleY ?? o.handleY ?? 0;
2542
2542
  if (((a = o.inputBinding) == null ? void 0 : a.type) === "keyboard" && o.inputBinding.keyboardConfig) {
2543
2543
  const r = o.inputBinding.keyboardConfig;
2544
- let l = s, c = n;
2544
+ let c = s, l = n;
2545
2545
  const u = (r.speed || 5) * t;
2546
2546
  let h = !1;
2547
- this.activeKeys.has(r.upKey.toLowerCase()) && (c -= u, h = !0), this.activeKeys.has(r.downKey.toLowerCase()) && (c += u, h = !0), this.activeKeys.has(r.leftKey.toLowerCase()) && (l -= u, h = !0), this.activeKeys.has(r.rightKey.toLowerCase()) && (l += u, h = !0), o.joystickType === "1D_X" && (c = 0), o.joystickType === "1D_Y" && (l = 0);
2548
- const d = Math.sqrt(l * l + c * c);
2549
- d > 1 && (l /= d, c /= d), !h && o.isSpringReturn !== !1 && (l += (0 - l) * (10 * t), c += (0 - c) * (10 * t), Math.abs(l) < 0.01 && (l = 0), Math.abs(c) < 0.01 && (c = 0)), s = l, n = c;
2547
+ this.activeKeys.has(r.upKey.toLowerCase()) && (l -= u, h = !0), this.activeKeys.has(r.downKey.toLowerCase()) && (l += u, h = !0), this.activeKeys.has(r.leftKey.toLowerCase()) && (c -= u, h = !0), this.activeKeys.has(r.rightKey.toLowerCase()) && (c += u, h = !0), o.joystickType === "1D_X" && (l = 0), o.joystickType === "1D_Y" && (c = 0);
2548
+ const d = Math.sqrt(c * c + l * l);
2549
+ d > 1 && (c /= d, l /= d), !h && o.isSpringReturn !== !1 && (c += (0 - c) * (10 * t), l += (0 - l) * (10 * t), Math.abs(c) < 0.01 && (c = 0), Math.abs(l) < 0.01 && (l = 0)), s = c, n = l;
2550
2550
  }
2551
2551
  if (e.handleX = s, e.handleY = n, o.handleX = s, o.handleY = n, o.bindings && o.bindings.length > 0) {
2552
2552
  const r = Math.sqrt(s * s + n * n);
2553
- let l = Math.atan2(n, s) * (180 / Math.PI);
2554
- l < 0 && (l += 360), o.bindings.forEach((c) => {
2553
+ let c = Math.atan2(n, s) * (180 / Math.PI);
2554
+ c < 0 && (c += 360), o.bindings.forEach((l) => {
2555
2555
  var h, d;
2556
2556
  let f = 0;
2557
- c.sourceAxis === "x" ? f = o.invertX ? -s : s : c.sourceAxis === "y" ? f = o.invertY ? -n : n : c.sourceAxis === "distance" ? f = r : c.sourceAxis === "angle" && (f = l);
2558
- const u = (h = this.artboard) == null ? void 0 : h.objects.find((p) => p.id === c.targetObjectId);
2557
+ l.sourceAxis === "x" ? f = o.invertX ? -s : s : l.sourceAxis === "y" ? f = o.invertY ? -n : n : l.sourceAxis === "distance" ? f = r : l.sourceAxis === "angle" && (f = c);
2558
+ const u = (h = this.artboard) == null ? void 0 : h.objects.find((p) => p.id === l.targetObjectId);
2559
2559
  if (u) {
2560
- if (c.actionType === "bind" && c.targetProperty && c.isContinuous !== !1) {
2561
- const p = c.sourceMin ?? -1, y = c.sourceMax ?? 1, m = c.targetMin ?? 0, b = c.targetMax ?? 100, v = (f - p) / (y - p), S = Math.max(0, Math.min(1, v));
2560
+ if (l.actionType === "bind" && l.targetProperty && l.isContinuous !== !1) {
2561
+ const p = l.sourceMin ?? -1, y = l.sourceMax ?? 1, m = l.targetMin ?? 0, b = l.targetMax ?? 100, v = (f - p) / (y - p), S = Math.max(0, Math.min(1, v));
2562
2562
  let C = m + S * (b - m);
2563
- c.step && c.step > 0 && (C = Math.round(C / c.step) * c.step);
2563
+ l.step && l.step > 0 && (C = Math.round(C / l.step) * l.step);
2564
2564
  const w = this.objectStates.get(u.id);
2565
2565
  if (w) {
2566
- const I = c.isRelative !== !1, M = I ? u.x ?? 0 : 0, k = I ? u.y ?? 0 : 0, T = I ? u.rotation ?? 0 : 0, R = I ? u.scale_x ?? 1 : 0, P = I ? u.scale_y ?? 1 : 0, E = I ? u.opacity ?? 100 : 0;
2567
- c.targetProperty === "x" ? w.x = M + C : c.targetProperty === "y" ? w.y = k + C : c.targetProperty === "rotation" || c.targetProperty === "r" ? w.rotation = T + C : c.targetProperty === "scaleX" ? w.scale_x = R + C : c.targetProperty === "scaleY" ? w.scale_y = P + C : c.targetProperty === "opacity" && (w.opacity = E + C);
2566
+ const I = l.isRelative !== !1, M = I ? u.x ?? 0 : 0, k = I ? u.y ?? 0 : 0, T = I ? u.rotation ?? 0 : 0, x = I ? u.scale_x ?? 1 : 0, P = I ? u.scale_y ?? 1 : 0, E = I ? u.opacity ?? 100 : 0;
2567
+ l.targetProperty === "x" || l.targetProperty === "transform.x" ? w.x = M + C : l.targetProperty === "y" || l.targetProperty === "transform.y" ? w.y = k + C : l.targetProperty === "rotation" || l.targetProperty === "r" || l.targetProperty === "transform.rotation" ? w.rotation = T + C : l.targetProperty === "scaleX" || l.targetProperty === "transform.scale_x" ? w.scale_x = x + C : l.targetProperty === "scaleY" || l.targetProperty === "transform.scale_y" ? w.scale_y = P + C : (l.targetProperty === "opacity" || l.targetProperty === "transform.opacity") && (w.opacity = E + C);
2568
2568
  }
2569
- (d = u.physics) != null && d.enabled && this.physicsEngine && (c.targetProperty === "x" || c.targetProperty === "y") && (c.targetProperty === "x" ? this.physicsEngine.applyForce(u.id, (C - ((w == null ? void 0 : w.x) || 0)) * 10, 0) : c.targetProperty === "y" && this.physicsEngine.applyForce(u.id, 0, (C - ((w == null ? void 0 : w.y) || 0)) * 10));
2570
- } else if (c.actionType === "playAnimation" || c.actionType === "stopAnimation" || c.actionType === "pauseAnimation") {
2569
+ (d = u.physics) != null && d.enabled && this.physicsEngine && (l.targetProperty === "x" || l.targetProperty === "transform.x" || l.targetProperty === "y" || l.targetProperty === "transform.y") && (l.targetProperty === "x" || l.targetProperty === "transform.x" ? this.physicsEngine.applyForce(u.id, (C - ((w == null ? void 0 : w.x) || 0)) * 10, 0) : (l.targetProperty === "y" || l.targetProperty === "transform.y") && this.physicsEngine.applyForce(u.id, 0, (C - ((w == null ? void 0 : w.y) || 0)) * 10));
2570
+ } else if (l.actionType === "playAnimation" || l.actionType === "stopAnimation" || l.actionType === "pauseAnimation") {
2571
2571
  let p = !1;
2572
- const y = c.threshold ?? 0;
2573
- c.condition === "always" ? p = !0 : c.condition === ">" ? p = f > y : c.condition === "<" ? p = f < y : c.condition === "==" && (p = Math.abs(f - y) < 0.01);
2574
- const m = e[`_prev_src_${c.id}`] ?? f;
2572
+ const y = l.threshold ?? 0;
2573
+ l.condition === "always" ? p = !0 : l.condition === ">" ? p = f > y : l.condition === "<" ? p = f < y : l.condition === "==" && (p = Math.abs(f - y) < 0.01);
2574
+ const m = e[`_prev_src_${l.id}`] ?? f;
2575
2575
  let b = !1;
2576
- c.condition === "always" ? b = !0 : c.condition === ">" ? b = m > y : c.condition === "<" ? b = m < y : c.condition === "==" && (b = Math.abs(m - y) < 0.01), e[`_prev_src_${c.id}`] = f, p && !b && c.targetAnimationId && (c.actionType === "playAnimation" || c.actionType);
2576
+ l.condition === "always" ? b = !0 : l.condition === ">" ? b = m > y : l.condition === "<" ? b = m < y : l.condition === "==" && (b = Math.abs(m - y) < 0.01), e[`_prev_src_${l.id}`] = f, p && !b && l.targetAnimationId && (l.actionType === "playAnimation" || l.actionType);
2577
2577
  }
2578
2578
  }
2579
2579
  });
@@ -2581,7 +2581,7 @@ class ci {
2581
2581
  });
2582
2582
  }
2583
2583
  applyBlendState(t, i) {
2584
- var l, c, f, u, h, d, p, y;
2584
+ var c, l, f, u, h, d, p, y;
2585
2585
  if (!t.blendAnimations || t.blendAnimations.length === 0) return;
2586
2586
  let o = 0, e = 0;
2587
2587
  t.blendInputX && (o = this.inputs.get(t.blendInputX) ?? 0), t.blendInputY && (e = this.inputs.get(t.blendInputY) ?? 0);
@@ -2590,7 +2590,7 @@ class ci {
2590
2590
  if (t.blendType === "1D") {
2591
2591
  const m = [...t.blendAnimations].sort((b, v) => b.position[0] - v.position[0]);
2592
2592
  if (m.length === 1) {
2593
- const b = (c = (l = this.artboard) == null ? void 0 : l.animations) == null ? void 0 : c.find((v) => v.id === m[0].animationId);
2593
+ const b = (l = (c = this.artboard) == null ? void 0 : c.animations) == null ? void 0 : l.find((v) => v.id === m[0].animationId);
2594
2594
  b && (s.push({ anim: b, weight: 1 }), n = 1);
2595
2595
  } else {
2596
2596
  let b = 0;
@@ -2628,8 +2628,8 @@ class ci {
2628
2628
  };
2629
2629
  s.forEach(({ anim: m, weight: b }) => {
2630
2630
  m.tracks && m.tracks.forEach((v) => {
2631
- var R, P;
2632
- const S = v.object_id || v.objectId, C = v.property, w = (R = this.artboard) == null ? void 0 : R.objects.find((E) => E.id === S);
2631
+ var x, P;
2632
+ const S = v.object_id || v.objectId, C = v.property, w = (x = this.artboard) == null ? void 0 : x.objects.find((E) => E.id === S);
2633
2633
  if (((P = w == null ? void 0 : w.physics) == null ? void 0 : P.enabled) && w.physics.bodyType !== "Static" && (C === "x" || C === "y" || C === "rotation")) return;
2634
2634
  const M = this.interpolate(v.keyframes, i);
2635
2635
  if (M === void 0) return;
@@ -2658,24 +2658,24 @@ class ci {
2658
2658
  !v || !S || m.forEach((w, I) => {
2659
2659
  let M = w.value;
2660
2660
  if (w.type === "color" && w.colorAcc) {
2661
- const k = Math.round(w.colorAcc.r).toString(16).padStart(2, "0"), T = Math.round(w.colorAcc.g).toString(16).padStart(2, "0"), R = Math.round(w.colorAcc.b).toString(16).padStart(2, "0");
2662
- M = `#${k}${T}${R}`;
2661
+ const k = Math.round(w.colorAcc.r).toString(16).padStart(2, "0"), T = Math.round(w.colorAcc.g).toString(16).padStart(2, "0"), x = Math.round(w.colorAcc.b).toString(16).padStart(2, "0");
2662
+ M = `#${k}${T}${x}`;
2663
2663
  }
2664
2664
  if (I.includes(".")) {
2665
2665
  const k = (I || "").split(".");
2666
2666
  let T = v;
2667
- for (let R = 0; R < k.length - 1; R++) {
2668
- if (typeof T[k[R]] != "object" || T[k[R]] === null) {
2667
+ for (let x = 0; x < k.length - 1; x++) {
2668
+ if (typeof T[k[x]] != "object" || T[k[x]] === null) {
2669
2669
  let P = S;
2670
- for (let E = 0; E <= R; E++)
2670
+ for (let E = 0; E <= x; E++)
2671
2671
  P = P ? P[k[E]] : null;
2672
- if (k[R] === "corner_radius" || k[R] === "cornerRadius") {
2673
- const E = typeof T[k[R]] == "number" ? T[k[R]] : typeof P == "number" ? P : 0;
2674
- T[k[R]] = { tl: E, tr: E, bl: E, br: E };
2672
+ if (k[x] === "corner_radius" || k[x] === "cornerRadius") {
2673
+ const E = typeof T[k[x]] == "number" ? T[k[x]] : typeof P == "number" ? P : 0;
2674
+ T[k[x]] = { tl: E, tr: E, bl: E, br: E };
2675
2675
  } else
2676
- T[k[R]] = P ? JSON.parse(JSON.stringify(P)) : {};
2676
+ T[k[x]] = P ? JSON.parse(JSON.stringify(P)) : {};
2677
2677
  }
2678
- T = T[k[R]];
2678
+ T = T[k[x]];
2679
2679
  }
2680
2680
  T[k[k.length - 1]] = M, k[k.length - 1] === "color" && (k[k.length - 2] === "fill" || k[k.length - 2] === "stroke") && (T.type = "Solid");
2681
2681
  } else
@@ -2697,20 +2697,20 @@ class ci {
2697
2697
  let r = e.property;
2698
2698
  if (a && (r === "x" || r === "y" || r === "rotation"))
2699
2699
  return;
2700
- const l = this.objectStates.get(s);
2701
- if (!l) {
2700
+ const c = this.objectStates.get(s);
2701
+ if (!c) {
2702
2702
  this.frameCount % 600 === 0 && this.debugLog(`Skipping track: Object ${s} not found in state`);
2703
2703
  return;
2704
2704
  }
2705
- const c = this.interpolate(e.keyframes, i);
2706
- if (c !== void 0) {
2705
+ const l = this.interpolate(e.keyframes, i);
2706
+ if (l !== void 0) {
2707
2707
  if (this.frameCount % 240 === 0) {
2708
- const d = (n == null ? void 0 : n.name) || s, p = typeof c == "object" ? JSON.stringify(c).slice(0, 50) : c;
2708
+ const d = (n == null ? void 0 : n.name) || s, p = typeof l == "object" ? JSON.stringify(l).slice(0, 50) : l;
2709
2709
  this.debugLog(`[Anim] Applying ${r} = ${p} to ${d}`);
2710
2710
  }
2711
2711
  if (r.includes(".")) {
2712
2712
  const d = (r || "").split(".");
2713
- let p = l;
2713
+ let p = c;
2714
2714
  for (let y = 0; y < d.length - 1; y++) {
2715
2715
  if (typeof p[d[y]] != "object" || p[d[y]] === null) {
2716
2716
  let m = n;
@@ -2724,17 +2724,17 @@ class ci {
2724
2724
  }
2725
2725
  p = p[d[y]];
2726
2726
  }
2727
- p[d[d.length - 1]] = c, d[d.length - 1] === "color" && (d[d.length - 2] === "fill" || d[d.length - 2] === "stroke") && (p.type = "Solid");
2727
+ p[d[d.length - 1]] = l, d[d.length - 1] === "color" && (d[d.length - 2] === "fill" || d[d.length - 2] === "stroke") && (p.type = "Solid");
2728
2728
  } else
2729
- r === "fill" ? (l.style || (l.style = {}), l.style.fill = c) : r === "stroke" ? (l.style || (l.style = {}), l.style.stroke = c) : l[r] = c;
2729
+ r === "fill" ? (c.style || (c.style = {}), c.style.fill = l) : r === "stroke" ? (c.style || (c.style = {}), c.style.stroke = l) : c[r] = l;
2730
2730
  if (this.physicsEngine && ((h = n == null ? void 0 : n.physics) != null && h.enabled) && n.physics.bodyType === "Static")
2731
2731
  if (r === "x") {
2732
2732
  const d = this.physicsEngine.getPosition(s);
2733
- d && this.physicsEngine.setPosition(s, c, d.y);
2733
+ d && this.physicsEngine.setPosition(s, l, d.y);
2734
2734
  } else if (r === "y") {
2735
2735
  const d = this.physicsEngine.getPosition(s);
2736
- d && this.physicsEngine.setPosition(s, d.x, c);
2737
- } else r === "rotation" && this.physicsEngine.setRotation(s, c * (Math.PI / 180));
2736
+ d && this.physicsEngine.setPosition(s, d.x, l);
2737
+ } else r === "rotation" && this.physicsEngine.setRotation(s, l * (Math.PI / 180));
2738
2738
  }
2739
2739
  });
2740
2740
  }
@@ -2758,8 +2758,8 @@ class ci {
2758
2758
  }
2759
2759
  if (Array.isArray(o.value) && Array.isArray(e.value))
2760
2760
  return o.value.length === e.value.length ? o.value.map((a, r) => {
2761
- const l = e.value[r];
2762
- return typeof a == "number" && typeof l == "number" ? a + (l - a) * n : n < 0.5 ? a : l;
2761
+ const c = e.value[r];
2762
+ return typeof a == "number" && typeof c == "number" ? a + (c - a) * n : n < 0.5 ? a : c;
2763
2763
  }) : n < 0.5 ? o.value : e.value;
2764
2764
  if (typeof o.value == "object" && typeof e.value == "object" && o.value !== null && e.value !== null) {
2765
2765
  if (o.value.width !== void 0 && o.value.color !== void 0)
@@ -2767,9 +2767,9 @@ class ci {
2767
2767
  if (o.value.type && e.value.type)
2768
2768
  return this.interpolateFill(o.value, e.value, n);
2769
2769
  const a = {};
2770
- return (/* @__PURE__ */ new Set([...Object.keys(o.value), ...Object.keys(e.value)])).forEach((l) => {
2771
- const c = o.value[l], f = e.value[l];
2772
- typeof c == "number" && typeof f == "number" ? a[l] = c + (f - c) * n : c === void 0 ? a[l] = f : f === void 0 ? a[l] = c : a[l] = n < 0.5 ? c : f;
2770
+ return (/* @__PURE__ */ new Set([...Object.keys(o.value), ...Object.keys(e.value)])).forEach((c) => {
2771
+ const l = o.value[c], f = e.value[c];
2772
+ typeof l == "number" && typeof f == "number" ? a[c] = l + (f - l) * n : l === void 0 ? a[c] = f : f === void 0 ? a[c] = l : a[c] = n < 0.5 ? l : f;
2773
2773
  }), a;
2774
2774
  }
2775
2775
  return typeof o.value == "number" && typeof e.value == "number" ? o.value + (e.value - o.value) * n : n < 0.5 ? o.value : e.value;
@@ -2788,11 +2788,11 @@ class ci {
2788
2788
  g: parseInt(m.substring(2, 4), 16),
2789
2789
  b: parseInt(m.substring(4, 6), 16)
2790
2790
  };
2791
- }, r = a(s), l = a(n), c = Math.round(r.r + (l.r - r.r) * o), f = Math.round(r.g + (l.g - r.g) * o), u = Math.round(r.b + (l.b - r.b) * o), h = (y) => {
2791
+ }, r = a(s), c = a(n), l = Math.round(r.r + (c.r - r.r) * o), f = Math.round(r.g + (c.g - r.g) * o), u = Math.round(r.b + (c.b - r.b) * o), h = (y) => {
2792
2792
  const m = Math.max(0, Math.min(255, y)).toString(16);
2793
2793
  return m.length === 1 ? "0" + m : m;
2794
2794
  };
2795
- return `#${h(c)}${h(f)}${h(u)}`;
2795
+ return `#${h(l)}${h(f)}${h(u)}`;
2796
2796
  }
2797
2797
  interpolateStops(t, i, o) {
2798
2798
  return !t || !i || t.length !== i.length ? o < 0.5 ? t : i : t.map((e, s) => {
@@ -2849,46 +2849,46 @@ class ci {
2849
2849
  }
2850
2850
  }
2851
2851
  (this.artboard.clipContent === !0 || this.artboard.clip_content === !0) && (t.beginPath(), t.rect(0, 0, s, n), t.clip());
2852
- const l = /* @__PURE__ */ new Map();
2853
- this.artboard.objects.forEach((u) => l.set(u.id, u)), this.artboard.objects.filter((u) => !u.parentId).map((u, h) => {
2852
+ const c = /* @__PURE__ */ new Map();
2853
+ this.artboard.objects.forEach((u) => c.set(u.id, u)), this.artboard.objects.filter((u) => !u.parentId).map((u, h) => {
2854
2854
  const d = this.objectStates.get(u.id), p = (d == null ? void 0 : d.zIndex) ?? h;
2855
2855
  return { obj: u, zIndex: p };
2856
2856
  }).sort((u, h) => u.zIndex - h.zIndex).forEach(({ obj: u }) => {
2857
- this.renderObject(t, u, l);
2857
+ this.renderObject(t, u, c);
2858
2858
  }), this._emitterPools.forEach((u, h) => {
2859
- if (!(u.length === 0 || !l.get(h)))
2859
+ if (!(u.length === 0 || !c.get(h)))
2860
2860
  for (const p of u)
2861
2861
  t.save(), t.globalAlpha = p.opacity, t.fillStyle = p.color, t.beginPath(), t.arc(p.x, p.y, Math.max(1, p.size * p.opacity), 0, Math.PI * 2), t.fill(), t.restore();
2862
2862
  }), this.lastRenderTime = performance.now() - e, this.debugMode && this.frameCount % 60 === 0 && this.log(`[Engine Debug] Rendered ${this.debug_objectsRendered}/${this.debug_objectsTotal} objects in ${this.lastRenderTime.toFixed(2)}ms`), t.restore();
2863
2863
  }
2864
2864
  isObjectInView(t, i, o, e, s, n = 0) {
2865
- const a = t.getTransform(), r = i * a.a + o * a.c + a.e, l = i * a.b + o * a.d + a.f, c = Math.sqrt(a.a * a.a + a.b * a.b), f = Math.sqrt(a.c * a.c + a.d * a.d), u = (e / 2 + n) * c, h = (s / 2 + n) * f;
2866
- return r + u >= 0 && r - u <= this.canvasWidth && l + h >= 0 && l - h <= this.canvasHeight;
2865
+ const a = t.getTransform(), r = i * a.a + o * a.c + a.e, c = i * a.b + o * a.d + a.f, l = Math.sqrt(a.a * a.a + a.b * a.b), f = Math.sqrt(a.c * a.c + a.d * a.d), u = (e / 2 + n) * l, h = (s / 2 + n) * f;
2866
+ return r + u >= 0 && r - u <= this.canvasWidth && c + h >= 0 && c - h <= this.canvasHeight;
2867
2867
  }
2868
2868
  calculateTransform(t, i, o, e, s, n) {
2869
- let a = 1, r = 1, l = 1;
2870
- const c = o / e, f = t / i;
2869
+ let a = 1, r = 1, c = 1;
2870
+ const l = o / e, f = t / i;
2871
2871
  switch (s) {
2872
2872
  case "Contain":
2873
- f > c ? l = i / e : l = t / o, a = r = l;
2873
+ f > l ? c = i / e : c = t / o, a = r = c;
2874
2874
  break;
2875
2875
  case "Cover":
2876
- f > c ? l = t / o : l = i / e, a = r = l;
2876
+ f > l ? c = t / o : c = i / e, a = r = c;
2877
2877
  break;
2878
2878
  case "Fill":
2879
2879
  a = t / o, r = i / e;
2880
2880
  break;
2881
2881
  case "FitWidth":
2882
- l = t / o, a = r = l;
2882
+ c = t / o, a = r = c;
2883
2883
  break;
2884
2884
  case "FitHeight":
2885
- l = i / e, a = r = l;
2885
+ c = i / e, a = r = c;
2886
2886
  break;
2887
2887
  case "None":
2888
2888
  a = r = 1;
2889
2889
  break;
2890
2890
  case "ScaleDown":
2891
- l = Math.min(t / o, i / e), l > 1 && (l = 1), a = r = l;
2891
+ c = Math.min(t / o, i / e), c > 1 && (c = 1), a = r = c;
2892
2892
  break;
2893
2893
  default:
2894
2894
  a = r = 1;
@@ -2918,7 +2918,7 @@ class ci {
2918
2918
  }
2919
2919
  */
2920
2920
  renderObject(t, i, o) {
2921
- var p, y, m, b, v, S, C, w, I, M, k, T, R, P, E, x, O, W, B, $, Y, H, K, A, _;
2921
+ var p, y, m, b, v, S, C, w, I, M, k, T, x, P, E, R, O, W, B, $, Y, H, K, A, _;
2922
2922
  const e = this.objectStates.get(i.id);
2923
2923
  if (!e) {
2924
2924
  this.warn("No state for object:", i.id);
@@ -2933,12 +2933,12 @@ class ci {
2933
2933
  L = Math.min(L, lt.x), X = Math.max(X, lt.x), V = Math.min(V, lt.y), it = Math.max(it, lt.y);
2934
2934
  }), a === 0 && (a = X - L), r === 0 && (r = it - V);
2935
2935
  }
2936
- const l = (L) => {
2936
+ const c = (L) => {
2937
2937
  if (L)
2938
2938
  return L.corner_radius ?? L.cornerRadius;
2939
- }, c = l(e) ?? l(n) ?? l(s) ?? l(i.style) ?? l(i.geometry) ?? 0;
2939
+ }, l = c(e) ?? c(n) ?? c(s) ?? c(i.style) ?? c(i.geometry) ?? 0;
2940
2940
  let f = { ...s, width: a, height: r };
2941
- if (delete f.cornerRadius, f.corner_radius = c, f.type === "Path" && i.weights && i.bindMatrices && f.points) {
2941
+ if (delete f.cornerRadius, f.corner_radius = l, f.type === "Path" && i.weights && i.bindMatrices && f.points) {
2942
2942
  const L = this.getGlobalTransform(i.id);
2943
2943
  if (L) {
2944
2944
  const X = li(
@@ -2977,7 +2977,7 @@ class ci {
2977
2977
  this.debug_objectsRendered++, t.save();
2978
2978
  const wt = [], Mt = n.blur || ((T = i.style) == null ? void 0 : T.blur);
2979
2979
  Mt && Mt.amount > 0 && wt.push(`blur(${Mt.amount}px)`);
2980
- const It = n.effect || ((R = i.style) == null ? void 0 : R.effect), Ot = (It == null ? void 0 : It.isEnabled) === !0, At = It == null ? void 0 : It.type, Tt = (It == null ? void 0 : It.radius) ?? 10;
2980
+ const It = n.effect || ((x = i.style) == null ? void 0 : x.effect), Ot = (It == null ? void 0 : It.isEnabled) === !0, At = It == null ? void 0 : It.type, Tt = (It == null ? void 0 : It.radius) ?? 10;
2981
2981
  Ot && At === "LayerBlur" && wt.push(`blur(${Tt}px)`);
2982
2982
  const zt = ((P = s == null ? void 0 : s.type) == null ? void 0 : P.toLowerCase().includes("image")) || ((E = i.type) == null ? void 0 : E.toLowerCase().includes("image")), Z = n.adjustments && Object.keys(n.adjustments).length > 0 ? n.adjustments : null, pt = s != null && s.adjustments && Object.keys(s.adjustments).length > 0 ? s.adjustments : null, Et = zt ? pt || Z : Z || pt, ut = zt && !Et ? {
2983
2983
  exposure: 0,
@@ -3048,8 +3048,8 @@ class ci {
3048
3048
  }
3049
3049
  }
3050
3050
  wt.length > 0 ? t.filter = wt.join(" ") : t.filter = "none", t.imageSmoothingEnabled = !0, t.imageSmoothingQuality = "high";
3051
- const vt = t.globalAlpha, xt = this.normalizeOpacity(e.opacity !== void 0 ? e.opacity : 100);
3052
- t.globalAlpha = vt * xt;
3051
+ const vt = t.globalAlpha, Rt = this.normalizeOpacity(e.opacity !== void 0 ? e.opacity : 100);
3052
+ t.globalAlpha = vt * Rt;
3053
3053
  const Xt = e.compositeOperation || e.blendMode;
3054
3054
  if (Xt && Xt !== "Normal") {
3055
3055
  const at = Xt.toLowerCase();
@@ -3104,7 +3104,7 @@ class ci {
3104
3104
  const at = Math.tan(ue * Math.PI / 180), gt = Math.tan(pe * Math.PI / 180);
3105
3105
  t.transform(1 + at * gt, gt, at, 1, 0, 0);
3106
3106
  }
3107
- const Qt = e.rotate_x !== void 0 ? e.rotate_x : ((x = e.transform) == null ? void 0 : x.rotate_x) ?? 0, me = e.rotate_y !== void 0 ? e.rotate_y : ((O = e.transform) == null ? void 0 : O.rotate_y) ?? 0, ye = 1 + (e.translate_z !== void 0 ? e.translate_z : ((W = e.transform) == null ? void 0 : W.translate_z) ?? 0) / 1e3, Se = (e.flip_x === !0 ? -1 : 1) * Math.cos(me * Math.PI / 180) * ye, Pe = (e.flip_y === !0 ? -1 : 1) * Math.cos(Qt * Math.PI / 180) * ye;
3107
+ const Qt = e.rotate_x !== void 0 ? e.rotate_x : ((R = e.transform) == null ? void 0 : R.rotate_x) ?? 0, me = e.rotate_y !== void 0 ? e.rotate_y : ((O = e.transform) == null ? void 0 : O.rotate_y) ?? 0, ye = 1 + (e.translate_z !== void 0 ? e.translate_z : ((W = e.transform) == null ? void 0 : W.translate_z) ?? 0) / 1e3, Se = (e.flip_x === !0 ? -1 : 1) * Math.cos(me * Math.PI / 180) * ye, Pe = (e.flip_y === !0 ? -1 : 1) * Math.cos(Qt * Math.PI / 180) * ye;
3108
3108
  t.scale(
3109
3109
  lt * Se,
3110
3110
  nt * Pe
@@ -3148,12 +3148,12 @@ class ci {
3148
3148
  console.error("[ExodeUI] Image load failed:", D, `Src preview: ${at.substring(0, 100)}...`);
3149
3149
  }, gt.src = at, this.imageCache.set(at, gt));
3150
3150
  const j = n.stroke && n.stroke.width > 0 && n.stroke.isEnabled !== !1, z = (((H = n.stroke) == null ? void 0 : H.alignment) || "center").toLowerCase();
3151
- if (j && (z === "outside" || z === "center") && this.applyStrokeAlignment(t, n, f, a, r, c), n.fill && n.fill.type !== "None") {
3151
+ if (j && (z === "outside" || z === "center") && this.applyStrokeAlignment(t, n, f, a, r, l), n.fill && n.fill.type !== "None") {
3152
3152
  t.save();
3153
3153
  const D = t.globalAlpha, et = this.createCanvasFill(t, n.fill, a, r);
3154
- t.fillStyle = et || n.fill.color || "transparent", t.globalAlpha = D * this.normalizeOpacity(n.fill.opacity ?? 100), c !== 0 ? (this.drawRoundRect(t, -a / 2, -r / 2, a, r, c), t.fill()) : t.fillRect(-a / 2, -r / 2, a, r), t.globalAlpha = D, t.restore();
3154
+ t.fillStyle = et || n.fill.color || "transparent", t.globalAlpha = D * this.normalizeOpacity(n.fill.opacity ?? 100), l !== 0 ? (this.drawRoundRect(t, -a / 2, -r / 2, a, r, l), t.fill()) : t.fillRect(-a / 2, -r / 2, a, r), t.globalAlpha = D, t.restore();
3155
3155
  }
3156
- gt.complete && gt.naturalWidth > 0 ? (c !== 0 ? (t.save(), this.drawRoundRect(t, -a / 2, -r / 2, a, r, c), t.clip(), t.drawImage(gt, -a / 2, -r / 2, a, r), t.restore()) : t.drawImage(gt, -a / 2, -r / 2, a, r), j && z === "inside" && this.applyStrokeAlignment(t, n, f, a, r, c)) : j && z === "inside" && this.applyStrokeAlignment(t, n, f, a, r, c);
3156
+ gt.complete && gt.naturalWidth > 0 ? (l !== 0 ? (t.save(), this.drawRoundRect(t, -a / 2, -r / 2, a, r, l), t.clip(), t.drawImage(gt, -a / 2, -r / 2, a, r), t.restore()) : t.drawImage(gt, -a / 2, -r / 2, a, r), j && z === "inside" && this.applyStrokeAlignment(t, n, f, a, r, l)) : j && z === "inside" && this.applyStrokeAlignment(t, n, f, a, r, l);
3157
3157
  }
3158
3158
  } else if (s.type === "SVG") {
3159
3159
  const at = s.svgContent;
@@ -3231,7 +3231,7 @@ class ci {
3231
3231
  }
3232
3232
  const Ft = J(tt.center, 0, 0.5) * 100, Ut = J(tt.center, 1, 0.5) * 100, se = (tt.radius ?? 0.5) * 100;
3233
3233
  return `<radialGradient id="${dt}" cx="${Ft}%" cy="${Ut}%" r="${se}%" gradientUnits="objectBoundingBox">${st}</radialGradient>`;
3234
- }, Rt = (tt, dt) => /<defs>/i.test(tt) ? tt.replace(/<defs>/i, `<defs>${dt}`) : tt.replace(/(<svg[^>]*>)/i, `$1<defs>${dt}</defs>`);
3234
+ }, xt = (tt, dt) => /<defs>/i.test(tt) ? tt.replace(/<defs>/i, `<defs>${dt}`) : tt.replace(/(<svg[^>]*>)/i, `$1<defs>${dt}</defs>`);
3235
3235
  if (z && z.isEnabled !== !1 && (z.width || 0) > 0) {
3236
3236
  const tt = et ? 1 : this.normalizeOpacity(z.opacity ?? 100), dt = et ? "#FFFFFF" : z.color || (j == null ? void 0 : j.color) || "#000000";
3237
3237
  let G = "";
@@ -3241,7 +3241,7 @@ class ci {
3241
3241
  G = st.color || z.color || "#000000";
3242
3242
  else if (st.type === "LinearGradient" || st.type === "RadialGradient" || st.type === "Linear" || st.type === "Radial") {
3243
3243
  const Gt = "exode-stroke";
3244
- F = Rt(F, ce(st, Gt, tt)), G = `url(#${Gt})`;
3244
+ F = xt(F, ce(st, Gt, tt)), G = `url(#${Gt})`;
3245
3245
  }
3246
3246
  }
3247
3247
  G || (G = dt), F.match(/\bstroke\s*=\s*["']/i) ? F = F.replace(
@@ -3263,11 +3263,11 @@ class ci {
3263
3263
  F.match(/\bstroke-linecap\s*=\s*["']/i) ? F = F.replace(/\bstroke-linecap\s*=\s*["'][^"']*["']/gi, `stroke-linecap="${Ce}"`) : F = F.replace(/<(path|circle|rect|ellipse|polygon|polyline)/gi, `<$1 stroke-linecap="${Ce}"`), F = F.replace(/stroke-linecap\s*:\s*[^;"')]+/gi, `stroke-linecap:${Ce}`);
3264
3264
  const Ee = z.lineJoin || "round";
3265
3265
  F.match(/\bstroke-linejoin\s*=\s*["']/i) ? F = F.replace(/\bstroke-linejoin\s*=\s*["'][^"']*["']/gi, `stroke-linejoin="${Ee}"`) : F = F.replace(/<(path|circle|rect|ellipse|polygon|polyline)/gi, `<$1 stroke-linejoin="${Ee}"`), F = F.replace(/stroke-linejoin\s*:\s*[^;"')]+/gi, `stroke-linejoin:${Ee}`);
3266
- const Ae = z.trimStart ?? 0, Oe = z.trimEnd ?? 1, Re = z.trimOffset ?? 0, xe = z.dashOffset ?? 0, $e = Ae !== 0 || Oe !== 1 || Re !== 0 || xe !== 0;
3266
+ const Ae = z.trimStart ?? 0, Oe = z.trimEnd ?? 1, xe = z.trimOffset ?? 0, Re = z.dashOffset ?? 0, $e = Ae !== 0 || Oe !== 1 || xe !== 0 || Re !== 0;
3267
3267
  if ($e) {
3268
3268
  const Gt = Math.max(0, Math.min(1, Ae)), ie = Math.max(0, Math.min(1, Oe));
3269
3269
  this.frameCount % 600 === 0 && this.debugLog(`SVG Trim - Object: ${i.name || i.id}, Start: ${Gt}, End: ${ie}`);
3270
- const be = (J + Ft) * 2, Le = (Re % 1 + 1) % 1, Fe = (xe % 1 + 1) % 1;
3270
+ const be = (J + Ft) * 2, Le = (xe % 1 + 1) % 1, Fe = (Re % 1 + 1) % 1;
3271
3271
  let he = "", re = 0;
3272
3272
  if (Gt >= ie)
3273
3273
  he = `0 ${be}`, re = 0;
@@ -3283,7 +3283,7 @@ class ci {
3283
3283
  if (!/\bstroke\s*=\s*["']/i.test(at) && !new RegExp("(?<![a-z-])stroke\\s*:", "i").test(at)) {
3284
3284
  let Gt = "", ie = "";
3285
3285
  if ($e) {
3286
- const he = s.width || a || 100, re = s.height || r || 100, le = (he + re) * 2, we = Math.max(0, Math.min(1, Ae)), We = Math.max(0, Math.min(1, Oe)), Ge = (Re % 1 + 1) % 1, De = (xe % 1 + 1) % 1;
3286
+ const he = s.width || a || 100, re = s.height || r || 100, le = (he + re) * 2, we = Math.max(0, Math.min(1, Ae)), We = Math.max(0, Math.min(1, Oe)), Ge = (xe % 1 + 1) % 1, De = (Re % 1 + 1) % 1;
3287
3287
  if (we >= We)
3288
3288
  Gt = ` stroke-dasharray="0 ${le}"`, ie = ' stroke-dashoffset="0"';
3289
3289
  else {
@@ -3315,27 +3315,27 @@ class ci {
3315
3315
  this.maskBuffer || (this.maskBuffer = document.createElement("canvas"), this.maskCtx = this.maskBuffer.getContext("2d")), this.maskBuffer.width = F, this.maskBuffer.height = Lt, this.maskCtx.setTransform(1, 0, 0, 1, 0, 0), this.maskCtx.globalCompositeOperation = "source-over", this.maskCtx.globalAlpha = 1, this.maskCtx.filter = "none", this.maskCtx.clearRect(0, 0, F, Lt), this.maskCtx.drawImage(yt, 0, 0, F, Lt), this.maskCtx.globalCompositeOperation = "source-in";
3316
3316
  const jt = j.color || "#000000", Vt = this.normalizeOpacity(j.opacity ?? 100);
3317
3317
  this.maskCtx.fillStyle = jt, this.maskCtx.globalAlpha = Vt, this.maskCtx.fillRect(0, 0, F, Lt), t.drawImage(this.maskBuffer, -F / 2, -Lt / 2, F, Lt);
3318
- } else c !== 0 ? (t.save(), this.drawRoundRect(t, -F / 2, -Lt / 2, F, Lt, c), t.clip(), t.drawImage(yt, -F / 2, -Lt / 2, F, Lt), t.restore()) : t.drawImage(yt, -F / 2, -Lt / 2, F, Lt);
3318
+ } else l !== 0 ? (t.save(), this.drawRoundRect(t, -F / 2, -Lt / 2, F, Lt, l), t.clip(), t.drawImage(yt, -F / 2, -Lt / 2, F, Lt), t.restore()) : t.drawImage(yt, -F / 2, -Lt / 2, F, Lt);
3319
3319
  }
3320
3320
  }
3321
3321
  } else if (f.type === "LineGraph")
3322
3322
  this.renderLineGraph(t, f, a, r);
3323
3323
  else if (i.type === "Shape") {
3324
- if (this.applyPath(t, f, a, r, c), t.save(), n.blur && n.blur.amount > 0 && (t.filter = `blur(${n.blur.amount}px)`), n.fill) {
3324
+ if (this.applyPath(t, f, a, r, l), t.save(), n.blur && n.blur.amount > 0 && (t.filter = `blur(${n.blur.amount}px)`), n.fill) {
3325
3325
  const at = t.globalAlpha;
3326
3326
  if (((A = n.fill) == null ? void 0 : A.type) === "Image" && (n.fill.originalSrc || n.fill.src)) {
3327
3327
  const gt = n.fill.originalSrc || n.fill.src;
3328
3328
  let j = this.imageCache.get(gt);
3329
- j || (j = new Image(), j.src = gt, this.imageCache.set(gt, j)), j.complete && j.naturalWidth > 0 && (t.save(), this.applyPath(t, f, a, r, c), t.clip(), this.renderFittedImage(t, j, -a / 2, -r / 2, a, r, n.fill.fillMode), t.restore());
3329
+ j || (j = new Image(), j.src = gt, this.imageCache.set(gt, j)), j.complete && j.naturalWidth > 0 && (t.save(), this.applyPath(t, f, a, r, l), t.clip(), this.renderFittedImage(t, j, -a / 2, -r / 2, a, r, n.fill.fillMode), t.restore());
3330
3330
  } else {
3331
3331
  const gt = this.createCanvasFill(t, n.fill, a, r);
3332
- t.fillStyle = gt || (typeof n.fill == "string" ? n.fill : n.fill.color || "transparent"), t.globalAlpha = at * this.normalizeOpacity(n.fill.opacity ?? 100), this.applyPath(t, f, a, r, c), t.fill();
3332
+ t.fillStyle = gt || (typeof n.fill == "string" ? n.fill : n.fill.color || "transparent"), t.globalAlpha = at * this.normalizeOpacity(n.fill.opacity ?? 100), this.applyPath(t, f, a, r, l), t.fill();
3333
3333
  }
3334
3334
  t.globalAlpha = at;
3335
3335
  }
3336
- t.restore(), n.stroke && n.stroke.width > 0 && this.applyStrokeAlignment(t, n, f, a, r, c);
3336
+ t.restore(), n.stroke && n.stroke.width > 0 && this.applyStrokeAlignment(t, n, f, a, r, l);
3337
3337
  } else if (i.type === "Frame" || i.type === "Group" && !i.isStructuralGroup) {
3338
- const at = e.width ?? s.width ?? i.width ?? a, gt = e.height ?? s.height ?? i.height ?? r, j = c;
3338
+ const at = e.width ?? s.width ?? i.width ?? a, gt = e.height ?? s.height ?? i.height ?? r, j = l;
3339
3339
  if (t.save(), t.beginPath(), this.drawRoundRect(t, -at / 2, -gt / 2, at, gt, j), n.fill && n.fill.type !== "None") {
3340
3340
  const z = t.globalAlpha, D = this.createCanvasFill(t, n.fill, at, gt);
3341
3341
  t.fillStyle = D || n.fill.color || "transparent", t.globalAlpha = z * this.normalizeOpacity(n.fill.opacity ?? 100), t.fill(), t.globalAlpha = z;
@@ -3345,7 +3345,7 @@ class ci {
3345
3345
  this.applyStrokeAlignment(t, n, z, at, gt, j);
3346
3346
  }
3347
3347
  } else i.type === "Group" && i.isStructuralGroup || (i.type === "Component" && i.variant === "inputbox" ? this.renderInputBox(t, i) : i.type === "Component" && i.variant === "button" ? this.renderButton(t, i) : i.type === "Component" && i.variant === "toggle_button" ? this.renderToggleButton(t, i) : i.type === "Toggle" || i.type === "Component" && i.variant === "toggle" ? this.renderToggle(t, i) : i.type === "Slider" || i.type === "Component" && i.variant === "slider" ? this.renderSlider(t, i) : i.type === "Dropdown" || i.type === "Component" && i.variant === "dropdown" ? this.renderDropdown(t, i) : i.type === "ListView" || i.type === "Component" && i.variant === "listview" ? this.renderListView(t, i) : i.type === "Checkbox" || i.type === "Component" && i.variant === "checkbox" ? this.renderCheckbox(t, i) : i.type === "RadioGroup" || i.type === "Component" && i.variant === "radiogroup" ? this.renderRadioGroup(t, i) : i.type === "BarChart" || i.type === "Component" && i.variant === "barchart" ? this.renderBarChart(t, i) : i.type === "PieChart" || i.type === "Component" && i.variant === "piechart" ? this.renderPieChart(t, i) : i.type === "Joystick" || i.type === "Component" && i.variant === "joystick" ? this.renderJoystick(t, i) : this.frameCount % 300 === 0 && this.warn("[Engine] Unhandled object type in renderObject:", i.type, "Geo:", (_ = i.geometry) == null ? void 0 : _.type));
3348
- if (this.applyArtEffectOverlay(t, i, f, a, r, c), Ot && At === "BackgroundBlur" && this.applyBackgroundBlurGlass(t, f, a, r, c, It), ee && ee.enabled && t.restore(), i.children && i.children.length > 0) {
3348
+ if (this.applyArtEffectOverlay(t, i, f, a, r, l), Ot && At === "BackgroundBlur" && this.applyBackgroundBlurGlass(t, f, a, r, l, It), ee && ee.enabled && t.restore(), i.children && i.children.length > 0) {
3349
3349
  const gt = i.type === "Frame", j = i.clipsContent !== void 0 ? i.clipsContent : i.clipContent !== void 0 ? i.clipContent : gt;
3350
3350
  if (t.save(), j) {
3351
3351
  t.beginPath();
@@ -3381,15 +3381,15 @@ class ci {
3381
3381
  const D = o.get(z.maskId), et = this.objectStates.get(D.id), mt = z.feather || 0, Pt = z.inverted === !0, Ct = z.opacity !== void 0 ? typeof z.opacity == "number" ? z.opacity : z.opacity / 100 : 1;
3382
3382
  if ((z.type || "alpha") === "luma") {
3383
3383
  (!this.lumaBuffer || this.lumaBuffer.width !== this.maskBuffer.width || this.lumaBuffer.height !== this.maskBuffer.height) && (this.lumaBuffer = document.createElement("canvas"), this.lumaBuffer.width = this.maskBuffer.width, this.lumaBuffer.height = this.maskBuffer.height, this.lumaCtx = this.lumaBuffer.getContext("2d", { willReadFrequently: !0 }), this.lumaCtx && (this.lumaCtx.imageSmoothingEnabled = !0, this.lumaCtx.imageSmoothingQuality = "high")), this.lumaCtx.setTransform(1, 0, 0, 1, 0, 0), this.lumaCtx.globalCompositeOperation = "source-over", this.lumaCtx.globalAlpha = 1, this.lumaCtx.filter = "none", this.lumaCtx.clearRect(0, 0, this.lumaBuffer.width, this.lumaBuffer.height), this.lumaCtx.save(), this.rootTransform && this.lumaCtx.setTransform(this.rootTransform), this.applyAbsoluteTransform(this.lumaCtx, D.id, o), mt > 0 && (this.lumaCtx.filter = `blur(${mt}px)`), this.lumaCtx.globalAlpha = Ct;
3384
- const Rt = (et == null ? void 0 : et.width) || D.geometry.width || 0, ft = (et == null ? void 0 : et.height) || D.geometry.height || 0, ct = (et == null ? void 0 : et.corner_radius) ?? D.corner_radius ?? 0;
3384
+ const xt = (et == null ? void 0 : et.width) || D.geometry.width || 0, ft = (et == null ? void 0 : et.height) || D.geometry.height || 0, ct = (et == null ? void 0 : et.corner_radius) ?? D.corner_radius ?? 0;
3385
3385
  if (((yt = D.geometry) == null ? void 0 : yt.type) === "Text") {
3386
3386
  const st = et != null && et.geometry ? this.deepMerge(D.geometry, et.geometry) : D.geometry, J = et != null && et.style ? this.deepMerge(D.style, et.style) : D.style;
3387
- this._renderText(this.lumaCtx, D, { ...st, width: Rt, height: ft, corner_radius: ct }, J, et, Rt, ft, !0);
3387
+ this._renderText(this.lumaCtx, D, { ...st, width: xt, height: ft, corner_radius: ct }, J, et, xt, ft, !0);
3388
3388
  } else if (((F = D.geometry) == null ? void 0 : F.type) === "Image") {
3389
3389
  const st = D.geometry.src;
3390
3390
  if (st) {
3391
3391
  let J = this.imageCache.get(st);
3392
- J || (J = new Image(), J.src = st, this.imageCache.set(st, J)), J.complete && J.naturalWidth > 0 ? this.lumaCtx.drawImage(J, -Rt / 2, -ft / 2, Rt, ft) : (this.applyPath(this.lumaCtx, D.geometry, Rt, ft, ct), this.lumaCtx.fillStyle = "#ffffff", this.lumaCtx.fill());
3392
+ J || (J = new Image(), J.src = st, this.imageCache.set(st, J)), J.complete && J.naturalWidth > 0 ? this.lumaCtx.drawImage(J, -xt / 2, -ft / 2, xt, ft) : (this.applyPath(this.lumaCtx, D.geometry, xt, ft, ct), this.lumaCtx.fillStyle = "#ffffff", this.lumaCtx.fill());
3393
3393
  }
3394
3394
  } else if (((Lt = D.geometry) == null ? void 0 : Lt.type) === "SVG") {
3395
3395
  const st = D.geometry.svgContent;
@@ -3403,10 +3403,10 @@ class ci {
3403
3403
  this.artboard && this.reset();
3404
3404
  }, this.imageCache.set(J, Ft);
3405
3405
  }
3406
- Ft.complete && Ft.naturalWidth > 0 ? this.lumaCtx.drawImage(Ft, -Rt / 2, -ft / 2, Rt, ft) : (this.applyPath(this.lumaCtx, D.geometry, Rt, ft, ct), this.lumaCtx.fillStyle = "#ffffff", this.lumaCtx.fill());
3406
+ Ft.complete && Ft.naturalWidth > 0 ? this.lumaCtx.drawImage(Ft, -xt / 2, -ft / 2, xt, ft) : (this.applyPath(this.lumaCtx, D.geometry, xt, ft, ct), this.lumaCtx.fillStyle = "#ffffff", this.lumaCtx.fill());
3407
3407
  }
3408
3408
  } else
3409
- this.applyPath(this.lumaCtx, D.geometry, Rt, ft, ct), this.lumaCtx.fillStyle = "#ffffff", this.lumaCtx.fill();
3409
+ this.applyPath(this.lumaCtx, D.geometry, xt, ft, ct), this.lumaCtx.fillStyle = "#ffffff", this.lumaCtx.fill();
3410
3410
  this.lumaCtx.restore();
3411
3411
  const tt = this.maskCtx.getImageData(0, 0, this.canvasWidth, this.canvasHeight), dt = this.lumaCtx.getImageData(0, 0, this.canvasWidth, this.canvasHeight).data, G = tt.data;
3412
3412
  for (let st = 0; st < G.length; st += 4) {
@@ -3417,15 +3417,15 @@ class ci {
3417
3417
  this.maskCtx.putImageData(tt, 0, 0);
3418
3418
  } else {
3419
3419
  this.maskCtx.save(), this.rootTransform && this.maskCtx.setTransform(this.rootTransform), this.maskCtx.globalCompositeOperation = Pt ? "destination-out" : "destination-in", mt > 0 && (this.maskCtx.filter = `blur(${mt}px)`), this.maskCtx.globalAlpha = Ct, this.applyAbsoluteTransform(this.maskCtx, D.id, o);
3420
- const Rt = (et == null ? void 0 : et.width) || D.geometry.width || 0, ft = (et == null ? void 0 : et.height) || D.geometry.height || 0, ct = (et == null ? void 0 : et.corner_radius) ?? D.corner_radius ?? 0;
3420
+ const xt = (et == null ? void 0 : et.width) || D.geometry.width || 0, ft = (et == null ? void 0 : et.height) || D.geometry.height || 0, ct = (et == null ? void 0 : et.corner_radius) ?? D.corner_radius ?? 0;
3421
3421
  if (((jt = D.geometry) == null ? void 0 : jt.type) === "Text") {
3422
3422
  const tt = et != null && et.geometry ? this.deepMerge(D.geometry, et.geometry) : D.geometry, dt = et != null && et.style ? this.deepMerge(D.style, et.style) : D.style;
3423
- this._renderText(this.maskCtx, D, { ...tt, width: Rt, height: ft, corner_radius: ct }, dt, et, Rt, ft, !0);
3423
+ this._renderText(this.maskCtx, D, { ...tt, width: xt, height: ft, corner_radius: ct }, dt, et, xt, ft, !0);
3424
3424
  } else if (((Vt = D.geometry) == null ? void 0 : Vt.type) === "Image") {
3425
3425
  const tt = D.geometry.src;
3426
3426
  if (tt) {
3427
3427
  let dt = this.imageCache.get(tt);
3428
- dt || (dt = new Image(), dt.src = tt, this.imageCache.set(tt, dt)), dt.complete && dt.naturalWidth > 0 ? this.maskCtx.drawImage(dt, -Rt / 2, -ft / 2, Rt, ft) : (this.applyPath(this.maskCtx, D.geometry, Rt, ft, ct), this.maskCtx.fillStyle = "#ffffff", this.maskCtx.fill());
3428
+ dt || (dt = new Image(), dt.src = tt, this.imageCache.set(tt, dt)), dt.complete && dt.naturalWidth > 0 ? this.maskCtx.drawImage(dt, -xt / 2, -ft / 2, xt, ft) : (this.applyPath(this.maskCtx, D.geometry, xt, ft, ct), this.maskCtx.fillStyle = "#ffffff", this.maskCtx.fill());
3429
3429
  }
3430
3430
  } else if (((ce = D.geometry) == null ? void 0 : ce.type) === "SVG") {
3431
3431
  const tt = D.geometry.svgContent;
@@ -3439,10 +3439,10 @@ class ci {
3439
3439
  this.artboard && this.reset();
3440
3440
  }, this.imageCache.set(dt, G);
3441
3441
  }
3442
- G.complete && G.naturalWidth > 0 ? this.maskCtx.drawImage(G, -Rt / 2, -ft / 2, Rt, ft) : (this.applyPath(this.maskCtx, D.geometry, Rt, ft, ct), this.maskCtx.fillStyle = "#ffffff", this.maskCtx.fill());
3442
+ G.complete && G.naturalWidth > 0 ? this.maskCtx.drawImage(G, -xt / 2, -ft / 2, xt, ft) : (this.applyPath(this.maskCtx, D.geometry, xt, ft, ct), this.maskCtx.fillStyle = "#ffffff", this.maskCtx.fill());
3443
3443
  }
3444
3444
  } else
3445
- this.applyPath(this.maskCtx, D.geometry, Rt, ft, ct), this.maskCtx.fillStyle = "#ffffff", this.maskCtx.fill();
3445
+ this.applyPath(this.maskCtx, D.geometry, xt, ft, ct), this.maskCtx.fillStyle = "#ffffff", this.maskCtx.fill();
3446
3446
  this.maskCtx.restore();
3447
3447
  }
3448
3448
  }), Bt.save(), Bt.setTransform(1, 0, 0, 1, 0, 0);
@@ -3452,12 +3452,12 @@ class ci {
3452
3452
  t.restore();
3453
3453
  }
3454
3454
  }
3455
- _renderText(t, i, o, e, s, n, a, r = !1, l = !1) {
3455
+ _renderText(t, i, o, e, s, n, a, r = !1, c = !1) {
3456
3456
  var bt, ht, wt, Mt, It, Ot, At, Tt, zt;
3457
- let c = o.text || "";
3457
+ let l = o.text || "";
3458
3458
  if (o.textInputId && !r) {
3459
3459
  const Z = this.inputs.get(o.textInputId);
3460
- Z !== void 0 && (c = String(Z), s.geometry && s.geometry.type === "Text" && (s.geometry.text = c));
3460
+ Z !== void 0 && (l = String(Z), s.geometry && s.geometry.type === "Text" && (s.geometry.text = l));
3461
3461
  }
3462
3462
  if (o.svgPath) {
3463
3463
  const Z = o.svgPath;
@@ -3468,7 +3468,7 @@ class ci {
3468
3468
  t.fill(ut), t.restore();
3469
3469
  return;
3470
3470
  }
3471
- let f = c || "";
3471
+ let f = l || "";
3472
3472
  o.enableSegments === !0 && o.segments && Array.isArray(o.segments) && (f = o.segments.map((Z) => Z && Z.text ? Z.text : "").join(""));
3473
3473
  const u = o.textCase || "none";
3474
3474
  u === "uppercase" ? f = f.toUpperCase() : u === "lowercase" ? f = f.toLowerCase() : u === "capitalize" && (f = f.replace(/\b\w/g, (Z) => Z.toUpperCase()));
@@ -3497,10 +3497,10 @@ class ci {
3497
3497
  t.letterSpacing !== void 0 && (t.letterSpacing = `${M}px`);
3498
3498
  const k = o.kerning || "auto", T = o.kerningValue || 0;
3499
3499
  k === "manual" && T !== 0 && (t.letterSpacing = `${M + T}px`);
3500
- const R = o.paragraphSpacing || 0;
3500
+ const x = o.paragraphSpacing || 0;
3501
3501
  let P = o.lineHeight ?? 1.2;
3502
3502
  typeof P == "string" && (P = parseFloat(P)), P > 5 && y > 0 && (P = P / y);
3503
- const E = (P || 1.2) * y, x = o.isPointText === !0 || !o.width || o.width <= 0, O = ((It = o.padding) == null ? void 0 : It.left) || ((Ot = o.padding) == null ? void 0 : Ot.right) || 0, W = x ? 1e5 : o.width && o.width > 0 ? Math.ceil(o.width) - O * 2 : 1e5;
3503
+ const E = (P || 1.2) * y, R = o.isPointText === !0 || !o.width || o.width <= 0, O = ((It = o.padding) == null ? void 0 : It.left) || ((Ot = o.padding) == null ? void 0 : Ot.right) || 0, W = R ? 1e5 : o.width && o.width > 0 ? Math.ceil(o.width) - O * 2 : 1e5;
3504
3504
  o.autoHeight;
3505
3505
  const B = us({
3506
3506
  text: f,
@@ -3511,7 +3511,7 @@ class ci {
3511
3511
  lineHeight: P,
3512
3512
  width: W,
3513
3513
  letterSpacing: M,
3514
- paragraphSpacing: R,
3514
+ paragraphSpacing: x,
3515
3515
  paragraphIndent: o.paragraphIndent || 0,
3516
3516
  segments: o.segments,
3517
3517
  enableSegments: o.enableSegments,
@@ -3525,8 +3525,8 @@ class ci {
3525
3525
  let Z = 0, pt = 0;
3526
3526
  const Et = B.fullText || f;
3527
3527
  ($ || []).forEach((ut) => {
3528
- const vt = ut.text || "", xt = t.measureText(vt).width + (vt.length > 0 ? (vt.length - 1) * M : 0);
3529
- xt > Z && (Z = xt), pt += vt.length, pt < Et.length && (Et[pt] === `
3528
+ const vt = ut.text || "", Rt = t.measureText(vt).width + (vt.length > 0 ? (vt.length - 1) * M : 0);
3529
+ Rt > Z && (Z = Rt), pt += vt.length, pt < Et.length && (Et[pt] === `
3530
3530
  ` || Et[pt] === "\r") && (pt++, Et[pt - 1] === "\r" && Et[pt] === `
3531
3531
  ` && pt++);
3532
3532
  }), (_ === 0 || _ >= 1e5) && (_ = Z), L === 0 && (L = A || 0);
@@ -3545,8 +3545,8 @@ class ci {
3545
3545
  var ut, vt;
3546
3546
  if (M === 0 && (!o.enableSegments || !((ut = o.segments) != null && ut.length))) return t.measureText(Z).width;
3547
3547
  let Et = 0;
3548
- for (let xt = 0; xt < Z.length; xt++) {
3549
- const Xt = pt + xt;
3548
+ for (let Rt = 0; Rt < Z.length; Rt++) {
3549
+ const Xt = pt + Rt;
3550
3550
  let Bt = 0;
3551
3551
  if (o.enableSegments === !0 && ((vt = o.segments) == null ? void 0 : vt.length) > 0) {
3552
3552
  let Dt = 0, Ht = null;
@@ -3561,18 +3561,18 @@ class ci {
3561
3561
  t.save();
3562
3562
  let te = Ht.fontFamily || o.fontFamily || "Inter";
3563
3563
  const ue = this.mapFontWeight((Ht.fontWeight || o.fontWeight || "400").toString()), pe = Ht.fontStyle || d, Qt = Ht.fontSize || y;
3564
- t.font = `${pe} ${ue} ${Qt}px "${te}", sans-serif`, Bt = t.measureText(Z[xt]).width, t.restore();
3564
+ t.font = `${pe} ${ue} ${Qt}px "${te}", sans-serif`, Bt = t.measureText(Z[Rt]).width, t.restore();
3565
3565
  } else
3566
- Bt = t.measureText(Z[xt]).width;
3566
+ Bt = t.measureText(Z[Rt]).width;
3567
3567
  } else
3568
- Bt = t.measureText(Z[xt]).width;
3568
+ Bt = t.measureText(Z[Rt]).width;
3569
3569
  Et += Bt + M;
3570
3570
  }
3571
3571
  return Et - (Z.length > 0 ? M : 0);
3572
3572
  }, nt = (Z, pt, Et, ut, vt) => {
3573
3573
  var ue, pe;
3574
3574
  const Xt = (vt === 0 || f[vt - 1] === `
3575
- ` || f[vt - 1] === "\r") && o.paragraphIndent ? o.paragraphIndent : 0, Bt = (!r || l) && (i.behaviors || []).some(
3575
+ ` || f[vt - 1] === "\r") && o.paragraphIndent ? o.paragraphIndent : 0, Bt = (!r || c) && (i.behaviors || []).some(
3576
3576
  (Qt) => Qt.enabled && (Qt.type.toString().includes("Text") || ["Typewriter", "Scramble", "Wave", "Bounce", "GlitchText", "Reveal3D", "RevealSlide", "RevealBlur"].includes(Qt.type))
3577
3577
  ), Dt = !o.pathId && !Bt && (o.enableSegments !== !0 || !o.segments || o.segments.length === 0), Ht = o.baselineShift || 0, te = Et + Ht;
3578
3578
  if (Dt)
@@ -3586,7 +3586,7 @@ class ci {
3586
3586
  let ye = 0, Se = 0;
3587
3587
  const Pe = o.justifyMinWordSpacing, ae = o.justifyMaxWordSpacing;
3588
3588
  if (I === "justify" && !_e && Qt > 0 && !o.pathId) {
3589
- const j = x ? Qt : W - O * 2 + 0, z = Math.max(0, j - Qt);
3589
+ const j = R ? Qt : W - O * 2 + 0, z = Math.max(0, j - Qt);
3590
3590
  for (let D = 0; D < Z.length; D++)
3591
3591
  Z[D] === " " && Se++;
3592
3592
  if (Se > 0) {
@@ -3598,7 +3598,7 @@ class ci {
3598
3598
  let ee = o.pathOffset || 0;
3599
3599
  o.pathId && it > 0 && V && (I === "center" ? ee += it / 2 - Qt / 2 : I === "right" && (ee += it - Qt));
3600
3600
  let at = me;
3601
- const gt = r && !l ? [] : ((ue = i.behaviors) == null ? void 0 : ue.filter(
3601
+ const gt = r && !c ? [] : ((ue = i.behaviors) == null ? void 0 : ue.filter(
3602
3602
  (j) => [
3603
3603
  N.Typewriter,
3604
3604
  N.Scramble,
@@ -3754,25 +3754,25 @@ class ci {
3754
3754
  t.font = C;
3755
3755
  const ce = t.globalAlpha;
3756
3756
  t.globalAlpha *= yt, t.save();
3757
- const Rt = t.measureText(F).width;
3757
+ const xt = t.measureText(F).width;
3758
3758
  if (V && it > 0) {
3759
- const ft = at - me + Rt / 2, tt = (ee + ft) / it, dt = this.getPointOnPath(V.geo, V.w, V.h, Math.abs(tt % 1)), G = dt.angle, st = Et + mt + (o.pathOffsetY || 0), J = o.pathSide === "right" ? -1 : 1, Ft = Math.cos(G + Math.PI / 2) * st * J, Ut = Math.sin(G + Math.PI / 2) * st * J;
3759
+ const ft = at - me + xt / 2, tt = (ee + ft) / it, dt = this.getPointOnPath(V.geo, V.w, V.h, Math.abs(tt % 1)), G = dt.angle, st = Et + mt + (o.pathOffsetY || 0), J = o.pathSide === "right" ? -1 : 1, Ft = Math.cos(G + Math.PI / 2) * st * J, Ut = Math.sin(G + Math.PI / 2) * st * J;
3760
3760
  t.translate(dt.x + Ft + et, dt.y + Ut), t.rotate(G + Wt + (J === -1 ? Math.PI : 0));
3761
3761
  } else
3762
- t.translate(at + et + Rt / 2, Et + mt), Wt !== 0 && t.rotate(Wt);
3763
- if (t.scale(Pt, Ct), Lt && !r && !l) {
3762
+ t.translate(at + et + xt / 2, Et + mt), Wt !== 0 && t.rotate(Wt);
3763
+ if (t.scale(Pt, Ct), Lt && !r && !c) {
3764
3764
  const ft = this.createCanvasFill(t, Lt, _, L);
3765
3765
  t.fillStyle = ft || Lt.color || "#000000";
3766
- } else if (!r && !l) {
3766
+ } else if (!r && !c) {
3767
3767
  const ft = this.createCanvasFill(t, e.fill, _, L);
3768
3768
  t.fillStyle = ft || e.fill.color || "#000000";
3769
3769
  }
3770
3770
  if (yt > 0)
3771
- if (r || l) {
3772
- const ft = l ? "#000000" : this.createCanvasFill(t, e.fill, _, L);
3773
- t.fillStyle = ft || e.fill.color || "#ffffff", t.fillText(F, -Rt / 2, 0);
3774
- } else ut ? t.strokeText(F, -Rt / 2, 0) : t.fillText(F, -Rt / 2, 0);
3775
- jt !== "none" && !r && this.drawTextDecoration(t, jt, 0, 0, Rt, Vt), t.restore(), t.globalAlpha = ce, I === "justify" && ye > 0 && F === " " && !_e ? at += Rt + M + ye : at += Rt + M;
3771
+ if (r || c) {
3772
+ const ft = c ? "#000000" : this.createCanvasFill(t, e.fill, _, L);
3773
+ t.fillStyle = ft || e.fill.color || "#ffffff", t.fillText(F, -xt / 2, 0);
3774
+ } else ut ? t.strokeText(F, -xt / 2, 0) : t.fillText(F, -xt / 2, 0);
3775
+ jt !== "none" && !r && this.drawTextDecoration(t, jt, 0, 0, xt, Vt), t.restore(), t.globalAlpha = ce, I === "justify" && ye > 0 && F === " " && !_e ? at += xt + M + ye : at += xt + M;
3776
3776
  }
3777
3777
  }
3778
3778
  };
@@ -3781,10 +3781,10 @@ class ci {
3781
3781
  ($ || []).forEach((Et) => {
3782
3782
  const ut = Et.text || "", vt = f.indexOf(ut, Z);
3783
3783
  vt !== -1 && (Z = vt);
3784
- let xt = -_ / 2;
3785
- I === "center" ? xt = 0 : I === "right" && (xt = _ / 2), nt(ut, xt, pt, !1, Z), Z += ut.length, pt += E;
3784
+ let Rt = -_ / 2;
3785
+ I === "center" ? Rt = 0 : I === "right" && (Rt = _ / 2), nt(ut, Rt, pt, !1, Z), Z += ut.length, pt += E;
3786
3786
  });
3787
- } else if (l) {
3787
+ } else if (c) {
3788
3788
  let Z = 0, pt = X;
3789
3789
  ($ || []).forEach((Et) => {
3790
3790
  const ut = Et.text || "";
@@ -3802,12 +3802,12 @@ class ci {
3802
3802
  const Dt = Xt.textCase || o.textCase || "none";
3803
3803
  return Dt === "uppercase" ? Bt.toUpperCase() : Dt === "lowercase" ? Bt.toLowerCase() : Dt === "capitalize" ? Bt.replace(/\b\w/g, (Ht) => Ht.toUpperCase()) : Bt;
3804
3804
  }).join("") : f);
3805
- let vt = 0, xt = X;
3805
+ let vt = 0, Rt = X;
3806
3806
  ($ || []).forEach((Xt) => {
3807
3807
  const Bt = Xt.text || "";
3808
3808
  let Dt = -_ / 2;
3809
- I === "center" ? Dt = 0 : I === "right" && (Dt = _ / 2), nt(Bt, Dt, xt, !1, vt), vt += Bt.length, xt += E, vt < ut.length && (ut[vt] === `
3810
- ` || ut[vt] === "\r") && (R > 0 && (xt += R), vt++, ut[vt - 1] === "\r" && ut[vt] === `
3809
+ I === "center" ? Dt = 0 : I === "right" && (Dt = _ / 2), nt(Bt, Dt, Rt, !1, vt), vt += Bt.length, Rt += E, vt < ut.length && (ut[vt] === `
3810
+ ` || ut[vt] === "\r") && (x > 0 && (Rt += x), vt++, ut[vt - 1] === "\r" && ut[vt] === `
3811
3811
  ` && vt++);
3812
3812
  }), t.globalAlpha = pt;
3813
3813
  }
@@ -3816,9 +3816,9 @@ class ci {
3816
3816
  let pt = 0;
3817
3817
  ($ || []).forEach((Et, ut) => {
3818
3818
  var Xt, Bt;
3819
- const xt = pt === 0 || pt < f.length && (f[pt] === `
3819
+ const Rt = pt === 0 || pt < f.length && (f[pt] === `
3820
3820
  ` || f[pt] === "\r");
3821
- if (xt && ut > 0 && pt++, xt) {
3821
+ if (Rt && ut > 0 && pt++, Rt) {
3822
3822
  if (((Xt = Z.top) == null ? void 0 : Xt.width) > 0) {
3823
3823
  const Dt = X + ut * E - Z.top.offset;
3824
3824
  t.strokeStyle = Z.top.color || "#000000", t.lineWidth = Z.top.width, t.beginPath();
@@ -3839,10 +3839,10 @@ class ci {
3839
3839
  const pt = t.globalAlpha;
3840
3840
  e.fill && e.fill.type !== "None" && e.fill.isEnabled !== !1 && e.fill.opacity !== 0 && e.fill.color !== "transparent" && e.fill.color !== "rgba(0,0,0,0)" && (t.shadowColor = "transparent", t.shadowBlur = 0, t.shadowOffsetX = 0, t.shadowOffsetY = 0), t.strokeStyle = e.stroke.color, t.lineWidth = e.stroke.width, t.globalAlpha = pt * this.normalizeOpacity(e.stroke.opacity ?? 100);
3841
3841
  let ut = 0, vt = X;
3842
- ($ || []).forEach((xt) => {
3842
+ ($ || []).forEach((Rt) => {
3843
3843
  let Xt = -_ / 2;
3844
- I === "center" ? Xt = 0 : I === "right" && (Xt = _ / 2), nt(xt.text, Xt, vt, !0, ut), ut += (xt.text || "").length, vt += E, ut < f.length && (f[ut] === `
3845
- ` || f[ut] === "\r") && (R > 0 && (vt += R), ut++, f[ut - 1] === "\r" && f[ut] === `
3844
+ I === "center" ? Xt = 0 : I === "right" && (Xt = _ / 2), nt(Rt.text, Xt, vt, !0, ut), ut += (Rt.text || "").length, vt += E, ut < f.length && (f[ut] === `
3845
+ ` || f[ut] === "\r") && (x > 0 && (vt += x), ut++, f[ut - 1] === "\r" && f[ut] === `
3846
3846
  ` && ut++);
3847
3847
  }), t.globalAlpha = pt;
3848
3848
  }
@@ -3850,7 +3850,7 @@ class ci {
3850
3850
  }
3851
3851
  applyStrokeAlignment(t, i, o, e, s, n) {
3852
3852
  if (!i.stroke || i.stroke.width <= 0 || i.stroke.isEnabled === !1) return;
3853
- const a = i.stroke, r = a.width, l = (a.alignment || "center").toLowerCase();
3853
+ const a = i.stroke, r = a.width, c = (a.alignment || "center").toLowerCase();
3854
3854
  if (t.save(), i.fill && i.fill.type !== "None" && i.fill.isEnabled !== !1 && i.fill.opacity !== 0 && i.fill.color !== "transparent" && i.fill.color !== "rgba(0,0,0,0)" && (t.shadowColor = "transparent", t.shadowBlur = 0, t.shadowOffsetX = 0, t.shadowOffsetY = 0), a.fill) {
3855
3855
  const m = this.createCanvasFill(t, a.fill, e, s);
3856
3856
  m ? t.strokeStyle = m : t.strokeStyle = a.color || "#000000";
@@ -3874,7 +3874,7 @@ class ci {
3874
3874
  }
3875
3875
  }
3876
3876
  } else y.length > 0 && (t.setLineDash(y), t.lineDashOffset = p);
3877
- (o == null ? void 0 : o.type) === "Line" || e === 0 || s === 0 ? (this.applyPath(t, o, e, s, n), t.stroke()) : l === "inside" ? (t.lineWidth = r * 2, t.save(), this.applyPath(t, o, e, s, n), t.clip(), t.stroke(), t.restore()) : l === "outside" ? (t.lineWidth = r * 2, this.applyPath(t, o, e, s, n), t.stroke(), t.save(), t.globalCompositeOperation = "destination-out", this.applyPath(t, o, e, s, n), t.fill(), t.restore()) : (t.lineWidth = r, this.applyPath(t, o, e, s, n), t.stroke()), t.restore();
3877
+ (o == null ? void 0 : o.type) === "Line" || e === 0 || s === 0 ? (this.applyPath(t, o, e, s, n), t.stroke()) : c === "inside" ? (t.lineWidth = r * 2, t.save(), this.applyPath(t, o, e, s, n), t.clip(), t.stroke(), t.restore()) : c === "outside" ? (t.lineWidth = r * 2, this.applyPath(t, o, e, s, n), t.stroke(), t.save(), t.globalCompositeOperation = "destination-out", this.applyPath(t, o, e, s, n), t.fill(), t.restore()) : (t.lineWidth = r, this.applyPath(t, o, e, s, n), t.stroke()), t.restore();
3878
3878
  }
3879
3879
  getPerimeter(t, i, o) {
3880
3880
  switch (this.ensurePathPoints(t), t == null ? void 0 : t.type) {
@@ -3883,12 +3883,12 @@ class ci {
3883
3883
  case "Ellipse": {
3884
3884
  const e = Math.abs(i) / 2, s = Math.abs(o) / 2, n = Math.abs(t.sweepAngle ?? 360), a = t.ratio || 0, r = Math.PI * (3 * (e + s) - Math.sqrt((3 * e + s) * (e + 3 * s)));
3885
3885
  if (n >= 360 && a <= 0) return r;
3886
- let l = n / 360 * r;
3886
+ let c = n / 360 * r;
3887
3887
  if (a > 0) {
3888
- const c = Math.PI * (3 * (e * a + s * a) - Math.sqrt((3 * e * a + s * a) * (e * a + 3 * s * a)));
3889
- l += n / 360 * c, n < 360 && (l += 2 * Math.sqrt((e - e * a) ** 2 + (s - s * a) ** 2));
3890
- } else n < 360 && (l += 2 * Math.max(e, s));
3891
- return isNaN(l) ? 0 : l;
3888
+ const l = Math.PI * (3 * (e * a + s * a) - Math.sqrt((3 * e * a + s * a) * (e * a + 3 * s * a)));
3889
+ c += n / 360 * l, n < 360 && (c += 2 * Math.sqrt((e - e * a) ** 2 + (s - s * a) ** 2));
3890
+ } else n < 360 && (c += 2 * Math.max(e, s));
3891
+ return isNaN(c) ? 0 : c;
3892
3892
  }
3893
3893
  case "Line":
3894
3894
  return t.length || Math.sqrt(i * i + o * o);
@@ -3907,22 +3907,22 @@ class ci {
3907
3907
  if (e.length < 2) return t.length || 0;
3908
3908
  let s = 0, n = e[0].x, a = e[0].y;
3909
3909
  for (let r = 1; r < e.length; r++) {
3910
- const l = e[r];
3911
- if (l.moveTo) {
3912
- n = l.x, a = l.y;
3910
+ const c = e[r];
3911
+ if (c.moveTo) {
3912
+ n = c.x, a = c.y;
3913
3913
  continue;
3914
3914
  }
3915
- const c = n, f = a, u = e[r - 1].out_x, h = e[r - 1].out_y;
3916
- if (u !== void 0 || l.in_x !== void 0 ? s += this.getBezierLength(
3917
- c,
3915
+ const l = n, f = a, u = e[r - 1].out_x, h = e[r - 1].out_y;
3916
+ if (u !== void 0 || c.in_x !== void 0 ? s += this.getBezierLength(
3917
+ l,
3918
3918
  f,
3919
- u ?? c,
3919
+ u ?? l,
3920
3920
  h ?? f,
3921
- l.in_x ?? l.x,
3922
- l.in_y ?? l.y,
3923
- l.x,
3924
- l.y
3925
- ) : s += Math.sqrt((l.x - c) ** 2 + (l.y - f) ** 2), n = l.x, a = l.y, l.closePath || r === e.length - 1 && (t.is_closed || t.isClosed)) {
3921
+ c.in_x ?? c.x,
3922
+ c.in_y ?? c.y,
3923
+ c.x,
3924
+ c.y
3925
+ ) : s += Math.sqrt((c.x - l) ** 2 + (c.y - f) ** 2), n = c.x, a = c.y, c.closePath || r === e.length - 1 && (t.is_closed || t.isClosed)) {
3926
3926
  const d = n, p = a, y = [...e.slice(0, r + 1)].reverse().find((I) => I.moveTo) || e[0], m = y.x, b = y.y, v = e[r].out_x, S = e[r].out_y, C = y.in_x, w = y.in_y;
3927
3927
  v !== void 0 || C !== void 0 ? s += this.getBezierLength(
3928
3928
  d,
@@ -3942,22 +3942,22 @@ class ci {
3942
3942
  return (i + o) * 2;
3943
3943
  }
3944
3944
  }
3945
- getBezierLength(t, i, o, e, s, n, a, r, l = 10) {
3946
- let c = 0, f = t, u = i;
3947
- for (let h = 1; h <= l; h++) {
3948
- const d = h / l, p = 1 - d, y = d * d, m = p * p, b = m * p, v = y * d, S = b * t + 3 * m * d * o + 3 * p * y * s + v * a, C = b * i + 3 * m * d * e + 3 * p * y * n + v * r, w = S - f, I = C - u;
3949
- c += Math.sqrt(w * w + I * I), f = S, u = C;
3945
+ getBezierLength(t, i, o, e, s, n, a, r, c = 10) {
3946
+ let l = 0, f = t, u = i;
3947
+ for (let h = 1; h <= c; h++) {
3948
+ const d = h / c, p = 1 - d, y = d * d, m = p * p, b = m * p, v = y * d, S = b * t + 3 * m * d * o + 3 * p * y * s + v * a, C = b * i + 3 * m * d * e + 3 * p * y * n + v * r, w = S - f, I = C - u;
3949
+ l += Math.sqrt(w * w + I * I), f = S, u = C;
3950
3950
  }
3951
- return c;
3951
+ return l;
3952
3952
  }
3953
- getBezierTAtLength(t, i, o, e, s, n, a, r, l, c = 20) {
3953
+ getBezierTAtLength(t, i, o, e, s, n, a, r, c, l = 20) {
3954
3954
  if (t <= 0) return 0;
3955
3955
  let f = 0, u = i, h = o;
3956
- for (let d = 1; d <= c; d++) {
3957
- const p = d / c, y = 1 - p, m = p * p, b = y * y, v = b * y, S = m * p, C = v * i + 3 * b * p * e + 3 * y * m * n + S * r, w = v * o + 3 * b * p * s + 3 * y * m * a + S * l, I = C - u, M = w - h, k = Math.sqrt(I * I + M * M);
3956
+ for (let d = 1; d <= l; d++) {
3957
+ const p = d / l, y = 1 - p, m = p * p, b = y * y, v = b * y, S = m * p, C = v * i + 3 * b * p * e + 3 * y * m * n + S * r, w = v * o + 3 * b * p * s + 3 * y * m * a + S * c, I = C - u, M = w - h, k = Math.sqrt(I * I + M * M);
3958
3958
  if (f + k >= t) {
3959
- const T = t - f, R = k === 0 ? 0 : T / k;
3960
- return (d - 1 + R) / c;
3959
+ const T = t - f, x = k === 0 ? 0 : T / k;
3960
+ return (d - 1 + x) / l;
3961
3961
  }
3962
3962
  f += k, u = C, h = w;
3963
3963
  }
@@ -3967,11 +3967,11 @@ class ci {
3967
3967
  if (this.ensurePathPoints(t), (t == null ? void 0 : t.type) === "Path") {
3968
3968
  const s = t.points || [];
3969
3969
  if (s.length < 2) return { x: 0, y: 0, angle: 0 };
3970
- let n = 1 / 0, a = -1 / 0, r = 1 / 0, l = -1 / 0;
3970
+ let n = 1 / 0, a = -1 / 0, r = 1 / 0, c = -1 / 0;
3971
3971
  s.forEach((b) => {
3972
- typeof b.x == "number" && typeof b.y == "number" && (n = Math.min(n, b.x), a = Math.max(a, b.x), r = Math.min(r, b.y), l = Math.max(l, b.y), b.out_x !== void 0 && (n = Math.min(n, b.out_x), a = Math.max(a, b.out_x)), b.out_y !== void 0 && (r = Math.min(r, b.out_y), l = Math.max(l, b.out_y)), b.in_x !== void 0 && (n = Math.min(n, b.in_x), a = Math.max(a, b.in_x)), b.in_y !== void 0 && (r = Math.min(r, b.in_y), l = Math.max(l, b.in_y)));
3972
+ typeof b.x == "number" && typeof b.y == "number" && (n = Math.min(n, b.x), a = Math.max(a, b.x), r = Math.min(r, b.y), c = Math.max(c, b.y), b.out_x !== void 0 && (n = Math.min(n, b.out_x), a = Math.max(a, b.out_x)), b.out_y !== void 0 && (r = Math.min(r, b.out_y), c = Math.max(c, b.out_y)), b.in_x !== void 0 && (n = Math.min(n, b.in_x), a = Math.max(a, b.in_x)), b.in_y !== void 0 && (r = Math.min(r, b.in_y), c = Math.max(c, b.in_y)));
3973
3973
  });
3974
- const c = (n + a) / 2, f = (r + l) / 2, h = this.getPerimeter(t, i, o) * e;
3974
+ const l = (n + a) / 2, f = (r + c) / 2, h = this.getPerimeter(t, i, o) * e;
3975
3975
  let d = 0;
3976
3976
  const p = [];
3977
3977
  let y = s[0], m = s[0];
@@ -3990,27 +3990,27 @@ class ci {
3990
3990
  if (w ? C = this.getBezierLength(v.x, v.y, v.out_x ?? v.x, v.out_y ?? v.y, S.in_x ?? S.x, S.in_y ?? S.y, S.x, S.y) : C = Math.sqrt((S.x - v.x) ** 2 + (S.y - v.y) ** 2), d + C >= h || b === p[p.length - 1]) {
3991
3991
  let I = 0;
3992
3992
  if (w)
3993
- return I = this.getBezierTAtLength(h - d, v.x, v.y, v.out_x ?? v.x, v.out_y ?? v.y, S.in_x ?? S.x, S.in_y ?? S.y, S.x, S.y, 20), this.getBezierPointAndAngle(I, v, S, c, f);
3993
+ return I = this.getBezierTAtLength(h - d, v.x, v.y, v.out_x ?? v.x, v.out_y ?? v.y, S.in_x ?? S.x, S.in_y ?? S.y, S.x, S.y, 20), this.getBezierPointAndAngle(I, v, S, l, f);
3994
3994
  {
3995
3995
  I = C === 0 ? 0 : (h - d) / C;
3996
- const M = v.x + (S.x - v.x) * I - c, k = v.y + (S.y - v.y) * I - f, T = Math.atan2(S.y - v.y, S.x - v.x);
3996
+ const M = v.x + (S.x - v.x) * I - l, k = v.y + (S.y - v.y) * I - f, T = Math.atan2(S.y - v.y, S.x - v.x);
3997
3997
  return { x: M, y: k, angle: T };
3998
3998
  }
3999
3999
  }
4000
4000
  d += C;
4001
4001
  }
4002
4002
  } else if (t.type === "Ellipse") {
4003
- const s = Math.abs(i) / 2, n = Math.abs(o) / 2, a = t.sweepAngle ?? 360, l = ((t.startAngle ?? 0) + a * e) * Math.PI / 180, c = s * Math.cos(l), f = n * Math.sin(l), u = -s * Math.sin(l), h = n * Math.cos(l), d = Math.atan2(h, u);
4004
- return { x: c, y: f, angle: d };
4003
+ const s = Math.abs(i) / 2, n = Math.abs(o) / 2, a = t.sweepAngle ?? 360, c = ((t.startAngle ?? 0) + a * e) * Math.PI / 180, l = s * Math.cos(c), f = n * Math.sin(c), u = -s * Math.sin(c), h = n * Math.cos(c), d = Math.atan2(h, u);
4004
+ return { x: l, y: f, angle: d };
4005
4005
  } else if ((t == null ? void 0 : t.type) === "Rectangle") {
4006
4006
  const s = Math.abs(i), n = Math.abs(o), r = (s + n) * 2 * e;
4007
- let l = 0, c = 0, f = 0;
4008
- return r < s ? (l = -s / 2 + r, c = -n / 2, f = 0) : r < s + n ? (l = s / 2, c = -n / 2 + (r - s), f = Math.PI / 2) : r < 2 * s + n ? (l = s / 2 - (r - (s + n)), c = n / 2, f = Math.PI) : (l = -s / 2, c = n / 2 - (r - (2 * s + n)), f = -Math.PI / 2), { x: l, y: c, angle: f };
4007
+ let c = 0, l = 0, f = 0;
4008
+ return r < s ? (c = -s / 2 + r, l = -n / 2, f = 0) : r < s + n ? (c = s / 2, l = -n / 2 + (r - s), f = Math.PI / 2) : r < 2 * s + n ? (c = s / 2 - (r - (s + n)), l = n / 2, f = Math.PI) : (c = -s / 2, l = n / 2 - (r - (2 * s + n)), f = -Math.PI / 2), { x: c, y: l, angle: f };
4009
4009
  }
4010
4010
  return { x: 0, y: 0, angle: 0 };
4011
4011
  }
4012
4012
  getBezierPointAndAngle(t, i, o, e, s) {
4013
- const n = i.x, a = i.y, r = i.out_x ?? i.x, l = i.out_y ?? i.y, c = o.in_x ?? o.x, f = o.in_y ?? o.y, u = o.x, h = o.y, d = 1 - t, p = t * t, y = d * d, m = y * d, b = p * t, v = m * n + 3 * y * t * r + 3 * d * p * c + b * u - e, S = m * a + 3 * y * t * l + 3 * d * p * f + b * h - s, C = 3 * y * (r - n) + 6 * d * t * (c - r) + 3 * p * (u - c), w = 3 * y * (l - a) + 6 * d * t * (f - l) + 3 * p * (h - f), I = Math.atan2(w, C);
4013
+ const n = i.x, a = i.y, r = i.out_x ?? i.x, c = i.out_y ?? i.y, l = o.in_x ?? o.x, f = o.in_y ?? o.y, u = o.x, h = o.y, d = 1 - t, p = t * t, y = d * d, m = y * d, b = p * t, v = m * n + 3 * y * t * r + 3 * d * p * l + b * u - e, S = m * a + 3 * y * t * c + 3 * d * p * f + b * h - s, C = 3 * y * (r - n) + 6 * d * t * (l - r) + 3 * p * (u - l), w = 3 * y * (c - a) + 6 * d * t * (f - c) + 3 * p * (h - f), I = Math.atan2(w, C);
4014
4014
  return { x: v, y: S, angle: I };
4015
4015
  }
4016
4016
  applyAbsoluteTransform(t, i, o) {
@@ -4037,50 +4037,50 @@ class ci {
4037
4037
  var h, d, p, y, m;
4038
4038
  const a = this.objectStates.get(i.id), r = ((h = a == null ? void 0 : a.style) == null ? void 0 : h.artEffect) || i.artEffect || ((d = i.style) == null ? void 0 : d.artEffect);
4039
4039
  if (!r || !r.enabled) return;
4040
- const l = r.type, c = r.intensity ?? 0.5, f = r.speed ?? 1, u = r.scale ?? 10;
4041
- if (l === "acid_gradient" || l === "acid_rave" || l === "shimmer" || l === "glint_overlay" || l === "halftone" || l === "noise" || l === "scanlines" || l === "chromatic_aberration" || l === "pixelate" || l === "glitch" || l === "fold_overlay" || l === "crumple_overlay") {
4042
- if (t.save(), this.applyPath(t, o, e, s, n), t.clip(), l === "shimmer") {
4040
+ const c = r.type, l = r.intensity ?? 0.5, f = r.speed ?? 1, u = r.scale ?? 10;
4041
+ if (c === "acid_gradient" || c === "acid_rave" || c === "shimmer" || c === "glint_overlay" || c === "halftone" || c === "noise" || c === "scanlines" || c === "chromatic_aberration" || c === "pixelate" || c === "glitch" || c === "fold_overlay" || c === "crumple_overlay") {
4042
+ if (t.save(), this.applyPath(t, o, e, s, n), t.clip(), c === "shimmer") {
4043
4043
  const v = this.currentTime * f % 2 / 2, S = t.createLinearGradient(-e, -s, e, s);
4044
- S.addColorStop(Math.max(0, v - 0.2), "rgba(255,255,255,0)"), S.addColorStop(v, `rgba(255,255,255,${c * 0.8})`), S.addColorStop(Math.min(1, v + 0.2), "rgba(255,255,255,0)"), t.fillStyle = S, t.globalCompositeOperation = "screen", t.fillRect(-e / 2, -s / 2, e, s), t.globalCompositeOperation = "source-over";
4045
- } else if (l === "glint_overlay") {
4044
+ S.addColorStop(Math.max(0, v - 0.2), "rgba(255,255,255,0)"), S.addColorStop(v, `rgba(255,255,255,${l * 0.8})`), S.addColorStop(Math.min(1, v + 0.2), "rgba(255,255,255,0)"), t.fillStyle = S, t.globalCompositeOperation = "screen", t.fillRect(-e / 2, -s / 2, e, s), t.globalCompositeOperation = "source-over";
4045
+ } else if (c === "glint_overlay") {
4046
4046
  let S = ((this._lastPointerPos || { x: 0 }).x - (((p = i.transform) == null ? void 0 : p.x) ?? 0) + 300) / 600;
4047
4047
  S = Math.max(-0.2, Math.min(1.2, S));
4048
4048
  const C = t.createLinearGradient(-e, -s, e, s);
4049
- C.addColorStop(Math.max(0, S - 0.15), "rgba(255,255,255,0)"), C.addColorStop(Math.max(0, Math.min(1, S)), `rgba(255,255,255,${c})`), C.addColorStop(Math.min(1, S + 0.15), "rgba(255,255,255,0)"), t.fillStyle = C, t.globalCompositeOperation = "screen", t.fillRect(-e / 2, -s / 2, e, s), t.globalCompositeOperation = "source-over";
4050
- } else if (l === "fold_overlay") {
4049
+ C.addColorStop(Math.max(0, S - 0.15), "rgba(255,255,255,0)"), C.addColorStop(Math.max(0, Math.min(1, S)), `rgba(255,255,255,${l})`), C.addColorStop(Math.min(1, S + 0.15), "rgba(255,255,255,0)"), t.fillStyle = C, t.globalCompositeOperation = "screen", t.fillRect(-e / 2, -s / 2, e, s), t.globalCompositeOperation = "source-over";
4050
+ } else if (c === "fold_overlay") {
4051
4051
  const b = this._lastPointerPos || { x: 0, y: 0 }, v = b.x - (((y = i.transform) == null ? void 0 : y.x) ?? 0), S = b.y - (((m = i.transform) == null ? void 0 : m.y) ?? 0), C = t.createLinearGradient(v > 0 ? -e / 2 : e / 2, S > 0 ? -s / 2 : s / 2, v > 0 ? e / 2 : -e / 2, S > 0 ? s / 2 : -s / 2);
4052
- C.addColorStop(0, `rgba(0,0,0,${c * 0.6})`), C.addColorStop(0.4, "rgba(0,0,0,0)"), C.addColorStop(0.5, `rgba(255,255,255,${c * 0.4})`), C.addColorStop(1, `rgba(0,0,0,${c * 0.2})`), t.fillStyle = C, t.globalCompositeOperation = "overlay", t.fillRect(-e / 2, -s / 2, e, s), t.globalCompositeOperation = "source-over", t.beginPath(), v > 0 && S > 0 ? (t.moveTo(e / 2 - 40, s / 2), t.lineTo(e / 2, s / 2 - 40), t.lineTo(e / 2 - 40, s / 2 - 40)) : v < 0 && S > 0 ? (t.moveTo(-e / 2 + 40, s / 2), t.lineTo(-e / 2, s / 2 - 40), t.lineTo(-e / 2 + 40, s / 2 - 40)) : v > 0 && S < 0 ? (t.moveTo(e / 2 - 40, -s / 2), t.lineTo(e / 2, -s / 2 + 40), t.lineTo(e / 2 - 40, -s / 2 + 40)) : (t.moveTo(-e / 2 + 40, -s / 2), t.lineTo(-e / 2, -s / 2 + 40), t.lineTo(-e / 2 + 40, -s / 2 + 40)), t.closePath(), t.fillStyle = "#ffffff", t.shadowColor = "rgba(0,0,0,0.5)", t.shadowBlur = 10, t.shadowOffsetX = v > 0 ? -2 : 2, t.shadowOffsetY = S > 0 ? -2 : 2, t.fill();
4053
- } else if (l === "crumple_overlay") {
4052
+ C.addColorStop(0, `rgba(0,0,0,${l * 0.6})`), C.addColorStop(0.4, "rgba(0,0,0,0)"), C.addColorStop(0.5, `rgba(255,255,255,${l * 0.4})`), C.addColorStop(1, `rgba(0,0,0,${l * 0.2})`), t.fillStyle = C, t.globalCompositeOperation = "overlay", t.fillRect(-e / 2, -s / 2, e, s), t.globalCompositeOperation = "source-over", t.beginPath(), v > 0 && S > 0 ? (t.moveTo(e / 2 - 40, s / 2), t.lineTo(e / 2, s / 2 - 40), t.lineTo(e / 2 - 40, s / 2 - 40)) : v < 0 && S > 0 ? (t.moveTo(-e / 2 + 40, s / 2), t.lineTo(-e / 2, s / 2 - 40), t.lineTo(-e / 2 + 40, s / 2 - 40)) : v > 0 && S < 0 ? (t.moveTo(e / 2 - 40, -s / 2), t.lineTo(e / 2, -s / 2 + 40), t.lineTo(e / 2 - 40, -s / 2 + 40)) : (t.moveTo(-e / 2 + 40, -s / 2), t.lineTo(-e / 2, -s / 2 + 40), t.lineTo(-e / 2 + 40, -s / 2 + 40)), t.closePath(), t.fillStyle = "#ffffff", t.shadowColor = "rgba(0,0,0,0.5)", t.shadowBlur = 10, t.shadowOffsetX = v > 0 ? -2 : 2, t.shadowOffsetY = S > 0 ? -2 : 2, t.fill();
4053
+ } else if (c === "crumple_overlay") {
4054
4054
  const b = Math.floor(e / u), v = document.createElement("canvas");
4055
4055
  v.width = b, v.height = Math.floor(s / u);
4056
4056
  const S = v.getContext("2d"), C = S.createImageData(v.width, v.height);
4057
4057
  for (let w = 0; w < C.data.length; w += 4) {
4058
4058
  const I = Math.random() > 0.95 ? 150 : 255;
4059
- C.data[w] = I, C.data[w + 1] = I, C.data[w + 2] = I, C.data[w + 3] = 255 * c;
4059
+ C.data[w] = I, C.data[w + 1] = I, C.data[w + 2] = I, C.data[w + 3] = 255 * l;
4060
4060
  }
4061
4061
  S.putImageData(C, 0, 0), t.globalCompositeOperation = "multiply", t.imageSmoothingEnabled = !1, t.drawImage(v, -e / 2, -s / 2, e, s);
4062
- } else if (l === "acid_gradient" || l === "acid_rave") {
4062
+ } else if (c === "acid_gradient" || c === "acid_rave") {
4063
4063
  const b = this.currentTime * f, v = r.color1, S = r.color2, C = t.createLinearGradient(-e / 2, -s / 2, e / 2, s / 2);
4064
4064
  if (v && S) {
4065
4065
  const w = b * 60 % 360;
4066
- C.addColorStop(0, this._shiftHue(v, w, c * 0.7)), C.addColorStop(1, this._shiftHue(S, (w + 180) % 360, c * 0.7));
4066
+ C.addColorStop(0, this._shiftHue(v, w, l * 0.7)), C.addColorStop(1, this._shiftHue(S, (w + 180) % 360, l * 0.7));
4067
4067
  } else {
4068
4068
  const w = b * 100 % 360, I = (w + 180) % 360;
4069
- C.addColorStop(0, `hsla(${w}, 80%, 50%, ${c * 0.5})`), C.addColorStop(1, `hsla(${I}, 80%, 50%, ${c * 0.5})`);
4069
+ C.addColorStop(0, `hsla(${w}, 80%, 50%, ${l * 0.5})`), C.addColorStop(1, `hsla(${I}, 80%, 50%, ${l * 0.5})`);
4070
4070
  }
4071
4071
  t.fillStyle = C, t.globalCompositeOperation = "screen", t.fillRect(-e / 2, -s / 2, e, s);
4072
- } else if (l === "halftone") {
4073
- const b = Math.max(2, u * (1 - c * 0.8)), v = document.createElement("canvas");
4072
+ } else if (c === "halftone") {
4073
+ const b = Math.max(2, u * (1 - l * 0.8)), v = document.createElement("canvas");
4074
4074
  v.width = b, v.height = b;
4075
4075
  const S = v.getContext("2d");
4076
4076
  if (S) {
4077
- S.fillStyle = "black", S.beginPath(), S.arc(b / 2, b / 2, b / 2 * c, 0, Math.PI * 2), S.fill();
4077
+ S.fillStyle = "black", S.beginPath(), S.arc(b / 2, b / 2, b / 2 * l, 0, Math.PI * 2), S.fill();
4078
4078
  const C = t.createPattern(v, "repeat");
4079
- C && (t.globalAlpha = 0.3 * c, t.fillStyle = C, t.fillRect(-e / 2, -s / 2, e, s));
4079
+ C && (t.globalAlpha = 0.3 * l, t.fillStyle = C, t.fillRect(-e / 2, -s / 2, e, s));
4080
4080
  }
4081
- } else if (l === "noise") {
4082
- const b = Math.floor(e * s * c * 0.02);
4083
- t.globalAlpha = 0.4 * c;
4081
+ } else if (c === "noise") {
4082
+ const b = Math.floor(e * s * l * 0.02);
4083
+ t.globalAlpha = 0.4 * l;
4084
4084
  for (let v = 0; v < b; v++) {
4085
4085
  const S = Math.random() > 0.5 ? 255 : 0;
4086
4086
  t.fillStyle = `rgba(${S}, ${S}, ${S}, ${0.5 + Math.random() * 0.5})`, t.fillRect(
@@ -4090,15 +4090,15 @@ class ci {
4090
4090
  2
4091
4091
  );
4092
4092
  }
4093
- } else if (l === "scanlines") {
4094
- t.globalAlpha = 0.2 * c, t.strokeStyle = "rgba(0,0,0,0.5)", t.lineWidth = 1;
4093
+ } else if (c === "scanlines") {
4094
+ t.globalAlpha = 0.2 * l, t.strokeStyle = "rgba(0,0,0,0.5)", t.lineWidth = 1;
4095
4095
  for (let b = -s / 2; b < s / 2; b += 4)
4096
4096
  t.beginPath(), t.moveTo(-e / 2, b), t.lineTo(e / 2, b), t.stroke();
4097
- } else if (l === "chromatic_aberration") {
4098
- const b = 5 * c;
4097
+ } else if (c === "chromatic_aberration") {
4098
+ const b = 5 * l;
4099
4099
  t.globalCompositeOperation = "screen", t.globalAlpha = 0.5, t.fillStyle = "cyan", t.fillRect(-e / 2 - b, -s / 2, e, s), t.fillStyle = "magenta", t.fillRect(-e / 2 + b, -s / 2, e, s);
4100
- } else if (l === "pixelate") {
4101
- const b = Math.max(2, Math.round(u * (1 - c * 0.5))), v = document.createElement("canvas"), S = Math.max(1, Math.ceil(e / b)), C = Math.max(1, Math.ceil(s / b));
4100
+ } else if (c === "pixelate") {
4101
+ const b = Math.max(2, Math.round(u * (1 - l * 0.5))), v = document.createElement("canvas"), S = Math.max(1, Math.ceil(e / b)), C = Math.max(1, Math.ceil(s / b));
4102
4102
  v.width = S, v.height = C;
4103
4103
  const w = v.getContext("2d");
4104
4104
  if (w) {
@@ -4106,17 +4106,17 @@ class ci {
4106
4106
  const I = t.getTransform(), M = I.e - e / 2, k = I.f - s / 2;
4107
4107
  w.drawImage(t.canvas, M, k, e, s, 0, 0, S, C), t.imageSmoothingEnabled = !1, t.drawImage(v, 0, 0, S, C, -e / 2, -s / 2, e, s), t.imageSmoothingEnabled = !0;
4108
4108
  }
4109
- } else if (l === "glitch") {
4110
- const b = this.currentTime * f, v = r.chaosAmount ?? 0.2, S = Math.max(3, Math.floor(8 * c)), C = c * e * 0.15;
4111
- t.globalCompositeOperation = "screen", t.globalAlpha = c * 0.4;
4109
+ } else if (c === "glitch") {
4110
+ const b = this.currentTime * f, v = r.chaosAmount ?? 0.2, S = Math.max(3, Math.floor(8 * l)), C = l * e * 0.15;
4111
+ t.globalCompositeOperation = "screen", t.globalAlpha = l * 0.4;
4112
4112
  const w = C * 0.3;
4113
4113
  t.fillStyle = "rgba(255, 0, 0, 0.4)", t.fillRect(-e / 2 + w, -s / 2, e, s), t.fillStyle = "rgba(0, 255, 255, 0.4)", t.fillRect(-e / 2 - w, -s / 2, e, s), t.globalCompositeOperation = "source-over", t.globalAlpha = 1;
4114
4114
  const I = s / S;
4115
4115
  for (let M = 0; M < S; M++) {
4116
4116
  const k = Math.sin(M * 127.1 + b * 311.7 * f) * 43758.5, T = k - Math.floor(k);
4117
4117
  if (T > 1 - v) {
4118
- const R = (T - (1 - v)) / v * C * (Math.random() > 0.5 ? 1 : -1), P = -s / 2 + M * I, E = t.getTransform(), x = E.e - e / 2 + R, O = E.f + P;
4119
- t.save(), t.beginPath(), t.rect(-e / 2, P, e, I), t.clip(), t.globalAlpha = 0.8, t.drawImage(t.canvas, x, O, e, I, -e / 2 + R, P, e, I), t.restore();
4118
+ const x = (T - (1 - v)) / v * C * (Math.random() > 0.5 ? 1 : -1), P = -s / 2 + M * I, E = t.getTransform(), R = E.e - e / 2 + x, O = E.f + P;
4119
+ t.save(), t.beginPath(), t.rect(-e / 2, P, e, I), t.clip(), t.globalAlpha = 0.8, t.drawImage(t.canvas, R, O, e, I, -e / 2 + x, P, e, I), t.restore();
4120
4120
  }
4121
4121
  }
4122
4122
  }
@@ -4131,22 +4131,22 @@ class ci {
4131
4131
  e = parseInt(h.substring(0, 2), 16) / 255, s = parseInt(h.substring(2, 4), 16) / 255, n = parseInt(h.substring(4, 6), 16) / 255;
4132
4132
  }
4133
4133
  const a = Math.max(e, s, n), r = Math.min(e, s, n);
4134
- let l = 0, c = 0, f = (a + r) / 2;
4134
+ let c = 0, l = 0, f = (a + r) / 2;
4135
4135
  if (a !== r) {
4136
4136
  const h = a - r;
4137
- switch (c = f > 0.5 ? h / (2 - a - r) : h / (a + r), a) {
4137
+ switch (l = f > 0.5 ? h / (2 - a - r) : h / (a + r), a) {
4138
4138
  case e:
4139
- l = ((s - n) / h + (s < n ? 6 : 0)) / 6;
4139
+ c = ((s - n) / h + (s < n ? 6 : 0)) / 6;
4140
4140
  break;
4141
4141
  case s:
4142
- l = ((n - e) / h + 2) / 6;
4142
+ c = ((n - e) / h + 2) / 6;
4143
4143
  break;
4144
4144
  case n:
4145
- l = ((e - s) / h + 4) / 6;
4145
+ c = ((e - s) / h + 4) / 6;
4146
4146
  break;
4147
4147
  }
4148
4148
  }
4149
- return `hsla(${(((l * 360 + i) % 360 + 360) % 360).toFixed(0)}, ${(c * 100).toFixed(0)}%, ${(f * 100).toFixed(0)}%, ${o})`;
4149
+ return `hsla(${(((c * 360 + i) % 360 + 360) % 360).toFixed(0)}, ${(l * 100).toFixed(0)}%, ${(f * 100).toFixed(0)}%, ${o})`;
4150
4150
  }
4151
4151
  /**
4152
4152
  * Simulate CSS `backdrop-filter: blur()` + glass overlay on Canvas2D.
@@ -4157,7 +4157,7 @@ class ci {
4157
4157
  * 4. Apply the overlay color tint, sheen highlight, noise grain, and glass border
4158
4158
  */
4159
4159
  applyBackgroundBlurGlass(t, i, o, e, s, n) {
4160
- const a = n.radius ?? 10, r = n.color ?? "rgba(255,255,255,0.2)", l = n.opacity ?? 0.5, c = n.noise ?? 0;
4160
+ const a = n.radius ?? 10, r = n.color ?? "rgba(255,255,255,0.2)", c = n.opacity ?? 0.5, l = n.noise ?? 0;
4161
4161
  t.save(), this.applyPath(t, i, o, e, s), t.clip();
4162
4162
  const f = t.getTransform(), u = f.e - o / 2, h = f.f - e / 2;
4163
4163
  try {
@@ -4173,10 +4173,10 @@ class ci {
4173
4173
  }
4174
4174
  } catch {
4175
4175
  }
4176
- t.globalCompositeOperation = "source-over", t.globalAlpha = l, t.fillStyle = r, t.fillRect(-o / 2, -e / 2, o, e), t.globalAlpha = 1, t.globalCompositeOperation = "source-atop";
4176
+ t.globalCompositeOperation = "source-over", t.globalAlpha = c, t.fillStyle = r, t.fillRect(-o / 2, -e / 2, o, e), t.globalAlpha = 1, t.globalCompositeOperation = "source-atop";
4177
4177
  const d = t.createLinearGradient(-o / 2, -e / 2, o / 2, e / 2);
4178
- if (d.addColorStop(0, "rgba(255,255,255,0.12)"), d.addColorStop(0.3, "rgba(255,255,255,0.04)"), d.addColorStop(0.5, "rgba(255,255,255,0.0)"), d.addColorStop(1, "rgba(255,255,255,0.0)"), t.fillStyle = d, t.fillRect(-o / 2, -e / 2, o, e), c > 0) {
4179
- if (t.globalAlpha = c / 100, !this._noiseTileCanvas) {
4178
+ if (d.addColorStop(0, "rgba(255,255,255,0.12)"), d.addColorStop(0.3, "rgba(255,255,255,0.04)"), d.addColorStop(0.5, "rgba(255,255,255,0.0)"), d.addColorStop(1, "rgba(255,255,255,0.0)"), t.fillStyle = d, t.fillRect(-o / 2, -e / 2, o, e), l > 0) {
4179
+ if (t.globalAlpha = l / 100, !this._noiseTileCanvas) {
4180
4180
  const y = document.createElement("canvas");
4181
4181
  y.width = 64, y.height = 64;
4182
4182
  const m = y.getContext("2d"), b = m.createImageData(64, 64), v = b.data;
@@ -4202,76 +4202,76 @@ class ci {
4202
4202
  } else if (i.type === "Line")
4203
4203
  t.moveTo(-o / 2, 0), t.lineTo(o / 2, 0);
4204
4204
  else if (i.type === "Ellipse") {
4205
- const { startAngle: n = 0, sweepAngle: a = 360, ratio: r = 0 } = i, l = o / 2, c = e / 2, f = n * Math.PI / 180, u = a * Math.PI / 180, h = f + u;
4206
- a >= 360 && r <= 0 ? t.ellipse(0, 0, l, c, 0, 0, Math.PI * 2) : (t.ellipse(0, 0, l, c, 0, f, h, !1), r > 0 ? t.ellipse(0, 0, l * r, c * r, 0, h, f, !0) : t.lineTo(0, 0), t.closePath());
4205
+ const { startAngle: n = 0, sweepAngle: a = 360, ratio: r = 0 } = i, c = o / 2, l = e / 2, f = n * Math.PI / 180, u = a * Math.PI / 180, h = f + u;
4206
+ a >= 360 && r <= 0 ? t.ellipse(0, 0, c, l, 0, 0, Math.PI * 2) : (t.ellipse(0, 0, c, l, 0, f, h, !1), r > 0 ? t.ellipse(0, 0, c * r, l * r, 0, h, f, !0) : t.lineTo(0, 0), t.closePath());
4207
4207
  } else if (i.type === "Triangle")
4208
4208
  t.moveTo(0, -e / 2), t.lineTo(o / 2, e / 2), t.lineTo(-o / 2, e / 2), t.closePath();
4209
4209
  else if (i.type === "Polygon") {
4210
4210
  const n = i.sides || 3, a = i.radius || Math.min(o, e) / 2;
4211
4211
  for (let r = 0; r < n; r++) {
4212
- const l = r * 2 * Math.PI / n - Math.PI / 2, c = a * Math.cos(l), f = a * Math.sin(l);
4213
- r === 0 ? t.moveTo(c, f) : t.lineTo(c, f);
4212
+ const c = r * 2 * Math.PI / n - Math.PI / 2, l = a * Math.cos(c), f = a * Math.sin(c);
4213
+ r === 0 ? t.moveTo(l, f) : t.lineTo(l, f);
4214
4214
  }
4215
4215
  t.closePath();
4216
4216
  } else if (i.type === "Star") {
4217
4217
  const n = i.points || 5, a = i.outer_radius || Math.min(o, e) / 2;
4218
4218
  let r = i.inner_radius;
4219
4219
  r == null ? r = a * 0.382 : r <= 1 && (r = a * r);
4220
- for (let l = 0; l < n * 2; l++) {
4221
- const c = l * Math.PI / n - Math.PI / 2, f = l % 2 === 0 ? a : r, u = f * Math.cos(c), h = f * Math.sin(c);
4222
- l === 0 ? t.moveTo(u, h) : t.lineTo(u, h);
4220
+ for (let c = 0; c < n * 2; c++) {
4221
+ const l = c * Math.PI / n - Math.PI / 2, f = c % 2 === 0 ? a : r, u = f * Math.cos(l), h = f * Math.sin(l);
4222
+ c === 0 ? t.moveTo(u, h) : t.lineTo(u, h);
4223
4223
  }
4224
4224
  t.closePath();
4225
4225
  } else if (((i == null ? void 0 : i.type) === "Path" || i.type === "Subtract" || i.type === "Union" || i.type === "Intersect" || i.type === "Exclude" || i.type === "BooleanOperation") && i.points) {
4226
4226
  this.frameCount % 300 === 0 && this.log("[Engine] Tracing Path:", i.points.length, "points");
4227
- let n = 1 / 0, a = -1 / 0, r = 1 / 0, l = -1 / 0;
4227
+ let n = 1 / 0, a = -1 / 0, r = 1 / 0, c = -1 / 0;
4228
4228
  if (i.points.forEach((u) => {
4229
- typeof u.x == "number" && typeof u.y == "number" && (n = Math.min(n, u.x), a = Math.max(a, u.x), r = Math.min(r, u.y), l = Math.max(l, u.y), u.out_x !== void 0 && (n = Math.min(n, u.out_x), a = Math.max(a, u.out_x)), u.out_y !== void 0 && (r = Math.min(r, u.out_y), l = Math.max(l, u.out_y)), u.in_x !== void 0 && (n = Math.min(n, u.in_x), a = Math.max(a, u.in_x)), u.in_y !== void 0 && (r = Math.min(r, u.in_y), l = Math.max(l, u.in_y)));
4229
+ typeof u.x == "number" && typeof u.y == "number" && (n = Math.min(n, u.x), a = Math.max(a, u.x), r = Math.min(r, u.y), c = Math.max(c, u.y), u.out_x !== void 0 && (n = Math.min(n, u.out_x), a = Math.max(a, u.out_x)), u.out_y !== void 0 && (r = Math.min(r, u.out_y), c = Math.max(c, u.out_y)), u.in_x !== void 0 && (n = Math.min(n, u.in_x), a = Math.max(a, u.in_x)), u.in_y !== void 0 && (r = Math.min(r, u.in_y), c = Math.max(c, u.in_y)));
4230
4230
  }), n === 1 / 0) return;
4231
- const c = (n + a) / 2, f = (r + l) / 2;
4232
- if (isNaN(c) || isNaN(f)) {
4233
- this.warn("[Engine] Invalid path center:", c, f);
4231
+ const l = (n + a) / 2, f = (r + c) / 2;
4232
+ if (isNaN(l) || isNaN(f)) {
4233
+ this.warn("[Engine] Invalid path center:", l, f);
4234
4234
  return;
4235
4235
  }
4236
4236
  i.points.forEach((u, h) => {
4237
4237
  if (h === 0 || u.moveTo)
4238
- t.moveTo(u.x - c, u.y - f);
4238
+ t.moveTo(u.x - l, u.y - f);
4239
4239
  else {
4240
4240
  const d = i.points[h - 1];
4241
4241
  if (!d) return;
4242
- const p = (d.out_x ?? d.x) - c, y = (d.out_y ?? d.y) - f, m = (u.in_x ?? u.x) - c, b = (u.in_y ?? u.y) - f;
4243
- isNaN(p) || isNaN(m) || isNaN(u.x) ? t.lineTo(u.x - c, u.y - f) : t.bezierCurveTo(p, y, m, b, u.x - c, u.y - f);
4242
+ const p = (d.out_x ?? d.x) - l, y = (d.out_y ?? d.y) - f, m = (u.in_x ?? u.x) - l, b = (u.in_y ?? u.y) - f;
4243
+ isNaN(p) || isNaN(m) || isNaN(u.x) ? t.lineTo(u.x - l, u.y - f) : t.bezierCurveTo(p, y, m, b, u.x - l, u.y - f);
4244
4244
  }
4245
4245
  if (u.closePath || h === i.points.length - 1 && (i.is_closed || i.isClosed)) {
4246
4246
  const d = [...i.points.slice(0, h + 1)].reverse().find((p) => p.moveTo) || i.points[0];
4247
4247
  d && (u.out_x !== void 0 || d.in_x !== void 0) && t.bezierCurveTo(
4248
- (u.out_x ?? u.x) - c,
4248
+ (u.out_x ?? u.x) - l,
4249
4249
  (u.out_y ?? u.y) - f,
4250
- (d.in_x ?? d.x) - c,
4250
+ (d.in_x ?? d.x) - l,
4251
4251
  (d.in_y ?? d.y) - f,
4252
- d.x - c,
4252
+ d.x - l,
4253
4253
  d.y - f
4254
4254
  ), t.closePath();
4255
4255
  }
4256
4256
  });
4257
4257
  } else if (i.points && Array.isArray(i.points)) {
4258
- let n = 1 / 0, a = -1 / 0, r = 1 / 0, l = -1 / 0;
4258
+ let n = 1 / 0, a = -1 / 0, r = 1 / 0, c = -1 / 0;
4259
4259
  i.points.forEach((u) => {
4260
- n = Math.min(n, u.x), a = Math.max(a, u.x), r = Math.min(r, u.y), l = Math.max(l, u.y);
4260
+ n = Math.min(n, u.x), a = Math.max(a, u.x), r = Math.min(r, u.y), c = Math.max(c, u.y);
4261
4261
  });
4262
- const c = (n + a) / 2, f = (r + l) / 2;
4262
+ const l = (n + a) / 2, f = (r + c) / 2;
4263
4263
  i.points.forEach((u, h) => {
4264
- if (h === 0) t.moveTo(u.x - c, u.y - f);
4264
+ if (h === 0) t.moveTo(u.x - l, u.y - f);
4265
4265
  else {
4266
4266
  const d = i.points[h - 1];
4267
4267
  d.out_x !== void 0 || u.in_x !== void 0 ? t.bezierCurveTo(
4268
- (d.out_x ?? d.x) - c,
4268
+ (d.out_x ?? d.x) - l,
4269
4269
  (d.out_y ?? d.y) - f,
4270
- (u.in_x ?? u.x) - c,
4270
+ (u.in_x ?? u.x) - l,
4271
4271
  (u.in_y ?? u.y) - f,
4272
- u.x - c,
4272
+ u.x - l,
4273
4273
  u.y - f
4274
- ) : t.lineTo(u.x - c, u.y - f);
4274
+ ) : t.lineTo(u.x - l, u.y - f);
4275
4275
  }
4276
4276
  (u.closePath || h === i.points.length - 1 && (i.is_closed || i.isClosed)) && t.closePath();
4277
4277
  });
@@ -4280,14 +4280,14 @@ class ci {
4280
4280
  }
4281
4281
  renderInputBox(t, i) {
4282
4282
  var it, lt;
4283
- const o = this.objectStates.get(i.id), e = (o == null ? void 0 : o.options) || i.options || {}, s = ((it = i.geometry) == null ? void 0 : it.width) || 250, n = ((lt = i.geometry) == null ? void 0 : lt.height) || 45, a = this.focusedId === i.id, r = this.lastHoveredObjectId === i.id, l = e.previewState || "default", c = l !== "default" ? l : a ? "focused" : r ? "hovered" : "default", f = e.label || { visible: !0, text: "Label" }, u = e.helperText || { visible: !1, text: "Helper text" }, h = e.leftIcon || { visible: !1 }, d = e.rightIcon || { visible: !1 }, p = e.multiline === !0, y = e.corner_radius ?? 8, m = e.corners || { tl: y, tr: y, bl: y, br: y }, b = [m.tl, m.tr, m.br, m.bl];
4283
+ const o = this.objectStates.get(i.id), e = (o == null ? void 0 : o.options) || i.options || {}, s = ((it = i.geometry) == null ? void 0 : it.width) || 250, n = ((lt = i.geometry) == null ? void 0 : lt.height) || 45, a = this.focusedId === i.id, r = this.lastHoveredObjectId === i.id, c = e.previewState || "default", l = c !== "default" ? c : a ? "focused" : r ? "hovered" : "default", f = e.label || { visible: !0, text: "Label" }, u = e.helperText || { visible: !1, text: "Helper text" }, h = e.leftIcon || { visible: !1 }, d = e.rightIcon || { visible: !1 }, p = e.multiline === !0, y = e.corner_radius ?? 8, m = e.corners || { tl: y, tr: y, bl: y, br: y }, b = [m.tl, m.tr, m.br, m.bl];
4284
4284
  let v = e.backgroundColor || "rgba(31, 41, 55, 1)", S = e.borderColor || "rgba(55, 65, 81, 1)", C = e.borderWidth ?? 1.5, w = e.color || "#ffffff", I = e.placeholderColor || "rgba(156, 163, 175, 1)", M = e.fontSize || 14;
4285
- const k = `${c}Style`, T = e[k];
4286
- T ? (T.backgroundColor !== void 0 && (v = T.backgroundColor), T.borderColor !== void 0 && (S = T.borderColor), T.borderWidth !== void 0 && (C = T.borderWidth), T.color !== void 0 && (w = T.color), T.placeholderColor !== void 0 && (I = T.placeholderColor), T.fontSize !== void 0 && (M = T.fontSize)) : c === "focused" ? (S = e.focusBorderColor || "rgba(59, 130, 246, 1)", C = Math.max(C, 2)) : c === "hovered" || c === "hover" ? (S = e.hoverBorderColor || S, v = e.hoverBackgroundColor || v) : c === "disabled" ? (v = e.disabledBackgroundColor || "rgba(31, 41, 55, 0.6)", S = e.disabledBorderColor || "rgba(55, 65, 81, 0.4)") : c === "error" && (S = "rgba(239, 68, 68, 1)", C = Math.max(C, 2)), t.beginPath(), this.drawRoundRect(t, -s / 2, -n / 2, s, n, b);
4287
- const R = this.createCanvasFill(t, v, s, n);
4288
- if (R && (t.fillStyle = R, t.fill()), C > 0) {
4285
+ const k = `${l}Style`, T = e[k];
4286
+ T ? (T.backgroundColor !== void 0 && (v = T.backgroundColor), T.borderColor !== void 0 && (S = T.borderColor), T.borderWidth !== void 0 && (C = T.borderWidth), T.color !== void 0 && (w = T.color), T.placeholderColor !== void 0 && (I = T.placeholderColor), T.fontSize !== void 0 && (M = T.fontSize)) : l === "focused" ? (S = e.focusBorderColor || "rgba(59, 130, 246, 1)", C = Math.max(C, 2)) : l === "hovered" || l === "hover" ? (S = e.hoverBorderColor || S, v = e.hoverBackgroundColor || v) : l === "disabled" ? (v = e.disabledBackgroundColor || "rgba(31, 41, 55, 0.6)", S = e.disabledBorderColor || "rgba(55, 65, 81, 0.4)") : l === "error" && (S = "rgba(239, 68, 68, 1)", C = Math.max(C, 2)), t.beginPath(), this.drawRoundRect(t, -s / 2, -n / 2, s, n, b);
4287
+ const x = this.createCanvasFill(t, v, s, n);
4288
+ if (x && (t.fillStyle = x, t.fill()), C > 0) {
4289
4289
  const nt = this.createCanvasFill(t, S, s, n);
4290
- if (nt && (t.strokeStyle = nt, t.lineWidth = C, t.stroke()), c === "focused" || c === "focus") {
4290
+ if (nt && (t.strokeStyle = nt, t.lineWidth = C, t.stroke()), l === "focused" || l === "focus") {
4291
4291
  t.save(), t.beginPath();
4292
4292
  const bt = b.map((ht) => ht + 2);
4293
4293
  this.drawRoundRect(t, -s / 2 - 2, -n / 2 - 2, s + 4, n + 4, bt), t.strokeStyle = "rgba(59, 130, 246, 0.3)", t.lineWidth = 2, t.stroke(), t.restore();
@@ -4303,7 +4303,7 @@ class ci {
4303
4303
  t.restore();
4304
4304
  };
4305
4305
  P(h, !0), P(d, !1);
4306
- const E = e.text || "", x = e.placeholder || "Enter text...", O = !E, W = E || x, B = O ? I : w, $ = M, Y = e.fontFamily || "Inter", H = e.fontWeight || 400;
4306
+ const E = e.text || "", R = e.placeholder || "Enter text...", O = !E, W = E || R, B = O ? I : w, $ = M, Y = e.fontFamily || "Inter", H = e.fontWeight || 400;
4307
4307
  t.font = `${H} ${$}px "${Y}", sans-serif`, t.fillStyle = B, t.textAlign = "left", t.textBaseline = p ? "top" : "middle";
4308
4308
  const K = e.inputPadding ?? 16, A = h.visible ? (h.offset ?? 16) + (h.size || 14) / 2 + 8 : K, _ = d.visible ? (d.offset ?? 16) + (d.size || 14) / 2 + 8 : K, L = -(s / 2) + A, X = s - A - _, V = e.inputType === "password" ? "•".repeat(W.length) : W;
4309
4309
  if (t.save(), t.beginPath(), t.rect(L - 2, -n / 2 + 4, X + 4, n - 8), t.clip(), p) {
@@ -4336,14 +4336,14 @@ class ci {
4336
4336
  t.fillText(nt, Mt, It);
4337
4337
  }
4338
4338
  if (u.visible === !0) {
4339
- const nt = u.text || "Helper text", bt = u.fontSize || 11, ht = c === "error" ? "rgba(239, 68, 68, 1)" : u.color || "rgba(156, 163, 175, 1)", wt = u.offset ?? 6;
4339
+ const nt = u.text || "Helper text", bt = u.fontSize || 11, ht = l === "error" ? "rgba(239, 68, 68, 1)" : u.color || "rgba(156, 163, 175, 1)", wt = u.offset ?? 6;
4340
4340
  t.font = `400 ${bt}px "${Y}", sans-serif`, t.fillStyle = ht, t.textAlign = "left", t.textBaseline = "top";
4341
4341
  const Mt = -(s / 2), It = n / 2 + wt;
4342
4342
  t.fillText(nt, Mt, It);
4343
4343
  }
4344
4344
  }
4345
4345
  renderSlider(t, i) {
4346
- const o = this.objectStates.get(i.id), e = (o == null ? void 0 : o.geometry) || i.geometry, s = (o == null ? void 0 : o.options) || i.options || {}, n = e.width || 200, a = s.value ?? 50, r = s.min ?? 0, c = (s.max ?? 100) - r, f = c === 0 ? 0 : (a - r) / c, u = s.trackHeight || 4, h = s.trackRoundedness ?? 2, d = s.trackShape ?? "Rectangle", p = s.trackPath || "", y = s.accentColor || "#3b82f6", m = s.inactiveColor || "#374151", b = s.thumbShape || "Ellipse", v = s.thumbWidth ?? 16, S = s.thumbHeight ?? 16, C = s.thumbRoundedness ?? 0, w = s.thumbColor || "#ffffff", I = s.thumbPath || "", M = s.thumbIcon || "", k = s.showValueTooltip ?? !1, T = s.tooltipBgColor || "#333333", R = s.tooltipColor || "#ffffff", P = s.tooltipOffsetX ?? 0, E = s.tooltipOffsetY ?? -25, x = (X, V, it, lt, nt, bt, ht) => {
4346
+ const o = this.objectStates.get(i.id), e = (o == null ? void 0 : o.geometry) || i.geometry, s = (o == null ? void 0 : o.options) || i.options || {}, n = e.width || 200, a = s.value ?? 50, r = s.min ?? 0, l = (s.max ?? 100) - r, f = l === 0 ? 0 : (a - r) / l, u = s.trackHeight || 4, h = s.trackRoundedness ?? 2, d = s.trackShape ?? "Rectangle", p = s.trackPath || "", y = s.accentColor || "#3b82f6", m = s.inactiveColor || "#374151", b = s.thumbShape || "Ellipse", v = s.thumbWidth ?? 16, S = s.thumbHeight ?? 16, C = s.thumbRoundedness ?? 0, w = s.thumbColor || "#ffffff", I = s.thumbPath || "", M = s.thumbIcon || "", k = s.showValueTooltip ?? !1, T = s.tooltipBgColor || "#333333", x = s.tooltipColor || "#ffffff", P = s.tooltipOffsetX ?? 0, E = s.tooltipOffsetY ?? -25, R = (X, V, it, lt, nt, bt, ht) => {
4347
4347
  if ((X === "Custom" || X === "Icon") && ht)
4348
4348
  try {
4349
4349
  const wt = new Path2D(ht);
@@ -4381,7 +4381,7 @@ class ci {
4381
4381
  } else X === "Line" && (t.moveTo(V - lt / 2, it), t.lineTo(V + lt / 2, it));
4382
4382
  t.fill();
4383
4383
  }, O = this.createCanvasFill(t, m, n, u);
4384
- O && (t.fillStyle = O, t.strokeStyle = O), d === "Line" ? (t.lineWidth = u, t.beginPath(), t.moveTo(-n / 2, 0), t.lineTo(n / 2, 0), t.stroke()) : x(d, 0, 0, n, u, h, p);
4384
+ O && (t.fillStyle = O, t.strokeStyle = O), d === "Line" ? (t.lineWidth = u, t.beginPath(), t.moveTo(-n / 2, 0), t.lineTo(n / 2, 0), t.stroke()) : R(d, 0, 0, n, u, h, p);
4385
4385
  const W = n - v, B = -n / 2 + v / 2 + f * W, $ = B - -n / 2;
4386
4386
  if ($ > 0) {
4387
4387
  const X = this.createCanvasFill(t, y, n, u);
@@ -4391,12 +4391,12 @@ class ci {
4391
4391
  const Y = t.getTransform(), H = Math.sqrt(Y.a * Y.a + Y.b * Y.b) || 1;
4392
4392
  t.shadowColor = "rgba(0,0,0,0.2)", t.shadowBlur = 4 * H, t.shadowOffsetY = 1 * H;
4393
4393
  const K = this.createCanvasFill(t, w, v, S);
4394
- if (K && (t.fillStyle = K), x(b, 0, 0, v, S, C, b === "Icon" ? M : I), t.restore(), k) {
4394
+ if (K && (t.fillStyle = K), R(b, 0, 0, v, S, C, b === "Icon" ? M : I), t.restore(), k) {
4395
4395
  t.save(), t.translate(B + P, E);
4396
4396
  const X = Math.round(a).toString();
4397
4397
  t.font = "10px Inter, sans-serif";
4398
4398
  const V = t.measureText(X), it = 6, lt = 4, nt = V.width + it * 2, bt = 14 + lt;
4399
- t.beginPath(), this.drawRoundRect(t, -nt / 2, -bt / 2, nt, bt, 4), t.fillStyle = T, t.fill(), t.fillStyle = R, t.textAlign = "center", t.textBaseline = "middle", t.fillText(X, 0, 0), t.restore();
4399
+ t.beginPath(), this.drawRoundRect(t, -nt / 2, -bt / 2, nt, bt, 4), t.fillStyle = T, t.fill(), t.fillStyle = x, t.textAlign = "center", t.textBaseline = "middle", t.fillText(X, 0, 0), t.restore();
4400
4400
  }
4401
4401
  const A = s.label || {}, _ = s.helperText || {}, L = s.fontFamily || "Inter";
4402
4402
  if (A.visible !== !1) {
@@ -4416,17 +4416,17 @@ class ci {
4416
4416
  var E;
4417
4417
  const o = this.objectStates.get(i.id);
4418
4418
  if (!o) return;
4419
- const e = o.options || i.options || {}, s = i.geometry.width || 160, n = i.geometry.height || 40, a = -s / 2, r = -n / 2, l = e.corner_radius ?? 6, c = e.disabled || e.previewState === "disabled", f = this.lastHoveredObjectId === i.id || e.previewState === "hover", u = (e.isOpen || e.previewState === "active") && !c;
4419
+ const e = o.options || i.options || {}, s = i.geometry.width || 160, n = i.geometry.height || 40, a = -s / 2, r = -n / 2, c = e.corner_radius ?? 6, l = e.disabled || e.previewState === "disabled", f = this.lastHoveredObjectId === i.id || e.previewState === "hover", u = (e.isOpen || e.previewState === "active") && !l;
4420
4420
  let h = e.backgroundColor, d = e.borderColor, p = e.color || "#333333";
4421
- c ? (h = e.disabledBackgroundColor || "#f3f4f6", d = e.disabledBorderColor || "#e5e7eb", p = e.disabledColor || "#9ca3af") : u ? (h = e.activeBackgroundColor || h, d = e.activeBorderColor || d, p = e.activeColor || p) : f && (h = e.hoverBackgroundColor || h, d = e.hoverBorderColor || d, p = e.hoverColor || p), h || (h = "#ffffff"), d || (d = "#e5e7eb");
4421
+ l ? (h = e.disabledBackgroundColor || "#f3f4f6", d = e.disabledBorderColor || "#e5e7eb", p = e.disabledColor || "#9ca3af") : u ? (h = e.activeBackgroundColor || h, d = e.activeBorderColor || d, p = e.activeColor || p) : f && (h = e.hoverBackgroundColor || h, d = e.hoverBorderColor || d, p = e.hoverColor || p), h || (h = "#ffffff"), d || (d = "#e5e7eb");
4422
4422
  const y = t.globalAlpha;
4423
- t.globalAlpha = y * (e.opacity ?? 1), this.drawRoundRect(t, a, r, s, n, l), t.fillStyle = this.createCanvasFill(t, typeof h == "string" ? { type: "Solid", color: h } : h, s, n) || "#ffffff", t.fill();
4423
+ t.globalAlpha = y * (e.opacity ?? 1), this.drawRoundRect(t, a, r, s, n, c), t.fillStyle = this.createCanvasFill(t, typeof h == "string" ? { type: "Solid", color: h } : h, s, n) || "#ffffff", t.fill();
4424
4424
  const m = e.borderWidth ?? 1;
4425
4425
  m > 0 && (t.strokeStyle = this.createCanvasFill(t, typeof d == "string" ? { type: "Solid", color: d } : d, s, n) || "#e5e7eb", t.lineWidth = m, t.stroke());
4426
4426
  const b = 12, v = e.chevronType || "chevron", S = e.chevronSize || 16, C = (u ? e.openIconColor : e.closedIconColor) || e.chevronColor || "#6b7280";
4427
4427
  if (v !== "none") {
4428
- const x = a + s - b - S / 2;
4429
- t.save(), t.translate(x, 0);
4428
+ const R = a + s - b - S / 2;
4429
+ t.save(), t.translate(R, 0);
4430
4430
  const O = u ? e.openIconAngle ?? 180 : e.closedIconAngle ?? 0;
4431
4431
  if (t.rotate(O * Math.PI / 180), t.strokeStyle = C, t.fillStyle = C, t.lineWidth = 1.5, t.lineCap = "round", t.lineJoin = "round", v === "chevron")
4432
4432
  t.beginPath(), t.moveTo(-S / 2, -S * 0.2), t.lineTo(0, S * 0.2), t.lineTo(S / 2, -S * 0.2), t.stroke();
@@ -4443,23 +4443,23 @@ class ci {
4443
4443
  }
4444
4444
  const w = e.selectedOption || e.placeholder || "Select...", I = e.fontSize || 14, M = e.fontWeight || 400, k = e.fontFamily || "Inter, sans-serif";
4445
4445
  t.font = `${M} ${I}px ${k}`;
4446
- const T = c ? e.disabledColor || "#9ca3af" : !e.selectedOption && e.placeholder ? "#9ca3af" : p;
4446
+ const T = l ? e.disabledColor || "#9ca3af" : !e.selectedOption && e.placeholder ? "#9ca3af" : p;
4447
4447
  t.fillStyle = this.createCanvasFill(t, typeof T == "string" ? { type: "Solid", color: T } : T, s, n) || "#333333", t.textAlign = "left", t.textBaseline = "middle";
4448
- const R = v === "none" ? 0 : S + 8, P = s - b * 2 - R;
4449
- if (t.save(), t.beginPath(), t.rect(a + b, r, P, n), t.clip(), t.fillText(w, a + b, 0), t.restore(), u && !c) {
4450
- const x = r + n + 4, O = e.optionsList || [], W = e.itemHeight || 32, B = e.listPadding ?? 4, $ = O.length * W + B * 2, Y = e.listCornerRadius ?? l;
4448
+ const x = v === "none" ? 0 : S + 8, P = s - b * 2 - x;
4449
+ if (t.save(), t.beginPath(), t.rect(a + b, r, P, n), t.clip(), t.fillText(w, a + b, 0), t.restore(), u && !l) {
4450
+ const R = r + n + 4, O = e.optionsList || [], W = e.itemHeight || 32, B = e.listPadding ?? 4, $ = O.length * W + B * 2, Y = e.listCornerRadius ?? c;
4451
4451
  t.save();
4452
4452
  const H = e.listShadow || {}, K = t.getTransform(), A = Math.sqrt(K.a * K.a + K.b * K.b) || 1;
4453
- t.shadowColor = typeof H.color == "string" ? H.color : ((E = H.color) == null ? void 0 : E.color) || "rgba(0,0,0,0.15)", t.shadowBlur = (H.blur ?? 12) * A, t.shadowOffsetY = (H.offsetY ?? 6) * A, t.shadowOffsetX = (H.offsetX ?? 0) * A, t.beginPath(), this.drawRoundRect(t, a, x, s, $, Y), t.fillStyle = this.createCanvasFill(t, typeof e.listBackgroundColor == "string" ? { type: "Solid", color: e.listBackgroundColor } : e.listBackgroundColor || { type: "Solid", color: "#ffffff" }, s, $) || "#ffffff", t.fill();
4453
+ t.shadowColor = typeof H.color == "string" ? H.color : ((E = H.color) == null ? void 0 : E.color) || "rgba(0,0,0,0.15)", t.shadowBlur = (H.blur ?? 12) * A, t.shadowOffsetY = (H.offsetY ?? 6) * A, t.shadowOffsetX = (H.offsetX ?? 0) * A, t.beginPath(), this.drawRoundRect(t, a, R, s, $, Y), t.fillStyle = this.createCanvasFill(t, typeof e.listBackgroundColor == "string" ? { type: "Solid", color: e.listBackgroundColor } : e.listBackgroundColor || { type: "Solid", color: "#ffffff" }, s, $) || "#ffffff", t.fill();
4454
4454
  const _ = e.listBorderWidth ?? 1;
4455
4455
  _ > 0 && (t.shadowColor = "transparent", t.strokeStyle = this.createCanvasFill(t, typeof e.listBorderColor == "string" ? { type: "Solid", color: e.listBorderColor } : e.listBorderColor || { type: "Solid", color: d }, s, $) || "#e5e7eb", t.lineWidth = _, t.stroke()), t.restore();
4456
4456
  const L = e.itemFontSize || I, X = e.itemFontFamily || k;
4457
4457
  t.font = `${M} ${L}px ${X}`, O.forEach((V, it) => {
4458
- const lt = x + B + it * W;
4458
+ const lt = R + B + it * W;
4459
4459
  if (V === e.selectedOption)
4460
4460
  t.fillStyle = this.createCanvasFill(t, typeof e.itemSelectedBackgroundColor == "string" ? { type: "Solid", color: e.itemSelectedBackgroundColor } : e.itemSelectedBackgroundColor || { type: "Solid", color: "#f3f4f6" }, s, W) || "#f3f4f6", t.fillRect(a + _, lt, s - _ * 2, W), t.fillStyle = e.itemSelectedColor || e.accentColor || p || "#374151";
4461
4461
  else if (t.fillStyle = e.listTextColor || p || "#333333", this.activeDropdownId === i.id && this._lastPointerPos) {
4462
- const bt = this._lastPointerPos.y - (x + B), ht = Math.floor(bt / W);
4462
+ const bt = this._lastPointerPos.y - (R + B), ht = Math.floor(bt / W);
4463
4463
  it === ht && (t.fillStyle = this.createCanvasFill(t, typeof e.itemHoverBackgroundColor == "string" ? { type: "Solid", color: e.itemHoverBackgroundColor } : e.itemHoverBackgroundColor || { type: "Solid", color: "#f9fafb" }, s, W) || "#f9fafb", t.fillRect(a + _, lt, s - _ * 2, W), t.fillStyle = e.itemHoverColor || p);
4464
4464
  }
4465
4465
  t.fillText(V, a + b, lt + W / 2);
@@ -4469,57 +4469,57 @@ class ci {
4469
4469
  }
4470
4470
  renderButton(t, i) {
4471
4471
  if (i.children && i.children.length > 0) return;
4472
- const o = this.objectStates.get(i.id), e = (o == null ? void 0 : o.options) || i.options || {}, s = i.geometry || {}, n = s.width || 120, a = s.height || 40, r = this.lastHoveredObjectId === i.id, l = this.activeObjectId === i.id, c = e.label || {}, f = e.hoverStyle || {}, u = e.activeStyle || {}, h = e.icon || { enabled: !1 };
4473
- let d = e.backgroundColor || "#3b82f6", p = c.color || "#ffffff", y = c.text || "Button", m = s.cornerRadius ?? 8, b = e.borderColor || "transparent", v = e.borderWidth || 0, S = 1;
4474
- l && u ? (d = u.backgroundColor || d, p = u.color || p, y = u.text || y, S = u.scale ?? 0.95, m = u.cornerRadius ?? m) : r && f && (d = f.backgroundColor || d, p = f.color || p, y = f.text || y, S = f.scale ?? 1, m = f.cornerRadius ?? m, b = f.borderColor || b);
4472
+ const o = this.objectStates.get(i.id), e = (o == null ? void 0 : o.options) || i.options || {}, s = i.geometry || {}, n = s.width || 120, a = s.height || 40, r = this.lastHoveredObjectId === i.id, c = this.activeObjectId === i.id, l = e.label || {}, f = e.hoverStyle || {}, u = e.activeStyle || {}, h = e.icon || { enabled: !1 };
4473
+ let d = e.backgroundColor || "#3b82f6", p = l.color || "#ffffff", y = l.text || "Button", m = s.cornerRadius ?? 8, b = e.borderColor || "transparent", v = e.borderWidth || 0, S = 1;
4474
+ c && u ? (d = u.backgroundColor || d, p = u.color || p, y = u.text || y, S = u.scale ?? 0.95, m = u.cornerRadius ?? m) : r && f && (d = f.backgroundColor || d, p = f.color || p, y = f.text || y, S = f.scale ?? 1, m = f.cornerRadius ?? m, b = f.borderColor || b);
4475
4475
  const C = -n / 2, w = -a / 2;
4476
4476
  t.save(), t.scale(S, S), t.beginPath(), this.drawRoundRect(t, C, w, n, a, m);
4477
4477
  const I = this.createCanvasFill(t, d, n, a);
4478
4478
  I && (t.fillStyle = I, t.fill()), (v > 0 || r && f.borderColor) && (t.strokeStyle = b, t.lineWidth = v || (r ? 1 : 0), t.stroke());
4479
- const M = c.fontSize || 14, k = c.fontFamily || "Inter", T = c.fontWeight || 600;
4479
+ const M = l.fontSize || 14, k = l.fontFamily || "Inter", T = l.fontWeight || 600;
4480
4480
  t.font = `${T} ${M}px "${k}", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif`, t.fillStyle = p, t.textAlign = "center", t.textBaseline = "middle";
4481
- let R = 0;
4481
+ let x = 0;
4482
4482
  if (h.enabled && h.svgPath) {
4483
- const P = M * 1.1, E = h.gap || 8, x = t.measureText(y), W = -(x.width + P + E) / 2, B = h.position === "left" ? W + P / 2 : W + x.width + E + P / 2;
4484
- R = h.position === "left" ? W + P + E + x.width / 2 : W + x.width / 2, t.save(), t.translate(B, 0);
4483
+ const P = M * 1.1, E = h.gap || 8, R = t.measureText(y), W = -(R.width + P + E) / 2, B = h.position === "left" ? W + P / 2 : W + R.width + E + P / 2;
4484
+ x = h.position === "left" ? W + P + E + R.width / 2 : W + R.width / 2, t.save(), t.translate(B, 0);
4485
4485
  const $ = new Path2D(h.svgPath), Y = P / 24;
4486
4486
  t.scale(Y, Y), t.translate(-12, -12), t.fillStyle = p, t.fill($), t.restore();
4487
4487
  }
4488
- t.fillText(y, R, 0), t.restore();
4488
+ t.fillText(y, x, 0), t.restore();
4489
4489
  }
4490
4490
  renderToggleButton(t, i) {
4491
4491
  var y, m;
4492
- const o = this.objectStates.get(i.id), e = (o == null ? void 0 : o.options) || i.options || {}, s = e.checked ?? !1, n = ((y = i.geometry) == null ? void 0 : y.width) || 120, a = ((m = i.geometry) == null ? void 0 : m.height) || 40, r = -n / 2, l = -a / 2, c = e.corner_radius ?? 8, f = e.label || {}, u = s ? e.accentColor || "#3b82f6" : e.inactiveColor || "#374151", h = s ? e.activeTextColor || "#ffffff" : e.inactiveTextColor || "#9ca3af";
4493
- t.save(), t.beginPath(), this.drawRoundRect(t, r, l, n, a, c), t.fillStyle = u, t.fill();
4492
+ const o = this.objectStates.get(i.id), e = (o == null ? void 0 : o.options) || i.options || {}, s = e.checked ?? !1, n = ((y = i.geometry) == null ? void 0 : y.width) || 120, a = ((m = i.geometry) == null ? void 0 : m.height) || 40, r = -n / 2, c = -a / 2, l = e.corner_radius ?? 8, f = e.label || {}, u = s ? e.accentColor || "#3b82f6" : e.inactiveColor || "#374151", h = s ? e.activeTextColor || "#ffffff" : e.inactiveTextColor || "#9ca3af";
4493
+ t.save(), t.beginPath(), this.drawRoundRect(t, r, c, n, a, l), t.fillStyle = u, t.fill();
4494
4494
  const d = f.fontSize || 14, p = f.fontFamily || "Inter";
4495
4495
  t.font = `${f.fontWeight || 600} ${d}px "${p}", sans-serif`, t.fillStyle = h, t.textAlign = "center", t.textBaseline = "middle", t.fillText(f.text || "Toggle", 0, 0), t.restore();
4496
4496
  }
4497
4497
  renderToggle(t, i) {
4498
4498
  var Y, H, K, A, _, L, X, V, it, lt, nt, bt;
4499
- const o = this.objectStates.get(i.id), e = (o == null ? void 0 : o.options) || i.options || {}, s = ((Y = i.geometry) == null ? void 0 : Y.width) || 52, n = ((H = i.geometry) == null ? void 0 : H.height) || 30, a = -s / 2, r = -n / 2, l = e.checked ?? !1, c = e.cornerRadius ?? e.corner_radius ?? n / 2, f = e.toggleStyle || {}, u = f.backgroundColor || e.activeColor || "#10b981", h = f.borderColor || e.borderColor || "transparent", d = f.borderWidth ?? e.borderWidth ?? 0, p = f.knobColor || e.knobColor || "#ffffff", y = l ? u : e.inactiveColor || "#374151", m = l ? h : e.borderColor || "transparent", b = l ? d : e.borderWidth ?? 0, v = l ? p : e.knobColor || "#ffffff";
4500
- e.disabled && (t.globalAlpha *= 0.5), t.beginPath(), this.drawRoundRect(t, a, r, s, n, c);
4499
+ const o = this.objectStates.get(i.id), e = (o == null ? void 0 : o.options) || i.options || {}, s = ((Y = i.geometry) == null ? void 0 : Y.width) || 52, n = ((H = i.geometry) == null ? void 0 : H.height) || 30, a = -s / 2, r = -n / 2, c = e.checked ?? !1, l = e.cornerRadius ?? e.corner_radius ?? n / 2, f = e.toggleStyle || {}, u = f.backgroundColor || e.activeColor || "#10b981", h = f.borderColor || e.borderColor || "transparent", d = f.borderWidth ?? e.borderWidth ?? 0, p = f.knobColor || e.knobColor || "#ffffff", y = c ? u : e.inactiveColor || "#374151", m = c ? h : e.borderColor || "transparent", b = c ? d : e.borderWidth ?? 0, v = c ? p : e.knobColor || "#ffffff";
4500
+ e.disabled && (t.globalAlpha *= 0.5), t.beginPath(), this.drawRoundRect(t, a, r, s, n, l);
4501
4501
  const S = this.createCanvasFill(t, y, s, n);
4502
4502
  if (S && (t.fillStyle = S, t.fill()), b > 0) {
4503
4503
  t.lineWidth = b;
4504
4504
  const ht = this.createCanvasFill(t, m, s, n);
4505
4505
  ht && (t.strokeStyle = ht, t.stroke());
4506
4506
  }
4507
- const C = 2, w = n - C * 2, I = w / 2, M = a + C, k = a + s - C - w, T = l ? k : M, R = r + C;
4508
- t.beginPath(), t.arc(T + I, R + I, I, 0, Math.PI * 2);
4507
+ const C = 2, w = n - C * 2, I = w / 2, M = a + C, k = a + s - C - w, T = c ? k : M, x = r + C;
4508
+ t.beginPath(), t.arc(T + I, x + I, I, 0, Math.PI * 2);
4509
4509
  const P = this.createCanvasFill(t, v, w, w);
4510
4510
  P && (t.fillStyle = P, t.fill()), e.disabled && (t.globalAlpha *= 2);
4511
- let E = !1, x = !1;
4512
- const O = (l ? (K = f.leftLabel) == null ? void 0 : K.text : null) || ((A = e.leftLabel) == null ? void 0 : A.text) || "", W = (l ? (_ = f.leftLabel) == null ? void 0 : _.color : null) || ((L = e.leftLabel) == null ? void 0 : L.color) || "#f3f4f6";
4511
+ let E = !1, R = !1;
4512
+ const O = (c ? (K = f.leftLabel) == null ? void 0 : K.text : null) || ((A = e.leftLabel) == null ? void 0 : A.text) || "", W = (c ? (_ = f.leftLabel) == null ? void 0 : _.color : null) || ((L = e.leftLabel) == null ? void 0 : L.color) || "#f3f4f6";
4513
4513
  if ((X = e.leftLabel) != null && X.enabled && O) {
4514
4514
  const ht = e.leftLabel;
4515
4515
  t.font = `${ht.fontWeight || 400} ${ht.fontSize || 12}px "${ht.fontFamily || "Inter"}", sans-serif`, t.fillStyle = W, t.textBaseline = "middle", t.textAlign = "right", t.fillText(O, a - (ht.gap || 8), 0), E = !0;
4516
4516
  }
4517
- const B = (l ? (V = f.rightLabel) == null ? void 0 : V.text : null) || ((it = e.rightLabel) == null ? void 0 : it.text) || "", $ = (l ? (lt = f.rightLabel) == null ? void 0 : lt.color : null) || ((nt = e.rightLabel) == null ? void 0 : nt.color) || "#f3f4f6";
4517
+ const B = (c ? (V = f.rightLabel) == null ? void 0 : V.text : null) || ((it = e.rightLabel) == null ? void 0 : it.text) || "", $ = (c ? (lt = f.rightLabel) == null ? void 0 : lt.color : null) || ((nt = e.rightLabel) == null ? void 0 : nt.color) || "#f3f4f6";
4518
4518
  if ((bt = e.rightLabel) != null && bt.enabled && B) {
4519
4519
  const ht = e.rightLabel;
4520
- t.font = `${ht.fontWeight || 400} ${ht.fontSize || 12}px "${ht.fontFamily || "Inter"}", sans-serif`, t.fillStyle = $, t.textBaseline = "middle", t.textAlign = "left", t.fillText(B, a + s + (ht.gap || 8), 0), x = !0;
4520
+ t.font = `${ht.fontWeight || 400} ${ht.fontSize || 12}px "${ht.fontFamily || "Inter"}", sans-serif`, t.fillStyle = $, t.textBaseline = "middle", t.textAlign = "left", t.fillText(B, a + s + (ht.gap || 8), 0), R = !0;
4521
4521
  }
4522
- if (!E && !x && e.label && e.label.text) {
4522
+ if (!E && !R && e.label && e.label.text) {
4523
4523
  const ht = e.label, wt = ht.fontSize || 14, Mt = ht.fontWeight || 400, It = ht.fontFamily || "Inter";
4524
4524
  t.font = `${Mt} ${wt}px "${It}", sans-serif`, t.fillStyle = ht.color || "#f3f4f6", t.textBaseline = "middle";
4525
4525
  const Ot = ht.gap || 10;
@@ -4529,24 +4529,24 @@ class ci {
4529
4529
  }
4530
4530
  renderCheckbox(t, i) {
4531
4531
  var S, C;
4532
- const o = this.objectStates.get(i.id), e = (o == null ? void 0 : o.options) || i.options || {}, s = ((S = i.geometry) == null ? void 0 : S.width) || 20, n = ((C = i.geometry) == null ? void 0 : C.height) || 20, a = -s / 2, r = -n / 2, l = e.cornerRadius ?? 4, c = e.checked ?? !1, f = e.activeColor || "#3b82f6", u = e.inactiveColor || "transparent", h = e.checkColor || "#ffffff", d = e.borderColor || "#4b5563", p = e.borderWidth ?? 2, y = c ? f : u, m = c ? "transparent" : d, b = c ? 0 : p;
4533
- e.disabled && (t.globalAlpha *= 0.5), t.beginPath(), this.drawRoundRect(t, a, r, s, n, l);
4532
+ const o = this.objectStates.get(i.id), e = (o == null ? void 0 : o.options) || i.options || {}, s = ((S = i.geometry) == null ? void 0 : S.width) || 20, n = ((C = i.geometry) == null ? void 0 : C.height) || 20, a = -s / 2, r = -n / 2, c = e.cornerRadius ?? 4, l = e.checked ?? !1, f = e.activeColor || "#3b82f6", u = e.inactiveColor || "transparent", h = e.checkColor || "#ffffff", d = e.borderColor || "#4b5563", p = e.borderWidth ?? 2, y = l ? f : u, m = l ? "transparent" : d, b = l ? 0 : p;
4533
+ e.disabled && (t.globalAlpha *= 0.5), t.beginPath(), this.drawRoundRect(t, a, r, s, n, c);
4534
4534
  const v = this.createCanvasFill(t, y, s, n);
4535
4535
  if (v && (t.fillStyle = v, t.fill()), b > 0) {
4536
4536
  t.lineWidth = b;
4537
4537
  const w = this.createCanvasFill(t, m, s, n);
4538
4538
  w && (t.strokeStyle = w, t.stroke());
4539
- } else if (c) {
4539
+ } else if (l) {
4540
4540
  t.lineWidth = 1;
4541
4541
  const w = this.createCanvasFill(t, f, s, n);
4542
4542
  w && (t.strokeStyle = w, t.stroke());
4543
4543
  }
4544
- if (c) {
4544
+ if (l) {
4545
4545
  t.save(), t.beginPath();
4546
4546
  const w = this.createCanvasFill(t, h, s, n);
4547
4547
  t.strokeStyle = w || h, t.lineWidth = Math.max(2, s * 0.12), t.lineCap = "round", t.lineJoin = "round";
4548
- const I = a + s * 0.25, M = r + n * 0.5, k = a + s * 0.45, T = r + n * 0.7, R = a + s * 0.75, P = r + n * 0.25;
4549
- t.moveTo(I, M), t.lineTo(k, T), t.lineTo(R, P), t.stroke(), t.restore();
4548
+ const I = a + s * 0.25, M = r + n * 0.5, k = a + s * 0.45, T = r + n * 0.7, x = a + s * 0.75, P = r + n * 0.25;
4549
+ t.moveTo(I, M), t.lineTo(k, T), t.lineTo(x, P), t.stroke(), t.restore();
4550
4550
  }
4551
4551
  if (e.disabled && (t.globalAlpha *= 2), e.label && e.label.text) {
4552
4552
  const w = e.label;
@@ -4558,24 +4558,24 @@ class ci {
4558
4558
  }
4559
4559
  renderRadioGroup(t, i) {
4560
4560
  var C, w;
4561
- const o = this.objectStates.get(i.id), e = (o == null ? void 0 : o.options) || i.options || {}, s = ((C = i.geometry) == null ? void 0 : C.width) || 180, n = ((w = i.geometry) == null ? void 0 : w.height) || 100, a = -s / 2, r = -n / 2, l = e.selectedValue, c = e.optionsList || ["Option 1", "Option 2", "Option 3"], f = e.orientation || "vertical", u = e.itemGap !== void 0 ? e.itemGap : 16, h = e.activeColor || "#3b82f6", d = e.inactiveColor || "#4b5563", p = e.textColor || "#ffffff", y = e.fontSize || 14, m = e.fontFamily || "Inter", b = e.fontWeight || 400;
4561
+ const o = this.objectStates.get(i.id), e = (o == null ? void 0 : o.options) || i.options || {}, s = ((C = i.geometry) == null ? void 0 : C.width) || 180, n = ((w = i.geometry) == null ? void 0 : w.height) || 100, a = -s / 2, r = -n / 2, c = e.selectedValue, l = e.optionsList || ["Option 1", "Option 2", "Option 3"], f = e.orientation || "vertical", u = e.itemGap !== void 0 ? e.itemGap : 16, h = e.activeColor || "#3b82f6", d = e.inactiveColor || "#4b5563", p = e.textColor || "#ffffff", y = e.fontSize || 14, m = e.fontFamily || "Inter", b = e.fontWeight || 400;
4562
4562
  e.disabled && (t.globalAlpha *= 0.5);
4563
4563
  const v = 8, S = v * 2;
4564
4564
  if (t.save(), t.font = `${b} ${y}px "${m}", sans-serif`, t.textBaseline = "middle", t.textAlign = "left", f === "vertical") {
4565
4565
  const I = Math.max(S, y) + u;
4566
- c.forEach((M, k) => {
4566
+ l.forEach((M, k) => {
4567
4567
  const T = r + k * I + v;
4568
4568
  t.beginPath(), t.arc(a + v, T, v, 0, Math.PI * 2);
4569
- const R = l === M, P = this.createCanvasFill(t, h, S, S), E = this.createCanvasFill(t, d, S, S);
4570
- R ? (t.strokeStyle = P || h, t.lineWidth = 2, t.stroke(), t.beginPath(), t.arc(a + v, T, v / 2, 0, Math.PI * 2), t.fillStyle = P || h, t.fill()) : (t.strokeStyle = E || d, t.lineWidth = 1.5, t.stroke()), t.fillStyle = p, t.fillText(M, a + S + 8, T);
4569
+ const x = c === M, P = this.createCanvasFill(t, h, S, S), E = this.createCanvasFill(t, d, S, S);
4570
+ x ? (t.strokeStyle = P || h, t.lineWidth = 2, t.stroke(), t.beginPath(), t.arc(a + v, T, v / 2, 0, Math.PI * 2), t.fillStyle = P || h, t.fill()) : (t.strokeStyle = E || d, t.lineWidth = 1.5, t.stroke()), t.fillStyle = p, t.fillText(M, a + S + 8, T);
4571
4571
  });
4572
4572
  } else {
4573
4573
  let I = a;
4574
- c.forEach((M) => {
4575
- const k = l === M, T = t.measureText(M).width;
4574
+ l.forEach((M) => {
4575
+ const k = c === M, T = t.measureText(M).width;
4576
4576
  t.beginPath(), t.arc(I + v, 0, v, 0, Math.PI * 2);
4577
- const R = this.createCanvasFill(t, h, S, S), P = this.createCanvasFill(t, d, S, S);
4578
- k ? (t.strokeStyle = R || h, t.lineWidth = 2, t.stroke(), t.beginPath(), t.arc(I + v, 0, v / 2, 0, Math.PI * 2), t.fillStyle = R || h, t.fill()) : (t.strokeStyle = P || d, t.lineWidth = 1.5, t.stroke()), t.fillStyle = p, t.fillText(M, I + S + 6, 0), I += S + 6 + T + u;
4577
+ const x = this.createCanvasFill(t, h, S, S), P = this.createCanvasFill(t, d, S, S);
4578
+ k ? (t.strokeStyle = x || h, t.lineWidth = 2, t.stroke(), t.beginPath(), t.arc(I + v, 0, v / 2, 0, Math.PI * 2), t.fillStyle = x || h, t.fill()) : (t.strokeStyle = P || d, t.lineWidth = 1.5, t.stroke()), t.fillStyle = p, t.fillText(M, I + S + 6, 0), I += S + 6 + T + u;
4579
4579
  });
4580
4580
  }
4581
4581
  if (t.restore(), e.disabled && (t.globalAlpha *= 2), e.label && e.label.text) {
@@ -4587,10 +4587,10 @@ class ci {
4587
4587
  }
4588
4588
  }
4589
4589
  renderBarChart(t, i) {
4590
- var T, R;
4590
+ var T, x;
4591
4591
  const o = this.objectStates.get(i.id), e = (o == null ? void 0 : o.options) || i.options || {}, s = {
4592
4592
  width: ((T = i.geometry) == null ? void 0 : T.width) || 300,
4593
- height: ((R = i.geometry) == null ? void 0 : R.height) || 180,
4593
+ height: ((x = i.geometry) == null ? void 0 : x.height) || 180,
4594
4594
  chartType: e.chartType || "grouped",
4595
4595
  stylePreset: e.stylePreset || "default",
4596
4596
  datasets: e.datasets || [{ id: "ds-1", label: "Revenue", data: [42, 67, 31, 55, 78, 48], color: "#6366f1" }],
@@ -4635,36 +4635,36 @@ class ci {
4635
4635
  return hs[this.stylePreset] || hs.default;
4636
4636
  },
4637
4637
  _resolveColor: function(P, E) {
4638
- const x = this._getPreset();
4639
- return ["#6366f1", "#f59e0b", "#10b981", "#3b82f6", "#a855f7"].includes(P) ? x.colors[E % x.colors.length] : typeof P == "string" ? P : x.colors[E % x.colors.length];
4638
+ const R = this._getPreset();
4639
+ return ["#6366f1", "#f59e0b", "#10b981", "#3b82f6", "#a855f7"].includes(P) ? R.colors[E % R.colors.length] : typeof P == "string" ? P : R.colors[E % R.colors.length];
4640
4640
  },
4641
- _makeGradient: function(P, E, x, O, W, B) {
4641
+ _makeGradient: function(P, E, R, O, W, B) {
4642
4642
  if (!this._getPreset().barGradient && !this.barGradient) return E;
4643
- const Y = P.createLinearGradient(x, O, W, B);
4643
+ const Y = P.createLinearGradient(R, O, W, B);
4644
4644
  return Y.addColorStop(0, E), Y.addColorStop(1, E + "44"), Y;
4645
4645
  },
4646
- _drawRoundedBar: function(P, E, x, O, W, B, $) {
4646
+ _drawRoundedBar: function(P, E, R, O, W, B, $) {
4647
4647
  if (B = Math.min(B, Math.min(Math.abs(O), Math.abs(W)) / 2), B <= 0 || O === 0 || W === 0) {
4648
- P.rect(E, x, O, W);
4648
+ P.rect(E, R, O, W);
4649
4649
  return;
4650
4650
  }
4651
- P.beginPath(), $ ? (P.moveTo(E, x + W), P.lineTo(E, x + B), P.quadraticCurveTo(E, x, E + B, x), P.lineTo(E + O - B, x), P.quadraticCurveTo(E + O, x, E + O, x + B), P.lineTo(E + O, x + W), P.lineTo(E, x + W)) : (P.moveTo(E, x), P.lineTo(E + O - B, x), P.quadraticCurveTo(E + O, x, E + O, x + B), P.lineTo(E + O, x + W - B), P.quadraticCurveTo(E + O, x + W, E + O - B, x + W), P.lineTo(E, x + W), P.lineTo(E, x)), P.closePath();
4651
+ P.beginPath(), $ ? (P.moveTo(E, R + W), P.lineTo(E, R + B), P.quadraticCurveTo(E, R, E + B, R), P.lineTo(E + O - B, R), P.quadraticCurveTo(E + O, R, E + O, R + B), P.lineTo(E + O, R + W), P.lineTo(E, R + W)) : (P.moveTo(E, R), P.lineTo(E + O - B, R), P.quadraticCurveTo(E + O, R, E + O, R + B), P.lineTo(E + O, R + W - B), P.quadraticCurveTo(E + O, R + W, E + O - B, R + W), P.lineTo(E, R + W), P.lineTo(E, R)), P.closePath();
4652
4652
  }
4653
- }, n = s.width, a = s.height, r = -n / 2, l = -a / 2;
4653
+ }, n = s.width, a = s.height, r = -n / 2, c = -a / 2;
4654
4654
  if (!s.datasets || s.datasets.length === 0 || s.categories.length === 0) {
4655
4655
  t.save(), t.fillStyle = "rgba(99,102,241,0.7)", t.font = "bold 11px Inter, sans-serif", t.textAlign = "center", t.textBaseline = "middle", t.fillText("NO CHART DATA", 0, 0), t.restore();
4656
4656
  return;
4657
4657
  }
4658
- const c = s._getPreset();
4658
+ const l = s._getPreset();
4659
4659
  let f = -1 / 0, u = 1 / 0;
4660
4660
  const h = s.categories.length, d = s.datasets.length;
4661
4661
  if (s.chartType === "stacked")
4662
4662
  for (let P = 0; P < h; P++) {
4663
- let E = 0, x = 0;
4663
+ let E = 0, R = 0;
4664
4664
  s.datasets.forEach((O) => {
4665
4665
  const W = O.data[P] ?? 0;
4666
- W >= 0 ? E += W : x += W;
4667
- }), E > f && (f = E), x < u && (u = x);
4666
+ W >= 0 ? E += W : R += W;
4667
+ }), E > f && (f = E), R < u && (u = R);
4668
4668
  }
4669
4669
  else
4670
4670
  s.datasets.forEach((P) => {
@@ -4675,19 +4675,19 @@ class ci {
4675
4675
  isFinite(f) || (f = 10), isFinite(u) || (u = 0), f = Math.max(f, 0), u = Math.min(u, 0);
4676
4676
  const p = f - u || 10;
4677
4677
  t.save(), s.enableShadows && (t.shadowColor = s.shadowColor, t.shadowBlur = s.shadowBlur, t.shadowOffsetY = s.shadowOffsetY), t.font = s.axisLabelFontSize + "px Inter, sans-serif";
4678
- const y = s.showYLabels ? t.measureText(f.toFixed(0)).width + 14 : 10, m = s.showXLabels ? s.axisLabelFontSize + 12 : 8, v = (s.showLegend && d > 0 ? s.legendFontSize + 10 : 0) + 8, S = 10, C = r + y, w = l + v, I = n - y - S, M = a - v - m;
4679
- if (s.enableShadows && (t.shadowColor = "transparent"), t.beginPath(), t.roundRect(r, l, n, a, 10), t.fillStyle = c.cardBackground, t.fill(), t.strokeStyle = c.cardBorderColor, t.lineWidth = 1, t.stroke(), s.chartBackground && s.chartBackground !== "transparent" && (t.beginPath(), t.rect(C, w, I, M), t.fillStyle = s.chartBackground, t.fill()), s.showLegend && d > 0) {
4678
+ const y = s.showYLabels ? t.measureText(f.toFixed(0)).width + 14 : 10, m = s.showXLabels ? s.axisLabelFontSize + 12 : 8, v = (s.showLegend && d > 0 ? s.legendFontSize + 10 : 0) + 8, S = 10, C = r + y, w = c + v, I = n - y - S, M = a - v - m;
4679
+ if (s.enableShadows && (t.shadowColor = "transparent"), t.beginPath(), t.roundRect(r, c, n, a, 10), t.fillStyle = l.cardBackground, t.fill(), t.strokeStyle = l.cardBorderColor, t.lineWidth = 1, t.stroke(), s.chartBackground && s.chartBackground !== "transparent" && (t.beginPath(), t.rect(C, w, I, M), t.fillStyle = s.chartBackground, t.fill()), s.showLegend && d > 0) {
4680
4680
  t.font = s.legendFontSize + "px Inter, sans-serif", t.textBaseline = "middle";
4681
- const P = l + 12;
4681
+ const P = c + 12;
4682
4682
  let E = C;
4683
- s.datasets.forEach((x, O) => {
4684
- const W = s._resolveColor(x.color, O), B = x.label || "Series " + (O + 1), $ = 7;
4685
- t.beginPath(), t.roundRect(E, P - $ / 2, $, $, 2), t.fillStyle = W, t.fill(), t.fillStyle = c.legendColor, t.textAlign = "left", t.fillText(B, E + $ + 4, P), E += t.measureText(B).width + $ + 16;
4683
+ s.datasets.forEach((R, O) => {
4684
+ const W = s._resolveColor(R.color, O), B = R.label || "Series " + (O + 1), $ = 7;
4685
+ t.beginPath(), t.roundRect(E, P - $ / 2, $, $, 2), t.fillStyle = W, t.fill(), t.fillStyle = l.legendColor, t.textAlign = "left", t.fillText(B, E + $ + 4, P), E += t.measureText(B).width + $ + 16;
4686
4686
  });
4687
4687
  }
4688
4688
  const k = 4;
4689
4689
  if (s.showGridLines) {
4690
- t.setLineDash(s.gridLineDash || []), t.lineWidth = s.gridLineWidth || 1, t.strokeStyle = c.gridColor;
4690
+ t.setLineDash(s.gridLineDash || []), t.lineWidth = s.gridLineWidth || 1, t.strokeStyle = l.gridColor;
4691
4691
  for (let P = 0; P <= k; P++)
4692
4692
  if (s.orientation === "horizontal") {
4693
4693
  const E = C + P / k * I;
@@ -4699,27 +4699,27 @@ class ci {
4699
4699
  t.setLineDash([]);
4700
4700
  }
4701
4701
  if (s.showYLabels) {
4702
- t.font = s.axisLabelFontSize + "px Inter, sans-serif", t.textAlign = "right", t.textBaseline = "middle", t.fillStyle = c.axisLabelColor;
4702
+ t.font = s.axisLabelFontSize + "px Inter, sans-serif", t.textAlign = "right", t.textBaseline = "middle", t.fillStyle = l.axisLabelColor;
4703
4703
  for (let P = 0; P <= k; P++)
4704
4704
  if (s.orientation === "horizontal") {
4705
- const E = u + P / k * p, x = C + P / k * I;
4706
- t.textAlign = "center", t.fillText(E.toFixed(0), x, w + M + s.axisLabelFontSize);
4705
+ const E = u + P / k * p, R = C + P / k * I;
4706
+ t.textAlign = "center", t.fillText(E.toFixed(0), R, w + M + s.axisLabelFontSize);
4707
4707
  } else {
4708
- const E = f - P / k * p, x = w + P / k * M;
4709
- t.textAlign = "right", t.fillText(E.toFixed(0), C - 6, x);
4708
+ const E = f - P / k * p, R = w + P / k * M;
4709
+ t.textAlign = "right", t.fillText(E.toFixed(0), C - 6, R);
4710
4710
  }
4711
4711
  }
4712
4712
  if (t.setLineDash([]), s.showXAxis && (t.lineWidth = s.xAxisLineWidth || 1, t.strokeStyle = s.xAxisColor, t.beginPath(), t.moveTo(C, w + M), t.lineTo(C + I, w + M), t.stroke()), s.showYAxis && (t.lineWidth = s.yAxisLineWidth || 1, t.strokeStyle = s.yAxisColor, t.beginPath(), t.moveTo(C, w), t.lineTo(C, w + M), t.stroke()), s.enableShadows && (t.shadowColor = s.shadowColor), s.chartType === "stacked")
4713
4713
  if (s.orientation === "horizontal") {
4714
4714
  const P = M / h;
4715
4715
  for (let E = 0; E < h; E++) {
4716
- const x = w + E * P + P / 2;
4717
- s.showXLabels && (t.font = s.axisLabelFontSize + "px Inter, sans-serif", t.textAlign = "right", t.textBaseline = "middle", t.fillStyle = c.axisLabelColor, t.shadowColor = "transparent", t.fillText(s.categories[E] || "", C - 5, x), s.enableShadows && (t.shadowColor = s.shadowColor));
4716
+ const R = w + E * P + P / 2;
4717
+ s.showXLabels && (t.font = s.axisLabelFontSize + "px Inter, sans-serif", t.textAlign = "right", t.textBaseline = "middle", t.fillStyle = l.axisLabelColor, t.shadowColor = "transparent", t.fillText(s.categories[E] || "", C - 5, R), s.enableShadows && (t.shadowColor = s.shadowColor));
4718
4718
  let O = C;
4719
4719
  s.datasets.forEach((W, B) => {
4720
4720
  const $ = W.data[E] ?? 0;
4721
4721
  if ($ === 0) return;
4722
- const Y = $ / p * I, H = Math.min(s.barWidth * d + s.barGap, P - 8), K = x - H / 2, A = O;
4722
+ const Y = $ / p * I, H = Math.min(s.barWidth * d + s.barGap, P - 8), K = R - H / 2, A = O;
4723
4723
  O += Y;
4724
4724
  const _ = s._resolveColor(W.color, B);
4725
4725
  t.beginPath(), t.fillStyle = s._makeGradient(t, _, A, K, A + Y, K), s._drawRoundedBar(t, A, K, Y, H, B === d - 1 ? s.barCornerRadius : 0, !1), s.barStyle === "outline" || s.barStyle === "dashed" ? (t.fillStyle = "transparent", t.strokeStyle = s.barBorderColor === "auto" ? _ : s.barBorderColor, t.lineWidth = s.barBorderWidth, s.barStyle === "dashed" && t.setLineDash([4, 4]), t.stroke(), t.setLineDash([])) : t.fill();
@@ -4728,13 +4728,13 @@ class ci {
4728
4728
  } else {
4729
4729
  const P = I / h;
4730
4730
  for (let E = 0; E < h; E++) {
4731
- const x = C + E * P + P / 2;
4732
- s.showXLabels && (t.font = s.axisLabelFontSize + "px Inter, sans-serif", t.textAlign = "center", t.textBaseline = "top", t.fillStyle = c.axisLabelColor, t.shadowColor = "transparent", t.fillText(s.categories[E] || "", x, w + M + 5), s.enableShadows && (t.shadowColor = s.shadowColor));
4731
+ const R = C + E * P + P / 2;
4732
+ s.showXLabels && (t.font = s.axisLabelFontSize + "px Inter, sans-serif", t.textAlign = "center", t.textBaseline = "top", t.fillStyle = l.axisLabelColor, t.shadowColor = "transparent", t.fillText(s.categories[E] || "", R, w + M + 5), s.enableShadows && (t.shadowColor = s.shadowColor));
4733
4733
  let O = w + M;
4734
4734
  s.datasets.forEach((W, B) => {
4735
4735
  const $ = W.data[E] ?? 0;
4736
4736
  if ($ === 0) return;
4737
- const Y = $ / p * M, H = Math.min(s.barWidth * d + s.barGap, P - 8), K = x - H / 2, A = O - Y;
4737
+ const Y = $ / p * M, H = Math.min(s.barWidth * d + s.barGap, P - 8), K = R - H / 2, A = O - Y;
4738
4738
  O -= Y;
4739
4739
  const _ = s._resolveColor(W.color, B);
4740
4740
  t.beginPath(), t.fillStyle = s._makeGradient(t, _, K, A, K, A + Y), s._drawRoundedBar(t, K, A, H, Y, B === d - 1 ? s.barCornerRadius : 0, !0), s.barStyle === "outline" || s.barStyle === "dashed" ? (t.fillStyle = "transparent", t.strokeStyle = s.barBorderColor === "auto" ? _ : s.barBorderColor, t.lineWidth = s.barBorderWidth, s.barStyle === "dashed" && t.setLineDash([4, 4]), t.stroke(), t.setLineDash([])) : t.fill();
@@ -4742,28 +4742,28 @@ class ci {
4742
4742
  }
4743
4743
  }
4744
4744
  else if (s.orientation === "horizontal") {
4745
- const P = M / h, E = d * s.barWidth + Math.max(0, (d - 1) * s.barGap), x = C + (0 - u) / p * I;
4745
+ const P = M / h, E = d * s.barWidth + Math.max(0, (d - 1) * s.barGap), R = C + (0 - u) / p * I;
4746
4746
  for (let O = 0; O < h; O++) {
4747
4747
  const W = w + O * P + P / 2;
4748
- s.showXLabels && (t.font = s.axisLabelFontSize + "px Inter, sans-serif", t.textAlign = "right", t.textBaseline = "middle", t.fillStyle = c.axisLabelColor, t.shadowColor = "transparent", t.fillText(s.categories[O] || "", C - 5, W), s.enableShadows && (t.shadowColor = s.shadowColor));
4748
+ s.showXLabels && (t.font = s.axisLabelFontSize + "px Inter, sans-serif", t.textAlign = "right", t.textBaseline = "middle", t.fillStyle = l.axisLabelColor, t.shadowColor = "transparent", t.fillText(s.categories[O] || "", C - 5, W), s.enableShadows && (t.shadowColor = s.shadowColor));
4749
4749
  const B = W - E / 2;
4750
4750
  s.datasets.forEach(($, Y) => {
4751
4751
  const H = $.data[O] ?? 0, K = Math.abs(H / p * I);
4752
4752
  if (K < 1) return;
4753
- const A = B + Y * (s.barWidth + s.barGap), _ = H >= 0 ? x : x - K, L = s._resolveColor($.color, Y);
4753
+ const A = B + Y * (s.barWidth + s.barGap), _ = H >= 0 ? R : R - K, L = s._resolveColor($.color, Y);
4754
4754
  t.beginPath(), t.fillStyle = s._makeGradient(t, L, _, A, _ + K, A), s._drawRoundedBar(t, _, A, K, s.barWidth, s.barCornerRadius, !1), s.barStyle === "outline" || s.barStyle === "dashed" ? (t.fillStyle = "transparent", t.strokeStyle = s.barBorderColor === "auto" ? L : s.barBorderColor, t.lineWidth = s.barBorderWidth, s.barStyle === "dashed" && t.setLineDash([4, 4]), t.stroke(), t.setLineDash([])) : t.fill(), s.showValueOnTop && H !== 0 && (t.font = (s.valueFontWeight || "bold") + " " + (s.valueFontSize || 10) + "px Inter, sans-serif", t.textAlign = H >= 0 ? "left" : "right", t.textBaseline = "middle", t.fillStyle = s.valueColor === "auto" ? L : s.valueColor || "#fff", t.shadowColor = "transparent", t.fillText(H.toString(), H >= 0 ? _ + K + 4 : _ - 4, A + s.barWidth / 2), s.enableShadows && (t.shadowColor = s.shadowColor));
4755
4755
  });
4756
4756
  }
4757
4757
  } else {
4758
- const P = I / h, E = d * s.barWidth + Math.max(0, (d - 1) * s.barGap), x = w + M - (0 - u) / p * M;
4758
+ const P = I / h, E = d * s.barWidth + Math.max(0, (d - 1) * s.barGap), R = w + M - (0 - u) / p * M;
4759
4759
  for (let O = 0; O < h; O++) {
4760
4760
  const W = C + O * P + P / 2;
4761
- s.showXLabels && (t.font = s.axisLabelFontSize + "px Inter, sans-serif", t.textAlign = "center", t.textBaseline = "top", t.fillStyle = c.axisLabelColor, t.shadowColor = "transparent", t.fillText(s.categories[O] || "", W, w + M + 5), s.enableShadows && (t.shadowColor = s.shadowColor));
4761
+ s.showXLabels && (t.font = s.axisLabelFontSize + "px Inter, sans-serif", t.textAlign = "center", t.textBaseline = "top", t.fillStyle = l.axisLabelColor, t.shadowColor = "transparent", t.fillText(s.categories[O] || "", W, w + M + 5), s.enableShadows && (t.shadowColor = s.shadowColor));
4762
4762
  const B = W - E / 2;
4763
4763
  s.datasets.forEach(($, Y) => {
4764
4764
  const H = $.data[O] ?? 0, K = Math.abs(H / p * M);
4765
4765
  if (K < 1) return;
4766
- const A = B + Y * (s.barWidth + s.barGap), _ = H >= 0 ? x - K : x, L = s._resolveColor($.color, Y);
4766
+ const A = B + Y * (s.barWidth + s.barGap), _ = H >= 0 ? R - K : R, L = s._resolveColor($.color, Y);
4767
4767
  t.beginPath(), t.fillStyle = s._makeGradient(t, L, A, _, A, _ + K), s._drawRoundedBar(t, A, _, s.barWidth, K, s.barCornerRadius, !0), s.barStyle === "outline" || s.barStyle === "dashed" ? (t.fillStyle = "transparent", t.strokeStyle = s.barBorderColor === "auto" ? L : s.barBorderColor, t.lineWidth = s.barBorderWidth, s.barStyle === "dashed" && t.setLineDash([4, 4]), t.stroke(), t.setLineDash([])) : t.fill(), s.showValueOnTop && H !== 0 && (t.font = (s.valueFontWeight || "bold") + " " + (s.valueFontSize || 10) + "px Inter, sans-serif", t.textAlign = "center", t.textBaseline = H >= 0 ? "bottom" : "top", t.fillStyle = s.valueColor === "auto" ? L : s.valueColor || "#fff", t.shadowColor = "transparent", t.fillText(H.toString(), A + s.barWidth / 2, H >= 0 ? _ - 4 : _ + K + 4), s.enableShadows && (t.shadowColor = s.shadowColor));
4768
4768
  });
4769
4769
  }
@@ -4807,18 +4807,18 @@ class ci {
4807
4807
  t.save(), t.fillStyle = "rgba(99,102,241,0.8)", t.font = "bold 11px Inter, sans-serif", t.textAlign = "center", t.textBaseline = "middle", t.fillText("EMPTY DATA", 0, 0), t.restore();
4808
4808
  return;
4809
4809
  }
4810
- const l = s._getPreset();
4811
- t.save(), t.beginPath(), t.roundRect(-n / 2, -a / 2, n, a, 10), t.fillStyle = l.cardBackground, t.fill(), t.strokeStyle = l.cardBorderColor, t.lineWidth = 1, t.stroke();
4812
- const c = s.showLegend ? Math.ceil(s.slices.length / 2) : 0, f = c > 0 ? c * (s.legendFontSize + 8) + 10 : 0, u = a - f - 16, h = Math.min(n - 24, u) / 2, d = 0, p = -f / 2;
4810
+ const c = s._getPreset();
4811
+ t.save(), t.beginPath(), t.roundRect(-n / 2, -a / 2, n, a, 10), t.fillStyle = c.cardBackground, t.fill(), t.strokeStyle = c.cardBorderColor, t.lineWidth = 1, t.stroke();
4812
+ const l = s.showLegend ? Math.ceil(s.slices.length / 2) : 0, f = l > 0 ? l * (s.legendFontSize + 8) + 10 : 0, u = a - f - 16, h = Math.min(n - 24, u) / 2, d = 0, p = -f / 2;
4813
4813
  if (s.chartType === "rose") {
4814
4814
  const b = Math.max(...s.slices.map((C) => C.value || 0)), v = Math.PI * 2 / s.slices.length, S = h > 0 ? s.sliceGap / h : 0;
4815
4815
  s.slices.forEach((C, w) => {
4816
4816
  const I = C.value || 0;
4817
4817
  if (I === 0) return;
4818
- const M = I / b * h, k = -Math.PI / 2 + w * v + S / 2, T = k + v - S, R = s._resolveSliceColor(C, w);
4819
- if (t.beginPath(), t.moveTo(d, p), t.arc(d, p, M, k, T), t.closePath(), t.fillStyle = R + "cc", t.fill(), t.strokeStyle = R, t.lineWidth = 1.5, t.stroke(), s.showLabels) {
4820
- const P = k + (T - k) / 2, E = d + M * 0.65 * Math.cos(P), x = p + M * 0.65 * Math.sin(P), O = Math.round(I / r * 100);
4821
- t.save(), t.font = `bold ${s.labelFontSize}px Inter, sans-serif`, t.fillStyle = l.labelColor, t.textAlign = "center", t.textBaseline = "middle", t.fillText(`${O}%`, E, x), t.restore();
4818
+ const M = I / b * h, k = -Math.PI / 2 + w * v + S / 2, T = k + v - S, x = s._resolveSliceColor(C, w);
4819
+ if (t.beginPath(), t.moveTo(d, p), t.arc(d, p, M, k, T), t.closePath(), t.fillStyle = x + "cc", t.fill(), t.strokeStyle = x, t.lineWidth = 1.5, t.stroke(), s.showLabels) {
4820
+ const P = k + (T - k) / 2, E = d + M * 0.65 * Math.cos(P), R = p + M * 0.65 * Math.sin(P), O = Math.round(I / r * 100);
4821
+ t.save(), t.font = `bold ${s.labelFontSize}px Inter, sans-serif`, t.fillStyle = c.labelColor, t.textAlign = "center", t.textBaseline = "middle", t.fillText(`${O}%`, E, R), t.restore();
4822
4822
  }
4823
4823
  });
4824
4824
  } else {
@@ -4830,33 +4830,33 @@ class ci {
4830
4830
  C += M / r * Math.PI * 2;
4831
4831
  return;
4832
4832
  }
4833
- const k = M / r * Math.PI * 2, T = C + S / 2, R = C + k - S / 2;
4834
- if (R <= T) {
4833
+ const k = M / r * Math.PI * 2, T = C + S / 2, x = C + k - S / 2;
4834
+ if (x <= T) {
4835
4835
  C += k;
4836
4836
  return;
4837
4837
  }
4838
4838
  const P = s._resolveSliceColor(w, I);
4839
- if (t.beginPath(), t.fillStyle = P, v <= 0 ? (t.moveTo(d, p), t.arc(d, p, h, T, R), t.lineTo(d, p)) : (t.moveTo(d + h * Math.cos(T), p + h * Math.sin(T)), t.arc(d, p, h, T, R), t.arc(d, p, v, R, T, !0), t.closePath()), t.fill(), s.showLabels) {
4840
- const E = T + (R - T) / 2, x = v + (h - v) / 2, O = d + x * Math.cos(E), W = p + x * Math.sin(E), B = Math.round(M / r * 100);
4841
- t.save(), t.font = `bold ${s.labelFontSize}px Inter, sans-serif`, t.fillStyle = l.labelColor, t.textAlign = "center", t.textBaseline = "middle", t.fillText(`${B}%`, O, W), t.restore();
4839
+ if (t.beginPath(), t.fillStyle = P, v <= 0 ? (t.moveTo(d, p), t.arc(d, p, h, T, x), t.lineTo(d, p)) : (t.moveTo(d + h * Math.cos(T), p + h * Math.sin(T)), t.arc(d, p, h, T, x), t.arc(d, p, v, x, T, !0), t.closePath()), t.fill(), s.showLabels) {
4840
+ const E = T + (x - T) / 2, R = v + (h - v) / 2, O = d + R * Math.cos(E), W = p + R * Math.sin(E), B = Math.round(M / r * 100);
4841
+ t.save(), t.font = `bold ${s.labelFontSize}px Inter, sans-serif`, t.fillStyle = c.labelColor, t.textAlign = "center", t.textBaseline = "middle", t.fillText(`${B}%`, O, W), t.restore();
4842
4842
  }
4843
4843
  C += k;
4844
4844
  }), s.chartType === "donut" && s.showCenterText && v > 14) {
4845
4845
  const w = Math.round(r), I = Math.min(Math.floor(v * 0.52), 20), M = Math.min(Math.floor(v * 0.26), 10);
4846
- t.textAlign = "center", t.textBaseline = "middle", t.font = `bold ${I}px Inter, sans-serif`, t.fillStyle = l.centerTextColor, t.fillText(w.toString(), d, p - M * 0.5), s.centerLabel && (t.font = `${M}px Inter, sans-serif`, t.fillStyle = l.centerLabelColor, t.fillText(s.centerLabel, d, p + I * 0.6));
4846
+ t.textAlign = "center", t.textBaseline = "middle", t.font = `bold ${I}px Inter, sans-serif`, t.fillStyle = c.centerTextColor, t.fillText(w.toString(), d, p - M * 0.5), s.centerLabel && (t.font = `${M}px Inter, sans-serif`, t.fillStyle = c.centerLabelColor, t.fillText(s.centerLabel, d, p + I * 0.6));
4847
4847
  }
4848
4848
  }
4849
4849
  if (s.showLegend && s.slices.length > 0) {
4850
4850
  t.font = `${s.legendFontSize}px Inter, sans-serif`;
4851
4851
  const b = 2, v = n / b, S = s.legendFontSize + 8, C = a / 2 - f + 10, w = -n / 2 + 10;
4852
4852
  s.slices.forEach((I, M) => {
4853
- const k = M % b, T = Math.floor(M / b), R = w + k * v, P = C + T * S, E = s._resolveSliceColor(I, M), x = 7;
4854
- t.beginPath(), t.roundRect(R, P - x / 2, x, x, 2), t.fillStyle = E, t.fill(), t.textAlign = "left", t.textBaseline = "middle", t.fillStyle = l.legendColor;
4855
- const O = Math.round((I.value || 0) / r * 100), W = `${I.label || "Item"} ${O}%`, B = v - x - 20;
4853
+ const k = M % b, T = Math.floor(M / b), x = w + k * v, P = C + T * S, E = s._resolveSliceColor(I, M), R = 7;
4854
+ t.beginPath(), t.roundRect(x, P - R / 2, R, R, 2), t.fillStyle = E, t.fill(), t.textAlign = "left", t.textBaseline = "middle", t.fillStyle = c.legendColor;
4855
+ const O = Math.round((I.value || 0) / r * 100), W = `${I.label || "Item"} ${O}%`, B = v - R - 20;
4856
4856
  let $ = W;
4857
4857
  for (; t.measureText($).width > B && $.length > 4; )
4858
4858
  $ = $.slice(0, -4) + "…";
4859
- t.fillText($, R + x + 4, P);
4859
+ t.fillText($, x + R + 4, P);
4860
4860
  });
4861
4861
  }
4862
4862
  t.restore();
@@ -4864,33 +4864,33 @@ class ci {
4864
4864
  renderJoystick(t, i) {
4865
4865
  var p, y, m, b, v;
4866
4866
  const o = this.objectStates.get(i.id), e = (o == null ? void 0 : o.width) !== void 0 ? o.width : ((p = i.geometry) == null ? void 0 : p.width) ?? i.width ?? 100, s = (o == null ? void 0 : o.height) !== void 0 ? o.height : ((y = i.geometry) == null ? void 0 : y.height) ?? i.height ?? 100, n = Math.min(e, s) * 0.45, a = Math.min(e, s) * 0.15;
4867
- let r = i.handleX || 0, l = i.handleY || 0;
4868
- o && o.handleX !== void 0 && (r = o.handleX), o && o.handleY !== void 0 && (l = o.handleY), t.save();
4869
- let c = 0, f = 0;
4870
- i.handleOrigin === "top-left" ? (c = e / 2, f = s / 2) : i.handleOrigin === "bottom-right" && (c = -e / 2, f = -s / 2), t.translate(c, f), t.beginPath(), i.boundsShape === "square" ? t.rect(-n, -n, n * 2, n * 2) : t.arc(0, 0, n, 0, Math.PI * 2), t.fillStyle = "rgba(0,0,0,0.2)", (m = i.style) != null && m.fill && typeof i.style.fill == "string" ? t.fillStyle = i.style.fill : (b = i.style) != null && b.fill && i.style.fill.type === "solid" && (t.fillStyle = i.style.fill.color), t.fill(), (v = i.style) != null && v.stroke && i.style.stroke.isEnabled !== !1 && (t.lineWidth = i.style.stroke.width || 1, t.strokeStyle = i.style.stroke.color || "#000", t.stroke());
4867
+ let r = i.handleX || 0, c = i.handleY || 0;
4868
+ o && o.handleX !== void 0 && (r = o.handleX), o && o.handleY !== void 0 && (c = o.handleY), t.save();
4869
+ let l = 0, f = 0;
4870
+ i.handleOrigin === "top-left" ? (l = e / 2, f = s / 2) : i.handleOrigin === "bottom-right" && (l = -e / 2, f = -s / 2), t.translate(l, f), t.beginPath(), i.boundsShape === "square" ? t.rect(-n, -n, n * 2, n * 2) : t.arc(0, 0, n, 0, Math.PI * 2), t.fillStyle = "rgba(0,0,0,0.2)", (m = i.style) != null && m.fill && typeof i.style.fill == "string" ? t.fillStyle = i.style.fill : (b = i.style) != null && b.fill && i.style.fill.type === "solid" && (t.fillStyle = i.style.fill.color), t.fill(), (v = i.style) != null && v.stroke && i.style.stroke.isEnabled !== !1 && (t.lineWidth = i.style.stroke.width || 1, t.strokeStyle = i.style.stroke.color || "#000", t.stroke());
4871
4871
  const u = n - a;
4872
4872
  let h = 0, d = 0;
4873
- i.joystickType === "2D" ? (h = r * u, d = l * u) : i.joystickType === "1D_X" ? (h = r * u, d = 0) : i.joystickType === "1D_Y" && (h = 0, d = l * u), t.beginPath(), t.arc(h, d, a, 0, Math.PI * 2), t.fillStyle = "#fff", t.fill(), t.strokeStyle = "rgba(0,0,0,0.5)", t.lineWidth = 1, t.stroke(), t.restore();
4873
+ i.joystickType === "2D" ? (h = r * u, d = c * u) : i.joystickType === "1D_X" ? (h = r * u, d = 0) : i.joystickType === "1D_Y" && (h = 0, d = c * u), t.beginPath(), t.arc(h, d, a, 0, Math.PI * 2), t.fillStyle = "#fff", t.fill(), t.strokeStyle = "rgba(0,0,0,0.5)", t.lineWidth = 1, t.stroke(), t.restore();
4874
4874
  }
4875
4875
  getRadioGroupItemIndexAtPointer(t, i, o) {
4876
4876
  var M, k;
4877
4877
  const e = t.options || {}, s = this.objectStates.get(t.id) || {}, n = e.optionsList || [];
4878
4878
  if (n.length === 0) return null;
4879
- const a = s.width !== void 0 ? s.width : ((M = t.geometry) == null ? void 0 : M.width) || 180, r = s.height !== void 0 ? s.height : ((k = t.geometry) == null ? void 0 : k.height) || 100, l = e.orientation || "vertical", c = e.itemGap !== void 0 ? e.itemGap : 16, f = e.fontSize || 14, u = this.getWorldTransform(t.id), h = i - u.x, d = o - u.y, p = -u.rotation * (Math.PI / 180), y = Math.cos(p), m = Math.sin(p), b = h * y - d * m, v = h * m + d * y, C = 8 * 2, w = -a / 2, I = -r / 2;
4880
- if (l === "vertical") {
4881
- const T = Math.max(C, f) + c;
4882
- for (let R = 0; R < n.length; R++) {
4883
- const P = I + R * T;
4879
+ const a = s.width !== void 0 ? s.width : ((M = t.geometry) == null ? void 0 : M.width) || 180, r = s.height !== void 0 ? s.height : ((k = t.geometry) == null ? void 0 : k.height) || 100, c = e.orientation || "vertical", l = e.itemGap !== void 0 ? e.itemGap : 16, f = e.fontSize || 14, u = this.getWorldTransform(t.id), h = i - u.x, d = o - u.y, p = -u.rotation * (Math.PI / 180), y = Math.cos(p), m = Math.sin(p), b = h * y - d * m, v = h * m + d * y, C = 8 * 2, w = -a / 2, I = -r / 2;
4880
+ if (c === "vertical") {
4881
+ const T = Math.max(C, f) + l;
4882
+ for (let x = 0; x < n.length; x++) {
4883
+ const P = I + x * T;
4884
4884
  if (b >= w && b <= w + a && v >= P && v <= P + T)
4885
- return R;
4885
+ return x;
4886
4886
  }
4887
4887
  } else {
4888
4888
  let T = w;
4889
- for (let R = 0; R < n.length; R++) {
4890
- const E = n[R].length * 8, x = C + 6 + E + c;
4891
- if (b >= T && b <= T + x && v >= I && v <= I + r)
4892
- return R;
4893
- T += x;
4889
+ for (let x = 0; x < n.length; x++) {
4890
+ const E = n[x].length * 8, R = C + 6 + E + l;
4891
+ if (b >= T && b <= T + R && v >= I && v <= I + r)
4892
+ return x;
4893
+ T += R;
4894
4894
  }
4895
4895
  }
4896
4896
  return null;
@@ -4932,10 +4932,10 @@ class ci {
4932
4932
  }
4933
4933
  p._resolvedData = y;
4934
4934
  }), r < 2) return;
4935
- const l = a - n, c = o / (r - 1), f = (p) => {
4936
- const y = l === 0 ? 0.5 : (p - n) / l;
4935
+ const c = a - n, l = o / (r - 1), f = (p) => {
4936
+ const y = c === 0 ? 0.5 : (p - n) / c;
4937
4937
  return e / 2 - y * e;
4938
- }, u = (p) => p * c - o / 2, h = i.axisColor || "#333333";
4938
+ }, u = (p) => p * l - o / 2, h = i.axisColor || "#333333";
4939
4939
  if (i.showXAxis && (t.beginPath(), t.strokeStyle = i.xAxisColor || h, t.lineWidth = 1, t.moveTo(-o / 2, e / 2), t.lineTo(o / 2, e / 2), t.stroke()), i.showYAxis && (t.beginPath(), t.strokeStyle = i.yAxisColor || h, t.lineWidth = 1, t.moveTo(-o / 2, -e / 2), t.lineTo(-o / 2, e / 2), t.stroke()), t.fillStyle = i.axisLabelColor || "#333333", t.font = `${i.axisLabelFontSize || 10}px Inter, sans-serif`, i.showXLabels) {
4940
4940
  t.textAlign = "center", t.textBaseline = "top";
4941
4941
  for (let p = 0; p < r; p++) {
@@ -4995,8 +4995,8 @@ class ci {
4995
4995
  }
4996
4996
  }
4997
4997
  _catmullRom(t, i, o, e, s) {
4998
- const n = (o - t) * 0.5, a = (e - i) * 0.5, r = s * s, l = s * r;
4999
- return (2 * i - 2 * o + n + a) * l + (-3 * i + 3 * o - 2 * n - a) * r + n * s + i;
4998
+ const n = (o - t) * 0.5, a = (e - i) * 0.5, r = s * s, c = s * r;
4999
+ return (2 * i - 2 * o + n + a) * c + (-3 * i + 3 * o - 2 * n - a) * r + n * s + i;
5000
5000
  }
5001
5001
  normalizeOpacity(t) {
5002
5002
  const i = typeof t == "number" ? t : parseFloat(String(t));
@@ -5007,19 +5007,19 @@ class ci {
5007
5007
  if (!i || i.type === "None") return null;
5008
5008
  if (typeof i == "string") return i;
5009
5009
  if (i.type === "Solid" && i.color) {
5010
- const r = i.color, c = (((n = (s = this.artboard) == null ? void 0 : s.tokens) == null ? void 0 : n.colors) || {})[r] || r;
5011
- return t.fillStyle = c, c;
5010
+ const r = i.color, l = (((n = (s = this.artboard) == null ? void 0 : s.tokens) == null ? void 0 : n.colors) || {})[r] || r;
5011
+ return t.fillStyle = l, l;
5012
5012
  }
5013
5013
  if ((i.type === "LinearGradient" || i.type === "RadialGradient" || i.type === "AngularGradient" || i.type === "DiamondGradient") && i.stops) {
5014
- const r = (l, c = 100) => {
5014
+ const r = (c, l = 100) => {
5015
5015
  var S, C;
5016
- const u = (((C = (S = this.artboard) == null ? void 0 : S.tokens) == null ? void 0 : C.colors) || {})[l] || l, h = this.normalizeOpacity(i.opacity ?? 100), p = this.normalizeOpacity(c) * h;
5016
+ const u = (((C = (S = this.artboard) == null ? void 0 : S.tokens) == null ? void 0 : C.colors) || {})[c] || c, h = this.normalizeOpacity(i.opacity ?? 100), p = this.normalizeOpacity(l) * h;
5017
5017
  if (p >= 1 && u.startsWith("#")) return u;
5018
5018
  const y = u.startsWith("#") ? u.replace("#", "") : "ffffff", m = parseInt(y.substring(0, 2), 16), b = parseInt(y.substring(2, 4), 16), v = parseInt(y.substring(4, 6), 16);
5019
5019
  return `rgba(${m}, ${b}, ${v}, ${p})`;
5020
5020
  };
5021
5021
  if (i.type === "LinearGradient") {
5022
- const l = (p, y, m) => Array.isArray(p) ? p[y] ?? (y === 0 ? 0 : 1) : p && typeof p == "object" ? p[m] ?? (y === 0 ? 0 : 1) : y === 0 ? 0 : 1, c = l(i.start, 0, "x") * o - o / 2, f = l(i.start, 1, "y") * e - e / 2, u = l(i.end, 0, "x") * o - o / 2, h = l(i.end, 1, "y") * e - e / 2, d = t.createLinearGradient(c, f, u, h);
5022
+ const c = (p, y, m) => Array.isArray(p) ? p[y] ?? (y === 0 ? 0 : 1) : p && typeof p == "object" ? p[m] ?? (y === 0 ? 0 : 1) : y === 0 ? 0 : 1, l = c(i.start, 0, "x") * o - o / 2, f = c(i.start, 1, "y") * e - e / 2, u = c(i.end, 0, "x") * o - o / 2, h = c(i.end, 1, "y") * e - e / 2, d = t.createLinearGradient(l, f, u, h);
5023
5023
  if (i.stops.forEach((p) => {
5024
5024
  const y = p.offset !== void 0 ? p.offset : p.pos !== void 0 ? p.pos : p.position !== void 0 ? p.position : 0, m = r(p.color || "#000000", p.opacity ?? 100);
5025
5025
  d.addColorStop(Math.max(0, Math.min(1, y)), m);
@@ -5029,7 +5029,7 @@ class ci {
5029
5029
  }
5030
5030
  return d;
5031
5031
  } else if (i.type === "RadialGradient") {
5032
- const l = (d, p, y) => Array.isArray(d) ? d[p] ?? 0.5 : d && typeof d == "object" ? d[y] ?? 0.5 : 0.5, c = l(i.center, 0, "x") * o - o / 2, f = l(i.center, 1, "y") * e - e / 2, u = (i.radius ?? 0.5) * Math.max(o, e), h = t.createRadialGradient(c, f, 0, c, f, u);
5032
+ const c = (d, p, y) => Array.isArray(d) ? d[p] ?? 0.5 : d && typeof d == "object" ? d[y] ?? 0.5 : 0.5, l = c(i.center, 0, "x") * o - o / 2, f = c(i.center, 1, "y") * e - e / 2, u = (i.radius ?? 0.5) * Math.max(o, e), h = t.createRadialGradient(l, f, 0, l, f, u);
5033
5033
  if (i.stops.forEach((d) => {
5034
5034
  const p = d.offset !== void 0 ? d.offset : d.pos !== void 0 ? d.pos : d.position !== void 0 ? d.position : 0, y = r(d.color || "#000000", d.opacity ?? 100);
5035
5035
  h.addColorStop(Math.max(0, Math.min(1, p)), y);
@@ -5039,7 +5039,7 @@ class ci {
5039
5039
  }
5040
5040
  return h;
5041
5041
  } else if (i.type === "AngularGradient") {
5042
- const l = (d, p, y) => Array.isArray(d) ? d[p] ?? 0.5 : d && typeof d == "object" ? d[y] ?? 0.5 : 0.5, c = l(i.center || [0.5, 0.5], 0, "x") * o - o / 2, f = l(i.center || [0.5, 0.5], 1, "y") * e - e / 2, u = (i.degree || i.angle || 0) * (Math.PI / 180), h = (a = t.createConicGradient) == null ? void 0 : a.call(t, u, c, f);
5042
+ const c = (d, p, y) => Array.isArray(d) ? d[p] ?? 0.5 : d && typeof d == "object" ? d[y] ?? 0.5 : 0.5, l = c(i.center || [0.5, 0.5], 0, "x") * o - o / 2, f = c(i.center || [0.5, 0.5], 1, "y") * e - e / 2, u = (i.degree || i.angle || 0) * (Math.PI / 180), h = (a = t.createConicGradient) == null ? void 0 : a.call(t, u, l, f);
5043
5043
  if (h) {
5044
5044
  if (i.stops.forEach((d) => {
5045
5045
  const p = d.offset !== void 0 ? d.offset : d.pos !== void 0 ? d.pos : d.position !== void 0 ? d.position : 0, y = r(d.color || "#000000", d.opacity ?? 100);
@@ -5051,8 +5051,8 @@ class ci {
5051
5051
  return h;
5052
5052
  }
5053
5053
  } else if (i.type === "DiamondGradient") {
5054
- const l = (d, p, y) => Array.isArray(d) ? d[p] ?? 0.5 : d && typeof d == "object" ? d[y] ?? 0.5 : 0.5, c = l(i.center || [0.5, 0.5], 0, "x") * o - o / 2, f = l(i.center || [0.5, 0.5], 1, "y") * e - e / 2, u = (i.radius ?? 0.5) * Math.max(o, e);
5055
- t.save(), t.translate(c, f), t.rotate(Math.PI / 4);
5054
+ const c = (d, p, y) => Array.isArray(d) ? d[p] ?? 0.5 : d && typeof d == "object" ? d[y] ?? 0.5 : 0.5, l = c(i.center || [0.5, 0.5], 0, "x") * o - o / 2, f = c(i.center || [0.5, 0.5], 1, "y") * e - e / 2, u = (i.radius ?? 0.5) * Math.max(o, e);
5055
+ t.save(), t.translate(l, f), t.rotate(Math.PI / 4);
5056
5056
  const h = t.createRadialGradient(0, 0, 0, 0, 0, u);
5057
5057
  if (i.stops.forEach((d) => {
5058
5058
  const p = d.offset !== void 0 ? d.offset : d.pos !== void 0 ? d.pos : d.position !== void 0 ? d.position : 0, y = r(d.color || "#000000", d.opacity ?? 100);
@@ -5067,12 +5067,12 @@ class ci {
5067
5067
  if (i.type === "Pattern" && i.url) {
5068
5068
  let r = this.imageCache.get(i.url);
5069
5069
  if (r || (r = new Image(), r.src = i.url, this.imageCache.set(i.url, r)), r.complete && r.naturalWidth > 0) {
5070
- const l = t.createPattern(r, "repeat");
5071
- if (l && (i.scaleX !== void 0 || i.offsetX !== void 0)) {
5072
- const c = new DOMMatrix(), f = i.scaleX ?? 1, u = i.scaleY ?? 1, h = i.offsetX ?? 0, d = i.offsetY ?? 0, p = i.rotation ?? 0;
5073
- c.translateSelf(h, d), c.rotateSelf(p), c.scaleSelf(f, u), l.setTransform(c);
5070
+ const c = t.createPattern(r, "repeat");
5071
+ if (c && (i.scaleX !== void 0 || i.offsetX !== void 0)) {
5072
+ const l = new DOMMatrix(), f = i.scaleX ?? 1, u = i.scaleY ?? 1, h = i.offsetX ?? 0, d = i.offsetY ?? 0, p = i.rotation ?? 0;
5073
+ l.translateSelf(h, d), l.rotateSelf(p), l.scaleSelf(f, u), c.setTransform(l);
5074
5074
  }
5075
- return l;
5075
+ return c;
5076
5076
  }
5077
5077
  }
5078
5078
  return i.color || null;
@@ -5089,45 +5089,45 @@ class ci {
5089
5089
  } catch {
5090
5090
  a = parseFloat(a) || 0;
5091
5091
  }
5092
- let r = 0, l = 0, c = 0, f = 0;
5093
- typeof a == "number" ? r = l = c = f = a : Array.isArray(a) ? a.length === 1 ? r = l = c = f = a[0] : a.length === 2 ? (r = c = a[0], l = f = a[1]) : a.length === 3 ? (r = a[0], l = f = a[1], c = a[2]) : a.length >= 4 && (r = a[0], l = a[1], c = a[2], f = a[3]) : a && typeof a == "object" && (r = a.tl ?? a.corner_radius ?? a.cornerRadius ?? 0, l = a.tr ?? a.corner_radius ?? a.cornerRadius ?? 0, c = a.br ?? a.corner_radius ?? a.cornerRadius ?? 0, f = a.bl ?? a.corner_radius ?? a.cornerRadius ?? 0);
5092
+ let r = 0, c = 0, l = 0, f = 0;
5093
+ typeof a == "number" ? r = c = l = f = a : Array.isArray(a) ? a.length === 1 ? r = c = l = f = a[0] : a.length === 2 ? (r = l = a[0], c = f = a[1]) : a.length === 3 ? (r = a[0], c = f = a[1], l = a[2]) : a.length >= 4 && (r = a[0], c = a[1], l = a[2], f = a[3]) : a && typeof a == "object" && (r = a.tl ?? a.corner_radius ?? a.cornerRadius ?? 0, c = a.tr ?? a.corner_radius ?? a.cornerRadius ?? 0, l = a.br ?? a.corner_radius ?? a.cornerRadius ?? 0, f = a.bl ?? a.corner_radius ?? a.cornerRadius ?? 0);
5094
5094
  const u = Math.min(Math.abs(e) / 2, Math.abs(s) / 2);
5095
- if (r = Math.min(Math.max(0, r), u), l = Math.min(Math.max(0, l), u), c = Math.min(Math.max(0, c), u), f = Math.min(Math.max(0, f), u), t.roundRect) {
5096
- t.roundRect(i, o, e, s, [r, l, c, f]);
5095
+ if (r = Math.min(Math.max(0, r), u), c = Math.min(Math.max(0, c), u), l = Math.min(Math.max(0, l), u), f = Math.min(Math.max(0, f), u), t.roundRect) {
5096
+ t.roundRect(i, o, e, s, [r, c, l, f]);
5097
5097
  return;
5098
5098
  }
5099
- t.moveTo(i + r, o), t.lineTo(i + e - l, o), t.arcTo(i + e, o, i + e, o + l, l), t.lineTo(i + e, o + s - c), t.arcTo(i + e, o + s, i + e - c, o + s, c), t.lineTo(i + f, o + s), t.arcTo(i, o + s, i, o + s - f, f), t.lineTo(i, o + r), t.arcTo(i, o, i + r, o, r), t.closePath();
5099
+ t.moveTo(i + r, o), t.lineTo(i + e - c, o), t.arcTo(i + e, o, i + e, o + c, c), t.lineTo(i + e, o + s - l), t.arcTo(i + e, o + s, i + e - l, o + s, l), t.lineTo(i + f, o + s), t.arcTo(i, o + s, i, o + s - f, f), t.lineTo(i, o + r), t.arcTo(i, o, i + r, o, r), t.closePath();
5100
5100
  }
5101
5101
  renderListView(t, i) {
5102
5102
  var O, W, B, $;
5103
- const o = this.objectStates.get(i.id) || {}, e = o.options || i.options || {}, s = o.width !== void 0 ? o.width : ((O = i.geometry) == null ? void 0 : O.width) || 200, n = o.height !== void 0 ? o.height : ((W = i.geometry) == null ? void 0 : W.height) || 300, a = -s / 2, r = -n / 2, l = o.corner_radius !== void 0 ? o.corner_radius : e.corner_radius ?? 0, c = e.orientation || "vertical", f = e.items || [], u = e.itemGap ?? 10, h = e.itemHeight ?? 50, d = e.itemWidth ?? 200, p = e.scrollOffset ?? 0, y = e.padding ?? 0, m = e.glassEffect !== !1, b = e.accentColor || "#3b82f6", v = e.itemTextColor || "#333333", S = e.itemBackgroundColor || "#ffffff", C = e.hoveredIndex ?? null, w = e.activeItemIndex ?? null, I = e.glowIntensity ?? 0, M = e.glowColor || "#3b82f6", k = typeof M == "string" ? M : M.color || (($ = (B = M.stops) == null ? void 0 : B[0]) == null ? void 0 : $.color) || "#3b82f6", T = e.opacity !== void 0 ? e.opacity : i.opacity !== void 0 ? i.opacity : 1;
5103
+ const o = this.objectStates.get(i.id) || {}, e = o.options || i.options || {}, s = o.width !== void 0 ? o.width : ((O = i.geometry) == null ? void 0 : O.width) || 200, n = o.height !== void 0 ? o.height : ((W = i.geometry) == null ? void 0 : W.height) || 300, a = -s / 2, r = -n / 2, c = o.corner_radius !== void 0 ? o.corner_radius : e.corner_radius ?? 0, l = e.orientation || "vertical", f = e.items || [], u = e.itemGap ?? 10, h = e.itemHeight ?? 50, d = e.itemWidth ?? 200, p = e.scrollOffset ?? 0, y = e.padding ?? 0, m = e.glassEffect !== !1, b = e.accentColor || "#3b82f6", v = e.itemTextColor || "#333333", S = e.itemBackgroundColor || "#ffffff", C = e.hoveredIndex ?? null, w = e.activeItemIndex ?? null, I = e.glowIntensity ?? 0, M = e.glowColor || "#3b82f6", k = typeof M == "string" ? M : M.color || (($ = (B = M.stops) == null ? void 0 : B[0]) == null ? void 0 : $.color) || "#3b82f6", T = e.opacity !== void 0 ? e.opacity : i.opacity !== void 0 ? i.opacity : 1;
5104
5104
  if (t.save(), t.globalAlpha *= T, I > 0) {
5105
5105
  const Y = t.getTransform(), H = Math.sqrt(Y.a * Y.a + Y.b * Y.b) || 1;
5106
5106
  t.shadowColor = k, t.shadowBlur = I * 2 * H, t.shadowOffsetX = 0, t.shadowOffsetY = 0;
5107
5107
  }
5108
5108
  if (m) {
5109
5109
  const Y = e.listBackgroundColor || "rgba(31, 41, 55, 0.4)", H = this.createCanvasFill(t, Y, s, n);
5110
- t.fillStyle = H || "rgba(31, 41, 55, 0.4)", t.beginPath(), this.drawCustomShape(t, e.containerShape || "rectangle", e.containerPath || "", a, r, s, n, l) || t.fill();
5110
+ t.fillStyle = H || "rgba(31, 41, 55, 0.4)", t.beginPath(), this.drawCustomShape(t, e.containerShape || "rectangle", e.containerPath || "", a, r, s, n, c) || t.fill();
5111
5111
  const A = t.createLinearGradient(a, r, a + s, r + n);
5112
- A.addColorStop(0, "rgba(255, 255, 255, 0.15)"), A.addColorStop(0.5, "rgba(255, 255, 255, 0.08)"), A.addColorStop(1, "rgba(255, 255, 255, 0.03)"), t.fillStyle = A, t.beginPath(), this.drawCustomShape(t, e.containerShape || "rectangle", e.containerPath || "", a, r, s, n, l) || t.fill(), t.strokeStyle = "rgba(255, 255, 255, 0.25)", t.lineWidth = 1, t.beginPath(), this.drawCustomShape(t, e.containerShape || "rectangle", e.containerPath || "", a, r, s, n, l) || t.stroke();
5112
+ A.addColorStop(0, "rgba(255, 255, 255, 0.15)"), A.addColorStop(0.5, "rgba(255, 255, 255, 0.08)"), A.addColorStop(1, "rgba(255, 255, 255, 0.03)"), t.fillStyle = A, t.beginPath(), this.drawCustomShape(t, e.containerShape || "rectangle", e.containerPath || "", a, r, s, n, c) || t.fill(), t.strokeStyle = "rgba(255, 255, 255, 0.25)", t.lineWidth = 1, t.beginPath(), this.drawCustomShape(t, e.containerShape || "rectangle", e.containerPath || "", a, r, s, n, c) || t.stroke();
5113
5113
  } else {
5114
5114
  const Y = e.backgroundColor || e.listBackgroundColor || "transparent", H = this.createCanvasFill(t, Y, s, n);
5115
5115
  if (H) {
5116
5116
  t.fillStyle = H, t.beginPath();
5117
- const A = this.drawCustomShape(t, e.containerShape || "rectangle", e.containerPath || "", a, r, s, n, l);
5117
+ const A = this.drawCustomShape(t, e.containerShape || "rectangle", e.containerPath || "", a, r, s, n, c);
5118
5118
  t.fill();
5119
5119
  }
5120
5120
  const K = e.borderWidth ?? 0;
5121
5121
  if (K > 0) {
5122
5122
  t.strokeStyle = e.borderColor || "#cccccc", t.lineWidth = K, t.beginPath();
5123
- const A = this.drawCustomShape(t, e.containerShape || "rectangle", e.containerPath || "", a, r, s, n, l);
5123
+ const A = this.drawCustomShape(t, e.containerShape || "rectangle", e.containerPath || "", a, r, s, n, c);
5124
5124
  t.stroke();
5125
5125
  }
5126
5126
  }
5127
5127
  t.shadowBlur = 0, t.save(), t.beginPath();
5128
- const R = this.drawCustomShape(t, e.containerShape || "rectangle", e.containerPath || "", a, r, s, n, l);
5128
+ const x = this.drawCustomShape(t, e.containerShape || "rectangle", e.containerPath || "", a, r, s, n, c);
5129
5129
  if (e.listLayout !== "circular")
5130
- if (R && e.containerShape === "custom")
5130
+ if (x && e.containerShape === "custom")
5131
5131
  try {
5132
5132
  const Y = new Path2D(e.containerPath);
5133
5133
  t.translate(a, r), t.scale(s / 100, n / 100), t.clip(Y), t.scale(100 / s, 100 / n), t.translate(-a, -r);
@@ -5135,16 +5135,16 @@ class ci {
5135
5135
  }
5136
5136
  else
5137
5137
  t.clip();
5138
- const P = typeof y == "number" ? y : c === "vertical" ? y[0] : y[3];
5139
- let E = (c === "vertical" ? r : a) + p + P;
5138
+ const P = typeof y == "number" ? y : l === "vertical" ? y[0] : y[3];
5139
+ let E = (l === "vertical" ? r : a) + p + P;
5140
5140
  if (t.textBaseline = "middle", f.forEach((Y, H) => {
5141
- const K = e.listLayout || "linear", A = K === "circular" ? d : c === "vertical" ? s : d, _ = K === "circular" || c === "vertical" ? h : n;
5141
+ const K = e.listLayout || "linear", A = K === "circular" ? d : l === "vertical" ? s : d, _ = K === "circular" || l === "vertical" ? h : n;
5142
5142
  let L = 0, X = 0, V = 0;
5143
5143
  if (K === "circular") {
5144
- const Tt = f.length || 1, zt = Math.PI * 2 / Tt, Z = e.circularStartAngle || 0, pt = e.circularRadius || 100, Et = p * 0.01 + Z * Math.PI / 180, ut = H * zt + Et, vt = a + s / 2, xt = r + n / 2;
5145
- L = vt + Math.cos(ut) * pt - A / 2, X = xt + Math.sin(ut) * pt - _ / 2, V = ut + (e.itemRotation || 0) * Math.PI / 180;
5144
+ const Tt = f.length || 1, zt = Math.PI * 2 / Tt, Z = e.circularStartAngle || 0, pt = e.circularRadius || 100, Et = p * 0.01 + Z * Math.PI / 180, ut = H * zt + Et, vt = a + s / 2, Rt = r + n / 2;
5145
+ L = vt + Math.cos(ut) * pt - A / 2, X = Rt + Math.sin(ut) * pt - _ / 2, V = ut + (e.itemRotation || 0) * Math.PI / 180;
5146
5146
  } else
5147
- L = c === "vertical" ? a : E, X = c === "vertical" ? E : r, V = (e.itemRotation || 0) * Math.PI / 180;
5147
+ L = l === "vertical" ? a : E, X = l === "vertical" ? E : r, V = (e.itemRotation || 0) * Math.PI / 180;
5148
5148
  const it = C === H, lt = w === H, nt = lt && e.activeItemShape ? e.activeItemShape : e.itemShape || "rectangle", bt = lt && e.activeItemShape ? e.activeItemPath : e.itemPath || "", ht = e.itemCornerRadius || 0;
5149
5149
  if (t.save(), V !== 0 && (t.translate(L + A / 2, X + _ / 2), t.rotate(V), t.translate(-(L + A / 2), -(X + _ / 2))), lt) {
5150
5150
  const Tt = this.createCanvasFill(t, b, A, _);
@@ -5158,17 +5158,17 @@ class ci {
5158
5158
  t.fillStyle = Tt || S, t.beginPath(), this.drawCustomShape(t, nt, bt, L, X, A, _, ht) || (t.rect(L, X, A, _), t.fill());
5159
5159
  }
5160
5160
  if (lt || it) {
5161
- const Tt = this.createCanvasFill(t, b, c === "vertical" ? 3 : A, c === "vertical" ? _ : 3);
5162
- t.fillStyle = Tt || b, c === "vertical" ? t.fillRect(L, X, 3, _) : t.fillRect(L, X + _ - 3, A, 3);
5161
+ const Tt = this.createCanvasFill(t, b, l === "vertical" ? 3 : A, l === "vertical" ? _ : 3);
5162
+ t.fillStyle = Tt || b, l === "vertical" ? t.fillRect(L, X, 3, _) : t.fillRect(L, X + _ - 3, A, 3);
5163
5163
  }
5164
5164
  const wt = lt ? "#ffffff" : m ? "rgba(255, 255, 255, 0.9)" : v;
5165
5165
  t.fillStyle = wt, t.font = lt || it ? "600 14px Inter, sans-serif" : "400 14px Inter, sans-serif";
5166
- const Mt = typeof Y == "string" ? Y : (Y == null ? void 0 : Y.label) || `Item ${H + 1}`, It = L + (c === "vertical" ? 16 : A / 2), Ot = X + _ / 2;
5167
- c === "horizontal" || K === "circular" ? t.textAlign = "center" : t.textAlign = "left";
5166
+ const Mt = typeof Y == "string" ? Y : (Y == null ? void 0 : Y.label) || `Item ${H + 1}`, It = L + (l === "vertical" ? 16 : A / 2), Ot = X + _ / 2;
5167
+ l === "horizontal" || K === "circular" ? t.textAlign = "center" : t.textAlign = "left";
5168
5168
  const At = K === "circular" ? L + A / 2 : It;
5169
- t.fillText(Mt, At, Ot), t.restore(), E += (c === "vertical" ? h : d) + u;
5169
+ t.fillText(Mt, At, Ot), t.restore(), E += (l === "vertical" ? h : d) + u;
5170
5170
  }), t.restore(), e.showScrollbar !== !1) {
5171
- const Y = (f.length || 0) * (c === "vertical" ? h : d) + ((f.length || 0) - 1) * u, H = c === "vertical" ? n : s, K = e.listLayout || "linear", A = e.containerShape === "circle" || K === "circular";
5171
+ const Y = (f.length || 0) * (l === "vertical" ? h : d) + ((f.length || 0) - 1) * u, H = l === "vertical" ? n : s, K = e.listLayout || "linear", A = e.containerShape === "circle" || K === "circular";
5172
5172
  if (Y > H || K === "circular" && f.length > 0) {
5173
5173
  const _ = e.scrollbarColor || "rgba(255,255,255,0.3)", L = e.scrollbarWidth || 4;
5174
5174
  if (A) {
@@ -5183,7 +5183,7 @@ class ci {
5183
5183
  t.stroke();
5184
5184
  } else {
5185
5185
  const X = H / Y, V = H * X, it = -p / Y * H;
5186
- t.fillStyle = _, c === "vertical" ? t.fillRect(a + s - L - 2, r + it, L, V) : t.fillRect(a + it, r + n - L - 2, V, L);
5186
+ t.fillStyle = _, l === "vertical" ? t.fillRect(a + s - L - 2, r + it, L, V) : t.fillRect(a + it, r + n - L - 2, V, L);
5187
5187
  }
5188
5188
  }
5189
5189
  }
@@ -5191,15 +5191,15 @@ class ci {
5191
5191
  }
5192
5192
  drawCustomShape(t, i, o, e, s, n, a, r) {
5193
5193
  if (i === "circle") {
5194
- const l = Math.min(n, a) / 2;
5195
- return t.arc(e + n / 2, s + a / 2, l, 0, Math.PI * 2), !1;
5194
+ const c = Math.min(n, a) / 2;
5195
+ return t.arc(e + n / 2, s + a / 2, c, 0, Math.PI * 2), !1;
5196
5196
  } else if (i === "pill") {
5197
- const l = Math.min(n, a) / 2;
5198
- return this.drawListViewRect(t, e, s, n, a, l), !1;
5197
+ const c = Math.min(n, a) / 2;
5198
+ return this.drawListViewRect(t, e, s, n, a, c), !1;
5199
5199
  } else if (i === "custom" && o)
5200
5200
  try {
5201
- const l = new Path2D(o);
5202
- return t.save(), t.translate(e, s), t.scale(n / 100, a / 100), t.fill(l), t.restore(), !0;
5201
+ const c = new Path2D(o);
5202
+ return t.save(), t.translate(e, s), t.scale(n / 100, a / 100), t.fill(c), t.restore(), !0;
5203
5203
  } catch {
5204
5204
  return this.drawListViewRect(t, e, s, n, a, r), !1;
5205
5205
  }
@@ -5210,10 +5210,10 @@ class ci {
5210
5210
  if (!this._lastPointerPos || !this._prevPointerPos) return;
5211
5211
  const i = t.options || {}, o = i.orientation || "vertical", e = this._lastPointerPos.x - this._prevPointerPos.x, s = this._lastPointerPos.y - this._prevPointerPos.y;
5212
5212
  o === "vertical" ? i.scrollOffset = (i.scrollOffset || 0) + s : i.scrollOffset = (i.scrollOffset || 0) + e;
5213
- const n = i.listLayout || "linear", a = this.objectStates.get(t.id) || {}, r = i.items || [], l = i.itemGap ?? 10, c = i.itemHeight ?? 50, f = i.itemWidth ?? 200, u = a.width !== void 0 ? a.width : ((m = t.geometry) == null ? void 0 : m.width) || 200, h = a.height !== void 0 ? a.height : ((b = t.geometry) == null ? void 0 : b.height) || 300;
5213
+ const n = i.listLayout || "linear", a = this.objectStates.get(t.id) || {}, r = i.items || [], c = i.itemGap ?? 10, l = i.itemHeight ?? 50, f = i.itemWidth ?? 200, u = a.width !== void 0 ? a.width : ((m = t.geometry) == null ? void 0 : m.width) || 200, h = a.height !== void 0 ? a.height : ((b = t.geometry) == null ? void 0 : b.height) || 300;
5214
5214
  if (n === "circular")
5215
5215
  return;
5216
- const d = (r.length || 0) * (o === "vertical" ? c : f) + ((r.length || 0) - 1) * l, y = Math.max(0, d - (o === "vertical" ? h : u) + (i.padding * 2 || 0));
5216
+ const d = (r.length || 0) * (o === "vertical" ? l : f) + ((r.length || 0) - 1) * c, y = Math.max(0, d - (o === "vertical" ? h : u) + (i.padding * 2 || 0));
5217
5217
  i.scrollOffset > 0 && (i.scrollOffset = 0), i.scrollOffset < -y && (i.scrollOffset = -y);
5218
5218
  }
5219
5219
  updateListViewHoverFromPointer(t, i, o) {
@@ -5224,24 +5224,24 @@ class ci {
5224
5224
  var B, $;
5225
5225
  const e = t.options || {}, s = this.objectStates.get(t.id) || {}, n = e.items || [];
5226
5226
  if (n.length === 0) return null;
5227
- const a = s.width !== void 0 ? s.width : ((B = t.geometry) == null ? void 0 : B.width) || 200, r = s.height !== void 0 ? s.height : (($ = t.geometry) == null ? void 0 : $.height) || 300, l = e.orientation || "vertical", c = e.itemGap ?? 10, f = e.itemHeight ?? 50, u = e.itemWidth ?? 200, h = e.scrollOffset ?? 0, d = e.padding ?? 0, p = this.getWorldTransform(t.id), y = i - p.x, m = o - p.y, b = -p.rotation * (Math.PI / 180), v = Math.cos(b), S = Math.sin(b), C = y * v - m * S, w = y * S + m * v, I = -a / 2, M = -r / 2, k = typeof d == "number" ? d : l === "vertical" ? d[0] : d[3];
5228
- let T = (l === "vertical" ? M : I) + h + k;
5229
- const R = e.listLayout || "linear", P = n.length || 1, E = Math.PI * 2 / P, x = e.circularStartAngle || 0, O = e.circularRadius || 100, W = h * 0.01 + x * Math.PI / 180;
5227
+ const a = s.width !== void 0 ? s.width : ((B = t.geometry) == null ? void 0 : B.width) || 200, r = s.height !== void 0 ? s.height : (($ = t.geometry) == null ? void 0 : $.height) || 300, c = e.orientation || "vertical", l = e.itemGap ?? 10, f = e.itemHeight ?? 50, u = e.itemWidth ?? 200, h = e.scrollOffset ?? 0, d = e.padding ?? 0, p = this.getWorldTransform(t.id), y = i - p.x, m = o - p.y, b = -p.rotation * (Math.PI / 180), v = Math.cos(b), S = Math.sin(b), C = y * v - m * S, w = y * S + m * v, I = -a / 2, M = -r / 2, k = typeof d == "number" ? d : c === "vertical" ? d[0] : d[3];
5228
+ let T = (c === "vertical" ? M : I) + h + k;
5229
+ const x = e.listLayout || "linear", P = n.length || 1, E = Math.PI * 2 / P, R = e.circularStartAngle || 0, O = e.circularRadius || 100, W = h * 0.01 + R * Math.PI / 180;
5230
5230
  for (let Y = 0; Y < n.length; Y++) {
5231
- const H = R === "circular" ? u : l === "vertical" ? a : u, K = R === "circular" || l === "vertical" ? f : r;
5231
+ const H = x === "circular" ? u : c === "vertical" ? a : u, K = x === "circular" || c === "vertical" ? f : r;
5232
5232
  let A = 0, _ = 0, L = 0;
5233
- if (R === "circular") {
5233
+ if (x === "circular") {
5234
5234
  const X = Y * E + W, V = I + a / 2, it = M + r / 2;
5235
5235
  A = V + Math.cos(X) * O - H / 2, _ = it + Math.sin(X) * O - K / 2, L = X + (e.itemRotation || 0) * Math.PI / 180;
5236
5236
  } else
5237
- A = l === "vertical" ? I : T, _ = l === "vertical" ? T : M, L = (e.itemRotation || 0) * Math.PI / 180;
5237
+ A = c === "vertical" ? I : T, _ = c === "vertical" ? T : M, L = (e.itemRotation || 0) * Math.PI / 180;
5238
5238
  if (L !== 0) {
5239
5239
  const X = A + H / 2, V = _ + K / 2, it = C - X, lt = w - V, nt = -L, bt = it * Math.cos(nt) - lt * Math.sin(nt) + X, ht = it * Math.sin(nt) + lt * Math.cos(nt) + V;
5240
5240
  if (bt >= A && bt <= A + H && ht >= _ && ht <= _ + K)
5241
5241
  return Y;
5242
5242
  } else if (C >= A && C <= A + H && w >= _ && w <= _ + K)
5243
5243
  return Y;
5244
- T += (l === "vertical" ? f : u) + c;
5244
+ T += (c === "vertical" ? f : u) + l;
5245
5245
  }
5246
5246
  return null;
5247
5247
  }
@@ -5259,28 +5259,28 @@ class ci {
5259
5259
  if (!e.behaviors || e.behaviors.length === 0) return;
5260
5260
  const s = this.objectStates.get(e.id);
5261
5261
  s && e.behaviors.forEach((n) => {
5262
- var u, h, d, p, y, m, b, v, S, C, w, I, M, k, T, R, P, E, x, O, W, B, $, Y, H, K, A, _, L, X, V, it, lt, nt, bt, ht, wt, Mt, It, Ot, At, Tt, zt, Z, pt, Et, ut, vt, xt, Xt, Bt, Dt, Ht, te, ue, pe, Qt, me, _e, ye, Se, Pe, ae, ee, at, gt, j, z, D, et, mt, Pt, Ct, Wt, yt, F, Lt, jt, Vt, ce, Rt, ft, ct, tt, dt, G, st, J, Ft, Ut, se, Yt, qt, Nt, Ce, Ee, Ae, Oe, Re, xe, $e, Gt, ie, be, Le, Fe, he, re, le, we, We, Ge, De, Be, ze, Ve, Ze, je;
5262
+ var u, h, d, p, y, m, b, v, S, C, w, I, M, k, T, x, P, E, R, O, W, B, $, Y, H, K, A, _, L, X, V, it, lt, nt, bt, ht, wt, Mt, It, Ot, At, Tt, zt, Z, pt, Et, ut, vt, Rt, Xt, Bt, Dt, Ht, te, ue, pe, Qt, me, _e, ye, Se, Pe, ae, ee, at, gt, j, z, D, et, mt, Pt, Ct, Wt, yt, F, Lt, jt, Vt, ce, xt, ft, ct, tt, dt, G, st, J, Ft, Ut, se, Yt, qt, Nt, Ce, Ee, Ae, Oe, xe, Re, $e, Gt, ie, be, Le, Fe, he, re, le, we, We, Ge, De, Be, ze, Ve, Ze, je;
5263
5263
  if (!n.enabled) return;
5264
5264
  const a = n.startTime || 0, r = n.endTime || 1 / 0;
5265
5265
  if (this.currentTime < a || this.currentTime > r) return;
5266
- const l = s.x - i, c = s.y - o, f = Math.sqrt(l * l + c * c);
5266
+ const c = s.x - i, l = s.y - o, f = Math.sqrt(c * c + l * l);
5267
5267
  if (this.frameCount % 240 === 0 && Math.random() < 0.1 && this.log(`[ExodeUI] Executing ${n.type} on ${e.name}`), n.type === N.Proximity) {
5268
5268
  const U = ((u = n.settings) == null ? void 0 : u.radius) || 300, Q = ((h = n.settings) == null ? void 0 : h.falloff) || "smooth";
5269
5269
  let q = 0;
5270
5270
  f < U && (Q === "linear" ? q = 1 - f / U : q = Math.pow(1 - f / U, 2)), n.sensors.forEach((rt) => {
5271
- this.applyBehaviorSensor(s, rt, q, t, n.settings, e, l, c, f);
5271
+ this.applyBehaviorSensor(s, rt, q, t, n.settings, e, c, l, f);
5272
5272
  });
5273
5273
  } else if (n.type === N.Magnetic) {
5274
5274
  const U = ((d = n.settings) == null ? void 0 : d.radius) || 400, Q = ((p = n.settings) == null ? void 0 : p.strength) || 0.5;
5275
5275
  if (f < U && f > 5) {
5276
- const q = 1 - f / U, rt = l * q * Q, kt = c * q * Q;
5276
+ const q = 1 - f / U, rt = c * q * Q, kt = l * q * Q;
5277
5277
  s.x -= rt * t * 10, s.y -= kt * t * 10;
5278
5278
  }
5279
5279
  } else if (n.type === N.Repel) {
5280
5280
  const U = ((y = n.settings) == null ? void 0 : y.radius) || 300, Q = ((m = n.settings) == null ? void 0 : m.strength) || 1;
5281
5281
  if (f < U) {
5282
5282
  const q = Math.pow(1 - f / U, 2);
5283
- s.x += l / (f || 1) * q * 60 * Q * t * 5, s.y += c / (f || 1) * q * 60 * Q * t * 5;
5283
+ s.x += c / (f || 1) * q * 60 * Q * t * 5, s.y += l / (f || 1) * q * 60 * Q * t * 5;
5284
5284
  }
5285
5285
  } else if (n.type === N.Orbit) {
5286
5286
  const U = ((b = n.settings) == null ? void 0 : b.speed) || 1, Q = ((v = n.settings) == null ? void 0 : v.radius) || 30, q = this.currentTime * U * Math.PI * 2;
@@ -5288,13 +5288,13 @@ class ci {
5288
5288
  } else if (n.type === N.Vortex) {
5289
5289
  const U = ((S = n.settings) == null ? void 0 : S.radius) || 400, Q = ((C = n.settings) == null ? void 0 : C.speed) || 2, q = ((w = n.settings) == null ? void 0 : w.strength) || 1;
5290
5290
  if (f < U) {
5291
- const rt = Math.pow(1 - f / U, 1.5), kt = this.currentTime * Q * Math.PI * 2, _t = Math.cos(kt) * 30 - l * 0.4, $t = Math.sin(kt) * 30 - c * 0.4;
5291
+ const rt = Math.pow(1 - f / U, 1.5), kt = this.currentTime * Q * Math.PI * 2, _t = Math.cos(kt) * 30 - c * 0.4, $t = Math.sin(kt) * 30 - l * 0.4;
5292
5292
  s.x += _t * rt * q * t * 5, s.y += $t * rt * q * t * 5, s.rotation += 5 * rt * q * t * 5, s.scale_x *= 1 - rt * 0.1 * q * t, s.scale_y *= 1 - rt * 0.1 * q * t;
5293
5293
  }
5294
5294
  } else if (n.type === N.Fluid) {
5295
5295
  const U = ((I = n.settings) == null ? void 0 : I.radius) || 300, Q = ((M = n.settings) == null ? void 0 : M.strength) || 1;
5296
5296
  if (f < U) {
5297
- const q = Math.pow(1 - f / U, 1.2), rt = l / (f || 1) * q * 1.2 * Q, kt = c / (f || 1) * q * 1.2 * Q;
5297
+ const q = Math.pow(1 - f / U, 1.2), rt = c / (f || 1) * q * 1.2 * Q, kt = l / (f || 1) * q * 1.2 * Q;
5298
5298
  s.x += rt * 10 * t * 5, s.y += kt * 10 * t * 5, s.scale_x *= 1 + q * 0.3 * Q * t, s.scale_y *= 1 + q * 0.3 * Q * t;
5299
5299
  }
5300
5300
  } else if (n.type === N.Elastic) {
@@ -5304,7 +5304,7 @@ class ci {
5304
5304
  s.scale_x *= 1 + q * 0.4 * Q * t, s.scale_y *= 1 + q * 0.4 * Q * t;
5305
5305
  }
5306
5306
  } else if (n.type === N.Holographic) {
5307
- const U = s.x - this.canvasWidth / 2, Q = s.y - this.canvasHeight / 2, q = ((R = n.settings) == null ? void 0 : R.factor) || 25;
5307
+ const U = s.x - this.canvasWidth / 2, Q = s.y - this.canvasHeight / 2, q = ((x = n.settings) == null ? void 0 : x.factor) || 25;
5308
5308
  if (s.x -= U / 1e3 * q * t * 5, s.y -= Q / 1e3 * q * t * 5, s.style) {
5309
5309
  const rt = 1 - Math.min(1, f / 400);
5310
5310
  s.style.exposure = (s.style.exposure || 1) + rt * 0.5 * t;
@@ -5313,10 +5313,10 @@ class ci {
5313
5313
  const U = ((P = n.settings) == null ? void 0 : P.radius) || 80, Q = ((E = n.settings) == null ? void 0 : E.strength) || 1;
5314
5314
  if (f < U) {
5315
5315
  const q = Math.pow(1 - f / U, 2);
5316
- s.x -= l * q * Q * t * 10, s.y -= c * q * Q * t * 10, s.scale_x *= 1 - q * 0.1 * Q * t, s.scale_y *= 1 - q * 0.1 * Q * t;
5316
+ s.x -= c * q * Q * t * 10, s.y -= l * q * Q * t * 10, s.scale_x *= 1 - q * 0.1 * Q * t, s.scale_y *= 1 - q * 0.1 * Q * t;
5317
5317
  }
5318
5318
  } else if (n.type === N.Dilation) {
5319
- const U = ((x = n.settings) == null ? void 0 : x.size) || 120, Q = ((O = n.settings) == null ? void 0 : O.strength) || 1;
5319
+ const U = ((R = n.settings) == null ? void 0 : R.size) || 120, Q = ((O = n.settings) == null ? void 0 : O.strength) || 1;
5320
5320
  if (f < U) {
5321
5321
  const q = 1 - f / U;
5322
5322
  s.scale_x *= 1 + q * 0.5 * Q * t, s.scale_y *= 1 + q * 0.5 * Q * t;
@@ -5326,7 +5326,7 @@ class ci {
5326
5326
  s.x = this.lerp(s.x ?? ((A = e.transform) == null ? void 0 : A.x) ?? 0, Zt, ge), s.y = this.lerp(s.y ?? ((_ = e.transform) == null ? void 0 : _.y) ?? 0, fe, ge), s.rotate_x = this.lerp(s.rotate_x ?? ((L = e.transform) == null ? void 0 : L.rotate_x) ?? 0, Ie, ge), s.rotate_y = this.lerp(s.rotate_y ?? ((X = e.transform) == null ? void 0 : X.rotate_y) ?? 0, ne, ge);
5327
5327
  } else if (n.type === N.Fold) {
5328
5328
  if (f < 300) {
5329
- const U = 1 - f / 300, Q = (l > 0 ? -1 : 1) * U * 10, q = 1 - U * 0.1, rt = c / 300 * U * 20, kt = -(l / 300) * U * 20, _t = Math.min(1, 10 * t);
5329
+ const U = 1 - f / 300, Q = (c > 0 ? -1 : 1) * U * 10, q = 1 - U * 0.1, rt = l / 300 * U * 20, kt = -(c / 300) * U * 20, _t = Math.min(1, 10 * t);
5330
5330
  s.skew_x = this.lerp(s.skew_x ?? ((V = e.transform) == null ? void 0 : V.skew_x) ?? 0, Q, _t), s.scale_y = this.lerp(s.scale_y ?? ((it = e.transform) == null ? void 0 : it.scale_y) ?? 1, (((lt = e.transform) == null ? void 0 : lt.scale_y) ?? 1) * q, _t), s.rotate_x = this.lerp(s.rotate_x ?? ((nt = e.transform) == null ? void 0 : nt.rotate_x) ?? 0, rt, _t), s.rotate_y = this.lerp(s.rotate_y ?? ((bt = e.transform) == null ? void 0 : bt.rotate_y) ?? 0, kt, _t), s.style = s.style || { ...e.style }, s.style.artEffect = { enabled: !0, type: "fold_overlay", intensity: ((ht = n.settings) == null ? void 0 : ht.opacity) ?? 0.5 };
5331
5331
  }
5332
5332
  } else if (n.type === N.Crumple) {
@@ -5338,7 +5338,7 @@ class ci {
5338
5338
  const U = ((Z = n.settings) == null ? void 0 : Z.strength) || 0.8;
5339
5339
  f < (e.width || 100) && this.isMouseDown ? (s.scale_y = this.lerp(s.scale_y ?? 1, (((pt = e.transform) == null ? void 0 : pt.scale_y) ?? 1) * U, 0.3), s.scale_x = this.lerp(s.scale_x ?? 1, (((Et = e.transform) == null ? void 0 : Et.scale_x) ?? 1) * (1 + (1 - U) * 0.4), 0.3)) : (s.scale_y = this.lerp(s.scale_y ?? 1, ((ut = e.transform) == null ? void 0 : ut.scale_y) ?? 1, 0.2), s.scale_x = this.lerp(s.scale_x ?? 1, ((vt = e.transform) == null ? void 0 : vt.scale_x) ?? 1, 0.2));
5340
5340
  } else if (n.type === N.TextCounter) {
5341
- const U = ((xt = n.settings) == null ? void 0 : xt.duration) || 2, Q = ((Xt = n.settings) == null ? void 0 : Xt.from) || 0, q = ((Bt = n.settings) == null ? void 0 : Bt.to) || 100;
5341
+ const U = ((Rt = n.settings) == null ? void 0 : Rt.duration) || 2, Q = ((Xt = n.settings) == null ? void 0 : Xt.from) || 0, q = ((Bt = n.settings) == null ? void 0 : Bt.to) || 100;
5342
5342
  n._runtimeStart === void 0 && (n._runtimeStart = this.currentTime);
5343
5343
  const rt = this.currentTime - n._runtimeStart, kt = Math.min(1, rt / U), _t = Math.floor(Q + (q - Q) * kt);
5344
5344
  if (((Dt = e.geometry) == null ? void 0 : Dt.type) === "Text") {
@@ -5368,7 +5368,7 @@ class ci {
5368
5368
  const U = ((Ct = n.settings) == null ? void 0 : Ct.axis) || "vertical", Q = ((Wt = n.settings) == null ? void 0 : Wt.factor) || 0.5, q = ((yt = n.settings) == null ? void 0 : yt.strength) || 1, rt = ((F = n.settings) == null ? void 0 : F.scaleFactor) || 0;
5369
5369
  (U === "vertical" || U === "both") && (s.y += this.scrollOffset.y * Q * q * t), (U === "horizontal" || U === "both") && (s.x += this.scrollOffset.x * Q * q * t), rt !== 0 && (s.scale_x *= 1 + this.scrollOffset.y * rt * t, s.scale_y *= 1 + this.scrollOffset.y * rt * t);
5370
5370
  } else if (n.type === N.LookAt) {
5371
- const U = ((Lt = n.settings) == null ? void 0 : Lt.factor) || 1, Q = ((jt = n.settings) == null ? void 0 : jt.strength) || 1, q = Math.atan2(-c, -l) * (180 / Math.PI), rt = s.rotation, kt = (q - rt + 180) % 360 - 180;
5371
+ const U = ((Lt = n.settings) == null ? void 0 : Lt.factor) || 1, Q = ((jt = n.settings) == null ? void 0 : jt.strength) || 1, q = Math.atan2(-l, -c) * (180 / Math.PI), rt = s.rotation, kt = (q - rt + 180) % 360 - 180;
5372
5372
  s.rotation += kt * U * Q * t * 10;
5373
5373
  } else if (n.type === N.Scan) {
5374
5374
  const U = (((Vt = n.settings) == null ? void 0 : Vt.speed) || 1) * 4e-3, Q = ((ce = n.settings) == null ? void 0 : ce.strength) || 1, q = (Math.sin(Date.now() * U) + 1) / 2;
@@ -5377,7 +5377,7 @@ class ci {
5377
5377
  s.style = s.style || { ...e.style }, s.style.artEffect = {
5378
5378
  enabled: !0,
5379
5379
  type: "glint_overlay",
5380
- intensity: ((Rt = n.settings) == null ? void 0 : Rt.strength) ?? 0.8
5380
+ intensity: ((xt = n.settings) == null ? void 0 : xt.strength) ?? 0.8
5381
5381
  };
5382
5382
  else if (n.type === N.Ratchet) {
5383
5383
  const U = ((ft = n.settings) == null ? void 0 : ft.steps) || 12, Q = (((ct = n.settings) == null ? void 0 : ct.speed) || 1) * 30, q = Math.floor(s.rotation / (360 / U)) * (360 / U);
@@ -5415,7 +5415,7 @@ class ci {
5415
5415
  const q = Math.pow(1 - f / U, 2);
5416
5416
  s.scale_x = this.lerp(s.scale_x ?? 1, (((Ae = e.transform) == null ? void 0 : Ae.scale_x) ?? 1) * (1 + q * Q), 0.2), s.scale_y = this.lerp(s.scale_y ?? 1, (((Oe = e.transform) == null ? void 0 : Oe.scale_y) ?? 1) * (1 + q * Q), 0.2);
5417
5417
  } else
5418
- s.scale_x = this.lerp(s.scale_x ?? 1, ((Re = e.transform) == null ? void 0 : Re.scale_x) ?? 1, 0.1), s.scale_y = this.lerp(s.scale_y ?? 1, ((xe = e.transform) == null ? void 0 : xe.scale_y) ?? 1, 0.1);
5418
+ s.scale_x = this.lerp(s.scale_x ?? 1, ((xe = e.transform) == null ? void 0 : xe.scale_x) ?? 1, 0.1), s.scale_y = this.lerp(s.scale_y ?? 1, ((Re = e.transform) == null ? void 0 : Re.scale_y) ?? 1, 0.1);
5419
5419
  } else if (n.type === N.LayoutAnimation) {
5420
5420
  const U = (($e = n.settings) == null ? void 0 : $e.watchProperties) || ["x", "y", "scale_x", "scale_y", "opacity", "rotation"], Q = ((Gt = n.settings) == null ? void 0 : Gt.duration) || 0.3;
5421
5421
  this._layoutAnimCache.has(e.id) || this._layoutAnimCache.set(e.id, /* @__PURE__ */ new Map());
@@ -5547,88 +5547,88 @@ class ci {
5547
5547
  });
5548
5548
  });
5549
5549
  }
5550
- applyBehaviorSensor(t, i, o, e, s, n, a = 0, r = 0, l = 1) {
5551
- var d, p, y, m, b, v, S, C, w, I, M, k, T, R, P, E, x, O, W, B, $, Y, H, K;
5552
- const c = (s == null ? void 0 : s.intensity) || (s == null ? void 0 : s.strength) || 1, f = Math.min(1, 15 * e), u = l > 0 ? a / l : 0, h = l > 0 ? r / l : 0;
5550
+ applyBehaviorSensor(t, i, o, e, s, n, a = 0, r = 0, c = 1) {
5551
+ var d, p, y, m, b, v, S, C, w, I, M, k, T, x, P, E, R, O, W, B, $, Y, H, K;
5552
+ const l = (s == null ? void 0 : s.intensity) || (s == null ? void 0 : s.strength) || 1, f = Math.min(1, 15 * e), u = c > 0 ? a / c : 0, h = c > 0 ? r / c : 0;
5553
5553
  switch (i) {
5554
5554
  case Kt.Scale: {
5555
- const A = ((d = n == null ? void 0 : n.transform) == null ? void 0 : d.scale_x) ?? 1, _ = ((p = n == null ? void 0 : n.transform) == null ? void 0 : p.scale_y) ?? 1, L = A * (1 + o * c * 0.4), X = _ * (1 + o * c * 0.4);
5555
+ const A = ((d = n == null ? void 0 : n.transform) == null ? void 0 : d.scale_x) ?? 1, _ = ((p = n == null ? void 0 : n.transform) == null ? void 0 : p.scale_y) ?? 1, L = A * (1 + o * l * 0.4), X = _ * (1 + o * l * 0.4);
5556
5556
  t.scale_x = (t.scale_x ?? A) * (1 - f) + L * f, t.scale_y = (t.scale_y ?? _) * (1 - f) + X * f;
5557
5557
  break;
5558
5558
  }
5559
5559
  case Kt.Opacity: {
5560
- const A = ((y = n == null ? void 0 : n.transform) == null ? void 0 : y.opacity) ?? 100, _ = Math.max(0, Math.min(100, A - o * c * 100));
5560
+ const A = ((y = n == null ? void 0 : n.transform) == null ? void 0 : y.opacity) ?? 100, _ = Math.max(0, Math.min(100, A - o * l * 100));
5561
5561
  t.opacity = (t.opacity ?? A) * (1 - f) + _ * f;
5562
5562
  break;
5563
5563
  }
5564
5564
  case Kt.RotateZ: {
5565
- const A = ((m = n == null ? void 0 : n.transform) == null ? void 0 : m.rotation) ?? 0, _ = A + o * c * 45;
5565
+ const A = ((m = n == null ? void 0 : n.transform) == null ? void 0 : m.rotation) ?? 0, _ = A + o * l * 45;
5566
5566
  t.rotation = (t.rotation ?? A) * (1 - f) + _ * f;
5567
5567
  break;
5568
5568
  }
5569
5569
  case Kt.RotateX: {
5570
- const A = ((b = n == null ? void 0 : n.transform) == null ? void 0 : b.rotate_x) ?? 0, _ = A - h * o * c * 60;
5570
+ const A = ((b = n == null ? void 0 : n.transform) == null ? void 0 : b.rotate_x) ?? 0, _ = A - h * o * l * 60;
5571
5571
  t.rotate_x = (t.rotate_x ?? A) * (1 - f) + _ * f;
5572
5572
  break;
5573
5573
  }
5574
5574
  case Kt.RotateY: {
5575
- const A = ((v = n == null ? void 0 : n.transform) == null ? void 0 : v.rotate_y) ?? 0, _ = A + u * o * c * 60;
5575
+ const A = ((v = n == null ? void 0 : n.transform) == null ? void 0 : v.rotate_y) ?? 0, _ = A + u * o * l * 60;
5576
5576
  t.rotate_y = (t.rotate_y ?? A) * (1 - f) + _ * f;
5577
5577
  break;
5578
5578
  }
5579
5579
  case Kt.PositionX: {
5580
- const A = ((S = n == null ? void 0 : n.transform) == null ? void 0 : S.x) ?? 0, _ = A - u * o * c * 40;
5580
+ const A = ((S = n == null ? void 0 : n.transform) == null ? void 0 : S.x) ?? 0, _ = A - u * o * l * 40;
5581
5581
  t.x = (t.x ?? A) * (1 - f) + _ * f;
5582
5582
  break;
5583
5583
  }
5584
5584
  case Kt.PositionY: {
5585
- const A = ((C = n == null ? void 0 : n.transform) == null ? void 0 : C.y) ?? 0, _ = A - h * o * c * 40;
5585
+ const A = ((C = n == null ? void 0 : n.transform) == null ? void 0 : C.y) ?? 0, _ = A - h * o * l * 40;
5586
5586
  t.y = (t.y ?? A) * (1 - f) + _ * f;
5587
5587
  break;
5588
5588
  }
5589
5589
  case Kt.SkewX: {
5590
- const A = ((w = n == null ? void 0 : n.transform) == null ? void 0 : w.skew_x) ?? 0, _ = A + u * o * c * 45;
5590
+ const A = ((w = n == null ? void 0 : n.transform) == null ? void 0 : w.skew_x) ?? 0, _ = A + u * o * l * 45;
5591
5591
  t.skew_x = (t.skew_x ?? A) * (1 - f) + _ * f, t.skew_x > 85 && (t.skew_x = 85), t.skew_x < -85 && (t.skew_x = -85);
5592
5592
  break;
5593
5593
  }
5594
5594
  case Kt.Blur: {
5595
5595
  t.style || (t.style = { ...n == null ? void 0 : n.style }), t.style.blur || (t.style.blur = { ...(I = n == null ? void 0 : n.style) == null ? void 0 : I.blur });
5596
- const A = ((k = (M = n == null ? void 0 : n.style) == null ? void 0 : M.blur) == null ? void 0 : k.amount) || 0, _ = A + o * ((s == null ? void 0 : s.blur) || 20) * c;
5596
+ const A = ((k = (M = n == null ? void 0 : n.style) == null ? void 0 : M.blur) == null ? void 0 : k.amount) || 0, _ = A + o * ((s == null ? void 0 : s.blur) || 20) * l;
5597
5597
  t.style.blur.amount = (t.style.blur.amount ?? A) * (1 - f) + _ * f;
5598
5598
  break;
5599
5599
  }
5600
5600
  case Kt.Exposure: {
5601
5601
  t.style || (t.style = { ...n == null ? void 0 : n.style }), t.style.adjustments || (t.style.adjustments = { ...(T = n == null ? void 0 : n.style) == null ? void 0 : T.adjustments });
5602
- const A = ((P = (R = n == null ? void 0 : n.style) == null ? void 0 : R.adjustments) == null ? void 0 : P.exposure) || 0, _ = A + o * ((s == null ? void 0 : s.exposure) || 50) * c;
5602
+ const A = ((P = (x = n == null ? void 0 : n.style) == null ? void 0 : x.adjustments) == null ? void 0 : P.exposure) || 0, _ = A + o * ((s == null ? void 0 : s.exposure) || 50) * l;
5603
5603
  t.style.adjustments.exposure = (t.style.adjustments.exposure ?? A) * (1 - f) + _ * f;
5604
5604
  break;
5605
5605
  }
5606
5606
  case Kt.HueShift: {
5607
5607
  t.style || (t.style = { ...n == null ? void 0 : n.style }), t.style.adjustments || (t.style.adjustments = { ...(E = n == null ? void 0 : n.style) == null ? void 0 : E.adjustments });
5608
- const A = ((O = (x = n == null ? void 0 : n.style) == null ? void 0 : x.adjustments) == null ? void 0 : O.hue) || 0, _ = A + o * ((s == null ? void 0 : s.hue) || 180) * c;
5608
+ const A = ((O = (R = n == null ? void 0 : n.style) == null ? void 0 : R.adjustments) == null ? void 0 : O.hue) || 0, _ = A + o * ((s == null ? void 0 : s.hue) || 180) * l;
5609
5609
  t.style.adjustments.hue = (t.style.adjustments.hue ?? A) * (1 - f) + _ * f;
5610
5610
  break;
5611
5611
  }
5612
5612
  case Kt.Negative: {
5613
5613
  t.style || (t.style = { ...n == null ? void 0 : n.style }), t.style.adjustments || (t.style.adjustments = { ...(W = n == null ? void 0 : n.style) == null ? void 0 : W.adjustments });
5614
- const A = (($ = (B = n == null ? void 0 : n.style) == null ? void 0 : B.adjustments) == null ? void 0 : $.negative) || 0, _ = A + o * ((s == null ? void 0 : s.negative) || 100) * c;
5614
+ const A = (($ = (B = n == null ? void 0 : n.style) == null ? void 0 : B.adjustments) == null ? void 0 : $.negative) || 0, _ = A + o * ((s == null ? void 0 : s.negative) || 100) * l;
5615
5615
  t.style.adjustments.negative = (t.style.adjustments.negative ?? A) * (1 - f) + _ * f;
5616
5616
  break;
5617
5617
  }
5618
5618
  case Kt.CornerRadius: {
5619
- const A = ((Y = n == null ? void 0 : n.transform) == null ? void 0 : Y.corner_radius) || 0, _ = A + o * c * 50;
5619
+ const A = ((Y = n == null ? void 0 : n.transform) == null ? void 0 : Y.corner_radius) || 0, _ = A + o * l * 50;
5620
5620
  t.corner_radius = (t.corner_radius ?? A) * (1 - f) + _ * f;
5621
5621
  break;
5622
5622
  }
5623
5623
  case Kt.StrokeWidth: {
5624
5624
  t.style || (t.style = { ...n == null ? void 0 : n.style });
5625
- const A = ((H = n == null ? void 0 : n.style) == null ? void 0 : H.borderWidth) || 0, _ = A + o * c * 10;
5625
+ const A = ((H = n == null ? void 0 : n.style) == null ? void 0 : H.borderWidth) || 0, _ = A + o * l * 10;
5626
5626
  t.style.borderWidth = (t.style.borderWidth ?? A) * (1 - f) + _ * f;
5627
5627
  break;
5628
5628
  }
5629
5629
  case Kt.LetterSpacing: {
5630
5630
  t.geometry || (t.geometry = {});
5631
- const A = ((K = n == null ? void 0 : n.geometry) == null ? void 0 : K.letterSpacing) || 0, _ = A + o * c * 10;
5631
+ const A = ((K = n == null ? void 0 : n.geometry) == null ? void 0 : K.letterSpacing) || 0, _ = A + o * l * 10;
5632
5632
  t.geometry.letterSpacing = (t.geometry.letterSpacing ?? A) * (1 - f) + _ * f;
5633
5633
  break;
5634
5634
  }
@@ -5651,12 +5651,12 @@ class ci {
5651
5651
  const s = o.split(".");
5652
5652
  let n = t;
5653
5653
  for (let r = 0; r < s.length - 1; r++) {
5654
- const l = s[r];
5655
- if (n[l] === void 0 || n[l] === null) {
5656
- const c = i, f = s.slice(0, r + 1).reduce((u, h) => u == null ? void 0 : u[h], c);
5657
- n[l] = f !== void 0 ? { ...f } : {};
5654
+ const c = s[r];
5655
+ if (n[c] === void 0 || n[c] === null) {
5656
+ const l = i, f = s.slice(0, r + 1).reduce((u, h) => u == null ? void 0 : u[h], l);
5657
+ n[c] = f !== void 0 ? { ...f } : {};
5658
5658
  }
5659
- n = n[l];
5659
+ n = n[c];
5660
5660
  }
5661
5661
  const a = s[s.length - 1];
5662
5662
  n != null && (n[a] = e);
@@ -5704,9 +5704,9 @@ class ci {
5704
5704
  return o;
5705
5705
  }
5706
5706
  renderFittedImage(t, i, o, e, s, n, a = "cover") {
5707
- const r = i.naturalWidth, l = i.naturalHeight, c = r / l, f = s / n;
5707
+ const r = i.naturalWidth, c = i.naturalHeight, l = r / c, f = s / n;
5708
5708
  let u = s, h = n, d = o, p = e;
5709
- a === "cover" ? c > f ? (u = n * c, d = o - (u - s) / 2) : (h = s / c, p = e - (h - n) / 2) : a === "contain" && (c > f ? (h = s / c, p = e + (n - h) / 2) : (u = n * c, d = o + (s - u) / 2)), t.drawImage(i, d, p, u, h);
5709
+ a === "cover" ? l > f ? (u = n * l, d = o - (u - s) / 2) : (h = s / l, p = e - (h - n) / 2) : a === "contain" && (l > f ? (h = s / l, p = e + (n - h) / 2) : (u = n * l, d = o + (s - u) / 2)), t.drawImage(i, d, p, u, h);
5710
5710
  }
5711
5711
  }
5712
5712
  const yi = Ss(({
@@ -5719,8 +5719,8 @@ const yi = Ss(({
5719
5719
  onReady: n,
5720
5720
  onTrigger: a,
5721
5721
  onInputUpdate: r,
5722
- onComponentChange: l,
5723
- onToggle: c,
5722
+ onComponentChange: c,
5723
+ onToggle: l,
5724
5724
  onInputChange: f,
5725
5725
  onInputFocus: u,
5726
5726
  onInputBlur: h,
@@ -5737,19 +5737,19 @@ const yi = Ss(({
5737
5737
  isMouseDown: M,
5738
5738
  inputs: k,
5739
5739
  interactive: T = !0,
5740
- onNavigation: R
5740
+ onNavigation: x
5741
5741
  }, P) => {
5742
- const E = Me(null), x = Me(null);
5743
- x.current || (x.current = new ci());
5742
+ const E = Me(null), R = Me(null);
5743
+ R.current || (R.current = new ci());
5744
5744
  const O = Me(void 0), W = Me(0), B = Me(null), $ = Me(v), Y = Me(null), [, H] = ds(g || null), K = Me(!0);
5745
5745
  Cs(P, () => E.current), Te(() => (K.current = !0, () => {
5746
5746
  K.current = !1, O.current && cancelAnimationFrame(O.current);
5747
5747
  }), []), Te(() => {
5748
- x.current.setLayout(e, s);
5748
+ R.current.setLayout(e, s);
5749
5749
  }, [e, s]), Te(() => {
5750
- const _ = x.current;
5751
- a && _.setTriggerCallback(a), r && _.setInputUpdateCallback((L, X) => r({ [L]: X })), l && _.setComponentChangeCallback((L) => l(L)), c && _.setToggleCallback(c), f && _.setInputChangeCallback(f), u && _.setInputFocusCallback(u), h && _.setInputBlurCallback(h), d && _.setOnLogCallback((L) => d(L, "info")), p && _.setLogicUpdateCallback(p), y && _.setButtonClickCallback(y), m && _.setGraphPointClickCallback((L) => m(L.objectId, L)), R && _.setNavigationCallback(R);
5752
- }, [a, r, l, c, f, u, h, d, p, y, m, R]), Te(() => {
5750
+ const _ = R.current;
5751
+ a && _.setTriggerCallback(a), r && _.setInputUpdateCallback((L, X) => r({ [L]: X })), c && _.setComponentChangeCallback((L) => c(L)), l && _.setToggleCallback(l), f && _.setInputChangeCallback(f), u && _.setInputFocusCallback(u), h && _.setInputBlurCallback(h), d && _.setOnLogCallback((L) => d(L, "info")), p && _.setLogicUpdateCallback(p), y && _.setButtonClickCallback(y), m && _.setGraphPointClickCallback((L) => m(L.objectId, L)), x && _.setNavigationCallback(x);
5752
+ }, [a, r, c, l, f, u, h, d, p, y, m, x]), Te(() => {
5753
5753
  (async () => {
5754
5754
  let L = g;
5755
5755
  if (t && !g)
@@ -5759,14 +5759,14 @@ const yi = Ss(({
5759
5759
  console.error("[ExodeUI] Failed to load src:", X);
5760
5760
  }
5761
5761
  if (L) {
5762
- const X = x.current, V = L.id || L.name || "default";
5762
+ const X = R.current, V = L.id || L.name || "default";
5763
5763
  (B.current !== V || $.current !== v || Y.current !== L) && (X.load(L), B.current = V, $.current = v, Y.current = L, H(L), W.current = 0, X.advance(0)), n && n(X);
5764
5764
  }
5765
5765
  })();
5766
5766
  }, [g, t, v]), Te(() => {
5767
5767
  const _ = (L) => {
5768
- if (!x.current || !K.current) return;
5769
- const X = x.current, V = E.current;
5768
+ if (!R.current || !K.current) return;
5769
+ const X = R.current, V = E.current;
5770
5770
  if (!V) return;
5771
5771
  const it = V.getContext("2d");
5772
5772
  if (!it) return;
@@ -5787,14 +5787,14 @@ const yi = Ss(({
5787
5787
  O.current && cancelAnimationFrame(O.current);
5788
5788
  };
5789
5789
  }, [o, b]), Te(() => {
5790
- const _ = x.current;
5790
+ const _ = R.current;
5791
5791
  S !== void 0 && _.updateInput("scrollY", S), C !== void 0 && _.updateInput("scrollX", C), w !== void 0 && _.updateInput("mouseX", w), I !== void 0 && _.updateInput("mouseY", I), M !== void 0 && _.updateInput("isMouseDown", M), k && Object.entries(k).forEach(([L, X]) => _.updateInput(L, X));
5792
5792
  }, [S, C, w, I, M, k]);
5793
5793
  const A = (_, L) => {
5794
5794
  if (!T || !E.current) return;
5795
5795
  _.stopPropagation(), "nativeEvent" in _ && _.nativeEvent && typeof _.nativeEvent.stopImmediatePropagation == "function" ? _.nativeEvent.stopImmediatePropagation() : typeof _.stopImmediatePropagation == "function" && _.stopImmediatePropagation();
5796
5796
  const X = E.current, V = X.getBoundingClientRect(), it = _.clientX - V.left, lt = _.clientY - V.top, nt = window.devicePixelRatio || 1;
5797
- (L === "click" || L === "down" || L === "up") && d && d(`[Canvas] Pointer ${L} at rect(${Math.round(it)},${Math.round(lt)}) mapped to buffer(${Math.round(it * nt)},${Math.round(lt * nt)})`, "info"), x.current.handlePointerInput(L, it * nt, lt * nt, X.width, X.height);
5797
+ (L === "click" || L === "down" || L === "up") && d && d(`[Canvas] Pointer ${L} at rect(${Math.round(it)},${Math.round(lt)}) mapped to buffer(${Math.round(it * nt)},${Math.round(lt * nt)})`, "info"), R.current.handlePointerInput(L, it * nt, lt * nt, X.width, X.height);
5798
5798
  };
5799
5799
  return /* @__PURE__ */ ke(
5800
5800
  "canvas",
@@ -5809,9 +5809,9 @@ const yi = Ss(({
5809
5809
  onPointerCancel: (_) => A(_, "up"),
5810
5810
  onClick: (_) => A(_, "click"),
5811
5811
  onWheel: (_) => {
5812
- x.current.handleWheel(_.deltaX, _.deltaY);
5812
+ R.current.handleWheel(_.deltaX, _.deltaY);
5813
5813
  },
5814
- onKeyDown: (_) => x.current.handleKeyDown(_.nativeEvent),
5814
+ onKeyDown: (_) => R.current.handleKeyDown(_.nativeEvent),
5815
5815
  onContextMenu: (_) => _.preventDefault(),
5816
5816
  tabIndex: 0,
5817
5817
  style: {
@@ -5841,9 +5841,9 @@ function bi() {
5841
5841
  g == null || g.setInputStringArray(f, u);
5842
5842
  }, [g]), r = ve((f, u) => {
5843
5843
  g == null || g.updateObjectOptions(f, u);
5844
- }, [g]), l = ve((f, u, h) => {
5844
+ }, [g]), c = ve((f, u, h) => {
5845
5845
  g == null || g.updateConstraint(f, u, h);
5846
- }, [g]), c = ve((f, u) => {
5846
+ }, [g]), l = ve((f, u) => {
5847
5847
  g == null || g.updateGraphData(f, u);
5848
5848
  }, [g]);
5849
5849
  return {
@@ -5856,8 +5856,8 @@ function bi() {
5856
5856
  setInputText: s,
5857
5857
  setInputNumberArray: n,
5858
5858
  setInputStringArray: a,
5859
- updateConstraint: l,
5860
- updateGraphData: c,
5859
+ updateConstraint: c,
5860
+ updateGraphData: l,
5861
5861
  updateObjectOptions: r
5862
5862
  };
5863
5863
  }
@@ -5880,24 +5880,24 @@ const vi = ({ artboard: g, config: t }) => {
5880
5880
  f.length > 0 && (r = f[0].geometry.text);
5881
5881
  }
5882
5882
  r && (e("name", "description", r), e("property", "og:description", r)), i.keywords && i.keywords.length > 0 && e("name", "keywords", i.keywords.join(", "));
5883
- const l = i.ogImage || g.backgroundImage;
5884
- l && e("property", "og:image", l), a && e("property", "og:title", a), e("property", "og:type", "website");
5883
+ const c = i.ogImage || g.backgroundImage;
5884
+ c && e("property", "og:image", c), a && e("property", "og:title", a), e("property", "og:type", "website");
5885
5885
  }, [i, g, o]);
5886
- const e = (a, r, l) => {
5887
- let c = document.querySelector(`meta[${a}="${r}"]`);
5888
- c || (c = document.createElement("meta"), c.setAttribute(a, r), document.head.appendChild(c)), c.setAttribute("content", l);
5886
+ const e = (a, r, c) => {
5887
+ let l = document.querySelector(`meta[${a}="${r}"]`);
5888
+ l || (l = document.createElement("meta"), l.setAttribute(a, r), document.head.appendChild(l)), l.setAttribute("content", c);
5889
5889
  }, s = () => {
5890
5890
  const a = [];
5891
- return a.push(/* @__PURE__ */ ke("h1", { children: i.title || g.name }, "artboard-title")), g.objects.forEach((l, c) => {
5891
+ return a.push(/* @__PURE__ */ ke("h1", { children: i.title || g.name }, "artboard-title")), g.objects.forEach((c, l) => {
5892
5892
  var f, u;
5893
- if (!(l.visible === !1 || l.isVisible === !1))
5894
- if (((f = l.geometry) == null ? void 0 : f.type) === "Text") {
5895
- const h = l.geometry.text;
5896
- h && (l.geometry.fontSize > 24 ? a.push(/* @__PURE__ */ ke("h2", { children: h }, l.id || c)) : a.push(/* @__PURE__ */ ke("p", { children: h }, l.id || c)));
5897
- } else if (((u = l.geometry) == null ? void 0 : u.type) === "Image") {
5898
- const h = l.geometry.src, d = l.altText || l.name || "Illustration";
5899
- a.push(/* @__PURE__ */ ke("img", { src: h, alt: d }, l.id || c));
5900
- } else l.type === "Button" && a.push(/* @__PURE__ */ ke("button", { children: l.name || "Button" }, l.id || c));
5893
+ if (!(c.visible === !1 || c.isVisible === !1))
5894
+ if (((f = c.geometry) == null ? void 0 : f.type) === "Text") {
5895
+ const h = c.geometry.text;
5896
+ h && (c.geometry.fontSize > 24 ? a.push(/* @__PURE__ */ ke("h2", { children: h }, c.id || l)) : a.push(/* @__PURE__ */ ke("p", { children: h }, c.id || l)));
5897
+ } else if (((u = c.geometry) == null ? void 0 : u.type) === "Image") {
5898
+ const h = c.geometry.src, d = c.altText || c.name || "Illustration";
5899
+ a.push(/* @__PURE__ */ ke("img", { src: h, alt: d }, c.id || l));
5900
+ } else c.type === "Button" && a.push(/* @__PURE__ */ ke("button", { children: c.name || "Button" }, c.id || l));
5901
5901
  }), a;
5902
5902
  }, n = i.jsonLd || {
5903
5903
  "@context": "https://schema.org",
@@ -5930,7 +5930,7 @@ const vi = ({ artboard: g, config: t }) => {
5930
5930
  ]
5931
5931
  }
5932
5932
  );
5933
- }, hi = "6.3.30", fi = {
5933
+ }, hi = "6.3.31", fi = {
5934
5934
  version: hi
5935
5935
  }, Si = fi.version;
5936
5936
  export {