!function(){"use strict";let e=/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=|shorts\/)|youtu\.be\/)([^"&?/\s]{11})/i,t=t=>{var i;let o=t.match(e);return null!==(i=null==o?void 0:o[1])&&void 0!==i?i:void 0},i=({containerElement:e,backgroundElement:t},{speed:i=0,scale:o="100%",hoverEffect:l=!1,hoverEffectDuration:r})=>{var n;if(!e||!t)return;let s=/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,a=s?.5*i:i,d=window.innerHeight,h=!1,c=0,u=0,v=0,p=0,g=0,m=0,b=(e,i=!1)=>{let l=i?`translate3d(0, ${e}px, 0) scale(${o})`:`translate3d(0, ${e}px, 0)`;t.style.transform=l,t.style.webkitTransform=l},f=()=>{let i=t.getBoundingClientRect().height,o=e.getBoundingClientRect().height;g=i-o},y=()=>{let e=t.getBoundingClientRect();v=e.top,p=e.height;let i=-p,o=d;if(v<=i||v>=o){m=0;return}let l=(v-i)/(o-i)*100,r=Math.min(Math.max(l,0),100)/100*g-g/2;m=-(r*a*1)},w=r?`${null!==(n=parseFloat(`${r}`))&&void 0!==n?n:.5}s`:s?"300ms":"0.05s",S=()=>{Object.assign(t.style,{willChange:"transform",webkitBackfaceVisibility:"hidden",transformStyle:"preserve-3d",transition:s?`transform ${w} cubic-bezier(0, 0, 0, 1)`:`transform ${w} linear`})},k=()=>{Object.assign(t.style,{willChange:"",webkitBackfaceVisibility:"",transformStyle:"",transition:""})},E=null,P=()=>{E||(E=setTimeout(()=>{d=window.innerHeight,f(),E=null},100))};window.addEventListener("resize",P,{passive:!0}),f(),y();let x=new ResizeObserver(()=>{f()});x.observe(e);let $=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting?(h=!0,S(),c=requestAnimationFrame(A)):(h=!1,k(),cancelAnimationFrame(c))})},{threshold:0});$.observe(e),l&&(e.addEventListener("mouseenter",()=>b(m,!0),{passive:!0}),e.addEventListener("mouseleave",()=>b(m),{passive:!0}));let q=0,A=e=>{if(!h)return;let t=window.pageYOffset;if(e-q<16||u===t){c=requestAnimationFrame(A);return}q=e,u=t,y(),b(m),c=requestAnimationFrame(A)};return()=>{$.disconnect(),x.disconnect(),window.removeEventListener("resize",P),cancelAnimationFrame(c)}},o=(e,t,i)=>{var o,l,r,n,s,a;switch(t){case"tablet":return null!==(l=null!==(o=null==e?void 0:e.tablet)&&void 0!==o?o:null==e?void 0:e.desktop)&&void 0!==l?l:i;case"mobile":return null!==(s=null!==(n=null!==(r=null==e?void 0:e.mobile)&&void 0!==r?r:null==e?void 0:e.tablet)&&void 0!==n?n:null==e?void 0:e.desktop)&&void 0!==s?s:i;default:return null!==(a=null==e?void 0:e.desktop)&&void 0!==a?a:i}},l="1.04",r=(e,t)=>{var i,o,l,r,n,s,a;switch(e){case"desktop":if((null==t?void 0:null===(i=t.desktop)||void 0===i?void 0:i.type)==="video")return{device:"desktop",data:t.desktop};break;case"tablet":if((null==t?void 0:null===(o=t.tablet)||void 0===o?void 0:o.type)==="video")return{device:"tablet",data:t.tablet};if(!(null==t?void 0:t.tablet)&&(null==t?void 0:null===(l=t.desktop)||void 0===l?void 0:l.type)==="video")return{device:"desktop",data:t.desktop};break;case"mobile":if((null==t?void 0:null===(r=t.mobile)||void 0===r?void 0:r.type)==="video")return{device:"mobile",data:t.mobile};if(!(null==t?void 0:t.mobile)&&(null==t?void 0:null===(n=t.tablet)||void 0===n?void 0:n.type)==="video")return{device:"tablet",data:t.tablet};if(!(null==t?void 0:t.mobile)&&!(null==t?void 0:null===(s=t.tablet)||void 0===s?void 0:s.type)&&(null==t?void 0:null===(a=t.desktop)||void 0===a?void 0:a.type)==="video")return{device:"desktop",data:t.desktop}}},n=e=>e?String(e).includes("%")?`${e}`:`${e}%`:"100%",s=e=>{Object.assign(e.style,{position:"absolute",top:"0",left:"0",width:"100%",height:"100%"})},a=e=>{if(!e)return 0;let{width:t,height:i}=e.getBoundingClientRect();return t&&i?t/i:0},d={src:"https://www.youtube.com/iframe_api",loading:!1,loaded:!1,listeners:[],load:function(e){let t=this;if(this.listeners.push(e),this.loaded){setTimeout(function(){t.done()});return}if(this.loading)return;this.loading=!0,window.onYouTubeIframeAPIReady=function(){t.loaded=!0,t.done()};let i=document.createElement("script");i.type="text/javascript",i.src=this.src,document.body.appendChild(i)},done:function(){for(;this.listeners.length;)this.listeners.pop()(window.YT)}},h=e=>!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(e);function c(e,t){let i=e.getBoundingClientRect().top+window.pageYOffset,o=window.pageYOffset,l=i-o,r=null;requestAnimationFrame(function e(i){var n;null===r&&(r=i);let s=i-r,a=(n=s/(t/2))<1?l/2*n*n+o:-l/2*(--n*(n-2)-1)+o;window.scrollTo(0,a),s(e.startsWith("#el-")?e.replace("#el-","#"):e).substring(1),v=(e,t)=>{if(e){if(t){c(e,t);return}p(e)}},p=e=>{e&&e.scrollIntoView({behavior:"smooth"})},g=e=>{let t=document.documentElement;if(e){c(t,e);return}window.scrollTo({top:0,behavior:"smooth"})},m=({query:e,container:t})=>{let i=null;try{i=(t||document).querySelector(e||"")}catch(e){console.info("querySelector error",e)}return i},b=(e,t)=>{if(!e||!t)return 16/9;let i=o(e,t),l=null==i?void 0:i.videoCustomRatio;if((null==l?void 0:l.width)&&(null==l?void 0:l.height)){let e=Number(l.width),t=Number(l.height);if(e>0&&t>0)return e/t}return 16/9},f=e=>{switch(e){case"top":return{top:"0",transform:`translate(-50%, 0%) scale(${l})`};case"bottom":return{top:"100%",transform:`translate(-50%, -100%) scale(${l})`};default:return{top:"50%",transform:`translate(-50%, -50%) scale(${l})`}}},y=({iframeEl:e,containerRatio:t,videoObjectFit:i,background:r,currentDevice:n,isYoutubeVideoMigrated:s})=>{let a,d;let h=b(r,n),c=o(r,n);if(!e||!t)return;let u=(null==c?void 0:c.videoAlign)||"top",v=f(u);if("contain"===i){Object.assign(e.style,{position:"absolute",top:"50%",left:"50%",width:"100%",height:"100%",maxWidth:"none",transform:`translate(-50%, -50%) scale(${l})`});return}t>=h?(a=100,d=t/h*100):(d=100,a=h/t*100),Object.assign(e.style,{position:"absolute",top:v.top,left:"50%",width:s?"500%":`${a}%`,height:s?"100%":`${d}%`,maxWidth:"none",transform:v.transform})};function w(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}let S="article",k=()=>{window.removeEventListener("gp-global-loaded",k),customElements.get("gp-hero-banner")||customElements.define("gp-hero-banner",class extends GP.Component{redirectAnchor(e){var t;if(this.href&&!(null==e?void 0:null===(t=e.srcElement)||void 0===t?void 0:t.closest("a"))){let e=u(this.href),t=m({query:`[id='${e}']`}),i=m({query:`[data-gp-dialog-id='${e}']`});if((null==i?void 0:i.tagName)==="DIALOG"){let e=null==i?void 0:i.parentNode;e&&e.openModal()}if("scroll-to-top"===e&&g(),t&&v(t),"open-popup"===this.linkType||"scroll-to"===this.linkType)return;window.open(this.href,this.target)}}addAnchorLinkEventListener(){let e=this.querySelector('[data-hero-banner-link="true"]');e&&(e.removeEventListener("click",this.redirectAnchor.bind(this)),null==e||e.addEventListener("click",this.redirectAnchor.bind(this)))}init(){var t,o,l;let s=this.querySelector(".hero-banner-bg-parallax");s&&(this.isParallaxVer2=!0),this.enableParallax&&0!==this.speedParallax&&s&&i({containerElement:this,backgroundElement:s},{speed:this.speedParallax,hoverEffect:this.hoverEffect,scale:n(this.hoverEffectScale),hoverEffectDuration:this.hoverEffectDuration}),this.dataResponsive=r(this.device,this.background);let a=null===(t=r(this.device,this.background))||void 0===t?void 0:t.data,d=this.querySelector(`${this.bgQuery}`);a?this.setDataHtml5Source(a):null===(o=d.querySelector("video"))||void 0===o||o.classList.add("gp-hidden");let h=(null==a?void 0:a.type)==="video"&&(null==a?void 0:a.videoType)==="youtube"&&e.test((null==a?void 0:a.video)||"");h?this.createArticle():null===(l=d.querySelector(S))||void 0===l||l.remove(),this.updateSizeForContent(),this.addEventResize(),this.triggerEventPlay(),this.addEventSwitchTab(),this.addEventScroll(),this.isParallaxVer2||(this.handleParallaxScroll(),this.addStyleBackgroundImage(this.device))}setDataHtml5Source(e){var t;let i=this.querySelector(`${this.bgQuery}`);if((null==e?void 0:e.type)==="video"&&(null==e?void 0:e.videoType)==="html5"&&e.videoHtml5){let t=i.querySelector("video");t&&(t.removeAttribute("data-ll-status"),t.removeAttribute("data-src"),null==t||t.classList.remove("gp-hidden"),t.loop=!!e.loop,t.src=e.videoHtml5,t.load())}else null===(t=i.querySelector("video"))||void 0===t||t.classList.add("gp-hidden")}updateSizeForContent(){var e;let t=o(this.layout,this.device),i=o(this.contentPosition1Col,this.device),l=o(this.contentPosition2Col,this.device),r=1>=((null==t?void 0:null===(e=t.cols)||void 0===e?void 0:e.length)||1)?i:l;if("space-between"===r){let e=this.querySelector(".gp-hero-banner-row");e&&(e.style.height=`${this.clientHeight}px`)}}addEventResize(){window.addEventListener("resize",()=>{let t=this.getDevice();if(t!==this.device){var i,o;this.device=t,this.updateSizeForContent();let l=null===(i=r(t,this.background))||void 0===i?void 0:i.data,n=this.querySelector(`${this.bgQuery}`),s=this.querySelector(`${this.bgQuery} ${S}`);if(l?(s&&s.classList.add("gp-hidden"),this.setDataHtml5Source(l)):(null===(o=n.querySelector("video"))||void 0===o||o.classList.add("gp-hidden"),null==s||s.classList.add("gp-hidden")),l&&"video"===l.type&&"youtube"===l.videoType&&e.test(l.video||"")){if(s&&s.classList.remove("gp-hidden"),s){if(s.innerHTML="",this.dataResponsive=r(t,this.background),!this.dataResponsive)return;let e=this.getDataIframe();if(void 0===e)return;this.createIframe(s,e,!0)}else this.dataResponsive=r(t,this.background),this.createArticle()}else{let e=this.querySelector(`${this.bgQuery}`);this.articleSelector=e.querySelector(S),this.articleSelector&&this.articleSelector.classList.add("gp-hidden")}this.isParallaxVer2||this.addStyleBackgroundImage(t)}this.triggerEventPlay(),this.isParallaxVer2||this.handleParallaxScroll()})}addEventScroll(){window.addEventListener("scroll",()=>{this.triggerEventPlay(),this.isParallaxVer2||this.handleParallaxScroll()})}addEventSwitchTab(){window.addEventListener("visibilitychange",()=>{document.hidden||this.triggerEventPlay()})}triggerEventPlay(){var e,t,i;let o=null===(e=this.dataResponsive)||void 0===e?void 0:e.device,l=this.background[o];(null==l?void 0:l.video)&&(null==l?void 0:l.loop)&&this.iframeEl&&(null===(i=this.iframeEl)||void 0===i||null===(t=i.contentWindow)||void 0===t||t.postMessage(JSON.stringify({event:"command",func:"playVideo"}),"*"))}getDevice(){return window.innerWidth<768?"mobile":window.innerWidth>=768&&window.innerWidth<1025?"tablet":"desktop"}getVideoObjectFitByDevice(e){var t,i;return null!==(i=null!==(t=o(this.videoObjectFit,e))&&void 0!==t?t:o(this.videoObjectFit,"desktop"))&&void 0!==i?i:"cover"}setupResponsiveScaling(e){let t=()=>{let t=e.querySelector("iframe"),i=this.getVideoObjectFitByDevice(this.device);y({iframeEl:t,containerRatio:a(this),videoObjectFit:i,background:this.background,currentDevice:this.device,isYoutubeVideoMigrated:this.isYoutubeVideoMigrated})};t();let i=new ResizeObserver(()=>t());i.observe(this);let o=this.responsiveCleanup;this.responsiveCleanup=()=>{i.disconnect(),null==o||o()}}createArticle(){var e;null===(e=this.responsiveCleanup)||void 0===e||e.call(this);let t=this.getDataIframe();if(void 0===t)return;let i=this.querySelector(`${this.bgQuery} .gp-hero-banner-image-background`);if(this.articleSelector=i.querySelector(S),this.articleSelector){let e=this.articleSelector.querySelector("iframe");this.createIframe(this.articleSelector,t,!e)}else this.articleSelector=document.createElement(S),this.articleSelector.style.cssText=` pointer-events: none; height: 100%; width: 100%; overflow: hidden; max-width: none !important; position: relative; `,this.createIframe(this.articleSelector,t,!0),i.appendChild(this.articleSelector)}createIframe(e,t,i){var o;let l=null===(o=this.articleSelector)||void 0===o?void 0:o.querySelector("iframe");if(t.isLoop){!i&&l&&l.remove();let{videoId:o}=t,r=this.createWrapperDiv();e.append(r);let n=`player-wrapper-${this.uid}`;r.append(this.createPlayerWrapper(n)),null==d||d.load(()=>{new YT.Player(n,{videoId:o,host:"https://www.youtube-nocookie.com",playerVars:{autoplay:1,state:1,controls:0,mute:1,enablejsapi:1,playlist:o,showinfo:0,rel:0,fs:0},events:{onReady:e=>{e.target.playVideo(),this.videoDuration=Math.floor(e.target.getDuration()),setTimeout(()=>{this.setupResponsiveScaling(r)},50)},onStateChange:e=>{let t=e.target;this.isVideoStarted||(t.playVideo(),this.isVideoStarted=!0,this.runVideo(e)),0===e.data&&(this.videoDuration=t.getCurrentTime(),t.playVideo(),this.runVideo(e))}}})});let s=()=>{let e=r.querySelector("iframe");e?(this.iframeEl=e,this.setupResponsiveScaling(r)):requestAnimationFrame(s)};s(),window.onbeforeunload=()=>{clearInterval(this.intervalTracker)}}else{if(!i&&l){this.iframeEl=l,this.setupResponsiveScaling(e);return}let o=document.createElement("div");o.className="gp-absolute gp-left-0 gp-top-0 gp-h-full gp-w-full";let r=document.createElement("iframe");r.allowFullscreen=!0,r.allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture",r.frameBorder="0",r.src=t.iframeSrc,r.style.cssText=` position: absolute; inset: 0; background: #000; max-width: none !important; `,this.iframeEl=r,o.append(r),e.append(o),this.setupResponsiveScaling(e)}}runVideo(e){let t=e.target;if(this.videoDuration>0){let e=parseFloat((this.videoDuration/100*5).toFixed(2));clearInterval(this.intervalTracker),this.intervalTracker=setInterval(()=>{let i=parseFloat(t.getCurrentTime().toFixed(2)),o=parseFloat((this.videoDuration-i).toFixed(2));o<=1.5*e&&t.seekTo(0)},1e3*e)}}createWrapperDiv(){let e=document.createElement("div");return s(e),e}createPlayerWrapper(e){let t=document.createElement("div");return t.id=e,s(t),t.style.backgroundColor="black",t}getDataIframe(){var i,o;let l=null===(i=this.dataResponsive)||void 0===i?void 0:i.device,r=this.background[l],n=null!==(o=null==r?void 0:r.video)&&void 0!==o?o:"",s=t(n);if(!e.test(n)||!s)return;let a=`https://www.youtube-nocookie.com/embed/${s}?autoplay=1&state=1&mute=1&loop=${(null==r?void 0:r.loop)?1:0}&playlist=${s}&controls=0&enablejsapi=1`;return{iframeSrc:a,videoId:s,isLoop:(null==r?void 0:r.loop)?1:0}}addStyleBackgroundImage(e){var t,i;let o=this.querySelector(`${this.bgQuery}`);h(navigator.userAgent)&&(null===(t=this.background[e])||void 0===t?void 0:t.type)!=="video"&&(null===(i=this.background[e])||void 0===i?void 0:i.attachment)==="fixed"?o.style.setProperty("-webkit-transform","translate3d(0,0,0)"):o.style.removeProperty("-webkit-transform")}handleParallaxScroll(){var e,t,i,o,l,r,n;let s=this.querySelector(`${this.bgQuery}`);this.scrollAmount=window.innerHeight-this.clientHeight;let a=this.getBoundingClientRect().y;window.innerHeight>a?this.scrollAmount=window.innerHeight-a:this.scrollAmount=0,s&&0!==this.speedParallax&&(s.style.backgroundAttachment=(null===(e=this.background[this.device])||void 0===e?void 0:e.type)==="image"&&this.enableParallax?"fixed":(null===(t=this.background[this.device])||void 0===t?void 0:t.attachment)||"scroll",s.style.backgroundPosition=(null===(i=this.background[this.device])||void 0===i?void 0:i.type)==="image"&&this.enableParallax?`center ${(window.innerHeight-this.scrollAmount)*(1-this.speedParallax)}px `:`${null===(l=this.background[this.device])||void 0===l?void 0:null===(o=l.position)||void 0===o?void 0:o.x}% ${null===(n=this.background[this.device])||void 0===n?void 0:null===(r=n.position)||void 0===r?void 0:r.y}%`)}constructor(){var e,t;super(),w(this,"uid",void 0),w(this,"bgQuery",void 0),w(this,"background",void 0),w(this,"device","desktop"),w(this,"articleSelector",null),w(this,"dataResponsive",void 0),w(this,"iframeEl",void 0),w(this,"enableParallax",!1),w(this,"speedParallax",0),w(this,"scrollAmount",0),w(this,"intervalTracker",void 0),w(this,"isVideoStarted",!1),w(this,"videoDuration",0),w(this,"hoverEffect",!1),w(this,"hoverEffectScale","100%"),w(this,"hoverEffectDuration",void 0),w(this,"isParallaxVer2",!1),w(this,"layout",void 0),w(this,"contentPosition2Col",void 0),w(this,"contentPosition1Col",void 0),w(this,"sizeSetting",void 0),w(this,"videoObjectFit",void 0),w(this,"responsiveCleanup",void 0),w(this,"href",void 0),w(this,"target",void 0),w(this,"linkType",void 0),w(this,"isYoutubeVideoMigrated",!1),w(this,"initEventLazyload",()=>{this.init()}),this.uid=this.getState("uid"),this.bgQuery=`[data-id="${this.uid}"] .gp-hero-banner-bg`,this.background=this.getState("background"),this.speedParallax=this.getState("speedParallax"),this.device=this.getDevice(),this.enableParallax=this.getState("enableParallax"),this.hoverEffect=this.getState("hoverEffect"),this.hoverEffectScale=this.getState("hoverEffectScale"),this.hoverEffectDuration=this.getState("hoverEffectDuration"),this.layout=this.getState("layout"),this.contentPosition1Col=this.getState("contentPosition1Col"),this.contentPosition2Col=this.getState("contentPosition2Col"),this.sizeSetting=this.getState("sizeSetting"),this.videoObjectFit=this.getState("videoObjectFit"),this.isYoutubeVideoMigrated=this.getState("isYoutubeVideoMigrated"),this.init(),this.href=null!==(t=null!==(e=this.getAttribute("gp-href"))&&void 0!==e?e:this.getState("href"))&&void 0!==t?t:"",this.target=this.getState("target"),this.linkType=this.getState("linkType"),this.addAnchorLinkEventListener()}})};"completed"===window.gpReadyState?k():window.addEventListener("gp-global-loaded",k)}();