exodeui 6.3.37 → 6.3.39

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.
package/dist/index.mjs CHANGED
@@ -40,15 +40,15 @@ function ps(g) {
40
40
  lineHeight: n = 1.2,
41
41
  width: a = 200,
42
42
  letterSpacing: r = 0,
43
- paragraphSpacing: f = 0,
44
- paragraphIndent: h = 0,
43
+ paragraphSpacing: h = 0,
44
+ paragraphIndent: f = 0,
45
45
  textCase: l = "none",
46
46
  segments: p = [],
47
47
  enableSegments: c = !1
48
48
  } = g;
49
49
  let d = String(t || "");
50
50
  l === "uppercase" ? d = d.toUpperCase() : l === "lowercase" ? d = d.toLowerCase() : l === "capitalize" && (d = d.replace(/\b\w/g, (k) => k.toUpperCase())), g.hyphenation === !0 && (d = Ts(d));
51
- const u = `${s} ${e} ${o}px "${i}", sans-serif`, v = `${d}|${u}|${r}|${f}|${h}|${c}|${JSON.stringify(p)}|hyp:${!!g.hyphenation}|comp:${g.composer}|bal:${!!g.balanceRaggedLines}`;
51
+ const u = `${s} ${e} ${o}px "${i}", sans-serif`, v = `${d}|${u}|${r}|${h}|${f}|${c}|${JSON.stringify(p)}|hyp:${!!g.hyphenation}|comp:${g.composer}|bal:${!!g.balanceRaggedLines}`;
52
52
  let b = Ge.get(v);
53
53
  const m = typeof CanvasRenderingContext2D < "u" ? CanvasRenderingContext2D.prototype.measureText : null, y = function(k) {
54
54
  if (!m) return { width: 0, fontBoundingBoxAscent: 0, fontBoundingBoxDescent: 0 };
@@ -107,11 +107,11 @@ function ps(g) {
107
107
  k && Ge.delete(k);
108
108
  }
109
109
  }
