@snowcone-app/canvas 0.46.3 → 0.46.6

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 (54) hide show
  1. package/dist/{CanvasRenderer-B8BADU_r.js → CanvasRenderer-CmIQSVCK.js} +4 -4
  2. package/dist/{CanvasRenderer-B8BADU_r.js.map → CanvasRenderer-CmIQSVCK.js.map} +1 -1
  3. package/dist/{ContextualToolbars-5tHC6s0Y.js → ContextualToolbars-Dmo86Wd2.js} +323 -322
  4. package/dist/{ContextualToolbars-5tHC6s0Y.js.map → ContextualToolbars-Dmo86Wd2.js.map} +1 -1
  5. package/dist/{EditorCanvasImpl-CrP9FSoY.js → EditorCanvasImpl-BHa8q4iO.js} +16 -15
  6. package/dist/{EditorCanvasImpl-CrP9FSoY.js.map → EditorCanvasImpl-BHa8q4iO.js.map} +1 -1
  7. package/dist/{ExportManager-xRsXgyNo.js → ExportManager-DEJgxB0S.js} +79 -78
  8. package/dist/{ExportManager-xRsXgyNo.js.map → ExportManager-DEJgxB0S.js.map} +1 -1
  9. package/dist/{FontAnalyzer-Ds3Wdba7.js → FontAnalyzer-CLMJi2Sw.js} +374 -409
  10. package/dist/FontAnalyzer-CLMJi2Sw.js.map +1 -0
  11. package/dist/{ImagePanel-bW3yr6Ac.js → ImagePanel-4fHABjNT.js} +6 -6
  12. package/dist/{ImagePanel-bW3yr6Ac.js.map → ImagePanel-4fHABjNT.js.map} +1 -1
  13. package/dist/{SnowconeCanvas-crxPwbib.js → SnowconeCanvas-GPag5BXG.js} +10 -10
  14. package/dist/{SnowconeCanvas-crxPwbib.js.map → SnowconeCanvas-GPag5BXG.js.map} +1 -1
  15. package/dist/advanced.mjs +54 -54
  16. package/dist/core/image-adjustments.d.ts +2 -4
  17. package/dist/core/masked-crop.d.ts +3 -55
  18. package/dist/{custom-icons-DQRp8GhF.js → custom-icons-Dt0Y4VSn.js} +2 -2
  19. package/dist/{custom-icons-DQRp8GhF.js.map → custom-icons-Dt0Y4VSn.js.map} +1 -1
  20. package/dist/design-builder-HKRo18WT.js +1798 -0
  21. package/dist/design-builder-HKRo18WT.js.map +1 -0
  22. package/dist/{embed-D0f-YvCl.js → embed-DhjsJ3ni.js} +10 -10
  23. package/dist/{embed-D0f-YvCl.js.map → embed-DhjsJ3ni.js.map} +1 -1
  24. package/dist/embed.mjs +35 -36
  25. package/dist/embed.mjs.map +1 -1
  26. package/dist/{export-worker.bundle.string-BL30CYzH.js → export-worker.bundle.string-CyMb_XjB.js} +27 -25
  27. package/dist/{export-worker.bundle.string-BL30CYzH.js.map → export-worker.bundle.string-CyMb_XjB.js.map} +1 -1
  28. package/dist/{guards-DwYEoqcn.js → guards-Dk86a-kH.js} +2 -2
  29. package/dist/{guards-DwYEoqcn.js.map → guards-Dk86a-kH.js.map} +1 -1
  30. package/dist/index.mjs +43 -43
  31. package/dist/internals.mjs +150 -149
  32. package/dist/internals.mjs.map +1 -1
  33. package/dist/rendering/serialize-for-server.d.ts +4 -91
  34. package/dist/state/CanvasStateV1.d.ts +1 -363
  35. package/dist/{CanvasStateV1-BlDWgOzV.js → template-fields-CKEuUmTM.js} +1997 -1835
  36. package/dist/template-fields-CKEuUmTM.js.map +1 -0
  37. package/dist/testing.mjs +61 -60
  38. package/dist/testing.mjs.map +1 -1
  39. package/dist/{useCommands-F-b_SwW-.js → useCommands-BI7O5Lf0.js} +225 -225
  40. package/dist/{useCommands-F-b_SwW-.js.map → useCommands-BI7O5Lf0.js.map} +1 -1
  41. package/dist/{usePieceGuideBundle-BWdobHQE.js → usePieceGuideBundle-DJfjOVEd.js} +2 -2
  42. package/dist/{usePieceGuideBundle-BWdobHQE.js.map → usePieceGuideBundle-DJfjOVEd.js.map} +1 -1
  43. package/dist/utils/custom-fonts.d.ts +2 -16
  44. package/dist/{validation-hn5ZX8Po.js → validation-au_-Sj-A.js} +11 -11
  45. package/dist/{validation-hn5ZX8Po.js.map → validation-au_-Sj-A.js.map} +1 -1
  46. package/dist/workers/export-worker.bundle.string.d.ts +1 -1
  47. package/example/package.json +1 -1
  48. package/package.json +4 -3
  49. package/dist/CanvasStateV1-BlDWgOzV.js.map +0 -1
  50. package/dist/FontAnalyzer-Ds3Wdba7.js.map +0 -1
  51. package/dist/design-builder-sH53Og6j.js +0 -1870
  52. package/dist/design-builder-sH53Og6j.js.map +0 -1
  53. package/dist/template-fields-BaQG0CJY.js +0 -559
  54. package/dist/template-fields-BaQG0CJY.js.map +0 -1
@@ -1,29 +1,30 @@
1
+ import { isNeutralAdjustments as Ot, isLegacyMaskedCrop as Lt, FULL_CROP as be, MASKED_CROP_FRAME as Wt, effectiveImageCrop as Nt, isFullCrop as xe } from "@snowcone-app/design/wire";
1
2
  function Se(o) {
2
3
  return o && o.__esModule && Object.prototype.hasOwnProperty.call(o, "default") ? o.default : o;
3
4
  }
