(e=>{"function"==typeof define&&define.amd?define("carouselPreview",e):e()})(function(){jQuery(function(r){r(".gallery-prev-btn").click(function(e){e.preventDefault(),r(this).parents(".element").find(".gallery-carousel.owl-carousel").trigger("prev.owl.carousel")}),r(".gallery-next-btn").click(function(e){e.preventDefault(),r(this).parents(".element").find(".gallery-carousel.owl-carousel").trigger("next.owl.carousel")}),r(".element.video-block").on("click",".prev-next-pagination a.prev",function(e){e.preventDefault(),r(this).hasClass("disabled")||r(this).closest(".element.video-block").find(".video-gallery-carousel.owl-carousel").trigger("prev.owl.carousel")}),r(".element.video-block").on("click",".prev-next-pagination a.next",function(e){e.preventDefault(),r(this).hasClass("disabled")||r(this).closest(".element.video-block").find(".video-gallery-carousel.owl-carousel").trigger("next.owl.carousel")}),r(".element.video-block .video-gallery-carousel.owl-carousel").on("initialized.owl.carousel changed.owl.carousel refreshed.owl.carousel resized.owl.carousel",function(e){var t,i,l,n,a,o;t=r(this),e=e,(o=t.closest(".element.video-block")).length&&(t=t.data("owl.carousel"))&&(i=o.find(".prev-next-pagination a.prev").first(),o=o.find(".prev-next-pagination a.next").first(),i.length)&&o.length&&(n=l=!0,n=e&&e.page&&"number"==typeof e.page.index&&"number"==typeof e.page.count?(l=0===e.page.index,e.page.index>=e.page.count-1):e&&e.item&&"number"==typeof e.item.index?(a="number"==typeof e.item.count?e.item.count:t.items().length,l=(e=t.relative(e.item.index))<=0,a-1<=e):(l=(a=t.relative(t.current()))<=0,a>=t.items().length-1),i.toggleClass("disabled",l).attr("aria-disabled",l?"true":"false"),o.toggleClass("disabled",n).attr("aria-disabled",n?"true":"false"))})}),MyListing.GalleryCarouselPreview=function(){jQuery(function(l){l(".gallerySlider").each(function(){var e=l(this),t=e.find(".galleryPreview"),i=e.find(".gallery-thumb");t.length&&(t.owlCarousel({items:1,center:!0,dotsContainer:"#customDots",autoHeight:!0}),t.on("changed.owl.carousel",function(){l(this).find("video").each(function(){!1===this.paused&&this.pause()})})),e.find(".slide-thumb").click(function(e){e.preventDefault();e=l(this).data("slide-no");t.trigger("to.owl.carousel",e)}),i.each(function(){var e=l(this).data("items")?l(this).data("items"):4,t=l(this).data("items-mobile")?l(this).data("items-mobile"):2;l(this).owlCarousel({margin:10,items:e,mouseDrag:!1,responsive:{0:{items:t},600:{items:3<e?3:e},1e3:{items:e}}})}),e.find(".gallery-prev-btn").click(function(e){e.preventDefault(),i.trigger("prev.owl.carousel")}),e.find(".gallery-next-btn").click(function(e){e.preventDefault(),i.trigger("next.owl.carousel")}),setTimeout(function(){l(window).trigger("resize")},100)})})},MyListing.GalleryCarouselPreview()});
