Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@20minutes/hela

Package Overview
Dependencies
Maintainers
0
Versions
327
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@20minutes/hela - npm Package Compare versions

Comparing version 1.14.7 to 1.14.8

dist/src/components/molecules/Legend/index.d.ts

794

dist/js/scripts.es.js

@@ -1,13 +0,13 @@

var R = Object.defineProperty;
var O = (e, t, o) => t in e ? R(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o;
var g = (e, t, o) => O(e, typeof t != "symbol" ? t + "" : t, o);
const B = () => {
const e = document.querySelector("#js-election-selector");
e && e.addEventListener("change", (t) => {
window.location.replace(t.target.value);
var W = Object.defineProperty;
var F = (t, e, o) => e in t ? W(t, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[e] = o;
var v = (t, e, o) => F(t, typeof e != "symbol" ? e + "" : e, o);
const N = () => {
const t = document.querySelector("#js-election-selector");
t && t.addEventListener("change", (e) => {
window.location.replace(e.target.value);
});
}, W = () => {
const e = document.querySelector(".c-search-banner");
if (e) {
const t = document.querySelector("#js-search-banner-to-hide"), o = e.querySelector("#js-search-banner-dropdown-btn");
}, P = () => {
const t = document.querySelector(".c-search-banner");
if (t) {
const e = document.querySelector("#js-search-banner-to-hide"), o = t.querySelector("#js-search-banner-dropdown-btn");
o == null || o.addEventListener("click", () => {

@@ -17,6 +17,6 @@ const n = o.querySelector("svg"), s = n == null ? void 0 : n.querySelector("use");

case "#chevron-up":
s == null || s.setAttribute("xlink:href", "#chevron-down"), t == null || t.classList.add("u-hidden");
s == null || s.setAttribute("xlink:href", "#chevron-down"), e == null || e.classList.add("u-hidden");
break;
case "#chevron-down":
s == null || s.setAttribute("xlink:href", "#chevron-up"), t == null || t.classList.remove("u-hidden");
s == null || s.setAttribute("xlink:href", "#chevron-up"), e == null || e.classList.remove("u-hidden");
break;

@@ -26,20 +26,20 @@ }

}
}, F = () => {
const e = document.getElementById("elections-form-search"), t = document.querySelector(".c-search-form__autocomplete");
if (!e || !t)
}, V = () => {
const t = document.getElementById("elections-form-search"), e = document.querySelector(".c-search-form__autocomplete");
if (!t || !e)
return;
const o = (r) => {
t.classList.remove("u-hidden");
const c = t.querySelectorAll("li"), i = [];
const o = (i) => {
e.classList.remove("u-hidden");
const c = e.querySelectorAll("li"), r = [];
return c.forEach((l) => {
const u = l.querySelector("a");
u && u.innerHTML.toLowerCase().includes(r.toLowerCase()) && i.push(l.innerHTML);
}), i;
}, n = (r) => {
t.innerHTML += `<li>${r}</li>`;
}, s = ({ target: r }) => {
const c = r.value;
if (t.classList.add("u-hidden"), c.length >= 3) {
const i = o(c);
t.innerHTML = "", i.length === 0 && t.classList.add("u-hidden"), i.forEach((l) => {
u && u.innerHTML.toLowerCase().includes(i.toLowerCase()) && r.push(l.innerHTML);
}), r;
}, n = (i) => {
e.innerHTML += `<li>${i}</li>`;
}, s = ({ target: i }) => {
const c = i.value;
if (e.classList.add("u-hidden"), c.length >= 3) {
const r = o(c);
e.innerHTML = "", r.length === 0 && e.classList.add("u-hidden"), r.forEach((l) => {
n(l);

@@ -49,14 +49,14 @@ });

};
e.addEventListener("input", s), e.addEventListener("focusout", () => {
setTimeout(() => t.classList.add("u-hidden"), 300);
}), e.addEventListener("focusin", () => {
t.childElementCount > 0 && t.classList.remove("u-hidden");
t.addEventListener("input", s), t.addEventListener("focusout", () => {
setTimeout(() => e.classList.add("u-hidden"), 300);
}), t.addEventListener("focusin", () => {
e.childElementCount > 0 && e.classList.remove("u-hidden");
});
}, N = () => {
const e = document.querySelector("header"), t = document.querySelector(".js-limit-scroll-close-article-btn"), o = document.querySelector(".c-close-article-btn"), n = document.querySelector(".c-header-mobile"), s = n instanceof HTMLElement ? n.offsetHeight : 0;
if (e && t && o) {
const r = new IntersectionObserver(
}, K = () => {
const t = document.querySelector("header"), e = document.querySelector(".js-limit-scroll-close-article-btn"), o = document.querySelector(".c-close-article-btn"), n = document.querySelector(".c-header-mobile"), s = n instanceof HTMLElement ? n.offsetHeight : 0;
if (t && e && o) {
const i = new IntersectionObserver(
() => {
const c = o.classList, i = c.contains("u-hidden"), l = e.getBoundingClientRect().bottom - s, u = t.getBoundingClientRect().bottom - s;
i && l <= 0 && u >= 0 && c.remove("u-hidden"), !i && (l >= 0 || u <= 0) && c.add("u-hidden");
const c = o.classList, r = c.contains("u-hidden"), l = t.getBoundingClientRect().bottom - s, u = e.getBoundingClientRect().bottom - s;
r && l <= 0 && u >= 0 && c.remove("u-hidden"), !r && (l >= 0 || u <= 0) && c.add("u-hidden");
},

@@ -66,28 +66,28 @@ // remove height of the header mobile to trigger observer after the header

);
r.observe(e), r.observe(t);
i.observe(t), i.observe(e);
}
}, P = (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")}`
}, G = (t) => {
t.stopImmediatePropagation(), t.preventDefault();
const e = t.currentTarget;
if (e instanceof HTMLButtonElement) {
const o = e.parentElement, n = o == null ? void 0 : o.querySelector(
`#${e.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"));
e.getAttribute("aria-expanded") === "true" ? (e.setAttribute("aria-expanded", "false"), n == null || n.setAttribute("aria-hidden", "true")) : (e.setAttribute("aria-expanded", "true"), n == null || n.setAttribute("aria-hidden", "false"));
}
}, V = (e = document.querySelector(
}, z = (t = document.querySelector(
".js-collapse__button"
)) => {
e && document.querySelectorAll(".c-collapse__button").forEach((o) => {
t && document.querySelectorAll(".c-collapse__button").forEach((o) => {
o.addEventListener("click", (n) => {
P(n);
G(n);
});
});
}, K = (e, t) => {
}, Z = (t, e) => {
const o = document.querySelector(
`#${t}`
`#${e}`
);
if (o) {
const n = o.querySelector(".js-countdown-days"), s = o.querySelector(".js-countdown-hours"), r = o.querySelector(".js-countdown-minutes"), c = o.querySelector(".js-countdown-seconds");
if (!n || !s || !r || !c)
const n = o.querySelector(".js-countdown-days"), s = o.querySelector(".js-countdown-hours"), i = o.querySelector(".js-countdown-minutes"), c = o.querySelector(".js-countdown-seconds");
if (!n || !s || !i || !c)
return;

@@ -97,120 +97,128 @@ window.counters = {

};
const i = window.counters[e], l = new Date(i).getTime(), u = setInterval(() => {
const m = (/* @__PURE__ */ new Date()).getTime(), a = l - m;
if (a <= 0)
const r = window.counters[t], l = new Date(r).getTime(), u = setInterval(() => {
const f = (/* @__PURE__ */ new Date()).getTime(), m = l - f;
if (m <= 0)
clearInterval(u);
else {
const f = Math.floor(a / 864e5), p = Math.floor(a % (1e3 * 60 * 60 * 24) / (1e3 * 60 * 60)), h = Math.floor(a % (1e3 * 60 * 60) / (1e3 * 60)), b = Math.floor(a % (1e3 * 60) / 1e3);
n.innerHTML = f.toString(), s.innerHTML = p.toString(), r.innerHTML = h.toString(), c.innerHTML = b.toString();
const b = Math.floor(m / 864e5), g = Math.floor(m % (1e3 * 60 * 60 * 24) / (1e3 * 60 * 60)), d = Math.floor(m % (1e3 * 60 * 60) / (1e3 * 60)), h = Math.floor(m % (1e3 * 60) / 1e3);
n.innerHTML = b.toString(), s.innerHTML = g.toString(), i.innerHTML = d.toString(), c.innerHTML = h.toString();
}
}, 1e3);
}
}, G = (e) => {
const t = e.getBBox(), o = t.width / 20;
return [t.x - o, t.y - o, t.width + o * 2, t.height + o * 2].join(
}, Y = (t) => {
const e = t.getBBox(), o = e.width / 20;
return [e.x - o, e.y - o, e.width + o * 2, e.height + o * 2].join(
" "
);
}, z = () => {
const e = document.querySelector(".c-map-districts");
if (!e)
}, X = () => {
const t = document.querySelector(".c-map-districts-container"), e = document.querySelector(".c-map-districts");
if (!t || !e)
return;
const t = document.querySelector(
const o = document.querySelector(
".c-map-districts-container__description"
), n = document.querySelector(
".c-map-districts-container__department"
), s = document.querySelector(
".c-map-districts-container__unzoom-button"
);
let o = e;
const n = e.getAttribute("viewBox"), s = (a, f) => {
let i = e;
const c = e.getAttribute("viewBox"), r = (d, h) => {
var p;
return (p = a.matches) == null ? void 0 : p.call(a, f);
}, r = (a, f, p = ".c-map-districts__zoomable:not(.js-selected-area)") => {
if (!a)
return (p = d.matches) == null ? void 0 : p.call(d, h);
}, l = (d, h, p = ".c-map-districts__zoomable:not(.js-selected-area)") => {
if (!d)
return;
let h, b = a.parentElement;
for (; b instanceof SVGGraphicsElement && b !== f; )
s(b, p) && (h = b), b = b.parentElement;
return h;
}, c = (a, f, p) => {
if (!a)
let y, L = d.parentElement;
for (; L instanceof SVGGraphicsElement && L !== h; )
r(L, p) && (y = L), L = L.parentElement;
return y;
}, u = (d, h, p) => {
if (!d)
return;
let h = a.parentElement;
for (; h instanceof SVGGraphicsElement && h !== p; ) {
if (f === h)
let y = d.parentElement;
for (; y instanceof SVGGraphicsElement && y !== p; ) {
if (h === y)
return !0;
h = h.parentElement;
y = y.parentElement;
}
return p === f;
}, i = (a, f) => {
f && t && (t.classList.add("u-hidden"), f !== n && t.classList.remove("u-hidden"), o.classList.remove("js-selected-area"), o = a, o.classList.add("js-selected-area"), e.setAttribute("viewBox", f));
}, l = (a) => {
a.stopPropagation();
const f = a.currentTarget;
if (o && e && f instanceof SVGGraphicsElement) {
if (f === o)
return p === h;
}, f = (d, h) => {
if (h && s && o) {
t.classList.remove("c-map-districts-container--department-view"), o.classList.remove("u-hidden"), n == null || n.classList.add("u-hidden"), s.classList.add("u-hidden"), h !== c && (o.classList.add("u-hidden"), s.classList.remove("u-hidden")), i.classList.remove("js-selected-area"), i = d;
const p = i.getAttribute("data-info");
n && p && (t.classList.add("c-map-districts-container--department-view"), n.classList.remove("u-hidden"), n.innerHTML = p), i.classList.add("js-selected-area"), e.setAttribute("viewBox", h);
}
}, m = (d) => {
d.stopPropagation();
const h = d.currentTarget;
if (i && e && h instanceof SVGGraphicsElement) {
if (h === i)
return;
if (a.preventDefault(), o !== e && !c(f, o, e)) {
i(e, n);
if (d.preventDefault(), i !== e && !u(h, i, e)) {
f(e, c);
return;
}
const p = r(
f,
o
const p = l(
h,
i
);
i(
p || f,
G(p || f)
f(
p || h,
Y(p || h)
);
}
}, u = () => {
e && o !== e && i(e, n);
}, b = () => {
e && i !== e && f(e, c);
};
e.addEventListener("click", u), t && t.addEventListener("click", u), document.querySelectorAll(".c-map-districts__zoomable").forEach((a) => {
a.addEventListener("click", (f) => l(f));
e.addEventListener("click", b), s && s.addEventListener("click", b), document.querySelectorAll(".c-map-districts__zoomable").forEach((d) => {
d.addEventListener("click", (h) => m(h));
});
}, Z = (e) => {
}, J = (t) => {
var n;
e.setAttribute("aria-expanded", "true");
const t = (n = e.parentNode) == null ? void 0 : n.querySelectorAll(".js-ellipsis-target");
t == null || t.forEach((s) => s.classList.remove("u-ellipsis"));
const o = e.querySelector(".js-ellipsis-button__label");
t.setAttribute("aria-expanded", "true");
const e = (n = t.parentNode) == null ? void 0 : n.querySelectorAll(".js-ellipsis-target");
e == null || e.forEach((s) => s.classList.remove("u-ellipsis"));
const o = t.querySelector(".js-ellipsis-button__label");
o instanceof HTMLSpanElement && (o.innerHTML = "Voir moins");
}, Y = (e) => {
}, Q = (t) => {
var n;
const t = (n = e.parentNode) == null ? void 0 : n.querySelectorAll(".js-ellipsis-target");
t == null || t.forEach((s) => s.classList.add("u-ellipsis")), e.setAttribute("aria-expanded", "false");
const o = e.querySelector(".js-ellipsis-button__label");
const e = (n = t.parentNode) == null ? void 0 : n.querySelectorAll(".js-ellipsis-target");
e == null || e.forEach((s) => s.classList.add("u-ellipsis")), t.setAttribute("aria-expanded", "false");
const o = t.querySelector(".js-ellipsis-button__label");
o instanceof HTMLSpanElement && (o.innerHTML = "Voir plus");
}, X = (e) => {
const t = e.currentTarget;
return e.preventDefault(), t instanceof HTMLButtonElement ? t.getAttribute("aria-expanded") === "true" ? Y(t) : Z(t) : null;
}, J = (e = document.querySelector(
}, U = (t) => {
const e = t.currentTarget;
return t.preventDefault(), e instanceof HTMLButtonElement ? e.getAttribute("aria-expanded") === "true" ? Q(e) : J(e) : null;
}, ee = (t = document.querySelector(
".js-ellipsis-button"
)) => {
e && document.querySelectorAll(".js-ellipsis-button").forEach((o) => o.addEventListener("click", X));
}, Q = (e) => {
t && document.querySelectorAll(".js-ellipsis-button").forEach((o) => o.addEventListener("click", U));
}, te = (t) => {
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");
t.setAttribute("aria-expanded", "true");
const e = (n = t.parentNode) == null ? void 0 : n.querySelectorAll(".js-expand-target");
e == null || e.forEach((s) => s.setAttribute("aria-hidden", "false"));
const o = t.querySelector(".js-expand-button__label");
o instanceof HTMLSpanElement && (o.innerHTML = "Voir moins");
}, U = (e) => {
}, oe = (t) => {
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");
const e = (n = t.parentNode) == null ? void 0 : n.querySelectorAll(".js-expand-target");
e == null || e.forEach((s) => s.setAttribute("aria-hidden", "true")), t.setAttribute("aria-expanded", "false");
const o = t.querySelector(".js-expand-button__label");
o instanceof HTMLSpanElement && (o.innerHTML = "Voir plus");
}, ee = (e) => {
const t = e.currentTarget;
return e.preventDefault(), t instanceof HTMLButtonElement ? t.getAttribute("aria-expanded") === "true" ? U(t) : Q(t) : null;
}, te = (e = document.querySelector(
}, ne = (t) => {
const e = t.currentTarget;
return t.preventDefault(), e instanceof HTMLButtonElement ? e.getAttribute("aria-expanded") === "true" ? oe(e) : te(e) : null;
}, se = (t = document.querySelector(
".js-expand-button"
)) => {
e && document.querySelectorAll(".js-expand-button").forEach((o) => o.addEventListener("click", ee));
}, oe = () => {
const e = document.querySelectorAll(".js-half-donut-result");
for (const t of Array.from(e)) {
const o = t.querySelector(".c-half-donut"), n = t.querySelector(".c-legend");
t && document.querySelectorAll(".js-expand-button").forEach((o) => o.addEventListener("click", ne));
}, ie = () => {
const t = document.querySelectorAll(".js-half-donut-result");
for (const e of Array.from(t)) {
const o = e.querySelector(".c-half-donut"), n = e.querySelector(".c-legend");
if (!o || !n)
return;
n.querySelectorAll("[data-color]").forEach((s) => {
const r = s.getAttribute("data-color"), c = o.querySelector(`.c-half-donut__zone--${r}`);
const i = s.getAttribute("data-color"), c = o.querySelector(`.c-half-donut__zone--${i}`);
c == null || c.addEventListener("mouseenter", () => {

@@ -227,3 +235,3 @@ s.classList.add("c-legend__item--is-hovered"), o.classList.add("c-half-donut--is-hovered"), n.classList.add("c-legend--is-hovered");

}
}, d = {
}, a = {
inert: ":not([inert]):not([inert] *)",

@@ -233,46 +241,46 @@ negTabIndex: ':not([tabindex^="-"])',

};
var ne = [
`a[href]${d.inert}${d.negTabIndex}`,
`area[href]${d.inert}${d.negTabIndex}`,
`input:not([type="hidden"]):not([type="radio"])${d.inert}${d.negTabIndex}${d.disabled}`,
`input[type="radio"]${d.inert}${d.negTabIndex}${d.disabled}`,
`select${d.inert}${d.negTabIndex}${d.disabled}`,
`textarea${d.inert}${d.negTabIndex}${d.disabled}`,
`button${d.inert}${d.negTabIndex}${d.disabled}`,
`details${d.inert} > summary:first-of-type${d.negTabIndex}`,
var re = [
`a[href]${a.inert}${a.negTabIndex}`,
`area[href]${a.inert}${a.negTabIndex}`,
`input:not([type="hidden"]):not([type="radio"])${a.inert}${a.negTabIndex}${a.disabled}`,
`input[type="radio"]${a.inert}${a.negTabIndex}${a.disabled}`,
`select${a.inert}${a.negTabIndex}${a.disabled}`,
`textarea${a.inert}${a.negTabIndex}${a.disabled}`,
`button${a.inert}${a.negTabIndex}${a.disabled}`,
`details${a.inert} > summary:first-of-type${a.negTabIndex}`,
// Discard until Firefox supports `:has()`
// See: https://github.com/KittyGiraudel/focusable-selectors/issues/12
// `details:not(:has(> summary))${not.inert}${not.negTabIndex}`,
`iframe${d.inert}${d.negTabIndex}`,
`audio[controls]${d.inert}${d.negTabIndex}`,
`video[controls]${d.inert}${d.negTabIndex}`,
`[contenteditable]${d.inert}${d.negTabIndex}`,
`[tabindex]${d.inert}${d.negTabIndex}`
`iframe${a.inert}${a.negTabIndex}`,
`audio[controls]${a.inert}${a.negTabIndex}`,
`video[controls]${a.inert}${a.negTabIndex}`,
`[contenteditable]${a.inert}${a.negTabIndex}`,
`[tabindex]${a.inert}${a.negTabIndex}`
];
function T(e) {
(e.querySelector("[autofocus]") || e).focus();
function x(t) {
(t.querySelector("[autofocus]") || t).focus();
}
function se(e) {
const t = L(e, !0), o = t ? L(e, !1) || t : null;
return [t, o];
function ce(t) {
const e = S(t, !0), o = e ? S(t, !1) || e : null;
return [e, o];
}
function L(e, t) {
if (t && x(e))
return e;
if (re(e))
if (e.shadowRoot) {
let o = q(e.shadowRoot, t);
function S(t, e) {
if (e && M(t))
return t;
if (ae(t))
if (t.shadowRoot) {
let o = C(t.shadowRoot, e);
for (; o; ) {
const n = L(o, t);
const n = S(o, e);
if (n)
return n;
o = $(o, t);
o = k(o, e);
}
} else if (e.localName === "slot") {
const o = e.assignedElements({
} else if (t.localName === "slot") {
const o = t.assignedElements({
flatten: !0
});
t || o.reverse();
e || o.reverse();
for (const n of o) {
const s = L(n, t);
const s = S(n, e);
if (s)

@@ -282,43 +290,43 @@ return s;

} else {
let o = q(e, t);
let o = C(t, e);
for (; o; ) {
const n = L(o, t);
const n = S(o, e);
if (n)
return n;
o = $(o, t);
o = k(o, e);
}
}
return !t && x(e) ? e : null;
return !e && M(t) ? t : null;
}
function q(e, t) {
return t ? e.firstElementChild : e.lastElementChild;
function C(t, e) {
return e ? t.firstElementChild : t.lastElementChild;
}
function $(e, t) {
return t ? e.nextElementSibling : e.previousElementSibling;
function k(t, e) {
return e ? t.nextElementSibling : t.previousElementSibling;
}
const ie = (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(ne.join(",")) && !ie(e);
const le = (t) => t.matches("details:not([open]) *") && !t.matches("details>summary:first-of-type") ? !0 : !(t.offsetWidth || t.offsetHeight || t.getClientRects().length), M = (t) => {
var e;
return (e = t.shadowRoot) != null && e.delegatesFocus ? !1 : t.matches(re.join(",")) && !le(t);
};
function re(e) {
return e.shadowRoot && e.getAttribute("tabindex") === "-1" ? !1 : !e.matches(":disabled,[hidden],[inert]");
function ae(t) {
return t.shadowRoot && t.getAttribute("tabindex") === "-1" ? !1 : !t.matches(":disabled,[hidden],[inert]");
}
function A(e = document) {
const t = e.activeElement;
return t ? t.shadowRoot ? A(t.shadowRoot) || document.activeElement : t : null;
function $(t = document) {
const e = t.activeElement;
return e ? e.shadowRoot ? $(e.shadowRoot) || document.activeElement : e : null;
}
function ce(e, t) {
const [o, n] = se(e);
function de(t, e) {
const [o, n] = ce(t);
if (!o)
return t.preventDefault();
const s = A();
t.shiftKey && s === o ? (n.focus(), t.preventDefault()) : !t.shiftKey && s === n && (o.focus(), t.preventDefault());
return e.preventDefault();
const s = $();
e.shiftKey && s === o ? (n.focus(), e.preventDefault()) : !e.shiftKey && s === n && (o.focus(), e.preventDefault());
}
class j {
constructor(t) {
g(this, "$el");
g(this, "id");
g(this, "previouslyFocused");
g(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);
class O {
constructor(e) {
v(this, "$el");
v(this, "id");
v(this, "previouslyFocused");
v(this, "shown");
this.$el = e, 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);
}

@@ -336,5 +344,5 @@ /**

*/
show(t) {
show(e) {
var o;
return this.shown ? this : (this.shown = !0, this.$el.removeAttribute("aria-hidden"), this.previouslyFocused = A(), ((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) : T(this.$el), document.body.addEventListener("focus", this.maintainFocus, !0), this.$el.addEventListener("keydown", this.bindKeypress, !0), this.fire("show", t), this);
return this.shown ? this : (this.shown = !0, this.$el.removeAttribute("aria-hidden"), this.previouslyFocused = $(), ((o = this.previouslyFocused) == null ? void 0 : o.tagName) === "BODY" && (e != null && e.target) && (this.previouslyFocused = e.target), (e == null ? void 0 : e.type) === "focus" ? this.maintainFocus(e) : x(this.$el), document.body.addEventListener("focus", this.maintainFocus, !0), this.$el.addEventListener("keydown", this.bindKeypress, !0), this.fire("show", e), this);
}

@@ -346,5 +354,5 @@ /**

*/
hide(t) {
hide(e) {
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;
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", e), this) : this;
}

@@ -354,4 +362,4 @@ /**

*/
on(t, o, n) {
return this.$el.addEventListener(t, o, n), this;
on(e, o, n) {
return this.$el.addEventListener(e, o, n), this;
}

@@ -361,4 +369,4 @@ /**

*/
off(t, o, n) {
return this.$el.removeEventListener(t, o, n), this;
off(e, o, n) {
return this.$el.removeEventListener(e, o, n), this;
}

@@ -370,4 +378,4 @@ /**

*/
fire(t, o) {
this.$el.dispatchEvent(new CustomEvent(t, {
fire(e, o) {
this.$el.dispatchEvent(new CustomEvent(e, {
detail: o,

@@ -381,5 +389,5 @@ 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);
handleTriggerClicks(e) {
const o = e.target;
o.closest(`[data-a11y-dialog-show="${this.id}"]`) && this.show(e), (o.closest(`[data-a11y-dialog-hide="${this.id}"]`) || o.closest("[data-a11y-dialog-hide]") && o.closest('[aria-modal="true"]') === this.$el) && this.hide(e);
}

@@ -390,3 +398,3 @@ /**

*/
bindKeypress(t) {
bindKeypress(e) {
var n;

@@ -400,3 +408,3 @@ if (((n = document.activeElement) == null ? void 0 : n.closest('[aria-modal="true"]')) !== this.$el)

}
t.key === "Escape" && this.$el.getAttribute("role") !== "alertdialog" && !o && (t.preventDefault(), this.hide(t)), t.key === "Tab" && ce(this.$el, t);
e.key === "Escape" && this.$el.getAttribute("role") !== "alertdialog" && !o && (e.preventDefault(), this.hide(e)), e.key === "Tab" && de(this.$el, e);
}

@@ -409,19 +417,19 @@ /**

*/
maintainFocus(t) {
t.target.closest('[aria-modal="true"], [data-a11y-dialog-ignore-focus-trap]') || T(this.$el);
maintainFocus(e) {
e.target.closest('[aria-modal="true"], [data-a11y-dialog-ignore-focus-trap]') || x(this.$el);
}
}
function C() {
for (const e of document.querySelectorAll("[data-a11y-dialog]"))
new j(e);
function I() {
for (const t of document.querySelectorAll("[data-a11y-dialog]"))
new O(t);
}
typeof document < "u" && (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", C) : C());
const le = () => document.querySelectorAll(".js-modal").forEach((e) => {
if (!(e instanceof HTMLElement))
typeof document < "u" && (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", I) : I());
const ue = () => document.querySelectorAll(".js-modal").forEach((t) => {
if (!(t instanceof HTMLElement))
return;
const t = new j(e), o = {
const e = new O(t), o = {
x: 0,
y: 0
};
t.on("show", () => {
e.on("show", () => {
o.x = window.scrollX, o.y = window.scrollY, document.body.classList.add("noscroll"), document.body.style.top = `-${o.y}px`;

@@ -431,54 +439,54 @@ }).on("hide", () => {

});
}), ae = ({ navigatedList: e, nextBtn: t, prevBtn: o }) => {
var r, c, i, l, u, m, a, f;
const n = e.scrollLeft > 0, s = e.scrollLeft + e.clientWidth < e.scrollWidth;
n && s ? ((r = t.classList) == null || r.add("o-nav-button--visible"), (c = o.classList) == null || c.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 ? ((u = t.classList) == null || u.add("o-nav-button--visible"), (m = o.classList) == null || m.remove("o-nav-button--visible")) : ((a = t.classList) == null || a.remove("o-nav-button--visible"), (f = o.classList) == null || f.remove("o-nav-button--visible"));
}, de = ({
navigatedList: e,
nextBtn: t,
}), fe = ({ navigatedList: t, nextBtn: e, prevBtn: o }) => {
var i, c, r, l, u, f, m, b;
const n = t.scrollLeft > 0, s = t.scrollLeft + t.clientWidth < t.scrollWidth;
n && s ? ((i = e.classList) == null || i.add("o-nav-button--visible"), (c = o.classList) == null || c.add("o-nav-button--visible")) : n ? ((r = e.classList) == null || r.remove("o-nav-button--visible"), (l = o.classList) == null || l.add("o-nav-button--visible")) : s ? ((u = e.classList) == null || u.add("o-nav-button--visible"), (f = o.classList) == null || f.remove("o-nav-button--visible")) : ((m = e.classList) == null || m.remove("o-nav-button--visible"), (b = o.classList) == null || b.remove("o-nav-button--visible"));
}, he = ({
navigatedList: t,
nextBtn: e,
prevBtn: o,
sliderVariant: n
}) => {
if (e) {
const s = e.closest(".js-overview-bar-container"), r = s == null ? void 0 : s.querySelector(".c-stepper"), c = r == null ? void 0 : r.querySelectorAll(".c-stepper__item");
if (t) {
const s = t.closest(".js-overview-bar-container"), i = s == null ? void 0 : s.querySelector(".c-stepper"), c = i == null ? void 0 : i.querySelectorAll(".c-stepper__item");
if (c) {
const i = Array.from(c).findIndex(
const r = Array.from(c).findIndex(
(l) => l.classList.contains("c-stepper__item--loading")
);
if (i < 0)
if (r < 0)
c[0].classList.add("c-stepper__item--loading");
else {
c[i].classList.remove("c-stepper__item--loading"), c[i].classList.add("c-stepper__item--loaded");
const l = c[i].querySelector(".c-stepper__loader");
l && l instanceof HTMLElement && (l.style.transition = "width 0s linear"), i + 1 < c.length && c[i + 1].classList.add("c-stepper__item--loading");
c[r].classList.remove("c-stepper__item--loading"), c[r].classList.add("c-stepper__item--loaded");
const l = c[r].querySelector(".c-stepper__loader");
l && l instanceof HTMLElement && (l.style.transition = "width 0s linear"), r + 1 < c.length && c[r + 1].classList.add("c-stepper__item--loading");
}
}
if (e.scrollWidth - e.clientWidth > e.clientWidth) {
let i = e.scrollLeft;
if (t.scrollWidth - t.clientWidth > t.clientWidth) {
let r = t.scrollLeft;
switch (n) {
case "three-columns-articles":
i += e.clientWidth + 32;
r += t.clientWidth + 32;
break;
case "rubrics":
i += e.clientWidth - 36;
r += t.clientWidth - 36;
break;
default:
i += Math.ceil(e.clientWidth * 0.6);
r += Math.ceil(t.clientWidth * 0.6);
break;
}
e.scrollTo({
left: i,
t.scrollTo({
left: r,
behavior: "smooth"
}), o.classList.add("o-nav-button--visible"), i + e.clientWidth >= e.scrollWidth && t.classList.remove("o-nav-button--visible");
}), o.classList.add("o-nav-button--visible"), r + t.clientWidth >= t.scrollWidth && e.classList.remove("o-nav-button--visible");
} else {
const i = e.scrollWidth - e.clientWidth;
e.scrollTo({
left: i,
const r = t.scrollWidth - t.clientWidth;
t.scrollTo({
left: r,
behavior: "smooth"
}), t.classList.remove("o-nav-button--visible"), o.classList.add("o-nav-button--visible");
}), e.classList.remove("o-nav-button--visible"), o.classList.add("o-nav-button--visible");
}
}
}, ue = ({
navigatedList: e,
nextBtn: t,
}, me = ({
navigatedList: t,
nextBtn: e,
prevBtn: o,

@@ -488,98 +496,98 @@ sliderVariant: n,

}) => {
if (e) {
const r = e.closest(".js-overview-bar-container"), c = r == null ? void 0 : r.querySelector(".c-stepper"), i = c == null ? void 0 : c.querySelectorAll(".c-stepper__item");
if (i) {
const l = Array.from(i).findIndex(
if (t) {
const i = t.closest(".js-overview-bar-container"), c = i == null ? void 0 : i.querySelector(".c-stepper"), r = c == null ? void 0 : c.querySelectorAll(".c-stepper__item");
if (r) {
const l = Array.from(r).findIndex(
(u) => u.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 u = i[l - 1].querySelector(".c-stepper__loader");
i[l - 1].classList.add("c-stepper__item--loading"), u && u instanceof HTMLElement && (u.style.transition = `width ${s / 1e3}s linear`);
l < 0 ? r[0].classList.add("c-stepper__item--loading") : (r[l].classList.remove("c-stepper__item--loading"), r[l].classList.remove("c-stepper__item--loaded"), l - 1 > 0 && (r[l - 1].classList.remove("c-stepper__item--loading"), r[l - 1].classList.remove("c-stepper__item--loaded"), setTimeout(() => {
const u = r[l - 1].querySelector(".c-stepper__loader");
r[l - 1].classList.add("c-stepper__item--loading"), u && u instanceof HTMLElement && (u.style.transition = `width ${s / 1e3}s linear`);
}, 0)));
}
if (e.clientWidth < e.scrollLeft) {
let l = e.scrollLeft;
if (t.clientWidth < t.scrollLeft) {
let l = t.scrollLeft;
switch (n) {
case "three-columns-articles":
l -= e.clientWidth + 32;
l -= t.clientWidth + 32;
break;
case "rubrics":
l -= e.clientWidth - 36;
l -= t.clientWidth - 36;
break;
default:
l -= Math.ceil(e.clientWidth * 0.6);
l -= Math.ceil(t.clientWidth * 0.6);
break;
}
e.scrollTo({
t.scrollTo({
left: l,
behavior: "smooth"
}), t.classList.add("o-nav-button--visible"), l === 0 && o.classList.remove("o-nav-button--visible");
}), e.classList.add("o-nav-button--visible"), l === 0 && o.classList.remove("o-nav-button--visible");
} else
e.scrollTo({
t.scrollTo({
left: 0,
behavior: "smooth"
}), o.classList.remove("o-nav-button--visible"), e.clientWidth < e.scrollWidth && t.classList.add("o-nav-button--visible");
}), o.classList.remove("o-nav-button--visible"), t.clientWidth < t.scrollWidth && e.classList.add("o-nav-button--visible");
}
}, fe = ({ navigatedList: e, nextBtn: t, prevBtn: o }) => {
ae({
navigatedList: e,
nextBtn: t,
}, pe = ({ navigatedList: t, nextBtn: e, prevBtn: o }) => {
fe({
navigatedList: t,
nextBtn: e,
prevBtn: o
});
}, he = () => {
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, c = t.closest(".js-overview-bar-container"), i = c == null ? void 0 : c.querySelector(".c-stepper"), l = i == null ? void 0 : i.querySelectorAll(".c-stepper__item");
if (t) {
const u = t.querySelector(
}, be = () => {
const t = document.querySelectorAll(".js-navigation-container");
for (const e of Array.from(t)) {
const { sliderVariant: o } = e.dataset, { sliderAuto: n } = e.dataset, { sliderDelay: s } = e.dataset, i = s ? parseInt(s, 10) : 3e3, c = e.closest(".js-overview-bar-container"), r = c == null ? void 0 : c.querySelector(".c-stepper"), l = r == null ? void 0 : r.querySelectorAll(".c-stepper__item");
if (e) {
const u = e.querySelector(
".js-navigation-container__list"
), m = t.querySelector(
), f = e.querySelector(
".o-nav-button--next-button"
), a = t.querySelector(
), m = e.querySelector(
".o-nav-button--previous-button"
);
if (u && u.clientWidth < u.scrollWidth && (m == null || m.classList.add("o-nav-button--visible")), u && m && a && (m == null || m.addEventListener(
if (u && u.clientWidth < u.scrollWidth && (f == null || f.classList.add("o-nav-button--visible")), u && f && m && (f == null || f.addEventListener(
"click",
de.bind(!1, {
he.bind(!1, {
navigatedList: u,
nextBtn: m,
prevBtn: a,
nextBtn: f,
prevBtn: m,
sliderVariant: o
})
), a == null || a.addEventListener(
), m == null || m.addEventListener(
"click",
ue.bind(!1, {
me.bind(!1, {
navigatedList: u,
nextBtn: m,
prevBtn: a,
nextBtn: f,
prevBtn: m,
sliderVariant: o,
delay: r
delay: i
})
)), n === "true" && m) {
const f = i ? i.querySelector(".c-stepper__item--loading") : null;
l && (l.forEach((p) => {
const h = p.querySelector(".c-stepper__loader");
h && h instanceof HTMLElement && (h.style.transition = `width ${r / 1e3}s linear`);
}), f || l[0].classList.add("c-stepper__item--loading")), setInterval(() => {
m.classList.contains("o-nav-button--visible") ? m.click() : u && a && (u.scrollLeft = 0, l && (l.forEach((p) => {
const h = p.querySelector(".c-stepper__loader");
h && h instanceof HTMLElement && (h.style.transition = "width 0s linear"), p.classList.remove("c-stepper__item--loading"), p.classList.remove("c-stepper__item--loaded"), setTimeout(() => {
h && h instanceof HTMLElement && (h.style.transition = `width ${r / 1e3}s linear`);
)), n === "true" && f) {
const b = r ? r.querySelector(".c-stepper__item--loading") : null;
l && (l.forEach((g) => {
const d = g.querySelector(".c-stepper__loader");
d && d instanceof HTMLElement && (d.style.transition = `width ${i / 1e3}s linear`);
}), b || l[0].classList.add("c-stepper__item--loading")), setInterval(() => {
f.classList.contains("o-nav-button--visible") ? f.click() : u && m && (u.scrollLeft = 0, l && (l.forEach((g) => {
const d = g.querySelector(".c-stepper__loader");
d && d instanceof HTMLElement && (d.style.transition = "width 0s linear"), g.classList.remove("c-stepper__item--loading"), g.classList.remove("c-stepper__item--loaded"), setTimeout(() => {
d && d instanceof HTMLElement && (d.style.transition = `width ${i / 1e3}s linear`);
}, 0);
}), setTimeout(() => {
l[0].classList.add("c-stepper__item--loading");
}, 0)), a.click());
}, r);
}, 0)), m.click());
}, i);
}
}
}
}, me = () => {
const e = document.querySelectorAll(".js-navigation-container");
for (const t of Array.from(e))
if (t) {
const o = t.querySelector(
}, ge = () => {
const t = document.querySelectorAll(".js-navigation-container");
for (const e of Array.from(t))
if (e) {
const o = e.querySelector(
".js-navigation-container__list"
), n = t.querySelector(
), n = e.querySelector(
".o-nav-button--next-button"
), s = t.querySelector(
), s = e.querySelector(
".o-nav-button--previous-button"

@@ -589,3 +597,3 @@ );

"resize",
fe.bind(!1, {
pe.bind(!1, {
navigatedList: o,

@@ -597,5 +605,5 @@ nextBtn: n,

}
}, pe = () => {
const e = document.querySelector(".js-limit-scroll-progress-bar"), t = document.querySelector(".c-progress__bar");
if (!t)
}, ye = () => {
const t = document.querySelector(".js-limit-scroll-progress-bar"), e = document.querySelector(".c-progress__bar");
if (!e)
return;

@@ -607,26 +615,26 @@ const { documentElement: o } = document;

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%");
}, be = () => {
document.querySelector(".c-progress") && window.addEventListener("scroll", pe);
t && (n = t.scrollHeight - o.clientHeight + (window.pageYOffset + t.getBoundingClientRect().top));
const i = Math.round(s / n * 100);
e.style.width = `${i}%`, i >= 100 && (e.style.width = "100%");
}, Le = () => {
document.querySelector(".c-progress") && window.addEventListener("scroll", ye);
};
let y, v = 0;
const ge = () => {
y = null, document.body.getBoundingClientRect().top > v + 2 && (y = "up"), document.body.getBoundingClientRect().top < v - 2 && (y = "down"), v = 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 = "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")), (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.style.borderWidth = "0", e.classList.contains("c-read-also-banner__scrolldirection--down") || e.classList.add("c-read-also-banner__scrolldirection--down"));
let E, w = 0;
const ve = () => {
E = null, document.body.getBoundingClientRect().top > w + 2 && (E = "up"), document.body.getBoundingClientRect().top < w - 2 && (E = "down"), w = document.body.getBoundingClientRect().top;
const t = document.querySelector(".c-read-also-banner");
if (t) {
const e = t.dataset.bannerLimitTop || "0";
E === "up" && -document.body.getBoundingClientRect().top >= parseInt(e, 10) && (t.classList.remove("c-read-also-banner__scrolldirection--down"), t.style.paddingTop = "0.75em", t.style.paddingBottom = "0.75em", t.style.borderWidth = "1px", t.classList.contains("c-read-also-banner__scrolldirection--up") || t.classList.add("c-read-also-banner__scrolldirection--up")), (E === "down" || -document.body.getBoundingClientRect().top <= parseInt(e, 10)) && (t.classList.remove("c-read-also-banner__scrolldirection--up"), t.style.paddingTop = "0", t.style.paddingBottom = "0", t.style.borderWidth = "0", t.classList.contains("c-read-also-banner__scrolldirection--down") || t.classList.add("c-read-also-banner__scrolldirection--down"));
}
}, ye = (e = document.querySelector(
}, Ee = (t = document.querySelector(
".c-read-also-banner"
)) => {
if (e) {
let t;
if (t) {
let e;
window.addEventListener("scroll", () => {
clearTimeout(t), t = setTimeout(ge, 100);
clearTimeout(e), e = setTimeout(ve, 100);
});
}
}, S = "#page-content", w = "#text-tooltip", Le = ".tooltip-btn", D = "c-text-tooltip--show", Ee = [
}, A = "#page-content", T = "#text-tooltip", Se = ".tooltip-btn", B = "c-text-tooltip--show", _e = [
"#page-content .c-content p",

@@ -643,14 +651,14 @@ "#page-content .c-content h2",

"#page-content header h2"
], k = (e, t) => e instanceof Element ? t.some((o) => e.matches(o)) : !1, ve = (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 && k(o, t) || !!n && k(n, t);
}, Se = (e) => {
], H = (t, e) => t instanceof Element ? e.some((o) => t.matches(o)) : !1, we = (t, e) => {
const o = t.startContainer.nodeType === Node.ELEMENT_NODE ? t.startContainer : t.startContainer.parentElement, n = t.endContainer.nodeType === Node.ELEMENT_NODE ? t.endContainer : t.endContainer.parentElement;
return !!o && H(o, e) || !!n && H(n, e);
}, Ae = (t) => {
var o;
if (!e.focusNode)
if (!t.focusNode)
return null;
const t = (o = e.anchorNode) == null ? void 0 : o.compareDocumentPosition(e.focusNode);
return t ? (t & 4) > 0 : e.anchorOffset < e.focusOffset;
}, we = (e, t, o) => {
const n = document.querySelector(`${S} ${w}`), s = document.querySelector(`${S}`), r = document.querySelectorAll(
`${S} ${w} ${Le}`
const e = (o = t.anchorNode) == null ? void 0 : o.compareDocumentPosition(t.focusNode);
return e ? (e & 4) > 0 : t.anchorOffset < t.focusOffset;
}, Te = (t, e, o) => {
const n = document.querySelector(`${A} ${T}`), s = document.querySelector(`${A}`), i = document.querySelectorAll(
`${A} ${T} ${Se}`
);

@@ -661,24 +669,24 @@ if (!n || !s) {

}
Array.from(r).forEach((l) => l.setAttribute("data-selected-text", o));
const c = e.getClientRects(), i = c[t ? c.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(D);
}, M = () => {
const e = document.querySelector(`${w}`);
e && e.classList.remove(D);
}, E = ({ type: e }) => {
const t = window.getSelection();
if (e === "selectionchange") {
M();
Array.from(i).forEach((l) => l.setAttribute("data-selected-text", o));
const c = t.getClientRects(), r = c[e ? c.length - 1 : 0];
n.style.top = `${r.top - s.getBoundingClientRect().top - (n.offsetHeight + 10)}px`, r.width < n.offsetWidth ? n.style.left = `${r.left - s.getBoundingClientRect().left + r.width / 2 - n.offsetWidth / 2}px` : e ? n.style.left = `${r.left - s.getBoundingClientRect().left + r.width - n.offsetWidth}px` : n.style.left = `${r.left - s.getBoundingClientRect().left}px`, n.classList.add(B);
}, j = () => {
const t = document.querySelector(`${T}`);
t && t.classList.remove(B);
}, _ = ({ type: t }) => {
const e = window.getSelection();
if (t === "selectionchange") {
j();
return;
}
if (!t || !t.rangeCount)
if (!e || !e.rangeCount)
return;
const o = t.getRangeAt(0), n = t.toString().trim();
const o = e.getRangeAt(0), n = e.toString().trim();
if (n.length) {
const s = ve(o, Ee), r = Se(t) || !1;
s && we(o, r, n);
const s = we(o, _e), i = Ae(e) || !1;
s && Te(o, i, n);
return;
}
M();
}, _e = () => {
j();
}, qe = () => {
if (!(window != null && window.getSelection)) {

@@ -688,72 +696,72 @@ console.warn("Selection API isn't supported");

}
document.addEventListener("mouseup", E), document.addEventListener("selectionchange", E), document.addEventListener("touchend", E), document.addEventListener("touchcancel", E);
}, Ae = (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"));
document.addEventListener("mouseup", _), document.addEventListener("selectionchange", _), document.addEventListener("touchend", _), document.addEventListener("touchcancel", _);
}, $e = (t) => {
const { target: e } = t;
if (e instanceof Element) {
const o = e.closest(".c-search-form--button");
o && (t.preventDefault(), o.classList.remove("c-search-form--button"));
}
}, Te = (e = document.querySelector(
}, xe = (t = document.querySelector(
".c-search-form--button"
)) => {
e && e.addEventListener("click", (t) => {
Ae(t);
t && t.addEventListener("click", (e) => {
$e(e);
});
}, qe = ({
tabsContainerElement: e,
event: t
}, Ce = ({
tabsContainerElement: t,
event: e
}) => {
t.preventDefault();
const o = t.target;
e.preventDefault();
const o = e.target;
if (!(o instanceof HTMLButtonElement))
return;
const n = e.querySelectorAll('[role="tab"]'), s = e.querySelectorAll('[role="tabpanel"]'), r = o.getAttribute("aria-controls"), c = Object.values(s).find(
(i) => i.id === r
const n = t.querySelectorAll('[role="tab"]'), s = t.querySelectorAll('[role="tabpanel"]'), i = o.getAttribute("aria-controls"), c = Object.values(s).find(
(r) => r.id === i
);
n.forEach((i) => {
i.setAttribute("aria-selected", "false");
}), s.forEach((i) => {
i.setAttribute("aria-hidden", "true");
n.forEach((r) => {
r.setAttribute("aria-selected", "false");
}), s.forEach((r) => {
r.setAttribute("aria-hidden", "true");
}), o.setAttribute("aria-selected", "true"), c && c.removeAttribute("aria-hidden");
}, I = (e) => e.code === "ArrowLeft" || e.keyCode === 39, H = (e) => e.code === "ArrowRight" || e.keyCode === 37, $e = (e = document.querySelectorAll(
}, D = (t) => t.code === "ArrowLeft" || t.keyCode === 39, R = (t) => t.code === "ArrowRight" || t.keyCode === 37, ke = (t = document.querySelectorAll(
".js-tabs"
)) => {
e.length > 0 && e.forEach((t) => {
const o = t.querySelectorAll('[role="tab"]');
t.length > 0 && t.forEach((e) => {
const o = e.querySelectorAll('[role="tab"]');
o.forEach((s) => {
s.addEventListener("click", (r) => {
qe({ tabsContainerElement: t, event: r });
s.addEventListener("click", (i) => {
Ce({ tabsContainerElement: e, event: i });
});
});
const n = t.querySelector('[role="tablist"]');
const n = e.querySelector('[role="tablist"]');
if (n && o.length > 0) {
let s = 0;
n.addEventListener("keydown", (r) => {
r instanceof KeyboardEvent && (I(r) || H(r)) && (o[s].setAttribute("tabindex", "-1"), I(r) ? (s += 1, s >= o.length && (s = 0)) : H(r) && (s -= 1, s < 0 && (s = o.length - 1)), o[s].setAttribute("tabindex", "0"), o[s].focus());
n.addEventListener("keydown", (i) => {
i instanceof KeyboardEvent && (D(i) || R(i)) && (o[s].setAttribute("tabindex", "-1"), D(i) ? (s += 1, s >= o.length && (s = 0)) : R(i) && (s -= 1, s < 0 && (s = o.length - 1)), o[s].setAttribute("tabindex", "0"), o[s].focus());
});
}
});
}, _ = "c-social-bar-item__container--is-highlighted", xe = (e) => {
const t = e.find(
(o) => o.classList.contains(_)
}, q = "c-social-bar-item__container--is-highlighted", Me = (t) => {
const e = t.find(
(o) => o.classList.contains(q)
);
t == null || t.classList.remove(_);
}, Ce = () => {
const e = document.querySelector(".c-toolbar");
if (e) {
const t = window.location.origin + window.location.pathname, o = Array.from(e.querySelectorAll(".c-social-bar-item__container"));
xe(o);
e == null || e.classList.remove(q);
}, Ie = () => {
const t = document.querySelector(".c-toolbar");
if (t) {
const e = window.location.origin + window.location.pathname, o = Array.from(t.querySelectorAll(".c-social-bar-item__container"));
Me(o);
const n = o.find(
(s) => {
var r;
return ((r = s.querySelector("a")) == null ? void 0 : r.getAttribute("href")) === t;
var i;
return ((i = s.querySelector("a")) == null ? void 0 : i.getAttribute("href")) === e;
}
);
n == null || n.classList.add(_);
n == null || n.classList.add(q);
}
}, Me = () => {
te(), $e(), V(), J(), be(), le(), ye(), Te(), K("olympicsGames", "countdown-olympics-games"), _e(), N(), oe(), F(), z(), Ce(), B(), W(), he(), me();
}, je = () => {
se(), ke(), z(), ee(), Le(), ue(), Ee(), xe(), Z("olympicsGames", "countdown-olympics-games"), qe(), K(), ie(), V(), X(), Ie(), N(), P(), be(), ge();
};
export {
Me as initScripts
je as initScripts
};

@@ -1,1 +0,1 @@

(function(g,b){typeof exports=="object"&&typeof module<"u"?b(exports):typeof define=="function"&&define.amd?define(["exports"],b):(g=typeof globalThis<"u"?globalThis:g||self,b(g.scripts={}))})(this,function(g){"use strict";var ke=Object.defineProperty;var Me=(g,b,L)=>b in g?ke(g,b,{enumerable:!0,configurable:!0,writable:!0,value:L}):g[b]=L;var S=(g,b,L)=>Me(g,typeof b!="symbol"?b+"":b,L);const b=()=>{const e=document.querySelector("#js-election-selector");e&&e.addEventListener("change",t=>{window.location.replace(t.target.value)})},L=()=>{const e=document.querySelector(".c-search-banner");if(e){const t=document.querySelector("#js-search-banner-to-hide"),o=e.querySelector("#js-search-banner-dropdown-btn");o==null||o.addEventListener("click",()=>{const n=o.querySelector("svg"),s=n==null?void 0:n.querySelector("use");switch(s==null?void 0:s.getAttribute("xlink:href")){case"#chevron-up":s==null||s.setAttribute("xlink:href","#chevron-down"),t==null||t.classList.add("u-hidden");break;case"#chevron-down":s==null||s.setAttribute("xlink:href","#chevron-up"),t==null||t.classList.remove("u-hidden");break}})}},W=()=>{const e=document.getElementById("elections-form-search"),t=document.querySelector(".c-search-form__autocomplete");if(!e||!t)return;const o=r=>{t.classList.remove("u-hidden");const c=t.querySelectorAll("li"),i=[];return c.forEach(l=>{const u=l.querySelector("a");u&&u.innerHTML.toLowerCase().includes(r.toLowerCase())&&i.push(l.innerHTML)}),i},n=r=>{t.innerHTML+=`<li>${r}</li>`},s=({target:r})=>{const c=r.value;if(t.classList.add("u-hidden"),c.length>=3){const i=o(c);t.innerHTML="",i.length===0&&t.classList.add("u-hidden"),i.forEach(l=>{n(l)})}};e.addEventListener("input",s),e.addEventListener("focusout",()=>{setTimeout(()=>t.classList.add("u-hidden"),300)}),e.addEventListener("focusin",()=>{t.childElementCount>0&&t.classList.remove("u-hidden")})},F=()=>{const e=document.querySelector("header"),t=document.querySelector(".js-limit-scroll-close-article-btn"),o=document.querySelector(".c-close-article-btn"),n=document.querySelector(".c-header-mobile"),s=n instanceof HTMLElement?n.offsetHeight:0;if(e&&t&&o){const r=new IntersectionObserver(()=>{const c=o.classList,i=c.contains("u-hidden"),l=e.getBoundingClientRect().bottom-s,u=t.getBoundingClientRect().bottom-s;i&&l<=0&&u>=0&&c.remove("u-hidden"),!i&&(l>=0||u<=0)&&c.add("u-hidden")},{root:document,rootMargin:`-${s}px 0px 0px 0px`});r.observe(e),r.observe(t)}},N=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"))}},P=(e=document.querySelector(".js-collapse__button"))=>{e&&document.querySelectorAll(".c-collapse__button").forEach(o=>{o.addEventListener("click",n=>{N(n)})})},V=(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"),c=o.querySelector(".js-countdown-seconds");if(!n||!s||!r||!c)return;window.counters={olympicsGames:"2024-07-26 20:00:00"};const i=window.counters[e],l=new Date(i).getTime(),u=setInterval(()=>{const m=new Date().getTime(),a=l-m;if(a<=0)clearInterval(u);else{const f=Math.floor(a/864e5),p=Math.floor(a%(1e3*60*60*24)/(1e3*60*60)),h=Math.floor(a%(1e3*60*60)/(1e3*60)),y=Math.floor(a%(1e3*60)/1e3);n.innerHTML=f.toString(),s.innerHTML=p.toString(),r.innerHTML=h.toString(),c.innerHTML=y.toString()}},1e3)}},K=e=>{const t=e.getBBox(),o=t.width/20;return[t.x-o,t.y-o,t.width+o*2,t.height+o*2].join(" ")},G=()=>{const e=document.querySelector(".c-map-districts");if(!e)return;const t=document.querySelector(".c-map-districts-container__unzoom-button");let o=e;const n=e.getAttribute("viewBox"),s=(a,f)=>{var p;return(p=a.matches)==null?void 0:p.call(a,f)},r=(a,f,p=".c-map-districts__zoomable:not(.js-selected-area)")=>{if(!a)return;let h,y=a.parentElement;for(;y instanceof SVGGraphicsElement&&y!==f;)s(y,p)&&(h=y),y=y.parentElement;return h},c=(a,f,p)=>{if(!a)return;let h=a.parentElement;for(;h instanceof SVGGraphicsElement&&h!==p;){if(f===h)return!0;h=h.parentElement}return p===f},i=(a,f)=>{f&&t&&(t.classList.add("u-hidden"),f!==n&&t.classList.remove("u-hidden"),o.classList.remove("js-selected-area"),o=a,o.classList.add("js-selected-area"),e.setAttribute("viewBox",f))},l=a=>{a.stopPropagation();const f=a.currentTarget;if(o&&e&&f instanceof SVGGraphicsElement){if(f===o)return;if(a.preventDefault(),o!==e&&!c(f,o,e)){i(e,n);return}const p=r(f,o);i(p||f,K(p||f))}},u=()=>{e&&o!==e&&i(e,n)};e.addEventListener("click",u),t&&t.addEventListener("click",u),document.querySelectorAll(".c-map-districts__zoomable").forEach(a=>{a.addEventListener("click",f=>l(f))})},z=e=>{var n;e.setAttribute("aria-expanded","true");const t=(n=e.parentNode)==null?void 0:n.querySelectorAll(".js-ellipsis-target");t==null||t.forEach(s=>s.classList.remove("u-ellipsis"));const o=e.querySelector(".js-ellipsis-button__label");o instanceof HTMLSpanElement&&(o.innerHTML="Voir moins")},Z=e=>{var n;const t=(n=e.parentNode)==null?void 0:n.querySelectorAll(".js-ellipsis-target");t==null||t.forEach(s=>s.classList.add("u-ellipsis")),e.setAttribute("aria-expanded","false");const o=e.querySelector(".js-ellipsis-button__label");o instanceof HTMLSpanElement&&(o.innerHTML="Voir plus")},Y=e=>{const t=e.currentTarget;return e.preventDefault(),t instanceof HTMLButtonElement?t.getAttribute("aria-expanded")==="true"?Z(t):z(t):null},X=(e=document.querySelector(".js-ellipsis-button"))=>{e&&document.querySelectorAll(".js-ellipsis-button").forEach(o=>o.addEventListener("click",Y))},J=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")},Q=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")},U=e=>{const t=e.currentTarget;return e.preventDefault(),t instanceof HTMLButtonElement?t.getAttribute("aria-expanded")==="true"?Q(t):J(t):null},ee=(e=document.querySelector(".js-expand-button"))=>{e&&document.querySelectorAll(".js-expand-button").forEach(o=>o.addEventListener("click",U))},te=()=>{const e=document.querySelectorAll(".js-half-donut-result");for(const t of Array.from(e)){const o=t.querySelector(".c-half-donut"),n=t.querySelector(".c-legend");if(!o||!n)return;n.querySelectorAll("[data-color]").forEach(s=>{const r=s.getAttribute("data-color"),c=o.querySelector(`.c-half-donut__zone--${r}`);c==null||c.addEventListener("mouseenter",()=>{s.classList.add("c-legend__item--is-hovered"),o.classList.add("c-half-donut--is-hovered"),n.classList.add("c-legend--is-hovered")}),c==null||c.addEventListener("mouseleave",()=>{s.classList.remove("c-legend__item--is-hovered"),o.classList.remove("c-half-donut--is-hovered"),n.classList.remove("c-legend--is-hovered")}),s.addEventListener("mouseenter",()=>{c==null||c.classList.add("c-half-donut__zone--is-hovered"),n.classList.add("c-legend--is-hovered"),o.classList.add("c-half-donut--is-hovered")}),s.addEventListener("mouseleave",()=>{c==null||c.classList.remove("c-half-donut__zone--is-hovered"),n.classList.remove("c-legend--is-hovered"),o.classList.remove("c-half-donut--is-hovered")})})}},d={inert:":not([inert]):not([inert] *)",negTabIndex:':not([tabindex^="-"])',disabled:":not(:disabled)"};var oe=[`a[href]${d.inert}${d.negTabIndex}`,`area[href]${d.inert}${d.negTabIndex}`,`input:not([type="hidden"]):not([type="radio"])${d.inert}${d.negTabIndex}${d.disabled}`,`input[type="radio"]${d.inert}${d.negTabIndex}${d.disabled}`,`select${d.inert}${d.negTabIndex}${d.disabled}`,`textarea${d.inert}${d.negTabIndex}${d.disabled}`,`button${d.inert}${d.negTabIndex}${d.disabled}`,`details${d.inert} > summary:first-of-type${d.negTabIndex}`,`iframe${d.inert}${d.negTabIndex}`,`audio[controls]${d.inert}${d.negTabIndex}`,`video[controls]${d.inert}${d.negTabIndex}`,`[contenteditable]${d.inert}${d.negTabIndex}`,`[tabindex]${d.inert}${d.negTabIndex}`];function x(e){(e.querySelector("[autofocus]")||e).focus()}function ne(e){const t=E(e,!0),o=t?E(e,!1)||t:null;return[t,o]}function E(e,t){if(t&&M(e))return e;if(ie(e))if(e.shadowRoot){let o=C(e.shadowRoot,t);for(;o;){const n=E(o,t);if(n)return n;o=k(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=C(e,t);for(;o;){const n=E(o,t);if(n)return n;o=k(o,t)}}return!t&&M(e)?e:null}function C(e,t){return t?e.firstElementChild:e.lastElementChild}function k(e,t){return t?e.nextElementSibling:e.previousElementSibling}const se=e=>e.matches("details:not([open]) *")&&!e.matches("details>summary:first-of-type")?!0:!(e.offsetWidth||e.offsetHeight||e.getClientRects().length),M=e=>{var t;return(t=e.shadowRoot)!=null&&t.delegatesFocus?!1:e.matches(oe.join(","))&&!se(e)};function ie(e){return e.shadowRoot&&e.getAttribute("tabindex")==="-1"?!1:!e.matches(":disabled,[hidden],[inert]")}function _(e=document){const t=e.activeElement;return t?t.shadowRoot?_(t.shadowRoot)||document.activeElement:t:null}function re(e,t){const[o,n]=ne(e);if(!o)return t.preventDefault();const s=_();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=_(),((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"&&re(this.$el,t)}maintainFocus(t){t.target.closest('[aria-modal="true"], [data-a11y-dialog-ignore-focus-trap]')||x(this.$el)}}function H(){for(const e of document.querySelectorAll("[data-a11y-dialog]"))new I(e)}typeof document<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",H):H());const ce=()=>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)})}),le=({navigatedList:e,nextBtn:t,prevBtn:o})=>{var r,c,i,l,u,m,a,f;const n=e.scrollLeft>0,s=e.scrollLeft+e.clientWidth<e.scrollWidth;n&&s?((r=t.classList)==null||r.add("o-nav-button--visible"),(c=o.classList)==null||c.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?((u=t.classList)==null||u.add("o-nav-button--visible"),(m=o.classList)==null||m.remove("o-nav-button--visible")):((a=t.classList)==null||a.remove("o-nav-button--visible"),(f=o.classList)==null||f.remove("o-nav-button--visible"))},ae=({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"),c=r==null?void 0:r.querySelectorAll(".c-stepper__item");if(c){const i=Array.from(c).findIndex(l=>l.classList.contains("c-stepper__item--loading"));if(i<0)c[0].classList.add("c-stepper__item--loading");else{c[i].classList.remove("c-stepper__item--loading"),c[i].classList.add("c-stepper__item--loaded");const l=c[i].querySelector(".c-stepper__loader");l&&l instanceof HTMLElement&&(l.style.transition="width 0s linear"),i+1<c.length&&c[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")}}},de=({navigatedList:e,nextBtn:t,prevBtn:o,sliderVariant:n,delay:s})=>{if(e){const r=e.closest(".js-overview-bar-container"),c=r==null?void 0:r.querySelector(".c-stepper"),i=c==null?void 0:c.querySelectorAll(".c-stepper__item");if(i){const l=Array.from(i).findIndex(u=>u.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 u=i[l-1].querySelector(".c-stepper__loader");i[l-1].classList.add("c-stepper__item--loading"),u&&u instanceof HTMLElement&&(u.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")}},ue=({navigatedList:e,nextBtn:t,prevBtn:o})=>{le({navigatedList:e,nextBtn:t,prevBtn:o})},fe=()=>{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,c=t.closest(".js-overview-bar-container"),i=c==null?void 0:c.querySelector(".c-stepper"),l=i==null?void 0:i.querySelectorAll(".c-stepper__item");if(t){const u=t.querySelector(".js-navigation-container__list"),m=t.querySelector(".o-nav-button--next-button"),a=t.querySelector(".o-nav-button--previous-button");if(u&&u.clientWidth<u.scrollWidth&&(m==null||m.classList.add("o-nav-button--visible")),u&&m&&a&&(m==null||m.addEventListener("click",ae.bind(!1,{navigatedList:u,nextBtn:m,prevBtn:a,sliderVariant:o})),a==null||a.addEventListener("click",de.bind(!1,{navigatedList:u,nextBtn:m,prevBtn:a,sliderVariant:o,delay:r}))),n==="true"&&m){const f=i?i.querySelector(".c-stepper__item--loading"):null;l&&(l.forEach(p=>{const h=p.querySelector(".c-stepper__loader");h&&h instanceof HTMLElement&&(h.style.transition=`width ${r/1e3}s linear`)}),f||l[0].classList.add("c-stepper__item--loading")),setInterval(()=>{m.classList.contains("o-nav-button--visible")?m.click():u&&a&&(u.scrollLeft=0,l&&(l.forEach(p=>{const h=p.querySelector(".c-stepper__loader");h&&h instanceof HTMLElement&&(h.style.transition="width 0s linear"),p.classList.remove("c-stepper__item--loading"),p.classList.remove("c-stepper__item--loaded"),setTimeout(()=>{h&&h instanceof HTMLElement&&(h.style.transition=`width ${r/1e3}s linear`)},0)}),setTimeout(()=>{l[0].classList.add("c-stepper__item--loading")},0)),a.click())},r)}}}},he=()=>{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",ue.bind(!1,{navigatedList:o,nextBtn:n,prevBtn:s}))}},me=()=>{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%")},pe=()=>{document.querySelector(".c-progress")&&window.addEventListener("scroll",me)};let v,A=0;const be=()=>{v=null,document.body.getBoundingClientRect().top>A+2&&(v="up"),document.body.getBoundingClientRect().top<A-2&&(v="down"),A=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"))}},ge=(e=document.querySelector(".c-read-also-banner"))=>{if(e){let t;window.addEventListener("scroll",()=>{clearTimeout(t),t=setTimeout(be,100)})}},T="#page-content",q="#text-tooltip",ye=".tooltip-btn",j="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"],D=(e,t)=>e instanceof Element?t.some(o=>e.matches(o)):!1,Ee=(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&&D(o,t)||!!n&&D(n,t)},ve=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},Se=(e,t,o)=>{const n=document.querySelector(`${T} ${q}`),s=document.querySelector(`${T}`),r=document.querySelectorAll(`${T} ${q} ${ye}`);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 c=e.getClientRects(),i=c[t?c.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(j)},O=()=>{const e=document.querySelector(`${q}`);e&&e.classList.remove(j)},w=({type:e})=>{const t=window.getSelection();if(e==="selectionchange"){O();return}if(!t||!t.rangeCount)return;const o=t.getRangeAt(0),n=t.toString().trim();if(n.length){const s=Ee(o,Le),r=ve(t)||!1;s&&Se(o,r,n);return}O()},we=()=>{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)},_e=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"))}},Ae=(e=document.querySelector(".c-search-form--button"))=>{e&&e.addEventListener("click",t=>{_e(t)})},Te=({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"),c=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"),c&&c.removeAttribute("aria-hidden")},R=e=>e.code==="ArrowLeft"||e.keyCode===39,B=e=>e.code==="ArrowRight"||e.keyCode===37,qe=(e=document.querySelectorAll(".js-tabs"))=>{e.length>0&&e.forEach(t=>{const o=t.querySelectorAll('[role="tab"]');o.forEach(s=>{s.addEventListener("click",r=>{Te({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&&(R(r)||B(r))&&(o[s].setAttribute("tabindex","-1"),R(r)?(s+=1,s>=o.length&&(s=0)):B(r)&&(s-=1,s<0&&(s=o.length-1)),o[s].setAttribute("tabindex","0"),o[s].focus())})}})},$="c-social-bar-item__container--is-highlighted",$e=e=>{const t=e.find(o=>o.classList.contains($));t==null||t.classList.remove($)},xe=()=>{const e=document.querySelector(".c-toolbar");if(e){const t=window.location.origin+window.location.pathname,o=Array.from(e.querySelectorAll(".c-social-bar-item__container"));$e(o);const n=o.find(s=>{var r;return((r=s.querySelector("a"))==null?void 0:r.getAttribute("href"))===t});n==null||n.classList.add($)}},Ce=()=>{ee(),qe(),P(),X(),pe(),ce(),ge(),Ae(),V("olympicsGames","countdown-olympics-games"),we(),F(),te(),W(),G(),xe(),b(),L(),fe(),he()};g.initScripts=Ce,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});
(function(g,p){typeof exports=="object"&&typeof module<"u"?p(exports):typeof define=="function"&&define.amd?define(["exports"],p):(g=typeof globalThis<"u"?globalThis:g||self,p(g.scripts={}))})(this,function(g){"use strict";var He=Object.defineProperty;var je=(g,p,E)=>p in g?He(g,p,{enumerable:!0,configurable:!0,writable:!0,value:E}):g[p]=E;var A=(g,p,E)=>je(g,typeof p!="symbol"?p+"":p,E);const p=()=>{const t=document.querySelector("#js-election-selector");t&&t.addEventListener("change",e=>{window.location.replace(e.target.value)})},E=()=>{const t=document.querySelector(".c-search-banner");if(t){const e=document.querySelector("#js-search-banner-to-hide"),o=t.querySelector("#js-search-banner-dropdown-btn");o==null||o.addEventListener("click",()=>{const n=o.querySelector("svg"),s=n==null?void 0:n.querySelector("use");switch(s==null?void 0:s.getAttribute("xlink:href")){case"#chevron-up":s==null||s.setAttribute("xlink:href","#chevron-down"),e==null||e.classList.add("u-hidden");break;case"#chevron-down":s==null||s.setAttribute("xlink:href","#chevron-up"),e==null||e.classList.remove("u-hidden");break}})}},P=()=>{const t=document.getElementById("elections-form-search"),e=document.querySelector(".c-search-form__autocomplete");if(!t||!e)return;const o=i=>{e.classList.remove("u-hidden");const c=e.querySelectorAll("li"),r=[];return c.forEach(l=>{const u=l.querySelector("a");u&&u.innerHTML.toLowerCase().includes(i.toLowerCase())&&r.push(l.innerHTML)}),r},n=i=>{e.innerHTML+=`<li>${i}</li>`},s=({target:i})=>{const c=i.value;if(e.classList.add("u-hidden"),c.length>=3){const r=o(c);e.innerHTML="",r.length===0&&e.classList.add("u-hidden"),r.forEach(l=>{n(l)})}};t.addEventListener("input",s),t.addEventListener("focusout",()=>{setTimeout(()=>e.classList.add("u-hidden"),300)}),t.addEventListener("focusin",()=>{e.childElementCount>0&&e.classList.remove("u-hidden")})},V=()=>{const t=document.querySelector("header"),e=document.querySelector(".js-limit-scroll-close-article-btn"),o=document.querySelector(".c-close-article-btn"),n=document.querySelector(".c-header-mobile"),s=n instanceof HTMLElement?n.offsetHeight:0;if(t&&e&&o){const i=new IntersectionObserver(()=>{const c=o.classList,r=c.contains("u-hidden"),l=t.getBoundingClientRect().bottom-s,u=e.getBoundingClientRect().bottom-s;r&&l<=0&&u>=0&&c.remove("u-hidden"),!r&&(l>=0||u<=0)&&c.add("u-hidden")},{root:document,rootMargin:`-${s}px 0px 0px 0px`});i.observe(t),i.observe(e)}},K=t=>{t.stopImmediatePropagation(),t.preventDefault();const e=t.currentTarget;if(e instanceof HTMLButtonElement){const o=e.parentElement,n=o==null?void 0:o.querySelector(`#${e.getAttribute("aria-controls")}`);e.getAttribute("aria-expanded")==="true"?(e.setAttribute("aria-expanded","false"),n==null||n.setAttribute("aria-hidden","true")):(e.setAttribute("aria-expanded","true"),n==null||n.setAttribute("aria-hidden","false"))}},G=(t=document.querySelector(".js-collapse__button"))=>{t&&document.querySelectorAll(".c-collapse__button").forEach(o=>{o.addEventListener("click",n=>{K(n)})})},z=(t,e)=>{const o=document.querySelector(`#${e}`);if(o){const n=o.querySelector(".js-countdown-days"),s=o.querySelector(".js-countdown-hours"),i=o.querySelector(".js-countdown-minutes"),c=o.querySelector(".js-countdown-seconds");if(!n||!s||!i||!c)return;window.counters={olympicsGames:"2024-07-26 20:00:00"};const r=window.counters[t],l=new Date(r).getTime(),u=setInterval(()=>{const f=new Date().getTime(),m=l-f;if(m<=0)clearInterval(u);else{const y=Math.floor(m/864e5),L=Math.floor(m%(1e3*60*60*24)/(1e3*60*60)),d=Math.floor(m%(1e3*60*60)/(1e3*60)),h=Math.floor(m%(1e3*60)/1e3);n.innerHTML=y.toString(),s.innerHTML=L.toString(),i.innerHTML=d.toString(),c.innerHTML=h.toString()}},1e3)}},Z=t=>{const e=t.getBBox(),o=e.width/20;return[e.x-o,e.y-o,e.width+o*2,e.height+o*2].join(" ")},Y=()=>{const t=document.querySelector(".c-map-districts-container"),e=document.querySelector(".c-map-districts");if(!t||!e)return;const o=document.querySelector(".c-map-districts-container__description"),n=document.querySelector(".c-map-districts-container__department"),s=document.querySelector(".c-map-districts-container__unzoom-button");let i=e;const c=e.getAttribute("viewBox"),r=(d,h)=>{var b;return(b=d.matches)==null?void 0:b.call(d,h)},l=(d,h,b=".c-map-districts__zoomable:not(.js-selected-area)")=>{if(!d)return;let v,S=d.parentElement;for(;S instanceof SVGGraphicsElement&&S!==h;)r(S,b)&&(v=S),S=S.parentElement;return v},u=(d,h,b)=>{if(!d)return;let v=d.parentElement;for(;v instanceof SVGGraphicsElement&&v!==b;){if(h===v)return!0;v=v.parentElement}return b===h},f=(d,h)=>{if(h&&s&&o){t.classList.remove("c-map-districts-container--department-view"),o.classList.remove("u-hidden"),n==null||n.classList.add("u-hidden"),s.classList.add("u-hidden"),h!==c&&(o.classList.add("u-hidden"),s.classList.remove("u-hidden")),i.classList.remove("js-selected-area"),i=d;const b=i.getAttribute("data-info");n&&b&&(t.classList.add("c-map-districts-container--department-view"),n.classList.remove("u-hidden"),n.innerHTML=b),i.classList.add("js-selected-area"),e.setAttribute("viewBox",h)}},m=d=>{d.stopPropagation();const h=d.currentTarget;if(i&&e&&h instanceof SVGGraphicsElement){if(h===i)return;if(d.preventDefault(),i!==e&&!u(h,i,e)){f(e,c);return}const b=l(h,i);f(b||h,Z(b||h))}},y=()=>{e&&i!==e&&f(e,c)};e.addEventListener("click",y),s&&s.addEventListener("click",y),document.querySelectorAll(".c-map-districts__zoomable").forEach(d=>{d.addEventListener("click",h=>m(h))})},X=t=>{var n;t.setAttribute("aria-expanded","true");const e=(n=t.parentNode)==null?void 0:n.querySelectorAll(".js-ellipsis-target");e==null||e.forEach(s=>s.classList.remove("u-ellipsis"));const o=t.querySelector(".js-ellipsis-button__label");o instanceof HTMLSpanElement&&(o.innerHTML="Voir moins")},J=t=>{var n;const e=(n=t.parentNode)==null?void 0:n.querySelectorAll(".js-ellipsis-target");e==null||e.forEach(s=>s.classList.add("u-ellipsis")),t.setAttribute("aria-expanded","false");const o=t.querySelector(".js-ellipsis-button__label");o instanceof HTMLSpanElement&&(o.innerHTML="Voir plus")},Q=t=>{const e=t.currentTarget;return t.preventDefault(),e instanceof HTMLButtonElement?e.getAttribute("aria-expanded")==="true"?J(e):X(e):null},U=(t=document.querySelector(".js-ellipsis-button"))=>{t&&document.querySelectorAll(".js-ellipsis-button").forEach(o=>o.addEventListener("click",Q))},ee=t=>{var n;t.setAttribute("aria-expanded","true");const e=(n=t.parentNode)==null?void 0:n.querySelectorAll(".js-expand-target");e==null||e.forEach(s=>s.setAttribute("aria-hidden","false"));const o=t.querySelector(".js-expand-button__label");o instanceof HTMLSpanElement&&(o.innerHTML="Voir moins")},te=t=>{var n;const e=(n=t.parentNode)==null?void 0:n.querySelectorAll(".js-expand-target");e==null||e.forEach(s=>s.setAttribute("aria-hidden","true")),t.setAttribute("aria-expanded","false");const o=t.querySelector(".js-expand-button__label");o instanceof HTMLSpanElement&&(o.innerHTML="Voir plus")},oe=t=>{const e=t.currentTarget;return t.preventDefault(),e instanceof HTMLButtonElement?e.getAttribute("aria-expanded")==="true"?te(e):ee(e):null},ne=(t=document.querySelector(".js-expand-button"))=>{t&&document.querySelectorAll(".js-expand-button").forEach(o=>o.addEventListener("click",oe))},se=()=>{const t=document.querySelectorAll(".js-half-donut-result");for(const e of Array.from(t)){const o=e.querySelector(".c-half-donut"),n=e.querySelector(".c-legend");if(!o||!n)return;n.querySelectorAll("[data-color]").forEach(s=>{const i=s.getAttribute("data-color"),c=o.querySelector(`.c-half-donut__zone--${i}`);c==null||c.addEventListener("mouseenter",()=>{s.classList.add("c-legend__item--is-hovered"),o.classList.add("c-half-donut--is-hovered"),n.classList.add("c-legend--is-hovered")}),c==null||c.addEventListener("mouseleave",()=>{s.classList.remove("c-legend__item--is-hovered"),o.classList.remove("c-half-donut--is-hovered"),n.classList.remove("c-legend--is-hovered")}),s.addEventListener("mouseenter",()=>{c==null||c.classList.add("c-half-donut__zone--is-hovered"),n.classList.add("c-legend--is-hovered"),o.classList.add("c-half-donut--is-hovered")}),s.addEventListener("mouseleave",()=>{c==null||c.classList.remove("c-half-donut__zone--is-hovered"),n.classList.remove("c-legend--is-hovered"),o.classList.remove("c-half-donut--is-hovered")})})}},a={inert:":not([inert]):not([inert] *)",negTabIndex:':not([tabindex^="-"])',disabled:":not(:disabled)"};var ie=[`a[href]${a.inert}${a.negTabIndex}`,`area[href]${a.inert}${a.negTabIndex}`,`input:not([type="hidden"]):not([type="radio"])${a.inert}${a.negTabIndex}${a.disabled}`,`input[type="radio"]${a.inert}${a.negTabIndex}${a.disabled}`,`select${a.inert}${a.negTabIndex}${a.disabled}`,`textarea${a.inert}${a.negTabIndex}${a.disabled}`,`button${a.inert}${a.negTabIndex}${a.disabled}`,`details${a.inert} > summary:first-of-type${a.negTabIndex}`,`iframe${a.inert}${a.negTabIndex}`,`audio[controls]${a.inert}${a.negTabIndex}`,`video[controls]${a.inert}${a.negTabIndex}`,`[contenteditable]${a.inert}${a.negTabIndex}`,`[tabindex]${a.inert}${a.negTabIndex}`];function M(t){(t.querySelector("[autofocus]")||t).focus()}function re(t){const e=_(t,!0),o=e?_(t,!1)||e:null;return[e,o]}function _(t,e){if(e&&j(t))return t;if(le(t))if(t.shadowRoot){let o=I(t.shadowRoot,e);for(;o;){const n=_(o,e);if(n)return n;o=H(o,e)}}else if(t.localName==="slot"){const o=t.assignedElements({flatten:!0});e||o.reverse();for(const n of o){const s=_(n,e);if(s)return s}}else{let o=I(t,e);for(;o;){const n=_(o,e);if(n)return n;o=H(o,e)}}return!e&&j(t)?t:null}function I(t,e){return e?t.firstElementChild:t.lastElementChild}function H(t,e){return e?t.nextElementSibling:t.previousElementSibling}const ce=t=>t.matches("details:not([open]) *")&&!t.matches("details>summary:first-of-type")?!0:!(t.offsetWidth||t.offsetHeight||t.getClientRects().length),j=t=>{var e;return(e=t.shadowRoot)!=null&&e.delegatesFocus?!1:t.matches(ie.join(","))&&!ce(t)};function le(t){return t.shadowRoot&&t.getAttribute("tabindex")==="-1"?!1:!t.matches(":disabled,[hidden],[inert]")}function q(t=document){const e=t.activeElement;return e?e.shadowRoot?q(e.shadowRoot)||document.activeElement:e:null}function ae(t,e){const[o,n]=re(t);if(!o)return e.preventDefault();const s=q();e.shiftKey&&s===o?(n.focus(),e.preventDefault()):!e.shiftKey&&s===n&&(o.focus(),e.preventDefault())}class D{constructor(e){A(this,"$el");A(this,"id");A(this,"previouslyFocused");A(this,"shown");this.$el=e,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(e){var o;return this.shown?this:(this.shown=!0,this.$el.removeAttribute("aria-hidden"),this.previouslyFocused=q(),((o=this.previouslyFocused)==null?void 0:o.tagName)==="BODY"&&(e!=null&&e.target)&&(this.previouslyFocused=e.target),(e==null?void 0:e.type)==="focus"?this.maintainFocus(e):M(this.$el),document.body.addEventListener("focus",this.maintainFocus,!0),this.$el.addEventListener("keydown",this.bindKeypress,!0),this.fire("show",e),this)}hide(e){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",e),this):this}on(e,o,n){return this.$el.addEventListener(e,o,n),this}off(e,o,n){return this.$el.removeEventListener(e,o,n),this}fire(e,o){this.$el.dispatchEvent(new CustomEvent(e,{detail:o,cancelable:!0}))}handleTriggerClicks(e){const o=e.target;o.closest(`[data-a11y-dialog-show="${this.id}"]`)&&this.show(e),(o.closest(`[data-a11y-dialog-hide="${this.id}"]`)||o.closest("[data-a11y-dialog-hide]")&&o.closest('[aria-modal="true"]')===this.$el)&&this.hide(e)}bindKeypress(e){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{}e.key==="Escape"&&this.$el.getAttribute("role")!=="alertdialog"&&!o&&(e.preventDefault(),this.hide(e)),e.key==="Tab"&&ae(this.$el,e)}maintainFocus(e){e.target.closest('[aria-modal="true"], [data-a11y-dialog-ignore-focus-trap]')||M(this.$el)}}function O(){for(const t of document.querySelectorAll("[data-a11y-dialog]"))new D(t)}typeof document<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",O):O());const de=()=>document.querySelectorAll(".js-modal").forEach(t=>{if(!(t instanceof HTMLElement))return;const e=new D(t),o={x:0,y:0};e.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)})}),ue=({navigatedList:t,nextBtn:e,prevBtn:o})=>{var i,c,r,l,u,f,m,y;const n=t.scrollLeft>0,s=t.scrollLeft+t.clientWidth<t.scrollWidth;n&&s?((i=e.classList)==null||i.add("o-nav-button--visible"),(c=o.classList)==null||c.add("o-nav-button--visible")):n?((r=e.classList)==null||r.remove("o-nav-button--visible"),(l=o.classList)==null||l.add("o-nav-button--visible")):s?((u=e.classList)==null||u.add("o-nav-button--visible"),(f=o.classList)==null||f.remove("o-nav-button--visible")):((m=e.classList)==null||m.remove("o-nav-button--visible"),(y=o.classList)==null||y.remove("o-nav-button--visible"))},fe=({navigatedList:t,nextBtn:e,prevBtn:o,sliderVariant:n})=>{if(t){const s=t.closest(".js-overview-bar-container"),i=s==null?void 0:s.querySelector(".c-stepper"),c=i==null?void 0:i.querySelectorAll(".c-stepper__item");if(c){const r=Array.from(c).findIndex(l=>l.classList.contains("c-stepper__item--loading"));if(r<0)c[0].classList.add("c-stepper__item--loading");else{c[r].classList.remove("c-stepper__item--loading"),c[r].classList.add("c-stepper__item--loaded");const l=c[r].querySelector(".c-stepper__loader");l&&l instanceof HTMLElement&&(l.style.transition="width 0s linear"),r+1<c.length&&c[r+1].classList.add("c-stepper__item--loading")}}if(t.scrollWidth-t.clientWidth>t.clientWidth){let r=t.scrollLeft;switch(n){case"three-columns-articles":r+=t.clientWidth+32;break;case"rubrics":r+=t.clientWidth-36;break;default:r+=Math.ceil(t.clientWidth*.6);break}t.scrollTo({left:r,behavior:"smooth"}),o.classList.add("o-nav-button--visible"),r+t.clientWidth>=t.scrollWidth&&e.classList.remove("o-nav-button--visible")}else{const r=t.scrollWidth-t.clientWidth;t.scrollTo({left:r,behavior:"smooth"}),e.classList.remove("o-nav-button--visible"),o.classList.add("o-nav-button--visible")}}},he=({navigatedList:t,nextBtn:e,prevBtn:o,sliderVariant:n,delay:s})=>{if(t){const i=t.closest(".js-overview-bar-container"),c=i==null?void 0:i.querySelector(".c-stepper"),r=c==null?void 0:c.querySelectorAll(".c-stepper__item");if(r){const l=Array.from(r).findIndex(u=>u.classList.contains("c-stepper__item--loading"));l<0?r[0].classList.add("c-stepper__item--loading"):(r[l].classList.remove("c-stepper__item--loading"),r[l].classList.remove("c-stepper__item--loaded"),l-1>0&&(r[l-1].classList.remove("c-stepper__item--loading"),r[l-1].classList.remove("c-stepper__item--loaded"),setTimeout(()=>{const u=r[l-1].querySelector(".c-stepper__loader");r[l-1].classList.add("c-stepper__item--loading"),u&&u instanceof HTMLElement&&(u.style.transition=`width ${s/1e3}s linear`)},0)))}if(t.clientWidth<t.scrollLeft){let l=t.scrollLeft;switch(n){case"three-columns-articles":l-=t.clientWidth+32;break;case"rubrics":l-=t.clientWidth-36;break;default:l-=Math.ceil(t.clientWidth*.6);break}t.scrollTo({left:l,behavior:"smooth"}),e.classList.add("o-nav-button--visible"),l===0&&o.classList.remove("o-nav-button--visible")}else t.scrollTo({left:0,behavior:"smooth"}),o.classList.remove("o-nav-button--visible"),t.clientWidth<t.scrollWidth&&e.classList.add("o-nav-button--visible")}},me=({navigatedList:t,nextBtn:e,prevBtn:o})=>{ue({navigatedList:t,nextBtn:e,prevBtn:o})},pe=()=>{const t=document.querySelectorAll(".js-navigation-container");for(const e of Array.from(t)){const{sliderVariant:o}=e.dataset,{sliderAuto:n}=e.dataset,{sliderDelay:s}=e.dataset,i=s?parseInt(s,10):3e3,c=e.closest(".js-overview-bar-container"),r=c==null?void 0:c.querySelector(".c-stepper"),l=r==null?void 0:r.querySelectorAll(".c-stepper__item");if(e){const u=e.querySelector(".js-navigation-container__list"),f=e.querySelector(".o-nav-button--next-button"),m=e.querySelector(".o-nav-button--previous-button");if(u&&u.clientWidth<u.scrollWidth&&(f==null||f.classList.add("o-nav-button--visible")),u&&f&&m&&(f==null||f.addEventListener("click",fe.bind(!1,{navigatedList:u,nextBtn:f,prevBtn:m,sliderVariant:o})),m==null||m.addEventListener("click",he.bind(!1,{navigatedList:u,nextBtn:f,prevBtn:m,sliderVariant:o,delay:i}))),n==="true"&&f){const y=r?r.querySelector(".c-stepper__item--loading"):null;l&&(l.forEach(L=>{const d=L.querySelector(".c-stepper__loader");d&&d instanceof HTMLElement&&(d.style.transition=`width ${i/1e3}s linear`)}),y||l[0].classList.add("c-stepper__item--loading")),setInterval(()=>{f.classList.contains("o-nav-button--visible")?f.click():u&&m&&(u.scrollLeft=0,l&&(l.forEach(L=>{const d=L.querySelector(".c-stepper__loader");d&&d instanceof HTMLElement&&(d.style.transition="width 0s linear"),L.classList.remove("c-stepper__item--loading"),L.classList.remove("c-stepper__item--loaded"),setTimeout(()=>{d&&d instanceof HTMLElement&&(d.style.transition=`width ${i/1e3}s linear`)},0)}),setTimeout(()=>{l[0].classList.add("c-stepper__item--loading")},0)),m.click())},i)}}}},be=()=>{const t=document.querySelectorAll(".js-navigation-container");for(const e of Array.from(t))if(e){const o=e.querySelector(".js-navigation-container__list"),n=e.querySelector(".o-nav-button--next-button"),s=e.querySelector(".o-nav-button--previous-button");o&&n&&s&&window.addEventListener("resize",me.bind(!1,{navigatedList:o,nextBtn:n,prevBtn:s}))}},ge=()=>{const t=document.querySelector(".js-limit-scroll-progress-bar"),e=document.querySelector(".c-progress__bar");if(!e)return;const{documentElement:o}=document;let n=o.scrollHeight-o.clientHeight;if(!n)return;const s=o.scrollTop;t&&(n=t.scrollHeight-o.clientHeight+(window.pageYOffset+t.getBoundingClientRect().top));const i=Math.round(s/n*100);e.style.width=`${i}%`,i>=100&&(e.style.width="100%")},ye=()=>{document.querySelector(".c-progress")&&window.addEventListener("scroll",ge)};let w,$=0;const Le=()=>{w=null,document.body.getBoundingClientRect().top>$+2&&(w="up"),document.body.getBoundingClientRect().top<$-2&&(w="down"),$=document.body.getBoundingClientRect().top;const t=document.querySelector(".c-read-also-banner");if(t){const e=t.dataset.bannerLimitTop||"0";w==="up"&&-document.body.getBoundingClientRect().top>=parseInt(e,10)&&(t.classList.remove("c-read-also-banner__scrolldirection--down"),t.style.paddingTop="0.75em",t.style.paddingBottom="0.75em",t.style.borderWidth="1px",t.classList.contains("c-read-also-banner__scrolldirection--up")||t.classList.add("c-read-also-banner__scrolldirection--up")),(w==="down"||-document.body.getBoundingClientRect().top<=parseInt(e,10))&&(t.classList.remove("c-read-also-banner__scrolldirection--up"),t.style.paddingTop="0",t.style.paddingBottom="0",t.style.borderWidth="0",t.classList.contains("c-read-also-banner__scrolldirection--down")||t.classList.add("c-read-also-banner__scrolldirection--down"))}},ve=(t=document.querySelector(".c-read-also-banner"))=>{if(t){let e;window.addEventListener("scroll",()=>{clearTimeout(e),e=setTimeout(Le,100)})}},x="#page-content",C="#text-tooltip",Ee=".tooltip-btn",R="c-text-tooltip--show",Se=["#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"],B=(t,e)=>t instanceof Element?e.some(o=>t.matches(o)):!1,_e=(t,e)=>{const o=t.startContainer.nodeType===Node.ELEMENT_NODE?t.startContainer:t.startContainer.parentElement,n=t.endContainer.nodeType===Node.ELEMENT_NODE?t.endContainer:t.endContainer.parentElement;return!!o&&B(o,e)||!!n&&B(n,e)},we=t=>{var o;if(!t.focusNode)return null;const e=(o=t.anchorNode)==null?void 0:o.compareDocumentPosition(t.focusNode);return e?(e&4)>0:t.anchorOffset<t.focusOffset},Ae=(t,e,o)=>{const n=document.querySelector(`${x} ${C}`),s=document.querySelector(`${x}`),i=document.querySelectorAll(`${x} ${C} ${Ee}`);if(!n||!s){console.warn("Text tooltip : Tooltip or it's parent are not found in the DOM");return}Array.from(i).forEach(l=>l.setAttribute("data-selected-text",o));const c=t.getClientRects(),r=c[e?c.length-1:0];n.style.top=`${r.top-s.getBoundingClientRect().top-(n.offsetHeight+10)}px`,r.width<n.offsetWidth?n.style.left=`${r.left-s.getBoundingClientRect().left+r.width/2-n.offsetWidth/2}px`:e?n.style.left=`${r.left-s.getBoundingClientRect().left+r.width-n.offsetWidth}px`:n.style.left=`${r.left-s.getBoundingClientRect().left}px`,n.classList.add(R)},W=()=>{const t=document.querySelector(`${C}`);t&&t.classList.remove(R)},T=({type:t})=>{const e=window.getSelection();if(t==="selectionchange"){W();return}if(!e||!e.rangeCount)return;const o=e.getRangeAt(0),n=e.toString().trim();if(n.length){const s=_e(o,Se),i=we(e)||!1;s&&Ae(o,i,n);return}W()},Te=()=>{if(!(window!=null&&window.getSelection)){console.warn("Selection API isn't supported");return}document.addEventListener("mouseup",T),document.addEventListener("selectionchange",T),document.addEventListener("touchend",T),document.addEventListener("touchcancel",T)},qe=t=>{const{target:e}=t;if(e instanceof Element){const o=e.closest(".c-search-form--button");o&&(t.preventDefault(),o.classList.remove("c-search-form--button"))}},$e=(t=document.querySelector(".c-search-form--button"))=>{t&&t.addEventListener("click",e=>{qe(e)})},xe=({tabsContainerElement:t,event:e})=>{e.preventDefault();const o=e.target;if(!(o instanceof HTMLButtonElement))return;const n=t.querySelectorAll('[role="tab"]'),s=t.querySelectorAll('[role="tabpanel"]'),i=o.getAttribute("aria-controls"),c=Object.values(s).find(r=>r.id===i);n.forEach(r=>{r.setAttribute("aria-selected","false")}),s.forEach(r=>{r.setAttribute("aria-hidden","true")}),o.setAttribute("aria-selected","true"),c&&c.removeAttribute("aria-hidden")},F=t=>t.code==="ArrowLeft"||t.keyCode===39,N=t=>t.code==="ArrowRight"||t.keyCode===37,Ce=(t=document.querySelectorAll(".js-tabs"))=>{t.length>0&&t.forEach(e=>{const o=e.querySelectorAll('[role="tab"]');o.forEach(s=>{s.addEventListener("click",i=>{xe({tabsContainerElement:e,event:i})})});const n=e.querySelector('[role="tablist"]');if(n&&o.length>0){let s=0;n.addEventListener("keydown",i=>{i instanceof KeyboardEvent&&(F(i)||N(i))&&(o[s].setAttribute("tabindex","-1"),F(i)?(s+=1,s>=o.length&&(s=0)):N(i)&&(s-=1,s<0&&(s=o.length-1)),o[s].setAttribute("tabindex","0"),o[s].focus())})}})},k="c-social-bar-item__container--is-highlighted",ke=t=>{const e=t.find(o=>o.classList.contains(k));e==null||e.classList.remove(k)},Me=()=>{const t=document.querySelector(".c-toolbar");if(t){const e=window.location.origin+window.location.pathname,o=Array.from(t.querySelectorAll(".c-social-bar-item__container"));ke(o);const n=o.find(s=>{var i;return((i=s.querySelector("a"))==null?void 0:i.getAttribute("href"))===e});n==null||n.classList.add(k)}},Ie=()=>{ne(),Ce(),G(),U(),ye(),de(),ve(),$e(),z("olympicsGames","countdown-olympics-games"),Te(),V(),se(),P(),Y(),Me(),p(),E(),pe(),be()};g.initScripts=Ie,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});

@@ -5,5 +5,5 @@ import { BoxProps } from '../..';

export interface TagOptions {
variant?: 'primary' | 'secondary' | 'ternary' | 'breadcrumb';
variant?: 'primary' | 'secondary' | 'ternary' | 'breadcrumb' | 'span';
}
export type TagProps<T extends As = 'a'> = TagOptions & BoxProps<T>;
export declare const Tag: import('../../../types').ComponentWithAs<"div", TagProps<"a">>;

@@ -83,1 +83,8 @@ import { default as React } from 'react';

};
export declare const AsSpan: {
args: {
variant: string;
color: string;
children: string;
};
};
export * from './HalfDonut';
export * from './Legend';
export * from './MapDepartments';
export * from './MapDistricts';
export * from './MapEurope';

@@ -22,5 +22,7 @@ export * from './AlertInfoBanner';

export * from './InfoBanner';
export * from './Legend';
export * from './ListWithDiode';
export * from './Live';
export * from './LogoutButton';
export * from './Maps';
export * from './Menu';

@@ -27,0 +29,0 @@ export * from './Newsletter';

{
"name": "@20minutes/hela",
"version": "1.14.7",
"version": "1.14.8",
"repository": "git@github.com:20minutes/hela.git",

@@ -130,3 +130,3 @@ "license": "MIT",

"typescript": "^4.9.5",
"vite": "^5.3.2",
"vite": "^5.3.3",
"vite-plugin-dts": "^3.9.1",

@@ -133,0 +133,0 @@ "vite-tsconfig-paths": "^4.3.2",

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc