
document.addEventListener("DOMContentLoaded",(function(){function e(e,t){var n=t.querySelector(".ticker"),i=t.querySelector(".ticker-wrap");if(n&&i){var o=!1;function r(){var e=210,i=window.innerWidth;if(i>1920||(i>992?e*=i/1920:e=e/1920*992),o){const e=t.getBoundingClientRect();e.top<0||e.bottom>window.innerHeight?n.style.animationPlayState="paused":n.style.animationPlayState="running"}else{const e=t.getBoundingClientRect(),o=e.top+.5*e.height;o<0||o>window.innerHeight?(n.style.animationPlayState="paused",i<768&&(n.style.marginTop=t.getBoundingClientRect().top+n.getBoundingClientRect().height-20+"px")):(n.style.animationPlayState="running",n.style.marginTop="0px")}}0!=t.getBoundingClientRect().top&&(o=!0),Number(n.style.animationDuration.split("s").join("")),window.addEventListener("resize",r),document.addEventListener("scroll",r),document.addEventListener("smoothscroll",r),r(),document.addEventListener("cleanup",(function e(){document.removeEventListener("cleanup",e),window.removeEventListener("resize",r),document.removeEventListener("scroll",r),document.removeEventListener("smoothscroll",r)}))}}const t=document.getElementsByClassName("wp-block-tbwa-blocks-ticker-text");for(var n=0;n<t.length;n++)e(0,t[n])}),!1);



document.addEventListener("DOMContentLoaded",(function(){function e(e,t){const o=t.querySelector(".search"),n=t.querySelector(".search form"),s=t.querySelector(".search-icon"),c=t.querySelector("input"),i=t.querySelector(".search-icon-clear"),r=t.querySelector(".hamburger-icon"),a=t.querySelector(".close-icon"),l=t.querySelector(".tint-search"),d=t.querySelector(".column-outer-1"),u=t.querySelector(".column-outer-2");if(o&&n&&s&&c&&i&&r&&a&&l&&d&&u){n.addEventListener("submit",(function(e){e.preventDefault();var t=n.action+"?keywords="+encodeURIComponent(c.value);window.tbwaPageTransitionGoToURL?window.tbwaPageTransitionGoToURL(t,"_parent"):window.open(t,"_parent"),gtag("event","search",{search_term:c.value})})),r.addEventListener("click",(function(o){t.classList.add("menu-open"),t.classList.remove("search-open"),r.classList.remove("show"),s.classList.remove("show"),a.classList.add("show"),0==e&&document.body.classList.add("noscroll")})),a.addEventListener("click",m),s.addEventListener("click",(function(e){t.classList.remove("menu-open"),r.classList.remove("show"),a.classList.add("show"),h(),c.focus(),c.selectionStart=c.selectionEnd=c.value.length,o.classList.add("show"),t.classList.add("search-open"),c.value="",c.setAttribute("placeholder",""),c.focus(),setTimeout((function(){w()}),333),document.addEventListener("click",L)})),c.addEventListener("input",h),i.addEventListener("click",(function(e){c.value="",i.classList.remove("show"),c.focus()})),l.addEventListener("click",m),window.addEventListener("resize",p);const y=t.querySelectorAll(".wp-block-tbwa-blocks-top-nav-button a");for(var v=0;v<y.length;v++)window.location.href==y[v].href&&y[v].classList.add("active");function m(e){t.classList.remove("menu-open"),t.classList.remove("search-open"),a.classList.remove("show"),o.classList.remove("show"),r.classList.add("show"),s.classList.add("show"),document.body.classList.remove("noscroll")}function L(e){t.contains(e.target)||(document.removeEventListener("click",L),m())}function w(){const e="I'm looking for...".substr(0,c.placeholder.length+1);c.placeholder=e,e.length<18?setTimeout((function(){w()}),50):c.focus()}function h(e){""==c.value?i.classList.remove("show"):i.classList.add("show")}var f=window.innerWidth;function p(){const e=window.innerWidth;f!=e&&(f=e,e>768&&m())}if(0==e){function E(){var e="absolute",o="relative";t.getBoundingClientRect().top<=0&&(e="fixed",o="fixed"),d.style.position=e,u.style.position=o}t.classList.add("first"),window.addEventListener("resize",E),document.addEventListener("scroll",E),document.addEventListener("smoothscroll",E),E()}document.addEventListener("cleanup",(function e(){document.removeEventListener("cleanup",e),window.removeEventListener("resize",p),window.removeEventListener("resize",E),document.removeEventListener("scroll",E),document.removeEventListener("smoothscroll",E)}))}}const t=document.getElementsByClassName("wp-block-tbwa-blocks-top-nav");for(var o=0;o<t.length;o++)e(o,t[o])}),!1);



