exodeui 6.3.36 → 6.3.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.js +17 -17
  2. package/dist/index.mjs +604 -591
  3. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -30,7 +30,7 @@ function Ps(g, t, i) {
30
30
  }
31
31
  const Ge = /* @__PURE__ */ new Map();
32
32
  function ps(g) {
33
- var M;
33
+ var I;
34
34
  const {
35
35
  text: t,
36
36
  fontFamily: i = "Inter",
@@ -135,7 +135,7 @@ function ps(g) {
135
135
  } finally {
136
136
  r !== 0 && m && (CanvasRenderingContext2D.prototype.measureText = m);
137
137
  }
138
- let w = (C == null ? void 0 : C.height) !== void 0 && C.height > 0 ? C.height : (((M = C == null ? void 0 : C.lines) == null ? void 0 : M.length) || 0) * S * o;
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
139
  if (f > 0 && C && C.lines && C.lines.length > 1) {
140
140
  let k = 0;
141
141
  const T = b.fullText || t;
@@ -144,12 +144,12 @@ function ps(g) {
144
144
  ` || T[k] === "\r") && (w += f, k++, T[k - 1] === "\r" && T[k] === `
145
145
  ` && k++);
146
146
  }
147
- let I = (C == null ? void 0 : C.lines) || [];
148
- return g.composer === "every-line" && I.length > 1 && (I = _s(I)), g.balanceRaggedLines === !0 && I.length > 1 && (I = Ps(I)), {
147
+ let M = (C == null ? void 0 : C.lines) || [];
148
+ return g.composer === "every-line" && M.length > 1 && (M = _s(M)), g.balanceRaggedLines === !0 && M.length > 1 && (M = Ps(M)), {
149
149
  width: a,
150
150
  height: w,
151
- lineCount: I.length,
152
- lines: I
151
+ lineCount: M.length,
152
+ lines: M
153
153
  };
154
154
  }
155
155
  function is(g, t, i) {
@@ -217,10 +217,10 @@ function Es(g, t, i) {
217
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
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);
219
219
  const C = [];
220
- let w = n.left, I = n.top;
221
- const M = a.toLowerCase(), k = M === "center" || M.endsWith("-center"), T = M.endsWith("-right"), L = M === "center" || M.startsWith("center-"), P = M.startsWith("bottom-");
220
+ let w = n.left, M = n.top;
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
- let W = w, z = I;
223
+ let W = w, z = M;
224
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) => {
225
225
  var F, j;
226
226
  let G = W, N = z;
@@ -233,7 +233,7 @@ function Es(g, t, i) {
233
233
  width: J && f ? A.width : void 0,
234
234
  height: x ? f ? void 0 : A.height : void 0
235
235
  }), f ? z += Y.h + s : W += Y.w + s;
236
- }), f ? w += A.width + s : I += A.height + s;
236
+ }), f ? 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) {
@@ -242,15 +242,15 @@ function As(g, t, i) {
242
242
  const { gridColumns: e, gridRows: s, columnGap: n = 0, rowGap: a = 0, padding: r, align: f } = o;
243
243
  let h = g.width, l = g.height;
244
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-");
245
- let I = 0, M = 0;
246
- y ? I = (p - v) / 2 : S && (I = p - v), C ? M = (c - b) / 2 : w && (M = c - b);
245
+ let M = 0, I = 0;
246
+ y ? M = (p - v) / 2 : S && (M = p - v), C ? I = (c - b) / 2 : w && (I = c - b);
247
247
  const k = [];
248
248
  return t.forEach((T, L) => {
249
249
  var j, X;
250
250
  const P = L % d.length || 0, _ = Math.floor(L / d.length) || 0;
251
251
  _ >= u.length && u.push(100);
252
252
  const E = d[P], A = u[_];
253
- let W = r.left + I + d.slice(0, P).reduce((tt, R) => tt + R + n, 0), z = r.top + M + u.slice(0, _).reduce((tt, R) => tt + R + a, 0);
253
+ let W = r.left + M + d.slice(0, P).reduce((tt, O) => tt + O + n, 0), z = r.top + I + u.slice(0, _).reduce((tt, O) => tt + O + a, 0);
254
254
  const Y = i(T.id), G = T.geometry;
255
255
  let N = (Y == null ? void 0 : Y.width) ?? G.width ?? 100, J = (Y == null ? void 0 : Y.height) ?? G.height ?? 100;
256
256
  if (G.type === "Ellipse" || G.type === "Polygon" || G.type === "Star") {
@@ -427,7 +427,7 @@ class xs {
427
427
  }
428
428
  }
429
429
  }
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) => {
430
+ const gs = (g) => g, Ls = (g) => g > 0 ? 1 : 0, Os = (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, Rs = (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
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) => {
@@ -460,7 +460,7 @@ const gs = (g) => g, Ls = (g) => g > 0 ? 1 : 0, Rs = (g) => g < 1 ? 0 : 1, os =
460
460
  EaseOutQuad: as,
461
461
  EaseInOutQuad: rs,
462
462
  // Cubic
463
- EaseInCubic: Os,
463
+ EaseInCubic: Rs,
464
464
  EaseOutCubic: Fs,
465
465
  EaseInOutCubic: $s,
466
466
  // Quartic
@@ -501,7 +501,7 @@ const gs = (g) => g, Ls = (g) => g > 0 ? 1 : 0, Rs = (g) => g < 1 ? 0 : 1, os =
501
501
  EaseInOut: rs,
502
502
  // Discrete
503
503
  StepStart: Ls,
504
- StepEnd: Rs
504
+ StepEnd: Os
505
505
  }, ri = (g) => {
506
506
  const t = g.trim(), i = t.toLowerCase();
507
507
  if (Ke[t]) return Ke[t];
@@ -575,8 +575,8 @@ const gs = (g) => g, Ls = (g) => g > 0 ? 1 : 0, Rs = (g) => g < 1 ? 0 : 1, os =
575
575
  const s = o.scale_x ?? 1, n = o.scale_y ?? 1, a = (r, f, h) => {
576
576
  let l = 0, p = 0;
577
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((M) => {
579
- const k = e(M.boneId);
578
+ h.forEach((I) => {
579
+ const k = e(I.boneId);
580
580
  if (!k) return;
581
581
  const T = {
582
582
  x: k.x,
@@ -584,40 +584,40 @@ const gs = (g) => g, Ls = (g) => g > 0 ? 1 : 0, Rs = (g) => g < 1 ? 0 : 1, os =
584
584
  rotation: k.rotation,
585
585
  scaleX: k.scale_x ?? 1,
586
586
  scaleY: k.scale_y ?? 1
587
- }, L = i[M.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
- l += z * M.amount, p += Y * M.amount;
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
+ l += z * I.amount, p += Y * I.amount;
589
589
  });
590
- const m = [...h].sort((M, k) => k.amount - M.amount);
590
+ const m = [...h].sort((I, k) => k.amount - I.amount);
591
591
  if (m.length >= 2 && m[0].amount > 0 && m[1].amount > 0) {
592
- const M = e(m[0].boneId), k = e(m[1].boneId);
593
- if (M && k && M.length !== void 0 && k.length !== void 0) {
594
- const T = M.length * (M.scale_y ?? 1), L = M.rotation * Math.PI / 180, P = M.x - T * Math.sin(L), _ = M.y + T * Math.cos(L), E = k.length * (k.scale_y ?? 1), A = k.rotation * Math.PI / 180, W = k.x - E * Math.sin(A), z = k.y + E * Math.cos(A);
592
+ const I = e(m[0].boneId), k = e(m[1].boneId);
593
+ if (I && k && I.length !== void 0 && k.length !== void 0) {
594
+ const T = I.length * (I.scale_y ?? 1), L = I.rotation * Math.PI / 180, P = I.x - T * Math.sin(L), _ = I.y + T * Math.cos(L), E = k.length * (k.scale_y ?? 1), A = k.rotation * Math.PI / 180, W = k.x - E * Math.sin(A), z = k.y + E * Math.cos(A);
595
595
  let Y = null, G = null, N = !1;
596
596
  const J = 1;
597
- if (Math.hypot(M.x - k.x, M.y - k.y) < J || Math.hypot(M.x - W, M.y - z) < J ? (Y = M.x, G = M.y) : (Math.hypot(P - k.x, _ - k.y) < J || Math.hypot(P - W, _ - z) < J) && (Y = P, G = _, N = !0), Y !== null && G !== null) {
597
+ if (Math.hypot(I.x - k.x, I.y - k.y) < J || Math.hypot(I.x - W, I.y - z) < J ? (Y = I.x, G = I.y) : (Math.hypot(P - k.x, _ - k.y) < J || Math.hypot(P - W, _ - z) < J) && (Y = P, G = _, N = !0), Y !== null && G !== null) {
598
598
  const x = i[m[0].boneId] || [1, 0, 0, 1, 0, 0], F = x[0] * x[3] - x[1] * x[2];
599
599
  let j = 0, X = 0;
600
600
  if (F !== 0) {
601
- const tt = (x[2] * x[5] - x[3] * x[4]) / F, R = (x[1] * x[4] - x[0] * x[5]) / F, O = Math.atan2(-x[1], x[3]);
601
+ const tt = (x[2] * x[5] - x[3] * x[4]) / F, O = (x[1] * x[4] - x[0] * x[5]) / F, R = Math.atan2(-x[1], x[3]);
602
602
  if (!N)
603
- j = tt, X = R;
603
+ j = tt, X = O;
604
604
  else {
605
- const ot = -x[2] / F, yt = x[0] / F, bt = Math.hypot(ot, yt), gt = M.length * bt;
606
- j = tt - gt * Math.sin(O), X = R + gt * Math.cos(O);
605
+ const ot = -x[2] / F, yt = x[0] / F, bt = Math.hypot(ot, yt), gt = I.length * bt;
606
+ j = tt - gt * Math.sin(R), X = O + gt * Math.cos(R);
607
607
  }
608
608
  const D = Math.hypot(v - j, b - X), q = Math.hypot(l - Y, p - G);
609
609
  if (q > 0 && D > 0) {
610
- const ot = Math.max(q, 0.01), yt = Math.min(D / ot, 3), bt = Y + (l - Y) * yt, gt = G + (p - G) * yt, Pt = m[0].amount, It = m[1].amount, St = Math.min(Pt, It) * 2, Xt = 1 - Math.pow(1 - St, 4);
610
+ const ot = Math.max(q, 0.01), yt = Math.min(D / ot, 3), bt = Y + (l - Y) * yt, gt = G + (p - G) * yt, Et = m[0].amount, It = m[1].amount, St = Math.min(Et, It) * 2, Xt = 1 - Math.pow(1 - St, 4);
611
611
  l = l * (1 - Xt) + bt * Xt, p = p * (1 - Xt) + gt * Xt;
612
612
  }
613
613
  }
614
614
  }
615
615
  }
616
616
  }
617
- const y = o.rotation * Math.PI / 180, S = Math.cos(y), C = Math.sin(y), w = l - o.x, I = p - o.y;
617
+ const y = o.rotation * Math.PI / 180, S = Math.cos(y), C = Math.sin(y), w = l - o.x, M = p - o.y;
618
618
  return {
619
- x: (w * S + I * C) / s,
620
- y: (-w * C + I * S) / n
619
+ x: (w * S + M * C) / s,
620
+ y: (-w * C + M * S) / n
621
621
  };
622
622
  };
623
623
  return g.map((r, f) => {
@@ -944,8 +944,8 @@ class ci {
944
944
  for (; b < d.length; ) {
945
945
  const S = y(), C = y(), w = y();
946
946
  if (e.length > 0) {
947
- const I = e[e.length - 1];
948
- I.out_x = S.x, I.out_y = S.y;
947
+ const M = e[e.length - 1];
948
+ M.out_x = S.x, M.out_y = S.y;
949
949
  }
950
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;
951
951
  }
@@ -954,8 +954,8 @@ class ci {
954
954
  for (; b < d.length; ) {
955
955
  const S = { x: 2 * n - r, y: 2 * a - f }, C = y(), w = y();
956
956
  if (e.length > 0) {
957
- const I = e[e.length - 1];
958
- I.out_x = S.x, I.out_y = S.y;
957
+ const M = e[e.length - 1];
958
+ M.out_x = S.x, M.out_y = S.y;
959
959
  }
960
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;
961
961
  }
@@ -1567,9 +1567,9 @@ class ci {
1567
1567
  else {
1568
1568
  const S = b.split(".");
1569
1569
  let C = m;
1570
- for (let I = 0; I < S.length - 1; I++) {
1571
- const M = S[I];
1572
- C[M] === void 0 && (C[M] = {}), C = C[M];
1570
+ for (let M = 0; M < S.length - 1; M++) {
1571
+ const I = S[M];
1572
+ C[I] === void 0 && (C[I] = {}), C = C[I];
1573
1573
  }
1574
1574
  const w = S[S.length - 1];
1575
1575
  C[w] = v, d = v;
@@ -1715,16 +1715,16 @@ class ci {
1715
1715
  this._springChainState.has(m.id) || this._springChainState.set(m.id, /* @__PURE__ */ new Map());
1716
1716
  const w = this._springChainState.get(m.id);
1717
1717
  if (!w.has(u)) {
1718
- const M = this.objectStates.get(u);
1718
+ const I = this.objectStates.get(u);
1719
1719
  w.set(u, {
1720
- x: (M == null ? void 0 : M.x) ?? 0,
1721
- y: (M == null ? void 0 : M.y) ?? 0,
1720
+ x: (I == null ? void 0 : I.x) ?? 0,
1721
+ y: (I == null ? void 0 : I.y) ?? 0,
1722
1722
  vx: 0,
1723
1723
  vy: 0
1724
1724
  });
1725
1725
  }
1726
- const I = w.get(u);
1727
- I && (I.vx += v, I.vy += b);
1726
+ const M = w.get(u);
1727
+ M && (M.vx += v, M.vy += b);
1728
1728
  }
1729
1729
  });
1730
1730
  })), d = 1;
@@ -1910,12 +1910,12 @@ class ci {
1910
1910
  if (r.type === "Translation") {
1911
1911
  const y = this.getGlobalTransform(r.targetId);
1912
1912
  if (y) {
1913
- const S = r.offsetX || 0, C = r.offsetY || 0, w = y.x + S, I = y.y + C, M = r.useSpring;
1914
- if (M) {
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, I, r, t);
1913
+ const S = r.offsetX || 0, C = r.offsetY || 0, w = y.x + S, M = y.y + C, I = r.useSpring;
1914
+ if (I) {
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
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 });
1917
1917
  } else
1918
- r.copyX && (e.x = e.x + (w - e.x) * f), r.copyY && (e.y = e.y + (I - e.y) * f);
1918
+ r.copyX && (e.x = e.x + (w - e.x) * f), r.copyY && (e.y = e.y + (M - e.y) * f);
1919
1919
  let k = !1;
1920
1920
  if ((l = r.limitX) != null && l.enabled) {
1921
1921
  const T = e.x;
@@ -1925,7 +1925,7 @@ class ci {
1925
1925
  const T = e.y;
1926
1926
  e.y = Math.max(r.limitY.min, Math.min(r.limitY.max, e.y)), e.y !== T && (k = !0);
1927
1927
  }
1928
- k && M && this.objectVelocities.set(i.id, { vx: 0, vy: 0 });
1928
+ k && I && this.objectVelocities.set(i.id, { vx: 0, vy: 0 });
1929
1929
  }
1930
1930
  } else if (r.type === "Rotation") {
1931
1931
  const y = this.getGlobalTransform(r.targetId);
@@ -1946,41 +1946,41 @@ class ci {
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;
1948
1948
  if (C) {
1949
- const I = this.objectVelocities.get(i.id) || { vx: 0, vy: 0 }, { x: M, y: k, vx: T, vy: L } = this.computeSpring(e.x, e.y, I.vx, I.vy, y, S, r, t);
1950
- e.x = M, e.y = k, this.objectVelocities.set(i.id, { vx: T, vy: L });
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
+ e.x = I, e.y = k, this.objectVelocities.set(i.id, { vx: T, vy: L });
1951
1951
  } else
1952
1952
  e.x = e.x + (y - e.x) * f, e.y = e.y + (S - e.y) * f;
1953
1953
  let w = !1;
1954
1954
  if ((u = r.limitX) != null && u.enabled) {
1955
- const I = e.x;
1956
- e.x = Math.max(r.limitX.min, Math.min(r.limitX.max, e.x)), e.x !== I && (w = !0);
1955
+ const M = e.x;
1956
+ e.x = Math.max(r.limitX.min, Math.min(r.limitX.max, e.x)), e.x !== M && (w = !0);
1957
1957
  }
1958
1958
  if ((v = r.limitY) != null && v.enabled) {
1959
- const I = e.y;
1960
- e.y = Math.max(r.limitY.min, Math.min(r.limitY.max, e.y)), e.y !== I && (w = !0);
1959
+ const M = e.y;
1960
+ e.y = Math.max(r.limitY.min, Math.min(r.limitY.max, e.y)), e.y !== M && (w = !0);
1961
1961
  }
1962
1962
  w && C && this.objectVelocities.set(i.id, { vx: 0, vy: 0 });
1963
1963
  } else if (r.type === "Distance") {
1964
1964
  const y = this.getGlobalTransform(r.targetId);
1965
1965
  if (y) {
1966
- const S = e.x - y.x, C = e.y - y.y, w = Math.sqrt(S * S + C * C), I = r.distance || 0;
1967
- let M = w;
1966
+ const S = e.x - y.x, C = e.y - y.y, w = Math.sqrt(S * S + C * C), M = r.distance || 0;
1967
+ let I = w;
1968
1968
  switch (r.mode) {
1969
1969
  case "exact":
1970
- M = I;
1970
+ I = M;
1971
1971
  break;
1972
1972
  case "minimum":
1973
- M = Math.max(I, w);
1973
+ I = Math.max(M, w);
1974
1974
  break;
1975
1975
  case "maximum":
1976
- M = Math.min(I, w);
1976
+ I = Math.min(M, w);
1977
1977
  break;
1978
1978
  case "clamped":
1979
- M = Math.max(0, Math.min(I, w));
1979
+ I = Math.max(0, Math.min(M, w));
1980
1980
  break;
1981
1981
  }
1982
1982
  if (w > 0) {
1983
- const k = e.x === y.x && e.y === y.y ? 1 : M / w;
1983
+ const k = e.x === y.x && e.y === y.y ? 1 : I / w;
1984
1984
  e.x = e.x + (y.x + S * k - e.x) * f, e.y = e.y + (y.y + C * k - e.y) * f;
1985
1985
  }
1986
1986
  }
@@ -1997,7 +1997,7 @@ class ci {
1997
1997
  F && (C = F.geometry);
1998
1998
  }
1999
1999
  if (!C) return;
2000
- const w = (r.distance || 0) / 100, I = S.width || C.width || 0, M = S.height || C.height || 0, k = this.getPointOnPath(C, I, M, w), T = S.rotation * Math.PI / 180, L = Math.cos(T), P = Math.sin(T), _ = k.x * S.scale_x * L - k.y * S.scale_y * P, E = k.x * S.scale_x * P + k.y * S.scale_y * L;
2000
+ const w = (r.distance || 0) / 100, M = S.width || C.width || 0, I = S.height || C.height || 0, k = this.getPointOnPath(C, M, I, w), T = S.rotation * Math.PI / 180, L = Math.cos(T), P = Math.sin(T), _ = k.x * S.scale_x * L - k.y * S.scale_y * P, E = k.x * S.scale_x * P + k.y * S.scale_y * L;
2001
2001
  let A = S.rotation + (r.offsetRotation || 0);
2002
2002
  if (r.orient) {
2003
2003
  const F = Math.cos(k.angle), j = Math.sin(k.angle), X = F * S.scale_x * L - j * S.scale_y * P, tt = F * S.scale_x * P + j * S.scale_y * L;
@@ -2076,10 +2076,10 @@ class ci {
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);
2077
2077
  if (y > 1e-3 && S > 1e-3) {
2078
2078
  const C = Math.atan2(v, u);
2079
- let I = (Math.atan2(m, b) - C) * 180 / Math.PI;
2080
- I *= e;
2081
- const M = this.objectStates.get(c.id);
2082
- M && (M.rotation += I);
2079
+ let M = (Math.atan2(m, b) - C) * 180 / Math.PI;
2080
+ M *= e;
2081
+ const I = this.objectStates.get(c.id);
2082
+ I && (I.rotation += M);
2083
2083
  }
2084
2084
  }
2085
2085
  }
@@ -2156,9 +2156,9 @@ class ci {
2156
2156
  })) : t === "blur" && this.activeHoverIds.clear(), this.activeDropdownId && t === "down") {
2157
2157
  const c = this.artboard.objects.find((d) => d.id === this.activeDropdownId);
2158
2158
  if (c && (c.type === "Dropdown" || c.variant === "dropdown")) {
2159
- const d = this.objectStates.get(c.id), u = (d == null ? void 0 : d.options) || c.options || {}, v = c.geometry || {}, b = v.width ?? c.width ?? 200, m = v.height ?? c.height ?? 40, y = u.optionsList || [], S = u.itemHeight || 32, C = u.listPadding ?? 4, w = y.length * S + C * 2, I = this.getWorldTransform(c.id), M = b * Math.abs(I.scaleX), k = m * Math.abs(I.scaleY), T = I.y + k / 2 + 4, L = Math.abs(i - I.x) <= M / 2, P = o >= T && o <= T + w * Math.abs(I.scaleY);
2159
+ const d = this.objectStates.get(c.id), u = (d == null ? void 0 : d.options) || c.options || {}, v = c.geometry || {}, b = v.width ?? c.width ?? 200, m = v.height ?? c.height ?? 40, y = u.optionsList || [], S = u.itemHeight || 32, C = u.listPadding ?? 4, w = y.length * S + C * 2, M = this.getWorldTransform(c.id), I = b * Math.abs(M.scaleX), k = m * Math.abs(M.scaleY), T = M.y + k / 2 + 4, L = Math.abs(i - M.x) <= I / 2, P = o >= T && o <= T + w * Math.abs(M.scaleY);
2160
2160
  if (L && P) {
2161
- const _ = Math.abs(I.scaleY), E = o - (T + C * _), A = Math.floor(E / (S * _));
2161
+ const _ = Math.abs(M.scaleY), E = o - (T + C * _), A = Math.floor(E / (S * _));
2162
2162
  if (A >= 0 && A < y.length) {
2163
2163
  const W = y[A];
2164
2164
  u.selectedOption = W, u.isOpen = !1, this.activeDropdownId = null, c.inputId && this.setInternalInput(c.inputId, W), this.onComponentChange && this.onComponentChange({
@@ -2274,7 +2274,7 @@ class ci {
2274
2274
  }
2275
2275
  }
2276
2276
  if (c.type === "LineGraph" && (t === "down" || t === "click")) {
2277
- const v = c.geometry, b = (v == null ? void 0 : v.datasets) || [], m = this.objectStates.get(c.id), y = (m == null ? void 0 : m.width) || (v == null ? void 0 : v.width) || 200, S = (m == null ? void 0 : m.height) || (v == null ? void 0 : v.height) || 150, C = this.getWorldTransform(c.id), w = 30, I = 20, M = y - w, k = S - I;
2277
+ const v = c.geometry, b = (v == null ? void 0 : v.datasets) || [], m = this.objectStates.get(c.id), y = (m == null ? void 0 : m.width) || (v == null ? void 0 : v.width) || 200, S = (m == null ? void 0 : m.height) || (v == null ? void 0 : v.height) || 150, C = this.getWorldTransform(c.id), w = 30, M = 20, I = y - w, k = S - M;
2278
2278
  let T = 1;
2279
2279
  b.forEach((_) => {
2280
2280
  const E = Math.max(..._.data || [0]);
@@ -2282,9 +2282,9 @@ class ci {
2282
2282
  });
2283
2283
  let L = 1 / 0, P = null;
2284
2284
  b.forEach((_, E) => {
2285
- const A = _.data || [], W = M / Math.max(A.length - 1, 1);
2285
+ const A = _.data || [], W = I / Math.max(A.length - 1, 1);
2286
2286
  A.forEach((z, Y) => {
2287
- const G = C.x - y / 2 + w + Y * W, N = C.y + S / 2 - I - z / T * k, J = Math.sqrt((i - G) ** 2 + (o - N) ** 2);
2287
+ const G = C.x - y / 2 + w + Y * W, N = C.y + S / 2 - M - z / T * k, J = Math.sqrt((i - G) ** 2 + (o - N) ** 2);
2288
2288
  J < L && (L = J, P = { dIdx: E, pIdx: Y, val: z, label: _.label || `Dataset ${E + 1}` });
2289
2289
  });
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 });
@@ -2504,10 +2504,10 @@ class ci {
2504
2504
  return Math.abs(c) <= b / 2 && Math.abs(d) <= m / 2;
2505
2505
  }
2506
2506
  updateSliderValueFromPointer(t, i, o) {
2507
- var I;
2507
+ var M;
2508
2508
  const e = this.objectStates.get(t.id);
2509
2509
  if (!e) return;
2510
- const s = t.options || {}, n = ((I = t.geometry) == null ? void 0 : I.width) ?? t.width ?? 200, a = this.getWorldTransform(t.id), r = i - a.x, 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, 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;
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;
@@ -2523,10 +2523,10 @@ class ci {
2523
2523
  }));
2524
2524
  }
2525
2525
  updateJoystickValueFromPointer(t, i, o) {
2526
- var I, M;
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 : ((I = t.geometry) == null ? void 0 : I.width) ?? t.width ?? 100, n = (e == null ? void 0 : e.height) !== void 0 ? e.height : ((M = t.geometry) == null ? void 0 : M.height) ?? t.height ?? 100, a = this.getWorldTransform(t.id), r = i - a.x, f = o - a.y, h = -a.rotation * (Math.PI / 180), l = Math.cos(h), p = Math.sin(h);
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
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));
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;
@@ -2569,20 +2569,20 @@ class ci {
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) {
2572
- const w = l.sourceMin ?? -1, I = l.sourceMax ?? 1, M = l.targetMin ?? 0, k = l.targetMax ?? 100;
2572
+ const w = l.sourceMin ?? -1, M = l.sourceMax ?? 1, I = l.targetMin ?? 0, k = l.targetMax ?? 100;
2573
2573
  let T = !!l.isContinuous, L = 0, P = 0;
2574
2574
  if (T) {
2575
- if ((l.sourceAxis === "x" || l.sourceAxis === "y") && M >= 0) {
2576
- const E = Math.max(Math.abs(w), Math.abs(I)) || 1;
2575
+ if ((l.sourceAxis === "x" || l.sourceAxis === "y") && I >= 0) {
2576
+ const E = Math.max(Math.abs(w), Math.abs(M)) || 1;
2577
2577
  P = p / E * k;
2578
2578
  } else {
2579
- let E = (p - w) / (I - w);
2580
- E = Math.max(0, Math.min(1, E)), P = M + E * (k - M);
2579
+ let E = (p - w) / (M - w);
2580
+ E = Math.max(0, Math.min(1, E)), P = I + E * (k - I);
2581
2581
  }
2582
2582
  Math.abs(p) < 0.05 && (P = 0);
2583
2583
  } else {
2584
- const E = (p - w) / (I - w), A = Math.max(0, Math.min(1, E));
2585
- L = M + A * (k - M), l.step && l.step > 0 && (L = Math.round(L / l.step) * l.step);
2584
+ const E = (p - w) / (M - w), A = Math.max(0, Math.min(1, E));
2585
+ L = I + A * (k - I), l.step && l.step > 0 && (L = Math.round(L / l.step) * l.step);
2586
2586
  }
2587
2587
  const _ = this.objectStates.get(c.id);
2588
2588
  if (_) {
@@ -2590,8 +2590,8 @@ class ci {
2590
2590
  let X = L;
2591
2591
  if (T) {
2592
2592
  const tt = `_internal_${F}_${l.id}`;
2593
- let R = _[tt];
2594
- R === void 0 && (R = _[F] ?? j), X = R + P * J, _[tt] = X, l.step && l.step > 0 && (X = Math.round(X / l.step) * l.step);
2593
+ let O = _[tt];
2594
+ O === void 0 && (O = _[F] ?? j), X = O + P * J, _[tt] = X, l.step && l.step > 0 && (X = Math.round(X / l.step) * l.step);
2595
2595
  } else
2596
2596
  X = j + L;
2597
2597
  _[F] = X;
@@ -2601,11 +2601,11 @@ class ci {
2601
2601
  (C = c.physics) != null && C.enabled && this.physicsEngine && (l.targetProperty === "x" || l.targetProperty === "transform.x" || l.targetProperty === "y" || l.targetProperty === "transform.y") && (l.targetProperty === "x" || l.targetProperty === "transform.x" ? this.physicsEngine.applyForce(c.id, (L - ((_ == null ? void 0 : _.x) || 0)) * 10, 0) : (l.targetProperty === "y" || l.targetProperty === "transform.y") && this.physicsEngine.applyForce(c.id, 0, (L - ((_ == null ? void 0 : _.y) || 0)) * 10));
2602
2602
  } else if (l.actionType === "playAnimation" || l.actionType === "stopAnimation" || l.actionType === "pauseAnimation") {
2603
2603
  let w = !1;
2604
- const I = l.threshold ?? 0;
2605
- l.condition === "always" ? w = !0 : l.condition === ">" ? w = p > I : l.condition === "<" ? w = p < I : l.condition === "==" && (w = Math.abs(p - I) < 0.01);
2606
- const M = e[`_prev_src_${l.id}`] ?? p;
2604
+ const M = l.threshold ?? 0;
2605
+ l.condition === "always" ? w = !0 : l.condition === ">" ? w = p > M : l.condition === "<" ? w = p < M : l.condition === "==" && (w = Math.abs(p - M) < 0.01);
2606
+ const I = e[`_prev_src_${l.id}`] ?? p;
2607
2607
  let k = !1;
2608
- l.condition === "always" ? k = !0 : l.condition === ">" ? k = M > I : l.condition === "<" ? k = M < I : l.condition === "==" && (k = Math.abs(M - I) < 0.01), e[`_prev_src_${l.id}`] = p, w && !k && l.targetAnimationId && (l.actionType === "playAnimation" || l.actionType);
2608
+ l.condition === "always" ? k = !0 : l.condition === ">" ? k = I > M : l.condition === "<" ? k = I < M : l.condition === "==" && (k = Math.abs(I - M) < 0.01), e[`_prev_src_${l.id}`] = p, w && !k && l.targetAnimationId && (l.actionType === "playAnimation" || l.actionType);
2609
2609
  }
2610
2610
  }
2611
2611
  });
@@ -2632,24 +2632,24 @@ class ci {
2632
2632
  const y = (p = (l = this.artboard) == null ? void 0 : l.animations) == null ? void 0 : p.find((S) => S.id === b[m].animationId);
2633
2633
  y && (s.push({ anim: y, weight: 1 }), n = 1);
2634
2634
  } else {
2635
- const y = b[m].position[0], S = b[m + 1].position[0], C = (d = (c = this.artboard) == null ? void 0 : c.animations) == null ? void 0 : d.find((T) => T.id === b[m].animationId), w = (v = (u = this.artboard) == null ? void 0 : u.animations) == null ? void 0 : v.find((T) => T.id === b[m + 1].animationId), I = Math.max(1e-3, S - y);
2636
- let M = (o - y) / I;
2637
- M = Math.max(0, Math.min(1, M));
2638
- const k = 1 - M;
2639
- C && (s.push({ anim: C, weight: k }), n += k), w && (s.push({ anim: w, weight: M }), n += M);
2635
+ const y = b[m].position[0], S = b[m + 1].position[0], C = (d = (c = this.artboard) == null ? void 0 : c.animations) == null ? void 0 : d.find((T) => T.id === b[m].animationId), w = (v = (u = this.artboard) == null ? void 0 : u.animations) == null ? void 0 : v.find((T) => T.id === b[m + 1].animationId), M = Math.max(1e-3, S - y);
2636
+ let I = (o - y) / M;
2637
+ I = Math.max(0, Math.min(1, I));
2638
+ const k = 1 - I;
2639
+ C && (s.push({ anim: C, weight: k }), n += k), w && (s.push({ anim: w, weight: I }), n += I);
2640
2640
  }
2641
2641
  }
2642
2642
  } else
2643
2643
  t.blendAnimations.forEach((b) => {
2644
- var w, I;
2645
- const m = (I = (w = this.artboard) == null ? void 0 : w.animations) == null ? void 0 : I.find((M) => M.id === b.animationId);
2644
+ var w, M;
2645
+ const m = (M = (w = this.artboard) == null ? void 0 : w.animations) == null ? void 0 : M.find((I) => I.id === b.animationId);
2646
2646
  if (!m) return;
2647
2647
  const y = b.position[0] - o, S = b.position[1] - e, C = y * y + S * S;
2648
2648
  if (C < 1e-4)
2649
2649
  s.push({ anim: m, weight: 1e4 }), n += 1e4;
2650
2650
  else {
2651
- const M = 1 / C;
2652
- s.push({ anim: m, weight: M }), n += M;
2651
+ const I = 1 / C;
2652
+ s.push({ anim: m, weight: I }), n += I;
2653
2653
  }
2654
2654
  });
2655
2655
  if (n === 0) return;
@@ -2663,38 +2663,38 @@ class ci {
2663
2663
  var L, P;
2664
2664
  const S = y.object_id || y.objectId, C = y.property, w = (L = this.artboard) == null ? void 0 : L.objects.find((_) => _.id === S);
2665
2665
  if (((P = w == null ? void 0 : w.physics) == null ? void 0 : P.enabled) && w.physics.bodyType !== "Static" && (C === "x" || C === "y" || C === "rotation")) return;
2666
- const M = this.interpolate(y.keyframes, i);
2667
- if (M === void 0) return;
2666
+ const I = this.interpolate(y.keyframes, i);
2667
+ if (I === void 0) return;
2668
2668
  let k = a.get(S);
2669
2669
  k || (k = /* @__PURE__ */ new Map(), a.set(S, k));
2670
2670
  let T = k.get(C);
2671
2671
  if (!T) {
2672
- if (typeof M == "number")
2672
+ if (typeof I == "number")
2673
2673
  T = { type: "number", value: 0 };
2674
- else if (typeof M == "string" && M.startsWith("#"))
2675
- T = { type: "color", value: M, colorAcc: { r: 0, g: 0, b: 0, a: 0 } };
2676
- else if (T = { type: "number", value: M }, m < 0.5) return;
2674
+ else if (typeof I == "string" && I.startsWith("#"))
2675
+ T = { type: "color", value: I, colorAcc: { r: 0, g: 0, b: 0, a: 0 } };
2676
+ else if (T = { type: "number", value: I }, m < 0.5) return;
2677
2677
  k.set(C, T);
2678
2678
  }
2679
- if (T.type === "number" && typeof M == "number")
2680
- T.value += M * m;
2681
- else if (T.type === "color" && typeof M == "string" && T.colorAcc) {
2682
- const _ = r(M);
2679
+ if (T.type === "number" && typeof I == "number")
2680
+ T.value += I * m;
2681
+ else if (T.type === "color" && typeof I == "string" && T.colorAcc) {
2682
+ const _ = r(I);
2683
2683
  _ && (T.colorAcc.r += _.r * m, T.colorAcc.g += _.g * m, T.colorAcc.b += _.b * m, T.colorAcc.a += _.a * m);
2684
2684
  } else
2685
- m > 0.5 && (T.value = M);
2685
+ m > 0.5 && (T.value = I);
2686
2686
  });
2687
2687
  }), a.forEach((b, m) => {
2688
2688
  var C;
2689
2689
  const y = this.objectStates.get(m), S = (C = this.artboard) == null ? void 0 : C.objects.find((w) => w.id === m);
2690
- !y || !S || b.forEach((w, I) => {
2691
- let M = w.value;
2690
+ !y || !S || b.forEach((w, M) => {
2691
+ let I = w.value;
2692
2692
  if (w.type === "color" && w.colorAcc) {
2693
2693
  const k = Math.round(w.colorAcc.r).toString(16).padStart(2, "0"), T = Math.round(w.colorAcc.g).toString(16).padStart(2, "0"), L = Math.round(w.colorAcc.b).toString(16).padStart(2, "0");
2694
- M = `#${k}${T}${L}`;
2694
+ I = `#${k}${T}${L}`;
2695
2695
  }
2696
- if (I.includes(".")) {
2697
- const k = (I || "").split(".");
2696
+ if (M.includes(".")) {
2697
+ const k = (M || "").split(".");
2698
2698
  let T = y;
2699
2699
  for (let L = 0; L < k.length - 1; L++) {
2700
2700
  if (typeof T[k[L]] != "object" || T[k[L]] === null) {
@@ -2709,9 +2709,9 @@ class ci {
2709
2709
  }
2710
2710
  T = T[k[L]];
2711
2711
  }
2712
- T[k[k.length - 1]] = M, k[k.length - 1] === "color" && (k[k.length - 2] === "fill" || k[k.length - 2] === "stroke") && (T.type = "Solid");
2712
+ T[k[k.length - 1]] = I, k[k.length - 1] === "color" && (k[k.length - 2] === "fill" || k[k.length - 2] === "stroke") && (T.type = "Solid");
2713
2713
  } else
2714
- I === "fill" ? (y.style || (y.style = {}), y.style.fill = M) : I === "stroke" ? (y.style || (y.style = {}), y.style.stroke = M) : y[I] = M;
2714
+ M === "fill" ? (y.style || (y.style = {}), y.style.fill = I) : M === "stroke" ? (y.style || (y.style = {}), y.style.stroke = I) : y[M] = I;
2715
2715
  });
2716
2716
  });
2717
2717
  }
