1(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){ 2"use strict"; 3 4Object.defineProperty(exports, "__esModule", { 5 value: true 6}); 7exports.extend = extend; 8exports.getDocument = getDocument; 9exports.getWindow = getWindow; 10exports.ssrWindow = exports.ssrDocument = void 0; 11function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } 12/** 13 * SSR Window 4.0.2 14 * Better handling for window object in SSR environment 15 * https://github.com/nolimits4web/ssr-window 16 * 17 * Copyright 2021, Vladimir Kharlampidi 18 * 19 * Licensed under MIT 20 * 21 * Released on: December 13, 2021 22 */ 23/* eslint-disable no-param-reassign */ 24function isObject(obj) { 25 return obj !== null && _typeof(obj) === 'object' && 'constructor' in obj && obj.constructor === Object; 26} 27function extend() { 28 var target = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; 29 var src = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; 30 Object.keys(src).forEach(function (key) { 31 if (typeof target[key] === 'undefined') target[key] = src[key];else if (isObject(src[key]) && isObject(target[key]) && Object.keys(src[key]).length > 0) { 32 extend(target[key], src[key]); 33 } 34 }); 35} 36var ssrDocument = { 37 body: {}, 38 addEventListener: function addEventListener() {}, 39 removeEventListener: function removeEventListener() {}, 40 activeElement: { 41 blur: function blur() {}, 42 nodeName: '' 43 }, 44 querySelector: function querySelector() { 45 return null; 46 }, 47 querySelectorAll: function querySelectorAll() { 48 return []; 49 }, 50 getElementById: function getElementById() { 51 return null; 52 }, 53 createEvent: function createEvent() { 54 return { 55 initEvent: function initEvent() {} 56 }; 57 }, 58 createElement: function createElement() { 59 return { 60 children: [], 61 childNodes: [], 62 style: {}, 63 setAttribute: function setAttribute() {}, 64 getElementsByTagName: function getElementsByTagName() { 65 return []; 66 } 67 }; 68 }, 69 createElementNS: function createElementNS() { 70 return {}; 71 }, 72 importNode: function importNode() { 73 return null; 74 }, 75 location: { 76 hash: '', 77 host: '', 78 hostname: '', 79 href: '', 80 origin: '', 81 pathname: '', 82 protocol: '', 83 search: '' 84 } 85}; 86exports.ssrDocument = ssrDocument; 87function getDocument() { 88 var doc = typeof document !== 'undefined' ? document : {}; 89 extend(doc, ssrDocument); 90 return doc; 91} 92var ssrWindow = { 93 document: ssrDocument, 94 navigator: { 95 userAgent: '' 96 }, 97 location: { 98 hash: '', 99 host: '', 100 hostname: '', 101 href: '', 102 origin: '', 103 pathname: '', 104 protocol: '', 105 search: '' 106 }, 107 history: { 108 replaceState: function replaceState() {}, 109 pushState: function pushState() {}, 110 go: function go() {}, 111 back: function back() {} 112 }, 113 CustomEvent: function CustomEvent() { 114 return this; 115 }, 116 addEventListener: function addEventListener() {}, 117 removeEventListener: function removeEventListener() {}, 118 getComputedStyle: function getComputedStyle() { 119 return { 120 getPropertyValue: function getPropertyValue() { 121 return ''; 122 } 123 }; 124 }, 125 Image: function Image() {}, 126 Date: function Date() {}, 127 screen: {}, 128 setTimeout: function setTimeout() {}, 129 clearTimeout: function clearTimeout() {}, 130 matchMedia: function matchMedia() { 131 return {}; 132 }, 133 requestAnimationFrame: function requestAnimationFrame(callback) { 134 if (typeof setTimeout === 'undefined') { 135 callback(); 136 return null; 137 } 138 return setTimeout(callback, 0); 139 }, 140 cancelAnimationFrame: function cancelAnimationFrame(id) { 141 if (typeof setTimeout === 'undefined') { 142 return; 143 } 144 clearTimeout(id); 145 } 146}; 147exports.ssrWindow = ssrWindow; 148function getWindow() { 149 var win = typeof window !== 'undefined' ? window : {}; 150 extend(win, ssrWindow); 151 return win; 152} 153 154},{}],2:[function(require,module,exports){ 155"use strict"; 156 157Object.defineProperty(exports, "__esModule", { 158 value: true 159});
160exports["default"] = getBreakpoint; 161var _ssrWindow = require("ssr-window"); 162function getBreakpoint(breakpoints) { 163 var base = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'window'; 164 var containerEl = arguments.length > 2 ? arguments[2] : undefined; 165 if (!breakpoints || base === 'container' && !containerEl) return undefined; 166 var breakpoint = false; 167 var window = (0, _ssrWindow.getWindow)(); 168 var currentHeight = base === 'window' ? window.innerHeight : containerEl.clientHeight; 169 var points = Object.keys(breakpoints).map(function (point) { 170 if (typeof point === 'string' && point.indexOf('@') === 0) { 171 var minRatio = parseFloat(point.substr(1)); 172 var value = currentHeight * minRatio; 173 return { 174 value: value, 175 point: point 176 }; 177 } 178 return { 179 value: point, 180 point: point 181 }; 182 }); 183 points.sort(function (a, b) { 184 return parseInt(a.value, 10) - parseInt(b.value, 10); 185 }); 186 for (var i = 0; i < points.length; i += 1) { 187 var _points$i = points[i], 188 point = _points$i.point, 189 value = _points$i.value; 190 if (base === 'window') { 191 if (window.matchMedia("(min-width: ".concat(value, "px)")).matches) { 192 breakpoint = point; 193 } 194 } else if (value <= containerEl.clientWidth) { 195 breakpoint = point; 196 } 197 } 198 return breakpoint || 'max'; 199} 200 201},{"ssr-window":1}],3:[function(require,module,exports){ 202"use strict"; 203 204Object.defineProperty(exports, "__esModule", { 205 value: true 206}); 207exports["default"] = void 0; 208var _setBreakpoint = _interopRequireDefault(require("./setBreakpoint.js")); 209var _getBreakpoint = _interopRequireDefault(require("./getBreakpoint.js")); 210function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } 211var _default = { 212 setBreakpoint: _setBreakpoint["default"], 213 getBreakpoint: _getBreakpoint["default"] 214}; 215exports["default"] = _default; 216 217},{"./getBreakpoint.js":2,"./setBreakpoint.js":4}],4:[function(require,module,exports){ 218"use strict"; 219 220Object.defineProperty(exports, "__esModule", { 221 value: true 222}); 223exports["default"] = setBreakpoint; 224var _utils = require("../../shared/utils.js"); 225var isGridEnabled = function isGridEnabled(swiper, params) { 226 return swiper.grid && params.grid && params.grid.rows > 1; 227}; 228function setBreakpoint() { 229 var swiper = this; 230 var realIndex = swiper.realIndex, 231 initialized = swiper.initialized, 232 params = swiper.params, 233 el = swiper.el; 234 var breakpoints = params.breakpoints; 235 if (!breakpoints || breakpoints && Object.keys(breakpoints).length === 0) return; 236 237 // Get breakpoint for window width and update parameters 238 var breakpoint = swiper.getBreakpoint(breakpoints, swiper.params.breakpointsBase, swiper.el); 239 if (!breakpoint || swiper.currentBreakpoint === breakpoint) return; 240 var breakpointOnlyParams = breakpoint in breakpoints ? breakpoints[breakpoint] : undefined; 241 var breakpointParams = breakpointOnlyParams || swiper.originalParams; 242 var wasMultiRow = isGridEnabled(swiper, params); 243 var isMultiRow = isGridEnabled(swiper, breakpointParams); 244 var wasEnabled = params.enabled; 245 if (wasMultiRow && !isMultiRow) { 246 el.classList.remove("".concat(params.containerModifierClass, "grid"), "".concat(params.containerModifierClass, "grid-column")); 247 swiper.emitContainerClasses(); 248 } else if (!wasMultiRow && isMultiRow) { 249 el.classList.add("".concat(params.containerModifierClass, "grid")); 250 if (breakpointParams.grid.fill && breakpointParams.grid.fill === 'column' || !breakpointParams.grid.fill && params.grid.fill === 'column') { 251 el.classList.add("".concat(params.containerModifierClass, "grid-column")); 252 } 253 swiper.emitContainerClasses(); 254 } 255 256 // Toggle navigation, pagination, scrollbar 257 ['navigation', 'pagination', 'scrollbar'].forEach(function (prop) { 258 var wasModuleEnabled = params[prop] && params[prop].enabled; 259 var isModuleEnabled = breakpointParams[prop] && breakpointParams[prop].enabled; 260 if (wasModuleEnabled && !isModuleEnabled) { 261 swiper[prop].disable(); 262 } 263 if (!wasModuleEnabled && isModuleEnabled) { 264 swiper[prop].enable(); 265 } 266 }); 267 var directionChanged = breakpointParams.direction && breakpointParams.direction !== params.direction; 268 var needsReLoop = params.loop && (breakpointParams.slidesPerView !== params.slidesPerView || directionChanged); 269 if (directionChanged && initialized) { 270 swiper.changeDirection(); 271 } 272 (0, _utils.extend)(swiper.params, breakpointParams); 273 var isEnabled = swiper.params.enabled; 274 Object.assign(swiper, { 275 allowTouchMove: swiper.params.allowTouchMove, 276 allowSlideNext: swiper.params.allowSlideNext, 277 allowSlidePrev: swiper.params.allowSlidePrev 278 }); 279 if (wasEnabled && !isEnabled) { 280 swiper.disable(); 281 } else if (!wasEnabled && isEnabled) { 282 swiper.enable(); 283 } 284 swiper.currentBreakpoint = breakpoint; 285 swiper.emit('_beforeBreakpoint', breakpointParams); 286 if (needsReLoop && initialized) { 287 swiper.loopDestroy(); 288 swiper.loopCreate(realIndex); 289 swiper.updateSlides(); 290 } 291 swiper.emit('breakpoint', breakpointParams); 292} 293 294},{"../../shared/utils.js":97}],5:[function(require,module,exports){ 295"use strict"; 296 297Object.defineProperty(exports, "__esModule", { 298 value: true 299}); 300exports["default"] = void 0; 301function checkOverflow() { 302 var swiper = this;
303 var wasLocked = swiper.isLocked, 304 params = swiper.params; 305 var slidesOffsetBefore = params.slidesOffsetBefore; 306 if (slidesOffsetBefore) { 307 var lastSlideIndex = swiper.slides.length - 1; 308 var lastSlideRightEdge = swiper.slidesGrid[lastSlideIndex] + swiper.slidesSizesGrid[lastSlideIndex] + slidesOffsetBefore * 2; 309 swiper.isLocked = swiper.size > lastSlideRightEdge; 310 } else { 311 swiper.isLocked = swiper.snapGrid.length === 1; 312 } 313 if (params.allowSlideNext === true) { 314 swiper.allowSlideNext = !swiper.isLocked; 315 } 316 if (params.allowSlidePrev === true) { 317 swiper.allowSlidePrev = !swiper.isLocked; 318 } 319 if (wasLocked && wasLocked !== swiper.isLocked) { 320 swiper.isEnd = false; 321 } 322 if (wasLocked !== swiper.isLocked) { 323 swiper.emit(swiper.isLocked ? 'lock' : 'unlock'); 324 } 325} 326var _default = { 327 checkOverflow: checkOverflow 328}; 329exports["default"] = _default; 330 331},{}],6:[function(require,module,exports){ 332"use strict"; 333 334Object.defineProperty(exports, "__esModule", { 335 value: true 336}); 337exports["default"] = addClasses; 338function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } 339function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } 340function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } 341function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } 342function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } 343function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } 344function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } 345function prepareClasses(entries, prefix) { 346 var resultClasses = []; 347 entries.forEach(function (item) { 348 if (_typeof(item) === 'object') { 349 Object.keys(item).forEach(function (classNames) { 350 if (item[classNames]) { 351 resultClasses.push(prefix + classNames); 352 } 353 }); 354 } else if (typeof item === 'string') { 355 resultClasses.push(prefix + item); 356 } 357 }); 358 return resultClasses; 359} 360function addClasses() { 361 var _el$classList; 362 var swiper = this; 363 var classNames = swiper.classNames, 364 params = swiper.params, 365 rtl = swiper.rtl, 366 el = swiper.el, 367 device = swiper.device; 368 // prettier-ignore 369 var suffixes = prepareClasses(['initialized', params.direction, { 370 'free-mode': swiper.params.freeMode && params.freeMode.enabled 371 }, { 372 'autoheight': params.autoHeight 373 }, { 374 'rtl': rtl 375 }, { 376 'grid': params.grid && params.grid.rows > 1 377 }, { 378 'grid-column': params.grid && params.grid.rows > 1 && params.grid.fill === 'column' 379 }, { 380 'android': device.android 381 }, { 382 'ios': device.ios 383 }, { 384 'css-mode': params.cssMode 385 }, { 386 'centered': params.cssMode && params.centeredSlides 387 }, { 388 'watch-progress': params.watchSlidesProgress 389 }], params.containerModifierClass); 390 classNames.push.apply(classNames, _toConsumableArray(suffixes)); 391 (_el$classList = el.classList).add.apply(_el$classList, _toConsumableArray(classNames)); 392 swiper.emitContainerClasses(); 393} 394 395},{}],7:[function(require,module,exports){ 396"use strict"; 397 398Object.defineProperty(exports, "__esModule", { 399 value: true 400}); 401exports["default"] = void 0; 402var _addClasses = _interopRequireDefault(require("./addClasses.js")); 403var _removeClasses = _interopRequireDefault(require("./removeClasses.js")); 404function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } 405var _default = { 406 addClasses: _addClasses["default"], 407 removeClasses: _removeClasses["default"] 408}; 409exports["default"] = _default; 410 411},{"./addClasses.js":6,"./removeClasses.js":8}],8:[function(require,module,exports){ 412"use strict"; 413 414Object.defineProperty(exports, "__esModule", { 415 value: true 416}); 417exports["default"] = removeClasses; 418function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } 419function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } 420function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } 421function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } 422function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } 423function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } 424function removeClasses() { 425 var _el$classList; 426 var swiper = this; 427 var el = swiper.el, 428 classNames = swiper.classNames; 429 (_el$classList = el.classList).remove.apply(_el$classList, _toConsumableArray(classNames)); 430 swiper.emitContainerClasses(); 431} 432 433},{}],9:[function(require,module,exports){ 434"use strict"; 435 436Object.defineProperty(exports, "__esModule", { 437 value: true 438}); 439exports["default"] = void 0; 440var _ssrWindow = require("ssr-window"); 441var _utils = require("../shared/utils.js"); 442var _getSupport = require("../shared/get-support.js"); 443var _getDevice = require("../shared/get-device.js"); 444var _getBrowser = require("../shared/get-browser.js"); 445var _resize = _interopRequireDefault(require("./modules/resize/resize.js")); 446var _observer = _interopRequireDefault(require("./modules/observer/observer.js")); 447var _eventsEmitter = _interopRequireDefault(require("./events-emitter.js")); 448var _index = _interopRequireDefault(require("./update/index.js")); 449var _index2 = _interopRequireDefault(require("./translate/index.js")); 450var _index3 = _interopRequireDefault(require("./transition/index.js"));
vendor: 4,344 bytes, lines 451-495
451var _index4 = _interopRequireDefault(require("./slide/index.js")); 452var _index5 = _interopRequireDefault(require("./loop/index.js")); 453var _index6 = _interopRequireDefault(require("./grab-cursor/index.js")); 454var _index7 = _interopRequireDefault(require("./events/index.js")); 455var _index8 = _interopRequireDefault(require("./breakpoints/index.js")); 456var _index9 = _interopRequireDefault(require("./classes/index.js")); 457var _index10 = _interopRequireDefault(require("./check-overflow/index.js")); 458var _defaults = _interopRequireDefault(require("./defaults.js")); 459var _moduleExtendParams = _interopRequireDefault(require("./moduleExtendParams.js")); 460var _processLazyPreloader = require("../shared/process-lazy-preloader.js"); 461function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } 462function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } 463function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } 464function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } 465function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } 466function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } 467function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } 468function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } 469function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 470function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } } 471function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } 472function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } 473function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } /* eslint no-param-reassign: "off" */ 474var prototypes = { 475 eventsEmitter: _eventsEmitter["default"], 476 update: _index["default"], 477 translate: _index2["default"], 478 transition: _index3["default"], 479 slide: _index4["default"], 480 loop: _index5["default"], 481 grabCursor: _index6["default"], 482 events: _index7["default"], 483 breakpoints: _index8["default"], 484 checkOverflow: _index10["default"], 485 classes: _index9["default"] 486}; 487var extendedDefaults = {}; 488var Swiper = /*#__PURE__*/function () { 489 function Swiper() { 490 _classCallCheck(this, Swiper); 491 var el; 492 var params; 493 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { 494 args[_key] = arguments[_key]; 495 }
496 if (args.length === 1 && args[0].constructor && Object.prototype.toString.call(args[0]).slice(8, -1) === 'Object') { 497 params = args[0]; 498 } else { 499 el = args[0]; 500 params = args[1]; 501 } 502 if (!params) params = {}; 503 params = (0, _utils.extend)({}, params); 504 if (el && !params.el) params.el = el; 505 var document = (0, _ssrWindow.getDocument)(); 506 if (params.el && typeof params.el === 'string' && document.querySelectorAll(params.el).length > 1) { 507 var swipers = []; 508 document.querySelectorAll(params.el).forEach(function (containerEl) { 509 var newParams = (0, _utils.extend)({}, params, { 510 el: containerEl 511 }); 512 swipers.push(new Swiper(newParams)); 513 }); 514 // eslint-disable-next-line no-constructor-return 515 return swipers; 516 } 517 518 // Swiper Instance 519 var swiper = this; 520 swiper.__swiper__ = true; 521 swiper.support = (0, _getSupport.getSupport)(); 522 swiper.device = (0, _getDevice.getDevice)({ 523 userAgent: params.userAgent 524 }); 525 swiper.browser = (0, _getBrowser.getBrowser)(); 526 swiper.eventsListeners = {}; 527 swiper.eventsAnyListeners = []; 528 swiper.modules = _toConsumableArray(swiper.__modules__); 529 if (params.modules && Array.isArray(params.modules)) { 530 var _swiper$modules; 531 (_swiper$modules = swiper.modules).push.apply(_swiper$modules, _toConsumableArray(params.modules)); 532 } 533 var allModulesParams = {}; 534 swiper.modules.forEach(function (mod) { 535 mod({ 536 params: params, 537 swiper: swiper, 538 extendParams: (0, _moduleExtendParams["default"])(params, allModulesParams), 539 on: swiper.on.bind(swiper), 540 once: swiper.once.bind(swiper), 541 off: swiper.off.bind(swiper), 542 emit: swiper.emit.bind(swiper) 543 }); 544 }); 545 546 // Extend defaults with modules params 547 var swiperParams = (0, _utils.extend)({}, _defaults["default"], allModulesParams); 548 549 // Extend defaults with passed params 550 swiper.params = (0, _utils.extend)({}, swiperParams, extendedDefaults, params); 551 swiper.originalParams = (0, _utils.extend)({}, swiper.params); 552 swiper.passedParams = (0, _utils.extend)({}, params); 553 554 // add event listeners 555 if (swiper.params && swiper.params.on) {
556 Object.keys(swiper.params.on).forEach(function (eventName) { 557 swiper.on(eventName, swiper.params.on[eventName]); 558 }); 559 } 560 if (swiper.params && swiper.params.onAny) { 561 swiper.onAny(swiper.params.onAny); 562 } 563 564 // Extend Swiper 565 Object.assign(swiper, { 566 enabled: swiper.params.enabled, 567 el: el, 568 // Classes 569 classNames: [], 570 // Slides 571 slides: [], 572 slidesGrid: [], 573 snapGrid: [], 574 slidesSizesGrid: [], 575 // isDirection 576 isHorizontal: function isHorizontal() { 577 return swiper.params.direction === 'horizontal'; 578 }, 579 isVertical: function isVertical() { 580 return swiper.params.direction === 'vertical'; 581 }, 582 // Indexes 583 activeIndex: 0, 584 realIndex: 0, 585 // 586 isBeginning: true, 587 isEnd: false, 588 // Props 589 translate: 0, 590 previousTranslate: 0, 591 progress: 0, 592 velocity: 0, 593 animating: false, 594 cssOverflowAdjustment: function cssOverflowAdjustment() { 595 // Returns 0 unless `translate` is > 2**23 596 // Should be subtracted from css values to prevent overflow 597 return Math.trunc(this.translate / Math.pow(2, 23)) * Math.pow(2, 23); 598 }, 599 // Locks 600 allowSlideNext: swiper.params.allowSlideNext, 601 allowSlidePrev: swiper.params.allowSlidePrev, 602 // Touch Events 603 touchEventsData: { 604 isTouched: undefined, 605 isMoved: undefined, 606 allowTouchCallbacks: undefined, 607 touchStartTime: undefined, 608 isScrolling: undefined, 609 currentTranslate: undefined, 610 startTranslate: undefined, 611 allowThresholdMove: undefined, 612 // Form elements to match 613 focusableElements: swiper.params.focusableElements, 614 // Last click time 615 lastClickTime: 0, 616 clickTimeout: undefined, 617 // Velocities 618 velocities: [], 619 allowMomentumBounce: undefined, 620 startMoving: undefined, 621 evCache: [] 622 }, 623 // Clicks 624 allowClick: true, 625 // Touches 626 allowTouchMove: swiper.params.allowTouchMove, 627 touches: { 628 startX: 0, 629 startY: 0, 630 currentX: 0, 631 currentY: 0, 632 diff: 0 633 }, 634 // Images 635 imagesToLoad: [], 636 imagesLoaded: 0 637 }); 638 swiper.emit('_swiper'); 639 640 // Init 641 if (swiper.params.init) { 642 swiper.init(); 643 } 644 645 // Return app instance 646 // eslint-disable-next-line no-constructor-return 647 return swiper; 648 } 649 _createClass(Swiper, [{ 650 key: "getSlideIndex", 651 value: function getSlideIndex(slideEl) { 652 var slidesEl = this.slidesEl, 653 params = this.params; 654 var slides = (0, _utils.elementChildren)(slidesEl, ".".concat(params.slideClass, ", swiper-slide")); 655 var firstSlideIndex = (0, _utils.elementIndex)(slides[0]); 656 return (0, _utils.elementIndex)(slideEl) - firstSlideIndex; 657 } 658 }, { 659 key: "getSlideIndexByData", 660 value: function getSlideIndexByData(index) { 661 return this.getSlideIndex(this.slides.filter(function (slideEl) { 662 return slideEl.getAttribute('data-swiper-slide-index') * 1 === index; 663 })[0]); 664 } 665 }, { 666 key: "recalcSlides", 667 value: function recalcSlides() { 668 var swiper = this; 669 var slidesEl = swiper.slidesEl, 670 params = swiper.params; 671 swiper.slides = (0, _utils.elementChildren)(slidesEl, ".".concat(params.slideClass, ", swiper-slide")); 672 } 673 }, { 674 key: "enable", 675 value: function enable() { 676 var swiper = this; 677 if (swiper.enabled) return; 678 swiper.enabled = true; 679 if (swiper.params.grabCursor) { 680 swiper.setGrabCursor(); 681 } 682 swiper.emit('enable'); 683 } 684 }, { 685 key: "disable", 686 value: function disable() { 687 var swiper = this; 688 if (!swiper.enabled) return; 689 swiper.enabled = false; 690 if (swiper.params.grabCursor) { 691 swiper.unsetGrabCursor(); 692 } 693 swiper.emit('disable'); 694 } 695 }, { 696 key: "setProgress", 697 value: function setProgress(progress, speed) { 698 var swiper = this; 699 progress = Math.min(Math.max(progress, 0), 1); 700 var min = swiper.minTranslate(); 701 var max = swiper.maxTranslate(); 702 var current = (max - min) * progress + min; 703 swiper.translateTo(current, typeof speed === 'undefined' ? 0 : speed); 704 swiper.updateActiveIndex(); 705 swiper.updateSlidesClasses(); 706 } 707 }, { 708 key: "emitContainerClasses", 709 value: function emitContainerClasses() { 710 var swiper = this; 711 if (!swiper.params._emitClasses || !swiper.el) return; 712 var cls = swiper.el.className.split(' ').filter(function (className) { 713 return className.indexOf('swiper') === 0 || className.indexOf(swiper.params.containerModifierClass) === 0; 714 }); 715 swiper.emit('_containerClasses', cls.join(' ')); 716 } 717 }, { 718 key: "getSlideClasses",
719 value: function getSlideClasses(slideEl) { 720 var swiper = this; 721 if (swiper.destroyed) return ''; 722 return slideEl.className.split(' ').filter(function (className) { 723 return className.indexOf('swiper-slide') === 0 || className.indexOf(swiper.params.slideClass) === 0; 724 }).join(' '); 725 } 726 }, { 727 key: "emitSlidesClasses", 728 value: function emitSlidesClasses() { 729 var swiper = this; 730 if (!swiper.params._emitClasses || !swiper.el) return; 731 var updates = []; 732 swiper.slides.forEach(function (slideEl) { 733 var classNames = swiper.getSlideClasses(slideEl); 734 updates.push({ 735 slideEl: slideEl, 736 classNames: classNames 737 }); 738 swiper.emit('_slideClass', slideEl, classNames); 739 }); 740 swiper.emit('_slideClasses', updates); 741 } 742 }, { 743 key: "slidesPerViewDynamic", 744 value: function slidesPerViewDynamic() { 745 var view = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'current'; 746 var exact = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; 747 var swiper = this; 748 var params = swiper.params, 749 slides = swiper.slides, 750 slidesGrid = swiper.slidesGrid, 751 slidesSizesGrid = swiper.slidesSizesGrid, 752 swiperSize = swiper.size, 753 activeIndex = swiper.activeIndex; 754 var spv = 1; 755 if (params.centeredSlides) { 756 var slideSize = slides[activeIndex].swiperSlideSize; 757 var breakLoop; 758 for (var i = activeIndex + 1; i < slides.length; i += 1) { 759 if (slides[i] && !breakLoop) { 760 slideSize += slides[i].swiperSlideSize; 761 spv += 1; 762 if (slideSize > swiperSize) breakLoop = true; 763 } 764 } 765 for (var _i = activeIndex - 1; _i >= 0; _i -= 1) { 766 if (slides[_i] && !breakLoop) { 767 slideSize += slides[_i].swiperSlideSize; 768 spv += 1; 769 if (slideSize > swiperSize) breakLoop = true; 770 } 771 } 772 } else { 773 // eslint-disable-next-line 774 if (view === 'current') { 775 for (var _i2 = activeIndex + 1; _i2 < slides.length; _i2 += 1) { 776 var slideInView = exact ? slidesGrid[_i2] + slidesSizesGrid[_i2] - slidesGrid[activeIndex] < swiperSize : slidesGrid[_i2] - slidesGrid[activeIndex] < swiperSize; 777 if (slideInView) { 778 spv += 1; 779 } 780 } 781 } else { 782 // previous 783 for (var _i3 = activeIndex - 1; _i3 >= 0; _i3 -= 1) { 784 var _slideInView = slidesGrid[activeIndex] - slidesGrid[_i3] < swiperSize; 785 if (_slideInView) { 786 spv += 1; 787 } 788 } 789 } 790 } 791 return spv; 792 } 793 }, { 794 key: "update", 795 value: function update() { 796 var swiper = this; 797 if (!swiper || swiper.destroyed) return; 798 var snapGrid = swiper.snapGrid, 799 params = swiper.params;
800 // Breakpoints 801 if (params.breakpoints) { 802 swiper.setBreakpoint(); 803 } 804 _toConsumableArray(swiper.el.querySelectorAll('[loading="lazy"]')).forEach(function (imageEl) { 805 if (imageEl.complete) { 806 (0, _processLazyPreloader.processLazyPreloader)(swiper, imageEl); 807 } 808 }); 809 swiper.updateSize(); 810 swiper.updateSlides(); 811 swiper.updateProgress(); 812 swiper.updateSlidesClasses(); 813 function setTranslate() { 814 var translateValue = swiper.rtlTranslate ? swiper.translate * -1 : swiper.translate; 815 var newTranslate = Math.min(Math.max(translateValue, swiper.maxTranslate()), swiper.minTranslate()); 816 swiper.setTranslate(newTranslate); 817 swiper.updateActiveIndex(); 818 swiper.updateSlidesClasses(); 819 } 820 var translated; 821 if (swiper.params.freeMode && swiper.params.freeMode.enabled) { 822 setTranslate(); 823 if (swiper.params.autoHeight) { 824 swiper.updateAutoHeight(); 825 } 826 } else { 827 if ((swiper.params.slidesPerView === 'auto' || swiper.params.slidesPerView > 1) && swiper.isEnd && !swiper.params.centeredSlides) { 828 var slides = swiper.virtual && swiper.params.virtual.enabled ? swiper.virtual.slides : swiper.slides; 829 translated = swiper.slideTo(slides.length - 1, 0, false, true); 830 } else { 831 translated = swiper.slideTo(swiper.activeIndex, 0, false, true); 832 } 833 if (!translated) { 834 setTranslate(); 835 } 836 } 837 if (params.watchOverflow && snapGrid !== swiper.snapGrid) { 838 swiper.checkOverflow(); 839 } 840 swiper.emit('update'); 841 } 842 }, { 843 key: "changeDirection", 844 value: function changeDirection(newDirection) { 845 var needUpdate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; 846 var swiper = this; 847 var currentDirection = swiper.params.direction; 848 if (!newDirection) { 849 // eslint-disable-next-line 850 newDirection = currentDirection === 'horizontal' ? 'vertical' : 'horizontal'; 851 } 852 if (newDirection === currentDirection || newDirection !== 'horizontal' && newDirection !== 'vertical') { 853 return swiper; 854 } 855 swiper.el.classList.remove("".concat(swiper.params.containerModifierClass).concat(currentDirection)); 856 swiper.el.classList.add("".concat(swiper.params.containerModifierClass).concat(newDirection)); 857 swiper.emitContainerClasses(); 858 swiper.params.direction = newDirection; 859 swiper.slides.forEach(function (slideEl) { 860 if (newDirection === 'vertical') { 861 slideEl.style.width = ''; 862 } else { 863 slideEl.style.height = ''; 864 } 865 }); 866 swiper.emit('changeDirection'); 867 if (needUpdate) swiper.update(); 868 return swiper; 869 } 870 }, { 871 key: "changeLanguageDirection", 872 value: function changeLanguageDirection(direction) { 873 var swiper = this; 874 if (swiper.rtl && direction === 'rtl' || !swiper.rtl && direction === 'ltr') return; 875 swiper.rtl = direction === 'rtl'; 876 swiper.rtlTranslate = swiper.params.direction === 'horizontal' && swiper.rtl; 877 if (swiper.rtl) { 878 swiper.el.classList.add("".concat(swiper.params.containerModifierClass, "rtl")); 879 swiper.el.dir = 'rtl'; 880 } else { 881 swiper.el.classList.remove("".concat(swiper.params.containerModifierClass, "rtl")); 882 swiper.el.dir = 'ltr'; 883 } 884 swiper.update(); 885 } 886 }, { 887 key: "mount", 888 value: function mount(element) { 889 var swiper = this; 890 if (swiper.mounted) return true; 891 892 // Find el 893 var el = element || swiper.params.el; 894 if (typeof el === 'string') { 895 el = document.querySelector(el); 896 } 897 if (!el) { 898 return false; 899 } 900 el.swiper = swiper; 901 if (el.shadowEl) { 902 swiper.isElement = true; 903 } 904 var getWrapperSelector = function getWrapperSelector() { 905 return ".".concat((swiper.params.wrapperClass || '').trim().split(' ').join('.')); 906 }; 907 var getWrapper = function getWrapper() { 908 if (el && el.shadowRoot && el.shadowRoot.querySelector) { 909 var res = el.shadowRoot.querySelector(getWrapperSelector()); 910 // Children needs to return slot items 911 return res; 912 } 913 return (0, _utils.elementChildren)(el, getWrapperSelector())[0]; 914 }; 915 // Find Wrapper 916 var wrapperEl = getWrapper(); 917 if (!wrapperEl && swiper.params.createElements) { 918 wrapperEl = (0, _utils.createElement)('div', swiper.params.wrapperClass); 919 el.append(wrapperEl); 920 (0, _utils.elementChildren)(el, ".".concat(swiper.params.slideClass)).forEac
920h(function (slideEl) { 921 wrapperEl.append(slideEl); 922 }); 923 } 924 Object.assign(swiper, { 925 el: el, 926 wrapperEl: wrapperEl, 927 slidesEl: swiper.isElement ? el : wrapperEl, 928 mounted: true, 929 // RTL 930 rtl: el.dir.toLowerCase() === 'rtl' || (0, _utils.elementStyle)(el, 'direction') === 'rtl', 931 rtlTranslate: swiper.params.direction === 'horizontal' && (el.dir.toLowerCase() === 'rtl' || (0, _utils.elementStyle)(el, 'direction') === 'rtl'), 932 wrongRTL: (0, _utils.elementStyle)(wrapperEl, 'display') === '-webkit-box' 933 }); 934 return true; 935 } 936 }, { 937 key: "init", 938 value: function init(el) { 939 var swiper = this; 940 if (swiper.initialized) return swiper; 941 var mounted = swiper.mount(el); 942 if (mounted === false) return swiper; 943 swiper.emit('beforeInit'); 944 945 // Set breakpoint 946 if (swiper.params.breakpoints) { 947 swiper.setBreakpoint(); 948 } 949 950 // Add Classes 951 swiper.addClasses(); 952 953 // Update size 954 swiper.updateSize(); 955 956 // Update slides 957 swiper.updateSlides(); 958 if (swiper.params.watchOverflow) { 959 swiper.checkOverflow(); 960 } 961 962 // Set Grab Cursor 963 if (swiper.params.grabCursor && swiper.enabled) { 964 swiper.setGrabCursor(); 965 } 966 967 // Slide To Initial Slide 968 if (swiper.params.loop && swiper.virtual && swiper.params.virtual.enabled) { 969 swiper.slideTo(swiper.params.initialSlide + swiper.virtual.slidesBefore, 0, swiper.params.runCallbacksOnInit, false, true); 970 } else { 971 swiper.slideTo(swiper.params.initialSlide, 0, swiper.params.runCallbacksOnInit, false, true); 972 } 973 974 // Create loop 975 if (swiper.params.loop) { 976 swiper.loopCreate(); 977 } 978 979 // Attach events 980 swiper.attachEvents(); 981 _toConsumableArray(swiper.el.querySelectorAll('[loading="lazy"]')).forEach(function (imageEl) { 982 if (imageEl.complete) { 983 (0, _processLazyPreloader.processLazyPreloader)(swiper, imageEl); 984 } else { 985 imageEl.addEventListener('load', function (e) { 986 (0, _processLazyPreloader.processLazyPreloader)(swiper, e.target); 987 }); 988 } 989 }); 990 (0, _processLazyPreloader.preload)(swiper); 991 992 // Init Flag 993 swiper.initialized = true; 994 (0, _processLazyPreloader.preload)(swiper); 995 996 // Emit 997 swiper.emit('init'); 998 swiper.emit('afterInit'); 999 return swiper; 1000 } 1001 }, { 1002 key: "destroy", 1003 value: function destroy() { 1004 var deleteInstance = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; 1005 var cleanStyles = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; 1006 var swiper = this; 1007 var params = swiper.params, 1008 el = swiper.el, 1009 wrapperEl = swiper.wrapperEl, 1010 slides = swiper.slides; 1011 if (typeof swiper.params === 'undefined' || swiper.destroyed) { 1012 return null; 1013 } 1014 swiper.emit('beforeDestroy'); 1015 1016 // Init Flag 1017 swiper.initialized = false; 1018 1019 // Detach events 1020 swiper.detachEvents(); 1021 1022 // Destroy loop 1023 if (params.loop) { 1024 swiper.loopDestroy(); 1025 } 1026 1027 // Cleanup styles 1028 if (cleanStyles) { 1029 swiper.removeClasses(); 1030 el.removeAttribute('style'); 1031 wrapperEl.removeAttribute('style'); 1032 if (slides && slides.length) { 1033 slides.forEach(function (slideEl) { 1034 slideEl.classList.remove(params.slideVisibleClass, params.slideActiveClass, params.slideNextClass, params.slidePrevClass); 1035 slideEl.removeAttribute('style'); 1036 slideEl.removeAttribute('data-swiper-slide-index'); 1037 }); 1038 } 1039 } 1040 swiper.emit('destroy'); 1041 1042 // Detach emitter events 1043 Object.keys(swiper.eventsListeners).forEach(function (eventName) { 1044 swiper.off(eventName); 1045 }); 1046 if (deleteInstance !== false) { 1047 swiper.el.swiper = null; 1048 (0, _utils.deleteProps)(swiper); 1049 } 1050 swiper.destroyed = true; 1051 return null; 1052 } 1053 }], [{ 1054 key: "extendDefaults", 1055 value: function extendDefaults(newDefaults) { 1056 (0, _utils.extend)(extendedDefaults, newDefaults); 1057 } 1058 }, { 1059 key: "extendedDefaults", 1060 get: function get() { 1061 return extendedDefaults; 1062 } 1063 }, { 1064 key: "defaults", 1065 get: function get() { 1066 return _defaults["default"]; 1067 } 1068 }, { 1069 key: "installModule", 1070 value: function installModule(mod) { 1071 if (!Swiper.prototype.__modules__) Swiper.prototype.__modules__ = []; 1072 var modules = Swiper.prototype.__modules__; 1073 if (typeof mod === 'function' && modules.indexOf(mod) < 0) { 1074 modules.push(mod); 1075 } 1076 } 1077 }, { 1078 key: "use", 1079 value: function use(module) { 1080 if (Array.isArray(module)) { 1081 module.forEach(function (m) { 1082 return Swiper.installModule(m); 1083 }); 1084 return Swiper; 1085 } 1086 Swiper.installModule(module); 1087 return Swiper; 1088 } 1089 }]); 1090 return Swiper; 1091}();
1092Object.keys(prototypes).forEach(function (prototypeGroup) { 1093 Object.keys(prototypes[prototypeGroup]).forEach(function (protoMethod) { 1094 Swiper.prototype[protoMethod] = prototypes[prototypeGroup][protoMethod]; 1095 }); 1096}); 1097Swiper.use([_resize["default"], _observer["default"]]); 1098var _default = Swiper; 1099exports["default"] = _default; 1100 1101},{"../shared/get-browser.js":93,"../shared/get-device.js":94,"../shared/get-support.js":95,"../shared/process-lazy-preloader.js":96,"../shared/utils.js":97,"./breakpoints/index.js":3,"./check-overflow/index.js":5,"./classes/index.js":7,"./defaults.js":10,"./events-emitter.js":11,"./events/index.js":12,"./grab-cursor/index.js":20,"./loop/index.js":23,"./moduleExtendParams.js":27,"./modules/observer/observer.js":28,"./modules/resize/resize.js":29,"./slide/index.js":30,"./transition/index.js":38,"./translate/index.js":44,"./update/index.js":49,"ssr-window":1}],10:[function(require,module,exports){ 1102"use strict"; 1103 1104Object.defineProperty(exports, "__esModule", { 1105 value: true 1106}); 1107exports["default"] = void 0; 1108var _default = { 1109 init: true, 1110 direction: 'horizontal', 1111 oneWayMovement: false, 1112 touchEventsTarget: 'wrapper', 1113 initialSlide: 0, 1114 speed: 300, 1115 cssMode: false, 1116 updateOnWindowResize: true, 1117 resizeObserver: true, 1118 nested: false, 1119 createElements: false, 1120 enabled: true, 1121 focusableElements: 'input, select, option, textarea, button, video, label', 1122 // Overrides 1123 width: null, 1124 height: null, 1125 // 1126 preventInteractionOnTransition: false, 1127 // ssr 1128 userAgent: null, 1129 url: null, 1130 // To support iOS's swipe-to-go-back gesture (when being used in-app). 1131 edgeSwipeDetection: false, 1132 edgeSwipeThreshold: 20, 1133 // Autoheight 1134 autoHeight: false, 1135 // Set wrapper width 1136 setWrapperSize: false, 1137 // Virtual Translate 1138 virtualTranslate: false, 1139 // Effects 1140 effect: 'slide', 1141 // 'slide' or 'fade' or 'cube' or 'coverflow' or 'flip' 1142 1143 // Breakpoints 1144 breakpoints: undefined, 1145 breakpointsBase: 'window', 1146 // Slides grid 1147 spaceBetween: 0, 1148 slidesPerView: 1, 1149 slidesPerGroup: 1, 1150 slidesPerGroupSkip: 0, 1151 slidesPerGroupAuto: false, 1152 centeredSlides: false, 1153 centeredSlidesBounds: false, 1154 slidesOffsetBefore: 0, 1155 // in px 1156 slidesOffsetAfter: 0, 1157 // in px 1158 normalizeSlideIndex: true, 1159 centerInsufficientSlides: false, 1160 // Disable swiper and hide navigation when container not overflow 1161 watchOverflow: true, 1162 // Round length 1163 roundLengths: false, 1164 // Touches 1165 touchRatio: 1, 1166 touchAngle: 45, 1167 simulateTouch: true, 1168 shortSwipes: true, 1169 longSwipes: true, 1170 longSwipesRatio: 0.5, 1171 longSwipesMs: 300, 1172 followFinger: true, 1173 allowTouchMove: true, 1174 threshold: 5, 1175 touchMoveStopPropagation: false, 1176 touchStartPreventDefault: true, 1177 touchStartForcePreventDefault: false, 1178 touchReleaseOnEdges: false, 1179 // Unique Navigation Elements 1180 uniqueNavElements: true, 1181 // Resistance 1182 resistance: true, 1183 resistanceRatio: 0.85, 1184 // Progress 1185 watchSlidesProgress: false, 1186 // Cursor 1187 grabCursor: false, 1188 // Clicks 1189 preventClicks: true, 1190 preventClicksPropagation: true, 1191 slideToClickedSlide: false, 1192 // loop 1193 loop: false, 1194 loopedSlides: null, 1195 loopPreventsSliding: true, 1196 // rewind 1197 rewind: false, 1198 // Swiping/no swiping 1199 allowSlidePrev: true, 1200 allowSlideNext: true, 1201 swipeHandler: null, 1202 // '.swipe-handler', 1203 noSwiping: true, 1204 noSwipingClass: 'swiper-no-swiping', 1205 noSwipingSelector: null, 1206 // Passive Listeners 1207 passiveListeners: true, 1208 maxBackfaceHiddenSlides: 10, 1209 // NS 1210 containerModifierClass: 'swiper-', 1211 // NEW 1212 slideClass: 'swiper-slide', 1213 slideActiveClass: 'swiper-slide-active', 1214 slideVisibleClass: 'swiper-slide-visible', 1215 slideNextClass: 'swiper-slide-next', 1216 slidePrevClass: 'swiper-slide-prev', 1217 wrapperClass: 'swiper-wrapper', 1218 lazyPreloaderClass: 'swiper-lazy-preloader', 1219 lazyPreloadPrevNext: 0, 1220 // Callbacks 1221 runCallbacksOnInit: true, 1222 // Internals 1223 _emitClasses: false 1224}; 1225exports["default"] = _default; 1226 1227},{}],11:[function(require,module,exports){ 1228"use strict"; 1229 1230Object.defineProperty(exports, "__esModule", { 1231 value: true 1232}); 1233exports["default"] = void 0; 1234function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } 1235function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } 1236function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } 1237function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } 1238function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } 1239function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } 1240/* eslint-disable no-underscore-dangle */ 1241var _default = { 1242 on: function on(events, handler, priority) { 1243 var self = this; 1244 if (!self.eventsListeners || self.destroyed) return self; 1245 if (typeof handler !== 'function') return self; 1246 var method = priority ? 'unshift' : 'push'; 1247 events.split(' ').forEach(function (event) { 1248 if (!self.eventsListeners[event]) self.eventsListeners[event] = []; 1249 self.eventsListeners[event][method](handler); 1250 }); 1251 return self; 1252 }, 1253 once: function once(events, handler, priority) { 1254 var self = this; 1255 if (!self.eventsListeners || self.destroyed) return self; 1256 if (typeof handler !== 'function') return self; 1257 function onceHandler() { 1258 self.off(events, onceHandler); 1259 if (onceHandler.__emitterProxy) { 1260 delete onceHandler.__emitterProxy; 1261 } 1262 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { 1263 args[_key] = arguments[_key]; 1264 } 1265 handler.apply(self, args); 1266 } 1267 onceHandler.__emitterProxy = handler; 1268 return self.on(events, onceHandler, priority); 1269 }, 1270 onAny: function onAny(handler, priority) { 1271 var self = this; 1272 if (!self.eventsListeners || self.destroyed) return self; 1273 if (typeof handler !== 'function') return self; 1274 var method = priority ? 'unshift' : 'push'; 1275 if (self.eventsAnyListeners.indexOf(handler) < 0) { 1276 self.eventsAnyListeners[method](handler); 1277 } 1278 return self; 1279 }, 1280 offAny: function offAny(handler) { 1281 var self = this; 1282 if (!self.eventsListeners || self.destroyed) return self; 1283 if (!self.eventsAnyListeners) return self; 1284 var index = self.eventsAnyListeners.indexOf(handler); 1285 if (index >= 0) { 1286 self.eventsAnyListeners.splice(index, 1); 1287 } 1288 return self; 1289 }, 1290 off: function off(events, handler) { 1291 var self = this; 1292 if (!self.eventsListeners || self.destroyed) return self; 1293 if (!self.eventsListeners) return self; 1294 events.split(' ').forEach(function (event) { 1295 if (typeof handler === 'undefined') { 1296 self.eventsListeners[event] = []; 1297 } else if (self.eventsListeners[event]) { 1298 self.eventsListeners[event].forEach(function (eventHandler, index) { 1299 if (eventHandler === handler || eventHandler.__emitterProxy && eventHandler.__emitterProxy === handler) { 1300 self.eventsListeners[event].splice(index, 1); 1301 } 1302 }); 1303 } 1304 }); 1305 return self; 1306 }, 1307 emit: function emit() { 1308 var self = this; 1309 if (!self.eventsListeners || self.destroyed) return self; 1310 if (!self.eventsListeners) return self; 1311 var events; 1312 var data; 1313 var context; 1314 for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { 1315 args[_key2] = arguments[_key2]; 1316 } 1317 if (typeof args[0] === 'string' || Array.isArray(args[0])) { 1318 events = args[0]; 1319 data = args.slice(1, args.length); 1320 context = self; 1321 } else { 1322 events = args[0].events; 1323 data = args[0].data;
1324 context = args[0].context || self; 1325 } 1326 data.unshift(context); 1327 var eventsArray = Array.isArray(events) ? events : events.split(' '); 1328 eventsArray.forEach(function (event) { 1329 if (self.eventsAnyListeners && self.eventsAnyListeners.length) { 1330 self.eventsAnyListeners.forEach(function (eventHandler) { 1331 eventHandler.apply(context, [event].concat(_toConsumableArray(data))); 1332 }); 1333 } 1334 if (self.eventsListeners && self.eventsListeners[event]) { 1335 self.eventsListeners[event].forEach(function (eventHandler) { 1336 eventHandler.apply(context, data); 1337 }); 1338 } 1339 }); 1340 return self; 1341 } 1342}; 1343exports["default"] = _default; 1344 1345},{}],12:[function(require,module,exports){ 1346"use strict"; 1347 1348Object.defineProperty(exports, "__esModule", { 1349 value: true 1350}); 1351exports["default"] = void 0; 1352var _ssrWindow = require("ssr-window"); 1353var _onTouchStart = _interopRequireDefault(require("./onTouchStart.js")); 1354var _onTouchMove = _interopRequireDefault(require("./onTouchMove.js")); 1355var _onTouchEnd = _interopRequireDefault(require("./onTouchEnd.js")); 1356var _onResize = _interopRequireDefault(require("./onResize.js")); 1357var _onClick = _interopRequireDefault(require("./onClick.js")); 1358var _onScroll = _interopRequireDefault(require("./onScroll.js")); 1359var _onLoad = _interopRequireDefault(require("./onLoad.js")); 1360function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } 1361var dummyEventAttached = false; 1362function dummyEventListener() {} 1363var events = function events(swiper, method) { 1364 var document = (0, _ssrWindow.getDocument)(); 1365 var params = swiper.params, 1366 el = swiper.el, 1367 wrapperEl = swiper.wrapperEl, 1368 device = swiper.device; 1369 var capture = !!params.nested; 1370 var domMethod = method === 'on' ? 'addEventListener' : 'removeEventListener'; 1371 var swiperMethod = method; 1372 1373 // Touch Events 1374 el[domMethod]('pointerdown', swiper.onTouchStart, { 1375 passive: false 1376 }); 1377 document[domMethod]('pointermove', swiper.onTouchMove, { 1378 passive: false, 1379 capture: capture 1380 }); 1381 document[domMethod]('pointerup', swiper.onTouchEnd, { 1382 passive: true 1383 }); 1384 document[domMethod]('pointercancel', swiper.onTouchEnd, { 1385 passive: true 1386 }); 1387 document[domMethod]('pointerout', swiper.onTouchEnd, { 1388 passive: true 1389 }); 1390 document[domMethod]('pointerleave', swiper.onTouchEnd, { 1391 passive: true 1392 }); 1393 1394 // Prevent Links Clicks 1395 if (params.preventClicks || params.preventClicksPropagation) { 1396 el[domMethod]('click', swiper.onClick, true); 1397 } 1398 if (params.cssMode) { 1399 wrapperEl[domMethod]('scroll', swiper.onScroll); 1400 } 1401 1402 // Resize handler 1403 if (params.updateOnWindowResize) { 1404 swiper[swiperMethod](device.ios || device.android ? 'resize orientationchange observerUpdate' : 'resize observerUpdate', _onResize["default"], true); 1405 } else { 1406 swiper[swiperMethod]('observerUpdate', _onResize["default"], true); 1407 } 1408 1409 // Images loader 1410 el[domMethod]('load', swiper.onLoad, { 1411 capture: true 1412 }); 1413}; 1414function attachEvents() { 1415 var swiper = this; 1416 var document = (0, _ssrWindow.getDocument)(); 1417 var params = swiper.params; 1418 swiper.onTouchStart = _onTouchStart["default"].bind(swiper); 1419 swiper.onTouchMove = _onTouchMove["default"].bind(swiper); 1420 swiper.onTouchEnd = _onTouchEnd["default"].bind(swiper); 1421 if (params.cssMode) { 1422 swiper.onScroll = _onScroll["default"].bind(swiper); 1423 } 1424 swiper.onClick = _onClick["default"].bind(swiper); 1425 swiper.onLoad = _onLoad["default"].bind(swiper); 1426 if (!dummyEventAttached) { 1427 document.addEventListener('touchstart', dummyEventListener); 1428 dummyEventAttached = true; 1429 } 1430 events(swiper, 'on'); 1431} 1432function detachEvents() { 1433 var swiper = this; 1434 events(swiper, 'off'); 1435} 1436var _default = { 1437 attachEvents: attachEvents, 1438 detachEvents: detachEvents 1439}; 1440exports["default"] = _default; 1441 1442},{"./onClick.js":13,"./onLoad.js":14,"./onResize.js":15,"./onScroll.js":16,"./onTouchEnd.js":17,"./onTouchMove.js":18,"./onTouchStart.js":19,"ssr-window":1}],13:[function(require,module,exports){ 1443"use strict"; 1444 1445Object.defineProperty(exports, "__esModule", { 1446 value: true 1447}); 1448exports["default"] = onClick; 1449function onClick(e) { 1450 var swiper = this; 1451 if (!swiper.enabled) return; 1452 if (!swiper.allowClick) { 1453 if (swiper.params.preventClicks) e.preventDefault(); 1454 if (swiper.params.preventClicksPropagation && swiper.animating) { 1455 e.stopPropagation(); 1456 e.stopImmediatePropagation(); 1457 } 1458 } 1459} 1460 1461},{}],14:[function(require,module,exports){ 1462"use strict"; 1463 1464Object.defineProperty(exports, "__esModule", { 1465 value: true 1466}); 1467exports["default"] = onLoad; 1468var _processLazyPreloader = require("../../shared/process-lazy-preloader.js"); 1469function onLoad(e) { 1470 var swiper = this; 1471 (0, _processLazyPreloader.processLazyPreloader)(swiper, e.target); 1472 if (swiper.params.cssMode || swiper.params.slidesPerView !== 'auto' && !swiper.params.autoHeight) { 1473 return; 1474 }
1475 swiper.update(); 1476} 1477 1478},{"../../shared/process-lazy-preloader.js":96}],15:[function(require,module,exports){ 1479"use strict"; 1480 1481Object.defineProperty(exports, "__esModule", { 1482 value: true 1483}); 1484exports["default"] = onResize; 1485function onResize() { 1486 var swiper = this; 1487 var params = swiper.params, 1488 el = swiper.el; 1489 if (el && el.offsetWidth === 0) return; 1490 1491 // Breakpoints 1492 if (params.breakpoints) { 1493 swiper.setBreakpoint(); 1494 } 1495 1496 // Save locks 1497 var allowSlideNext = swiper.allowSlideNext, 1498 allowSlidePrev = swiper.allowSlidePrev, 1499 snapGrid = swiper.snapGrid; 1500 var isVirtual = swiper.virtual && swiper.params.virtual.enabled; 1501 1502 // Disable locks on resize 1503 swiper.allowSlideNext = true; 1504 swiper.allowSlidePrev = true; 1505 swiper.updateSize(); 1506 swiper.updateSlides(); 1507 swiper.updateSlidesClasses(); 1508 var isVirtualLoop = isVirtual && params.loop; 1509 if ((params.slidesPerView === 'auto' || params.slidesPerView > 1) && swiper.isEnd && !swiper.isBeginning && !swiper.params.centeredSlides && !isVirtualLoop) { 1510 swiper.slideTo(swiper.slides.length - 1, 0, false, true); 1511 } else { 1512 if (swiper.params.loop && !isVirtual) { 1513 swiper.slideToLoop(swiper.realIndex, 0, false, true); 1514 } else { 1515 swiper.slideTo(swiper.activeIndex, 0, false, true); 1516 } 1517 } 1518 if (swiper.autoplay && swiper.autoplay.running && swiper.autoplay.paused) { 1519 clearTimeout(swiper.autoplay.resizeTimeout); 1520 swiper.autoplay.resizeTimeout = setTimeout(function () { 1521 if (swiper.autoplay && swiper.autoplay.running && swiper.autoplay.paused) { 1522 swiper.autoplay.resume(); 1523 } 1524 }, 500); 1525 } 1526 // Return locks after resize 1527 swiper.allowSlidePrev = allowSlidePrev; 1528 swiper.allowSlideNext = allowSlideNext; 1529 if (swiper.params.watchOverflow && snapGrid !== swiper.snapGrid) { 1530 swiper.checkOverflow(); 1531 } 1532} 1533 1534},{}],16:[function(require,module,exports){ 1535"use strict"; 1536 1537Object.defineProperty(exports, "__esModule", { 1538 value: true 1539}); 1540exports["default"] = onScroll; 1541function onScroll() { 1542 var swiper = this; 1543 var wrapperEl = swiper.wrapperEl, 1544 rtlTranslate = swiper.rtlTranslate, 1545 enabled = swiper.enabled; 1546 if (!enabled) return; 1547 swiper.previousTranslate = swiper.translate; 1548 if (swiper.isHorizontal()) { 1549 swiper.translate = -wrapperEl.scrollLeft; 1550 } else { 1551 swiper.translate = -wrapperEl.scrollTop; 1552 } 1553 // eslint-disable-next-line 1554 if (swiper.translate === 0) swiper.translate = 0; 1555 swiper.updateActiveIndex(); 1556 swiper.updateSlidesClasses(); 1557 var newProgress; 1558 var translatesDiff = swiper.maxTranslate() - swiper.minTranslate(); 1559 if (translatesDiff === 0) { 1560 newProgress = 0; 1561 } else { 1562 newProgress = (swiper.translate - swiper.minTranslate()) / translatesDiff; 1563 } 1564 if (newProgress !== swiper.progress) { 1565 swiper.updateProgress(rtlTranslate ? -swiper.translate : swiper.translate); 1566 } 1567 swiper.emit('setTranslate', swiper.translate, false); 1568} 1569 1570},{}],17:[function(require,module,exports){ 1571"use strict"; 1572 1573Object.defineProperty(exports, "__esModule", { 1574 value: true 1575}); 1576exports["default"] = onTouchEnd; 1577var _utils = require("../../shared/utils.js"); 1578function onTouchEnd(event) { 1579 var swiper = this; 1580 var data = swiper.touchEventsData; 1581 var pointerIndex = data.evCache.findIndex(function (cachedEv) { 1582 return cachedEv.pointerId === event.pointerId; 1583 }); 1584 if (pointerIndex >= 0) { 1585 data.evCache.splice(pointerIndex, 1); 1586 } 1587 if (['pointercancel', 'pointerout', 'pointerleave'].includes(event.type)) { 1588 var proceed = event.type === 'pointercancel' && (swiper.browser.isSafari || swiper.browser.isWebView); 1589 if (!proceed) { 1590 return; 1591 } 1592 } 1593 var params = swiper.params, 1594 touches = swiper.touches, 1595 rtl = swiper.rtlTranslate, 1596 slidesGrid = swiper.slidesGrid, 1597 enabled = swiper.enabled; 1598 if (!enabled) return; 1599 if (!params.simulateTouch && event.pointerType === 'mouse') return; 1600 var e = event; 1601 if (e.originalEvent) e = e.originalEvent; 1602 if (data.allowTouchCallbacks) { 1603 swiper.emit('touchEnd', e); 1604 } 1605 data.allowTouchCallbacks = false; 1606 if (!data.isTouched) { 1607 if (data.isMoved && params.grabCursor) { 1608 swiper.setGrabCursor(false); 1609 } 1610 data.isMoved = false;
1611 data.startMoving = false; 1612 return; 1613 } 1614 // Return Grab Cursor 1615 if (params.grabCursor && data.isMoved && data.isTouched && (swiper.allowSlideNext === true || swiper.allowSlidePrev === true)) { 1616 swiper.setGrabCursor(false); 1617 } 1618 1619 // Time diff 1620 var touchEndTime = (0, _utils.now)(); 1621 var timeDiff = touchEndTime - data.touchStartTime; 1622 1623 // Tap, doubleTap, Click 1624 if (swiper.allowClick) { 1625 var pathTree = e.path || e.composedPath && e.composedPath(); 1626 swiper.updateClickedSlide(pathTree && pathTree[0] || e.target); 1627 swiper.emit('tap click', e); 1628 if (timeDiff < 300 && touchEndTime - data.lastClickTime < 300) { 1629 swiper.emit('doubleTap doubleClick', e); 1630 } 1631 } 1632 data.lastClickTime = (0, _utils.now)(); 1633 (0, _utils.nextTick)(function () { 1634 if (!swiper.destroyed) swiper.allowClick = true; 1635 }); 1636 if (!data.isTouched || !data.isMoved || !swiper.swipeDirection || touches.diff === 0 || data.currentTranslate === data.startTranslate) { 1637 data.isTouched = false; 1638 data.isMoved = false; 1639 data.startMoving = false; 1640 return; 1641 } 1642 data.isTouched = false; 1643 data.isMoved = false; 1644 data.startMoving = false; 1645 var currentPos; 1646 if (params.followFinger) { 1647 currentPos = rtl ? swiper.translate : -swiper.translate; 1648 } else { 1649 currentPos = -data.currentTranslate; 1650 } 1651 if (params.cssMode) { 1652 return; 1653 } 1654 if (swiper.params.freeMode && params.freeMode.enabled) { 1655 swiper.freeMode.onTouchEnd({ 1656 currentPos: currentPos 1657 }); 1658 return; 1659 } 1660 1661 // Find current slide 1662 var stopIndex = 0; 1663 var groupSize = swiper.slidesSizesGrid[0]; 1664 for (var i = 0; i < slidesGrid.length; i += i < params.slidesPerGroupSkip ? 1 : params.slidesPerGroup) { 1665 var _increment = i < params.slidesPerGroupSkip - 1 ? 1 : params.slidesPerGroup; 1666 if (typeof slidesGrid[i + _increment] !== 'undefined') { 1667 if (currentPos >= slidesGrid[i] && currentPos < slidesGrid[i + _increment]) { 1668 stopIndex = i; 1669 groupSize = slidesGrid[i + _increment] - slidesGrid[i]; 1670 } 1671 } else if (currentPos >= slidesGrid[i]) { 1672 stopIndex = i; 1673 groupSize = slidesGrid[slidesGrid.length - 1] - slidesGrid[slidesGrid.length - 2]; 1674 } 1675 } 1676 var rewindFirstIndex = null; 1677 var rewindLastIndex = null; 1678 if (params.rewind) { 1679 if (swiper.isBeginning) { 1680 rewindLastIndex = swiper.params.virtual && swiper.params.virtual.enabled && swiper.virtual ? swiper.virtual.slides.length - 1 : swiper.slides.length - 1; 1681 } else if (swiper.isEnd) { 1682 rewindFirstIndex = 0; 1683 } 1684 } 1685 // Find current slide size 1686 var ratio = (currentPos - slidesGrid[stopIndex]) / groupSize; 1687 var increment = stopIndex < params.slidesPerGroupSkip - 1 ? 1 : params.slidesPerGroup; 1688 if (timeDiff > params.longSwipesMs) { 1689 // Long touches 1690 if (!params.longSwipes) { 1691 swiper.slideTo(swiper.activeIndex); 1692 return; 1693 } 1694 if (swiper.swipeDirection === 'next') { 1695 if (ratio >= params.longSwipesRatio) swiper.slideTo(params.rewind && swiper.isEnd ? rewindFirstIndex : stopIndex + increment);else swiper.slideTo(stopIndex); 1696 } 1697 if (swiper.swipeDirection === 'prev') { 1698 if (ratio > 1 - params.longSwipesRatio) { 1699 swiper.slideTo(stopIndex + increment); 1700 } else if (rewindLastIndex !== null && ratio < 0 && Math.abs(ratio) > params.longSwipesRatio) { 1701 swiper.slideTo(rewindLastIndex); 1702 } else { 1703 swiper.slideTo(stopIndex); 1704 } 1705 } 1706 } else { 1707 // Short swipes 1708 if (!params.shortSwipes) { 1709 swiper.slideTo(swiper.activeIndex); 1710 return; 1711 } 1712 var isNavButtonTarget = swiper.navigation && (e.target === swiper.navigation.nextEl || e.target === swiper.navigation.prevEl); 1713 if (!isNavButtonTarget) { 1714 if (swiper.swipeDirection === 'next') { 1715 swiper.slideTo(rewindFirstIndex !== null ? rewindFirstIndex : stopIndex + increment); 1716 } 1717 if (swiper.swipeDirection === 'prev') { 1718 swiper.slideTo(rewindLastIndex !== null ? rewindLastIndex : stopIndex); 1719 } 1720 } else if (e.target === swiper.navigation.nextEl) { 1721 swiper.slideTo(stopIndex + increment); 1722 } else { 1723 swiper.slideTo(stopIndex); 1724 } 1725 } 1726} 1727 1728},{"../../shared/utils.js":97}],18:[function(require,module,exports){ 1729"use strict"; 1730 1731Object.defineProperty(exports, "__esModule", { 1732 value: true 1733}); 1734exports["default"] = onTouchMove; 1735var _ssrWindow = require("ssr-window"); 1736var _utils = require("../../shared/utils.js"); 1737function onTouchMove(event) { 1738 var document = (0, _ssrWindow.getDocument)(); 1739 var swiper = this; 1740 var data = swiper.touchEventsData; 1741 var params = swiper.params, 1742 touches = swiper.touches, 1743 rtl = swiper.rtlTranslate, 1744 enabled = swiper.enabled; 1745 if (!enabled) return; 1746 if (!params.simulateTouch && event.pointerType === 'mouse') return; 1747 var e = event; 1748 if (e.originalEvent) e = e.originalEvent; 1749 if (!data.isTouched) { 1750 if (data.startMoving && data.isScrolling) { 1751 swiper.emit('touchMoveOpposite', e); 1752 } 1753 return; 1754 } 1755 var pointerIndex = data.evCache.findIndex(function (cachedEv) { 1756 return cachedEv.pointerId === e.pointerId; 1757 }); 1758 if (pointerIndex >= 0) data.evCache[pointerIndex] = e; 1759 var targetTouch = data.evCache.length > 1 ? data.evCache[0] : e; 1760 var pageX = targetTouch.pageX; 1761 var pageY = targetTouch.pageY; 1762 if (e.preventedByNestedSwiper) { 1763 touches.startX = pageX; 1764 touches.startY = pageY; 1765 return; 1766 } 1767 if (!swiper.allowTouchMove) { 1768 if (!e.target.matches(data.focusableElements)) { 1769 swiper.allowClick = false;
1770 } 1771 if (data.isTouched) { 1772 Object.assign(touches, { 1773 startX: pageX, 1774 startY: pageY, 1775 prevX: swiper.touches.currentX, 1776 prevY: swiper.touches.currentY, 1777 currentX: pageX, 1778 currentY: pageY 1779 }); 1780 data.touchStartTime = (0, _utils.now)(); 1781 } 1782 return; 1783 } 1784 if (params.touchReleaseOnEdges && !params.loop) { 1785 if (swiper.isVertical()) { 1786 // Vertical 1787 if (pageY < touches.startY && swiper.translate <= swiper.maxTranslate() || pageY > touches.startY && swiper.translate >= swiper.minTranslate()) { 1788 data.isTouched = false; 1789 data.isMoved = false; 1790 return; 1791 } 1792 } else if (pageX < touches.startX && swiper.translate <= swiper.maxTranslate() || pageX > touches.startX && swiper.translate >= swiper.minTranslate()) { 1793 return; 1794 } 1795 } 1796 if (document.activeElement) { 1797 if (e.target === document.activeElement && e.target.matches(data.focusableElements)) { 1798 data.isMoved = true; 1799 swiper.allowClick = false; 1800 return; 1801 } 1802 } 1803 if (data.allowTouchCallbacks) { 1804 swiper.emit('touchMove', e); 1805 } 1806 if (e.targetTouches && e.targetTouches.length > 1) return; 1807 touches.currentX = pageX; 1808 touches.currentY = pageY; 1809 var diffX = touches.currentX - touches.startX; 1810 var diffY = touches.currentY - touches.startY; 1811 if (swiper.params.threshold && Math.sqrt(Math.pow(diffX, 2) + Math.pow(diffY, 2)) < swiper.params.threshold) return; 1812 if (typeof data.isScrolling === 'undefined') { 1813 var touchAngle; 1814 if (swiper.isHorizontal() && touches.currentY === touches.startY || swiper.isVertical() && touches.currentX === touches.startX) { 1815 data.isScrolling = false; 1816 } else { 1817 // eslint-disable-next-line 1818 if (diffX * diffX + diffY * diffY >= 25) { 1819 touchAngle = Math.atan2(Math.abs(diffY), Math.abs(diffX)) * 180 / Math.PI; 1820 data.isScrolling = swiper.isHorizontal() ? touchAngle > params.touchAngle : 90 - touchAngle > params.touchAngle; 1821 } 1822 } 1823 } 1824 if (data.isScrolling) { 1825 swiper.emit('touchMoveOpposite', e); 1826 } 1827 if (typeof data.startMoving === 'undefined') { 1828 if (touches.currentX !== touches.startX || touches.currentY !== touches.startY) { 1829 data.startMoving = true; 1830 } 1831 } 1832 if (data.isScrolling || swiper.zoom && swiper.params.zoom && swiper.params.zoom.enabled && data.evCache.length > 1) { 1833 data.isTouched = false; 1834 return; 1835 } 1836 if (!data.startMoving) { 1837 return; 1838 } 1839 swiper.allowClick = false; 1840 if (!params.cssMode && e.cancelable) { 1841 e.preventDefault(); 1842 } 1843 if (params.touchMoveStopPropagation && !params.nested) { 1844 e.stopPropagation(); 1845 } 1846 var diff = swiper.isHorizontal() ? diffX : diffY; 1847 var touchesDiff = swiper.isHorizontal() ? touches.currentX - touches.previousX : touches.currentY - touches.previousY; 1848 if (params.oneWayMovement) { 1849 diff = Math.abs(diff) * (rtl ? 1 : -1); 1850 touchesDiff = Math.abs(touchesDiff) * (rtl ? 1 : -1); 1851 } 1852 touches.diff = diff; 1853 diff *= params.touchRatio; 1854 if (rtl) { 1855 diff = -diff; 1856 touchesDiff = -touchesDiff; 1857 } 1858 var prevTouchesDirection = swiper.touchesDirection; 1859 swiper.swipeDirection = diff > 0 ? 'prev' : 'next'; 1860 swiper.touchesDirection = touchesDiff > 0 ? 'prev' : 'next'; 1861 var isLoop = swiper.params.loop && !params.cssMode; 1862 if (!data.isMoved) { 1863 if (isLoop) { 1864 swiper.loopFix({ 1865 direction: swiper.swipeDirection 1866 }); 1867 } 1868 data.startTranslate = swiper.getTranslate(); 1869 swiper.setTransition(0); 1870 if (swiper.animating) { 1871 var evt = new window.CustomEvent('transitionend', { 1872 bubbles: true, 1873 cancelable: true 1874 }); 1875 swiper.wrapperEl.dispatchEvent(evt); 1876 } 1877 data.allowMomentumBounce = false; 1878 // Grab Cursor 1879 if (params.grabCursor && (swiper.allowSlideNext === true || swiper.allowSlidePrev === true)) { 1880 swiper.setGrabCursor(true); 1881 } 1882 swiper.emit('sliderFirstMove', e); 1883 } 1884 var loopFixed; 1885 if (data.isMoved && prevTouchesDirection !== swiper.touchesDirection && isLoop && Math.abs(diff) >= 1) { 1886 // need another loop fix 1887 swiper.loopFix({ 1888 direction: swiper.swipeDirection, 1889 setTranslate: true 1890 }); 1891 loopFixed = true; 1892 } 1893 swiper.emit('sliderMove', e); 1894 data.isMoved = true; 1895 data.currentTranslate = diff + data.startTranslate; 1896 var disableParentSwiper = true; 1897 var resistanceRatio = params.resistanceRatio; 1898 if (params.touchReleaseOnEdges) { 1899 resistanceRatio = 0; 1900 } 1901 if (diff > 0) { 1902 if (isLoop && !loopFixed && data.currentTranslate > (params.centeredSlides ? swiper.minTranslate() - swiper.size / 2 : swiper.minTranslate())) { 1903 swiper.loopFix({ 1904 direction: 'prev', 1905 setTranslate: true, 1906 activeSlideIndex: 0 1907 }); 1908 } 1909 if (data.currentTranslate > swiper.minTranslate()) { 1910 disableParentSwiper = false;
1911 if (params.resistance) { 1912 data.currentTranslate = swiper.minTranslate() - 1 + Math.pow(-swiper.minTranslate() + data.startTranslate + diff, resistanceRatio); 1913 } 1914 } 1915 } else if (diff < 0) { 1916 if (isLoop && !loopFixed && data.currentTranslate < (params.centeredSlides ? swiper.maxTranslate() + swiper.size / 2 : swiper.maxTranslate())) { 1917 swiper.loopFix({ 1918 direction: 'next', 1919 setTranslate: true, 1920 activeSlideIndex: swiper.slides.length - (params.slidesPerView === 'auto' ? swiper.slidesPerViewDynamic() : Math.ceil(parseFloat(params.slidesPerView, 10))) 1921 }); 1922 } 1923 if (data.currentTranslate < swiper.maxTranslate()) { 1924 disableParentSwiper = false; 1925 if (params.resistance) { 1926 data.currentTranslate = swiper.maxTranslate() + 1 - Math.pow(swiper.maxTranslate() - data.startTranslate - diff, resistanceRatio); 1927 } 1928 } 1929 } 1930 if (disableParentSwiper) { 1931 e.preventedByNestedSwiper = true; 1932 } 1933 1934 // Directions locks 1935 if (!swiper.allowSlideNext && swiper.swipeDirection === 'next' && data.currentTranslate < data.startTranslate) { 1936 data.currentTranslate = data.startTranslate; 1937 } 1938 if (!swiper.allowSlidePrev && swiper.swipeDirection === 'prev' && data.currentTranslate > data.startTranslate) { 1939 data.currentTranslate = data.startTranslate; 1940 } 1941 if (!swiper.allowSlidePrev && !swiper.allowSlideNext) { 1942 data.currentTranslate = data.startTranslate; 1943 } 1944 1945 // Threshold 1946 if (params.threshold > 0) { 1947 if (Math.abs(diff) > params.threshold || data.allowThresholdMove) { 1948 if (!data.allowThresholdMove) { 1949 data.allowThresholdMove = true; 1950 touches.startX = touches.currentX; 1951 touches.startY = touches.currentY; 1952 data.currentTranslate = data.startTranslate; 1953 touches.diff = swiper.isHorizontal() ? touches.currentX - touches.startX : touches.currentY - touches.startY; 1954 return; 1955 } 1956 } else { 1957 data.currentTranslate = data.startTranslate; 1958 return; 1959 } 1960 } 1961 if (!params.followFinger || params.cssMode) return; 1962 1963 // Update active index in free mode 1964 if (params.freeMode && params.freeMode.enabled && swiper.freeMode || params.watchSlidesProgress) { 1965 swiper.updateActiveIndex(); 1966 swiper.updateSlidesClasses(); 1967 } 1968 if (swiper.params.freeMode && params.freeMode.enabled && swiper.freeMode) { 1969 swiper.freeMode.onTouchMove(); 1970 } 1971 // Update progress 1972 swiper.updateProgress(data.currentTranslate); 1973 // Update translate 1974 swiper.setTranslate(data.currentTranslate); 1975} 1976 1977},{"../../shared/utils.js":97,"ssr-window":1}],19:[function(require,module,exports){ 1978"use strict"; 1979 1980Object.defineProperty(exports, "__esModule", { 1981 value: true 1982}); 1983exports["default"] = onTouchStart; 1984var _ssrWindow = require("ssr-window"); 1985var _utils = require("../../shared/utils.js"); 1986// Modified from https://stackoverflow.com/questions/54520554/custom-element-getrootnode-closest-function-crossing-multiple-parent-shadowd 1987function closestElement(selector) { 1988 var base = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this; 1989 function __closestFrom(el) { 1990 if (!el || el === (0, _ssrWindow.getDocument)() || el === (0, _ssrWindow.getWindow)()) return null; 1991 if (el.assignedSlot) el = el.assignedSlot; 1992 var found = el.closest(selector); 1993 if (!found && !el.getRootNode) { 1994 return null; 1995 } 1996 return found || __closestFrom(el.getRootNode().host); 1997 } 1998 return __closestFrom(base); 1999} 2000function onTouchStart(event) { 2001 var swiper = this; 2002 var document = (0, _ssrWindow.getDocument)(); 2003 var window = (0, _ssrWindow.getWindow)(); 2004 var data = swiper.touchEventsData; 2005 data.evCache.push(event); 2006 var params = swiper.params, 2007 touches = swiper.touches, 2008 enabled = swiper.enabled; 2009 if (!enabled) return; 2010 if (!params.simulateTouch && event.pointerType === 'mouse') return; 2011 if (swiper.animating && params.preventInteractionOnTransition) { 2012 return; 2013 } 2014 if (!swiper.animating && params.cssMode && params.loop) { 2015 swiper.loopFix(); 2016 } 2017 var e = event; 2018 if (e.originalEvent) e = e.originalEvent; 2019 var targetEl = e.target; 2020 if (params.touchEventsTarget === 'wrapper') { 2021 if (!swiper.wrapperEl.contains(targetEl)) return; 2022 } 2023 if ('which' in e && e.which === 3) return; 2024 if ('button' in e && e.button > 0) return; 2025 if (data.isTouched && data.isMoved) return; 2026 2027 // change target el for shadow root component 2028 var swipingClassHasValue = !!params.noSwipingClass && params.noSwipingClass !== ''; 2029 // eslint-disable-next-line 2030 var eventPath = event.composedPath ? event.composedPath() : event.path; 2031 if (swipingClassHasValue && e.target && e.target.shadowRoot && eventPath) { 2032 targetEl = eventPath[0]; 2033 } 2034 var noSwipingSelector = params.noSwipingSelector ? params.noSwipingSelector : ".".concat(params.noSwipingClass); 2035 var isTargetShadow = !!(e.target && e.target.shadowRoot); 2036 2037 // use closestElement for shadow root element to get the actual closest for nested shadow root element 2038 if (params.noSwiping && (isTargetShadow ? closestElement(noSwipingSelector, targetEl) : targetEl.closest(noSwipingSelector))) { 2039 swiper.allowClick = true; 2040 return; 2041 } 2042 if (params.swipeHandler) { 2043 if (!targetEl.closest(params.swipeHandler)) return; 2044 } 2045 touches.currentX = e.pageX; 2046 touches.currentY = e.pageY; 2047 var startX = touches.currentX; 2048 var startY = touches.currentY; 2049 2050 // Do NOT start if iOS edge swipe is detected. Otherwise iOS app cannot swipe-to-go-back anymore 2051 2052 var edgeSwipeDetection = params.edgeSwipeDetection || params.iOSEdgeSwipeDetection; 2053 var edgeSwipeThreshold = params.edgeSwipeThreshold || params.iOSEdgeSwipeThreshold; 2054 if (edgeSwipeDetection && (startX <= edgeSwipeThreshold || startX >= window.innerWidth - edgeSwipeThreshold)) { 2055 if (edgeSwipeDetection === 'prevent') { 2056 event.preventDefault(); 2057 } else { 2058 return; 2059 } 2060 } 2061 Object.assign(data, { 2062 isTouched: true, 2063 isMoved: false, 2064 allowTouchCallbacks: true, 2065 isScrolling: undefined, 2066 startMoving: undefined 2067 }); 2068 touches.startX = startX; 2069 touches.startY = startY; 2070 data.touchStartTime = (0, _utils.now)(); 2071 swiper.allowClick = true; 2072 swiper.updateSize(); 2073 swiper.swipeDirection = undefined; 2074 if (params.threshold > 0) data.allowThresholdMove = false;
2075 var preventDefault = true; 2076 if (targetEl.matches(data.focusableElements)) { 2077 preventDefault = false; 2078 if (targetEl.nodeName === 'SELECT') { 2079 data.isTouched = false; 2080 } 2081 } 2082 if (document.activeElement && document.activeElement.matches(data.focusableElements) && document.activeElement !== targetEl) { 2083 document.activeElement.blur(); 2084 } 2085 var shouldPreventDefault = preventDefault && swiper.allowTouchMove && params.touchStartPreventDefault; 2086 if ((params.touchStartForcePreventDefault || shouldPreventDefault) && !targetEl.isContentEditable) { 2087 e.preventDefault(); 2088 } 2089 if (swiper.params.freeMode && swiper.params.freeMode.enabled && swiper.freeMode && swiper.animating && !params.cssMode) { 2090 swiper.freeMode.onTouchStart(); 2091 } 2092 swiper.emit('touchStart', e); 2093} 2094 2095},{"../../shared/utils.js":97,"ssr-window":1}],20:[function(require,module,exports){ 2096"use strict"; 2097 2098Object.defineProperty(exports, "__esModule", { 2099 value: true 2100}); 2101exports["default"] = void 0; 2102var _setGrabCursor = _interopRequireDefault(require("./setGrabCursor.js")); 2103var _unsetGrabCursor = _interopRequireDefault(require("./unsetGrabCursor.js")); 2104function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } 2105var _default = { 2106 setGrabCursor: _setGrabCursor["default"], 2107 unsetGrabCursor: _unsetGrabCursor["default"] 2108}; 2109exports["default"] = _default; 2110 2111},{"./setGrabCursor.js":21,"./unsetGrabCursor.js":22}],21:[function(require,module,exports){ 2112"use strict"; 2113 2114Object.defineProperty(exports, "__esModule", { 2115 value: true 2116}); 2117exports["default"] = setGrabCursor; 2118function setGrabCursor(moving) { 2119 var swiper = this; 2120 if (!swiper.params.simulateTouch || swiper.params.watchOverflow && swiper.isLocked || swiper.params.cssMode) return; 2121 var el = swiper.params.touchEventsTarget === 'container' ? swiper.el : swiper.wrapperEl; 2122 if (swiper.isElement) { 2123 swiper.__preventObserver__ = true; 2124 } 2125 el.style.cursor = 'move'; 2126 el.style.cursor = moving ? 'grabbing' : 'grab'; 2127 if (swiper.isElement) { 2128 requestAnimationFrame(function () { 2129 swiper.__preventObserver__ = false; 2130 }); 2131 } 2132} 2133 2134},{}],22:[function(require,module,exports){ 2135"use strict"; 2136 2137Object.defineProperty(exports, "__esModule", { 2138 value: true 2139}); 2140exports["default"] = unsetGrabCursor; 2141function unsetGrabCursor() { 2142 var swiper = this; 2143 if (swiper.params.watchOverflow && swiper.isLocked || swiper.params.cssMode) { 2144 return; 2145 } 2146 if (swiper.isElement) { 2147 swiper.__preventObserver__ = true; 2148 } 2149 swiper[swiper.params.touchEventsTarget === 'container' ? 'el' : 'wrapperEl'].style.cursor = ''; 2150 if (swiper.isElement) { 2151 requestAnimationFrame(function () { 2152 swiper.__preventObserver__ = false; 2153 }); 2154 } 2155} 2156 2157},{}],23:[function(require,module,exports){ 2158"use strict"; 2159 2160Object.defineProperty(exports, "__esModule", { 2161 value: true 2162}); 2163exports["default"] = void 0; 2164var _loopCreate = _interopRequireDefault(require("./loopCreate.js")); 2165var _loopFix = _interopRequireDefault(require("./loopFix.js")); 2166var _loopDestroy = _interopRequireDefault(require("./loopDestroy.js")); 2167function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } 2168var _default = { 2169 loopCreate: _loopCreate["default"], 2170 loopFix: _loopFix["default"], 2171 loopDestroy: _loopDestroy["default"] 2172}; 2173exports["default"] = _default; 2174 2175},{"./loopCreate.js":24,"./loopDestroy.js":25,"./loopFix.js":26}],24:[function(require,module,exports){ 2176"use strict"; 2177 2178Object.defineProperty(exports, "__esModule", { 2179 value: true 2180}); 2181exports["default"] = loopCreate; 2182var _utils = require("../../shared/utils.js"); 2183function loopCreate(slideRealIndex) { 2184 var swiper = this; 2185 var params = swiper.params, 2186 slidesEl = swiper.slidesEl; 2187 if (!params.loop || swiper.virtual && swiper.params.virtual.enabled) return; 2188 var slides = (0, _utils.elementChildren)(slidesEl, ".".concat(params.slideClass, ", swiper-slide")); 2189 slides.forEach(function (el, index) { 2190 el.setAttribute('data-swiper-slide-index', index); 2191 }); 2192 swiper.loopFix({ 2193 slideRealIndex: slideRealIndex, 2194 direction: params.centeredSlides ? undefined : 'next' 2195 }); 2196} 2197 2198},{"../../shared/utils.js":97}],25:[function(require,module,exports){ 2199"use strict"; 2200 2201Object.defineProperty(exports, "__esModule", { 2202 value: true 2203}); 2204exports["default"] = loopDestroy; 2205function loopDestroy() { 2206 var swiper = this; 2207 var params = swiper.params, 2208 slidesEl = swiper.slidesEl; 2209 if (!params.loop || swiper.virtual && swiper.params.virtual.enabled) return; 2210 swiper.recalcSlides(); 2211 var newSlidesOrder = [];
2212 swiper.slides.forEach(function (slideEl) { 2213 var index = typeof slideEl.swiperSlideIndex === 'undefined' ? slideEl.getAttribute('data-swiper-slide-index') * 1 : slideEl.swiperSlideIndex; 2214 newSlidesOrder[index] = slideEl; 2215 }); 2216 swiper.slides.forEach(function (slideEl) { 2217 slideEl.removeAttribute('data-swiper-slide-index'); 2218 }); 2219 newSlidesOrder.forEach(function (slideEl) { 2220 slidesEl.append(slideEl); 2221 }); 2222 swiper.recalcSlides(); 2223 swiper.slideTo(swiper.realIndex, 0); 2224} 2225 2226},{}],26:[function(require,module,exports){ 2227"use strict"; 2228 2229Object.defineProperty(exports, "__esModule", { 2230 value: true 2231}); 2232exports["default"] = loopFix; 2233function loopFix() { 2234 var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, 2235 slideRealIndex = _ref.slideRealIndex, 2236 _ref$slideTo = _ref.slideTo, 2237 slideTo = _ref$slideTo === void 0 ? true : _ref$slideTo, 2238 direction = _ref.direction, 2239 setTranslate = _ref.setTranslate, 2240 activeSlideIndex = _ref.activeSlideIndex, 2241 byController = _ref.byController, 2242 byMousewheel = _ref.byMousewheel; 2243 var swiper = this; 2244 if (!swiper.params.loop) return; 2245 swiper.emit('beforeLoopFix'); 2246 var slides = swiper.slides, 2247 allowSlidePrev = swiper.allowSlidePrev, 2248 allowSlideNext = swiper.allowSlideNext, 2249 slidesEl = swiper.slidesEl, 2250 params = swiper.params; 2251 swiper.allowSlidePrev = true; 2252 swiper.allowSlideNext = true; 2253 if (swiper.virtual && params.virtual.enabled) { 2254 if (slideTo) { 2255 if (!params.centeredSlides && swiper.snapIndex === 0) { 2256 swiper.slideTo(swiper.virtual.slides.length, 0, false, true); 2257 } else if (params.centeredSlides && swiper.snapIndex < params.slidesPerView) { 2258 swiper.slideTo(swiper.virtual.slides.length + swiper.snapIndex, 0, false, true); 2259 } else if (swiper.snapIndex === swiper.snapGrid.length - 1) { 2260 swiper.slideTo(swiper.virtual.slidesBefore, 0, false, true); 2261 } 2262 } 2263 swiper.allowSlidePrev = allowSlidePrev; 2264 swiper.allowSlideNext = allowSlideNext; 2265 swiper.emit('loopFix'); 2266 return; 2267 } 2268 var slidesPerView = params.slidesPerView === 'auto' ? swiper.slidesPerViewDynamic() : Math.ceil(parseFloat(params.slidesPerView, 10)); 2269 var loopedSlides = params.loopedSlides || slidesPerView; 2270 if (loopedSlides % params.slidesPerGroup !== 0) { 2271 loopedSlides += params.slidesPerGroup - loopedSlides % params.slidesPerGroup; 2272 } 2273 swiper.loopedSlides = loopedSlides; 2274 var prependSlidesIndexes = []; 2275 var appendSlidesIndexes = []; 2276 var activeIndex = swiper.activeIndex; 2277 if (typeof activeSlideIndex === 'undefined') { 2278 activeSlideIndex = swiper.getSlideIndex(swiper.slides.filter(function (el) { 2279 return el.classList.contains(params.slideActiveClass); 2280 })[0]); 2281 } else { 2282 activeIndex = activeSlideIndex; 2283 } 2284 var isNext = direction === 'next' || !direction; 2285 var isPrev = direction === 'prev' || !direction; 2286 var slidesPrepended = 0; 2287 var slidesAppended = 0; 2288 // prepend last slides before start 2289 if (activeSlideIndex < loopedSlides) { 2290 slidesPrepended = Math.max(loopedSlides - activeSlideIndex, params.slidesPerGroup); 2291 for (var i = 0; i < loopedSlides - activeSlideIndex; i += 1) { 2292 var index = i - Math.floor(i / slides.length) * slides.length; 2293 prependSlidesIndexes.push(slides.length - index - 1); 2294 } 2295 } else if (activeSlideIndex /* + slidesPerView */ > swiper.slides.length - loopedSlides * 2) { 2296 slidesAppended = Math.max(activeSlideIndex - (swiper.slides.length - loopedSlides * 2), params.slidesPerGroup); 2297 for (var _i = 0; _i < slidesAppended; _i += 1) { 2298 var _index = _i - Math.floor(_i / slides.length) * slides.length; 2299 appendSlidesIndexes.push(_index); 2300 } 2301 } 2302 if (isPrev) { 2303 prependSlidesIndexes.forEach(function (index) { 2304 swiper.slides[index].swiperLoopMoveDOM = true; 2305 slidesEl.prepend(swiper.slides[index]); 2306 swiper.slides[index].swiperLoopMoveDOM = false; 2307 }); 2308 } 2309 if (isNext) { 2310 appendSlidesIndexes.forEach(function (index) { 2311 swiper.slides[index].swiperLoopMoveDOM = true; 2312 slidesEl.append(swiper.slides[index]); 2313 swiper.slides[index].swiperLoopMoveDOM = false;
2314 }); 2315 } 2316 swiper.recalcSlides(); 2317 if (params.slidesPerView === 'auto') { 2318 swiper.updateSlides(); 2319 } 2320 if (params.watchSlidesProgress) { 2321 swiper.updateSlidesOffset(); 2322 } 2323 if (slideTo) { 2324 if (prependSlidesIndexes.length > 0 && isPrev) { 2325 if (typeof slideRealIndex === 'undefined') { 2326 var currentSlideTranslate = swiper.slidesGrid[activeIndex]; 2327 var newSlideTranslate = swiper.slidesGrid[activeIndex + slidesPrepended]; 2328 var diff = newSlideTranslate - currentSlideTranslate; 2329 if (byMousewheel) { 2330 swiper.setTranslate(swiper.translate - diff); 2331 } else { 2332 swiper.slideTo(activeIndex + slidesPrepended, 0, false, true); 2333 if (setTranslate) { 2334 swiper.touches[swiper.isHorizontal() ? 'startX' : 'startY'] += diff; 2335 } 2336 } 2337 } else { 2338 if (setTranslate) { 2339 swiper.slideToLoop(slideRealIndex, 0, false, true); 2340 } 2341 } 2342 } else if (appendSlidesIndexes.length > 0 && isNext) { 2343 if (typeof slideRealIndex === 'undefined') { 2344 var _currentSlideTranslate = swiper.slidesGrid[activeIndex]; 2345 var _newSlideTranslate = swiper.slidesGrid[activeIndex - slidesAppended]; 2346 var _diff = _newSlideTranslate - _currentSlideTranslate; 2347 if (byMousewheel) { 2348 swiper.setTranslate(swiper.translate - _diff); 2349 } else { 2350 swiper.slideTo(activeIndex - slidesAppended, 0, false, true); 2351 if (setTranslate) { 2352 swiper.touches[swiper.isHorizontal() ? 'startX' : 'startY'] += _diff; 2353 } 2354 } 2355 } else { 2356 swiper.slideToLoop(slideRealIndex, 0, false, true); 2357 } 2358 } 2359 } 2360 swiper.allowSlidePrev = allowSlidePrev; 2361 swiper.allowSlideNext = allowSlideNext; 2362 if (swiper.controller && swiper.controller.control && !byController) { 2363 var loopParams = { 2364 slideRealIndex: slideRealIndex, 2365 slideTo: false, 2366 direction: direction, 2367 setTranslate: setTranslate, 2368 activeSlideIndex: activeSlideIndex, 2369 byController: true 2370 }; 2371 if (Array.isArray(swiper.controller.control)) { 2372 swiper.controller.control.forEach(function (c) { 2373 if (!c.destroyed && c.params.loop) c.loopFix(loopParams); 2374 }); 2375 } else if (swiper.controller.control instanceof swiper.constructor && swiper.controller.control.params.loop) { 2376 swiper.controller.control.loopFix(loopParams); 2377 } 2378 } 2379 swiper.emit('loopFix'); 2380} 2381 2382},{}],27:[function(require,module,exports){ 2383"use strict"; 2384 2385Object.defineProperty(exports, "__esModule", { 2386 value: true 2387}); 2388exports["default"] = moduleExtendParams; 2389var _utils = require("../shared/utils.js"); 2390function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } 2391function moduleExtendParams(params, allModulesParams) { 2392 return function extendParams() { 2393 var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; 2394 var moduleParamName = Object.keys(obj)[0]; 2395 var moduleParams = obj[moduleParamName]; 2396 if (_typeof(moduleParams) !== 'object' || moduleParams === null) { 2397 (0, _utils.extend)(allModulesParams, obj); 2398 return; 2399 } 2400 if (['navigation', 'pagination', 'scrollbar'].indexOf(moduleParamName) >= 0 && params[moduleParamName] === true) { 2401 params[moduleParamName] = { 2402 auto: true 2403 }; 2404 } 2405 if (!(moduleParamName in params && 'enabled' in moduleParams)) { 2406 (0, _utils.extend)(allModulesParams, obj); 2407 return; 2408 } 2409 if (params[moduleParamName] === true) { 2410 params[moduleParamName] = { 2411 enabled: true 2412 }; 2413 } 2414 if (_typeof(params[moduleParamName]) === 'object' && !('enabled' in params[moduleParamName])) { 2415 params[moduleParamName].enabled = true; 2416 } 2417 if (!params[moduleParamName]) params[moduleParamName] = { 2418 enabled: false 2419 }; 2420 (0, _utils.extend)(allModulesParams, obj); 2421 }; 2422} 2423 2424},{"../shared/utils.js":97}],28:[function(require,module,exports){ 2425"use strict"; 2426 2427Object.defineProperty(exports, "__esModule", { 2428 value: true 2429}); 2430exports["default"] = Observer; 2431var _ssrWindow = require("ssr-window"); 2432var _utils = require("../../../shared/utils.js"); 2433function Observer(_ref) { 2434 var swiper = _ref.swiper, 2435 extendParams = _ref.extendParams, 2436 on = _ref.on, 2437 emit = _ref.emit; 2438 var observers = []; 2439 var window = (0, _ssrWindow.getWindow)(); 2440 var attach = function attach(target) { 2441 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; 2442 var ObserverFunc = window.MutationObserver || window.WebkitMutationObserver; 2443 var observer = new ObserverFunc(function (mutations) { 2444 // The observerUpdate event should only be triggered 2445 // once despite the number of mutations. Additional 2446 // triggers are redundant and are very costly 2447 if (swiper.__preventObserver__) return; 2448 if (mutations.length === 1) { 2449 emit('observerUpdate', mutations[0]); 2450 return; 2451 } 2452 var observerUpdate = function observerUpdate() { 2453 emit('observerUpdate', mutations[0]); 2454 }; 2455 if (window.requestAnimationFrame) { 2456 window.requestAnimationFrame(observerUpdate); 2457 } else { 2458 window.setTimeout(observerUpdate, 0); 2459 } 2460 }); 2461 observer.observe(target, { 2462 attributes: typeof options.attributes === 'undefined' ? true : options.attributes, 2463 childList: typeof options.childList === 'undefined' ? true : options.childList, 2464 characterData: typeof options.characterData === 'undefined' ? true : options.characterData 2465 }); 2466 observers.push(observer); 2467 };
2468 var init = function init() { 2469 if (!swiper.params.observer) return; 2470 if (swiper.params.observeParents) { 2471 var containerParents = (0, _utils.elementParents)(swiper.el); 2472 for (var i = 0; i < containerParents.length; i += 1) { 2473 attach(containerParents[i]); 2474 } 2475 } 2476 // Observe container 2477 attach(swiper.el, { 2478 childList: swiper.params.observeSlideChildren 2479 }); 2480 2481 // Observe wrapper 2482 attach(swiper.wrapperEl, { 2483 attributes: false 2484 }); 2485 }; 2486 var destroy = function destroy() { 2487 observers.forEach(function (observer) { 2488 observer.disconnect(); 2489 }); 2490 observers.splice(0, observers.length); 2491 }; 2492 extendParams({ 2493 observer: false, 2494 observeParents: false, 2495 observeSlideChildren: false 2496 }); 2497 on('init', init); 2498 on('destroy', destroy); 2499} 2500 2501},{"../../../shared/utils.js":97,"ssr-window":1}],29:[function(require,module,exports){ 2502"use strict"; 2503 2504Object.defineProperty(exports, "__esModule", { 2505 value: true 2506}); 2507exports["default"] = Resize; 2508var _ssrWindow = require("ssr-window"); 2509function Resize(_ref) { 2510 var swiper = _ref.swiper, 2511 on = _ref.on, 2512 emit = _ref.emit; 2513 var window = (0, _ssrWindow.getWindow)(); 2514 var observer = null; 2515 var animationFrame = null; 2516 var resizeHandler = function resizeHandler() { 2517 if (!swiper || swiper.destroyed || !swiper.initialized) return; 2518 emit('beforeResize'); 2519 emit('resize'); 2520 }; 2521 var createObserver = function createObserver() { 2522 if (!swiper || swiper.destroyed || !swiper.initialized) return; 2523 observer = new ResizeObserver(function (entries) { 2524 animationFrame = window.requestAnimationFrame(function () { 2525 var width = swiper.width, 2526 height = swiper.height; 2527 var newWidth = width; 2528 var newHeight = height; 2529 entries.forEach(function (_ref2) { 2530 var contentBoxSize = _ref2.contentBoxSize, 2531 contentRect = _ref2.contentRect, 2532 target = _ref2.target; 2533 if (target && target !== swiper.el) return; 2534 newWidth = contentRect ? contentRect.width : (contentBoxSize[0] || contentBoxSize).inlineSize; 2535 newHeight = contentRect ? contentRect.height : (contentBoxSize[0] || contentBoxSize).blockSize; 2536 }); 2537 if (newWidth !== width || newHeight !== height) { 2538 resizeHandler(); 2539 } 2540 }); 2541 }); 2542 observer.observe(swiper.el); 2543 }; 2544 var removeObserver = function removeObserver() { 2545 if (animationFrame) { 2546 window.cancelAnimationFrame(animationFrame); 2547 } 2548 if (observer && observer.unobserve && swiper.el) { 2549 observer.unobserve(swiper.el); 2550 observer = null; 2551 } 2552 }; 2553 var orientationChangeHandler = function orientationChangeHandler() { 2554 if (!swiper || swiper.destroyed || !swiper.initialized) return; 2555 emit('orientationchange'); 2556 }; 2557 on('init', function () { 2558 if (swiper.params.resizeObserver && typeof window.ResizeObserver !== 'undefined') { 2559 createObserver(); 2560 return; 2561 } 2562 window.addEventListener('resize', resizeHandler); 2563 window.addEventListener('orientationchange', orientationChangeHandler); 2564 }); 2565 on('destroy', function () { 2566 removeObserver(); 2567 window.removeEventListener('resize', resizeHandler); 2568 window.removeEventListener('orientationchange', orientationChangeHandler); 2569 }); 2570} 2571 2572},{"ssr-window":1}],30:[function(require,module,exports){ 2573"use strict"; 2574 2575Object.defineProperty(exports, "__esModule", { 2576 value: true 2577}); 2578exports["default"] = void 0;
2579var _slideTo = _interopRequireDefault(require("./slideTo.js")); 2580var _slideToLoop = _interopRequireDefault(require("./slideToLoop.js")); 2581var _slideNext = _interopRequireDefault(require("./slideNext.js")); 2582var _slidePrev = _interopRequireDefault(require("./slidePrev.js")); 2583var _slideReset = _interopRequireDefault(require("./slideReset.js")); 2584var _slideToClosest = _interopRequireDefault(require("./slideToClosest.js")); 2585var _slideToClickedSlide = _interopRequireDefault(require("./slideToClickedSlide.js")); 2586function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } 2587var _default = { 2588 slideTo: _slideTo["default"], 2589 slideToLoop: _slideToLoop["default"], 2590 slideNext: _slideNext["default"], 2591 slidePrev: _slidePrev["default"], 2592 slideReset: _slideReset["default"], 2593 slideToClosest: _slideToClosest["default"], 2594 slideToClickedSlide: _slideToClickedSlide["default"] 2595}; 2596exports["default"] = _default; 2597 2598},{"./slideNext.js":31,"./slidePrev.js":32,"./slideReset.js":33,"./slideTo.js":34,"./slideToClickedSlide.js":35,"./slideToClosest.js":36,"./slideToLoop.js":37}],31:[function(require,module,exports){ 2599"use strict"; 2600 2601Object.defineProperty(exports, "__esModule", { 2602 value: true 2603}); 2604exports["default"] = slideNext; 2605/* eslint no-unused-vars: "off" */ 2606function slideNext() { 2607 var speed = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.params.speed; 2608 var runCallbacks = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; 2609 var internal = arguments.length > 2 ? arguments[2] : undefined; 2610 var swiper = this; 2611 var enabled = swiper.enabled, 2612 params = swiper.params, 2613 animating = swiper.animating; 2614 if (!enabled) return swiper; 2615 var perGroup = params.slidesPerGroup; 2616 if (params.slidesPerView === 'auto' && params.slidesPerGroup === 1 && params.slidesPerGroupAuto) { 2617 perGroup = Math.max(swiper.slidesPerViewDynamic('current', true), 1); 2618 } 2619 var increment = swiper.activeIndex < params.slidesPerGroupSkip ? 1 : perGroup; 2620 var isVirtual = swiper.virtual && params.virtual.enabled; 2621 if (params.loop) { 2622 if (animating && !isVirtual && params.loopPreventsSliding) return false; 2623 swiper.loopFix({ 2624 direction: 'next' 2625 }); 2626 // eslint-disable-next-line 2627 swiper._clientLeft = swiper.wrapperEl.clientLeft; 2628 } 2629 if (params.rewind && swiper.isEnd) { 2630 return swiper.slideTo(0, speed, runCallbacks, internal); 2631 } 2632 return swiper.slideTo(swiper.activeIndex + increment, speed, runCallbacks, internal); 2633} 2634 2635},{}],32:[function(require,module,exports){ 2636"use strict"; 2637 2638Object.defineProperty(exports, "__esModule", { 2639 value: true 2640}); 2641exports["default"] = slidePrev; 2642/* eslint no-unused-vars: "off" */ 2643function slidePrev() { 2644 var speed = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.params.speed; 2645 var runCallbacks = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; 2646 var internal = arguments.length > 2 ? arguments[2] : undefined; 2647 var swiper = this; 2648 var params = swiper.params, 2649 snapGrid = swiper.snapGrid, 2650 slidesGrid = swiper.slidesGrid, 2651 rtlTranslate = swiper.rtlTranslate, 2652 enabled = swiper.enabled, 2653 animating = swiper.animating; 2654 if (!enabled) return swiper; 2655 var isVirtual = swiper.virtual && params.virtual.enabled; 2656 if (params.loop) { 2657 if (animating && !isVirtual && params.loopPreventsSliding) return false; 2658 swiper.loopFix({ 2659 direction: 'prev' 2660 }); 2661 // eslint-disable-next-line 2662 swiper._clientLeft = swiper.wrapperEl.clientLeft; 2663 } 2664 var translate = rtlTranslate ? swiper.translate : -swiper.translate; 2665 function normalize(val) { 2666 if (val < 0) return -Math.floor(Math.abs(val)); 2667 return Math.floor(val); 2668 } 2669 var normalizedTranslate = normalize(translate); 2670 var normalizedSnapGrid = snapGrid.map(function (val) { 2671 return normalize(val); 2672 }); 2673 var prevSnap = snapGrid[normalizedSnapGrid.indexOf(normalizedTranslate) - 1]; 2674 if (typeof prevSnap === 'undefined' && params.cssMode) { 2675 var prevSnapIndex; 2676 snapGrid.forEach(function (snap, snapIndex) { 2677 if (normalizedTranslate >= snap) { 2678 // prevSnap = snap; 2679 prevSnapIndex = snapIndex; 2680 } 2681 }); 2682 if (typeof prevSnapIndex !== 'undefined') { 2683 prevSnap = snapGrid[prevSnapIndex > 0 ? prevSnapIndex - 1 : prevSnapIndex]; 2684 } 2685 } 2686 var prevIndex = 0; 2687 if (typeof prevSnap !== 'undefined') { 2688 prevIndex = slidesGrid.indexOf(prevSnap); 2689 if (prevIndex < 0) prevIndex = swiper.activeIndex - 1; 2690 if (params.slidesPerView === 'auto' && params.slidesPerGroup === 1 && params.slidesPerGroupAuto) { 2691 prevIndex = prevIndex - swiper.slidesPerViewDynamic('previous', true) + 1; 2692 prevIndex = Math.max(prevIndex, 0); 2693 } 2694 } 2695 if (params.rewind && swiper.isBeginning) { 2696 var lastIndex = swiper.params.virtual && swiper.params.virtual.enabled && swiper.virtual ? swiper.virtual.slides.length - 1 : swiper.slides.length - 1; 2697 return swiper.slideTo(lastIndex, speed, runCallbacks, internal); 2698 } 2699 return swiper.slideTo(prevIndex, speed, runCallbacks, internal); 2700} 2701 2702},{}],33:[function(require,module,exports){ 2703"use strict"; 2704 2705Object.defineProperty(exports, "__esModule", { 2706 value: true 2707}); 2708exports["default"] = slideReset; 2709/* eslint no-unused-vars: "off" */ 2710function slideReset() { 2711 var speed = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.params.speed; 2712 var runCallbacks = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; 2713 var internal = arguments.length > 2 ? arguments[2] : undefined; 2714 var swiper = this; 2715 return swiper.slideTo(swiper.activeIndex, speed, runCallbacks, internal); 2716} 2717 2718},{}],34:[function(require,module,exports){ 2719"use strict"; 2720 2721Object.defineProperty(exports, "__esModule", { 2722 value: true 2723}); 2724exports["default"] = slideTo; 2725var _utils = require("../../shared/utils.js"); 2726function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } 2727function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } 2728function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string");
2728 return _typeof(key) === "symbol" ? key : String(key); } 2729function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } 2730function slideTo() { 2731 var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; 2732 var speed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.params.speed; 2733 var runCallbacks = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; 2734 var internal = arguments.length > 3 ? arguments[3] : undefined; 2735 var initial = arguments.length > 4 ? arguments[4] : undefined; 2736 if (typeof index === 'string') { 2737 index = parseInt(index, 10); 2738 } 2739 var swiper = this; 2740 var slideIndex = index; 2741 if (slideIndex < 0) slideIndex = 0; 2742 var params = swiper.params, 2743 snapGrid = swiper.snapGrid, 2744 slidesGrid = swiper.slidesGrid, 2745 previousIndex = swiper.previousIndex, 2746 activeIndex = swiper.activeIndex, 2747 rtl = swiper.rtlTranslate, 2748 wrapperEl = swiper.wrapperEl, 2749 enabled = swiper.enabled; 2750 if (swiper.animating && params.preventInteractionOnTransition || !enabled && !internal && !initial) { 2751 return false; 2752 } 2753 var skip = Math.min(swiper.params.slidesPerGroupSkip, slideIndex); 2754 var snapIndex = skip + Math.floor((slideIndex - skip) / swiper.params.slidesPerGroup); 2755 if (snapIndex >= snapGrid.length) snapIndex = snapGrid.length - 1; 2756 var translate = -snapGrid[snapIndex]; 2757 // Normalize slideIndex 2758 if (params.normalizeSlideIndex) { 2759 for (var i = 0; i < slidesGrid.length; i += 1) { 2760 var normalizedTranslate = -Math.floor(translate * 100); 2761 var normalizedGrid = Math.floor(slidesGrid[i] * 100); 2762 var normalizedGridNext = Math.floor(slidesGrid[i + 1] * 100); 2763 if (typeof slidesGrid[i + 1] !== 'undefined') { 2764 if (normalizedTranslate >= normalizedGrid && normalizedTranslate < normalizedGridNext - (normalizedGridNext - normalizedGrid) / 2) { 2765 slideIndex = i; 2766 } else if (normalizedTranslate >= normalizedGrid && normalizedTranslate < normalizedGridNext) { 2767 slideIndex = i + 1; 2768 } 2769 } else if (normalizedTranslate >= normalizedGrid) { 2770 slideIndex = i; 2771 } 2772 } 2773 } 2774 // Directions locks 2775 if (swiper.initialized && slideIndex !== activeIndex) { 2776 if (!swiper.allowSlideNext && translate < swiper.translate && translate < swiper.minTranslate()) { 2777 return false; 2778 } 2779 if (!swiper.allowSlidePrev && translate > swiper.translate && translate > swiper.maxTranslate()) { 2780 if ((activeIndex || 0) !== slideIndex) { 2781 return false; 2782 } 2783 } 2784 } 2785 if (slideIndex !== (previousIndex || 0) && runCallbacks) { 2786 swiper.emit('beforeSlideChangeStart'); 2787 } 2788 2789 // Update progress 2790 swiper.updateProgress(translate); 2791 var direction; 2792 if (slideIndex > activeIndex) direction = 'next';else if (slideIndex < activeIndex) direction = 'prev';else direction = 'reset'; 2793 2794 // Update Index 2795 if (rtl && -translate === swiper.translate || !rtl && translate === swiper.translate) { 2796 swiper.updateActiveIndex(slideIndex); 2797 // Update Height 2798 if (params.autoHeight) { 2799 swiper.updateAutoHeight(); 2800 } 2801 swiper.updateSlidesClasses(); 2802 if (params.effect !== 'slide') { 2803 swiper.setTranslate(translate); 2804 } 2805 if (direction !== 'reset') { 2806 swiper.transitionStart(runCallbacks, direction); 2807 swiper.transitionEnd(runCallbacks, direction); 2808 } 2809 return false; 2810 } 2811 if (params.cssMode) { 2812 var isH = swiper.isHorizontal(); 2813 var t = rtl ? translate : -translate; 2814 if (speed === 0) { 2815 var isVirtual = swiper.virtual && swiper.params.virtual.enabled; 2816 if (isVirtual) { 2817 swiper.wrapperEl.style.scrollSnapType = 'none'; 2818 swiper._immediateVirtual = true; 2819 } 2820 if (isVirtual && !swiper._cssModeVirtualInitialSet && swiper.params.initialSlide > 0) { 2821 swiper._cssModeVirtualInitialSet = true; 2822 requestAnimationFrame(function () { 2823 wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = t; 2824 }); 2825 } else { 2826 wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = t; 2827 } 2828 if (isVirtual) { 2829 requestAnimationFrame(function () { 2830 swiper.wrapperEl.style.scrollSnapType = ''; 2831 swiper._immediateVirtual = false;
2832 }); 2833 } 2834 } else { 2835 var _wrapperEl$scrollTo; 2836 if (!swiper.support.smoothScroll) { 2837 (0, _utils.animateCSSModeScroll)({ 2838 swiper: swiper, 2839 targetPosition: t, 2840 side: isH ? 'left' : 'top' 2841 }); 2842 return true; 2843 } 2844 wrapperEl.scrollTo((_wrapperEl$scrollTo = {}, _defineProperty(_wrapperEl$scrollTo, isH ? 'left' : 'top', t), _defineProperty(_wrapperEl$scrollTo, "behavior", 'smooth'), _wrapperEl$scrollTo)); 2845 } 2846 return true; 2847 } 2848 swiper.setTransition(speed); 2849 swiper.setTranslate(translate); 2850 swiper.updateActiveIndex(slideIndex); 2851 swiper.updateSlidesClasses(); 2852 swiper.emit('beforeTransitionStart', speed, internal); 2853 swiper.transitionStart(runCallbacks, direction); 2854 if (speed === 0) { 2855 swiper.transitionEnd(runCallbacks, direction); 2856 } else if (!swiper.animating) { 2857 swiper.animating = true; 2858 if (!swiper.onSlideToWrapperTransitionEnd) { 2859 swiper.onSlideToWrapperTransitionEnd = function transitionEnd(e) { 2860 if (!swiper || swiper.destroyed) return; 2861 if (e.target !== this) return; 2862 swiper.wrapperEl.removeEventListener('transitionend', swiper.onSlideToWrapperTransitionEnd); 2863 swiper.onSlideToWrapperTransitionEnd = null; 2864 delete swiper.onSlideToWrapperTransitionEnd; 2865 swiper.transitionEnd(runCallbacks, direction); 2866 }; 2867 } 2868 swiper.wrapperEl.addEventListener('transitionend', swiper.onSlideToWrapperTransitionEnd); 2869 } 2870 return true; 2871} 2872 2873},{"../../shared/utils.js":97}],35:[function(require,module,exports){ 2874"use strict"; 2875 2876Object.defineProperty(exports, "__esModule", { 2877 value: true 2878}); 2879exports["default"] = slideToClickedSlide; 2880var _utils = require("../../shared/utils.js"); 2881function slideToClickedSlide() { 2882 var swiper = this; 2883 var params = swiper.params, 2884 slidesEl = swiper.slidesEl; 2885 var slidesPerView = params.slidesPerView === 'auto' ? swiper.slidesPerViewDynamic() : params.slidesPerView; 2886 var slideToIndex = swiper.clickedIndex; 2887 var realIndex; 2888 var slideSelector = swiper.isElement ? "swiper-slide" : ".".concat(params.slideClass); 2889 if (params.loop) { 2890 if (swiper.animating) return; 2891 realIndex = parseInt(swiper.clickedSlide.getAttribute('data-swiper-slide-index'), 10); 2892 if (params.centeredSlides) { 2893 if (slideToIndex < swiper.loopedSlides - slidesPerView / 2 || slideToIndex > swiper.slides.length - swiper.loopedSlides + slidesPerView / 2) { 2894 swiper.loopFix(); 2895 slideToIndex = swiper.getSlideIndex((0, _utils.elementChildren)(slidesEl, "".concat(slideSelector, "[data-swiper-slide-index=\"").concat(realIndex, "\"]"))[0]); 2896 (0, _utils.nextTick)(function () { 2897 swiper.slideTo(slideToIndex); 2898 }); 2899 } else { 2900 swiper.slideTo(slideToIndex); 2901 } 2902 } else if (slideToIndex > swiper.slides.length - slidesPerView) { 2903 swiper.loopFix(); 2904 slideToIndex = swiper.getSlideIndex((0, _utils.elementChildren)(slidesEl, "".concat(slideSelector, "[data-swiper-slide-index=\"").concat(realIndex, "\"]"))[0]); 2905 (0, _utils.nextTick)(function () { 2906 swiper.slideTo(slideToIndex); 2907 }); 2908 } else { 2909 swiper.slideTo(slideToIndex); 2910 } 2911 } else { 2912 swiper.slideTo(slideToIndex); 2913 } 2914} 2915 2916},{"../../shared/utils.js":97}],36:[function(require,module,exports){ 2917"use strict"; 2918 2919Object.defineProperty(exports, "__esModule", { 2920 value: true 2921}); 2922exports["default"] = slideToClosest; 2923/* eslint no-unused-vars: "off" */ 2924function slideToClosest() { 2925 var speed = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.params.speed; 2926 var runCallbacks = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; 2927 var internal = arguments.length > 2 ? arguments[2] : undefined; 2928 var threshold = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0.5; 2929 var swiper = this; 2930 var index = swiper.activeIndex; 2931 var skip = Math.min(swiper.params.slidesPerGroupSkip, index); 2932 var snapIndex = skip + Math.floor((index - skip) / swiper.params.slidesPerGroup);
2933 var translate = swiper.rtlTranslate ? swiper.translate : -swiper.translate; 2934 if (translate >= swiper.snapGrid[snapIndex]) { 2935 // The current translate is on or after the current snap index, so the choice 2936 // is between the current index and the one after it. 2937 var currentSnap = swiper.snapGrid[snapIndex]; 2938 var nextSnap = swiper.snapGrid[snapIndex + 1]; 2939 if (translate - currentSnap > (nextSnap - currentSnap) * threshold) { 2940 index += swiper.params.slidesPerGroup; 2941 } 2942 } else { 2943 // The current translate is before the current snap index, so the choice 2944 // is between the current index and the one before it. 2945 var prevSnap = swiper.snapGrid[snapIndex - 1]; 2946 var _currentSnap = swiper.snapGrid[snapIndex]; 2947 if (translate - prevSnap <= (_currentSnap - prevSnap) * threshold) { 2948 index -= swiper.params.slidesPerGroup; 2949 } 2950 } 2951 index = Math.max(index, 0); 2952 index = Math.min(index, swiper.slidesGrid.length - 1); 2953 return swiper.slideTo(index, speed, runCallbacks, internal); 2954} 2955 2956},{}],37:[function(require,module,exports){ 2957"use strict"; 2958 2959Object.defineProperty(exports, "__esModule", { 2960 value: true 2961}); 2962exports["default"] = slideToLoop; 2963function slideToLoop() { 2964 var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; 2965 var speed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.params.speed; 2966 var runCallbacks = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; 2967 var internal = arguments.length > 3 ? arguments[3] : undefined; 2968 if (typeof index === 'string') { 2969 var indexAsNumber = parseInt(index, 10); 2970 index = indexAsNumber; 2971 } 2972 var swiper = this; 2973 var newIndex = index; 2974 if (swiper.params.loop) { 2975 if (swiper.virtual && swiper.params.virtual.enabled) { 2976 // eslint-disable-next-line 2977 newIndex = newIndex + swiper.virtual.slidesBefore; 2978 } else { 2979 newIndex = swiper.getSlideIndexByData(newIndex); 2980 } 2981 } 2982 return swiper.slideTo(newIndex, speed, runCallbacks, internal); 2983} 2984 2985},{}],38:[function(require,module,exports){ 2986"use strict"; 2987 2988Object.defineProperty(exports, "__esModule", { 2989 value: true 2990}); 2991exports["default"] = void 0; 2992var _setTransition = _interopRequireDefault(require("./setTransition.js")); 2993var _transitionStart = _interopRequireDefault(require("./transitionStart.js")); 2994var _transitionEnd = _interopRequireDefault(require("./transitionEnd.js")); 2995function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } 2996var _default = { 2997 setTransition: _setTransition["default"], 2998 transitionStart: _transitionStart["default"], 2999 transitionEnd: _transitionEnd["default"] 3000}; 3001exports["default"] = _default; 3002 3003},{"./setTransition.js":39,"./transitionEnd.js":41,"./transitionStart.js":42}],39:[function(require,module,exports){ 3004"use strict"; 3005 3006Object.defineProperty(exports, "__esModule", { 3007 value: true 3008}); 3009exports["default"] = setTransition; 3010function setTransition(duration, byController) { 3011 var swiper = this; 3012 if (!swiper.params.cssMode) { 3013 swiper.wrapperEl.style.transitionDuration = "".concat(duration, "ms"); 3014 } 3015 swiper.emit('setTransition', duration, byController); 3016} 3017 3018},{}],40:[function(require,module,exports){ 3019"use strict"; 3020 3021Object.defineProperty(exports, "__esModule", { 3022 value: true 3023}); 3024exports["default"] = transitionEmit; 3025function transitionEmit(_ref) { 3026 var swiper = _ref.swiper, 3027 runCallbacks = _ref.runCallbacks, 3028 direction = _ref.direction, 3029 step = _ref.step; 3030 var activeIndex = swiper.activeIndex, 3031 previousIndex = swiper.previousIndex; 3032 var dir = direction; 3033 if (!dir) { 3034 if (activeIndex > previousIndex) dir = 'next';else if (activeIndex < previousIndex) dir = 'prev';else dir = 'reset'; 3035 } 3036 swiper.emit("transition".concat(step)); 3037 if (runCallbacks && activeIndex !== previousIndex) { 3038 if (dir === 'reset') { 3039 swiper.emit("slideResetTransition".concat(step)); 3040 return; 3041 } 3042 swiper.emit("slideChangeTransition".concat(step)); 3043 if (dir === 'next') { 3044 swiper.emit("slideNextTransition".concat(step)); 3045 } else { 3046 swiper.emit("slidePrevTransition".concat(step)); 3047 } 3048 } 3049} 3050 3051},{}],41:[function(require,module,exports){ 3052"use strict"; 3053 3054Object.defineProperty(exports, "__esModule", { 3055 value: true 3056}); 3057exports["default"] = transitionEnd; 3058var _transitionEmit = _interopRequireDefault(require("./transitionEmit.js")); 3059function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } 3060function transitionEnd() { 3061 var runCallbacks = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; 3062 var direction = arguments.length > 1 ? arguments[1] : undefined; 3063 var swiper = this; 3064 var params = swiper.params; 3065 swiper.animating = false;
3066 if (params.cssMode) return; 3067 swiper.setTransition(0); 3068 (0, _transitionEmit["default"])({ 3069 swiper: swiper, 3070 runCallbacks: runCallbacks, 3071 direction: direction, 3072 step: 'End' 3073 }); 3074} 3075 3076},{"./transitionEmit.js":40}],42:[function(require,module,exports){ 3077"use strict"; 3078 3079Object.defineProperty(exports, "__esModule", { 3080 value: true 3081}); 3082exports["default"] = transitionStart; 3083var _transitionEmit = _interopRequireDefault(require("./transitionEmit.js")); 3084function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } 3085function transitionStart() { 3086 var runCallbacks = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; 3087 var direction = arguments.length > 1 ? arguments[1] : undefined; 3088 var swiper = this; 3089 var params = swiper.params; 3090 if (params.cssMode) return; 3091 if (params.autoHeight) { 3092 swiper.updateAutoHeight(); 3093 } 3094 (0, _transitionEmit["default"])({ 3095 swiper: swiper, 3096 runCallbacks: runCallbacks, 3097 direction: direction, 3098 step: 'Start' 3099 }); 3100} 3101 3102},{"./transitionEmit.js":40}],43:[function(require,module,exports){ 3103"use strict"; 3104 3105Object.defineProperty(exports, "__esModule", { 3106 value: true 3107}); 3108exports["default"] = getSwiperTranslate; 3109var _utils = require("../../shared/utils.js"); 3110function getSwiperTranslate() { 3111 var axis = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.isHorizontal() ? 'x' : 'y'; 3112 var swiper = this; 3113 var params = swiper.params, 3114 rtl = swiper.rtlTranslate, 3115 translate = swiper.translate, 3116 wrapperEl = swiper.wrapperEl; 3117 if (params.virtualTranslate) { 3118 return rtl ? -translate : translate; 3119 } 3120 if (params.cssMode) { 3121 return translate; 3122 } 3123 var currentTranslate = (0, _utils.getTranslate)(wrapperEl, axis); 3124 currentTranslate += swiper.cssOverflowAdjustment(); 3125 if (rtl) currentTranslate = -currentTranslate; 3126 return currentTranslate || 0; 3127} 3128 3129},{"../../shared/utils.js":97}],44:[function(require,module,exports){ 3130"use strict"; 3131 3132Object.defineProperty(exports, "__esModule", { 3133 value: true 3134}); 3135exports["default"] = void 0; 3136var _getTranslate = _interopRequireDefault(require("./getTranslate.js")); 3137var _setTranslate = _interopRequireDefault(require("./setTranslate.js")); 3138var _minTranslate = _interopRequireDefault(require("./minTranslate.js")); 3139var _maxTranslate = _interopRequireDefault(require("./maxTranslate.js")); 3140var _translateTo = _interopRequireDefault(require("./translateTo.js")); 3141function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } 3142var _default = { 3143 getTranslate: _getTranslate["default"], 3144 setTranslate: _setTranslate["default"], 3145 minTranslate: _minTranslate["default"], 3146 maxTranslate: _maxTranslate["default"], 3147 translateTo: _translateTo["default"] 3148}; 3149exports["default"] = _default; 3150 3151},{"./getTranslate.js":43,"./maxTranslate.js":45,"./minTranslate.js":46,"./setTranslate.js":47,"./translateTo.js":48}],45:[function(require,module,exports){ 3152"use strict"; 3153 3154Object.defineProperty(exports, "__esModule", { 3155 value: true 3156}); 3157exports["default"] = maxTranslate; 3158function maxTranslate() { 3159 return -this.snapGrid[this.snapGrid.length - 1]; 3160} 3161 3162},{}],46:[function(require,module,exports){ 3163"use strict"; 3164 3165Object.defineProperty(exports, "__esModule", { 3166 value: true 3167}); 3168exports["default"] = minTranslate; 3169function minTranslate() { 3170 return -this.snapGrid[0]; 3171} 3172 3173},{}],47:[function(require,module,exports){ 3174"use strict"; 3175 3176Object.defineProperty(exports, "__esModule", { 3177 value: true 3178}); 3179exports["default"] = setTranslate; 3180function setTranslate(translate, byController) { 3181 var swiper = this; 3182 var rtl = swiper.rtlTranslate, 3183 params = swiper.params, 3184 wrapperEl = swiper.wrapperEl, 3185 progress = swiper.progress; 3186 var x = 0; 3187 var y = 0; 3188 var z = 0; 3189 if (swiper.isHorizontal()) { 3190 x = rtl ? -translate : translate; 3191 } else { 3192 y = translate; 3193 } 3194 if (params.roundLengths) { 3195 x = Math.floor(x); 3196 y = Math.floor(y); 3197 } 3198 swiper.previousTranslate = swiper.translate; 3199 swiper.translate = swiper.isHorizontal() ? x : y; 3200 if (params.cssMode) { 3201 wrapperEl[swiper.isHorizontal() ? 'scrollLeft' : 'scrollTop'] = swiper.isHorizontal() ? -x : -y; 3202 } else if (!params.virtualTranslate) { 3203 if (swiper.isHorizontal()) { 3204 x -= swiper.cssOverflowAdjustment(); 3205 } else { 3206 y -= swiper.cssOverflowAdjustment(); 3207 } 3208 wrapperEl.style.transform = "translate3d(".concat(x, "px, ").concat(y, "px, ").concat(z, "px)"); 3209 } 3210 3211 // Check if we need to update progress 3212 var newProgress; 3213 var translatesDiff = swiper.maxTranslate() - swiper.minTranslate(); 3214 if (translatesDiff === 0) { 3215 newProgress = 0; 3216 } else { 3217 newProgress = (translate - swiper.minTranslate()) / translatesDiff; 3218 } 3219 if (newProgress !== progress) { 3220 swiper.updateProgress(translate); 3221 } 3222 swiper.emit('setTranslate', swiper.translate, byController); 3223} 3224 3225},{}],48:[function(require,module,exports){ 3226"use strict"; 3227 3228Object.defineProperty(exports, "__esModule", { 3229 value: true 3230}); 3231exports["default"] = translateTo; 3232var _utils = require("../../shared/utils.js"); 3233function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } 3234function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } 3235function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string");
3235 return _typeof(key) === "symbol" ? key : String(key); } 3236function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } 3237function translateTo() { 3238 var translate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; 3239 var speed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.params.speed; 3240 var runCallbacks = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; 3241 var translateBounds = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true; 3242 var internal = arguments.length > 4 ? arguments[4] : undefined; 3243 var swiper = this; 3244 var params = swiper.params, 3245 wrapperEl = swiper.wrapperEl; 3246 if (swiper.animating && params.preventInteractionOnTransition) { 3247 return false; 3248 } 3249 var minTranslate = swiper.minTranslate(); 3250 var maxTranslate = swiper.maxTranslate(); 3251 var newTranslate; 3252 if (translateBounds && translate > minTranslate) newTranslate = minTranslate;else if (translateBounds && translate < maxTranslate) newTranslate = maxTranslate;else newTranslate = translate; 3253 3254 // Update progress 3255 swiper.updateProgress(newTranslate); 3256 if (params.cssMode) { 3257 var isH = swiper.isHorizontal(); 3258 if (speed === 0) { 3259 wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = -newTranslate; 3260 } else { 3261 var _wrapperEl$scrollTo; 3262 if (!swiper.support.smoothScroll) { 3263 (0, _utils.animateCSSModeScroll)({ 3264 swiper: swiper, 3265 targetPosition: -newTranslate, 3266 side: isH ? 'left' : 'top' 3267 }); 3268 return true; 3269 } 3270 wrapperEl.scrollTo((_wrapperEl$scrollTo = {}, _defineProperty(_wrapperEl$scrollTo, isH ? 'left' : 'top', -newTranslate), _defineProperty(_wrapperEl$scrollTo, "behavior", 'smooth'), _wrapperEl$scrollTo)); 3271 } 3272 return true; 3273 } 3274 if (speed === 0) { 3275 swiper.setTransition(0); 3276 swiper.setTranslate(newTranslate); 3277 if (runCallbacks) { 3278 swiper.emit('beforeTransitionStart', speed, internal); 3279 swiper.emit('transitionEnd'); 3280 } 3281 } else { 3282 swiper.setTransition(speed); 3283 swiper.setTranslate(newTranslate); 3284 if (runCallbacks) { 3285 swiper.emit('beforeTransitionStart', speed, internal); 3286 swiper.emit('transitionStart'); 3287 } 3288 if (!swiper.animating) { 3289 swiper.animating = true; 3290 if (!swiper.onTranslateToWrapperTransitionEnd) { 3291 swiper.onTranslateToWrapperTransitionEnd = function transitionEnd(e) { 3292 if (!swiper || swiper.destroyed) return; 3293 if (e.target !== this) return; 3294 swiper.wrapperEl.removeEventListener('transitionend', swiper.onTranslateToWrapperTransitionEnd); 3295 swiper.onTranslateToWrapperTransitionEnd = null; 3296 delete swiper.onTranslateToWrapperTransitionEnd; 3297 if (runCallbacks) { 3298 swiper.emit('transitionEnd'); 3299 } 3300 }; 3301 } 3302 swiper.wrapperEl.addEventListener('transitionend', swiper.onTranslateToWrapperTransitionEnd); 3303 } 3304 } 3305 return true; 3306} 3307 3308},{"../../shared/utils.js":97}],49:[function(require,module,exports){ 3309"use strict"; 3310 3311Object.defineProperty(exports, "__esModule", { 3312 value: true 3313}); 3314exports["default"] = void 0; 3315var _updateSize = _interopRequireDefault(require("./updateSize.js")); 3316var _updateSlides = _interopRequireDefault(require("./updateSlides.js")); 3317var _updateAutoHeight = _interopRequireDefault(require("./updateAutoHeight.js")); 3318var _updateSlidesOffset = _interopRequireDefault(require("./updateSlidesOffset.js")); 3319var _updateSlidesProgress = _interopRequireDefault(require("./updateSlidesProgress.js")); 3320var _updateProgress = _interopRequireDefault(require("./updateProgress.js")); 3321var _updateSlidesClasses = _interopRequireDefault(require("./updateSlidesClasses.js")); 3322var _updateActiveIndex = _interopRequireDefault(require("./updateActiveIndex.js")); 3323var _updateClickedSlide = _interopRequireDefault(require("./updateClickedSlide.js")); 3324function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } 3325var _default = { 3326 updateSize: _updateSize["default"], 3327 updateSlides: _updateSlides["default"], 3328 updateAutoHeight: _updateAutoHeight["default"], 3329 updateSlidesOffset: _updateSlidesOffset["default"], 3330 updateSlidesProgress: _updateSlidesProgress["default"], 3331 updateProgress: _updateProgress["default"], 3332 updateSlidesClasses: _updateSlidesClasses["default"], 3333 updateActiveIndex: _updateActiveIndex["default"], 3334 updateClickedSlide: _updateClickedSlide["default"] 3335}; 3336exports["default"] = _default; 3337 3338},{"./updateActiveIndex.js":50,"./updateAutoHeight.js":51,"./updateClickedSlide.js":52,"./updateProgress.js":53,"./updateSize.js":54,"./updateSlides.js":55,"./updateSlidesClasses.js":56,"./updateSlidesOffset.js":57,"./updateSlidesProgress.js":58}],50:[function(require,module,exports){ 3339"use strict"; 3340 3341Object.defineProperty(exports, "__esModule", { 3342 value: true 3343}); 3344exports["default"] = updateActiveIndex;
3345exports.getActiveIndexByTranslate = getActiveIndexByTranslate; 3346var _processLazyPreloader = require("../../shared/process-lazy-preloader.js"); 3347function getActiveIndexByTranslate(swiper) { 3348 var slidesGrid = swiper.slidesGrid, 3349 params = swiper.params; 3350 var translate = swiper.rtlTranslate ? swiper.translate : -swiper.translate; 3351 var activeIndex; 3352 for (var i = 0; i < slidesGrid.length; i += 1) { 3353 if (typeof slidesGrid[i + 1] !== 'undefined') { 3354 if (translate >= slidesGrid[i] && translate < slidesGrid[i + 1] - (slidesGrid[i + 1] - slidesGrid[i]) / 2) { 3355 activeIndex = i; 3356 } else if (translate >= slidesGrid[i] && translate < slidesGrid[i + 1]) { 3357 activeIndex = i + 1; 3358 } 3359 } else if (translate >= slidesGrid[i]) { 3360 activeIndex = i; 3361 } 3362 } 3363 // Normalize slideIndex 3364 if (params.normalizeSlideIndex) { 3365 if (activeIndex < 0 || typeof activeIndex === 'undefined') activeIndex = 0; 3366 } 3367 return activeIndex; 3368} 3369function updateActiveIndex(newActiveIndex) { 3370 var swiper = this; 3371 var translate = swiper.rtlTranslate ? swiper.translate : -swiper.translate; 3372 var snapGrid = swiper.snapGrid, 3373 params = swiper.params, 3374 previousIndex = swiper.activeIndex, 3375 previousRealIndex = swiper.realIndex, 3376 previousSnapIndex = swiper.snapIndex; 3377 var activeIndex = newActiveIndex; 3378 var snapIndex; 3379 var getVirtualRealIndex = function getVirtualRealIndex(aIndex) { 3380 var realIndex = aIndex - swiper.virtual.slidesBefore; 3381 if (realIndex < 0) { 3382 realIndex = swiper.virtual.slides.length + realIndex; 3383 } 3384 if (realIndex >= swiper.virtual.slides.length) { 3385 realIndex -= swiper.virtual.slides.length; 3386 } 3387 return realIndex; 3388 }; 3389 if (typeof activeIndex === 'undefined') { 3390 activeIndex = getActiveIndexByTranslate(swiper); 3391 } 3392 if (snapGrid.indexOf(translate) >= 0) { 3393 snapIndex = snapGrid.indexOf(translate); 3394 } else { 3395 var skip = Math.min(params.slidesPerGroupSkip, activeIndex); 3396 snapIndex = skip + Math.floor((activeIndex - skip) / params.slidesPerGroup); 3397 } 3398 if (snapIndex >= snapGrid.length) snapIndex = snapGrid.length - 1; 3399 if (activeIndex === previousIndex) { 3400 if (snapIndex !== previousSnapIndex) { 3401 swiper.snapIndex = snapIndex; 3402 swiper.emit('snapIndexChange'); 3403 } 3404 if (swiper.params.loop && swiper.virtual && swiper.params.virtual.enabled) { 3405 swiper.realIndex = getVirtualRealIndex(activeIndex); 3406 } 3407 return; 3408 } 3409 // Get real index 3410 var realIndex; 3411 if (swiper.virtual && params.virtual.enabled && params.loop) { 3412 realIndex = getVirtualRealIndex(activeIndex); 3413 } else if (swiper.slides[activeIndex]) { 3414 realIndex = parseInt(swiper.slides[activeIndex].getAttribute('data-swiper-slide-index') || activeIndex, 10); 3415 } else { 3416 realIndex = activeIndex; 3417 } 3418 Object.assign(swiper, { 3419 previousSnapIndex: previousSnapIndex, 3420 snapIndex: snapIndex, 3421 previousRealIndex: previousRealIndex, 3422 realIndex: realIndex, 3423 previousIndex: previousIndex, 3424 activeIndex: activeIndex 3425 }); 3426 if (swiper.initialized) { 3427 (0, _processLazyPreloader.preload)(swiper); 3428 } 3429 swiper.emit('activeIndexChange'); 3430 swiper.emit('snapIndexChange'); 3431 if (previousRealIndex !== realIndex) { 3432 swiper.emit('realIndexChange'); 3433 } 3434 if (swiper.initialized || swiper.params.runCallbacksOnInit) { 3435 swiper.emit('slideChange'); 3436 } 3437} 3438 3439},{"../../shared/process-lazy-preloader.js":96}],51:[function(require,module,exports){ 3440"use strict"; 3441 3442Object.defineProperty(exports, "__esModule", { 3443 value: true 3444}); 3445exports["default"] = updateAutoHeight; 3446function updateAutoHeight(speed) { 3447 var swiper = this; 3448 var activeSlides = []; 3449 var isVirtual = swiper.virtual && swiper.params.virtual.enabled; 3450 var newHeight = 0; 3451 var i; 3452 if (typeof speed === 'number') { 3453 swiper.setTransition(speed); 3454 } else if (speed === true) { 3455 swiper.setTransition(swiper.params.speed); 3456 } 3457 var getSlideByIndex = function getSlideByIndex(index) { 3458 if (isVirtual) { 3459 return swiper.slides[swiper.getSlideIndexByData(index)]; 3460 } 3461 return swiper.slides[index]; 3462 }; 3463 // Find slides currently in view 3464 if (swiper.params.slidesPerView !== 'auto' && swiper.params.slidesPerView > 1) { 3465 if (swiper.params.centeredSlides) {
3466 (swiper.visibleSlides || []).forEach(function (slide) { 3467 activeSlides.push(slide); 3468 }); 3469 } else { 3470 for (i = 0; i < Math.ceil(swiper.params.slidesPerView); i += 1) { 3471 var index = swiper.activeIndex + i; 3472 if (index > swiper.slides.length && !isVirtual) break; 3473 activeSlides.push(getSlideByIndex(index)); 3474 } 3475 } 3476 } else { 3477 activeSlides.push(getSlideByIndex(swiper.activeIndex)); 3478 } 3479 3480 // Find new height from highest slide in view 3481 for (i = 0; i < activeSlides.length; i += 1) { 3482 if (typeof activeSlides[i] !== 'undefined') { 3483 var height = activeSlides[i].offsetHeight; 3484 newHeight = height > newHeight ? height : newHeight; 3485 } 3486 } 3487 3488 // Update Height 3489 if (newHeight || newHeight === 0) swiper.wrapperEl.style.height = "".concat(newHeight, "px"); 3490} 3491 3492},{}],52:[function(require,module,exports){ 3493"use strict"; 3494 3495Object.defineProperty(exports, "__esModule", { 3496 value: true 3497}); 3498exports["default"] = updateClickedSlide; 3499function updateClickedSlide(e) { 3500 var swiper = this; 3501 var params = swiper.params; 3502 var slide = e.closest(".".concat(params.slideClass, ", swiper-slide")); 3503 var slideFound = false; 3504 var slideIndex; 3505 if (slide) { 3506 for (var i = 0; i < swiper.slides.length; i += 1) { 3507 if (swiper.slides[i] === slide) { 3508 slideFound = true; 3509 slideIndex = i; 3510 break; 3511 } 3512 } 3513 } 3514 if (slide && slideFound) { 3515 swiper.clickedSlide = slide; 3516 if (swiper.virtual && swiper.params.virtual.enabled) { 3517 swiper.clickedIndex = parseInt(slide.getAttribute('data-swiper-slide-index'), 10); 3518 } else { 3519 swiper.clickedIndex = slideIndex; 3520 } 3521 } else { 3522 swiper.clickedSlide = undefined; 3523 swiper.clickedIndex = undefined; 3524 return; 3525 } 3526 if (params.slideToClickedSlide && swiper.clickedIndex !== undefined && swiper.clickedIndex !== swiper.activeIndex) { 3527 swiper.slideToClickedSlide(); 3528 } 3529} 3530 3531},{}],53:[function(require,module,exports){ 3532"use strict"; 3533 3534Object.defineProperty(exports, "__esModule", { 3535 value: true 3536}); 3537exports["default"] = updateProgress; 3538function updateProgress(translate) { 3539 var swiper = this; 3540 if (typeof translate === 'undefined') { 3541 var multiplier = swiper.rtlTranslate ? -1 : 1; 3542 // eslint-disable-next-line 3543 translate = swiper && swiper.translate && swiper.translate * multiplier || 0; 3544 } 3545 var params = swiper.params; 3546 var translatesDiff = swiper.maxTranslate() - swiper.minTranslate(); 3547 var progress = swiper.progress, 3548 isBeginning = swiper.isBeginning, 3549 isEnd = swiper.isEnd, 3550 progressLoop = swiper.progressLoop; 3551 var wasBeginning = isBeginning; 3552 var wasEnd = isEnd; 3553 if (translatesDiff === 0) { 3554 progress = 0; 3555 isBeginning = true; 3556 isEnd = true; 3557 } else { 3558 progress = (translate - swiper.minTranslate()) / translatesDiff; 3559 var isBeginningRounded = Math.abs(translate - swiper.minTranslate()) < 1; 3560 var isEndRounded = Math.abs(translate - swiper.maxTranslate()) < 1; 3561 isBeginning = isBeginningRounded || progress <= 0; 3562 isEnd = isEndRounded || progress >= 1; 3563 if (isBeginningRounded) progress = 0; 3564 if (isEndRounded) progress = 1; 3565 } 3566 if (params.loop) { 3567 var firstSlideIndex = swiper.getSlideIndexByData(0); 3568 var lastSlideIndex = swiper.getSlideIndexByData(swiper.slides.length - 1); 3569 var firstSlideTranslate = swiper.slidesGrid[firstSlideIndex]; 3570 var lastSlideTranslate = swiper.slidesGrid[lastSlideIndex]; 3571 var translateMax = swiper.slidesGrid[swiper.slidesGrid.length - 1]; 3572 var translateAbs = Math.abs(translate); 3573 if (translateAbs >= firstSlideTranslate) { 3574 progressLoop = (translateAbs - firstSlideTranslate) / translateMax; 3575 } else { 3576 progressLoop = (translateAbs + translateMax - lastSlideTranslate) / translateMax; 3577 } 3578 if (progressLoop > 1) progressLoop -= 1; 3579 } 3580 Object.assign(swiper, { 3581 progress: progress, 3582 progressLoop: progressLoop, 3583 isBeginning: isBeginning, 3584 isEnd: isEnd 3585 }); 3586 if (params.watchSlidesProgress || params.centeredSlides && params.autoHeight) swiper.updateSlidesProgress(translate); 3587 if (isBeginning && !wasBeginning) { 3588 swiper.emit('reachBeginning toEdge'); 3589 } 3590 if (isEnd && !wasEnd) { 3591 swiper.emit('reachEnd toEdge'); 3592 } 3593 if (wasBeginning && !isBeginning || wasEnd && !isEnd) { 3594 swiper.emit('fromEdge'); 3595 } 3596 swiper.emit('progress', progress); 3597} 3598 3599},{}],54:[function(require,module,exports){ 3600"use strict"; 3601 3602Object.defineProperty(exports, "__esModule", { 3603 value: true 3604}); 3605exports["default"] = updateSize; 3606var _utils = require("../../shared/utils.js"); 3607function updateSize() { 3608 var swiper = this; 3609 var width; 3610 var height; 3611 var el = swiper.el; 3612 if (typeof swiper.params.width !== 'undefined' && swiper.params.width !== null) { 3613 width = swiper.params.width; 3614 } else { 3615 width = el.clientWidth; 3616 } 3617 if (typeof swiper.params.height !== 'undefined' && swiper.params.height !== null) { 3618 height = swiper.params.height; 3619 } else { 3620 height = el.clientHeight; 3621 } 3622 if (width === 0 && swiper.isHorizontal() || height === 0 && swiper.isVertical()) { 3623 return; 3624 } 3625 3626 // Subtract paddings 3627 width = width - parseInt((0, _utils.elementStyle)(el, 'padding-left') || 0, 10) - parseInt((0, _utils.elementStyle)(el, 'padding-right') || 0, 10); 3628 height = height - parseInt((0, _utils.elementStyle)(el, 'padding-top') || 0, 10) - parseInt((0, _utils.elementStyle)(el, 'padding-bottom') || 0, 10); 3629 if (Number.isNaN(width)) width = 0; 3630 if (Number.isNaN(height)) height = 0; 3631 Object.assign(swiper, { 3632 width: width, 3633 height: height, 3634 size: swiper.isHorizontal() ? width : height 3635 }); 3636} 3637 3638},{"../../shared/utils.js":97}],55:[function(require,module,exports){ 3639"use strict"; 3640 3641Object.defineProperty(exports, "__esModule", { 3642 value: true 3643}); 3644exports["default"] = updateSlides; 3645var _utils = require("../../shared/utils.js"); 3646function updateSlides() { 3647 var swiper = this; 3648 function getDirectionLabel(property) { 3649 if (swiper.isHorizontal()) { 3650 return property; 3651 } 3652 // prettier-ignore 3653 return { 3654 'width': 'height', 3655 'margin-top': 'margin-left', 3656 'margin-bottom ': 'margin-right', 3657 'margin-left': 'margin-top', 3658 'margin-right': 'margin-bottom', 3659 'padding-left': 'padding-top', 3660 'padding-right': 'padding-bottom', 3661 'marginRight': 'marginBottom' 3662 }[property]; 3663 } 3664 function getDirectionPropertyValue(node, label) { 3665 return parseFloat(node.getPropertyValue(getDirectionLabel(label)) || 0); 3666 } 3667 var params = swiper.params; 3668 var wrapperEl = swiper.wrapperEl, 3669 slidesEl = swiper.slidesEl, 3670 swiperSize = swiper.size, 3671 rtl = swiper.rtlTranslate, 3672 wrongRTL = swiper.wrongRTL; 3673 var isVirtual = swiper.virtual && params.virtual.enabled; 3674 var previousSlidesLength = isVirtual ? swiper.virtual.slides.length : swiper.slides.length; 3675 var slides = (0, _utils.elementChildren)(slidesEl, ".".concat(swiper.params.slideClass, ", swiper-slide")); 3676 var slidesLength = isVirtual ? swiper.virtual.slides.length : slides.length; 3677 var snapGrid = []; 3678 var slidesGrid = []; 3679 var slidesSizesGrid = []; 3680 var offsetBefore = params.slidesOffsetBefore; 3681 if (typeof offsetBefore === 'function') {
3682 offsetBefore = params.slidesOffsetBefore.call(swiper); 3683 } 3684 var offsetAfter = params.slidesOffsetAfter; 3685 if (typeof offsetAfter === 'function') { 3686 offsetAfter = params.slidesOffsetAfter.call(swiper); 3687 } 3688 var previousSnapGridLength = swiper.snapGrid.length; 3689 var previousSlidesGridLength = swiper.slidesGrid.length; 3690 var spaceBetween = params.spaceBetween; 3691 var slidePosition = -offsetBefore; 3692 var prevSlideSize = 0; 3693 var index = 0; 3694 if (typeof swiperSize === 'undefined') { 3695 return; 3696 } 3697 if (typeof spaceBetween === 'string' && spaceBetween.indexOf('%') >= 0) { 3698 spaceBetween = parseFloat(spaceBetween.replace('%', '')) / 100 * swiperSize; 3699 } else if (typeof spaceBetween === 'string') { 3700 spaceBetween = parseFloat(spaceBetween); 3701 } 3702 swiper.virtualSize = -spaceBetween; 3703 3704 // reset margins 3705 slides.forEach(function (slideEl) { 3706 if (rtl) { 3707 slideEl.style.marginLeft = ''; 3708 } else { 3709 slideEl.style.marginRight = ''; 3710 } 3711 slideEl.style.marginBottom = ''; 3712 slideEl.style.marginTop = ''; 3713 }); 3714 3715 // reset cssMode offsets 3716 if (params.centeredSlides && params.cssMode) { 3717 (0, _utils.setCSSProperty)(wrapperEl, '--swiper-centered-offset-before', ''); 3718 (0, _utils.setCSSProperty)(wrapperEl, '--swiper-centered-offset-after', ''); 3719 } 3720 var gridEnabled = params.grid && params.grid.rows > 1 && swiper.grid; 3721 if (gridEnabled) { 3722 swiper.grid.initSlides(slidesLength); 3723 } 3724 3725 // Calc slides 3726 var slideSize; 3727 var shouldResetSlideSize = params.slidesPerView === 'auto' && params.breakpoints && Object.keys(params.breakpoints).filter(function (key) { 3728 return typeof params.breakpoints[key].slidesPerView !== 'undefined'; 3729 }).length > 0; 3730 for (var i = 0; i < slidesLength; i += 1) { 3731 slideSize = 0; 3732 var slide = void 0; 3733 if (slides[i]) slide = slides[i]; 3734 if (gridEnabled) { 3735 swiper.grid.updateSlide(i, slide, slidesLength, getDirectionLabel); 3736 } 3737 if (slides[i] && (0, _utils.elementStyle)(slide, 'display') === 'none') continue; // eslint-disable-line 3738 3739 if (params.slidesPerView === 'auto') { 3740 if (shouldResetSlideSize) { 3741 slides[i].style[getDirectionLabel('width')] = ""; 3742 } 3743 var slideStyles = getComputedStyle(slide); 3744 var currentTransform = slide.style.transform; 3745 var currentWebKitTransform = slide.style.webkitTransform; 3746 if (currentTransform) { 3747 slide.style.transform = 'none'; 3748 } 3749 if (currentWebKitTransform) { 3750 slide.style.webkitTransform = 'none'; 3751 } 3752 if (params.roundLengths) { 3753 slideSize = swiper.isHorizontal() ? (0, _utils.elementOuterSize)(slide, 'width', true) : (0, _utils.elementOuterSize)(slide, 'height', true); 3754 } else { 3755 // eslint-disable-next-line 3756 var width = getDirectionPropertyValue(slideStyles, 'width'); 3757 var paddingLeft = getDirectionPropertyValue(slideStyles, 'padding-left'); 3758 var paddingRight = getDirectionPropertyValue(slideStyles, 'padding-right'); 3759 var marginLeft = getDirectionPropertyValue(slideStyles, 'margin-left'); 3760 var marginRight = getDirectionPropertyValue(slideStyles, 'margin-right'); 3761 var boxSizing = slideStyles.getPropertyValue('box-sizing'); 3762 if (boxSizing && boxSizing === 'border-box') { 3763 slideSize = width + marginLeft + marginRight; 3764 } else { 3765 var _slide = slide, 3766 clientWidth = _slide.clientWidth, 3767 offsetWidth = _slide.offsetWidth; 3768 slideSize = width + paddingLeft + paddingRight + marginLeft + marginRight + (offsetWidth - clientWidth); 3769 } 3770 } 3771 if (currentTransform) { 3772 slide.style.transform = currentTransform; 3773 } 3774 if (currentWebKitTransform) { 3775 slide.style.webkitTransform = currentWebKitTransform; 3776 } 3777 if (params.roundLengths) slideSize = Math.floor(slideSize); 3778 } else { 3779 slideSize = (swiperSize - (params.slidesPerView - 1) * spaceBetween) / params.slidesPerView; 3780 if (params.roundLengths) slideSize = Math.floor(slideSize); 3781 if (slides[i]) { 3782 slides[i].style[getDirectionLabel('width')] = "".concat(slideSize, "px"); 3783 } 3784 } 3785 if (slides[i]) { 3786 slides[i].swiperSlideSize = slideSize; 3787 } 3788 slidesSizesGrid.push(slideSize); 3789 if (params.centeredSlides) { 3790 slidePosition = slidePosition + slideSize / 2 + prevSlideSize / 2 + spaceBetween; 3791 if (prevSlideSize === 0 && i !== 0) slidePosition = slidePosition - swiperSize / 2 - spaceBetween; 3792 if (i === 0) slidePosition = slidePosition - swiperSize / 2 - spaceBetween; 3793 if (Math.abs(slidePosition) < 1 / 1000) slidePosition = 0; 3794 if (params.roundLengths) slidePosition = Math.floor(slidePosition); 3795 if (index % params.slidesPerGroup === 0) snapGrid.push(slidePosition); 3796 slidesGrid.push(slidePosition); 3797 } else { 3798 if (params.roundLengths) slidePosition = Math.floor(slidePosition); 3799 if ((index - Math.min(swiper.params.slidesPerGroupSkip, index)) % swiper.params.slidesPerGroup === 0) snapGrid.push(slidePosition); 3800 slidesGrid.push(slidePosition); 3801 slidePosition = slidePosition + slideSize + spaceBetween; 3802 } 3803 swiper.virtualSize += slideSize + spaceBetween; 3804 prevSlideSize = slideSize; 3805 index += 1; 3806 } 3807 swiper.virtualSize = Math.max(swiper.virtualSize, swiperSize) + offsetAfter; 3808 if (rtl && wrongRTL && (params.effect === 'slide' || params.effect === 'coverflow')) { 3809 wrapperEl.style.width = "".concat(swiper.virtualSize + spaceBetween, "px"); 3810 } 3811 if (params.setWrapperSize) { 3812 wrapperEl.style[getDirectionLabel('width')] = "".concat(swiper.virtualSize + spaceBetween, "px"); 3813 } 3814 if (gridEnabled) { 3815 swiper.grid.updateWrapperSize(slideSize, snapGrid, getDirectionLabel); 3816 } 3817 3818 // Remove last grid elements depending on width 3819 if (!params.centeredSlides) { 3820 var newSlidesGrid = []; 3821 for (var _i = 0; _i < snapGrid.length; _i += 1) { 3822 var slidesGridItem = snapGrid[_i]; 3823 if (params.roundLengths) slidesGridItem = Math.floor(slidesGridItem);
3824 if (snapGrid[_i] <= swiper.virtualSize - swiperSize) { 3825 newSlidesGrid.push(slidesGridItem); 3826 } 3827 } 3828 snapGrid = newSlidesGrid; 3829 if (Math.floor(swiper.virtualSize - swiperSize) - Math.floor(snapGrid[snapGrid.length - 1]) > 1) { 3830 snapGrid.push(swiper.virtualSize - swiperSize); 3831 } 3832 } 3833 if (isVirtual && params.loop) { 3834 var size = slidesSizesGrid[0] + spaceBetween; 3835 if (params.slidesPerGroup > 1) { 3836 var groups = Math.ceil((swiper.virtual.slidesBefore + swiper.virtual.slidesAfter) / params.slidesPerGroup); 3837 var groupSize = size * params.slidesPerGroup; 3838 for (var _i2 = 0; _i2 < groups; _i2 += 1) { 3839 snapGrid.push(snapGrid[snapGrid.length - 1] + groupSize); 3840 } 3841 } 3842 for (var _i3 = 0; _i3 < swiper.virtual.slidesBefore + swiper.virtual.slidesAfter; _i3 += 1) { 3843 if (params.slidesPerGroup === 1) { 3844 snapGrid.push(snapGrid[snapGrid.length - 1] + size); 3845 } 3846 slidesGrid.push(slidesGrid[slidesGrid.length - 1] + size); 3847 swiper.virtualSize += size; 3848 } 3849 } 3850 if (snapGrid.length === 0) snapGrid = [0]; 3851 if (spaceBetween !== 0) { 3852 var key = swiper.isHorizontal() && rtl ? 'marginLeft' : getDirectionLabel('marginRight'); 3853 slides.filter(function (_, slideIndex) { 3854 if (!params.cssMode || params.loop) return true; 3855 if (slideIndex === slides.length - 1) { 3856 return false; 3857 } 3858 return true; 3859 }
3859).forEach(function (slideEl) { 3860 slideEl.style[key] = "".concat(spaceBetween, "px"); 3861 }); 3862 } 3863 if (params.centeredSlides && params.centeredSlidesBounds) { 3864 var allSlidesSize = 0; 3865 slidesSizesGrid.forEach(function (slideSizeValue) { 3866 allSlidesSize += slideSizeValue + (spaceBetween || 0); 3867 }); 3868 allSlidesSize -= spaceBetween; 3869 var maxSnap = allSlidesSize - swiperSize; 3870 snapGrid = snapGrid.map(function (snap) { 3871 if (snap < 0) return -offsetBefore; 3872 if (snap > maxSnap) return maxSnap + offsetAfter; 3873 return snap; 3874 }); 3875 } 3876 if (params.centerInsufficientSlides) { 3877 var _allSlidesSize = 0; 3878 slidesSizesGrid.forEach(function (slideSizeValue) { 3879 _allSlidesSize += slideSizeValue + (spaceBetween || 0); 3880 }); 3881 _allSlidesSize -= spaceBetween; 3882 if (_allSlidesSize < swiperSize) { 3883 var allSlidesOffset = (swiperSize - _allSlidesSize) / 2; 3884 snapGrid.forEach(function (snap, snapIndex) { 3885 snapGrid[snapIndex] = snap - allSlidesOffset; 3886 }); 3887 slidesGrid.forEach(function (snap, snapIndex) { 3888 slidesGrid[snapIndex] = snap + allSlidesOffset; 3889 }); 3890 } 3891 } 3892 Object.assign(swiper, { 3893 slides: slides, 3894 snapGrid: snapGrid, 3895 slidesGrid: slidesGrid, 3896 slidesSizesGrid: slidesSizesGrid 3897 }); 3898 if (params.centeredSlides && params.cssMode && !params.centeredSlidesBounds) { 3899 (0, _utils.setCSSProperty)(wrapperEl, '--swiper-centered-offset-before', "".concat(-snapGrid[0], "px")); 3900 (0, _utils.setCSSProperty)(wrapperEl, '--swiper-centered-offset-after', "".concat(swiper.size / 2 - slidesSizesGrid[slidesSizesGrid.length - 1] / 2, "px")); 3901 var addToSnapGrid = -swiper.snapGrid[0]; 3902 var addToSlidesGrid = -swiper.slidesGrid[0]; 3903 swiper.snapGrid = swiper.snapGrid.map(function (v) { 3904 return v + addToSnapGrid; 3905 }); 3906 swiper.slidesGrid = swiper.slidesGrid.map(function (v) { 3907 return v + addToSlidesGrid; 3908 }); 3909 } 3910 if (slidesLength !== previousSlidesLength) { 3911 swiper.emit('slidesLengthChange'); 3912 } 3913 if (snapGrid.length !== previousSnapGridLength) { 3914 if (swiper.params.watchOverflow) swiper.checkOverflow(); 3915 swiper.emit('snapGridLengthChange'); 3916 } 3917 if (slidesGrid.length !== previousSlidesGridLength) { 3918 swiper.emit('slidesGridLengthChange'); 3919 } 3920 if (params.watchSlidesProgress) { 3921 swiper.updateSlidesOffset(); 3922 } 3923 if (!isVirtual && !params.cssMode && (params.effect === 'slide' || params.effect === 'fade')) { 3924 var backFaceHiddenClass = "".concat(params.containerModifierClass, "backface-hidden"); 3925 var hasClassBackfaceClassAdded = swiper.el.classList.contains(backFaceHiddenClass); 3926 if (slidesLength <= params.maxBackfaceHiddenSlides) { 3927 if (!hasClassBackfaceClassAdded) swiper.el.classList.add(backFaceHiddenClass); 3928 } else if (hasClassBackfaceClassAdded) { 3929 swiper.el.classList.remove(backFaceHiddenClass); 3930 } 3931 } 3932} 3933 3934},{"../../shared/utils.js":97}],56:[function(require,module,exports){ 3935"use strict"; 3936 3937Object.defineProperty(exports, "__esModule", { 3938 value: true 3939}); 3940exports["default"] = updateSlidesClasses; 3941var _utils = require("../../shared/utils.js"); 3942function updateSlidesClasses() { 3943 var swiper = this; 3944 var slides = swiper.slides, 3945 params = swiper.params, 3946 slidesEl = swiper.slidesEl, 3947 activeIndex = swiper.activeIndex; 3948 var isVirtual = swiper.virtual && params.virtual.enabled; 3949 var getFilteredSlide = function getFilteredSlide(selector) { 3950 return (0, _utils.elementChildren)(slidesEl, ".".concat(params.slideClass).concat(selector, ", swiper-slide").concat(selector))[0]; 3951 }; 3952 slides.forEach(function (slideEl) { 3953 slideEl.classList.remove(params.slideActiveClass, params.slideNextClass, params.slidePrevClass); 3954 }); 3955 var activeSlide; 3956 if (isVirtual) { 3957 if (params.loop) { 3958 var slideIndex = activeIndex - swiper.virtual.slidesBefore; 3959 if (slideIndex < 0) slideIndex = swiper.virtual.slides.length + slideIndex; 3960 if (slideIndex >= swiper.virtual.slides.length) slideIndex -= swiper.virtual.slides.length; 3961 activeSlide = getFilteredSlide("[data-swiper-slide-index=\"".concat(slideIndex, "\"]")); 3962 } else { 3963 activeSlide = getFilteredSlide("[data-swiper-slide-index=\"".concat(activeIndex, "\"]")); 3964 } 3965 } else { 3966 activeSlide = slides[activeIndex]; 3967 } 3968 if (activeSlide) { 3969 // Active classes 3970 activeSlide.classList.add(params.slideActiveClass); 3971 3972 // Next Slide 3973 var nextSlide = (0, _utils.elementNextAll)(activeSlide, ".".concat(params.slideClass, ", swiper-slide"))[0]; 3974 if (params.loop && !nextSlide) { 3975 nextSlide = slides[0]; 3976 } 3977 if (nextSlide) { 3978 nextSlide.classList.add(params.slideNextClass); 3979 } 3980 // Prev Slide 3981 var prevSlide = (0, _utils.elementPrevAll)(activeSlide, ".".concat(params.slideClass, ", swiper-slide"))[0]; 3982 if (params.loop && !prevSlide === 0) { 3983 prevSlide = slides[slides.length - 1]; 3984 } 3985 if (prevSlide) { 3986 prevSlide.classList.add(params.slidePrevClass); 3987 } 3988 } 3989 swiper.emitSlidesClasses(); 3990} 3991 3992},{"../../shared/utils.js":97}],57:[function(require,module,exports){ 3993"use strict"; 3994 3995Object.defineProperty(exports, "__esModule", { 3996 value: true 3997}); 3998exports["default"] = updateSlidesOffset; 3999function updateSlidesOffset() { 4000 var swiper = this; 4001 var slides = swiper.slides; 4002 // eslint-disable-next-line 4003 var minusOffset = swiper.isElement ? swiper.isHorizontal() ? swiper.wrapperEl.offsetLeft : swiper.wrapperEl.offsetTop : 0; 4004 for (var i = 0; i < slides.length; i += 1) { 4005 slides[i].swiperSlideOffset = (swiper.isHorizontal() ? slides[i].offsetLeft : slides[i].offsetTop) - minu
4005sOffset - swiper.cssOverflowAdjustment(); 4006 } 4007} 4008 4009},{}],58:[function(require,module,exports){ 4010"use strict"; 4011 4012Object.defineProperty(exports, "__esModule", { 4013 value: true 4014}); 4015exports["default"] = updateSlidesProgress; 4016function updateSlidesProgress() { 4017 var translate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this && this.translate || 0; 4018 var swiper = this; 4019 var params = swiper.params; 4020 var slides = swiper.slides, 4021 rtl = swiper.rtlTranslate, 4022 snapGrid = swiper.snapGrid; 4023 if (slides.length === 0) return; 4024 if (typeof slides[0].swiperSlideOffset === 'undefined') swiper.updateSlidesOffset(); 4025 var offsetCenter = -translate; 4026 if (rtl) offsetCenter = translate; 4027 4028 // Visible Slides 4029 slides.forEach(function (slideEl) { 4030 slideEl.classList.remove(params.slideVisibleClass); 4031 }); 4032 swiper.visibleSlidesIndexes = []; 4033 swiper.visibleSlides = []; 4034 var spaceBetween = params.spaceBetween; 4035 if (typeof spaceBetween === 'string' && spaceBetween.indexOf('%') >= 0) { 4036 spaceBetween = parseFloat(spaceBetween.replace('%', '')) / 100 * swiper.size; 4037 } else if (typeof spaceBetween === 'string') { 4038 spaceBetween = parseFloat(spaceBetween); 4039 } 4040 for (var i = 0; i < slides.length; i += 1) { 4041 var slide = slides[i]; 4042 var slideOffset = slide.swiperSlideOffset; 4043 if (params.cssMode && params.centeredSlides) { 4044 slideOffset -= slides[0].swiperSlideOffset; 4045 } 4046 var slideProgress = (offsetCenter + (params.centeredSlides ? swiper.minTranslate() : 0) - slideOffset) / (slide.swiperSlideSize + spaceBetween); 4047 var originalSlideProgress = (offsetCenter - snapGrid[0] + (params.centeredSlides ? swiper.minTranslate() : 0) - slideOffset) / (slide.swiperSlideSize + spaceBetween); 4048 var slideBefore = -(offsetCenter - slideOffset); 4049 var slideAfter = slideBefore + swiper.slidesSizesGrid[i]; 4050 var isVisible = slideBefore >= 0 && slideBefore < swiper.size - 1 || slideAfter > 1 && slideAfter <= swiper.size || slideBefore <= 0 && slideAfter >= swiper.size; 4051 if (isVisible) { 4052 swiper.visibleSlides.push(slide); 4053 swiper.visibleSlidesIndexes.push(i); 4054 slides[i].classList.add(params.slideVisibleClass); 4055 } 4056 slide.progress = rtl ? -slideProgress : slideProgress; 4057 slide.originalProgress = rtl ? -originalSlideProgress : originalSlideProgress; 4058 } 4059} 4060 4061},{}],59:[function(require,module,exports){ 4062"use strict"; 4063 4064Object.defineProperty(exports, "__esModule", { 4065 value: true 4066}); 4067exports["default"] = A11y; 4068var _classesToSelector = _interopRequireDefault(require("../../shared/classes-to-selector.js")); 4069var _utils = require("../../shared/utils.js"); 4070function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } 4071function A11y(_ref) { 4072 var swiper = _ref.swiper, 4073 extendParams = _ref.extendParams, 4074 on = _ref.on; 4075 extendParams({ 4076 a11y: { 4077 enabled: true, 4078 notificationClass: 'swiper-notification', 4079 prevSlideMessage: 'Previous slide', 4080 nextSlideMessage: 'Next slide', 4081 firstSlideMessage: 'This is the first slide', 4082 lastSlideMessage: 'This is the last slide', 4083 paginationBulletMessage: 'Go to slide {{index}}', 4084 slideLabelMessage: '{{index}} / {{slidesLength}}', 4085 containerMessage: null, 4086 containerRoleDescriptionMessage: null, 4087 itemRoleDescriptionMessage: null, 4088 slideRole: 'group', 4089 id: null 4090 } 4091 }); 4092 swiper.a11y = { 4093 clicked: false 4094 }; 4095 var liveRegion = null; 4096 function notify(message) { 4097 var notification = liveRegion; 4098 if (notification.length === 0) return; 4099 notification.innerHTML = ''; 4100 notification.innerHTML = message; 4101 } 4102 var makeElementsArray = function makeElementsArray(el) { 4103 if (!Array.isArray(el)) el = [el].filter(function (e) { 4104 return !!e; 4105 }); 4106 return el; 4107 }; 4108 function getRandomNumber() { 4109 var size = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 16; 4110 var randomChar = function randomChar() { 4111 return Math.round(16 * Math.random()).toString(16); 4112 }; 4113 return 'x'.repeat(size).replace(/x/g, randomChar); 4114 } 4115 function makeElFocusable(el) { 4116 el = makeElementsArray(el); 4117 el.forEach(function (subEl) { 4118 subEl.setAttribute('tabIndex', '0'); 4119 }); 4120 } 4121 function makeElNotFocusable(el) { 4122 el = makeElementsArray(el); 4123 el.forEach(function (subEl) { 4124 subEl.setAttribute('tabIndex', '-1'); 4125 }); 4126 } 4127 function addElRole(el, role) { 4128 el = makeElementsArray(el); 4129 el.forEach(function (subEl) { 4130 subEl.setAttribute('role', role); 4131 }); 4132 } 4133 function addElRoleDescription(el, description) { 4134 el = makeElementsArray(el); 4135 el.forEach(function (subEl) { 4136 subEl.setAttribute('aria-roledescription', description); 4137 }); 4138 } 4139 function addElControls(el, controls) { 4140 el = makeElementsArray(el); 4141 el.forEach(function (subEl) { 4142 subEl.setAttribute('aria-controls', controls); 4143 }); 4144 } 4145 function addElLabel(el, label) { 4146 el = makeElementsArray(el); 4147 el.forEach(function (subEl) { 4148 subEl.setAttribute('aria-label', label); 4149 }); 4150 } 4151 function addElId(el, id) { 4152 el = makeElementsArray(el); 4153 el.forEach(function (subEl) { 4154 subEl.setAttribute('id', id); 4155 }); 4156 } 4157 function addElLive(el, live) { 4158 el = makeElementsArray(el); 4159 el.forEach(function (subEl) { 4160 subEl.setAttribute('aria-live', live); 4161 }); 4162 } 4163 function disableEl(el) { 4164 el = makeElementsArray(el); 4165 el.forEach(function (subEl) { 4166 subEl.setAttribute('aria-disabled', true); 4167 }); 4168 } 4169 function enableEl(el) { 4170 el = makeElementsArray(el); 4171 el.forEach(function (subEl) { 4172 subEl.setAttribute('aria-disabled', false); 4173 }); 4174 } 4175 function onEnterOrSpaceKey(e) { 4176 if (e.keyCode !== 13 && e.keyCode !== 32) return; 4177 var params = swiper.params.a11y; 4178 var targetEl = e.target; 4179 if (swiper.pagination && swiper.pagination.el && (targetEl === swiper.pagination.el || swiper.pagination.el.contains(e.target))) { 4180 if (!e.target.matches((0, _classesToSelector["default"])(swiper.params.pagination.bulletClass))) return; 4181 } 4182 if (swiper.navigation && swiper.navigation.nextEl && targetEl === swiper.navigation.nextEl) { 4183 if (!(swiper.isEnd && !swiper.params.loop)) { 4184 swiper.slideNext(); 4185 } 4186 if (swiper.isEnd) { 4187 notify(params.lastSlideMessage); 4188 } else { 4189 notify(params.nextSlideMessage); 4190 } 4191 } 4192 if (swiper.navigation && swiper.navigation.prevEl && targetEl === swiper.navigation.prevEl) { 4193 if (!(swiper.isBeginning && !swiper.params.loop)) { 4194 swiper.slidePrev(); 4195 } 4196 if (swiper.isBeginning) { 4197 notify(params.firstSlideMessage); 4198 } else { 4199 notify(params.prevSlideMessage); 4200 } 4201 } 4202 if (swiper.pagination && targetEl.matches((0, _classesToSelector["default"])(swiper.params.pagination.bulletClass))) { 4203 targetEl.click(); 4204 } 4205 } 4206 function updateNavigation() { 4207 if (swiper.params.loop || swiper.params.rewind || !swiper.navigation) return; 4208 var _swiper$navigation = swiper.navigation, 4209 nextEl = _swiper$navigation.nextEl, 4210 prevEl = _swiper$navigation.prevEl; 4211 if (prevEl) { 4212 if (swiper.isBeginning) { 4213 disableEl(prevEl); 4214 makeElNotFocusable(prevEl); 4215 } else { 4216 enableEl(prevEl); 4217 makeElFocusable(prevEl); 4218 } 4219 } 4220 if (nextEl) { 4221 if (swiper.isEnd) { 4222 disableEl(nextEl); 4223 makeElNotFocusable(nextEl); 4224 } else { 4225 enableEl(nextEl); 4226 makeElFocusable(nextEl); 4227 } 4228 } 4229 } 4230 function hasPagination() { 4231 return swiper.pagination && swiper.pagination.bullets && swiper.pagination.bullets.length; 4232 } 4233 function hasClickablePagination() { 4234 return hasPagination() && swiper.params.pagination.clickable; 4235 } 4236 function updatePagination() { 4237 var params = swiper.params.a11y; 4238 if (!hasPagination()) return;
4239 swiper.pagination.bullets.forEach(function (bulletEl) { 4240 if (swiper.params.pagination.clickable) { 4241 makeElFocusable(bulletEl); 4242 if (!swiper.params.pagination.renderBullet) { 4243 addElRole(bulletEl, 'button'); 4244 addElLabel(bulletEl, params.paginationBulletMessage.replace(/\{\{index\}\}/, (0, _utils.elementIndex)(bulletEl) + 1)); 4245 } 4246 } 4247 if (bulletEl.matches((0, _classesToSelector["default"])(swiper.params.pagination.bulletActiveClass))) { 4248 bulletEl.setAttribute('aria-current', 'true'); 4249 } else { 4250 bulletEl.removeAttribute('aria-current'); 4251 } 4252 }); 4253 } 4254 var initNavEl = function initNavEl(el, wrapperId, message) { 4255 makeElFocusable(el); 4256 if (el.tagName !== 'BUTTON') { 4257 addElRole(el, 'button'); 4258 el.addEventListener('keydown', onEnterOrSpaceKey); 4259 } 4260 addElLabel(el, message); 4261 addElControls(el, wrapperId); 4262 }; 4263 var handlePointerDown = function handlePointerDown() { 4264 swiper.a11y.clicked = true; 4265 }; 4266 var handlePointerUp = function handlePointerUp() { 4267 requestAnimationFrame(function () { 4268 requestAnimationFrame(function () { 4269 if (!swiper.destroyed) { 4270 swiper.a11y.clicked = false; 4271 } 4272 }); 4273 }); 4274 }; 4275 var handleFocus = function handleFocus(e) { 4276 if (swiper.a11y.clicked) return; 4277 var slideEl = e.target.closest(".".concat(swiper.params.slideClass, ", swiper-slide")); 4278 if (!slideEl || !swiper.slides.includes(slideEl)) return; 4279 var isActive = swiper.slides.indexOf(slideEl) === swiper.activeIndex; 4280 var isVisible = swiper.params.watchSlidesProgress && swiper.visibleSlides && swiper.visibleSlides.includes(slideEl); 4281 if (isActive || isVisible) return; 4282 if (e.sourceCapabilities && e.sourceCapabilities.firesTouchEvents) return; 4283 if (swiper.isHorizontal()) { 4284 swiper.el.scrollLeft = 0; 4285 } else { 4286 swiper.el.scrollTop = 0; 4287 } 4288 swiper.slideTo(swiper.slides.indexOf(slideEl), 0); 4289 }; 4290 var initSlides = function initSlides() { 4291 var params = swiper.params.a11y; 4292 if (params.itemRoleDescriptionMessage) { 4293 addElRoleDescription(swiper.slides, params.itemRoleDescriptionMessage); 4294 } 4295 if (params.slideRole) { 4296 addElRole(swiper.slides, params.slideRole); 4297 } 4298 var slidesLength = swiper.slides.length; 4299 if (params.slideLabelMessage) { 4300 swiper.slides.forEach(function (slideEl, index) { 4301 var slideIndex = swiper.params.loop ? parseInt(slideEl.getAttribute('data-swiper-slide-index'), 10) : index; 4302 var ariaLabelMessage = params.slideLabelMessage.replace(/\{\{index\}\}/, slideIndex + 1).replace(/\{\{slidesLength\}\}/, slidesLength); 4303 addElLabel(slideEl, ariaLabelMessage); 4304 }); 4305 } 4306 }; 4307 var init = function init() { 4308 var params = swiper.params.a11y; 4309 if (swiper.isElement) { 4310 swiper.el.shadowEl.append(liveRegion); 4311 } else { 4312 swiper.el.append(liveRegion); 4313 } 4314 4315 // Container 4316 var containerEl = swiper.el; 4317 if (params.containerRoleDescriptionMessage) { 4318 addElRoleDescription(containerEl, params.containerRoleDescriptionMessage); 4319 } 4320 if (params.containerMessage) { 4321 addElLabel(containerEl, params.containerMessage); 4322 } 4323 4324 // Wrapper 4325 var wrapperEl = swiper.wrapperEl; 4326 var wrapperId = params.id || wrapperEl.getAttribute('id') || "swiper-wrapper-".concat(getRandomNumber(16)); 4327 var live = swiper.params.autoplay && swiper.params.autoplay.enabled ? 'off' : 'polite'; 4328 addElId(wrapperEl, wrapperId); 4329 addElLive(wrapperEl, live); 4330 4331 // Slide 4332 initSlides(); 4333 4334 // Navigation 4335 var _ref2 = swiper.navigation ? swiper.navigation : {}, 4336 nextEl = _ref2.nextEl, 4337 prevEl = _ref2.prevEl; 4338 nextEl = makeElementsArray(nextEl); 4339 prevEl = makeElementsArray(prevEl); 4340 if (nextEl) { 4341 nextEl.forEach(function (el) { 4342 return initNavEl(el, wrapperId, params.nextSlideMessage); 4343 }); 4344 } 4345 if (prevEl) { 4346 prevEl.forEach(function (el) { 4347 return initNavEl(el, wrapperId, params.prevSlideMessage); 4348 }); 4349 } 4350 4351 // Pagination 4352 if (hasClickablePagination()) { 4353 var paginationEl = Array.isArray(swiper.pagination.el) ? swiper.pagination.el : [swiper.pagination.el]; 4354 paginationEl.forEach(function (el) { 4355 el.addEventListener('keydown', onEnterOrSpaceKey); 4356 }); 4357 } 4358 4359 // Tab focus 4360 swiper.el.addEventListener('focus', handleFocus, true); 4361 swiper.el.addEventListener('pointerdown', handlePointerDown, true); 4362 swiper.el.addEventListener('pointerup', handlePointerUp, true); 4363 }; 4364 function destroy() { 4365 if (liveRegion) liveRegion.remove(); 4366 var _ref3 = swiper.navigation ? swiper.navigation : {}, 4367 nextEl = _ref3.nextEl, 4368 prevEl = _ref3.prevEl; 4369 nextEl = makeElementsArray(nextEl); 4370 prevEl = makeElementsArray(prevEl); 4371 if (nextEl) { 4372 nextEl.forEach(function (el) { 4373 return el.removeEventListener('keydown', onEnterOrSpaceKey); 4374 }); 4375 } 4376 if (prevEl) { 4377 prevEl.forEach(function (el) { 4378 return el.removeEventListener('keydown', onEnterOrSpaceKey); 4379 }); 4380 } 4381 4382 // Pagination 4383 if (hasClickablePagination()) { 4384 var paginationEl = Array.isArray(swiper.pagination.el) ? swiper.pagination.el : [swiper.pagination.el]; 4385 paginationEl.forEach(function (el) { 4386 el.removeEventListener('keydown', onEnterOrSpaceKey); 4387 }); 4388 } 4389 4390 // Tab focus 4391 swiper.el.removeEventListener('focus', handleFocus, true); 4392 swiper.el.removeEventListener('pointerdown', handlePointerDown, true); 4393 swiper.el.removeEventListener('pointerup', handlePointerUp, true); 4394 } 4395 on('beforeInit', function () { 4396 liveRegion = (0, _utils.createElement)('span', swiper.params.a11y.notificationClass); 4397 liveRegion.setAttribute('aria-live', 'assertive'); 4398 liveRegion.setAttribute('aria-atomic', 'true'); 4399 }); 4400 on('afterInit', function () { 4401 if (!swiper.params.a11y.enabled) return; 4402 init(); 4403 }); 4404 on('slidesLengthChange snapGridLengthChange slidesGridLengthChange', function () { 4405 if (!swiper.params.a11y.enabled) return; 4406 initSlides(); 4407 }); 4408 on('fromEdge toEdge afterInit lock unlock', function () { 4409 if (!swiper.params.a11y.enabled) return; 4410 updateNavigation(); 4411 }); 4412 on('paginationUpdate', function () { 4413 if (!swiper.params.a11y.enabled) return; 4414 updatePagination(); 4415 }); 4416 on('destroy', function () { 4417 if (!swiper.params.a11y.enabled) return; 4418 destroy(); 4419 }); 4420} 4421 4422},{"../../shared/classes-to-selector.js":87,"../../shared/utils.js":97}],60:[function(require,module,exports){ 4423"use strict"; 4424 4425Object.defineProperty(exports, "__esModule", { 4426 value: true 4427}); 4428exports["default"] = Autoplay; 4429var _ssrWindow = require("ssr-window"); 4430/* eslint no-underscore-dangle: "off" */
4431/* eslint no-use-before-define: "off" */ 4432 4433function Autoplay(_ref) { 4434 var swiper = _ref.swiper, 4435 extendParams = _ref.extendParams, 4436 on = _ref.on, 4437 emit = _ref.emit, 4438 params = _ref.params; 4439 swiper.autoplay = { 4440 running: false, 4441 paused: false, 4442 timeLeft: 0 4443 }; 4444 extendParams({ 4445 autoplay: { 4446 enabled: false, 4447 delay: 3000, 4448 waitForTransition: true, 4449 disableOnInteraction: true, 4450 stopOnLastSlide: false, 4451 reverseDirection: false, 4452 pauseOnMouseEnter: false 4453 } 4454 }); 4455 var timeout; 4456 var raf; 4457 var autoplayDelayTotal = params && params.autoplay ? params.autoplay.delay : 3000; 4458 var autoplayDelayCurrent = params && params.autoplay ? params.autoplay.delay : 3000; 4459 var autoplayTimeLeft; 4460 var autoplayStartTime = new Date().getTime; 4461 var wasPaused; 4462 var isTouched; 4463 var pausedByTouch; 4464 var touchStartTimeout; 4465 var slideChanged; 4466 var pausedByInteraction; 4467 function onTransitionEnd(e) { 4468 if (!swiper || swiper.destroyed || !swiper.wrapperEl) return; 4469 if (e.target !== swiper.wrapperEl) return; 4470 swiper.wrapperEl.removeEventListener('transitionend', onTransitionEnd); 4471 resume(); 4472 } 4473 var calcTimeLeft = function calcTimeLeft() { 4474 if (swiper.destroyed || !swiper.autoplay.running) return; 4475 if (swiper.autoplay.paused) { 4476 wasPaused = true; 4477 } else if (wasPaused) { 4478 autoplayDelayCurrent = autoplayTimeLeft; 4479 wasPaused = false; 4480 } 4481 var timeLeft = swiper.autoplay.paused ? autoplayTimeLeft : autoplayStartTime + autoplayDelayCurrent - new Date().getTime(); 4482 swiper.autoplay.timeLeft = timeLeft; 4483 emit('autoplayTimeLeft', timeLeft, timeLeft / autoplayDelayTotal); 4484 raf = requestAnimationFrame(function () { 4485 calcTimeLeft(); 4486 }); 4487 }; 4488 var getSlideDelay = function getSlideDelay() { 4489 var activeSlideEl; 4490 if (swiper.virtual && swiper.params.virtual.enabled) { 4491 activeSlideEl = swiper.slides.filter(function (slideEl) { 4492 return slideEl.classList.contains('swiper-slide-active'); 4493 })[0]; 4494 } else { 4495 activeSlideEl = swiper.slides[swiper.activeIndex]; 4496 } 4497 if (!activeSlideEl) return undefined; 4498 var currentSlideDelay = parseInt(activeSlideEl.getAttribute('data-swiper-autoplay'), 10); 4499 return currentSlideDelay; 4500 }; 4501 var run = function run(delayForce) { 4502 if (swiper.destroyed || !swiper.autoplay.running) return; 4503 cancelAnimationFrame(raf); 4504 calcTimeLeft(); 4505 var delay = typeof delayForce === 'undefined' ? swiper.params.autoplay.delay : delayForce; 4506 autoplayDelayTotal = swiper.params.autoplay.delay; 4507 autoplayDelayCurrent = swiper.params.autoplay.delay; 4508 var currentSlideDelay = getSlideDelay(); 4509 if (!Number.isNaN(currentSlideDelay) && currentSlideDelay > 0 && typeof delayForce === 'undefined') { 4510 delay = currentSlideDelay; 4511 autoplayDelayTotal = currentSlideDelay; 4512 autoplayDelayCurrent = currentSlideDelay; 4513 } 4514 autoplayTimeLeft = delay; 4515 var speed = swiper.params.speed; 4516 var proceed = function proceed() { 4517 if (!swiper || swiper.destroyed) return; 4518 if (swiper.params.autoplay.reverseDirection) { 4519 if (!swiper.isBeginning || swiper.params.loop || swiper.params.rewind) { 4520 swiper.slidePrev(speed, true, true); 4521 emit('autoplay'); 4522 } else if (!swiper.params.autoplay.stopOnLastSlide) { 4523 swiper.slideTo(swiper.slides.length - 1, speed, true, true); 4524 emit('autoplay'); 4525 } 4526 } else { 4527 if (!swiper.isEnd || swiper.params.loop || swiper.params.rewind) { 4528 swiper.slideNext(speed, true, true); 4529 emit('autoplay'); 4530 } else if (!swiper.params.autoplay.stopOnLastSlide) { 4531 swiper.slideTo(0, speed, true, true); 4532 emit('autoplay'); 4533 } 4534 } 4535 if (swiper.params.cssMode) { 4536 autoplayStartTime = new Date().getTime(); 4537 requestAnimationFrame(function () { 4538 run(); 4539 }); 4540 } 4541 }; 4542 if (delay > 0) { 4543 clearTimeout(timeout); 4544 timeout = setTimeout(function () { 4545 proceed(); 4546 }, delay); 4547 } else { 4548 requestAnimationFrame(function () { 4549 proceed(); 4550 }); 4551 } 4552 4553 // eslint-disable-next-line 4554 return delay; 4555 }; 4556 var start = function start() { 4557 swiper.autoplay.running = true; 4558 run(); 4559 emit('autoplayStart'); 4560 }; 4561 var stop = function stop() { 4562 swiper.autoplay.running = false;
4563 clearTimeout(timeout); 4564 cancelAnimationFrame(raf); 4565 emit('autoplayStop'); 4566 }; 4567 var pause = function pause(internal, reset) { 4568 if (swiper.destroyed || !swiper.autoplay.running) return; 4569 clearTimeout(timeout); 4570 if (!internal) { 4571 pausedByInteraction = true; 4572 } 4573 var proceed = function proceed() { 4574 emit('autoplayPause'); 4575 if (swiper.params.autoplay.waitForTransition) { 4576 swiper.wrapperEl.addEventListener('transitionend', onTransitionEnd); 4577 } else { 4578 resume(); 4579 } 4580 }; 4581 swiper.autoplay.paused = true; 4582 if (reset) { 4583 if (slideChanged) { 4584 autoplayTimeLeft = swiper.params.autoplay.delay; 4585 } 4586 slideChanged = false; 4587 proceed(); 4588 return; 4589 } 4590 var delay = autoplayTimeLeft || swiper.params.autoplay.delay; 4591 autoplayTimeLeft = delay - (new Date().getTime() - autoplayStartTime); 4592 if (swiper.isEnd && autoplayTimeLeft < 0 && !swiper.params.loop) return; 4593 if (autoplayTimeLeft < 0) autoplayTimeLeft = 0; 4594 proceed(); 4595 }; 4596 var resume = function resume() { 4597 if (swiper.isEnd && autoplayTimeLeft < 0 && !swiper.params.loop || swiper.destroyed || !swiper.autoplay.running) return; 4598 autoplayStartTime = new Date().getTime(); 4599 if (pausedByInteraction) { 4600 pausedByInteraction = false; 4601 run(autoplayTimeLeft); 4602 } else { 4603 run(); 4604 } 4605 swiper.autoplay.paused = false; 4606 emit('autoplayResume'); 4607 }; 4608 var onVisibilityChange = function onVisibilityChange() { 4609 if (swiper.destroyed || !swiper.autoplay.running) return; 4610 var document = (0, _ssrWindow.getDocument)(); 4611 if (document.visibilityState === 'hidden') { 4612 pausedByInteraction = true; 4613 pause(true); 4614 } 4615 if (document.visibilityState === 'visible') { 4616 resume(); 4617 } 4618 }; 4619 var onPointerEnter = function onPointerEnter(e) { 4620 if (e.pointerType !== 'mouse') return; 4621 pausedByInteraction = true; 4622 pause(true); 4623 }; 4624 var onPointerLeave = function onPointerLeave(e) { 4625 if (e.pointerType !== 'mouse') return; 4626 if (swiper.autoplay.paused) { 4627 resume(); 4628 } 4629 }; 4630 var attachMouseEvents = function attachMouseEvents() { 4631 if (swiper.params.autoplay.pauseOnMouseEnter) { 4632 swiper.el.addEventListener('pointerenter', onPointerEnter); 4633 swiper.el.addEventListener('pointerleave', onPointerLeave); 4634 } 4635 }; 4636 var detachMouseEvents = function detachMouseEvents() { 4637 swiper.el.removeEventListener('pointerenter', onPointerEnter); 4638 swiper.el.removeEventListener('pointerleave', onPointerLeave); 4639 }; 4640 var attachDocumentEvents = function attachDocumentEvents() { 4641 var document = (0, _ssrWindow.getDocument)(); 4642 document.addEventListener('visibilitychange', onVisibilityChange); 4643 }; 4644 var detachDocumentEvents = function detachDocumentEvents() { 4645 var document = (0, _ssrWindow.getDocument)(); 4646 document.removeEventListener('visibilitychange', onVisibilityChange); 4647 }; 4648 on('init', function () { 4649 if (swiper.params.autoplay.enabled) { 4650 attachMouseEvents(); 4651 attachDocumentEvents(); 4652 autoplayStartTime = new Date().getTime(); 4653 start(); 4654 } 4655 }); 4656 on('destroy', function () { 4657 detachMouseEvents(); 4658 detachDocumentEvents(); 4659 if (swiper.autoplay.running) { 4660 stop(); 4661 } 4662 }); 4663 on('beforeTransitionStart', function (_s, speed, internal) { 4664 if (swiper.destroyed || !swiper.autoplay.running) return; 4665 if (internal || !swiper.params.autoplay.disableOnInteraction) { 4666 pause(true, true); 4667 } else { 4668 stop(); 4669 } 4670 }); 4671 on('sliderFirstMove', function () { 4672 if (swiper.destroyed || !swiper.autoplay.running) return; 4673 if (swiper.params.autoplay.disableOnInteraction) { 4674 stop(); 4675 return; 4676 } 4677 isTouched = true; 4678 pausedByTouch = false; 4679 pausedByInteraction = false; 4680 touchStartTimeout = setTimeout(function () { 4681 pausedByInteraction = true; 4682 pausedByTouch = true; 4683 pause(true); 4684 }, 200); 4685 }); 4686 on('touchEnd', function () { 4687 if (swiper.destroyed || !swiper.autoplay.running || !isTouched) return; 4688 clearTimeout(touchStartTimeout); 4689 clearTimeout(timeout); 4690 if (swiper.params.autoplay.disableOnInteraction) { 4691 pausedByTouch = false;
4692 isTouched = false; 4693 return; 4694 } 4695 if (pausedByTouch && swiper.params.cssMode) resume(); 4696 pausedByTouch = false; 4697 isTouched = false; 4698 }); 4699 on('slideChange', function () { 4700 if (swiper.destroyed || !swiper.autoplay.running) return; 4701 slideChanged = true; 4702 }); 4703 Object.assign(swiper.autoplay, { 4704 start: start, 4705 stop: stop, 4706 pause: pause, 4707 resume: resume 4708 }); 4709} 4710 4711},{"ssr-window":1}],61:[function(require,module,exports){ 4712"use strict"; 4713 4714Object.defineProperty(exports, "__esModule", { 4715 value: true 4716}); 4717exports["default"] = Controller; 4718var _utils = require("../../shared/utils.js"); 4719/* eslint no-bitwise: ["error", { "allow": [">>"] }] */ 4720 4721function Controller(_ref) { 4722 var swiper = _ref.swiper, 4723 extendParams = _ref.extendParams, 4724 on = _ref.on; 4725 extendParams({ 4726 controller: { 4727 control: undefined, 4728 inverse: false, 4729 by: 'slide' // or 'container' 4730 } 4731 }); 4732 4733 swiper.controller = { 4734 control: undefined 4735 }; 4736 function LinearSpline(x, y) { 4737 var binarySearch = function search() { 4738 var maxIndex; 4739 var minIndex; 4740 var guess; 4741 return function (array, val) { 4742 minIndex = -1; 4743 maxIndex = array.length; 4744 while (maxIndex - minIndex > 1) { 4745 guess = maxIndex + minIndex >> 1; 4746 if (array[guess] <= val) { 4747 minIndex = guess; 4748 } else { 4749 maxIndex = guess; 4750 } 4751 } 4752 return maxIndex; 4753 }; 4754 }(); 4755 this.x = x; 4756 this.y = y; 4757 this.lastIndex = x.length - 1; 4758 // Given an x value (x2), return the expected y2 value: 4759 // (x1,y1) is the known point before given value, 4760 // (x3,y3) is the known point after given value. 4761 var i1; 4762 var i3; 4763 this.interpolate = function interpolate(x2) { 4764 if (!x2) return 0; 4765 4766 // Get the indexes of x1 and x3 (the array indexes before and after given x2): 4767 i3 = binarySearch(this.x, x2); 4768 i1 = i3 - 1; 4769 4770 // We have our indexes i1 & i3, so we can calculate already: 4771 // y2 := ((x2−x1) × (y3−y1)) ÷ (x3−x1) + y1 4772 return (x2 - this.x[i1]) * (this.y[i3] - this.y[i1]) / (this.x[i3] - this.x[i1]) + this.y[i1]; 4773 }; 4774 return this; 4775 } 4776 function getInterpolateFunction(c) { 4777 swiper.controller.spline = swiper.params.loop ? new LinearSpline(swiper.slidesGrid, c.slidesGrid) : new LinearSpline(swiper.snapGrid, c.snapGrid); 4778 } 4779 function setTranslate(_t, byController) { 4780 var controlled = swiper.controller.control; 4781 var multiplier; 4782 var controlledTranslate; 4783 var Swiper = swiper.constructor; 4784 function setControlledTranslate(c) { 4785 if (c.destroyed) return; 4786 4787 // this will create an Interpolate function based on the snapGrids 4788 // x is the Grid of the scrolled scroller and y will be the controlled scroller 4789 // it makes sense to create this only once and recall it for the interpolation 4790 // the function does a lot of value caching for performance 4791 var translate = swiper.rtlTranslate ? -swiper.translate : swiper.translate; 4792 if (swiper.params.controller.by === 'slide') { 4793 getInterpolateFunction(c); 4794 // i am not sure why the values have to be multiplicated this way, tried to invert the snapGrid 4795 // but it did not work out 4796 controlledTranslate = -swiper.controller.spline.interpolate(-translate); 4797 } 4798 if (!controlledTranslate || swiper.params.controller.by === 'container') { 4799 multiplier = (c.maxTranslate() - c.minTranslate()) / (swiper.maxTranslate() - swiper.minTranslate()); 4800 if (Number.isNaN(multiplier) || !Number.isFinite(multiplier)) { 4801 multiplier = 1; 4802 } 4803 controlledTranslate = (translate - swiper.minTranslate()) * multiplier + c.minTranslate(); 4804 } 4805 if (swiper.params.controller.inverse) { 4806 controlledTranslate = c.maxTranslate() - controlledTranslate; 4807 } 4808 c.updateProgress(controlledTranslate); 4809 c.setTranslate(controlledTranslate, swiper); 4810 c.updateActiveIndex(); 4811 c.updateSlidesClasses(); 4812 } 4813 if (Array.isArray(controlled)) { 4814 for (var i = 0; i < controlled.length; i += 1) { 4815 if (controlled[i] !== byController && controlled[i] instanceof Swiper) { 4816 setControlledTranslate(controlled[i]); 4817 } 4818 } 4819 } else if (controlled instanceof Swiper && byController !== controlled) { 4820 setControlledTranslate(controlled); 4821 } 4822 } 4823 function setTransition(duration, byController) { 4824 var Swiper = swiper.constructor; 4825 var controlled = swiper.controller.control; 4826 var i; 4827 function setControlledTransition(c) { 4828 if (c.destroyed) return; 4829 c.setTransition(duration, swiper); 4830 if (duration !== 0) { 4831 c.transitionStart(); 4832 if (c.params.autoHeight) { 4833 (0, _utils.nextTick)(function () { 4834 c.updateAutoHeight(); 4835 }); 4836 } 4837 (0, _utils.elementTransitionEnd)(c.wrapperEl, function () { 4838 if (!controlled) return; 4839 c.transitionEnd(); 4840 }); 4841 } 4842 } 4843 if (Array.isArray(controlled)) { 4844 for (i = 0; i < controlled.length; i += 1) { 4845 if (controlled[i] !== byController && controlled[i] instanceof Swiper) { 4846 setControlledTransition(controlled[i]); 4847 } 4848 } 4849 } else if (controlled instanceof Swiper && byController !== controlled) { 4850 setControlledTransition(controlled); 4851 } 4852 } 4853 function removeSpline() { 4854 if (!swiper.controller.control) return; 4855 if (swiper.controller.spline) { 4856 swiper.controller.spline = undefined; 4857 delete swiper.controller.spline; 4858 } 4859 } 4860 on('beforeInit', function () { 4861 if (typeof window !== 'undefined' && ( 4862 // eslint-disable-line 4863 typeof swiper.params.controller.control === 'string' || swiper.params.controller.control instanceof HTMLElement)) { 4864 var controlElement = document.querySelector(swiper.params.controller.control); 4865 if (controlElement && controlElement.swiper) { 4866 swiper.controller.control = controlElement.swiper; 4867 } else if (controlElement) { 4868 var onControllerSwiper = function onControllerSwiper(e) { 4869 swiper.controller.control = e.detail[0];
4870 swiper.update(); 4871 controlElement.removeEventListener('init', onControllerSwiper); 4872 }; 4873 controlElement.addEventListener('init', onControllerSwiper); 4874 } 4875 return; 4876 } 4877 swiper.controller.control = swiper.params.controller.control; 4878 }); 4879 on('update', function () { 4880 removeSpline(); 4881 }); 4882 on('resize', function () { 4883 removeSpline(); 4884 }); 4885 on('observerUpdate', function () { 4886 removeSpline(); 4887 }); 4888 on('setTranslate', function (_s, translate, byController) { 4889 if (!swiper.controller.control || swiper.controller.control.destroyed) return; 4890 swiper.controller.setTranslate(translate, byController); 4891 }); 4892 on('setTransition', function (_s, duration, byController) { 4893 if (!swiper.controller.control || swiper.controller.control.destroyed) return; 4894 swiper.controller.setTransition(duration, byController); 4895 }); 4896 Object.assign(swiper.controller, { 4897 setTranslate: setTranslate, 4898 setTransition: setTransition 4899 }); 4900} 4901 4902},{"../../shared/utils.js":97}],62:[function(require,module,exports){ 4903"use strict"; 4904 4905Object.defineProperty(exports, "__esModule", { 4906 value: true 4907}); 4908exports["default"] = EffectCards; 4909var _createShadow = _interopRequireDefault(require("../../shared/create-shadow.js")); 4910var _effectInit = _interopRequireDefault(require("../../shared/effect-init.js")); 4911var _effectTarget = _interopRequireDefault(require("../../shared/effect-target.js")); 4912var _effectVirtualTransitionEnd = _interopRequireDefault(require("../../shared/effect-virtual-transition-end.js")); 4913var _utils = require("../../shared/utils.js"); 4914function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } 4915function EffectCards(_ref) { 4916 var swiper = _ref.swiper, 4917 extendParams = _ref.extendParams, 4918 on = _ref.on; 4919 extendParams({ 4920 cardsEffect: { 4921 slideShadows: true, 4922 rotate: true, 4923 perSlideRotate: 2, 4924 perSlideOffset: 8 4925 } 4926 }); 4927 var setTranslate = function setTranslate() { 4928 var slides = swiper.slides, 4929 activeIndex = swiper.activeIndex; 4930 var params = swiper.params.cardsEffect; 4931 var _swiper$touchEventsDa = swiper.touchEventsData, 4932 startTranslate = _swiper$touchEventsDa.startTranslate, 4933 isTouched = _swiper$touchEventsDa.isTouched; 4934 var currentTranslate = swiper.translate; 4935 for (var i = 0; i < slides.length; i += 1) { 4936 var slideEl = slides[i]; 4937 var slideProgress = slideEl.progress; 4938 var progress = Math.min(Math.max(slideProgress, -4), 4); 4939 var offset = slideEl.swiperSlideOffset; 4940 if (swiper.params.centeredSlides && !swiper.params.cssMode) { 4941 swiper.wrapperEl.style.transform = "translateX(".concat(swiper.minTranslate(), "px)"); 4942 } 4943 if (swiper.params.centeredSlides && swiper.params.cssMode) { 4944 offset -= slides[0].swiperSlideOffset; 4945 } 4946 var tX = swiper.params.cssMode ? -offset - swiper.translate : -offset; 4947 var tY = 0; 4948 var tZ = -100 * Math.abs(progress); 4949 var scale = 1; 4950 var rotate = -params.perSlideRotate * progress; 4951 var tXAdd = params.perSlideOffset - Math.abs(progress) * 0.75; 4952 var slideIndex = swiper.virtual && swiper.params.virtual.enabled ? swiper.virtual.from + i : i; 4953 var isSwipeToNext = (slideIndex === activeIndex || slideIndex === activeIndex - 1) && progress > 0 && progress < 1 && (isTouched || swiper.params.cssMode) && currentTranslate < startTranslate; 4954 var isSwipeToPrev = (slideIndex === activeIndex || slideIndex === activeIndex + 1) && progress < 0 && progress > -1 && (isTouched || swiper.params.cssMode) && currentTranslate > startTranslate; 4955 if (isSwipeToNext || isSwipeToPrev) { 4956 var subProgress = Math.pow(1 - Math.abs((Math.abs(progress) - 0.5) / 0.5), 0.5); 4957 rotate += -28 * progress * subProgress; 4958 scale += -0.5 * subProgress; 4959 tXAdd += 96 * subProgress; 4960 tY = "".concat(-25 * subProgress * Math.abs(progress), "%"); 4961 } 4962 if (progress < 0) { 4963 // next 4964 tX = "calc(".concat(tX, "px + (").concat(tXAdd * Math.abs(progress), "%))"); 4965 } else if (progress > 0) { 4966 // prev 4967 tX = "calc(".concat(tX, "px + (-").concat(tXAdd * Math.abs(progress), "%))"); 4968 } else { 4969 tX = "".concat(tX, "px"); 4970 } 4971 if (!swiper.isHorizontal()) { 4972 var prevY = tY; 4973 tY = tX; 4974 tX = prevY; 4975 }
4976 var scaleString = progress < 0 ? "".concat(1 + (1 - scale) * progress) : "".concat(1 - (1 - scale) * progress); 4977 var transform = "\n translate3d(".concat(tX, ", ").concat(tY, ", ").concat(tZ, "px)\n rotateZ(").concat(params.rotate ? rotate : 0, "deg)\n scale(").concat(scaleString, ")\n "); 4978 if (params.slideShadows) { 4979 // Set shadows 4980 var shadowEl = slideEl.querySelector('.swiper-slide-shadow'); 4981 if (!shadowEl) { 4982 shadowEl = (0, _createShadow["default"])(params, slideEl); 4983 } 4984 if (shadowEl) shadowEl.style.opacity = Math.min(Math.max((Math.abs(progress) - 0.5) / 0.5, 0), 1); 4985 } 4986 slideEl.style.zIndex = -Math.abs(Math.round(slideProgress)) + slides.length; 4987 var targetEl = (0, _effectTarget["default"])(params, slideEl); 4988 targetEl.style.transform = transform; 4989 } 4990 }; 4991 var setTransition = function setTransition(duration) { 4992 var transformElements = swiper.slides.map(function (slideEl) { 4993 return (0, _utils.getSlideTransformEl)(slideEl); 4994 }); 4995 transformElements.forEach(function (el) { 4996 el.style.transitionDuration = "".concat(duration, "ms"); 4997 el.querySelectorAll('.swiper-slide-shadow').forEach(function (shadowEl) { 4998 shadowEl.style.transitionDuration = "".concat(duration, "ms"); 4999 }); 5000 }); 5001 (0, _effectVirtualTransitionEnd["default"])({ 5002 swiper: swiper, 5003 duration: duration, 5004 transformElements: transformElements 5005 }); 5006 }; 5007 (0, _effectInit["default"])({ 5008 effect: 'cards', 5009 swiper: swiper, 5010 on: on, 5011 setTranslate: setTranslate, 5012 setTransition: setTransition, 5013 perspective: function perspective() { 5014 return true; 5015 }, 5016 overwriteParams: function overwriteParams() { 5017 return { 5018 watchSlidesProgress: true, 5019 virtualTranslate: !swiper.params.cssMode 5020 }; 5021 } 5022 }); 5023} 5024 5025},{"../../shared/create-shadow.js":89,"../../shared/effect-init.js":90,"../../shared/effect-target.js":91,"../../shared/effect-virtual-transition-end.js":92,"../../shared/utils.js":97}],63:[function(require,module,exports){ 5026"use strict"; 5027 5028Object.defineProperty(exports, "__esModule", { 5029 value: true 5030}); 5031exports["default"] = EffectCoverflow; 5032var _createShadow = _interopRequireDefault(require("../../shared/create-shadow.js")); 5033var _effectInit = _interopRequireDefault(require("../../shared/effect-init.js")); 5034var _effectTarget = _interopRequireDefault(require("../../shared/effect-target.js")); 5035var _utils = require("../../shared/utils.js"); 5036function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } 5037function EffectCoverflow(_ref) { 5038 var swiper = _ref.swiper, 5039 extendParams = _ref.extendParams, 5040 on = _ref.on; 5041 extendParams({ 5042 coverflowEffect: { 5043 rotate: 50, 5044 stretch: 0, 5045 depth: 100, 5046 scale: 1, 5047 modifier: 1, 5048 slideShadows: true 5049 } 5050 }); 5051 var setTranslate = function setTranslate() { 5052 var swiperWidth = swiper.width, 5053 swiperHeight = swiper.height, 5054 slides = swiper.slides, 5055 slidesSizesGrid = swiper.slidesSizesGrid; 5056 var params = swiper.params.coverflowEffect; 5057 var isHorizontal = swiper.isHorizontal(); 5058 var transform = swiper.translate; 5059 var center = isHorizontal ? -transform + swiperWidth / 2 : -transform + swiperHeight / 2; 5060 var rotate = isHorizontal ? params.rotate : -params.rotate; 5061 var translate = params.depth; 5062 // Each slide offset from center 5063 for (var i = 0, length = slides.length; i < length; i += 1) { 5064 var slideEl = slides[i]; 5065 var slideSize = slidesSizesGrid[i]; 5066 var slideOffset = slideEl.swiperSlideOffset; 5067 var centerOffset = (center - slideOffset - slideSize / 2) / slideSize; 5068 var offsetMultiplier = typeof params.modifier === 'function' ? params.modifier(centerOffset) : centerOffset * params.modifier; 5069 var rotateY = isHorizontal ? rotate * offsetMultiplier : 0; 5070 var rotateX = isHorizontal ? 0 : rotate * offsetMultiplier; 5071 // var rotateZ = 0 5072 var translateZ = -translate * Math.abs(offsetMultiplier); 5073 var stretch = params.stretch; 5074 // Allow percentage to make a relative stretch for responsive sliders 5075 if (typeof stretch === 'string' && stretch.indexOf('%') !== -1) { 5076 stretch = parseFloat(params.stretch) / 100 * slideSize; 5077 } 5078 var translateY = isHorizontal ? 0 : stretch * offsetMultiplier; 5079 var translateX = isHorizontal ? stretch * offsetMultiplier : 0; 5080 var scale = 1 - (1 - params.scale) * Math.abs(offsetMultiplier); 5081 5082 // Fix for ultra small values 5083 if (Math.abs(translateX) < 0.001) translateX = 0; 5084 if (Math.abs(translateY) < 0.001) translateY = 0; 5085 if (Math.abs(translateZ) < 0.001) translateZ = 0; 5086 if (Math.abs(rotateY) < 0.001) rotateY = 0; 5087 if (Math.abs(rotateX) < 0.001) rotateX = 0; 5088 if (Math.abs(scale) < 0.001) scale = 0; 5089 var slideTransform = "translate3d(".concat(translateX, "px,").concat(translateY, "px,").concat(translateZ, "px) rotateX(").concat(rotateX, "deg) rotateY(").concat(rotateY, "deg) scale(").concat(scale, ")"); 5090 var targetEl = (0, _effectTarget["default"])(params, slideEl); 5091 targetEl.style.transform = slideTransform; 5092 slideEl.style.zIndex = -Math.abs(Math.round(offsetMultiplier)) + 1; 5093 if (params.slideShadows) { 5094 // Set shadows 5095 var shadowBeforeEl = isHorizontal ? slideEl.querySelector('.swiper-slide-shadow-left') : slideEl.querySelector('.swiper-slide-shadow-top'); 5096 var shadowAfterEl = isHorizontal ? slideEl.querySelector('.swiper-slide-shadow-right') : slideEl.querySelector('.swiper-slide-shadow-bottom'); 5097 if (!shadowBeforeEl) { 5098 shadowBeforeEl = (0, _createShadow["default"])(params, slideEl, isHorizontal ? 'left' : 'top'); 5099 } 5100 if (!shadowAfterEl) { 5101 shadowAfterEl = (0, _createShadow["default"])(params, slideEl, isHorizontal ? 'right' : 'bottom'); 5102 } 5103 if (shadowBeforeEl) shadowBeforeEl.style.opacity = offsetMultiplier > 0 ? offsetMultiplier : 0; 5104 if (shadowAfterEl) shadowAfterEl.style.opacity = -offsetMultiplier > 0 ? -offsetMultiplier : 0; 5105 } 5106 } 5107 }; 5108 var setTransition = function setTransition(duration) { 5109 var transformElements = swiper.slides.map(function (slideEl) { 5110 return (0, _utils.getSlideTransformEl)(slideEl); 5111 });
5112 transformElements.forEach(function (el) { 5113 el.style.transitionDuration = "".concat(duration, "ms"); 5114 el.querySelectorAll('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left').forEach(function (shadowEl) { 5115 shadowEl.style.transitionDuration = "".concat(duration, "ms"); 5116 }); 5117 }); 5118 }; 5119 (0, _effectInit["default"])({ 5120 effect: 'coverflow', 5121 swiper: swiper, 5122 on: on, 5123 setTranslate: setTranslate, 5124 setTransition: setTransition, 5125 perspective: function perspective() { 5126 return true; 5127 }, 5128 overwriteParams: function overwriteParams() { 5129 return { 5130 watchSlidesProgress: true 5131 }; 5132 } 5133 }); 5134} 5135 5136},{"../../shared/create-shadow.js":89,"../../shared/effect-init.js":90,"../../shared/effect-target.js":91,"../../shared/utils.js":97}],64:[function(require,module,exports){ 5137"use strict"; 5138 5139Object.defineProperty(exports, "__esModule", { 5140 value: true 5141}); 5142exports["default"] = EffectCreative; 5143var _createShadow = _interopRequireDefault(require("../../shared/create-shadow.js")); 5144var _effectInit = _interopRequireDefault(require("../../shared/effect-init.js")); 5145var _effectTarget = _interopRequireDefault(require("../../shared/effect-target.js")); 5146var _effectVirtualTransitionEnd = _interopRequireDefault(require("../../shared/effect-virtual-transition-end.js")); 5147var _utils = require("../../shared/utils.js"); 5148function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } 5149function EffectCreative(_ref) { 5150 var swiper = _ref.swiper, 5151 extendParams = _ref.extendParams, 5152 on = _ref.on; 5153 extendParams({ 5154 creativeEffect: { 5155 limitProgress: 1, 5156 shadowPerProgress: false, 5157 progressMultiplier: 1, 5158 perspective: true, 5159 prev: { 5160 translate: [0, 0, 0], 5161 rotate: [0, 0, 0], 5162 opacity: 1, 5163 scale: 1 5164 }, 5165 next: { 5166 translate: [0, 0, 0], 5167 rotate: [0, 0, 0], 5168 opacity: 1, 5169 scale: 1 5170 } 5171 } 5172 }); 5173 var getTranslateValue = function getTranslateValue(value) { 5174 if (typeof value === 'string') return value; 5175 return "".concat(value, "px"); 5176 }; 5177 var setTranslate = function setTranslate() { 5178 var slides = swiper.slides, 5179 wrapperEl = swiper.wrapperEl, 5180 slidesSizesGrid = swiper.slidesSizesGrid; 5181 var params = swiper.params.creativeEffect; 5182 var multiplier = params.progressMultiplier; 5183 var isCenteredSlides = swiper.params.centeredSlides; 5184 if (isCenteredSlides) { 5185 var margin = slidesSizesGrid[0] / 2 - swiper.params.slidesOffsetBefore || 0; 5186 wrapperEl.style.transform = "translateX(calc(50% - ".concat(margin, "px))"); 5187 } 5188 var _loop = function _loop() { 5189 var slideEl = slides[i]; 5190 var slideProgress = slideEl.progress; 5191 var progress = Math.min(Math.max(slideEl.progress, -params.limitProgress), params.limitProgress); 5192 var originalProgress = progress; 5193 if (!isCenteredSlides) { 5194 originalProgress = Math.min(Math.max(slideEl.originalProgress, -params.limitProgress), params.limitProgress); 5195 } 5196 var offset = slideEl.swiperSlideOffset; 5197 var t = [swiper.params.cssMode ? -offset - swiper.translate : -offset, 0, 0]; 5198 var r = [0, 0, 0]; 5199 var custom = false; 5200 if (!swiper.isHorizontal()) { 5201 t[1] = t[0]; 5202 t[0] = 0; 5203 } 5204 var data = { 5205 translate: [0, 0, 0], 5206 rotate: [0, 0, 0], 5207 scale: 1, 5208 opacity: 1 5209 }; 5210 if (progress < 0) { 5211 data = params.next; 5212 custom = true; 5213 } else if (progress > 0) { 5214 data = params.prev; 5215 custom = true; 5216 } 5217 // set translate 5218 t.forEach(function (value, index) { 5219 t[index] = "calc(".concat(value, "px + (").concat(getTranslateValue(data.translate[index]), " * ").concat(Math.abs(progress * multiplier), "))"); 5220 }); 5221 // set rotates 5222 r.forEach(function (value, index) { 5223 r[index] = data.rotate[index] * Math.abs(progress * multiplier); 5224 }); 5225 slideEl.style.zIndex = -Math.abs(Math.round(slideProgress)) + slides.length; 5226 var translateString = t.join(', '); 5227 var rotateString = "rotateX(".concat(r[0], "deg) rotateY(").concat(r[1], "deg) rotateZ(").concat(r[2], "deg)");
5228 var scaleString = originalProgress < 0 ? "scale(".concat(1 + (1 - data.scale) * originalProgress * multiplier, ")") : "scale(".concat(1 - (1 - data.scale) * originalProgress * multiplier, ")"); 5229 var opacityString = originalProgress < 0 ? 1 + (1 - data.opacity) * originalProgress * multiplier : 1 - (1 - data.opacity) * originalProgress * multiplier; 5230 var transform = "translate3d(".concat(translateString, ") ").concat(rotateString, " ").concat(scaleString); 5231 5232 // Set shadows 5233 if (custom && data.shadow || !custom) { 5234 var shadowEl = slideEl.querySelector('.swiper-slide-shadow'); 5235 if (!shadowEl && data.shadow) { 5236 shadowEl = (0, _createShadow["default"])(params, slideEl); 5237 } 5238 if (shadowEl) { 5239 var shadowOpacity = params.shadowPerProgress ? progress * (1 / params.limitProgress) : progress; 5240 shadowEl.style.opacity = Math.min(Math.max(Math.abs(shadowOpacity), 0), 1); 5241 } 5242 } 5243 var targetEl = (0, _effectTarget["default"])(params, slideEl); 5244 targetEl.style.transform = transform; 5245 targetEl.style.opacity = opacityString; 5246 if (data.origin) { 5247 targetEl.style.transformOrigin = data.origin; 5248 } 5249 }; 5250 for (var i = 0; i < slides.length; i += 1) { 5251 _loop(); 5252 } 5253 }; 5254 var setTransition = function setTransition(duration) { 5255 var transformElements = swiper.slides.map(function (slideEl) { 5256 return (0, _utils.getSlideTransformEl)(slideEl); 5257 }); 5258 transformElements.forEach(function (el) { 5259 el.style.transitionDuration = "".concat(duration, "ms"); 5260 el.querySelectorAll('.swiper-slide-shadow').forEach(function (shadowEl) { 5261 shadowEl.style.transitionDuration = "".concat(duration, "ms"); 5262 }); 5263 }); 5264 (0, _effectVirtualTransitionEnd["default"])({ 5265 swiper: swiper, 5266 duration: duration, 5267 transformElements: transformElements, 5268 allSlides: true 5269 }); 5270 }; 5271 (0, _effectInit["default"])({ 5272 effect: 'creative', 5273 swiper: swiper, 5274 on: on, 5275 setTranslate: setTranslate, 5276 setTransition: setTransition, 5277 perspective: function perspective() { 5278 return swiper.params.creativeEffect.perspective; 5279 }, 5280 overwriteParams: function overwriteParams() { 5281 return { 5282 watchSlidesProgress: true, 5283 virtualTranslate: !swiper.params.cssMode 5284 }; 5285 } 5286 }); 5287} 5288 5289},{"../../shared/create-shadow.js":89,"../../shared/effect-init.js":90,"../../shared/effect-target.js":91,"../../shared/effect-virtual-transition-end.js":92,"../../shared/utils.js":97}],65:[function(require,module,exports){ 5290"use strict"; 5291 5292Object.defineProperty(exports, "__esModule", { 5293 value: true 5294}); 5295exports["default"] = EffectCube; 5296var _effectInit = _interopRequireDefault(require("../../shared/effect-init.js")); 5297var _utils = require("../../shared/utils.js"); 5298function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } 5299function EffectCube(_ref) { 5300 var swiper = _ref.swiper, 5301 extendParams = _ref.extendParams, 5302 on = _ref.on; 5303 extendParams({ 5304 cubeEffect: { 5305 slideShadows: true, 5306 shadow: true, 5307 shadowOffset: 20, 5308 shadowScale: 0.94 5309 } 5310 }); 5311 var createSlideShadows = function createSlideShadows(slideEl, progress, isHorizontal) { 5312 var shadowBefore = isHorizontal ? slideEl.querySelector('.swiper-slide-shadow-left') : slideEl.querySelector('.swiper-slide-shadow-top'); 5313 var shadowAfter = isHorizontal ? slideEl.querySelector('.swiper-slide-shadow-right') : slideEl.querySelector('.swiper-slide-shadow-bottom'); 5314 if (!shadowBefore) { 5315 shadowBefore = (0, _utils.createElement)('div', "swiper-slide-shadow-".concat(isHorizontal ? 'left' : 'top')); 5316 slideEl.append(shadowBefore); 5317 } 5318 if (!shadowAfter) { 5319 shadowAfter = (0, _utils.createElement)('div', "swiper-slide-shadow-".concat(isHorizontal ? 'right' : 'bottom')); 5320 slideEl.append(shadowAfter); 5321 } 5322 if (shadowBefore) shadowBefore.style.opacity = Math.max(-progress, 0); 5323 if (shadowAfter) shadowAfter.style.opacity = Math.max(progress, 0); 5324 }; 5325 var recreateShadows = function recreateShadows() { 5326 // create new ones 5327 var isHorizontal = swiper.isHorizontal();
5328 swiper.slides.forEach(function (slideEl) { 5329 var progress = Math.max(Math.min(slideEl.progress, 1), -1); 5330 createSlideShadows(slideEl, progress, isHorizontal); 5331 }); 5332 }; 5333 var setTranslate = function setTranslate() { 5334 var el = swiper.el, 5335 wrapperEl = swiper.wrapperEl, 5336 slides = swiper.slides, 5337 swiperWidth = swiper.width, 5338 swiperHeight = swiper.height, 5339 rtl = swiper.rtlTranslate, 5340 swiperSize = swiper.size, 5341 browser = swiper.browser; 5342 var params = swiper.params.cubeEffect; 5343 var isHorizontal = swiper.isHorizontal(); 5344 var isVirtual = swiper.virtual && swiper.params.virtual.enabled; 5345 var wrapperRotate = 0; 5346 var cubeShadowEl; 5347 if (params.shadow) { 5348 if (isHorizontal) { 5349 cubeShadowEl = swiper.slidesEl.querySelector('.swiper-cube-shadow'); 5350 if (!cubeShadowEl) { 5351 cubeShadowEl = (0, _utils.createElement)('div', 'swiper-cube-shadow'); 5352 swiper.slidesEl.append(cubeShadowEl); 5353 } 5354 cubeShadowEl.style.height = "".concat(swiperWidth, "px"); 5355 } else { 5356 cubeShadowEl = el.querySelector('.swiper-cube-shadow'); 5357 if (!cubeShadowEl) { 5358 cubeShadowEl = (0, _utils.createElement)('div', 'swiper-cube-shadow'); 5359 el.append(cubeShadowEl); 5360 } 5361 } 5362 } 5363 for (var i = 0; i < slides.length; i += 1) { 5364 var slideEl = slides[i]; 5365 var slideIndex = i; 5366 if (isVirtual) { 5367 slideIndex = parseInt(slideEl.getAttribute('data-swiper-slide-index'), 10); 5368 } 5369 var slideAngle = slideIndex * 90; 5370 var round = Math.floor(slideAngle / 360); 5371 if (rtl) { 5372 slideAngle = -slideAngle; 5373 round = Math.floor(-slideAngle / 360); 5374 } 5375 var progress = Math.max(Math.min(slideEl.progress, 1), -1); 5376 var tx = 0; 5377 var ty = 0; 5378 var tz = 0; 5379 if (slideIndex % 4 === 0) { 5380 tx = -round * 4 * swiperSize; 5381 tz = 0; 5382 } else if ((slideIndex - 1) % 4 === 0) { 5383 tx = 0; 5384 tz = -round * 4 * swiperSize; 5385 } else if ((slideIndex - 2) % 4 === 0) { 5386 tx = swiperSize + round * 4 * swiperSize; 5387 tz = swiperSize; 5388 } else if ((slideIndex - 3) % 4 === 0) { 5389 tx = -swiperSize; 5390 tz = 3 * swiperSize + swiperSize * 4 * round; 5391 } 5392 if (rtl) { 5393 tx = -tx; 5394 } 5395 if (!isHorizontal) { 5396 ty = tx; 5397 tx = 0; 5398 } 5399 var transform = "rotateX(".concat(isHorizontal ? 0 : -slideAngle, "deg) rotateY(").concat(isHorizontal ? slideAngle : 0, "deg) translate3d(").concat(tx, "px, ").concat(ty, "px, ").concat(tz, "px)"); 5400 if (progress <= 1 && progress > -1) { 5401 wrapperRotate = slideIndex * 90 + progress * 90; 5402 if (rtl) wrapperRotate = -slideIndex * 90 - progress * 90; 5403 } 5404 slideEl.style.transform = transform; 5405 if (params.slideShadows) { 5406 createSlideShadows(slideEl, progress, isHorizontal); 5407 } 5408 } 5409 wrapperEl.style.transformOrigin = "50% 50% -".concat(swiperSize / 2, "px"); 5410 wrapperEl.style['-webkit-transform-origin'] = "50% 50% -".concat(swiperSize / 2, "px"); 5411 if (params.shadow) { 5412 if (isHorizontal) { 5413 cubeShadowEl.style.transform = "translate3d(0px, ".concat(swiperWidth / 2 + params.shadowOffset, "px, ").concat(-swiperWidth / 2, "px) rotateX(90deg) rotateZ(0deg) scale(").concat(params.shadowScale, ")"); 5414 } else { 5415 var shadowAngle = Math.abs(wrapperRotate) - Math.floor(Math.abs(wrapperRotate) / 90) * 90; 5416 var multiplier = 1.5 - (Math.sin(shadowAngle * 2 * Math.PI / 360) / 2 + Math.cos(shadowAngle * 2 * Math.PI / 360) / 2); 5417 var scale1 = params.shadowScale; 5418 var scale2 = params.shadowScale / multiplier; 5419 var offset = params.shadowOffset; 5420 cubeShadowEl.style.transform = "scale3d(".concat(scale1, ", 1, ").concat(scale2, ") translate3d(0px, ").concat(swiperHeight / 2 + offset, "px, ").concat(-swiperHeight / 2 / scale2, "px) rotateX(-90deg)"); 5421 } 5422 } 5423 var zFactor = (browser.isSafari || browser.isWebView) && browser.needPerspectiveFix ? -swiperSize / 2 : 0; 5424 wrapperEl.style.transform = "translate3d(0px,0,".concat(zFactor, "px) rotateX(").concat(swiper.isHorizontal() ? 0 : wrapperRotate, "deg) rotateY(").concat(swiper.isHorizontal() ? -wrapperRotate : 0, "deg)"); 5425 wrapperEl.style.setProperty('--swiper-cube-translate-z', "".concat(zFactor, "px")); 5426 }; 5427 var setTransition = function setTransition(duration) { 5428 var el = swiper.el, 5429 slides = swiper.slides;
5430 slides.forEach(function (slideEl) { 5431 slideEl.style.transitionDuration = "".concat(duration, "ms"); 5432 slideEl.querySelectorAll('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left').forEach(function (subEl) { 5433 subEl.style.transitionDuration = "".concat(duration, "ms"); 5434 }); 5435 }); 5436 if (swiper.params.cubeEffect.shadow && !swiper.isHorizontal()) { 5437 var shadowEl = el.querySelector('.swiper-cube-shadow'); 5438 if (shadowEl) shadowEl.style.transitionDuration = "".concat(duration, "ms"); 5439 } 5440 }; 5441 (0, _effectInit["default"])({ 5442 effect: 'cube', 5443 swiper: swiper, 5444 on: on, 5445 setTranslate: setTranslate, 5446 setTransition: setTransition, 5447 recreateShadows: recreateShadows, 5448 getEffectParams: function getEffectParams() { 5449 return swiper.params.cubeEffect; 5450 }, 5451 perspective: function perspective() { 5452 return true; 5453 }, 5454 overwriteParams: function overwriteParams() { 5455 return { 5456 slidesPerView: 1, 5457 slidesPerGroup: 1, 5458 watchSlidesProgress: true, 5459 resistanceRatio: 0, 5460 spaceBetween: 0, 5461 centeredSlides: false, 5462 virtualTranslate: true 5463 }; 5464 } 5465 }); 5466} 5467 5468},{"../../shared/effect-init.js":90,"../../shared/utils.js":97}],66:[function(require,module,exports){ 5469"use strict"; 5470 5471Object.defineProperty(exports, "__esModule", { 5472 value: true 5473}); 5474exports["default"] = EffectFade; 5475var _effectInit = _interopRequireDefault(require("../../shared/effect-init.js")); 5476var _effectTarget = _interopRequireDefault(require("../../shared/effect-target.js")); 5477var _effectVirtualTransitionEnd = _interopRequireDefault(require("../../shared/effect-virtual-transition-end.js")); 5478var _utils = require("../../shared/utils.js"); 5479function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } 5480function EffectFade(_ref) { 5481 var swiper = _ref.swiper, 5482 extendParams = _ref.extendParams, 5483 on = _ref.on; 5484 extendParams({ 5485 fadeEffect: { 5486 crossFade: false 5487 } 5488 }); 5489 var setTranslate = function setTranslate() { 5490 var slides = swiper.slides; 5491 var params = swiper.params.fadeEffect; 5492 for (var i = 0; i < slides.length; i += 1) { 5493 var slideEl = swiper.slides[i]; 5494 var offset = slideEl.swiperSlideOffset; 5495 var tx = -offset; 5496 if (!swiper.params.virtualTranslate) tx -= swiper.translate; 5497 var ty = 0; 5498 if (!swiper.isHorizontal()) { 5499 ty = tx; 5500 tx = 0; 5501 } 5502 var slideOpacity = swiper.params.fadeEffect.crossFade ? Math.max(1 - Math.abs(slideEl.progress), 0) : 1 + Math.min(Math.max(slideEl.progress, -1), 0); 5503 var targetEl = (0, _effectTarget["default"])(params, slideEl); 5504 targetEl.style.opacity = slideOpacity; 5505 targetEl.style.transform = "translate3d(".concat(tx, "px, ").concat(ty, "px, 0px)"); 5506 } 5507 }; 5508 var setTransition = function setTransition(duration) { 5509 var transformElements = swiper.slides.map(function (slideEl) { 5510 return (0, _utils.getSlideTransformEl)(slideEl); 5511 }); 5512 transformElements.forEach(function (el) { 5513 el.style.transitionDuration = "".concat(duration, "ms"); 5514 }); 5515 (0, _effectVirtualTransitionEnd["default"])({ 5516 swiper: swiper, 5517 duration: duration, 5518 transformElements: transformElements, 5519 allSlides: true 5520 }); 5521 }; 5522 (0, _effectInit["default"])({ 5523 effect: 'fade', 5524 swiper: swiper, 5525 on: on, 5526 setTranslate: setTranslate, 5527 setTransition: setTransition, 5528 overwriteParams: function overwriteParams() { 5529 return { 5530 slidesPerView: 1, 5531 slidesPerGroup: 1, 5532 watchSlidesProgress: true, 5533 spaceBetween: 0, 5534 virtualTranslate: !swiper.params.cssMode 5535 }; 5536 } 5537 }); 5538} 5539 5540},{"../../shared/effect-init.js":90,"../../shared/effect-target.js":91,"../../shared/effect-virtual-transition-end.js":92,"../../shared/utils.js":97}],67:[function(require,module,exports){ 5541"use strict"; 5542 5543Object.defineProperty(exports, "__esModule", { 5544 value: true 5545}); 5546exports["default"] = EffectFlip; 5547var _createShadow = _interopRequireDefault(require("../../shared/create-shadow.js")); 5548var _effectInit = _interopRequireDefault(require("../../shared/effect-init.js")); 5549var _effectTarget = _interopRequireDefault(require("../../shared/effect-target.js")); 5550var _effectVirtualTransitionEnd = _interopRequireDefault(require("../../shared/effect-virtual-transition-end.js")); 5551var _utils = require("../../shared/utils.js"); 5552function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } 5553function EffectFlip(_ref) { 5554 var swiper = _ref.swiper, 5555 extendParams = _ref.extendParams, 5556 on = _ref.on; 5557 extendParams({ 5558 flipEffect: { 5559 slideShadows: true, 5560 limitRotation: true 5561 } 5562 }); 5563 var createSlideShadows = function createSlideShadows(slideEl, progress, params) { 5564 var shadowBefore = swiper.isHorizontal() ? slideEl.querySelector('.swiper-slide-shadow-left') : slideEl.querySelector('.swiper-slide-shadow-top'); 5565 var shadowAfter = swiper.isHorizontal() ? slideEl.querySelector('.swiper-slide-shadow-right') : slideEl.querySelector('.swiper-slide-shadow-bottom'); 5566 if (!shadowBefore) { 5567 shadowBefore = (0, _createShadow["default"])(params, slideEl, swiper.isHorizontal() ? 'left' : 'top'); 5568 } 5569 if (!shadowAfter) { 5570 shadowAfter = (0, _createShadow["default"])(params, slideEl, swiper.isHorizontal() ? 'right' : 'bottom'); 5571 } 5572 if (shadowBefore) shadowBefore.style.opacity = Math.max(-progress, 0); 5573 if (shadowAfter) shadowAfter.style.opacity = Math.max(progress, 0); 5574 }; 5575 var recreateShadows = function recreateShadows() { 5576 // Set shadows 5577 var params = swiper.params.flipEffect;
5578 swiper.slides.forEach(function (slideEl) { 5579 var progress = slideEl.progress; 5580 if (swiper.params.flipEffect.limitRotation) { 5581 progress = Math.max(Math.min(slideEl.progress, 1), -1); 5582 } 5583 createSlideShadows(slideEl, progress, params); 5584 }); 5585 }; 5586 var setTranslate = function setTranslate() { 5587 var slides = swiper.slides, 5588 rtl = swiper.rtlTranslate; 5589 var params = swiper.params.flipEffect; 5590 for (var i = 0; i < slides.length; i += 1) { 5591 var slideEl = slides[i]; 5592 var progress = slideEl.progress; 5593 if (swiper.params.flipEffect.limitRotation) { 5594 progress = Math.max(Math.min(slideEl.progress, 1), -1); 5595 } 5596 var offset = slideEl.swiperSlideOffset; 5597 var rotate = -180 * progress; 5598 var rotateY = rotate; 5599 var rotateX = 0; 5600 var tx = swiper.params.cssMode ? -offset - swiper.translate : -offset; 5601 var ty = 0; 5602 if (!swiper.isHorizontal()) { 5603 ty = tx; 5604 tx = 0; 5605 rotateX = -rotateY; 5606 rotateY = 0; 5607 } else if (rtl) { 5608 rotateY = -rotateY; 5609 } 5610 slideEl.style.zIndex = -Math.abs(Math.round(progress)) + slides.length; 5611 if (params.slideShadows) { 5612 createSlideShadows(slideEl, progress, params); 5613 } 5614 var transform = "translate3d(".concat(tx, "px, ").concat(ty, "px, 0px) rotateX(").concat(rotateX, "deg) rotateY(").concat(rotateY, "deg)"); 5615 var targetEl = (0, _effectTarget["default"])(params, slideEl); 5616 targetEl.style.transform = transform; 5617 } 5618 }; 5619 var setTransition = function setTransition(duration) { 5620 var transformElements = swiper.slides.map(function (slideEl) { 5621 return (0, _utils.getSlideTransformEl)(slideEl); 5622 }); 5623 transformElements.forEach(function (el) { 5624 el.style.transitionDuration = "".concat(duration, "ms"); 5625 el.querySelectorAll('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left').forEach(function (shadowEl) { 5626 shadowEl.style.transitionDuration = "".concat(duration, "ms"); 5627 }); 5628 }); 5629 (0, _effectVirtualTransitionEnd["default"])({ 5630 swiper: swiper, 5631 duration: duration, 5632 transformElements: transformElements 5633 }); 5634 }; 5635 (0, _effectInit["default"])({ 5636 effect: 'flip', 5637 swiper: swiper, 5638 on: on, 5639 setTranslate: setTranslate, 5640 setTransition: setTransition, 5641 recreateShadows: recreateShadows, 5642 getEffectParams: function getEffectParams() { 5643 return swiper.params.flipEffect; 5644 }, 5645 perspective: function perspective() { 5646 return true; 5647 }, 5648 overwriteParams: function overwriteParams() { 5649 return { 5650 slidesPerView: 1, 5651 slidesPerGroup: 1, 5652 watchSlidesProgress: true, 5653 spaceBetween: 0, 5654 virtualTranslate: !swiper.params.cssMode 5655 }; 5656 } 5657 }); 5658} 5659 5660},{"../../shared/create-shadow.js":89,"../../shared/effect-init.js":90,"../../shared/effect-target.js":91,"../../shared/effect-virtual-transition-end.js":92,"../../shared/utils.js":97}],68:[function(require,module,exports){ 5661"use strict"; 5662 5663Object.defineProperty(exports, "__esModule", { 5664 value: true 5665}); 5666exports["default"] = freeMode; 5667var _utils = require("../../shared/utils.js"); 5668function freeMode(_ref) { 5669 var swiper = _ref.swiper, 5670 extendParams = _ref.extendParams, 5671 emit = _ref.emit, 5672 once = _ref.once; 5673 extendParams({ 5674 freeMode: { 5675 enabled: false, 5676 momentum: true, 5677 momentumRatio: 1, 5678 momentumBounce: true, 5679 momentumBounceRatio: 1, 5680 momentumVelocityRatio: 1, 5681 sticky: false, 5682 minimumVelocity: 0.02 5683 } 5684 }); 5685 function onTouchStart() { 5686 var translate = swiper.getTranslate(); 5687 swiper.setTranslate(translate); 5688 swiper.setTransition(0); 5689 swiper.touchEventsData.velocities.length = 0; 5690 swiper.freeMode.onTouchEnd({ 5691 currentPos: swiper.rtl ? swiper.translate : -swiper.translate 5692 }); 5693 } 5694 function onTouchMove() { 5695 var data = swiper.touchEventsData, 5696 touches = swiper.touches; 5697 // Velocity 5698 if (data.velocities.length === 0) { 5699 data.velocities.push({ 5700 position: touches[swiper.isHorizontal() ? 'startX' : 'startY'], 5701 time: data.touchStartTime 5702 }); 5703 } 5704 data.velocities.push({ 5705 position: touches[swiper.isHorizontal() ? 'currentX' : 'currentY'], 5706 time: (0, _utils.now)() 5707 }); 5708 } 5709 function onTouchEnd(_ref2) { 5710 var currentPos = _ref2.currentPos; 5711 var params = swiper.params, 5712 wrapperEl = swiper.wrapperEl, 5713 rtl = swiper.rtlTranslate, 5714 snapGrid = swiper.snapGrid, 5715 data = swiper.touchEventsData; 5716 // Time diff 5717 var touchEndTime = (0, _utils.now)(); 5718 var timeDiff = touchEndTime - data.touchStartTime;
5719 if (currentPos < -swiper.minTranslate()) { 5720 swiper.slideTo(swiper.activeIndex); 5721 return; 5722 } 5723 if (currentPos > -swiper.maxTranslate()) { 5724 if (swiper.slides.length < snapGrid.length) { 5725 swiper.slideTo(snapGrid.length - 1); 5726 } else { 5727 swiper.slideTo(swiper.slides.length - 1); 5728 } 5729 return; 5730 } 5731 if (params.freeMode.momentum) { 5732 if (data.velocities.length > 1) { 5733 var lastMoveEvent = data.velocities.pop(); 5734 var velocityEvent = data.velocities.pop(); 5735 var distance = lastMoveEvent.position - velocityEvent.position; 5736 var time = lastMoveEvent.time - velocityEvent.time; 5737 swiper.velocity = distance / time; 5738 swiper.velocity /= 2; 5739 if (Math.abs(swiper.velocity) < params.freeMode.minimumVelocity) { 5740 swiper.velocity = 0; 5741 } 5742 // this implies that the user stopped moving a finger then released. 5743 // There would be no events with distance zero, so the last event is stale. 5744 if (time > 150 || (0, _utils.now)() - lastMoveEvent.time > 300) { 5745 swiper.velocity = 0; 5746 } 5747 } else { 5748 swiper.velocity = 0; 5749 } 5750 swiper.velocity *= params.freeMode.momentumVelocityRatio; 5751 data.velocities.length = 0; 5752 var momentumDuration = 1000 * params.freeMode.momentumRatio; 5753 var momentumDistance = swiper.velocity * momentumDuration; 5754 var newPosition = swiper.translate + momentumDistance; 5755 if (rtl) newPosition = -newPosition; 5756 var doBounce = false; 5757 var afterBouncePosition; 5758 var bounceAmount = Math.abs(swiper.velocity) * 20 * params.freeMode.momentumBounceRatio; 5759 var needsLoopFix; 5760 if (newPosition < swiper.maxTranslate()) { 5761 if (params.freeMode.momentumBounce) { 5762 if (newPosition + swiper.maxTranslate() < -bounceAmount) { 5763 newPosition = swiper.maxTranslate() - bounceAmount; 5764 } 5765 afterBouncePosition = swiper.maxTranslate(); 5766 doBounce = true; 5767 data.allowMomentumBounce = true; 5768 } else { 5769 newPosition = swiper.maxTranslate(); 5770 } 5771 if (params.loop && params.centeredSlides) needsLoopFix = true; 5772 } else if (newPosition > swiper.minTranslate()) { 5773 if (params.freeMode.momentumBounce) { 5774 if (newPosition - swiper.minTranslate() > bounceAmount) { 5775 newPosition = swiper.minTranslate() + bounceAmount; 5776 } 5777 afterBouncePosition = swiper.minTranslate(); 5778 doBounce = true; 5779 data.allowMomentumBounce = true; 5780 } else { 5781 newPosition = swiper.minTranslate(); 5782 } 5783 if (params.loop && params.centeredSlides) needsLoopFix = true; 5784 } else if (params.freeMode.sticky) { 5785 var nextSlide; 5786 for (var j = 0; j < snapGrid.length; j += 1) { 5787 if (snapGrid[j] > -newPosition) { 5788 nextSlide = j; 5789 break; 5790 } 5791 } 5792 if (Math.abs(snapGrid[nextSlide] - newPosition) < Math.abs(snapGrid[nextSlide - 1] - newPosition) || swiper.swipeDirection === 'next') { 5793 newPosition = snapGrid[nextSlide]; 5794 } else { 5795 newPosition = snapGrid[nextSlide - 1]; 5796 } 5797 newPosition = -newPosition; 5798 } 5799 if (needsLoopFix) { 5800 once('transitionEnd', function () { 5801 swiper.loopFix(); 5802 }); 5803 } 5804 // Fix duration 5805 if (swiper.velocity !== 0) { 5806 if (rtl) { 5807 momentumDuration = Math.abs((-newPosition - swiper.translate) / swiper.velocity); 5808 } else { 5809 momentumDuration = Math.abs((newPosition - swiper.translate) / swiper.velocity); 5810 } 5811 if (params.freeMode.sticky) { 5812 // If freeMode.sticky is active and the user ends a swipe with a slow-velocity 5813 // event, then durations can be 20+ seconds to slide one (or zero!) slides. 5814 // It's easy to see this when simulating touch with mouse events. To fix this, 5815 // limit single-slide swipes to the default slide duration. This also has the 5816 // nice side effect of matching slide speed if the user stopped moving before 5817 // lifting finger or mouse vs. moving slowly before lifting the finger/mouse. 5818 // For faster swipes, also apply limits (albeit higher ones). 5819 var moveDistance = Math.abs((rtl ? -newPosition : newPosition) - swiper.translate); 5820 var currentSlideSize = swiper.slidesSizesGrid[swiper.activeIndex]; 5821 if (moveDistance < currentSlideSize) { 5822 momentumDuration = params.speed; 5823 } else if (moveDistance < 2 * currentSlideSize) { 5824 momentumDuration = params.speed * 1.5; 5825 } else { 5826 momentumDuration = params.speed * 2.5; 5827 } 5828 } 5829 } else if (params.freeMode.sticky) { 5830 swiper.slideToClosest(); 5831 return; 5832 } 5833 if (params.freeMode.momentumBounce && doBounce) { 5834 swiper.updateProgress(afterBouncePosition); 5835 swiper.setTransition(momentumDuration); 5836 swiper.setTranslate(newPosition); 5837 swiper.transitionStart(true, swiper.swipeDirection); 5838 swiper.animating = true; 5839 (0, _utils.elementTransitionEnd)(wrapperEl, function () { 5840 if (!swiper || swiper.destroyed || !data.allowMomentumBounce) return; 5841 emit('momentumBounce'); 5842 swiper.setTransition(params.speed); 5843 setTimeout(function () { 5844 swiper.setTranslate(afterBouncePosition); 5845 (0, _utils.elementTransitionEnd)(wrapperEl, function () { 5846 if (!swiper || swiper.destroyed) return; 5847 swiper.transitionEnd(); 5848 }); 5849 }, 0); 5850 }); 5851 } else if (swiper.velocity) { 5852 emit('_freeModeNoMomentumRelease'); 5853 swiper.updateProgress(newPosition); 5854 swiper.setTransition(momentumDuration); 5855 swiper.setTranslate(newPosition); 5856 swiper.transitionStart(true, swiper.swipeDirection); 5857 if (!swiper.animating) { 5858 swiper.animating = true; 5859 (0, _utils.elementTransitionEnd)(wrapperEl, function () { 5860 if (!swiper || swiper.destroyed) return; 5861 swiper.transitionEnd(); 5862 }); 5863 } 5864 } else { 5865 swiper.updateProgress(newPosition); 5866 } 5867 swiper.updateActiveIndex(); 5868 swiper.updateSlidesClasses(); 5869 } else if (params.freeMode.sticky) { 5870 swiper.slideToClosest(); 5871 return; 5872 } else if (params.freeMode) { 5873 emit('_freeModeNoMomentumRelease'); 5874 } 5875 if (!params.freeMode.momentum || timeDiff >= params.longSwipesMs) { 5876 swiper.updateProgress(); 5877 swiper.updateActiveIndex(); 5878 swiper.updateSlidesClasses(); 5879 } 5880 } 5881 Object.assign(swiper, { 5882 freeMode: { 5883 onTouchStart: onTouchStart, 5884 onTouchMove: onTouchMove, 5885 onTouchEnd: onTouchEnd 5886 } 5887 }); 5888} 5889 5890},{"../../shared/utils.js":97}],69:[function(require,module,exports){ 5891"use strict"; 5892 5893Object.defineProperty(exports, "__esModule", { 5894 value: true 5895}); 5896exports["default"] = Grid; 5897function Grid(_ref) { 5898 var swiper = _ref.swiper, 5899 extendParams = _ref.extendParams; 5900 extendParams({ 5901 grid: { 5902 rows: 1, 5903 fill: 'column' 5904 } 5905 });
5906 var slidesNumberEvenToRows; 5907 var slidesPerRow; 5908 var numFullColumns; 5909 var getSpaceBetween = function getSpaceBetween() { 5910 var spaceBetween = swiper.params.spaceBetween; 5911 if (typeof spaceBetween === 'string' && spaceBetween.indexOf('%') >= 0) { 5912 spaceBetween = parseFloat(spaceBetween.replace('%', '')) / 100 * swiper.size; 5913 } else if (typeof spaceBetween === 'string') { 5914 spaceBetween = parseFloat(spaceBetween); 5915 } 5916 return spaceBetween; 5917 }; 5918 var initSlides = function initSlides(slidesLength) { 5919 var slidesPerView = swiper.params.slidesPerView; 5920 var _swiper$params$grid = swiper.params.grid, 5921 rows = _swiper$params$grid.rows, 5922 fill = _swiper$params$grid.fill; 5923 slidesPerRow = slidesNumberEvenToRows / rows; 5924 numFullColumns = Math.floor(slidesLength / rows); 5925 if (Math.floor(slidesLength / rows) === slidesLength / rows) { 5926 slidesNumberEvenToRows = slidesLength; 5927 } else { 5928 slidesNumberEvenToRows = Math.ceil(slidesLength / rows) * rows; 5929 } 5930 if (slidesPerView !== 'auto' && fill === 'row') { 5931 slidesNumberEvenToRows = Math.max(slidesNumberEvenToRows, slidesPerView * rows); 5932 } 5933 }; 5934 var updateSlide = function updateSlide(i, slide, slidesLength, getDirectionLabel) { 5935 var slidesPerGroup = swiper.params.slidesPerGroup; 5936 var spaceBetween = getSpaceBetween(); 5937 var _swiper$params$grid2 = swiper.params.grid, 5938 rows = _swiper$params$grid2.rows, 5939 fill = _swiper$params$grid2.fill; 5940 // Set slides order 5941 var newSlideOrderIndex; 5942 var column; 5943 var row; 5944 if (fill === 'row' && slidesPerGroup > 1) { 5945 var groupIndex = Math.floor(i / (slidesPerGroup * rows)); 5946 var slideIndexInGroup = i - rows * slidesPerGroup * groupIndex; 5947 var columnsInGroup = groupIndex === 0 ? slidesPerGroup : Math.min(Math.ceil((slidesLength - groupIndex * rows * slidesPerGroup) / rows), slidesPerGroup); 5948 row = Math.floor(slideIndexInGroup / columnsInGroup); 5949 column = slideIndexInGroup - row * columnsInGroup + groupIndex * slidesPerGroup; 5950 newSlideOrderIndex = column + row * slidesNumberEvenToRows / rows; 5951 slide.style.order = newSlideOrderIndex; 5952 } else if (fill === 'column') { 5953 column = Math.floor(i / rows); 5954 row = i - column * rows; 5955 if (column > numFullColumns || column === numFullColumns && row === rows - 1) { 5956 row += 1; 5957 if (row >= rows) { 5958 row = 0; 5959 column += 1; 5960 } 5961 } 5962 } else { 5963 row = Math.floor(i / slidesPerRow); 5964 column = i - row * slidesPerRow; 5965 } 5966 slide.style[getDirectionLabel('margin-top')] = row !== 0 ? spaceBetween && "".concat(spaceBetween, "px") : ''; 5967 }; 5968 var updateWrapperSize = function updateWrapperSize(slideSize, snapGrid, getDirectionLabel) { 5969 var _swiper$params = swiper.params, 5970 centeredSlides = _swiper$params.centeredSlides, 5971 roundLengths = _swiper$params.roundLengths; 5972 var spaceBetween = getSpaceBetween(); 5973 var rows = swiper.params.grid.rows; 5974 swiper.virtualSize = (slideSize + spaceBetween) * slidesNumberEvenToRows; 5975 swiper.virtualSize = Math.ceil(swiper.virtualSize / rows) - spaceBetween; 5976 swiper.wrapperEl.style[getDirectionLabel('width')] = "".concat(swiper.virtualSize + spaceBetween, "px"); 5977 if (centeredSlides) { 5978 var newSlidesGrid = []; 5979 for (var i = 0; i < snapGrid.length; i += 1) { 5980 var slidesGridItem = snapGrid[i]; 5981 if (roundLengths) slidesGridItem = Math.floor(slidesGridItem); 5982 if (snapGrid[i] < swiper.virtualSize + snapGrid[0]) newSlidesGrid.push(slidesGridItem); 5983 } 5984 snapGrid.splice(0, snapGrid.length); 5985 snapGrid.push.apply(snapGrid, newSlidesGrid); 5986 } 5987 }; 5988 swiper.grid = { 5989 initSlides: initSlides, 5990 updateSlide: updateSlide, 5991 updateWrapperSize: updateWrapperSize 5992 }; 5993} 5994 5995},{}],70:[function(require,module,exports){ 5996"use strict"; 5997 5998Object.defineProperty(exports, "__esModule", { 5999 value: true 6000}); 6001exports["default"] = HashNavigation; 6002var _ssrWindow = require("ssr-window"); 6003var _utils = require("../../shared/utils.js"); 6004function HashNavigation(_ref) { 6005 var swiper = _ref.swiper, 6006 extendParams = _ref.extendParams, 6007 emit = _ref.emit, 6008 on = _ref.on; 6009 var initialized = false;
6010 var document = (0, _ssrWindow.getDocument)(); 6011 var window = (0, _ssrWindow.getWindow)(); 6012 extendParams({ 6013 hashNavigation: { 6014 enabled: false, 6015 replaceState: false, 6016 watchState: false, 6017 getSlideIndex: function getSlideIndex(_s, hash) { 6018 if (swiper.virtual && swiper.params.virtual.enabled) { 6019 var slideWithHash = swiper.slides.filter(function (slideEl) { 6020 return slideEl.getAttribute('data-hash') === hash; 6021 })[0]; 6022 if (!slideWithHash) return 0; 6023 var index = parseInt(slideWithHash.getAttribute('data-swiper-slide-index'), 10); 6024 return index; 6025 } 6026 return swiper.getSlideIndex((0, _utils.elementChildren)(swiper.slidesEl, ".".concat(swiper.params.slideClass, "[data-hash=\"").concat(hash, "\"], swiper-slide[data-hash=\"").concat(hash, "\"]"))[0]); 6027 } 6028 } 6029 }); 6030 var onHashChange = function onHashChange() { 6031 emit('hashChange'); 6032 var newHash = document.location.hash.replace('#', ''); 6033 var activeSlideEl = swiper.slidesEl.querySelector("[data-swiper-slide-index=\"".concat(swiper.activeIndex, "\"]")); 6034 var activeSlideHash = activeSlideEl ? activeSlideEl.getAttribute('data-hash') : ''; 6035 if (newHash !== activeSlideHash) { 6036 var newIndex = swiper.params.hashNavigation.getSlideIndex(swiper, newHash); 6037 if (typeof newIndex === 'undefined' || Number.isNaN(newIndex)) return; 6038 swiper.slideTo(newIndex); 6039 } 6040 }; 6041 var setHash = function setHash() { 6042 if (!initialized || !swiper.params.hashNavigation.enabled) return; 6043 var activeSlideEl = swiper.slidesEl.querySelector("[data-swiper-slide-index=\"".concat(swiper.activeIndex, "\"]")); 6044 var activeSlideHash = activeSlideEl ? activeSlideEl.getAttribute('data-hash') || activeSlideEl.getAttribute('data-history') : ''; 6045 if (swiper.params.hashNavigation.replaceState && window.history && window.history.replaceState) { 6046 window.history.replaceState(null, null, "#".concat(activeSlideHash) || ''); 6047 emit('hashSet'); 6048 } else { 6049 document.location.hash = activeSlideHash || ''; 6050 emit('hashSet'); 6051 } 6052 }; 6053 var init = function init() { 6054 if (!swiper.params.hashNavigation.enabled || swiper.params.history && swiper.params.history.enabled) return; 6055 initialized = true; 6056 var hash = document.location.hash.replace('#', ''); 6057 if (hash) { 6058 var speed = 0; 6059 var index = swiper.params.hashNavigation.getSlideIndex(swiper, hash); 6060 swiper.slideTo(index || 0, speed, swiper.params.runCallbacksOnInit, true); 6061 } 6062 if (swiper.params.hashNavigation.watchState) { 6063 window.addEventListener('hashchange', onHashChange); 6064 } 6065 }; 6066 var destroy = function destroy() { 6067 if (swiper.params.hashNavigation.watchState) { 6068 window.removeEventListener('hashchange', onHashChange); 6069 } 6070 }; 6071 on('init', function () { 6072 if (swiper.params.hashNavigation.enabled) { 6073 init(); 6074 } 6075 }); 6076 on('destroy', function () { 6077 if (swiper.params.hashNavigation.enabled) { 6078 destroy(); 6079 } 6080 }); 6081 on('transitionEnd _freeModeNoMomentumRelease', function () { 6082 if (initialized) { 6083 setHash(); 6084 } 6085 }); 6086 on('slideChange', function () { 6087 if (initialized && swiper.params.cssMode) { 6088 setHash(); 6089 } 6090 }); 6091} 6092 6093},{"../../shared/utils.js":97,"ssr-window":1}],71:[function(require,module,exports){ 6094"use strict"; 6095 6096Object.defineProperty(exports, "__esModule", { 6097 value: true 6098}); 6099exports["default"] = History; 6100var _ssrWindow = require("ssr-window"); 6101function History(_ref) { 6102 var swiper = _ref.swiper, 6103 extendParams = _ref.extendParams, 6104 on = _ref.on; 6105 extendParams({ 6106 history: { 6107 enabled: false, 6108 root: '', 6109 replaceState: false, 6110 key: 'slides', 6111 keepQuery: false 6112 } 6113 }); 6114 var initialized = false; 6115 var paths = {}; 6116 var slugify = function slugify(text) { 6117 return text.toString().replace(/\s+/g, '-').replace(/[^\w-]+/g, '').replace(/--+/g, '-').replace(/^-+/, '').replace(/-+$/, ''); 6118 }; 6119 var getPathValues = function getPathValues(urlOverride) { 6120 var window = (0, _ssrWindow.getWindow)(); 6121 var location; 6122 if (urlOverride) { 6123 location = new URL(urlOverride); 6124 } else { 6125 location = window.location; 6126 } 6127 var pathArray = location.pathname.slice(1).split('/').filter(function (part) { 6128 return part !== ''; 6129 }); 6130 var total = pathArray.length; 6131 var key = pathArray[total - 2]; 6132 var value = pathArray[total - 1]; 6133 return { 6134 key: key, 6135 value: value 6136 }; 6137 }; 6138 var setHistory = function setHistory(key, index) { 6139 var window = (0, _ssrWindow.getWindow)(); 6140 if (!initialized || !swiper.params.history.enabled) return; 6141 var location; 6142 if (swiper.params.url) { 6143 location = new URL(swiper.params.url); 6144 } else { 6145 location = window.location; 6146 } 6147 var slide = swiper.slides[index]; 6148 var value = slugify(slide.getAttribute('data-history')); 6149 if (swiper.params.history.root.length > 0) { 6150 var root = swiper.params.history.root; 6151 if (root[root.length - 1] === '/') root = root.slice(0, root.length - 1); 6152 value = "".concat(root, "/").concat(key ? "".concat(key, "/") : '').concat(value); 6153 } else if (!location.pathname.includes(key)) { 6154 value = "".concat(key ? "".concat(key, "/") : '').concat(value); 6155 } 6156 if (swiper.params.history.keepQuery) { 6157 value += location.search; 6158 } 6159 var currentState = window.history.state; 6160 if (currentState && currentState.value === value) { 6161 return; 6162 } 6163 if (swiper.params.history.replaceState) { 6164 window.history.replaceState({ 6165 value: value 6166 }, null, value); 6167 } else { 6168 window.history.pushState({ 6169 value: value 6170 }, null, value); 6171 } 6172 }; 6173 var scrollToSlide = function scrollToSlide(speed, value, runCallbacks) { 6174 if (value) { 6175 for (var i = 0, length = swiper.slides.length; i < length; i += 1) { 6176 var slide = swiper.slides[i]; 6177 var slideHistory = slugify(slide.getAttribute('data-history')); 6178 if (slideHistory === value) { 6179 var index = swiper.getSlideIndex(slide); 6180 swiper.slideTo(index, speed, runCallbacks); 6181 } 6182 } 6183 } else { 6184 swiper.slideTo(0, speed, runCallbacks); 6185 } 6186 }; 6187 var setHistoryPopState = function setHistoryPopState() { 6188 paths = getPathValues(swiper.params.url); 6189 scrollToSlide(swiper.params.speed, paths.value, false); 6190 };
6191 var init = function init() { 6192 var window = (0, _ssrWindow.getWindow)(); 6193 if (!swiper.params.history) return; 6194 if (!window.history || !window.history.pushState) { 6195 swiper.params.history.enabled = false; 6196 swiper.params.hashNavigation.enabled = true; 6197 return; 6198 } 6199 initialized = true; 6200 paths = getPathValues(swiper.params.url); 6201 if (!paths.key && !paths.value) { 6202 if (!swiper.params.history.replaceState) { 6203 window.addEventListener('popstate', setHistoryPopState); 6204 } 6205 return; 6206 } 6207 scrollToSlide(0, paths.value, swiper.params.runCallbacksOnInit); 6208 if (!swiper.params.history.replaceState) { 6209 window.addEventListener('popstate', setHistoryPopState); 6210 } 6211 }; 6212 var destroy = function destroy() { 6213 var window = (0, _ssrWindow.getWindow)(); 6214 if (!swiper.params.history.replaceState) { 6215 window.removeEventListener('popstate', setHistoryPopState); 6216 } 6217 }; 6218 on('init', function () { 6219 if (swiper.params.history.enabled) { 6220 init(); 6221 } 6222 }); 6223 on('destroy', function () { 6224 if (swiper.params.history.enabled) { 6225 destroy(); 6226 } 6227 }); 6228 on('transitionEnd _freeModeNoMomentumRelease', function () { 6229 if (initialized) { 6230 setHistory(swiper.params.history.key, swiper.activeIndex); 6231 } 6232 }); 6233 on('slideChange', function () { 6234 if (initialized && swiper.params.cssMode) { 6235 setHistory(swiper.params.history.key, swiper.activeIndex); 6236 } 6237 }); 6238} 6239 6240},{"ssr-window":1}],72:[function(require,module,exports){ 6241"use strict"; 6242 6243Object.defineProperty(exports, "__esModule", { 6244 value: true 6245}); 6246exports["default"] = Keyboard; 6247var _ssrWindow = require("ssr-window"); 6248var _utils = require("../../shared/utils.js"); 6249/* eslint-disable consistent-return */ 6250 6251function Keyboard(_ref) { 6252 var swiper = _ref.swiper, 6253 extendParams = _ref.extendParams, 6254 on = _ref.on, 6255 emit = _ref.emit; 6256 var document = (0, _ssrWindow.getDocument)(); 6257 var window = (0, _ssrWindow.getWindow)(); 6258 swiper.keyboard = { 6259 enabled: false 6260 }; 6261 extendParams({ 6262 keyboard: { 6263 enabled: false, 6264 onlyInViewport: true, 6265 pageUpDown: true 6266 } 6267 }); 6268 function handle(event) { 6269 if (!swiper.enabled) return; 6270 var rtl = swiper.rtlTranslate; 6271 var e = event; 6272 if (e.originalEvent) e = e.originalEvent; // jquery fix 6273 var kc = e.keyCode || e.charCode; 6274 var pageUpDown = swiper.params.keyboard.pageUpDown; 6275 var isPageUp = pageUpDown && kc === 33; 6276 var isPageDown = pageUpDown && kc === 34; 6277 var isArrowLeft = kc === 37; 6278 var isArrowRight = kc === 39; 6279 var isArrowUp = kc === 38; 6280 var isArrowDown = kc === 40; 6281 // Directions locks 6282 if (!swiper.allowSlideNext && (swiper.isHorizontal() && isArrowRight || swiper.isVertical() && isArrowDown || isPageDown)) { 6283 return false; 6284 } 6285 if (!swiper.allowSlidePrev && (swiper.isHorizontal() && isArrowLeft || swiper.isVertical() && isArrowUp || isPageUp)) { 6286 return false; 6287 } 6288 if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey) { 6289 return undefined; 6290 } 6291 if (document.activeElement && document.activeElement.nodeName && (document.activeElement.nodeName.toLowerCase() === 'input' || document.activeElement.nodeName.toLowerCase() === 'textarea')) { 6292 return undefined; 6293 } 6294 if (swiper.params.keyboard.onlyInViewport && (isPageUp || isPageDown || isArrowLeft || isArrowRight || isArrowUp || isArrowDown)) { 6295 var inView = false; 6296 // Check that swiper should be inside of visible area of window 6297 if ((0, _utils.elementParents)(swiper.el, ".".concat(swiper.params.slideClass, ", swiper-slide")).length > 0 && (0, _utils.elementParents)(swiper.el, ".".concat(swiper.params.slideActiveClass)).length === 0) { 6298 return undefined; 6299 } 6300 var el = swiper.el; 6301 var swiperWidth = el.clientWidth; 6302 var swiperHeight = el.clientHeight; 6303 var windowWidth = window.innerWidth; 6304 var windowHeight = window.innerHeight; 6305 var swiperOffset = (0, _utils.elementOffset)(el); 6306 if (rtl) swiperOffset.left -= el.scrollLeft; 6307 var swiperCoord = [[swiperOffset.left, swiperOffset.top], [swiperOffset.left + swiperWidth, swiperOffset.top], [swiperOffset.left, swiperOffset.top + swiperHeight], [swiperOffset.left + swiperWidth, swiperOffset.top + swiperHeight]]; 6308 for (var i = 0; i < swiperCoord.length; i += 1) { 6309 var point = swiperCoord[i]; 6310 if (point[0] >= 0 && point[0] <= windowWidth && point[1] >= 0 && point[1] <= windowHeight) { 6311 if (point[0] === 0 && point[1] === 0) continue; // eslint-disable-line 6312 inView = true; 6313 } 6314 } 6315 if (!inView) return undefined; 6316 } 6317 if (swiper.isHorizontal()) { 6318 if (isPageUp || isPageDown || isArrowLeft || isArrowRight) { 6319 if (e.preventDefault) e.preventDefault();else e.returnValue = false;
6320 } 6321 if ((isPageDown || isArrowRight) && !rtl || (isPageUp || isArrowLeft) && rtl) swiper.slideNext(); 6322 if ((isPageUp || isArrowLeft) && !rtl || (isPageDown || isArrowRight) && rtl) swiper.slidePrev(); 6323 } else { 6324 if (isPageUp || isPageDown || isArrowUp || isArrowDown) { 6325 if (e.preventDefault) e.preventDefault();else e.returnValue = false; 6326 } 6327 if (isPageDown || isArrowDown) swiper.slideNext(); 6328 if (isPageUp || isArrowUp) swiper.slidePrev(); 6329 } 6330 emit('keyPress', kc); 6331 return undefined; 6332 } 6333 function enable() { 6334 if (swiper.keyboard.enabled) return; 6335 document.addEventListener('keydown', handle); 6336 swiper.keyboard.enabled = true; 6337 } 6338 function disable() { 6339 if (!swiper.keyboard.enabled) return; 6340 document.removeEventListener('keydown', handle); 6341 swiper.keyboard.enabled = false; 6342 } 6343 on('init', function () { 6344 if (swiper.params.keyboard.enabled) { 6345 enable(); 6346 } 6347 }); 6348 on('destroy', function () { 6349 if (swiper.keyboard.enabled) { 6350 disable(); 6351 } 6352 }); 6353 Object.assign(swiper.keyboard, { 6354 enable: enable, 6355 disable: disable 6356 }); 6357} 6358 6359},{"../../shared/utils.js":97,"ssr-window":1}],73:[function(require,module,exports){ 6360"use strict"; 6361 6362Object.defineProperty(exports, "__esModule", { 6363 value: true 6364}); 6365exports["default"] = Manipulation; 6366var _appendSlide = _interopRequireDefault(require("./methods/appendSlide.js")); 6367var _prependSlide = _interopRequireDefault(require("./methods/prependSlide.js")); 6368var _addSlide = _interopRequireDefault(require("./methods/addSlide.js")); 6369var _removeSlide = _interopRequireDefault(require("./methods/removeSlide.js")); 6370var _removeAllSlides = _interopRequireDefault(require("./methods/removeAllSlides.js")); 6371function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } 6372function Manipulation(_ref) { 6373 var swiper = _ref.swiper; 6374 Object.assign(swiper, { 6375 appendSlide: _appendSlide["default"].bind(swiper), 6376 prependSlide: _prependSlide["default"].bind(swiper), 6377 addSlide: _addSlide["default"].bind(swiper), 6378 removeSlide: _removeSlide["default"].bind(swiper), 6379 removeAllSlides: _removeAllSlides["default"].bind(swiper) 6380 }); 6381} 6382 6383},{"./methods/addSlide.js":74,"./methods/appendSlide.js":75,"./methods/prependSlide.js":76,"./methods/removeAllSlides.js":77,"./methods/removeSlide.js":78}],74:[function(require,module,exports){ 6384"use strict"; 6385 6386Object.defineProperty(exports, "__esModule", { 6387 value: true 6388}); 6389exports["default"] = addSlide; 6390function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } 6391function addSlide(index, slides) { 6392 var swiper = this; 6393 var params = swiper.params, 6394 activeIndex = swiper.activeIndex, 6395 slidesEl = swiper.slidesEl; 6396 var activeIndexBuffer = activeIndex; 6397 if (params.loop) { 6398 activeIndexBuffer -= swiper.loopedSlides; 6399 swiper.loopDestroy(); 6400 swiper.recalcSlides(); 6401 } 6402 var baseLength = swiper.slides.length; 6403 if (index <= 0) { 6404 swiper.prependSlide(slides); 6405 return; 6406 } 6407 if (index >= baseLength) { 6408 swiper.appendSlide(slides); 6409 return; 6410 } 6411 var newActiveIndex = activeIndexBuffer > index ? activeIndexBuffer + 1 : activeIndexBuffer; 6412 var slidesBuffer = []; 6413 for (var i = baseLength - 1; i >= index; i -= 1) { 6414 var currentSlide = swiper.slides[i]; 6415 currentSlide.remove(); 6416 slidesBuffer.unshift(currentSlide); 6417 } 6418 if (_typeof(slides) === 'object' && 'length' in slides) { 6419 for (var _i = 0; _i < slides.length; _i += 1) { 6420 if (slides[_i]) slidesEl.append(slides[_i]); 6421 } 6422 newActiveIndex = activeIndexBuffer > index ? activeIndexBuffer + slides.length : activeIndexBuffer; 6423 } else { 6424 slidesEl.append(slides); 6425 } 6426 for (var _i2 = 0; _i2 < slidesBuffer.length; _i2 += 1) { 6427 slidesEl.append(slidesBuffer[_i2]); 6428 } 6429 swiper.recalcSlides(); 6430 if (params.loop) { 6431 swiper.loopCreate(); 6432 } 6433 if (!params.observer || swiper.isElement) {
6434 swiper.update(); 6435 } 6436 if (params.loop) { 6437 swiper.slideTo(newActiveIndex + swiper.loopedSlides, 0, false); 6438 } else { 6439 swiper.slideTo(newActiveIndex, 0, false); 6440 } 6441} 6442 6443},{}],75:[function(require,module,exports){ 6444"use strict"; 6445 6446Object.defineProperty(exports, "__esModule", { 6447 value: true 6448}); 6449exports["default"] = appendSlide; 6450function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } 6451function appendSlide(slides) { 6452 var swiper = this; 6453 var params = swiper.params, 6454 slidesEl = swiper.slidesEl; 6455 if (params.loop) { 6456 swiper.loopDestroy(); 6457 } 6458 var appendElement = function appendElement(slideEl) { 6459 if (typeof slideEl === 'string') { 6460 var tempDOM = document.createElement('div'); 6461 tempDOM.innerHTML = slideEl; 6462 slidesEl.append(tempDOM.children[0]); 6463 tempDOM.innerHTML = ''; 6464 } else { 6465 slidesEl.append(slideEl); 6466 } 6467 }; 6468 if (_typeof(slides) === 'object' && 'length' in slides) { 6469 for (var i = 0; i < slides.length; i += 1) { 6470 if (slides[i]) appendElement(slides[i]); 6471 } 6472 } else { 6473 appendElement(slides); 6474 } 6475 swiper.recalcSlides(); 6476 if (params.loop) { 6477 swiper.loopCreate(); 6478 } 6479 if (!params.observer || swiper.isElement) { 6480 swiper.update(); 6481 } 6482} 6483 6484},{}],76:[function(require,module,exports){ 6485"use strict"; 6486 6487Object.defineProperty(exports, "__esModule", { 6488 value: true 6489}); 6490exports["default"] = prependSlide; 6491function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } 6492function prependSlide(slides) { 6493 var swiper = this; 6494 var params = swiper.params, 6495 activeIndex = swiper.activeIndex, 6496 slidesEl = swiper.slidesEl; 6497 if (params.loop) { 6498 swiper.loopDestroy(); 6499 } 6500 var newActiveIndex = activeIndex + 1; 6501 var prependElement = function prependElement(slideEl) { 6502 if (typeof slideEl === 'string') { 6503 var tempDOM = document.createElement('div'); 6504 tempDOM.innerHTML = slideEl; 6505 slidesEl.prepend(tempDOM.children[0]); 6506 tempDOM.innerHTML = ''; 6507 } else { 6508 slidesEl.prepend(slideEl); 6509 } 6510 }; 6511 if (_typeof(slides) === 'object' && 'length' in slides) { 6512 for (var i = 0; i < slides.length; i += 1) { 6513 if (slides[i]) prependElement(slides[i]); 6514 } 6515 newActiveIndex = activeIndex + slides.length; 6516 } else { 6517 prependElement(slides); 6518 } 6519 swiper.recalcSlides(); 6520 if (params.loop) { 6521 swiper.loopCreate(); 6522 } 6523 if (!params.observer || swiper.isElement) { 6524 swiper.update(); 6525 } 6526 swiper.slideTo(newActiveIndex, 0, false); 6527} 6528 6529},{}],77:[function(require,module,exports){ 6530"use strict"; 6531 6532Object.defineProperty(exports, "__esModule", { 6533 value: true 6534}); 6535exports["default"] = removeAllSlides; 6536function removeAllSlides() { 6537 var swiper = this; 6538 var slidesIndexes = []; 6539 for (var i = 0; i < swiper.slides.length; i += 1) { 6540 slidesIndexes.push(i); 6541 } 6542 swiper.removeSlide(slidesIndexes); 6543} 6544 6545},{}],78:[function(require,module,exports){ 6546"use strict"; 6547 6548Object.defineProperty(exports, "__esModule", { 6549 value: true 6550}); 6551exports["default"] = removeSlide; 6552function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } 6553function removeSlide(slidesIndexes) { 6554 var swiper = this; 6555 var params = swiper.params, 6556 activeIndex = swiper.activeIndex; 6557 var activeIndexBuffer = activeIndex; 6558 if (params.loop) { 6559 activeIndexBuffer -= swiper.loopedSlides; 6560 swiper.loopDestroy(); 6561 } 6562 var newActiveIndex = activeIndexBuffer; 6563 var indexToRemove; 6564 if (_typeof(slidesIndexes) === 'object' && 'length' in slidesIndexes) { 6565 for (var i = 0; i < slidesIndexes.length; i += 1) { 6566 indexToRemove = slidesIndexes[i]; 6567 if (swiper.slides[indexToRemove]) swiper.slides[indexToRemove].remove(); 6568 if (indexToRemove < newActiveIndex) newActiveIndex -= 1; 6569 } 6570 newActiveIndex = Math.max(newActiveIndex, 0); 6571 } else { 6572 indexToRemove = slidesIndexes; 6573 if (swiper.slides[indexToRemove]) swiper.slides[indexToRemove].remove(); 6574 if (indexToRemove < newActiveIndex) newActiveIndex -= 1; 6575 newActiveIndex = Math.max(newActiveIndex, 0); 6576 } 6577 swiper.recalcSlides(); 6578 if (params.loop) { 6579 swiper.loopCreate(); 6580 } 6581 if (!params.observer || swiper.isElement) {
vendor: 4,618 bytes, lines 6582-6745
6582 swiper.update(); 6583 } 6584 if (params.loop) { 6585 swiper.slideTo(newActiveIndex + swiper.loopedSlides, 0, false); 6586 } else { 6587 swiper.slideTo(newActiveIndex, 0, false); 6588 } 6589} 6590 6591},{}],79:[function(require,module,exports){ 6592"use strict"; 6593 6594Object.defineProperty(exports, "__esModule", { 6595 value: true 6596}); 6597exports["default"] = Mousewheel; 6598var _ssrWindow = require("ssr-window"); 6599var _utils = require("../../shared/utils.js"); 6600/* eslint-disable consistent-return */ 6601 6602function Mousewheel(_ref) { 6603 var swiper = _ref.swiper, 6604 extendParams = _ref.extendParams, 6605 on = _ref.on, 6606 emit = _ref.emit; 6607 var window = (0, _ssrWindow.getWindow)(); 6608 extendParams({ 6609 mousewheel: { 6610 enabled: false, 6611 releaseOnEdges: false, 6612 invert: false, 6613 forceToAxis: false, 6614 sensitivity: 1, 6615 eventsTarget: 'container', 6616 thresholdDelta: null, 6617 thresholdTime: null, 6618 noMousewheelClass: 'swiper-no-mousewheel' 6619 } 6620 }); 6621 swiper.mousewheel = { 6622 enabled: false 6623 }; 6624 var timeout; 6625 var lastScrollTime = (0, _utils.now)(); 6626 var lastEventBeforeSnap; 6627 var recentWheelEvents = []; 6628 function normalize(e) { 6629 // Reasonable defaults 6630 var PIXEL_STEP = 10; 6631 var LINE_HEIGHT = 40; 6632 var PAGE_HEIGHT = 800; 6633 var sX = 0; 6634 var sY = 0; // spinX, spinY 6635 var pX = 0; 6636 var pY = 0; // pixelX, pixelY 6637 6638 // Legacy 6639 if ('detail' in e) { 6640 sY = e.detail; 6641 } 6642 if ('wheelDelta' in e) { 6643 sY = -e.wheelDelta / 120; 6644 } 6645 if ('wheelDeltaY' in e) { 6646 sY = -e.wheelDeltaY / 120; 6647 } 6648 if ('wheelDeltaX' in e) { 6649 sX = -e.wheelDeltaX / 120; 6650 } 6651 6652 // side scrolling on FF with DOMMouseScroll 6653 if ('axis' in e && e.axis === e.HORIZONTAL_AXIS) { 6654 sX = sY; 6655 sY = 0; 6656 } 6657 pX = sX * PIXEL_STEP; 6658 pY = sY * PIXEL_STEP; 6659 if ('deltaY' in e) { 6660 pY = e.deltaY; 6661 } 6662 if ('deltaX' in e) { 6663 pX = e.deltaX; 6664 } 6665 if (e.shiftKey && !pX) { 6666 // if user scrolls with shift he wants horizontal scroll 6667 pX = pY; 6668 pY = 0; 6669 } 6670 if ((pX || pY) && e.deltaMode) { 6671 if (e.deltaMode === 1) { 6672 // delta in LINE units 6673 pX *= LINE_HEIGHT; 6674 pY *= LINE_HEIGHT; 6675 } else { 6676 // delta in PAGE units 6677 pX *= PAGE_HEIGHT; 6678 pY *= PAGE_HEIGHT; 6679 } 6680 } 6681 6682 // Fall-back if spin cannot be determined 6683 if (pX && !sX) { 6684 sX = pX < 1 ? -1 : 1; 6685 } 6686 if (pY && !sY) { 6687 sY = pY < 1 ? -1 : 1; 6688 } 6689 return { 6690 spinX: sX, 6691 spinY: sY, 6692 pixelX: pX, 6693 pixelY: pY 6694 }; 6695 } 6696 function handleMouseEnter() { 6697 if (!swiper.enabled) return; 6698 swiper.mouseEntered = true; 6699 } 6700 function handleMouseLeave() { 6701 if (!swiper.enabled) return; 6702 swiper.mouseEntered = false; 6703 } 6704 function animateSlider(newEvent) { 6705 if (swiper.params.mousewheel.thresholdDelta && newEvent.delta < swiper.params.mousewheel.thresholdDelta) { 6706 // Prevent if delta of wheel scroll delta is below configured threshold 6707 return false; 6708 } 6709 if (swiper.params.mousewheel.thresholdTime && (0, _utils.now)() - lastScrollTime < swiper.params.mousewheel.thresholdTime) { 6710 // Prevent if time between scrolls is below configured threshold 6711 return false; 6712 } 6713 6714 // If the movement is NOT big enough and 6715 // if the last time the user scrolled was too close to the current one (avoid continuously triggering the slider): 6716 // Don't go any further (avoid insignificant scroll movement). 6717 if (newEvent.delta >= 6 && (0, _utils.now)() - lastScrollTime < 60) { 6718 // Return false as a default 6719 return true; 6720 } 6721 // If user is scrolling towards the end: 6722 // If the slider hasn't hit the latest slide or 6723 // if the slider is a loop and 6724 // if the slider isn't moving right now: 6725 // Go to next slide and 6726 // emit a scroll event. 6727 // Else (the user is scrolling towards the beginning) and 6728 // if the slider hasn't hit the first slide or 6729 // if the slider is a loop and 6730 // if the slider isn't moving right now: 6731 // Go to prev slide and 6732 // emit a scroll event. 6733 if (newEvent.direction < 0) { 6734 if ((!swiper.isEnd || swiper.params.loop) && !swiper.animating) { 6735 swiper.slideNext(); 6736 emit('scroll', newEvent.raw); 6737 } 6738 } else if ((!swiper.isBeginning || swiper.params.loop) && !swiper.animating) { 6739 swiper.slidePrev(); 6740 emit('scroll', newEvent.raw); 6741 } 6742 // If you got here is because an animation has been triggered so store the current time 6743 lastScrollTime = new window.Date().getTime(); 6744 // Return false as a default 6745 return false;
6746 } 6747 function releaseScroll(newEvent) { 6748 var params = swiper.params.mousewheel; 6749 if (newEvent.direction < 0) { 6750 if (swiper.isEnd && !swiper.params.loop && params.releaseOnEdges) { 6751 // Return true to animate scroll on edges 6752 return true; 6753 } 6754 } else if (swiper.isBeginning && !swiper.params.loop && params.releaseOnEdges) { 6755 // Return true to animate scroll on edges 6756 return true; 6757 } 6758 return false; 6759 } 6760 function handle(event) { 6761 var e = event; 6762 var disableParentSwiper = true; 6763 if (!swiper.enabled) return; 6764 6765 // Ignore event if the target or its parents have the swiper-no-mousewheel class 6766 if (event.target.closest(".".concat(swiper.params.mousewheel.noMousewheelClass))) return; 6767 var params = swiper.params.mousewheel; 6768 if (swiper.params.cssMode) { 6769 e.preventDefault(); 6770 } 6771 var targetEl = swiper.el; 6772 if (swiper.params.mousewheel.eventsTarget !== 'container') { 6773 targetEl = document.querySelector(swiper.params.mousewheel.eventsTarget); 6774 } 6775 var targetElContainsTarget = targetEl && targetEl.contains(e.target); 6776 if (!swiper.mouseEntered && !targetElContainsTarget && !params.releaseOnEdges) return true; 6777 if (e.originalEvent) e = e.originalEvent; // jquery fix 6778 var delta = 0; 6779 var rtlFactor = swiper.rtlTranslate ? -1 : 1; 6780 var data = normalize(e); 6781 if (params.forceToAxis) { 6782 if (swiper.isHorizontal()) { 6783 if (Math.abs(data.pixelX) > Math.abs(data.pixelY)) delta = -data.pixelX * rtlFactor;else return true; 6784 } else if (Math.abs(data.pixelY) > Math.abs(data.pixelX)) delta = -data.pixelY;else return true; 6785 } else { 6786 delta = Math.abs(data.pixelX) > Math.abs(data.pixelY) ? -data.pixelX * rtlFactor : -data.pixelY; 6787 } 6788 if (delta === 0) return true; 6789 if (params.invert) delta = -delta; 6790 6791 // Get the scroll positions 6792 var positions = swiper.getTranslate() + delta * params.sensitivity; 6793 if (positions >= swiper.minTranslate()) positions = swiper.minTranslate(); 6794 if (positions <= swiper.maxTranslate()) positions = swiper.maxTranslate(); 6795 6796 // When loop is true: 6797 // the disableParentSwiper will be true. 6798 // When loop is false: 6799 // if the scroll positions is not on edge, 6800 // then the disableParentSwiper will be true. 6801 // if the scroll on edge positions, 6802 // then the disableParentSwiper will be false. 6803 disableParentSwiper = swiper.params.loop ? true : !(positions === swiper.minTranslate() || positions === swiper.maxTranslate()); 6804 if (disableParentSwiper && swiper.params.nested) e.stopPropagation(); 6805 if (!swiper.params.freeMode || !swiper.params.freeMode.enabled) { 6806 // Register the new event in a variable which stores the relevant data 6807 var newEvent = { 6808 time: (0, _utils.now)(), 6809 delta: Math.abs(delta), 6810 direction: Math.sign(delta), 6811 raw: event 6812 }; 6813 6814 // Keep the most recent events 6815 if (recentWheelEvents.length >= 2) { 6816 recentWheelEvents.shift(); // only store the last N events 6817 } 6818 6819 var prevEvent = recentWheelEvents.length ? recentWheelEvents[recentWheelEvents.length - 1] : undefined; 6820 recentWheelEvents.push(newEvent); 6821 6822 // If there is at least one previous recorded event: 6823 // If direction has changed or 6824 // if the scroll is quicker than the previous one: 6825 // Animate the slider. 6826 // Else (this is the first time the wheel is moved): 6827 // Animate the slider. 6828 if (prevEvent) { 6829 if (newEvent.direction !== prevEvent.direction || newEvent.delta > prevEvent.delta || newEvent.time > prevEvent.time + 150) { 6830 animateSlider(newEvent); 6831 } 6832 } else { 6833 animateSlider(newEvent); 6834 } 6835 6836 // If it's time to release the scroll: 6837 // Return now so you don't hit the preventDefault. 6838 if (releaseScroll(newEvent)) { 6839 return true; 6840 } 6841 } else { 6842 // Freemode or scrollContainer: 6843 6844 // If we recently snapped after a momentum scroll, then ignore wheel events 6845 // to give time for the deceleration to finish. Stop ignoring after 500 msecs 6846 // or if it's a new scroll (larger delta or inverse sign as last event before 6847 // an end-of-momentum snap). 6848 var _newEvent = { 6849 time: (0, _utils.now)(), 6850 delta: Math.abs(delta), 6851 direction: Math.sign(delta) 6852 }; 6853 var ignoreWheelEvents = lastEventBeforeSnap && _newEvent.time < lastEventBeforeSnap.time + 500 && _newEvent.delta <= lastEventBeforeSnap.delta && _newEvent.direction === lastEventBeforeSnap.direction; 6854 if (!ignoreWheelEvents) { 6855 lastEventBeforeSnap = undefined; 6856 var position = swiper.getTranslate() + delta * params.sensitivity; 6857 var wasBeginning = swiper.isBeginning; 6858 var wasEnd = swiper.isEnd; 6859 if (position >= swiper.minTranslate()) position = swiper.minTranslate(); 6860 if (position <= swiper.maxTranslate()) position = swiper.maxTranslate(); 6861 swiper.setTransition(0); 6862 swiper.setTranslate(position); 6863 swiper.updateProgress(); 6864 swiper.updateActiveIndex(); 6865 swiper.updateSlidesClasses(); 6866 if (!wasBeginning && swiper.isBeginning || !wasEnd && swiper.isEnd) { 6867 swiper.updateSlidesClasses(); 6868 } 6869 if (swiper.params.loop) { 6870 swiper.loopFix({ 6871 direction: _newEvent.direction < 0 ? 'next' : 'prev', 6872 byMousewheel: true 6873 }); 6874 } 6875 if (swiper.params.freeMode.sticky) { 6876 // When wheel scrolling starts with sticky (aka snap) enabled, then detect 6877 // the end of a momentum scroll by storing recent (N=15?) wheel events.
6878 // 1. do all N events have decreasing or same (absolute value) delta? 6879 // 2. did all N events arrive in the last M (M=500?) msecs? 6880 // 3. does the earliest event have an (absolute value) delta that's 6881 // at least P (P=1?) larger than the most recent event's delta? 6882 // 4. does the latest event have a delta that's smaller than Q (Q=6?) pixels? 6883 // If 1-4 are "yes" then we're near the end of a momentum scroll deceleration. 6884 // Snap immediately and ignore remaining wheel events in this scroll. 6885 // See comment above for "remaining wheel events in this scroll" determination. 6886 // If 1-4 aren't satisfied, then wait to snap until 500ms after the last event. 6887 clearTimeout(timeout); 6888 timeout = undefined; 6889 if (recentWheelEvents.length >= 15) { 6890 recentWheelEvents.shift(); // only store the last N events 6891 } 6892 6893 var _prevEvent = recentWheelEvents.length ? recentWheelEvents[recentWheelEvents.length - 1] : undefined; 6894 var firstEvent = recentWheelEvents[0]; 6895 recentWheelEvents.push(_newEvent); 6896 if (_prevEvent && (_newEvent.delta > _prevEvent.delta || _newEvent.direction !== _prevEvent.direction)) { 6897 // Increasing or reverse-sign delta means the user started scrolling again. Clear the wheel event log. 6898 recentWheelEvents.splice(0); 6899 } else if (recentWheelEvents.length >= 15 && _newEvent.time - firstEvent.time < 500 && firstEvent.delta - _newEvent.delta >= 1 && _newEvent.delta <= 6) { 6900 // We're at the end of the deceleration of a momentum scroll, so there's no need 6901 // to wait for more events. Snap ASAP on the next tick. 6902 // Also, because there's some remaining momentum we'll bias the snap in the 6903 // direction of the ongoing scroll because it's better UX for the scroll to snap 6904 // in the same direction as the scroll instead of reversing to snap. Therefore, 6905 // if it's already scrolled more than 20% in the current direction, keep going. 6906 var snapToThreshold = delta > 0 ? 0.8 : 0.2; 6907 lastEventBeforeSnap = _newEvent; 6908 recentWheelEvents.splice(0); 6909 timeout = (0, _utils.nextTick)(function () { 6910 swiper.slideToClosest(swiper.params.speed, true, undefined, snapToThreshold); 6911 }, 0); // no delay; move on next tick 6912 } 6913 6914 if (!timeout) { 6915 // if we get here, then we haven't detected the end of a momentum scroll, so 6916 // we'll consider a scroll "complete" when there haven't been any wheel events 6917 // for 500ms. 6918 timeout = (0, _utils.nextTick)(function () { 6919 var snapToThreshold = 0.5; 6920 lastEventBeforeSnap = _newEvent; 6921 recentWheelEvents.splice(0); 6922 swiper.slideToClosest(swiper.params.speed, true, undefined, snapToThreshold); 6923 }, 500); 6924 } 6925 } 6926 6927 // Emit event 6928 if (!ignoreWheelEvents) emit('scroll', e); 6929 6930 // Stop autoplay 6931 if (swiper.params.autoplay && swiper.params.autoplayDisableOnInteraction) swiper.autoplay.stop(); 6932 // Return page scroll on edge positions 6933 if (position === swiper.minTranslate() || position === swiper.maxTranslate()) return true; 6934 } 6935 } 6936 if (e.preventDefault) e.preventDefault();else e.returnValue = false; 6937 return false; 6938 } 6939 function events(method) { 6940 var targetEl = swiper.el; 6941 if (swiper.params.mousewheel.eventsTarget !== 'container') { 6942 targetEl = document.querySelector(swiper.params.mousewheel.eventsTarget); 6943 } 6944 targetEl[method]('mouseenter', handleMouseEnter); 6945 targetEl[method]('mouseleave', handleMouseLeave); 6946 targetEl[method]('wheel', handle); 6947 } 6948 function enable() { 6949 if (swiper.params.cssMode) { 6950 swiper.wrapperEl.removeEventListener('wheel', handle); 6951 return true; 6952 } 6953 if (swiper.mousewheel.enabled) return false; 6954 events('addEventListener'); 6955 swiper.mousewheel.enabled = true; 6956 return true; 6957 } 6958 function disable() { 6959 if (swiper.params.cssMode) { 6960 swiper.wrapperEl.addEventListener(event, handle); 6961 return true; 6962 } 6963 if (!swiper.mousewheel.enabled) return false;
6964 events('removeEventListener'); 6965 swiper.mousewheel.enabled = false; 6966 return true; 6967 } 6968 on('init', function () { 6969 if (!swiper.params.mousewheel.enabled && swiper.params.cssMode) { 6970 disable(); 6971 } 6972 if (swiper.params.mousewheel.enabled) enable(); 6973 }); 6974 on('destroy', function () { 6975 if (swiper.params.cssMode) { 6976 enable(); 6977 } 6978 if (swiper.mousewheel.enabled) disable(); 6979 }); 6980 Object.assign(swiper.mousewheel, { 6981 enable: enable, 6982 disable: disable 6983 }); 6984} 6985 6986},{"../../shared/utils.js":97,"ssr-window":1}],80:[function(require,module,exports){ 6987"use strict"; 6988 6989Object.defineProperty(exports, "__esModule", { 6990 value: true 6991}); 6992exports["default"] = Navigation; 6993var _createElementIfNotDefined = _interopRequireDefault(require("../../shared/create-element-if-not-defined.js")); 6994function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } 6995function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } 6996function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } 6997function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } 6998function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } 6999function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } 7000function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } 7001function Navigation(_ref) { 7002 var swiper = _ref.swiper, 7003 extendParams = _ref.extendParams, 7004 on = _ref.on, 7005 emit = _ref.emit; 7006 extendParams({ 7007 navigation: { 7008 nextEl: null, 7009 prevEl: null, 7010 hideOnClick: false, 7011 disabledClass: 'swiper-button-disabled', 7012 hiddenClass: 'swiper-button-hidden', 7013 lockClass: 'swiper-button-lock', 7014 navigationDisabledClass: 'swiper-navigation-disabled' 7015 } 7016 }); 7017 swiper.navigation = { 7018 nextEl: null, 7019 prevEl: null 7020 }; 7021 var makeElementsArray = function makeElementsArray(el) { 7022 if (!Array.isArray(el)) el = [el].filter(function (e) { 7023 return !!e; 7024 }); 7025 return el; 7026 }; 7027 function getEl(el) { 7028 var res; 7029 if (el && typeof el === 'string' && swiper.isElement) { 7030 res = swiper.el.shadowRoot.querySelector(el); 7031 if (res) return res; 7032 } 7033 if (el) { 7034 if (typeof el === 'string') res = _toConsumableArray(document.querySelectorAll(el)); 7035 if (swiper.params.uniqueNavElements && typeof el === 'string' && res.length > 1 && swiper.el.querySelectorAll(el).length === 1) { 7036 res = swiper.el.querySelector(el); 7037 } 7038 } 7039 if (el && !res) return el; 7040 // if (Array.isArray(res) && res.length === 1) res = res[0]; 7041 return res; 7042 } 7043 function toggleEl(el, disabled) { 7044 var params = swiper.params.navigation; 7045 el = makeElementsArray(el); 7046 el.forEach(function (subEl) { 7047 if (subEl) { 7048 var _subEl$classList; 7049 (_subEl$classList = subEl.classList)[disabled ? 'add' : 'remove'].apply(_subEl$classList, _toConsumableArray(params.disabledClass.split(' '))); 7050 if (subEl.tagName === 'BUTTON') subEl.disabled = disabled; 7051 if (swiper.params.watchOverflow && swiper.enabled) { 7052 subEl.classList[swiper.isLocked ? 'add' : 'remove'](params.lockClass); 7053 } 7054 } 7055 }); 7056 } 7057 function update() { 7058 // Update Navigation Buttons 7059 var _swiper$navigation = swiper.navigation, 7060 nextEl = _swiper$navigation.nextEl, 7061 prevEl = _swiper$navigation.prevEl; 7062 if (swiper.params.loop) { 7063 toggleEl(prevEl, false); 7064 toggleEl(nextEl, false); 7065 return; 7066 } 7067 toggleEl(prevEl, swiper.isBeginning && !swiper.params.rewind); 7068 toggleEl(nextEl, swiper.isEnd && !swiper.params.rewind); 7069 } 7070 function onPrevClick(e) { 7071 e.preventDefault(); 7072 if (swiper.isBeginning && !swiper.params.loop && !swiper.params.rewind) return; 7073 swiper.slidePrev(); 7074 emit('navigationPrev'); 7075 } 7076 function onNextClick(e) { 7077 e.preventDefault(); 7078 if (swiper.isEnd && !swiper.params.loop && !swiper.params.rewind) return; 7079 swiper.slideNext(); 7080 emit('navigationNext'); 7081 }
7082 function init() { 7083 var params = swiper.params.navigation; 7084 swiper.params.navigation = (0, _createElementIfNotDefined["default"])(swiper, swiper.originalParams.navigation, swiper.params.navigation, { 7085 nextEl: 'swiper-button-next', 7086 prevEl: 'swiper-button-prev' 7087 }); 7088 if (!(params.nextEl || params.prevEl)) return; 7089 var nextEl = getEl(params.nextEl); 7090 var prevEl = getEl(params.prevEl); 7091 Object.assign(swiper.navigation, { 7092 nextEl: nextEl, 7093 prevEl: prevEl 7094 }); 7095 nextEl = makeElementsArray(nextEl); 7096 prevEl = makeElementsArray(prevEl); 7097 var initButton = function initButton(el, dir) { 7098 if (el) { 7099 el.addEventListener('click', dir === 'next' ? onNextClick : onPrevClick); 7100 } 7101 if (!swiper.enabled && el) { 7102 var _el$classList; 7103 (_el$classList = el.classList).add.apply(_el$classList, _toConsumableArray(params.lockClass.split(' '))); 7104 } 7105 }; 7106 nextEl.forEach(function (el) { 7107 return initButton(el, 'next'); 7108 }); 7109 prevEl.forEach(function (el) { 7110 return initButton(el, 'prev'); 7111 }); 7112 } 7113 function destroy() { 7114 var _swiper$navigation2 = swiper.navigation, 7115 nextEl = _swiper$navigation2.nextEl, 7116 prevEl = _swiper$navigation2.prevEl; 7117 nextEl = makeElementsArray(nextEl); 7118 prevEl = makeElementsArray(prevEl); 7119 var destroyButton = function destroyButton(el, dir) { 7120 var _el$classList2; 7121 el.removeEventListener('click', dir === 'next' ? onNextClick : onPrevClick); 7122 (_el$classList2 = el.classList).remove.apply(_el$classList2, _toConsumableArray(swiper.params.navigation.disabledClass.split(' '))); 7123 }; 7124 nextEl.forEach(function (el) { 7125 return destroyButton(el, 'next'); 7126 }); 7127 prevEl.forEach(function (el) { 7128 return destroyButton(el, 'prev'); 7129 }); 7130 } 7131 on('init', function () { 7132 if (swiper.params.navigation.enabled === false) { 7133 // eslint-disable-next-line 7134 disable(); 7135 } else { 7136 init(); 7137 update(); 7138 } 7139 }); 7140 on('toEdge fromEdge lock unlock', function () { 7141 update(); 7142 }); 7143 on('destroy', function () { 7144 destroy(); 7145 }); 7146 on('enable disable', function () { 7147 var _swiper$navigation3 = swiper.navigation, 7148 nextEl = _swiper$navigation3.nextEl, 7149 prevEl = _swiper$navigation3.prevEl; 7150 nextEl = makeElementsArray(nextEl); 7151 prevEl = makeElementsArray(prevEl); 7152 [].concat(_toConsumableArray(nextEl), _toConsumableArray(prevEl)).filter(function (el) { 7153 return !!el; 7154 }
7154).forEach(function (el) { 7155 return el.classList[swiper.enabled ? 'remove' : 'add'](swiper.params.navigation.lockClass); 7156 }); 7157 }); 7158 on('click', function (_s, e) { 7159 var _swiper$navigation4 = swiper.navigation, 7160 nextEl = _swiper$navigation4.nextEl, 7161 prevEl = _swiper$navigation4.prevEl; 7162 nextEl = makeElementsArray(nextEl); 7163 prevEl = makeElementsArray(prevEl); 7164 var targetEl = e.target; 7165 if (swiper.params.navigation.hideOnClick && !prevEl.includes(targetEl) && !nextEl.includes(targetEl)) { 7166 if (swiper.pagination && swiper.params.pagination && swiper.params.pagination.clickable && (swiper.pagination.el === targetEl || swiper.pagination.el.contains(targetEl))) return; 7167 var isHidden; 7168 if (nextEl.length) { 7169 isHidden = nextEl[0].classList.contains(swiper.params.navigation.hiddenClass); 7170 } else if (prevEl.length) { 7171 isHidden = prevEl[0].classList.contains(swiper.params.navigation.hiddenClass); 7172 } 7173 if (isHidden === true) { 7174 emit('navigationShow'); 7175 } else { 7176 emit('navigationHide'); 7177 } 7178 [].concat(_toConsumableArray(nextEl), _toConsumableArray(prevEl)).filter(function (el) { 7179 return !!el; 7180 }
7180).forEach(function (el) { 7181 return el.classList.toggle(swiper.params.navigation.hiddenClass); 7182 }); 7183 } 7184 }); 7185 var enable = function enable() { 7186 var _swiper$el$classList; 7187 (_swiper$el$classList = swiper.el.classList).remove.apply(_swiper$el$classList, _toConsumableArray(swiper.params.navigation.navigationDisabledClass.split(' '))); 7188 init(); 7189 update(); 7190 }; 7191 var disable = function disable() { 7192 var _swiper$el$classList2; 7193 (_swiper$el$classList2 = swiper.el.classList).add.apply(_swiper$el$classList2, _toConsumableArray(swiper.params.navigation.navigationDisabledClass.split(' '))); 7194 destroy(); 7195 }; 7196 Object.assign(swiper.navigation, { 7197 enable: enable, 7198 disable: disable, 7199 update: update, 7200 init: init, 7201 destroy: destroy 7202 }); 7203} 7204 7205},{"../../shared/create-element-if-not-defined.js":88}],81:[function(require,module,exports){ 7206"use strict"; 7207 7208Object.defineProperty(exports, "__esModule", { 7209 value: true 7210}); 7211exports["default"] = Pagination; 7212var _classesToSelector = _interopRequireDefault(require("../../shared/classes-to-selector.js")); 7213var _createElementIfNotDefined = _interopRequireDefault(require("../../shared/create-element-if-not-defined.js")); 7214var _utils = require("../../shared/utils.js"); 7215function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } 7216function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } 7217function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } 7218function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } 7219function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } 7220function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } 7221function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } 7222function Pagination(_ref) { 7223 var swiper = _ref.swiper, 7224 extendParams = _ref.extendParams, 7225 on = _ref.on, 7226 emit = _ref.emit; 7227 var pfx = 'swiper-pagination'; 7228 extendParams({ 7229 pagination: { 7230 el: null, 7231 bulletElement: 'span', 7232 clickable: false, 7233 hideOnClick: false, 7234 renderBullet: null, 7235 renderProgressbar: null, 7236 renderFraction: null, 7237 renderCustom: null, 7238 progressbarOpposite: false, 7239 type: 'bullets', 7240 // 'bullets' or 'progressbar' or 'fraction' or 'custom' 7241 dynamicBullets: false, 7242 dynamicMainBullets: 1, 7243 formatFractionCurrent: function formatFractionCurrent(number) { 7244 return number; 7245 }, 7246 formatFractionTotal: function formatFractionTotal(number) { 7247 return number; 7248 }, 7249 bulletClass: "".concat(pfx, "-bullet"), 7250 bulletActiveClass: "".concat(pfx, "-bullet-active"), 7251 modifierClass: "".concat(pfx, "-"), 7252 currentClass: "".concat(pfx, "-current"), 7253 totalClass: "".concat(pfx, "-total"), 7254 hiddenClass: "".concat(pfx, "-hidden"), 7255 progressbarFillClass: "".concat(pfx, "-progressbar-fill"), 7256 progressbarOppositeClass: "".concat(pfx, "-progressbar-opposite"), 7257 clickableClass: "".concat(pfx, "-clickable"), 7258 lockClass: "".concat(pfx, "-lock"), 7259 horizontalClass: "".concat(pfx, "-horizontal"), 7260 verticalClass: "".concat(pfx, "-vertical"), 7261 paginationDisabledClass: "".concat(pfx, "-disabled") 7262 } 7263 }); 7264 swiper.pagination = { 7265 el: null, 7266 bullets: [] 7267 }; 7268 var bulletSize; 7269 var dynamicBulletIndex = 0; 7270 var makeElementsArray = function makeElementsArray(el) { 7271 if (!Array.isArray(el)) el = [el].filter(function (e) { 7272 return !!e; 7273 }); 7274 return el; 7275 }; 7276 function isPaginationDisabled() { 7277 return !swiper.params.pagination.el || !swiper.pagination.el || Array.isArray(swiper.pagination.el) && swiper.pagination.el.length === 0; 7278 } 7279 function setSideBullets(bulletEl, position) { 7280 var bulletActiveClass = swiper.params.pagination.bulletActiveClass; 7281 if (!bulletEl) return; 7282 bulletEl = bulletEl["".concat(position === 'prev' ? 'previous' : 'next', "ElementSibling")]; 7283 if (bulletEl) { 7284 bulletEl.classList.add("".concat(bulletActiveClass, "-").concat(position)); 7285 bulletEl = bulletEl["".concat(position === 'prev' ? 'previous' : 'next', "ElementSibling")]; 7286 if (bulletEl) { 7287 bulletEl.classList.add("".concat(bulletActiveClass, "-").concat(position, "-").concat(position)); 7288 } 7289 } 7290 } 7291 function onBulletClick(e) { 7292 var bulletEl = e.target.closest((0, _classesToSelector["default"])(swiper.params.pagination.bulletClass)); 7293 if (!bulletEl) { 7294 return; 7295 } 7296 e.preventDefault(); 7297 var index = (0, _utils.elementIndex)(bulletEl) * swiper.params.slidesPerGroup; 7298 if (swiper.params.loop) { 7299 if (swiper.realIndex === index) return; 7300 var newSlideIndex = swiper.getSlideIndexByData(index); 7301 var currentSlideIndex = swiper.getSlideIndexByData(swiper.realIndex); 7302 if (newSlideIndex > swiper.slides.length - swiper.loopedSlides) { 7303 swiper.loopFix({ 7304 direction: newSlideIndex > currentSlideIndex ? 'next' : 'prev', 7305 activeSlideIndex: newSlideIndex, 7306 slideTo: false 7307 }); 7308 } 7309 swiper.slideToLoop(index); 7310 } else { 7311 swiper.slideTo(index); 7312 } 7313 }
7314 function update() { 7315 // Render || Update Pagination bullets/items 7316 var rtl = swiper.rtl; 7317 var params = swiper.params.pagination; 7318 if (isPaginationDisabled()) return; 7319 var el = swiper.pagination.el; 7320 el = makeElementsArray(el); 7321 // Current/Total 7322 var current; 7323 var previousIndex; 7324 var slidesLength = swiper.virtual && swiper.params.virtual.enabled ? swiper.virtual.slides.length : swiper.slides.length; 7325 var total = swiper.params.loop ? Math.ceil(slidesLength / swiper.params.slidesPerGroup) : swiper.snapGrid.length; 7326 if (swiper.params.loop) { 7327 previousIndex = swiper.previousRealIndex || 0; 7328 current = swiper.params.slidesPerGroup > 1 ? Math.floor(swiper.realIndex / swiper.params.slidesPerGroup) : swiper.realIndex; 7329 } else if (typeof swiper.snapIndex !== 'undefined') { 7330 current = swiper.snapIndex; 7331 previousIndex = swiper.previousSnapIndex; 7332 } else { 7333 previousIndex = swiper.previousIndex || 0; 7334 current = swiper.activeIndex || 0; 7335 } 7336 // Types 7337 if (params.type === 'bullets' && swiper.pagination.bullets && swiper.pagination.bullets.length > 0) { 7338 var bullets = swiper.pagination.bullets; 7339 var firstIndex; 7340 var lastIndex; 7341 var midIndex; 7342 if (params.dynamicBullets) { 7343 bulletSize = (0, _utils.elementOuterSize)(bullets[0], swiper.isHorizontal() ? 'width' : 'height', true); 7344 el.forEach(function (subEl) { 7345 subEl.style[swiper.isHorizontal() ? 'width' : 'height'] = "".concat(bulletSize * (params.dynamicMainBullets + 4), "px"); 7346 }); 7347 if (params.dynamicMainBullets > 1 && previousIndex !== undefined) { 7348 dynamicBulletIndex += current - (previousIndex || 0); 7349 if (dynamicBulletIndex > params.dynamicMainBullets - 1) { 7350 dynamicBulletIndex = params.dynamicMainBullets - 1; 7351 } else if (dynamicBulletIndex < 0) { 7352 dynamicBulletIndex = 0; 7353 } 7354 } 7355 firstIndex = Math.max(current - dynamicBulletIndex, 0); 7356 lastIndex = firstIndex + (Math.min(bullets.length, params.dynamicMainBullets) - 1); 7357 midIndex = (lastIndex + firstIndex) / 2; 7358 } 7359 bullets.forEach(function (bulletEl) { 7360 var _bulletEl$classList; 7361 var classesToRemove = _toConsumableArray(['', '-next', '-next-next', '-prev', '-prev-prev', '-main'].map(function (suffix) { 7362 return "".concat(params.bulletActiveClass).concat(suffix); 7363 })).map(function (s) { 7364 return typeof s === 'string' && s.includes(' ') ? s.split(' ') : s; 7365 }).flat(); 7366 (_bulletEl$classList = bulletEl.classList).remove.apply(_bulletEl$classList, _toConsumableArray(classesToRemove)); 7367 }); 7368 if (el.length > 1) { 7369 bullets.forEach(function (bullet) { 7370 var bulletIndex = (0, _utils.elementIndex)(bullet); 7371 if (bulletIndex === current) { 7372 var _bullet$classList; 7373 (_bullet$classList = bullet.classList).add.apply(_bullet$classList, _toConsumableArray(params.bulletActiveClass.split(' '))); 7374 } 7375 if (params.dynamicBullets) { 7376 if (bulletIndex >= firstIndex && bulletIndex <= lastIndex) { 7377 var _bullet$classList2; 7378 (_bullet$classList2 = bullet.classList).add.apply(_bullet$classList2, _toConsumableArray("".concat(params.bulletActiveClass, "-main").split(' '))); 7379 } 7380 if (bulletIndex === firstIndex) { 7381 setSideBullets(bullet, 'prev'); 7382 } 7383 if (bulletIndex === lastIndex) { 7384 setSideBullets(bullet, 'next'); 7385 } 7386 } 7387 }); 7388 } else { 7389 var bullet = bullets[current]; 7390 if (bullet) { 7391 var _bullet$classList3; 7392 (_bullet$classList3 = bullet.classList).add.apply(_bullet$classList3, _toConsumableArray(params.bulletActiveClass.split(' '))); 7393 } 7394 if (params.dynamicBullets) { 7395 var firstDisplayedBullet = bullets[firstIndex]; 7396 var lastDisplayedBullet = bullets[lastIndex]; 7397 for (var i = firstIndex; i <= lastIndex; i += 1) { 7398 if (bullets[i]) { 7399 var _bullets$i$classList; 7400 (_bullets$i$classList = bullets[i].classList).add.apply(_bullets$i$classList, _toConsumableArray("".concat(params.bulletActiveClass, "-main").split(' '))); 7401 } 7402 } 7403 setSideBullets(firstDisplayedBullet, 'prev'); 7404 setSideBullets(lastDisplayedBullet, 'next'); 7405 } 7406 } 7407 if (params.dynamicBullets) { 7408 var dynamicBulletsLength = Math.min(bullets.length, params.dynamicMainBullets + 4); 7409 var bulletsOffset = (bulletSize * dynamicBulletsLength - bulletSize) / 2 - midIndex * bulletSize; 7410 var offsetProp = rtl ? 'right' : 'left';
7411 bullets.forEach(function (bullet) { 7412 bullet.style[swiper.isHorizontal() ? offsetProp : 'top'] = "".concat(bulletsOffset, "px"); 7413 }); 7414 } 7415 } 7416 el.forEach(function (subEl, subElIndex) { 7417 if (params.type === 'fraction') { 7418 subEl.querySelectorAll((0, _classesToSelector["default"])(params.currentClass)).forEach(function (fractionEl) { 7419 fractionEl.textContent = params.formatFractionCurrent(current + 1); 7420 }); 7421 subEl.querySelectorAll((0, _classesToSelector["default"])(params.totalClass)).forEach(function (totalEl) { 7422 totalEl.textContent = params.formatFractionTotal(total); 7423 }); 7424 } 7425 if (params.type === 'progressbar') { 7426 var progressbarDirection; 7427 if (params.progressbarOpposite) { 7428 progressbarDirection = swiper.isHorizontal() ? 'vertical' : 'horizontal'; 7429 } else { 7430 progressbarDirection = swiper.isHorizontal() ? 'horizontal' : 'vertical'; 7431 } 7432 var scale = (current + 1) / total; 7433 var scaleX = 1; 7434 var scaleY = 1; 7435 if (progressbarDirection === 'horizontal') { 7436 scaleX = scale; 7437 } else { 7438 scaleY = scale; 7439 } 7440 subEl.querySelectorAll((0, _classesToSelector["default"])(params.progressbarFillClass)).forEach(function (progressEl) { 7441 progressEl.style.transform = "translate3d(0,0,0) scaleX(".concat(scaleX, ") scaleY(").concat(scaleY, ")"); 7442 progressEl.style.transitionDuration = "".concat(swiper.params.speed, "ms"); 7443 }); 7444 } 7445 if (params.type === 'custom' && params.renderCustom) { 7446 subEl.innerHTML = params.renderCustom(swiper, current + 1, total); 7447 if (subElIndex === 0) emit('paginationRender', subEl); 7448 } else { 7449 if (subElIndex === 0) emit('paginationRender', subEl); 7450 emit('paginationUpdate', subEl); 7451 } 7452 if (swiper.params.watchOverflow && swiper.enabled) { 7453 subEl.classList[swiper.isLocked ? 'add' : 'remove'](params.lockClass); 7454 } 7455 }); 7456 } 7457 function render() { 7458 // Render Container 7459 var params = swiper.params.pagination; 7460 if (isPaginationDisabled()) return; 7461 var slidesLength = swiper.virtual && swiper.params.virtual.enabled ? swiper.virtual.slides.length : swiper.slides.length; 7462 var el = swiper.pagination.el; 7463 el = makeElementsArray(el); 7464 var paginationHTML = ''; 7465 if (params.type === 'bullets') { 7466 var numberOfBullets = swiper.params.loop ? Math.ceil(slidesLength / swiper.params.slidesPerGroup) : swiper.snapGrid.length; 7467 if (swiper.params.freeMode && swiper.params.freeMode.enabled && numberOfBullets > slidesLength) { 7468 numberOfBullets = slidesLength; 7469 } 7470 for (var i = 0; i < numberOfBullets; i += 1) { 7471 if (params.renderBullet) { 7472 paginationHTML += params.renderBullet.call(swiper, i, params.bulletClass); 7473 } else { 7474 paginationHTML += "<".concat(params.bulletElement, " class=\"").concat(params.bulletClass, "\"></").concat(params.bulletElement, ">"); 7475 } 7476 } 7477 } 7478 if (params.type === 'fraction') { 7479 if (params.renderFraction) { 7480 paginationHTML = params.renderFraction.call(swiper, params.currentClass, params.totalClass); 7481 } else { 7482 paginationHTML = "<span class=\"".concat(params.currentClass, "\"></span>") + ' / ' + "<span class=\"".concat(params.totalClass, "\"></span>"); 7483 } 7484 } 7485 if (params.type === 'progressbar') { 7486 if (params.renderProgressbar) { 7487 paginationHTML = params.renderProgressbar.call(swiper, params.progressbarFillClass); 7488 } else { 7489 paginationHTML = "<span class=\"".concat(params.progressbarFillClass, "\"></span>"); 7490 } 7491 } 7492 swiper.pagination.bullets = []; 7493 el.forEach(function (subEl) { 7494 if (params.type !== 'custom') { 7495 subEl.innerHTML = paginationHTML || ''; 7496 } 7497 if (params.type === 'bullets') { 7498 var _swiper$pagination$bu; 7499 (_swiper$pagination$bu = swiper.pagination.bullets).push.apply(_swiper$pagination$bu, _toConsumableArray(subEl.querySelectorAll((0, _classesToSelector["default"])(params.bulletClass)))); 7500 } 7501 }); 7502 if (params.type !== 'custom') { 7503 emit('paginationRender', el[0]); 7504 } 7505 }
7506 function init() { 7507 swiper.params.pagination = (0, _createElementIfNotDefined["default"])(swiper, swiper.originalParams.pagination, swiper.params.pagination, { 7508 el: 'swiper-pagination' 7509 }); 7510 var params = swiper.params.pagination; 7511 if (!params.el) return; 7512 var el; 7513 if (typeof params.el === 'string' && swiper.isElement) { 7514 el = swiper.el.shadowRoot.querySelector(params.el); 7515 } 7516 if (!el && typeof params.el === 'string') { 7517 el = _toConsumableArray(document.querySelectorAll(params.el)); 7518 } 7519 if (!el) { 7520 el = params.el; 7521 } 7522 if (!el || el.length === 0) return; 7523 if (swiper.params.uniqueNavElements && typeof params.el === 'string' && Array.isArray(el) && el.length > 1) { 7524 el = _toConsumableArray(swiper.el.querySelectorAll(params.el)); 7525 // check if it belongs to another nested Swiper 7526 if (el.length > 1) { 7527 el = el.filter(function (subEl) { 7528 if ((0, _utils.elementParents)(subEl, '.swiper')[0] !== swiper.el) return false; 7529 return true; 7530 })[0]; 7531 } 7532 } 7533 if (Array.isArray(el) && el.length === 1) el = el[0]; 7534 Object.assign(swiper.pagination, { 7535 el: el 7536 }); 7537 el = makeElementsArray(el); 7538 el.forEach(function (subEl) { 7539 if (params.type === 'bullets' && params.clickable) { 7540 subEl.classList.add(params.clickableClass); 7541 } 7542 subEl.classList.add(params.modifierClass + params.type); 7543 subEl.classList.add(swiper.isHorizontal() ? params.horizontalClass : params.verticalClass); 7544 if (params.type === 'bullets' && params.dynamicBullets) { 7545 subEl.classList.add("".concat(params.modifierClass).concat(params.type, "-dynamic")); 7546 dynamicBulletIndex = 0; 7547 if (params.dynamicMainBullets < 1) { 7548 params.dynamicMainBullets = 1; 7549 } 7550 } 7551 if (params.type === 'progressbar' && params.progressbarOpposite) { 7552 subEl.classList.add(params.progressbarOppositeClass); 7553 } 7554 if (params.clickable) { 7555 subEl.addEventListener('click', onBulletClick); 7556 } 7557 if (!swiper.enabled) { 7558 subEl.classList.add(params.lockClass); 7559 } 7560 }); 7561 } 7562 function destroy() { 7563 var params = swiper.params.pagination; 7564 if (isPaginationDisabled()) return; 7565 var el = swiper.pagination.el; 7566 if (el) { 7567 el = makeElementsArray(el); 7568 el.forEach(function (subEl) { 7569 subEl.classList.remove(params.hiddenClass); 7570 subEl.classList.remove(params.modifierClass + params.type); 7571 subEl.classList.remove(swiper.isHorizontal() ? params.horizontalClass : params.verticalClass); 7572 if (params.clickable) { 7573 subEl.removeEventListener('click', onBulletClick); 7574 } 7575 }); 7576 } 7577 if (swiper.pagination.bullets) swiper.pagination.bullets.forEach(function (subEl) { 7578 var _subEl$classList; 7579 return (_subEl$classList = subEl.classList).remove.apply(_subEl$classList, _toConsumableArray(params.bulletActiveClass.split(' '))); 7580 }); 7581 } 7582 on('changeDirection', function () { 7583 if (!swiper.pagination || !swiper.pagination.el) return; 7584 var params = swiper.params.pagination; 7585 var el = swiper.pagination.el; 7586 el = makeElementsArray(el); 7587 el.forEach(function (subEl) { 7588 subEl.classList.remove(params.horizontalClass, params.verticalClass); 7589 subEl.classList.add(swiper.isHorizontal() ? params.horizontalClass : params.verticalClass); 7590 }); 7591 }); 7592 on('init', function () { 7593 if (swiper.params.pagination.enabled === false) { 7594 // eslint-disable-next-line 7595 disable(); 7596 } else { 7597 init(); 7598 render(); 7599 update(); 7600 } 7601 }); 7602 on('activeIndexChange', function () { 7603 if (typeof swiper.snapIndex === 'undefined') { 7604 update(); 7605 } 7606 }); 7607 on('snapIndexChange', function () { 7608 update(); 7609 }); 7610 on('snapGridLengthChange', function () { 7611 render(); 7612 update(); 7613 }); 7614 on('destroy', function () { 7615 destroy(); 7616 }); 7617 on('enable disable', function () { 7618 var el = swiper.pagination.el; 7619 if (el) { 7620 el = makeElementsArray(el); 7621 el.forEach(function (subEl) { 7622 return subEl.classList[swiper.enabled ? 'remove' : 'add'](swiper.params.pagination.lockClass); 7623 }); 7624 } 7625 }); 7626 on('lock unlock', function () { 7627 update(); 7628 }); 7629 on('click', function (_s, e) { 7630 var targetEl = e.target; 7631 var el = swiper.pagination.el; 7632 if (!Array.isArray(el)) el = [el].filter(function (element) { 7633 return !!element; 7634 }); 7635 if (swiper.params.pagination.el && swiper.params.pagination.hideOnClick && el && el.length > 0 && !targetEl.classList.contains(swiper.params.pagination.bulletClass)) { 7636 if (swiper.navigation && (swiper.navigation.nextEl && targetEl === swiper.navigation.nextEl || swiper.navigation.prevEl && targetEl === swiper.navigation.prevEl)) return; 7637 var isHidden = el[0].classList.contains(swiper.params.pagination.hiddenClass); 7638 if (isHidden === true) { 7639 emit('paginationShow'); 7640 } else { 7641 emit('paginationHide'); 7642 } 7643 el.forEach(function (subEl) { 7644 return subEl.classList.toggle(swiper.params.pagination.hiddenClass); 7645 }); 7646 } 7647 }); 7648 var enable = function enable() { 7649 swiper.el.classList.remove(swiper.params.pagination.paginationDisabledClass); 7650 var el = swiper.pagination.el; 7651 if (el) { 7652 el = makeElementsArray(el); 7653 el.forEach(function (subEl) { 7654 return subEl.classList.remove(swiper.params.pagination.paginationDisabledClass); 7655 }); 7656 } 7657 init(); 7658 render(); 7659 update(); 7660 }; 7661 var disable = function disable() { 7662 swiper.el.classList.add(swiper.params.pagination.paginationDisabledClass); 7663 var el = swiper.pagination.el; 7664 if (el) { 7665 el = makeElementsArray(el); 7666 el.forEach(function (subEl) { 7667 return subEl.classList.add(swiper.params.pagination.paginationDisabledClass); 7668 }); 7669 } 7670 destroy(); 7671 }; 7672 Object.assign(swiper.pagination, { 7673 enable: enable, 7674 disable: disable, 7675 render: render, 7676 update: update, 7677 init: init, 7678 destroy: destroy 7679 }); 7680} 7681 7682},{"../../shared/classes-to-selector.js":87,"../../shared/create-element-if-not-defined.js":88,"../../shared/utils.js":97}],82:[function(require,module,exports){ 7683"use strict"; 7684 7685Object.defineProperty(exports, "__esModule", { 7686 value: true 7687}); 7688exports["default"] = Parallax; 7689var _utils = require("../../shared/utils.js"); 7690function Parallax(_ref) { 7691 var swiper = _ref.swiper, 7692 extendParams = _ref.extendParams, 7693 on = _ref.on; 7694 extendParams({ 7695 parallax: { 7696 enabled: false 7697 } 7698 }); 7699 var setTransform = function setTransform(el, progress) { 7700 var rtl = swiper.rtl; 7701 var rtlFactor = rtl ? -1 : 1; 7702 var p = el.getAttribute('data-swiper-parallax') || '0'; 7703 var x = el.getAttribute('data-swiper-parallax-x'); 7704 var y = el.getAttribute('data-swiper-parallax-y'); 7705 var scale = el.getAttribute('data-swiper-parallax-scale'); 7706 var opacity = el.getAttribute('data-swiper-parallax-opacity'); 7707 var rotate = el.getAttribute('data-swiper-parallax-rotate'); 7708 if (x || y) { 7709 x = x || '0'; 7710 y = y || '0'; 7711 } else if (swiper.isHorizontal()) { 7712 x = p; 7713 y = '0'; 7714 } else { 7715 y = p; 7716 x = '0'; 7717 } 7718 if (x.indexOf('%') >= 0) { 7719 x = "".concat(parseInt(x, 10) * progress * rtlFactor, "%"); 7720 } else { 7721 x = "".concat(x * progress * rtlFactor, "px"); 7722 } 7723 if (y.indexOf('%') >= 0) { 7724 y = "".concat(parseInt(y, 10) * progress, "%"); 7725 } else { 7726 y = "".concat(y * progress, "px"); 7727 } 7728 if (typeof opacity !== 'undefined' && opacity !== null) { 7729 var currentOpacity = opacity - (opacity - 1) * (1 - Math.abs(progress)); 7730 el.style.opacity = currentOpacity; 7731 } 7732 var transform = "translate3d(".concat(x, ", ").concat(y, ", 0px)"); 7733 if (typeof scale !== 'undefined' && scale !== null) { 7734 var currentScale = scale - (scale - 1) * (1 - Math.abs(progress)); 7735 transform += " scale(".concat(currentScale, ")"); 7736 } 7737 if (rotate && typeof rotate !== 'undefined' && rotate !== null) { 7738 var currentRotate = rotate * progress * -1; 7739 transform += " rotate(".concat(currentRotate, "deg)"); 7740 } 7741 el.style.transform = transform; 7742 }; 7743 var setTranslate = function setTranslate() { 7744 var el = swiper.el, 7745 slides = swiper.slides, 7746 progress = swiper.progress, 7747 snapGrid = swiper.snapGrid; 7748 (0, _utils.elementChildren)(el, '[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]').forEach(function (subEl) { 7749 setTransform(subEl, progress); 7750 });
7751 slides.forEach(function (slideEl, slideIndex) { 7752 var slideProgress = slideEl.progress; 7753 if (swiper.params.slidesPerGroup > 1 && swiper.params.slidesPerView !== 'auto') { 7754 slideProgress += Math.ceil(slideIndex / 2) - progress * (snapGrid.length - 1); 7755 } 7756 slideProgress = Math.min(Math.max(slideProgress, -1), 1); 7757 slideEl.querySelectorAll('[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale], [data-swiper-parallax-rotate]').forEach(function (subEl) { 7758 setTransform(subEl, slideProgress); 7759 }); 7760 }); 7761 }; 7762 var setTransition = function setTransition() { 7763 var duration = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : swiper.params.speed; 7764 var el = swiper.el; 7765 el.querySelectorAll('[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]').forEach(function (parallaxEl) { 7766 var parallaxDuration = parseInt(parallaxEl.getAttribute('data-swiper-parallax-duration'), 10) || duration; 7767 if (duration === 0) parallaxDuration = 0; 7768 parallaxEl.style.transitionDuration = "".concat(parallaxDuration, "ms"); 7769 }); 7770 }; 7771 on('beforeInit', function () { 7772 if (!swiper.params.parallax.enabled) return; 7773 swiper.params.watchSlidesProgress = true; 7774 swiper.originalParams.watchSlidesProgress = true; 7775 }); 7776 on('init', function () { 7777 if (!swiper.params.parallax.enabled) return; 7778 setTranslate(); 7779 }); 7780 on('setTranslate', function () { 7781 if (!swiper.params.parallax.enabled) return; 7782 setTranslate(); 7783 }); 7784 on('setTransition', function (_swiper, duration) { 7785 if (!swiper.params.parallax.enabled) return; 7786 setTransition(duration); 7787 }); 7788} 7789 7790},{"../../shared/utils.js":97}],83:[function(require,module,exports){ 7791"use strict"; 7792 7793Object.defineProperty(exports, "__esModule", { 7794 value: true 7795}); 7796exports["default"] = Scrollbar; 7797var _ssrWindow = require("ssr-window"); 7798var _utils = require("../../shared/utils.js"); 7799var _createElementIfNotDefined = _interopRequireDefault(require("../../shared/create-element-if-not-defined.js")); 7800function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } 7801function Scrollbar(_ref) { 7802 var swiper = _ref.swiper, 7803 extendParams = _ref.extendParams, 7804 on = _ref.on, 7805 emit = _ref.emit; 7806 var document = (0, _ssrWindow.getDocument)(); 7807 var isTouched = false; 7808 var timeout = null; 7809 var dragTimeout = null; 7810 var dragStartPos; 7811 var dragSize; 7812 var trackSize; 7813 var divider; 7814 extendParams({ 7815 scrollbar: { 7816 el: null, 7817 dragSize: 'auto', 7818 hide: false, 7819 draggable: false, 7820 snapOnRelease: true, 7821 lockClass: 'swiper-scrollbar-lock', 7822 dragClass: 'swiper-scrollbar-drag', 7823 scrollbarDisabledClass: 'swiper-scrollbar-disabled', 7824 horizontalClass: "swiper-scrollbar-horizontal", 7825 verticalClass: "swiper-scrollbar-vertical" 7826 } 7827 }); 7828 swiper.scrollbar = { 7829 el: null, 7830 dragEl: null 7831 }; 7832 function setTranslate() { 7833 if (!swiper.params.scrollbar.el || !swiper.scrollbar.el) return; 7834 var scrollbar = swiper.scrollbar, 7835 rtl = swiper.rtlTranslate; 7836 var dragEl = scrollbar.dragEl, 7837 el = scrollbar.el; 7838 var params = swiper.params.scrollbar; 7839 var progress = swiper.params.loop ? swiper.progressLoop : swiper.progress; 7840 var newSize = dragSize; 7841 var newPos = (trackSize - dragSize) * progress; 7842 if (rtl) { 7843 newPos = -newPos; 7844 if (newPos > 0) { 7845 newSize = dragSize - newPos; 7846 newPos = 0; 7847 } else if (-newPos + dragSize > trackSize) { 7848 newSize = trackSize + newPos; 7849 } 7850 } else if (newPos < 0) { 7851 newSize = dragSize + newPos; 7852 newPos = 0; 7853 } else if (newPos + dragSize > trackSize) { 7854 newSize = trackSize - newPos; 7855 } 7856 if (swiper.isHorizontal()) { 7857 dragEl.style.transform = "translate3d(".concat(newPos, "px, 0, 0)"); 7858 dragEl.style.width = "".concat(newSize, "px"); 7859 } else { 7860 dragEl.style.transform = "translate3d(0px, ".concat(newPos, "px, 0)"); 7861 dragEl.style.height = "".concat(newSize, "px"); 7862 } 7863 if (params.hide) { 7864 clearTimeout(timeout); 7865 el.style.opacity = 1; 7866 timeout = setTimeout(function () { 7867 el.style.opacity = 0; 7868 el.style.transitionDuration = '400ms'; 7869 }, 1000); 7870 } 7871 } 7872 function setTransition(duration) { 7873 if (!swiper.params.scrollbar.el || !swiper.scrollbar.el) return; 7874 swiper.scrollbar.dragEl.style.transitionDuration = "".concat(duration, "ms"); 7875 } 7876 function updateSize() { 7877 if (!swiper.params.scrollbar.el || !swiper.scrollbar.el) return; 7878 var scrollbar = swiper.scrollbar; 7879 var dragEl = scrollbar.dragEl, 7880 el = scrollbar.el; 7881 dragEl.style.width = ''; 7882 dragEl.style.height = ''; 7883 trackSize = swiper.isHorizontal() ? el.offsetWidth : el.offsetHeight; 7884 divider = swiper.size / (swiper.virtualSize + swiper.params.slidesOffsetBefore - (swiper.params.centeredSlides ? swiper.snapGrid[0] : 0)); 7885 if (swiper.params.scrollbar.dragSize === 'auto') { 7886 dragSize = trackSize * divider; 7887 } else { 7888 dragSize = parseInt(swiper.params.scrollbar.dragSize, 10); 7889 } 7890 if (swiper.isHorizontal()) { 7891 dragEl.style.width = "".concat(dragSize, "px"); 7892 } else { 7893 dragEl.style.height = "".concat(dragSize, "px"); 7894 } 7895 if (divider >= 1) { 7896 el.style.display = 'none'; 7897 } else { 7898 el.style.display = ''; 7899 } 7900 if (swiper.params.scrollbar.hide) { 7901 el.style.opacity = 0; 7902 } 7903 if (swiper.params.watchOverflow && swiper.enabled) { 7904 scrollbar.el.classList[swiper.isLocked ? 'add' : 'remove'](swiper.params.scrollbar.lockClass); 7905 } 7906 } 7907 function getPointerPosition(e) { 7908 return swiper.isHorizontal() ? e.clientX : e.clientY; 7909 } 7910 function setDragPosition(e) { 7911 var scrollbar = swiper.scrollbar, 7912 rtl = swiper.rtlTranslate; 7913 var el = scrollbar.el; 7914 var positionRatio; 7915 positionRatio = (getPointerPosition(e) - (0, _utils.elementOffset)(el)[swiper.isHorizontal() ? 'left' : 'top'] - (dragStartPos !== null ? dragStartPos : dragSize / 2)) / (trackSize - dragSize); 7916 positionRatio = Math.max(Math.min(positionRatio, 1), 0); 7917 if (rtl) { 7918 positionRatio = 1 - positionRatio; 7919 } 7920 var position = swiper.minTranslate() + (swiper.maxTranslate() - swiper.minTranslate()) * positionRatio; 7921 swiper.updateProgress(position); 7922 swiper.setTranslate(position); 7923 swiper.updateActiveIndex(); 7924 swiper.updateSlidesClasses(); 7925 } 7926 function onDragStart(e) { 7927 var params = swiper.params.scrollbar; 7928 var scrollbar = swiper.scrollbar, 7929 wrapperEl = swiper.wrapperEl; 7930 var el = scrollbar.el, 7931 dragEl = scrollbar.dragEl; 7932 isTouched = true; 7933 dragStartPos = e.target === dragEl ? getPointerPosition(e) - e.target.getBoundingClientRect()[swiper.isHorizontal() ? 'left' : 'top'] : null; 7934 e.preventDefault(); 7935 e.stopPropagation(); 7936 wrapperEl.style.transitionDuration = '100ms'; 7937 dragEl.style.transitionDuration = '100ms'; 7938 setDragPosition(e); 7939 clearTimeout(dragTimeout); 7940 el.style.transitionDuration = '0ms'; 7941 if (params.hide) { 7942 el.style.opacity = 1; 7943 } 7944 if (swiper.params.cssMode) {
7945 swiper.wrapperEl.style['scroll-snap-type'] = 'none'; 7946 } 7947 emit('scrollbarDragStart', e); 7948 } 7949 function onDragMove(e) { 7950 var scrollbar = swiper.scrollbar, 7951 wrapperEl = swiper.wrapperEl; 7952 var el = scrollbar.el, 7953 dragEl = scrollbar.dragEl; 7954 if (!isTouched) return; 7955 if (e.preventDefault) e.preventDefault();else e.returnValue = false; 7956 setDragPosition(e); 7957 wrapperEl.style.transitionDuration = '0ms'; 7958 el.style.transitionDuration = '0ms'; 7959 dragEl.style.transitionDuration = '0ms'; 7960 emit('scrollbarDragMove', e); 7961 } 7962 function onDragEnd(e) { 7963 var params = swiper.params.scrollbar; 7964 var scrollbar = swiper.scrollbar, 7965 wrapperEl = swiper.wrapperEl; 7966 var el = scrollbar.el; 7967 if (!isTouched) return; 7968 isTouched = false; 7969 if (swiper.params.cssMode) { 7970 swiper.wrapperEl.style['scroll-snap-type'] = ''; 7971 wrapperEl.style.transitionDuration = ''; 7972 } 7973 if (params.hide) { 7974 clearTimeout(dragTimeout); 7975 dragTimeout = (0, _utils.nextTick)(function () { 7976 el.style.opacity = 0; 7977 el.style.transitionDuration = '400ms'; 7978 }, 1000); 7979 } 7980 emit('scrollbarDragEnd', e); 7981 if (params.snapOnRelease) { 7982 swiper.slideToClosest(); 7983 } 7984 } 7985 function events(method) { 7986 var scrollbar = swiper.scrollbar, 7987 params = swiper.params; 7988 var el = scrollbar.el; 7989 if (!el) return; 7990 var target = el; 7991 var activeListener = params.passiveListeners ? { 7992 passive: false, 7993 capture: false 7994 } : false; 7995 var passiveListener = params.passiveListeners ? { 7996 passive: true, 7997 capture: false 7998 } : false; 7999 if (!target) return; 8000 var eventMethod = method === 'on' ? 'addEventListener' : 'removeEventListener'; 8001 target[eventMethod]('pointerdown', onDragStart, activeListener); 8002 document[eventMethod]('pointermove', onDragMove, activeListener); 8003 document[eventMethod]('pointerup', onDragEnd, passiveListener); 8004 } 8005 function enableDraggable() { 8006 if (!swiper.params.scrollbar.el || !swiper.scrollbar.el) return; 8007 events('on'); 8008 } 8009 function disableDraggable() { 8010 if (!swiper.params.scrollbar.el || !swiper.scrollbar.el) return; 8011 events('off'); 8012 } 8013 function init() { 8014 var scrollbar = swiper.scrollbar, 8015 swiperEl = swiper.el; 8016 swiper.params.scrollbar = (0, _createElementIfNotDefined["default"])(swiper, swiper.originalParams.scrollbar, swiper.params.scrollbar, { 8017 el: 'swiper-scrollbar' 8018 }); 8019 var params = swiper.params.scrollbar; 8020 if (!params.el) return; 8021 var el; 8022 if (typeof params.el === 'string' && swiper.isElement) { 8023 el = swiper.el.shadowRoot.querySelector(params.el); 8024 } 8025 if (!el && typeof params.el === 'string') { 8026 el = document.querySelectorAll(params.el); 8027 } else if (!el) { 8028 el = params.el; 8029 } 8030 if (swiper.params.uniqueNavElements && typeof params.el === 'string' && el.length > 1 && swiperEl.querySelectorAll(params.el).length === 1) { 8031 el = swiperEl.querySelector(params.el); 8032 } 8033 if (el.length > 0) el = el[0]; 8034 el.classList.add(swiper.isHorizontal() ? params.horizontalClass : params.verticalClass); 8035 var dragEl; 8036 if (el) { 8037 dragEl = el.querySelector(".".concat(swiper.params.scrollbar.dragClass)); 8038 if (!dragEl) { 8039 dragEl = (0, _utils.createElement)('div', swiper.params.scrollbar.dragClass); 8040 el.append(dragEl); 8041 } 8042 } 8043 Object.assign(scrollbar, { 8044 el: el, 8045 dragEl: dragEl 8046 }); 8047 if (params.draggable) { 8048 enableDraggable(); 8049 } 8050 if (el) { 8051 el.classList[swiper.enabled ? 'remove' : 'add'](swiper.params.scrollbar.lockClass); 8052 } 8053 } 8054 function destroy() { 8055 var params = swiper.params.scrollbar; 8056 var el = swiper.scrollbar.el; 8057 if (el) { 8058 el.classList.remove(swiper.isHorizontal() ? params.horizontalClass : params.verticalClass); 8059 } 8060 disableDraggable(); 8061 } 8062 on('init', function () { 8063 if (swiper.params.scrollbar.enabled === false) { 8064 // eslint-disable-next-line 8065 disable(); 8066 } else { 8067 init(); 8068 updateSize(); 8069 setTranslate(); 8070 } 8071 }); 8072 on('update resize observerUpdate lock unlock', function () { 8073 updateSize(); 8074 }); 8075 on('setTranslate', function () { 8076 setTranslate(); 8077 }); 8078 on('setTransition', function (_s, duration) { 8079 setTransition(duration); 8080 }); 8081 on('enable disable', function () { 8082 var el = swiper.scrollbar.el; 8083 if (el) { 8084 el.classList[swiper.enabled ? 'remove' : 'add'](swiper.params.scrollbar.lockClass); 8085 } 8086 }); 8087 on('destroy', function () { 8088 destroy(); 8089 }); 8090 var enable = function enable() { 8091 swiper.el.classList.remove(swiper.params.scrollbar.scrollbarDisabledClass); 8092 if (swiper.scrollbar.el) { 8093 swiper.scrollbar.el.classList.remove(swiper.params.scrollbar.scrollbarDisabledClass); 8094 } 8095 init(); 8096 updateSize(); 8097 setTranslate(); 8098 }; 8099 var disable = function disable() { 8100 swiper.el.classList.add(swiper.params.scrollbar.scrollbarDisabledClass); 8101 if (swiper.scrollbar.el) { 8102 swiper.scrollbar.el.classList.add(swiper.params.scrollbar.scrollbarDisabledClass); 8103 } 8104 destroy(); 8105 }; 8106 Object.assign(swiper.scrollbar, { 8107 enable: enable, 8108 disable: disable, 8109 updateSize: updateSize, 8110 setTranslate: setTranslate, 8111 init: init, 8112 destroy: destroy 8113 }); 8114} 8115 8116},{"../../shared/create-element-if-not-defined.js":88,"../../shared/utils.js":97,"ssr-window":1}],84:[function(require,module,exports){ 8117"use strict"; 8118 8119Object.defineProperty(exports, "__esModule", { 8120 value: true 8121}); 8122exports["default"] = Thumb; 8123var _ssrWindow = require("ssr-window"); 8124var _utils = require("../../shared/utils.js"); 8125function Thumb(_ref) { 8126 var swiper = _ref.swiper, 8127 extendParams = _ref.extendParams, 8128 on = _ref.on; 8129 extendParams({ 8130 thumbs: { 8131 swiper: null, 8132 multipleActiveThumbs: true, 8133 autoScrollOffset: 0, 8134 slideThumbActiveClass: 'swiper-slide-thumb-active', 8135 thumbsContainerClass: 'swiper-thumbs' 8136 } 8137 }); 8138 var initialized = false;
8139 var swiperCreated = false; 8140 swiper.thumbs = { 8141 swiper: null 8142 }; 8143 function onThumbClick() { 8144 var thumbsSwiper = swiper.thumbs.swiper; 8145 if (!thumbsSwiper || thumbsSwiper.destroyed) return; 8146 var clickedIndex = thumbsSwiper.clickedIndex; 8147 var clickedSlide = thumbsSwiper.clickedSlide; 8148 if (clickedSlide && clickedSlide.classList.contains(swiper.params.thumbs.slideThumbActiveClass)) return; 8149 if (typeof clickedIndex === 'undefined' || clickedIndex === null) return; 8150 var slideToIndex; 8151 if (thumbsSwiper.params.loop) { 8152 slideToIndex = parseInt(thumbsSwiper.clickedSlide.getAttribute('data-swiper-slide-index'), 10); 8153 } else { 8154 slideToIndex = clickedIndex; 8155 } 8156 if (swiper.params.loop) { 8157 swiper.slideToLoop(slideToIndex); 8158 } else { 8159 swiper.slideTo(slideToIndex); 8160 } 8161 } 8162 function init() { 8163 var thumbsParams = swiper.params.thumbs; 8164 if (initialized) return false; 8165 initialized = true; 8166 var SwiperClass = swiper.constructor; 8167 if (thumbsParams.swiper instanceof SwiperClass) { 8168 swiper.thumbs.swiper = thumbsParams.swiper; 8169 Object.assign(swiper.thumbs.swiper.originalParams, { 8170 watchSlidesProgress: true, 8171 slideToClickedSlide: false 8172 }); 8173 Object.assign(swiper.thumbs.swiper.params, { 8174 watchSlidesProgress: true, 8175 slideToClickedSlide: false 8176 }); 8177 swiper.thumbs.swiper.update(); 8178 } else if ((0, _utils.isObject)(thumbsParams.swiper)) { 8179 var thumbsSwiperParams = Object.assign({}, thumbsParams.swiper); 8180 Object.assign(thumbsSwiperParams, { 8181 watchSlidesProgress: true, 8182 slideToClickedSlide: false 8183 }); 8184 swiper.thumbs.swiper = new SwiperClass(thumbsSwiperParams); 8185 swiperCreated = true; 8186 } 8187 swiper.thumbs.swiper.el.classList.add(swiper.params.thumbs.thumbsContainerClass); 8188 swiper.thumbs.swiper.on('tap', onThumbClick); 8189 return true; 8190 } 8191 function update(initial) { 8192 var thumbsSwiper = swiper.thumbs.swiper; 8193 if (!thumbsSwiper || thumbsSwiper.destroyed) return; 8194 var slidesPerView = thumbsSwiper.params.slidesPerView === 'auto' ? thumbsSwiper.slidesPerViewDynamic() : thumbsSwiper.params.slidesPerView; 8195 8196 // Activate thumbs 8197 var thumbsToActivate = 1; 8198 var thumbActiveClass = swiper.params.thumbs.slideThumbActiveClass; 8199 if (swiper.params.slidesPerView > 1 && !swiper.params.centeredSlides) { 8200 thumbsToActivate = swiper.params.slidesPerView; 8201 } 8202 if (!swiper.params.thumbs.multipleActiveThumbs) { 8203 thumbsToActivate = 1; 8204 } 8205 thumbsToActivate = Math.floor(thumbsToActivate); 8206 thumbsSwiper.slides.forEach(function (slideEl) { 8207 return slideEl.classList.remove(thumbActiveClass); 8208 }); 8209 if (thumbsSwiper.params.loop || thumbsSwiper.params.virtual && thumbsSwiper.params.virtual.enabled) { 8210 for (var i = 0; i < thumbsToActivate; i += 1) { 8211 (0, _utils.elementChildren)(thumbsSwiper.slidesEl, "[data-swiper-slide-index=\"".concat(swiper.realIndex + i, "\"]")).forEach(function (slideEl) { 8212 slideEl.classList.add(thumbActiveClass); 8213 }); 8214 } 8215 } else { 8216 for (var _i = 0; _i < thumbsToActivate; _i += 1) { 8217 if (thumbsSwiper.slides[swiper.realIndex + _i]) { 8218 thumbsSwiper.slides[swiper.realIndex + _i].classList.add(thumbActiveClass); 8219 } 8220 } 8221 } 8222 var autoScrollOffset = swiper.params.thumbs.autoScrollOffset; 8223 var useOffset = autoScrollOffset && !thumbsSwiper.params.loop; 8224 if (swiper.realIndex !== thumbsSwiper.realIndex || useOffset) { 8225 var currentThumbsIndex = thumbsSwiper.activeIndex; 8226 var newThumbsIndex; 8227 var direction; 8228 if (thumbsSwiper.params.loop) { 8229 var newThumbsSlide = thumbsSwiper.slides.filter(function (slideEl) { 8230 return slideEl.getAttribute('data-swiper-slide-index') === "".concat(swiper.realIndex); 8231 })[0]; 8232 newThumbsIndex = thumbsSwiper.slides.indexOf(newThumbsSlide); 8233 direction = swiper.activeIndex > swiper.previousIndex ? 'next' : 'prev'; 8234 } else { 8235 newThumbsIndex = swiper.realIndex; 8236 direction = newThumbsIndex > swiper.previousIndex ? 'next' : 'prev'; 8237 } 8238 if (useOffset) { 8239 newThumbsIndex += direction === 'next' ? autoScrollOffset : -1 * autoScrollOffset; 8240 } 8241 if (thumbsSwiper.visibleSlidesIndexes && thumbsSwiper.visibleSlidesIndexes.indexOf(newThumbsIndex) < 0) { 8242 if (thumbsSwiper.params.centeredSlides) { 8243 if (newThumbsIndex > currentThumbsIndex) { 8244 newThumbsIndex = newThumbsIndex - Math.floor(slidesPerView / 2) + 1; 8245 } else { 8246 newThumbsIndex = newThumbsIndex + Math.floor(slidesPerView / 2) - 1; 8247 } 8248 } else if (newThumbsIndex > currentThumbsIndex && thumbsSwiper.params.slidesPerGroup === 1) { 8249 // newThumbsIndex = newThumbsIndex - slidesPerView + 1; 8250 } 8251 thumbsSwiper.slideTo(newThumbsIndex, initial ? 0 : undefined); 8252 } 8253 } 8254 } 8255 on('beforeInit', function () { 8256 var thumbs = swiper.params.thumbs; 8257 if (!thumbs || !thumbs.swiper) return; 8258 if (typeof thumbs.swiper === 'string' || thumbs.swiper instanceof HTMLElement) { 8259 var document = (0, _ssrWindow.getDocument)(); 8260 var getThumbsElementAndInit = function getThumbsElementAndInit() { 8261 var thumbsElement = typeof thumbs.swiper === 'string' ? document.querySelector(thumbs.swiper) : thumbs.swiper; 8262 if (thumbsElement && thumbsElement.swiper) { 8263 thumbs.swiper = thumbsElement.swiper; 8264 init(); 8265 update(true); 8266 } else if (thumbsElement) { 8267 var onThumbsSwiper = function onThumbsSwiper(e) { 8268 thumbs.swiper = e.detail[0]; 8269 thumbsElement.removeEventListener('init', onThumbsSwiper); 8270 init(); 8271 update(true);
8272 thumbs.swiper.update(); 8273 swiper.update(); 8274 }; 8275 thumbsElement.addEventListener('init', onThumbsSwiper); 8276 } 8277 return thumbsElement; 8278 }; 8279 var watchForThumbsToAppear = function watchForThumbsToAppear() { 8280 if (swiper.destroyed) return; 8281 var thumbsElement = getThumbsElementAndInit(); 8282 if (!thumbsElement) { 8283 requestAnimationFrame(watchForThumbsToAppear); 8284 } 8285 }; 8286 requestAnimationFrame(watchForThumbsToAppear); 8287 } else { 8288 init(); 8289 update(true); 8290 } 8291 }); 8292 on('slideChange update resize observerUpdate', function () { 8293 update(); 8294 }); 8295 on('setTransition', function (_s, duration) { 8296 var thumbsSwiper = swiper.thumbs.swiper; 8297 if (!thumbsSwiper || thumbsSwiper.destroyed) return; 8298 thumbsSwiper.setTransition(duration); 8299 }); 8300 on('beforeDestroy', function () { 8301 var thumbsSwiper = swiper.thumbs.swiper; 8302 if (!thumbsSwiper || thumbsSwiper.destroyed) return; 8303 if (swiperCreated) { 8304 thumbsSwiper.destroy(); 8305 } 8306 }); 8307 Object.assign(swiper.thumbs, { 8308 init: init, 8309 update: update 8310 }); 8311} 8312 8313},{"../../shared/utils.js":97,"ssr-window":1}],85:[function(require,module,exports){ 8314"use strict"; 8315 8316Object.defineProperty(exports, "__esModule", { 8317 value: true 8318}); 8319exports["default"] = Virtual; 8320var _ssrWindow = require("ssr-window"); 8321var _utils = require("../../shared/utils.js"); 8322function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } 8323function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } 8324function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } 8325function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } 8326function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } 8327function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } 8328function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } 8329function Virtual(_ref) { 8330 var swiper = _ref.swiper, 8331 extendParams = _ref.extendParams, 8332 on = _ref.on, 8333 emit = _ref.emit; 8334 extendParams({ 8335 virtual: { 8336 enabled: false, 8337 slides: [], 8338 cache: true, 8339 renderSlide: null, 8340 renderExternal: null, 8341 renderExternalUpdate: true, 8342 addSlidesBefore: 0, 8343 addSlidesAfter: 0 8344 } 8345 }); 8346 var cssModeTimeout; 8347 var document = (0, _ssrWindow.getDocument)(); 8348 swiper.virtual = { 8349 cache: {}, 8350 from: undefined, 8351 to: undefined, 8352 slides: [], 8353 offset: 0, 8354 slidesGrid: [] 8355 }; 8356 var tempDOM = document.createElement('div');
8357 function renderSlide(slide, index) { 8358 var params = swiper.params.virtual; 8359 if (params.cache && swiper.virtual.cache[index]) { 8360 return swiper.virtual.cache[index]; 8361 } 8362 // eslint-disable-next-line 8363 var slideEl; 8364 if (params.renderSlide) { 8365 slideEl = params.renderSlide.call(swiper, slide, index); 8366 if (typeof slideEl === 'string') { 8367 tempDOM.innerHTML = slideEl; 8368 slideEl = tempDOM.children[0]; 8369 } 8370 } else if (swiper.isElement) { 8371 slideEl = (0, _utils.createElement)('swiper-slide'); 8372 } else { 8373 slideEl = (0, _utils.createElement)('div', swiper.params.slideClass); 8374 } 8375 slideEl.setAttribute('data-swiper-slide-index', index); 8376 if (!params.renderSlide) { 8377 slideEl.innerHTML = slide; 8378 } 8379 if (params.cache) swiper.virtual.cache[index] = slideEl; 8380 return slideEl; 8381 } 8382 function update(force) { 8383 var _swiper$params = swiper.params, 8384 slidesPerView = _swiper$params.slidesPerView, 8385 slidesPerGroup = _swiper$params.slidesPerGroup, 8386 centeredSlides = _swiper$params.centeredSlides, 8387 isLoop = _swiper$params.loop; 8388 var _swiper$params$virtua = swiper.params.virtual, 8389 addSlidesBefore = _swiper$params$virtua.addSlidesBefore, 8390 addSlidesAfter = _swiper$params$virtua.addSlidesAfter; 8391 var _swiper$virtual = swiper.virtual, 8392 previousFrom = _swiper$virtual.from, 8393 previousTo = _swiper$virtual.to, 8394 slides = _swiper$virtual.slides, 8395 previousSlidesGrid = _swiper$virtual.slidesGrid, 8396 previousOffset = _swiper$virtual.offset; 8397 if (!swiper.params.cssMode) { 8398 swiper.updateActiveIndex(); 8399 } 8400 var activeIndex = swiper.activeIndex || 0; 8401 var offsetProp; 8402 if (swiper.rtlTranslate) offsetProp = 'right';else offsetProp = swiper.isHorizontal() ? 'left' : 'top'; 8403 var slidesAfter; 8404 var slidesBefore; 8405 if (centeredSlides) { 8406 slidesAfter = Math.floor(slidesPerView / 2) + slidesPerGroup + addSlidesAfter; 8407 slidesBefore = Math.floor(slidesPerView / 2) + slidesPerGroup + addSlidesBefore; 8408 } else { 8409 slidesAfter = slidesPerView + (slidesPerGroup - 1) + addSlidesAfter; 8410 slidesBefore = (isLoop ? slidesPerView : slidesPerGroup) + addSlidesBefore; 8411 } 8412 var from = activeIndex - slidesBefore; 8413 var to = activeIndex + slidesAfter; 8414 if (!isLoop) { 8415 from = Math.max(from, 0); 8416 to = Math.min(to, slides.length - 1); 8417 } 8418 var offset = (swiper.slidesGrid[from] || 0) - (swiper.slidesGrid[0] || 0); 8419 if (isLoop && activeIndex >= slidesBefore) { 8420 from -= slidesBefore; 8421 if (!centeredSlides) offset += swiper.slidesGrid[0]; 8422 } else if (isLoop && activeIndex < slidesBefore) { 8423 from = -slidesBefore; 8424 if (centeredSlides) offset += swiper.slidesGrid[0]; 8425 } 8426 Object.assign(swiper.virtual, { 8427 from: from, 8428 to: to, 8429 offset: offset, 8430 slidesGrid: swiper.slidesGrid, 8431 slidesBefore: slidesBefore, 8432 slidesAfter: slidesAfter 8433 }); 8434 function onRendered() { 8435 swiper.updateSlides(); 8436 swiper.updateProgress(); 8437 swiper.updateSlidesClasses(); 8438 emit('virtualUpdate'); 8439 } 8440 if (previousFrom === from && previousTo === to && !force) { 8441 if (swiper.slidesGrid !== previousSlidesGrid && offset !== previousOffset) { 8442 swiper.slides.forEach(function (slideEl) { 8443 slideEl.style[offsetProp] = "".concat(offset - Math.abs(swiper.cssOverflowAdjustment()), "px"); 8444 }); 8445 } 8446 swiper.updateProgress(); 8447 emit('virtualUpdate'); 8448 return; 8449 } 8450 if (swiper.params.virtual.renderExternal) { 8451 swiper.params.virtual.renderExternal.call(swiper, { 8452 offset: offset, 8453 from: from, 8454 to: to, 8455 slides: function getSlides() { 8456 var slidesToRender = []; 8457 for (var i = from; i <= to; i += 1) { 8458 slidesToRender.push(slides[i]); 8459 } 8460 return slidesToRender; 8461 }() 8462 }); 8463 if (swiper.params.virtual.renderExternalUpdate) { 8464 onRendered(); 8465 } else { 8466 emit('virtualUpdate'); 8467 } 8468 return; 8469 } 8470 var prependIndexes = []; 8471 var appendIndexes = []; 8472 var getSlideIndex = function getSlideIndex(index) { 8473 var slideIndex = index; 8474 if (index < 0) { 8475 slideIndex = slides.length + index; 8476 } else if (slideIndex >= slides.length) { 8477 // eslint-disable-next-line 8478 slideIndex = slideIndex - slides.length; 8479 } 8480 return slideIndex; 8481 }; 8482 if (force) { 8483 swiper.slidesEl.querySelectorAll(".".concat(swiper.params.slideClass, ", swiper-slide")).forEac
8483h(function (slideEl) { 8484 slideEl.remove(); 8485 }); 8486 } else { 8487 for (var i = previousFrom; i <= previousTo; i += 1) { 8488 if (i < from || i > to) { 8489 var slideIndex = getSlideIndex(i); 8490 swiper.slidesEl.querySelectorAll(".".concat(swiper.params.slideClass, "[data-swiper-slide-index=\"").concat(slideIndex, "\"], swiper-slide[data-swiper-slide-index=\"").concat(slideIndex, "\"]")).forEach(function (slideEl) { 8491 slideEl.remove(); 8492 }); 8493 } 8494 } 8495 } 8496 var loopFrom = isLoop ? -slides.length : 0; 8497 var loopTo = isLoop ? slides.length * 2 : slides.length; 8498 for (var _i = loopFrom; _i < loopTo; _i += 1) { 8499 if (_i >= from && _i <= to) { 8500 var _slideIndex = getSlideIndex(_i); 8501 if (typeof previousTo === 'undefined' || force) { 8502 appendIndexes.push(_slideIndex); 8503 } else { 8504 if (_i > previousTo) appendIndexes.push(_slideIndex); 8505 if (_i < previousFrom) prependIndexes.push(_slideIndex); 8506 } 8507 } 8508 } 8509 appendIndexes.forEach(function (index) { 8510 swiper.slidesEl.append(renderSlide(slides[index], index)); 8511 }); 8512 if (isLoop) { 8513 for (var _i2 = prependIndexes.length - 1; _i2 >= 0; _i2 -= 1) { 8514 var index = prependIndexes[_i2]; 8515 swiper.slidesEl.prepend(renderSlide(slides[index], index)); 8516 } 8517 } else { 8518 prependIndexes.sort(function (a, b) { 8519 return b - a; 8520 }); 8521 prependIndexes.forEach(function (index) { 8522 swiper.slidesEl.prepend(renderSlide(slides[index], index)); 8523 }); 8524 } 8525 (0, _utils.elementChildren)(swiper.slidesEl, '.swiper-slide, swiper-slide').forEach(function (slideEl) { 8526 slideEl.style[offsetProp] = "".concat(offset - Math.abs(swiper.cssOverflowAdjustment()), "px"); 8527 }); 8528 onRendered(); 8529 } 8530 function appendSlide(slides) { 8531 if (_typeof(slides) === 'object' && 'length' in slides) { 8532 for (var i = 0; i < slides.length; i += 1) { 8533 if (slides[i]) swiper.virtual.slides.push(slides[i]); 8534 } 8535 } else { 8536 swiper.virtual.slides.push(slides); 8537 } 8538 update(true); 8539 } 8540 function prependSlide(slides) { 8541 var activeIndex = swiper.activeIndex; 8542 var newActiveIndex = activeIndex + 1; 8543 var numberOfNewSlides = 1; 8544 if (Array.isArray(slides)) { 8545 for (var i = 0; i < slides.length; i += 1) { 8546 if (slides[i]) swiper.virtual.slides.unshift(slides[i]); 8547 } 8548 newActiveIndex = activeIndex + slides.length; 8549 numberOfNewSlides = slides.length; 8550 } else { 8551 swiper.virtual.slides.unshift(slides); 8552 } 8553 if (swiper.params.virtual.cache) { 8554 var cache = swiper.virtual.cache; 8555 var newCache = {}; 8556 Object.keys(cache).forEach(function (cachedIndex) { 8557 var cachedEl = cache[cachedIndex]; 8558 var cachedElIndex = cachedEl.getAttribute('data-swiper-slide-index'); 8559 if (cachedElIndex) { 8560 cachedEl.setAttribute('data-swiper-slide-index', parseInt(cachedElIndex, 10) + numberOfNewSlides); 8561 } 8562 newCache[parseInt(cachedIndex, 10) + numberOfNewSlides] = cachedEl; 8563 }); 8564 swiper.virtual.cache = newCache; 8565 } 8566 update(true); 8567 swiper.slideTo(newActiveIndex, 0); 8568 } 8569 function removeSlide(slidesIndexes) { 8570 if (typeof slidesIndexes === 'undefined' || slidesIndexes === null) return; 8571 var activeIndex = swiper.activeIndex; 8572 if (Array.isArray(slidesIndexes)) { 8573 for (var i = slidesIndexes.length - 1; i >= 0; i -= 1) { 8574 swiper.virtual.slides.splice(slidesIndexes[i], 1); 8575 if (swiper.params.virtual.cache) { 8576 delete swiper.virtual.cache[slidesIndexes[i]]; 8577 } 8578 if (slidesIndexes[i] < activeIndex) activeIndex -= 1; 8579 activeIndex = Math.max(activeIndex, 0); 8580 } 8581 } else { 8582 swiper.virtual.slides.splice(slidesIndexes, 1); 8583 if (swiper.params.virtual.cache) { 8584 delete swiper.virtual.cache[slidesIndexes]; 8585 } 8586 if (slidesIndexes < activeIndex) activeIndex -= 1; 8587 activeIndex = Math.max(activeIndex, 0); 8588 } 8589 update(true); 8590 swiper.slideTo(activeIndex, 0); 8591 } 8592 function removeAllSlides() { 8593 swiper.virtual.slides = []; 8594 if (swiper.params.virtual.cache) { 8595 swiper.virtual.cache = {}; 8596 } 8597 update(true); 8598 swiper.slideTo(0, 0); 8599 } 8600 on('beforeInit', function () { 8601 if (!swiper.params.virtual.enabled) return; 8602 var domSlidesAssigned; 8603 if (typeof swiper.passedParams.virtual.slides === 'undefined') { 8604 var slides = _toConsumableArray(swiper.slidesEl.children).filter(function (el) { 8605 return el.matches(".".concat(swiper.params.slideClass, ", swiper-slide")); 8606 }); 8607 if (slides && slides.length) { 8608 swiper.virtual.slides = _toConsumableArray(slides); 8609 domSlidesAssigned = true;
8610 slides.forEach(function (slideEl, slideIndex) { 8611 slideEl.setAttribute('data-swiper-slide-index', slideIndex); 8612 swiper.virtual.cache[slideIndex] = slideEl; 8613 slideEl.remove(); 8614 }); 8615 } 8616 } 8617 if (!domSlidesAssigned) { 8618 swiper.virtual.slides = swiper.params.virtual.slides; 8619 } 8620 swiper.classNames.push("".concat(swiper.params.containerModifierClass, "virtual")); 8621 swiper.params.watchSlidesProgress = true; 8622 swiper.originalParams.watchSlidesProgress = true; 8623 if (!swiper.params.initialSlide) { 8624 update(); 8625 } 8626 }); 8627 on('setTranslate', function () { 8628 if (!swiper.params.virtual.enabled) return; 8629 if (swiper.params.cssMode && !swiper._immediateVirtual) { 8630 clearTimeout(cssModeTimeout); 8631 cssModeTimeout = setTimeout(function () { 8632 update(); 8633 }, 100); 8634 } else { 8635 update(); 8636 } 8637 }); 8638 on('init update resize', function () { 8639 if (!swiper.params.virtual.enabled) return; 8640 if (swiper.params.cssMode) { 8641 (0, _utils.setCSSProperty)(swiper.wrapperEl, '--swiper-virtual-size', "".concat(swiper.virtualSize, "px")); 8642 } 8643 }); 8644 Object.assign(swiper.virtual, { 8645 appendSlide: appendSlide, 8646 prependSlide: prependSlide, 8647 removeSlide: removeSlide, 8648 removeAllSlides: removeAllSlides, 8649 update: update 8650 }); 8651} 8652 8653},{"../../shared/utils.js":97,"ssr-window":1}],86:[function(require,module,exports){ 8654"use strict"; 8655 8656Object.defineProperty(exports, "__esModule", { 8657 value: true 8658}); 8659exports["default"] = Zoom; 8660var _ssrWindow = require("ssr-window"); 8661var _utils = require("../../shared/utils.js"); 8662function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } 8663function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } 8664function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } 8665function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } 8666function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } 8667function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } 8668function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } 8669function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } 8670function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } 8671function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } 8672function Zoom(_ref) { 8673 var swiper = _ref.swiper, 8674 extendParams = _ref.extendParams, 8675 on = _ref.on, 8676 emit = _ref.emit; 8677 var window = (0, _ssrWindow.getWindow)(); 8678 extendParams({ 8679 zoom: { 8680 enabled: false, 8681 maxRatio: 3, 8682 minRatio: 1, 8683 toggle: true, 8684 containerClass: 'swiper-zoom-container', 8685 zoomedSlideClass: 'swiper-slide-zoomed' 8686 } 8687 }); 8688 swiper.zoom = { 8689 enabled: false 8690 }; 8691 var currentScale = 1; 8692 var isScaling = false;
8693 var fakeGestureTouched; 8694 var fakeGestureMoved; 8695 var evCache = []; 8696 var gesture = { 8697 originX: 0, 8698 originY: 0, 8699 slideEl: undefined, 8700 slideWidth: undefined, 8701 slideHeight: undefined, 8702 imageEl: undefined, 8703 imageWrapEl: undefined, 8704 maxRatio: 3 8705 }; 8706 var image = { 8707 isTouched: undefined, 8708 isMoved: undefined, 8709 currentX: undefined, 8710 currentY: undefined, 8711 minX: undefined, 8712 minY: undefined, 8713 maxX: undefined, 8714 maxY: undefined, 8715 width: undefined, 8716 height: undefined, 8717 startX: undefined, 8718 startY: undefined, 8719 touchesStart: {}, 8720 touchesCurrent: {} 8721 }; 8722 var velocity = { 8723 x: undefined, 8724 y: undefined, 8725 prevPositionX: undefined, 8726 prevPositionY: undefined, 8727 prevTime: undefined 8728 }; 8729 var scale = 1; 8730 Object.defineProperty(swiper.zoom, 'scale', { 8731 get: function get() { 8732 return scale; 8733 }, 8734 set: function set(value) { 8735 if (scale !== value) { 8736 var imageEl = gesture.imageEl; 8737 var slideEl = gesture.slideEl; 8738 emit('zoomChange', value, imageEl, slideEl); 8739 } 8740 scale = value; 8741 } 8742 }); 8743 function getDistanceBetweenTouches() { 8744 if (evCache.length < 2) return 1; 8745 var x1 = evCache[0].pageX; 8746 var y1 = evCache[0].pageY; 8747 var x2 = evCache[1].pageX; 8748 var y2 = evCache[1].pageY; 8749 var distance = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2)); 8750 return distance; 8751 } 8752 function getScaleOrigin() { 8753 if (evCache.length < 2) return { 8754 x: null, 8755 y: null 8756 }; 8757 var box = gesture.imageEl.getBoundingClientRect(); 8758 return [(evCache[0].pageX + (evCache[1].pageX - evCache[0].pageX) / 2 - box.x) / currentScale, (evCache[0].pageY + (evCache[1].pageY - evCache[0].pageY) / 2 - box.y) / currentScale]; 8759 } 8760 function getSlideSelector() { 8761 return swiper.isElement ? "swiper-slide" : ".".concat(swiper.params.slideClass); 8762 } 8763 function eventWithinSlide(e) { 8764 var slideSelector = getSlideSelector(); 8765 if (e.target.matches(slideSelector)) return true; 8766 if (swiper.slides.filter(function (slideEl) { 8767 return slideEl.contains(e.target); 8768 }).length > 0) return true; 8769 return false; 8770 } 8771 function eventWithinZoomContainer(e) { 8772 var selector = ".".concat(swiper.params.zoom.containerClass); 8773 if (e.target.matches(selector)) return true; 8774 if (_toConsumableArray(swiper.el.querySelectorAll(selector)).filter(function (containerEl) { 8775 return containerEl.contains(e.target); 8776 }).length > 0) return true; 8777 return false; 8778 } 8779 8780 // Events 8781 function onGestureStart(e) { 8782 if (e.pointerType === 'mouse') { 8783 evCache.splice(0, evCache.length); 8784 } 8785 if (!eventWithinSlide(e)) return; 8786 var params = swiper.params.zoom; 8787 fakeGestureTouched = false; 8788 fakeGestureMoved = false; 8789 evCache.push(e); 8790 if (evCache.length < 2) { 8791 return; 8792 } 8793 fakeGestureTouched = true; 8794 gesture.scaleStart = getDistanceBetweenTouches(); 8795 if (!gesture.slideEl) { 8796 gesture.slideEl = e.target.closest(".".concat(swiper.params.slideClass, ", swiper-slide")); 8797 if (!gesture.slideEl) gesture.slideEl = swiper.slides[swiper.activeIndex]; 8798 var imageEl = gesture.slideEl.querySelector(".".concat(params.containerClass)); 8799 if (imageEl) { 8800 imageEl = imageEl.querySelectorAll('picture, img, svg, canvas, .swiper-zoom-target')[0]; 8801 } 8802 gesture.imageEl = imageEl; 8803 if (imageEl) { 8804 gesture.imageWrapEl = (0, _utils.elementParents)(gesture.imageEl, ".".concat(params.containerClass))[0]; 8805 } else { 8806 gesture.imageWrapEl = undefined; 8807 } 8808 if (!gesture.imageWrapEl) { 8809 gesture.imageEl = undefined; 8810 return; 8811 } 8812 gesture.maxRatio = gesture.imageWrapEl.getAttribute('data-swiper-zoom') || params.maxRatio; 8813 } 8814 if (gesture.imageEl) { 8815 var _getScaleOrigin = getScaleOrigin(), 8816 _getScaleOrigin2 = _slicedToArray(_getScaleOrigin, 2), 8817 originX = _getScaleOrigin2[0], 8818 originY = _getScaleOrigin2[1]; 8819 gesture.originX = originX; 8820 gesture.originY = originY; 8821 gesture.imageEl.style.transitionDuration = '0ms'; 8822 } 8823 isScaling = true; 8824 } 8825 function onGestureChange(e) { 8826 if (!eventWithinSlide(e)) return; 8827 var params = swiper.params.zoom; 8828 var zoom = swiper.zoom; 8829 var pointerIndex = evCache.findIndex(function (cachedEv) { 8830 return cachedEv.pointerId === e.pointerId; 8831 }); 8832 if (pointerIndex >= 0) evCache[pointerIndex] = e; 8833 if (evCache.length < 2) { 8834 return; 8835 } 8836 fakeGestureMoved = true; 8837 gesture.scaleMove = getDistanceBetweenTouches(); 8838 if (!gesture.imageEl) { 8839 return; 8840 } 8841 zoom.scale = gesture.scaleMove / gesture.scaleStart * currentScale; 8842 if (zoom.scale > gesture.maxRatio) { 8843 zoom.scale = gesture.maxRatio - 1 + Math.pow(zoom.scale - gesture.maxRatio + 1, 0.5); 8844 } 8845 if (zoom.scale < params.minRatio) { 8846 zoom.scale = params.minRatio + 1 - Math.pow(params.minRatio - zoom.scale + 1, 0.5); 8847 }
8848 gesture.imageEl.style.transform = "translate3d(0,0,0) scale(".concat(zoom.scale, ")"); 8849 } 8850 function onGestureEnd(e) { 8851 if (!eventWithinSlide(e)) return; 8852 if (e.pointerType === 'mouse' && e.type === 'pointerout') return; 8853 var params = swiper.params.zoom; 8854 var zoom = swiper.zoom; 8855 var pointerIndex = evCache.findIndex(function (cachedEv) { 8856 return cachedEv.pointerId === e.pointerId; 8857 }); 8858 if (pointerIndex >= 0) evCache.splice(pointerIndex, 1); 8859 if (!fakeGestureTouched || !fakeGestureMoved) { 8860 return; 8861 } 8862 fakeGestureTouched = false; 8863 fakeGestureMoved = false; 8864 if (!gesture.imageEl) return; 8865 zoom.scale = Math.max(Math.min(zoom.scale, gesture.maxRatio), params.minRatio); 8866 gesture.imageEl.style.transitionDuration = "".concat(swiper.params.speed, "ms"); 8867 gesture.imageEl.style.transform = "translate3d(0,0,0) scale(".concat(zoom.scale, ")"); 8868 currentScale = zoom.scale; 8869 isScaling = false; 8870 if (zoom.scale > 1 && gesture.slideEl) { 8871 gesture.slideEl.classList.add("".concat(params.zoomedSlideClass)); 8872 } else if (zoom.scale <= 1 && gesture.slideEl) { 8873 gesture.slideEl.classList.remove("".concat(params.zoomedSlideClass)); 8874 } 8875 if (zoom.scale === 1) { 8876 gesture.originX = 0; 8877 gesture.originY = 0; 8878 gesture.slideEl = undefined; 8879 } 8880 } 8881 function onTouchStart(e) { 8882 var device = swiper.device; 8883 if (!gesture.imageEl) return; 8884 if (image.isTouched) return; 8885 if (device.android && e.cancelable) e.preventDefault(); 8886 image.isTouched = true; 8887 var event = evCache.length > 0 ? evCache[0] : e; 8888 image.touchesStart.x = event.pageX; 8889 image.touchesStart.y = event.pageY; 8890 } 8891 function onTouchMove(e) { 8892 if (!eventWithinSlide(e) || !eventWithinZoomContainer(e)) return; 8893 var zoom = swiper.zoom; 8894 if (!gesture.imageEl) return; 8895 if (!image.isTouched || !gesture.slideEl) return; 8896 if (!image.isMoved) { 8897 image.width = gesture.imageEl.offsetWidth; 8898 image.height = gesture.imageEl.offsetHeight; 8899 image.startX = (0, _utils.getTranslate)(gesture.imageWrapEl, 'x') || 0; 8900 image.startY = (0, _utils.getTranslate)(gesture.imageWrapEl, 'y') || 0; 8901 gesture.slideWidth = gesture.slideEl.offsetWidth; 8902 gesture.slideHeight = gesture.slideEl.offsetHeight; 8903 gesture.imageWrapEl.style.transitionDuration = '0ms'; 8904 } 8905 // Define if we need image drag 8906 var scaledWidth = image.width * zoom.scale; 8907 var scaledHeight = image.height * zoom.scale; 8908 if (scaledWidth < gesture.slideWidth && scaledHeight < gesture.slideHeight) return; 8909 image.minX = Math.min(gesture.slideWidth / 2 - scaledWidth / 2, 0); 8910 image.maxX = -image.minX; 8911 image.minY = Math.min(gesture.slideHeight / 2 - scaledHeight / 2, 0); 8912 image.maxY = -image.minY; 8913 image.touchesCurrent.x = evCache.length > 0 ? evCache[0].pageX : e.pageX; 8914 image.touchesCurrent.y = evCache.length > 0 ? evCache[0].pageY : e.pageY; 8915 var touchesDiff = Math.max(Math.abs(image.touchesCurrent.x - image.touchesStart.x), Math.abs(image.touchesCurrent.y - image.touchesStart.y)); 8916 if (touchesDiff > 5) { 8917 swiper.allowClick = false; 8918 } 8919 if (!image.isMoved && !isScaling) { 8920 if (swiper.isHorizontal() && (Math.floor(image.minX) === Math.floor(image.startX) && image.touchesCurrent.x < image.touchesStart.x || Math.floor(image.maxX) === Math.floor(image.startX) && image.touchesCurrent.x > image.touchesStart.x)) { 8921 image.isTouched = false; 8922 return; 8923 } 8924 if (!swiper.isHorizontal() && (Math.floor(image.minY) === Math.floor(image.startY) && image.touchesCurrent.y < image.touchesStart.y || Math.floor(image.maxY) === Math.floor(image.startY) && image.touchesCurrent.y > image.touchesStart.y)) { 8925 image.isTouched = false; 8926 return; 8927 } 8928 } 8929 if (e.cancelable) { 8930 e.preventDefault(); 8931 } 8932 e.stopPropagation(); 8933 image.isMoved = true; 8934 var scaleRatio = (zoom.scale - currentScale) / (gesture.maxRatio - swiper.params.zoom.minRatio); 8935 var originX = gesture.originX, 8936 originY = gesture.originY; 8937 image.currentX = image.touchesCurrent.x - image.touchesStart.x + image.startX + scaleRatio * (image.
8937width - originX * 2); 8938 image.currentY = image.touchesCurrent.y - image.touchesStart.y + image.startY + scaleRatio * (image.height - originY * 2); 8939 if (image.currentX < image.minX) { 8940 image.currentX = image.minX + 1 - Math.pow(image.minX - image.currentX + 1, 0.8); 8941 } 8942 if (image.currentX > image.maxX) { 8943 image.currentX = image.maxX - 1 + Math.pow(image.currentX - image.maxX + 1, 0.8); 8944 } 8945 if (image.currentY < image.minY) { 8946 image.currentY = image.minY + 1 - Math.pow(image.minY - image.currentY + 1, 0.8); 8947 } 8948 if (image.currentY > image.maxY) { 8949 image.currentY = image.maxY - 1 + Math.pow(image.currentY - image.maxY + 1, 0.8); 8950 } 8951 8952 // Velocity 8953 if (!velocity.prevPositionX) velocity.prevPositionX = image.touchesCurrent.x; 8954 if (!velocity.prevPositionY) velocity.prevPositionY = image.touchesCurrent.y; 8955 if (!velocity.prevTime) velocity.prevTime = Date.now(); 8956 velocity.x = (image.touchesCurrent.x - velocity.prevPositionX) / (Date.now() - velocity.prevTime) / 2; 8957 velocity.y = (image.touchesCurrent.y - velocity.prevPositionY) / (Date.now() - velocity.prevTime) / 2; 8958 if (Math.abs(image.touchesCurrent.x - velocity.prevPositionX) < 2) velocity.x = 0; 8959 if (Math.abs(image.touchesCurrent.y - velocity.prevPositionY) < 2) velocity.y = 0; 8960 velocity.prevPositionX = image.touchesCurrent.x; 8961 velocity.prevPositionY = image.touchesCurrent.y; 8962 velocity.prevTime = Date.now(); 8963 gesture.imageWrapEl.style.transform = "translate3d(".concat(image.currentX, "px, ").concat(image.currentY, "px,0)"); 8964 } 8965 function onTouchEnd() { 8966 var zoom = swiper.zoom; 8967 if (!gesture.imageEl) return; 8968 if (!image.isTouched || !image.isMoved) { 8969 image.isTouched = false; 8970 image.isMoved = false; 8971 return; 8972 } 8973 image.isTouched = false; 8974 image.isMoved = false; 8975 var momentumDurationX = 300; 8976 var momentumDurationY = 300; 8977 var momentumDistanceX = velocity.x * momentumDurationX; 8978 var newPositionX = image.currentX + momentumDistanceX; 8979 var momentumDistanceY = velocity.y * momentumDurationY; 8980 var newPositionY = image.currentY + momentumDistanceY; 8981 8982 // Fix duration 8983 if (velocity.x !== 0) momentumDurationX = Math.abs((newPositionX - image.currentX) / velocity.x); 8984 if (velocity.y !== 0) momentumDurationY = Math.abs((newPositionY - image.currentY) / velocity.y); 8985 var momentumDuration = Math.max(momentumDurationX, momentumDurationY); 8986 image.currentX = newPositionX; 8987 image.currentY = newPositionY; 8988 // Define if we need image drag 8989 var scaledWidth = image.width * zoom.scale; 8990 var scaledHeight = image.height * zoom.scale; 8991 image.minX = Math.min(gesture.slideWidth / 2 - scaledWidth / 2, 0); 8992 image.maxX = -image.minX; 8993 image.minY = Math.min(gesture.slideHeight / 2 - scaledHeight / 2, 0); 8994 image.maxY = -image.minY; 8995 image.currentX = Math.max(Math.min(image.currentX, image.maxX), image.minX); 8996 image.currentY = Math.max(Math.min(image.currentY, image.maxY), image.minY); 8997 gesture.imageWrapEl.style.transitionDuration = "".concat(momentumDuration, "ms"); 8998 gesture.imageWrapEl.style.transform = "translate3d(".concat(image.currentX, "px, ").concat(image.currentY, "px,0)"); 8999 } 9000 function onTransitionEnd() { 9001 var zoom = swiper.zoom; 9002 if (gesture.slideEl && swiper.activeIndex !== swiper.slides.indexOf(gesture.slideEl)) { 9003 if (gesture.imageEl) { 9004 gesture.imageEl.style.transform = 'translate3d(0,0,0) scale(1)'; 9005 } 9006 if (gesture.imageWrapEl) { 9007 gesture.imageWrapEl.style.transform = 'translate3d(0,0,0)'; 9008 } 9009 gesture.slideEl.classList.remove("".concat(swiper.params.zoom.zoomedSlideClass)); 9010 zoom.scale = 1; 9011 currentScale = 1; 9012 gesture.slideEl = undefined; 9013 gesture.imageEl = undefined; 9014 gesture.imageWrapEl = undefined; 9015 gesture.originX = 0; 9016 gesture.originY = 0; 9017 } 9018 } 9019 function zoomIn(e) { 9020 var zoom = swiper.zoom; 9021 var params = swiper.params.zoom; 9022 if (!gesture.slideEl) { 9023 if (e && e.target) { 9024 gesture.slideEl = e.target.closest(".".concat(swiper.params.slideClass, ", swiper-slide")); 9025 } 9026 if (!gesture.slideEl) { 9027 if (swiper.params.virtual && swiper.params.virtual.enabled && swiper.virtual) { 9028 gesture.slideEl = (0, _utils.elementChildren)(swiper.slidesEl, ".".concat(swiper.params.slideActiveClass))[0]; 9029 } else { 9030 gesture.slideEl = swiper.slides[swiper.activeIndex]; 9031 } 9032 } 9033 var imageEl = gesture.slideEl.querySelector(".".concat(params.containerClass)); 9034 if (imageEl) { 9035 imageEl = imageEl.querySelectorAll('picture, img, svg, canvas, .swiper-zoom-target')[0]; 9036 } 9037 gesture.imageEl = imageEl; 9038 if (imageEl) { 9039 gesture.imageWrapEl = (0, _utils.elementParents)(gesture.imageEl, ".".concat(params.containerClass))[0]; 9040 } else { 9041 gesture.imageWrapEl = undefined; 9042 } 9043 } 9044 if (!gesture.imageEl || !gesture.imageWrapEl) return; 9045 if (swiper.params.cssMode) { 9046 swiper.wrapperEl.style.overflow = 'hidden';
9047 swiper.wrapperEl.style.touchAction = 'none'; 9048 } 9049 gesture.slideEl.classList.add("".concat(params.zoomedSlideClass)); 9050 var touchX; 9051 var touchY; 9052 var offsetX; 9053 var offsetY; 9054 var diffX; 9055 var diffY; 9056 var translateX; 9057 var translateY; 9058 var imageWidth; 9059 var imageHeight; 9060 var scaledWidth; 9061 var scaledHeight; 9062 var translateMinX; 9063 var translateMinY; 9064 var translateMaxX; 9065 var translateMaxY; 9066 var slideWidth; 9067 var slideHeight; 9068 if (typeof image.touchesStart.x === 'undefined' && e) { 9069 touchX = e.pageX; 9070 touchY = e.pageY; 9071 } else { 9072 touchX = image.touchesStart.x; 9073 touchY = image.touchesStart.y; 9074 } 9075 var forceZoomRatio = typeof e === 'number' ? e : null; 9076 if (currentScale === 1 && forceZoomRatio) { 9077 touchX = undefined; 9078 touchY = undefined; 9079 } 9080 zoom.scale = forceZoomRatio || gesture.imageWrapEl.getAttribute('data-swiper-zoom') || params.maxRatio; 9081 currentScale = forceZoomRatio || gesture.imageWrapEl.getAttribute('data-swiper-zoom') || params.maxRatio; 9082 if (e && !(currentScale === 1 && forceZoomRatio)) { 9083 slideWidth = gesture.slideEl.offsetWidth; 9084 slideHeight = gesture.slideEl.offsetHeight; 9085 offsetX = (0, _utils.elementOffset)(gesture.slideEl).left + window.scrollX; 9086 offsetY = (0, _utils.elementOffset)(gesture.slideEl).top + window.scrollY; 9087 diffX = offsetX + slideWidth / 2 - touchX; 9088 diffY = offsetY + slideHeight / 2 - touchY; 9089 imageWidth = gesture.imageEl.offsetWidth; 9090 imageHeight = gesture.imageEl.offsetHeight; 9091 scaledWidth = imageWidth * zoom.scale; 9092 scaledHeight = imageHeight * zoom.scale; 9093 translateMinX = Math.min(slideWidth / 2 - scaledWidth / 2, 0); 9094 translateMinY = Math.min(slideHeight / 2 - scaledHeight / 2, 0); 9095 translateMaxX = -translateMinX; 9096 translateMaxY = -translateMinY; 9097 translateX = diffX * zoom.scale; 9098 translateY = diffY * zoom.scale; 9099 if (translateX < translateMinX) { 9100 translateX = translateMinX; 9101 } 9102 if (translateX > translateMaxX) { 9103 translateX = translateMaxX; 9104 } 9105 if (translateY < translateMinY) { 9106 translateY = translateMinY; 9107 } 9108 if (translateY > translateMaxY) { 9109 translateY = translateMaxY; 9110 } 9111 } else { 9112 translateX = 0; 9113 translateY = 0; 9114 } 9115 if (forceZoomRatio && zoom.scale === 1) { 9116 gesture.originX = 0; 9117 gesture.originY = 0; 9118 } 9119 gesture.imageWrapEl.style.transitionDuration = '300ms'; 9120 gesture.imageWrapEl.style.transform = "translate3d(".concat(translateX, "px, ").concat(translateY, "px,0)"); 9121 gesture.imageEl.style.transitionDuration = '300ms'; 9122 gesture.imageEl.style.transform = "translate3d(0,0,0) scale(".concat(zoom.scale, ")"); 9123 } 9124 function zoomOut() { 9125 var zoom = swiper.zoom; 9126 var params = swiper.params.zoom; 9127 if (!gesture.slideEl) { 9128 if (swiper.params.virtual && swiper.params.virtual.enabled && swiper.virtual) { 9129 gesture.slideEl = (0, _utils.elementChildren)(swiper.slidesEl, ".".concat(swiper.params.slideActiveClass))[0]; 9130 } else { 9131 gesture.slideEl = swiper.slides[swiper.activeIndex]; 9132 } 9133 var imageEl = gesture.slideEl.querySelector(".".concat(params.containerClass)); 9134 if (imageEl) { 9135 imageEl = imageEl.querySelectorAll('picture, img, svg, canvas, .swiper-zoom-target')[0]; 9136 } 9137 gesture.imageEl = imageEl; 9138 if (imageEl) { 9139 gesture.imageWrapEl = (0, _utils.elementParents)(gesture.imageEl, ".".concat(params.containerClass))[0]; 9140 } else { 9141 gesture.imageWrapEl = undefined; 9142 } 9143 } 9144 if (!gesture.imageEl || !gesture.imageWrapEl) return; 9145 if (swiper.params.cssMode) { 9146 swiper.wrapperEl.style.overflow = ''; 9147 swiper.wrapperEl.style.touchAction = ''; 9148 } 9149 zoom.scale = 1; 9150 currentScale = 1; 9151 gesture.imageWrapEl.style.transitionDuration = '300ms'; 9152 gesture.imageWrapEl.style.transform = 'translate3d(0,0,0)'; 9153 gesture.imageEl.style.transitionDuration = '300ms';
9154 gesture.imageEl.style.transform = 'translate3d(0,0,0) scale(1)'; 9155 gesture.slideEl.classList.remove("".concat(params.zoomedSlideClass)); 9156 gesture.slideEl = undefined; 9157 gesture.originX = 0; 9158 gesture.originY = 0; 9159 } 9160 9161 // Toggle Zoom 9162 function zoomToggle(e) { 9163 var zoom = swiper.zoom; 9164 if (zoom.scale && zoom.scale !== 1) { 9165 // Zoom Out 9166 zoomOut(); 9167 } else { 9168 // Zoom In 9169 zoomIn(e); 9170 } 9171 } 9172 function getListeners() { 9173 var passiveListener = swiper.params.passiveListeners ? { 9174 passive: true, 9175 capture: false 9176 } : false; 9177 var activeListenerWithCapture = swiper.params.passiveListeners ? { 9178 passive: false, 9179 capture: true 9180 } : true; 9181 return { 9182 passiveListener: passiveListener, 9183 activeListenerWithCapture: activeListenerWithCapture 9184 }; 9185 } 9186 9187 // Attach/Detach Events 9188 function enable() { 9189 var zoom = swiper.zoom; 9190 if (zoom.enabled) return; 9191 zoom.enabled = true; 9192 var _getListeners = getListeners(), 9193 passiveListener = _getListeners.passiveListener, 9194 activeListenerWithCapture = _getListeners.activeListenerWithCapture; 9195 9196 // Scale image 9197 swiper.wrapperEl.addEventListener('pointerdown', onGestureStart, passiveListener); 9198 swiper.wrapperEl.addEventListener('pointermove', onGestureChange, activeListenerWithCapture); 9199 ['pointerup', 'pointercancel', 'pointerout'].forEach(function (eventName) { 9200 swiper.wrapperEl.addEventListener(eventName, onGestureEnd, passiveListener); 9201 }); 9202 9203 // Move image 9204 swiper.wrapperEl.addEventListener('pointermove', onTouchMove, activeListenerWithCapture); 9205 } 9206 function disable() { 9207 var zoom = swiper.zoom; 9208 if (!zoom.enabled) return; 9209 zoom.enabled = false; 9210 var _getListeners2 = getListeners(), 9211 passiveListener = _getListeners2.passiveListener, 9212 activeListenerWithCapture = _getListeners2.activeListenerWithCapture; 9213 9214 // Scale image 9215 swiper.wrapperEl.removeEventListener('pointerdown', onGestureStart, passiveListener); 9216 swiper.wrapperEl.removeEventListener('pointermove', onGestureChange, activeListenerWithCapture); 9217 ['pointerup', 'pointercancel', 'pointerout'].forEach(function (eventName) { 9218 swiper.wrapperEl.removeEventListener(eventName, onGestureEnd, passiveListener); 9219 }); 9220 9221 // Move image 9222 swiper.wrapperEl.removeEventListener('pointermove', onTouchMove, activeListenerWithCapture); 9223 } 9224 on('init', function () { 9225 if (swiper.params.zoom.enabled) { 9226 enable(); 9227 } 9228 }); 9229 on('destroy', function () { 9230 disable(); 9231 }); 9232 on('touchStart', function (_s, e) { 9233 if (!swiper.zoom.enabled) return; 9234 onTouchStart(e); 9235 }); 9236 on('touchEnd', function (_s, e) { 9237 if (!swiper.zoom.enabled) return; 9238 onTouchEnd(e); 9239 }); 9240 on('doubleTap', function (_s, e) { 9241 if (!swiper.animating && swiper.params.zoom.enabled && swiper.zoom.enabled && swiper.params.zoom.toggle) { 9242 zoomToggle(e); 9243 } 9244 }); 9245 on('transitionEnd', function () { 9246 if (swiper.zoom.enabled && swiper.params.zoom.enabled) { 9247 onTransitionEnd(); 9248 } 9249 }); 9250 on('slideChange', function () { 9251 if (swiper.zoom.enabled && swiper.params.zoom.enabled && swiper.params.cssMode) { 9252 onTransitionEnd(); 9253 } 9254 }); 9255 Object.assign(swiper.zoom, { 9256 enable: enable, 9257 disable: disable, 9258 "in": zoomIn, 9259 out: zoomOut, 9260 toggle: zoomToggle 9261 }); 9262} 9263 9264},{"../../shared/utils.js":97,"ssr-window":1}],87:[function(require,module,exports){ 9265"use strict"; 9266 9267Object.defineProperty(exports, "__esModule", { 9268 value: true 9269}); 9270exports["default"] = classesToSelector; 9271function classesToSelector() { 9272 var classes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; 9273 return ".".concat(classes.trim().replace(/([\.:!+\/])/g, '\\$1') // eslint-disable-line 9274 .replace(/ /g, '.')); 9275} 9276 9277},{}],88:[function(require,module,exports){ 9278"use strict"; 9279 9280Object.defineProperty(exports, "__esModule", { 9281 value: true 9282}); 9283exports["default"] = createElementIfNotDefined; 9284var _utils = require("./utils.js"); 9285function createElementIfNotDefined(swiper, originalParams, params, checkProps) { 9286 if (swiper.params.createElements) {
9287 Object.keys(checkProps).forEach(function (key) { 9288 if (!params[key] && params.auto === true) { 9289 var element = (0, _utils.elementChildren)(swiper.el, ".".concat(checkProps[key]))[0]; 9290 if (!element) { 9291 element = (0, _utils.createElement)('div', checkProps[key]); 9292 element.className = checkProps[key]; 9293 swiper.el.append(element); 9294 } 9295 params[key] = element; 9296 originalParams[key] = element; 9297 } 9298 }); 9299 } 9300 return params; 9301} 9302 9303},{"./utils.js":97}],89:[function(require,module,exports){ 9304"use strict"; 9305 9306Object.defineProperty(exports, "__esModule", { 9307 value: true 9308}); 9309exports["default"] = createShadow; 9310var _utils = require("./utils.js"); 9311function createShadow(params, slideEl, side) { 9312 var shadowClass = "swiper-slide-shadow".concat(side ? "-".concat(side) : ''); 9313 var shadowContainer = (0, _utils.getSlideTransformEl)(slideEl); 9314 var shadowEl = shadowContainer.querySelector(".".concat(shadowClass)); 9315 if (!shadowEl) { 9316 shadowEl = (0, _utils.createElement)('div', "swiper-slide-shadow".concat(side ? "-".concat(side) : '')); 9317 shadowContainer.append(shadowEl); 9318 } 9319 return shadowEl; 9320} 9321 9322},{"./utils.js":97}],90:[function(require,module,exports){ 9323"use strict"; 9324 9325Object.defineProperty(exports, "__esModule", { 9326 value: true 9327}); 9328exports["default"] = effectInit; 9329function effectInit(params) { 9330 var effect = params.effect, 9331 swiper = params.swiper, 9332 on = params.on, 9333 setTranslate = params.setTranslate, 9334 setTransition = params.setTransition, 9335 overwriteParams = params.overwriteParams, 9336 perspective = params.perspective, 9337 recreateShadows = params.recreateShadows, 9338 getEffectParams = params.getEffectParams; 9339 on('beforeInit', function () { 9340 if (swiper.params.effect !== effect) return; 9341 swiper.classNames.push("".concat(swiper.params.containerModifierClass).concat(effect)); 9342 if (perspective && perspective()) { 9343 swiper.classNames.push("".concat(swiper.params.containerModifierClass, "3d")); 9344 } 9345 var overwriteParamsResult = overwriteParams ? overwriteParams() : {}; 9346 Object.assign(swiper.params, overwriteParamsResult); 9347 Object.assign(swiper.originalParams, overwriteParamsResult); 9348 }); 9349 on('setTranslate', function () { 9350 if (swiper.params.effect !== effect) return; 9351 setTranslate(); 9352 }); 9353 on('setTransition', function (_s, duration) { 9354 if (swiper.params.effect !== effect) return; 9355 setTransition(duration); 9356 }); 9357 on('transitionEnd', function () { 9358 if (swiper.params.effect !== effect) return; 9359 if (recreateShadows) { 9360 if (!getEffectParams || !getEffectParams().slideShadows) return; 9361 // remove shadows 9362 swiper.slides.forEach(function (slideEl) { 9363 slideEl.querySelectorAll('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left').forEach(function (shadowEl) { 9364 return shadowEl.remove(); 9365 }); 9366 }); 9367 // create new one 9368 recreateShadows(); 9369 } 9370 }); 9371 var requireUpdateOnVirtual; 9372 on('virtualUpdate', function () { 9373 if (swiper.params.effect !== effect) return; 9374 if (!swiper.slides.length) { 9375 requireUpdateOnVirtual = true; 9376 } 9377 requestAnimationFrame(function () { 9378 if (requireUpdateOnVirtual && swiper.slides && swiper.slides.length) { 9379 setTranslate(); 9380 requireUpdateOnVirtual = false; 9381 } 9382 }); 9383 }); 9384} 9385 9386},{}],91:[function(require,module,exports){ 9387"use strict"; 9388 9389Object.defineProperty(exports, "__esModule", { 9390 value: true 9391}); 9392exports["default"] = effectTarget; 9393var _utils = require("./utils.js"); 9394function effectTarget(effectParams, slideEl) { 9395 var transformEl = (0, _utils.getSlideTransformEl)(slideEl); 9396 if (transformEl !== slideEl) { 9397 transformEl.style.backfaceVisibility = 'hidden'; 9398 transformEl.style['-webkit-backface-visibility'] = 'hidden'; 9399 } 9400 return transformEl; 9401} 9402 9403},{"./utils.js":97}],92:[function(require,module,exports){ 9404"use strict"; 9405 9406Object.defineProperty(exports, "__esModule", { 9407 value: true 9408}); 9409exports["default"] = effectVirtualTransitionEnd; 9410var _utils = require("./utils.js"); 9411function effectVirtualTransitionEnd(_ref) { 9412 var swiper = _ref.swiper, 9413 duration = _ref.duration, 9414 transformElements = _ref.transformElements, 9415 allSlides = _ref.allSlides; 9416 var activeIndex = swiper.activeIndex; 9417 var getSlide = function getSlide(el) { 9418 if (!el.parentElement) { 9419 // assume shadow root 9420 var slide = swiper.slides.filter(function (slideEl) { 9421 return slideEl.shadowEl && slideEl.shadowEl === el.parentNode; 9422 })[0]; 9423 return slide; 9424 } 9425 return el.parentElement; 9426 }; 9427 if (swiper.params.virtualTranslate && duration !== 0) { 9428 var eventTriggered = false;
9429 var transitionEndTarget; 9430 if (allSlides) { 9431 transitionEndTarget = transformElements; 9432 } else { 9433 transitionEndTarget = transformElements.filter(function (transformEl) { 9434 var el = transformEl.classList.contains('swiper-slide-transform') ? getSlide(transformEl) : transformEl; 9435 return swiper.getSlideIndex(el) === activeIndex; 9436 }); 9437 } 9438 transitionEndTarget.forEach(function (el) { 9439 (0, _utils.elementTransitionEnd)(el, function () { 9440 if (eventTriggered) return; 9441 if (!swiper || swiper.destroyed) return; 9442 eventTriggered = true; 9443 swiper.animating = false; 9444 var evt = new window.CustomEvent('transitionend', { 9445 bubbles: true, 9446 cancelable: true 9447 }); 9448 swiper.wrapperEl.dispatchEvent(evt); 9449 }); 9450 }); 9451 } 9452} 9453 9454},{"./utils.js":97}],93:[function(require,module,exports){ 9455"use strict"; 9456 9457Object.defineProperty(exports, "__esModule", { 9458 value: true 9459}); 9460exports.getBrowser = getBrowser; 9461var _ssrWindow = require("ssr-window"); 9462function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } 9463function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } 9464function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } 9465function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } 9466function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } 9467function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } 9468var browser; 9469function calcBrowser() { 9470 var window = (0, _ssrWindow.getWindow)(); 9471 var needPerspectiveFix = false; 9472 function isSafari() { 9473 var ua = window.navigator.userAgent.toLowerCase(); 9474 return ua.indexOf('safari') >= 0 && ua.indexOf('chrome') < 0 && ua.indexOf('android') < 0; 9475 } 9476 if (isSafari()) { 9477 var ua = String(window.navigator.userAgent); 9478 if (ua.includes('Version/')) { 9479 var _ua$split$1$split$0$s = ua.split('Version/')[1].split(' ')[0].split('.').map(function (num) { 9480 return Number(num); 9481 }), 9482 _ua$split$1$split$0$s2 = _slicedToArray(_ua$split$1$split$0$s, 2), 9483 major = _ua$split$1$split$0$s2[0], 9484 minor = _ua$split$1$split$0$s2[1]; 9485 needPerspectiveFix = major < 16 || major === 16 && minor < 2; 9486 } 9487 } 9488 return { 9489 isSafari: needPerspectiveFix || isSafari(), 9490 needPerspectiveFix: needPerspectiveFix, 9491 isWebView: /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(window.navigator.userAgent) 9492 }; 9493} 9494function getBrowser() { 9495 if (!browser) { 9496 browser = calcBrowser(); 9497 } 9498 return browser; 9499} 9500 9501},{"ssr-window":1}],94:[function(require,module,exports){ 9502"use strict"; 9503 9504Object.defineProperty(exports, "__esModule", { 9505 value: true 9506}); 9507exports.getDevice = getDevice; 9508var _ssrWindow = require("ssr-window"); 9509var _getSupport = require("./get-support.js"); 9510var deviceCached; 9511function calcDevice() { 9512 var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, 9513 userAgent = _ref.userAgent;
9514 var support = (0, _getSupport.getSupport)(); 9515 var window = (0, _ssrWindow.getWindow)(); 9516 var platform = window.navigator.platform; 9517 var ua = userAgent || window.navigator.userAgent; 9518 var device = { 9519 ios: false, 9520 android: false 9521 }; 9522 var screenWidth = window.screen.width; 9523 var screenHeight = window.screen.height; 9524 var android = ua.match(/(Android);?[\s\/]+([\d.]+)?/); // eslint-disable-line 9525 var ipad = ua.match(/(iPad).*OS\s([\d_]+)/); 9526 var ipod = ua.match(/(iPod)(.*OS\s([\d_]+))?/); 9527 var iphone = !ipad && ua.match(/(iPhone\sOS|iOS)\s([\d_]+)/); 9528 var windows = platform === 'Win32'; 9529 var macos = platform === 'MacIntel'; 9530 9531 // iPadOs 13 fix 9532 var iPadScreens = ['1024x1366', '1366x1024', '834x1194', '1194x834', '834x1112', '1112x834', '768x1024', '1024x768', '820x1180', '1180x820', '810x1080', '1080x810']; 9533 if (!ipad && macos && support.touch && iPadScreens.indexOf("".concat(screenWidth, "x").concat(screenHeight)) >= 0) { 9534 ipad = ua.match(/(Version)\/([\d.]+)/); 9535 if (!ipad) ipad = [0, 1, '13_0_0']; 9536 macos = false; 9537 } 9538 9539 // Android 9540 if (android && !windows) { 9541 device.os = 'android'; 9542 device.android = true; 9543 } 9544 if (ipad || iphone || ipod) { 9545 device.os = 'ios'; 9546 device.ios = true; 9547 } 9548 9549 // Export object 9550 return device; 9551} 9552function getDevice() { 9553 var overrides = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; 9554 if (!deviceCached) { 9555 deviceCached = calcDevice(overrides); 9556 } 9557 return deviceCached; 9558} 9559 9560},{"./get-support.js":95,"ssr-window":1}],95:[function(require,module,exports){ 9561"use strict"; 9562 9563Object.defineProperty(exports, "__esModule", { 9564 value: true 9565});
9566exports.getSupport = getSupport; 9567var _ssrWindow = require("ssr-window"); 9568var support; 9569function calcSupport() { 9570 var window = (0, _ssrWindow.getWindow)(); 9571 var document = (0, _ssrWindow.getDocument)(); 9572 return { 9573 smoothScroll: document.documentElement && document.documentElement.style && 'scrollBehavior' in document.documentElement.style, 9574 touch: !!('ontouchstart' in window || window.DocumentTouch && document instanceof window.DocumentTouch) 9575 }; 9576} 9577function getSupport() { 9578 if (!support) { 9579 support = calcSupport(); 9580 } 9581 return support; 9582} 9583 9584},{"ssr-window":1}],96:[function(require,module,exports){ 9585"use strict"; 9586 9587Object.defineProperty(exports, "__esModule", { 9588 value: true 9589}); 9590exports.processLazyPreloader = exports.preload = void 0; 9591var processLazyPreloader = function processLazyPreloader(swiper, imageEl) { 9592 if (!swiper || swiper.destroyed || !swiper.params) return; 9593 var slideSelector = function slideSelector() { 9594 return swiper.isElement ? "swiper-slide" : ".".concat(swiper.params.slideClass); 9595 }; 9596 var slideEl = imageEl.closest(slideSelector()); 9597 if (slideEl) { 9598 var lazyEl = slideEl.querySelector(".".concat(swiper.params.lazyPreloaderClass)); 9599 if (lazyEl) lazyEl.remove(); 9600 } 9601}; 9602exports.processLazyPreloader = processLazyPreloader; 9603var unlazy = function unlazy(swiper, index) { 9604 if (!swiper.slides[index]) return; 9605 var imageEl = swiper.slides[index].querySelector('[loading="lazy"]'); 9606 if (imageEl) imageEl.removeAttribute('loading'); 9607}; 9608var preload = function preload(swiper) { 9609 if (!swiper || swiper.destroyed || !swiper.params) return; 9610 var amount = swiper.params.lazyPreloadPrevNext; 9611 var len = swiper.slides.length; 9612 if (!len || !amount || amount < 0) return; 9613 amount = Math.min(amount, len); 9614 var slidesPerView = swiper.params.slidesPerView === 'auto' ? swiper.slidesPerViewDynamic() : Math.ceil(swiper.params.slidesPerView); 9615 var activeIndex = swiper.activeIndex; 9616 var slideIndexLastInView = activeIndex + slidesPerView - 1; 9617 if (swiper.params.rewind) { 9618 for (var i = activeIndex - amount; i <= slideIndexLastInView + amount; i += 1) { 9619 var realIndex = (i % len + len) % len; 9620 if (realIndex !== activeIndex && realIndex > slideIndexLastInView) unlazy(swiper, realIndex); 9621 } 9622 } else { 9623 for (var _i = Math.max(slideIndexLastInView - amount, 0); _i <= Math.min(slideIndexLastInView + amount, len - 1); _i += 1) { 9624 if (_i !== activeIndex && _i > slideIndexLastInView) unlazy(swiper, _i); 9625 } 9626 } 9627}; 9628exports.preload = preload; 9629 9630},{}],97:[function(require,module,exports){ 9631"use strict"; 9632 9633Object.defineProperty(exports, "__esModule", { 9634 value: true 9635}); 9636exports.animateCSSModeScroll = animateCSSModeScroll; 9637exports.createElement = createElement; 9638exports.deleteProps = deleteProps; 9639exports.elementChildren = elementChildren; 9640exports.elementIndex = elementIndex; 9641exports.elementNextAll = elementNextAll; 9642exports.elementOffset = elementOffset; 9643exports.elementOuterSize = elementOuterSize; 9644exports.elementParents = elementParents; 9645exports.elementPrevAll = elementPrevAll; 9646exports.elementStyle = elementStyle; 9647exports.elementTransitionEnd = elementTransitionEnd; 9648exports.extend = extend; 9649exports.findElementsInElements = findElementsInElements; 9650exports.getComputedStyle = getComputedStyle; 9651exports.getSlideTransformEl = getSlideTransformEl; 9652exports.getTranslate = getTranslate; 9653exports.isObject = isObject; 9654exports.nextTick = nextTick; 9655exports.now = now; 9656exports.setCSSProperty = setCSSProperty; 9657var _ssrWindow = require("ssr-window"); 9658function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } 9659function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } 9660function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } 9661function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } 9662function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } 9663function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } 9664function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } 9665function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string");
9665 return _typeof(key) === "symbol" ? key : String(key); } 9666function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } 9667function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } 9668function deleteProps(obj) { 9669 var object = obj; 9670 Object.keys(object).forEach(function (key) { 9671 try { 9672 object[key] = null; 9673 } catch (e) { 9674 // no getter for object 9675 } 9676 try { 9677 delete object[key]; 9678 } catch (e) { 9679 // something got wrong 9680 } 9681 }); 9682} 9683function nextTick(callback) { 9684 var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; 9685 return setTimeout(callback, delay); 9686} 9687function now() { 9688 return Date.now(); 9689} 9690function getComputedStyle(el) { 9691 var window = (0, _ssrWindow.getWindow)(); 9692 var style; 9693 if (window.getComputedStyle) { 9694 style = window.getComputedStyle(el, null); 9695 } 9696 if (!style && el.currentStyle) { 9697 style = el.currentStyle; 9698 } 9699 if (!style) { 9700 style = el.style; 9701 } 9702 return style; 9703} 9704function getTranslate(el) { 9705 var axis = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'x'; 9706 var window = (0, _ssrWindow.getWindow)(); 9707 var matrix; 9708 var curTransform; 9709 var transformMatrix; 9710 var curStyle = getComputedStyle(el, null); 9711 if (window.WebKitCSSMatrix) { 9712 curTransform = curStyle.transform || curStyle.webkitTransform; 9713 if (curTransform.split(',').length > 6) { 9714 curTransform = curTransform.split(', ').map(function (a) { 9715 return a.replace(',', '.'); 9716 }).join(', '); 9717 } 9718 // Some old versions of Webkit choke when 'none' is passed; pass 9719 // empty string instead in this case 9720 transformMatrix = new window.WebKitCSSMatrix(curTransform === 'none' ? '' : curTransform); 9721 } else { 9722 transformMatrix = curStyle.MozTransform || curStyle.OTransform || curStyle.MsTransform || curStyle.msTransform || curStyle.transform || curStyle.getPropertyValue('transform').replace('translate(', 'matrix(1, 0, 0, 1,'); 9723 matrix = transformMatrix.toString().split(','); 9724 } 9725 if (axis === 'x') { 9726 // Latest Chrome and webkits Fix 9727 if (window.WebKitCSSMatrix) curTransform = transformMatrix.m41; 9728 // Crazy IE10 Matrix 9729 else if (matrix.length === 16) curTransform = parseFloat(matrix[12]); 9730 // Normal Browsers 9731 else curTransform = parseFloat(matrix[4]); 9732 } 9733 if (axis === 'y') { 9734 // Latest Chrome and webkits Fix 9735 if (window.WebKitCSSMatrix) curTransform = transformMatrix.m42; 9736 // Crazy IE10 Matrix 9737 else if (matrix.length === 16) curTransform = parseFloat(matrix[13]); 9738 // Normal Browsers 9739 else curTransform = parseFloat(matrix[5]); 9740 } 9741 return curTransform || 0; 9742} 9743function isObject(o) { 9744 return _typeof(o) === 'object' && o !== null && o.constructor && Object.prototype.toString.call(o).slice(8, -1) === 'Object'; 9745} 9746function isNode(node) { 9747 // eslint-disable-next-line 9748 if (typeof window !== 'undefined' && typeof window.HTMLElement !== 'undefined') { 9749 return node instanceof HTMLElement; 9750 } 9751 return node && (node.nodeType === 1 || node.nodeType === 11); 9752} 9753function extend() { 9754 var to = Object(arguments.length <= 0 ? undefined : arguments[0]); 9755 var noExtend = ['__proto__', 'constructor', 'prototype']; 9756 for (var i = 1; i < arguments.length; i += 1) { 9757 var nextSource = i < 0 || arguments.length <= i ? undefined : arguments[i]; 9758 if (nextSource !== undefined && nextSource !== null && !isNode(nextSource)) { 9759 var keysArray = Object.keys(Object(nextSource)).filter(function (key) { 9760 return noExtend.indexOf(key) < 0; 9761 }); 9762 for (var nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex += 1) { 9763 var nextKey = keysArray[nextIndex]; 9764 var desc = Object.getOwnPropertyDescriptor(nextSource, nextKey); 9765 if (desc !== undefined && desc.enumerable) { 9766 if (isObject(to[nextKey]) && isObject(nextSource[nextKey])) { 9767 if (nextSource[nextKey].__swiper__) { 9768 to[nextKey] = nextSource[nextKey]; 9769 } else { 9770 extend(to[nextKey], nextSource[nextKey]); 9771 } 9772 } else if (!isObject(to[nextKey]) && isObject(nextSource[nextKey])) { 9773 to[nextKey] = {}; 9774 if (nextSource[nextKey].__swiper__) { 9775 to[nextKey] = nextSource[nextKey]; 9776 } else { 9777 extend(to[nextKey], nextSource[nextKey]); 9778 } 9779 } else { 9780 to[nextKey] = nextSource[nextKey]; 9781 } 9782 } 9783 } 9784 } 9785 } 9786 return to; 9787} 9788function setCSSProperty(el, varName, varValue) { 9789 el.style.setProperty(varName, varValue); 9790} 9791function animateCSSModeScroll(_ref) { 9792 var swiper = _ref.swiper, 9793 targetPosition = _ref.targetPosition, 9794 side = _ref.side; 9795 var window = (0, _ssrWindow.getWindow)(); 9796 var startPosition = -swiper.translate; 9797 var startTime = null; 9798 var time; 9799 var duration = swiper.params.speed; 9800 swiper.wrapperEl.style.scrollSnapType = 'none'; 9801 window.cancelAnimationFrame(swiper.cssModeFrameID); 9802 var dir = targetPosition > startPosition ? 'next' : 'prev'; 9803 var isOutOfBound = function isOutOfBound(current, target) { 9804 return dir === 'next' && current >= target || dir === 'prev' && current <= target; 9805 }; 9806 var animate = function animate() { 9807 time = new Date().getTime(); 9808 if (startTime === null) { 9809 startTime = time; 9810 } 9811 var progress = Math.max(Math.min((time - startTime) / duration, 1), 0); 9812 var easeProgress = 0.5 - Math.cos(progress * Math.PI) / 2; 9813 var currentPosition = startPosition + easeProgress * (targetPosition - startPosition); 9814 if (isOutOfBound(currentPosition, targetPosition)) { 9815 currentPosition = targetPosition; 9816 } 9817 swiper.wrapperEl.scrollTo(_defineProperty({}, side, currentPosition)); 9818 if (isOutOfBound(currentPosition, targetPosition)) { 9819 swiper.wrapperEl.style.overflow = 'hidden'; 9820 swiper.wrapperEl.style.scrollSnapType = ''; 9821 setTimeout(function () { 9822 swiper.wrapperEl.style.overflow = ''; 9823 swiper.wrapperEl.scrollTo(_defineProperty({}, side, currentPosition)); 9824 }); 9825 window.cancelAnimationFrame(swiper.cssModeFrameID); 9826 return; 9827 } 9828 swiper.cssModeFrameID = window.requestAnimationFrame(animate); 9829 }; 9830 animate(); 9831} 9832function getSlideTransformEl(slideEl) { 9833 return slideEl.querySelector('.swiper-slide-transform') || slideEl.shadowEl && slideEl.shadowEl.querySelector('.swiper-slide-transform') || slideEl; 9834} 9835function findElementsInElements() { 9836 var elements = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; 9837 var selector = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; 9838 var found = [];
9839 elements.forEach(function (el) { 9840 found.push.apply(found, _toConsumableArray(el.querySelectorAll(selector))); 9841 }); 9842 return found; 9843} 9844function elementChildren(element) { 9845 var selector = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; 9846 return _toConsumableArray(element.children).filter(function (el) { 9847 return el.matches(selector); 9848 }); 9849} 9850function createElement(tag) { 9851 var _el$classList; 9852 var classes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; 9853 var el = document.createElement(tag); 9854 (_el$classList = el.classList).add.apply(_el$classList, _toConsumableArray(Array.isArray(classes) ? classes : [classes])); 9855 return el; 9856} 9857function elementOffset(el) { 9858 var window = (0, _ssrWindow.getWindow)(); 9859 var document = (0, _ssrWindow.getDocument)(); 9860 var box = el.getBoundingClientRect(); 9861 var body = document.body; 9862 var clientTop = el.clientTop || body.clientTop || 0; 9863 var clientLeft = el.clientLeft || body.clientLeft || 0; 9864 var scrollTop = el === window ? window.scrollY : el.scrollTop; 9865 var scrollLeft = el === window ? window.scrollX : el.scrollLeft; 9866 return { 9867 top: box.top + scrollTop - clientTop, 9868 left: box.left + scrollLeft - clientLeft 9869 }; 9870} 9871function elementPrevAll(el, selector) { 9872 var prevEls = []; 9873 while (el.previousElementSibling) { 9874 var prev = el.previousElementSibling; // eslint-disable-line 9875 if (selector) { 9876 if (prev.matches(selector)) prevEls.push(prev); 9877 } else prevEls.push(prev); 9878 el = prev; 9879 } 9880 return prevEls; 9881} 9882function elementNextAll(el, selector) { 9883 var nextEls = []; 9884 while (el.nextElementSibling) { 9885 var next = el.nextElementSibling; // eslint-disable-line 9886 if (selector) { 9887 if (next.matches(selector)) nextEls.push(next); 9888 } else nextEls.push(next); 9889 el = next; 9890 } 9891 return nextEls; 9892} 9893function elementStyle(el, prop) { 9894 var window = (0, _ssrWindow.getWindow)(); 9895 return window.getComputedStyle(el, null).getPropertyValue(prop); 9896} 9897function elementIndex(el) { 9898 var child = el; 9899 var i; 9900 if (child) { 9901 i = 0; 9902 // eslint-disable-next-line 9903 while ((child = child.previousSibling) !== null) { 9904 if (child.nodeType === 1) i += 1; 9905 } 9906 return i; 9907 } 9908 return undefined; 9909} 9910function elementParents(el, selector) { 9911 var parents = []; // eslint-disable-line 9912 var parent = el.parentElement; // eslint-disable-line 9913 while (parent) { 9914 if (selector) { 9915 if (parent.matches(selector)) parents.push(parent); 9916 } else { 9917 parents.push(parent); 9918 } 9919 parent = parent.parentElement; 9920 } 9921 return parents; 9922} 9923function elementTransitionEnd(el, callback) { 9924 function fireCallBack(e) { 9925 if (e.target !== el) return; 9926 callback.call(el, e); 9927 el.removeEventListener('transitionend', fireCallBack); 9928 } 9929 if (callback) { 9930 el.addEventListener('transitionend', fireCallBack); 9931 } 9932} 9933function elementOuterSize(el, size, includeMargins) { 9934 var window = (0, _ssrWindow.getWindow)(); 9935 if (includeMargins) { 9936 return el[size === 'width' ? 'offsetWidth' : 'offsetHeight'] + parseFloat(window.getComputedStyle(el, null).getPropertyValue(size === 'width' ? 'margin-right' : 'margin-top')) + parseFloat(window.getComputedStyle(el, null).getPropertyValue(size === 'width' ? 'margin-left' : 'margin-bottom')); 9937 } 9938 return el.offsetWidth; 9939} 9940 9941},{"ssr-window":1}],98:[function(require,module,exports){ 9942"use strict"; 9943 9944Object.defineProperty(exports, "__esModule", { 9945 value: true 9946}); 9947Object.defineProperty(exports, "A11y", { 9948 enumerable: true, 9949 get: function get() { 9950 return _a11y["default"]; 9951 } 9952}); 9953Object.defineProperty(exports, "Autoplay", { 9954 enumerable: true, 9955 get: function get() { 9956 return _autoplay["default"]; 9957 } 9958}); 9959Object.defineProperty(exports, "Controller", { 9960 enumerable: true, 9961 get: function get() { 9962 return _controller["default"]; 9963 } 9964}); 9965Object.defineProperty(exports, "EffectCards", { 9966 enumerable: true, 9967 get: function get() { 9968 return _effectCards["default"]; 9969 } 9970}); 9971Object.defineProperty(exports, "EffectCoverflow", { 9972 enumerable: true, 9973 get: function get() { 9974 return _effectCoverflow["default"]; 9975 } 9976}); 9977Object.defineProperty(exports, "EffectCreative", { 9978 enumerable: true, 9979 get: function get() { 9980 return _effectCreative["default"]; 9981 } 9982}); 9983Object.defineProperty(exports, "EffectCube", { 9984 enumerable: true, 9985 get: function get() { 9986 return _effectCube["default"]; 9987 } 9988}); 9989Object.defineProperty(exports, "EffectFade", { 9990 enumerable: true, 9991 get: function get() { 9992 return _effectFade["default"]; 9993 } 9994}); 9995Object.defineProperty(exports, "EffectFlip", { 9996 enumerable: true, 9997 get: function get() { 9998 return _effectFlip["default"]; 9999 } 10000}); 10001Object.defineProperty(exports, "FreeMode", { 10002 enumerable: true, 10003 get: function get() { 10004 return _freeMode["default"]; 10005 } 10006}); 10007Object.defineProperty(exports, "Grid", { 10008 enumerable: true, 10009 get: function get() { 10010 return _grid["default"]; 10011 } 10012}); 10013Object.defineProperty(exports, "HashNavigation", { 10014 enumerable: true, 10015 get: function get() { 10016 return _hashNavigation["default"]; 10017 } 10018}); 10019Object.defineProperty(exports, "History", { 10020 enumerable: true, 10021 get: function get() { 10022 return _history["default"]; 10023 } 10024}); 10025Object.defineProperty(exports, "Keyboard", { 10026 enumerable: true, 10027 get: function get() { 10028 return _keyboard["default"]; 10029 } 10030}); 10031Object.defineProperty(exports, "Manipulation", { 10032 enumerable: true, 10033 get: function get() { 10034 return _manipulation["default"]; 10035 } 10036}); 10037Object.defineProperty(exports, "Mousewheel", { 10038 enumerable: true, 10039 get: function get() {
10040 return _mousewheel["default"]; 10041 } 10042}); 10043Object.defineProperty(exports, "Navigation", { 10044 enumerable: true, 10045 get: function get() { 10046 return _navigation["default"]; 10047 } 10048}); 10049Object.defineProperty(exports, "Pagination", { 10050 enumerable: true, 10051 get: function get() { 10052 return _pagination["default"]; 10053 } 10054}); 10055Object.defineProperty(exports, "Parallax", { 10056 enumerable: true, 10057 get: function get() { 10058 return _parallax["default"]; 10059 } 10060}); 10061Object.defineProperty(exports, "Scrollbar", { 10062 enumerable: true, 10063 get: function get() { 10064 return _scrollbar["default"]; 10065 } 10066}); 10067Object.defineProperty(exports, "Swiper", { 10068 enumerable: true, 10069 get: function get() { 10070 return _core["default"]; 10071 } 10072}); 10073Object.defineProperty(exports, "Thumbs", { 10074 enumerable: true, 10075 get: function get() { 10076 return _thumbs["default"]; 10077 } 10078}); 10079Object.defineProperty(exports, "Virtual", { 10080 enumerable: true, 10081 get: function get() { 10082 return _virtual["default"]; 10083 } 10084}); 10085Object.defineProperty(exports, "Zoom", { 10086 enumerable: true, 10087 get: function get() { 10088 return _zoom["default"]; 10089 } 10090}); 10091Object.defineProperty(exports, "default", { 10092 enumerable: true, 10093 get: function get() { 10094 return _core["default"]; 10095 } 10096}); 10097var _core = _interopRequireDefault(require("./core/core.js")); 10098var _virtual = _interopRequireDefault(require("./modules/virtual/virtual.js")); 10099var _keyboard = _interopRequireDefault(require("./modules/keyboard/keyboard.js")); 10100var _mousewheel = _interopRequireDefault(require("./modules/mousewheel/mousewheel.js")); 10101var _navigation = _interopRequireDefault(require("./modules/navigation/navigation.js")); 10102var _pagination = _interopRequireDefault(require("./modules/pagination/pagination.js")); 10103var _scrollbar = _interopRequireDefault(require("./modules/scrollbar/scrollbar.js")); 10104var _parallax = _interopRequireDefault(require("./modules/parallax/parallax.js")); 10105var _zoom = _interopRequireDefault(require("./modules/zoom/zoom.js")); 10106var _controller = _interopRequireDefault(require("./modules/controller/controller.js")); 10107var _a11y = _interopRequireDefault(require("./modules/a11y/a11y.js")); 10108var _history = _interopRequireDefault(require("./modules/history/history.js")); 10109var _hashNavigation = _interopRequireDefault(require("./modules/hash-navigation/hash-navigation.js")); 10110var _autoplay = _interopRequireDefault(require("./modules/autoplay/autoplay.js")); 10111var _thumbs = _interopRequireDefault(require("./modules/thumbs/thumbs.js")); 10112var _freeMode = _interopRequireDefault(require("./modules/free-mode/free-mode.js")); 10113var _grid = _interopRequireDefault(require("./modules/grid/grid.js")); 10114var _manipulation = _interopRequireDefault(require("./modules/manipulation/manipulation.js")); 10115var _effectFade = _interopRequireDefault(require("./modules/effect-fade/effect-fade.js")); 10116var _effectCube = _interopRequireDefault(require("./modules/effect-cube/effect-cube.js")); 10117var _effectFlip = _interopRequireDefault(require("./modules/effect-flip/effect-flip.js")); 10118var _effectCoverflow = _interopRequireDefault(require("./modules/effect-coverflow/effect-coverflow.js")); 10119var _effectCreative = _interopRequireDefault(require("./modules/effect-creative/effect-creative.js")); 10120var _effectCards = _interopRequireDefault(require("./modules/effect-cards/effect-cards.js")); 10121function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } 10122 10123},{"./core/core.js":9,"./modules/a11y/a11y.js":59,"./modules/autoplay/autoplay.js":60,"./modules/controller/controller.js":61,"./modules/effect-cards/effect-cards.js":62,"./modules/effect-coverflow/effect-coverflow.js":63,"./modules/effect-creative/effect-creative.js":64,"./modules/effect-cube/effect-cube.js":65,"./modules/effect-fade/effect-fade.js":66,"./modules/effect-flip/effect-flip.js":67,"./modules/free-mode/free-mode.js":68,"./modules/grid/grid.js":69,"./modules/hash-navigation/hash-navigation.js":70,"./modules/history/history.js":71,"./modules/keyboard/keyboard.js":72,"./modules/manipulation/manipulation.js":73,"./modules/mousewheel/mousewheel.js":79,"./modules/navigation/navigation.js":80,"./modules/pagination/pagination.js":81,"./modules/parallax/parallax.js":82,"./modules/scrollbar/scrollbar.
10123js":83,"./modules/thumbs/thumbs.js":84,"./modules/virtual/virtual.js":85,"./modules/zoom/zoom.js":86}],99:[function(require,module,exports){ 10124"use strict"; 10125 10126function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } 10127var _swiper = _interopRequireWildcard(require("swiper")); 10128function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } 10129function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } 10130// import Swiper JS 10131 10132var slidersVertical = document.querySelectorAll('.swiper-container--vertical'); 10133var slidersHorizontal = document.querySelectorAll('.swiper-container--horizontal'); 10134var initVerticalSlider = function initVerticalSlider(item) { 10135 var options = { 10136 modules: [_swiper.Autoplay, _swiper.FreeMode], 10137 direction: 'vertical', 10138 effect: 'slide', 10139 autoHeight: false, 10140 slidesPerView: 6, 10141 slidesPerGroup: 6, 10142 spaceBetween: 10, 10143 loop: true, 10144 pagination: { 10145 el: '.swiper-pagination', 10146 clickable: true 10147 }, 10148 autoplay: { 10149 delay: 0, 10150 disableOnInteraction: false 10151 }, 10152 speed: 25000 10153 }; 10154 return new _swiper["default"](item, options); 10155}; 10156var initHorizontalSlider = function initHorizontalSlider(item) { 10157 var options = { 10158 modules: [_swiper.Autoplay, _swiper.FreeMode], 10159 effect: 'slide', 10160 autoHeight: false, 10161 slidesPerView: 3, 10162 slidesPerGroup: 3, 10163 spaceBetween: 10, 10164 loop: true, 10165 pagination: { 10166 el: '.swiper-pagination', 10167 clickable: true 10168 }, 10169 autoplay: { 10170 delay: 0, 10171 disableOnInteraction: false 10172 }, 10173 speed: 25000 10174 }; 10175 return new _swiper["default"](item, options); 10176}; 10177slidersVertical.forEach(function (item, i) { 10178 var slider = initVerticalSlider(item); 10179}); 10180slidersHorizontal.forEach(function (item, i) {}); 10181if (document.querySelector('.ticker-insertable')) { 10182 var count = 0; 10183 document.querySelectorAll('.ticker-insertable .elementor-loop-container.elementor-grid > div').forEach(function (item, i) { 10184 if ((i + 1) % 4 === 0) { 10185 if (count <= 2) { 10186 if (count === 0) { 10187 // Move the div after every fourth item 10188 document.querySelector('.ticker-inserter__top').style.maxWidth = 'calc(100vw - 50px)'; 10189 item.parentNode.insertBefore(document.querySelector('.ticker-inserter__top'), item.nextSibling); 10190 var slider = initHorizontalSlider(document.querySelector('.ticker-inserter__top .swiper-container--horizontal')); 10191 } 10192 if (count === 1) { 10193 document.querySelector('.ticker-inserter__middle').style.maxWidth = 'calc(100vw - 50px)'; 10194 item.parentNode.insertBefore(document.querySelector('.ticker-inserter__middle'), item.nextSibling); 10195 var _slider = initHorizontalSlider(document.querySelector('.ticker-inserter__middle .swiper-container--horizontal')); 10196 } 10197 if (count === 2) { 10198 document.querySelector('.ticker-inserter__bottom').style.maxWidth = 'calc(100vw - 50px)'; 10199 item.parentNode.insertBefore(document.querySelector('.ticker-inserter__bottom'), item.nextSibling); 10200 var _slider2 = initHorizontalSlider(document.querySelector('.ticker-inserter__bottom .
10200swiper-container--horizontal')); 10201 } 10202 } 10203 count++; 10204 } 10205 }); 10206} 10207 10208},{"swiper":98}]},{},[99]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.