(function ($) {
	const ninodemCardSlider = {
		init: function () {
			const self = this;
			$(".esign-slider-row").each(function () {
				self.setup($(this));
				self.sliders($(this));
			});
		},

		setup: function ($cardSlider) {
			$cardSlider.find(".wp-block-group").each(function () {
				$(this).wrap('<div class="card-slider-item"></div>');
			});
		},

		sliders: function ($cardSlider) {
			const self = this;
			const $wrapper = $cardSlider.parent();
			$cardSlider.slick({
				slidesToShow: 1,
				slidesToScroll: 1,
				arrows: true,
				// appendArrows: $wrapper.find('.esign-slider-btns'),
				prevArrow: $wrapper.find('.esign-slider-btn-prev .wp-block-button__link'),
				nextArrow: $wrapper.find('.esign-slider-btn-next .wp-block-button__link'),
				draggable: false,
				focusOnSelect: true,
				variableWidth: true,
			});
		},
	};

	ninodemCardSlider.init();
})(jQuery);