4
- var qt = { exports: {} }, B = qt.exports = {}, _, X;
5
- function Ft() {
5
+ var Jt = { exports: {} }, B = Jt.exports = {}, _, z;
6
+ function Tt() {
6
7
  throw new Error("setTimeout has not been defined");
7
8
  }
8
- function Mt() {
9
+ function Ft() {
9
10
  throw new Error("clearTimeout has not been defined");
10
11
  }
11
12
  (function() {
12
13
  try {
13
- typeof setTimeout == "function" ? _ = setTimeout : _ = Ft;
14
+ typeof setTimeout == "function" ? _ = setTimeout : _ = Tt;
14
15
  } catch {
15
- _ = Ft;
16
+ _ = Tt;
16
17
  }
17
18
  try {
18
- typeof clearTimeout == "function" ? X = clearTimeout : X = Mt;
19
+ typeof clearTimeout == "function" ? z = clearTimeout : z = Ft;
19
20
  } catch {
20
- X = Mt;
21
+ z = Ft;
21
22
  }
22
23
  })();
23
- function jt(o) {
24
+ function qt(o) {
24
25
  if (_ === setTimeout)
25
26
  return setTimeout(o, 0);
26
- if ((_ === Ft || !_) && setTimeout)
27
+ if ((_ === Tt || !_) && setTimeout)
27
28
  return _ = setTimeout, setTimeout(o, 0);
28
29
  try {
29
30
  return _(o, 0);
@@ -36,32 +37,32 @@ function jt(o) {
36
37
  }
37
38
  }
38
39
  function Ce(o) {
39
- if (X === clearTimeout)
40
+ if (z === clearTimeout)
40
41
  return clearTimeout(o);
41
- if ((X === Mt || !X) && clearTimeout)
42
- return X = clearTimeout, clearTimeout(o);
42
+ if ((z === Ft || !z) && clearTimeout)
43
+ return z = clearTimeout, clearTimeout(o);
43
44
  try {
44
- return X(o);
45
+ return z(o);
45
46
  } catch {
46
47
  try {
47
- return X.call(null, o);
48
+ return z.call(null, o);
48
49
  } catch {
49
- return X.call(this, o);
50
+ return z.call(this, o);
50
51
  }
51
52
  }
52
53
  }
53
- var z = [], Q = !1, J, ft = -1;
54
+ var X = [], Q = !1, J, ft = -1;
54
55
  function ve() {
55
- !Q || !J || (Q = !1, J.length ? z = J.concat(z) : ft = -1, z.length && Zt());
56
+ !Q || !J || (Q = !1, J.length ? X = J.concat(X) : ft = -1, X.length && jt());
56
57
  }
57
- function Zt() {
58
+ function jt() {
58
59
  if (!Q) {
59
- var o = jt(ve);
60
+ var o = qt(ve);
60
61
  Q = !0;
61
- for (var t = z.length; t; ) {
62
- for (J = z, z = []; ++ft < t; )
62
+ for (var t = X.length; t; ) {
63
+ for (J = X, X = []; ++ft < t; )
63
64
  J && J[ft].run();
64
- ft = -1, t = z.length;
65
+ ft = -1, t = X.length;
65
66
  }
66
67
  J = null, Q = !1, Ce(o);
67
68
  }
@@ -71,12 +72,12 @@ B.nextTick = function(o) {
71
72
  if (arguments.length > 1)
72
73
  for (var e = 1; e < arguments.length; e++)
73
74
  t[e - 1] = arguments[e];
74
- z.push(new Kt(o, t)), z.length === 1 && !Q && jt(Zt);
75
+ X.push(new Zt(o, t)), X.length === 1 && !Q && qt(jt);
75
76
  };
76
- function Kt(o, t) {
77
+ function Zt(o, t) {
77
78
  this.fun = o, this.array = t;
78
79
  }
79
- Kt.prototype.run = function() {
80
+ Zt.prototype.run = function() {
80
81
  this.fun.apply(null, this.array);
81
82
  };
82
83
  B.title = "browser";
@@ -111,12 +112,12 @@ B.chdir = function(o) {
111
112
  B.umask = function() {
112
113
  return 0;
113
114
  };
114
- var Te = qt.exports;
115
+ var Te = Jt.exports;
115
116
  const mt = /* @__PURE__ */ Se(Te), Fs = [229, 72, 77], Ms = "#000000";
116
- let Xt = 1;
117
+ let _t = 1;
117
118
  class at {
118
119
  constructor(t = {}) {
119
- this.transformType = "artboard", this.id = t.id || `artboard-${Xt++}`, this.name = t.name || `Artboard ${Xt}`, this.x = t.x !== void 0 ? t.x : 0, this.y = t.y !== void 0 ? t.y : 0, this.width = t.width || 1920, this.height = t.height || 1080, this.backgroundColor = t.backgroundColor || "#ffffff", t.backgroundType ? this.backgroundType = t.backgroundType : t.backgroundColor === "transparent" ? this.backgroundType = "transparent" : t.backgroundTexture ? this.backgroundType = "texture" : this.backgroundType = "color", this.backgroundTexture = t.backgroundTexture, this.exportBackground = t.exportBackground ?? !1, this.clipShape = t.clipShape, this.previewBackgroundColor = t.previewBackgroundColor, this.role = t.role, this.distressTexture = t.distressTexture ? { ...t.distressTexture } : void 0, this.imageMask = t.imageMask ? { ...t.imageMask } : void 0, this.elementIds = new Set(t.elementIds || []);
120
+ this.transformType = "artboard", this.id = t.id || `artboard-${_t++}`, this.name = t.name || `Artboard ${_t}`, this.x = t.x !== void 0 ? t.x : 0, this.y = t.y !== void 0 ? t.y : 0, this.width = t.width || 1920, this.height = t.height || 1080, this.backgroundColor = t.backgroundColor || "#ffffff", t.backgroundType ? this.backgroundType = t.backgroundType : t.backgroundColor === "transparent" ? this.backgroundType = "transparent" : t.backgroundTexture ? this.backgroundType = "texture" : this.backgroundType = "color", this.backgroundTexture = t.backgroundTexture, this.exportBackground = t.exportBackground ?? !1, this.clipShape = t.clipShape, this.previewBackgroundColor = t.previewBackgroundColor, this.role = t.role, this.distressTexture = t.distressTexture ? { ...t.distressTexture } : void 0, this.imageMask = t.imageMask ? { ...t.imageMask } : void 0, this.elementIds = new Set(t.elementIds || []);
120
121
  }
121
122
  /**
122
123
  * Get bounding box of the artboard
@@ -816,7 +817,7 @@ class P {
816
817
  return new P(t);
817
818
  }
818
819
  }
819
- const Qt = [
820
+ const Kt = [
820
821
  // Bold/Display Fonts - Perfect for statements and headlines (49 fonts)
821
822
  {
822
823
  name: "Bebas Neue",
@@ -2293,7 +2294,7 @@ const Qt = [
2293
2294
  }
2294
2295
  ];
2295
2296
  function Me() {
2296
- return Qt.map((o) => o.name);
2297
+ return Kt.map((o) => o.name);
2297
2298
  }
2298
2299
  const Ds = {
2299
2300
  system: "System Fonts",
@@ -2307,7 +2308,7 @@ const Ds = {
2307
2308
  decorative: "Decorative & Unique",
2308
2309
  monospace: "Monospace"
2309
2310
  };
2310
- function te(o) {
2311
+ function Qt(o) {
2311
2312
  if (typeof window > "u" || typeof document > "u")
2312
2313
  return "oklch(0% 0 0)";
2313
2314
  const t = o || document.documentElement;
@@ -2316,7 +2317,7 @@ function te(o) {
2316
2317
  function Ae(o) {
2317
2318
  return typeof window > "u" || typeof document > "u" ? "light" : document.documentElement.getAttribute("data-theme") || "light";
2318
2319
  }
2319
- function ee() {
2320
+ function te() {
2320
2321
  return Ae().includes("dark") ? "#60a5fa" : "#3b82f6";
2321
2322
  }
2322
2323
  function Is(o) {
@@ -2326,7 +2327,7 @@ function Is(o) {
2326
2327
  return getComputedStyle(t).getPropertyValue("--color-spacing-indicator").trim() || "#FF0000";
2327
2328
  }
2328
2329
  function ks(o = 0.1, t) {
2329
- const e = te(t);
2330
+ const e = Qt(t);
2330
2331
  if (e.startsWith("oklch("))
2331
2332
  return `${e.slice(0, -1)} / ${o})`;
2332
2333
  if (e.startsWith("#")) {
@@ -2399,7 +2400,7 @@ function _s(o) {
2399
2400
  const t = document.documentElement, e = getComputedStyle(t).getPropertyValue("--foreground").trim();
2400
2401
  return e.startsWith("oklch(") ? `${e.slice(0, -1)} / 0.5)` : e || "oklch(0.2103 0.0059 285.89 / 0.5)";
2401
2402
  }
2402
- const Xs = 1, zs = "#ffffff", Ie = 20, Ys = 6, Us = 24, ke = 16, Ee = 36, Oe = 24, Gs = 4, $s = "#FFFFFF", Vs = 2, Js = 0.1, qs = Me(), js = [8, 10, 12, 14, 16, 18, 20, 24, 28, 32, 36, 48, 64, 72, 96, 128], Z = 0, se = 1.2, ie = 50, Be = 8, Re = 999, He = /* @__PURE__ */ new Set([
2403
+ const zs = 1, Xs = "#ffffff", Ie = 20, Ys = 6, Us = 24, ke = 16, Ee = 36, Oe = 24, Gs = 4, $s = "#FFFFFF", Vs = 2, Js = 0.1, qs = Me(), js = [8, 10, 12, 14, 16, 18, 20, 24, 28, 32, 36, 48, 64, 72, 96, 128], Z = 0, ee = 1.2, se = 50, Be = 8, Re = 999, He = /* @__PURE__ */ new Set([
2403
2404
  "Arial",
2404
2405
  "Arial Black",
2405
2406
  "Verdana",
@@ -2499,33 +2500,33 @@ class Ne {
2499
2500
  this.logger.error(`[${this.scopeName}] ${t}`, ...e);
2500
2501
  }
2501
2502
  }
2502
- const _e = new We(), wt = (o) => _e.scope(o), oe = wt("ImageLoadEvents"), At = /* @__PURE__ */ new Set();
2503
+ const _e = new We(), wt = (o) => _e.scope(o), ie = wt("ImageLoadEvents"), Mt = /* @__PURE__ */ new Set();
2503
2504
  function Zs(o) {
2504
- return At.add(o), () => {
2505
- At.delete(o);
2505
+ return Mt.add(o), () => {
2506
+ Mt.delete(o);
2506
2507
  };
2507
2508
  }
2508
2509
  function st(o) {
2509
- At.forEach((t) => {
2510
+ Mt.forEach((t) => {
2510
2511
  try {
2511
2512
  t(o);
2512
2513
  } catch (e) {
2513
- oe.error("Listener error:", e);
2514
+ ie.error("Listener error:", e);
2514
2515
  }
2515
2516
  });
2516
2517
  }
2517
- const Dt = /* @__PURE__ */ new Set();
2518
+ const At = /* @__PURE__ */ new Set();
2518
2519
  function Ks(o) {
2519
- return Dt.add(o), () => {
2520
- Dt.delete(o);
2520
+ return At.add(o), () => {
2521
+ At.delete(o);
2521
2522
  };
2522
2523
  }
2523
- function Xe(o) {
2524
- Dt.forEach((t) => {
2524
+ function ze(o) {
2525
+ At.forEach((t) => {
2525
2526
  try {
2526
2527
  t(o);
2527
2528
  } catch (e) {
2528
- oe.error("Failure-listener error:", e);
2529
+ ie.error("Failure-listener error:", e);
2529
2530
  }
2530
2531
  });
2531
2532
  }
@@ -2611,16 +2612,8 @@ class q {
2611
2612
  this.cache.clear();
2612
2613
  }
2613
2614
  }
2614
- const Qs = Object.freeze({
2615
- brightness: 1,
2616
- contrast: 1,
2617
- saturation: 1
2618
- }), Ct = 1e-3;
2619
- function Pt(o) {
2620
- return o ? Math.abs(o.brightness - 1) < Ct && Math.abs(o.contrast - 1) < Ct && Math.abs(o.saturation - 1) < Ct : !0;
2621
- }
2622
- function ze(o) {
2623
- if (Pt(o)) return;
2615
+ function Xe(o) {
2616
+ if (Ot(o)) return;
2624
2617
  const t = (e) => Math.round(e * 100) / 100;
2625
2618
  return {
2626
2619
  brightness: t(o.brightness),
@@ -2628,46 +2621,24 @@ function ze(o) {
2628
2621
  saturation: t(o.saturation)
2629
2622
  };
2630
2623
  }
2631
- function ti(o) {
2632
- if (Pt(o)) return "neutral";
2624
+ function Qs(o) {
2625
+ if (Ot(o)) return "neutral";
2633
2626
  const t = o;
2634
2627
  return `b${t.brightness}c${t.contrast}s${t.saturation}`;
2635
2628
  }
2636
- let It = null;
2637
- function ei(o) {
2638
- It = o;
2629
+ let Dt = null;
2630
+ function ti(o) {
2631
+ Dt = o;
2639
2632
  }
2640
2633
  function Ye(o, t) {
2641
- if (Pt(t)) return o;
2642
- if (!It)
2634
+ if (Ot(t)) return o;
2635
+ if (!Dt)
2643
2636
  throw new Error(
2644
2637
  "[image-adjustments] no adjusted-source provider registered. Painting an image with non-neutral adjustments requires the rendering engine: import 'src/rendering/image-adjustments.js' (rendering/element-painters does this for every paint driver; a direct element.render() call in a test must import it too)."
2645
2638
  );
2646
- return It(o, t);
2647
- }
2648
- const kt = "frame", re = Object.freeze({ cropX: 0, cropY: 0, cropWidth: 1, cropHeight: 1 });
2649
- function Ue(o) {
2650
- return Math.abs(o.cropX ?? 0) < 1e-9 && Math.abs(o.cropY ?? 0) < 1e-9 && Math.abs((o.cropWidth ?? 1) - 1) < 1e-9 && Math.abs((o.cropHeight ?? 1) - 1) < 1e-9;
2639
+ return Dt(o, t);
2651
2640
  }
2652
- function Et(o, t) {
2653
- return t && (o == null ? void 0 : o.maskedCrop) !== kt;
2654
- }
2655
- function Ot(o, t) {
2656
- return !o || Et(o, t) ? { ...re } : {
2657
- cropX: o.cropX ?? 0,
2658
- cropY: o.cropY ?? 0,
2659
- cropWidth: o.cropWidth ?? 1,
2660
- cropHeight: o.cropHeight ?? 1
2661
- };
2662
- }
2663
- function si(o, t) {
2664
- const e = Ot(o, t);
2665
- return { width: ((o == null ? void 0 : o.width) ?? 0) * e.cropWidth, height: ((o == null ? void 0 : o.height) ?? 0) * e.cropHeight };
2666
- }
2667
- function ii(o) {
2668
- return Array.isArray(o == null ? void 0 : o.masks) && o.masks.length > 0;
2669
- }
2670
- const it = wt("ImageElement"), zt = 3e4, vt = 3, Ge = 1e3;
2641
+ const it = wt("ImageElement"), zt = 3e4, Ct = 3, Ue = 1e3;
2671
2642
  function S(o) {
2672
2643
  return o.transformData;
2673
2644
  }
@@ -2686,8 +2657,8 @@ class bt extends tt {
2686
2657
  flipHorizontal: ((l = t.transformData) == null ? void 0 : l.flipHorizontal) ?? !1,
2687
2658
  flipVertical: ((c = t.transformData) == null ? void 0 : c.flipVertical) ?? !1,
2688
2659
  borderRadius: ((g = t.transformData) == null ? void 0 : g.borderRadius) ?? 0
2689
- }, Et(t.transformData, this.hasMasks()) && Object.assign(this.transformData, re), this.transformData.maskedCrop = kt;
2690
- const e = ze((d = t.transformData) == null ? void 0 : d.adjustments);
2660
+ }, Lt(t.transformData, this.hasMasks()) && Object.assign(this.transformData, be), this.transformData.maskedCrop = Wt;
2661
+ const e = Xe((d = t.transformData) == null ? void 0 : d.adjustments);
2691
2662
  e && (this.transformData.adjustments = e), (u = t.transformData) != null && u.engrave && (this.transformData.engrave = { ...t.transformData.engrave }), this.imageUrl = t.imageUrl || "", this.imageLoaded = !1, this.imageElement = null, this.imageAspectRatio = t.imageAspectRatio || 1, this.isSvg = ((f = t.imageUrl) == null ? void 0 : f.toLowerCase().endsWith(".svg")) || !1, this.preserveDimensions = t.preserveDimensions ?? !1, this.imageLoadState = t.imageUrl ? "loading" : "loaded", this.imageLoadError = null, this.isCropping = !1, this.onLoadCallback = t.onLoadCallback || null, this.imageUrl && this.loadImage(this.imageUrl);
2692
2663
  }
2693
2664
  /**
@@ -2744,13 +2715,13 @@ class bt extends tt {
2744
2715
  * Handle a load failure - either retry with backoff or set error state.
2745
2716
  */
2746
2717
  handleLoadFailure(t, e, s = "error") {
2747
- if (this.retryAttempt++, this.retryAttempt < vt) {
2748
- const i = Ge * Math.pow(2, this.retryAttempt - 1);
2718
+ if (this.retryAttempt++, this.retryAttempt < Ct) {
2719
+ const i = Ue * Math.pow(2, this.retryAttempt - 1);
2749
2720
  it.warn(`Image load attempt ${this.retryAttempt} failed, retrying in ${i}ms:`, t), this.imageLoadState = "retrying", this.imageLoadError = e, st(this.id), this.loadTimeoutId = setTimeout(() => {
2750
2721
  this.attemptLoadRegularImage(t);
2751
2722
  }, i);
2752
2723
  } else
2753
- it.error(`Image load failed after ${vt} attempts:`, t), this.imageLoaded = !1, this.imageLoadState = "error", this.imageLoadError = e, st(this.id), this.reportTerminalFailure(t, s);
2724
+ it.error(`Image load failed after ${Ct} attempts:`, t), this.imageLoaded = !1, this.imageLoadState = "error", this.imageLoadError = e, st(this.id), this.reportTerminalFailure(t, s);
2754
2725
  }
2755
2726
  /**
2756
2727
  * Probe the failed URL's real HTTP status (one-shot) and emit a structured
@@ -2764,12 +2735,12 @@ class bt extends tt {
2764
2735
  typeof fetch == "function" && i && (s = (await fetch(t, { method: "GET" })).status);
2765
2736
  } catch {
2766
2737
  }
2767
- Xe({
2738
+ ze({
2768
2739
  elementId: this.id,
2769
2740
  url: t,
2770
2741
  isProxied: t.includes("/api/image-proxy"),
2771
2742
  phase: e,
2772
- attempts: vt,
2743
+ attempts: Ct,
2773
2744
  httpStatus: s
2774
2745
  });
2775
2746
  }
@@ -2936,7 +2907,7 @@ class bt extends tt {
2936
2907
  this.transformData.width,
2937
2908
  this.transformData.height
2938
2909
  ), m > 0 && t.restore();
2939
- } else if (this.hasMasks() && Et(this.transformData, !0))
2910
+ } else if (this.hasMasks() && Lt(this.transformData, !0))
2940
2911
  t.drawImage(
2941
2912
  i,
2942
2913
  0,
@@ -3017,8 +2988,8 @@ class bt extends tt {
3017
2988
  if (this.isCropping) {
3018
2989
  const k = i.x, M = i.y, E = S(i).cropWidth * S(i).width, R = S(i).cropHeight * S(i).height;
3019
2990
  this.x = k, this.y = M;
3020
- const H = E / this.transformData.width, O = R / this.transformData.height, W = k - A, N = M - U, _t = new P(this).worldDeltaToLocal(W, N), me = _t.dx, pe = _t.dy, ye = this.transformData.width / 2 + me, we = this.transformData.height / 2 + pe, be = ye / this.transformData.width - H / 2, xe = we / this.transformData.height - O / 2;
3021
- this.transformData.cropX = be, this.transformData.cropY = xe, this.transformData.cropWidth = H, this.transformData.cropHeight = O;
2991
+ const H = E / this.transformData.width, O = R / this.transformData.height, W = k - A, N = M - U, Pt = new P(this).worldDeltaToLocal(W, N), fe = Pt.dx, ue = Pt.dy, me = this.transformData.width / 2 + fe, pe = this.transformData.height / 2 + ue, ye = me / this.transformData.width - H / 2, we = pe / this.transformData.height - O / 2;
2992
+ this.transformData.cropX = ye, this.transformData.cropY = we, this.transformData.cropWidth = H, this.transformData.cropHeight = O;
3022
2993
  } else {
3023
2994
  const k = (this.transformData.cropX + this.transformData.cropWidth / 2) * this.transformData.width - this.transformData.width / 2, M = (this.transformData.cropY + this.transformData.cropHeight / 2) * this.transformData.height - this.transformData.height / 2, E = k, R = M, O = new P(this).localDeltaToWorld(E, R), W = O.dx, N = O.dy;
3024
2995
  this.x = A + W, this.y = U + N;
@@ -3063,7 +3034,7 @@ class bt extends tt {
3063
3034
  * still covers the frame on both axes; 2 = twice that, and so on.
3064
3035
  */
3065
3036
  getPhotoZoom() {
3066
- const t = this.transformData, e = Ot(t, this.hasMasks()), s = Math.max(e.cropWidth, e.cropHeight);
3037
+ const t = this.transformData, e = Nt(t, this.hasMasks()), s = Math.max(e.cropWidth, e.cropHeight);
3067
3038
  return s > 0 ? 1 / s : 1;
3068
3039
  }
3069
3040
  /**
@@ -3072,12 +3043,12 @@ class bt extends tt {
3072
3043
  * photo bounds allow. Zoom is clamped to [1, 10] (crop fractions ≥ 0.1).
3073
3044
  */
3074
3045
  setPhotoZoom(t) {
3075
- const e = this.transformData, s = Ot(e, this.hasMasks());
3076
- if (Ue(s) && !(t > 1)) return;
3046
+ const e = this.transformData, s = Nt(e, this.hasMasks());
3047
+ if (xe(s) && !(t > 1)) return;
3077
3048
  const i = e.width * s.cropWidth, r = e.height * s.cropHeight;
3078
3049
  if (!(i > 0) || !(r > 0) || !(e.width > 0) || !(e.height > 0)) return;
3079
3050
  const h = e.width / e.height, a = Math.max(i, r * h), n = Math.min(10, Math.max(1, Number.isFinite(t) ? t : 1)), l = a * n, c = l / h, g = Math.min(1, i / l), d = Math.min(1, r / c), u = s.cropX + s.cropWidth / 2, f = s.cropY + s.cropHeight / 2;
3080
- e.width = l, e.height = c, e.cropWidth = g, e.cropHeight = d, e.cropX = Math.max(0, Math.min(1 - g, u - g / 2)), e.cropY = Math.max(0, Math.min(1 - d, f - d / 2)), e.maskedCrop = kt;
3051
+ e.width = l, e.height = c, e.cropWidth = g, e.cropHeight = d, e.cropX = Math.max(0, Math.min(1 - g, u - g / 2)), e.cropY = Math.max(0, Math.min(1 - d, f - d / 2)), e.maskedCrop = Wt;
3081
3052
  }
3082
3053
  /**
3083
3054
  * Get crop box bounds in local coordinates (before rotation)
@@ -3386,29 +3357,29 @@ class bt extends tt {
3386
3357
  this.clearLoadTimeout(), this.releaseImageCache(), this.revokeSvgBlobUrl(), this.imageElement = null, this.onLoadCallback = null, this.imageLoadError = null;
3387
3358
  }
3388
3359
  }
3389
- const ne = /* @__PURE__ */ new Map();
3390
- let Bt = null;
3391
- function ae(o) {
3360
+ const oe = /* @__PURE__ */ new Map();
3361
+ let It = null;
3362
+ function re(o) {
3392
3363
  return new Error(
3393
3364
  `[paint-registry] no painter registered for ${o}. Element painting requires the rendering engine: import 'src/rendering/element-painters.js' (every paint driver — CanvasRenderer, ExportManager, ElementPreviewRenderer — does this; a direct element.render() call in a test must import it too).`
3394
3365
  );
3395
3366
  }
3396
- function oi(o, t) {
3397
- ne.set(o, t);
3367
+ function ei(o, t) {
3368
+ oe.set(o, t);
3398
3369
  }
3399
3370
  function ut(o) {
3400
- const t = ne.get(o);
3401
- if (!t) throw ae(`text transform "${o}"`);
3371
+ const t = oe.get(o);
3372
+ if (!t) throw re(`text transform "${o}"`);
3402
3373
  return t;
3403
3374
  }
3404
- function ri(o) {
3405
- Bt = o;
3375
+ function si(o) {
3376
+ It = o;
3406
3377
  }
3407
- function $e() {
3408
- if (!Bt) throw ae("group clipping");
3409
- return Bt;
3378
+ function Ge() {
3379
+ if (!It) throw re("group clipping");
3380
+ return It;
3410
3381
  }
3411
- const Ve = [
3382
+ const $e = [
3412
3383
  "multiply",
3413
3384
  "screen",
3414
3385
  "overlay",
@@ -3611,68 +3582,68 @@ class L {
3611
3582
  return new L(t.spans);
3612
3583
  }
3613
3584
  }
3614
- function ni(o) {
3585
+ function ii(o) {
3615
3586
  return o.type === "custom";
3616
3587
  }
3617
- function ai(o) {
3588
+ function oi(o) {
3618
3589
  return o.type === "circle";
3619
3590
  }
3620
- function hi(o) {
3591
+ function ri(o) {
3621
3592
  return o.type === "arch";
3622
3593
  }
3623
- function li(o) {
3594
+ function ni(o) {
3624
3595
  return o.type === "wave";
3625
3596
  }
3626
- function ci(o) {
3597
+ function ai(o) {
3627
3598
  return o.type === "flag";
3628
3599
  }
3629
- function di(o) {
3600
+ function hi(o) {
3630
3601
  return o.type === "image";
3631
3602
  }
3632
- function gi(o) {
3603
+ function li(o) {
3633
3604
  return o.type === "group";
3634
3605
  }
3635
- function fi(o) {
3606
+ function ci(o) {
3636
3607
  return o.transformType !== "image" && o.transformType !== "group";
3637
3608
  }
3638
- function ui(o) {
3609
+ function di(o) {
3639
3610
  return o.transformType === "image";
3640
3611
  }
3641
- function mi(o) {
3612
+ function gi(o) {
3642
3613
  return o.transformType === "custom";
3643
3614
  }
3644
- function pi(o) {
3615
+ function fi(o) {
3645
3616
  return o.transformType === "circle";
3646
3617
  }
3647
- function yi(o) {
3618
+ function ui(o) {
3648
3619
  return o.transformType === "group";
3649
3620
  }
3650
- function wi(o) {
3621
+ function mi(o) {
3651
3622
  return o.transformType === "shape";
3652
3623
  }
3653
- function bi(o) {
3624
+ function pi(o) {
3654
3625
  return o.transformType === "path";
3655
3626
  }
3656
- function xi(o) {
3627
+ function yi(o) {
3657
3628
  return o.type === "shape";
3658
3629
  }
3659
- function Si(o) {
3630
+ function wi(o) {
3660
3631
  return o.type === "path";
3661
3632
  }
3662
- function Ci(o) {
3633
+ function bi(o) {
3663
3634
  var t;
3664
3635
  return ((t = o.stroke) == null ? void 0 : t.enabled) === !0;
3665
3636
  }
3666
- function vi(o) {
3637
+ function xi(o) {
3667
3638
  return Array.isArray(o.masks) && o.masks.length > 0;
3668
3639
  }
3669
- function Ti(o) {
3640
+ function Si(o) {
3670
3641
  return o.blendMode === "knockout" || o.blendMode === "clip";
3671
3642
  }
3672
- function Fi(o) {
3673
- return Ve.includes(o);
3643
+ function Ci(o) {
3644
+ return $e.includes(o);
3674
3645
  }
3675
- function Mi(o) {
3646
+ function vi(o) {
3676
3647
  var t;
3677
3648
  return ((t = o.distressEffect) == null ? void 0 : t.enabled) === !0;
3678
3649
  }
@@ -3818,20 +3789,20 @@ class j extends tt {
3818
3789
  };
3819
3790
  }
3820
3791
  }
3821
- function Je(o) {
3792
+ function Ve(o) {
3822
3793
  return Array.from(o).length;
3823
3794
  }
3824
3795
  function xt(o, t, e) {
3825
- return e ? o + e * Je(t) : o;
3796
+ return e ? o + e * Ve(t) : o;
3826
3797
  }
3827
- function qe(o, t, e) {
3798
+ function Je(o, t, e) {
3828
3799
  const s = Array.from(t), i = [0];
3829
3800
  let r = "";
3830
3801
  for (let h = 0; h < s.length; h++)
3831
3802
  r += s[h], i.push(o.measureText(r).width + e * (h + 1));
3832
3803
  return i;
3833
3804
  }
3834
- function je(o, t, e) {
3805
+ function qe(o, t, e) {
3835
3806
  switch (o.textAlign) {
3836
3807
  case "center":
3837
3808
  return t - e / 2;
@@ -3842,23 +3813,23 @@ function je(o, t, e) {
3842
3813
  return t;
3843
3814
  }
3844
3815
  }
3845
- function he(o, t, e, s, i, r) {
3816
+ function ne(o, t, e, s, i, r) {
3846
3817
  if (!r || e.length === 0) {
3847
3818
  t[o](e, s, i);
3848
3819
  return;
3849
3820
  }
3850
- const h = qe(t, e, r), a = h[h.length - 1], n = je(t, s, a), l = t.textAlign;
3821
+ const h = Je(t, e, r), a = h[h.length - 1], n = qe(t, s, a), l = t.textAlign;
3851
3822
  t.textAlign = "left";
3852
3823
  const c = Array.from(e);
3853
3824
  for (let g = 0; g < c.length; g++)
3854
3825
  t[o](c[g], n + h[g], i);
3855
3826
  t.textAlign = l;
3856
3827
  }
3857
- function Ai(o, t, e, s, i) {
3858
- he("fillText", o, t, e, s, i);
3828
+ function Ti(o, t, e, s, i) {
3829
+ ne("fillText", o, t, e, s, i);
3859
3830
  }
3860
- function Di(o, t, e, s, i) {
3861
- he("strokeText", o, t, e, s, i);
3831
+ function Fi(o, t, e, s, i) {
3832
+ ne("strokeText", o, t, e, s, i);
3862
3833
  }
3863
3834
  let lt = null;
3864
3835
  function St() {
@@ -3871,14 +3842,14 @@ function St() {
3871
3842
  throw new Error("No canvas available for text measurement");
3872
3843
  return lt;
3873
3844
  }
3874
- function Rt(o) {
3845
+ function kt(o) {
3875
3846
  return 0.5 + Math.max(0, o) * 0.01;
3876
3847
  }
3877
3848
  function ht(o, t, e = !1, s = !1) {
3878
3849
  const i = [];
3879
3850
  return s && i.push("italic"), e && i.push("bold"), i.push(`${o}px`), i.push(t), i.join(" ");
3880
3851
  }
3881
- function Lt(o, t, e, s, i = !1, r = !1, h, a = !1, n) {
3852
+ function Bt(o, t, e, s, i = !1, r = !1, h, a = !1, n) {
3882
3853
  const c = St().getContext("2d");
3883
3854
  c.font = ht(e, s, i, r);
3884
3855
  const g = (n == null ? void 0 : n.letterSpacing) ?? 0, d = (M) => xt(c.measureText(M).width, M, g);
@@ -3889,7 +3860,7 @@ function Lt(o, t, e, s, i = !1, r = !1, h, a = !1, n) {
3889
3860
  const M = o.split(`
3890
3861
  `), E = [];
3891
3862
  for (let R = 0; R < M.length; R++) {
3892
- const H = M[R], O = Lt(H, t, e, s, i, r, void 0, a, n);
3863
+ const H = M[R], O = Bt(H, t, e, s, i, r, void 0, a, n);
3893
3864
  E.push(...O);
3894
3865
  }
3895
3866
  return E;
@@ -3905,12 +3876,12 @@ function Lt(o, t, e, s, i = !1, r = !1, h, a = !1, n) {
3905
3876
  }
3906
3877
  return M.length > 0 && (M[0] = m + M[0], M[M.length - 1] = M[M.length - 1] + y), M;
3907
3878
  }
3908
- const b = w.join(" "), x = m + b + y, T = d(x), D = t < 200, F = a ? Rt(t) : Math.max(20, t * (D ? 0.08 : 0.05));
3879
+ const b = w.join(" "), x = m + b + y, T = d(x), D = t < 200, F = a ? kt(t) : Math.max(20, t * (D ? 0.08 : 0.05));
3909
3880
  if (T <= t + F)
3910
3881
  return [x];
3911
3882
  const v = [];
3912
3883
  let A = "";
3913
- const k = a ? Rt(t) : Math.max(15, t * (D ? 0.05 : 0.03));
3884
+ const k = a ? kt(t) : Math.max(15, t * (D ? 0.05 : 0.03));
3914
3885
  for (let M = 0; M < w.length; M++) {
3915
3886
  const E = w[M];
3916
3887
  if (d(E) > t + k) {
@@ -3939,25 +3910,25 @@ function Lt(o, t, e, s, i = !1, r = !1, h, a = !1, n) {
3939
3910
  }
3940
3911
  return v;
3941
3912
  }
3942
- function Yt(o, t, e, s = !1, i = !1, r = 0) {
3913
+ function Xt(o, t, e, s = !1, i = !1, r = 0) {
3943
3914
  const a = St().getContext("2d");
3944
3915
  return a.font = ht(t, e, s, i), xt(a.measureText(o).width, o, r);
3945
3916
  }
3946
- function Ht(o, t, e = !1, s = !1) {
3917
+ function Et(o, t, e = !1, s = !1) {
3947
3918
  const r = St().getContext("2d");
3948
3919
  r.font = ht(o, t, e, s);
3949
3920
  const a = r.measureText("ÁÉÍgjpqy"), n = a.actualBoundingBoxAscent || o * 0.8, l = a.actualBoundingBoxDescent || o * 0.2, c = n + l;
3950
3921
  return { ascent: n, descent: l, height: c };
3951
3922
  }
3952
- function Ut(o, t, e, s, i = !1, r = !1, h, a = !1, n) {
3953
- const l = (n == null ? void 0 : n.letterSpacing) ?? 0, c = Lt(o, t, e, s, i, r, h, a, n), g = o.includes(`
3923
+ function Yt(o, t, e, s, i = !1, r = !1, h, a = !1, n) {
3924
+ const l = (n == null ? void 0 : n.letterSpacing) ?? 0, c = Bt(o, t, e, s, i, r, h, a, n), g = o.includes(`
3954
3925
  `), d = c.map((x, T) => ({
3955
3926
  isParagraphStart: !g && T === 0,
3956
3927
  isParagraphEnd: !g && T === c.length - 1
3957
3928
  })), f = St().getContext("2d");
3958
3929
  f.font = ht(e, s, i, r);
3959
3930
  let m = 0;
3960
- const y = Ht(e, s, i, r);
3931
+ const y = Et(e, s, i, r);
3961
3932
  let p = 0;
3962
3933
  c.forEach((x, T) => {
3963
3934
  const D = d[T].isParagraphStart, C = d[T].isParagraphEnd;
@@ -3976,7 +3947,7 @@ function Ut(o, t, e, s, i = !1, r = !1, h, a = !1, n) {
3976
3947
  }
3977
3948
  });
3978
3949
  let w;
3979
- const b = (n == null ? void 0 : n.lineHeight) ?? se;
3950
+ const b = (n == null ? void 0 : n.lineHeight) ?? ee;
3980
3951
  if (p === 1)
3981
3952
  w = y.height;
3982
3953
  else if (p === 0)
@@ -3992,7 +3963,7 @@ function Ut(o, t, e, s, i = !1, r = !1, h, a = !1, n) {
3992
3963
  };
3993
3964
  }
3994
3965
  let ct = null;
3995
- function Ze() {
3966
+ function je() {
3996
3967
  if (!ct)
3997
3968
  if (typeof OffscreenCanvas < "u")
3998
3969
  ct = new OffscreenCanvas(1, 1).getContext("2d");
@@ -4002,8 +3973,8 @@ function Ze() {
4002
3973
  throw new Error("No canvas context available");
4003
3974
  return ct;
4004
3975
  }
4005
- function Ke(o, t, e) {
4006
- const s = Ze(), i = [], r = t + Rt(t), h = (p, w) => {
3976
+ function Ze(o, t, e) {
3977
+ const s = je(), i = [], r = t + kt(t), h = (p, w) => {
4007
3978
  const b = w.fontSize || e.fontSize, x = w.fontFamily || e.fontFamily, T = w.bold !== void 0 ? w.bold : e.bold || !1, D = w.italic !== void 0 ? w.italic : e.italic || !1, C = w.letterSpacing !== void 0 ? w.letterSpacing : e.letterSpacing ?? 0;
4008
3979
  return s.font = ht(b, x, T, D), xt(s.measureText(p).width, p, C);
4009
3980
  }, a = (p, w) => p.fontSize === w.fontSize && p.fontFamily === w.fontFamily && p.color === w.color && p.bold === w.bold && p.italic === w.italic && p.underline === w.underline && p.strikethrough === w.strikethrough && p.letterSpacing === w.letterSpacing, n = [];
@@ -4080,7 +4051,7 @@ function Ke(o, t, e) {
4080
4051
  }), m += D;
4081
4052
  }), y(), i.length === 0 && i.push([]), i;
4082
4053
  }
4083
- function Qe(o) {
4054
+ function Ke(o) {
4084
4055
  const t = [];
4085
4056
  let e = [];
4086
4057
  return o.spans.forEach((s) => {
@@ -4094,10 +4065,10 @@ function Qe(o) {
4094
4065
  function ot(o) {
4095
4066
  return typeof o.width == "number" ? o.width : void 0;
4096
4067
  }
4097
- function le(o, t) {
4068
+ function ae(o, t) {
4098
4069
  o.width = t;
4099
4070
  }
4100
- function ts(o, t, e) {
4071
+ function Qe(o, t, e) {
4101
4072
  const s = e.transformData, i = ot(s), r = i !== void 0 ? i : e.width ?? 0, h = t / r, a = e.fontSize ?? o.fontSize, n = a * h;
4102
4073
  let l;
4103
4074
  if (n < 16 ? l = Math.round(n) : l = Math.round(n * 2) / 2, o.setFontSize(l), e.richText && e.richText instanceof L && typeof o.setRichText == "function") {
@@ -4112,31 +4083,31 @@ function ts(o, t, e) {
4112
4083
  const c = o.transformData;
4113
4084
  if (ot(c) !== void 0 && i !== void 0) {
4114
4085
  const d = a > 0 ? l / a : h, u = i * d;
4115
- le(c, Math.max(20, Math.ceil(u)));
4086
+ ae(c, Math.max(20, Math.ceil(u)));
4116
4087
  }
4117
4088
  }
4118
- function es(o, t, e, s) {
4089
+ function ts(o, t, e, s) {
4119
4090
  if (t !== "middle-left" && t !== "middle-right")
4120
4091
  return;
4121
4092
  o.fontSize = s.fontSize ?? o.fontSize;
4122
4093
  const i = o.transformData;
4123
4094
  if (ot(i) !== void 0) {
4124
- le(i, Math.max(ie, e));
4095
+ ae(i, Math.max(se, e));
4125
4096
  const h = I.toRadiansInverse(o.rotation), a = Math.cos(h), n = Math.sin(h), l = s.transformData, g = ot(l) ?? s.width ?? 0, u = (ot(i) ?? 0) - g;
4126
4097
  t === "middle-left" ? (o.x = s.x - u / 2 * a, o.y = s.y - u / 2 * n) : t === "middle-right" && (o.x = s.x + u / 2 * a, o.y = s.y + u / 2 * n);
4127
4098
  }
4128
4099
  }
4129
- function ce(o, t, e, s, i) {
4100
+ function he(o, t, e, s, i) {
4130
4101
  const r = t.includes("top") || t.includes("bottom"), h = t.includes("middle");
4131
- r ? ts(o, e, i) : h && es(o, t, e, i);
4102
+ r ? Qe(o, e, i) : h && ts(o, t, e, i);
4132
4103
  }
4133
- class ss extends j {
4104
+ class es extends j {
4134
4105
  // Temporary property used during resize operations only
4135
4106
  constructor(t = {}) {
4136
4107
  super(t), this.transformType = "custom";
4137
4108
  const e = t.transformData, s = (e == null ? void 0 : e.width) !== void 0 ? e.width : Math.max(
4138
- ie,
4139
- Yt(this.text, this.fontSize, this.fontFamily, this.bold, this.italic, this.letterSpacing ?? 0) + Z * 2
4109
+ se,
4110
+ Xt(this.text, this.fontSize, this.fontFamily, this.bold, this.italic, this.letterSpacing ?? 0) + Z * 2
4140
4111
  );
4141
4112
  this.transformData = {
4142
4113
  type: "custom",
@@ -4149,9 +4120,9 @@ class ss extends j {
4149
4120
  * Returns the total height based on the tallest font in each line
4150
4121
  */
4151
4122
  calculateRichTextHeight() {
4152
- const t = this.getRichText(), e = this.transformData.width - Z * 2, s = Qe(t), i = [];
4123
+ const t = this.getRichText(), e = this.transformData.width - Z * 2, s = Ke(t), i = [];
4153
4124
  if (s.forEach((n) => {
4154
- Ke(n, e, {
4125
+ Ze(n, e, {
4155
4126
  fontSize: this.fontSize,
4156
4127
  fontFamily: this.fontFamily,
4157
4128
  bold: this.bold,
@@ -4165,15 +4136,15 @@ class ss extends j {
4165
4136
  let r = 0, h = 0;
4166
4137
  i.forEach((n) => {
4167
4138
  n.forEach((l) => {
4168
- const c = l.style.fontSize !== void 0 ? l.style.fontSize : this.fontSize, g = l.style.fontFamily !== void 0 ? l.style.fontFamily : this.fontFamily, d = l.style.bold !== void 0 ? l.style.bold : this.bold, u = l.style.italic !== void 0 ? l.style.italic : this.italic, f = Ht(c, g, d, u);
4139
+ const c = l.style.fontSize !== void 0 ? l.style.fontSize : this.fontSize, g = l.style.fontFamily !== void 0 ? l.style.fontFamily : this.fontFamily, d = l.style.bold !== void 0 ? l.style.bold : this.bold, u = l.style.italic !== void 0 ? l.style.italic : this.italic, f = Et(c, g, d, u);
4169
4140
  r = Math.max(r, f.height), h = Math.max(h, f.ascent);
4170
4141
  });
4171
4142
  });
4172
- const a = this.fontSize * (this.lineHeight ?? se);
4143
+ const a = this.fontSize * (this.lineHeight ?? ee);
4173
4144
  if (i.length === 1)
4174
4145
  return r;
4175
4146
  {
4176
- const n = Ht(this.fontSize, this.fontFamily, this.bold, this.italic), l = (i.length - 1) * a + n.height, c = Math.max(0, h - n.ascent), g = Math.max(0, r - h - (n.height - n.ascent));
4147
+ const n = Et(this.fontSize, this.fontFamily, this.bold, this.italic), l = (i.length - 1) * a + n.height, c = Math.max(0, h - n.ascent), g = Math.max(0, r - h - (n.height - n.ascent));
4177
4148
  return l + c + g;
4178
4149
  }
4179
4150
  }
@@ -4195,7 +4166,7 @@ class ss extends j {
4195
4166
  getBoundingBox() {
4196
4167
  const t = this.transformData.width - Z * 2;
4197
4168
  let e;
4198
- return this.hasPerCharacterFormatting() ? e = this.calculateRichTextHeight() : e = Ut(
4169
+ return this.hasPerCharacterFormatting() ? e = this.calculateRichTextHeight() : e = Yt(
4199
4170
  this.text,
4200
4171
  t,
4201
4172
  this.fontSize,
@@ -4222,7 +4193,7 @@ class ss extends j {
4222
4193
  getVisualBoundingBox() {
4223
4194
  const t = this.transformData.width - Z * 2;
4224
4195
  let e;
4225
- this.hasPerCharacterFormatting() ? e = this.calculateRichTextHeight() : e = Ut(
4196
+ this.hasPerCharacterFormatting() ? e = this.calculateRichTextHeight() : e = Yt(
4226
4197
  this.text,
4227
4198
  t,
4228
4199
  this.fontSize,
@@ -4289,7 +4260,7 @@ class ss extends j {
4289
4260
  * Override getTransformStartData to capture initial line count
4290
4261
  */
4291
4262
  getTransformStartData() {
4292
- const t = super.getTransformStartData(), e = this.transformData.width - Z * 2, s = Lt(this.text, e, this.fontSize, this.fontFamily, this.bold, this.italic, void 0, !1, {
4263
+ const t = super.getTransformStartData(), e = this.transformData.width - Z * 2, s = Bt(this.text, e, this.fontSize, this.fontFamily, this.bold, this.italic, void 0, !1, {
4293
4264
  letterSpacing: this.letterSpacing
4294
4265
  });
4295
4266
  return t.lineCount = s.length, t;
@@ -4300,8 +4271,8 @@ class ss extends j {
4300
4271
  * Side handles: only width changes - text re-wraps naturally
4301
4272
  */
4302
4273
  resize(t, e, s, i) {
4303
- if (t === "top-left" || t === "top-right" || t === "bottom-left" || t === "bottom-right" || (this._lockedLineCount = void 0), ce(this, t, e, s, i), this._lockedLineCount !== void 0 && this._lockedLineCount > 0) {
4304
- const a = Yt(
4274
+ if (t === "top-left" || t === "top-right" || t === "bottom-left" || t === "bottom-right" || (this._lockedLineCount = void 0), he(this, t, e, s, i), this._lockedLineCount !== void 0 && this._lockedLineCount > 0) {
4275
+ const a = Xt(
4305
4276
  this.text,
4306
4277
  this.fontSize,
4307
4278
  this.fontFamily,
@@ -4353,7 +4324,7 @@ class ss extends j {
4353
4324
  };
4354
4325
  }
4355
4326
  }
4356
- function is(o, t, e, s) {
4327
+ function ss(o, t, e, s) {
4357
4328
  const i = I.toRadians(s), r = Math.cos(i), h = Math.sin(i);
4358
4329
  let a = 0, n = 0;
4359
4330
  e === "top-left" ? (a = o.width, n = o.height) : e === "top-right" ? (a = 0, n = o.height) : e === "bottom-left" ? (a = o.width, n = 0) : e === "bottom-right" && (a = 0, n = 0);
@@ -4363,14 +4334,14 @@ function is(o, t, e, s) {
4363
4334
  const u = l - (g * r - d * h), f = c - (g * h + d * r);
4364
4335
  return { x: u, y: f };
4365
4336
  }
4366
- function Ii(o, t, e, s = 1) {
4337
+ function Mi(o, t, e, s = 1) {
4367
4338
  const i = o.width / 2, r = o.height + Ie / s, h = o.x + i, a = o.y + r, n = I.toRadians(t), l = Math.cos(n), c = Math.sin(n), g = h - e.x, d = a - e.y, u = g * l - d * c, f = g * c + d * l;
4368
4339
  return {
4369
4340
  x: e.x + u,
4370
4341
  y: e.y + f
4371
4342
  };
4372
4343
  }
4373
- function ki(o, t, e) {
4344
+ function Ai(o, t, e) {
4374
4345
  const s = I.toRadians(t), i = Math.cos(s), r = Math.sin(s), h = (c, g) => {
4375
4346
  const d = o.x + c, u = o.y + g, f = d - e.x, m = u - e.y, y = f * i - m * r, p = f * r + m * i;
4376
4347
  return {
@@ -4378,7 +4349,7 @@ function ki(o, t, e) {
4378
4349
  y: e.y + p
4379
4350
  };
4380
4351
  }, { width: a, height: n } = o, l = (c, g, d, u) => {
4381
- const f = h(d, u), m = os(
4352
+ const f = h(d, u), m = is(
4382
4353
  f.x,
4383
4354
  f.y,
4384
4355
  e.x,
@@ -4407,11 +4378,11 @@ function ki(o, t, e) {
4407
4378
  l("edge", "middle-bottom", a / 2, n)
4408
4379
  ];
4409
4380
  }
4410
- function Ei(o, t, e, s, i) {
4381
+ function Di(o, t, e, s, i) {
4411
4382
  const r = o - e, h = t - s;
4412
4383
  return r * r + h * h <= i * i;
4413
4384
  }
4414
- function Oi(o, t, e, s) {
4385
+ function Ii(o, t, e, s) {
4415
4386
  const i = I.toRadiansInverse(s), r = Math.cos(i), h = Math.sin(i), a = o - e.x, n = t - e.y, l = a * r - n * h, c = a * h + n * r;
4416
4387
  return l >= 0 && l <= e.width && c >= 0 && c <= e.height;
4417
4388
  }
@@ -4419,19 +4390,19 @@ function et(o, t, e = "Arial", s = !1, i = !1) {
4419
4390
  const h = document.createElement("canvas").getContext("2d"), a = s ? "bold" : "normal", n = i ? "italic" : "normal";
4420
4391
  return h.font = `${n} ${a} ${t}px ${e}`, h.measureText(o).width;
4421
4392
  }
4422
- function Bi(o) {
4393
+ function ki(o) {
4423
4394
  return {
4424
4395
  x: o.x + o.width / 2,
4425
4396
  y: o.y + o.height / 2
4426
4397
  };
4427
4398
  }
4428
- function Ri(o, t, e, s) {
4399
+ function Ei(o, t, e, s) {
4429
4400
  return Math.atan2(s - t, e - o);
4430
4401
  }
4431
- function Hi(o, t, e) {
4402
+ function Oi(o, t, e) {
4432
4403
  return Math.abs(o - t) <= e;
4433
4404
  }
4434
- function os(o, t, e, s, i, r = 0, h = "") {
4405
+ function is(o, t, e, s, i, r = 0, h = "") {
4435
4406
  const a = o - e, n = t - s;
4436
4407
  let l = Math.atan2(n, a) * (180 / Math.PI);
4437
4408
  if (l = (l % 360 + 360) % 360, i === "corner") {
@@ -4448,17 +4419,17 @@ function os(o, t, e, s, i, r = 0, h = "") {
4448
4419
  return c >= 45 && c < 135 ? "ns-resize" : "ew-resize";
4449
4420
  }
4450
4421
  }
4451
- function rs(o) {
4422
+ function os(o) {
4452
4423
  if (!o.getTransform)
4453
4424
  return 1;
4454
4425
  const t = o.getTransform();
4455
4426
  return Math.sqrt(t.a * t.a + t.b * t.b);
4456
4427
  }
4457
- function Pi(o, t, e = []) {
4458
- const s = rs(o);
4428
+ function Bi(o, t, e = []) {
4429
+ const s = os(o);
4459
4430
  o.lineWidth = s > 0 ? t / s : t, e.length > 0 && o.setLineDash(s > 0 ? e.map((i) => i / s) : e);
4460
4431
  }
4461
- class ns extends j {
4432
+ class rs extends j {
4462
4433
  constructor(t = {}) {
4463
4434
  super(t), this.transformType = "circle";
4464
4435
  const e = t.transformData;
@@ -4514,7 +4485,7 @@ class ns extends j {
4514
4485
  resize(t, e, s, i) {
4515
4486
  const r = i.transformData, h = (e + s) / 2, a = (i.width + i.height) / 2, n = h / a, l = r.scale * n, c = Math.max(0.1, Math.min(10, l));
4516
4487
  this.transformData.scale = c;
4517
- const g = this.getBoundingBox(), d = is(
4488
+ const g = this.getBoundingBox(), d = ss(
4518
4489
  {
4519
4490
  x: i.x - r.radius * r.scale,
4520
4491
  y: i.y - r.radius * r.scale,
@@ -4588,7 +4559,7 @@ class ns extends j {
4588
4559
  };
4589
4560
  }
4590
4561
  }
4591
- class as extends j {
4562
+ class ns extends j {
4592
4563
  constructor(t = {}) {
4593
4564
  super(t), this.transformType = "arch";
4594
4565
  const e = t.transformData;
@@ -4693,14 +4664,14 @@ const rt = {
4693
4664
  frequency: 2,
4694
4665
  // Standard flag frequency
4695
4666
  width: 200
4696
- }, hs = {
4667
+ }, as = {
4697
4668
  archHeight: 0.5
4698
- }, ls = {
4669
+ }, hs = {
4699
4670
  leanAmount: 0
4700
- }, cs = {
4671
+ }, ls = {
4701
4672
  ascendAngle: -15
4702
4673
  };
4703
- class ds extends j {
4674
+ class cs extends j {
4704
4675
  constructor(t = {}) {
4705
4676
  super(t), this.transformType = "wave";
4706
4677
  const e = t.transformData;
@@ -4748,7 +4719,7 @@ class ds extends j {
4748
4719
  };
4749
4720
  }
4750
4721
  resize(t, e, s, i) {
4751
- ce(this, t, e, s, i);
4722
+ he(this, t, e, s, i);
4752
4723
  }
4753
4724
  getEnabledAnchors() {
4754
4725
  return ["top-left", "top-right", "bottom-left", "bottom-right"];
@@ -4769,7 +4740,7 @@ class ds extends j {
4769
4740
  };
4770
4741
  }
4771
4742
  }
4772
- class gs extends j {
4743
+ class ds extends j {
4773
4744
  constructor(t = {}) {
4774
4745
  super(t), this.transformType = "flag";
4775
4746
  const e = t.transformData;
@@ -4865,7 +4836,7 @@ class gs extends j {
4865
4836
  };
4866
4837
  }
4867
4838
  }
4868
- class fs extends j {
4839
+ class gs extends j {
4869
4840
  constructor(t = {}) {
4870
4841
  super(t), this.transformType = "lean";
4871
4842
  const e = t.transformData;
@@ -4955,7 +4926,7 @@ class fs extends j {
4955
4926
  };
4956
4927
  }
4957
4928
  }
4958
- class us extends j {
4929
+ class fs extends j {
4959
4930
  constructor(t = {}) {
4960
4931
  super(t), this.transformType = "ascend";
4961
4932
  const e = t.transformData;
@@ -5048,23 +5019,23 @@ class us extends j {
5048
5019
  };
5049
5020
  }
5050
5021
  }
5051
- class ms extends Error {
5022
+ class us extends Error {
5052
5023
  constructor(t, e, s = {}) {
5053
5024
  super(`[Editor] ${t}: ${e}`), this.name = "EditorError", this.code = t, this.data = { code: t, ...s };
5054
5025
  }
5055
5026
  }
5056
- function Li(o) {
5027
+ function Ri(o) {
5057
5028
  return o instanceof Error && o.name === "EditorError" && "code" in o;
5058
5029
  }
5059
- function Wi() {
5030
+ function Hi() {
5060
5031
  var o;
5061
5032
  return typeof mt < "u" && ((o = mt.env) == null ? void 0 : o.NODE_ENV) !== "production";
5062
5033
  }
5063
- const de = "#3b82f6", Gt = ["solid", "linear", "radial"];
5034
+ const le = "#3b82f6", Ut = ["solid", "linear", "radial"];
5064
5035
  function V(o, t) {
5065
- return new ms("E_INVALID_FILL", o, t);
5036
+ return new us("E_INVALID_FILL", o, t);
5066
5037
  }
5067
- function ps(o) {
5038
+ function ms(o) {
5068
5039
  if (typeof o != "object" || o === null)
5069
5040
  throw V(
5070
5041
  `shape fill must be an object ({ type: "solid" | "linear" | "radial", ... }), got ${JSON.stringify(o)}.`,
@@ -5099,11 +5070,11 @@ function ps(o) {
5099
5070
  return;
5100
5071
  }
5101
5072
  throw V(
5102
- `unknown shape fill type ${JSON.stringify(t.type)}. Valid types: ${JSON.stringify(Gt)}.`,
5103
- { fill: o, validNames: Gt }
5073
+ `unknown shape fill type ${JSON.stringify(t.type)}. Valid types: ${JSON.stringify(Ut)}.`,
5074
+ { fill: o, validNames: Ut }
5104
5075
  );
5105
5076
  }
5106
- function $t(o) {
5077
+ function Gt(o) {
5107
5078
  switch (o.type) {
5108
5079
  case "solid":
5109
5080
  return { type: "solid", color: o.color };
@@ -5113,28 +5084,28 @@ function $t(o) {
5113
5084
  return { type: "radial", stops: o.stops.map((t) => ({ ...t })) };
5114
5085
  }
5115
5086
  }
5116
- function Vt(o, t) {
5087
+ function $t(o, t) {
5117
5088
  for (const e of t)
5118
5089
  o.addColorStop(Math.min(1, Math.max(0, e.offset)), e.color);
5119
5090
  return o;
5120
5091
  }
5121
5092
  function dt(o, t) {
5122
5093
  const { fill: e } = t;
5123
- if (!e) return t.fillColor || de;
5094
+ if (!e) return t.fillColor || le;
5124
5095
  if (e.type === "solid") return e.color;
5125
5096
  const s = t.width ?? 100, i = t.height ?? 100;
5126
5097
  if (e.type === "linear") {
5127
5098
  const h = e.angle * Math.PI / 180, a = Math.sin(h), n = -Math.cos(h), l = (Math.abs(s * a) + Math.abs(i * n)) / 2;
5128
- return Vt(
5099
+ return $t(
5129
5100
  o.createLinearGradient(-a * l, -n * l, a * l, n * l),
5130
5101
  e.stops
5131
5102
  );
5132
5103
  }
5133
5104
  const r = Math.sqrt(s * s + i * i) / 2;
5134
- return Vt(o.createRadialGradient(0, 0, 0, 0, 0, r), e.stops);
5105
+ return $t(o.createRadialGradient(0, 0, 0, 0, 0, r), e.stops);
5135
5106
  }
5136
- function Ni(o, t) {
5137
- if (!o) return t || de;
5107
+ function Pi(o, t) {
5108
+ if (!o) return t || le;
5138
5109
  switch (o.type) {
5139
5110
  case "solid":
5140
5111
  return o.color;
@@ -5144,12 +5115,12 @@ function Ni(o, t) {
5144
5115
  return `radial-gradient(circle, ${o.stops.map((e) => `${e.color} ${e.offset * 100}%`).join(", ")})`;
5145
5116
  }
5146
5117
  }
5147
- class Wt extends tt {
5118
+ class Rt extends tt {
5148
5119
  constructor(t = {}) {
5149
5120
  var i, r, h, a, n, l, c, g, d, u, f, m;
5150
5121
  super(t), this.transformType = "shape";
5151
5122
  const e = (i = t.transformData) == null ? void 0 : i.fill;
5152
- e !== void 0 && ps(e);
5123
+ e !== void 0 && ms(e);
5153
5124
  const s = "rectangle";
5154
5125
  this.transformData = {
5155
5126
  type: "shape",
@@ -5163,10 +5134,10 @@ class Wt extends tt {
5163
5134
  sides: ((g = t.transformData) == null ? void 0 : g.sides) ?? 5,
5164
5135
  points: ((d = t.transformData) == null ? void 0 : d.points) ?? 5,
5165
5136
  innerRadius: ((u = t.transformData) == null ? void 0 : u.innerRadius) ?? 0.4,
5166
- fillColor: ((f = t.transformData) == null ? void 0 : f.fillColor) || ee(),
5137
+ fillColor: ((f = t.transformData) == null ? void 0 : f.fillColor) || te(),
5167
5138
  fillOpacity: ((m = t.transformData) == null ? void 0 : m.fillOpacity) ?? 1,
5168
5139
  // Deep-copy so a config's stops array is never aliased by the element
5169
- ...e !== void 0 && { fill: $t(e) }
5140
+ ...e !== void 0 && { fill: Gt(e) }
5170
5141
  };
5171
5142
  }
5172
5143
  /**
@@ -5613,7 +5584,7 @@ class Wt extends tt {
5613
5584
  * Clone this element
5614
5585
  */
5615
5586
  clone() {
5616
- return new Wt(this.toJSON());
5587
+ return new Rt(this.toJSON());
5617
5588
  }
5618
5589
  /**
5619
5590
  * Serialize to JSON
@@ -5635,12 +5606,12 @@ class Wt extends tt {
5635
5606
  ...this.transformData,
5636
5607
  // Deep-copy gradient stops — a spread would alias the stops array
5637
5608
  // between the element and its serialized config (fidelity sweep pin)
5638
- ...this.transformData.fill && { fill: $t(this.transformData.fill) }
5609
+ ...this.transformData.fill && { fill: Gt(this.transformData.fill) }
5639
5610
  }
5640
5611
  };
5641
5612
  }
5642
5613
  }
5643
- class Nt extends tt {
5614
+ class Ht extends tt {
5644
5615
  constructor(t = {}) {
5645
5616
  var e, s, i, r, h, a, n, l, c, g;
5646
5617
  super(t), this.transformType = "path", this.transformData = {
@@ -5650,7 +5621,7 @@ class Nt extends tt {
5650
5621
  width: ((i = t.transformData) == null ? void 0 : i.width) || 200,
5651
5622
  height: ((r = t.transformData) == null ? void 0 : r.height) || 200,
5652
5623
  fillEnabled: ((h = t.transformData) == null ? void 0 : h.fillEnabled) ?? !1,
5653
- fillColor: ((a = t.transformData) == null ? void 0 : a.fillColor) || ee(),
5624
+ fillColor: ((a = t.transformData) == null ? void 0 : a.fillColor) || te(),
5654
5625
  fillOpacity: ((n = t.transformData) == null ? void 0 : n.fillOpacity) ?? 1,
5655
5626
  strokeEnabled: ((l = t.transformData) == null ? void 0 : l.strokeEnabled) ?? !0,
5656
5627
  strokeColor: ((c = t.transformData) == null ? void 0 : c.strokeColor) || "#000000",
@@ -5916,7 +5887,7 @@ class Nt extends tt {
5916
5887
  * Clone this element
5917
5888
  */
5918
5889
  clone() {
5919
- return new Nt(this.toJSON());
5890
+ return new Ht(this.toJSON());
5920
5891
  }
5921
5892
  /**
5922
5893
  * Serialize to JSON
@@ -5946,7 +5917,7 @@ class Nt extends tt {
5946
5917
  };
5947
5918
  }
5948
5919
  }
5949
- const ys = {
5920
+ const ps = {
5950
5921
  circle: [
5951
5922
  {
5952
5923
  key: "reverse",
@@ -5959,7 +5930,7 @@ const ys = {
5959
5930
  {
5960
5931
  key: "archHeight",
5961
5932
  label: "Arch Height",
5962
- defaultInternalValue: hs.archHeight,
5933
+ defaultInternalValue: as.archHeight,
5963
5934
  // Slider 0-100 maps to internal -1 to 1
5964
5935
  toSlider: (o) => (o + 1) / 2 * 100,
5965
5936
  fromSlider: (o) => o / 100 * 2 - 1,
@@ -6012,7 +5983,7 @@ const ys = {
6012
5983
  {
6013
5984
  key: "leanAmount",
6014
5985
  label: "Lean Amount",
6015
- defaultInternalValue: ls.leanAmount,
5986
+ defaultInternalValue: hs.leanAmount,
6016
5987
  // Slider 0-100 maps to internal -0.5 to 0.5
6017
5988
  // Display as -100% to 100%
6018
5989
  toSlider: (o) => (o + 0.5) * 100,
@@ -6024,7 +5995,7 @@ const ys = {
6024
5995
  {
6025
5996
  key: "ascendAngle",
6026
5997
  label: "Ascend Amount",
6027
- defaultInternalValue: cs.ascendAngle,
5998
+ defaultInternalValue: ls.ascendAngle,
6028
5999
  // Slider 0-100 maps to internal angle +30° to -30°
6029
6000
  // Display: slider 0 = -100% (down), slider 50 = 0%, slider 100 = +100% (up)
6030
6001
  toSlider: (o) => (30 - o) / 60 * 100,
@@ -6100,19 +6071,19 @@ const ys = {
6100
6071
  toDisplay: (o) => `${(o * 100).toFixed(0)}%`
6101
6072
  }
6102
6073
  ]
6103
- }, ge = [
6104
- { id: "custom", label: "CUSTOM", Component: ss },
6074
+ }, ce = [
6075
+ { id: "custom", label: "CUSTOM", Component: es },
6105
6076
  // NOTE: distort transform is not yet implemented. Removed from registry
6106
6077
  // to prevent it from appearing in UI that iterates over registered transforms.
6107
6078
  // Re-add with a valid Component when implementation is ready.
6108
- { id: "circle", label: "CIRCLE", Component: ns },
6109
- { id: "lean", label: "LEAN", Component: fs },
6110
- { id: "arch", label: "ARCH", Component: as },
6111
- { id: "ascend", label: "ASCEND", Component: us },
6112
- { id: "wave", label: "WAVE", Component: ds },
6113
- { id: "flag", label: "FLAG", Component: gs },
6114
- { id: "shape", label: "SHAPE", Component: Wt },
6115
- { id: "path", label: "PATH", Component: Nt },
6079
+ { id: "circle", label: "CIRCLE", Component: rs },
6080
+ { id: "lean", label: "LEAN", Component: gs },
6081
+ { id: "arch", label: "ARCH", Component: ns },
6082
+ { id: "ascend", label: "ASCEND", Component: fs },
6083
+ { id: "wave", label: "WAVE", Component: cs },
6084
+ { id: "flag", label: "FLAG", Component: ds },
6085
+ { id: "shape", label: "SHAPE", Component: Rt },
6086
+ { id: "path", label: "PATH", Component: Ht },
6116
6087
  { id: "image", label: "IMAGE", Component: bt },
6117
6088
  // Use a getter to break circular dependency: GroupElement imports getTransformById
6118
6089
  // from this module, so GroupElement may be in the TDZ during module evaluation.
@@ -6120,9 +6091,9 @@ const ys = {
6120
6091
  { id: "group", label: "GROUP", get Component() {
6121
6092
  return yt;
6122
6093
  } }
6123
- ], fe = new Set(ge.map((o) => o.id)), pt = /* @__PURE__ */ new Map();
6124
- function _i(o, t) {
6125
- if (fe.has(o))
6094
+ ], de = new Set(ce.map((o) => o.id)), pt = /* @__PURE__ */ new Map();
6095
+ function Li(o, t) {
6096
+ if (de.has(o))
6126
6097
  throw new Error(
6127
6098
  `Cannot register transform type "${o}": conflicts with built-in type`
6128
6099
  );
@@ -6132,19 +6103,19 @@ function _i(o, t) {
6132
6103
  );
6133
6104
  pt.set(o, t);
6134
6105
  }
6135
- function Xi(o) {
6136
- if (fe.has(o))
6106
+ function Wi(o) {
6107
+ if (de.has(o))
6137
6108
  throw new Error(
6138
6109
  `Cannot unregister transform type "${o}": built-in types cannot be removed`
6139
6110
  );
6140
6111
  return pt.delete(o);
6141
6112
  }
6142
- function ws(o) {
6143
- const t = ge.find((e) => e.id === o);
6113
+ function ys(o) {
6114
+ const t = ce.find((e) => e.id === o);
6144
6115
  return t || pt.get(o);
6145
6116
  }
6146
- function zi(o) {
6147
- return ys[o] || [];
6117
+ function Ni(o) {
6118
+ return ps[o] || [];
6148
6119
  }
6149
6120
  class yt extends tt {
6150
6121
  constructor(t = {}) {
@@ -6161,7 +6132,7 @@ class yt extends tt {
6161
6132
  */
6162
6133
  // eslint-disable-next-line @typescript-eslint/no-explicit-any -- JSON deserialization: config comes from toJSON() and constructors accept Partial<Config> with varying signatures
6163
6134
  _reconstructChildFromJSON(t) {
6164
- const e = t.transformType || t.type, s = ws(e);
6135
+ const e = t.transformType || t.type, s = ys(e);
6165
6136
  if (!s || !s.Component)
6166
6137
  throw new Error(`Unknown transform type: ${e}`);
6167
6138
  return new s.Component(t);
@@ -6248,7 +6219,7 @@ class yt extends tt {
6248
6219
  */
6249
6220
  render(t, e = !1, s = !1) {
6250
6221
  const i = this.children.filter((h) => h.visible !== !1);
6251
- i.some((h) => h.isClipping) ? $e()(t, i) : i.forEach((h) => {
6222
+ i.some((h) => h.isClipping) ? Ge()(t, i) : i.forEach((h) => {
6252
6223
  h.render(t, !1);
6253
6224
  }), e ? this._renderGroupOutline(t, 1) : s && this._renderGroupOutline(t, 0.3);
6254
6225
  }
@@ -6258,7 +6229,7 @@ class yt extends tt {
6258
6229
  */
6259
6230
  _renderGroupOutline(t, e = 1) {
6260
6231
  const s = this.getOrientedBoundingBox();
6261
- t.save(), t.globalAlpha = e, t.strokeStyle = te(), t.lineWidth = 2, t.setLineDash([5, 5]);
6232
+ t.save(), t.globalAlpha = e, t.strokeStyle = Qt(), t.lineWidth = 2, t.setLineDash([5, 5]);
6262
6233
  const i = this._rotationCenterX || this.x, r = this._rotationCenterY || this.y;
6263
6234
  this.rotation !== 0 && (t.translate(i, r), t.rotate(-this.rotation * Math.PI / 180), t.translate(-i, -r)), t.strokeRect(s.x, s.y, s.width, s.height), t.setLineDash([]), t.restore();
6264
6235
  }
@@ -6605,7 +6576,7 @@ class $ {
6605
6576
  throw new Error("Command.undo() must be implemented");
6606
6577
  }
6607
6578
  }
6608
- class Yi extends $ {
6579
+ class _i extends $ {
6609
6580
  constructor(t, e, s, i) {
6610
6581
  super(), this.elementId = t, this.oldElement = e ? e.clone() : null, this.newElement = s ? s.clone() : null, this.onUpdate = i;
6611
6582
  }
@@ -6616,7 +6587,7 @@ class Yi extends $ {
6616
6587
  this.oldElement && this.onUpdate(this.oldElement);
6617
6588
  }
6618
6589
  }
6619
- class Ui extends $ {
6590
+ class zi extends $ {
6620
6591
  constructor(t, e, s) {
6621
6592
  super(), this.element = t.clone(), this.onAdd = e, this.onRemove = s;
6622
6593
  }
@@ -6627,7 +6598,7 @@ class Ui extends $ {
6627
6598
  this.onRemove(this.element.id);
6628
6599
  }
6629
6600
  }
6630
- class Gi extends $ {
6601
+ class Xi extends $ {
6631
6602
  constructor(t, e, s) {
6632
6603
  super(), this.element = t.clone(), this.onAdd = e, this.onRemove = s;
6633
6604
  }
@@ -6638,7 +6609,7 @@ class Gi extends $ {
6638
6609
  this.onAdd(this.element);
6639
6610
  }
6640
6611
  }
6641
- class bs extends $ {
6612
+ class ws extends $ {
6642
6613
  constructor(t) {
6643
6614
  super(), this.commands = t;
6644
6615
  }
@@ -6670,7 +6641,7 @@ class gt {
6670
6641
  executeBatch(t) {
6671
6642
  if (t.length === 0)
6672
6643
  return;
6673
- const e = new bs(t);
6644
+ const e = new ws(t);
6674
6645
  this.execute(e);
6675
6646
  }
6676
6647
  /**
@@ -6715,7 +6686,7 @@ class gt {
6715
6686
  };
6716
6687
  }
6717
6688
  }
6718
- class $i extends $ {
6689
+ class Yi extends $ {
6719
6690
  constructor(t, e) {
6720
6691
  super(), this.artboard = t.clone(), this.artboardManager = e;
6721
6692
  }
@@ -6735,7 +6706,7 @@ class $i extends $ {
6735
6706
  this.artboardManager.deleteArtboard(this.artboard.id);
6736
6707
  }
6737
6708
  }
6738
- class Vi extends $ {
6709
+ class Ui extends $ {
6739
6710
  constructor(t, e) {
6740
6711
  super(), this.artboard = t.clone(), this.artboardManager = e, this.elementsOnArtboard = t.getElementIds();
6741
6712
  }
@@ -6758,7 +6729,7 @@ class Vi extends $ {
6758
6729
  });
6759
6730
  }
6760
6731
  }
6761
- class Ji extends $ {
6732
+ class Gi extends $ {
6762
6733
  constructor(t, e, s, i) {
6763
6734
  super(), this.artboardId = t, this.oldProperties = { ...e }, this.newProperties = { ...s }, this.artboardManager = i;
6764
6735
  }
@@ -6769,7 +6740,7 @@ class Ji extends $ {
6769
6740
  this.artboardManager.updateArtboard(this.artboardId, this.oldProperties);
6770
6741
  }
6771
6742
  }
6772
- class qi extends $ {
6743
+ class $i extends $ {
6773
6744
  constructor(t, e, s, i, r) {
6774
6745
  super(), this.draggedId = t, this.targetId = e, this.position = s, this.oldOrder = [...i], this.onReorder = r, this.newOrder = this.calculateNewOrder();
6775
6746
  }
@@ -6789,8 +6760,8 @@ class qi extends $ {
6789
6760
  this.onReorder(this.oldOrder);
6790
6761
  }
6791
6762
  }
6792
- const xs = wt("HybridHistoryManager");
6793
- class ji {
6763
+ const bs = wt("HybridHistoryManager");
6764
+ class Vi {
6794
6765
  constructor(t, e = 50) {
6795
6766
  this.commandExecutedCallbacks = [], this.globalHistory = new gt(e), this.artboardHistories = /* @__PURE__ */ new Map(), this.lastOperation = null, this.artboardManager = t, this.maxHistorySize = e;
6796
6767
  }
@@ -6812,7 +6783,7 @@ class ji {
6812
6783
  try {
6813
6784
  i(t, e, s);
6814
6785
  } catch (r) {
6815
- xs.error("Error in command executed callback:", r);
6786
+ bs.error("Error in command executed callback:", r);
6816
6787
  }
6817
6788
  }
6818
6789
  /**
@@ -7084,23 +7055,23 @@ class ji {
7084
7055
  return this.canRedoGlobal() ? "Redo artboard operation" : "Nothing to redo";
7085
7056
  }
7086
7057
  }
7087
- let Jt = null;
7088
- function Ss(o) {
7089
- return Jt ?? (Jt = new Map(Qt.filter((t) => {
7058
+ let Vt = null;
7059
+ function xs(o) {
7060
+ return Vt ?? (Vt = new Map(Kt.filter((t) => {
7090
7061
  var e;
7091
7062
  return (e = t.weights) == null ? void 0 : e.length;
7092
- }).map((t) => [t.name, t.weights]))), Jt.get(o);
7063
+ }).map((t) => [t.name, t.weights]))), Vt.get(o);
7093
7064
  }
7094
- function Cs(o, t) {
7095
- const e = Ss(o);
7065
+ function Ss(o, t) {
7066
+ const e = xs(o);
7096
7067
  return !e || e.includes(t) ? t : e.reduce((s, i) => Math.abs(i - t) < Math.abs(s - t) ? i : s, e[0]);
7097
7068
  }
7098
7069
  const G = wt("FontAnalyzer");
7099
- let Tt = null;
7100
- async function vs() {
7101
- return Tt || (Tt = await import("./browser-module-DFvKXBUE.js")), Tt;
7070
+ let vt = null;
7071
+ async function Cs() {
7072
+ return vt || (vt = await import("./browser-module-DFvKXBUE.js")), vt;
7102
7073
  }
7103
- class Ts {
7074
+ class vs {
7104
7075
  constructor() {
7105
7076
  this.fontCache = /* @__PURE__ */ new Map(), this.failedFonts = /* @__PURE__ */ new Set(), this.CACHE_DURATION = 1e3 * 60 * 30, this.MAX_CACHE_SIZE = 5;
7106
7077
  }
@@ -7126,7 +7097,7 @@ class Ts {
7126
7097
  * Get Google Fonts API URL for a specific font family
7127
7098
  */
7128
7099
  getGoogleFontUrl(t, e = 400) {
7129
- return `https://fonts.googleapis.com/css2?family=${t.replace(/\s+/g, "+")}:wght@${Cs(t, e)}&display=swap`;
7100
+ return `https://fonts.googleapis.com/css2?family=${t.replace(/\s+/g, "+")}:wght@${Ss(t, e)}&display=swap`;
7130
7101
  }
7131
7102
  /**
7132
7103
  * Extract actual font file URL from Google Fonts CSS
@@ -7168,7 +7139,7 @@ class Ts {
7168
7139
  const h = await fetch(r);
7169
7140
  if (!h.ok)
7170
7141
  return G.error(`Font fetch failed: ${h.status} ${h.statusText}`), this.failedFonts.add(s), null;
7171
- const a = await h.arrayBuffer(), n = new Uint8Array(a), c = (await vs()).create(n), g = "fonts" in c ? c.fonts[0] : c;
7142
+ const a = await h.arrayBuffer(), n = new Uint8Array(a), c = (await Cs()).create(n), g = "fonts" in c ? c.fonts[0] : c;
7172
7143
  return this.fontCache.set(s, {
7173
7144
  font: g,
7174
7145
  url: r,
@@ -7519,147 +7490,141 @@ class Ts {
7519
7490
  };
7520
7491
  }
7521
7492
  }
7522
- const Zi = new Ts();
7493
+ const Ji = new vs();
7523
7494
  export {
7524
- ii as $,
7495
+ is as $,
7525
7496
  at as A,
7526
- Ui as B,
7527
- ns as C,
7528
- $i as D,
7497
+ Gi as B,
7498
+ rs as C,
7499
+ Ui as D,
7529
7500
  K as E,
7530
- gs as F,
7501
+ ds as F,
7531
7502
  yt as G,
7532
- ji as H,
7503
+ Vi as H,
7533
7504
  bt as I,
7534
- Vi as J,
7505
+ $i as J,
7535
7506
  Ji as K,
7536
- fs as L,
7537
- qi as M,
7538
- Be as N,
7539
- Re as O,
7540
- Nt as P,
7541
- zs as Q,
7542
- Gi as R,
7543
- Wt as S,
7507
+ gs as L,
7508
+ Be as M,
7509
+ Re as N,
7510
+ Xs as O,
7511
+ Ht as P,
7512
+ Ms as Q,
7513
+ Xi as R,
7514
+ Rt as S,
7544
7515
  j as T,
7545
- Yi as U,
7546
- Ms as V,
7547
- ds as W,
7548
- hs as X,
7549
- rt as Y,
7550
- Li as Z,
7551
- Wi as _,
7552
- ti as a,
7553
- ps as a$,
7554
- Ot as a0,
7555
- Ue as a1,
7556
- te as a2,
7557
- os as a3,
7558
- ke as a4,
7559
- P as a5,
7560
- Ri as a6,
7561
- I as a7,
7562
- Hi as a8,
7563
- Gs as a9,
7564
- Mi as aA,
7565
- vi as aB,
7566
- Ci as aC,
7567
- hi as aD,
7568
- pi as aE,
7569
- ai as aF,
7570
- mi as aG,
7571
- ni as aH,
7572
- ci as aI,
7573
- yi as aJ,
7574
- gi as aK,
7575
- ui as aL,
7576
- di as aM,
7577
- Ti as aN,
7578
- bi as aO,
7579
- Si as aP,
7580
- wi as aQ,
7581
- xi as aR,
7582
- fi as aS,
7583
- li as aT,
7584
- se as aU,
7585
- oi as aV,
7586
- ri as aW,
7587
- q as aX,
7588
- si as aY,
7589
- Fi as aZ,
7590
- Qt as a_,
7591
- Hs as aa,
7592
- Ps as ab,
7593
- Fs as ac,
7594
- Rs as ad,
7595
- De as ae,
7596
- Bs as af,
7597
- Os as ag,
7598
- Z as ah,
7599
- ht as ai,
7600
- xt as aj,
7601
- Di as ak,
7602
- Ai as al,
7603
- Ut as am,
7604
- Pe as an,
7605
- Is as ao,
7606
- Vs as ap,
7607
- $s as aq,
7608
- Es as ar,
7609
- Ys as as,
7610
- Us as at,
7611
- Xs as au,
7612
- js as av,
7613
- _i as aw,
7614
- Xi as ax,
7615
- tt as ay,
7616
- L as az,
7516
+ _i as U,
7517
+ as as V,
7518
+ cs as W,
7519
+ rt as X,
7520
+ Ri as Y,
7521
+ Hi as Z,
7522
+ Qt as _,
7523
+ Qs as a,
7524
+ ce as a$,
7525
+ ke as a0,
7526
+ P as a1,
7527
+ Ei as a2,
7528
+ I as a3,
7529
+ Oi as a4,
7530
+ Gs as a5,
7531
+ Hs as a6,
7532
+ Ps as a7,
7533
+ Fs as a8,
7534
+ Rs as a9,
7535
+ fi as aA,
7536
+ oi as aB,
7537
+ gi as aC,
7538
+ ii as aD,
7539
+ ai as aE,
7540
+ ui as aF,
7541
+ li as aG,
7542
+ di as aH,
7543
+ hi as aI,
7544
+ Si as aJ,
7545
+ pi as aK,
7546
+ wi as aL,
7547
+ mi as aM,
7548
+ yi as aN,
7549
+ ci as aO,
7550
+ ni as aP,
7551
+ ee as aQ,
7552
+ ei as aR,
7553
+ si as aS,
7554
+ q as aT,
7555
+ Ci as aU,
7556
+ Kt as aV,
7557
+ ms as aW,
7558
+ Gt as aX,
7559
+ Xe as aY,
7560
+ Pi as aZ,
7561
+ Ds as a_,
7562
+ De as aa,
7563
+ Bs as ab,
7564
+ Os as ac,
7565
+ Z as ad,
7566
+ ht as ae,
7567
+ xt as af,
7568
+ Fi as ag,
7569
+ Ti as ah,
7570
+ Yt as ai,
7571
+ Pe as aj,
7572
+ Is as ak,
7573
+ Vs as al,
7574
+ $s as am,
7575
+ Es as an,
7576
+ Ys as ao,
7577
+ Us as ap,
7578
+ zs as aq,
7579
+ js as ar,
7580
+ Li as as,
7581
+ Wi as at,
7582
+ tt as au,
7583
+ L as av,
7584
+ vi as aw,
7585
+ xi as ax,
7586
+ bi as ay,
7587
+ ri as az,
7617
7588
  dt as b,
7618
- $t as b0,
7619
- ze as b1,
7620
- Ni as b2,
7621
- Ds as b3,
7622
- ge as b4,
7623
- zi as b5,
7624
- qs as b6,
7625
- ls as b7,
7626
- nt as b8,
7627
- Qs as b9,
7628
- Ve as ba,
7629
- Lt as bb,
7630
- ee as bc,
7631
- Ws as bd,
7632
- Ns as be,
7633
- _s as bf,
7634
- Js as bg,
7635
- Pi as bh,
7636
- Ie as bi,
7637
- ks as bj,
7638
- Ls as bk,
7639
- Bi as bl,
7589
+ Ni as b0,
7590
+ qs as b1,
7591
+ hs as b2,
7592
+ nt as b3,
7593
+ $e as b4,
7594
+ Bt as b5,
7595
+ te as b6,
7596
+ Ws as b7,
7597
+ Ns as b8,
7598
+ _s as b9,
7599
+ Js as ba,
7600
+ Bi as bb,
7601
+ Ie as bc,
7602
+ ks as bd,
7603
+ Ls as be,
7604
+ ki as bf,
7640
7605
  wt as c,
7641
- as as d,
7606
+ ns as d,
7642
7607
  As as e,
7643
- us as f,
7644
- ss as g,
7608
+ fs as f,
7609
+ es as g,
7645
7610
  Le as h,
7646
- Pt as i,
7647
- is as j,
7648
- ki as k,
7649
- Ii as l,
7650
- Ei as m,
7651
- Oi as n,
7652
- _e as o,
7611
+ ss as i,
7612
+ Ai as j,
7613
+ Mi as k,
7614
+ Di as l,
7615
+ Ii as m,
7616
+ _e as n,
7617
+ ys as o,
7653
7618
  mt as p,
7654
- ws as q,
7655
- ei as r,
7656
- Qe as s,
7657
- ms as t,
7658
- Zs as u,
7659
- Ht as v,
7660
- Ke as w,
7661
- Yt as x,
7662
- Ks as y,
7663
- Zi as z
7619
+ us as q,
7620
+ ti as r,
7621
+ Ke as s,
7622
+ Zs as t,
7623
+ Et as u,
7624
+ Xt as v,
7625
+ Ze as w,
7626
+ Ks as x,
7627
+ zi as y,
7628
+ Yi as z
7664
7629
  };
7665
- //# sourceMappingURL=FontAnalyzer-Ds3Wdba7.js.map
7630
+ //# sourceMappingURL=FontAnalyzer-CLMJi2Sw.js.map