function Util(){}Util.hasClass=function(el,className){return el.classList.contains(className)},Util.addClass=function(el,className){var classList=className.split(" ");void 0!==el.classList&&el.classList.add(classList[0]),classList.length>1&&Util.addClass(el,classList.slice(1).join(" "))},Util.removeClass=function(el,className){var classList=className.split(" ");void 0!==el.classList&&(el.classList.remove(classList[0]),classList.length>1&&Util.removeClass(el,classList.slice(1).join(" ")))},Util.getIndexInArray=function(array,el){return Array.prototype.indexOf.call(array,el)},Util.osHasReducedMotion=function(){if(!window.matchMedia)return!1;var matchMediaObj=window.matchMedia("(prefers-reduced-motion: reduce)");return!!matchMediaObj&&matchMediaObj.matches},function(){"use strict";var TextAnim=function(element){this.element=element,this.wordsWrapper=this.element.getElementsByClassName(" js-text-anim__wrapper"),this.words=this.element.getElementsByClassName("js-text-anim__word"),this.selectedWord=0,this.loopInterval=1e3*parseFloat(getComputedStyle(this.element).getPropertyValue("--text-anim-pause"))||1e3,this.transitionDuration=1e3*parseFloat(getComputedStyle(this.element).getPropertyValue("--text-anim-duration"))||1e3,this.loop=!this.element.getAttribute("data-loop")||"off"!=this.element.getAttribute("data-loop"),this.wordInClass="text-anim__word--in",this.wordOutClass="text-anim__word--out",this.isClipAnim=Util.hasClass(this.element,"text-anim--clip"),this.isClipAnim&&(this.animBorderWidth=parseInt(getComputedStyle(this.element).getPropertyValue("--text-anim-border-width"))||2,this.animPulseClass="text-anim__wrapper--pulse"),initTextAnim(this)};function initTextAnim(element){setSelectedWord(element),element.isClipAnim&&Util.addClass(element.wordsWrapper[0],element.animPulseClass),loopWords(element)}function setSelectedWord(element){var selectedWord=element.element.getElementsByClassName(element.wordInClass);0==selectedWord.length?Util.addClass(element.words[0],element.wordInClass):element.selectedWord=Util.getIndexInArray(element.words,selectedWord[0])}function loopWords(element){if(element.loop||element.selectedWord!=element.words.length-1){var newWordIndex=getNewWordIndex(element);setTimeout((function(){element.isClipAnim?switchClipWords(element,newWordIndex):switchWords(element,newWordIndex)}),element.loopInterval)}}function switchWords(element,newWordIndex){Util.removeClass(element.words[element.selectedWord],element.wordInClass),Util.addClass(element.words[element.selectedWord],element.wordOutClass),Util.addClass(element.words[newWordIndex],element.wordInClass),resetLoop(element,newWordIndex)}function resetLoop(element,newIndex){setTimeout((function(){Util.removeClass(element.words[element.selectedWord],element.wordOutClass),element.selectedWord=newIndex,loopWords(element)}),element.transitionDuration)}function switchClipWords(element,newWordIndex){var startWidth=element.words[element.selectedWord].offsetWidth,endWidth=element.words[newWordIndex].offsetWidth;Util.removeClass(element.wordsWrapper[0],element.animPulseClass),animateWidth(startWidth,element.animBorderWidth,element.wordsWrapper[0],element.transitionDuration,(function(){Util.removeClass(element.words[element.selectedWord],element.wordInClass),Util.addClass(element.words[newWordIndex],element.wordInClass),element.selectedWord=newWordIndex,animateWidth(element.animBorderWidth,endWidth,element.wordsWrapper[0],element.transitionDuration,(function(){Util.addClass(element.wordsWrapper[0],element.animPulseClass),loopWords(element)}))}))}function getNewWordIndex(element){var index=element.selectedWord+1;return index>=element.words.length&&(index=0),index}function animateWidth(start,to,element,duration,cb){var currentTime=null,animateProperty=function(timestamp){currentTime||(currentTime=timestamp);var progress=timestamp-currentTime,val=Math.easeInOutQuart(progress,start,to-start,duration);element.style.width=val+"px",progress<duration?window.requestAnimationFrame(animateProperty):cb()};element.style.width=start+"px",window.requestAnimationFrame(animateProperty)}window.TextAnim=TextAnim;var textAnim=document.getElementsByClassName("js-text-anim"),reducedMotion=Util.osHasReducedMotion();if(textAnim){if(reducedMotion)return;for(var i=0;i<textAnim.length;i++)!function(i){new TextAnim(textAnim[i])}(i)}}();