document.addEventListener("DOMContentLoaded",function(){const e=document.querySelectorAll("span.purdue-home-cta-hero__header-animate");console.log(e);let t=null,s=null,a=0,l=!1;e.length>0&&e.forEach(c=>{const o=c.querySelectorAll("span.purdue-home-cta-hero__header-animate-item");if(o.length>0){function i(e){for(let e=0;e<o.length;e++)o[e].classList.add("hide"),o[e].classList.remove("slide-in","slide-out");const t=o[e];t.classList.remove("hide"),t.classList.add("slide-in")}function n(){l||(s=setTimeout(()=>{if(l)return;const e=o[a];e.classList.remove("slide-in"),e.classList.add("slide-out")},3500),t=setTimeout(()=>{l||(a=(a+1)%o.length,i(a),n())},4e3))}function r(){clearTimeout(t),clearTimeout(s),t=null,s=null}i(a),n();const u=document.querySelector(".purdue-home-50-50-animated-header button.cta-btnctrl");u&&u.addEventListener("click",t=>{console.log(e);const s=t.currentTarget;console.log(s);const u=s.querySelector("i");console.log(u),s.classList.contains("cta-play")?(console.log(s),s.classList.remove("cta-play"),s.classList.add("cta-pause"),s.setAttribute("aria-label","Pause Animation"),u.classList.add("fa-circle-pause","cta-pause-icon"),u.classList.remove("fa-circle-play","cta-play-icon"),c.classList.remove("pause"),l=!1,r(),i(a=(a+1)%o.length),n()):(s.classList.add("cta-play"),s.classList.remove("cta-pause"),s.setAttribute("aria-label","Play Animation"),u.classList.add("fa-circle-play","cta-play-icon"),u.classList.remove("fa-circle-pause","cta-pause-icon"),c.classList.add("pause"),l=!0,r())})}})});