@20minutes/hela
Advanced tools
Comparing version 1.8.4 to 1.8.5
var D = Object.defineProperty; | ||
var W = (e, t, o) => t in e ? D(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o; | ||
var b = (e, t, o) => (W(e, typeof t != "symbol" ? t + "" : t, o), o); | ||
const j = new IntersectionObserver(([e]) => { | ||
const t = document.querySelector(".c-close-article-btn"); | ||
t && (t.style.visibility = e.isIntersecting || e.boundingClientRect.top < 0 ? "hidden" : "visible"); | ||
}), F = () => { | ||
const j = () => { | ||
const e = document.querySelector(".js-limit-scroll-close-article-btn"); | ||
e && j.observe(e); | ||
}, O = (e) => { | ||
e && new IntersectionObserver(([o]) => { | ||
const n = document.querySelector(".c-close-article-btn"); | ||
n && (n.style.visibility = o.isIntersecting || o.boundingClientRect.top < 0 ? "hidden" : "visible"); | ||
}).observe(e); | ||
}, F = (e) => { | ||
e.stopImmediatePropagation(), e.preventDefault(); | ||
@@ -19,3 +19,3 @@ const t = e.currentTarget; | ||
} | ||
}, N = (e = document.querySelector( | ||
}, O = (e = document.querySelector( | ||
".js-collapse__button" | ||
@@ -25,6 +25,6 @@ )) => { | ||
o.addEventListener("click", (n) => { | ||
O(n); | ||
F(n); | ||
}); | ||
}); | ||
}, B = (e, t) => { | ||
}, N = (e, t) => { | ||
const o = document.querySelector( | ||
@@ -50,3 +50,3 @@ `#${t}` | ||
} | ||
}, K = (e) => { | ||
}, B = (e) => { | ||
var n; | ||
@@ -58,3 +58,3 @@ e.setAttribute("aria-expanded", "true"); | ||
o instanceof HTMLSpanElement && (o.innerHTML = "Voir moins"); | ||
}, P = (e) => { | ||
}, K = (e) => { | ||
var n; | ||
@@ -65,9 +65,9 @@ const t = (n = e.parentNode) == null ? void 0 : n.querySelectorAll(".js-expand-target"); | ||
o instanceof HTMLSpanElement && (o.innerHTML = "Voir plus"); | ||
}, z = (e) => { | ||
}, P = (e) => { | ||
const t = e.currentTarget; | ||
return e.preventDefault(), t instanceof HTMLButtonElement ? t.getAttribute("aria-expanded") === "true" ? P(t) : K(t) : null; | ||
}, V = (e = document.querySelector( | ||
return e.preventDefault(), t instanceof HTMLButtonElement ? t.getAttribute("aria-expanded") === "true" ? K(t) : B(t) : null; | ||
}, z = (e = document.querySelector( | ||
".js-expand-button" | ||
)) => { | ||
e && document.querySelectorAll(".js-expand-button").forEach((o) => o.addEventListener("click", z)); | ||
e && document.querySelectorAll(".js-expand-button").forEach((o) => o.addEventListener("click", P)); | ||
}, c = { | ||
@@ -78,3 +78,3 @@ inert: ":not([inert]):not([inert] *)", | ||
}; | ||
var Y = [ | ||
var V = [ | ||
`a[href]${c.inert}${c.negTabIndex}`, | ||
@@ -100,3 +100,3 @@ `area[href]${c.inert}${c.negTabIndex}`, | ||
} | ||
function G(e) { | ||
function Y(e) { | ||
const t = g(e, !0), o = t ? g(e, !1) || t : null; | ||
@@ -108,3 +108,3 @@ return [t, o]; | ||
return e; | ||
if (J(e)) | ||
if (X(e)) | ||
if (e.shadowRoot) { | ||
@@ -145,7 +145,7 @@ let o = _(e.shadowRoot, t); | ||
} | ||
const X = (e) => e.matches("details:not([open]) *") && !e.matches("details>summary:first-of-type") ? !0 : !(e.offsetWidth || e.offsetHeight || e.getClientRects().length), x = (e) => { | ||
const G = (e) => e.matches("details:not([open]) *") && !e.matches("details>summary:first-of-type") ? !0 : !(e.offsetWidth || e.offsetHeight || e.getClientRects().length), x = (e) => { | ||
var t; | ||
return (t = e.shadowRoot) != null && t.delegatesFocus ? !1 : e.matches(Y.join(",")) && !X(e); | ||
return (t = e.shadowRoot) != null && t.delegatesFocus ? !1 : e.matches(V.join(",")) && !G(e); | ||
}; | ||
function J(e) { | ||
function X(e) { | ||
return e.shadowRoot && e.getAttribute("tabindex") === "-1" ? !1 : !e.matches(":disabled,[hidden],[inert]"); | ||
@@ -157,4 +157,4 @@ } | ||
} | ||
function Q(e, t) { | ||
const [o, n] = G(e); | ||
function J(e, t) { | ||
const [o, n] = Y(e); | ||
if (!o) | ||
@@ -241,3 +241,3 @@ return t.preventDefault(); | ||
} | ||
t.key === "Escape" && this.$el.getAttribute("role") !== "alertdialog" && !o && (t.preventDefault(), this.hide(t)), t.key === "Tab" && Q(this.$el, t); | ||
t.key === "Escape" && this.$el.getAttribute("role") !== "alertdialog" && !o && (t.preventDefault(), this.hide(t)), t.key === "Tab" && J(this.$el, t); | ||
} | ||
@@ -259,3 +259,3 @@ /** | ||
typeof document < "u" && (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", A) : A()); | ||
const U = () => document.querySelectorAll(".js-modal").forEach((e) => { | ||
const Q = () => document.querySelectorAll(".js-modal").forEach((e) => { | ||
if (!(e instanceof HTMLElement)) | ||
@@ -272,7 +272,7 @@ return; | ||
}); | ||
}), Z = ({ navigatedList: e, nextBtn: t, prevBtn: o }) => { | ||
}), U = ({ navigatedList: e, nextBtn: t, prevBtn: o }) => { | ||
var r, a, i, l, d, u, f, m; | ||
const n = e.scrollLeft > 0, s = e.scrollLeft + e.clientWidth < e.scrollWidth; | ||
n && s ? ((r = t.classList) == null || r.add("o-nav-button--visible"), (a = o.classList) == null || a.add("o-nav-button--visible")) : n ? ((i = t.classList) == null || i.remove("o-nav-button--visible"), (l = o.classList) == null || l.add("o-nav-button--visible")) : s ? ((d = t.classList) == null || d.add("o-nav-button--visible"), (u = o.classList) == null || u.remove("o-nav-button--visible")) : ((f = t.classList) == null || f.remove("o-nav-button--visible"), (m = o.classList) == null || m.remove("o-nav-button--visible")); | ||
}, ee = ({ | ||
}, Z = ({ | ||
navigatedList: e, | ||
@@ -322,3 +322,3 @@ nextBtn: t, | ||
} | ||
}, te = ({ | ||
}, ee = ({ | ||
navigatedList: e, | ||
@@ -364,4 +364,4 @@ nextBtn: t, | ||
} | ||
}, oe = ({ navigatedList: e, nextBtn: t, prevBtn: o }) => { | ||
Z({ | ||
}, te = ({ navigatedList: e, nextBtn: t, prevBtn: o }) => { | ||
U({ | ||
navigatedList: e, | ||
@@ -371,3 +371,3 @@ nextBtn: t, | ||
}); | ||
}, ne = () => { | ||
}, oe = () => { | ||
const e = document.querySelectorAll(".js-navigation-container"); | ||
@@ -386,3 +386,3 @@ for (const t of Array.from(e)) { | ||
"click", | ||
ee.bind(!1, { | ||
Z.bind(!1, { | ||
navigatedList: d, | ||
@@ -395,3 +395,3 @@ nextBtn: u, | ||
"click", | ||
te.bind(!1, { | ||
ee.bind(!1, { | ||
navigatedList: d, | ||
@@ -421,3 +421,3 @@ nextBtn: u, | ||
} | ||
}, se = () => { | ||
}, ne = () => { | ||
const e = document.querySelectorAll(".js-navigation-container"); | ||
@@ -435,3 +435,3 @@ for (const t of Array.from(e)) | ||
"resize", | ||
oe.bind(!1, { | ||
te.bind(!1, { | ||
navigatedList: o, | ||
@@ -443,3 +443,3 @@ nextBtn: n, | ||
} | ||
}, ie = () => { | ||
}, se = () => { | ||
const e = document.querySelector(".js-limit-scroll-progress-bar"), t = document.querySelector(".c-progress__bar"); | ||
@@ -456,7 +456,7 @@ if (!t) | ||
t.style.width = `${r}%`, r >= 100 && (t.style.width = "100%"); | ||
}, re = () => { | ||
document.querySelector(".c-progress") && window.addEventListener("scroll", ie); | ||
}, ie = () => { | ||
document.querySelector(".c-progress") && window.addEventListener("scroll", se); | ||
}; | ||
let y, v = 0; | ||
const le = () => { | ||
const re = () => { | ||
y = null, document.body.getBoundingClientRect().top > v + 2 && (y = "up"), document.body.getBoundingClientRect().top < v - 2 && (y = "down"), v = document.body.getBoundingClientRect().top; | ||
@@ -468,3 +468,3 @@ const e = document.querySelector(".c-read-also-banner"); | ||
} | ||
}, ce = (e = document.querySelector( | ||
}, le = (e = document.querySelector( | ||
".c-read-also-banner" | ||
@@ -475,6 +475,6 @@ )) => { | ||
window.addEventListener("scroll", () => { | ||
clearTimeout(t), t = setTimeout(le, 100); | ||
clearTimeout(t), t = setTimeout(re, 100); | ||
}); | ||
} | ||
}, S = "#page-content", w = "#text-tooltip", ae = ".tooltip-btn", H = "c-text-tooltip--show", de = [ | ||
}, S = "#page-content", w = "#text-tooltip", ce = ".tooltip-btn", H = "c-text-tooltip--show", ae = [ | ||
"#page-content .c-content p", | ||
@@ -491,6 +491,6 @@ "#page-content .c-content h2", | ||
"#page-content header h2" | ||
], q = (e, t) => e instanceof Element ? t.some((o) => e.matches(o)) : !1, ue = (e, t) => { | ||
], q = (e, t) => e instanceof Element ? t.some((o) => e.matches(o)) : !1, de = (e, t) => { | ||
const o = e.startContainer.nodeType === Node.ELEMENT_NODE ? e.startContainer : e.startContainer.parentElement, n = e.endContainer.nodeType === Node.ELEMENT_NODE ? e.endContainer : e.endContainer.parentElement; | ||
return !!o && q(o, t) || !!n && q(n, t); | ||
}, fe = (e) => { | ||
}, ue = (e) => { | ||
var o; | ||
@@ -501,5 +501,5 @@ if (!e.focusNode) | ||
return t ? (t & 4) > 0 : e.anchorOffset < e.focusOffset; | ||
}, he = (e, t, o) => { | ||
}, fe = (e, t, o) => { | ||
const n = document.querySelector(`${S} ${w}`), s = document.querySelector(`${S}`), r = document.querySelectorAll( | ||
`${S} ${w} ${ae}` | ||
`${S} ${w} ${ce}` | ||
); | ||
@@ -526,8 +526,8 @@ if (!n || !s) { | ||
if (n.length) { | ||
const s = ue(o, de), r = fe(t) || !1; | ||
s && he(o, r, n); | ||
const s = de(o, ae), r = ue(t) || !1; | ||
s && fe(o, r, n); | ||
return; | ||
} | ||
C(); | ||
}, pe = () => { | ||
}, he = () => { | ||
if (!(window != null && window.getSelection)) { | ||
@@ -538,3 +538,3 @@ console.warn("Selection API isn't supported"); | ||
document.addEventListener("mouseup", E), document.addEventListener("selectionchange", E), document.addEventListener("touchend", E), document.addEventListener("touchcancel", E); | ||
}, me = (e) => { | ||
}, pe = (e) => { | ||
const { target: t } = e; | ||
@@ -545,9 +545,9 @@ if (t instanceof Element) { | ||
} | ||
}, be = (e = document.querySelector( | ||
}, me = (e = document.querySelector( | ||
".c-search-form--button" | ||
)) => { | ||
e && e.addEventListener("click", (t) => { | ||
me(t); | ||
pe(t); | ||
}); | ||
}, ye = ({ | ||
}, be = ({ | ||
tabsContainerElement: e, | ||
@@ -568,3 +568,3 @@ event: t | ||
}), o.setAttribute("aria-selected", "true"), a && a.removeAttribute("aria-hidden"); | ||
}, I = (e) => e.code === "ArrowLeft" || e.keyCode === 39, k = (e) => e.code === "ArrowRight" || e.keyCode === 37, ge = (e = document.querySelectorAll( | ||
}, I = (e) => e.code === "ArrowLeft" || e.keyCode === 39, k = (e) => e.code === "ArrowRight" || e.keyCode === 37, ye = (e = document.querySelectorAll( | ||
".js-tabs" | ||
@@ -576,3 +576,3 @@ )) => { | ||
s.addEventListener("click", (r) => { | ||
ye({ tabsContainerElement: t, event: r }); | ||
be({ tabsContainerElement: t, event: r }); | ||
}); | ||
@@ -588,7 +588,7 @@ }); | ||
}); | ||
}, ve = () => { | ||
V(), ge(), N(), re(), U(), ce(), be(), B("olympicsGames", "countdown-olympics-games"), pe(), F(), ne(), se(); | ||
}, Ee = () => { | ||
z(), ye(), O(), ie(), Q(), le(), me(), N("olympicsGames", "countdown-olympics-games"), he(), j(), oe(), ne(); | ||
}; | ||
export { | ||
ve as initScripts | ||
Ee as initScripts | ||
}; |
@@ -1,1 +0,1 @@ | ||
(function(p,h){typeof exports=="object"&&typeof module<"u"?h(exports):typeof define=="function"&&define.amd?define(["exports"],h):(p=typeof globalThis<"u"?globalThis:p||self,h(p.scripts={}))})(this,function(p){"use strict";var Ee=Object.defineProperty;var Se=(p,h,b)=>h in p?Ee(p,h,{enumerable:!0,configurable:!0,writable:!0,value:b}):p[h]=b;var v=(p,h,b)=>(Se(p,typeof h!="symbol"?h+"":h,b),b);const h=new IntersectionObserver(([e])=>{const t=document.querySelector(".c-close-article-btn");t&&(t.style.visibility=e.isIntersecting||e.boundingClientRect.top<0?"hidden":"visible")}),b=()=>{const e=document.querySelector(".js-limit-scroll-close-article-btn");e&&h.observe(e)},j=e=>{e.stopImmediatePropagation(),e.preventDefault();const t=e.currentTarget;if(t instanceof HTMLButtonElement){const o=t.parentElement,n=o==null?void 0:o.querySelector(`#${t.getAttribute("aria-controls")}`);t.getAttribute("aria-expanded")==="true"?(t.setAttribute("aria-expanded","false"),n==null||n.setAttribute("aria-hidden","true")):(t.setAttribute("aria-expanded","true"),n==null||n.setAttribute("aria-hidden","false"))}},F=(e=document.querySelector(".js-collapse__button"))=>{e&&document.querySelectorAll(".c-collapse__button").forEach(o=>{o.addEventListener("click",n=>{j(n)})})},O=(e,t)=>{const o=document.querySelector(`#${t}`);if(o){const n=o.querySelector(".js-countdown-days"),s=o.querySelector(".js-countdown-hours"),r=o.querySelector(".js-countdown-minutes"),a=o.querySelector(".js-countdown-seconds");if(!n||!s||!r||!a)return;window.counters={olympicsGames:"2024-07-26 20:00:00"};const i=window.counters[e],l=new Date(i).getTime(),d=setInterval(()=>{const u=new Date().getTime(),f=l-u;if(f<=0)clearInterval(d);else{const g=Math.floor(f/864e5),y=Math.floor(f%(1e3*60*60*24)/(1e3*60*60)),m=Math.floor(f%(1e3*60*60)/(1e3*60)),ge=Math.floor(f%(1e3*60)/1e3);n.innerHTML=g.toString(),s.innerHTML=y.toString(),r.innerHTML=m.toString(),a.innerHTML=ge.toString()}},1e3)}},N=e=>{var n;e.setAttribute("aria-expanded","true");const t=(n=e.parentNode)==null?void 0:n.querySelectorAll(".js-expand-target");t==null||t.forEach(s=>s.setAttribute("aria-hidden","false"));const o=e.querySelector(".js-expand-button__label");o instanceof HTMLSpanElement&&(o.innerHTML="Voir moins")},B=e=>{var n;const t=(n=e.parentNode)==null?void 0:n.querySelectorAll(".js-expand-target");t==null||t.forEach(s=>s.setAttribute("aria-hidden","true")),e.setAttribute("aria-expanded","false");const o=e.querySelector(".js-expand-button__label");o instanceof HTMLSpanElement&&(o.innerHTML="Voir plus")},P=e=>{const t=e.currentTarget;return e.preventDefault(),t instanceof HTMLButtonElement?t.getAttribute("aria-expanded")==="true"?B(t):N(t):null},K=(e=document.querySelector(".js-expand-button"))=>{e&&document.querySelectorAll(".js-expand-button").forEach(o=>o.addEventListener("click",P))},c={inert:":not([inert]):not([inert] *)",negTabIndex:':not([tabindex^="-"])',disabled:":not(:disabled)"};var z=[`a[href]${c.inert}${c.negTabIndex}`,`area[href]${c.inert}${c.negTabIndex}`,`input:not([type="hidden"]):not([type="radio"])${c.inert}${c.negTabIndex}${c.disabled}`,`input[type="radio"]${c.inert}${c.negTabIndex}${c.disabled}`,`select${c.inert}${c.negTabIndex}${c.disabled}`,`textarea${c.inert}${c.negTabIndex}${c.disabled}`,`button${c.inert}${c.negTabIndex}${c.disabled}`,`details${c.inert} > summary:first-of-type${c.negTabIndex}`,`iframe${c.inert}${c.negTabIndex}`,`audio[controls]${c.inert}${c.negTabIndex}`,`video[controls]${c.inert}${c.negTabIndex}`,`[contenteditable]${c.inert}${c.negTabIndex}`,`[tabindex]${c.inert}${c.negTabIndex}`];function x(e){(e.querySelector("[autofocus]")||e).focus()}function V(e){const t=E(e,!0),o=t?E(e,!1)||t:null;return[t,o]}function E(e,t){if(t&&C(e))return e;if(G(e))if(e.shadowRoot){let o=A(e.shadowRoot,t);for(;o;){const n=E(o,t);if(n)return n;o=q(o,t)}}else if(e.localName==="slot"){const o=e.assignedElements({flatten:!0});t||o.reverse();for(const n of o){const s=E(n,t);if(s)return s}}else{let o=A(e,t);for(;o;){const n=E(o,t);if(n)return n;o=q(o,t)}}return!t&&C(e)?e:null}function A(e,t){return t?e.firstElementChild:e.lastElementChild}function q(e,t){return t?e.nextElementSibling:e.previousElementSibling}const Y=e=>e.matches("details:not([open]) *")&&!e.matches("details>summary:first-of-type")?!0:!(e.offsetWidth||e.offsetHeight||e.getClientRects().length),C=e=>{var t;return(t=e.shadowRoot)!=null&&t.delegatesFocus?!1:e.matches(z.join(","))&&!Y(e)};function G(e){return e.shadowRoot&&e.getAttribute("tabindex")==="-1"?!1:!e.matches(":disabled,[hidden],[inert]")}function L(e=document){const t=e.activeElement;return t?t.shadowRoot?L(t.shadowRoot)||document.activeElement:t:null}function X(e,t){const[o,n]=V(e);if(!o)return t.preventDefault();const s=L();t.shiftKey&&s===o?(n.focus(),t.preventDefault()):!t.shiftKey&&s===n&&(o.focus(),t.preventDefault())}class I{constructor(t){v(this,"$el");v(this,"id");v(this,"previouslyFocused");v(this,"shown");this.$el=t,this.id=this.$el.getAttribute("data-a11y-dialog")||this.$el.id,this.previouslyFocused=null,this.shown=!1,this.maintainFocus=this.maintainFocus.bind(this),this.bindKeypress=this.bindKeypress.bind(this),this.handleTriggerClicks=this.handleTriggerClicks.bind(this),this.show=this.show.bind(this),this.hide=this.hide.bind(this),this.$el.setAttribute("aria-hidden","true"),this.$el.setAttribute("aria-modal","true"),this.$el.setAttribute("tabindex","-1"),this.$el.hasAttribute("role")||this.$el.setAttribute("role","dialog"),document.addEventListener("click",this.handleTriggerClicks,!0)}destroy(){return this.hide(),document.removeEventListener("click",this.handleTriggerClicks,!0),this.$el.replaceWith(this.$el.cloneNode(!0)),this.fire("destroy"),this}show(t){var o;return this.shown?this:(this.shown=!0,this.$el.removeAttribute("aria-hidden"),this.previouslyFocused=L(),((o=this.previouslyFocused)==null?void 0:o.tagName)==="BODY"&&(t!=null&&t.target)&&(this.previouslyFocused=t.target),(t==null?void 0:t.type)==="focus"?this.maintainFocus(t):x(this.$el),document.body.addEventListener("focus",this.maintainFocus,!0),this.$el.addEventListener("keydown",this.bindKeypress,!0),this.fire("show",t),this)}hide(t){var o,n;return this.shown?(this.shown=!1,this.$el.setAttribute("aria-hidden","true"),(n=(o=this.previouslyFocused)==null?void 0:o.focus)==null||n.call(o),document.body.removeEventListener("focus",this.maintainFocus,!0),this.$el.removeEventListener("keydown",this.bindKeypress,!0),this.fire("hide",t),this):this}on(t,o,n){return this.$el.addEventListener(t,o,n),this}off(t,o,n){return this.$el.removeEventListener(t,o,n),this}fire(t,o){this.$el.dispatchEvent(new CustomEvent(t,{detail:o,cancelable:!0}))}handleTriggerClicks(t){const o=t.target;o.closest(`[data-a11y-dialog-show="${this.id}"]`)&&this.show(t),(o.closest(`[data-a11y-dialog-hide="${this.id}"]`)||o.closest("[data-a11y-dialog-hide]")&&o.closest('[aria-modal="true"]')===this.$el)&&this.hide(t)}bindKeypress(t){var n;if(((n=document.activeElement)==null?void 0:n.closest('[aria-modal="true"]'))!==this.$el)return;let o=!1;try{o=!!this.$el.querySelector('[popover]:not([popover="manual"]):popover-open')}catch{}t.key==="Escape"&&this.$el.getAttribute("role")!=="alertdialog"&&!o&&(t.preventDefault(),this.hide(t)),t.key==="Tab"&&X(this.$el,t)}maintainFocus(t){t.target.closest('[aria-modal="true"], [data-a11y-dialog-ignore-focus-trap]')||x(this.$el)}}function k(){for(const e of document.querySelectorAll("[data-a11y-dialog]"))new I(e)}typeof document<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",k):k());const J=()=>document.querySelectorAll(".js-modal").forEach(e=>{if(!(e instanceof HTMLElement))return;const t=new I(e),o={x:0,y:0};t.on("show",()=>{o.x=window.scrollX,o.y=window.scrollY,document.body.classList.add("noscroll"),document.body.style.top=`-${o.y}px`}).on("hide",()=>{document.body.classList.remove("noscroll"),document.body.style.top="",(window.scrollY!==o.y||window.scrollX!==o.x)&&window.scroll(o.x,o.y)})}),Q=({navigatedList:e,nextBtn:t,prevBtn:o})=>{var r,a,i,l,d,u,f,g;const n=e.scrollLeft>0,s=e.scrollLeft+e.clientWidth<e.scrollWidth;n&&s?((r=t.classList)==null||r.add("o-nav-button--visible"),(a=o.classList)==null||a.add("o-nav-button--visible")):n?((i=t.classList)==null||i.remove("o-nav-button--visible"),(l=o.classList)==null||l.add("o-nav-button--visible")):s?((d=t.classList)==null||d.add("o-nav-button--visible"),(u=o.classList)==null||u.remove("o-nav-button--visible")):((f=t.classList)==null||f.remove("o-nav-button--visible"),(g=o.classList)==null||g.remove("o-nav-button--visible"))},U=({navigatedList:e,nextBtn:t,prevBtn:o,sliderVariant:n})=>{if(e){const s=e.closest(".js-overview-bar-container"),r=s==null?void 0:s.querySelector(".c-stepper"),a=r==null?void 0:r.querySelectorAll(".c-stepper__item");if(a){const i=Array.from(a).findIndex(l=>l.classList.contains("c-stepper__item--loading"));if(i<0)a[0].classList.add("c-stepper__item--loading");else{a[i].classList.remove("c-stepper__item--loading"),a[i].classList.add("c-stepper__item--loaded");const l=a[i].querySelector(".c-stepper__loader");l&&l instanceof HTMLElement&&(l.style.transition="width 0s linear"),i+1<a.length&&a[i+1].classList.add("c-stepper__item--loading")}}if(e.scrollWidth-e.clientWidth>e.clientWidth){let i=e.scrollLeft;switch(n){case"three-columns-articles":i+=e.clientWidth+32;break;case"rubrics":i+=e.clientWidth-36;break;default:i+=Math.ceil(e.clientWidth*.6);break}e.scrollTo({left:i,behavior:"smooth"}),o.classList.add("o-nav-button--visible"),i+e.clientWidth>=e.scrollWidth&&t.classList.remove("o-nav-button--visible")}else{const i=e.scrollWidth-e.clientWidth;e.scrollTo({left:i,behavior:"smooth"}),t.classList.remove("o-nav-button--visible"),o.classList.add("o-nav-button--visible")}}},Z=({navigatedList:e,nextBtn:t,prevBtn:o,sliderVariant:n,delay:s})=>{if(e){const r=e.closest(".js-overview-bar-container"),a=r==null?void 0:r.querySelector(".c-stepper"),i=a==null?void 0:a.querySelectorAll(".c-stepper__item");if(i){const l=Array.from(i).findIndex(d=>d.classList.contains("c-stepper__item--loading"));l<0?i[0].classList.add("c-stepper__item--loading"):(i[l].classList.remove("c-stepper__item--loading"),i[l].classList.remove("c-stepper__item--loaded"),l-1>0&&(i[l-1].classList.remove("c-stepper__item--loading"),i[l-1].classList.remove("c-stepper__item--loaded"),setTimeout(()=>{const d=i[l-1].querySelector(".c-stepper__loader");i[l-1].classList.add("c-stepper__item--loading"),d&&d instanceof HTMLElement&&(d.style.transition=`width ${s/1e3}s linear`)},0)))}if(e.clientWidth<e.scrollLeft){let l=e.scrollLeft;switch(n){case"three-columns-articles":l-=e.clientWidth+32;break;case"rubrics":l-=e.clientWidth-36;break;default:l-=Math.ceil(e.clientWidth*.6);break}e.scrollTo({left:l,behavior:"smooth"}),t.classList.add("o-nav-button--visible"),l===0&&o.classList.remove("o-nav-button--visible")}else e.scrollTo({left:0,behavior:"smooth"}),o.classList.remove("o-nav-button--visible"),e.clientWidth<e.scrollWidth&&t.classList.add("o-nav-button--visible")}},ee=({navigatedList:e,nextBtn:t,prevBtn:o})=>{Q({navigatedList:e,nextBtn:t,prevBtn:o})},te=()=>{const e=document.querySelectorAll(".js-navigation-container");for(const t of Array.from(e)){const{sliderVariant:o}=t.dataset,{sliderAuto:n}=t.dataset,{sliderDelay:s}=t.dataset,r=s?parseInt(s,10):3e3,a=t.closest(".js-overview-bar-container"),i=a==null?void 0:a.querySelector(".c-stepper"),l=i==null?void 0:i.querySelectorAll(".c-stepper__item");if(t){const d=t.querySelector(".js-navigation-container__list"),u=t.querySelector(".o-nav-button--next-button"),f=t.querySelector(".o-nav-button--previous-button");if(d&&d.clientWidth<d.scrollWidth&&(u==null||u.classList.add("o-nav-button--visible")),d&&u&&f&&(u==null||u.addEventListener("click",U.bind(!1,{navigatedList:d,nextBtn:u,prevBtn:f,sliderVariant:o})),f==null||f.addEventListener("click",Z.bind(!1,{navigatedList:d,nextBtn:u,prevBtn:f,sliderVariant:o,delay:r}))),n==="true"&&u){const g=i?i.querySelector(".c-stepper__item--loading"):null;l&&(l.forEach(y=>{const m=y.querySelector(".c-stepper__loader");m&&m instanceof HTMLElement&&(m.style.transition=`width ${r/1e3}s linear`)}),g||l[0].classList.add("c-stepper__item--loading")),setInterval(()=>{u.classList.contains("o-nav-button--visible")?u.click():d&&f&&(d.scrollLeft=0,l&&(l.forEach(y=>{const m=y.querySelector(".c-stepper__loader");m&&m instanceof HTMLElement&&(m.style.transition="width 0s linear"),y.classList.remove("c-stepper__item--loading"),y.classList.remove("c-stepper__item--loaded"),setTimeout(()=>{m&&m instanceof HTMLElement&&(m.style.transition=`width ${r/1e3}s linear`)},0)}),setTimeout(()=>{l[0].classList.add("c-stepper__item--loading")},0)),f.click())},r)}}}},oe=()=>{const e=document.querySelectorAll(".js-navigation-container");for(const t of Array.from(e))if(t){const o=t.querySelector(".js-navigation-container__list"),n=t.querySelector(".o-nav-button--next-button"),s=t.querySelector(".o-nav-button--previous-button");o&&n&&s&&window.addEventListener("resize",ee.bind(!1,{navigatedList:o,nextBtn:n,prevBtn:s}))}},ne=()=>{const e=document.querySelector(".js-limit-scroll-progress-bar"),t=document.querySelector(".c-progress__bar");if(!t)return;const{documentElement:o}=document;let n=o.scrollHeight-o.clientHeight;if(!n)return;const s=o.scrollTop;e&&(n=e.scrollHeight-o.clientHeight+(window.pageYOffset+e.getBoundingClientRect().top));const r=Math.round(s/n*100);t.style.width=`${r}%`,r>=100&&(t.style.width="100%")},se=()=>{document.querySelector(".c-progress")&&window.addEventListener("scroll",ne)};let S,T=0;const ie=()=>{S=null,document.body.getBoundingClientRect().top>T+2&&(S="up"),document.body.getBoundingClientRect().top<T-2&&(S="down"),T=document.body.getBoundingClientRect().top;const e=document.querySelector(".c-read-also-banner");if(e){const t=e.dataset.bannerLimitTop||"0";S==="up"&&-document.body.getBoundingClientRect().top>=parseInt(t,10)&&(e.classList.remove("c-read-also-banner__scrolldirection--down"),e.style.paddingTop="0.75em",e.style.paddingBottom="0.75em",e.style.borderWidth="1px",e.classList.contains("c-read-also-banner__scrolldirection--up")||e.classList.add("c-read-also-banner__scrolldirection--up")),(S==="down"||-document.body.getBoundingClientRect().top<=parseInt(t,10))&&(e.classList.remove("c-read-also-banner__scrolldirection--up"),e.style.paddingTop="0",e.style.paddingBottom="0",e.style.borderWidth="0",e.classList.contains("c-read-also-banner__scrolldirection--down")||e.classList.add("c-read-also-banner__scrolldirection--down"))}},re=(e=document.querySelector(".c-read-also-banner"))=>{if(e){let t;window.addEventListener("scroll",()=>{clearTimeout(t),t=setTimeout(ie,100)})}},_="#page-content",$="#text-tooltip",le=".tooltip-btn",M="c-text-tooltip--show",ce=["#page-content .c-content p","#page-content .c-content h2","#page-content .c-content h3","#page-content .c-content h4","#page-content .c-content h5","#page-content .c-content h6","#page-content .c-content li","#page-content .c-content span","#page-content header span","#page-content header h1","#page-content header h2"],H=(e,t)=>e instanceof Element?t.some(o=>e.matches(o)):!1,ae=(e,t)=>{const o=e.startContainer.nodeType===Node.ELEMENT_NODE?e.startContainer:e.startContainer.parentElement,n=e.endContainer.nodeType===Node.ELEMENT_NODE?e.endContainer:e.endContainer.parentElement;return!!o&&H(o,t)||!!n&&H(n,t)},de=e=>{var o;if(!e.focusNode)return null;const t=(o=e.anchorNode)==null?void 0:o.compareDocumentPosition(e.focusNode);return t?(t&4)>0:e.anchorOffset<e.focusOffset},ue=(e,t,o)=>{const n=document.querySelector(`${_} ${$}`),s=document.querySelector(`${_}`),r=document.querySelectorAll(`${_} ${$} ${le}`);if(!n||!s){console.warn("Text tooltip : Tooltip or it's parent are not found in the DOM");return}Array.from(r).forEach(l=>l.setAttribute("data-selected-text",o));const a=e.getClientRects(),i=a[t?a.length-1:0];n.style.top=`${i.top-s.getBoundingClientRect().top-(n.offsetHeight+10)}px`,i.width<n.offsetWidth?n.style.left=`${i.left-s.getBoundingClientRect().left+i.width/2-n.offsetWidth/2}px`:t?n.style.left=`${i.left-s.getBoundingClientRect().left+i.width-n.offsetWidth}px`:n.style.left=`${i.left-s.getBoundingClientRect().left}px`,n.classList.add(M)},R=()=>{const e=document.querySelector(`${$}`);e&&e.classList.remove(M)},w=({type:e})=>{const t=window.getSelection();if(e==="selectionchange"){R();return}if(!t||!t.rangeCount)return;const o=t.getRangeAt(0),n=t.toString().trim();if(n.length){const s=ae(o,ce),r=de(t)||!1;s&&ue(o,r,n);return}R()},fe=()=>{if(!(window!=null&&window.getSelection)){console.warn("Selection API isn't supported");return}document.addEventListener("mouseup",w),document.addEventListener("selectionchange",w),document.addEventListener("touchend",w),document.addEventListener("touchcancel",w)},he=e=>{const{target:t}=e;if(t instanceof Element){const o=t.closest(".c-search-form--button");o&&(e.preventDefault(),o.classList.remove("c-search-form--button"))}},pe=(e=document.querySelector(".c-search-form--button"))=>{e&&e.addEventListener("click",t=>{he(t)})},me=({tabsContainerElement:e,event:t})=>{t.preventDefault();const o=t.target;if(!(o instanceof HTMLButtonElement))return;const n=e.querySelectorAll('[role="tab"]'),s=e.querySelectorAll('[role="tabpanel"]'),r=o.getAttribute("aria-controls"),a=Object.values(s).find(i=>i.id===r);n.forEach(i=>{i.setAttribute("aria-selected","false")}),s.forEach(i=>{i.setAttribute("aria-hidden","true")}),o.setAttribute("aria-selected","true"),a&&a.removeAttribute("aria-hidden")},D=e=>e.code==="ArrowLeft"||e.keyCode===39,W=e=>e.code==="ArrowRight"||e.keyCode===37,be=(e=document.querySelectorAll(".js-tabs"))=>{e.length>0&&e.forEach(t=>{const o=t.querySelectorAll('[role="tab"]');o.forEach(s=>{s.addEventListener("click",r=>{me({tabsContainerElement:t,event:r})})});const n=t.querySelector('[role="tablist"]');if(n&&o.length>0){let s=0;n.addEventListener("keydown",r=>{r instanceof KeyboardEvent&&(D(r)||W(r))&&(o[s].setAttribute("tabindex","-1"),D(r)?(s+=1,s>=o.length&&(s=0)):W(r)&&(s-=1,s<0&&(s=o.length-1)),o[s].setAttribute("tabindex","0"),o[s].focus())})}})},ye=()=>{K(),be(),F(),se(),J(),re(),pe(),O("olympicsGames","countdown-olympics-games"),fe(),b(),te(),oe()};p.initScripts=ye,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})}); | ||
(function(p,h){typeof exports=="object"&&typeof module<"u"?h(exports):typeof define=="function"&&define.amd?define(["exports"],h):(p=typeof globalThis<"u"?globalThis:p||self,h(p.scripts={}))})(this,function(p){"use strict";var ge=Object.defineProperty;var Ee=(p,h,b)=>h in p?ge(p,h,{enumerable:!0,configurable:!0,writable:!0,value:b}):p[h]=b;var S=(p,h,b)=>(Ee(p,typeof h!="symbol"?h+"":h,b),b);const h=()=>{const e=document.querySelector(".js-limit-scroll-close-article-btn");e&&new IntersectionObserver(([o])=>{const n=document.querySelector(".c-close-article-btn");n&&(n.style.visibility=o.isIntersecting||o.boundingClientRect.top<0?"hidden":"visible")}).observe(e)},b=e=>{e.stopImmediatePropagation(),e.preventDefault();const t=e.currentTarget;if(t instanceof HTMLButtonElement){const o=t.parentElement,n=o==null?void 0:o.querySelector(`#${t.getAttribute("aria-controls")}`);t.getAttribute("aria-expanded")==="true"?(t.setAttribute("aria-expanded","false"),n==null||n.setAttribute("aria-hidden","true")):(t.setAttribute("aria-expanded","true"),n==null||n.setAttribute("aria-hidden","false"))}},j=(e=document.querySelector(".js-collapse__button"))=>{e&&document.querySelectorAll(".c-collapse__button").forEach(o=>{o.addEventListener("click",n=>{b(n)})})},F=(e,t)=>{const o=document.querySelector(`#${t}`);if(o){const n=o.querySelector(".js-countdown-days"),s=o.querySelector(".js-countdown-hours"),r=o.querySelector(".js-countdown-minutes"),a=o.querySelector(".js-countdown-seconds");if(!n||!s||!r||!a)return;window.counters={olympicsGames:"2024-07-26 20:00:00"};const i=window.counters[e],l=new Date(i).getTime(),d=setInterval(()=>{const u=new Date().getTime(),f=l-u;if(f<=0)clearInterval(d);else{const g=Math.floor(f/864e5),y=Math.floor(f%(1e3*60*60*24)/(1e3*60*60)),m=Math.floor(f%(1e3*60*60)/(1e3*60)),ye=Math.floor(f%(1e3*60)/1e3);n.innerHTML=g.toString(),s.innerHTML=y.toString(),r.innerHTML=m.toString(),a.innerHTML=ye.toString()}},1e3)}},O=e=>{var n;e.setAttribute("aria-expanded","true");const t=(n=e.parentNode)==null?void 0:n.querySelectorAll(".js-expand-target");t==null||t.forEach(s=>s.setAttribute("aria-hidden","false"));const o=e.querySelector(".js-expand-button__label");o instanceof HTMLSpanElement&&(o.innerHTML="Voir moins")},N=e=>{var n;const t=(n=e.parentNode)==null?void 0:n.querySelectorAll(".js-expand-target");t==null||t.forEach(s=>s.setAttribute("aria-hidden","true")),e.setAttribute("aria-expanded","false");const o=e.querySelector(".js-expand-button__label");o instanceof HTMLSpanElement&&(o.innerHTML="Voir plus")},B=e=>{const t=e.currentTarget;return e.preventDefault(),t instanceof HTMLButtonElement?t.getAttribute("aria-expanded")==="true"?N(t):O(t):null},P=(e=document.querySelector(".js-expand-button"))=>{e&&document.querySelectorAll(".js-expand-button").forEach(o=>o.addEventListener("click",B))},c={inert:":not([inert]):not([inert] *)",negTabIndex:':not([tabindex^="-"])',disabled:":not(:disabled)"};var K=[`a[href]${c.inert}${c.negTabIndex}`,`area[href]${c.inert}${c.negTabIndex}`,`input:not([type="hidden"]):not([type="radio"])${c.inert}${c.negTabIndex}${c.disabled}`,`input[type="radio"]${c.inert}${c.negTabIndex}${c.disabled}`,`select${c.inert}${c.negTabIndex}${c.disabled}`,`textarea${c.inert}${c.negTabIndex}${c.disabled}`,`button${c.inert}${c.negTabIndex}${c.disabled}`,`details${c.inert} > summary:first-of-type${c.negTabIndex}`,`iframe${c.inert}${c.negTabIndex}`,`audio[controls]${c.inert}${c.negTabIndex}`,`video[controls]${c.inert}${c.negTabIndex}`,`[contenteditable]${c.inert}${c.negTabIndex}`,`[tabindex]${c.inert}${c.negTabIndex}`];function x(e){(e.querySelector("[autofocus]")||e).focus()}function z(e){const t=E(e,!0),o=t?E(e,!1)||t:null;return[t,o]}function E(e,t){if(t&&C(e))return e;if(Y(e))if(e.shadowRoot){let o=A(e.shadowRoot,t);for(;o;){const n=E(o,t);if(n)return n;o=q(o,t)}}else if(e.localName==="slot"){const o=e.assignedElements({flatten:!0});t||o.reverse();for(const n of o){const s=E(n,t);if(s)return s}}else{let o=A(e,t);for(;o;){const n=E(o,t);if(n)return n;o=q(o,t)}}return!t&&C(e)?e:null}function A(e,t){return t?e.firstElementChild:e.lastElementChild}function q(e,t){return t?e.nextElementSibling:e.previousElementSibling}const V=e=>e.matches("details:not([open]) *")&&!e.matches("details>summary:first-of-type")?!0:!(e.offsetWidth||e.offsetHeight||e.getClientRects().length),C=e=>{var t;return(t=e.shadowRoot)!=null&&t.delegatesFocus?!1:e.matches(K.join(","))&&!V(e)};function Y(e){return e.shadowRoot&&e.getAttribute("tabindex")==="-1"?!1:!e.matches(":disabled,[hidden],[inert]")}function L(e=document){const t=e.activeElement;return t?t.shadowRoot?L(t.shadowRoot)||document.activeElement:t:null}function G(e,t){const[o,n]=z(e);if(!o)return t.preventDefault();const s=L();t.shiftKey&&s===o?(n.focus(),t.preventDefault()):!t.shiftKey&&s===n&&(o.focus(),t.preventDefault())}class I{constructor(t){S(this,"$el");S(this,"id");S(this,"previouslyFocused");S(this,"shown");this.$el=t,this.id=this.$el.getAttribute("data-a11y-dialog")||this.$el.id,this.previouslyFocused=null,this.shown=!1,this.maintainFocus=this.maintainFocus.bind(this),this.bindKeypress=this.bindKeypress.bind(this),this.handleTriggerClicks=this.handleTriggerClicks.bind(this),this.show=this.show.bind(this),this.hide=this.hide.bind(this),this.$el.setAttribute("aria-hidden","true"),this.$el.setAttribute("aria-modal","true"),this.$el.setAttribute("tabindex","-1"),this.$el.hasAttribute("role")||this.$el.setAttribute("role","dialog"),document.addEventListener("click",this.handleTriggerClicks,!0)}destroy(){return this.hide(),document.removeEventListener("click",this.handleTriggerClicks,!0),this.$el.replaceWith(this.$el.cloneNode(!0)),this.fire("destroy"),this}show(t){var o;return this.shown?this:(this.shown=!0,this.$el.removeAttribute("aria-hidden"),this.previouslyFocused=L(),((o=this.previouslyFocused)==null?void 0:o.tagName)==="BODY"&&(t!=null&&t.target)&&(this.previouslyFocused=t.target),(t==null?void 0:t.type)==="focus"?this.maintainFocus(t):x(this.$el),document.body.addEventListener("focus",this.maintainFocus,!0),this.$el.addEventListener("keydown",this.bindKeypress,!0),this.fire("show",t),this)}hide(t){var o,n;return this.shown?(this.shown=!1,this.$el.setAttribute("aria-hidden","true"),(n=(o=this.previouslyFocused)==null?void 0:o.focus)==null||n.call(o),document.body.removeEventListener("focus",this.maintainFocus,!0),this.$el.removeEventListener("keydown",this.bindKeypress,!0),this.fire("hide",t),this):this}on(t,o,n){return this.$el.addEventListener(t,o,n),this}off(t,o,n){return this.$el.removeEventListener(t,o,n),this}fire(t,o){this.$el.dispatchEvent(new CustomEvent(t,{detail:o,cancelable:!0}))}handleTriggerClicks(t){const o=t.target;o.closest(`[data-a11y-dialog-show="${this.id}"]`)&&this.show(t),(o.closest(`[data-a11y-dialog-hide="${this.id}"]`)||o.closest("[data-a11y-dialog-hide]")&&o.closest('[aria-modal="true"]')===this.$el)&&this.hide(t)}bindKeypress(t){var n;if(((n=document.activeElement)==null?void 0:n.closest('[aria-modal="true"]'))!==this.$el)return;let o=!1;try{o=!!this.$el.querySelector('[popover]:not([popover="manual"]):popover-open')}catch{}t.key==="Escape"&&this.$el.getAttribute("role")!=="alertdialog"&&!o&&(t.preventDefault(),this.hide(t)),t.key==="Tab"&&G(this.$el,t)}maintainFocus(t){t.target.closest('[aria-modal="true"], [data-a11y-dialog-ignore-focus-trap]')||x(this.$el)}}function k(){for(const e of document.querySelectorAll("[data-a11y-dialog]"))new I(e)}typeof document<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",k):k());const X=()=>document.querySelectorAll(".js-modal").forEach(e=>{if(!(e instanceof HTMLElement))return;const t=new I(e),o={x:0,y:0};t.on("show",()=>{o.x=window.scrollX,o.y=window.scrollY,document.body.classList.add("noscroll"),document.body.style.top=`-${o.y}px`}).on("hide",()=>{document.body.classList.remove("noscroll"),document.body.style.top="",(window.scrollY!==o.y||window.scrollX!==o.x)&&window.scroll(o.x,o.y)})}),J=({navigatedList:e,nextBtn:t,prevBtn:o})=>{var r,a,i,l,d,u,f,g;const n=e.scrollLeft>0,s=e.scrollLeft+e.clientWidth<e.scrollWidth;n&&s?((r=t.classList)==null||r.add("o-nav-button--visible"),(a=o.classList)==null||a.add("o-nav-button--visible")):n?((i=t.classList)==null||i.remove("o-nav-button--visible"),(l=o.classList)==null||l.add("o-nav-button--visible")):s?((d=t.classList)==null||d.add("o-nav-button--visible"),(u=o.classList)==null||u.remove("o-nav-button--visible")):((f=t.classList)==null||f.remove("o-nav-button--visible"),(g=o.classList)==null||g.remove("o-nav-button--visible"))},Q=({navigatedList:e,nextBtn:t,prevBtn:o,sliderVariant:n})=>{if(e){const s=e.closest(".js-overview-bar-container"),r=s==null?void 0:s.querySelector(".c-stepper"),a=r==null?void 0:r.querySelectorAll(".c-stepper__item");if(a){const i=Array.from(a).findIndex(l=>l.classList.contains("c-stepper__item--loading"));if(i<0)a[0].classList.add("c-stepper__item--loading");else{a[i].classList.remove("c-stepper__item--loading"),a[i].classList.add("c-stepper__item--loaded");const l=a[i].querySelector(".c-stepper__loader");l&&l instanceof HTMLElement&&(l.style.transition="width 0s linear"),i+1<a.length&&a[i+1].classList.add("c-stepper__item--loading")}}if(e.scrollWidth-e.clientWidth>e.clientWidth){let i=e.scrollLeft;switch(n){case"three-columns-articles":i+=e.clientWidth+32;break;case"rubrics":i+=e.clientWidth-36;break;default:i+=Math.ceil(e.clientWidth*.6);break}e.scrollTo({left:i,behavior:"smooth"}),o.classList.add("o-nav-button--visible"),i+e.clientWidth>=e.scrollWidth&&t.classList.remove("o-nav-button--visible")}else{const i=e.scrollWidth-e.clientWidth;e.scrollTo({left:i,behavior:"smooth"}),t.classList.remove("o-nav-button--visible"),o.classList.add("o-nav-button--visible")}}},U=({navigatedList:e,nextBtn:t,prevBtn:o,sliderVariant:n,delay:s})=>{if(e){const r=e.closest(".js-overview-bar-container"),a=r==null?void 0:r.querySelector(".c-stepper"),i=a==null?void 0:a.querySelectorAll(".c-stepper__item");if(i){const l=Array.from(i).findIndex(d=>d.classList.contains("c-stepper__item--loading"));l<0?i[0].classList.add("c-stepper__item--loading"):(i[l].classList.remove("c-stepper__item--loading"),i[l].classList.remove("c-stepper__item--loaded"),l-1>0&&(i[l-1].classList.remove("c-stepper__item--loading"),i[l-1].classList.remove("c-stepper__item--loaded"),setTimeout(()=>{const d=i[l-1].querySelector(".c-stepper__loader");i[l-1].classList.add("c-stepper__item--loading"),d&&d instanceof HTMLElement&&(d.style.transition=`width ${s/1e3}s linear`)},0)))}if(e.clientWidth<e.scrollLeft){let l=e.scrollLeft;switch(n){case"three-columns-articles":l-=e.clientWidth+32;break;case"rubrics":l-=e.clientWidth-36;break;default:l-=Math.ceil(e.clientWidth*.6);break}e.scrollTo({left:l,behavior:"smooth"}),t.classList.add("o-nav-button--visible"),l===0&&o.classList.remove("o-nav-button--visible")}else e.scrollTo({left:0,behavior:"smooth"}),o.classList.remove("o-nav-button--visible"),e.clientWidth<e.scrollWidth&&t.classList.add("o-nav-button--visible")}},Z=({navigatedList:e,nextBtn:t,prevBtn:o})=>{J({navigatedList:e,nextBtn:t,prevBtn:o})},ee=()=>{const e=document.querySelectorAll(".js-navigation-container");for(const t of Array.from(e)){const{sliderVariant:o}=t.dataset,{sliderAuto:n}=t.dataset,{sliderDelay:s}=t.dataset,r=s?parseInt(s,10):3e3,a=t.closest(".js-overview-bar-container"),i=a==null?void 0:a.querySelector(".c-stepper"),l=i==null?void 0:i.querySelectorAll(".c-stepper__item");if(t){const d=t.querySelector(".js-navigation-container__list"),u=t.querySelector(".o-nav-button--next-button"),f=t.querySelector(".o-nav-button--previous-button");if(d&&d.clientWidth<d.scrollWidth&&(u==null||u.classList.add("o-nav-button--visible")),d&&u&&f&&(u==null||u.addEventListener("click",Q.bind(!1,{navigatedList:d,nextBtn:u,prevBtn:f,sliderVariant:o})),f==null||f.addEventListener("click",U.bind(!1,{navigatedList:d,nextBtn:u,prevBtn:f,sliderVariant:o,delay:r}))),n==="true"&&u){const g=i?i.querySelector(".c-stepper__item--loading"):null;l&&(l.forEach(y=>{const m=y.querySelector(".c-stepper__loader");m&&m instanceof HTMLElement&&(m.style.transition=`width ${r/1e3}s linear`)}),g||l[0].classList.add("c-stepper__item--loading")),setInterval(()=>{u.classList.contains("o-nav-button--visible")?u.click():d&&f&&(d.scrollLeft=0,l&&(l.forEach(y=>{const m=y.querySelector(".c-stepper__loader");m&&m instanceof HTMLElement&&(m.style.transition="width 0s linear"),y.classList.remove("c-stepper__item--loading"),y.classList.remove("c-stepper__item--loaded"),setTimeout(()=>{m&&m instanceof HTMLElement&&(m.style.transition=`width ${r/1e3}s linear`)},0)}),setTimeout(()=>{l[0].classList.add("c-stepper__item--loading")},0)),f.click())},r)}}}},te=()=>{const e=document.querySelectorAll(".js-navigation-container");for(const t of Array.from(e))if(t){const o=t.querySelector(".js-navigation-container__list"),n=t.querySelector(".o-nav-button--next-button"),s=t.querySelector(".o-nav-button--previous-button");o&&n&&s&&window.addEventListener("resize",Z.bind(!1,{navigatedList:o,nextBtn:n,prevBtn:s}))}},oe=()=>{const e=document.querySelector(".js-limit-scroll-progress-bar"),t=document.querySelector(".c-progress__bar");if(!t)return;const{documentElement:o}=document;let n=o.scrollHeight-o.clientHeight;if(!n)return;const s=o.scrollTop;e&&(n=e.scrollHeight-o.clientHeight+(window.pageYOffset+e.getBoundingClientRect().top));const r=Math.round(s/n*100);t.style.width=`${r}%`,r>=100&&(t.style.width="100%")},ne=()=>{document.querySelector(".c-progress")&&window.addEventListener("scroll",oe)};let v,T=0;const se=()=>{v=null,document.body.getBoundingClientRect().top>T+2&&(v="up"),document.body.getBoundingClientRect().top<T-2&&(v="down"),T=document.body.getBoundingClientRect().top;const e=document.querySelector(".c-read-also-banner");if(e){const t=e.dataset.bannerLimitTop||"0";v==="up"&&-document.body.getBoundingClientRect().top>=parseInt(t,10)&&(e.classList.remove("c-read-also-banner__scrolldirection--down"),e.style.paddingTop="0.75em",e.style.paddingBottom="0.75em",e.style.borderWidth="1px",e.classList.contains("c-read-also-banner__scrolldirection--up")||e.classList.add("c-read-also-banner__scrolldirection--up")),(v==="down"||-document.body.getBoundingClientRect().top<=parseInt(t,10))&&(e.classList.remove("c-read-also-banner__scrolldirection--up"),e.style.paddingTop="0",e.style.paddingBottom="0",e.style.borderWidth="0",e.classList.contains("c-read-also-banner__scrolldirection--down")||e.classList.add("c-read-also-banner__scrolldirection--down"))}},ie=(e=document.querySelector(".c-read-also-banner"))=>{if(e){let t;window.addEventListener("scroll",()=>{clearTimeout(t),t=setTimeout(se,100)})}},_="#page-content",$="#text-tooltip",re=".tooltip-btn",M="c-text-tooltip--show",le=["#page-content .c-content p","#page-content .c-content h2","#page-content .c-content h3","#page-content .c-content h4","#page-content .c-content h5","#page-content .c-content h6","#page-content .c-content li","#page-content .c-content span","#page-content header span","#page-content header h1","#page-content header h2"],H=(e,t)=>e instanceof Element?t.some(o=>e.matches(o)):!1,ce=(e,t)=>{const o=e.startContainer.nodeType===Node.ELEMENT_NODE?e.startContainer:e.startContainer.parentElement,n=e.endContainer.nodeType===Node.ELEMENT_NODE?e.endContainer:e.endContainer.parentElement;return!!o&&H(o,t)||!!n&&H(n,t)},ae=e=>{var o;if(!e.focusNode)return null;const t=(o=e.anchorNode)==null?void 0:o.compareDocumentPosition(e.focusNode);return t?(t&4)>0:e.anchorOffset<e.focusOffset},de=(e,t,o)=>{const n=document.querySelector(`${_} ${$}`),s=document.querySelector(`${_}`),r=document.querySelectorAll(`${_} ${$} ${re}`);if(!n||!s){console.warn("Text tooltip : Tooltip or it's parent are not found in the DOM");return}Array.from(r).forEach(l=>l.setAttribute("data-selected-text",o));const a=e.getClientRects(),i=a[t?a.length-1:0];n.style.top=`${i.top-s.getBoundingClientRect().top-(n.offsetHeight+10)}px`,i.width<n.offsetWidth?n.style.left=`${i.left-s.getBoundingClientRect().left+i.width/2-n.offsetWidth/2}px`:t?n.style.left=`${i.left-s.getBoundingClientRect().left+i.width-n.offsetWidth}px`:n.style.left=`${i.left-s.getBoundingClientRect().left}px`,n.classList.add(M)},R=()=>{const e=document.querySelector(`${$}`);e&&e.classList.remove(M)},w=({type:e})=>{const t=window.getSelection();if(e==="selectionchange"){R();return}if(!t||!t.rangeCount)return;const o=t.getRangeAt(0),n=t.toString().trim();if(n.length){const s=ce(o,le),r=ae(t)||!1;s&&de(o,r,n);return}R()},ue=()=>{if(!(window!=null&&window.getSelection)){console.warn("Selection API isn't supported");return}document.addEventListener("mouseup",w),document.addEventListener("selectionchange",w),document.addEventListener("touchend",w),document.addEventListener("touchcancel",w)},fe=e=>{const{target:t}=e;if(t instanceof Element){const o=t.closest(".c-search-form--button");o&&(e.preventDefault(),o.classList.remove("c-search-form--button"))}},he=(e=document.querySelector(".c-search-form--button"))=>{e&&e.addEventListener("click",t=>{fe(t)})},pe=({tabsContainerElement:e,event:t})=>{t.preventDefault();const o=t.target;if(!(o instanceof HTMLButtonElement))return;const n=e.querySelectorAll('[role="tab"]'),s=e.querySelectorAll('[role="tabpanel"]'),r=o.getAttribute("aria-controls"),a=Object.values(s).find(i=>i.id===r);n.forEach(i=>{i.setAttribute("aria-selected","false")}),s.forEach(i=>{i.setAttribute("aria-hidden","true")}),o.setAttribute("aria-selected","true"),a&&a.removeAttribute("aria-hidden")},D=e=>e.code==="ArrowLeft"||e.keyCode===39,W=e=>e.code==="ArrowRight"||e.keyCode===37,me=(e=document.querySelectorAll(".js-tabs"))=>{e.length>0&&e.forEach(t=>{const o=t.querySelectorAll('[role="tab"]');o.forEach(s=>{s.addEventListener("click",r=>{pe({tabsContainerElement:t,event:r})})});const n=t.querySelector('[role="tablist"]');if(n&&o.length>0){let s=0;n.addEventListener("keydown",r=>{r instanceof KeyboardEvent&&(D(r)||W(r))&&(o[s].setAttribute("tabindex","-1"),D(r)?(s+=1,s>=o.length&&(s=0)):W(r)&&(s-=1,s<0&&(s=o.length-1)),o[s].setAttribute("tabindex","0"),o[s].focus())})}})},be=()=>{P(),me(),j(),ne(),X(),ie(),he(),F("olympicsGames","countdown-olympics-games"),ue(),h(),ee(),te()};p.initScripts=be,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})}); |
{ | ||
"name": "@20minutes/hela", | ||
"version": "1.8.4", | ||
"version": "1.8.5", | ||
"repository": "git@github.com:20minutes/hela.git", | ||
@@ -85,9 +85,9 @@ "license": "MIT", | ||
"@svgr/cli": "^8.1.0", | ||
"@testing-library/react": "^14.2.2", | ||
"@testing-library/react": "^14.3.0", | ||
"@types/merge-stream": "^1.1.5", | ||
"@types/node": "^20.12.5", | ||
"@types/react": "^18.2.74", | ||
"@types/react": "^18.2.75", | ||
"@types/react-dom": "^18.2.24", | ||
"@typescript-eslint/eslint-plugin": "^7.5.0", | ||
"@typescript-eslint/parser": "^7.5.0", | ||
"@typescript-eslint/eslint-plugin": "^7.6.0", | ||
"@typescript-eslint/parser": "^7.6.0", | ||
"@vitejs/plugin-react": "^4.2.1", | ||
@@ -94,0 +94,0 @@ "autoprefixer": "^10.4.19", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1481380