@20minutes/hela 2.16.2 → 2.16.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +971 -930
- package/dist/index.umd.js +1 -1
- package/dist/js/scripts.es.js +172 -150
- package/dist/js/scripts.umd.js +1 -1
- package/dist/scss/abstracts/variables/_token-variables.scss +1 -1
- package/dist/scss/abstracts/variables/_variables.scss +1 -1
- package/dist/src/assets/scripts/townsMarkerMap.d.ts +1 -0
- package/dist/src/components/molecules/Horoscope/HoroscopeContent/HoroscopeContent.stories.d.ts +3 -1
- package/dist/src/components/molecules/InfoBanner/InfoBanner.d.ts +3 -3
- package/dist/src/components/molecules/InfoBanner/InfoBanner.stories.d.ts +33 -0
- package/dist/src/components/molecules/Maps/MapTownsByDepartments/MapTownsByDepartments.d.ts +1 -0
- package/dist/src/constants/index.d.ts +1 -0
- package/dist/src/constants/mapTownsByDepartmentsConfig.d.ts +69 -0
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/js/scripts.es.js
CHANGED
|
@@ -60,7 +60,7 @@ const Ct = () => /Android/i.test(navigator.userAgent), zt = typeof window < "u"
|
|
|
60
60
|
const a = r.dataset.storybook, l = r.querySelector(`#${s}-search`), c = l?.getAttribute("data-api-url"), h = r.querySelector(".c-autocomplete__menu");
|
|
61
61
|
if (!l || !h || !c)
|
|
62
62
|
return;
|
|
63
|
-
const d = r.querySelector(".c-autocomplete__input-spinner"),
|
|
63
|
+
const d = r.querySelector(".c-autocomplete__input-spinner"), u = l.getAttribute("data-trigger-message"), p = async (g) => {
|
|
64
64
|
try {
|
|
65
65
|
let _;
|
|
66
66
|
return a && t.includes("20minutes.fr") ? _ = $t : _ = await (await fetch(`${c}${e}${encodeURIComponent(g)}`)).json(), o ? _[o] : _;
|
|
@@ -72,24 +72,24 @@ const Ct = () => /Android/i.test(navigator.userAgent), zt = typeof window < "u"
|
|
|
72
72
|
A.id = `/${g}`, A.textContent = _, A.addEventListener("click", () => {
|
|
73
73
|
l instanceof HTMLInputElement && (l.value = _, h.classList.add("u-hidden"));
|
|
74
74
|
}), h.appendChild(A);
|
|
75
|
-
},
|
|
75
|
+
}, m = () => {
|
|
76
76
|
d?.classList.toggle("u-hidden");
|
|
77
77
|
}, w = () => {
|
|
78
78
|
const g = document.createElement("li");
|
|
79
|
-
g.textContent =
|
|
80
|
-
},
|
|
81
|
-
|
|
82
|
-
const _ = await
|
|
79
|
+
g.textContent = u, h.appendChild(g);
|
|
80
|
+
}, b = async (g) => {
|
|
81
|
+
m(), h.classList.remove("u-hidden");
|
|
82
|
+
const _ = await p(g);
|
|
83
83
|
h.innerHTML = "", _.length === 0 && h.classList.add("u-hidden"), _.forEach((A) => {
|
|
84
84
|
f(A[i], A[n]);
|
|
85
|
-
}),
|
|
86
|
-
},
|
|
85
|
+
}), m();
|
|
86
|
+
}, x = (g) => {
|
|
87
87
|
if (!(g.target instanceof HTMLInputElement))
|
|
88
88
|
return;
|
|
89
89
|
const _ = g.target.value;
|
|
90
|
-
h.classList.remove("u-hidden"), _.length >= 3 ?
|
|
90
|
+
h.classList.remove("u-hidden"), _.length >= 3 ? b(_) : (h.innerHTML = "", w());
|
|
91
91
|
};
|
|
92
|
-
l.addEventListener("input",
|
|
92
|
+
l.addEventListener("input", x), l.addEventListener("focusout", () => {
|
|
93
93
|
setTimeout(() => h.classList.add("u-hidden"), 300);
|
|
94
94
|
}), l.addEventListener("focusin", () => {
|
|
95
95
|
h.childElementCount > 0 && h.classList.remove("u-hidden");
|
|
@@ -124,7 +124,7 @@ const Ct = () => /Android/i.test(navigator.userAgent), zt = typeof window < "u"
|
|
|
124
124
|
Zt(i);
|
|
125
125
|
});
|
|
126
126
|
});
|
|
127
|
-
},
|
|
127
|
+
}, N = (s, t) => {
|
|
128
128
|
const e = document.querySelector(
|
|
129
129
|
`#${t}`
|
|
130
130
|
);
|
|
@@ -143,8 +143,8 @@ const Ct = () => /Android/i.test(navigator.userAgent), zt = typeof window < "u"
|
|
|
143
143
|
if (d <= 0)
|
|
144
144
|
clearInterval(c);
|
|
145
145
|
else {
|
|
146
|
-
const
|
|
147
|
-
i.innerHTML =
|
|
146
|
+
const u = Math.floor(d / 864e5), p = Math.floor(d % (1e3 * 60 * 60 * 24) / (1e3 * 60 * 60)), f = Math.floor(d % (1e3 * 60 * 60) / (1e3 * 60)), m = Math.floor(d % (1e3 * 60) / 1e3);
|
|
147
|
+
i.innerHTML = u.toString(), n.innerHTML = p.toString(), o.innerHTML = f.toString(), r.innerHTML = m.toString();
|
|
148
148
|
}
|
|
149
149
|
}, 1e3);
|
|
150
150
|
}
|
|
@@ -153,7 +153,7 @@ const Ct = () => /Android/i.test(navigator.userAgent), zt = typeof window < "u"
|
|
|
153
153
|
return [t.x - e, t.y - e, t.width + e * 2, t.height + e * 2].join(
|
|
154
154
|
" "
|
|
155
155
|
);
|
|
156
|
-
},
|
|
156
|
+
}, Bt = () => {
|
|
157
157
|
const s = document.querySelector(".c-map-districts-container"), t = document.querySelector(".c-map-districts");
|
|
158
158
|
if (!s || !t)
|
|
159
159
|
return;
|
|
@@ -165,55 +165,55 @@ const Ct = () => /Android/i.test(navigator.userAgent), zt = typeof window < "u"
|
|
|
165
165
|
".c-map-districts-container__unzoom-button"
|
|
166
166
|
);
|
|
167
167
|
let o = t;
|
|
168
|
-
const r = t.getAttribute("viewBox"), a = (f,
|
|
168
|
+
const r = t.getAttribute("viewBox"), a = (f, m) => f.matches?.call(f, m), l = (f, m, w = ".c-map-districts__zoomable:not(.js-selected-area)") => {
|
|
169
169
|
if (!f)
|
|
170
170
|
return;
|
|
171
|
-
let
|
|
172
|
-
for (;
|
|
173
|
-
a(
|
|
174
|
-
return
|
|
175
|
-
}, c = (f,
|
|
171
|
+
let b, x = f.parentElement;
|
|
172
|
+
for (; x instanceof SVGGraphicsElement && x !== m; )
|
|
173
|
+
a(x, w) && (b = x), x = x.parentElement;
|
|
174
|
+
return b;
|
|
175
|
+
}, c = (f, m, w) => {
|
|
176
176
|
if (!f)
|
|
177
177
|
return;
|
|
178
|
-
let
|
|
179
|
-
for (;
|
|
180
|
-
if (
|
|
178
|
+
let b = f.parentElement;
|
|
179
|
+
for (; b instanceof SVGGraphicsElement && b !== w; ) {
|
|
180
|
+
if (m === b)
|
|
181
181
|
return !0;
|
|
182
|
-
|
|
182
|
+
b = b.parentElement;
|
|
183
183
|
}
|
|
184
|
-
return w ===
|
|
185
|
-
}, h = (f,
|
|
186
|
-
if (
|
|
187
|
-
s.classList.remove("c-map-districts-container--department-view"), e.classList.remove("u-hidden"), i?.classList.add("u-hidden"), n.classList.add("u-hidden"),
|
|
184
|
+
return w === m;
|
|
185
|
+
}, h = (f, m) => {
|
|
186
|
+
if (m && n && e) {
|
|
187
|
+
s.classList.remove("c-map-districts-container--department-view"), e.classList.remove("u-hidden"), i?.classList.add("u-hidden"), n.classList.add("u-hidden"), m !== r && (e.classList.add("u-hidden"), n.classList.remove("u-hidden")), o.classList.remove("js-selected-area"), o = f;
|
|
188
188
|
const w = o.getAttribute("data-info");
|
|
189
|
-
i && w && (s.classList.add("c-map-districts-container--department-view"), i.classList.remove("u-hidden"), i.innerHTML = w), o.classList.add("js-selected-area"), t.setAttribute("viewBox",
|
|
189
|
+
i && w && (s.classList.add("c-map-districts-container--department-view"), i.classList.remove("u-hidden"), i.innerHTML = w), o.classList.add("js-selected-area"), t.setAttribute("viewBox", m);
|
|
190
190
|
}
|
|
191
191
|
}, d = (f) => {
|
|
192
192
|
f.stopPropagation();
|
|
193
|
-
const
|
|
194
|
-
if (o && t &&
|
|
195
|
-
if (
|
|
193
|
+
const m = f.currentTarget;
|
|
194
|
+
if (o && t && m instanceof SVGGraphicsElement) {
|
|
195
|
+
if (m === o)
|
|
196
196
|
return;
|
|
197
|
-
if (f.preventDefault(), o !== t && !c(
|
|
197
|
+
if (f.preventDefault(), o !== t && !c(m, o, t)) {
|
|
198
198
|
h(t, r);
|
|
199
199
|
return;
|
|
200
200
|
}
|
|
201
201
|
const w = l(
|
|
202
|
-
|
|
202
|
+
m,
|
|
203
203
|
o
|
|
204
204
|
);
|
|
205
205
|
h(
|
|
206
|
-
w ||
|
|
207
|
-
qt(w ||
|
|
206
|
+
w || m,
|
|
207
|
+
qt(w || m)
|
|
208
208
|
);
|
|
209
209
|
}
|
|
210
|
-
},
|
|
210
|
+
}, u = () => {
|
|
211
211
|
t && o !== t && h(t, r);
|
|
212
212
|
};
|
|
213
|
-
t.addEventListener("click",
|
|
214
|
-
f.addEventListener("click", (
|
|
213
|
+
t.addEventListener("click", u), n && n.addEventListener("click", u), document.querySelectorAll(".c-map-districts__zoomable").forEach((f) => {
|
|
214
|
+
f.addEventListener("click", (m) => d(m));
|
|
215
215
|
});
|
|
216
|
-
},
|
|
216
|
+
}, Ht = () => {
|
|
217
217
|
const s = document.getElementById("elections-form-search"), t = document.querySelector(".c-search-form__autocomplete");
|
|
218
218
|
if (!s || !t)
|
|
219
219
|
return;
|
|
@@ -242,7 +242,7 @@ const Ct = () => /Android/i.test(navigator.userAgent), zt = typeof window < "u"
|
|
|
242
242
|
}), s.addEventListener("focusin", () => {
|
|
243
243
|
t.childElementCount > 0 && t.classList.remove("u-hidden");
|
|
244
244
|
});
|
|
245
|
-
},
|
|
245
|
+
}, Nt = (s, t) => {
|
|
246
246
|
s.setAttribute("aria-expanded", "true"), s.parentNode?.querySelectorAll(".js-ellipsis-target")?.forEach((n) => n.classList.remove(t));
|
|
247
247
|
const i = s.querySelector(".js-ellipsis-button__label");
|
|
248
248
|
i instanceof HTMLSpanElement && (i.innerHTML = "Voir moins");
|
|
@@ -254,7 +254,7 @@ const Ct = () => /Android/i.test(navigator.userAgent), zt = typeof window < "u"
|
|
|
254
254
|
const e = s.currentTarget;
|
|
255
255
|
if (s.preventDefault(), e instanceof HTMLButtonElement) {
|
|
256
256
|
const i = t ? "u-ellipsis-multiline" : "u-ellipsis";
|
|
257
|
-
return e.getAttribute("aria-expanded") === "true" ? Wt(e, i) :
|
|
257
|
+
return e.getAttribute("aria-expanded") === "true" ? Wt(e, i) : Nt(e, i);
|
|
258
258
|
}
|
|
259
259
|
return null;
|
|
260
260
|
}, jt = (s = document.querySelector(
|
|
@@ -332,43 +332,43 @@ const Ct = () => /Android/i.test(navigator.userAgent), zt = typeof window < "u"
|
|
|
332
332
|
h(g);
|
|
333
333
|
}
|
|
334
334
|
}, 4e3);
|
|
335
|
-
},
|
|
335
|
+
}, u = () => {
|
|
336
336
|
r && (clearInterval(r), r = null);
|
|
337
|
-
},
|
|
338
|
-
a = !0,
|
|
337
|
+
}, p = () => {
|
|
338
|
+
a = !0, u();
|
|
339
339
|
}, f = () => {
|
|
340
340
|
a = !1, d();
|
|
341
341
|
};
|
|
342
342
|
e?.addEventListener("click", () => {
|
|
343
|
-
|
|
343
|
+
p();
|
|
344
344
|
const g = (o - 1 + t.length) % t.length;
|
|
345
345
|
h(g), setTimeout(f, 5e3);
|
|
346
346
|
}), i?.addEventListener("click", () => {
|
|
347
|
-
|
|
347
|
+
p();
|
|
348
348
|
const g = (o + 1) % t.length;
|
|
349
349
|
h(g), setTimeout(f, 5e3);
|
|
350
350
|
}), n.forEach((g, _) => {
|
|
351
351
|
g.addEventListener("click", () => {
|
|
352
|
-
|
|
352
|
+
p(), h(_), setTimeout(f, 5e3);
|
|
353
353
|
});
|
|
354
354
|
});
|
|
355
|
-
let
|
|
355
|
+
let m = 0, w = 0, b = !1;
|
|
356
356
|
return s.addEventListener("touchstart", (g) => {
|
|
357
|
-
s instanceof HTMLElement && (
|
|
357
|
+
s instanceof HTMLElement && (p(), m = g.touches[0].clientX, w = m, b = !0, s.style.transition = "none");
|
|
358
358
|
}), s.addEventListener("touchmove", (g) => {
|
|
359
359
|
if (!(s instanceof HTMLElement))
|
|
360
360
|
return;
|
|
361
361
|
w = g.touches[0].clientX;
|
|
362
|
-
const _ = w -
|
|
362
|
+
const _ = w - m, A = -o * window.innerWidth + _;
|
|
363
363
|
s.style.transform = `translateX(${A}px)`;
|
|
364
364
|
}), s.addEventListener("touchend", () => {
|
|
365
|
-
if (!
|
|
365
|
+
if (!b)
|
|
366
366
|
return;
|
|
367
|
-
|
|
368
|
-
const g = w -
|
|
367
|
+
b = !1;
|
|
368
|
+
const g = w - m;
|
|
369
369
|
Math.abs(g) > 75 && (g < 0 ? o = Math.min(o + 1, t.length - 1) : g > 0 && (o = Math.max(o - 1, 0))), c(!0), setTimeout(f, 5e3);
|
|
370
370
|
}), c(!0), d(), () => {
|
|
371
|
-
|
|
371
|
+
u();
|
|
372
372
|
};
|
|
373
373
|
}, v = {
|
|
374
374
|
inert: ":not([inert]):not([inert] *)",
|
|
@@ -741,14 +741,14 @@ const re = () => document.querySelectorAll(".js-modal").forEach((s) => {
|
|
|
741
741
|
})
|
|
742
742
|
), e === "true") {
|
|
743
743
|
const d = r ? r.querySelector(".c-stepper__item--loading") : null;
|
|
744
|
-
a && (a.forEach((
|
|
745
|
-
const
|
|
746
|
-
|
|
744
|
+
a && (a.forEach((u) => {
|
|
745
|
+
const p = u.querySelector(".c-stepper__loader");
|
|
746
|
+
p && p instanceof HTMLElement && (p.style.transition = `width ${n / 1e3}s linear`);
|
|
747
747
|
}), d || a[0].classList.add("c-stepper__item--loading")), setInterval(() => {
|
|
748
|
-
c.classList.contains("o-nav-button--visible") ? c.click() : l && h && (l.scrollLeft = 0, a && (a.forEach((
|
|
749
|
-
const
|
|
750
|
-
|
|
751
|
-
|
|
748
|
+
c.classList.contains("o-nav-button--visible") ? c.click() : l && h && (l.scrollLeft = 0, a && (a.forEach((u) => {
|
|
749
|
+
const p = u.querySelector(".c-stepper__loader");
|
|
750
|
+
p && p instanceof HTMLElement && (p.style.transition = "width 0s linear"), u.classList.remove("c-stepper__item--loading"), u.classList.remove("c-stepper__item--loaded"), setTimeout(() => {
|
|
751
|
+
p && p instanceof HTMLElement && (p.style.transition = `width ${n / 1e3}s linear`);
|
|
752
752
|
}, 0);
|
|
753
753
|
}), setTimeout(() => {
|
|
754
754
|
a[0].classList.add("c-stepper__item--loading");
|
|
@@ -794,7 +794,7 @@ const re = () => document.querySelectorAll(".js-modal").forEach((s) => {
|
|
|
794
794
|
);
|
|
795
795
|
}
|
|
796
796
|
};
|
|
797
|
-
function
|
|
797
|
+
function S(s, t, e) {
|
|
798
798
|
const i = document.createElement(t);
|
|
799
799
|
return s && (i.className = s), e && e.appendChild(i), i;
|
|
800
800
|
}
|
|
@@ -861,11 +861,11 @@ function _e(s, t, e = document) {
|
|
|
861
861
|
function it() {
|
|
862
862
|
return !!(navigator.vendor && navigator.vendor.match(/apple/i));
|
|
863
863
|
}
|
|
864
|
-
let
|
|
864
|
+
let bt = !1;
|
|
865
865
|
try {
|
|
866
866
|
window.addEventListener("test", null, Object.defineProperty({}, "passive", {
|
|
867
867
|
get: () => {
|
|
868
|
-
|
|
868
|
+
bt = !0;
|
|
869
869
|
}
|
|
870
870
|
}));
|
|
871
871
|
} catch {
|
|
@@ -927,7 +927,7 @@ class ye {
|
|
|
927
927
|
listener: i,
|
|
928
928
|
passive: n
|
|
929
929
|
}));
|
|
930
|
-
const h =
|
|
930
|
+
const h = bt ? {
|
|
931
931
|
passive: n || !1
|
|
932
932
|
} : !1;
|
|
933
933
|
t[a](c, i, h);
|
|
@@ -935,7 +935,7 @@ class ye {
|
|
|
935
935
|
});
|
|
936
936
|
}
|
|
937
937
|
}
|
|
938
|
-
function
|
|
938
|
+
function St(s, t) {
|
|
939
939
|
if (s.getViewportSizeFn) {
|
|
940
940
|
const e = s.getViewportSizeFn(s, t);
|
|
941
941
|
if (e)
|
|
@@ -1104,7 +1104,7 @@ let Et = class {
|
|
|
1104
1104
|
return this._parseZoomLevelOption("max") || Math.max(1, this.fit * 4);
|
|
1105
1105
|
}
|
|
1106
1106
|
};
|
|
1107
|
-
class
|
|
1107
|
+
class be {
|
|
1108
1108
|
/**
|
|
1109
1109
|
* @param {SlideData} data
|
|
1110
1110
|
* @param {number} index
|
|
@@ -1121,7 +1121,7 @@ class Se {
|
|
|
1121
1121
|
slide: this,
|
|
1122
1122
|
data: this.data,
|
|
1123
1123
|
index: e
|
|
1124
|
-
}), this.content = this.pswp.contentLoader.getContentBySlide(this), this.container =
|
|
1124
|
+
}), this.content = this.pswp.contentLoader.getContentBySlide(this), this.container = S("pswp__zoom-wrap", "div"), this.holderElement = null, this.currZoomLevel = 1, this.width = this.content.width, this.height = this.content.height, this.heavyAppended = !1, this.bounds = new we(this), this.prevDisplayedWidth = -1, this.prevDisplayedHeight = -1, this.pswp.dispatch("slideInit", {
|
|
1125
1125
|
slide: this
|
|
1126
1126
|
});
|
|
1127
1127
|
}
|
|
@@ -1374,7 +1374,7 @@ class Se {
|
|
|
1374
1374
|
t !== this.currentResolution && (this.currentResolution = t, this.updateContentSize(), this.pswp.dispatch("resolutionChanged"));
|
|
1375
1375
|
}
|
|
1376
1376
|
}
|
|
1377
|
-
const
|
|
1377
|
+
const Se = 0.35, Le = 0.6, nt = 0.4, ot = 0.5;
|
|
1378
1378
|
function Ee(s, t) {
|
|
1379
1379
|
return s * t / (1 - t);
|
|
1380
1380
|
}
|
|
@@ -1442,8 +1442,8 @@ class Ae {
|
|
|
1442
1442
|
bounds: o
|
|
1443
1443
|
} = i, r = n[t], a = this.pswp.bgOpacity < 1 && t === "y", c = r + Ee(e[t], 0.995);
|
|
1444
1444
|
if (a) {
|
|
1445
|
-
const f = this._getVerticalDragRatio(r),
|
|
1446
|
-
if (f < 0 &&
|
|
1445
|
+
const f = this._getVerticalDragRatio(r), m = this._getVerticalDragRatio(c);
|
|
1446
|
+
if (f < 0 && m < -nt || f > 0 && m > nt) {
|
|
1447
1447
|
this.pswp.close();
|
|
1448
1448
|
return;
|
|
1449
1449
|
}
|
|
@@ -1451,7 +1451,7 @@ class Ae {
|
|
|
1451
1451
|
const h = o.correctPan(t, c);
|
|
1452
1452
|
if (r === h)
|
|
1453
1453
|
return;
|
|
1454
|
-
const d = h === c ? 1 : 0.82,
|
|
1454
|
+
const d = h === c ? 1 : 0.82, u = this.pswp.bgOpacity, p = h - r;
|
|
1455
1455
|
this.pswp.animations.startSpring({
|
|
1456
1456
|
name: "panGesture" + t,
|
|
1457
1457
|
isPan: !0,
|
|
@@ -1461,8 +1461,8 @@ class Ae {
|
|
|
1461
1461
|
dampingRatio: d,
|
|
1462
1462
|
onUpdate: (f) => {
|
|
1463
1463
|
if (a && this.pswp.bgOpacity < 1) {
|
|
1464
|
-
const
|
|
1465
|
-
this.pswp.applyBgOpacity(k(
|
|
1464
|
+
const m = 1 - (h - f) / p;
|
|
1465
|
+
this.pswp.applyBgOpacity(k(u + (1 - u) * m, 0, 1));
|
|
1466
1466
|
}
|
|
1467
1467
|
n[t] = Math.floor(f), i.applyCurrentZoomPan();
|
|
1468
1468
|
}
|
|
@@ -1496,20 +1496,20 @@ class Ae {
|
|
|
1496
1496
|
bounds: h
|
|
1497
1497
|
} = r, d = r.pan[t] + l;
|
|
1498
1498
|
if (this.pswp.options.allowPanToNext && i === "x" && t === "x" && !o) {
|
|
1499
|
-
const
|
|
1499
|
+
const u = a.getCurrSlideX(), p = a.x - u, f = l > 0, m = !f;
|
|
1500
1500
|
if (d > h.min[t] && f) {
|
|
1501
1501
|
if (h.min[t] <= this.startPan[t])
|
|
1502
1502
|
return a.moveTo(c, !0), !0;
|
|
1503
1503
|
this._setPanWithFriction(t, d);
|
|
1504
|
-
} else if (d < h.max[t] &&
|
|
1504
|
+
} else if (d < h.max[t] && m) {
|
|
1505
1505
|
if (this.startPan[t] <= h.max[t])
|
|
1506
1506
|
return a.moveTo(c, !0), !0;
|
|
1507
1507
|
this._setPanWithFriction(t, d);
|
|
1508
|
-
} else if (
|
|
1509
|
-
if (
|
|
1510
|
-
return a.moveTo(Math.max(c,
|
|
1511
|
-
if (
|
|
1512
|
-
return a.moveTo(Math.min(c,
|
|
1508
|
+
} else if (p !== 0) {
|
|
1509
|
+
if (p > 0)
|
|
1510
|
+
return a.moveTo(Math.max(c, u), !0), !0;
|
|
1511
|
+
if (p < 0)
|
|
1512
|
+
return a.moveTo(Math.min(c, u), !0), !0;
|
|
1513
1513
|
} else
|
|
1514
1514
|
this._setPanWithFriction(t, d);
|
|
1515
1515
|
} else
|
|
@@ -1555,12 +1555,12 @@ class Ae {
|
|
|
1555
1555
|
} = n;
|
|
1556
1556
|
if (r.correctPan(t, e) !== e || i) {
|
|
1557
1557
|
const l = Math.round(e - o[t]);
|
|
1558
|
-
o[t] += l * (i ||
|
|
1558
|
+
o[t] += l * (i || Se);
|
|
1559
1559
|
} else
|
|
1560
1560
|
o[t] = e;
|
|
1561
1561
|
}
|
|
1562
1562
|
}
|
|
1563
|
-
const
|
|
1563
|
+
const xe = 0.05, Pe = 0.15;
|
|
1564
1564
|
function rt(s, t, e) {
|
|
1565
1565
|
return s.x = (t.x + e.x) / 2, s.y = (t.y + e.y) / 2, s;
|
|
1566
1566
|
}
|
|
@@ -1610,8 +1610,8 @@ class Ie {
|
|
|
1610
1610
|
bgOpacity: h
|
|
1611
1611
|
}).defaultPrevented || o.applyBgOpacity(h);
|
|
1612
1612
|
} else
|
|
1613
|
-
c = a - (a - c) *
|
|
1614
|
-
else c > l && (c = l + (c - l) *
|
|
1613
|
+
c = a - (a - c) * Pe;
|
|
1614
|
+
else c > l && (c = l + (c - l) * xe);
|
|
1615
1615
|
r.pan.x = this._calculatePanForZoomLevel("x", c), r.pan.y = this._calculatePanForZoomLevel("y", c), r.setZoomLevel(c), r.applyCurrentZoomPan();
|
|
1616
1616
|
}
|
|
1617
1617
|
end() {
|
|
@@ -1679,15 +1679,15 @@ class Ie {
|
|
|
1679
1679
|
velocity: 0,
|
|
1680
1680
|
dampingRatio: 1,
|
|
1681
1681
|
naturalFrequency: 40,
|
|
1682
|
-
onUpdate: (
|
|
1683
|
-
if (
|
|
1684
|
-
if (d && (i.pan.x = c.x + (h.x - c.x) *
|
|
1685
|
-
const
|
|
1686
|
-
i.setZoomLevel(
|
|
1682
|
+
onUpdate: (u) => {
|
|
1683
|
+
if (u /= 1e3, d || r) {
|
|
1684
|
+
if (d && (i.pan.x = c.x + (h.x - c.x) * u, i.pan.y = c.y + (h.y - c.y) * u), r) {
|
|
1685
|
+
const p = n + (o - n) * u;
|
|
1686
|
+
i.setZoomLevel(p);
|
|
1687
1687
|
}
|
|
1688
1688
|
i.applyCurrentZoomPan();
|
|
1689
1689
|
}
|
|
1690
|
-
l && e.bgOpacity < 1 && e.applyBgOpacity(k(a + (1 - a) *
|
|
1690
|
+
l && e.bgOpacity < 1 && e.applyBgOpacity(k(a + (1 - a) * u, 0, 1));
|
|
1691
1691
|
},
|
|
1692
1692
|
onComplete: () => {
|
|
1693
1693
|
i._setResolution(o), i.applyCurrentZoomPan();
|
|
@@ -2072,7 +2072,7 @@ class $e {
|
|
|
2072
2072
|
appendHolders() {
|
|
2073
2073
|
this.itemHolders = [];
|
|
2074
2074
|
for (let t = 0; t < 3; t++) {
|
|
2075
|
-
const e =
|
|
2075
|
+
const e = S("pswp__item", "div", this.pswp.container);
|
|
2076
2076
|
e.setAttribute("role", "group"), e.setAttribute("aria-roledescription", "slide"), e.setAttribute("aria-hidden", "true"), e.style.display = t === 1 ? "block" : "none", this.itemHolders.push({
|
|
2077
2077
|
el: e
|
|
2078
2078
|
//index: -1
|
|
@@ -2207,7 +2207,7 @@ const Re = {
|
|
|
2207
2207
|
ArrowRight: 39,
|
|
2208
2208
|
ArrowDown: 40,
|
|
2209
2209
|
Tab: 9
|
|
2210
|
-
},
|
|
2210
|
+
}, P = (s, t) => t ? s : Re[s];
|
|
2211
2211
|
class Fe {
|
|
2212
2212
|
/**
|
|
2213
2213
|
* @param {PhotoSwipe} pswp
|
|
@@ -2253,25 +2253,25 @@ class Fe {
|
|
|
2253
2253
|
let i, n, o = !1;
|
|
2254
2254
|
const r = "key" in t;
|
|
2255
2255
|
switch (r ? t.key : t.keyCode) {
|
|
2256
|
-
case
|
|
2256
|
+
case P("Escape", r):
|
|
2257
2257
|
e.options.escKey && (i = "close");
|
|
2258
2258
|
break;
|
|
2259
|
-
case
|
|
2259
|
+
case P("z", r):
|
|
2260
2260
|
i = "toggleZoom";
|
|
2261
2261
|
break;
|
|
2262
|
-
case
|
|
2262
|
+
case P("ArrowLeft", r):
|
|
2263
2263
|
n = "x";
|
|
2264
2264
|
break;
|
|
2265
|
-
case
|
|
2265
|
+
case P("ArrowUp", r):
|
|
2266
2266
|
n = "y";
|
|
2267
2267
|
break;
|
|
2268
|
-
case
|
|
2268
|
+
case P("ArrowRight", r):
|
|
2269
2269
|
n = "x", o = !0;
|
|
2270
2270
|
break;
|
|
2271
|
-
case
|
|
2271
|
+
case P("ArrowDown", r):
|
|
2272
2272
|
o = !0, n = "y";
|
|
2273
2273
|
break;
|
|
2274
|
-
case
|
|
2274
|
+
case P("Tab", r):
|
|
2275
2275
|
this._focusRoot();
|
|
2276
2276
|
break;
|
|
2277
2277
|
}
|
|
@@ -2347,8 +2347,8 @@ class ke {
|
|
|
2347
2347
|
this._helperTimeout && clearTimeout(this._helperTimeout), fe(this._target), this._target.removeEventListener("transitionend", this._onTransitionEnd, !1), this._target.removeEventListener("transitioncancel", this._onTransitionEnd, !1), this._finished || this._finalizeAnimation();
|
|
2348
2348
|
}
|
|
2349
2349
|
}
|
|
2350
|
-
const qe = 12,
|
|
2351
|
-
class
|
|
2350
|
+
const qe = 12, Be = 0.75;
|
|
2351
|
+
class He {
|
|
2352
2352
|
/**
|
|
2353
2353
|
* @param {number} initialVelocity Initial velocity, px per ms.
|
|
2354
2354
|
*
|
|
@@ -2365,7 +2365,7 @@ class Be {
|
|
|
2365
2365
|
* Recommended value from 10 to 50
|
|
2366
2366
|
*/
|
|
2367
2367
|
constructor(t, e, i) {
|
|
2368
|
-
this.velocity = t * 1e3, this._dampingRatio = e ||
|
|
2368
|
+
this.velocity = t * 1e3, this._dampingRatio = e || Be, this._naturalFrequency = i || qe, this._dampedFrequency = this._naturalFrequency, this._dampingRatio < 1 && (this._dampedFrequency *= Math.sqrt(1 - this._dampingRatio * this._dampingRatio));
|
|
2369
2369
|
}
|
|
2370
2370
|
/**
|
|
2371
2371
|
* @param {number} deltaPosition Difference between current and end position of the animation
|
|
@@ -2387,7 +2387,7 @@ class Be {
|
|
|
2387
2387
|
return i;
|
|
2388
2388
|
}
|
|
2389
2389
|
}
|
|
2390
|
-
class
|
|
2390
|
+
class Ne {
|
|
2391
2391
|
/**
|
|
2392
2392
|
* @param {SpringAnimationProps} props
|
|
2393
2393
|
*/
|
|
@@ -2405,12 +2405,12 @@ class He {
|
|
|
2405
2405
|
naturalFrequency: c
|
|
2406
2406
|
} = t;
|
|
2407
2407
|
this.onFinish = a;
|
|
2408
|
-
const h = new
|
|
2409
|
-
let d = Date.now(),
|
|
2410
|
-
const
|
|
2411
|
-
this._raf && (
|
|
2408
|
+
const h = new He(n, l, c);
|
|
2409
|
+
let d = Date.now(), u = e - i;
|
|
2410
|
+
const p = () => {
|
|
2411
|
+
this._raf && (u = h.easeFrame(u, Date.now() - d), Math.abs(u) < 1 && Math.abs(h.velocity) < 50 ? (o(i), r && r(), this.onFinish()) : (d = Date.now(), o(u + i), this._raf = requestAnimationFrame(p)));
|
|
2412
2412
|
};
|
|
2413
|
-
this._raf = requestAnimationFrame(
|
|
2413
|
+
this._raf = requestAnimationFrame(p);
|
|
2414
2414
|
}
|
|
2415
2415
|
// Destroy is called automatically onFinish
|
|
2416
2416
|
destroy() {
|
|
@@ -2440,7 +2440,7 @@ class We {
|
|
|
2440
2440
|
* @returns {Animation}
|
|
2441
2441
|
*/
|
|
2442
2442
|
_start(t, e) {
|
|
2443
|
-
const i = e ? new
|
|
2443
|
+
const i = e ? new Ne(
|
|
2444
2444
|
/** @type SpringAnimationProps */
|
|
2445
2445
|
t
|
|
2446
2446
|
) : new ke(
|
|
@@ -2559,25 +2559,25 @@ class Ue {
|
|
|
2559
2559
|
let a = e.isButton ? e.tagName || "button" : e.tagName || "div";
|
|
2560
2560
|
a = /** @type {keyof HTMLElementTagNameMap} */
|
|
2561
2561
|
a.toLowerCase();
|
|
2562
|
-
const l =
|
|
2562
|
+
const l = S(r, a);
|
|
2563
2563
|
if (e.isButton) {
|
|
2564
2564
|
a === "button" && (l.type = "button");
|
|
2565
2565
|
let {
|
|
2566
2566
|
title: d
|
|
2567
2567
|
} = e;
|
|
2568
2568
|
const {
|
|
2569
|
-
ariaLabel:
|
|
2569
|
+
ariaLabel: u
|
|
2570
2570
|
} = e;
|
|
2571
2571
|
typeof t.options[n + "Title"] == "string" && (d = t.options[n + "Title"]), d && (l.title = d);
|
|
2572
|
-
const
|
|
2573
|
-
|
|
2572
|
+
const p = u || d;
|
|
2573
|
+
p && l.setAttribute("aria-label", p);
|
|
2574
2574
|
}
|
|
2575
2575
|
l.innerHTML = je(o), e.onInit && e.onInit(l, t), e.onClick && (l.onclick = (d) => {
|
|
2576
2576
|
typeof e.onClick == "string" ? t[e.onClick]() : typeof e.onClick == "function" && e.onClick(d, l, t);
|
|
2577
2577
|
});
|
|
2578
2578
|
const c = e.appendTo || "bar";
|
|
2579
2579
|
let h = t.element;
|
|
2580
|
-
c === "bar" ? (t.topBar || (t.topBar =
|
|
2580
|
+
c === "bar" ? (t.topBar || (t.topBar = S("pswp__top-bar pswp__hide-on-close", "div", t.scrollWrap)), h = t.topBar) : (l.classList.add("pswp__hide-on-close"), c === "wrapper" && (h = t.scrollWrap)), (i = h) === null || i === void 0 || i.appendChild(t.applyFilters("uiElement", l, e));
|
|
2581
2581
|
}
|
|
2582
2582
|
}
|
|
2583
2583
|
function At(s, t, e) {
|
|
@@ -2870,7 +2870,7 @@ let ni = class {
|
|
|
2870
2870
|
* @param {HTMLElement} container
|
|
2871
2871
|
*/
|
|
2872
2872
|
constructor(t, e) {
|
|
2873
|
-
if (this.element =
|
|
2873
|
+
if (this.element = S("pswp__img pswp__img--placeholder", t ? "img" : "div", e), t) {
|
|
2874
2874
|
const i = (
|
|
2875
2875
|
/** @type {HTMLImageElement} */
|
|
2876
2876
|
this.element
|
|
@@ -2930,7 +2930,7 @@ let ni = class {
|
|
|
2930
2930
|
this.element && !e || this.instance.dispatch("contentLoad", {
|
|
2931
2931
|
content: this,
|
|
2932
2932
|
isLazy: t
|
|
2933
|
-
}).defaultPrevented || (this.isImageContent() ? (this.element =
|
|
2933
|
+
}).defaultPrevented || (this.isImageContent() ? (this.element = S("pswp__img", "img"), this.displayedImageWidth && this.loadImage(t)) : (this.element = S("pswp__content", "div"), this.element.innerHTML = this.data.html || ""), e && this.slide && this.slide.updateContentSize(!0));
|
|
2934
2934
|
}
|
|
2935
2935
|
/**
|
|
2936
2936
|
* Preload image
|
|
@@ -3075,9 +3075,9 @@ let ni = class {
|
|
|
3075
3075
|
displayError() {
|
|
3076
3076
|
if (this.slide) {
|
|
3077
3077
|
var t, e;
|
|
3078
|
-
let i =
|
|
3078
|
+
let i = S("pswp__error-msg", "div");
|
|
3079
3079
|
i.innerText = (t = (e = this.instance.options) === null || e === void 0 ? void 0 : e.errorMsg) !== null && t !== void 0 ? t : "", i = /** @type {HTMLDivElement} */
|
|
3080
|
-
this.instance.applyFilters("contentErrorElement", i, this), this.element =
|
|
3080
|
+
this.instance.applyFilters("contentErrorElement", i, this), this.element = S("pswp__content pswp__error-msg-container", "div"), this.element.appendChild(i), this.slide.container.innerText = "", this.slide.container.appendChild(this.element), this.slide.updateContentSize(!0), this.removePlaceholder();
|
|
3081
3081
|
}
|
|
3082
3082
|
}
|
|
3083
3083
|
/**
|
|
@@ -3136,7 +3136,7 @@ let ni = class {
|
|
|
3136
3136
|
}
|
|
3137
3137
|
};
|
|
3138
3138
|
const li = 5;
|
|
3139
|
-
function
|
|
3139
|
+
function xt(s, t, e) {
|
|
3140
3140
|
const i = t.createContentFromData(s, e);
|
|
3141
3141
|
let n;
|
|
3142
3142
|
const {
|
|
@@ -3145,7 +3145,7 @@ function Pt(s, t, e) {
|
|
|
3145
3145
|
if (o) {
|
|
3146
3146
|
n = new Et(o, s, -1);
|
|
3147
3147
|
let r;
|
|
3148
|
-
t.pswp ? r = t.pswp.viewportSize : r =
|
|
3148
|
+
t.pswp ? r = t.pswp.viewportSize : r = St(o, t);
|
|
3149
3149
|
const a = Lt(o, r, s, e);
|
|
3150
3150
|
n.update(i.width, i.height, a);
|
|
3151
3151
|
}
|
|
@@ -3157,7 +3157,7 @@ function ci(s, t) {
|
|
|
3157
3157
|
index: s,
|
|
3158
3158
|
itemData: e
|
|
3159
3159
|
}).defaultPrevented)
|
|
3160
|
-
return
|
|
3160
|
+
return xt(e, t, s);
|
|
3161
3161
|
}
|
|
3162
3162
|
class hi {
|
|
3163
3163
|
/**
|
|
@@ -3322,7 +3322,7 @@ let di = class extends oi {
|
|
|
3322
3322
|
* @returns {Content} Image that is being decoded or false.
|
|
3323
3323
|
*/
|
|
3324
3324
|
lazyLoadData(t, e) {
|
|
3325
|
-
return
|
|
3325
|
+
return xt(t, this, e);
|
|
3326
3326
|
}
|
|
3327
3327
|
};
|
|
3328
3328
|
const z = 3e-3;
|
|
@@ -3638,7 +3638,7 @@ class mi extends di {
|
|
|
3638
3638
|
if (!this.canLoop() && (e < 0 || e >= this.getNumItems()))
|
|
3639
3639
|
return;
|
|
3640
3640
|
const n = this.getItemData(e);
|
|
3641
|
-
t.slide = new
|
|
3641
|
+
t.slide = new be(n, e, this), e === this.currIndex && (this.currSlide = t.slide), t.slide.append(t.el);
|
|
3642
3642
|
}
|
|
3643
3643
|
/** @returns {Point} */
|
|
3644
3644
|
getViewportCenterPoint() {
|
|
@@ -3656,7 +3656,7 @@ class mi extends di {
|
|
|
3656
3656
|
updateSize(t) {
|
|
3657
3657
|
if (this.isDestroying)
|
|
3658
3658
|
return;
|
|
3659
|
-
const e =
|
|
3659
|
+
const e = St(this.options, this);
|
|
3660
3660
|
!t && F(e, this._prevViewportSize) || (y(this._prevViewportSize, e), this.dispatch("beforeResize"), y(this.viewportSize, this._prevViewportSize), this._updatePageScrollOffset(), this.dispatch("viewportSize"), this.mainScroll.resize(this.opener.isOpen), !this.hasMouse && window.matchMedia("(any-hover: hover)").matches && this.mouseDetected(), this.dispatch("resize"));
|
|
3661
3661
|
}
|
|
3662
3662
|
/**
|
|
@@ -3708,7 +3708,7 @@ class mi extends di {
|
|
|
3708
3708
|
* @private
|
|
3709
3709
|
*/
|
|
3710
3710
|
_createMainStructure() {
|
|
3711
|
-
this.element =
|
|
3711
|
+
this.element = S("pswp", "div"), this.element.setAttribute("tabindex", "-1"), this.element.setAttribute("role", "dialog"), this.template = this.element, this.bg = S("pswp__bg", "div", this.element), this.scrollWrap = S("pswp__scroll-wrap", "section", this.element), this.container = S("pswp__container", "div", this.scrollWrap), this.scrollWrap.setAttribute("aria-roledescription", "carousel"), this.container.setAttribute("aria-live", "off"), this.container.setAttribute("id", "pswp__items"), this.mainScroll.appendHolders(), this.ui = new ti(this), this.ui.init(), (this.options.appendToEl || document.body).appendChild(this.element);
|
|
3712
3712
|
}
|
|
3713
3713
|
/**
|
|
3714
3714
|
* Get position and dimensions of small thumbnail
|
|
@@ -3891,7 +3891,7 @@ class wi {
|
|
|
3891
3891
|
(t = this.element) !== null && t !== void 0 && t.parentNode && this.element.remove(), this.element = null;
|
|
3892
3892
|
}
|
|
3893
3893
|
}
|
|
3894
|
-
class
|
|
3894
|
+
class bi {
|
|
3895
3895
|
/**
|
|
3896
3896
|
* @param {SlideData} itemData Slide data
|
|
3897
3897
|
* @param {PhotoSwipeBase} instance PhotoSwipe or PhotoSwipeLightbox instance
|
|
@@ -4136,7 +4136,7 @@ class Si {
|
|
|
4136
4136
|
}).defaultPrevented || (this.slide && this.element && !this.element.parentNode && this.slide.container.appendChild(this.element), (this.state === E.LOADED || this.state === E.ERROR) && this.removePlaceholder()));
|
|
4137
4137
|
}
|
|
4138
4138
|
}
|
|
4139
|
-
function
|
|
4139
|
+
function Si(s, t) {
|
|
4140
4140
|
if (s.getViewportSizeFn) {
|
|
4141
4141
|
const e = s.getViewportSizeFn(s, t);
|
|
4142
4142
|
if (e)
|
|
@@ -4250,7 +4250,7 @@ class Ei {
|
|
|
4250
4250
|
return this._parseZoomLevelOption("max") || Math.max(1, this.fit * 4);
|
|
4251
4251
|
}
|
|
4252
4252
|
}
|
|
4253
|
-
function
|
|
4253
|
+
function Pt(s, t, e) {
|
|
4254
4254
|
const i = t.createContentFromData(s, e);
|
|
4255
4255
|
let n;
|
|
4256
4256
|
const {
|
|
@@ -4259,7 +4259,7 @@ function xt(s, t, e) {
|
|
|
4259
4259
|
if (o) {
|
|
4260
4260
|
n = new Ei(o, s, -1);
|
|
4261
4261
|
let r;
|
|
4262
|
-
t.pswp ? r = t.pswp.viewportSize : r =
|
|
4262
|
+
t.pswp ? r = t.pswp.viewportSize : r = Si(o, t);
|
|
4263
4263
|
const a = Li(o, r, s, e);
|
|
4264
4264
|
n.update(i.width, i.height, a);
|
|
4265
4265
|
}
|
|
@@ -4271,9 +4271,9 @@ function Ai(s, t) {
|
|
|
4271
4271
|
index: s,
|
|
4272
4272
|
itemData: e
|
|
4273
4273
|
}).defaultPrevented)
|
|
4274
|
-
return
|
|
4274
|
+
return Pt(e, t, s);
|
|
4275
4275
|
}
|
|
4276
|
-
class
|
|
4276
|
+
class xi extends yi {
|
|
4277
4277
|
/**
|
|
4278
4278
|
* Get total number of slides
|
|
4279
4279
|
*
|
|
@@ -4296,7 +4296,7 @@ class Pi extends yi {
|
|
|
4296
4296
|
* @returns {Content}
|
|
4297
4297
|
*/
|
|
4298
4298
|
createContentFromData(t, e) {
|
|
4299
|
-
return new
|
|
4299
|
+
return new bi(t, this, e);
|
|
4300
4300
|
}
|
|
4301
4301
|
/**
|
|
4302
4302
|
* Get item data by index.
|
|
@@ -4364,10 +4364,10 @@ class Pi extends yi {
|
|
|
4364
4364
|
* @returns {Content} Image that is being decoded or false.
|
|
4365
4365
|
*/
|
|
4366
4366
|
lazyLoadData(t, e) {
|
|
4367
|
-
return
|
|
4367
|
+
return Pt(t, this, e);
|
|
4368
4368
|
}
|
|
4369
4369
|
}
|
|
4370
|
-
class
|
|
4370
|
+
class Pi extends xi {
|
|
4371
4371
|
/**
|
|
4372
4372
|
* @param {PhotoSwipeOptions} [options]
|
|
4373
4373
|
*/
|
|
@@ -4519,7 +4519,7 @@ class xi extends Pi {
|
|
|
4519
4519
|
}
|
|
4520
4520
|
const Ii = () => {
|
|
4521
4521
|
let s = null;
|
|
4522
|
-
return s = new
|
|
4522
|
+
return s = new Pi({
|
|
4523
4523
|
gallery: "#photoswipe-gallery",
|
|
4524
4524
|
children: "a",
|
|
4525
4525
|
pswpModule: mi,
|
|
@@ -4613,7 +4613,7 @@ const Ii = () => {
|
|
|
4613
4613
|
}, ut = () => {
|
|
4614
4614
|
const s = document.querySelector(`${G}`);
|
|
4615
4615
|
s && s.classList.remove(It);
|
|
4616
|
-
},
|
|
4616
|
+
}, B = ({ type: s }) => {
|
|
4617
4617
|
const t = window.getSelection();
|
|
4618
4618
|
if (s === "selectionchange") {
|
|
4619
4619
|
ut();
|
|
@@ -4633,7 +4633,7 @@ const Ii = () => {
|
|
|
4633
4633
|
console.warn("Selection API isn't supported");
|
|
4634
4634
|
return;
|
|
4635
4635
|
}
|
|
4636
|
-
document.addEventListener("mouseup",
|
|
4636
|
+
document.addEventListener("mouseup", B), document.addEventListener("selectionchange", B), document.addEventListener("touchend", B), document.addEventListener("touchcancel", B);
|
|
4637
4637
|
}, Zi = (s) => {
|
|
4638
4638
|
const { target: t } = s;
|
|
4639
4639
|
if (t instanceof Element) {
|
|
@@ -4662,7 +4662,7 @@ const Ii = () => {
|
|
|
4662
4662
|
}), n.forEach((a) => {
|
|
4663
4663
|
a.setAttribute("aria-hidden", "true");
|
|
4664
4664
|
}), e.setAttribute("aria-selected", "true"), r && r.removeAttribute("aria-hidden");
|
|
4665
|
-
}, pt = (s) => s.code === "ArrowLeft" || s.keyCode === 39, mt = (s) => s.code === "ArrowRight" || s.keyCode === 37,
|
|
4665
|
+
}, pt = (s) => s.code === "ArrowLeft" || s.keyCode === 39, mt = (s) => s.code === "ArrowRight" || s.keyCode === 37, Bi = (s = document.querySelectorAll(
|
|
4666
4666
|
".js-tabs"
|
|
4667
4667
|
)) => {
|
|
4668
4668
|
s.length > 0 && s.forEach((t) => {
|
|
@@ -4680,35 +4680,35 @@ const Ii = () => {
|
|
|
4680
4680
|
});
|
|
4681
4681
|
}
|
|
4682
4682
|
});
|
|
4683
|
-
},
|
|
4683
|
+
}, H = (s) => {
|
|
4684
4684
|
const [t, e] = s.split("h").map(Number);
|
|
4685
4685
|
return t * 60 + e;
|
|
4686
4686
|
}, Tt = () => {
|
|
4687
4687
|
const s = /* @__PURE__ */ new Date(), t = s.getHours(), e = s.getMinutes();
|
|
4688
4688
|
return t * 60 + e;
|
|
4689
|
-
},
|
|
4689
|
+
}, Hi = (s, t) => {
|
|
4690
4690
|
const e = Tt();
|
|
4691
4691
|
if (e < s || e > t)
|
|
4692
4692
|
return 0;
|
|
4693
4693
|
const i = t - s;
|
|
4694
4694
|
return (e - s) / i;
|
|
4695
|
-
},
|
|
4695
|
+
}, Ni = (s) => {
|
|
4696
4696
|
const t = Tt();
|
|
4697
4697
|
let e = null, i = null, n = -1;
|
|
4698
4698
|
return Array.from(s).find((o, r, a) => {
|
|
4699
4699
|
if (r === a.length - 1)
|
|
4700
4700
|
return !1;
|
|
4701
|
-
const l =
|
|
4701
|
+
const l = H(o.textContent), c = H(a[r + 1].textContent);
|
|
4702
4702
|
return t >= l && t < c ? (e = o.textContent, i = a[r + 1].textContent, n = r, !0) : !1;
|
|
4703
4703
|
}), { currentIntervalStartTime: e, currentIntervalEndTime: i, currentIntervalIndex: n };
|
|
4704
4704
|
}, Wi = () => {
|
|
4705
4705
|
const s = document.querySelectorAll(".c-timeline__time");
|
|
4706
4706
|
if (!s || s.length < 2)
|
|
4707
4707
|
return;
|
|
4708
|
-
const t = document.querySelector(".c-timeline__progress-bar"), { currentIntervalStartTime: e, currentIntervalEndTime: i, currentIntervalIndex: n } =
|
|
4708
|
+
const t = document.querySelector(".c-timeline__progress-bar"), { currentIntervalStartTime: e, currentIntervalEndTime: i, currentIntervalIndex: n } = Ni(s);
|
|
4709
4709
|
if (!e || !i)
|
|
4710
4710
|
return;
|
|
4711
|
-
const o =
|
|
4711
|
+
const o = H(e), r = H(i), a = Hi(o, r);
|
|
4712
4712
|
if (t instanceof HTMLElement) {
|
|
4713
4713
|
if (t.classList.contains("c-timeline__progress-bar--is-desktop") && s.length >= 5) {
|
|
4714
4714
|
const l = "172px / 2";
|
|
@@ -4759,15 +4759,37 @@ const Ii = () => {
|
|
|
4759
4759
|
(n) => n.querySelector("a")?.getAttribute("href") === t
|
|
4760
4760
|
)?.classList.add(K);
|
|
4761
4761
|
}
|
|
4762
|
-
},
|
|
4763
|
-
|
|
4762
|
+
}, Ui = () => {
|
|
4763
|
+
const s = document.querySelectorAll(".js-city-marker");
|
|
4764
|
+
if (!s.length)
|
|
4765
|
+
return;
|
|
4766
|
+
const t = () => {
|
|
4767
|
+
let e = !0;
|
|
4768
|
+
s.forEach((i) => {
|
|
4769
|
+
if (!i.classList.contains("c-map-towns__city-marker--is-hidden"))
|
|
4770
|
+
return;
|
|
4771
|
+
const n = i.querySelector(".js-city-anchor"), o = i.querySelector(".js-city-text"), r = i.querySelector(".js-city-bg");
|
|
4772
|
+
if (!n || !o || !r)
|
|
4773
|
+
return;
|
|
4774
|
+
const { x: a, y: l, width: c, height: h } = n.getBBox();
|
|
4775
|
+
if (c > 0) {
|
|
4776
|
+
i.setAttribute("transform", `translate(${a + c / 2}, ${l + h / 2})`);
|
|
4777
|
+
const d = o.getBBox(), u = d.width + 8, p = d.height + 4;
|
|
4778
|
+
r.setAttribute("width", `${u}`), r.setAttribute("height", `${p}`), r.setAttribute("x", `${-u / 2}`), r.setAttribute("y", `${-p - 8}`), o.setAttribute("y", `${-p / 2 - 5}`), i.classList.remove("c-map-towns__city-marker--is-hidden");
|
|
4779
|
+
} else
|
|
4780
|
+
e = !1;
|
|
4781
|
+
}), e || requestAnimationFrame(t);
|
|
4782
|
+
};
|
|
4783
|
+
requestAnimationFrame(t);
|
|
4784
|
+
}, ts = () => {
|
|
4785
|
+
Yt(), Bi(), kt(), jt(), Ci(), Ii(), re(), ki(), N("winterOlympicsGames", "countdown-winter-olympics-games"), N("eurovision", "countdown-eurovision"), N("worldFoot2026", "countdown-world-foot-2026"), Fi(), Ft(), Jt(), Ht(), Rt(
|
|
4764
4786
|
"localisation-input",
|
|
4765
4787
|
"https://www.20minutes.fr/elections/resultats/recherche",
|
|
4766
4788
|
"?searchValue=",
|
|
4767
4789
|
"text",
|
|
4768
4790
|
"text"
|
|
4769
|
-
),
|
|
4791
|
+
), Bt(), Ui(), ji(), Dt(), Mt(), te(), ue(), pe(), Qt(), Ot(), Wi(), zi();
|
|
4770
4792
|
};
|
|
4771
4793
|
export {
|
|
4772
|
-
|
|
4794
|
+
ts as initScripts
|
|
4773
4795
|
};
|