(()=>{"use strict";!function(){function t(t){var e=t.querySelector(".ttc-carousel-container");if(e){var n=e.querySelectorAll(".ttc-card"),a=e.querySelectorAll(".ttc-dot"),i=e.querySelector(".ttc-nav-prev"),s=e.querySelector(".ttc-nav-next");if(!(n.length<1)){var r="true"===e.getAttribute("data-autoplay"),c=parseInt(e.getAttribute("data-speed"),10)||4,o=e.getAttribute("data-transition")||"fade",u=0,l=null,d=!1,f=0,v=0,y=!1;s&&s.addEventListener("click",(function(){m(),h(),g()})),i&&i.addEventListener("click",(function(){p(),h(),g()})),a.forEach((function(t){t.addEventListener("click",(function(){var e=parseInt(t.getAttribute("data-index"),10);L(e,e>u?"next":"prev"),h(),g()}))})),e.addEventListener("mouseenter",(function(){y=!0,h()})),e.addEventListener("mouseleave",(function(){y=!1,g()})),t.setAttribute("tabindex","0"),t.addEventListener("keydown",(function(t){"ArrowRight"===t.key||"ArrowDown"===t.key?(t.preventDefault(),m(),h(),g()):"ArrowLeft"!==t.key&&"ArrowUp"!==t.key||(t.preventDefault(),p(),h(),g())})),e.addEventListener("touchstart",(function(t){f=t.changedTouches[0].screenX}),{passive:!0}),e.addEventListener("touchend",(function(t){v=t.changedTouches[0].screenX;var e=f-v;Math.abs(e)>50&&(e>0?m():p(),h(),g())}),{passive:!0}),e.addEventListener("focusin",(function(){y=!0,h()})),e.addEventListener("focusout",(function(){y=!1,g()})),g()}}function L(t,e){if(!d&&t!==u){d=!0;var i,s=n[u],r=n[t];if("slide"===o){var c="next"===e?"is-exiting-left":"is-exiting-right";s.classList.add(c),s.classList.remove("is-active"),r.style.transform="next"===e?"translateX(60px)":"translateX(-60px)",r.style.opacity="0",r.classList.add("is-active"),requestAnimationFrame((function(){requestAnimationFrame((function(){r.style.transform="translateX(0)",r.style.opacity="1"}))})),setTimeout((function(){s.classList.remove(c),s.style.transform="",s.style.opacity="",r.style.transform="",r.style.opacity="",d=!1}),520)}else s.classList.remove("is-active"),r.classList.add("is-active"),setTimeout((function(){d=!1}),520);i=t,a.forEach((function(t,e){var n=t.getAttribute("data-accent")||"";e===i?(t.classList.add("is-active"),t.setAttribute("aria-selected","true"),n&&(t.style.background=n)):(t.classList.remove("is-active"),t.setAttribute("aria-selected","false"),t.style.background="")})),u=t}}function m(){L((u+1)%n.length,"next")}function p(){L((u-1+n.length)%n.length,"prev")}function g(){r&&n.length>1&&!y&&(h(),l=setInterval(m,1e3*c))}function h(){l&&(clearInterval(l),l=null)}}function e(){document.querySelectorAll(".wp-block-bpsc-carousel-testimonial-section").forEach(t)}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",e):e()}()})();