@snowcone-app/canvas 0.34.0 → 0.35.1

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 (44) hide show
  1. package/dist/{CanvasRenderer-1j-twIbs.js → CanvasRenderer-BHBCxI-B.js} +4 -4
  2. package/dist/{CanvasRenderer-1j-twIbs.js.map → CanvasRenderer-BHBCxI-B.js.map} +1 -1
  3. package/dist/{CanvasStateV1-BmC1JfPv.js → CanvasStateV1-BoG8ld4D.js} +3 -3
  4. package/dist/{CanvasStateV1-BmC1JfPv.js.map → CanvasStateV1-BoG8ld4D.js.map} +1 -1
  5. package/dist/{ContextualToolbars-BxnFwtTH.js → ContextualToolbars-TCO7dzu6.js} +6 -6
  6. package/dist/{ContextualToolbars-BxnFwtTH.js.map → ContextualToolbars-TCO7dzu6.js.map} +1 -1
  7. package/dist/{EditorCanvasImpl-B9GjC1h6.js → EditorCanvasImpl-Dl75xnjk.js} +7 -7
  8. package/dist/{EditorCanvasImpl-B9GjC1h6.js.map → EditorCanvasImpl-Dl75xnjk.js.map} +1 -1
  9. package/dist/{ExportManager-Ci81K6xA.js → ExportManager-D1PAlOiE.js} +2 -2
  10. package/dist/{ExportManager-Ci81K6xA.js.map → ExportManager-D1PAlOiE.js.map} +1 -1
  11. package/dist/{FontAnalyzer-BrKY6XYn.js → FontAnalyzer-CEYA_6fY.js} +476 -439
  12. package/dist/FontAnalyzer-CEYA_6fY.js.map +1 -0
  13. package/dist/{ImagePanel-Ih9e9cOQ.js → ImagePanel-Duh1AMdF.js} +6 -6
  14. package/dist/{ImagePanel-Ih9e9cOQ.js.map → ImagePanel-Duh1AMdF.js.map} +1 -1
  15. package/dist/{SnowconeCanvas-B4Nhk7JQ.js → SnowconeCanvas-h8cfofsO.js} +296 -292
  16. package/dist/{SnowconeCanvas-B4Nhk7JQ.js.map → SnowconeCanvas-h8cfofsO.js.map} +1 -1
  17. package/dist/advanced.mjs +14 -14
  18. package/dist/api/stable.d.ts +1 -0
  19. package/dist/components/embed/SnowconeCanvas.d.ts +9 -0
  20. package/dist/core/ImageElement.d.ts +6 -0
  21. package/dist/core/ImageLoadEvents.d.ts +33 -0
  22. package/dist/{custom-icons-CblWjgt-.js → custom-icons-DYIOjjXt.js} +2 -2
  23. package/dist/{custom-icons-CblWjgt-.js.map → custom-icons-DYIOjjXt.js.map} +1 -1
  24. package/dist/{design-builder-D4izkvlb.js → design-builder-CqgTpp9B.js} +2 -2
  25. package/dist/{design-builder-D4izkvlb.js.map → design-builder-CqgTpp9B.js.map} +1 -1
  26. package/dist/{embed-CxSoTDTw.js → embed-p_FskJ1G.js} +10 -10
  27. package/dist/{embed-CxSoTDTw.js.map → embed-p_FskJ1G.js.map} +1 -1
  28. package/dist/embed.mjs +7 -7
  29. package/dist/{guards-BhaQgJrE.js → guards-DldCuuJq.js} +2 -2
  30. package/dist/{guards-BhaQgJrE.js.map → guards-DldCuuJq.js.map} +1 -1
  31. package/dist/index.mjs +9 -9
  32. package/dist/internals.mjs +6 -6
  33. package/dist/{template-fields-ClO9mflO.js → template-fields-jgE6czak.js} +5 -5
  34. package/dist/{template-fields-ClO9mflO.js.map → template-fields-jgE6czak.js.map} +1 -1
  35. package/dist/testing.mjs +3 -3
  36. package/dist/{useCommands-Bj9QHZ35.js → useCommands-D16Tq-B-.js} +7 -7
  37. package/dist/{useCommands-Bj9QHZ35.js.map → useCommands-D16Tq-B-.js.map} +1 -1
  38. package/dist/{usePieceGuideBundle-CnSmYrmM.js → usePieceGuideBundle-BUQKb0Ja.js} +2 -2
  39. package/dist/{usePieceGuideBundle-CnSmYrmM.js.map → usePieceGuideBundle-BUQKb0Ja.js.map} +1 -1
  40. package/dist/{validation-BU8STi7a.js → validation-8QF2gWih.js} +11 -11
  41. package/dist/{validation-BU8STi7a.js.map → validation-8QF2gWih.js.map} +1 -1
  42. package/example/package.json +1 -1
  43. package/package.json +3 -3
  44. package/dist/FontAnalyzer-BrKY6XYn.js.map +0 -1