document.addEventListener("DOMContentLoaded",(function(){function e(e){var t,n=T(),o=!0,i=-0,a="",r="",c="",l=0,s=e.querySelectorAll(".wp-block-tbwa-blocks-homepage-hero-item");if(!(s.length<=0)){var d,u,g,w=e.querySelector(".indicator-knob"),h=e.querySelector(".indicator-max");h&&(h.innerHTML=s.length);for(var v=0;v<s.length;v++)s[v].style.display="inline-block";y()&&(e.addEventListener("touchstart",(function(e){d=e.touches[0].pageX,u=e.touches[0].pageY,g=new Date})),e.addEventListener("touchend",(function(e){var t=e.changedTouches[0].pageX,n=e.changedTouches[0].pageY,o=new Date;let i=t-d,a=n-u,r=o-g;Math.abs(i)>30&&Math.abs(a)<30&&r<1e3&&(i<0?(b(),gtag("event","Homepage Hero Next",{})):(p(),gtag("event","Homepage Hero Previous",{})))}))),f(),setTimeout((function(){for(var e=0;e<s.length;e++)s[e].classList.add("animate")}),100),window.addEventListener("resize",m),window.addEventListener("mousemove",L),e.addEventListener("click",(function(e){e.preventDefault(),y()||"arrow-left"!=c?"read-more"==c?""!=a&&(window.tbwaPageTransitionGoToURL?window.tbwaPageTransitionGoToURL(a,r):window.open(a,r)):y()||"arrow-right"!=c||(b(),gtag("event","Homepage Hero Next",{})):(p(),gtag("event","Homepage Hero Previous",{})),L(e)})),function a(){if(o){if(w){var r=(T()-(n+1))/6.5;r<0&&(r=0),r>1&&(r=1),w.style.width=100*r+"%",w.style.left=50-50*r+"%"}T()-n>8&&(n=T(),function(){if(i+1>=s.length)return i=0,void f();const t=e.getBoundingClientRect();if(t.top+.5*t.height<0)return o=!1,void f();i+=1,f()}())}t&&clearTimeout(t),t=setTimeout(a,50)}(),document.addEventListener("cleanup",(function e(){document.removeEventListener("cleanup",e),window.removeEventListener("resize",m),window.removeEventListener("mousemove",L),t&&clearTimeout(t)}))}function m(){f()}function f(){a=s[i].getAttribute("data-url"),r=s[i].getAttribute("data-target");const t=document.body.clientWidth;for(var n=0;n<s.length;n++){var c=s[n];c.style.width=t+"px",c.style.left=(n-i)*t+"px",n==i?c.classList.add("active"):c.classList.remove("active")}o||w&&(w.style.width=1/s.length*100+"%",w.style.left=i/s.length*100+"%");var l=e.querySelector(".indicator-min");l&&(l.innerHTML=i+1)}function p(){o=!1,(i-=1)<0&&(i=s.length-1),f()}function b(){o=!1,(i+=1)>s.length-1&&(i=0),f()}function L(t){l=t.clientX,t.clientY;const n=document.body.clientWidth;c=l<n/3?"arrow-left":l<n/3*2?""!=a?"read-more":"":"arrow-right",window.tbwaThemeFollowCursorSelect&&window.tbwaThemeFollowCursorSelect(c,e,"small","black-white")}function T(){return performance.now()/1e3}function y(){return"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0}}const t=document.getElementsByClassName("wp-block-tbwa-blocks-homepage-hero");for(var n=0;n<t.length;n++)e(t[n])}),!1);



document.addEventListener("DOMContentLoaded",(function(){const t=document.querySelectorAll(".wp-block-tbwa-blocks-image-animated-sprite,.wp-block-tbwa-blocks-section-with-spritesheet-media .media,.wp-block-tbwa-blocks-section-with-spritesheet-media .column-outer");function e(t){const e=t.querySelector(".sprite");if(e){const n=t.dataset.spriteUrl,o=900,s=900,c=(Math.ceil(49/9),9),l=49;let a=l-1;function i(){a<0&&(a=l-1);const i=Math.floor(a/c),r=a%c,d=t.clientWidth,h=t.clientHeight,u=Math.min(d/o,h/s),b=o*u,m=s*u;e.style.backgroundImage=`url(${n})`,e.style.backgroundSize=`${8100*u}px ${5400*u}px`;const p=-r*b+(d-b)/2+"px",w=-i*m+"px";e.style.backgroundPosition=`${p} ${w}`,a--;const f=t.closest(".wp-block-tbwa-blocks-section-with-spritesheet-media .column-outer");if(f)if(f.clientWidth!==f.clientHeight){const e=t.firstElementChild;e.style.margin="0 auto",e.style.width=e.clientHeight+"px"}else t.style.margin="",childDiv.style.width=""}setInterval(i,50),window.addEventListener("resize",(()=>{i()}))}}if(t.length>0)for(const i of t)e(i)}),!1);



document.addEventListener("DOMContentLoaded",(function(){function t(t){const e=t.querySelector("a");if(e){const a=e.getAttribute("data-cursor"),c=(e.getAttribute("data-cursor-position"),e.getAttribute("data-cursor-size"));var o=e.getAttribute("data-cursor-color");const s=e.getAttribute("href"),u=e.getAttribute("target");if(""==a)return;if(""==s)return;"yellow"==o&&(t.closest(".background-black")||(o="yellow-inverted"));var n=t.previousElementSibling;function r(t){if(mx=t.clientX,my=t.clientY,n){const t=n.getBoundingClientRect();t.left<mx&&mx<t.right&&t.top<my&&my<t.bottom&&(e=a,window.tbwaThemeFollowCursorSelect&&window.tbwaThemeFollowCursorSelect(e,n,c,o))}var e}function i(t){t.preventDefault(),window.tbwaPageTransitionGoToURL?window.tbwaPageTransitionGoToURL(s,u):window.open(s,u),r(t)}n&&("ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0?(n.addEventListener("click",i),n.style.cursor="pointer"):(window.addEventListener("mousemove",r),n.addEventListener("click",i),n.style.cursor="pointer"),document.addEventListener("cleanup",(function t(){document.removeEventListener("cleanup",t),window.removeEventListener("mousemove",r)})))}}const e=document.getElementsByClassName("wp-block-tbwa-blocks-follow-cursor");for(var o=0;o<e.length;o++)t(e[o])}),!1);



document.addEventListener('DOMContentLoaded',function(event){var commentForm=document.getElementById("commentform");if(null===commentForm){return}
var author=commentForm.querySelector("#author");if(null===author){return}
author.addEventListener('blur',function(){this.value=this.value.replace(/\d+/g,'')},!1)});



document.addEventListener("DOMContentLoaded",(function(){function e(e){var t,n=E(),o=!0,i=-0,r="",a=0,c=e.querySelectorAll(".wp-block-tbwa-blocks-carousel-item");if(!(c.length<=0)){var l,s,u,d=e.querySelector(".indicator-min"),g=e.querySelector(".indicator-max");d&&(d.innerHTML="1"),g&&(g.innerHTML=c.length);for(var h,v=e.querySelector(".indicator-knob"),f=0;f<c.length;f++)c[f].style.display="inline-block";C()&&(e.addEventListener("touchstart",(function(e){l=e.touches[0].pageX,s=e.touches[0].pageY,u=new Date})),e.addEventListener("touchend",(function(e){var t=e.changedTouches[0].pageX,n=e.changedTouches[0].pageY,o=new Date;let i=t-l,r=n-s,a=o-u;Math.abs(i)>30&&Math.abs(r)<30&&a<1e3&&(i<0?(T(),gtag("event","Homepage Hero Next",{})):(p(),gtag("event","Homepage Hero Previous",{})))}))),L(),setTimeout(w,100),window.addEventListener("resize",m),window.addEventListener("mousemove",b),e.addEventListener("click",(function(e){e.preventDefault(),C()||"arrow-left"!=r?C()||"arrow-right"!=r||(T(),gtag("event","Carousel Next",{})):(p(),gtag("event","Carousel Previous",{})),b(e)})),function r(){if(o){if(v){var a=(E()-(n+1))/6.5;a<0&&(a=0),a>1&&(a=1),v.style.width=100*a+"%",v.style.left=50-50*a+"%"}E()-n>8&&(n=E(),function(){if(i+1>=c.length)return i=0,void L();const t=e.getBoundingClientRect();if(t.top+.5*t.height<0)return o=!1,void L();(i+=1)>=c.length&&(i=0),L()}())}t&&clearTimeout(t),t=setTimeout(r,50)}(),document.addEventListener("cleanup",(function e(){document.removeEventListener("cleanup",e),window.removeEventListener("resize",m),window.removeEventListener("mousemove",b),t&&clearTimeout(t)}))}function w(){for(var e=0;e<c.length;e++)c[e].classList.add("animate")}function m(){!function(){for(var e=0;e<c.length;e++)c[e].classList.remove("animate")}(),L(),h&&clearTimeout(h),h=setTimeout(w,500)}function L(){const t=e.getBoundingClientRect();for(var n=0;n<c.length;n++){var r=c[n];r.style.width=t.width+"px",r.style.left=0+(n-i)*t.width+"px",n==i?r.classList.add("active"):r.classList.remove("active")}o||v&&(v.style.width=1/c.length*100+"%",v.style.left=i/c.length*100+"%"),d&&(d.innerHTML=i+1)}function p(){o=!1,(i-=1)<0&&(i=c.length-1),L()}function T(){o=!1,(i+=1)>c.length-1&&(i=0),L()}function b(t){a=t.clientX,t.clientY;const n=e.getBoundingClientRect();a-n.left<.25*n.width?y("arrow-left"):a-n.left<.75*n.width?y(""):y("arrow-right")}function y(t){r=t,window.tbwaThemeFollowCursorSelect&&window.tbwaThemeFollowCursorSelect(r,e,"small","black-white")}function E(){return performance.now()/1e3}function C(){return"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0}}const t=document.getElementsByClassName("wp-block-tbwa-blocks-carousel");for(var n=0;n<t.length;n++)e(t[n])}),!1);



(()=>{function e(e,t){return!e||""==t}document.addEventListener("DOMContentLoaded",(function(){const t=document.getElementById("mc-embedded-subscribe-form");t&&function(){let n=document.getElementById("mc-embedded-subscribe-form"),d=document.getElementById("NAME"),l=document.getElementById("EMAIL"),s=document.getElementById("email-message"),o=document.getElementById("COUNTRY"),c=document.getElementById("COMPANY"),a=document.getElementById("ABOUT"),i=document.getElementById("SUBSCRIBE"),u=document.getElementById("TERMS"),m=document.getElementById("downloadSubmit"),r="unsubscribed",b=document.getElementById("fileDownload"),E=b.innerHTML,y=document.getElementById("thanks-message");u.addEventListener("click",(function(){m.disabled=e(u.checked,l.value)})),l.addEventListener("keyup",(function(){m.disabled=e(u.checked,l.value)})),l.addEventListener("blur",(function(){let e=function(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)}(l.value);e||(s.innerHTML="Please use a valid email.",s.classList.add("error"))})),i.addEventListener("click",(function(){r=i.checked?"subscribed":"unsubscribed"})),t.addEventListener("submit",(function(e){e.preventDefault();const t={merge_fields:{NAME:d.value,COUNTRY:o.value,ABOUT:a.value,COMPANY:c.value,DOWNLOAD:"Yes"},full_name:d.value,email_address:l.value,status:r,type:"download",tags:[{name:E,status:"active"}]};fetch("/wp-json/mailchimp/v1/subscribe/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).then((e=>e.json())).then((e=>{console.log(e),b.click(),y.style.display="block",y.scrollIntoView({behavior:"smooth",block:"start"}),n.style.display="none"})).catch((e=>{console.error(e),alert("Submition failed. Please try again later.")}))}))}()}),!1)})();


