UNPKG

yk-element-components-v2

Version:

1,076 lines 76.4 kB
var Di = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, We = {}, Ie = { exports: {} }; /*! * Cropper.js v1.5.13 * https://fengyuanchen.github.io/cropperjs * * Copyright 2015-present Chen Fengyuan * Released under the MIT license * * Date: 2022-11-20T05:30:46.114Z */ (function(s, h) { (function(m, v) { s.exports = v(); })(Di, function() { function m(a, t) { var i = Object.keys(a); if (Object.getOwnPropertySymbols) { var e = Object.getOwnPropertySymbols(a); t && (e = e.filter(function(o) { return Object.getOwnPropertyDescriptor(a, o).enumerable; })), i.push.apply(i, e); } return i; } function v(a) { for (var t = 1; t < arguments.length; t++) { var i = arguments[t] != null ? arguments[t] : {}; t % 2 ? m(Object(i), !0).forEach(function(e) { E(a, e, i[e]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(i)) : m(Object(i)).forEach(function(e) { Object.defineProperty(a, e, Object.getOwnPropertyDescriptor(i, e)); }); } return a; } function b(a) { return b = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) { return typeof t; } : function(t) { return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; }, b(a); } function N(a, t) { if (!(a instanceof t)) throw new TypeError("Cannot call a class as a function"); } function _(a, t) { for (var i = 0; i < t.length; i++) { var e = t[i]; e.enumerable = e.enumerable || !1, e.configurable = !0, "value" in e && (e.writable = !0), Object.defineProperty(a, e.key, e); } } function M(a, t, i) { return t && _(a.prototype, t), i && _(a, i), Object.defineProperty(a, "prototype", { writable: !1 }), a; } function E(a, t, i) { return t in a ? Object.defineProperty(a, t, { value: i, enumerable: !0, configurable: !0, writable: !0 }) : a[t] = i, a; } function L(a) { return dt(a) || Z(a) || z(a) || ut(); } function dt(a) { if (Array.isArray(a)) return tt(a); } function Z(a) { if (typeof Symbol < "u" && a[Symbol.iterator] != null || a["@@iterator"] != null) return Array.from(a); } function z(a, t) { if (!!a) { if (typeof a == "string") return tt(a, t); var i = Object.prototype.toString.call(a).slice(8, -1); if (i === "Object" && a.constructor && (i = a.constructor.name), i === "Map" || i === "Set") return Array.from(a); if (i === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)) return tt(a, t); } } function tt(a, t) { (t == null || t > a.length) && (t = a.length); for (var i = 0, e = new Array(t); i < t; i++) e[i] = a[i]; return e; } function ut() { throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`); } var pt = typeof window < "u" && typeof window.document < "u", Y = pt ? window : {}, at = pt && Y.document.documentElement ? "ontouchstart" in Y.document.documentElement : !1, gt = pt ? "PointerEvent" in Y : !1, T = "cropper", Ct = "all", mt = "crop", S = "move", G = "zoom", j = "e", K = "w", vt = "s", rt = "n", Dt = "ne", Tt = "nw", Mt = "se", Et = "sw", kt = "".concat(T, "-crop"), te = "".concat(T, "-disabled"), $ = "".concat(T, "-hidden"), ee = "".concat(T, "-hide"), $e = "".concat(T, "-invisible"), _t = "".concat(T, "-modal"), Lt = "".concat(T, "-move"), Ot = "".concat(T, "Action"), At = "".concat(T, "Preview"), zt = "crop", ie = "move", ae = "none", $t = "crop", Pt = "cropend", Xt = "cropmove", Yt = "cropstart", re = "dblclick", Pe = at ? "touchstart" : "mousedown", Xe = at ? "touchmove" : "mousemove", Ye = at ? "touchend touchcancel" : "mouseup", ne = gt ? "pointerdown" : Pe, oe = gt ? "pointermove" : Xe, se = gt ? "pointerup pointercancel" : Ye, he = "ready", ce = "resize", le = "wheel", jt = "zoom", fe = "image/jpeg", je = /^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/, Ue = /^data:/, Ve = /^data:image\/jpeg;base64,/, Fe = /^img|canvas$/i, de = 200, ue = 100, pe = { viewMode: 0, dragMode: zt, initialAspectRatio: NaN, aspectRatio: NaN, data: null, preview: "", responsive: !0, restore: !0, checkCrossOrigin: !0, checkOrientation: !0, modal: !0, guides: !0, center: !0, highlight: !0, background: !0, autoCrop: !0, autoCropArea: 0.8, movable: !0, rotatable: !0, scalable: !0, zoomable: !0, zoomOnTouch: !0, zoomOnWheel: !0, wheelZoomRatio: 0.1, cropBoxMovable: !0, cropBoxResizable: !0, toggleDragModeOnDblclick: !0, minCanvasWidth: 0, minCanvasHeight: 0, minCropBoxWidth: 0, minCropBoxHeight: 0, minContainerWidth: de, minContainerHeight: ue, ready: null, cropstart: null, cropmove: null, cropend: null, crop: null, zoom: null }, Ge = '<div class="cropper-container" touch-action="none"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-cropper-action="e"></span><span class="cropper-line line-n" data-cropper-action="n"></span><span class="cropper-line line-w" data-cropper-action="w"></span><span class="cropper-line line-s" data-cropper-action="s"></span><span class="cropper-point point-e" data-cropper-action="e"></span><span class="cropper-point point-n" data-cropper-action="n"></span><span class="cropper-point point-w" data-cropper-action="w"></span><span class="cropper-point point-s" data-cropper-action="s"></span><span class="cropper-point point-ne" data-cropper-action="ne"></span><span class="cropper-point point-nw" data-cropper-action="nw"></span><span class="cropper-point point-sw" data-cropper-action="sw"></span><span class="cropper-point point-se" data-cropper-action="se"></span></div></div>', qe = Number.isNaN || Y.isNaN; function y(a) { return typeof a == "number" && !qe(a); } var ge = function(t) { return t > 0 && t < 1 / 0; }; function Ut(a) { return typeof a > "u"; } function ht(a) { return b(a) === "object" && a !== null; } var Ze = Object.prototype.hasOwnProperty; function bt(a) { if (!ht(a)) return !1; try { var t = a.constructor, i = t.prototype; return t && i && Ze.call(i, "isPrototypeOf"); } catch { return !1; } } function P(a) { return typeof a == "function"; } var Ke = Array.prototype.slice; function me(a) { return Array.from ? Array.from(a) : Ke.call(a); } function A(a, t) { return a && P(t) && (Array.isArray(a) || y(a.length) ? me(a).forEach(function(i, e) { t.call(a, i, e, a); }) : ht(a) && Object.keys(a).forEach(function(i) { t.call(a, a[i], i, a); })), a; } var O = Object.assign || function(t) { for (var i = arguments.length, e = new Array(i > 1 ? i - 1 : 0), o = 1; o < i; o++) e[o - 1] = arguments[o]; return ht(t) && e.length > 0 && e.forEach(function(r) { ht(r) && Object.keys(r).forEach(function(n) { t[n] = r[n]; }); }), t; }, Qe = /\.\d*(?:0|9){12}\d*$/; function yt(a) { var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 1e11; return Qe.test(a) ? Math.round(a * t) / t : a; } var Je = /^width|height|left|top|marginLeft|marginTop$/; function nt(a, t) { var i = a.style; A(t, function(e, o) { Je.test(o) && y(e) && (e = "".concat(e, "px")), i[o] = e; }); } function ti(a, t) { return a.classList ? a.classList.contains(t) : a.className.indexOf(t) > -1; } function H(a, t) { if (!!t) { if (y(a.length)) { A(a, function(e) { H(e, t); }); return; } if (a.classList) { a.classList.add(t); return; } var i = a.className.trim(); i ? i.indexOf(t) < 0 && (a.className = "".concat(i, " ").concat(t)) : a.className = t; } } function Q(a, t) { if (!!t) { if (y(a.length)) { A(a, function(i) { Q(i, t); }); return; } if (a.classList) { a.classList.remove(t); return; } a.className.indexOf(t) >= 0 && (a.className = a.className.replace(t, "")); } } function wt(a, t, i) { if (!!t) { if (y(a.length)) { A(a, function(e) { wt(e, t, i); }); return; } i ? H(a, t) : Q(a, t); } } var ei = /([a-z\d])([A-Z])/g; function Vt(a) { return a.replace(ei, "$1-$2").toLowerCase(); } function Ft(a, t) { return ht(a[t]) ? a[t] : a.dataset ? a.dataset[t] : a.getAttribute("data-".concat(Vt(t))); } function Rt(a, t, i) { ht(i) ? a[t] = i : a.dataset ? a.dataset[t] = i : a.setAttribute("data-".concat(Vt(t)), i); } function ii(a, t) { if (ht(a[t])) try { delete a[t]; } catch { a[t] = void 0; } else if (a.dataset) try { delete a.dataset[t]; } catch { a.dataset[t] = void 0; } else a.removeAttribute("data-".concat(Vt(t))); } var ve = /\s\s*/, be = function() { var a = !1; if (pt) { var t = !1, i = function() { }, e = Object.defineProperty({}, "once", { get: function() { return a = !0, t; }, set: function(r) { t = r; } }); Y.addEventListener("test", i, e), Y.removeEventListener("test", i, e); } return a; }(); function q(a, t, i) { var e = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {}, o = i; t.trim().split(ve).forEach(function(r) { if (!be) { var n = a.listeners; n && n[r] && n[r][i] && (o = n[r][i], delete n[r][i], Object.keys(n[r]).length === 0 && delete n[r], Object.keys(n).length === 0 && delete a.listeners); } a.removeEventListener(r, o, e); }); } function V(a, t, i) { var e = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {}, o = i; t.trim().split(ve).forEach(function(r) { if (e.once && !be) { var n = a.listeners, c = n === void 0 ? {} : n; o = function() { delete c[r][i], a.removeEventListener(r, o, e); for (var d = arguments.length, l = new Array(d), f = 0; f < d; f++) l[f] = arguments[f]; i.apply(a, l); }, c[r] || (c[r] = {}), c[r][i] && a.removeEventListener(r, c[r][i], e), c[r][i] = o, a.listeners = c; } a.addEventListener(r, o, e); }); } function xt(a, t, i) { var e; return P(Event) && P(CustomEvent) ? e = new CustomEvent(t, { detail: i, bubbles: !0, cancelable: !0 }) : (e = document.createEvent("CustomEvent"), e.initCustomEvent(t, !0, !0, i)), a.dispatchEvent(e); } function ye(a) { var t = a.getBoundingClientRect(); return { left: t.left + (window.pageXOffset - document.documentElement.clientLeft), top: t.top + (window.pageYOffset - document.documentElement.clientTop) }; } var Gt = Y.location, ai = /^(\w+:)\/\/([^:/?#]*):?(\d*)/i; function we(a) { var t = a.match(ai); return t !== null && (t[1] !== Gt.protocol || t[2] !== Gt.hostname || t[3] !== Gt.port); } function xe(a) { var t = "timestamp=".concat(new Date().getTime()); return a + (a.indexOf("?") === -1 ? "?" : "&") + t; } function Nt(a) { var t = a.rotate, i = a.scaleX, e = a.scaleY, o = a.translateX, r = a.translateY, n = []; y(o) && o !== 0 && n.push("translateX(".concat(o, "px)")), y(r) && r !== 0 && n.push("translateY(".concat(r, "px)")), y(t) && t !== 0 && n.push("rotate(".concat(t, "deg)")), y(i) && i !== 1 && n.push("scaleX(".concat(i, ")")), y(e) && e !== 1 && n.push("scaleY(".concat(e, ")")); var c = n.length ? n.join(" ") : "none"; return { WebkitTransform: c, msTransform: c, transform: c }; } function ri(a) { var t = v({}, a), i = 0; return A(a, function(e, o) { delete t[o], A(t, function(r) { var n = Math.abs(e.startX - r.startX), c = Math.abs(e.startY - r.startY), p = Math.abs(e.endX - r.endX), d = Math.abs(e.endY - r.endY), l = Math.sqrt(n * n + c * c), f = Math.sqrt(p * p + d * d), u = (f - l) / l; Math.abs(u) > Math.abs(i) && (i = u); }); }), i; } function Bt(a, t) { var i = a.pageX, e = a.pageY, o = { endX: i, endY: e }; return t ? o : v({ startX: i, startY: e }, o); } function ni(a) { var t = 0, i = 0, e = 0; return A(a, function(o) { var r = o.startX, n = o.startY; t += r, i += n, e += 1; }), t /= e, i /= e, { pageX: t, pageY: i }; } function ot(a) { var t = a.aspectRatio, i = a.height, e = a.width, o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "contain", r = ge(e), n = ge(i); if (r && n) { var c = i * t; o === "contain" && c > e || o === "cover" && c < e ? i = e / t : e = i * t; } else r ? i = e / t : n && (e = i * t); return { width: e, height: i }; } function oi(a) { var t = a.width, i = a.height, e = a.degree; if (e = Math.abs(e) % 180, e === 90) return { width: i, height: t }; var o = e % 90 * Math.PI / 180, r = Math.sin(o), n = Math.cos(o), c = t * n + i * r, p = t * r + i * n; return e > 90 ? { width: p, height: c } : { width: c, height: p }; } function si(a, t, i, e) { var o = t.aspectRatio, r = t.naturalWidth, n = t.naturalHeight, c = t.rotate, p = c === void 0 ? 0 : c, d = t.scaleX, l = d === void 0 ? 1 : d, f = t.scaleY, u = f === void 0 ? 1 : f, x = i.aspectRatio, w = i.naturalWidth, R = i.naturalHeight, C = e.fillColor, W = C === void 0 ? "transparent" : C, k = e.imageSmoothingEnabled, B = k === void 0 ? !0 : k, et = e.imageSmoothingQuality, U = et === void 0 ? "low" : et, g = e.maxWidth, D = g === void 0 ? 1 / 0 : g, I = e.maxHeight, F = I === void 0 ? 1 / 0 : I, it = e.minWidth, ct = it === void 0 ? 0 : it, lt = e.minHeight, st = lt === void 0 ? 0 : lt, J = document.createElement("canvas"), X = J.getContext("2d"), ft = ot({ aspectRatio: x, width: D, height: F }), Wt = ot({ aspectRatio: x, width: ct, height: st }, "cover"), qt = Math.min(ft.width, Math.max(Wt.width, w)), Zt = Math.min(ft.height, Math.max(Wt.height, R)), Te = ot({ aspectRatio: o, width: D, height: F }), Me = ot({ aspectRatio: o, width: ct, height: st }, "cover"), Ee = Math.min(Te.width, Math.max(Me.width, r)), Oe = Math.min(Te.height, Math.max(Me.height, n)), xi = [-Ee / 2, -Oe / 2, Ee, Oe]; return J.width = yt(qt), J.height = yt(Zt), X.fillStyle = W, X.fillRect(0, 0, qt, Zt), X.save(), X.translate(qt / 2, Zt / 2), X.rotate(p * Math.PI / 180), X.scale(l, u), X.imageSmoothingEnabled = B, X.imageSmoothingQuality = U, X.drawImage.apply(X, [a].concat(L(xi.map(function(Ci) { return Math.floor(yt(Ci)); })))), X.restore(), J; } var Ce = String.fromCharCode; function hi(a, t, i) { var e = ""; i += t; for (var o = t; o < i; o += 1) e += Ce(a.getUint8(o)); return e; } var ci = /^data:.*,/; function li(a) { var t = a.replace(ci, ""), i = atob(t), e = new ArrayBuffer(i.length), o = new Uint8Array(e); return A(o, function(r, n) { o[n] = i.charCodeAt(n); }), e; } function fi(a, t) { for (var i = [], e = 8192, o = new Uint8Array(a); o.length > 0; ) i.push(Ce.apply(null, me(o.subarray(0, e)))), o = o.subarray(e); return "data:".concat(t, ";base64,").concat(btoa(i.join(""))); } function di(a) { var t = new DataView(a), i; try { var e, o, r; if (t.getUint8(0) === 255 && t.getUint8(1) === 216) for (var n = t.byteLength, c = 2; c + 1 < n; ) { if (t.getUint8(c) === 255 && t.getUint8(c + 1) === 225) { o = c; break; } c += 1; } if (o) { var p = o + 4, d = o + 10; if (hi(t, p, 4) === "Exif") { var l = t.getUint16(d); if (e = l === 18761, (e || l === 19789) && t.getUint16(d + 2, e) === 42) { var f = t.getUint32(d + 4, e); f >= 8 && (r = d + f); } } } if (r) { var u = t.getUint16(r, e), x, w; for (w = 0; w < u; w += 1) if (x = r + w * 12 + 2, t.getUint16(x, e) === 274) { x += 8, i = t.getUint16(x, e), t.setUint16(x, 1, e); break; } } } catch { i = 1; } return i; } function ui(a) { var t = 0, i = 1, e = 1; switch (a) { case 2: i = -1; break; case 3: t = -180; break; case 4: e = -1; break; case 5: t = 90, e = -1; break; case 6: t = 90; break; case 7: t = 90, i = -1; break; case 8: t = -90; break; } return { rotate: t, scaleX: i, scaleY: e }; } var pi = { render: function() { this.initContainer(), this.initCanvas(), this.initCropBox(), this.renderCanvas(), this.cropped && this.renderCropBox(); }, initContainer: function() { var t = this.element, i = this.options, e = this.container, o = this.cropper, r = Number(i.minContainerWidth), n = Number(i.minContainerHeight); H(o, $), Q(t, $); var c = { width: Math.max(e.offsetWidth, r >= 0 ? r : de), height: Math.max(e.offsetHeight, n >= 0 ? n : ue) }; this.containerData = c, nt(o, { width: c.width, height: c.height }), H(t, $), Q(o, $); }, initCanvas: function() { var t = this.containerData, i = this.imageData, e = this.options.viewMode, o = Math.abs(i.rotate) % 180 === 90, r = o ? i.naturalHeight : i.naturalWidth, n = o ? i.naturalWidth : i.naturalHeight, c = r / n, p = t.width, d = t.height; t.height * c > t.width ? e === 3 ? p = t.height * c : d = t.width / c : e === 3 ? d = t.width / c : p = t.height * c; var l = { aspectRatio: c, naturalWidth: r, naturalHeight: n, width: p, height: d }; this.canvasData = l, this.limited = e === 1 || e === 2, this.limitCanvas(!0, !0), l.width = Math.min(Math.max(l.width, l.minWidth), l.maxWidth), l.height = Math.min(Math.max(l.height, l.minHeight), l.maxHeight), l.left = (t.width - l.width) / 2, l.top = (t.height - l.height) / 2, l.oldLeft = l.left, l.oldTop = l.top, this.initialCanvasData = O({}, l); }, limitCanvas: function(t, i) { var e = this.options, o = this.containerData, r = this.canvasData, n = this.cropBoxData, c = e.viewMode, p = r.aspectRatio, d = this.cropped && n; if (t) { var l = Number(e.minCanvasWidth) || 0, f = Number(e.minCanvasHeight) || 0; c > 1 ? (l = Math.max(l, o.width), f = Math.max(f, o.height), c === 3 && (f * p > l ? l = f * p : f = l / p)) : c > 0 && (l ? l = Math.max(l, d ? n.width : 0) : f ? f = Math.max(f, d ? n.height : 0) : d && (l = n.width, f = n.height, f * p > l ? l = f * p : f = l / p)); var u = ot({ aspectRatio: p, width: l, height: f }); l = u.width, f = u.height, r.minWidth = l, r.minHeight = f, r.maxWidth = 1 / 0, r.maxHeight = 1 / 0; } if (i) if (c > (d ? 0 : 1)) { var x = o.width - r.width, w = o.height - r.height; r.minLeft = Math.min(0, x), r.minTop = Math.min(0, w), r.maxLeft = Math.max(0, x), r.maxTop = Math.max(0, w), d && this.limited && (r.minLeft = Math.min(n.left, n.left + (n.width - r.width)), r.minTop = Math.min(n.top, n.top + (n.height - r.height)), r.maxLeft = n.left, r.maxTop = n.top, c === 2 && (r.width >= o.width && (r.minLeft = Math.min(0, x), r.maxLeft = Math.max(0, x)), r.height >= o.height && (r.minTop = Math.min(0, w), r.maxTop = Math.max(0, w)))); } else r.minLeft = -r.width, r.minTop = -r.height, r.maxLeft = o.width, r.maxTop = o.height; }, renderCanvas: function(t, i) { var e = this.canvasData, o = this.imageData; if (i) { var r = oi({ width: o.naturalWidth * Math.abs(o.scaleX || 1), height: o.naturalHeight * Math.abs(o.scaleY || 1), degree: o.rotate || 0 }), n = r.width, c = r.height, p = e.width * (n / e.naturalWidth), d = e.height * (c / e.naturalHeight); e.left -= (p - e.width) / 2, e.top -= (d - e.height) / 2, e.width = p, e.height = d, e.aspectRatio = n / c, e.naturalWidth = n, e.naturalHeight = c, this.limitCanvas(!0, !1); } (e.width > e.maxWidth || e.width < e.minWidth) && (e.left = e.oldLeft), (e.height > e.maxHeight || e.height < e.minHeight) && (e.top = e.oldTop), e.width = Math.min(Math.max(e.width, e.minWidth), e.maxWidth), e.height = Math.min(Math.max(e.height, e.minHeight), e.maxHeight), this.limitCanvas(!1, !0), e.left = Math.min(Math.max(e.left, e.minLeft), e.maxLeft), e.top = Math.min(Math.max(e.top, e.minTop), e.maxTop), e.oldLeft = e.left, e.oldTop = e.top, nt(this.canvas, O({ width: e.width, height: e.height }, Nt({ translateX: e.left, translateY: e.top }))), this.renderImage(t), this.cropped && this.limited && this.limitCropBox(!0, !0); }, renderImage: function(t) { var i = this.canvasData, e = this.imageData, o = e.naturalWidth * (i.width / i.naturalWidth), r = e.naturalHeight * (i.height / i.naturalHeight); O(e, { width: o, height: r, left: (i.width - o) / 2, top: (i.height - r) / 2 }), nt(this.image, O({ width: e.width, height: e.height }, Nt(O({ translateX: e.left, translateY: e.top }, e)))), t && this.output(); }, initCropBox: function() { var t = this.options, i = this.canvasData, e = t.aspectRatio || t.initialAspectRatio, o = Number(t.autoCropArea) || 0.8, r = { width: i.width, height: i.height }; e && (i.height * e > i.width ? r.height = r.width / e : r.width = r.height * e), this.cropBoxData = r, this.limitCropBox(!0, !0), r.width = Math.min(Math.max(r.width, r.minWidth), r.maxWidth), r.height = Math.min(Math.max(r.height, r.minHeight), r.maxHeight), r.width = Math.max(r.minWidth, r.width * o), r.height = Math.max(r.minHeight, r.height * o), r.left = i.left + (i.width - r.width) / 2, r.top = i.top + (i.height - r.height) / 2, r.oldLeft = r.left, r.oldTop = r.top, this.initialCropBoxData = O({}, r); }, limitCropBox: function(t, i) { var e = this.options, o = this.containerData, r = this.canvasData, n = this.cropBoxData, c = this.limited, p = e.aspectRatio; if (t) { var d = Number(e.minCropBoxWidth) || 0, l = Number(e.minCropBoxHeight) || 0, f = c ? Math.min(o.width, r.width, r.width + r.left, o.width - r.left) : o.width, u = c ? Math.min(o.height, r.height, r.height + r.top, o.height - r.top) : o.height; d = Math.min(d, o.width), l = Math.min(l, o.height), p && (d && l ? l * p > d ? l = d / p : d = l * p : d ? l = d / p : l && (d = l * p), u * p > f ? u = f / p : f = u * p), n.minWidth = Math.min(d, f), n.minHeight = Math.min(l, u), n.maxWidth = f, n.maxHeight = u; } i && (c ? (n.minLeft = Math.max(0, r.left), n.minTop = Math.max(0, r.top), n.maxLeft = Math.min(o.width, r.left + r.width) - n.width, n.maxTop = Math.min(o.height, r.top + r.height) - n.height) : (n.minLeft = 0, n.minTop = 0, n.maxLeft = o.width - n.width, n.maxTop = o.height - n.height)); }, renderCropBox: function() { var t = this.options, i = this.containerData, e = this.cropBoxData; (e.width > e.maxWidth || e.width < e.minWidth) && (e.left = e.oldLeft), (e.height > e.maxHeight || e.height < e.minHeight) && (e.top = e.oldTop), e.width = Math.min(Math.max(e.width, e.minWidth), e.maxWidth), e.height = Math.min(Math.max(e.height, e.minHeight), e.maxHeight), this.limitCropBox(!1, !0), e.left = Math.min(Math.max(e.left, e.minLeft), e.maxLeft), e.top = Math.min(Math.max(e.top, e.minTop), e.maxTop), e.oldLeft = e.left, e.oldTop = e.top, t.movable && t.cropBoxMovable && Rt(this.face, Ot, e.width >= i.width && e.height >= i.height ? S : Ct), nt(this.cropBox, O({ width: e.width, height: e.height }, Nt({ translateX: e.left, translateY: e.top }))), this.cropped && this.limited && this.limitCanvas(!0, !0), this.disabled || this.output(); }, output: function() { this.preview(), xt(this.element, $t, this.getData()); } }, gi = { initPreview: function() { var t = this.element, i = this.crossOrigin, e = this.options.preview, o = i ? this.crossOriginUrl : this.url, r = t.alt || "The image to preview", n = document.createElement("img"); if (i && (n.crossOrigin = i), n.src = o, n.alt = r, this.viewBox.appendChild(n), this.viewBoxImage = n, !!e) { var c = e; typeof e == "string" ? c = t.ownerDocument.querySelectorAll(e) : e.querySelector && (c = [e]), this.previews = c, A(c, function(p) { var d = document.createElement("img"); Rt(p, At, { width: p.offsetWidth, height: p.offsetHeight, html: p.innerHTML }), i && (d.crossOrigin = i), d.src = o, d.alt = r, d.style.cssText = 'display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"', p.innerHTML = "", p.appendChild(d); }); } }, resetPreview: function() { A(this.previews, function(t) { var i = Ft(t, At); nt(t, { width: i.width, height: i.height }), t.innerHTML = i.html, ii(t, At); }); }, preview: function() { var t = this.imageData, i = this.canvasData, e = this.cropBoxData, o = e.width, r = e.height, n = t.width, c = t.height, p = e.left - i.left - t.left, d = e.top - i.top - t.top; !this.cropped || this.disabled || (nt(this.viewBoxImage, O({ width: n, height: c }, Nt(O({ translateX: -p, translateY: -d }, t)))), A(this.previews, function(l) { var f = Ft(l, At), u = f.width, x = f.height, w = u, R = x, C = 1; o && (C = u / o, R = r * C), r && R > x && (C = x / r, w = o * C, R = x), nt(l, { width: w, height: R }), nt(l.getElementsByTagName("img")[0], O({ width: n * C, height: c * C }, Nt(O({ translateX: -p * C, translateY: -d * C }, t)))); })); } }, mi = { bind: function() { var t = this.element, i = this.options, e = this.cropper; P(i.cropstart) && V(t, Yt, i.cropstart), P(i.cropmove) && V(t, Xt, i.cropmove), P(i.cropend) && V(t, Pt, i.cropend), P(i.crop) && V(t, $t, i.crop), P(i.zoom) && V(t, jt, i.zoom), V(e, ne, this.onCropStart = this.cropStart.bind(this)), i.zoomable && i.zoomOnWheel && V(e, le, this.onWheel = this.wheel.bind(this), { passive: !1, capture: !0 }), i.toggleDragModeOnDblclick && V(e, re, this.onDblclick = this.dblclick.bind(this)), V(t.ownerDocument, oe, this.onCropMove = this.cropMove.bind(this)), V(t.ownerDocument, se, this.onCropEnd = this.cropEnd.bind(this)), i.responsive && V(window, ce, this.onResize = this.resize.bind(this)); }, unbind: function() { var t = this.element, i = this.options, e = this.cropper; P(i.cropstart) && q(t, Yt, i.cropstart), P(i.cropmove) && q(t, Xt, i.cropmove), P(i.cropend) && q(t, Pt, i.cropend), P(i.crop) && q(t, $t, i.crop), P(i.zoom) && q(t, jt, i.zoom), q(e, ne, this.onCropStart), i.zoomable && i.zoomOnWheel && q(e, le, this.onWheel, { passive: !1, capture: !0 }), i.toggleDragModeOnDblclick && q(e, re, this.onDblclick), q(t.ownerDocument, oe, this.onCropMove), q(t.ownerDocument, se, this.onCropEnd), i.responsive && q(window, ce, this.onResize); } }, vi = { resize: function() { if (!this.disabled) { var t = this.options, i = this.container, e = this.containerData, o = i.offsetWidth / e.width, r = i.offsetHeight / e.height, n = Math.abs(o - 1) > Math.abs(r - 1) ? o : r; if (n !== 1) { var c, p; t.restore && (c = this.getCanvasData(), p = this.getCropBoxData()), this.render(), t.restore && (this.setCanvasData(A(c, function(d, l) { c[l] = d * n; })), this.setCropBoxData(A(p, function(d, l) { p[l] = d * n; }))); } } }, dblclick: function() { this.disabled || this.options.dragMode === ae || this.setDragMode(ti(this.dragBox, kt) ? ie : zt); }, wheel: function(t) { var i = this, e = Number(this.options.wheelZoomRatio) || 0.1, o = 1; this.disabled || (t.preventDefault(), !this.wheeling && (this.wheeling = !0, setTimeout(function() { i.wheeling = !1; }, 50), t.deltaY ? o = t.deltaY > 0 ? 1 : -1 : t.wheelDelta ? o = -t.wheelDelta / 120 : t.detail && (o = t.detail > 0 ? 1 : -1), this.zoom(-o * e, t))); }, cropStart: function(t) { var i = t.buttons, e = t.button; if (!(this.disabled || (t.type === "mousedown" || t.type === "pointerdown" && t.pointerType === "mouse") && (y(i) && i !== 1 || y(e) && e !== 0 || t.ctrlKey))) { var o = this.options, r = this.pointers, n; t.changedTouches ? A(t.changedTouches, function(c) { r[c.identifier] = Bt(c); }) : r[t.pointerId || 0] = Bt(t), Object.keys(r).length > 1 && o.zoomable && o.zoomOnTouch ? n = G : n = Ft(t.target, Ot), !!je.test(n) && xt(this.element, Yt, { originalEvent: t, action: n }) !== !1 && (t.preventDefault(), this.action = n, this.cropping = !1, n === mt && (this.cropping = !0, H(this.dragBox, _t))); } }, cropMove: function(t) { var i = this.action; if (!(this.disabled || !i)) { var e = this.pointers; t.preventDefault(), xt(this.element, Xt, { originalEvent: t, action: i }) !== !1 && (t.changedTouches ? A(t.changedTouches, function(o) { O(e[o.identifier] || {}, Bt(o, !0)); }) : O(e[t.pointerId || 0] || {}, Bt(t, !0)), this.change(t)); } }, cropEnd: function(t) { if (!this.disabled) { var i = this.action, e = this.pointers; t.changedTouches ? A(t.changedTouches, function(o) { delete e[o.identifier]; }) : delete e[t.pointerId || 0], i && (t.preventDefault(), Object.keys(e).length || (this.action = ""), this.cropping && (this.cropping = !1, wt(this.dragBox, _t, this.cropped && this.options.modal)), xt(this.element, Pt, { originalEvent: t, action: i })); } } }, bi = { change: function(t) { var i = this.options, e = this.canvasData, o = this.containerData, r = this.cropBoxData, n = this.pointers, c = this.action, p = i.aspectRatio, d = r.left, l = r.top, f = r.width, u = r.height, x = d + f, w = l + u, R = 0, C = 0, W = o.width, k = o.height, B = !0, et; !p && t.shiftKey && (p = f && u ? f / u : 1), this.limited && (R = r.minLeft, C = r.minTop, W = R + Math.min(o.width, e.width, e.left + e.width), k = C + Math.min(o.height, e.height, e.top + e.height)); var U = n[Object.keys(n)[0]], g = { x: U.endX - U.startX, y: U.endY - U.startY }, D = function(F) { switch (F) { case j: x + g.x > W && (g.x = W - x); break; case K: d + g.x < R && (g.x = R - d); break; case rt: l + g.y < C && (g.y = C - l); break; case vt: w + g.y > k && (g.y = k - w); break; } }; switch (c) { case Ct: d += g.x, l += g.y; break; case j: if (g.x >= 0 && (x >= W || p && (l <= C || w >= k))) { B = !1; break; } D(j), f += g.x, f < 0 && (c = K, f = -f, d -= f), p && (u = f / p, l += (r.height - u) / 2); break; case rt: if (g.y <= 0 && (l <= C || p && (d <= R || x >= W))) { B = !1; break; } D(rt), u -= g.y, l += g.y, u < 0 && (c = vt, u = -u, l -= u), p && (f = u * p, d += (r.width - f) / 2); break; case K: if (g.x <= 0 && (d <= R || p && (l <= C || w >= k))) { B = !1; break; } D(K), f -= g.x, d += g.x, f < 0 && (c = j, f = -f, d -= f), p && (u = f / p, l += (r.height - u) / 2); break; case vt: if (g.y >= 0 && (w >= k || p && (d <= R || x >= W))) { B = !1; break; } D(vt), u += g.y, u < 0 && (c = rt, u = -u, l -= u), p && (f = u * p, d += (r.width - f) / 2); break; case Dt: if (p) { if (g.y <= 0 && (l <= C || x >= W)) { B = !1; break; } D(rt), u -= g.y, l += g.y, f = u * p; } else D(rt), D(j), g.x >= 0 ? x < W ? f += g.x : g.y <= 0 && l <= C && (B = !1) : f += g.x, g.y <= 0 ? l > C && (u -= g.y, l += g.y) : (u -= g.y, l += g.y); f < 0 && u < 0 ? (c = Et, u = -u, f = -f, l -= u, d -= f) : f < 0 ? (c = Tt, f = -f, d -= f) : u < 0 && (c = Mt, u = -u, l -= u); break; case Tt: if (p) { if (g.y <= 0 && (l <= C || d <= R)) { B = !1; break; } D(rt), u -= g.y, l += g.y, f = u * p, d += r.width - f; } else D(rt), D(K), g.x <= 0 ? d > R ? (f -= g.x, d += g.x) : g.y <= 0 && l <= C && (B = !1) : (f -= g.x, d += g.x), g.y <= 0 ? l > C && (u -= g.y, l += g.y) : (u -= g.y, l += g.y); f < 0 && u < 0 ? (c = Mt, u = -u, f = -f, l -= u, d -= f) : f < 0 ? (c = Dt, f = -f, d -= f) : u < 0 && (c = Et, u = -u, l -= u); break; case Et: if (p) { if (g.x <= 0 && (d <= R || w >= k)) { B = !1; break; } D(K), f -= g.x, d += g.x, u = f / p; } else D(vt), D(K), g.x <= 0 ? d > R ? (f -= g.x, d += g.x) : g.y >= 0 && w >= k && (B = !1) : (f -= g.x, d += g.x), g.y >= 0 ? w < k && (u += g.y) : u += g.y; f < 0 && u < 0 ? (c = Dt, u = -u, f = -f, l -= u, d -= f) : f < 0 ? (c = Mt, f = -f, d -= f) : u < 0 && (c = Tt, u = -u, l -= u); break; case Mt: if (p) { if (g.x >= 0 && (x >= W || w >= k)) { B = !1; break; } D(j), f += g.x, u = f / p; } else D(vt), D(j), g.x >= 0 ? x < W ? f += g.x : g.y >= 0 && w >= k && (B = !1) : f += g.x, g.y >= 0 ? w < k && (u += g.y) : u += g.y; f < 0 && u < 0 ? (c = Tt, u = -u, f = -f, l -= u, d -= f) : f < 0 ? (c = Et, f = -f, d -= f) : u < 0 && (c = Dt, u = -u, l -= u); break; case S: this.move(g.x, g.y), B = !1; break; case G: this.zoom(ri(n), t), B = !1; break; case mt: if (!g.x || !g.y) { B = !1; break; } et = ye(this.cropper), d = U.startX - et.left, l = U.startY - et.top, f = r.minWidth, u = r.minHeight, g.x > 0 ? c = g.y > 0 ? Mt : Dt : g.x < 0 && (d -= f, c = g.y > 0 ? Et : Tt), g.y < 0 && (l -= u), this.cropped || (Q(this.cropBox, $), this.cropped = !0, this.limited && this.limitCropBox(!0, !0)); break; } B && (r.width = f, r.height = u, r.left = d, r.top = l, this.action = c, this.renderCropBox()), A(n, function(I) { I.startX = I.endX, I.startY = I.endY; }); } }, yi = { crop: function() { return this.ready && !this.cropped && !this.disabled && (this.cropped = !0, this.limitCropBox(!0, !0), this.options.modal && H(this.dragBox, _t), Q(this.cropBox, $), this.setCropBoxData(this.initialCropBoxData)), this; }, reset: function() { return this.ready && !this.disabled && (this.imageData = O({}, this.initialImageData), this.canvasData = O({}, this.initialCanvasData), this.cropBoxData = O({}, this.initialCropBoxData), this.renderCanvas(), this.cropped && this.renderCropBox()), this; }, clear: function() { return this.cropped && !this.disabled && (O(this.cropBoxData, { left: 0, top: 0, width: 0, height: 0 }), this.cropped = !1, this.renderCropBox(), this.limitCanvas(!0, !0), this.renderCanvas(), Q(this.dragBox, _t), H(this.cropBox, $)), this; }, replace: function(t) { var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1; return !this.disabled && t && (this.isImg && (this.element.src = t), i ? (this.url = t, this.image.src = t, this.ready && (this.viewBoxImage.src = t, A(this.previews, function(e) { e.getElementsByTagName("img")[0].src = t; }))) : (this.isImg && (this.replaced = !0), this.options.data = null, this.uncreate(), this.load(t))), this; }, enable: function() { return this.ready && this.disabled && (this.disabled = !1, Q(this.cropper, te)), this; }, disable: function() { return this.ready && !this.disabled && (this.disabled = !0, H(this.cropper, te)), this; }, destroy: function() { var t = this.element; return t[T] ? (t[T] = void 0, this.isImg && this.replaced && (t.src = this.originalUrl), this.uncreate(), this) : this; }, move: function(t) { var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : t, e = this.canvasData, o = e.left, r = e.top; return this.moveTo(Ut(t) ? t : o + Number(t), Ut(i) ? i : r + Number(i)); }, moveTo: function(t) { var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : t, e = this.canvasData, o = !1; return t = Number(t), i = Number(i), this.ready && !this.disabled && this.options.movable && (y(t) && (e.left = t, o = !0), y(i) && (e.top = i, o = !0), o && this.renderCanvas(!0)), this; }, zoom: function(t, i) { var e = this.canvasData; return t = Number(t), t < 0 ? t = 1 / (1 - t) : t = 1 + t, this.zoomTo(e.width * t / e.naturalWidth, null, i); }, zoomTo: function(t, i, e) { var o = this.options, r = this.canvasData, n = r.width, c = r.height, p = r.naturalWidth, d = r.naturalHeight; if (t = Number(t), t >= 0 && this.ready && !this.disabled && o.zoomable) { var l = p * t, f = d * t; if (xt(this.element, jt, { ratio: t, oldRatio: n / p, originalEvent: e }) === !1) return this; if (e) { var u = this.pointers, x = ye(this.cropper), w = u && Object.keys(u).length ? ni(u) : { pageX: e.pageX, pageY: e.pageY }; r.left -= (l - n) * ((w.pageX - x.left - r.left) / n), r.top -= (f - c) * ((w.pageY - x.top - r.top) / c); } else bt(i) && y(i.x) && y(i.y) ? (r.left -= (l - n) * ((i.x - r.left) / n), r.top -= (f - c) * ((i.y - r.top) / c)) : (r.left -= (l - n) / 2, r.top -= (f - c) / 2); r.width = l, r.height = f, this.renderCanvas(!0); } return this; }, rotate: function(t) { return this.rotateTo((this.imageData.rotate || 0) + Number(t)); }, rotateTo: function(t) { return t = Number(t), y(t) && this.ready && !this.disabled && this.options.rotatable && (this.imageData.rotate = t % 360, this.renderCanvas(!0, !0)), this; }, scaleX: function(t) { var i = this.imageData.scaleY; return this.scale(t, y(i) ? i : 1); }, scaleY: function(t) { var i = this.imageData.scaleX; return this.scale(y(i) ? i : 1, t); }, scale: function(t) { var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : t, e = this.imageData, o = !1; return t = Number(t), i = Number(i), this.ready && !this.disabled && this.options.scalable && (y(t) && (e.scaleX = t, o = !0), y(i) && (e.scaleY = i, o = !0), o && this.renderCanvas(!0, !0)), this; }, getData: function() { var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, i = this.options, e = this.imageData, o = this.canvasData, r = this.cropBoxData, n; if (this.ready && this.cropped) { n = { x: r.left - o.left, y: r.top - o.top, width: r.width, height: r.height }; var c = e.width / e.naturalWidth; if (A(n, function(l, f) { n[f] = l / c; }), t) { var p = Math.round(n.y + n.height), d = Math.round(n.x + n.width); n.x = Math.round(n.x), n.y = Math.round(n.y), n.width = d - n.x, n.height = p - n.y; } } else n = { x: 0, y: 0, width: 0, height: 0 }; return i.rotatable && (n.rotate = e.rotate || 0), i.scalable && (n.scaleX = e.scaleX || 1, n.scaleY = e.scaleY || 1), n; }, setData: function(t) { var i = this.options, e = this.imageData, o = this.canvasData, r = {}; if (this.ready && !this.disabled && bt(t)) { var n = !1; i.rotatable && y(t.rotate) && t.rotate !== e.rotate && (e.rotate = t.rotate, n = !0), i.scalable && (y(t.scaleX) && t.scaleX !== e.scaleX && (e.scaleX = t.scaleX, n = !0), y(t.scaleY) && t.scaleY !== e.scaleY && (e.scaleY = t.scaleY, n = !0)), n && this.renderCanvas(!0, !0); var c = e.width / e.naturalWidth; y(t.x) && (r.left = t.x * c + o.left), y(t.y) && (r.top = t.y * c + o.top), y(t.width) && (r.width = t.width * c), y(t.height) && (r.height = t.height * c), this.setCropBoxData(r); } return this; }, getContainerData: function() { return this.ready ? O({}, this.containerData) : {}; }, getImageData: function() { return this.sized ? O({}, this.imageData) : {}; }, getCanvasData: function() { var t = this.canvasData, i = {}; return this.ready && A(["left", "top", "width", "height", "naturalWidth", "naturalHeight"], function(e) { i[e] = t[e]; }), i; }, setCanvasData: function(t) { var i = this.canvasData, e = i.aspectRatio; return this.ready && !this.disabled && bt(t) && (y(t.left) && (i.left = t.left), y(t.top) && (i.top = t.top), y(t.width) ? (i.width = t.width, i.height = t.width / e) : y(t.height) && (i.height = t.height, i.width = t.height * e), this.renderCanvas(!0)), this; }, getCropBoxData: function() { var t = this.cropBoxData, i; return this.ready && this.cropped && (i = { left: t.left, top: t.top, width: t.width, height: t.height }), i || {}; }, setCropBoxData: function(t) { var i = this.cropBoxData, e = this.options.aspectRatio, o, r; return this.ready && this.cropped && !this.disabled && bt(t) && (y(t.left) && (i.left = t.left), y(t.top) && (i.top = t.top), y(t.width) && t.width !== i.width && (o = !0, i.width = t.width), y(t.height) && t.height !== i.height && (r = !0, i.height = t.height), e && (o ? i.height = i.width / e : r && (i.width = i.height * e)), this.renderCropBox()), this; }, getCroppedCanvas: function() { var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; if (!this.ready || !window.HTMLCanvasElement) return null; var i = this.canvasData, e = si(this.image, this.imageData, i, t); if (!this.cropped) return e; var o = this.getData(), r = o.x, n = o.y, c = o.width, p = o.height, d = e.width / Math.floor(i.naturalWidth); d !== 1 && (r *= d, n *= d, c *= d, p *= d); var l = c / p, f = ot({ aspectRatio: l, width: t.maxWidth || 1 / 0, height: t.maxHeight || 1 / 0 }), u = ot({ aspectRatio: l, width: t.minWidth || 0, height: t.minHeight || 0 }, "cover"), x = ot({ aspectRatio: l, width: t.width || (d !== 1 ? e.width : c), height: t.height || (d !== 1 ? e.height : p) }), w = x.width, R = x.height; w = Math.min(f.width, Math.max(u.width, w)), R = Math.min(f.height, Math.max(u.height, R)); var C = document.createElement("canvas"), W = C.getContext("2d"); C.width = yt(w), C.height = yt(R), W.fillStyle = t.fillColor || "transparent", W.fillRect(0, 0, w, R); var k = t.imageSmoothingEnabled, B = k === void 0 ? !0 : k, et = t.imageSmoothingQuality; W.imageSmoothingEnabled = B, et && (W.imageSmoothingQuality = et); var U = e.width, g = e.height, D = r, I = n, F, it, ct, lt, st, J; D <= -c || D > U ? (D = 0, F = 0, ct = 0, st = 0) : D <= 0 ? (ct = -D, D = 0, F = Math.min(U, c + D), st = F) : D <= U && (ct = 0, F = Math.min(c, U - D), st = F), F <= 0 || I <= -p || I > g ? (I = 0, it = 0, lt = 0, J = 0) : I <= 0 ? (lt = -I, I = 0, it = Math.min(g, p + I), J = it) : I <= g && (lt = 0, it = Math.min(p, g - I), J = it); var X = [D, I, F, it]; if (st > 0 && J > 0) { var ft = w / c; X.push(ct * ft, lt * ft, st * ft, J * ft); } return W.drawImage.apply(W, [e].concat(L(X.map(function(Wt) { return Math.floor(yt(Wt)); })))), C; }, setAspectRatio: function(t) { var i = this.options; return !this.disabled && !Ut(t) && (i.aspectRatio = Math.max(0, t) || NaN, this.ready && (this.initCropBox(), this.cropped && this.renderCropBox())), this; }, setDragMode: function(t) { var i = this.options, e = this.dragBox, o = this.face; if (this.ready && !this.disabled) { var r = t === zt, n = i.movable && t === ie; t = r || n ? t : ae, i.dragMode = t, Rt(e, Ot, t), wt(e, kt, r), wt(e, Lt, n), i.cropBoxMovable || (Rt(o, Ot, t), wt(o, kt, r), wt(o, Lt, n)); } return this; } }, wi = Y.Cropper, De = /* @__PURE__ */ function() { function a(t) { var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; if (N(this, a), !t || !Fe.test(t.tagName)) throw new Error("The first argument is required and must be an <img> or <canvas> element."); this.element = t, this.options = O({}, pe, bt(i) && i), this.cropped = !1, this.disabled = !1, this.pointers = {}, this.ready = !1, this.reloading = !1, this.replaced = !1, this.sized = !1, this.sizing = !1, this.init(); } return M(a, [{ key: "init", value: function() { var i = this.element, e = i.tagName.toLowerCase(), o; if (!i[T]) { if (i[T] = this, e === "img") { if (this.isImg = !0, o = i.getAttribute("src") || "", this.originalUrl = o, !o) return; o = i.src; } else e === "canvas" && window.HTMLCanvasElement && (o = i.toDataURL()); this.load(o); } } }, { key: "load", value: function(i) { var e = this; if (!!i) { this.url = i, this.imageData = {}; var o = this.element, r = this.options; if (!r.rotatable && !r.sca