110
- if (h > 0 && b && b.widths && !b.indentApplied) {
110
+ if (f > 0 && b && b.widths && !b.indentApplied) {
111
111
  const k = [...b.widths], T = b.fullText || d;
112
112
  let L = !0;
113
113
  for (let P = 0; P < T.length; P++)
114
- L && k[P] !== void 0 && (k[P] += h, L = !1), (T[P] === `
114
+ L && k[P] !== void 0 && (k[P] += f, L = !1), (T[P] === `
115
115
  ` || T[P] === "\r") && (L = !0, T[P] === "\r" && T[P + 1] === `
116
116
  ` && P++);
117
117
  b = { ...b, widths: k, indentApplied: !0 };
@@ -136,12 +136,12 @@ function ps(g) {
136
136
  r !== 0 && m && (CanvasRenderingContext2D.prototype.measureText = m);
137
137
  }
138
138
  let w = (C == null ? void 0 : C.height) !== void 0 && C.height > 0 ? C.height : (((I = C == null ? void 0 : C.lines) == null ? void 0 : I.length) || 0) * S * o;
139
- if (f > 0 && C && C.lines && C.lines.length > 1) {
139
+ if (h > 0 && C && C.lines && C.lines.length > 1) {
140
140
  let k = 0;
141
141
  const T = b.fullText || t;
142
142
  for (let L = 0; L < C.lines.length - 1; L++)
143
143
  k += C.lines[L].text.length, (T[k] === `
144
- ` || T[k] === "\r") && (w += f, k++, T[k - 1] === "\r" && T[k] === `
144
+ ` || T[k] === "\r") && (w += h, k++, T[k - 1] === "\r" && T[k] === `
145
145
  ` && k++);
146
146
  }
147
147
  let M = (C == null ? void 0 : C.lines) || [];
@@ -160,15 +160,15 @@ function is(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, f) => {
163
+ if (e.forEach((r, h) => {
164
164
  if (r.endsWith("px")) {
165
- const h = parseFloat(r);
166
- s[f] = h, n -= h;
167
- } else r.endsWith("fr") ? a += parseFloat(r) : r === "auto" && (s[f] = 100, n -= 100);
165
+ const f = parseFloat(r);
166
+ s[h] = f, n -= f;
167
+ } else r.endsWith("fr") ? a += parseFloat(r) : r === "auto" && (s[h] = 100, n -= 100);
168
168
  }), a > 0 && n > 0) {
169
169
  const r = n / a;
170
- e.forEach((f, h) => {
171
- f.endsWith("fr") && (s[h] = r * parseFloat(f));
170
+ e.forEach((h, f) => {
171
+ h.endsWith("fr") && (s[f] = r * parseFloat(h));
172
172
  });
173
173
  }
174
174
  return s;
@@ -183,7 +183,7 @@ function ns(g, t, i) {
183
183
  }
184
184
  function Es(g, t, i) {
185
185
  var _, E;
186
- const o = g.autoLayout, { direction: e, spacing: s, padding: n, align: a, wrap: r } = o, f = e === "vertical", h = t.map((A) => {
186
+ const o = g.autoLayout, { direction: e, spacing: s, padding: n, align: a, wrap: r } = o, h = e === "vertical", f = t.map((A) => {
187
187
  const W = i(A.id), z = A.geometry;
188
188
  let Y = (W == null ? void 0 : W.width) ?? z.width ?? 100, G = (W == null ? void 0 : W.height) ?? z.height ?? 100;
189
189
  if (z.type === "Ellipse" || z.type === "Polygon" || z.type === "Star") {
@@ -213,35 +213,35 @@ function Es(g, t, i) {
213
213
  const c = ((_ = g.layoutProps) == null ? void 0 : _.width) === "hug", d = ((E = g.layoutProps) == null ? void 0 : E.height) === "hug", u = [];
214
214
  let v = [], b = 0, m = 0;
215
215
  const y = l - n.left - n.right, S = p - n.top - n.bottom;
216
- h.forEach((A) => {
217
- r && v.length > 0 && (f ? m + s + A.h > S : b + s + A.w > y) ? (u.push({ children: v, width: b, height: m }), v = [A], b = A.w, m = A.h) : (v.push(A), f ? (b = Math.max(b, A.w), m += (v.length > 1 ? s : 0) + A.h) : (b += (v.length > 1 ? s : 0) + A.w, m = Math.max(m, A.h)));
218
- }), v.length > 0 && u.push({ children: v, width: b, height: m }), c && !f && (l = Math.max(...u.map((A) => A.width), 0) + n.left + n.right), d && f && (p = Math.max(...u.map((A) => A.height), 0) + n.top + n.bottom);
216
+ f.forEach((A) => {
217
+ r && v.length > 0 && (h ? m + s + A.h > S : b + s + A.w > y) ? (u.push({ children: v, width: b, height: m }), v = [A], b = A.w, m = A.h) : (v.push(A), h ? (b = Math.max(b, A.w), m += (v.length > 1 ? s : 0) + A.h) : (b += (v.length > 1 ? s : 0) + A.w, m = Math.max(m, A.h)));
218
+ }), v.length > 0 && u.push({ children: v, width: b, height: m }), c && !h && (l = Math.max(...u.map((A) => A.width), 0) + n.left + n.right), d && h && (p = Math.max(...u.map((A) => A.height), 0) + n.top + n.bottom);
219
219
  const C = [];
220
220
  let w = n.left, M = n.top;
221
221
  const I = a.toLowerCase(), k = I === "center" || I.endsWith("-center"), T = I.endsWith("-right"), L = I === "center" || I.startsWith("center-"), P = I.startsWith("bottom-");
222
222
  return u.forEach((A) => {
223
223
  let W = w, z = M;
224
- f ? L ? z = n.top + (p - n.top - n.bottom - A.height) / 2 : P && (z = p - n.bottom - A.height) : k ? W = n.left + (l - n.left - n.right - A.width) / 2 : T && (W = l - n.right - A.width), A.children.forEach((Y) => {
224
+ h ? L ? z = n.top + (p - n.top - n.bottom - A.height) / 2 : P && (z = p - n.bottom - A.height) : k ? W = n.left + (l - n.left - n.right - A.width) / 2 : T && (W = l - n.right - A.width), A.children.forEach((Y) => {
225
225
  var F, j;
226
226
  let G = W, N = z;
227
- f ? k ? G += (A.width - Y.w) / 2 : T && (G += A.width - Y.w) : L ? N += (A.height - Y.h) / 2 : P && (N += A.height - Y.h);
227
+ h ? k ? G += (A.width - Y.w) / 2 : T && (G += A.width - Y.w) : L ? N += (A.height - Y.h) / 2 : P && (N += A.height - Y.h);
228
228
  const J = ((F = Y.original.layoutProps) == null ? void 0 : F.width) === "fill", x = ((j = Y.original.layoutProps) == null ? void 0 : j.height) === "fill";
229
229
  C.push({
230
230
  id: Y.id,
231
231
  x: G + Y.w / 2 - l / 2,
232
232
  y: N + Y.h / 2 - p / 2,
233
- width: J && f ? A.width : void 0,
234
- height: x ? f ? void 0 : A.height : void 0
235
- }), f ? z += Y.h + s : W += Y.w + s;
236
- }), f ? w += A.width + s : M += A.height + s;
233
+ width: J && h ? A.width : void 0,
234
+ height: x ? h ? void 0 : A.height : void 0
235
+ }), h ? z += Y.h + s : W += Y.w + s;
236
+ }), h ? w += A.width + s : M += A.height + s;
237
237
  }), { frameWidth: c ? l : void 0, frameHeight: d ? p : 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: f } = o;
243
- let h = g.width, l = g.height;
244
- const p = h - r.left - r.right, c = l - r.top - r.bottom, d = is(e || "1fr", p, n), u = is(s || "auto", c, a), v = d.length > 0 ? d.reduce((T, L) => T + L, 0) + (d.length - 1) * n : 0, b = u.length > 0 ? u.reduce((T, L) => T + L, 0) + (u.length - 1) * a : 0, m = f.toLowerCase(), y = m === "center" || m.endsWith("-center"), S = m.endsWith("-right"), C = m === "center" || m.startsWith("center-"), w = m.startsWith("bottom-");
242
+ const { gridColumns: e, gridRows: s, columnGap: n = 0, rowGap: a = 0, padding: r, align: h } = o;
243
+ let f = g.width, l = g.height;
244
+ const p = f - r.left - r.right, c = l - r.top - r.bottom, d = is(e || "1fr", p, n), u = is(s || "auto", c, a), v = d.length > 0 ? d.reduce((T, L) => T + L, 0) + (d.length - 1) * n : 0, b = u.length > 0 ? u.reduce((T, L) => T + L, 0) + (u.length - 1) * a : 0, m = h.toLowerCase(), y = m === "center" || m.endsWith("-center"), S = m.endsWith("-right"), C = m === "center" || m.startsWith("center-"), w = m.startsWith("bottom-");
245
245
  let M = 0, I = 0;
246
246
  y ? M = (p - v) / 2 : S && (M = p - v), C ? I = (c - b) / 2 : w && (I = c - b);
247
247
  const k = [];
@@ -261,7 +261,7 @@ function As(g, t, i) {
261
261
  let x = W, F = z;
262
262
  y ? x += (E - N) / 2 : S && (x += E - N), C ? F += (A - J) / 2 : w && (F += A - J), k.push({
263
263
  id: T.id,
264
- x: x + N / 2 - h / 2,
264
+ x: x + N / 2 - f / 2,
265
265
  y: F + J / 2 - l / 2,
266
266
  width: ((j = T.layoutProps) == null ? void 0 : j.width) === "fill" ? E : void 0,
267
267
  height: ((X = T.layoutProps) == null ? void 0 : X.height) === "fill" ? A : void 0
@@ -404,8 +404,8 @@ class xs {
404
404
  const e = new qt.Vector2(t.anchorA.x, t.anchorA.y), s = new qt.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, f = t.damping ?? 10;
408
- n = qt.JointData.spring(a, r, f, e, s);
407
+ const a = t.length ?? 100, r = t.stiffness ?? 100, h = t.damping ?? 10;
408
+ n = qt.JointData.spring(a, r, h, e, s);
409
409
  } else
410
410
  n = qt.JointData.revolute(e, s);
411
411
  try {
@@ -430,24 +430,24 @@ class xs {
430
430
  const gs = (g) => g, Ls = (g) => g > 0 ? 1 : 0, Rs = (g) => g < 1 ? 0 : 1, os = (g) => g * g, as = (g) => g * (2 - g), rs = (g) => g < 0.5 ? 2 * g * g : -1 + (4 - 2 * g) * g, Os = (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, Bs = (g) => g * g * g * g, Ws = (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, Ds = (g) => 1 + --g * g * g * g * g, Gs = (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, Ks = (g) => 1 - Math.sqrt(1 - g * g), Js = (g) => Math.sqrt(1 - --g * g), Qs = (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, qe = je * 1.525, ms = je + 1, Zs = (g) => ms * g * g * g - je * g * g, js = (g) => 1 + ms * Math.pow(g - 1, 3) + je * Math.pow(g - 1, 2), ti = (g) => g < 0.5 ? Math.pow(2 * g, 2) * ((qe + 1) * 2 * g - qe) / 2 : (Math.pow(2 * g - 2, 2) * ((qe + 1) * (g * 2 - 2) + qe) + 2) / 2, ys = 2 * Math.PI / 3, ls = 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) * ys), si = (g) => g === 0 ? 0 : g === 1 ? 1 : Math.pow(2, -10 * g) * Math.sin((g * 10 - 0.75) * ys) + 1, ii = (g) => g === 0 ? 0 : g === 1 ? 1 : g < 0.5 ? -(Math.pow(2, 20 * g - 10) * Math.sin((20 * g - 11.125) * ls)) / 2 : Math.pow(2, -20 * g + 10) * Math.sin((20 * g - 11.125) * ls) / 2 + 1, Ze = (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 - Ze(1 - g), oi = Ze, ai = (g) => g < 0.5 ? (1 - Ze(1 - 2 * g)) / 2 : (1 + Ze(2 * g - 1)) / 2, es = /* @__PURE__ */ new Map(), ze = (g, t, i, o) => {
431
431
  const e = `${g},${t},${i},${o}`;
432
432
  if (es.has(e)) return es.get(e);
433
- const s = (h) => (1 - 3 * i + 3 * g) * h * h * h + (3 * i - 6 * g) * h * h + 3 * g * h, n = (h) => (1 - 3 * o + 3 * t) * h * h * h + (3 * o - 6 * t) * h * h + 3 * t * h, a = (h) => 3 * (1 - 3 * i + 3 * g) * h * h + 2 * (3 * i - 6 * g) * h + 3 * g, r = (h) => {
434
- let l = h;
433
+ const s = (f) => (1 - 3 * i + 3 * g) * f * f * f + (3 * i - 6 * g) * f * f + 3 * g * f, n = (f) => (1 - 3 * o + 3 * t) * f * f * f + (3 * o - 6 * t) * f * f + 3 * t * f, a = (f) => 3 * (1 - 3 * i + 3 * g) * f * f + 2 * (3 * i - 6 * g) * f + 3 * g, r = (f) => {
434
+ let l = f;
435
435
  for (let p = 0; p < 8; p++) {
436
- const c = s(l) - h;
436
+ const c = s(l) - f;
437
437
  if (Math.abs(c) < 1e-6) return l;
438
438
  const d = a(l);
439
439
  if (Math.abs(d) < 1e-6) break;
440
440
  l = l - c / d;
441
441
  }
442
442
  return l;
443
- }, f = (h) => h === 0 ? 0 : h === 1 ? 1 : n(r(h));
444
- return es.set(e, f), f;
443
+ }, h = (f) => f === 0 ? 0 : f === 1 ? 1 : n(r(f));
444
+ return es.set(e, h), h;
445
445
  }, cs = (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;
448
448
  const [, i, o, e, s] = t.map(Number);
449
449
  return ze(i, o, e, s);
450
- }, fs = {
450
+ }, hs = {
451
451
  ease: ze(0.25, 0.1, 0.25, 1),
452
452
  "ease-in": ze(0.42, 0, 1, 1),
453
453
  "ease-out": ze(0, 0, 0.58, 1),
@@ -507,19 +507,19 @@ const gs = (g) => g, Ls = (g) => g > 0 ? 1 : 0, Rs = (g) => g < 1 ? 0 : 1, os =
507
507
  if (Ke[t]) return Ke[t];
508
508
  const o = Object.keys(Ke).find((s) => s.toLowerCase() === i);
509
509
  if (o) return Ke[o];
510
- const e = Object.keys(hs).find((s) => s.toLowerCase() === i);
510
+ const e = Object.keys(fs).find((s) => s.toLowerCase() === i);
511
511
  if (e) {
512
- const s = cs(hs[e].value);
512
+ const s = cs(fs[e].value);
513
513
  if (s) return s;
514
514
  }
515
- if (fs[i])
516
- return fs[i];
515
+ if (hs[i])
516
+ return hs[i];
517
517
  if (i.startsWith("cubic-bezier")) {
518
518
  const s = cs(t);
519
519
  if (s) return s;
520
520
  }
521
521
  return gs;
522
- }, hs = {
522
+ }, fs = {
523
523
  Snappy: {
524
524
  label: "Snappy",
525
525
  description: "High energy, quick arrival.",
@@ -572,10 +572,10 @@ const gs = (g) => g, Ls = (g) => g > 0 ? 1 : 0, Rs = (g) => g < 1 ? 0 : 1, os =
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, f, h) => {
575
+ const s = o.scale_x ?? 1, n = o.scale_y ?? 1, a = (r, h, f) => {
576
576
  let l = 0, p = 0;
577
- const c = o.rotation * Math.PI / 180, d = Math.cos(c), u = Math.sin(c), v = r * s * d - f * n * u + o.x, b = r * s * u + f * n * d + o.y;
578
- h.forEach((I) => {
577
+ const c = o.rotation * Math.PI / 180, d = Math.cos(c), u = Math.sin(c), v = r * s * d - h * n * u + o.x, b = r * s * u + h * n * d + o.y;
578
+ f.forEach((I) => {
579
579
  const k = e(I.boneId);
580
580
  if (!k) return;
581
581
  const T = {
@@ -587,7 +587,7 @@ const gs = (g) => g, Ls = (g) => g > 0 ? 1 : 0, Rs = (g) => g < 1 ? 0 : 1, os =
587
587
  }, L = i[I.boneId] || [1, 0, 0, 1, 0, 0], P = v * L[0] + b * L[2] + L[4], _ = v * L[1] + b * L[3] + L[5], E = T.rotation * Math.PI / 180, A = Math.cos(E), W = Math.sin(E), z = P * T.scaleX * A - _ * T.scaleY * W + T.x, Y = P * T.scaleX * W + _ * T.scaleY * A + T.y;
588
588
  l += z * I.amount, p += Y * I.amount;
589
589
  });
590
- const m = [...h].sort((I, k) => k.amount - I.amount);
590
+ const m = [...f].sort((I, k) => k.amount - I.amount);
591
591
  if (m.length >= 2 && m[0].amount > 0 && m[1].amount > 0) {
592
592
  const I = e(m[0].boneId), k = e(m[1].boneId);
593
593
  if (I && k && I.length !== void 0 && k.length !== void 0) {
@@ -620,16 +620,16 @@ const gs = (g) => g, Ls = (g) => g > 0 ? 1 : 0, Rs = (g) => g < 1 ? 0 : 1, os =
620
620
  y: (-w * C + M * S) / n
621
621
  };
622
622
  };
623
- return g.map((r, f) => {
624
- const h = t[f];
625
- if (!h || h.length === 0) return { ...r };
626
- const l = { ...r, ...a(r.x, r.y, h) };
623
+ return g.map((r, h) => {
624
+ const f = t[h];
625
+ if (!f || f.length === 0) return { ...r };
626
+ const l = { ...r, ...a(r.x, r.y, f) };
627
627
  if (r.in_x !== void 0 && r.in_y !== void 0) {
628
- const p = a(r.in_x, r.in_y, h);
628
+ const p = a(r.in_x, r.in_y, f);
629
629
  l.in_x = p.x, l.in_y = p.y;
630
630
  }
631
631
  if (r.out_x !== void 0 && r.out_y !== void 0) {
632
- const p = a(r.out_x, r.out_y, h);
632
+ const p = a(r.out_x, r.out_y, f);
633
633
  l.out_x = p.x, l.out_y = p.y;
634
634
  }
635
635
  return l;
@@ -909,7 +909,7 @@ class ci {
909
909
  }
910
910
  svgPathToPoints(t) {
911
911
  const i = /([MLHVCSQTAZmlhvcsqtaz])([^MLHVCSQTAZmlhvcsqtaz]*)/g, o = /[-+]?(?:\d*\.\d+|\d+)(?:[eE][-+]?\d+)?/g, e = [];
912
- let s = !1, n = 0, a = 0, r = 0, f = 0, h = 0, l = 0, p;
912
+ let s = !1, n = 0, a = 0, r = 0, h = 0, f = 0, l = 0, p;
913
913
  for (; (p = i.exec(t)) !== null; ) {
914
914
  const c = p[1], d = (p[2].match(o) || []).map(parseFloat), u = c === c.toLowerCase(), v = c.toUpperCase();
915
915
  let b = 0;
@@ -920,7 +920,7 @@ class ci {
920
920
  switch (v) {
921
921
  case "M": {
922
922
  const S = y();
923
- for (h = n = S.x, l = a = S.y, e.push({ x: n, y: a, in_x: n, in_y: a, out_x: n, out_y: a, moveTo: !0 }); b < d.length; ) {
923
+ for (f = n = S.x, l = a = S.y, e.push({ x: n, y: a, in_x: n, in_y: a, out_x: n, out_y: a, moveTo: !0 }); b < d.length; ) {
924
924
  const C = y();
925
925
  n = C.x, a = C.y, e.push({ x: n, y: a, in_x: n, in_y: a, out_x: n, out_y: a });
926
926
  }
@@ -947,17 +947,17 @@ class ci {
947
947
  const M = e[e.length - 1];
948
948
  M.out_x = S.x, M.out_y = S.y;
949
949
  }
950
- 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, f = C.y;
950
+ 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, h = C.y;
951
951
  }
952
952
  break;
953
953
  case "S":
954
954
  for (; b < d.length; ) {
955
- const S = { x: 2 * n - r, y: 2 * a - f }, C = y(), w = y();
955
+ const S = { x: 2 * n - r, y: 2 * a - h }, C = y(), w = y();
956
956
  if (e.length > 0) {
957
957
  const M = e[e.length - 1];
958
958
  M.out_x = S.x, M.out_y = S.y;
959
959
  }
960
- 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, f = C.y;
960
+ 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, h = C.y;
961
961
  }
962
962
  break;
963
963
  case "Q":
@@ -967,17 +967,17 @@ class ci {
967
967
  const w = e[e.length - 1];
968
968
  w.out_x = w.x + 2 / 3 * (S.x - w.x), w.out_y = w.y + 2 / 3 * (S.y - w.y);
969
969
  }
970
- 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, f = S.y;
970
+ 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, h = S.y;
971
971
  }
972
972
  break;
973
973
  case "T":
974
974
  for (; b < d.length; ) {
975
- const S = { x: 2 * n - r, y: 2 * a - f }, C = y();
975
+ const S = { x: 2 * n - r, y: 2 * a - h }, C = y();
976
976
  if (e.length > 0) {
977
977
  const w = e[e.length - 1];
978
978
  w.out_x = w.x + 2 / 3 * (S.x - w.x), w.out_y = w.y + 2 / 3 * (S.y - w.y);
979
979
  }
980
- 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, f = S.y;
980
+ 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, h = S.y;
981
981
  }
982
982
  break;
983
983
  case "Z":
@@ -987,7 +987,7 @@ class ci {
987
987
  const C = [...e].reverse().find((w) => w.moveTo) || e[0];
988
988
  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));
989
989
  }
990
- n = h, a = l;
990
+ n = f, a = l;
991
991
  break;
992
992
  default:
993
993
  if (d.length >= 2) {
@@ -1064,20 +1064,20 @@ class ci {
1064
1064
  if (!t) return;
1065
1065
  let i = this.decompressStrings(t);
1066
1066
  const o = [], e = /* @__PURE__ */ new Set(), s = (r) => {
1067
- r && r.forEach((f) => {
1068
- if (e.has(f.id)) return;
1069
- const h = { ...f }, l = h.childrenObjects || [];
1070
- e.add(h.id), o.push(h), s(l);
1067
+ r && r.forEach((h) => {
1068
+ if (e.has(h.id)) return;
1069
+ const f = { ...h }, l = f.childrenObjects || [];
1070
+ e.add(f.id), o.push(f), s(l);
1071
1071
  });
1072
1072
  };
1073
1073
  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) {
1074
1074
  const r = /* @__PURE__ */ new Map();
1075
- this.artboard.objects.forEach((f) => {
1076
- r.set(f.id, f), f.children || (f.children = []);
1077
- }), this.artboard.objects.forEach((f) => {
1078
- if (f.parentId) {
1079
- const h = r.get(f.parentId);
1080
- h && (h.children || (h.children = []), h.children.includes(f.id) || h.children.push(f.id));
1075
+ this.artboard.objects.forEach((h) => {
1076
+ r.set(h.id, h), h.children || (h.children = []);
1077
+ }), this.artboard.objects.forEach((h) => {
1078
+ if (h.parentId) {
1079
+ const f = r.get(h.parentId);
1080
+ f && (f.children || (f.children = []), f.children.includes(h.id) || f.children.push(h.id));
1081
1081
  }
1082
1082
  });
1083
1083
  }
@@ -1127,11 +1127,11 @@ class ci {
1127
1127
  reset() {
1128
1128
  if (!this.artboard) return;
1129
1129
  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) => {
1130
- var n, a, r, f, h, l, p;
1131
- 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) ?? ((f = i.geometry) == null ? void 0 : f.cornerRadius) ?? 0;
1130
+ var n, a, r, h, f, l, p;
1131
+ 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) ?? ((h = i.geometry) == null ? void 0 : h.cornerRadius) ?? 0;
1132
1132
  this.objectStates.set(i.id, {
1133
1133
  ...i.transform || {},
1134
- x: ((h = i.transform) == null ? void 0 : h.x) ?? i.x ?? 0,
1134
+ x: ((f = i.transform) == null ? void 0 : f.x) ?? i.x ?? 0,
1135
1135
  y: ((l = i.transform) == null ? void 0 : l.y) ?? i.y ?? 0,
1136
1136
  width: o,
1137
1137
  height: e,
@@ -1168,14 +1168,14 @@ class ci {
1168
1168
  if ((s = e.physics) != null && s.enabled && e.type === "Shape") {
1169
1169
  const a = this.objectStates.get(e.id);
1170
1170
  if (!a) return;
1171
- const r = e.geometry.width || 100, f = e.geometry.height || 100;
1171
+ const r = e.geometry.width || 100, h = e.geometry.height || 100;
1172
1172
  this.physicsEngine.createBody({
1173
1173
  id: e.id,
1174
1174
  type: ((n = e.geometry) == null ? void 0 : n.type) || "Rectangle",
1175
1175
  x: a.x,
1176
1176
  y: a.y,
1177
1177
  width: r,
1178
- height: f,
1178
+ height: h,
1179
1179
  rotation: a.rotation * (Math.PI / 180),
1180
1180
  // Convert deg to rad
1181
1181
  isStatic: e.physics.bodyType === "Static",
@@ -1212,8 +1212,8 @@ class ci {
1212
1212
  n.forEach((a) => {
1213
1213
  const r = this.objectStates.get(a.id);
1214
1214
  if (r) {
1215
- const f = Math.abs(r.x - a.x), h = Math.abs(r.y - a.y);
1216
- !t && (f > 20 || h > 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);
1215
+ const h = Math.abs(r.x - a.x), f = Math.abs(r.y - a.y);
1216
+ !t && (h > 20 || f > 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);
1217
1217
  }
1218
1218
  });
1219
1219
  };
@@ -1224,10 +1224,10 @@ class ci {
1224
1224
  this.artboard.objects.forEach((n) => {
1225
1225
  var a;
1226
1226
  if (n.type === "Frame" && ((a = n.autoLayout) != null && a.enabled) && n.children && n.children.length > 0) {
1227
- const r = n.children.map((l) => i.get(l)).filter((l) => !!l), f = this.objectStates.get(n.id);
1228
- if (!f) return;
1229
- const h = ns(f, r, (l) => this.objectStates.get(l));
1230
- h.frameWidth !== void 0 && (f.width = h.frameWidth), h.frameHeight !== void 0 && (f.height = h.frameHeight), e(h.childUpdates);
1227
+ const r = n.children.map((l) => i.get(l)).filter((l) => !!l), h = this.objectStates.get(n.id);
1228
+ if (!h) return;
1229
+ const f = ns(h, r, (l) => this.objectStates.get(l));
1230
+ f.frameWidth !== void 0 && (h.width = f.frameWidth), f.frameHeight !== void 0 && (h.height = f.frameHeight), e(f.childUpdates);
1231
1231
  }
1232
1232
  });
1233
1233
  }
@@ -1278,21 +1278,21 @@ class ci {
1278
1278
  const a = this.activeStateMachine.layers.find((r) => r.name === t);
1279
1279
  if (a)
1280
1280
  for (const r of i) {
1281
- const f = a.states.find((h) => h.id === r);
1282
- if (f)
1283
- if (f.isBlendState && f.blendAnimations && f.blendAnimations.length > 0)
1284
- e.push({ animation: null, state: f }), f.blendAnimations.forEach((h) => {
1285
- const l = this.artboard.animations.find((p) => p.id === h.animationId);
1281
+ const h = a.states.find((f) => f.id === r);
1282
+ if (h)
1283
+ if (h.isBlendState && h.blendAnimations && h.blendAnimations.length > 0)
1284
+ e.push({ animation: null, state: h }), h.blendAnimations.forEach((f) => {
1285
+ const l = this.artboard.animations.find((p) => p.id === f.animationId);
1286
1286
  l && (s = Math.max(s, l.duration));
1287
1287
  });
1288
1288
  else {
1289
- let h = null;
1290
- f.animationId && (h = this.artboard.animations.find((l) => l.id === f.animationId) || null), h || (h = this.artboard.animations.find(
1289
+ let f = null;
1290
+ h.animationId && (f = this.artboard.animations.find((l) => l.id === h.animationId) || null), f || (f = this.artboard.animations.find(
1291
1291
  (l) => {
1292
1292
  var p, c;
1293
- return l.name === f.name || l.id === f.name || (f.name === "Entry" || f.id === "entry") && (((p = l.name) == null ? void 0 : p.toLowerCase()) === "onload" || ((c = l.name) == null ? void 0 : c.toLowerCase()) === "intro");
1293
+ return l.name === h.name || l.id === h.name || (h.name === "Entry" || h.id === "entry") && (((p = l.name) == null ? void 0 : p.toLowerCase()) === "onload" || ((c = l.name) == null ? void 0 : c.toLowerCase()) === "intro");
1294
1294
  }
1295
- ) || null), h && ((n = this.artboard.animationFlow) != null && n.some((p) => (p.trigger === "on_load" || p.trigger === "after_delay") && p.targetAnimationId === (h == null ? void 0 : h.id)) || (e.push({ animation: h, state: f }), s = Math.max(s, h.duration)));
1295
+ ) || null), f && ((n = this.artboard.animationFlow) != null && n.some((p) => (p.trigger === "on_load" || p.trigger === "after_delay") && p.targetAnimationId === (f == null ? void 0 : f.id)) || (e.push({ animation: f, state: h }), s = Math.max(s, f.duration)));
1296
1296
  }
1297
1297
  }
1298
1298
  }
@@ -1338,22 +1338,22 @@ class ci {
1338
1338
  var n, a, r;
1339
1339
  let o;
1340
1340
  if (this.inputs.has(t)) {
1341
- const f = (n = this.activeStateMachine) == null ? void 0 : n.inputs.find((h) => h.id === t);
1342
- f && typeof f.value == "object" && (o = f.value.type);
1341
+ const h = (n = this.activeStateMachine) == null ? void 0 : n.inputs.find((f) => f.id === t);
1342
+ h && typeof h.value == "object" && (o = h.value.type);
1343
1343
  } else {
1344
- const f = this.inputNameMap.get(t);
1345
- if (f && f.length > 0) {
1346
- const h = (a = this.activeStateMachine) == null ? void 0 : a.inputs.find((l) => l.id === f[0]);
1347
- h && typeof h.value == "object" && (o = h.value.type);
1344
+ const h = this.inputNameMap.get(t);
1345
+ if (h && h.length > 0) {
1346
+ const f = (a = this.activeStateMachine) == null ? void 0 : a.inputs.find((l) => l.id === h[0]);
1347
+ f && typeof f.value == "object" && (o = f.value.type);
1348
1348
  }
1349
1349
  }
1350
1350
  let e = i;
1351
1351
  o === "Trigger" && (i === 1 ? e = !0 : i === 0 && (e = !1)), this.inputs.has(t) && this.setInternalInput(t, e);
1352
1352
  const s = this.inputNameMap.get(t);
1353
- s && s.forEach((f) => this.setInternalInput(f, e)), o === "Trigger" && e === !0 && (this.justFiredTriggers.add(t), s && s.forEach((f) => this.justFiredTriggers.add(f))), Array.isArray(e) && ((r = this.artboard) == null || r.objects.forEach((f) => {
1354
- if (f.inputId === t || f.name === t) {
1355
- const h = this.objectStates.get(f.id);
1356
- h && h.options && (f.type === "ListView" || f.variant === "listview" ? h.options.items = e : (f.type === "Dropdown" || f.variant === "dropdown") && (h.options.optionsList = e));
1353
+ s && s.forEach((h) => this.setInternalInput(h, e)), o === "Trigger" && e === !0 && (this.justFiredTriggers.add(t), s && s.forEach((h) => this.justFiredTriggers.add(h))), Array.isArray(e) && ((r = this.artboard) == null || r.objects.forEach((h) => {
1354
+ if (h.inputId === t || h.name === t) {
1355
+ const f = this.objectStates.get(h.id);
1356
+ f && f.options && (h.type === "ListView" || h.variant === "listview" ? f.options.items = e : (h.type === "Dropdown" || h.variant === "dropdown") && (f.options.optionsList = e));
1357
1357
  }
1358
1358
  })), this.evaluateTransitions(), this.evaluateVariableTriggers(t, e);
1359
1359
  }
@@ -1363,42 +1363,42 @@ class ci {
1363
1363
  o.forEach((s) => {
1364
1364
  if (s.trigger === "variable" && s.conditionVariableId && s.targetAnimationId && (s.conditionVariableId === t || e && e.includes(s.conditionVariableId))) {
1365
1365
  const a = s.conditionOperator || "IsTrue", r = s.conditionValue;
1366
- let f = !1;
1366
+ let h = !1;
1367
1367
  switch (a) {
1368
1368
  case "Equal":
1369
1369
  case "==":
1370
- f = i == r;
1370
+ h = i == r;
1371
1371
  break;
1372
1372
  case "NotEqual":
1373
1373
  case "!=":
1374
- f = i != r;
1374
+ h = i != r;
1375
1375
  break;
1376
1376
  case "GreaterThan":
1377
1377
  case ">":
1378
- f = i > r;
1378
+ h = i > r;
1379
1379
  break;
1380
1380
  case "LessThan":
1381
1381
  case "<":
1382
- f = i < r;
1382
+ h = i < r;
1383
1383
  break;
1384
1384
  case "GreaterEqual":
1385
1385
  case ">=":
1386
- f = i >= r;
1386
+ h = i >= r;
1387
1387
  break;
1388
1388
  case "LessEqual":
1389
1389
  case "<=":
1390
- f = i <= r;
1390
+ h = i <= r;
1391
1391
  break;
1392
1392
  case "IsTrue":
1393
- f = !!i;
1393
+ h = !!i;
1394
1394
  break;
1395
1395
  case "IsFalse":
1396
- f = !i;
1396
+ h = !i;
1397
1397
  break;
1398
1398
  }
1399
- if (f) {
1400
- const h = s.delay || 0;
1401
- h <= 0 ? this.triggerGlobalAnimation(s.targetAnimationId, s.subAnimationIds, s.loop, s.id) : setTimeout(() => this.triggerGlobalAnimation(s.targetAnimationId, s.subAnimationIds, s.loop, s.id), h);
1399
+ if (h) {
1400
+ const f = s.delay || 0;
1401
+ f <= 0 ? this.triggerGlobalAnimation(s.targetAnimationId, s.subAnimationIds, s.loop, s.id) : setTimeout(() => this.triggerGlobalAnimation(s.targetAnimationId, s.subAnimationIds, s.loop, s.id), f);
1402
1402
  }
1403
1403
  }
1404
1404
  });
@@ -1421,7 +1421,7 @@ class ci {
1421
1421
  const s = this.findGlobalTransition(t, i.currentStateIds);
1422
1422
  s && (o.length = 0, o.push(s.targetStateId), e = !0, s.conditions && (s.conditions || []).forEach((n) => {
1423
1423
  var r;
1424
- const a = (r = this.activeStateMachine) == null ? void 0 : r.inputs.find((f) => f.id === n.inputId);
1424
+ const a = (r = this.activeStateMachine) == null ? void 0 : r.inputs.find((h) => h.id === n.inputId);
1425
1425
  a && typeof a.value == "object" && a.value.type === "Trigger" && this.setInternalInput(n.inputId, !1);
1426
1426
  }));
1427
1427
  }
@@ -1498,7 +1498,7 @@ class ci {
1498
1498
  });
1499
1499
  }
1500
1500
  evaluateLogicTree(t, i = null, o = /* @__PURE__ */ new Set()) {
1501
- var a, r, f, h, l, p;
1501
+ var a, r, h, f, l, p;
1502
1502
  if (o.has(t))
1503
1503
  return this.inputs.get(t) ?? this.logicNodeValues.get(t) ?? 0;
1504
1504
  o.add(t);
@@ -1708,7 +1708,7 @@ class ci {
1708
1708
  }
1709
1709
  case wt.SPRING_PULL: {
1710
1710
  const u = c("objectId", ""), v = c("forceX", 0), b = c("forceY", 0);
1711
- u && ((f = this.artboard) == null || f.objects.forEach((m) => {
1711
+ u && ((h = this.artboard) == null || h.objects.forEach((m) => {
1712
1712
  m.behaviors && m.behaviors.forEach((y) => {
1713
1713
  var S;
1714
1714
  if (y.type === U.SpringChain && ((S = y.settings) != null && S.connections) && (y.settings.connections.some((w) => w.targetId === u) || m.id === u)) {
@@ -1745,7 +1745,7 @@ class ci {
1745
1745
  }
1746
1746
  case wt.EMIT: {
1747
1747
  const u = c("objectId", ""), v = c("count", 20);
1748
- u && ((h = this.artboard) == null || h.objects.forEach((b) => {
1748
+ u && ((f = this.artboard) == null || f.objects.forEach((b) => {
1749
1749
  b.behaviors && b.behaviors.forEach((m) => {
1750
1750
  m.type === U.ParticleEmitter && b.id === u && (m._pendingBurst = (m._pendingBurst || 0) + v);
1751
1751
  });
@@ -1841,11 +1841,11 @@ class ci {
1841
1841
  }), i.forEach((o) => {
1842
1842
  this.layerStates.delete(o), this.debugLog(`[Engine] Cleaned up completed global layer: ${o}`);
1843
1843
  }), this.solveConstraints(t), this.solveBehaviors(t), this.activeTriggers.forEach((o, e) => {
1844
- var s, n, a, r, f, h, l;
1844
+ var s, n, a, r, h, f, l;
1845
1845
  if (o.phase === "entry")
1846
1846
  o.time += t, o.time >= o.animation.duration && ((a = (n = (s = this.artboard) == null ? void 0 : s.objects.find((p) => p.id === e)) == null ? void 0 : n.triggers) == null || a.find((p) => p.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);
1847
1847
  else if (o.phase === "hold") {
1848
- const p = (h = (f = (r = this.artboard) == null ? void 0 : r.objects.find((u) => u.id === e)) == null ? void 0 : f.triggers) == null ? void 0 : h.find((u) => u.id === o.triggerId), c = (p == null ? void 0 : p.duration) || 0;
1848
+ const p = (f = (h = (r = this.artboard) == null ? void 0 : r.objects.find((u) => u.id === e)) == null ? void 0 : h.triggers) == null ? void 0 : f.find((u) => u.id === o.triggerId), c = (p == null ? void 0 : p.duration) || 0;
1849
1849
  o.elapsedHold += t * 1e3;
1850
1850
  let d = o.elapsedHold >= c;
1851
1851
  if ((p == null ? void 0 : p.eventType) === "hover" && !this.activeHoverIds.has(e) && (d = !0), ((p == null ? void 0 : p.eventType) === "onHold" || (p == null ? void 0 : p.eventType) === "pointerDown") && !this.isMouseDown && (d = !0), d)
@@ -1864,7 +1864,7 @@ class ci {
1864
1864
  if (o && o.isEnabled && o.triggerType === "visible") {
1865
1865
  const a = this.objectStates.get(i.id);
1866
1866
  if (a && a.visible !== !1) {
1867
- const r = this.getGlobalTransform(i.id), f = (((s = i.geometry) == null ? void 0 : s.width) || 100) * (r.scale_x || 1), h = (((n = i.geometry) == null ? void 0 : n.height) || 100) * (r.scale_y || 1), l = 50, p = r.x + f / 2 >= -this.canvasWidth / 2 - l && r.x - f / 2 <= this.canvasWidth / 2 + l && r.y + h / 2 >= -this.canvasHeight / 2 - l && r.y - h / 2 <= this.canvasHeight / 2 + l, c = `analytics_${i.id}`, d = this.wasInView.has(c);
1867
+ const r = this.getGlobalTransform(i.id), h = (((s = i.geometry) == null ? void 0 : s.width) || 100) * (r.scale_x || 1), f = (((n = i.geometry) == null ? void 0 : n.height) || 100) * (r.scale_y || 1), l = 50, p = r.x + h / 2 >= -this.canvasWidth / 2 - l && r.x - h / 2 <= this.canvasWidth / 2 + l && r.y + f / 2 >= -this.canvasHeight / 2 - l && r.y - f / 2 <= this.canvasHeight / 2 + l, c = `analytics_${i.id}`, d = this.wasInView.has(c);
1868
1868
  p && !d && this.fireAnalyticsEvent(i.id, "visible"), p ? this.wasInView.add(c) : this.wasInView.delete(c);
1869
1869
  }
1870
1870
  }
@@ -1873,7 +1873,7 @@ class ci {
1873
1873
  o.length !== 0 && o.forEach((e) => {
1874
1874
  const s = e.triggers || [e.event || e.trigger];
1875
1875
  s && s.forEach((n) => {
1876
- var r, f, h;
1876
+ var r, h, f;
1877
1877
  const a = n.toLowerCase();
1878
1878
  if (a === "on interval" || a === "oninterval") {
1879
1879
  const l = e.intervalValue || 2e3, p = this.periodicTriggerTimes.get(e.id) || 0;
@@ -1886,12 +1886,12 @@ class ci {
1886
1886
  if (a === "scroll into view" || a === "scrollintoview") {
1887
1887
  const l = this.objectStates.get(i.id);
1888
1888
  if (l && l.visible !== !1) {
1889
- const p = this.getGlobalTransform(i.id), c = (((r = i.geometry) == null ? void 0 : r.width) || 100) * (p.scale_x || 1), d = (((f = i.geometry) == null ? void 0 : f.height) || 100) * (p.scale_y || 1), u = 50, v = p.x + c / 2 >= -this.canvasWidth / 2 - u && p.x - c / 2 <= this.canvasWidth / 2 + u && p.y + d / 2 >= -this.canvasHeight / 2 - u && p.y - d / 2 <= this.canvasHeight / 2 + u, b = this.wasInView.has(i.id);
1889
+ const p = this.getGlobalTransform(i.id), c = (((r = i.geometry) == null ? void 0 : r.width) || 100) * (p.scale_x || 1), d = (((h = i.geometry) == null ? void 0 : h.height) || 100) * (p.scale_y || 1), u = 50, v = p.x + c / 2 >= -this.canvasWidth / 2 - u && p.x - c / 2 <= this.canvasWidth / 2 + u && p.y + d / 2 >= -this.canvasHeight / 2 - u && p.y - d / 2 <= this.canvasHeight / 2 + u, b = this.wasInView.has(i.id);
1890
1890
  v && !b && (!e.conditions || this.checkConditions(e.conditions)) && this.fireEventForObject(i.id, "Scroll Into View"), v ? this.wasInView.add(i.id) : this.wasInView.delete(i.id);
1891
1891
  }
1892
1892
  }
1893
1893
  if (a === "scroll progress" || a === "scrollprogress") {
1894
- const l = Math.abs(this.scrollOffset.y) / (((h = this.artboard) == null ? void 0 : h.height) || 1e3), p = this.scrollProgressLastValue.get(e.id) || 0;
1894
+ const l = Math.abs(this.scrollOffset.y) / (((f = this.artboard) == null ? void 0 : f.height) || 1e3), p = this.scrollProgressLastValue.get(e.id) || 0;
1895
1895
  Math.abs(l - p) > 1e-3 && (this.scrollProgressLastValue.set(e.id, l), (e.action === "Set Input" || e.action === "setInput") && this.updateInput(e.targetInputId, l));
1896
1896
  }
1897
1897
  });
@@ -1905,17 +1905,17 @@ class ci {
1905
1905
  if (!o) return;
1906
1906
  const e = this.getGlobalTransform(i.id);
1907
1907
  if (i.constraints.forEach((s, n) => {
1908
- var h, l, p, c, d, u, v, b, m;
1909
- const a = ((h = o.constraints) == null ? void 0 : h[n]) || {}, r = { ...s, ...a }, f = r.strength ?? 1;
1908
+ var f, l, p, c, d, u, v, b, m;
1909
+ const a = ((f = o.constraints) == null ? void 0 : f[n]) || {}, r = { ...s, ...a }, h = r.strength ?? 1;
1910
1910
  if (r.type === "Translation") {
1911
1911
  const y = this.getGlobalTransform(r.targetId);
1912
1912
  if (y) {
1913
1913
  const S = r.offsetX || 0, C = r.offsetY || 0, w = y.x + S, M = y.y + C, I = r.useSpring;
1914
1914
  if (I) {
1915
1915
  const T = this.objectVelocities.get(i.id) || { vx: 0, vy: 0 }, { x: L, y: P, vx: _, vy: E } = this.computeSpring(e.x, e.y, T.vx, T.vy, w, M, r, t);
1916
- r.copyX && (e.x = e.x + (L - e.x) * f), r.copyY && (e.y = e.y + (P - e.y) * f), this.objectVelocities.set(i.id, { vx: _, vy: E });
1916
+ r.copyX && (e.x = e.x + (L - e.x) * h), r.copyY && (e.y = e.y + (P - e.y) * h), this.objectVelocities.set(i.id, { vx: _, vy: E });
1917
1917
  } else
1918
- r.copyX && (e.x = e.x + (w - e.x) * f), r.copyY && (e.y = e.y + (M - e.y) * f);
1918
+ r.copyX && (e.x = e.x + (w - e.x) * h), r.copyY && (e.y = e.y + (M - e.y) * h);
1919
1919
  let k = !1;
1920
1920
  if ((l = r.limitX) != null && l.enabled) {
1921
1921
  const T = e.x;
@@ -1931,17 +1931,17 @@ class ci {
1931
1931
  const y = this.getGlobalTransform(r.targetId);
1932
1932
  if (y) {
1933
1933
  let C = (y.rotation + (r.offset || 0) - e.rotation) % 360;
1934
- C > 180 && (C -= 360), C < -180 && (C += 360), e.rotation = e.rotation + C * f;
1934
+ C > 180 && (C -= 360), C < -180 && (C += 360), e.rotation = e.rotation + C * h;
1935
1935
  }
1936
1936
  } else if (r.type === "Scale") {
1937
1937
  const y = this.getGlobalTransform(r.targetId);
1938
- y && (r.copyX && (e.scale_x = e.scale_x + (y.scale_x - e.scale_x) * f), r.copyY && (e.scale_y = e.scale_y + (y.scale_y - e.scale_y) * f));
1938
+ y && (r.copyX && (e.scale_x = e.scale_x + (y.scale_x - e.scale_x) * h), r.copyY && (e.scale_y = e.scale_y + (y.scale_y - e.scale_y) * h));
1939
1939
  } else if (r.type === "Transform") {
1940
1940
  const y = this.getGlobalTransform(r.targetId);
1941
1941
  if (y) {
1942
- e.x = e.x + (y.x - e.x) * f, e.y = e.y + (y.y - e.y) * f;
1942
+ e.x = e.x + (y.x - e.x) * h, e.y = e.y + (y.y - e.y) * h;
1943
1943
  let S = (y.rotation - e.rotation) % 360;
1944
- S > 180 && (S -= 360), S < -180 && (S += 360), e.rotation = e.rotation + S * f, e.scale_x = e.scale_x + (y.scale_x - e.scale_x) * f, e.scale_y = e.scale_y + (y.scale_y - e.scale_y) * f;
1944
+ S > 180 && (S -= 360), S < -180 && (S += 360), e.rotation = e.rotation + S * h, e.scale_x = e.scale_x + (y.scale_x - e.scale_x) * h, e.scale_y = e.scale_y + (y.scale_y - e.scale_y) * h;
1945
1945
  }
1946
1946
  } else if (r.type === "FollowPointer") {
1947
1947
  const y = ((c = this._lastPointerPos) == null ? void 0 : c.x) ?? e.x, S = ((d = this._lastPointerPos) == null ? void 0 : d.y) ?? e.y, C = r.useSpring;
@@ -1949,7 +1949,7 @@ class ci {
1949
1949
  const M = this.objectVelocities.get(i.id) || { vx: 0, vy: 0 }, { x: I, y: k, vx: T, vy: L } = this.computeSpring(e.x, e.y, M.vx, M.vy, y, S, r, t);
1950
1950
  e.x = I, e.y = k, this.objectVelocities.set(i.id, { vx: T, vy: L });
1951
1951
  } else
1952
- e.x = e.x + (y - e.x) * f, e.y = e.y + (S - e.y) * f;
1952
+ e.x = e.x + (y - e.x) * h, e.y = e.y + (S - e.y) * h;
1953
1953
  let w = !1;
1954
1954
  if ((u = r.limitX) != null && u.enabled) {
1955
1955
  const M = e.x;
@@ -1981,7 +1981,7 @@ class ci {
1981
1981
  }
1982
1982
  if (w > 0) {
1983
1983
  const k = e.x === y.x && e.y === y.y ? 1 : I / w;
1984
- e.x = e.x + (y.x + S * k - e.x) * f, e.y = e.y + (y.y + C * k - e.y) * f;
1984
+ e.x = e.x + (y.x + S * k - e.x) * h, e.y = e.y + (y.y + C * k - e.y) * h;
1985
1985
  }
1986
1986
  }
1987
1987
  } else if (r.type === "FollowPath") {
@@ -2004,15 +2004,15 @@ class ci {
2004
2004
  A = Math.atan2(tt, X) * 180 / Math.PI + (r.offsetRotation || 0);
2005
2005
  }
2006
2006
  const W = A * Math.PI / 180, z = Math.cos(W), Y = Math.sin(W), G = (r.offsetX || 0) * z - (r.offsetY || 0) * Y, N = (r.offsetX || 0) * Y + (r.offsetY || 0) * z, J = S.x + _ + G, x = S.y + E + N;
2007
- if (e.x = e.x + (J - e.x) * f, e.y = e.y + (x - e.y) * f, r.orient) {
2007
+ if (e.x = e.x + (J - e.x) * h, e.y = e.y + (x - e.y) * h, r.orient) {
2008
2008
  let F = (A - e.rotation) % 360;
2009
- F > 180 && (F -= 360), F < -180 && (F += 360), e.rotation = e.rotation + F * f;
2009
+ F > 180 && (F -= 360), F < -180 && (F += 360), e.rotation = e.rotation + F * h;
2010
2010
  }
2011
2011
  }
2012
2012
  }
2013
2013
  } else if (r.type === "IK") {
2014
2014
  const y = this.getGlobalTransform(r.targetId);
2015
- y && this.solveIK(i, y, r.boneCount || 2, f);
2015
+ y && this.solveIK(i, y, r.boneCount || 2, h);
2016
2016
  }
2017
2017
  }), i.constraints.some((s) => s.type !== "IK")) {
2018
2018
  const s = this.globalToLocal(i.parentId, e);
@@ -2034,10 +2034,10 @@ class ci {
2034
2034
  scale_y: (i.scale_y ?? 1) * (i.flip_y ? -1 : 1),
2035
2035
  length: e
2036
2036
  };
2037
- const s = this.getGlobalTransform(o.parentId), n = s.rotation * Math.PI / 180, a = Math.cos(n), r = Math.sin(n), f = s.x + (i.x * s.scale_x * a - i.y * s.scale_y * r), h = s.y + (i.x * s.scale_x * r + i.y * s.scale_y * a);
2037
+ const s = this.getGlobalTransform(o.parentId), n = s.rotation * Math.PI / 180, a = Math.cos(n), r = Math.sin(n), h = s.x + (i.x * s.scale_x * a - i.y * s.scale_y * r), f = s.y + (i.x * s.scale_x * r + i.y * s.scale_y * a);
2038
2038
  return {
2039
- x: f,
2040
- y: h,
2039
+ x: h,
2040
+ y: f,
2041
2041
  rotation: s.rotation + i.rotation,
2042
2042
  scale_x: s.scale_x * (i.scale_x ?? 1) * (i.flip_x ? -1 : 1),
2043
2043
  scale_y: s.scale_y * (i.scale_y ?? 1) * (i.flip_y ? -1 : 1),
@@ -2046,7 +2046,7 @@ class ci {
2046
2046
  }
2047
2047
  globalToLocal(t, i) {
2048
2048
  if (!t) return i;
2049
- 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), f = i.x - o.x, h = i.y - o.y, l = (f * a - h * r) * e, p = (f * r + h * a) * s;
2049
+ 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), h = i.x - o.x, f = i.y - o.y, l = (h * a - f * r) * e, p = (h * r + f * a) * s;
2050
2050
  return {
2051
2051
  x: l,
2052
2052
  y: p,
@@ -2056,11 +2056,11 @@ class ci {
2056
2056
  };
2057
2057
  }
2058
2058
  solveIK(t, i, o, e) {
2059
- var f;
2059
+ var h;
2060
2060
  const s = [];
2061
2061
  let n = t.id;
2062
- for (let h = 0; h < o && n; h++) {
2063
- const l = (f = this.artboard) == null ? void 0 : f.objects.find((p) => p.id === n);
2062
+ for (let f = 0; f < o && n; f++) {
2063
+ const l = (h = this.artboard) == null ? void 0 : h.objects.find((p) => p.id === n);
2064
2064
  if (!l) break;
2065
2065
  s.push({
2066
2066
  id: n,
@@ -2070,7 +2070,7 @@ class ci {
2070
2070
  }
2071
2071
  if (s.length < 2) return;
2072
2072
  const a = s.reverse(), r = 5;
2073
- for (let h = 0; h < r; h++) {
2073
+ for (let f = 0; f < r; f++) {
2074
2074
  const l = this.getGlobalTransform(t.id);
2075
2075
  for (let p = a.length - 2; p >= 0; p--) {
2076
2076
  const c = a[p], d = this.getGlobalTransform(c.id), u = l.x - d.x, v = l.y - d.y, b = i.x - d.x, m = i.y - d.y, y = Math.sqrt(u * u + v * v), S = Math.sqrt(b * b + m * m);
@@ -2085,7 +2085,7 @@ class ci {
2085
2085
  }
2086
2086
  }
2087
2087
  computeSpring(t, i, o, e, s, n, a, r) {
2088
- const f = a.stiffness ?? 100, h = a.damping ?? 10, l = a.mass ?? 1, p = -f * (t - s), c = -f * (i - n), d = -h * o, u = -h * e, v = (p + d) / l, b = (c + u) / l, m = o + v * r, y = e + b * r, S = t + m * r, C = i + y * r;
2088
+ const h = a.stiffness ?? 100, f = a.damping ?? 10, l = a.mass ?? 1, p = -h * (t - s), c = -h * (i - n), d = -f * o, u = -f * e, v = (p + d) / l, b = (c + u) / l, m = o + v * r, y = e + b * r, S = t + m * r, C = i + y * r;
2089
2089
  return { x: S, y: C, vx: m, vy: y };
2090
2090
  }
2091
2091
  handlePointerInput(t, i, o, e, s) {
@@ -2109,7 +2109,7 @@ class ci {
2109
2109
  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);
2110
2110
  }
2111
2111
  handlePointerEvent(t, i, o) {
2112
- var r, f, h, l, p;
2112
+ var r, h, f, l, p;
2113
2113
  if (!this.artboard) return;
2114
2114
  t === "down" ? (this.isMouseDown = !0, this.updateInput("isMouseDown", !0)) : (t === "up" || t === "blur") && (this.isMouseDown = !1, this.updateInput("isMouseDown", !1));
2115
2115
  let e = null;
@@ -2290,11 +2290,11 @@ class ci {
2290
2290
  }), P && L < 20 && this.onGraphPointClick && this.onGraphPointClick({ objectId: c.id, componentName: c.name, datasetIndex: P.dIdx, pointIndex: P.pIdx, value: P.val, label: P.label }), this.onComponentChange && this.onComponentChange({ objectId: c.id, componentName: c.name, variant: "linegraph", property: "click", value: (P == null ? void 0 : P.val) ?? null });
2291
2291
  }
2292
2292
  if (t === "click") {
2293
- const v = (f = this.artboard) == null ? void 0 : f.objects.find((y) => y.id === e.id), b = this.focusedId, m = (v == null ? void 0 : v.type) === "InputBox" || (v == null ? void 0 : v.type) === "Component" && v.variant === "inputbox";
2293
+ const v = (h = this.artboard) == null ? void 0 : h.objects.find((y) => y.id === e.id), b = this.focusedId, m = (v == null ? void 0 : v.type) === "InputBox" || (v == null ? void 0 : v.type) === "Component" && v.variant === "inputbox";
2294
2294
  if (v && m) {
2295
2295
  if (this.focusedId = e.id, this.log(`[Engine] Focus set to: ${e.id}`), b !== this.focusedId) {
2296
2296
  if (b) {
2297
- const y = (h = this.artboard) == null ? void 0 : h.objects.find((S) => S.id === b);
2297
+ const y = (f = this.artboard) == null ? void 0 : f.objects.find((S) => S.id === b);
2298
2298
  y && this.onInputBlur && this.onInputBlur(y.name);
2299
2299
  }
2300
2300
  this.onInputFocus && this.onInputFocus(v.name);
@@ -2346,8 +2346,8 @@ class ci {
2346
2346
  this.artboard && (this.activeKeys.delete(t.key.toLowerCase()), this.activeKeys.delete(t.code));
2347
2347
  }
2348
2348
  fireEventForObject(t, i) {
2349
- var h, l, p, c, d;
2350
- const o = (h = this.artboard) == null ? void 0 : h.objects.find((u) => u.id === t);
2349
+ var f, l, p, c, d;
2350
+ const o = (f = this.artboard) == null ? void 0 : f.objects.find((u) => u.id === t);
2351
2351
  if (!o) return;
2352
2352
  const e = /* @__PURE__ */ new Set([i, i.toLowerCase()]), s = i.toLowerCase();
2353
2353
  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"));
@@ -2394,51 +2394,51 @@ class ci {
2394
2394
  }
2395
2395
  this.onTrigger && this.onTrigger(i, a.action);
2396
2396
  }
2397
- const f = (o.triggers || []).find((u) => {
2397
+ const h = (o.triggers || []).find((u) => {
2398
2398
  const v = u.eventType.toLowerCase();
2399
2399
  let b = !1;
2400
2400
  return (e.has(v) || v === "click" && e.has("onclick") || v === "hover" && (e.has("onpointerenter") || e.has("hover")) || v === "pointerdown" && e.has("onpointerdown") || v === "pointerup" && e.has("onpointerup")) && (b = !0), b && u.conditions && u.conditions.length > 0 ? this.checkConditions(u.conditions) : b;
2401
2401
  });
2402
- if (f && f.entryAnimationId) {
2403
- this.log(`[Engine] Trigger matched: ${i} (as ${f.eventType}) -> Animation ${f.entryAnimationId}`);
2404
- const u = (d = (c = this.artboard) == null ? void 0 : c.animations) == null ? void 0 : d.find((v) => v.id === f.entryAnimationId);
2402
+ if (h && h.entryAnimationId) {
2403
+ this.log(`[Engine] Trigger matched: ${i} (as ${h.eventType}) -> Animation ${h.entryAnimationId}`);
2404
+ const u = (d = (c = this.artboard) == null ? void 0 : c.animations) == null ? void 0 : d.find((v) => v.id === h.entryAnimationId);
2405
2405
  u && (this.activeTriggers.set(o.id, {
2406
- triggerId: f.id,
2406
+ triggerId: h.id,
2407
2407
  animation: u,
2408
2408
  time: 0,
2409
2409
  phase: "entry",
2410
2410
  elapsedHold: 0,
2411
- filterObjectId: f.targetObjectId
2412
- }), this.onTrigger && this.onTrigger(f.name, u.name));
2411
+ filterObjectId: h.targetObjectId
2412
+ }), this.onTrigger && this.onTrigger(h.name, u.name));
2413
2413
  }
2414
2414
  }
2415
2415
  fireAnalyticsEvent(t, i) {
2416
- var r, f;
2417
- const o = (r = this.artboard) == null ? void 0 : r.objects.find((h) => h.id === t);
2416
+ var r, h;
2417
+ const o = (r = this.artboard) == null ? void 0 : r.objects.find((f) => f.id === t);
2418
2418
  if (!o) return;
2419
- const e = (f = o.style) == null ? void 0 : f.analytics;
2419
+ const e = (h = o.style) == null ? void 0 : h.analytics;
2420
2420
  if (!e || !e.isEnabled || e.triggerType !== i) return;
2421
2421
  const s = e.eventName || `${o.name.toLowerCase().replace(/\s+/g, "_")}_interacted`, n = {};
2422
- e.parameters && Array.isArray(e.parameters) && e.parameters.forEach((h) => {
2423
- if (h.type === "literal")
2424
- n[h.key] = h.value;
2425
- else if (h.type === "variable") {
2426
- const l = this.inputs.get(h.value);
2427
- n[h.key] = l !== void 0 ? l : "";
2422
+ e.parameters && Array.isArray(e.parameters) && e.parameters.forEach((f) => {
2423
+ if (f.type === "literal")
2424
+ n[f.key] = f.value;
2425
+ else if (f.type === "variable") {
2426
+ const l = this.inputs.get(f.value);
2427
+ n[f.key] = l !== void 0 ? l : "";
2428
2428
  }
2429
2429
  }), this.log(`[ExodeUI Analytics] Dispatching event "${s}" via ${i} trigger:`, n);
2430
2430
  const a = e.platforms || { ga4: !0, meta: !0, mixpanel: !1 };
2431
2431
  if (a.ga4) {
2432
- const h = window;
2433
- typeof h.gtag == "function" ? (h.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.`);
2432
+ const f = window;
2433
+ typeof f.gtag == "function" ? (f.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.`);
2434
2434
  }
2435
2435
  if (a.meta) {
2436
- const h = window;
2437
- typeof h.fbq == "function" ? (h.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.`);
2436
+ const f = window;
2437
+ typeof f.fbq == "function" ? (f.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.`);
2438
2438
  }
2439
2439
  if (a.mixpanel) {
2440
- const h = window;
2441
- h.mixpanel && typeof h.mixpanel.track == "function" ? (h.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.`);
2440
+ const f = window;
2441
+ f.mixpanel && typeof f.mixpanel.track == "function" ? (f.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.`);
2442
2442
  }
2443
2443
  }
2444
2444
  initGlobalAnimationTriggers() {
@@ -2488,9 +2488,9 @@ class ci {
2488
2488
  scaleY: i.scale_y ?? 1,
2489
2489
  rotation: i.rotation ?? 0
2490
2490
  };
2491
- 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, f = i.y * e.scaleY, h = e.x + (r * n - f * a), l = e.y + (r * a + f * n);
2491
+ 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, h = i.y * e.scaleY, f = e.x + (r * n - h * a), l = e.y + (r * a + h * n);
2492
2492
  return {
2493
- x: h,
2493
+ x: f,
2494
2494
  y: l,
2495
2495
  scaleX: (i.scale_x ?? 1) * e.scaleX,
2496
2496
  scaleY: (i.scale_y ?? 1) * e.scaleY,
@@ -2500,14 +2500,14 @@ class ci {
2500
2500
  hitTest(t, i, o) {
2501
2501
  var y, S;
2502
2502
  if (!this.objectStates.get(t.id)) return !1;
2503
- const s = ((y = t.geometry) == null ? void 0 : y.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, f = o - a.y, h = -a.rotation * (Math.PI / 180), l = Math.cos(h), p = Math.sin(h), c = r * l - f * p, d = r * p + f * l, u = a.scaleX, v = a.scaleY, b = s * Math.abs(u), m = n * Math.abs(v);
2503
+ const s = ((y = t.geometry) == null ? void 0 : y.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, h = o - a.y, f = -a.rotation * (Math.PI / 180), l = Math.cos(f), p = Math.sin(f), c = r * l - h * p, d = r * p + h * l, u = a.scaleX, v = a.scaleY, b = s * Math.abs(u), m = n * Math.abs(v);
2504
2504
  return Math.abs(c) <= b / 2 && Math.abs(d) <= m / 2;
2505
2505
  }
2506
2506
  updateSliderValueFromPointer(t, i, o) {
2507
2507
  var M;
2508
2508
  const e = this.objectStates.get(t.id);
2509
2509
  if (!e) return;
2510
- const s = t.options || {}, n = ((M = t.geometry) == null ? void 0 : M.width) ?? t.width ?? 200, a = this.getWorldTransform(t.id), r = i - a.x, f = o - a.y, h = -a.rotation * (Math.PI / 180), l = Math.cos(h), p = Math.sin(h), c = r * l - f * p, d = s.thumbWidth ?? 16, u = n - d;
2510
+ const s = t.options || {}, n = ((M = t.geometry) == null ? void 0 : M.width) ?? t.width ?? 200, a = this.getWorldTransform(t.id), r = i - a.x, h = o - a.y, f = -a.rotation * (Math.PI / 180), l = Math.cos(f), p = Math.sin(f), c = r * l - h * p, d = s.thumbWidth ?? 16, u = n - d;
2511
2511
  let b = (c + u / 2) / u;
2512
2512
  b = Math.max(0, Math.min(1, b));
2513
2513
  const m = s.min ?? 0, y = s.max ?? 100, S = s.step || 1;
@@ -2526,8 +2526,8 @@ class ci {
2526
2526
  var M, I;
2527
2527
  const e = this.objectStates.get(t.id);
2528
2528
  if (!e) return;
2529
- const s = (e == null ? void 0 : e.width) !== void 0 ? e.width : ((M = t.geometry) == null ? void 0 : M.width) ?? t.width ?? 100, n = (e == null ? void 0 : e.height) !== void 0 ? e.height : ((I = t.geometry) == null ? void 0 : I.height) ?? t.height ?? 100, a = this.getWorldTransform(t.id), r = i - a.x, f = o - a.y, h = -a.rotation * (Math.PI / 180), l = Math.cos(h), p = Math.sin(h);
2530
- let c = (r * l - f * p) / Math.max(1e-3, Math.abs(a.scaleX || 1)), d = (r * p + f * l) / Math.max(1e-3, Math.abs(a.scaleY || 1));
2529
+ const s = (e == null ? void 0 : e.width) !== void 0 ? e.width : ((M = t.geometry) == null ? void 0 : M.width) ?? t.width ?? 100, n = (e == null ? void 0 : e.height) !== void 0 ? e.height : ((I = t.geometry) == null ? void 0 : I.height) ?? t.height ?? 100, a = this.getWorldTransform(t.id), r = i - a.x, h = o - a.y, f = -a.rotation * (Math.PI / 180), l = Math.cos(f), p = Math.sin(f);
2530
+ let c = (r * l - h * p) / Math.max(1e-3, Math.abs(a.scaleX || 1)), d = (r * p + h * l) / Math.max(1e-3, Math.abs(a.scaleY || 1));
2531
2531
  t.handleOrigin === "top-left" ? (c -= s / 2, d -= n / 2) : t.handleOrigin === "bottom-right" && (c += s / 2, d += n / 2);
2532
2532
  const u = Math.min(s, n) * 0.45, v = Math.min(s, n) * 0.15, b = u - v;
2533
2533
  let m = c / b, y = d / b;
@@ -2544,28 +2544,28 @@ class ci {
2544
2544
  if (!e) return;
2545
2545
  let s = e.handleX ?? o.handleX ?? 0, n = e.handleY ?? o.handleY ?? 0;
2546
2546
  if (((a = o.inputBinding) == null ? void 0 : a.type) === "keyboard" && o.inputBinding.keyboardConfig) {
2547
- const f = o.inputBinding.keyboardConfig;
2548
- let h = s, l = n;
2549
- const c = (f.speed || 5) * t;
2547
+ const h = o.inputBinding.keyboardConfig;
2548
+ let f = s, l = n;
2549
+ const c = (h.speed || 5) * t;
2550
2550
  let d = !1;
2551
- this.activeKeys.has(f.upKey.toLowerCase()) && (l -= c, d = !0), this.activeKeys.has(f.downKey.toLowerCase()) && (l += c, d = !0), this.activeKeys.has(f.leftKey.toLowerCase()) && (h -= c, d = !0), this.activeKeys.has(f.rightKey.toLowerCase()) && (h += c, d = !0), o.joystickType === "1D_X" && (l = 0), o.joystickType === "1D_Y" && (h = 0);
2552
- const u = Math.sqrt(h * h + l * l);
2553
- u > 1 && (h /= u, l /= u), !d && o.isSpringReturn !== !1 && (h += (0 - h) * (10 * t), l += (0 - l) * (10 * t), Math.abs(h) < 0.01 && (h = 0), Math.abs(l) < 0.01 && (l = 0)), s = h, n = l;
2551
+ this.activeKeys.has(h.upKey.toLowerCase()) && (l -= c, d = !0), this.activeKeys.has(h.downKey.toLowerCase()) && (l += c, d = !0), this.activeKeys.has(h.leftKey.toLowerCase()) && (f -= c, d = !0), this.activeKeys.has(h.rightKey.toLowerCase()) && (f += c, d = !0), o.joystickType === "1D_X" && (l = 0), o.joystickType === "1D_Y" && (f = 0);
2552
+ const u = Math.sqrt(f * f + l * l);
2553
+ u > 1 && (f /= u, l /= u), !d && o.isSpringReturn !== !1 && (f += (0 - f) * (10 * t), l += (0 - l) * (10 * t), Math.abs(f) < 0.01 && (f = 0), Math.abs(l) < 0.01 && (l = 0)), s = f, n = l;
2554
2554
  } else if (((r = o.inputBinding) == null ? void 0 : r.type) === "mouse" && o.inputBinding.mouseConfig) {
2555
- const f = o.inputBinding.mouseConfig;
2556
- let h = s, l = n;
2557
- const p = f.sensitivity || 0.01, c = Math.abs(this._mouseDelta.dx) > 0 || Math.abs(this._mouseDelta.dy) > 0;
2558
- f.axisX && (h += this._mouseDelta.dx * p), f.axisY && (l += this._mouseDelta.dy * p), o.joystickType === "1D_X" && (l = 0), o.joystickType === "1D_Y" && (h = 0);
2559
- const d = Math.sqrt(h * h + l * l);
2560
- d > 1 && (h /= d, l /= d), !c && o.isSpringReturn !== !1 && (h += (0 - h) * (10 * t), l += (0 - l) * (10 * t), Math.abs(h) < 0.01 && (h = 0), Math.abs(l) < 0.01 && (l = 0)), s = h, n = l;
2555
+ const h = o.inputBinding.mouseConfig;
2556
+ let f = s, l = n;
2557
+ const p = h.sensitivity || 0.01, c = Math.abs(this._mouseDelta.dx) > 0 || Math.abs(this._mouseDelta.dy) > 0;
2558
+ h.axisX && (f += this._mouseDelta.dx * p), h.axisY && (l += this._mouseDelta.dy * p), o.joystickType === "1D_X" && (l = 0), o.joystickType === "1D_Y" && (f = 0);
2559
+ const d = Math.sqrt(f * f + l * l);
2560
+ d > 1 && (f /= d, l /= d), !c && o.isSpringReturn !== !1 && (f += (0 - f) * (10 * t), l += (0 - l) * (10 * t), Math.abs(f) < 0.01 && (f = 0), Math.abs(l) < 0.01 && (l = 0)), s = f, n = l;
2561
2561
  }
2562
2562
  if (e.handleX = s, e.handleY = n, o.handleX = s, o.handleY = n, o.bindings && o.bindings.length > 0) {
2563
- const f = Math.sqrt(s * s + n * n);
2564
- let h = Math.atan2(n, s) * (180 / Math.PI);
2565
- h < 0 && (h += 360), o.bindings.forEach((l) => {
2563
+ const h = Math.sqrt(s * s + n * n);
2564
+ let f = Math.atan2(n, s) * (180 / Math.PI);
2565
+ f < 0 && (f += 360), o.bindings.forEach((l) => {
2566
2566
  var d, u, v, b, m, y, S, C;
2567
2567
  let p = 0;
2568
- l.sourceAxis === "x" ? p = o.invertX ? -s : s : l.sourceAxis === "y" ? p = o.invertY ? -n : n : l.sourceAxis === "distance" ? p = f : l.sourceAxis === "angle" && (p = h);
2568
+ l.sourceAxis === "x" ? p = o.invertX ? -s : s : l.sourceAxis === "y" ? p = o.invertY ? -n : n : l.sourceAxis === "distance" ? p = h : l.sourceAxis === "angle" && (p = f);
2569
2569
  const c = (d = this.artboard) == null ? void 0 : d.objects.find((w) => w.id === l.targetObjectId);
2570
2570
  if (c) {
2571
2571
  if (l.actionType === "bind" && l.targetProperty && l.isContinuous !== !1) {
@@ -2613,7 +2613,7 @@ class ci {
2613
2613
  }), this._mouseDelta.dx = 0, this._mouseDelta.dy = 0);
2614
2614
  }
2615
2615
  applyBlendState(t, i) {
2616
- var f, h, l, p, c, d, u, v;
2616
+ var h, f, l, p, c, d, u, v;
2617
2617
  if (!t.blendAnimations || t.blendAnimations.length === 0) return;
2618
2618
  let o = 0, e = 0;
2619
2619
  t.blendInputX && (o = this.inputs.get(t.blendInputX) ?? 0), t.blendInputY && (e = this.inputs.get(t.blendInputY) ?? 0);
@@ -2622,7 +2622,7 @@ class ci {
2622
2622
  if (t.blendType === "1D") {
2623
2623
  const b = [...t.blendAnimations].sort((m, y) => m.position[0] - y.position[0]);
2624
2624
  if (b.length === 1) {
2625
- const m = (h = (f = this.artboard) == null ? void 0 : f.animations) == null ? void 0 : h.find((y) => y.id === b[0].animationId);
2625
+ const m = (f = (h = this.artboard) == null ? void 0 : h.animations) == null ? void 0 : f.find((y) => y.id === b[0].animationId);
2626
2626
  m && (s.push({ anim: m, weight: 1 }), n = 1);
2627
2627
  } else {
2628
2628
  let m = 0;
@@ -2729,20 +2729,20 @@ class ci {
2729
2729
  let r = e.property;
2730
2730
  if (a && (r === "x" || r === "y" || r === "rotation"))
2731
2731
  return;
2732
- const f = this.objectStates.get(s);
2733
- if (!f) {
2732
+ const h = this.objectStates.get(s);
2733
+ if (!h) {
2734
2734
  this.frameCount % 600 === 0 && this.debugLog(`Skipping track: Object ${s} not found in state`);
2735
2735
  return;
2736
2736
  }
2737
- const h = this.interpolate(e.keyframes, i);
2738
- if (h !== void 0) {
2737
+ const f = this.interpolate(e.keyframes, i);
2738
+ if (f !== void 0) {
2739
2739
  if (this.frameCount % 240 === 0) {
2740
- const d = (n == null ? void 0 : n.name) || s, u = typeof h == "object" ? JSON.stringify(h).slice(0, 50) : h;
2740
+ const d = (n == null ? void 0 : n.name) || s, u = typeof f == "object" ? JSON.stringify(f).slice(0, 50) : f;
2741
2741
  this.debugLog(`[Anim] Applying ${r} = ${u} to ${d}`);
2742
2742
  }
2743
2743
  if (r.includes(".")) {
2744
2744
  const d = (r || "").split(".");
2745
- let u = f;
2745
+ let u = h;
2746
2746
  for (let v = 0; v < d.length - 1; v++) {
2747
2747
  if (typeof u[d[v]] != "object" || u[d[v]] === null) {
2748
2748
  let b = n;
@@ -2756,17 +2756,17 @@ class ci {
2756
2756
  }
2757
2757
  u = u[d[v]];
2758
2758
  }
2759
- u[d[d.length - 1]] = h, d[d.length - 1] === "color" && (d[d.length - 2] === "fill" || d[d.length - 2] === "stroke") && (u.type = "Solid");
2759
+ u[d[d.length - 1]] = f, d[d.length - 1] === "color" && (d[d.length - 2] === "fill" || d[d.length - 2] === "stroke") && (u.type = "Solid");
2760
2760
  } else
2761
- r === "fill" ? (f.style || (f.style = {}), f.style.fill = h) : r === "stroke" ? (f.style || (f.style = {}), f.style.stroke = h) : f[r] = h;
2761
+ r === "fill" ? (h.style || (h.style = {}), h.style.fill = f) : r === "stroke" ? (h.style || (h.style = {}), h.style.stroke = f) : h[r] = f;
2762
2762
  if (this.physicsEngine && ((c = n == null ? void 0 : n.physics) != null && c.enabled) && n.physics.bodyType === "Static")
2763
2763
  if (r === "x") {
2764
2764
  const d = this.physicsEngine.getPosition(s);
2765
- d && this.physicsEngine.setPosition(s, h, d.y);
2765
+ d && this.physicsEngine.setPosition(s, f, d.y);
2766
2766
  } else if (r === "y") {
2767
2767
  const d = this.physicsEngine.getPosition(s);
2768
- d && this.physicsEngine.setPosition(s, d.x, h);
2769
- } else r === "rotation" && this.physicsEngine.setRotation(s, h * (Math.PI / 180));
2768
+ d && this.physicsEngine.setPosition(s, d.x, f);
2769
+ } else r === "rotation" && this.physicsEngine.setRotation(s, f * (Math.PI / 180));
2770
2770
  }
2771
2771
  });
2772
2772
  }
@@ -2790,8 +2790,8 @@ class ci {
2790
2790
  }
2791
2791
  if (Array.isArray(o.value) && Array.isArray(e.value))
2792
2792
  return o.value.length === e.value.length ? o.value.map((a, r) => {
2793
- const f = e.value[r];
2794
- return typeof a == "number" && typeof f == "number" ? a + (f - a) * n : n < 0.5 ? a : f;
2793
+ const h = e.value[r];
2794
+ return typeof a == "number" && typeof h == "number" ? a + (h - a) * n : n < 0.5 ? a : h;
2795
2795
  }) : n < 0.5 ? o.value : e.value;
2796
2796
  if (typeof o.value == "object" && typeof e.value == "object" && o.value !== null && e.value !== null) {
2797
2797
  if (o.value.width !== void 0 && o.value.color !== void 0)
@@ -2799,9 +2799,9 @@ class ci {
2799
2799
  if (o.value.type && e.value.type)
2800
2800
  return this.interpolateFill(o.value, e.value, n);
2801
2801
  const a = {};
2802
- return (/* @__PURE__ */ new Set([...Object.keys(o.value), ...Object.keys(e.value)])).forEach((f) => {
2803
- const h = o.value[f], l = e.value[f];
2804
- typeof h == "number" && typeof l == "number" ? a[f] = h + (l - h) * n : h === void 0 ? a[f] = l : l === void 0 ? a[f] = h : a[f] = n < 0.5 ? h : l;
2802
+ return (/* @__PURE__ */ new Set([...Object.keys(o.value), ...Object.keys(e.value)])).forEach((h) => {
2803
+ const f = o.value[h], l = e.value[h];
2804
+ typeof f == "number" && typeof l == "number" ? a[h] = f + (l - f) * n : f === void 0 ? a[h] = l : l === void 0 ? a[h] = f : a[h] = n < 0.5 ? f : l;
2805
2805
  }), a;
2806
2806
  }
2807
2807
  return typeof o.value == "number" && typeof e.value == "number" ? o.value + (e.value - o.value) * n : n < 0.5 ? o.value : e.value;
@@ -2820,11 +2820,11 @@ class ci {
2820
2820
  g: parseInt(b.substring(2, 4), 16),
2821
2821
  b: parseInt(b.substring(4, 6), 16)
2822
2822
  };
2823
- }, r = a(s), f = a(n), h = Math.round(r.r + (f.r - r.r) * o), l = Math.round(r.g + (f.g - r.g) * o), p = Math.round(r.b + (f.b - r.b) * o), c = (v) => {
2823
+ }, r = a(s), h = a(n), f = Math.round(r.r + (h.r - r.r) * o), l = Math.round(r.g + (h.g - r.g) * o), p = Math.round(r.b + (h.b - r.b) * o), c = (v) => {
2824
2824
  const b = Math.max(0, Math.min(255, v)).toString(16);
2825
2825
  return b.length === 1 ? "0" + b : b;
2826
2826
  };
2827
- return `#${c(h)}${c(l)}${c(p)}`;
2827
+ return `#${c(f)}${c(l)}${c(p)}`;
2828
2828
  }
2829
2829
  interpolateStops(t, i, o) {
2830
2830
  return !t || !i || t.length !== i.length ? o < 0.5 ? t : i : t.map((e, s) => {
@@ -2881,46 +2881,46 @@ class ci {
2881
2881
  }
2882
2882
  }
2883
2883
  (this.artboard.clipContent === !0 || this.artboard.clip_content === !0) && (t.beginPath(), t.rect(0, 0, s, n), t.clip());
2884
- const f = /* @__PURE__ */ new Map();
2885
- this.artboard.objects.forEach((p) => f.set(p.id, p)), this.artboard.objects.filter((p) => !p.parentId).map((p, c) => {
2884
+ const h = /* @__PURE__ */ new Map();
2885
+ this.artboard.objects.forEach((p) => h.set(p.id, p)), this.artboard.objects.filter((p) => !p.parentId).map((p, c) => {
2886
2886
  const d = this.objectStates.get(p.id), u = (d == null ? void 0 : d.zIndex) ?? c;
2887
2887
  return { obj: p, zIndex: u };
2888
2888
  }).sort((p, c) => p.zIndex - c.zIndex).forEach(({ obj: p }) => {
2889
- this.renderObject(t, p, f);
2889
+ this.renderObject(t, p, h);
2890
2890
  }), this._emitterPools.forEach((p, c) => {
2891
- if (!(p.length === 0 || !f.get(c)))
2891
+ if (!(p.length === 0 || !h.get(c)))
2892
2892
  for (const u of p)
2893
2893
  t.save(), t.globalAlpha = u.opacity, t.fillStyle = u.color, t.beginPath(), t.arc(u.x, u.y, Math.max(1, u.size * u.opacity), 0, Math.PI * 2), t.fill(), t.restore();
2894
2894
  }), 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();
2895
2895
  }
2896
2896
  isObjectInView(t, i, o, e, s, n = 0) {
2897
- const a = t.getTransform(), r = i * a.a + o * a.c + a.e, f = i * a.b + o * a.d + a.f, h = Math.sqrt(a.a * a.a + a.b * a.b), l = Math.sqrt(a.c * a.c + a.d * a.d), p = (e / 2 + n) * h, c = (s / 2 + n) * l;
2898
- return r + p >= 0 && r - p <= this.canvasWidth && f + c >= 0 && f - c <= this.canvasHeight;
2897
+ const a = t.getTransform(), r = i * a.a + o * a.c + a.e, h = i * a.b + o * a.d + a.f, f = Math.sqrt(a.a * a.a + a.b * a.b), l = Math.sqrt(a.c * a.c + a.d * a.d), p = (e / 2 + n) * f, c = (s / 2 + n) * l;
2898
+ return r + p >= 0 && r - p <= this.canvasWidth && h + c >= 0 && h - c <= this.canvasHeight;
2899
2899
  }
2900
2900
  calculateTransform(t, i, o, e, s, n) {
2901
- let a = 1, r = 1, f = 1;
2902
- const h = o / e, l = t / i;
2901
+ let a = 1, r = 1, h = 1;
2902
+ const f = o / e, l = t / i;
2903
2903
  switch (s) {
2904
2904
  case "Contain":
2905
- l > h ? f = i / e : f = t / o, a = r = f;
2905
+ l > f ? h = i / e : h = t / o, a = r = h;
2906
2906
  break;
2907
2907
  case "Cover":
2908
- l > h ? f = t / o : f = i / e, a = r = f;
2908
+ l > f ? h = t / o : h = i / e, a = r = h;
2909
2909
  break;
2910
2910
  case "Fill":
2911
2911
  a = t / o, r = i / e;
2912
2912
  break;
2913
2913
  case "FitWidth":
2914
- f = t / o, a = r = f;
2914
+ h = t / o, a = r = h;
2915
2915
  break;
2916
2916
  case "FitHeight":
2917
- f = i / e, a = r = f;
2917
+ h = i / e, a = r = h;
2918
2918
  break;
2919
2919
  case "None":
2920
2920
  a = r = 1;
2921
2921
  break;
2922
2922
  case "ScaleDown":
2923
- f = Math.min(t / o, i / e), f > 1 && (f = 1), a = r = f;
2923
+ h = Math.min(t / o, i / e), h > 1 && (h = 1), a = r = h;
2924
2924
  break;
2925
2925
  default:
2926
2926
  a = r = 1;
@@ -2965,12 +2965,12 @@ class ci {
2965
2965
  X = Math.min(X, D.x), tt = Math.max(tt, D.x), R = Math.min(R, D.y), O = Math.max(O, D.y);
2966
2966
  }), a === 0 && (a = tt - X), r === 0 && (r = O - R);
2967
2967
  }
2968
- const f = (X) => {
2968
+ const h = (X) => {
2969
2969
  if (X)
2970
2970
  return X.corner_radius ?? X.cornerRadius;
2971
- }, h = f(e) ?? f(n) ?? f(s) ?? f(i.style) ?? f(i.geometry) ?? 0;
2971
+ }, f = h(e) ?? h(n) ?? h(s) ?? h(i.style) ?? h(i.geometry) ?? 0;
2972
2972
  let l = { ...s, width: a, height: r };
2973
- if (delete l.cornerRadius, l.corner_radius = h, l.type === "Path" && i.weights && i.bindMatrices && l.points) {
2973
+ if (delete l.cornerRadius, l.corner_radius = f, l.type === "Path" && i.weights && i.bindMatrices && l.points) {
2974
2974
  const X = this.getGlobalTransform(i.id);
2975
2975
  if (X) {
2976
2976
  const tt = li(
@@ -2990,30 +2990,30 @@ class ci {
2990
2990
  let tt = e.x !== void 0 ? e.x : ((b = e.transform) == null ? void 0 : b.x) ?? 0, R = e.y !== void 0 ? e.y : ((m = e.transform) == null ? void 0 : m.y) ?? 0, O = e.rotation !== void 0 ? e.rotation : ((y = e.transform) == null ? void 0 : y.rotation) ?? 0, D = e.scale_x !== void 0 ? e.scale_x : ((S = e.transform) == null ? void 0 : S.scale_x) ?? 1, q = e.scale_y !== void 0 ? e.scale_y : ((C = e.transform) == null ? void 0 : C.scale_y) ?? 1;
2991
2991
  if (c && X > 0) {
2992
2992
  if (p.type === "Linear") {
2993
- const ft = p.offsetX || 0, pt = p.offsetY || 0, at = p.rotation || 0, B = p.scale !== void 0 ? p.scale : 1;
2994
- tt += X * ft, R += X * pt, O += X * at, D *= Math.pow(B, X), q *= Math.pow(B, X);
2993
+ const ht = p.offsetX || 0, pt = p.offsetY || 0, at = p.rotation || 0, B = p.scale !== void 0 ? p.scale : 1;
2994
+ tt += X * ht, R += X * pt, O += X * at, D *= Math.pow(B, X), q *= Math.pow(B, X);
2995
2995
  } else if (p.type === "Grid") {
2996
- const ft = p.cols || Math.ceil(Math.sqrt(p.count)), pt = p.gapX || 0, at = p.gapY || 0, B = Math.floor(X / ft), nt = X % ft, Z = a + pt, Pt = r + at;
2996
+ const ht = p.cols || Math.ceil(Math.sqrt(p.count)), pt = p.gapX || 0, at = p.gapY || 0, B = Math.floor(X / ht), nt = X % ht, Z = a + pt, Pt = r + at;
2997
2997
  tt += nt * Z, R += B * Pt;
2998
2998
  } else if (p.type === "Radial") {
2999
- const ft = p.radius || 100, pt = p.startAngle || 0, B = (p.endAngle || 360) - pt, nt = p.count > 1 ? B / (B === 360 ? p.count : p.count - 1) : 0, Z = pt + X * nt, Pt = Z * Math.PI / 180;
3000
- tt = e.x + ft * Math.cos(Pt), R = e.y + ft * Math.sin(Pt), O += Z;
2999
+ const ht = p.radius || 100, pt = p.startAngle || 0, B = (p.endAngle || 360) - pt, nt = p.count > 1 ? B / (B === 360 ? p.count : p.count - 1) : 0, Z = pt + X * nt, Pt = Z * Math.PI / 180;
3000
+ tt = e.x + ht * Math.cos(Pt), R = e.y + ht * Math.sin(Pt), O += Z;
3001
3001
  }
3002
3002
  }
3003
3003
  const ot = i.type === "Group" || i.type === "Frame" || i.type === "Component", yt = a > 0 && r > 0;
3004
3004
  if (!ot && yt) {
3005
- const ft = (((w = n.shadow) == null ? void 0 : w.isEnabled) !== !1 ? (((M = n.shadow) == null ? void 0 : M.blur) || 0) + 10 : 0) + (((I = n.blur) == null ? void 0 : I.isEnabled) !== !1 && ((k = n.blur) == null ? void 0 : k.radius) || 0) + 20;
3006
- if (!this.isObjectInView(t, tt, R, a, r, ft))
3005
+ const ht = (((w = n.shadow) == null ? void 0 : w.isEnabled) !== !1 ? (((M = n.shadow) == null ? void 0 : M.blur) || 0) + 10 : 0) + (((I = n.blur) == null ? void 0 : I.isEnabled) !== !1 && ((k = n.blur) == null ? void 0 : k.radius) || 0) + 20;
3006
+ if (!this.isObjectInView(t, tt, R, a, r, ht))
3007
3007
  continue;
3008
3008
  }
3009
3009
  this.debug_objectsRendered++, t.save();
3010
3010
  const bt = [], gt = n.blur || ((T = i.style) == null ? void 0 : T.blur);
3011
3011
  gt && gt.amount > 0 && bt.push(`blur(${gt.amount}px)`);
3012
3012
  const Et = n.effects || ((L = i.style) == null ? void 0 : L.effects) || [];
3013
- let It = Et.find((ft) => ft.isEnabled !== !1 && (ft.type === "BackgroundBlur" || ft.type === "LayerBlur"));
3014
- It || (It = n.effect || ((P = i.style) == null ? void 0 : P.effect) || Et.find((ft) => ft.isEnabled !== !1));
3015
- const St = It, Xt = (St == null ? void 0 : St.isEnabled) !== !1, le = St == null ? void 0 : St.type, he = (St == null ? void 0 : St.radius) ?? 10;
3016
- Xt && le === "LayerBlur" ? bt.push(`blur(${he}px)`) : Xt && le === "BackgroundBlur" && (n === i.style && (n = { ...n }), n.fill = { type: "None" });
3013
+ let It = Et.find((ht) => ht.isEnabled !== !1 && (ht.type === "BackgroundBlur" || ht.type === "LayerBlur"));
3014
+ It || (It = n.effect || ((P = i.style) == null ? void 0 : P.effect) || Et.find((ht) => ht.isEnabled !== !1));
3015
+ const St = It, Xt = (St == null ? void 0 : St.isEnabled) !== !1, le = St == null ? void 0 : St.type, fe = (St == null ? void 0 : St.radius) ?? 10;
3016
+ Xt && le === "LayerBlur" ? bt.push(`blur(${fe}px)`) : Xt && le === "BackgroundBlur" && (n === i.style && (n = { ...n }), n.fill = { type: "None" });
3017
3017
  const et = ((_ = s == null ? void 0 : s.type) == null ? void 0 : _.toLowerCase().includes("image")) || ((E = i.type) == null ? void 0 : E.toLowerCase().includes("image")), mt = n.adjustments && Object.keys(n.adjustments).length > 0 ? n.adjustments : null, Rt = s != null && s.adjustments && Object.keys(s.adjustments).length > 0 ? s.adjustments : null, _t = et ? Rt || mt : mt || Rt, dt = et && !_t ? {
3018
3018
  exposure: 0,
3019
3019
  contrast: 0,
@@ -3027,13 +3027,13 @@ class ci {
3027
3027
  hue: 0
3028
3028
  } : _t;
3029
3029
  if (e && dt && (e.geometry = e.geometry || {}, e.geometry.adjustments = { ...dt }), dt) {
3030
- const ft = (dt.exposure || 0) / 100, pt = dt.contrast || 0, at = 1 + (dt.saturation || 0) / 100, B = (dt.temperature || 0) / 200, nt = (dt.tint || 0) / 200, Z = (dt.highlights || 0) / 500, Pt = (dt.shadows || 0) / 500;
3030
+ const ht = (dt.exposure || 0) / 100, pt = dt.contrast || 0, at = 1 + (dt.saturation || 0) / 100, B = (dt.temperature || 0) / 200, nt = (dt.tint || 0) / 200, Z = (dt.highlights || 0) / 500, Pt = (dt.shadows || 0) / 500;
3031
3031
  let xt = "", kt = "SourceGraphic";
3032
- if (ft !== 0 && (xt += `
3032
+ if (ht !== 0 && (xt += `
3033
3033
  <feComponentTransfer in="${kt}" result="exposure">
3034
- <feFuncR type="linear" slope="1" intercept="${ft}"/>
3035
- <feFuncG type="linear" slope="1" intercept="${ft}"/>
3036
- <feFuncB type="linear" slope="1" intercept="${ft}"/>
3034
+ <feFuncR type="linear" slope="1" intercept="${ht}"/>
3035
+ <feFuncG type="linear" slope="1" intercept="${ht}"/>
3036
+ <feFuncB type="linear" slope="1" intercept="${ht}"/>
3037
3037
  </feComponentTransfer>`, kt = "exposure"), pt !== 0) {
3038
3038
  const Mt = (pt + 100) / 100, $ = 0.5 * (1 - Mt);
3039
3039
  xt += `
@@ -3087,7 +3087,7 @@ class ci {
3087
3087
  t.globalAlpha = Ft * Dt;
3088
3088
  const $t = e.compositeOperation || e.blendMode;
3089
3089
  if ($t && $t !== "Normal") {
3090
- const ft = $t.toLowerCase();
3090
+ const ht = $t.toLowerCase();
3091
3091
  [
3092
3092
  "multiply",
3093
3093
  "screen",
@@ -3117,7 +3117,7 @@ class ci {
3117
3117
  "xor",
3118
3118
  "multiply",
3119
3119
  "screen"
3120
- ].includes(ft) && (t.globalCompositeOperation = ft);
3120
+ ].includes(ht) && (t.globalCompositeOperation = ht);
3121
3121
  }
3122
3122
  const Ot = t, Vt = e.masks || (i.maskedBy ? [{
3123
3123
  maskId: i.maskedBy,
@@ -3128,16 +3128,16 @@ class ci {
3128
3128
  isVisible: !0
3129
3129
  }] : []);
3130
3130
  let ie = !1;
3131
- const me = Vt.filter((ft) => ft.isVisible !== !1 && o.has(ft.maskId));
3131
+ const me = Vt.filter((ht) => ht.isVisible !== !1 && o.has(ht.maskId));
3132
3132
  if (me.length > 0) {
3133
- const ft = me[0], pt = o.get(ft.maskId), at = this.objectStates.get(pt.id);
3133
+ const ht = me[0], pt = o.get(ht.maskId), at = this.objectStates.get(pt.id);
3134
3134
  at && at.visible !== !1 && (ie = !0, (!this.maskBuffer || this.maskBuffer.width !== this.canvasWidth || this.maskBuffer.height !== this.canvasHeight) && (this.maskBuffer = document.createElement("canvas"), this.maskBuffer.width = this.canvasWidth, this.maskBuffer.height = this.canvasHeight, this.maskCtx = this.maskBuffer.getContext("2d", { willReadFrequently: !0 }), this.maskCtx && (this.maskCtx.imageSmoothingEnabled = !0, this.maskCtx.imageSmoothingQuality = "high")), 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, this.maskBuffer.width, this.maskBuffer.height), this.rootTransform && this.maskCtx.setTransform(this.rootTransform), i.parentId && this.applyAbsoluteTransform(this.maskCtx, i.parentId, o), this.maskCtx.save(), this.maskCtx.globalAlpha = 1, t = this.maskCtx, t.filter = Ot.filter);
3135
3135
  }
3136
3136
  t.translate(Math.round(tt), Math.round(R)), t.rotate(O * Math.PI / 180);
3137
3137
  const ye = e.skew_x || 0, Ut = e.skew_y || 0;
3138
3138
  if (ye !== 0 || Ut !== 0) {
3139
- const ft = Math.tan(ye * Math.PI / 180), pt = Math.tan(Ut * Math.PI / 180);
3140
- t.transform(1 + ft * pt, pt, ft, 1, 0, 0);
3139
+ const ht = Math.tan(ye * Math.PI / 180), pt = Math.tan(Ut * Math.PI / 180);
3140
+ t.transform(1 + ht * pt, pt, ht, 1, 0, 0);
3141
3141
  }
3142
3142
  const Se = e.rotate_x !== void 0 ? e.rotate_x : ((A = e.transform) == null ? void 0 : A.rotate_x) ?? 0, Pe = e.rotate_y !== void 0 ? e.rotate_y : ((W = e.transform) == null ? void 0 : W.rotate_y) ?? 0, Ce = 1 + (e.translate_z !== void 0 ? e.translate_z : ((z = e.transform) == null ? void 0 : z.translate_z) ?? 0) / 1e3, Ae = (e.flip_x === !0 ? -1 : 1) * Math.cos(Pe * Math.PI / 180) * Ce, xe = (e.flip_y === !0 ? -1 : 1) * Math.cos(Se * Math.PI / 180) * Ce;
3143
3143
  t.scale(
@@ -3146,15 +3146,15 @@ class ci {
3146
3146
  ), n.shadow && n.shadow.isEnabled !== !0 && ((n.shadow.blur || 0) > 0 || Math.abs(n.shadow.offsetX || 0) > 0 || Math.abs(n.shadow.offsetY || 0) > 0) && (n.shadow.isEnabled = !0);
3147
3147
  const se = n.shadow;
3148
3148
  if (se && se.isEnabled !== !1) {
3149
- let ft = se.color || "#000000";
3150
- (G = (Y = this.artboard) == null ? void 0 : Y.tokens) != null && G.colors && this.artboard.tokens.colors[ft] && (ft = this.artboard.tokens.colors[ft]);
3149
+ let ht = se.color || "#000000";
3150
+ (G = (Y = this.artboard) == null ? void 0 : Y.tokens) != null && G.colors && this.artboard.tokens.colors[ht] && (ht = this.artboard.tokens.colors[ht]);
3151
3151
  const pt = this.normalizeOpacity(se.opacity ?? 100), at = se.spread || 0, nt = (se.blur || 0) + at * 1.5;
3152
- let Z = ft;
3153
- if (ft.startsWith("#")) {
3154
- const kt = ft.replace("#", ""), At = parseInt(kt.substring(0, 2), 16), Mt = parseInt(kt.substring(2, 4), 16), $ = parseInt(kt.substring(4, 6), 16);
3152
+ let Z = ht;
3153
+ if (ht.startsWith("#")) {
3154
+ const kt = ht.replace("#", ""), At = parseInt(kt.substring(0, 2), 16), Mt = parseInt(kt.substring(2, 4), 16), $ = parseInt(kt.substring(4, 6), 16);
3155
3155
  Z = `rgba(${At}, ${Mt}, ${$}, ${pt})`;
3156
- } else if (ft.startsWith("rgba")) {
3157
- const kt = ft.match(/[\d.]+/g);
3156
+ } else if (ht.startsWith("rgba")) {
3157
+ const kt = ht.match(/[\d.]+/g);
3158
3158
  if (kt && kt.length >= 4) {
3159
3159
  const At = kt[0], Mt = kt[1], $ = kt[2], Wt = kt[3];
3160
3160
  Z = `rgba(${At}, ${Mt}, ${$}, ${parseFloat(Wt) * pt})`;
@@ -3162,37 +3162,38 @@ class ci {
3162
3162
  }
3163
3163
  const Pt = t.getTransform(), xt = Math.sqrt(Pt.a * Pt.a + Pt.b * Pt.b) || 1;
3164
3164
  t.shadowColor = Z, t.shadowBlur = nt * xt, t.shadowOffsetX = (se.offsetX || 0) * xt, t.shadowOffsetY = (se.offsetY || 0) * xt;
3165
- }
3165
+ } else
3166
+ t.shadowColor = "transparent", t.shadowBlur = 0, t.shadowOffsetX = 0, t.shadowOffsetY = 0;
3166
3167
  const jt = i.liquidFill || ((N = i.style) == null ? void 0 : N.liquidFill);
3167
3168
  if (jt && jt.enabled) {
3168
3169
  t.save();
3169
- const ft = jt.fillLevel ?? 0.5;
3170
+ const ht = jt.fillLevel ?? 0.5;
3170
3171
  t.beginPath();
3171
- const pt = r / 2 - r * ft;
3172
- t.rect(-a / 2, pt, a, r * ft), t.clip(), t.fillStyle = jt.color || "#3b82f6", t.globalAlpha = t.globalAlpha * (jt.opacity ?? 1);
3172
+ const pt = r / 2 - r * ht;
3173
+ t.rect(-a / 2, pt, a, r * ht), t.clip(), t.fillStyle = jt.color || "#3b82f6", t.globalAlpha = t.globalAlpha * (jt.opacity ?? 1);
3173
3174
  }
3174
3175
  if ((s == null ? void 0 : s.type) === "Text")
3175
3176
  this._renderText(t, i, l, n, e, a, r, !1, !1, D, q);
3176
3177
  else if ((s == null ? void 0 : s.type) === "Image") {
3177
- const ft = s.originalSrc || s.src;
3178
- if (ft) {
3179
- let pt = this.imageCache.get(ft);
3178
+ const ht = s.originalSrc || s.src;
3179
+ if (ht) {
3180
+ let pt = this.imageCache.get(ht);
3180
3181
  pt || (pt = new Image(), pt.onload = () => {
3181
3182
  this.log(`[ExodeUI] Image loaded successfully, size: ${pt.naturalWidth}x${pt.naturalHeight}`);
3182
3183
  }, pt.onerror = (nt) => {
3183
- console.error("[ExodeUI] Image load failed:", nt, `Src preview: ${ft.substring(0, 100)}...`);
3184
- }, pt.src = ft, this.imageCache.set(ft, pt));
3184
+ console.error("[ExodeUI] Image load failed:", nt, `Src preview: ${ht.substring(0, 100)}...`);
3185
+ }, pt.src = ht, this.imageCache.set(ht, pt));
3185
3186
  const at = n.stroke && n.stroke.width > 0 && n.stroke.isEnabled !== !1, B = (((J = n.stroke) == null ? void 0 : J.alignment) || "center").toLowerCase();
3186
- if (at && (B === "outside" || B === "center") && this.applyStrokeAlignment(t, n, l, a, r, h, D, q), n.fill && n.fill.type !== "None") {
3187
+ if (at && (B === "outside" || B === "center") && this.applyStrokeAlignment(t, n, l, a, r, f, D, q), n.fill && n.fill.type !== "None") {
3187
3188
  t.save();
3188
3189
  const nt = t.globalAlpha, Z = this.createCanvasFill(t, n.fill, a, r);
3189
- t.fillStyle = Z || n.fill.color || "transparent", t.globalAlpha = nt * this.normalizeOpacity(n.fill.opacity ?? 100), h !== 0 ? (this.drawRoundRect(t, -a / 2, -r / 2, a, r, h), t.fill()) : t.fillRect(-a / 2, -r / 2, a, r), t.globalAlpha = nt, t.restore();
3190
+ t.fillStyle = Z || n.fill.color || "transparent", t.globalAlpha = nt * this.normalizeOpacity(n.fill.opacity ?? 100), f !== 0 ? (this.drawRoundRect(t, -a / 2, -r / 2, a, r, f), t.fill()) : t.fillRect(-a / 2, -r / 2, a, r), t.globalAlpha = nt, t.restore();
3190
3191
  }
3191
- pt.complete && pt.naturalWidth > 0 ? (h !== 0 ? (t.save(), this.drawRoundRect(t, -a / 2, -r / 2, a, r, h), t.clip(), t.drawImage(pt, -a / 2, -r / 2, a, r), t.restore()) : t.drawImage(pt, -a / 2, -r / 2, a, r), at && B === "inside" && this.applyStrokeAlignment(t, n, l, a, r, h, D, q)) : at && B === "inside" && this.applyStrokeAlignment(t, n, l, a, r, h, D, q);
3192
+ pt.complete && pt.naturalWidth > 0 ? (f !== 0 ? (t.save(), this.drawRoundRect(t, -a / 2, -r / 2, a, r, f), t.clip(), t.drawImage(pt, -a / 2, -r / 2, a, r), t.restore()) : t.drawImage(pt, -a / 2, -r / 2, a, r), at && B === "inside" && this.applyStrokeAlignment(t, n, l, a, r, f, D, q)) : at && B === "inside" && this.applyStrokeAlignment(t, n, l, a, r, f, D, q);
3192
3193
  }
3193
3194
  } else if (s.type === "SVG") {
3194
- const ft = s.svgContent;
3195
- if (ft) {
3195
+ const ht = s.svgContent;
3196
+ if (ht) {
3196
3197
  const pt = n.palette || [], at = n.fill, B = n.stroke, nt = at ? this.normalizeOpacity(at.opacity ?? 100) : 1, Z = (at == null ? void 0 : at.type) === "Solid" && (!B || B.isEnabled === !1 || B.type === "Solid" && B.color === at.color), Pt = at && at.type !== "None" ? Z ? "monochrome" : at.type === "Solid" ? (at.color || "") + "|opacity:" + nt : JSON.stringify(at.stops || []) + "|opacity:" + nt : "", xt = B && B.isEnabled !== !1 && (B.width || 0) > 0 ? Z ? [
3197
3198
  "monochrome",
3198
3199
  B.width || 0,
@@ -3223,7 +3224,7 @@ class ci {
3223
3224
  let At = this.imageCache.get(kt);
3224
3225
  if (!At) {
3225
3226
  At = new Image(), At.crossOrigin = "anonymous";
3226
- let $ = ft;
3227
+ let $ = ht;
3227
3228
  $.match(/xmlns=["']http:\/\/www\.w3\.org\/2000\/svg["']/i) || ($ = $.replace(/<svg([^>]*)>/i, (rt, V) => `<svg xmlns="http://www.w3.org/2000/svg"${V}>`));
3228
3229
  let Wt = s.width || a || 100, Kt = s.height || r || 100;
3229
3230
  const te = $.match(/viewBox=["']\s*0\s+0\s+([\d.]+)\s+([\d.]+)\s*["']/i);
@@ -3287,7 +3288,7 @@ class ci {
3287
3288
  `stroke:${st}`
3288
3289
  );
3289
3290
  let vt = s.width || a || 100, Yt = s.height || r || 100;
3290
- const Qt = ft.match(/viewBox=["']\s*0\s+0\s+([\d.]+)\s+([\d.]+)\s*["']/i);
3291
+ const Qt = ht.match(/viewBox=["']\s*0\s+0\s+([\d.]+)\s+([\d.]+)\s*["']/i);
3291
3292
  if (Qt) {
3292
3293
  const zt = parseFloat(Qt[1]), oe = parseFloat(Qt[2]);
3293
3294
  !isNaN(zt) && !isNaN(oe) && (vt = zt, Yt = oe);
@@ -3307,29 +3308,29 @@ class ci {
3307
3308
  if (zt >= oe)
3308
3309
  de = `0 ${we}`, ce = 0;
3309
3310
  else {
3310
- const fe = we * (oe - zt), ke = we - fe;
3311
- ce = -(we * (zt + Be + We)), de = `${fe} ${ke}`;
3311
+ const he = we * (oe - zt), ke = we - he;
3312
+ ce = -(we * (zt + Be + We)), de = `${he} ${ke}`;
3312
3313
  }
3313
3314
  $.match(/\bstroke-dasharray\s*=/i) ? $ = $.replace(/\bstroke-dasharray\s*=\s*["'][^"']*["']/gi, `stroke-dasharray="${de}"`) : $ = $.replace(/<(path|circle|rect|ellipse|polygon|polyline)/gi, `<$1 stroke-dasharray="${de}"`), $ = $.replace(/stroke-dasharray\s*:\s*[^;"')]+/gi, `stroke-dasharray:${de}`), $.match(/\bstroke-dashoffset\s*=/i) ? $ = $.replace(/\bstroke-dashoffset\s*=\s*["'][^"']*["']/gi, `stroke-dashoffset="${ce}"`) : $ = $.replace(/<(path|circle|rect|ellipse|polygon|polyline)/gi, `<$1 stroke-dashoffset="${ce}"`), $ = $.replace(/stroke-dashoffset\s*:\s*[^;"')]+/gi, `stroke-dashoffset:${ce}`);
3314
3315
  } else if (B.dashArray && B.dashArray.length > 0) {
3315
3316
  const zt = B.dashArray.join(" ");
3316
3317
  $ = $.replace(/\bstroke-dasharray\s*=\s*["'][^"']*["']/gi, `stroke-dasharray="${zt}"`), $ = $.replace(/stroke-dasharray\s*:\s*[^;"')]+/gi, `stroke-dasharray:${zt}`), B.dashOffset && ($ = $.replace(/\bstroke-dashoffset\s*=\s*["'][^"']*["']/gi, `stroke-dashoffset="${B.dashOffset}"`), $ = $.replace(/stroke-dashoffset\s*:\s*[^;"')]+/gi, `stroke-dashoffset:${B.dashOffset}`));
3317
3318
  }
3318
- if (!/\bstroke\s*=\s*["']/i.test(ft) && !new RegExp("(?<![a-z-])stroke\\s*:", "i").test(ft)) {
3319
+ if (!/\bstroke\s*=\s*["']/i.test(ht) && !new RegExp("(?<![a-z-])stroke\\s*:", "i").test(ht)) {
3319
3320
  let zt = "", oe = "";
3320
3321
  if (Ye) {
3321
- const de = s.width || a || 100, ce = s.height || r || 100, fe = (de + ce) * 2, ke = Math.max(0, Math.min(1, Re)), Xe = Math.max(0, Math.min(1, Oe)), Ve = (Fe % 1 + 1) % 1, Ne = ($e % 1 + 1) % 1;
3322
+ const de = s.width || a || 100, ce = s.height || r || 100, he = (de + ce) * 2, ke = Math.max(0, Math.min(1, Re)), Xe = Math.max(0, Math.min(1, Oe)), Ve = (Fe % 1 + 1) % 1, Ne = ($e % 1 + 1) % 1;
3322
3323
  if (ke >= Xe)
3323
- zt = ` stroke-dasharray="0 ${fe}"`, oe = ' stroke-dashoffset="0"';
3324
+ zt = ` stroke-dasharray="0 ${he}"`, oe = ' stroke-dashoffset="0"';
3324
3325
  else {
3325
- const De = fe * (Xe - ke), He = fe - De, H = -(fe * (ke + Ve + Ne));
3326
+ const De = he * (Xe - ke), He = he - De, H = -(he * (ke + Ve + Ne));
3326
3327
  zt = ` stroke-dasharray="${De} ${He}"`, oe = ` stroke-dashoffset="${H}"`;
3327
3328
  }
3328
3329
  } else (x = B.dashArray) != null && x.length && (zt = ` stroke-dasharray="${B.dashArray.join(" ")}"`, B.dashOffset && (oe = ` stroke-dashoffset="${B.dashOffset}"`));
3329
3330
  const we = ` stroke-linecap="${B.lineCap || "round"}"`, Be = ` stroke-linejoin="${B.lineJoin || "round"}"`, We = `stroke="${st}" stroke-width="${Nt}" stroke-opacity="${rt}"${we}${Be}${zt}${oe}`;
3330
3331
  $ = $.replace(
3331
3332
  /(<svg[^>]*>)(\s*(?:<defs>[\s\S]*?<\/defs>)?)/i,
3332
- (de, ce, fe) => `${ce}${fe}<g ${We}>`
3333
+ (de, ce, he) => `${ce}${he}<g ${We}>`
3333
3334
  ), $ = $.replace(/<\/svg>/i, "</g></svg>");
3334
3335
  }
3335
3336
  } else B && B.isEnabled === !1 && ($ = $.replace(/\bstroke\s*=\s*["'][^"']*["']/gi, 'stroke="none"'), $ = $.replace(new RegExp(`(?<![a-z-])stroke\\s*:\\s*(?!none|transparent)[^;"')]+`, "gi"), "stroke:none"));
@@ -3350,37 +3351,37 @@ class ci {
3350
3351
  this.maskBuffer || (this.maskBuffer = document.createElement("canvas"), this.maskCtx = this.maskBuffer.getContext("2d")), this.maskBuffer.width = $, this.maskBuffer.height = Wt, 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, $, Wt), this.maskCtx.drawImage(Mt, 0, 0, $, Wt), this.maskCtx.globalCompositeOperation = "source-in";
3351
3352
  const Kt = at.color || "#000000", te = this.normalizeOpacity(at.opacity ?? 100);
3352
3353
  this.maskCtx.fillStyle = Kt, this.maskCtx.globalAlpha = te, this.maskCtx.fillRect(0, 0, $, Wt), t.drawImage(this.maskBuffer, -$ / 2, -Wt / 2, $, Wt);
3353
- } else h !== 0 ? (t.save(), this.drawRoundRect(t, -$ / 2, -Wt / 2, $, Wt, h), t.clip(), t.drawImage(Mt, -$ / 2, -Wt / 2, $, Wt), t.restore()) : t.drawImage(Mt, -$ / 2, -Wt / 2, $, Wt);
3354
+ } else f !== 0 ? (t.save(), this.drawRoundRect(t, -$ / 2, -Wt / 2, $, Wt, f), t.clip(), t.drawImage(Mt, -$ / 2, -Wt / 2, $, Wt), t.restore()) : t.drawImage(Mt, -$ / 2, -Wt / 2, $, Wt);
3354
3355
  }
3355
3356
  }
3356
3357
  } else if (l.type === "LineGraph")
3357
3358
  this.renderLineGraph(t, l, a, r);
3358
3359
  else if (i.type === "Shape") {
3359
- if (this.applyPath(t, l, a, r, h), t.save(), n.blur && n.blur.amount > 0 && (t.filter = `blur(${n.blur.amount}px)`), n.fill) {
3360
- const ft = t.globalAlpha;
3360
+ if (this.applyPath(t, l, a, r, f), t.save(), n.blur && n.blur.amount > 0 && (t.filter = `blur(${n.blur.amount}px)`), n.fill) {
3361
+ const ht = t.globalAlpha;
3361
3362
  if (((F = n.fill) == null ? void 0 : F.type) === "Image" && (n.fill.originalSrc || n.fill.src)) {
3362
3363
  const pt = n.fill.originalSrc || n.fill.src;
3363
3364
  let at = this.imageCache.get(pt);
3364
- at || (at = new Image(), at.src = pt, this.imageCache.set(pt, at)), at.complete && at.naturalWidth > 0 && (t.save(), this.applyPath(t, l, a, r, h), t.clip(), this.renderFittedImage(t, at, -a / 2, -r / 2, a, r, n.fill.fillMode), t.restore());
3365
+ at || (at = new Image(), at.src = pt, this.imageCache.set(pt, at)), at.complete && at.naturalWidth > 0 && (t.save(), this.applyPath(t, l, a, r, f), t.clip(), this.renderFittedImage(t, at, -a / 2, -r / 2, a, r, n.fill.fillMode), t.restore());
3365
3366
  } else {
3366
3367
  const pt = this.createCanvasFill(t, n.fill, a, r);
3367
- t.fillStyle = pt || (typeof n.fill == "string" ? n.fill : n.fill.color || "transparent"), t.globalAlpha = ft * this.normalizeOpacity(n.fill.opacity ?? 100), this.applyPath(t, l, a, r, h), t.fill();
3368
+ t.fillStyle = pt || (typeof n.fill == "string" ? n.fill : n.fill.color || "transparent"), t.globalAlpha = ht * this.normalizeOpacity(n.fill.opacity ?? 100), this.applyPath(t, l, a, r, f), t.fill();
3368
3369
  }
3369
- t.globalAlpha = ft;
3370
+ t.globalAlpha = ht;
3370
3371
  }
3371
- t.restore(), n.stroke && n.stroke.width > 0 && this.applyStrokeAlignment(t, n, l, a, r, h, D, q);
3372
+ t.restore(), n.stroke && n.stroke.width > 0 && this.applyStrokeAlignment(t, n, l, a, r, f, D, q);
3372
3373
  } else if (i.type === "Frame" || i.type === "Group" && !i.isStructuralGroup) {
3373
- const ft = e.width ?? s.width ?? i.width ?? a, pt = e.height ?? s.height ?? i.height ?? r, at = h;
3374
- if (t.save(), t.beginPath(), this.drawRoundRect(t, -ft / 2, -pt / 2, ft, pt, at), n.fill && n.fill.type !== "None") {
3375
- const B = t.globalAlpha, nt = this.createCanvasFill(t, n.fill, ft, pt);
3374
+ const ht = e.width ?? s.width ?? i.width ?? a, pt = e.height ?? s.height ?? i.height ?? r, at = f;
3375
+ if (t.save(), t.beginPath(), this.drawRoundRect(t, -ht / 2, -pt / 2, ht, pt, at), n.fill && n.fill.type !== "None") {
3376
+ const B = t.globalAlpha, nt = this.createCanvasFill(t, n.fill, ht, pt);
3376
3377
  t.fillStyle = nt || n.fill.color || "transparent", t.globalAlpha = B * this.normalizeOpacity(n.fill.opacity ?? 100), t.fill(), t.globalAlpha = B;
3377
3378
  }
3378
3379
  if (t.restore(), n.stroke && n.stroke.width > 0 && n.stroke.isEnabled !== !1) {
3379
3380
  const B = { type: "Rectangle" };
3380
- this.applyStrokeAlignment(t, n, B, ft, pt, at, D, q);
3381
+ this.applyStrokeAlignment(t, n, B, ht, pt, at, D, q);
3381
3382
  }
3382
3383
  } 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:", (j = i.geometry) == null ? void 0 : j.type));
3383
- if (this.applyArtEffectOverlay(t, i, l, a, r, h), Xt && le === "BackgroundBlur" && this.applyBackgroundBlurGlass(t, l, a, r, h, St), jt && jt.enabled && t.restore(), i.children && i.children.length > 0) {
3384
+ if (this.applyArtEffectOverlay(t, i, l, a, r, f), Xt && le === "BackgroundBlur" && this.applyBackgroundBlurGlass(t, l, a, r, f, St), jt && jt.enabled && t.restore(), i.children && i.children.length > 0) {
3384
3385
  const pt = i.type === "Frame", at = i.clipsContent !== void 0 ? i.clipsContent : i.clipContent !== void 0 ? i.clipContent : pt;
3385
3386
  if (t.save(), at) {
3386
3387
  t.beginPath();
@@ -3487,8 +3488,8 @@ class ci {
3487
3488
  t.restore();
3488
3489
  }
3489
3490
  }
3490
- _renderText(t, i, o, e, s, n, a, r = !1, f = !1, h = 1, l = 1) {
3491
- var yt, bt, gt, Et, It, St, Xt, le, he;
3491
+ _renderText(t, i, o, e, s, n, a, r = !1, h = !1, f = 1, l = 1) {
3492
+ var yt, bt, gt, Et, It, St, Xt, le, fe;
3492
3493
  let p = o.text || "";
3493
3494
  if (o.textInputId && !r) {
3494
3495
  const et = this.inputs.get(o.textInputId);
@@ -3607,7 +3608,7 @@ class ci {
3607
3608
  }, ot = (et, mt, Rt, _t, dt) => {
3608
3609
  var me, ye;
3609
3610
  const Dt = (dt === 0 || c[dt - 1] === `
3610
- ` || c[dt - 1] === "\r") && o.paragraphIndent ? o.paragraphIndent : 0, $t = (!r || f) && (i.behaviors || []).some(
3611
+ ` || c[dt - 1] === "\r") && o.paragraphIndent ? o.paragraphIndent : 0, $t = (!r || h) && (i.behaviors || []).some(
3611
3612
  (Ut) => Ut.enabled && (Ut.type.toString().includes("Text") || ["Typewriter", "Scramble", "Wave", "Bounce", "GlitchText", "Reveal3D", "RevealSlide", "RevealBlur"].includes(Ut.type))
3612
3613
  ), Ot = !o.pathId && !$t && (o.enableSegments !== !0 || !o.segments || o.segments.length === 0), Vt = o.baselineShift || 0, ie = Rt + Vt;
3613
3614
  if (Ot)
@@ -3633,7 +3634,7 @@ class ci {
3633
3634
  let se = o.pathOffset || 0;
3634
3635
  o.pathId && D > 0 && O && (k === "center" ? se += D / 2 - Ut / 2 : k === "right" && (se += D - Ut));
3635
3636
  let jt = Se;
3636
- const ft = r && !f ? [] : ((me = i.behaviors) == null ? void 0 : me.filter(
3637
+ const ht = r && !h ? [] : ((me = i.behaviors) == null ? void 0 : me.filter(
3637
3638
  (pt) => [
3638
3639
  U.Typewriter,
3639
3640
  U.Scramble,
@@ -3670,7 +3671,7 @@ class ci {
3670
3671
  let at = et[pt];
3671
3672
  const B = dt + pt;
3672
3673
  let nt = 0, Z = 0, Pt = 1, xt = 1, kt = 0, At = 1, Mt = at;
3673
- ft.forEach((ut) => {
3674
+ ht.forEach((ut) => {
3674
3675
  const ct = ut.settings || {}, Ct = ct.strength || 1, rt = Date.now();
3675
3676
  if (ut.type === U.Typewriter)
3676
3677
  this.currentTime * (ct.speed || 1) - B * (ct.stagger || 0.05) < 0 && (At = 0);
@@ -3795,16 +3796,16 @@ class ci {
3795
3796
  t.translate(rt.x + vt + nt, rt.y + Yt), t.rotate(V + kt + (it === -1 ? Math.PI : 0));
3796
3797
  } else
3797
3798
  t.translate(jt + nt + Jt / 2, Rt + Z), kt !== 0 && t.rotate(kt);
3798
- if (t.scale(Pt, xt), $ && !r && !f) {
3799
+ if (t.scale(Pt, xt), $ && !r && !h) {
3799
3800
  const ut = this.createCanvasFill(t, $, X, tt);
3800
3801
  t.fillStyle = ut || $.color || "#000000";
3801
- } else if (!r && !f) {
3802
+ } else if (!r && !h) {
3802
3803
  const ut = this.createCanvasFill(t, e.fill, X, tt);
3803
3804
  t.fillStyle = ut || e.fill.color || "#000000";
3804
3805
  }
3805
3806
  if (At > 0)
3806
- if (r || f) {
3807
- const ut = f ? "#000000" : this.createCanvasFill(t, e.fill, X, tt);
3807
+ if (r || h) {
3808
+ const ut = h ? "#000000" : this.createCanvasFill(t, e.fill, X, tt);
3808
3809
  t.fillStyle = ut || e.fill.color || "#ffffff", t.fillText(Mt, -Jt / 2, 0);
3809
3810
  } else _t ? t.strokeText(Mt, -Jt / 2, 0) : t.fillText(Mt, -Jt / 2, 0);
3810
3811
  Wt !== "none" && !r && this.drawTextDecoration(t, Wt, 0, 0, Jt, Kt), t.restore(), t.globalAlpha = te, k === "justify" && Ee > 0 && Mt === " " && !Pe ? jt += Jt + T + Ee : jt += Jt + T;
@@ -3819,7 +3820,7 @@ class ci {
3819
3820
  let Ft = -X / 2;
3820
3821
  k === "center" ? Ft = 0 : k === "right" && (Ft = X / 2), ot(_t, Ft, mt, !1, et), et += _t.length, mt += A;
3821
3822
  });
3822
- } else if (f) {
3823
+ } else if (h) {
3823
3824
  let et = 0, mt = R;
3824
3825
  (N || []).forEach((Rt) => {
3825
3826
  const _t = Rt.text || "";
@@ -3847,7 +3848,7 @@ class ci {
3847
3848
  }), t.globalAlpha = mt;
3848
3849
  }
3849
3850
  const et = o.paragraphRule;
3850
- if (et && (((le = et.top) == null ? void 0 : le.width) > 0 || ((he = et.bottom) == null ? void 0 : he.width) > 0)) {
3851
+ if (et && (((le = et.top) == null ? void 0 : le.width) > 0 || ((fe = et.bottom) == null ? void 0 : fe.width) > 0)) {
3851
3852
  let mt = 0;
3852
3853
  (N || []).forEach((Rt, _t) => {
3853
3854
  var Dt, $t;
@@ -3878,7 +3879,7 @@ class ci {
3878
3879
  const Dt = t.getTransform(), $t = Math.sqrt(Dt.a * Dt.a + Dt.b * Dt.b) || 1, Ot = this.rootTransform, Vt = Math.sqrt(Ot.a * Ot.a + Ot.b * Ot.b) || 1;
3879
3880
  _t = $t / Vt;
3880
3881
  } else
3881
- _t = (Math.abs(h) + Math.abs(l)) / 2 || 1;
3882
+ _t = (Math.abs(f) + Math.abs(l)) / 2 || 1;
3882
3883
  t.lineWidth = (e.stroke.width || 1) / (_t || 1), t.globalAlpha = mt * this.normalizeOpacity(e.stroke.opacity ?? 100);
3883
3884
  let dt = 0, Ft = R;
3884
3885
  (N || []).forEach((Dt) => {
@@ -3892,22 +3893,22 @@ class ci {
3892
3893
  }
3893
3894
  applyStrokeAlignment(t, i, o, e, s, n, a = 1, r = 1) {
3894
3895
  if (!i.stroke || i.stroke.width <= 0 || i.stroke.isEnabled === !1) return;
3895
- const f = i.stroke;
3896
- let h = 1;
3896
+ const h = i.stroke;
3897
+ let f = 1;
3897
3898
  if (this.rootTransform) {
3898
3899
  const S = t.getTransform(), C = Math.sqrt(S.a * S.a + S.b * S.b) || 1, w = this.rootTransform, M = Math.sqrt(w.a * w.a + w.b * w.b) || 1;
3899
- h = C / M;
3900
+ f = C / M;
3900
3901
  } else
3901
- h = (Math.abs(a) + Math.abs(r)) / 2 || 1;
3902
- const l = (f.width || 1) / (h || 1), p = (f.alignment || "center").toLowerCase();
3903
- 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), f.fill) {
3904
- const S = this.createCanvasFill(t, f.fill, e, s);
3905
- S ? t.strokeStyle = S : t.strokeStyle = f.color || "#000000";
3902
+ f = (Math.abs(a) + Math.abs(r)) / 2 || 1;
3903
+ const l = (h.width || 1) / (f || 1), p = (h.alignment || "center").toLowerCase();
3904
+ 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), h.fill) {
3905
+ const S = this.createCanvasFill(t, h.fill, e, s);
3906
+ S ? t.strokeStyle = S : t.strokeStyle = h.color || "#000000";
3906
3907
  } else
3907
- t.strokeStyle = f.color || "#000000";
3908
+ t.strokeStyle = h.color || "#000000";
3908
3909
  const d = t.globalAlpha;
3909
- t.globalAlpha = d * this.normalizeOpacity(f.opacity ?? 100), t.lineWidth = l, t.lineCap = f.lineCap || "round", t.lineJoin = f.lineJoin || "round", f.miterLimit !== void 0 && (t.miterLimit = f.miterLimit);
3910
- const u = f.trimStart ?? 0, v = f.trimEnd ?? 1, b = f.trimOffset ?? 0, m = f.dashOffset ?? 0, y = f.dashArray || [];
3910
+ t.globalAlpha = d * this.normalizeOpacity(h.opacity ?? 100), t.lineWidth = l, t.lineCap = h.lineCap || "round", t.lineJoin = h.lineJoin || "round", h.miterLimit !== void 0 && (t.miterLimit = h.miterLimit);
3911
+ const u = h.trimStart ?? 0, v = h.trimEnd ?? 1, b = h.trimOffset ?? 0, m = h.dashOffset ?? 0, y = h.dashArray || [];
3911
3912
  if (u !== 0 || v !== 1 || b !== 0) {
3912
3913
  const S = this.getPerimeter(o, e, s);
3913
3914
  if (S > 0) {
@@ -3923,7 +3924,7 @@ class ci {
3923
3924
  }
3924
3925
  }
3925
3926
  } else y.length > 0 && (t.setLineDash(y), t.lineDashOffset = m);
3926
- (o == null ? void 0 : o.type) === "Line" || e === 0 || s === 0 ? (this.applyPath(t, o, e, s, n), t.stroke()) : p === "inside" ? (t.lineWidth = l * 2, t.save(), this.applyPath(t, o, e, s, n), t.clip(), t.stroke(), t.restore()) : p === "outside" ? (t.lineWidth = l * 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 = l, this.applyPath(t, o, e, s, n), t.stroke()), t.restore();
3927
+ (o == null ? void 0 : o.type) === "Line" || e === 0 || s === 0 ? (this.applyPath(t, o, e, s, n), t.stroke()) : p === "inside" ? (t.lineWidth = l * 2, t.save(), this.applyPath(t, o, e, s, n), t.clip(), t.stroke(), t.restore()) : p === "outside" ? (t.lineWidth = l * 2, t.save(), t.beginPath(), t.rect(-99999, -99999, 199998, 199998), this._tracePath(t, o, e, s, n), t.clip("evenodd"), this.applyPath(t, o, e, s, n), t.stroke(), t.restore()) : (t.lineWidth = l, this.applyPath(t, o, e, s, n), t.stroke()), t.restore();
3927
3928
  }
3928
3929
  getPerimeter(t, i, o) {
3929
3930
  switch (this.ensurePathPoints(t), t == null ? void 0 : t.type) {
@@ -3932,12 +3933,12 @@ class ci {
3932
3933
  case "Ellipse": {
3933
3934
  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)));
3934
3935
  if (n >= 360 && a <= 0) return r;
3935
- let f = n / 360 * r;
3936
+ let h = n / 360 * r;
3936
3937
  if (a > 0) {
3937
- const h = Math.PI * (3 * (e * a + s * a) - Math.sqrt((3 * e * a + s * a) * (e * a + 3 * s * a)));
3938
- f += n / 360 * h, n < 360 && (f += 2 * Math.sqrt((e - e * a) ** 2 + (s - s * a) ** 2));
3939
- } else n < 360 && (f += 2 * Math.max(e, s));
3940
- return isNaN(f) ? 0 : f;
3938
+ const f = Math.PI * (3 * (e * a + s * a) - Math.sqrt((3 * e * a + s * a) * (e * a + 3 * s * a)));
3939
+ h += n / 360 * f, n < 360 && (h += 2 * Math.sqrt((e - e * a) ** 2 + (s - s * a) ** 2));
3940
+ } else n < 360 && (h += 2 * Math.max(e, s));
3941
+ return isNaN(h) ? 0 : h;
3941
3942
  }
3942
3943
  case "Line":
3943
3944
  return t.length || Math.sqrt(i * i + o * o);
@@ -3956,22 +3957,22 @@ class ci {
3956
3957
  if (e.length < 2) return t.length || 0;
3957
3958
  let s = 0, n = e[0].x, a = e[0].y;
3958
3959
  for (let r = 1; r < e.length; r++) {
3959
- const f = e[r];
3960
- if (f.moveTo) {
3961
- n = f.x, a = f.y;
3960
+ const h = e[r];
3961
+ if (h.moveTo) {
3962
+ n = h.x, a = h.y;
3962
3963
  continue;
3963
3964
  }
3964
- const h = n, l = a, p = e[r - 1].out_x, c = e[r - 1].out_y;
3965
- if (p !== void 0 || f.in_x !== void 0 ? s += this.getBezierLength(
3966
- h,
3965
+ const f = n, l = a, p = e[r - 1].out_x, c = e[r - 1].out_y;
3966
+ if (p !== void 0 || h.in_x !== void 0 ? s += this.getBezierLength(
3967
+ f,
3967
3968
  l,
3968
- p ?? h,
3969
+ p ?? f,
3969
3970
  c ?? l,
3970
- f.in_x ?? f.x,
3971
- f.in_y ?? f.y,
3972
- f.x,
3973
- f.y
3974
- ) : s += Math.sqrt((f.x - h) ** 2 + (f.y - l) ** 2), n = f.x, a = f.y, f.closePath || r === e.length - 1 && (t.is_closed || t.isClosed)) {
3971
+ h.in_x ?? h.x,
3972
+ h.in_y ?? h.y,
3973
+ h.x,
3974
+ h.y
3975
+ ) : s += Math.sqrt((h.x - f) ** 2 + (h.y - l) ** 2), n = h.x, a = h.y, h.closePath || r === e.length - 1 && (t.is_closed || t.isClosed)) {
3975
3976
  const d = n, u = a, v = [...e.slice(0, r + 1)].reverse().find((M) => M.moveTo) || e[0], b = v.x, m = v.y, y = e[r].out_x, S = e[r].out_y, C = v.in_x, w = v.in_y;
3976
3977
  y !== void 0 || C !== void 0 ? s += this.getBezierLength(
3977
3978
  d,
@@ -3991,22 +3992,22 @@ class ci {
3991
3992
  return (i + o) * 2;
3992
3993
  }
3993
3994
  }
3994
- getBezierLength(t, i, o, e, s, n, a, r, f = 10) {
3995
- let h = 0, l = t, p = i;
3996
- for (let c = 1; c <= f; c++) {
3997
- const d = c / f, u = 1 - d, v = d * d, b = u * u, m = b * u, y = v * d, S = m * t + 3 * b * d * o + 3 * u * v * s + y * a, C = m * i + 3 * b * d * e + 3 * u * v * n + y * r, w = S - l, M = C - p;
3998
- h += Math.sqrt(w * w + M * M), l = S, p = C;
3995
+ getBezierLength(t, i, o, e, s, n, a, r, h = 10) {
3996
+ let f = 0, l = t, p = i;
3997
+ for (let c = 1; c <= h; c++) {
3998
+ const d = c / h, u = 1 - d, v = d * d, b = u * u, m = b * u, y = v * d, S = m * t + 3 * b * d * o + 3 * u * v * s + y * a, C = m * i + 3 * b * d * e + 3 * u * v * n + y * r, w = S - l, M = C - p;
3999
+ f += Math.sqrt(w * w + M * M), l = S, p = C;
3999
4000
  }
4000
- return h;
4001
+ return f;
4001
4002
  }
4002
- getBezierTAtLength(t, i, o, e, s, n, a, r, f, h = 20) {
4003
+ getBezierTAtLength(t, i, o, e, s, n, a, r, h, f = 20) {
4003
4004
  if (t <= 0) return 0;
4004
4005
  let l = 0, p = i, c = o;
4005
- for (let d = 1; d <= h; d++) {
4006
- const u = d / h, v = 1 - u, b = u * u, m = v * v, y = m * v, S = b * u, C = y * i + 3 * m * u * e + 3 * v * b * n + S * r, w = y * o + 3 * m * u * s + 3 * v * b * a + S * f, M = C - p, I = w - c, k = Math.sqrt(M * M + I * I);
4006
+ for (let d = 1; d <= f; d++) {
4007
+ const u = d / f, v = 1 - u, b = u * u, m = v * v, y = m * v, S = b * u, C = y * i + 3 * m * u * e + 3 * v * b * n + S * r, w = y * o + 3 * m * u * s + 3 * v * b * a + S * h, M = C - p, I = w - c, k = Math.sqrt(M * M + I * I);
4007
4008
  if (l + k >= t) {
4008
4009
  const T = t - l, L = k === 0 ? 0 : T / k;
4009
- return (d - 1 + L) / h;
4010
+ return (d - 1 + L) / f;
4010
4011
  }
4011
4012
  l += k, p = C, c = w;
4012
4013
  }
@@ -4016,11 +4017,11 @@ class ci {
4016
4017
  if (this.ensurePathPoints(t), (t == null ? void 0 : t.type) === "Path") {
4017
4018
  const s = t.points || [];
4018
4019
  if (s.length < 2) return { x: 0, y: 0, angle: 0 };
4019
- let n = 1 / 0, a = -1 / 0, r = 1 / 0, f = -1 / 0;
4020
+ let n = 1 / 0, a = -1 / 0, r = 1 / 0, h = -1 / 0;
4020
4021
  s.forEach((m) => {
4021
- typeof m.x == "number" && typeof m.y == "number" && (n = Math.min(n, m.x), a = Math.max(a, m.x), r = Math.min(r, m.y), f = Math.max(f, m.y), m.out_x !== void 0 && (n = Math.min(n, m.out_x), a = Math.max(a, m.out_x)), m.out_y !== void 0 && (r = Math.min(r, m.out_y), f = Math.max(f, m.out_y)), m.in_x !== void 0 && (n = Math.min(n, m.in_x), a = Math.max(a, m.in_x)), m.in_y !== void 0 && (r = Math.min(r, m.in_y), f = Math.max(f, m.in_y)));
4022
+ typeof m.x == "number" && typeof m.y == "number" && (n = Math.min(n, m.x), a = Math.max(a, m.x), r = Math.min(r, m.y), h = Math.max(h, m.y), m.out_x !== void 0 && (n = Math.min(n, m.out_x), a = Math.max(a, m.out_x)), m.out_y !== void 0 && (r = Math.min(r, m.out_y), h = Math.max(h, m.out_y)), m.in_x !== void 0 && (n = Math.min(n, m.in_x), a = Math.max(a, m.in_x)), m.in_y !== void 0 && (r = Math.min(r, m.in_y), h = Math.max(h, m.in_y)));
4022
4023
  });
4023
- const h = (n + a) / 2, l = (r + f) / 2, c = this.getPerimeter(t, i, o) * e;
4024
+ const f = (n + a) / 2, l = (r + h) / 2, c = this.getPerimeter(t, i, o) * e;
4024
4025
  let d = 0;
4025
4026
  const u = [];
4026
4027
  let v = s[0], b = s[0];
@@ -4039,27 +4040,27 @@ class ci {
4039
4040
  if (w ? C = this.getBezierLength(y.x, y.y, y.out_x ?? y.x, y.out_y ?? y.y, S.in_x ?? S.x, S.in_y ?? S.y, S.x, S.y) : C = Math.sqrt((S.x - y.x) ** 2 + (S.y - y.y) ** 2), d + C >= c || m === u[u.length - 1]) {
4040
4041
  let M = 0;
4041
4042
  if (w)
4042
- return M = this.getBezierTAtLength(c - d, y.x, y.y, y.out_x ?? y.x, y.out_y ?? y.y, S.in_x ?? S.x, S.in_y ?? S.y, S.x, S.y, 20), this.getBezierPointAndAngle(M, y, S, h, l);
4043
+ return M = this.getBezierTAtLength(c - d, y.x, y.y, y.out_x ?? y.x, y.out_y ?? y.y, S.in_x ?? S.x, S.in_y ?? S.y, S.x, S.y, 20), this.getBezierPointAndAngle(M, y, S, f, l);
4043
4044
  {
4044
4045
  M = C === 0 ? 0 : (c - d) / C;
4045
- const I = y.x + (S.x - y.x) * M - h, k = y.y + (S.y - y.y) * M - l, T = Math.atan2(S.y - y.y, S.x - y.x);
4046
+ const I = y.x + (S.x - y.x) * M - f, k = y.y + (S.y - y.y) * M - l, T = Math.atan2(S.y - y.y, S.x - y.x);
4046
4047
  return { x: I, y: k, angle: T };
4047
4048
  }
4048
4049
  }
4049
4050
  d += C;
4050
4051
  }
4051
4052
  } else if (t.type === "Ellipse") {
4052
- const s = Math.abs(i) / 2, n = Math.abs(o) / 2, a = t.sweepAngle ?? 360, f = ((t.startAngle ?? 0) + a * e) * Math.PI / 180, h = s * Math.cos(f), l = n * Math.sin(f), p = -s * Math.sin(f), c = n * Math.cos(f), d = Math.atan2(c, p);
4053
- return { x: h, y: l, angle: d };
4053
+ const s = Math.abs(i) / 2, n = Math.abs(o) / 2, a = t.sweepAngle ?? 360, h = ((t.startAngle ?? 0) + a * e) * Math.PI / 180, f = s * Math.cos(h), l = n * Math.sin(h), p = -s * Math.sin(h), c = n * Math.cos(h), d = Math.atan2(c, p);
4054
+ return { x: f, y: l, angle: d };
4054
4055
  } else if ((t == null ? void 0 : t.type) === "Rectangle") {
4055
4056
  const s = Math.abs(i), n = Math.abs(o), r = (s + n) * 2 * e;
4056
- let f = 0, h = 0, l = 0;
4057
- return r < s ? (f = -s / 2 + r, h = -n / 2, l = 0) : r < s + n ? (f = s / 2, h = -n / 2 + (r - s), l = Math.PI / 2) : r < 2 * s + n ? (f = s / 2 - (r - (s + n)), h = n / 2, l = Math.PI) : (f = -s / 2, h = n / 2 - (r - (2 * s + n)), l = -Math.PI / 2), { x: f, y: h, angle: l };
4057
+ let h = 0, f = 0, l = 0;
4058
+ return r < s ? (h = -s / 2 + r, f = -n / 2, l = 0) : r < s + n ? (h = s / 2, f = -n / 2 + (r - s), l = Math.PI / 2) : r < 2 * s + n ? (h = s / 2 - (r - (s + n)), f = n / 2, l = Math.PI) : (h = -s / 2, f = n / 2 - (r - (2 * s + n)), l = -Math.PI / 2), { x: h, y: f, angle: l };
4058
4059
  }
4059
4060
  return { x: 0, y: 0, angle: 0 };
4060
4061
  }
4061
4062
  getBezierPointAndAngle(t, i, o, e, s) {
4062
- const n = i.x, a = i.y, r = i.out_x ?? i.x, f = i.out_y ?? i.y, h = o.in_x ?? o.x, l = o.in_y ?? o.y, p = o.x, c = o.y, d = 1 - t, u = t * t, v = d * d, b = v * d, m = u * t, y = b * n + 3 * v * t * r + 3 * d * u * h + m * p - e, S = b * a + 3 * v * t * f + 3 * d * u * l + m * c - s, C = 3 * v * (r - n) + 6 * d * t * (h - r) + 3 * u * (p - h), w = 3 * v * (f - a) + 6 * d * t * (l - f) + 3 * u * (c - l), M = Math.atan2(w, C);
4063
+ const n = i.x, a = i.y, r = i.out_x ?? i.x, h = i.out_y ?? i.y, f = o.in_x ?? o.x, l = o.in_y ?? o.y, p = o.x, c = o.y, d = 1 - t, u = t * t, v = d * d, b = v * d, m = u * t, y = b * n + 3 * v * t * r + 3 * d * u * f + m * p - e, S = b * a + 3 * v * t * h + 3 * d * u * l + m * c - s, C = 3 * v * (r - n) + 6 * d * t * (f - r) + 3 * u * (p - f), w = 3 * v * (h - a) + 6 * d * t * (l - h) + 3 * u * (c - l), M = Math.atan2(w, C);
4063
4064
  return { x: y, y: S, angle: M };
4064
4065
  }
4065
4066
  applyAbsoluteTransform(t, i, o) {
@@ -4085,57 +4086,57 @@ class ci {
4085
4086
  const b = Math.tan(e * Math.PI / 180), m = Math.tan(s * Math.PI / 180);
4086
4087
  t.transform(1 + b * m, m, b, 1, 0, 0);
4087
4088
  }
4088
- const n = o.rotate_x !== void 0 ? o.rotate_x : ((d = o.transform) == null ? void 0 : d.rotate_x) ?? 0, a = o.rotate_y !== void 0 ? o.rotate_y : ((u = o.transform) == null ? void 0 : u.rotate_y) ?? 0, f = 1 + (o.translate_z !== void 0 ? o.translate_z : ((v = o.transform) == null ? void 0 : v.translate_z) ?? 0) / 1e3, h = (o.flip_x === !0 ? -1 : 1) * Math.cos(a * Math.PI / 180) * f, l = (o.flip_y === !0 ? -1 : 1) * Math.cos(n * Math.PI / 180) * f, p = (o.scale_x ?? 1) * h, c = (o.scale_y ?? 1) * l;
4089
+ const n = o.rotate_x !== void 0 ? o.rotate_x : ((d = o.transform) == null ? void 0 : d.rotate_x) ?? 0, a = o.rotate_y !== void 0 ? o.rotate_y : ((u = o.transform) == null ? void 0 : u.rotate_y) ?? 0, h = 1 + (o.translate_z !== void 0 ? o.translate_z : ((v = o.transform) == null ? void 0 : v.translate_z) ?? 0) / 1e3, f = (o.flip_x === !0 ? -1 : 1) * Math.cos(a * Math.PI / 180) * h, l = (o.flip_y === !0 ? -1 : 1) * Math.cos(n * Math.PI / 180) * h, p = (o.scale_x ?? 1) * f, c = (o.scale_y ?? 1) * l;
4089
4090
  t.scale(p, c);
4090
4091
  }
4091
4092
  applyArtEffectOverlay(t, i, o, e, s, n) {
4092
4093
  var c, d, u, v, b;
4093
4094
  const a = this.objectStates.get(i.id), r = ((c = a == null ? void 0 : a.style) == null ? void 0 : c.artEffect) || i.artEffect || ((d = i.style) == null ? void 0 : d.artEffect);
4094
4095
  if (!r || !r.enabled) return;
4095
- const f = r.type, h = r.intensity ?? 0.5, l = r.speed ?? 1, p = r.scale ?? 10;
4096
- if (f === "acid_gradient" || f === "acid_rave" || f === "shimmer" || f === "glint_overlay" || f === "halftone" || f === "noise" || f === "scanlines" || f === "chromatic_aberration" || f === "pixelate" || f === "glitch" || f === "fold_overlay" || f === "crumple_overlay") {
4097
- if (t.save(), this.applyPath(t, o, e, s, n), t.clip(), f === "shimmer") {
4096
+ const h = r.type, f = r.intensity ?? 0.5, l = r.speed ?? 1, p = r.scale ?? 10;
4097
+ if (h === "acid_gradient" || h === "acid_rave" || h === "shimmer" || h === "glint_overlay" || h === "halftone" || h === "noise" || h === "scanlines" || h === "chromatic_aberration" || h === "pixelate" || h === "glitch" || h === "fold_overlay" || h === "crumple_overlay") {
4098
+ if (t.save(), this.applyPath(t, o, e, s, n), t.clip(), h === "shimmer") {
4098
4099
  const y = this.currentTime * l % 2 / 2, S = t.createLinearGradient(-e, -s, e, s);
4099
- S.addColorStop(Math.max(0, y - 0.2), "rgba(255,255,255,0)"), S.addColorStop(y, `rgba(255,255,255,${h * 0.8})`), S.addColorStop(Math.min(1, y + 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";
4100
- } else if (f === "glint_overlay") {
4100
+ S.addColorStop(Math.max(0, y - 0.2), "rgba(255,255,255,0)"), S.addColorStop(y, `rgba(255,255,255,${f * 0.8})`), S.addColorStop(Math.min(1, y + 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";
4101
+ } else if (h === "glint_overlay") {
4101
4102
  let S = ((this._lastPointerPos || { x: 0 }).x - (((u = i.transform) == null ? void 0 : u.x) ?? 0) + 300) / 600;
4102
4103
  S = Math.max(-0.2, Math.min(1.2, S));
4103
4104
  const C = t.createLinearGradient(-e, -s, e, s);
4104
- 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,${h})`), 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";
4105
- } else if (f === "fold_overlay") {
4105
+ 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,${f})`), 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";
4106
+ } else if (h === "fold_overlay") {
4106
4107
  const m = this._lastPointerPos || { x: 0, y: 0 }, y = m.x - (((v = i.transform) == null ? void 0 : v.x) ?? 0), S = m.y - (((b = i.transform) == null ? void 0 : b.y) ?? 0), C = t.createLinearGradient(y > 0 ? -e / 2 : e / 2, S > 0 ? -s / 2 : s / 2, y > 0 ? e / 2 : -e / 2, S > 0 ? s / 2 : -s / 2);
4107
- C.addColorStop(0, `rgba(0,0,0,${h * 0.6})`), C.addColorStop(0.4, "rgba(0,0,0,0)"), C.addColorStop(0.5, `rgba(255,255,255,${h * 0.4})`), C.addColorStop(1, `rgba(0,0,0,${h * 0.2})`), t.fillStyle = C, t.globalCompositeOperation = "overlay", t.fillRect(-e / 2, -s / 2, e, s), t.globalCompositeOperation = "source-over", t.beginPath(), y > 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)) : y < 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)) : y > 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 = y > 0 ? -2 : 2, t.shadowOffsetY = S > 0 ? -2 : 2, t.fill();
4108
- } else if (f === "crumple_overlay") {
4108
+ C.addColorStop(0, `rgba(0,0,0,${f * 0.6})`), C.addColorStop(0.4, "rgba(0,0,0,0)"), C.addColorStop(0.5, `rgba(255,255,255,${f * 0.4})`), C.addColorStop(1, `rgba(0,0,0,${f * 0.2})`), t.fillStyle = C, t.globalCompositeOperation = "overlay", t.fillRect(-e / 2, -s / 2, e, s), t.globalCompositeOperation = "source-over", t.beginPath(), y > 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)) : y < 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)) : y > 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 = y > 0 ? -2 : 2, t.shadowOffsetY = S > 0 ? -2 : 2, t.fill();
4109
+ } else if (h === "crumple_overlay") {
4109
4110
  const m = Math.floor(e / p), y = document.createElement("canvas");
4110
4111
  y.width = m, y.height = Math.floor(s / p);
4111
4112
  const S = y.getContext("2d"), C = S.createImageData(y.width, y.height);
4112
4113
  for (let w = 0; w < C.data.length; w += 4) {
4113
4114
  const M = Math.random() > 0.95 ? 150 : 255;
4114
- C.data[w] = M, C.data[w + 1] = M, C.data[w + 2] = M, C.data[w + 3] = 255 * h;
4115
+ C.data[w] = M, C.data[w + 1] = M, C.data[w + 2] = M, C.data[w + 3] = 255 * f;
4115
4116
  }
4116
4117
  S.putImageData(C, 0, 0), t.globalCompositeOperation = "multiply", t.imageSmoothingEnabled = !1, t.drawImage(y, -e / 2, -s / 2, e, s);
4117
- } else if (f === "acid_gradient" || f === "acid_rave") {
4118
+ } else if (h === "acid_gradient" || h === "acid_rave") {
4118
4119
  const m = this.currentTime * l, y = r.color1, S = r.color2, C = t.createLinearGradient(-e / 2, -s / 2, e / 2, s / 2);
4119
4120
  if (y && S) {
4120
4121
  const w = m * 60 % 360;
4121
- C.addColorStop(0, this._shiftHue(y, w, h * 0.7)), C.addColorStop(1, this._shiftHue(S, (w + 180) % 360, h * 0.7));
4122
+ C.addColorStop(0, this._shiftHue(y, w, f * 0.7)), C.addColorStop(1, this._shiftHue(S, (w + 180) % 360, f * 0.7));
4122
4123
  } else {
4123
4124
  const w = m * 100 % 360, M = (w + 180) % 360;
4124
- C.addColorStop(0, `hsla(${w}, 80%, 50%, ${h * 0.5})`), C.addColorStop(1, `hsla(${M}, 80%, 50%, ${h * 0.5})`);
4125
+ C.addColorStop(0, `hsla(${w}, 80%, 50%, ${f * 0.5})`), C.addColorStop(1, `hsla(${M}, 80%, 50%, ${f * 0.5})`);
4125
4126
  }
4126
4127
  t.fillStyle = C, t.globalCompositeOperation = "screen", t.fillRect(-e / 2, -s / 2, e, s);
4127
- } else if (f === "halftone") {
4128
- const m = Math.max(2, p * (1 - h * 0.8)), y = document.createElement("canvas");
4128
+ } else if (h === "halftone") {
4129
+ const m = Math.max(2, p * (1 - f * 0.8)), y = document.createElement("canvas");
4129
4130
  y.width = m, y.height = m;
4130
4131
  const S = y.getContext("2d");
4131
4132
  if (S) {
4132
- S.fillStyle = "black", S.beginPath(), S.arc(m / 2, m / 2, m / 2 * h, 0, Math.PI * 2), S.fill();
4133
+ S.fillStyle = "black", S.beginPath(), S.arc(m / 2, m / 2, m / 2 * f, 0, Math.PI * 2), S.fill();
4133
4134
  const C = t.createPattern(y, "repeat");
4134
- C && (t.globalAlpha = 0.3 * h, t.fillStyle = C, t.fillRect(-e / 2, -s / 2, e, s));
4135
+ C && (t.globalAlpha = 0.3 * f, t.fillStyle = C, t.fillRect(-e / 2, -s / 2, e, s));
4135
4136
  }
4136
- } else if (f === "noise") {
4137
- const m = Math.floor(e * s * h * 0.02);
4138
- t.globalAlpha = 0.4 * h;
4137
+ } else if (h === "noise") {
4138
+ const m = Math.floor(e * s * f * 0.02);
4139
+ t.globalAlpha = 0.4 * f;
4139
4140
  for (let y = 0; y < m; y++) {
4140
4141
  const S = Math.random() > 0.5 ? 255 : 0;
4141
4142
  t.fillStyle = `rgba(${S}, ${S}, ${S}, ${0.5 + Math.random() * 0.5})`, t.fillRect(
@@ -4145,15 +4146,15 @@ class ci {
4145
4146
  2
4146
4147
  );
4147
4148
  }
4148
- } else if (f === "scanlines") {
4149
- t.globalAlpha = 0.2 * h, t.strokeStyle = "rgba(0,0,0,0.5)", t.lineWidth = 1;
4149
+ } else if (h === "scanlines") {
4150
+ t.globalAlpha = 0.2 * f, t.strokeStyle = "rgba(0,0,0,0.5)", t.lineWidth = 1;
4150
4151
  for (let m = -s / 2; m < s / 2; m += 4)
4151
4152
  t.beginPath(), t.moveTo(-e / 2, m), t.lineTo(e / 2, m), t.stroke();
4152
- } else if (f === "chromatic_aberration") {
4153
- const m = 5 * h;
4153
+ } else if (h === "chromatic_aberration") {
4154
+ const m = 5 * f;
4154
4155
  t.globalCompositeOperation = "screen", t.globalAlpha = 0.5, t.fillStyle = "cyan", t.fillRect(-e / 2 - m, -s / 2, e, s), t.fillStyle = "magenta", t.fillRect(-e / 2 + m, -s / 2, e, s);
4155
- } else if (f === "pixelate") {
4156
- const m = Math.max(2, Math.round(p * (1 - h * 0.5))), y = document.createElement("canvas"), S = Math.max(1, Math.ceil(e / m)), C = Math.max(1, Math.ceil(s / m));
4156
+ } else if (h === "pixelate") {
4157
+ const m = Math.max(2, Math.round(p * (1 - f * 0.5))), y = document.createElement("canvas"), S = Math.max(1, Math.ceil(e / m)), C = Math.max(1, Math.ceil(s / m));
4157
4158
  y.width = S, y.height = C;
4158
4159
  const w = y.getContext("2d");
4159
4160
  if (w) {
@@ -4161,9 +4162,9 @@ class ci {
4161
4162
  const M = t.getTransform(), I = M.e - e / 2, k = M.f - s / 2;
4162
4163
  w.drawImage(t.canvas, I, k, e, s, 0, 0, S, C), t.imageSmoothingEnabled = !1, t.drawImage(y, 0, 0, S, C, -e / 2, -s / 2, e, s), t.imageSmoothingEnabled = !0;
4163
4164
  }
4164
- } else if (f === "glitch") {
4165
- const m = this.currentTime * l, y = r.chaosAmount ?? 0.2, S = Math.max(3, Math.floor(8 * h)), C = h * e * 0.15;
4166
- t.globalCompositeOperation = "screen", t.globalAlpha = h * 0.4;
4165
+ } else if (h === "glitch") {
4166
+ const m = this.currentTime * l, y = r.chaosAmount ?? 0.2, S = Math.max(3, Math.floor(8 * f)), C = f * e * 0.15;
4167
+ t.globalCompositeOperation = "screen", t.globalAlpha = f * 0.4;
4167
4168
  const w = C * 0.3;
4168
4169
  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;
4169
4170
  const M = s / S;
@@ -4186,22 +4187,22 @@ class ci {
4186
4187
  e = parseInt(c.substring(0, 2), 16) / 255, s = parseInt(c.substring(2, 4), 16) / 255, n = parseInt(c.substring(4, 6), 16) / 255;
4187
4188
  }
4188
4189
  const a = Math.max(e, s, n), r = Math.min(e, s, n);
4189
- let f = 0, h = 0, l = (a + r) / 2;
4190
+ let h = 0, f = 0, l = (a + r) / 2;
4190
4191
  if (a !== r) {
4191
4192
  const c = a - r;
4192
- switch (h = l > 0.5 ? c / (2 - a - r) : c / (a + r), a) {
4193
+ switch (f = l > 0.5 ? c / (2 - a - r) : c / (a + r), a) {
4193
4194
  case e:
4194
- f = ((s - n) / c + (s < n ? 6 : 0)) / 6;
4195
+ h = ((s - n) / c + (s < n ? 6 : 0)) / 6;
4195
4196
  break;
4196
4197
  case s:
4197
- f = ((n - e) / c + 2) / 6;
4198
+ h = ((n - e) / c + 2) / 6;
4198
4199
  break;
4199
4200
  case n:
4200
- f = ((e - s) / c + 4) / 6;
4201
+ h = ((e - s) / c + 4) / 6;
4201
4202
  break;
4202
4203
  }
4203
4204
  }
4204
- return `hsla(${(((f * 360 + i) % 360 + 360) % 360).toFixed(0)}, ${(h * 100).toFixed(0)}%, ${(l * 100).toFixed(0)}%, ${o})`;
4205
+ return `hsla(${(((h * 360 + i) % 360 + 360) % 360).toFixed(0)}, ${(f * 100).toFixed(0)}%, ${(l * 100).toFixed(0)}%, ${o})`;
4205
4206
  }
4206
4207
  /**
4207
4208
  * Simulate CSS `backdrop-filter: blur()` + glass overlay on Canvas2D.
@@ -4212,7 +4213,7 @@ class ci {
4212
4213
  * 4. Apply the overlay color tint, sheen highlight, noise grain, and glass border
4213
4214
  */
4214
4215
  applyBackgroundBlurGlass(t, i, o, e, s, n) {
4215
- const a = n.radius ?? 10, r = n.color ?? "rgba(255,255,255,0.2)", f = n.opacity !== void 0 ? this.normalizeOpacity(n.opacity) : 0.5, h = n.noise ?? 0;
4216
+ const a = n.radius ?? 10, r = n.color ?? "rgba(255,255,255,0.2)", h = n.opacity !== void 0 ? this.normalizeOpacity(n.opacity) : 0.5, f = n.noise ?? 0;
4216
4217
  t.save(), this.applyPath(t, i, o, e, s), t.clip();
4217
4218
  const l = t.getTransform(), p = t.canvas;
4218
4219
  try {
@@ -4237,10 +4238,10 @@ class ci {
4237
4238
  }
4238
4239
  } catch {
4239
4240
  }
4240
- t.globalCompositeOperation = "source-over", t.globalAlpha = f, t.fillStyle = r, t.fillRect(-o / 2, -e / 2, o, e), t.globalAlpha = 1, t.globalCompositeOperation = "source-atop";
4241
+ t.globalCompositeOperation = "source-over", t.globalAlpha = h, t.fillStyle = r, t.fillRect(-o / 2, -e / 2, o, e), t.globalAlpha = 1, t.globalCompositeOperation = "source-atop";
4241
4242
  const c = t.createLinearGradient(-o / 2, -e / 2, o / 2, e / 2);
4242
- if (c.addColorStop(0, "rgba(255,255,255,0.12)"), c.addColorStop(0.3, "rgba(255,255,255,0.04)"), c.addColorStop(0.5, "rgba(255,255,255,0.0)"), c.addColorStop(1, "rgba(255,255,255,0.0)"), t.fillStyle = c, t.fillRect(-o / 2, -e / 2, o, e), h > 0) {
4243
- if (t.globalAlpha = h / 100, !this._noiseTileCanvas) {
4243
+ if (c.addColorStop(0, "rgba(255,255,255,0.12)"), c.addColorStop(0.3, "rgba(255,255,255,0.04)"), c.addColorStop(0.5, "rgba(255,255,255,0.0)"), c.addColorStop(1, "rgba(255,255,255,0.0)"), t.fillStyle = c, t.fillRect(-o / 2, -e / 2, o, e), f > 0) {
4244
+ if (t.globalAlpha = f / 100, !this._noiseTileCanvas) {
4244
4245
  const u = document.createElement("canvas");
4245
4246
  u.width = 64, u.height = 64;
4246
4247
  const v = u.getContext("2d"), b = v.createImageData(64, 64), m = b.data;
@@ -4266,76 +4267,76 @@ class ci {
4266
4267
  } else if (i.type === "Line")
4267
4268
  t.moveTo(-o / 2, 0), t.lineTo(o / 2, 0);
4268
4269
  else if (i.type === "Ellipse") {
4269
- const { startAngle: n = 0, sweepAngle: a = 360, ratio: r = 0 } = i, f = o / 2, h = e / 2, l = n * Math.PI / 180, p = a * Math.PI / 180, c = l + p;
4270
- a >= 360 && r <= 0 ? t.ellipse(0, 0, f, h, 0, 0, Math.PI * 2) : (t.ellipse(0, 0, f, h, 0, l, c, !1), r > 0 ? t.ellipse(0, 0, f * r, h * r, 0, c, l, !0) : t.lineTo(0, 0), t.closePath());
4270
+ const { startAngle: n = 0, sweepAngle: a = 360, ratio: r = 0 } = i, h = o / 2, f = e / 2, l = n * Math.PI / 180, p = a * Math.PI / 180, c = l + p;
4271
+ a >= 360 && r <= 0 ? t.ellipse(0, 0, h, f, 0, 0, Math.PI * 2) : (t.ellipse(0, 0, h, f, 0, l, c, !1), r > 0 ? t.ellipse(0, 0, h * r, f * r, 0, c, l, !0) : t.lineTo(0, 0), t.closePath());
4271
4272
  } else if (i.type === "Triangle")
4272
4273
  t.moveTo(0, -e / 2), t.lineTo(o / 2, e / 2), t.lineTo(-o / 2, e / 2), t.closePath();
4273
4274
  else if (i.type === "Polygon") {
4274
4275
  const n = i.sides || 3, a = i.radius || Math.min(o, e) / 2;
4275
4276
  for (let r = 0; r < n; r++) {
4276
- const f = r * 2 * Math.PI / n - Math.PI / 2, h = a * Math.cos(f), l = a * Math.sin(f);
4277
- r === 0 ? t.moveTo(h, l) : t.lineTo(h, l);
4277
+ const h = r * 2 * Math.PI / n - Math.PI / 2, f = a * Math.cos(h), l = a * Math.sin(h);
4278
+ r === 0 ? t.moveTo(f, l) : t.lineTo(f, l);
4278
4279
  }
4279
4280
  t.closePath();
4280
4281
  } else if (i.type === "Star") {
4281
4282
  const n = i.points || 5, a = i.outer_radius || Math.min(o, e) / 2;
4282
4283
  let r = i.inner_radius;
4283
4284
  r == null ? r = a * 0.382 : r <= 1 && (r = a * r);
4284
- for (let f = 0; f < n * 2; f++) {
4285
- const h = f * Math.PI / n - Math.PI / 2, l = f % 2 === 0 ? a : r, p = l * Math.cos(h), c = l * Math.sin(h);
4286
- f === 0 ? t.moveTo(p, c) : t.lineTo(p, c);
4285
+ for (let h = 0; h < n * 2; h++) {
4286
+ const f = h * Math.PI / n - Math.PI / 2, l = h % 2 === 0 ? a : r, p = l * Math.cos(f), c = l * Math.sin(f);
4287
+ h === 0 ? t.moveTo(p, c) : t.lineTo(p, c);
4287
4288
  }
4288
4289
  t.closePath();
4289
4290
  } 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) {
4290
4291
  this.frameCount % 300 === 0 && this.log("[Engine] Tracing Path:", i.points.length, "points");
4291
- let n = 1 / 0, a = -1 / 0, r = 1 / 0, f = -1 / 0;
4292
+ let n = 1 / 0, a = -1 / 0, r = 1 / 0, h = -1 / 0;
4292
4293
  if (i.points.forEach((p) => {
4293
- typeof p.x == "number" && typeof p.y == "number" && (n = Math.min(n, p.x), a = Math.max(a, p.x), r = Math.min(r, p.y), f = Math.max(f, p.y), p.out_x !== void 0 && (n = Math.min(n, p.out_x), a = Math.max(a, p.out_x)), p.out_y !== void 0 && (r = Math.min(r, p.out_y), f = Math.max(f, p.out_y)), p.in_x !== void 0 && (n = Math.min(n, p.in_x), a = Math.max(a, p.in_x)), p.in_y !== void 0 && (r = Math.min(r, p.in_y), f = Math.max(f, p.in_y)));
4294
+ typeof p.x == "number" && typeof p.y == "number" && (n = Math.min(n, p.x), a = Math.max(a, p.x), r = Math.min(r, p.y), h = Math.max(h, p.y), p.out_x !== void 0 && (n = Math.min(n, p.out_x), a = Math.max(a, p.out_x)), p.out_y !== void 0 && (r = Math.min(r, p.out_y), h = Math.max(h, p.out_y)), p.in_x !== void 0 && (n = Math.min(n, p.in_x), a = Math.max(a, p.in_x)), p.in_y !== void 0 && (r = Math.min(r, p.in_y), h = Math.max(h, p.in_y)));
4294
4295
  }), n === 1 / 0) return;
4295
- const h = (n + a) / 2, l = (r + f) / 2;
4296
- if (isNaN(h) || isNaN(l)) {
4297
- this.warn("[Engine] Invalid path center:", h, l);
4296
+ const f = (n + a) / 2, l = (r + h) / 2;
4297
+ if (isNaN(f) || isNaN(l)) {
4298
+ this.warn("[Engine] Invalid path center:", f, l);
4298
4299
  return;
4299
4300
  }
4300
4301
  i.points.forEach((p, c) => {
4301
4302
  if (c === 0 || p.moveTo)
4302
- t.moveTo(p.x - h, p.y - l);
4303
+ t.moveTo(p.x - f, p.y - l);
4303
4304
  else {
4304
4305
  const d = i.points[c - 1];
4305
4306
  if (!d) return;
4306
- const u = (d.out_x ?? d.x) - h, v = (d.out_y ?? d.y) - l, b = (p.in_x ?? p.x) - h, m = (p.in_y ?? p.y) - l;
4307
- isNaN(u) || isNaN(b) || isNaN(p.x) ? t.lineTo(p.x - h, p.y - l) : t.bezierCurveTo(u, v, b, m, p.x - h, p.y - l);
4307
+ const u = (d.out_x ?? d.x) - f, v = (d.out_y ?? d.y) - l, b = (p.in_x ?? p.x) - f, m = (p.in_y ?? p.y) - l;
4308
+ isNaN(u) || isNaN(b) || isNaN(p.x) ? t.lineTo(p.x - f, p.y - l) : t.bezierCurveTo(u, v, b, m, p.x - f, p.y - l);
4308
4309
  }
4309
4310
  if (p.closePath || c === i.points.length - 1 && (i.is_closed || i.isClosed)) {
4310
4311
  const d = [...i.points.slice(0, c + 1)].reverse().find((u) => u.moveTo) || i.points[0];
4311
4312
  d && (p.out_x !== void 0 || d.in_x !== void 0) && t.bezierCurveTo(
4312
- (p.out_x ?? p.x) - h,
4313
+ (p.out_x ?? p.x) - f,
4313
4314
  (p.out_y ?? p.y) - l,
4314
- (d.in_x ?? d.x) - h,
4315
+ (d.in_x ?? d.x) - f,
4315
4316
  (d.in_y ?? d.y) - l,
4316
- d.x - h,
4317
+ d.x - f,
4317
4318
  d.y - l
4318
4319
  ), t.closePath();
4319
4320
  }
4320
4321
  });
4321
4322
  } else if (i.points && Array.isArray(i.points)) {
4322
- let n = 1 / 0, a = -1 / 0, r = 1 / 0, f = -1 / 0;
4323
+ let n = 1 / 0, a = -1 / 0, r = 1 / 0, h = -1 / 0;
4323
4324
  i.points.forEach((p) => {
4324
- n = Math.min(n, p.x), a = Math.max(a, p.x), r = Math.min(r, p.y), f = Math.max(f, p.y);
4325
+ n = Math.min(n, p.x), a = Math.max(a, p.x), r = Math.min(r, p.y), h = Math.max(h, p.y);
4325
4326
  });
4326
- const h = (n + a) / 2, l = (r + f) / 2;
4327
+ const f = (n + a) / 2, l = (r + h) / 2;
4327
4328
  i.points.forEach((p, c) => {
4328
- if (c === 0) t.moveTo(p.x - h, p.y - l);
4329
+ if (c === 0) t.moveTo(p.x - f, p.y - l);
4329
4330
  else {
4330
4331
  const d = i.points[c - 1];
4331
4332
  d.out_x !== void 0 || p.in_x !== void 0 ? t.bezierCurveTo(
4332
- (d.out_x ?? d.x) - h,
4333
+ (d.out_x ?? d.x) - f,
4333
4334
  (d.out_y ?? d.y) - l,
4334
- (p.in_x ?? p.x) - h,
4335
+ (p.in_x ?? p.x) - f,
4335
4336
  (p.in_y ?? p.y) - l,
4336
- p.x - h,
4337
+ p.x - f,
4337
4338
  p.y - l
4338
- ) : t.lineTo(p.x - h, p.y - l);
4339
+ ) : t.lineTo(p.x - f, p.y - l);
4339
4340
  }
4340
4341
  (p.closePath || c === i.points.length - 1 && (i.is_closed || i.isClosed)) && t.closePath();
4341
4342
  });
@@ -4344,14 +4345,14 @@ class ci {
4344
4345
  }
4345
4346
  renderInputBox(t, i) {
4346
4347
  var R, O;
4347
- const o = this.objectStates.get(i.id), e = (o == null ? void 0 : o.options) || i.options || {}, s = ((R = i.geometry) == null ? void 0 : R.width) || 250, n = ((O = i.geometry) == null ? void 0 : O.height) || 45, a = this.focusedId === i.id, r = this.lastHoveredObjectId === i.id, f = e.previewState || "default", h = f !== "default" ? f : a ? "focused" : r ? "hovered" : "default", l = e.label || { visible: !0, text: "Label" }, p = e.helperText || { visible: !1, text: "Helper text" }, c = e.leftIcon || { visible: !1 }, d = e.rightIcon || { visible: !1 }, u = e.multiline === !0, v = e.corner_radius ?? 8, b = e.corners || { tl: v, tr: v, bl: v, br: v }, m = [b.tl, b.tr, b.br, b.bl];
4348
+ const o = this.objectStates.get(i.id), e = (o == null ? void 0 : o.options) || i.options || {}, s = ((R = i.geometry) == null ? void 0 : R.width) || 250, n = ((O = i.geometry) == null ? void 0 : O.height) || 45, a = this.focusedId === i.id, r = this.lastHoveredObjectId === i.id, h = e.previewState || "default", f = h !== "default" ? h : a ? "focused" : r ? "hovered" : "default", l = e.label || { visible: !0, text: "Label" }, p = e.helperText || { visible: !1, text: "Helper text" }, c = e.leftIcon || { visible: !1 }, d = e.rightIcon || { visible: !1 }, u = e.multiline === !0, v = e.corner_radius ?? 8, b = e.corners || { tl: v, tr: v, bl: v, br: v }, m = [b.tl, b.tr, b.br, b.bl];
4348
4349
  let y = e.backgroundColor || "rgba(31, 41, 55, 1)", S = e.borderColor || "rgba(55, 65, 81, 1)", C = e.borderWidth ?? 1.5, w = e.color || "#ffffff", M = e.placeholderColor || "rgba(156, 163, 175, 1)", I = e.fontSize || 14;
4349
- const k = `${h}Style`, T = e[k];
4350
- T ? (T.backgroundColor !== void 0 && (y = 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 && (M = T.placeholderColor), T.fontSize !== void 0 && (I = T.fontSize)) : h === "focused" ? (S = e.focusBorderColor || "rgba(59, 130, 246, 1)", C = Math.max(C, 2)) : h === "hovered" || h === "hover" ? (S = e.hoverBorderColor || S, y = e.hoverBackgroundColor || y) : h === "disabled" ? (y = e.disabledBackgroundColor || "rgba(31, 41, 55, 0.6)", S = e.disabledBorderColor || "rgba(55, 65, 81, 0.4)") : h === "error" && (S = "rgba(239, 68, 68, 1)", C = Math.max(C, 2)), t.beginPath(), this.drawRoundRect(t, -s / 2, -n / 2, s, n, m);
4350
+ const k = `${f}Style`, T = e[k];
4351
+ T ? (T.backgroundColor !== void 0 && (y = 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 && (M = T.placeholderColor), T.fontSize !== void 0 && (I = T.fontSize)) : f === "focused" ? (S = e.focusBorderColor || "rgba(59, 130, 246, 1)", C = Math.max(C, 2)) : f === "hovered" || f === "hover" ? (S = e.hoverBorderColor || S, y = e.hoverBackgroundColor || y) : f === "disabled" ? (y = e.disabledBackgroundColor || "rgba(31, 41, 55, 0.6)", S = e.disabledBorderColor || "rgba(55, 65, 81, 0.4)") : f === "error" && (S = "rgba(239, 68, 68, 1)", C = Math.max(C, 2)), t.beginPath(), this.drawRoundRect(t, -s / 2, -n / 2, s, n, m);
4351
4352
  const L = this.createCanvasFill(t, y, s, n);
4352
4353
  if (L && (t.fillStyle = L, t.fill()), C > 0) {
4353
4354
  const D = this.createCanvasFill(t, S, s, n);
4354
- if (D && (t.strokeStyle = D, t.lineWidth = C, t.stroke()), h === "focused" || h === "focus") {
4355
+ if (D && (t.strokeStyle = D, t.lineWidth = C, t.stroke()), f === "focused" || f === "focus") {
4355
4356
  t.save(), t.beginPath();
4356
4357
  const q = m.map((ot) => ot + 2);
4357
4358
  this.drawRoundRect(t, -s / 2 - 2, -n / 2 - 2, s + 4, n + 4, q), t.strokeStyle = "rgba(59, 130, 246, 0.3)", t.lineWidth = 2, t.stroke(), t.restore();
@@ -4400,14 +4401,14 @@ class ci {
4400
4401
  t.fillText(D, bt, gt);
4401
4402
  }
4402
4403
  if (p.visible === !0) {
4403
- const D = p.text || "Helper text", q = p.fontSize || 11, ot = h === "error" ? "rgba(239, 68, 68, 1)" : p.color || "rgba(156, 163, 175, 1)", yt = p.offset ?? 6;
4404
+ const D = p.text || "Helper text", q = p.fontSize || 11, ot = f === "error" ? "rgba(239, 68, 68, 1)" : p.color || "rgba(156, 163, 175, 1)", yt = p.offset ?? 6;
4404
4405
  t.font = `400 ${q}px "${G}", sans-serif`, t.fillStyle = ot, t.textAlign = "left", t.textBaseline = "top";
4405
4406
  const bt = -(s / 2), gt = n / 2 + yt;
4406
4407
  t.fillText(D, bt, gt);
4407
4408
  }
4408
4409
  }
4409
4410
  renderSlider(t, i) {
4410
- 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, h = (s.max ?? 100) - r, l = h === 0 ? 0 : (a - r) / h, p = s.trackHeight || 4, c = s.trackRoundedness ?? 2, d = s.trackShape ?? "Rectangle", u = s.trackPath || "", v = s.accentColor || "#3b82f6", b = s.inactiveColor || "#374151", m = s.thumbShape || "Ellipse", y = s.thumbWidth ?? 16, S = s.thumbHeight ?? 16, C = s.thumbRoundedness ?? 0, w = s.thumbColor || "#ffffff", M = s.thumbPath || "", I = s.thumbIcon || "", k = s.showValueTooltip ?? !1, T = s.tooltipBgColor || "#333333", L = s.tooltipColor || "#ffffff", P = s.tooltipOffsetX ?? 0, _ = s.tooltipOffsetY ?? -25, E = (X, tt, R, O, D, q, ot) => {
4411
+ 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, f = (s.max ?? 100) - r, l = f === 0 ? 0 : (a - r) / f, p = s.trackHeight || 4, c = s.trackRoundedness ?? 2, d = s.trackShape ?? "Rectangle", u = s.trackPath || "", v = s.accentColor || "#3b82f6", b = s.inactiveColor || "#374151", m = s.thumbShape || "Ellipse", y = s.thumbWidth ?? 16, S = s.thumbHeight ?? 16, C = s.thumbRoundedness ?? 0, w = s.thumbColor || "#ffffff", M = s.thumbPath || "", I = s.thumbIcon || "", k = s.showValueTooltip ?? !1, T = s.tooltipBgColor || "#333333", L = s.tooltipColor || "#ffffff", P = s.tooltipOffsetX ?? 0, _ = s.tooltipOffsetY ?? -25, E = (X, tt, R, O, D, q, ot) => {
4411
4412
  if ((X === "Custom" || X === "Icon") && ot)
4412
4413
  try {
4413
4414
  const yt = new Path2D(ot);
@@ -4480,11 +4481,11 @@ class ci {
4480
4481
  var _;
4481
4482
  const o = this.objectStates.get(i.id);
4482
4483
  if (!o) return;
4483
- const e = o.options || i.options || {}, s = i.geometry.width || 160, n = i.geometry.height || 40, a = -s / 2, r = -n / 2, f = e.corner_radius ?? 6, h = e.disabled || e.previewState === "disabled", l = this.lastHoveredObjectId === i.id || e.previewState === "hover", p = (e.isOpen || e.previewState === "active") && !h;
4484
+ const e = o.options || i.options || {}, s = i.geometry.width || 160, n = i.geometry.height || 40, a = -s / 2, r = -n / 2, h = e.corner_radius ?? 6, f = e.disabled || e.previewState === "disabled", l = this.lastHoveredObjectId === i.id || e.previewState === "hover", p = (e.isOpen || e.previewState === "active") && !f;
4484
4485
  let c = e.backgroundColor, d = e.borderColor, u = e.color || "#333333";
4485
- h ? (c = e.disabledBackgroundColor || "#f3f4f6", d = e.disabledBorderColor || "#e5e7eb", u = e.disabledColor || "#9ca3af") : p ? (c = e.activeBackgroundColor || c, d = e.activeBorderColor || d, u = e.activeColor || u) : l && (c = e.hoverBackgroundColor || c, d = e.hoverBorderColor || d, u = e.hoverColor || u), c || (c = "#ffffff"), d || (d = "#e5e7eb");
4486
+ f ? (c = e.disabledBackgroundColor || "#f3f4f6", d = e.disabledBorderColor || "#e5e7eb", u = e.disabledColor || "#9ca3af") : p ? (c = e.activeBackgroundColor || c, d = e.activeBorderColor || d, u = e.activeColor || u) : l && (c = e.hoverBackgroundColor || c, d = e.hoverBorderColor || d, u = e.hoverColor || u), c || (c = "#ffffff"), d || (d = "#e5e7eb");
4486
4487
  const v = t.globalAlpha;
4487
- t.globalAlpha = v * (e.opacity ?? 1), this.drawRoundRect(t, a, r, s, n, f), t.fillStyle = this.createCanvasFill(t, typeof c == "string" ? { type: "Solid", color: c } : c, s, n) || "#ffffff", t.fill();
4488
+ t.globalAlpha = v * (e.opacity ?? 1), this.drawRoundRect(t, a, r, s, n, h), t.fillStyle = this.createCanvasFill(t, typeof c == "string" ? { type: "Solid", color: c } : c, s, n) || "#ffffff", t.fill();
4488
4489
  const b = e.borderWidth ?? 1;
4489
4490
  b > 0 && (t.strokeStyle = this.createCanvasFill(t, typeof d == "string" ? { type: "Solid", color: d } : d, s, n) || "#e5e7eb", t.lineWidth = b, t.stroke());
4490
4491
  const m = 12, y = e.chevronType || "chevron", S = e.chevronSize || 16, C = (p ? e.openIconColor : e.closedIconColor) || e.chevronColor || "#6b7280";
@@ -4507,11 +4508,11 @@ class ci {
4507
4508
  }
4508
4509
  const w = e.selectedOption || e.placeholder || "Select...", M = e.fontSize || 14, I = e.fontWeight || 400, k = e.fontFamily || "Inter, sans-serif";
4509
4510
  t.font = `${I} ${M}px ${k}`;
4510
- const T = h ? e.disabledColor || "#9ca3af" : !e.selectedOption && e.placeholder ? "#9ca3af" : u;
4511
+ const T = f ? e.disabledColor || "#9ca3af" : !e.selectedOption && e.placeholder ? "#9ca3af" : u;
4511
4512
  t.fillStyle = this.createCanvasFill(t, typeof T == "string" ? { type: "Solid", color: T } : T, s, n) || "#333333", t.textAlign = "left", t.textBaseline = "middle";
4512
4513
  const L = y === "none" ? 0 : S + 8, P = s - m * 2 - L;
4513
- if (t.save(), t.beginPath(), t.rect(a + m, r, P, n), t.clip(), t.fillText(w, a + m, 0), t.restore(), p && !h) {
4514
- const E = r + n + 4, A = e.optionsList || [], W = e.itemHeight || 32, z = e.listPadding ?? 4, Y = A.length * W + z * 2, G = e.listCornerRadius ?? f;
4514
+ if (t.save(), t.beginPath(), t.rect(a + m, r, P, n), t.clip(), t.fillText(w, a + m, 0), t.restore(), p && !f) {
4515
+ const E = r + n + 4, A = e.optionsList || [], W = e.itemHeight || 32, z = e.listPadding ?? 4, Y = A.length * W + z * 2, G = e.listCornerRadius ?? h;
4515
4516
  t.save();
4516
4517
  const N = e.listShadow || {}, J = t.getTransform(), x = Math.sqrt(J.a * J.a + J.b * J.b) || 1;
4517
4518
  t.shadowColor = typeof N.color == "string" ? N.color : ((_ = N.color) == null ? void 0 : _.color) || "rgba(0,0,0,0.15)", t.shadowBlur = (N.blur ?? 12) * x, t.shadowOffsetY = (N.offsetY ?? 6) * x, t.shadowOffsetX = (N.offsetX ?? 0) * x, t.beginPath(), this.drawRoundRect(t, a, E, s, Y, G), t.fillStyle = this.createCanvasFill(t, typeof e.listBackgroundColor == "string" ? { type: "Solid", color: e.listBackgroundColor } : e.listBackgroundColor || { type: "Solid", color: "#ffffff" }, s, Y) || "#ffffff", t.fill();
@@ -4533,14 +4534,14 @@ class ci {
4533
4534
  }
4534
4535
  renderButton(t, i) {
4535
4536
  if (i.children && i.children.length > 0) return;
4536
- 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, f = this.activeObjectId === i.id, h = e.label || {}, l = e.hoverStyle || {}, p = e.activeStyle || {}, c = e.icon || { enabled: !1 };
4537
- let d = e.backgroundColor || "#3b82f6", u = h.color || "#ffffff", v = h.text || "Button", b = s.cornerRadius ?? 8, m = e.borderColor || "transparent", y = e.borderWidth || 0, S = 1;
4538
- f && p ? (d = p.backgroundColor || d, u = p.color || u, v = p.text || v, S = p.scale ?? 0.95, b = p.cornerRadius ?? b) : r && l && (d = l.backgroundColor || d, u = l.color || u, v = l.text || v, S = l.scale ?? 1, b = l.cornerRadius ?? b, m = l.borderColor || m);
4537
+ 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, h = this.activeObjectId === i.id, f = e.label || {}, l = e.hoverStyle || {}, p = e.activeStyle || {}, c = e.icon || { enabled: !1 };
4538
+ let d = e.backgroundColor || "#3b82f6", u = f.color || "#ffffff", v = f.text || "Button", b = s.cornerRadius ?? 8, m = e.borderColor || "transparent", y = e.borderWidth || 0, S = 1;
4539
+ h && p ? (d = p.backgroundColor || d, u = p.color || u, v = p.text || v, S = p.scale ?? 0.95, b = p.cornerRadius ?? b) : r && l && (d = l.backgroundColor || d, u = l.color || u, v = l.text || v, S = l.scale ?? 1, b = l.cornerRadius ?? b, m = l.borderColor || m);
4539
4540
  const C = -n / 2, w = -a / 2;
4540
4541
  t.save(), t.scale(S, S), t.beginPath(), this.drawRoundRect(t, C, w, n, a, b);
4541
4542
  const M = this.createCanvasFill(t, d, n, a);
4542
4543
  M && (t.fillStyle = M, t.fill()), (y > 0 || r && l.borderColor) && (t.strokeStyle = m, t.lineWidth = y || (r ? 1 : 0), t.stroke());
4543
- const I = h.fontSize || 14, k = h.fontFamily || "Inter", T = h.fontWeight || 600;
4544
+ const I = f.fontSize || 14, k = f.fontFamily || "Inter", T = f.fontWeight || 600;
4544
4545
  t.font = `${T} ${I}px "${k}", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif`, t.fillStyle = u, t.textAlign = "center", t.textBaseline = "middle";
4545
4546
  let L = 0;
4546
4547
  if (c.enabled && c.svgPath) {
@@ -4553,32 +4554,32 @@ class ci {
4553
4554
  }
4554
4555
  renderToggleButton(t, i) {
4555
4556
  var v, b;
4556
- const o = this.objectStates.get(i.id), e = (o == null ? void 0 : o.options) || i.options || {}, s = e.checked ?? !1, n = ((v = i.geometry) == null ? void 0 : v.width) || 120, a = ((b = i.geometry) == null ? void 0 : b.height) || 40, r = -n / 2, f = -a / 2, h = e.corner_radius ?? 8, l = e.label || {}, p = s ? e.accentColor || "#3b82f6" : e.inactiveColor || "#374151", c = s ? e.activeTextColor || "#ffffff" : e.inactiveTextColor || "#9ca3af";
4557
- t.save(), t.beginPath(), this.drawRoundRect(t, r, f, n, a, h), t.fillStyle = p, t.fill();
4557
+ const o = this.objectStates.get(i.id), e = (o == null ? void 0 : o.options) || i.options || {}, s = e.checked ?? !1, n = ((v = i.geometry) == null ? void 0 : v.width) || 120, a = ((b = i.geometry) == null ? void 0 : b.height) || 40, r = -n / 2, h = -a / 2, f = e.corner_radius ?? 8, l = e.label || {}, p = s ? e.accentColor || "#3b82f6" : e.inactiveColor || "#374151", c = s ? e.activeTextColor || "#ffffff" : e.inactiveTextColor || "#9ca3af";
4558
+ t.save(), t.beginPath(), this.drawRoundRect(t, r, h, n, a, f), t.fillStyle = p, t.fill();
4558
4559
  const d = l.fontSize || 14, u = l.fontFamily || "Inter";
4559
4560
  t.font = `${l.fontWeight || 600} ${d}px "${u}", sans-serif`, t.fillStyle = c, t.textAlign = "center", t.textBaseline = "middle", t.fillText(l.text || "Toggle", 0, 0), t.restore();
4560
4561
  }
4561
4562
  renderToggle(t, i) {
4562
4563
  var G, N, J, x, F, j, X, tt, R, O, D, q;
4563
- const o = this.objectStates.get(i.id), e = (o == null ? void 0 : o.options) || i.options || {}, s = ((G = i.geometry) == null ? void 0 : G.width) || 52, n = ((N = i.geometry) == null ? void 0 : N.height) || 30, a = -s / 2, r = -n / 2, f = e.checked ?? !1, h = e.cornerRadius ?? e.corner_radius ?? n / 2, l = e.toggleStyle || {}, p = l.backgroundColor || e.activeColor || "#10b981", c = l.borderColor || e.borderColor || "transparent", d = l.borderWidth ?? e.borderWidth ?? 0, u = l.knobColor || e.knobColor || "#ffffff", v = f ? p : e.inactiveColor || "#374151", b = f ? c : e.borderColor || "transparent", m = f ? d : e.borderWidth ?? 0, y = f ? u : e.knobColor || "#ffffff";
4564
- e.disabled && (t.globalAlpha *= 0.5), t.beginPath(), this.drawRoundRect(t, a, r, s, n, h);
4564
+ const o = this.objectStates.get(i.id), e = (o == null ? void 0 : o.options) || i.options || {}, s = ((G = i.geometry) == null ? void 0 : G.width) || 52, n = ((N = i.geometry) == null ? void 0 : N.height) || 30, a = -s / 2, r = -n / 2, h = e.checked ?? !1, f = e.cornerRadius ?? e.corner_radius ?? n / 2, l = e.toggleStyle || {}, p = l.backgroundColor || e.activeColor || "#10b981", c = l.borderColor || e.borderColor || "transparent", d = l.borderWidth ?? e.borderWidth ?? 0, u = l.knobColor || e.knobColor || "#ffffff", v = h ? p : e.inactiveColor || "#374151", b = h ? c : e.borderColor || "transparent", m = h ? d : e.borderWidth ?? 0, y = h ? u : e.knobColor || "#ffffff";
4565
+ e.disabled && (t.globalAlpha *= 0.5), t.beginPath(), this.drawRoundRect(t, a, r, s, n, f);
4565
4566
  const S = this.createCanvasFill(t, v, s, n);
4566
4567
  if (S && (t.fillStyle = S, t.fill()), m > 0) {
4567
4568
  t.lineWidth = m;
4568
4569
  const ot = this.createCanvasFill(t, b, s, n);
4569
4570
  ot && (t.strokeStyle = ot, t.stroke());
4570
4571
  }
4571
- const C = 2, w = n - C * 2, M = w / 2, I = a + C, k = a + s - C - w, T = f ? k : I, L = r + C;
4572
+ const C = 2, w = n - C * 2, M = w / 2, I = a + C, k = a + s - C - w, T = h ? k : I, L = r + C;
4572
4573
  t.beginPath(), t.arc(T + M, L + M, M, 0, Math.PI * 2);
4573
4574
  const P = this.createCanvasFill(t, y, w, w);
4574
4575
  P && (t.fillStyle = P, t.fill()), e.disabled && (t.globalAlpha *= 2);
4575
4576
  let _ = !1, E = !1;
4576
- const A = (f ? (J = l.leftLabel) == null ? void 0 : J.text : null) || ((x = e.leftLabel) == null ? void 0 : x.text) || "", W = (f ? (F = l.leftLabel) == null ? void 0 : F.color : null) || ((j = e.leftLabel) == null ? void 0 : j.color) || "#f3f4f6";
4577
+ const A = (h ? (J = l.leftLabel) == null ? void 0 : J.text : null) || ((x = e.leftLabel) == null ? void 0 : x.text) || "", W = (h ? (F = l.leftLabel) == null ? void 0 : F.color : null) || ((j = e.leftLabel) == null ? void 0 : j.color) || "#f3f4f6";
4577
4578
  if ((X = e.leftLabel) != null && X.enabled && A) {
4578
4579
  const ot = e.leftLabel;
4579
4580
  t.font = `${ot.fontWeight || 400} ${ot.fontSize || 12}px "${ot.fontFamily || "Inter"}", sans-serif`, t.fillStyle = W, t.textBaseline = "middle", t.textAlign = "right", t.fillText(A, a - (ot.gap || 8), 0), _ = !0;
4580
4581
  }
4581
- const z = (f ? (tt = l.rightLabel) == null ? void 0 : tt.text : null) || ((R = e.rightLabel) == null ? void 0 : R.text) || "", Y = (f ? (O = l.rightLabel) == null ? void 0 : O.color : null) || ((D = e.rightLabel) == null ? void 0 : D.color) || "#f3f4f6";
4582
+ const z = (h ? (tt = l.rightLabel) == null ? void 0 : tt.text : null) || ((R = e.rightLabel) == null ? void 0 : R.text) || "", Y = (h ? (O = l.rightLabel) == null ? void 0 : O.color : null) || ((D = e.rightLabel) == null ? void 0 : D.color) || "#f3f4f6";
4582
4583
  if ((q = e.rightLabel) != null && q.enabled && z) {
4583
4584
  const ot = e.rightLabel;
4584
4585
  t.font = `${ot.fontWeight || 400} ${ot.fontSize || 12}px "${ot.fontFamily || "Inter"}", sans-serif`, t.fillStyle = Y, t.textBaseline = "middle", t.textAlign = "left", t.fillText(z, a + s + (ot.gap || 8), 0), E = !0;
@@ -4593,19 +4594,19 @@ class ci {
4593
4594
  }
4594
4595
  renderCheckbox(t, i) {
4595
4596
  var S, C;
4596
- 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, f = e.cornerRadius ?? 4, h = e.checked ?? !1, l = e.activeColor || "#3b82f6", p = e.inactiveColor || "transparent", c = e.checkColor || "#ffffff", d = e.borderColor || "#4b5563", u = e.borderWidth ?? 2, v = h ? l : p, b = h ? "transparent" : d, m = h ? 0 : u;
4597
- e.disabled && (t.globalAlpha *= 0.5), t.beginPath(), this.drawRoundRect(t, a, r, s, n, f);
4597
+ 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, h = e.cornerRadius ?? 4, f = e.checked ?? !1, l = e.activeColor || "#3b82f6", p = e.inactiveColor || "transparent", c = e.checkColor || "#ffffff", d = e.borderColor || "#4b5563", u = e.borderWidth ?? 2, v = f ? l : p, b = f ? "transparent" : d, m = f ? 0 : u;
4598
+ e.disabled && (t.globalAlpha *= 0.5), t.beginPath(), this.drawRoundRect(t, a, r, s, n, h);
4598
4599
  const y = this.createCanvasFill(t, v, s, n);
4599
4600
  if (y && (t.fillStyle = y, t.fill()), m > 0) {
4600
4601
  t.lineWidth = m;
4601
4602
  const w = this.createCanvasFill(t, b, s, n);
4602
4603
  w && (t.strokeStyle = w, t.stroke());
4603
- } else if (h) {
4604
+ } else if (f) {
4604
4605
  t.lineWidth = 1;
4605
4606
  const w = this.createCanvasFill(t, l, s, n);
4606
4607
  w && (t.strokeStyle = w, t.stroke());
4607
4608
  }
4608
- if (h) {
4609
+ if (f) {
4609
4610
  t.save(), t.beginPath();
4610
4611
  const w = this.createCanvasFill(t, c, s, n);
4611
4612
  t.strokeStyle = w || c, t.lineWidth = Math.max(2, s * 0.12), t.lineCap = "round", t.lineJoin = "round";
@@ -4622,21 +4623,21 @@ class ci {
4622
4623
  }
4623
4624
  renderRadioGroup(t, i) {
4624
4625
  var C, w;
4625
- 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, f = e.selectedValue, h = e.optionsList || ["Option 1", "Option 2", "Option 3"], l = e.orientation || "vertical", p = e.itemGap !== void 0 ? e.itemGap : 16, c = e.activeColor || "#3b82f6", d = e.inactiveColor || "#4b5563", u = e.textColor || "#ffffff", v = e.fontSize || 14, b = e.fontFamily || "Inter", m = e.fontWeight || 400;
4626
+ 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, h = e.selectedValue, f = e.optionsList || ["Option 1", "Option 2", "Option 3"], l = e.orientation || "vertical", p = e.itemGap !== void 0 ? e.itemGap : 16, c = e.activeColor || "#3b82f6", d = e.inactiveColor || "#4b5563", u = e.textColor || "#ffffff", v = e.fontSize || 14, b = e.fontFamily || "Inter", m = e.fontWeight || 400;
4626
4627
  e.disabled && (t.globalAlpha *= 0.5);
4627
4628
  const y = 8, S = y * 2;
4628
4629
  if (t.save(), t.font = `${m} ${v}px "${b}", sans-serif`, t.textBaseline = "middle", t.textAlign = "left", l === "vertical") {
4629
4630
  const M = Math.max(S, v) + p;
4630
- h.forEach((I, k) => {
4631
+ f.forEach((I, k) => {
4631
4632
  const T = r + k * M + y;
4632
4633
  t.beginPath(), t.arc(a + y, T, y, 0, Math.PI * 2);
4633
- const L = f === I, P = this.createCanvasFill(t, c, S, S), _ = this.createCanvasFill(t, d, S, S);
4634
+ const L = h === I, P = this.createCanvasFill(t, c, S, S), _ = this.createCanvasFill(t, d, S, S);
4634
4635
  L ? (t.strokeStyle = P || c, t.lineWidth = 2, t.stroke(), t.beginPath(), t.arc(a + y, T, y / 2, 0, Math.PI * 2), t.fillStyle = P || c, t.fill()) : (t.strokeStyle = _ || d, t.lineWidth = 1.5, t.stroke()), t.fillStyle = u, t.fillText(I, a + S + 8, T);
4635
4636
  });
4636
4637
  } else {
4637
4638
  let M = a;
4638
- h.forEach((I) => {
4639
- const k = f === I, T = t.measureText(I).width;
4639
+ f.forEach((I) => {
4640
+ const k = h === I, T = t.measureText(I).width;
4640
4641
  t.beginPath(), t.arc(M + y, 0, y, 0, Math.PI * 2);
4641
4642
  const L = this.createCanvasFill(t, c, S, S), P = this.createCanvasFill(t, d, S, S);
4642
4643
  k ? (t.strokeStyle = L || c, t.lineWidth = 2, t.stroke(), t.beginPath(), t.arc(M + y, 0, y / 2, 0, Math.PI * 2), t.fillStyle = L || c, t.fill()) : (t.strokeStyle = P || d, t.lineWidth = 1.5, t.stroke()), t.fillStyle = u, t.fillText(I, M + S + 6, 0), M += S + 6 + T + p;
@@ -4714,12 +4715,12 @@ class ci {
4714
4715
  }
4715
4716
  P.beginPath(), Y ? (P.moveTo(_, E + W), P.lineTo(_, E + z), P.quadraticCurveTo(_, E, _ + z, E), P.lineTo(_ + A - z, E), P.quadraticCurveTo(_ + A, E, _ + A, E + z), P.lineTo(_ + A, E + W), P.lineTo(_, E + W)) : (P.moveTo(_, E), P.lineTo(_ + A - z, E), P.quadraticCurveTo(_ + A, E, _ + A, E + z), P.lineTo(_ + A, E + W - z), P.quadraticCurveTo(_ + A, E + W, _ + A - z, E + W), P.lineTo(_, E + W), P.lineTo(_, E)), P.closePath();
4716
4717
  }
4717
- }, n = s.width, a = s.height, r = -n / 2, f = -a / 2;
4718
+ }, n = s.width, a = s.height, r = -n / 2, h = -a / 2;
4718
4719
  if (!s.datasets || s.datasets.length === 0 || s.categories.length === 0) {
4719
4720
  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();
4720
4721
  return;
4721
4722
  }
4722
- const h = s._getPreset();
4723
+ const f = s._getPreset();
4723
4724
  let l = -1 / 0, p = 1 / 0;
4724
4725
  const c = s.categories.length, d = s.datasets.length;
4725
4726
  if (s.chartType === "stacked")
@@ -4739,19 +4740,19 @@ class ci {
4739
4740
  isFinite(l) || (l = 10), isFinite(p) || (p = 0), l = Math.max(l, 0), p = Math.min(p, 0);
4740
4741
  const u = l - p || 10;
4741
4742
  t.save(), s.enableShadows && (t.shadowColor = s.shadowColor, t.shadowBlur = s.shadowBlur, t.shadowOffsetY = s.shadowOffsetY), t.font = s.axisLabelFontSize + "px Inter, sans-serif";
4742
- const v = s.showYLabels ? t.measureText(l.toFixed(0)).width + 14 : 10, b = s.showXLabels ? s.axisLabelFontSize + 12 : 8, y = (s.showLegend && d > 0 ? s.legendFontSize + 10 : 0) + 8, S = 10, C = r + v, w = f + y, M = n - v - S, I = a - y - b;
4743
- if (s.enableShadows && (t.shadowColor = "transparent"), t.beginPath(), t.roundRect(r, f, n, a, 10), t.fillStyle = h.cardBackground, t.fill(), t.strokeStyle = h.cardBorderColor, t.lineWidth = 1, t.stroke(), s.chartBackground && s.chartBackground !== "transparent" && (t.beginPath(), t.rect(C, w, M, I), t.fillStyle = s.chartBackground, t.fill()), s.showLegend && d > 0) {
4743
+ const v = s.showYLabels ? t.measureText(l.toFixed(0)).width + 14 : 10, b = s.showXLabels ? s.axisLabelFontSize + 12 : 8, y = (s.showLegend && d > 0 ? s.legendFontSize + 10 : 0) + 8, S = 10, C = r + v, w = h + y, M = n - v - S, I = a - y - b;
4744
+ if (s.enableShadows && (t.shadowColor = "transparent"), t.beginPath(), t.roundRect(r, h, n, a, 10), t.fillStyle = f.cardBackground, t.fill(), t.strokeStyle = f.cardBorderColor, t.lineWidth = 1, t.stroke(), s.chartBackground && s.chartBackground !== "transparent" && (t.beginPath(), t.rect(C, w, M, I), t.fillStyle = s.chartBackground, t.fill()), s.showLegend && d > 0) {
4744
4745
  t.font = s.legendFontSize + "px Inter, sans-serif", t.textBaseline = "middle";
4745
- const P = f + 12;
4746
+ const P = h + 12;
4746
4747
  let _ = C;
4747
4748
  s.datasets.forEach((E, A) => {
4748
4749
  const W = s._resolveColor(E.color, A), z = E.label || "Series " + (A + 1), Y = 7;
4749
- t.beginPath(), t.roundRect(_, P - Y / 2, Y, Y, 2), t.fillStyle = W, t.fill(), t.fillStyle = h.legendColor, t.textAlign = "left", t.fillText(z, _ + Y + 4, P), _ += t.measureText(z).width + Y + 16;
4750
+ t.beginPath(), t.roundRect(_, P - Y / 2, Y, Y, 2), t.fillStyle = W, t.fill(), t.fillStyle = f.legendColor, t.textAlign = "left", t.fillText(z, _ + Y + 4, P), _ += t.measureText(z).width + Y + 16;
4750
4751
  });
4751
4752
  }
4752
4753
  const k = 4;
4753
4754
  if (s.showGridLines) {
4754
- t.setLineDash(s.gridLineDash || []), t.lineWidth = s.gridLineWidth || 1, t.strokeStyle = h.gridColor;
4755
+ t.setLineDash(s.gridLineDash || []), t.lineWidth = s.gridLineWidth || 1, t.strokeStyle = f.gridColor;
4755
4756
  for (let P = 0; P <= k; P++)
4756
4757
  if (s.orientation === "horizontal") {
4757
4758
  const _ = C + P / k * M;
@@ -4763,7 +4764,7 @@ class ci {
4763
4764
  t.setLineDash([]);
4764
4765
  }
4765
4766
  if (s.showYLabels) {
4766
- t.font = s.axisLabelFontSize + "px Inter, sans-serif", t.textAlign = "right", t.textBaseline = "middle", t.fillStyle = h.axisLabelColor;
4767
+ t.font = s.axisLabelFontSize + "px Inter, sans-serif", t.textAlign = "right", t.textBaseline = "middle", t.fillStyle = f.axisLabelColor;
4767
4768
  for (let P = 0; P <= k; P++)
4768
4769
  if (s.orientation === "horizontal") {
4769
4770
  const _ = p + P / k * u, E = C + P / k * M;
@@ -4778,7 +4779,7 @@ class ci {
4778
4779
  const P = I / c;
4779
4780
  for (let _ = 0; _ < c; _++) {
4780
4781
  const E = w + _ * P + P / 2;
4781
- s.showXLabels && (t.font = s.axisLabelFontSize + "px Inter, sans-serif", t.textAlign = "right", t.textBaseline = "middle", t.fillStyle = h.axisLabelColor, t.shadowColor = "transparent", t.fillText(s.categories[_] || "", C - 5, E), s.enableShadows && (t.shadowColor = s.shadowColor));
4782
+ s.showXLabels && (t.font = s.axisLabelFontSize + "px Inter, sans-serif", t.textAlign = "right", t.textBaseline = "middle", t.fillStyle = f.axisLabelColor, t.shadowColor = "transparent", t.fillText(s.categories[_] || "", C - 5, E), s.enableShadows && (t.shadowColor = s.shadowColor));
4782
4783
  let A = C;
4783
4784
  s.datasets.forEach((W, z) => {
4784
4785
  const Y = W.data[_] ?? 0;
@@ -4793,7 +4794,7 @@ class ci {
4793
4794
  const P = M / c;
4794
4795
  for (let _ = 0; _ < c; _++) {
4795
4796
  const E = C + _ * P + P / 2;
4796
- s.showXLabels && (t.font = s.axisLabelFontSize + "px Inter, sans-serif", t.textAlign = "center", t.textBaseline = "top", t.fillStyle = h.axisLabelColor, t.shadowColor = "transparent", t.fillText(s.categories[_] || "", E, w + I + 5), s.enableShadows && (t.shadowColor = s.shadowColor));
4797
+ s.showXLabels && (t.font = s.axisLabelFontSize + "px Inter, sans-serif", t.textAlign = "center", t.textBaseline = "top", t.fillStyle = f.axisLabelColor, t.shadowColor = "transparent", t.fillText(s.categories[_] || "", E, w + I + 5), s.enableShadows && (t.shadowColor = s.shadowColor));
4797
4798
  let A = w + I;
4798
4799
  s.datasets.forEach((W, z) => {
4799
4800
  const Y = W.data[_] ?? 0;
@@ -4809,7 +4810,7 @@ class ci {
4809
4810
  const P = I / c, _ = d * s.barWidth + Math.max(0, (d - 1) * s.barGap), E = C + (0 - p) / u * M;
4810
4811
  for (let A = 0; A < c; A++) {
4811
4812
  const W = w + A * P + P / 2;
4812
- s.showXLabels && (t.font = s.axisLabelFontSize + "px Inter, sans-serif", t.textAlign = "right", t.textBaseline = "middle", t.fillStyle = h.axisLabelColor, t.shadowColor = "transparent", t.fillText(s.categories[A] || "", C - 5, W), s.enableShadows && (t.shadowColor = s.shadowColor));
4813
+ s.showXLabels && (t.font = s.axisLabelFontSize + "px Inter, sans-serif", t.textAlign = "right", t.textBaseline = "middle", t.fillStyle = f.axisLabelColor, t.shadowColor = "transparent", t.fillText(s.categories[A] || "", C - 5, W), s.enableShadows && (t.shadowColor = s.shadowColor));
4813
4814
  const z = W - _ / 2;
4814
4815
  s.datasets.forEach((Y, G) => {
4815
4816
  const N = Y.data[A] ?? 0, J = Math.abs(N / u * M);
@@ -4822,7 +4823,7 @@ class ci {
4822
4823
  const P = M / c, _ = d * s.barWidth + Math.max(0, (d - 1) * s.barGap), E = w + I - (0 - p) / u * I;
4823
4824
  for (let A = 0; A < c; A++) {
4824
4825
  const W = C + A * P + P / 2;
4825
- s.showXLabels && (t.font = s.axisLabelFontSize + "px Inter, sans-serif", t.textAlign = "center", t.textBaseline = "top", t.fillStyle = h.axisLabelColor, t.shadowColor = "transparent", t.fillText(s.categories[A] || "", W, w + I + 5), s.enableShadows && (t.shadowColor = s.shadowColor));
4826
+ s.showXLabels && (t.font = s.axisLabelFontSize + "px Inter, sans-serif", t.textAlign = "center", t.textBaseline = "top", t.fillStyle = f.axisLabelColor, t.shadowColor = "transparent", t.fillText(s.categories[A] || "", W, w + I + 5), s.enableShadows && (t.shadowColor = s.shadowColor));
4826
4827
  const z = W - _ / 2;
4827
4828
  s.datasets.forEach((Y, G) => {
4828
4829
  const N = Y.data[A] ?? 0, J = Math.abs(N / u * I);
@@ -4871,9 +4872,9 @@ class ci {
4871
4872
  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();
4872
4873
  return;
4873
4874
  }
4874
- const f = s._getPreset();
4875
- t.save(), t.beginPath(), t.roundRect(-n / 2, -a / 2, n, a, 10), t.fillStyle = f.cardBackground, t.fill(), t.strokeStyle = f.cardBorderColor, t.lineWidth = 1, t.stroke();
4876
- const h = s.showLegend ? Math.ceil(s.slices.length / 2) : 0, l = h > 0 ? h * (s.legendFontSize + 8) + 10 : 0, p = a - l - 16, c = Math.min(n - 24, p) / 2, d = 0, u = -l / 2;
4875
+ const h = s._getPreset();
4876
+ t.save(), t.beginPath(), t.roundRect(-n / 2, -a / 2, n, a, 10), t.fillStyle = h.cardBackground, t.fill(), t.strokeStyle = h.cardBorderColor, t.lineWidth = 1, t.stroke();
4877
+ const f = s.showLegend ? Math.ceil(s.slices.length / 2) : 0, l = f > 0 ? f * (s.legendFontSize + 8) + 10 : 0, p = a - l - 16, c = Math.min(n - 24, p) / 2, d = 0, u = -l / 2;
4877
4878
  if (s.chartType === "rose") {
4878
4879
  const m = Math.max(...s.slices.map((C) => C.value || 0)), y = Math.PI * 2 / s.slices.length, S = c > 0 ? s.sliceGap / c : 0;
4879
4880
  s.slices.forEach((C, w) => {
@@ -4882,7 +4883,7 @@ class ci {
4882
4883
  const I = M / m * c, k = -Math.PI / 2 + w * y + S / 2, T = k + y - S, L = s._resolveSliceColor(C, w);
4883
4884
  if (t.beginPath(), t.moveTo(d, u), t.arc(d, u, I, k, T), t.closePath(), t.fillStyle = L + "cc", t.fill(), t.strokeStyle = L, t.lineWidth = 1.5, t.stroke(), s.showLabels) {
4884
4885
  const P = k + (T - k) / 2, _ = d + I * 0.65 * Math.cos(P), E = u + I * 0.65 * Math.sin(P), A = Math.round(M / r * 100);
4885
- t.save(), t.font = `bold ${s.labelFontSize}px Inter, sans-serif`, t.fillStyle = f.labelColor, t.textAlign = "center", t.textBaseline = "middle", t.fillText(`${A}%`, _, E), t.restore();
4886
+ t.save(), t.font = `bold ${s.labelFontSize}px Inter, sans-serif`, t.fillStyle = h.labelColor, t.textAlign = "center", t.textBaseline = "middle", t.fillText(`${A}%`, _, E), t.restore();
4886
4887
  }
4887
4888
  });
4888
4889
  } else {
@@ -4902,12 +4903,12 @@ class ci {
4902
4903
  const P = s._resolveSliceColor(w, M);
4903
4904
  if (t.beginPath(), t.fillStyle = P, y <= 0 ? (t.moveTo(d, u), t.arc(d, u, c, T, L), t.lineTo(d, u)) : (t.moveTo(d + c * Math.cos(T), u + c * Math.sin(T)), t.arc(d, u, c, T, L), t.arc(d, u, y, L, T, !0), t.closePath()), t.fill(), s.showLabels) {
4904
4905
  const _ = T + (L - T) / 2, E = y + (c - y) / 2, A = d + E * Math.cos(_), W = u + E * Math.sin(_), z = Math.round(I / r * 100);
4905
- t.save(), t.font = `bold ${s.labelFontSize}px Inter, sans-serif`, t.fillStyle = f.labelColor, t.textAlign = "center", t.textBaseline = "middle", t.fillText(`${z}%`, A, W), t.restore();
4906
+ t.save(), t.font = `bold ${s.labelFontSize}px Inter, sans-serif`, t.fillStyle = h.labelColor, t.textAlign = "center", t.textBaseline = "middle", t.fillText(`${z}%`, A, W), t.restore();
4906
4907
  }
4907
4908
  C += k;
4908
4909
  }), s.chartType === "donut" && s.showCenterText && y > 14) {
4909
4910
  const w = Math.round(r), M = Math.min(Math.floor(y * 0.52), 20), I = Math.min(Math.floor(y * 0.26), 10);
4910
- t.textAlign = "center", t.textBaseline = "middle", t.font = `bold ${M}px Inter, sans-serif`, t.fillStyle = f.centerTextColor, t.fillText(w.toString(), d, u - I * 0.5), s.centerLabel && (t.font = `${I}px Inter, sans-serif`, t.fillStyle = f.centerLabelColor, t.fillText(s.centerLabel, d, u + M * 0.6));
4911
+ t.textAlign = "center", t.textBaseline = "middle", t.font = `bold ${M}px Inter, sans-serif`, t.fillStyle = h.centerTextColor, t.fillText(w.toString(), d, u - I * 0.5), s.centerLabel && (t.font = `${I}px Inter, sans-serif`, t.fillStyle = h.centerLabelColor, t.fillText(s.centerLabel, d, u + M * 0.6));
4911
4912
  }
4912
4913
  }
4913
4914
  if (s.showLegend && s.slices.length > 0) {
@@ -4915,7 +4916,7 @@ class ci {
4915
4916
  const m = 2, y = n / m, S = s.legendFontSize + 8, C = a / 2 - l + 10, w = -n / 2 + 10;
4916
4917
  s.slices.forEach((M, I) => {
4917
4918
  const k = I % m, T = Math.floor(I / m), L = w + k * y, P = C + T * S, _ = s._resolveSliceColor(M, I), E = 7;
4918
- t.beginPath(), t.roundRect(L, P - E / 2, E, E, 2), t.fillStyle = _, t.fill(), t.textAlign = "left", t.textBaseline = "middle", t.fillStyle = f.legendColor;
4919
+ t.beginPath(), t.roundRect(L, P - E / 2, E, E, 2), t.fillStyle = _, t.fill(), t.textAlign = "left", t.textBaseline = "middle", t.fillStyle = h.legendColor;
4919
4920
  const A = Math.round((M.value || 0) / r * 100), W = `${M.label || "Item"} ${A}%`, z = y - E - 20;
4920
4921
  let Y = W;
4921
4922
  for (; t.measureText(Y).width > z && Y.length > 4; )
@@ -4928,21 +4929,21 @@ class ci {
4928
4929
  renderJoystick(t, i) {
4929
4930
  var u, v, b, m, y;
4930
4931
  const o = this.objectStates.get(i.id), e = (o == null ? void 0 : o.width) !== void 0 ? o.width : ((u = i.geometry) == null ? void 0 : u.width) ?? i.width ?? 100, s = (o == null ? void 0 : o.height) !== void 0 ? o.height : ((v = i.geometry) == null ? void 0 : v.height) ?? i.height ?? 100, n = Math.min(e, s) * 0.45, a = Math.min(e, s) * 0.15;
4931
- let r = i.handleX || 0, f = i.handleY || 0;
4932
- o && o.handleX !== void 0 && (r = o.handleX), o && o.handleY !== void 0 && (f = o.handleY), t.save();
4933
- let h = 0, l = 0;
4934
- i.handleOrigin === "top-left" ? (h = e / 2, l = s / 2) : i.handleOrigin === "bottom-right" && (h = -e / 2, l = -s / 2), t.translate(h, l), 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)", (b = i.style) != null && b.fill && typeof i.style.fill == "string" ? t.fillStyle = i.style.fill : (m = i.style) != null && m.fill && i.style.fill.type === "solid" && (t.fillStyle = i.style.fill.color), t.fill(), (y = i.style) != null && y.stroke && i.style.stroke.isEnabled !== !1 && (t.lineWidth = i.style.stroke.width || 1, t.strokeStyle = i.style.stroke.color || "#000", t.stroke());
4932
+ let r = i.handleX || 0, h = i.handleY || 0;
4933
+ o && o.handleX !== void 0 && (r = o.handleX), o && o.handleY !== void 0 && (h = o.handleY), t.save();
4934
+ let f = 0, l = 0;
4935
+ i.handleOrigin === "top-left" ? (f = e / 2, l = s / 2) : i.handleOrigin === "bottom-right" && (f = -e / 2, l = -s / 2), t.translate(f, l), 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)", (b = i.style) != null && b.fill && typeof i.style.fill == "string" ? t.fillStyle = i.style.fill : (m = i.style) != null && m.fill && i.style.fill.type === "solid" && (t.fillStyle = i.style.fill.color), t.fill(), (y = i.style) != null && y.stroke && i.style.stroke.isEnabled !== !1 && (t.lineWidth = i.style.stroke.width || 1, t.strokeStyle = i.style.stroke.color || "#000", t.stroke());
4935
4936
  const p = n - a;
4936
4937
  let c = 0, d = 0;
4937
- i.joystickType === "2D" ? (c = r * p, d = f * p) : i.joystickType === "1D_X" ? (c = r * p, d = 0) : i.joystickType === "1D_Y" && (c = 0, d = f * p), t.beginPath(), t.arc(c, 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();
4938
+ i.joystickType === "2D" ? (c = r * p, d = h * p) : i.joystickType === "1D_X" ? (c = r * p, d = 0) : i.joystickType === "1D_Y" && (c = 0, d = h * p), t.beginPath(), t.arc(c, 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();
4938
4939
  }
4939
4940
  getRadioGroupItemIndexAtPointer(t, i, o) {
4940
4941
  var I, k;
4941
4942
  const e = t.options || {}, s = this.objectStates.get(t.id) || {}, n = e.optionsList || [];
4942
4943
  if (n.length === 0) return null;
4943
- const a = s.width !== void 0 ? s.width : ((I = t.geometry) == null ? void 0 : I.width) || 180, r = s.height !== void 0 ? s.height : ((k = t.geometry) == null ? void 0 : k.height) || 100, f = e.orientation || "vertical", h = e.itemGap !== void 0 ? e.itemGap : 16, l = e.fontSize || 14, p = this.getWorldTransform(t.id), c = i - p.x, d = o - p.y, u = -p.rotation * (Math.PI / 180), v = Math.cos(u), b = Math.sin(u), m = c * v - d * b, y = c * b + d * v, C = 8 * 2, w = -a / 2, M = -r / 2;
4944
- if (f === "vertical") {
4945
- const T = Math.max(C, l) + h;
4944
+ const a = s.width !== void 0 ? s.width : ((I = t.geometry) == null ? void 0 : I.width) || 180, r = s.height !== void 0 ? s.height : ((k = t.geometry) == null ? void 0 : k.height) || 100, h = e.orientation || "vertical", f = e.itemGap !== void 0 ? e.itemGap : 16, l = e.fontSize || 14, p = this.getWorldTransform(t.id), c = i - p.x, d = o - p.y, u = -p.rotation * (Math.PI / 180), v = Math.cos(u), b = Math.sin(u), m = c * v - d * b, y = c * b + d * v, C = 8 * 2, w = -a / 2, M = -r / 2;
4945
+ if (h === "vertical") {
4946
+ const T = Math.max(C, l) + f;
4946
4947
  for (let L = 0; L < n.length; L++) {
4947
4948
  const P = M + L * T;
4948
4949
  if (m >= w && m <= w + a && y >= P && y <= P + T)
@@ -4951,7 +4952,7 @@ class ci {
4951
4952
  } else {
4952
4953
  let T = w;
4953
4954
  for (let L = 0; L < n.length; L++) {
4954
- const _ = n[L].length * 8, E = C + 6 + _ + h;
4955
+ const _ = n[L].length * 8, E = C + 6 + _ + f;
4955
4956
  if (m >= T && m <= T + E && y >= M && y <= M + r)
4956
4957
  return L;
4957
4958
  T += E;
@@ -4996,10 +4997,10 @@ class ci {
4996
4997
  }
4997
4998
  u._resolvedData = v;
4998
4999
  }), r < 2) return;
4999
- const f = a - n, h = o / (r - 1), l = (u) => {
5000
- const v = f === 0 ? 0.5 : (u - n) / f;
5000
+ const h = a - n, f = o / (r - 1), l = (u) => {
5001
+ const v = h === 0 ? 0.5 : (u - n) / h;
5001
5002
  return e / 2 - v * e;
5002
- }, p = (u) => u * h - o / 2, c = i.axisColor || "#333333";
5003
+ }, p = (u) => u * f - o / 2, c = i.axisColor || "#333333";
5003
5004
  if (i.showXAxis && (t.beginPath(), t.strokeStyle = i.xAxisColor || c, 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 || c, 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) {
5004
5005
  t.textAlign = "center", t.textBaseline = "top";
5005
5006
  for (let u = 0; u < r; u++) {
@@ -5059,8 +5060,8 @@ class ci {
5059
5060
  }
5060
5061
  }
5061
5062
  _catmullRom(t, i, o, e, s) {
5062
- const n = (o - t) * 0.5, a = (e - i) * 0.5, r = s * s, f = s * r;
5063
- return (2 * i - 2 * o + n + a) * f + (-3 * i + 3 * o - 2 * n - a) * r + n * s + i;
5063
+ const n = (o - t) * 0.5, a = (e - i) * 0.5, r = s * s, h = s * r;
5064
+ return (2 * i - 2 * o + n + a) * h + (-3 * i + 3 * o - 2 * n - a) * r + n * s + i;
5064
5065
  }
5065
5066
  normalizeOpacity(t) {
5066
5067
  const i = typeof t == "number" ? t : parseFloat(String(t));
@@ -5071,19 +5072,19 @@ class ci {
5071
5072
  if (!i || i.type === "None") return null;
5072
5073
  if (typeof i == "string") return i;
5073
5074
  if (i.type === "Solid" && i.color) {
5074
- const r = i.color, h = (((n = (s = this.artboard) == null ? void 0 : s.tokens) == null ? void 0 : n.colors) || {})[r] || r;
5075
- return t.fillStyle = h, h;
5075
+ const r = i.color, f = (((n = (s = this.artboard) == null ? void 0 : s.tokens) == null ? void 0 : n.colors) || {})[r] || r;
5076
+ return t.fillStyle = f, f;
5076
5077
  }
5077
5078
  if ((i.type === "LinearGradient" || i.type === "RadialGradient" || i.type === "AngularGradient" || i.type === "DiamondGradient") && i.stops) {
5078
- const r = (f, h = 100) => {
5079
+ const r = (h, f = 100) => {
5079
5080
  var S, C;
5080
- const p = (((C = (S = this.artboard) == null ? void 0 : S.tokens) == null ? void 0 : C.colors) || {})[f] || f, c = this.normalizeOpacity(i.opacity ?? 100), u = this.normalizeOpacity(h) * c;
5081
+ const p = (((C = (S = this.artboard) == null ? void 0 : S.tokens) == null ? void 0 : C.colors) || {})[h] || h, c = this.normalizeOpacity(i.opacity ?? 100), u = this.normalizeOpacity(f) * c;
5081
5082
  if (u >= 1 && p.startsWith("#")) return p;
5082
5083
  const v = p.startsWith("#") ? p.replace("#", "") : "ffffff", b = parseInt(v.substring(0, 2), 16), m = parseInt(v.substring(2, 4), 16), y = parseInt(v.substring(4, 6), 16);
5083
5084
  return `rgba(${b}, ${m}, ${y}, ${u})`;
5084
5085
  };
5085
5086
  if (i.type === "LinearGradient") {
5086
- const f = (u, v, b) => Array.isArray(u) ? u[v] ?? (v === 0 ? 0 : 1) : u && typeof u == "object" ? u[b] ?? (v === 0 ? 0 : 1) : v === 0 ? 0 : 1, h = f(i.start, 0, "x") * o - o / 2, l = f(i.start, 1, "y") * e - e / 2, p = f(i.end, 0, "x") * o - o / 2, c = f(i.end, 1, "y") * e - e / 2, d = t.createLinearGradient(h, l, p, c);
5087
+ const h = (u, v, b) => Array.isArray(u) ? u[v] ?? (v === 0 ? 0 : 1) : u && typeof u == "object" ? u[b] ?? (v === 0 ? 0 : 1) : v === 0 ? 0 : 1, f = h(i.start, 0, "x") * o - o / 2, l = h(i.start, 1, "y") * e - e / 2, p = h(i.end, 0, "x") * o - o / 2, c = h(i.end, 1, "y") * e - e / 2, d = t.createLinearGradient(f, l, p, c);
5087
5088
  if (i.stops.forEach((u) => {
5088
5089
  const v = u.offset !== void 0 ? u.offset : u.pos !== void 0 ? u.pos : u.position !== void 0 ? u.position : 0, b = r(u.color || "#000000", u.opacity ?? 100);
5089
5090
  d.addColorStop(Math.max(0, Math.min(1, v)), b);
@@ -5093,7 +5094,7 @@ class ci {
5093
5094
  }
5094
5095
  return d;
5095
5096
  } else if (i.type === "RadialGradient") {
5096
- const f = (d, u, v) => Array.isArray(d) ? d[u] ?? 0.5 : d && typeof d == "object" ? d[v] ?? 0.5 : 0.5, h = f(i.center, 0, "x") * o - o / 2, l = f(i.center, 1, "y") * e - e / 2, p = (i.radius ?? 0.5) * Math.max(o, e), c = t.createRadialGradient(h, l, 0, h, l, p);
5097
+ const h = (d, u, v) => Array.isArray(d) ? d[u] ?? 0.5 : d && typeof d == "object" ? d[v] ?? 0.5 : 0.5, f = h(i.center, 0, "x") * o - o / 2, l = h(i.center, 1, "y") * e - e / 2, p = (i.radius ?? 0.5) * Math.max(o, e), c = t.createRadialGradient(f, l, 0, f, l, p);
5097
5098
  if (i.stops.forEach((d) => {
5098
5099
  const u = d.offset !== void 0 ? d.offset : d.pos !== void 0 ? d.pos : d.position !== void 0 ? d.position : 0, v = r(d.color || "#000000", d.opacity ?? 100);
5099
5100
  c.addColorStop(Math.max(0, Math.min(1, u)), v);
@@ -5103,7 +5104,7 @@ class ci {
5103
5104
  }
5104
5105
  return c;
5105
5106
  } else if (i.type === "AngularGradient") {
5106
- const f = (d, u, v) => Array.isArray(d) ? d[u] ?? 0.5 : d && typeof d == "object" ? d[v] ?? 0.5 : 0.5, h = f(i.center || [0.5, 0.5], 0, "x") * o - o / 2, l = f(i.center || [0.5, 0.5], 1, "y") * e - e / 2, p = (i.degree || i.angle || 0) * (Math.PI / 180), c = (a = t.createConicGradient) == null ? void 0 : a.call(t, p, h, l);
5107
+ const h = (d, u, v) => Array.isArray(d) ? d[u] ?? 0.5 : d && typeof d == "object" ? d[v] ?? 0.5 : 0.5, f = h(i.center || [0.5, 0.5], 0, "x") * o - o / 2, l = h(i.center || [0.5, 0.5], 1, "y") * e - e / 2, p = (i.degree || i.angle || 0) * (Math.PI / 180), c = (a = t.createConicGradient) == null ? void 0 : a.call(t, p, f, l);
5107
5108
  if (c) {
5108
5109
  if (i.stops.forEach((d) => {
5109
5110
  const u = d.offset !== void 0 ? d.offset : d.pos !== void 0 ? d.pos : d.position !== void 0 ? d.position : 0, v = r(d.color || "#000000", d.opacity ?? 100);
@@ -5115,8 +5116,8 @@ class ci {
5115
5116
  return c;
5116
5117
  }
5117
5118
  } else if (i.type === "DiamondGradient") {
5118
- const f = (d, u, v) => Array.isArray(d) ? d[u] ?? 0.5 : d && typeof d == "object" ? d[v] ?? 0.5 : 0.5, h = f(i.center || [0.5, 0.5], 0, "x") * o - o / 2, l = f(i.center || [0.5, 0.5], 1, "y") * e - e / 2, p = (i.radius ?? 0.5) * Math.max(o, e);
5119
- t.save(), t.translate(h, l), t.rotate(Math.PI / 4);
5119
+ const h = (d, u, v) => Array.isArray(d) ? d[u] ?? 0.5 : d && typeof d == "object" ? d[v] ?? 0.5 : 0.5, f = h(i.center || [0.5, 0.5], 0, "x") * o - o / 2, l = h(i.center || [0.5, 0.5], 1, "y") * e - e / 2, p = (i.radius ?? 0.5) * Math.max(o, e);
5120
+ t.save(), t.translate(f, l), t.rotate(Math.PI / 4);
5120
5121
  const c = t.createRadialGradient(0, 0, 0, 0, 0, p);
5121
5122
  if (i.stops.forEach((d) => {
5122
5123
  const u = d.offset !== void 0 ? d.offset : d.pos !== void 0 ? d.pos : d.position !== void 0 ? d.position : 0, v = r(d.color || "#000000", d.opacity ?? 100);
@@ -5131,12 +5132,12 @@ class ci {
5131
5132
  if (i.type === "Pattern" && i.url) {
5132
5133
  let r = this.imageCache.get(i.url);
5133
5134
  if (r || (r = new Image(), r.src = i.url, this.imageCache.set(i.url, r)), r.complete && r.naturalWidth > 0) {
5134
- const f = t.createPattern(r, "repeat");
5135
- if (f && (i.scaleX !== void 0 || i.offsetX !== void 0)) {
5136
- const h = new DOMMatrix(), l = i.scaleX ?? 1, p = i.scaleY ?? 1, c = i.offsetX ?? 0, d = i.offsetY ?? 0, u = i.rotation ?? 0;
5137
- h.translateSelf(c, d), h.rotateSelf(u), h.scaleSelf(l, p), f.setTransform(h);
5135
+ const h = t.createPattern(r, "repeat");
5136
+ if (h && (i.scaleX !== void 0 || i.offsetX !== void 0)) {
5137
+ const f = new DOMMatrix(), l = i.scaleX ?? 1, p = i.scaleY ?? 1, c = i.offsetX ?? 0, d = i.offsetY ?? 0, u = i.rotation ?? 0;
5138
+ f.translateSelf(c, d), f.rotateSelf(u), f.scaleSelf(l, p), h.setTransform(f);
5138
5139
  }
5139
- return f;
5140
+ return h;
5140
5141
  }
5141
5142
  }
5142
5143
  return i.color || null;
@@ -5153,43 +5154,43 @@ class ci {
5153
5154
  } catch {
5154
5155
  a = parseFloat(a) || 0;
5155
5156
  }
5156
- let r = 0, f = 0, h = 0, l = 0;
5157
- typeof a == "number" ? r = f = h = l = a : Array.isArray(a) ? a.length === 1 ? r = f = h = l = a[0] : a.length === 2 ? (r = h = a[0], f = l = a[1]) : a.length === 3 ? (r = a[0], f = l = a[1], h = a[2]) : a.length >= 4 && (r = a[0], f = a[1], h = a[2], l = a[3]) : a && typeof a == "object" && (r = a.tl ?? a.corner_radius ?? a.cornerRadius ?? 0, f = a.tr ?? a.corner_radius ?? a.cornerRadius ?? 0, h = a.br ?? a.corner_radius ?? a.cornerRadius ?? 0, l = a.bl ?? a.corner_radius ?? a.cornerRadius ?? 0);
5157
+ let r = 0, h = 0, f = 0, l = 0;
5158
+ typeof a == "number" ? r = h = f = l = a : Array.isArray(a) ? a.length === 1 ? r = h = f = l = a[0] : a.length === 2 ? (r = f = a[0], h = l = a[1]) : a.length === 3 ? (r = a[0], h = l = a[1], f = a[2]) : a.length >= 4 && (r = a[0], h = a[1], f = a[2], l = a[3]) : a && typeof a == "object" && (r = a.tl ?? a.corner_radius ?? a.cornerRadius ?? 0, h = a.tr ?? a.corner_radius ?? a.cornerRadius ?? 0, f = a.br ?? a.corner_radius ?? a.cornerRadius ?? 0, l = a.bl ?? a.corner_radius ?? a.cornerRadius ?? 0);
5158
5159
  const p = Math.min(Math.abs(e) / 2, Math.abs(s) / 2);
5159
- if (r = Math.min(Math.max(0, r), p), f = Math.min(Math.max(0, f), p), h = Math.min(Math.max(0, h), p), l = Math.min(Math.max(0, l), p), t.roundRect) {
5160
- t.roundRect(i, o, e, s, [r, f, h, l]);
5160
+ if (r = Math.min(Math.max(0, r), p), h = Math.min(Math.max(0, h), p), f = Math.min(Math.max(0, f), p), l = Math.min(Math.max(0, l), p), t.roundRect) {
5161
+ t.roundRect(i, o, e, s, [r, h, f, l]);
5161
5162
  return;
5162
5163
  }
5163
- t.moveTo(i + r, o), t.lineTo(i + e - f, o), t.arcTo(i + e, o, i + e, o + f, f), t.lineTo(i + e, o + s - h), t.arcTo(i + e, o + s, i + e - h, o + s, h), t.lineTo(i + l, o + s), t.arcTo(i, o + s, i, o + s - l, l), t.lineTo(i, o + r), t.arcTo(i, o, i + r, o, r), t.closePath();
5164
+ t.moveTo(i + r, o), t.lineTo(i + e - h, o), t.arcTo(i + e, o, i + e, o + h, h), t.lineTo(i + e, o + s - f), t.arcTo(i + e, o + s, i + e - f, o + s, f), t.lineTo(i + l, o + s), t.arcTo(i, o + s, i, o + s - l, l), t.lineTo(i, o + r), t.arcTo(i, o, i + r, o, r), t.closePath();
5164
5165
  }
5165
5166
  renderListView(t, i) {
5166
5167
  var A, W, z, Y;
5167
- const o = this.objectStates.get(i.id) || {}, e = o.options || i.options || {}, s = o.width !== void 0 ? o.width : ((A = i.geometry) == null ? void 0 : A.width) || 200, n = o.height !== void 0 ? o.height : ((W = i.geometry) == null ? void 0 : W.height) || 300, a = -s / 2, r = -n / 2, f = o.corner_radius !== void 0 ? o.corner_radius : e.corner_radius ?? 0, h = e.orientation || "vertical", l = e.items || [], p = e.itemGap ?? 10, c = e.itemHeight ?? 50, d = e.itemWidth ?? 200, u = e.scrollOffset ?? 0, v = e.padding ?? 0, b = e.glassEffect !== !1, m = e.accentColor || "#3b82f6", y = e.itemTextColor || "#333333", S = e.itemBackgroundColor || "#ffffff", C = e.hoveredIndex ?? null, w = e.activeItemIndex ?? null, M = e.glowIntensity ?? 0, I = e.glowColor || "#3b82f6", k = typeof I == "string" ? I : I.color || ((Y = (z = I.stops) == null ? void 0 : z[0]) == null ? void 0 : Y.color) || "#3b82f6", T = e.opacity !== void 0 ? e.opacity : i.opacity !== void 0 ? i.opacity : 1;
5168
+ const o = this.objectStates.get(i.id) || {}, e = o.options || i.options || {}, s = o.width !== void 0 ? o.width : ((A = i.geometry) == null ? void 0 : A.width) || 200, n = o.height !== void 0 ? o.height : ((W = i.geometry) == null ? void 0 : W.height) || 300, a = -s / 2, r = -n / 2, h = o.corner_radius !== void 0 ? o.corner_radius : e.corner_radius ?? 0, f = e.orientation || "vertical", l = e.items || [], p = e.itemGap ?? 10, c = e.itemHeight ?? 50, d = e.itemWidth ?? 200, u = e.scrollOffset ?? 0, v = e.padding ?? 0, b = e.glassEffect !== !1, m = e.accentColor || "#3b82f6", y = e.itemTextColor || "#333333", S = e.itemBackgroundColor || "#ffffff", C = e.hoveredIndex ?? null, w = e.activeItemIndex ?? null, M = e.glowIntensity ?? 0, I = e.glowColor || "#3b82f6", k = typeof I == "string" ? I : I.color || ((Y = (z = I.stops) == null ? void 0 : z[0]) == null ? void 0 : Y.color) || "#3b82f6", T = e.opacity !== void 0 ? e.opacity : i.opacity !== void 0 ? i.opacity : 1;
5168
5169
  if (t.save(), t.globalAlpha *= T, M > 0) {
5169
5170
  const G = t.getTransform(), N = Math.sqrt(G.a * G.a + G.b * G.b) || 1;
5170
5171
  t.shadowColor = k, t.shadowBlur = M * 2 * N, t.shadowOffsetX = 0, t.shadowOffsetY = 0;
5171
5172
  }
5172
5173
  if (b) {
5173
5174
  const G = e.listBackgroundColor || "rgba(31, 41, 55, 0.4)", N = this.createCanvasFill(t, G, s, n);
5174
- t.fillStyle = N || "rgba(31, 41, 55, 0.4)", t.beginPath(), this.drawCustomShape(t, e.containerShape || "rectangle", e.containerPath || "", a, r, s, n, f) || t.fill();
5175
+ t.fillStyle = N || "rgba(31, 41, 55, 0.4)", t.beginPath(), this.drawCustomShape(t, e.containerShape || "rectangle", e.containerPath || "", a, r, s, n, h) || t.fill();
5175
5176
  const x = t.createLinearGradient(a, r, a + s, r + n);
5176
- x.addColorStop(0, "rgba(255, 255, 255, 0.15)"), x.addColorStop(0.5, "rgba(255, 255, 255, 0.08)"), x.addColorStop(1, "rgba(255, 255, 255, 0.03)"), t.fillStyle = x, t.beginPath(), this.drawCustomShape(t, e.containerShape || "rectangle", e.containerPath || "", a, r, s, n, f) || 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, f) || t.stroke();
5177
+ x.addColorStop(0, "rgba(255, 255, 255, 0.15)"), x.addColorStop(0.5, "rgba(255, 255, 255, 0.08)"), x.addColorStop(1, "rgba(255, 255, 255, 0.03)"), t.fillStyle = x, t.beginPath(), this.drawCustomShape(t, e.containerShape || "rectangle", e.containerPath || "", a, r, s, n, h) || 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, h) || t.stroke();
5177
5178
  } else {
5178
5179
  const G = e.backgroundColor || e.listBackgroundColor || "transparent", N = this.createCanvasFill(t, G, s, n);
5179
5180
  if (N) {
5180
5181
  t.fillStyle = N, t.beginPath();
5181
- const x = this.drawCustomShape(t, e.containerShape || "rectangle", e.containerPath || "", a, r, s, n, f);
5182
+ const x = this.drawCustomShape(t, e.containerShape || "rectangle", e.containerPath || "", a, r, s, n, h);
5182
5183
  t.fill();
5183
5184
  }
5184
5185
  const J = e.borderWidth ?? 0;
5185
5186
  if (J > 0) {
5186
5187
  t.strokeStyle = e.borderColor || "#cccccc", t.lineWidth = J, t.beginPath();
5187
- const x = this.drawCustomShape(t, e.containerShape || "rectangle", e.containerPath || "", a, r, s, n, f);
5188
+ const x = this.drawCustomShape(t, e.containerShape || "rectangle", e.containerPath || "", a, r, s, n, h);
5188
5189
  t.stroke();
5189
5190
  }
5190
5191
  }
5191
5192
  t.shadowBlur = 0, t.save(), t.beginPath();
5192
- const L = this.drawCustomShape(t, e.containerShape || "rectangle", e.containerPath || "", a, r, s, n, f);
5193
+ const L = this.drawCustomShape(t, e.containerShape || "rectangle", e.containerPath || "", a, r, s, n, h);
5193
5194
  if (e.listLayout !== "circular")
5194
5195
  if (L && e.containerShape === "custom")
5195
5196
  try {
@@ -5199,16 +5200,16 @@ class ci {
5199
5200
  }
5200
5201
  else
5201
5202
  t.clip();
5202
- const P = typeof v == "number" ? v : h === "vertical" ? v[0] : v[3];
5203
- let _ = (h === "vertical" ? r : a) + u + P;
5203
+ const P = typeof v == "number" ? v : f === "vertical" ? v[0] : v[3];
5204
+ let _ = (f === "vertical" ? r : a) + u + P;
5204
5205
  if (t.textBaseline = "middle", l.forEach((G, N) => {
5205
- const J = e.listLayout || "linear", x = J === "circular" ? d : h === "vertical" ? s : d, F = J === "circular" || h === "vertical" ? c : n;
5206
+ const J = e.listLayout || "linear", x = J === "circular" ? d : f === "vertical" ? s : d, F = J === "circular" || f === "vertical" ? c : n;
5206
5207
  let j = 0, X = 0, tt = 0;
5207
5208
  if (J === "circular") {
5208
- const St = l.length || 1, Xt = Math.PI * 2 / St, le = e.circularStartAngle || 0, he = e.circularRadius || 100, et = u * 0.01 + le * Math.PI / 180, mt = N * Xt + et, Rt = a + s / 2, _t = r + n / 2;
5209
- j = Rt + Math.cos(mt) * he - x / 2, X = _t + Math.sin(mt) * he - F / 2, tt = mt + (e.itemRotation || 0) * Math.PI / 180;
5209
+ const St = l.length || 1, Xt = Math.PI * 2 / St, le = e.circularStartAngle || 0, fe = e.circularRadius || 100, et = u * 0.01 + le * Math.PI / 180, mt = N * Xt + et, Rt = a + s / 2, _t = r + n / 2;
5210
+ j = Rt + Math.cos(mt) * fe - x / 2, X = _t + Math.sin(mt) * fe - F / 2, tt = mt + (e.itemRotation || 0) * Math.PI / 180;
5210
5211
  } else
5211
- j = h === "vertical" ? a : _, X = h === "vertical" ? _ : r, tt = (e.itemRotation || 0) * Math.PI / 180;
5212
+ j = f === "vertical" ? a : _, X = f === "vertical" ? _ : r, tt = (e.itemRotation || 0) * Math.PI / 180;
5212
5213
  const R = C === N, O = w === N, D = O && e.activeItemShape ? e.activeItemShape : e.itemShape || "rectangle", q = O && e.activeItemShape ? e.activeItemPath : e.itemPath || "", ot = e.itemCornerRadius || 0;
5213
5214
  if (t.save(), tt !== 0 && (t.translate(j + x / 2, X + F / 2), t.rotate(tt), t.translate(-(j + x / 2), -(X + F / 2))), O) {
5214
5215
  const St = this.createCanvasFill(t, m, x, F);
@@ -5222,17 +5223,17 @@ class ci {
5222
5223
  t.fillStyle = St || S, t.beginPath(), this.drawCustomShape(t, D, q, j, X, x, F, ot) || (t.rect(j, X, x, F), t.fill());
5223
5224
  }
5224
5225
  if (O || R) {
5225
- const St = this.createCanvasFill(t, m, h === "vertical" ? 3 : x, h === "vertical" ? F : 3);
5226
- t.fillStyle = St || m, h === "vertical" ? t.fillRect(j, X, 3, F) : t.fillRect(j, X + F - 3, x, 3);
5226
+ const St = this.createCanvasFill(t, m, f === "vertical" ? 3 : x, f === "vertical" ? F : 3);
5227
+ t.fillStyle = St || m, f === "vertical" ? t.fillRect(j, X, 3, F) : t.fillRect(j, X + F - 3, x, 3);
5227
5228
  }
5228
5229
  const yt = O ? "#ffffff" : b ? "rgba(255, 255, 255, 0.9)" : y;
5229
5230
  t.fillStyle = yt, t.font = O || R ? "600 14px Inter, sans-serif" : "400 14px Inter, sans-serif";
5230
- const bt = typeof G == "string" ? G : (G == null ? void 0 : G.label) || `Item ${N + 1}`, gt = j + (h === "vertical" ? 16 : x / 2), Et = X + F / 2;
5231
- h === "horizontal" || J === "circular" ? t.textAlign = "center" : t.textAlign = "left";
5231
+ const bt = typeof G == "string" ? G : (G == null ? void 0 : G.label) || `Item ${N + 1}`, gt = j + (f === "vertical" ? 16 : x / 2), Et = X + F / 2;
5232
+ f === "horizontal" || J === "circular" ? t.textAlign = "center" : t.textAlign = "left";
5232
5233
  const It = J === "circular" ? j + x / 2 : gt;
5233
- t.fillText(bt, It, Et), t.restore(), _ += (h === "vertical" ? c : d) + p;
5234
+ t.fillText(bt, It, Et), t.restore(), _ += (f === "vertical" ? c : d) + p;
5234
5235
  }), t.restore(), e.showScrollbar !== !1) {
5235
- const G = (l.length || 0) * (h === "vertical" ? c : d) + ((l.length || 0) - 1) * p, N = h === "vertical" ? n : s, J = e.listLayout || "linear", x = e.containerShape === "circle" || J === "circular";
5236
+ const G = (l.length || 0) * (f === "vertical" ? c : d) + ((l.length || 0) - 1) * p, N = f === "vertical" ? n : s, J = e.listLayout || "linear", x = e.containerShape === "circle" || J === "circular";
5236
5237
  if (G > N || J === "circular" && l.length > 0) {
5237
5238
  const F = e.scrollbarColor || "rgba(255,255,255,0.3)", j = e.scrollbarWidth || 4;
5238
5239
  if (x) {
@@ -5247,7 +5248,7 @@ class ci {
5247
5248
  t.stroke();
5248
5249
  } else {
5249
5250
  const X = N / G, tt = N * X, R = -u / G * N;
5250
- t.fillStyle = F, h === "vertical" ? t.fillRect(a + s - j - 2, r + R, j, tt) : t.fillRect(a + R, r + n - j - 2, tt, j);
5251
+ t.fillStyle = F, f === "vertical" ? t.fillRect(a + s - j - 2, r + R, j, tt) : t.fillRect(a + R, r + n - j - 2, tt, j);
5251
5252
  }
5252
5253
  }
5253
5254
  }
@@ -5255,15 +5256,15 @@ class ci {
5255
5256
  }
5256
5257
  drawCustomShape(t, i, o, e, s, n, a, r) {
5257
5258
  if (i === "circle") {
5258
- const f = Math.min(n, a) / 2;
5259
- return t.arc(e + n / 2, s + a / 2, f, 0, Math.PI * 2), !1;
5259
+ const h = Math.min(n, a) / 2;
5260
+ return t.arc(e + n / 2, s + a / 2, h, 0, Math.PI * 2), !1;
5260
5261
  } else if (i === "pill") {
5261
- const f = Math.min(n, a) / 2;
5262
- return this.drawListViewRect(t, e, s, n, a, f), !1;
5262
+ const h = Math.min(n, a) / 2;
5263
+ return this.drawListViewRect(t, e, s, n, a, h), !1;
5263
5264
  } else if (i === "custom" && o)
5264
5265
  try {
5265
- const f = new Path2D(o);
5266
- return t.save(), t.translate(e, s), t.scale(n / 100, a / 100), t.fill(f), t.restore(), !0;
5266
+ const h = new Path2D(o);
5267
+ return t.save(), t.translate(e, s), t.scale(n / 100, a / 100), t.fill(h), t.restore(), !0;
5267
5268
  } catch {
5268
5269
  return this.drawListViewRect(t, e, s, n, a, r), !1;
5269
5270
  }
@@ -5274,10 +5275,10 @@ class ci {
5274
5275
  if (!this._lastPointerPos || !this._prevPointerPos) return;
5275
5276
  const i = t.options || {}, o = i.orientation || "vertical", e = this._lastPointerPos.x - this._prevPointerPos.x, s = this._lastPointerPos.y - this._prevPointerPos.y;
5276
5277
  o === "vertical" ? i.scrollOffset = (i.scrollOffset || 0) + s : i.scrollOffset = (i.scrollOffset || 0) + e;
5277
- const n = i.listLayout || "linear", a = this.objectStates.get(t.id) || {}, r = i.items || [], f = i.itemGap ?? 10, h = i.itemHeight ?? 50, l = i.itemWidth ?? 200, p = a.width !== void 0 ? a.width : ((b = t.geometry) == null ? void 0 : b.width) || 200, c = a.height !== void 0 ? a.height : ((m = t.geometry) == null ? void 0 : m.height) || 300;
5278
+ const n = i.listLayout || "linear", a = this.objectStates.get(t.id) || {}, r = i.items || [], h = i.itemGap ?? 10, f = i.itemHeight ?? 50, l = i.itemWidth ?? 200, p = a.width !== void 0 ? a.width : ((b = t.geometry) == null ? void 0 : b.width) || 200, c = a.height !== void 0 ? a.height : ((m = t.geometry) == null ? void 0 : m.height) || 300;
5278
5279
  if (n === "circular")
5279
5280
  return;
5280
- const d = (r.length || 0) * (o === "vertical" ? h : l) + ((r.length || 0) - 1) * f, v = Math.max(0, d - (o === "vertical" ? c : p) + (i.padding * 2 || 0));
5281
+ const d = (r.length || 0) * (o === "vertical" ? f : l) + ((r.length || 0) - 1) * h, v = Math.max(0, d - (o === "vertical" ? c : p) + (i.padding * 2 || 0));
5281
5282
  i.scrollOffset > 0 && (i.scrollOffset = 0), i.scrollOffset < -v && (i.scrollOffset = -v);
5282
5283
  }
5283
5284
  updateListViewHoverFromPointer(t, i, o) {
@@ -5288,24 +5289,24 @@ class ci {
5288
5289
  var z, Y;
5289
5290
  const e = t.options || {}, s = this.objectStates.get(t.id) || {}, n = e.items || [];
5290
5291
  if (n.length === 0) return null;
5291
- const a = s.width !== void 0 ? s.width : ((z = t.geometry) == null ? void 0 : z.width) || 200, r = s.height !== void 0 ? s.height : ((Y = t.geometry) == null ? void 0 : Y.height) || 300, f = e.orientation || "vertical", h = e.itemGap ?? 10, l = e.itemHeight ?? 50, p = e.itemWidth ?? 200, c = e.scrollOffset ?? 0, d = e.padding ?? 0, u = this.getWorldTransform(t.id), v = i - u.x, b = o - u.y, m = -u.rotation * (Math.PI / 180), y = Math.cos(m), S = Math.sin(m), C = v * y - b * S, w = v * S + b * y, M = -a / 2, I = -r / 2, k = typeof d == "number" ? d : f === "vertical" ? d[0] : d[3];
5292
- let T = (f === "vertical" ? I : M) + c + k;
5292
+ const a = s.width !== void 0 ? s.width : ((z = t.geometry) == null ? void 0 : z.width) || 200, r = s.height !== void 0 ? s.height : ((Y = t.geometry) == null ? void 0 : Y.height) || 300, h = e.orientation || "vertical", f = e.itemGap ?? 10, l = e.itemHeight ?? 50, p = e.itemWidth ?? 200, c = e.scrollOffset ?? 0, d = e.padding ?? 0, u = this.getWorldTransform(t.id), v = i - u.x, b = o - u.y, m = -u.rotation * (Math.PI / 180), y = Math.cos(m), S = Math.sin(m), C = v * y - b * S, w = v * S + b * y, M = -a / 2, I = -r / 2, k = typeof d == "number" ? d : h === "vertical" ? d[0] : d[3];
5293
+ let T = (h === "vertical" ? I : M) + c + k;
5293
5294
  const L = e.listLayout || "linear", P = n.length || 1, _ = Math.PI * 2 / P, E = e.circularStartAngle || 0, A = e.circularRadius || 100, W = c * 0.01 + E * Math.PI / 180;
5294
5295
  for (let G = 0; G < n.length; G++) {
5295
- const N = L === "circular" ? p : f === "vertical" ? a : p, J = L === "circular" || f === "vertical" ? l : r;
5296
+ const N = L === "circular" ? p : h === "vertical" ? a : p, J = L === "circular" || h === "vertical" ? l : r;
5296
5297
  let x = 0, F = 0, j = 0;
5297
5298
  if (L === "circular") {
5298
5299
  const X = G * _ + W, tt = M + a / 2, R = I + r / 2;
5299
5300
  x = tt + Math.cos(X) * A - N / 2, F = R + Math.sin(X) * A - J / 2, j = X + (e.itemRotation || 0) * Math.PI / 180;
5300
5301
  } else
5301
- x = f === "vertical" ? M : T, F = f === "vertical" ? T : I, j = (e.itemRotation || 0) * Math.PI / 180;
5302
+ x = h === "vertical" ? M : T, F = h === "vertical" ? T : I, j = (e.itemRotation || 0) * Math.PI / 180;
5302
5303
  if (j !== 0) {
5303
5304
  const X = x + N / 2, tt = F + J / 2, R = C - X, O = w - tt, D = -j, q = R * Math.cos(D) - O * Math.sin(D) + X, ot = R * Math.sin(D) + O * Math.cos(D) + tt;
5304
5305
  if (q >= x && q <= x + N && ot >= F && ot <= F + J)
5305
5306
  return G;
5306
5307
  } else if (C >= x && C <= x + N && w >= F && w <= F + J)
5307
5308
  return G;
5308
- T += (f === "vertical" ? l : p) + h;
5309
+ T += (h === "vertical" ? l : p) + f;
5309
5310
  }
5310
5311
  return null;
5311
5312
  }
@@ -5323,28 +5324,28 @@ class ci {
5323
5324
  if (!e.behaviors || e.behaviors.length === 0) return;
5324
5325
  const s = this.objectStates.get(e.id);
5325
5326
  s && e.behaviors.forEach((n) => {
5326
- var p, c, d, u, v, b, m, y, S, C, w, M, I, k, T, L, P, _, E, A, W, z, Y, G, N, J, x, F, j, X, tt, R, O, D, q, ot, yt, bt, gt, Et, It, St, Xt, le, he, et, mt, Rt, _t, dt, Ft, Dt, $t, Ot, Vt, ie, me, ye, Ut, Se, Pe, Ee, Ce, Ae, xe, se, jt, ft, pt, at, B, nt, Z, Pt, xt, kt, At, Mt, $, Wt, Kt, te, Jt, ut, ct, Ct, rt, V, st, it, vt, Yt, Qt, ne, Gt, Ht, Nt, Ie, Le, Re, Oe, Fe, $e, Ye, zt, oe, we, Be, We, de, ce, fe, ke, Xe, Ve, Ne, De, He;
5327
+ var p, c, d, u, v, b, m, y, S, C, w, M, I, k, T, L, P, _, E, A, W, z, Y, G, N, J, x, F, j, X, tt, R, O, D, q, ot, yt, bt, gt, Et, It, St, Xt, le, fe, et, mt, Rt, _t, dt, Ft, Dt, $t, Ot, Vt, ie, me, ye, Ut, Se, Pe, Ee, Ce, Ae, xe, se, jt, ht, pt, at, B, nt, Z, Pt, xt, kt, At, Mt, $, Wt, Kt, te, Jt, ut, ct, Ct, rt, V, st, it, vt, Yt, Qt, ne, Gt, Ht, Nt, Ie, Le, Re, Oe, Fe, $e, Ye, zt, oe, we, Be, We, de, ce, he, ke, Xe, Ve, Ne, De, He;
5327
5328
  if (!n.enabled) return;
5328
5329
  const a = n.startTime || 0, r = n.endTime || 1 / 0;
5329
5330
  if (this.currentTime < a || this.currentTime > r) return;
5330
- const f = s.x - i, h = s.y - o, l = Math.sqrt(f * f + h * h);
5331
+ const h = s.x - i, f = s.y - o, l = Math.sqrt(h * h + f * f);
5331
5332
  if (this.frameCount % 240 === 0 && Math.random() < 0.1 && this.log(`[ExodeUI] Executing ${n.type} on ${e.name}`), n.type === U.Proximity) {
5332
5333
  const H = ((p = n.settings) == null ? void 0 : p.radius) || 300, Q = ((c = n.settings) == null ? void 0 : c.falloff) || "smooth";
5333
5334
  let K = 0;
5334
- l < H && (Q === "linear" ? K = 1 - l / H : K = Math.pow(1 - l / H, 2)), n.sensors.forEach((ht) => {
5335
- this.applyBehaviorSensor(s, ht, K, t, n.settings, e, f, h, l);
5335
+ l < H && (Q === "linear" ? K = 1 - l / H : K = Math.pow(1 - l / H, 2)), n.sensors.forEach((ft) => {
5336
+ this.applyBehaviorSensor(s, ft, K, t, n.settings, e, h, f, l);
5336
5337
  });
5337
5338
  } else if (n.type === U.Magnetic) {
5338
5339
  const H = ((d = n.settings) == null ? void 0 : d.radius) || 400, Q = ((u = n.settings) == null ? void 0 : u.strength) || 0.5;
5339
5340
  if (l < H && l > 5) {
5340
- const K = 1 - l / H, ht = f * K * Q, Tt = h * K * Q;
5341
- s.x -= ht * t * 10, s.y -= Tt * t * 10;
5341
+ const K = 1 - l / H, ft = h * K * Q, Tt = f * K * Q;
5342
+ s.x -= ft * t * 10, s.y -= Tt * t * 10;
5342
5343
  }
5343
5344
  } else if (n.type === U.Repel) {
5344
5345
  const H = ((v = n.settings) == null ? void 0 : v.radius) || 300, Q = ((b = n.settings) == null ? void 0 : b.strength) || 1;
5345
5346
  if (l < H) {
5346
5347
  const K = Math.pow(1 - l / H, 2);
5347
- s.x += f / (l || 1) * K * 60 * Q * t * 5, s.y += h / (l || 1) * K * 60 * Q * t * 5;
5348
+ s.x += h / (l || 1) * K * 60 * Q * t * 5, s.y += f / (l || 1) * K * 60 * Q * t * 5;
5348
5349
  }
5349
5350
  } else if (n.type === U.Orbit) {
5350
5351
  const H = ((m = n.settings) == null ? void 0 : m.speed) || 1, Q = ((y = n.settings) == null ? void 0 : y.radius) || 30, K = this.currentTime * H * Math.PI * 2;
@@ -5352,14 +5353,14 @@ class ci {
5352
5353
  } else if (n.type === U.Vortex) {
5353
5354
  const H = ((S = n.settings) == null ? void 0 : S.radius) || 400, Q = ((C = n.settings) == null ? void 0 : C.speed) || 2, K = ((w = n.settings) == null ? void 0 : w.strength) || 1;
5354
5355
  if (l < H) {
5355
- const ht = Math.pow(1 - l / H, 1.5), Tt = this.currentTime * Q * Math.PI * 2, Lt = Math.cos(Tt) * 30 - f * 0.4, Bt = Math.sin(Tt) * 30 - h * 0.4;
5356
- s.x += Lt * ht * K * t * 5, s.y += Bt * ht * K * t * 5, s.rotation += 5 * ht * K * t * 5, s.scale_x *= 1 - ht * 0.1 * K * t, s.scale_y *= 1 - ht * 0.1 * K * t;
5356
+ const ft = Math.pow(1 - l / H, 1.5), Tt = this.currentTime * Q * Math.PI * 2, Lt = Math.cos(Tt) * 30 - h * 0.4, Bt = Math.sin(Tt) * 30 - f * 0.4;
5357
+ s.x += Lt * ft * K * t * 5, s.y += Bt * ft * K * t * 5, s.rotation += 5 * ft * K * t * 5, s.scale_x *= 1 - ft * 0.1 * K * t, s.scale_y *= 1 - ft * 0.1 * K * t;
5357
5358
  }
5358
5359
  } else if (n.type === U.Fluid) {
5359
5360
  const H = ((M = n.settings) == null ? void 0 : M.radius) || 300, Q = ((I = n.settings) == null ? void 0 : I.strength) || 1;
5360
5361
  if (l < H) {
5361
- const K = Math.pow(1 - l / H, 1.2), ht = f / (l || 1) * K * 1.2 * Q, Tt = h / (l || 1) * K * 1.2 * Q;
5362
- s.x += ht * 10 * t * 5, s.y += Tt * 10 * t * 5, s.scale_x *= 1 + K * 0.3 * Q * t, s.scale_y *= 1 + K * 0.3 * Q * t;
5362
+ const K = Math.pow(1 - l / H, 1.2), ft = h / (l || 1) * K * 1.2 * Q, Tt = f / (l || 1) * K * 1.2 * Q;
5363
+ s.x += ft * 10 * t * 5, s.y += Tt * 10 * t * 5, s.scale_x *= 1 + K * 0.3 * Q * t, s.scale_y *= 1 + K * 0.3 * Q * t;
5363
5364
  }
5364
5365
  } else if (n.type === U.Elastic) {
5365
5366
  const H = ((k = n.settings) == null ? void 0 : k.radius) || 300, Q = ((T = n.settings) == null ? void 0 : T.strength) || 1;
@@ -5370,14 +5371,14 @@ class ci {
5370
5371
  } else if (n.type === U.Holographic) {
5371
5372
  const H = s.x - this.canvasWidth / 2, Q = s.y - this.canvasHeight / 2, K = ((L = n.settings) == null ? void 0 : L.factor) || 25;
5372
5373
  if (s.x -= H / 1e3 * K * t * 5, s.y -= Q / 1e3 * K * t * 5, s.style) {
5373
- const ht = 1 - Math.min(1, l / 400);
5374
- s.style.exposure = (s.style.exposure || 1) + ht * 0.5 * t;
5374
+ const ft = 1 - Math.min(1, l / 400);
5375
+ s.style.exposure = (s.style.exposure || 1) + ft * 0.5 * t;
5375
5376
  }
5376
5377
  } else if (n.type === U.Sticky) {
5377
5378
  const H = ((P = n.settings) == null ? void 0 : P.radius) || 80, Q = ((_ = n.settings) == null ? void 0 : _.strength) || 1;
5378
5379
  if (l < H) {
5379
5380
  const K = Math.pow(1 - l / H, 2);
5380
- s.x -= f * K * Q * t * 10, s.y -= h * K * Q * t * 10, s.scale_x *= 1 - K * 0.1 * Q * t, s.scale_y *= 1 - K * 0.1 * Q * t;
5381
+ s.x -= h * K * Q * t * 10, s.y -= f * K * Q * t * 10, s.scale_x *= 1 - K * 0.1 * Q * t, s.scale_y *= 1 - K * 0.1 * Q * t;
5381
5382
  }
5382
5383
  } else if (n.type === U.Dilation) {
5383
5384
  const H = ((E = n.settings) == null ? void 0 : E.size) || 120, Q = ((A = n.settings) == null ? void 0 : A.strength) || 1;
@@ -5386,25 +5387,25 @@ class ci {
5386
5387
  s.scale_x *= 1 + K * 0.5 * Q * t, s.scale_y *= 1 + K * 0.5 * Q * t;
5387
5388
  }
5388
5389
  } else if (n.type === U.Parallax) {
5389
- const H = ((W = n.settings) == null ? void 0 : W.factor) || 15, Q = ((z = n.settings) == null ? void 0 : z.strength) || 1, K = this.canvasWidth / 2, ht = this.canvasHeight / 2, Tt = this._lastPointerPos || { x: K, y: ht }, Lt = (Tt.x - K) / K, Bt = (Tt.y - ht) / ht, ee = (((Y = e.transform) == null ? void 0 : Y.x) ?? 0) + Lt * H * Q, ue = (((G = e.transform) == null ? void 0 : G.y) ?? 0) + Bt * H * Q, Te = (((N = e.transform) == null ? void 0 : N.rotate_x) ?? 0) - Bt * H * 1.5 * Q, ae = (((J = e.transform) == null ? void 0 : J.rotate_y) ?? 0) + Lt * H * 1.5 * Q, be = Math.min(1, 10 * t);
5390
+ const H = ((W = n.settings) == null ? void 0 : W.factor) || 15, Q = ((z = n.settings) == null ? void 0 : z.strength) || 1, K = this.canvasWidth / 2, ft = this.canvasHeight / 2, Tt = this._lastPointerPos || { x: K, y: ft }, Lt = (Tt.x - K) / K, Bt = (Tt.y - ft) / ft, ee = (((Y = e.transform) == null ? void 0 : Y.x) ?? 0) + Lt * H * Q, ue = (((G = e.transform) == null ? void 0 : G.y) ?? 0) + Bt * H * Q, Te = (((N = e.transform) == null ? void 0 : N.rotate_x) ?? 0) - Bt * H * 1.5 * Q, ae = (((J = e.transform) == null ? void 0 : J.rotate_y) ?? 0) + Lt * H * 1.5 * Q, be = Math.min(1, 10 * t);
5390
5391
  s.x = this.lerp(s.x ?? ((x = e.transform) == null ? void 0 : x.x) ?? 0, ee, be), s.y = this.lerp(s.y ?? ((F = e.transform) == null ? void 0 : F.y) ?? 0, ue, be), s.rotate_x = this.lerp(s.rotate_x ?? ((j = e.transform) == null ? void 0 : j.rotate_x) ?? 0, Te, be), s.rotate_y = this.lerp(s.rotate_y ?? ((X = e.transform) == null ? void 0 : X.rotate_y) ?? 0, ae, be);
5391
5392
  } else if (n.type === U.Fold) {
5392
5393
  if (l < 300) {
5393
- const H = 1 - l / 300, Q = (f > 0 ? -1 : 1) * H * 10, K = 1 - H * 0.1, ht = h / 300 * H * 20, Tt = -(f / 300) * H * 20, Lt = Math.min(1, 10 * t);
5394
- s.skew_x = this.lerp(s.skew_x ?? ((tt = e.transform) == null ? void 0 : tt.skew_x) ?? 0, Q, Lt), s.scale_y = this.lerp(s.scale_y ?? ((R = e.transform) == null ? void 0 : R.scale_y) ?? 1, (((O = e.transform) == null ? void 0 : O.scale_y) ?? 1) * K, Lt), s.rotate_x = this.lerp(s.rotate_x ?? ((D = e.transform) == null ? void 0 : D.rotate_x) ?? 0, ht, Lt), s.rotate_y = this.lerp(s.rotate_y ?? ((q = e.transform) == null ? void 0 : q.rotate_y) ?? 0, Tt, Lt), s.style = s.style || { ...e.style }, s.style.artEffect = { enabled: !0, type: "fold_overlay", intensity: ((ot = n.settings) == null ? void 0 : ot.opacity) ?? 0.5 };
5394
+ const H = 1 - l / 300, Q = (h > 0 ? -1 : 1) * H * 10, K = 1 - H * 0.1, ft = f / 300 * H * 20, Tt = -(h / 300) * H * 20, Lt = Math.min(1, 10 * t);
5395
+ s.skew_x = this.lerp(s.skew_x ?? ((tt = e.transform) == null ? void 0 : tt.skew_x) ?? 0, Q, Lt), s.scale_y = this.lerp(s.scale_y ?? ((R = e.transform) == null ? void 0 : R.scale_y) ?? 1, (((O = e.transform) == null ? void 0 : O.scale_y) ?? 1) * K, Lt), s.rotate_x = this.lerp(s.rotate_x ?? ((D = e.transform) == null ? void 0 : D.rotate_x) ?? 0, ft, Lt), s.rotate_y = this.lerp(s.rotate_y ?? ((q = e.transform) == null ? void 0 : q.rotate_y) ?? 0, Tt, Lt), s.style = s.style || { ...e.style }, s.style.artEffect = { enabled: !0, type: "fold_overlay", intensity: ((ot = n.settings) == null ? void 0 : ot.opacity) ?? 0.5 };
5395
5396
  }
5396
5397
  } else if (n.type === U.Crumple) {
5397
5398
  if (l < 300) {
5398
- const H = 1 - l / 300, Q = H * (Math.random() - 0.5) * 5, K = H * (Math.random() - 0.5) * 0.05, ht = Math.min(1, 15 * t);
5399
- s.skew_x = this.lerp(s.skew_x ?? ((yt = e.transform) == null ? void 0 : yt.skew_x) ?? 0, Q, ht), s.scale_x = this.lerp(s.scale_x ?? ((bt = e.transform) == null ? void 0 : bt.scale_x) ?? 1, (((gt = e.transform) == null ? void 0 : gt.scale_x) ?? 1) * (1 + K), ht), s.scale_y = this.lerp(s.scale_y ?? ((Et = e.transform) == null ? void 0 : Et.scale_y) ?? 1, (((It = e.transform) == null ? void 0 : It.scale_y) ?? 1) * (1 + K), ht), s.style = s.style || { ...e.style }, s.style.artEffect = { enabled: !0, type: "crumple_overlay", intensity: ((St = n.settings) == null ? void 0 : St.intensity) ?? 1, scale: ((Xt = n.settings) == null ? void 0 : Xt.scale) ?? 2 };
5399
+ const H = 1 - l / 300, Q = H * (Math.random() - 0.5) * 5, K = H * (Math.random() - 0.5) * 0.05, ft = Math.min(1, 15 * t);
5400
+ s.skew_x = this.lerp(s.skew_x ?? ((yt = e.transform) == null ? void 0 : yt.skew_x) ?? 0, Q, ft), s.scale_x = this.lerp(s.scale_x ?? ((bt = e.transform) == null ? void 0 : bt.scale_x) ?? 1, (((gt = e.transform) == null ? void 0 : gt.scale_x) ?? 1) * (1 + K), ft), s.scale_y = this.lerp(s.scale_y ?? ((Et = e.transform) == null ? void 0 : Et.scale_y) ?? 1, (((It = e.transform) == null ? void 0 : It.scale_y) ?? 1) * (1 + K), ft), s.style = s.style || { ...e.style }, s.style.artEffect = { enabled: !0, type: "crumple_overlay", intensity: ((St = n.settings) == null ? void 0 : St.intensity) ?? 1, scale: ((Xt = n.settings) == null ? void 0 : Xt.scale) ?? 2 };
5400
5401
  }
5401
5402
  } else if (n.type === U.Squash) {
5402
5403
  const H = ((le = n.settings) == null ? void 0 : le.strength) || 0.8;
5403
- l < (e.width || 100) && this.isMouseDown ? (s.scale_y = this.lerp(s.scale_y ?? 1, (((he = e.transform) == null ? void 0 : he.scale_y) ?? 1) * H, 0.3), s.scale_x = this.lerp(s.scale_x ?? 1, (((et = e.transform) == null ? void 0 : et.scale_x) ?? 1) * (1 + (1 - H) * 0.4), 0.3)) : (s.scale_y = this.lerp(s.scale_y ?? 1, ((mt = e.transform) == null ? void 0 : mt.scale_y) ?? 1, 0.2), s.scale_x = this.lerp(s.scale_x ?? 1, ((Rt = e.transform) == null ? void 0 : Rt.scale_x) ?? 1, 0.2));
5404
+ l < (e.width || 100) && this.isMouseDown ? (s.scale_y = this.lerp(s.scale_y ?? 1, (((fe = e.transform) == null ? void 0 : fe.scale_y) ?? 1) * H, 0.3), s.scale_x = this.lerp(s.scale_x ?? 1, (((et = e.transform) == null ? void 0 : et.scale_x) ?? 1) * (1 + (1 - H) * 0.4), 0.3)) : (s.scale_y = this.lerp(s.scale_y ?? 1, ((mt = e.transform) == null ? void 0 : mt.scale_y) ?? 1, 0.2), s.scale_x = this.lerp(s.scale_x ?? 1, ((Rt = e.transform) == null ? void 0 : Rt.scale_x) ?? 1, 0.2));
5404
5405
  } else if (n.type === U.TextCounter) {
5405
5406
  const H = ((_t = n.settings) == null ? void 0 : _t.duration) || 2, Q = ((dt = n.settings) == null ? void 0 : dt.from) || 0, K = ((Ft = n.settings) == null ? void 0 : Ft.to) || 100;
5406
5407
  n._runtimeStart === void 0 && (n._runtimeStart = this.currentTime);
5407
- const ht = this.currentTime - n._runtimeStart, Tt = Math.min(1, ht / H), Lt = Math.floor(Q + (K - Q) * Tt);
5408
+ const ft = this.currentTime - n._runtimeStart, Tt = Math.min(1, ft / H), Lt = Math.floor(Q + (K - Q) * Tt);
5408
5409
  if (((Dt = e.geometry) == null ? void 0 : Dt.type) === "Text") {
5409
5410
  const Bt = (($t = n.settings) == null ? void 0 : $t.prefix) || "", ee = ((Ot = n.settings) == null ? void 0 : Ot.suffix) || "";
5410
5411
  s.geometry || (s.geometry = { ...e.geometry }), s.geometry.text = `${Bt}${Lt}${ee}`;
@@ -5420,19 +5421,19 @@ class ci {
5420
5421
  const H = (((Ce = n.settings) == null ? void 0 : Ce.frequency) || ((Ae = n.settings) == null ? void 0 : Ae.speed) || 1) * 2e-3, Q = (((xe = n.settings) == null ? void 0 : xe.amplitude) || ((se = n.settings) == null ? void 0 : se.range) || 50) * (((jt = n.settings) == null ? void 0 : jt.strength) || 1), K = Date.now();
5421
5422
  s.x += Math.sin(K * H) * Q * t, s.y += Math.cos(K * H * 0.8) * Q * t, s.rotation += Math.sin(K * H * 0.5) * 5 * t;
5422
5423
  } else if (n.type === U.Pulse) {
5423
- const H = (((ft = n.settings) == null ? void 0 : ft.speed) || 1) * 5e-3, Q = (((pt = n.settings) == null ? void 0 : pt.scale) || 1.2) - 1, K = Math.sin(Date.now() * H), ht = ((at = n.settings) == null ? void 0 : at.strength) || 1;
5424
- s.scale_x *= 1 + K * Q * ht * t, s.scale_y *= 1 + K * Q * ht * t, s.style && (s.style.exposure = (s.style.exposure || 1) + Math.max(0, K) * 0.1 * ht * t);
5424
+ const H = (((ht = n.settings) == null ? void 0 : ht.speed) || 1) * 5e-3, Q = (((pt = n.settings) == null ? void 0 : pt.scale) || 1.2) - 1, K = Math.sin(Date.now() * H), ft = ((at = n.settings) == null ? void 0 : at.strength) || 1;
5425
+ s.scale_x *= 1 + K * Q * ft * t, s.scale_y *= 1 + K * Q * ft * t, s.style && (s.style.exposure = (s.style.exposure || 1) + Math.max(0, K) * 0.1 * ft * t);
5425
5426
  } else if (n.type === U.Draggable) {
5426
5427
  const H = ((B = n.settings) == null ? void 0 : B.radius) || 150, Q = this.draggingBehaviors.has(e.id);
5427
5428
  if (l < H || Q) {
5428
- const K = ((nt = n.settings) == null ? void 0 : nt.strength) || 1, ht = Q ? 1 : Math.max(0, 1 - l / H);
5429
- this.applyBehaviorSensor(s, Zt.PositionX, ht * K, t, n.settings), this.applyBehaviorSensor(s, Zt.PositionY, ht * K, t, n.settings);
5429
+ const K = ((nt = n.settings) == null ? void 0 : nt.strength) || 1, ft = Q ? 1 : Math.max(0, 1 - l / H);
5430
+ this.applyBehaviorSensor(s, Zt.PositionX, ft * K, t, n.settings), this.applyBehaviorSensor(s, Zt.PositionY, ft * K, t, n.settings);
5430
5431
  }
5431
5432
  } else if (n.type === U.Scroll) {
5432
- const H = ((Z = n.settings) == null ? void 0 : Z.axis) || "vertical", Q = ((Pt = n.settings) == null ? void 0 : Pt.factor) || 0.5, K = ((xt = n.settings) == null ? void 0 : xt.strength) || 1, ht = ((kt = n.settings) == null ? void 0 : kt.scaleFactor) || 0;
5433
- (H === "vertical" || H === "both") && (s.y += this.scrollOffset.y * Q * K * t), (H === "horizontal" || H === "both") && (s.x += this.scrollOffset.x * Q * K * t), ht !== 0 && (s.scale_x *= 1 + this.scrollOffset.y * ht * t, s.scale_y *= 1 + this.scrollOffset.y * ht * t);
5433
+ const H = ((Z = n.settings) == null ? void 0 : Z.axis) || "vertical", Q = ((Pt = n.settings) == null ? void 0 : Pt.factor) || 0.5, K = ((xt = n.settings) == null ? void 0 : xt.strength) || 1, ft = ((kt = n.settings) == null ? void 0 : kt.scaleFactor) || 0;
5434
+ (H === "vertical" || H === "both") && (s.y += this.scrollOffset.y * Q * K * t), (H === "horizontal" || H === "both") && (s.x += this.scrollOffset.x * Q * K * t), ft !== 0 && (s.scale_x *= 1 + this.scrollOffset.y * ft * t, s.scale_y *= 1 + this.scrollOffset.y * ft * t);
5434
5435
  } else if (n.type === U.LookAt) {
5435
- const H = ((At = n.settings) == null ? void 0 : At.factor) || 1, Q = ((Mt = n.settings) == null ? void 0 : Mt.strength) || 1, K = Math.atan2(-h, -f) * (180 / Math.PI), ht = s.rotation, Tt = (K - ht + 180) % 360 - 180;
5436
+ const H = ((At = n.settings) == null ? void 0 : At.factor) || 1, Q = ((Mt = n.settings) == null ? void 0 : Mt.strength) || 1, K = Math.atan2(-f, -h) * (180 / Math.PI), ft = s.rotation, Tt = (K - ft + 180) % 360 - 180;
5436
5437
  s.rotation += Tt * H * Q * t * 10;
5437
5438
  } else if (n.type === U.Scan) {
5438
5439
  const H = ((($ = n.settings) == null ? void 0 : $.speed) || 1) * 4e-3, Q = ((Wt = n.settings) == null ? void 0 : Wt.strength) || 1, K = (Math.sin(Date.now() * H) + 1) / 2;
@@ -5454,8 +5455,8 @@ class ci {
5454
5455
  if (H) {
5455
5456
  const Q = this.objectStates.get(H);
5456
5457
  if (Q) {
5457
- const K = ((rt = n.settings) == null ? void 0 : rt.stiffness) || 0.1, ht = Q.x - s.x, Tt = Q.y - s.y;
5458
- s.x += ht * K * t * 60, s.y += Tt * K * t * 60;
5458
+ const K = ((rt = n.settings) == null ? void 0 : rt.stiffness) || 0.1, ft = Q.x - s.x, Tt = Q.y - s.y;
5459
+ s.x += ft * K * t * 60, s.y += Tt * K * t * 60;
5459
5460
  }
5460
5461
  }
5461
5462
  } else if (n.type === U.Wrap)
@@ -5484,30 +5485,30 @@ class ci {
5484
5485
  const H = ((Oe = n.settings) == null ? void 0 : Oe.watchProperties) || ["x", "y", "scale_x", "scale_y", "opacity", "rotation"], Q = ((Fe = n.settings) == null ? void 0 : Fe.duration) || 0.3;
5485
5486
  this._layoutAnimCache.has(e.id) || this._layoutAnimCache.set(e.id, /* @__PURE__ */ new Map());
5486
5487
  const K = this._layoutAnimCache.get(e.id);
5487
- for (const ht of H) {
5488
- const Tt = this.getObjectProperty(s, e, ht);
5488
+ for (const ft of H) {
5489
+ const Tt = this.getObjectProperty(s, e, ft);
5489
5490
  if (Tt === void 0) continue;
5490
- const Lt = K.get(ht);
5491
+ const Lt = K.get(ft);
5491
5492
  if (!Lt)
5492
- K.set(ht, {
5493
+ K.set(ft, {
5493
5494
  from: Tt,
5494
5495
  to: Tt,
5495
5496
  startTime: this.currentTime,
5496
5497
  duration: 0
5497
5498
  });
5498
5499
  else if (Lt.to !== Tt) {
5499
- const ee = this.getObjectProperty(s, e, ht);
5500
- K.set(ht, {
5500
+ const ee = this.getObjectProperty(s, e, ft);
5501
+ K.set(ft, {
5501
5502
  from: ee ?? Lt.from,
5502
5503
  to: Tt,
5503
5504
  startTime: this.currentTime,
5504
5505
  duration: (($e = n.settings) == null ? void 0 : $e.duration) ?? Q
5505
5506
  });
5506
5507
  }
5507
- const Bt = K.get(ht);
5508
+ const Bt = K.get(ft);
5508
5509
  if (Bt.duration > 0 && Bt.from !== Bt.to) {
5509
5510
  const ee = this.currentTime - Bt.startTime, ue = Math.min(1, ee / Bt.duration), Te = this.applyEasing(ue, ((Ye = n.settings) == null ? void 0 : Ye.easing) || "easeOutCubic"), ae = Bt.from + (Bt.to - Bt.from) * Te;
5510
- this.setObjectProperty(s, e, ht, ae);
5511
+ this.setObjectProperty(s, e, ft, ae);
5511
5512
  }
5512
5513
  }
5513
5514
  } else if (n.type === U.StateReactive) {
@@ -5527,30 +5528,30 @@ class ci {
5527
5528
  "style.shadow.offsetX",
5528
5529
  "style.shadow.offsetY"
5529
5530
  ];
5530
- for (const ht of K) {
5531
- const Tt = this.getObjectProperty(s, e, ht);
5531
+ for (const ft of K) {
5532
+ const Tt = this.getObjectProperty(s, e, ft);
5532
5533
  if (Tt === void 0 || typeof Tt != "number") continue;
5533
- const Lt = H.get(ht);
5534
+ const Lt = H.get(ft);
5534
5535
  if (!Lt)
5535
- H.set(ht, {
5536
+ H.set(ft, {
5536
5537
  from: Tt,
5537
5538
  to: Tt,
5538
5539
  startTime: this.currentTime,
5539
5540
  duration: 0
5540
5541
  });
5541
5542
  else if (Lt.to !== Tt) {
5542
- const ee = this.getObjectProperty(s, e, ht);
5543
- H.set(ht, {
5543
+ const ee = this.getObjectProperty(s, e, ft);
5544
+ H.set(ft, {
5544
5545
  from: ee ?? Lt.from,
5545
5546
  to: Tt,
5546
5547
  startTime: this.currentTime,
5547
5548
  duration: Q
5548
5549
  });
5549
5550
  }
5550
- const Bt = H.get(ht);
5551
+ const Bt = H.get(ft);
5551
5552
  if (Bt.duration > 0 && Bt.from !== Bt.to) {
5552
5553
  const ee = this.currentTime - Bt.startTime, ue = Math.min(1, ee / Bt.duration), Te = this.applyEasing(ue, ((oe = n.settings) == null ? void 0 : oe.defaultEasing) || "easeOutCubic"), ae = Bt.from + (Bt.to - Bt.from) * Te;
5553
- this.setObjectProperty(s, e, ht, ae);
5554
+ this.setObjectProperty(s, e, ft, ae);
5554
5555
  }
5555
5556
  }
5556
5557
  } else if (n.type === U.SpringChain) {
@@ -5569,21 +5570,21 @@ class ci {
5569
5570
  }
5570
5571
  K.has(e.id) || K.set(e.id, { x: s.x, y: s.y, vx: 0, vy: 0 });
5571
5572
  }
5572
- const ht = K.get(e.id);
5573
- if (ht) {
5574
- ht.x = s.x, ht.y = s.y;
5573
+ const ft = K.get(e.id);
5574
+ if (ft) {
5575
+ ft.x = s.x, ft.y = s.y;
5575
5576
  for (const Tt of H) {
5576
5577
  const Lt = K.get(Tt.targetId);
5577
5578
  if (!Lt) continue;
5578
- const Bt = Lt.x - ht.x, ee = Lt.y - ht.y, ue = Math.sqrt(Bt * Bt + ee * ee) || 1e-3, ae = (ue - (Tt.restLength || 50)) * (Tt.stiffness || 0.8), be = Bt / ue * ae, Ue = ee / ue * ae;
5579
- ht.vx += be * t * 10, ht.vy += Ue * t * 10, Lt.vx -= be * t * 10, Lt.vy -= Ue * t * 10, ht.vx *= 1 - Q * t * 10, ht.vy *= 1 - Q * t * 10, Lt.vx *= 1 - Q * t * 10, Lt.vy *= 1 - Q * t * 10;
5579
+ const Bt = Lt.x - ft.x, ee = Lt.y - ft.y, ue = Math.sqrt(Bt * Bt + ee * ee) || 1e-3, ae = (ue - (Tt.restLength || 50)) * (Tt.stiffness || 0.8), be = Bt / ue * ae, Ue = ee / ue * ae;
5580
+ ft.vx += be * t * 10, ft.vy += Ue * t * 10, Lt.vx -= be * t * 10, Lt.vy -= Ue * t * 10, ft.vx *= 1 - Q * t * 10, ft.vy *= 1 - Q * t * 10, Lt.vx *= 1 - Q * t * 10, Lt.vy *= 1 - Q * t * 10;
5580
5581
  const pe = this.objectStates.get(Tt.targetId);
5581
5582
  pe && (pe.x += Lt.vx * t, pe.y += Lt.vy * t);
5582
5583
  }
5583
- s.x += ht.vx * t, s.y += ht.vy * t;
5584
+ s.x += ft.vx * t, s.y += ft.vy * t;
5584
5585
  }
5585
5586
  } else if (n.type === U.ParticleEmitter) {
5586
- const H = ((We = n.settings) == null ? void 0 : We.rate) || 10, Q = ((de = n.settings) == null ? void 0 : de.speed) || 100, K = ((ce = n.settings) == null ? void 0 : ce.size) || 5, ht = ((fe = n.settings) == null ? void 0 : fe.lifetime) || 2, Tt = ((ke = n.settings) == null ? void 0 : ke.gravity) || 0, Lt = ((Xe = n.settings) == null ? void 0 : Xe.color) || "#ffffff", Bt = ((Ve = n.settings) == null ? void 0 : Ve.maxParticles) || 200, ee = (Ne = n.settings) != null && Ne.rateInputId ? this.inputs.get(n.settings.rateInputId) ?? H : H, ue = (De = n.settings) != null && De.gravityInputId ? this.inputs.get(n.settings.gravityInputId) ?? Tt : Tt, Te = (He = n.settings) != null && He.speedInputId ? this.inputs.get(n.settings.speedInputId) ?? Q : Q;
5587
+ const H = ((We = n.settings) == null ? void 0 : We.rate) || 10, Q = ((de = n.settings) == null ? void 0 : de.speed) || 100, K = ((ce = n.settings) == null ? void 0 : ce.size) || 5, ft = ((he = n.settings) == null ? void 0 : he.lifetime) || 2, Tt = ((ke = n.settings) == null ? void 0 : ke.gravity) || 0, Lt = ((Xe = n.settings) == null ? void 0 : Xe.color) || "#ffffff", Bt = ((Ve = n.settings) == null ? void 0 : Ve.maxParticles) || 200, ee = (Ne = n.settings) != null && Ne.rateInputId ? this.inputs.get(n.settings.rateInputId) ?? H : H, ue = (De = n.settings) != null && De.gravityInputId ? this.inputs.get(n.settings.gravityInputId) ?? Tt : Tt, Te = (He = n.settings) != null && He.speedInputId ? this.inputs.get(n.settings.speedInputId) ?? Q : Q;
5587
5588
  this._emitterPools.has(e.id) || this._emitterPools.set(e.id, []);
5588
5589
  const ae = this._emitterPools.get(e.id);
5589
5590
  let be = 0;
@@ -5597,7 +5598,7 @@ class ci {
5597
5598
  vx: Math.cos(re) * ss,
5598
5599
  vy: Math.sin(re) * ss,
5599
5600
  life: 0,
5600
- maxLife: ht * (0.5 + Math.random() * 0.5),
5601
+ maxLife: ft * (0.5 + Math.random() * 0.5),
5601
5602
  size: K * (0.5 + Math.random()),
5602
5603
  color: Lt,
5603
5604
  opacity: 1
@@ -5611,88 +5612,88 @@ class ci {
5611
5612
  });
5612
5613
  });
5613
5614
  }
5614
- applyBehaviorSensor(t, i, o, e, s, n, a = 0, r = 0, f = 1) {
5615
+ applyBehaviorSensor(t, i, o, e, s, n, a = 0, r = 0, h = 1) {
5615
5616
  var d, u, v, b, m, y, S, C, w, M, I, k, T, L, P, _, E, A, W, z, Y, G, N, J;
5616
- const h = (s == null ? void 0 : s.intensity) || (s == null ? void 0 : s.strength) || 1, l = Math.min(1, 15 * e), p = f > 0 ? a / f : 0, c = f > 0 ? r / f : 0;
5617
+ const f = (s == null ? void 0 : s.intensity) || (s == null ? void 0 : s.strength) || 1, l = Math.min(1, 15 * e), p = h > 0 ? a / h : 0, c = h > 0 ? r / h : 0;
5617
5618
  switch (i) {
5618
5619
  case Zt.Scale: {
5619
- const x = ((d = n == null ? void 0 : n.transform) == null ? void 0 : d.scale_x) ?? 1, F = ((u = n == null ? void 0 : n.transform) == null ? void 0 : u.scale_y) ?? 1, j = x * (1 + o * h * 0.4), X = F * (1 + o * h * 0.4);
5620
+ const x = ((d = n == null ? void 0 : n.transform) == null ? void 0 : d.scale_x) ?? 1, F = ((u = n == null ? void 0 : n.transform) == null ? void 0 : u.scale_y) ?? 1, j = x * (1 + o * f * 0.4), X = F * (1 + o * f * 0.4);
5620
5621
  t.scale_x = (t.scale_x ?? x) * (1 - l) + j * l, t.scale_y = (t.scale_y ?? F) * (1 - l) + X * l;
5621
5622
  break;
5622
5623
  }
5623
5624
  case Zt.Opacity: {
5624
- const x = ((v = n == null ? void 0 : n.transform) == null ? void 0 : v.opacity) ?? 100, F = Math.max(0, Math.min(100, x - o * h * 100));
5625
+ const x = ((v = n == null ? void 0 : n.transform) == null ? void 0 : v.opacity) ?? 100, F = Math.max(0, Math.min(100, x - o * f * 100));
5625
5626
  t.opacity = (t.opacity ?? x) * (1 - l) + F * l;
5626
5627
  break;
5627
5628
  }
5628
5629
  case Zt.RotateZ: {
5629
- const x = ((b = n == null ? void 0 : n.transform) == null ? void 0 : b.rotation) ?? 0, F = x + o * h * 45;
5630
+ const x = ((b = n == null ? void 0 : n.transform) == null ? void 0 : b.rotation) ?? 0, F = x + o * f * 45;
5630
5631
  t.rotation = (t.rotation ?? x) * (1 - l) + F * l;
5631
5632
  break;
5632
5633
  }
5633
5634
  case Zt.RotateX: {
5634
- const x = ((m = n == null ? void 0 : n.transform) == null ? void 0 : m.rotate_x) ?? 0, F = x - c * o * h * 60;
5635
+ const x = ((m = n == null ? void 0 : n.transform) == null ? void 0 : m.rotate_x) ?? 0, F = x - c * o * f * 60;
5635
5636
  t.rotate_x = (t.rotate_x ?? x) * (1 - l) + F * l;
5636
5637
  break;
5637
5638
  }
5638
5639
  case Zt.RotateY: {
5639
- const x = ((y = n == null ? void 0 : n.transform) == null ? void 0 : y.rotate_y) ?? 0, F = x + p * o * h * 60;
5640
+ const x = ((y = n == null ? void 0 : n.transform) == null ? void 0 : y.rotate_y) ?? 0, F = x + p * o * f * 60;
5640
5641
  t.rotate_y = (t.rotate_y ?? x) * (1 - l) + F * l;
5641
5642
  break;
5642
5643
  }
5643
5644
  case Zt.PositionX: {
5644
- const x = ((S = n == null ? void 0 : n.transform) == null ? void 0 : S.x) ?? 0, F = x - p * o * h * 40;
5645
+ const x = ((S = n == null ? void 0 : n.transform) == null ? void 0 : S.x) ?? 0, F = x - p * o * f * 40;
5645
5646
  t.x = (t.x ?? x) * (1 - l) + F * l;
5646
5647
  break;
5647
5648
  }
5648
5649
  case Zt.PositionY: {
5649
- const x = ((C = n == null ? void 0 : n.transform) == null ? void 0 : C.y) ?? 0, F = x - c * o * h * 40;
5650
+ const x = ((C = n == null ? void 0 : n.transform) == null ? void 0 : C.y) ?? 0, F = x - c * o * f * 40;
5650
5651
  t.y = (t.y ?? x) * (1 - l) + F * l;
5651
5652
  break;
5652
5653
  }
5653
5654
  case Zt.SkewX: {
5654
- const x = ((w = n == null ? void 0 : n.transform) == null ? void 0 : w.skew_x) ?? 0, F = x + p * o * h * 45;
5655
+ const x = ((w = n == null ? void 0 : n.transform) == null ? void 0 : w.skew_x) ?? 0, F = x + p * o * f * 45;
5655
5656
  t.skew_x = (t.skew_x ?? x) * (1 - l) + F * l, t.skew_x > 85 && (t.skew_x = 85), t.skew_x < -85 && (t.skew_x = -85);
5656
5657
  break;
5657
5658
  }
5658
5659
  case Zt.Blur: {
5659
5660
  t.style || (t.style = { ...n == null ? void 0 : n.style }), t.style.blur || (t.style.blur = { ...(M = n == null ? void 0 : n.style) == null ? void 0 : M.blur });
5660
- const x = ((k = (I = n == null ? void 0 : n.style) == null ? void 0 : I.blur) == null ? void 0 : k.amount) || 0, F = x + o * ((s == null ? void 0 : s.blur) || 20) * h;
5661
+ const x = ((k = (I = n == null ? void 0 : n.style) == null ? void 0 : I.blur) == null ? void 0 : k.amount) || 0, F = x + o * ((s == null ? void 0 : s.blur) || 20) * f;
5661
5662
  t.style.blur.amount = (t.style.blur.amount ?? x) * (1 - l) + F * l;
5662
5663
  break;
5663
5664
  }
5664
5665
  case Zt.Exposure: {
5665
5666
  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 });
5666
- const x = ((P = (L = n == null ? void 0 : n.style) == null ? void 0 : L.adjustments) == null ? void 0 : P.exposure) || 0, F = x + o * ((s == null ? void 0 : s.exposure) || 50) * h;
5667
+ const x = ((P = (L = n == null ? void 0 : n.style) == null ? void 0 : L.adjustments) == null ? void 0 : P.exposure) || 0, F = x + o * ((s == null ? void 0 : s.exposure) || 50) * f;
5667
5668
  t.style.adjustments.exposure = (t.style.adjustments.exposure ?? x) * (1 - l) + F * l;
5668
5669
  break;
5669
5670
  }
5670
5671
  case Zt.HueShift: {
5671
5672
  t.style || (t.style = { ...n == null ? void 0 : n.style }), t.style.adjustments || (t.style.adjustments = { ...(_ = n == null ? void 0 : n.style) == null ? void 0 : _.adjustments });
5672
- const x = ((A = (E = n == null ? void 0 : n.style) == null ? void 0 : E.adjustments) == null ? void 0 : A.hue) || 0, F = x + o * ((s == null ? void 0 : s.hue) || 180) * h;
5673
+ const x = ((A = (E = n == null ? void 0 : n.style) == null ? void 0 : E.adjustments) == null ? void 0 : A.hue) || 0, F = x + o * ((s == null ? void 0 : s.hue) || 180) * f;
5673
5674
  t.style.adjustments.hue = (t.style.adjustments.hue ?? x) * (1 - l) + F * l;
5674
5675
  break;
5675
5676
  }
5676
5677
  case Zt.Negative: {
5677
5678
  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 });
5678
- const x = ((Y = (z = n == null ? void 0 : n.style) == null ? void 0 : z.adjustments) == null ? void 0 : Y.negative) || 0, F = x + o * ((s == null ? void 0 : s.negative) || 100) * h;
5679
+ const x = ((Y = (z = n == null ? void 0 : n.style) == null ? void 0 : z.adjustments) == null ? void 0 : Y.negative) || 0, F = x + o * ((s == null ? void 0 : s.negative) || 100) * f;
5679
5680
  t.style.adjustments.negative = (t.style.adjustments.negative ?? x) * (1 - l) + F * l;
5680
5681
  break;
5681
5682
  }
5682
5683
  case Zt.CornerRadius: {
5683
- const x = ((G = n == null ? void 0 : n.transform) == null ? void 0 : G.corner_radius) || 0, F = x + o * h * 50;
5684
+ const x = ((G = n == null ? void 0 : n.transform) == null ? void 0 : G.corner_radius) || 0, F = x + o * f * 50;
5684
5685
  t.corner_radius = (t.corner_radius ?? x) * (1 - l) + F * l;
5685
5686
  break;
5686
5687
  }
5687
5688
  case Zt.StrokeWidth: {
5688
5689
  t.style || (t.style = { ...n == null ? void 0 : n.style });
5689
- const x = ((N = n == null ? void 0 : n.style) == null ? void 0 : N.borderWidth) || 0, F = x + o * h * 10;
5690
+ const x = ((N = n == null ? void 0 : n.style) == null ? void 0 : N.borderWidth) || 0, F = x + o * f * 10;
5690
5691
  t.style.borderWidth = (t.style.borderWidth ?? x) * (1 - l) + F * l;
5691
5692
  break;
5692
5693
  }
5693
5694
  case Zt.LetterSpacing: {
5694
5695
  t.geometry || (t.geometry = {});
5695
- const x = ((J = n == null ? void 0 : n.geometry) == null ? void 0 : J.letterSpacing) || 0, F = x + o * h * 10;
5696
+ const x = ((J = n == null ? void 0 : n.geometry) == null ? void 0 : J.letterSpacing) || 0, F = x + o * f * 10;
5696
5697
  t.geometry.letterSpacing = (t.geometry.letterSpacing ?? x) * (1 - l) + F * l;
5697
5698
  break;
5698
5699
  }
@@ -5715,12 +5716,12 @@ class ci {
5715
5716
  const s = o.split(".");
5716
5717
  let n = t;
5717
5718
  for (let r = 0; r < s.length - 1; r++) {
5718
- const f = s[r];
5719
- if (n[f] === void 0 || n[f] === null) {
5720
- const h = i, l = s.slice(0, r + 1).reduce((p, c) => p == null ? void 0 : p[c], h);
5721
- n[f] = l !== void 0 ? { ...l } : {};
5719
+ const h = s[r];
5720
+ if (n[h] === void 0 || n[h] === null) {
5721
+ const f = i, l = s.slice(0, r + 1).reduce((p, c) => p == null ? void 0 : p[c], f);
5722
+ n[h] = l !== void 0 ? { ...l } : {};
5722
5723
  }
5723
- n = n[f];
5724
+ n = n[h];
5724
5725
  }
5725
5726
  const a = s[s.length - 1];
5726
5727
  n != null && (n[a] = e);
@@ -5768,9 +5769,9 @@ class ci {
5768
5769
  return o;
5769
5770
  }
5770
5771
  renderFittedImage(t, i, o, e, s, n, a = "cover") {
5771
- const r = i.naturalWidth, f = i.naturalHeight, h = r / f, l = s / n;
5772
+ const r = i.naturalWidth, h = i.naturalHeight, f = r / h, l = s / n;
5772
5773
  let p = s, c = n, d = o, u = e;
5773
- a === "cover" ? h > l ? (p = n * h, d = o - (p - s) / 2) : (c = s / h, u = e - (c - n) / 2) : a === "contain" && (h > l ? (c = s / h, u = e + (n - c) / 2) : (p = n * h, d = o + (s - p) / 2)), t.drawImage(i, d, u, p, c);
5774
+ a === "cover" ? f > l ? (p = n * f, d = o - (p - s) / 2) : (c = s / f, u = e - (c - n) / 2) : a === "contain" && (f > l ? (c = s / f, u = e + (n - c) / 2) : (p = n * f, d = o + (s - p) / 2)), t.drawImage(i, d, u, p, c);
5774
5775
  }
5775
5776
  }
5776
5777
  const yi = Ss(({
@@ -5783,8 +5784,8 @@ const yi = Ss(({
5783
5784
  onReady: n,
5784
5785
  onTrigger: a,
5785
5786
  onInputUpdate: r,
5786
- onComponentChange: f,
5787
- onToggle: h,
5787
+ onComponentChange: h,
5788
+ onToggle: f,
5788
5789
  onInputChange: l,
5789
5790
  onInputFocus: p,
5790
5791
  onInputBlur: c,
@@ -5812,8 +5813,8 @@ const yi = Ss(({
5812
5813
  E.current.setLayout(e, s);
5813
5814
  }, [e, s]), ve(() => {
5814
5815
  const R = E.current;
5815
- a && R.setTriggerCallback(a), r && R.setInputUpdateCallback((O, D) => r({ [O]: D })), f && R.setComponentChangeCallback((O) => f(O)), h && R.setToggleCallback(h), l && R.setInputChangeCallback(l), p && R.setInputFocusCallback(p), c && R.setInputBlurCallback(c), d && R.setOnLogCallback((O) => d(O, "info")), u && R.setLogicUpdateCallback(u), v && R.setButtonClickCallback(v), b && R.setGraphPointClickCallback((O) => b(O.objectId, O)), L && R.setNavigationCallback(L);
5816
- }, [a, r, f, h, l, p, c, d, u, v, b, L]), ve(() => {
5816
+ a && R.setTriggerCallback(a), r && R.setInputUpdateCallback((O, D) => r({ [O]: D })), h && R.setComponentChangeCallback((O) => h(O)), f && R.setToggleCallback(f), l && R.setInputChangeCallback(l), p && R.setInputFocusCallback(p), c && R.setInputBlurCallback(c), d && R.setOnLogCallback((O) => d(O, "info")), u && R.setLogicUpdateCallback(u), v && R.setButtonClickCallback(v), b && R.setGraphPointClickCallback((O) => b(O.objectId, O)), L && R.setNavigationCallback(L);
5817
+ }, [a, r, h, f, l, p, c, d, u, v, b, L]), ve(() => {
5817
5818
  (async () => {
5818
5819
  let O = g;
5819
5820
  if (t && !g)
@@ -6049,9 +6050,9 @@ function bi() {
6049
6050
  g == null || g.setInputStringArray(l, p);
6050
6051
  }, [g]), r = Me((l, p) => {
6051
6052
  g == null || g.updateObjectOptions(l, p);
6052
- }, [g]), f = Me((l, p, c) => {
6053
+ }, [g]), h = Me((l, p, c) => {
6053
6054
  g == null || g.updateConstraint(l, p, c);
6054
- }, [g]), h = Me((l, p) => {
6055
+ }, [g]), f = Me((l, p) => {
6055
6056
  g == null || g.updateGraphData(l, p);
6056
6057
  }, [g]);
6057
6058
  return {
@@ -6064,8 +6065,8 @@ function bi() {
6064
6065
  setInputText: s,
6065
6066
  setInputNumberArray: n,
6066
6067
  setInputStringArray: a,
6067
- updateConstraint: f,
6068
- updateGraphData: h,
6068
+ updateConstraint: h,
6069
+ updateGraphData: f,
6069
6070
  updateObjectOptions: r
6070
6071
  };
6071
6072
  }
@@ -6088,24 +6089,24 @@ const vi = ({ artboard: g, config: t }) => {
6088
6089
  l.length > 0 && (r = l[0].geometry.text);
6089
6090
  }
6090
6091
  r && (e("name", "description", r), e("property", "og:description", r)), i.keywords && i.keywords.length > 0 && e("name", "keywords", i.keywords.join(", "));
6091
- const f = i.ogImage || g.backgroundImage;
6092
- f && e("property", "og:image", f), a && e("property", "og:title", a), e("property", "og:type", "website");
6092
+ const h = i.ogImage || g.backgroundImage;
6093
+ h && e("property", "og:image", h), a && e("property", "og:title", a), e("property", "og:type", "website");
6093
6094
  }, [i, g, o]);
6094
- const e = (a, r, f) => {
6095
- let h = document.querySelector(`meta[${a}="${r}"]`);
6096
- h || (h = document.createElement("meta"), h.setAttribute(a, r), document.head.appendChild(h)), h.setAttribute("content", f);
6095
+ const e = (a, r, h) => {
6096
+ let f = document.querySelector(`meta[${a}="${r}"]`);
6097
+ f || (f = document.createElement("meta"), f.setAttribute(a, r), document.head.appendChild(f)), f.setAttribute("content", h);
6097
6098
  }, s = () => {
6098
6099
  const a = [];
6099
- return a.push(/* @__PURE__ */ ge("h1", { children: i.title || g.name }, "artboard-title")), g.objects.forEach((f, h) => {
6100
+ return a.push(/* @__PURE__ */ ge("h1", { children: i.title || g.name }, "artboard-title")), g.objects.forEach((h, f) => {
6100
6101
  var l, p;
6101
- if (!(f.visible === !1 || f.isVisible === !1))
6102
- if (((l = f.geometry) == null ? void 0 : l.type) === "Text") {
6103
- const c = f.geometry.text;
6104
- c && (f.geometry.fontSize > 24 ? a.push(/* @__PURE__ */ ge("h2", { children: c }, f.id || h)) : a.push(/* @__PURE__ */ ge("p", { children: c }, f.id || h)));
6105
- } else if (((p = f.geometry) == null ? void 0 : p.type) === "Image") {
6106
- const c = f.geometry.src, d = f.altText || f.name || "Illustration";
6107
- a.push(/* @__PURE__ */ ge("img", { src: c, alt: d }, f.id || h));
6108
- } else f.type === "Button" && a.push(/* @__PURE__ */ ge("button", { children: f.name || "Button" }, f.id || h));
6102
+ if (!(h.visible === !1 || h.isVisible === !1))
6103
+ if (((l = h.geometry) == null ? void 0 : l.type) === "Text") {
6104
+ const c = h.geometry.text;
6105
+ c && (h.geometry.fontSize > 24 ? a.push(/* @__PURE__ */ ge("h2", { children: c }, h.id || f)) : a.push(/* @__PURE__ */ ge("p", { children: c }, h.id || f)));
6106
+ } else if (((p = h.geometry) == null ? void 0 : p.type) === "Image") {
6107
+ const c = h.geometry.src, d = h.altText || h.name || "Illustration";
6108
+ a.push(/* @__PURE__ */ ge("img", { src: c, alt: d }, h.id || f));
6109
+ } else h.type === "Button" && a.push(/* @__PURE__ */ ge("button", { children: h.name || "Button" }, h.id || f));
6109
6110
  }), a;
6110
6111
  }, n = i.jsonLd || {
6111
6112
  "@context": "https://schema.org",
@@ -6138,9 +6139,9 @@ const vi = ({ artboard: g, config: t }) => {
6138
6139
  ]
6139
6140
  }
6140
6141
  );
6141
- }, fi = "6.3.36", hi = {
6142
- version: fi
6143
- }, Si = hi.version;
6142
+ }, hi = "6.3.38", fi = {
6143
+ version: hi
6144
+ }, Si = fi.version;
6144
6145
  export {
6145
6146
  Zt as BehaviorSensor,
6146
6147
  U as BehaviorType,