1var p=Object.defineProperty;var g=(s,e,t)=>e in s?p(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var r=(s,e,t)=>g(s,typeof e!="symbol"?e+"":e,t);import{C as f}from"./content-helper-Bc6KOjDh.js";import{i as S}from"./slider-helper-fI-hXIWE.js";const u=1e3,_=5e3,n=class n{constructor(e){r(this,"_slider");r(this,"_dots");r(this,"_isPaused");r(this,"_container");r(this,"_parent");r(this,"_pages");var t;this._container=e,this._slider=S(this._container,n._sliderSettings),this._parent=this._container.closest("[data-slider-parent]"),this._pages=[...((t=this._parent)==null?void 0:t.querySelectorAll("[data-slider-pager]"))??[]],this._dots=this._pages.map(i=>{var c;const o=i.querySelector("progress");if(!o)return null;const a=parseInt(i.getAttribute("data-index")??""),d=((c=this._parent)==null?void 0:c.querySelector(`[data-slider-video="${a}"]`))??null,h=new I(a,this.getDefaultAutoplayDuration(),i,o,this,d);return h.init(),h}).filter(i=>!!i),this._isPaused=!1}init(){this.handleTops(),this.handleArrows(),this.handleDotsStart()}onScroll(){const e=this._isPaused;f.isElementInViewport(this._container)?this._isPaused=!1:this._isPaused=!0,e!==this._isPaused&&this.handleDots(t=>{t.resumeAnimation(),this._isPaused?t.pauseVideo():t.playVideo()})}getCurrentSliderIndex(){const e=this._slider.getInfo();return e.slideCount===e.slideCountNew?e.index:e.index-1}getSpeed(){return u}getDefaultAutoplayDuration(){return _}handleDotsStart(){this.handleDots(e=>{e.cancelAnimation(),e.startAnimation()},e=>{e.cancelAnimation()})}handleDots(e,t){this._dots.forEach(i=>{i._index===this.getCurrentSliderIndex()?e&&e(i):t&&t(i)})}handleArrows(){const e=this._container.querySelectorAll("[data-controls=prev]"),t=this._container.querySelectorAll("[data-controls=next]");e.forEach(i=>this.handleArrowControl(i)),t.forEach(i=>this.handleArrowControl(i))}handleArrowControl(e){e.addEventListener("click",()=>{const t=e.getAttribute("data-controls");this._slider.goTo(t)})}handleTops(){document.querySelectorAll(".topImage.topImage--hasParallax").forEach(t=>{const i=t.offsetTop,o=t.offsetHeight,a=t.querySelector("img");a&&(a.style.height=`${o+i}px`)})}};r(n,"_sliderSettings",{items:1,speed:u,autoHeight:!0,autoplayTimeout:_,mouseDrag:!0,loop:!0,rewind:!0,controls:!1,nav:!1,autoplay:!1});let l=n;class I{constructor(e,t,i,o,a,d){r(this,"_index");r(this,"_duration");r(this,"_dot");r(this,"_progressBar");r(this,"_topImageSlider");r(this,"_animationFrameId");r(this,"_startTime");r(this,"_elapsedTime");r(this,"_video");this._index=e,this._duration=t,this._dot=i,this._progressBar=o,this._topImageSlider=a,this._animationFrameId=0,this._startTime=0,this._elapsedTime=0,this._video=d}init(){this.setVideoDuration(),this.bindListeners(),this._index===this._topImageSlider.getCurrentSliderIndex()&&this.playVideo(),this._topImageSlider._slider.events.on("indexChanged",()=>{this._index===this._topImageSlider.getCurrentSliderIndex()?this.playVideo():setTimeout(()=>{this.stopVideo(),this.playVideo()},this._topImageSlider.getSpeed()),this._topImageSlider.handleDotsStart()})}startAnimation(){this._startTime=Date.now(),this.animation()}resumeAnimation(){this._startTime=Date.now()-this._elapsedTime,this.animation()}cancelAnimation(){this._progressBar.value=0,this._animationFrameId&&cancelAnimationFrame(this._animationFrameId),this._dot.classList.remove("tns-active"),this._startTime=0,this._elapsedTime=0}playVideo(){this._video&&this._video.play()}pauseVideo(){this._video&&this._video.pause()}stopVideo(){this._video&&(this._video.pause(),this._video.currentTime=0)}bindListeners(){this._dot.addEventListener("click",()=>{this._topImageSlider._slider.goTo(this._index)})}animation(){this._dot.classList.add("tns-active");const e=()=>{if(this._topImageSlider._isPaused)return;const t=Date.now();this._elapsedTime=t-this._startTime;const i=this._elapsedTime/this._duration*100;if(i<this._progressBar.max)this._progressBar.value=i,this._animationFrameId=requestAnimationFrame(e);else{this._progressBar.value=this._progressBar.max;const o=this._topImageSlider.getCurrentSliderIndex()===this._topImageSlider._dots.length-1;this._topImageSlider._slider.goTo(o?0:"next")}};this._animationFrameId=requestAnimationFrame(e)}setVideoDuration(){if(!this._video)return;const e=!isNaN(this._video.duration)&&this._video.duration!==1/0;this._duration=e?this._video.duration*1e3:this._topImageSlider.getDefaultAutoplayDuration()}}
1const T=[...document.querySelectorAll("[data-slider-init='topImage']")],m=T.map(s=>new l(s));function A(){document.querySelectorAll('[data-top-image="video"]').forEach(e=>{y(e)})}function v(){const s=document.querySelector("[data-top-image-wrapper]");if(!s)return;const e=document.querySelector("[data-breadcrumbs=source]");if(!e)return;const t=s.querySelectorAll("[data-breadcrumbs=target]");e.classList.add("d-none"),t.forEach(i=>i.innerHTML=e.innerHTML)}function y(s){const e=s.play();e!==void 0&&e.then(t=>{}).catch(t=>{})}const E={onLoad:()=>{v(),A(),m.forEach(s=>{s.init()})},onScroll(){m.forEach(s=>{s.onScroll()})}};export{E as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.