window.Subjx = (function (n) {
  var r = {};
  function o(t) {
    if (r[t]) return r[t].exports;
    var e = (r[t] = { i: t, l: !1, exports: {} });
    return n[t].call(e.exports, e, e.exports, o), (e.l = !0), e.exports;
  }
  return (
    (o.m = n),
    (o.c = r),
    (o.d = function (t, e, n) {
      o.o(t, e) || Object.defineProperty(t, e, { enumerable: !0, get: n });
    }),
    (o.r = function (t) {
      "undefined" != typeof Symbol &&
        Symbol.toStringTag &&
        Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }),
        Object.defineProperty(t, "__esModule", { value: !0 });
    }),
    (o.t = function (e, t) {
      if ((1 & t && (e = o(e)), 8 & t)) return e;
      if (4 & t && "object" == typeof e && e && e.__esModule) return e;
      var n = Object.create(null);
      if (
        (o.r(n),
        Object.defineProperty(n, "default", { enumerable: !0, value: e }),
        2 & t && "string" != typeof e)
      )
        for (var r in e)
          o.d(
            n,
            r,
            function (t) {
              return e[t];
            }.bind(null, r)
          );
      return n;
    }),
    (o.n = function (t) {
      var e =
        t && t.__esModule
          ? function () {
              return t.default;
            }
          : function () {
              return t;
            };
      return o.d(e, "a", e), e;
    }),
    (o.o = function (t, e) {
      return Object.prototype.hasOwnProperty.call(t, e);
    }),
    (o.p = ""),
    o((o.s = 1))
  );
})([
  function (t, e, n) {},
  function (t, e, n) {
    "use strict";
    n.r(e);
    n(0);
    var j =
        requestAnimationFrame ||
        mozRequestAnimationFrame ||
        webkitRequestAnimationFrame ||
        msRequestAnimationFrame ||
        function (t) {
          return setTimeout(t, 1e3 / 60);
        },
      a =
        cancelAnimationFrame ||
        mozCancelAnimationFrame ||
        function (t) {
          clearTimeout(t);
        },
      o = (Array.prototype.forEach, Array.prototype.slice),
      i = Array.prototype.map,
      s = Array.prototype.reduce,
      At = console.warn;
    function k(t) {
      return null != t;
    }
    function P(t) {
      return null == t;
    }
    function M(t) {
      return "function" == typeof t;
    }
    function c(t, e) {
      for (var n = 0; n < e.length; n++) {
        var r = e[n];
        (r.enumerable = r.enumerable || !1),
          (r.configurable = !0),
          "value" in r && (r.writable = !0),
          Object.defineProperty(t, r.key, r);
      }
    }
    var l = (function () {
      function t() {
        !(function (t, e) {
          if (!(t instanceof e))
            throw new TypeError("Cannot call a class as a function");
        })(this, t),
          (this.observers = {});
      }
      var e, n, r;
      return (
        (e = t),
        (n = [
          {
            key: "subscribe",
            value: function (t, e) {
              var n = this.observers;
              P(n[t]) && Object.defineProperty(n, t, { value: [] }),
                n[t].push(e);
            },
          },
          {
            key: "unsubscribe",
            value: function (e) {
              this.observers = this.observers.filter(function (t) {
                return t !== e;
              });
            },
          },
          {
            key: "notify",
            value: function (e, n, r) {
              P(this.observers[e]) ||
                this.observers[e].forEach(function (t) {
                  if (n !== t)
                    switch (e) {
                      case "onmove":
                        t.onMove(r);
                        break;
                      case "onrotate":
                        t.onRotate(r);
                        break;
                      case "onresize":
                        t.onResize(r);
                        break;
                      case "onapply":
                        t.onApply(r);
                        break;
                      case "ongetstate":
                        t.onGetState(r);
                    }
                });
            },
          },
        ]) && c(e.prototype, n),
        r && c(e, r),
        t
      );
    })();
    function u(t) {
      return (u =
        "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
          ? function (t) {
              return typeof t;
            }
          : function (t) {
              return t &&
                "function" == typeof Symbol &&
                t.constructor === Symbol &&
                t !== Symbol.prototype
                ? "symbol"
                : typeof t;
            })(t);
    }
    function r(t, e) {
      for (var n = 0; n < e.length; n++) {
        var r = e[n];
        (r.enumerable = r.enumerable || !1),
          (r.configurable = !0),
          "value" in r && (r.writable = !0),
          Object.defineProperty(t, r.key, r);
      }
    }
    var h = (function () {
      function a(t) {
        if (
          ((function (t, e) {
            if (!(t instanceof e))
              throw new TypeError("Cannot call a class as a function");
          })(this, a),
          !t)
        )
          return this;
        if ("string" == typeof t) {
          var e = document.querySelectorAll(t);
          this.length = e.length;
          for (var n = 0; n < this.length; n++) this[n] = e[n];
        } else if (1 === t.nodeType || t === document)
          (this[0] = t), (this.length = 1);
        else if (t instanceof Subjx || "object" === u(t)) {
          this.length = t.length;
          for (var r = 0; r < this.length; r++) this[r] = t[r];
        } else if (Array.isArray(t))
          for (var o = (this.length = 0); o < this.length; o++)
            1 === t.nodeType && ((this[o] = t[o]), this.length++);
        return this;
      }
      var t, e, n;
      return (
        (t = a),
        (e = [
          {
            key: "css",
            value: function (t) {
              return function (n) {
                var t = {
                  setStyle: function (t) {
                    return (function (t, e) {
                      var n = t.length;
                      for (; n--; ) for (var r in e) t[n].style[r] = e[r];
                      return t.style;
                    })(this, t);
                  },
                  getStyle: function () {
                    return (function (t) {
                      var e = t.length;
                      for (; e--; )
                        return t[e].currentStyle
                          ? t[e].currentStyle[n]
                          : document.defaultView &&
                            document.defaultView.getComputedStyle
                          ? document.defaultView.getComputedStyle(t[e], "")[n]
                          : t[e].style[n];
                    })(this);
                  },
                };
                {
                  if ("string" == typeof n)
                    return t.getStyle.apply(this, o.call(arguments, 1));
                  if ("object" === u(n) || !n)
                    return t.setStyle.apply(this, arguments);
                  At("Method ".concat(n, " does not exist"));
                }
                return !1;
              }.call(this, t);
            },
          },
          {
            key: "find",
            value: function (t) {
              return function (t) {
                var e = this.length;
                for (; e--; ) return T(this[e].querySelectorAll(t));
              }.call(this, t);
            },
          },
          {
            key: "each",
            value: function (t) {
              return function (e) {
                for (
                  var n = o.call(this, 0),
                    t = function (t) {
                      e.call(n[t]);
                    },
                    r = n.length - 1;
                  0 <= r;
                  --r
                )
                  t(r);
                return this;
              }.call(this, t);
            },
          },
          {
            key: "on",
            value: function () {
              return function () {
                var t = this.length;
                for (; t--; )
                  this[t].events ||
                    ((this[t].events = {}),
                    (this[t].events[arguments[0]] = [])),
                    2 === arguments.length
                      ? document.addEventListener
                        ? this[t].addEventListener(
                            arguments[0],
                            arguments[1],
                            !1
                          )
                        : document.attachEvent
                        ? this[t].attachEvent(
                            "on".concat(arguments[0]),
                            arguments[1]
                          )
                        : (this[t]["on".concat(arguments[0])] = arguments[1])
                      : 3 === arguments.length &&
                        "string" == typeof arguments[1] &&
                        f(
                          this[t],
                          arguments[0],
                          arguments[1],
                          arguments[2],
                          !0
                        );
                return this;
              }.apply(this, arguments);
            },
          },
          {
            key: "off",
            value: function () {
              return function () {
                var t = this.length;
                for (; t--; )
                  this[t].events ||
                    ((this[t].events = {}),
                    (this[t].events[arguments[0]] = [])),
                    2 === arguments.length
                      ? document.removeEventListener
                        ? this[t].removeEventListener(
                            arguments[0],
                            arguments[1],
                            !1
                          )
                        : document.detachEvent
                        ? this[t].detachEvent(
                            "on".concat(arguments[0]),
                            arguments[1]
                          )
                        : (this[t]["on".concat(arguments[0])] = null)
                      : 3 === arguments.length &&
                        "string" == typeof arguments[1] &&
                        f(
                          this[t],
                          arguments[0],
                          arguments[1],
                          arguments[2],
                          !1
                        );
                return this;
              }.apply(this, arguments);
            },
          },
          {
            key: "is",
            value: function (t) {
              return function (t) {
                var e = T(t),
                  n = this.length;
                for (; n--; ) if (this[n] === e[n]) return !0;
                return !1;
              }.call(this, t);
            },
          },
        ]) && r(t.prototype, e),
        n && r(t, n),
        a
      );
    })();
    function f(t, e, n, r, o) {
      var a = function (t) {
        for (var e = t.target; e && e !== this; )
          e.matches(n) && r.call(e, t), (e = e.parentNode);
      };
      !0 === o
        ? document.addEventListener
          ? t.addEventListener(e, a, !1)
          : document.attachEvent
          ? t.attachEvent("on".concat(e), a)
          : (t["on".concat(e)] = a)
        : document.removeEventListener
        ? t.removeEventListener(e, a, !1)
        : document.detachEvent
        ? t.detachEvent("on".concat(e), a)
        : (t["on".concat(e)] = null);
    }
    function T(t) {
      return new h(t);
    }
    function w(t) {
      return t.getBoundingClientRect();
    }
    function E(t) {
      return (
        t.css("-webkit-transform") ||
        t.css("-moz-transform") ||
        t.css("-ms-transform") ||
        t.css("-o-transform") ||
        t.css("transform") ||
        "none"
      );
    }
    function S(t) {
      var e = t.match(/-?\d+\.?\d+|-?\d+/g);
      return e
        ? e.map(function (t) {
            return parseFloat(t);
          })
        : [1, 0, 0, 1, 0, 0];
    }
    function A(e, t) {
      if (t) {
        if (e.classList) {
          if (!(-1 < t.indexOf(" "))) return e.classList.add(t);
          t.split(/\s+/).forEach(function (t) {
            return e.classList.add(t);
          });
        }
        return e;
      }
    }
    var p = /px|em|%|ex|ch|rem|vh|vw|vmin|vmax|mm|cm|in|pt|pc|deg/,
      O = Math.PI / 180;
    Math.PI;
    function C(t, e) {
      if (0 === e) return t;
      var n,
        r,
        o = ((n = t), 0 === (r = e) ? n : Math.round(n / r) * r);
      return o - t < e ? o : void 0;
    }
    function N(t, e, n, r, o, a, i) {
      var s = parseFloat(n) / 2,
        c = parseFloat(r) / 2,
        l = t + s,
        u = e + c,
        h = t - l,
        f = e - u,
        p = Math.atan2(f, h) + o,
        v = Math.sqrt(Math.pow(s, 2) + Math.pow(c, 2)),
        d = Math.cos(p),
        y = Math.sin(p),
        m = u + v * (y = !0 === i ? -y : y);
      return { left: b(l + v * (d = !0 === a ? -d : d)), top: b(m) };
    }
    function V(t, e) {
      return /px/.test(t)
        ? t
        : /%/.test(t)
        ? "".concat((parseFloat(t) * parseFloat(e)) / 100, "px")
        : void 0;
    }
    function x(t, e, n) {
      return /px/.test(n)
        ? t
        : /%/.test(n)
        ? "".concat((100 * parseFloat(t)) / parseFloat(e), "%")
        : void 0;
    }
    function z(t) {
      return t.match(p)[0];
    }
    function b(t) {
      return Number(t.toFixed(6));
    }
    function v(t, e) {
      for (var n = 0; n < e.length; n++) {
        var r = e[n];
        (r.enumerable = r.enumerable || !1),
          (r.configurable = !0),
          "value" in r && (r.writable = !0),
          Object.defineProperty(t, r.key, r);
      }
    }
    var d = (function () {
      function n(t, e) {
        if (
          ((function (t, e) {
            if (!(t instanceof e))
              throw new TypeError("Cannot call a class as a function");
          })(this, n),
          this.constructor === n)
        )
          throw new TypeError("Cannot construct Subject instances directly");
        (this.el = t),
          (this.storage = null),
          (this.Ob = e),
          (this._onMouseDown = this._onMouseDown.bind(this)),
          (this._onTouchStart = this._onTouchStart.bind(this)),
          (this._onMouseMove = this._onMouseMove.bind(this)),
          (this._onTouchMove = this._onTouchMove.bind(this)),
          (this._onMouseUp = this._onMouseUp.bind(this)),
          (this._onTouchEnd = this._onTouchEnd.bind(this)),
          (this._animate = this._animate.bind(this));
      }
      var t, e, r;
      return (
        (t = n),
        (e = [
          {
            key: "enable",
            value: function (t) {
              P(this.storage)
                ? (this._load(t), this._init(this.el))
                : At("Already enabled");
            },
          },
          {
            key: "disable",
            value: function () {
              var t = this.storage,
                e = this.el;
              P(t) ||
                (t.onExecution &&
                  (this._end(),
                  T(document)
                    .off("mousemove", this._onMouseMove)
                    .off("mouseup", this._onMouseUp)
                    .off("touchmove", this._onTouchMove)
                    .off("touchend", this._onTouchEnd)),
                (function (e, t) {
                  if (t) {
                    if (e.classList) {
                      if (!(-1 < t.indexOf(" "))) return e.classList.remove(t);
                      t.split(/\s+/).forEach(function (t) {
                        return e.classList.remove(t);
                      });
                    }
                  }
                })(e, "dg-drag"),
                this._destroy(),
                delete this.storage);
            },
          },
          { key: "_init", value: function () {} },
          { key: "_destroy", value: function () {} },
          { key: "_drag", value: function () {} },
          { key: "_resize", value: function () {} },
          { key: "_rotate", value: function () {} },
          { key: "_cursorPoint", value: function () {} },
          {
            key: "_load",
            value: function (t) {
              var e = this.el,
                n = this.Ob;
              A(e, "dg-drag");
              var r = { x: 10, y: 10, angle: 10 * O },
                o = { move: !1, resize: !1, rotate: !1 },
                a = !0,
                i = null,
                s = function () {},
                c = e.parentNode,
                l = !1;
              if (k(t)) {
                var u = t.snap,
                  h = t.each,
                  f = t.showHandles,
                  p = t.restrict,
                  v = t.drop,
                  d = t.container,
                  y = t.proportions;
                if (k(u)) {
                  var m = u.x,
                    b = u.y,
                    g = u.angle;
                  (r.x = P(m) ? 10 : m),
                    (r.y = P(b) ? 10 : b),
                    (r.angle = P(g) ? r.angle : g * O);
                }
                if (k(h)) {
                  var x = h.move,
                    _ = h.resize,
                    w = h.rotate;
                  (o.move = x || !1),
                    (o.resize = _ || !1),
                    (o.rotate = w || !1);
                }
                k(p) &&
                  (i = "parent" === p ? e.parentNode : T(p)[0] || document),
                  (s = M(t.drop)
                    ? function (t) {
                        v(t, e);
                      }
                    : s),
                  (a = P(f) || !0 === f),
                  (c = T(d)[0] || c),
                  (l = y || !1);
              }
              (this.storage = {
                showHandles: a,
                restrict: i,
                container: c,
                drop: s,
                snap: r,
                each: o,
                proportions: l,
              }),
                (o.move || o.resize || o.rotate) &&
                  (n.subscribe("ongetstate", this),
                  n.subscribe("onapply", this)),
                o.move && n.subscribe("onmove", this),
                o.resize && n.subscribe("onresize", this),
                o.rotate && n.subscribe("onrotate", this);
            },
          },
          {
            key: "_draw",
            value: function () {
              this._animate();
            },
          },
          {
            key: "_animate",
            value: function () {
              var t = this,
                e = t.storage;
              if (!P(e) && ((e.frame = j(t._animate)), e.doDraw)) {
                e.doDraw = !1;
                e.e;
                var n = e.handle,
                  r = e.handles,
                  o = e.cx,
                  a = e.cy,
                  i = e.nx,
                  s = e.ny,
                  c = e.pressang,
                  l = e.clientX,
                  u = e.clientY,
                  h = e.center,
                  f = e.snap,
                  p = e.doDrag,
                  v = e.doResize,
                  d = e.doRotate,
                  y = e.revX,
                  m = e.revY,
                  b = e.each,
                  g = b.move,
                  x = b.resize,
                  _ = b.rotate;
                if (v) {
                  var w = this._pointToElement({ x: l, y: u }),
                    k = w.x,
                    M = w.y,
                    T = C(k - o, f.x),
                    E = C(M - a, f.y);
                  (T =
                    n.is(r.ml) ||
                    n.is(r.mr) ||
                    n.is(r.tl) ||
                    n.is(r.tr) ||
                    n.is(r.bl) ||
                    n.is(r.br)
                      ? y
                        ? -T
                        : T
                      : 0),
                    (E =
                      n.is(r.br) ||
                      n.is(r.bl) ||
                      n.is(r.bc) ||
                      n.is(r.tr) ||
                      n.is(r.tl) ||
                      n.is(r.tc)
                        ? m
                          ? -E
                          : E
                        : 0),
                    t._resize(T, E),
                    x && t.Ob.notify("onresize", t, { dx: T, dy: E });
                }
                if (p) {
                  var S = C(l - i, f.x),
                    A = C(u - s, f.y);
                  t._drag(S, A),
                    g && t.Ob.notify("onmove", t, { dx: S, dy: A });
                }
                if (d) {
                  var O = Math.atan2(u - h.y, l - h.x) - c;
                  t._rotate(C(O, f.angle)),
                    _ && t.Ob.notify("onrotate", t, { radians: O });
                }
              }
            },
          },
          {
            key: "_start",
            value: function (t) {
              t.stopImmediatePropagation && t.stopImmediatePropagation();
              var e = this.storage,
                n = this._compute(t);
              Object.keys(n).forEach(function (t) {
                e[t] = n[t];
              });
              var r = n.onRightEdge,
                o = n.onBottomEdge,
                a = n.onTopEdge,
                i = n.onLeftEdge,
                s = n.handle,
                c = n.factor,
                l = n.revX,
                u = n.revY,
                h = r || o || a || i,
                f = s.is(e.handles.rotator),
                p = t.clientX,
                v = t.clientY,
                d = t.ctrlKey,
                y = this._cursorPoint({ clientX: p, clientY: v }),
                m = y.x,
                b = y.y,
                g = this._pointToElement({ x: m, y: b }),
                x = g.x,
                _ = g.y;
              (e.clientX = p),
                (e.clientY = v),
                (e.nx = m),
                (e.ny = b),
                (e.cx = x),
                (e.cy = _),
                (e.ctrlKey = d),
                (e.doResize = h),
                (e.doDrag = !f && !h),
                (e.doRotate = f),
                (e.onExecution = !0),
                this.Ob.notify("ongetstate", this, {
                  factor: c,
                  revX: l,
                  revY: u,
                }),
                this._draw();
            },
          },
          {
            key: "_moving",
            value: function (t) {
              t.preventDefault && t.preventDefault();
              var e = this.storage,
                n = this._cursorPoint(t),
                r = n.x,
                o = n.y;
              (e.clientX = r), (e.clientY = o), (e.doDraw = !0);
            },
          },
          {
            key: "_end",
            value: function (t) {
              k(t) &&
                t.stopImmediatePropagation &&
                t.stopImmediatePropagation();
              var e = this.storage,
                n = e.doResize ? "resize" : e.doDrag ? "drag" : "rotate";
              (e.doResize = !1),
                (e.doDrag = !1),
                (e.doRotate = !1),
                (e.doDraw = !1),
                (e.onExecution = !1),
                this._apply(n),
                this.Ob.notify("onapply", this, n),
                a(e.frame),
                e.drop.call(this, t);
            },
          },
          {
            key: "_onMouseDown",
            value: function (t) {
              this._start(t),
                T(document)
                  .on("mousemove", this._onMouseMove)
                  .on("mouseup", this._onMouseUp);
            },
          },
          {
            key: "_onTouchStart",
            value: function (t) {
              this._start(t.touches[0]),
                T(document)
                  .on("touchmove", this._onTouchMove)
                  .on("touchend", this._onTouchEnd);
            },
          },
          {
            key: "_onMouseMove",
            value: function (t) {
              this._moving(t, this.el);
            },
          },
          {
            key: "_onTouchMove",
            value: function (t) {
              this._moving(t.touches[0], this.el);
            },
          },
          {
            key: "_onMouseUp",
            value: function (t) {
              T(document)
                .off("mousemove", this._onMouseMove)
                .off("mouseup", this._onMouseUp),
                this._end(t, this.el);
            },
          },
          {
            key: "_onTouchEnd",
            value: function (t) {
              T(document)
                .off("touchmove", this._onTouchMove)
                .off("touchend", this._onTouchEnd),
                0 === t.touches.length &&
                  this._end(t.changedTouches[0], this.el);
            },
          },
          {
            key: "onMove",
            value: function (t) {
              var e = t.dx,
                n = t.dy;
              this._drag(e, n);
            },
          },
          {
            key: "onRotate",
            value: function (t) {
              var e = this.storage.snap;
              this._rotate(C(t.radians, e.angle));
            },
          },
          {
            key: "onResize",
            value: function (t) {
              var e = t.dx,
                n = t.dy,
                r = t.dox,
                o = t.doy;
              this._resize(e, n, r, o);
            },
          },
          {
            key: "onApply",
            value: function (t) {
              this._apply(t);
            },
          },
        ]) && v(t.prototype, e),
        r && v(t, r),
        n
      );
    })();
    function y(t, e) {
      return (
        (function (t) {
          if (Array.isArray(t)) return t;
        })(t) ||
        (function (t, e) {
          var n = [],
            r = !0,
            o = !1,
            a = void 0;
          try {
            for (
              var i, s = t[Symbol.iterator]();
              !(r = (i = s.next()).done) &&
              (n.push(i.value), !e || n.length !== e);
              r = !0
            );
          } catch (t) {
            (o = !0), (a = t);
          } finally {
            try {
              r || null == s.return || s.return();
            } finally {
              if (o) throw a;
            }
          }
          return n;
        })(t, e) ||
        (function () {
          throw new TypeError(
            "Invalid attempt to destructure non-iterable instance"
          );
        })()
      );
    }
    function m(t) {
      return (m =
        "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
          ? function (t) {
              return typeof t;
            }
          : function (t) {
              return t &&
                "function" == typeof Symbol &&
                t.constructor === Symbol &&
                t !== Symbol.prototype
                ? "symbol"
                : typeof t;
            })(t);
    }
    function D(t) {
      return (
        (function (t) {
          if (Array.isArray(t)) {
            for (var e = 0, n = new Array(t.length); e < t.length; e++)
              n[e] = t[e];
            return n;
          }
        })(t) ||
        (function (t) {
          if (
            Symbol.iterator in Object(t) ||
            "[object Arguments]" === Object.prototype.toString.call(t)
          )
            return Array.from(t);
        })(t) ||
        (function () {
          throw new TypeError(
            "Invalid attempt to spread non-iterable instance"
          );
        })()
      );
    }
    function g(t, e) {
      for (var n = 0; n < e.length; n++) {
        var r = e[n];
        (r.enumerable = r.enumerable || !1),
          (r.configurable = !0),
          "value" in r && (r.writable = !0),
          Object.defineProperty(t, r.key, r);
      }
    }
    function _(t, e) {
      return !e || ("object" !== m(e) && "function" != typeof e)
        ? (function (t) {
            if (void 0 !== t) return t;
            throw new ReferenceError(
              "this hasn't been initialised - super() hasn't been called"
            );
          })(t)
        : e;
    }
    function X(t) {
      return (X = Object.setPrototypeOf
        ? Object.getPrototypeOf
        : function (t) {
            return t.__proto__ || Object.getPrototypeOf(t);
          })(t);
    }
    function Y(t, e) {
      return (Y =
        Object.setPrototypeOf ||
        function (t, e) {
          return (t.__proto__ = e), t;
        })(t, e);
    }
    var L = (function (t) {
      function o(t, e, n) {
        var r;
        return (
          (function (t, e) {
            if (!(t instanceof e))
              throw new TypeError("Cannot call a class as a function");
          })(this, o),
          (r = _(this, X(o).call(this, t, n))).enable(e),
          r
        );
      }
      var e, n, r;
      return (
        (function (t, e) {
          if ("function" != typeof e && null !== e)
            throw new TypeError(
              "Super expression must either be null or a function"
            );
          (t.prototype = Object.create(e && e.prototype, {
            constructor: { value: t, writable: !0, configurable: !0 },
          })),
            e && Y(t, e);
        })(o, d),
        (e = o),
        (n = [
          {
            key: "_init",
            value: function (t) {
              (function (t) {
                var e = this.storage,
                  n = document.createElement("div");
                A(n, "dg-wrapper"), t.parentNode.insertBefore(n, t);
                var r = T(t),
                  o = t.style,
                  a = o.left,
                  i = o.top,
                  s = o.width,
                  c = o.height,
                  l = s || r.css("width"),
                  u = c || r.css("height"),
                  h = i || r.css("top"),
                  f = a || r.css("left"),
                  p = T(n.parentNode),
                  v = { top: h, left: f, width: l, height: u, transform: E(r) },
                  d = document.createElement("div");
                (d.innerHTML =
                  '\n        <div class="dg dg-normal"></div>\n        <div class="dg-hdl dg-hdl-t dg-hdl-l dg-hdl-tl"></div>\n        <div class="dg-hdl dg-hdl-t dg-hdl-r dg-hdl-tr"></div>\n        <div class="dg-hdl dg-hdl-b dg-hdl-r dg-hdl-br"></div>\n        <div class="dg-hdl dg-hdl-b dg-hdl-l dg-hdl-bl"></div>\n        <div class="dg-hdl dg-hdl-t dg-hdl-c dg-hdl-tc"></div>\n        <div class="dg-hdl dg-hdl-b dg-hdl-c dg-hdl-bc"></div>\n        <div class="dg-hdl dg-hdl-m dg-hdl-l dg-hdl-ml"></div>\n        <div class="dg-hdl dg-hdl-m dg-hdl-r dg-hdl-mr"></div>\n        <div class="dg-hdl dg-rotator"></div>'),
                  A(d, "dg-controls"),
                  n.appendChild(d);
                var y = T(d);
                y.css(v);
                var m = T(n);
                Object.assign(e, {
                  controls: d,
                  handles: {
                    tl: m.find(".dg-hdl-tl"),
                    tr: m.find(".dg-hdl-tr"),
                    br: m.find(".dg-hdl-br"),
                    bl: m.find(".dg-hdl-bl"),
                    tc: m.find(".dg-hdl-tc"),
                    bc: m.find(".dg-hdl-bc"),
                    ml: m.find(".dg-hdl-ml"),
                    mr: m.find(".dg-hdl-mr"),
                    rotator: m.find(".dg-rotator"),
                  },
                  parent: p,
                }),
                  y
                    .on("mousedown", this._onMouseDown)
                    .on("touchstart", this._onTouchStart);
              }).call(this, t);
            },
          },
          {
            key: "_destroy",
            value: function (t) {
              (function () {
                var t = this.storage,
                  e = t.controls,
                  n = t.container;
                T(e)
                  .off("mousedown", this._onMouseDown)
                  .off("touchstart", this._onTouchStart),
                  n.removeChild(e.parentNode);
              }).call(this, t);
            },
          },
          {
            key: "_drag",
            value: function () {
              I.call.apply(
                I,
                [this].concat(Array.prototype.slice.call(arguments))
              );
            },
          },
          {
            key: "_rotate",
            value: function () {
              U.call.apply(
                U,
                [this].concat(Array.prototype.slice.call(arguments))
              );
            },
          },
          {
            key: "_resize",
            value: function () {
              R.call.apply(
                R,
                [this].concat(Array.prototype.slice.call(arguments))
              );
            },
          },
          {
            key: "_compute",
            value: function () {
              return B.call.apply(
                B,
                [this].concat(Array.prototype.slice.call(arguments))
              );
            },
          },
          {
            key: "_pointToElement",
            value: function (t) {
              var e = this.storage.transform,
                n = t.x,
                r = t.y,
                o = D(e.matrix);
              return (o[4] = o[5] = 0), G({ x: n, y: r }, H(o));
            },
          },
          {
            key: "_cursorPoint",
            value: function (t) {
              var e = S(E(T(this.storage.container)));
              return G({ x: t.clientX, y: t.clientY }, H(e));
            },
          },
          {
            key: "_apply",
            value: function () {
              var t = this.storage,
                e = T(this.el),
                n = t.cached,
                r = t.parent,
                o = t.dimens,
                a = t.controls;
              if (n) {
                var i = D(n),
                  s = r.css("width"),
                  c = r.css("height"),
                  l = i[4],
                  u = i[5];
                (i[4] = 0), (i[5] = 0);
                var h = q(i),
                  f = parseFloat(V(e[0].style.left || e.css("left"), s)),
                  p = parseFloat(V(e[0].style.top || e.css("top"), c));
                (h.left = x(f + l + "px", s, o.left)),
                  (h.top = x(p + u + "px", c, o.top)),
                  e.css(h),
                  T(a).css(h),
                  (this.storage.cached = null);
              }
            },
          },
          {
            key: "onGetState",
            value: function (t) {
              var e = this.storage,
                n = F.call(this, t);
              Object.keys(n).forEach(function (t) {
                e[t] = n[t];
              });
            },
          },
        ]) && g(e.prototype, n),
        r && g(e, r),
        o
      );
    })();
    function B(t) {
      var e = this.storage.handles,
        n = T(t.target),
        r = n.is(e.tl) || n.is(e.ml) || n.is(e.bl) || n.is(e.tc),
        o = n.is(e.tl) || n.is(e.tr) || n.is(e.tc) || n.is(e.ml),
        a = n.is(e.tl) || n.is(e.tc) || n.is(e.tr),
        i = n.is(e.tl) || n.is(e.ml) || n.is(e.bl),
        s = n.is(e.tr) || n.is(e.mr) || n.is(e.br),
        c = n.is(e.br) || n.is(e.bc) || n.is(e.bl),
        l = n.is(e.tr) || n.is(e.bl) ? -1 : 1,
        u = F.call(this, { factor: l, revX: r, revY: o }),
        h = this._cursorPoint(t),
        f = h.x,
        p = h.y,
        v = Math.atan2(p - u.center.y, f - u.center.x);
      return (
        (u.onTopEdge = a),
        (u.onLeftEdge = i),
        (u.onRightEdge = s),
        (u.onBottomEdge = c),
        (u.handle = n),
        (u.pressang = v),
        u
      );
    }
    function F(t) {
      var e = t.factor,
        n = t.revX,
        r = t.revY,
        o = this.el,
        a = this.storage,
        i = a.handles,
        s = a.controls,
        c = a.parent,
        l = w(i.tl[0]),
        u = w(i.tr[0]),
        h = Math.atan2(u.top - l.top, u.left - l.left) * e,
        f = parseFloat(V(s.style.width, c.css("width"))),
        p = parseFloat(V(s.style.height, c.css("height"))),
        v = w(s),
        d = v.left + f / 2,
        y = v.top + p / 2,
        m = T(o),
        b = o.style,
        g = {
          top: z(b.top || m.css("top")),
          left: z(b.left || m.css("left")),
          width: z(b.width || m.css("width")),
          height: z(b.height || m.css("height")),
        },
        x = { matrix: S(E(T(s))), parentMatrix: S(E(c)) },
        _ = D(x.matrix);
      return (
        (_[4] = 0),
        (_[5] = 0),
        {
          transform: x,
          cw: f,
          ch: p,
          coords: N(x.matrix[4], x.matrix[5], f, p, h, n, r),
          center: { x: d, y: y },
          factor: e,
          refang: h,
          revX: n,
          revY: r,
          dimens: g,
        }
      );
    }
    function R(t, e) {
      var n = this.el,
        r = this.storage,
        o = r.controls,
        a = r.coords,
        i = r.cw,
        s = r.ch,
        c = r.dimens,
        l = r.parent,
        u = r.transform,
        h = r.refang,
        f = r.revX,
        p = r.revY,
        v = o.style,
        d = i + t,
        y = s + e;
      if (!(d < 2 || y < 2)) {
        (v.width = "".concat(d, "px")), (v.height = "".concat(y, "px"));
        var m = D(u.matrix),
          b = N(m[4], m[5], d, y, h, f, p);
        (m[4] -= b.left - a.left), (m[5] -= b.top - a.top);
        var g = q(m);
        T(o).css(g),
          (g.width = x(v.width, l.css("width"), c.width)),
          (g.height = x(v.height, l.css("height"), c.height)),
          T(n).css(g),
          (r.cached = m);
      }
    }
    function I(t, e) {
      var n = this.el,
        r = this.storage,
        o = r.controls,
        a = r.transform,
        i = a.matrix,
        s = D(a.parentMatrix);
      s[4] = s[5] = 0;
      var c = G({ x: t, y: e }, H(s)),
        l = (c.x, c.y, D(i));
      (l[4] = i[4] + t), (l[5] = i[5] + e);
      var u = q(l);
      T(o).css(u), T(n).css(u), (r.cached = l);
    }
    function U(t) {
      var e = this.el,
        n = this.storage,
        r = n.controls,
        o = n.transform.matrix,
        a = b(Math.cos(t)),
        i = b(Math.sin(t)),
        s = (function (t, e) {
          for (
            var n = [
                [t[0], t[2], t[4]],
                [t[1], t[3], t[5]],
                [0, 0, 1],
              ],
              r = [
                [e[0], e[2], e[4]],
                [e[1], e[3], e[5]],
                [0, 0, 1],
              ],
              o = [],
              a = 0;
            a < r.length;
            a++
          ) {
            o[a] = [];
            for (var i = 0; i < n[0].length; i++) {
              for (var s = 0, c = 0; c < n.length; c++) s += n[c][i] * r[a][c];
              o[a].push(s);
            }
          }
          return [o[0][0], o[1][0], o[0][1], o[1][1], o[0][2], o[1][2]];
        })([a, i, -i, a, 0, 0], o),
        c = q(s);
      T(r).css(c), T(e).css(c), (n.cached = s);
    }
    function q(t) {
      var e = "matrix(".concat(t.join(), ")");
      return {
        transform: e,
        webkitTranform: e,
        mozTransform: e,
        msTransform: e,
        otransform: e,
      };
    }
    function G(t, e) {
      var n = t.x,
        r = t.y,
        o = y(e, 6),
        a = o[0],
        i = o[1],
        s = o[2],
        c = o[3];
      return { x: a * n + s * r + o[4], y: i * n + c * r + o[5] };
    }
    function H(t) {
      var e = [
        [t[0], t[2], t[4]],
        [t[1], t[3], t[5]],
        [0, 0, 1],
      ];
      if (e.length === e[0].length) {
        for (var n = e.length, r = [], o = [], a = 0; a < n; a += 1) {
          (r[r.length] = []), (o[o.length] = []);
          for (var i = 0; i < n; i += 1)
            (r[a][i] = a == i ? 1 : 0), (o[a][i] = e[a][i]);
        }
        for (var s = 0; s < n; s += 1) {
          var c = o[s][s];
          if (0 === c) {
            for (var l = s + 1; l < n; l += 1)
              if (0 !== o[l][s]) {
                for (var u = 0; u < n; u++)
                  (c = o[s][u]),
                    (o[s][u] = o[l][u]),
                    (o[l][u] = c),
                    (c = r[s][u]),
                    (r[s][u] = r[l][u]),
                    (r[l][u] = c);
                break;
              }
            if (0 === (c = o[s][s])) return;
          }
          for (var h = 0; h < n; h++)
            (o[s][h] = o[s][h] / c), (r[s][h] = r[s][h] / c);
          for (var f = 0; f < n; f++)
            if (f != s) {
              c = o[f][s];
              for (var p = 0; p < n; p++)
                (o[f][p] -= c * o[s][p]), (r[f][p] -= c * r[s][p]);
            }
        }
        return [r[0][0], r[1][0], r[0][1], r[1][1], r[0][2], r[1][2]];
      }
    }
    var K = [
      "circle",
      "ellipse",
      "image",
      "line",
      "path",
      "polygon",
      "polyline",
      "rect",
      "text",
      "g",
    ];
    function Q(t) {
      return document.createElementNS("http://www.w3.org/2000/svg", t);
    }
    function Z() {
      return Q("svg").createSVGMatrix();
    }
    function ot(t, e) {
      return (e.getScreenCTM() || Z())
        .inverse()
        .multiply(t.getScreenCTM() || Z());
    }
    function J(t) {
      return "matrix("
        .concat(t.a, ",")
        .concat(t.b, ",")
        .concat(t.c, ",")
        .concat(t.d, ",")
        .concat(t.e, ",")
        .concat(t.f, ")");
    }
    function Ot(t, e, n, r) {
      var o = e.createSVGPoint();
      return (o.x = n), (o.y = r), o.matrixTransform(t);
    }
    function jt(t) {
      var e = Z();
      return (
        (e.a = t.a),
        (e.b = t.b),
        (e.c = t.c),
        (e.d = t.d),
        (e.e = t.e),
        (e.f = t.f),
        e
      );
    }
    function W(t) {
      return (
        (function (t) {
          if (Array.isArray(t)) {
            for (var e = 0, n = new Array(t.length); e < t.length; e++)
              n[e] = t[e];
            return n;
          }
        })(t) ||
        (function (t) {
          if (
            Symbol.iterator in Object(t) ||
            "[object Arguments]" === Object.prototype.toString.call(t)
          )
            return Array.from(t);
        })(t) ||
        (function () {
          throw new TypeError(
            "Invalid attempt to spread non-iterable instance"
          );
        })()
      );
    }
    function Pt(t, e) {
      return (
        (function (t) {
          if (Array.isArray(t)) return t;
        })(t) ||
        (function (t, e) {
          var n = [],
            r = !0,
            o = !1,
            a = void 0;
          try {
            for (
              var i, s = t[Symbol.iterator]();
              !(r = (i = s.next()).done) &&
              (n.push(i.value), !e || n.length !== e);
              r = !0
            );
          } catch (t) {
            (o = !0), (a = t);
          } finally {
            try {
              r || null == s.return || s.return();
            } finally {
              if (o) throw a;
            }
          }
          return n;
        })(t, e) ||
        (function () {
          throw new TypeError(
            "Invalid attempt to destructure non-iterable instance"
          );
        })()
      );
    }
    var $ = /\s*([achlmqstvz])([^achlmqstvz]*)\s*/gi,
      tt = /\s*,\s*|\s+/g;
    function Ct(t) {
      for (var e = ($.lastIndex = 0), n = []; (e = $.exec(t)); ) {
        var r = e[1],
          o = r.toUpperCase(),
          a = e[2].replace(/[^e\s+]-/g, " -").replace(/ +/g, " ");
        n.push({
          relative: r !== o,
          key: o,
          cmd: r,
          value: a
            .trim()
            .split(tt)
            .map(function (t) {
              if (!isNaN(t)) return Number(t);
            }),
        });
      }
      return n;
    }
    function et(t) {
      return (
        (function (t) {
          if (Array.isArray(t)) {
            for (var e = 0, n = new Array(t.length); e < t.length; e++)
              n[e] = t[e];
            return n;
          }
        })(t) ||
        (function (t) {
          if (
            Symbol.iterator in Object(t) ||
            "[object Arguments]" === Object.prototype.toString.call(t)
          )
            return Array.from(t);
        })(t) ||
        (function () {
          throw new TypeError(
            "Invalid attempt to spread non-iterable instance"
          );
        })()
      );
    }
    function nt(t) {
      return (nt =
        "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
          ? function (t) {
              return typeof t;
            }
          : function (t) {
              return t &&
                "function" == typeof Symbol &&
                t.constructor === Symbol &&
                t !== Symbol.prototype
                ? "symbol"
                : typeof t;
            })(t);
    }
    function rt(t, e) {
      for (var n = 0; n < e.length; n++) {
        var r = e[n];
        (r.enumerable = r.enumerable || !1),
          (r.configurable = !0),
          "value" in r && (r.writable = !0),
          Object.defineProperty(t, r.key, r);
      }
    }
    function at(t, e) {
      return !e || ("object" !== nt(e) && "function" != typeof e)
        ? (function (t) {
            if (void 0 !== t) return t;
            throw new ReferenceError(
              "this hasn't been initialised - super() hasn't been called"
            );
          })(t)
        : e;
    }
    function it(t) {
      return (it = Object.setPrototypeOf
        ? Object.getPrototypeOf
        : function (t) {
            return t.__proto__ || Object.getPrototypeOf(t);
          })(t);
    }
    function st(t, e) {
      return (st =
        Object.setPrototypeOf ||
        function (t, e) {
          return (t.__proto__ = e), t;
        })(t, e);
    }
    var ct = 50,
      lt = /[+-]?\d+(\.\d+)?/g,
      ut = (function (t) {
        function o(t, e, n) {
          var r;
          return (
            (function (t, e) {
              if (!(t instanceof e))
                throw new TypeError("Cannot call a class as a function");
            })(this, o),
            (r = at(this, it(o).call(this, t, n))).enable(e),
            r
          );
        }
        var e, n, r;
        return (
          (function (t, e) {
            if ("function" != typeof e && null !== e)
              throw new TypeError(
                "Super expression must either be null or a function"
              );
            (t.prototype = Object.create(e && e.prototype, {
              constructor: { value: t, writable: !0, configurable: !0 },
            })),
              e && st(t, e);
          })(o, d),
          (e = o),
          (n = [
            {
              key: "_init",
              value: function (t) {
                (function (t) {
                  var e = this.storage,
                    i = e.showHandles,
                    n = e.container,
                    r = Q("g");
                  [["class", "removeID"]].forEach(function (t) {
                    r.setAttribute(t[0], t[1]);
                  });
                  n.appendChild(r);
                  var o = t.getBBox(),
                    a = o.width,
                    s = o.height,
                    c = o.x,
                    l = o.y,
                    u = ot(t, n),
                    h = Q("rect");
                  [
                    ["width", a],
                    ["height", s],
                    ["x", c],
                    ["y", l],
                    ["fill", "rgba(0, 168, 255, 0.2)"],
                    ["stroke", "#00a8ff"],
                    ["stroke-dasharray", "3 3"],
                    ["vector-effect", "non-scaling-stroke"],
                    ["transform", J(u)],
                  ].forEach(function (t) {
                    h.setAttribute(t[0], t[1]);
                  });
                  var f = Q("g"),
                    p = Q("g"),
                    v = Q("g");
                  v.appendChild(h),
                    r.appendChild(v),
                    r.appendChild(p),
                    r.appendChild(f);
                  var d = h.getBBox(),
                    y = d.x,
                    m = d.y,
                    b = d.width,
                    g = d.height,
                    x = ot(h, h.parentNode),
                    _ = {
                      tl: Ot(x, n, y, m),
                      tr: Ot(x, n, y + b, m),
                      br: Ot(x, n, y + b, m + g),
                      bl: Ot(x, n, y, m + g),
                      tc: Ot(x, n, y + b / 2, m),
                      bc: Ot(x, n, y + b / 2, m + g),
                      ml: Ot(x, n, y, m + g / 2),
                      mr: Ot(x, n, y + b, m + g / 2),
                      rotator: {},
                    },
                    w = Math.atan2(_.tl.y - _.tr.y, _.tl.x - _.tr.x);
                  (_.rotator.x = _.mr.x - ct * Math.cos(w)),
                    (_.rotator.y = _.mr.y - ct * Math.sin(w));
                  var k = Q("line");
                  i &&
                    ((k.x1.baseVal.value = _.mr.x),
                    (k.y1.baseVal.value = _.mr.y),
                    (k.x2.baseVal.value = _.rotator.x),
                    (k.y2.baseVal.value = _.rotator.y),
                    k.setAttribute("stroke", "#00a8ff"),
                    k.setAttribute("stroke-dasharray", "3 3"),
                    k.setAttribute("vector-effect", "non-scaling-stroke"),
                    p.appendChild(k));
                  Object.keys(_).forEach(function (t) {
                    var e,
                      n,
                      r,
                      o,
                      a = _[t];
                    (_[t] =
                      ((e = a.x),
                      (n = a.y),
                      (r = Q("circle")),
                      (o = {
                        cx: e,
                        cy: n,
                        r: "5",
                        fill: "rgba(0, 168, 255, 0.2)",
                        stroke: "#00a8ff",
                        "vector-effect": "non-scaling-stroke",
                      }),
                      Object.keys(o).map(function (t) {
                        r.setAttribute(t, o[t]);
                      }),
                      r)),
                      i && f.appendChild(_[t]);
                  }),
                    Object.assign(e, {
                      wrapper: r,
                      box: h,
                      handles: _,
                      normalLine: k,
                      parent: t.parentNode,
                    }),
                    T(r)
                      .on("mousedown", this._onMouseDown)
                      .on("touchstart", this._onTouchStart);
                }).call(this, t);
              },
            },
            {
              key: "_destroy",
              value: function (t) {
                (function () {
                  var t = this.storage,
                    e = t.wrapper,
                    n = t.container;
                  T(e)
                    .off("mousedown", this._onMouseDown)
                    .off("touchstart", this._onTouchStart),
                    n.removeChild(e);
                }).call(this, t);
              },
            },
            {
              key: "_drag",
              value: function () {
                vt.call.apply(
                  vt,
                  [this].concat(Array.prototype.slice.call(arguments))
                );
              },
            },
            {
              key: "_rotate",
              value: function () {
                dt.call.apply(
                  dt,
                  [this].concat(Array.prototype.slice.call(arguments))
                );
              },
            },
            {
              key: "_resize",
              value: function () {
                pt.call.apply(
                  pt,
                  [this].concat(Array.prototype.slice.call(arguments))
                );
              },
            },
            {
              key: "_compute",
              value: function () {
                return ht.call.apply(
                  ht,
                  [this].concat(Array.prototype.slice.call(arguments))
                );
              },
            },
            {
              key: "_cursorPoint",
              value: function (t) {
                var e = this.storage.container;
                return Ot(e.getScreenCTM().inverse(), e, t.clientX, t.clientY);
              },
            },
            {
              key: "_pointToElement",
              value: function (t) {
                var e = this.storage,
                  n = e.transform,
                  r = e.container,
                  o = t.x,
                  a = t.y,
                  i = n.ctm.inverse(),
                  s = r.createSVGPoint();
                return (
                  (s.x = o), (s.y = a), (i.e = i.f = 0), s.matrixTransform(i)
                );
              },
            },
            {
              key: "_apply",
              value: function (t) {
                var i = this.el,
                  e = this.storage,
                  s = e.container,
                  n = e.box,
                  r = e.handles,
                  o = e.normalLine,
                  a = e.cached,
                  c = e.transform;
                if (!P(a)) {
                  var l = a.scaleX,
                    u = a.scaleY,
                    h = a.dx,
                    f = a.dy,
                    p = a.ox,
                    v = a.oy,
                    d = c.matrix;
                  if ("drag" === t) {
                    if (0 === h && 0 === f) return;
                    var y = Z();
                    (y.e = h), (y.f = f);
                    var m = y.multiply(d).multiply(y.inverse());
                    if ((i.setAttribute("transform", J(m)), gt(i)))
                      xt(i).forEach(function (t) {
                        var e = s.createSVGPoint(),
                          n = ot(i.parentNode, s).inverse();
                        (e.x = p), (e.y = v), (n.e = n.f = 0);
                        var r = e.matrixTransform(n),
                          o = Z();
                        (o.e = h), (o.f = f);
                        var a = o
                          .multiply(ot(t, t.parentNode))
                          .multiply(o.inverse());
                        t.setAttribute("transform", J(a)),
                          gt(t) || yt(t, { x: r.x, y: r.y });
                      });
                    else yt(i, { x: h, y: f });
                  }
                  if ("resize" === t) {
                    var b = n.getBBox();
                    if (
                      (bt(
                        n,
                        r,
                        o,
                        { x: b.x, y: b.y, width: b.width, height: b.height },
                        s
                      ),
                      gt(i))
                    )
                      xt(i).forEach(function (t) {
                        gt(t) ||
                          mt(t, {
                            scaleX: l,
                            scaleY: u,
                            defaultCTM: t.__ctm__,
                            bBox: c.bBox,
                            container: s,
                            storage: e,
                          });
                      });
                    else
                      mt(i, {
                        scaleX: l,
                        scaleY: u,
                        defaultCTM: c.ctm,
                        bBox: c.bBox,
                        container: s,
                        storage: e,
                      });
                    i.setAttribute("transform", J(d));
                  }
                  this.storage.cached = null;
                }
              },
            },
            {
              key: "onGetState",
              value: function (t) {
                var e = this.storage,
                  n = ft.call(this, t);
                Object.keys(n).forEach(function (t) {
                  e[t] = n[t];
                });
              },
            },
          ]) && rt(e.prototype, n),
          r && rt(e, r),
          o
        );
      })();
    function ht(t) {
      var e = this.storage.handles,
        n = T(t.target),
        r = n.is(e.tl) || n.is(e.ml) || n.is(e.bl) || n.is(e.tc),
        o = n.is(e.tl) || n.is(e.tr) || n.is(e.tc) || n.is(e.ml),
        a = n.is(e.tl) || n.is(e.tc) || n.is(e.tr),
        i = n.is(e.tl) || n.is(e.ml) || n.is(e.bl),
        s = n.is(e.tr) || n.is(e.mr) || n.is(e.br),
        c = n.is(e.br) || n.is(e.bc) || n.is(e.bl),
        l = ft.call(this, { revX: r, revY: o }),
        u = this._cursorPoint(t),
        h = u.x,
        f = u.y,
        p = Math.atan2(f - l.center.y, h - l.center.x);
      return (
        (l.onTopEdge = a),
        (l.onLeftEdge = i),
        (l.onRightEdge = s),
        (l.onBottomEdge = c),
        (l.handle = n),
        (l.pressang = p),
        l
      );
    }
    function ft(t) {
      var e = t.revX,
        n = t.revY,
        r = this.el,
        o = this.storage,
        a = o.container,
        i = o.box,
        s = o.wrapper,
        c = o.parent,
        l = this.el.getBBox(),
        u = l.x,
        h = l.y,
        f = l.width,
        p = l.height,
        v = i.getBBox(),
        d = v.width,
        y = v.height,
        m = v.x,
        b = v.y,
        g = ot(r, c),
        x = i.parentNode,
        _ = {
          matrix: g,
          ctm: ot(r, a),
          wrapperMatrix: ot(s, s.parentNode),
          boxCTM: ot(x, a),
          boxMatrix: ot(x, x.parentNode),
          parentMatrix: ot(c, a),
          trMatrix: Z(),
          scMatrix: Z(),
          rotMatrix: Z(),
          scaleX: e ? f + u : u,
          scaleY: n ? p + h : h,
          bBox: l,
        },
        w = d / 2,
        k = y / 2,
        M = Ot(ot(i, a), a, m + w, b + k),
        T = Ot(g, a, u + f / 2, h + p / 2);
      return (
        xt(r).forEach(function (t) {
          t.__ctm__ = ot(t, a);
        }),
        {
          transform: _,
          cw: d,
          ch: y,
          center: { x: M.x, y: M.y, el_x: T.x, el_y: T.y },
          left: m,
          top: b,
          revX: e,
          revY: n,
        }
      );
    }
    function pt(t, e) {
      var n = this.storage,
        r = n.container,
        o = n.box,
        a = n.handles,
        i = n.normalLine,
        s = n.left,
        c = n.top,
        l = n.cw,
        u = n.ch,
        h = n.transform,
        f = n.revX,
        p = n.revY,
        v = h.matrix,
        d = h.scMatrix,
        y = h.trMatrix,
        m = h.scaleX,
        b = h.scaleY,
        g = this.el,
        x = o.getBBox(),
        _ = x.width,
        w = x.height;
      if (((_ = l + t), (w = u + e), !(Math.abs(_) < 2 || Math.abs(w) < 2))) {
        var k = _ / l,
          M = w / u;
        (d.a = k),
          (d.b = 0),
          (d.c = 0),
          (d.d = M),
          (d.e = 0),
          (d.f = 0),
          (y.e = m),
          (y.f = b);
        var T = v.multiply(y).multiply(d).multiply(y.inverse());
        g.setAttribute("transform", J(T)),
          (this.storage.cached = { scaleX: k, scaleY: M }),
          bt(
            o,
            a,
            i,
            { x: f ? s - t : s, y: p ? c - e : c, width: _, height: w },
            r
          );
      }
    }
    function vt(t, e) {
      var n = this.storage,
        r = n.container,
        o = n.transform,
        a = n.wrapper,
        i = o.matrix,
        s = o.trMatrix,
        c = o.scMatrix,
        l = o.wrapperMatrix,
        u = o.parentMatrix;
      (c.e = t), (c.f = e);
      var h = c.multiply(l);
      a.setAttribute("transform", J(h)), (u.e = u.f = 0);
      var f = Ot(u.inverse(), r, t, e),
        p = f.x,
        v = f.y;
      (s.e = p), (s.f = v);
      var d = s.multiply(i);
      this.el.setAttribute("transform", J(d)),
        (this.storage.cached = { dx: p, dy: v, ox: t, oy: e });
    }
    function dt(t) {
      var e = this.storage,
        n = e.center,
        r = e.transform,
        o = e.wrapper,
        a = r.matrix,
        i = r.wrapperMatrix,
        s = r.parentMatrix,
        c = r.trMatrix,
        l = r.scMatrix,
        u = r.rotMatrix,
        h = b(Math.cos(t)),
        f = b(Math.sin(t));
      (c.e = n.x), (c.f = n.y), (u.a = h), (u.b = f), (u.c = -f), (u.d = h);
      var p = c.multiply(u).multiply(c.inverse()).multiply(i);
      o.setAttribute("transform", J(p)),
        (l.e = n.el_x),
        (l.f = n.el_y),
        (s.e = s.f = 0);
      var v = s.inverse().multiply(u).multiply(s),
        d = l.multiply(v).multiply(l.inverse()).multiply(a);
      this.el.setAttribute("transform", J(d));
    }
    function yt(e, t) {
      var n = t.x,
        r = t.y,
        o = [];
      switch (e.tagName.toLowerCase()) {
        case "use":
        case "image":
        case "text":
        case "rect":
          var a = Number(e.getAttribute("x")) + n,
            i = Number(e.getAttribute("y")) + r;
          o.push(["x", a], ["y", i]);
          break;
        case "circle":
        case "ellipse":
          var s = Number(e.getAttribute("cx")) + n,
            c = Number(e.getAttribute("cy")) + r;
          o.push(["cx", s], ["cy", c]);
          break;
        case "line":
          var l = Number(e.getAttribute("x1")) + n,
            u = Number(e.getAttribute("y1")) + r,
            h = Number(e.getAttribute("x2")) + n,
            f = Number(e.getAttribute("y2")) + r;
          o.push(["x1", l], ["y1", u], ["x2", h], ["y2", f]);
          break;
        case "polygon":
        case "polyline":
          var p = _t(e.getAttribute("points"))
            .map(function (t) {
              return (
                (t[0] = Number(t[0]) + n),
                (t[1] = Number(t[1]) + r),
                t.join(" ")
              );
            })
            .join(" ");
          o.push(["points", p]);
          break;
        case "path":
          var v = e.getAttribute("d");
          o.push([
            "d",
            (function (t) {
              var e = t.path,
                n = t.dx,
                r = t.dy;
              try {
                for (
                  var o = Ct(e), a = "", i = !0, s = 0, c = o.length;
                  s < c;
                  s++
                ) {
                  var l = o[s],
                    u = l.value,
                    h = l.key,
                    f = l.relative,
                    p = [];
                  switch (h) {
                    case "M":
                      for (var v = 0, d = u.length; v < d; v += 2) {
                        var y = Pt(u.slice(v, v + 2), 2),
                          m = y[0],
                          b = y[1];
                        (f && !i) || ((m += n), (b += r)),
                          p.push(m, b),
                          (i = !1);
                      }
                      break;
                    case "A":
                      for (var g = 0, x = u.length; g < x; g += 7) {
                        var _ = u.slice(g, g + 7);
                        f || ((_[5] = _[5] + n), (_[6] = _[6] + r)),
                          p.push.apply(p, W(_));
                      }
                      break;
                    case "C":
                      for (var w = 0, k = u.length; w < k; w += 6) {
                        var M = u.slice(w, w + 6);
                        f ||
                          ((M[0] = M[0] + n),
                          (M[1] = M[1] + r),
                          (M[2] = M[2] + n),
                          (M[3] = M[3] + r),
                          (M[4] = M[4] + n),
                          (M[5] = M[5] + r)),
                          p.push.apply(p, W(M));
                      }
                      break;
                    case "H":
                      for (var T = 0, E = u.length; T < E; T += 1) {
                        var S = u.slice(T, T + 1);
                        f || (S[0] += n), p.push(S[0]);
                      }
                      break;
                    case "V":
                      for (var A = 0, O = u.length; A < O; A += 1) {
                        var j = u.slice(A, A + 1);
                        f || (j[0] += r), p.push(j[0]);
                      }
                      break;
                    case "L":
                    case "T":
                      for (var P = 0, C = u.length; P < C; P += 2) {
                        var N = Pt(u.slice(P, P + 2), 2);
                        (m = N[0]),
                          (b = N[1]),
                          f || ((m += n), (b += r)),
                          p.push(m, b);
                      }
                      break;
                    case "Q":
                    case "S":
                      for (var V = 0, z = u.length; V < z; V += 4) {
                        var D = Pt(u.slice(V, V + 4), 4),
                          X = D[0],
                          Y = D[1],
                          L = D[2],
                          B = D[3];
                        f || ((X += n), (Y += r), (L += n), (B += r)),
                          p.push(X, Y, L, B);
                      }
                      break;
                    case "Z":
                      u[0] = "";
                  }
                  a += l.cmd + p.join(",") + " ";
                }
                return a;
              } catch (t) {
                At("Path parsing error: " + t);
              }
            })({ path: v, dx: n, dy: r }),
          ]);
      }
      o.forEach(function (t) {
        e.setAttribute(t[0], t[1]);
      });
    }
    function mt(e, t) {
      var n = t.scaleX,
        r = t.scaleY,
        o = t.bBox,
        a = t.defaultCTM,
        i = t.container,
        s = o.width,
        c = o.height,
        l = [],
        u = ot(e, i),
        h = a.inverse().multiply(u);
      switch (e.tagName.toLowerCase()) {
        case "text":
          var f = e.x.baseVal.value,
            p = e.y.baseVal.value,
            v = Ot(h, i, f, p),
            d = v.x,
            y = v.y;
          l.push(["x", d + (n < 0 ? s : 0)], ["y", y + (r < 0 ? c : 0)]);
          break;
        case "circle":
          var m = e.r.baseVal.value,
            b = e.cx.baseVal.value,
            g = e.cy.baseVal.value,
            x = (m * (Math.abs(n) + Math.abs(r))) / 2,
            _ = Ot(h, i, b, g),
            w = _.x,
            k = _.y;
          l.push(["r", x], ["cx", w], ["cy", k]);
          break;
        case "image":
        case "rect":
          var M = e.width.baseVal.value,
            T = e.height.baseVal.value,
            E = e.x.baseVal.value,
            S = e.y.baseVal.value,
            A = Ot(h, i, E, S),
            O = A.x,
            j = A.y;
          h.e = h.f = 0;
          var P = Ot(h, i, M, T),
            C = P.x,
            N = P.y,
            V = Math.abs(C),
            z = Math.abs(N);
          l.push(
            ["x", O - (n < 0 ? V : 0)],
            ["y", j - (r < 0 ? z : 0)],
            ["width", V],
            ["height", z]
          );
          break;
        case "ellipse":
          var D = e.rx.baseVal.value,
            X = e.ry.baseVal.value,
            Y = e.cx.baseVal.value,
            L = e.cy.baseVal.value,
            B = Ot(h, i, Y, L),
            F = B.x,
            R = B.y;
          h.e = h.f = 0;
          var I = Ot(h, i, D, X),
            U = I.x,
            q = I.y;
          l.push(
            ["rx", Math.abs(U)],
            ["ry", Math.abs(q)],
            ["cx", F],
            ["cy", R]
          );
          break;
        case "line":
          var G = e.x1.baseVal.value,
            H = e.y1.baseVal.value,
            K = e.x2.baseVal.value,
            Q = e.y2.baseVal.value,
            Z = Ot(h, i, G, H),
            J = Z.x,
            W = Z.y,
            $ = Ot(h, i, K, Q),
            tt = $.x,
            et = $.y;
          l.push(["x1", J], ["y1", W], ["x2", tt], ["y2", et]);
          break;
        case "polygon":
        case "polyline":
          var nt = _t(e.getAttribute("points"))
            .map(function (t) {
              var e = Ot(h, i, Number(t[0]), Number(t[1])),
                n = e.x,
                r = e.y;
              return (t[0] = n), (t[1] = r), t.join(" ");
            })
            .join(" ");
          l.push(["points", nt]);
          break;
        case "path":
          var rt = e.getAttribute("d");
          l.push([
            "d",
            (function (t) {
              var e = t.path,
                n = t.localCTM,
                r = t.container;
              try {
                for (
                  var o = Ct(e), a = "", i = [], s = !0, c = 0, l = o.length;
                  c < l;
                  c++
                ) {
                  var u = o[c],
                    h = u.value,
                    f = u.key,
                    p = u.relative;
                  switch (f) {
                    case "A":
                      for (var v = [], d = 0, y = h.length; d < y; d += 7) {
                        var m = Pt(h.slice(d, d + 7), 7),
                          b = m[0],
                          g = m[1],
                          x = m[2],
                          _ = m[3],
                          w = m[4],
                          k = m[5],
                          M = m[6],
                          T = jt(n);
                        p && (T.e = T.f = 0);
                        var E = Ot(T, r, k, M),
                          S = E.x,
                          A = E.y;
                        v.push(S, A), (T.e = T.f = 0);
                        var O = Ot(T, r, b, g),
                          j = O.x,
                          P = O.y;
                        v.unshift(j, P, x, _, w);
                      }
                      i.push(v);
                      break;
                    case "C":
                      for (var C = [], N = 0, V = h.length; N < V; N += 6) {
                        var z = Pt(h.slice(N, N + 6), 6),
                          D = z[0],
                          X = z[1],
                          Y = z[2],
                          L = z[3],
                          B = ((k = z[4]), (M = z[5]), jt(n));
                        p && (B.e = B.f = 0);
                        var F = Ot(B, r, D, X),
                          R = F.x,
                          I = F.y,
                          U = Ot(B, r, Y, L),
                          q = U.x,
                          G = U.y,
                          H = Ot(B, r, k, M);
                        (S = H.x), (A = H.y), C.push(R, I, q, G, S, A);
                      }
                      i.push(C);
                      break;
                    case "H":
                      for (var K = [], Q = 0, Z = h.length; Q < Z; Q += 1) {
                        k = Pt(h.slice(Q, Q + 1), 1)[0];
                        var J = jt(n);
                        p && (J.e = J.f = 0), (S = Ot(J, r, k, 0).x), K.push(S);
                      }
                      i.push(K);
                      break;
                    case "V":
                      for (var W = [], $ = 0, tt = h.length; $ < tt; $ += 1) {
                        M = Pt(h.slice($, $ + 1), 1)[0];
                        var et = jt(n);
                        p && (et.e = et.f = 0),
                          (A = Ot(et, r, 0, M).y),
                          W.push(A);
                      }
                      i.push(W);
                      break;
                    case "T":
                    case "L":
                      for (
                        var nt = [], rt = 0, ot = h.length;
                        rt < ot;
                        rt += 2
                      ) {
                        var at = Pt(h.slice(rt, rt + 2), 2),
                          it = ((k = at[0]), (M = at[1]), jt(n));
                        p && (it.e = it.f = 0);
                        var st = Ot(it, r, k, M);
                        (S = st.x), (A = st.y), nt.push(S, A);
                      }
                      i.push(nt);
                      break;
                    case "M":
                      for (
                        var ct = [], lt = 0, ut = h.length;
                        lt < ut;
                        lt += 2
                      ) {
                        var ht = Pt(h.slice(lt, lt + 2), 2),
                          ft = ((k = ht[0]), (M = ht[1]), jt(n));
                        p && !s && (ft.e = ft.f = 0);
                        var pt = Ot(ft, r, k, M);
                        (S = pt.x), (A = pt.y), ct.push(S, A), (s = !1);
                      }
                      i.push(ct);
                      break;
                    case "Q":
                      for (
                        var vt = [], dt = 0, yt = h.length;
                        dt < yt;
                        dt += 4
                      ) {
                        var mt = Pt(h.slice(dt, dt + 4), 4),
                          bt =
                            ((D = mt[0]),
                            (X = mt[1]),
                            (k = mt[2]),
                            (M = mt[3]),
                            jt(n));
                        p && (bt.e = bt.f = 0);
                        var gt = Ot(bt, r, D, X),
                          xt = ((R = gt.x), (I = gt.y), Ot(bt, r, k, M));
                        (S = xt.x), (A = xt.y), vt.push(R, I, S, A);
                      }
                      i.push(vt);
                      break;
                    case "S":
                      for (
                        var _t = [], wt = 0, kt = h.length;
                        wt < kt;
                        wt += 4
                      ) {
                        var Mt = Pt(h.slice(wt, wt + 4), 4),
                          Tt =
                            ((Y = Mt[0]),
                            (L = Mt[1]),
                            (k = Mt[2]),
                            (M = Mt[3]),
                            jt(n));
                        p && (Tt.e = Tt.f = 0);
                        var Et = Ot(Tt, r, Y, L),
                          St = ((q = Et.x), (G = Et.y), Ot(n, r, k, M));
                        (S = St.x), (A = St.y), _t.push(q, G, S, A);
                      }
                      i.push(_t);
                      break;
                    case "Z":
                      i.push([""]);
                  }
                  a += u.cmd + i[c].join(",") + " ";
                }
                return a;
              } catch (t) {
                At("Path parsing error: " + t);
              }
            })({ path: rt, localCTM: h, container: i }),
          ]);
      }
      l.forEach(function (t) {
        e.setAttribute(t[0], t[1]);
      });
    }
    function bt(e, n, t, r, o) {
      var a = r.x,
        i = r.y,
        s = r.width,
        c = r.height,
        l = s / 2,
        u = c / 2,
        h = ot(e, e.parentNode.parentNode),
        f = {
          tl: Ot(h, o, a, i),
          tr: Ot(h, o, a + s, i),
          br: Ot(h, o, a + s, i + c),
          bl: Ot(h, o, a, i + c),
          tc: Ot(h, o, a + l, i),
          bc: Ot(h, o, a + l, i + c),
          ml: Ot(h, o, a, i + u),
          mr: Ot(h, o, a + s, i + u),
          rotator: {},
        },
        p = Math.atan2(f.tl.y - f.tr.y, f.tl.x - f.tr.x);
      (f.rotator.x = f.mr.x - ct * Math.cos(p)),
        (f.rotator.y = f.mr.y - ct * Math.sin(p)),
        (t.x1.baseVal.value = f.mr.x),
        (t.y1.baseVal.value = f.mr.y),
        (t.x2.baseVal.value = f.rotator.x),
        (t.y2.baseVal.value = f.rotator.y);
      var v = {
        x: (a += s < 0 ? s : 0),
        y: (i += c < 0 ? c : 0),
        width: Math.abs(s),
        height: Math.abs(c),
      };
      Object.keys(v).forEach(function (t) {
        e.setAttribute(t, v[t]);
      }),
        Object.keys(n).forEach(function (t) {
          var e = n[t];
          e.setAttribute("cx", f[t].x), e.setAttribute("cy", f[t].y);
        });
    }
    function gt(t) {
      return "g" === t.tagName.toLowerCase();
    }
    function xt(t) {
      var n = [];
      return (
        gt(t)
          ? t.childNodes.forEach(function (t) {
              if (1 === t.nodeType) {
                var e = t.tagName.toLowerCase();
                -1 !== K.indexOf(e) &&
                  ("g" === e && n.push.apply(n, et(xt(t))), n.push(t));
              }
            })
          : n.push(t),
        n
      );
    }
    function _t(t) {
      return t.match(lt).reduce(function (t, e, n, r) {
        return n % 2 == 0 && t.push(r.slice(n, n + 2)), t;
      }, []);
    }
    function wt(r) {
      if (this.length) {
        var o = new l();
        return s.call(
          this,
          function (t, e) {
            var n;
            return (
              e instanceof SVGElement
                ? ((n = e.tagName.toLowerCase()),
                  (-1 !== K.indexOf(n) ||
                    (At(
                      "Selected element is not allowed to transform. Allowed elements:\ncircle, ellipse, image, line, path, polygon, polyline, rect, text, g"
                    ),
                    0)) &&
                    t.push(new ut(e, r, o)))
                : t.push(new L(e, r, o)),
              t
            );
          },
          []
        );
      }
    }
    function kt(t) {
      return (kt =
        "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
          ? function (t) {
              return typeof t;
            }
          : function (t) {
              return t &&
                "function" == typeof Symbol &&
                t.constructor === Symbol &&
                t !== Symbol.prototype
                ? "symbol"
                : typeof t;
            })(t);
    }
    function Mt(t, e) {
      for (var n = 0; n < e.length; n++) {
        var r = e[n];
        (r.enumerable = r.enumerable || !1),
          (r.configurable = !0),
          "value" in r && (r.writable = !0),
          Object.defineProperty(t, r.key, r);
      }
    }
    var Tt = (function () {
      function n(t, e) {
        !(function (t, e) {
          if (!(t instanceof e))
            throw new TypeError("Cannot call a class as a function");
        })(this, n),
          (this.el = t),
          (this.options = e || {}),
          (this.storage = null),
          (this._onMouseDown = this._onMouseDown.bind(this)),
          (this._onTouchStart = this._onTouchStart.bind(this)),
          (this._onMouseMove = this._onMouseMove.bind(this)),
          (this._onTouchMove = this._onTouchMove.bind(this)),
          (this._onMouseUp = this._onMouseUp.bind(this)),
          (this._onTouchEnd = this._onTouchEnd.bind(this)),
          (this._animate = this._animate.bind(this)),
          this.enable();
      }
      var t, e, r;
      return (
        (t = n),
        (e = [
          {
            key: "enable",
            value: function () {
              P(this.storage) ? this._init() : At("Already enabled");
            },
          },
          {
            key: "disable",
            value: function () {
              _destroy.call(this);
            },
          },
          {
            key: "_init",
            value: function () {
              var t = T(this.el),
                e = this.options,
                n = e.style,
                f = e.drop,
                r = e.appendTo,
                o = e.stack,
                a = { position: "absolute", "z-index": "2147483647" };
              k(n) && "object" === kt(n) && Object.assign(a, n);
              var p = k(o) ? T(o)[0] : document,
                i = M(f)
                  ? function (t) {
                      var e,
                        n,
                        r,
                        o,
                        a,
                        i,
                        s,
                        c,
                        l,
                        u,
                        h = this.storage.clone;
                      ((n = p),
                      (r = w((e = h))),
                      (o = r.top),
                      (a = r.left),
                      (i = w(n)),
                      (s = i.top),
                      (c = i.left),
                      (l = T(e)),
                      (u = T(n)),
                      !(
                        o < s ||
                        o + parseFloat(l.css("height")) >
                          s + parseFloat(u.css("height")) ||
                        a < c ||
                        a + parseFloat(l.css("width")) >
                          c + parseFloat(u.css("width"))
                      )) && f.call(this, t, this.el, h);
                    }
                  : function () {};
              (this.storage = {
                onDrop: i,
                options: this.options,
                css: a,
                parent: T(r)[0] || document.body,
                stack: p,
              }),
                t
                  .on("mousedown", this._onMouseDown)
                  .on("touchstart", this._onTouchStart);
            },
          },
          {
            key: "_start",
            value: function (t) {
              t.stopImmediatePropagation && t.stopImmediatePropagation();
              var e = this.storage,
                n = this.el,
                r = e.parent,
                o = e.css,
                a = w(r),
                i = t.clientX,
                s = t.clientY;
              (o.left = "".concat(i - a.left, "px")),
                (o.top = "".concat(s - a.top, "px"));
              var c = n.cloneNode(!0);
              T(c).css(o),
                (e.clientX = i),
                (e.clientY = s),
                (e.cx = i),
                (e.cy = s),
                (e.clone = c),
                T(r)[0].appendChild(c),
                this._draw();
            },
          },
          {
            key: "_move",
            value: function (t) {
              t.preventDefault && t.preventDefault();
              var e = this.storage;
              (e.clientX = t.clientX),
                (e.clientY = t.clientY),
                (e.doDraw = !0),
                (e.doMove = !0);
            },
          },
          {
            key: "_end",
            value: function (t) {
              t.stopImmediatePropagation && t.stopImmediatePropagation();
              var e = this.storage,
                n = e.clone,
                r = e.frameId,
                o = e.onDrop;
              (e.doDraw = !1),
                a(r),
                P(n) ||
                  (o.call(this, t),
                  n.parentNode.removeChild(n),
                  delete e.clone);
            },
          },
          {
            key: "_draw",
            value: function () {
              this._animate();
            },
          },
          {
            key: "_animate",
            value: function () {
              var t = this.storage;
              t.frameId = j(this._animate);
              var e = t.doDraw,
                n = t.clientX,
                r = t.clientY,
                o = t.cx,
                a = t.cy,
                i = t.clone;
              if (e) {
                t.doDraw = !1;
                var s = "translate(".concat(n - o, "px, ").concat(r - a, "px)");
                T(i).css({
                  transform: s,
                  webkitTranform: s,
                  mozTransform: s,
                  msTransform: s,
                  otransform: s,
                });
              }
            },
          },
          {
            key: "_destroy",
            value: function () {
              P(this.storage) ||
                (T(this.el)
                  .off("mousedown", this._onMouseDown)
                  .off("touchstart", this._onTouchStart),
                delete this.storage);
            },
          },
          {
            key: "_onMouseDown",
            value: function (t) {
              this._start(t),
                T(document)
                  .on("mousemove", this._onMouseMove)
                  .on("mouseup", this._onMouseUp);
            },
          },
          {
            key: "_onMouseMove",
            value: function (t) {
              this._move(t);
            },
          },
          {
            key: "_onMouseUp",
            value: function (t) {
              this._end(t),
                T(document)
                  .off("mousemove", this._onMouseMove)
                  .off("mouseup", this._onMouseUp);
            },
          },
          {
            key: "_onTouchStart",
            value: function (t) {
              this._start(t.touches[0]),
                T(document)
                  .on("touchmove", this._onTouchMove)
                  .on("touchend", this._onTouchEnd);
            },
          },
          {
            key: "_onTouchMove",
            value: function (t) {
              this._move(t.touches[0]);
            },
          },
          {
            key: "_onTouchEnd",
            value: function (t) {
              0 === t.touches.length && this._end(t.changedTouches[0]),
                T(document)
                  .off("touchmove", this._onTouchMove)
                  .off("touchend", this._onTouchEnd);
            },
          },
        ]) && Mt(t.prototype, e),
        r && Mt(t, r),
        n
      );
    })();
    function Et(t) {
      return (Et =
        "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
          ? function (t) {
              return typeof t;
            }
          : function (t) {
              return t &&
                "function" == typeof Symbol &&
                t.constructor === Symbol &&
                t !== Symbol.prototype
                ? "symbol"
                : typeof t;
            })(t);
    }
    function St(t, e) {
      for (var n = 0; n < e.length; n++) {
        var r = e[n];
        (r.enumerable = r.enumerable || !1),
          (r.configurable = !0),
          "value" in r && (r.writable = !0),
          Object.defineProperty(t, r.key, r);
      }
    }
    function Nt(t, e) {
      return !e || ("object" !== Et(e) && "function" != typeof e)
        ? (function (t) {
            if (void 0 !== t) return t;
            throw new ReferenceError(
              "this hasn't been initialised - super() hasn't been called"
            );
          })(t)
        : e;
    }
    function Vt(t) {
      return (Vt = Object.setPrototypeOf
        ? Object.getPrototypeOf
        : function (t) {
            return t.__proto__ || Object.getPrototypeOf(t);
          })(t);
    }
    function zt(t, e) {
      return (zt =
        Object.setPrototypeOf ||
        function (t, e) {
          return (t.__proto__ = e), t;
        })(t, e);
    }
    /* @license
     * Move/Rotate/Resize tool
     * Released under the MIT license, 2018-2019
     * nichollascarter@gmail.com
     */ var Dt = (function (t) {
      function e(t) {
        return (
          (function (t, e) {
            if (!(t instanceof e))
              throw new TypeError("Cannot call a class as a function");
          })(this, e),
          Nt(this, Vt(e).call(this, t))
        );
      }
      var n, r, o;
      return (
        (function (t, e) {
          if ("function" != typeof e && null !== e)
            throw new TypeError(
              "Super expression must either be null or a function"
            );
          (t.prototype = Object.create(e && e.prototype, {
            constructor: { value: t, writable: !0, configurable: !0 },
          })),
            e && zt(t, e);
        })(e, h),
        (n = e),
        (r = [
          {
            key: "drag",
            value: function (t) {
              return wt.call(this, t);
            },
          },
          {
            key: "clone",
            value: function (t) {
              return function (e) {
                if (this.length)
                  return i.call(this, function (t) {
                    return new Tt(t, e);
                  });
              }.call(this, t);
            },
          },
        ]) && St(n.prototype, r),
        o && St(n, o),
        e
      );
    })();
    e.default = function (t) {
      return new Dt(t);
    };
  },
]).default;
//# sourceMappingURL=subjx.js.map
