const swiper = new Swiper('[class^="iwp"] .swiper', {
  // Optional parameters
  direction: 'horizontal',
  loop: true,

  // If we need pagination
  pagination: {
    el: '.swiper-pagination',
  },

  // Navigation arrows
  navigation: {
    nextEl: '.swiper-button-next',
    prevEl: '.swiper-button-prev',
  },
});
// Override
let swiperCarousel = document.querySelectorAll(
  '[class^="iwp"] .swiper_carousel'
);
let prevSlide = document.querySelectorAll('[class^="iwp"] .swiper-button-prev');
let nextSlide = document.querySelectorAll('[class^="iwp"] .swiper-button-next');
for (let i = 0; i < swiperCarousel.length; i++) {
  swiperCarousel[i].classList.add('swiper_carousel-' + i);
  prevSlide[i].classList.add('swiper-button-prev-' + i);
  nextSlide[i].classList.add('swiper-button-next-' + i);

  const swiper_carousel = new Swiper(
    '[class^="iwp"] .swiper_carousel-' + i,
    {
    slidesPerView: 1,
    spaceBetween: 0,

    direction: 'horizontal',
    loop: true,

    pagination: false,

    navigation: {
      nextEl: '.swiper-button-next-' + i,
      prevEl: '.swiper-button-prev-' + i,
    },

    breakpoints: {
      768: {
        slidesPerView: 2,
        spaceBetween: 10,
      },
      1024: {
        slidesPerView: 3,
        spaceBetween: 20,
      },
    },
    }
  );
}