@@ -1,29 +1,29 @@
1
- function ge(o) {
1
+ function ue(o) {
2
2
  return o && o.__esModule && Object.prototype.hasOwnProperty.call(o, "default") ? o.default : o;
3
3
  }
4
- var Yt = { exports: {} }, O = Yt.exports = {}, _, z;
5
- function Tt() {
4
+ var Ut = { exports: {} }, O = Ut.exports = {}, _, z;
5
+ function Ft() {
6
6
  throw new Error("setTimeout has not been defined");
7
7
  }
8
- function Ft() {
8
+ function At() {
9
9
  throw new Error("clearTimeout has not been defined");
10
10
  }
11
11
  (function() {
12
12
  try {
13
- typeof setTimeout == "function" ? _ = setTimeout : _ = Tt;
13
+ typeof setTimeout == "function" ? _ = setTimeout : _ = Ft;
14
14
  } catch {
15
- _ = Tt;
15
+ _ = Ft;
16
16
  }
17
17
  try {
18
- typeof clearTimeout == "function" ? z = clearTimeout : z = Ft;
18
+ typeof clearTimeout == "function" ? z = clearTimeout : z = At;
19
19
  } catch {
20
- z = Ft;
20
+ z = At;
21
21
  }
22
22
  })();
23
- function Ut(o) {
23
+ function Gt(o) {
24
24
  if (_ === setTimeout)
25
25
  return setTimeout(o, 0);
26
- if ((_ === Tt || !_) && setTimeout)
26
+ if ((_ === Ft || !_) && setTimeout)
27
27
  return _ = setTimeout, setTimeout(o, 0);
28
28
  try {
29
29
  return _(o, 0);
@@ -35,10 +35,10 @@ function Ut(o) {
35
35
  }
36
36
  }
37
37
  }
38
- function fe(o) {
38
+ function me(o) {
39
39
  if (z === clearTimeout)
40
40
  return clearTimeout(o);
41
- if ((z === Ft || !z) && clearTimeout)
41
+ if ((z === At || !z) && clearTimeout)
42
42
  return z = clearTimeout, clearTimeout(o);
43
43
  try {
44
44
  return z(o);
@@ -51,19 +51,19 @@ function fe(o) {
51
51
  }
52
52
  }
53
53
  var X = [], Q = !1, J, ft = -1;
54
- function ue() {
55
- !Q || !J || (Q = !1, J.length ? X = J.concat(X) : ft = -1, X.length && Gt());
54
+ function pe() {
55
+ !Q || !J || (Q = !1, J.length ? X = J.concat(X) : ft = -1, X.length && $t());
56
56
  }
57
- function Gt() {
57
+ function $t() {
58
58
  if (!Q) {
59
- var o = Ut(ue);
59
+ var o = Gt(pe);
60
60
  Q = !0;
61
61
  for (var t = X.length; t; ) {
62
62
  for (J = X, X = []; ++ft < t; )
63
63
  J && J[ft].run();
64
64
  ft = -1, t = X.length;
65
65
  }
66
- J = null, Q = !1, fe(o);
66
+ J = null, Q = !1, me(o);
67
67
  }
68
68
  }
69
69
  O.nextTick = function(o) {
@@ -71,12 +71,12 @@ O.nextTick = function(o) {
71
71
  if (arguments.length > 1)
72
72
  for (var e = 1; e < arguments.length; e++)
73
73
  t[e - 1] = arguments[e];
74
- X.push(new $t(o, t)), X.length === 1 && !Q && Ut(Gt);
74
+ X.push(new Vt(o, t)), X.length === 1 && !Q && Gt($t);
75
75
  };
76
- function $t(o, t) {
76
+ function Vt(o, t) {
77
77
  this.fun = o, this.array = t;
78
78
  }
79
- $t.prototype.run = function() {
79
+ Vt.prototype.run = function() {
80
80
  this.fun.apply(null, this.array);
81
81
  };
82
82
  O.title = "browser";
@@ -111,12 +111,12 @@ O.chdir = function(o) {
111
111
  O.umask = function() {
112
112
  return 0;
113
113
  };
114
- var me = Yt.exports;
115
- const mt = /* @__PURE__ */ ge(me);
116
- let Ht = 1;
114
+ var ye = Ut.exports;
115
+ const mt = /* @__PURE__ */ ue(ye);
116
+ let Lt = 1;
117
117
  class at {
118
118
  constructor(t = {}) {
119
- this.transformType = "artboard", this.id = t.id || `artboard-${Ht++}`, this.name = t.name || `Artboard ${Ht}`, 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 || []);
119
+ this.transformType = "artboard", this.id = t.id || `artboard-${Lt++}`, this.name = t.name || `Artboard ${Lt}`, 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
120
  }
121
121
  /**
122
122
  * Get bounding box of the artboard
@@ -274,7 +274,7 @@ class at {
274
274
  this.x = t, this.y = e;
275
275
  }
276
276
  }
277
- class ui {
277
+ class pi {
278
278
  constructor() {
279
279
  this.artboards = /* @__PURE__ */ new Map(), this.elementToArtboard = /* @__PURE__ */ new Map(), this.activeArtboardId = null;
280
280
  }
@@ -521,7 +521,7 @@ const I = {
521
521
  return t > 180 && (t -= 360), t;
522
522
  }
523
523
  };
524
- let pe = 1;
524
+ let we = 1;
525
525
  class tt {
526
526
  /** Whether this element clips content below it (derived from blendMode === 'clip') */
527
527
  get isClipping() {
@@ -531,7 +531,7 @@ class tt {
531
531
  t ? (this.blendMode = "clip", this.knockoutParts || (this.knockoutParts = { fill: !0, scope: "group" })) : this.blendMode === "clip" && (this.blendMode = "normal");
532
532
  }
533
533
  constructor(t = {}) {
534
- this.id = t.id || `element-${pe++}`, this.x = t.x !== void 0 ? t.x : 100, this.y = t.y !== void 0 ? t.y : 100, this.rotation = t.rotation !== void 0 ? t.rotation : 0, this.opacity = t.opacity !== void 0 ? t.opacity : 1, this.transformType = t.transformType || "custom", this.transformData = t.transformData || {}, this.blendMode = t.blendMode, this.knockoutParts = t.knockoutParts, this.stroke = t.stroke, this.masks = t.masks, this.distressEffect = t.distressEffect, this.shadow = t.shadow, t.isClipping && !t.blendMode && (this.blendMode = "clip", this.knockoutParts || (this.knockoutParts = { fill: !0, scope: "group" })), this.name = t.name, this.visible = t.visible !== void 0 ? t.visible : !0, this.locked = t.locked !== void 0 ? t.locked : !1;
534
+ this.id = t.id || `element-${we++}`, this.x = t.x !== void 0 ? t.x : 100, this.y = t.y !== void 0 ? t.y : 100, this.rotation = t.rotation !== void 0 ? t.rotation : 0, this.opacity = t.opacity !== void 0 ? t.opacity : 1, this.transformType = t.transformType || "custom", this.transformData = t.transformData || {}, this.blendMode = t.blendMode, this.knockoutParts = t.knockoutParts, this.stroke = t.stroke, this.masks = t.masks, this.distressEffect = t.distressEffect, this.shadow = t.shadow, t.isClipping && !t.blendMode && (this.blendMode = "clip", this.knockoutParts || (this.knockoutParts = { fill: !0, scope: "group" })), this.name = t.name, this.visible = t.visible !== void 0 ? t.visible : !0, this.locked = t.locked !== void 0 ? t.locked : !1;
535
535
  }
536
536
  /**
537
537
  * Get visual bounding box (tight fit around actual rendered content)
@@ -792,7 +792,7 @@ class P {
792
792
  return new P(t);
793
793
  }
794
794
  }
795
- const ye = [
795
+ const be = [
796
796
  // Bold/Display Fonts - Perfect for statements and headlines (49 fonts)
797
797
  {
798
798
  name: "Bebas Neue",
@@ -2268,10 +2268,10 @@ const ye = [
2268
2268
  description: "Humanist monospace"
2269
2269
  }
2270
2270
  ];
2271
- function we() {
2272
- return ye.map((o) => o.name);
2271
+ function xe() {
2272
+ return be.map((o) => o.name);
2273
2273
  }
2274
- const mi = {
2274
+ const yi = {
2275
2275
  system: "System Fonts",
2276
2276
  display: "Bold & Display",
2277
2277
  "sans-serif": "Sans Serif",
@@ -2283,26 +2283,26 @@ const mi = {
2283
2283
  decorative: "Decorative & Unique",
2284
2284
  monospace: "Monospace"
2285
2285
  };
2286
- function Vt(o) {
2286
+ function Jt(o) {
2287
2287
  if (typeof window > "u" || typeof document > "u")
2288
2288
  return "oklch(0% 0 0)";
2289
2289
  const t = o || document.documentElement;
2290
2290
  return getComputedStyle(t).getPropertyValue("--accent").trim() || "oklch(0% 0 0)";
2291
2291
  }
2292
- function be(o) {
2292
+ function Se(o) {
2293
2293
  return typeof window > "u" || typeof document > "u" ? "light" : document.documentElement.getAttribute("data-theme") || "light";
2294
2294
  }
2295
- function Jt() {
2296
- return be().includes("dark") ? "#60a5fa" : "#3b82f6";
2295
+ function qt() {
2296
+ return Se().includes("dark") ? "#60a5fa" : "#3b82f6";
2297
2297
  }
2298
- function pi(o) {
2298
+ function wi(o) {
2299
2299
  if (typeof window > "u" || typeof document > "u")
2300
2300
  return "#FF0000";
2301
2301
  const t = o || document.documentElement;
2302
2302
  return getComputedStyle(t).getPropertyValue("--color-spacing-indicator").trim() || "#FF0000";
2303
2303
  }
2304
- function yi(o = 0.1, t) {
2305
- const e = Vt(t);
2304
+ function bi(o = 0.1, t) {
2305
+ const e = Jt(t);
2306
2306
  if (e.startsWith("oklch("))
2307
2307
  return `${e.slice(0, -1)} / ${o})`;
2308
2308
  if (e.startsWith("#")) {
@@ -2311,71 +2311,71 @@ function yi(o = 0.1, t) {
2311
2311
  }
2312
2312
  return e;
2313
2313
  }
2314
- function wi(o) {
2314
+ function xi(o) {
2315
2315
  if (typeof window > "u" || typeof document > "u")
2316
2316
  return "oklch(0% 0 0 / 0.45)";
2317
2317
  const t = o || document.documentElement;
2318
2318
  return getComputedStyle(t).getPropertyValue("--color-text-selection").trim() || "oklch(0% 0 0 / 0.45)";
2319
2319
  }
2320
- function bi(o) {
2320
+ function Si(o) {
2321
2321
  if (typeof window > "u" || typeof document > "u")
2322
2322
  return "#b5f747";
2323
2323
  const t = o || document.documentElement;
2324
2324
  return getComputedStyle(t).getPropertyValue("--color-accent-hover").trim() || "#b5f747";
2325
2325
  }
2326
- function xe(o) {
2326
+ function Ce(o) {
2327
2327
  if (typeof window > "u" || typeof document > "u")
2328
2328
  return "oklch(0.2103 0.0059 285.89)";
2329
2329
  const t = o || document.documentElement;
2330
2330
  return getComputedStyle(t).getPropertyValue("--foreground").trim() || "oklch(0.2103 0.0059 285.89)";
2331
2331
  }
2332
- function xi(o) {
2332
+ function Ci(o) {
2333
2333
  if (typeof window > "u" || typeof document > "u")
2334
2334
  return "oklch(0.9607 0 0)";
2335
2335
  const t = o || document.documentElement;
2336
2336
  return getComputedStyle(t).getPropertyValue("--background").trim() || "oklch(0.9607 0 0)";
2337
2337
  }
2338
- function Si(o) {
2339
- const t = xe(o);
2338
+ function Ti(o) {
2339
+ const t = Ce(o);
2340
2340
  return t.startsWith("oklch(") ? `${t.slice(0, -1)} / 0.2)` : "rgba(0,0,0,0.2)";
2341
2341
  }
2342
- function Ci(o) {
2342
+ function vi(o) {
2343
2343
  if (typeof window > "u" || typeof document > "u")
2344
2344
  return "oklch(0% 0 0 / 0.2)";
2345
2345
  const t = document.documentElement;
2346
2346
  return getComputedStyle(t).getPropertyValue("--divider").trim() || "oklch(0% 0 0 / 0.2)";
2347
2347
  }
2348
- function vi(o) {
2348
+ function Fi(o) {
2349
2349
  if (typeof window > "u" || typeof document > "u")
2350
2350
  return "oklch(0% 0 0 / 0.5)";
2351
2351
  const t = document.documentElement, e = getComputedStyle(t).getPropertyValue("--foreground").trim();
2352
2352
  return e.startsWith("oklch(") ? `${e.slice(0, -1)} / 0.5)` : e || "oklch(0% 0 0 / 0.5)";
2353
2353
  }
2354
- function Ti(o) {
2354
+ function Ai(o) {
2355
2355
  if (typeof window > "u" || typeof document > "u")
2356
2356
  return "#b5f747";
2357
2357
  const t = document.documentElement;
2358
2358
  return getComputedStyle(t).getPropertyValue("--color-accent-hover-border").trim() || "#b5f747";
2359
2359
  }
2360
- function Fi(o) {
2360
+ function Mi(o) {
2361
2361
  if (typeof window > "u" || typeof document > "u")
2362
2362
  return "oklch(0.2103 0.0059 285.89)";
2363
2363
  const t = document.documentElement;
2364
2364
  return getComputedStyle(t).getPropertyValue("--foreground").trim() || "oklch(0.2103 0.0059 285.89)";
2365
2365
  }
2366
- function Ai(o) {
2366
+ function Di(o) {
2367
2367
  if (typeof window > "u" || typeof document > "u")
2368
2368
  return "oklch(1 0 0)";
2369
2369
  const t = document.documentElement;
2370
2370
  return getComputedStyle(t).getPropertyValue("--background").trim() || "oklch(1 0 0)";
2371
2371
  }
2372
- function Mi(o) {
2372
+ function Ii(o) {
2373
2373
  if (typeof window > "u" || typeof document > "u")
2374
2374
  return "oklch(0.2103 0.0059 285.89 / 0.5)";
2375
2375
  const t = document.documentElement, e = getComputedStyle(t).getPropertyValue("--foreground").trim();
2376
2376
  return e.startsWith("oklch(") ? `${e.slice(0, -1)} / 0.5)` : e || "oklch(0.2103 0.0059 285.89 / 0.5)";
2377
2377
  }
2378
- const Di = 1, Ii = "#ffffff", Se = 20, ki = 6, Ei = 24, Ce = 16, ve = 36, Te = 24, Oi = 4, Bi = "#FFFFFF", Ri = 2, Hi = 0.1, Pi = we(), Li = [8, 10, 12, 14, 16, 18, 20, 24, 28, 32, 36, 48, 64, 72, 96, 128], Z = 0, qt = 1.2, jt = 50, Fe = 8, Ae = 999, Me = /* @__PURE__ */ new Set([
2378
+ const ki = 1, Ei = "#ffffff", Te = 20, Oi = 6, Bi = 24, ve = 16, Fe = 36, Ae = 24, Ri = 4, Hi = "#FFFFFF", Pi = 2, Li = 0.1, Wi = xe(), Ni = [8, 10, 12, 14, 16, 18, 20, 24, 28, 32, 36, 48, 64, 72, 96, 128], Z = 0, jt = 1.2, Zt = 50, Me = 8, De = 999, Ie = /* @__PURE__ */ new Set([
2379
2379
  "Arial",
2380
2380
  "Arial Black",
2381
2381
  "Verdana",
@@ -2396,9 +2396,9 @@ const Di = 1, Ii = "#ffffff", Se = 20, ki = 6, Ei = 24, Ce = 16, ve = 36, Te = 2
2396
2396
  "Monaco",
2397
2397
  "Consolas",
2398
2398
  "Courier"
2399
- ]), De = 0.3;
2400
- var Ie = /* @__PURE__ */ ((o) => (o[o.DEBUG = 0] = "DEBUG", o[o.INFO = 1] = "INFO", o[o.WARN = 2] = "WARN", o[o.ERROR = 3] = "ERROR", o[o.NONE = 4] = "NONE", o))(Ie || {});
2401
- class ke {
2399
+ ]), ke = 0.3;
2400
+ var Ee = /* @__PURE__ */ ((o) => (o[o.DEBUG = 0] = "DEBUG", o[o.INFO = 1] = "INFO", o[o.WARN = 2] = "WARN", o[o.ERROR = 3] = "ERROR", o[o.NONE = 4] = "NONE", o))(Ee || {});
2401
+ class Oe {
2402
2402
  constructor() {
2403
2403
  var t;
2404
2404
  this.level = 0, this.enabled = typeof mt < "u" && ((t = mt.env) == null ? void 0 : t.NODE_ENV) !== "production";
@@ -2455,10 +2455,10 @@ class ke {
2455
2455
  * Create a scoped logger with a prefix for a specific module
2456
2456
  */
2457
2457
  scope(t) {
2458
- return new Ee(this, t);
2458
+ return new Be(this, t);
2459
2459
  }
2460
2460
  }
2461
- class Ee {
2461
+ class Be {
2462
2462
  constructor(t, e) {
2463
2463
  this.logger = t, this.scopeName = e;
2464
2464
  }
@@ -2475,18 +2475,33 @@ class Ee {
2475
2475
  this.logger.error(`[${this.scopeName}] ${t}`, ...e);
2476
2476
  }
2477
2477
  }
2478
- const Oe = new ke(), wt = (o) => Oe.scope(o), Be = wt("ImageLoadEvents"), At = /* @__PURE__ */ new Set();
2479
- function Wi(o) {
2480
- return At.add(o), () => {
2481
- At.delete(o);
2478
+ const Re = new Oe(), wt = (o) => Re.scope(o), Kt = wt("ImageLoadEvents"), Mt = /* @__PURE__ */ new Set();
2479
+ function _i(o) {
2480
+ return Mt.add(o), () => {
2481
+ Mt.delete(o);
2482
2482
  };
2483
2483
  }
2484
2484
  function it(o) {
2485
- At.forEach((t) => {
2485
+ Mt.forEach((t) => {
2486
2486
  try {
2487
2487
  t(o);
2488
2488
  } catch (e) {
2489
- Be.error("Listener error:", e);
2489
+ Kt.error("Listener error:", e);
2490
+ }
2491
+ });
2492
+ }
2493
+ const Dt = /* @__PURE__ */ new Set();
2494
+ function zi(o) {
2495
+ return Dt.add(o), () => {
2496
+ Dt.delete(o);
2497
+ };
2498
+ }
2499
+ function He(o) {
2500
+ Dt.forEach((t) => {
2501
+ try {
2502
+ t(o);
2503
+ } catch (e) {
2504
+ Kt.error("Failure-listener error:", e);
2490
2505
  }
2491
2506
  });
2492
2507
  }
@@ -2572,16 +2587,16 @@ class q {
2572
2587
  this.cache.clear();
2573
2588
  }
2574
2589
  }
2575
- const Ni = Object.freeze({
2590
+ const Xi = Object.freeze({
2576
2591
  brightness: 1,
2577
2592
  contrast: 1,
2578
2593
  saturation: 1
2579
2594
  }), Ct = 1e-3;
2580
- function kt(o) {
2595
+ function Ot(o) {
2581
2596
  return o ? Math.abs(o.brightness - 1) < Ct && Math.abs(o.contrast - 1) < Ct && Math.abs(o.saturation - 1) < Ct : !0;
2582
2597
  }
2583
- function Re(o) {
2584
- if (kt(o)) return;
2598
+ function Pe(o) {
2599
+ if (Ot(o)) return;
2585
2600
  const t = (e) => Math.round(e * 100) / 100;
2586
2601
  return {
2587
2602
  brightness: t(o.brightness),
@@ -2589,24 +2604,24 @@ function Re(o) {
2589
2604
  saturation: t(o.saturation)
2590
2605
  };
2591
2606
  }
2592
- function _i(o) {
2593
- if (kt(o)) return "neutral";
2607
+ function Yi(o) {
2608
+ if (Ot(o)) return "neutral";
2594
2609
  const t = o;
2595
2610
  return `b${t.brightness}c${t.contrast}s${t.saturation}`;
2596
2611
  }
2597
- let Mt = null;
2598
- function zi(o) {
2599
- Mt = o;
2612
+ let It = null;
2613
+ function Ui(o) {
2614
+ It = o;
2600
2615
  }
2601
- function He(o, t) {
2602
- if (kt(t)) return o;
2603
- if (!Mt)
2616
+ function Le(o, t) {
2617
+ if (Ot(t)) return o;
2618
+ if (!It)
2604
2619
  throw new Error(
2605
2620
  "[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)."
2606
2621
  );
2607
- return Mt(o, t);
2622
+ return It(o, t);
2608
2623
  }
2609
- const st = wt("ImageElement"), Pt = 3e4, Lt = 3, Pe = 1e3;
2624
+ const st = wt("ImageElement"), Wt = 3e4, Tt = 3, We = 1e3;
2610
2625
  function x(o) {
2611
2626
  return o.transformData;
2612
2627
  }
@@ -2626,7 +2641,7 @@ class bt extends tt {
2626
2641
  flipVertical: ((c = t.transformData) == null ? void 0 : c.flipVertical) ?? !1,
2627
2642
  borderRadius: ((g = t.transformData) == null ? void 0 : g.borderRadius) ?? 0
2628
2643
  };
2629
- const e = Re((d = t.transformData) == null ? void 0 : d.adjustments);
2644
+ const e = Pe((d = t.transformData) == null ? void 0 : d.adjustments);
2630
2645
  e && (this.transformData.adjustments = e), 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);
2631
2646
  }
2632
2647
  /**
@@ -2675,21 +2690,42 @@ class bt extends tt {
2675
2690
  }, this.loadTimeoutId = setTimeout(() => {
2676
2691
  if (s) return;
2677
2692
  r(), i.src = "";
2678
- const l = new Error(`Image load timed out after ${Pt}ms: ${t}`);
2679
- this.handleLoadFailure(t, l);
2680
- }, Pt), (!i.src || i.src !== t) && (i.src = t), !s && i.complete && i.naturalWidth > 0 && ((a = i.onload) == null || a.call(i, new Event("load")));
2693
+ const l = new Error(`Image load timed out after ${Wt}ms: ${t}`);
2694
+ this.handleLoadFailure(t, l, "timeout");
2695
+ }, Wt), (!i.src || i.src !== t) && (i.src = t), !s && i.complete && i.naturalWidth > 0 && ((a = i.onload) == null || a.call(i, new Event("load")));
2681
2696
  }
2682
2697
  /**
2683
2698
  * Handle a load failure - either retry with backoff or set error state.
2684
2699
  */
2685
- handleLoadFailure(t, e) {
2686
- if (this.retryAttempt++, this.retryAttempt < Lt) {
2687
- const i = Pe * Math.pow(2, this.retryAttempt - 1);
2688
- st.warn(`Image load attempt ${this.retryAttempt} failed, retrying in ${i}ms:`, t), this.imageLoadState = "retrying", this.imageLoadError = e, it(this.id), this.loadTimeoutId = setTimeout(() => {
2700
+ handleLoadFailure(t, e, i = "error") {
2701
+ if (this.retryAttempt++, this.retryAttempt < Tt) {
2702
+ const s = We * Math.pow(2, this.retryAttempt - 1);
2703
+ st.warn(`Image load attempt ${this.retryAttempt} failed, retrying in ${s}ms:`, t), this.imageLoadState = "retrying", this.imageLoadError = e, it(this.id), this.loadTimeoutId = setTimeout(() => {
2689
2704
  this.attemptLoadRegularImage(t);
2690
- }, i);
2705
+ }, s);
2691
2706
  } else
2692
- st.error(`Image load failed after ${Lt} attempts:`, t), this.imageLoaded = !1, this.imageLoadState = "error", this.imageLoadError = e, it(this.id);
2707
+ st.error(`Image load failed after ${Tt} attempts:`, t), this.imageLoaded = !1, this.imageLoadState = "error", this.imageLoadError = e, it(this.id), this.reportTerminalFailure(t, i);
2708
+ }
2709
+ /**
2710
+ * Probe the failed URL's real HTTP status (one-shot) and emit a structured
2711
+ * terminal-failure event. Best-effort: a throwing fetch (CORS/network) is
2712
+ * itself diagnostic and reported as `httpStatus: null`.
2713
+ */
2714
+ async reportTerminalFailure(t, e) {
2715
+ let i = null;
2716
+ try {
2717
+ const s = /^https?:\/\//.test(t) || t.startsWith("/");
2718
+ typeof fetch == "function" && s && (i = (await fetch(t, { method: "GET" })).status);
2719
+ } catch {
2720
+ }
2721
+ He({
2722
+ elementId: this.id,
2723
+ url: t,
2724
+ isProxied: t.includes("/api/image-proxy"),
2725
+ phase: e,
2726
+ attempts: Tt,
2727
+ httpStatus: i
2728
+ });
2693
2729
  }
2694
2730
  /**
2695
2731
  * Clear any pending load timeout
@@ -2826,7 +2862,7 @@ class bt extends tt {
2826
2862
  this.renderPlaceholder(t);
2827
2863
  return;
2828
2864
  }
2829
- const s = He(
2865
+ const s = Le(
2830
2866
  this.imageElement,
2831
2867
  this.transformData.adjustments
2832
2868
  ), r = s.width, h = s.height;
@@ -2930,14 +2966,14 @@ class bt extends tt {
2930
2966
  a === "top-left" ? (u = x(s).width / 2, m = x(s).height / 2) : a === "top-right" ? (u = -x(s).width / 2, m = x(s).height / 2) : a === "bottom-left" ? (u = x(s).width / 2, m = -x(s).height / 2) : a === "bottom-right" ? (u = -x(s).width / 2, m = -x(s).height / 2) : a === "middle-left" ? (u = x(s).width / 2, m = 0) : a === "middle-right" ? (u = -x(s).width / 2, m = 0) : a === "middle-top" ? (u = 0, m = x(s).height / 2) : a === "middle-bottom" && (u = 0, m = -x(s).height / 2);
2931
2967
  const y = P.fromSnapshot(s).localDeltaToWorld(u, m), w = y.dx, S = y.dy;
2932
2968
  d = c + w, f = g + S;
2933
- let b = 0, v = 0;
2934
- a === "top-left" ? (b = this.transformData.width / 2, v = this.transformData.height / 2) : a === "top-right" ? (b = -this.transformData.width / 2, v = this.transformData.height / 2) : a === "bottom-left" ? (b = this.transformData.width / 2, v = -this.transformData.height / 2) : a === "bottom-right" ? (b = -this.transformData.width / 2, v = -this.transformData.height / 2) : a === "middle-left" ? (b = this.transformData.width / 2, v = 0) : a === "middle-right" ? (b = -this.transformData.width / 2, v = 0) : a === "middle-top" ? (b = 0, v = this.transformData.height / 2) : a === "middle-bottom" && (b = 0, v = -this.transformData.height / 2);
2935
- const M = new P(this).localDeltaToWorld(b, v), F = M.dx, T = M.dy, D = d - F, U = f - T;
2969
+ let b = 0, T = 0;
2970
+ a === "top-left" ? (b = this.transformData.width / 2, T = this.transformData.height / 2) : a === "top-right" ? (b = -this.transformData.width / 2, T = this.transformData.height / 2) : a === "bottom-left" ? (b = this.transformData.width / 2, T = -this.transformData.height / 2) : a === "bottom-right" ? (b = -this.transformData.width / 2, T = -this.transformData.height / 2) : a === "middle-left" ? (b = this.transformData.width / 2, T = 0) : a === "middle-right" ? (b = -this.transformData.width / 2, T = 0) : a === "middle-top" ? (b = 0, T = this.transformData.height / 2) : a === "middle-bottom" && (b = 0, T = -this.transformData.height / 2);
2971
+ const M = new P(this).localDeltaToWorld(b, T), F = M.dx, v = M.dy, D = d - F, U = f - v;
2936
2972
  if (this.isCropping) {
2937
2973
  const B = s.x, A = s.y, k = x(s).cropWidth * x(s).width, R = x(s).cropHeight * x(s).height;
2938
2974
  this.x = B, this.y = A;
2939
- const H = k / this.transformData.width, E = R / this.transformData.height, W = B - D, N = A - U, Rt = new P(this).worldDeltaToLocal(W, N), ne = Rt.dx, ae = Rt.dy, he = this.transformData.width / 2 + ne, le = this.transformData.height / 2 + ae, ce = he / this.transformData.width - H / 2, de = le / this.transformData.height - E / 2;
2940
- this.transformData.cropX = ce, this.transformData.cropY = de, this.transformData.cropWidth = H, this.transformData.cropHeight = E;
2975
+ const H = k / this.transformData.width, E = R / this.transformData.height, W = B - D, N = A - U, Pt = new P(this).worldDeltaToLocal(W, N), he = Pt.dx, le = Pt.dy, ce = this.transformData.width / 2 + he, de = this.transformData.height / 2 + le, ge = ce / this.transformData.width - H / 2, fe = de / this.transformData.height - E / 2;
2976
+ this.transformData.cropX = ge, this.transformData.cropY = fe, this.transformData.cropWidth = H, this.transformData.cropHeight = E;
2941
2977
  } else {
2942
2978
  const B = (this.transformData.cropX + this.transformData.cropWidth / 2) * this.transformData.width - this.transformData.width / 2, A = (this.transformData.cropY + this.transformData.cropHeight / 2) * this.transformData.height - this.transformData.height / 2, k = B, R = A, E = new P(this).localDeltaToWorld(k, R), W = E.dx, N = E.dy;
2943
2979
  this.x = D + W, this.y = U + N;
@@ -3039,7 +3075,7 @@ class bt extends tt {
3039
3075
  if (!this.isCropping) return null;
3040
3076
  const s = this.getCropBoxBounds();
3041
3077
  if (!s) return null;
3042
- const r = this.worldToLocal(t, e), h = 1 / i, n = Ce * h, a = ve * h, l = Te * h, c = [
3078
+ const r = this.worldToLocal(t, e), h = 1 / i, n = ve * h, a = Fe * h, l = Ae * h, c = [
3043
3079
  { x: s.x, y: s.y, anchor: "top-left" },
3044
3080
  { x: s.x + s.width, y: s.y, anchor: "top-right" },
3045
3081
  { x: s.x, y: s.y + s.height, anchor: "bottom-left" },
@@ -3270,29 +3306,29 @@ class bt extends tt {
3270
3306
  this.clearLoadTimeout(), this.releaseImageCache(), this.revokeSvgBlobUrl(), this.imageElement = null, this.onLoadCallback = null, this.imageLoadError = null;
3271
3307
  }
3272
3308
  }
3273
- const Zt = /* @__PURE__ */ new Map();
3274
- let Dt = null;
3275
- function Kt(o) {
3309
+ const Qt = /* @__PURE__ */ new Map();
3310
+ let kt = null;
3311
+ function te(o) {
3276
3312
  return new Error(
3277
3313
  `[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).`
3278
3314
  );
3279
3315
  }
3280
- function Xi(o, t) {
3281
- Zt.set(o, t);
3316
+ function Gi(o, t) {
3317
+ Qt.set(o, t);
3282
3318
  }
3283
3319
  function ut(o) {
3284
- const t = Zt.get(o);
3285
- if (!t) throw Kt(`text transform "${o}"`);
3320
+ const t = Qt.get(o);
3321
+ if (!t) throw te(`text transform "${o}"`);
3286
3322
  return t;
3287
3323
  }
3288
- function Yi(o) {
3289
- Dt = o;
3324
+ function $i(o) {
3325
+ kt = o;
3290
3326
  }
3291
- function Le() {
3292
- if (!Dt) throw Kt("group clipping");
3293
- return Dt;
3327
+ function Ne() {
3328
+ if (!kt) throw te("group clipping");
3329
+ return kt;
3294
3330
  }
3295
- const We = [
3331
+ const _e = [
3296
3332
  "multiply",
3297
3333
  "screen",
3298
3334
  "overlay",
@@ -3495,68 +3531,68 @@ class L {
3495
3531
  return new L(t.spans);
3496
3532
  }
3497
3533
  }
3498
- function Ui(o) {
3534
+ function Vi(o) {
3499
3535
  return o.type === "custom";
3500
3536
  }
3501
- function Gi(o) {
3537
+ function Ji(o) {
3502
3538
  return o.type === "circle";
3503
3539
  }
3504
- function $i(o) {
3540
+ function qi(o) {
3505
3541
  return o.type === "arch";
3506
3542
  }
3507
- function Vi(o) {
3543
+ function ji(o) {
3508
3544
  return o.type === "wave";
3509
3545
  }
3510
- function Ji(o) {
3546
+ function Zi(o) {
3511
3547
  return o.type === "flag";
3512
3548
  }
3513
- function qi(o) {
3549
+ function Ki(o) {
3514
3550
  return o.type === "image";
3515
3551
  }
3516
- function ji(o) {
3552
+ function Qi(o) {
3517
3553
  return o.type === "group";
3518
3554
  }
3519
- function Zi(o) {
3555
+ function ts(o) {
3520
3556
  return o.transformType !== "image" && o.transformType !== "group";
3521
3557
  }
3522
- function Ki(o) {
3558
+ function es(o) {
3523
3559
  return o.transformType === "image";
3524
3560
  }
3525
- function Qi(o) {
3561
+ function is(o) {
3526
3562
  return o.transformType === "custom";
3527
3563
  }
3528
- function ts(o) {
3564
+ function ss(o) {
3529
3565
  return o.transformType === "circle";
3530
3566
  }
3531
- function es(o) {
3567
+ function os(o) {
3532
3568
  return o.transformType === "group";
3533
3569
  }
3534
- function is(o) {
3570
+ function rs(o) {
3535
3571
  return o.transformType === "shape";
3536
3572
  }
3537
- function ss(o) {
3573
+ function ns(o) {
3538
3574
  return o.transformType === "path";
3539
3575
  }
3540
- function os(o) {
3576
+ function as(o) {
3541
3577
  return o.type === "shape";
3542
3578
  }
3543
- function rs(o) {
3579
+ function hs(o) {
3544
3580
  return o.type === "path";
3545
3581
  }
3546
- function ns(o) {
3582
+ function ls(o) {
3547
3583
  var t;
3548
3584
  return ((t = o.stroke) == null ? void 0 : t.enabled) === !0;
3549
3585
  }
3550
- function as(o) {
3586
+ function cs(o) {
3551
3587
  return Array.isArray(o.masks) && o.masks.length > 0;
3552
3588
  }
3553
- function hs(o) {
3589
+ function ds(o) {
3554
3590
  return o.blendMode === "knockout" || o.blendMode === "clip";
3555
3591
  }
3556
- function ls(o) {
3557
- return We.includes(o);
3592
+ function gs(o) {
3593
+ return _e.includes(o);
3558
3594
  }
3559
- function cs(o) {
3595
+ function fs(o) {
3560
3596
  var t;
3561
3597
  return ((t = o.distressEffect) == null ? void 0 : t.enabled) === !0;
3562
3598
  }
@@ -3668,7 +3704,7 @@ class j extends tt {
3668
3704
  * Update font size
3669
3705
  */
3670
3706
  setFontSize(t) {
3671
- this.fontSize = Math.max(Fe, Math.min(Ae, t));
3707
+ this.fontSize = Math.max(Me, Math.min(De, t));
3672
3708
  }
3673
3709
  /**
3674
3710
  * Update color
@@ -3702,20 +3738,20 @@ class j extends tt {
3702
3738
  };
3703
3739
  }
3704
3740
  }
3705
- function Ne(o) {
3741
+ function ze(o) {
3706
3742
  return Array.from(o).length;
3707
3743
  }
3708
3744
  function xt(o, t, e) {
3709
- return e ? o + e * Ne(t) : o;
3745
+ return e ? o + e * ze(t) : o;
3710
3746
  }
3711
- function _e(o, t, e) {
3747
+ function Xe(o, t, e) {
3712
3748
  const i = Array.from(t), s = [0];
3713
3749
  let r = "";
3714
3750
  for (let h = 0; h < i.length; h++)
3715
3751
  r += i[h], s.push(o.measureText(r).width + e * (h + 1));
3716
3752
  return s;
3717
3753
  }
3718
- function ze(o, t, e) {
3754
+ function Ye(o, t, e) {
3719
3755
  switch (o.textAlign) {
3720
3756
  case "center":
3721
3757
  return t - e / 2;
@@ -3726,23 +3762,23 @@ function ze(o, t, e) {
3726
3762
  return t;
3727
3763
  }
3728
3764
  }
3729
- function Qt(o, t, e, i, s, r) {
3765
+ function ee(o, t, e, i, s, r) {
3730
3766
  if (!r || e.length === 0) {
3731
3767
  t[o](e, i, s);
3732
3768
  return;
3733
3769
  }
3734
- const h = _e(t, e, r), n = h[h.length - 1], a = ze(t, i, n), l = t.textAlign;
3770
+ const h = Xe(t, e, r), n = h[h.length - 1], a = Ye(t, i, n), l = t.textAlign;
3735
3771
  t.textAlign = "left";
3736
3772
  const c = Array.from(e);
3737
3773
  for (let g = 0; g < c.length; g++)
3738
3774
  t[o](c[g], a + h[g], s);
3739
3775
  t.textAlign = l;
3740
3776
  }
3741
- function ds(o, t, e, i, s) {
3742
- Qt("fillText", o, t, e, i, s);
3777
+ function us(o, t, e, i, s) {
3778
+ ee("fillText", o, t, e, i, s);
3743
3779
  }
3744
- function gs(o, t, e, i, s) {
3745
- Qt("strokeText", o, t, e, i, s);
3780
+ function ms(o, t, e, i, s) {
3781
+ ee("strokeText", o, t, e, i, s);
3746
3782
  }
3747
3783
  let lt = null;
3748
3784
  function St() {
@@ -3759,7 +3795,7 @@ function ht(o, t, e = !1, i = !1) {
3759
3795
  const s = [];
3760
3796
  return i && s.push("italic"), e && s.push("bold"), s.push(`${o}px`), s.push(t), s.join(" ");
3761
3797
  }
3762
- function Et(o, t, e, i, s = !1, r = !1, h, n = !1, a) {
3798
+ function Bt(o, t, e, i, s = !1, r = !1, h, n = !1, a) {
3763
3799
  const c = St().getContext("2d");
3764
3800
  c.font = ht(e, i, s, r);
3765
3801
  const g = (a == null ? void 0 : a.letterSpacing) ?? 0, d = (A) => xt(c.measureText(A).width, A, g);
@@ -3770,7 +3806,7 @@ function Et(o, t, e, i, s = !1, r = !1, h, n = !1, a) {
3770
3806
  const A = o.split(`
3771
3807
  `), k = [];
3772
3808
  for (let R = 0; R < A.length; R++) {
3773
- const H = A[R], E = Et(H, t, e, i, s, r, void 0, n, a);
3809
+ const H = A[R], E = Bt(H, t, e, i, s, r, void 0, n, a);
3774
3810
  k.push(...E);
3775
3811
  }
3776
3812
  return k;
@@ -3786,78 +3822,78 @@ function Et(o, t, e, i, s = !1, r = !1, h, n = !1, a) {
3786
3822
  }
3787
3823
  return A.length > 0 && (A[0] = m + A[0], A[A.length - 1] = A[A.length - 1] + p), A;
3788
3824
  }
3789
- const S = w.join(" "), b = m + S + p, v = d(b), C = t < 200, F = n ? 0 : Math.max(20, t * (n ? 0 : C ? 0.08 : 0.05));
3790
- if (v <= t + F)
3825
+ const S = w.join(" "), b = m + S + p, T = d(b), C = t < 200, F = n ? 0 : Math.max(20, t * (n ? 0 : C ? 0.08 : 0.05));
3826
+ if (T <= t + F)
3791
3827
  return [b];
3792
- const T = [];
3828
+ const v = [];
3793
3829
  let D = "";
3794
3830
  const B = n ? 0 : Math.max(15, t * (n ? 0 : C ? 0.05 : 0.03));
3795
3831
  for (let A = 0; A < w.length; A++) {
3796
3832
  const k = w[A];
3797
3833
  if (d(k) > t + B) {
3798
- D.length > 0 && (T.push(D), D = "");
3834
+ D.length > 0 && (v.push(D), D = "");
3799
3835
  const H = Array.from(k);
3800
3836
  let E = "";
3801
3837
  for (const W of H) {
3802
3838
  const N = E + W;
3803
- d(N) > t + B && E.length > 0 ? (T.push(E), E = W) : E = N;
3839
+ d(N) > t + B && E.length > 0 ? (v.push(E), E = W) : E = N;
3804
3840
  }
3805
3841
  D = E;
3806
3842
  } else {
3807
3843
  const H = D.length > 0 ? D + " " + k : k;
3808
- d(H) > t + B && D.length > 0 ? (T.push(D), D = k) : D = H;
3844
+ d(H) > t + B && D.length > 0 ? (v.push(D), D = k) : D = H;
3809
3845
  }
3810
3846
  }
3811
- if (D.length > 0 && T.push(D), T.length > 0) {
3847
+ if (D.length > 0 && v.push(D), v.length > 0) {
3812
3848
  if (m.length > 0) {
3813
- const A = m + T[0];
3814
- d(A) > t + B ? T.unshift(m) : T[0] = A;
3849
+ const A = m + v[0];
3850
+ d(A) > t + B ? v.unshift(m) : v[0] = A;
3815
3851
  }
3816
3852
  if (p.length > 0) {
3817
- const A = T.length - 1, k = T[A] + p;
3818
- d(k) > t + B ? T.push(p) : T[A] = k;
3853
+ const A = v.length - 1, k = v[A] + p;
3854
+ d(k) > t + B ? v.push(p) : v[A] = k;
3819
3855
  }
3820
3856
  }
3821
- return T;
3857
+ return v;
3822
3858
  }
3823
- function Wt(o, t, e, i = !1, s = !1, r = 0) {
3859
+ function Nt(o, t, e, i = !1, s = !1, r = 0) {
3824
3860
  const n = St().getContext("2d");
3825
3861
  return n.font = ht(t, e, i, s), xt(n.measureText(o).width, o, r);
3826
3862
  }
3827
- function It(o, t, e = !1, i = !1) {
3863
+ function Et(o, t, e = !1, i = !1) {
3828
3864
  const r = St().getContext("2d");
3829
3865
  r.font = ht(o, t, e, i);
3830
3866
  const n = r.measureText("ÁÉÍgjpqy"), a = n.actualBoundingBoxAscent || o * 0.8, l = n.actualBoundingBoxDescent || o * 0.2, c = a + l;
3831
3867
  return { ascent: a, descent: l, height: c };
3832
3868
  }
3833
- function Nt(o, t, e, i, s = !1, r = !1, h, n = !1, a) {
3834
- const l = (a == null ? void 0 : a.letterSpacing) ?? 0, c = Et(o, t, e, i, s, r, h, n, a), g = o.includes(`
3835
- `), d = c.map((b, v) => ({
3836
- isParagraphStart: !g && v === 0,
3837
- isParagraphEnd: !g && v === c.length - 1
3869
+ function _t(o, t, e, i, s = !1, r = !1, h, n = !1, a) {
3870
+ const l = (a == null ? void 0 : a.letterSpacing) ?? 0, c = Bt(o, t, e, i, s, r, h, n, a), g = o.includes(`
3871
+ `), d = c.map((b, T) => ({
3872
+ isParagraphStart: !g && T === 0,
3873
+ isParagraphEnd: !g && T === c.length - 1
3838
3874
  })), u = St().getContext("2d");
3839
3875
  u.font = ht(e, i, s, r);
3840
3876
  let m = 0;
3841
- const p = It(e, i, s, r);
3877
+ const p = Et(e, i, s, r);
3842
3878
  let y = 0;
3843
- c.forEach((b, v) => {
3844
- const C = d[v].isParagraphStart, M = d[v].isParagraphEnd;
3879
+ c.forEach((b, T) => {
3880
+ const C = d[T].isParagraphStart, M = d[T].isParagraphEnd;
3845
3881
  let F = b;
3846
3882
  if (!C) {
3847
- const T = b.match(/^ +/), D = T ? T[0].length : 0;
3883
+ const v = b.match(/^ +/), D = v ? v[0].length : 0;
3848
3884
  D > 0 && (F = F.substring(D));
3849
3885
  }
3850
3886
  if (!M) {
3851
- const T = F.match(/ +$/), D = T ? T[0].length : 0;
3887
+ const v = F.match(/ +$/), D = v ? v[0].length : 0;
3852
3888
  D > 0 && (F = F.substring(0, F.length - D));
3853
3889
  }
3854
3890
  if (y++, F.length > 0) {
3855
- const T = xt(u.measureText(F).width, F, l);
3856
- m = Math.max(m, T);
3891
+ const v = xt(u.measureText(F).width, F, l);
3892
+ m = Math.max(m, v);
3857
3893
  }
3858
3894
  });
3859
3895
  let w;
3860
- const S = (a == null ? void 0 : a.lineHeight) ?? qt;
3896
+ const S = (a == null ? void 0 : a.lineHeight) ?? jt;
3861
3897
  if (y === 1)
3862
3898
  w = p.height;
3863
3899
  else if (y === 0)
@@ -3873,7 +3909,7 @@ function Nt(o, t, e, i, s = !1, r = !1, h, n = !1, a) {
3873
3909
  };
3874
3910
  }
3875
3911
  let ct = null;
3876
- function Xe() {
3912
+ function Ue() {
3877
3913
  if (!ct)
3878
3914
  if (typeof OffscreenCanvas < "u")
3879
3915
  ct = new OffscreenCanvas(1, 1).getContext("2d");
@@ -3883,10 +3919,10 @@ function Xe() {
3883
3919
  throw new Error("No canvas context available");
3884
3920
  return ct;
3885
3921
  }
3886
- function Ye(o, t, e) {
3887
- const i = Xe(), s = [], r = (p, y) => {
3888
- const w = y.fontSize || e.fontSize, S = y.fontFamily || e.fontFamily, b = y.bold !== void 0 ? y.bold : e.bold || !1, v = y.italic !== void 0 ? y.italic : e.italic || !1, C = y.letterSpacing !== void 0 ? y.letterSpacing : e.letterSpacing ?? 0;
3889
- return i.font = ht(w, S, b, v), xt(i.measureText(p).width, p, C);
3922
+ function Ge(o, t, e) {
3923
+ const i = Ue(), s = [], r = (p, y) => {
3924
+ const w = y.fontSize || e.fontSize, S = y.fontFamily || e.fontFamily, b = y.bold !== void 0 ? y.bold : e.bold || !1, T = y.italic !== void 0 ? y.italic : e.italic || !1, C = y.letterSpacing !== void 0 ? y.letterSpacing : e.letterSpacing ?? 0;
3925
+ return i.font = ht(w, S, b, T), xt(i.measureText(p).width, p, C);
3890
3926
  }, h = (p, y) => p.fontSize === y.fontSize && p.fontFamily === y.fontFamily && p.color === y.color && p.bold === y.bold && p.italic === y.italic && p.underline === y.underline && p.strikethrough === y.strikethrough && p.letterSpacing === y.letterSpacing, n = [];
3891
3927
  o.forEach((p) => {
3892
3928
  n.length > 0 && h(n[n.length - 1].style, p.style) ? n[n.length - 1].text += p.text : n.push({ text: p.text, style: p.style });
@@ -3916,21 +3952,21 @@ function Ye(o, t, e) {
3916
3952
  M !== S ? (w.push({ text: b, style: n[S].style }), b = a[C], S = M) : b += a[C];
3917
3953
  }
3918
3954
  b.length > 0 && w.push({ text: b, style: n[S].style });
3919
- const v = w.reduce((C, M) => C + r(M.text, M.style), 0);
3955
+ const T = w.reduce((C, M) => C + r(M.text, M.style), 0);
3920
3956
  if (p.text === " ") {
3921
3957
  if (f.length > 0) {
3922
3958
  const C = f[f.length - 1];
3923
3959
  h(C.style, w[0].style) ? C.text += " " : f.push({ text: " ", style: w[0].style });
3924
3960
  } else
3925
3961
  f.push({ text: " ", style: w[0].style });
3926
- u += v;
3927
- } else if (v > t) {
3962
+ u += T;
3963
+ } else if (T > t) {
3928
3964
  f.length > 0 && m();
3929
3965
  for (const C of w) {
3930
3966
  const M = Array.from(C.text);
3931
3967
  let F = "";
3932
- for (const T of M) {
3933
- const D = r(T, C.style);
3968
+ for (const v of M) {
3969
+ const D = r(v, C.style);
3934
3970
  if (u + D > t && u > 0) {
3935
3971
  if (F.length > 0) {
3936
3972
  if (f.length > 0) {
@@ -3942,26 +3978,26 @@ function Ye(o, t, e) {
3942
3978
  }
3943
3979
  m();
3944
3980
  }
3945
- F += T, u += D;
3981
+ F += v, u += D;
3946
3982
  }
3947
3983
  if (F.length > 0)
3948
3984
  if (f.length > 0) {
3949
- const T = f[f.length - 1];
3950
- h(T.style, C.style) ? T.text += F : f.push({ text: F, style: C.style });
3985
+ const v = f[f.length - 1];
3986
+ h(v.style, C.style) ? v.text += F : f.push({ text: F, style: C.style });
3951
3987
  } else
3952
3988
  f.push({ text: F, style: C.style });
3953
3989
  }
3954
3990
  } else
3955
- u + v > t && f.length > 0 && m(), w.forEach((C) => {
3991
+ u + T > t && f.length > 0 && m(), w.forEach((C) => {
3956
3992
  if (f.length > 0) {
3957
3993
  const M = f[f.length - 1];
3958
3994
  h(M.style, C.style) ? M.text += C.text : f.push({ ...C });
3959
3995
  } else
3960
3996
  f.push({ ...C });
3961
- }), u += v;
3997
+ }), u += T;
3962
3998
  }), m(), s.length === 0 && s.push([]), s;
3963
3999
  }
3964
- function Ue(o) {
4000
+ function $e(o) {
3965
4001
  const t = [];
3966
4002
  let e = [];
3967
4003
  return o.spans.forEach((i) => {
@@ -3975,10 +4011,10 @@ function Ue(o) {
3975
4011
  function ot(o) {
3976
4012
  return typeof o.width == "number" ? o.width : void 0;
3977
4013
  }
3978
- function te(o, t) {
4014
+ function ie(o, t) {
3979
4015
  o.width = t;
3980
4016
  }
3981
- function Ge(o, t, e) {
4017
+ function Ve(o, t, e) {
3982
4018
  const i = e.transformData, s = ot(i), r = s !== void 0 ? s : e.width ?? 0, h = t / r, n = e.fontSize ?? o.fontSize, a = n * h;
3983
4019
  let l;
3984
4020
  if (a < 16 ? l = Math.round(a) : l = Math.round(a * 2) / 2, o.setFontSize(l), e.richText && e.richText instanceof L && typeof o.setRichText == "function") {
@@ -3993,31 +4029,31 @@ function Ge(o, t, e) {
3993
4029
  const c = o.transformData;
3994
4030
  if (ot(c) !== void 0 && s !== void 0) {
3995
4031
  const d = n > 0 ? l / n : h, f = s * d;
3996
- te(c, Math.max(20, Math.ceil(f)));
4032
+ ie(c, Math.max(20, Math.ceil(f)));
3997
4033
  }
3998
4034
  }
3999
- function $e(o, t, e, i) {
4035
+ function Je(o, t, e, i) {
4000
4036
  if (t !== "middle-left" && t !== "middle-right")
4001
4037
  return;
4002
4038
  o.fontSize = i.fontSize ?? o.fontSize;
4003
4039
  const s = o.transformData;
4004
4040
  if (ot(s) !== void 0) {
4005
- te(s, Math.max(jt, e));
4041
+ ie(s, Math.max(Zt, e));
4006
4042
  const h = I.toRadiansInverse(o.rotation), n = Math.cos(h), a = Math.sin(h), l = i.transformData, g = ot(l) ?? i.width ?? 0, f = (ot(s) ?? 0) - g;
4007
4043
  t === "middle-left" ? (o.x = i.x - f / 2 * n, o.y = i.y - f / 2 * a) : t === "middle-right" && (o.x = i.x + f / 2 * n, o.y = i.y + f / 2 * a);
4008
4044
  }
4009
4045
  }
4010
- function ee(o, t, e, i, s) {
4046
+ function se(o, t, e, i, s) {
4011
4047
  const r = t.includes("top") || t.includes("bottom"), h = t.includes("middle");
4012
- r ? Ge(o, e, s) : h && $e(o, t, e, s);
4048
+ r ? Ve(o, e, s) : h && Je(o, t, e, s);
4013
4049
  }
4014
- class Ve extends j {
4050
+ class qe extends j {
4015
4051
  // Temporary property used during resize operations only
4016
4052
  constructor(t = {}) {
4017
4053
  super(t), this.transformType = "custom";
4018
4054
  const e = t.transformData, i = (e == null ? void 0 : e.width) !== void 0 ? e.width : Math.max(
4019
- jt,
4020
- Wt(this.text, this.fontSize, this.fontFamily, this.bold, this.italic, this.letterSpacing ?? 0) + Z * 2
4055
+ Zt,
4056
+ Nt(this.text, this.fontSize, this.fontFamily, this.bold, this.italic, this.letterSpacing ?? 0) + Z * 2
4021
4057
  );
4022
4058
  this.transformData = {
4023
4059
  type: "custom",
@@ -4030,9 +4066,9 @@ class Ve extends j {
4030
4066
  * Returns the total height based on the tallest font in each line
4031
4067
  */
4032
4068
  calculateRichTextHeight() {
4033
- const t = this.getRichText(), e = this.transformData.width - Z * 2, i = Ue(t), s = [];
4069
+ const t = this.getRichText(), e = this.transformData.width - Z * 2, i = $e(t), s = [];
4034
4070
  if (i.forEach((a) => {
4035
- Ye(a, e, {
4071
+ Ge(a, e, {
4036
4072
  fontSize: this.fontSize,
4037
4073
  fontFamily: this.fontFamily,
4038
4074
  bold: this.bold,
@@ -4046,15 +4082,15 @@ class Ve extends j {
4046
4082
  let r = 0, h = 0;
4047
4083
  s.forEach((a) => {
4048
4084
  a.forEach((l) => {
4049
- 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, f = l.style.italic !== void 0 ? l.style.italic : this.italic, u = It(c, g, d, f);
4085
+ 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, f = l.style.italic !== void 0 ? l.style.italic : this.italic, u = Et(c, g, d, f);
4050
4086
  r = Math.max(r, u.height), h = Math.max(h, u.ascent);
4051
4087
  });
4052
4088
  });
4053
- const n = this.fontSize * (this.lineHeight ?? qt);
4089
+ const n = this.fontSize * (this.lineHeight ?? jt);
4054
4090
  if (s.length === 1)
4055
4091
  return r;
4056
4092
  {
4057
- const a = It(this.fontSize, this.fontFamily, this.bold, this.italic), l = (s.length - 1) * n + a.height, c = Math.max(0, h - a.ascent), g = Math.max(0, r - h - (a.height - a.ascent));
4093
+ const a = Et(this.fontSize, this.fontFamily, this.bold, this.italic), l = (s.length - 1) * n + a.height, c = Math.max(0, h - a.ascent), g = Math.max(0, r - h - (a.height - a.ascent));
4058
4094
  return l + c + g;
4059
4095
  }
4060
4096
  }
@@ -4076,7 +4112,7 @@ class Ve extends j {
4076
4112
  getBoundingBox() {
4077
4113
  const t = this.transformData.width - Z * 2;
4078
4114
  let e;
4079
- return this.hasPerCharacterFormatting() ? e = this.calculateRichTextHeight() : e = Nt(
4115
+ return this.hasPerCharacterFormatting() ? e = this.calculateRichTextHeight() : e = _t(
4080
4116
  this.text,
4081
4117
  t,
4082
4118
  this.fontSize,
@@ -4103,7 +4139,7 @@ class Ve extends j {
4103
4139
  getVisualBoundingBox() {
4104
4140
  const t = this.transformData.width - Z * 2;
4105
4141
  let e;
4106
- this.hasPerCharacterFormatting() ? e = this.calculateRichTextHeight() : e = Nt(
4142
+ this.hasPerCharacterFormatting() ? e = this.calculateRichTextHeight() : e = _t(
4107
4143
  this.text,
4108
4144
  t,
4109
4145
  this.fontSize,
@@ -4170,7 +4206,7 @@ class Ve extends j {
4170
4206
  * Override getTransformStartData to capture initial line count
4171
4207
  */
4172
4208
  getTransformStartData() {
4173
- const t = super.getTransformStartData(), e = this.transformData.width - Z * 2, i = Et(this.text, e, this.fontSize, this.fontFamily, this.bold, this.italic, void 0, !1, {
4209
+ const t = super.getTransformStartData(), e = this.transformData.width - Z * 2, i = Bt(this.text, e, this.fontSize, this.fontFamily, this.bold, this.italic, void 0, !1, {
4174
4210
  letterSpacing: this.letterSpacing
4175
4211
  });
4176
4212
  return t.lineCount = i.length, t;
@@ -4181,8 +4217,8 @@ class Ve extends j {
4181
4217
  * Side handles: only width changes - text re-wraps naturally
4182
4218
  */
4183
4219
  resize(t, e, i, s) {
4184
- if (t === "top-left" || t === "top-right" || t === "bottom-left" || t === "bottom-right" || (this._lockedLineCount = void 0), ee(this, t, e, i, s), this._lockedLineCount !== void 0 && this._lockedLineCount > 0) {
4185
- const n = Wt(
4220
+ if (t === "top-left" || t === "top-right" || t === "bottom-left" || t === "bottom-right" || (this._lockedLineCount = void 0), se(this, t, e, i, s), this._lockedLineCount !== void 0 && this._lockedLineCount > 0) {
4221
+ const n = Nt(
4186
4222
  this.text,
4187
4223
  this.fontSize,
4188
4224
  this.fontFamily,
@@ -4234,7 +4270,7 @@ class Ve extends j {
4234
4270
  };
4235
4271
  }
4236
4272
  }
4237
- function Je(o, t, e, i) {
4273
+ function je(o, t, e, i) {
4238
4274
  const s = I.toRadians(i), r = Math.cos(s), h = Math.sin(s);
4239
4275
  let n = 0, a = 0;
4240
4276
  e === "top-left" ? (n = o.width, a = o.height) : e === "top-right" ? (n = 0, a = o.height) : e === "bottom-left" ? (n = o.width, a = 0) : e === "bottom-right" && (n = 0, a = 0);
@@ -4244,14 +4280,14 @@ function Je(o, t, e, i) {
4244
4280
  const f = l - (g * r - d * h), u = c - (g * h + d * r);
4245
4281
  return { x: f, y: u };
4246
4282
  }
4247
- function fs(o, t, e, i = 1) {
4248
- const s = o.width / 2, r = o.height + Se / i, h = o.x + s, n = o.y + r, a = I.toRadians(t), l = Math.cos(a), c = Math.sin(a), g = h - e.x, d = n - e.y, f = g * l - d * c, u = g * c + d * l;
4283
+ function ps(o, t, e, i = 1) {
4284
+ const s = o.width / 2, r = o.height + Te / i, h = o.x + s, n = o.y + r, a = I.toRadians(t), l = Math.cos(a), c = Math.sin(a), g = h - e.x, d = n - e.y, f = g * l - d * c, u = g * c + d * l;
4249
4285
  return {
4250
4286
  x: e.x + f,
4251
4287
  y: e.y + u
4252
4288
  };
4253
4289
  }
4254
- function us(o, t, e) {
4290
+ function ys(o, t, e) {
4255
4291
  const i = I.toRadians(t), s = Math.cos(i), r = Math.sin(i), h = (c, g) => {
4256
4292
  const d = o.x + c, f = o.y + g, u = d - e.x, m = f - e.y, p = u * s - m * r, y = u * r + m * s;
4257
4293
  return {
@@ -4259,7 +4295,7 @@ function us(o, t, e) {
4259
4295
  y: e.y + y
4260
4296
  };
4261
4297
  }, { width: n, height: a } = o, l = (c, g, d, f) => {
4262
- const u = h(d, f), m = qe(
4298
+ const u = h(d, f), m = Ze(
4263
4299
  u.x,
4264
4300
  u.y,
4265
4301
  e.x,
@@ -4288,11 +4324,11 @@ function us(o, t, e) {
4288
4324
  l("edge", "middle-bottom", n / 2, a)
4289
4325
  ];
4290
4326
  }
4291
- function ms(o, t, e, i, s) {
4327
+ function ws(o, t, e, i, s) {
4292
4328
  const r = o - e, h = t - i;
4293
4329
  return r * r + h * h <= s * s;
4294
4330
  }
4295
- function ps(o, t, e, i) {
4331
+ function bs(o, t, e, i) {
4296
4332
  const s = I.toRadiansInverse(i), r = Math.cos(s), h = Math.sin(s), n = o - e.x, a = t - e.y, l = n * r - a * h, c = n * h + a * r;
4297
4333
  return l >= 0 && l <= e.width && c >= 0 && c <= e.height;
4298
4334
  }
@@ -4300,19 +4336,19 @@ function et(o, t, e = "Arial", i = !1, s = !1) {
4300
4336
  const h = document.createElement("canvas").getContext("2d"), n = i ? "bold" : "normal", a = s ? "italic" : "normal";
4301
4337
  return h.font = `${a} ${n} ${t}px ${e}`, h.measureText(o).width;
4302
4338
  }
4303
- function ys(o) {
4339
+ function xs(o) {
4304
4340
  return {
4305
4341
  x: o.x + o.width / 2,
4306
4342
  y: o.y + o.height / 2
4307
4343
  };
4308
4344
  }
4309
- function ws(o, t, e, i) {
4345
+ function Ss(o, t, e, i) {
4310
4346
  return Math.atan2(i - t, e - o);
4311
4347
  }
4312
- function bs(o, t, e) {
4348
+ function Cs(o, t, e) {
4313
4349
  return Math.abs(o - t) <= e;
4314
4350
  }
4315
- function qe(o, t, e, i, s, r = 0, h = "") {
4351
+ function Ze(o, t, e, i, s, r = 0, h = "") {
4316
4352
  const n = o - e, a = t - i;
4317
4353
  let l = Math.atan2(a, n) * (180 / Math.PI);
4318
4354
  if (l = (l % 360 + 360) % 360, s === "corner") {
@@ -4329,17 +4365,17 @@ function qe(o, t, e, i, s, r = 0, h = "") {
4329
4365
  return c >= 45 && c < 135 ? "ns-resize" : "ew-resize";
4330
4366
  }
4331
4367
  }
4332
- function je(o) {
4368
+ function Ke(o) {
4333
4369
  if (!o.getTransform)
4334
4370
  return 1;
4335
4371
  const t = o.getTransform();
4336
4372
  return Math.sqrt(t.a * t.a + t.b * t.b);
4337
4373
  }
4338
- function xs(o, t, e = []) {
4339
- const i = je(o);
4374
+ function Ts(o, t, e = []) {
4375
+ const i = Ke(o);
4340
4376
  o.lineWidth = i > 0 ? t / i : t, e.length > 0 && o.setLineDash(i > 0 ? e.map((s) => s / i) : e);
4341
4377
  }
4342
- class Ze extends j {
4378
+ class Qe extends j {
4343
4379
  constructor(t = {}) {
4344
4380
  super(t), this.transformType = "circle";
4345
4381
  const e = t.transformData;
@@ -4395,7 +4431,7 @@ class Ze extends j {
4395
4431
  resize(t, e, i, s) {
4396
4432
  const r = s.transformData, h = (e + i) / 2, n = (s.width + s.height) / 2, a = h / n, l = r.scale * a, c = Math.max(0.1, Math.min(10, l));
4397
4433
  this.transformData.scale = c;
4398
- const g = this.getBoundingBox(), d = Je(
4434
+ const g = this.getBoundingBox(), d = je(
4399
4435
  {
4400
4436
  x: s.x - r.radius * r.scale,
4401
4437
  y: s.y - r.radius * r.scale,
@@ -4469,7 +4505,7 @@ class Ze extends j {
4469
4505
  };
4470
4506
  }
4471
4507
  }
4472
- class Ke extends j {
4508
+ class ti extends j {
4473
4509
  constructor(t = {}) {
4474
4510
  super(t), this.transformType = "arch";
4475
4511
  const e = t.transformData;
@@ -4503,8 +4539,8 @@ class Ke extends j {
4503
4539
  { x: p / 2, y: n }
4504
4540
  // bottom-right
4505
4541
  ].forEach((C) => {
4506
- const M = C.x, F = C.y + b * r * C.x, T = y + M, D = S + F;
4507
- a = Math.min(a, T), l = Math.max(l, T), c = Math.min(c, D), g = Math.max(g, D);
4542
+ const M = C.x, F = C.y + b * r * C.x, v = y + M, D = S + F;
4543
+ a = Math.min(a, v), l = Math.max(l, v), c = Math.min(c, D), g = Math.max(g, D);
4508
4544
  }), d += p;
4509
4545
  });
4510
4546
  const f = 2;
@@ -4574,14 +4610,14 @@ const rt = {
4574
4610
  frequency: 2,
4575
4611
  // Standard flag frequency
4576
4612
  width: 200
4577
- }, Qe = {
4613
+ }, ei = {
4578
4614
  archHeight: 0.5
4579
- }, ti = {
4615
+ }, ii = {
4580
4616
  leanAmount: 0
4581
- }, ei = {
4617
+ }, si = {
4582
4618
  ascendAngle: -15
4583
4619
  };
4584
- class ii extends j {
4620
+ class oi extends j {
4585
4621
  constructor(t = {}) {
4586
4622
  super(t), this.transformType = "wave";
4587
4623
  const e = t.transformData;
@@ -4616,7 +4652,7 @@ class ii extends j {
4616
4652
  { x: u / 2, y: r }
4617
4653
  // bottom-right
4618
4654
  ].forEach((b) => {
4619
- const v = b.x, C = b.y + w * De * b.x, M = m + v, F = y + C;
4655
+ const T = b.x, C = b.y + w * ke * b.x, M = m + T, F = y + C;
4620
4656
  h = Math.min(h, M), n = Math.max(n, M), a = Math.min(a, F), l = Math.max(l, F);
4621
4657
  }), c += u;
4622
4658
  });
@@ -4629,7 +4665,7 @@ class ii extends j {
4629
4665
  };
4630
4666
  }
4631
4667
  resize(t, e, i, s) {
4632
- ee(this, t, e, i, s);
4668
+ se(this, t, e, i, s);
4633
4669
  }
4634
4670
  getEnabledAnchors() {
4635
4671
  return ["top-left", "top-right", "bottom-left", "bottom-right"];
@@ -4650,7 +4686,7 @@ class ii extends j {
4650
4686
  };
4651
4687
  }
4652
4688
  }
4653
- class si extends j {
4689
+ class ri extends j {
4654
4690
  constructor(t = {}) {
4655
4691
  super(t), this.transformType = "flag";
4656
4692
  const e = t.transformData;
@@ -4674,7 +4710,7 @@ class si extends j {
4674
4710
  const t = this.text.split(""), e = t.map((f) => et(f, this.fontSize, this.fontFamily)), i = e.reduce((f, u) => f + u, 0), s = 0.3, h = this.fontSize / 2;
4675
4711
  let n = 1 / 0, a = -1 / 0, l = 1 / 0, c = -1 / 0, g = -i / 2;
4676
4712
  t.forEach((f, u) => {
4677
- const m = e[u], p = g + m / 2, y = p / (this.transformData.width / 2), w = Math.abs(y), S = this.transformData.amplitude * w, b = S * this.fontSize * Math.sin(this.transformData.frequency * Math.PI * y), v = S * this.transformData.frequency * Math.PI * Math.cos(this.transformData.frequency * Math.PI * y), C = this.transformData.amplitude * Math.sign(y) * Math.sin(this.transformData.frequency * Math.PI * y), M = v + C;
4713
+ const m = e[u], p = g + m / 2, y = p / (this.transformData.width / 2), w = Math.abs(y), S = this.transformData.amplitude * w, b = S * this.fontSize * Math.sin(this.transformData.frequency * Math.PI * y), T = S * this.transformData.frequency * Math.PI * Math.cos(this.transformData.frequency * Math.PI * y), C = this.transformData.amplitude * Math.sign(y) * Math.sin(this.transformData.frequency * Math.PI * y), M = T + C;
4678
4714
  [
4679
4715
  { x: -m / 2, y: -h },
4680
4716
  // top-left
@@ -4684,8 +4720,8 @@ class si extends j {
4684
4720
  // bottom-left
4685
4721
  { x: m / 2, y: h }
4686
4722
  // bottom-right
4687
- ].forEach((T) => {
4688
- const D = T.x, U = T.y + M * s * T.x, B = p + D, A = b + U;
4723
+ ].forEach((v) => {
4724
+ const D = v.x, U = v.y + M * s * v.x, B = p + D, A = b + U;
4689
4725
  n = Math.min(n, B), a = Math.max(a, B), l = Math.min(l, A), c = Math.max(c, A);
4690
4726
  }), g += m;
4691
4727
  });
@@ -4746,7 +4782,7 @@ class si extends j {
4746
4782
  };
4747
4783
  }
4748
4784
  }
4749
- class oi extends j {
4785
+ class ni extends j {
4750
4786
  constructor(t = {}) {
4751
4787
  super(t), this.transformType = "lean";
4752
4788
  const e = t.transformData;
@@ -4836,7 +4872,7 @@ class oi extends j {
4836
4872
  };
4837
4873
  }
4838
4874
  }
4839
- class ri extends j {
4875
+ class ai extends j {
4840
4876
  constructor(t = {}) {
4841
4877
  super(t), this.transformType = "ascend";
4842
4878
  const e = t.transformData;
@@ -4869,9 +4905,9 @@ class ri extends j {
4869
4905
  // bottom-left
4870
4906
  { x: y / 2, y: a }
4871
4907
  // bottom-right
4872
- ].forEach((v) => {
4873
- const C = v.x, M = v.y + r * h * v.x, F = w + C, T = S + M;
4874
- l = Math.min(l, F), c = Math.max(c, F), g = Math.min(g, T), d = Math.max(d, T);
4908
+ ].forEach((T) => {
4909
+ const C = T.x, M = T.y + r * h * T.x, F = w + C, v = S + M;
4910
+ l = Math.min(l, F), c = Math.max(c, F), g = Math.min(g, v), d = Math.max(d, v);
4875
4911
  }), f += y;
4876
4912
  });
4877
4913
  const u = 2;
@@ -4929,23 +4965,23 @@ class ri extends j {
4929
4965
  };
4930
4966
  }
4931
4967
  }
4932
- class ni extends Error {
4968
+ class hi extends Error {
4933
4969
  constructor(t, e, i = {}) {
4934
4970
  super(`[Editor] ${t}: ${e}`), this.name = "EditorError", this.code = t, this.data = { code: t, ...i };
4935
4971
  }
4936
4972
  }
4937
- function Ss(o) {
4973
+ function vs(o) {
4938
4974
  return o instanceof Error && o.name === "EditorError" && "code" in o;
4939
4975
  }
4940
- function Cs() {
4976
+ function Fs() {
4941
4977
  var o;
4942
4978
  return typeof mt < "u" && ((o = mt.env) == null ? void 0 : o.NODE_ENV) !== "production";
4943
4979
  }
4944
- const ie = "#3b82f6", _t = ["solid", "linear", "radial"];
4980
+ const oe = "#3b82f6", zt = ["solid", "linear", "radial"];
4945
4981
  function V(o, t) {
4946
- return new ni("E_INVALID_FILL", o, t);
4982
+ return new hi("E_INVALID_FILL", o, t);
4947
4983
  }
4948
- function ai(o) {
4984
+ function li(o) {
4949
4985
  if (typeof o != "object" || o === null)
4950
4986
  throw V(
4951
4987
  `shape fill must be an object ({ type: "solid" | "linear" | "radial", ... }), got ${JSON.stringify(o)}.`,
@@ -4980,11 +5016,11 @@ function ai(o) {
4980
5016
  return;
4981
5017
  }
4982
5018
  throw V(
4983
- `unknown shape fill type ${JSON.stringify(t.type)}. Valid types: ${JSON.stringify(_t)}.`,
4984
- { fill: o, validNames: _t }
5019
+ `unknown shape fill type ${JSON.stringify(t.type)}. Valid types: ${JSON.stringify(zt)}.`,
5020
+ { fill: o, validNames: zt }
4985
5021
  );
4986
5022
  }
4987
- function zt(o) {
5023
+ function Xt(o) {
4988
5024
  switch (o.type) {
4989
5025
  case "solid":
4990
5026
  return { type: "solid", color: o.color };
@@ -4994,28 +5030,28 @@ function zt(o) {
4994
5030
  return { type: "radial", stops: o.stops.map((t) => ({ ...t })) };
4995
5031
  }
4996
5032
  }
4997
- function Xt(o, t) {
5033
+ function Yt(o, t) {
4998
5034
  for (const e of t)
4999
5035
  o.addColorStop(Math.min(1, Math.max(0, e.offset)), e.color);
5000
5036
  return o;
5001
5037
  }
5002
5038
  function dt(o, t) {
5003
5039
  const { fill: e } = t;
5004
- if (!e) return t.fillColor || ie;
5040
+ if (!e) return t.fillColor || oe;
5005
5041
  if (e.type === "solid") return e.color;
5006
5042
  const i = t.width ?? 100, s = t.height ?? 100;
5007
5043
  if (e.type === "linear") {
5008
5044
  const h = e.angle * Math.PI / 180, n = Math.sin(h), a = -Math.cos(h), l = (Math.abs(i * n) + Math.abs(s * a)) / 2;
5009
- return Xt(
5045
+ return Yt(
5010
5046
  o.createLinearGradient(-n * l, -a * l, n * l, a * l),
5011
5047
  e.stops
5012
5048
  );
5013
5049
  }
5014
5050
  const r = Math.sqrt(i * i + s * s) / 2;
5015
- return Xt(o.createRadialGradient(0, 0, 0, 0, 0, r), e.stops);
5051
+ return Yt(o.createRadialGradient(0, 0, 0, 0, 0, r), e.stops);
5016
5052
  }
5017
- function vs(o, t) {
5018
- if (!o) return t || ie;
5053
+ function As(o, t) {
5054
+ if (!o) return t || oe;
5019
5055
  switch (o.type) {
5020
5056
  case "solid":
5021
5057
  return o.color;
@@ -5025,12 +5061,12 @@ function vs(o, t) {
5025
5061
  return `radial-gradient(circle, ${o.stops.map((e) => `${e.color} ${e.offset * 100}%`).join(", ")})`;
5026
5062
  }
5027
5063
  }
5028
- class Ot extends tt {
5064
+ class Rt extends tt {
5029
5065
  constructor(t = {}) {
5030
5066
  var s, r, h, n, a, l, c, g, d, f, u, m;
5031
5067
  super(t), this.transformType = "shape";
5032
5068
  const e = (s = t.transformData) == null ? void 0 : s.fill;
5033
- e !== void 0 && ai(e);
5069
+ e !== void 0 && li(e);
5034
5070
  const i = "rectangle";
5035
5071
  this.transformData = {
5036
5072
  type: "shape",
@@ -5044,10 +5080,10 @@ class Ot extends tt {
5044
5080
  sides: ((g = t.transformData) == null ? void 0 : g.sides) ?? 5,
5045
5081
  points: ((d = t.transformData) == null ? void 0 : d.points) ?? 5,
5046
5082
  innerRadius: ((f = t.transformData) == null ? void 0 : f.innerRadius) ?? 0.4,
5047
- fillColor: ((u = t.transformData) == null ? void 0 : u.fillColor) || Jt(),
5083
+ fillColor: ((u = t.transformData) == null ? void 0 : u.fillColor) || qt(),
5048
5084
  fillOpacity: ((m = t.transformData) == null ? void 0 : m.fillOpacity) ?? 1,
5049
5085
  // Deep-copy so a config's stops array is never aliased by the element
5050
- ...e !== void 0 && { fill: zt(e) }
5086
+ ...e !== void 0 && { fill: Xt(e) }
5051
5087
  };
5052
5088
  }
5053
5089
  /**
@@ -5494,7 +5530,7 @@ class Ot extends tt {
5494
5530
  * Clone this element
5495
5531
  */
5496
5532
  clone() {
5497
- return new Ot(this.toJSON());
5533
+ return new Rt(this.toJSON());
5498
5534
  }
5499
5535
  /**
5500
5536
  * Serialize to JSON
@@ -5516,12 +5552,12 @@ class Ot extends tt {
5516
5552
  ...this.transformData,
5517
5553
  // Deep-copy gradient stops — a spread would alias the stops array
5518
5554
  // between the element and its serialized config (fidelity sweep pin)
5519
- ...this.transformData.fill && { fill: zt(this.transformData.fill) }
5555
+ ...this.transformData.fill && { fill: Xt(this.transformData.fill) }
5520
5556
  }
5521
5557
  };
5522
5558
  }
5523
5559
  }
5524
- class Bt extends tt {
5560
+ class Ht extends tt {
5525
5561
  constructor(t = {}) {
5526
5562
  var e, i, s, r, h, n, a, l, c, g;
5527
5563
  super(t), this.transformType = "path", this.transformData = {
@@ -5531,7 +5567,7 @@ class Bt extends tt {
5531
5567
  width: ((s = t.transformData) == null ? void 0 : s.width) || 200,
5532
5568
  height: ((r = t.transformData) == null ? void 0 : r.height) || 200,
5533
5569
  fillEnabled: ((h = t.transformData) == null ? void 0 : h.fillEnabled) ?? !1,
5534
- fillColor: ((n = t.transformData) == null ? void 0 : n.fillColor) || Jt(),
5570
+ fillColor: ((n = t.transformData) == null ? void 0 : n.fillColor) || qt(),
5535
5571
  fillOpacity: ((a = t.transformData) == null ? void 0 : a.fillOpacity) ?? 1,
5536
5572
  strokeEnabled: ((l = t.transformData) == null ? void 0 : l.strokeEnabled) ?? !0,
5537
5573
  strokeColor: ((c = t.transformData) == null ? void 0 : c.strokeColor) || "#000000",
@@ -5608,8 +5644,8 @@ class Bt extends tt {
5608
5644
  x: u.x + (((c = u.handleIn) == null ? void 0 : c.x) || 0),
5609
5645
  y: u.y + (((g = u.handleIn) == null ? void 0 : g.y) || 0)
5610
5646
  }, S = { x: u.x, y: u.y }, b = 20;
5611
- for (let v = 0; v <= b; v++) {
5612
- const C = v / b, M = this.bezierPoint(p, y, w, S, C);
5647
+ for (let T = 0; T <= b; T++) {
5648
+ const C = T / b, M = this.bezierPoint(p, y, w, S, C);
5613
5649
  e = Math.min(e, M.x), i = Math.min(i, M.y), s = Math.max(s, M.x), r = Math.max(r, M.y);
5614
5650
  }
5615
5651
  }
@@ -5797,7 +5833,7 @@ class Bt extends tt {
5797
5833
  * Clone this element
5798
5834
  */
5799
5835
  clone() {
5800
- return new Bt(this.toJSON());
5836
+ return new Ht(this.toJSON());
5801
5837
  }
5802
5838
  /**
5803
5839
  * Serialize to JSON
@@ -5827,7 +5863,7 @@ class Bt extends tt {
5827
5863
  };
5828
5864
  }
5829
5865
  }
5830
- const hi = {
5866
+ const ci = {
5831
5867
  circle: [
5832
5868
  {
5833
5869
  key: "reverse",
@@ -5840,7 +5876,7 @@ const hi = {
5840
5876
  {
5841
5877
  key: "archHeight",
5842
5878
  label: "Arch Height",
5843
- defaultInternalValue: Qe.archHeight,
5879
+ defaultInternalValue: ei.archHeight,
5844
5880
  // Slider 0-100 maps to internal -1 to 1
5845
5881
  toSlider: (o) => (o + 1) / 2 * 100,
5846
5882
  fromSlider: (o) => o / 100 * 2 - 1,
@@ -5893,7 +5929,7 @@ const hi = {
5893
5929
  {
5894
5930
  key: "leanAmount",
5895
5931
  label: "Lean Amount",
5896
- defaultInternalValue: ti.leanAmount,
5932
+ defaultInternalValue: ii.leanAmount,
5897
5933
  // Slider 0-100 maps to internal -0.5 to 0.5
5898
5934
  // Display as -100% to 100%
5899
5935
  toSlider: (o) => (o + 0.5) * 100,
@@ -5905,7 +5941,7 @@ const hi = {
5905
5941
  {
5906
5942
  key: "ascendAngle",
5907
5943
  label: "Ascend Amount",
5908
- defaultInternalValue: ei.ascendAngle,
5944
+ defaultInternalValue: si.ascendAngle,
5909
5945
  // Slider 0-100 maps to internal angle +30° to -30°
5910
5946
  // Display: slider 0 = -100% (down), slider 50 = 0%, slider 100 = +100% (up)
5911
5947
  toSlider: (o) => (30 - o) / 60 * 100,
@@ -5981,19 +6017,19 @@ const hi = {
5981
6017
  toDisplay: (o) => `${(o * 100).toFixed(0)}%`
5982
6018
  }
5983
6019
  ]
5984
- }, se = [
5985
- { id: "custom", label: "CUSTOM", Component: Ve },
6020
+ }, re = [
6021
+ { id: "custom", label: "CUSTOM", Component: qe },
5986
6022
  // NOTE: distort transform is not yet implemented. Removed from registry
5987
6023
  // to prevent it from appearing in UI that iterates over registered transforms.
5988
6024
  // Re-add with a valid Component when implementation is ready.
5989
- { id: "circle", label: "CIRCLE", Component: Ze },
5990
- { id: "lean", label: "LEAN", Component: oi },
5991
- { id: "arch", label: "ARCH", Component: Ke },
5992
- { id: "ascend", label: "ASCEND", Component: ri },
5993
- { id: "wave", label: "WAVE", Component: ii },
5994
- { id: "flag", label: "FLAG", Component: si },
5995
- { id: "shape", label: "SHAPE", Component: Ot },
5996
- { id: "path", label: "PATH", Component: Bt },
6025
+ { id: "circle", label: "CIRCLE", Component: Qe },
6026
+ { id: "lean", label: "LEAN", Component: ni },
6027
+ { id: "arch", label: "ARCH", Component: ti },
6028
+ { id: "ascend", label: "ASCEND", Component: ai },
6029
+ { id: "wave", label: "WAVE", Component: oi },
6030
+ { id: "flag", label: "FLAG", Component: ri },
6031
+ { id: "shape", label: "SHAPE", Component: Rt },
6032
+ { id: "path", label: "PATH", Component: Ht },
5997
6033
  { id: "image", label: "IMAGE", Component: bt },
5998
6034
  // Use a getter to break circular dependency: GroupElement imports getTransformById
5999
6035
  // from this module, so GroupElement may be in the TDZ during module evaluation.
@@ -6001,9 +6037,9 @@ const hi = {
6001
6037
  { id: "group", label: "GROUP", get Component() {
6002
6038
  return yt;
6003
6039
  } }
6004
- ], oe = new Set(se.map((o) => o.id)), pt = /* @__PURE__ */ new Map();
6005
- function Ts(o, t) {
6006
- if (oe.has(o))
6040
+ ], ne = new Set(re.map((o) => o.id)), pt = /* @__PURE__ */ new Map();
6041
+ function Ms(o, t) {
6042
+ if (ne.has(o))
6007
6043
  throw new Error(
6008
6044
  `Cannot register transform type "${o}": conflicts with built-in type`
6009
6045
  );
@@ -6013,19 +6049,19 @@ function Ts(o, t) {
6013
6049
  );
6014
6050
  pt.set(o, t);
6015
6051
  }
6016
- function Fs(o) {
6017
- if (oe.has(o))
6052
+ function Ds(o) {
6053
+ if (ne.has(o))
6018
6054
  throw new Error(
6019
6055
  `Cannot unregister transform type "${o}": built-in types cannot be removed`
6020
6056
  );
6021
6057
  return pt.delete(o);
6022
6058
  }
6023
- function li(o) {
6024
- const t = se.find((e) => e.id === o);
6059
+ function di(o) {
6060
+ const t = re.find((e) => e.id === o);
6025
6061
  return t || pt.get(o);
6026
6062
  }
6027
- function As(o) {
6028
- return hi[o] || [];
6063
+ function Is(o) {
6064
+ return ci[o] || [];
6029
6065
  }
6030
6066
  class yt extends tt {
6031
6067
  constructor(t = {}) {
@@ -6042,7 +6078,7 @@ class yt extends tt {
6042
6078
  */
6043
6079
  // eslint-disable-next-line @typescript-eslint/no-explicit-any -- JSON deserialization: config comes from toJSON() and constructors accept Partial<Config> with varying signatures
6044
6080
  _reconstructChildFromJSON(t) {
6045
- const e = t.transformType || t.type, i = li(e);
6081
+ const e = t.transformType || t.type, i = di(e);
6046
6082
  if (!i || !i.Component)
6047
6083
  throw new Error(`Unknown transform type: ${e}`);
6048
6084
  return new i.Component(t);
@@ -6129,7 +6165,7 @@ class yt extends tt {
6129
6165
  */
6130
6166
  render(t, e = !1, i = !1) {
6131
6167
  const s = this.children.filter((h) => h.visible !== !1);
6132
- s.some((h) => h.isClipping) ? Le()(t, s) : s.forEach((h) => {
6168
+ s.some((h) => h.isClipping) ? Ne()(t, s) : s.forEach((h) => {
6133
6169
  h.render(t, !1);
6134
6170
  }), e ? this._renderGroupOutline(t, 1) : i && this._renderGroupOutline(t, 0.3);
6135
6171
  }
@@ -6139,7 +6175,7 @@ class yt extends tt {
6139
6175
  */
6140
6176
  _renderGroupOutline(t, e = 1) {
6141
6177
  const i = this.getOrientedBoundingBox();
6142
- t.save(), t.globalAlpha = e, t.strokeStyle = Vt(), t.lineWidth = 2, t.setLineDash([5, 5]);
6178
+ t.save(), t.globalAlpha = e, t.strokeStyle = Jt(), t.lineWidth = 2, t.setLineDash([5, 5]);
6143
6179
  const s = this._rotationCenterX || this.x, r = this._rotationCenterY || this.y;
6144
6180
  this.rotation !== 0 && (t.translate(s, r), t.rotate(-this.rotation * Math.PI / 180), t.translate(-s, -r)), t.strokeRect(i.x, i.y, i.width, i.height), t.setLineDash([]), t.restore();
6145
6181
  }
@@ -6216,16 +6252,16 @@ class yt extends tt {
6216
6252
  }
6217
6253
  const c = -s.rotation * Math.PI / 180, g = Math.cos(c), d = Math.sin(c), f = s.x + (a * g - l * d), u = s.y + (a * d + l * g);
6218
6254
  this.children.forEach((y, w) => {
6219
- const S = s.childrenStartData[w], b = S.x - f, v = S.y - u, C = f + b * n, M = u + v * n;
6255
+ const S = s.childrenStartData[w], b = S.x - f, T = S.y - u, C = f + b * n, M = u + T * n;
6220
6256
  if (y.x = C, y.y = M, y instanceof bt) {
6221
- const F = S.transformData, T = F.width * n, D = F.height * n;
6222
- y.transformData.width = T, y.transformData.height = D;
6257
+ const F = S.transformData, v = F.width * n, D = F.height * n;
6258
+ y.transformData.width = v, y.transformData.height = D;
6223
6259
  } else if (y instanceof yt) {
6224
- const F = (S.width ?? 0) * n, T = (S.height ?? 0) * n;
6225
- y.resize(t, F, T, S);
6260
+ const F = (S.width ?? 0) * n, v = (S.height ?? 0) * n;
6261
+ y.resize(t, F, v, S);
6226
6262
  } else {
6227
- const F = (S.width ?? 0) * n, T = (S.height ?? 0) * n;
6228
- y.resize(t, F, T, S);
6263
+ const F = (S.width ?? 0) * n, v = (S.height ?? 0) * n;
6264
+ y.resize(t, F, v, S);
6229
6265
  }
6230
6266
  }), this._baseBBoxWidth = s.width * n, this._baseBBoxHeight = s.height * n;
6231
6267
  const m = s.x - f, p = s.y - u;
@@ -6486,7 +6522,7 @@ class $ {
6486
6522
  throw new Error("Command.undo() must be implemented");
6487
6523
  }
6488
6524
  }
6489
- class Ms extends $ {
6525
+ class ks extends $ {
6490
6526
  constructor(t, e, i, s) {
6491
6527
  super(), this.elementId = t, this.oldElement = e ? e.clone() : null, this.newElement = i ? i.clone() : null, this.onUpdate = s;
6492
6528
  }
@@ -6497,7 +6533,7 @@ class Ms extends $ {
6497
6533
  this.oldElement && this.onUpdate(this.oldElement);
6498
6534
  }
6499
6535
  }
6500
- class Ds extends $ {
6536
+ class Es extends $ {
6501
6537
  constructor(t, e, i) {
6502
6538
  super(), this.element = t.clone(), this.onAdd = e, this.onRemove = i;
6503
6539
  }
@@ -6508,7 +6544,7 @@ class Ds extends $ {
6508
6544
  this.onRemove(this.element.id);
6509
6545
  }
6510
6546
  }
6511
- class Is extends $ {
6547
+ class Os extends $ {
6512
6548
  constructor(t, e, i) {
6513
6549
  super(), this.element = t.clone(), this.onAdd = e, this.onRemove = i;
6514
6550
  }
@@ -6519,7 +6555,7 @@ class Is extends $ {
6519
6555
  this.onAdd(this.element);
6520
6556
  }
6521
6557
  }
6522
- class ci extends $ {
6558
+ class gi extends $ {
6523
6559
  constructor(t) {
6524
6560
  super(), this.commands = t;
6525
6561
  }
@@ -6551,7 +6587,7 @@ class gt {
6551
6587
  executeBatch(t) {
6552
6588
  if (t.length === 0)
6553
6589
  return;
6554
- const e = new ci(t);
6590
+ const e = new gi(t);
6555
6591
  this.execute(e);
6556
6592
  }
6557
6593
  /**
@@ -6596,7 +6632,7 @@ class gt {
6596
6632
  };
6597
6633
  }
6598
6634
  }
6599
- class ks extends $ {
6635
+ class Bs extends $ {
6600
6636
  constructor(t, e) {
6601
6637
  super(), this.artboard = t.clone(), this.artboardManager = e;
6602
6638
  }
@@ -6616,7 +6652,7 @@ class ks extends $ {
6616
6652
  this.artboardManager.deleteArtboard(this.artboard.id);
6617
6653
  }
6618
6654
  }
6619
- class Es extends $ {
6655
+ class Rs extends $ {
6620
6656
  constructor(t, e) {
6621
6657
  super(), this.artboard = t.clone(), this.artboardManager = e, this.elementsOnArtboard = t.getElementIds();
6622
6658
  }
@@ -6639,7 +6675,7 @@ class Es extends $ {
6639
6675
  });
6640
6676
  }
6641
6677
  }
6642
- class Os extends $ {
6678
+ class Hs extends $ {
6643
6679
  constructor(t, e, i, s) {
6644
6680
  super(), this.artboardId = t, this.oldProperties = { ...e }, this.newProperties = { ...i }, this.artboardManager = s;
6645
6681
  }
@@ -6650,7 +6686,7 @@ class Os extends $ {
6650
6686
  this.artboardManager.updateArtboard(this.artboardId, this.oldProperties);
6651
6687
  }
6652
6688
  }
6653
- class Bs extends $ {
6689
+ class Ps extends $ {
6654
6690
  constructor(t, e, i, s, r) {
6655
6691
  super(), this.draggedId = t, this.targetId = e, this.position = i, this.oldOrder = [...s], this.onReorder = r, this.newOrder = this.calculateNewOrder();
6656
6692
  }
@@ -6670,8 +6706,8 @@ class Bs extends $ {
6670
6706
  this.onReorder(this.oldOrder);
6671
6707
  }
6672
6708
  }
6673
- const di = wt("HybridHistoryManager");
6674
- class Rs {
6709
+ const fi = wt("HybridHistoryManager");
6710
+ class Ls {
6675
6711
  constructor(t, e = 50) {
6676
6712
  this.commandExecutedCallbacks = [], this.globalHistory = new gt(e), this.artboardHistories = /* @__PURE__ */ new Map(), this.lastOperation = null, this.artboardManager = t, this.maxHistorySize = e;
6677
6713
  }
@@ -6693,7 +6729,7 @@ class Rs {
6693
6729
  try {
6694
6730
  s(t, e, i);
6695
6731
  } catch (r) {
6696
- di.error("Error in command executed callback:", r);
6732
+ fi.error("Error in command executed callback:", r);
6697
6733
  }
6698
6734
  }
6699
6735
  /**
@@ -6967,10 +7003,10 @@ class Rs {
6967
7003
  }
6968
7004
  const G = wt("FontAnalyzer");
6969
7005
  let vt = null;
6970
- async function gi() {
7006
+ async function ui() {
6971
7007
  return vt || (vt = await import("./browser-module-DFvKXBUE.js")), vt;
6972
7008
  }
6973
- class fi {
7009
+ class mi {
6974
7010
  constructor() {
6975
7011
  this.fontCache = /* @__PURE__ */ new Map(), this.failedFonts = /* @__PURE__ */ new Set(), this.CACHE_DURATION = 1e3 * 60 * 30, this.MAX_CACHE_SIZE = 5;
6976
7012
  }
@@ -6990,7 +7026,7 @@ class fi {
6990
7026
  * Check if a font is a system font
6991
7027
  */
6992
7028
  isSystemFont(t) {
6993
- return Me.has(t);
7029
+ return Ie.has(t);
6994
7030
  }
6995
7031
  /**
6996
7032
  * Get Google Fonts API URL for a specific font family
@@ -7038,7 +7074,7 @@ class fi {
7038
7074
  const h = await fetch(r);
7039
7075
  if (!h.ok)
7040
7076
  return G.error(`Font fetch failed: ${h.status} ${h.statusText}`), this.failedFonts.add(i), null;
7041
- const n = await h.arrayBuffer(), a = new Uint8Array(n), c = (await gi()).create(a), g = "fonts" in c ? c.fonts[0] : c;
7077
+ const n = await h.arrayBuffer(), a = new Uint8Array(n), c = (await ui()).create(a), g = "fonts" in c ? c.fonts[0] : c;
7042
7078
  return this.fontCache.set(i, {
7043
7079
  font: g,
7044
7080
  url: r,
@@ -7183,13 +7219,13 @@ class fi {
7183
7219
  const S = w.coverage;
7184
7220
  if (!S) continue;
7185
7221
  if (this.getCoverageIndex(S, n.id) !== -1) {
7186
- const v = this.getSubstituteGlyph(w, n.id);
7187
- v !== null && r.push({
7188
- glyphIndex: v,
7222
+ const T = this.getSubstituteGlyph(w, n.id);
7223
+ T !== null && r.push({
7224
+ glyphIndex: T,
7189
7225
  unicode: e,
7190
7226
  name: `${e} (${m})`,
7191
7227
  category: this.categorizeFeature(m),
7192
- previewDataUrl: this.generateGlyphPreview(s, v, 80)
7228
+ previewDataUrl: this.generateGlyphPreview(s, T, 80)
7193
7229
  });
7194
7230
  }
7195
7231
  }
@@ -7197,9 +7233,9 @@ class fi {
7197
7233
  for (const w of y.subtables || []) {
7198
7234
  const S = w.coverage;
7199
7235
  if (!S) continue;
7200
- const b = this.getCoverageIndex(S, n.id), v = w;
7201
- if (b !== -1 && v.alternateSets) {
7202
- const C = v.alternateSets[b];
7236
+ const b = this.getCoverageIndex(S, n.id), T = w;
7237
+ if (b !== -1 && T.alternateSets) {
7238
+ const C = T.alternateSets[b];
7203
7239
  if (C)
7204
7240
  for (const M of C)
7205
7241
  r.push({
@@ -7389,140 +7425,141 @@ class fi {
7389
7425
  };
7390
7426
  }
7391
7427
  }
7392
- const Hs = new fi();
7428
+ const Ws = new mi();
7393
7429
  export {
7394
- si as $,
7430
+ ri as $,
7395
7431
  at as A,
7396
7432
  tt as B,
7397
- Hs as C,
7398
- Cs as D,
7399
- ni as E,
7400
- Li as F,
7433
+ Ws as C,
7434
+ Fs as D,
7435
+ hi as E,
7436
+ Ni as F,
7401
7437
  yt as G,
7402
- ye as H,
7438
+ be as H,
7403
7439
  bt as I,
7404
- ai as J,
7405
- zt as K,
7406
- Re as L,
7407
- kt as M,
7408
- _i as N,
7409
- zi as O,
7410
- Bt as P,
7440
+ li as J,
7441
+ Xt as K,
7442
+ Pe as L,
7443
+ Ot as M,
7444
+ Yi as N,
7445
+ Ui as O,
7446
+ Ht as P,
7411
7447
  dt as Q,
7412
7448
  L as R,
7413
- Ot as S,
7449
+ Rt as S,
7414
7450
  j as T,
7415
- Ms as U,
7416
- Ke as V,
7417
- ui as W,
7418
- ri as X,
7419
- Ze as Y,
7420
- Ve as Z,
7451
+ ks as U,
7452
+ ti as V,
7453
+ pi as W,
7454
+ ai as X,
7455
+ Qe as Y,
7456
+ qe as Z,
7421
7457
  K as _,
7422
- as as a,
7423
- pi as a$,
7424
- Rs as a0,
7425
- oi as a1,
7426
- Ie as a2,
7427
- ii as a3,
7428
- Je as a4,
7429
- us as a5,
7430
- fs as a6,
7431
- ms as a7,
7432
- ps as a8,
7433
- Oe as a9,
7458
+ cs as a,
7459
+ Si as a$,
7460
+ Ls as a0,
7461
+ ni as a1,
7462
+ Ee as a2,
7463
+ oi as a3,
7464
+ je as a4,
7465
+ ys as a5,
7466
+ ps as a6,
7467
+ ws as a7,
7468
+ bs as a8,
7469
+ Re as a9,
7434
7470
  rt as aA,
7435
- Wi as aB,
7436
- Et as aC,
7437
- Jt as aD,
7438
- Fi as aE,
7439
- Vt as aF,
7440
- Ai as aG,
7441
- Mi as aH,
7442
- I as aI,
7443
- P as aJ,
7444
- Hi as aK,
7445
- xs as aL,
7446
- Se as aM,
7447
- yi as aN,
7448
- Ti as aO,
7449
- ws as aP,
7450
- Ce as aQ,
7451
- ys as aR,
7452
- qe as aS,
7453
- bs as aT,
7454
- Oi as aU,
7455
- Ci as aV,
7471
+ _i as aB,
7472
+ zi as aC,
7473
+ Bt as aD,
7474
+ qt as aE,
7475
+ Mi as aF,
7476
+ Jt as aG,
7477
+ Di as aH,
7478
+ Ii as aI,
7479
+ I as aJ,
7480
+ P as aK,
7481
+ Li as aL,
7482
+ Ts as aM,
7483
+ Te as aN,
7484
+ bi as aO,
7485
+ Ai as aP,
7486
+ Ss as aQ,
7487
+ ve as aR,
7488
+ xs as aS,
7489
+ Ze as aT,
7490
+ Cs as aU,
7491
+ Ri as aV,
7456
7492
  vi as aW,
7457
- Si as aX,
7458
- xe as aY,
7459
- xi as aZ,
7460
- bi as a_,
7461
- Ue as aa,
7462
- Ye as ab,
7493
+ Fi as aX,
7494
+ Ti as aY,
7495
+ Ce as aZ,
7496
+ Ci as a_,
7497
+ $e as aa,
7498
+ Ge as ab,
7463
7499
  ht as ac,
7464
- Wt as ad,
7465
- It as ae,
7466
- Nt as af,
7467
- qt as ag,
7468
- gs as ah,
7500
+ Nt as ad,
7501
+ Et as ae,
7502
+ _t as af,
7503
+ jt as ag,
7504
+ ms as ah,
7469
7505
  Z as ai,
7470
7506
  xt as aj,
7471
- ds as ak,
7472
- De as al,
7473
- Xi as am,
7474
- Yi as an,
7507
+ us as ak,
7508
+ ke as al,
7509
+ Gi as am,
7510
+ $i as an,
7475
7511
  q as ao,
7476
- ls as ap,
7477
- Ds as aq,
7478
- Is as ar,
7479
- ks as as,
7480
- Es as at,
7481
- Os as au,
7482
- Bs as av,
7483
- Fe as aw,
7484
- Ae as ax,
7485
- Ii as ay,
7486
- Qe as az,
7487
- ns as b,
7488
- Ri as b0,
7489
- Bi as b1,
7490
- wi as b2,
7491
- ki as b3,
7492
- Ei as b4,
7493
- Di as b5,
7494
- vs as b6,
7495
- mi as b7,
7496
- se as b8,
7497
- As as b9,
7498
- Pi as ba,
7499
- ti as bb,
7500
- nt as bc,
7501
- Ni as bd,
7502
- We as be,
7512
+ gs as ap,
7513
+ Es as aq,
7514
+ Os as ar,
7515
+ Bs as as,
7516
+ Rs as at,
7517
+ Hs as au,
7518
+ Ps as av,
7519
+ Me as aw,
7520
+ De as ax,
7521
+ Ei as ay,
7522
+ ei as az,
7523
+ ls as b,
7524
+ wi as b0,
7525
+ Pi as b1,
7526
+ Hi as b2,
7527
+ xi as b3,
7528
+ Oi as b4,
7529
+ Bi as b5,
7530
+ ki as b6,
7531
+ As as b7,
7532
+ yi as b8,
7533
+ re as b9,
7534
+ Is as ba,
7535
+ Wi as bb,
7536
+ ii as bc,
7537
+ nt as bd,
7538
+ Xi as be,
7539
+ _e as bf,
7503
7540
  wt as c,
7504
- ts as d,
7505
- Gi as e,
7506
- Qi as f,
7507
- li as g,
7508
- cs as h,
7509
- $i as i,
7510
- Ui as j,
7511
- Ji as k,
7512
- es as l,
7513
- ji as m,
7514
- Ki as n,
7515
- qi as o,
7516
- hs as p,
7517
- ss as q,
7518
- Ts as r,
7519
- rs as s,
7520
- is as t,
7521
- Fs as u,
7522
- os as v,
7523
- Zi as w,
7524
- Vi as x,
7525
- Ss as y,
7541
+ ss as d,
7542
+ Ji as e,
7543
+ is as f,
7544
+ di as g,
7545
+ fs as h,
7546
+ qi as i,
7547
+ Vi as j,
7548
+ Zi as k,
7549
+ os as l,
7550
+ Qi as m,
7551
+ es as n,
7552
+ Ki as o,
7553
+ ds as p,
7554
+ ns as q,
7555
+ Ms as r,
7556
+ hs as s,
7557
+ rs as t,
7558
+ Ds as u,
7559
+ as as v,
7560
+ ts as w,
7561
+ ji as x,
7562
+ vs as y,
7526
7563
  mt as z
7527
7564
  };
7528
- //# sourceMappingURL=FontAnalyzer-BrKY6XYn.js.map
7565
+ //# sourceMappingURL=FontAnalyzer-CEYA_6fY.js.map