@@ -2950,20 +2950,20 @@ class ci {
2950
2950
  }
2951
2951
  */
2952
2952
  renderObject(t, i, o) {
2953
- var u, v, b, m, y, S, C, w, I, M, k, T, L, P, _, E, A, W, z, Y, G, N, J, x, F, j;
2953
+ var 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;
2954
2954
  const e = this.objectStates.get(i.id);
2955
2955
  if (!e) {
2956
2956
  this.warn("No state for object:", i.id);
2957
2957
  return;
2958
2958
  }
2959
- this.frameCount % 60, t.roundRect || (t.roundRect = (X, tt, R, O, D) => (this.drawRoundRect(t, X, tt, R, O, D), t));
2959
+ this.frameCount % 60, t.roundRect || (t.roundRect = (X, tt, O, R, D) => (this.drawRoundRect(t, X, tt, O, R, D), t));
2960
2960
  const s = e.geometry ? this.deepMerge(i.geometry, e.geometry) : i.geometry;
2961
2961
  let n = e.style ? this.deepMerge(i.style, e.style) : i.style, a = (s == null ? void 0 : s.width) || ((u = i.geometry) == null ? void 0 : u.width) || i.width || 0, r = (s == null ? void 0 : s.height) || ((v = i.geometry) == null ? void 0 : v.height) || i.height || 0;
2962
2962
  if ((a === 0 || r === 0) && (s != null && s.points) && Array.isArray(s.points) && s.points.length > 0) {
2963
- let X = 1 / 0, tt = -1 / 0, R = 1 / 0, O = -1 / 0;
2963
+ let X = 1 / 0, tt = -1 / 0, O = 1 / 0, R = -1 / 0;
2964
2964
  s.points.forEach((D) => {
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
- }), a === 0 && (a = tt - X), r === 0 && (r = O - R);
2965
+ X = Math.min(X, D.x), tt = Math.max(tt, D.x), O = Math.min(O, D.y), R = Math.max(R, D.y);
2966
+ }), a === 0 && (a = tt - X), r === 0 && (r = R - O);
2967
2967
  }
2968
2968
  const f = (X) => {
2969
2969
  if (X)
@@ -2978,7 +2978,7 @@ class ci {
2978
2978
  i.weights,
2979
2979
  i.bindMatrices,
2980
2980
  X,
2981
- (R) => this.getGlobalTransform(R)
2981
+ (O) => this.getGlobalTransform(O)
2982
2982
  );
2983
2983
  l = { ...l, points: tt };
2984
2984
  }
