/* global WCF_ADDONS_JS */
(function ($) {
  /**
   * @param $scope The Widget wrapper element as a jQuery element
   * @param $ The jQuery alias
   */
  const BinoxHeroSlider = function ($scope, $) {
    const slider = $($('.binox_hero_slider', $scope)[0]);
    const sliderSettings = $($('.binox_hero_slider', $scope)[0]).data('settings') || {};

    new elementorFrontend.utils.swiper(slider, sliderSettings).then(newSwiperInstance => newSwiperInstance);
  };

  // Make sure you run this code under Elementor.
  $(window).on('elementor/frontend/init', function () {
    elementorFrontend.hooks.addAction('frontend/element_ready/wcf--hero-slider.default', BinoxHeroSlider);
  });
})(jQuery);