jQuery(document).ready(function ($) {
    var mainSliderAutoplay = IRK_DATA.main_slider_autoplay;
    var mainSliderLoop = IRK_DATA.main_slider_loop;
    var mainSliderAnimation = IRK_DATA.main_slider_animation;
    var mainSliderOptions = {
        autoplayHoverPause: true,
        autoplaySpeed: 500,
        nav: true,
        dots: true,
        items: 1,
        navText: ['<span data-icon=arrow-left></span>', '<span data-icon=arrow-right></span>'],
    };
    if ($('body').hasClass('rtl')) {
        mainSliderOptions.rtl = true;
    }
    if (mainSliderAutoplay) {
        mainSliderOptions.autoplay = true;
    }
    if (mainSliderLoop) {
        mainSliderOptions.loop = true;
    }
    if (mainSliderAnimation === 'fadeout') {
        mainSliderOptions.animateOut = 'fadeOut';
    }
    $('.main-slider .owl-carousel').owlCarousel(mainSliderOptions);

    var promotionSliderOptions = {
        autoplayTimeout: 10000,
        autoplayHoverPause: false,
        autoplaySpeed: 500,
        nav: false,
        loop: true,
        autoplay: true,
        dots: false,
        items: 1,
        navText: ['<span data-icon=arrow-left></span>', '<span data-icon=arrow-right></span>'],
    };
    if ($('body').hasClass('rtl')) {
        promotionSliderOptions.rtl = true;
    }
    $('.promotion-slider .owl-carousel').owlCarousel(promotionSliderOptions);

    var relatedProductsSliderOptions = {
        autoplayTimeout: 10000,
        autoplayHoverPause: true,
        autoplaySpeed: 500,
        nav: true,
        loop: true,
        autoplay: true,
        dots: false,
        items: 1,
    };
    if ($('body').hasClass('rtl')) {
        relatedProductsSliderOptions.rtl = true;
    }
    $('.related-products-slider .owl-carousel').owlCarousel(relatedProductsSliderOptions);

    var amazingSliderAutoplay = IRK_DATA.amazing_slider_autoplay;
    var amazingSliderLoop = IRK_DATA.amazing_slider_loop;
    var amazingSliderItems = IRK_DATA.amazing_slider_items;
    var amazingSliderOptions = {
        nav: true,
        dots: false,
        margin: 5,
        navText: ['<span data-icon=arrow-left></span>', '<span data-icon=arrow-right></span>'],
        responsive: {
            0: {
                items: 2,
                slideBy: 2,
            },
            768: {
                items: 3,
                slideBy: 3,
            },
            992: {
                items: amazingSliderItems,
                slideBy: amazingSliderItems,
            }
        }
    };
    if ($('body').hasClass('rtl')) {
        amazingSliderOptions.rtl = true;
    }
    if (amazingSliderAutoplay) {
        amazingSliderOptions.autoplay = true;
    }
    if (amazingSliderLoop) {
        amazingSliderOptions.loop = true;
    }
    $('.amazing-slider.style1 .owl-carousel').owlCarousel(amazingSliderOptions);

    var amazingSliderAutoplay2 = IRK_DATA.amazing_slider_autoplay;
    var amazingSliderLoop2 = IRK_DATA.amazing_slider_loop;
    var amazingSliderOptions2 = {
        nav: false,
        dots: false,
        margin: 5,
        items: 1,
        animateOut: 'fadeOut',
        thumbs: true,
        thumbImage: false,
        thumbsPrerendered: true,
        thumbContainerClass: 'owl-thumbs',
        thumbItemClass: 'owl-thumb-item',
        navText: ['<span data-icon=arrow-left></span>', '<span data-icon=arrow-right></span>'],
        responsive: {
            0: {
                items: 2,
                slideBy: 2,
                nav: true,
            },
            768: {
                items: 3,
                slideBy: 3,
                nav: true,
            },
            992: {
                items: 1,
                slideBy: 1,
            },
        }
    };
    if ($('body').hasClass('rtl')) {
        amazingSliderOptions2.rtl = true;
    }
    if (amazingSliderAutoplay2) {
        amazingSliderOptions2.autoplay = true;
    }
    if (amazingSliderLoop2) {
        amazingSliderOptions2.loop = true;
    }
    $('.amazing-slider.style2 .owl-carousel').owlCarousel(amazingSliderOptions2);

    var productsSliderAutoplay = IRK_DATA.products_slider_autoplay;
    var productsSliderLoop = IRK_DATA.products_slider_loop;
    var productsSliderItems = IRK_DATA.products_slider_items;
    var productsSliderOptions = {
        nav: true,
        dots: false,
        margin: 5,
        navText: ['<span data-icon=arrow-left></span>', '<span data-icon=arrow-right></span>'],
        responsive: {
            0: {
                items: 2,
                slideBy: 2,
            },
            768: {
                items: 3,
                slideBy: 3,
            },
            992: {
                items: productsSliderItems,
                slideBy: productsSliderItems,
            }
        }
    };
    if ($('body').hasClass('rtl')) {
        productsSliderOptions.rtl = true;
    }
    if (productsSliderAutoplay) {
        productsSliderOptions.autoplay = true;
    }
    if (productsSliderLoop) {
        productsSliderOptions.loop = true;
    }
    $('.widget-products-slider .owl-carousel').owlCarousel(productsSliderOptions);

    var brandsSliderAutoplay = IRK_DATA.brands_slider_autoplay;
    var brandsSliderLoop = IRK_DATA.brands_slider_loop;
    var brandsSliderItems = IRK_DATA.brands_slider_items;
    var brandsSliderOptions = {
        nav: true,
        dots: false,
        margin: 5,
        navText: ['<span data-icon=arrow-left></span>', '<span data-icon=arrow-right></span>'],
        responsive: {
            0: {
                items: 2,
                slideBy: 2,
            },
            768: {
                items: 3,
                slideBy: 3,
            },
            992: {
                items: brandsSliderItems,
                slideBy: brandsSliderItems,
            }
        }
    };
    if ($('body').hasClass('rtl')) {
        brandsSliderOptions.rtl = true;
    }
    if (brandsSliderAutoplay) {
        brandsSliderOptions.autoplay = true;
    }
    if (brandsSliderLoop) {
        brandsSliderOptions.loop = true;
    }
    $('.widget-brands-slider .owl-carousel').owlCarousel(brandsSliderOptions);

    var postsSliderAutoplay = IRK_DATA.posts_slider_autoplay;
    var postsSliderLoop = IRK_DATA.posts_slider_loop;
    var postsSliderItems = IRK_DATA.posts_slider_items;
    var postsSliderOptions = {
        nav: true,
        dots: false,
        margin: 5,
        navText: ['<span data-icon=arrow-left></span>', '<span data-icon=arrow-right></span>'],
        responsive: {
            0: {
                items: 2,
                slideBy: 2,
            },
            768: {
                items: 3,
                slideBy: 3,
            },
            992: {
                items: postsSliderItems,
                slideBy: postsSliderItems,
            }
        }
    };
    if ($('body').hasClass('rtl')) {
        postsSliderOptions.rtl = true;
    }
    if (postsSliderAutoplay) {
        postsSliderOptions.autoplay = true;
    }
    if (postsSliderLoop) {
        postsSliderOptions.loop = true;
    }
    $('.widget-posts-slider .owl-carousel').owlCarousel(postsSliderOptions);
});