@@ -2987,34 +2987,34 @@ class ci {
2987
2987
  return;
2988
2988
  const p = i.repeaterConfig, c = p && p.isEnabled && p.count > 1, d = c ? p.count : 1;
2989
2989
  for (let X = 0; X < d; X++) {
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;
2990
+ let tt = e.x !== void 0 ? e.x : ((b = e.transform) == null ? void 0 : b.x) ?? 0, O = e.y !== void 0 ? e.y : ((m = e.transform) == null ? void 0 : m.y) ?? 0, R = 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
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);
2994
+ tt += X * ft, O += X * pt, R += 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, _t = r + at;
2997
- tt += nt * Z, R += B * _t;
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;
2997
+ tt += nt * Z, O += 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, _t = Z * Math.PI / 180;
3000
- tt = e.x + ft * Math.cos(_t), R = e.y + ft * Math.sin(_t), O += Z;
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), O = e.y + ft * Math.sin(Pt), R += 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 ? (((I = n.shadow) == null ? void 0 : I.blur) || 0) + 10 : 0) + (((M = n.blur) == null ? void 0 : M.isEnabled) !== !1 && ((k = n.blur) == null ? void 0 : k.radius) || 0) + 20;
3006
- if (!this.isObjectInView(t, tt, R, a, r, ft))
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, O, a, r, ft))
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
- const Pt = n.effects || ((L = i.style) == null ? void 0 : L.effects) || [];
3013
- let It = Pt.find((ft) => ft.isEnabled !== !1 && (ft.type === "BackgroundBlur" || ft.type === "LayerBlur"));
3014
- It || (It = n.effect || ((P = i.style) == null ? void 0 : P.effect) || Pt.find((ft) => ft.isEnabled !== !1));
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
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
3016
  Xt && le === "LayerBlur" ? bt.push(`blur(${he}px)`) : Xt && le === "BackgroundBlur" && (n === i.style && (n = { ...n }), n.fill = { type: "None" });
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, Et = et ? Rt || mt : mt || Rt, dt = et && !Et ? {
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, Ot = s != null && s.adjustments && Object.keys(s.adjustments).length > 0 ? s.adjustments : null, _t = et ? Ot || mt : mt || Ot, dt = et && !_t ? {
3018
3018
  exposure: 0,
3019
3019
  contrast: 0,
3020
3020
  saturation: 100,
@@ -3025,9 +3025,9 @@ class ci {
3025
3025
  blur: 0,
3026
3026
  negative: 0,
3027
3027
  hue: 0
3028
- } : Et;
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, _t = (dt.shadows || 0) / 500;
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;
3031
3031
  let xt = "", kt = "SourceGraphic";
3032
3032
  if (ft !== 0 && (xt += `
3033
3033
  <feComponentTransfer in="${kt}" result="exposure">
@@ -3052,15 +3052,15 @@ class ci {
3052
3052
  0 0 ${Mt} 0 ${1 - Mt}
3053
3053
  0 0 0 1 0"/>`, kt = "invert";
3054
3054
  }
3055
- if (B !== 0 || nt !== 0 || Z !== 0 || _t !== 0) {
3056
- const Mt = 1 + Z + _t, $ = Mt * (1 + B - nt / 2), Bt = Mt * (1 + nt), Kt = Mt * (1 - B - nt / 2), te = dt.shadows * 0.1 / 255, Jt = [
3055
+ if (B !== 0 || nt !== 0 || Z !== 0 || Pt !== 0) {
3056
+ const Mt = 1 + Z + Pt, $ = Mt * (1 + B - nt / 2), Wt = Mt * (1 + nt), Kt = Mt * (1 - B - nt / 2), te = dt.shadows * 0.1 / 255, Jt = [
3057
3057
  $,
3058
3058
  0,
3059
3059
  0,
3060
3060
  0,
3061
3061
  te,
3062
3062
  0,
3063
- Bt,
3063
+ Wt,
3064
3064
  0,
3065
3065
  0,
3066
3066
  te,
@@ -3083,11 +3083,11 @@ class ci {
3083
3083
  }
3084
3084
  }
3085
3085
  bt.length > 0 ? t.filter = bt.join(" ") : t.filter = "none", t.imageSmoothingEnabled = !0, t.imageSmoothingQuality = "high";
3086
- const Ot = t.globalAlpha, zt = this.normalizeOpacity(e.opacity !== void 0 ? e.opacity : 100);
3087
- t.globalAlpha = Ot * zt;
3088
- const Wt = e.compositeOperation || e.blendMode;
3089
- if (Wt && Wt !== "Normal") {
3090
- const ft = Wt.toLowerCase();
3086
+ const Ft = t.globalAlpha, Dt = this.normalizeOpacity(e.opacity !== void 0 ? e.opacity : 100);
3087
+ t.globalAlpha = Ft * Dt;
3088
+ const $t = e.compositeOperation || e.blendMode;
3089
+ if ($t && $t !== "Normal") {
3090
+ const ft = $t.toLowerCase();
3091
3091
  [
3092
3092
  "multiply",
3093
3093
  "screen",
@@ -3119,7 +3119,7 @@ class ci {
3119
3119
  "screen"
3120
3120
  ].includes(ft) && (t.globalCompositeOperation = ft);
3121
3121
  }
3122
- const $t = t, Ht = e.masks || (i.maskedBy ? [{
3122
+ const Rt = t, Vt = e.masks || (i.maskedBy ? [{
3123
3123
  maskId: i.maskedBy,
3124
3124
  inverted: i.maskInverted === !0,
3125
3125
  type: i.maskType || "alpha",
@@ -3128,12 +3128,12 @@ class ci {
3128
3128
  isVisible: !0
3129
3129
  }] : []);
3130
3130
  let ie = !1;
3131
- const me = Ht.filter((ft) => ft.isVisible !== !1 && o.has(ft.maskId));
3131
+ const me = Vt.filter((ft) => ft.isVisible !== !1 && o.has(ft.maskId));
3132
3132
  if (me.length > 0) {
3133
3133
  const ft = me[0], pt = o.get(ft.maskId), at = this.objectStates.get(pt.id);
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 = $t.filter);
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 = Rt.filter);
3135
3135
  }
3136
- t.translate(Math.round(tt), Math.round(R)), t.rotate(O * Math.PI / 180);
3136
+ t.translate(Math.round(tt), Math.round(O)), t.rotate(R * Math.PI / 180);
3137
3137
  const ye = e.skew_x || 0, Ut = e.skew_y || 0;
3138
3138
  if (ye !== 0 || Ut !== 0) {
3139
3139
  const ft = Math.tan(ye * Math.PI / 180), pt = Math.tan(Ut * Math.PI / 180);
@@ -3156,13 +3156,14 @@ class ci {
3156
3156
  } else if (ft.startsWith("rgba")) {
3157
3157
  const kt = ft.match(/[\d.]+/g);
3158
3158
  if (kt && kt.length >= 4) {
3159
- const At = kt[0], Mt = kt[1], $ = kt[2], Bt = kt[3];
3160
- Z = `rgba(${At}, ${Mt}, ${$}, ${parseFloat(Bt) * pt})`;
3159
+ const At = kt[0], Mt = kt[1], $ = kt[2], Wt = kt[3];
3160
+ Z = `rgba(${At}, ${Mt}, ${$}, ${parseFloat(Wt) * pt})`;
3161
3161
  }
3162
3162
  }
3163
- const _t = t.getTransform(), xt = Math.sqrt(_t.a * _t.a + _t.b * _t.b) || 1;
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();
@@ -3193,7 +3194,7 @@ class ci {
3193
3194
  } else if (s.type === "SVG") {
3194
3195
  const ft = s.svgContent;
3195
3196
  if (ft) {
3196
- 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), _t = 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
+ 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,
3199
3200
  B.trimStart ?? 0,
@@ -3215,7 +3216,7 @@ class ci {
3215
3216
  ].join("|") : "nostroke", kt = [
3216
3217
  i.id,
3217
3218
  pt.join("_"),
3218
- _t,
3219
+ Pt,
3219
3220
  xt,
3220
3221
  e.opacity ?? 100,
3221
3222
  e.visible !== !1 ? "v" : "h"
@@ -3225,11 +3226,11 @@ class ci {
3225
3226
  At = new Image(), At.crossOrigin = "anonymous";
3226
3227
  let $ = ft;
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
- let Bt = s.width || a || 100, Kt = s.height || r || 100;
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);
3230
- if (te && (Bt = parseFloat(te[1]), Kt = parseFloat(te[2])), $ = $.replace(/<svg([^>]*)>/i, (rt, V) => {
3231
+ if (te && (Wt = parseFloat(te[1]), Kt = parseFloat(te[2])), $ = $.replace(/<svg([^>]*)>/i, (rt, V) => {
3231
3232
  let st = V.replace(/\b(?:width|height)=["'][^"']*["']/gi, " ");
3232
- return st.match(/\bviewBox=/i) || (st += ` viewBox="0 0 ${Bt} ${Kt}"`), st.match(/\bpreserveAspectRatio=/i) || (st += ' preserveAspectRatio="none"'), st += ' width="100%" height="100%"', `<svg${st}>`;
3233
+ return st.match(/\bviewBox=/i) || (st += ` viewBox="0 0 ${Wt} ${Kt}"`), st.match(/\bpreserveAspectRatio=/i) || (st += ' preserveAspectRatio="none"'), st += ' width="100%" height="100%"', `<svg${st}>`;
3233
3234
  }), s.colors && s.colors.length > 0 && pt.length > 0 && s.colors.forEach((rt, V) => {
3234
3235
  if (pt[V]) {
3235
3236
  const st = rt.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"), it = new RegExp(st, "gi");
@@ -3246,23 +3247,23 @@ class ci {
3246
3247
  }).join("");
3247
3248
  let it = "";
3248
3249
  if (at.type === "LinearGradient" || at.type === "Linear") {
3249
- const vt = (Nt, Vt) => Array.isArray(Nt) ? Nt[Vt] ?? (Vt === 0 ? 0 : 1) : Nt && typeof Nt == "object" ? Nt[Vt === 0 ? "x" : "y"] ?? (Vt === 0 ? 0 : 1) : Vt === 0 ? 0 : 1, Yt = vt(at.start, 0) * 100, Qt = vt(at.start, 1) * 100, ne = vt(at.end, 0) * 100, Dt = vt(at.end, 1) * 100;
3250
- it = `<linearGradient id="${rt}" x1="${Yt}%" y1="${Qt}%" x2="${ne}%" y2="${Dt}%" gradientUnits="objectBoundingBox">${st}</linearGradient>`;
3250
+ const vt = (Ht, Nt) => Array.isArray(Ht) ? Ht[Nt] ?? (Nt === 0 ? 0 : 1) : Ht && typeof Ht == "object" ? Ht[Nt === 0 ? "x" : "y"] ?? (Nt === 0 ? 0 : 1) : Nt === 0 ? 0 : 1, Yt = vt(at.start, 0) * 100, Qt = vt(at.start, 1) * 100, ne = vt(at.end, 0) * 100, Gt = vt(at.end, 1) * 100;
3251
+ it = `<linearGradient id="${rt}" x1="${Yt}%" y1="${Qt}%" x2="${ne}%" y2="${Gt}%" gradientUnits="objectBoundingBox">${st}</linearGradient>`;
3251
3252
  } else {
3252
- const vt = (Dt, Nt) => Array.isArray(Dt) ? Dt[Nt] ?? 0.5 : Dt && typeof Dt == "object" ? Dt[Nt === 0 ? "x" : "y"] ?? 0.5 : 0.5, Yt = vt(at.center, 0) * 100, Qt = vt(at.center, 1) * 100, ne = (at.radius ?? 0.5) * 100;
3253
+ const vt = (Gt, Ht) => Array.isArray(Gt) ? Gt[Ht] ?? 0.5 : Gt && typeof Gt == "object" ? Gt[Ht === 0 ? "x" : "y"] ?? 0.5 : 0.5, Yt = vt(at.center, 0) * 100, Qt = vt(at.center, 1) * 100, ne = (at.radius ?? 0.5) * 100;
3253
3254
  it = `<radialGradient id="${rt}" cx="${Yt}%" cy="${Qt}%" r="${ne}%" gradientUnits="objectBoundingBox">${st}</radialGradient>`;
3254
3255
  }
3255
3256
  /<defs>/i.test($) ? $ = $.replace(/<defs>/i, `<defs>${it}`) : $ = $.replace(/<svg([^>]*)>/i, `<svg$1><defs>${it}</defs>`), $ = $.replace(/\bfill\s*=\s*["'][^"']*["']/gi, (vt) => /fill\s*=\s*["']\s*(none|transparent)\s*["']/i.test(vt) ? vt : `fill="url(#${rt})"`), $ = $.replace(/fill\s*:\s*[^;"')]+/gi, (vt) => /fill\s*:\s*(none|transparent)/i.test(vt) ? vt : `fill:url(#${rt})`);
3256
3257
  }
3257
3258
  }
3258
3259
  const Jt = (rt, V, st = 1) => {
3259
- const it = (rt.stops || []).map((Dt) => {
3260
- const Nt = Dt.offset !== void 0 ? Dt.offset : Dt.pos ?? 0, Vt = this.normalizeOpacity(Dt.opacity ?? 100) * st;
3261
- return `<stop offset="${Nt * 100}%" stop-color="${Dt.color || "#000"}" stop-opacity="${Vt}"/>`;
3262
- }).join(""), vt = (Dt, Nt, Vt = 0.5) => Array.isArray(Dt) ? Dt[Nt] ?? Vt : Dt && typeof Dt == "object" ? Dt[Nt === 0 ? "x" : "y"] ?? Vt : Vt;
3260
+ const it = (rt.stops || []).map((Gt) => {
3261
+ const Ht = Gt.offset !== void 0 ? Gt.offset : Gt.pos ?? 0, Nt = this.normalizeOpacity(Gt.opacity ?? 100) * st;
3262
+ return `<stop offset="${Ht * 100}%" stop-color="${Gt.color || "#000"}" stop-opacity="${Nt}"/>`;
3263
+ }).join(""), vt = (Gt, Ht, Nt = 0.5) => Array.isArray(Gt) ? Gt[Ht] ?? Nt : Gt && typeof Gt == "object" ? Gt[Ht === 0 ? "x" : "y"] ?? Nt : Nt;
3263
3264
  if (rt.type === "LinearGradient" || rt.type === "Linear") {
3264
- const Dt = vt(rt.start, 0, 0) * 100, Nt = vt(rt.start, 1, 0) * 100, Vt = vt(rt.end, 0, 1) * 100, Ie = vt(rt.end, 1, 1) * 100;
3265
- return `<linearGradient id="${V}" x1="${Dt}%" y1="${Nt}%" x2="${Vt}%" y2="${Ie}%" gradientUnits="objectBoundingBox">${it}</linearGradient>`;
3265
+ const Gt = vt(rt.start, 0, 0) * 100, Ht = vt(rt.start, 1, 0) * 100, Nt = vt(rt.end, 0, 1) * 100, Ie = vt(rt.end, 1, 1) * 100;
3266
+ return `<linearGradient id="${V}" x1="${Gt}%" y1="${Ht}%" x2="${Nt}%" y2="${Ie}%" gradientUnits="objectBoundingBox">${it}</linearGradient>`;
3266
3267
  }
3267
3268
  const Yt = vt(rt.center, 0, 0.5) * 100, Qt = vt(rt.center, 1, 0.5) * 100, ne = (rt.radius ?? 0.5) * 100;
3268
3269
  return `<radialGradient id="${V}" cx="${Yt}%" cy="${Qt}%" r="${ne}%" gradientUnits="objectBoundingBox">${it}</radialGradient>`;
@@ -3275,13 +3276,13 @@ class ci {
3275
3276
  if (it.type === "Solid")
3276
3277
  st = it.color || B.color || "#000000";
3277
3278
  else if (it.type === "LinearGradient" || it.type === "RadialGradient" || it.type === "Linear" || it.type === "Radial") {
3278
- const Gt = "exode-stroke";
3279
- $ = ut($, Jt(it, Gt, rt)), st = `url(#${Gt})`;
3279
+ const zt = "exode-stroke";
3280
+ $ = ut($, Jt(it, zt, rt)), st = `url(#${zt})`;
3280
3281
  }
3281
3282
  }
3282
3283
  st || (st = V), $.match(/\bstroke\s*=\s*["']/i) ? $ = $.replace(
3283
3284
  /\bstroke\s*=\s*["'][^"']*["']/gi,
3284
- (Gt) => /stroke\s*=\s*["']\s*(none|transparent)\s*["']/i.test(Gt) ? Gt : `stroke="${st}"`
3285
+ (zt) => /stroke\s*=\s*["']\s*(none|transparent)\s*["']/i.test(zt) ? zt : `stroke="${st}"`
3285
3286
  ) : $ = $.replace(/<(path|circle|rect|ellipse|polygon|polyline)/gi, `<$1 stroke="${st}"`), $ = $.replace(
3286
3287
  new RegExp(`(?<![a-z-])stroke\\s*:\\s*(?!none|transparent)[^;"')]+`, "gi"),
3287
3288
  `stroke:${st}`
@@ -3289,44 +3290,44 @@ class ci {
3289
3290
  let vt = s.width || a || 100, Yt = s.height || r || 100;
3290
3291
  const Qt = ft.match(/viewBox=["']\s*0\s+0\s+([\d.]+)\s+([\d.]+)\s*["']/i);
3291
3292
  if (Qt) {
3292
- const Gt = parseFloat(Qt[1]), oe = parseFloat(Qt[2]);
3293
- !isNaN(Gt) && !isNaN(oe) && (vt = Gt, Yt = oe);
3293
+ const zt = parseFloat(Qt[1]), oe = parseFloat(Qt[2]);
3294
+ !isNaN(zt) && !isNaN(oe) && (vt = zt, Yt = oe);
3294
3295
  }
3295
- const ne = Math.max(1e-3, a / vt), Dt = Math.max(1e-3, r / Yt), Nt = (ne + Dt) / 2, Vt = (B.width || 1) / Nt;
3296
- $.match(/\bstroke-width\s*=\s*["']/i) ? $ = $.replace(/\bstroke-width\s*=\s*["'][^"']*["']/gi, `stroke-width="${Vt}"`) : $ = $.replace(/<(path|circle|rect|ellipse|polygon|polyline)/gi, `<$1 stroke-width="${Vt}"`), $ = $.replace(/stroke-width\s*:\s*[^;"')]+/gi, `stroke-width:${Vt}`), $.match(/\bstroke-opacity\s*=\s*["']/i) ? $ = $.replace(/\bstroke-opacity\s*=\s*["'][^"']*["']/gi, `stroke-opacity="${rt}"`) : $ = $.replace(/<(path|circle|rect|ellipse|polygon|polyline)/gi, `<$1 stroke-opacity="${rt}"`), $ = $.replace(/stroke-opacity\s*:\s*[^;"')]+/gi, `stroke-opacity:${rt}`);
3296
+ const ne = Math.max(1e-3, a / vt), Gt = Math.max(1e-3, r / Yt), Ht = (ne + Gt) / 2, Nt = (B.width || 1) / Ht;
3297
+ $.match(/\bstroke-width\s*=\s*["']/i) ? $ = $.replace(/\bstroke-width\s*=\s*["'][^"']*["']/gi, `stroke-width="${Nt}"`) : $ = $.replace(/<(path|circle|rect|ellipse|polygon|polyline)/gi, `<$1 stroke-width="${Nt}"`), $ = $.replace(/stroke-width\s*:\s*[^;"')]+/gi, `stroke-width:${Nt}`), $.match(/\bstroke-opacity\s*=\s*["']/i) ? $ = $.replace(/\bstroke-opacity\s*=\s*["'][^"']*["']/gi, `stroke-opacity="${rt}"`) : $ = $.replace(/<(path|circle|rect|ellipse|polygon|polyline)/gi, `<$1 stroke-opacity="${rt}"`), $ = $.replace(/stroke-opacity\s*:\s*[^;"')]+/gi, `stroke-opacity:${rt}`);
3297
3298
  const Ie = B.lineCap || "round";
3298
3299
  $.match(/\bstroke-linecap\s*=\s*["']/i) ? $ = $.replace(/\bstroke-linecap\s*=\s*["'][^"']*["']/gi, `stroke-linecap="${Ie}"`) : $ = $.replace(/<(path|circle|rect|ellipse|polygon|polyline)/gi, `<$1 stroke-linecap="${Ie}"`), $ = $.replace(/stroke-linecap\s*:\s*[^;"')]+/gi, `stroke-linecap:${Ie}`);
3299
3300
  const Le = B.lineJoin || "round";
3300
3301
  $.match(/\bstroke-linejoin\s*=\s*["']/i) ? $ = $.replace(/\bstroke-linejoin\s*=\s*["'][^"']*["']/gi, `stroke-linejoin="${Le}"`) : $ = $.replace(/<(path|circle|rect|ellipse|polygon|polyline)/gi, `<$1 stroke-linejoin="${Le}"`), $ = $.replace(/stroke-linejoin\s*:\s*[^;"')]+/gi, `stroke-linejoin:${Le}`);
3301
- const Re = B.trimStart ?? 0, Oe = B.trimEnd ?? 1, Fe = B.trimOffset ?? 0, $e = B.dashOffset ?? 0, Ye = Re !== 0 || Oe !== 1 || Fe !== 0 || $e !== 0;
3302
+ const Oe = B.trimStart ?? 0, Re = B.trimEnd ?? 1, Fe = B.trimOffset ?? 0, $e = B.dashOffset ?? 0, Ye = Oe !== 0 || Re !== 1 || Fe !== 0 || $e !== 0;
3302
3303
  if (Ye) {
3303
- const Gt = Math.max(0, Math.min(1, Re)), oe = Math.max(0, Math.min(1, Oe));
3304
- this.frameCount % 600 === 0 && this.debugLog(`SVG Trim - Object: ${i.name || i.id}, Start: ${Gt}, End: ${oe}`);
3304
+ const zt = Math.max(0, Math.min(1, Oe)), oe = Math.max(0, Math.min(1, Re));
3305
+ this.frameCount % 600 === 0 && this.debugLog(`SVG Trim - Object: ${i.name || i.id}, Start: ${zt}, End: ${oe}`);
3305
3306
  const we = (vt + Yt) * 2, Be = (Fe % 1 + 1) % 1, We = ($e % 1 + 1) % 1;
3306
3307
  let de = "", ce = 0;
3307
- if (Gt >= oe)
3308
+ if (zt >= oe)
3308
3309
  de = `0 ${we}`, ce = 0;
3309
3310
  else {
3310
- const fe = we * (oe - Gt), ke = we - fe;
3311
- ce = -(we * (Gt + Be + We)), de = `${fe} ${ke}`;
3311
+ const fe = we * (oe - zt), ke = we - fe;
3312
+ ce = -(we * (zt + Be + We)), de = `${fe} ${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
- const Gt = B.dashArray.join(" ");
3316
- $ = $.replace(/\bstroke-dasharray\s*=\s*["'][^"']*["']/gi, `stroke-dasharray="${Gt}"`), $ = $.replace(/stroke-dasharray\s*:\s*[^;"')]+/gi, `stroke-dasharray:${Gt}`), B.dashOffset && ($ = $.replace(/\bstroke-dashoffset\s*=\s*["'][^"']*["']/gi, `stroke-dashoffset="${B.dashOffset}"`), $ = $.replace(/stroke-dashoffset\s*:\s*[^;"')]+/gi, `stroke-dashoffset:${B.dashOffset}`));
3316
+ const zt = B.dashArray.join(" ");
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
3319
  if (!/\bstroke\s*=\s*["']/i.test(ft) && !new RegExp("(?<![a-z-])stroke\\s*:", "i").test(ft)) {
3319
- let Gt = "", oe = "";
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, fe = (de + ce) * 2, ke = Math.max(0, Math.min(1, Oe)), Xe = Math.max(0, Math.min(1, Re)), Ve = (Fe % 1 + 1) % 1, Ne = ($e % 1 + 1) % 1;
3322
3323
  if (ke >= Xe)
3323
- Gt = ` stroke-dasharray="0 ${fe}"`, oe = ' stroke-dashoffset="0"';
3324
+ zt = ` stroke-dasharray="0 ${fe}"`, oe = ' stroke-dashoffset="0"';
3324
3325
  else {
3325
3326
  const De = fe * (Xe - ke), He = fe - De, H = -(fe * (ke + Ve + Ne));
3326
- Gt = ` stroke-dasharray="${De} ${He}"`, oe = ` stroke-dashoffset="${H}"`;
3327
+ zt = ` stroke-dasharray="${De} ${He}"`, oe = ` stroke-dashoffset="${H}"`;
3327
3328
  }
3328
- } else (x = B.dashArray) != null && x.length && (Gt = ` stroke-dasharray="${B.dashArray.join(" ")}"`, B.dashOffset && (oe = ` stroke-dashoffset="${B.dashOffset}"`));
3329
- const we = ` stroke-linecap="${B.lineCap || "round"}"`, Be = ` stroke-linejoin="${B.lineJoin || "round"}"`, We = `stroke="${st}" stroke-width="${Vt}" stroke-opacity="${rt}"${we}${Be}${Gt}${oe}`;
3329
+ } else (x = B.dashArray) != null && x.length && (zt = ` stroke-dasharray="${B.dashArray.join(" ")}"`, B.dashOffset && (oe = ` stroke-dashoffset="${B.dashOffset}"`));
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
3333
  (de, ce, fe) => `${ce}${fe}<g ${We}>`
@@ -3345,12 +3346,12 @@ class ci {
3345
3346
  }
3346
3347
  let Mt = null;
3347
3348
  if (At.complete && At.naturalWidth > 0 ? (Mt = At, this.lastValidSvgImgMap.set(i.id, At)) : Mt = this.lastValidSvgImgMap.get(i.id) || null, Mt && Mt.complete && Mt.naturalWidth > 0) {
3348
- const $ = Math.max(1, a), Bt = Math.max(1, r);
3349
+ const $ = Math.max(1, a), Wt = Math.max(1, r);
3349
3350
  if (Z && (at == null ? void 0 : at.type) === "Solid") {
3350
- this.maskBuffer || (this.maskBuffer = document.createElement("canvas"), this.maskCtx = this.maskBuffer.getContext("2d")), this.maskBuffer.width = $, this.maskBuffer.height = Bt, 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, $, Bt), this.maskCtx.drawImage(Mt, 0, 0, $, Bt), this.maskCtx.globalCompositeOperation = "source-in";
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
- this.maskCtx.fillStyle = Kt, this.maskCtx.globalAlpha = te, this.maskCtx.fillRect(0, 0, $, Bt), t.drawImage(this.maskBuffer, -$ / 2, -Bt / 2, $, Bt);
3353
- } else h !== 0 ? (t.save(), this.drawRoundRect(t, -$ / 2, -Bt / 2, $, Bt, h), t.clip(), t.drawImage(Mt, -$ / 2, -Bt / 2, $, Bt), t.restore()) : t.drawImage(Mt, -$ / 2, -Bt / 2, $, Bt);
3353
+ this.maskCtx.fillStyle = Kt, this.maskCtx.globalAlpha = te, this.maskCtx.fillRect(0, 0, $, Wt), t.drawImage(this.maskBuffer, -$ / 2, -Wt / 2, $, Wt);
3354
+ } 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
3355
  }
3355
3356
  }
3356
3357
  } else if (l.type === "LineGraph")
@@ -3384,18 +3385,18 @@ class ci {
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();
3387
- const nt = e.width ?? (s == null ? void 0 : s.width) ?? i.width ?? 0, Z = e.height ?? (s == null ? void 0 : s.height) ?? i.height ?? 0, _t = e.cornerRadius ?? (s == null ? void 0 : s.corner_radius) ?? i.cornerRadius ?? 0;
3388
- this.drawRoundRect(t, -nt / 2, -Z / 2, nt, Z, _t), t.clip();
3388
+ const nt = e.width ?? (s == null ? void 0 : s.width) ?? i.width ?? 0, Z = e.height ?? (s == null ? void 0 : s.height) ?? i.height ?? 0, Pt = e.cornerRadius ?? (s == null ? void 0 : s.corner_radius) ?? i.cornerRadius ?? 0;
3389
+ this.drawRoundRect(t, -nt / 2, -Z / 2, nt, Z, Pt), t.clip();
3389
3390
  }
3390
3391
  let B = 0;
3391
3392
  for (i.children.forEach((nt) => {
3392
3393
  const Z = o.get(nt);
3393
3394
  if (!Z) return;
3394
- const _t = this.objectStates.get(nt), xt = (_t == null ? void 0 : _t.geometry) || Z.geometry;
3395
- if (xt && xt.isMask && (_t == null ? void 0 : _t.visible) !== !1) {
3395
+ const Pt = this.objectStates.get(nt), xt = (Pt == null ? void 0 : Pt.geometry) || Z.geometry;
3396
+ if (xt && xt.isMask && (Pt == null ? void 0 : Pt.visible) !== !1) {
3396
3397
  const kt = xt.width || 0, At = xt.height || 0;
3397
3398
  this.applyObjectTransform(t, nt);
3398
- const Mt = (_t == null ? void 0 : _t.corner_radius) ?? (xt == null ? void 0 : xt.corner_radius) ?? 0;
3399
+ const Mt = (Pt == null ? void 0 : Pt.corner_radius) ?? (xt == null ? void 0 : xt.corner_radius) ?? 0;
3399
3400
  this.applyPath(t, xt, kt, At, Mt), t.clip(), B++;
3400
3401
  } else
3401
3402
  this.renderObject(t, Z, o);
@@ -3412,10 +3413,10 @@ class ci {
3412
3413
  feather: i.maskFeather || 0,
3413
3414
  isVisible: !0
3414
3415
  }] : [])).filter((B) => B.isVisible !== !1 && o.has(B.maskId)).forEach((B) => {
3415
- var Mt, $, Bt, Kt, te, Jt;
3416
- const nt = o.get(B.maskId), Z = this.objectStates.get(nt.id), _t = B.feather || 0, xt = B.inverted === !0, kt = B.opacity !== void 0 ? typeof B.opacity == "number" ? B.opacity : B.opacity / 100 : 1;
3416
+ var Mt, $, Wt, Kt, te, Jt;
3417
+ const nt = o.get(B.maskId), Z = this.objectStates.get(nt.id), Pt = B.feather || 0, xt = B.inverted === !0, kt = B.opacity !== void 0 ? typeof B.opacity == "number" ? B.opacity : B.opacity / 100 : 1;
3417
3418
  if ((B.type || "alpha") === "luma") {
3418
- (!this.lumaBuffer || this.lumaBuffer.width !== this.maskBuffer.width || this.lumaBuffer.height !== this.maskBuffer.height) && (this.lumaBuffer = document.createElement("canvas"), this.lumaBuffer.width = this.maskBuffer.width, this.lumaBuffer.height = this.maskBuffer.height, this.lumaCtx = this.lumaBuffer.getContext("2d", { willReadFrequently: !0 }), this.lumaCtx && (this.lumaCtx.imageSmoothingEnabled = !0, this.lumaCtx.imageSmoothingQuality = "high")), this.lumaCtx.setTransform(1, 0, 0, 1, 0, 0), this.lumaCtx.globalCompositeOperation = "source-over", this.lumaCtx.globalAlpha = 1, this.lumaCtx.filter = "none", this.lumaCtx.clearRect(0, 0, this.lumaBuffer.width, this.lumaBuffer.height), this.lumaCtx.save(), this.rootTransform && this.lumaCtx.setTransform(this.rootTransform), this.applyAbsoluteTransform(this.lumaCtx, nt.id, o), _t > 0 && (this.lumaCtx.filter = `blur(${_t}px)`), this.lumaCtx.globalAlpha = kt;
3419
+ (!this.lumaBuffer || this.lumaBuffer.width !== this.maskBuffer.width || this.lumaBuffer.height !== this.maskBuffer.height) && (this.lumaBuffer = document.createElement("canvas"), this.lumaBuffer.width = this.maskBuffer.width, this.lumaBuffer.height = this.maskBuffer.height, this.lumaCtx = this.lumaBuffer.getContext("2d", { willReadFrequently: !0 }), this.lumaCtx && (this.lumaCtx.imageSmoothingEnabled = !0, this.lumaCtx.imageSmoothingQuality = "high")), this.lumaCtx.setTransform(1, 0, 0, 1, 0, 0), this.lumaCtx.globalCompositeOperation = "source-over", this.lumaCtx.globalAlpha = 1, this.lumaCtx.filter = "none", this.lumaCtx.clearRect(0, 0, this.lumaBuffer.width, this.lumaBuffer.height), this.lumaCtx.save(), this.rootTransform && this.lumaCtx.setTransform(this.rootTransform), this.applyAbsoluteTransform(this.lumaCtx, nt.id, o), Pt > 0 && (this.lumaCtx.filter = `blur(${Pt}px)`), this.lumaCtx.globalAlpha = kt;
3419
3420
  const ut = (Z == null ? void 0 : Z.width) || nt.geometry.width || 0, ct = (Z == null ? void 0 : Z.height) || nt.geometry.height || 0, Ct = (Z == null ? void 0 : Z.corner_radius) ?? nt.corner_radius ?? 0;
3420
3421
  if (((Mt = nt.geometry) == null ? void 0 : Mt.type) === "Text") {
3421
3422
  const it = Z != null && Z.geometry ? this.deepMerge(nt.geometry, Z.geometry) : nt.geometry, vt = Z != null && Z.style ? this.deepMerge(nt.style, Z.style) : nt.style;
@@ -3426,7 +3427,7 @@ class ci {
3426
3427
  let vt = this.imageCache.get(it);
3427
3428
  vt || (vt = new Image(), vt.src = it, this.imageCache.set(it, vt)), vt.complete && vt.naturalWidth > 0 ? this.lumaCtx.drawImage(vt, -ut / 2, -ct / 2, ut, ct) : (this.applyPath(this.lumaCtx, nt.geometry, ut, ct, Ct), this.lumaCtx.fillStyle = "#ffffff", this.lumaCtx.fill());
3428
3429
  }
3429
- } else if (((Bt = nt.geometry) == null ? void 0 : Bt.type) === "SVG") {
3430
+ } else if (((Wt = nt.geometry) == null ? void 0 : Wt.type) === "SVG") {
3430
3431
  const it = nt.geometry.svgContent;
3431
3432
  if (it) {
3432
3433
  const vt = `__lumamask_${nt.id}`;
@@ -3451,7 +3452,7 @@ class ci {
3451
3452
  }
3452
3453
  this.maskCtx.putImageData(rt, 0, 0);
3453
3454
  } else {
3454
- this.maskCtx.save(), this.rootTransform && this.maskCtx.setTransform(this.rootTransform), this.maskCtx.globalCompositeOperation = xt ? "destination-out" : "destination-in", _t > 0 && (this.maskCtx.filter = `blur(${_t}px)`), this.maskCtx.globalAlpha = kt, this.applyAbsoluteTransform(this.maskCtx, nt.id, o);
3455
+ this.maskCtx.save(), this.rootTransform && this.maskCtx.setTransform(this.rootTransform), this.maskCtx.globalCompositeOperation = xt ? "destination-out" : "destination-in", Pt > 0 && (this.maskCtx.filter = `blur(${Pt}px)`), this.maskCtx.globalAlpha = kt, this.applyAbsoluteTransform(this.maskCtx, nt.id, o);
3455
3456
  const ut = (Z == null ? void 0 : Z.width) || nt.geometry.width || 0, ct = (Z == null ? void 0 : Z.height) || nt.geometry.height || 0, Ct = (Z == null ? void 0 : Z.corner_radius) ?? nt.corner_radius ?? 0;
3456
3457
  if (((Kt = nt.geometry) == null ? void 0 : Kt.type) === "Text") {
3457
3458
  const rt = Z != null && Z.geometry ? this.deepMerge(nt.geometry, Z.geometry) : nt.geometry, V = Z != null && Z.style ? this.deepMerge(nt.style, Z.style) : nt.style;
@@ -3480,15 +3481,15 @@ class ci {
3480
3481
  this.applyPath(this.maskCtx, nt.geometry, ut, ct, Ct), this.maskCtx.fillStyle = "#ffffff", this.maskCtx.fill();
3481
3482
  this.maskCtx.restore();
3482
3483
  }
3483
- }), $t.save(), $t.setTransform(1, 0, 0, 1, 0, 0);
3484
+ }), Rt.save(), Rt.setTransform(1, 0, 0, 1, 0, 0);
3484
3485
  const at = i.maskBlendMode || i.blendMode;
3485
- at && at !== "Normal" && ($t.globalCompositeOperation = at.toLowerCase()), $t.drawImage(this.maskBuffer, 0, 0), $t.restore(), $t.restore();
3486
+ at && at !== "Normal" && (Rt.globalCompositeOperation = at.toLowerCase()), Rt.drawImage(this.maskBuffer, 0, 0), Rt.restore(), Rt.restore();
3486
3487
  } else
3487
3488
  t.restore();
3488
3489
  }
3489
3490
  }
3490
3491
  _renderText(t, i, o, e, s, n, a, r = !1, f = !1, h = 1, l = 1) {
3491
- var yt, bt, gt, Pt, It, St, Xt, le, he;
3492
+ var yt, bt, gt, Et, It, St, Xt, le, he;
3492
3493
  let p = o.text || "";
3493
3494
  if (o.textInputId && !r) {
3494
3495
  const et = this.inputs.get(o.textInputId);
@@ -3497,17 +3498,17 @@ class ci {
3497
3498
  if (o.svgPath) {
3498
3499
  const et = o.svgPath;
3499
3500
  t.save();
3500
- const mt = ((yt = e == null ? void 0 : e.fill) == null ? void 0 : yt.color) || "#000000", Rt = ((bt = e == null ? void 0 : e.fill) == null ? void 0 : bt.opacity) !== void 0 ? (gt = e == null ? void 0 : e.fill) == null ? void 0 : gt.opacity : 1;
3501
- t.fillStyle = mt, t.globalAlpha *= Rt;
3502
- const Et = new Path2D(et);
3503
- t.fill(Et), t.restore();
3501
+ const mt = ((yt = e == null ? void 0 : e.fill) == null ? void 0 : yt.color) || "#000000", Ot = ((bt = e == null ? void 0 : e.fill) == null ? void 0 : bt.opacity) !== void 0 ? (gt = e == null ? void 0 : e.fill) == null ? void 0 : gt.opacity : 1;
3502
+ t.fillStyle = mt, t.globalAlpha *= Ot;
3503
+ const _t = new Path2D(et);
3504
+ t.fill(_t), t.restore();
3504
3505
  return;
3505
3506
  }
3506
3507
  let c = p || "";
3507
3508
  o.enableSegments === !0 && o.segments && Array.isArray(o.segments) && (c = o.segments.map((et) => et && et.text ? et.text : "").join(""));
3508
3509
  const d = o.textCase || "none";
3509
3510
  d === "uppercase" ? c = c.toUpperCase() : d === "lowercase" ? c = c.toLowerCase() : d === "capitalize" && (c = c.replace(/\b\w/g, (et) => et.toUpperCase()));
3510
- let u = ((Pt = o.fontWeight) == null ? void 0 : Pt.toString()) || "400", v = o.fontStyle || "normal";
3511
+ let u = ((Et = o.fontWeight) == null ? void 0 : Et.toString()) || "400", v = o.fontStyle || "normal";
3511
3512
  u.toLowerCase().includes("italic") && (v = "italic", u = u.replace(/italic/gi, "").trim() || "400");
3512
3513
  const b = this.mapFontWeight(u), m = Math.max(1, o.fontSize || 32);
3513
3514
  let y = o.fontFamily || "Inter";
@@ -3516,9 +3517,9 @@ class ci {
3516
3517
  const mt = new RegExp(`[\\s-]${et}$`, "i");
3517
3518
  mt.test(y) && (y = y.replace(mt, "").trim());
3518
3519
  });
3519
- const I = `${o.smallCaps === !0 ? "small-caps " : ""}${v} ${b} ${m}px "${y}", sans-serif`;
3520
- t.font = I;
3521
- const M = o.textVerticalAlign || "top";
3520
+ const M = `${o.smallCaps === !0 ? "small-caps " : ""}${v} ${b} ${m}px "${y}", sans-serif`;
3521
+ t.font = M;
3522
+ const I = o.textVerticalAlign || "top";
3522
3523
  t.textBaseline = "top";
3523
3524
  const k = o.textAlign || "left";
3524
3525
  t.textAlign = k;
@@ -3558,63 +3559,63 @@ class ci {
3558
3559
  let j = G.height, X = n, tt = a;
3559
3560
  if (X === 0 || tt === 0 || X >= 1e5) {
3560
3561
  let et = 0, mt = 0;
3561
- const Rt = G.fullText || c;
3562
- (N || []).forEach((Et) => {
3563
- const dt = Et.text || "", Ot = t.measureText(dt).width + (dt.length > 0 ? (dt.length - 1) * T : 0);
3564
- Ot > et && (et = Ot), mt += dt.length, mt < Rt.length && (Rt[mt] === `
3565
- ` || Rt[mt] === "\r") && (mt++, Rt[mt - 1] === "\r" && Rt[mt] === `
3562
+ const Ot = G.fullText || c;
3563
+ (N || []).forEach((_t) => {
3564
+ const dt = _t.text || "", Ft = t.measureText(dt).width + (dt.length > 0 ? (dt.length - 1) * T : 0);
3565
+ Ft > et && (et = Ft), mt += dt.length, mt < Ot.length && (Ot[mt] === `
3566
+ ` || Ot[mt] === "\r") && (mt++, Ot[mt - 1] === "\r" && Ot[mt] === `
3566
3567
  ` && mt++);
3567
3568
  }), (X === 0 || X >= 1e5) && (X = et), tt === 0 && (tt = j || 0);
3568
3569
  }
3569
- let R = -j / 2;
3570
- a > 0 && a > j && (M === "top" ? R = -a / 2 : M === "middle" || M === "center" ? R = -j / 2 : M === "bottom" && (R = a / 2 - j)), R += F;
3571
- let O = null, D = 0;
3570
+ let O = -j / 2;
3571
+ a > 0 && a > j && (I === "top" ? O = -a / 2 : I === "middle" || I === "center" ? O = -j / 2 : I === "bottom" && (O = a / 2 - j)), O += F;
3572
+ let R = null, D = 0;
3572
3573
  if (o.pathId && this.artboard) {
3573
3574
  const et = this.artboard.objects.find((mt) => mt.id === o.pathId);
3574
3575
  if (et && et.type === "Shape" && ((Xt = et.geometry) == null ? void 0 : Xt.type) === "Path") {
3575
- const mt = this.objectStates.get(et.id), Rt = mt != null && mt.geometry ? this.deepMerge(et.geometry, mt.geometry) : et.geometry, Et = (mt == null ? void 0 : mt.scale_x) !== void 0 ? (et.width || 0) * mt.scale_x : et.width || 0, dt = (mt == null ? void 0 : mt.scale_y) !== void 0 ? (et.height || 0) * mt.scale_y : et.height || 0;
3576
- O = { geo: Rt, obj: et, w: Et, h: dt }, D = this.getPerimeter(Rt, Et, dt);
3576
+ const mt = this.objectStates.get(et.id), Ot = mt != null && mt.geometry ? this.deepMerge(et.geometry, mt.geometry) : et.geometry, _t = (mt == null ? void 0 : mt.scale_x) !== void 0 ? (et.width || 0) * mt.scale_x : et.width || 0, dt = (mt == null ? void 0 : mt.scale_y) !== void 0 ? (et.height || 0) * mt.scale_y : et.height || 0;
3577
+ R = { geo: Ot, obj: et, w: _t, h: dt }, D = this.getPerimeter(Ot, _t, dt);
3577
3578
  }
3578
3579
  }
3579
3580
  const q = (et, mt) => {
3580
- var Et, dt;
3581
- if (T === 0 && (!o.enableSegments || !((Et = o.segments) != null && Et.length))) return t.measureText(et).width;
3582
- let Rt = 0;
3583
- for (let Ot = 0; Ot < et.length; Ot++) {
3584
- const zt = mt + Ot;
3585
- let Wt = 0;
3581
+ var _t, dt;
3582
+ if (T === 0 && (!o.enableSegments || !((_t = o.segments) != null && _t.length))) return t.measureText(et).width;
3583
+ let Ot = 0;
3584
+ for (let Ft = 0; Ft < et.length; Ft++) {
3585
+ const Dt = mt + Ft;
3586
+ let $t = 0;
3586
3587
  if (o.enableSegments === !0 && ((dt = o.segments) == null ? void 0 : dt.length) > 0) {
3587
- let $t = 0, Ht = null;
3588
+ let Rt = 0, Vt = null;
3588
3589
  for (const ie of o.segments) {
3589
- if (zt < $t + (ie.text || "").length) {
3590
- Ht = ie;
3590
+ if (Dt < Rt + (ie.text || "").length) {
3591
+ Vt = ie;
3591
3592
  break;
3592
3593
  }
3593
- $t += (ie.text || "").length;
3594
+ Rt += (ie.text || "").length;
3594
3595
  }
3595
- if (Ht) {
3596
+ if (Vt) {
3596
3597
  t.save();
3597
- let ie = Ht.fontFamily || o.fontFamily || "Inter";
3598
- const me = this.mapFontWeight((Ht.fontWeight || o.fontWeight || "400").toString()), ye = Ht.fontStyle || v, Ut = Ht.fontSize || m;
3599
- t.font = `${ye} ${me} ${Ut}px "${ie}", sans-serif`, Wt = t.measureText(et[Ot]).width, t.restore();
3598
+ let ie = Vt.fontFamily || o.fontFamily || "Inter";
3599
+ const me = this.mapFontWeight((Vt.fontWeight || o.fontWeight || "400").toString()), ye = Vt.fontStyle || v, Ut = Vt.fontSize || m;
3600
+ t.font = `${ye} ${me} ${Ut}px "${ie}", sans-serif`, $t = t.measureText(et[Ft]).width, t.restore();
3600
3601
  } else
3601
- Wt = t.measureText(et[Ot]).width;
3602
+ $t = t.measureText(et[Ft]).width;
3602
3603
  } else
3603
- Wt = t.measureText(et[Ot]).width;
3604
- Rt += Wt + T;
3604
+ $t = t.measureText(et[Ft]).width;
3605
+ Ot += $t + T;
3605
3606
  }
3606
- return Rt - (et.length > 0 ? T : 0);
3607
- }, ot = (et, mt, Rt, Et, dt) => {
3607
+ return Ot - (et.length > 0 ? T : 0);
3608
+ }, ot = (et, mt, Ot, _t, dt) => {
3608
3609
  var me, ye;
3609
- const zt = (dt === 0 || c[dt - 1] === `
3610
- ` || c[dt - 1] === "\r") && o.paragraphIndent ? o.paragraphIndent : 0, Wt = (!r || f) && (i.behaviors || []).some(
3610
+ const Dt = (dt === 0 || c[dt - 1] === `
3611
+ ` || c[dt - 1] === "\r") && o.paragraphIndent ? o.paragraphIndent : 0, $t = (!r || f) && (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
- ), $t = !o.pathId && !Wt && (o.enableSegments !== !0 || !o.segments || o.segments.length === 0), Ht = o.baselineShift || 0, ie = Rt + Ht;
3613
- if ($t)
3614
- t.font = I, Et ? t.strokeText(et, mt + zt, ie) : t.fillText(et, mt + zt, ie);
3613
+ ), Rt = !o.pathId && !$t && (o.enableSegments !== !0 || !o.segments || o.segments.length === 0), Vt = o.baselineShift || 0, ie = Ot + Vt;
3614
+ if (Rt)
3615
+ t.font = M, _t ? t.strokeText(et, mt + Dt, ie) : t.fillText(et, mt + Dt, ie);
3615
3616
  else {
3616
3617
  const Ut = q(et, dt);
3617
- let Se = mt + zt;
3618
+ let Se = mt + Dt;
3618
3619
  k === "center" ? Se -= Ut / 2 : k === "right" && (Se -= Ut);
3619
3620
  const Pe = dt + et.length >= c.length || c[dt + et.length] === `
3620
3621
  ` || c[dt + et.length] === "\r";
@@ -3631,7 +3632,7 @@ class ci {
3631
3632
  }
3632
3633
  }
3633
3634
  let se = o.pathOffset || 0;
3634
- o.pathId && D > 0 && O && (k === "center" ? se += D / 2 - Ut / 2 : k === "right" && (se += D - Ut));
3635
+ o.pathId && D > 0 && R && (k === "center" ? se += D / 2 - Ut / 2 : k === "right" && (se += D - Ut));
3635
3636
  let jt = Se;
3636
3637
  const ft = r && !f ? [] : ((me = i.behaviors) == null ? void 0 : me.filter(
3637
3638
  (pt) => [
@@ -3669,7 +3670,7 @@ class ci {
3669
3670
  for (let pt = 0; pt < et.length; pt++) {
3670
3671
  let at = et[pt];
3671
3672
  const B = dt + pt;
3672
- let nt = 0, Z = 0, _t = 1, xt = 1, kt = 0, At = 1, Mt = at;
3673
+ let nt = 0, Z = 0, Pt = 1, xt = 1, kt = 0, At = 1, Mt = at;
3673
3674
  ft.forEach((ut) => {
3674
3675
  const ct = ut.settings || {}, Ct = ct.strength || 1, rt = Date.now();
3675
3676
  if (ut.type === U.Typewriter)
@@ -3683,10 +3684,10 @@ class ci {
3683
3684
  V < 1 && (Z -= Math.abs(Math.sin(V * Math.PI)) * (ct.height || 50) * Ct);
3684
3685
  } else if (ut.type === U.TextTrail) {
3685
3686
  const V = this.pointerHistory[Math.max(0, this.pointerHistory.length - 1 - B * (ct.delay || 5))];
3686
- V && (nt += (V.x - (s.x + jt)) * Ct * 0.2, Z += (V.y - (s.y + Rt + Z)) * Ct * 0.2);
3687
+ V && (nt += (V.x - (s.x + jt)) * Ct * 0.2, Z += (V.y - (s.y + Ot + Z)) * Ct * 0.2);
3687
3688
  } else if (ut.type === U.Reveal3D) {
3688
3689
  const V = Math.max(0, Math.min(1, this.currentTime * (ct.speed || 1) - B * (ct.stagger || 0.1)));
3689
- _t *= V, xt *= V, At = V;
3690
+ Pt *= V, xt *= V, At = V;
3690
3691
  } else if (ut.type === U.RevealSlide) {
3691
3692
  const V = Math.max(0, Math.min(1, this.currentTime * 1.5 - B * 0.05)), st = (1 - V) * (ct.distance || 40) * Ct, it = ct.direction || "up";
3692
3693
  it === "up" ? Z -= st : it === "down" ? Z += st : it === "left" ? nt -= st : it === "right" && (nt += st), At = V;
@@ -3728,30 +3729,30 @@ class ci {
3728
3729
  nt += Math.sin(rt * 2e-3 * V + B) * st * Ct, Z += Math.cos(rt * 15e-4 * V + B * 0.7) * st * Ct;
3729
3730
  } else if (ut.type === U.TextBreathe) {
3730
3731
  const st = 1 + (Math.sin(rt * 3e-3 + B * 0.2) + 1) / 2 * 0.2 * Ct;
3731
- _t *= st, xt *= st;
3732
+ Pt *= st, xt *= st;
3732
3733
  } else if (ut.type === U.TextSpin) {
3733
3734
  const V = ct.speed || 1;
3734
3735
  kt += rt * 0.01 * V + B;
3735
3736
  } else if (ut.type === U.TextMagnet) {
3736
3737
  const V = this.pointerHistory[this.pointerHistory.length - 1];
3737
3738
  if (V) {
3738
- const st = V.x - (s.x + jt), it = V.y - (s.y + Rt);
3739
+ const st = V.x - (s.x + jt), it = V.y - (s.y + Ot);
3739
3740
  kt = Math.atan2(it, st);
3740
3741
  }
3741
3742
  } else if (ut.type === U.TextPerspective) {
3742
3743
  const V = et.length / 2, st = (B - V) / V, it = 1 - Math.abs(st) * 0.3 * Ct;
3743
- _t *= it, xt *= it, nt += st * 20 * Ct;
3744
+ Pt *= it, xt *= it, nt += st * 20 * Ct;
3744
3745
  } else if (ut.type === U.TextMirror)
3745
3746
  At *= 0.8;
3746
3747
  else if (ut.type === U.TextFloral) {
3747
3748
  const V = ct.speed || 1, st = ct.stagger || 0.1, it = (rt * 1e-3 * V + B * st) % 2;
3748
- it < 1 && (_t *= it, xt *= it, kt += it * Math.PI);
3749
+ it < 1 && (Pt *= it, xt *= it, kt += it * Math.PI);
3749
3750
  } else if (ut.type === U.TextSmoke) {
3750
3751
  const V = ct.speed || 1, st = ct.height || 50, it = (rt * 5e-4 * V + B * 0.2) % 1;
3751
3752
  Z -= it * st * Ct, nt += Math.sin(rt * 2e-3 + B) * 5 * Ct, At = 1 - it;
3752
3753
  } else if (ut.type === U.TextVariable) {
3753
3754
  const V = ct.speed || 1, st = ct.intensity || 1.5, it = (Math.sin(rt * 4e-3 * V + B * 0.3) + 1) / 2;
3754
- _t *= 1 + it * (st - 1) * Ct;
3755
+ Pt *= 1 + it * (st - 1) * Ct;
3755
3756
  } else if (ut.type === U.TextZing) {
3756
3757
  const V = ct.speed || 2, st = ct.distance || 100, it = (rt * 2e-3 * V + B * 0.05) % 1;
3757
3758
  nt += (1 - it) * st * Ct, At = it;
@@ -3766,7 +3767,7 @@ class ci {
3766
3767
  Math.random() < 0.1 && (nt += (Math.random() - 0.5) * V, Z += (Math.random() - 0.5) * V, Math.random() < 0.05 && (At = 0.5));
3767
3768
  }
3768
3769
  });
3769
- let $ = null, Bt = o.textDecoration || "none", Kt = m;
3770
+ let $ = null, Wt = o.textDecoration || "none", Kt = m;
3770
3771
  if (o.enableSegments === !0 && ((ye = o.segments) == null ? void 0 : ye.length) > 0) {
3771
3772
  let ut = 0, ct = null;
3772
3773
  for (const Ct of o.segments) {
@@ -3783,19 +3784,19 @@ class ci {
3783
3784
  it.test(Ct) && (Ct = Ct.replace(it, "").trim());
3784
3785
  });
3785
3786
  const rt = this.mapFontWeight((ct.fontWeight || o.fontWeight || "400").toString()), V = ct.fontStyle || v;
3786
- Kt = ct.fontSize || m, t.font = `${V} ${rt} ${Kt}px "${Ct}", sans-serif`, ct.fill && ($ = ct.fill), ct.textDecoration && (Bt = ct.textDecoration), Kt < J && (Z += (J - Kt) * 0.85);
3787
+ Kt = ct.fontSize || m, t.font = `${V} ${rt} ${Kt}px "${Ct}", sans-serif`, ct.fill && ($ = ct.fill), ct.textDecoration && (Wt = ct.textDecoration), Kt < J && (Z += (J - Kt) * 0.85);
3787
3788
  }
3788
3789
  } else
3789
- t.font = I;
3790
+ t.font = M;
3790
3791
  const te = t.globalAlpha;
3791
3792
  t.globalAlpha *= At, t.save();
3792
3793
  const Jt = t.measureText(Mt).width;
3793
- if (O && D > 0) {
3794
- const ut = jt - Se + Jt / 2, Ct = (se + ut) / D, rt = this.getPointOnPath(O.geo, O.w, O.h, Math.abs(Ct % 1)), V = rt.angle, st = Rt + Z + (o.pathOffsetY || 0), it = o.pathSide === "right" ? -1 : 1, vt = Math.cos(V + Math.PI / 2) * st * it, Yt = Math.sin(V + Math.PI / 2) * st * it;
3794
+ if (R && D > 0) {
3795
+ const ut = jt - Se + Jt / 2, Ct = (se + ut) / D, rt = this.getPointOnPath(R.geo, R.w, R.h, Math.abs(Ct % 1)), V = rt.angle, st = Ot + Z + (o.pathOffsetY || 0), it = o.pathSide === "right" ? -1 : 1, vt = Math.cos(V + Math.PI / 2) * st * it, Yt = Math.sin(V + Math.PI / 2) * st * it;
3795
3796
  t.translate(rt.x + vt + nt, rt.y + Yt), t.rotate(V + kt + (it === -1 ? Math.PI : 0));
3796
3797
  } else
3797
- t.translate(jt + nt + Jt / 2, Rt + Z), kt !== 0 && t.rotate(kt);
3798
- if (t.scale(_t, xt), $ && !r && !f) {
3798
+ t.translate(jt + nt + Jt / 2, Ot + Z), kt !== 0 && t.rotate(kt);
3799
+ if (t.scale(Pt, xt), $ && !r && !f) {
3799
3800
  const ut = this.createCanvasFill(t, $, X, tt);
3800
3801
  t.fillStyle = ut || $.color || "#000000";
3801
3802
  } else if (!r && !f) {
@@ -3806,80 +3807,85 @@ class ci {
3806
3807
  if (r || f) {
3807
3808
  const ut = f ? "#000000" : this.createCanvasFill(t, e.fill, X, tt);
3808
3809
  t.fillStyle = ut || e.fill.color || "#ffffff", t.fillText(Mt, -Jt / 2, 0);
3809
- } else Et ? t.strokeText(Mt, -Jt / 2, 0) : t.fillText(Mt, -Jt / 2, 0);
3810
- Bt !== "none" && !r && this.drawTextDecoration(t, Bt, 0, 0, Jt, Kt), t.restore(), t.globalAlpha = te, k === "justify" && Ee > 0 && Mt === " " && !Pe ? jt += Jt + T + Ee : jt += Jt + T;
3810
+ } else _t ? t.strokeText(Mt, -Jt / 2, 0) : t.fillText(Mt, -Jt / 2, 0);
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;
3811
3812
  }
3812
3813
  }
3813
3814
  };
3814
3815
  if (r) {
3815
- let et = 0, mt = R;
3816
- (N || []).forEach((Rt) => {
3817
- const Et = Rt.text || "", dt = c.indexOf(Et, et);
3816
+ let et = 0, mt = O;
3817
+ (N || []).forEach((Ot) => {
3818
+ const _t = Ot.text || "", dt = c.indexOf(_t, et);
3818
3819
  dt !== -1 && (et = dt);
3819
- let Ot = -X / 2;
3820
- k === "center" ? Ot = 0 : k === "right" && (Ot = X / 2), ot(Et, Ot, mt, !1, et), et += Et.length, mt += A;
3820
+ let Ft = -X / 2;
3821
+ k === "center" ? Ft = 0 : k === "right" && (Ft = X / 2), ot(_t, Ft, mt, !1, et), et += _t.length, mt += A;
3821
3822
  });
3822
3823
  } else if (f) {
3823
- let et = 0, mt = R;
3824
- (N || []).forEach((Rt) => {
3825
- const Et = Rt.text || "";
3824
+ let et = 0, mt = O;
3825
+ (N || []).forEach((Ot) => {
3826
+ const _t = Ot.text || "";
3826
3827
  let dt = -X / 2;
3827
- k === "center" ? dt = 0 : k === "right" && (dt = X / 2), ot(Et, dt, mt, !1, et), et += Et.length, et < c.length && (c[et] === `
3828
+ k === "center" ? dt = 0 : k === "right" && (dt = X / 2), ot(_t, dt, mt, !1, et), et += _t.length, et < c.length && (c[et] === `
3828
3829
  ` || c[et] === "\r") && (et++, c[et - 1] === "\r" && c[et] === `
3829
3830
  ` && et++), mt += A;
3830
3831
  });
3831
3832
  } else {
3832
3833
  if (e.fill) {
3833
- const mt = t.globalAlpha, Rt = this.createCanvasFill(t, e.fill, X, tt);
3834
- t.fillStyle = Rt || e.fill.color || "#000000", t.globalAlpha = mt * this.normalizeOpacity(e.fill.opacity ?? 100);
3835
- const Et = G.fullText || (o.enableSegments ? (o.segments || []).map((zt) => {
3836
- let Wt = zt.text || "";
3837
- const $t = zt.textCase || o.textCase || "none";
3838
- return $t === "uppercase" ? Wt.toUpperCase() : $t === "lowercase" ? Wt.toLowerCase() : $t === "capitalize" ? Wt.replace(/\b\w/g, (Ht) => Ht.toUpperCase()) : Wt;
3834
+ const mt = t.globalAlpha, Ot = this.createCanvasFill(t, e.fill, X, tt);
3835
+ t.fillStyle = Ot || e.fill.color || "#000000", t.globalAlpha = mt * this.normalizeOpacity(e.fill.opacity ?? 100);
3836
+ const _t = G.fullText || (o.enableSegments ? (o.segments || []).map((Dt) => {
3837
+ let $t = Dt.text || "";
3838
+ const Rt = Dt.textCase || o.textCase || "none";
3839
+ return Rt === "uppercase" ? $t.toUpperCase() : Rt === "lowercase" ? $t.toLowerCase() : Rt === "capitalize" ? $t.replace(/\b\w/g, (Vt) => Vt.toUpperCase()) : $t;
3839
3840
  }).join("") : c);
3840
- let dt = 0, Ot = R;
3841
- (N || []).forEach((zt) => {
3842
- const Wt = zt.text || "";
3843
- let $t = -X / 2;
3844
- k === "center" ? $t = 0 : k === "right" && ($t = X / 2), ot(Wt, $t, Ot, !1, dt), dt += Wt.length, Ot += A, dt < Et.length && (Et[dt] === `
3845
- ` || Et[dt] === "\r") && (_ > 0 && (Ot += _), dt++, Et[dt - 1] === "\r" && Et[dt] === `
3841
+ let dt = 0, Ft = O;
3842
+ (N || []).forEach((Dt) => {
3843
+ const $t = Dt.text || "";
3844
+ let Rt = -X / 2;
3845
+ k === "center" ? Rt = 0 : k === "right" && (Rt = X / 2), ot($t, Rt, Ft, !1, dt), dt += $t.length, Ft += A, dt < _t.length && (_t[dt] === `
3846
+ ` || _t[dt] === "\r") && (_ > 0 && (Ft += _), dt++, _t[dt - 1] === "\r" && _t[dt] === `
3846
3847
  ` && dt++);
3847
3848
  }), t.globalAlpha = mt;
3848
3849
  }
3849
3850
  const et = o.paragraphRule;
3850
3851
  if (et && (((le = et.top) == null ? void 0 : le.width) > 0 || ((he = et.bottom) == null ? void 0 : he.width) > 0)) {
3851
3852
  let mt = 0;
3852
- (N || []).forEach((Rt, Et) => {
3853
- var zt, Wt;
3854
- const Ot = mt === 0 || mt < c.length && (c[mt] === `
3853
+ (N || []).forEach((Ot, _t) => {
3854
+ var Dt, $t;
3855
+ const Ft = mt === 0 || mt < c.length && (c[mt] === `
3855
3856
  ` || c[mt] === "\r");
3856
- if (Ot && Et > 0 && mt++, Ot) {
3857
- if (((zt = et.top) == null ? void 0 : zt.width) > 0) {
3858
- const $t = R + Et * A - et.top.offset;
3857
+ if (Ft && _t > 0 && mt++, Ft) {
3858
+ if (((Dt = et.top) == null ? void 0 : Dt.width) > 0) {
3859
+ const Rt = O + _t * A - et.top.offset;
3859
3860
  t.strokeStyle = et.top.color || "#000000", t.lineWidth = et.top.width, t.beginPath();
3860
- const Ht = -n / 2 + A * 0.2;
3861
- t.moveTo(Ht, $t), t.lineTo(n / 2 - A * 0.2, $t), t.stroke();
3861
+ const Vt = -n / 2 + A * 0.2;
3862
+ t.moveTo(Vt, Rt), t.lineTo(n / 2 - A * 0.2, Rt), t.stroke();
3862
3863
  }
3863
- if (((Wt = et.bottom) == null ? void 0 : Wt.width) > 0) {
3864
- const $t = R + (Et + 1) * A - et.bottom.offset;
3864
+ if ((($t = et.bottom) == null ? void 0 : $t.width) > 0) {
3865
+ const Rt = O + (_t + 1) * A - et.bottom.offset;
3865
3866
  t.strokeStyle = et.bottom.color || "#000000", t.lineWidth = et.bottom.width, t.beginPath();
3866
- const Ht = -n / 2 + A * 0.2;
3867
- t.moveTo(Ht, $t), t.lineTo(n / 2 - A * 0.2, $t), t.stroke();
3867
+ const Vt = -n / 2 + A * 0.2;
3868
+ t.moveTo(Vt, Rt), t.lineTo(n / 2 - A * 0.2, Rt), t.stroke();
3868
3869
  }
3869
3870
  }
3870
- mt += (Rt.text || "").length;
3871
+ mt += (Ot.text || "").length;
3871
3872
  });
3872
3873
  }
3873
3874
  if (e.stroke && e.stroke.width > 0) {
3874
3875
  const mt = t.globalAlpha;
3875
3876
  e.fill && e.fill.type !== "None" && e.fill.isEnabled !== !1 && e.fill.opacity !== 0 && e.fill.color !== "transparent" && e.fill.color !== "rgba(0,0,0,0)" && (t.shadowColor = "transparent", t.shadowBlur = 0, t.shadowOffsetX = 0, t.shadowOffsetY = 0), t.strokeStyle = e.stroke.color;
3876
- const Et = (Math.abs(h) + Math.abs(l)) / 2 || 1;
3877
- t.lineWidth = (e.stroke.width || 1) / Et, t.globalAlpha = mt * this.normalizeOpacity(e.stroke.opacity ?? 100);
3878
- let dt = 0, Ot = R;
3879
- (N || []).forEach((zt) => {
3880
- let Wt = -X / 2;
3881
- k === "center" ? Wt = 0 : k === "right" && (Wt = X / 2), ot(zt.text, Wt, Ot, !0, dt), dt += (zt.text || "").length, Ot += A, dt < c.length && (c[dt] === `
3882
- ` || c[dt] === "\r") && (_ > 0 && (Ot += _), dt++, c[dt - 1] === "\r" && c[dt] === `
3877
+ let _t = 1;
3878
+ if (this.rootTransform) {
3879
+ const Dt = t.getTransform(), $t = Math.sqrt(Dt.a * Dt.a + Dt.b * Dt.b) || 1, Rt = this.rootTransform, Vt = Math.sqrt(Rt.a * Rt.a + Rt.b * Rt.b) || 1;
3880
+ _t = $t / Vt;
3881
+ } else
3882
+ _t = (Math.abs(h) + Math.abs(l)) / 2 || 1;
3883
+ t.lineWidth = (e.stroke.width || 1) / (_t || 1), t.globalAlpha = mt * this.normalizeOpacity(e.stroke.opacity ?? 100);
3884
+ let dt = 0, Ft = O;
3885
+ (N || []).forEach((Dt) => {
3886
+ let $t = -X / 2;
3887
+ k === "center" ? $t = 0 : k === "right" && ($t = X / 2), ot(Dt.text, $t, Ft, !0, dt), dt += (Dt.text || "").length, Ft += A, dt < c.length && (c[dt] === `
3888
+ ` || c[dt] === "\r") && (_ > 0 && (Ft += _), dt++, c[dt - 1] === "\r" && c[dt] === `
3883
3889
  ` && dt++);
3884
3890
  }), t.globalAlpha = mt;
3885
3891
  }
@@ -3887,7 +3893,14 @@ class ci {
3887
3893
  }
3888
3894
  applyStrokeAlignment(t, i, o, e, s, n, a = 1, r = 1) {
3889
3895
  if (!i.stroke || i.stroke.width <= 0 || i.stroke.isEnabled === !1) return;
3890
- const f = i.stroke, h = (Math.abs(a) + Math.abs(r)) / 2 || 1, l = (f.width || 1) / h, p = (f.alignment || "center").toLowerCase();
3896
+ const f = i.stroke;
3897
+ let h = 1;
3898
+ if (this.rootTransform) {
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;
3900
+ h = C / M;
3901
+ } else
3902
+ h = (Math.abs(a) + Math.abs(r)) / 2 || 1;
3903
+ const l = (f.width || 1) / (h || 1), p = (f.alignment || "center").toLowerCase();
3891
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), f.fill) {
3892
3905
  const S = this.createCanvasFill(t, f.fill, e, s);
3893
3906
  S ? t.strokeStyle = S : t.strokeStyle = f.color || "#000000";
@@ -3901,13 +3914,13 @@ class ci {
3901
3914
  if (S > 0) {
3902
3915
  const C = Math.max(0, Math.min(1, u)), w = Math.max(0, Math.min(1, v));
3903
3916
  if (C < w) {
3904
- const I = S * (w - C), M = S - I, k = -(S * (C + b % 1));
3905
- t.setLineDash([I, M]), t.lineDashOffset = k + m * S;
3917
+ const M = S * (w - C), I = S - M, k = -(S * (C + b % 1));
3918
+ t.setLineDash([M, I]), t.lineDashOffset = k + m * S;
3906
3919
  } else if (C === w)
3907
3920
  t.setLineDash([0, S]);
3908
3921
  else {
3909
- const I = S * (1 - C + w), M = S - I, k = -(S * C);
3910
- t.setLineDash([I, M]), t.lineDashOffset = k + m * S;
3922
+ const M = S * (1 - C + w), I = S - M, k = -(S * C);
3923
+ t.setLineDash([M, I]), t.lineDashOffset = k + m * S;
3911
3924
  }
3912
3925
  }
3913
3926
  } else y.length > 0 && (t.setLineDash(y), t.lineDashOffset = m);
@@ -3960,7 +3973,7 @@ class ci {
3960
3973
  f.x,
3961
3974
  f.y
3962
3975
  ) : 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)) {
3963
- const d = n, u = a, v = [...e.slice(0, r + 1)].reverse().find((I) => I.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
+ 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;
3964
3977
  y !== void 0 || C !== void 0 ? s += this.getBezierLength(
3965
3978
  d,
3966
3979
  u,
@@ -3982,8 +3995,8 @@ class ci {
3982
3995
  getBezierLength(t, i, o, e, s, n, a, r, f = 10) {
3983
3996
  let h = 0, l = t, p = i;
3984
3997
  for (let c = 1; c <= f; c++) {
3985
- 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, I = C - p;
3986
- h += Math.sqrt(w * w + I * I), l = S, p = C;
3998
+ 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;
3999
+ h += Math.sqrt(w * w + M * M), l = S, p = C;
3987
4000
  }
3988
4001
  return h;
3989
4002
  }
@@ -3991,7 +4004,7 @@ class ci {
3991
4004
  if (t <= 0) return 0;
3992
4005
  let l = 0, p = i, c = o;
3993
4006
  for (let d = 1; d <= h; d++) {
3994
- 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, I = C - p, M = w - c, k = Math.sqrt(I * I + M * M);
4007
+ 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);
3995
4008
  if (l + k >= t) {
3996
4009
  const T = t - l, L = k === 0 ? 0 : T / k;
3997
4010
  return (d - 1 + L) / h;
@@ -4025,13 +4038,13 @@ class ci {
4025
4038
  let C = 0;
4026
4039
  const w = y.out_x !== void 0 || S.in_x !== void 0;
4027
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]) {
4028
- let I = 0;
4041
+ let M = 0;
4029
4042
  if (w)
4030
- return I = 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(I, 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, h, l);
4031
4044
  {
4032
- I = C === 0 ? 0 : (c - d) / C;
4033
- const M = y.x + (S.x - y.x) * I - h, k = y.y + (S.y - y.y) * I - l, T = Math.atan2(S.y - y.y, S.x - y.x);
4034
- return { x: M, y: k, angle: T };
4045
+ M = C === 0 ? 0 : (c - d) / C;
4046
+ 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);
4047
+ return { x: I, y: k, angle: T };
4035
4048
  }
4036
4049
  }
4037
4050
  d += C;
@@ -4047,8 +4060,8 @@ class ci {
4047
4060
  return { x: 0, y: 0, angle: 0 };
4048
4061
  }
4049
4062
  getBezierPointAndAngle(t, i, o, e, s) {
4050
- 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), I = Math.atan2(w, C);
4051
- return { x: y, y: S, angle: I };
4063
+ 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);
4064
+ return { x: y, y: S, angle: M };
4052
4065
  }
4053
4066
  applyAbsoluteTransform(t, i, o) {
4054
4067
  if (!o.get(i)) return;
@@ -4098,8 +4111,8 @@ class ci {
4098
4111
  y.width = m, y.height = Math.floor(s / p);
4099
4112
  const S = y.getContext("2d"), C = S.createImageData(y.width, y.height);
4100
4113
  for (let w = 0; w < C.data.length; w += 4) {
4101
- const I = Math.random() > 0.95 ? 150 : 255;
4102
- C.data[w] = I, C.data[w + 1] = I, C.data[w + 2] = I, C.data[w + 3] = 255 * h;
4114
+ const M = Math.random() > 0.95 ? 150 : 255;
4115
+ C.data[w] = M, C.data[w + 1] = M, C.data[w + 2] = M, C.data[w + 3] = 255 * h;
4103
4116
  }
4104
4117
  S.putImageData(C, 0, 0), t.globalCompositeOperation = "multiply", t.imageSmoothingEnabled = !1, t.drawImage(y, -e / 2, -s / 2, e, s);
4105
4118
  } else if (f === "acid_gradient" || f === "acid_rave") {
@@ -4108,8 +4121,8 @@ class ci {
4108
4121
  const w = m * 60 % 360;
4109
4122
  C.addColorStop(0, this._shiftHue(y, w, h * 0.7)), C.addColorStop(1, this._shiftHue(S, (w + 180) % 360, h * 0.7));
4110
4123
  } else {
4111
- const w = m * 100 % 360, I = (w + 180) % 360;
4112
- C.addColorStop(0, `hsla(${w}, 80%, 50%, ${h * 0.5})`), C.addColorStop(1, `hsla(${I}, 80%, 50%, ${h * 0.5})`);
4124
+ const w = m * 100 % 360, M = (w + 180) % 360;
4125
+ C.addColorStop(0, `hsla(${w}, 80%, 50%, ${h * 0.5})`), C.addColorStop(1, `hsla(${M}, 80%, 50%, ${h * 0.5})`);
4113
4126
  }
4114
4127
  t.fillStyle = C, t.globalCompositeOperation = "screen", t.fillRect(-e / 2, -s / 2, e, s);
4115
4128
  } else if (f === "halftone") {
@@ -4146,20 +4159,20 @@ class ci {
4146
4159
  const w = y.getContext("2d");
4147
4160
  if (w) {
4148
4161
  w.imageSmoothingEnabled = !1;
4149
- const I = t.getTransform(), M = I.e - e / 2, k = I.f - s / 2;
4150
- w.drawImage(t.canvas, M, 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;
4162
+ const M = t.getTransform(), I = M.e - e / 2, k = M.f - s / 2;
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;
4151
4164
  }
4152
4165
  } else if (f === "glitch") {
4153
4166
  const m = this.currentTime * l, y = r.chaosAmount ?? 0.2, S = Math.max(3, Math.floor(8 * h)), C = h * e * 0.15;
4154
4167
  t.globalCompositeOperation = "screen", t.globalAlpha = h * 0.4;
4155
4168
  const w = C * 0.3;
4156
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;
4157
- const I = s / S;
4158
- for (let M = 0; M < S; M++) {
4159
- const k = Math.sin(M * 127.1 + m * 311.7 * l) * 43758.5, T = k - Math.floor(k);
4170
+ const M = s / S;
4171
+ for (let I = 0; I < S; I++) {
4172
+ const k = Math.sin(I * 127.1 + m * 311.7 * l) * 43758.5, T = k - Math.floor(k);
4160
4173
  if (T > 1 - y) {
4161
- const L = (T - (1 - y)) / y * C * (Math.random() > 0.5 ? 1 : -1), P = -s / 2 + M * I, _ = t.getTransform(), E = _.e - e / 2 + L, A = _.f + P;
4162
- t.save(), t.beginPath(), t.rect(-e / 2, P, e, I), t.clip(), t.globalAlpha = 0.8, t.drawImage(t.canvas, E, A, e, I, -e / 2 + L, P, e, I), t.restore();
4174
+ const L = (T - (1 - y)) / y * C * (Math.random() > 0.5 ? 1 : -1), P = -s / 2 + I * M, _ = t.getTransform(), E = _.e - e / 2 + L, A = _.f + P;
4175
+ t.save(), t.beginPath(), t.rect(-e / 2, P, e, M), t.clip(), t.globalAlpha = 0.8, t.drawImage(t.canvas, E, A, e, M, -e / 2 + L, P, e, M), t.restore();
4163
4176
  }
4164
4177
  }
4165
4178
  }
@@ -4331,11 +4344,11 @@ class ci {
4331
4344
  }
4332
4345
  }
4333
4346
  renderInputBox(t, i) {
4334
- var R, O;
4335
- 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];
4336
- 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", I = e.placeholderColor || "rgba(156, 163, 175, 1)", M = e.fontSize || 14;
4347
+ var O, R;
4348
+ const o = this.objectStates.get(i.id), e = (o == null ? void 0 : o.options) || i.options || {}, s = ((O = i.geometry) == null ? void 0 : O.width) || 250, n = ((R = i.geometry) == null ? void 0 : R.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];
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;
4337
4350
  const k = `${h}Style`, T = e[k];
4338
- 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 && (I = T.placeholderColor), T.fontSize !== void 0 && (M = 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);
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)) : 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);
4339
4352
  const L = this.createCanvasFill(t, y, s, n);
4340
4353
  if (L && (t.fillStyle = L, t.fill()), C > 0) {
4341
4354
  const D = this.createCanvasFill(t, S, s, n);
@@ -4347,15 +4360,15 @@ class ci {
4347
4360
  }
4348
4361
  const P = (D, q) => {
4349
4362
  if (!D.visible || !D.svgPath) return;
4350
- const ot = D.size || 14, yt = D.offset ?? 16, bt = D.color || "#ffffff", gt = q ? -(s / 2) + yt : s / 2 - yt, Pt = D.svgPath;
4351
- if (t.save(), t.translate(gt, 0), !Pt.startsWith("<svg")) {
4352
- const It = new Path2D(Pt), St = ot / 24;
4363
+ const ot = D.size || 14, yt = D.offset ?? 16, bt = D.color || "#ffffff", gt = q ? -(s / 2) + yt : s / 2 - yt, Et = D.svgPath;
4364
+ if (t.save(), t.translate(gt, 0), !Et.startsWith("<svg")) {
4365
+ const It = new Path2D(Et), St = ot / 24;
4353
4366
  t.scale(St, St), t.translate(-12, -12), t.fillStyle = bt, t.fill(It);
4354
4367
  }
4355
4368
  t.restore();
4356
4369
  };
4357
4370
  P(c, !0), P(d, !1);
4358
- const _ = e.text || "", E = e.placeholder || "Enter text...", A = !_, W = _ || E, z = A ? I : w, Y = M, G = e.fontFamily || "Inter", N = e.fontWeight || 400;
4371
+ const _ = e.text || "", E = e.placeholder || "Enter text...", A = !_, W = _ || E, z = A ? M : w, Y = I, G = e.fontFamily || "Inter", N = e.fontWeight || 400;
4359
4372
  t.font = `${N} ${Y}px "${G}", sans-serif`, t.fillStyle = z, t.textAlign = "left", t.textBaseline = u ? "top" : "middle";
4360
4373
  const J = e.inputPadding ?? 16, x = c.visible ? (c.offset ?? 16) + (c.size || 14) / 2 + 8 : J, F = d.visible ? (d.offset ?? 16) + (d.size || 14) / 2 + 8 : J, j = -(s / 2) + x, X = s - x - F, tt = e.inputType === "password" ? "•".repeat(W.length) : W;
4361
4374
  if (t.save(), t.beginPath(), t.rect(j - 2, -n / 2 + 4, X + 4, n - 8), t.clip(), u) {
@@ -4365,11 +4378,11 @@ class ci {
4365
4378
  const ot = Y * 1.2;
4366
4379
  let yt = 0;
4367
4380
  D.forEach((bt, gt) => {
4368
- const Pt = bt.split(" ");
4381
+ const Et = bt.split(" ");
4369
4382
  let It = "";
4370
- for (let St = 0; St < Pt.length; St++) {
4371
- const Xt = It + Pt[St] + " ";
4372
- t.measureText(Xt).width > X && St > 0 ? (t.fillText(It, j, q), It = Pt[St] + " ", q += ot) : It = Xt;
4383
+ for (let St = 0; St < Et.length; St++) {
4384
+ const Xt = It + Et[St] + " ";
4385
+ t.measureText(Xt).width > X && St > 0 ? (t.fillText(It, j, q), It = Et[St] + " ", q += ot) : It = Xt;
4373
4386
  }
4374
4387
  t.fillText(It, j, q), yt = t.measureText(It).width, gt < D.length - 1 && (q += ot, yt = 0);
4375
4388
  }), a && !A && Math.floor(performance.now() / 500) % 2 === 0 && t.fillRect(j + yt, q, 1.5, Y);
@@ -4395,12 +4408,12 @@ class ci {
4395
4408
  }
4396
4409
  }
4397
4410
  renderSlider(t, i) {
4398
- 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", I = s.thumbPath || "", M = 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, 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, O, R, D, q, ot) => {
4399
4412
  if ((X === "Custom" || X === "Icon") && ot)
4400
4413
  try {
4401
4414
  const yt = new Path2D(ot);
4402
- if (t.save(), t.translate(tt, R), X === "Icon") {
4403
- const bt = Math.min(O, D) / 24;
4415
+ if (t.save(), t.translate(tt, O), X === "Icon") {
4416
+ const bt = Math.min(R, D) / 24;
4404
4417
  t.scale(bt, bt), t.translate(-12, -12);
4405
4418
  }
4406
4419
  t.fill(yt), t.restore();
@@ -4409,28 +4422,28 @@ class ci {
4409
4422
  console.error("Error drawing slider shape in engine:", yt);
4410
4423
  }
4411
4424
  if (t.beginPath(), X === "Ellipse")
4412
- t.ellipse(tt, R, O / 2, D / 2, 0, 0, Math.PI * 2);
4425
+ t.ellipse(tt, O, R / 2, D / 2, 0, 0, Math.PI * 2);
4413
4426
  else if (X === "Rectangle")
4414
- this.drawRoundRect(t, tt - O / 2, R - D / 2, O, D, q);
4427
+ this.drawRoundRect(t, tt - R / 2, O - D / 2, R, D, q);
4415
4428
  else if (X === "Triangle")
4416
- t.moveTo(tt, R - D / 2), t.lineTo(tt + O / 2, R + D / 2), t.lineTo(tt - O / 2, R + D / 2), t.closePath();
4429
+ t.moveTo(tt, O - D / 2), t.lineTo(tt + R / 2, O + D / 2), t.lineTo(tt - R / 2, O + D / 2), t.closePath();
4417
4430
  else if (X === "Diamond")
4418
- t.moveTo(tt, R - D / 2), t.lineTo(tt + O / 2, R), t.lineTo(tt, R + D / 2), t.lineTo(tt - O / 2, R), t.closePath();
4431
+ t.moveTo(tt, O - D / 2), t.lineTo(tt + R / 2, O), t.lineTo(tt, O + D / 2), t.lineTo(tt - R / 2, O), t.closePath();
4419
4432
  else if (X === "Polygon") {
4420
- const yt = i.geometry.sides || 3, bt = i.geometry.radius || Math.min(O, D) / 2;
4433
+ const yt = i.geometry.sides || 3, bt = i.geometry.radius || Math.min(R, D) / 2;
4421
4434
  for (let gt = 0; gt < yt; gt++) {
4422
- const Pt = gt * 2 * Math.PI / yt - Math.PI / 2, It = tt + bt * Math.cos(Pt), St = R + bt * Math.sin(Pt);
4435
+ const Et = gt * 2 * Math.PI / yt - Math.PI / 2, It = tt + bt * Math.cos(Et), St = O + bt * Math.sin(Et);
4423
4436
  gt === 0 ? t.moveTo(It, St) : t.lineTo(It, St);
4424
4437
  }
4425
4438
  t.closePath();
4426
4439
  } else if (X === "Star") {
4427
- const bt = Math.min(O, D) / 2, gt = bt / 2;
4428
- for (let Pt = 0; Pt < 10; Pt++) {
4429
- const It = Pt % 2 === 0 ? bt : gt, St = Pt * Math.PI / 5 - Math.PI / 2;
4430
- t.lineTo(tt + It * Math.cos(St), R + It * Math.sin(St));
4440
+ const bt = Math.min(R, D) / 2, gt = bt / 2;
4441
+ for (let Et = 0; Et < 10; Et++) {
4442
+ const It = Et % 2 === 0 ? bt : gt, St = Et * Math.PI / 5 - Math.PI / 2;
4443
+ t.lineTo(tt + It * Math.cos(St), O + It * Math.sin(St));
4431
4444
  }
4432
4445
  t.closePath();
4433
- } else X === "Line" && (t.moveTo(tt - O / 2, R), t.lineTo(tt + O / 2, R));
4446
+ } else X === "Line" && (t.moveTo(tt - R / 2, O), t.lineTo(tt + R / 2, O));
4434
4447
  t.fill();
4435
4448
  }, A = this.createCanvasFill(t, b, n, p);
4436
4449
  A && (t.fillStyle = A, t.strokeStyle = A), d === "Line" ? (t.lineWidth = p, t.beginPath(), t.moveTo(-n / 2, 0), t.lineTo(n / 2, 0), t.stroke()) : E(d, 0, 0, n, p, c, u);
@@ -4443,24 +4456,24 @@ class ci {
4443
4456
  const G = t.getTransform(), N = Math.sqrt(G.a * G.a + G.b * G.b) || 1;
4444
4457
  t.shadowColor = "rgba(0,0,0,0.2)", t.shadowBlur = 4 * N, t.shadowOffsetY = 1 * N;
4445
4458
  const J = this.createCanvasFill(t, w, y, S);
4446
- if (J && (t.fillStyle = J), E(m, 0, 0, y, S, C, m === "Icon" ? M : I), t.restore(), k) {
4459
+ if (J && (t.fillStyle = J), E(m, 0, 0, y, S, C, m === "Icon" ? I : M), t.restore(), k) {
4447
4460
  t.save(), t.translate(z + P, _);
4448
4461
  const X = Math.round(a).toString();
4449
4462
  t.font = "10px Inter, sans-serif";
4450
- const tt = t.measureText(X), R = 6, O = 4, D = tt.width + R * 2, q = 14 + O;
4463
+ const tt = t.measureText(X), O = 6, R = 4, D = tt.width + O * 2, q = 14 + R;
4451
4464
  t.beginPath(), this.drawRoundRect(t, -D / 2, -q / 2, D, q, 4), t.fillStyle = T, t.fill(), t.fillStyle = L, t.textAlign = "center", t.textBaseline = "middle", t.fillText(X, 0, 0), t.restore();
4452
4465
  }
4453
4466
  const x = s.label || {}, F = s.helperText || {}, j = s.fontFamily || "Inter";
4454
4467
  if (x.visible !== !1) {
4455
- const X = x.text || "Label", tt = x.fontSize || 12, R = x.color || "rgba(156, 163, 175, 1)", O = x.offset ?? 8;
4456
- t.font = `600 ${tt}px "${j}", sans-serif`, t.fillStyle = R, t.textAlign = "left", t.textBaseline = "bottom";
4457
- const D = -(n / 2), q = -(p / 2) - O;
4468
+ const X = x.text || "Label", tt = x.fontSize || 12, O = x.color || "rgba(156, 163, 175, 1)", R = x.offset ?? 8;
4469
+ t.font = `600 ${tt}px "${j}", sans-serif`, t.fillStyle = O, t.textAlign = "left", t.textBaseline = "bottom";
4470
+ const D = -(n / 2), q = -(p / 2) - R;
4458
4471
  t.fillText(X, D, q);
4459
4472
  }
4460
4473
  if (F.visible === !0) {
4461
- const X = F.text || "Helper text", tt = F.fontSize || 11, R = F.color || "rgba(156, 163, 175, 1)", O = F.offset ?? 6;
4462
- t.font = `400 ${tt}px "${j}", sans-serif`, t.fillStyle = R, t.textAlign = "left", t.textBaseline = "top";
4463
- const D = -(n / 2), q = p / 2 + O;
4474
+ const X = F.text || "Helper text", tt = F.fontSize || 11, O = F.color || "rgba(156, 163, 175, 1)", R = F.offset ?? 6;
4475
+ t.font = `400 ${tt}px "${j}", sans-serif`, t.fillStyle = O, t.textAlign = "left", t.textBaseline = "top";
4476
+ const D = -(n / 2), q = p / 2 + R;
4464
4477
  t.fillText(X, D, q);
4465
4478
  }
4466
4479
  }
@@ -4493,8 +4506,8 @@ class ci {
4493
4506
  }
4494
4507
  t.restore();
4495
4508
  }
4496
- const w = e.selectedOption || e.placeholder || "Select...", I = e.fontSize || 14, M = e.fontWeight || 400, k = e.fontFamily || "Inter, sans-serif";
4497
- t.font = `${M} ${I}px ${k}`;
4509
+ const w = e.selectedOption || e.placeholder || "Select...", M = e.fontSize || 14, I = e.fontWeight || 400, k = e.fontFamily || "Inter, sans-serif";
4510
+ t.font = `${I} ${M}px ${k}`;
4498
4511
  const T = h ? e.disabledColor || "#9ca3af" : !e.selectedOption && e.placeholder ? "#9ca3af" : u;
4499
4512
  t.fillStyle = this.createCanvasFill(t, typeof T == "string" ? { type: "Solid", color: T } : T, s, n) || "#333333", t.textAlign = "left", t.textBaseline = "middle";
4500
4513
  const L = y === "none" ? 0 : S + 8, P = s - m * 2 - L;
@@ -4505,16 +4518,16 @@ class ci {
4505
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();
4506
4519
  const F = e.listBorderWidth ?? 1;
4507
4520
  F > 0 && (t.shadowColor = "transparent", t.strokeStyle = this.createCanvasFill(t, typeof e.listBorderColor == "string" ? { type: "Solid", color: e.listBorderColor } : e.listBorderColor || { type: "Solid", color: d }, s, Y) || "#e5e7eb", t.lineWidth = F, t.stroke()), t.restore();
4508
- const j = e.itemFontSize || I, X = e.itemFontFamily || k;
4509
- t.font = `${M} ${j}px ${X}`, A.forEach((tt, R) => {
4510
- const O = E + z + R * W;
4521
+ const j = e.itemFontSize || M, X = e.itemFontFamily || k;
4522
+ t.font = `${I} ${j}px ${X}`, A.forEach((tt, O) => {
4523
+ const R = E + z + O * W;
4511
4524
  if (tt === e.selectedOption)
4512
- t.fillStyle = this.createCanvasFill(t, typeof e.itemSelectedBackgroundColor == "string" ? { type: "Solid", color: e.itemSelectedBackgroundColor } : e.itemSelectedBackgroundColor || { type: "Solid", color: "#f3f4f6" }, s, W) || "#f3f4f6", t.fillRect(a + F, O, s - F * 2, W), t.fillStyle = e.itemSelectedColor || e.accentColor || u || "#374151";
4525
+ t.fillStyle = this.createCanvasFill(t, typeof e.itemSelectedBackgroundColor == "string" ? { type: "Solid", color: e.itemSelectedBackgroundColor } : e.itemSelectedBackgroundColor || { type: "Solid", color: "#f3f4f6" }, s, W) || "#f3f4f6", t.fillRect(a + F, R, s - F * 2, W), t.fillStyle = e.itemSelectedColor || e.accentColor || u || "#374151";
4513
4526
  else if (t.fillStyle = e.listTextColor || u || "#333333", this.activeDropdownId === i.id && this._lastPointerPos) {
4514
4527
  const q = this._lastPointerPos.y - (E + z), ot = Math.floor(q / W);
4515
- R === ot && (t.fillStyle = this.createCanvasFill(t, typeof e.itemHoverBackgroundColor == "string" ? { type: "Solid", color: e.itemHoverBackgroundColor } : e.itemHoverBackgroundColor || { type: "Solid", color: "#f9fafb" }, s, W) || "#f9fafb", t.fillRect(a + F, O, s - F * 2, W), t.fillStyle = e.itemHoverColor || u);
4528
+ O === ot && (t.fillStyle = this.createCanvasFill(t, typeof e.itemHoverBackgroundColor == "string" ? { type: "Solid", color: e.itemHoverBackgroundColor } : e.itemHoverBackgroundColor || { type: "Solid", color: "#f9fafb" }, s, W) || "#f9fafb", t.fillRect(a + F, R, s - F * 2, W), t.fillStyle = e.itemHoverColor || u);
4516
4529
  }
4517
- t.fillText(tt, a + m, O + W / 2);
4530
+ t.fillText(tt, a + m, R + W / 2);
4518
4531
  });
4519
4532
  }
4520
4533
  t.globalAlpha = v;
@@ -4526,13 +4539,13 @@ class ci {
4526
4539
  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);
4527
4540
  const C = -n / 2, w = -a / 2;
4528
4541
  t.save(), t.scale(S, S), t.beginPath(), this.drawRoundRect(t, C, w, n, a, b);
4529
- const I = this.createCanvasFill(t, d, n, a);
4530
- I && (t.fillStyle = I, t.fill()), (y > 0 || r && l.borderColor) && (t.strokeStyle = m, t.lineWidth = y || (r ? 1 : 0), t.stroke());
4531
- const M = h.fontSize || 14, k = h.fontFamily || "Inter", T = h.fontWeight || 600;
4532
- t.font = `${T} ${M}px "${k}", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif`, t.fillStyle = u, t.textAlign = "center", t.textBaseline = "middle";
4542
+ const M = this.createCanvasFill(t, d, n, a);
4543
+ M && (t.fillStyle = M, t.fill()), (y > 0 || r && l.borderColor) && (t.strokeStyle = m, t.lineWidth = y || (r ? 1 : 0), t.stroke());
4544
+ const I = h.fontSize || 14, k = h.fontFamily || "Inter", T = h.fontWeight || 600;
4545
+ t.font = `${T} ${I}px "${k}", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif`, t.fillStyle = u, t.textAlign = "center", t.textBaseline = "middle";
4533
4546
  let L = 0;
4534
4547
  if (c.enabled && c.svgPath) {
4535
- const P = M * 1.1, _ = c.gap || 8, E = t.measureText(v), W = -(E.width + P + _) / 2, z = c.position === "left" ? W + P / 2 : W + E.width + _ + P / 2;
4548
+ const P = I * 1.1, _ = c.gap || 8, E = t.measureText(v), W = -(E.width + P + _) / 2, z = c.position === "left" ? W + P / 2 : W + E.width + _ + P / 2;
4536
4549
  L = c.position === "left" ? W + P + _ + E.width / 2 : W + E.width / 2, t.save(), t.translate(z, 0);
4537
4550
  const Y = new Path2D(c.svgPath), G = P / 24;
4538
4551
  t.scale(G, G), t.translate(-12, -12), t.fillStyle = u, t.fill(Y), t.restore();
@@ -4547,7 +4560,7 @@ class ci {
4547
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();
4548
4561
  }
4549
4562
  renderToggle(t, i) {
4550
- var G, N, J, x, F, j, X, tt, R, O, D, q;
4563
+ var G, N, J, x, F, j, X, tt, O, R, D, q;
4551
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, 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";
4552
4565
  e.disabled && (t.globalAlpha *= 0.5), t.beginPath(), this.drawRoundRect(t, a, r, s, n, h);
4553
4566
  const S = this.createCanvasFill(t, v, s, n);
@@ -4556,8 +4569,8 @@ class ci {
4556
4569
  const ot = this.createCanvasFill(t, b, s, n);
4557
4570
  ot && (t.strokeStyle = ot, t.stroke());
4558
4571
  }
4559
- const C = 2, w = n - C * 2, I = w / 2, M = a + C, k = a + s - C - w, T = f ? k : M, L = r + C;
4560
- t.beginPath(), t.arc(T + I, L + I, I, 0, Math.PI * 2);
4572
+ 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;
4573
+ t.beginPath(), t.arc(T + M, L + M, M, 0, Math.PI * 2);
4561
4574
  const P = this.createCanvasFill(t, y, w, w);
4562
4575
  P && (t.fillStyle = P, t.fill()), e.disabled && (t.globalAlpha *= 2);
4563
4576
  let _ = !1, E = !1;
@@ -4566,7 +4579,7 @@ class ci {
4566
4579
  const ot = e.leftLabel;
4567
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;
4568
4581
  }
4569
- 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 = (f ? (tt = l.rightLabel) == null ? void 0 : tt.text : null) || ((O = e.rightLabel) == null ? void 0 : O.text) || "", Y = (f ? (R = l.rightLabel) == null ? void 0 : R.color : null) || ((D = e.rightLabel) == null ? void 0 : D.color) || "#f3f4f6";
4570
4583
  if ((q = e.rightLabel) != null && q.enabled && z) {
4571
4584
  const ot = e.rightLabel;
4572
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;
@@ -4574,9 +4587,9 @@ class ci {
4574
4587
  if (!_ && !E && e.label && e.label.text) {
4575
4588
  const ot = e.label, yt = ot.fontSize || 14, bt = ot.fontWeight || 400, gt = ot.fontFamily || "Inter";
4576
4589
  t.font = `${bt} ${yt}px "${gt}", sans-serif`, t.fillStyle = ot.color || "#f3f4f6", t.textBaseline = "middle";
4577
- const Pt = ot.gap || 10;
4590
+ const Et = ot.gap || 10;
4578
4591
  let It = 0, St = 0;
4579
- ot.position === "left" ? (t.textAlign = "right", It = a - Pt, St = 0) : ot.position === "right" ? (t.textAlign = "left", It = a + s + Pt, St = 0) : ot.position === "top" ? (t.textAlign = "center", It = 0, St = r - Pt, t.textBaseline = "bottom") : ot.position === "bottom" ? (t.textAlign = "center", It = 0, St = r + n + Pt, t.textBaseline = "top") : (t.textAlign = "left", It = a + s + Pt, St = 0), t.fillText(ot.text, It, St);
4592
+ ot.position === "left" ? (t.textAlign = "right", It = a - Et, St = 0) : ot.position === "right" ? (t.textAlign = "left", It = a + s + Et, St = 0) : ot.position === "top" ? (t.textAlign = "center", It = 0, St = r - Et, t.textBaseline = "bottom") : ot.position === "bottom" ? (t.textAlign = "center", It = 0, St = r + n + Et, t.textBaseline = "top") : (t.textAlign = "left", It = a + s + Et, St = 0), t.fillText(ot.text, It, St);
4580
4593
  }
4581
4594
  }
4582
4595
  renderCheckbox(t, i) {
@@ -4597,15 +4610,15 @@ class ci {
4597
4610
  t.save(), t.beginPath();
4598
4611
  const w = this.createCanvasFill(t, c, s, n);
4599
4612
  t.strokeStyle = w || c, t.lineWidth = Math.max(2, s * 0.12), t.lineCap = "round", t.lineJoin = "round";
4600
- const I = a + s * 0.25, M = r + n * 0.5, k = a + s * 0.45, T = r + n * 0.7, L = a + s * 0.75, P = r + n * 0.25;
4601
- t.moveTo(I, M), t.lineTo(k, T), t.lineTo(L, P), t.stroke(), t.restore();
4613
+ const M = a + s * 0.25, I = r + n * 0.5, k = a + s * 0.45, T = r + n * 0.7, L = a + s * 0.75, P = r + n * 0.25;
4614
+ t.moveTo(M, I), t.lineTo(k, T), t.lineTo(L, P), t.stroke(), t.restore();
4602
4615
  }
4603
4616
  if (e.disabled && (t.globalAlpha *= 2), e.label && e.label.text) {
4604
4617
  const w = e.label;
4605
4618
  t.save(), t.font = `${w.fontWeight || 400} ${w.fontSize || 14}px "${w.fontFamily || "Inter"}", sans-serif`, t.fillStyle = w.color || "#f3f4f6", t.textBaseline = "middle";
4606
- const I = w.gap || 8;
4607
- let M = 0, k = 0;
4608
- w.position === "left" ? (t.textAlign = "right", M = a - I, k = 0) : w.position === "right" ? (t.textAlign = "left", M = a + s + I, k = 0) : w.position === "top" ? (t.textAlign = "center", M = 0, k = r - I, t.textBaseline = "bottom") : w.position === "bottom" && (t.textAlign = "center", M = 0, k = r + n + I, t.textBaseline = "top"), t.fillText(w.text, M, k), t.restore();
4619
+ const M = w.gap || 8;
4620
+ let I = 0, k = 0;
4621
+ w.position === "left" ? (t.textAlign = "right", I = a - M, k = 0) : w.position === "right" ? (t.textAlign = "left", I = a + s + M, k = 0) : w.position === "top" ? (t.textAlign = "center", I = 0, k = r - M, t.textBaseline = "bottom") : w.position === "bottom" && (t.textAlign = "center", I = 0, k = r + n + M, t.textBaseline = "top"), t.fillText(w.text, I, k), t.restore();
4609
4622
  }
4610
4623
  }
4611
4624
  renderRadioGroup(t, i) {
@@ -4614,28 +4627,28 @@ class ci {
4614
4627
  e.disabled && (t.globalAlpha *= 0.5);
4615
4628
  const y = 8, S = y * 2;
4616
4629
  if (t.save(), t.font = `${m} ${v}px "${b}", sans-serif`, t.textBaseline = "middle", t.textAlign = "left", l === "vertical") {
4617
- const I = Math.max(S, v) + p;
4618
- h.forEach((M, k) => {
4619
- const T = r + k * I + y;
4630
+ const M = Math.max(S, v) + p;
4631
+ h.forEach((I, k) => {
4632
+ const T = r + k * M + y;
4620
4633
  t.beginPath(), t.arc(a + y, T, y, 0, Math.PI * 2);
4621
- const L = f === M, P = this.createCanvasFill(t, c, S, S), _ = this.createCanvasFill(t, d, S, S);
4622
- 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(M, a + S + 8, T);
4634
+ const L = f === I, P = this.createCanvasFill(t, c, S, S), _ = this.createCanvasFill(t, d, S, S);
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);
4623
4636
  });
4624
4637
  } else {
4625
- let I = a;
4626
- h.forEach((M) => {
4627
- const k = f === M, T = t.measureText(M).width;
4628
- t.beginPath(), t.arc(I + y, 0, y, 0, Math.PI * 2);
4638
+ let M = a;
4639
+ h.forEach((I) => {
4640
+ const k = f === I, T = t.measureText(I).width;
4641
+ t.beginPath(), t.arc(M + y, 0, y, 0, Math.PI * 2);
4629
4642
  const L = this.createCanvasFill(t, c, S, S), P = this.createCanvasFill(t, d, S, S);
4630
- k ? (t.strokeStyle = L || c, t.lineWidth = 2, t.stroke(), t.beginPath(), t.arc(I + 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(M, I + S + 6, 0), I += S + 6 + T + p;
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;
4631
4644
  });
4632
4645
  }
4633
4646
  if (t.restore(), e.disabled && (t.globalAlpha *= 2), e.label && e.label.text) {
4634
- const I = e.label;
4635
- t.save(), t.font = `${I.fontWeight || 400} ${I.fontSize || 14}px "${I.fontFamily || "Inter"}", sans-serif`, t.fillStyle = I.color || "#9ca3af", t.textBaseline = "middle";
4636
- const M = I.gap || 8;
4647
+ const M = e.label;
4648
+ t.save(), t.font = `${M.fontWeight || 400} ${M.fontSize || 14}px "${M.fontFamily || "Inter"}", sans-serif`, t.fillStyle = M.color || "#9ca3af", t.textBaseline = "middle";
4649
+ const I = M.gap || 8;
4637
4650
  let k = 0, T = 0;
4638
- I.position === "left" ? (t.textAlign = "right", k = a - M, T = 0) : I.position === "right" ? (t.textAlign = "left", k = a + s + M, T = 0) : I.position === "top" ? (t.textAlign = "center", k = 0, T = r - M, t.textBaseline = "bottom") : I.position === "bottom" && (t.textAlign = "center", k = 0, T = r + n + M, t.textBaseline = "top"), t.fillText(I.text, k, T), t.restore();
4651
+ M.position === "left" ? (t.textAlign = "right", k = a - I, T = 0) : M.position === "right" ? (t.textAlign = "left", k = a + s + I, T = 0) : M.position === "top" ? (t.textAlign = "center", k = 0, T = r - I, t.textBaseline = "bottom") : M.position === "bottom" && (t.textAlign = "center", k = 0, T = r + n + I, t.textBaseline = "top"), t.fillText(M.text, k, T), t.restore();
4639
4652
  }
4640
4653
  }
4641
4654
  renderBarChart(t, i) {
@@ -4727,8 +4740,8 @@ class ci {
4727
4740
  isFinite(l) || (l = 10), isFinite(p) || (p = 0), l = Math.max(l, 0), p = Math.min(p, 0);
4728
4741
  const u = l - p || 10;
4729
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";
4730
- 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, I = n - v - S, M = a - y - b;
4731
- 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, I, M), 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 = f + y, M = n - v - S, I = a - y - b;
4744
+ 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) {
4732
4745
  t.font = s.legendFontSize + "px Inter, sans-serif", t.textBaseline = "middle";
4733
4746
  const P = f + 12;
4734
4747
  let _ = C;
@@ -4742,11 +4755,11 @@ class ci {
4742
4755
  t.setLineDash(s.gridLineDash || []), t.lineWidth = s.gridLineWidth || 1, t.strokeStyle = h.gridColor;
4743
4756
  for (let P = 0; P <= k; P++)
4744
4757
  if (s.orientation === "horizontal") {
4745
- const _ = C + P / k * I;
4746
- t.beginPath(), t.moveTo(_, w), t.lineTo(_, w + M), t.stroke();
4758
+ const _ = C + P / k * M;
4759
+ t.beginPath(), t.moveTo(_, w), t.lineTo(_, w + I), t.stroke();
4747
4760
  } else {
4748
- const _ = w + P / k * M;
4749
- t.beginPath(), t.moveTo(C, _), t.lineTo(C + I, _), t.stroke();
4761
+ const _ = w + P / k * I;
4762
+ t.beginPath(), t.moveTo(C, _), t.lineTo(C + M, _), t.stroke();
4750
4763
  }
4751
4764
  t.setLineDash([]);
4752
4765
  }
@@ -4754,16 +4767,16 @@ class ci {
4754
4767
  t.font = s.axisLabelFontSize + "px Inter, sans-serif", t.textAlign = "right", t.textBaseline = "middle", t.fillStyle = h.axisLabelColor;
4755
4768
  for (let P = 0; P <= k; P++)
4756
4769
  if (s.orientation === "horizontal") {
4757
- const _ = p + P / k * u, E = C + P / k * I;
4758
- t.textAlign = "center", t.fillText(_.toFixed(0), E, w + M + s.axisLabelFontSize);
4770
+ const _ = p + P / k * u, E = C + P / k * M;
4771
+ t.textAlign = "center", t.fillText(_.toFixed(0), E, w + I + s.axisLabelFontSize);
4759
4772
  } else {
4760
- const _ = l - P / k * u, E = w + P / k * M;
4773
+ const _ = l - P / k * u, E = w + P / k * I;
4761
4774
  t.textAlign = "right", t.fillText(_.toFixed(0), C - 6, E);
4762
4775
  }
4763
4776
  }
4764
- if (t.setLineDash([]), s.showXAxis && (t.lineWidth = s.xAxisLineWidth || 1, t.strokeStyle = s.xAxisColor, t.beginPath(), t.moveTo(C, w + M), t.lineTo(C + I, w + M), t.stroke()), s.showYAxis && (t.lineWidth = s.yAxisLineWidth || 1, t.strokeStyle = s.yAxisColor, t.beginPath(), t.moveTo(C, w), t.lineTo(C, w + M), t.stroke()), s.enableShadows && (t.shadowColor = s.shadowColor), s.chartType === "stacked")
4777
+ if (t.setLineDash([]), s.showXAxis && (t.lineWidth = s.xAxisLineWidth || 1, t.strokeStyle = s.xAxisColor, t.beginPath(), t.moveTo(C, w + I), t.lineTo(C + M, w + I), t.stroke()), s.showYAxis && (t.lineWidth = s.yAxisLineWidth || 1, t.strokeStyle = s.yAxisColor, t.beginPath(), t.moveTo(C, w), t.lineTo(C, w + I), t.stroke()), s.enableShadows && (t.shadowColor = s.shadowColor), s.chartType === "stacked")
4765
4778
  if (s.orientation === "horizontal") {
4766
- const P = M / c;
4779
+ const P = I / c;
4767
4780
  for (let _ = 0; _ < c; _++) {
4768
4781
  const E = w + _ * P + P / 2;
4769
4782
  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));
@@ -4771,22 +4784,22 @@ class ci {
4771
4784
  s.datasets.forEach((W, z) => {
4772
4785
  const Y = W.data[_] ?? 0;
4773
4786
  if (Y === 0) return;
4774
- const G = Y / u * I, N = Math.min(s.barWidth * d + s.barGap, P - 8), J = E - N / 2, x = A;
4787
+ const G = Y / u * M, N = Math.min(s.barWidth * d + s.barGap, P - 8), J = E - N / 2, x = A;
4775
4788
  A += G;
4776
4789
  const F = s._resolveColor(W.color, z);
4777
4790
  t.beginPath(), t.fillStyle = s._makeGradient(t, F, x, J, x + G, J), s._drawRoundedBar(t, x, J, G, N, z === d - 1 ? s.barCornerRadius : 0, !1), s.barStyle === "outline" || s.barStyle === "dashed" ? (t.fillStyle = "transparent", t.strokeStyle = s.barBorderColor === "auto" ? F : s.barBorderColor, t.lineWidth = s.barBorderWidth, s.barStyle === "dashed" && t.setLineDash([4, 4]), t.stroke(), t.setLineDash([])) : t.fill();
4778
4791
  });
4779
4792
  }
4780
4793
  } else {
4781
- const P = I / c;
4794
+ const P = M / c;
4782
4795
  for (let _ = 0; _ < c; _++) {
4783
4796
  const E = C + _ * P + P / 2;
4784
- 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 + M + 5), s.enableShadows && (t.shadowColor = s.shadowColor));
4785
- let A = w + M;
4797
+ 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));
4798
+ let A = w + I;
4786
4799
  s.datasets.forEach((W, z) => {
4787
4800
  const Y = W.data[_] ?? 0;
4788
4801
  if (Y === 0) return;
4789
- const G = Y / u * M, N = Math.min(s.barWidth * d + s.barGap, P - 8), J = E - N / 2, x = A - G;
4802
+ const G = Y / u * I, N = Math.min(s.barWidth * d + s.barGap, P - 8), J = E - N / 2, x = A - G;
4790
4803
  A -= G;
4791
4804
  const F = s._resolveColor(W.color, z);
4792
4805
  t.beginPath(), t.fillStyle = s._makeGradient(t, F, J, x, J, x + G), s._drawRoundedBar(t, J, x, N, G, z === d - 1 ? s.barCornerRadius : 0, !0), s.barStyle === "outline" || s.barStyle === "dashed" ? (t.fillStyle = "transparent", t.strokeStyle = s.barBorderColor === "auto" ? F : s.barBorderColor, t.lineWidth = s.barBorderWidth, s.barStyle === "dashed" && t.setLineDash([4, 4]), t.stroke(), t.setLineDash([])) : t.fill();
@@ -4794,26 +4807,26 @@ class ci {
4794
4807
  }
4795
4808
  }
4796
4809
  else if (s.orientation === "horizontal") {
4797
- const P = M / c, _ = d * s.barWidth + Math.max(0, (d - 1) * s.barGap), E = C + (0 - p) / u * I;
4810
+ const P = I / c, _ = d * s.barWidth + Math.max(0, (d - 1) * s.barGap), E = C + (0 - p) / u * M;
4798
4811
  for (let A = 0; A < c; A++) {
4799
4812
  const W = w + A * P + P / 2;
4800
4813
  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));
4801
4814
  const z = W - _ / 2;
4802
4815
  s.datasets.forEach((Y, G) => {
4803
- const N = Y.data[A] ?? 0, J = Math.abs(N / u * I);
4816
+ const N = Y.data[A] ?? 0, J = Math.abs(N / u * M);
4804
4817
  if (J < 1) return;
4805
4818
  const x = z + G * (s.barWidth + s.barGap), F = N >= 0 ? E : E - J, j = s._resolveColor(Y.color, G);
4806
4819
  t.beginPath(), t.fillStyle = s._makeGradient(t, j, F, x, F + J, x), s._drawRoundedBar(t, F, x, J, s.barWidth, s.barCornerRadius, !1), s.barStyle === "outline" || s.barStyle === "dashed" ? (t.fillStyle = "transparent", t.strokeStyle = s.barBorderColor === "auto" ? j : s.barBorderColor, t.lineWidth = s.barBorderWidth, s.barStyle === "dashed" && t.setLineDash([4, 4]), t.stroke(), t.setLineDash([])) : t.fill(), s.showValueOnTop && N !== 0 && (t.font = (s.valueFontWeight || "bold") + " " + (s.valueFontSize || 10) + "px Inter, sans-serif", t.textAlign = N >= 0 ? "left" : "right", t.textBaseline = "middle", t.fillStyle = s.valueColor === "auto" ? j : s.valueColor || "#fff", t.shadowColor = "transparent", t.fillText(N.toString(), N >= 0 ? F + J + 4 : F - 4, x + s.barWidth / 2), s.enableShadows && (t.shadowColor = s.shadowColor));
4807
4820
  });
4808
4821
  }
4809
4822
  } else {
4810
- const P = I / c, _ = d * s.barWidth + Math.max(0, (d - 1) * s.barGap), E = w + M - (0 - p) / u * M;
4823
+ const P = M / c, _ = d * s.barWidth + Math.max(0, (d - 1) * s.barGap), E = w + I - (0 - p) / u * I;
4811
4824
  for (let A = 0; A < c; A++) {
4812
4825
  const W = C + A * P + P / 2;
4813
- 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 + M + 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 = h.axisLabelColor, t.shadowColor = "transparent", t.fillText(s.categories[A] || "", W, w + I + 5), s.enableShadows && (t.shadowColor = s.shadowColor));
4814
4827
  const z = W - _ / 2;
4815
4828
  s.datasets.forEach((Y, G) => {
4816
- const N = Y.data[A] ?? 0, J = Math.abs(N / u * M);
4829
+ const N = Y.data[A] ?? 0, J = Math.abs(N / u * I);
4817
4830
  if (J < 1) return;
4818
4831
  const x = z + G * (s.barWidth + s.barGap), F = N >= 0 ? E - J : E, j = s._resolveColor(Y.color, G);
4819
4832
  t.beginPath(), t.fillStyle = s._makeGradient(t, j, x, F, x, F + J), s._drawRoundedBar(t, x, F, s.barWidth, J, s.barCornerRadius, !0), s.barStyle === "outline" || s.barStyle === "dashed" ? (t.fillStyle = "transparent", t.strokeStyle = s.barBorderColor === "auto" ? j : s.barBorderColor, t.lineWidth = s.barBorderWidth, s.barStyle === "dashed" && t.setLineDash([4, 4]), t.stroke(), t.setLineDash([])) : t.fill(), s.showValueOnTop && N !== 0 && (t.font = (s.valueFontWeight || "bold") + " " + (s.valueFontSize || 10) + "px Inter, sans-serif", t.textAlign = "center", t.textBaseline = N >= 0 ? "bottom" : "top", t.fillStyle = s.valueColor === "auto" ? j : s.valueColor || "#fff", t.shadowColor = "transparent", t.fillText(N.toString(), x + s.barWidth / 2, N >= 0 ? F - 4 : F + J + 4), s.enableShadows && (t.shadowColor = s.shadowColor));
@@ -4865,46 +4878,46 @@ class ci {
4865
4878
  if (s.chartType === "rose") {
4866
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;
4867
4880
  s.slices.forEach((C, w) => {
4868
- const I = C.value || 0;
4869
- if (I === 0) return;
4870
- const M = I / m * c, k = -Math.PI / 2 + w * y + S / 2, T = k + y - S, L = s._resolveSliceColor(C, w);
4871
- if (t.beginPath(), t.moveTo(d, u), t.arc(d, u, M, k, T), t.closePath(), t.fillStyle = L + "cc", t.fill(), t.strokeStyle = L, t.lineWidth = 1.5, t.stroke(), s.showLabels) {
4872
- const P = k + (T - k) / 2, _ = d + M * 0.65 * Math.cos(P), E = u + M * 0.65 * Math.sin(P), A = Math.round(I / r * 100);
4881
+ const M = C.value || 0;
4882
+ if (M === 0) return;
4883
+ const I = M / m * c, k = -Math.PI / 2 + w * y + S / 2, T = k + y - S, L = s._resolveSliceColor(C, w);
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) {
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);
4873
4886
  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();
4874
4887
  }
4875
4888
  });
4876
4889
  } else {
4877
4890
  const m = s.chartType === "pie" ? 0 : s.innerRadius, y = c * Math.max(0, m), S = c > 0 ? s.sliceGap / c : 0;
4878
4891
  let C = -Math.PI / 2;
4879
- if (s.slices.forEach((w, I) => {
4880
- const M = w.value || 0;
4881
- if (M === 0) {
4882
- C += M / r * Math.PI * 2;
4892
+ if (s.slices.forEach((w, M) => {
4893
+ const I = w.value || 0;
4894
+ if (I === 0) {
4895
+ C += I / r * Math.PI * 2;
4883
4896
  return;
4884
4897
  }
4885
- const k = M / r * Math.PI * 2, T = C + S / 2, L = C + k - S / 2;
4898
+ const k = I / r * Math.PI * 2, T = C + S / 2, L = C + k - S / 2;
4886
4899
  if (L <= T) {
4887
4900
  C += k;
4888
4901
  return;
4889
4902
  }
4890
- const P = s._resolveSliceColor(w, I);
4903
+ const P = s._resolveSliceColor(w, M);
4891
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) {
4892
- const _ = T + (L - T) / 2, E = y + (c - y) / 2, A = d + E * Math.cos(_), W = u + E * Math.sin(_), z = Math.round(M / r * 100);
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);
4893
4906
  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();
4894
4907
  }
4895
4908
  C += k;
4896
4909
  }), s.chartType === "donut" && s.showCenterText && y > 14) {
4897
- const w = Math.round(r), I = Math.min(Math.floor(y * 0.52), 20), M = Math.min(Math.floor(y * 0.26), 10);
4898
- t.textAlign = "center", t.textBaseline = "middle", t.font = `bold ${I}px Inter, sans-serif`, t.fillStyle = f.centerTextColor, t.fillText(w.toString(), d, u - M * 0.5), s.centerLabel && (t.font = `${M}px Inter, sans-serif`, t.fillStyle = f.centerLabelColor, t.fillText(s.centerLabel, d, u + I * 0.6));
4910
+ const w = Math.round(r), M = Math.min(Math.floor(y * 0.52), 20), I = Math.min(Math.floor(y * 0.26), 10);
4911
+ 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));
4899
4912
  }
4900
4913
  }
4901
4914
  if (s.showLegend && s.slices.length > 0) {
4902
4915
  t.font = `${s.legendFontSize}px Inter, sans-serif`;
4903
4916
  const m = 2, y = n / m, S = s.legendFontSize + 8, C = a / 2 - l + 10, w = -n / 2 + 10;
4904
- s.slices.forEach((I, M) => {
4905
- const k = M % m, T = Math.floor(M / m), L = w + k * y, P = C + T * S, _ = s._resolveSliceColor(I, M), E = 7;
4917
+ s.slices.forEach((M, I) => {
4918
+ const k = I % m, T = Math.floor(I / m), L = w + k * y, P = C + T * S, _ = s._resolveSliceColor(M, I), E = 7;
4906
4919
  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;
4907
- const A = Math.round((I.value || 0) / r * 100), W = `${I.label || "Item"} ${A}%`, z = y - E - 20;
4920
+ const A = Math.round((M.value || 0) / r * 100), W = `${M.label || "Item"} ${A}%`, z = y - E - 20;
4908
4921
  let Y = W;
4909
4922
  for (; t.measureText(Y).width > z && Y.length > 4; )
4910
4923
  Y = Y.slice(0, -4) + "…";
@@ -4925,14 +4938,14 @@ class ci {
4925
4938
  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();
4926
4939
  }
4927
4940
  getRadioGroupItemIndexAtPointer(t, i, o) {
4928
- var M, k;
4941
+ var I, k;
4929
4942
  const e = t.options || {}, s = this.objectStates.get(t.id) || {}, n = e.optionsList || [];
4930
4943
  if (n.length === 0) return null;
4931
- const a = s.width !== void 0 ? s.width : ((M = t.geometry) == null ? void 0 : M.width) || 180, r = s.height !== void 0 ? s.height : ((k = t.geometry) == null ? void 0 : k.height) || 100, 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, I = -r / 2;
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, 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;
4932
4945
  if (f === "vertical") {
4933
4946
  const T = Math.max(C, l) + h;
4934
4947
  for (let L = 0; L < n.length; L++) {
4935
- const P = I + L * T;
4948
+ const P = M + L * T;
4936
4949
  if (m >= w && m <= w + a && y >= P && y <= P + T)
4937
4950
  return L;
4938
4951
  }
@@ -4940,7 +4953,7 @@ class ci {
4940
4953
  let T = w;
4941
4954
  for (let L = 0; L < n.length; L++) {
4942
4955
  const _ = n[L].length * 8, E = C + 6 + _ + h;
4943
- if (m >= T && m <= T + E && y >= I && y <= I + r)
4956
+ if (m >= T && m <= T + E && y >= M && y <= M + r)
4944
4957
  return L;
4945
4958
  T += E;
4946
4959
  }
@@ -5008,9 +5021,9 @@ class ci {
5008
5021
  if (t.beginPath(), t.moveTo(p(0), e / 2), t.lineTo(p(0), l(v[0])), u.smoothing && v.length > 2)
5009
5022
  for (let m = 0; m < v.length - 1; m++) {
5010
5023
  const y = v[m === 0 ? m : m - 1], S = v[m], C = v[m + 1], w = v[m + 1 === v.length - 1 ? m + 1 : m + 2];
5011
- for (let I = 1; I <= d; I++) {
5012
- const M = I / d, k = this._catmullRom(y, S, C, w, M);
5013
- t.lineTo(p(m + M), l(k));
5024
+ for (let M = 1; M <= d; M++) {
5025
+ const I = M / d, k = this._catmullRom(y, S, C, w, I);
5026
+ t.lineTo(p(m + I), l(k));
5014
5027
  }
5015
5028
  }
5016
5029
  else
@@ -5024,8 +5037,8 @@ class ci {
5024
5037
  for (let b = 0; b < v.length - 1; b++) {
5025
5038
  const m = v[b === 0 ? b : b - 1], y = v[b], S = v[b + 1], C = v[b + 1 === v.length - 1 ? b + 1 : b + 2];
5026
5039
  for (let w = 1; w <= d; w++) {
5027
- const I = w / d, M = this._catmullRom(m, y, S, C, I);
5028
- t.lineTo(p(b + I), l(M));
5040
+ const M = w / d, I = this._catmullRom(m, y, S, C, M);
5041
+ t.lineTo(p(b + M), l(I));
5029
5042
  }
5030
5043
  }
5031
5044
  else
@@ -5152,10 +5165,10 @@ class ci {
5152
5165
  }
5153
5166
  renderListView(t, i) {
5154
5167
  var A, W, z, Y;
5155
- 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, I = e.glowIntensity ?? 0, M = e.glowColor || "#3b82f6", k = typeof M == "string" ? M : M.color || ((Y = (z = M.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;
5156
- if (t.save(), t.globalAlpha *= T, I > 0) {
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, 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;
5169
+ if (t.save(), t.globalAlpha *= T, M > 0) {
5157
5170
  const G = t.getTransform(), N = Math.sqrt(G.a * G.a + G.b * G.b) || 1;
5158
- t.shadowColor = k, t.shadowBlur = I * 2 * N, t.shadowOffsetX = 0, t.shadowOffsetY = 0;
5171
+ t.shadowColor = k, t.shadowBlur = M * 2 * N, t.shadowOffsetX = 0, t.shadowOffsetY = 0;
5159
5172
  }
5160
5173
  if (b) {
5161
5174
  const G = e.listBackgroundColor || "rgba(31, 41, 55, 0.4)", N = this.createCanvasFill(t, G, s, n);
@@ -5193,49 +5206,49 @@ class ci {
5193
5206
  const J = e.listLayout || "linear", x = J === "circular" ? d : h === "vertical" ? s : d, F = J === "circular" || h === "vertical" ? c : n;
5194
5207
  let j = 0, X = 0, tt = 0;
5195
5208
  if (J === "circular") {
5196
- 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, Et = r + n / 2;
5197
- j = Rt + Math.cos(mt) * he - x / 2, X = Et + 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, he = e.circularRadius || 100, et = u * 0.01 + le * Math.PI / 180, mt = N * Xt + et, Ot = a + s / 2, _t = r + n / 2;
5210
+ j = Ot + Math.cos(mt) * he - x / 2, X = _t + Math.sin(mt) * he - F / 2, tt = mt + (e.itemRotation || 0) * Math.PI / 180;
5198
5211
  } else
5199
5212
  j = h === "vertical" ? a : _, X = h === "vertical" ? _ : r, tt = (e.itemRotation || 0) * Math.PI / 180;
5200
- 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;
5201
- 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) {
5213
+ const O = C === N, R = w === N, D = R && e.activeItemShape ? e.activeItemShape : e.itemShape || "rectangle", q = R && e.activeItemShape ? e.activeItemPath : e.itemPath || "", ot = e.itemCornerRadius || 0;
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))), R) {
5202
5215
  const St = this.createCanvasFill(t, m, x, F);
5203
5216
  t.fillStyle = St || m;
5204
5217
  const Xt = t.globalAlpha;
5205
5218
  t.globalAlpha = Xt * 0.8, t.beginPath(), this.drawCustomShape(t, D, q, j, X, x, F, ot) || (t.rect(j, X, x, F), t.fill()), t.globalAlpha = Xt;
5206
- } else if (R)
5219
+ } else if (O)
5207
5220
  t.fillStyle = b ? "rgba(255, 255, 255, 0.1)" : "rgba(0, 0, 0, 0.05)", t.beginPath(), this.drawCustomShape(t, D, q, j, X, x, F, ot) || (t.rect(j, X, x, F), t.fill());
5208
5221
  else if (S !== "transparent") {
5209
5222
  const St = this.createCanvasFill(t, S, x, F);
5210
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());
5211
5224
  }
5212
- if (O || R) {
5225
+ if (R || O) {
5213
5226
  const St = this.createCanvasFill(t, m, h === "vertical" ? 3 : x, h === "vertical" ? F : 3);
5214
5227
  t.fillStyle = St || m, h === "vertical" ? t.fillRect(j, X, 3, F) : t.fillRect(j, X + F - 3, x, 3);
5215
5228
  }
5216
- const yt = O ? "#ffffff" : b ? "rgba(255, 255, 255, 0.9)" : y;
5217
- t.fillStyle = yt, t.font = O || R ? "600 14px Inter, sans-serif" : "400 14px Inter, sans-serif";
5218
- const bt = typeof G == "string" ? G : (G == null ? void 0 : G.label) || `Item ${N + 1}`, gt = j + (h === "vertical" ? 16 : x / 2), Pt = X + F / 2;
5229
+ const yt = R ? "#ffffff" : b ? "rgba(255, 255, 255, 0.9)" : y;
5230
+ t.fillStyle = yt, t.font = R || O ? "600 14px Inter, sans-serif" : "400 14px Inter, sans-serif";
5231
+ 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;
5219
5232
  h === "horizontal" || J === "circular" ? t.textAlign = "center" : t.textAlign = "left";
5220
5233
  const It = J === "circular" ? j + x / 2 : gt;
5221
- t.fillText(bt, It, Pt), t.restore(), _ += (h === "vertical" ? c : d) + p;
5234
+ t.fillText(bt, It, Et), t.restore(), _ += (h === "vertical" ? c : d) + p;
5222
5235
  }), t.restore(), e.showScrollbar !== !1) {
5223
5236
  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";
5224
5237
  if (G > N || J === "circular" && l.length > 0) {
5225
5238
  const F = e.scrollbarColor || "rgba(255,255,255,0.3)", j = e.scrollbarWidth || 4;
5226
5239
  if (x) {
5227
- const X = Math.min(s, n) / 2 - j / 2 - 2, tt = a + s / 2, R = r + n / 2;
5240
+ const X = Math.min(s, n) / 2 - j / 2 - 2, tt = a + s / 2, O = r + n / 2;
5228
5241
  if (t.strokeStyle = F, t.lineWidth = j, t.lineCap = "round", t.beginPath(), J === "circular") {
5229
- const O = Math.PI / 4, D = -(u * 0.01) - Math.PI / 2;
5230
- t.arc(tt, R, X, D, D + O);
5242
+ const R = Math.PI / 4, D = -(u * 0.01) - Math.PI / 2;
5243
+ t.arc(tt, O, X, D, D + R);
5231
5244
  } else {
5232
- const O = Math.PI / 2, D = N / G, q = O * D, ot = -u / G * O, bt = -Math.PI / 4 + ot;
5233
- t.arc(tt, R, X, bt, bt + q);
5245
+ const R = Math.PI / 2, D = N / G, q = R * D, ot = -u / G * R, bt = -Math.PI / 4 + ot;
5246
+ t.arc(tt, O, X, bt, bt + q);
5234
5247
  }
5235
5248
  t.stroke();
5236
5249
  } else {
5237
- const X = N / G, tt = N * X, R = -u / G * N;
5238
- 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);
5250
+ const X = N / G, tt = N * X, O = -u / G * N;
5251
+ t.fillStyle = F, h === "vertical" ? t.fillRect(a + s - j - 2, r + O, j, tt) : t.fillRect(a + O, r + n - j - 2, tt, j);
5239
5252
  }
5240
5253
  }
5241
5254
  }
@@ -5276,19 +5289,19 @@ class ci {
5276
5289
  var z, Y;
5277
5290
  const e = t.options || {}, s = this.objectStates.get(t.id) || {}, n = e.items || [];
5278
5291
  if (n.length === 0) return null;
5279
- 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, I = -a / 2, M = -r / 2, k = typeof d == "number" ? d : f === "vertical" ? d[0] : d[3];
5280
- let T = (f === "vertical" ? M : I) + 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, 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];
5293
+ let T = (f === "vertical" ? I : M) + c + k;
5281
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;
5282
5295
  for (let G = 0; G < n.length; G++) {
5283
5296
  const N = L === "circular" ? p : f === "vertical" ? a : p, J = L === "circular" || f === "vertical" ? l : r;
5284
5297
  let x = 0, F = 0, j = 0;
5285
5298
  if (L === "circular") {
5286
- const X = G * _ + W, tt = I + a / 2, R = M + r / 2;
5287
- x = tt + Math.cos(X) * A - N / 2, F = R + Math.sin(X) * A - J / 2, j = X + (e.itemRotation || 0) * Math.PI / 180;
5299
+ const X = G * _ + W, tt = M + a / 2, O = I + r / 2;
5300
+ x = tt + Math.cos(X) * A - N / 2, F = O + Math.sin(X) * A - J / 2, j = X + (e.itemRotation || 0) * Math.PI / 180;
5288
5301
  } else
5289
- x = f === "vertical" ? I : T, F = f === "vertical" ? T : M, j = (e.itemRotation || 0) * Math.PI / 180;
5302
+ x = f === "vertical" ? M : T, F = f === "vertical" ? T : I, j = (e.itemRotation || 0) * Math.PI / 180;
5290
5303
  if (j !== 0) {
5291
- 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
+ const X = x + N / 2, tt = F + J / 2, O = C - X, R = w - tt, D = -j, q = O * Math.cos(D) - R * Math.sin(D) + X, ot = O * Math.sin(D) + R * Math.cos(D) + tt;
5292
5305
  if (q >= x && q <= x + N && ot >= F && ot <= F + J)
5293
5306
  return G;
5294
5307
  } else if (C >= x && C <= x + N && w >= F && w <= F + J)
@@ -5311,7 +5324,7 @@ class ci {
5311
5324
  if (!e.behaviors || e.behaviors.length === 0) return;
5312
5325
  const s = this.objectStates.get(e.id);
5313
5326
  s && e.behaviors.forEach((n) => {
5314
- var p, c, d, u, v, b, m, y, S, C, w, I, M, 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, Pt, It, St, Xt, le, he, et, mt, Rt, Et, dt, Ot, zt, Wt, $t, Ht, ie, me, ye, Ut, Se, Pe, Ee, Ce, Ae, xe, se, jt, ft, pt, at, B, nt, Z, _t, xt, kt, At, Mt, $, Bt, Kt, te, Jt, ut, ct, Ct, rt, V, st, it, vt, Yt, Qt, ne, Dt, Nt, Vt, Ie, Le, Re, Oe, Fe, $e, Ye, Gt, 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, O, R, D, q, ot, yt, bt, gt, Et, It, St, Xt, le, he, et, mt, Ot, _t, dt, Ft, Dt, $t, Rt, 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, Oe, Re, Fe, $e, Ye, zt, oe, we, Be, We, de, ce, fe, ke, Xe, Ve, Ne, De, He;
5315
5328
  if (!n.enabled) return;
5316
5329
  const a = n.startTime || 0, r = n.endTime || 1 / 0;
5317
5330
  if (this.currentTime < a || this.currentTime > r) return;
@@ -5340,11 +5353,11 @@ class ci {
5340
5353
  } else if (n.type === U.Vortex) {
5341
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;
5342
5355
  if (l < H) {
5343
- const ht = Math.pow(1 - l / H, 1.5), Tt = this.currentTime * Q * Math.PI * 2, Lt = Math.cos(Tt) * 30 - f * 0.4, Ft = Math.sin(Tt) * 30 - h * 0.4;
5344
- s.x += Lt * ht * K * t * 5, s.y += Ft * 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 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;
5357
+ 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;
5345
5358
  }
5346
5359
  } else if (n.type === U.Fluid) {
5347
- const H = ((I = n.settings) == null ? void 0 : I.radius) || 300, Q = ((M = n.settings) == null ? void 0 : M.strength) || 1;
5360
+ const H = ((M = n.settings) == null ? void 0 : M.radius) || 300, Q = ((I = n.settings) == null ? void 0 : I.strength) || 1;
5348
5361
  if (l < H) {
5349
5362
  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;
5350
5363
  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;
@@ -5374,31 +5387,31 @@ class ci {
5374
5387
  s.scale_x *= 1 + K * 0.5 * Q * t, s.scale_y *= 1 + K * 0.5 * Q * t;
5375
5388
  }
5376
5389
  } else if (n.type === U.Parallax) {
5377
- 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, Ft = (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) + Ft * H * Q, Te = (((N = e.transform) == null ? void 0 : N.rotate_x) ?? 0) - Ft * 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, 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);
5378
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);
5379
5392
  } else if (n.type === U.Fold) {
5380
5393
  if (l < 300) {
5381
5394
  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);
5382
- 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 };
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 ?? ((O = e.transform) == null ? void 0 : O.scale_y) ?? 1, (((R = e.transform) == null ? void 0 : R.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 };
5383
5396
  }
5384
5397
  } else if (n.type === U.Crumple) {
5385
5398
  if (l < 300) {
5386
5399
  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);
5387
- 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 ?? ((Pt = e.transform) == null ? void 0 : Pt.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 };
5400
+ 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 };
5388
5401
  }
5389
5402
  } else if (n.type === U.Squash) {
5390
5403
  const H = ((le = n.settings) == null ? void 0 : le.strength) || 0.8;
5391
- 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, (((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, ((Ot = e.transform) == null ? void 0 : Ot.scale_x) ?? 1, 0.2));
5392
5405
  } else if (n.type === U.TextCounter) {
5393
- const H = ((Et = n.settings) == null ? void 0 : Et.duration) || 2, Q = ((dt = n.settings) == null ? void 0 : dt.from) || 0, K = ((Ot = n.settings) == null ? void 0 : Ot.to) || 100;
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;
5394
5407
  n._runtimeStart === void 0 && (n._runtimeStart = this.currentTime);
5395
5408
  const ht = this.currentTime - n._runtimeStart, Tt = Math.min(1, ht / H), Lt = Math.floor(Q + (K - Q) * Tt);
5396
- if (((zt = e.geometry) == null ? void 0 : zt.type) === "Text") {
5397
- const Ft = ((Wt = n.settings) == null ? void 0 : Wt.prefix) || "", ee = (($t = n.settings) == null ? void 0 : $t.suffix) || "";
5398
- s.geometry || (s.geometry = { ...e.geometry }), s.geometry.text = `${Ft}${Lt}${ee}`;
5409
+ if (((Dt = e.geometry) == null ? void 0 : Dt.type) === "Text") {
5410
+ const Bt = (($t = n.settings) == null ? void 0 : $t.prefix) || "", ee = ((Rt = n.settings) == null ? void 0 : Rt.suffix) || "";
5411
+ s.geometry || (s.geometry = { ...e.geometry }), s.geometry.text = `${Bt}${Lt}${ee}`;
5399
5412
  }
5400
5413
  } else if (n.type === U.Spotlight) {
5401
- const H = ((Ht = n.settings) == null ? void 0 : Ht.radius) || 250, Q = ((ie = n.settings) == null ? void 0 : ie.strength) || 1.5;
5414
+ const H = ((Vt = n.settings) == null ? void 0 : Vt.radius) || 250, Q = ((ie = n.settings) == null ? void 0 : ie.strength) || 1.5;
5402
5415
  if (l < H) {
5403
5416
  const K = Math.pow(1 - l / H, 2);
5404
5417
  s.style || (s.style = { ...e.style }), s.style.adjustments || (s.style.adjustments = { ...(me = e.style) == null ? void 0 : me.adjustments }), s.style.adjustments.exposure = (((Ut = (ye = e.style) == null ? void 0 : ye.adjustments) == null ? void 0 : Ut.exposure) || 0) + K * Q * 50;
@@ -5417,13 +5430,13 @@ class ci {
5417
5430
  this.applyBehaviorSensor(s, Zt.PositionX, ht * K, t, n.settings), this.applyBehaviorSensor(s, Zt.PositionY, ht * K, t, n.settings);
5418
5431
  }
5419
5432
  } else if (n.type === U.Scroll) {
5420
- const H = ((Z = n.settings) == null ? void 0 : Z.axis) || "vertical", Q = ((_t = n.settings) == null ? void 0 : _t.factor) || 0.5, K = ((xt = n.settings) == null ? void 0 : xt.strength) || 1, ht = ((kt = n.settings) == null ? void 0 : kt.scaleFactor) || 0;
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, ht = ((kt = n.settings) == null ? void 0 : kt.scaleFactor) || 0;
5421
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), ht !== 0 && (s.scale_x *= 1 + this.scrollOffset.y * ht * t, s.scale_y *= 1 + this.scrollOffset.y * ht * t);
5422
5435
  } else if (n.type === U.LookAt) {
5423
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(-h, -f) * (180 / Math.PI), ht = s.rotation, Tt = (K - ht + 180) % 360 - 180;
5424
5437
  s.rotation += Tt * H * Q * t * 10;
5425
5438
  } else if (n.type === U.Scan) {
5426
- const H = ((($ = n.settings) == null ? void 0 : $.speed) || 1) * 4e-3, Q = ((Bt = n.settings) == null ? void 0 : Bt.strength) || 1, K = (Math.sin(Date.now() * H) + 1) / 2;
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;
5427
5440
  s.style && (s.style.exposure = (s.style.exposure || 1) + K * Q * t * 5), s.x += (K - 0.5) * 20 * Q * t;
5428
5441
  } else if (n.type === U.Glint)
5429
5442
  s.style = s.style || { ...e.style }, s.style.artEffect = {
@@ -5462,14 +5475,14 @@ class ci {
5462
5475
  } else
5463
5476
  s.skew_x = this.lerp(s.skew_x || 0, ((ne = e.transform) == null ? void 0 : ne.skew_x) || 0, 0.05);
5464
5477
  } else if (n.type === U.Lens) {
5465
- const H = ((Dt = n.settings) == null ? void 0 : Dt.radius) || 200, Q = ((Nt = n.settings) == null ? void 0 : Nt.strength) || 0.5;
5478
+ const H = ((Gt = n.settings) == null ? void 0 : Gt.radius) || 200, Q = ((Ht = n.settings) == null ? void 0 : Ht.strength) || 0.5;
5466
5479
  if (l < H) {
5467
5480
  const K = Math.pow(1 - l / H, 2);
5468
- s.scale_x = this.lerp(s.scale_x ?? 1, (((Vt = e.transform) == null ? void 0 : Vt.scale_x) ?? 1) * (1 + K * Q), 0.2), s.scale_y = this.lerp(s.scale_y ?? 1, (((Ie = e.transform) == null ? void 0 : Ie.scale_y) ?? 1) * (1 + K * Q), 0.2);
5481
+ s.scale_x = this.lerp(s.scale_x ?? 1, (((Nt = e.transform) == null ? void 0 : Nt.scale_x) ?? 1) * (1 + K * Q), 0.2), s.scale_y = this.lerp(s.scale_y ?? 1, (((Ie = e.transform) == null ? void 0 : Ie.scale_y) ?? 1) * (1 + K * Q), 0.2);
5469
5482
  } else
5470
- s.scale_x = this.lerp(s.scale_x ?? 1, ((Le = e.transform) == null ? void 0 : Le.scale_x) ?? 1, 0.1), s.scale_y = this.lerp(s.scale_y ?? 1, ((Re = e.transform) == null ? void 0 : Re.scale_y) ?? 1, 0.1);
5483
+ s.scale_x = this.lerp(s.scale_x ?? 1, ((Le = e.transform) == null ? void 0 : Le.scale_x) ?? 1, 0.1), s.scale_y = this.lerp(s.scale_y ?? 1, ((Oe = e.transform) == null ? void 0 : Oe.scale_y) ?? 1, 0.1);
5471
5484
  } else if (n.type === U.LayoutAnimation) {
5472
- 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
+ const H = ((Re = n.settings) == null ? void 0 : Re.watchProperties) || ["x", "y", "scale_x", "scale_y", "opacity", "rotation"], Q = ((Fe = n.settings) == null ? void 0 : Fe.duration) || 0.3;
5473
5486
  this._layoutAnimCache.has(e.id) || this._layoutAnimCache.set(e.id, /* @__PURE__ */ new Map());
5474
5487
  const K = this._layoutAnimCache.get(e.id);
5475
5488
  for (const ht of H) {
@@ -5492,15 +5505,15 @@ class ci {
5492
5505
  duration: (($e = n.settings) == null ? void 0 : $e.duration) ?? Q
5493
5506
  });
5494
5507
  }
5495
- const Ft = K.get(ht);
5496
- if (Ft.duration > 0 && Ft.from !== Ft.to) {
5497
- const ee = this.currentTime - Ft.startTime, ue = Math.min(1, ee / Ft.duration), Te = this.applyEasing(ue, ((Ye = n.settings) == null ? void 0 : Ye.easing) || "easeOutCubic"), ae = Ft.from + (Ft.to - Ft.from) * Te;
5508
+ const Bt = K.get(ht);
5509
+ if (Bt.duration > 0 && Bt.from !== Bt.to) {
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;
5498
5511
  this.setObjectProperty(s, e, ht, ae);
5499
5512
  }
5500
5513
  }
5501
5514
  } else if (n.type === U.StateReactive) {
5502
5515
  this._layoutAnimCache.has(e.id) || this._layoutAnimCache.set(e.id, /* @__PURE__ */ new Map());
5503
- const H = this._layoutAnimCache.get(e.id), Q = ((Gt = n.settings) == null ? void 0 : Gt.defaultDuration) || 0.3, K = [
5516
+ const H = this._layoutAnimCache.get(e.id), Q = ((zt = n.settings) == null ? void 0 : zt.defaultDuration) || 0.3, K = [
5504
5517
  "x",
5505
5518
  "y",
5506
5519
  "scale_x",
@@ -5535,9 +5548,9 @@ class ci {
5535
5548
  duration: Q
5536
5549
  });
5537
5550
  }
5538
- const Ft = H.get(ht);
5539
- if (Ft.duration > 0 && Ft.from !== Ft.to) {
5540
- const ee = this.currentTime - Ft.startTime, ue = Math.min(1, ee / Ft.duration), Te = this.applyEasing(ue, ((oe = n.settings) == null ? void 0 : oe.defaultEasing) || "easeOutCubic"), ae = Ft.from + (Ft.to - Ft.from) * Te;
5551
+ const Bt = H.get(ht);
5552
+ if (Bt.duration > 0 && Bt.from !== Bt.to) {
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;
5541
5554
  this.setObjectProperty(s, e, ht, ae);
5542
5555
  }
5543
5556
  }
@@ -5563,7 +5576,7 @@ class ci {
5563
5576
  for (const Tt of H) {
5564
5577
  const Lt = K.get(Tt.targetId);
5565
5578
  if (!Lt) continue;
5566
- const Ft = Lt.x - ht.x, ee = Lt.y - ht.y, ue = Math.sqrt(Ft * Ft + ee * ee) || 1e-3, ae = (ue - (Tt.restLength || 50)) * (Tt.stiffness || 0.8), be = Ft / ue * ae, Ue = ee / ue * ae;
5579
+ 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;
5567
5580
  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;
5568
5581
  const pe = this.objectStates.get(Tt.targetId);
5569
5582
  pe && (pe.x += Lt.vx * t, pe.y += Lt.vy * t);
@@ -5571,13 +5584,13 @@ class ci {
5571
5584
  s.x += ht.vx * t, s.y += ht.vy * t;
5572
5585
  }
5573
5586
  } else if (n.type === U.ParticleEmitter) {
5574
- 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", Ft = ((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, 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;
5575
5588
  this._emitterPools.has(e.id) || this._emitterPools.set(e.id, []);
5576
5589
  const ae = this._emitterPools.get(e.id);
5577
5590
  let be = 0;
5578
5591
  n._pendingBurst && n._pendingBurst > 0 && (be = n._pendingBurst, n._pendingBurst = 0);
5579
5592
  const Ue = Math.floor(ee * t) + (be || 0);
5580
- for (let pe = 0; pe < Math.min(Ue, Ft - ae.length); pe++) {
5593
+ for (let pe = 0; pe < Math.min(Ue, Bt - ae.length); pe++) {
5581
5594
  const re = Math.random() * Math.PI * 2, ss = Te * (0.5 + Math.random() * 0.5);
5582
5595
  ae.push({
5583
5596
  x: s.x,
@@ -5600,7 +5613,7 @@ class ci {
5600
5613
  });
5601
5614
  }
5602
5615
  applyBehaviorSensor(t, i, o, e, s, n, a = 0, r = 0, f = 1) {
5603
- var d, u, v, b, m, y, S, C, w, I, M, k, T, L, P, _, E, A, W, z, Y, G, N, J;
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;
5604
5617
  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;
5605
5618
  switch (i) {
5606
5619
  case Zt.Scale: {
@@ -5644,8 +5657,8 @@ class ci {
5644
5657
  break;
5645
5658
  }
5646
5659
  case Zt.Blur: {
5647
- t.style || (t.style = { ...n == null ? void 0 : n.style }), t.style.blur || (t.style.blur = { ...(I = n == null ? void 0 : n.style) == null ? void 0 : I.blur });
5648
- const x = ((k = (M = n == null ? void 0 : n.style) == null ? void 0 : M.blur) == null ? void 0 : k.amount) || 0, F = x + o * ((s == null ? void 0 : s.blur) || 20) * h;
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 });
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) * h;
5649
5662
  t.style.blur.amount = (t.style.blur.amount ?? x) * (1 - l) + F * l;
5650
5663
  break;
5651
5664
  }
@@ -5785,8 +5798,8 @@ const yi = Ss(({
5785
5798
  scrollY: S,
5786
5799
  scrollX: C,
5787
5800
  mouseX: w,
5788
- mouseY: I,
5789
- isMouseDown: M,
5801
+ mouseY: M,
5802
+ isMouseDown: I,
5790
5803
  inputs: k,
5791
5804
  interactive: T = !0,
5792
5805
  onNavigation: L
@@ -5799,98 +5812,98 @@ const yi = Ss(({
5799
5812
  }), []), ve(() => {
5800
5813
  E.current.setLayout(e, s);
5801
5814
  }, [e, s]), ve(() => {
5802
- const R = E.current;
5803
- 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);
5815
+ const O = E.current;
5816
+ a && O.setTriggerCallback(a), r && O.setInputUpdateCallback((R, D) => r({ [R]: D })), f && O.setComponentChangeCallback((R) => f(R)), h && O.setToggleCallback(h), l && O.setInputChangeCallback(l), p && O.setInputFocusCallback(p), c && O.setInputBlurCallback(c), d && O.setOnLogCallback((R) => d(R, "info")), u && O.setLogicUpdateCallback(u), v && O.setButtonClickCallback(v), b && O.setGraphPointClickCallback((R) => b(R.objectId, R)), L && O.setNavigationCallback(L);
5804
5817
  }, [a, r, f, h, l, p, c, d, u, v, b, L]), ve(() => {
5805
5818
  (async () => {
5806
- let O = g;
5819
+ let R = g;
5807
5820
  if (t && !g)
5808
5821
  try {
5809
- t.startsWith("{") ? O = JSON.parse(t) : O = await (await fetch(t)).json();
5822
+ t.startsWith("{") ? R = JSON.parse(t) : R = await (await fetch(t)).json();
5810
5823
  } catch (D) {
5811
5824
  console.error("[ExodeUI] Failed to load src:", D);
5812
5825
  }
5813
- if (O) {
5814
- const D = E.current, q = O.id || O.name || "default";
5815
- (z.current !== q || Y.current !== y || G.current !== O) && (D.load(O), z.current = q, Y.current = y, G.current = O, N(O), W.current = 0, D.advance(0)), n && n(D);
5826
+ if (R) {
5827
+ const D = E.current, q = R.id || R.name || "default";
5828
+ (z.current !== q || Y.current !== y || G.current !== R) && (D.load(R), z.current = q, Y.current = y, G.current = R, N(R), W.current = 0, D.advance(0)), n && n(D);
5816
5829
  }
5817
5830
  })();
5818
5831
  }, [g, t, y]), ve(() => {
5819
- const R = (O) => {
5832
+ const O = (R) => {
5820
5833
  if (!E.current || !J.current) return;
5821
5834
  const D = E.current, q = _.current;
5822
5835
  if (!q) return;
5823
5836
  const ot = q.getContext("2d");
5824
5837
  if (!ot) return;
5825
- const yt = O / 1e3;
5838
+ const yt = R / 1e3;
5826
5839
  W.current === 0 && (W.current = yt);
5827
5840
  let bt = yt - W.current;
5828
5841
  bt > 0.1 && (bt = 0.1), W.current = yt;
5829
- const gt = q.getBoundingClientRect(), Pt = window.devicePixelRatio || 1, It = Math.round(gt.width * Pt), St = Math.round(gt.height * Pt);
5842
+ const gt = q.getBoundingClientRect(), Et = window.devicePixelRatio || 1, It = Math.round(gt.width * Et), St = Math.round(gt.height * Et);
5830
5843
  (q.width !== It || q.height !== St) && (q.width = It, q.height = St);
5831
5844
  try {
5832
5845
  o ? D.advance(bt) : m !== void 0 && D.seek(m), D.render(ot, q.width, q.height);
5833
5846
  } catch (Xt) {
5834
5847
  console.error("[ExodeUICanvas] Error in animation loop:", Xt), d && d(`[Error] Animation loop crashed: ${Xt}`, "error");
5835
5848
  }
5836
- A.current = requestAnimationFrame(R);
5849
+ A.current = requestAnimationFrame(O);
5837
5850
  };
5838
- return A.current = requestAnimationFrame(R), () => {
5851
+ return A.current = requestAnimationFrame(O), () => {
5839
5852
  A.current && cancelAnimationFrame(A.current);
5840
5853
  };
5841
5854
  }, [o, m]), ve(() => {
5842
- const R = E.current;
5843
- S !== void 0 && R.updateInput("scrollY", S), C !== void 0 && R.updateInput("scrollX", C), w !== void 0 && R.updateInput("mouseX", w), I !== void 0 && R.updateInput("mouseY", I), M !== void 0 && R.updateInput("isMouseDown", M), k && Object.entries(k).forEach(([O, D]) => R.updateInput(O, D));
5844
- }, [S, C, w, I, M, k]);
5845
- const x = (R, O) => {
5855
+ const O = E.current;
5856
+ S !== void 0 && O.updateInput("scrollY", S), C !== void 0 && O.updateInput("scrollX", C), w !== void 0 && O.updateInput("mouseX", w), M !== void 0 && O.updateInput("mouseY", M), I !== void 0 && O.updateInput("isMouseDown", I), k && Object.entries(k).forEach(([R, D]) => O.updateInput(R, D));
5857
+ }, [S, C, w, M, I, k]);
5858
+ const x = (O, R) => {
5846
5859
  if (!T || !_.current) return;
5847
- R.stopPropagation(), "nativeEvent" in R && R.nativeEvent && typeof R.nativeEvent.stopImmediatePropagation == "function" ? R.nativeEvent.stopImmediatePropagation() : typeof R.stopImmediatePropagation == "function" && R.stopImmediatePropagation();
5848
- const D = _.current, q = D.getBoundingClientRect(), ot = R.clientX - q.left, yt = R.clientY - q.top, bt = window.devicePixelRatio || 1;
5849
- (O === "click" || O === "down" || O === "up") && d && d(`[Canvas] Pointer ${O} at rect(${Math.round(ot)},${Math.round(yt)}) mapped to buffer(${Math.round(ot * bt)},${Math.round(yt * bt)})`, "info"), E.current.handlePointerInput(O, ot * bt, yt * bt, D.width, D.height);
5860
+ O.stopPropagation(), "nativeEvent" in O && O.nativeEvent && typeof O.nativeEvent.stopImmediatePropagation == "function" ? O.nativeEvent.stopImmediatePropagation() : typeof O.stopImmediatePropagation == "function" && O.stopImmediatePropagation();
5861
+ const D = _.current, q = D.getBoundingClientRect(), ot = O.clientX - q.left, yt = O.clientY - q.top, bt = window.devicePixelRatio || 1;
5862
+ (R === "click" || R === "down" || R === "up") && d && d(`[Canvas] Pointer ${R} at rect(${Math.round(ot)},${Math.round(yt)}) mapped to buffer(${Math.round(ot * bt)},${Math.round(yt * bt)})`, "info"), E.current.handlePointerInput(R, ot * bt, yt * bt, D.width, D.height);
5850
5863
  };
5851
5864
  ve(() => {
5852
5865
  if (!T) return;
5853
- const R = (D) => {
5866
+ const O = (D) => {
5854
5867
  var q, ot, yt;
5855
5868
  ((q = document.activeElement) == null ? void 0 : q.tagName) === "INPUT" || ((ot = document.activeElement) == null ? void 0 : ot.tagName) === "TEXTAREA" || (yt = E.current) == null || yt.handleKeyDown(D);
5856
- }, O = (D) => {
5869
+ }, R = (D) => {
5857
5870
  var q, ot, yt;
5858
5871
  ((q = document.activeElement) == null ? void 0 : q.tagName) === "INPUT" || ((ot = document.activeElement) == null ? void 0 : ot.tagName) === "TEXTAREA" || (yt = E.current) == null || yt.handleKeyUp(D);
5859
5872
  };
5860
- return window.addEventListener("keydown", R), window.addEventListener("keyup", O), () => {
5861
- window.removeEventListener("keydown", R), window.removeEventListener("keyup", O);
5873
+ return window.addEventListener("keydown", O), window.addEventListener("keyup", R), () => {
5874
+ window.removeEventListener("keydown", O), window.removeEventListener("keyup", R);
5862
5875
  };
5863
5876
  }, [T]);
5864
5877
  const [F, j] = Qe([]);
5865
5878
  ve(() => {
5866
5879
  if (g && g.objects) {
5867
- const R = g.objects.filter((O) => {
5880
+ const O = g.objects.filter((R) => {
5868
5881
  var D, q;
5869
- return O.type === "Joystick" && ((D = O.inputBinding) == null ? void 0 : D.type) === "keyboard" && ((q = O.inputBinding.keyboardConfig) == null ? void 0 : q.showVirtualKeyboard);
5882
+ return R.type === "Joystick" && ((D = R.inputBinding) == null ? void 0 : D.type) === "keyboard" && ((q = R.inputBinding.keyboardConfig) == null ? void 0 : q.showVirtualKeyboard);
5870
5883
  });
5871
- j(R);
5884
+ j(O);
5872
5885
  }
5873
5886
  }, [g]);
5874
5887
  const [, X] = Qe(0);
5875
5888
  ve(() => {
5876
5889
  if (F.length === 0) return;
5877
- let R;
5878
- const O = () => {
5879
- X((D) => D + 1), R = requestAnimationFrame(O);
5890
+ let O;
5891
+ const R = () => {
5892
+ X((D) => D + 1), O = requestAnimationFrame(R);
5880
5893
  };
5881
- return R = requestAnimationFrame(O), () => cancelAnimationFrame(R);
5894
+ return O = requestAnimationFrame(R), () => cancelAnimationFrame(O);
5882
5895
  }, [F.length]);
5883
- const tt = () => F.map((R) => {
5884
- const O = R.inputBinding.keyboardConfig, D = (gt) => {
5896
+ const tt = () => F.map((O) => {
5897
+ const R = O.inputBinding.keyboardConfig, D = (gt) => {
5885
5898
  var It;
5886
- const Pt = { key: gt, code: gt, preventDefault: () => {
5899
+ const Et = { key: gt, code: gt, preventDefault: () => {
5887
5900
  } };
5888
- (It = E.current) == null || It.handleKeyDown(Pt);
5901
+ (It = E.current) == null || It.handleKeyDown(Et);
5889
5902
  }, q = (gt) => {
5890
5903
  var It;
5891
- const Pt = { key: gt, code: gt, preventDefault: () => {
5904
+ const Et = { key: gt, code: gt, preventDefault: () => {
5892
5905
  } };
5893
- (It = E.current) == null || It.handleKeyUp(Pt);
5906
+ (It = E.current) == null || It.handleKeyUp(Et);
5894
5907
  }, ot = E.current, yt = (gt) => ot && ot.activeKeys ? ot.activeKeys.has(gt.toLowerCase()) : !1, bt = (gt) => ({
5895
5908
  width: "50px",
5896
5909
  height: "50px",
@@ -5923,90 +5936,90 @@ const yi = Ss(({
5923
5936
  /* @__PURE__ */ ge(
5924
5937
  "div",
5925
5938
  {
5926
- style: bt(yt(O.upKey)),
5927
- onMouseDown: () => D(O.upKey),
5928
- onMouseUp: () => q(O.upKey),
5929
- onMouseLeave: () => q(O.upKey),
5939
+ style: bt(yt(R.upKey)),
5940
+ onMouseDown: () => D(R.upKey),
5941
+ onMouseUp: () => q(R.upKey),
5942
+ onMouseLeave: () => q(R.upKey),
5930
5943
  onTouchStart: (gt) => {
5931
- gt.preventDefault(), D(O.upKey);
5944
+ gt.preventDefault(), D(R.upKey);
5932
5945
  },
5933
5946
  onTouchEnd: (gt) => {
5934
- gt.preventDefault(), q(O.upKey);
5947
+ gt.preventDefault(), q(R.upKey);
5935
5948
  },
5936
- children: O.upKey.toUpperCase()
5949
+ children: R.upKey.toUpperCase()
5937
5950
  }
5938
5951
  ),
5939
5952
  /* @__PURE__ */ Je("div", { style: { display: "flex", gap: "8px" }, children: [
5940
5953
  /* @__PURE__ */ ge(
5941
5954
  "div",
5942
5955
  {
5943
- style: bt(yt(O.leftKey)),
5944
- onMouseDown: () => D(O.leftKey),
5945
- onMouseUp: () => q(O.leftKey),
5946
- onMouseLeave: () => q(O.leftKey),
5956
+ style: bt(yt(R.leftKey)),
5957
+ onMouseDown: () => D(R.leftKey),
5958
+ onMouseUp: () => q(R.leftKey),
5959
+ onMouseLeave: () => q(R.leftKey),
5947
5960
  onTouchStart: (gt) => {
5948
- gt.preventDefault(), D(O.leftKey);
5961
+ gt.preventDefault(), D(R.leftKey);
5949
5962
  },
5950
5963
  onTouchEnd: (gt) => {
5951
- gt.preventDefault(), q(O.leftKey);
5964
+ gt.preventDefault(), q(R.leftKey);
5952
5965
  },
5953
- children: O.leftKey.toUpperCase()
5966
+ children: R.leftKey.toUpperCase()
5954
5967
  }
5955
5968
  ),
5956
5969
  /* @__PURE__ */ ge(
5957
5970
  "div",
5958
5971
  {
5959
- style: bt(yt(O.downKey)),
5960
- onMouseDown: () => D(O.downKey),
5961
- onMouseUp: () => q(O.downKey),
5962
- onMouseLeave: () => q(O.downKey),
5972
+ style: bt(yt(R.downKey)),
5973
+ onMouseDown: () => D(R.downKey),
5974
+ onMouseUp: () => q(R.downKey),
5975
+ onMouseLeave: () => q(R.downKey),
5963
5976
  onTouchStart: (gt) => {
5964
- gt.preventDefault(), D(O.downKey);
5977
+ gt.preventDefault(), D(R.downKey);
5965
5978
  },
5966
5979
  onTouchEnd: (gt) => {
5967
- gt.preventDefault(), q(O.downKey);
5980
+ gt.preventDefault(), q(R.downKey);
5968
5981
  },
5969
- children: O.downKey.toUpperCase()
5982
+ children: R.downKey.toUpperCase()
5970
5983
  }
5971
5984
  ),
5972
5985
  /* @__PURE__ */ ge(
5973
5986
  "div",
5974
5987
  {
5975
- style: bt(yt(O.rightKey)),
5976
- onMouseDown: () => D(O.rightKey),
5977
- onMouseUp: () => q(O.rightKey),
5978
- onMouseLeave: () => q(O.rightKey),
5988
+ style: bt(yt(R.rightKey)),
5989
+ onMouseDown: () => D(R.rightKey),
5990
+ onMouseUp: () => q(R.rightKey),
5991
+ onMouseLeave: () => q(R.rightKey),
5979
5992
  onTouchStart: (gt) => {
5980
- gt.preventDefault(), D(O.rightKey);
5993
+ gt.preventDefault(), D(R.rightKey);
5981
5994
  },
5982
5995
  onTouchEnd: (gt) => {
5983
- gt.preventDefault(), q(O.rightKey);
5996
+ gt.preventDefault(), q(R.rightKey);
5984
5997
  },
5985
- children: O.rightKey.toUpperCase()
5998
+ children: R.rightKey.toUpperCase()
5986
5999
  }
5987
6000
  )
5988
6001
  ] })
5989
- ] }, R.id);
6002
+ ] }, O.id);
5990
6003
  });
5991
6004
  return /* @__PURE__ */ Je("div", { style: { position: "relative", width: "100%", height: "100%" }, children: [
5992
6005
  /* @__PURE__ */ ge(
5993
6006
  "canvas",
5994
6007
  {
5995
6008
  ref: _,
5996
- onPointerDown: (R) => {
5997
- var O;
5998
- x(R, "down"), (O = _.current) == null || O.focus();
6009
+ onPointerDown: (O) => {
6010
+ var R;
6011
+ x(O, "down"), (R = _.current) == null || R.focus();
5999
6012
  },
6000
- onPointerMove: (R) => x(R, "move"),
6001
- onPointerUp: (R) => x(R, "up"),
6002
- onPointerCancel: (R) => x(R, "up"),
6003
- onClick: (R) => x(R, "click"),
6004
- onWheel: (R) => {
6005
- E.current.handleWheel(R.deltaX, R.deltaY);
6013
+ onPointerMove: (O) => x(O, "move"),
6014
+ onPointerUp: (O) => x(O, "up"),
6015
+ onPointerCancel: (O) => x(O, "up"),
6016
+ onClick: (O) => x(O, "click"),
6017
+ onWheel: (O) => {
6018
+ E.current.handleWheel(O.deltaX, O.deltaY);
6006
6019
  },
6007
- onKeyDown: (R) => E.current.handleKeyDown(R.nativeEvent),
6008
- onKeyUp: (R) => E.current.handleKeyUp(R.nativeEvent),
6009
- onContextMenu: (R) => R.preventDefault(),
6020
+ onKeyDown: (O) => E.current.handleKeyDown(O.nativeEvent),
6021
+ onKeyUp: (O) => E.current.handleKeyUp(O.nativeEvent),
6022
+ onContextMenu: (O) => O.preventDefault(),
6010
6023
  tabIndex: 0,
6011
6024
  style: {
6012
6025
  ...i,
@@ -6126,7 +6139,7 @@ const vi = ({ artboard: g, config: t }) => {
6126
6139
  ]
6127
6140
  }
6128
6141
  );
6129
- }, fi = "6.3.35", hi = {
6142
+ }, fi = "6.3.37", hi = {
6130
6143
  version: fi
6131
6144
  }, Si = hi.version;
6132
6145
  export {