!function(){"use strict";const e=e=>{if(e.dataset.msqtCarouselReady)return;e.dataset.msqtCarouselReady="1";let t=e.querySelector(":scope > .msqt-carousel-track");if(!t){for(t=document.createElement("div"),t.className="msqt-carousel-track";e.firstChild;)t.appendChild(e.firstChild);e.appendChild(t)}const n=e.querySelector(".timeline-controls"),i=n?n.querySelector(".timeline-control--prev"):null,o=n?n.querySelector(".timeline-control--next"):null,r=n?n.querySelector(".timeline-pagination"):null,s=e,a=window.matchMedia?window.matchMedia("(max-width: 720px)"):null,l=()=>a?a.matches:window.innerWidth<=720;let c=[],d=0,u=null,m=null,f=Array.from(t.children);const h=()=>f;let g=window.pageYOffset||window.scrollY||0;const v=e=>{m=e||null,u||(u=window.requestAnimationFrame(()=>{u=null,(()=>{if(!n)return;if(!l())return s.classList.remove("has-floating-controls"),n.classList.remove("timeline-controls--sticky-bottom"),void s.style.removeProperty("--timeline-controls-offset");const e=window.innerHeight||document.documentElement.clientHeight||0,t=s.getBoundingClientRect();if(!(e>0&&t.bottom>0&&t.top<e))return s.classList.remove("has-floating-controls"),n.classList.remove("timeline-controls--sticky-bottom"),void s.style.removeProperty("--timeline-controls-offset");if((t.height||0)<=0)return s.classList.remove("has-floating-controls"),n.classList.remove("timeline-controls--sticky-bottom"),void s.style.removeProperty("--timeline-controls-offset");const i=2/3*e,o=e-((n.getBoundingClientRect().height||0)+12),r=t.top<=i,a=t.bottom>=o;if(r&&a)return s.classList.add("has-floating-controls"),n.classList.add("timeline-controls--sticky-bottom"),void s.style.removeProperty("--timeline-controls-offset");s.classList.remove("has-floating-controls"),n.classList.remove("timeline-controls--sticky-bottom"),s.style.removeProperty("--timeline-controls-offset")})(),m=null}))};a&&"function"==typeof a.addEventListener&&a.addEventListener("change",()=>{v(h()[d]||null)});const p=e=>{const t=h();if(!t.length)return;const n=d>=0&&d<t.length?t[d]:null,r=n?.dataset.eventYear||null,s=Math.max(0,Math.min(t.length-1,e)),a=t[s];if(!a)return;d=s;const u=0===s,m=s===t.length-1;t.forEach(e=>e.classList.remove("is-active","is-at-start")),a.classList.add("is-active"),u&&a.classList.add("is-at-start");const f=a.dataset.eventYear||null,g=!l();t.forEach(e=>{const t="1"===e.dataset.eventYearDuplicate,i=g&&t&&!(e===a)&&!(n&&e===n&&r&&f&&r!==f);e.classList.toggle("is-duplicate-year-hidden",i)}),i&&(i.disabled=u,i.setAttribute("aria-disabled",String(u))),o&&(o.disabled=m,o.setAttribute("aria-disabled",String(m))),c.length&&c.forEach((e,t)=>{const n=t===d;e.classList.toggle("is-active",n),e.setAttribute("aria-selected",String(n)),e.tabIndex=n?0:-1}),H||v(a)},w=()=>{const{scrollLeft:e}=t,n=h();if(!n.length)return i&&(i.disabled=!0,i.setAttribute("aria-disabled","true")),o&&(o.disabled=!0,o.setAttribute("aria-disabled","true")),void c.forEach(e=>{e.classList.remove("is-active"),e.setAttribute("aria-selected","false"),e.tabIndex=-1});let r=n[0],s=Math.abs(n[0].offsetLeft-e);for(let t=1;t<n.length;t+=1){const i=n[t],o=Math.abs(i.offsetLeft-e);o<s&&(s=o,r=i)}d=n.indexOf(r),p(d)},y=Array.from(t.querySelectorAll(".timeline-event-card[data-event-id]")),L=new Map;y.forEach(e=>{const t=e.getAttribute("data-event-id");t&&L.set(t,e)});const b=e.querySelector(".timeline-images-layer"),E=b?Array.from(b.querySelectorAll(".timeline-image-item[data-event-id]")):[],A=b?Array.from(b.querySelectorAll(".timeline-image-inner .timeline-figure")):[];let M=null,x=null,q=!1;const S=new Map,k=()=>{E.length&&L.size&&(E.forEach(e=>{const t=e.getAttribute("data-event-id");if(!t||!L.has(t))return;const n=(e.querySelector(".timeline-image-inner")||e).getBoundingClientRect().width||0;if(n<=0)return;const i=L.get(t);if(i){const e=Math.ceil(n+16);i.style.setProperty("--timeline-image-column-width",e+"px")}}),w())},C=()=>{window.requestAnimationFrame(k)};C(),E.length&&E.forEach(e=>{e.querySelectorAll("img").forEach(e=>{e.complete||e.addEventListener("load",()=>{C(),j()},{once:!0})})}),window.addEventListener("resize",C);const R=(e,t,n)=>e+(t-e)*n,Y=()=>{if(q=!1,!A.length)return;const e=null!==M&&null!==x&&!l()&&"number"==typeof window.innerHeight,t=s.getBoundingClientRect(),n=window.innerHeight||document.documentElement.clientHeight||0;let i=!1;A.forEach(o=>{const r=S.get(o)||{x:0,y:0};let s=0,a=0;if(e){const e=o.getBoundingClientRect();if(n>0&&e.bottom>0&&e.top<n){const n=e.left-t.left+e.width/2,i=e.top-t.top+e.height/2,o=M-n,r=x-i;if(Math.abs(o)<=300){const e=Math.hypot(o,r);if(e>0&&e<=300){const t=.3333333333333333*(1-e/300);s=o*t,a=r*t}}}}const l=R(r.x,s,.25),c=R(r.y,a,.25);(Math.abs(l)>.5||Math.abs(c)>.5)&&(i=!0),S.set(o,{x:l,y:c}),o.style.transform=`scale3d(var(--scale), var(--scale), var(--scale)) translate3d(${l.toFixed(2)}px, ${c.toFixed(2)}px, 0)`}),e||!i||q||(q=!0,window.requestAnimationFrame(Y))};s.addEventListener("pointermove",e=>{if(l()||!A.length)return;const t=s.getBoundingClientRect();M=e.clientX-t.left,x=e.clientY-t.top,q||(q=!0,window.requestAnimationFrame(Y))}),s.addEventListener("pointerleave",()=>{E.length&&(M=null,x=null,q||(q=!0,window.requestAnimationFrame(Y)))});const B=(e,n="pagination")=>{const i=h()[e];if(!i)return;const o=(()=>{const e=getComputedStyle(t),n=parseFloat(e.paddingLeft||e.paddingInlineStart||"0");return Number.isFinite(n)?n:0})();var r;null!==(r=i.offsetLeft-o)&&"number"==typeof r&&t.scrollTo({left:r,behavior:"smooth"}),p(e),(e=>{if(!e||!l())return;const t=e.getBoundingClientRect(),n=window.pageYOffset+t.top-16,i=Math.max(0,n);Math.abs(window.pageYOffset-i)<4||window.scrollTo({top:i,behavior:"smooth"})})(i)},D=(e,t)=>{const n=h();if(!n.length)return;const i=Math.max(0,Math.min(n.length-1,d+e));B(i,t)},F=()=>{D(-1,"chevron-prev")},$=()=>{D(1,"chevron-next")};i&&i.addEventListener("click",F),o&&o.addEventListener("click",$);let H=!1,O=0,P=0,T=0,z=0,X=null;const W=e=>{if("mousedown"===e.type&&0!==e.button)return;const n=Boolean(e.touches&&e.touches[0]),i=e.pageX||(n?e.touches[0].pageX:0)||0,o=e.pageY||(n?e.touches[0].pageY:0)||0;H=!0,O=i,P=o,T=t.scrollLeft,z=d,X=null,n||t.classList.add("is-dragging")},I=e=>{if(!H)return;const n=Boolean(e.touches&&e.touches[0]),i=e.pageX||(n?e.touches[0].pageX:0)||0,o=e.pageY||(n?e.touches[0].pageY:0)||0,r=i-O,s=o-P,a=Math.abs(r),l=Math.abs(s);if(n){if(null===X){const e=8;if(a<e&&l<e)return;if(!(a>1.5*l))return X="vertical",void(H=!1);X="horizontal",t.classList.add("is-dragging")}if("vertical"===X)return;return e.preventDefault(),void(t.scrollLeft=T-r)}t.scrollLeft=T-r,e.preventDefault()},N=()=>{if(!H)return;H=!1,t.classList.remove("is-dragging");const e="horizontal"===X||null===X;X=null,e&&(()=>{const e=h();if(!e.length)return;const n=t.scrollLeft-T,i=Math.abs(n);if(i<10)return;const o=Math.max(0,Math.min(e.length-1,z)),r=e[o];if(!r)return;const s=n>0?1:n<0?-1:0;if(0===s)return p(o),void B(o,"snap-no-direction");const a=Math.max(0,Math.min(e.length-1,o+s)),l=e[a];let c=r.offsetWidth||0;if(l&&l!==r){const e=r.offsetLeft,t=l.offsetLeft;c=Math.abs(t-e)||c}if(c<=0)return p(o),void B(o,"snap-fallback");B(i>=.3*c?a:o,"snap-threshold")})()};t.addEventListener("mousedown",W),t.addEventListener("mousemove",I),window.addEventListener("mouseup",N),t.addEventListener("touchstart",W,{passive:!0}),t.addEventListener("touchmove",I,{passive:!1}),window.addEventListener("touchend",N),t.addEventListener("keydown",e=>{e.target===t&&("ArrowRight"===e.key||"ArrowDown"===e.key?(e.preventDefault(),$()):"ArrowLeft"!==e.key&&"ArrowUp"!==e.key||(e.preventDefault(),F()))}),f=Array.from(t.children),(()=>{if(!r)return;r.innerHTML="",c=[];const e=h();e.forEach((t,n)=>{const i=document.createElement("button");i.type="button",i.className="timeline-pagination__dot",i.setAttribute("data-slide-index",String(n)),i.setAttribute("role","tab");const o=t.querySelector(".event-year"),s=o?o.textContent?.trim():"",a=s?`${s} (${n+1}/${e.length})`:`${n+1}/${e.length}`;i.setAttribute("aria-label",a),i.addEventListener("click",()=>{B(n,"dot-click")}),i.addEventListener("keydown",t=>{if("ArrowRight"===t.key||"ArrowDown"===t.key){t.preventDefault();const i=Math.min(e.length-1,n+1);c[i]?.focus(),B(i,"dot-keyboard")}else if("ArrowLeft"===t.key||"ArrowUp"===t.key){t.preventDefault();const e=Math.max(0,n-1);c[e]?.focus(),B(e,"dot-keyboard")}}),r.appendChild(i),c.push(i)})})(),t.addEventListener("scroll",()=>{w()},{passive:!0}),w(),v(h()[d]||null);const U=Array.from(t.children);U.forEach(e=>{e.addEventListener("mouseenter",()=>{U.forEach(t=>{t.classList.remove("is-hovered","is-dimmed"),t!==e&&t.classList.add("is-dimmed")}),e.classList.add("is-hovered")}),e.addEventListener("mouseleave",()=>{e.classList.remove("is-hovered"),U.forEach(e=>e.classList.remove("is-dimmed"))})});let _=!1;const j=()=>{_||(_=!0,window.requestAnimationFrame(()=>{_=!1,(()=>{const n=window.innerHeight||document.documentElement.clientHeight,i=window.innerWidth||document.documentElement.clientWidth,o=n/2,r=i/2,s=e,a=s.querySelector(".timeline-images-layer"),l=s.querySelector(".timeline-controls");if(!a)return;const c=s.getBoundingClientRect(),d=Array.from(t.querySelectorAll(".timeline-event-card[data-event-id]")),u=Array.from(a.querySelectorAll(".timeline-image-item[data-event-id]"));if(!d.length||!u.length)return;const m=new Map;u.forEach(e=>{const t=e.getAttribute("data-event-id");t&&m.set(t,e)}),d.forEach(e=>{const t=e.getAttribute("data-event-id");if(!t||!m.has(t))return;const n=m.get(t),i=e.getBoundingClientRect(),s=i.left+i.width/2,a=i.top+i.height/2;let d=0,u=0;r>0&&(d=(s-r)/r),o>0&&(u=(a-o)/o),d=Math.max(-1,Math.min(1,d)),u=Math.max(-1,Math.min(1,u));const f=80*-u,h=n.getBoundingClientRect(),g=h.height||0,v=h.width||0,p=i.right-c.left-v;let w=c.top+c.height/2-c.top-g/2+f+(n.classList.contains("has-2-images")?40:-40);if(l){const e=l.getBoundingClientRect().top-c.top-g+10;w=Math.min(w,e)}n.style.transform=`translate3d(calc(${p}px + var(--timeline-pointer-offset-x, 0px)), calc(${w}px + var(--timeline-pointer-offset-y, 0px)), 0)`})})()}))};let G;t.addEventListener("scroll",j,{passive:!0}),window.addEventListener("scroll",j,{passive:!0}),window.addEventListener("scroll",()=>{const e=window.pageYOffset||window.scrollY||0;Math.abs(e-g)<8||(g=e,v(h()[d]||null))},{passive:!0}),window.addEventListener("resize",()=>{clearTimeout(G),G=setTimeout(()=>{w(),v(h()[d]||null),j()},150)},{passive:!0}),window.addEventListener("load",()=>{setTimeout(()=>{j(),(()=>{const t=e.querySelector(".timeline-container");t&&t.classList.add("is-ready")})()},250)},{once:!0})},t=()=>{((e,t=document)=>Array.from(t.querySelectorAll(e)))('[data-msqt-carousel="1"]').forEach(e)};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",t):t()}();