@anu3ev/fabric-image-editor 0.5.9 → 0.5.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/main.js +420 -398
  2. package/package.json +1 -1
  3. package/readme.md +27 -8
package/dist/main.js CHANGED
@@ -2,7 +2,7 @@ var ds = Object.defineProperty, ls = Object.defineProperties;
2
2
  var hs = Object.getOwnPropertyDescriptors;
3
3
  var Gt = Object.getOwnPropertySymbols;
4
4
  var _e = Object.prototype.hasOwnProperty, Ne = Object.prototype.propertyIsEnumerable;
5
- var Re = (h, t, e) => t in h ? ds(h, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : h[t] = e, _ = (h, t) => {
5
+ var Re = (h, t, e) => t in h ? ds(h, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : h[t] = e, N = (h, t) => {
6
6
  for (var e in t || (t = {}))
7
7
  _e.call(t, e) && Re(h, e, t[e]);
8
8
  if (Gt)
@@ -19,7 +19,7 @@ var vt = (h, t) => {
19
19
  t.indexOf(s) < 0 && Ne.call(h, s) && (e[s] = h[s]);
20
20
  return e;
21
21
  };
22
- var N = (h, t, e) => new Promise((s, o) => {
22
+ var x = (h, t, e) => new Promise((s, o) => {
23
23
  var n = (r) => {
24
24
  try {
25
25
  a(e.next(r));
@@ -175,7 +175,7 @@ class Ut {
175
175
  * @param event.code — код клавиши
176
176
  */
177
177
  handleUndoRedoEvent(t) {
178
- return N(this, null, function* () {
178
+ return x(this, null, function* () {
179
179
  const { ctrlKey: e, metaKey: s, code: o, repeat: n } = t;
180
180
  this._shouldIgnoreKeyboardEvent(t) || !e && !s || n || !/Mac/i.test(navigator.userAgent) && this.isUndoRedoKeyPressed || (o === "KeyZ" ? (t.preventDefault(), this.isUndoRedoKeyPressed = !0, yield this.editor.historyManager.undo()) : o === "KeyY" && (t.preventDefault(), this.isUndoRedoKeyPressed = !0, yield this.editor.historyManager.redo()));
181
181
  });
@@ -694,7 +694,7 @@ const B = class B {
694
694
  this.fonts = t;
695
695
  }
696
696
  loadFonts() {
697
- return N(this, null, function* () {
697
+ return x(this, null, function* () {
698
698
  var o;
699
699
  const t = (o = this.fonts) != null ? o : [];
700
700
  if (!t.length) return;
@@ -705,7 +705,7 @@ const B = class B {
705
705
  });
706
706
  }
707
707
  static loadFont(t, e) {
708
- return N(this, null, function* () {
708
+ return x(this, null, function* () {
709
709
  var c, d;
710
710
  const s = typeof FontFace != "undefined", o = (c = t.family) == null ? void 0 : c.trim(), n = (d = t.source) == null ? void 0 : d.trim();
711
711
  if (!o || !n) return;
@@ -932,7 +932,7 @@ const _s = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMj
932
932
  sendBackwards: ks
933
933
  },
934
934
  handlers: {
935
- copyPaste: (h) => N(null, null, function* () {
935
+ copyPaste: (h) => x(null, null, function* () {
936
936
  h.clipboardManager.copyPaste();
937
937
  }),
938
938
  delete: (h) => {
@@ -965,11 +965,11 @@ class Ys {
965
965
  _initToolbar() {
966
966
  if (!this.options.showToolbar) return;
967
967
  const t = this.options.toolbar || {};
968
- this.config = yt(_(_({}, Pt), t), {
969
- style: _(_({}, Pt.style), t.style || {}),
970
- btnStyle: _(_({}, Pt.btnStyle), t.btnStyle || {}),
971
- icons: _(_({}, Pt.icons), t.icons || {}),
972
- handlers: _(_({}, Pt.handlers), t.handlers || {})
968
+ this.config = yt(N(N({}, Pt), t), {
969
+ style: N(N({}, Pt.style), t.style || {}),
970
+ btnStyle: N(N({}, Pt.btnStyle), t.btnStyle || {}),
971
+ icons: N(N({}, Pt.icons), t.icons || {}),
972
+ handlers: N(N({}, Pt.handlers), t.handlers || {})
973
973
  }), this.currentTarget = null, this.currentLocked = !1, this.isTransforming = !1, this.isTemporarilyHidden = !1, this._onMouseDown = this._handleMouseDown.bind(this), this._onObjectMoving = this._startTransform.bind(this), this._onObjectScaling = this._startTransform.bind(this), this._onObjectRotating = this._startTransform.bind(this), this._onMouseUp = this._endTransform.bind(this), this._onObjectModified = this._endTransform.bind(this), this._onSelectionChange = this._updateToolbar.bind(this), this._onSelectionClear = () => {
974
974
  this.el.style.display = "none";
975
975
  }, this._createDOM(), this._bindEvents();
@@ -1377,7 +1377,7 @@ class Jt {
1377
1377
  * @fires editor:history-state-loaded
1378
1378
  */
1379
1379
  loadStateFromFullState(t) {
1380
- return N(this, null, function* () {
1380
+ return x(this, null, function* () {
1381
1381
  if (!t) return;
1382
1382
  console.log("loadStateFromFullState fullState", t);
1383
1383
  const { canvas: e, canvasManager: s, interactionBlocker: o, backgroundManager: n } = this.editor, { width: i, height: a } = e;
@@ -1404,7 +1404,7 @@ class Jt {
1404
1404
  * @fires editor:undo
1405
1405
  */
1406
1406
  undo() {
1407
- return N(this, null, function* () {
1407
+ return x(this, null, function* () {
1408
1408
  if (!this.skipHistory) {
1409
1409
  if (this.currentIndex <= 0) {
1410
1410
  console.log("Нет предыдущих состояний для отмены.");
@@ -1441,7 +1441,7 @@ class Jt {
1441
1441
  * @fires editor:redo
1442
1442
  */
1443
1443
  redo() {
1444
- return N(this, null, function* () {
1444
+ return x(this, null, function* () {
1445
1445
  if (!this.skipHistory) {
1446
1446
  if (this.currentIndex >= this.patches.length) {
1447
1447
  console.log("Нет состояний для повтора.");
@@ -1528,7 +1528,7 @@ class ct {
1528
1528
  * @returns возвращает Promise с объектом изображения или null в случае ошибки
1529
1529
  */
1530
1530
  importImage(t) {
1531
- return N(this, null, function* () {
1531
+ return x(this, null, function* () {
1532
1532
  const {
1533
1533
  source: e,
1534
1534
  scale: s = `image-${this.options.scaleType}`,
@@ -1593,18 +1593,18 @@ class ct {
1593
1593
  const A = b.getElement();
1594
1594
  let j = "";
1595
1595
  if (A instanceof HTMLImageElement ? j = A.src : A instanceof HTMLCanvasElement && (j = A.toDataURL()), y > wt || I > Mt) {
1596
- const w = yield this.resizeImageToBoundaries(j, "max"), T = URL.createObjectURL(w);
1597
- this._createdBlobUrls.push(T), b = yield zt.fromURL(T, { crossOrigin: "anonymous" });
1596
+ const S = yield this.resizeImageToBoundaries(j, "max"), C = URL.createObjectURL(S);
1597
+ this._createdBlobUrls.push(C), b = yield zt.fromURL(C, { crossOrigin: "anonymous" });
1598
1598
  } else if (y < _t || I < Rt) {
1599
- const w = yield this.resizeImageToBoundaries(j, "min"), T = URL.createObjectURL(w);
1600
- this._createdBlobUrls.push(T), b = yield zt.fromURL(T, { crossOrigin: "anonymous" });
1599
+ const S = yield this.resizeImageToBoundaries(j, "min"), C = URL.createObjectURL(S);
1600
+ this._createdBlobUrls.push(C), b = yield zt.fromURL(C, { crossOrigin: "anonymous" });
1601
1601
  }
1602
1602
  }
1603
1603
  if (b.set("id", `${b.type}-${G()}`), b.set("format", f), s === "scale-montage")
1604
1604
  this.editor.canvasManager.scaleMontageAreaToImage({ object: b, withoutSave: !0 });
1605
1605
  else {
1606
- const { width: A, height: j } = c, w = this.calculateScaleFactor({ imageObject: b, scaleType: s });
1607
- s === "image-contain" && w < 1 ? d.fitObject({ object: b, type: "contain", withoutSave: !0 }) : s === "image-cover" && (I > A || y > j) && d.fitObject({ object: b, type: "cover", withoutSave: !0 });
1606
+ const { width: A, height: j } = c, S = this.calculateScaleFactor({ imageObject: b, scaleType: s });
1607
+ s === "image-contain" && S < 1 ? d.fitObject({ object: b, type: "contain", withoutSave: !0 }) : s === "image-cover" && (I > A || y > j) && d.fitObject({ object: b, type: "cover", withoutSave: !0 });
1608
1608
  }
1609
1609
  r.add(b), r.centerObject(b), a || r.setActiveObject(b), r.renderAll(), l.resumeHistory(), o || l.saveState();
1610
1610
  const M = {
@@ -1648,7 +1648,7 @@ class ct {
1648
1648
  * @returns возвращает Promise с Blob-объектом уменьшенного изображения
1649
1649
  */
1650
1650
  resizeImageToBoundaries(t, e = "max") {
1651
- return N(this, null, function* () {
1651
+ return x(this, null, function* () {
1652
1652
  let s = `Размер изображения больше максимального размера канваса, поэтому оно будет уменьшено до максимальных размеров c сохранением пропорций: ${Mt}x${wt}`;
1653
1653
  e === "min" && (s = `Размер изображения меньше минимального размера канваса, поэтому оно будет увеличено до минимальных размеров c сохранением пропорций: ${Rt}x${_t}`);
1654
1654
  const o = {
@@ -1680,7 +1680,7 @@ class ct {
1680
1680
  * @fires editor:canvas-exported
1681
1681
  */
1682
1682
  exportCanvasAsImageFile() {
1683
- return N(this, arguments, function* (t = {}) {
1683
+ return x(this, arguments, function* (t = {}) {
1684
1684
  const {
1685
1685
  fileName: e = "image.png",
1686
1686
  contentType: s = "image/png",
@@ -1692,18 +1692,18 @@ class ct {
1692
1692
  a.setCoords();
1693
1693
  const { left: g, top: f, width: p, height: m } = a.getBoundingRect(), v = yield i.clone(["id", "format", "locked"]);
1694
1694
  v.enableRetinaScaling = !1, ["image/jpg", "image/jpeg"].includes(l) && (v.backgroundColor = "#ffffff");
1695
- const b = v.getObjects().find((S) => S.id === a.id);
1695
+ const b = v.getObjects().find((w) => w.id === a.id);
1696
1696
  if (b && (b.visible = !1), c != null && c.isBlocked) {
1697
- const S = v.getObjects().find((C) => C.id === c.overlayMask.id);
1698
- S && (S.visible = !1);
1697
+ const w = v.getObjects().find((T) => T.id === c.overlayMask.id);
1698
+ w && (w.visible = !1);
1699
1699
  }
1700
1700
  v.viewportTransform = [1, 0, 0, 1, -g, -f], v.setDimensions({ width: p, height: m }, { backstoreOnly: !0 }), v.renderAll();
1701
- const I = v.getObjects().filter((S) => S.format).every((S) => S.format === "svg");
1701
+ const I = v.getObjects().filter((w) => w.format).every((w) => w.format === "svg");
1702
1702
  if (u === "svg" && I) {
1703
- const S = v.toSVG();
1703
+ const w = v.toSVG();
1704
1704
  v.dispose();
1705
- const x = {
1706
- image: ct._exportSVGStringAsFile(S, {
1705
+ const E = {
1706
+ image: ct._exportSVGStringAsFile(w, {
1707
1707
  exportAsBase64: o,
1708
1708
  exportAsBlob: n,
1709
1709
  fileName: e
@@ -1712,21 +1712,21 @@ class ct {
1712
1712
  contentType: "image/svg+xml",
1713
1713
  fileName: e.replace(/\.[^/.]+$/, ".svg")
1714
1714
  };
1715
- return i.fire("editor:canvas-exported", x), x;
1715
+ return i.fire("editor:canvas-exported", E), E;
1716
1716
  }
1717
- const y = yield new Promise((S, C) => {
1718
- v.getElement().toBlob((x) => {
1719
- x ? S(x) : C(new Error("Failed to create Blob from canvas"));
1717
+ const y = yield new Promise((w, T) => {
1718
+ v.getElement().toBlob((E) => {
1719
+ E ? w(E) : T(new Error("Failed to create Blob from canvas"));
1720
1720
  });
1721
1721
  });
1722
1722
  if (v.dispose(), n) {
1723
- const S = {
1723
+ const w = {
1724
1724
  image: y,
1725
1725
  format: u,
1726
1726
  contentType: l,
1727
1727
  fileName: e
1728
1728
  };
1729
- return i.fire("editor:canvas-exported", S), S;
1729
+ return i.fire("editor:canvas-exported", w), w;
1730
1730
  }
1731
1731
  const M = yield createImageBitmap(y), A = yield r.post(
1732
1732
  "toDataURL",
@@ -1734,44 +1734,44 @@ class ct {
1734
1734
  [M]
1735
1735
  );
1736
1736
  if (d) {
1737
- const C = p * 0.264583, x = m * 0.264583, W = (yield this.editor.moduleLoader.loadModule("jspdf")).jsPDF, Y = new W({
1738
- orientation: C > x ? "landscape" : "portrait",
1737
+ const T = p * 0.264583, E = m * 0.264583, U = (yield this.editor.moduleLoader.loadModule("jspdf")).jsPDF, z = new U({
1738
+ orientation: T > E ? "landscape" : "portrait",
1739
1739
  unit: "mm",
1740
- format: [C, x]
1740
+ format: [T, E]
1741
1741
  });
1742
- if (Y.addImage(String(A), "JPG", 0, 0, C, x), o) {
1743
- const P = {
1744
- image: Y.output("datauristring"),
1742
+ if (z.addImage(String(A), "JPG", 0, 0, T, E), o) {
1743
+ const F = {
1744
+ image: z.output("datauristring"),
1745
1745
  format: "pdf",
1746
1746
  contentType: "application/pdf",
1747
1747
  fileName: e
1748
1748
  };
1749
- return i.fire("editor:canvas-exported", P), P;
1749
+ return i.fire("editor:canvas-exported", F), F;
1750
1750
  }
1751
- const H = Y.output("blob"), L = {
1752
- image: new File([H], e, { type: "application/pdf" }),
1751
+ const Y = z.output("blob"), D = {
1752
+ image: new File([Y], e, { type: "application/pdf" }),
1753
1753
  format: "pdf",
1754
1754
  contentType: "application/pdf",
1755
1755
  fileName: e
1756
1756
  };
1757
- return i.fire("editor:canvas-exported", L), L;
1757
+ return i.fire("editor:canvas-exported", D), D;
1758
1758
  }
1759
1759
  if (o) {
1760
- const S = {
1760
+ const w = {
1761
1761
  image: A,
1762
1762
  format: u,
1763
1763
  contentType: l,
1764
1764
  fileName: e
1765
1765
  };
1766
- return i.fire("editor:canvas-exported", S), S;
1766
+ return i.fire("editor:canvas-exported", w), w;
1767
1767
  }
1768
- const j = u === "svg" && !I ? e.replace(/\.[^/.]+$/, ".png") : e, T = {
1768
+ const j = u === "svg" && !I ? e.replace(/\.[^/.]+$/, ".png") : e, C = {
1769
1769
  image: new File([y], j, { type: l }),
1770
1770
  format: u,
1771
1771
  contentType: l,
1772
1772
  fileName: j
1773
1773
  };
1774
- return i.fire("editor:canvas-exported", T), T;
1774
+ return i.fire("editor:canvas-exported", C), C;
1775
1775
  } catch (d) {
1776
1776
  return this.editor.errorManager.emitError({
1777
1777
  origin: "ImageManager",
@@ -1795,7 +1795,7 @@ class ct {
1795
1795
  * @fires editor:object-exported
1796
1796
  */
1797
1797
  exportObjectAsImageFile() {
1798
- return N(this, arguments, function* (t = {}) {
1798
+ return x(this, arguments, function* (t = {}) {
1799
1799
  const {
1800
1800
  object: e,
1801
1801
  fileName: s = "image.png",
@@ -1908,7 +1908,7 @@ class ct {
1908
1908
  * @public
1909
1909
  */
1910
1910
  getContentType(t) {
1911
- return N(this, null, function* () {
1911
+ return x(this, null, function* () {
1912
1912
  return typeof t == "string" ? this.getContentTypeFromUrl(t) : t.type || "application/octet-stream";
1913
1913
  });
1914
1914
  }
@@ -1919,7 +1919,7 @@ class ct {
1919
1919
  * @public
1920
1920
  */
1921
1921
  getContentTypeFromUrl(t) {
1922
- return N(this, null, function* () {
1922
+ return x(this, null, function* () {
1923
1923
  if (t.startsWith("data:")) {
1924
1924
  const e = t.match(/^data:([^;]+)/);
1925
1925
  return e ? e[1] : "application/octet-stream";
@@ -2621,8 +2621,8 @@ class Js {
2621
2621
  _calculateEmptySpaceRatio(t) {
2622
2622
  const { canvas: e, montageArea: s } = this.editor, o = e.viewportTransform, n = e.getWidth(), i = e.getHeight(), a = s.left - s.width / 2, r = s.left + s.width / 2, c = s.top - s.height / 2, d = s.top + s.height / 2, l = -o[4] / t, u = (-o[4] + n) / t, g = -o[5] / t, f = (-o[5] + i) / t, p = l < a, m = u > r, v = g < c, b = f > d;
2623
2623
  if (!(p || m || v || b)) return 0;
2624
- const y = Math.max(0, a - l), M = Math.max(0, u - r), A = Math.max(0, c - g), j = Math.max(0, f - d), w = Math.max(y, M), T = Math.max(A, j), S = w / n, C = T / i;
2625
- return Math.max(S, C);
2624
+ const y = Math.max(0, a - l), M = Math.max(0, u - r), A = Math.max(0, c - g), j = Math.max(0, f - d), S = Math.max(y, M), C = Math.max(A, j), w = S / n, T = C / i;
2625
+ return Math.max(w, T);
2626
2626
  }
2627
2627
  /**
2628
2628
  * Вычисляет плавный шаг перемещения viewport к центру с ускорением
@@ -2638,8 +2638,8 @@ class Js {
2638
2638
  const { canvas: i, montageArea: a } = this.editor, r = i.viewportTransform, c = i.getWidth(), d = i.getHeight(), l = t.x - r[4], u = t.y - r[5], g = Math.abs(o), f = e - s;
2639
2639
  if (Math.abs(f) / g <= 0.1)
2640
2640
  return { x: l, y: u };
2641
- const m = c / 2, v = d / 2, b = a.left, I = a.top, y = m - b * s, M = v - I * s, A = (y - r[4]) / (e - s), j = (M - r[5]) / (e - s), w = A * g, T = j * g, S = w * n, C = T * n, x = Math.abs(S) > Math.abs(l) ? l : S, W = Math.abs(C) > Math.abs(u) ? u : C;
2642
- return { x, y: W };
2641
+ const m = c / 2, v = d / 2, b = a.left, I = a.top, y = m - b * s, M = v - I * s, A = (y - r[4]) / (e - s), j = (M - r[5]) / (e - s), S = A * g, C = j * g, w = S * n, T = C * n, E = Math.abs(w) > Math.abs(l) ? l : w, U = Math.abs(T) > Math.abs(u) ? u : T;
2642
+ return { x: E, y: U };
2643
2643
  }
2644
2644
  /**
2645
2645
  * Применяет плавное центрирование viewport при приближении к defaultZoom.
@@ -2968,7 +2968,7 @@ class Ot {
2968
2968
  * @param options.withoutSave - Если true, не сохранять состояние в историю
2969
2969
  */
2970
2970
  setImageBackground(o) {
2971
- return N(this, arguments, function* ({
2971
+ return x(this, arguments, function* ({
2972
2972
  imageSource: t,
2973
2973
  customData: e = {},
2974
2974
  withoutSave: s = !1
@@ -3061,7 +3061,7 @@ class Ot {
3061
3061
  * @param source - источник изображения (URL или File)
3062
3062
  */
3063
3063
  _createImageBackground(t, e) {
3064
- return N(this, null, function* () {
3064
+ return x(this, null, function* () {
3065
3065
  var o;
3066
3066
  const { image: s } = (o = yield this.editor.imageManager.importImage({
3067
3067
  source: t,
@@ -3336,7 +3336,7 @@ class to {
3336
3336
  "height",
3337
3337
  "fill"
3338
3338
  ]);
3339
- const { canvas: u } = this.editor, g = new gs(_({
3339
+ const { canvas: u } = this.editor, g = new gs(N({
3340
3340
  id: t,
3341
3341
  left: e,
3342
3342
  top: s,
@@ -3376,7 +3376,7 @@ class to {
3376
3376
  "radius",
3377
3377
  "fill"
3378
3378
  ]);
3379
- const { canvas: l } = this.editor, u = new fs(_({
3379
+ const { canvas: l } = this.editor, u = new fs(N({
3380
3380
  id: t,
3381
3381
  left: e,
3382
3382
  top: s,
@@ -3418,7 +3418,7 @@ class to {
3418
3418
  "height",
3419
3419
  "fill"
3420
3420
  ]);
3421
- const { canvas: u } = this.editor, g = new ps(_({
3421
+ const { canvas: u } = this.editor, g = new ps(N({
3422
3422
  id: t,
3423
3423
  left: e,
3424
3424
  top: s,
@@ -3457,7 +3457,7 @@ class eo {
3457
3457
  * Асинхронное клонирование для внутреннего буфера
3458
3458
  */
3459
3459
  _cloneToInternalClipboard(t) {
3460
- return N(this, null, function* () {
3460
+ return x(this, null, function* () {
3461
3461
  const { canvas: e, errorManager: s } = this.editor;
3462
3462
  try {
3463
3463
  const o = yield t.clone(Xt);
@@ -3477,7 +3477,7 @@ class eo {
3477
3477
  * Копирование в системный буфер обмена
3478
3478
  */
3479
3479
  _copyToSystemClipboard(t) {
3480
- return N(this, null, function* () {
3480
+ return x(this, null, function* () {
3481
3481
  const { errorManager: e } = this.editor;
3482
3482
  if (typeof ClipboardItem == "undefined" || !navigator.clipboard)
3483
3483
  return e.emitWarning({
@@ -3504,7 +3504,7 @@ class eo {
3504
3504
  * Копирование изображения в буфер обмена
3505
3505
  */
3506
3506
  _copyImageToClipboard(t, e) {
3507
- return N(this, null, function* () {
3507
+ return x(this, null, function* () {
3508
3508
  try {
3509
3509
  const o = t.toCanvasElement({ enableRetinaScaling: !1 }).toDataURL(), n = o.slice(5).split(";")[0], i = o.split(",")[1], a = atob(i), r = new Uint8Array(a.length);
3510
3510
  for (let l = 0; l < a.length; l += 1)
@@ -3526,7 +3526,7 @@ class eo {
3526
3526
  * Копирование текста в буфер обмена
3527
3527
  */
3528
3528
  _copyTextToClipboard(t) {
3529
- return N(this, null, function* () {
3529
+ return x(this, null, function* () {
3530
3530
  try {
3531
3531
  const e = `${Ze}${t}`;
3532
3532
  return yield navigator.clipboard.writeText(e), console.info("Text copied to clipboard successfully"), !0;
@@ -3561,7 +3561,7 @@ class eo {
3561
3561
  * @param source - источник изображения (data URL или URL)
3562
3562
  */
3563
3563
  _handleImageImport(t) {
3564
- return N(this, null, function* () {
3564
+ return x(this, null, function* () {
3565
3565
  var s;
3566
3566
  const { image: e } = (s = yield this.editor.imageManager.importImage({
3567
3567
  source: t,
@@ -3577,7 +3577,7 @@ class eo {
3577
3577
  * @fires editor:object-pasted
3578
3578
  */
3579
3579
  copyPaste(t) {
3580
- return N(this, null, function* () {
3580
+ return x(this, null, function* () {
3581
3581
  const { canvas: e } = this.editor, s = t || e.getActiveObject();
3582
3582
  if (!s || s.locked) return !1;
3583
3583
  try {
@@ -3612,7 +3612,7 @@ class eo {
3612
3612
  * @param event.clipboardData.items — элементы буфера обмена
3613
3613
  */
3614
3614
  handlePasteEvent(e) {
3615
- return N(this, arguments, function* ({ clipboardData: t }) {
3615
+ return x(this, arguments, function* ({ clipboardData: t }) {
3616
3616
  var r;
3617
3617
  if (!((r = t == null ? void 0 : t.items) != null && r.length)) {
3618
3618
  this.paste();
@@ -3663,7 +3663,7 @@ class eo {
3663
3663
  * @fires editor:object-pasted
3664
3664
  */
3665
3665
  paste() {
3666
- return N(this, null, function* () {
3666
+ return x(this, null, function* () {
3667
3667
  const { canvas: t } = this.editor;
3668
3668
  if (!this.clipboard) return !1;
3669
3669
  try {
@@ -4082,7 +4082,7 @@ class Yt {
4082
4082
  message: i,
4083
4083
  data: o
4084
4084
  };
4085
- this._buffer.push(_({
4085
+ this._buffer.push(N({
4086
4086
  type: "editor:error"
4087
4087
  }, a)), this.editor.canvas.fire("editor:error", a);
4088
4088
  }
@@ -4110,7 +4110,7 @@ class Yt {
4110
4110
  message: i,
4111
4111
  data: n
4112
4112
  };
4113
- this._buffer.push(_({
4113
+ this._buffer.push(N({
4114
4114
  type: "editor:warning"
4115
4115
  }, a)), this.editor.canvas.fire("editor:warning", a);
4116
4116
  }
@@ -4237,7 +4237,7 @@ const at = ({
4237
4237
  }
4238
4238
  _getTransformedDimensions(t = {}) {
4239
4239
  const { width: e, height: s } = this._getBackgroundDimensions();
4240
- return super._getTransformedDimensions(yt(_({}, t), {
4240
+ return super._getTransformedDimensions(yt(N({}, t), {
4241
4241
  width: e,
4242
4242
  height: s
4243
4243
  }));
@@ -4247,7 +4247,7 @@ const at = ({
4247
4247
  */
4248
4248
  toObject(t = []) {
4249
4249
  const e = super.toObject(t);
4250
- return yt(_({}, e), {
4250
+ return yt(N({}, e), {
4251
4251
  backgroundOpacity: this.backgroundOpacity,
4252
4252
  paddingTop: this.paddingTop,
4253
4253
  paddingRight: this.paddingRight,
@@ -4419,7 +4419,7 @@ const io = () => {
4419
4419
  if (!(t <= 0))
4420
4420
  return h != null ? h : "#000000";
4421
4421
  }, Ke = ({ width: h = 0 }) => h ? Math.max(0, h) : 0, ie = ({ value: h }) => typeof h == "string" ? h.toLocaleUpperCase() : "", st = 0.01;
4422
- class z {
4422
+ class P {
4423
4423
  constructor({ editor: t }) {
4424
4424
  var e;
4425
4425
  this._handleTextEditingEntered = () => {
@@ -4427,14 +4427,14 @@ class z {
4427
4427
  }, this._handleTextEditingExited = (s) => {
4428
4428
  var r, c;
4429
4429
  const { target: o } = s;
4430
- if (!z._isTextbox(o)) return;
4430
+ if (!P._isTextbox(o)) return;
4431
4431
  const n = (r = o.text) != null ? r : "";
4432
4432
  if (!!o.uppercase) {
4433
4433
  const d = (c = o.textCaseRaw) != null ? c : n.toLocaleLowerCase();
4434
4434
  o.textCaseRaw = d;
4435
4435
  } else
4436
4436
  o.textCaseRaw = n;
4437
- z._roundTextboxDimensions({ textbox: o }) && (o.setCoords(), o.dirty = !0, this.canvas.requestRenderAll()), o.locked || o.set({
4437
+ P._roundTextboxDimensions({ textbox: o }) && (o.setCoords(), o.dirty = !0, this.canvas.requestRenderAll()), o.locked || o.set({
4438
4438
  lockMovementX: !1,
4439
4439
  lockMovementY: !1
4440
4440
  }), setTimeout(() => {
@@ -4443,7 +4443,7 @@ class z {
4443
4443
  }, this._handleObjectScaling = (s) => {
4444
4444
  var X, It, Wt, mt, Ht, Ct, Ae, je, Ie, Ce, Te, Ee, Oe;
4445
4445
  const { target: o, transform: n } = s;
4446
- if (o instanceof k || !z._isTextbox(o) || !n) return;
4446
+ if (o instanceof k || !P._isTextbox(o) || !n) return;
4447
4447
  o.isScaling = !0;
4448
4448
  const i = this._ensureScalingState(o), {
4449
4449
  baseWidth: a,
@@ -4454,28 +4454,28 @@ class z {
4454
4454
  baseStyles: u
4455
4455
  } = i, g = typeof ((X = n.original) == null ? void 0 : X.width) == "number" ? n.original.width : void 0, f = typeof ((It = n.original) == null ? void 0 : It.left) == "number" ? n.original.left : void 0, p = g != null ? g : a, m = f != null ? f : r, v = (Wt = n.corner) != null ? Wt : "", b = (mt = n.action) != null ? mt : "", I = ["ml", "mr"].includes(v) || b === "scaleX", y = ["mt", "mb"].includes(v) || b === "scaleY", M = ["tl", "tr", "bl", "br"].includes(v) || b === "scale", A = M || y;
4456
4456
  if (!I && !y && !M) return;
4457
- const j = Math.abs((Ct = (Ht = o.scaleX) != null ? Ht : n.scaleX) != null ? Ct : 1) || 1, w = Math.abs((je = (Ae = o.scaleY) != null ? Ae : n.scaleY) != null ? je : 1) || 1, T = Math.max(1, p * j), S = Math.max(1, Math.round(T)), C = Math.max(1, c * w), {
4458
- paddingTop: x = 0,
4459
- paddingRight: W = 0,
4460
- paddingBottom: Y = 0,
4461
- paddingLeft: H = 0,
4457
+ const j = Math.abs((Ct = (Ht = o.scaleX) != null ? Ht : n.scaleX) != null ? Ct : 1) || 1, S = Math.abs((je = (Ae = o.scaleY) != null ? Ae : n.scaleY) != null ? je : 1) || 1, C = Math.max(1, p * j), w = Math.max(1, Math.round(C)), T = Math.max(1, c * S), {
4458
+ paddingTop: E = 0,
4459
+ paddingRight: U = 0,
4460
+ paddingBottom: z = 0,
4461
+ paddingLeft: Y = 0,
4462
4462
  radiusTopLeft: V = 0,
4463
- radiusTopRight: L = 0,
4464
- radiusBottomRight: D = 0,
4465
- radiusBottomLeft: P = 0,
4463
+ radiusTopRight: D = 0,
4464
+ radiusBottomRight: _ = 0,
4465
+ radiusBottomLeft: F = 0,
4466
4466
  fontSize: Z,
4467
- width: U,
4467
+ width: W,
4468
4468
  originX: K = "left"
4469
- } = o, $ = M || y, q = M || y, F = $ ? {
4470
- top: Math.max(0, d.top * w),
4471
- right: Math.max(0, d.right * w),
4472
- bottom: Math.max(0, d.bottom * w),
4473
- left: Math.max(0, d.left * w)
4469
+ } = o, $ = M || y, q = M || y, H = $ ? {
4470
+ top: Math.max(0, d.top * S),
4471
+ right: Math.max(0, d.right * S),
4472
+ bottom: Math.max(0, d.bottom * S),
4473
+ left: Math.max(0, d.left * S)
4474
4474
  } : d, Q = q ? {
4475
- topLeft: Math.max(0, l.topLeft * w),
4476
- topRight: Math.max(0, l.topRight * w),
4477
- bottomRight: Math.max(0, l.bottomRight * w),
4478
- bottomLeft: Math.max(0, l.bottomLeft * w)
4475
+ topLeft: Math.max(0, l.topLeft * S),
4476
+ topRight: Math.max(0, l.topRight * S),
4477
+ bottomRight: Math.max(0, l.bottomRight * S),
4478
+ bottomLeft: Math.max(0, l.bottomLeft * S)
4479
4479
  } : l, St = Object.keys(u).length > 0;
4480
4480
  let et;
4481
4481
  if (A && St) {
@@ -4485,23 +4485,23 @@ class z {
4485
4485
  const oe = {};
4486
4486
  Object.entries(Le).forEach(([cs, Zt]) => {
4487
4487
  if (!Zt) return;
4488
- const De = _({}, Zt);
4489
- typeof Zt.fontSize == "number" && (De.fontSize = Math.max(1, Zt.fontSize * w)), oe[cs] = De;
4488
+ const De = N({}, Zt);
4489
+ typeof Zt.fontSize == "number" && (De.fontSize = Math.max(1, Zt.fontSize * S)), oe[cs] = De;
4490
4490
  }), Object.keys(oe).length && (se[rs] = oe);
4491
4491
  }), Object.keys(se).length && (et = se);
4492
4492
  }
4493
- const lt = (Ce = (Ie = n.originX) != null ? Ie : K) != null ? Ce : "left", pt = m + p, At = m + p / 2, ht = U != null ? U : p, jt = S !== ht, Ft = Math.abs(C - (Z != null ? Z : c)) > st, Nt = Math.abs(F.top - x) > st || Math.abs(F.right - W) > st || Math.abs(F.bottom - Y) > st || Math.abs(F.left - H) > st, xt = Math.abs(Q.topLeft - V) > st || Math.abs(Q.topRight - L) > st || Math.abs(Q.bottomRight - D) > st || Math.abs(Q.bottomLeft - P) > st;
4493
+ const lt = (Ce = (Ie = n.originX) != null ? Ie : K) != null ? Ce : "left", pt = m + p, At = m + p / 2, ht = W != null ? W : p, jt = w !== ht, Ft = Math.abs(T - (Z != null ? Z : c)) > st, Nt = Math.abs(H.top - E) > st || Math.abs(H.right - U) > st || Math.abs(H.bottom - z) > st || Math.abs(H.left - Y) > st, xt = Math.abs(Q.topLeft - V) > st || Math.abs(Q.topRight - D) > st || Math.abs(Q.bottomRight - _) > st || Math.abs(Q.bottomLeft - F) > st;
4494
4494
  if (!jt && !Ft && !Nt && !xt) {
4495
4495
  o.set({ scaleX: 1, scaleY: 1 }), n.scaleX = 1, n.scaleY = 1;
4496
4496
  return;
4497
4497
  }
4498
4498
  et && (o.styles = et), o.set({
4499
- width: S,
4500
- fontSize: A ? C : c,
4501
- paddingTop: F.top,
4502
- paddingRight: F.right,
4503
- paddingBottom: F.bottom,
4504
- paddingLeft: F.left,
4499
+ width: w,
4500
+ fontSize: A ? T : c,
4501
+ paddingTop: H.top,
4502
+ paddingRight: H.right,
4503
+ paddingBottom: H.bottom,
4504
+ paddingLeft: H.left,
4505
4505
  radiusTopLeft: Q.topLeft,
4506
4506
  radiusTopRight: Q.topRight,
4507
4507
  radiusBottomRight: Q.bottomRight,
@@ -4509,17 +4509,17 @@ class z {
4509
4509
  scaleX: 1,
4510
4510
  scaleY: 1
4511
4511
  });
4512
- const Bt = z._roundTextboxDimensions({ textbox: o });
4512
+ const Bt = P._roundTextboxDimensions({ textbox: o });
4513
4513
  Bt && (o.dirty = !0);
4514
- const ut = (Te = o.width) != null ? Te : S, kt = ut !== ht;
4514
+ const ut = (Te = o.width) != null ? Te : w, kt = ut !== ht;
4515
4515
  let gt = m;
4516
4516
  kt && (I || M) && (lt === "right" ? gt = pt - ut : lt === "center" && (gt = At - ut / 2)), o.set({ left: gt }), i.baseLeft = gt, n.scaleX = 1, n.scaleY = 1;
4517
4517
  const { original: it } = n;
4518
- it && (it.scaleX = 1, it.scaleY = 1, it.width = ut, it.height = o.height, it.left = gt), o.setCoords(), this.canvas.requestRenderAll(), i.baseWidth = ut, i.baseFontSize = (Ee = o.fontSize) != null ? Ee : C, i.baseStyles = JSON.parse(JSON.stringify((Oe = o.styles) != null ? Oe : {})), i.basePadding = {
4519
- top: F.top,
4520
- right: F.right,
4521
- bottom: F.bottom,
4522
- left: F.left
4518
+ it && (it.scaleX = 1, it.scaleY = 1, it.width = ut, it.height = o.height, it.left = gt), o.setCoords(), this.canvas.requestRenderAll(), i.baseWidth = ut, i.baseFontSize = (Ee = o.fontSize) != null ? Ee : T, i.baseStyles = JSON.parse(JSON.stringify((Oe = o.styles) != null ? Oe : {})), i.basePadding = {
4519
+ top: H.top,
4520
+ right: H.right,
4521
+ bottom: H.bottom,
4522
+ left: H.left
4523
4523
  }, i.baseRadii = {
4524
4524
  topLeft: Q.topLeft,
4525
4525
  topRight: Q.topRight,
@@ -4531,56 +4531,56 @@ class z {
4531
4531
  const { target: o } = s;
4532
4532
  if (o instanceof k) {
4533
4533
  const M = o.getObjects();
4534
- if (!M.some((S) => z._isTextbox(S))) return;
4535
- const { scaleX: j = 1, scaleY: w = 1 } = o;
4536
- if (Math.abs(j - 1) < st && Math.abs(w - 1) < st) return;
4537
- this.canvas.discardActiveObject(), M.forEach((S) => {
4538
- var C, x, W, Y;
4539
- if (z._isTextbox(S)) {
4540
- const H = (C = S.scaleX) != null ? C : 1, V = (x = S.scaleY) != null ? x : 1, L = ((W = S.fontSize) != null ? W : 16) * V, D = ((Y = S.width) != null ? Y : 0) * H, P = V, {
4534
+ if (!M.some((w) => P._isTextbox(w))) return;
4535
+ const { scaleX: j = 1, scaleY: S = 1 } = o;
4536
+ if (Math.abs(j - 1) < st && Math.abs(S - 1) < st) return;
4537
+ this.canvas.discardActiveObject(), M.forEach((w) => {
4538
+ var T, E, U, z;
4539
+ if (P._isTextbox(w)) {
4540
+ const Y = (T = w.scaleX) != null ? T : 1, V = (E = w.scaleY) != null ? E : 1, D = ((U = w.fontSize) != null ? U : 16) * V, _ = ((z = w.width) != null ? z : 0) * Y, F = V, {
4541
4541
  paddingTop: Z = 0,
4542
- paddingRight: U = 0,
4542
+ paddingRight: W = 0,
4543
4543
  paddingBottom: K = 0,
4544
4544
  paddingLeft: $ = 0,
4545
4545
  radiusTopLeft: q = 0,
4546
- radiusTopRight: F = 0,
4546
+ radiusTopRight: H = 0,
4547
4547
  radiusBottomRight: Q = 0,
4548
4548
  radiusBottomLeft: St = 0,
4549
4549
  styles: et
4550
- } = S, lt = {
4551
- paddingTop: Math.max(0, Z * P),
4552
- paddingRight: Math.max(0, U * P),
4553
- paddingBottom: Math.max(0, K * P),
4554
- paddingLeft: Math.max(0, $ * P)
4550
+ } = w, lt = {
4551
+ paddingTop: Math.max(0, Z * F),
4552
+ paddingRight: Math.max(0, W * F),
4553
+ paddingBottom: Math.max(0, K * F),
4554
+ paddingLeft: Math.max(0, $ * F)
4555
4555
  }, pt = {
4556
- radiusTopLeft: Math.max(0, q * P),
4557
- radiusTopRight: Math.max(0, F * P),
4558
- radiusBottomRight: Math.max(0, Q * P),
4559
- radiusBottomLeft: Math.max(0, St * P)
4556
+ radiusTopLeft: Math.max(0, q * F),
4557
+ radiusTopRight: Math.max(0, H * F),
4558
+ radiusBottomRight: Math.max(0, Q * F),
4559
+ radiusBottomLeft: Math.max(0, St * F)
4560
4560
  };
4561
4561
  let At = et;
4562
4562
  et && Object.keys(et).length > 0 && (At = JSON.parse(JSON.stringify(et)), Object.values(At).forEach((ht) => {
4563
4563
  Object.values(ht).forEach((jt) => {
4564
- typeof jt.fontSize == "number" && (jt.fontSize = Math.max(1, jt.fontSize * P));
4564
+ typeof jt.fontSize == "number" && (jt.fontSize = Math.max(1, jt.fontSize * F));
4565
4565
  });
4566
- })), S.set(yt(_(_({
4567
- fontSize: L,
4568
- width: D,
4566
+ })), w.set(yt(N(N({
4567
+ fontSize: D,
4568
+ width: _,
4569
4569
  scaleX: 1,
4570
4570
  scaleY: 1
4571
4571
  }, lt), pt), {
4572
4572
  styles: At
4573
- })), z._roundTextboxDimensions({ textbox: S });
4573
+ })), P._roundTextboxDimensions({ textbox: w });
4574
4574
  }
4575
- S.setCoords();
4575
+ w.setCoords();
4576
4576
  });
4577
- const T = new k(M, {
4577
+ const C = new k(M, {
4578
4578
  canvas: this.canvas
4579
4579
  });
4580
- this.canvas.setActiveObject(T), this.canvas.requestRenderAll();
4580
+ this.canvas.setActiveObject(C), this.canvas.requestRenderAll();
4581
4581
  return;
4582
4582
  }
4583
- if (!z._isTextbox(o)) return;
4583
+ if (!P._isTextbox(o)) return;
4584
4584
  o.isScaling = !1;
4585
4585
  const n = this.scalingState.get(o);
4586
4586
  if (this.scalingState.delete(o), !(n != null && n.hasWidthChange)) return;
@@ -4615,8 +4615,8 @@ class z {
4615
4615
  * @param options — настройки текста
4616
4616
  * @param flags — флаги поведения
4617
4617
  */
4618
- addText(W = {}, { withoutSelection: S = !1, withoutSave: C = !1, withoutAdding: x = !1 } = {}) {
4619
- var Y = W, {
4618
+ addText(U = {}, { withoutSelection: w = !1, withoutSave: T = !1, withoutAdding: E = !1 } = {}) {
4619
+ var z = U, {
4620
4620
  id: t = `text-${G()}`,
4621
4621
  text: e = "Новый текст",
4622
4622
  fontFamily: s,
@@ -4640,8 +4640,8 @@ class z {
4640
4640
  radiusTopLeft: M = 0,
4641
4641
  radiusTopRight: A = 0,
4642
4642
  radiusBottomRight: j = 0,
4643
- radiusBottomLeft: w = 0
4644
- } = Y, T = vt(Y, [
4643
+ radiusBottomLeft: S = 0
4644
+ } = z, C = vt(z, [
4645
4645
  "id",
4646
4646
  "text",
4647
4647
  "fontFamily",
@@ -4668,14 +4668,14 @@ class z {
4668
4668
  "radiusBottomLeft"
4669
4669
  ]);
4670
4670
  var $;
4671
- const { historyManager: H } = this.editor, { canvas: V } = this;
4672
- H.suspendHistory();
4673
- const L = s != null ? s : this._getDefaultFontFamily(), D = Ke({ width: g }), P = Xe({
4671
+ const { historyManager: Y } = this.editor, { canvas: V } = this;
4672
+ Y.suspendHistory();
4673
+ const D = s != null ? s : this._getDefaultFontFamily(), _ = Ke({ width: g }), F = Xe({
4674
4674
  strokeColor: u,
4675
- width: D
4676
- }), Z = _({
4675
+ width: _
4676
+ }), Z = N({
4677
4677
  id: t,
4678
- fontFamily: L,
4678
+ fontFamily: D,
4679
4679
  fontSize: o,
4680
4680
  fontWeight: n ? "bold" : "normal",
4681
4681
  fontStyle: i ? "italic" : "normal",
@@ -4684,8 +4684,8 @@ class z {
4684
4684
  linethrough: c,
4685
4685
  textAlign: d,
4686
4686
  fill: l,
4687
- stroke: P,
4688
- strokeWidth: D,
4687
+ stroke: F,
4688
+ strokeWidth: _,
4689
4689
  strokeUniform: !0,
4690
4690
  opacity: f,
4691
4691
  backgroundColor: p,
@@ -4697,30 +4697,30 @@ class z {
4697
4697
  radiusTopLeft: M,
4698
4698
  radiusTopRight: A,
4699
4699
  radiusBottomRight: j,
4700
- radiusBottomLeft: w
4701
- }, T), U = new ee(e, Z);
4702
- if (U.textCaseRaw = ($ = U.text) != null ? $ : "", r) {
4703
- const q = ie({ value: U.textCaseRaw });
4704
- q !== U.text && U.set({ text: q });
4705
- }
4706
- return z._roundTextboxDimensions({ textbox: U }) && (U.dirty = !0), T.left === void 0 && T.top === void 0 && V.centerObject(U), x || V.add(U), S || V.setActiveObject(U), V.requestRenderAll(), H.resumeHistory(), C || H.saveState(), V.fire("editor:text-added", {
4707
- textbox: U,
4708
- options: yt(_({}, Z), {
4700
+ radiusBottomLeft: S
4701
+ }, C), W = new ee(e, Z);
4702
+ if (W.textCaseRaw = ($ = W.text) != null ? $ : "", r) {
4703
+ const q = ie({ value: W.textCaseRaw });
4704
+ q !== W.text && W.set({ text: q });
4705
+ }
4706
+ return P._roundTextboxDimensions({ textbox: W }) && (W.dirty = !0), C.left === void 0 && C.top === void 0 && V.centerObject(W), E || V.add(W), w || V.setActiveObject(W), V.requestRenderAll(), Y.resumeHistory(), T || Y.saveState(), V.fire("editor:text-added", {
4707
+ textbox: W,
4708
+ options: yt(N({}, Z), {
4709
4709
  text: e,
4710
4710
  bold: n,
4711
4711
  italic: i,
4712
4712
  strikethrough: c,
4713
4713
  align: d,
4714
4714
  color: l,
4715
- strokeColor: P,
4716
- strokeWidth: D
4715
+ strokeColor: F,
4716
+ strokeWidth: _
4717
4717
  }),
4718
4718
  flags: {
4719
- withoutSelection: !!S,
4720
- withoutSave: !!C,
4721
- withoutAdding: !!x
4719
+ withoutSelection: !!w,
4720
+ withoutSave: !!T,
4721
+ withoutAdding: !!E
4722
4722
  }
4723
- }), U;
4723
+ }), W;
4724
4724
  }
4725
4725
  /**
4726
4726
  * Обновляет текстовый объект.
@@ -4736,7 +4736,7 @@ class z {
4736
4736
  if (!n) return null;
4737
4737
  const { historyManager: i } = this.editor, { canvas: a } = this;
4738
4738
  i.suspendHistory();
4739
- const r = z._getSnapshot(n), Nt = e, {
4739
+ const r = P._getSnapshot(n), Nt = e, {
4740
4740
  text: c,
4741
4741
  fontFamily: d,
4742
4742
  fontSize: l,
@@ -4752,14 +4752,14 @@ class z {
4752
4752
  opacity: M,
4753
4753
  backgroundColor: A,
4754
4754
  backgroundOpacity: j,
4755
- paddingTop: w,
4756
- paddingRight: T,
4757
- paddingBottom: S,
4758
- paddingLeft: C,
4759
- radiusTopLeft: x,
4760
- radiusTopRight: W,
4761
- radiusBottomRight: Y,
4762
- radiusBottomLeft: H
4755
+ paddingTop: S,
4756
+ paddingRight: C,
4757
+ paddingBottom: w,
4758
+ paddingLeft: T,
4759
+ radiusTopLeft: E,
4760
+ radiusTopRight: U,
4761
+ radiusBottomRight: z,
4762
+ radiusBottomLeft: Y
4763
4763
  } = Nt, V = vt(Nt, [
4764
4764
  "text",
4765
4765
  "fontFamily",
@@ -4784,39 +4784,39 @@ class z {
4784
4784
  "radiusTopRight",
4785
4785
  "radiusBottomRight",
4786
4786
  "radiusBottomLeft"
4787
- ]), L = _({}, V), D = ao({ textbox: n }), P = D ? z._expandRangeToFullLines({ textbox: n, range: D }) : null, Z = {}, U = {}, K = {}, $ = co({ textbox: n, range: D }), q = !D || $, F = !D;
4788
- if (d !== void 0 && (P && (U.fontFamily = d), q && (L.fontFamily = d, F && (K.fontFamily = d))), l !== void 0 && (P && (U.fontSize = l), q && (L.fontSize = l, F && (K.fontSize = l))), u !== void 0) {
4787
+ ]), D = N({}, V), _ = ao({ textbox: n }), F = _ ? P._expandRangeToFullLines({ textbox: n, range: _ }) : null, Z = {}, W = {}, K = {}, $ = co({ textbox: n, range: _ }), q = !_ || $, H = !_;
4788
+ if (d !== void 0 && (F && (W.fontFamily = d), q && (D.fontFamily = d, H && (K.fontFamily = d))), l !== void 0 && (F && (W.fontSize = l), q && (D.fontSize = l, H && (K.fontSize = l))), u !== void 0) {
4789
4789
  const X = u ? "bold" : "normal";
4790
- D && (Z.fontWeight = X), q && (L.fontWeight = X, F && (K.fontWeight = X));
4790
+ _ && (Z.fontWeight = X), q && (D.fontWeight = X, H && (K.fontWeight = X));
4791
4791
  }
4792
4792
  if (g !== void 0) {
4793
4793
  const X = g ? "italic" : "normal";
4794
- D && (Z.fontStyle = X), q && (L.fontStyle = X, F && (K.fontStyle = X));
4794
+ _ && (Z.fontStyle = X), q && (D.fontStyle = X, H && (K.fontStyle = X));
4795
4795
  }
4796
- if (f !== void 0 && (D && (Z.underline = f), q && (L.underline = f, F && (K.underline = f))), m !== void 0 && (D && (Z.linethrough = m), q && (L.linethrough = m, F && (K.linethrough = m))), v !== void 0 && (L.textAlign = v), b !== void 0 && (D && (Z.fill = b), q && (L.fill = b, F && (K.fill = b))), I !== void 0 || y !== void 0) {
4797
- const X = D ? Ve({ textbox: n, range: D, property: "strokeWidth" }) : void 0, It = D ? Ve({ textbox: n, range: D, property: "stroke" }) : void 0, Wt = (Bt = (xt = y != null ? y : X) != null ? xt : n.strokeWidth) != null ? Bt : 0, mt = Ke({ width: Wt }), Ht = (kt = (ut = I != null ? I : It) != null ? ut : n.stroke) != null ? kt : void 0, Ct = Xe({
4796
+ if (f !== void 0 && (_ && (Z.underline = f), q && (D.underline = f, H && (K.underline = f))), m !== void 0 && (_ && (Z.linethrough = m), q && (D.linethrough = m, H && (K.linethrough = m))), v !== void 0 && (D.textAlign = v), b !== void 0 && (_ && (Z.fill = b), q && (D.fill = b, H && (K.fill = b))), I !== void 0 || y !== void 0) {
4797
+ const X = _ ? Ve({ textbox: n, range: _, property: "strokeWidth" }) : void 0, It = _ ? Ve({ textbox: n, range: _, property: "stroke" }) : void 0, Wt = (Bt = (xt = y != null ? y : X) != null ? xt : n.strokeWidth) != null ? Bt : 0, mt = Ke({ width: Wt }), Ht = (kt = (ut = I != null ? I : It) != null ? ut : n.stroke) != null ? kt : void 0, Ct = Xe({
4798
4798
  strokeColor: Ht,
4799
4799
  width: mt
4800
4800
  });
4801
- D && (Z.stroke = Ct, Z.strokeWidth = mt), q && (L.stroke = Ct, L.strokeWidth = mt, F && (K.stroke = Ct, K.strokeWidth = mt));
4801
+ _ && (Z.stroke = Ct, Z.strokeWidth = mt), q && (D.stroke = Ct, D.strokeWidth = mt, H && (K.stroke = Ct, K.strokeWidth = mt));
4802
4802
  }
4803
- M !== void 0 && (L.opacity = M), A !== void 0 && (L.backgroundColor = A), j !== void 0 && (L.backgroundOpacity = j), w !== void 0 && (L.paddingTop = w), T !== void 0 && (L.paddingRight = T), S !== void 0 && (L.paddingBottom = S), C !== void 0 && (L.paddingLeft = C), x !== void 0 && (L.radiusTopLeft = x), W !== void 0 && (L.radiusTopRight = W), Y !== void 0 && (L.radiusBottomRight = Y), H !== void 0 && (L.radiusBottomLeft = H);
4803
+ M !== void 0 && (D.opacity = M), A !== void 0 && (D.backgroundColor = A), j !== void 0 && (D.backgroundOpacity = j), S !== void 0 && (D.paddingTop = S), C !== void 0 && (D.paddingRight = C), w !== void 0 && (D.paddingBottom = w), T !== void 0 && (D.paddingLeft = T), E !== void 0 && (D.radiusTopLeft = E), U !== void 0 && (D.radiusTopRight = U), z !== void 0 && (D.radiusBottomRight = z), Y !== void 0 && (D.radiusBottomLeft = Y);
4804
4804
  const Q = (it = n.textCaseRaw) != null ? it : (gt = n.text) != null ? gt : "", St = !!n.uppercase, et = c !== void 0, lt = et ? c != null ? c : "" : Q, pt = p != null ? p : St;
4805
4805
  if (et || pt !== St) {
4806
4806
  const X = pt ? ie({ value: lt }) : lt;
4807
- L.text = X, n.textCaseRaw = lt;
4807
+ D.text = X, n.textCaseRaw = lt;
4808
4808
  } else n.textCaseRaw === void 0 && (n.textCaseRaw = Q);
4809
- n.uppercase = pt, n.set(L);
4809
+ n.uppercase = pt, n.set(D);
4810
4810
  let ht = !1;
4811
- if (D) {
4812
- const X = ne({ textbox: n, styles: Z, range: D }), It = P ? ne({ textbox: n, styles: U, range: P }) : !1;
4811
+ if (_) {
4812
+ const X = ne({ textbox: n, styles: Z, range: _ }), It = F ? ne({ textbox: n, styles: W, range: F }) : !1;
4813
4813
  ht = X || It;
4814
4814
  } else if (Object.keys(K).length) {
4815
4815
  const X = ro({ textbox: n });
4816
4816
  X && (ht = ne({ textbox: n, styles: K, range: X }));
4817
4817
  }
4818
- ht && (n.dirty = !0), (A !== void 0 || j !== void 0 || w !== void 0 || T !== void 0 || S !== void 0 || C !== void 0 || x !== void 0 || W !== void 0 || Y !== void 0 || H !== void 0) && (n.dirty = !0), z._roundTextboxDimensions({ textbox: n }) && (n.dirty = !0), n.setCoords(), o || a.requestRenderAll(), i.resumeHistory(), s || i.saveState();
4819
- const Ft = z._getSnapshot(n);
4818
+ ht && (n.dirty = !0), (A !== void 0 || j !== void 0 || S !== void 0 || C !== void 0 || w !== void 0 || T !== void 0 || E !== void 0 || U !== void 0 || z !== void 0 || Y !== void 0) && (n.dirty = !0), P._roundTextboxDimensions({ textbox: n }) && (n.dirty = !0), n.setCoords(), o || a.requestRenderAll(), i.resumeHistory(), s || i.saveState();
4819
+ const Ft = P._getSnapshot(n);
4820
4820
  return a.fire("editor:text-updated", {
4821
4821
  textbox: n,
4822
4822
  target: t,
@@ -4825,11 +4825,11 @@ class z {
4825
4825
  withoutSave: !!s,
4826
4826
  skipRender: !!o
4827
4827
  },
4828
- updates: L,
4828
+ updates: D,
4829
4829
  before: r,
4830
4830
  after: Ft,
4831
- selectionRange: D != null ? D : void 0,
4832
- selectionStyles: D && Object.keys(Z).length ? Z : void 0
4831
+ selectionRange: _ != null ? _ : void 0,
4832
+ selectionStyles: _ && Object.keys(Z).length ? Z : void 0
4833
4833
  }), n;
4834
4834
  }
4835
4835
  /**
@@ -4837,7 +4837,7 @@ class z {
4837
4837
  */
4838
4838
  destroy() {
4839
4839
  const { canvas: t } = this;
4840
- t.off("object:scaling", this._handleObjectScaling), t.off("object:resizing", z._handleObjectResizing), t.off("object:modified", this._handleObjectModified), t.off("text:editing:exited", this._handleTextEditingExited), t.off("text:editing:entered", this._handleTextEditingEntered), t.off("text:changed", z._handleTextChanged);
4840
+ t.off("object:scaling", this._handleObjectScaling), t.off("object:resizing", P._handleObjectResizing), t.off("object:modified", this._handleObjectModified), t.off("text:editing:exited", this._handleTextEditingExited), t.off("text:editing:entered", this._handleTextEditingEntered), t.off("text:changed", P._handleTextChanged);
4841
4841
  }
4842
4842
  /**
4843
4843
  * Возвращает активный текст или ищет по id.
@@ -4847,10 +4847,10 @@ class z {
4847
4847
  const { canvas: e } = this;
4848
4848
  if (!t) {
4849
4849
  const s = e.getActiveObject();
4850
- return z._isTextbox(s) ? s : null;
4850
+ return P._isTextbox(s) ? s : null;
4851
4851
  }
4852
4852
  if (typeof t == "string") {
4853
- const s = e.getObjects().find((o) => z._isTextbox(o) && o.id === t);
4853
+ const s = e.getObjects().find((o) => P._isTextbox(o) && o.id === t);
4854
4854
  return s != null ? s : null;
4855
4855
  }
4856
4856
  return null;
@@ -4866,21 +4866,21 @@ class z {
4866
4866
  */
4867
4867
  _bindEvents() {
4868
4868
  const { canvas: t } = this;
4869
- t.on("object:scaling", this._handleObjectScaling), t.on("object:resizing", z._handleObjectResizing), t.on("object:modified", this._handleObjectModified), t.on("text:editing:entered", this._handleTextEditingEntered), t.on("text:editing:exited", this._handleTextEditingExited), t.on("text:changed", z._handleTextChanged);
4869
+ t.on("object:scaling", this._handleObjectScaling), t.on("object:resizing", P._handleObjectResizing), t.on("object:modified", this._handleObjectModified), t.on("text:editing:entered", this._handleTextEditingEntered), t.on("text:editing:exited", this._handleTextEditingExited), t.on("text:changed", P._handleTextChanged);
4870
4870
  }
4871
4871
  /**
4872
4872
  * Реагирует на изменение текста в режиме редактирования: синхронизирует textCaseRaw и uppercase.
4873
4873
  */
4874
4874
  static _handleTextChanged(t) {
4875
4875
  const { target: e } = t;
4876
- if (!z._isTextbox(e)) return;
4876
+ if (!P._isTextbox(e)) return;
4877
4877
  const { text: s = "", uppercase: o } = e, n = !!o, i = s.toLocaleLowerCase();
4878
4878
  if (n) {
4879
4879
  const r = ie({ value: i });
4880
4880
  r !== s && e.set({ text: r }), e.textCaseRaw = i;
4881
4881
  } else
4882
4882
  e.textCaseRaw = s;
4883
- z._roundTextboxDimensions({ textbox: e }) && (e.setCoords(), e.dirty = !0);
4883
+ P._roundTextboxDimensions({ textbox: e }) && (e.setCoords(), e.dirty = !0);
4884
4884
  }
4885
4885
  /**
4886
4886
  * Обрабатывает изменение ширины текстового объекта (resizing).
@@ -4891,7 +4891,7 @@ class z {
4891
4891
  static _handleObjectResizing(t) {
4892
4892
  var l, u, g, f, p, m;
4893
4893
  const { target: e, transform: s } = t;
4894
- if (!z._isTextbox(e)) return;
4894
+ if (!P._isTextbox(e)) return;
4895
4895
  const {
4896
4896
  paddingLeft: o = 0,
4897
4897
  paddingRight: n = 0
@@ -4931,7 +4931,7 @@ class z {
4931
4931
  textbox: t,
4932
4932
  range: e
4933
4933
  }) {
4934
- const s = z._getLineRanges({ textbox: t });
4934
+ const s = P._getLineRanges({ textbox: t });
4935
4935
  if (!s.length) return e;
4936
4936
  let { start: o } = e, { end: n } = e;
4937
4937
  return s.forEach(({ start: i, end: a }) => {
@@ -4993,10 +4993,10 @@ class z {
4993
4993
  static _roundTextboxDimensions({
4994
4994
  textbox: t
4995
4995
  }) {
4996
- const { width: e, height: s, calcTextWidth: o, calcTextHeight: n } = t, i = typeof o == "function" ? o.call(t) : void 0, a = typeof n == "function" ? n.call(t) : void 0, r = z._resolveDimension({
4996
+ const { width: e, height: s, calcTextWidth: o, calcTextHeight: n } = t, i = typeof o == "function" ? o.call(t) : void 0, a = typeof n == "function" ? n.call(t) : void 0, r = P._resolveDimension({
4997
4997
  rawValue: e,
4998
4998
  calculatedValue: i
4999
- }), c = z._resolveDimension({
4999
+ }), c = P._resolveDimension({
5000
5000
  rawValue: s,
5001
5001
  calculatedValue: a
5002
5002
  }), d = Number.isFinite(r) ? Math.round(r) : null, l = Number.isFinite(c) ? Math.round(c) : null, u = {};
@@ -5008,9 +5008,9 @@ class z {
5008
5008
  static _getSnapshot(t) {
5009
5009
  const e = ({
5010
5010
  snapshot: Z,
5011
- entries: U
5011
+ entries: W
5012
5012
  }) => {
5013
- Object.entries(U).forEach(([K, $]) => {
5013
+ Object.entries(W).forEach(([K, $]) => {
5014
5014
  $ != null && (Z[K] = $);
5015
5015
  });
5016
5016
  }, {
@@ -5035,24 +5035,24 @@ class z {
5035
5035
  paddingRight: M,
5036
5036
  paddingBottom: A,
5037
5037
  paddingLeft: j,
5038
- radiusTopLeft: w,
5039
- radiusTopRight: T,
5040
- radiusBottomRight: S,
5041
- radiusBottomLeft: C,
5042
- left: x,
5043
- top: W,
5044
- width: Y,
5045
- height: H,
5038
+ radiusTopLeft: S,
5039
+ radiusTopRight: C,
5040
+ radiusBottomRight: w,
5041
+ radiusBottomLeft: T,
5042
+ left: E,
5043
+ top: U,
5044
+ width: z,
5045
+ height: Y,
5046
5046
  angle: V,
5047
- scaleX: L,
5048
- scaleY: D
5049
- } = t, P = {
5047
+ scaleX: D,
5048
+ scaleY: _
5049
+ } = t, F = {
5050
5050
  id: s,
5051
5051
  uppercase: !!i,
5052
5052
  textAlign: g
5053
5053
  };
5054
5054
  return e({
5055
- snapshot: P,
5055
+ snapshot: F,
5056
5056
  entries: {
5057
5057
  text: o,
5058
5058
  textCaseRaw: n,
@@ -5072,19 +5072,19 @@ class z {
5072
5072
  paddingRight: M,
5073
5073
  paddingBottom: A,
5074
5074
  paddingLeft: j,
5075
- radiusTopLeft: w,
5076
- radiusTopRight: T,
5077
- radiusBottomRight: S,
5078
- radiusBottomLeft: C,
5079
- left: x,
5080
- top: W,
5081
- width: Y,
5082
- height: H,
5075
+ radiusTopLeft: S,
5076
+ radiusTopRight: C,
5077
+ radiusBottomRight: w,
5078
+ radiusBottomLeft: T,
5079
+ left: E,
5080
+ top: U,
5081
+ width: z,
5082
+ height: Y,
5083
5083
  angle: V,
5084
- scaleX: L,
5085
- scaleY: D
5084
+ scaleX: D,
5085
+ scaleY: _
5086
5086
  }
5087
- }), P;
5087
+ }), F;
5088
5088
  }
5089
5089
  /**
5090
5090
  * Возвращает первый доступный шрифт или дефолтный Arial.
@@ -5265,7 +5265,7 @@ class R {
5265
5265
  baseWidth: m,
5266
5266
  baseHeight: v,
5267
5267
  montageArea: i != null ? i : null
5268
- })), I = yt(_({}, s), {
5268
+ })), I = yt(N({}, s), {
5269
5269
  baseWidth: m,
5270
5270
  baseHeight: v,
5271
5271
  positionsNormalized: !0,
@@ -5284,7 +5284,7 @@ class R {
5284
5284
  * @param options.data - данные для заполнения текстов по customData.templateField
5285
5285
  */
5286
5286
  applyTemplate(s) {
5287
- return N(this, arguments, function* ({
5287
+ return x(this, arguments, function* ({
5288
5288
  template: t,
5289
5289
  data: e
5290
5290
  }) {
@@ -5390,8 +5390,8 @@ class R {
5390
5390
  * Превращает plain-описание объектов в Fabric объекты.
5391
5391
  */
5392
5392
  static _enlivenObjects(t) {
5393
- return N(this, null, function* () {
5394
- return (yield Promise.all(t.map((s) => N(null, null, function* () {
5393
+ return x(this, null, function* () {
5394
+ return (yield Promise.all(t.map((s) => x(null, null, function* () {
5395
5395
  if (R._hasSerializedSvgMarkup(s)) {
5396
5396
  const i = yield R._reviveSvgObject(s);
5397
5397
  if (i)
@@ -5414,19 +5414,44 @@ class R {
5414
5414
  width: o,
5415
5415
  height: n,
5416
5416
  scaleX: i,
5417
- scaleY: a
5418
- } = e, r = t, c = "getElement" in r && typeof r.getElement == "function" ? r.getElement() : null, {
5419
- naturalWidth: d = 0,
5420
- naturalHeight: l = 0,
5421
- width: u = 0,
5422
- height: g = 0
5423
- } = c instanceof HTMLImageElement ? c : {
5417
+ scaleY: a,
5418
+ customData: r
5419
+ } = e, c = t, d = "getElement" in c && typeof c.getElement == "function" ? c.getElement() : null, {
5420
+ naturalWidth: l = 0,
5421
+ naturalHeight: u = 0,
5422
+ width: g = 0,
5423
+ height: f = 0
5424
+ } = d instanceof HTMLImageElement ? d : {
5424
5425
  naturalWidth: 0,
5425
5426
  naturalHeight: 0,
5426
5427
  width: 0,
5427
5428
  height: 0
5428
- }, f = ot({ value: d || u || r.width, fallback: 0 }), p = ot({ value: l || g || r.height, fallback: 0 }), m = ot({ value: o, fallback: f }), v = ot({ value: n, fallback: p }), b = ot({ value: i, fallback: r.scaleX || 1 }), I = ot({ value: a, fallback: r.scaleY || 1 }), y = m * b, M = v * I, A = f ? y / f : null, j = p ? M / p : null, w = {};
5429
- f > 0 && (w.width = f), p > 0 && (w.height = p), A && A > 0 && (w.scaleX = A), j && j > 0 && (w.scaleY = j), r.set(w);
5429
+ }, p = ot({ value: l || g || c.width, fallback: 0 }), m = ot({ value: u || f || c.height, fallback: 0 }), v = ot({ value: o, fallback: p }), b = ot({ value: n, fallback: m }), I = ot({ value: i, fallback: c.scaleX || 1 }), y = ot({ value: a, fallback: c.scaleY || 1 }), M = v * I, A = b * y, j = p > 0, S = m > 0, C = M > 0, w = A > 0, T = R._resolveImageFit({ customData: r }), E = {};
5430
+ if (j && (E.width = p), S && (E.height = m), !j || !S) {
5431
+ c.set(E);
5432
+ return;
5433
+ }
5434
+ if (T === "stretch") {
5435
+ const z = C ? M / p : null, Y = w ? A / m : null;
5436
+ z && z > 0 && (E.scaleX = z), Y && Y > 0 && (E.scaleY = Y), c.set(E);
5437
+ return;
5438
+ }
5439
+ if (!C || !w) {
5440
+ c.set(E);
5441
+ return;
5442
+ }
5443
+ const U = Math.min(M / p, A / m);
5444
+ Number.isFinite(U) && U > 0 && (E.scaleX = U, E.scaleY = U), c.set(E);
5445
+ }
5446
+ /**
5447
+ * Определяет режим вписывания изображения при восстановлении.
5448
+ */
5449
+ static _resolveImageFit({
5450
+ customData: t
5451
+ }) {
5452
+ if (!t || typeof t != "object") return "contain";
5453
+ const { imageFit: e } = t;
5454
+ return e === "stretch" ? "stretch" : "contain";
5430
5455
  }
5431
5456
  /**
5432
5457
  * Проверяет, содержит ли сериализованный объект инлайн SVG.
@@ -5438,7 +5463,7 @@ class R {
5438
5463
  * Восстанавливает SVG-объект из компактного описания.
5439
5464
  */
5440
5465
  static _reviveSvgObject(t) {
5441
- return N(this, null, function* () {
5466
+ return x(this, null, function* () {
5442
5467
  const e = typeof t.svgMarkup == "string" ? t.svgMarkup : null;
5443
5468
  if (!e) return null;
5444
5469
  try {
@@ -5455,7 +5480,7 @@ class R {
5455
5480
  * Убирает технические поля сериализации, оставляя только применимые свойства.
5456
5481
  */
5457
5482
  static _prepareSerializableProps(t) {
5458
- const e = _({}, t);
5483
+ const e = N({}, t);
5459
5484
  return delete e.svgMarkup, delete e.objects, delete e.path, delete e.paths, delete e.type, delete e.version, e;
5460
5485
  }
5461
5486
  /**
@@ -5559,17 +5584,14 @@ class R {
5559
5584
  const s = t[e];
5560
5585
  return s === "center" || s === "end" || s === "start" ? s : "start";
5561
5586
  }
5562
- static _detectAnchor({
5563
- start: t,
5564
- end: e
5565
- }) {
5566
- const s = t <= 0.05, o = e >= 0.95, n = t < 0, i = e > 1, a = e - t, r = Math.max(0, t), c = Math.max(0, 1 - e);
5587
+ static _detectAnchor({ start: t, end: e }) {
5588
+ const s = t <= 0.05, o = e >= 0.95, n = t < 0, i = e > 1, a = e - t, r = Math.max(0, t), c = Math.max(0, 1 - e), d = Math.abs(r - c) <= 0.02;
5567
5589
  if (s && o || n && i)
5568
- return a >= 0.98 ? "center" : r <= c ? "start" : "end";
5590
+ return d || a >= 0.9 ? "center" : r <= c ? "start" : "end";
5569
5591
  if (s || n) return "start";
5570
5592
  if (o || i) return "end";
5571
- const d = r - c;
5572
- return Math.abs(d) <= 0.1 ? "center" : d < 0 ? "start" : "end";
5593
+ const l = r - c;
5594
+ return Math.abs(l) <= 0.1 ? "center" : l < 0 ? "start" : "end";
5573
5595
  }
5574
5596
  /**
5575
5597
  * Нормализует мета-данные шаблона.
@@ -5579,7 +5601,7 @@ class R {
5579
5601
  fallback: e
5580
5602
  }) {
5581
5603
  const { width: s, height: o } = e, r = t || {}, { baseWidth: n = s, baseHeight: i = o } = r, a = vt(r, ["baseWidth", "baseHeight"]);
5582
- return _({
5604
+ return N({
5583
5605
  baseWidth: n,
5584
5606
  baseHeight: i
5585
5607
  }, a);
@@ -5676,7 +5698,7 @@ class R {
5676
5698
  * Применяет фоновый объект шаблона к текущему холсту через BackgroundManager.
5677
5699
  */
5678
5700
  static _applyBackgroundFromObject(o) {
5679
- return N(this, arguments, function* ({
5701
+ return x(this, arguments, function* ({
5680
5702
  backgroundObject: t,
5681
5703
  backgroundManager: e,
5682
5704
  errorManager: s
@@ -5741,7 +5763,7 @@ class R {
5741
5763
  */
5742
5764
  static _cloneCustomData(t) {
5743
5765
  if (!(!t || typeof t != "object"))
5744
- return _({}, t);
5766
+ return N({}, t);
5745
5767
  }
5746
5768
  /**
5747
5769
  * Извлекает src изображения из FabricImage или его исходного элемента.
@@ -5907,50 +5929,50 @@ const po = 5, os = "#3D8BF4", pe = 1, Qt = 1, Qe = ({
5907
5929
  return { delta: 0, guide: null };
5908
5930
  const u = d[l - 1], g = d[l - 2], f = d[l + 1], p = d[l + 2], m = [], v = i - n;
5909
5931
  if (u && g) {
5910
- const { bounds: y } = u, { bounds: M } = g, A = y.top - M.bottom, j = n - y.bottom, w = Math.abs(j - A);
5911
- if (w <= e) {
5912
- const T = A - j, S = n + T, C = {
5932
+ const { bounds: y } = u, { bounds: M } = g, A = y.top - M.bottom, j = n - y.bottom, S = Math.abs(j - A);
5933
+ if (S <= e) {
5934
+ const C = A - j, w = n + C, T = {
5913
5935
  type: "vertical",
5914
5936
  axis: o,
5915
5937
  refStart: M.bottom,
5916
5938
  refEnd: y.top,
5917
5939
  activeStart: y.bottom,
5918
- activeEnd: S,
5940
+ activeEnd: w,
5919
5941
  distance: A
5920
5942
  };
5921
- m.push({ delta: T, guide: C, diff: w });
5943
+ m.push({ delta: C, guide: T, diff: S });
5922
5944
  }
5923
5945
  }
5924
5946
  if (f && p) {
5925
- const { bounds: y } = f, { bounds: M } = p, A = M.top - y.bottom, j = y.top - i, w = Math.abs(j - A);
5926
- if (w <= e) {
5927
- const T = j - A, S = i + T, C = {
5947
+ const { bounds: y } = f, { bounds: M } = p, A = M.top - y.bottom, j = y.top - i, S = Math.abs(j - A);
5948
+ if (S <= e) {
5949
+ const C = j - A, w = i + C, T = {
5928
5950
  type: "vertical",
5929
5951
  axis: o,
5930
5952
  refStart: y.bottom,
5931
5953
  refEnd: M.top,
5932
- activeStart: S,
5954
+ activeStart: w,
5933
5955
  activeEnd: y.top,
5934
5956
  distance: A
5935
5957
  };
5936
- m.push({ delta: T, guide: C, diff: w });
5958
+ m.push({ delta: C, guide: T, diff: S });
5937
5959
  }
5938
5960
  }
5939
5961
  if (u && f) {
5940
5962
  const { bounds: y } = u, { bounds: M } = f, j = M.top - y.bottom - v;
5941
5963
  if (j >= 0) {
5942
- const w = j / 2, T = n - y.bottom, S = M.top - i, C = Math.abs(T - w), x = Math.abs(S - w), W = Math.max(C, x);
5943
- if (W <= e) {
5944
- const Y = w - T, H = i + Y, V = {
5964
+ const S = j / 2, C = n - y.bottom, w = M.top - i, T = Math.abs(C - S), E = Math.abs(w - S), U = Math.max(T, E);
5965
+ if (U <= e) {
5966
+ const z = S - C, Y = i + z, V = {
5945
5967
  type: "vertical",
5946
5968
  axis: o,
5947
5969
  refStart: y.bottom,
5948
- refEnd: y.bottom + w,
5949
- activeStart: H,
5950
- activeEnd: H + w,
5951
- distance: w
5970
+ refEnd: y.bottom + S,
5971
+ activeStart: Y,
5972
+ activeEnd: Y + S,
5973
+ distance: S
5952
5974
  };
5953
- m.push({ delta: Y, guide: V, diff: W });
5975
+ m.push({ delta: z, guide: V, diff: U });
5954
5976
  }
5955
5977
  }
5956
5978
  }
@@ -5993,50 +6015,50 @@ const po = 5, os = "#3D8BF4", pe = 1, Qt = 1, Qe = ({
5993
6015
  return { delta: 0, guide: null };
5994
6016
  const u = d[l - 1], g = d[l - 2], f = d[l + 1], p = d[l + 2], m = [], v = i - n;
5995
6017
  if (u && g) {
5996
- const { bounds: y } = u, { bounds: M } = g, A = y.left - M.right, j = n - y.right, w = Math.abs(j - A);
5997
- if (w <= e) {
5998
- const T = A - j, S = n + T, C = {
6018
+ const { bounds: y } = u, { bounds: M } = g, A = y.left - M.right, j = n - y.right, S = Math.abs(j - A);
6019
+ if (S <= e) {
6020
+ const C = A - j, w = n + C, T = {
5999
6021
  type: "horizontal",
6000
6022
  axis: o,
6001
6023
  refStart: M.right,
6002
6024
  refEnd: y.left,
6003
6025
  activeStart: y.right,
6004
- activeEnd: S,
6026
+ activeEnd: w,
6005
6027
  distance: A
6006
6028
  };
6007
- m.push({ delta: T, guide: C, diff: w });
6029
+ m.push({ delta: C, guide: T, diff: S });
6008
6030
  }
6009
6031
  }
6010
6032
  if (f && p) {
6011
- const { bounds: y } = f, { bounds: M } = p, A = M.left - y.right, j = y.left - i, w = Math.abs(j - A);
6012
- if (w <= e) {
6013
- const T = j - A, S = i + T, C = {
6033
+ const { bounds: y } = f, { bounds: M } = p, A = M.left - y.right, j = y.left - i, S = Math.abs(j - A);
6034
+ if (S <= e) {
6035
+ const C = j - A, w = i + C, T = {
6014
6036
  type: "horizontal",
6015
6037
  axis: o,
6016
6038
  refStart: y.right,
6017
6039
  refEnd: M.left,
6018
- activeStart: S,
6040
+ activeStart: w,
6019
6041
  activeEnd: y.left,
6020
6042
  distance: A
6021
6043
  };
6022
- m.push({ delta: T, guide: C, diff: w });
6044
+ m.push({ delta: C, guide: T, diff: S });
6023
6045
  }
6024
6046
  }
6025
6047
  if (u && f) {
6026
6048
  const { bounds: y } = u, { bounds: M } = f, j = M.left - y.right - v;
6027
6049
  if (j >= 0) {
6028
- const w = j / 2, T = n - y.right, S = M.left - i, C = Math.abs(T - w), x = Math.abs(S - w), W = Math.max(C, x);
6029
- if (W <= e) {
6030
- const Y = w - T, H = i + Y, V = {
6050
+ const S = j / 2, C = n - y.right, w = M.left - i, T = Math.abs(C - S), E = Math.abs(w - S), U = Math.max(T, E);
6051
+ if (U <= e) {
6052
+ const z = S - C, Y = i + z, V = {
6031
6053
  type: "horizontal",
6032
6054
  axis: o,
6033
6055
  refStart: y.right,
6034
- refEnd: y.right + w,
6035
- activeStart: H,
6036
- activeEnd: H + w,
6037
- distance: w
6056
+ refEnd: y.right + S,
6057
+ activeStart: Y,
6058
+ activeEnd: Y + S,
6059
+ distance: S
6038
6060
  };
6039
- m.push({ delta: Y, guide: V, diff: W });
6061
+ m.push({ delta: z, guide: V, diff: U });
6040
6062
  }
6041
6063
  }
6042
6064
  }
@@ -6105,13 +6127,13 @@ const po = 5, os = "#3D8BF4", pe = 1, Qt = 1, Qe = ({
6105
6127
  }) => {
6106
6128
  const p = i || 1, m = 12 / p, v = l / p, b = u / p, I = (s + o) / 2 + g, y = t === "vertical" ? e + f : I, M = t === "vertical" ? I : e + f;
6107
6129
  h.save(), h.setLineDash([]), h.fillStyle = a, h.strokeStyle = a, h.lineWidth = d / p, h.font = `${m}px ${c}`, h.textAlign = "center", h.textBaseline = "middle";
6108
- const j = h.measureText(n).width + v * 2, w = m + v * 2, T = y - j / 2, S = M - w / 2;
6130
+ const j = h.measureText(n).width + v * 2, S = m + v * 2, C = y - j / 2, w = M - S / 2;
6109
6131
  h.beginPath(), Mo({
6110
6132
  context: h,
6111
- x: T,
6112
- y: S,
6133
+ x: C,
6134
+ y: w,
6113
6135
  width: j,
6114
- height: w,
6136
+ height: S,
6115
6137
  radius: b
6116
6138
  }), h.fill(), h.fillStyle = r, h.fillText(n, y, M), h.restore();
6117
6139
  }, wo = ({
@@ -6620,24 +6642,24 @@ class Lt {
6620
6642
  } = e, p = Math.max(a, u), m = Math.min(r, g), b = m >= p ? (p + m) / 2 : (c + f) / 2;
6621
6643
  if (d >= i) {
6622
6644
  if (s) return o;
6623
- const C = d - i;
6624
- return C > 0 && o.push({
6645
+ const T = d - i;
6646
+ return T > 0 && o.push({
6625
6647
  type: "horizontal",
6626
6648
  axis: b,
6627
6649
  start: i,
6628
6650
  end: d,
6629
- distance: C
6651
+ distance: T
6630
6652
  }), o;
6631
6653
  }
6632
6654
  if (l <= n) {
6633
6655
  if (s) return o;
6634
- const C = n - l;
6635
- return C > 0 && o.push({
6656
+ const T = n - l;
6657
+ return T > 0 && o.push({
6636
6658
  type: "horizontal",
6637
6659
  axis: b,
6638
6660
  start: l,
6639
6661
  end: n,
6640
- distance: C
6662
+ distance: T
6641
6663
  }), o;
6642
6664
  }
6643
6665
  if (!s) return o;
@@ -6649,13 +6671,13 @@ class Lt {
6649
6671
  end: A,
6650
6672
  distance: j
6651
6673
  });
6652
- const w = Math.min(i, l), T = Math.max(i, l), S = T - w;
6653
- return S > 0 && !y && o.push({
6674
+ const S = Math.min(i, l), C = Math.max(i, l), w = C - S;
6675
+ return w > 0 && !y && o.push({
6654
6676
  type: "horizontal",
6655
6677
  axis: b,
6656
- start: w,
6657
- end: T,
6658
- distance: S
6678
+ start: S,
6679
+ end: C,
6680
+ distance: w
6659
6681
  }), o;
6660
6682
  }
6661
6683
  /**
@@ -6681,24 +6703,24 @@ class Lt {
6681
6703
  } = e, p = Math.max(a, u), m = Math.min(r, g), b = m >= p ? (p + m) / 2 : (c + f) / 2;
6682
6704
  if (d >= i) {
6683
6705
  if (s) return o;
6684
- const C = d - i;
6685
- return C > 0 && o.push({
6706
+ const T = d - i;
6707
+ return T > 0 && o.push({
6686
6708
  type: "vertical",
6687
6709
  axis: b,
6688
6710
  start: i,
6689
6711
  end: d,
6690
- distance: C
6712
+ distance: T
6691
6713
  }), o;
6692
6714
  }
6693
6715
  if (l <= n) {
6694
6716
  if (s) return o;
6695
- const C = n - l;
6696
- return C > 0 && o.push({
6717
+ const T = n - l;
6718
+ return T > 0 && o.push({
6697
6719
  type: "vertical",
6698
6720
  axis: b,
6699
6721
  start: l,
6700
6722
  end: n,
6701
- distance: C
6723
+ distance: T
6702
6724
  }), o;
6703
6725
  }
6704
6726
  if (!s) return o;
@@ -6710,13 +6732,13 @@ class Lt {
6710
6732
  end: A,
6711
6733
  distance: j
6712
6734
  });
6713
- const w = Math.min(i, l), T = Math.max(i, l), S = T - w;
6714
- return S > 0 && !y && o.push({
6735
+ const S = Math.min(i, l), C = Math.max(i, l), w = C - S;
6736
+ return w > 0 && !y && o.push({
6715
6737
  type: "vertical",
6716
6738
  axis: b,
6717
- start: w,
6718
- end: T,
6719
- distance: S
6739
+ start: S,
6740
+ end: C,
6741
+ distance: w
6720
6742
  }), o;
6721
6743
  }
6722
6744
  /**
@@ -6797,7 +6819,7 @@ class Se {
6797
6819
  * @fires editor:ready
6798
6820
  */
6799
6821
  init() {
6800
- return N(this, null, function* () {
6822
+ return x(this, null, function* () {
6801
6823
  var u;
6802
6824
  const {
6803
6825
  editorContainerWidth: t,
@@ -6812,7 +6834,7 @@ class Se {
6812
6834
  showRotationAngle: d,
6813
6835
  _onReadyCallback: l
6814
6836
  } = this.options;
6815
- if (J.apply(), this.canvas = new vs(this.containerId, this.options), this.moduleLoader = new As(), this.workerManager = new Is(), this.errorManager = new Yt({ editor: this }), this.historyManager = new Jt({ editor: this }), this.toolbar = new Ys({ editor: this }), this.transformManager = new qs({ editor: this }), this.zoomManager = new Js({ editor: this }), this.canvasManager = new Qs({ editor: this }), this.imageManager = new ct({ editor: this }), this.layerManager = new $t({ editor: this }), this.shapeManager = new to({ editor: this }), this.interactionBlocker = new $s({ editor: this }), this.backgroundManager = new Ot({ editor: this }), this.clipboardManager = new eo({ editor: this }), this.objectLockManager = new te({ editor: this }), this.groupingManager = new so({ editor: this }), this.selectionManager = new oo({ editor: this }), this.deletionManager = new we({ editor: this }), this.panConstraintManager = new no({ editor: this }), this.snappingManager = new jo({ editor: this }), this.measurementManager = new Lt({ editor: this }), this.fontManager = new fe((u = this.options.fonts) != null ? u : []), this.textManager = new z({ editor: this }), this.templateManager = new R({ editor: this }), d && (this.angleIndicator = new Me({ editor: this })), this._createMontageArea(), this._createClippingArea(), this.listeners = new Ut({ editor: this, options: this.options }), this.canvasManager.setEditorContainerWidth(t), this.canvasManager.setEditorContainerHeight(e), this.canvasManager.setCanvasWrapperWidth(s), this.canvasManager.setCanvasWrapperHeight(o), this.canvasManager.setCanvasCSSWidth(n), this.canvasManager.setCanvasCSSHeight(i), this.canvasManager.updateCanvas(), this.zoomManager.calculateAndApplyDefaultZoom(), yield this.fontManager.loadFonts(), a != null && a.source) {
6837
+ if (J.apply(), this.canvas = new vs(this.containerId, this.options), this.moduleLoader = new As(), this.workerManager = new Is(), this.errorManager = new Yt({ editor: this }), this.historyManager = new Jt({ editor: this }), this.toolbar = new Ys({ editor: this }), this.transformManager = new qs({ editor: this }), this.zoomManager = new Js({ editor: this }), this.canvasManager = new Qs({ editor: this }), this.imageManager = new ct({ editor: this }), this.layerManager = new $t({ editor: this }), this.shapeManager = new to({ editor: this }), this.interactionBlocker = new $s({ editor: this }), this.backgroundManager = new Ot({ editor: this }), this.clipboardManager = new eo({ editor: this }), this.objectLockManager = new te({ editor: this }), this.groupingManager = new so({ editor: this }), this.selectionManager = new oo({ editor: this }), this.deletionManager = new we({ editor: this }), this.panConstraintManager = new no({ editor: this }), this.snappingManager = new jo({ editor: this }), this.measurementManager = new Lt({ editor: this }), this.fontManager = new fe((u = this.options.fonts) != null ? u : []), this.textManager = new P({ editor: this }), this.templateManager = new R({ editor: this }), d && (this.angleIndicator = new Me({ editor: this })), this._createMontageArea(), this._createClippingArea(), this.listeners = new Ut({ editor: this, options: this.options }), this.canvasManager.setEditorContainerWidth(t), this.canvasManager.setEditorContainerHeight(e), this.canvasManager.setCanvasWrapperWidth(s), this.canvasManager.setCanvasWrapperHeight(o), this.canvasManager.setCanvasCSSWidth(n), this.canvasManager.setCanvasCSSHeight(i), this.canvasManager.updateCanvas(), this.zoomManager.calculateAndApplyDefaultZoom(), yield this.fontManager.loadFonts(), a != null && a.source) {
6816
6838
  const {
6817
6839
  source: g,
6818
6840
  scale: f = `image-${c}`,
@@ -6891,7 +6913,7 @@ class Se {
6891
6913
  });
6892
6914
  }
6893
6915
  }
6894
- const E = [
6916
+ const O = [
6895
6917
  "U+0000-00FF",
6896
6918
  "U+0131",
6897
6919
  "U+0152-0153",
@@ -6911,7 +6933,7 @@ const E = [
6911
6933
  "U+2215",
6912
6934
  "U+FEFF",
6913
6935
  "U+FFFD"
6914
- ].join(", "), O = [
6936
+ ].join(", "), L = [
6915
6937
  "U+0301",
6916
6938
  "U+0400-045F",
6917
6939
  "U+0490-0491",
@@ -6934,7 +6956,7 @@ const E = [
6934
6956
  style: "normal",
6935
6957
  weight: "400",
6936
6958
  display: "swap",
6937
- unicodeRange: O
6959
+ unicodeRange: L
6938
6960
  }
6939
6961
  },
6940
6962
  {
@@ -6944,7 +6966,7 @@ const E = [
6944
6966
  style: "normal",
6945
6967
  weight: "400",
6946
6968
  display: "swap",
6947
- unicodeRange: E
6969
+ unicodeRange: O
6948
6970
  }
6949
6971
  },
6950
6972
  {
@@ -6954,7 +6976,7 @@ const E = [
6954
6976
  style: "normal",
6955
6977
  weight: "700",
6956
6978
  display: "swap",
6957
- unicodeRange: O
6979
+ unicodeRange: L
6958
6980
  }
6959
6981
  },
6960
6982
  {
@@ -6964,7 +6986,7 @@ const E = [
6964
6986
  style: "normal",
6965
6987
  weight: "700",
6966
6988
  display: "swap",
6967
- unicodeRange: E
6989
+ unicodeRange: O
6968
6990
  }
6969
6991
  },
6970
6992
  {
@@ -6974,7 +6996,7 @@ const E = [
6974
6996
  style: "normal",
6975
6997
  weight: "200 700",
6976
6998
  display: "swap",
6977
- unicodeRange: O
6999
+ unicodeRange: L
6978
7000
  }
6979
7001
  },
6980
7002
  {
@@ -6984,7 +7006,7 @@ const E = [
6984
7006
  style: "normal",
6985
7007
  weight: "200 700",
6986
7008
  display: "swap",
6987
- unicodeRange: E
7009
+ unicodeRange: O
6988
7010
  }
6989
7011
  },
6990
7012
  {
@@ -6994,7 +7016,7 @@ const E = [
6994
7016
  style: "normal",
6995
7017
  weight: "300 900",
6996
7018
  display: "swap",
6997
- unicodeRange: O
7019
+ unicodeRange: L
6998
7020
  }
6999
7021
  },
7000
7022
  {
@@ -7004,7 +7026,7 @@ const E = [
7004
7026
  style: "normal",
7005
7027
  weight: "300 900",
7006
7028
  display: "swap",
7007
- unicodeRange: E
7029
+ unicodeRange: O
7008
7030
  }
7009
7031
  },
7010
7032
  {
@@ -7014,7 +7036,7 @@ const E = [
7014
7036
  style: "normal",
7015
7037
  weight: "400 700",
7016
7038
  display: "swap",
7017
- unicodeRange: O
7039
+ unicodeRange: L
7018
7040
  }
7019
7041
  },
7020
7042
  {
@@ -7024,7 +7046,7 @@ const E = [
7024
7046
  style: "normal",
7025
7047
  weight: "400 700",
7026
7048
  display: "swap",
7027
- unicodeRange: E
7049
+ unicodeRange: O
7028
7050
  }
7029
7051
  },
7030
7052
  {
@@ -7034,7 +7056,7 @@ const E = [
7034
7056
  style: "normal",
7035
7057
  weight: "300 700",
7036
7058
  display: "swap",
7037
- unicodeRange: O
7059
+ unicodeRange: L
7038
7060
  }
7039
7061
  },
7040
7062
  {
@@ -7044,7 +7066,7 @@ const E = [
7044
7066
  style: "normal",
7045
7067
  weight: "300 700",
7046
7068
  display: "swap",
7047
- unicodeRange: E
7069
+ unicodeRange: O
7048
7070
  }
7049
7071
  },
7050
7072
  {
@@ -7054,7 +7076,7 @@ const E = [
7054
7076
  style: "normal",
7055
7077
  weight: "300 700",
7056
7078
  display: "swap",
7057
- unicodeRange: O
7079
+ unicodeRange: L
7058
7080
  }
7059
7081
  },
7060
7082
  {
@@ -7064,7 +7086,7 @@ const E = [
7064
7086
  style: "normal",
7065
7087
  weight: "300 700",
7066
7088
  display: "swap",
7067
- unicodeRange: E
7089
+ unicodeRange: O
7068
7090
  }
7069
7091
  },
7070
7092
  {
@@ -7074,7 +7096,7 @@ const E = [
7074
7096
  style: "normal",
7075
7097
  weight: "400",
7076
7098
  display: "swap",
7077
- unicodeRange: O
7099
+ unicodeRange: L
7078
7100
  }
7079
7101
  },
7080
7102
  {
@@ -7084,7 +7106,7 @@ const E = [
7084
7106
  style: "normal",
7085
7107
  weight: "400",
7086
7108
  display: "swap",
7087
- unicodeRange: E
7109
+ unicodeRange: O
7088
7110
  }
7089
7111
  },
7090
7112
  {
@@ -7094,7 +7116,7 @@ const E = [
7094
7116
  style: "normal",
7095
7117
  weight: "400 700",
7096
7118
  display: "swap",
7097
- unicodeRange: O
7119
+ unicodeRange: L
7098
7120
  }
7099
7121
  },
7100
7122
  {
@@ -7104,7 +7126,7 @@ const E = [
7104
7126
  style: "normal",
7105
7127
  weight: "400 700",
7106
7128
  display: "swap",
7107
- unicodeRange: E
7129
+ unicodeRange: O
7108
7130
  }
7109
7131
  },
7110
7132
  {
@@ -7114,7 +7136,7 @@ const E = [
7114
7136
  style: "normal",
7115
7137
  weight: "100 900",
7116
7138
  display: "swap",
7117
- unicodeRange: O
7139
+ unicodeRange: L
7118
7140
  }
7119
7141
  },
7120
7142
  {
@@ -7124,7 +7146,7 @@ const E = [
7124
7146
  style: "normal",
7125
7147
  weight: "100 900",
7126
7148
  display: "swap",
7127
- unicodeRange: E
7149
+ unicodeRange: O
7128
7150
  }
7129
7151
  },
7130
7152
  {
@@ -7134,7 +7156,7 @@ const E = [
7134
7156
  style: "normal",
7135
7157
  weight: "400",
7136
7158
  display: "swap",
7137
- unicodeRange: O
7159
+ unicodeRange: L
7138
7160
  }
7139
7161
  },
7140
7162
  {
@@ -7144,7 +7166,7 @@ const E = [
7144
7166
  style: "normal",
7145
7167
  weight: "400",
7146
7168
  display: "swap",
7147
- unicodeRange: E
7169
+ unicodeRange: O
7148
7170
  }
7149
7171
  },
7150
7172
  {
@@ -7154,7 +7176,7 @@ const E = [
7154
7176
  style: "normal",
7155
7177
  weight: "700",
7156
7178
  display: "swap",
7157
- unicodeRange: O
7179
+ unicodeRange: L
7158
7180
  }
7159
7181
  },
7160
7182
  {
@@ -7164,7 +7186,7 @@ const E = [
7164
7186
  style: "normal",
7165
7187
  weight: "700",
7166
7188
  display: "swap",
7167
- unicodeRange: E
7189
+ unicodeRange: O
7168
7190
  }
7169
7191
  },
7170
7192
  {
@@ -7174,7 +7196,7 @@ const E = [
7174
7196
  style: "normal",
7175
7197
  weight: "400 700",
7176
7198
  display: "swap",
7177
- unicodeRange: O
7199
+ unicodeRange: L
7178
7200
  }
7179
7201
  },
7180
7202
  {
@@ -7184,7 +7206,7 @@ const E = [
7184
7206
  style: "normal",
7185
7207
  weight: "400 700",
7186
7208
  display: "swap",
7187
- unicodeRange: E
7209
+ unicodeRange: O
7188
7210
  }
7189
7211
  },
7190
7212
  {
@@ -7194,7 +7216,7 @@ const E = [
7194
7216
  style: "normal",
7195
7217
  weight: "100 900",
7196
7218
  display: "swap",
7197
- unicodeRange: O
7219
+ unicodeRange: L
7198
7220
  }
7199
7221
  },
7200
7222
  {
@@ -7204,7 +7226,7 @@ const E = [
7204
7226
  style: "normal",
7205
7227
  weight: "100 900",
7206
7228
  display: "swap",
7207
- unicodeRange: E
7229
+ unicodeRange: O
7208
7230
  }
7209
7231
  },
7210
7232
  {
@@ -7214,7 +7236,7 @@ const E = [
7214
7236
  style: "normal",
7215
7237
  weight: "100",
7216
7238
  display: "swap",
7217
- unicodeRange: O
7239
+ unicodeRange: L
7218
7240
  }
7219
7241
  },
7220
7242
  {
@@ -7224,7 +7246,7 @@ const E = [
7224
7246
  style: "normal",
7225
7247
  weight: "100",
7226
7248
  display: "swap",
7227
- unicodeRange: E
7249
+ unicodeRange: O
7228
7250
  }
7229
7251
  },
7230
7252
  {
@@ -7234,7 +7256,7 @@ const E = [
7234
7256
  style: "normal",
7235
7257
  weight: "200",
7236
7258
  display: "swap",
7237
- unicodeRange: O
7259
+ unicodeRange: L
7238
7260
  }
7239
7261
  },
7240
7262
  {
@@ -7244,7 +7266,7 @@ const E = [
7244
7266
  style: "normal",
7245
7267
  weight: "200",
7246
7268
  display: "swap",
7247
- unicodeRange: E
7269
+ unicodeRange: O
7248
7270
  }
7249
7271
  },
7250
7272
  {
@@ -7254,7 +7276,7 @@ const E = [
7254
7276
  style: "normal",
7255
7277
  weight: "300",
7256
7278
  display: "swap",
7257
- unicodeRange: O
7279
+ unicodeRange: L
7258
7280
  }
7259
7281
  },
7260
7282
  {
@@ -7264,7 +7286,7 @@ const E = [
7264
7286
  style: "normal",
7265
7287
  weight: "300",
7266
7288
  display: "swap",
7267
- unicodeRange: E
7289
+ unicodeRange: O
7268
7290
  }
7269
7291
  },
7270
7292
  {
@@ -7274,7 +7296,7 @@ const E = [
7274
7296
  style: "normal",
7275
7297
  weight: "400",
7276
7298
  display: "swap",
7277
- unicodeRange: O
7299
+ unicodeRange: L
7278
7300
  }
7279
7301
  },
7280
7302
  {
@@ -7284,7 +7306,7 @@ const E = [
7284
7306
  style: "normal",
7285
7307
  weight: "400",
7286
7308
  display: "swap",
7287
- unicodeRange: E
7309
+ unicodeRange: O
7288
7310
  }
7289
7311
  },
7290
7312
  {
@@ -7294,7 +7316,7 @@ const E = [
7294
7316
  style: "normal",
7295
7317
  weight: "500",
7296
7318
  display: "swap",
7297
- unicodeRange: O
7319
+ unicodeRange: L
7298
7320
  }
7299
7321
  },
7300
7322
  {
@@ -7304,7 +7326,7 @@ const E = [
7304
7326
  style: "normal",
7305
7327
  weight: "500",
7306
7328
  display: "swap",
7307
- unicodeRange: E
7329
+ unicodeRange: O
7308
7330
  }
7309
7331
  },
7310
7332
  {
@@ -7314,7 +7336,7 @@ const E = [
7314
7336
  style: "normal",
7315
7337
  weight: "600",
7316
7338
  display: "swap",
7317
- unicodeRange: O
7339
+ unicodeRange: L
7318
7340
  }
7319
7341
  },
7320
7342
  {
@@ -7324,7 +7346,7 @@ const E = [
7324
7346
  style: "normal",
7325
7347
  weight: "600",
7326
7348
  display: "swap",
7327
- unicodeRange: E
7349
+ unicodeRange: O
7328
7350
  }
7329
7351
  },
7330
7352
  {
@@ -7334,7 +7356,7 @@ const E = [
7334
7356
  style: "normal",
7335
7357
  weight: "700",
7336
7358
  display: "swap",
7337
- unicodeRange: O
7359
+ unicodeRange: L
7338
7360
  }
7339
7361
  },
7340
7362
  {
@@ -7344,7 +7366,7 @@ const E = [
7344
7366
  style: "normal",
7345
7367
  weight: "700",
7346
7368
  display: "swap",
7347
- unicodeRange: E
7369
+ unicodeRange: O
7348
7370
  }
7349
7371
  },
7350
7372
  {
@@ -7354,7 +7376,7 @@ const E = [
7354
7376
  style: "normal",
7355
7377
  weight: "800",
7356
7378
  display: "swap",
7357
- unicodeRange: O
7379
+ unicodeRange: L
7358
7380
  }
7359
7381
  },
7360
7382
  {
@@ -7364,7 +7386,7 @@ const E = [
7364
7386
  style: "normal",
7365
7387
  weight: "800",
7366
7388
  display: "swap",
7367
- unicodeRange: E
7389
+ unicodeRange: O
7368
7390
  }
7369
7391
  },
7370
7392
  {
@@ -7374,7 +7396,7 @@ const E = [
7374
7396
  style: "normal",
7375
7397
  weight: "900",
7376
7398
  display: "swap",
7377
- unicodeRange: O
7399
+ unicodeRange: L
7378
7400
  }
7379
7401
  },
7380
7402
  {
@@ -7384,7 +7406,7 @@ const E = [
7384
7406
  style: "normal",
7385
7407
  weight: "900",
7386
7408
  display: "swap",
7387
- unicodeRange: E
7409
+ unicodeRange: O
7388
7410
  }
7389
7411
  },
7390
7412
  {
@@ -7394,7 +7416,7 @@ const E = [
7394
7416
  style: "normal",
7395
7417
  weight: "400",
7396
7418
  display: "swap",
7397
- unicodeRange: O
7419
+ unicodeRange: L
7398
7420
  }
7399
7421
  },
7400
7422
  {
@@ -7404,7 +7426,7 @@ const E = [
7404
7426
  style: "normal",
7405
7427
  weight: "400",
7406
7428
  display: "swap",
7407
- unicodeRange: E
7429
+ unicodeRange: O
7408
7430
  }
7409
7431
  },
7410
7432
  {
@@ -7414,7 +7436,7 @@ const E = [
7414
7436
  style: "normal",
7415
7437
  weight: "700",
7416
7438
  display: "swap",
7417
- unicodeRange: O
7439
+ unicodeRange: L
7418
7440
  }
7419
7441
  },
7420
7442
  {
@@ -7424,7 +7446,7 @@ const E = [
7424
7446
  style: "normal",
7425
7447
  weight: "700",
7426
7448
  display: "swap",
7427
- unicodeRange: E
7449
+ unicodeRange: O
7428
7450
  }
7429
7451
  },
7430
7452
  {
@@ -7434,7 +7456,7 @@ const E = [
7434
7456
  style: "normal",
7435
7457
  weight: "100 900",
7436
7458
  display: "swap",
7437
- unicodeRange: O
7459
+ unicodeRange: L
7438
7460
  }
7439
7461
  },
7440
7462
  {
@@ -7444,7 +7466,7 @@ const E = [
7444
7466
  style: "normal",
7445
7467
  weight: "100 900",
7446
7468
  display: "swap",
7447
- unicodeRange: E
7469
+ unicodeRange: O
7448
7470
  }
7449
7471
  },
7450
7472
  {
@@ -7454,7 +7476,7 @@ const E = [
7454
7476
  style: "normal",
7455
7477
  weight: "300 700",
7456
7478
  display: "swap",
7457
- unicodeRange: O
7479
+ unicodeRange: L
7458
7480
  }
7459
7481
  },
7460
7482
  {
@@ -7464,7 +7486,7 @@ const E = [
7464
7486
  style: "normal",
7465
7487
  weight: "300 700",
7466
7488
  display: "swap",
7467
- unicodeRange: E
7489
+ unicodeRange: O
7468
7490
  }
7469
7491
  },
7470
7492
  {
@@ -7474,7 +7496,7 @@ const E = [
7474
7496
  style: "normal",
7475
7497
  weight: "400",
7476
7498
  display: "swap",
7477
- unicodeRange: O
7499
+ unicodeRange: L
7478
7500
  }
7479
7501
  },
7480
7502
  {
@@ -7484,7 +7506,7 @@ const E = [
7484
7506
  style: "normal",
7485
7507
  weight: "400",
7486
7508
  display: "swap",
7487
- unicodeRange: E
7509
+ unicodeRange: O
7488
7510
  }
7489
7511
  },
7490
7512
  {
@@ -7494,7 +7516,7 @@ const E = [
7494
7516
  style: "normal",
7495
7517
  weight: "200 800",
7496
7518
  display: "swap",
7497
- unicodeRange: O
7519
+ unicodeRange: L
7498
7520
  }
7499
7521
  },
7500
7522
  {
@@ -7504,7 +7526,7 @@ const E = [
7504
7526
  style: "normal",
7505
7527
  weight: "200 800",
7506
7528
  display: "swap",
7507
- unicodeRange: E
7529
+ unicodeRange: O
7508
7530
  }
7509
7531
  },
7510
7532
  {
@@ -7514,7 +7536,7 @@ const E = [
7514
7536
  style: "normal",
7515
7537
  weight: "100 900",
7516
7538
  display: "swap",
7517
- unicodeRange: O
7539
+ unicodeRange: L
7518
7540
  }
7519
7541
  },
7520
7542
  {
@@ -7524,7 +7546,7 @@ const E = [
7524
7546
  style: "normal",
7525
7547
  weight: "100 900",
7526
7548
  display: "swap",
7527
- unicodeRange: E
7549
+ unicodeRange: O
7528
7550
  }
7529
7551
  },
7530
7552
  {
@@ -7534,7 +7556,7 @@ const E = [
7534
7556
  style: "normal",
7535
7557
  weight: "400",
7536
7558
  display: "swap",
7537
- unicodeRange: O
7559
+ unicodeRange: L
7538
7560
  }
7539
7561
  },
7540
7562
  {
@@ -7544,7 +7566,7 @@ const E = [
7544
7566
  style: "normal",
7545
7567
  weight: "400",
7546
7568
  display: "swap",
7547
- unicodeRange: E
7569
+ unicodeRange: O
7548
7570
  }
7549
7571
  },
7550
7572
  {
@@ -7554,7 +7576,7 @@ const E = [
7554
7576
  style: "normal",
7555
7577
  weight: "100 900",
7556
7578
  display: "swap",
7557
- unicodeRange: O
7579
+ unicodeRange: L
7558
7580
  }
7559
7581
  },
7560
7582
  {
@@ -7564,7 +7586,7 @@ const E = [
7564
7586
  style: "normal",
7565
7587
  weight: "100 900",
7566
7588
  display: "swap",
7567
- unicodeRange: E
7589
+ unicodeRange: O
7568
7590
  }
7569
7591
  },
7570
7592
  {
@@ -7574,7 +7596,7 @@ const E = [
7574
7596
  style: "normal",
7575
7597
  weight: "300 800",
7576
7598
  display: "swap",
7577
- unicodeRange: O
7599
+ unicodeRange: L
7578
7600
  }
7579
7601
  },
7580
7602
  {
@@ -7584,7 +7606,7 @@ const E = [
7584
7606
  style: "normal",
7585
7607
  weight: "300 800",
7586
7608
  display: "swap",
7587
- unicodeRange: E
7609
+ unicodeRange: O
7588
7610
  }
7589
7611
  },
7590
7612
  {
@@ -7594,7 +7616,7 @@ const E = [
7594
7616
  style: "normal",
7595
7617
  weight: "400",
7596
7618
  display: "swap",
7597
- unicodeRange: O
7619
+ unicodeRange: L
7598
7620
  }
7599
7621
  },
7600
7622
  {
@@ -7604,7 +7626,7 @@ const E = [
7604
7626
  style: "normal",
7605
7627
  weight: "400",
7606
7628
  display: "swap",
7607
- unicodeRange: E
7629
+ unicodeRange: O
7608
7630
  }
7609
7631
  },
7610
7632
  {
@@ -7614,7 +7636,7 @@ const E = [
7614
7636
  style: "normal",
7615
7637
  weight: "700",
7616
7638
  display: "swap",
7617
- unicodeRange: O
7639
+ unicodeRange: L
7618
7640
  }
7619
7641
  },
7620
7642
  {
@@ -7624,7 +7646,7 @@ const E = [
7624
7646
  style: "normal",
7625
7647
  weight: "700",
7626
7648
  display: "swap",
7627
- unicodeRange: E
7649
+ unicodeRange: O
7628
7650
  }
7629
7651
  },
7630
7652
  {
@@ -7634,7 +7656,7 @@ const E = [
7634
7656
  style: "normal",
7635
7657
  weight: "300 900",
7636
7658
  display: "swap",
7637
- unicodeRange: O
7659
+ unicodeRange: L
7638
7660
  }
7639
7661
  },
7640
7662
  {
@@ -7644,7 +7666,7 @@ const E = [
7644
7666
  style: "normal",
7645
7667
  weight: "300 900",
7646
7668
  display: "swap",
7647
- unicodeRange: E
7669
+ unicodeRange: O
7648
7670
  }
7649
7671
  },
7650
7672
  {
@@ -7654,7 +7676,7 @@ const E = [
7654
7676
  style: "normal",
7655
7677
  weight: "400",
7656
7678
  display: "swap",
7657
- unicodeRange: O
7679
+ unicodeRange: L
7658
7680
  }
7659
7681
  },
7660
7682
  {
@@ -7664,7 +7686,7 @@ const E = [
7664
7686
  style: "normal",
7665
7687
  weight: "400",
7666
7688
  display: "swap",
7667
- unicodeRange: E
7689
+ unicodeRange: O
7668
7690
  }
7669
7691
  },
7670
7692
  {
@@ -7674,7 +7696,7 @@ const E = [
7674
7696
  style: "normal",
7675
7697
  weight: "100 900",
7676
7698
  display: "swap",
7677
- unicodeRange: O
7699
+ unicodeRange: L
7678
7700
  }
7679
7701
  },
7680
7702
  {
@@ -7684,7 +7706,7 @@ const E = [
7684
7706
  style: "normal",
7685
7707
  weight: "100 900",
7686
7708
  display: "swap",
7687
- unicodeRange: E
7709
+ unicodeRange: O
7688
7710
  }
7689
7711
  },
7690
7712
  {
@@ -7694,7 +7716,7 @@ const E = [
7694
7716
  style: "normal",
7695
7717
  weight: "100 900",
7696
7718
  display: "swap",
7697
- unicodeRange: O
7719
+ unicodeRange: L
7698
7720
  }
7699
7721
  },
7700
7722
  {
@@ -7704,7 +7726,7 @@ const E = [
7704
7726
  style: "normal",
7705
7727
  weight: "100 900",
7706
7728
  display: "swap",
7707
- unicodeRange: E
7729
+ unicodeRange: O
7708
7730
  }
7709
7731
  }
7710
7732
  ], Co = {
@@ -7802,7 +7824,7 @@ const E = [
7802
7824
  fonts: Io
7803
7825
  };
7804
7826
  function Do(h, t = {}) {
7805
- const e = _(_({}, Co), t), s = document.getElementById(h);
7827
+ const e = N(N({}, Co), t), s = document.getElementById(h);
7806
7828
  if (!s)
7807
7829
  return Promise.reject(new Error(`Контейнер с ID "${h}" не найден.`));
7808
7830
  const o = document.createElement("canvas");