@esri/calcite-components
Version:
Web Components for Esri's Calcite Design System.
868 lines (867 loc) • 146 kB
JavaScript
/*! All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://github.com/Esri/calcite-design-system/blob/dev/LICENSE.md for details.
v3.2.1 */
function getDefaultExportFromCjs(x) {
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
}
var interact_min$1 = { exports: {} };
var interact_min = interact_min$1.exports;
var hasRequiredInteract_min;
function requireInteract_min() {
if (hasRequiredInteract_min) return interact_min$1.exports;
hasRequiredInteract_min = 1;
(function(module, exports) {
!function(t, e) {
module.exports = e();
}(interact_min, function() {
function t(t2, e2) {
var n2 = Object.keys(t2);
if (Object.getOwnPropertySymbols) {
var r2 = Object.getOwnPropertySymbols(t2);
e2 && (r2 = r2.filter(function(e3) {
return Object.getOwnPropertyDescriptor(t2, e3).enumerable;
})), n2.push.apply(n2, r2);
}
return n2;
}
function e(e2) {
for (var n2 = 1; n2 < arguments.length; n2++) {
var r2 = null != arguments[n2] ? arguments[n2] : {};
n2 % 2 ? t(Object(r2), true).forEach(function(t2) {
a(e2, t2, r2[t2]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(r2)) : t(Object(r2)).forEach(function(t2) {
Object.defineProperty(e2, t2, Object.getOwnPropertyDescriptor(r2, t2));
});
}
return e2;
}
function n(t2) {
return n = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t3) {
return typeof t3;
} : function(t3) {
return t3 && "function" == typeof Symbol && t3.constructor === Symbol && t3 !== Symbol.prototype ? "symbol" : typeof t3;
}, n(t2);
}
function r(t2, e2) {
if (!(t2 instanceof e2)) throw new TypeError("Cannot call a class as a function");
}
function i(t2, e2) {
for (var n2 = 0; n2 < e2.length; n2++) {
var r2 = e2[n2];
r2.enumerable = r2.enumerable || false, r2.configurable = true, "value" in r2 && (r2.writable = true), Object.defineProperty(t2, d(r2.key), r2);
}
}
function o(t2, e2, n2) {
return e2 && i(t2.prototype, e2), Object.defineProperty(t2, "prototype", { writable: false }), t2;
}
function a(t2, e2, n2) {
return (e2 = d(e2)) in t2 ? Object.defineProperty(t2, e2, { value: n2, enumerable: true, configurable: true, writable: true }) : t2[e2] = n2, t2;
}
function s(t2, e2) {
if ("function" != typeof e2 && null !== e2) throw new TypeError("Super expression must either be null or a function");
t2.prototype = Object.create(e2 && e2.prototype, { constructor: { value: t2, writable: true, configurable: true } }), Object.defineProperty(t2, "prototype", { writable: false }), e2 && l(t2, e2);
}
function c(t2) {
return c = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t3) {
return t3.__proto__ || Object.getPrototypeOf(t3);
}, c(t2);
}
function l(t2, e2) {
return l = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t3, e3) {
return t3.__proto__ = e3, t3;
}, l(t2, e2);
}
function u(t2) {
if (void 0 === t2) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return t2;
}
function p(t2) {
var e2 = function() {
if ("undefined" == typeof Reflect || !Reflect.construct) return false;
if (Reflect.construct.sham) return false;
if ("function" == typeof Proxy) return true;
try {
return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
})), true;
} catch (t3) {
return false;
}
}();
return function() {
var n2, r2 = c(t2);
if (e2) {
var i2 = c(this).constructor;
n2 = Reflect.construct(r2, arguments, i2);
} else n2 = r2.apply(this, arguments);
return function(t3, e3) {
if (e3 && ("object" == typeof e3 || "function" == typeof e3)) return e3;
if (void 0 !== e3) throw new TypeError("Derived constructors may only return object or undefined");
return u(t3);
}(this, n2);
};
}
function f() {
return f = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function(t2, e2, n2) {
var r2 = function(t3, e3) {
for (; !Object.prototype.hasOwnProperty.call(t3, e3) && null !== (t3 = c(t3)); ) ;
return t3;
}(t2, e2);
if (r2) {
var i2 = Object.getOwnPropertyDescriptor(r2, e2);
return i2.get ? i2.get.call(arguments.length < 3 ? t2 : n2) : i2.value;
}
}, f.apply(this, arguments);
}
function d(t2) {
var e2 = function(t3, e3) {
if ("object" != typeof t3 || null === t3) return t3;
var n2 = t3[Symbol.toPrimitive];
if (void 0 !== n2) {
var r2 = n2.call(t3, e3);
if ("object" != typeof r2) return r2;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return String(t3);
}(t2, "string");
return "symbol" == typeof e2 ? e2 : e2 + "";
}
var h = function(t2) {
return !(!t2 || !t2.Window) && t2 instanceof t2.Window;
}, v = void 0, g = void 0;
function m(t2) {
v = t2;
var e2 = t2.document.createTextNode("");
e2.ownerDocument !== t2.document && "function" == typeof t2.wrap && t2.wrap(e2) === e2 && (t2 = t2.wrap(t2)), g = t2;
}
function y(t2) {
return h(t2) ? t2 : (t2.ownerDocument || t2).defaultView || g.window;
}
"undefined" != typeof window && window && m(window);
var b = function(t2) {
return !!t2 && "object" === n(t2);
}, x = function(t2) {
return "function" == typeof t2;
}, w = { window: function(t2) {
return t2 === g || h(t2);
}, docFrag: function(t2) {
return b(t2) && 11 === t2.nodeType;
}, object: b, func: x, number: function(t2) {
return "number" == typeof t2;
}, bool: function(t2) {
return "boolean" == typeof t2;
}, string: function(t2) {
return "string" == typeof t2;
}, element: function(t2) {
if (!t2 || "object" !== n(t2)) return false;
var e2 = y(t2) || g;
return /object|function/.test("undefined" == typeof Element ? "undefined" : n(Element)) ? t2 instanceof Element || t2 instanceof e2.Element : 1 === t2.nodeType && "string" == typeof t2.nodeName;
}, plainObject: function(t2) {
return b(t2) && !!t2.constructor && /function Object\b/.test(t2.constructor.toString());
}, array: function(t2) {
return b(t2) && void 0 !== t2.length && x(t2.splice);
} };
function E(t2) {
var e2 = t2.interaction;
if ("drag" === e2.prepared.name) {
var n2 = e2.prepared.axis;
"x" === n2 ? (e2.coords.cur.page.y = e2.coords.start.page.y, e2.coords.cur.client.y = e2.coords.start.client.y, e2.coords.velocity.client.y = 0, e2.coords.velocity.page.y = 0) : "y" === n2 && (e2.coords.cur.page.x = e2.coords.start.page.x, e2.coords.cur.client.x = e2.coords.start.client.x, e2.coords.velocity.client.x = 0, e2.coords.velocity.page.x = 0);
}
}
function T(t2) {
var e2 = t2.iEvent, n2 = t2.interaction;
if ("drag" === n2.prepared.name) {
var r2 = n2.prepared.axis;
if ("x" === r2 || "y" === r2) {
var i2 = "x" === r2 ? "y" : "x";
e2.page[i2] = n2.coords.start.page[i2], e2.client[i2] = n2.coords.start.client[i2], e2.delta[i2] = 0;
}
}
}
var S = { id: "actions/drag", install: function(t2) {
var e2 = t2.actions, n2 = t2.Interactable, r2 = t2.defaults;
n2.prototype.draggable = S.draggable, e2.map.drag = S, e2.methodDict.drag = "draggable", r2.actions.drag = S.defaults;
}, listeners: { "interactions:before-action-move": E, "interactions:action-resume": E, "interactions:action-move": T, "auto-start:check": function(t2) {
var e2 = t2.interaction, n2 = t2.interactable, r2 = t2.buttons, i2 = n2.options.drag;
if (i2 && i2.enabled && (!e2.pointerIsDown || !/mouse|pointer/.test(e2.pointerType) || 0 != (r2 & n2.options.drag.mouseButtons))) return t2.action = { name: "drag", axis: "start" === i2.lockAxis ? i2.startAxis : i2.lockAxis }, false;
} }, draggable: function(t2) {
return w.object(t2) ? (this.options.drag.enabled = false !== t2.enabled, this.setPerAction("drag", t2), this.setOnEvents("drag", t2), /^(xy|x|y|start)$/.test(t2.lockAxis) && (this.options.drag.lockAxis = t2.lockAxis), /^(xy|x|y)$/.test(t2.startAxis) && (this.options.drag.startAxis = t2.startAxis), this) : w.bool(t2) ? (this.options.drag.enabled = t2, this) : this.options.drag;
}, beforeMove: E, move: T, defaults: { startAxis: "xy", lockAxis: "xy" }, getCursor: function() {
return "move";
}, filterEventType: function(t2) {
return 0 === t2.search("drag");
} }, _ = S, P = { init: function(t2) {
var e2 = t2;
P.document = e2.document, P.DocumentFragment = e2.DocumentFragment || O, P.SVGElement = e2.SVGElement || O, P.SVGSVGElement = e2.SVGSVGElement || O, P.SVGElementInstance = e2.SVGElementInstance || O, P.Element = e2.Element || O, P.HTMLElement = e2.HTMLElement || P.Element, P.Event = e2.Event, P.Touch = e2.Touch || O, P.PointerEvent = e2.PointerEvent || e2.MSPointerEvent;
}, document: null, DocumentFragment: null, SVGElement: null, SVGSVGElement: null, SVGElementInstance: null, Element: null, HTMLElement: null, Event: null, Touch: null, PointerEvent: null };
function O() {
}
var k = P;
var D = { init: function(t2) {
var e2 = k.Element, n2 = t2.navigator || {};
D.supportsTouch = "ontouchstart" in t2 || w.func(t2.DocumentTouch) && k.document instanceof t2.DocumentTouch, D.supportsPointerEvent = false !== n2.pointerEnabled && !!k.PointerEvent, D.isIOS = /iP(hone|od|ad)/.test(n2.platform), D.isIOS7 = /iP(hone|od|ad)/.test(n2.platform) && /OS 7[^\d]/.test(n2.appVersion), D.isIe9 = /MSIE 9/.test(n2.userAgent), D.isOperaMobile = "Opera" === n2.appName && D.supportsTouch && /Presto/.test(n2.userAgent), D.prefixedMatchesSelector = "matches" in e2.prototype ? "matches" : "webkitMatchesSelector" in e2.prototype ? "webkitMatchesSelector" : "mozMatchesSelector" in e2.prototype ? "mozMatchesSelector" : "oMatchesSelector" in e2.prototype ? "oMatchesSelector" : "msMatchesSelector", D.pEventTypes = D.supportsPointerEvent ? k.PointerEvent === t2.MSPointerEvent ? { up: "MSPointerUp", down: "MSPointerDown", over: "mouseover", out: "mouseout", move: "MSPointerMove", cancel: "MSPointerCancel" } : { up: "pointerup", down: "pointerdown", over: "pointerover", out: "pointerout", move: "pointermove", cancel: "pointercancel" } : null, D.wheelEvent = k.document && "onmousewheel" in k.document ? "mousewheel" : "wheel";
}, supportsTouch: null, supportsPointerEvent: null, isIOS7: null, isIOS: null, isIe9: null, isOperaMobile: null, prefixedMatchesSelector: null, pEventTypes: null, wheelEvent: null };
var I = D;
function M(t2, e2) {
if (t2.contains) return t2.contains(e2);
for (; e2; ) {
if (e2 === t2) return true;
e2 = e2.parentNode;
}
return false;
}
function z(t2, e2) {
for (; w.element(t2); ) {
if (R(t2, e2)) return t2;
t2 = A(t2);
}
return null;
}
function A(t2) {
var e2 = t2.parentNode;
if (w.docFrag(e2)) {
for (; (e2 = e2.host) && w.docFrag(e2); ) ;
return e2;
}
return e2;
}
function R(t2, e2) {
return g !== v && (e2 = e2.replace(/\/deep\//g, " ")), t2[I.prefixedMatchesSelector](e2);
}
var C = function(t2) {
return t2.parentNode || t2.host;
};
function j(t2, e2) {
for (var n2, r2 = [], i2 = t2; (n2 = C(i2)) && i2 !== e2 && n2 !== i2.ownerDocument; ) r2.unshift(i2), i2 = n2;
return r2;
}
function F(t2, e2, n2) {
for (; w.element(t2); ) {
if (R(t2, e2)) return true;
if ((t2 = A(t2)) === n2) return R(t2, e2);
}
return false;
}
function X(t2) {
return t2.correspondingUseElement || t2;
}
function Y(t2) {
var e2 = t2 instanceof k.SVGElement ? t2.getBoundingClientRect() : t2.getClientRects()[0];
return e2 && { left: e2.left, right: e2.right, top: e2.top, bottom: e2.bottom, width: e2.width || e2.right - e2.left, height: e2.height || e2.bottom - e2.top };
}
function L(t2) {
var e2, n2 = Y(t2);
if (!I.isIOS7 && n2) {
var r2 = { x: (e2 = (e2 = y(t2)) || g).scrollX || e2.document.documentElement.scrollLeft, y: e2.scrollY || e2.document.documentElement.scrollTop };
n2.left += r2.x, n2.right += r2.x, n2.top += r2.y, n2.bottom += r2.y;
}
return n2;
}
function q(t2) {
for (var e2 = []; t2; ) e2.push(t2), t2 = A(t2);
return e2;
}
function B(t2) {
return !!w.string(t2) && (k.document.querySelector(t2), true);
}
function V(t2, e2) {
for (var n2 in e2) t2[n2] = e2[n2];
return t2;
}
function W(t2, e2, n2) {
return "parent" === t2 ? A(n2) : "self" === t2 ? e2.getRect(n2) : z(n2, t2);
}
function G(t2, e2, n2, r2) {
var i2 = t2;
return w.string(i2) ? i2 = W(i2, e2, n2) : w.func(i2) && (i2 = i2.apply(void 0, r2)), w.element(i2) && (i2 = L(i2)), i2;
}
function N(t2) {
return t2 && { x: "x" in t2 ? t2.x : t2.left, y: "y" in t2 ? t2.y : t2.top };
}
function U(t2) {
return !t2 || "x" in t2 && "y" in t2 || ((t2 = V({}, t2)).x = t2.left || 0, t2.y = t2.top || 0, t2.width = t2.width || (t2.right || 0) - t2.x, t2.height = t2.height || (t2.bottom || 0) - t2.y), t2;
}
function H(t2, e2, n2) {
t2.left && (e2.left += n2.x), t2.right && (e2.right += n2.x), t2.top && (e2.top += n2.y), t2.bottom && (e2.bottom += n2.y), e2.width = e2.right - e2.left, e2.height = e2.bottom - e2.top;
}
function K(t2, e2, n2) {
var r2 = n2 && t2.options[n2];
return N(G(r2 && r2.origin || t2.options.origin, t2, e2, [t2 && e2])) || { x: 0, y: 0 };
}
function $(t2, e2) {
var n2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : function(t3) {
return true;
}, r2 = arguments.length > 3 ? arguments[3] : void 0;
if (r2 = r2 || {}, w.string(t2) && -1 !== t2.search(" ") && (t2 = J(t2)), w.array(t2)) return t2.forEach(function(t3) {
return $(t3, e2, n2, r2);
}), r2;
if (w.object(t2) && (e2 = t2, t2 = ""), w.func(e2) && n2(t2)) r2[t2] = r2[t2] || [], r2[t2].push(e2);
else if (w.array(e2)) for (var i2 = 0, o2 = e2; i2 < o2.length; i2++) {
var a2 = o2[i2];
$(t2, a2, n2, r2);
}
else if (w.object(e2)) for (var s2 in e2) {
$(J(s2).map(function(e3) {
return "".concat(t2).concat(e3);
}), e2[s2], n2, r2);
}
return r2;
}
function J(t2) {
return t2.trim().split(/ +/);
}
var Q = function(t2, e2) {
return Math.sqrt(t2 * t2 + e2 * e2);
}, Z = ["webkit", "moz"];
function tt(t2, e2) {
t2.__set || (t2.__set = {});
var n2 = function(n3) {
if (Z.some(function(t3) {
return 0 === n3.indexOf(t3);
})) return 1;
"function" != typeof t2[n3] && "__set" !== n3 && Object.defineProperty(t2, n3, { get: function() {
return n3 in t2.__set ? t2.__set[n3] : t2.__set[n3] = e2[n3];
}, set: function(e3) {
t2.__set[n3] = e3;
}, configurable: true });
};
for (var r2 in e2) n2(r2);
return t2;
}
function et(t2, e2) {
t2.page = t2.page || {}, t2.page.x = e2.page.x, t2.page.y = e2.page.y, t2.client = t2.client || {}, t2.client.x = e2.client.x, t2.client.y = e2.client.y, t2.timeStamp = e2.timeStamp;
}
function nt(t2) {
t2.page.x = 0, t2.page.y = 0, t2.client.x = 0, t2.client.y = 0;
}
function rt(t2) {
return t2 instanceof k.Event || t2 instanceof k.Touch;
}
function it(t2, e2, n2) {
return t2 = t2 || "page", (n2 = n2 || {}).x = e2[t2 + "X"], n2.y = e2[t2 + "Y"], n2;
}
function ot(t2, e2) {
return e2 = e2 || { x: 0, y: 0 }, I.isOperaMobile && rt(t2) ? (it("screen", t2, e2), e2.x += window.scrollX, e2.y += window.scrollY) : it("page", t2, e2), e2;
}
function at(t2) {
return w.number(t2.pointerId) ? t2.pointerId : t2.identifier;
}
function st(t2, e2, n2) {
var r2 = e2.length > 1 ? lt(e2) : e2[0];
ot(r2, t2.page), function(t3, e3) {
e3 = e3 || {}, I.isOperaMobile && rt(t3) ? it("screen", t3, e3) : it("client", t3, e3);
}(r2, t2.client), t2.timeStamp = n2;
}
function ct(t2) {
var e2 = [];
return w.array(t2) ? (e2[0] = t2[0], e2[1] = t2[1]) : "touchend" === t2.type ? 1 === t2.touches.length ? (e2[0] = t2.touches[0], e2[1] = t2.changedTouches[0]) : 0 === t2.touches.length && (e2[0] = t2.changedTouches[0], e2[1] = t2.changedTouches[1]) : (e2[0] = t2.touches[0], e2[1] = t2.touches[1]), e2;
}
function lt(t2) {
for (var e2 = { pageX: 0, pageY: 0, clientX: 0, clientY: 0, screenX: 0, screenY: 0 }, n2 = 0; n2 < t2.length; n2++) {
var r2 = t2[n2];
for (var i2 in e2) e2[i2] += r2[i2];
}
for (var o2 in e2) e2[o2] /= t2.length;
return e2;
}
function ut(t2) {
if (!t2.length) return null;
var e2 = ct(t2), n2 = Math.min(e2[0].pageX, e2[1].pageX), r2 = Math.min(e2[0].pageY, e2[1].pageY), i2 = Math.max(e2[0].pageX, e2[1].pageX), o2 = Math.max(e2[0].pageY, e2[1].pageY);
return { x: n2, y: r2, left: n2, top: r2, right: i2, bottom: o2, width: i2 - n2, height: o2 - r2 };
}
function pt(t2, e2) {
var n2 = e2 + "X", r2 = e2 + "Y", i2 = ct(t2), o2 = i2[0][n2] - i2[1][n2], a2 = i2[0][r2] - i2[1][r2];
return Q(o2, a2);
}
function ft(t2, e2) {
var n2 = e2 + "X", r2 = e2 + "Y", i2 = ct(t2), o2 = i2[1][n2] - i2[0][n2], a2 = i2[1][r2] - i2[0][r2];
return 180 * Math.atan2(a2, o2) / Math.PI;
}
function dt(t2) {
return w.string(t2.pointerType) ? t2.pointerType : w.number(t2.pointerType) ? [void 0, void 0, "touch", "pen", "mouse"][t2.pointerType] : /touch/.test(t2.type || "") || t2 instanceof k.Touch ? "touch" : "mouse";
}
function ht(t2) {
var e2 = w.func(t2.composedPath) ? t2.composedPath() : t2.path;
return [X(e2 ? e2[0] : t2.target), X(t2.currentTarget)];
}
var vt = function() {
function t2(e2) {
r(this, t2), this.immediatePropagationStopped = false, this.propagationStopped = false, this._interaction = e2;
}
return o(t2, [{ key: "preventDefault", value: function() {
} }, { key: "stopPropagation", value: function() {
this.propagationStopped = true;
} }, { key: "stopImmediatePropagation", value: function() {
this.immediatePropagationStopped = this.propagationStopped = true;
} }]), t2;
}();
Object.defineProperty(vt.prototype, "interaction", { get: function() {
return this._interaction._proxy;
}, set: function() {
} });
var gt = function(t2, e2) {
for (var n2 = 0; n2 < e2.length; n2++) {
var r2 = e2[n2];
t2.push(r2);
}
return t2;
}, mt = function(t2) {
return gt([], t2);
}, yt = function(t2, e2) {
for (var n2 = 0; n2 < t2.length; n2++) if (e2(t2[n2], n2, t2)) return n2;
return -1;
}, bt = function(t2, e2) {
return t2[yt(t2, e2)];
}, xt = function(t2) {
s(n2, t2);
var e2 = p(n2);
function n2(t3, i2, o2) {
var a2;
r(this, n2), (a2 = e2.call(this, i2._interaction)).dropzone = void 0, a2.dragEvent = void 0, a2.relatedTarget = void 0, a2.draggable = void 0, a2.propagationStopped = false, a2.immediatePropagationStopped = false;
var s2 = "dragleave" === o2 ? t3.prev : t3.cur, c2 = s2.element, l2 = s2.dropzone;
return a2.type = o2, a2.target = c2, a2.currentTarget = c2, a2.dropzone = l2, a2.dragEvent = i2, a2.relatedTarget = i2.target, a2.draggable = i2.interactable, a2.timeStamp = i2.timeStamp, a2;
}
return o(n2, [{ key: "reject", value: function() {
var t3 = this, e3 = this._interaction.dropState;
if ("dropactivate" === this.type || this.dropzone && e3.cur.dropzone === this.dropzone && e3.cur.element === this.target) if (e3.prev.dropzone = this.dropzone, e3.prev.element = this.target, e3.rejected = true, e3.events.enter = null, this.stopImmediatePropagation(), "dropactivate" === this.type) {
var r2 = e3.activeDrops, i2 = yt(r2, function(e4) {
var n3 = e4.dropzone, r3 = e4.element;
return n3 === t3.dropzone && r3 === t3.target;
});
e3.activeDrops.splice(i2, 1);
var o2 = new n2(e3, this.dragEvent, "dropdeactivate");
o2.dropzone = this.dropzone, o2.target = this.target, this.dropzone.fire(o2);
} else this.dropzone.fire(new n2(e3, this.dragEvent, "dragleave"));
} }, { key: "preventDefault", value: function() {
} }, { key: "stopPropagation", value: function() {
this.propagationStopped = true;
} }, { key: "stopImmediatePropagation", value: function() {
this.immediatePropagationStopped = this.propagationStopped = true;
} }]), n2;
}(vt);
function wt(t2, e2) {
for (var n2 = 0, r2 = t2.slice(); n2 < r2.length; n2++) {
var i2 = r2[n2], o2 = i2.dropzone, a2 = i2.element;
e2.dropzone = o2, e2.target = a2, o2.fire(e2), e2.propagationStopped = e2.immediatePropagationStopped = false;
}
}
function Et(t2, e2) {
for (var n2 = function(t3, e3) {
for (var n3 = [], r3 = 0, i3 = t3.interactables.list; r3 < i3.length; r3++) {
var o2 = i3[r3];
if (o2.options.drop.enabled) {
var a2 = o2.options.drop.accept;
if (!(w.element(a2) && a2 !== e3 || w.string(a2) && !R(e3, a2) || w.func(a2) && !a2({ dropzone: o2, draggableElement: e3 }))) for (var s2 = 0, c2 = o2.getAllElements(); s2 < c2.length; s2++) {
var l2 = c2[s2];
l2 !== e3 && n3.push({ dropzone: o2, element: l2, rect: o2.getRect(l2) });
}
}
}
return n3;
}(t2, e2), r2 = 0; r2 < n2.length; r2++) {
var i2 = n2[r2];
i2.rect = i2.dropzone.getRect(i2.element);
}
return n2;
}
function Tt(t2, e2, n2) {
for (var r2 = t2.dropState, i2 = t2.interactable, o2 = t2.element, a2 = [], s2 = 0, c2 = r2.activeDrops; s2 < c2.length; s2++) {
var l2 = c2[s2], u2 = l2.dropzone, p2 = l2.element, f2 = l2.rect, d2 = u2.dropCheck(e2, n2, i2, o2, p2, f2);
a2.push(d2 ? p2 : null);
}
var h2 = function(t3) {
for (var e3, n3, r3, i3 = [], o3 = 0; o3 < t3.length; o3++) {
var a3 = t3[o3], s3 = t3[e3];
if (a3 && o3 !== e3) if (s3) {
var c3 = C(a3), l3 = C(s3);
if (c3 !== a3.ownerDocument) if (l3 !== a3.ownerDocument) if (c3 !== l3) {
i3 = i3.length ? i3 : j(s3);
var u3 = void 0;
if (s3 instanceof k.HTMLElement && a3 instanceof k.SVGElement && !(a3 instanceof k.SVGSVGElement)) {
if (a3 === l3) continue;
u3 = a3.ownerSVGElement;
} else u3 = a3;
for (var p3 = j(u3, s3.ownerDocument), f3 = 0; p3[f3] && p3[f3] === i3[f3]; ) f3++;
var d3 = [p3[f3 - 1], p3[f3], i3[f3]];
if (d3[0]) for (var h3 = d3[0].lastChild; h3; ) {
if (h3 === d3[1]) {
e3 = o3, i3 = p3;
break;
}
if (h3 === d3[2]) break;
h3 = h3.previousSibling;
}
} else r3 = s3, (parseInt(y(n3 = a3).getComputedStyle(n3).zIndex, 10) || 0) >= (parseInt(y(r3).getComputedStyle(r3).zIndex, 10) || 0) && (e3 = o3);
else e3 = o3;
} else e3 = o3;
}
return e3;
}(a2);
return r2.activeDrops[h2] || null;
}
function St(t2, e2, n2) {
var r2 = t2.dropState, i2 = { enter: null, leave: null, activate: null, deactivate: null, move: null, drop: null };
return "dragstart" === n2.type && (i2.activate = new xt(r2, n2, "dropactivate"), i2.activate.target = null, i2.activate.dropzone = null), "dragend" === n2.type && (i2.deactivate = new xt(r2, n2, "dropdeactivate"), i2.deactivate.target = null, i2.deactivate.dropzone = null), r2.rejected || (r2.cur.element !== r2.prev.element && (r2.prev.dropzone && (i2.leave = new xt(r2, n2, "dragleave"), n2.dragLeave = i2.leave.target = r2.prev.element, n2.prevDropzone = i2.leave.dropzone = r2.prev.dropzone), r2.cur.dropzone && (i2.enter = new xt(r2, n2, "dragenter"), n2.dragEnter = r2.cur.element, n2.dropzone = r2.cur.dropzone)), "dragend" === n2.type && r2.cur.dropzone && (i2.drop = new xt(r2, n2, "drop"), n2.dropzone = r2.cur.dropzone, n2.relatedTarget = r2.cur.element), "dragmove" === n2.type && r2.cur.dropzone && (i2.move = new xt(r2, n2, "dropmove"), n2.dropzone = r2.cur.dropzone)), i2;
}
function _t(t2, e2) {
var n2 = t2.dropState, r2 = n2.activeDrops, i2 = n2.cur, o2 = n2.prev;
e2.leave && o2.dropzone.fire(e2.leave), e2.enter && i2.dropzone.fire(e2.enter), e2.move && i2.dropzone.fire(e2.move), e2.drop && i2.dropzone.fire(e2.drop), e2.deactivate && wt(r2, e2.deactivate), n2.prev.dropzone = i2.dropzone, n2.prev.element = i2.element;
}
function Pt(t2, e2) {
var n2 = t2.interaction, r2 = t2.iEvent, i2 = t2.event;
if ("dragmove" === r2.type || "dragend" === r2.type) {
var o2 = n2.dropState;
e2.dynamicDrop && (o2.activeDrops = Et(e2, n2.element));
var a2 = r2, s2 = Tt(n2, a2, i2);
o2.rejected = o2.rejected && !!s2 && s2.dropzone === o2.cur.dropzone && s2.element === o2.cur.element, o2.cur.dropzone = s2 && s2.dropzone, o2.cur.element = s2 && s2.element, o2.events = St(n2, 0, a2);
}
}
var Ot = { id: "actions/drop", install: function(t2) {
var e2 = t2.actions, n2 = t2.interactStatic, r2 = t2.Interactable, i2 = t2.defaults;
t2.usePlugin(_), r2.prototype.dropzone = function(t3) {
return function(t4, e3) {
if (w.object(e3)) {
if (t4.options.drop.enabled = false !== e3.enabled, e3.listeners) {
var n3 = $(e3.listeners), r3 = Object.keys(n3).reduce(function(t5, e4) {
return t5[/^(enter|leave)/.test(e4) ? "drag".concat(e4) : /^(activate|deactivate|move)/.test(e4) ? "drop".concat(e4) : e4] = n3[e4], t5;
}, {}), i3 = t4.options.drop.listeners;
i3 && t4.off(i3), t4.on(r3), t4.options.drop.listeners = r3;
}
return w.func(e3.ondrop) && t4.on("drop", e3.ondrop), w.func(e3.ondropactivate) && t4.on("dropactivate", e3.ondropactivate), w.func(e3.ondropdeactivate) && t4.on("dropdeactivate", e3.ondropdeactivate), w.func(e3.ondragenter) && t4.on("dragenter", e3.ondragenter), w.func(e3.ondragleave) && t4.on("dragleave", e3.ondragleave), w.func(e3.ondropmove) && t4.on("dropmove", e3.ondropmove), /^(pointer|center)$/.test(e3.overlap) ? t4.options.drop.overlap = e3.overlap : w.number(e3.overlap) && (t4.options.drop.overlap = Math.max(Math.min(1, e3.overlap), 0)), "accept" in e3 && (t4.options.drop.accept = e3.accept), "checker" in e3 && (t4.options.drop.checker = e3.checker), t4;
}
if (w.bool(e3)) return t4.options.drop.enabled = e3, t4;
return t4.options.drop;
}(this, t3);
}, r2.prototype.dropCheck = function(t3, e3, n3, r3, i3, o2) {
return function(t4, e4, n4, r4, i4, o3, a2) {
var s2 = false;
if (!(a2 = a2 || t4.getRect(o3))) return !!t4.options.drop.checker && t4.options.drop.checker(e4, n4, s2, t4, o3, r4, i4);
var c2 = t4.options.drop.overlap;
if ("pointer" === c2) {
var l2 = K(r4, i4, "drag"), u2 = ot(e4);
u2.x += l2.x, u2.y += l2.y;
var p2 = u2.x > a2.left && u2.x < a2.right, f2 = u2.y > a2.top && u2.y < a2.bottom;
s2 = p2 && f2;
}
var d2 = r4.getRect(i4);
if (d2 && "center" === c2) {
var h2 = d2.left + d2.width / 2, v2 = d2.top + d2.height / 2;
s2 = h2 >= a2.left && h2 <= a2.right && v2 >= a2.top && v2 <= a2.bottom;
}
if (d2 && w.number(c2)) {
s2 = Math.max(0, Math.min(a2.right, d2.right) - Math.max(a2.left, d2.left)) * Math.max(0, Math.min(a2.bottom, d2.bottom) - Math.max(a2.top, d2.top)) / (d2.width * d2.height) >= c2;
}
t4.options.drop.checker && (s2 = t4.options.drop.checker(e4, n4, s2, t4, o3, r4, i4));
return s2;
}(this, t3, e3, n3, r3, i3, o2);
}, n2.dynamicDrop = function(e3) {
return w.bool(e3) ? (t2.dynamicDrop = e3, n2) : t2.dynamicDrop;
}, V(e2.phaselessTypes, { dragenter: true, dragleave: true, dropactivate: true, dropdeactivate: true, dropmove: true, drop: true }), e2.methodDict.drop = "dropzone", t2.dynamicDrop = false, i2.actions.drop = Ot.defaults;
}, listeners: { "interactions:before-action-start": function(t2) {
var e2 = t2.interaction;
"drag" === e2.prepared.name && (e2.dropState = { cur: { dropzone: null, element: null }, prev: { dropzone: null, element: null }, rejected: null, events: null, activeDrops: [] });
}, "interactions:after-action-start": function(t2, e2) {
var n2 = t2.interaction, r2 = (t2.event, t2.iEvent);
if ("drag" === n2.prepared.name) {
var i2 = n2.dropState;
i2.activeDrops = [], i2.events = {}, i2.activeDrops = Et(e2, n2.element), i2.events = St(n2, 0, r2), i2.events.activate && (wt(i2.activeDrops, i2.events.activate), e2.fire("actions/drop:start", { interaction: n2, dragEvent: r2 }));
}
}, "interactions:action-move": Pt, "interactions:after-action-move": function(t2, e2) {
var n2 = t2.interaction, r2 = t2.iEvent;
if ("drag" === n2.prepared.name) {
var i2 = n2.dropState;
_t(n2, i2.events), e2.fire("actions/drop:move", { interaction: n2, dragEvent: r2 }), i2.events = {};
}
}, "interactions:action-end": function(t2, e2) {
if ("drag" === t2.interaction.prepared.name) {
var n2 = t2.interaction, r2 = t2.iEvent;
Pt(t2, e2), _t(n2, n2.dropState.events), e2.fire("actions/drop:end", { interaction: n2, dragEvent: r2 });
}
}, "interactions:stop": function(t2) {
var e2 = t2.interaction;
if ("drag" === e2.prepared.name) {
var n2 = e2.dropState;
n2 && (n2.activeDrops = null, n2.events = null, n2.cur.dropzone = null, n2.cur.element = null, n2.prev.dropzone = null, n2.prev.element = null, n2.rejected = false);
}
} }, getActiveDrops: Et, getDrop: Tt, getDropEvents: St, fireDropEvents: _t, filterEventType: function(t2) {
return 0 === t2.search("drag") || 0 === t2.search("drop");
}, defaults: { enabled: false, accept: null, overlap: "pointer" } }, kt = Ot;
function Dt(t2) {
var e2 = t2.interaction, n2 = t2.iEvent, r2 = t2.phase;
if ("gesture" === e2.prepared.name) {
var i2 = e2.pointers.map(function(t3) {
return t3.pointer;
}), o2 = "start" === r2, a2 = "end" === r2, s2 = e2.interactable.options.deltaSource;
if (n2.touches = [i2[0], i2[1]], o2) n2.distance = pt(i2, s2), n2.box = ut(i2), n2.scale = 1, n2.ds = 0, n2.angle = ft(i2, s2), n2.da = 0, e2.gesture.startDistance = n2.distance, e2.gesture.startAngle = n2.angle;
else if (a2 || e2.pointers.length < 2) {
var c2 = e2.prevEvent;
n2.distance = c2.distance, n2.box = c2.box, n2.scale = c2.scale, n2.ds = 0, n2.angle = c2.angle, n2.da = 0;
} else n2.distance = pt(i2, s2), n2.box = ut(i2), n2.scale = n2.distance / e2.gesture.startDistance, n2.angle = ft(i2, s2), n2.ds = n2.scale - e2.gesture.scale, n2.da = n2.angle - e2.gesture.angle;
e2.gesture.distance = n2.distance, e2.gesture.angle = n2.angle, w.number(n2.scale) && n2.scale !== 1 / 0 && !isNaN(n2.scale) && (e2.gesture.scale = n2.scale);
}
}
var It = { id: "actions/gesture", before: ["actions/drag", "actions/resize"], install: function(t2) {
var e2 = t2.actions, n2 = t2.Interactable, r2 = t2.defaults;
n2.prototype.gesturable = function(t3) {
return w.object(t3) ? (this.options.gesture.enabled = false !== t3.enabled, this.setPerAction("gesture", t3), this.setOnEvents("gesture", t3), this) : w.bool(t3) ? (this.options.gesture.enabled = t3, this) : this.options.gesture;
}, e2.map.gesture = It, e2.methodDict.gesture = "gesturable", r2.actions.gesture = It.defaults;
}, listeners: { "interactions:action-start": Dt, "interactions:action-move": Dt, "interactions:action-end": Dt, "interactions:new": function(t2) {
t2.interaction.gesture = { angle: 0, distance: 0, scale: 1, startAngle: 0, startDistance: 0 };
}, "auto-start:check": function(t2) {
if (!(t2.interaction.pointers.length < 2)) {
var e2 = t2.interactable.options.gesture;
if (e2 && e2.enabled) return t2.action = { name: "gesture" }, false;
}
} }, defaults: {}, getCursor: function() {
return "";
}, filterEventType: function(t2) {
return 0 === t2.search("gesture");
} }, Mt = It;
function zt(t2, e2, n2, r2, i2, o2, a2) {
if (!e2) return false;
if (true === e2) {
var s2 = w.number(o2.width) ? o2.width : o2.right - o2.left, c2 = w.number(o2.height) ? o2.height : o2.bottom - o2.top;
if (a2 = Math.min(a2, Math.abs(("left" === t2 || "right" === t2 ? s2 : c2) / 2)), s2 < 0 && ("left" === t2 ? t2 = "right" : "right" === t2 && (t2 = "left")), c2 < 0 && ("top" === t2 ? t2 = "bottom" : "bottom" === t2 && (t2 = "top")), "left" === t2) {
var l2 = s2 >= 0 ? o2.left : o2.right;
return n2.x < l2 + a2;
}
if ("top" === t2) {
var u2 = c2 >= 0 ? o2.top : o2.bottom;
return n2.y < u2 + a2;
}
if ("right" === t2) return n2.x > (s2 >= 0 ? o2.right : o2.left) - a2;
if ("bottom" === t2) return n2.y > (c2 >= 0 ? o2.bottom : o2.top) - a2;
}
return !!w.element(r2) && (w.element(e2) ? e2 === r2 : F(r2, e2, i2));
}
function At(t2) {
var e2 = t2.iEvent, n2 = t2.interaction;
if ("resize" === n2.prepared.name && n2.resizeAxes) {
var r2 = e2;
n2.interactable.options.resize.square ? ("y" === n2.resizeAxes ? r2.delta.x = r2.delta.y : r2.delta.y = r2.delta.x, r2.axes = "xy") : (r2.axes = n2.resizeAxes, "x" === n2.resizeAxes ? r2.delta.y = 0 : "y" === n2.resizeAxes && (r2.delta.x = 0));
}
}
var Rt, Ct, jt = { id: "actions/resize", before: ["actions/drag"], install: function(t2) {
var e2 = t2.actions, n2 = t2.browser, r2 = t2.Interactable, i2 = t2.defaults;
jt.cursors = function(t3) {
return t3.isIe9 ? { x: "e-resize", y: "s-resize", xy: "se-resize", top: "n-resize", left: "w-resize", bottom: "s-resize", right: "e-resize", topleft: "se-resize", bottomright: "se-resize", topright: "ne-resize", bottomleft: "ne-resize" } : { x: "ew-resize", y: "ns-resize", xy: "nwse-resize", top: "ns-resize", left: "ew-resize", bottom: "ns-resize", right: "ew-resize", topleft: "nwse-resize", bottomright: "nwse-resize", topright: "nesw-resize", bottomleft: "nesw-resize" };
}(n2), jt.defaultMargin = n2.supportsTouch || n2.supportsPointerEvent ? 20 : 10, r2.prototype.resizable = function(e3) {
return function(t3, e4, n3) {
if (w.object(e4)) return t3.options.resize.enabled = false !== e4.enabled, t3.setPerAction("resize", e4), t3.setOnEvents("resize", e4), w.string(e4.axis) && /^x$|^y$|^xy$/.test(e4.axis) ? t3.options.resize.axis = e4.axis : null === e4.axis && (t3.options.resize.axis = n3.defaults.actions.resize.axis), w.bool(e4.preserveAspectRatio) ? t3.options.resize.preserveAspectRatio = e4.preserveAspectRatio : w.bool(e4.square) && (t3.options.resize.square = e4.square), t3;
if (w.bool(e4)) return t3.options.resize.enabled = e4, t3;
return t3.options.resize;
}(this, e3, t2);
}, e2.map.resize = jt, e2.methodDict.resize = "resizable", i2.actions.resize = jt.defaults;
}, listeners: { "interactions:new": function(t2) {
t2.interaction.resizeAxes = "xy";
}, "interactions:action-start": function(t2) {
!function(t3) {
var e2 = t3.iEvent, n2 = t3.interaction;
if ("resize" === n2.prepared.name && n2.prepared.edges) {
var r2 = e2, i2 = n2.rect;
n2._rects = { start: V({}, i2), corrected: V({}, i2), previous: V({}, i2), delta: { left: 0, right: 0, width: 0, top: 0, bottom: 0, height: 0 } }, r2.edges = n2.prepared.edges, r2.rect = n2._rects.corrected, r2.deltaRect = n2._rects.delta;
}
}(t2), At(t2);
}, "interactions:action-move": function(t2) {
!function(t3) {
var e2 = t3.iEvent, n2 = t3.interaction;
if ("resize" === n2.prepared.name && n2.prepared.edges) {
var r2 = e2, i2 = n2.interactable.options.resize.invert, o2 = "reposition" === i2 || "negate" === i2, a2 = n2.rect, s2 = n2._rects, c2 = s2.start, l2 = s2.corrected, u2 = s2.delta, p2 = s2.previous;
if (V(p2, l2), o2) {
if (V(l2, a2), "reposition" === i2) {
if (l2.top > l2.bottom) {
var f2 = l2.top;
l2.top = l2.bottom, l2.bottom = f2;
}
if (l2.left > l2.right) {
var d2 = l2.left;
l2.left = l2.right, l2.right = d2;
}
}
} else l2.top = Math.min(a2.top, c2.bottom), l2.bottom = Math.max(a2.bottom, c2.top), l2.left = Math.min(a2.left, c2.right), l2.right = Math.max(a2.right, c2.left);
for (var h2 in l2.width = l2.right - l2.left, l2.height = l2.bottom - l2.top, l2) u2[h2] = l2[h2] - p2[h2];
r2.edges = n2.prepared.edges, r2.rect = l2, r2.deltaRect = u2;
}
}(t2), At(t2);
}, "interactions:action-end": function(t2) {
var e2 = t2.iEvent, n2 = t2.interaction;
if ("resize" === n2.prepared.name && n2.prepared.edges) {
var r2 = e2;
r2.edges = n2.prepared.edges, r2.rect = n2._rects.corrected, r2.deltaRect = n2._rects.delta;
}
}, "auto-start:check": function(t2) {
var e2 = t2.interaction, n2 = t2.interactable, r2 = t2.element, i2 = t2.rect, o2 = t2.buttons;
if (i2) {
var a2 = V({}, e2.coords.cur.page), s2 = n2.options.resize;
if (s2 && s2.enabled && (!e2.pointerIsDown || !/mouse|pointer/.test(e2.pointerType) || 0 != (o2 & s2.mouseButtons))) {
if (w.object(s2.edges)) {
var c2 = { left: false, right: false, top: false, bottom: false };
for (var l2 in c2) c2[l2] = zt(l2, s2.edges[l2], a2, e2._latestPointer.eventTarget, r2, i2, s2.margin || jt.defaultMargin);
c2.left = c2.left && !c2.right, c2.top = c2.top && !c2.bottom, (c2.left || c2.right || c2.top || c2.bottom) && (t2.action = { name: "resize", edges: c2 });
} else {
var u2 = "y" !== s2.axis && a2.x > i2.right - jt.defaultMargin, p2 = "x" !== s2.axis && a2.y > i2.bottom - jt.defaultMargin;
(u2 || p2) && (t2.action = { name: "resize", axes: (u2 ? "x" : "") + (p2 ? "y" : "") });
}
return !t2.action && void 0;
}
}
} }, defaults: { square: false, preserveAspectRatio: false, axis: "xy", margin: NaN, edges: null, invert: "none" }, cursors: null, getCursor: function(t2) {
var e2 = t2.edges, n2 = t2.axis, r2 = t2.name, i2 = jt.cursors, o2 = null;
if (n2) o2 = i2[r2 + n2];
else if (e2) {
for (var a2 = "", s2 = 0, c2 = ["top", "bottom", "left", "right"]; s2 < c2.length; s2++) {
var l2 = c2[s2];
e2[l2] && (a2 += l2);
}
o2 = i2[a2];
}
return o2;
}, filterEventType: function(t2) {
return 0 === t2.search("resize");
}, defaultMargin: null }, Ft = jt, Xt = { id: "actions", install: function(t2) {
t2.usePlugin(Mt), t2.usePlugin(Ft), t2.usePlugin(_), t2.usePlugin(kt);
} }, Yt = 0;
var Lt = { request: function(t2) {
return Rt(t2);
}, cancel: function(t2) {
return Ct(t2);
}, init: function(t2) {
if (Rt = t2.requestAnimationFrame, Ct = t2.cancelAnimationFrame, !Rt) for (var e2 = ["ms", "moz", "webkit", "o"], n2 = 0; n2 < e2.length; n2++) {
var r2 = e2[n2];
Rt = t2["".concat(r2, "RequestAnimationFrame")], Ct = t2["".concat(r2, "CancelAnimationFrame")] || t2["".concat(r2, "CancelRequestAnimationFrame")];
}
Rt = Rt && Rt.bind(t2), Ct = Ct && Ct.bind(t2), Rt || (Rt = function(e3) {
var n3 = Date.now(), r3 = Math.max(0, 16 - (n3 - Yt)), i2 = t2.setTimeout(function() {
e3(n3 + r3);
}, r3);
return Yt = n3 + r3, i2;
}, Ct = function(t3) {
return clearTimeout(t3);
});
} };
var qt = { defaults: { enabled: false, margin: 60, container: null, speed: 300 }, now: Date.now, interaction: null, i: 0, x: 0, y: 0, isScrolling: false, prevTime: 0, margin: 0, speed: 0, start: function(t2) {
qt.isScrolling = true, Lt.cancel(qt.i), t2.autoScroll = qt, qt.interaction = t2, qt.prevTime = qt.now(), qt.i = Lt.request(qt.scroll);
}, stop: function() {
qt.isScrolling = false, qt.interaction && (qt.interaction.autoScroll = null), Lt.cancel(qt.i);
}, scroll: function() {
var t2 = qt.interaction, e2 = t2.interactable, n2 = t2.element, r2 = t2.prepared.name, i2 = e2.options[r2].autoScroll, o2 = Bt(i2.container, e2, n2), a2 = qt.now(), s2 = (a2 - qt.prevTime) / 1e3, c2 = i2.speed * s2;
if (c2 >= 1) {
var l2 = { x: qt.x * c2, y: qt.y * c2 };
if (l2.x || l2.y) {
var u2 = Vt(o2);
w.window(o2) ? o2.scrollBy(l2.x, l2.y) : o2 && (o2.scrollLeft += l2.x, o2.scrollTop += l2.y);
var p2 = Vt(o2), f2 = { x: p2.x - u2.x, y: p2.y - u2.y };
(f2.x || f2.y) && e2.fire({ type: "autoscroll", target: n2, interactable: e2, delta: f2, interaction: t2, container: o2 });
}
qt.prevTime = a2;
}
qt.isScrolling && (Lt.cancel(qt.i), qt.i = Lt.request(qt.scroll));
}, check: function(t2, e2) {
var n2;
return null == (n2 = t2.options[e2].autoScroll) ? void 0 : n2.enabled;
}, onInteractionMove: function(t2) {
var e2 = t2.interaction, n2 = t2.pointer;
if (e2.interacting() && qt.check(e2.interactable, e2.prepared.name)) if (e2.simulation) qt.x = qt.y = 0;
else {
var r2, i2, o2, a2, s2 = e2.interactable, c2 = e2.element, l2 = e2.prepared.name, u2 = s2.options[l2].autoScroll, p2 = Bt(u2.container, s2, c2);
if (w.window(p2)) a2 = n2.clientX < qt.margin, r2 = n2.clientY < qt.margin, i2 = n2.clientX > p2.innerWidth - qt.margin, o2 = n2.clientY > p2.innerHeight - qt.margin;
else {
var f2 = Y(p2);
a2 = n2.clientX < f2.left + qt.margin, r2 = n2.clientY < f2.top + qt.margin, i2 = n2.clientX > f2.right - qt.margin, o2 = n2.clientY > f2.bottom - qt.margin;
}
qt.x = i2 ? 1 : a2 ? -1 : 0, qt.y = o2 ? 1 : r2 ? -1 : 0, qt.isScrolling || (qt.margin = u2.margin, qt.speed = u2.speed, qt.start(e2));
}
} };
function Bt(t2, e2, n2) {
return (w.string(t2) ? W(t2, e2, n2) : t2) || y(n2);
}
function Vt(t2) {
return w.window(t2) && (t2 = window.document.body), { x: t2.scrollLeft, y: t2.scrollTop };
}
var Wt = { id: "auto-scroll", install: function(t2) {
var e2 = t2.defaults, n2 = t2.actions;
t2.autoScroll = qt, qt.now = function() {
return t2.now();
}, n2.phaselessTypes.autoscroll = true, e2.perAction.autoScroll = qt.defaults;
}, listeners: { "interactions:new": function(t2) {
t2.interaction.autoScroll = null;
}, "interactions:destroy": function(t2) {
t2.interaction.autoScroll = null, qt.stop(), qt.interaction && (qt.interaction = null);
}, "interactions:stop": qt.stop, "interactions:action-move": function(t2) {
return qt.onInteractionMove(t2);
} } }, Gt = Wt;
function Nt(t2, e2) {
var n2 = false;
return function() {
return n2 || (g.console.warn(e2), n2 = true), t2.apply(this, arguments);
};
}
function Ut(t2, e2) {
return t2.name = e2.name, t2.axis = e2.axis, t2.edges = e2.edges, t2;
}
function Ht(t2) {
return w.bool(t2) ? (this.options.styleCursor = t2, this) : null === t2 ? (delete this.options.styleCursor, this) : this.options.styleCursor;
}
function Kt(t2) {
return w.func(t2) ? (this.options.actionChecker = t2, this) : null === t2 ? (delete this.options.actionChecker, this) : this.options.actionChecker;
}
var $t = { id: "auto-start/interactableMethods", install: function(t2) {
var e2 = t2.Interactable;
e2.prototype.getAction = function(e3, n2, r2, i2) {
var o2 = function(t3, e4, n3, r3, i3) {
var o3 = t3.getRect(r3), a2 = e4.buttons || { 0: 1, 1: 4, 3: 8, 4: 16 }[e4.button], s2 = { action: null, interactable: t3, interaction: n3, element: r3, rect: o3, buttons: a2 };
return i3.fire("auto-start:check", s2), s2.action;
}(this, n2, r2, i2, t2);
return this.options.actionChecker ? this.options.actionChecker(e3, n2, o2, this, i2, r2) : o2;
}, e2.prototype.ignoreFrom = Nt(function(t3) {
return this._backCompatOption("ignoreFrom", t3);
}, "Interactable.ignoreFrom() has been deprecated. Use Interactble.draggable({ignoreFrom: newValue})."), e2.prototype.allowFrom = Nt(function(t3) {
return this._backCompatOption("allowFrom", t3);
}, "Interactable.allowFrom() has been deprecated. Use Interactble.draggable({allowFrom: newValue})."), e2.prototype.actionChecker = Kt, e2.prototype.styleCursor = Ht;
} };
function Jt(t2, e2, n2, r2, i2) {
return e2.testIgnoreAllow(e2.options[t2.name], n2, r2) && e2.options[t2.name].enabled && ee(e2, n2, t2, i2) ? t2 : null;
}
function Qt(t2, e2, n2, r2, i2, o2, a2) {
for (var s2 = 0, c2 = r2.length; s2 < c2; s2++) {
var l2 = r2[s2], u2 = i2[s2], p2 = l2.getAction(e2, n2, t2, u2);
if (p2) {
var f2 = Jt(p2, l2, u2, o2, a2);
if (f2) return { action: f2, interactable: l2, element: u2 };
}
}
return { action: null, interactable: null, element: null };
}
function Zt(t2, e2, n2, r2, i2) {
var o2 = [], a2 = [], s2 = r2;
function c2(t3) {
o2.push(t3), a2.push(s2);
}
for (; w.element(s2); ) {
o2 = [], a2 = [], i2.interactables.forEachMatch(s2, c2);
var l2 = Qt(t2, e2, n2, o2, a2, r2, i2);
if (l2.action && !l2.interactable.options[l2.action.name].manualStart) return l2;
s2 = A(s2);
}
return { action: null, interactable: null, element: null };
}
function te(t2, e2, n2) {
var r2 = e2.action, i2 = e2.interactable, o2 = e2.element;
r2 = r2 || { name: null }, t2.interactable = i2, t2.element = o2, Ut(t2.prepared, r2), t2.rect = i2 && r2.name ? i2.getRect(o2) : null, ie(t2, n2), n2.fire("autoStart:prepared", { interaction: t2 });
}
function ee(t2, e2, n2, r2) {
var i2 = t2.options, o2 = i2[n2.name].max, a2 = i2[n2.name].maxPerElement, s2 = r2.autoStart.maxInteractions, c2 = 0, l2 = 0, u2 = 0;
if (!(o2 && a2 && s2)) return false;
for (var p2 = 0, f2 = r2.interactions.list; p2 < f2.length; p2++) {
var d2 = f2[p2], h2 = d2.prepared.name;
if (d2.interacting()) {
if (++c2 >= s2) return false;
if (d2.interactable === t2) {
if ((l2 += h2 === n2.name ? 1 : 0) >= o2) return false;
if (d2.element === e2 && (u2++, h2 === n2.name && u2 >= a2)) return false;
}
}
}
return s2 > 0;
}
function ne(t2, e2) {
return w.number(t2) ? (e2.autoStart.maxInteractions = t2, this) : e2.autoStart.maxInteractions;