@cliquify.me/timeline 6.0.8 → 6.0.9

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.
package/dist/index.es.js CHANGED
@@ -1,6 +1,6 @@
1
1
  var Dl = Object.defineProperty;
2
2
  var Il = (i, t, e) => t in i ? Dl(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
3
- var x = (i, t, e) => Il(i, typeof t != "symbol" ? t + "" : t, e);
3
+ var w = (i, t, e) => Il(i, typeof t != "symbol" ? t + "" : t, e);
4
4
  import { dispatch as se } from "@designcombo/events";
5
5
  function y(i, t, e) {
6
6
  return (t = function(s) {
@@ -145,7 +145,7 @@ const Ht = () => io || (io = { document, window, isTouchSupported: "ontouchstart
145
145
  }(), Ni = "6.9.1";
146
146
  function Le() {
147
147
  }
148
- const Te = Math.PI / 2, he = 2 * Math.PI, Tn = Math.PI / 180, ft = Object.freeze([1, 0, 0, 1, 0, 0]), xn = 16, me = 0.4477152502, j = "center", B = "left", pt = "top", Ui = "bottom", Z = "right", mt = "none", Sn = /\r?\n/, ja = "moving", ii = "scaling", Ea = "rotating", wn = "rotate", Pa = "skewing", Xs = "resizing", Aa = "modifyPoly", Al = "modifyPath", Xr = "changed", ni = "scale", gt = "scaleX", _t = "scaleY", vs = "skewX", ys = "skewY", rt = "fill", vt = "stroke", zr = "modified", Ke = "json", Oi = "svg", k = new class {
148
+ const Te = Math.PI / 2, he = 2 * Math.PI, Tn = Math.PI / 180, ft = Object.freeze([1, 0, 0, 1, 0, 0]), xn = 16, me = 0.4477152502, j = "center", B = "left", pt = "top", Ui = "bottom", Q = "right", mt = "none", Sn = /\r?\n/, ja = "moving", ii = "scaling", Ea = "rotating", wn = "rotate", Pa = "skewing", Xs = "resizing", Aa = "modifyPoly", Al = "modifyPath", Xr = "changed", ni = "scale", gt = "scaleX", _t = "scaleY", vs = "skewX", ys = "skewY", rt = "fill", vt = "stroke", zr = "modified", Ke = "json", Oi = "svg", k = new class {
149
149
  constructor() {
150
150
  this[Ke] = /* @__PURE__ */ new Map(), this[Oi] = /* @__PURE__ */ new Map();
151
151
  }
@@ -528,10 +528,10 @@ const xe = () => Rl++, Yt = () => {
528
528
  return t.width = i.width, t.height = i.height, t;
529
529
  }, On = (i, t, e) => i.toDataURL("image/".concat(t), e), kn = (i, t, e) => new Promise((s, r) => {
530
530
  i.toBlob(s, "image/".concat(t), e);
531
- }), q = (i) => i * Tn, Vt = (i) => i / Tn, Wa = (i) => i.every((t, e) => t === ft[e]), lt = (i, t, e) => new T(i).transform(t, e), bt = (i) => {
531
+ }), K = (i) => i * Tn, Vt = (i) => i / Tn, Wa = (i) => i.every((t, e) => t === ft[e]), lt = (i, t, e) => new T(i).transform(t, e), bt = (i) => {
532
532
  const t = 1 / (i[0] * i[3] - i[1] * i[2]), e = [t * i[3], -t * i[1], -t * i[2], t * i[0], 0, 0], { x: s, y: r } = new T(i[4], i[5]).transform(e, !0);
533
533
  return e[4] = -s, e[5] = -r, e;
534
- }, K = (i, t, e) => [i[0] * t[0] + i[2] * t[1], i[1] * t[0] + i[3] * t[1], i[0] * t[2] + i[2] * t[3], i[1] * t[2] + i[3] * t[3], e ? 0 : i[0] * t[4] + i[2] * t[5] + i[4], e ? 0 : i[1] * t[4] + i[3] * t[5] + i[5]], oi = (i, t) => i.reduceRight((e, s) => s && e ? K(s, e, t) : s || e, void 0) || ft.concat(), Xa = (i) => {
534
+ }, J = (i, t, e) => [i[0] * t[0] + i[2] * t[1], i[1] * t[0] + i[3] * t[1], i[0] * t[2] + i[2] * t[3], i[1] * t[2] + i[3] * t[3], e ? 0 : i[0] * t[4] + i[2] * t[5] + i[4], e ? 0 : i[1] * t[4] + i[3] * t[5] + i[5]], oi = (i, t) => i.reduceRight((e, s) => s && e ? J(s, e, t) : s || e, void 0) || ft.concat(), Xa = (i) => {
535
535
  let [t, e] = i;
536
536
  return Math.atan2(e, t);
537
537
  }, us = (i) => {
@@ -542,20 +542,20 @@ const xe = () => Rl++, Yt = () => {
542
542
  };
543
543
  function Ye() {
544
544
  let { angle: i = 0 } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, { x: t = 0, y: e = 0 } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
545
- const s = q(i), r = At(s), n = Lt(s);
545
+ const s = K(i), r = At(s), n = Lt(s);
546
546
  return [r, n, -n, r, t ? t - (r * t - n * e) : 0, e ? e - (n * t + r * e) : 0];
547
547
  }
548
548
  const ai = function(i) {
549
549
  return [i, 0, 0, arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : i, 0, 0];
550
- }, za = (i) => Math.tan(q(i)), Mn = (i) => [1, 0, za(i), 1, 0, 0], Dn = (i) => [1, za(i), 0, 1, 0, 0], Js = (i) => {
550
+ }, za = (i) => Math.tan(K(i)), Mn = (i) => [1, 0, za(i), 1, 0, 0], Dn = (i) => [1, za(i), 0, 1, 0, 0], Js = (i) => {
551
551
  let { scaleX: t = 1, scaleY: e = 1, flipX: s = !1, flipY: r = !1, skewX: n = 0, skewY: o = 0 } = i, a = ai(s ? -t : t, r ? -e : e);
552
- return n && (a = K(a, Mn(n), !0)), o && (a = K(a, Dn(o), !0)), a;
552
+ return n && (a = J(a, Mn(n), !0)), o && (a = J(a, Dn(o), !0)), a;
553
553
  }, Ha = (i) => {
554
554
  const { translateX: t = 0, translateY: e = 0, angle: s = 0 } = i;
555
555
  let r = bs(t, e);
556
- s && (r = K(r, Ye({ angle: s })));
556
+ s && (r = J(r, Ye({ angle: s })));
557
557
  const n = Js(i);
558
- return Wa(n) || (r = K(r, n)), r;
558
+ return Wa(n) || (r = J(r, n)), r;
559
559
  }, Ps = function(i) {
560
560
  let { signal: t, crossOrigin: e = null } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
561
561
  return new Promise(function(s, r) {
@@ -1000,7 +1000,7 @@ Resulting to default behavior: removing object from previous canvas and adding t
1000
1000
  }
1001
1001
  toCanvasElement() {
1002
1002
  let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1, { width: e, height: s, left: r, top: n, filter: o } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1003
- const a = (e || this.width) * t, c = (s || this.height) * t, h = this.getZoom(), l = this.width, u = this.height, d = this.skipControlsDrawing, f = h * t, g = this.viewportTransform, p = [f, 0, 0, f, (g[4] - (r || 0)) * t, (g[5] - (n || 0)) * t], m = this.enableRetinaScaling, b = Tt({ width: a, height: c }), _ = o ? this._objects.filter((w) => o(w)) : this._objects;
1003
+ const a = (e || this.width) * t, c = (s || this.height) * t, h = this.getZoom(), l = this.width, u = this.height, d = this.skipControlsDrawing, f = h * t, g = this.viewportTransform, p = [f, 0, 0, f, (g[4] - (r || 0)) * t, (g[5] - (n || 0)) * t], m = this.enableRetinaScaling, b = Tt({ width: a, height: c }), _ = o ? this._objects.filter((S) => o(S)) : this._objects;
1004
1004
  return this.enableRetinaScaling = !1, this.viewportTransform = p, this.width = a, this.height = c, this.skipControlsDrawing = !0, this.calcViewportBoundaries(), this.renderCanvas(b.getContext("2d"), _), this.viewportTransform = g, this.width = l, this.height = u, this.calcViewportBoundaries(), this.enableRetinaScaling = m, this.skipControlsDrawing = d, b;
1005
1005
  }
1006
1006
  dispose() {
@@ -1034,7 +1034,7 @@ const Wl = ["touchstart", "touchmove", "touchend"], Ua = (i) => {
1034
1034
  (a > s || !n) && (s = a), (a < t || !n) && (t = a), (c > r || !n) && (r = c), (c < e || !n) && (e = c);
1035
1035
  }
1036
1036
  return { left: t, top: e, width: s - t, height: r - e };
1037
- }, Xl = ["translateX", "translateY", "scaleX", "scaleY"], $a = (i, t) => gs(i, K(t, i.calcOwnMatrix())), gs = (i, t) => {
1037
+ }, Xl = ["translateX", "translateY", "scaleX", "scaleY"], $a = (i, t) => gs(i, J(t, i.calcOwnMatrix())), gs = (i, t) => {
1038
1038
  const e = us(t), { translateX: s, translateY: r, scaleX: n, scaleY: o } = e, a = N(e, Xl), c = new T(s, r);
1039
1039
  i.flipX = !1, i.flipY = !1, Object.assign(i, a), i.set({ scaleX: n, scaleY: o }), i.setPositionByOrigin(c, j, j);
1040
1040
  }, qa = (i) => {
@@ -1044,7 +1044,7 @@ const Wl = ["touchstart", "touchmove", "touchend"], Ua = (i) => {
1044
1044
  return new T(o.width, o.height);
1045
1045
  }, tr = function() {
1046
1046
  let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ft;
1047
- return K(bt(arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ft), i);
1047
+ return J(bt(arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ft), i);
1048
1048
  }, oe = function(i) {
1049
1049
  let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ft, e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ft;
1050
1050
  return i.transform(tr(t, e));
@@ -1053,7 +1053,7 @@ const Wl = ["touchstart", "touchmove", "touchend"], Ua = (i) => {
1053
1053
  return i.transform(tr(t, e), !0);
1054
1054
  }, qi = (i, t, e) => {
1055
1055
  const s = tr(t, e);
1056
- return gs(i, K(s, i.calcOwnMatrix())), s;
1056
+ return gs(i, J(s, i.calcOwnMatrix())), s;
1057
1057
  }, En = (i, t) => {
1058
1058
  var e;
1059
1059
  const { transform: { target: s } } = t;
@@ -1075,7 +1075,7 @@ function hi(i, t, e, s, r) {
1075
1075
  let { target: o, corner: a } = i;
1076
1076
  const c = o.controls[a], h = ((n = o.canvas) === null || n === void 0 ? void 0 : n.getZoom()) || 1, l = o.padding / h, u = function(d, f, g, p) {
1077
1077
  const m = d.getRelativeCenterPoint(), b = g !== void 0 && p !== void 0 ? d.translateToGivenOrigin(m, j, j, g, p) : new T(d.left, d.top);
1078
- return (d.angle ? f.rotate(-q(d.angle), m) : f).subtract(b);
1078
+ return (d.angle ? f.rotate(-K(d.angle), m) : f).subtract(b);
1079
1079
  }(o, new T(s, r), t, e);
1080
1080
  return u.x >= l && (u.x -= l), u.x <= -l && (u.x += l), u.y >= l && (u.y -= l), u.y <= l && (u.y += l), u.x -= c.offsetX, u.y -= c.offsetY, u;
1081
1081
  }
@@ -1332,7 +1332,7 @@ class ae {
1332
1332
  return [this.offsetX, this.offsetY, this.blur, this.color].join("px ");
1333
1333
  }
1334
1334
  toSVG(t) {
1335
- const e = An(new T(this.offsetX, this.offsetY), q(-t.angle)), s = new X(this.color);
1335
+ const e = An(new T(this.offsetX, this.offsetY), K(-t.angle)), s = new X(this.color);
1336
1336
  let r = 40, n = 40;
1337
1337
  return t.width && t.height && (r = 100 * H((Math.abs(e.x) + this.blur) / t.width, L.NUM_FRACTION_DIGITS) + 20, n = 100 * H((Math.abs(e.y) + this.blur) / t.height, L.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(r, '%" width="').concat(100 + 2 * r, `%" >
1338
1338
  <feGaussianBlur in="SourceAlpha" stdDeviation="`).concat(H(this.blur ? this.blur / 2 : 0, L.NUM_FRACTION_DIGITS), `"></feGaussianBlur>
@@ -1653,7 +1653,7 @@ class iu extends Ra {
1653
1653
  return ((t = this.canvas) === null || t === void 0 ? void 0 : t.viewportTransform) || ft.concat();
1654
1654
  }
1655
1655
  calcACoords() {
1656
- const t = Ye({ angle: this.angle }), { x: e, y: s } = this.getRelativeCenterPoint(), r = bs(e, s), n = K(r, t), o = this._getTransformedDimensions(), a = o.x / 2, c = o.y / 2;
1656
+ const t = Ye({ angle: this.angle }), { x: e, y: s } = this.getRelativeCenterPoint(), r = bs(e, s), n = J(r, t), o = this._getTransformedDimensions(), a = o.x / 2, c = o.y / 2;
1657
1657
  return { tl: lt({ x: -a, y: -c }, n), tr: lt({ x: a, y: -c }, n), bl: lt({ x: -a, y: c }, n), br: lt({ x: a, y: c }, n) };
1658
1658
  }
1659
1659
  setCoords() {
@@ -1667,7 +1667,7 @@ class iu extends Ra {
1667
1667
  let t = arguments.length > 0 && arguments[0] !== void 0 && arguments[0], e = this.calcOwnMatrix();
1668
1668
  if (t || !this.group) return e;
1669
1669
  const s = this.transformMatrixKey(t), r = this.matrixCache;
1670
- return r && r.key.every((n, o) => n === s[o]) ? r.value : (this.group && (e = K(this.group.calcTransformMatrix(!1), e)), this.matrixCache = { key: s, value: e }, e);
1670
+ return r && r.key.every((n, o) => n === s[o]) ? r.value : (this.group && (e = J(this.group.calcTransformMatrix(!1), e)), this.matrixCache = { key: s, value: e }, e);
1671
1671
  }
1672
1672
  calcOwnMatrix() {
1673
1673
  const t = this.transformMatrixKey(!0), e = this.ownMatrixCache;
@@ -1702,11 +1702,11 @@ class iu extends Ra {
1702
1702
  translateToCenterPoint(t, e, s) {
1703
1703
  if (e === j && s === j) return t;
1704
1704
  const r = this.translateToGivenOrigin(t, e, s, j, j);
1705
- return this.angle ? r.rotate(q(this.angle), t) : r;
1705
+ return this.angle ? r.rotate(K(this.angle), t) : r;
1706
1706
  }
1707
1707
  translateToOriginPoint(t, e, s) {
1708
1708
  const r = this.translateToGivenOrigin(t, j, j, e, s);
1709
- return this.angle ? r.rotate(q(this.angle), t) : r;
1709
+ return this.angle ? r.rotate(K(this.angle), t) : r;
1710
1710
  }
1711
1711
  getCenterPoint() {
1712
1712
  const t = this.getRelativeCenterPoint();
@@ -1935,8 +1935,8 @@ let Qt = class Fr extends iu {
1935
1935
  delete this.group, t.withoutTransform && qa(this), t.withoutShadow && (this.shadow = null), t.viewportTransform && qi(this, this.getViewportTransform()), this.setCoords();
1936
1936
  const h = Yt(), l = this.getBoundingRect(), u = this.shadow, d = new T();
1937
1937
  if (u) {
1938
- const _ = u.blur, w = u.nonScaling ? new T(1, 1) : this.getObjectScaling();
1939
- d.x = 2 * Math.round(n(u.offsetX) + _) * n(w.x), d.y = 2 * Math.round(n(u.offsetY) + _) * n(w.y);
1938
+ const _ = u.blur, S = u.nonScaling ? new T(1, 1) : this.getObjectScaling();
1939
+ d.x = 2 * Math.round(n(u.offsetX) + _) * n(S.x), d.y = 2 * Math.round(n(u.offsetY) + _) * n(S.y);
1940
1940
  }
1941
1941
  const f = l.width + d.x, g = l.height + d.y;
1942
1942
  h.width = Math.ceil(f), h.height = Math.ceil(g);
@@ -2041,9 +2041,9 @@ let Qt = class Fr extends iu {
2041
2041
  toObject() {
2042
2042
  const t = (arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : []).concat(Fr.customProperties, this.constructor.customProperties || []);
2043
2043
  let e;
2044
- const s = L.NUM_FRACTION_DIGITS, { clipPath: r, fill: n, stroke: o, shadow: a, strokeDashArray: c, left: h, top: l, originX: u, originY: d, width: f, height: g, strokeWidth: p, strokeLineCap: m, strokeDashOffset: b, strokeLineJoin: _, strokeUniform: w, strokeMiterLimit: S, scaleX: C, scaleY: O, angle: D, flipX: M, flipY: I, opacity: R, visible: z, backgroundColor: E, fillRule: W, paintFirst: F, globalCompositeOperation: at, skewX: nt, skewY: ct } = this;
2044
+ const s = L.NUM_FRACTION_DIGITS, { clipPath: r, fill: n, stroke: o, shadow: a, strokeDashArray: c, left: h, top: l, originX: u, originY: d, width: f, height: g, strokeWidth: p, strokeLineCap: m, strokeDashOffset: b, strokeLineJoin: _, strokeUniform: S, strokeMiterLimit: x, scaleX: C, scaleY: O, angle: D, flipX: M, flipY: I, opacity: R, visible: z, backgroundColor: E, fillRule: W, paintFirst: F, globalCompositeOperation: at, skewX: nt, skewY: ct } = this;
2045
2045
  r && !r.excludeFromExport && (e = r.toObject(t.concat("inverted", "absolutePositioned")));
2046
- const Y = (Zt) => H(Zt, s), Ft = v(v({}, Ve(this, t)), {}, { type: this.constructor.type, version: Ni, originX: u, originY: d, left: Y(h), top: Y(l), width: Y(f), height: Y(g), fill: no(n) ? n.toObject() : n, stroke: no(o) ? o.toObject() : o, strokeWidth: Y(p), strokeDashArray: c && c.concat(), strokeLineCap: m, strokeDashOffset: b, strokeLineJoin: _, strokeUniform: w, strokeMiterLimit: Y(S), scaleX: Y(C), scaleY: Y(O), angle: Y(D), flipX: M, flipY: I, opacity: Y(R), shadow: a && a.toObject(), visible: z, backgroundColor: E, fillRule: W, paintFirst: F, globalCompositeOperation: at, skewX: Y(nt), skewY: Y(ct) }, e ? { clipPath: e } : null);
2046
+ const Y = (Zt) => H(Zt, s), Ft = v(v({}, Ve(this, t)), {}, { type: this.constructor.type, version: Ni, originX: u, originY: d, left: Y(h), top: Y(l), width: Y(f), height: Y(g), fill: no(n) ? n.toObject() : n, stroke: no(o) ? o.toObject() : o, strokeWidth: Y(p), strokeDashArray: c && c.concat(), strokeLineCap: m, strokeDashOffset: b, strokeLineJoin: _, strokeUniform: S, strokeMiterLimit: Y(x), scaleX: Y(C), scaleY: Y(O), angle: Y(D), flipX: M, flipY: I, opacity: Y(R), shadow: a && a.toObject(), visible: z, backgroundColor: E, fillRule: W, paintFirst: F, globalCompositeOperation: at, skewX: Y(nt), skewY: Y(ct) }, e ? { clipPath: e } : null);
2047
2047
  return this.includeDefaultValues ? Ft : this._removeDefaultValues(Ft);
2048
2048
  }
2049
2049
  toDatalessObject(t) {
@@ -2081,7 +2081,7 @@ function Ge(i) {
2081
2081
  }
2082
2082
  const Zi = Oe(Xs, Ge((i, t, e, s) => {
2083
2083
  const r = hi(t, t.originX, t.originY, e, s);
2084
- if (et(t.originX) === et(j) || et(t.originX) === et(Z) && r.x < 0 || et(t.originX) === et(B) && r.x > 0) {
2084
+ if (et(t.originX) === et(j) || et(t.originX) === et(Q) && r.x < 0 || et(t.originX) === et(B) && r.x > 0) {
2085
2085
  const { target: n } = t, o = n.strokeWidth / (n.strokeUniform ? n.scaleX : 1), a = Ja(t) ? 2 : 1, c = n.width, h = Math.abs(r.x * a / n.scaleX) - o;
2086
2086
  return n.set("width", Math.max(h, 1)), c !== n.width;
2087
2087
  }
@@ -2098,7 +2098,7 @@ function dc(i, t, e, s, r) {
2098
2098
  const n = this.sizeX || s.cornerSize || r.cornerSize, o = this.sizeY || s.cornerSize || r.cornerSize, a = s.transparentCorners !== void 0 ? s.transparentCorners : r.transparentCorners, c = a ? vt : rt, h = !a && (s.cornerStrokeColor || r.cornerStrokeColor), l = n / 2, u = o / 2;
2099
2099
  i.save(), i.fillStyle = s.cornerColor || r.cornerColor || "", i.strokeStyle = s.cornerStrokeColor || r.cornerStrokeColor || "", i.translate(t, e);
2100
2100
  const d = r.getTotalAngle();
2101
- i.rotate(q(d)), i["".concat(c, "Rect")](-l, -u, n, o), h && i.strokeRect(-l, -u, n, o), i.restore();
2101
+ i.rotate(K(d)), i["".concat(c, "Rect")](-l, -u, n, o), h && i.strokeRect(-l, -u, n, o), i.restore();
2102
2102
  }
2103
2103
  class $ {
2104
2104
  constructor(t) {
@@ -2198,9 +2198,9 @@ function _c(i, t, e, s, r) {
2198
2198
  const { target: n } = e, { counterAxis: o, origin: a, lockSkewing: c, skew: h, flip: l } = Pi[i];
2199
2199
  if (Pt(n, c)) return !1;
2200
2200
  const { origin: u, flip: d } = Pi[o], f = et(e[u]) * (n[d] ? -1 : 1), g = -Math.sign(f) * (n[l] ? -1 : 1), p = 0.5 * -((n[h] === 0 && hi(e, j, j, s, r)[i] > 0 || n[h] > 0 ? 1 : -1) * g) + 0.5;
2201
- return Oe(Pa, Ge((b, _, w, S) => function(C, O, D) {
2201
+ return Oe(Pa, Ge((b, _, S, x) => function(C, O, D) {
2202
2202
  let { target: M, ex: I, ey: R, skewingSide: z } = O, E = N(O, cu);
2203
- const { skew: W } = Pi[C], F = D.subtract(new T(I, R)).divide(new T(M.scaleX, M.scaleY))[C], at = M[W], nt = E[W], ct = Math.tan(q(nt)), Y = C === "y" ? M._getTransformedDimensions({ scaleX: 1, scaleY: 1, skewX: 0 }).x : M._getTransformedDimensions({ scaleX: 1, scaleY: 1 }).y, Ft = 2 * F * z / Math.max(Y, 1) + ct, Zt = Vt(Math.atan(Ft));
2203
+ const { skew: W } = Pi[C], F = D.subtract(new T(I, R)).divide(new T(M.scaleX, M.scaleY))[C], at = M[W], nt = E[W], ct = Math.tan(K(nt)), Y = C === "y" ? M._getTransformedDimensions({ scaleX: 1, scaleY: 1, skewX: 0 }).x : M._getTransformedDimensions({ scaleX: 1, scaleY: 1 }).y, Ft = 2 * F * z / Math.max(Y, 1) + ct, Zt = Vt(Math.atan(Ft));
2204
2204
  M.set(W, Zt);
2205
2205
  const ar = at !== M[W];
2206
2206
  if (ar && C === "y") {
@@ -2208,7 +2208,7 @@ function _c(i, t, e, s, r) {
2208
2208
  Me !== 1 && M.set(gt, Me * xs);
2209
2209
  }
2210
2210
  return ar;
2211
- }(i, _, new T(w, S))))(t, v(v({}, e), {}, { [a]: p, skewingSide: g }), s, r);
2211
+ }(i, _, new T(S, x))))(t, v(v({}, e), {}, { [a]: p, skewingSide: g }), s, r);
2212
2212
  }
2213
2213
  const Tc = (i, t, e, s) => _c("x", i, t, e, s), xc = (i, t, e, s) => _c("y", i, t, e, s);
2214
2214
  function di(i, t) {
@@ -2251,7 +2251,7 @@ class Hs extends Qt {
2251
2251
  }
2252
2252
  }
2253
2253
  calcOCoords() {
2254
- const t = this.getViewportTransform(), e = this.getCenterPoint(), s = bs(e.x, e.y), r = Ye({ angle: this.getTotalAngle() - (this.group && this.flipX ? 180 : 0) }), n = K(s, r), o = K(t, n), a = K(o, [1 / t[0], 0, 0, 1 / t[3], 0, 0]), c = this.group ? us(this.calcTransformMatrix()) : void 0;
2254
+ const t = this.getViewportTransform(), e = this.getCenterPoint(), s = bs(e.x, e.y), r = Ye({ angle: this.getTotalAngle() - (this.group && this.flipX ? 180 : 0) }), n = J(s, r), o = J(t, n), a = J(o, [1 / t[0], 0, 0, 1 / t[3], 0, 0]), c = this.group ? us(this.calcTransformMatrix()) : void 0;
2255
2255
  c && (c.scaleX = Math.abs(c.scaleX), c.scaleY = Math.abs(c.scaleY));
2256
2256
  const h = this._calculateCurrentDimensions(c), l = {};
2257
2257
  return this.forEachControl((u, d) => {
@@ -2273,7 +2273,7 @@ class Hs extends Qt {
2273
2273
  if (!this.selectionBackgroundColor || this.canvas && this.canvas._activeObject !== this) return;
2274
2274
  t.save();
2275
2275
  const e = this.getRelativeCenterPoint(), s = this._calculateCurrentDimensions(), r = this.getViewportTransform();
2276
- t.translate(e.x, e.y), t.scale(1 / r[0], 1 / r[3]), t.rotate(q(this.angle)), t.fillStyle = this.selectionBackgroundColor, t.fillRect(-s.x / 2, -s.y / 2, s.x, s.y), t.restore();
2276
+ t.translate(e.x, e.y), t.scale(1 / r[0], 1 / r[3]), t.rotate(K(this.angle)), t.fillStyle = this.selectionBackgroundColor, t.fillRect(-s.x / 2, -s.y / 2, s.x, s.y), t.restore();
2277
2277
  }
2278
2278
  strokeBorders(t, e) {
2279
2279
  t.strokeRect(-e.x / 2, -e.y / 2, e.x, e.y);
@@ -2285,8 +2285,8 @@ class Hs extends Qt {
2285
2285
  }
2286
2286
  _renderControls(t) {
2287
2287
  let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
2288
- const { hasBorders: s, hasControls: r } = this, n = v({ hasBorders: s, hasControls: r }, e), o = this.getViewportTransform(), a = n.hasBorders, c = n.hasControls, h = K(o, this.calcTransformMatrix()), l = us(h);
2289
- t.save(), t.translate(l.translateX, l.translateY), t.lineWidth = this.borderScaleFactor, this.group === this.parent && (t.globalAlpha = this.isMoving ? this.borderOpacityWhenMoving : 1), this.flipX && (l.angle -= 180), t.rotate(q(this.group ? l.angle : this.angle)), a && this.drawBorders(t, l, e), c && this.drawControls(t, e), t.restore();
2288
+ const { hasBorders: s, hasControls: r } = this, n = v({ hasBorders: s, hasControls: r }, e), o = this.getViewportTransform(), a = n.hasBorders, c = n.hasControls, h = J(o, this.calcTransformMatrix()), l = us(h);
2289
+ t.save(), t.translate(l.translateX, l.translateY), t.lineWidth = this.borderScaleFactor, this.group === this.parent && (t.globalAlpha = this.isMoving ? this.borderOpacityWhenMoving : 1), this.flipX && (l.angle -= 180), t.rotate(K(this.group ? l.angle : this.angle)), a && this.drawBorders(t, l, e), c && this.drawControls(t, e), t.restore();
2290
2290
  }
2291
2291
  drawBorders(t, e, s) {
2292
2292
  let r;
@@ -2388,7 +2388,7 @@ class kc {
2388
2388
  }
2389
2389
  applySkew(t) {
2390
2390
  const e = new T(t);
2391
- return e.y += e.x * Math.tan(q(this.options.skewY)), e.x += e.y * Math.tan(q(this.options.skewX)), e;
2391
+ return e.y += e.x * Math.tan(K(this.options.skewY)), e.x += e.y * Math.tan(K(this.options.skewX)), e;
2392
2392
  }
2393
2393
  scaleUnitVector(t, e) {
2394
2394
  return t.multiply(this.strokeUniformScalar).scalarMultiply(e);
@@ -2425,7 +2425,7 @@ class hs extends kc {
2425
2425
  }), s;
2426
2426
  }
2427
2427
  projectRoundWithSkew(t, e) {
2428
- const s = [], { skewX: r, skewY: n, scaleX: o, scaleY: a, strokeUniform: c } = this.options, h = new T(Math.tan(q(r)), Math.tan(q(n))), l = this.strokeProjectionMagnitude, u = c ? l / a / Math.sqrt(1 / a ** 2 + 1 / o ** 2 * h.y ** 2) : l / Math.sqrt(1 + h.y ** 2), d = new T(Math.sqrt(Math.max(l ** 2 - u ** 2, 0)), u), f = c ? l / Math.sqrt(1 + h.x ** 2 * (1 / a) ** 2 / (1 / o + 1 / o * h.x * h.y) ** 2) : l / Math.sqrt(1 + h.x ** 2 / (1 + h.x * h.y) ** 2), g = new T(f, Math.sqrt(Math.max(l ** 2 - f ** 2, 0)));
2428
+ const s = [], { skewX: r, skewY: n, scaleX: o, scaleY: a, strokeUniform: c } = this.options, h = new T(Math.tan(K(r)), Math.tan(K(n))), l = this.strokeProjectionMagnitude, u = c ? l / a / Math.sqrt(1 / a ** 2 + 1 / o ** 2 * h.y ** 2) : l / Math.sqrt(1 + h.y ** 2), d = new T(Math.sqrt(Math.max(l ** 2 - u ** 2, 0)), u), f = c ? l / Math.sqrt(1 + h.x ** 2 * (1 / a) ** 2 / (1 / o + 1 / o * h.x * h.y) ** 2) : l / Math.sqrt(1 + h.x ** 2 / (1 + h.x * h.y) ** 2), g = new T(f, Math.sqrt(Math.max(l ** 2 - f ** 2, 0)));
2429
2429
  return [g, g.scalarMultiply(-1), d, d.scalarMultiply(-1)].map((p) => this.applySkew(c ? p.multiply(this.strokeUniformScalar) : p)).forEach((p) => {
2430
2430
  Ki(p, t, e) && s.push(this.applySkew(this.A).add(p));
2431
2431
  }), s;
@@ -2642,10 +2642,10 @@ function Du(i, t, e, s) {
2642
2642
  if (i !== rt && i !== vt || t !== mt) {
2643
2643
  if (i === "strokeUniform") return t === "non-scaling-stroke";
2644
2644
  if (i === "strokeDashArray") o = t === mt ? null : t.replace(/,/g, " ").split(/\s+/).map(parseFloat);
2645
- else if (i === "transformMatrix") o = e && e.transformMatrix ? K(e.transformMatrix, en(t)) : en(t);
2645
+ else if (i === "transformMatrix") o = e && e.transformMatrix ? J(e.transformMatrix, en(t)) : en(t);
2646
2646
  else if (i === "visible") o = t !== mt && t !== "hidden", e && e.visible === !1 && (o = !1);
2647
2647
  else if (i === "opacity") o = parseFloat(t), e && e.opacity !== void 0 && (o *= e.opacity);
2648
- else if (i === "textAnchor") o = t === "start" ? B : t === "end" ? Z : j;
2648
+ else if (i === "textAnchor") o = t === "start" ? B : t === "end" ? Q : j;
2649
2649
  else if (i === "charSpacing" || i === We) n = Re(t, s) / s * 1e3;
2650
2650
  else if (i === "paintFirst") {
2651
2651
  const a = t.indexOf(rt), c = t.indexOf(vt);
@@ -2942,7 +2942,7 @@ class zt extends La(ht) {
2942
2942
  t.group && t.group.remove(t), t._set("parent", this), this._enterGroup(t, e);
2943
2943
  }
2944
2944
  _enterGroup(t, e) {
2945
- e && gs(t, K(bt(this.calcTransformMatrix()), t.calcTransformMatrix())), this._shouldSetNestedCoords() && t.setCoords(), t._set("group", this), t._set("canvas", this.canvas), this._watchObject(!0, t);
2945
+ e && gs(t, J(bt(this.calcTransformMatrix()), t.calcTransformMatrix())), this._shouldSetNestedCoords() && t.setCoords(), t._set("group", this), t._set("canvas", this.canvas), this._watchObject(!0, t);
2946
2946
  const s = this.canvas && this.canvas.getActiveObject && this.canvas.getActiveObject();
2947
2947
  s && (s === t || t.isDescendantOf(s)) && this._activeObjects.push(t);
2948
2948
  }
@@ -2950,7 +2950,7 @@ class zt extends La(ht) {
2950
2950
  this._exitGroup(t, e), t._set("parent", void 0), t._set("canvas", void 0);
2951
2951
  }
2952
2952
  _exitGroup(t, e) {
2953
- t._set("group", void 0), e || (gs(t, K(this.calcTransformMatrix(), t.calcTransformMatrix())), t.setCoords()), this._watchObject(!1, t);
2953
+ t._set("group", void 0), e || (gs(t, J(this.calcTransformMatrix(), t.calcTransformMatrix())), t.setCoords()), this._watchObject(!1, t);
2954
2954
  const s = this._activeObjects.length > 0 ? this._activeObjects.indexOf(t) : -1;
2955
2955
  s > -1 && this._activeObjects.splice(s, 1);
2956
2956
  }
@@ -3063,8 +3063,8 @@ function nn(i, t, e, s, r, n, o, a) {
3063
3063
  if (L.cachesBoundsOfCurve && (c = [...arguments].join(), js.boundsOfCurveCache[c])) return js.boundsOfCurveCache[c];
3064
3064
  const h = Math.sqrt, l = Math.abs, u = [], d = [[0, 0], [0, 0]];
3065
3065
  let f = 6 * i - 12 * e + 6 * r, g = -3 * i + 9 * e - 9 * r + 3 * o, p = 3 * e - 3 * i;
3066
- for (let S = 0; S < 2; ++S) {
3067
- if (S > 0 && (f = 6 * t - 12 * s + 6 * n, g = -3 * t + 9 * s - 9 * n + 3 * a, p = 3 * s - 3 * t), l(g) < 1e-12) {
3066
+ for (let x = 0; x < 2; ++x) {
3067
+ if (x > 0 && (f = 6 * t - 12 * s + 6 * n, g = -3 * t + 9 * s - 9 * n + 3 * a, p = 3 * s - 3 * t), l(g) < 1e-12) {
3068
3068
  if (l(f) < 1e-12) continue;
3069
3069
  const I = -p / f;
3070
3070
  0 < I && I < 1 && u.push(I);
@@ -3080,18 +3080,18 @@ function nn(i, t, e, s, r, n, o, a) {
3080
3080
  let m = u.length;
3081
3081
  const b = m, _ = Bc(i, t, e, s, r, n, o, a);
3082
3082
  for (; m--; ) {
3083
- const { x: S, y: C } = _(u[m]);
3084
- d[0][m] = S, d[1][m] = C;
3083
+ const { x, y: C } = _(u[m]);
3084
+ d[0][m] = x, d[1][m] = C;
3085
3085
  }
3086
3086
  d[0][b] = i, d[1][b] = t, d[0][b + 1] = o, d[1][b + 1] = a;
3087
- const w = [new T(Math.min(...d[0]), Math.min(...d[1])), new T(Math.max(...d[0]), Math.max(...d[1]))];
3088
- return L.cachesBoundsOfCurve && (js.boundsOfCurveCache[c] = w), w;
3087
+ const S = [new T(Math.min(...d[0]), Math.min(...d[1])), new T(Math.max(...d[0]), Math.max(...d[1]))];
3088
+ return L.cachesBoundsOfCurve && (js.boundsOfCurveCache[c] = S), S;
3089
3089
  }
3090
3090
  const Hu = (i, t, e) => {
3091
3091
  let [s, r, n, o, a, c, h, l] = e;
3092
3092
  const u = ((d, f, g, p, m, b, _) => {
3093
3093
  if (g === 0 || p === 0) return [];
3094
- let w = 0, S = 0, C = 0;
3094
+ let S = 0, x = 0, C = 0;
3095
3095
  const O = Math.PI, D = _ * Tn, M = Lt(D), I = At(D), R = 0.5 * (-I * d - M * f), z = 0.5 * (-I * f + M * d), E = g ** 2, W = p ** 2, F = z ** 2, at = R ** 2, nt = E * W - E * F - W * at;
3096
3096
  let ct = Math.abs(g), Y = Math.abs(p);
3097
3097
  if (nt < 0) {
@@ -3103,7 +3103,7 @@ const Hu = (i, t, e) => {
3103
3103
  b === 0 && ge > 0 ? ge -= 2 * O : b === 1 && ge < 0 && (ge += 2 * O);
3104
3104
  const cr = Math.ceil(Math.abs(ge / O * 2)), Me = [], Ss = ge / cr, Ml = 8 / 3 * Math.sin(Ss / 4) * Math.sin(Ss / 4) / Math.sin(Ss / 2);
3105
3105
  let Ci = xs + Ss;
3106
- for (let pe = 0; pe < cr; pe++) Me[pe] = zu(xs, Ci, I, M, ct, Y, ar, wi, Ml, w, S), w = Me[pe][5], S = Me[pe][6], xs = Ci, Ci += Ss;
3106
+ for (let pe = 0; pe < cr; pe++) Me[pe] = zu(xs, Ci, I, M, ct, Y, ar, wi, Ml, S, x), S = Me[pe][5], x = Me[pe][6], xs = Ci, Ci += Ss;
3107
3107
  return Me;
3108
3108
  })(h - i, l - t, r, n, a, c, o);
3109
3109
  for (let d = 0, f = u.length; d < f; d++) u[d][1] += i, u[d][2] += t, u[d][3] += i, u[d][4] += t, u[d][5] += i, u[d][6] += t;
@@ -3300,7 +3300,7 @@ var Vn = Object.freeze({ __proto__: null, addTransformToObject: $a, animate: Fn,
3300
3300
  var t;
3301
3301
  const e = Tt(i);
3302
3302
  return (t = e.getContext("2d")) === null || t === void 0 || t.drawImage(i, 0, 0), e;
3303
- }, cos: At, createCanvasElement: Yt, createImage: Ba, createRotateMatrix: Ye, createScaleMatrix: ai, createSkewXMatrix: Mn, createSkewYMatrix: Dn, createTranslateMatrix: bs, createVector: Ur, crossProduct: cs, degreesToRadians: q, dotProduct: cc, ease: ql, enlivenObjectEnlivables: Zs, enlivenObjects: ds, findScaleToCover: Rc, findScaleToFit: Lc, getBoundsOfCurve: nn, getOrthonormalVector: Ln, getPathSegmentsInfo: Yn, getPointOnPath: Hc, getPointer: Ua, getRandomInt: Ju, getRegularPolygonPath: (i, t) => {
3303
+ }, cos: At, createCanvasElement: Yt, createImage: Ba, createRotateMatrix: Ye, createScaleMatrix: ai, createSkewXMatrix: Mn, createSkewYMatrix: Dn, createTranslateMatrix: bs, createVector: Ur, crossProduct: cs, degreesToRadians: K, dotProduct: cc, ease: ql, enlivenObjectEnlivables: Zs, enlivenObjects: ds, findScaleToCover: Rc, findScaleToFit: Lc, getBoundsOfCurve: nn, getOrthonormalVector: Ln, getPathSegmentsInfo: Yn, getPointOnPath: Hc, getPointer: Ua, getRandomInt: Ju, getRegularPolygonPath: (i, t) => {
3304
3304
  const e = 2 * Math.PI / i;
3305
3305
  let s = -Te;
3306
3306
  i % 2 == 0 && (s += e / 2);
@@ -3327,10 +3327,10 @@ var Vn = Object.freeze({ __proto__: null, addTransformToObject: $a, animate: Fn,
3327
3327
  s.inverted && !r.inverted && (s = t, r = i), qi(r, (e = r.group) === null || e === void 0 ? void 0 : e.calcTransformMatrix(), s.calcTransformMatrix());
3328
3328
  const n = s.inverted && r.inverted;
3329
3329
  return n && (s.inverted = r.inverted = !1), new zt([s], { clipPath: r, inverted: n });
3330
- }, multiplyTransformMatrices: K, multiplyTransformMatrixArray: oi, parsePath: Yc, parsePreserveAspectRatioAttribute: tc, parseUnit: Re, pick: Ve, projectStrokeOnPoints: Mc, qrDecompose: us, radiansToDegrees: Vt, removeFromArray: De, removeTransformFromObject: (i, t) => {
3331
- const e = bt(t), s = K(e, i.calcOwnMatrix());
3330
+ }, multiplyTransformMatrices: J, multiplyTransformMatrixArray: oi, parsePath: Yc, parsePreserveAspectRatioAttribute: tc, parseUnit: Re, pick: Ve, projectStrokeOnPoints: Mc, qrDecompose: us, radiansToDegrees: Vt, removeFromArray: De, removeTransformFromObject: (i, t) => {
3331
+ const e = bt(t), s = J(e, i.calcOwnMatrix());
3332
3332
  gs(i, s);
3333
- }, removeTransformMatrixForSvgParsing: Qu, request: Zu, requestAnimFrame: Es, resetObjectTransform: qa, rotatePoint: (i, t, e) => i.rotate(e, t), rotateVector: An, saveObjectTransform: jn, sendObjectToPlane: qi, sendPointToPlane: oe, sendVectorToPlane: Ka, setStyle: Qr, sin: Lt, sizeAfterTransform: ci, string: fu, stylesFromArray: jc, stylesToArray: Ic, toBlob: kn, toDataURL: On, toFixed: H, transformPath: (i, t, e) => (e && (t = K(t, [1, 0, 0, 1, -e.x, -e.y])), i.map((s) => {
3333
+ }, removeTransformMatrixForSvgParsing: Qu, request: Zu, requestAnimFrame: Es, resetObjectTransform: qa, rotatePoint: (i, t, e) => i.rotate(e, t), rotateVector: An, saveObjectTransform: jn, sendObjectToPlane: qi, sendPointToPlane: oe, sendVectorToPlane: Ka, setStyle: Qr, sin: Lt, sizeAfterTransform: ci, string: fu, stylesFromArray: jc, stylesToArray: Ic, toBlob: kn, toDataURL: On, toFixed: H, transformPath: (i, t, e) => (e && (t = J(t, [1, 0, 0, 1, -e.x, -e.y])), i.map((s) => {
3334
3334
  const r = [...s];
3335
3335
  for (let n = 1; n < s.length - 1; n += 2) {
3336
3336
  const { x: o, y: a } = lt({ x: s[n], y: s[n + 1] }, t);
@@ -3447,7 +3447,7 @@ class mi extends Qs {
3447
3447
  }
3448
3448
  _getOriginFromCorner(t, e) {
3449
3449
  const s = { x: t.originX, y: t.originY };
3450
- return e && (["ml", "tl", "bl"].includes(e) ? s.x = Z : ["mr", "tr", "br"].includes(e) && (s.x = B), ["tl", "mt", "tr"].includes(e) ? s.y = Ui : ["bl", "mb", "br"].includes(e) && (s.y = pt)), s;
3450
+ return e && (["ml", "tl", "bl"].includes(e) ? s.x = Q : ["mr", "tr", "br"].includes(e) && (s.x = B), ["tl", "mt", "tr"].includes(e) ? s.y = Ui : ["bl", "mb", "br"].includes(e) && (s.y = pt)), s;
3451
3451
  }
3452
3452
  _setupCurrentTransform(t, e, s) {
3453
3453
  var r;
@@ -3455,7 +3455,7 @@ class mi extends Qs {
3455
3455
  if (!g || !f) return "drag";
3456
3456
  const b = m.controls[g];
3457
3457
  return b.getActionName(p, b, m);
3458
- })(s, o, t, e), l = t[this.centeredKey], u = this._shouldCenterTransform(e, h, l) ? { x: j, y: j } : this._getOriginFromCorner(e, o), d = { target: e, action: h, actionHandler: c, actionPerformed: !1, corner: o, scaleX: e.scaleX, scaleY: e.scaleY, skewX: e.skewX, skewY: e.skewY, offsetX: n.x - e.left, offsetY: n.y - e.top, originX: u.x, originY: u.y, ex: n.x, ey: n.y, lastX: n.x, lastY: n.y, theta: q(e.angle), width: e.width, height: e.height, shiftKey: t.shiftKey, altKey: l, original: v(v({}, jn(e)), {}, { originX: u.x, originY: u.y }) };
3458
+ })(s, o, t, e), l = t[this.centeredKey], u = this._shouldCenterTransform(e, h, l) ? { x: j, y: j } : this._getOriginFromCorner(e, o), d = { target: e, action: h, actionHandler: c, actionPerformed: !1, corner: o, scaleX: e.scaleX, scaleY: e.scaleY, skewX: e.skewX, skewY: e.skewY, offsetX: n.x - e.left, offsetY: n.y - e.top, originX: u.x, originY: u.y, ex: n.x, ey: n.y, lastX: n.x, lastY: n.y, theta: K(e.angle), width: e.width, height: e.height, shiftKey: t.shiftKey, altKey: l, original: v(v({}, jn(e)), {}, { originX: u.x, originY: u.y }) };
3459
3459
  this._currentTransform = d, this.fire("before:transform", { e: t, transform: d });
3460
3460
  }
3461
3461
  setCursor(t) {
@@ -3530,7 +3530,7 @@ class mi extends Qs {
3530
3530
  let e = arguments.length > 1 && arguments[1] !== void 0 && arguments[1];
3531
3531
  const s = this.upperCanvasEl, r = s.getBoundingClientRect();
3532
3532
  let n = Ua(t), o = r.width || 0, a = r.height || 0;
3533
- o && a || (pt in r && Ui in r && (a = Math.abs(r.top - r.bottom)), Z in r && B in r && (o = Math.abs(r.right - r.left))), this.calcOffset(), n.x = n.x - this._offset.left, n.y = n.y - this._offset.top, e || (n = oe(n, void 0, this.viewportTransform));
3533
+ o && a || (pt in r && Ui in r && (a = Math.abs(r.top - r.bottom)), Q in r && B in r && (o = Math.abs(r.right - r.left))), this.calcOffset(), n.x = n.x - this._offset.left, n.y = n.y - this._offset.top, e || (n = oe(n, void 0, this.viewportTransform));
3534
3534
  const c = this.getRetinaScaling();
3535
3535
  c !== 1 && (n.x /= c, n.y /= c);
3536
3536
  const h = o === 0 || a === 0 ? new T(1, 1) : new T(s.width / o, s.height / a);
@@ -4081,14 +4081,14 @@ class lr {
4081
4081
  } else if (this.type === "radial") {
4082
4082
  const { x1: u, y1: d, x2: f, y2: g, r1: p, r2: m } = this.coords, b = p > m;
4083
4083
  s.push("<radialGradient ", l, ' cx="', b ? u : f, '" cy="', b ? d : g, '" r="', b ? p : m, '" fx="', b ? f : u, '" fy="', b ? g : d, `">
4084
- `), b && (o.reverse(), o.forEach((w) => {
4085
- w.offset = 1 - w.offset;
4084
+ `), b && (o.reverse(), o.forEach((S) => {
4085
+ S.offset = 1 - S.offset;
4086
4086
  }));
4087
4087
  const _ = Math.min(p, m);
4088
4088
  if (_ > 0) {
4089
- const w = _ / Math.max(p, m);
4090
- o.forEach((S) => {
4091
- S.offset += w * (1 - S.offset);
4089
+ const S = _ / Math.max(p, m);
4090
+ o.forEach((x) => {
4091
+ x.offset += S * (1 - x.offset);
4092
4092
  });
4093
4093
  }
4094
4094
  }
@@ -4278,7 +4278,7 @@ class te extends ht {
4278
4278
  return super._set(t, e), t === "radius" && this.setRadius(e), this;
4279
4279
  }
4280
4280
  _render(t) {
4281
- t.beginPath(), t.arc(0, 0, this.radius, q(this.startAngle), q(this.endAngle), this.counterClockwise), this._renderPaintInOrder(t);
4281
+ t.beginPath(), t.arc(0, 0, this.radius, K(this.startAngle), K(this.endAngle), this.counterClockwise), this._renderPaintInOrder(t);
4282
4282
  }
4283
4283
  getRadiusX() {
4284
4284
  return this.get("radius") * this.get(gt);
@@ -4298,7 +4298,7 @@ class te extends ht {
4298
4298
  if (t === 0) return ["<circle ", "COMMON_PARTS", 'cx="0" cy="0" ', 'r="', "".concat(this.radius), `" />
4299
4299
  `];
4300
4300
  {
4301
- const { radius: e } = this, s = q(this.startAngle), r = q(this.endAngle), n = At(s) * e, o = Lt(s) * e, a = At(r) * e, c = Lt(r) * e, h = t > 180 ? 1 : 0, l = this.counterClockwise ? 0 : 1;
4301
+ const { radius: e } = this, s = K(this.startAngle), r = K(this.endAngle), n = At(s) * e, o = Lt(s) * e, a = At(r) * e, c = Lt(r) * e, h = t > 180 ? 1 : 0, l = this.counterClockwise ? 0 : 1;
4302
4302
  return ['<path d="M '.concat(n, " ").concat(o, " A ").concat(e, " ").concat(e, " 0 ").concat(h, " ").concat(l, " ").concat(a, " ").concat(c, '" '), "COMMON_PARTS", ` />
4303
4303
  `];
4304
4304
  }
@@ -4454,7 +4454,7 @@ class Mt extends ht {
4454
4454
  if (e.length === 0) return { left: 0, top: 0, width: 0, height: 0, pathOffset: new T(), strokeOffset: new T(), strokeDiff: new T() };
4455
4455
  const s = Xt(e), r = Js(v(v({}, t), {}, { scaleX: 1, scaleY: 1 })), n = Xt(this.points.map((h) => lt(h, r, !0))), o = new T(this.scaleX, this.scaleY);
4456
4456
  let a = s.left + s.width / 2, c = s.top + s.height / 2;
4457
- return this.exactBoundingBox && (a -= c * Math.tan(q(this.skewX)), c -= a * Math.tan(q(this.skewY))), v(v({}, s), {}, { pathOffset: new T(a, c), strokeOffset: new T(n.left, n.top).subtract(new T(s.left, s.top)).multiply(o), strokeDiff: new T(s.width, s.height).subtract(new T(n.width, n.height)).multiply(o) });
4457
+ return this.exactBoundingBox && (a -= c * Math.tan(K(this.skewX)), c -= a * Math.tan(K(this.skewY))), v(v({}, s), {}, { pathOffset: new T(a, c), strokeOffset: new T(n.left, n.top).subtract(new T(s.left, s.top)).multiply(o), strokeDiff: new T(s.width, s.height).subtract(new T(n.width, n.height)).multiply(o) });
4458
4458
  }
4459
4459
  _findCenterFromElement() {
4460
4460
  const t = Xt(this.points);
@@ -4745,7 +4745,7 @@ class ut extends Qc {
4745
4745
  }
4746
4746
  _measureLine(t) {
4747
4747
  let e, s, r = 0;
4748
- const n = this.pathSide === Z, o = this.path, a = this._textLines[t], c = a.length, h = new Array(c);
4748
+ const n = this.pathSide === Q, o = this.path, a = this._textLines[t], c = a.length, h = new Array(c);
4749
4749
  this.__charBounds[t] = h;
4750
4750
  for (let l = 0; l < c; l++) {
4751
4751
  const u = a[l];
@@ -4761,7 +4761,7 @@ class ut extends Qc {
4761
4761
  case j:
4762
4762
  l = (u - r) / 2;
4763
4763
  break;
4764
- case Z:
4764
+ case Q:
4765
4765
  l = n ? 0 : u - r;
4766
4766
  }
4767
4767
  l += this.pathStartOffset * (n ? -1 : 1);
@@ -4771,7 +4771,7 @@ class ut extends Qc {
4771
4771
  }
4772
4772
  _setGraphemeOnPath(t, e) {
4773
4773
  const s = t + e.kernedWidth / 2, r = this.path, n = Hc(r.path, s, r.segmentsInfo);
4774
- e.renderLeft = n.x - r.pathOffset.x, e.renderTop = n.y - r.pathOffset.y, e.angle = n.angle + (this.pathSide === Z ? Math.PI : 0);
4774
+ e.renderLeft = n.x - r.pathOffset.x, e.renderTop = n.y - r.pathOffset.y, e.angle = n.angle + (this.pathSide === Q ? Math.PI : 0);
4775
4775
  }
4776
4776
  _getGraphemeBox(t, e, s, r, n) {
4777
4777
  const o = this.getCompleteStyleDeclaration(e, s), a = r ? this.getCompleteStyleDeclaration(e, s - 1) : {}, c = this._measureChar(t, o, r, a);
@@ -4820,9 +4820,9 @@ class ut extends Qc {
4820
4820
  }
4821
4821
  _renderChars(t, e, s, r, n, o) {
4822
4822
  const a = this.textAlign.includes(Bt), c = this.path, h = !a && this.charSpacing === 0 && this.isEmptyStyles(o) && !c, l = this.direction === "ltr", u = this.direction === "ltr" ? 1 : -1, d = e.direction;
4823
- let f, g, p, m, b, _ = "", w = 0;
4824
- if (e.save(), d !== this.direction && (e.canvas.setAttribute("dir", l ? "ltr" : "rtl"), e.direction = l ? "ltr" : "rtl", e.textAlign = l ? B : Z), n -= this.getHeightOfLineImpl(o) * this._fontSizeFraction, h) return this._renderChar(t, e, o, 0, s.join(""), r, n), void e.restore();
4825
- for (let S = 0, C = s.length - 1; S <= C; S++) m = S === C || this.charSpacing || c, _ += s[S], p = this.__charBounds[o][S], w === 0 ? (r += u * (p.kernedWidth - p.width), w += p.width) : w += p.kernedWidth, a && !m && this._reSpaceAndTab.test(s[S]) && (m = !0), m || (f = f || this.getCompleteStyleDeclaration(o, S), g = this.getCompleteStyleDeclaration(o, S + 1), m = gi(f, g, !1)), m && (c ? (e.save(), e.translate(p.renderLeft, p.renderTop), e.rotate(p.angle), this._renderChar(t, e, o, S, _, -w / 2, 0), e.restore()) : (b = r, this._renderChar(t, e, o, S, _, b, n)), _ = "", f = g, r += u * w, w = 0);
4823
+ let f, g, p, m, b, _ = "", S = 0;
4824
+ if (e.save(), d !== this.direction && (e.canvas.setAttribute("dir", l ? "ltr" : "rtl"), e.direction = l ? "ltr" : "rtl", e.textAlign = l ? B : Q), n -= this.getHeightOfLineImpl(o) * this._fontSizeFraction, h) return this._renderChar(t, e, o, 0, s.join(""), r, n), void e.restore();
4825
+ for (let x = 0, C = s.length - 1; x <= C; x++) m = x === C || this.charSpacing || c, _ += s[x], p = this.__charBounds[o][x], S === 0 ? (r += u * (p.kernedWidth - p.width), S += p.width) : S += p.kernedWidth, a && !m && this._reSpaceAndTab.test(s[x]) && (m = !0), m || (f = f || this.getCompleteStyleDeclaration(o, x), g = this.getCompleteStyleDeclaration(o, x + 1), m = gi(f, g, !1)), m && (c ? (e.save(), e.translate(p.renderLeft, p.renderTop), e.rotate(p.angle), this._renderChar(t, e, o, x, _, -S / 2, 0), e.restore()) : (b = r, this._renderChar(t, e, o, x, _, b, n)), _ = "", f = g, r += u * S, S = 0);
4826
4826
  e.restore();
4827
4827
  }
4828
4828
  _applyPatternGradientTransformText(t) {
@@ -4868,7 +4868,7 @@ class ut extends Qc {
4868
4868
  _getLineLeftOffset(t) {
4869
4869
  const e = this.getLineWidth(t), s = this.width - e, r = this.textAlign, n = this.direction, o = this.isEndOfWrapping(t);
4870
4870
  let a = 0;
4871
- return r === Bt || r === Ls && !o || r === As && !o || r === Nr && !o ? 0 : (r === j && (a = s / 2), r === Z && (a = s), r === Ls && (a = s / 2), r === As && (a = s), n === "rtl" && (r === Z || r === Bt || r === As ? a = 0 : r === B || r === Nr ? a = -s : r !== j && r !== Ls || (a = -s / 2)), a);
4871
+ return r === Bt || r === Ls && !o || r === As && !o || r === Nr && !o ? 0 : (r === j && (a = s / 2), r === Q && (a = s), r === Ls && (a = s / 2), r === As && (a = s), n === "rtl" && (r === Q || r === Bt || r === As ? a = 0 : r === B || r === Nr ? a = -s : r !== j && r !== Ls || (a = -s / 2)), a);
4872
4872
  }
4873
4873
  _clearCache() {
4874
4874
  this._forceClearCache = !1, this.__lineWidths = [], this.__lineHeights = [], this.__charBounds = [];
@@ -4896,26 +4896,26 @@ class ut extends Qc {
4896
4896
  continue;
4897
4897
  }
4898
4898
  const d = this._textLines[h], f = u / this.lineHeight, g = this._getLineLeftOffset(h);
4899
- let p = 0, m = 0, b = this.getValueOfPropertyAt(h, 0, e), _ = this.getValueOfPropertyAt(h, 0, rt), w = this.getValueOfPropertyAt(h, 0, We), S = b, C = _, O = w;
4899
+ let p = 0, m = 0, b = this.getValueOfPropertyAt(h, 0, e), _ = this.getValueOfPropertyAt(h, 0, rt), S = this.getValueOfPropertyAt(h, 0, We), x = b, C = _, O = S;
4900
4900
  const D = s + f * (1 - this._fontSizeFraction);
4901
4901
  let M = this.getHeightOfChar(h, 0), I = this.getValueOfPropertyAt(h, 0, "deltaY");
4902
4902
  for (let E = 0, W = d.length; E < W; E++) {
4903
4903
  const F = this.__charBounds[h][E];
4904
- S = this.getValueOfPropertyAt(h, E, e), C = this.getValueOfPropertyAt(h, E, rt), O = this.getValueOfPropertyAt(h, E, We);
4904
+ x = this.getValueOfPropertyAt(h, E, e), C = this.getValueOfPropertyAt(h, E, rt), O = this.getValueOfPropertyAt(h, E, We);
4905
4905
  const at = this.getHeightOfChar(h, E), nt = this.getValueOfPropertyAt(h, E, "deltaY");
4906
- if (n && S && C) {
4906
+ if (n && x && C) {
4907
4907
  const ct = this.fontSize * O / 1e3;
4908
4908
  t.save(), t.fillStyle = _, t.translate(F.renderLeft, F.renderTop), t.rotate(F.angle), t.fillRect(-F.kernedWidth / 2, c * at + nt - a * ct, F.kernedWidth, ct), t.restore();
4909
- } else if ((S !== b || C !== _ || at !== M || O !== w || nt !== I) && m > 0) {
4910
- const ct = this.fontSize * w / 1e3;
4909
+ } else if ((x !== b || C !== _ || at !== M || O !== S || nt !== I) && m > 0) {
4910
+ const ct = this.fontSize * S / 1e3;
4911
4911
  let Y = r + g + p;
4912
- this.direction === "rtl" && (Y = this.width - Y - m), b && _ && w && (t.fillStyle = _, t.fillRect(Y, D + c * M + I - a * ct, m, ct)), p = F.left, m = F.width, b = S, w = O, _ = C, M = at, I = nt;
4912
+ this.direction === "rtl" && (Y = this.width - Y - m), b && _ && S && (t.fillStyle = _, t.fillRect(Y, D + c * M + I - a * ct, m, ct)), p = F.left, m = F.width, b = x, S = O, _ = C, M = at, I = nt;
4913
4913
  } else m += F.kernedWidth;
4914
4914
  }
4915
4915
  let R = r + g + p;
4916
4916
  this.direction === "rtl" && (R = this.width - R - m), t.fillStyle = C;
4917
4917
  const z = this.fontSize * O / 1e3;
4918
- S && C && O && t.fillRect(R, D + c * M + I - a * z, m - o, z), s += u;
4918
+ x && C && O && t.fillRect(R, D + c * M + I - a * z, m - o, z), s += u;
4919
4919
  }
4920
4920
  this._removeShadow(t);
4921
4921
  }
@@ -4954,8 +4954,8 @@ class ut extends Qc {
4954
4954
  }
4955
4955
  static async fromElement(t, e, s) {
4956
4956
  const r = ue(t, ut.ATTRIBUTE_NAMES, s), n = v(v({}, e), r), { textAnchor: o = B, textDecoration: a = "", dx: c = 0, dy: h = 0, top: l = 0, left: u = 0, fontSize: d = xn, strokeWidth: f = 1 } = n, g = N(n, _d), p = new this(Gr(t.textContent || "").trim(), v({ left: u + c, top: l + h, underline: a.includes("underline"), overline: a.includes("overline"), linethrough: a.includes("line-through"), strokeWidth: 0, fontSize: d }, g)), m = p.getScaledHeight() / p.height, b = ((p.height + p.strokeWidth) * p.lineHeight - p.height) * m, _ = p.getScaledHeight() + b;
4957
- let w = 0;
4958
- return o === j && (w = p.getScaledWidth() / 2), o === Z && (w = p.getScaledWidth()), p.set({ left: p.left - w, top: p.top - (_ - p.fontSize * (0.07 + p._fontSizeFraction)) / p.lineHeight, strokeWidth: f }), p;
4957
+ let S = 0;
4958
+ return o === j && (S = p.getScaledWidth() / 2), o === Q && (S = p.getScaledWidth()), p.set({ left: p.left - S, top: p.top - (_ - p.fontSize * (0.07 + p._fontSizeFraction)) / p.lineHeight, strokeWidth: f }), p;
4959
4959
  }
4960
4960
  static fromObject(t) {
4961
4961
  return this._fromObject(v(v({}, t), {}, { styles: jc(t.styles || {}, t.text) }), { extraParam: "text" });
@@ -5061,12 +5061,12 @@ class Td {
5061
5061
  let { selectionStart: r, selectionEnd: n } = e;
5062
5062
  const o = this.target, a = o.canvas, c = new T(o.flipX ? -1 : 1, o.flipY ? -1 : 1), h = o._getCursorBoundaries(r), l = new T(h.left + h.leftOffset, h.top + h.topOffset).multiply(c).transform(o.calcTransformMatrix()), u = a.getScenePoint(t).subtract(l), d = o.getCanvasRetinaScaling(), f = o.getBoundingRect(), g = l.subtract(new T(f.left, f.top)), p = a.viewportTransform, m = g.add(u).transform(p, !0), b = o.backgroundColor, _ = Xn(o.styles);
5063
5063
  o.backgroundColor = "";
5064
- const w = { stroke: "transparent", fill: "transparent", textBackgroundColor: "transparent" };
5065
- o.setSelectionStyles(w, 0, r), o.setSelectionStyles(w, n, o.text.length), o.dirty = !0;
5066
- const S = o.toCanvasElement({ enableRetinaScaling: a.enableRetinaScaling, viewportTransform: !0 });
5067
- o.backgroundColor = b, o.styles = _, o.dirty = !0, Qr(S, { position: "fixed", left: "".concat(-S.width, "px"), border: mt, width: "".concat(S.width / d, "px"), height: "".concat(S.height / d, "px") }), this.__dragImageDisposer && this.__dragImageDisposer(), this.__dragImageDisposer = () => {
5068
- S.remove();
5069
- }, It(t.target || this.target.hiddenTextarea).body.appendChild(S), (s = t.dataTransfer) === null || s === void 0 || s.setDragImage(S, m.x, m.y);
5064
+ const S = { stroke: "transparent", fill: "transparent", textBackgroundColor: "transparent" };
5065
+ o.setSelectionStyles(S, 0, r), o.setSelectionStyles(S, n, o.text.length), o.dirty = !0;
5066
+ const x = o.toCanvasElement({ enableRetinaScaling: a.enableRetinaScaling, viewportTransform: !0 });
5067
+ o.backgroundColor = b, o.styles = _, o.dirty = !0, Qr(x, { position: "fixed", left: "".concat(-x.width, "px"), border: mt, width: "".concat(x.width / d, "px"), height: "".concat(x.height / d, "px") }), this.__dragImageDisposer && this.__dragImageDisposer(), this.__dragImageDisposer = () => {
5068
+ x.remove();
5069
+ }, It(t.target || this.target.hiddenTextarea).body.appendChild(x), (s = t.dataTransfer) === null || s === void 0 || s.setDragImage(x, m.x, m.y);
5070
5070
  }
5071
5071
  onDragStart(t) {
5072
5072
  this.__dragStartFired = !0;
@@ -5364,7 +5364,7 @@ class xd extends ut {
5364
5364
  this.insertNewStyleBlock(n, s, e), this._text = [...this._text.slice(0, s), ...n, ...this._text.slice(r)], this.text = this._text.join(""), this.set("dirty", !0), this.initDimensions(), this.setCoords(), this._removeExtraneousStyles();
5365
5365
  }
5366
5366
  setSelectionStartEndWithShift(t, e, s) {
5367
- s <= t ? (e === t ? this._selectionDirection = B : this._selectionDirection === Z && (this._selectionDirection = B, this.selectionEnd = t), this.selectionStart = s) : s > t && s < e ? this._selectionDirection === Z ? this.selectionEnd = s : this.selectionStart = s : (e === t ? this._selectionDirection = Z : this._selectionDirection === B && (this._selectionDirection = Z, this.selectionStart = e), this.selectionEnd = s);
5367
+ s <= t ? (e === t ? this._selectionDirection = B : this._selectionDirection === Q && (this._selectionDirection = B, this.selectionEnd = t), this.selectionStart = s) : s > t && s < e ? this._selectionDirection === Q ? this.selectionEnd = s : this.selectionStart = s : (e === t ? this._selectionDirection = Q : this._selectionDirection === B && (this._selectionDirection = Q, this.selectionStart = e), this.selectionEnd = s);
5368
5368
  }
5369
5369
  }
5370
5370
  class Sd extends xd {
@@ -5405,12 +5405,12 @@ class Sd extends xd {
5405
5405
  if (this.hiddenTextarea.value === "") return this.styles = {}, void o();
5406
5406
  const a = this._splitTextIntoLines(s).graphemeText, c = this._text.length, h = a.length, l = this.selectionStart, u = this.selectionEnd, d = l !== u;
5407
5407
  let f, g, p, m, b = h - c;
5408
- const _ = this.fromStringToGraphemeSelection(r, n, s), w = l > _.selectionStart;
5409
- d ? (g = this._text.slice(l, u), b += u - l) : h < c && (g = w ? this._text.slice(u + b, u) : this._text.slice(l, l - b));
5410
- const S = a.slice(_.selectionEnd - b, _.selectionEnd);
5411
- if (g && g.length && (S.length && (f = this.getSelectionStyles(l, l + 1, !1), f = S.map(() => f[0])), d ? (p = l, m = u) : w ? (p = u - g.length, m = u) : (p = u, m = u + g.length), this.removeStyleFromTo(p, m)), S.length) {
5408
+ const _ = this.fromStringToGraphemeSelection(r, n, s), S = l > _.selectionStart;
5409
+ d ? (g = this._text.slice(l, u), b += u - l) : h < c && (g = S ? this._text.slice(u + b, u) : this._text.slice(l, l - b));
5410
+ const x = a.slice(_.selectionEnd - b, _.selectionEnd);
5411
+ if (g && g.length && (x.length && (f = this.getSelectionStyles(l, l + 1, !1), f = x.map(() => f[0])), d ? (p = l, m = u) : S ? (p = u - g.length, m = u) : (p = u, m = u + g.length), this.removeStyleFromTo(p, m)), x.length) {
5412
5412
  const { copyPasteData: C } = Ht();
5413
- e && S.join("") === C.copiedText && !L.disableStyleCopyPaste && (f = C.copiedTextStyle), this.insertNewStyleBlock(S, l, f);
5413
+ e && x.join("") === C.copiedText && !L.disableStyleCopyPaste && (f = C.copiedTextStyle), this.insertNewStyleBlock(x, l, f);
5414
5414
  }
5415
5415
  o();
5416
5416
  }
@@ -5470,7 +5470,7 @@ class Sd extends xd {
5470
5470
  this.selectionStart === 0 && this.selectionEnd === 0 || this._moveCursorUpOrDown("Up", t);
5471
5471
  }
5472
5472
  _moveCursorUpOrDown(t, e) {
5473
- const s = this["get".concat(t, "CursorOffset")](e, this._selectionDirection === Z);
5473
+ const s = this["get".concat(t, "CursorOffset")](e, this._selectionDirection === Q);
5474
5474
  if (e.shiftKey ? this.moveCursorWithShift(s) : this.moveCursorWithoutShift(s), s !== 0) {
5475
5475
  const r = this.text.length;
5476
5476
  this.selectionStart = Xe(0, this.selectionStart, r), this.selectionEnd = Xe(0, this.selectionEnd, r), this.abortCursorAnimation(), this.initDelayedCursor(), this._fireSelectionChanged(), this._updateTextarea();
@@ -5506,7 +5506,7 @@ class Sd extends xd {
5506
5506
  return this._selectionDirection = B, this.selectionEnd === this.selectionStart && this.selectionStart !== 0 && (e = this._moveLeft(t, "selectionStart")), this.selectionEnd = this.selectionStart, e;
5507
5507
  }
5508
5508
  moveCursorLeftWithShift(t) {
5509
- return this._selectionDirection === Z && this.selectionStart !== this.selectionEnd ? this._moveLeft(t, "selectionEnd") : this.selectionStart !== 0 ? (this._selectionDirection = B, this._moveLeft(t, "selectionStart")) : void 0;
5509
+ return this._selectionDirection === Q && this.selectionStart !== this.selectionEnd ? this._moveLeft(t, "selectionEnd") : this.selectionStart !== 0 ? (this._selectionDirection = B, this._moveLeft(t, "selectionStart")) : void 0;
5510
5510
  }
5511
5511
  moveCursorRight(t) {
5512
5512
  this.selectionStart >= this._text.length && this.selectionEnd >= this._text.length || this._moveCursorLeftOrRight("Right", t);
@@ -5516,11 +5516,11 @@ class Sd extends xd {
5516
5516
  this._currentCursorOpacity = 1, this[s](e) && (this.abortCursorAnimation(), this.initDelayedCursor(), this._fireSelectionChanged(), this._updateTextarea());
5517
5517
  }
5518
5518
  moveCursorRightWithShift(t) {
5519
- return this._selectionDirection === B && this.selectionStart !== this.selectionEnd ? this._moveRight(t, "selectionStart") : this.selectionEnd !== this._text.length ? (this._selectionDirection = Z, this._moveRight(t, "selectionEnd")) : void 0;
5519
+ return this._selectionDirection === B && this.selectionStart !== this.selectionEnd ? this._moveRight(t, "selectionStart") : this.selectionEnd !== this._text.length ? (this._selectionDirection = Q, this._moveRight(t, "selectionEnd")) : void 0;
5520
5520
  }
5521
5521
  moveCursorRightWithoutShift(t) {
5522
5522
  let e = !0;
5523
- return this._selectionDirection = Z, this.selectionStart === this.selectionEnd ? (e = this._moveRight(t, "selectionStart"), this.selectionEnd = this.selectionStart) : this.selectionStart = this.selectionEnd, e;
5523
+ return this._selectionDirection = Q, this.selectionStart === this.selectionEnd ? (e = this._moveRight(t, "selectionStart"), this.selectionEnd = this.selectionStart) : this.selectionStart = this.selectionEnd, e;
5524
5524
  }
5525
5525
  }
5526
5526
  const Ro = (i) => !!i.button;
@@ -5679,7 +5679,7 @@ class ie extends wd {
5679
5679
  const o = this._getLineLeftOffset(n), a = this.__charBounds[n][r];
5680
5680
  a && (s = a.left), this.charSpacing !== 0 && r === this._textLines[n].length && (s -= this._getWidthOfCharSpacing());
5681
5681
  const c = { top: e, left: o + (s > 0 ? s : 0) };
5682
- return this.direction === "rtl" && (this.textAlign === Z || this.textAlign === Bt || this.textAlign === As ? c.left *= -1 : this.textAlign === B || this.textAlign === Nr ? c.left = o - (s > 0 ? s : 0) : this.textAlign !== j && this.textAlign !== Ls || (c.left = o - (s > 0 ? s : 0))), c;
5682
+ return this.direction === "rtl" && (this.textAlign === Q || this.textAlign === Bt || this.textAlign === As ? c.left *= -1 : this.textAlign === B || this.textAlign === Nr ? c.left = o - (s > 0 ? s : 0) : this.textAlign !== j && this.textAlign !== Ls || (c.left = o - (s > 0 ? s : 0))), c;
5683
5683
  }
5684
5684
  renderCursorAt(t) {
5685
5685
  this._renderCursor(this.canvas.contextTop, this._getCursorBoundaries(t, !0), t);
@@ -5720,9 +5720,9 @@ class ie extends wd {
5720
5720
  _ = this.__charBounds[l][d - 1].left + this.__charBounds[l][d - 1].width - D;
5721
5721
  }
5722
5722
  m = p, (this.lineHeight < 1 || f === l && this.lineHeight > 1) && (p /= this.lineHeight);
5723
- let w = s.left + g + b, S = p, C = 0;
5723
+ let S = s.left + g + b, x = p, C = 0;
5724
5724
  const O = _ - b;
5725
- this.inCompositionMode ? (t.fillStyle = this.compositionColor || "black", S = 1, C = p) : t.fillStyle = this.selectionColor, this.direction === "rtl" && (this.textAlign === Z || this.textAlign === Bt || this.textAlign === As ? w = this.width - w - O : this.textAlign === B || this.textAlign === Nr ? w = s.left + g - _ : this.textAlign !== j && this.textAlign !== Ls || (w = s.left + g - _)), t.fillRect(w, s.top + s.topOffset + C, O, S), s.topOffset += m;
5725
+ this.inCompositionMode ? (t.fillStyle = this.compositionColor || "black", x = 1, C = p) : t.fillStyle = this.selectionColor, this.direction === "rtl" && (this.textAlign === Q || this.textAlign === Bt || this.textAlign === As ? S = this.width - S - O : this.textAlign === B || this.textAlign === Nr ? S = s.left + g - _ : this.textAlign !== j && this.textAlign !== Ls || (S = s.left + g - _)), t.fillRect(S, s.top + s.topOffset + C, O, x), s.topOffset += m;
5726
5726
  }
5727
5727
  }
5728
5728
  getCurrentCharFontSize() {
@@ -5840,8 +5840,8 @@ class Ae extends ie {
5840
5840
  const m = Math.max(e, r, this.dynamicMinWidth), b = n[t];
5841
5841
  let _;
5842
5842
  for (f = 0, _ = 0; _ < b.length; _++) {
5843
- const { word: w, width: S } = b[_];
5844
- f += w.length, u += g + S - a, u > m && !p ? (h.push(d), d = [], u = S, p = !0) : u += a, p || c || d.push(l), d = d.concat(w), g = c ? 0 : this._measureWord([l], t, f), f++, p = !1;
5843
+ const { word: S, width: x } = b[_];
5844
+ f += S.length, u += g + x - a, u > m && !p ? (h.push(d), d = [], u = x, p = !0) : u += a, p || c || d.push(l), d = d.concat(S), g = c ? 0 : this._measureWord([l], t, f), f++, p = !1;
5845
5845
  }
5846
5846
  return _ && h.push(d), r + o > this.dynamicMinWidth && (this.dynamicMinWidth = r - a + o), h;
5847
5847
  }
@@ -6233,7 +6233,7 @@ y(St, "type", "Image"), y(St, "cacheProperties", [...le, ...eh]), y(St, "ownDefa
6233
6233
  li(["pattern", "defs", "symbol", "metadata", "clipPath", "mask", "desc"]);
6234
6234
  const sh = Aa, Xo = (i) => function(t, e, s) {
6235
6235
  const { points: r, pathOffset: n } = s;
6236
- return new T(r[i]).subtract(n).transform(K(s.getViewportTransform(), s.calcTransformMatrix()));
6236
+ return new T(r[i]).subtract(n).transform(J(s.getViewportTransform(), s.calcTransformMatrix()));
6237
6237
  }, rh = (i, t, e, s) => {
6238
6238
  const { target: r, pointIndex: n } = t, o = r, a = oe(new T(e, s), void 0, o.calcOwnMatrix());
6239
6239
  return o.points[n] = a.add(o.pathOffset), o.setDimensions(), o.set("dirty", !0), !0;
@@ -6242,7 +6242,7 @@ const sh = Aa, Xo = (i) => function(t, e, s) {
6242
6242
  return o.left -= l.x, o.top -= l.y, h;
6243
6243
  }, zo = (i) => Oe(sh, ih(i, rh)), cn = (i, t, e) => {
6244
6244
  const { path: s, pathOffset: r } = i, n = s[t];
6245
- return new T(n[e] - r.x, n[e + 1] - r.y).transform(K(i.getViewportTransform(), i.calcTransformMatrix()));
6245
+ return new T(n[e] - r.x, n[e + 1] - r.y).transform(J(i.getViewportTransform(), i.calcTransformMatrix()));
6246
6246
  };
6247
6247
  function Id(i, t, e) {
6248
6248
  const { commandIndex: s, pointIndex: r } = this;
@@ -6252,8 +6252,8 @@ function jd(i, t, e, s) {
6252
6252
  const { target: r } = t, { commandIndex: n, pointIndex: o } = this, a = ((c, h, l, u, d) => {
6253
6253
  const { path: f, pathOffset: g } = c, p = f[(u > 0 ? u : f.length) - 1], m = new T(p[d], p[d + 1]), b = m.subtract(g).transform(c.calcOwnMatrix()), _ = oe(new T(h, l), void 0, c.calcOwnMatrix());
6254
6254
  f[u][d] = _.x + g.x, f[u][d + 1] = _.y + g.y, c.setDimensions();
6255
- const w = m.subtract(c.pathOffset).transform(c.calcOwnMatrix()).subtract(b);
6256
- return c.left -= w.x, c.top -= w.y, c.set("dirty", !0), !0;
6255
+ const S = m.subtract(c.pathOffset).transform(c.calcOwnMatrix()).subtract(b);
6256
+ return c.left -= S.x, c.top -= S.y, c.set("dirty", !0), !0;
6257
6257
  })(r, e, s, n, o);
6258
6258
  return En(this.actionName, v(v({}, Pn(i, t, e, s)), {}, { commandIndex: n, pointIndex: o })), a;
6259
6259
  }
@@ -6638,11 +6638,11 @@ class _r extends it {
6638
6638
  let l = 0, u = 0, d = 0, f = 0, g = 0;
6639
6639
  const p = h - h % c, m = p + c;
6640
6640
  for (let b = -14; b < a; b++) {
6641
- const _ = b / a, w = 4 * Math.floor(n * _), S = 1 - Math.abs(_);
6642
- let C = h + w;
6641
+ const _ = b / a, S = 4 * Math.floor(n * _), x = 1 - Math.abs(_);
6642
+ let C = h + S;
6643
6643
  C < p ? C = p : C > m && (C = m);
6644
- const O = e[C + 3] * S;
6645
- l += e[C] * O, u += e[C + 1] * O, d += e[C + 2] * O, f += O, g += S;
6644
+ const O = e[C + 3] * x;
6645
+ l += e[C] * O, u += e[C + 1] * O, d += e[C + 2] * O, f += O, g += x;
6646
6646
  }
6647
6647
  o[h] = l / f, o[h + 1] = u / f, o[h + 2] = d / f, o[h + 3] = f / g;
6648
6648
  }
@@ -6651,11 +6651,11 @@ class _r extends it {
6651
6651
  let l = 0, u = 0, d = 0, f = 0, g = 0;
6652
6652
  const p = h % c, m = o.length - c + p;
6653
6653
  for (let b = -14; b < a; b++) {
6654
- const _ = b / a, w = Math.floor(n * _) * c, S = 1 - Math.abs(_);
6655
- let C = h + w;
6654
+ const _ = b / a, S = Math.floor(n * _) * c, x = 1 - Math.abs(_);
6655
+ let C = h + S;
6656
6656
  C < p ? C = p : C > m && (C = m);
6657
- const O = o[C + 3] * S;
6658
- l += o[C] * O, u += o[C + 1] * O, d += o[C + 2] * O, f += O, g += S;
6657
+ const O = o[C + 3] * x;
6658
+ l += o[C] * O, u += o[C + 1] * O, d += o[C + 2] * O, f += O, g += x;
6659
6659
  }
6660
6660
  e[h] = l / f, e[h + 1] = u / f, e[h + 2] = d / f, e[h + 3] = f / g;
6661
6661
  }
@@ -6958,9 +6958,9 @@ class Sr extends it {
6958
6958
  }
6959
6959
  applyTo2d(t) {
6960
6960
  const e = t.imageData, s = e.data, r = this.matrix, n = Math.round(Math.sqrt(r.length)), o = Math.floor(n / 2), a = e.width, c = e.height, h = t.ctx.createImageData(a, c), l = h.data, u = this.opaque ? 1 : 0;
6961
- let d, f, g, p, m, b, _, w, S, C, O, D, M;
6961
+ let d, f, g, p, m, b, _, S, x, C, O, D, M;
6962
6962
  for (O = 0; O < c; O++) for (C = 0; C < a; C++) {
6963
- for (m = 4 * (O * a + C), d = 0, f = 0, g = 0, p = 0, M = 0; M < n; M++) for (D = 0; D < n; D++) _ = O + M - o, b = C + D - o, _ < 0 || _ >= c || b < 0 || b >= a || (w = 4 * (_ * a + b), S = r[M * n + D], d += s[w] * S, f += s[w + 1] * S, g += s[w + 2] * S, u || (p += s[w + 3] * S));
6963
+ for (m = 4 * (O * a + C), d = 0, f = 0, g = 0, p = 0, M = 0; M < n; M++) for (D = 0; D < n; D++) _ = O + M - o, b = C + D - o, _ < 0 || _ >= c || b < 0 || b >= a || (S = 4 * (_ * a + b), x = r[M * n + D], d += s[S] * x, f += s[S + 1] * x, g += s[S + 2] * x, u || (p += s[S + 3] * x));
6964
6964
  l[m] = d, l[m + 1] = f, l[m + 2] = g, l[m + 3] = u ? s[m + 3] : p;
6965
6965
  }
6966
6966
  t.imageData = h;
@@ -7316,39 +7316,39 @@ class Ir extends it {
7316
7316
  }
7317
7317
  lanczosResize(t, e, s, r, n) {
7318
7318
  const o = t.imageData.data, a = t.ctx.createImageData(r, n), c = a.data, h = this.lanczosCreate(this.lanczosLobes), l = this.rcpScaleX, u = this.rcpScaleY, d = 2 / this.rcpScaleX, f = 2 / this.rcpScaleY, g = Math.ceil(l * this.lanczosLobes / 2), p = Math.ceil(u * this.lanczosLobes / 2), m = {}, b = { x: 0, y: 0 }, _ = { x: 0, y: 0 };
7319
- return function w(S) {
7319
+ return function S(x) {
7320
7320
  let C, O, D, M, I, R, z, E, W, F, at;
7321
- for (b.x = (S + 0.5) * l, _.x = Math.floor(b.x), C = 0; C < n; C++) {
7321
+ for (b.x = (x + 0.5) * l, _.x = Math.floor(b.x), C = 0; C < n; C++) {
7322
7322
  for (b.y = (C + 0.5) * u, _.y = Math.floor(b.y), I = 0, R = 0, z = 0, E = 0, W = 0, O = _.x - g; O <= _.x + g; O++) if (!(O < 0 || O >= e)) {
7323
7323
  F = Math.floor(1e3 * Math.abs(O - b.x)), m[F] || (m[F] = {});
7324
7324
  for (let nt = _.y - p; nt <= _.y + p; nt++) nt < 0 || nt >= s || (at = Math.floor(1e3 * Math.abs(nt - b.y)), m[F][at] || (m[F][at] = h(Math.sqrt(Math.pow(F * d, 2) + Math.pow(at * f, 2)) / 1e3)), D = m[F][at], D > 0 && (M = 4 * (nt * e + O), I += D, R += D * o[M], z += D * o[M + 1], E += D * o[M + 2], W += D * o[M + 3]));
7325
7325
  }
7326
- M = 4 * (C * r + S), c[M] = R / I, c[M + 1] = z / I, c[M + 2] = E / I, c[M + 3] = W / I;
7326
+ M = 4 * (C * r + x), c[M] = R / I, c[M + 1] = z / I, c[M + 2] = E / I, c[M + 3] = W / I;
7327
7327
  }
7328
- return ++S < r ? w(S) : a;
7328
+ return ++x < r ? S(x) : a;
7329
7329
  }(0);
7330
7330
  }
7331
7331
  bilinearFiltering(t, e, s, r, n) {
7332
- let o, a, c, h, l, u, d, f, g, p, m, b, _, w = 0;
7333
- const S = this.rcpScaleX, C = this.rcpScaleY, O = 4 * (e - 1), D = t.imageData.data, M = t.ctx.createImageData(r, n), I = M.data;
7334
- for (d = 0; d < n; d++) for (f = 0; f < r; f++) for (l = Math.floor(S * f), u = Math.floor(C * d), g = S * f - l, p = C * d - u, _ = 4 * (u * e + l), m = 0; m < 4; m++) o = D[_ + m], a = D[_ + 4 + m], c = D[_ + O + m], h = D[_ + O + 4 + m], b = o * (1 - g) * (1 - p) + a * g * (1 - p) + c * p * (1 - g) + h * g * p, I[w++] = b;
7332
+ let o, a, c, h, l, u, d, f, g, p, m, b, _, S = 0;
7333
+ const x = this.rcpScaleX, C = this.rcpScaleY, O = 4 * (e - 1), D = t.imageData.data, M = t.ctx.createImageData(r, n), I = M.data;
7334
+ for (d = 0; d < n; d++) for (f = 0; f < r; f++) for (l = Math.floor(x * f), u = Math.floor(C * d), g = x * f - l, p = C * d - u, _ = 4 * (u * e + l), m = 0; m < 4; m++) o = D[_ + m], a = D[_ + 4 + m], c = D[_ + O + m], h = D[_ + O + 4 + m], b = o * (1 - g) * (1 - p) + a * g * (1 - p) + c * p * (1 - g) + h * g * p, I[S++] = b;
7335
7335
  return M;
7336
7336
  }
7337
7337
  hermiteFastResize(t, e, s, r, n) {
7338
7338
  const o = this.rcpScaleX, a = this.rcpScaleY, c = Math.ceil(o / 2), h = Math.ceil(a / 2), l = t.imageData.data, u = t.ctx.createImageData(r, n), d = u.data;
7339
7339
  for (let f = 0; f < n; f++) for (let g = 0; g < r; g++) {
7340
7340
  const p = 4 * (g + f * r);
7341
- let m = 0, b = 0, _ = 0, w = 0, S = 0, C = 0, O = 0;
7341
+ let m = 0, b = 0, _ = 0, S = 0, x = 0, C = 0, O = 0;
7342
7342
  const D = (f + 0.5) * a;
7343
7343
  for (let M = Math.floor(f * a); M < (f + 1) * a; M++) {
7344
7344
  const I = Math.abs(D - (M + 0.5)) / h, R = (g + 0.5) * o, z = I * I;
7345
7345
  for (let E = Math.floor(g * o); E < (g + 1) * o; E++) {
7346
7346
  let W = Math.abs(R - (E + 0.5)) / c;
7347
7347
  const F = Math.sqrt(z + W * W);
7348
- F > 1 && F < -1 || (m = 2 * F * F * F - 3 * F * F + 1, m > 0 && (W = 4 * (E + M * e), O += m * l[W + 3], _ += m, l[W + 3] < 255 && (m = m * l[W + 3] / 250), w += m * l[W], S += m * l[W + 1], C += m * l[W + 2], b += m));
7348
+ F > 1 && F < -1 || (m = 2 * F * F * F - 3 * F * F + 1, m > 0 && (W = 4 * (E + M * e), O += m * l[W + 3], _ += m, l[W + 3] < 255 && (m = m * l[W + 3] / 250), S += m * l[W], x += m * l[W + 1], C += m * l[W + 2], b += m));
7349
7349
  }
7350
7350
  }
7351
- d[p] = w / b, d[p + 1] = S / b, d[p + 2] = C / b, d[p + 3] = O / _;
7351
+ d[p] = S / b, d[p + 1] = x / b, d[p + 2] = C / b, d[p + 3] = O / _;
7352
7352
  }
7353
7353
  return u;
7354
7354
  }
@@ -7443,8 +7443,8 @@ const Yd = {
7443
7443
  }, es = class es extends st {
7444
7444
  constructor(e) {
7445
7445
  super(e);
7446
- x(this, "id");
7447
- x(this, "accepts", [
7446
+ w(this, "id");
7447
+ w(this, "accepts", [
7448
7448
  "audio",
7449
7449
  "video",
7450
7450
  "image",
@@ -7452,10 +7452,10 @@ const Yd = {
7452
7452
  "caption",
7453
7453
  "template"
7454
7454
  ]);
7455
- x(this, "metadata");
7456
- x(this, "items", []);
7457
- x(this, "magnetic");
7458
- x(this, "static");
7455
+ w(this, "metadata");
7456
+ w(this, "items", []);
7457
+ w(this, "magnetic");
7458
+ w(this, "static");
7459
7459
  Object.assign(this, es.ownDefaults), this.id = e.id, this.accepts = e.accepts || [], this.items = e.items || [], this.magnetic = e.magnetic, this.static = e.static, this.metadata = e.metadata, this.fill = "rgba(34, 34, 37, 0.8)", this.objectCaching = !1;
7460
7460
  }
7461
7461
  static getDefaults() {
@@ -7468,7 +7468,7 @@ const Yd = {
7468
7468
  this.width = e;
7469
7469
  }
7470
7470
  };
7471
- x(es, "ownDefaults", Yd), x(es, "type", "Track");
7471
+ w(es, "ownDefaults", Yd), w(es, "type", "Track");
7472
7472
  let Nt = es;
7473
7473
  k.setClass(Nt, "Track");
7474
7474
  const er = 1, Ue = "rgba(255, 255, 255,1.0)", Vd = [
@@ -7535,13 +7535,13 @@ const er = 1, Ue = "rgba(255, 255, 255,1.0)", Vd = [
7535
7535
  width: e.width
7536
7536
  });
7537
7537
  super([r, n, o], e);
7538
- x(this, "guide");
7539
- x(this, "topGuide");
7540
- x(this, "bottomGuide");
7541
- x(this, "metadata");
7542
- x(this, "accepts", []);
7543
- x(this, "kind");
7544
- x(this, "activeGuideFill");
7538
+ w(this, "guide");
7539
+ w(this, "topGuide");
7540
+ w(this, "bottomGuide");
7541
+ w(this, "metadata");
7542
+ w(this, "accepts", []);
7543
+ w(this, "kind");
7544
+ w(this, "activeGuideFill");
7545
7545
  Object.assign(this, ss.ownDefaults), this.guide = n, this.topGuide = r, this.bottomGuide = o, this.id = e.id, this.metadata = e.metadata, this.tScale = e.tScale, this.kind = e.kind, this.activeGuideFill = e.activeGuideFill || Ue;
7546
7546
  }
7547
7547
  static getDefaults() {
@@ -7557,7 +7557,7 @@ const er = 1, Ue = "rgba(255, 255, 255,1.0)", Vd = [
7557
7557
  e ? this.guide.set("fill", this.activeGuideFill) : this.guide.set("fill", "transparent");
7558
7558
  }
7559
7559
  };
7560
- x(ss, "type", "Helper"), x(ss, "ownDefaults", {
7560
+ w(ss, "type", "Helper"), w(ss, "ownDefaults", {
7561
7561
  selectable: !1,
7562
7562
  evented: !1
7563
7563
  });
@@ -7566,11 +7566,11 @@ k.setClass(Se, "Helper");
7566
7566
  const rs = class rs extends st {
7567
7567
  constructor(e) {
7568
7568
  super(e);
7569
- x(this, "guideItemId");
7570
- x(this, "distXToActCenter");
7571
- x(this, "trackItemType");
7572
- x(this, "defaultPos");
7573
- x(this, "draggedObject");
7569
+ w(this, "guideItemId");
7570
+ w(this, "distXToActCenter");
7571
+ w(this, "trackItemType");
7572
+ w(this, "defaultPos");
7573
+ w(this, "draggedObject");
7574
7574
  Object.assign(this, rs.ownDefaults), this.id = e.id;
7575
7575
  }
7576
7576
  static getDefaults() {
@@ -7593,7 +7593,7 @@ const rs = class rs extends st {
7593
7593
  ), e.lineWidth = er, e.setLineDash(this.strokeDashArray), e.strokeStyle = Ue, e.stroke(), e.restore();
7594
7594
  }
7595
7595
  };
7596
- x(rs, "type", "Placeholder"), x(rs, "ownDefaults", {
7596
+ w(rs, "type", "Placeholder"), w(rs, "ownDefaults", {
7597
7597
  rx: 6,
7598
7598
  ry: 6,
7599
7599
  objectCaching: !1,
@@ -7630,7 +7630,7 @@ function yi(i) {
7630
7630
  };
7631
7631
  }
7632
7632
  const Yo = 3, $d = 4, ch = 188, qd = 60, Kd = 1e3 / qd;
7633
- function Q(i, t = 1, e = 1) {
7633
+ function q(i, t = 1, e = 1) {
7634
7634
  const s = ch * t;
7635
7635
  return i * (60 / 1e3) * s / e;
7636
7636
  }
@@ -7639,7 +7639,7 @@ function P(i, t = 1, e = 1) {
7639
7639
  return i / s * Kd * e;
7640
7640
  }
7641
7641
  function Wy(i, t = 1) {
7642
- return Q(i, t);
7642
+ return q(i, t);
7643
7643
  }
7644
7644
  const Br = (i, t) => (t || Object.keys(i)).reduce((s, r) => {
7645
7645
  const n = i[r];
@@ -7670,19 +7670,19 @@ const Br = (i, t) => (t || Object.keys(i)).reduce((s, r) => {
7670
7670
  if (n.left < 0) return !1;
7671
7671
  const u = c - h;
7672
7672
  if (n.left + u < 0) {
7673
- const b = Q(
7673
+ const b = q(
7674
7674
  n.duration,
7675
7675
  n.tScale,
7676
7676
  n.playbackRate
7677
7677
  ), _ = n.width + n.left;
7678
7678
  if (_ <= b) {
7679
7679
  n.set("width", _);
7680
- const w = P(
7680
+ const S = P(
7681
7681
  b - _,
7682
7682
  n.tScale,
7683
7683
  n.playbackRate
7684
7684
  );
7685
- return n.trim.from = w, !0;
7685
+ return n.trim.from = S, !0;
7686
7686
  }
7687
7687
  return !1;
7688
7688
  }
@@ -7782,24 +7782,33 @@ const Br = (i, t) => (t || Object.keys(i)).reduce((s, r) => {
7782
7782
  f,
7783
7783
  n.tScale,
7784
7784
  n.playbackRate
7785
- ), p = d + g;
7786
- if (u) {
7787
- if (p > u.maxTo) return !1;
7788
- } else if (p > n.duration) return !1;
7789
- n.set("width", Math.max(h, 0)), n.trim.to = p;
7785
+ ), p = d + g, m = u ? u.maxTo : n.duration, b = Math.max(n.trim.from + 10, Math.min(m, p)), _ = b - d, S = q(
7786
+ _,
7787
+ n.tScale,
7788
+ n.playbackRate
7789
+ ), x = c + S;
7790
+ n.set("width", Math.max(x, 0)), n.trim.to = b;
7790
7791
  } else {
7791
- if (n.left < 0) return !1;
7792
- const d = c - h;
7793
- if (n.left + d < 0) return !1;
7794
- const g = h - c, p = n.trim.from, m = P(
7792
+ const d = u ? u.minFrom : 0, f = n.trim.from, g = h - c, p = P(
7795
7793
  g,
7796
7794
  n.tScale,
7797
7795
  n.playbackRate
7798
- ), b = p - m;
7799
- if (u) {
7800
- if (b < u.minFrom) return !1;
7801
- } else if (b < 0) return !1;
7802
- n.set("width", Math.max(h, 0)), n.trim.from = b;
7796
+ ), m = f - p;
7797
+ let b = Math.max(d, Math.min(n.trim.to - 10, m)), _ = f - b, S = q(
7798
+ _,
7799
+ n.tScale,
7800
+ n.playbackRate
7801
+ ), x = c + S;
7802
+ if (x > n.left + c) {
7803
+ x = n.left + c;
7804
+ const C = x - c, O = P(
7805
+ C,
7806
+ n.tScale,
7807
+ n.playbackRate
7808
+ );
7809
+ b = f - O;
7810
+ }
7811
+ n.set("width", Math.max(x, 0)), n.trim.from = b;
7803
7812
  }
7804
7813
  return c !== n.width;
7805
7814
  }
@@ -7945,15 +7954,15 @@ const { wrapWithFireEvent: pf, getLocalPoint: mf } = _s, vf = (i, t, e, s) => {
7945
7954
  if (n.left < 0) return !1;
7946
7955
  const d = c - h;
7947
7956
  if (n.left + d < 0) {
7948
- const w = Q(
7957
+ const S = q(
7949
7958
  n.duration,
7950
7959
  n.tScale,
7951
7960
  n.playbackRate
7952
- ), S = n.width + n.left;
7953
- if (S <= w) {
7954
- n.set("width", S);
7961
+ ), x = n.width + n.left;
7962
+ if (x <= S) {
7963
+ n.set("width", x);
7955
7964
  const C = P(
7956
- w - S,
7965
+ S - x,
7957
7966
  n.tScale,
7958
7967
  n.playbackRate
7959
7968
  );
@@ -7983,12 +7992,12 @@ const { wrapWithFireEvent: pf, getLocalPoint: mf } = _s, vf = (i, t, e, s) => {
7983
7992
  ), is = class is extends st {
7984
7993
  constructor(e) {
7985
7994
  super(e);
7986
- x(this, "duration");
7987
- x(this, "fromId");
7988
- x(this, "toId");
7989
- x(this, "kind", "none");
7990
- x(this, "isSelected", !1);
7991
- x(this, "availableDrop", !0);
7995
+ w(this, "duration");
7996
+ w(this, "fromId");
7997
+ w(this, "toId");
7998
+ w(this, "kind", "none");
7999
+ w(this, "isSelected", !1);
8000
+ w(this, "availableDrop", !0);
7992
8001
  Object.assign(this, is.ownDefaults), this.id = e.id, this.centeredScaling = !0, this.strokeWidth = 0, this.tScale = e.tScale, this.duration = e.duration, this.fromId = e.fromId, this.toId = e.toId, this.kind = e.kind, this.strokeDashArray = e.strokeDashArray || [];
7993
8002
  }
7994
8003
  static createControls() {
@@ -8020,7 +8029,7 @@ const { wrapWithFireEvent: pf, getLocalPoint: mf } = _s, vf = (i, t, e, s) => {
8020
8029
  ), e.lineWidth = er, e.setLineDash(this.strokeDashArray), e.strokeStyle = s, e.stroke(), e.restore();
8021
8030
  }
8022
8031
  };
8023
- x(is, "type", "Transition"), x(is, "ownDefaults", {
8032
+ w(is, "type", "Transition"), w(is, "ownDefaults", {
8024
8033
  objectCaching: !1,
8025
8034
  borderColor: "transparent",
8026
8035
  stroke: "transparent",
@@ -8039,12 +8048,12 @@ k.setClass($t, "Transition");
8039
8048
  const Bs = class Bs extends st {
8040
8049
  constructor(e) {
8041
8050
  super(e);
8042
- x(this, "id");
8043
- x(this, "resourceId", "");
8044
- x(this, "tScale");
8045
- x(this, "isSelected", !1);
8046
- x(this, "trim");
8047
- x(this, "duration");
8051
+ w(this, "id");
8052
+ w(this, "resourceId", "");
8053
+ w(this, "tScale");
8054
+ w(this, "isSelected", !1);
8055
+ w(this, "trim");
8056
+ w(this, "duration");
8048
8057
  Object.assign(this, Bs.ownDefaults), this.id = e.id, this.tScale = e.tScale, this.objectCaching = !1, this.rx = 8, this.ry = 8;
8049
8058
  }
8050
8059
  static createControls() {
@@ -8072,7 +8081,7 @@ const Bs = class Bs extends st {
8072
8081
  this.src = e;
8073
8082
  }
8074
8083
  };
8075
- x(Bs, "type", "Trimmable"), x(Bs, "ownDefaults", {
8084
+ w(Bs, "type", "Trimmable"), w(Bs, "ownDefaults", {
8076
8085
  rx: 6,
8077
8086
  ry: 6,
8078
8087
  objectCaching: !1,
@@ -8088,7 +8097,7 @@ k.setClass(ne, "Trimmable");
8088
8097
  const ns = class ns extends st {
8089
8098
  constructor(e) {
8090
8099
  super(e);
8091
- x(this, "isSelected", !1);
8100
+ w(this, "isSelected", !1);
8092
8101
  Object.assign(this, ns.ownDefaults), this.tScale = e.tScale, this.display = e.display;
8093
8102
  }
8094
8103
  static createControls() {
@@ -8117,7 +8126,7 @@ const ns = class ns extends st {
8117
8126
  ), e.lineWidth = er, e.strokeStyle = Ue, e.stroke(), e.restore());
8118
8127
  }
8119
8128
  };
8120
- x(ns, "type", "Resizable"), x(ns, "ownDefaults", {
8129
+ w(ns, "type", "Resizable"), w(ns, "ownDefaults", {
8121
8130
  rx: 6,
8122
8131
  ry: 6,
8123
8132
  objectCaching: !1,
@@ -8137,13 +8146,13 @@ function yf(i) {
8137
8146
  const os = class os extends st {
8138
8147
  constructor(e) {
8139
8148
  super(e);
8140
- x(this, "duration");
8141
- x(this, "fromId");
8142
- x(this, "toId");
8143
- x(this, "isSelected", !1);
8144
- x(this, "name");
8145
- x(this, "durationString");
8146
- x(this, "itemType");
8149
+ w(this, "duration");
8150
+ w(this, "fromId");
8151
+ w(this, "toId");
8152
+ w(this, "isSelected", !1);
8153
+ w(this, "name");
8154
+ w(this, "durationString");
8155
+ w(this, "itemType");
8147
8156
  Object.assign(this, os.ownDefaults), this.id = e.id, this.fill = "#27272a", this.name = e.type.toUpperCase(), this.durationString = yf(e.duration), this.itemType = e.type;
8148
8157
  }
8149
8158
  static getDefaults() {
@@ -8180,7 +8189,7 @@ const os = class os extends st {
8180
8189
  e.fillStyle = "rgba(0, 0, 0, 0.5)", e.roundRect ? (e.beginPath(), e.roundRect(s, r, n, o, a), e.fill()) : e.fillRect(s, r, n, o);
8181
8190
  }
8182
8191
  };
8183
- x(os, "type", "PreviewTrackItem"), x(os, "ownDefaults", {
8192
+ w(os, "type", "PreviewTrackItem"), w(os, "ownDefaults", {
8184
8193
  objectCaching: !1,
8185
8194
  borderColor: "transparent",
8186
8195
  stroke: "transparent",
@@ -8194,8 +8203,8 @@ let we = os;
8194
8203
  k.setClass(we, "PreviewTrackItem");
8195
8204
  class bf {
8196
8205
  constructor() {
8197
- x(this, "___eventListeners", {});
8198
- x(this, "___activeObjects", []);
8206
+ w(this, "___eventListeners", {});
8207
+ w(this, "___activeObjects", []);
8199
8208
  }
8200
8209
  resize(t, { force: e } = { force: !1 }) {
8201
8210
  var s;
@@ -8238,7 +8247,7 @@ function Gs(i, t) {
8238
8247
  }
8239
8248
  const _f = (i, t) => {
8240
8249
  var h, l, u, d, f, g, p, m;
8241
- const e = i.display, s = Q(e.from, t.tScale), r = Q(
8250
+ const e = i.display, s = q(e.from, t.tScale), r = q(
8242
8251
  e.to - e.from,
8243
8252
  t.tScale,
8244
8253
  i.playbackRate
@@ -9064,16 +9073,16 @@ function Nv(i, t, e, s, r, n) {
9064
9073
  d = a[u];
9065
9074
  var b = i[d], _ = t[d];
9066
9075
  if (s)
9067
- var w = o ? s(_, b, d, t, i, n) : s(b, _, d, i, t, n);
9068
- if (!(w === void 0 ? b === _ || r(b, _, e, s, n) : w)) {
9076
+ var S = o ? s(_, b, d, t, i, n) : s(b, _, d, i, t, n);
9077
+ if (!(S === void 0 ? b === _ || r(b, _, e, s, n) : S)) {
9069
9078
  p = !1;
9070
9079
  break;
9071
9080
  }
9072
9081
  m || (m = d == "constructor");
9073
9082
  }
9074
9083
  if (p && !m) {
9075
- var S = i.constructor, C = t.constructor;
9076
- S != C && "constructor" in i && "constructor" in t && !(typeof S == "function" && S instanceof S && typeof C == "function" && C instanceof C) && (p = !1);
9084
+ var x = i.constructor, C = t.constructor;
9085
+ x != C && "constructor" in i && "constructor" in t && !(typeof x == "function" && x instanceof x && typeof C == "function" && C instanceof C) && (p = !1);
9077
9086
  }
9078
9087
  return n.delete(i), n.delete(t), p;
9079
9088
  }
@@ -9149,10 +9158,10 @@ function s0(i, t, e) {
9149
9158
  function _(O) {
9150
9159
  return a = void 0, d && s ? f(O) : (s = r = void 0, o);
9151
9160
  }
9152
- function w() {
9161
+ function S() {
9153
9162
  a !== void 0 && clearTimeout(a), h = 0, s = c = r = a = void 0;
9154
9163
  }
9155
- function S() {
9164
+ function x() {
9156
9165
  return a === void 0 ? o : _(Yi());
9157
9166
  }
9158
9167
  function C() {
@@ -9165,7 +9174,7 @@ function s0(i, t, e) {
9165
9174
  }
9166
9175
  return a === void 0 && (a = setTimeout(b, t)), o;
9167
9176
  }
9168
- return C.cancel = w, C.flush = S, C;
9177
+ return C.cancel = S, C.flush = x, C;
9169
9178
  }
9170
9179
  function r0(i, t) {
9171
9180
  return kh(i, t);
@@ -9240,7 +9249,7 @@ class l0 {
9240
9249
  }
9241
9250
  updateTrackItemsToHistory() {
9242
9251
  this.pauseEventListeners(), this.trackItemIds.forEach((t) => {
9243
- const e = this.tracks.find((c) => c.items.includes(t)), s = this.getObjects().find((c) => c.id === (e == null ? void 0 : e.id)).top, r = this.trackItemsMap[t], n = this.getObjects().find((c) => c.id === t), o = Q(r.display.from, this.tScale), a = Q(
9252
+ const e = this.tracks.find((c) => c.items.includes(t)), s = this.getObjects().find((c) => c.id === (e == null ? void 0 : e.id)).top, r = this.trackItemsMap[t], n = this.getObjects().find((c) => c.id === t), o = q(r.display.from, this.tScale), a = q(
9244
9253
  r.display.to - r.display.from,
9245
9254
  this.tScale,
9246
9255
  r.playbackRate
@@ -9323,7 +9332,7 @@ class l0 {
9323
9332
  const e = t ? this.getActiveObjects().map((s) => s.id) : [];
9324
9333
  !t && this.pauseEventListeners(), this.trackItemIds.forEach((s) => {
9325
9334
  if (e.includes(s)) return;
9326
- const r = this.getObjects().find((c) => c.id === s), n = this.trackItemsMap[s], o = Q(n.display.from, this.tScale), a = Q(
9335
+ const r = this.getObjects().find((c) => c.id === s), n = this.trackItemsMap[s], o = q(n.display.from, this.tScale), a = q(
9327
9336
  n.display.to - n.display.from,
9328
9337
  this.tScale
9329
9338
  );
@@ -9480,11 +9489,11 @@ function Mh(i) {
9480
9489
  const p = Math.abs(c - g), m = Math.abs(c - f), b = P(1, e.tScale);
9481
9490
  if (p < n)
9482
9491
  if (e instanceof ne) {
9483
- const _ = g - e.left, w = _ - a, S = P(
9484
- w,
9492
+ const _ = g - e.left, S = _ - a, x = P(
9493
+ S,
9485
9494
  e.tScale,
9486
9495
  e.playbackRate
9487
- ), C = e.trim.to + S;
9496
+ ), C = e.trim.to + x;
9488
9497
  if (_ < b || _ < b) return;
9489
9498
  C <= e.duration && (e.set({
9490
9499
  width: _,
@@ -9497,11 +9506,11 @@ function Mh(i) {
9497
9506
  }), e.onResizeSnap && e.onResizeSnap(), h = !0;
9498
9507
  else if (m < n)
9499
9508
  if (e instanceof ne) {
9500
- const _ = f - e.left, w = _ - a, S = P(
9501
- w,
9509
+ const _ = f - e.left, S = _ - a, x = P(
9510
+ S,
9502
9511
  e.tScale,
9503
9512
  e.playbackRate
9504
- ), C = e.trim.to + S;
9513
+ ), C = e.trim.to + x;
9505
9514
  if (_ < b) return;
9506
9515
  C <= e.duration && (e.set({
9507
9516
  width: _,
@@ -9516,16 +9525,16 @@ function Mh(i) {
9516
9525
  const p = Math.abs(o - f), m = Math.abs(o - g);
9517
9526
  if (p < n)
9518
9527
  if (e instanceof ne) {
9519
- const b = c - f, _ = b - a, w = P(
9528
+ const b = c - f, _ = b - a, S = P(
9520
9529
  _,
9521
9530
  e.tScale,
9522
9531
  e.playbackRate
9523
- ), S = e.trim.from - w;
9524
- S >= 0 && (e.set({
9532
+ ), x = e.trim.from - S;
9533
+ x >= 0 && (e.set({
9525
9534
  left: f,
9526
9535
  width: b,
9527
9536
  scaleX: 1
9528
- }), e.trim.from = S, e.onResizeSnap && e.onResizeSnap(), h = !0);
9537
+ }), e.trim.from = x, e.onResizeSnap && e.onResizeSnap(), h = !0);
9529
9538
  } else
9530
9539
  e.set({
9531
9540
  left: f,
@@ -9534,16 +9543,16 @@ function Mh(i) {
9534
9543
  }), e.onResizeSnap && e.onResizeSnap(), h = !0;
9535
9544
  else if (m < n)
9536
9545
  if (e instanceof ne) {
9537
- const b = c - g, _ = b - a, w = P(
9546
+ const b = c - g, _ = b - a, S = P(
9538
9547
  _,
9539
9548
  e.tScale,
9540
9549
  e.playbackRate
9541
- ), S = e.trim.from - w;
9542
- S >= 0 && (e.set({
9550
+ ), x = e.trim.from - S;
9551
+ x >= 0 && (e.set({
9543
9552
  left: g,
9544
9553
  width: b,
9545
9554
  scaleX: 1
9546
- }), e.trim.from = S, e.onResizeSnap && e.onResizeSnap(), h = !0);
9555
+ }), e.trim.from = x, e.onResizeSnap && e.onResizeSnap(), h = !0);
9547
9556
  } else
9548
9557
  e.set({
9549
9558
  left: g,
@@ -9564,15 +9573,15 @@ function Mh(i) {
9564
9573
  var m;
9565
9574
  const p = t.trackItemsMap[g.id];
9566
9575
  if (p) {
9567
- const b = p.duration || 0, _ = (m = p.metadata) == null ? void 0 : m.userLimitDuration, w = typeof _ == "number" ? _ : b, S = p.display.from || 0, C = Math.max(0, d - S), O = Math.min(C, w);
9576
+ const b = p.duration || 0, _ = (m = p.metadata) == null ? void 0 : m.userLimitDuration, S = typeof _ == "number" ? _ : b, x = p.display.from || 0, C = Math.max(0, d - x), O = Math.min(C, S);
9568
9577
  g.display = {
9569
- from: S,
9570
- to: S + O
9578
+ from: x,
9579
+ to: x + O
9571
9580
  }, g.trim && (g.trim = {
9572
9581
  from: g.trim.from || 0,
9573
9582
  to: (g.trim.from || 0) + O
9574
9583
  });
9575
- const D = Q(O, t.tScale);
9584
+ const D = q(O, t.tScale);
9576
9585
  g.set({
9577
9586
  width: D,
9578
9587
  scaleX: 1
@@ -9670,7 +9679,7 @@ const Eh = {
9670
9679
  initialTrackPoints: [],
9671
9680
  updateItemsInTrack: null,
9672
9681
  orderNormalTrack: !1
9673
- }, J = () => Eh, ot = (i) => {
9682
+ }, Z = () => Eh, ot = (i) => {
9674
9683
  Object.assign(Eh, i);
9675
9684
  }, Sa = 10, Si = (i, t) => {
9676
9685
  t.forEach((e) => e.isAlignmentAuxiliary && i.remove(e));
@@ -9807,7 +9816,7 @@ const Eh = {
9807
9816
  function Wh(i) {
9808
9817
  const t = this;
9809
9818
  if (!t) return;
9810
- const s = J().enableGuideRedraw, r = t.getScenePoint(i.e), n = t.getObjects("Helper", "Track"), o = n.find((g) => {
9819
+ const s = Z().enableGuideRedraw, r = t.getScenePoint(i.e), n = t.getObjects("Helper", "Track"), o = n.find((g) => {
9811
9820
  const p = g.getBoundingRect();
9812
9821
  return r.x >= p.left && r.x <= p.left + p.width && r.y >= p.top && r.y <= p.top + p.height;
9813
9822
  });
@@ -9871,7 +9880,7 @@ function Hh(i, t) {
9871
9880
  return s;
9872
9881
  }
9873
9882
  function Yh(i) {
9874
- const t = J(), e = t.canvas;
9883
+ const t = Z(), e = t.canvas;
9875
9884
  ot({
9876
9885
  activeTrackToItemsMap: {},
9877
9886
  primaryTracks: {},
@@ -9969,11 +9978,11 @@ function M0(i) {
9969
9978
  const as = class as extends st {
9970
9979
  constructor(e) {
9971
9980
  super(e);
9972
- x(this, "duration");
9973
- x(this, "fromId");
9974
- x(this, "toId");
9975
- x(this, "itemType", "none");
9976
- x(this, "isSelected", !1);
9981
+ w(this, "duration");
9982
+ w(this, "fromId");
9983
+ w(this, "toId");
9984
+ w(this, "itemType", "none");
9985
+ w(this, "isSelected", !1);
9977
9986
  Object.assign(this, as.ownDefaults), this.id = e.id;
9978
9987
  }
9979
9988
  static createControls() {
@@ -9990,7 +9999,7 @@ const as = class as extends st {
9990
9999
  if (!e) return;
9991
10000
  const s = e.getObjects().find((o) => o.id === this.fromId);
9992
10001
  if (!s) return;
9993
- const r = Q(this.duration, this.tScale), n = s.left + s.width - r / 2;
10002
+ const r = q(this.duration, this.tScale), n = s.left + s.width - r / 2;
9994
10003
  this.set({
9995
10004
  width: r,
9996
10005
  left: n
@@ -10019,7 +10028,7 @@ const as = class as extends st {
10019
10028
  ), e.lineWidth = er, e.strokeStyle = Ue, e.stroke(), e.restore());
10020
10029
  }
10021
10030
  };
10022
- x(as, "type", "TransitionGuide"), x(as, "ownDefaults", {
10031
+ w(as, "type", "TransitionGuide"), w(as, "ownDefaults", {
10023
10032
  objectCaching: !1,
10024
10033
  borderColor: "transparent",
10025
10034
  stroke: "transparent",
@@ -10076,7 +10085,7 @@ const D0 = (i) => {
10076
10085
  "template"
10077
10086
  ];
10078
10087
  function Vh() {
10079
- const i = J();
10088
+ const i = Z();
10080
10089
  Fh(this, i.placeholderMovingObjects);
10081
10090
  }
10082
10091
  function j0(i) {
@@ -10097,23 +10106,23 @@ const P0 = (i, t, e) => !(e < 0 || Gh(i, {
10097
10106
  ...t.getBoundingRect(),
10098
10107
  left: e
10099
10108
  })), Nh = (i) => {
10100
- const e = J().draggingOverTrack, s = e == null ? void 0 : e.accepts.map(
10109
+ const e = Z().draggingOverTrack, s = e == null ? void 0 : e.accepts.map(
10101
10110
  (n) => n.toLowerCase()
10102
10111
  ), r = i.type.toLowerCase();
10103
10112
  return i instanceof we, e && (s == null ? void 0 : s.includes(r));
10104
10113
  };
10105
10114
  function A0(i) {
10106
- J().isPointerOverHelperTrack ? i.opacity = 0 : i.opacity = 1;
10115
+ Z().isPointerOverHelperTrack ? i.opacity = 0 : i.opacity = 1;
10107
10116
  }
10108
10117
  function L0() {
10109
- const i = J(), t = i.primaryMovingObjects[0];
10118
+ const i = Z(), t = i.primaryMovingObjects[0];
10110
10119
  return {
10111
10120
  top: i.objectInitialPositions[t.id].top,
10112
10121
  left: i.objectInitialPositions[t.id].left
10113
10122
  };
10114
10123
  }
10115
10124
  function R0(i) {
10116
- const t = i.getBoundingRect(), e = J(), s = e.draggingOverTrack;
10125
+ const t = i.getBoundingRect(), e = Z(), s = e.draggingOverTrack;
10117
10126
  if (e.primaryMovingObjects.map((n) => n.id).includes(i.id)) {
10118
10127
  const o = e.primaryMovingObjects[0].getBoundingRect();
10119
10128
  return {
@@ -10133,7 +10142,7 @@ function F0(i, t, e, s) {
10133
10142
  a,
10134
10143
  i,
10135
10144
  o
10136
- ), h = J();
10145
+ ), h = Z();
10137
10146
  if (h.orderNormalTrack = !0, !c || s.x - 20 < 0) {
10138
10147
  const l = h.draggingOverTrack;
10139
10148
  return {
@@ -10156,7 +10165,7 @@ const B0 = (i, t) => {
10156
10165
  (i) => {
10157
10166
  const t = i.target.canvas;
10158
10167
  j0(i);
10159
- const e = J(), s = e.draggingOverTrack;
10168
+ const e = Z(), s = e.draggingOverTrack;
10160
10169
  if (s) {
10161
10170
  const a = e.primaryMovingObjects[0];
10162
10171
  I0.includes(a.type) && e.placeholderMovingObjects.forEach((c) => {
@@ -10271,7 +10280,7 @@ function W0(i, t) {
10271
10280
  }
10272
10281
  function X0(i, t, e) {
10273
10282
  var h;
10274
- const s = J(), r = (h = i[0]) == null ? void 0 : h.canvas, n = s.draggingOverTrack, o = s.primaryMovingObjects.map((l) => l.id);
10283
+ const s = Z(), r = (h = i[0]) == null ? void 0 : h.canvas, n = s.draggingOverTrack, o = s.primaryMovingObjects.map((l) => l.id);
10275
10284
  if (!r) return;
10276
10285
  const a = r.transitionIds.filter(
10277
10286
  (l) => r.transitionsMap[l].kind !== "none"
@@ -10289,7 +10298,7 @@ function X0(i, t, e) {
10289
10298
  d !== -1 && e.splice(
10290
10299
  d,
10291
10300
  0,
10292
- Q(l.display.from, r.tScale)
10301
+ q(l.display.from, r.tScale)
10293
10302
  );
10294
10303
  }
10295
10304
  }
@@ -10347,14 +10356,14 @@ function G0(i) {
10347
10356
  i.off("mouse:up", Vh.bind(i)), i.off("object:moving", Uh);
10348
10357
  }
10349
10358
  const N0 = (i) => {
10350
- J().canvas.fire("track:create", i);
10359
+ Z().canvas.fire("track:create", i);
10351
10360
  }, U0 = (i) => {
10352
- J().canvas.fire("track-items:moved", i);
10361
+ Z().canvas.fire("track-items:moved", i);
10353
10362
  }, $h = (i) => {
10354
10363
  var a, c, h;
10355
10364
  const t = (a = i.target) == null ? void 0 : a.canvas;
10356
10365
  if (!t) return;
10357
- const e = J(), s = t.getActiveObject();
10366
+ const e = Z(), s = t.getActiveObject();
10358
10367
  if (!s || !t.positionBeforeTransform) return;
10359
10368
  const r = t.getScenePoint(i.e), o = t.getObjects("Track", "Helper").find((l) => {
10360
10369
  const u = l.getBoundingRect();
@@ -10415,7 +10424,7 @@ const N0 = (i) => {
10415
10424
  }
10416
10425
  };
10417
10426
  function $0() {
10418
- const i = J(), t = i.canvas, [e] = i.primaryMovingObjects, s = e.id, r = t.positionAfterTransform[s], n = e.getBoundingRect().top, o = r.top - n, a = {};
10427
+ const i = Z(), t = i.canvas, [e] = i.primaryMovingObjects, s = e.id, r = t.positionAfterTransform[s], n = e.getBoundingRect().top, o = r.top - n, a = {};
10419
10428
  return i.secondaryMovingObjects.forEach((c) => {
10420
10429
  const h = c.getBoundingRect().top + o, l = i.trackTopToIdMap[h], u = bn(
10421
10430
  i.trackTops,
@@ -10429,7 +10438,7 @@ function $0() {
10429
10438
  }), a;
10430
10439
  }
10431
10440
  function q0() {
10432
- const i = $0(), t = J();
10441
+ const i = $0(), t = Z();
10433
10442
  return Object.keys(i).some((e) => {
10434
10443
  const s = t.trackToItemsMap[e], r = i[e].objects;
10435
10444
  return !s || !s.length ? !0 : s.filter((n) => !r.includes(n)).some((n) => qh(
@@ -10550,7 +10559,7 @@ function Qh(i) {
10550
10559
  if (!oy.includes(e)) return;
10551
10560
  const s = t.duration || 5e3, r = this;
10552
10561
  r.discardActiveObject(), r.setActiveIds([]);
10553
- const n = Q(s, this.tScale), o = r.getItemSize(e), a = r.getTrackItems();
10562
+ const n = q(s, this.tScale), o = r.getItemSize(e), a = r.getTrackItems();
10554
10563
  if (tt = cy({
10555
10564
  width: n,
10556
10565
  height: o,
@@ -10565,17 +10574,17 @@ function Qh(i) {
10565
10574
  Be.forEach((p) => {
10566
10575
  const m = a.find((C) => C.id === p.toId), b = a.find((C) => C.id === p.fromId), _ = p.width;
10567
10576
  ((m == null ? void 0 : m.width) || 0) >= _ / 2 && ((b == null ? void 0 : b.width) || 0) >= _ / 2 || (p.availableDrop = !1);
10568
- const w = g.find(
10577
+ const S = g.find(
10569
10578
  (C) => C.fromId === p.toId
10570
10579
  );
10571
- w && w.width + _ / 2 >= ((m == null ? void 0 : m.width) || 0) && (p.availableDrop = !1);
10572
- const S = g.find(
10580
+ S && S.width + _ / 2 >= ((m == null ? void 0 : m.width) || 0) && (p.availableDrop = !1);
10581
+ const x = g.find(
10573
10582
  (C) => C.toId === p.fromId
10574
10583
  );
10575
- S && S.width + _ / 2 >= ((b == null ? void 0 : b.width) || 0) && (p.availableDrop = !1), p.visible = !0;
10584
+ x && x.width + _ / 2 >= ((b == null ? void 0 : b.width) || 0) && (p.availableDrop = !1), p.visible = !0;
10576
10585
  });
10577
10586
  }
10578
- const c = J();
10587
+ const c = Z();
10579
10588
  r.trackIdAfterTransform = "", r.positionAfterTransform = {};
10580
10589
  const h = tt, l = [tt];
10581
10590
  ot({
@@ -10614,7 +10623,7 @@ function Qh(i) {
10614
10623
  }), r.add(...c.placeholderMovingObjects), r.add(tt), se(Z0);
10615
10624
  }
10616
10625
  const tl = (i) => {
10617
- const t = J();
10626
+ const t = Z();
10618
10627
  Fh(i, t.placeholderMovingObjects), i && (Si(i, i.getObjects()), Bh(i.getObjects("Helper")));
10619
10628
  };
10620
10629
  function el() {
@@ -10628,7 +10637,7 @@ function el() {
10628
10637
  }), i.remove(tt);
10629
10638
  }
10630
10639
  function sl(i) {
10631
- const t = J();
10640
+ const t = Z();
10632
10641
  if (!tt || !t.placeholderMovingObjects || !t.placeholderMovingObjects[0])
10633
10642
  return !1;
10634
10643
  const e = t.placeholderMovingObjects[0];
@@ -10681,7 +10690,7 @@ function rl(i) {
10681
10690
  qs = "";
10682
10691
  const t = this;
10683
10692
  tl(t);
10684
- const e = J(), s = e.draggingOverTrack;
10693
+ const e = Z(), s = e.draggingOverTrack;
10685
10694
  ot({ draggingOverTrack: null, isPointerOverHelperTrack: !1 });
10686
10695
  let r = null;
10687
10696
  for (const o of ((n = i.e.dataTransfer) == null ? void 0 : n.types) || [])
@@ -10874,7 +10883,7 @@ const fy = (i) => {
10874
10883
  i.off("mouse:wheel", il), i.off("selection:created", nl), i.off("selection:updated", ol), i.off("selection:cleared", al);
10875
10884
  }, cl = () => {
10876
10885
  var n;
10877
- const i = J(), t = i.canvas, e = i.draggingOverTrack;
10886
+ const i = Z(), t = i.canvas, e = i.draggingOverTrack;
10878
10887
  t.updateTrackItemCoords(!0);
10879
10888
  const s = e == null ? void 0 : e.magnetic, r = new Set(i.activeObjects.map((o) => o.id));
10880
10889
  if (s) {
@@ -10897,7 +10906,7 @@ const fy = (i) => {
10897
10906
  if (h.left + d > (f == null ? void 0 : f.left)) {
10898
10907
  const p = d - (f.left - h.left);
10899
10908
  g.forEach((m) => {
10900
- const b = Q(m.display.from, t.tScale);
10909
+ const b = q(m.display.from, t.tScale);
10901
10910
  m.left = b + p;
10902
10911
  });
10903
10912
  }
@@ -10959,7 +10968,7 @@ class xy {
10959
10968
  const e = this.transitionsMap[t], s = e.fromId, r = e.toId, n = this.getObjects(), o = n.find((d) => d.id === s), a = n.find((d) => d.id === r);
10960
10969
  if (!o || !a)
10961
10970
  return;
10962
- const c = Q(e.duration, this.tScale), h = o.left + o.width - c / 2, l = o.height, u = new $t({
10971
+ const c = q(e.duration, this.tScale), h = o.left + o.width - c / 2, l = o.height, u = new $t({
10963
10972
  id: e.id,
10964
10973
  left: h,
10965
10974
  top: o.top,
@@ -10990,7 +10999,7 @@ class xy {
10990
10999
  (c) => c.id === r.fromId && !e.includes(c.id)
10991
11000
  );
10992
11001
  if (!n) return;
10993
- const o = Q(r.duration, this.tScale), a = n.left + n.width - o / 2;
11002
+ const o = q(r.duration, this.tScale), a = n.left + n.width - o / 2;
10994
11003
  r.set({
10995
11004
  left: a,
10996
11005
  top: n.top
@@ -11033,7 +11042,7 @@ class xy {
11033
11042
  }
11034
11043
  }
11035
11044
  function pl(i) {
11036
- const { secondaryTracks: t, primaryTracks: e, primaryPositions: s } = i, { positions: r, trackIndex: n } = s, o = n === -1 ? this.tracks.length : n, a = J(), [c] = Object.keys(e), h = this.tracks.find(
11045
+ const { secondaryTracks: t, primaryTracks: e, primaryPositions: s } = i, { positions: r, trackIndex: n } = s, o = n === -1 ? this.tracks.length : n, a = Z(), [c] = Object.keys(e), h = this.tracks.find(
11037
11046
  (_) => _.id === c
11038
11047
  ), l = e[c], u = [];
11039
11048
  let d = !1;
@@ -11041,8 +11050,8 @@ function pl(i) {
11041
11050
  if (_.type === "audio")
11042
11051
  if (d) {
11043
11052
  u.push(_.id);
11044
- const w = a.objectInitialPositions[_.id];
11045
- w && (_.set({ top: w.top, left: w.left }), _.setCoords());
11053
+ const S = a.objectInitialPositions[_.id];
11054
+ S && (_.set({ top: S.top, left: S.left }), _.setCoords());
11046
11055
  } else
11047
11056
  d = !0;
11048
11057
  });
@@ -11053,7 +11062,7 @@ function pl(i) {
11053
11062
  accepts: h.accepts,
11054
11063
  muted: h.muted || !1
11055
11064
  }, g = Qn(
11056
- Object.keys(t).map((_) => t[_].objects.filter((w) => !u.includes(w.id)).map((w) => w.id))
11065
+ Object.keys(t).map((_) => t[_].objects.filter((S) => !u.includes(S.id)).map((S) => S.id))
11057
11066
  );
11058
11067
  let p = Gs(this.tracks, [
11059
11068
  ...Object.keys(r).filter((_) => !u.includes(_)),
@@ -11061,16 +11070,16 @@ function pl(i) {
11061
11070
  ]);
11062
11071
  const m = [];
11063
11072
  Object.keys(t).forEach((_) => {
11064
- const { objects: w, index: S } = t[_], C = this.tracks.find(
11073
+ const { objects: S, index: x } = t[_], C = this.tracks.find(
11065
11074
  (M) => M.id === _
11066
- ), O = w.map((M) => M.id).filter(
11075
+ ), O = S.map((M) => M.id).filter(
11067
11076
  (M) => !this.transitionIds.includes(M) && !u.includes(M)
11068
11077
  ), D = {
11069
11078
  id: nr(),
11070
11079
  items: O,
11071
11080
  type: C.type,
11072
11081
  accepts: C.accepts,
11073
- tempIndex: S,
11082
+ tempIndex: x,
11074
11083
  muted: C.muted || !1
11075
11084
  };
11076
11085
  m.push(D);
@@ -11115,7 +11124,7 @@ function or(i) {
11115
11124
  from: ((a = o.trim) == null ? void 0 : a.from) ?? 0,
11116
11125
  to: ((c = o.trim) == null ? void 0 : c.to) ?? o.display.to
11117
11126
  });
11118
- const h = o.display.to - o.display.from, l = Q(h, i.tScale);
11127
+ const h = o.display.to - o.display.from, l = q(h, i.tScale);
11119
11128
  n.set({
11120
11129
  width: l,
11121
11130
  scaleX: 1
@@ -11131,7 +11140,7 @@ function ml(i) {
11131
11140
  secondaryTracks: e,
11132
11141
  primaryTracks: s,
11133
11142
  primaryPositions: r
11134
- } = i, { trackId: n, positions: o } = r, a = this.tracks.find((O) => O.id === n), c = J(), l = c.primaryMovingObjects.sort((O, D) => O.left - D.left);
11143
+ } = i, { trackId: n, positions: o } = r, a = this.tracks.find((O) => O.id === n), c = Z(), l = c.primaryMovingObjects.sort((O, D) => O.left - D.left);
11135
11144
  l.forEach((O, D) => {
11136
11145
  l[D - 1] && O.left - l[D - 1].left;
11137
11146
  });
@@ -11172,7 +11181,7 @@ function ml(i) {
11172
11181
  const M = r.trackId, I = _.find((R) => R.id === M);
11173
11182
  I == null || I.items.push(...m), this.tracks = _;
11174
11183
  });
11175
- const w = this.tracks[u], S = [];
11184
+ const S = this.tracks[u], x = [];
11176
11185
  Object.keys(e).forEach((O) => {
11177
11186
  const { objects: D, index: M } = e[O], I = D.filter(
11178
11187
  (E) => E.type !== "transition" && !g.includes(E.id)
@@ -11186,13 +11195,13 @@ function ml(i) {
11186
11195
  tempIndex: M,
11187
11196
  muted: !1
11188
11197
  };
11189
- S.push(W);
11198
+ x.push(W);
11190
11199
  } else {
11191
11200
  const E = _[u + M];
11192
11201
  E == null || E.items.push(...I), this.tracks = _;
11193
11202
  }
11194
11203
  });
11195
- const C = Hh(w, S);
11204
+ const C = Hh(S, x);
11196
11205
  C.length && _.splice(u, 1, ...C), this.tracks = _, this.renderTracks(), this.alignItemsToTrack(), this.uodateTrackItemIdsOrdering(), this.adjustMagneticTrack(), or(this), this.updateTransitions(!0), this.updateState({ updateHistory: !0, kind: "update" });
11197
11206
  }
11198
11207
  function vl({
@@ -11366,7 +11375,7 @@ const ky = (i) => {
11366
11375
  if (o.hasSrc) {
11367
11376
  const l = n[o.id];
11368
11377
  if (o.src !== a.details.src && o.setSrc && o.setSrc(a.details.src), a.type === "video" || a.type === "audio") {
11369
- const d = (((c = l.trim) == null ? void 0 : c.to) || 0) - (((h = l.trim) == null ? void 0 : h.from) || 0), f = Q(
11378
+ const d = (((c = l.trim) == null ? void 0 : c.to) || 0) - (((h = l.trim) == null ? void 0 : h.from) || 0), f = q(
11370
11379
  d,
11371
11380
  i.scale.zoom,
11372
11381
  l.playbackRate
@@ -11412,25 +11421,25 @@ function Dy(i) {
11412
11421
  }
11413
11422
  class Iy {
11414
11423
  constructor(t, e = {}) {
11415
- x(this, "canvas");
11416
- x(this, "fill", "rgba(0,0,0,.3)");
11417
- x(this, "stroke", "rgba(255,255,255,.3)");
11418
- x(this, "lineWidth", 1);
11419
- x(this, "hideX", !1);
11420
- x(this, "hideY", !1);
11421
- x(this, "scrollbarMinWidth", 40);
11422
- x(this, "scrollbarSize", 5);
11423
- x(this, "scrollSpace", 0);
11424
- x(this, "padding", 4);
11425
- x(this, "extraMarginX", 200);
11426
- x(this, "extraMarginY", 200);
11427
- x(this, "offsetX", 0);
11428
- x(this, "offsetY", 0);
11429
- x(this, "scrollbarWidth", 5);
11430
- x(this, "scrollbarColor", "rgba(0,0,0,.3)");
11431
- x(this, "onViewportChange");
11432
- x(this, "_bar");
11433
- x(this, "_barViewport", {
11424
+ w(this, "canvas");
11425
+ w(this, "fill", "rgba(0,0,0,.3)");
11426
+ w(this, "stroke", "rgba(255,255,255,.3)");
11427
+ w(this, "lineWidth", 1);
11428
+ w(this, "hideX", !1);
11429
+ w(this, "hideY", !1);
11430
+ w(this, "scrollbarMinWidth", 40);
11431
+ w(this, "scrollbarSize", 5);
11432
+ w(this, "scrollSpace", 0);
11433
+ w(this, "padding", 4);
11434
+ w(this, "extraMarginX", 200);
11435
+ w(this, "extraMarginY", 200);
11436
+ w(this, "offsetX", 0);
11437
+ w(this, "offsetY", 0);
11438
+ w(this, "scrollbarWidth", 5);
11439
+ w(this, "scrollbarColor", "rgba(0,0,0,.3)");
11440
+ w(this, "onViewportChange");
11441
+ w(this, "_bar");
11442
+ w(this, "_barViewport", {
11434
11443
  left: 1,
11435
11444
  right: -1,
11436
11445
  top: 1,
@@ -11438,9 +11447,9 @@ class Iy {
11438
11447
  sx: 1,
11439
11448
  sy: 1
11440
11449
  });
11441
- x(this, "_originalMouseDown");
11442
- x(this, "_originalMouseMove");
11443
- x(this, "_originalMouseUp");
11450
+ w(this, "_originalMouseDown");
11451
+ w(this, "_originalMouseMove");
11452
+ w(this, "_originalMouseUp");
11444
11453
  this.canvas = t, Object.assign(this, e), e.scrollbarWidth !== void 0 && (this.scrollbarSize = e.scrollbarWidth), e.scrollbarColor !== void 0 && (this.fill = e.scrollbarColor), this._originalMouseDown = this.canvas.__onMouseDown, this._originalMouseMove = this.canvas._onMouseMove, this._originalMouseUp = this.canvas._onMouseUp, this.canvas.__onMouseDown = this.mouseDownHandler.bind(this), this.canvas._onMouseMove = this.mouseMoveHandler.bind(this), this.canvas._onMouseUp = this.mouseUpHandler.bind(this), this.beforeRenderHandler = this.beforeRenderHandler.bind(this), this.afterRenderHandler = this.afterRenderHandler.bind(this), this.initBehavior();
11445
11454
  }
11446
11455
  initBehavior() {
@@ -11612,31 +11621,31 @@ const jy = (i) => {
11612
11621
  constructor(e, s) {
11613
11622
  var r;
11614
11623
  super(e, s);
11615
- x(this, "itemTypes", []);
11616
- x(this, "acceptsMap");
11617
- x(this, "sizesMap", {});
11618
- x(this, "objectTypes", []);
11624
+ w(this, "itemTypes", []);
11625
+ w(this, "acceptsMap");
11626
+ w(this, "sizesMap", {});
11627
+ w(this, "objectTypes", []);
11619
11628
  // Declare properties from state
11620
- x(this, "tracks", []);
11621
- x(this, "hoverCornerItem", !1);
11622
- x(this, "trackItemsMap", {});
11623
- x(this, "trackItemIds", []);
11624
- x(this, "transitionIds", []);
11625
- x(this, "transitionsMap", {});
11626
- x(this, "scale");
11627
- x(this, "duration");
11628
- x(this, "bounding");
11629
- x(this, "onScroll");
11630
- x(this, "onResizeCanvas");
11631
- x(this, "tScale");
11632
- x(this, "state");
11633
- x(this, "activeIds", []);
11634
- x(this, "spacing");
11635
- x(this, "guideLineColor");
11636
- x(this, "withTransitions", []);
11637
- x(this, "_mouseWheelHandler");
11638
- x(this, "_scrollbars");
11639
- x(this, "_viewportChangeCallback");
11629
+ w(this, "tracks", []);
11630
+ w(this, "hoverCornerItem", !1);
11631
+ w(this, "trackItemsMap", {});
11632
+ w(this, "trackItemIds", []);
11633
+ w(this, "transitionIds", []);
11634
+ w(this, "transitionsMap", {});
11635
+ w(this, "scale");
11636
+ w(this, "duration");
11637
+ w(this, "bounding");
11638
+ w(this, "onScroll");
11639
+ w(this, "onResizeCanvas");
11640
+ w(this, "tScale");
11641
+ w(this, "state");
11642
+ w(this, "activeIds", []);
11643
+ w(this, "spacing");
11644
+ w(this, "guideLineColor");
11645
+ w(this, "withTransitions", []);
11646
+ w(this, "_mouseWheelHandler");
11647
+ w(this, "_scrollbars");
11648
+ w(this, "_viewportChangeCallback");
11640
11649
  this.bounding = s.bounding || {
11641
11650
  width: s.width || 0,
11642
11651
  height: s.height || 0
@@ -11911,20 +11920,20 @@ const jy = (i) => {
11911
11920
  this.pauseEventListeners();
11912
11921
  const r = -(this.viewportTransform[4] - this.spacing.left), n = P(r, this.tScale);
11913
11922
  this.tScale = e.zoom, this.scale = e, this.getTrackItems().forEach((l) => {
11914
- const u = Q(l.display.from, this.tScale), d = Q(
11923
+ const u = q(l.display.from, this.tScale), d = q(
11915
11924
  l.display.to - l.display.from,
11916
11925
  this.tScale,
11917
11926
  l.playbackRate
11918
11927
  );
11919
11928
  l.set({ left: u, width: d, tScale: e.zoom }), l.onScale && l.onScale(), l.setCoords();
11920
11929
  }), this.requestRenderAll(), this.calcBounding(), this.refreshTrackLayout(), this.updateTransitions(!1);
11921
- const a = Q(n, this.tScale), c = this.viewportTransform.slice(0);
11930
+ const a = q(n, this.tScale), c = this.viewportTransform.slice(0);
11922
11931
  c[4] = -a + this.spacing.left;
11923
11932
  const h = this.getViewportPos(c[4], c[5]);
11924
11933
  c[4] = h.x, c[5] = h.y, this.setViewportTransform(c), this.requestRenderAll(), this.resumeEventListeners();
11925
11934
  }
11926
11935
  };
11927
- x(Ws, "objectTypes", []);
11936
+ w(Ws, "objectTypes", []);
11928
11937
  let be = Ws;
11929
11938
  Oy(be, [
11930
11939
  bf,
@@ -11978,7 +11987,7 @@ export {
11978
11987
  ir as isTransformCentered,
11979
11988
  Hy as resize,
11980
11989
  A as resolveOrigin,
11981
- Q as timeMsToUnits,
11990
+ q as timeMsToUnits,
11982
11991
  P as unitsToTimeMs,
11983
11992
  Vn as util,
11984
11993
  yi as wrapWithFixedAnchor