@gravity-ui/page-constructor 8.13.0-beta.1 → 8.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -41,9 +41,14 @@ var import_react = __toESM(require("react"), 1);
41
41
  function isObject(obj) {
42
42
  return obj !== null && typeof obj === "object" && "constructor" in obj && obj.constructor === Object;
43
43
  }
44
- function extend(target = {}, src = {}) {
45
- const noExtend = ["__proto__", "constructor", "prototype"];
46
- Object.keys(src).filter((key) => noExtend.indexOf(key) < 0).forEach((key) => {
44
+ function extend(target, src) {
45
+ if (target === void 0) {
46
+ target = {};
47
+ }
48
+ if (src === void 0) {
49
+ src = {};
50
+ }
51
+ Object.keys(src).forEach((key) => {
47
52
  if (typeof target[key] === "undefined") target[key] = src[key];
48
53
  else if (isObject(src[key]) && isObject(target[key]) && Object.keys(src[key]).length > 0) {
49
54
  extend(target[key], src[key]);
@@ -182,9 +187,6 @@ function getWindow() {
182
187
  }
183
188
 
184
189
  // node_modules/swiper/shared/utils.mjs
185
- function classesToTokens(classes2 = "") {
186
- return classes2.trim().split(" ").filter((c) => !!c.trim());
187
- }
188
190
  function deleteProps(obj) {
189
191
  const object = obj;
190
192
  Object.keys(object).forEach((key) => {
@@ -198,7 +200,10 @@ function deleteProps(obj) {
198
200
  }
199
201
  });
200
202
  }
201
- function nextTick(callback, delay = 0) {
203
+ function nextTick(callback, delay) {
204
+ if (delay === void 0) {
205
+ delay = 0;
206
+ }
202
207
  return setTimeout(callback, delay);
203
208
  }
204
209
  function now() {
@@ -218,7 +223,10 @@ function getComputedStyle2(el) {
218
223
  }
219
224
  return style;
220
225
  }
221
- function getTranslate(el, axis = "x") {
226
+ function getTranslate(el, axis) {
227
+ if (axis === void 0) {
228
+ axis = "x";
229
+ }
222
230
  const window2 = getWindow();
223
231
  let matrix;
224
232
  let curTransform;
@@ -255,12 +263,13 @@ function isNode(node) {
255
263
  }
256
264
  return node && (node.nodeType === 1 || node.nodeType === 11);
257
265
  }
258
- function extend2(...args) {
259
- const to = Object(args[0]);
260
- for (let i = 1; i < args.length; i += 1) {
261
- const nextSource = args[i];
266
+ function extend2() {
267
+ const to = Object(arguments.length <= 0 ? void 0 : arguments[0]);
268
+ const noExtend = ["__proto__", "constructor", "prototype"];
269
+ for (let i = 1; i < arguments.length; i += 1) {
270
+ const nextSource = i < 0 || arguments.length <= i ? void 0 : arguments[i];
262
271
  if (nextSource !== void 0 && nextSource !== null && !isNode(nextSource)) {
263
- const keysArray = Object.keys(Object(nextSource)).filter((key) => key !== "__proto__" && key !== "constructor" && key !== "prototype");
272
+ const keysArray = Object.keys(Object(nextSource)).filter((key) => noExtend.indexOf(key) < 0);
264
273
  for (let nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex += 1) {
265
274
  const nextKey = keysArray[nextIndex];
266
275
  const desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);
@@ -290,11 +299,12 @@ function extend2(...args) {
290
299
  function setCSSProperty(el, varName, varValue) {
291
300
  el.style.setProperty(varName, varValue);
292
301
  }
293
- function animateCSSModeScroll({
294
- swiper,
295
- targetPosition,
296
- side
297
- }) {
302
+ function animateCSSModeScroll(_ref) {
303
+ let {
304
+ swiper,
305
+ targetPosition,
306
+ side
307
+ } = _ref;
298
308
  const window2 = getWindow();
299
309
  const startPosition = -swiper.translate;
300
310
  let startTime = null;
@@ -336,49 +346,18 @@ function animateCSSModeScroll({
336
346
  };
337
347
  animate();
338
348
  }
339
- function elementChildren(element, selector = "") {
340
- const window2 = getWindow();
341
- const children = [...element.children];
342
- if (window2.HTMLSlotElement && element instanceof HTMLSlotElement) {
343
- children.push(...element.assignedElements());
344
- }
345
- if (!selector) {
346
- return children;
349
+ function elementChildren(element, selector) {
350
+ if (selector === void 0) {
351
+ selector = "";
347
352
  }
348
- return children.filter((el) => el.matches(selector));
353
+ return [...element.children].filter((el) => el.matches(selector));
349
354
  }
350
- function elementIsChildOfSlot(el, slot) {
351
- const elementsQueue = [slot];
352
- while (elementsQueue.length > 0) {
353
- const elementToCheck = elementsQueue.shift();
354
- if (el === elementToCheck) {
355
- return true;
356
- }
357
- elementsQueue.push(...elementToCheck.children, ...elementToCheck.shadowRoot ? elementToCheck.shadowRoot.children : [], ...elementToCheck.assignedElements ? elementToCheck.assignedElements() : []);
355
+ function createElement(tag, classes2) {
356
+ if (classes2 === void 0) {
357
+ classes2 = [];
358
358
  }
359
- }
360
- function elementIsChildOf(el, parent) {
361
- const window2 = getWindow();
362
- let isChild = parent.contains(el);
363
- if (!isChild && window2.HTMLSlotElement && parent instanceof HTMLSlotElement) {
364
- const children = [...parent.assignedElements()];
365
- isChild = children.includes(el);
366
- if (!isChild) {
367
- isChild = elementIsChildOfSlot(el, parent);
368
- }
369
- }
370
- return isChild;
371
- }
372
- function showWarning(text) {
373
- try {
374
- console.warn(text);
375
- return;
376
- } catch (err) {
377
- }
378
- }
379
- function createElement(tag, classes2 = []) {
380
359
  const el = document.createElement(tag);
381
- el.classList.add(...Array.isArray(classes2) ? classes2 : classesToTokens(classes2));
360
+ el.classList.add(...Array.isArray(classes2) ? classes2 : [classes2]);
382
361
  return el;
383
362
  }
384
363
  function elementPrevAll(el, selector) {
@@ -439,15 +418,6 @@ function elementOuterSize(el, size, includeMargins) {
439
418
  }
440
419
  return el.offsetWidth;
441
420
  }
442
- function setInnerHTML(el, html = "") {
443
- if (typeof trustedTypes !== "undefined") {
444
- el.innerHTML = trustedTypes.createPolicy("html", {
445
- createHTML: (s) => s
446
- }).createHTML(html);
447
- } else {
448
- el.innerHTML = html;
449
- }
450
- }
451
421
 
452
422
  // node_modules/swiper/shared/swiper-core.mjs
453
423
  var support;
@@ -466,9 +436,10 @@ function getSupport() {
466
436
  return support;
467
437
  }
468
438
  var deviceCached;
469
- function calcDevice({
470
- userAgent
471
- } = {}) {
439
+ function calcDevice(_temp) {
440
+ let {
441
+ userAgent
442
+ } = _temp === void 0 ? {} : _temp;
472
443
  const support2 = getSupport();
473
444
  const window2 = getWindow();
474
445
  const platform = window2.navigator.platform;
@@ -480,7 +451,7 @@ function calcDevice({
480
451
  const screenWidth = window2.screen.width;
481
452
  const screenHeight = window2.screen.height;
482
453
  const android = ua.match(/(Android);?[\s\/]+([\d.]+)?/);
483
- let ipad = ua.match(/(iPad)(?!\1).*OS\s([\d_]+)/);
454
+ let ipad = ua.match(/(iPad).*OS\s([\d_]+)/);
484
455
  const ipod = ua.match(/(iPod)(.*OS\s([\d_]+))?/);
485
456
  const iphone = !ipad && ua.match(/(iPhone\sOS|iOS)\s([\d_]+)/);
486
457
  const windows = platform === "Win32";
@@ -501,7 +472,10 @@ function calcDevice({
501
472
  }
502
473
  return device;
503
474
  }
504
- function getDevice(overrides = {}) {
475
+ function getDevice(overrides) {
476
+ if (overrides === void 0) {
477
+ overrides = {};
478
+ }
505
479
  if (!deviceCached) {
506
480
  deviceCached = calcDevice(overrides);
507
481
  }
@@ -510,7 +484,6 @@ function getDevice(overrides = {}) {
510
484
  var browser;
511
485
  function calcBrowser() {
512
486
  const window2 = getWindow();
513
- const device = getDevice();
514
487
  let needPerspectiveFix = false;
515
488
  function isSafari() {
516
489
  const ua = window2.navigator.userAgent.toLowerCase();
@@ -523,14 +496,10 @@ function calcBrowser() {
523
496
  needPerspectiveFix = major < 16 || major === 16 && minor < 2;
524
497
  }
525
498
  }
526
- const isWebView = /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(window2.navigator.userAgent);
527
- const isSafariBrowser = isSafari();
528
- const need3dFix = isSafariBrowser || isWebView && device.ios;
529
499
  return {
530
- isSafari: needPerspectiveFix || isSafariBrowser,
500
+ isSafari: needPerspectiveFix || isSafari(),
531
501
  needPerspectiveFix,
532
- need3dFix,
533
- isWebView
502
+ isWebView: /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(window2.navigator.userAgent)
534
503
  };
535
504
  }
536
505
  function getBrowser() {
@@ -539,11 +508,12 @@ function getBrowser() {
539
508
  }
540
509
  return browser;
541
510
  }
542
- function Resize({
543
- swiper,
544
- on,
545
- emit
546
- }) {
511
+ function Resize(_ref) {
512
+ let {
513
+ swiper,
514
+ on,
515
+ emit
516
+ } = _ref;
547
517
  const window2 = getWindow();
548
518
  let observer = null;
549
519
  let animationFrame = null;
@@ -562,11 +532,12 @@ function Resize({
562
532
  } = swiper;
563
533
  let newWidth = width;
564
534
  let newHeight = height;
565
- entries.forEach(({
566
- contentBoxSize,
567
- contentRect,
568
- target
569
- }) => {
535
+ entries.forEach((_ref2) => {
536
+ let {
537
+ contentBoxSize,
538
+ contentRect,
539
+ target
540
+ } = _ref2;
570
541
  if (target && target !== swiper.el) return;
571
542
  newWidth = contentRect ? contentRect.width : (contentBoxSize[0] || contentBoxSize).inlineSize;
572
543
  newHeight = contentRect ? contentRect.height : (contentBoxSize[0] || contentBoxSize).blockSize;
@@ -605,15 +576,19 @@ function Resize({
605
576
  window2.removeEventListener("orientationchange", orientationChangeHandler);
606
577
  });
607
578
  }
608
- function Observer({
609
- swiper,
610
- extendParams,
611
- on,
612
- emit
613
- }) {
579
+ function Observer(_ref) {
580
+ let {
581
+ swiper,
582
+ extendParams,
583
+ on,
584
+ emit
585
+ } = _ref;
614
586
  const observers = [];
615
587
  const window2 = getWindow();
616
- const attach = (target, options = {}) => {
588
+ const attach = function(target, options) {
589
+ if (options === void 0) {
590
+ options = {};
591
+ }
617
592
  const ObserverFunc = window2.MutationObserver || window2.WebkitMutationObserver;
618
593
  const observer = new ObserverFunc((mutations) => {
619
594
  if (swiper.__preventObserver__) return;
@@ -632,7 +607,7 @@ function Observer({
632
607
  });
633
608
  observer.observe(target, {
634
609
  attributes: typeof options.attributes === "undefined" ? true : options.attributes,
635
- childList: swiper.isElement || (typeof options.childList === "undefined" ? true : options).childList,
610
+ childList: typeof options.childList === "undefined" ? true : options.childList,
636
611
  characterData: typeof options.characterData === "undefined" ? true : options.characterData
637
612
  });
638
613
  observers.push(observer);
@@ -682,11 +657,14 @@ var eventsEmitter = {
682
657
  const self = this;
683
658
  if (!self.eventsListeners || self.destroyed) return self;
684
659
  if (typeof handler !== "function") return self;
685
- function onceHandler(...args) {
660
+ function onceHandler() {
686
661
  self.off(events2, onceHandler);
687
662
  if (onceHandler.__emitterProxy) {
688
663
  delete onceHandler.__emitterProxy;
689
664
  }
665
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
666
+ args[_key] = arguments[_key];
667
+ }
690
668
  handler.apply(self, args);
691
669
  }
692
670
  onceHandler.__emitterProxy = handler;
@@ -729,13 +707,16 @@ var eventsEmitter = {
729
707
  });
730
708
  return self;
731
709
  },
732
- emit(...args) {
710
+ emit() {
733
711
  const self = this;
734
712
  if (!self.eventsListeners || self.destroyed) return self;
735
713
  if (!self.eventsListeners) return self;
736
714
  let events2;
737
715
  let data;
738
716
  let context;
717
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
718
+ args[_key2] = arguments[_key2];
719
+ }
739
720
  if (typeof args[0] === "string" || Array.isArray(args[0])) {
740
721
  events2 = args[0];
741
722
  data = args.slice(1, args.length);
@@ -792,13 +773,29 @@ function updateSize() {
792
773
  }
793
774
  function updateSlides() {
794
775
  const swiper = this;
776
+ function getDirectionLabel(property) {
777
+ if (swiper.isHorizontal()) {
778
+ return property;
779
+ }
780
+ return {
781
+ "width": "height",
782
+ "margin-top": "margin-left",
783
+ "margin-bottom ": "margin-right",
784
+ "margin-left": "margin-top",
785
+ "margin-right": "margin-bottom",
786
+ "padding-left": "padding-top",
787
+ "padding-right": "padding-bottom",
788
+ "marginRight": "marginBottom"
789
+ }[property];
790
+ }
795
791
  function getDirectionPropertyValue(node, label) {
796
- return parseFloat(node.getPropertyValue(swiper.getDirectionLabel(label)) || 0);
792
+ return parseFloat(node.getPropertyValue(getDirectionLabel(label)) || 0);
797
793
  }
798
794
  const params = swiper.params;
799
795
  const {
800
796
  wrapperEl,
801
797
  slidesEl,
798
+ size: swiperSize,
802
799
  rtlTranslate: rtl,
803
800
  wrongRTL
804
801
  } = swiper;
@@ -819,7 +816,6 @@ function updateSlides() {
819
816
  }
820
817
  const previousSnapGridLength = swiper.snapGrid.length;
821
818
  const previousSlidesGridLength = swiper.slidesGrid.length;
822
- const swiperSize = swiper.size - offsetBefore - offsetAfter;
823
819
  let spaceBetween = params.spaceBetween;
824
820
  let slidePosition = -offsetBefore;
825
821
  let prevSlideSize = 0;
@@ -832,7 +828,7 @@ function updateSlides() {
832
828
  } else if (typeof spaceBetween === "string") {
833
829
  spaceBetween = parseFloat(spaceBetween);
834
830
  }
835
- swiper.virtualSize = -spaceBetween - offsetBefore - offsetAfter;
831
+ swiper.virtualSize = -spaceBetween;
836
832
  slides.forEach((slideEl) => {
837
833
  if (rtl) {
838
834
  slideEl.style.marginLeft = "";
@@ -846,15 +842,9 @@ function updateSlides() {
846
842
  setCSSProperty(wrapperEl, "--swiper-centered-offset-before", "");
847
843
  setCSSProperty(wrapperEl, "--swiper-centered-offset-after", "");
848
844
  }
849
- if (params.cssMode) {
850
- setCSSProperty(wrapperEl, "--swiper-slides-offset-before", `${offsetBefore}px`);
851
- setCSSProperty(wrapperEl, "--swiper-slides-offset-after", `${offsetAfter}px`);
852
- }
853
845
  const gridEnabled = params.grid && params.grid.rows > 1 && swiper.grid;
854
846
  if (gridEnabled) {
855
- swiper.grid.initSlides(slides);
856
- } else if (swiper.grid) {
857
- swiper.grid.unsetSlides();
847
+ swiper.grid.initSlides(slidesLength);
858
848
  }
859
849
  let slideSize;
860
850
  const shouldResetSlideSize = params.slidesPerView === "auto" && params.breakpoints && Object.keys(params.breakpoints).filter((key) => {
@@ -862,24 +852,15 @@ function updateSlides() {
862
852
  }).length > 0;
863
853
  for (let i = 0; i < slidesLength; i += 1) {
864
854
  slideSize = 0;
865
- const slide2 = slides[i];
866
- if (slide2) {
867
- if (gridEnabled) {
868
- swiper.grid.updateSlide(i, slide2, slides);
869
- }
870
- if (elementStyle(slide2, "display") === "none") continue;
855
+ let slide2;
856
+ if (slides[i]) slide2 = slides[i];
857
+ if (gridEnabled) {
858
+ swiper.grid.updateSlide(i, slide2, slidesLength, getDirectionLabel);
871
859
  }
872
- if (isVirtual && params.slidesPerView === "auto") {
873
- if (params.virtual.slidesPerViewAutoSlideSize) {
874
- slideSize = params.virtual.slidesPerViewAutoSlideSize;
875
- }
876
- if (slideSize && slide2) {
877
- if (params.roundLengths) slideSize = Math.floor(slideSize);
878
- slide2.style[swiper.getDirectionLabel("width")] = `${slideSize}px`;
879
- }
880
- } else if (params.slidesPerView === "auto") {
860
+ if (slides[i] && elementStyle(slide2, "display") === "none") continue;
861
+ if (params.slidesPerView === "auto") {
881
862
  if (shouldResetSlideSize) {
882
- slide2.style[swiper.getDirectionLabel("width")] = ``;
863
+ slides[i].style[getDirectionLabel("width")] = ``;
883
864
  }
884
865
  const slideStyles = getComputedStyle(slide2);
885
866
  const currentTransform = slide2.style.transform;
@@ -919,12 +900,12 @@ function updateSlides() {
919
900
  } else {
920
901
  slideSize = (swiperSize - (params.slidesPerView - 1) * spaceBetween) / params.slidesPerView;
921
902
  if (params.roundLengths) slideSize = Math.floor(slideSize);
922
- if (slide2) {
923
- slide2.style[swiper.getDirectionLabel("width")] = `${slideSize}px`;
903
+ if (slides[i]) {
904
+ slides[i].style[getDirectionLabel("width")] = `${slideSize}px`;
924
905
  }
925
906
  }
926
- if (slide2) {
927
- slide2.swiperSlideSize = slideSize;
907
+ if (slides[i]) {
908
+ slides[i].swiperSlideSize = slideSize;
928
909
  }
929
910
  slidesSizesGrid.push(slideSize);
930
911
  if (params.centeredSlides) {
@@ -950,50 +931,23 @@ function updateSlides() {
950
931
  wrapperEl.style.width = `${swiper.virtualSize + spaceBetween}px`;
951
932
  }
952
933
  if (params.setWrapperSize) {
953
- wrapperEl.style[swiper.getDirectionLabel("width")] = `${swiper.virtualSize + spaceBetween}px`;
934
+ wrapperEl.style[getDirectionLabel("width")] = `${swiper.virtualSize + spaceBetween}px`;
954
935
  }
955
936
  if (gridEnabled) {
956
- swiper.grid.updateWrapperSize(slideSize, snapGrid);
937
+ swiper.grid.updateWrapperSize(slideSize, snapGrid, getDirectionLabel);
957
938
  }
958
939
  if (!params.centeredSlides) {
959
- const isFractionalSlidesPerView = params.slidesPerView !== "auto" && params.slidesPerView % 1 !== 0;
960
- const shouldSnapToSlideEdge = params.snapToSlideEdge && !params.loop && (params.slidesPerView === "auto" || isFractionalSlidesPerView);
961
- let lastAllowedSnapIndex = snapGrid.length;
962
- if (shouldSnapToSlideEdge) {
963
- let minVisibleSlides;
964
- if (params.slidesPerView === "auto") {
965
- minVisibleSlides = 1;
966
- let accumulatedSize = 0;
967
- for (let i = slidesSizesGrid.length - 1; i >= 0; i -= 1) {
968
- accumulatedSize += slidesSizesGrid[i] + (i < slidesSizesGrid.length - 1 ? spaceBetween : 0);
969
- if (accumulatedSize <= swiperSize) {
970
- minVisibleSlides = slidesSizesGrid.length - i;
971
- } else {
972
- break;
973
- }
974
- }
975
- } else {
976
- minVisibleSlides = Math.floor(params.slidesPerView);
977
- }
978
- lastAllowedSnapIndex = Math.max(slidesLength - minVisibleSlides, 0);
979
- }
980
940
  const newSlidesGrid = [];
981
941
  for (let i = 0; i < snapGrid.length; i += 1) {
982
942
  let slidesGridItem = snapGrid[i];
983
943
  if (params.roundLengths) slidesGridItem = Math.floor(slidesGridItem);
984
- if (shouldSnapToSlideEdge) {
985
- if (i <= lastAllowedSnapIndex) {
986
- newSlidesGrid.push(slidesGridItem);
987
- }
988
- } else if (snapGrid[i] <= swiper.virtualSize - swiperSize) {
944
+ if (snapGrid[i] <= swiper.virtualSize - swiperSize) {
989
945
  newSlidesGrid.push(slidesGridItem);
990
946
  }
991
947
  }
992
948
  snapGrid = newSlidesGrid;
993
949
  if (Math.floor(swiper.virtualSize - swiperSize) - Math.floor(snapGrid[snapGrid.length - 1]) > 1) {
994
- if (!shouldSnapToSlideEdge) {
995
- snapGrid.push(swiper.virtualSize - swiperSize);
996
- }
950
+ snapGrid.push(swiper.virtualSize - swiperSize);
997
951
  }
998
952
  }
999
953
  if (isVirtual && params.loop) {
@@ -1015,7 +969,7 @@ function updateSlides() {
1015
969
  }
1016
970
  if (snapGrid.length === 0) snapGrid = [0];
1017
971
  if (spaceBetween !== 0) {
1018
- const key = swiper.isHorizontal() && rtl ? "marginLeft" : swiper.getDirectionLabel("marginRight");
972
+ const key = swiper.isHorizontal() && rtl ? "marginLeft" : getDirectionLabel("marginRight");
1019
973
  slides.filter((_, slideIndex) => {
1020
974
  if (!params.cssMode || params.loop) return true;
1021
975
  if (slideIndex === slides.length - 1) {
@@ -1032,7 +986,7 @@ function updateSlides() {
1032
986
  allSlidesSize += slideSizeValue + (spaceBetween || 0);
1033
987
  });
1034
988
  allSlidesSize -= spaceBetween;
1035
- const maxSnap = allSlidesSize > swiperSize ? allSlidesSize - swiperSize : 0;
989
+ const maxSnap = allSlidesSize - swiperSize;
1036
990
  snapGrid = snapGrid.map((snap) => {
1037
991
  if (snap <= 0) return -offsetBefore;
1038
992
  if (snap > maxSnap) return maxSnap + offsetAfter;
@@ -1082,7 +1036,6 @@ function updateSlides() {
1082
1036
  if (params.watchSlidesProgress) {
1083
1037
  swiper.updateSlidesOffset();
1084
1038
  }
1085
- swiper.emit("slidesUpdated");
1086
1039
  if (!isVirtual && !params.cssMode && (params.effect === "slide" || params.effect === "fade")) {
1087
1040
  const backFaceHiddenClass = `${params.containerModifierClass}backface-hidden`;
1088
1041
  const hasClassBackfaceClassAdded = swiper.el.classList.contains(backFaceHiddenClass);
@@ -1141,14 +1094,10 @@ function updateSlidesOffset() {
1141
1094
  slides[i].swiperSlideOffset = (swiper.isHorizontal() ? slides[i].offsetLeft : slides[i].offsetTop) - minusOffset - swiper.cssOverflowAdjustment();
1142
1095
  }
1143
1096
  }
1144
- var toggleSlideClasses$1 = (slideEl, condition, className) => {
1145
- if (condition && !slideEl.classList.contains(className)) {
1146
- slideEl.classList.add(className);
1147
- } else if (!condition && slideEl.classList.contains(className)) {
1148
- slideEl.classList.remove(className);
1097
+ function updateSlidesProgress(translate2) {
1098
+ if (translate2 === void 0) {
1099
+ translate2 = this && this.translate || 0;
1149
1100
  }
1150
- };
1151
- function updateSlidesProgress(translate2 = this && this.translate || 0) {
1152
1101
  const swiper = this;
1153
1102
  const params = swiper.params;
1154
1103
  const {
@@ -1160,6 +1109,9 @@ function updateSlidesProgress(translate2 = this && this.translate || 0) {
1160
1109
  if (typeof slides[0].swiperSlideOffset === "undefined") swiper.updateSlidesOffset();
1161
1110
  let offsetCenter = -translate2;
1162
1111
  if (rtl) offsetCenter = translate2;
1112
+ slides.forEach((slideEl) => {
1113
+ slideEl.classList.remove(params.slideVisibleClass);
1114
+ });
1163
1115
  swiper.visibleSlidesIndexes = [];
1164
1116
  swiper.visibleSlides = [];
1165
1117
  let spaceBetween = params.spaceBetween;
@@ -1178,14 +1130,12 @@ function updateSlidesProgress(translate2 = this && this.translate || 0) {
1178
1130
  const originalSlideProgress = (offsetCenter - snapGrid[0] + (params.centeredSlides ? swiper.minTranslate() : 0) - slideOffset) / (slide2.swiperSlideSize + spaceBetween);
1179
1131
  const slideBefore = -(offsetCenter - slideOffset);
1180
1132
  const slideAfter = slideBefore + swiper.slidesSizesGrid[i];
1181
- const isFullyVisible = slideBefore >= 0 && slideBefore <= swiper.size - swiper.slidesSizesGrid[i];
1182
1133
  const isVisible = slideBefore >= 0 && slideBefore < swiper.size - 1 || slideAfter > 1 && slideAfter <= swiper.size || slideBefore <= 0 && slideAfter >= swiper.size;
1183
1134
  if (isVisible) {
1184
1135
  swiper.visibleSlides.push(slide2);
1185
1136
  swiper.visibleSlidesIndexes.push(i);
1137
+ slides[i].classList.add(params.slideVisibleClass);
1186
1138
  }
1187
- toggleSlideClasses$1(slide2, isVisible, params.slideVisibleClass);
1188
- toggleSlideClasses$1(slide2, isFullyVisible, params.slideFullyVisibleClass);
1189
1139
  slide2.progress = rtl ? -slideProgress : slideProgress;
1190
1140
  slide2.originalProgress = rtl ? -originalSlideProgress : originalSlideProgress;
1191
1141
  }
@@ -1251,13 +1201,6 @@ function updateProgress(translate2) {
1251
1201
  }
1252
1202
  swiper.emit("progress", progress);
1253
1203
  }
1254
- var toggleSlideClasses = (slideEl, condition, className) => {
1255
- if (condition && !slideEl.classList.contains(className)) {
1256
- slideEl.classList.add(className);
1257
- } else if (!condition && slideEl.classList.contains(className)) {
1258
- slideEl.classList.remove(className);
1259
- }
1260
- };
1261
1204
  function updateSlidesClasses() {
1262
1205
  const swiper = this;
1263
1206
  const {
@@ -1267,13 +1210,13 @@ function updateSlidesClasses() {
1267
1210
  activeIndex
1268
1211
  } = swiper;
1269
1212
  const isVirtual = swiper.virtual && params.virtual.enabled;
1270
- const gridEnabled = swiper.grid && params.grid && params.grid.rows > 1;
1271
1213
  const getFilteredSlide = (selector) => {
1272
1214
  return elementChildren(slidesEl, `.${params.slideClass}${selector}, swiper-slide${selector}`)[0];
1273
1215
  };
1216
+ slides.forEach((slideEl) => {
1217
+ slideEl.classList.remove(params.slideActiveClass, params.slideNextClass, params.slidePrevClass);
1218
+ });
1274
1219
  let activeSlide;
1275
- let prevSlide;
1276
- let nextSlide;
1277
1220
  if (isVirtual) {
1278
1221
  if (params.loop) {
1279
1222
  let slideIndex = activeIndex - swiper.virtual.slidesBefore;
@@ -1284,31 +1227,25 @@ function updateSlidesClasses() {
1284
1227
  activeSlide = getFilteredSlide(`[data-swiper-slide-index="${activeIndex}"]`);
1285
1228
  }
1286
1229
  } else {
1287
- if (gridEnabled) {
1288
- activeSlide = slides.find((slideEl) => slideEl.column === activeIndex);
1289
- nextSlide = slides.find((slideEl) => slideEl.column === activeIndex + 1);
1290
- prevSlide = slides.find((slideEl) => slideEl.column === activeIndex - 1);
1291
- } else {
1292
- activeSlide = slides[activeIndex];
1293
- }
1230
+ activeSlide = slides[activeIndex];
1294
1231
  }
1295
1232
  if (activeSlide) {
1296
- if (!gridEnabled) {
1297
- nextSlide = elementNextAll(activeSlide, `.${params.slideClass}, swiper-slide`)[0];
1298
- if (params.loop && !nextSlide) {
1299
- nextSlide = slides[0];
1300
- }
1301
- prevSlide = elementPrevAll(activeSlide, `.${params.slideClass}, swiper-slide`)[0];
1302
- if (params.loop && !prevSlide === 0) {
1303
- prevSlide = slides[slides.length - 1];
1304
- }
1233
+ activeSlide.classList.add(params.slideActiveClass);
1234
+ let nextSlide = elementNextAll(activeSlide, `.${params.slideClass}, swiper-slide`)[0];
1235
+ if (params.loop && !nextSlide) {
1236
+ nextSlide = slides[0];
1237
+ }
1238
+ if (nextSlide) {
1239
+ nextSlide.classList.add(params.slideNextClass);
1240
+ }
1241
+ let prevSlide = elementPrevAll(activeSlide, `.${params.slideClass}, swiper-slide`)[0];
1242
+ if (params.loop && !prevSlide === 0) {
1243
+ prevSlide = slides[slides.length - 1];
1244
+ }
1245
+ if (prevSlide) {
1246
+ prevSlide.classList.add(params.slidePrevClass);
1305
1247
  }
1306
1248
  }
1307
- slides.forEach((slideEl) => {
1308
- toggleSlideClasses(slideEl, slideEl === activeSlide, params.slideActiveClass);
1309
- toggleSlideClasses(slideEl, slideEl === nextSlide, params.slideNextClass);
1310
- toggleSlideClasses(slideEl, slideEl === prevSlide, params.slidePrevClass);
1311
- });
1312
1249
  swiper.emitSlidesClasses();
1313
1250
  }
1314
1251
  var processLazyPreloader = (swiper, imageEl) => {
@@ -1324,12 +1261,12 @@ var processLazyPreloader = (swiper, imageEl) => {
1324
1261
  requestAnimationFrame(() => {
1325
1262
  if (slideEl.shadowRoot) {
1326
1263
  lazyEl = slideEl.shadowRoot.querySelector(`.${swiper.params.lazyPreloaderClass}`);
1327
- if (lazyEl && !lazyEl.lazyPreloaderManaged) lazyEl.remove();
1264
+ if (lazyEl) lazyEl.remove();
1328
1265
  }
1329
1266
  });
1330
1267
  }
1331
1268
  }
1332
- if (lazyEl && !lazyEl.lazyPreloaderManaged) lazyEl.remove();
1269
+ if (lazyEl) lazyEl.remove();
1333
1270
  }
1334
1271
  };
1335
1272
  var unlazy = (swiper, index) => {
@@ -1427,39 +1364,21 @@ function updateActiveIndex(newActiveIndex) {
1427
1364
  snapIndex = skip + Math.floor((activeIndex - skip) / params.slidesPerGroup);
1428
1365
  }
1429
1366
  if (snapIndex >= snapGrid.length) snapIndex = snapGrid.length - 1;
1430
- if (activeIndex === previousIndex && !swiper.params.loop) {
1367
+ if (activeIndex === previousIndex) {
1431
1368
  if (snapIndex !== previousSnapIndex) {
1432
1369
  swiper.snapIndex = snapIndex;
1433
1370
  swiper.emit("snapIndexChange");
1434
1371
  }
1372
+ if (swiper.params.loop && swiper.virtual && swiper.params.virtual.enabled) {
1373
+ swiper.realIndex = getVirtualRealIndex(activeIndex);
1374
+ }
1435
1375
  return;
1436
1376
  }
1437
- if (activeIndex === previousIndex && swiper.params.loop && swiper.virtual && swiper.params.virtual.enabled) {
1438
- swiper.realIndex = getVirtualRealIndex(activeIndex);
1439
- return;
1440
- }
1441
- const gridEnabled = swiper.grid && params.grid && params.grid.rows > 1;
1442
1377
  let realIndex;
1443
- if (swiper.virtual && params.virtual.enabled) {
1444
- if (params.loop) {
1445
- realIndex = getVirtualRealIndex(activeIndex);
1446
- } else {
1447
- realIndex = activeIndex;
1448
- }
1449
- } else if (gridEnabled) {
1450
- const firstSlideInColumn = swiper.slides.find((slideEl) => slideEl.column === activeIndex);
1451
- let activeSlideIndex = parseInt(firstSlideInColumn.getAttribute("data-swiper-slide-index"), 10);
1452
- if (Number.isNaN(activeSlideIndex)) {
1453
- activeSlideIndex = Math.max(swiper.slides.indexOf(firstSlideInColumn), 0);
1454
- }
1455
- realIndex = Math.floor(activeSlideIndex / params.grid.rows);
1378
+ if (swiper.virtual && params.virtual.enabled && params.loop) {
1379
+ realIndex = getVirtualRealIndex(activeIndex);
1456
1380
  } else if (swiper.slides[activeIndex]) {
1457
- const slideIndex = swiper.slides[activeIndex].getAttribute("data-swiper-slide-index");
1458
- if (slideIndex) {
1459
- realIndex = parseInt(slideIndex, 10);
1460
- } else {
1461
- realIndex = activeIndex;
1462
- }
1381
+ realIndex = parseInt(swiper.slides[activeIndex].getAttribute("data-swiper-slide-index") || activeIndex, 10);
1463
1382
  } else {
1464
1383
  realIndex = activeIndex;
1465
1384
  }
@@ -1532,7 +1451,10 @@ var update = {
1532
1451
  updateActiveIndex,
1533
1452
  updateClickedSlide
1534
1453
  };
1535
- function getSwiperTranslate(axis = this.isHorizontal() ? "x" : "y") {
1454
+ function getSwiperTranslate(axis) {
1455
+ if (axis === void 0) {
1456
+ axis = this.isHorizontal() ? "x" : "y";
1457
+ }
1536
1458
  const swiper = this;
1537
1459
  const {
1538
1460
  params,
@@ -1601,7 +1523,19 @@ function minTranslate() {
1601
1523
  function maxTranslate() {
1602
1524
  return -this.snapGrid[this.snapGrid.length - 1];
1603
1525
  }
1604
- function translateTo(translate2 = 0, speed = this.params.speed, runCallbacks = true, translateBounds = true, internal) {
1526
+ function translateTo(translate2, speed, runCallbacks, translateBounds, internal) {
1527
+ if (translate2 === void 0) {
1528
+ translate2 = 0;
1529
+ }
1530
+ if (speed === void 0) {
1531
+ speed = this.params.speed;
1532
+ }
1533
+ if (runCallbacks === void 0) {
1534
+ runCallbacks = true;
1535
+ }
1536
+ if (translateBounds === void 0) {
1537
+ translateBounds = true;
1538
+ }
1605
1539
  const swiper = this;
1606
1540
  const {
1607
1541
  params,
@@ -1660,7 +1594,6 @@ function translateTo(translate2 = 0, speed = this.params.speed, runCallbacks = t
1660
1594
  swiper.wrapperEl.removeEventListener("transitionend", swiper.onTranslateToWrapperTransitionEnd);
1661
1595
  swiper.onTranslateToWrapperTransitionEnd = null;
1662
1596
  delete swiper.onTranslateToWrapperTransitionEnd;
1663
- swiper.animating = false;
1664
1597
  if (runCallbacks) {
1665
1598
  swiper.emit("transitionEnd");
1666
1599
  }
@@ -1686,12 +1619,13 @@ function setTransition(duration, byController) {
1686
1619
  }
1687
1620
  swiper.emit("setTransition", duration, byController);
1688
1621
  }
1689
- function transitionEmit({
1690
- swiper,
1691
- runCallbacks,
1692
- direction,
1693
- step
1694
- }) {
1622
+ function transitionEmit(_ref) {
1623
+ let {
1624
+ swiper,
1625
+ runCallbacks,
1626
+ direction,
1627
+ step
1628
+ } = _ref;
1695
1629
  const {
1696
1630
  activeIndex,
1697
1631
  previousIndex
@@ -1703,9 +1637,11 @@ function transitionEmit({
1703
1637
  else dir = "reset";
1704
1638
  }
1705
1639
  swiper.emit(`transition${step}`);
1706
- if (runCallbacks && dir === "reset") {
1707
- swiper.emit(`slideResetTransition${step}`);
1708
- } else if (runCallbacks && activeIndex !== previousIndex) {
1640
+ if (runCallbacks && activeIndex !== previousIndex) {
1641
+ if (dir === "reset") {
1642
+ swiper.emit(`slideResetTransition${step}`);
1643
+ return;
1644
+ }
1709
1645
  swiper.emit(`slideChangeTransition${step}`);
1710
1646
  if (dir === "next") {
1711
1647
  swiper.emit(`slideNextTransition${step}`);
@@ -1714,7 +1650,10 @@ function transitionEmit({
1714
1650
  }
1715
1651
  }
1716
1652
  }
1717
- function transitionStart(runCallbacks = true, direction) {
1653
+ function transitionStart(runCallbacks, direction) {
1654
+ if (runCallbacks === void 0) {
1655
+ runCallbacks = true;
1656
+ }
1718
1657
  const swiper = this;
1719
1658
  const {
1720
1659
  params
@@ -1730,7 +1669,10 @@ function transitionStart(runCallbacks = true, direction) {
1730
1669
  step: "Start"
1731
1670
  });
1732
1671
  }
1733
- function transitionEnd(runCallbacks = true, direction) {
1672
+ function transitionEnd(runCallbacks, direction) {
1673
+ if (runCallbacks === void 0) {
1674
+ runCallbacks = true;
1675
+ }
1734
1676
  const swiper = this;
1735
1677
  const {
1736
1678
  params
@@ -1750,7 +1692,16 @@ var transition = {
1750
1692
  transitionStart,
1751
1693
  transitionEnd
1752
1694
  };
1753
- function slideTo(index = 0, speed, runCallbacks = true, internal, initial) {
1695
+ function slideTo(index, speed, runCallbacks, internal, initial) {
1696
+ if (index === void 0) {
1697
+ index = 0;
1698
+ }
1699
+ if (speed === void 0) {
1700
+ speed = this.params.speed;
1701
+ }
1702
+ if (runCallbacks === void 0) {
1703
+ runCallbacks = true;
1704
+ }
1754
1705
  if (typeof index === "string") {
1755
1706
  index = parseInt(index, 10);
1756
1707
  }
@@ -1767,12 +1718,9 @@ function slideTo(index = 0, speed, runCallbacks = true, internal, initial) {
1767
1718
  wrapperEl,
1768
1719
  enabled
1769
1720
  } = swiper;
1770
- if (!enabled && !internal && !initial || swiper.destroyed || swiper.animating && params.preventInteractionOnTransition) {
1721
+ if (swiper.animating && params.preventInteractionOnTransition || !enabled && !internal && !initial) {
1771
1722
  return false;
1772
1723
  }
1773
- if (typeof speed === "undefined") {
1774
- speed = swiper.params.speed;
1775
- }
1776
1724
  const skip = Math.min(swiper.params.slidesPerGroupSkip, slideIndex);
1777
1725
  let snapIndex = skip + Math.floor((slideIndex - skip) / swiper.params.slidesPerGroup);
1778
1726
  if (snapIndex >= snapGrid.length) snapIndex = snapGrid.length - 1;
@@ -1811,9 +1759,7 @@ function slideTo(index = 0, speed, runCallbacks = true, internal, initial) {
1811
1759
  if (slideIndex > activeIndex) direction = "next";
1812
1760
  else if (slideIndex < activeIndex) direction = "prev";
1813
1761
  else direction = "reset";
1814
- const isVirtual = swiper.virtual && swiper.params.virtual.enabled;
1815
- const isInitialVirtual = isVirtual && initial;
1816
- if (!isInitialVirtual && (rtl && -translate2 === swiper.translate || !rtl && translate2 === swiper.translate)) {
1762
+ if (rtl && -translate2 === swiper.translate || !rtl && translate2 === swiper.translate) {
1817
1763
  swiper.updateActiveIndex(slideIndex);
1818
1764
  if (params.autoHeight) {
1819
1765
  swiper.updateAutoHeight();
@@ -1832,6 +1778,7 @@ function slideTo(index = 0, speed, runCallbacks = true, internal, initial) {
1832
1778
  const isH = swiper.isHorizontal();
1833
1779
  const t = rtl ? translate2 : -translate2;
1834
1780
  if (speed === 0) {
1781
+ const isVirtual = swiper.virtual && swiper.params.virtual.enabled;
1835
1782
  if (isVirtual) {
1836
1783
  swiper.wrapperEl.style.scrollSnapType = "none";
1837
1784
  swiper._immediateVirtual = true;
@@ -1866,11 +1813,6 @@ function slideTo(index = 0, speed, runCallbacks = true, internal, initial) {
1866
1813
  }
1867
1814
  return true;
1868
1815
  }
1869
- const browser2 = getBrowser();
1870
- const isSafari = browser2.isSafari;
1871
- if (isVirtual && !initial && isSafari && swiper.isElement) {
1872
- swiper.virtual.update(false, false, slideIndex);
1873
- }
1874
1816
  swiper.setTransition(speed);
1875
1817
  swiper.setTranslate(translate2);
1876
1818
  swiper.updateActiveIndex(slideIndex);
@@ -1895,85 +1837,45 @@ function slideTo(index = 0, speed, runCallbacks = true, internal, initial) {
1895
1837
  }
1896
1838
  return true;
1897
1839
  }
1898
- function slideToLoop(index = 0, speed, runCallbacks = true, internal) {
1840
+ function slideToLoop(index, speed, runCallbacks, internal) {
1841
+ if (index === void 0) {
1842
+ index = 0;
1843
+ }
1844
+ if (speed === void 0) {
1845
+ speed = this.params.speed;
1846
+ }
1847
+ if (runCallbacks === void 0) {
1848
+ runCallbacks = true;
1849
+ }
1899
1850
  if (typeof index === "string") {
1900
1851
  const indexAsNumber = parseInt(index, 10);
1901
1852
  index = indexAsNumber;
1902
1853
  }
1903
1854
  const swiper = this;
1904
- if (swiper.destroyed) return;
1905
- if (typeof speed === "undefined") {
1906
- speed = swiper.params.speed;
1907
- }
1908
- const gridEnabled = swiper.grid && swiper.params.grid && swiper.params.grid.rows > 1;
1909
1855
  let newIndex = index;
1910
1856
  if (swiper.params.loop) {
1911
1857
  if (swiper.virtual && swiper.params.virtual.enabled) {
1912
1858
  newIndex = newIndex + swiper.virtual.slidesBefore;
1913
1859
  } else {
1914
- let targetSlideIndex;
1915
- if (gridEnabled) {
1916
- const slideIndex = newIndex * swiper.params.grid.rows;
1917
- targetSlideIndex = swiper.slides.find((slideEl) => slideEl.getAttribute("data-swiper-slide-index") * 1 === slideIndex).column;
1918
- } else {
1919
- targetSlideIndex = swiper.getSlideIndexByData(newIndex);
1920
- }
1921
- const cols = gridEnabled ? Math.ceil(swiper.slides.length / swiper.params.grid.rows) : swiper.slides.length;
1922
- const {
1923
- centeredSlides,
1924
- slidesOffsetBefore,
1925
- slidesOffsetAfter
1926
- } = swiper.params;
1927
- const bothDirections = centeredSlides || !!slidesOffsetBefore || !!slidesOffsetAfter;
1928
- let slidesPerView = swiper.params.slidesPerView;
1929
- if (slidesPerView === "auto") {
1930
- slidesPerView = swiper.slidesPerViewDynamic();
1931
- } else {
1932
- slidesPerView = Math.ceil(parseFloat(swiper.params.slidesPerView, 10));
1933
- if (bothDirections && slidesPerView % 2 === 0) {
1934
- slidesPerView = slidesPerView + 1;
1935
- }
1936
- }
1937
- let needLoopFix = cols - targetSlideIndex < slidesPerView;
1938
- if (bothDirections) {
1939
- needLoopFix = needLoopFix || targetSlideIndex < Math.ceil(slidesPerView / 2);
1940
- }
1941
- if (internal && bothDirections && swiper.params.slidesPerView !== "auto" && !gridEnabled) {
1942
- needLoopFix = false;
1943
- }
1944
- if (needLoopFix) {
1945
- const direction = bothDirections ? targetSlideIndex < swiper.activeIndex ? "prev" : "next" : targetSlideIndex - swiper.activeIndex - 1 < swiper.params.slidesPerView ? "next" : "prev";
1946
- swiper.loopFix({
1947
- direction,
1948
- slideTo: true,
1949
- activeSlideIndex: direction === "next" ? targetSlideIndex + 1 : targetSlideIndex - cols + 1,
1950
- slideRealIndex: direction === "next" ? swiper.realIndex : void 0
1951
- });
1952
- }
1953
- if (gridEnabled) {
1954
- const slideIndex = newIndex * swiper.params.grid.rows;
1955
- newIndex = swiper.slides.find((slideEl) => slideEl.getAttribute("data-swiper-slide-index") * 1 === slideIndex).column;
1956
- } else {
1957
- newIndex = swiper.getSlideIndexByData(newIndex);
1958
- }
1860
+ newIndex = swiper.getSlideIndexByData(newIndex);
1959
1861
  }
1960
1862
  }
1961
- requestAnimationFrame(() => {
1962
- swiper.slideTo(newIndex, speed, runCallbacks, internal);
1963
- });
1964
- return swiper;
1863
+ return swiper.slideTo(newIndex, speed, runCallbacks, internal);
1965
1864
  }
1966
- function slideNext(speed, runCallbacks = true, internal) {
1865
+ function slideNext(speed, runCallbacks, internal) {
1866
+ if (speed === void 0) {
1867
+ speed = this.params.speed;
1868
+ }
1869
+ if (runCallbacks === void 0) {
1870
+ runCallbacks = true;
1871
+ }
1967
1872
  const swiper = this;
1968
1873
  const {
1969
1874
  enabled,
1970
1875
  params,
1971
1876
  animating
1972
1877
  } = swiper;
1973
- if (!enabled || swiper.destroyed) return swiper;
1974
- if (typeof speed === "undefined") {
1975
- speed = swiper.params.speed;
1976
- }
1878
+ if (!enabled) return swiper;
1977
1879
  let perGroup = params.slidesPerGroup;
1978
1880
  if (params.slidesPerView === "auto" && params.slidesPerGroup === 1 && params.slidesPerGroupAuto) {
1979
1881
  perGroup = Math.max(swiper.slidesPerViewDynamic("current", true), 1);
@@ -1998,7 +1900,13 @@ function slideNext(speed, runCallbacks = true, internal) {
1998
1900
  }
1999
1901
  return swiper.slideTo(swiper.activeIndex + increment, speed, runCallbacks, internal);
2000
1902
  }
2001
- function slidePrev(speed, runCallbacks = true, internal) {
1903
+ function slidePrev(speed, runCallbacks, internal) {
1904
+ if (speed === void 0) {
1905
+ speed = this.params.speed;
1906
+ }
1907
+ if (runCallbacks === void 0) {
1908
+ runCallbacks = true;
1909
+ }
2002
1910
  const swiper = this;
2003
1911
  const {
2004
1912
  params,
@@ -2008,10 +1916,7 @@ function slidePrev(speed, runCallbacks = true, internal) {
2008
1916
  enabled,
2009
1917
  animating
2010
1918
  } = swiper;
2011
- if (!enabled || swiper.destroyed) return swiper;
2012
- if (typeof speed === "undefined") {
2013
- speed = swiper.params.speed;
2014
- }
1919
+ if (!enabled) return swiper;
2015
1920
  const isVirtual = swiper.virtual && params.virtual.enabled;
2016
1921
  if (params.loop) {
2017
1922
  if (animating && !isVirtual && params.loopPreventsSliding) return false;
@@ -2027,9 +1932,8 @@ function slidePrev(speed, runCallbacks = true, internal) {
2027
1932
  }
2028
1933
  const normalizedTranslate = normalize(translate2);
2029
1934
  const normalizedSnapGrid = snapGrid.map((val) => normalize(val));
2030
- const isFreeMode = params.freeMode && params.freeMode.enabled;
2031
1935
  let prevSnap = snapGrid[normalizedSnapGrid.indexOf(normalizedTranslate) - 1];
2032
- if (typeof prevSnap === "undefined" && (params.cssMode || isFreeMode)) {
1936
+ if (typeof prevSnap === "undefined" && params.cssMode) {
2033
1937
  let prevSnapIndex;
2034
1938
  snapGrid.forEach((snap, snapIndex) => {
2035
1939
  if (normalizedTranslate >= snap) {
@@ -2037,7 +1941,7 @@ function slidePrev(speed, runCallbacks = true, internal) {
2037
1941
  }
2038
1942
  });
2039
1943
  if (typeof prevSnapIndex !== "undefined") {
2040
- prevSnap = isFreeMode ? snapGrid[prevSnapIndex] : snapGrid[prevSnapIndex > 0 ? prevSnapIndex - 1 : prevSnapIndex];
1944
+ prevSnap = snapGrid[prevSnapIndex > 0 ? prevSnapIndex - 1 : prevSnapIndex];
2041
1945
  }
2042
1946
  }
2043
1947
  let prevIndex = 0;
@@ -2060,20 +1964,27 @@ function slidePrev(speed, runCallbacks = true, internal) {
2060
1964
  }
2061
1965
  return swiper.slideTo(prevIndex, speed, runCallbacks, internal);
2062
1966
  }
2063
- function slideReset(speed, runCallbacks = true, internal) {
2064
- const swiper = this;
2065
- if (swiper.destroyed) return;
2066
- if (typeof speed === "undefined") {
2067
- speed = swiper.params.speed;
1967
+ function slideReset(speed, runCallbacks, internal) {
1968
+ if (speed === void 0) {
1969
+ speed = this.params.speed;
2068
1970
  }
1971
+ if (runCallbacks === void 0) {
1972
+ runCallbacks = true;
1973
+ }
1974
+ const swiper = this;
2069
1975
  return swiper.slideTo(swiper.activeIndex, speed, runCallbacks, internal);
2070
1976
  }
2071
- function slideToClosest(speed, runCallbacks = true, internal, threshold = 0.5) {
2072
- const swiper = this;
2073
- if (swiper.destroyed) return;
2074
- if (typeof speed === "undefined") {
2075
- speed = swiper.params.speed;
1977
+ function slideToClosest(speed, runCallbacks, internal, threshold) {
1978
+ if (speed === void 0) {
1979
+ speed = this.params.speed;
1980
+ }
1981
+ if (runCallbacks === void 0) {
1982
+ runCallbacks = true;
2076
1983
  }
1984
+ if (threshold === void 0) {
1985
+ threshold = 0.5;
1986
+ }
1987
+ const swiper = this;
2077
1988
  let index = swiper.activeIndex;
2078
1989
  const skip = Math.min(swiper.params.slidesPerGroupSkip, index);
2079
1990
  const snapIndex = skip + Math.floor((index - skip) / swiper.params.slidesPerGroup);
@@ -2097,22 +2008,28 @@ function slideToClosest(speed, runCallbacks = true, internal, threshold = 0.5) {
2097
2008
  }
2098
2009
  function slideToClickedSlide() {
2099
2010
  const swiper = this;
2100
- if (swiper.destroyed) return;
2101
2011
  const {
2102
2012
  params,
2103
2013
  slidesEl
2104
2014
  } = swiper;
2105
2015
  const slidesPerView = params.slidesPerView === "auto" ? swiper.slidesPerViewDynamic() : params.slidesPerView;
2106
- let slideToIndex = swiper.getSlideIndexWhenGrid(swiper.clickedIndex);
2016
+ let slideToIndex = swiper.clickedIndex;
2107
2017
  let realIndex;
2108
2018
  const slideSelector = swiper.isElement ? `swiper-slide` : `.${params.slideClass}`;
2109
- const isGrid = swiper.grid && swiper.params.grid && swiper.params.grid.rows > 1;
2110
2019
  if (params.loop) {
2111
2020
  if (swiper.animating) return;
2112
2021
  realIndex = parseInt(swiper.clickedSlide.getAttribute("data-swiper-slide-index"), 10);
2113
2022
  if (params.centeredSlides) {
2114
- swiper.slideToLoop(realIndex);
2115
- } else if (slideToIndex > (isGrid ? (swiper.slides.length - slidesPerView) / 2 - (swiper.params.grid.rows - 1) : swiper.slides.length - slidesPerView)) {
2023
+ if (slideToIndex < swiper.loopedSlides - slidesPerView / 2 || slideToIndex > swiper.slides.length - swiper.loopedSlides + slidesPerView / 2) {
2024
+ swiper.loopFix();
2025
+ slideToIndex = swiper.getSlideIndex(elementChildren(slidesEl, `${slideSelector}[data-swiper-slide-index="${realIndex}"]`)[0]);
2026
+ nextTick(() => {
2027
+ swiper.slideTo(slideToIndex);
2028
+ });
2029
+ } else {
2030
+ swiper.slideTo(slideToIndex);
2031
+ }
2032
+ } else if (slideToIndex > swiper.slides.length - slidesPerView) {
2116
2033
  swiper.loopFix();
2117
2034
  slideToIndex = swiper.getSlideIndex(elementChildren(slidesEl, `${slideSelector}[data-swiper-slide-index="${realIndex}"]`)[0]);
2118
2035
  nextTick(() => {
@@ -2134,82 +2051,32 @@ var slide = {
2134
2051
  slideToClosest,
2135
2052
  slideToClickedSlide
2136
2053
  };
2137
- function loopCreate(slideRealIndex, initial) {
2054
+ function loopCreate(slideRealIndex) {
2138
2055
  const swiper = this;
2139
2056
  const {
2140
2057
  params,
2141
2058
  slidesEl
2142
2059
  } = swiper;
2143
2060
  if (!params.loop || swiper.virtual && swiper.params.virtual.enabled) return;
2144
- const initSlides = () => {
2145
- const slides = elementChildren(slidesEl, `.${params.slideClass}, swiper-slide`);
2146
- slides.forEach((el, index) => {
2147
- el.setAttribute("data-swiper-slide-index", index);
2148
- });
2149
- };
2150
- const clearBlankSlides = () => {
2151
- const slides = elementChildren(slidesEl, `.${params.slideBlankClass}`);
2152
- slides.forEach((el) => {
2153
- el.remove();
2154
- });
2155
- if (slides.length > 0) {
2156
- swiper.recalcSlides();
2157
- swiper.updateSlides();
2158
- }
2159
- };
2160
- const gridEnabled = swiper.grid && params.grid && params.grid.rows > 1;
2161
- if (params.loopAddBlankSlides && (params.slidesPerGroup > 1 || gridEnabled)) {
2162
- clearBlankSlides();
2163
- }
2164
- const slidesPerGroup = params.slidesPerGroup * (gridEnabled ? params.grid.rows : 1);
2165
- const shouldFillGroup = swiper.slides.length % slidesPerGroup !== 0;
2166
- const shouldFillGrid = gridEnabled && swiper.slides.length % params.grid.rows !== 0;
2167
- const addBlankSlides = (amountOfSlides) => {
2168
- for (let i = 0; i < amountOfSlides; i += 1) {
2169
- const slideEl = swiper.isElement ? createElement("swiper-slide", [params.slideBlankClass]) : createElement("div", [params.slideClass, params.slideBlankClass]);
2170
- swiper.slidesEl.append(slideEl);
2171
- }
2172
- };
2173
- if (shouldFillGroup) {
2174
- if (params.loopAddBlankSlides) {
2175
- const slidesToAdd = slidesPerGroup - swiper.slides.length % slidesPerGroup;
2176
- addBlankSlides(slidesToAdd);
2177
- swiper.recalcSlides();
2178
- swiper.updateSlides();
2179
- } else {
2180
- showWarning("Swiper Loop Warning: The number of slides is not even to slidesPerGroup, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)");
2181
- }
2182
- initSlides();
2183
- } else if (shouldFillGrid) {
2184
- if (params.loopAddBlankSlides) {
2185
- const slidesToAdd = params.grid.rows - swiper.slides.length % params.grid.rows;
2186
- addBlankSlides(slidesToAdd);
2187
- swiper.recalcSlides();
2188
- swiper.updateSlides();
2189
- } else {
2190
- showWarning("Swiper Loop Warning: The number of slides is not even to grid.rows, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)");
2191
- }
2192
- initSlides();
2193
- } else {
2194
- initSlides();
2195
- }
2196
- const bothDirections = params.centeredSlides || !!params.slidesOffsetBefore || !!params.slidesOffsetAfter;
2061
+ const slides = elementChildren(slidesEl, `.${params.slideClass}, swiper-slide`);
2062
+ slides.forEach((el, index) => {
2063
+ el.setAttribute("data-swiper-slide-index", index);
2064
+ });
2197
2065
  swiper.loopFix({
2198
2066
  slideRealIndex,
2199
- direction: bothDirections ? void 0 : "next",
2200
- initial
2067
+ direction: params.centeredSlides ? void 0 : "next"
2201
2068
  });
2202
2069
  }
2203
- function loopFix({
2204
- slideRealIndex,
2205
- slideTo: slideTo2 = true,
2206
- direction,
2207
- setTranslate: setTranslate2,
2208
- activeSlideIndex,
2209
- initial,
2210
- byController,
2211
- byMousewheel
2212
- } = {}) {
2070
+ function loopFix(_temp) {
2071
+ let {
2072
+ slideRealIndex,
2073
+ slideTo: slideTo2 = true,
2074
+ direction,
2075
+ setTranslate: setTranslate2,
2076
+ activeSlideIndex,
2077
+ byController,
2078
+ byMousewheel
2079
+ } = _temp === void 0 ? {} : _temp;
2213
2080
  const swiper = this;
2214
2081
  if (!swiper.params.loop) return;
2215
2082
  swiper.emit("beforeLoopFix");
@@ -2220,20 +2087,13 @@ function loopFix({
2220
2087
  slidesEl,
2221
2088
  params
2222
2089
  } = swiper;
2223
- const {
2224
- centeredSlides,
2225
- slidesOffsetBefore,
2226
- slidesOffsetAfter,
2227
- initialSlide
2228
- } = params;
2229
- const bothDirections = centeredSlides || !!slidesOffsetBefore || !!slidesOffsetAfter;
2230
2090
  swiper.allowSlidePrev = true;
2231
2091
  swiper.allowSlideNext = true;
2232
2092
  if (swiper.virtual && params.virtual.enabled) {
2233
2093
  if (slideTo2) {
2234
- if (!bothDirections && swiper.snapIndex === 0) {
2094
+ if (!params.centeredSlides && swiper.snapIndex === 0) {
2235
2095
  swiper.slideTo(swiper.virtual.slides.length, 0, false, true);
2236
- } else if (bothDirections && swiper.snapIndex < params.slidesPerView) {
2096
+ } else if (params.centeredSlides && swiper.snapIndex < params.slidesPerView) {
2237
2097
  swiper.slideTo(swiper.virtual.slides.length + swiper.snapIndex, 0, false, true);
2238
2098
  } else if (swiper.snapIndex === swiper.snapGrid.length - 1) {
2239
2099
  swiper.slideTo(swiper.virtual.slidesBefore, 0, false, true);
@@ -2244,35 +2104,17 @@ function loopFix({
2244
2104
  swiper.emit("loopFix");
2245
2105
  return;
2246
2106
  }
2247
- let slidesPerView = params.slidesPerView;
2248
- if (slidesPerView === "auto") {
2249
- slidesPerView = swiper.slidesPerViewDynamic();
2250
- } else {
2251
- slidesPerView = Math.ceil(parseFloat(params.slidesPerView, 10));
2252
- if (bothDirections && slidesPerView % 2 === 0) {
2253
- slidesPerView = slidesPerView + 1;
2254
- }
2107
+ const slidesPerView = params.slidesPerView === "auto" ? swiper.slidesPerViewDynamic() : Math.ceil(parseFloat(params.slidesPerView, 10));
2108
+ let loopedSlides = params.loopedSlides || slidesPerView;
2109
+ if (loopedSlides % params.slidesPerGroup !== 0) {
2110
+ loopedSlides += params.slidesPerGroup - loopedSlides % params.slidesPerGroup;
2255
2111
  }
2256
- const slidesPerGroup = params.slidesPerGroupAuto ? slidesPerView : params.slidesPerGroup;
2257
- let loopedSlides = bothDirections ? Math.max(slidesPerGroup, Math.ceil(slidesPerView / 2)) : slidesPerGroup;
2258
- if (loopedSlides % slidesPerGroup !== 0) {
2259
- loopedSlides += slidesPerGroup - loopedSlides % slidesPerGroup;
2260
- }
2261
- loopedSlides += params.loopAdditionalSlides;
2262
2112
  swiper.loopedSlides = loopedSlides;
2263
- const gridEnabled = swiper.grid && params.grid && params.grid.rows > 1;
2264
- if (slides.length < slidesPerView + loopedSlides || swiper.params.effect === "cards" && slides.length < slidesPerView + loopedSlides * 2) {
2265
- showWarning("Swiper Loop Warning: The number of slides is not enough for loop mode, it will be disabled or not function properly. You need to add more slides (or make duplicates) or lower the values of slidesPerView and slidesPerGroup parameters");
2266
- } else if (gridEnabled && params.grid.fill === "row") {
2267
- showWarning("Swiper Loop Warning: Loop mode is not compatible with grid.fill = `row`");
2268
- }
2269
2113
  const prependSlidesIndexes = [];
2270
2114
  const appendSlidesIndexes = [];
2271
- const cols = gridEnabled ? Math.ceil(slides.length / params.grid.rows) : slides.length;
2272
- const isInitialOverflow = initial && cols - initialSlide < slidesPerView && !bothDirections;
2273
- let activeIndex = isInitialOverflow ? initialSlide : swiper.activeIndex;
2115
+ let activeIndex = swiper.activeIndex;
2274
2116
  if (typeof activeSlideIndex === "undefined") {
2275
- activeSlideIndex = swiper.getSlideIndex(slides.find((el) => el.classList.contains(params.slideActiveClass)));
2117
+ activeSlideIndex = swiper.getSlideIndex(swiper.slides.filter((el) => el.classList.contains(params.slideActiveClass))[0]);
2276
2118
  } else {
2277
2119
  activeIndex = activeSlideIndex;
2278
2120
  }
@@ -2280,70 +2122,36 @@ function loopFix({
2280
2122
  const isPrev = direction === "prev" || !direction;
2281
2123
  let slidesPrepended = 0;
2282
2124
  let slidesAppended = 0;
2283
- const activeColIndex = gridEnabled ? slides[activeSlideIndex].column : activeSlideIndex;
2284
- const activeColIndexWithShift = activeColIndex + (bothDirections && typeof setTranslate2 === "undefined" ? -slidesPerView / 2 + 0.5 : 0);
2285
- if (activeColIndexWithShift < loopedSlides) {
2286
- slidesPrepended = Math.max(loopedSlides - activeColIndexWithShift, slidesPerGroup);
2287
- for (let i = 0; i < loopedSlides - activeColIndexWithShift; i += 1) {
2288
- const index = i - Math.floor(i / cols) * cols;
2289
- if (gridEnabled) {
2290
- const colIndexToPrepend = cols - index - 1;
2291
- for (let i2 = slides.length - 1; i2 >= 0; i2 -= 1) {
2292
- if (slides[i2].column === colIndexToPrepend) prependSlidesIndexes.push(i2);
2293
- }
2294
- } else {
2295
- prependSlidesIndexes.push(cols - index - 1);
2296
- }
2297
- }
2298
- } else if (activeColIndexWithShift + slidesPerView > cols - loopedSlides) {
2299
- slidesAppended = Math.max(activeColIndexWithShift - (cols - loopedSlides * 2), slidesPerGroup);
2300
- if (isInitialOverflow) {
2301
- slidesAppended = Math.max(slidesAppended, slidesPerView - cols + initialSlide + 1);
2302
- }
2125
+ if (activeSlideIndex < loopedSlides) {
2126
+ slidesPrepended = Math.max(loopedSlides - activeSlideIndex, params.slidesPerGroup);
2127
+ for (let i = 0; i < loopedSlides - activeSlideIndex; i += 1) {
2128
+ const index = i - Math.floor(i / slides.length) * slides.length;
2129
+ prependSlidesIndexes.push(slides.length - index - 1);
2130
+ }
2131
+ } else if (activeSlideIndex > swiper.slides.length - loopedSlides * 2) {
2132
+ slidesAppended = Math.max(activeSlideIndex - (swiper.slides.length - loopedSlides * 2), params.slidesPerGroup);
2303
2133
  for (let i = 0; i < slidesAppended; i += 1) {
2304
- const index = i - Math.floor(i / cols) * cols;
2305
- if (gridEnabled) {
2306
- slides.forEach((slide2, slideIndex) => {
2307
- if (slide2.column === index) appendSlidesIndexes.push(slideIndex);
2308
- });
2309
- } else {
2310
- appendSlidesIndexes.push(index);
2311
- }
2312
- }
2313
- }
2314
- swiper.__preventObserver__ = true;
2315
- requestAnimationFrame(() => {
2316
- swiper.__preventObserver__ = false;
2317
- });
2318
- if (swiper.params.effect === "cards" && slides.length < slidesPerView + loopedSlides * 2) {
2319
- if (appendSlidesIndexes.includes(activeSlideIndex)) {
2320
- appendSlidesIndexes.splice(appendSlidesIndexes.indexOf(activeSlideIndex), 1);
2321
- }
2322
- if (prependSlidesIndexes.includes(activeSlideIndex)) {
2323
- prependSlidesIndexes.splice(prependSlidesIndexes.indexOf(activeSlideIndex), 1);
2134
+ const index = i - Math.floor(i / slides.length) * slides.length;
2135
+ appendSlidesIndexes.push(index);
2324
2136
  }
2325
2137
  }
2326
2138
  if (isPrev) {
2327
2139
  prependSlidesIndexes.forEach((index) => {
2328
- slides[index].swiperLoopMoveDOM = true;
2329
- slidesEl.prepend(slides[index]);
2330
- slides[index].swiperLoopMoveDOM = false;
2140
+ swiper.slides[index].swiperLoopMoveDOM = true;
2141
+ slidesEl.prepend(swiper.slides[index]);
2142
+ swiper.slides[index].swiperLoopMoveDOM = false;
2331
2143
  });
2332
2144
  }
2333
2145
  if (isNext) {
2334
2146
  appendSlidesIndexes.forEach((index) => {
2335
- slides[index].swiperLoopMoveDOM = true;
2336
- slidesEl.append(slides[index]);
2337
- slides[index].swiperLoopMoveDOM = false;
2147
+ swiper.slides[index].swiperLoopMoveDOM = true;
2148
+ slidesEl.append(swiper.slides[index]);
2149
+ swiper.slides[index].swiperLoopMoveDOM = false;
2338
2150
  });
2339
2151
  }
2340
2152
  swiper.recalcSlides();
2341
2153
  if (params.slidesPerView === "auto") {
2342
2154
  swiper.updateSlides();
2343
- } else if (gridEnabled && (prependSlidesIndexes.length > 0 && isPrev || appendSlidesIndexes.length > 0 && isNext)) {
2344
- swiper.slides.forEach((slide2, slideIndex) => {
2345
- swiper.grid.updateSlide(slideIndex, slide2, swiper.slides);
2346
- });
2347
2155
  }
2348
2156
  if (params.watchSlidesProgress) {
2349
2157
  swiper.updateSlidesOffset();
@@ -2357,16 +2165,15 @@ function loopFix({
2357
2165
  if (byMousewheel) {
2358
2166
  swiper.setTranslate(swiper.translate - diff);
2359
2167
  } else {
2360
- swiper.slideTo(activeIndex + Math.ceil(slidesPrepended), 0, false, true);
2168
+ swiper.slideTo(activeIndex + slidesPrepended, 0, false, true);
2361
2169
  if (setTranslate2) {
2362
- swiper.touchEventsData.startTranslate = swiper.touchEventsData.startTranslate - diff;
2363
- swiper.touchEventsData.currentTranslate = swiper.touchEventsData.currentTranslate - diff;
2170
+ swiper.touches[swiper.isHorizontal() ? "startX" : "startY"] += diff;
2171
+ swiper.touchEventsData.currentTranslate = swiper.translate;
2364
2172
  }
2365
2173
  }
2366
2174
  } else {
2367
2175
  if (setTranslate2) {
2368
- const shift = gridEnabled ? prependSlidesIndexes.length / params.grid.rows : prependSlidesIndexes.length;
2369
- swiper.slideTo(swiper.activeIndex + shift, 0, false, true);
2176
+ swiper.slideToLoop(slideRealIndex, 0, false, true);
2370
2177
  swiper.touchEventsData.currentTranslate = swiper.translate;
2371
2178
  }
2372
2179
  }
@@ -2380,13 +2187,12 @@ function loopFix({
2380
2187
  } else {
2381
2188
  swiper.slideTo(activeIndex - slidesAppended, 0, false, true);
2382
2189
  if (setTranslate2) {
2383
- swiper.touchEventsData.startTranslate = swiper.touchEventsData.startTranslate - diff;
2384
- swiper.touchEventsData.currentTranslate = swiper.touchEventsData.currentTranslate - diff;
2190
+ swiper.touches[swiper.isHorizontal() ? "startX" : "startY"] += diff;
2191
+ swiper.touchEventsData.currentTranslate = swiper.translate;
2385
2192
  }
2386
2193
  }
2387
2194
  } else {
2388
- const shift = gridEnabled ? appendSlidesIndexes.length / params.grid.rows : appendSlidesIndexes.length;
2389
- swiper.slideTo(swiper.activeIndex - shift, 0, false, true);
2195
+ swiper.slideToLoop(slideRealIndex, 0, false, true);
2390
2196
  }
2391
2197
  }
2392
2198
  }
@@ -2422,7 +2228,7 @@ function loopDestroy() {
2422
2228
  params,
2423
2229
  slidesEl
2424
2230
  } = swiper;
2425
- if (!params.loop || !slidesEl || swiper.virtual && swiper.params.virtual.enabled) return;
2231
+ if (!params.loop || swiper.virtual && swiper.params.virtual.enabled) return;
2426
2232
  swiper.recalcSlides();
2427
2233
  const newSlidesOrder = [];
2428
2234
  swiper.slides.forEach((slideEl) => {
@@ -2477,7 +2283,10 @@ var grabCursor = {
2477
2283
  setGrabCursor,
2478
2284
  unsetGrabCursor
2479
2285
  };
2480
- function closestElement(selector, base = this) {
2286
+ function closestElement(selector, base) {
2287
+ if (base === void 0) {
2288
+ base = this;
2289
+ }
2481
2290
  function __closestFrom(el) {
2482
2291
  if (!el || el === getDocument() || el === getWindow()) return null;
2483
2292
  if (el.assignedSlot) el = el.assignedSlot;
@@ -2489,63 +2298,36 @@ function closestElement(selector, base = this) {
2489
2298
  }
2490
2299
  return __closestFrom(base);
2491
2300
  }
2492
- function preventEdgeSwipe(swiper, event, startX) {
2493
- const window2 = getWindow();
2494
- const {
2495
- params
2496
- } = swiper;
2497
- const edgeSwipeDetection = params.edgeSwipeDetection;
2498
- const edgeSwipeThreshold = params.edgeSwipeThreshold;
2499
- if (edgeSwipeDetection && (startX <= edgeSwipeThreshold || startX >= window2.innerWidth - edgeSwipeThreshold)) {
2500
- if (edgeSwipeDetection === "prevent") {
2501
- event.preventDefault();
2502
- return true;
2503
- }
2504
- return false;
2505
- }
2506
- return true;
2507
- }
2508
2301
  function onTouchStart(event) {
2509
2302
  const swiper = this;
2510
- if (swiper.destroyed) return;
2511
2303
  const document2 = getDocument();
2512
- let e = event;
2513
- if (e.originalEvent) e = e.originalEvent;
2304
+ const window2 = getWindow();
2514
2305
  const data = swiper.touchEventsData;
2515
- if (e.type === "pointerdown") {
2516
- if (data.pointerId !== null && data.pointerId !== e.pointerId) {
2517
- return;
2518
- }
2519
- data.pointerId = e.pointerId;
2520
- } else if (e.type === "touchstart" && e.targetTouches.length === 1) {
2521
- data.touchId = e.targetTouches[0].identifier;
2522
- }
2523
- if (e.type === "touchstart") {
2524
- preventEdgeSwipe(swiper, e, e.targetTouches[0].pageX);
2525
- return;
2526
- }
2306
+ data.evCache.push(event);
2527
2307
  const {
2528
2308
  params,
2529
2309
  touches,
2530
2310
  enabled
2531
2311
  } = swiper;
2532
2312
  if (!enabled) return;
2533
- if (!params.simulateTouch && e.pointerType === "mouse") return;
2313
+ if (!params.simulateTouch && event.pointerType === "mouse") return;
2534
2314
  if (swiper.animating && params.preventInteractionOnTransition) {
2535
2315
  return;
2536
2316
  }
2537
2317
  if (!swiper.animating && params.cssMode && params.loop) {
2538
2318
  swiper.loopFix();
2539
2319
  }
2320
+ let e = event;
2321
+ if (e.originalEvent) e = e.originalEvent;
2540
2322
  let targetEl = e.target;
2541
2323
  if (params.touchEventsTarget === "wrapper") {
2542
- if (!elementIsChildOf(targetEl, swiper.wrapperEl)) return;
2324
+ if (!swiper.wrapperEl.contains(targetEl)) return;
2543
2325
  }
2544
2326
  if ("which" in e && e.which === 3) return;
2545
2327
  if ("button" in e && e.button > 0) return;
2546
2328
  if (data.isTouched && data.isMoved) return;
2547
2329
  const swipingClassHasValue = !!params.noSwipingClass && params.noSwipingClass !== "";
2548
- const eventPath = e.composedPath ? e.composedPath() : e.path;
2330
+ const eventPath = event.composedPath ? event.composedPath() : event.path;
2549
2331
  if (swipingClassHasValue && e.target && e.target.shadowRoot && eventPath) {
2550
2332
  targetEl = eventPath[0];
2551
2333
  }
@@ -2562,8 +2344,14 @@ function onTouchStart(event) {
2562
2344
  touches.currentY = e.pageY;
2563
2345
  const startX = touches.currentX;
2564
2346
  const startY = touches.currentY;
2565
- if (!preventEdgeSwipe(swiper, e, startX)) {
2566
- return;
2347
+ const edgeSwipeDetection = params.edgeSwipeDetection || params.iOSEdgeSwipeDetection;
2348
+ const edgeSwipeThreshold = params.edgeSwipeThreshold || params.iOSEdgeSwipeThreshold;
2349
+ if (edgeSwipeDetection && (startX <= edgeSwipeThreshold || startX >= window2.innerWidth - edgeSwipeThreshold)) {
2350
+ if (edgeSwipeDetection === "prevent") {
2351
+ event.preventDefault();
2352
+ } else {
2353
+ return;
2354
+ }
2567
2355
  }
2568
2356
  Object.assign(data, {
2569
2357
  isTouched: true,
@@ -2586,7 +2374,7 @@ function onTouchStart(event) {
2586
2374
  data.isTouched = false;
2587
2375
  }
2588
2376
  }
2589
- if (document2.activeElement && document2.activeElement.matches(data.focusableElements) && document2.activeElement !== targetEl && (e.pointerType === "mouse" || e.pointerType !== "mouse" && !targetEl.matches(data.focusableElements))) {
2377
+ if (document2.activeElement && document2.activeElement.matches(data.focusableElements) && document2.activeElement !== targetEl) {
2590
2378
  document2.activeElement.blur();
2591
2379
  }
2592
2380
  const shouldPreventDefault = preventDefault && swiper.allowTouchMove && params.touchStartPreventDefault;
@@ -2601,7 +2389,6 @@ function onTouchStart(event) {
2601
2389
  function onTouchMove(event) {
2602
2390
  const document2 = getDocument();
2603
2391
  const swiper = this;
2604
- if (swiper.destroyed) return;
2605
2392
  const data = swiper.touchEventsData;
2606
2393
  const {
2607
2394
  params,
@@ -2613,24 +2400,15 @@ function onTouchMove(event) {
2613
2400
  if (!params.simulateTouch && event.pointerType === "mouse") return;
2614
2401
  let e = event;
2615
2402
  if (e.originalEvent) e = e.originalEvent;
2616
- if (e.type === "pointermove") {
2617
- if (data.touchId !== null) return;
2618
- const id = e.pointerId;
2619
- if (id !== data.pointerId) return;
2620
- }
2621
- let targetTouch;
2622
- if (e.type === "touchmove") {
2623
- targetTouch = [...e.changedTouches].find((t) => t.identifier === data.touchId);
2624
- if (!targetTouch || targetTouch.identifier !== data.touchId) return;
2625
- } else {
2626
- targetTouch = e;
2627
- }
2628
2403
  if (!data.isTouched) {
2629
2404
  if (data.startMoving && data.isScrolling) {
2630
2405
  swiper.emit("touchMoveOpposite", e);
2631
2406
  }
2632
2407
  return;
2633
2408
  }
2409
+ const pointerIndex = data.evCache.findIndex((cachedEv) => cachedEv.pointerId === e.pointerId);
2410
+ if (pointerIndex >= 0) data.evCache[pointerIndex] = e;
2411
+ const targetTouch = data.evCache.length > 1 ? data.evCache[0] : e;
2634
2412
  const pageX = targetTouch.pageX;
2635
2413
  const pageY = targetTouch.pageY;
2636
2414
  if (e.preventedByNestedSwiper) {
@@ -2646,6 +2424,8 @@ function onTouchMove(event) {
2646
2424
  Object.assign(touches, {
2647
2425
  startX: pageX,
2648
2426
  startY: pageY,
2427
+ prevX: swiper.touches.currentX,
2428
+ prevY: swiper.touches.currentY,
2649
2429
  currentX: pageX,
2650
2430
  currentY: pageY
2651
2431
  });
@@ -2660,15 +2440,10 @@ function onTouchMove(event) {
2660
2440
  data.isMoved = false;
2661
2441
  return;
2662
2442
  }
2663
- } else if (rtl && (pageX > touches.startX && -swiper.translate <= swiper.maxTranslate() || pageX < touches.startX && -swiper.translate >= swiper.minTranslate())) {
2664
- return;
2665
- } else if (!rtl && (pageX < touches.startX && swiper.translate <= swiper.maxTranslate() || pageX > touches.startX && swiper.translate >= swiper.minTranslate())) {
2443
+ } else if (pageX < touches.startX && swiper.translate <= swiper.maxTranslate() || pageX > touches.startX && swiper.translate >= swiper.minTranslate()) {
2666
2444
  return;
2667
2445
  }
2668
2446
  }
2669
- if (document2.activeElement && document2.activeElement.matches(data.focusableElements) && document2.activeElement !== e.target && e.pointerType !== "mouse") {
2670
- document2.activeElement.blur();
2671
- }
2672
2447
  if (document2.activeElement) {
2673
2448
  if (e.target === document2.activeElement && e.target.matches(data.focusableElements)) {
2674
2449
  data.isMoved = true;
@@ -2679,8 +2454,7 @@ function onTouchMove(event) {
2679
2454
  if (data.allowTouchCallbacks) {
2680
2455
  swiper.emit("touchMove", e);
2681
2456
  }
2682
- touches.previousX = touches.currentX;
2683
- touches.previousY = touches.currentY;
2457
+ if (e.targetTouches && e.targetTouches.length > 1) return;
2684
2458
  touches.currentX = pageX;
2685
2459
  touches.currentY = pageY;
2686
2460
  const diffX = touches.currentX - touches.startX;
@@ -2705,7 +2479,7 @@ function onTouchMove(event) {
2705
2479
  data.startMoving = true;
2706
2480
  }
2707
2481
  }
2708
- if (data.isScrolling || e.type === "touchmove" && data.preventTouchMoveFromPointerMove) {
2482
+ if (data.isScrolling || swiper.zoom && swiper.params.zoom && swiper.params.zoom.enabled && data.evCache.length > 1) {
2709
2483
  data.isTouched = false;
2710
2484
  return;
2711
2485
  }
@@ -2735,7 +2509,7 @@ function onTouchMove(event) {
2735
2509
  swiper.swipeDirection = diff > 0 ? "prev" : "next";
2736
2510
  swiper.touchesDirection = touchesDiff > 0 ? "prev" : "next";
2737
2511
  const isLoop = swiper.params.loop && !params.cssMode;
2738
- const allowLoopFix = swiper.touchesDirection === "next" && swiper.allowSlideNext || swiper.touchesDirection === "prev" && swiper.allowSlidePrev;
2512
+ const allowLoopFix = swiper.swipeDirection === "next" && swiper.allowSlideNext || swiper.swipeDirection === "prev" && swiper.allowSlidePrev;
2739
2513
  if (!data.isMoved) {
2740
2514
  if (isLoop && allowLoopFix) {
2741
2515
  swiper.loopFix({
@@ -2747,10 +2521,7 @@ function onTouchMove(event) {
2747
2521
  if (swiper.animating) {
2748
2522
  const evt = new window.CustomEvent("transitionend", {
2749
2523
  bubbles: true,
2750
- cancelable: true,
2751
- detail: {
2752
- bySwiperTouchMove: true
2753
- }
2524
+ cancelable: true
2754
2525
  });
2755
2526
  swiper.wrapperEl.dispatchEvent(evt);
2756
2527
  }
@@ -2761,18 +2532,12 @@ function onTouchMove(event) {
2761
2532
  swiper.emit("sliderFirstMove", e);
2762
2533
  }
2763
2534
  let loopFixed;
2764
- (/* @__PURE__ */ new Date()).getTime();
2765
- if (params._loopSwapReset !== false && data.isMoved && data.allowThresholdMove && prevTouchesDirection !== swiper.touchesDirection && isLoop && allowLoopFix && Math.abs(diff) >= 1) {
2766
- Object.assign(touches, {
2767
- startX: pageX,
2768
- startY: pageY,
2769
- currentX: pageX,
2770
- currentY: pageY,
2771
- startTranslate: data.currentTranslate
2535
+ if (data.isMoved && prevTouchesDirection !== swiper.touchesDirection && isLoop && allowLoopFix && Math.abs(diff) >= 1) {
2536
+ swiper.loopFix({
2537
+ direction: swiper.swipeDirection,
2538
+ setTranslate: true
2772
2539
  });
2773
- data.loopSwapReset = true;
2774
- data.startTranslate = data.currentTranslate;
2775
- return;
2540
+ loopFixed = true;
2776
2541
  }
2777
2542
  swiper.emit("sliderMove", e);
2778
2543
  data.isMoved = true;
@@ -2783,7 +2548,7 @@ function onTouchMove(event) {
2783
2548
  resistanceRatio = 0;
2784
2549
  }
2785
2550
  if (diff > 0) {
2786
- if (isLoop && allowLoopFix && !loopFixed && data.allowThresholdMove && data.currentTranslate > (params.centeredSlides ? swiper.minTranslate() - swiper.slidesSizesGrid[swiper.activeIndex + 1] - (params.slidesPerView !== "auto" && swiper.slides.length - params.slidesPerView >= 2 ? swiper.slidesSizesGrid[swiper.activeIndex + 1] + swiper.params.spaceBetween : 0) - swiper.params.spaceBetween : swiper.minTranslate())) {
2551
+ if (isLoop && allowLoopFix && !loopFixed && data.currentTranslate > (params.centeredSlides ? swiper.minTranslate() - swiper.size / 2 : swiper.minTranslate())) {
2787
2552
  swiper.loopFix({
2788
2553
  direction: "prev",
2789
2554
  setTranslate: true,
@@ -2797,7 +2562,7 @@ function onTouchMove(event) {
2797
2562
  }
2798
2563
  }
2799
2564
  } else if (diff < 0) {
2800
- if (isLoop && allowLoopFix && !loopFixed && data.allowThresholdMove && data.currentTranslate < (params.centeredSlides ? swiper.maxTranslate() + swiper.slidesSizesGrid[swiper.slidesSizesGrid.length - 1] + swiper.params.spaceBetween + (params.slidesPerView !== "auto" && swiper.slides.length - params.slidesPerView >= 2 ? swiper.slidesSizesGrid[swiper.slidesSizesGrid.length - 1] + swiper.params.spaceBetween : 0) : swiper.maxTranslate())) {
2565
+ if (isLoop && allowLoopFix && !loopFixed && data.currentTranslate < (params.centeredSlides ? swiper.maxTranslate() + swiper.size / 2 : swiper.maxTranslate())) {
2801
2566
  swiper.loopFix({
2802
2567
  direction: "next",
2803
2568
  setTranslate: true,
@@ -2851,28 +2616,17 @@ function onTouchMove(event) {
2851
2616
  }
2852
2617
  function onTouchEnd(event) {
2853
2618
  const swiper = this;
2854
- if (swiper.destroyed) return;
2855
2619
  const data = swiper.touchEventsData;
2856
- let e = event;
2857
- if (e.originalEvent) e = e.originalEvent;
2858
- let targetTouch;
2859
- const isTouchEvent = e.type === "touchend" || e.type === "touchcancel";
2860
- if (!isTouchEvent) {
2861
- if (data.touchId !== null) return;
2862
- if (e.pointerId !== data.pointerId) return;
2863
- targetTouch = e;
2864
- } else {
2865
- targetTouch = [...e.changedTouches].find((t) => t.identifier === data.touchId);
2866
- if (!targetTouch || targetTouch.identifier !== data.touchId) return;
2620
+ const pointerIndex = data.evCache.findIndex((cachedEv) => cachedEv.pointerId === event.pointerId);
2621
+ if (pointerIndex >= 0) {
2622
+ data.evCache.splice(pointerIndex, 1);
2867
2623
  }
2868
- if (["pointercancel", "pointerout", "pointerleave", "contextmenu"].includes(e.type)) {
2869
- const proceed = ["pointercancel", "contextmenu"].includes(e.type) && (swiper.browser.isSafari || swiper.browser.isWebView);
2624
+ if (["pointercancel", "pointerout", "pointerleave", "contextmenu"].includes(event.type)) {
2625
+ const proceed = ["pointercancel", "contextmenu"].includes(event.type) && (swiper.browser.isSafari || swiper.browser.isWebView);
2870
2626
  if (!proceed) {
2871
2627
  return;
2872
2628
  }
2873
2629
  }
2874
- data.pointerId = null;
2875
- data.touchId = null;
2876
2630
  const {
2877
2631
  params,
2878
2632
  touches,
@@ -2881,7 +2635,9 @@ function onTouchEnd(event) {
2881
2635
  enabled
2882
2636
  } = swiper;
2883
2637
  if (!enabled) return;
2884
- if (!params.simulateTouch && e.pointerType === "mouse") return;
2638
+ if (!params.simulateTouch && event.pointerType === "mouse") return;
2639
+ let e = event;
2640
+ if (e.originalEvent) e = e.originalEvent;
2885
2641
  if (data.allowTouchCallbacks) {
2886
2642
  swiper.emit("touchEnd", e);
2887
2643
  }
@@ -2911,7 +2667,7 @@ function onTouchEnd(event) {
2911
2667
  nextTick(() => {
2912
2668
  if (!swiper.destroyed) swiper.allowClick = true;
2913
2669
  });
2914
- if (!data.isTouched || !data.isMoved || !swiper.swipeDirection || touches.diff === 0 && !data.loopSwapReset || data.currentTranslate === data.startTranslate && !data.loopSwapReset) {
2670
+ if (!data.isTouched || !data.isMoved || !swiper.swipeDirection || touches.diff === 0 || data.currentTranslate === data.startTranslate) {
2915
2671
  data.isTouched = false;
2916
2672
  data.isMoved = false;
2917
2673
  data.startMoving = false;
@@ -2935,17 +2691,16 @@ function onTouchEnd(event) {
2935
2691
  });
2936
2692
  return;
2937
2693
  }
2938
- const swipeToLast = currentPos >= -swiper.maxTranslate() && !swiper.params.loop;
2939
2694
  let stopIndex = 0;
2940
2695
  let groupSize = swiper.slidesSizesGrid[0];
2941
2696
  for (let i = 0; i < slidesGrid.length; i += i < params.slidesPerGroupSkip ? 1 : params.slidesPerGroup) {
2942
2697
  const increment2 = i < params.slidesPerGroupSkip - 1 ? 1 : params.slidesPerGroup;
2943
2698
  if (typeof slidesGrid[i + increment2] !== "undefined") {
2944
- if (swipeToLast || currentPos >= slidesGrid[i] && currentPos < slidesGrid[i + increment2]) {
2699
+ if (currentPos >= slidesGrid[i] && currentPos < slidesGrid[i + increment2]) {
2945
2700
  stopIndex = i;
2946
2701
  groupSize = slidesGrid[i + increment2] - slidesGrid[i];
2947
2702
  }
2948
- } else if (swipeToLast || currentPos >= slidesGrid[i]) {
2703
+ } else if (currentPos >= slidesGrid[i]) {
2949
2704
  stopIndex = i;
2950
2705
  groupSize = slidesGrid[slidesGrid.length - 1] - slidesGrid[slidesGrid.length - 2];
2951
2706
  }
@@ -3022,8 +2777,7 @@ function onResize() {
3022
2777
  swiper.updateSlidesClasses();
3023
2778
  const isVirtualLoop = isVirtual && params.loop;
3024
2779
  if ((params.slidesPerView === "auto" || params.slidesPerView > 1) && swiper.isEnd && !swiper.isBeginning && !swiper.params.centeredSlides && !isVirtualLoop) {
3025
- const slides = isVirtual ? swiper.virtual.slides : swiper.slides;
3026
- swiper.slideTo(slides.length - 1, 0, false, true);
2780
+ swiper.slideTo(swiper.slides.length - 1, 0, false, true);
3027
2781
  } else {
3028
2782
  if (swiper.params.loop && !isVirtual) {
3029
2783
  swiper.slideToLoop(swiper.realIndex, 0, false, true);
@@ -3047,7 +2801,6 @@ function onResize() {
3047
2801
  }
3048
2802
  function onClick(e) {
3049
2803
  const swiper = this;
3050
- if (swiper.destroyed) return;
3051
2804
  if (!swiper.enabled) return;
3052
2805
  if (!swiper.allowClick) {
3053
2806
  if (swiper.params.preventClicks) e.preventDefault();
@@ -3059,7 +2812,6 @@ function onClick(e) {
3059
2812
  }
3060
2813
  function onScroll() {
3061
2814
  const swiper = this;
3062
- if (swiper.destroyed) return;
3063
2815
  const {
3064
2816
  wrapperEl,
3065
2817
  rtlTranslate,
@@ -3089,21 +2841,14 @@ function onScroll() {
3089
2841
  }
3090
2842
  function onLoad(e) {
3091
2843
  const swiper = this;
3092
- if (swiper.destroyed) return;
3093
2844
  processLazyPreloader(swiper, e.target);
3094
2845
  if (swiper.params.cssMode || swiper.params.slidesPerView !== "auto" && !swiper.params.autoHeight) {
3095
2846
  return;
3096
2847
  }
3097
2848
  swiper.update();
3098
2849
  }
3099
- function onDocumentTouchStart() {
3100
- const swiper = this;
3101
- if (swiper.destroyed) return;
3102
- if (swiper.documentTouchHandlerProceeded) return;
3103
- swiper.documentTouchHandlerProceeded = true;
3104
- if (swiper.params.touchReleaseOnEdges) {
3105
- swiper.el.style.touchAction = "auto";
3106
- }
2850
+ var dummyEventAttached = false;
2851
+ function dummyEventListener() {
3107
2852
  }
3108
2853
  var events = (swiper, method) => {
3109
2854
  const document2 = getDocument();
@@ -3116,37 +2861,19 @@ var events = (swiper, method) => {
3116
2861
  const capture = !!params.nested;
3117
2862
  const domMethod = method === "on" ? "addEventListener" : "removeEventListener";
3118
2863
  const swiperMethod = method;
3119
- if (!el || typeof el === "string") return;
3120
- document2[domMethod]("touchstart", swiper.onDocumentTouchStart, {
3121
- passive: false,
3122
- capture
3123
- });
3124
- el[domMethod]("touchstart", swiper.onTouchStart, {
3125
- passive: false
3126
- });
3127
2864
  el[domMethod]("pointerdown", swiper.onTouchStart, {
3128
2865
  passive: false
3129
2866
  });
3130
- document2[domMethod]("touchmove", swiper.onTouchMove, {
3131
- passive: false,
3132
- capture
3133
- });
3134
2867
  document2[domMethod]("pointermove", swiper.onTouchMove, {
3135
2868
  passive: false,
3136
2869
  capture
3137
2870
  });
3138
- document2[domMethod]("touchend", swiper.onTouchEnd, {
3139
- passive: true
3140
- });
3141
2871
  document2[domMethod]("pointerup", swiper.onTouchEnd, {
3142
2872
  passive: true
3143
2873
  });
3144
2874
  document2[domMethod]("pointercancel", swiper.onTouchEnd, {
3145
2875
  passive: true
3146
2876
  });
3147
- document2[domMethod]("touchcancel", swiper.onTouchEnd, {
3148
- passive: true
3149
- });
3150
2877
  document2[domMethod]("pointerout", swiper.onTouchEnd, {
3151
2878
  passive: true
3152
2879
  });
@@ -3173,18 +2900,22 @@ var events = (swiper, method) => {
3173
2900
  };
3174
2901
  function attachEvents() {
3175
2902
  const swiper = this;
2903
+ const document2 = getDocument();
3176
2904
  const {
3177
2905
  params
3178
2906
  } = swiper;
3179
2907
  swiper.onTouchStart = onTouchStart.bind(swiper);
3180
2908
  swiper.onTouchMove = onTouchMove.bind(swiper);
3181
2909
  swiper.onTouchEnd = onTouchEnd.bind(swiper);
3182
- swiper.onDocumentTouchStart = onDocumentTouchStart.bind(swiper);
3183
2910
  if (params.cssMode) {
3184
2911
  swiper.onScroll = onScroll.bind(swiper);
3185
2912
  }
3186
2913
  swiper.onClick = onClick.bind(swiper);
3187
2914
  swiper.onLoad = onLoad.bind(swiper);
2915
+ if (!dummyEventAttached) {
2916
+ document2.addEventListener("touchstart", dummyEventListener);
2917
+ dummyEventAttached = true;
2918
+ }
3188
2919
  events(swiper, "on");
3189
2920
  }
3190
2921
  function detachEvents() {
@@ -3208,17 +2939,12 @@ function setBreakpoint() {
3208
2939
  } = swiper;
3209
2940
  const breakpoints2 = params.breakpoints;
3210
2941
  if (!breakpoints2 || breakpoints2 && Object.keys(breakpoints2).length === 0) return;
3211
- const document2 = getDocument();
3212
- const breakpointsBase = params.breakpointsBase === "window" || !params.breakpointsBase ? params.breakpointsBase : "container";
3213
- const breakpointContainer = ["window", "container"].includes(params.breakpointsBase) || !params.breakpointsBase ? swiper.el : document2.querySelector(params.breakpointsBase);
3214
- const breakpoint = swiper.getBreakpoint(breakpoints2, breakpointsBase, breakpointContainer);
2942
+ const breakpoint = swiper.getBreakpoint(breakpoints2, swiper.params.breakpointsBase, swiper.el);
3215
2943
  if (!breakpoint || swiper.currentBreakpoint === breakpoint) return;
3216
2944
  const breakpointOnlyParams = breakpoint in breakpoints2 ? breakpoints2[breakpoint] : void 0;
3217
2945
  const breakpointParams = breakpointOnlyParams || swiper.originalParams;
3218
2946
  const wasMultiRow = isGridEnabled(swiper, params);
3219
2947
  const isMultiRow = isGridEnabled(swiper, breakpointParams);
3220
- const wasGrabCursor = swiper.params.grabCursor;
3221
- const isGrabCursor = breakpointParams.grabCursor;
3222
2948
  const wasEnabled = params.enabled;
3223
2949
  if (wasMultiRow && !isMultiRow) {
3224
2950
  el.classList.remove(`${params.containerModifierClass}grid`, `${params.containerModifierClass}grid-column`);
@@ -3230,11 +2956,6 @@ function setBreakpoint() {
3230
2956
  }
3231
2957
  swiper.emitContainerClasses();
3232
2958
  }
3233
- if (wasGrabCursor && !isGrabCursor) {
3234
- swiper.unsetGrabCursor();
3235
- } else if (!wasGrabCursor && isGrabCursor) {
3236
- swiper.setGrabCursor();
3237
- }
3238
2959
  ["navigation", "pagination", "scrollbar"].forEach((prop) => {
3239
2960
  if (typeof breakpointParams[prop] === "undefined") return;
3240
2961
  const wasModuleEnabled = params[prop] && params[prop].enabled;
@@ -3281,7 +3002,10 @@ function setBreakpoint() {
3281
3002
  }
3282
3003
  swiper.emit("breakpoint", breakpointParams);
3283
3004
  }
3284
- function getBreakpoint(breakpoints2, base = "window", containerEl) {
3005
+ function getBreakpoint(breakpoints2, base, containerEl) {
3006
+ if (base === void 0) {
3007
+ base = "window";
3008
+ }
3285
3009
  if (!breakpoints2 || base === "container" && !containerEl) return void 0;
3286
3010
  let breakpoint = false;
3287
3011
  const window2 = getWindow();
@@ -3375,7 +3099,6 @@ function removeClasses() {
3375
3099
  el,
3376
3100
  classNames
3377
3101
  } = swiper;
3378
- if (!el || typeof el === "string") return;
3379
3102
  el.classList.remove(...classNames);
3380
3103
  swiper.emitContainerClasses();
3381
3104
  }
@@ -3419,7 +3142,6 @@ var defaults = {
3419
3142
  init: true,
3420
3143
  direction: "horizontal",
3421
3144
  oneWayMovement: false,
3422
- swiperElementNodeName: "SWIPER-CONTAINER",
3423
3145
  touchEventsTarget: "wrapper",
3424
3146
  initialSlide: 0,
3425
3147
  speed: 300,
@@ -3428,7 +3150,6 @@ var defaults = {
3428
3150
  resizeObserver: true,
3429
3151
  nested: false,
3430
3152
  createElements: false,
3431
- eventsPrefix: "swiper",
3432
3153
  enabled: true,
3433
3154
  focusableElements: "input, select, option, textarea, button, video, label",
3434
3155
  // Overrides
@@ -3468,7 +3189,6 @@ var defaults = {
3468
3189
  // in px
3469
3190
  normalizeSlideIndex: true,
3470
3191
  centerInsufficientSlides: false,
3471
- snapToSlideEdge: false,
3472
3192
  // Disable swiper and hide navigation when container not overflow
3473
3193
  watchOverflow: true,
3474
3194
  // Round length
@@ -3503,8 +3223,7 @@ var defaults = {
3503
3223
  slideToClickedSlide: false,
3504
3224
  // loop
3505
3225
  loop: false,
3506
- loopAddBlankSlides: true,
3507
- loopAdditionalSlides: 0,
3226
+ loopedSlides: null,
3508
3227
  loopPreventsSliding: true,
3509
3228
  // rewind
3510
3229
  rewind: false,
@@ -3523,10 +3242,8 @@ var defaults = {
3523
3242
  containerModifierClass: "swiper-",
3524
3243
  // NEW
3525
3244
  slideClass: "swiper-slide",
3526
- slideBlankClass: "swiper-slide-blank",
3527
3245
  slideActiveClass: "swiper-slide-active",
3528
3246
  slideVisibleClass: "swiper-slide-visible",
3529
- slideFullyVisibleClass: "swiper-slide-fully-visible",
3530
3247
  slideNextClass: "swiper-slide-next",
3531
3248
  slidePrevClass: "swiper-slide-prev",
3532
3249
  wrapperClass: "swiper-wrapper",
@@ -3538,7 +3255,10 @@ var defaults = {
3538
3255
  _emitClasses: false
3539
3256
  };
3540
3257
  function moduleExtendParams(params, allModulesParams) {
3541
- return function extendParams(obj = {}) {
3258
+ return function extendParams(obj) {
3259
+ if (obj === void 0) {
3260
+ obj = {};
3261
+ }
3542
3262
  const moduleParamName = Object.keys(obj)[0];
3543
3263
  const moduleParams = obj[moduleParamName];
3544
3264
  if (typeof moduleParams !== "object" || moduleParams === null) {
@@ -3584,9 +3304,12 @@ var prototypes = {
3584
3304
  };
3585
3305
  var extendedDefaults = {};
3586
3306
  var Swiper = class _Swiper {
3587
- constructor(...args) {
3307
+ constructor() {
3588
3308
  let el;
3589
3309
  let params;
3310
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
3311
+ args[_key] = arguments[_key];
3312
+ }
3590
3313
  if (args.length === 1 && args[0].constructor && Object.prototype.toString.call(args[0]).slice(8, -1) === "Object") {
3591
3314
  params = args[0];
3592
3315
  } else {
@@ -3617,11 +3340,7 @@ var Swiper = class _Swiper {
3617
3340
  swiper.eventsAnyListeners = [];
3618
3341
  swiper.modules = [...swiper.__modules__];
3619
3342
  if (params.modules && Array.isArray(params.modules)) {
3620
- params.modules.forEach((mod) => {
3621
- if (typeof mod === "function" && swiper.modules.indexOf(mod) < 0) {
3622
- swiper.modules.push(mod);
3623
- }
3624
- });
3343
+ swiper.modules.push(...params.modules);
3625
3344
  }
3626
3345
  const allModulesParams = {};
3627
3346
  swiper.modules.forEach((mod) => {
@@ -3701,8 +3420,7 @@ var Swiper = class _Swiper {
3701
3420
  velocities: [],
3702
3421
  allowMomentumBounce: void 0,
3703
3422
  startMoving: void 0,
3704
- pointerId: null,
3705
- touchId: null
3423
+ evCache: []
3706
3424
  },
3707
3425
  // Clicks
3708
3426
  allowClick: true,
@@ -3725,21 +3443,6 @@ var Swiper = class _Swiper {
3725
3443
  }
3726
3444
  return swiper;
3727
3445
  }
3728
- getDirectionLabel(property) {
3729
- if (this.isHorizontal()) {
3730
- return property;
3731
- }
3732
- return {
3733
- "width": "height",
3734
- "margin-top": "margin-left",
3735
- "margin-bottom ": "margin-right",
3736
- "margin-left": "margin-top",
3737
- "margin-right": "margin-bottom",
3738
- "padding-left": "padding-top",
3739
- "padding-right": "padding-bottom",
3740
- "marginRight": "marginBottom"
3741
- }[property];
3742
- }
3743
3446
  getSlideIndex(slideEl) {
3744
3447
  const {
3745
3448
  slidesEl,
@@ -3750,17 +3453,7 @@ var Swiper = class _Swiper {
3750
3453
  return elementIndex(slideEl) - firstSlideIndex;
3751
3454
  }
3752
3455
  getSlideIndexByData(index) {
3753
- return this.getSlideIndex(this.slides.find((slideEl) => slideEl.getAttribute("data-swiper-slide-index") * 1 === index));
3754
- }
3755
- getSlideIndexWhenGrid(index) {
3756
- if (this.grid && this.params.grid && this.params.grid.rows > 1) {
3757
- if (this.params.grid.fill === "column") {
3758
- index = Math.floor(index / this.params.grid.rows);
3759
- } else if (this.params.grid.fill === "row") {
3760
- index = index % Math.ceil(this.slides.length / this.params.grid.rows);
3761
- }
3762
- }
3763
- return index;
3456
+ return this.getSlideIndex(this.slides.filter((slideEl) => slideEl.getAttribute("data-swiper-slide-index") * 1 === index)[0]);
3764
3457
  }
3765
3458
  recalcSlides() {
3766
3459
  const swiper = this;
@@ -3827,7 +3520,13 @@ var Swiper = class _Swiper {
3827
3520
  });
3828
3521
  swiper.emit("_slideClasses", updates);
3829
3522
  }
3830
- slidesPerViewDynamic(view = "current", exact = false) {
3523
+ slidesPerViewDynamic(view, exact) {
3524
+ if (view === void 0) {
3525
+ view = "current";
3526
+ }
3527
+ if (exact === void 0) {
3528
+ exact = false;
3529
+ }
3831
3530
  const swiper = this;
3832
3531
  const {
3833
3532
  params,
@@ -3840,11 +3539,11 @@ var Swiper = class _Swiper {
3840
3539
  let spv = 1;
3841
3540
  if (typeof params.slidesPerView === "number") return params.slidesPerView;
3842
3541
  if (params.centeredSlides) {
3843
- let slideSize = slides[activeIndex] ? Math.ceil(slides[activeIndex].swiperSlideSize) : 0;
3542
+ let slideSize = slides[activeIndex] ? slides[activeIndex].swiperSlideSize : 0;
3844
3543
  let breakLoop;
3845
3544
  for (let i = activeIndex + 1; i < slides.length; i += 1) {
3846
3545
  if (slides[i] && !breakLoop) {
3847
- slideSize += Math.ceil(slides[i].swiperSlideSize);
3546
+ slideSize += slides[i].swiperSlideSize;
3848
3547
  spv += 1;
3849
3548
  if (slideSize > swiperSize) breakLoop = true;
3850
3549
  }
@@ -3923,7 +3622,10 @@ var Swiper = class _Swiper {
3923
3622
  }
3924
3623
  swiper.emit("update");
3925
3624
  }
3926
- changeDirection(newDirection, needUpdate = true) {
3625
+ changeDirection(newDirection, needUpdate) {
3626
+ if (needUpdate === void 0) {
3627
+ needUpdate = true;
3628
+ }
3927
3629
  const swiper = this;
3928
3630
  const currentDirection = swiper.params.direction;
3929
3631
  if (!newDirection) {
@@ -3972,7 +3674,7 @@ var Swiper = class _Swiper {
3972
3674
  return false;
3973
3675
  }
3974
3676
  el.swiper = swiper;
3975
- if (el.parentNode && el.parentNode.host && el.parentNode.host.nodeName === swiper.params.swiperElementNodeName.toUpperCase()) {
3677
+ if (el.parentNode && el.parentNode.host && el.parentNode.host.nodeName === "SWIPER-CONTAINER") {
3976
3678
  swiper.isElement = true;
3977
3679
  }
3978
3680
  const getWrapperSelector = () => {
@@ -4030,7 +3732,7 @@ var Swiper = class _Swiper {
4030
3732
  swiper.slideTo(swiper.params.initialSlide, 0, swiper.params.runCallbacksOnInit, false, true);
4031
3733
  }
4032
3734
  if (swiper.params.loop) {
4033
- swiper.loopCreate(void 0, true);
3735
+ swiper.loopCreate();
4034
3736
  }
4035
3737
  swiper.attachEvents();
4036
3738
  const lazyElements = [...swiper.el.querySelectorAll('[loading="lazy"]')];
@@ -4053,7 +3755,13 @@ var Swiper = class _Swiper {
4053
3755
  swiper.emit("afterInit");
4054
3756
  return swiper;
4055
3757
  }
4056
- destroy(deleteInstance = true, cleanStyles = true) {
3758
+ destroy(deleteInstance, cleanStyles) {
3759
+ if (deleteInstance === void 0) {
3760
+ deleteInstance = true;
3761
+ }
3762
+ if (cleanStyles === void 0) {
3763
+ cleanStyles = true;
3764
+ }
4057
3765
  const swiper = this;
4058
3766
  const {
4059
3767
  params,
@@ -4072,15 +3780,11 @@ var Swiper = class _Swiper {
4072
3780
  }
4073
3781
  if (cleanStyles) {
4074
3782
  swiper.removeClasses();
4075
- if (el && typeof el !== "string") {
4076
- el.removeAttribute("style");
4077
- }
4078
- if (wrapperEl) {
4079
- wrapperEl.removeAttribute("style");
4080
- }
3783
+ el.removeAttribute("style");
3784
+ wrapperEl.removeAttribute("style");
4081
3785
  if (slides && slides.length) {
4082
3786
  slides.forEach((slideEl) => {
4083
- slideEl.classList.remove(params.slideVisibleClass, params.slideFullyVisibleClass, params.slideActiveClass, params.slideNextClass, params.slidePrevClass);
3787
+ slideEl.classList.remove(params.slideVisibleClass, params.slideActiveClass, params.slideNextClass, params.slidePrevClass);
4084
3788
  slideEl.removeAttribute("style");
4085
3789
  slideEl.removeAttribute("data-swiper-slide-index");
4086
3790
  });
@@ -4091,9 +3795,7 @@ var Swiper = class _Swiper {
4091
3795
  swiper.off(eventName);
4092
3796
  });
4093
3797
  if (deleteInstance !== false) {
4094
- if (swiper.el && typeof swiper.el !== "string") {
4095
- swiper.el.swiper = null;
4096
- }
3798
+ swiper.el.swiper = null;
4097
3799
  deleteProps(swiper);
4098
3800
  }
4099
3801
  swiper.destroyed = true;
@@ -4140,7 +3842,6 @@ var paramsList = [
4140
3842
  "init",
4141
3843
  "_direction",
4142
3844
  "oneWayMovement",
4143
- "swiperElementNodeName",
4144
3845
  "touchEventsTarget",
4145
3846
  "initialSlide",
4146
3847
  "_speed",
@@ -4177,7 +3878,6 @@ var paramsList = [
4177
3878
  "_slidesOffsetAfter",
4178
3879
  "normalizeSlideIndex",
4179
3880
  "_centerInsufficientSlides",
4180
- "_snapToSlideEdge",
4181
3881
  "_watchOverflow",
4182
3882
  "roundLengths",
4183
3883
  "touchRatio",
@@ -4203,8 +3903,7 @@ var paramsList = [
4203
3903
  "preventClicksPropagation",
4204
3904
  "_slideToClickedSlide",
4205
3905
  "_loop",
4206
- "loopAdditionalSlides",
4207
- "loopAddBlankSlides",
3906
+ "loopedSlides",
4208
3907
  "loopPreventsSliding",
4209
3908
  "_rewind",
4210
3909
  "_allowSlidePrev",
@@ -4218,10 +3917,8 @@ var paramsList = [
4218
3917
  "slideClass",
4219
3918
  "slideActiveClass",
4220
3919
  "slideVisibleClass",
4221
- "slideFullyVisibleClass",
4222
3920
  "slideNextClass",
4223
3921
  "slidePrevClass",
4224
- "slideBlankClass",
4225
3922
  "wrapperClass",
4226
3923
  "lazyPreloaderClass",
4227
3924
  "lazyPreloadPrevNext",
@@ -4267,16 +3964,28 @@ function extend3(target, src) {
4267
3964
  }
4268
3965
  });
4269
3966
  }
4270
- function needsNavigation(params = {}) {
3967
+ function needsNavigation(params) {
3968
+ if (params === void 0) {
3969
+ params = {};
3970
+ }
4271
3971
  return params.navigation && typeof params.navigation.nextEl === "undefined" && typeof params.navigation.prevEl === "undefined";
4272
3972
  }
4273
- function needsPagination(params = {}) {
3973
+ function needsPagination(params) {
3974
+ if (params === void 0) {
3975
+ params = {};
3976
+ }
4274
3977
  return params.pagination && typeof params.pagination.el === "undefined";
4275
3978
  }
4276
- function needsScrollbar(params = {}) {
3979
+ function needsScrollbar(params) {
3980
+ if (params === void 0) {
3981
+ params = {};
3982
+ }
4277
3983
  return params.scrollbar && typeof params.scrollbar.el === "undefined";
4278
3984
  }
4279
- function uniqueClasses(classNames = "") {
3985
+ function uniqueClasses(classNames) {
3986
+ if (classNames === void 0) {
3987
+ classNames = "";
3988
+ }
4280
3989
  const classes2 = classNames.split(" ").map((c) => c.trim()).filter((c) => !!c);
4281
3990
  const unique = [];
4282
3991
  classes2.forEach((c) => {
@@ -4284,21 +3993,25 @@ function uniqueClasses(classNames = "") {
4284
3993
  });
4285
3994
  return unique.join(" ");
4286
3995
  }
4287
- function wrapperClass(className = "") {
3996
+ function wrapperClass(className) {
3997
+ if (className === void 0) {
3998
+ className = "";
3999
+ }
4288
4000
  if (!className) return "swiper-wrapper";
4289
4001
  if (!className.includes("swiper-wrapper")) return `swiper-wrapper ${className}`;
4290
4002
  return className;
4291
4003
  }
4292
- function updateSwiper({
4293
- swiper,
4294
- slides,
4295
- passedParams,
4296
- changedParams,
4297
- nextEl,
4298
- prevEl,
4299
- scrollbarEl,
4300
- paginationEl
4301
- }) {
4004
+ function updateSwiper(_ref) {
4005
+ let {
4006
+ swiper,
4007
+ slides,
4008
+ passedParams,
4009
+ changedParams,
4010
+ nextEl,
4011
+ prevEl,
4012
+ scrollbarEl,
4013
+ paginationEl
4014
+ } = _ref;
4302
4015
  const updateParams = changedParams.filter((key) => key !== "children" && key !== "direction" && key !== "wrapperClass");
4303
4016
  const {
4304
4017
  params: currentParams,
@@ -4316,7 +4029,7 @@ function updateSwiper({
4316
4029
  let loopNeedDestroy;
4317
4030
  let loopNeedEnable;
4318
4031
  let loopNeedReloop;
4319
- if (changedParams.includes("thumbs") && passedParams.thumbs && passedParams.thumbs.swiper && !passedParams.thumbs.swiper.destroyed && currentParams.thumbs && (!currentParams.thumbs.swiper || currentParams.thumbs.swiper.destroyed)) {
4032
+ if (changedParams.includes("thumbs") && passedParams.thumbs && passedParams.thumbs.swiper && currentParams.thumbs && !currentParams.thumbs.swiper) {
4320
4033
  needThumbsInit = true;
4321
4034
  }
4322
4035
  if (changedParams.includes("controller") && passedParams.controller && passedParams.controller.control && currentParams.controller && !currentParams.controller.control) {
@@ -4362,7 +4075,7 @@ function updateSwiper({
4362
4075
  }
4363
4076
  updateParams.forEach((key) => {
4364
4077
  if (isObject3(currentParams[key]) && isObject3(passedParams[key])) {
4365
- Object.assign(currentParams[key], passedParams[key]);
4078
+ extend3(currentParams[key], passedParams[key]);
4366
4079
  if ((key === "navigation" || key === "pagination" || key === "scrollbar") && "enabled" in passedParams[key] && !passedParams[key].enabled) {
4367
4080
  destroyModule(key);
4368
4081
  }
@@ -4383,9 +4096,6 @@ function updateSwiper({
4383
4096
  if (changedParams.includes("children") && slides && virtual && currentParams.virtual.enabled) {
4384
4097
  virtual.slides = slides;
4385
4098
  virtual.update(true);
4386
- } else if (changedParams.includes("virtual") && virtual && currentParams.virtual.enabled) {
4387
- if (slides) virtual.slides = slides;
4388
- virtual.update(true);
4389
4099
  }
4390
4100
  if (changedParams.includes("children") && slides && currentParams.loop) {
4391
4101
  loopNeedReloop = true;
@@ -4426,14 +4136,14 @@ function updateSwiper({
4426
4136
  if (!nextEl || typeof nextEl === "string") {
4427
4137
  nextEl = document.createElement("div");
4428
4138
  nextEl.classList.add("swiper-button-next");
4429
- setInnerHTML(nextEl, swiper.navigation.arrowSvg);
4139
+ nextEl.innerHTML = swiper.hostEl.constructor.nextButtonSvg;
4430
4140
  nextEl.part.add("button-next");
4431
4141
  swiper.el.appendChild(nextEl);
4432
4142
  }
4433
4143
  if (!prevEl || typeof prevEl === "string") {
4434
4144
  prevEl = document.createElement("div");
4435
4145
  prevEl.classList.add("swiper-button-prev");
4436
- setInnerHTML(prevEl, swiper.navigation.arrowSvg);
4146
+ prevEl.innerHTML = swiper.hostEl.constructor.prevButtonSvg;
4437
4147
  prevEl.part.add("button-prev");
4438
4148
  swiper.el.appendChild(prevEl);
4439
4149
  }
@@ -4462,7 +4172,13 @@ function updateSwiper({
4462
4172
  }
4463
4173
 
4464
4174
  // node_modules/swiper/shared/update-on-virtual-data.mjs
4465
- function getParams(obj = {}, splitEvents = true) {
4175
+ function getParams(obj, splitEvents) {
4176
+ if (obj === void 0) {
4177
+ obj = {};
4178
+ }
4179
+ if (splitEvents === void 0) {
4180
+ splitEvents = true;
4181
+ }
4466
4182
  const params = {
4467
4183
  on: {}
4468
4184
  };
@@ -4507,14 +4223,15 @@ function getParams(obj = {}, splitEvents = true) {
4507
4223
  events: events2
4508
4224
  };
4509
4225
  }
4510
- function mountSwiper({
4511
- el,
4512
- nextEl,
4513
- prevEl,
4514
- paginationEl,
4515
- scrollbarEl,
4516
- swiper
4517
- }, swiperParams) {
4226
+ function mountSwiper(_ref, swiperParams) {
4227
+ let {
4228
+ el,
4229
+ nextEl,
4230
+ prevEl,
4231
+ paginationEl,
4232
+ scrollbarEl,
4233
+ swiper
4234
+ } = _ref;
4518
4235
  if (needsNavigation(swiperParams) && nextEl && prevEl) {
4519
4236
  swiper.params.navigation.nextEl = nextEl;
4520
4237
  swiper.originalParams.navigation.nextEl = nextEl;
@@ -4573,7 +4290,6 @@ var updateOnVirtualData = (swiper) => {
4573
4290
  swiper.updateSlides();
4574
4291
  swiper.updateProgress();
4575
4292
  swiper.updateSlidesClasses();
4576
- swiper.emit("_virtualUpdated");
4577
4293
  if (swiper.parallax && swiper.params.parallax && swiper.params.parallax.enabled) {
4578
4294
  swiper.parallax.setTranslate();
4579
4295
  }
@@ -4669,7 +4385,7 @@ function renderVirtual(swiper, slides, virtualData) {
4669
4385
  return /* @__PURE__ */ import_react.default.cloneElement(child, {
4670
4386
  swiper,
4671
4387
  style,
4672
- key: child.props.virtualIndex || child.key || `slide-${index}`
4388
+ key: `slide-${index}`
4673
4389
  });
4674
4390
  });
4675
4391
  }
@@ -4685,14 +4401,15 @@ var SwiperContext = /* @__PURE__ */ (0, import_react.createContext)(null);
4685
4401
  var useSwiper = () => {
4686
4402
  return (0, import_react.useContext)(SwiperContext);
4687
4403
  };
4688
- var Swiper2 = /* @__PURE__ */ (0, import_react.forwardRef)(({
4689
- className,
4690
- tag: Tag = "div",
4691
- wrapperTag: WrapperTag = "div",
4692
- children,
4693
- onSwiper,
4694
- ...rest
4695
- } = {}, externalElRef) => {
4404
+ var Swiper2 = /* @__PURE__ */ (0, import_react.forwardRef)(function(_temp, externalElRef) {
4405
+ let {
4406
+ className,
4407
+ tag: Tag = "div",
4408
+ wrapperTag: WrapperTag = "div",
4409
+ children,
4410
+ onSwiper,
4411
+ ...rest
4412
+ } = _temp === void 0 ? {} : _temp;
4696
4413
  let eventsAssigned = false;
4697
4414
  const [containerClasses, setContainerClasses] = (0, import_react.useState)("swiper");
4698
4415
  const [virtualData, setVirtualData] = (0, import_react.useState)(null);
@@ -4789,7 +4506,7 @@ var Swiper2 = /* @__PURE__ */ (0, import_react.forwardRef)(({
4789
4506
  scrollbarEl: scrollbarElRef.current,
4790
4507
  swiper: swiperRef.current
4791
4508
  }, swiperParams);
4792
- if (onSwiper && !swiperRef.current.destroyed) onSwiper(swiperRef.current);
4509
+ if (onSwiper) onSwiper(swiperRef.current);
4793
4510
  return () => {
4794
4511
  if (swiperRef.current && !swiperRef.current.destroyed) {
4795
4512
  swiperRef.current.destroy(true, false);
@@ -4853,17 +4570,18 @@ var Swiper2 = /* @__PURE__ */ (0, import_react.forwardRef)(({
4853
4570
  }), slots["container-end"]));
4854
4571
  });
4855
4572
  Swiper2.displayName = "Swiper";
4856
- var SwiperSlide = /* @__PURE__ */ (0, import_react.forwardRef)(({
4857
- tag: Tag = "div",
4858
- children,
4859
- className = "",
4860
- swiper,
4861
- zoom,
4862
- lazy,
4863
- virtualIndex,
4864
- swiperSlideIndex,
4865
- ...rest
4866
- } = {}, externalRef) => {
4573
+ var SwiperSlide = /* @__PURE__ */ (0, import_react.forwardRef)(function(_temp, externalRef) {
4574
+ let {
4575
+ tag: Tag = "div",
4576
+ children,
4577
+ className = "",
4578
+ swiper,
4579
+ zoom,
4580
+ lazy,
4581
+ virtualIndex,
4582
+ swiperSlideIndex,
4583
+ ...rest
4584
+ } = _temp === void 0 ? {} : _temp;
4867
4585
  const slideElRef = (0, import_react.useRef)(null);
4868
4586
  const [slideClasses, setSlideClasses] = (0, import_react.useState)("swiper-slide");
4869
4587
  const [lazyLoaded, setLazyLoaded] = (0, import_react.useState)(false);
@@ -4902,7 +4620,6 @@ var SwiperSlide = /* @__PURE__ */ (0, import_react.forwardRef)(({
4902
4620
  const slideData = {
4903
4621
  isActive: slideClasses.indexOf("swiper-slide-active") >= 0,
4904
4622
  isVisible: slideClasses.indexOf("swiper-slide-visible") >= 0,
4905
- isFullyVisible: slideClasses.indexOf("swiper-slide-fully-visible") >= 0,
4906
4623
  isPrev: slideClasses.indexOf("swiper-slide-prev") >= 0,
4907
4624
  isNext: slideClasses.indexOf("swiper-slide-next") >= 0
4908
4625
  };
@@ -4923,17 +4640,11 @@ var SwiperSlide = /* @__PURE__ */ (0, import_react.forwardRef)(({
4923
4640
  className: "swiper-zoom-container",
4924
4641
  "data-swiper-zoom": typeof zoom === "number" ? zoom : void 0
4925
4642
  }, renderChildren(), lazy && !lazyLoaded && /* @__PURE__ */ import_react.default.createElement("div", {
4926
- className: "swiper-lazy-preloader",
4927
- ref: (node) => {
4928
- if (node) node.lazyPreloaderManaged = true;
4929
- }
4643
+ className: "swiper-lazy-preloader"
4930
4644
  }))), !zoom && /* @__PURE__ */ import_react.default.createElement(SwiperSlideContext.Provider, {
4931
4645
  value: slideData
4932
4646
  }, renderChildren(), lazy && !lazyLoaded && /* @__PURE__ */ import_react.default.createElement("div", {
4933
- className: "swiper-lazy-preloader",
4934
- ref: (node) => {
4935
- if (node) node.lazyPreloaderManaged = true;
4936
- }
4647
+ className: "swiper-lazy-preloader"
4937
4648
  })));
4938
4649
  });
4939
4650
  SwiperSlide.displayName = "SwiperSlide";