UNPKG

hexo-theme-nexmoe

Version:

🔥 A special hexo theme.

2 lines • 122 kB
// @fancyapps/ui/Fancybox v4.0.26 !(function(t, e) { typeof exports === 'object' && typeof module !== 'undefined' ? e(exports) : typeof define === 'function' && define.amd ? define(['exports'], e) : e((t = typeof globalThis !== 'undefined' ? globalThis : t || self).window = t.window || {}); }(this, t => { function e(t, e) { const i = Object.keys(t); if (Object.getOwnPropertySymbols) { let n = Object.getOwnPropertySymbols(t); e && (n = n.filter(e => { return Object.getOwnPropertyDescriptor(t, e).enumerable; })), i.push.apply(i, n); } return i; } function i(t) { for (let i = 1; i < arguments.length; i++) { var n = arguments[i] != null ? arguments[i] : {}; i % 2 ? e(Object(n), !0).forEach(e => { r(t, e, n[e]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : e(Object(n)).forEach(e => { Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e)); }); } return t; } function n(t) { return n = 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; }, n(t); } function o(t, e) { if (!(t instanceof e)) throw new TypeError('Cannot call a class as a function'); } function a(t, e) { for (let i = 0; i < e.length; i++) { const n = e[i]; n.enumerable = n.enumerable || !1, n.configurable = !0, 'value' in n && (n.writable = !0), Object.defineProperty(t, n.key, n); } } function s(t, e, i) { return e && a(t.prototype, e), i && a(t, i), Object.defineProperty(t, 'prototype', {writable: !1}), t; } function r(t, e, i) { return e in t ? Object.defineProperty(t, e, {value: i, enumerable: !0, configurable: !0, writable: !0}) : t[e] = i, t; } function l(t, e) { if (typeof e !== 'function' && e !== null) 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}}), Object.defineProperty(t, 'prototype', {writable: !1}), e && h(t, e); } function c(t) { return c = Object.setPrototypeOf ? Object.getPrototypeOf : function(t) { return t.__proto__ || Object.getPrototypeOf(t); }, c(t); } function h(t, e) { return h = Object.setPrototypeOf || function(t, e) { return t.__proto__ = e, t; }, h(t, e); } function d(t) { if (void 0 === t) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called'); return t; } function u(t, e) { if (e && (typeof e === 'object' || typeof e === 'function')) return e; if (void 0 !== e) throw new TypeError('Derived constructors may only return object or undefined'); return d(t); } function f(t) { const e = (function() { if (typeof Reflect === 'undefined' || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if (typeof Proxy === 'function') return !0; try { return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], () => {})), !0; } catch (t) { return !1; } }()); return function() { let i; const n = c(t); if (e) { const o = c(this).constructor; i = Reflect.construct(n, arguments, o); } else i = n.apply(this, arguments); return u(this, i); }; } function v(t, e) { for (;!Object.prototype.hasOwnProperty.call(t, e) && (t = c(t)) !== null;);return t; } function p() { return p = typeof Reflect !== 'undefined' && Reflect.get ? Reflect.get : function(t, e, i) { const n = v(t, e); if (n) { const o = Object.getOwnPropertyDescriptor(n, e); return o.get ? o.get.call(arguments.length < 3 ? t : i) : o.value; } }, p.apply(this, arguments); } function g(t, e) { return (function(t) { if (Array.isArray(t)) return t; }(t)) || (function(t, e) { let i = t == null ? null : typeof Symbol !== 'undefined' && t[Symbol.iterator] || t['@@iterator']; if (i == null) return; let n, o; const a = []; let s = !0; let r = !1; try { for (i = i.call(t); !(s = (n = i.next()).done) && (a.push(n.value), !e || a.length !== e); s = !0); } catch (t) { r = !0, o = t; } finally { try { s || i.return == null || i.return(); } finally { if (r) throw o; } } return a; }(t, e)) || y(t, e) || (function() { throw new TypeError('Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.'); }()); } function m(t) { return (function(t) { if (Array.isArray(t)) return b(t); }(t)) || (function(t) { if (typeof Symbol !== 'undefined' && t[Symbol.iterator] != null || t['@@iterator'] != null) return Array.from(t); }(t)) || y(t) || (function() { throw new TypeError('Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.'); }()); } function y(t, e) { if (t) { if (typeof t === 'string') return b(t, e); let i = Object.prototype.toString.call(t).slice(8, -1); return i === 'Object' && t.constructor && (i = t.constructor.name), i === 'Map' || i === 'Set' ? Array.from(t) : i === 'Arguments' || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i) ? b(t, e) : void 0; } } function b(t, e) { (e == null || e > t.length) && (e = t.length); for (var i = 0, n = new Array(e); i < e; i++)n[i] = t[i]; return n; } function x(t, e) { let i = typeof Symbol !== 'undefined' && t[Symbol.iterator] || t['@@iterator']; if (!i) { if (Array.isArray(t) || (i = y(t)) || e && t && typeof t.length === 'number') { i && (t = i); let n = 0; const o = function() {}; return {s: o, n: function() { return n >= t.length ? {done: !0} : {done: !1, value: t[n++]}; }, e: function(t) { throw t; }, f: o}; } throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.'); } let a; let s = !0; let r = !1; return {s: function() { i = i.call(t); }, n: function() { const t = i.next(); return s = t.done, t; }, e: function(t) { r = !0, a = t; }, f: function() { try { s || i.return == null || i.return(); } finally { if (r) throw a; } }}; } const w = function(t) { return n(t) === 'object' && t !== null && t.constructor === Object && Object.prototype.toString.call(t) === '[object Object]'; }; const k = function t() { for (var e = !1, i = arguments.length, o = new Array(i), a = 0; a < i; a++)o[a] = arguments[a]; typeof o[0] === 'boolean' && (e = o.shift()); const s = o[0]; if (!s || n(s) !== 'object') throw new Error('extendee must be an object'); for (let r = o.slice(1), l = r.length, c = 0; c < l; c++) { const h = r[c]; for (const d in h) if (h.hasOwnProperty(d)) { const u = h[d]; if (e && (Array.isArray(u) || w(u))) { const f = Array.isArray(u) ? [] : {}; s[d] = t(!0, s.hasOwnProperty(d) ? s[d] : f, u); } else s[d] = u; } } return s; }; const S = function(t) { const e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1e4; return t = parseFloat(t) || 0, Math.round((t + Number.EPSILON) * e) / e; }; const C = function t(e) { return !!(e && n(e) === 'object' && e instanceof Element && e !== document.body) && (!e.__Panzoom && ((function(t) { const e = getComputedStyle(t)['overflow-y']; const i = getComputedStyle(t)['overflow-x']; const n = (e === 'scroll' || e === 'auto') && Math.abs(t.scrollHeight - t.clientHeight) > 1; const o = (i === 'scroll' || i === 'auto') && Math.abs(t.scrollWidth - t.clientWidth) > 1; return n || o; }(e)) ? e : t(e.parentNode))); }; const $ = typeof window !== 'undefined' && window.ResizeObserver || (function() { function t(e) { o(this, t), this.observables = [], this.boundCheck = this.check.bind(this), this.boundCheck(), this.callback = e; } return s(t, [{key: 'observe', value: function(t) { if (!this.observables.some(e => { return e.el === t; })) { const e = {el: t, size: {height: t.clientHeight, width: t.clientWidth}}; this.observables.push(e); } }}, {key: 'unobserve', value: function(t) { this.observables = this.observables.filter(e => { return e.el !== t; }); }}, {key: 'disconnect', value: function() { this.observables = []; }}, {key: 'check', value: function() { const t = this.observables.filter(t => { const e = t.el.clientHeight; const i = t.el.clientWidth; if (t.size.height !== e || t.size.width !== i) return t.size.height = e, t.size.width = i, !0; }).map(t => { return t.el; }); t.length > 0 && this.callback(t), window.requestAnimationFrame(this.boundCheck); }}]), t; }()); const E = s(function t(e) { o(this, t), this.id = self.Touch && e instanceof Touch ? e.identifier : -1, this.pageX = e.pageX, this.pageY = e.pageY, this.clientX = e.clientX, this.clientY = e.clientY; }); const P = function(t, e) { return e ? Math.sqrt(Math.pow(e.clientX - t.clientX, 2) + Math.pow(e.clientY - t.clientY, 2)) : 0; }; const T = function(t, e) { return e ? {clientX: (t.clientX + e.clientX) / 2, clientY: (t.clientY + e.clientY) / 2} : t; }; const L = function(t) { return 'changedTouches' in t; }; const _ = (function() { function t(e) { const i = this; const n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; const a = n.start; const s = void 0 === a ? function() { return !0; } : a; const r = n.move; const l = void 0 === r ? function() {} : r; const c = n.end; const h = void 0 === c ? function() {} : c; o(this, t), this._element = e, this.startPointers = [], this.currentPointers = [], this._pointerStart = function(t) { if (!(t.buttons > 0 && t.button !== 0)) { const e = new E(t); i.currentPointers.some(t => { return t.id === e.id; }) || i._triggerPointerStart(e, t) && (window.addEventListener('mousemove', i._move), window.addEventListener('mouseup', i._pointerEnd)); } }, this._touchStart = function(t) { for (let e = 0, n = Array.from(t.changedTouches || []); e < n.length; e++) { const o = n[e]; i._triggerPointerStart(new E(o), t); } }, this._move = function(t) { let e; const n = i.currentPointers.slice(); const o = L(t) ? Array.from(t.changedTouches).map(t => { return new E(t); }) : [new E(t)]; const a = []; const s = x(o); try { const r = function() { const t = e.value; const n = i.currentPointers.findIndex(e => { return e.id === t.id; }); if (n < 0) return 'continue'; a.push(t), i.currentPointers[n] = t; }; for (s.s(); !(e = s.n()).done;)r(); } catch (t) { s.e(t); } finally { s.f(); }i._moveCallback(n, i.currentPointers.slice(), t); }, this._triggerPointerEnd = function(t, e) { const n = i.currentPointers.findIndex(e => { return e.id === t.id; }); return !(n < 0) && (i.currentPointers.splice(n, 1), i.startPointers.splice(n, 1), i._endCallback(t, e), !0); }, this._pointerEnd = function(t) { t.buttons > 0 && t.button !== 0 || i._triggerPointerEnd(new E(t), t) && (window.removeEventListener('mousemove', i._move, {passive: !1}), window.removeEventListener('mouseup', i._pointerEnd, {passive: !1})); }, this._touchEnd = function(t) { for (let e = 0, n = Array.from(t.changedTouches || []); e < n.length; e++) { const o = n[e]; i._triggerPointerEnd(new E(o), t); } }, this._startCallback = s, this._moveCallback = l, this._endCallback = h, this._element.addEventListener('mousedown', this._pointerStart, {passive: !1}), this._element.addEventListener('touchstart', this._touchStart, {passive: !1}), this._element.addEventListener('touchmove', this._move, {passive: !1}), this._element.addEventListener('touchend', this._touchEnd), this._element.addEventListener('touchcancel', this._touchEnd); } return s(t, [{key: 'stop', value: function() { this._element.removeEventListener('mousedown', this._pointerStart, {passive: !1}), this._element.removeEventListener('touchstart', this._touchStart, {passive: !1}), this._element.removeEventListener('touchmove', this._move, {passive: !1}), this._element.removeEventListener('touchend', this._touchEnd), this._element.removeEventListener('touchcancel', this._touchEnd), window.removeEventListener('mousemove', this._move), window.removeEventListener('mouseup', this._pointerEnd); }}, {key: '_triggerPointerStart', value: function(t, e) { return !!this._startCallback(t, e) && (this.currentPointers.push(t), this.startPointers.push(t), !0); }}]), t; }()); const A = function(t, e) { return t.split('.').reduce((t, e) => { return t && t[e]; }, e); }; const O = (function() { function t() { const e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; o(this, t), this.options = k(!0, {}, e), this.plugins = [], this.events = {}; for (let i = 0, n = ['on', 'once']; i < n.length; i++) for (let a = n[i], s = 0, r = Object.entries(this.options[a] || {}); s < r.length; s++) { const l = r[s]; this[a].apply(this, m(l)); } } return s(t, [{key: 'option', value: function(t, e) { t = String(t); let i = A(t, this.options); if (typeof i === 'function') { for (var n, o = arguments.length, a = new Array(o > 2 ? o - 2 : 0), s = 2; s < o; s++)a[s - 2] = arguments[s]; i = (n = i).call.apply(n, [this, this].concat(a)); } return void 0 === i ? e : i; }}, {key: 'localize', value: function(t) { const e = this; const i = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : []; return t = (t = String(t).replace(/\{\{(\w+).?(\w+)?\}\}/g, (t, n, o) => { let a = ''; o ? a = e.option(''.concat(n[0] + n.toLowerCase().substring(1), '.l10n.').concat(o)) : n && (a = e.option('l10n.'.concat(n))), a || (a = t); for (let s = 0; s < i.length; s++)a = a.split(i[s][0]).join(i[s][1]); return a; })).replace(/\{\{(.*)\}\}/, (t, e) => { return e; }); }}, {key: 'on', value: function(t, e) { const i = this; if (w(t)) { for (let n = 0, o = Object.entries(t); n < o.length; n++) { const a = o[n]; this.on.apply(this, m(a)); } return this; } return String(t).split(' ').forEach(t => { const n = i.events[t] = i.events[t] || []; n.indexOf(e) == -1 && n.push(e); }), this; }}, {key: 'once', value: function(t, e) { const i = this; if (w(t)) { for (let n = 0, o = Object.entries(t); n < o.length; n++) { const a = o[n]; this.once.apply(this, m(a)); } return this; } return String(t).split(' ').forEach(t => { const n = function n() { i.off(t, n); for (var o = arguments.length, a = new Array(o), s = 0; s < o; s++)a[s] = arguments[s]; e.call.apply(e, [i, i].concat(a)); }; n._ = e, i.on(t, n); }), this; }}, {key: 'off', value: function(t, e) { const i = this; if (!w(t)) return t.split(' ').forEach(t => { const n = i.events[t]; if (!n || !n.length) return i; for (var o = -1, a = 0, s = n.length; a < s; a++) { const r = n[a]; if (r && (r === e || r._ === e)) { o = a; break; } }o != -1 && n.splice(o, 1); }), this; for (let n = 0, o = Object.entries(t); n < o.length; n++) { const a = o[n]; this.off.apply(this, m(a)); } }}, {key: 'trigger', value: function(t) { for (var e = arguments.length, i = new Array(e > 1 ? e - 1 : 0), n = 1; n < e; n++)i[n - 1] = arguments[n]; let o; const a = x(m(this.events[t] || []).slice()); try { for (a.s(); !(o = a.n()).done;) { const s = o.value; if (s && !1 === s.call.apply(s, [this, this].concat(i))) return !1; } } catch (t) { a.e(t); } finally { a.f(); } let r; const l = x(m(this.events['*'] || []).slice()); try { for (l.s(); !(r = l.n()).done;) { const c = r.value; if (c && !1 === c.call.apply(c, [this, t, this].concat(i))) return !1; } } catch (t) { l.e(t); } finally { l.f(); } return !0; }}, {key: 'attachPlugins', value: function(t) { for (var e = {}, i = 0, n = Object.entries(t || {}); i < n.length; i++) { const o = g(n[i], 2); const a = o[0]; const s = o[1]; !1 === this.options[a] || this.plugins[a] || (this.options[a] = k({}, s.defaults || {}, this.options[a]), e[a] = new s(this)); } for (let r = 0, l = Object.entries(e); r < l.length; r++) { const c = g(l[r], 2); c[0], c[1].attach(this); } return this.plugins = Object.assign({}, this.plugins, e), this; }}, {key: 'detachPlugins', value: function() { for (const t in this.plugins) { let e = void 0; (e = this.plugins[t]) && typeof e.detach === 'function' && e.detach(this); } return this.plugins = {}, this; }}]), t; }()); const z = {touch: !0, zoom: !0, pinchToZoom: !0, panOnlyZoomed: !1, lockAxis: !1, friction: .64, decelFriction: .88, zoomFriction: .74, bounceForce: .2, baseScale: 1, minScale: 1, maxScale: 2, step: .5, textSelection: !1, click: 'toggleZoom', wheel: 'zoom', wheelFactor: 42, wheelLimit: 5, draggableClass: 'is-draggable', draggingClass: 'is-dragging', ratio: 1}; const M = (function(t) { l(n, t); const e = f(n); function n(t) { let i; const a = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; o(this, n), (i = e.call(this, k(!0, {}, z, a))).state = 'init', i.$container = t; for (let s = 0, r = ['onLoad', 'onWheel', 'onClick']; s < r.length; s++) { const l = r[s]; i[l] = i[l].bind(d(i)); } return i.initLayout(), i.resetValues(), i.attachPlugins(n.Plugins), i.trigger('init'), i.updateMetrics(), i.attachEvents(), i.trigger('ready'), !1 === i.option('centerOnStart') ? i.state = 'ready' : i.panTo({friction: 0}), t.__Panzoom = d(i), i; } return s(n, [{key: 'initLayout', value: function() { const t = this.$container; if (!(t instanceof HTMLElement)) throw new Error('Panzoom: Container not found'); const e = this.option('content') || t.querySelector('.panzoom__content'); if (!e) throw new Error('Panzoom: Content not found'); this.$content = e; let i; let n = this.option('viewport') || t.querySelector('.panzoom__viewport'); n || !1 === this.option('wrapInner') || ((n = document.createElement('div')).classList.add('panzoom__viewport'), (i = n).append.apply(i, m(t.childNodes)), t.appendChild(n)); this.$viewport = n || e.parentNode; }}, {key: 'resetValues', value: function() { this.updateRate = this.option('updateRate', /iPhone|iPad|iPod|Android/i.test(navigator.userAgent) ? 250 : 24), this.container = {width: 0, height: 0}, this.viewport = {width: 0, height: 0}, this.content = {origWidth: 0, origHeight: 0, width: 0, height: 0, x: this.option('x', 0), y: this.option('y', 0), scale: this.option('baseScale')}, this.transform = {x: 0, y: 0, scale: 1}, this.resetDragPosition(); }}, {key: 'onLoad', value: function(t) { this.updateMetrics(), this.panTo({scale: this.option('baseScale'), friction: 0}), this.trigger('load', t); }}, {key: 'onClick', value: function(t) { if (!t.defaultPrevented) if (this.option('textSelection') && window.getSelection().toString().length)t.stopPropagation(); else { const e = this.$content.getClientRects()[0]; if (this.state !== 'ready' && (this.dragPosition.midPoint || Math.abs(e.top - this.dragStart.rect.top) > 1 || Math.abs(e.left - this.dragStart.rect.left) > 1)) return t.preventDefault(), void t.stopPropagation(); !1 !== this.trigger('click', t) && this.option('zoom') && this.option('click') === 'toggleZoom' && (t.preventDefault(), t.stopPropagation(), this.zoomWithClick(t)); } }}, {key: 'onWheel', value: function(t) { !1 !== this.trigger('wheel', t) && this.option('zoom') && this.option('wheel') && this.zoomWithWheel(t); }}, {key: 'zoomWithWheel', value: function(t) { void 0 === this.changedDelta && (this.changedDelta = 0); const e = Math.max(-1, Math.min(1, -t.deltaY || -t.deltaX || t.wheelDelta || -t.detail)); const i = this.content.scale; let n = i * (100 + e * this.option('wheelFactor')) / 100; if (e < 0 && Math.abs(i - this.option('minScale')) < .01 || e > 0 && Math.abs(i - this.option('maxScale')) < .01 ? (this.changedDelta += Math.abs(e), n = i) : (this.changedDelta = 0, n = Math.max(Math.min(n, this.option('maxScale')), this.option('minScale'))), !(this.changedDelta > this.option('wheelLimit')) && (t.preventDefault(), n !== i)) { const o = this.$content.getBoundingClientRect(); const a = t.clientX - o.left; const s = t.clientY - o.top; this.zoomTo(n, {x: a, y: s}); } }}, {key: 'zoomWithClick', value: function(t) { const e = this.$content.getClientRects()[0]; const i = t.clientX - e.left; const n = t.clientY - e.top; this.toggleZoom({x: i, y: n}); }}, {key: 'attachEvents', value: function() { const t = this; this.$content.addEventListener('load', this.onLoad), this.$container.addEventListener('wheel', this.onWheel, {passive: !1}), this.$container.addEventListener('click', this.onClick, {passive: !1}), this.initObserver(); var e = new _(this.$container, {start: function(i, n) { if (!t.option('touch')) return !1; if (t.velocity.scale < 0) return !1; const o = n.composedPath()[0]; if (!e.currentPointers.length) { if (['BUTTON', 'TEXTAREA', 'OPTION', 'INPUT', 'SELECT', 'VIDEO'].indexOf(o.nodeName) !== -1) return !1; if (t.option('textSelection') && (function(t, e, i) { for (let n = t.childNodes, o = document.createRange(), a = 0; a < n.length; a++) { const s = n[a]; if (s.nodeType === Node.TEXT_NODE) { o.selectNodeContents(s); const r = o.getBoundingClientRect(); if (e >= r.left && i >= r.top && e <= r.right && i <= r.bottom) return s; } } return !1; }(o, i.clientX, i.clientY))) return !1; } return !C(o) && (!1 !== t.trigger('touchStart', n) && (n.type === 'mousedown' && n.preventDefault(), t.state = 'pointerdown', t.resetDragPosition(), t.dragPosition.midPoint = null, t.dragPosition.time = Date.now(), !0)); }, move: function(i, n, o) { if (t.state === 'pointerdown') if (!1 !== t.trigger('touchMove', o)) { if (!(n.length < 2 && !0 === t.option('panOnlyZoomed') && t.content.width <= t.viewport.width && t.content.height <= t.viewport.height && t.transform.scale <= t.option('baseScale')) && (!(n.length > 1) || t.option('zoom') && !1 !== t.option('pinchToZoom'))) { const a = T(i[0], i[1]); const s = T(n[0], n[1]); const r = s.clientX - a.clientX; const l = s.clientY - a.clientY; const c = P(i[0], i[1]); const h = P(n[0], n[1]); const d = c && h ? h / c : 1; t.dragOffset.x += r, t.dragOffset.y += l, t.dragOffset.scale *= d, t.dragOffset.time = Date.now() - t.dragPosition.time; const u = t.dragStart.scale === 1 && t.option('lockAxis'); if (u && !t.lockAxis) { if (Math.abs(t.dragOffset.x) < 6 && Math.abs(t.dragOffset.y) < 6) return void o.preventDefault(); const f = Math.abs(180 * Math.atan2(t.dragOffset.y, t.dragOffset.x) / Math.PI); t.lockAxis = f > 45 && f < 135 ? 'y' : 'x'; } if (u === 'xy' || t.lockAxis !== 'y') { if (o.preventDefault(), o.stopPropagation(), o.stopImmediatePropagation(), t.lockAxis && (t.dragOffset[t.lockAxis === 'x' ? 'y' : 'x'] = 0), t.$container.classList.add(t.option('draggingClass')), t.transform.scale === t.option('baseScale') && t.lockAxis === 'y' || (t.dragPosition.x = t.dragStart.x + t.dragOffset.x), t.transform.scale === t.option('baseScale') && t.lockAxis === 'x' || (t.dragPosition.y = t.dragStart.y + t.dragOffset.y), t.dragPosition.scale = t.dragStart.scale * t.dragOffset.scale, n.length > 1) { const v = T(e.startPointers[0], e.startPointers[1]); const p = v.clientX - t.dragStart.rect.x; const g = v.clientY - t.dragStart.rect.y; const m = t.getZoomDelta(t.content.scale * t.dragOffset.scale, p, g); const y = m.deltaX; const b = m.deltaY; t.dragPosition.x -= y, t.dragPosition.y -= b, t.dragPosition.midPoint = s; } else t.setDragResistance(); t.transform = {x: t.dragPosition.x, y: t.dragPosition.y, scale: t.dragPosition.scale}, t.startAnimation(); } } } else o.preventDefault(); }, end: function(n, o) { if (t.state === 'pointerdown') if (t._dragOffset = i({}, t.dragOffset), e.currentPointers.length)t.resetDragPosition(); else if (t.state = 'decel', t.friction = t.option('decelFriction'), t.recalculateTransform(), t.$container.classList.remove(t.option('draggingClass')), !1 !== t.trigger('touchEnd', o) && t.state === 'decel') { const a = t.option('minScale'); if (t.transform.scale < a)t.zoomTo(a, {friction: .64}); else { const s = t.option('maxScale'); if (t.transform.scale - s > .01) { const r = t.dragPosition.midPoint || n; const l = t.$content.getClientRects()[0]; t.zoomTo(s, {friction: .64, x: r.clientX - l.left, y: r.clientY - l.top}); } else; } } }}); this.pointerTracker = e; }}, {key: 'initObserver', value: function() { const t = this; this.resizeObserver || (this.resizeObserver = new $(() => { t.updateTimer || (t.updateTimer = setTimeout(() => { const e = t.$container.getBoundingClientRect(); e.width && e.height ? ((Math.abs(e.width - t.container.width) > 1 || Math.abs(e.height - t.container.height) > 1) && (t.isAnimating() && t.endAnimation(!0), t.updateMetrics(), t.panTo({x: t.content.x, y: t.content.y, scale: t.option('baseScale'), friction: 0})), t.updateTimer = null) : t.updateTimer = null; }, t.updateRate)); }), this.resizeObserver.observe(this.$container)); }}, {key: 'resetDragPosition', value: function() { this.lockAxis = null, this.friction = this.option('friction'), this.velocity = {x: 0, y: 0, scale: 0}; const t = this.content; const e = t.x; const n = t.y; const o = t.scale; this.dragStart = {rect: this.$content.getBoundingClientRect(), x: e, y: n, scale: o}, this.dragPosition = i(i({}, this.dragPosition), {}, {x: e, y: n, scale: o}), this.dragOffset = {x: 0, y: 0, scale: 1, time: 0}; }}, {key: 'updateMetrics', value: function(t) { !0 !== t && this.trigger('beforeUpdate'); let e; const n = this.$container; const o = this.$content; const a = this.$viewport; const s = o instanceof HTMLImageElement; const r = this.option('zoom'); const l = this.option('resizeParent', r); let c = this.option('width'); let h = this.option('height'); let d = c || (e = o, Math.max(parseFloat(e.naturalWidth || 0), parseFloat(e.width && e.width.baseVal && e.width.baseVal.value || 0), parseFloat(e.offsetWidth || 0), parseFloat(e.scrollWidth || 0))); let u = h || (function(t) { return Math.max(parseFloat(t.naturalHeight || 0), parseFloat(t.height && t.height.baseVal && t.height.baseVal.value || 0), parseFloat(t.offsetHeight || 0), parseFloat(t.scrollHeight || 0)); }(o)); Object.assign(o.style, {width: c ? ''.concat(c, 'px') : '', height: h ? ''.concat(h, 'px') : '', maxWidth: '', maxHeight: ''}), l && Object.assign(a.style, {width: '', height: ''}); const f = this.option('ratio'); c = d = S(d * f), h = u = S(u * f); const v = o.getBoundingClientRect(); const p = a.getBoundingClientRect(); const g = a == n ? p : n.getBoundingClientRect(); let m = Math.max(a.offsetWidth, S(p.width)); let y = Math.max(a.offsetHeight, S(p.height)); const b = window.getComputedStyle(a); if (m -= parseFloat(b.paddingLeft) + parseFloat(b.paddingRight), y -= parseFloat(b.paddingTop) + parseFloat(b.paddingBottom), this.viewport.width = m, this.viewport.height = y, r) { if (Math.abs(d - v.width) > .1 || Math.abs(u - v.height) > .1) { const x = (function(t, e, i, n) { const o = Math.min(i / t || 0, n / e); return {width: t * o || 0, height: e * o || 0}; }(d, u, Math.min(d, v.width), Math.min(u, v.height))); c = S(x.width), h = S(x.height); }Object.assign(o.style, {width: ''.concat(c, 'px'), height: ''.concat(h, 'px'), transform: ''}); } if (l && (Object.assign(a.style, {width: ''.concat(c, 'px'), height: ''.concat(h, 'px')}), this.viewport = i(i({}, this.viewport), {}, {width: c, height: h})), s && r && typeof this.options.maxScale !== 'function') { const w = this.option('maxScale'); this.options.maxScale = function() { return this.content.origWidth > 0 && this.content.fitWidth > 0 ? this.content.origWidth / this.content.fitWidth : w; }; } this.content = i(i({}, this.content), {}, {origWidth: d, origHeight: u, fitWidth: c, fitHeight: h, width: c, height: h, scale: 1, isZoomable: r}), this.container = {width: g.width, height: g.height}, !0 !== t && this.trigger('afterUpdate'); }}, {key: 'zoomIn', value: function(t) { this.zoomTo(this.content.scale + (t || this.option('step'))); }}, {key: 'zoomOut', value: function(t) { this.zoomTo(this.content.scale - (t || this.option('step'))); }}, {key: 'toggleZoom', value: function() { const t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; const e = this.option('maxScale'); const i = this.option('baseScale'); const n = this.content.scale > i + .5 * (e - i) ? i : e; this.zoomTo(n, t); }}, {key: 'zoomTo', value: function() { let t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : this.option('baseScale'); const e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; const i = e.x; let n = void 0 === i ? null : i; const o = e.y; let a = void 0 === o ? null : o; t = Math.max(Math.min(t, this.option('maxScale')), this.option('minScale')); const s = S(this.content.scale / (this.content.width / this.content.fitWidth), 1e7); n === null && (n = this.content.width * s * .5), a === null && (a = this.content.height * s * .5); const r = this.getZoomDelta(t, n, a); const l = r.deltaX; const c = r.deltaY; n = this.content.x - l, a = this.content.y - c, this.panTo({x: n, y: a, scale: t, friction: this.option('zoomFriction')}); }}, {key: 'getZoomDelta', value: function(t) { const e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0; const i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0; const n = this.content.fitWidth * this.content.scale; const o = this.content.fitHeight * this.content.scale; const a = e > 0 && n ? e / n : 0; const s = i > 0 && o ? i / o : 0; const r = this.content.fitWidth * t; const l = this.content.fitHeight * t; const c = (r - n) * a; const h = (l - o) * s; return {deltaX: c, deltaY: h}; }}, {key: 'panTo', value: function() { const t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; const e = t.x; let n = void 0 === e ? this.content.x : e; const o = t.y; let a = void 0 === o ? this.content.y : o; let s = t.scale; const r = t.friction; const l = void 0 === r ? this.option('friction') : r; const c = t.ignoreBounds; const h = void 0 !== c && c; if (s = s || this.content.scale || 1, !h) { const d = this.getBounds(s); const u = d.boundX; const f = d.boundY; u && (n = Math.max(Math.min(n, u.to), u.from)), f && (a = Math.max(Math.min(a, f.to), f.from)); } this.friction = l, this.transform = i(i({}, this.transform), {}, {x: n, y: a, scale: s}), l ? (this.state = 'panning', this.velocity = {x: (1 / this.friction - 1) * (n - this.content.x), y: (1 / this.friction - 1) * (a - this.content.y), scale: (1 / this.friction - 1) * (s - this.content.scale)}, this.startAnimation()) : this.endAnimation(); }}, {key: 'startAnimation', value: function() { const t = this; this.rAF ? cancelAnimationFrame(this.rAF) : this.trigger('startAnimation'), this.rAF = requestAnimationFrame(() => { return t.animate(); }); }}, {key: 'animate', value: function() { const t = this; if (this.setEdgeForce(), this.setDragForce(), this.velocity.x *= this.friction, this.velocity.y *= this.friction, this.velocity.scale *= this.friction, this.content.x += this.velocity.x, this.content.y += this.velocity.y, this.content.scale += this.velocity.scale, this.isAnimating()) this.setTransform(); else if (this.state !== 'pointerdown') return void this.endAnimation(); this.rAF = requestAnimationFrame(() => { return t.animate(); }); }}, {key: 'getBounds', value: function(t) { let e = this.boundX; let i = this.boundY; if (void 0 !== e && void 0 !== i) return {boundX: e, boundY: i}; e = {from: 0, to: 0}, i = {from: 0, to: 0}, t = t || this.transform.scale; const n = this.content.fitWidth * t; const o = this.content.fitHeight * t; const a = this.viewport.width; const s = this.viewport.height; if (n < a) { const r = S(.5 * (a - n)); e.from = r, e.to = r; } else e.from = S(a - n); if (o < s) { const l = .5 * (s - o); i.from = l, i.to = l; } else i.from = S(s - o); return {boundX: e, boundY: i}; }}, {key: 'setEdgeForce', value: function() { if (this.state === 'decel') { let t, e, i, n; const o = this.option('bounceForce'); const a = this.getBounds(Math.max(this.transform.scale, this.content.scale)); const s = a.boundX; const r = a.boundY; if (s && (t = this.content.x < s.from, e = this.content.x > s.to), r && (i = this.content.y < r.from, n = this.content.y > r.to), t || e) { let l = ((t ? s.from : s.to) - this.content.x) * o; const c = this.content.x + (this.velocity.x + l) / this.friction; c >= s.from && c <= s.to && (l += this.velocity.x), this.velocity.x = l, this.recalculateTransform(); } if (i || n) { let h = ((i ? r.from : r.to) - this.content.y) * o; const d = this.content.y + (h + this.velocity.y) / this.friction; d >= r.from && d <= r.to && (h += this.velocity.y), this.velocity.y = h, this.recalculateTransform(); } } }}, {key: 'setDragResistance', value: function() { if (this.state === 'pointerdown') { let t, e, i, n; const o = this.getBounds(this.dragPosition.scale); const a = o.boundX; const s = o.boundY; if (a && (t = this.dragPosition.x < a.from, e = this.dragPosition.x > a.to), s && (i = this.dragPosition.y < s.from, n = this.dragPosition.y > s.to), (t || e) && (!t || !e)) { const r = t ? a.from : a.to; const l = r - this.dragPosition.x; this.dragPosition.x = r - .3 * l; } if ((i || n) && (!i || !n)) { const c = i ? s.from : s.to; const h = c - this.dragPosition.y; this.dragPosition.y = c - .3 * h; } } }}, {key: 'setDragForce', value: function() { this.state === 'pointerdown' && (this.velocity.x = this.dragPosition.x - this.content.x, this.velocity.y = this.dragPosition.y - this.content.y, this.velocity.scale = this.dragPosition.scale - this.content.scale); }}, {key: 'recalculateTransform', value: function() { this.transform.x = this.content.x + this.velocity.x / (1 / this.friction - 1), this.transform.y = this.content.y + this.velocity.y / (1 / this.friction - 1), this.transform.scale = this.content.scale + this.velocity.scale / (1 / this.friction - 1); }}, {key: 'isAnimating', value: function() { return !(!this.friction || !(Math.abs(this.velocity.x) > .05 || Math.abs(this.velocity.y) > .05 || Math.abs(this.velocity.scale) > .05)); }}, {key: 'setTransform', value: function(t) { let e, n, o, a, s; (t ? (e = S(this.transform.x), n = S(this.transform.y), o = this.transform.scale, this.content = i(i({}, this.content), {}, {x: e, y: n, scale: o})) : (e = S(this.content.x), n = S(this.content.y), o = this.content.scale / (this.content.width / this.content.fitWidth), this.content = i(i({}, this.content), {}, {x: e, y: n})), this.trigger('beforeTransform'), e = S(this.content.x), n = S(this.content.y), t && this.option('zoom')) ? (a = S(this.content.fitWidth * o), s = S(this.content.fitHeight * o), this.content.width = a, this.content.height = s, this.transform = i(i({}, this.transform), {}, {width: a, height: s, scale: o}), Object.assign(this.$content.style, {width: ''.concat(a, 'px'), height: ''.concat(s, 'px'), maxWidth: 'none', maxHeight: 'none', transform: 'translate3d('.concat(e, 'px, ').concat(n, 'px, 0) scale(1)')})) : this.$content.style.transform = 'translate3d('.concat(e, 'px, ').concat(n, 'px, 0) scale(').concat(o, ')'); this.trigger('afterTransform'); }}, {key: 'endAnimation', value: function(t) { cancelAnimationFrame(this.rAF), this.rAF = null, this.velocity = {x: 0, y: 0, scale: 0}, this.setTransform(!0), this.state = 'ready', this.handleCursor(), !0 !== t && this.trigger('endAnimation'); }}, {key: 'handleCursor', value: function() { const t = this.option('draggableClass'); t && this.option('touch') && (this.option('panOnlyZoomed') == 1 && this.content.width <= this.viewport.width && this.content.height <= this.viewport.height && this.transform.scale <= this.option('baseScale') ? this.$container.classList.remove(t) : this.$container.classList.add(t)); }}, {key: 'detachEvents', value: function() { this.$content.removeEventListener('load', this.onLoad), this.$container.removeEventListener('wheel', this.onWheel, {passive: !1}), this.$container.removeEventListener('click', this.onClick, {passive: !1}), this.pointerTracker && (this.pointerTracker.stop(), this.pointerTracker = null), this.resizeObserver && (this.resizeObserver.disconnect(), this.resizeObserver = null); }}, {key: 'destroy', value: function() { this.state !== 'destroy' && (this.state = 'destroy', clearTimeout(this.updateTimer), this.updateTimer = null, cancelAnimationFrame(this.rAF), this.rAF = null, this.detachEvents(), this.detachPlugins(), this.resetDragPosition()); }}]), n; }(O)); M.version = '4.0.26', M.Plugins = {}; const I = function(t, e) { let i = 0; return function() { const n = new Date().getTime(); if (!(n - i < e)) return i = n, t.apply(void 0, arguments); }; }; const F = (function() { function t(e) { o(this, t), this.$container = null, this.$prev = null, this.$next = null, this.carousel = e, this.onRefresh = this.onRefresh.bind(this); } return s(t, [{key: 'option', value: function(t) { return this.carousel.option('Navigation.'.concat(t)); }}, {key: 'createButton', value: function(t) { let e; const i = this; const n = document.createElement('button'); n.setAttribute('title', this.carousel.localize('{{'.concat(t.toUpperCase(), '}}'))); const o = this.option('classNames.button') + ' ' + this.option('classNames.'.concat(t)); return (e = n.classList).add.apply(e, m(o.split(' '))), n.setAttribute('tabindex', '0'), n.innerHTML = this.carousel.localize(this.option(''.concat(t, 'Tpl'))), n.addEventListener('click', e => { e.preventDefault(), e.stopPropagation(), i.carousel['slide'.concat(t === 'next' ? 'Next' : 'Prev')](); }), n; }}, {key: 'build', value: function() { let t; this.$container || (this.$container = document.createElement('div'), (t = this.$container.classList).add.apply(t, m(this.option('classNames.main').split(' '))), this.carousel.$container.appendChild(this.$container)); this.$next || (this.$next = this.createButton('next'), this.$container.appendChild(this.$next)), this.$prev || (this.$prev = this.createButton('prev'), this.$container.appendChild(this.$prev)); }}, {key: 'onRefresh', value: function() { const t = this.carousel.pages.length; t <= 1 || t > 1 && this.carousel.elemDimWidth < this.carousel.wrapDimWidth && !Number.isInteger(this.carousel.option('slidesPerPage')) ? this.cleanup() : (this.build(), this.$prev.removeAttribute('disabled'), this.$next.removeAttribute('disabled'), this.carousel.option('infiniteX', this.carousel.option('infinite')) || (this.carousel.page <= 0 && this.$prev.setAttribute('disabled', ''), this.carousel.page >= t - 1 && this.$next.setAttribute('disabled', ''))); }}, {key: 'cleanup', value: function() { this.$prev && this.$prev.remove(), this.$prev = null, this.$next && this.$next.remove(), this.$next = null, this.$container && this.$container.remove(), this.$container = null; }}, {key: 'attach', value: function() { this.carousel.on('refresh change', this.onRefresh); }}, {key: 'detach', value: function() { this.carousel.off('refresh change', this.onRefresh), this.cleanup(); }}]), t; }()); F.defaults = {prevTpl: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" tabindex="-1"><path d="M15 3l-9 9 9 9"/></svg>', nextTpl: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" tabindex="-1"><path d="M9 3l9 9-9 9"/></svg>', classNames: {main: 'carousel__nav', button: 'carousel__button', next: 'is-next', prev: 'is-prev'}}; const R = (function() { function t(e) { o(this, t), this.carousel = e, this.$list = null, this.events = {change: this.onChange.bind(this), refresh: this.onRefresh.bind(this)}; } return s(t, [{key: 'buildList', value: function() { const t = this; if (!(this.carousel.pages.length < this.carousel.option('Dots.minSlideCount'))) { const e = document.createElement('ol'); return e.classList.add('carousel__dots'), e.addEventListener('click', e => { if ('page' in e.target.dataset) { e.preventDefault(), e.stopPropagation(); const i = parseInt(e.target.dataset.page, 10); const n = t.carousel; i !== n.page && (n.pages.length < 3 && n.option('infinite') ? n[i == 0 ? 'slidePrev' : 'slideNext']() : n.slideTo(i)); } }), this.$list = e, this.carousel.$container.appendChild(e), this.carousel.$container.classList.add('has-dots'), e; } }}, {key: 'removeList', value: function() { this.$list && (this.$list.parentNode.removeChild(this.$list), this.$list = null), this.carousel.$container.classList.remove('has-dots'); }}, {key: 'rebuildDots', value: function() { const t = this; let e = this.$list; const i = !!e; const n = this.carousel.pages.length; if (n < 2)i && this.removeList(); else { i || (e = this.buildList()); const o = this.$list.children.length; if (o > n) for (let a = n; a < o; a++) this.$list.removeChild(this.$list.lastChild); else { for (let s = function(e) { const i = document.createElement('li'); i.classList.add('carousel__dot'), i.dataset.page = e, i.setAttribute('role', 'button'), i.setAttribute('tabindex', '0'), i.setAttribute('title', t.carousel.localize('{{GOTO}}', [['%d', e + 1]])), i.addEventListener('keydown', t => { let e; const n = t.code; n === 'Enter' || n === 'NumpadEnter' ? e = i : n === 'ArrowRight' ? e = i.nextSibling : n === 'ArrowLeft' && (e = i.previousSibling), e && e.click(); }), t.$list.appendChild(i); }, r = o; r < n; r++)s(r); this.setActiveDot(); } } }}, {key: 'setActiveDot', value: function() { if (this.$list) { this.$list.childNodes.forEach(t => { t.classList.remove('is-selected'); }); const t = this.$list.childNodes[this.carousel.page]; t && t.classList.add('is-selected'); } }}, {key: 'onChange', value: function() { this.setActiveDot(); }}, {key: 'onRefresh', value: function() { this.rebuildDots(); }}, {key: 'attach', value: function() { this.carousel.on(this.events); }}, {key: 'detach', value: function() { this.removeList(), this.carousel.off(this.events), this.carousel = null; }}]), t; }()); const N = (function() { function t(e) { o(this, t), this.carousel = e, this.selectedIndex = null, this.friction = 0, this.onNavReady = this.onNavReady.bind(this), this.onNavClick = this.onNavClick.bind(this), this.onNavCreateSlide = this.onNavCreateSlide.bind(this), this.onTargetChange = this.onTargetChange.bind(this); } return s(t, [{key: 'addAsTargetFor', value: function(t) { this.target = this.carousel, this.nav = t, this.attachEvents(); }}, {key: 'addAsNavFor', value: function(t) { this.target = t, this.nav = this.carousel, this.attachEvents(); }}, {key: 'attachEvents', value: function() { this.nav.options.initialSlide = this.target.options.initialPage, this.nav.on('ready', this.onNavReady), this.nav.on('createSlide', this.onNavCreateSlide), this.nav.on('Panzoom.click', this.onNavClick), this.target.on('change', this.onTargetChange), this.target.on('Panzoom.afterUpdate', this.onTargetChange); }}, {key: 'onNavReady', value: function() { this.onTargetChange(!0); }}, {key: 'onNavClick', value: function(t, e, i) { const n = i.target.closest('.carousel__slide'); if (n) { i.stopPropagation(); const o = parseInt(n.dataset.index, 10); const a = this.target.findPageForSlide(o); this.target.page !== a && this.target.slideTo(a, {friction: this.friction}), this.markSelectedSlide(o); } }}, {key: 'onNavCreateSlide', value: function(t, e) { e.index === this.selectedIndex && this.markSelectedSlide(e.index); }}, {key: 'onTargetChange', value: function() { const t = this.target.pages[this.target.page].indexes[0]; const e = this.nav.findPageForSlide(t); this.nav.slideTo(e), this.markSelectedSlide(t); }}, {key: 'markSelectedSlide', value: function(t) { this.selectedIndex = t, m(this.nav.slides).filter(t => { return t.$el && t.$el.classList.remove('is-nav-selected'); }); const e = this.nav.slides[t]; e && e.$el && e.$el.classList.add('is-nav-selected'); }}, {key: 'attach', value: function(t) { const e = t.options.Sync; (e.target || e.nav) && (e.target ? this.addAsNavFor(e.target) : e.nav && this.addAsTargetFor(e.nav), this.friction = e.friction); }}, {key: 'detach', value: function() { this.nav && (this.nav.off('ready', this.onNavReady), this.nav.off('Panzoom.click', this.onNavClick), this.nav.off('createSlide', this.onNavCreateSlide)), this.target && (this.target.off('Panzoom.afterUpdate', this.onTargetChange), this.target.off('change', this.onTargetChange)); }}]), t; }()); N.defaults = {friction: .92}; const D = {Navigation: F, Dots: R, Sync: N}; const B = {slides: [], preload: 0, slidesPerPage: 'auto', initialPage: null, initialSlide: null, friction: .92, center: !0, infinite: !0, fill: !0, dragFree: !1, prefix: '', classNames: {viewport: 'carousel__viewport', track: 'carousel__track', slide: 'carousel__slide', slideSelected: 'is-selected'}, l10n: {NEXT: 'Next slide', PREV: 'Previous slide', GOTO: 'Go to slide #%d'}}; const W = (function(t) { l(n, t); const e = f(n); function n(t) { let i; let a = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; if (o(this, n), a = k(!0, {}, B, a), (i = e.call(this, a)).state = 'init', i.$container = t, !(i.$container instanceof HTMLElement)) throw new Error('No root element provided'); return i.slideNext = I(i.slideNext.bind(d(i)), 250), i.slidePrev = I(i.slidePrev.bind(d(i)), 250), i.init(), t.__Carousel = d(i), i; } return s(n, [{key: 'init', value: function() { this.pages = [], this.page = this.pageIndex = null, this.prevPage = this.prevPageIndex = null, this.attachPlugins(n.Plugins), this.trigger('init'), this.initLayout(), this.initSlides(), this.updateMetrics(), this.$track && this.pages.length && (this.$track.style.transform = 'translate3d('.concat(-1 * this.pages[this.page].left, 'px, 0px, 0) scale(1)')), this.manageSlideVisiblity(), this.initPanzoom(), this.state = 'ready', this.trigger('ready'); }}, {key: 'initLayout', value: function() { let t, e, i, n; const o = this.option('prefix'); const a = this.option('classNames'); (this.$viewport = this.option('viewport') || this.$container.querySelector('.'.concat(o).concat(a.viewport)), this.$viewport) || (this.$viewport = document.createElement('div'), (t = this.$viewport.classList).add.apply(t, m((o + a.viewport).split(' '))), (e = this.$viewport).append.apply(e, m(this.$container.childNodes)), this.$container.appendChild(this.$viewport)); (this.$track = this.option('track') || this.$container.querySelector('.'.concat(o).concat(a.track)), this.$track) || (this.$track = document.createElement('div'), (i = this.$track.classList).add.apply(i, m((o + a.track).split(' '))), (n = this.$track).append.apply(n, m(this.$viewport.childNodes)), this.$viewport.appendChild(this.$track)); }}, {key: 'initSlides', value: function() { const t = this; this.slides = [], this.$viewport.querySelectorAll('.'.concat(this.option('prefix')).concat(this.option('classNames.slide'))).forEach(e => { const i = {$el: e, isDom: !0}; t.slides.push(i), t.trigger('createSlide', i, t.slides.length); }), Array.isArray(this.options.slides) && (this.slides = k(!0, m(this.slides), this.options.slides)); }}, {key: 'updateMetrics', value: function() { let t; const e = this; let n = 0; const o = []; this.slides.forEach((i, a) => { const s = i.$el; const r = i.isDom || !t ? e.getSlideMetrics(s) : t; i.index = a, i.width = r, i.left = n, t = r, n += r, o.push(a); }); let a = Math.max(this.$track.offsetWidth, S(this.$track.getBoundingClientRect().width)); const s = getComputedStyle(this.$track); a -= parseFloat(s.paddingLeft) + parseFloat(s.paddingRight), this.contentWidth = n, this.viewportWidth = a; const r = []; const l = this.option('slidesPerPage'); if (Number.isInteger(l) && n > a) for (let c = 0; c < this.slides.length; c += l)r.push({indexes: o.slice(c, c + l), slides: this.slides.slice(c, c + l)}); else for (let h = 0, d = 0, u = 0; u < this.slides.length; u += 1) { const f = this.slides[u]; (!r.length || d + f.width > a) && (r.push({indexes: [], slides: []}), h = r.length - 1, d = 0), d += f.width, r[h].indexes.push(u), r[h].slides.push(f); } const v = this.option('center'); const p = this.option('fill'); r.forEach((t, i) => { t.index = i, t.width = t.slides.reduce((t, e) => { return t + e.width; }, 0), t.left = t.slides[0].left, v && (t.left += .5 * (a - t.width) * -1), p && !e.option('infiniteX', e.option('infinite')) && n > a && (t.left = Math.max(t.left, 0), t.left = Math.min(t.left, n - a)); }); let g; const y = []; r.forEach(t => { const e = i({}, t); g && e.left === g.left ? (g.width += e.width, g.slides = [].concat(m(g.slides), m(e.slides)), g.indexes = [].concat(m(g.indexes), m(e.indexes))) : (e.index = y.length, g = e, y.push(e)); }), this.pages = y; let b = this.page; if (b === null) { const x = this.option('initialSlide'); b = x !== null ? this.findPageForSlide(x) : parseInt(this.option('initialPage', 0), 10) || 0, y[b] || (b = y.length && b > y.length ? y[y.length - 1].index : 0), this.page = b, this.pageIndex = b; } this.updatePanzoom(), this.trigger('refresh'); }}, {key: 'getSlideMetrics', value: function(t) { if (!t) { let e, i; const n = this.slides[0]; if ((t = document.createElement('div')).dataset.isTestEl = 1, t.style.visibility = 'hidden', (e = t.classList).add.apply(e, m((this.option('prefix') + this.option('classNames.slide')).split(' '))), n.customClass)(i = t.classList).add.apply(i, m(n.customClass.split(' '))); this.$track.prepend(t); } let o = Math.max(t.offsetWidth, S(t.getBoundingClientRect().width)); const a = t.currentStyle || window.getComputedStyle(t); return o = o + (parseFloat(a.marginLeft) || 0) + (parseFloat(a.marginRight) || 0), t.dataset.isTestEl && t.remove(), o; }}, {key: 'findPageForSlide', value: function(t) { t = parseInt(t, 10) || 0; const e = this.pages.find(e => { return e.indexes.indexOf(t) > -1; }); return e ? e.index : null; }}, {key: 'slideNext', value: function() { this.slideTo(this.pageIndex + 1); }}, {key: 'slidePrev', value: function() { this.slideTo(this.pageIndex - 1); }}, {key: 'slideTo', value: function(t) { const e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; const i = e.x; const n = void 0 === i ? -1 * this.setPage(t, !0) : i; const o = e.y; const a = void 0 === o ? 0 : o; const s = e.friction; const r = void 0 === s ? this.option('friction') : s; this.Panzoom.content.x === n && !this.Panzoom.velocity.x && r || (this.Panzoom.panTo({x: n, y: a, friction: r, ignoreBounds: !0}), this.state === 'ready' && this.Panzoom.state === 'ready' && this.trigger('settle')); }}, {key: 'initPanzoom', value: function() { const t = this; this.Panzoom && this.Panzoom.destroy(); const e = k(!0, {}, {content: this.$track, wrapInner: !1, resizeParent: !1, zoom: !1, click: !1, lockAxis: 'x', x: this.pages.length ? -1 * this.pages[this.page].left : 0, centerOnStart: !1, textSelection: function() { return t.option('textSelection', !1); }, panOnlyZoomed: function() { return this.content.width <= this.viewport.width; }}, this.option('Panzoom')); this.Panzoom = new M(this.$container, e), this.Panzoom.on({'*': function(e) { for (var i = arguments.length, n = new Array(i > 1 ? i - 1