!function(s){"function"==typeof define&&define.amd?define("ctsCarousel",s):s()}(function(){"use strict";jQuery(document).ready(function(i){var n="rtl"===i("html").attr("dir");i(".cts-carousel").each(function(s,c){function t(){var s=c.scrollLeft,t=c.scrollWidth-c.offsetWidth;n?(10<t+s?r.classList.add("cts-show"):r.classList.remove("cts-show"),s<-10?o.classList.add("cts-show"):o.classList.remove("cts-show")):(10<t-s?r.classList.add("cts-show"):r.classList.remove("cts-show"),10<s?o.classList.add("cts-show"):o.classList.remove("cts-show"))}function e(s){var t=n?Math.abs(c.scrollLeft):c.scrollLeft,e=c.scrollWidth-c.offsetWidth;return"next"===s?Math.min(300,e-t):Math.min(300,t)}var o=c.querySelector(".cts-prev"),r=c.querySelector(".cts-next");i(r).on("click",function(){var s=e("next");c.scrollBy({left:n?-s:s,behavior:"smooth"})}),i(o).on("click",function(){var s=e("prev");c.scrollBy({left:n?s:-s,behavior:"smooth"})}),c.addEventListener("scroll",MyListing.Helpers.debounce(t,20)),new ResizeSensor(c,MyListing.Helpers.debounce(t,100)),t()})})});
