@20minutes/hela
Advanced tools
Comparing version 0.1.115 to 0.1.116
@@ -20,5 +20,4 @@ import React from 'react'; | ||
credits?: string; | ||
isCaptionInside?: boolean; | ||
layout?: LayoutType; | ||
} | ||
export declare const ArticleCover: React.FC<ArticleCoverProps>; |
@@ -8,2 +8,3 @@ export * from './AlertInfoBanner'; | ||
export * from './Comment'; | ||
export * from './ContactForm'; | ||
export * from './ContactDetailsBlock'; | ||
@@ -14,2 +15,4 @@ export * from './ErrorContent'; | ||
export * from './InfoBanner'; | ||
export * from './ListWithDiode'; | ||
export * from './Live'; | ||
export * from './Menu'; | ||
@@ -32,2 +35,1 @@ export * from './MostReadArticles'; | ||
export * from './Tiles'; | ||
export * from './ListWithDiode'; |
@@ -404,2 +404,5 @@ export declare const tokenVariables: { | ||
}; | ||
publicommunique: { | ||
value: string; | ||
}; | ||
c2c: { | ||
@@ -406,0 +409,0 @@ value: string; |
@@ -24,11 +24,22 @@ var S = /* @__PURE__ */ ((e) => (e.MOBILE = "mobile", e.DESKTOP = "desktop", e))(S || {}); | ||
e.setAttribute("aria-expanded", "false"), t.innerHTML = "Voir plus", (s = e.previousElementSibling) == null || s.setAttribute("aria-hidden", "true"); | ||
}, $ = (e) => { | ||
}, j = (e) => { | ||
const t = e.currentTarget; | ||
return e.preventDefault(), t.getAttribute("aria-expanded") === "true" ? x(t) : T(t); | ||
}, j = (e = document.querySelector( | ||
}, $ = (e = document.querySelector( | ||
".js-expandButton" | ||
)) => { | ||
e && document.querySelectorAll(".js-expandButton").forEach((s) => s.addEventListener("click", $)); | ||
e && document.querySelectorAll(".js-expandButton").forEach((s) => s.addEventListener("click", j)); | ||
}, O = (e) => { | ||
const t = e.querySelector(".js-live-form__textarea"), s = e.querySelector("#live-form-submit-section"); | ||
t == null || t.setAttribute("aria-expanded", "true"), s == null || s.setAttribute("aria-hidden", "false"); | ||
}, W = () => { | ||
const e = document.querySelector(".js-live-form"); | ||
if (e) { | ||
const t = e.querySelector( | ||
".js-live-form__textarea textarea" | ||
); | ||
t == null || t.addEventListener("focus", O.bind(!1, e)); | ||
} | ||
}; | ||
var W = [ | ||
var I = [ | ||
'a[href]:not([tabindex^="-"])', | ||
@@ -46,3 +57,3 @@ 'area[href]:not([tabindex^="-"])', | ||
'[tabindex]:not([tabindex^="-"])' | ||
], I = "Tab", O = "Escape"; | ||
], D = "Tab", F = "Escape"; | ||
function u(e) { | ||
@@ -93,4 +104,4 @@ this._show = this.show.bind(this), this._hide = this.hide.bind(this), this._maintainFocus = this._maintainFocus.bind(this), this._bindKeypress = this._bindKeypress.bind(this), this.$el = e, this.shown = !1, this._id = this.$el.getAttribute("data-a11y-dialog") || this.$el.id, this._previouslyFocused = null, this._listeners = {}, this.create(); | ||
this.$el.dispatchEvent(i), s.forEach( | ||
function(n) { | ||
n(this.$el, t); | ||
function(r) { | ||
r(this.$el, t); | ||
}.bind(this) | ||
@@ -101,3 +112,3 @@ ); | ||
const t = document.activeElement; | ||
t && t.closest('[aria-modal="true"]') !== this.$el || (this.shown && e.key === O && this.$el.getAttribute("role") !== "alertdialog" && (e.preventDefault(), this.hide(e)), this.shown && e.key === I && H(this.$el, e)); | ||
t && t.closest('[aria-modal="true"]') !== this.$el || (this.shown && e.key === F && this.$el.getAttribute("role") !== "alertdialog" && (e.preventDefault(), this.hide(e)), this.shown && e.key === D && M(this.$el, e)); | ||
}; | ||
@@ -107,7 +118,7 @@ u.prototype._maintainFocus = function(e) { | ||
}; | ||
function D(e) { | ||
function H(e) { | ||
return Array.prototype.slice.call(e); | ||
} | ||
function p(e, t) { | ||
return D((t || document).querySelectorAll(e)); | ||
return H((t || document).querySelectorAll(e)); | ||
} | ||
@@ -119,7 +130,7 @@ function L(e) { | ||
function C(e) { | ||
return p(W.join(","), e).filter(function(t) { | ||
return p(I.join(","), e).filter(function(t) { | ||
return !!(t.offsetWidth || t.offsetHeight || t.getClientRects().length); | ||
}); | ||
} | ||
function H(e, t) { | ||
function M(e, t) { | ||
var s = C(e), i = s.indexOf(document.activeElement); | ||
@@ -134,8 +145,8 @@ t.shiftKey && i === 0 ? (s[s.length - 1].focus(), t.preventDefault()) : !t.shiftKey && i === s.length - 1 && (s[0].focus(), t.preventDefault()); | ||
typeof document < "u" && (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", _) : window.requestAnimationFrame ? window.requestAnimationFrame(_) : window.setTimeout(_, 16)); | ||
const F = (e = document.querySelector(".js-modal")) => { | ||
const R = (e = document.querySelector(".js-modal")) => { | ||
e && new u(e); | ||
}, M = ({ navigatedList: e, nextBtn: t, prevBtn: s }) => { | ||
const i = e.scrollLeft > 0, n = e.scrollLeft + e.clientWidth < e.scrollWidth; | ||
i && n ? (t.classList.add("o-nav-button--visible"), s.classList.add("o-nav-button--visible")) : i ? (t.classList.remove("o-nav-button--visible"), s.classList.add("o-nav-button--visible")) : n ? (t.classList.add("o-nav-button--visible"), s.classList.remove("o-nav-button--visible")) : (t.classList.remove("o-nav-button--visible"), s.classList.remove("o-nav-button--visible")); | ||
}, R = ({ | ||
}, K = ({ navigatedList: e, nextBtn: t, prevBtn: s }) => { | ||
const i = e.scrollLeft > 0, r = e.scrollLeft + e.clientWidth < e.scrollWidth; | ||
i && r ? (t.classList.add("o-nav-button--visible"), s.classList.add("o-nav-button--visible")) : i ? (t.classList.remove("o-nav-button--visible"), s.classList.add("o-nav-button--visible")) : r ? (t.classList.add("o-nav-button--visible"), s.classList.remove("o-nav-button--visible")) : (t.classList.remove("o-nav-button--visible"), s.classList.remove("o-nav-button--visible")); | ||
}, P = ({ | ||
navigatedList: e, | ||
@@ -147,6 +158,6 @@ nextBtn: t, | ||
if (e) { | ||
const n = e.closest(".js-overview-bar-container"), c = n == null ? void 0 : n.querySelector(".c-stepper"), l = c == null ? void 0 : c.querySelectorAll(".c-stepper__item"); | ||
const r = e.closest(".js-overview-bar-container"), c = r == null ? void 0 : r.querySelector(".c-stepper"), l = c == null ? void 0 : c.querySelectorAll(".c-stepper__item"); | ||
if (l) { | ||
const o = Array.from(l).findIndex( | ||
(r) => r.classList.contains("c-stepper__item--loading") | ||
(n) => n.classList.contains("c-stepper__item--loading") | ||
); | ||
@@ -157,4 +168,4 @@ if (o < 0) | ||
l[o].classList.remove("c-stepper__item--loading"), l[o].classList.add("c-stepper__item--loaded"); | ||
const r = l[o].querySelector(".c-stepper__loader"); | ||
r && r instanceof HTMLElement && (r.style.transition = "width 0s linear"), o + 1 < l.length && l[o + 1].classList.add("c-stepper__item--loading"); | ||
const n = l[o].querySelector(".c-stepper__loader"); | ||
n && n instanceof HTMLElement && (n.style.transition = "width 0s linear"), o + 1 < l.length && l[o + 1].classList.add("c-stepper__item--loading"); | ||
} | ||
@@ -190,3 +201,3 @@ } | ||
} | ||
}, K = ({ | ||
}, B = ({ | ||
navigatedList: e, | ||
@@ -196,3 +207,3 @@ nextBtn: t, | ||
sliderVariant: i, | ||
delay: n | ||
delay: r | ||
}) => { | ||
@@ -202,30 +213,30 @@ if (e) { | ||
if (o) { | ||
const r = Array.from(o).findIndex( | ||
const n = Array.from(o).findIndex( | ||
(a) => a.classList.contains("c-stepper__item--loading") | ||
); | ||
r < 0 ? o[0].classList.add("c-stepper__item--loading") : (o[r].classList.remove("c-stepper__item--loading"), o[r].classList.remove("c-stepper__item--loaded"), r - 1 > 0 && (o[r - 1].classList.remove("c-stepper__item--loading"), o[r - 1].classList.remove("c-stepper__item--loaded"), setTimeout(() => { | ||
const a = o[r - 1].querySelector(".c-stepper__loader"); | ||
o[r - 1].classList.add("c-stepper__item--loading"), a && a instanceof HTMLElement && (a.style.transition = `width ${n / 1e3}s linear`); | ||
n < 0 ? o[0].classList.add("c-stepper__item--loading") : (o[n].classList.remove("c-stepper__item--loading"), o[n].classList.remove("c-stepper__item--loaded"), n - 1 > 0 && (o[n - 1].classList.remove("c-stepper__item--loading"), o[n - 1].classList.remove("c-stepper__item--loaded"), setTimeout(() => { | ||
const a = o[n - 1].querySelector(".c-stepper__loader"); | ||
o[n - 1].classList.add("c-stepper__item--loading"), a && a instanceof HTMLElement && (a.style.transition = `width ${r / 1e3}s linear`); | ||
}, 0))); | ||
} | ||
if (e.clientWidth < e.scrollLeft) { | ||
let r = e.scrollLeft; | ||
let n = e.scrollLeft; | ||
switch (i) { | ||
case "partners": | ||
r -= e.clientWidth + 32; | ||
n -= e.clientWidth + 32; | ||
break; | ||
case "rubrics": | ||
r -= e.clientWidth - 36; | ||
n -= e.clientWidth - 36; | ||
break; | ||
case "overviewbar": | ||
r -= e.clientWidth - 24; | ||
n -= e.clientWidth - 24; | ||
break; | ||
default: | ||
r -= Math.ceil(e.clientWidth * 0.6); | ||
n -= Math.ceil(e.clientWidth * 0.6); | ||
break; | ||
} | ||
e.scrollTo({ | ||
left: r, | ||
left: n, | ||
behavior: "smooth" | ||
}), t.classList.add("o-nav-button--visible"), r === 0 && s.classList.remove("o-nav-button--visible"); | ||
}), t.classList.add("o-nav-button--visible"), n === 0 && s.classList.remove("o-nav-button--visible"); | ||
} else | ||
@@ -237,4 +248,4 @@ e.scrollTo({ | ||
} | ||
}, P = ({ navigatedList: e, nextBtn: t, prevBtn: s }) => { | ||
M({ | ||
}, V = ({ navigatedList: e, nextBtn: t, prevBtn: s }) => { | ||
K({ | ||
navigatedList: e, | ||
@@ -244,6 +255,6 @@ nextBtn: t, | ||
}); | ||
}, B = () => { | ||
}, z = () => { | ||
const e = document.querySelectorAll(".js-navigation-container"); | ||
for (const t of Array.from(e)) { | ||
const { sliderVariant: s } = t.dataset, { sliderAuto: i } = t.dataset, { sliderDelay: n } = t.dataset, c = n ? parseInt(n, 10) : 3e3, l = t.closest(".js-overview-bar-container"), o = l == null ? void 0 : l.querySelector(".c-stepper"), r = o == null ? void 0 : o.querySelectorAll(".c-stepper__item"); | ||
const { sliderVariant: s } = t.dataset, { sliderAuto: i } = t.dataset, { sliderDelay: r } = t.dataset, c = r ? parseInt(r, 10) : 3e3, l = t.closest(".js-overview-bar-container"), o = l == null ? void 0 : l.querySelector(".c-stepper"), n = o == null ? void 0 : o.querySelectorAll(".c-stepper__item"); | ||
if (t) { | ||
@@ -259,3 +270,3 @@ const a = t.querySelector( | ||
"click", | ||
R.bind(!1, { | ||
P.bind(!1, { | ||
navigatedList: a, | ||
@@ -268,3 +279,3 @@ nextBtn: d, | ||
"click", | ||
K.bind(!1, { | ||
B.bind(!1, { | ||
navigatedList: a, | ||
@@ -278,7 +289,7 @@ nextBtn: d, | ||
const w = o ? o.querySelector(".c-stepper__item--loading") : null; | ||
r && (r.forEach((b) => { | ||
n && (n.forEach((b) => { | ||
const h = b.querySelector(".c-stepper__loader"); | ||
h && h instanceof HTMLElement && (h.style.transition = `width ${c / 1e3}s linear`); | ||
}), w || r[0].classList.add("c-stepper__item--loading")), setInterval(() => { | ||
d.classList.contains("o-nav-button--visible") ? d.click() : a && f && (a.scrollLeft = 0, r && (r.forEach((b) => { | ||
}), w || n[0].classList.add("c-stepper__item--loading")), setInterval(() => { | ||
d.classList.contains("o-nav-button--visible") ? d.click() : a && f && (a.scrollLeft = 0, n && (n.forEach((b) => { | ||
const h = b.querySelector(".c-stepper__loader"); | ||
@@ -289,3 +300,3 @@ h && h instanceof HTMLElement && (h.style.transition = "width 0s linear"), b.classList.remove("c-stepper__item--loading"), b.classList.remove("c-stepper__item--loaded"), setTimeout(() => { | ||
}), setTimeout(() => { | ||
r[0].classList.add("c-stepper__item--loading"); | ||
n[0].classList.add("c-stepper__item--loading"); | ||
}, 0)), f.click()); | ||
@@ -296,3 +307,3 @@ }, c); | ||
} | ||
}, V = () => { | ||
}, N = () => { | ||
const e = document.querySelectorAll(".js-navigation-container"); | ||
@@ -304,3 +315,3 @@ for (const t of Array.from(e)) { | ||
".js-navigation-container__list" | ||
), n = t.querySelector( | ||
), r = t.querySelector( | ||
".o-nav-button--next-button" | ||
@@ -312,5 +323,5 @@ ), c = t.querySelector( | ||
"resize", | ||
P.bind(!1, { | ||
V.bind(!1, { | ||
navigatedList: i, | ||
nextBtn: n, | ||
nextBtn: r, | ||
prevBtn: c, | ||
@@ -322,3 +333,3 @@ sliderVariant: s | ||
} | ||
}, z = () => { | ||
}, Y = () => { | ||
const e = document.querySelectorAll(".js-header-link"), t = document.querySelector(".js-overlay"); | ||
@@ -339,3 +350,3 @@ if (t) | ||
}); | ||
}, N = () => { | ||
}, G = () => { | ||
const e = document.querySelector(".js-limit-scroll-progress-bar"), t = document.querySelector(".c-progress__bar"), { documentElement: s } = document; | ||
@@ -347,11 +358,11 @@ if (!t) | ||
return; | ||
const n = s.scrollTop; | ||
const r = s.scrollTop; | ||
e && (i = e.scrollHeight - s.clientHeight + (window.pageYOffset + e.getBoundingClientRect().top)); | ||
const c = Math.round(n / i * 100); | ||
const c = Math.round(r / i * 100); | ||
t.style.width = `${c}%`, c >= 100 && (t.style.width = "100%"); | ||
}, Y = () => { | ||
document.querySelector(".c-progress") && window.addEventListener("scroll", N); | ||
}, J = () => { | ||
document.querySelector(".c-progress") && window.addEventListener("scroll", G); | ||
}; | ||
let m, y = 0; | ||
const G = () => { | ||
const Q = () => { | ||
m = null, document.body.getBoundingClientRect().top > y + 2 && (m = "up"), document.body.getBoundingClientRect().top < y - 2 && (m = "down"), y = document.body.getBoundingClientRect().top; | ||
@@ -363,3 +374,3 @@ const e = document.querySelector(".c-read-also-banner"); | ||
} | ||
}, J = (e = document.querySelector( | ||
}, U = (e = document.querySelector( | ||
".c-read-also-banner" | ||
@@ -370,6 +381,6 @@ )) => { | ||
window.addEventListener("scroll", () => { | ||
clearTimeout(t), t = setTimeout(G, 100); | ||
clearTimeout(t), t = setTimeout(Q, 100); | ||
}); | ||
} | ||
}, Q = (e) => { | ||
}, X = (e) => { | ||
var i; | ||
@@ -379,3 +390,3 @@ e.preventDefault(); | ||
t.setAttribute("aria-hidden", "true"), s == null || s.setAttribute("aria-hidden", "false"); | ||
}, U = (e = document.querySelector( | ||
}, Z = (e = document.querySelector( | ||
".js-search-toggle" | ||
@@ -385,5 +396,5 @@ )) => { | ||
const t = e.querySelector(".c-header__search-button"); | ||
t == null || t.addEventListener("click", Q); | ||
t == null || t.addEventListener("click", X); | ||
} | ||
}, X = (e) => { | ||
}, ee = (e) => { | ||
e.stopImmediatePropagation(), e.preventDefault(); | ||
@@ -395,3 +406,3 @@ const t = e.currentTarget, s = t.parentElement, i = s == null ? void 0 : s.querySelector(".c-social-bar-item__sharebar-container"); | ||
!s || s.closest(".c-social-bar-item__sharebar-container") || s.closest(".c-social-bar-item") || (e.forEach((i) => { | ||
const n = i.parentElement, c = n == null ? void 0 : n.querySelector( | ||
const r = i.parentElement, c = r == null ? void 0 : r.querySelector( | ||
".c-social-bar-item__sharebar-container" | ||
@@ -404,3 +415,3 @@ ); | ||
)); | ||
}, Z = (e = document.querySelectorAll( | ||
}, te = (e = document.querySelectorAll( | ||
".js-social-network-button" | ||
@@ -410,3 +421,3 @@ )) => { | ||
t.addEventListener("click", (s) => { | ||
X(s); | ||
ee(s); | ||
}); | ||
@@ -417,3 +428,3 @@ }), document.addEventListener( | ||
); | ||
}, ee = ({ | ||
}, se = ({ | ||
tabsContainerElement: e, | ||
@@ -423,3 +434,3 @@ event: t | ||
t.preventDefault(); | ||
const s = t.target, i = e.querySelectorAll('[role="tab"]'), n = e.querySelectorAll('[role="tabpanel"]'), c = s.getAttribute("aria-controls"), l = Object.values(n).find( | ||
const s = t.target, i = e.querySelectorAll('[role="tab"]'), r = e.querySelectorAll('[role="tabpanel"]'), c = s.getAttribute("aria-controls"), l = Object.values(r).find( | ||
(o) => o.id === c | ||
@@ -429,11 +440,11 @@ ); | ||
o.setAttribute("aria-selected", "false"); | ||
}), n.forEach((o) => { | ||
}), r.forEach((o) => { | ||
o.setAttribute("aria-hidden", "true"); | ||
}), s.setAttribute("aria-selected", "true"), l && l.removeAttribute("aria-hidden"); | ||
}, v = (e) => e.code === "ArrowLeft" || e.keyCode === 39, g = (e) => e.code === "ArrowRight" || e.keyCode === 37, te = (e = document.querySelector(".js-tabs")) => { | ||
}, v = (e) => e.code === "ArrowLeft" || e.keyCode === 39, g = (e) => e.code === "ArrowRight" || e.keyCode === 37, ie = (e = document.querySelector(".js-tabs")) => { | ||
if (e) { | ||
const t = e.querySelectorAll('[role="tab"]'); | ||
t.forEach((i) => { | ||
i.addEventListener("click", (n) => { | ||
ee({ tabsContainerElement: e, event: n }); | ||
i.addEventListener("click", (r) => { | ||
se({ tabsContainerElement: e, event: r }); | ||
}); | ||
@@ -444,4 +455,4 @@ }); | ||
let i = 0; | ||
s.addEventListener("keydown", (n) => { | ||
n instanceof KeyboardEvent && (v(n) || g(n)) && (t[i].setAttribute("tabindex", "-1"), v(n) ? (i += 1, i >= t.length && (i = 0)) : g(n) && (i -= 1, i < 0 && (i = t.length - 1)), t[i].setAttribute("tabindex", "0"), t[i].focus()); | ||
s.addEventListener("keydown", (r) => { | ||
r instanceof KeyboardEvent && (v(r) || g(r)) && (t[i].setAttribute("tabindex", "-1"), v(r) ? (i += 1, i >= t.length && (i = 0)) : g(r) && (i -= 1, i < 0 && (i = t.length - 1)), t[i].setAttribute("tabindex", "0"), t[i].focus()); | ||
}); | ||
@@ -458,3 +469,3 @@ } | ||
i && (i.setAttribute("aria-hidden", String(s)), i.innerHTML = s ? "on" : "off"); | ||
}, se = (e = document.querySelector( | ||
}, oe = (e = document.querySelector( | ||
".js-switch-dark-mode" | ||
@@ -464,3 +475,3 @@ )) => { | ||
t && e && (document.documentElement.dataset.theme = t, A({ currentTheme: t, switchDarkModeElement: e })); | ||
}, ie = (e = document.querySelector( | ||
}, re = (e = document.querySelector( | ||
".js-switch-dark-mode" | ||
@@ -472,7 +483,7 @@ )) => { | ||
}); | ||
}, oe = () => { | ||
se(), ie(), j(), te(), k(), Y(), U(), F(), J(), B(), V(), window.layout === S.DESKTOP && (z(), Z()); | ||
}, ne = () => { | ||
oe(), re(), $(), ie(), k(), J(), Z(), R(), U(), W(), z(), N(), window.layout === S.DESKTOP && (Y(), te()); | ||
}; | ||
export { | ||
oe as initScripts | ||
ne as initScripts | ||
}; |
@@ -1,1 +0,1 @@ | ||
(function(b,p){typeof exports=="object"&&typeof module<"u"?p(exports):typeof define=="function"&&define.amd?define(["exports"],p):(b=typeof globalThis<"u"?globalThis:b||self,p(b.scripts={}))})(this,function(b){"use strict";var p=(e=>(e.MOBILE="mobile",e.DESKTOP="desktop",e))(p||{});const q=e=>{e.stopImmediatePropagation(),e.preventDefault();const t=e.currentTarget,i=t.parentElement,s=i==null?void 0:i.querySelector(`#${t.getAttribute("aria-controls")}`);t.getAttribute("aria-expanded")==="true"?(t.setAttribute("aria-expanded","false"),s==null||s.setAttribute("aria-hidden","true")):(t.setAttribute("aria-expanded","true"),s==null||s.setAttribute("aria-hidden","false"))},k=(e=document.querySelector(".js-collapse__button"))=>{e&&document.querySelectorAll(".c-collapse__button").forEach(i=>{i.addEventListener("click",s=>{q(s)})})},T=e=>{var i;const t=e.querySelector(".js-expandButton__label");e.setAttribute("aria-expanded","true"),t.innerHTML="Voir moins",(i=e.previousElementSibling)==null||i.setAttribute("aria-hidden","false")},x=e=>{var i;const t=e.querySelector(".js-expandButton__label");e.setAttribute("aria-expanded","false"),t.innerHTML="Voir plus",(i=e.previousElementSibling)==null||i.setAttribute("aria-hidden","true")},j=e=>{const t=e.currentTarget;return e.preventDefault(),t.getAttribute("aria-expanded")==="true"?x(t):T(t)},$=(e=document.querySelector(".js-expandButton"))=>{e&&document.querySelectorAll(".js-expandButton").forEach(i=>i.addEventListener("click",j))};var O=['a[href]:not([tabindex^="-"])','area[href]:not([tabindex^="-"])','input:not([type="hidden"]):not([type="radio"]):not([disabled]):not([tabindex^="-"])','input[type="radio"]:not([disabled]):not([tabindex^="-"])','select:not([disabled]):not([tabindex^="-"])','textarea:not([disabled]):not([tabindex^="-"])','button:not([disabled]):not([tabindex^="-"])','iframe:not([tabindex^="-"])','audio[controls]:not([tabindex^="-"])','video[controls]:not([tabindex^="-"])','[contenteditable]:not([tabindex^="-"])','[tabindex]:not([tabindex^="-"])'],W="Tab",I="Escape";function d(e){this._show=this.show.bind(this),this._hide=this.hide.bind(this),this._maintainFocus=this._maintainFocus.bind(this),this._bindKeypress=this._bindKeypress.bind(this),this.$el=e,this.shown=!1,this._id=this.$el.getAttribute("data-a11y-dialog")||this.$el.id,this._previouslyFocused=null,this._listeners={},this.create()}d.prototype.create=function(){this.$el.setAttribute("aria-hidden",!0),this.$el.setAttribute("aria-modal",!0),this.$el.setAttribute("tabindex",-1),this.$el.hasAttribute("role")||this.$el.setAttribute("role","dialog"),this._openers=m('[data-a11y-dialog-show="'+this._id+'"]'),this._openers.forEach(function(t){t.addEventListener("click",this._show)}.bind(this));const e=this.$el;return this._closers=m("[data-a11y-dialog-hide]",this.$el).filter(function(t){return t.closest('[aria-modal="true"], [data-a11y-dialog]')===e}).concat(m('[data-a11y-dialog-hide="'+this._id+'"]')),this._closers.forEach(function(t){t.addEventListener("click",this._hide)}.bind(this)),this._fire("create"),this},d.prototype.show=function(e){return this.shown?this:(this._previouslyFocused=document.activeElement,this.$el.removeAttribute("aria-hidden"),this.shown=!0,S(this.$el),document.body.addEventListener("focus",this._maintainFocus,!0),document.addEventListener("keydown",this._bindKeypress),this._fire("show",e),this)},d.prototype.hide=function(e){return this.shown?(this.shown=!1,this.$el.setAttribute("aria-hidden","true"),this._previouslyFocused&&this._previouslyFocused.focus&&this._previouslyFocused.focus(),document.body.removeEventListener("focus",this._maintainFocus,!0),document.removeEventListener("keydown",this._bindKeypress),this._fire("hide",e),this):this},d.prototype.destroy=function(){return this.hide(),this._openers.forEach(function(e){e.removeEventListener("click",this._show)}.bind(this)),this._closers.forEach(function(e){e.removeEventListener("click",this._hide)}.bind(this)),this._fire("destroy"),this._listeners={},this},d.prototype.on=function(e,t){return typeof this._listeners[e]>"u"&&(this._listeners[e]=[]),this._listeners[e].push(t),this},d.prototype.off=function(e,t){var i=(this._listeners[e]||[]).indexOf(t);return i>-1&&this._listeners[e].splice(i,1),this},d.prototype._fire=function(e,t){var i=this._listeners[e]||[],s=new CustomEvent(e,{detail:t});this.$el.dispatchEvent(s),i.forEach(function(n){n(this.$el,t)}.bind(this))},d.prototype._bindKeypress=function(e){const t=document.activeElement;t&&t.closest('[aria-modal="true"]')!==this.$el||(this.shown&&e.key===I&&this.$el.getAttribute("role")!=="alertdialog"&&(e.preventDefault(),this.hide(e)),this.shown&&e.key===W&&H(this.$el,e))},d.prototype._maintainFocus=function(e){this.shown&&!e.target.closest('[aria-modal="true"]')&&!e.target.closest("[data-a11y-dialog-ignore-focus-trap]")&&S(this.$el)};function D(e){return Array.prototype.slice.call(e)}function m(e,t){return D((t||document).querySelectorAll(e))}function S(e){var t=e.querySelector("[autofocus]")||e;t.focus()}function C(e){return m(O.join(","),e).filter(function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)})}function H(e,t){var i=C(e),s=i.indexOf(document.activeElement);t.shiftKey&&s===0?(i[i.length-1].focus(),t.preventDefault()):!t.shiftKey&&s===i.length-1&&(i[0].focus(),t.preventDefault())}function v(){m("[data-a11y-dialog]").forEach(function(e){new d(e)})}typeof document<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",v):window.requestAnimationFrame?window.requestAnimationFrame(v):window.setTimeout(v,16));const F=(e=document.querySelector(".js-modal"))=>{e&&new d(e)},M=({navigatedList:e,nextBtn:t,prevBtn:i})=>{const s=e.scrollLeft>0,n=e.scrollLeft+e.clientWidth<e.scrollWidth;s&&n?(t.classList.add("o-nav-button--visible"),i.classList.add("o-nav-button--visible")):s?(t.classList.remove("o-nav-button--visible"),i.classList.add("o-nav-button--visible")):n?(t.classList.add("o-nav-button--visible"),i.classList.remove("o-nav-button--visible")):(t.classList.remove("o-nav-button--visible"),i.classList.remove("o-nav-button--visible"))},R=({navigatedList:e,nextBtn:t,prevBtn:i,sliderVariant:s})=>{if(e){const n=e.closest(".js-overview-bar-container"),c=n==null?void 0:n.querySelector(".c-stepper"),l=c==null?void 0:c.querySelectorAll(".c-stepper__item");if(l){const o=Array.from(l).findIndex(r=>r.classList.contains("c-stepper__item--loading"));if(o<0)l[0].classList.add("c-stepper__item--loading");else{l[o].classList.remove("c-stepper__item--loading"),l[o].classList.add("c-stepper__item--loaded");const r=l[o].querySelector(".c-stepper__loader");r&&r instanceof HTMLElement&&(r.style.transition="width 0s linear"),o+1<l.length&&l[o+1].classList.add("c-stepper__item--loading")}}if(e.scrollWidth-e.clientWidth>e.clientWidth){let o=e.scrollLeft;switch(s){case"partners":o+=e.clientWidth+32;break;case"rubrics":o+=e.clientWidth-36;break;case"overviewbar":o+=e.clientWidth-20;break;default:o+=Math.ceil(e.clientWidth*.6);break}e.scrollTo({left:o,behavior:"smooth"}),i.classList.add("o-nav-button--visible"),o+e.clientWidth>=e.scrollWidth&&t.classList.remove("o-nav-button--visible")}else{const o=e.scrollWidth-e.clientWidth;e.scrollTo({left:o,behavior:"smooth"}),t.classList.remove("o-nav-button--visible"),i.classList.add("o-nav-button--visible")}}},K=({navigatedList:e,nextBtn:t,prevBtn:i,sliderVariant:s,delay:n})=>{if(e){const c=e.closest(".js-overview-bar-container"),l=c==null?void 0:c.querySelector(".c-stepper"),o=l==null?void 0:l.querySelectorAll(".c-stepper__item");if(o){const r=Array.from(o).findIndex(a=>a.classList.contains("c-stepper__item--loading"));r<0?o[0].classList.add("c-stepper__item--loading"):(o[r].classList.remove("c-stepper__item--loading"),o[r].classList.remove("c-stepper__item--loaded"),r-1>0&&(o[r-1].classList.remove("c-stepper__item--loading"),o[r-1].classList.remove("c-stepper__item--loaded"),setTimeout(()=>{const a=o[r-1].querySelector(".c-stepper__loader");o[r-1].classList.add("c-stepper__item--loading"),a&&a instanceof HTMLElement&&(a.style.transition=`width ${n/1e3}s linear`)},0)))}if(e.clientWidth<e.scrollLeft){let r=e.scrollLeft;switch(s){case"partners":r-=e.clientWidth+32;break;case"rubrics":r-=e.clientWidth-36;break;case"overviewbar":r-=e.clientWidth-24;break;default:r-=Math.ceil(e.clientWidth*.6);break}e.scrollTo({left:r,behavior:"smooth"}),t.classList.add("o-nav-button--visible"),r===0&&i.classList.remove("o-nav-button--visible")}else e.scrollTo({left:0,behavior:"smooth"}),i.classList.remove("o-nav-button--visible"),e.clientWidth<e.scrollWidth&&t.classList.add("o-nav-button--visible")}},P=({navigatedList:e,nextBtn:t,prevBtn:i})=>{M({navigatedList:e,nextBtn:t,prevBtn:i})},B=()=>{const e=document.querySelectorAll(".js-navigation-container");for(const t of Array.from(e)){const{sliderVariant:i}=t.dataset,{sliderAuto:s}=t.dataset,{sliderDelay:n}=t.dataset,c=n?parseInt(n,10):3e3,l=t.closest(".js-overview-bar-container"),o=l==null?void 0:l.querySelector(".c-stepper"),r=o==null?void 0:o.querySelectorAll(".c-stepper__item");if(t){const a=t.querySelector(".js-navigation-container__list"),u=t.querySelector(".o-nav-button--next-button"),h=t.querySelector(".o-nav-button--previous-button");if(a&&a.clientWidth<a.scrollWidth&&(u==null||u.classList.add("o-nav-button--visible")),u==null||u.addEventListener("click",R.bind(!1,{navigatedList:a,nextBtn:u,prevBtn:h,sliderVariant:i})),h==null||h.addEventListener("click",K.bind(!1,{navigatedList:a,nextBtn:u,prevBtn:h,sliderVariant:i,delay:c})),s==="true"&&u){const ne=o?o.querySelector(".c-stepper__item--loading"):null;r&&(r.forEach(_=>{const f=_.querySelector(".c-stepper__loader");f&&f instanceof HTMLElement&&(f.style.transition=`width ${c/1e3}s linear`)}),ne||r[0].classList.add("c-stepper__item--loading")),setInterval(()=>{u.classList.contains("o-nav-button--visible")?u.click():a&&h&&(a.scrollLeft=0,r&&(r.forEach(_=>{const f=_.querySelector(".c-stepper__loader");f&&f instanceof HTMLElement&&(f.style.transition="width 0s linear"),_.classList.remove("c-stepper__item--loading"),_.classList.remove("c-stepper__item--loaded"),setTimeout(()=>{f&&f instanceof HTMLElement&&(f.style.transition=`width ${c/1e3}s linear`)},0)}),setTimeout(()=>{r[0].classList.add("c-stepper__item--loading")},0)),h.click())},c)}}}},V=()=>{const e=document.querySelectorAll(".js-navigation-container");for(const t of Array.from(e)){const{sliderVariant:i}=t.dataset;if(t){const s=t.querySelector(".js-navigation-container__list"),n=t.querySelector(".o-nav-button--next-button"),c=t.querySelector(".o-nav-button--previous-button");window.addEventListener("resize",P.bind(!1,{navigatedList:s,nextBtn:n,prevBtn:c,sliderVariant:i}))}}},z=()=>{const e=document.querySelectorAll(".js-header-link"),t=document.querySelector(".js-overlay");if(t)for(const i of e)i.addEventListener("mouseenter",()=>{const s=i.querySelector(".js-sub-menu");if(s){if(window.getComputedStyle(s).getPropertyValue("display")!=="none"){t.classList.remove("u-hidden");return}t.classList.add("u-hidden")}}),i.addEventListener("mouseleave",()=>{t.classList.add("u-hidden")})},N=()=>{const e=document.querySelector(".js-limit-scroll-progress-bar"),t=document.querySelector(".c-progress__bar"),{documentElement:i}=document;if(!t)return;let s=i.scrollHeight-i.clientHeight;if(!s)return;const n=i.scrollTop;e&&(s=e.scrollHeight-i.clientHeight+(window.pageYOffset+e.getBoundingClientRect().top));const c=Math.round(n/s*100);t.style.width=`${c}%`,c>=100&&(t.style.width="100%")},Y=()=>{document.querySelector(".c-progress")&&window.addEventListener("scroll",N)};let y,g=0;const G=()=>{y=null,document.body.getBoundingClientRect().top>g+2&&(y="up"),document.body.getBoundingClientRect().top<g-2&&(y="down"),g=document.body.getBoundingClientRect().top;const e=document.querySelector(".c-read-also-banner");if(e){const t=e.dataset.bannerLimitTop||"0";y==="up"&&-document.body.getBoundingClientRect().top>=parseInt(t,10)&&(e.classList.remove("c-read-also-banner__scrolldirection--down"),e.style.paddingTop="1.5em",e.style.paddingBottom="1.5em",e.classList.contains("c-read-also-banner__scrolldirection--up")||e.classList.add("c-read-also-banner__scrolldirection--up")),(y==="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.classList.contains("c-read-also-banner__scrolldirection--down")||e.classList.add("c-read-also-banner__scrolldirection--down"))}},J=(e=document.querySelector(".c-read-also-banner"))=>{if(e){let t;window.addEventListener("scroll",()=>{clearTimeout(t),t=setTimeout(G,100)})}},Q=e=>{var s;e.preventDefault();const t=e.currentTarget,i=(s=t.closest(".js-search-toggle"))==null?void 0:s.querySelector(".c-search-form");t.setAttribute("aria-hidden","true"),i==null||i.setAttribute("aria-hidden","false")},U=(e=document.querySelector(".js-search-toggle"))=>{if(e){const t=e.querySelector(".c-header__search-button");t==null||t.addEventListener("click",Q)}},X=e=>{e.stopImmediatePropagation(),e.preventDefault();const t=e.currentTarget,i=t.parentElement,s=i==null?void 0:i.querySelector(".c-social-bar-item__sharebar-container");s&&(t.getAttribute("aria-expanded")==="true"?(t.setAttribute("aria-expanded","false"),s.setAttribute("aria-hidden","true"),s.classList.add("c-social-bar-item__sharebar-container--visible")):(t.setAttribute("aria-expanded","true"),s.setAttribute("aria-hidden","false"),s.classList.remove("c-social-bar-item__sharebar-container--visible")))},L=(e,t)=>{const i=t.target;!i||i.closest(".c-social-bar-item__sharebar-container")||i.closest(".c-social-bar-item")||(e.forEach(s=>{const n=s.parentElement,c=n==null?void 0:n.querySelector(".c-social-bar-item__sharebar-container");c&&(s.setAttribute("aria-expanded","true"),c.setAttribute("aria-hidden","false"),c.classList.remove("c-social-bar-item__sharebar-container--visible"))}),document.removeEventListener("click",L.bind(void 0,e)))},Z=(e=document.querySelectorAll(".js-social-network-button"))=>{e.forEach(t=>{t.addEventListener("click",i=>{X(i)})}),document.addEventListener("click",L.bind(void 0,e))},ee=({tabsContainerElement:e,event:t})=>{t.preventDefault();const i=t.target,s=e.querySelectorAll('[role="tab"]'),n=e.querySelectorAll('[role="tabpanel"]'),c=i.getAttribute("aria-controls"),l=Object.values(n).find(o=>o.id===c);s.forEach(o=>{o.setAttribute("aria-selected","false")}),n.forEach(o=>{o.setAttribute("aria-hidden","true")}),i.setAttribute("aria-selected","true"),l&&l.removeAttribute("aria-hidden")},E=e=>e.code==="ArrowLeft"||e.keyCode===39,A=e=>e.code==="ArrowRight"||e.keyCode===37,te=(e=document.querySelector(".js-tabs"))=>{if(e){const t=e.querySelectorAll('[role="tab"]');t.forEach(s=>{s.addEventListener("click",n=>{ee({tabsContainerElement:e,event:n})})});const i=e.querySelector('[role="tablist"]');if(i&&t.length>0){let s=0;i.addEventListener("keydown",n=>{n instanceof KeyboardEvent&&(E(n)||A(n))&&(t[s].setAttribute("tabindex","-1"),E(n)?(s+=1,s>=t.length&&(s=0)):A(n)&&(s-=1,s<0&&(s=t.length-1)),t[s].setAttribute("tabindex","0"),t[s].focus())})}}},w=({currentTheme:e,switchDarkModeElement:t})=>{const i=e==="dark";t.setAttribute("aria-checked",String(i));const s=t.querySelector("span[aria-hidden]");s&&(s.setAttribute("aria-hidden",String(i)),s.innerHTML=i?"on":"off")},ie=(e=document.querySelector(".js-switch-dark-mode"))=>{const t=localStorage.getItem("theme")||"light";t&&e&&(document.documentElement.dataset.theme=t,w({currentTheme:t,switchDarkModeElement:e}))},se=(e=document.querySelector(".js-switch-dark-mode"))=>{e&&e.addEventListener("click",()=>{const t=document.documentElement.dataset.theme,i=!t||t==="light"?"dark":"light";document.documentElement.dataset.theme=i,localStorage.setItem("theme",i),w({currentTheme:i,switchDarkModeElement:e})})},oe=()=>{ie(),se(),$(),te(),k(),Y(),U(),F(),J(),B(),V(),window.layout===p.DESKTOP&&(z(),Z())};b.initScripts=oe,Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})}); | ||
(function(b,m){typeof exports=="object"&&typeof module<"u"?m(exports):typeof define=="function"&&define.amd?define(["exports"],m):(b=typeof globalThis<"u"?globalThis:b||self,m(b.scripts={}))})(this,function(b){"use strict";var m=(e=>(e.MOBILE="mobile",e.DESKTOP="desktop",e))(m||{});const q=e=>{e.stopImmediatePropagation(),e.preventDefault();const t=e.currentTarget,i=t.parentElement,s=i==null?void 0:i.querySelector(`#${t.getAttribute("aria-controls")}`);t.getAttribute("aria-expanded")==="true"?(t.setAttribute("aria-expanded","false"),s==null||s.setAttribute("aria-hidden","true")):(t.setAttribute("aria-expanded","true"),s==null||s.setAttribute("aria-hidden","false"))},k=(e=document.querySelector(".js-collapse__button"))=>{e&&document.querySelectorAll(".c-collapse__button").forEach(i=>{i.addEventListener("click",s=>{q(s)})})},T=e=>{var i;const t=e.querySelector(".js-expandButton__label");e.setAttribute("aria-expanded","true"),t.innerHTML="Voir moins",(i=e.previousElementSibling)==null||i.setAttribute("aria-hidden","false")},x=e=>{var i;const t=e.querySelector(".js-expandButton__label");e.setAttribute("aria-expanded","false"),t.innerHTML="Voir plus",(i=e.previousElementSibling)==null||i.setAttribute("aria-hidden","true")},j=e=>{const t=e.currentTarget;return e.preventDefault(),t.getAttribute("aria-expanded")==="true"?x(t):T(t)},$=(e=document.querySelector(".js-expandButton"))=>{e&&document.querySelectorAll(".js-expandButton").forEach(i=>i.addEventListener("click",j))},O=e=>{const t=e.querySelector(".js-live-form__textarea"),i=e.querySelector("#live-form-submit-section");t==null||t.setAttribute("aria-expanded","true"),i==null||i.setAttribute("aria-hidden","false")},W=()=>{const e=document.querySelector(".js-live-form");if(e){const t=e.querySelector(".js-live-form__textarea textarea");t==null||t.addEventListener("focus",O.bind(!1,e))}};var I=['a[href]:not([tabindex^="-"])','area[href]:not([tabindex^="-"])','input:not([type="hidden"]):not([type="radio"]):not([disabled]):not([tabindex^="-"])','input[type="radio"]:not([disabled]):not([tabindex^="-"])','select:not([disabled]):not([tabindex^="-"])','textarea:not([disabled]):not([tabindex^="-"])','button:not([disabled]):not([tabindex^="-"])','iframe:not([tabindex^="-"])','audio[controls]:not([tabindex^="-"])','video[controls]:not([tabindex^="-"])','[contenteditable]:not([tabindex^="-"])','[tabindex]:not([tabindex^="-"])'],D="Tab",F="Escape";function d(e){this._show=this.show.bind(this),this._hide=this.hide.bind(this),this._maintainFocus=this._maintainFocus.bind(this),this._bindKeypress=this._bindKeypress.bind(this),this.$el=e,this.shown=!1,this._id=this.$el.getAttribute("data-a11y-dialog")||this.$el.id,this._previouslyFocused=null,this._listeners={},this.create()}d.prototype.create=function(){this.$el.setAttribute("aria-hidden",!0),this.$el.setAttribute("aria-modal",!0),this.$el.setAttribute("tabindex",-1),this.$el.hasAttribute("role")||this.$el.setAttribute("role","dialog"),this._openers=p('[data-a11y-dialog-show="'+this._id+'"]'),this._openers.forEach(function(t){t.addEventListener("click",this._show)}.bind(this));const e=this.$el;return this._closers=p("[data-a11y-dialog-hide]",this.$el).filter(function(t){return t.closest('[aria-modal="true"], [data-a11y-dialog]')===e}).concat(p('[data-a11y-dialog-hide="'+this._id+'"]')),this._closers.forEach(function(t){t.addEventListener("click",this._hide)}.bind(this)),this._fire("create"),this},d.prototype.show=function(e){return this.shown?this:(this._previouslyFocused=document.activeElement,this.$el.removeAttribute("aria-hidden"),this.shown=!0,S(this.$el),document.body.addEventListener("focus",this._maintainFocus,!0),document.addEventListener("keydown",this._bindKeypress),this._fire("show",e),this)},d.prototype.hide=function(e){return this.shown?(this.shown=!1,this.$el.setAttribute("aria-hidden","true"),this._previouslyFocused&&this._previouslyFocused.focus&&this._previouslyFocused.focus(),document.body.removeEventListener("focus",this._maintainFocus,!0),document.removeEventListener("keydown",this._bindKeypress),this._fire("hide",e),this):this},d.prototype.destroy=function(){return this.hide(),this._openers.forEach(function(e){e.removeEventListener("click",this._show)}.bind(this)),this._closers.forEach(function(e){e.removeEventListener("click",this._hide)}.bind(this)),this._fire("destroy"),this._listeners={},this},d.prototype.on=function(e,t){return typeof this._listeners[e]>"u"&&(this._listeners[e]=[]),this._listeners[e].push(t),this},d.prototype.off=function(e,t){var i=(this._listeners[e]||[]).indexOf(t);return i>-1&&this._listeners[e].splice(i,1),this},d.prototype._fire=function(e,t){var i=this._listeners[e]||[],s=new CustomEvent(e,{detail:t});this.$el.dispatchEvent(s),i.forEach(function(n){n(this.$el,t)}.bind(this))},d.prototype._bindKeypress=function(e){const t=document.activeElement;t&&t.closest('[aria-modal="true"]')!==this.$el||(this.shown&&e.key===F&&this.$el.getAttribute("role")!=="alertdialog"&&(e.preventDefault(),this.hide(e)),this.shown&&e.key===D&&M(this.$el,e))},d.prototype._maintainFocus=function(e){this.shown&&!e.target.closest('[aria-modal="true"]')&&!e.target.closest("[data-a11y-dialog-ignore-focus-trap]")&&S(this.$el)};function H(e){return Array.prototype.slice.call(e)}function p(e,t){return H((t||document).querySelectorAll(e))}function S(e){var t=e.querySelector("[autofocus]")||e;t.focus()}function C(e){return p(I.join(","),e).filter(function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)})}function M(e,t){var i=C(e),s=i.indexOf(document.activeElement);t.shiftKey&&s===0?(i[i.length-1].focus(),t.preventDefault()):!t.shiftKey&&s===i.length-1&&(i[0].focus(),t.preventDefault())}function v(){p("[data-a11y-dialog]").forEach(function(e){new d(e)})}typeof document<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",v):window.requestAnimationFrame?window.requestAnimationFrame(v):window.setTimeout(v,16));const R=(e=document.querySelector(".js-modal"))=>{e&&new d(e)},K=({navigatedList:e,nextBtn:t,prevBtn:i})=>{const s=e.scrollLeft>0,n=e.scrollLeft+e.clientWidth<e.scrollWidth;s&&n?(t.classList.add("o-nav-button--visible"),i.classList.add("o-nav-button--visible")):s?(t.classList.remove("o-nav-button--visible"),i.classList.add("o-nav-button--visible")):n?(t.classList.add("o-nav-button--visible"),i.classList.remove("o-nav-button--visible")):(t.classList.remove("o-nav-button--visible"),i.classList.remove("o-nav-button--visible"))},P=({navigatedList:e,nextBtn:t,prevBtn:i,sliderVariant:s})=>{if(e){const n=e.closest(".js-overview-bar-container"),c=n==null?void 0:n.querySelector(".c-stepper"),l=c==null?void 0:c.querySelectorAll(".c-stepper__item");if(l){const o=Array.from(l).findIndex(r=>r.classList.contains("c-stepper__item--loading"));if(o<0)l[0].classList.add("c-stepper__item--loading");else{l[o].classList.remove("c-stepper__item--loading"),l[o].classList.add("c-stepper__item--loaded");const r=l[o].querySelector(".c-stepper__loader");r&&r instanceof HTMLElement&&(r.style.transition="width 0s linear"),o+1<l.length&&l[o+1].classList.add("c-stepper__item--loading")}}if(e.scrollWidth-e.clientWidth>e.clientWidth){let o=e.scrollLeft;switch(s){case"partners":o+=e.clientWidth+32;break;case"rubrics":o+=e.clientWidth-36;break;case"overviewbar":o+=e.clientWidth-20;break;default:o+=Math.ceil(e.clientWidth*.6);break}e.scrollTo({left:o,behavior:"smooth"}),i.classList.add("o-nav-button--visible"),o+e.clientWidth>=e.scrollWidth&&t.classList.remove("o-nav-button--visible")}else{const o=e.scrollWidth-e.clientWidth;e.scrollTo({left:o,behavior:"smooth"}),t.classList.remove("o-nav-button--visible"),i.classList.add("o-nav-button--visible")}}},B=({navigatedList:e,nextBtn:t,prevBtn:i,sliderVariant:s,delay:n})=>{if(e){const c=e.closest(".js-overview-bar-container"),l=c==null?void 0:c.querySelector(".c-stepper"),o=l==null?void 0:l.querySelectorAll(".c-stepper__item");if(o){const r=Array.from(o).findIndex(a=>a.classList.contains("c-stepper__item--loading"));r<0?o[0].classList.add("c-stepper__item--loading"):(o[r].classList.remove("c-stepper__item--loading"),o[r].classList.remove("c-stepper__item--loaded"),r-1>0&&(o[r-1].classList.remove("c-stepper__item--loading"),o[r-1].classList.remove("c-stepper__item--loaded"),setTimeout(()=>{const a=o[r-1].querySelector(".c-stepper__loader");o[r-1].classList.add("c-stepper__item--loading"),a&&a instanceof HTMLElement&&(a.style.transition=`width ${n/1e3}s linear`)},0)))}if(e.clientWidth<e.scrollLeft){let r=e.scrollLeft;switch(s){case"partners":r-=e.clientWidth+32;break;case"rubrics":r-=e.clientWidth-36;break;case"overviewbar":r-=e.clientWidth-24;break;default:r-=Math.ceil(e.clientWidth*.6);break}e.scrollTo({left:r,behavior:"smooth"}),t.classList.add("o-nav-button--visible"),r===0&&i.classList.remove("o-nav-button--visible")}else e.scrollTo({left:0,behavior:"smooth"}),i.classList.remove("o-nav-button--visible"),e.clientWidth<e.scrollWidth&&t.classList.add("o-nav-button--visible")}},V=({navigatedList:e,nextBtn:t,prevBtn:i})=>{K({navigatedList:e,nextBtn:t,prevBtn:i})},z=()=>{const e=document.querySelectorAll(".js-navigation-container");for(const t of Array.from(e)){const{sliderVariant:i}=t.dataset,{sliderAuto:s}=t.dataset,{sliderDelay:n}=t.dataset,c=n?parseInt(n,10):3e3,l=t.closest(".js-overview-bar-container"),o=l==null?void 0:l.querySelector(".c-stepper"),r=o==null?void 0:o.querySelectorAll(".c-stepper__item");if(t){const a=t.querySelector(".js-navigation-container__list"),u=t.querySelector(".o-nav-button--next-button"),h=t.querySelector(".o-nav-button--previous-button");if(a&&a.clientWidth<a.scrollWidth&&(u==null||u.classList.add("o-nav-button--visible")),u==null||u.addEventListener("click",P.bind(!1,{navigatedList:a,nextBtn:u,prevBtn:h,sliderVariant:i})),h==null||h.addEventListener("click",B.bind(!1,{navigatedList:a,nextBtn:u,prevBtn:h,sliderVariant:i,delay:c})),s==="true"&&u){const ce=o?o.querySelector(".c-stepper__item--loading"):null;r&&(r.forEach(_=>{const f=_.querySelector(".c-stepper__loader");f&&f instanceof HTMLElement&&(f.style.transition=`width ${c/1e3}s linear`)}),ce||r[0].classList.add("c-stepper__item--loading")),setInterval(()=>{u.classList.contains("o-nav-button--visible")?u.click():a&&h&&(a.scrollLeft=0,r&&(r.forEach(_=>{const f=_.querySelector(".c-stepper__loader");f&&f instanceof HTMLElement&&(f.style.transition="width 0s linear"),_.classList.remove("c-stepper__item--loading"),_.classList.remove("c-stepper__item--loaded"),setTimeout(()=>{f&&f instanceof HTMLElement&&(f.style.transition=`width ${c/1e3}s linear`)},0)}),setTimeout(()=>{r[0].classList.add("c-stepper__item--loading")},0)),h.click())},c)}}}},N=()=>{const e=document.querySelectorAll(".js-navigation-container");for(const t of Array.from(e)){const{sliderVariant:i}=t.dataset;if(t){const s=t.querySelector(".js-navigation-container__list"),n=t.querySelector(".o-nav-button--next-button"),c=t.querySelector(".o-nav-button--previous-button");window.addEventListener("resize",V.bind(!1,{navigatedList:s,nextBtn:n,prevBtn:c,sliderVariant:i}))}}},Y=()=>{const e=document.querySelectorAll(".js-header-link"),t=document.querySelector(".js-overlay");if(t)for(const i of e)i.addEventListener("mouseenter",()=>{const s=i.querySelector(".js-sub-menu");if(s){if(window.getComputedStyle(s).getPropertyValue("display")!=="none"){t.classList.remove("u-hidden");return}t.classList.add("u-hidden")}}),i.addEventListener("mouseleave",()=>{t.classList.add("u-hidden")})},G=()=>{const e=document.querySelector(".js-limit-scroll-progress-bar"),t=document.querySelector(".c-progress__bar"),{documentElement:i}=document;if(!t)return;let s=i.scrollHeight-i.clientHeight;if(!s)return;const n=i.scrollTop;e&&(s=e.scrollHeight-i.clientHeight+(window.pageYOffset+e.getBoundingClientRect().top));const c=Math.round(n/s*100);t.style.width=`${c}%`,c>=100&&(t.style.width="100%")},J=()=>{document.querySelector(".c-progress")&&window.addEventListener("scroll",G)};let y,g=0;const Q=()=>{y=null,document.body.getBoundingClientRect().top>g+2&&(y="up"),document.body.getBoundingClientRect().top<g-2&&(y="down"),g=document.body.getBoundingClientRect().top;const e=document.querySelector(".c-read-also-banner");if(e){const t=e.dataset.bannerLimitTop||"0";y==="up"&&-document.body.getBoundingClientRect().top>=parseInt(t,10)&&(e.classList.remove("c-read-also-banner__scrolldirection--down"),e.style.paddingTop="1.5em",e.style.paddingBottom="1.5em",e.classList.contains("c-read-also-banner__scrolldirection--up")||e.classList.add("c-read-also-banner__scrolldirection--up")),(y==="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.classList.contains("c-read-also-banner__scrolldirection--down")||e.classList.add("c-read-also-banner__scrolldirection--down"))}},U=(e=document.querySelector(".c-read-also-banner"))=>{if(e){let t;window.addEventListener("scroll",()=>{clearTimeout(t),t=setTimeout(Q,100)})}},X=e=>{var s;e.preventDefault();const t=e.currentTarget,i=(s=t.closest(".js-search-toggle"))==null?void 0:s.querySelector(".c-search-form");t.setAttribute("aria-hidden","true"),i==null||i.setAttribute("aria-hidden","false")},Z=(e=document.querySelector(".js-search-toggle"))=>{if(e){const t=e.querySelector(".c-header__search-button");t==null||t.addEventListener("click",X)}},ee=e=>{e.stopImmediatePropagation(),e.preventDefault();const t=e.currentTarget,i=t.parentElement,s=i==null?void 0:i.querySelector(".c-social-bar-item__sharebar-container");s&&(t.getAttribute("aria-expanded")==="true"?(t.setAttribute("aria-expanded","false"),s.setAttribute("aria-hidden","true"),s.classList.add("c-social-bar-item__sharebar-container--visible")):(t.setAttribute("aria-expanded","true"),s.setAttribute("aria-hidden","false"),s.classList.remove("c-social-bar-item__sharebar-container--visible")))},L=(e,t)=>{const i=t.target;!i||i.closest(".c-social-bar-item__sharebar-container")||i.closest(".c-social-bar-item")||(e.forEach(s=>{const n=s.parentElement,c=n==null?void 0:n.querySelector(".c-social-bar-item__sharebar-container");c&&(s.setAttribute("aria-expanded","true"),c.setAttribute("aria-hidden","false"),c.classList.remove("c-social-bar-item__sharebar-container--visible"))}),document.removeEventListener("click",L.bind(void 0,e)))},te=(e=document.querySelectorAll(".js-social-network-button"))=>{e.forEach(t=>{t.addEventListener("click",i=>{ee(i)})}),document.addEventListener("click",L.bind(void 0,e))},ie=({tabsContainerElement:e,event:t})=>{t.preventDefault();const i=t.target,s=e.querySelectorAll('[role="tab"]'),n=e.querySelectorAll('[role="tabpanel"]'),c=i.getAttribute("aria-controls"),l=Object.values(n).find(o=>o.id===c);s.forEach(o=>{o.setAttribute("aria-selected","false")}),n.forEach(o=>{o.setAttribute("aria-hidden","true")}),i.setAttribute("aria-selected","true"),l&&l.removeAttribute("aria-hidden")},E=e=>e.code==="ArrowLeft"||e.keyCode===39,A=e=>e.code==="ArrowRight"||e.keyCode===37,se=(e=document.querySelector(".js-tabs"))=>{if(e){const t=e.querySelectorAll('[role="tab"]');t.forEach(s=>{s.addEventListener("click",n=>{ie({tabsContainerElement:e,event:n})})});const i=e.querySelector('[role="tablist"]');if(i&&t.length>0){let s=0;i.addEventListener("keydown",n=>{n instanceof KeyboardEvent&&(E(n)||A(n))&&(t[s].setAttribute("tabindex","-1"),E(n)?(s+=1,s>=t.length&&(s=0)):A(n)&&(s-=1,s<0&&(s=t.length-1)),t[s].setAttribute("tabindex","0"),t[s].focus())})}}},w=({currentTheme:e,switchDarkModeElement:t})=>{const i=e==="dark";t.setAttribute("aria-checked",String(i));const s=t.querySelector("span[aria-hidden]");s&&(s.setAttribute("aria-hidden",String(i)),s.innerHTML=i?"on":"off")},oe=(e=document.querySelector(".js-switch-dark-mode"))=>{const t=localStorage.getItem("theme")||"light";t&&e&&(document.documentElement.dataset.theme=t,w({currentTheme:t,switchDarkModeElement:e}))},ne=(e=document.querySelector(".js-switch-dark-mode"))=>{e&&e.addEventListener("click",()=>{const t=document.documentElement.dataset.theme,i=!t||t==="light"?"dark":"light";document.documentElement.dataset.theme=i,localStorage.setItem("theme",i),w({currentTheme:i,switchDarkModeElement:e})})},re=()=>{oe(),ne(),$(),se(),k(),J(),Z(),R(),U(),W(),z(),N(),window.layout===m.DESKTOP&&(Y(),te())};b.initScripts=re,Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})}); |
{ | ||
"name": "@20minutes/hela", | ||
"version": "0.1.115", | ||
"version": "0.1.116", | ||
"repository": "git@github.com:20minutes/hela.git", | ||
@@ -65,3 +65,3 @@ "license": "MIT", | ||
"@20minutes/eslint-config": "^1.2.4", | ||
"@aws-sdk/client-s3": "3.357.0", | ||
"@aws-sdk/client-s3": "3.360.0", | ||
"@babel/core": "^7.22.5", | ||
@@ -72,16 +72,16 @@ "@babel/eslint-parser": "^7.22.5", | ||
"@octokit/core": "4.2.4", | ||
"@storybook/addon-actions": "^7.0.22", | ||
"@storybook/addon-essentials": "^7.0.22", | ||
"@storybook/addon-links": "^7.0.22", | ||
"@storybook/addon-mdx-gfm": "^7.0.22", | ||
"@storybook/blocks": "^7.0.22", | ||
"@storybook/react": "^7.0.21", | ||
"@storybook/react-vite": "^7.0.22", | ||
"@storybook/addon-actions": "^7.0.23", | ||
"@storybook/addon-essentials": "^7.0.23", | ||
"@storybook/addon-links": "^7.0.23", | ||
"@storybook/addon-mdx-gfm": "^7.0.23", | ||
"@storybook/blocks": "^7.0.23", | ||
"@storybook/react": "^7.0.23", | ||
"@storybook/react-vite": "^7.0.23", | ||
"@svgr/cli": "^8.0.1", | ||
"@types/merge-stream": "^1.1.2", | ||
"@types/node": "^20.3.1", | ||
"@types/react": "^18.2.13", | ||
"@types/node": "^20.3.2", | ||
"@types/react": "^18.2.14", | ||
"@types/react-dom": "^18.2.6", | ||
"@typescript-eslint/eslint-plugin": "^5.60.0", | ||
"@typescript-eslint/parser": "^5.60.0", | ||
"@typescript-eslint/eslint-plugin": "^5.60.1", | ||
"@typescript-eslint/parser": "^5.60.1", | ||
"@vitejs/plugin-react": "^4.0.1", | ||
@@ -116,5 +116,5 @@ "@whitespace/storybook-addon-html": "^5.1.6", | ||
"sass": "^1.63.6", | ||
"storybook": "^7.0.22", | ||
"storybook": "^7.0.23", | ||
"style-dictionary": "^3.8.0", | ||
"stylelint": "^15.8.0", | ||
"stylelint": "^15.9.0", | ||
"stylelint-config-standard-scss": "^9.0.0", | ||
@@ -121,0 +121,0 @@ "stylelint-prettier": "^3.0.0", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1036278
311
11311