@component-hook/pdf-canvas 1.1.0-alpha.3 → 1.1.0-alpha.4

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.
@@ -14,7 +14,7 @@ var Ae = (a, t, e, s) => ({
14
14
  }
15
15
  });
16
16
  import { onMounted as _y, onBeforeUnmount as Km, defineComponent as wy, ref as xy, computed as Sy, nextTick as Cy, watch as tg, createElementBlock as Ay, openBlock as Ty, withModifiers as eg, normalizeStyle as Ey, createElementVNode as ky, normalizeClass as My } from "vue";
17
- function T(a, t, e) {
17
+ function E(a, t, e) {
18
18
  return (t = function(s) {
19
19
  var i = function(n, r) {
20
20
  if (typeof n != "object" || !n) return n;
@@ -39,11 +39,11 @@ function zp(a, t) {
39
39
  }
40
40
  return e;
41
41
  }
42
- function A(a) {
42
+ function T(a) {
43
43
  for (var t = 1; t < arguments.length; t++) {
44
44
  var e = arguments[t] != null ? arguments[t] : {};
45
45
  t % 2 ? zp(Object(e), !0).forEach(function(s) {
46
- T(a, s, e[s]);
46
+ E(a, s, e[s]);
47
47
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(e)) : zp(Object(e)).forEach(function(s) {
48
48
  Object.defineProperty(a, s, Object.getOwnPropertyDescriptor(e, s));
49
49
  });
@@ -72,7 +72,7 @@ function lr(a, t) {
72
72
  }
73
73
  class Vp {
74
74
  constructor() {
75
- T(this, "browserShadowBlurConstant", 1), T(this, "DPI", 96), T(this, "devicePixelRatio", typeof window < "u" ? window.devicePixelRatio : 1), T(this, "perfLimitSizeTotal", 2097152), T(this, "maxCacheSideLimit", 4096), T(this, "minCacheSideLimit", 256), T(this, "disableStyleCopyPaste", !1), T(this, "enableGLFiltering", !0), T(this, "textureSize", 4096), T(this, "forceGLPutImageData", !1), T(this, "cachesBoundsOfCurve", !1), T(this, "fontPaths", {}), T(this, "NUM_FRACTION_DIGITS", 4);
75
+ E(this, "browserShadowBlurConstant", 1), E(this, "DPI", 96), E(this, "devicePixelRatio", typeof window < "u" ? window.devicePixelRatio : 1), E(this, "perfLimitSizeTotal", 2097152), E(this, "maxCacheSideLimit", 4096), E(this, "minCacheSideLimit", 256), E(this, "disableStyleCopyPaste", !1), E(this, "enableGLFiltering", !0), E(this, "textureSize", 4096), E(this, "forceGLPutImageData", !1), E(this, "cachesBoundsOfCurve", !1), E(this, "fontPaths", {}), E(this, "NUM_FRACTION_DIGITS", 4);
76
76
  }
77
77
  }
78
78
  const ot = new class extends Vp {
@@ -85,7 +85,7 @@ const ot = new class extends Vp {
85
85
  }
86
86
  addFonts() {
87
87
  let a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
88
- this.fontPaths = A(A({}, this.fontPaths), a);
88
+ this.fontPaths = T(T({}, this.fontPaths), a);
89
89
  }
90
90
  removeFonts() {
91
91
  (arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : []).forEach((a) => {
@@ -137,7 +137,7 @@ const Ei = () => Xp || (Xp = { document, window, isTouchSupported: "ontouchstart
137
137
  return Math.max((a = ot.devicePixelRatio) !== null && a !== void 0 ? a : Dd().devicePixelRatio, 1);
138
138
  }, Vh = new class {
139
139
  constructor() {
140
- T(this, "charWidthsCache", {}), T(this, "boundsOfCurveCache", {});
140
+ E(this, "charWidthsCache", {}), E(this, "boundsOfCurveCache", {});
141
141
  }
142
142
  getFontCache(a) {
143
143
  let { fontFamily: t, fontStyle: e, fontWeight: s } = a;
@@ -201,7 +201,7 @@ const ir = Math.PI / 2, mn = 2 * Math.PI, sp = Math.PI / 180, je = Object.freeze
201
201
  }();
202
202
  class Fy {
203
203
  constructor() {
204
- T(this, "__eventListeners", {});
204
+ E(this, "__eventListeners", {});
205
205
  }
206
206
  on(t, e) {
207
207
  if (this.__eventListeners || (this.__eventListeners = {}), typeof t == "object") return Object.entries(t).forEach((s) => {
@@ -277,49 +277,49 @@ const pr = (a, t) => {
277
277
  }
278
278
  return Math.sin(a);
279
279
  };
280
- class D {
280
+ class P {
281
281
  constructor() {
282
282
  let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0, e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
283
283
  typeof t == "object" ? (this.x = t.x, this.y = t.y) : (this.x = t, this.y = e);
284
284
  }
285
285
  add(t) {
286
- return new D(this.x + t.x, this.y + t.y);
286
+ return new P(this.x + t.x, this.y + t.y);
287
287
  }
288
288
  addEquals(t) {
289
289
  return this.x += t.x, this.y += t.y, this;
290
290
  }
291
291
  scalarAdd(t) {
292
- return new D(this.x + t, this.y + t);
292
+ return new P(this.x + t, this.y + t);
293
293
  }
294
294
  scalarAddEquals(t) {
295
295
  return this.x += t, this.y += t, this;
296
296
  }
297
297
  subtract(t) {
298
- return new D(this.x - t.x, this.y - t.y);
298
+ return new P(this.x - t.x, this.y - t.y);
299
299
  }
300
300
  subtractEquals(t) {
301
301
  return this.x -= t.x, this.y -= t.y, this;
302
302
  }
303
303
  scalarSubtract(t) {
304
- return new D(this.x - t, this.y - t);
304
+ return new P(this.x - t, this.y - t);
305
305
  }
306
306
  scalarSubtractEquals(t) {
307
307
  return this.x -= t, this.y -= t, this;
308
308
  }
309
309
  multiply(t) {
310
- return new D(this.x * t.x, this.y * t.y);
310
+ return new P(this.x * t.x, this.y * t.y);
311
311
  }
312
312
  scalarMultiply(t) {
313
- return new D(this.x * t, this.y * t);
313
+ return new P(this.x * t, this.y * t);
314
314
  }
315
315
  scalarMultiplyEquals(t) {
316
316
  return this.x *= t, this.y *= t, this;
317
317
  }
318
318
  divide(t) {
319
- return new D(this.x / t.x, this.y / t.y);
319
+ return new P(this.x / t.x, this.y / t.y);
320
320
  }
321
321
  scalarDivide(t) {
322
- return new D(this.x / t, this.y / t);
322
+ return new P(this.x / t, this.y / t);
323
323
  }
324
324
  scalarDivideEquals(t) {
325
325
  return this.x /= t, this.y /= t, this;
@@ -341,7 +341,7 @@ class D {
341
341
  }
342
342
  lerp(t) {
343
343
  let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0.5;
344
- return e = Math.max(Math.min(1, e), 0), new D(this.x + (t.x - this.x) * e, this.y + (t.y - this.y) * e);
344
+ return e = Math.max(Math.min(1, e), 0), new P(this.x + (t.x - this.x) * e, this.y + (t.y - this.y) * e);
345
345
  }
346
346
  distanceFrom(t) {
347
347
  const e = this.x - t.x, s = this.y - t.y;
@@ -351,10 +351,10 @@ class D {
351
351
  return this.lerp(t);
352
352
  }
353
353
  min(t) {
354
- return new D(Math.min(this.x, t.x), Math.min(this.y, t.y));
354
+ return new P(Math.min(this.x, t.x), Math.min(this.y, t.y));
355
355
  }
356
356
  max(t) {
357
- return new D(Math.max(this.x, t.x), Math.max(this.y, t.y));
357
+ return new P(Math.max(this.x, t.x), Math.max(this.y, t.y));
358
358
  }
359
359
  toString() {
360
360
  return "".concat(this.x, ",").concat(this.y);
@@ -376,23 +376,23 @@ class D {
376
376
  this.x = t.x, this.y = t.y, t.x = e, t.y = s;
377
377
  }
378
378
  clone() {
379
- return new D(this.x, this.y);
379
+ return new P(this.x, this.y);
380
380
  }
381
381
  rotate(t) {
382
382
  let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : op;
383
383
  const s = Ks(t), i = qs(t), n = this.subtract(e);
384
- return new D(n.x * i - n.y * s, n.x * s + n.y * i).add(e);
384
+ return new P(n.x * i - n.y * s, n.x * s + n.y * i).add(e);
385
385
  }
386
386
  transform(t) {
387
387
  let e = arguments.length > 1 && arguments[1] !== void 0 && arguments[1];
388
- return new D(t[0] * this.x + t[2] * this.y + (e ? 0 : t[4]), t[1] * this.x + t[3] * this.y + (e ? 0 : t[5]));
388
+ return new P(t[0] * this.x + t[2] * this.y + (e ? 0 : t[4]), t[1] * this.x + t[3] * this.y + (e ? 0 : t[5]));
389
389
  }
390
390
  }
391
- const op = new D(0, 0), cu = (a) => !!a && Array.isArray(a._objects);
391
+ const op = new P(0, 0), cu = (a) => !!a && Array.isArray(a._objects);
392
392
  function e0(a) {
393
393
  class t extends a {
394
394
  constructor() {
395
- super(...arguments), T(this, "_objects", []);
395
+ super(...arguments), E(this, "_objects", []);
396
396
  }
397
397
  _onObjectAdded(s) {
398
398
  }
@@ -490,7 +490,7 @@ function e0(a) {
490
490
  }
491
491
  collectObjects(s) {
492
492
  let { left: i, top: n, width: r, height: o } = s, { includeIntersecting: h = !0 } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
493
- const c = [], u = new D(i, n), d = u.add(new D(r, o));
493
+ const c = [], u = new P(i, n), d = u.add(new P(r, o));
494
494
  for (let g = this._objects.length - 1; g >= 0; g--) {
495
495
  const f = this._objects[g];
496
496
  f.selectable && f.visible && (h && f.intersectsWithRect(u, d) || f.isContainedWithinRect(u, d) || h && f.containsPoint(u) || h && f.containsPoint(d)) && c.push(f);
@@ -538,8 +538,8 @@ const nr = () => Iy++, Es = () => {
538
538
  return t.width = a.width, t.height = a.height, t;
539
539
  }, ap = (a, t, e) => a.toDataURL("image/".concat(t), e), hp = (a, t, e) => new Promise((s, i) => {
540
540
  a.toBlob(s, "image/".concat(t), e);
541
- }), Ot = (a) => a * sp, rr = (a) => a / sp, r0 = (a) => a.every((t, e) => t === je[e]), ye = (a, t, e) => new D(a).transform(t, e), Ye = (a) => {
542
- const t = 1 / (a[0] * a[3] - a[1] * a[2]), e = [t * a[3], -t * a[1], -t * a[2], t * a[0], 0, 0], { x: s, y: i } = new D(a[4], a[5]).transform(e, !0);
541
+ }), Ot = (a) => a * sp, rr = (a) => a / sp, r0 = (a) => a.every((t, e) => t === je[e]), ye = (a, t, e) => new P(a).transform(t, e), Ye = (a) => {
542
+ const t = 1 / (a[0] * a[3] - a[1] * a[2]), e = [t * a[3], -t * a[1], -t * a[2], t * a[0], 0, 0], { x: s, y: i } = new P(a[4], a[5]).transform(e, !0);
543
543
  return e[4] = -s, e[5] = -i, e;
544
544
  }, Nt = (a, t, e) => [a[0] * t[0] + a[2] * t[1], a[1] * t[0] + a[3] * t[1], a[0] * t[2] + a[2] * t[3], a[1] * t[2] + a[3] * t[3], e ? 0 : a[0] * t[4] + a[2] * t[5] + a[4], e ? 0 : a[1] * t[4] + a[3] * t[5] + a[5]], Ld = (a, t) => a.reduceRight((e, s) => s && e ? Nt(s, e, t) : s || e, void 0) || je.concat(), o0 = (a) => {
545
545
  let [t, e] = a;
@@ -644,7 +644,7 @@ const Fd = function(a) {
644
644
  };
645
645
  class ft {
646
646
  constructor(t) {
647
- if (T(this, "isUnrecognised", !1), t) if (t instanceof ft) this.setSource([...t._source]);
647
+ if (E(this, "isUnrecognised", !1), t) if (t instanceof ft) this.setSource([...t._source]);
648
648
  else if (Array.isArray(t)) {
649
649
  const [e, s, i, n = 1] = t;
650
650
  this.setSource([e, s, i, n]);
@@ -808,7 +808,7 @@ function Qp(a) {
808
808
  }
809
809
  class d0 {
810
810
  constructor(t) {
811
- T(this, "_originalCanvasStyle", void 0), T(this, "lower", void 0);
811
+ E(this, "_originalCanvasStyle", void 0), E(this, "lower", void 0);
812
812
  const e = this.createLowerCanvas(t);
813
813
  this.lower = { el: e, ctx: e.getContext("2d") };
814
814
  }
@@ -912,7 +912,7 @@ Resulting to default behavior: removing object from previous canvas and adding t
912
912
  _setDimensionsImpl(t) {
913
913
  let { cssOnly: e = !1, backstoreOnly: s = !1 } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
914
914
  if (!e) {
915
- const i = A({ width: this.width, height: this.height }, t);
915
+ const i = T({ width: this.width, height: this.height }, t);
916
916
  this.elements.setDimensions(i, this.getRetinaScaling()), this.hasLostContext = !0, this.width = i.width, this.height = i.height;
917
917
  }
918
918
  s || this.elements.setCSSDimensions(t), this.calcOffset();
@@ -933,14 +933,14 @@ Resulting to default behavior: removing object from previous canvas and adding t
933
933
  i[4] += s.x - r.x, i[5] += s.y - r.y, this.setViewportTransform(i);
934
934
  }
935
935
  setZoom(t) {
936
- this.zoomToPoint(new D(0, 0), t);
936
+ this.zoomToPoint(new P(0, 0), t);
937
937
  }
938
938
  absolutePan(t) {
939
939
  const e = [...this.viewportTransform];
940
940
  return e[4] = -t.x, e[5] = -t.y, this.setViewportTransform(e);
941
941
  }
942
942
  relativePan(t) {
943
- return this.absolutePan(new D(-t.x - this.viewportTransform[4], -t.y - this.viewportTransform[5]));
943
+ return this.absolutePan(new P(-t.x - this.viewportTransform[4], -t.y - this.viewportTransform[5]));
944
944
  }
945
945
  getElement() {
946
946
  return this.elements.lower.el;
@@ -965,7 +965,7 @@ Resulting to default behavior: removing object from previous canvas and adding t
965
965
  }
966
966
  calcViewportBoundaries() {
967
967
  const t = this.width, e = this.height, s = Ye(this.viewportTransform), i = ye({ x: 0, y: 0 }, s), n = ye({ x: t, y: e }, s), r = i.min(n), o = i.max(n);
968
- return this.vptCoords = { tl: r, tr: new D(o.x, r.y), bl: new D(r.x, o.y), br: o };
968
+ return this.vptCoords = { tl: r, tr: new P(o.x, r.y), bl: new P(r.x, o.y), br: o };
969
969
  }
970
970
  cancelRequestedRender() {
971
971
  this.nextRenderHandle && (i0(this.nextRenderHandle), this.nextRenderHandle = 0);
@@ -1012,13 +1012,13 @@ Resulting to default behavior: removing object from previous canvas and adding t
1012
1012
  return { top: this.height / 2, left: this.width / 2 };
1013
1013
  }
1014
1014
  getCenterPoint() {
1015
- return new D(this.width / 2, this.height / 2);
1015
+ return new P(this.width / 2, this.height / 2);
1016
1016
  }
1017
1017
  centerObjectH(t) {
1018
- return this._centerObject(t, new D(this.getCenterPoint().x, t.getCenterPoint().y));
1018
+ return this._centerObject(t, new P(this.getCenterPoint().x, t.getCenterPoint().y));
1019
1019
  }
1020
1020
  centerObjectV(t) {
1021
- return this._centerObject(t, new D(t.getCenterPoint().x, this.getCenterPoint().y));
1021
+ return this._centerObject(t, new P(t.getCenterPoint().x, this.getCenterPoint().y));
1022
1022
  }
1023
1023
  centerObject(t) {
1024
1024
  return this._centerObject(t, this.getCenterPoint());
@@ -1027,10 +1027,10 @@ Resulting to default behavior: removing object from previous canvas and adding t
1027
1027
  return this._centerObject(t, this.getVpCenter());
1028
1028
  }
1029
1029
  viewportCenterObjectH(t) {
1030
- return this._centerObject(t, new D(this.getVpCenter().x, t.getCenterPoint().y));
1030
+ return this._centerObject(t, new P(this.getVpCenter().x, t.getCenterPoint().y));
1031
1031
  }
1032
1032
  viewportCenterObjectV(t) {
1033
- return this._centerObject(t, new D(t.getCenterPoint().x, this.getVpCenter().y));
1033
+ return this._centerObject(t, new P(t.getCenterPoint().x, this.getVpCenter().y));
1034
1034
  }
1035
1035
  getVpCenter() {
1036
1036
  return ye(this.getCenterPoint(), Ye(this.viewportTransform));
@@ -1052,7 +1052,7 @@ Resulting to default behavior: removing object from previous canvas and adding t
1052
1052
  }
1053
1053
  _toObjectMethod(t, e) {
1054
1054
  const s = this.clipPath, i = s && !s.excludeFromExport ? this._toObject(s, t, e) : null;
1055
- return A(A(A({ version: Ag }, No(this, e)), {}, { objects: this._objects.filter((n) => !n.excludeFromExport).map((n) => this._toObject(n, t, e)) }, this.__serializeBgOverlay(t, e)), i ? { clipPath: i } : null);
1055
+ return T(T(T({ version: Ag }, No(this, e)), {}, { objects: this._objects.filter((n) => !n.excludeFromExport).map((n) => this._toObject(n, t, e)) }, this.__serializeBgOverlay(t, e)), i ? { clipPath: i } : null);
1056
1056
  }
1057
1057
  _toObject(t, e, s) {
1058
1058
  let i;
@@ -1198,13 +1198,13 @@ Resulting to default behavior: removing object from previous canvas and adding t
1198
1198
  return "#<Canvas (".concat(this.complexity(), "): { objects: ").concat(this._objects.length, " }>");
1199
1199
  }
1200
1200
  }
1201
- T(Dc, "ownDefaults", Ny);
1201
+ E(Dc, "ownDefaults", Ny);
1202
1202
  const jy = ["touchstart", "touchmove", "touchend"], g0 = (a) => {
1203
1203
  const t = l0(a.target), e = function(s) {
1204
1204
  const i = s.changedTouches;
1205
1205
  return i && i[0] ? i[0] : s;
1206
1206
  }(a);
1207
- return new D(e.clientX + t.left, e.clientY + t.top);
1207
+ return new P(e.clientX + t.left, e.clientY + t.top);
1208
1208
  }, Uu = (a) => jy.includes(a.type) || a.pointerType === "touch", kg = (a) => {
1209
1209
  a.preventDefault(), a.stopPropagation();
1210
1210
  }, Ai = (a) => {
@@ -1215,13 +1215,13 @@ const jy = ["touchstart", "touchmove", "touchend"], g0 = (a) => {
1215
1215
  }
1216
1216
  return { left: t, top: e, width: s - t, height: i - e };
1217
1217
  }, By = ["translateX", "translateY", "scaleX", "scaleY"], f0 = (a, t) => uh(a, Nt(t, a.calcOwnMatrix())), uh = (a, t) => {
1218
- const e = Do(t), { translateX: s, translateY: i, scaleX: n, scaleY: r } = e, o = At(e, By), h = new D(s, i);
1218
+ const e = Do(t), { translateX: s, translateY: i, scaleX: n, scaleY: r } = e, o = At(e, By), h = new P(s, i);
1219
1219
  a.flipX = !1, a.flipY = !1, Object.assign(a, o), a.set({ scaleX: n, scaleY: r }), a.setPositionByOrigin(h, K, K);
1220
1220
  }, p0 = (a) => {
1221
1221
  a.scaleX = 1, a.scaleY = 1, a.skewX = 0, a.skewY = 0, a.flipX = !1, a.flipY = !1, a.rotate(0);
1222
1222
  }, gp = (a) => ({ scaleX: a.scaleX, scaleY: a.scaleY, skewX: a.skewX, skewY: a.skewY, angle: a.angle, left: a.left, flipX: a.flipX, flipY: a.flipY, top: a.top }), Id = (a, t, e) => {
1223
- const s = a / 2, i = t / 2, n = [new D(-s, -i), new D(s, -i), new D(-s, i), new D(s, i)].map((o) => o.transform(e)), r = Ai(n);
1224
- return new D(r.width, r.height);
1223
+ const s = a / 2, i = t / 2, n = [new P(-s, -i), new P(s, -i), new P(-s, i), new P(s, i)].map((o) => o.transform(e)), r = Ai(n);
1224
+ return new P(r.width, r.height);
1225
1225
  }, Oc = function() {
1226
1226
  let a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : je;
1227
1227
  return Nt(Ye(arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : je), a);
@@ -1237,7 +1237,7 @@ const jy = ["touchstart", "touchmove", "touchend"], g0 = (a) => {
1237
1237
  }, b0 = (a, t) => {
1238
1238
  var e;
1239
1239
  const { transform: { target: s } } = t;
1240
- (e = s.canvas) === null || e === void 0 || e.fire("object:".concat(a), A(A({}, t), {}, { target: s })), s.fire(a, t);
1240
+ (e = s.canvas) === null || e === void 0 || e.fire("object:".concat(a), T(T({}, t), {}, { target: s })), s.fire(a, t);
1241
1241
  }, Hy = { left: -0.5, top: -0.5, center: 0, bottom: 0.5, right: 0.5 }, Gt = (a) => typeof a == "string" ? Hy[a] : a - 0.5, Yu = "not-allowed";
1242
1242
  function v0(a) {
1243
1243
  return Gt(a.originX) === Gt(K) && Gt(a.originY) === Gt(K);
@@ -1245,7 +1245,7 @@ function v0(a) {
1245
1245
  function Jp(a) {
1246
1246
  return 0.5 - Gt(a);
1247
1247
  }
1248
- const $s = (a, t) => a[t], y0 = (a, t, e, s) => ({ e: a, transform: t, pointer: new D(e, s) });
1248
+ const $s = (a, t) => a[t], y0 = (a, t, e, s) => ({ e: a, transform: t, pointer: new P(e, s) });
1249
1249
  function _0(a, t) {
1250
1250
  const e = a.getTotalAngle() + rr(Math.atan2(t.y, t.x)) + 360;
1251
1251
  return Math.round(e % 360 / 45);
@@ -1254,9 +1254,9 @@ function fp(a, t, e, s, i) {
1254
1254
  var n;
1255
1255
  let { target: r, corner: o } = a;
1256
1256
  const h = r.controls[o], c = ((n = r.canvas) === null || n === void 0 ? void 0 : n.getZoom()) || 1, u = r.padding / c, d = function(g, f, p, b) {
1257
- const _ = g.getRelativeCenterPoint(), y = p !== void 0 && b !== void 0 ? g.translateToGivenOrigin(_, K, K, p, b) : new D(g.left, g.top);
1257
+ const _ = g.getRelativeCenterPoint(), y = p !== void 0 && b !== void 0 ? g.translateToGivenOrigin(_, K, K, p, b) : new P(g.left, g.top);
1258
1258
  return (g.angle ? f.rotate(-Ot(g.angle), _) : f).subtract(y);
1259
- }(r, new D(s, i), t, e);
1259
+ }(r, new P(s, i), t, e);
1260
1260
  return d.x >= u && (d.x -= u), d.x <= -u && (d.x += u), d.y >= u && (d.y -= u), d.y <= u && (d.y += u), d.x -= h.offsetX, d.y -= h.offsetY, d;
1261
1261
  }
1262
1262
  const Gy = (a, t, e, s) => {
@@ -1315,9 +1315,9 @@ function Nd(a) {
1315
1315
  return new RegExp("^(" + a.join("|") + ")\\b", "i");
1316
1316
  }
1317
1317
  var Zp;
1318
- const Us = String.raw(Zp || (Zp = lr(["(?:[-+]?(?:d*.d+|d+.?)(?:[eE][-+]?d+)?)"], ["(?:[-+]?(?:\\d*\\.\\d+|\\d+\\.?)(?:[eE][-+]?\\d+)?)"]))), Pg = "http://www.w3.org/2000/svg", zy = new RegExp("(normal|italic)?\\s*(normal|small-caps)?\\s*(normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900)?\\s*(" + Us + "(?:px|cm|mm|em|pt|pc|in)*)(?:\\/(normal|" + Us + "))?\\s+(.*)"), Vy = { cx: ut, x: ut, r: "radius", cy: $e, y: $e, display: "visible", visibility: "visible", transform: "transformMatrix", "fill-opacity": "fillOpacity", "fill-rule": "fillRule", "font-family": "fontFamily", "font-size": "fontSize", "font-style": "fontStyle", "font-weight": "fontWeight", "letter-spacing": "charSpacing", "paint-order": "paintFirst", "stroke-dasharray": "strokeDashArray", "stroke-dashoffset": "strokeDashOffset", "stroke-linecap": "strokeLineCap", "stroke-linejoin": "strokeLineJoin", "stroke-miterlimit": "strokeMiterLimit", "stroke-opacity": "strokeOpacity", "stroke-width": "strokeWidth", "text-decoration": "textDecoration", "text-anchor": "textAnchor", opacity: "opacity", "clip-path": "clipPath", "clip-rule": "clipRule", "vector-effect": "strokeUniform", "image-rendering": "imageSmoothing" }, ng = "font-size", rg = "clip-path", Xy = Nd(["path", "circle", "polygon", "polyline", "ellipse", "rect", "line", "image", "text"]), Wy = Nd(["symbol", "image", "marker", "pattern", "view", "svg"]), tm = Nd(["symbol", "g", "a", "svg", "clipPath", "defs"]), em = new RegExp("^\\s*(" + Us + "+)\\s*,?\\s*(" + Us + "+)\\s*,?\\s*(" + Us + "+)\\s*,?\\s*(" + Us + "+)\\s*$"), Uy = new D(1, 0), x0 = new D(), pp = (a, t) => a.rotate(t), $u = (a, t) => new D(t).subtract(a), qu = (a) => a.distanceFrom(x0), Ku = (a, t) => Math.atan2(ea(a, t), C0(a, t)), S0 = (a) => Ku(Uy, a), jd = (a) => a.eq(x0) ? a : a.scalarDivide(qu(a)), mp = function(a) {
1318
+ const Us = String.raw(Zp || (Zp = lr(["(?:[-+]?(?:d*.d+|d+.?)(?:[eE][-+]?d+)?)"], ["(?:[-+]?(?:\\d*\\.\\d+|\\d+\\.?)(?:[eE][-+]?\\d+)?)"]))), Pg = "http://www.w3.org/2000/svg", zy = new RegExp("(normal|italic)?\\s*(normal|small-caps)?\\s*(normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900)?\\s*(" + Us + "(?:px|cm|mm|em|pt|pc|in)*)(?:\\/(normal|" + Us + "))?\\s+(.*)"), Vy = { cx: ut, x: ut, r: "radius", cy: $e, y: $e, display: "visible", visibility: "visible", transform: "transformMatrix", "fill-opacity": "fillOpacity", "fill-rule": "fillRule", "font-family": "fontFamily", "font-size": "fontSize", "font-style": "fontStyle", "font-weight": "fontWeight", "letter-spacing": "charSpacing", "paint-order": "paintFirst", "stroke-dasharray": "strokeDashArray", "stroke-dashoffset": "strokeDashOffset", "stroke-linecap": "strokeLineCap", "stroke-linejoin": "strokeLineJoin", "stroke-miterlimit": "strokeMiterLimit", "stroke-opacity": "strokeOpacity", "stroke-width": "strokeWidth", "text-decoration": "textDecoration", "text-anchor": "textAnchor", opacity: "opacity", "clip-path": "clipPath", "clip-rule": "clipRule", "vector-effect": "strokeUniform", "image-rendering": "imageSmoothing" }, ng = "font-size", rg = "clip-path", Xy = Nd(["path", "circle", "polygon", "polyline", "ellipse", "rect", "line", "image", "text"]), Wy = Nd(["symbol", "image", "marker", "pattern", "view", "svg"]), tm = Nd(["symbol", "g", "a", "svg", "clipPath", "defs"]), em = new RegExp("^\\s*(" + Us + "+)\\s*,?\\s*(" + Us + "+)\\s*,?\\s*(" + Us + "+)\\s*,?\\s*(" + Us + "+)\\s*$"), Uy = new P(1, 0), x0 = new P(), pp = (a, t) => a.rotate(t), $u = (a, t) => new P(t).subtract(a), qu = (a) => a.distanceFrom(x0), Ku = (a, t) => Math.atan2(ea(a, t), C0(a, t)), S0 = (a) => Ku(Uy, a), jd = (a) => a.eq(x0) ? a : a.scalarDivide(qu(a)), mp = function(a) {
1319
1319
  let t = !(arguments.length > 1 && arguments[1] !== void 0) || arguments[1];
1320
- return jd(new D(-a.y, a.x).scalarMultiply(t ? 1 : -1));
1320
+ return jd(new P(-a.y, a.x).scalarMultiply(t ? 1 : -1));
1321
1321
  }, ea = (a, t) => a.x * t.y - a.y * t.x, C0 = (a, t) => a.x * t.x + a.y * t.y, Dg = (a, t, e) => {
1322
1322
  if (a.eq(t) || a.eq(e)) return !0;
1323
1323
  const s = ea(t, e), i = ea(t, a), n = ea(e, a);
@@ -1336,7 +1336,7 @@ class dn {
1336
1336
  return [this.offsetX, this.offsetY, this.blur, this.color].join("px ");
1337
1337
  }
1338
1338
  toSVG(t) {
1339
- const e = pp(new D(this.offsetX, this.offsetY), Ot(-t.angle)), s = new ft(this.color);
1339
+ const e = pp(new P(this.offsetX, this.offsetY), Ot(-t.angle)), s = new ft(this.color);
1340
1340
  let i = 40, n = 40;
1341
1341
  return t.width && t.height && (i = 100 * Ct((Math.abs(e.x) + this.blur) / t.width, ot.NUM_FRACTION_DIGITS) + 20, n = 100 * Ct((Math.abs(e.y) + this.blur) / t.height, ot.NUM_FRACTION_DIGITS) + 20), t.flipX && (e.x *= -1), t.flipY && (e.y *= -1), '<filter id="SVGID_'.concat(this.id, '" y="-').concat(n, '%" height="').concat(100 + 2 * n, '%" x="-').concat(i, '%" width="').concat(100 + 2 * i, `%" >
1342
1342
  <feGaussianBlur in="SourceAlpha" stdDeviation="`).concat(Ct(this.blur ? this.blur / 2 : 0, ot.NUM_FRACTION_DIGITS), `"></feGaussianBlur>
@@ -1358,7 +1358,7 @@ class dn {
1358
1358
  return new this(t);
1359
1359
  }
1360
1360
  }
1361
- T(dn, "ownDefaults", { color: "rgb(0,0,0)", blur: 0, offsetX: 0, offsetY: 0, affectStroke: !1, includeDefaultValues: !0, nonScaling: !1 }), T(dn, "type", "shadow"), j.setClass(dn, "shadow");
1361
+ E(dn, "ownDefaults", { color: "rgb(0,0,0)", blur: 0, offsetX: 0, offsetY: 0, affectStroke: !1, includeDefaultValues: !0, nonScaling: !1 }), E(dn, "type", "shadow"), j.setClass(dn, "shadow");
1362
1362
  const Oo = (a, t, e) => Math.max(a, Math.min(t, e)), Yy = [$e, ut, Be, ds, "flipX", "flipY", "originX", "originY", "angle", "opacity", "globalCompositeOperation", "shadow", "visible", gh, fh], yn = [Vt, Le, "strokeWidth", "strokeDashArray", "width", "height", "paintFirst", "strokeUniform", "strokeLineCap", "strokeDashOffset", "strokeLineJoin", "strokeMiterLimit", "backgroundColor", "clipPath"], $y = { top: 0, left: 0, width: 0, height: 0, angle: 0, flipX: !1, flipY: !1, scaleX: 1, scaleY: 1, minScaleLimit: 0, skewX: 0, skewY: 0, originX: ut, originY: $e, strokeWidth: 1, strokeUniform: !1, padding: 0, opacity: 1, paintFirst: Vt, fill: "rgb(0,0,0)", fillRule: "nonzero", stroke: null, strokeDashArray: null, strokeDashOffset: 0, strokeLineCap: "butt", strokeLineJoin: "miter", strokeMiterLimit: 4, globalCompositeOperation: "source-over", backgroundColor: "", shadow: null, visible: !0, includeDefaultValues: !0, excludeFromExport: !1, objectCaching: !0, clipPath: void 0, inverted: !1, absolutePositioned: !1, centeredRotation: !0, centeredScaling: !1, dirty: !0 }, og = (a, t, e, s) => (a < Math.abs(t) ? (a = t, s = e / 4) : s = t === 0 && a === 0 ? e / mn * Math.asin(1) : e / mn * Math.asin(t / a), { a, c: t, p: e, s }), nm = (a, t, e, s, i) => a * Math.pow(2, 10 * (s -= 1)) * Math.sin((s * i - t) * mn / e), A0 = (a, t, e, s) => -e * Math.cos(a / s * ir) + e + t, Og = (a, t, e, s) => (a /= s) < 1 / 2.75 ? e * (7.5625 * a * a) + t : a < 2 / 2.75 ? e * (7.5625 * (a -= 1.5 / 2.75) * a + 0.75) + t : a < 2.5 / 2.75 ? e * (7.5625 * (a -= 2.25 / 2.75) * a + 0.9375) + t : e * (7.5625 * (a -= 2.625 / 2.75) * a + 0.984375) + t, rm = (a, t, e, s) => e - Og(s - a, 0, e, s) + t;
1363
1363
  var qy = Object.freeze({ __proto__: null, defaultEasing: A0, easeInBack: function(a, t, e, s) {
1364
1364
  let i = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : 1.70158;
@@ -1398,7 +1398,7 @@ const Ky = () => !1;
1398
1398
  class bp {
1399
1399
  constructor(t) {
1400
1400
  let { startValue: e, byValue: s, duration: i = 500, delay: n = 0, easing: r = A0, onStart: o = Mo, onChange: h = Mo, onComplete: c = Mo, abort: u = Ky, target: d } = t;
1401
- T(this, "_state", "pending"), T(this, "durationProgress", 0), T(this, "valueProgress", 0), this.tick = this.tick.bind(this), this.duration = i, this.delay = n, this.easing = r, this._onStart = o, this._onChange = h, this._onComplete = c, this._abort = u, this.target = d, this.startValue = e, this.byValue = s, this.value = this.startValue, this.endValue = Object.freeze(this.calculate(this.duration).value);
1401
+ E(this, "_state", "pending"), E(this, "durationProgress", 0), E(this, "valueProgress", 0), this.tick = this.tick.bind(this), this.duration = i, this.delay = n, this.easing = r, this._onStart = o, this._onChange = h, this._onComplete = c, this._abort = u, this.target = d, this.startValue = e, this.byValue = s, this.value = this.startValue, this.endValue = Object.freeze(this.calculate(this.duration).value);
1402
1402
  }
1403
1403
  get state() {
1404
1404
  return this._state;
@@ -1432,7 +1432,7 @@ const Qy = ["startValue", "endValue"];
1432
1432
  class Jy extends bp {
1433
1433
  constructor(t) {
1434
1434
  let { startValue: e = 0, endValue: s = 100 } = t;
1435
- super(A(A({}, At(t, Qy)), {}, { startValue: e, byValue: s - e }));
1435
+ super(T(T({}, At(t, Qy)), {}, { startValue: e, byValue: s - e }));
1436
1436
  }
1437
1437
  calculate(t) {
1438
1438
  const e = this.easing(t, this.startValue, this.byValue, this.duration);
@@ -1443,7 +1443,7 @@ const Zy = ["startValue", "endValue"];
1443
1443
  class t_ extends bp {
1444
1444
  constructor(t) {
1445
1445
  let { startValue: e = [0], endValue: s = [100] } = t;
1446
- super(A(A({}, At(t, Zy)), {}, { startValue: e, byValue: s.map((i, n) => i - e[n]) }));
1446
+ super(T(T({}, At(t, Zy)), {}, { startValue: e, byValue: s.map((i, n) => i - e[n]) }));
1447
1447
  }
1448
1448
  calculate(t) {
1449
1449
  const e = this.startValue.map((s, i) => this.easing(t, s, this.byValue[i], this.duration, i));
@@ -1455,7 +1455,7 @@ class i_ extends bp {
1455
1455
  constructor(t) {
1456
1456
  let { startValue: e, endValue: s, easing: i = s_, onChange: n, onComplete: r, abort: o } = t, h = At(t, e_);
1457
1457
  const c = new ft(e).getSource(), u = new ft(s).getSource();
1458
- super(A(A({}, h), {}, { startValue: c, byValue: u.map((d, g) => d - c[g]), easing: i, onChange: ag(n), onComplete: ag(r), abort: ag(o) }));
1458
+ super(T(T({}, h), {}, { startValue: c, byValue: u.map((d, g) => d - c[g]), easing: i, onChange: ag(n), onComplete: ag(r), abort: ag(o) }));
1459
1459
  }
1460
1460
  calculate(t) {
1461
1461
  const [e, s, i, n] = this.startValue.map((o, h) => this.easing(t, o, this.byValue[h], this.duration, h)), r = [...[e, s, i].map(Math.round), Oo(0, n, 1)];
@@ -1492,7 +1492,7 @@ class kt {
1492
1492
  }
1493
1493
  }
1494
1494
  static isPointInPolygon(t, e) {
1495
- const s = new D(t).setX(Math.min(t.x - 1, ...e.map((n) => n.x)));
1495
+ const s = new P(t).setX(Math.min(t.x - 1, ...e.map((n) => n.x)));
1496
1496
  let i = 0;
1497
1497
  for (let n = 0; n < e.length; n++) {
1498
1498
  const r = this.intersectSegmentSegment(e[n], e[(n + 1) % e.length], t, s);
@@ -1506,7 +1506,7 @@ class kt {
1506
1506
  const o = e.x - t.x, h = e.y - t.y, c = i.x - s.x, u = i.y - s.y, d = t.x - s.x, g = t.y - s.y, f = c * g - u * d, p = o * g - h * d, b = u * o - c * h;
1507
1507
  if (b !== 0) {
1508
1508
  const _ = f / b, y = p / b;
1509
- return (n || 0 <= _ && _ <= 1) && (r || 0 <= y && y <= 1) ? new kt("Intersection").append(new D(t.x + _ * o, t.y + _ * h)) : new kt();
1509
+ return (n || 0 <= _ && _ <= 1) && (r || 0 <= y && y <= 1) ? new kt("Intersection").append(new P(t.x + _ * o, t.y + _ * h)) : new kt();
1510
1510
  }
1511
1511
  if (f === 0 || p === 0) {
1512
1512
  const _ = n || r || kt.isPointContained(t, s, i) || kt.isPointContained(e, s, i) || kt.isPointContained(s, t, e) || kt.isPointContained(i, t, e);
@@ -1541,7 +1541,7 @@ class kt {
1541
1541
  return n.length > 0 && n.length === t.length ? new kt("Coincident") : (s.points.length > 0 && (s.status = "Intersection"), s);
1542
1542
  }
1543
1543
  static intersectPolygonRectangle(t, e, s) {
1544
- const i = e.min(s), n = e.max(s), r = new D(n.x, i.y), o = new D(i.x, n.y);
1544
+ const i = e.min(s), n = e.max(s), r = new P(n.x, i.y), o = new P(i.x, n.y);
1545
1545
  return kt.intersectPolygonPolygon(t, [i, r, n, o]);
1546
1546
  }
1547
1547
  }
@@ -1578,7 +1578,7 @@ class n_ extends s0 {
1578
1578
  this.group && (t = ye(t, Ye(this.group.calcTransformMatrix()))), this.setRelativeXY(t, e, s);
1579
1579
  }
1580
1580
  getRelativeXY() {
1581
- return new D(this.left, this.top);
1581
+ return new P(this.left, this.top);
1582
1582
  }
1583
1583
  setRelativeXY(t) {
1584
1584
  let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.originX, s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : this.originY;
@@ -1680,19 +1680,19 @@ class n_ extends s0 {
1680
1680
  return this.ownMatrixCache = { key: t, value: n }, n;
1681
1681
  }
1682
1682
  _getNonTransformedDimensions() {
1683
- return new D(this.width, this.height).scalarAdd(this.strokeWidth);
1683
+ return new P(this.width, this.height).scalarAdd(this.strokeWidth);
1684
1684
  }
1685
1685
  _calculateCurrentDimensions(t) {
1686
1686
  return this._getTransformedDimensions(t).transform(this.getViewportTransform(), !0).scalarAdd(2 * this.padding);
1687
1687
  }
1688
1688
  _getTransformedDimensions() {
1689
1689
  let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1690
- const e = A({ scaleX: this.scaleX, scaleY: this.scaleY, skewX: this.skewX, skewY: this.skewY, width: this.width, height: this.height, strokeWidth: this.strokeWidth }, t), s = e.strokeWidth;
1690
+ const e = T({ scaleX: this.scaleX, scaleY: this.scaleY, skewX: this.skewX, skewY: this.skewY, width: this.width, height: this.height, strokeWidth: this.strokeWidth }, t), s = e.strokeWidth;
1691
1691
  let i = s, n = 0;
1692
1692
  this.strokeUniform && (i = 0, n = s);
1693
1693
  const r = e.width + i, o = e.height + i;
1694
1694
  let h;
1695
- return h = e.skewX === 0 && e.skewY === 0 ? new D(r * e.scaleX, o * e.scaleY) : Id(r, o, Mc(e)), h.scalarAdd(n);
1695
+ return h = e.skewX === 0 && e.skewY === 0 ? new P(r * e.scaleX, o * e.scaleY) : Id(r, o, Mc(e)), h.scalarAdd(n);
1696
1696
  }
1697
1697
  translateToGivenOrigin(t, e, s, i, n) {
1698
1698
  let r = t.x, o = t.y;
@@ -1701,7 +1701,7 @@ class n_ extends s0 {
1701
1701
  const u = this._getTransformedDimensions();
1702
1702
  r += h * u.x, o += c * u.y;
1703
1703
  }
1704
- return new D(r, o);
1704
+ return new P(r, o);
1705
1705
  }
1706
1706
  translateToCenterPoint(t, e, s) {
1707
1707
  if (e === K && s === K) return t;
@@ -1717,7 +1717,7 @@ class n_ extends s0 {
1717
1717
  return this.group ? ye(t, this.group.calcTransformMatrix()) : t;
1718
1718
  }
1719
1719
  getRelativeCenterPoint() {
1720
- return this.translateToCenterPoint(new D(this.left, this.top), this.originX, this.originY);
1720
+ return this.translateToCenterPoint(new P(this.left, this.top), this.originX, this.originY);
1721
1721
  }
1722
1722
  getPointByOrigin(t, e) {
1723
1723
  return this.translateToOriginPoint(this.getRelativeCenterPoint(), t, e);
@@ -1743,7 +1743,7 @@ let Mi = class uu extends n_ {
1743
1743
  pn("warn", "Setting type has no effect", t);
1744
1744
  }
1745
1745
  constructor(t) {
1746
- super(), T(this, "_cacheContext", null), Object.assign(this, uu.ownDefaults), this.setOptions(t);
1746
+ super(), E(this, "_cacheContext", null), Object.assign(this, uu.ownDefaults), this.setOptions(t);
1747
1747
  }
1748
1748
  _createCacheCanvas() {
1749
1749
  this._cacheCanvas = Es(), this._cacheContext = this._cacheCanvas.getContext("2d"), this._updateCacheCanvas(), this.dirty = !0;
@@ -1777,9 +1777,9 @@ let Mi = class uu extends n_ {
1777
1777
  t.transform(s[0], s[1], s[2], s[3], s[4], s[5]);
1778
1778
  }
1779
1779
  getObjectScaling() {
1780
- if (!this.group) return new D(Math.abs(this.scaleX), Math.abs(this.scaleY));
1780
+ if (!this.group) return new P(Math.abs(this.scaleX), Math.abs(this.scaleY));
1781
1781
  const t = Do(this.calcTransformMatrix());
1782
- return new D(Math.abs(t.scaleX), Math.abs(t.scaleY));
1782
+ return new P(Math.abs(t.scaleX), Math.abs(t.scaleY));
1783
1783
  }
1784
1784
  getTotalObjectScaling() {
1785
1785
  const t = this.getObjectScaling();
@@ -1889,7 +1889,7 @@ let Mi = class uu extends n_ {
1889
1889
  }
1890
1890
  _setShadow(t) {
1891
1891
  if (!this.shadow) return;
1892
- const e = this.shadow, s = this.canvas, i = this.getCanvasRetinaScaling(), [n, , , r] = (s == null ? void 0 : s.viewportTransform) || je, o = n * i, h = r * i, c = e.nonScaling ? new D(1, 1) : this.getObjectScaling();
1892
+ const e = this.shadow, s = this.canvas, i = this.getCanvasRetinaScaling(), [n, , , r] = (s == null ? void 0 : s.viewportTransform) || je, o = n * i, h = r * i, c = e.nonScaling ? new P(1, 1) : this.getObjectScaling();
1893
1893
  t.shadowColor = e.color, t.shadowBlur = e.blur * ot.browserShadowBlurConstant * (o + h) * (c.x + c.y) / 4, t.shadowOffsetX = e.offsetX * o * c.x, t.shadowOffsetY = e.offsetY * h * c.y;
1894
1894
  }
1895
1895
  _removeShadow(t) {
@@ -1923,7 +1923,7 @@ let Mi = class uu extends n_ {
1923
1923
  c && (c.beginPath(), c.moveTo(0, 0), c.lineTo(r, 0), c.lineTo(r, o), c.lineTo(0, o), c.closePath(), c.translate(r / 2, o / 2), c.scale(i.zoomX / this.scaleX / n, i.zoomY / this.scaleY / n), this._applyPatternGradientTransform(c, e), c.fillStyle = e.toLive(t), c.fill(), t.translate(-this.width / 2 - this.strokeWidth / 2, -this.height / 2 - this.strokeWidth / 2), t.scale(n * this.scaleX / i.zoomX, n * this.scaleY / i.zoomY), t.strokeStyle = (s = c.createPattern(h, "no-repeat")) !== null && s !== void 0 ? s : "");
1924
1924
  }
1925
1925
  _findCenterFromElement() {
1926
- return new D(this.left + this.width / 2, this.top + this.height / 2);
1926
+ return new P(this.left + this.width / 2, this.top + this.height / 2);
1927
1927
  }
1928
1928
  clone(t) {
1929
1929
  const e = this.toObject(t);
@@ -1937,15 +1937,15 @@ let Mi = class uu extends n_ {
1937
1937
  let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1938
1938
  const e = gp(this), s = this.group, i = this.shadow, n = Math.abs, r = t.enableRetinaScaling ? Qm() : 1, o = (t.multiplier || 1) * r, h = t.canvasProvider || ((x) => new Dc(x, { enableRetinaScaling: !1, renderOnAddRemove: !1, skipOffscreen: !1 }));
1939
1939
  delete this.group, t.withoutTransform && p0(this), t.withoutShadow && (this.shadow = null), t.viewportTransform && Mg(this, this.getViewportTransform()), this.setCoords();
1940
- const c = Es(), u = this.getBoundingRect(), d = this.shadow, g = new D();
1940
+ const c = Es(), u = this.getBoundingRect(), d = this.shadow, g = new P();
1941
1941
  if (d) {
1942
- const x = d.blur, C = d.nonScaling ? new D(1, 1) : this.getObjectScaling();
1942
+ const x = d.blur, C = d.nonScaling ? new P(1, 1) : this.getObjectScaling();
1943
1943
  g.x = 2 * Math.round(n(d.offsetX) + x) * n(C.x), g.y = 2 * Math.round(n(d.offsetY) + x) * n(C.y);
1944
1944
  }
1945
1945
  const f = u.width + g.x, p = u.height + g.y;
1946
1946
  c.width = Math.ceil(f), c.height = Math.ceil(p);
1947
1947
  const b = h(c);
1948
- t.format === "jpeg" && (b.backgroundColor = "#fff"), this.setPositionByOrigin(new D(b.width / 2, b.height / 2), K, K);
1948
+ t.format === "jpeg" && (b.backgroundColor = "#fff"), this.setPositionByOrigin(new P(b.width / 2, b.height / 2), K, K);
1949
1949
  const _ = this.canvas;
1950
1950
  b._objects = [this], this.set("canvas", b), this.setCoords();
1951
1951
  const y = b.toCanvasElement(o || 1, t);
@@ -1996,7 +1996,7 @@ let Mi = class uu extends n_ {
1996
1996
  }
1997
1997
  _animate(t, e) {
1998
1998
  let s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
1999
- const i = t.split("."), n = this.constructor.colorProperties.includes(i[i.length - 1]), { abort: r, startValue: o, onChange: h, onComplete: c } = s, u = A(A({}, s), {}, { target: this, startValue: o ?? i.reduce((d, g) => d[g], this), endValue: e, abort: r == null ? void 0 : r.bind(this), onChange: (d, g, f) => {
1999
+ const i = t.split("."), n = this.constructor.colorProperties.includes(i[i.length - 1]), { abort: r, startValue: o, onChange: h, onComplete: c } = s, u = T(T({}, s), {}, { target: this, startValue: o ?? i.reduce((d, g) => d[g], this), endValue: e, abort: r == null ? void 0 : r.bind(this), onChange: (d, g, f) => {
2000
2000
  i.reduce((p, b, _) => (_ === i.length - 1 && (p[b] = d), p[b]), this), h && h(d, g, f);
2001
2001
  }, onComplete: (d, g, f) => {
2002
2002
  this.setCoords(), c && c(d, g, f);
@@ -2045,9 +2045,9 @@ let Mi = class uu extends n_ {
2045
2045
  toObject() {
2046
2046
  const t = (arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : []).concat(uu.customProperties, this.constructor.customProperties || []);
2047
2047
  let e;
2048
- const s = ot.NUM_FRACTION_DIGITS, { clipPath: i, fill: n, stroke: r, shadow: o, strokeDashArray: h, left: c, top: u, originX: d, originY: g, width: f, height: p, strokeWidth: b, strokeLineCap: _, strokeDashOffset: y, strokeLineJoin: x, strokeUniform: C, strokeMiterLimit: S, scaleX: k, scaleY: M, angle: E, flipX: P, flipY: O, opacity: L, visible: R, backgroundColor: U, fillRule: z, paintFirst: V, globalCompositeOperation: rt, skewX: F, skewY: G } = this;
2048
+ const s = ot.NUM_FRACTION_DIGITS, { clipPath: i, fill: n, stroke: r, shadow: o, strokeDashArray: h, left: c, top: u, originX: d, originY: g, width: f, height: p, strokeWidth: b, strokeLineCap: _, strokeDashOffset: y, strokeLineJoin: x, strokeUniform: C, strokeMiterLimit: S, scaleX: k, scaleY: D, angle: A, flipX: M, flipY: O, opacity: R, visible: L, backgroundColor: X, fillRule: U, paintFirst: G, globalCompositeOperation: rt, skewX: F, skewY: z } = this;
2049
2049
  i && !i.excludeFromExport && (e = i.toObject(t.concat("inverted", "absolutePositioned")));
2050
- const it = (Wt) => Ct(Wt, s), Rt = A(A({}, No(this, t)), {}, { type: this.constructor.type, version: Ag, originX: d, originY: g, left: it(c), top: it(u), width: it(f), height: it(p), fill: qp(n) ? n.toObject() : n, stroke: qp(r) ? r.toObject() : r, strokeWidth: it(b), strokeDashArray: h && h.concat(), strokeLineCap: _, strokeDashOffset: y, strokeLineJoin: x, strokeUniform: C, strokeMiterLimit: it(S), scaleX: it(k), scaleY: it(M), angle: it(E), flipX: P, flipY: O, opacity: it(L), shadow: o && o.toObject(), visible: R, backgroundColor: U, fillRule: z, paintFirst: V, globalCompositeOperation: rt, skewX: it(F), skewY: it(G) }, e ? { clipPath: e } : null);
2050
+ const it = (Wt) => Ct(Wt, s), Rt = T(T({}, No(this, t)), {}, { type: this.constructor.type, version: Ag, originX: d, originY: g, left: it(c), top: it(u), width: it(f), height: it(p), fill: qp(n) ? n.toObject() : n, stroke: qp(r) ? r.toObject() : r, strokeWidth: it(b), strokeDashArray: h && h.concat(), strokeLineCap: _, strokeDashOffset: y, strokeLineJoin: x, strokeUniform: C, strokeMiterLimit: it(S), scaleX: it(k), scaleY: it(D), angle: it(A), flipX: M, flipY: O, opacity: it(R), shadow: o && o.toObject(), visible: L, backgroundColor: X, fillRule: U, paintFirst: G, globalCompositeOperation: rt, skewX: it(F), skewY: it(z) }, e ? { clipPath: e } : null);
2051
2051
  return this.includeDefaultValues ? Rt : this._removeDefaultValues(Rt);
2052
2052
  }
2053
2053
  toDatalessObject(t) {
@@ -2072,10 +2072,10 @@ let Mi = class uu extends n_ {
2072
2072
  return this._fromObject(t, e);
2073
2073
  }
2074
2074
  };
2075
- T(Mi, "stateProperties", Yy), T(Mi, "cacheProperties", yn), T(Mi, "ownDefaults", $y), T(Mi, "type", "FabricObject"), T(Mi, "colorProperties", [Vt, Le, "backgroundColor"]), T(Mi, "customProperties", []), j.setClass(Mi), j.setClass(Mi, "object");
2075
+ E(Mi, "stateProperties", Yy), E(Mi, "cacheProperties", yn), E(Mi, "ownDefaults", $y), E(Mi, "type", "FabricObject"), E(Mi, "colorProperties", [Vt, Le, "backgroundColor"]), E(Mi, "customProperties", []), j.setClass(Mi), j.setClass(Mi, "object");
2076
2076
  const bh = (a, t, e) => (s, i, n, r) => {
2077
2077
  const o = t(s, i, n, r);
2078
- return o && b0(a, A(A({}, y0(s, i, n, r)), e)), o;
2078
+ return o && b0(a, T(T({}, y0(s, i, n, r)), e)), o;
2079
2079
  };
2080
2080
  function vh(a) {
2081
2081
  return (t, e, s, i) => {
@@ -2106,7 +2106,7 @@ function h_(a, t, e, s, i) {
2106
2106
  }
2107
2107
  class Ms {
2108
2108
  constructor(t) {
2109
- T(this, "visible", !0), T(this, "actionName", Rd), T(this, "angle", 0), T(this, "x", 0), T(this, "y", 0), T(this, "offsetX", 0), T(this, "offsetY", 0), T(this, "sizeX", 0), T(this, "sizeY", 0), T(this, "touchSizeX", 0), T(this, "touchSizeY", 0), T(this, "cursorStyle", "crosshair"), T(this, "withConnection", !1), Object.assign(this, t);
2109
+ E(this, "visible", !0), E(this, "actionName", Rd), E(this, "angle", 0), E(this, "x", 0), E(this, "y", 0), E(this, "offsetX", 0), E(this, "offsetY", 0), E(this, "sizeX", 0), E(this, "sizeY", 0), E(this, "touchSizeX", 0), E(this, "touchSizeY", 0), E(this, "cursorStyle", "crosshair"), E(this, "withConnection", !1), Object.assign(this, t);
2110
2110
  }
2111
2111
  shouldActivate(t, e, s, i) {
2112
2112
  var n;
@@ -2136,11 +2136,11 @@ class Ms {
2136
2136
  this.visible = t;
2137
2137
  }
2138
2138
  positionHandler(t, e, s, i) {
2139
- return new D(this.x * t.x + this.offsetX, this.y * t.y + this.offsetY).transform(e);
2139
+ return new P(this.x * t.x + this.offsetX, this.y * t.y + this.offsetY).transform(e);
2140
2140
  }
2141
2141
  calcCornerCoords(t, e, s, i, n, r) {
2142
2142
  const o = Ld([ph(s, i), mh({ angle: t }), Fd((n ? this.touchSizeX : this.sizeX) || e, (n ? this.touchSizeY : this.sizeY) || e)]);
2143
- return { tl: new D(-0.5, -0.5).transform(o), tr: new D(0.5, -0.5).transform(o), br: new D(0.5, 0.5).transform(o), bl: new D(-0.5, 0.5).transform(o) };
2143
+ return { tl: new P(-0.5, -0.5).transform(o), tr: new P(0.5, -0.5).transform(o), br: new P(0.5, 0.5).transform(o), bl: new P(-0.5, 0.5).transform(o) };
2144
2144
  }
2145
2145
  render(t, e, s, i, n) {
2146
2146
  ((i = i || {}).cornerStyle || n.cornerStyle) === "circle" ? a_.call(this, t, e, s, i, n) : h_.call(this, t, e, s, i, n);
@@ -2202,17 +2202,17 @@ function M0(a, t, e, s, i) {
2202
2202
  const { target: n } = e, { counterAxis: r, origin: o, lockSkewing: h, skew: c, flip: u } = hg[a];
2203
2203
  if ($s(n, h)) return !1;
2204
2204
  const { origin: d, flip: g } = hg[r], f = Gt(e[d]) * (n[g] ? -1 : 1), p = -Math.sign(f) * (n[u] ? -1 : 1), b = 0.5 * -((n[c] === 0 && fp(e, K, K, s, i)[a] > 0 || n[c] > 0 ? 1 : -1) * p) + 0.5;
2205
- return bh(t0, vh((y, x, C, S) => function(k, M, E) {
2206
- let { target: P, ex: O, ey: L, skewingSide: R } = M, U = At(M, f_);
2207
- const { skew: z } = hg[k], V = E.subtract(new D(O, L)).divide(new D(P.scaleX, P.scaleY))[k], rt = P[z], F = U[z], G = Math.tan(Ot(F)), it = k === "y" ? P._getTransformedDimensions({ scaleX: 1, scaleY: 1, skewX: 0 }).x : P._getTransformedDimensions({ scaleX: 1, scaleY: 1 }).y, Rt = 2 * V * R / Math.max(it, 1) + G, Wt = rr(Math.atan(Rt));
2208
- P.set(z, Wt);
2209
- const ne = rt !== P[z];
2205
+ return bh(t0, vh((y, x, C, S) => function(k, D, A) {
2206
+ let { target: M, ex: O, ey: R, skewingSide: L } = D, X = At(D, f_);
2207
+ const { skew: U } = hg[k], G = A.subtract(new P(O, R)).divide(new P(M.scaleX, M.scaleY))[k], rt = M[U], F = X[U], z = Math.tan(Ot(F)), it = k === "y" ? M._getTransformedDimensions({ scaleX: 1, scaleY: 1, skewX: 0 }).x : M._getTransformedDimensions({ scaleX: 1, scaleY: 1 }).y, Rt = 2 * G * L / Math.max(it, 1) + z, Wt = rr(Math.atan(Rt));
2208
+ M.set(U, Wt);
2209
+ const ne = rt !== M[U];
2210
2210
  if (ne && k === "y") {
2211
- const { skewX: Bt, scaleX: yt } = P, Ce = P._getTransformedDimensions({ skewY: rt }), ti = P._getTransformedDimensions(), Pt = Bt !== 0 ? Ce.x / ti.x : 1;
2212
- Pt !== 1 && P.set(Be, Pt * yt);
2211
+ const { skewX: Bt, scaleX: yt } = M, Ce = M._getTransformedDimensions({ skewY: rt }), ti = M._getTransformedDimensions(), Pt = Bt !== 0 ? Ce.x / ti.x : 1;
2212
+ Pt !== 1 && M.set(Be, Pt * yt);
2213
2213
  }
2214
2214
  return ne;
2215
- }(a, x, new D(C, S))))(t, A(A({}, e), {}, { [o]: b, skewingSide: p }), s, i);
2215
+ }(a, x, new P(C, S))))(t, T(T({}, e), {}, { [o]: b, skewingSide: p }), s, i);
2216
2216
  }
2217
2217
  const b_ = (a, t, e, s) => M0("x", a, t, e, s), v_ = (a, t, e, s) => M0("y", a, t, e, s);
2218
2218
  function Bd(a, t) {
@@ -2221,10 +2221,10 @@ function Bd(a, t) {
2221
2221
  const jc = (a, t, e) => {
2222
2222
  const s = Bd(a, e);
2223
2223
  return t.x === 0 ? s ? gh : ds : t.y === 0 ? s ? fh : Be : "";
2224
- }, Ko = (a, t, e) => Bd(a, e) ? m_(0, t, e) : Ch(a, t, e), am = (a, t, e, s) => Bd(a, t.target) ? v_(a, t, e, s) : d_(a, t, e, s), hm = (a, t, e, s) => Bd(a, t.target) ? b_(a, t, e, s) : g_(a, t, e, s), P0 = () => ({ ml: new Ms({ x: -0.5, y: 0, cursorStyleHandler: Ko, actionHandler: am, getActionName: jc }), mr: new Ms({ x: 0.5, y: 0, cursorStyleHandler: Ko, actionHandler: am, getActionName: jc }), mb: new Ms({ x: 0, y: 0.5, cursorStyleHandler: Ko, actionHandler: hm, getActionName: jc }), mt: new Ms({ x: 0, y: -0.5, cursorStyleHandler: Ko, actionHandler: hm, getActionName: jc }), tl: new Ms({ x: -0.5, y: -0.5, cursorStyleHandler: Ch, actionHandler: Nc }), tr: new Ms({ x: 0.5, y: -0.5, cursorStyleHandler: Ch, actionHandler: Nc }), bl: new Ms({ x: -0.5, y: 0.5, cursorStyleHandler: Ch, actionHandler: Nc }), br: new Ms({ x: 0.5, y: 0.5, cursorStyleHandler: Ch, actionHandler: Nc }), mtr: new Ms({ x: 0, y: -0.5, actionHandler: c_, cursorStyleHandler: l_, offsetY: -40, withConnection: !0, actionName: rp }) }), y_ = () => ({ mr: new Ms({ x: 0.5, y: 0, actionHandler: om, cursorStyleHandler: Ko, actionName: Kh }), ml: new Ms({ x: -0.5, y: 0, actionHandler: om, cursorStyleHandler: Ko, actionName: Kh }) }), __ = () => A(A({}, P0()), y_());
2224
+ }, Ko = (a, t, e) => Bd(a, e) ? m_(0, t, e) : Ch(a, t, e), am = (a, t, e, s) => Bd(a, t.target) ? v_(a, t, e, s) : d_(a, t, e, s), hm = (a, t, e, s) => Bd(a, t.target) ? b_(a, t, e, s) : g_(a, t, e, s), P0 = () => ({ ml: new Ms({ x: -0.5, y: 0, cursorStyleHandler: Ko, actionHandler: am, getActionName: jc }), mr: new Ms({ x: 0.5, y: 0, cursorStyleHandler: Ko, actionHandler: am, getActionName: jc }), mb: new Ms({ x: 0, y: 0.5, cursorStyleHandler: Ko, actionHandler: hm, getActionName: jc }), mt: new Ms({ x: 0, y: -0.5, cursorStyleHandler: Ko, actionHandler: hm, getActionName: jc }), tl: new Ms({ x: -0.5, y: -0.5, cursorStyleHandler: Ch, actionHandler: Nc }), tr: new Ms({ x: 0.5, y: -0.5, cursorStyleHandler: Ch, actionHandler: Nc }), bl: new Ms({ x: -0.5, y: 0.5, cursorStyleHandler: Ch, actionHandler: Nc }), br: new Ms({ x: 0.5, y: 0.5, cursorStyleHandler: Ch, actionHandler: Nc }), mtr: new Ms({ x: 0, y: -0.5, actionHandler: c_, cursorStyleHandler: l_, offsetY: -40, withConnection: !0, actionName: rp }) }), y_ = () => ({ mr: new Ms({ x: 0.5, y: 0, actionHandler: om, cursorStyleHandler: Ko, actionName: Kh }), ml: new Ms({ x: -0.5, y: 0, actionHandler: om, cursorStyleHandler: Ko, actionName: Kh }) }), __ = () => T(T({}, P0()), y_());
2225
2225
  class Zh extends Mi {
2226
2226
  static getDefaults() {
2227
- return A(A({}, super.getDefaults()), Zh.ownDefaults);
2227
+ return T(T({}, super.getDefaults()), Zh.ownDefaults);
2228
2228
  }
2229
2229
  constructor(t) {
2230
2230
  super(), Object.assign(this, this.constructor.createControls(), Zh.ownDefaults), this.setOptions(t);
@@ -2284,18 +2284,18 @@ class Zh extends Mi {
2284
2284
  }
2285
2285
  _drawBorders(t, e) {
2286
2286
  let s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
2287
- const i = A({ hasControls: this.hasControls, borderColor: this.borderColor, borderDashArray: this.borderDashArray }, s);
2287
+ const i = T({ hasControls: this.hasControls, borderColor: this.borderColor, borderDashArray: this.borderDashArray }, s);
2288
2288
  t.save(), t.strokeStyle = i.borderColor, this._setLineDash(t, i.borderDashArray), this.strokeBorders(t, e), i.hasControls && this.drawControlsConnectingLines(t, e), t.restore();
2289
2289
  }
2290
2290
  _renderControls(t) {
2291
2291
  let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
2292
- const { hasBorders: s, hasControls: i } = this, n = A({ hasBorders: s, hasControls: i }, e), r = this.getViewportTransform(), o = n.hasBorders, h = n.hasControls, c = Nt(r, this.calcTransformMatrix()), u = Do(c);
2292
+ const { hasBorders: s, hasControls: i } = this, n = T({ hasBorders: s, hasControls: i }, e), r = this.getViewportTransform(), o = n.hasBorders, h = n.hasControls, c = Nt(r, this.calcTransformMatrix()), u = Do(c);
2293
2293
  t.save(), t.translate(u.translateX, u.translateY), t.lineWidth = this.borderScaleFactor, this.group === this.parent && (t.globalAlpha = this.isMoving ? this.borderOpacityWhenMoving : 1), this.flipX && (u.angle -= 180), t.rotate(Ot(this.group ? u.angle : this.angle)), o && this.drawBorders(t, u, e), h && this.drawControls(t, e), t.restore();
2294
2294
  }
2295
2295
  drawBorders(t, e, s) {
2296
2296
  let i;
2297
2297
  if (s && s.forActiveSelection || this.group) {
2298
- const n = Id(this.width, this.height, Mc(e)), r = this.isStrokeAccountedForInDimensions() ? op : (this.strokeUniform ? new D().scalarAdd(this.canvas ? this.canvas.getZoom() : 1) : new D(e.scaleX, e.scaleY)).scalarMultiply(this.strokeWidth);
2298
+ const n = Id(this.width, this.height, Mc(e)), r = this.isStrokeAccountedForInDimensions() ? op : (this.strokeUniform ? new P().scalarAdd(this.canvas ? this.canvas.getZoom() : 1) : new P(e.scaleX, e.scaleY)).scalarMultiply(this.strokeWidth);
2299
2299
  i = n.add(r).scalarAdd(this.borderScaleFactor).scalarAdd(2 * this.padding);
2300
2300
  } else i = this._calculateCurrentDimensions().scalarAdd(this.borderScaleFactor);
2301
2301
  this._drawBorders(t, i, s);
@@ -2309,7 +2309,7 @@ class Zh extends Mi {
2309
2309
  drawControls(t) {
2310
2310
  let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
2311
2311
  t.save();
2312
- const s = this.getCanvasRetinaScaling(), { cornerStrokeColor: i, cornerDashArray: n, cornerColor: r } = this, o = A({ cornerStrokeColor: i, cornerDashArray: n, cornerColor: r }, e);
2312
+ const s = this.getCanvasRetinaScaling(), { cornerStrokeColor: i, cornerDashArray: n, cornerColor: r } = this, o = T({ cornerStrokeColor: i, cornerDashArray: n, cornerColor: r }, e);
2313
2313
  t.setTransform(s, 0, 0, s, 0, 0), t.strokeStyle = t.fillStyle = o.cornerColor, this.transparentCorners || (t.strokeStyle = o.cornerStrokeColor), this._setLineDash(t, o.cornerDashArray), this.forEachControl((h, c) => {
2314
2314
  if (h.getVisibility(this, c)) {
2315
2315
  const u = this.oCoords[c];
@@ -2366,7 +2366,7 @@ function D0(a, t) {
2366
2366
  });
2367
2367
  }), a;
2368
2368
  }
2369
- T(Zh, "ownDefaults", { noScaleCache: !0, lockMovementX: !1, lockMovementY: !1, lockRotation: !1, lockScalingX: !1, lockScalingY: !1, lockSkewingX: !1, lockSkewingY: !1, lockScalingFlip: !1, cornerSize: 13, touchCornerSize: 24, transparentCorners: !0, cornerColor: "rgb(178,204,255)", cornerStrokeColor: "", cornerStyle: "rect", cornerDashArray: null, hasControls: !0, borderColor: "rgb(178,204,255)", borderDashArray: null, borderOpacityWhenMoving: 0.4, borderScaleFactor: 1, hasBorders: !0, selectionBackgroundColor: "", selectable: !0, evented: !0, perPixelTargetFind: !1, activeOn: "down", hoverCursor: null, moveCursor: null });
2369
+ E(Zh, "ownDefaults", { noScaleCache: !0, lockMovementX: !1, lockMovementY: !1, lockRotation: !1, lockScalingX: !1, lockScalingY: !1, lockSkewingX: !1, lockSkewingY: !1, lockScalingFlip: !1, cornerSize: 13, touchCornerSize: 24, transparentCorners: !0, cornerColor: "rgb(178,204,255)", cornerStrokeColor: "", cornerStyle: "rect", cornerDashArray: null, hasControls: !0, borderColor: "rgb(178,204,255)", borderDashArray: null, borderOpacityWhenMoving: 0.4, borderScaleFactor: 1, hasBorders: !0, selectionBackgroundColor: "", selectable: !0, evented: !0, perPixelTargetFind: !1, activeOn: "down", hoverCursor: null, moveCursor: null });
2370
2370
  class Se extends Zh {
2371
2371
  }
2372
2372
  D0(Se, [w0]), j.setClass(Se), j.setClass(Se, "object");
@@ -2378,7 +2378,7 @@ const O0 = (a, t, e, s) => {
2378
2378
  };
2379
2379
  class R0 {
2380
2380
  constructor(t) {
2381
- this.options = t, this.strokeProjectionMagnitude = this.options.strokeWidth / 2, this.scale = new D(this.options.scaleX, this.options.scaleY), this.strokeUniformScalar = this.options.strokeUniform ? new D(1 / this.options.scaleX, 1 / this.options.scaleY) : new D(1, 1);
2381
+ this.options = t, this.strokeProjectionMagnitude = this.options.strokeWidth / 2, this.scale = new P(this.options.scaleX, this.options.scaleY), this.strokeUniformScalar = this.options.strokeUniform ? new P(1 / this.options.scaleX, 1 / this.options.scaleY) : new P(1, 1);
2382
2382
  }
2383
2383
  createSideVector(t, e) {
2384
2384
  const s = $u(t, e);
@@ -2391,21 +2391,21 @@ class R0 {
2391
2391
  return this.options.skewX !== 0 || this.options.skewY !== 0;
2392
2392
  }
2393
2393
  applySkew(t) {
2394
- const e = new D(t);
2394
+ const e = new P(t);
2395
2395
  return e.y += e.x * Math.tan(Ot(this.options.skewY)), e.x += e.y * Math.tan(Ot(this.options.skewX)), e;
2396
2396
  }
2397
2397
  scaleUnitVector(t, e) {
2398
2398
  return t.multiply(this.strokeUniformScalar).scalarMultiply(e);
2399
2399
  }
2400
2400
  }
2401
- const w_ = new D();
2401
+ const w_ = new P();
2402
2402
  class sa extends R0 {
2403
2403
  static getOrthogonalRotationFactor(t, e) {
2404
2404
  const s = e ? Ku(t, e) : S0(t);
2405
2405
  return Math.abs(s) < ir ? -1 : 1;
2406
2406
  }
2407
2407
  constructor(t, e, s, i) {
2408
- super(i), T(this, "AB", void 0), T(this, "AC", void 0), T(this, "alpha", void 0), T(this, "bisector", void 0), this.A = new D(t), this.B = new D(e), this.C = new D(s), this.AB = this.createSideVector(this.A, this.B), this.AC = this.createSideVector(this.A, this.C), this.alpha = Ku(this.AB, this.AC), this.bisector = jd(pp(this.AB.eq(w_) ? this.AC : this.AB, this.alpha / 2));
2408
+ super(i), E(this, "AB", void 0), E(this, "AC", void 0), E(this, "alpha", void 0), E(this, "bisector", void 0), this.A = new P(t), this.B = new P(e), this.C = new P(s), this.AB = this.createSideVector(this.A, this.B), this.AC = this.createSideVector(this.A, this.C), this.alpha = Ku(this.AB, this.AC), this.bisector = jd(pp(this.AB.eq(w_) ? this.AC : this.AB, this.alpha / 2));
2409
2409
  }
2410
2410
  calcOrthogonalProjection(t, e) {
2411
2411
  let s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : this.strokeProjectionMagnitude;
@@ -2423,13 +2423,13 @@ class sa extends R0 {
2423
2423
  return qu(i) / this.strokeProjectionMagnitude <= n && t.push(this.applySkew(this.A.add(i))), t.push(...this.projectBevel()), t;
2424
2424
  }
2425
2425
  projectRoundNoSkew(t, e) {
2426
- const s = [], i = new D(sa.getOrthogonalRotationFactor(this.bisector), sa.getOrthogonalRotationFactor(new D(this.bisector.y, this.bisector.x)));
2427
- return [new D(1, 0).scalarMultiply(this.strokeProjectionMagnitude).multiply(this.strokeUniformScalar).multiply(i), new D(0, 1).scalarMultiply(this.strokeProjectionMagnitude).multiply(this.strokeUniformScalar).multiply(i)].forEach((n) => {
2426
+ const s = [], i = new P(sa.getOrthogonalRotationFactor(this.bisector), sa.getOrthogonalRotationFactor(new P(this.bisector.y, this.bisector.x)));
2427
+ return [new P(1, 0).scalarMultiply(this.strokeProjectionMagnitude).multiply(this.strokeUniformScalar).multiply(i), new P(0, 1).scalarMultiply(this.strokeProjectionMagnitude).multiply(this.strokeUniformScalar).multiply(i)].forEach((n) => {
2428
2428
  Dg(n, t, e) && s.push(this.A.add(n));
2429
2429
  }), s;
2430
2430
  }
2431
2431
  projectRoundWithSkew(t, e) {
2432
- const s = [], { skewX: i, skewY: n, scaleX: r, scaleY: o, strokeUniform: h } = this.options, c = new D(Math.tan(Ot(i)), Math.tan(Ot(n))), u = this.strokeProjectionMagnitude, d = h ? u / o / Math.sqrt(1 / o ** 2 + 1 / r ** 2 * c.y ** 2) : u / Math.sqrt(1 + c.y ** 2), g = new D(Math.sqrt(Math.max(u ** 2 - d ** 2, 0)), d), f = h ? u / Math.sqrt(1 + c.x ** 2 * (1 / o) ** 2 / (1 / r + 1 / r * c.x * c.y) ** 2) : u / Math.sqrt(1 + c.x ** 2 / (1 + c.x * c.y) ** 2), p = new D(f, Math.sqrt(Math.max(u ** 2 - f ** 2, 0)));
2432
+ const s = [], { skewX: i, skewY: n, scaleX: r, scaleY: o, strokeUniform: h } = this.options, c = new P(Math.tan(Ot(i)), Math.tan(Ot(n))), u = this.strokeProjectionMagnitude, d = h ? u / o / Math.sqrt(1 / o ** 2 + 1 / r ** 2 * c.y ** 2) : u / Math.sqrt(1 + c.y ** 2), g = new P(Math.sqrt(Math.max(u ** 2 - d ** 2, 0)), d), f = h ? u / Math.sqrt(1 + c.x ** 2 * (1 / o) ** 2 / (1 / r + 1 / r * c.x * c.y) ** 2) : u / Math.sqrt(1 + c.x ** 2 / (1 + c.x * c.y) ** 2), p = new P(f, Math.sqrt(Math.max(u ** 2 - f ** 2, 0)));
2433
2433
  return [p, p.scalarMultiply(-1), g, g.scalarMultiply(-1)].map((b) => this.applySkew(h ? b.multiply(this.strokeUniformScalar) : b)).forEach((b) => {
2434
2434
  Dg(b, t, e) && s.push(this.applySkew(this.A).add(b));
2435
2435
  }), s;
@@ -2456,7 +2456,7 @@ class sa extends R0 {
2456
2456
  }
2457
2457
  class lm extends R0 {
2458
2458
  constructor(t, e, s) {
2459
- super(s), this.A = new D(t), this.T = new D(e);
2459
+ super(s), this.A = new P(t), this.T = new P(e);
2460
2460
  }
2461
2461
  calcOrthogonalProjection(t, e) {
2462
2462
  let s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : this.strokeProjectionMagnitude;
@@ -2469,7 +2469,7 @@ class lm extends R0 {
2469
2469
  projectRound() {
2470
2470
  const t = [];
2471
2471
  if (!this.isSkewed() && this.A.eq(this.T)) {
2472
- const e = new D(1, 1).scalarMultiply(this.strokeProjectionMagnitude).multiply(this.strokeUniformScalar);
2472
+ const e = new P(1, 1).scalarMultiply(this.strokeProjectionMagnitude).multiply(this.strokeUniformScalar);
2473
2473
  t.push(this.applySkew(this.A.add(e)), this.applySkew(this.A.subtract(e)));
2474
2474
  } else t.push(...new sa(this.A, this.T, this.T, this.options).projectRound());
2475
2475
  return t;
@@ -2477,7 +2477,7 @@ class lm extends R0 {
2477
2477
  projectSquare() {
2478
2478
  const t = [];
2479
2479
  if (this.A.eq(this.T)) {
2480
- const e = new D(1, 1).scalarMultiply(this.strokeProjectionMagnitude).multiply(this.strokeUniformScalar);
2480
+ const e = new P(1, 1).scalarMultiply(this.strokeProjectionMagnitude).multiply(this.strokeUniformScalar);
2481
2481
  t.push(this.A.add(e), this.A.subtract(e));
2482
2482
  } else {
2483
2483
  const e = this.calcOrthogonalProjection(this.A, this.T, this.strokeProjectionMagnitude), s = this.scaleUnitVector(jd(this.createSideVector(this.A, this.T)), -this.strokeProjectionMagnitude), i = this.A.add(s);
@@ -2503,7 +2503,7 @@ const L0 = function(a, t) {
2503
2503
  let e = arguments.length > 2 && arguments[2] !== void 0 && arguments[2];
2504
2504
  const s = [];
2505
2505
  if (a.length === 0) return s;
2506
- const i = a.reduce((n, r) => (n[n.length - 1].eq(r) || n.push(new D(r)), n), [new D(a[0])]);
2506
+ const i = a.reduce((n, r) => (n[n.length - 1].eq(r) || n.push(new P(r)), n), [new P(a[0])]);
2507
2507
  if (i.length === 1) e = !0;
2508
2508
  else if (!e) {
2509
2509
  const n = i[0], r = ((o, h) => {
@@ -2520,7 +2520,7 @@ const L0 = function(a, t) {
2520
2520
  const t = {};
2521
2521
  return Object.keys(a).forEach((e) => {
2522
2522
  t[e] = {}, Object.keys(a[e]).forEach((s) => {
2523
- t[e][s] = A({}, a[e][s]);
2523
+ t[e][s] = T({}, a[e][s]);
2524
2524
  });
2525
2525
  }), t;
2526
2526
  }, F0 = (a) => a.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/'/g, "&apos;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), Hd = (a) => {
@@ -2570,7 +2570,7 @@ const Gd = function(a, t) {
2570
2570
  let i = -1, n = 0;
2571
2571
  for (let r = 0; r < e.length; r++) {
2572
2572
  const o = Hd(e[r]);
2573
- for (let h = 0; h < o.length; h++) i++, a[n] && a[n].start <= i && i < a[n].end && (s[r] = s[r] || {}, s[r][h] = A({}, a[n].style), i === a[n].end - 1 && n++);
2573
+ for (let h = 0; h < o.length; h++) i++, a[n] && a[n].start <= i && i < a[n].end && (s[r] = s[r] || {}, s[r][h] = T({}, a[n].style), i === a[n].end - 1 && n++);
2574
2574
  }
2575
2575
  return s;
2576
2576
  }, cr = ["display", "transform", Vt, "fill-opacity", "fill-rule", "opacity", Le, "stroke-dasharray", "stroke-linecap", "stroke-dashoffset", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke-width", "id", "paint-order", "vector-effect", "instantiated_by_use", "clip-path"];
@@ -2678,12 +2678,12 @@ function _n(a, t, e) {
2678
2678
  if (!a) return {};
2679
2679
  let s, i = {}, n = ip;
2680
2680
  a.parentNode && tm.test(a.parentNode.nodeName) && (i = _n(a.parentElement, t, e), i.fontSize && (s = n = De(i.fontSize)));
2681
- const r = A(A(A({}, t.reduce((c, u) => {
2681
+ const r = T(T(T({}, t.reduce((c, u) => {
2682
2682
  const d = a.getAttribute(u);
2683
2683
  return d && (c[u] = d), c;
2684
2684
  }, {})), function(c) {
2685
2685
  let u = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, d = {};
2686
- for (const g in u) C_(c, g.split(" ")) && (d = A(A({}, d), u[g]));
2686
+ for (const g in u) C_(c, g.split(" ")) && (d = T(T({}, d), u[g]));
2687
2687
  return d;
2688
2688
  }(a, e)), G_(a));
2689
2689
  r[rg] && a.setAttribute(rg, r[rg]), r[ng] && (s = De(r[ng], n), r[ng] = "".concat(s));
@@ -2693,7 +2693,7 @@ function _n(a, t, e) {
2693
2693
  o[u] = d;
2694
2694
  }
2695
2695
  o && o.font && H_(o.font, o);
2696
- const h = A(A({}, i), o);
2696
+ const h = T(T({}, i), o);
2697
2697
  return tm.test(a.nodeName) ? h : function(c) {
2698
2698
  const u = Se.getDefaults();
2699
2699
  return Object.entries(z_).forEach((d) => {
@@ -2712,7 +2712,7 @@ function _n(a, t, e) {
2712
2712
  const V_ = ["left", "top", "width", "height", "visible"], j0 = ["rx", "ry"];
2713
2713
  class xi extends Se {
2714
2714
  static getDefaults() {
2715
- return A(A({}, super.getDefaults()), xi.ownDefaults);
2715
+ return T(T({}, super.getDefaults()), xi.ownDefaults);
2716
2716
  }
2717
2717
  constructor(t) {
2718
2718
  super(), Object.assign(this, xi.ownDefaults), this.setOptions(t), this._initRxRy();
@@ -2736,12 +2736,12 @@ class xi extends Se {
2736
2736
  }
2737
2737
  static async fromElement(t, e, s) {
2738
2738
  const i = _n(t, this.ATTRIBUTE_NAMES, s), { left: n = 0, top: r = 0, width: o = 0, height: h = 0, visible: c = !0 } = i, u = At(i, V_);
2739
- return new this(A(A(A({}, e), u), {}, { left: n, top: r, width: o, height: h, visible: !!(c && o && h) }));
2739
+ return new this(T(T(T({}, e), u), {}, { left: n, top: r, width: o, height: h, visible: !!(c && o && h) }));
2740
2740
  }
2741
2741
  }
2742
- T(xi, "type", "Rect"), T(xi, "cacheProperties", [...yn, ...j0]), T(xi, "ownDefaults", { rx: 0, ry: 0 }), T(xi, "ATTRIBUTE_NAMES", [...cr, "x", "y", "rx", "ry", "width", "height"]), j.setClass(xi), j.setSVGClass(xi);
2742
+ E(xi, "type", "Rect"), E(xi, "cacheProperties", [...yn, ...j0]), E(xi, "ownDefaults", { rx: 0, ry: 0 }), E(xi, "ATTRIBUTE_NAMES", [...cr, "x", "y", "rx", "ry", "width", "height"]), j.setClass(xi), j.setSVGClass(xi);
2743
2743
  const cn = "initialization", Ju = "added", xp = "removed", Zu = "imperative", B0 = (a, t) => {
2744
- const { strokeUniform: e, strokeWidth: s, width: i, height: n, group: r } = t, o = r && r !== a ? Oc(r.calcTransformMatrix(), a.calcTransformMatrix()) : null, h = o ? t.getRelativeCenterPoint().transform(o) : t.getRelativeCenterPoint(), c = !t.isStrokeAccountedForInDimensions(), u = e && c ? m0(new D(s, s), void 0, a.calcTransformMatrix()) : op, d = !e && c ? s : 0, g = Id(i + d, n + d, Ld([o, t.calcOwnMatrix()], !0)).add(u).scalarDivide(2);
2744
+ const { strokeUniform: e, strokeWidth: s, width: i, height: n, group: r } = t, o = r && r !== a ? Oc(r.calcTransformMatrix(), a.calcTransformMatrix()) : null, h = o ? t.getRelativeCenterPoint().transform(o) : t.getRelativeCenterPoint(), c = !t.isStrokeAccountedForInDimensions(), u = e && c ? m0(new P(s, s), void 0, a.calcTransformMatrix()) : op, d = !e && c ? s : 0, g = Id(i + d, n + d, Ld([o, t.calcOwnMatrix()], !0)).add(u).scalarDivide(2);
2745
2745
  return [h.subtract(g), h.add(g)];
2746
2746
  };
2747
2747
  class zd {
@@ -2763,29 +2763,29 @@ class zd {
2763
2763
  const { type: s, target: i } = e;
2764
2764
  if (s === Zu && e.overrides) return e.overrides;
2765
2765
  if (t.length === 0) return;
2766
- const { left: n, top: r, width: o, height: h } = Ai(t.map((d) => B0(i, d)).reduce((d, g) => d.concat(g), [])), c = new D(o, h), u = new D(n, r).add(c.scalarDivide(2));
2766
+ const { left: n, top: r, width: o, height: h } = Ai(t.map((d) => B0(i, d)).reduce((d, g) => d.concat(g), [])), c = new P(o, h), u = new P(n, r).add(c.scalarDivide(2));
2767
2767
  if (s === cn) {
2768
2768
  const d = this.getInitialSize(e, { size: c, center: u });
2769
- return { center: u, relativeCorrection: new D(0, 0), size: d };
2769
+ return { center: u, relativeCorrection: new P(0, 0), size: d };
2770
2770
  }
2771
2771
  return { center: u.transform(i.calcOwnMatrix()), size: c };
2772
2772
  }
2773
2773
  }
2774
- T(zd, "type", "strategy");
2774
+ E(zd, "type", "strategy");
2775
2775
  class Lg extends zd {
2776
2776
  shouldPerformLayout(t) {
2777
2777
  return !0;
2778
2778
  }
2779
2779
  }
2780
- T(Lg, "type", "fit-content"), j.setClass(Lg);
2780
+ E(Lg, "type", "fit-content"), j.setClass(Lg);
2781
2781
  const X_ = ["strategy"], W_ = ["target", "strategy", "bubbles", "prevStrategy"], H0 = "layoutManager";
2782
2782
  class tl {
2783
2783
  constructor() {
2784
2784
  let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : new Lg();
2785
- T(this, "strategy", void 0), this.strategy = t, this._subscriptions = /* @__PURE__ */ new Map();
2785
+ E(this, "strategy", void 0), this.strategy = t, this._subscriptions = /* @__PURE__ */ new Map();
2786
2786
  }
2787
2787
  performLayout(t) {
2788
- const e = A(A({ bubbles: !0, strategy: this.strategy }, t), {}, { prevStrategy: this._prevLayoutStrategy, stopPropagation() {
2788
+ const e = T(T({ bubbles: !0, strategy: this.strategy }, t), {}, { prevStrategy: this._prevLayoutStrategy, stopPropagation() {
2789
2789
  this.bubbles = !1;
2790
2790
  } });
2791
2791
  this.onBeforeLayout(e);
@@ -2814,13 +2814,13 @@ class tl {
2814
2814
  const { target: e, type: s } = t, { canvas: i } = e;
2815
2815
  if (s === cn || s === Ju ? this.subscribeTargets(t) : s === xp && this.unsubscribeTargets(t), e.fire("layout:before", { context: t }), i && i.fire("object:layout:before", { target: e, context: t }), s === Zu && t.deep) {
2816
2816
  const n = At(t, X_);
2817
- e.forEachObject((r) => r.layoutManager && r.layoutManager.performLayout(A(A({}, n), {}, { bubbles: !1, target: r })));
2817
+ e.forEachObject((r) => r.layoutManager && r.layoutManager.performLayout(T(T({}, n), {}, { bubbles: !1, target: r })));
2818
2818
  }
2819
2819
  }
2820
2820
  getLayoutResult(t) {
2821
2821
  const { target: e, strategy: s, type: i } = t, n = s.calcLayoutResult(t, e.getObjects());
2822
2822
  if (!n) return;
2823
- const r = i === cn ? new D() : e.getRelativeCenterPoint(), { center: o, correction: h = new D(), relativeCorrection: c = new D() } = n, u = r.subtract(o).add(h).transform(i === cn ? je : Ye(e.calcOwnMatrix()), !0).add(c);
2823
+ const r = i === cn ? new P() : e.getRelativeCenterPoint(), { center: o, correction: h = new P(), relativeCorrection: c = new P() } = n, u = r.subtract(o).add(h).transform(i === cn ? je : Ye(e.calcOwnMatrix()), !0).add(c);
2824
2824
  return { result: n, prevCenter: r, nextCenter: o, offset: u };
2825
2825
  }
2826
2826
  commitLayout(t, e) {
@@ -2842,7 +2842,7 @@ class tl {
2842
2842
  const { target: s, strategy: i, bubbles: n, prevStrategy: r } = t, o = At(t, W_), { canvas: h } = s;
2843
2843
  s.fire("layout:after", { context: t, result: e }), h && h.fire("object:layout:after", { context: t, result: e, target: s });
2844
2844
  const c = s.parent;
2845
- n && c != null && c.layoutManager && ((o.path || (o.path = [])).push(s), c.layoutManager.performLayout(A(A({}, o), {}, { target: c }))), s.set("dirty", !0);
2845
+ n && c != null && c.layoutManager && ((o.path || (o.path = [])).push(s), c.layoutManager.performLayout(T(T({}, o), {}, { target: c }))), s.set("dirty", !0);
2846
2846
  }
2847
2847
  dispose() {
2848
2848
  const { _subscriptions: t } = this;
@@ -2863,11 +2863,11 @@ class Y_ extends tl {
2863
2863
  }
2864
2864
  class Ti extends e0(Se) {
2865
2865
  static getDefaults() {
2866
- return A(A({}, super.getDefaults()), Ti.ownDefaults);
2866
+ return T(T({}, super.getDefaults()), Ti.ownDefaults);
2867
2867
  }
2868
2868
  constructor() {
2869
2869
  let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
2870
- super(), T(this, "_activeObjects", []), T(this, "__objectSelectionTracker", void 0), T(this, "__objectSelectionDisposer", void 0), Object.assign(this, Ti.ownDefaults), this.setOptions(e), this.groupInit(t, e);
2870
+ super(), E(this, "_activeObjects", []), E(this, "__objectSelectionTracker", void 0), E(this, "__objectSelectionDisposer", void 0), Object.assign(this, Ti.ownDefaults), this.setOptions(e), this.groupInit(t, e);
2871
2871
  }
2872
2872
  groupInit(t, e) {
2873
2873
  var s;
@@ -2976,7 +2976,7 @@ class Ti extends e0(Se) {
2976
2976
  }
2977
2977
  triggerLayout() {
2978
2978
  let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2979
- this.layoutManager.performLayout(A({ target: this, type: Zu }, t));
2979
+ this.layoutManager.performLayout(T({ target: this, type: Zu }, t));
2980
2980
  }
2981
2981
  render(t) {
2982
2982
  this._transformDone = !0, super.render(t), this._transformDone = !1;
@@ -2995,7 +2995,7 @@ class Ti extends e0(Se) {
2995
2995
  toObject() {
2996
2996
  let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
2997
2997
  const e = this.layoutManager.toObject();
2998
- return A(A(A({}, super.toObject(["subTargetCheck", "interactive", ...t])), e.strategy !== "fit-content" || this.includeDefaultValues ? { layoutManager: e } : {}), {}, { objects: this.__serializeObjects("toObject", t) });
2998
+ return T(T(T({}, super.toObject(["subTargetCheck", "interactive", ...t])), e.strategy !== "fit-content" || this.includeDefaultValues ? { layoutManager: e } : {}), {}, { objects: this.__serializeObjects("toObject", t) });
2999
2999
  }
3000
3000
  toString() {
3001
3001
  return "#<Group: (".concat(this.complexity(), ")>");
@@ -3034,7 +3034,7 @@ class Ti extends e0(Se) {
3034
3034
  let { type: s, objects: i = [], layoutManager: n } = t, r = At(t, U_);
3035
3035
  return Promise.all([ch(i, e), Pc(r, e)]).then((o) => {
3036
3036
  let [h, c] = o;
3037
- const u = new this(h, A(A(A({}, r), c), {}, { layoutManager: new Y_() }));
3037
+ const u = new this(h, T(T(T({}, r), c), {}, { layoutManager: new Y_() }));
3038
3038
  if (n) {
3039
3039
  const d = j.getClass(n.type), g = j.getClass(n.strategy);
3040
3040
  u.layoutManager = new d(new g());
@@ -3043,7 +3043,7 @@ class Ti extends e0(Se) {
3043
3043
  });
3044
3044
  }
3045
3045
  }
3046
- T(Ti, "type", "Group"), T(Ti, "ownDefaults", { strokeWidth: 0, subTargetCheck: !1, interactive: !1 }), j.setClass(Ti);
3046
+ E(Ti, "type", "Group"), E(Ti, "ownDefaults", { strokeWidth: 0, subTargetCheck: !1, interactive: !1 }), j.setClass(Ti);
3047
3047
  const G0 = (a, t) => Math.min(t.width / a.width, t.height / a.height), z0 = (a, t) => Math.max(t.width / a.width, t.height / a.height), Fg = "\\s*,?\\s*", yh = "".concat(Fg, "(").concat(Us, ")"), $_ = "".concat(yh).concat(yh).concat(yh).concat(Fg, "([01])").concat(Fg, "([01])").concat(yh).concat(yh), q_ = { m: "l", M: "L" }, K_ = (a, t, e, s, i, n, r, o, h, c, u) => {
3048
3048
  const d = qs(a), g = Ks(a), f = qs(t), p = Ks(t), b = e * i * f - s * n * p + r, _ = s * i * f + e * n * p + o;
3049
3049
  return ["C", c + h * (-e * i * g - s * n * d), u + h * (-s * i * g + e * n * d), b + h * (e * i * p + s * n * f), _ + h * (s * i * p - e * n * f), b, _];
@@ -3065,10 +3065,10 @@ function Ig(a, t, e, s, i, n, r, o) {
3065
3065
  }
3066
3066
  const k = f * f - 4 * b * p;
3067
3067
  if (k < 0) continue;
3068
- const M = c(k), E = (-f + M) / (2 * p);
3069
- 0 < E && E < 1 && d.push(E);
3070
- const P = (-f - M) / (2 * p);
3071
- 0 < P && P < 1 && d.push(P);
3068
+ const D = c(k), A = (-f + D) / (2 * p);
3069
+ 0 < A && A < 1 && d.push(A);
3070
+ const M = (-f - D) / (2 * p);
3071
+ 0 < M && M < 1 && d.push(M);
3072
3072
  }
3073
3073
  let _ = d.length;
3074
3074
  const y = _, x = X0(a, t, e, s, i, n, r, o);
@@ -3077,7 +3077,7 @@ function Ig(a, t, e, s, i, n, r, o) {
3077
3077
  g[0][_] = S, g[1][_] = k;
3078
3078
  }
3079
3079
  g[0][y] = a, g[1][y] = t, g[0][y + 1] = r, g[1][y + 1] = o;
3080
- const C = [new D(Math.min(...g[0]), Math.min(...g[1])), new D(Math.max(...g[0]), Math.max(...g[1]))];
3080
+ const C = [new P(Math.min(...g[0]), Math.min(...g[1])), new P(Math.max(...g[0]), Math.max(...g[1]))];
3081
3081
  return ot.cachesBoundsOfCurve && (Vh.boundsOfCurveCache[h] = C), C;
3082
3082
  }
3083
3083
  const Q_ = (a, t, e) => {
@@ -3085,18 +3085,18 @@ const Q_ = (a, t, e) => {
3085
3085
  const d = ((g, f, p, b, _, y, x) => {
3086
3086
  if (p === 0 || b === 0) return [];
3087
3087
  let C = 0, S = 0, k = 0;
3088
- const M = Math.PI, E = x * sp, P = Ks(E), O = qs(E), L = 0.5 * (-O * g - P * f), R = 0.5 * (-O * f + P * g), U = p ** 2, z = b ** 2, V = R ** 2, rt = L ** 2, F = U * z - U * V - z * rt;
3089
- let G = Math.abs(p), it = Math.abs(b);
3088
+ const D = Math.PI, A = x * sp, M = Ks(A), O = qs(A), R = 0.5 * (-O * g - M * f), L = 0.5 * (-O * f + M * g), X = p ** 2, U = b ** 2, G = L ** 2, rt = R ** 2, F = X * U - X * G - U * rt;
3089
+ let z = Math.abs(p), it = Math.abs(b);
3090
3090
  if (F < 0) {
3091
- const ei = Math.sqrt(1 - F / (U * z));
3092
- G *= ei, it *= ei;
3093
- } else k = (_ === y ? -1 : 1) * Math.sqrt(F / (U * V + z * rt));
3094
- const Rt = k * G * R / it, Wt = -k * it * L / G, ne = O * Rt - P * Wt + 0.5 * g, Bt = P * Rt + O * Wt + 0.5 * f;
3095
- let yt = vm(1, 0, (L - Rt) / G, (R - Wt) / it), Ce = vm((L - Rt) / G, (R - Wt) / it, (-L - Rt) / G, (-R - Wt) / it);
3096
- y === 0 && Ce > 0 ? Ce -= 2 * M : y === 1 && Ce < 0 && (Ce += 2 * M);
3097
- const ti = Math.ceil(Math.abs(Ce / M * 2)), Pt = [], ct = Ce / ti, wn = 8 / 3 * Math.sin(ct / 4) * Math.sin(ct / 4) / Math.sin(ct / 2);
3091
+ const ei = Math.sqrt(1 - F / (X * U));
3092
+ z *= ei, it *= ei;
3093
+ } else k = (_ === y ? -1 : 1) * Math.sqrt(F / (X * G + U * rt));
3094
+ const Rt = k * z * L / it, Wt = -k * it * R / z, ne = O * Rt - M * Wt + 0.5 * g, Bt = M * Rt + O * Wt + 0.5 * f;
3095
+ let yt = vm(1, 0, (R - Rt) / z, (L - Wt) / it), Ce = vm((R - Rt) / z, (L - Wt) / it, (-R - Rt) / z, (-L - Wt) / it);
3096
+ y === 0 && Ce > 0 ? Ce -= 2 * D : y === 1 && Ce < 0 && (Ce += 2 * D);
3097
+ const ti = Math.ceil(Math.abs(Ce / D * 2)), Pt = [], ct = Ce / ti, wn = 8 / 3 * Math.sin(ct / 4) * Math.sin(ct / 4) / Math.sin(ct / 2);
3098
3098
  let Ho = yt + ct;
3099
- for (let ei = 0; ei < ti; ei++) Pt[ei] = K_(yt, Ho, O, P, G, it, ne, Bt, wn, C, S), C = Pt[ei][5], S = Pt[ei][6], yt = Ho, Ho += ct;
3099
+ for (let ei = 0; ei < ti; ei++) Pt[ei] = K_(yt, Ho, O, M, z, it, ne, Bt, wn, C, S), C = Pt[ei][5], S = Pt[ei][6], yt = Ho, Ho += ct;
3100
3100
  return Pt;
3101
3101
  })(c - a, u - t, i, n, o, h, r);
3102
3102
  for (let g = 0, f = d.length; g < f; g++) d[g][1] += a, d[g][2] += t, d[g][3] += a, d[g][4] += t, d[g][5] += a, d[g][6] += t;
@@ -3163,28 +3163,28 @@ const Q_ = (a, t, e) => {
3163
3163
  return n;
3164
3164
  }, td = (a, t, e, s) => Math.sqrt((e - a) ** 2 + (s - t) ** 2), X0 = (a, t, e, s, i, n, r, o) => (h) => {
3165
3165
  const c = h ** 3, u = ((f) => 3 * f ** 2 * (1 - f))(h), d = ((f) => 3 * f * (1 - f) ** 2)(h), g = ((f) => (1 - f) ** 3)(h);
3166
- return new D(r * c + i * u + e * d + a * g, o * c + n * u + s * d + t * g);
3166
+ return new P(r * c + i * u + e * d + a * g, o * c + n * u + s * d + t * g);
3167
3167
  }, W0 = (a) => a ** 2, U0 = (a) => 2 * a * (1 - a), Y0 = (a) => (1 - a) ** 2, J_ = (a, t, e, s, i, n, r, o) => (h) => {
3168
3168
  const c = W0(h), u = U0(h), d = Y0(h), g = 3 * (d * (e - a) + u * (i - e) + c * (r - i)), f = 3 * (d * (s - t) + u * (n - s) + c * (o - n));
3169
3169
  return Math.atan2(f, g);
3170
3170
  }, Z_ = (a, t, e, s, i, n) => (r) => {
3171
3171
  const o = W0(r), h = U0(r), c = Y0(r);
3172
- return new D(i * o + e * h + a * c, n * o + s * h + t * c);
3172
+ return new P(i * o + e * h + a * c, n * o + s * h + t * c);
3173
3173
  }, tw = (a, t, e, s, i, n) => (r) => {
3174
3174
  const o = 1 - r, h = 2 * (o * (e - a) + r * (i - e)), c = 2 * (o * (s - t) + r * (n - s));
3175
3175
  return Math.atan2(c, h);
3176
3176
  }, ym = (a, t, e) => {
3177
- let s = new D(t, e), i = 0;
3177
+ let s = new P(t, e), i = 0;
3178
3178
  for (let n = 1; n <= 100; n += 1) {
3179
3179
  const r = a(n / 100);
3180
3180
  i += td(s.x, s.y, r.x, r.y), s = r;
3181
3181
  }
3182
3182
  return i;
3183
3183
  }, ew = (a, t) => {
3184
- let e, s = 0, i = 0, n = { x: a.x, y: a.y }, r = A({}, n), o = 0.01, h = 0;
3184
+ let e, s = 0, i = 0, n = { x: a.x, y: a.y }, r = T({}, n), o = 0.01, h = 0;
3185
3185
  const c = a.iterator, u = a.angleFinder;
3186
3186
  for (; i < t && o > 1e-4; ) r = c(s), h = s, e = td(n.x, n.y, r.x, r.y), e + i > t ? (s -= o, o /= 2) : (n = r, s += o, i += e);
3187
- return A(A({}, r), {}, { angle: u(h) });
3187
+ return T(T({}, r), {}, { angle: u(h) });
3188
3188
  }, Sp = (a) => {
3189
3189
  let t, e, s = 0, i = 0, n = 0, r = 0, o = 0;
3190
3190
  const h = [];
@@ -3217,9 +3217,9 @@ const Q_ = (a, t, e) => {
3217
3217
  case "M":
3218
3218
  return { x: i.x, y: i.y, angle: 0 };
3219
3219
  case "Z":
3220
- return A(A({}, new D(i.x, i.y).lerp(new D(i.destX, i.destY), n)), {}, { angle: Math.atan2(i.destY - i.y, i.destX - i.x) });
3220
+ return T(T({}, new P(i.x, i.y).lerp(new P(i.destX, i.destY), n)), {}, { angle: Math.atan2(i.destY - i.y, i.destX - i.x) });
3221
3221
  case "L":
3222
- return A(A({}, new D(i.x, i.y).lerp(new D(r[1], r[2]), n)), {}, { angle: Math.atan2(r[2] - i.y, r[1] - i.x) });
3222
+ return T(T({}, new P(i.x, i.y).lerp(new P(r[1], r[2]), n)), {}, { angle: Math.atan2(r[2] - i.y, r[1] - i.x) });
3223
3223
  case "C":
3224
3224
  case "Q":
3225
3225
  return ew(i, t);
@@ -3248,7 +3248,7 @@ const Q_ = (a, t, e) => {
3248
3248
  }
3249
3249
  return e;
3250
3250
  }, rw = function(a) {
3251
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, e = new D(a[0]), s = new D(a[1]), i = 1, n = 0;
3251
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, e = new P(a[0]), s = new P(a[1]), i = 1, n = 0;
3252
3252
  const r = [], o = a.length, h = o > 2;
3253
3253
  let c;
3254
3254
  for (h && (i = a[2].x < s.x ? -1 : a[2].x === s.x ? 0 : 1, n = a[2].y < s.y ? -1 : a[2].y === s.y ? 0 : 1), r.push(["M", e.x - i * t, e.y - n * t]), c = 1; c < o; c++) {
@@ -3299,7 +3299,7 @@ var aw = Object.freeze({ __proto__: null, addTransformToObject: f0, animate: vp,
3299
3299
  a % 2 == 0 && (s += e / 2);
3300
3300
  const i = new Array(a + 1);
3301
3301
  for (let n = 0; n < a; n++) {
3302
- const r = n * e + s, { x: o, y: h } = new D(qs(r), Ks(r)).scalarMultiply(t);
3302
+ const r = n * e + s, { x: o, y: h } = new P(qs(r), Ks(r)).scalarMultiply(t);
3303
3303
  i[n] = [n === 0 ? "M" : "L", o, h];
3304
3304
  }
3305
3305
  return i[a] = ["Z"], i;
@@ -3334,7 +3334,7 @@ var aw = Object.freeze({ __proto__: null, addTransformToObject: f0, animate: vp,
3334
3334
  class hw extends d0 {
3335
3335
  constructor(t) {
3336
3336
  let { allowTouchScrolling: e = !1, containerClass: s = "" } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
3337
- super(t), T(this, "upper", void 0), T(this, "container", void 0);
3337
+ super(t), E(this, "upper", void 0), E(this, "container", void 0);
3338
3338
  const { el: i } = this.lower, n = this.createUpperCanvas();
3339
3339
  this.upper = { el: n, ctx: n.getContext("2d") }, this.applyCanvasStyle(i, { allowTouchScrolling: e }), this.applyCanvasStyle(n, { allowTouchScrolling: e, styles: { position: "absolute", left: "0", top: "0" } });
3340
3340
  const r = this.createContainerElement();
@@ -3350,7 +3350,7 @@ class hw extends d0 {
3350
3350
  }
3351
3351
  applyCanvasStyle(t, e) {
3352
3352
  const { styles: s, allowTouchScrolling: i } = e;
3353
- ed(t, A(A({}, s), {}, { "touch-action": i ? "manipulation" : Re })), Qp(t);
3353
+ ed(t, T(T({}, s), {}, { "touch-action": i ? "manipulation" : Re })), Qp(t);
3354
3354
  }
3355
3355
  setDimensions(t, e) {
3356
3356
  super.setDimensions(t, e);
@@ -3370,10 +3370,10 @@ class hw extends d0 {
3370
3370
  }
3371
3371
  class Vd extends Dc {
3372
3372
  constructor() {
3373
- super(...arguments), T(this, "targets", []), T(this, "_hoveredTargets", []), T(this, "_objectsToRender", void 0), T(this, "_currentTransform", null), T(this, "_groupSelector", null), T(this, "contextTopDirty", !1);
3373
+ super(...arguments), E(this, "targets", []), E(this, "_hoveredTargets", []), E(this, "_objectsToRender", void 0), E(this, "_currentTransform", null), E(this, "_groupSelector", null), E(this, "contextTopDirty", !1);
3374
3374
  }
3375
3375
  static getDefaults() {
3376
- return A(A({}, super.getDefaults()), Vd.ownDefaults);
3376
+ return T(T({}, super.getDefaults()), Vd.ownDefaults);
3377
3377
  }
3378
3378
  get upperCanvasEl() {
3379
3379
  var t;
@@ -3448,14 +3448,14 @@ class Vd extends Dc {
3448
3448
  if (!p || !f) return "drag";
3449
3449
  const y = _.controls[p];
3450
3450
  return y.getActionName(b, y, _);
3451
- })(s, r, t, e), u = t[this.centeredKey], d = this._shouldCenterTransform(e, c, u) ? { x: K, y: K } : this._getOriginFromCorner(e, r), g = { target: e, action: c, actionHandler: h, actionPerformed: !1, corner: r, scaleX: e.scaleX, scaleY: e.scaleY, skewX: e.skewX, skewY: e.skewY, offsetX: n.x - e.left, offsetY: n.y - e.top, originX: d.x, originY: d.y, ex: n.x, ey: n.y, lastX: n.x, lastY: n.y, theta: Ot(e.angle), width: e.width, height: e.height, shiftKey: t.shiftKey, altKey: u, original: A(A({}, gp(e)), {}, { originX: d.x, originY: d.y }) };
3451
+ })(s, r, t, e), u = t[this.centeredKey], d = this._shouldCenterTransform(e, c, u) ? { x: K, y: K } : this._getOriginFromCorner(e, r), g = { target: e, action: c, actionHandler: h, actionPerformed: !1, corner: r, scaleX: e.scaleX, scaleY: e.scaleY, skewX: e.skewX, skewY: e.skewY, offsetX: n.x - e.left, offsetY: n.y - e.top, originX: d.x, originY: d.y, ex: n.x, ey: n.y, lastX: n.x, lastY: n.y, theta: Ot(e.angle), width: e.width, height: e.height, shiftKey: t.shiftKey, altKey: u, original: T(T({}, gp(e)), {}, { originX: d.x, originY: d.y }) };
3452
3452
  this._currentTransform = g, this.fire("before:transform", { e: t, transform: g });
3453
3453
  }
3454
3454
  setCursor(t) {
3455
3455
  this.upperCanvasEl.style.cursor = t;
3456
3456
  }
3457
3457
  _drawSelection(t) {
3458
- const { x: e, y: s, deltaX: i, deltaY: n } = this._groupSelector, r = new D(e, s).transform(this.viewportTransform), o = new D(e + i, s + n).transform(this.viewportTransform), h = this.selectionLineWidth / 2;
3458
+ const { x: e, y: s, deltaX: i, deltaY: n } = this._groupSelector, r = new P(e, s).transform(this.viewportTransform), o = new P(e + i, s + n).transform(this.viewportTransform), h = this.selectionLineWidth / 2;
3459
3459
  let c = Math.min(r.x, o.x), u = Math.min(r.y, o.y), d = Math.max(r.x, o.x), g = Math.max(r.y, o.y);
3460
3460
  this.selectionColor && (t.fillStyle = this.selectionColor, t.fillRect(c, u, d - c, g - u)), this.selectionLineWidth && this.selectionBorderColor && (t.lineWidth = this.selectionLineWidth, t.strokeStyle = this.selectionBorderColor, c += h, u += h, d -= h, g -= h, Se.prototype._setLineDash.call(this, t, this.selectionDashArray), t.strokeRect(c, u, d - c, g - u));
3461
3461
  }
@@ -3481,7 +3481,7 @@ class Vd extends Dc {
3481
3481
  const i = this.getZoom(), n = t.padding / i;
3482
3482
  if (n) {
3483
3483
  const [r, o, h, c] = s, u = Math.atan2(o.y - r.y, o.x - r.x), d = qs(u) * n, g = Ks(u) * n, f = d + g, p = d - g;
3484
- s = [new D(r.x - p, r.y - f), new D(o.x + f, o.y - p), new D(h.x + p, h.y + f), new D(c.x - f, c.y + p)];
3484
+ s = [new P(r.x - p, r.y - f), new P(o.x + f, o.y - p), new P(h.x + p, h.y + f), new P(c.x - f, c.y + p)];
3485
3485
  }
3486
3486
  return kt.isPointInPolygon(e, s);
3487
3487
  }
@@ -3526,7 +3526,7 @@ class Vd extends Dc {
3526
3526
  r && o || ($e in i && Tg in i && (o = Math.abs(i.top - i.bottom)), It in i && ut in i && (r = Math.abs(i.right - i.left))), this.calcOffset(), n.x = n.x - this._offset.left, n.y = n.y - this._offset.top, e || (n = Po(n, void 0, this.viewportTransform));
3527
3527
  const h = this.getRetinaScaling();
3528
3528
  h !== 1 && (n.x /= h, n.y /= h);
3529
- const c = r === 0 || o === 0 ? new D(1, 1) : new D(s.width / r, s.height / o);
3529
+ const c = r === 0 || o === 0 ? new P(1, 1) : new P(s.width / r, s.height / o);
3530
3530
  return n.multiply(c);
3531
3531
  }
3532
3532
  _setDimensionsImpl(t, e) {
@@ -3619,10 +3619,10 @@ class Vd extends Dc {
3619
3619
  super._setSVGObject(t, e, s), e.set(i);
3620
3620
  }
3621
3621
  }
3622
- T(Vd, "ownDefaults", { uniformScaling: !0, uniScaleKey: "shiftKey", centeredScaling: !1, centeredRotation: !1, centeredKey: "altKey", altActionKey: "shiftKey", selection: !0, selectionKey: "shiftKey", selectionColor: "rgba(100, 100, 255, 0.3)", selectionDashArray: [], selectionBorderColor: "rgba(255, 255, 255, 0.3)", selectionLineWidth: 1, selectionFullyContained: !1, hoverCursor: "move", moveCursor: "move", defaultCursor: "default", freeDrawingCursor: "crosshair", notAllowedCursor: "not-allowed", perPixelTargetFind: !1, targetFindTolerance: 0, skipTargetFind: !1, stopContextMenu: !1, fireRightClick: !1, fireMiddleClick: !1, enablePointerEvents: !1, containerClass: "canvas-container", preserveObjectStacking: !1 });
3622
+ E(Vd, "ownDefaults", { uniformScaling: !0, uniScaleKey: "shiftKey", centeredScaling: !1, centeredRotation: !1, centeredKey: "altKey", altActionKey: "shiftKey", selection: !0, selectionKey: "shiftKey", selectionColor: "rgba(100, 100, 255, 0.3)", selectionDashArray: [], selectionBorderColor: "rgba(255, 255, 255, 0.3)", selectionLineWidth: 1, selectionFullyContained: !1, hoverCursor: "move", moveCursor: "move", defaultCursor: "default", freeDrawingCursor: "crosshair", notAllowedCursor: "not-allowed", perPixelTargetFind: !1, targetFindTolerance: 0, skipTargetFind: !1, stopContextMenu: !1, fireRightClick: !1, fireMiddleClick: !1, enablePointerEvents: !1, containerClass: "canvas-container", preserveObjectStacking: !1 });
3623
3623
  class lw {
3624
3624
  constructor(t) {
3625
- T(this, "targets", []), T(this, "__disposer", void 0);
3625
+ E(this, "targets", []), E(this, "__disposer", void 0);
3626
3626
  const e = () => {
3627
3627
  const { hiddenTextarea: i } = t.getActiveObject() || {};
3628
3628
  i && i.focus();
@@ -3669,7 +3669,7 @@ const cw = ["target", "oldTarget", "fireCanvas", "e"], qe = { passive: !1 }, zo
3669
3669
  }, uw = { mouse: { in: "over", out: "out", targetIn: "mouseover", targetOut: "mouseout", canvasIn: "mouse:over", canvasOut: "mouse:out" }, drag: { in: "enter", out: "leave", targetIn: "dragenter", targetOut: "dragleave", canvasIn: "drag:enter", canvasOut: "drag:leave" } };
3670
3670
  class Ng extends Vd {
3671
3671
  constructor(t) {
3672
- super(t, arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}), T(this, "_isClick", void 0), T(this, "textEditingManager", new lw(this)), ["_onMouseDown", "_onTouchStart", "_onMouseMove", "_onMouseUp", "_onTouchEnd", "_onResize", "_onMouseWheel", "_onMouseOut", "_onMouseEnter", "_onContextMenu", "_onDoubleClick", "_onDragStart", "_onDragEnd", "_onDragProgress", "_onDragOver", "_onDragEnter", "_onDragLeave", "_onDrop"].forEach((e) => {
3672
+ super(t, arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}), E(this, "_isClick", void 0), E(this, "textEditingManager", new lw(this)), ["_onMouseDown", "_onTouchStart", "_onMouseMove", "_onMouseUp", "_onTouchEnd", "_onResize", "_onMouseWheel", "_onMouseOut", "_onMouseEnter", "_onContextMenu", "_onDoubleClick", "_onDragStart", "_onDragEnd", "_onDragProgress", "_onDragOver", "_onDragEnter", "_onDragLeave", "_onDrop"].forEach((e) => {
3673
3673
  this[e] = this[e].bind(this);
3674
3674
  }), this.addOrRemove(Sn, "add");
3675
3675
  }
@@ -3689,13 +3689,13 @@ class Ng extends Vd {
3689
3689
  this.__onMouseWheel(t);
3690
3690
  }
3691
3691
  _onMouseOut(t) {
3692
- const e = this._hoveredTarget, s = A({ e: t }, zo(this, t));
3693
- this.fire("mouse:out", A(A({}, s), {}, { target: e })), this._hoveredTarget = void 0, e && e.fire("mouseout", A({}, s)), this._hoveredTargets.forEach((i) => {
3694
- this.fire("mouse:out", A(A({}, s), {}, { target: i })), i && i.fire("mouseout", A({}, s));
3692
+ const e = this._hoveredTarget, s = T({ e: t }, zo(this, t));
3693
+ this.fire("mouse:out", T(T({}, s), {}, { target: e })), this._hoveredTarget = void 0, e && e.fire("mouseout", T({}, s)), this._hoveredTargets.forEach((i) => {
3694
+ this.fire("mouse:out", T(T({}, s), {}, { target: i })), i && i.fire("mouseout", T({}, s));
3695
3695
  }), this._hoveredTargets = [];
3696
3696
  }
3697
3697
  _onMouseEnter(t) {
3698
- this._currentTransform || this.findTarget(t) || (this.fire("mouse:over", A({ e: t }, zo(this, t))), this._hoveredTarget = void 0, this._hoveredTargets = []);
3698
+ this._currentTransform || this.findTarget(t) || (this.fire("mouse:over", T({ e: t }, zo(this, t))), this._hoveredTarget = void 0, this._hoveredTargets = []);
3699
3699
  }
3700
3700
  _onDragStart(t) {
3701
3701
  this._isClick = !1;
@@ -3744,7 +3744,7 @@ class Ng extends Vd {
3744
3744
  this.fire("dragleave", e), this._fireEnterLeaveEvents(void 0, e), this._renderDragEffects(t, this._dragSource), this._dropTarget = void 0, this.targets = [], this._hoveredTargets = [];
3745
3745
  }
3746
3746
  _onDrop(t) {
3747
- const { target: e, targets: s } = this.findDragTargets(t), i = this._basicEventHandler("drop:before", A({ e: t, target: e, subTargets: s, dragSource: this._dragSource }, zo(this, t)));
3747
+ const { target: e, targets: s } = this.findDragTargets(t), i = this._basicEventHandler("drop:before", T({ e: t, target: e, subTargets: s, dragSource: this._dragSource }, zo(this, t)));
3748
3748
  i.didDrop = !1, i.dropTarget = void 0, this._basicEventHandler("drop", i), this.fire("drop:after", i);
3749
3749
  }
3750
3750
  _onContextMenu(t) {
@@ -3836,7 +3836,7 @@ class Ng extends Vd {
3836
3836
  return e;
3837
3837
  }
3838
3838
  _handleEvent(t, e) {
3839
- const s = this._target, i = this.targets || [], n = A(A({ e: t, target: s, subTargets: i }, zo(this, t)), {}, { transform: this._currentTransform }, e === "up:before" || e === "up" ? { isClick: this._isClick, currentTarget: this.findTarget(t), currentSubTargets: this.targets } : {});
3839
+ const s = this._target, i = this.targets || [], n = T(T({ e: t, target: s, subTargets: i }, zo(this, t)), {}, { transform: this._currentTransform }, e === "up:before" || e === "up" ? { isClick: this._isClick, currentTarget: this.findTarget(t), currentSubTargets: this.targets } : {});
3840
3840
  this.fire("mouse:".concat(e), n), s && s.fire("mouse".concat(e), n);
3841
3841
  for (let r = 0; r < i.length; r++) i[r] !== s && i[r].fire("mouse".concat(e), n);
3842
3842
  }
@@ -3908,19 +3908,19 @@ class Ng extends Vd {
3908
3908
  }
3909
3909
  _fireEnterLeaveEvents(t, e) {
3910
3910
  const s = this._draggedoverTarget, i = this._hoveredTargets, n = this.targets, r = Math.max(i.length, n.length);
3911
- this.fireSyntheticInOutEvents("drag", A(A({}, e), {}, { target: t, oldTarget: s, fireCanvas: !0 }));
3912
- for (let o = 0; o < r; o++) this.fireSyntheticInOutEvents("drag", A(A({}, e), {}, { target: n[o], oldTarget: i[o] }));
3911
+ this.fireSyntheticInOutEvents("drag", T(T({}, e), {}, { target: t, oldTarget: s, fireCanvas: !0 }));
3912
+ for (let o = 0; o < r; o++) this.fireSyntheticInOutEvents("drag", T(T({}, e), {}, { target: n[o], oldTarget: i[o] }));
3913
3913
  this._draggedoverTarget = t;
3914
3914
  }
3915
3915
  fireSyntheticInOutEvents(t, e) {
3916
3916
  let { target: s, oldTarget: i, fireCanvas: n, e: r } = e, o = At(e, cw);
3917
3917
  const { targetIn: h, targetOut: c, canvasIn: u, canvasOut: d } = uw[t], g = i !== s;
3918
3918
  if (i && g) {
3919
- const f = A(A({}, o), {}, { e: r, target: i, nextTarget: s }, zo(this, r));
3919
+ const f = T(T({}, o), {}, { e: r, target: i, nextTarget: s }, zo(this, r));
3920
3920
  n && this.fire(d, f), i.fire(c, f);
3921
3921
  }
3922
3922
  if (s && g) {
3923
- const f = A(A({}, o), {}, { e: r, target: s, previousTarget: i }, zo(this, r));
3923
+ const f = T(T({}, o), {}, { e: r, target: s, previousTarget: i }, zo(this, r));
3924
3924
  n && this.fire(u, f), s.fire(h, f);
3925
3925
  }
3926
3926
  }
@@ -3967,7 +3967,7 @@ class Ng extends Vd {
3967
3967
  }
3968
3968
  handleSelection(t) {
3969
3969
  if (!this.selection || !this._groupSelector) return !1;
3970
- const { x: e, y: s, deltaX: i, deltaY: n } = this._groupSelector, r = new D(e, s), o = r.add(new D(i, n)), h = r.min(o), c = r.max(o).subtract(h), u = this.collectObjects({ left: h.x, top: h.y, width: c.x, height: c.y }, { includeIntersecting: !this.selectionFullyContained }), d = r.eq(o) ? u[0] ? [u[0]] : [] : u.length > 1 ? u.filter((g) => !g.onSelect({ e: t })).reverse() : u;
3970
+ const { x: e, y: s, deltaX: i, deltaY: n } = this._groupSelector, r = new P(e, s), o = r.add(new P(i, n)), h = r.min(o), c = r.max(o).subtract(h), u = this.collectObjects({ left: h.x, top: h.y, width: c.x, height: c.y }, { includeIntersecting: !this.selectionFullyContained }), d = r.eq(o) ? u[0] ? [u[0]] : [] : u.length > 1 ? u.filter((g) => !g.onSelect({ e: t })).reverse() : u;
3971
3971
  if (d.length === 1) this.setActiveObject(d[0], t);
3972
3972
  else if (d.length > 1) {
3973
3973
  const g = j.getClass("ActiveSelection");
@@ -3982,7 +3982,7 @@ class Ng extends Vd {
3982
3982
  this.removeListeners(), this.textEditingManager.dispose(), super.destroy();
3983
3983
  }
3984
3984
  }
3985
- const J0 = { x1: 0, y1: 0, x2: 0, y2: 0 }, dw = A(A({}, J0), {}, { r1: 0, r2: 0 }), Qo = (a, t) => isNaN(a) && typeof t == "number" ? t : a, gw = /^(\d+\.\d+)%|(\d+)%$/;
3985
+ const J0 = { x1: 0, y1: 0, x2: 0, y2: 0 }, dw = T(T({}, J0), {}, { r1: 0, r2: 0 }), Qo = (a, t) => isNaN(a) && typeof t == "number" ? t : a, gw = /^(\d+\.\d+)%|(\d+)%$/;
3986
3986
  function Z0(a) {
3987
3987
  return a && gw.test(a);
3988
3988
  }
@@ -4030,12 +4030,12 @@ function vw(a, t) {
4030
4030
  return { x1: ks(e, "x1") || 0, y1: ks(e, "y1") || 0, x2: ks(e, "x2") || "100%", y2: ks(e, "y2") || 0 };
4031
4031
  }(a) : function(e) {
4032
4032
  return { x1: ks(e, "fx") || ks(e, "cx") || "50%", y1: ks(e, "fy") || ks(e, "cy") || "50%", r1: 0, x2: ks(e, "cx") || "50%", y2: ks(e, "cy") || "50%", r2: ks(e, "r") || "50%" };
4033
- }(a), A(A({}, t), {}, { gradientUnits: sb(a) }));
4033
+ }(a), T(T({}, t), {}, { gradientUnits: sb(a) }));
4034
4034
  }
4035
4035
  class Ah {
4036
4036
  constructor(t) {
4037
4037
  const { type: e = "linear", gradientUnits: s = "pixels", coords: i = {}, colorStops: n = [], offsetX: r = 0, offsetY: o = 0, gradientTransform: h, id: c } = t || {};
4038
- Object.assign(this, { type: e, gradientUnits: s, coords: A(A({}, e === "radial" ? dw : J0), i), colorStops: n, offsetX: r, offsetY: o, gradientTransform: h, id: c ? "".concat(c, "_").concat(nr()) : nr() });
4038
+ Object.assign(this, { type: e, gradientUnits: s, coords: T(T({}, e === "radial" ? dw : J0), i), colorStops: n, offsetX: r, offsetY: o, gradientTransform: h, id: c ? "".concat(c, "_").concat(nr()) : nr() });
4039
4039
  }
4040
4040
  addColorStop(t) {
4041
4041
  for (const e in t) {
@@ -4045,11 +4045,11 @@ class Ah {
4045
4045
  return this;
4046
4046
  }
4047
4047
  toObject(t) {
4048
- return A(A({}, No(this, t)), {}, { type: this.type, coords: A({}, this.coords), colorStops: this.colorStops.map((e) => A({}, e)), offsetX: this.offsetX, offsetY: this.offsetY, gradientUnits: this.gradientUnits, gradientTransform: this.gradientTransform ? [...this.gradientTransform] : void 0 });
4048
+ return T(T({}, No(this, t)), {}, { type: this.type, coords: T({}, this.coords), colorStops: this.colorStops.map((e) => T({}, e)), offsetX: this.offsetX, offsetY: this.offsetY, gradientUnits: this.gradientUnits, gradientTransform: this.gradientTransform ? [...this.gradientTransform] : void 0 });
4049
4049
  }
4050
4050
  toSVG(t) {
4051
4051
  let { additionalTransform: e } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
4052
- const s = [], i = this.gradientTransform ? this.gradientTransform.concat() : je.concat(), n = this.gradientUnits === "pixels" ? "userSpaceOnUse" : "objectBoundingBox", r = this.colorStops.map((d) => A({}, d)).sort((d, g) => d.offset - g.offset);
4052
+ const s = [], i = this.gradientTransform ? this.gradientTransform.concat() : je.concat(), n = this.gradientUnits === "pixels" ? "userSpaceOnUse" : "objectBoundingBox", r = this.colorStops.map((d) => T({}, d)).sort((d, g) => d.offset - g.offset);
4053
4053
  let o = -this.offsetX, h = -this.offsetY;
4054
4054
  var c;
4055
4055
  n === "objectBoundingBox" ? (o /= t.width, h /= t.height) : (o += t.width / 2, h += t.height / 2), (c = t) && typeof c._renderPathCommands == "function" && this.gradientUnits !== "percentage" && (o -= t.pathOffset.x, h -= t.pathOffset.y), i[4] -= o, i[5] -= h;
@@ -4088,14 +4088,14 @@ class Ah {
4088
4088
  }
4089
4089
  static async fromObject(t) {
4090
4090
  const { colorStops: e, gradientTransform: s } = t;
4091
- return new this(A(A({}, t), {}, { colorStops: e ? e.map((i) => A({}, i)) : void 0, gradientTransform: s ? [...s] : void 0 }));
4091
+ return new this(T(T({}, t), {}, { colorStops: e ? e.map((i) => T({}, i)) : void 0, gradientTransform: s ? [...s] : void 0 }));
4092
4092
  }
4093
4093
  static fromElement(t, e, s) {
4094
4094
  const i = sb(t), n = e._findCenterFromElement();
4095
- return new this(A({ id: t.getAttribute("id") || void 0, type: eb(t), coords: vw(t, { width: s.viewBoxWidth || s.width, height: s.viewBoxHeight || s.height }), colorStops: bw(t, s.opacity), gradientUnits: i, gradientTransform: Qu(t.getAttribute("gradientTransform") || "") }, i === "pixels" ? { offsetX: e.width / 2 - n.x, offsetY: e.height / 2 - n.y } : { offsetX: 0, offsetY: 0 }));
4095
+ return new this(T({ id: t.getAttribute("id") || void 0, type: eb(t), coords: vw(t, { width: s.viewBoxWidth || s.width, height: s.viewBoxHeight || s.height }), colorStops: bw(t, s.opacity), gradientUnits: i, gradientTransform: Qu(t.getAttribute("gradientTransform") || "") }, i === "pixels" ? { offsetX: e.width / 2 - n.x, offsetY: e.height / 2 - n.y } : { offsetX: 0, offsetY: 0 }));
4096
4096
  }
4097
4097
  }
4098
- T(Ah, "type", "Gradient"), j.setClass(Ah, "gradient"), j.setClass(Ah, "linear"), j.setClass(Ah, "radial");
4098
+ E(Ah, "type", "Gradient"), j.setClass(Ah, "gradient"), j.setClass(Ah, "linear"), j.setClass(Ah, "radial");
4099
4099
  const yw = ["type", "source", "patternTransform"];
4100
4100
  class lg {
4101
4101
  get type() {
@@ -4105,7 +4105,7 @@ class lg {
4105
4105
  pn("warn", "Setting type has no effect", t);
4106
4106
  }
4107
4107
  constructor(t) {
4108
- T(this, "repeat", "repeat"), T(this, "offsetX", 0), T(this, "offsetY", 0), T(this, "crossOrigin", ""), this.id = nr(), Object.assign(this, t);
4108
+ E(this, "repeat", "repeat"), E(this, "offsetX", 0), E(this, "offsetY", 0), E(this, "crossOrigin", ""), this.id = nr(), Object.assign(this, t);
4109
4109
  }
4110
4110
  isImageSource() {
4111
4111
  return !!this.source && typeof this.source.src == "string";
@@ -4122,7 +4122,7 @@ class lg {
4122
4122
  toObject() {
4123
4123
  let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
4124
4124
  const { repeat: e, crossOrigin: s } = this;
4125
- return A(A({}, No(this, t)), {}, { type: "pattern", source: this.sourceToString(), repeat: e, crossOrigin: s, offsetX: Ct(this.offsetX, ot.NUM_FRACTION_DIGITS), offsetY: Ct(this.offsetY, ot.NUM_FRACTION_DIGITS), patternTransform: this.patternTransform ? [...this.patternTransform] : null });
4125
+ return T(T({}, No(this, t)), {}, { type: "pattern", source: this.sourceToString(), repeat: e, crossOrigin: s, offsetX: Ct(this.offsetX, ot.NUM_FRACTION_DIGITS), offsetY: Ct(this.offsetY, ot.NUM_FRACTION_DIGITS), patternTransform: this.patternTransform ? [...this.patternTransform] : null });
4126
4126
  }
4127
4127
  toSVG(t) {
4128
4128
  let { width: e, height: s } = t;
@@ -4132,11 +4132,11 @@ class lg {
4132
4132
  }
4133
4133
  static async fromObject(t, e) {
4134
4134
  let { type: s, source: i, patternTransform: n } = t, r = At(t, yw);
4135
- const o = await Wh(i, A(A({}, e), {}, { crossOrigin: r.crossOrigin }));
4136
- return new this(A(A({}, r), {}, { patternTransform: n && n.slice(0), source: o }));
4135
+ const o = await Wh(i, T(T({}, e), {}, { crossOrigin: r.crossOrigin }));
4136
+ return new this(T(T({}, r), {}, { patternTransform: n && n.slice(0), source: o }));
4137
4137
  }
4138
4138
  }
4139
- T(lg, "type", "Pattern"), j.setClass(lg), j.setClass(lg, "pattern");
4139
+ E(lg, "type", "Pattern"), j.setClass(lg), j.setClass(lg, "pattern");
4140
4140
  const _w = ["path", "left", "top"], ww = ["d"];
4141
4141
  class br extends Se {
4142
4142
  constructor(t) {
@@ -4148,7 +4148,7 @@ class br extends Se {
4148
4148
  }
4149
4149
  _findCenterFromElement() {
4150
4150
  const t = this._calcBoundsFromPath();
4151
- return new D(t.left + t.width / 2, t.top + t.height / 2);
4151
+ return new P(t.left + t.width / 2, t.top + t.height / 2);
4152
4152
  }
4153
4153
  _renderPathCommands(t) {
4154
4154
  const e = -this.pathOffset.x, s = -this.pathOffset.y;
@@ -4178,7 +4178,7 @@ class br extends Se {
4178
4178
  }
4179
4179
  toObject() {
4180
4180
  let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
4181
- return A(A({}, super.toObject(t)), {}, { path: this.path.map((e) => e.slice()) });
4181
+ return T(T({}, super.toObject(t)), {}, { path: this.path.map((e) => e.slice()) });
4182
4182
  }
4183
4183
  toDatalessObject() {
4184
4184
  let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
@@ -4235,21 +4235,21 @@ class br extends Se {
4235
4235
  }
4236
4236
  _calcDimensions() {
4237
4237
  const t = this._calcBoundsFromPath();
4238
- return A(A({}, t), {}, { pathOffset: new D(t.left + t.width / 2, t.top + t.height / 2) });
4238
+ return T(T({}, t), {}, { pathOffset: new P(t.left + t.width / 2, t.top + t.height / 2) });
4239
4239
  }
4240
4240
  static fromObject(t) {
4241
4241
  return this._fromObject(t, { extraParam: "path" });
4242
4242
  }
4243
4243
  static async fromElement(t, e, s) {
4244
4244
  const i = _n(t, this.ATTRIBUTE_NAMES, s), { d: n } = i;
4245
- return new this(n, A(A(A({}, At(i, ww)), e), {}, { left: void 0, top: void 0 }));
4245
+ return new this(n, T(T(T({}, At(i, ww)), e), {}, { left: void 0, top: void 0 }));
4246
4246
  }
4247
4247
  }
4248
- T(br, "type", "Path"), T(br, "cacheProperties", [...yn, "path", "fillRule"]), T(br, "ATTRIBUTE_NAMES", [...cr, "d"]), j.setClass(br), j.setSVGClass(br);
4248
+ E(br, "type", "Path"), E(br, "cacheProperties", [...yn, "path", "fillRule"]), E(br, "ATTRIBUTE_NAMES", [...cr, "d"]), j.setClass(br), j.setSVGClass(br);
4249
4249
  const xw = ["left", "top", "radius"], ib = ["radius", "startAngle", "endAngle", "counterClockwise"];
4250
4250
  class Fi extends Se {
4251
4251
  static getDefaults() {
4252
- return A(A({}, super.getDefaults()), Fi.ownDefaults);
4252
+ return T(T({}, super.getDefaults()), Fi.ownDefaults);
4253
4253
  }
4254
4254
  constructor(t) {
4255
4255
  super(), Object.assign(this, Fi.ownDefaults), this.setOptions(t);
@@ -4285,13 +4285,13 @@ class Fi extends Se {
4285
4285
  }
4286
4286
  static async fromElement(t, e, s) {
4287
4287
  const i = _n(t, this.ATTRIBUTE_NAMES, s), { left: n = 0, top: r = 0, radius: o = 0 } = i;
4288
- return new this(A(A({}, At(i, xw)), {}, { radius: o, left: n - o, top: r - o }));
4288
+ return new this(T(T({}, At(i, xw)), {}, { radius: o, left: n - o, top: r - o }));
4289
4289
  }
4290
4290
  static fromObject(t) {
4291
4291
  return super._fromObject(t);
4292
4292
  }
4293
4293
  }
4294
- T(Fi, "type", "Circle"), T(Fi, "cacheProperties", [...yn, ...ib]), T(Fi, "ownDefaults", { radius: 0, startAngle: 0, endAngle: 360, counterClockwise: !1 }), T(Fi, "ATTRIBUTE_NAMES", ["cx", "cy", "r", ...cr]), j.setClass(Fi), j.setSVGClass(Fi);
4294
+ E(Fi, "type", "Circle"), E(Fi, "cacheProperties", [...yn, ...ib]), E(Fi, "ownDefaults", { radius: 0, startAngle: 0, endAngle: 360, counterClockwise: !1 }), E(Fi, "ATTRIBUTE_NAMES", ["cx", "cy", "r", ...cr]), j.setClass(Fi), j.setSVGClass(Fi);
4295
4295
  const Sw = ["x1", "y1", "x2", "y2"], Cw = ["x1", "y1", "x2", "y2"], jg = ["x1", "x2", "y1", "y2"];
4296
4296
  class vr extends Se {
4297
4297
  constructor() {
@@ -4303,7 +4303,7 @@ class vr extends Se {
4303
4303
  _setWidthHeight() {
4304
4304
  const { x1: t, y1: e, x2: s, y2: i } = this;
4305
4305
  this.width = Math.abs(s - t), this.height = Math.abs(i - e);
4306
- const { left: n, top: r, width: o, height: h } = Ai([{ x: t, y: e }, { x: s, y: i }]), c = new D(n + o / 2, r + h / 2);
4306
+ const { left: n, top: r, width: o, height: h } = Ai([{ x: t, y: e }, { x: s, y: i }]), c = new P(n + o / 2, r + h / 2);
4307
4307
  this.setPositionByOrigin(c, K, K);
4308
4308
  }
4309
4309
  _set(t, e) {
@@ -4318,11 +4318,11 @@ class vr extends Se {
4318
4318
  xs(this.stroke) ? t.strokeStyle = this.stroke.toLive(t) : t.strokeStyle = (i = this.stroke) !== null && i !== void 0 ? i : t.fillStyle, this.stroke && this._renderStroke(t), t.strokeStyle = s;
4319
4319
  }
4320
4320
  _findCenterFromElement() {
4321
- return new D((this.x1 + this.x2) / 2, (this.y1 + this.y2) / 2);
4321
+ return new P((this.x1 + this.x2) / 2, (this.y1 + this.y2) / 2);
4322
4322
  }
4323
4323
  toObject() {
4324
4324
  let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
4325
- return A(A({}, super.toObject(t)), this.calcLinePoints());
4325
+ return T(T({}, super.toObject(t)), this.calcLinePoints());
4326
4326
  }
4327
4327
  _getNonTransformedDimensions() {
4328
4328
  const t = super._getNonTransformedDimensions();
@@ -4343,13 +4343,13 @@ class vr extends Se {
4343
4343
  }
4344
4344
  static fromObject(t) {
4345
4345
  let { x1: e, y1: s, x2: i, y2: n } = t, r = At(t, Cw);
4346
- return this._fromObject(A(A({}, r), {}, { points: [e, s, i, n] }), { extraParam: "points" });
4346
+ return this._fromObject(T(T({}, r), {}, { points: [e, s, i, n] }), { extraParam: "points" });
4347
4347
  }
4348
4348
  }
4349
- T(vr, "type", "Line"), T(vr, "cacheProperties", [...yn, ...jg]), T(vr, "ATTRIBUTE_NAMES", cr.concat(jg)), j.setClass(vr), j.setSVGClass(vr);
4349
+ E(vr, "type", "Line"), E(vr, "cacheProperties", [...yn, ...jg]), E(vr, "ATTRIBUTE_NAMES", cr.concat(jg)), j.setClass(vr), j.setSVGClass(vr);
4350
4350
  class wr extends Se {
4351
4351
  static getDefaults() {
4352
- return A(A({}, super.getDefaults()), wr.ownDefaults);
4352
+ return T(T({}, super.getDefaults()), wr.ownDefaults);
4353
4353
  }
4354
4354
  constructor(t) {
4355
4355
  super(), Object.assign(this, wr.ownDefaults), this.setOptions(t);
@@ -4363,11 +4363,11 @@ class wr extends Se {
4363
4363
  return ["<polygon ", "COMMON_PARTS", 'points="', "".concat(-t, " ").concat(e, ",0 ").concat(-e, ",").concat(t, " ").concat(e), '" />'];
4364
4364
  }
4365
4365
  }
4366
- T(wr, "type", "Triangle"), T(wr, "ownDefaults", { width: 100, height: 100 }), j.setClass(wr), j.setSVGClass(wr);
4366
+ E(wr, "type", "Triangle"), E(wr, "ownDefaults", { width: 100, height: 100 }), j.setClass(wr), j.setSVGClass(wr);
4367
4367
  const nb = ["rx", "ry"];
4368
4368
  class Ii extends Se {
4369
4369
  static getDefaults() {
4370
- return A(A({}, super.getDefaults()), Ii.ownDefaults);
4370
+ return T(T({}, super.getDefaults()), Ii.ownDefaults);
4371
4371
  }
4372
4372
  constructor(t) {
4373
4373
  super(), Object.assign(this, Ii.ownDefaults), this.setOptions(t);
@@ -4410,15 +4410,15 @@ function Aw(a) {
4410
4410
  for (let s = 0; s < t.length; s += 2) e.push({ x: parseFloat(t[s]), y: parseFloat(t[s + 1]) });
4411
4411
  return e;
4412
4412
  }
4413
- T(Ii, "type", "Ellipse"), T(Ii, "cacheProperties", [...yn, ...nb]), T(Ii, "ownDefaults", { rx: 0, ry: 0 }), T(Ii, "ATTRIBUTE_NAMES", [...cr, "cx", "cy", "rx", "ry"]), j.setClass(Ii), j.setSVGClass(Ii);
4413
+ E(Ii, "type", "Ellipse"), E(Ii, "cacheProperties", [...yn, ...nb]), E(Ii, "ownDefaults", { rx: 0, ry: 0 }), E(Ii, "ATTRIBUTE_NAMES", [...cr, "cx", "cy", "rx", "ry"]), j.setClass(Ii), j.setSVGClass(Ii);
4414
4414
  const Tw = ["left", "top"], rb = { exactBoundingBox: !1 };
4415
4415
  class Xs extends Se {
4416
4416
  static getDefaults() {
4417
- return A(A({}, super.getDefaults()), Xs.ownDefaults);
4417
+ return T(T({}, super.getDefaults()), Xs.ownDefaults);
4418
4418
  }
4419
4419
  constructor() {
4420
4420
  let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
4421
- super(), T(this, "strokeDiff", void 0), Object.assign(this, Xs.ownDefaults), this.setOptions(e), this.points = t;
4421
+ super(), E(this, "strokeDiff", void 0), Object.assign(this, Xs.ownDefaults), this.setOptions(e), this.points = t;
4422
4422
  const { left: s, top: i } = e;
4423
4423
  this.initialized = !0, this.setBoundingBox(!0), typeof s == "number" && this.set(ut, s), typeof i == "number" && this.set($e, i);
4424
4424
  }
@@ -4429,29 +4429,29 @@ class Xs extends Se {
4429
4429
  return L0(this.points, t, this.isOpen());
4430
4430
  }
4431
4431
  _calcDimensions(t) {
4432
- t = A({ scaleX: this.scaleX, scaleY: this.scaleY, skewX: this.skewX, skewY: this.skewY, strokeLineCap: this.strokeLineCap, strokeLineJoin: this.strokeLineJoin, strokeMiterLimit: this.strokeMiterLimit, strokeUniform: this.strokeUniform, strokeWidth: this.strokeWidth }, t || {});
4432
+ t = T({ scaleX: this.scaleX, scaleY: this.scaleY, skewX: this.skewX, skewY: this.skewY, strokeLineCap: this.strokeLineCap, strokeLineJoin: this.strokeLineJoin, strokeMiterLimit: this.strokeMiterLimit, strokeUniform: this.strokeUniform, strokeWidth: this.strokeWidth }, t || {});
4433
4433
  const e = this.exactBoundingBox ? this._projectStrokeOnPoints(t).map((c) => c.projectedPoint) : this.points;
4434
- if (e.length === 0) return { left: 0, top: 0, width: 0, height: 0, pathOffset: new D(), strokeOffset: new D(), strokeDiff: new D() };
4435
- const s = Ai(e), i = Mc(A(A({}, t), {}, { scaleX: 1, scaleY: 1 })), n = Ai(this.points.map((c) => ye(c, i, !0))), r = new D(this.scaleX, this.scaleY);
4434
+ if (e.length === 0) return { left: 0, top: 0, width: 0, height: 0, pathOffset: new P(), strokeOffset: new P(), strokeDiff: new P() };
4435
+ const s = Ai(e), i = Mc(T(T({}, t), {}, { scaleX: 1, scaleY: 1 })), n = Ai(this.points.map((c) => ye(c, i, !0))), r = new P(this.scaleX, this.scaleY);
4436
4436
  let o = s.left + s.width / 2, h = s.top + s.height / 2;
4437
- return this.exactBoundingBox && (o -= h * Math.tan(Ot(this.skewX)), h -= o * Math.tan(Ot(this.skewY))), A(A({}, s), {}, { pathOffset: new D(o, h), strokeOffset: new D(n.left, n.top).subtract(new D(s.left, s.top)).multiply(r), strokeDiff: new D(s.width, s.height).subtract(new D(n.width, n.height)).multiply(r) });
4437
+ return this.exactBoundingBox && (o -= h * Math.tan(Ot(this.skewX)), h -= o * Math.tan(Ot(this.skewY))), T(T({}, s), {}, { pathOffset: new P(o, h), strokeOffset: new P(n.left, n.top).subtract(new P(s.left, s.top)).multiply(r), strokeDiff: new P(s.width, s.height).subtract(new P(n.width, n.height)).multiply(r) });
4438
4438
  }
4439
4439
  _findCenterFromElement() {
4440
4440
  const t = Ai(this.points);
4441
- return new D(t.left + t.width / 2, t.top + t.height / 2);
4441
+ return new P(t.left + t.width / 2, t.top + t.height / 2);
4442
4442
  }
4443
4443
  setDimensions() {
4444
4444
  this.setBoundingBox();
4445
4445
  }
4446
4446
  setBoundingBox(t) {
4447
4447
  const { left: e, top: s, width: i, height: n, pathOffset: r, strokeOffset: o, strokeDiff: h } = this._calcDimensions();
4448
- this.set({ width: i, height: n, pathOffset: r, strokeOffset: o, strokeDiff: h }), t && this.setPositionByOrigin(new D(e + i / 2, s + n / 2), K, K);
4448
+ this.set({ width: i, height: n, pathOffset: r, strokeOffset: o, strokeDiff: h }), t && this.setPositionByOrigin(new P(e + i / 2, s + n / 2), K, K);
4449
4449
  }
4450
4450
  isStrokeAccountedForInDimensions() {
4451
4451
  return this.exactBoundingBox;
4452
4452
  }
4453
4453
  _getNonTransformedDimensions() {
4454
- return this.exactBoundingBox ? new D(this.width, this.height) : super._getNonTransformedDimensions();
4454
+ return this.exactBoundingBox ? new P(this.width, this.height) : super._getNonTransformedDimensions();
4455
4455
  }
4456
4456
  _getTransformedDimensions() {
4457
4457
  let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
@@ -4460,12 +4460,12 @@ class Xs extends Se {
4460
4460
  if (Object.keys(t).some((o) => this.strokeUniform || this.constructor.layoutProperties.includes(o))) {
4461
4461
  var e, s;
4462
4462
  const { width: o, height: h } = this._calcDimensions(t);
4463
- r = new D((e = t.width) !== null && e !== void 0 ? e : o, (s = t.height) !== null && s !== void 0 ? s : h);
4463
+ r = new P((e = t.width) !== null && e !== void 0 ? e : o, (s = t.height) !== null && s !== void 0 ? s : h);
4464
4464
  } else {
4465
4465
  var i, n;
4466
- r = new D((i = t.width) !== null && i !== void 0 ? i : this.width, (n = t.height) !== null && n !== void 0 ? n : this.height);
4466
+ r = new P((i = t.width) !== null && i !== void 0 ? i : this.width, (n = t.height) !== null && n !== void 0 ? n : this.height);
4467
4467
  }
4468
- return r.multiply(new D(t.scaleX || this.scaleX, t.scaleY || this.scaleY));
4468
+ return r.multiply(new P(t.scaleX || this.scaleX, t.scaleY || this.scaleY));
4469
4469
  }
4470
4470
  return super._getTransformedDimensions(t);
4471
4471
  }
@@ -4475,7 +4475,7 @@ class Xs extends Se {
4475
4475
  }
4476
4476
  toObject() {
4477
4477
  let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
4478
- return A(A({}, super.toObject(t)), {}, { points: this.points.map((e) => {
4478
+ return T(T({}, super.toObject(t)), {}, { points: this.points.map((e) => {
4479
4479
  let { x: s, y: i } = e;
4480
4480
  return { x: s, y: i };
4481
4481
  }) });
@@ -4501,19 +4501,19 @@ class Xs extends Se {
4501
4501
  return this.points.length;
4502
4502
  }
4503
4503
  static async fromElement(t, e, s) {
4504
- return new this(Aw(t.getAttribute("points")), A(A({}, At(_n(t, this.ATTRIBUTE_NAMES, s), Tw)), e));
4504
+ return new this(Aw(t.getAttribute("points")), T(T({}, At(_n(t, this.ATTRIBUTE_NAMES, s), Tw)), e));
4505
4505
  }
4506
4506
  static fromObject(t) {
4507
4507
  return this._fromObject(t, { extraParam: "points" });
4508
4508
  }
4509
4509
  }
4510
- T(Xs, "ownDefaults", rb), T(Xs, "type", "Polyline"), T(Xs, "layoutProperties", [gh, fh, "strokeLineCap", "strokeLineJoin", "strokeMiterLimit", "strokeWidth", "strokeUniform", "points"]), T(Xs, "cacheProperties", [...yn, "points"]), T(Xs, "ATTRIBUTE_NAMES", [...cr]), j.setClass(Xs), j.setSVGClass(Xs);
4510
+ E(Xs, "ownDefaults", rb), E(Xs, "type", "Polyline"), E(Xs, "layoutProperties", [gh, fh, "strokeLineCap", "strokeLineJoin", "strokeMiterLimit", "strokeWidth", "strokeUniform", "points"]), E(Xs, "cacheProperties", [...yn, "points"]), E(Xs, "ATTRIBUTE_NAMES", [...cr]), j.setClass(Xs), j.setSVGClass(Xs);
4511
4511
  class Bc extends Xs {
4512
4512
  isOpen() {
4513
4513
  return !1;
4514
4514
  }
4515
4515
  }
4516
- T(Bc, "ownDefaults", rb), T(Bc, "type", "Polygon"), j.setClass(Bc), j.setSVGClass(Bc);
4516
+ E(Bc, "ownDefaults", rb), E(Bc, "type", "Polygon"), j.setClass(Bc), j.setSVGClass(Bc);
4517
4517
  const ob = ["fontSize", "fontWeight", "fontFamily", "fontStyle"], ab = ["underline", "overline", "linethrough"], hb = [...ob, "lineHeight", "text", "charSpacing", "textAlign", "styles", "path", "pathStartOffset", "pathSide", "pathAlign"], lb = [...hb, ...ab, "textBackgroundColor", "direction"], Ew = [...ob, ...ab, Le, "strokeWidth", Vt, "deltaY", "textBackgroundColor"], kw = { _reNewline: np, _reSpacesAndTabs: /[ \t\r]/g, _reSpaceAndTab: /[ \t\r]/, _reWords: /\S+/g, fontSize: 40, fontWeight: "normal", fontFamily: "Times New Roman", underline: !1, overline: !1, linethrough: !1, textAlign: ut, fontStyle: "normal", lineHeight: 1.16, superscript: { size: 0.6, baseline: -0.35 }, subscript: { size: 0.6, baseline: 0.11 }, textBackgroundColor: "", stroke: null, shadow: null, path: void 0, pathStartOffset: 0, pathSide: ut, pathAlign: "baseline", _fontSizeFraction: 0.222, offsets: { underline: 0.1, linethrough: -0.315, overline: -0.88 }, _fontSizeMult: 1.13, charSpacing: 0, deltaY: 0, direction: "ltr", CACHE_FONT_SIZE: 400, MIN_TEXT_WIDTH: 2 }, Si = "justify", sd = "justify-left", Uh = "justify-right", Yh = "justify-center";
4518
4518
  class cb extends Se {
4519
4519
  isEmptyStyles(t) {
@@ -4555,7 +4555,7 @@ class cb extends Se {
4555
4555
  _extendStyles(t, e) {
4556
4556
  const { lineIndex: s, charIndex: i } = this.get2DCursorLocation(t);
4557
4557
  this._getLineStyle(s) || this._setLineStyle(s);
4558
- const n = up(A(A({}, this._getStyleDeclaration(s, i)), e), (r) => r !== void 0);
4558
+ const n = up(T(T({}, this._getStyleDeclaration(s, i)), e), (r) => r !== void 0);
4559
4559
  this._setStyleDeclaration(s, i, n);
4560
4560
  }
4561
4561
  getSelectionStyles(t, e, s) {
@@ -4577,7 +4577,7 @@ class cb extends Se {
4577
4577
  return i && (s = i[e]) !== null && s !== void 0 ? s : {};
4578
4578
  }
4579
4579
  getCompleteStyleDeclaration(t, e) {
4580
- return A(A({}, No(this, this.constructor._styleProperties)), this._getStyleDeclaration(t, e));
4580
+ return T(T({}, No(this, this.constructor._styleProperties)), this._getStyleDeclaration(t, e));
4581
4581
  }
4582
4582
  _setStyleDeclaration(t, e, s) {
4583
4583
  this.styles[t][e] = s;
@@ -4595,7 +4595,7 @@ class cb extends Se {
4595
4595
  delete this.styles[t];
4596
4596
  }
4597
4597
  }
4598
- T(cb, "_styleProperties", Ew);
4598
+ E(cb, "_styleProperties", Ew);
4599
4599
  const Mw = / +/g, Pw = /"/g;
4600
4600
  function cg(a, t, e, s, i) {
4601
4601
  return " ".concat(function(n, r) {
@@ -4609,10 +4609,10 @@ const Dw = ["textAnchor", "textDecoration", "dx", "dy", "top", "left", "fontSize
4609
4609
  let ug;
4610
4610
  class ve extends cb {
4611
4611
  static getDefaults() {
4612
- return A(A({}, super.getDefaults()), ve.ownDefaults);
4612
+ return T(T({}, super.getDefaults()), ve.ownDefaults);
4613
4613
  }
4614
4614
  constructor(t, e) {
4615
- super(), T(this, "__charBounds", []), Object.assign(this, ve.ownDefaults), this.setOptions(e), this.styles || (this.styles = {}), this.text = t, this.initialized = !0, this.path && this.setPathInfo(), this.initDimensions(), this.setCoords();
4615
+ super(), E(this, "__charBounds", []), Object.assign(this, ve.ownDefaults), this.setOptions(e), this.styles || (this.styles = {}), this.text = t, this.initialized = !0, this.path && this.setPathInfo(), this.initDimensions(), this.setCoords();
4616
4616
  }
4617
4617
  setPathInfo() {
4618
4618
  const t = this.path;
@@ -4801,7 +4801,7 @@ class ve extends cb {
4801
4801
  const o = this.getHeightOfLine(r), h = this.textAlign.includes(Si), c = this.path, u = !h && this.charSpacing === 0 && this.isEmptyStyles(r) && !c, d = this.direction === "ltr", g = this.direction === "ltr" ? 1 : -1, f = e.direction;
4802
4802
  let p, b, _, y, x, C = "", S = 0;
4803
4803
  if (e.save(), f !== this.direction && (e.canvas.setAttribute("dir", d ? "ltr" : "rtl"), e.direction = d ? "ltr" : "rtl", e.textAlign = d ? ut : It), n -= o * this._fontSizeFraction / this.lineHeight, u) return this._renderChar(t, e, r, 0, s.join(""), i, n), void e.restore();
4804
- for (let k = 0, M = s.length - 1; k <= M; k++) y = k === M || this.charSpacing || c, C += s[k], _ = this.__charBounds[r][k], S === 0 ? (i += g * (_.kernedWidth - _.width), S += _.width) : S += _.kernedWidth, h && !y && this._reSpaceAndTab.test(s[k]) && (y = !0), y || (p = p || this.getCompleteStyleDeclaration(r, k), b = this.getCompleteStyleDeclaration(r, k + 1), y = Gd(p, b, !1)), y && (c ? (e.save(), e.translate(_.renderLeft, _.renderTop), e.rotate(_.angle), this._renderChar(t, e, r, k, C, -S / 2, 0), e.restore()) : (x = i, this._renderChar(t, e, r, k, C, x, n)), C = "", p = b, i += g * S, S = 0);
4804
+ for (let k = 0, D = s.length - 1; k <= D; k++) y = k === D || this.charSpacing || c, C += s[k], _ = this.__charBounds[r][k], S === 0 ? (i += g * (_.kernedWidth - _.width), S += _.width) : S += _.kernedWidth, h && !y && this._reSpaceAndTab.test(s[k]) && (y = !0), y || (p = p || this.getCompleteStyleDeclaration(r, k), b = this.getCompleteStyleDeclaration(r, k + 1), y = Gd(p, b, !1)), y && (c ? (e.save(), e.translate(_.renderLeft, _.renderTop), e.rotate(_.angle), this._renderChar(t, e, r, k, C, -S / 2, 0), e.restore()) : (x = i, this._renderChar(t, e, r, k, C, x, n)), C = "", p = b, i += g * S, S = 0);
4805
4805
  e.restore();
4806
4806
  }
4807
4807
  _applyPatternGradientTransformText(t) {
@@ -4877,19 +4877,19 @@ class ve extends cb {
4877
4877
  const d = this._textLines[h], g = u / this.lineHeight, f = this._getLineLeftOffset(h);
4878
4878
  let p, b, _ = 0, y = 0, x = this.getValueOfPropertyAt(h, 0, e), C = this.getValueOfPropertyAt(h, 0, Vt);
4879
4879
  const S = s + g * (1 - this._fontSizeFraction);
4880
- let k = this.getHeightOfChar(h, 0), M = this.getValueOfPropertyAt(h, 0, "deltaY");
4881
- for (let P = 0, O = d.length; P < O; P++) {
4882
- const L = this.__charBounds[h][P];
4883
- p = this.getValueOfPropertyAt(h, P, e), b = this.getValueOfPropertyAt(h, P, Vt);
4884
- const R = this.getHeightOfChar(h, P), U = this.getValueOfPropertyAt(h, P, "deltaY");
4885
- if (n && p && b) t.save(), t.fillStyle = C, t.translate(L.renderLeft, L.renderTop), t.rotate(L.angle), t.fillRect(-L.kernedWidth / 2, o * R + U, L.kernedWidth, this.fontSize / 15), t.restore();
4886
- else if ((p !== x || b !== C || R !== k || U !== M) && y > 0) {
4887
- let z = i + f + _;
4888
- this.direction === "rtl" && (z = this.width - z - y), x && C && (t.fillStyle = C, t.fillRect(z, S + o * k + M, y, this.fontSize / 15)), _ = L.left, y = L.width, x = p, C = b, k = R, M = U;
4889
- } else y += L.kernedWidth;
4880
+ let k = this.getHeightOfChar(h, 0), D = this.getValueOfPropertyAt(h, 0, "deltaY");
4881
+ for (let M = 0, O = d.length; M < O; M++) {
4882
+ const R = this.__charBounds[h][M];
4883
+ p = this.getValueOfPropertyAt(h, M, e), b = this.getValueOfPropertyAt(h, M, Vt);
4884
+ const L = this.getHeightOfChar(h, M), X = this.getValueOfPropertyAt(h, M, "deltaY");
4885
+ if (n && p && b) t.save(), t.fillStyle = C, t.translate(R.renderLeft, R.renderTop), t.rotate(R.angle), t.fillRect(-R.kernedWidth / 2, o * L + X, R.kernedWidth, this.fontSize / 15), t.restore();
4886
+ else if ((p !== x || b !== C || L !== k || X !== D) && y > 0) {
4887
+ let U = i + f + _;
4888
+ this.direction === "rtl" && (U = this.width - U - y), x && C && (t.fillStyle = C, t.fillRect(U, S + o * k + D, y, this.fontSize / 15)), _ = R.left, y = R.width, x = p, C = b, k = L, D = X;
4889
+ } else y += R.kernedWidth;
4890
4890
  }
4891
- let E = i + f + _;
4892
- this.direction === "rtl" && (E = this.width - E - y), t.fillStyle = b, p && b && t.fillRect(E, S + o * k + M, y - r, this.fontSize / 15), s += u;
4891
+ let A = i + f + _;
4892
+ this.direction === "rtl" && (A = this.width - A - y), t.fillStyle = b, p && b && t.fillRect(A, S + o * k + D, y - r, this.fontSize / 15), s += u;
4893
4893
  }
4894
4894
  this._removeShadow(t);
4895
4895
  }
@@ -4913,7 +4913,7 @@ class ve extends cb {
4913
4913
  }
4914
4914
  toObject() {
4915
4915
  let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
4916
- return A(A({}, super.toObject([...lb, ...t])), {}, { styles: I0(this.styles, this.text) }, this.path ? { path: this.path.toObject() } : {});
4916
+ return T(T({}, super.toObject([...lb, ...t])), {}, { styles: I0(this.styles, this.text) }, this.path ? { path: this.path.toObject() } : {});
4917
4917
  }
4918
4918
  set(t, e) {
4919
4919
  const { textLayoutProperties: s } = this.constructor;
@@ -4927,15 +4927,15 @@ class ve extends cb {
4927
4927
  return 1;
4928
4928
  }
4929
4929
  static async fromElement(t, e, s) {
4930
- const i = _n(t, ve.ATTRIBUTE_NAMES, s), n = A(A({}, e), i), { textAnchor: r = ut, textDecoration: o = "", dx: h = 0, dy: c = 0, top: u = 0, left: d = 0, fontSize: g = ip, strokeWidth: f = 1 } = n, p = At(n, Dw), b = new this((t.textContent || "").replace(/^\s+|\s+$|\n+/g, "").replace(/\s+/g, " "), A({ left: d + h, top: u + c, underline: o.includes("underline"), overline: o.includes("overline"), linethrough: o.includes("line-through"), strokeWidth: 0, fontSize: g }, p)), _ = b.getScaledHeight() / b.height, y = ((b.height + b.strokeWidth) * b.lineHeight - b.height) * _, x = b.getScaledHeight() + y;
4930
+ const i = _n(t, ve.ATTRIBUTE_NAMES, s), n = T(T({}, e), i), { textAnchor: r = ut, textDecoration: o = "", dx: h = 0, dy: c = 0, top: u = 0, left: d = 0, fontSize: g = ip, strokeWidth: f = 1 } = n, p = At(n, Dw), b = new this((t.textContent || "").replace(/^\s+|\s+$|\n+/g, "").replace(/\s+/g, " "), T({ left: d + h, top: u + c, underline: o.includes("underline"), overline: o.includes("overline"), linethrough: o.includes("line-through"), strokeWidth: 0, fontSize: g }, p)), _ = b.getScaledHeight() / b.height, y = ((b.height + b.strokeWidth) * b.lineHeight - b.height) * _, x = b.getScaledHeight() + y;
4931
4931
  let C = 0;
4932
4932
  return r === K && (C = b.getScaledWidth() / 2), r === It && (C = b.getScaledWidth()), b.set({ left: b.left - C, top: b.top - (x - b.fontSize * (0.07 + b._fontSizeFraction)) / b.lineHeight, strokeWidth: f }), b;
4933
4933
  }
4934
4934
  static fromObject(t) {
4935
- return this._fromObject(A(A({}, t), {}, { styles: N0(t.styles || {}, t.text) }), { extraParam: "text" });
4935
+ return this._fromObject(T(T({}, t), {}, { styles: N0(t.styles || {}, t.text) }), { extraParam: "text" });
4936
4936
  }
4937
4937
  }
4938
- T(ve, "textLayoutProperties", hb), T(ve, "cacheProperties", [...yn, ...lb]), T(ve, "ownDefaults", kw), T(ve, "type", "Text"), T(ve, "genericFonts", ["serif", "sans-serif", "monospace", "cursive", "fantasy", "system-ui", "ui-serif", "ui-sans-serif", "ui-monospace", "ui-rounded", "math", "emoji", "fangsong"]), T(ve, "ATTRIBUTE_NAMES", cr.concat("x", "y", "dx", "dy", "font-family", "font-style", "font-weight", "font-size", "letter-spacing", "text-decoration", "text-anchor")), D0(ve, [class extends w0 {
4938
+ E(ve, "textLayoutProperties", hb), E(ve, "cacheProperties", [...yn, ...lb]), E(ve, "ownDefaults", kw), E(ve, "type", "Text"), E(ve, "genericFonts", ["serif", "sans-serif", "monospace", "cursive", "fantasy", "system-ui", "ui-serif", "ui-sans-serif", "ui-monospace", "ui-rounded", "math", "emoji", "fangsong"]), E(ve, "ATTRIBUTE_NAMES", cr.concat("x", "y", "dx", "dy", "font-family", "font-style", "font-weight", "font-size", "letter-spacing", "text-decoration", "text-anchor")), D0(ve, [class extends w0 {
4939
4939
  _toSVG() {
4940
4940
  const a = this._getSVGLeftTopOffsets(), t = this._getSVGTextAndBg(a.textTop, a.textLeft);
4941
4941
  return this._wrapSVGTextAndBg(t);
@@ -4997,7 +4997,7 @@ T(ve, "textLayoutProperties", hb), T(ve, "cacheProperties", [...yn, ...lb]), T(v
4997
4997
  }]), j.setClass(ve), j.setSVGClass(ve);
4998
4998
  class Ow {
4999
4999
  constructor(t) {
5000
- T(this, "target", void 0), T(this, "__mouseDownInPlace", !1), T(this, "__dragStartFired", !1), T(this, "__isDraggingOver", !1), T(this, "__dragStartSelection", void 0), T(this, "__dragImageDisposer", void 0), T(this, "_dispose", void 0), this.target = t;
5000
+ E(this, "target", void 0), E(this, "__mouseDownInPlace", !1), E(this, "__dragStartFired", !1), E(this, "__isDraggingOver", !1), E(this, "__dragStartSelection", void 0), E(this, "__dragImageDisposer", void 0), E(this, "_dispose", void 0), this.target = t;
5001
5001
  const e = [this.target.on("dragenter", this.dragEnterHandler.bind(this)), this.target.on("dragover", this.dragOverHandler.bind(this)), this.target.on("dragleave", this.dragLeaveHandler.bind(this)), this.target.on("dragend", this.dragEndHandler.bind(this)), this.target.on("drop", this.dropHandler.bind(this))];
5002
5002
  this._dispose = () => {
5003
5003
  e.forEach((s) => s()), this._dispose = void 0;
@@ -5023,7 +5023,7 @@ class Ow {
5023
5023
  setDragImage(t, e) {
5024
5024
  var s;
5025
5025
  let { selectionStart: i, selectionEnd: n } = e;
5026
- const r = this.target, o = r.canvas, h = new D(r.flipX ? -1 : 1, r.flipY ? -1 : 1), c = r._getCursorBoundaries(i), u = new D(c.left + c.leftOffset, c.top + c.topOffset).multiply(h).transform(r.calcTransformMatrix()), d = o.getScenePoint(t).subtract(u), g = r.getCanvasRetinaScaling(), f = r.getBoundingRect(), p = u.subtract(new D(f.left, f.top)), b = o.viewportTransform, _ = p.add(d).transform(b, !0), y = r.backgroundColor, x = _p(r.styles);
5026
+ const r = this.target, o = r.canvas, h = new P(r.flipX ? -1 : 1, r.flipY ? -1 : 1), c = r._getCursorBoundaries(i), u = new P(c.left + c.leftOffset, c.top + c.topOffset).multiply(h).transform(r.calcTransformMatrix()), d = o.getScenePoint(t).subtract(u), g = r.getCanvasRetinaScaling(), f = r.getBoundingRect(), p = u.subtract(new P(f.left, f.top)), b = o.viewportTransform, _ = p.add(d).transform(b, !0), y = r.backgroundColor, x = _p(r.styles);
5027
5027
  r.backgroundColor = "";
5028
5028
  const C = { stroke: "transparent", fill: "transparent", textBackgroundColor: "transparent" };
5029
5029
  r.setSelectionStyles(C, 0, i), r.setSelectionStyles(C, n, r.text.length), r.dirty = !0;
@@ -5036,7 +5036,7 @@ class Ow {
5036
5036
  this.__dragStartFired = !0;
5037
5037
  const e = this.target, s = this.isActive();
5038
5038
  if (s && t.dataTransfer) {
5039
- const i = this.__dragStartSelection = { selectionStart: e.selectionStart, selectionEnd: e.selectionEnd }, n = e._text.slice(i.selectionStart, i.selectionEnd).join(""), r = A({ text: e.text, value: n }, i);
5039
+ const i = this.__dragStartSelection = { selectionStart: e.selectionStart, selectionEnd: e.selectionEnd }, n = e._text.slice(i.selectionStart, i.selectionEnd).join(""), r = T({ text: e.text, value: n }, i);
5040
5040
  t.dataTransfer.setData("text/plain", n), t.dataTransfer.setData("application/fabric", JSON.stringify({ value: n, styles: e.getSelectionStyles(i.selectionStart, i.selectionEnd, !0) })), t.dataTransfer.effectAllowed = "copyMove", this.setDragImage(t, r);
5041
5041
  }
5042
5042
  return e.abortCursorAnimation(), s;
@@ -5098,7 +5098,7 @@ class Ow {
5098
5098
  const wm = /[ \n\.,;!\?\-]/;
5099
5099
  class Rw extends ve {
5100
5100
  constructor() {
5101
- super(...arguments), T(this, "_currentCursorOpacity", 1);
5101
+ super(...arguments), E(this, "_currentCursorOpacity", 1);
5102
5102
  }
5103
5103
  initBehavior() {
5104
5104
  this._tick = this._tick.bind(this), this._onTickComplete = this._onTickComplete.bind(this), this.updateSelectionOnMouseMove = this.updateSelectionOnMouseMove.bind(this);
@@ -5226,7 +5226,7 @@ class Rw extends ve {
5226
5226
  }
5227
5227
  _calcTextareaPosition() {
5228
5228
  if (!this.canvas) return { left: "1px", top: "1px" };
5229
- const t = this.inCompositionMode ? this.compositionStart : this.selectionStart, e = this._getCursorBoundaries(t), s = this.get2DCursorLocation(t), i = s.lineIndex, n = s.charIndex, r = this.getValueOfPropertyAt(i, n, "fontSize") * this.lineHeight, o = e.leftOffset, h = this.getCanvasRetinaScaling(), c = this.canvas.upperCanvasEl, u = c.width / h, d = c.height / h, g = u - r, f = d - r, p = new D(e.left + o, e.top + e.topOffset + r).transform(this.calcTransformMatrix()).transform(this.canvas.viewportTransform).multiply(new D(c.clientWidth / u, c.clientHeight / d));
5229
+ const t = this.inCompositionMode ? this.compositionStart : this.selectionStart, e = this._getCursorBoundaries(t), s = this.get2DCursorLocation(t), i = s.lineIndex, n = s.charIndex, r = this.getValueOfPropertyAt(i, n, "fontSize") * this.lineHeight, o = e.leftOffset, h = this.getCanvasRetinaScaling(), c = this.canvas.upperCanvasEl, u = c.width / h, d = c.height / h, g = u - r, f = d - r, p = new P(e.left + o, e.top + e.topOffset + r).transform(this.calcTransformMatrix()).transform(this.canvas.viewportTransform).multiply(new P(c.clientWidth / u, c.clientHeight / d));
5230
5230
  return p.x < 0 && (p.x = 0), p.x > g && (p.x = g), p.y < 0 && (p.y = 0), p.y > f && (p.y = f), p.x += this.canvas._offset.left, p.y += this.canvas._offset.top, { left: "".concat(p.x, "px"), top: "".concat(p.y, "px"), fontSize: "".concat(r, "px"), charHeight: r };
5231
5231
  }
5232
5232
  _saveEditingProps() {
@@ -5285,24 +5285,24 @@ class Rw extends ve {
5285
5285
  g >= e && (h = !0, n[g - e] = this.styles[t][d], o && e === 0 || delete this.styles[t][d]);
5286
5286
  }
5287
5287
  let u = !1;
5288
- for (h && !o && (this.styles[t + s] = n, u = !0), (u || r > e) && s--; s > 0; ) i && i[s - 1] ? this.styles[t + s] = { 0: A({}, i[s - 1]) } : c ? this.styles[t + s] = { 0: A({}, c) } : delete this.styles[t + s], s--;
5288
+ for (h && !o && (this.styles[t + s] = n, u = !0), (u || r > e) && s--; s > 0; ) i && i[s - 1] ? this.styles[t + s] = { 0: T({}, i[s - 1]) } : c ? this.styles[t + s] = { 0: T({}, c) } : delete this.styles[t + s], s--;
5289
5289
  this._forceClearCache = !0;
5290
5290
  }
5291
5291
  insertCharStyleObject(t, e, s, i) {
5292
5292
  this.styles || (this.styles = {});
5293
- const n = this.styles[t], r = n ? A({}, n) : {};
5293
+ const n = this.styles[t], r = n ? T({}, n) : {};
5294
5294
  s || (s = 1);
5295
5295
  for (const h in r) {
5296
5296
  const c = parseInt(h, 10);
5297
5297
  c >= e && (n[c + s] = r[c], r[c - s] || delete n[c]);
5298
5298
  }
5299
5299
  if (this._forceClearCache = !0, i) {
5300
- for (; s--; ) Object.keys(i[s]).length && (this.styles[t] || (this.styles[t] = {}), this.styles[t][e + s] = A({}, i[s]));
5300
+ for (; s--; ) Object.keys(i[s]).length && (this.styles[t] || (this.styles[t] = {}), this.styles[t][e + s] = T({}, i[s]));
5301
5301
  return;
5302
5302
  }
5303
5303
  if (!n) return;
5304
5304
  const o = n[e ? e - 1 : 1];
5305
- for (; o && s--; ) this.styles[t][e + s] = A({}, o);
5305
+ for (; o && s--; ) this.styles[t][e + s] = T({}, o);
5306
5306
  }
5307
5307
  insertNewStyleBlock(t, e, s) {
5308
5308
  const i = this.get2DCursorLocation(e, !0), n = [0];
@@ -5485,7 +5485,7 @@ class Lw extends Rw {
5485
5485
  const dg = (a) => !!a.button;
5486
5486
  class Fw extends Lw {
5487
5487
  constructor() {
5488
- super(...arguments), T(this, "draggableTextDelegate", void 0);
5488
+ super(...arguments), E(this, "draggableTextDelegate", void 0);
5489
5489
  }
5490
5490
  initBehavior() {
5491
5491
  this.on("mousedown", this._mouseDownHandler), this.on("mousedown:before", this._mouseDownHandlerBefore), this.on("mouseup", this.mouseUpHandler), this.on("mousedblclick", this.doubleClickHandler), this.on("tripleclick", this.tripleClickHandler), this.__lastClickTime = +/* @__PURE__ */ new Date(), this.__lastLastClickTime = +/* @__PURE__ */ new Date(), this.__lastPointer = {}, this.on("mousedown", this.onMouseDown), this.draggableTextDelegate = new Ow(this), super.initBehavior();
@@ -5537,7 +5537,7 @@ class Fw extends Lw {
5537
5537
  t.shiftKey ? this.setSelectionStartEndWithShift(s, i, e) : (this.selectionStart = e, this.selectionEnd = e), this.isEditing && (this._fireSelectionChanged(), this._updateTextarea());
5538
5538
  }
5539
5539
  getSelectionStartFromPointer(t) {
5540
- const e = this.canvas.getScenePoint(t).transform(Ye(this.calcTransformMatrix())).add(new D(-this._getLeftOffset(), -this._getTopOffset()));
5540
+ const e = this.canvas.getScenePoint(t).transform(Ye(this.calcTransformMatrix())).add(new P(-this._getLeftOffset(), -this._getTopOffset()));
5541
5541
  let s = 0, i = 0, n = 0;
5542
5542
  for (let c = 0; c < this._textLines.length && s <= e.y; c++) s += this.getHeightOfLine(c), n = c, c > 0 && (i += this._textLines[c - 1].length + this.missingNewlineOffset(c - 1));
5543
5543
  let r = Math.abs(this._getLineLeftOffset(n));
@@ -5553,17 +5553,17 @@ class Fw extends Lw {
5553
5553
  return Math.min(this.flipX ? o - i : i, this._text.length);
5554
5554
  }
5555
5555
  }
5556
- const Hc = "moveCursorUp", Gc = "moveCursorDown", zc = "moveCursorLeft", Vc = "moveCursorRight", Xc = "exitEditing", Iw = A({ selectionStart: 0, selectionEnd: 0, selectionColor: "rgba(17,119,255,0.3)", isEditing: !1, editable: !0, editingBorderColor: "rgba(102,153,255,0.25)", cursorWidth: 2, cursorColor: "", cursorDelay: 1e3, cursorDuration: 600, caching: !0, hiddenTextareaContainer: null, keysMap: { 9: Xc, 27: Xc, 33: Hc, 34: Gc, 35: Vc, 36: zc, 37: zc, 38: Hc, 39: Vc, 40: Gc }, keysMapRtl: { 9: Xc, 27: Xc, 33: Hc, 34: Gc, 35: zc, 36: Vc, 37: Vc, 38: Hc, 39: zc, 40: Gc }, ctrlKeysMapDown: { 65: "selectAll" }, ctrlKeysMapUp: { 67: "copy", 88: "cut" } }, { _selectionDirection: null, _reSpace: /\s|\r?\n/, inCompositionMode: !1 });
5556
+ const Hc = "moveCursorUp", Gc = "moveCursorDown", zc = "moveCursorLeft", Vc = "moveCursorRight", Xc = "exitEditing", Iw = T({ selectionStart: 0, selectionEnd: 0, selectionColor: "rgba(17,119,255,0.3)", isEditing: !1, editable: !0, editingBorderColor: "rgba(102,153,255,0.25)", cursorWidth: 2, cursorColor: "", cursorDelay: 1e3, cursorDuration: 600, caching: !0, hiddenTextareaContainer: null, keysMap: { 9: Xc, 27: Xc, 33: Hc, 34: Gc, 35: Vc, 36: zc, 37: zc, 38: Hc, 39: Vc, 40: Gc }, keysMapRtl: { 9: Xc, 27: Xc, 33: Hc, 34: Gc, 35: zc, 36: Vc, 37: Vc, 38: Hc, 39: zc, 40: Gc }, ctrlKeysMapDown: { 65: "selectAll" }, ctrlKeysMapUp: { 67: "copy", 88: "cut" } }, { _selectionDirection: null, _reSpace: /\s|\r?\n/, inCompositionMode: !1 });
5557
5557
  class un extends Fw {
5558
5558
  static getDefaults() {
5559
- return A(A({}, super.getDefaults()), un.ownDefaults);
5559
+ return T(T({}, super.getDefaults()), un.ownDefaults);
5560
5560
  }
5561
5561
  get type() {
5562
5562
  const t = super.type;
5563
5563
  return t === "itext" ? "i-text" : t;
5564
5564
  }
5565
5565
  constructor(t, e) {
5566
- super(t, A(A({}, un.ownDefaults), e)), this.initBehavior();
5566
+ super(t, T(T({}, un.ownDefaults), e)), this.initBehavior();
5567
5567
  }
5568
5568
  _set(t, e) {
5569
5569
  return this.isEditing && this._savedProps && t in this._savedProps ? (this._savedProps[t] = e, this) : (t === "canvas" && (this.canvas instanceof Ng && this.canvas.textEditingManager.remove(this), e instanceof Ng && e.textEditingManager.add(this)), super._set(t, e));
@@ -5663,13 +5663,13 @@ class un extends Fw {
5663
5663
  if (f === c && (y = this.__charBounds[c][d].left), f >= c && f < u) x = r && !this.isEndOfWrapping(f) ? this.width : this.getLineWidth(f) || 5;
5664
5664
  else if (f === u) if (g === 0) x = this.__charBounds[u][g].left;
5665
5665
  else {
5666
- const E = this._getWidthOfCharSpacing();
5667
- x = this.__charBounds[u][g - 1].left + this.__charBounds[u][g - 1].width - E;
5666
+ const A = this._getWidthOfCharSpacing();
5667
+ x = this.__charBounds[u][g - 1].left + this.__charBounds[u][g - 1].width - A;
5668
5668
  }
5669
5669
  _ = b, (this.lineHeight < 1 || f === u && this.lineHeight > 1) && (b /= this.lineHeight);
5670
5670
  let C = s.left + p + y, S = b, k = 0;
5671
- const M = x - y;
5672
- this.inCompositionMode ? (t.fillStyle = this.compositionColor || "black", S = 1, k = b) : t.fillStyle = this.selectionColor, this.direction === "rtl" && (this.textAlign === It || this.textAlign === Si || this.textAlign === Uh ? C = this.width - C - M : this.textAlign === ut || this.textAlign === sd ? C = s.left + p - x : this.textAlign !== K && this.textAlign !== Yh || (C = s.left + p - x)), t.fillRect(C, s.top + s.topOffset + k, M, S), s.topOffset += _;
5671
+ const D = x - y;
5672
+ this.inCompositionMode ? (t.fillStyle = this.compositionColor || "black", S = 1, k = b) : t.fillStyle = this.selectionColor, this.direction === "rtl" && (this.textAlign === It || this.textAlign === Si || this.textAlign === Uh ? C = this.width - C - D : this.textAlign === ut || this.textAlign === sd ? C = s.left + p - x : this.textAlign !== K && this.textAlign !== Yh || (C = s.left + p - x)), t.fillRect(C, s.top + s.topOffset + k, D, S), s.topOffset += _;
5673
5673
  }
5674
5674
  }
5675
5675
  getCurrentCharFontSize() {
@@ -5688,13 +5688,13 @@ class un extends Fw {
5688
5688
  this.exitEditingImpl(), this.draggableTextDelegate.dispose(), super.dispose();
5689
5689
  }
5690
5690
  }
5691
- T(un, "ownDefaults", Iw), T(un, "type", "IText"), j.setClass(un), j.setClass(un, "i-text");
5691
+ E(un, "ownDefaults", Iw), E(un, "type", "IText"), j.setClass(un), j.setClass(un, "i-text");
5692
5692
  class xr extends un {
5693
5693
  static getDefaults() {
5694
- return A(A({}, super.getDefaults()), xr.ownDefaults);
5694
+ return T(T({}, super.getDefaults()), xr.ownDefaults);
5695
5695
  }
5696
5696
  constructor(t, e) {
5697
- super(t, A(A({}, xr.ownDefaults), e));
5697
+ super(t, T(T({}, xr.ownDefaults), e));
5698
5698
  }
5699
5699
  static createControls() {
5700
5700
  return { controls: __() };
@@ -5822,7 +5822,7 @@ class xr extends un {
5822
5822
  return super.toObject(["minWidth", "splitByGrapheme", ...t]);
5823
5823
  }
5824
5824
  }
5825
- T(xr, "type", "Textbox"), T(xr, "textLayoutProperties", [...un.textLayoutProperties, "width"]), T(xr, "ownDefaults", { minWidth: 20, dynamicMinWidth: 2, lockScalingFlip: !0, noScaleCache: !1, _wordJoiners: /[ \t\r]/, splitByGrapheme: !1 }), j.setClass(xr);
5825
+ E(xr, "type", "Textbox"), E(xr, "textLayoutProperties", [...un.textLayoutProperties, "width"]), E(xr, "ownDefaults", { minWidth: 20, dynamicMinWidth: 2, lockScalingFlip: !0, noScaleCache: !1, _wordJoiners: /[ \t\r]/, splitByGrapheme: !1 }), j.setClass(xr);
5826
5826
  class xm extends zd {
5827
5827
  shouldPerformLayout(t) {
5828
5828
  return !!t.target.clipPath && super.shouldPerformLayout(t);
@@ -5833,27 +5833,27 @@ class xm extends zd {
5833
5833
  calcLayoutResult(t, e) {
5834
5834
  const { target: s } = t, { clipPath: i, group: n } = s;
5835
5835
  if (!i || !this.shouldPerformLayout(t)) return;
5836
- const { width: r, height: o } = Ai(B0(s, i)), h = new D(r, o);
5836
+ const { width: r, height: o } = Ai(B0(s, i)), h = new P(r, o);
5837
5837
  if (i.absolutePositioned)
5838
5838
  return { center: Po(i.getRelativeCenterPoint(), void 0, n ? n.calcTransformMatrix() : void 0), size: h };
5839
5839
  {
5840
5840
  const c = i.getRelativeCenterPoint().transform(s.calcOwnMatrix(), !0);
5841
5841
  if (this.shouldPerformLayout(t)) {
5842
- const { center: u = new D(), correction: d = new D() } = this.calcBoundingBox(e, t) || {};
5842
+ const { center: u = new P(), correction: d = new P() } = this.calcBoundingBox(e, t) || {};
5843
5843
  return { center: u.add(c), correction: d.subtract(c), size: h };
5844
5844
  }
5845
5845
  return { center: s.getRelativeCenterPoint().add(c), size: h };
5846
5846
  }
5847
5847
  }
5848
5848
  }
5849
- T(xm, "type", "clip-path"), j.setClass(xm);
5849
+ E(xm, "type", "clip-path"), j.setClass(xm);
5850
5850
  class Sm extends zd {
5851
5851
  getInitialSize(t, e) {
5852
5852
  let { target: s } = t, { size: i } = e;
5853
- return new D(s.width || i.x, s.height || i.y);
5853
+ return new P(s.width || i.x, s.height || i.y);
5854
5854
  }
5855
5855
  }
5856
- T(Sm, "type", "fixed"), j.setClass(Sm);
5856
+ E(Sm, "type", "fixed"), j.setClass(Sm);
5857
5857
  class Nw extends tl {
5858
5858
  subscribeTargets(t) {
5859
5859
  const e = t.target;
@@ -5870,7 +5870,7 @@ class Nw extends tl {
5870
5870
  }
5871
5871
  class Sr extends Ti {
5872
5872
  static getDefaults() {
5873
- return A(A({}, super.getDefaults()), Sr.ownDefaults);
5873
+ return T(T({}, super.getDefaults()), Sr.ownDefaults);
5874
5874
  }
5875
5875
  constructor() {
5876
5876
  let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
@@ -5925,15 +5925,15 @@ class Sr extends Ti {
5925
5925
  }
5926
5926
  _renderControls(t, e, s) {
5927
5927
  t.save(), t.globalAlpha = this.isMoving ? this.borderOpacityWhenMoving : 1;
5928
- const i = A(A({ hasControls: !1 }, s), {}, { forActiveSelection: !0 });
5928
+ const i = T(T({ hasControls: !1 }, s), {}, { forActiveSelection: !0 });
5929
5929
  for (let n = 0; n < this._objects.length; n++) this._objects[n]._renderControls(t, i);
5930
5930
  super._renderControls(t, e), t.restore();
5931
5931
  }
5932
5932
  }
5933
- T(Sr, "type", "ActiveSelection"), T(Sr, "ownDefaults", { multiSelectionStacking: "canvas-stacking" }), j.setClass(Sr), j.setClass(Sr, "activeSelection");
5933
+ E(Sr, "type", "ActiveSelection"), E(Sr, "ownDefaults", { multiSelectionStacking: "canvas-stacking" }), j.setClass(Sr), j.setClass(Sr, "activeSelection");
5934
5934
  class jw {
5935
5935
  constructor() {
5936
- T(this, "resources", {});
5936
+ E(this, "resources", {});
5937
5937
  }
5938
5938
  applyFilters(t, e, s, i, n) {
5939
5939
  const r = n.getContext("2d");
@@ -5950,7 +5950,7 @@ class jw {
5950
5950
  class ub {
5951
5951
  constructor() {
5952
5952
  let { tileSize: t = ot.textureSize } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
5953
- T(this, "aPosition", new Float32Array([0, 0, 0, 1, 1, 0, 1, 1])), T(this, "resources", {}), this.tileSize = t, this.setupGLContext(t, t), this.captureGPUInfo();
5953
+ E(this, "aPosition", new Float32Array([0, 0, 0, 1, 1, 0, 1, 1])), E(this, "resources", {}), this.tileSize = t, this.setupGLContext(t, t), this.captureGPUInfo();
5954
5954
  }
5955
5955
  setupGLContext(t, e) {
5956
5956
  this.dispose(), this.createWebGLCanvas(t, e);
@@ -6031,10 +6031,10 @@ function fg() {
6031
6031
  const Hw = ["filters", "resizeFilter", "src", "crossOrigin", "type"], db = ["cropX", "cropY"];
6032
6032
  class _e extends Se {
6033
6033
  static getDefaults() {
6034
- return A(A({}, super.getDefaults()), _e.ownDefaults);
6034
+ return T(T({}, super.getDefaults()), _e.ownDefaults);
6035
6035
  }
6036
6036
  constructor(t, e) {
6037
- super(), T(this, "_lastScaleX", 1), T(this, "_lastScaleY", 1), T(this, "_filterScalingX", 1), T(this, "_filterScalingY", 1), this.filters = [], Object.assign(this, _e.ownDefaults), this.setOptions(e), this.cacheKey = "texture".concat(nr()), this.setElement(typeof t == "string" ? (this.canvas && Ws(this.canvas.getElement()) || dh()).getElementById(t) : t, e);
6037
+ super(), E(this, "_lastScaleX", 1), E(this, "_lastScaleY", 1), E(this, "_filterScalingX", 1), E(this, "_filterScalingY", 1), this.filters = [], Object.assign(this, _e.ownDefaults), this.setOptions(e), this.cacheKey = "texture".concat(nr()), this.setElement(typeof t == "string" ? (this.canvas && Ws(this.canvas.getElement()) || dh()).getElementById(t) : t, e);
6038
6038
  }
6039
6039
  getElement() {
6040
6040
  return this._element;
@@ -6071,7 +6071,7 @@ class _e extends Se {
6071
6071
  const e = [];
6072
6072
  return this.filters.forEach((s) => {
6073
6073
  s && e.push(s.toObject());
6074
- }), A(A({}, super.toObject([...db, ...t])), {}, { src: this.getSrc(), crossOrigin: this.getCrossOrigin(), filters: e }, this.resizeFilter ? { resizeFilter: this.resizeFilter.toObject() } : {});
6074
+ }), T(T({}, super.toObject([...db, ...t])), {}, { src: this.getSrc(), crossOrigin: this.getCrossOrigin(), filters: e }, this.resizeFilter ? { resizeFilter: this.resizeFilter.toObject() } : {});
6075
6075
  }
6076
6076
  hasCrop() {
6077
6077
  return !!this.cropX || !!this.cropY || this.width < this._element.width || this.height < this._element.height;
@@ -6161,9 +6161,9 @@ class _e extends Se {
6161
6161
  }
6162
6162
  static fromObject(t, e) {
6163
6163
  let { filters: s, resizeFilter: i, src: n, crossOrigin: r, type: o } = t, h = At(t, Hw);
6164
- return Promise.all([Wh(n, A(A({}, e), {}, { crossOrigin: r })), s && ch(s, e), i && ch([i], e), Pc(h, e)]).then((c) => {
6164
+ return Promise.all([Wh(n, T(T({}, e), {}, { crossOrigin: r })), s && ch(s, e), i && ch([i], e), Pc(h, e)]).then((c) => {
6165
6165
  let [u, d = [], [g] = [], f = {}] = c;
6166
- return new this(u, A(A({}, h), {}, { src: n, filters: d, resizeFilter: g }, f));
6166
+ return new this(u, T(T({}, h), {}, { src: n, filters: d, resizeFilter: g }, f));
6167
6167
  });
6168
6168
  }
6169
6169
  static fromURL(t) {
@@ -6197,7 +6197,7 @@ function pg(a) {
6197
6197
  } else s = a, s.removeAttribute("x"), s.removeAttribute("y"), e = s.getAttribute("transform") + e;
6198
6198
  return s.setAttribute("transform", e), y;
6199
6199
  }
6200
- T(_e, "type", "Image"), T(_e, "cacheProperties", [...yn, ...db]), T(_e, "ownDefaults", { strokeWidth: 0, srcFromAttribute: !1, minimumScaleTrigger: 0.5, cropX: 0, cropY: 0, imageSmoothing: !0 }), T(_e, "CSS_CANVAS", "canvas-img"), T(_e, "ATTRIBUTE_NAMES", [...cr, "x", "y", "width", "height", "preserveAspectRatio", "xlink:href", "crossOrigin", "image-rendering"]), j.setClass(_e), j.setSVGClass(_e);
6200
+ E(_e, "type", "Image"), E(_e, "cacheProperties", [...yn, ...db]), E(_e, "ownDefaults", { strokeWidth: 0, srcFromAttribute: !1, minimumScaleTrigger: 0.5, cropX: 0, cropY: 0, imageSmoothing: !0 }), E(_e, "CSS_CANVAS", "canvas-img"), E(_e, "ATTRIBUTE_NAMES", [...cr, "x", "y", "width", "height", "preserveAspectRatio", "xlink:href", "crossOrigin", "image-rendering"]), j.setClass(_e), j.setSVGClass(_e);
6201
6201
  const id = (a) => a.tagName.replace("svg:", ""), Gw = Nd(["pattern", "defs", "symbol", "metadata", "clipPath", "mask", "desc"]);
6202
6202
  function gb(a, t) {
6203
6203
  let e, s, i, n, r = [];
@@ -6234,7 +6234,7 @@ function Xw(a) {
6234
6234
  h[d] = g;
6235
6235
  }
6236
6236
  (r = o[0].trim()).split(",").forEach((u) => {
6237
- (u = u.replace(/^svg/i, "").trim()) !== "" && (i[u] = A(A({}, i[u] || {}), h));
6237
+ (u = u.replace(/^svg/i, "").trim()) !== "" && (i[u] = T(T({}, i[u] || {}), h));
6238
6238
  });
6239
6239
  });
6240
6240
  }
@@ -6276,7 +6276,7 @@ class Ww {
6276
6276
  resolveGradient(t, e, s) {
6277
6277
  const i = this.extractPropertyDefinition(t, s, this.gradientDefs);
6278
6278
  if (i) {
6279
- const n = e.getAttribute(s + "-opacity"), r = Ah.fromElement(i, t, A(A({}, this.options), {}, { opacity: n }));
6279
+ const n = e.getAttribute(s + "-opacity"), r = Ah.fromElement(i, t, T(T({}, this.options), {}, { opacity: n }));
6280
6280
  t.set(s, r);
6281
6281
  }
6282
6282
  }
@@ -6292,7 +6292,7 @@ class Ww {
6292
6292
  const c = await Promise.all(i.map((x) => Cm(x).fromElement(x, this.options, this.cssRules).then((C) => (du(C), C.fillRule = C.clipRule, delete C.clipRule, C)))), u = c.length === 1 ? c[0] : new Ti(c), d = Nt(n, u.calcTransformMatrix());
6293
6293
  u.clipPath && await this.resolveClipPath(u, o, r.getAttribute("clip-path") ? o : void 0);
6294
6294
  const { scaleX: g, scaleY: f, angle: p, skewX: b, translateX: _, translateY: y } = Do(d);
6295
- u.set({ flipX: !1, flipY: !1 }), u.set({ scaleX: g, scaleY: f, angle: p, skewX: b, skewY: 0 }), u.setPositionByOrigin(new D(_, y), K, K), t.clipPath = u;
6295
+ u.set({ flipX: !1, flipY: !1 }), u.set({ scaleX: g, scaleY: f, angle: p, skewX: b, skewY: 0 }), u.setPositionByOrigin(new P(_, y), K, K), t.clipPath = u;
6296
6296
  } else delete t.clipPath;
6297
6297
  }
6298
6298
  }
@@ -6313,36 +6313,36 @@ async function Uw(a, t) {
6313
6313
  let x = y.cloneNode(!0);
6314
6314
  const C = x.attributes, S = {};
6315
6315
  for (const O of C) O.value && (S[O.name] = O.value);
6316
- const { x: k = 0, y: M = 0, transform: E = "" } = b, P = "".concat(E, " ").concat(S.transform || "", " translate(").concat(k, ", ").concat(M, ")");
6316
+ const { x: k = 0, y: D = 0, transform: A = "" } = b, M = "".concat(A, " ").concat(S.transform || "", " translate(").concat(k, ", ").concat(D, ")");
6317
6317
  if (pg(x), /^svg$/i.test(x.nodeName)) {
6318
6318
  const O = x.ownerDocument.createElementNS(Pg, "g");
6319
- Object.entries(S).forEach((L) => {
6320
- let [R, U] = L;
6321
- return O.setAttributeNS(Pg, R, U);
6319
+ Object.entries(S).forEach((R) => {
6320
+ let [L, X] = R;
6321
+ return O.setAttributeNS(Pg, L, X);
6322
6322
  }), O.append(...x.childNodes), x = O;
6323
6323
  }
6324
6324
  for (const O of p) {
6325
6325
  if (!O) continue;
6326
- const { name: L, value: R } = O;
6327
- if (!g.includes(L)) if (L === "style") {
6328
- const U = {};
6329
- Rg(R, U), Object.entries(S).forEach((V) => {
6330
- let [rt, F] = V;
6331
- U[rt] = F;
6332
- }), Rg(S.style || "", U);
6333
- const z = Object.entries(U).map((V) => V.join(":")).join(";");
6334
- x.setAttribute(L, z);
6335
- } else !S[L] && x.setAttribute(L, R);
6326
+ const { name: R, value: L } = O;
6327
+ if (!g.includes(R)) if (R === "style") {
6328
+ const X = {};
6329
+ Rg(L, X), Object.entries(S).forEach((G) => {
6330
+ let [rt, F] = G;
6331
+ X[rt] = F;
6332
+ }), Rg(S.style || "", X);
6333
+ const U = Object.entries(X).map((G) => G.join(":")).join(";");
6334
+ x.setAttribute(R, U);
6335
+ } else !S[R] && x.setAttribute(R, L);
6336
6336
  }
6337
- x.setAttribute("transform", P), x.setAttribute("instantiated_by_use", "1"), x.removeAttribute("id"), f.parentNode.replaceChild(x, f);
6337
+ x.setAttribute("transform", M), x.setAttribute("instantiated_by_use", "1"), x.removeAttribute("id"), f.parentNode.replaceChild(x, f);
6338
6338
  }
6339
6339
  })(a);
6340
- const n = Array.from(i.getElementsByTagName("*")), r = A(A({}, pg(i)), {}, { crossOrigin: e, signal: s }), o = n.filter((u) => (pg(u), Am(u) && !function(d) {
6340
+ const n = Array.from(i.getElementsByTagName("*")), r = T(T({}, pg(i)), {}, { crossOrigin: e, signal: s }), o = n.filter((u) => (pg(u), Am(u) && !function(d) {
6341
6341
  let g = d;
6342
6342
  for (; g && (g = g.parentElement); ) if (g && g.nodeName && Gw.test(id(g)) && !g.getAttribute("instantiated_by_use")) return !0;
6343
6343
  return !1;
6344
6344
  }(u)));
6345
- if (!o || o && !o.length) return A(A({}, Bg()), {}, { options: r, allElements: n });
6345
+ if (!o || o && !o.length) return T(T({}, Bg()), {}, { options: r, allElements: n });
6346
6346
  const h = {};
6347
6347
  return n.filter((u) => id(u) === "clipPath").forEach((u) => {
6348
6348
  u.setAttribute("originalTransform", u.getAttribute("transform") || "");
@@ -6457,7 +6457,7 @@ class Qt {
6457
6457
  }
6458
6458
  toObject() {
6459
6459
  const t = Object.keys(this.constructor.defaults || {});
6460
- return A({ type: this.type }, t.reduce((e, s) => (e[s] = this[s], e), {}));
6460
+ return T({ type: this.type }, t.reduce((e, s) => (e[s] = this[s], e), {}));
6461
6461
  }
6462
6462
  toJSON() {
6463
6463
  return this.toObject();
@@ -6466,7 +6466,7 @@ class Qt {
6466
6466
  return new this(At(t, Kw));
6467
6467
  }
6468
6468
  }
6469
- T(Qt, "type", "BaseFilter"), T(Qt, "uniformLocations", []);
6469
+ E(Qt, "type", "BaseFilter"), E(Qt, "uniformLocations", []);
6470
6470
  const Jw = { multiply: `gl_FragColor.rgb *= uColor.rgb;
6471
6471
  `, screen: `gl_FragColor.rgb = 1.0 - (1.0 - gl_FragColor.rgb) * (1.0 - uColor.rgb);
6472
6472
  `, add: `gl_FragColor.rgb += uColor.rgb;
@@ -6559,7 +6559,7 @@ class Wc extends Qt {
6559
6559
  s[0] = this.alpha * s[0] / 255, s[1] = this.alpha * s[1] / 255, s[2] = this.alpha * s[2] / 255, s[3] = this.alpha, t.uniform4fv(e.uColor, s);
6560
6560
  }
6561
6561
  }
6562
- T(Wc, "defaults", { color: "#F95C63", mode: "multiply", alpha: 1 }), T(Wc, "type", "BlendColor"), T(Wc, "uniformLocations", ["uColor"]), j.setClass(Wc);
6562
+ E(Wc, "defaults", { color: "#F95C63", mode: "multiply", alpha: 1 }), E(Wc, "type", "BlendColor"), E(Wc, "uniformLocations", ["uColor"]), j.setClass(Wc);
6563
6563
  const Zw = { multiply: `
6564
6564
  precision highp float;
6565
6565
  uniform sampler2D uTexture;
@@ -6641,14 +6641,14 @@ class Uc extends Qt {
6641
6641
  t.uniform1i(e.uImage, 1), t.uniformMatrix3fv(e.uTransformMatrix, !1, s);
6642
6642
  }
6643
6643
  toObject() {
6644
- return A(A({}, super.toObject()), {}, { image: this.image && this.image.toObject() });
6644
+ return T(T({}, super.toObject()), {}, { image: this.image && this.image.toObject() });
6645
6645
  }
6646
6646
  static async fromObject(t, e) {
6647
6647
  let { type: s, image: i } = t, n = At(t, tx);
6648
- return _e.fromObject(i, e).then((r) => new this(A(A({}, n), {}, { image: r })));
6648
+ return _e.fromObject(i, e).then((r) => new this(T(T({}, n), {}, { image: r })));
6649
6649
  }
6650
6650
  }
6651
- T(Uc, "type", "BlendImage"), T(Uc, "defaults", { mode: "multiply", alpha: 1 }), T(Uc, "uniformLocations", ["uTransformMatrix", "uImage"]), j.setClass(Uc);
6651
+ E(Uc, "type", "BlendImage"), E(Uc, "defaults", { mode: "multiply", alpha: 1 }), E(Uc, "uniformLocations", ["uTransformMatrix", "uImage"]), j.setClass(Uc);
6652
6652
  class Yc extends Qt {
6653
6653
  getFragmentSource() {
6654
6654
  return `
@@ -6711,7 +6711,7 @@ class Yc extends Qt {
6711
6711
  return this.horizontal ? e[0] = s : e[1] = s, e;
6712
6712
  }
6713
6713
  }
6714
- T(Yc, "type", "Blur"), T(Yc, "defaults", { blur: 0 }), T(Yc, "uniformLocations", ["uDelta"]), j.setClass(Yc);
6714
+ E(Yc, "type", "Blur"), E(Yc, "defaults", { blur: 0 }), E(Yc, "uniformLocations", ["uDelta"]), j.setClass(Yc);
6715
6715
  class $c extends Qt {
6716
6716
  getFragmentSource() {
6717
6717
  return `
@@ -6738,7 +6738,7 @@ class $c extends Qt {
6738
6738
  t.uniform1f(e.uBrightness, this.brightness);
6739
6739
  }
6740
6740
  }
6741
- T($c, "type", "Brightness"), T($c, "defaults", { brightness: 0 }), T($c, "uniformLocations", ["uBrightness"]), j.setClass($c);
6741
+ E($c, "type", "Brightness"), E($c, "defaults", { brightness: 0 }), E($c, "uniformLocations", ["uBrightness"]), j.setClass($c);
6742
6742
  const pb = { matrix: [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0], colorsOnly: !0 };
6743
6743
  class Jo extends Qt {
6744
6744
  getFragmentSource() {
@@ -6770,19 +6770,19 @@ class Jo extends Qt {
6770
6770
  t.uniformMatrix4fv(e.uColorMatrix, !1, i), t.uniform4fv(e.uConstants, n);
6771
6771
  }
6772
6772
  toObject() {
6773
- return A(A({}, super.toObject()), {}, { matrix: [...this.matrix] });
6773
+ return T(T({}, super.toObject()), {}, { matrix: [...this.matrix] });
6774
6774
  }
6775
6775
  }
6776
6776
  function jo(a, t) {
6777
6777
  var e;
6778
- const s = (T(e = class extends Jo {
6778
+ const s = (E(e = class extends Jo {
6779
6779
  toObject() {
6780
6780
  return { type: this.type, colorsOnly: this.colorsOnly };
6781
6781
  }
6782
- }, "type", a), T(e, "defaults", { colorsOnly: !1, matrix: t }), e);
6782
+ }, "type", a), E(e, "defaults", { colorsOnly: !1, matrix: t }), e);
6783
6783
  return j.setClass(s, a), s;
6784
6784
  }
6785
- T(Jo, "type", "ColorMatrix"), T(Jo, "defaults", pb), T(Jo, "uniformLocations", ["uColorMatrix", "uConstants"]), j.setClass(Jo);
6785
+ E(Jo, "type", "ColorMatrix"), E(Jo, "defaults", pb), E(Jo, "uniformLocations", ["uColorMatrix", "uConstants"]), j.setClass(Jo);
6786
6786
  jo("Brownie", [0.5997, 0.34553, -0.27082, 0, 0.186, -0.0377, 0.86095, 0.15059, 0, -0.1449, 0.24113, -0.07441, 0.44972, 0, -0.02965, 0, 0, 0, 1, 0]);
6787
6787
  jo("Vintage", [0.62793, 0.32021, -0.03965, 0, 0.03784, 0.02578, 0.64411, 0.03259, 0, 0.02926, 0.0466, -0.08512, 0.52416, 0, 0.02023, 0, 0, 0, 1, 0]);
6788
6788
  jo("Kodachrome", [1.12855, -0.39673, -0.03992, 0, 0.24991, -0.16404, 1.08352, -0.05498, 0, 0.09698, -0.16786, -0.56034, 1.60148, 0, 0.13972, 0, 0, 0, 1, 0]);
@@ -6810,7 +6810,7 @@ class Tm extends Qt {
6810
6810
  return Promise.all((t.subFilters || []).map((s) => j.getClass(s.type).fromObject(s, e))).then((s) => new this({ subFilters: s }));
6811
6811
  }
6812
6812
  }
6813
- T(Tm, "type", "Composed"), j.setClass(Tm);
6813
+ E(Tm, "type", "Composed"), j.setClass(Tm);
6814
6814
  class qc extends Qt {
6815
6815
  getFragmentSource() {
6816
6816
  return `
@@ -6837,7 +6837,7 @@ class qc extends Qt {
6837
6837
  t.uniform1f(e.uContrast, this.contrast);
6838
6838
  }
6839
6839
  }
6840
- T(qc, "type", "Contrast"), T(qc, "defaults", { contrast: 0 }), T(qc, "uniformLocations", ["uContrast"]), j.setClass(qc);
6840
+ E(qc, "type", "Contrast"), E(qc, "defaults", { contrast: 0 }), E(qc, "uniformLocations", ["uContrast"]), j.setClass(qc);
6841
6841
  const ex = { Convolute_3_1: `
6842
6842
  precision highp float;
6843
6843
  uniform sampler2D uTexture;
@@ -6992,9 +6992,9 @@ class Kc extends Qt {
6992
6992
  }
6993
6993
  applyTo2d(t) {
6994
6994
  const e = t.imageData, s = e.data, i = this.matrix, n = Math.round(Math.sqrt(i.length)), r = Math.floor(n / 2), o = e.width, h = e.height, c = t.ctx.createImageData(o, h), u = c.data, d = this.opaque ? 1 : 0;
6995
- let g, f, p, b, _, y, x, C, S, k, M, E, P;
6996
- for (M = 0; M < h; M++) for (k = 0; k < o; k++) {
6997
- for (_ = 4 * (M * o + k), g = 0, f = 0, p = 0, b = 0, P = 0; P < n; P++) for (E = 0; E < n; E++) x = M + P - r, y = k + E - r, x < 0 || x >= h || y < 0 || y >= o || (C = 4 * (x * o + y), S = i[P * n + E], g += s[C] * S, f += s[C + 1] * S, p += s[C + 2] * S, d || (b += s[C + 3] * S));
6995
+ let g, f, p, b, _, y, x, C, S, k, D, A, M;
6996
+ for (D = 0; D < h; D++) for (k = 0; k < o; k++) {
6997
+ for (_ = 4 * (D * o + k), g = 0, f = 0, p = 0, b = 0, M = 0; M < n; M++) for (A = 0; A < n; A++) x = D + M - r, y = k + A - r, x < 0 || x >= h || y < 0 || y >= o || (C = 4 * (x * o + y), S = i[M * n + A], g += s[C] * S, f += s[C + 1] * S, p += s[C + 2] * S, d || (b += s[C + 3] * S));
6998
6998
  u[_] = g, u[_ + 1] = f, u[_ + 2] = p, u[_ + 3] = d ? s[_ + 3] : b;
6999
6999
  }
7000
7000
  t.imageData = c;
@@ -7003,10 +7003,10 @@ class Kc extends Qt {
7003
7003
  t.uniform1fv(e.uMatrix, this.matrix);
7004
7004
  }
7005
7005
  toObject() {
7006
- return A(A({}, super.toObject()), {}, { opaque: this.opaque, matrix: [...this.matrix] });
7006
+ return T(T({}, super.toObject()), {}, { opaque: this.opaque, matrix: [...this.matrix] });
7007
7007
  }
7008
7008
  }
7009
- T(Kc, "type", "Convolute"), T(Kc, "defaults", { opaque: !1, matrix: [0, 0, 0, 0, 1, 0, 0, 0, 0] }), T(Kc, "uniformLocations", ["uMatrix", "uOpaque", "uHalfSize", "uSize"]), j.setClass(Kc);
7009
+ E(Kc, "type", "Convolute"), E(Kc, "defaults", { opaque: !1, matrix: [0, 0, 0, 0, 1, 0, 0, 0, 0] }), E(Kc, "uniformLocations", ["uMatrix", "uOpaque", "uHalfSize", "uSize"]), j.setClass(Kc);
7010
7010
  const mb = "Gamma";
7011
7011
  class Qc extends Qt {
7012
7012
  getFragmentSource() {
@@ -7049,7 +7049,7 @@ class Qc extends Qt {
7049
7049
  return { type: mb, gamma: this.gamma.concat() };
7050
7050
  }
7051
7051
  }
7052
- T(Qc, "type", mb), T(Qc, "defaults", { gamma: [1, 1, 1] }), T(Qc, "uniformLocations", ["uGamma"]), j.setClass(Qc);
7052
+ E(Qc, "type", mb), E(Qc, "defaults", { gamma: [1, 1, 1] }), E(Qc, "uniformLocations", ["uGamma"]), j.setClass(Qc);
7053
7053
  const sx = { average: `
7054
7054
  precision highp float;
7055
7055
  uniform sampler2D uTexture;
@@ -7111,8 +7111,8 @@ class Jc extends Qt {
7111
7111
  return !1;
7112
7112
  }
7113
7113
  }
7114
- T(Jc, "type", "Grayscale"), T(Jc, "defaults", { mode: "average" }), T(Jc, "uniformLocations", ["uMode"]), j.setClass(Jc);
7115
- const ix = A(A({}, pb), {}, { rotation: 0 });
7114
+ E(Jc, "type", "Grayscale"), E(Jc, "defaults", { mode: "average" }), E(Jc, "uniformLocations", ["uMode"]), j.setClass(Jc);
7115
+ const ix = T(T({}, pb), {}, { rotation: 0 });
7116
7116
  class bg extends Jo {
7117
7117
  calculateMatrix() {
7118
7118
  const t = this.rotation * Math.PI, e = qs(t), s = Ks(t), i = 1 / 3, n = Math.sqrt(i) * s, r = 1 - e;
@@ -7128,7 +7128,7 @@ class bg extends Jo {
7128
7128
  return { type: this.type, rotation: this.rotation };
7129
7129
  }
7130
7130
  }
7131
- T(bg, "type", "HueRotation"), T(bg, "defaults", ix), j.setClass(bg);
7131
+ E(bg, "type", "HueRotation"), E(bg, "defaults", ix), j.setClass(bg);
7132
7132
  class Zc extends Qt {
7133
7133
  applyTo2d(t) {
7134
7134
  let { imageData: { data: e } } = t;
@@ -7162,7 +7162,7 @@ class Zc extends Qt {
7162
7162
  t.uniform1i(e.uInvert, Number(this.invert)), t.uniform1i(e.uAlpha, Number(this.alpha));
7163
7163
  }
7164
7164
  }
7165
- T(Zc, "type", "Invert"), T(Zc, "defaults", { alpha: !1, invert: !0 }), T(Zc, "uniformLocations", ["uInvert", "uAlpha"]), j.setClass(Zc);
7165
+ E(Zc, "type", "Invert"), E(Zc, "defaults", { alpha: !1, invert: !0 }), E(Zc, "uniformLocations", ["uInvert", "uAlpha"]), j.setClass(Zc);
7166
7166
  class tu extends Qt {
7167
7167
  getFragmentSource() {
7168
7168
  return `
@@ -7197,7 +7197,7 @@ class tu extends Qt {
7197
7197
  return this.noise === 0;
7198
7198
  }
7199
7199
  }
7200
- T(tu, "type", "Noise"), T(tu, "defaults", { noise: 0 }), T(tu, "uniformLocations", ["uNoise", "uSeed"]), j.setClass(tu);
7200
+ E(tu, "type", "Noise"), E(tu, "defaults", { noise: 0 }), E(tu, "uniformLocations", ["uNoise", "uSeed"]), j.setClass(tu);
7201
7201
  class eu extends Qt {
7202
7202
  applyTo2d(t) {
7203
7203
  let { imageData: { data: e, width: s, height: i } } = t;
@@ -7237,7 +7237,7 @@ class eu extends Qt {
7237
7237
  t.uniform1f(e.uBlocksize, this.blocksize);
7238
7238
  }
7239
7239
  }
7240
- T(eu, "type", "Pixelate"), T(eu, "defaults", { blocksize: 4 }), T(eu, "uniformLocations", ["uBlocksize"]), j.setClass(eu);
7240
+ E(eu, "type", "Pixelate"), E(eu, "defaults", { blocksize: 4 }), E(eu, "uniformLocations", ["uBlocksize"]), j.setClass(eu);
7241
7241
  class su extends Qt {
7242
7242
  getFragmentSource() {
7243
7243
  return `
@@ -7267,7 +7267,7 @@ void main() {
7267
7267
  t.uniform4fv(e.uLow, n), t.uniform4fv(e.uHigh, r);
7268
7268
  }
7269
7269
  }
7270
- T(su, "type", "RemoveColor"), T(su, "defaults", { color: "#FFFFFF", distance: 0.02, useAlpha: !1 }), T(su, "uniformLocations", ["uLow", "uHigh"]), j.setClass(su);
7270
+ E(su, "type", "RemoveColor"), E(su, "defaults", { color: "#FFFFFF", distance: 0.02, useAlpha: !1 }), E(su, "uniformLocations", ["uLow", "uHigh"]), j.setClass(su);
7271
7271
  class iu extends Qt {
7272
7272
  sendUniformData(t, e) {
7273
7273
  t.uniform2fv(e.uDelta, this.horizontal ? [1 / this.width, 0] : [0, 1 / this.height]), t.uniform1fv(e.uTaps, this.taps);
@@ -7351,43 +7351,43 @@ class iu extends Qt {
7351
7351
  lanczosResize(t, e, s, i, n) {
7352
7352
  const r = t.imageData.data, o = t.ctx.createImageData(i, n), h = o.data, c = this.lanczosCreate(this.lanczosLobes), u = this.rcpScaleX, d = this.rcpScaleY, g = 2 / this.rcpScaleX, f = 2 / this.rcpScaleY, p = Math.ceil(u * this.lanczosLobes / 2), b = Math.ceil(d * this.lanczosLobes / 2), _ = {}, y = { x: 0, y: 0 }, x = { x: 0, y: 0 };
7353
7353
  return function C(S) {
7354
- let k, M, E, P, O, L, R, U, z, V, rt;
7354
+ let k, D, A, M, O, R, L, X, U, G, rt;
7355
7355
  for (y.x = (S + 0.5) * u, x.x = Math.floor(y.x), k = 0; k < n; k++) {
7356
- for (y.y = (k + 0.5) * d, x.y = Math.floor(y.y), O = 0, L = 0, R = 0, U = 0, z = 0, M = x.x - p; M <= x.x + p; M++) if (!(M < 0 || M >= e)) {
7357
- V = Math.floor(1e3 * Math.abs(M - y.x)), _[V] || (_[V] = {});
7358
- for (let F = x.y - b; F <= x.y + b; F++) F < 0 || F >= s || (rt = Math.floor(1e3 * Math.abs(F - y.y)), _[V][rt] || (_[V][rt] = c(Math.sqrt(Math.pow(V * g, 2) + Math.pow(rt * f, 2)) / 1e3)), E = _[V][rt], E > 0 && (P = 4 * (F * e + M), O += E, L += E * r[P], R += E * r[P + 1], U += E * r[P + 2], z += E * r[P + 3]));
7356
+ for (y.y = (k + 0.5) * d, x.y = Math.floor(y.y), O = 0, R = 0, L = 0, X = 0, U = 0, D = x.x - p; D <= x.x + p; D++) if (!(D < 0 || D >= e)) {
7357
+ G = Math.floor(1e3 * Math.abs(D - y.x)), _[G] || (_[G] = {});
7358
+ for (let F = x.y - b; F <= x.y + b; F++) F < 0 || F >= s || (rt = Math.floor(1e3 * Math.abs(F - y.y)), _[G][rt] || (_[G][rt] = c(Math.sqrt(Math.pow(G * g, 2) + Math.pow(rt * f, 2)) / 1e3)), A = _[G][rt], A > 0 && (M = 4 * (F * e + D), O += A, R += A * r[M], L += A * r[M + 1], X += A * r[M + 2], U += A * r[M + 3]));
7359
7359
  }
7360
- P = 4 * (k * i + S), h[P] = L / O, h[P + 1] = R / O, h[P + 2] = U / O, h[P + 3] = z / O;
7360
+ M = 4 * (k * i + S), h[M] = R / O, h[M + 1] = L / O, h[M + 2] = X / O, h[M + 3] = U / O;
7361
7361
  }
7362
7362
  return ++S < i ? C(S) : o;
7363
7363
  }(0);
7364
7364
  }
7365
7365
  bilinearFiltering(t, e, s, i, n) {
7366
7366
  let r, o, h, c, u, d, g, f, p, b, _, y, x, C = 0;
7367
- const S = this.rcpScaleX, k = this.rcpScaleY, M = 4 * (e - 1), E = t.imageData.data, P = t.ctx.createImageData(i, n), O = P.data;
7368
- for (g = 0; g < n; g++) for (f = 0; f < i; f++) for (u = Math.floor(S * f), d = Math.floor(k * g), p = S * f - u, b = k * g - d, x = 4 * (d * e + u), _ = 0; _ < 4; _++) r = E[x + _], o = E[x + 4 + _], h = E[x + M + _], c = E[x + M + 4 + _], y = r * (1 - p) * (1 - b) + o * p * (1 - b) + h * b * (1 - p) + c * p * b, O[C++] = y;
7369
- return P;
7367
+ const S = this.rcpScaleX, k = this.rcpScaleY, D = 4 * (e - 1), A = t.imageData.data, M = t.ctx.createImageData(i, n), O = M.data;
7368
+ for (g = 0; g < n; g++) for (f = 0; f < i; f++) for (u = Math.floor(S * f), d = Math.floor(k * g), p = S * f - u, b = k * g - d, x = 4 * (d * e + u), _ = 0; _ < 4; _++) r = A[x + _], o = A[x + 4 + _], h = A[x + D + _], c = A[x + D + 4 + _], y = r * (1 - p) * (1 - b) + o * p * (1 - b) + h * b * (1 - p) + c * p * b, O[C++] = y;
7369
+ return M;
7370
7370
  }
7371
7371
  hermiteFastResize(t, e, s, i, n) {
7372
7372
  const r = this.rcpScaleX, o = this.rcpScaleY, h = Math.ceil(r / 2), c = Math.ceil(o / 2), u = t.imageData.data, d = t.ctx.createImageData(i, n), g = d.data;
7373
7373
  for (let f = 0; f < n; f++) for (let p = 0; p < i; p++) {
7374
7374
  const b = 4 * (p + f * i);
7375
- let _ = 0, y = 0, x = 0, C = 0, S = 0, k = 0, M = 0;
7376
- const E = (f + 0.5) * o;
7377
- for (let P = Math.floor(f * o); P < (f + 1) * o; P++) {
7378
- const O = Math.abs(E - (P + 0.5)) / c, L = (p + 0.5) * r, R = O * O;
7379
- for (let U = Math.floor(p * r); U < (p + 1) * r; U++) {
7380
- let z = Math.abs(L - (U + 0.5)) / h;
7381
- const V = Math.sqrt(R + z * z);
7382
- V > 1 && V < -1 || (_ = 2 * V * V * V - 3 * V * V + 1, _ > 0 && (z = 4 * (U + P * e), M += _ * u[z + 3], x += _, u[z + 3] < 255 && (_ = _ * u[z + 3] / 250), C += _ * u[z], S += _ * u[z + 1], k += _ * u[z + 2], y += _));
7375
+ let _ = 0, y = 0, x = 0, C = 0, S = 0, k = 0, D = 0;
7376
+ const A = (f + 0.5) * o;
7377
+ for (let M = Math.floor(f * o); M < (f + 1) * o; M++) {
7378
+ const O = Math.abs(A - (M + 0.5)) / c, R = (p + 0.5) * r, L = O * O;
7379
+ for (let X = Math.floor(p * r); X < (p + 1) * r; X++) {
7380
+ let U = Math.abs(R - (X + 0.5)) / h;
7381
+ const G = Math.sqrt(L + U * U);
7382
+ G > 1 && G < -1 || (_ = 2 * G * G * G - 3 * G * G + 1, _ > 0 && (U = 4 * (X + M * e), D += _ * u[U + 3], x += _, u[U + 3] < 255 && (_ = _ * u[U + 3] / 250), C += _ * u[U], S += _ * u[U + 1], k += _ * u[U + 2], y += _));
7383
7383
  }
7384
7384
  }
7385
- g[b] = C / y, g[b + 1] = S / y, g[b + 2] = k / y, g[b + 3] = M / x;
7385
+ g[b] = C / y, g[b + 1] = S / y, g[b + 2] = k / y, g[b + 3] = D / x;
7386
7386
  }
7387
7387
  return d;
7388
7388
  }
7389
7389
  }
7390
- T(iu, "type", "Resize"), T(iu, "defaults", { resizeType: "hermite", scaleX: 1, scaleY: 1, lanczosLobes: 3 }), T(iu, "uniformLocations", ["uDelta", "uTaps"]), j.setClass(iu);
7390
+ E(iu, "type", "Resize"), E(iu, "defaults", { resizeType: "hermite", scaleX: 1, scaleY: 1, lanczosLobes: 3 }), E(iu, "uniformLocations", ["uDelta", "uTaps"]), j.setClass(iu);
7391
7391
  class nu extends Qt {
7392
7392
  getFragmentSource() {
7393
7393
  return `
@@ -7421,7 +7421,7 @@ class nu extends Qt {
7421
7421
  return this.saturation === 0;
7422
7422
  }
7423
7423
  }
7424
- T(nu, "type", "Saturation"), T(nu, "defaults", { saturation: 0 }), T(nu, "uniformLocations", ["uSaturation"]), j.setClass(nu);
7424
+ E(nu, "type", "Saturation"), E(nu, "defaults", { saturation: 0 }), E(nu, "uniformLocations", ["uSaturation"]), j.setClass(nu);
7425
7425
  class ru extends Qt {
7426
7426
  getFragmentSource() {
7427
7427
  return `
@@ -7456,7 +7456,7 @@ class ru extends Qt {
7456
7456
  return this.vibrance === 0;
7457
7457
  }
7458
7458
  }
7459
- T(ru, "type", "Vibrance"), T(ru, "defaults", { vibrance: 0 }), T(ru, "uniformLocations", ["uVibrance"]), j.setClass(ru);
7459
+ E(ru, "type", "Vibrance"), E(ru, "defaults", { vibrance: 0 }), E(ru, "uniformLocations", ["uVibrance"]), j.setClass(ru);
7460
7460
  var $h = {};
7461
7461
  $h.d = (a, t) => {
7462
7462
  for (var e in t)
@@ -10858,58 +10858,58 @@ Ir = new WeakMap(), Fs = new WeakMap(), _t = new WeakMap(), ma = new WeakMap(),
10858
10858
  mustExec: !0
10859
10859
  });
10860
10860
  }, rf = function(t, e) {
10861
- const [s, i] = this.parentDimensions, n = this.x, r = this.y, o = this.width, h = this.height, c = tt.MIN_SIZE / s, u = tt.MIN_SIZE / i, d = w(this, $, _u).call(this, this.rotation), g = (F, G) => [d[0] * F + d[2] * G, d[1] * F + d[3] * G], f = w(this, $, _u).call(this, 360 - this.rotation), p = (F, G) => [f[0] * F + f[2] * G, f[1] * F + f[3] * G];
10861
+ const [s, i] = this.parentDimensions, n = this.x, r = this.y, o = this.width, h = this.height, c = tt.MIN_SIZE / s, u = tt.MIN_SIZE / i, d = w(this, $, _u).call(this, this.rotation), g = (F, z) => [d[0] * F + d[2] * z, d[1] * F + d[3] * z], f = w(this, $, _u).call(this, 360 - this.rotation), p = (F, z) => [f[0] * F + f[2] * z, f[1] * F + f[3] * z];
10862
10862
  let b, _, y = !1, x = !1;
10863
10863
  switch (t) {
10864
10864
  case "topLeft":
10865
- y = !0, b = (F, G) => [0, 0], _ = (F, G) => [F, G];
10865
+ y = !0, b = (F, z) => [0, 0], _ = (F, z) => [F, z];
10866
10866
  break;
10867
10867
  case "topMiddle":
10868
- b = (F, G) => [F / 2, 0], _ = (F, G) => [F / 2, G];
10868
+ b = (F, z) => [F / 2, 0], _ = (F, z) => [F / 2, z];
10869
10869
  break;
10870
10870
  case "topRight":
10871
- y = !0, b = (F, G) => [F, 0], _ = (F, G) => [0, G];
10871
+ y = !0, b = (F, z) => [F, 0], _ = (F, z) => [0, z];
10872
10872
  break;
10873
10873
  case "middleRight":
10874
- x = !0, b = (F, G) => [F, G / 2], _ = (F, G) => [0, G / 2];
10874
+ x = !0, b = (F, z) => [F, z / 2], _ = (F, z) => [0, z / 2];
10875
10875
  break;
10876
10876
  case "bottomRight":
10877
- y = !0, b = (F, G) => [F, G], _ = (F, G) => [0, 0];
10877
+ y = !0, b = (F, z) => [F, z], _ = (F, z) => [0, 0];
10878
10878
  break;
10879
10879
  case "bottomMiddle":
10880
- b = (F, G) => [F / 2, G], _ = (F, G) => [F / 2, 0];
10880
+ b = (F, z) => [F / 2, z], _ = (F, z) => [F / 2, 0];
10881
10881
  break;
10882
10882
  case "bottomLeft":
10883
- y = !0, b = (F, G) => [0, G], _ = (F, G) => [F, 0];
10883
+ y = !0, b = (F, z) => [0, z], _ = (F, z) => [F, 0];
10884
10884
  break;
10885
10885
  case "middleLeft":
10886
- x = !0, b = (F, G) => [0, G / 2], _ = (F, G) => [F, G / 2];
10886
+ x = !0, b = (F, z) => [0, z / 2], _ = (F, z) => [F, z / 2];
10887
10887
  break;
10888
10888
  }
10889
10889
  const C = b(o, h), S = _(o, h);
10890
10890
  let k = g(...S);
10891
- const M = tt._round(n + k[0]), E = tt._round(r + k[1]);
10892
- let P = 1, O = 1, L, R;
10891
+ const D = tt._round(n + k[0]), A = tt._round(r + k[1]);
10892
+ let M = 1, O = 1, R, L;
10893
10893
  if (e.fromKeyboard)
10894
10894
  ({
10895
- deltaX: L,
10896
- deltaY: R
10895
+ deltaX: R,
10896
+ deltaY: L
10897
10897
  } = e);
10898
10898
  else {
10899
10899
  const {
10900
10900
  screenX: F,
10901
- screenY: G
10901
+ screenY: z
10902
10902
  } = e, [it, Rt] = l(this, jr);
10903
- [L, R] = this.screenToPageTranslation(F - it, G - Rt), l(this, jr)[0] = F, l(this, jr)[1] = G;
10903
+ [R, L] = this.screenToPageTranslation(F - it, z - Rt), l(this, jr)[0] = F, l(this, jr)[1] = z;
10904
10904
  }
10905
- if ([L, R] = p(L / s, R / i), y) {
10905
+ if ([R, L] = p(R / s, L / i), y) {
10906
10906
  const F = Math.hypot(o, h);
10907
- P = O = Math.max(Math.min(Math.hypot(S[0] - C[0] - L, S[1] - C[1] - R) / F, 1 / o, 1 / h), c / o, u / h);
10908
- } else x ? P = Math.max(c, Math.min(1, Math.abs(S[0] - C[0] - L))) / o : O = Math.max(u, Math.min(1, Math.abs(S[1] - C[1] - R))) / h;
10909
- const U = tt._round(o * P), z = tt._round(h * O);
10910
- k = g(..._(U, z));
10911
- const V = M - k[0], rt = E - k[1];
10912
- l(this, Je) || m(this, Je, [this.x, this.y, this.width, this.height]), this.width = U, this.height = z, this.x = V, this.y = rt, this.setDims(s * U, i * z), this.fixAndSetPosition(), this._onResizing();
10907
+ M = O = Math.max(Math.min(Math.hypot(S[0] - C[0] - R, S[1] - C[1] - L) / F, 1 / o, 1 / h), c / o, u / h);
10908
+ } else x ? M = Math.max(c, Math.min(1, Math.abs(S[0] - C[0] - R))) / o : O = Math.max(u, Math.min(1, Math.abs(S[1] - C[1] - L))) / h;
10909
+ const X = tt._round(o * M), U = tt._round(h * O);
10910
+ k = g(..._(X, U));
10911
+ const G = D - k[0], rt = A - k[1];
10912
+ l(this, Je) || m(this, Je, [this.x, this.y, this.width, this.height]), this.width = X, this.height = U, this.x = G, this.y = rt, this.setDims(s * X, i * U), this.fixAndSetPosition(), this._onResizing();
10913
10913
  }, Gb = function() {
10914
10914
  var t;
10915
10915
  m(this, zi, {
@@ -10922,7 +10922,7 @@ Ir = new WeakMap(), Fs = new WeakMap(), _t = new WeakMap(), ma = new WeakMap(),
10922
10922
  let n = 0.7 * (s / e) + 1 - 0.7;
10923
10923
  if (n === 1)
10924
10924
  return;
10925
- const r = w(this, $, _u).call(this, this.rotation), o = (M, E) => [r[0] * M + r[2] * E, r[1] * M + r[3] * E], [h, c] = this.parentDimensions, u = this.x, d = this.y, g = this.width, f = this.height, p = tt.MIN_SIZE / h, b = tt.MIN_SIZE / c;
10925
+ const r = w(this, $, _u).call(this, this.rotation), o = (D, A) => [r[0] * D + r[2] * A, r[1] * D + r[3] * A], [h, c] = this.parentDimensions, u = this.x, d = this.y, g = this.width, f = this.height, p = tt.MIN_SIZE / h, b = tt.MIN_SIZE / c;
10926
10926
  n = Math.max(Math.min(n, 1 / g, 1 / f), p / g, b / f);
10927
10927
  const _ = tt._round(g * n), y = tt._round(f * n);
10928
10928
  if (_ === g && y === f)
@@ -11311,9 +11311,9 @@ class kx {
11311
11311
  function s(S, k) {
11312
11312
  return S.charCodeAt(k) << 24 | S.charCodeAt(k + 1) << 16 | S.charCodeAt(k + 2) << 8 | S.charCodeAt(k + 3) & 255;
11313
11313
  }
11314
- function i(S, k, M, E) {
11315
- const P = S.substring(0, k), O = S.substring(k + M);
11316
- return P + E + O;
11314
+ function i(S, k, D, A) {
11315
+ const M = S.substring(0, k), O = S.substring(k + D);
11316
+ return M + A + O;
11317
11317
  }
11318
11318
  let n, r;
11319
11319
  const o = this._document.createElement("canvas");
@@ -11916,17 +11916,17 @@ class Dx extends iv {
11916
11916
  let d = Math.round(0.2126 * c[0] + 0.7152 * c[1] + 0.0722 * c[2]), g = Math.round(0.2126 * u[0] + 0.7152 * u[1] + 0.0722 * u[2]), [f, p] = [n, r].map(w(this, N, Lh).bind(this));
11917
11917
  g < d && ([d, g, f, p] = [g, d, p, f]), l(this, N, Vo).style.color = "";
11918
11918
  const b = (C, S, k) => {
11919
- const M = new Array(256), E = (g - d) / k, P = C / 255, O = (S - C) / (255 * k);
11920
- let L = 0;
11921
- for (let R = 0; R <= k; R++) {
11922
- const U = Math.round(d + R * E), z = P + R * O;
11923
- for (let V = L; V <= U; V++)
11924
- M[V] = z;
11925
- L = U + 1;
11919
+ const D = new Array(256), A = (g - d) / k, M = C / 255, O = (S - C) / (255 * k);
11920
+ let R = 0;
11921
+ for (let L = 0; L <= k; L++) {
11922
+ const X = Math.round(d + L * A), U = M + L * O;
11923
+ for (let G = R; G <= X; G++)
11924
+ D[G] = U;
11925
+ R = X + 1;
11926
11926
  }
11927
- for (let R = L; R < 256; R++)
11928
- M[R] = M[L - 1];
11929
- return M.join(",");
11927
+ for (let L = R; L < 256; L++)
11928
+ D[L] = D[R - 1];
11929
+ return D.join(",");
11930
11930
  }, _ = `g_${l(this, Wi)}_hcm_${e}_filter`, y = h.filter = w(this, N, Wo).call(this, _);
11931
11931
  return w(this, N, cf).call(this, y), w(this, N, Rh).call(this, b(f[0], p[0], 5), b(f[1], p[1], 5), b(f[2], p[2], 5), y), h.url = w(this, N, Xo).call(this, _), h.url;
11932
11932
  }
@@ -12085,22 +12085,22 @@ function xg(a, t, e, s, i, n, r, o) {
12085
12085
  const f = (h[e] + t.offsetX) * t.scaleX, p = (h[e + 1] + t.offsetY) * t.scaleY, b = (h[s] + t.offsetX) * t.scaleX, _ = (h[s + 1] + t.offsetY) * t.scaleY, y = (h[i] + t.offsetX) * t.scaleX, x = (h[i + 1] + t.offsetY) * t.scaleY;
12086
12086
  if (p >= x)
12087
12087
  return;
12088
- const C = c[n], S = c[n + 1], k = c[n + 2], M = c[r], E = c[r + 1], P = c[r + 2], O = c[o], L = c[o + 1], R = c[o + 2], U = Math.round(p), z = Math.round(x);
12089
- let V, rt, F, G, it, Rt, Wt, ne;
12090
- for (let Bt = U; Bt <= z; Bt++) {
12088
+ const C = c[n], S = c[n + 1], k = c[n + 2], D = c[r], A = c[r + 1], M = c[r + 2], O = c[o], R = c[o + 1], L = c[o + 2], X = Math.round(p), U = Math.round(x);
12089
+ let G, rt, F, z, it, Rt, Wt, ne;
12090
+ for (let Bt = X; Bt <= U; Bt++) {
12091
12091
  if (Bt < _) {
12092
12092
  const ct = Bt < p ? 0 : (p - Bt) / (p - _);
12093
- V = f - (f - b) * ct, rt = C - (C - M) * ct, F = S - (S - E) * ct, G = k - (k - P) * ct;
12093
+ G = f - (f - b) * ct, rt = C - (C - D) * ct, F = S - (S - A) * ct, z = k - (k - M) * ct;
12094
12094
  } else {
12095
12095
  let ct;
12096
- Bt > x ? ct = 1 : _ === x ? ct = 0 : ct = (_ - Bt) / (_ - x), V = b - (b - y) * ct, rt = M - (M - O) * ct, F = E - (E - L) * ct, G = P - (P - R) * ct;
12096
+ Bt > x ? ct = 1 : _ === x ? ct = 0 : ct = (_ - Bt) / (_ - x), G = b - (b - y) * ct, rt = D - (D - O) * ct, F = A - (A - R) * ct, z = M - (M - L) * ct;
12097
12097
  }
12098
12098
  let yt;
12099
- Bt < p ? yt = 0 : Bt > x ? yt = 1 : yt = (p - Bt) / (p - x), it = f - (f - y) * yt, Rt = C - (C - O) * yt, Wt = S - (S - L) * yt, ne = k - (k - R) * yt;
12100
- const Ce = Math.round(Math.min(V, it)), ti = Math.round(Math.max(V, it));
12099
+ Bt < p ? yt = 0 : Bt > x ? yt = 1 : yt = (p - Bt) / (p - x), it = f - (f - y) * yt, Rt = C - (C - O) * yt, Wt = S - (S - R) * yt, ne = k - (k - L) * yt;
12100
+ const Ce = Math.round(Math.min(G, it)), ti = Math.round(Math.max(G, it));
12101
12101
  let Pt = d * Bt + Ce * 4;
12102
12102
  for (let ct = Ce; ct <= ti; ct++)
12103
- yt = (V - ct) / (V - it), yt < 0 ? yt = 0 : yt > 1 && (yt = 1), u[Pt++] = rt - (rt - Rt) * yt | 0, u[Pt++] = F - (F - Wt) * yt | 0, u[Pt++] = G - (G - ne) * yt | 0, u[Pt++] = 255;
12103
+ yt = (G - ct) / (G - it), yt < 0 ? yt = 0 : yt > 1 && (yt = 1), u[Pt++] = rt - (rt - Rt) * yt | 0, u[Pt++] = F - (F - Wt) * yt | 0, u[Pt++] = z - (z - ne) * yt | 0, u[Pt++] = 255;
12104
12104
  }
12105
12105
  }
12106
12106
  function Nx(a, t, e) {
@@ -12137,12 +12137,12 @@ class jx extends Op {
12137
12137
  scaleY: 1 / p
12138
12138
  }, _ = d + 2 * 2, y = g + 2 * 2, x = s.getCanvas("mesh", _, y), C = x.context, S = C.createImageData(d, g);
12139
12139
  if (e) {
12140
- const M = S.data;
12141
- for (let E = 0, P = M.length; E < P; E += 4)
12142
- M[E] = e[0], M[E + 1] = e[1], M[E + 2] = e[2], M[E + 3] = 255;
12140
+ const D = S.data;
12141
+ for (let A = 0, M = D.length; A < M; A += 4)
12142
+ D[A] = e[0], D[A + 1] = e[1], D[A + 2] = e[2], D[A + 3] = 255;
12143
12143
  }
12144
- for (const M of this._figures)
12145
- Nx(S, M, b);
12144
+ for (const D of this._figures)
12145
+ Nx(S, D, b);
12146
12146
  return C.putImageData(S, 2, 2), {
12147
12147
  canvas: x.canvas,
12148
12148
  offsetX: o - 2 * f,
@@ -12202,17 +12202,17 @@ const Om = {
12202
12202
  } = this;
12203
12203
  h = Math.abs(h), c = Math.abs(c), Yd("TilingType: " + n);
12204
12204
  const u = e[0], d = e[1], g = e[2], f = e[3], p = g - u, b = f - d, _ = W.singularValueDecompose2dScale(this.matrix), y = W.singularValueDecompose2dScale(this.baseTransform), x = _[0] * y[0], C = _[1] * y[1];
12205
- let S = p, k = b, M = !1, E = !1;
12206
- const P = Math.ceil(h * x), O = Math.ceil(c * C), L = Math.ceil(p * x), R = Math.ceil(b * C);
12207
- P >= L ? S = h : M = !0, O >= R ? k = c : E = !0;
12208
- const U = this.getSizeAndScale(S, this.ctx.canvas.width, x), z = this.getSizeAndScale(k, this.ctx.canvas.height, C), V = t.cachedCanvases.getCanvas("pattern", U.size, z.size), rt = V.context, F = o.createCanvasGraphics(rt);
12209
- if (F.groupLevel = t.groupLevel, this.setFillAndStrokeStyleToContext(F, i, r), rt.translate(-U.scale * u, -z.scale * d), F.transform(U.scale, 0, 0, z.scale, 0, 0), rt.save(), this.clipBbox(F, u, d, g, f), F.baseTransform = xt(F.ctx), F.executeOperatorList(s), F.endDrawing(), rt.restore(), M || E) {
12210
- const G = V.canvas;
12211
- M && (S = h), E && (k = c);
12212
- const it = this.getSizeAndScale(S, this.ctx.canvas.width, x), Rt = this.getSizeAndScale(k, this.ctx.canvas.height, C), Wt = it.size, ne = Rt.size, Bt = t.cachedCanvases.getCanvas("pattern-workaround", Wt, ne), yt = Bt.context, Ce = M ? Math.floor(p / h) : 0, ti = E ? Math.floor(b / c) : 0;
12205
+ let S = p, k = b, D = !1, A = !1;
12206
+ const M = Math.ceil(h * x), O = Math.ceil(c * C), R = Math.ceil(p * x), L = Math.ceil(b * C);
12207
+ M >= R ? S = h : D = !0, O >= L ? k = c : A = !0;
12208
+ const X = this.getSizeAndScale(S, this.ctx.canvas.width, x), U = this.getSizeAndScale(k, this.ctx.canvas.height, C), G = t.cachedCanvases.getCanvas("pattern", X.size, U.size), rt = G.context, F = o.createCanvasGraphics(rt);
12209
+ if (F.groupLevel = t.groupLevel, this.setFillAndStrokeStyleToContext(F, i, r), rt.translate(-X.scale * u, -U.scale * d), F.transform(X.scale, 0, 0, U.scale, 0, 0), rt.save(), this.clipBbox(F, u, d, g, f), F.baseTransform = xt(F.ctx), F.executeOperatorList(s), F.endDrawing(), rt.restore(), D || A) {
12210
+ const z = G.canvas;
12211
+ D && (S = h), A && (k = c);
12212
+ const it = this.getSizeAndScale(S, this.ctx.canvas.width, x), Rt = this.getSizeAndScale(k, this.ctx.canvas.height, C), Wt = it.size, ne = Rt.size, Bt = t.cachedCanvases.getCanvas("pattern-workaround", Wt, ne), yt = Bt.context, Ce = D ? Math.floor(p / h) : 0, ti = A ? Math.floor(b / c) : 0;
12213
12213
  for (let Pt = 0; Pt <= Ce; Pt++)
12214
12214
  for (let ct = 0; ct <= ti; ct++)
12215
- yt.drawImage(G, Wt * Pt, ne * ct, Wt, ne, 0, 0, Wt, ne);
12215
+ yt.drawImage(z, Wt * Pt, ne * ct, Wt, ne, 0, 0, Wt, ne);
12216
12216
  return {
12217
12217
  canvas: Bt.canvas,
12218
12218
  scaleX: it.scale,
@@ -12222,9 +12222,9 @@ const Om = {
12222
12222
  };
12223
12223
  }
12224
12224
  return {
12225
- canvas: V.canvas,
12226
- scaleX: U.scale,
12227
- scaleY: z.scale,
12225
+ canvas: G.canvas,
12226
+ scaleX: X.scale,
12227
+ scaleY: U.scale,
12228
12228
  offsetX: u,
12229
12229
  offsetY: d
12230
12230
  };
@@ -12355,12 +12355,12 @@ class Xx {
12355
12355
  function au(a, t, e, s, i, n, r, o, h, c) {
12356
12356
  const [u, d, g, f, p, b] = xt(a);
12357
12357
  if (d === 0 && g === 0) {
12358
- const x = r * u + p, C = Math.round(x), S = o * f + b, k = Math.round(S), M = (r + h) * u + p, E = Math.abs(Math.round(M) - C) || 1, P = (o + c) * f + b, O = Math.abs(Math.round(P) - k) || 1;
12359
- return a.setTransform(Math.sign(u), 0, 0, Math.sign(f), C, k), a.drawImage(t, e, s, i, n, 0, 0, E, O), a.setTransform(u, d, g, f, p, b), [E, O];
12358
+ const x = r * u + p, C = Math.round(x), S = o * f + b, k = Math.round(S), D = (r + h) * u + p, A = Math.abs(Math.round(D) - C) || 1, M = (o + c) * f + b, O = Math.abs(Math.round(M) - k) || 1;
12359
+ return a.setTransform(Math.sign(u), 0, 0, Math.sign(f), C, k), a.drawImage(t, e, s, i, n, 0, 0, A, O), a.setTransform(u, d, g, f, p, b), [A, O];
12360
12360
  }
12361
12361
  if (u === 0 && f === 0) {
12362
- const x = o * g + p, C = Math.round(x), S = r * d + b, k = Math.round(S), M = (o + c) * g + p, E = Math.abs(Math.round(M) - C) || 1, P = (r + h) * d + b, O = Math.abs(Math.round(P) - k) || 1;
12363
- return a.setTransform(0, Math.sign(d), Math.sign(g), 0, C, k), a.drawImage(t, e, s, i, n, 0, 0, O, E), a.setTransform(u, d, g, f, p, b), [O, E];
12362
+ const x = o * g + p, C = Math.round(x), S = r * d + b, k = Math.round(S), D = (o + c) * g + p, A = Math.abs(Math.round(D) - C) || 1, M = (r + h) * d + b, O = Math.abs(Math.round(M) - k) || 1;
12363
+ return a.setTransform(0, Math.sign(d), Math.sign(g), 0, C, k), a.drawImage(t, e, s, i, n, 0, 0, O, A), a.setTransform(u, d, g, f, p, b), [O, A];
12364
12364
  }
12365
12365
  a.drawImage(t, e, s, i, n, r, o, h, c);
12366
12366
  const _ = Math.hypot(u, d), y = Math.hypot(g, f);
@@ -12413,8 +12413,8 @@ function Wx(a) {
12413
12413
  do
12414
12414
  y += k;
12415
12415
  while (!r[y]);
12416
- const M = r[y];
12417
- M !== 5 && M !== 10 ? (S = M, r[y] = 0) : (S = M & 51 * S >> 4, r[y] &= S >> 2 | S << 2), b.lineTo(y % n, y / n | 0), r[y] || --f;
12416
+ const D = r[y];
12417
+ D !== 5 && D !== 10 ? (S = D, r[y] = 0) : (S = D & 51 * S >> 4, r[y] &= S >> 2 | S << 2), b.lineTo(y % n, y / n | 0), r[y] || --f;
12418
12418
  } while (C !== y);
12419
12419
  --o;
12420
12420
  }
@@ -12483,14 +12483,14 @@ function jm(a, t) {
12483
12483
  const _ = u.byteLength, y = new Uint32Array(d.buffer, 0, d.byteLength >> 2), x = y.length, C = s + 7 >> 3, S = 4294967295, k = Fe.isLittleEndian ? 4278190080 : 255;
12484
12484
  for (g = 0; g < r; g++) {
12485
12485
  for (p = g < n ? Ue : i, c = 0, f = 0; f < p; f++) {
12486
- const M = _ - h;
12487
- let E = 0;
12488
- const P = M > C ? s : M * 8 - 7, O = P & -8;
12489
- let L = 0, R = 0;
12490
- for (; E < O; E += 8)
12491
- R = u[h++], y[c++] = R & 128 ? S : k, y[c++] = R & 64 ? S : k, y[c++] = R & 32 ? S : k, y[c++] = R & 16 ? S : k, y[c++] = R & 8 ? S : k, y[c++] = R & 4 ? S : k, y[c++] = R & 2 ? S : k, y[c++] = R & 1 ? S : k;
12492
- for (; E < P; E++)
12493
- L === 0 && (R = u[h++], L = 128), y[c++] = R & L ? S : k, L >>= 1;
12486
+ const D = _ - h;
12487
+ let A = 0;
12488
+ const M = D > C ? s : D * 8 - 7, O = M & -8;
12489
+ let R = 0, L = 0;
12490
+ for (; A < O; A += 8)
12491
+ L = u[h++], y[c++] = L & 128 ? S : k, y[c++] = L & 64 ? S : k, y[c++] = L & 32 ? S : k, y[c++] = L & 16 ? S : k, y[c++] = L & 8 ? S : k, y[c++] = L & 4 ? S : k, y[c++] = L & 2 ? S : k, y[c++] = L & 1 ? S : k;
12492
+ for (; A < M; A++)
12493
+ R === 0 && (L = u[h++], R = 128), y[c++] = L & R ? S : k, R >>= 1;
12494
12494
  }
12495
12495
  for (; c < x; )
12496
12496
  y[c++] = 0;
@@ -12638,15 +12638,15 @@ const Np = class Np {
12638
12638
  } = t, n = this.current.fillColor, r = this.current.patternFill, o = xt(e);
12639
12639
  let h, c, u, d;
12640
12640
  if ((t.bitmap || t.data) && t.count > 1) {
12641
- const P = t.bitmap || t.data.buffer;
12642
- c = JSON.stringify(r ? o : [o.slice(0, 4), n]), h = this._cachedBitmapsMap.get(P), h || (h = /* @__PURE__ */ new Map(), this._cachedBitmapsMap.set(P, h));
12641
+ const M = t.bitmap || t.data.buffer;
12642
+ c = JSON.stringify(r ? o : [o.slice(0, 4), n]), h = this._cachedBitmapsMap.get(M), h || (h = /* @__PURE__ */ new Map(), this._cachedBitmapsMap.set(M, h));
12643
12643
  const O = h.get(c);
12644
12644
  if (O && !r) {
12645
- const L = Math.round(Math.min(o[0], o[2]) + o[4]), R = Math.round(Math.min(o[1], o[3]) + o[5]);
12645
+ const R = Math.round(Math.min(o[0], o[2]) + o[4]), L = Math.round(Math.min(o[1], o[3]) + o[5]);
12646
12646
  return {
12647
12647
  canvas: O,
12648
- offsetX: L,
12649
- offsetY: R
12648
+ offsetX: R,
12649
+ offsetY: L
12650
12650
  };
12651
12651
  }
12652
12652
  u = O;
@@ -12654,13 +12654,13 @@ const Np = class Np {
12654
12654
  u || (d = this.cachedCanvases.getCanvas("maskCanvas", s, i), Bm(d.context, t));
12655
12655
  let g = W.transform(o, [1 / s, 0, 0, -1 / i, 0, 0]);
12656
12656
  g = W.transform(g, [1, 0, 0, 1, 0, -i]);
12657
- const [f, p, b, _] = W.getAxialAlignedBoundingBox([0, 0, s, i], g), y = Math.round(b - f) || 1, x = Math.round(_ - p) || 1, C = this.cachedCanvases.getCanvas("fillCanvas", y, x), S = C.context, k = f, M = p;
12658
- S.translate(-k, -M), S.transform(...g), u || (u = this._scaleImage(d.canvas, si(S)), u = u.img, h && r && h.set(c, u)), S.imageSmoothingEnabled = Hm(xt(S), t.interpolate), au(S, u, 0, 0, u.width, u.height, 0, 0, s, i), S.globalCompositeOperation = "source-in";
12659
- const E = W.transform(si(S), [1, 0, 0, 1, -k, -M]);
12660
- return S.fillStyle = r ? n.getPattern(e, this, E, we.FILL) : n, S.fillRect(0, 0, s, i), h && !r && (this.cachedCanvases.delete("fillCanvas"), h.set(c, C.canvas)), {
12657
+ const [f, p, b, _] = W.getAxialAlignedBoundingBox([0, 0, s, i], g), y = Math.round(b - f) || 1, x = Math.round(_ - p) || 1, C = this.cachedCanvases.getCanvas("fillCanvas", y, x), S = C.context, k = f, D = p;
12658
+ S.translate(-k, -D), S.transform(...g), u || (u = this._scaleImage(d.canvas, si(S)), u = u.img, h && r && h.set(c, u)), S.imageSmoothingEnabled = Hm(xt(S), t.interpolate), au(S, u, 0, 0, u.width, u.height, 0, 0, s, i), S.globalCompositeOperation = "source-in";
12659
+ const A = W.transform(si(S), [1, 0, 0, 1, -k, -D]);
12660
+ return S.fillStyle = r ? n.getPattern(e, this, A, we.FILL) : n, S.fillRect(0, 0, s, i), h && !r && (this.cachedCanvases.delete("fillCanvas"), h.set(c, C.canvas)), {
12661
12661
  canvas: C.canvas,
12662
12662
  offsetX: Math.round(k),
12663
- offsetY: Math.round(M)
12663
+ offsetY: Math.round(D)
12664
12664
  };
12665
12665
  }
12666
12666
  setLineWidth(t) {
@@ -12976,61 +12976,61 @@ const Np = class Np {
12976
12976
  let y, x;
12977
12977
  if (e.patternFill) {
12978
12978
  n.save();
12979
- const E = e.fillColor.getPattern(n, this, si(n), we.FILL);
12980
- y = xt(n), n.restore(), n.fillStyle = E;
12979
+ const A = e.fillColor.getPattern(n, this, si(n), we.FILL);
12980
+ y = xt(n), n.restore(), n.fillStyle = A;
12981
12981
  }
12982
12982
  if (e.patternStroke) {
12983
12983
  n.save();
12984
- const E = e.strokeColor.getPattern(n, this, si(n), we.STROKE);
12985
- x = xt(n), n.restore(), n.strokeStyle = E;
12984
+ const A = e.strokeColor.getPattern(n, this, si(n), we.STROKE);
12985
+ x = xt(n), n.restore(), n.strokeStyle = A;
12986
12986
  }
12987
12987
  let C = e.lineWidth;
12988
12988
  const S = e.textMatrixScale;
12989
12989
  if (S === 0 || C === 0) {
12990
- const E = e.textRenderingMode & ue.FILL_STROKE_MASK;
12991
- (E === ue.STROKE || E === ue.FILL_STROKE) && (C = this.getSinglePixelWidth());
12990
+ const A = e.textRenderingMode & ue.FILL_STROKE_MASK;
12991
+ (A === ue.STROKE || A === ue.FILL_STROKE) && (C = this.getSinglePixelWidth());
12992
12992
  } else
12993
12993
  C /= S;
12994
12994
  if (r !== 1 && (n.scale(r, r), C /= r), n.lineWidth = C, s.isInvalidPDFjsFont) {
12995
- const E = [];
12996
- let P = 0;
12995
+ const A = [];
12996
+ let M = 0;
12997
12997
  for (const O of t)
12998
- E.push(O.unicode), P += O.width;
12999
- n.fillText(E.join(""), 0, 0), e.x += P * b * u, n.restore(), this.compose();
12998
+ A.push(O.unicode), M += O.width;
12999
+ n.fillText(A.join(""), 0, 0), e.x += M * b * u, n.restore(), this.compose();
13000
13000
  return;
13001
13001
  }
13002
- let k = 0, M;
13003
- for (M = 0; M < d; ++M) {
13004
- const E = t[M];
13005
- if (typeof E == "number") {
13006
- k += f * E * i / 1e3;
13002
+ let k = 0, D;
13003
+ for (D = 0; D < d; ++D) {
13004
+ const A = t[D];
13005
+ if (typeof A == "number") {
13006
+ k += f * A * i / 1e3;
13007
13007
  continue;
13008
13008
  }
13009
- let P = !1;
13010
- const O = (E.isSpace ? h : 0) + o, L = E.fontChar, R = E.accent;
13011
- let U, z, V = E.width;
13009
+ let M = !1;
13010
+ const O = (A.isSpace ? h : 0) + o, R = A.fontChar, L = A.accent;
13011
+ let X, U, G = A.width;
13012
13012
  if (g) {
13013
- const F = E.vmetric || p, G = -(E.vmetric ? F[1] : V * 0.5) * b, it = F[2] * b;
13014
- V = F ? -F[0] : V, U = G / r, z = (k + it) / r;
13013
+ const F = A.vmetric || p, z = -(A.vmetric ? F[1] : G * 0.5) * b, it = F[2] * b;
13014
+ G = F ? -F[0] : G, X = z / r, U = (k + it) / r;
13015
13015
  } else
13016
- U = k / r, z = 0;
13017
- if (s.remeasure && V > 0) {
13018
- const F = n.measureText(L).width * 1e3 / i * r;
13019
- if (V < F && this.isFontSubpixelAAEnabled) {
13020
- const G = V / F;
13021
- P = !0, n.save(), n.scale(G, 1), U /= G;
13022
- } else V !== F && (U += (V - F) / 2e3 * i / r);
13016
+ X = k / r, U = 0;
13017
+ if (s.remeasure && G > 0) {
13018
+ const F = n.measureText(R).width * 1e3 / i * r;
13019
+ if (G < F && this.isFontSubpixelAAEnabled) {
13020
+ const z = G / F;
13021
+ M = !0, n.save(), n.scale(z, 1), X /= z;
13022
+ } else G !== F && (X += (G - F) / 2e3 * i / r);
13023
13023
  }
13024
- if (this.contentVisible && (E.isInFont || s.missingFile)) {
13025
- if (_ && !R)
13026
- n.fillText(L, U, z);
13027
- else if (this.paintChar(L, U, z, y, x), R) {
13028
- const F = U + i * R.offset.x / r, G = z - i * R.offset.y / r;
13029
- this.paintChar(R.fontChar, F, G, y, x);
13024
+ if (this.contentVisible && (A.isInFont || s.missingFile)) {
13025
+ if (_ && !L)
13026
+ n.fillText(R, X, U);
13027
+ else if (this.paintChar(R, X, U, y, x), L) {
13028
+ const F = X + i * L.offset.x / r, z = U - i * L.offset.y / r;
13029
+ this.paintChar(L.fontChar, F, z, y, x);
13030
13030
  }
13031
13031
  }
13032
- const rt = g ? V * b - O * c : V * b + O * c;
13033
- k += rt, P && n.restore();
13032
+ const rt = g ? G * b - O * c : G * b + O * c;
13033
+ k += rt, M && n.restore();
13034
13034
  }
13035
13035
  g ? e.y -= k : e.x += k * u, n.restore(), this.compose();
13036
13036
  }
@@ -14848,16 +14848,16 @@ function SS(a = {}) {
14848
14848
  docId: e
14849
14849
  } = t, s = a.url ? CS(a.url) : null, i = a.data ? AS(a.data) : null, n = a.httpHeaders || null, r = a.withCredentials === !0, o = a.password ?? null, h = a.range instanceof vv ? a.range : null, c = Number.isInteger(a.rangeChunkSize) && a.rangeChunkSize > 0 ? a.rangeChunkSize : mS;
14850
14850
  let u = a.worker instanceof na ? a.worker : null;
14851
- const d = a.verbosity, g = typeof a.docBaseUrl == "string" && !Kd(a.docBaseUrl) ? a.docBaseUrl : null, f = typeof a.cMapUrl == "string" ? a.cMapUrl : null, p = a.cMapPacked !== !1, b = a.CMapReaderFactory || _S, _ = typeof a.standardFontDataUrl == "string" ? a.standardFontDataUrl : null, y = a.StandardFontDataFactory || xS, x = a.stopAtErrors !== !0, C = Number.isInteger(a.maxImageSize) && a.maxImageSize > -1 ? a.maxImageSize : -1, S = a.isEvalSupported !== !1, k = typeof a.isOffscreenCanvasSupported == "boolean" ? a.isOffscreenCanvasSupported : !xe, M = typeof a.isImageDecoderSupported == "boolean" ? a.isImageDecoderSupported : !xe && (Fe.platform.isFirefox || !globalThis.chrome), E = Number.isInteger(a.canvasMaxAreaInBytes) ? a.canvasMaxAreaInBytes : -1, P = typeof a.disableFontFace == "boolean" ? a.disableFontFace : xe, O = a.fontExtraProperties === !0, L = a.enableXfa === !0, R = a.ownerDocument || globalThis.document, U = a.disableRange === !0, z = a.disableStream === !0, V = a.disableAutoFetch === !0, rt = a.pdfBug === !0, F = a.CanvasFactory || yS, G = a.FilterFactory || wS, it = a.enableHWA === !0, Rt = h ? h.length : a.length ?? NaN, Wt = typeof a.useSystemFonts == "boolean" ? a.useSystemFonts : !xe && !P, ne = typeof a.useWorkerFetch == "boolean" ? a.useWorkerFetch : b === sv && y === ov && f && _ && Th(f, document.baseURI) && Th(_, document.baseURI), Bt = null;
14851
+ const d = a.verbosity, g = typeof a.docBaseUrl == "string" && !Kd(a.docBaseUrl) ? a.docBaseUrl : null, f = typeof a.cMapUrl == "string" ? a.cMapUrl : null, p = a.cMapPacked !== !1, b = a.CMapReaderFactory || _S, _ = typeof a.standardFontDataUrl == "string" ? a.standardFontDataUrl : null, y = a.StandardFontDataFactory || xS, x = a.stopAtErrors !== !0, C = Number.isInteger(a.maxImageSize) && a.maxImageSize > -1 ? a.maxImageSize : -1, S = a.isEvalSupported !== !1, k = typeof a.isOffscreenCanvasSupported == "boolean" ? a.isOffscreenCanvasSupported : !xe, D = typeof a.isImageDecoderSupported == "boolean" ? a.isImageDecoderSupported : !xe && (Fe.platform.isFirefox || !globalThis.chrome), A = Number.isInteger(a.canvasMaxAreaInBytes) ? a.canvasMaxAreaInBytes : -1, M = typeof a.disableFontFace == "boolean" ? a.disableFontFace : xe, O = a.fontExtraProperties === !0, R = a.enableXfa === !0, L = a.ownerDocument || globalThis.document, X = a.disableRange === !0, U = a.disableStream === !0, G = a.disableAutoFetch === !0, rt = a.pdfBug === !0, F = a.CanvasFactory || yS, z = a.FilterFactory || wS, it = a.enableHWA === !0, Rt = h ? h.length : a.length ?? NaN, Wt = typeof a.useSystemFonts == "boolean" ? a.useSystemFonts : !xe && !M, ne = typeof a.useWorkerFetch == "boolean" ? a.useWorkerFetch : b === sv && y === ov && f && _ && Th(f, document.baseURI) && Th(_, document.baseURI), Bt = null;
14852
14852
  hx(d);
14853
14853
  const yt = {
14854
14854
  canvasFactory: new F({
14855
- ownerDocument: R,
14855
+ ownerDocument: L,
14856
14856
  enableHWA: it
14857
14857
  }),
14858
- filterFactory: new G({
14858
+ filterFactory: new z({
14859
14859
  docId: e,
14860
- ownerDocument: R
14860
+ ownerDocument: L
14861
14861
  }),
14862
14862
  cMapReaderFactory: ne ? null : new b({
14863
14863
  baseUrl: f,
@@ -14879,33 +14879,33 @@ function SS(a = {}) {
14879
14879
  apiVersion: "4.10.38",
14880
14880
  data: i,
14881
14881
  password: o,
14882
- disableAutoFetch: V,
14882
+ disableAutoFetch: G,
14883
14883
  rangeChunkSize: c,
14884
14884
  length: Rt,
14885
14885
  docBaseUrl: g,
14886
- enableXfa: L,
14886
+ enableXfa: R,
14887
14887
  evaluatorOptions: {
14888
14888
  maxImageSize: C,
14889
- disableFontFace: P,
14889
+ disableFontFace: M,
14890
14890
  ignoreErrors: x,
14891
14891
  isEvalSupported: S,
14892
14892
  isOffscreenCanvasSupported: k,
14893
- isImageDecoderSupported: M,
14894
- canvasMaxAreaInBytes: E,
14893
+ isImageDecoderSupported: D,
14894
+ canvasMaxAreaInBytes: A,
14895
14895
  fontExtraProperties: O,
14896
14896
  useSystemFonts: Wt,
14897
14897
  cMapUrl: ne ? f : null,
14898
14898
  standardFontDataUrl: ne ? _ : null
14899
14899
  }
14900
14900
  }, ti = {
14901
- disableFontFace: P,
14901
+ disableFontFace: M,
14902
14902
  fontExtraProperties: O,
14903
- ownerDocument: R,
14903
+ ownerDocument: L,
14904
14904
  pdfBug: rt,
14905
14905
  styleElement: Bt,
14906
14906
  loadingParams: {
14907
- disableAutoFetch: V,
14908
- enableXfa: L
14907
+ disableAutoFetch: G,
14908
+ enableXfa: R
14909
14909
  }
14910
14910
  };
14911
14911
  return u.promise.then(function() {
@@ -14917,8 +14917,8 @@ function SS(a = {}) {
14917
14917
  let ct;
14918
14918
  if (h)
14919
14919
  ct = new Jx(h, {
14920
- disableRange: U,
14921
- disableStream: z
14920
+ disableRange: X,
14921
+ disableStream: U
14922
14922
  });
14923
14923
  else if (!i) {
14924
14924
  if (!s)
@@ -14939,8 +14939,8 @@ function SS(a = {}) {
14939
14939
  httpHeaders: n,
14940
14940
  withCredentials: r,
14941
14941
  rangeChunkSize: c,
14942
- disableRange: U,
14943
- disableStream: z
14942
+ disableRange: X,
14943
+ disableStream: U
14944
14944
  });
14945
14945
  }
14946
14946
  return Pt.then((wn) => {
@@ -15248,12 +15248,12 @@ class ES {
15248
15248
  lastChunk: !1,
15249
15249
  separateAnnots: null
15250
15250
  }, (k = this._stats) == null || k.time("Page Request"), this._pumpOperatorList(g));
15251
- const y = (M) => {
15252
- var E;
15253
- b.renderTasks.delete(x), (this._maybeCleanupAfterRender || _) && m(this, Yi, !0), w(this, Cs, Yo).call(this, !_), M ? (x.capability.reject(M), this._abortOperatorList({
15251
+ const y = (D) => {
15252
+ var A;
15253
+ b.renderTasks.delete(x), (this._maybeCleanupAfterRender || _) && m(this, Yi, !0), w(this, Cs, Yo).call(this, !_), D ? (x.capability.reject(D), this._abortOperatorList({
15254
15254
  intentState: b,
15255
- reason: M instanceof Error ? M : new Error(M)
15256
- })) : x.capability.resolve(), this._stats && (this._stats.timeEnd("Rendering"), this._stats.timeEnd("Overall"), (E = globalThis.Stats) != null && E.enabled && globalThis.Stats.add(this.pageNumber, this._stats));
15255
+ reason: D instanceof Error ? D : new Error(D)
15256
+ })) : x.capability.resolve(), this._stats && (this._stats.timeEnd("Rendering"), this._stats.timeEnd("Overall"), (A = globalThis.Stats) != null && A.enabled && globalThis.Stats.add(this.pageNumber, this._stats));
15257
15257
  }, x = new xf({
15258
15258
  callback: y,
15259
15259
  params: {
@@ -15275,17 +15275,17 @@ class ES {
15275
15275
  });
15276
15276
  (b.renderTasks || (b.renderTasks = /* @__PURE__ */ new Set())).add(x);
15277
15277
  const C = x.task;
15278
- return Promise.all([b.displayReadyCapability.promise, o]).then(([M, E]) => {
15279
- var P;
15278
+ return Promise.all([b.displayReadyCapability.promise, o]).then(([D, A]) => {
15279
+ var M;
15280
15280
  if (this.destroyed) {
15281
15281
  y();
15282
15282
  return;
15283
15283
  }
15284
- if ((P = this._stats) == null || P.time("Rendering"), !(E.renderingIntent & f))
15284
+ if ((M = this._stats) == null || M.time("Rendering"), !(A.renderingIntent & f))
15285
15285
  throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");
15286
15286
  x.initializeGraphics({
15287
- transparency: M,
15288
- optionalContentConfig: E
15287
+ transparency: D,
15288
+ optionalContentConfig: A
15289
15289
  }), x.operatorListChanged();
15290
15290
  }).catch(y), C;
15291
15291
  }
@@ -16780,8 +16780,8 @@ const jp = class jp {
16780
16780
  const f = u.createElement("clipPath"), p = `clippath_${this.data.id}`;
16781
16781
  f.setAttribute("id", p), f.setAttribute("clipPathUnits", "objectBoundingBox"), g.append(f);
16782
16782
  for (let b = 2, _ = t.length; b < _; b += 8) {
16783
- const y = t[b], x = t[b + 1], C = t[b + 2], S = t[b + 3], k = u.createElement("rect"), M = (C - e) / h, E = (n - x) / c, P = (y - C) / h, O = (x - S) / c;
16784
- k.setAttribute("x", M), k.setAttribute("y", E), k.setAttribute("width", P), k.setAttribute("height", O), f.append(k), o == null || o.push(`<rect vector-effect="non-scaling-stroke" x="${M}" y="${E}" width="${P}" height="${O}"/>`);
16783
+ const y = t[b], x = t[b + 1], C = t[b + 2], S = t[b + 3], k = u.createElement("rect"), D = (C - e) / h, A = (n - x) / c, M = (y - C) / h, O = (x - S) / c;
16784
+ k.setAttribute("x", D), k.setAttribute("y", A), k.setAttribute("width", M), k.setAttribute("height", O), f.append(k), o == null || o.push(`<rect vector-effect="non-scaling-stroke" x="${D}" y="${A}" width="${M}" height="${O}"/>`);
16785
16785
  }
16786
16786
  l(this, La) && (o.push("</g></svg>')"), r.backgroundImage = o.join("")), this.container.append(d), this.container.style.clipPath = `url(#${p})`;
16787
16787
  }
@@ -17302,13 +17302,13 @@ class NS extends Bo {
17302
17302
  let C = y, S = x;
17303
17303
  switch (f.inputType) {
17304
17304
  case "deleteWordBackward": {
17305
- const M = _.substring(0, y).match(/\w*[^\w]*$/);
17306
- M && (C -= M[0].length);
17305
+ const D = _.substring(0, y).match(/\w*[^\w]*$/);
17306
+ D && (C -= D[0].length);
17307
17307
  break;
17308
17308
  }
17309
17309
  case "deleteWordForward": {
17310
- const M = _.substring(y).match(/^[^\w]*\w*/);
17311
- M && (S += M[0].length);
17310
+ const D = _.substring(y).match(/^[^\w]*\w*/);
17311
+ D && (S += D[0].length);
17312
17312
  break;
17313
17313
  }
17314
17314
  case "deleteContentBackward":
@@ -18810,8 +18810,8 @@ const Li = class Li {
18810
18810
  const p = f - l(this, uc), b = p / f, _ = b * d, y = b * g;
18811
18811
  let x = o, C = h;
18812
18812
  o = c, h = u, c += _, u += y, (O = l(this, Wn)) == null || O.push(t, e);
18813
- const S = -y / p, k = _ / p, M = S * l(this, Va), E = k * l(this, Va);
18814
- return l(this, et).set(l(this, et).subarray(2, 8), 0), l(this, et).set([c + M, u + E], 4), l(this, et).set(l(this, et).subarray(14, 18), 12), l(this, et).set([c - M, u - E], 16), isNaN(l(this, et)[6]) ? (l(this, pi).length === 0 && (l(this, et).set([o + M, h + E], 2), l(this, pi).push(NaN, NaN, NaN, NaN, (o + M - s) / n, (h + E - i) / r), l(this, et).set([o - M, h - E], 14), l(this, js).push(NaN, NaN, NaN, NaN, (o - M - s) / n, (h - E - i) / r)), l(this, et).set([x, C, o, h, c, u], 6), !this.isEmpty()) : (l(this, et).set([x, C, o, h, c, u], 6), Math.abs(Math.atan2(C - h, x - o) - Math.atan2(y, _)) < Math.PI / 2 ? ([o, h, c, u] = l(this, et).subarray(2, 6), l(this, pi).push(NaN, NaN, NaN, NaN, ((o + c) / 2 - s) / n, ((h + u) / 2 - i) / r), [o, h, x, C] = l(this, et).subarray(14, 18), l(this, js).push(NaN, NaN, NaN, NaN, ((x + o) / 2 - s) / n, ((C + h) / 2 - i) / r), !0) : ([x, C, o, h, c, u] = l(this, et).subarray(0, 6), l(this, pi).push(((x + 5 * o) / 6 - s) / n, ((C + 5 * h) / 6 - i) / r, ((5 * o + c) / 6 - s) / n, ((5 * h + u) / 6 - i) / r, ((o + c) / 2 - s) / n, ((h + u) / 2 - i) / r), [c, u, o, h, x, C] = l(this, et).subarray(12, 18), l(this, js).push(((x + 5 * o) / 6 - s) / n, ((C + 5 * h) / 6 - i) / r, ((5 * o + c) / 6 - s) / n, ((5 * h + u) / 6 - i) / r, ((o + c) / 2 - s) / n, ((h + u) / 2 - i) / r), !0));
18813
+ const S = -y / p, k = _ / p, D = S * l(this, Va), A = k * l(this, Va);
18814
+ return l(this, et).set(l(this, et).subarray(2, 8), 0), l(this, et).set([c + D, u + A], 4), l(this, et).set(l(this, et).subarray(14, 18), 12), l(this, et).set([c - D, u - A], 16), isNaN(l(this, et)[6]) ? (l(this, pi).length === 0 && (l(this, et).set([o + D, h + A], 2), l(this, pi).push(NaN, NaN, NaN, NaN, (o + D - s) / n, (h + A - i) / r), l(this, et).set([o - D, h - A], 14), l(this, js).push(NaN, NaN, NaN, NaN, (o - D - s) / n, (h - A - i) / r)), l(this, et).set([x, C, o, h, c, u], 6), !this.isEmpty()) : (l(this, et).set([x, C, o, h, c, u], 6), Math.abs(Math.atan2(C - h, x - o) - Math.atan2(y, _)) < Math.PI / 2 ? ([o, h, c, u] = l(this, et).subarray(2, 6), l(this, pi).push(NaN, NaN, NaN, NaN, ((o + c) / 2 - s) / n, ((h + u) / 2 - i) / r), [o, h, x, C] = l(this, et).subarray(14, 18), l(this, js).push(NaN, NaN, NaN, NaN, ((x + o) / 2 - s) / n, ((C + h) / 2 - i) / r), !0) : ([x, C, o, h, c, u] = l(this, et).subarray(0, 6), l(this, pi).push(((x + 5 * o) / 6 - s) / n, ((C + 5 * h) / 6 - i) / r, ((5 * o + c) / 6 - s) / n, ((5 * h + u) / 6 - i) / r, ((o + c) / 2 - s) / n, ((h + u) / 2 - i) / r), [c, u, o, h, x, C] = l(this, et).subarray(12, 18), l(this, js).push(((x + 5 * o) / 6 - s) / n, ((C + 5 * h) / 6 - i) / r, ((5 * o + c) / 6 - s) / n, ((5 * h + u) / 6 - i) / r, ((o + c) / 2 - s) / n, ((h + u) / 2 - i) / r), !0));
18815
18815
  }
18816
18816
  toSVGPath() {
18817
18817
  if (this.isEmpty())
@@ -18985,8 +18985,8 @@ class Of {
18985
18985
  width: x,
18986
18986
  height: C
18987
18987
  } of t) {
18988
- const S = Math.floor((_ - e) / c) * c, k = Math.ceil((_ + x + e) / c) * c, M = Math.floor((y - e) / c) * c, E = Math.ceil((y + C + e) / c) * c, P = [S, M, E, !0], O = [k, M, E, !1];
18989
- l(this, Un).push(P, O), n = Math.min(n, S), r = Math.max(r, k), o = Math.min(o, M), h = Math.max(h, E);
18988
+ const S = Math.floor((_ - e) / c) * c, k = Math.ceil((_ + x + e) / c) * c, D = Math.floor((y - e) / c) * c, A = Math.ceil((y + C + e) / c) * c, M = [S, D, A, !0], O = [k, D, A, !1];
18989
+ l(this, Un).push(M, O), n = Math.min(n, S), r = Math.max(r, k), o = Math.min(o, D), h = Math.max(h, A);
18990
18990
  }
18991
18991
  const u = r - n + 2 * s, d = h - o + 2 * s, g = n - s, f = o - s, p = l(this, Un).at(i ? -1 : -2), b = [p[0], p[2]];
18992
18992
  for (const _ of l(this, Un)) {
@@ -19579,27 +19579,27 @@ const lt = class lt extends Mt {
19579
19579
  quadPoints: C,
19580
19580
  rect: S,
19581
19581
  rotation: k,
19582
- id: M,
19583
- color: E,
19584
- opacity: P,
19582
+ id: D,
19583
+ color: A,
19584
+ opacity: M,
19585
19585
  popupRef: O
19586
19586
  },
19587
19587
  parent: {
19588
19588
  page: {
19589
- pageNumber: L
19589
+ pageNumber: R
19590
19590
  }
19591
19591
  }
19592
19592
  } = e;
19593
19593
  n = e = {
19594
19594
  annotationType: J.HIGHLIGHT,
19595
- color: Array.from(E),
19596
- opacity: P,
19595
+ color: Array.from(A),
19596
+ opacity: M,
19597
19597
  quadPoints: C,
19598
19598
  boxes: null,
19599
- pageIndex: L - 1,
19599
+ pageIndex: R - 1,
19600
19600
  rect: S.slice(0),
19601
19601
  rotation: k,
19602
- id: M,
19602
+ id: D,
19603
19603
  deleted: !1,
19604
19604
  popupRef: O
19605
19605
  };
@@ -19609,29 +19609,29 @@ const lt = class lt extends Mt {
19609
19609
  inkLists: C,
19610
19610
  rect: S,
19611
19611
  rotation: k,
19612
- id: M,
19613
- color: E,
19612
+ id: D,
19613
+ color: A,
19614
19614
  borderStyle: {
19615
- rawWidth: P
19615
+ rawWidth: M
19616
19616
  },
19617
19617
  popupRef: O
19618
19618
  },
19619
19619
  parent: {
19620
19620
  page: {
19621
- pageNumber: L
19621
+ pageNumber: R
19622
19622
  }
19623
19623
  }
19624
19624
  } = e;
19625
19625
  n = e = {
19626
19626
  annotationType: J.HIGHLIGHT,
19627
- color: Array.from(E),
19628
- thickness: P,
19627
+ color: Array.from(A),
19628
+ thickness: M,
19629
19629
  inkLists: C,
19630
19630
  boxes: null,
19631
- pageIndex: L - 1,
19631
+ pageIndex: R - 1,
19632
19632
  rect: S.slice(0),
19633
19633
  rotation: k,
19634
- id: M,
19634
+ id: D,
19635
19635
  deleted: !1,
19636
19636
  popupRef: O
19637
19637
  };
@@ -19660,11 +19660,11 @@ const lt = class lt extends Mt {
19660
19660
  x: C[0] - f,
19661
19661
  y: g - (C[1] - p)
19662
19662
  }, k = new Lf(S, [0, 0, d, g], 1, l(u, ys) / 2, !0, 1e-3);
19663
- for (let P = 0, O = C.length; P < O; P += 2)
19664
- S.x = C[P] - f, S.y = g - (C[P + 1] - p), k.add(S);
19663
+ for (let M = 0, O = C.length; M < O; M += 2)
19664
+ S.x = C[M] - f, S.y = g - (C[M + 1] - p), k.add(S);
19665
19665
  const {
19666
- id: M,
19667
- clipPathId: E
19666
+ id: D,
19667
+ clipPathId: A
19668
19668
  } = s.drawLayer.draw({
19669
19669
  bbox: [0, 0, 1, 1],
19670
19670
  root: {
@@ -19682,8 +19682,8 @@ const lt = class lt extends Mt {
19682
19682
  }, !0, !0);
19683
19683
  w(y = u, Q, Fu).call(y, {
19684
19684
  highlightOutlines: k.getOutlines(),
19685
- highlightId: M,
19686
- clipPathId: E
19685
+ highlightId: D,
19686
+ clipPathId: A
19687
19687
  }), w(x = u, Q, fr).call(x);
19688
19688
  }
19689
19689
  return u;
@@ -20558,10 +20558,10 @@ const Bp = class Bp extends B {
20558
20558
  break;
20559
20559
  }
20560
20560
  for (const {
20561
- line: M,
20562
- points: E
20561
+ line: D,
20562
+ points: A
20563
20563
  } of l(this, os))
20564
- o.push(k(M, f, p, b, _, r ? new Array(M.length) : null)), h.push(k(E, f, p, b, _, r ? new Array(E.length) : null));
20564
+ o.push(k(D, f, p, b, _, r ? new Array(D.length) : null)), h.push(k(A, f, p, b, _, r ? new Array(A.length) : null));
20565
20565
  return {
20566
20566
  lines: o,
20567
20567
  points: h,
@@ -20606,11 +20606,11 @@ const Bp = class Bp extends B {
20606
20606
  }
20607
20607
  const S = new Float32Array(3 * (C - 2));
20608
20608
  o.push(S);
20609
- let [k, M, E, P] = x.subarray(0, 4);
20610
- S.set([NaN, NaN, NaN, NaN, k, M], 0);
20609
+ let [k, D, A, M] = x.subarray(0, 4);
20610
+ S.set([NaN, NaN, NaN, NaN, k, D], 0);
20611
20611
  for (let O = 4; O < C; O += 2) {
20612
- const L = x[O], R = x[O + 1];
20613
- S.set(B.createBezierPoints(k, M, E, P, L, R), (O - 2) * 3), [k, M, E, P] = [E, P, L, R];
20612
+ const R = x[O], L = x[O + 1];
20613
+ S.set(B.createBezierPoints(k, D, A, M, R, L), (O - 2) * 3), [k, D, A, M] = [A, M, R, L];
20614
20614
  }
20615
20615
  }
20616
20616
  }
@@ -21125,8 +21125,8 @@ const qh = class qh extends Mt {
21125
21125
  let h = l(this, Et), c = n, u = r, d = null;
21126
21126
  if (s) {
21127
21127
  if (n > s || r > s) {
21128
- const P = Math.min(s / n, s / r);
21129
- c = Math.floor(n * P), u = Math.floor(r * P);
21128
+ const M = Math.min(s / n, s / r);
21129
+ c = Math.floor(n * M), u = Math.floor(r * M);
21130
21130
  }
21131
21131
  d = document.createElement("canvas");
21132
21132
  const p = d.width = Math.ceil(c * o.sx), b = d.height = Math.ceil(u * o.sy);
@@ -21135,8 +21135,8 @@ const qh = class qh extends Mt {
21135
21135
  _.filter = this._uiManager.hcmFilter;
21136
21136
  let y = "white", x = "#cfcfd8";
21137
21137
  this._uiManager.hcmFilter !== "none" ? x = "black" : (f = window.matchMedia) != null && f.call(window, "(prefers-color-scheme: dark)").matches && (y = "#8f8f9d", x = "#42414d");
21138
- const C = 15, S = C * o.sx, k = C * o.sy, M = new OffscreenCanvas(S * 2, k * 2), E = M.getContext("2d");
21139
- E.fillStyle = y, E.fillRect(0, 0, S * 2, k * 2), E.fillStyle = x, E.fillRect(0, 0, S, k), E.fillRect(S, k, S, k), _.fillStyle = _.createPattern(M, "repeat"), _.fillRect(0, 0, p, b), _.drawImage(h, 0, 0, h.width, h.height, 0, 0, p, b);
21138
+ const C = 15, S = C * o.sx, k = C * o.sy, D = new OffscreenCanvas(S * 2, k * 2), A = D.getContext("2d");
21139
+ A.fillStyle = y, A.fillRect(0, 0, S * 2, k * 2), A.fillStyle = x, A.fillRect(0, 0, S, k), A.fillRect(S, k, S, k), _.fillStyle = _.createPattern(D, "repeat"), _.fillRect(0, 0, p, b), _.drawImage(h, 0, 0, h.width, h.height, 0, 0, p, b);
21140
21140
  }
21141
21141
  let g = null;
21142
21142
  if (i) {
@@ -21181,17 +21181,17 @@ const qh = class qh extends Mt {
21181
21181
  container: k,
21182
21182
  parent: {
21183
21183
  page: {
21184
- pageNumber: M
21184
+ pageNumber: D
21185
21185
  }
21186
21186
  }
21187
- } = e, E = k.querySelector("canvas"), P = i.imageManager.getFromCanvas(k.id, E);
21188
- E.remove();
21187
+ } = e, A = k.querySelector("canvas"), M = i.imageManager.getFromCanvas(k.id, A);
21188
+ A.remove();
21189
21189
  const O = ((b = await s._structTree.getAriaAttributes(`${Tp}${x}`)) == null ? void 0 : b.get("aria-label")) || "";
21190
21190
  n = e = {
21191
21191
  annotationType: J.STAMP,
21192
- bitmapId: P.id,
21193
- bitmap: P.bitmap,
21194
- pageIndex: M - 1,
21192
+ bitmapId: M.id,
21193
+ bitmap: M.bitmap,
21194
+ pageIndex: D - 1,
21195
21195
  rect: _.slice(0),
21196
21196
  rotation: y,
21197
21197
  id: x,
@@ -21412,7 +21412,7 @@ Et = new WeakMap(), le = new WeakMap(), Qn = new WeakMap(), rn = new WeakMap(),
21412
21412
  };
21413
21413
  }, Y(qh, "_type", "stamp"), Y(qh, "_editorType", J.STAMP);
21414
21414
  let Uf = qh;
21415
- var To, hh, wi, Zn, on, ws, tr, lh, Eo, zs, an, be, hn, X, er, St, dy, ni, Kf, Qf, zu;
21415
+ var To, hh, wi, Zn, on, ws, tr, lh, Eo, zs, an, be, hn, V, er, St, dy, ni, Kf, Qf, zu;
21416
21416
  const Ps = class Ps {
21417
21417
  constructor({
21418
21418
  uiManager: t,
@@ -21440,25 +21440,25 @@ const Ps = class Ps {
21440
21440
  v(this, an, null);
21441
21441
  v(this, be, null);
21442
21442
  v(this, hn, null);
21443
- v(this, X);
21443
+ v(this, V);
21444
21444
  const d = [...l(Ps, er).values()];
21445
21445
  if (!Ps._initialized) {
21446
21446
  Ps._initialized = !0;
21447
21447
  for (const g of d)
21448
21448
  g.initialize(u, t);
21449
21449
  }
21450
- t.registerEditorTypes(d), m(this, X, t), this.pageIndex = e, this.div = s, m(this, To, n), m(this, wi, r), this.viewport = c, m(this, be, h), this.drawLayer = o, this._structTree = i, l(this, X).addLayer(this);
21450
+ t.registerEditorTypes(d), m(this, V, t), this.pageIndex = e, this.div = s, m(this, To, n), m(this, wi, r), this.viewport = c, m(this, be, h), this.drawLayer = o, this._structTree = i, l(this, V).addLayer(this);
21451
21451
  }
21452
21452
  get isEmpty() {
21453
21453
  return l(this, ws).size === 0;
21454
21454
  }
21455
21455
  get isInvisible() {
21456
- return this.isEmpty && l(this, X).getMode() === J.NONE;
21456
+ return this.isEmpty && l(this, V).getMode() === J.NONE;
21457
21457
  }
21458
21458
  updateToolbar(t) {
21459
- l(this, X).updateToolbar(t);
21459
+ l(this, V).updateToolbar(t);
21460
21460
  }
21461
- updateMode(t = l(this, X).getMode()) {
21461
+ updateMode(t = l(this, V).getMode()) {
21462
21462
  switch (w(this, St, zu).call(this), t) {
21463
21463
  case J.NONE:
21464
21464
  this.disableTextSelection(), this.togglePointerEvents(!1), this.toggleAnnotationLayerPointerEvents(!0), this.disableClick();
@@ -21485,13 +21485,13 @@ const Ps = class Ps {
21485
21485
  return t === ((e = l(this, be)) == null ? void 0 : e.div);
21486
21486
  }
21487
21487
  setEditingState(t) {
21488
- l(this, X).setEditingState(t);
21488
+ l(this, V).setEditingState(t);
21489
21489
  }
21490
21490
  addCommands(t) {
21491
- l(this, X).addCommands(t);
21491
+ l(this, V).addCommands(t);
21492
21492
  }
21493
21493
  cleanUndoStack(t) {
21494
- l(this, X).cleanUndoStack(t);
21494
+ l(this, V).cleanUndoStack(t);
21495
21495
  }
21496
21496
  toggleDrawing(t = !1) {
21497
21497
  this.div.classList.toggle("drawing", !t);
@@ -21507,14 +21507,14 @@ const Ps = class Ps {
21507
21507
  m(this, Eo, !0), this.div.tabIndex = 0, this.togglePointerEvents(!0);
21508
21508
  const t = /* @__PURE__ */ new Set();
21509
21509
  for (const s of l(this, ws).values())
21510
- s.enableEditing(), s.show(!0), s.annotationElementId && (l(this, X).removeChangedExistingAnnotation(s), t.add(s.annotationElementId));
21510
+ s.enableEditing(), s.show(!0), s.annotationElementId && (l(this, V).removeChangedExistingAnnotation(s), t.add(s.annotationElementId));
21511
21511
  if (!l(this, wi)) {
21512
21512
  m(this, Eo, !1);
21513
21513
  return;
21514
21514
  }
21515
21515
  const e = l(this, wi).getEditableAnnotations();
21516
21516
  for (const s of e) {
21517
- if (s.hide(), l(this, X).isDeletedAnnotationElement(s.data.id) || t.has(s.data.id))
21517
+ if (s.hide(), l(this, V).isDeletedAnnotationElement(s.data.id) || t.has(s.data.id))
21518
21518
  continue;
21519
21519
  const i = await this.deserialize(s);
21520
21520
  i && (this.addOrRebuild(i), i.enableEditing());
@@ -21540,14 +21540,14 @@ const Ps = class Ps {
21540
21540
  const {
21541
21541
  id: o
21542
21542
  } = r.data;
21543
- if (l(this, X).isDeletedAnnotationElement(o))
21543
+ if (l(this, V).isDeletedAnnotationElement(o))
21544
21544
  continue;
21545
21545
  let h = e.get(o);
21546
21546
  if (h) {
21547
21547
  h.resetAnnotationElement(r), h.show(!1), r.show();
21548
21548
  continue;
21549
21549
  }
21550
- h = t.get(o), h && (l(this, X).addChangedExistingAnnotation(h), h.renderAnnotationElement(r) && h.show(!1)), r.show();
21550
+ h = t.get(o), h && (l(this, V).addChangedExistingAnnotation(h), h.renderAnnotationElement(r) && h.show(!1)), r.show();
21551
21551
  }
21552
21552
  }
21553
21553
  w(this, St, zu).call(this), this.isEmpty && (this.div.hidden = !0);
@@ -21563,13 +21563,13 @@ const Ps = class Ps {
21563
21563
  return ((e = l(this, wi)) == null ? void 0 : e.getEditableAnnotation(t)) || null;
21564
21564
  }
21565
21565
  setActiveEditor(t) {
21566
- l(this, X).getActive() !== t && l(this, X).setActiveEditor(t);
21566
+ l(this, V).getActive() !== t && l(this, V).setActiveEditor(t);
21567
21567
  }
21568
21568
  enableTextSelection() {
21569
21569
  var t;
21570
21570
  if (this.div.tabIndex = -1, (t = l(this, be)) != null && t.div && !l(this, hn)) {
21571
21571
  m(this, hn, new AbortController());
21572
- const e = l(this, X).combinedSignal(l(this, hn));
21572
+ const e = l(this, V).combinedSignal(l(this, hn));
21573
21573
  l(this, be).div.addEventListener("pointerdown", w(this, St, dy).bind(this), {
21574
21574
  signal: e
21575
21575
  }), l(this, be).div.classList.add("highlighting");
@@ -21583,7 +21583,7 @@ const Ps = class Ps {
21583
21583
  if (l(this, Zn))
21584
21584
  return;
21585
21585
  m(this, Zn, new AbortController());
21586
- const t = l(this, X).combinedSignal(l(this, Zn));
21586
+ const t = l(this, V).combinedSignal(l(this, Zn));
21587
21587
  this.div.addEventListener("pointerdown", this.pointerdown.bind(this), {
21588
21588
  signal: t
21589
21589
  });
@@ -21603,26 +21603,26 @@ const Ps = class Ps {
21603
21603
  const {
21604
21604
  annotationElementId: e
21605
21605
  } = t;
21606
- e && l(this, X).isDeletedAnnotationElement(e) && l(this, X).removeDeletedAnnotationElement(t);
21606
+ e && l(this, V).isDeletedAnnotationElement(e) && l(this, V).removeDeletedAnnotationElement(t);
21607
21607
  }
21608
21608
  detach(t) {
21609
21609
  var e;
21610
- l(this, ws).delete(t.id), (e = l(this, To)) == null || e.removePointerInTextLayer(t.contentDiv), !l(this, lh) && t.annotationElementId && l(this, X).addDeletedAnnotationElement(t);
21610
+ l(this, ws).delete(t.id), (e = l(this, To)) == null || e.removePointerInTextLayer(t.contentDiv), !l(this, lh) && t.annotationElementId && l(this, V).addDeletedAnnotationElement(t);
21611
21611
  }
21612
21612
  remove(t) {
21613
- this.detach(t), l(this, X).removeEditor(t), t.div.remove(), t.isAttachedToDOM = !1;
21613
+ this.detach(t), l(this, V).removeEditor(t), t.div.remove(), t.isAttachedToDOM = !1;
21614
21614
  }
21615
21615
  changeParent(t) {
21616
21616
  var e;
21617
- t.parent !== this && (t.parent && t.annotationElementId && (l(this, X).addDeletedAnnotationElement(t.annotationElementId), Mt.deleteAnnotationElement(t), t.annotationElementId = null), this.attach(t), (e = t.parent) == null || e.detach(t), t.setParent(this), t.div && t.isAttachedToDOM && (t.div.remove(), this.div.append(t.div)));
21617
+ t.parent !== this && (t.parent && t.annotationElementId && (l(this, V).addDeletedAnnotationElement(t.annotationElementId), Mt.deleteAnnotationElement(t), t.annotationElementId = null), this.attach(t), (e = t.parent) == null || e.detach(t), t.setParent(this), t.div && t.isAttachedToDOM && (t.div.remove(), this.div.append(t.div)));
21618
21618
  }
21619
21619
  add(t) {
21620
21620
  if (!(t.parent === this && t.isAttachedToDOM)) {
21621
- if (this.changeParent(t), l(this, X).addEditor(t), this.attach(t), !t.isAttachedToDOM) {
21621
+ if (this.changeParent(t), l(this, V).addEditor(t), this.attach(t), !t.isAttachedToDOM) {
21622
21622
  const e = t.render();
21623
21623
  this.div.append(e), t.isAttachedToDOM = !0;
21624
21624
  }
21625
- t.fixAndSetPosition(), t.onceAdded(!l(this, Eo)), l(this, X).addToAnnotationStorage(t), t._reportTelemetry(t.telemetryInitialData);
21625
+ t.fixAndSetPosition(), t.onceAdded(!l(this, Eo)), l(this, V).addToAnnotationStorage(t), t._reportTelemetry(t.telemetryInitialData);
21626
21626
  }
21627
21627
  }
21628
21628
  moveEditorInDOM(t) {
@@ -21637,7 +21637,7 @@ const Ps = class Ps {
21637
21637
  t._focusEventsAllowed = !0;
21638
21638
  }, {
21639
21639
  once: !0,
21640
- signal: l(this, X)._signal
21640
+ signal: l(this, V)._signal
21641
21641
  }), e.focus());
21642
21642
  }, 0))), t._structTreeParentId = (s = l(this, To)) == null ? void 0 : s.moveElementInDOM(this.div, t.div, t.contentDiv, !0);
21643
21643
  }
@@ -21655,17 +21655,17 @@ const Ps = class Ps {
21655
21655
  });
21656
21656
  }
21657
21657
  getNextId() {
21658
- return l(this, X).getId();
21658
+ return l(this, V).getId();
21659
21659
  }
21660
21660
  combinedSignal(t) {
21661
- return l(this, X).combinedSignal(t);
21661
+ return l(this, V).combinedSignal(t);
21662
21662
  }
21663
21663
  canCreateNewEmptyEditor() {
21664
21664
  var t;
21665
21665
  return (t = l(this, St, ni)) == null ? void 0 : t.canCreateNewEmptyEditor();
21666
21666
  }
21667
21667
  pasteEditor(t, e) {
21668
- l(this, X).updateToolbar(t), l(this, X).updateMode(t);
21668
+ l(this, V).updateToolbar(t), l(this, V).updateMode(t);
21669
21669
  const {
21670
21670
  offsetX: s,
21671
21671
  offsetY: i
@@ -21674,7 +21674,7 @@ const Ps = class Ps {
21674
21674
  id: n,
21675
21675
  x: s,
21676
21676
  y: i,
21677
- uiManager: l(this, X),
21677
+ uiManager: l(this, V),
21678
21678
  isCentered: !0,
21679
21679
  ...e
21680
21680
  });
@@ -21682,7 +21682,7 @@ const Ps = class Ps {
21682
21682
  }
21683
21683
  async deserialize(t) {
21684
21684
  var e;
21685
- return await ((e = l(Ps, er).get(t.annotationType ?? t.annotationEditorType)) == null ? void 0 : e.deserialize(t, this, l(this, X))) || null;
21685
+ return await ((e = l(Ps, er).get(t.annotationType ?? t.annotationEditorType)) == null ? void 0 : e.deserialize(t, this, l(this, V))) || null;
21686
21686
  }
21687
21687
  createAndAddNewEditor(t, e, s = {}) {
21688
21688
  const i = this.getNextId(), n = w(this, St, Kf).call(this, {
@@ -21690,7 +21690,7 @@ const Ps = class Ps {
21690
21690
  id: i,
21691
21691
  x: t.offsetX,
21692
21692
  y: t.offsetY,
21693
- uiManager: l(this, X),
21693
+ uiManager: l(this, V),
21694
21694
  isCentered: e,
21695
21695
  ...s
21696
21696
  });
@@ -21700,13 +21700,13 @@ const Ps = class Ps {
21700
21700
  this.createAndAddNewEditor(w(this, St, Qf).call(this), !0);
21701
21701
  }
21702
21702
  setSelected(t) {
21703
- l(this, X).setSelected(t);
21703
+ l(this, V).setSelected(t);
21704
21704
  }
21705
21705
  toggleSelected(t) {
21706
- l(this, X).toggleSelected(t);
21706
+ l(this, V).toggleSelected(t);
21707
21707
  }
21708
21708
  unselect(t) {
21709
- l(this, X).unselect(t);
21709
+ l(this, V).unselect(t);
21710
21710
  }
21711
21711
  pointerup(t) {
21712
21712
  var s;
@@ -21718,8 +21718,8 @@ const Ps = class Ps {
21718
21718
  m(this, hh, !0);
21719
21719
  return;
21720
21720
  }
21721
- if (l(this, X).getMode() === J.STAMP) {
21722
- l(this, X).unselectAll();
21721
+ if (l(this, V).getMode() === J.STAMP) {
21722
+ l(this, V).unselectAll();
21723
21723
  return;
21724
21724
  }
21725
21725
  this.createAndAddNewEditor(t, !1);
@@ -21727,7 +21727,7 @@ const Ps = class Ps {
21727
21727
  }
21728
21728
  pointerdown(t) {
21729
21729
  var i;
21730
- if (l(this, X).getMode() === J.HIGHLIGHT && this.enableTextSelection(), l(this, tr)) {
21730
+ if (l(this, V).getMode() === J.HIGHLIGHT && this.enableTextSelection(), l(this, tr)) {
21731
21731
  m(this, tr, !1);
21732
21732
  return;
21733
21733
  }
@@ -21740,23 +21740,23 @@ const Ps = class Ps {
21740
21740
  this.startDrawingSession(t);
21741
21741
  return;
21742
21742
  }
21743
- const s = l(this, X).getActive();
21743
+ const s = l(this, V).getActive();
21744
21744
  m(this, hh, !s || s.isEmpty());
21745
21745
  }
21746
21746
  startDrawingSession(t) {
21747
21747
  if (this.div.focus(), l(this, zs)) {
21748
- l(this, St, ni).startDrawing(this, l(this, X), !1, t);
21748
+ l(this, St, ni).startDrawing(this, l(this, V), !1, t);
21749
21749
  return;
21750
21750
  }
21751
- l(this, X).setCurrentDrawingSession(this), m(this, zs, new AbortController());
21752
- const e = l(this, X).combinedSignal(l(this, zs));
21751
+ l(this, V).setCurrentDrawingSession(this), m(this, zs, new AbortController());
21752
+ const e = l(this, V).combinedSignal(l(this, zs));
21753
21753
  this.div.addEventListener("blur", ({
21754
21754
  relatedTarget: s
21755
21755
  }) => {
21756
21756
  s && !this.div.contains(s) && (m(this, an, null), this.commitOrRemove());
21757
21757
  }, {
21758
21758
  signal: e
21759
- }), l(this, St, ni).startDrawing(this, l(this, X), !1, t);
21759
+ }), l(this, St, ni).startDrawing(this, l(this, V), !1, t);
21760
21760
  }
21761
21761
  pause(t) {
21762
21762
  if (t) {
@@ -21772,10 +21772,10 @@ const Ps = class Ps {
21772
21772
  }, 0);
21773
21773
  }
21774
21774
  endDrawingSession(t = !1) {
21775
- return l(this, zs) ? (l(this, X).setCurrentDrawingSession(null), l(this, zs).abort(), m(this, zs, null), m(this, an, null), l(this, St, ni).endDrawing(t)) : null;
21775
+ return l(this, zs) ? (l(this, V).setCurrentDrawingSession(null), l(this, zs).abort(), m(this, zs, null), m(this, an, null), l(this, St, ni).endDrawing(t)) : null;
21776
21776
  }
21777
21777
  findNewParent(t, e, s) {
21778
- const i = l(this, X).findParent(e, s);
21778
+ const i = l(this, V).findParent(e, s);
21779
21779
  return i === null || i === this ? !1 : (i.changeParent(t), !0);
21780
21780
  }
21781
21781
  commitOrRemove() {
@@ -21786,23 +21786,23 @@ const Ps = class Ps {
21786
21786
  }
21787
21787
  destroy() {
21788
21788
  var t, e;
21789
- this.commitOrRemove(), ((t = l(this, X).getActive()) == null ? void 0 : t.parent) === this && (l(this, X).commitOrRemove(), l(this, X).setActiveEditor(null)), l(this, on) && (clearTimeout(l(this, on)), m(this, on, null));
21789
+ this.commitOrRemove(), ((t = l(this, V).getActive()) == null ? void 0 : t.parent) === this && (l(this, V).commitOrRemove(), l(this, V).setActiveEditor(null)), l(this, on) && (clearTimeout(l(this, on)), m(this, on, null));
21790
21790
  for (const s of l(this, ws).values())
21791
21791
  (e = l(this, To)) == null || e.removePointerInTextLayer(s.contentDiv), s.setParent(null), s.isAttachedToDOM = !1, s.div.remove();
21792
- this.div = null, l(this, ws).clear(), l(this, X).removeLayer(this);
21792
+ this.div = null, l(this, ws).clear(), l(this, V).removeLayer(this);
21793
21793
  }
21794
21794
  render({
21795
21795
  viewport: t
21796
21796
  }) {
21797
21797
  this.viewport = t, Ro(this.div, t);
21798
- for (const e of l(this, X).getEditors(this.pageIndex))
21798
+ for (const e of l(this, V).getEditors(this.pageIndex))
21799
21799
  this.add(e), e.rebuild();
21800
21800
  this.updateMode();
21801
21801
  }
21802
21802
  update({
21803
21803
  viewport: t
21804
21804
  }) {
21805
- l(this, X).commitOrRemove(), w(this, St, zu).call(this);
21805
+ l(this, V).commitOrRemove(), w(this, St, zu).call(this);
21806
21806
  const e = this.viewport.rotation, s = t.rotation;
21807
21807
  if (this.viewport = t, Ro(this.div, {
21808
21808
  rotation: s
@@ -21818,11 +21818,11 @@ const Ps = class Ps {
21818
21818
  return [t, e];
21819
21819
  }
21820
21820
  get scale() {
21821
- return l(this, X).viewParameters.realScale;
21821
+ return l(this, V).viewParameters.realScale;
21822
21822
  }
21823
21823
  };
21824
- To = new WeakMap(), hh = new WeakMap(), wi = new WeakMap(), Zn = new WeakMap(), on = new WeakMap(), ws = new WeakMap(), tr = new WeakMap(), lh = new WeakMap(), Eo = new WeakMap(), zs = new WeakMap(), an = new WeakMap(), be = new WeakMap(), hn = new WeakMap(), X = new WeakMap(), er = new WeakMap(), St = new WeakSet(), dy = function(t) {
21825
- l(this, X).unselectAll();
21824
+ To = new WeakMap(), hh = new WeakMap(), wi = new WeakMap(), Zn = new WeakMap(), on = new WeakMap(), ws = new WeakMap(), tr = new WeakMap(), lh = new WeakMap(), Eo = new WeakMap(), zs = new WeakMap(), an = new WeakMap(), be = new WeakMap(), hn = new WeakMap(), V = new WeakMap(), er = new WeakMap(), St = new WeakSet(), dy = function(t) {
21825
+ l(this, V).unselectAll();
21826
21826
  const {
21827
21827
  target: e
21828
21828
  } = t;
@@ -21832,7 +21832,7 @@ To = new WeakMap(), hh = new WeakMap(), wi = new WeakMap(), Zn = new WeakMap(),
21832
21832
  } = Fe.platform;
21833
21833
  if (t.button !== 0 || t.ctrlKey && s)
21834
21834
  return;
21835
- l(this, X).showAllEditors("highlight", !0, !0), l(this, be).div.classList.add("free"), this.toggleDrawing(), cd.startHighlighting(this, l(this, X).direction === "ltr", {
21835
+ l(this, V).showAllEditors("highlight", !0, !0), l(this, be).div.classList.add("free"), this.toggleDrawing(), cd.startHighlighting(this, l(this, V).direction === "ltr", {
21836
21836
  target: l(this, be).div,
21837
21837
  x: t.x,
21838
21838
  y: t.y
@@ -21840,11 +21840,11 @@ To = new WeakMap(), hh = new WeakMap(), wi = new WeakMap(), Zn = new WeakMap(),
21840
21840
  l(this, be).div.classList.remove("free"), this.toggleDrawing(!0);
21841
21841
  }, {
21842
21842
  once: !0,
21843
- signal: l(this, X)._signal
21843
+ signal: l(this, V)._signal
21844
21844
  }), t.preventDefault();
21845
21845
  }
21846
21846
  }, ni = function() {
21847
- return l(Ps, er).get(l(this, X).getMode());
21847
+ return l(Ps, er).get(l(this, V).getMode());
21848
21848
  }, Kf = function(t) {
21849
21849
  const e = l(this, St, ni);
21850
21850
  return e ? new e.prototype.constructor(t) : null;
@@ -22238,77 +22238,77 @@ function RC(a) {
22238
22238
  let n = null, r = null, o = 1, h = { ...OC };
22239
22239
  function c() {
22240
22240
  if (!t || Ss.has(t)) return;
22241
- const E = bC(t);
22242
- return E.on("selection:cleared", () => S(E)), e && E.on("mouse:down", e), s && E.on("mouse:move", s), i && E.on("mouse:up", i), E;
22241
+ const A = bC(t);
22242
+ return A.on("selection:cleared", () => S(A)), e && A.on("mouse:down", e), s && A.on("mouse:move", s), i && A.on("mouse:up", i), A;
22243
22243
  }
22244
- function u(E, P) {
22245
- return kC(E, P, t);
22244
+ function u(A, M) {
22245
+ return kC(A, M, t);
22246
22246
  }
22247
- function d(E) {
22248
- return by(E, t);
22247
+ function d(A) {
22248
+ return by(A, t);
22249
22249
  }
22250
- async function g({ url: E, scale: P = 0.5 }) {
22251
- await py(t, { url: E, scale: P });
22250
+ async function g({ url: A, scale: M = 0.5 }) {
22251
+ await py(t, { url: A, scale: M });
22252
22252
  }
22253
- async function f(E, P, O) {
22254
- const L = Ss.get(t);
22255
- if (!L) return;
22256
- const R = await _e.fromURL(E, {}, { ...PC, ...P });
22257
- Ym(R, O), L.add(R), b(L, R), L.setActiveObject(R);
22253
+ async function f(A, M, O) {
22254
+ const R = Ss.get(t);
22255
+ if (!R) return;
22256
+ const L = await _e.fromURL(A, {}, { ...PC, ...M });
22257
+ Ym(L, O), R.add(L), b(R, L), R.setActiveObject(L);
22258
22258
  }
22259
- function p(E, P, O) {
22260
- const L = Ss.get(t);
22261
- if (!L) return;
22262
- const R = new ve(E, {
22259
+ function p(A, M, O) {
22260
+ const R = Ss.get(t);
22261
+ if (!R) return;
22262
+ const L = new ve(A, {
22263
22263
  ...DC,
22264
- ...P
22264
+ ...M
22265
22265
  });
22266
- Ym(R, O), L.add(R), b(L, R), L.setActiveObject(R);
22266
+ Ym(L, O), R.add(L), b(R, L), R.setActiveObject(L);
22267
22267
  }
22268
- function b(E, P) {
22269
- P.on("selected", (O) => _({ canvas: E, target: O.target })), P.on("modified", (O) => zh(O.target, n)), P.on("scaling", (O) => zh(O.transform.target, n)), P.on("moving", (O) => zh(O.transform.target, n)), P.on("rotating", (O) => zh(O.transform.target, n));
22268
+ function b(A, M) {
22269
+ M.on("selected", (O) => _({ canvas: A, target: O.target })), M.on("modified", (O) => zh(O.target, n)), M.on("scaling", (O) => zh(O.transform.target, n)), M.on("moving", (O) => zh(O.transform.target, n)), M.on("rotating", (O) => zh(O.transform.target, n));
22270
22270
  }
22271
22271
  async function _({
22272
- canvas: E,
22273
- target: P,
22272
+ canvas: A,
22273
+ target: M,
22274
22274
  stroke: O = h.stroke,
22275
- uuid: L = Date.now()
22275
+ uuid: R = Date.now()
22276
22276
  }) {
22277
- if ((n == null ? void 0 : n.stroke) === `${O}-${L}`) return;
22278
- const R = await _C(h.src, O, L);
22279
- S(E), n = R, r = P, y(E, P, L), x(o, !0), E.add(R);
22277
+ if ((n == null ? void 0 : n.stroke) === `${O}-${R}`) return;
22278
+ const L = await _C(h.src, O, R);
22279
+ S(A), n = L, r = M, y(A, M, R), x(o, !0), A.add(L);
22280
22280
  }
22281
- function y(E, P, O) {
22281
+ function y(A, M, O) {
22282
22282
  n && (n.on("selected", () => {
22283
- E.remove(P), S(E);
22283
+ A.remove(M), S(A);
22284
22284
  }), n.on("mouseover", () => {
22285
22285
  _({
22286
- canvas: E,
22287
- target: P,
22286
+ canvas: A,
22287
+ target: M,
22288
22288
  stroke: h.hoverStroke,
22289
22289
  uuid: O
22290
22290
  });
22291
22291
  }), n.on("mouseout", () => {
22292
- _({ canvas: E, target: P, stroke: h.stroke, uuid: O });
22292
+ _({ canvas: A, target: M, stroke: h.stroke, uuid: O });
22293
22293
  }));
22294
22294
  }
22295
- function x(E, P = !1) {
22295
+ function x(A, M = !1) {
22296
22296
  const O = Ss.get(t);
22297
- o = E, O && (CC(r, E, h), SC(r, E, n), !P && O.renderAll());
22297
+ o = A, O && (CC(r, A, h), SC(r, A, n), !M && O.renderAll());
22298
22298
  }
22299
- function C(E) {
22300
- if (!E) return;
22301
- h = { ...h, ...E };
22302
- const P = Ss.get(t);
22303
- !n || !r || !P || _({ target: r, canvas: P });
22299
+ function C(A) {
22300
+ if (!A) return;
22301
+ h = { ...h, ...A };
22302
+ const M = Ss.get(t);
22303
+ !n || !r || !M || _({ target: r, canvas: M });
22304
22304
  }
22305
- function S(E) {
22306
- n && (E.remove(n), n = r = null);
22305
+ function S(A) {
22306
+ n && (A.remove(n), n = r = null);
22307
22307
  }
22308
22308
  function k() {
22309
22309
  AC(t);
22310
22310
  }
22311
- function M() {
22311
+ function D() {
22312
22312
  TC(t);
22313
22313
  }
22314
22314
  return {
@@ -22319,7 +22319,7 @@ function RC(a) {
22319
22319
  addFabric: f,
22320
22320
  addTextFabric: p,
22321
22321
  clearActive: k,
22322
- deleteCanvas: M,
22322
+ deleteCanvas: D,
22323
22323
  scaleFabric: x,
22324
22324
  setCloseSvgOptions: C
22325
22325
  };
@@ -22367,45 +22367,46 @@ const NC = /* @__PURE__ */ wy({
22367
22367
  setCloseSvgOptions: y
22368
22368
  } = RC({
22369
22369
  id: o,
22370
- pointerDown: (M) => i("pointerDown", M),
22371
- pointerMove: (M) => i("pointerMove", M),
22372
- pointerUp: (M) => i("pointerUp", M)
22373
- });
22374
- x(), LC(() => {
22375
- s.manualReload || x(), i("reload");
22370
+ pointerDown: (A) => i("pointerDown", A),
22371
+ pointerMove: (A) => i("pointerMove", A),
22372
+ pointerUp: (A) => i("pointerUp", A)
22376
22373
  });
22374
+ x(), LC(D);
22377
22375
  async function x() {
22378
- const { file: M, page: E, fileScale: P } = s;
22376
+ const { file: A, page: M, fileScale: O } = s;
22379
22377
  window.requestAnimationFrame(async () => {
22380
- if (await Cy(), c(), M.PDFBase64.startsWith("data:image") || M.canvas) {
22381
- const { canvas: O } = M, L = O ? 7 : 3, R = O != null && O.length ? O[E - 1] : M.PDFBase64;
22382
- f({ url: R, scale: P / L }), i("loaded");
22378
+ if (await Cy(), c(), A.PDFBase64.startsWith("data:image") || A.canvas) {
22379
+ const { canvas: R } = A, L = R ? 7 : 3, X = R != null && R.length ? R[M - 1] : A.PDFBase64;
22380
+ f({ url: X, scale: O / L }), i("loaded");
22383
22381
  return;
22384
22382
  }
22385
22383
  await u({
22386
- page: E,
22387
- PDFBase64: M.PDFBase64,
22388
- scale: P,
22384
+ page: M,
22385
+ PDFBase64: A.PDFBase64,
22386
+ scale: O,
22389
22387
  password: s.password
22390
22388
  }), i("loaded");
22391
22389
  });
22392
22390
  }
22393
- function C(M) {
22394
- if (!s.isDrop || !M.dataTransfer) return;
22395
- const { dataTransfer: E, offsetX: P, offsetY: O } = M, L = E.getData("text/plain"), R = E.getData("text/uri-list"), U = E.getData("custom/offset"), z = U ? JSON.parse(U) : null, V = { top: O, left: P }, rt = { x: (z == null ? void 0 : z.offsetX) ?? 0, y: (z == null ? void 0 : z.offsetY) ?? 0 };
22396
- R ? S(R, V, rt) : L && k(L, V, rt);
22391
+ function C(A) {
22392
+ if (!s.isDrop || !A.dataTransfer) return;
22393
+ const { dataTransfer: M, offsetX: O, offsetY: R } = A, L = M.getData("text/plain"), X = M.getData("text/uri-list"), U = M.getData("custom/offset"), G = U ? JSON.parse(U) : null, rt = { top: R, left: O }, F = { x: (G == null ? void 0 : G.offsetX) ?? 0, y: (G == null ? void 0 : G.offsetY) ?? 0 };
22394
+ X ? S(X, rt, F) : L && k(L, rt, F);
22397
22395
  }
22398
- function S(M, E, P) {
22399
- d(M, { ...s.dropImageOptions, ...E }, P);
22396
+ function S(A, M, O) {
22397
+ d(A, { ...s.dropImageOptions, ...M }, O);
22400
22398
  }
22401
- function k(M, E, P) {
22402
- g(M, { ...s.dropTextOptions, ...E }, P);
22399
+ function k(A, M, O) {
22400
+ g(A, { ...s.dropTextOptions, ...M }, O);
22401
+ }
22402
+ function D() {
22403
+ s.manualReload || x(), i("reload");
22403
22404
  }
22404
- return tg([() => s.fileScale, () => s.page, () => s.file, () => s.password], x), tg(h, (M) => _(M), { immediate: !0 }), tg(() => s.closeSvgOptions, y, { immediate: !0 }), n(b), t({ reload: x, addImage: S, addText: k, clearActive: p, deleteCanvas: b, canvasRef: r }), (M, E) => (Ty(), Ay("div", {
22405
+ return tg([() => s.fileScale, () => s.page, () => s.file, () => s.password], D), tg(h, (A) => _(A), { immediate: !0 }), tg(() => s.closeSvgOptions, y, { immediate: !0 }), n(b), t({ reload: x, addImage: S, addText: k, clearActive: p, deleteCanvas: b, canvasRef: r }), (A, M) => (Ty(), Ay("div", {
22405
22406
  style: Ey({ transform: `scale(${h.value})` }),
22406
- onDragover: E[0] || (E[0] = eg(() => {
22407
+ onDragover: M[0] || (M[0] = eg(() => {
22407
22408
  }, ["stop", "prevent"])),
22408
- onDragenter: E[1] || (E[1] = eg(() => {
22409
+ onDragenter: M[1] || (M[1] = eg(() => {
22409
22410
  }, ["stop", "prevent"])),
22410
22411
  onDrop: eg(C, ["stop", "prevent"])
22411
22412
  }, [
@@ -22413,7 +22414,7 @@ const NC = /* @__PURE__ */ wy({
22413
22414
  id: o,
22414
22415
  ref_key: "canvasRef",
22415
22416
  ref: r,
22416
- class: My(M.canvasClass)
22417
+ class: My(A.canvasClass)
22417
22418
  }, null, 2)
22418
22419
  ], 36));
22419
22420
  }