@20minutes/hela 2.23.4 → 2.24.0
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/assets/scripts/infoButton.d.ts +1 -0
- package/dist/components/atoms/InfoButton/InfoButton.d.ts +5 -0
- package/dist/components/atoms/InfoButton/index.d.ts +1 -0
- package/dist/components/atoms/index.d.ts +1 -0
- package/dist/components/molecules/BlockedFeatureGate/BlockedFeatureGate.d.ts +14 -0
- package/dist/components/molecules/BlockedFeatureGate/index.d.ts +1 -0
- package/dist/components/molecules/InfoBanner/InfoBanner.d.ts +2 -2
- package/dist/components/molecules/UserPanel/UserPanel.d.ts +2 -2
- package/dist/components/molecules/index.d.ts +1 -0
- package/dist/index.es.js +709 -643
- package/dist/index.umd.cjs +1 -1
- package/dist/js/info-button.es.js +17 -0
- package/dist/js/info-button.umd.cjs +1 -0
- package/dist/js/scripts.es.js +363 -356
- package/dist/js/scripts.umd.cjs +1 -1
- package/dist/scss/abstracts/variables/_token-variables.scss +1 -1
- package/dist/style.css +1 -1
- package/package.json +24 -19
- package/dist/assets/scripts/infoBanner.d.ts +0 -1
package/dist/js/scripts.es.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
const
|
|
1
|
+
const Yt = () => /Android/i.test(navigator.userAgent), Jt = typeof window < "u" && navigator.userAgent.toLowerCase().includes("firefox"), Qt = () => {
|
|
2
2
|
const s = document.getElementById("js-download-band");
|
|
3
|
-
s &&
|
|
3
|
+
s && Yt() && s.setAttribute(
|
|
4
4
|
"href",
|
|
5
5
|
"https://app.adjust.com/15shf6wg?campaign=Bandeau_1&deep_link=20minutes%3A%2F%2Fhome"
|
|
6
6
|
);
|
|
7
|
-
},
|
|
7
|
+
}, te = () => {
|
|
8
8
|
const s = document.querySelector("#js-election-selector");
|
|
9
9
|
s && s.addEventListener("change", (t) => {
|
|
10
10
|
window.location.replace(t.target.value);
|
|
11
11
|
});
|
|
12
|
-
},
|
|
12
|
+
}, ee = () => {
|
|
13
13
|
const s = document.querySelector(".c-search-banner");
|
|
14
14
|
if (!s)
|
|
15
15
|
return;
|
|
@@ -24,7 +24,7 @@ const Kt = () => /Android/i.test(navigator.userAgent), Xt = typeof window < "u"
|
|
|
24
24
|
e.getAttribute("aria-expanded") === "true" ? (e.setAttribute("aria-expanded", "false"), i.setAttribute("aria-hidden", "true")) : (e.setAttribute("aria-expanded", "true"), i.setAttribute("aria-hidden", "false"));
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
|
-
},
|
|
27
|
+
}, ie = [
|
|
28
28
|
{
|
|
29
29
|
text: "Paris",
|
|
30
30
|
_index: "town_1717424751904",
|
|
@@ -55,7 +55,7 @@ const Kt = () => /Android/i.test(navigator.userAgent), Xt = typeof window < "u"
|
|
|
55
55
|
url: "/elections/resultats/paris/paris-75011"
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
],
|
|
58
|
+
], se = (s, t, e, i, n, o) => {
|
|
59
59
|
const r = document.getElementById(s);
|
|
60
60
|
if (!r)
|
|
61
61
|
return;
|
|
@@ -64,18 +64,18 @@ const Kt = () => /Android/i.test(navigator.userAgent), Xt = typeof window < "u"
|
|
|
64
64
|
return;
|
|
65
65
|
const h = r.querySelector(".c-autocomplete__input-spinner"), u = l.getAttribute("data-trigger-message"), f = async (g) => {
|
|
66
66
|
try {
|
|
67
|
-
const _ = a && t.includes("20minutes.fr") ?
|
|
67
|
+
const _ = a && t.includes("20minutes.fr") ? ie : await fetch(`${c}${e}${encodeURIComponent(g)}`).then(
|
|
68
68
|
(B) => B.json()
|
|
69
|
-
),
|
|
70
|
-
return Array.isArray(
|
|
69
|
+
), E = o && typeof _ == "object" && _ !== null ? _[o] : _;
|
|
70
|
+
return Array.isArray(E) ? E : [];
|
|
71
71
|
} catch (_) {
|
|
72
72
|
return console.error("Error fetching autocomplete results:", _), [];
|
|
73
73
|
}
|
|
74
74
|
}, m = (g, _) => {
|
|
75
|
-
const
|
|
76
|
-
|
|
75
|
+
const E = document.createElement("li");
|
|
76
|
+
E.id = `/${g}`, E.textContent = _, E.addEventListener("click", () => {
|
|
77
77
|
l instanceof HTMLInputElement && (l.value = _, d.classList.add("u-hidden"));
|
|
78
|
-
}), d.appendChild(
|
|
78
|
+
}), d.appendChild(E);
|
|
79
79
|
}, p = () => {
|
|
80
80
|
h?.classList.toggle("u-hidden");
|
|
81
81
|
}, y = () => {
|
|
@@ -84,8 +84,8 @@ const Kt = () => /Android/i.test(navigator.userAgent), Xt = typeof window < "u"
|
|
|
84
84
|
}, w = async (g) => {
|
|
85
85
|
p(), d.classList.remove("u-hidden");
|
|
86
86
|
const _ = await f(g);
|
|
87
|
-
d.innerHTML = "", _.length === 0 && d.classList.add("u-hidden"), _.forEach((
|
|
88
|
-
m(
|
|
87
|
+
d.innerHTML = "", _.length === 0 && d.classList.add("u-hidden"), _.forEach((E) => {
|
|
88
|
+
m(E[i], E[n]);
|
|
89
89
|
}), p();
|
|
90
90
|
}, C = (g) => {
|
|
91
91
|
if (!(g.target instanceof HTMLInputElement))
|
|
@@ -98,7 +98,7 @@ const Kt = () => /Android/i.test(navigator.userAgent), Xt = typeof window < "u"
|
|
|
98
98
|
}), l.addEventListener("focusin", () => {
|
|
99
99
|
d.childElementCount > 0 && d.classList.remove("u-hidden");
|
|
100
100
|
});
|
|
101
|
-
},
|
|
101
|
+
}, ne = (s) => {
|
|
102
102
|
s.stopImmediatePropagation(), s.preventDefault();
|
|
103
103
|
const t = s.currentTarget;
|
|
104
104
|
if (t instanceof HTMLButtonElement) {
|
|
@@ -107,15 +107,15 @@ const Kt = () => /Android/i.test(navigator.userAgent), Xt = typeof window < "u"
|
|
|
107
107
|
);
|
|
108
108
|
t.getAttribute("aria-expanded") === "true" ? (t.setAttribute("aria-expanded", "false"), i?.setAttribute("aria-hidden", "true")) : (t.setAttribute("aria-expanded", "true"), i?.setAttribute("aria-hidden", "false"));
|
|
109
109
|
}
|
|
110
|
-
},
|
|
110
|
+
}, oe = (s = document.querySelector(
|
|
111
111
|
".js-collapse__button"
|
|
112
112
|
)) => {
|
|
113
113
|
s && document.querySelectorAll(".c-collapse__button").forEach((e) => {
|
|
114
114
|
e.addEventListener("click", (i) => {
|
|
115
|
-
|
|
115
|
+
ne(i);
|
|
116
116
|
});
|
|
117
117
|
});
|
|
118
|
-
},
|
|
118
|
+
}, re = "[data-countdown][data-countdown-end-date]", ae = (s) => {
|
|
119
119
|
const t = s.querySelector(".js-countdown-days"), e = s.querySelector(".js-countdown-hours"), i = s.querySelector(".js-countdown-minutes"), n = s.querySelector(".js-countdown-seconds");
|
|
120
120
|
return !t || !e || !i || !n ? null : {
|
|
121
121
|
daysElement: t,
|
|
@@ -129,9 +129,9 @@ const Kt = () => /Android/i.test(navigator.userAgent), Xt = typeof window < "u"
|
|
|
129
129
|
return !1;
|
|
130
130
|
const i = Math.floor(e / (1e3 * 60 * 60 * 24)), n = Math.floor(e % (1e3 * 60 * 60 * 24) / (1e3 * 60 * 60)), o = Math.floor(e % (1e3 * 60 * 60) / (1e3 * 60)), r = Math.floor(e % (1e3 * 60) / 1e3);
|
|
131
131
|
return t.daysElement.textContent = i.toString(), t.hoursElement.textContent = n.toString(), t.minutesElement.textContent = o.toString(), t.secondsElement.textContent = r.toString(), !0;
|
|
132
|
-
},
|
|
133
|
-
document.querySelectorAll(
|
|
134
|
-
const e = t.dataset.countdownEndDate, i = e ? new Date(e).getTime() : Number.NaN, n =
|
|
132
|
+
}, le = () => {
|
|
133
|
+
document.querySelectorAll(re).forEach((t) => {
|
|
134
|
+
const e = t.dataset.countdownEndDate, i = e ? new Date(e).getTime() : Number.NaN, n = ae(t);
|
|
135
135
|
if (!n)
|
|
136
136
|
return;
|
|
137
137
|
if (Number.isNaN(i)) {
|
|
@@ -146,12 +146,12 @@ const Kt = () => /Android/i.test(navigator.userAgent), Xt = typeof window < "u"
|
|
|
146
146
|
dt(i, n) || (clearInterval(o), t.remove());
|
|
147
147
|
}, 1e3);
|
|
148
148
|
});
|
|
149
|
-
},
|
|
149
|
+
}, ce = (s) => {
|
|
150
150
|
const t = s.getBBox(), e = t.width / 20;
|
|
151
151
|
return [t.x - e, t.y - e, t.width + e * 2, t.height + e * 2].join(
|
|
152
152
|
" "
|
|
153
153
|
);
|
|
154
|
-
},
|
|
154
|
+
}, de = () => {
|
|
155
155
|
const s = document.querySelector(".c-map-districts-container"), t = document.querySelector(".c-map-districts");
|
|
156
156
|
if (!s || !t)
|
|
157
157
|
return;
|
|
@@ -202,7 +202,7 @@ const Kt = () => /Android/i.test(navigator.userAgent), Xt = typeof window < "u"
|
|
|
202
202
|
);
|
|
203
203
|
d(
|
|
204
204
|
y || p,
|
|
205
|
-
|
|
205
|
+
ce(y || p)
|
|
206
206
|
);
|
|
207
207
|
}
|
|
208
208
|
}, u = () => {
|
|
@@ -211,7 +211,7 @@ const Kt = () => /Android/i.test(navigator.userAgent), Xt = typeof window < "u"
|
|
|
211
211
|
t.addEventListener("click", u), n && n.addEventListener("click", u), document.querySelectorAll(".c-map-districts__zoomable").forEach((m) => {
|
|
212
212
|
m.addEventListener("click", (p) => h(p));
|
|
213
213
|
});
|
|
214
|
-
},
|
|
214
|
+
}, he = () => {
|
|
215
215
|
const s = document.getElementById("elections-form-search"), t = document.querySelector(".c-search-form__autocomplete");
|
|
216
216
|
if (!s || !t)
|
|
217
217
|
return;
|
|
@@ -239,59 +239,59 @@ const Kt = () => /Android/i.test(navigator.userAgent), Xt = typeof window < "u"
|
|
|
239
239
|
}), s.addEventListener("focusin", () => {
|
|
240
240
|
t.childElementCount > 0 && t.classList.remove("u-hidden");
|
|
241
241
|
});
|
|
242
|
-
},
|
|
242
|
+
}, ue = (s, t) => {
|
|
243
243
|
s.setAttribute("aria-expanded", "true"), s.parentNode?.querySelectorAll(".js-ellipsis-target")?.forEach((n) => {
|
|
244
244
|
n.classList.remove(t);
|
|
245
245
|
});
|
|
246
246
|
const i = s.querySelector(".js-ellipsis-button__label");
|
|
247
247
|
i instanceof HTMLSpanElement && (i.innerHTML = "Voir moins");
|
|
248
|
-
},
|
|
248
|
+
}, pe = (s, t) => {
|
|
249
249
|
s.parentNode?.querySelectorAll(".js-ellipsis-target")?.forEach((n) => {
|
|
250
250
|
n.classList.add(t);
|
|
251
251
|
}), s.setAttribute("aria-expanded", "false");
|
|
252
252
|
const i = s.querySelector(".js-ellipsis-button__label");
|
|
253
253
|
i instanceof HTMLSpanElement && (i.innerHTML = "Voir plus");
|
|
254
|
-
},
|
|
254
|
+
}, me = (s, t) => {
|
|
255
255
|
const e = s.currentTarget;
|
|
256
256
|
if (s.preventDefault(), e instanceof HTMLButtonElement) {
|
|
257
257
|
const i = t ? "u-ellipsis-multiline" : "u-ellipsis";
|
|
258
|
-
return e.getAttribute("aria-expanded") === "true" ?
|
|
258
|
+
return e.getAttribute("aria-expanded") === "true" ? pe(e, i) : ue(e, i);
|
|
259
259
|
}
|
|
260
260
|
return null;
|
|
261
|
-
},
|
|
261
|
+
}, fe = (s = document.querySelector(
|
|
262
262
|
".js-ellipsis-button"
|
|
263
263
|
)) => {
|
|
264
264
|
s && document.querySelectorAll(".js-ellipsis-button").forEach((e) => {
|
|
265
265
|
const i = e.getAttribute("data-multiple") === "true";
|
|
266
|
-
e.addEventListener("click", (n) =>
|
|
266
|
+
e.addEventListener("click", (n) => me(n, i));
|
|
267
267
|
});
|
|
268
|
-
},
|
|
268
|
+
}, ge = (s) => {
|
|
269
269
|
s.setAttribute("aria-expanded", "true"), s.parentNode?.querySelectorAll(".js-expand-target")?.forEach((i) => {
|
|
270
270
|
i.setAttribute("aria-hidden", "false");
|
|
271
271
|
});
|
|
272
272
|
const e = s.querySelector(".js-expand-button__label");
|
|
273
273
|
e instanceof HTMLSpanElement && (e.innerHTML = "Voir moins");
|
|
274
|
-
},
|
|
274
|
+
}, ve = (s) => {
|
|
275
275
|
s.parentNode?.querySelectorAll(".js-expand-target")?.forEach((i) => {
|
|
276
276
|
i.setAttribute("aria-hidden", "true");
|
|
277
277
|
}), s.setAttribute("aria-expanded", "false");
|
|
278
278
|
const e = s.querySelector(".js-expand-button__label");
|
|
279
279
|
e instanceof HTMLSpanElement && (e.innerHTML = "Voir plus");
|
|
280
|
-
},
|
|
280
|
+
}, ye = (s) => {
|
|
281
281
|
const t = s.currentTarget;
|
|
282
|
-
return s.preventDefault(), t instanceof HTMLButtonElement ? t.getAttribute("aria-expanded") === "true" ?
|
|
283
|
-
},
|
|
282
|
+
return s.preventDefault(), t instanceof HTMLButtonElement ? t.getAttribute("aria-expanded") === "true" ? ve(t) : ge(t) : null;
|
|
283
|
+
}, _e = (s) => {
|
|
284
284
|
const t = s.parentNode?.querySelector(".js-expand-target");
|
|
285
285
|
return !t || t.classList.contains("c-elections-result__members") ? !1 : (t.textContent?.trim().length ?? 0) < 255;
|
|
286
|
-
},
|
|
286
|
+
}, we = (s = document.querySelector(
|
|
287
287
|
".js-expand-button"
|
|
288
288
|
)) => {
|
|
289
289
|
s && document.querySelectorAll(".js-expand-button").forEach((e) => {
|
|
290
|
-
|
|
290
|
+
_e(e) ? (e.style.display = "none", e.parentNode?.querySelectorAll(".js-expand-target")?.forEach((n) => {
|
|
291
291
|
n.setAttribute("aria-hidden", "false");
|
|
292
|
-
})) : e.addEventListener("click",
|
|
292
|
+
})) : e.addEventListener("click", ye);
|
|
293
293
|
});
|
|
294
|
-
},
|
|
294
|
+
}, zt = (s, t) => {
|
|
295
295
|
const e = document.querySelector(".js-content-header"), i = document.querySelector(t), n = document.querySelector(s), o = document.querySelector(".c-header-mobile"), r = o instanceof HTMLElement ? o.offsetHeight : 0;
|
|
296
296
|
if (e && i && n) {
|
|
297
297
|
const a = new IntersectionObserver(
|
|
@@ -305,10 +305,10 @@ const Kt = () => /Android/i.test(navigator.userAgent), Xt = typeof window < "u"
|
|
|
305
305
|
);
|
|
306
306
|
a.observe(e), a.observe(i);
|
|
307
307
|
}
|
|
308
|
-
},
|
|
308
|
+
}, be = () => zt(".js-close-article-btn", ".js-limit-scroll-close-article-btn"), Se = () => zt(".js-chatbot-btn", ".js-limit-scroll-chatbot-btn"), Le = () => {
|
|
309
309
|
const s = document.querySelector(".js-game-alert");
|
|
310
|
-
|
|
311
|
-
},
|
|
310
|
+
Jt && s && s.classList.remove("u-hidden");
|
|
311
|
+
}, Ee = () => {
|
|
312
312
|
const s = document.querySelectorAll(".js-half-donut-result");
|
|
313
313
|
for (const t of Array.from(s)) {
|
|
314
314
|
const e = t.querySelector(".c-half-donut"), i = t.querySelector(".c-legend");
|
|
@@ -327,7 +327,7 @@ const Kt = () => /Android/i.test(navigator.userAgent), Xt = typeof window < "u"
|
|
|
327
327
|
});
|
|
328
328
|
});
|
|
329
329
|
}
|
|
330
|
-
},
|
|
330
|
+
}, Ae = () => {
|
|
331
331
|
const s = document.querySelector(".c-image-slider__container");
|
|
332
332
|
if (!s)
|
|
333
333
|
return () => {
|
|
@@ -380,8 +380,8 @@ const Kt = () => /Android/i.test(navigator.userAgent), Xt = typeof window < "u"
|
|
|
380
380
|
if (!(s instanceof HTMLElement))
|
|
381
381
|
return;
|
|
382
382
|
y = g.touches[0].clientX;
|
|
383
|
-
const _ = y - p,
|
|
384
|
-
s.style.transform = `translateX(${
|
|
383
|
+
const _ = y - p, E = -o * window.innerWidth + _;
|
|
384
|
+
s.style.transform = `translateX(${E}px)`;
|
|
385
385
|
}), s.addEventListener("touchend", () => {
|
|
386
386
|
if (!w)
|
|
387
387
|
return;
|
|
@@ -391,19 +391,26 @@ const Kt = () => /Android/i.test(navigator.userAgent), Xt = typeof window < "u"
|
|
|
391
391
|
}), c(!0), h(), () => {
|
|
392
392
|
u();
|
|
393
393
|
};
|
|
394
|
-
},
|
|
395
|
-
s.
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
394
|
+
}, Ce = (s) => {
|
|
395
|
+
const t = s.currentTarget, e = t instanceof HTMLElement ? t.nextElementSibling : null;
|
|
396
|
+
!(t instanceof HTMLButtonElement) || !(e instanceof HTMLElement) || (s.stopImmediatePropagation(), s.preventDefault(), t.getAttribute("aria-expanded") === "true" ? (t.setAttribute("aria-expanded", "false"), e.setAttribute("aria-hidden", "true")) : (t.setAttribute("aria-expanded", "true"), e.setAttribute("aria-hidden", "false")));
|
|
397
|
+
}, ht = /* @__PURE__ */ new WeakSet(), Ot = () => {
|
|
398
|
+
if (typeof document > "u")
|
|
399
|
+
return;
|
|
400
|
+
document.querySelectorAll(".js-info-button").forEach((t) => {
|
|
401
|
+
!(t instanceof HTMLButtonElement) || ht.has(t) || (ht.add(t), t.addEventListener("click", Ce));
|
|
402
|
+
});
|
|
403
|
+
};
|
|
404
|
+
if (typeof document < "u") {
|
|
405
|
+
const s = () => Ot();
|
|
406
|
+
document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", s, { once: !0 }) : s();
|
|
407
|
+
}
|
|
408
|
+
const v = {
|
|
402
409
|
inert: ":not([inert]):not([inert] *)",
|
|
403
410
|
negTabIndex: ':not([tabindex^="-"])',
|
|
404
411
|
disabled: ":not(:disabled)"
|
|
405
412
|
};
|
|
406
|
-
var
|
|
413
|
+
var xe = [
|
|
407
414
|
`a[href]${v.inert}${v.negTabIndex}`,
|
|
408
415
|
`area[href]${v.inert}${v.negTabIndex}`,
|
|
409
416
|
`input:not([type="hidden"]):not([type="radio"])${v.inert}${v.negTabIndex}${v.disabled}`,
|
|
@@ -421,24 +428,24 @@ var Ce = [
|
|
|
421
428
|
`[contenteditable]${v.inert}${v.negTabIndex}`,
|
|
422
429
|
`[tabindex]${v.inert}${v.negTabIndex}`
|
|
423
430
|
];
|
|
424
|
-
function
|
|
431
|
+
function ut(s) {
|
|
425
432
|
(s.querySelector("[autofocus]") || s).focus();
|
|
426
433
|
}
|
|
427
|
-
function
|
|
434
|
+
function Pe(s) {
|
|
428
435
|
const t = W(s, !0), e = t ? W(s, !1) || t : null;
|
|
429
436
|
return [t, e];
|
|
430
437
|
}
|
|
431
438
|
function W(s, t) {
|
|
432
|
-
if (t &&
|
|
439
|
+
if (t && ft(s))
|
|
433
440
|
return s;
|
|
434
441
|
if (Ie(s))
|
|
435
442
|
if (s.shadowRoot) {
|
|
436
|
-
let e =
|
|
443
|
+
let e = pt(s.shadowRoot, t);
|
|
437
444
|
for (; e; ) {
|
|
438
445
|
const i = W(e, t);
|
|
439
446
|
if (i)
|
|
440
447
|
return i;
|
|
441
|
-
e =
|
|
448
|
+
e = mt(e, t);
|
|
442
449
|
}
|
|
443
450
|
} else if (s.localName === "slot") {
|
|
444
451
|
const e = s.assignedElements({
|
|
@@ -451,23 +458,23 @@ function W(s, t) {
|
|
|
451
458
|
return n;
|
|
452
459
|
}
|
|
453
460
|
} else {
|
|
454
|
-
let e =
|
|
461
|
+
let e = pt(s, t);
|
|
455
462
|
for (; e; ) {
|
|
456
463
|
const i = W(e, t);
|
|
457
464
|
if (i)
|
|
458
465
|
return i;
|
|
459
|
-
e =
|
|
466
|
+
e = mt(e, t);
|
|
460
467
|
}
|
|
461
468
|
}
|
|
462
|
-
return !t &&
|
|
469
|
+
return !t && ft(s) ? s : null;
|
|
463
470
|
}
|
|
464
|
-
function
|
|
471
|
+
function pt(s, t) {
|
|
465
472
|
return t ? s.firstElementChild : s.lastElementChild;
|
|
466
473
|
}
|
|
467
|
-
function
|
|
474
|
+
function mt(s, t) {
|
|
468
475
|
return t ? s.nextElementSibling : s.previousElementSibling;
|
|
469
476
|
}
|
|
470
|
-
const
|
|
477
|
+
const Te = (s) => s.matches("details:not([open]) *") && !s.matches("details>summary:first-of-type") ? !0 : !(s.offsetWidth || s.offsetHeight || s.getClientRects().length), ft = (s) => s.shadowRoot?.delegatesFocus ? !1 : s.matches(xe.join(",")) && !Te(s);
|
|
471
478
|
function Ie(s) {
|
|
472
479
|
return s.shadowRoot && s.getAttribute("tabindex") === "-1" ? !1 : !s.matches(":disabled,[hidden],[inert]");
|
|
473
480
|
}
|
|
@@ -475,8 +482,8 @@ function V(s = document) {
|
|
|
475
482
|
const t = s.activeElement;
|
|
476
483
|
return t ? t.shadowRoot ? V(t.shadowRoot) || document.activeElement : t : null;
|
|
477
484
|
}
|
|
478
|
-
function
|
|
479
|
-
const [e, i] =
|
|
485
|
+
function Me(s, t) {
|
|
486
|
+
const [e, i] = Pe(s);
|
|
480
487
|
if (!e)
|
|
481
488
|
return t.preventDefault();
|
|
482
489
|
const n = V();
|
|
@@ -486,16 +493,16 @@ function $(s, t) {
|
|
|
486
493
|
function e(i) {
|
|
487
494
|
if (!i || i === document || i === window)
|
|
488
495
|
return null;
|
|
489
|
-
const n =
|
|
496
|
+
const n = Dt(i);
|
|
490
497
|
return n && (i = n), i.closest(s) || e(i.getRootNode().host);
|
|
491
498
|
}
|
|
492
499
|
return e(t);
|
|
493
500
|
}
|
|
494
|
-
function
|
|
495
|
-
return s.assignedSlot || (s.parentNode ?
|
|
501
|
+
function Dt(s) {
|
|
502
|
+
return s.assignedSlot || (s.parentNode ? Dt(s.parentNode) : null);
|
|
496
503
|
}
|
|
497
504
|
const k = "data-a11y-dialog";
|
|
498
|
-
class
|
|
505
|
+
class Rt {
|
|
499
506
|
$el;
|
|
500
507
|
id;
|
|
501
508
|
previouslyFocused;
|
|
@@ -544,7 +551,7 @@ class Ot {
|
|
|
544
551
|
* Returns the instance to allow method chaining.
|
|
545
552
|
*/
|
|
546
553
|
show(t) {
|
|
547
|
-
return this.shown ? this : this.fire("show", t).defaultPrevented ? this : (this.shown = !0, this.$el.removeAttribute("aria-hidden"), this.previouslyFocused = V(), this.previouslyFocused?.tagName === "BODY" && t?.target && (this.previouslyFocused = t.target), t?.type === "focus" ? this.maintainFocus() :
|
|
554
|
+
return this.shown ? this : this.fire("show", t).defaultPrevented ? this : (this.shown = !0, this.$el.removeAttribute("aria-hidden"), this.previouslyFocused = V(), this.previouslyFocused?.tagName === "BODY" && t?.target && (this.previouslyFocused = t.target), t?.type === "focus" ? this.maintainFocus() : ut(this.$el), document.body.addEventListener("focus", this.maintainFocus, !0), this.$el.addEventListener("keydown", this.bindKeypress, !0), this);
|
|
548
555
|
}
|
|
549
556
|
/**
|
|
550
557
|
* Hide the dialog.
|
|
@@ -607,7 +614,7 @@ class Ot {
|
|
|
607
614
|
e = !!this.$el.querySelector('[popover]:not([popover="manual"]):popover-open');
|
|
608
615
|
} catch {
|
|
609
616
|
}
|
|
610
|
-
t.key === "Escape" && this.$el.getAttribute("role") !== "alertdialog" && !e && (t.preventDefault(), this.hide(t)), t.key === "Tab" &&
|
|
617
|
+
t.key === "Escape" && this.$el.getAttribute("role") !== "alertdialog" && !e && (t.preventDefault(), this.hide(t)), t.key === "Tab" && Me(this.$el, t);
|
|
611
618
|
}
|
|
612
619
|
/**
|
|
613
620
|
* If the dialog is shown and the focus is not within a dialog element (either
|
|
@@ -617,18 +624,18 @@ class Ot {
|
|
|
617
624
|
*/
|
|
618
625
|
maintainFocus() {
|
|
619
626
|
const t = V();
|
|
620
|
-
$(`[aria-modal="true"], [${k}-ignore-focus-trap]`, t) ||
|
|
627
|
+
$(`[aria-modal="true"], [${k}-ignore-focus-trap]`, t) || ut(this.$el);
|
|
621
628
|
}
|
|
622
629
|
}
|
|
623
|
-
function
|
|
630
|
+
function gt() {
|
|
624
631
|
for (const s of document.querySelectorAll("[data-a11y-dialog]"))
|
|
625
|
-
new
|
|
632
|
+
new Rt(s);
|
|
626
633
|
}
|
|
627
|
-
typeof document < "u" && (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded",
|
|
628
|
-
const
|
|
634
|
+
typeof document < "u" && (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", gt) : gt());
|
|
635
|
+
const ze = () => document.querySelectorAll(".js-modal").forEach((s) => {
|
|
629
636
|
if (!(s instanceof HTMLElement))
|
|
630
637
|
return;
|
|
631
|
-
const t = new
|
|
638
|
+
const t = new Rt(s);
|
|
632
639
|
if (s.id === "dialog-menu") {
|
|
633
640
|
const e = document.querySelectorAll("button[data-a11y-dialog-show='dialog-menu']"), i = document.querySelectorAll("button[data-a11y-dialog-hide='dialog-menu']");
|
|
634
641
|
e.length > 0 && i.length > 0 && (t.on("show", () => {
|
|
@@ -657,7 +664,7 @@ const Me = () => document.querySelectorAll(".js-modal").forEach((s) => {
|
|
|
657
664
|
prevBtn: i
|
|
658
665
|
}) => {
|
|
659
666
|
e.classList.contains("o-nav-button--visible") && !i.classList.contains("o-nav-button--visible") && (s.style.paddingRight = J, s.style.paddingLeft = ""), i.classList.contains("o-nav-button--visible") && (s.style.paddingLeft = J, e.classList.contains("o-nav-button--visible") && (s.style.paddingRight = J), e.classList.contains("o-nav-button--visible") || (s.style.paddingRight = "")), !e.classList.contains("o-nav-button--visible") && !i.classList.contains("o-nav-button--visible") && (t.style.width = "", s.style.paddingRight = "");
|
|
660
|
-
},
|
|
667
|
+
}, Oe = ({
|
|
661
668
|
navigationContainer: s,
|
|
662
669
|
navigatedList: t,
|
|
663
670
|
nextBtn: e,
|
|
@@ -670,7 +677,7 @@ const Me = () => document.querySelectorAll(".js-modal").forEach((s) => {
|
|
|
670
677
|
nextBtn: e,
|
|
671
678
|
prevBtn: i
|
|
672
679
|
});
|
|
673
|
-
},
|
|
680
|
+
}, De = ({
|
|
674
681
|
navigationContainer: s,
|
|
675
682
|
navigatedList: t,
|
|
676
683
|
nextBtn: e,
|
|
@@ -722,7 +729,7 @@ const Me = () => document.querySelectorAll(".js-modal").forEach((s) => {
|
|
|
722
729
|
prevBtn: i
|
|
723
730
|
});
|
|
724
731
|
}
|
|
725
|
-
},
|
|
732
|
+
}, Re = ({
|
|
726
733
|
navigationContainer: s,
|
|
727
734
|
navigatedList: t,
|
|
728
735
|
nextBtn: e,
|
|
@@ -770,19 +777,19 @@ const Me = () => document.querySelectorAll(".js-modal").forEach((s) => {
|
|
|
770
777
|
prevBtn: i
|
|
771
778
|
});
|
|
772
779
|
}
|
|
773
|
-
},
|
|
780
|
+
}, $e = ({
|
|
774
781
|
navigationContainer: s,
|
|
775
782
|
navigatedList: t,
|
|
776
783
|
nextBtn: e,
|
|
777
784
|
prevBtn: i
|
|
778
785
|
}) => {
|
|
779
|
-
|
|
786
|
+
Oe({
|
|
780
787
|
navigationContainer: s,
|
|
781
788
|
navigatedList: t,
|
|
782
789
|
nextBtn: e,
|
|
783
790
|
prevBtn: i
|
|
784
791
|
});
|
|
785
|
-
},
|
|
792
|
+
}, Be = (s) => {
|
|
786
793
|
const { sliderVariant: t } = s.dataset, { sliderAuto: e } = s.dataset, { sliderDelay: i } = s.dataset, n = i ? parseInt(i, 10) : 3e3, r = s.closest(".js-overview-bar-container")?.querySelector(".c-stepper"), a = r?.querySelectorAll(".c-stepper__item"), l = s.querySelector(
|
|
787
794
|
".js-navigation-container__list"
|
|
788
795
|
), c = s.querySelector(".o-nav-button--next-button"), d = s.querySelector(
|
|
@@ -790,7 +797,7 @@ const Me = () => document.querySelectorAll(".js-modal").forEach((s) => {
|
|
|
790
797
|
);
|
|
791
798
|
if (!(!l || !c || !d) && (l.clientWidth < l.scrollWidth && (c.classList.add("o-nav-button--visible"), c.classList.contains("c-slider__button-container--has-space-around") && (s.style.paddingRight = J)), c.addEventListener(
|
|
792
799
|
"click",
|
|
793
|
-
|
|
800
|
+
De.bind(!1, {
|
|
794
801
|
navigationContainer: s,
|
|
795
802
|
navigatedList: l,
|
|
796
803
|
nextBtn: c,
|
|
@@ -799,7 +806,7 @@ const Me = () => document.querySelectorAll(".js-modal").forEach((s) => {
|
|
|
799
806
|
})
|
|
800
807
|
), d.addEventListener(
|
|
801
808
|
"click",
|
|
802
|
-
|
|
809
|
+
Re.bind(!1, {
|
|
803
810
|
navigationContainer: s,
|
|
804
811
|
navigatedList: l,
|
|
805
812
|
nextBtn: c,
|
|
@@ -823,7 +830,7 @@ const Me = () => document.querySelectorAll(".js-modal").forEach((s) => {
|
|
|
823
830
|
}, 0)), d.click());
|
|
824
831
|
}, n);
|
|
825
832
|
}
|
|
826
|
-
},
|
|
833
|
+
}, Fe = () => {
|
|
827
834
|
const s = document.querySelectorAll(".js-navigation-container");
|
|
828
835
|
Array.from(s).forEach((t) => {
|
|
829
836
|
const e = t.querySelector(
|
|
@@ -833,13 +840,13 @@ const Me = () => document.querySelectorAll(".js-modal").forEach((s) => {
|
|
|
833
840
|
const i = new ResizeObserver((n) => {
|
|
834
841
|
n.forEach((o) => {
|
|
835
842
|
const { width: r } = o.contentRect;
|
|
836
|
-
r > 0 && (
|
|
843
|
+
r > 0 && (Be(t), i.disconnect());
|
|
837
844
|
});
|
|
838
845
|
});
|
|
839
846
|
i.observe(e);
|
|
840
847
|
}
|
|
841
848
|
});
|
|
842
|
-
},
|
|
849
|
+
}, ke = () => {
|
|
843
850
|
const s = document.querySelectorAll(".js-navigation-container");
|
|
844
851
|
for (const t of Array.from(s))
|
|
845
852
|
if (t) {
|
|
@@ -852,7 +859,7 @@ const Me = () => document.querySelectorAll(".js-modal").forEach((s) => {
|
|
|
852
859
|
);
|
|
853
860
|
e && i && n && window.addEventListener(
|
|
854
861
|
"resize",
|
|
855
|
-
|
|
862
|
+
$e.bind(!1, {
|
|
856
863
|
navigationContainer: t,
|
|
857
864
|
navigatedList: e,
|
|
858
865
|
nextBtn: i,
|
|
@@ -868,7 +875,7 @@ function x(s, t, e) {
|
|
|
868
875
|
function S(s, t) {
|
|
869
876
|
return s.x = t.x, s.y = t.y, t.id !== void 0 && (s.id = t.id), s;
|
|
870
877
|
}
|
|
871
|
-
function
|
|
878
|
+
function $t(s) {
|
|
872
879
|
s.x = Math.round(s.x), s.y = Math.round(s.y);
|
|
873
880
|
}
|
|
874
881
|
function it(s, t) {
|
|
@@ -888,17 +895,17 @@ function G(s, t, e) {
|
|
|
888
895
|
function D(s, t, e, i) {
|
|
889
896
|
s.style.transform = G(t, e, i);
|
|
890
897
|
}
|
|
891
|
-
const
|
|
892
|
-
function
|
|
893
|
-
s.style.transition = t ? `${t} ${e}ms ${i ||
|
|
898
|
+
const Ze = "cubic-bezier(.4,0,.22,1)";
|
|
899
|
+
function Bt(s, t, e, i) {
|
|
900
|
+
s.style.transition = t ? `${t} ${e}ms ${i || Ze}` : "none";
|
|
894
901
|
}
|
|
895
902
|
function st(s, t, e) {
|
|
896
903
|
s.style.width = typeof t == "number" ? `${t}px` : t, s.style.height = typeof e == "number" ? `${e}px` : e;
|
|
897
904
|
}
|
|
898
|
-
function Ze(s) {
|
|
899
|
-
Rt(s);
|
|
900
|
-
}
|
|
901
905
|
function qe(s) {
|
|
906
|
+
Bt(s);
|
|
907
|
+
}
|
|
908
|
+
function Ne(s) {
|
|
902
909
|
return "decode" in s ? s.decode().catch(() => {
|
|
903
910
|
}) : s.complete ? Promise.resolve(s) : new Promise((t, e) => {
|
|
904
911
|
s.onload = () => t(s), s.onerror = e;
|
|
@@ -910,10 +917,10 @@ const P = {
|
|
|
910
917
|
LOADED: "loaded",
|
|
911
918
|
ERROR: "error"
|
|
912
919
|
};
|
|
913
|
-
function
|
|
920
|
+
function He(s) {
|
|
914
921
|
return "button" in s && s.button === 1 || s.ctrlKey || s.metaKey || s.altKey || s.shiftKey;
|
|
915
922
|
}
|
|
916
|
-
function
|
|
923
|
+
function We(s, t, e = document) {
|
|
917
924
|
let i = [];
|
|
918
925
|
if (s instanceof Element)
|
|
919
926
|
i = [s];
|
|
@@ -925,19 +932,19 @@ function He(s, t, e = document) {
|
|
|
925
932
|
}
|
|
926
933
|
return i;
|
|
927
934
|
}
|
|
928
|
-
function
|
|
935
|
+
function vt() {
|
|
929
936
|
return !!(navigator.vendor && navigator.vendor.match(/apple/i));
|
|
930
937
|
}
|
|
931
|
-
let
|
|
938
|
+
let Ft = !1;
|
|
932
939
|
try {
|
|
933
940
|
window.addEventListener("test", null, Object.defineProperty({}, "passive", {
|
|
934
941
|
get: () => {
|
|
935
|
-
|
|
942
|
+
Ft = !0;
|
|
936
943
|
}
|
|
937
944
|
}));
|
|
938
945
|
} catch {
|
|
939
946
|
}
|
|
940
|
-
class
|
|
947
|
+
class Ve {
|
|
941
948
|
constructor() {
|
|
942
949
|
this._pool = [];
|
|
943
950
|
}
|
|
@@ -994,7 +1001,7 @@ class We {
|
|
|
994
1001
|
listener: i,
|
|
995
1002
|
passive: n
|
|
996
1003
|
}));
|
|
997
|
-
const d =
|
|
1004
|
+
const d = Ft ? {
|
|
998
1005
|
passive: n || !1
|
|
999
1006
|
} : !1;
|
|
1000
1007
|
t[a](c, i, d);
|
|
@@ -1002,7 +1009,7 @@ class We {
|
|
|
1002
1009
|
});
|
|
1003
1010
|
}
|
|
1004
1011
|
}
|
|
1005
|
-
function
|
|
1012
|
+
function kt(s, t) {
|
|
1006
1013
|
if (s.getViewportSizeFn) {
|
|
1007
1014
|
const e = s.getViewportSizeFn(s, t);
|
|
1008
1015
|
if (e)
|
|
@@ -1029,13 +1036,13 @@ function q(s, t, e, i, n) {
|
|
|
1029
1036
|
}
|
|
1030
1037
|
return Number(o) || 0;
|
|
1031
1038
|
}
|
|
1032
|
-
function
|
|
1039
|
+
function Zt(s, t, e, i) {
|
|
1033
1040
|
return {
|
|
1034
1041
|
x: t.x - q("left", s, t, e, i) - q("right", s, t, e, i),
|
|
1035
1042
|
y: t.y - q("top", s, t, e, i) - q("bottom", s, t, e, i)
|
|
1036
1043
|
};
|
|
1037
1044
|
}
|
|
1038
|
-
class
|
|
1045
|
+
class je {
|
|
1039
1046
|
/**
|
|
1040
1047
|
* @param {Slide} slide
|
|
1041
1048
|
*/
|
|
@@ -1090,8 +1097,8 @@ class Ve {
|
|
|
1090
1097
|
return U(e, this.max[t], this.min[t]);
|
|
1091
1098
|
}
|
|
1092
1099
|
}
|
|
1093
|
-
const
|
|
1094
|
-
let
|
|
1100
|
+
const yt = 4e3;
|
|
1101
|
+
let qt = class {
|
|
1095
1102
|
/**
|
|
1096
1103
|
* @param {PhotoSwipeOptions} options PhotoSwipe options
|
|
1097
1104
|
* @param {SlideData} itemData Slide data
|
|
@@ -1148,7 +1155,7 @@ let kt = class {
|
|
|
1148
1155
|
*/
|
|
1149
1156
|
_getSecondary() {
|
|
1150
1157
|
let t = this._parseZoomLevelOption("secondary");
|
|
1151
|
-
return t || (t = Math.min(1, this.fit * 3), this.elementSize && t * this.elementSize.x >
|
|
1158
|
+
return t || (t = Math.min(1, this.fit * 3), this.elementSize && t * this.elementSize.x > yt && (t = yt / this.elementSize.x), t);
|
|
1152
1159
|
}
|
|
1153
1160
|
/**
|
|
1154
1161
|
* Get initial image zoom level.
|
|
@@ -1171,7 +1178,7 @@ let kt = class {
|
|
|
1171
1178
|
return this._parseZoomLevelOption("max") || Math.max(1, this.fit * 4);
|
|
1172
1179
|
}
|
|
1173
1180
|
};
|
|
1174
|
-
class
|
|
1181
|
+
class Ge {
|
|
1175
1182
|
/**
|
|
1176
1183
|
* @param {SlideData} data
|
|
1177
1184
|
* @param {number} index
|
|
@@ -1184,11 +1191,11 @@ class je {
|
|
|
1184
1191
|
}, this.pan = {
|
|
1185
1192
|
x: 0,
|
|
1186
1193
|
y: 0
|
|
1187
|
-
}, this.isFirstSlide = this.isActive && !i.opener.isOpen, this.zoomLevels = new
|
|
1194
|
+
}, this.isFirstSlide = this.isActive && !i.opener.isOpen, this.zoomLevels = new qt(i.options, t, e, i), this.pswp.dispatch("gettingData", {
|
|
1188
1195
|
slide: this,
|
|
1189
1196
|
data: this.data,
|
|
1190
1197
|
index: e
|
|
1191
|
-
}), this.content = this.pswp.contentLoader.getContentBySlide(this), this.container = x("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
|
|
1198
|
+
}), this.content = this.pswp.contentLoader.getContentBySlide(this), this.container = x("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 je(this), this.prevDisplayedWidth = -1, this.prevDisplayedHeight = -1, this.pswp.dispatch("slideInit", {
|
|
1192
1199
|
slide: this
|
|
1193
1200
|
});
|
|
1194
1201
|
}
|
|
@@ -1312,7 +1319,7 @@ class je {
|
|
|
1312
1319
|
transitionDuration: i
|
|
1313
1320
|
}), o.animations.stopAllPan();
|
|
1314
1321
|
const r = this.currZoomLevel;
|
|
1315
|
-
n || (t = U(t, this.zoomLevels.min, this.zoomLevels.max)), this.setZoomLevel(t), this.pan.x = this.calculateZoomToPanOffset("x", e, r), this.pan.y = this.calculateZoomToPanOffset("y", e, r),
|
|
1322
|
+
n || (t = U(t, this.zoomLevels.min, this.zoomLevels.max)), this.setZoomLevel(t), this.pan.x = this.calculateZoomToPanOffset("x", e, r), this.pan.y = this.calculateZoomToPanOffset("y", e, r), $t(this.pan);
|
|
1316
1323
|
const a = () => {
|
|
1317
1324
|
this._setResolution(t), this.applyCurrentZoomPan();
|
|
1318
1325
|
};
|
|
@@ -1413,7 +1420,7 @@ class je {
|
|
|
1413
1420
|
const {
|
|
1414
1421
|
pswp: t
|
|
1415
1422
|
} = this;
|
|
1416
|
-
S(this.panAreaSize,
|
|
1423
|
+
S(this.panAreaSize, Zt(t.options, t.viewportSize, this.data, this.index)), this.zoomLevels.update(this.width, this.height, this.panAreaSize), t.dispatch("calcSlideSize", {
|
|
1417
1424
|
slide: this
|
|
1418
1425
|
});
|
|
1419
1426
|
}
|
|
@@ -1441,11 +1448,11 @@ class je {
|
|
|
1441
1448
|
t !== this.currentResolution && (this.currentResolution = t, this.updateContentSize(), this.pswp.dispatch("resolutionChanged"));
|
|
1442
1449
|
}
|
|
1443
1450
|
}
|
|
1444
|
-
const
|
|
1445
|
-
function
|
|
1451
|
+
const Ue = 0.35, Ke = 0.6, _t = 0.4, wt = 0.5;
|
|
1452
|
+
function Xe(s, t) {
|
|
1446
1453
|
return s * t / (1 - t);
|
|
1447
1454
|
}
|
|
1448
|
-
class
|
|
1455
|
+
class Ye {
|
|
1449
1456
|
/**
|
|
1450
1457
|
* @param {Gestures} gestures
|
|
1451
1458
|
*/
|
|
@@ -1471,12 +1478,12 @@ class Xe {
|
|
|
1471
1478
|
if (!this.pswp.dispatch("verticalDrag", {
|
|
1472
1479
|
panY: o
|
|
1473
1480
|
}).defaultPrevented) {
|
|
1474
|
-
this._setPanWithFriction("y", o,
|
|
1481
|
+
this._setPanWithFriction("y", o, Ke);
|
|
1475
1482
|
const r = 1 - Math.abs(this._getVerticalDragRatio(n.pan.y));
|
|
1476
1483
|
this.pswp.applyBgOpacity(r), n.applyCurrentZoomPan();
|
|
1477
1484
|
}
|
|
1478
1485
|
} else
|
|
1479
|
-
this._panOrMoveMainScroll("x") || (this._panOrMoveMainScroll("y"), n && (
|
|
1486
|
+
this._panOrMoveMainScroll("x") || (this._panOrMoveMainScroll("y"), n && ($t(n.pan), n.applyCurrentZoomPan()));
|
|
1480
1487
|
}
|
|
1481
1488
|
end() {
|
|
1482
1489
|
const {
|
|
@@ -1488,7 +1495,7 @@ class Xe {
|
|
|
1488
1495
|
let n = 0;
|
|
1489
1496
|
if (this.pswp.animations.stopAll(), e.isShifted()) {
|
|
1490
1497
|
const r = (e.x - e.getCurrSlideX()) / this.pswp.viewportSize.x;
|
|
1491
|
-
t.x < -
|
|
1498
|
+
t.x < -wt && r < 0 || t.x < 0.1 && r < -0.5 ? (n = 1, t.x = Math.min(t.x, 0)) : (t.x > wt && r > 0 || t.x > -0.1 && r > 0.5) && (n = -1, t.x = Math.max(t.x, 0)), e.moveIndexBy(n, !0, t.x);
|
|
1492
1499
|
}
|
|
1493
1500
|
i && i.currZoomLevel > i.zoomLevels.max || this.gestures.isMultitouch ? this.gestures.zoomLevels.correctZoomPan(!0) : (this._finishPanGestureForAxis("x"), this._finishPanGestureForAxis("y"));
|
|
1494
1501
|
}
|
|
@@ -1507,10 +1514,10 @@ class Xe {
|
|
|
1507
1514
|
const {
|
|
1508
1515
|
pan: n,
|
|
1509
1516
|
bounds: o
|
|
1510
|
-
} = i, r = n[t], a = this.pswp.bgOpacity < 1 && t === "y", c = r +
|
|
1517
|
+
} = i, r = n[t], a = this.pswp.bgOpacity < 1 && t === "y", c = r + Xe(e[t], 0.995);
|
|
1511
1518
|
if (a) {
|
|
1512
1519
|
const m = this._getVerticalDragRatio(r), p = this._getVerticalDragRatio(c);
|
|
1513
|
-
if (m < 0 && p < -
|
|
1520
|
+
if (m < 0 && p < -_t || m > 0 && p > _t) {
|
|
1514
1521
|
this.pswp.close();
|
|
1515
1522
|
return;
|
|
1516
1523
|
}
|
|
@@ -1622,16 +1629,16 @@ class Xe {
|
|
|
1622
1629
|
} = n;
|
|
1623
1630
|
if (r.correctPan(t, e) !== e || i) {
|
|
1624
1631
|
const l = Math.round(e - o[t]);
|
|
1625
|
-
o[t] += l * (i ||
|
|
1632
|
+
o[t] += l * (i || Ue);
|
|
1626
1633
|
} else
|
|
1627
1634
|
o[t] = e;
|
|
1628
1635
|
}
|
|
1629
1636
|
}
|
|
1630
|
-
const
|
|
1631
|
-
function
|
|
1637
|
+
const Je = 0.05, Qe = 0.15;
|
|
1638
|
+
function bt(s, t, e) {
|
|
1632
1639
|
return s.x = (t.x + e.x) / 2, s.y = (t.y + e.y) / 2, s;
|
|
1633
1640
|
}
|
|
1634
|
-
class
|
|
1641
|
+
class ti {
|
|
1635
1642
|
/**
|
|
1636
1643
|
* @param {Gestures} gestures
|
|
1637
1644
|
*/
|
|
@@ -1668,7 +1675,7 @@ class Qe {
|
|
|
1668
1675
|
const a = r.zoomLevels.min, l = r.zoomLevels.max;
|
|
1669
1676
|
if (!r.isZoomable() || o.mainScroll.isShifted())
|
|
1670
1677
|
return;
|
|
1671
|
-
|
|
1678
|
+
bt(this._startZoomPoint, e, n), bt(this._zoomPoint, t, i);
|
|
1672
1679
|
let c = 1 / it(e, n) * it(t, i) * this._startZoomLevel;
|
|
1673
1680
|
if (c > r.zoomLevels.initial + r.zoomLevels.initial / 15 && (this._wasOverFitZoomLevel = !0), c < a)
|
|
1674
1681
|
if (o.options.pinchToClose && !this._wasOverFitZoomLevel && this._startZoomLevel <= r.zoomLevels.initial) {
|
|
@@ -1677,8 +1684,8 @@ class Qe {
|
|
|
1677
1684
|
bgOpacity: d
|
|
1678
1685
|
}).defaultPrevented || o.applyBgOpacity(d);
|
|
1679
1686
|
} else
|
|
1680
|
-
c = a - (a - c) *
|
|
1681
|
-
else c > l && (c = l + (c - l) *
|
|
1687
|
+
c = a - (a - c) * Qe;
|
|
1688
|
+
else c > l && (c = l + (c - l) * Je);
|
|
1682
1689
|
r.pan.x = this._calculatePanForZoomLevel("x", c), r.pan.y = this._calculatePanForZoomLevel("y", c), r.setZoomLevel(c), r.applyCurrentZoomPan();
|
|
1683
1690
|
}
|
|
1684
1691
|
end() {
|
|
@@ -1762,11 +1769,11 @@ class Qe {
|
|
|
1762
1769
|
});
|
|
1763
1770
|
}
|
|
1764
1771
|
}
|
|
1765
|
-
function
|
|
1772
|
+
function St(s) {
|
|
1766
1773
|
return !!/** @type {HTMLElement} */
|
|
1767
1774
|
s.target.closest(".pswp__container");
|
|
1768
1775
|
}
|
|
1769
|
-
class
|
|
1776
|
+
class ei {
|
|
1770
1777
|
/**
|
|
1771
1778
|
* @param {Gestures} gestures
|
|
1772
1779
|
*/
|
|
@@ -1789,14 +1796,14 @@ class ti {
|
|
|
1789
1796
|
* @param {PointerEvent} originalEvent
|
|
1790
1797
|
*/
|
|
1791
1798
|
tap(t, e) {
|
|
1792
|
-
|
|
1799
|
+
St(e) && this._doClickOrTapAction("tap", t, e);
|
|
1793
1800
|
}
|
|
1794
1801
|
/**
|
|
1795
1802
|
* @param {Point} point
|
|
1796
1803
|
* @param {PointerEvent} originalEvent
|
|
1797
1804
|
*/
|
|
1798
1805
|
doubleTap(t, e) {
|
|
1799
|
-
|
|
1806
|
+
St(e) && this._doClickOrTapAction("doubleTap", t, e);
|
|
1800
1807
|
}
|
|
1801
1808
|
/**
|
|
1802
1809
|
* @private
|
|
@@ -1840,8 +1847,8 @@ class ti {
|
|
|
1840
1847
|
}
|
|
1841
1848
|
}
|
|
1842
1849
|
}
|
|
1843
|
-
const
|
|
1844
|
-
class
|
|
1850
|
+
const ii = 10, si = 300, ni = 25;
|
|
1851
|
+
class oi {
|
|
1845
1852
|
/**
|
|
1846
1853
|
* @param {PhotoSwipe} pswp
|
|
1847
1854
|
*/
|
|
@@ -1873,7 +1880,7 @@ class ni {
|
|
|
1873
1880
|
}, this._intervalP1 = {
|
|
1874
1881
|
x: 0,
|
|
1875
1882
|
y: 0
|
|
1876
|
-
}, this._numActivePoints = 0, this._ongoingPointers = [], this._touchEventEnabled = "ontouchstart" in window, this._pointerEventEnabled = !!window.PointerEvent, this.supportsTouch = this._touchEventEnabled || this._pointerEventEnabled && navigator.maxTouchPoints > 1, this._numActivePoints = 0, this._intervalTime = 0, this._velocityCalculated = !1, this.isMultitouch = !1, this.isDragging = !1, this.isZooming = !1, this.raf = null, this._tapTimer = null, this.supportsTouch || (t.options.allowPanToNext = !1), this.drag = new
|
|
1883
|
+
}, this._numActivePoints = 0, this._ongoingPointers = [], this._touchEventEnabled = "ontouchstart" in window, this._pointerEventEnabled = !!window.PointerEvent, this.supportsTouch = this._touchEventEnabled || this._pointerEventEnabled && navigator.maxTouchPoints > 1, this._numActivePoints = 0, this._intervalTime = 0, this._velocityCalculated = !1, this.isMultitouch = !1, this.isDragging = !1, this.isZooming = !1, this.raf = null, this._tapTimer = null, this.supportsTouch || (t.options.allowPanToNext = !1), this.drag = new Ye(this), this.zoomLevels = new ti(this), this.tapHandler = new ei(this), t.on("bindEvents", () => {
|
|
1877
1884
|
t.events.add(
|
|
1878
1885
|
t.scrollWrap,
|
|
1879
1886
|
"click",
|
|
@@ -1993,8 +2000,8 @@ class ni {
|
|
|
1993
2000
|
this.tapHandler.click(this.startP1, t);
|
|
1994
2001
|
return;
|
|
1995
2002
|
}
|
|
1996
|
-
const i = this.pswp.options.doubleTapAction ?
|
|
1997
|
-
this._tapTimer ? (this._clearTapTimer(), it(this._lastStartP1, this.startP1) <
|
|
2003
|
+
const i = this.pswp.options.doubleTapAction ? si : 0;
|
|
2004
|
+
this._tapTimer ? (this._clearTapTimer(), it(this._lastStartP1, this.startP1) < ni && this.tapHandler.doubleTap(this.startP1, t)) : (S(this._lastStartP1, this.startP1), this._tapTimer = setTimeout(() => {
|
|
1998
2005
|
this.tapHandler.tap(this.startP1, t), this._clearTapTimer();
|
|
1999
2006
|
}, i));
|
|
2000
2007
|
}
|
|
@@ -2080,7 +2087,7 @@ class ni {
|
|
|
2080
2087
|
const t = Math.abs(this.p1.x - this.startP1.x) - Math.abs(this.p1.y - this.startP1.y);
|
|
2081
2088
|
if (t !== 0) {
|
|
2082
2089
|
const e = t > 0 ? "x" : "y";
|
|
2083
|
-
Math.abs(this.p1[e] - this.startP1[e]) >=
|
|
2090
|
+
Math.abs(this.p1[e] - this.startP1[e]) >= ii && (this.dragAxis = e);
|
|
2084
2091
|
}
|
|
2085
2092
|
}
|
|
2086
2093
|
}
|
|
@@ -2104,8 +2111,8 @@ class ni {
|
|
|
2104
2111
|
this.pswp.mainScroll.isShifted() && (t.preventDefault(), t.stopPropagation());
|
|
2105
2112
|
}
|
|
2106
2113
|
}
|
|
2107
|
-
const
|
|
2108
|
-
class
|
|
2114
|
+
const ri = 0.35;
|
|
2115
|
+
class ai {
|
|
2109
2116
|
/**
|
|
2110
2117
|
* @param {PhotoSwipe} pswp
|
|
2111
2118
|
*/
|
|
@@ -2258,7 +2265,7 @@ class ri {
|
|
|
2258
2265
|
let i = (this.slideWidth * this._currPositionIndex - t) / this.slideWidth;
|
|
2259
2266
|
i += this.pswp.currIndex;
|
|
2260
2267
|
const n = Math.round(t - this.x);
|
|
2261
|
-
(i < 0 && n > 0 || i >= this.pswp.getNumItems() - 1 && n < 0) && (t = this.x + n *
|
|
2268
|
+
(i < 0 && n > 0 || i >= this.pswp.getNumItems() - 1 && n < 0) && (t = this.x + n * ri);
|
|
2262
2269
|
}
|
|
2263
2270
|
this.x = t, this.pswp.container && D(this.pswp.container, t), this.pswp.dispatch("moveMainScroll", {
|
|
2264
2271
|
x: t,
|
|
@@ -2266,7 +2273,7 @@ class ri {
|
|
|
2266
2273
|
});
|
|
2267
2274
|
}
|
|
2268
2275
|
}
|
|
2269
|
-
const
|
|
2276
|
+
const li = {
|
|
2270
2277
|
Escape: 27,
|
|
2271
2278
|
z: 90,
|
|
2272
2279
|
ArrowLeft: 37,
|
|
@@ -2274,8 +2281,8 @@ const ai = {
|
|
|
2274
2281
|
ArrowRight: 39,
|
|
2275
2282
|
ArrowDown: 40,
|
|
2276
2283
|
Tab: 9
|
|
2277
|
-
}, O = (s, t) => t ? s :
|
|
2278
|
-
class
|
|
2284
|
+
}, O = (s, t) => t ? s : li[s];
|
|
2285
|
+
class ci {
|
|
2279
2286
|
/**
|
|
2280
2287
|
* @param {PhotoSwipe} pswp
|
|
2281
2288
|
*/
|
|
@@ -2315,7 +2322,7 @@ class li {
|
|
|
2315
2322
|
} = this;
|
|
2316
2323
|
if (e.dispatch("keydown", {
|
|
2317
2324
|
originalEvent: t
|
|
2318
|
-
}).defaultPrevented ||
|
|
2325
|
+
}).defaultPrevented || He(t))
|
|
2319
2326
|
return;
|
|
2320
2327
|
let i, n, o = !1;
|
|
2321
2328
|
const r = "key" in t;
|
|
@@ -2367,8 +2374,8 @@ class li {
|
|
|
2367
2374
|
) && e.focus();
|
|
2368
2375
|
}
|
|
2369
2376
|
}
|
|
2370
|
-
const
|
|
2371
|
-
class
|
|
2377
|
+
const di = "cubic-bezier(.4,0,.22,1)";
|
|
2378
|
+
class hi {
|
|
2372
2379
|
/**
|
|
2373
2380
|
* onComplete can be unpredictable, be careful about current state
|
|
2374
2381
|
*
|
|
@@ -2384,12 +2391,12 @@ class di {
|
|
|
2384
2391
|
onFinish: r = () => {
|
|
2385
2392
|
},
|
|
2386
2393
|
duration: a = 333,
|
|
2387
|
-
easing: l =
|
|
2394
|
+
easing: l = di
|
|
2388
2395
|
} = t;
|
|
2389
2396
|
this.onFinish = r;
|
|
2390
2397
|
const c = o ? "transform" : "opacity", d = (e = t[c]) !== null && e !== void 0 ? e : "";
|
|
2391
2398
|
this._target = i, this._onComplete = n, this._finished = !1, this._onTransitionEnd = this._onTransitionEnd.bind(this), this._helperTimeout = setTimeout(() => {
|
|
2392
|
-
|
|
2399
|
+
Bt(i, c, a, l), this._helperTimeout = setTimeout(() => {
|
|
2393
2400
|
i.addEventListener("transitionend", this._onTransitionEnd, !1), i.addEventListener("transitioncancel", this._onTransitionEnd, !1), this._helperTimeout = setTimeout(() => {
|
|
2394
2401
|
this._finalizeAnimation();
|
|
2395
2402
|
}, a + 500), i.style[c] = d;
|
|
@@ -2411,11 +2418,11 @@ class di {
|
|
|
2411
2418
|
}
|
|
2412
2419
|
// Destroy is called automatically onFinish
|
|
2413
2420
|
destroy() {
|
|
2414
|
-
this._helperTimeout && clearTimeout(this._helperTimeout),
|
|
2421
|
+
this._helperTimeout && clearTimeout(this._helperTimeout), qe(this._target), this._target.removeEventListener("transitionend", this._onTransitionEnd, !1), this._target.removeEventListener("transitioncancel", this._onTransitionEnd, !1), this._finished || this._finalizeAnimation();
|
|
2415
2422
|
}
|
|
2416
2423
|
}
|
|
2417
|
-
const
|
|
2418
|
-
class
|
|
2424
|
+
const ui = 12, pi = 0.75;
|
|
2425
|
+
class mi {
|
|
2419
2426
|
/**
|
|
2420
2427
|
* @param {number} initialVelocity Initial velocity, px per ms.
|
|
2421
2428
|
*
|
|
@@ -2432,7 +2439,7 @@ class pi {
|
|
|
2432
2439
|
* Recommended value from 10 to 50
|
|
2433
2440
|
*/
|
|
2434
2441
|
constructor(t, e, i) {
|
|
2435
|
-
this.velocity = t * 1e3, this._dampingRatio = e ||
|
|
2442
|
+
this.velocity = t * 1e3, this._dampingRatio = e || pi, this._naturalFrequency = i || ui, this._dampedFrequency = this._naturalFrequency, this._dampingRatio < 1 && (this._dampedFrequency *= Math.sqrt(1 - this._dampingRatio * this._dampingRatio));
|
|
2436
2443
|
}
|
|
2437
2444
|
/**
|
|
2438
2445
|
* @param {number} deltaPosition Difference between current and end position of the animation
|
|
@@ -2454,7 +2461,7 @@ class pi {
|
|
|
2454
2461
|
return i;
|
|
2455
2462
|
}
|
|
2456
2463
|
}
|
|
2457
|
-
class
|
|
2464
|
+
class fi {
|
|
2458
2465
|
/**
|
|
2459
2466
|
* @param {SpringAnimationProps} props
|
|
2460
2467
|
*/
|
|
@@ -2472,7 +2479,7 @@ class mi {
|
|
|
2472
2479
|
naturalFrequency: c
|
|
2473
2480
|
} = t;
|
|
2474
2481
|
this.onFinish = a;
|
|
2475
|
-
const d = new
|
|
2482
|
+
const d = new mi(n, l, c);
|
|
2476
2483
|
let h = Date.now(), u = e - i;
|
|
2477
2484
|
const f = () => {
|
|
2478
2485
|
this._raf && (u = d.easeFrame(u, Date.now() - h), Math.abs(u) < 1 && Math.abs(d.velocity) < 50 ? (o(i), r && r(), this.onFinish()) : (h = Date.now(), o(u + i), this._raf = requestAnimationFrame(f)));
|
|
@@ -2484,7 +2491,7 @@ class mi {
|
|
|
2484
2491
|
this._raf >= 0 && cancelAnimationFrame(this._raf), this._raf = 0;
|
|
2485
2492
|
}
|
|
2486
2493
|
}
|
|
2487
|
-
class
|
|
2494
|
+
class gi {
|
|
2488
2495
|
constructor() {
|
|
2489
2496
|
this.activeAnimations = [];
|
|
2490
2497
|
}
|
|
@@ -2507,10 +2514,10 @@ class fi {
|
|
|
2507
2514
|
* @returns {Animation}
|
|
2508
2515
|
*/
|
|
2509
2516
|
_start(t, e) {
|
|
2510
|
-
const i = e ? new
|
|
2517
|
+
const i = e ? new fi(
|
|
2511
2518
|
/** @type SpringAnimationProps */
|
|
2512
2519
|
t
|
|
2513
|
-
) : new
|
|
2520
|
+
) : new hi(
|
|
2514
2521
|
/** @type CssAnimationProps */
|
|
2515
2522
|
t
|
|
2516
2523
|
);
|
|
@@ -2553,7 +2560,7 @@ class fi {
|
|
|
2553
2560
|
return this.activeAnimations.some((t) => t.props.isPan);
|
|
2554
2561
|
}
|
|
2555
2562
|
}
|
|
2556
|
-
class
|
|
2563
|
+
class vi {
|
|
2557
2564
|
/**
|
|
2558
2565
|
* @param {PhotoSwipe} pswp
|
|
2559
2566
|
*/
|
|
@@ -2595,7 +2602,7 @@ class gi {
|
|
|
2595
2602
|
e.isPannable() && (t.deltaMode === 1 && (i *= 18, n *= 18), e.panTo(e.pan.x - i, e.pan.y - n));
|
|
2596
2603
|
}
|
|
2597
2604
|
}
|
|
2598
|
-
function
|
|
2605
|
+
function yi(s) {
|
|
2599
2606
|
if (typeof s == "string")
|
|
2600
2607
|
return s;
|
|
2601
2608
|
if (!s || !s.isCustomSVG)
|
|
@@ -2607,7 +2614,7 @@ function vi(s) {
|
|
|
2607
2614
|
t.size || 32
|
|
2608
2615
|
), t.outlineID && (e += '<use class="pswp__icn-shadow" xlink:href="#' + t.outlineID + '"/>'), e += t.inner, e += "</svg>", e;
|
|
2609
2616
|
}
|
|
2610
|
-
class
|
|
2617
|
+
class _i {
|
|
2611
2618
|
/**
|
|
2612
2619
|
* @param {PhotoSwipe} pswp
|
|
2613
2620
|
* @param {UIElementData} data
|
|
@@ -2639,7 +2646,7 @@ class yi {
|
|
|
2639
2646
|
const f = u || h;
|
|
2640
2647
|
f && l.setAttribute("aria-label", f);
|
|
2641
2648
|
}
|
|
2642
|
-
l.innerHTML =
|
|
2649
|
+
l.innerHTML = yi(o), e.onInit && e.onInit(l, t), e.onClick && (l.onclick = (h) => {
|
|
2643
2650
|
typeof e.onClick == "string" ? t[e.onClick]() : typeof e.onClick == "function" && e.onClick(h, l, t);
|
|
2644
2651
|
});
|
|
2645
2652
|
const c = e.appendTo || "bar";
|
|
@@ -2647,12 +2654,12 @@ class yi {
|
|
|
2647
2654
|
c === "bar" ? (t.topBar || (t.topBar = x("pswp__top-bar pswp__hide-on-close", "div", t.scrollWrap)), d = t.topBar) : (l.classList.add("pswp__hide-on-close"), c === "wrapper" && (d = t.scrollWrap)), (i = d) === null || i === void 0 || i.appendChild(t.applyFilters("uiElement", l, e));
|
|
2648
2655
|
}
|
|
2649
2656
|
}
|
|
2650
|
-
function
|
|
2657
|
+
function Nt(s, t, e) {
|
|
2651
2658
|
s.classList.add("pswp__button--arrow"), s.setAttribute("aria-controls", "pswp__items"), t.on("change", () => {
|
|
2652
2659
|
t.options.loop || (e ? s.disabled = !(t.currIndex < t.getNumItems() - 1) : s.disabled = !(t.currIndex > 0));
|
|
2653
2660
|
});
|
|
2654
2661
|
}
|
|
2655
|
-
const
|
|
2662
|
+
const wi = {
|
|
2656
2663
|
name: "arrowPrev",
|
|
2657
2664
|
className: "pswp__button--arrow--prev",
|
|
2658
2665
|
title: "Previous",
|
|
@@ -2666,8 +2673,8 @@ const _i = {
|
|
|
2666
2673
|
outlineID: "pswp__icn-arrow"
|
|
2667
2674
|
},
|
|
2668
2675
|
onClick: "prev",
|
|
2669
|
-
onInit:
|
|
2670
|
-
},
|
|
2676
|
+
onInit: Nt
|
|
2677
|
+
}, bi = {
|
|
2671
2678
|
name: "arrowNext",
|
|
2672
2679
|
className: "pswp__button--arrow--next",
|
|
2673
2680
|
title: "Next",
|
|
@@ -2682,9 +2689,9 @@ const _i = {
|
|
|
2682
2689
|
},
|
|
2683
2690
|
onClick: "next",
|
|
2684
2691
|
onInit: (s, t) => {
|
|
2685
|
-
|
|
2692
|
+
Nt(s, t, !0);
|
|
2686
2693
|
}
|
|
2687
|
-
},
|
|
2694
|
+
}, Si = {
|
|
2688
2695
|
name: "close",
|
|
2689
2696
|
title: "Close",
|
|
2690
2697
|
order: 20,
|
|
@@ -2695,7 +2702,7 @@ const _i = {
|
|
|
2695
2702
|
outlineID: "pswp__icn-close"
|
|
2696
2703
|
},
|
|
2697
2704
|
onClick: "close"
|
|
2698
|
-
},
|
|
2705
|
+
}, Li = {
|
|
2699
2706
|
name: "zoom",
|
|
2700
2707
|
title: "Zoom",
|
|
2701
2708
|
order: 10,
|
|
@@ -2707,7 +2714,7 @@ const _i = {
|
|
|
2707
2714
|
outlineID: "pswp__icn-zoom"
|
|
2708
2715
|
},
|
|
2709
2716
|
onClick: "toggleZoom"
|
|
2710
|
-
},
|
|
2717
|
+
}, Ei = {
|
|
2711
2718
|
name: "preloader",
|
|
2712
2719
|
appendTo: "bar",
|
|
2713
2720
|
order: 7,
|
|
@@ -2747,10 +2754,10 @@ const _i = {
|
|
|
2747
2754
|
});
|
|
2748
2755
|
}
|
|
2749
2756
|
};
|
|
2750
|
-
function
|
|
2757
|
+
function Lt(s, t) {
|
|
2751
2758
|
s.classList.toggle("pswp--zoomed-in", t);
|
|
2752
2759
|
}
|
|
2753
|
-
class
|
|
2760
|
+
class Ci {
|
|
2754
2761
|
/**
|
|
2755
2762
|
* @param {PhotoSwipe} pswp
|
|
2756
2763
|
*/
|
|
@@ -2762,7 +2769,7 @@ class Ei {
|
|
|
2762
2769
|
const {
|
|
2763
2770
|
pswp: t
|
|
2764
2771
|
} = this;
|
|
2765
|
-
this.isRegistered = !1, this.uiElementsData = [
|
|
2772
|
+
this.isRegistered = !1, this.uiElementsData = [Si, wi, bi, Li, Ei, Ai], t.dispatch("uiRegister"), this.uiElementsData.sort((e, i) => (e.order || 0) - (i.order || 0)), this.items = [], this.isRegistered = !0, this.uiElementsData.forEach((e) => {
|
|
2766
2773
|
this.registerElement(e);
|
|
2767
2774
|
}), t.on("change", () => {
|
|
2768
2775
|
var e;
|
|
@@ -2773,7 +2780,7 @@ class Ei {
|
|
|
2773
2780
|
* @param {UIElementData} elementData
|
|
2774
2781
|
*/
|
|
2775
2782
|
registerElement(t) {
|
|
2776
|
-
this.isRegistered ? this.items.push(new
|
|
2783
|
+
this.isRegistered ? this.items.push(new _i(this.pswp, t)) : this.uiElementsData.push(t);
|
|
2777
2784
|
}
|
|
2778
2785
|
/**
|
|
2779
2786
|
* Fired each time zoom or pan position is changed.
|
|
@@ -2797,15 +2804,15 @@ class Ei {
|
|
|
2797
2804
|
this._lastUpdatedZoomLevel = n;
|
|
2798
2805
|
const o = e.zoomLevels.initial - e.zoomLevels.secondary;
|
|
2799
2806
|
if (Math.abs(o) < 0.01 || !e.isZoomable()) {
|
|
2800
|
-
|
|
2807
|
+
Lt(t, !1), t.classList.remove("pswp--zoom-allowed");
|
|
2801
2808
|
return;
|
|
2802
2809
|
}
|
|
2803
2810
|
t.classList.add("pswp--zoom-allowed");
|
|
2804
2811
|
const r = n === e.zoomLevels.initial ? e.zoomLevels.secondary : e.zoomLevels.initial;
|
|
2805
|
-
|
|
2812
|
+
Lt(t, r <= n), (i.imageClickAction === "zoom" || i.imageClickAction === "zoom-or-close") && t.classList.add("pswp--click-to-zoom");
|
|
2806
2813
|
}
|
|
2807
2814
|
}
|
|
2808
|
-
function
|
|
2815
|
+
function xi(s) {
|
|
2809
2816
|
const t = s.getBoundingClientRect();
|
|
2810
2817
|
return {
|
|
2811
2818
|
x: t.left,
|
|
@@ -2813,7 +2820,7 @@ function Ci(s) {
|
|
|
2813
2820
|
w: t.width
|
|
2814
2821
|
};
|
|
2815
2822
|
}
|
|
2816
|
-
function
|
|
2823
|
+
function Pi(s, t, e) {
|
|
2817
2824
|
const i = s.getBoundingClientRect(), n = i.width / t, o = i.height / e, r = n > o ? n : o, a = (i.width - t * r) / 2, l = (i.height - e * r) / 2, c = {
|
|
2818
2825
|
x: i.left + a,
|
|
2819
2826
|
y: i.top + l,
|
|
@@ -2826,7 +2833,7 @@ function xi(s, t, e) {
|
|
|
2826
2833
|
y: l
|
|
2827
2834
|
}, c;
|
|
2828
2835
|
}
|
|
2829
|
-
function
|
|
2836
|
+
function Ti(s, t, e) {
|
|
2830
2837
|
const i = e.dispatch("thumbBounds", {
|
|
2831
2838
|
index: s,
|
|
2832
2839
|
itemData: t,
|
|
@@ -2845,7 +2852,7 @@ function Pi(s, t, e) {
|
|
|
2845
2852
|
n.querySelector(a)
|
|
2846
2853
|
);
|
|
2847
2854
|
}
|
|
2848
|
-
return r = e.applyFilters("thumbEl", r, t, s), r && (t.thumbCropped ? o =
|
|
2855
|
+
return r = e.applyFilters("thumbEl", r, t, s), r && (t.thumbCropped ? o = Pi(r, t.width || t.w || 0, t.height || t.h || 0) : o = xi(r)), e.applyFilters("thumbBounds", o, t, s);
|
|
2849
2856
|
}
|
|
2850
2857
|
let Ii = class {
|
|
2851
2858
|
/**
|
|
@@ -2858,7 +2865,7 @@ let Ii = class {
|
|
|
2858
2865
|
preventDefault() {
|
|
2859
2866
|
this.defaultPrevented = !0;
|
|
2860
2867
|
}
|
|
2861
|
-
},
|
|
2868
|
+
}, Mi = class {
|
|
2862
2869
|
constructor() {
|
|
2863
2870
|
this._listeners = {}, this._filters = {}, this.pswp = void 0, this.options = void 0;
|
|
2864
2871
|
}
|
|
@@ -2931,7 +2938,7 @@ let Ii = class {
|
|
|
2931
2938
|
o.call(this, n);
|
|
2932
2939
|
}), n;
|
|
2933
2940
|
}
|
|
2934
|
-
},
|
|
2941
|
+
}, zi = class {
|
|
2935
2942
|
/**
|
|
2936
2943
|
* @param {string | false} imageSrc
|
|
2937
2944
|
* @param {HTMLElement} container
|
|
@@ -2957,7 +2964,7 @@ let Ii = class {
|
|
|
2957
2964
|
var t;
|
|
2958
2965
|
(t = this.element) !== null && t !== void 0 && t.parentNode && this.element.remove(), this.element = null;
|
|
2959
2966
|
}
|
|
2960
|
-
},
|
|
2967
|
+
}, Oi = class {
|
|
2961
2968
|
/**
|
|
2962
2969
|
* @param {SlideData} itemData Slide data
|
|
2963
2970
|
* @param {PhotoSwipeBase} instance PhotoSwipe or PhotoSwipeLightbox instance
|
|
@@ -2992,7 +2999,7 @@ let Ii = class {
|
|
|
2992
2999
|
this.data.msrc && this.slide.isFirstSlide ? this.data.msrc : !1,
|
|
2993
3000
|
this
|
|
2994
3001
|
);
|
|
2995
|
-
this.placeholder = new
|
|
3002
|
+
this.placeholder = new zi(i, this.slide.container);
|
|
2996
3003
|
}
|
|
2997
3004
|
this.element && !e || this.instance.dispatch("contentLoad", {
|
|
2998
3005
|
content: this,
|
|
@@ -3162,7 +3169,7 @@ let Ii = class {
|
|
|
3162
3169
|
}).defaultPrevented)
|
|
3163
3170
|
return;
|
|
3164
3171
|
const t = "decode" in this.element;
|
|
3165
|
-
this.isImageContent() ? t && this.slide && (!this.slide.isActive ||
|
|
3172
|
+
this.isImageContent() ? t && this.slide && (!this.slide.isActive || vt()) ? (this.isDecoding = !0, this.element.decode().catch(() => {
|
|
3166
3173
|
}).finally(() => {
|
|
3167
3174
|
this.isDecoding = !1, this.appendImage();
|
|
3168
3175
|
})) : this.appendImage() : this.slide && !this.element.parentNode && this.slide.container.appendChild(this.element);
|
|
@@ -3175,7 +3182,7 @@ let Ii = class {
|
|
|
3175
3182
|
activate() {
|
|
3176
3183
|
this.instance.dispatch("contentActivate", {
|
|
3177
3184
|
content: this
|
|
3178
|
-
}).defaultPrevented || !this.slide || (this.isImageContent() && this.isDecoding && !
|
|
3185
|
+
}).defaultPrevented || !this.slide || (this.isImageContent() && this.isDecoding && !vt() ? this.appendImage() : this.isError() && this.load(!1, !0), this.slide.holderElement && this.slide.holderElement.setAttribute("aria-hidden", "false"));
|
|
3179
3186
|
}
|
|
3180
3187
|
/**
|
|
3181
3188
|
* Deactivate the content
|
|
@@ -3202,36 +3209,36 @@ let Ii = class {
|
|
|
3202
3209
|
}).defaultPrevented || (this.slide && this.element && !this.element.parentNode && this.slide.container.appendChild(this.element), (this.state === P.LOADED || this.state === P.ERROR) && this.removePlaceholder()));
|
|
3203
3210
|
}
|
|
3204
3211
|
};
|
|
3205
|
-
const
|
|
3206
|
-
function
|
|
3212
|
+
const Di = 5;
|
|
3213
|
+
function Ht(s, t, e) {
|
|
3207
3214
|
const i = t.createContentFromData(s, e);
|
|
3208
3215
|
let n;
|
|
3209
3216
|
const {
|
|
3210
3217
|
options: o
|
|
3211
3218
|
} = t;
|
|
3212
3219
|
if (o) {
|
|
3213
|
-
n = new
|
|
3220
|
+
n = new qt(o, s, -1);
|
|
3214
3221
|
let r;
|
|
3215
|
-
t.pswp ? r = t.pswp.viewportSize : r =
|
|
3216
|
-
const a =
|
|
3222
|
+
t.pswp ? r = t.pswp.viewportSize : r = kt(o, t);
|
|
3223
|
+
const a = Zt(o, r, s, e);
|
|
3217
3224
|
n.update(i.width, i.height, a);
|
|
3218
3225
|
}
|
|
3219
3226
|
return i.lazyLoad(), n && i.setDisplayedSize(Math.ceil(i.width * n.initial), Math.ceil(i.height * n.initial)), i;
|
|
3220
3227
|
}
|
|
3221
|
-
function
|
|
3228
|
+
function Ri(s, t) {
|
|
3222
3229
|
const e = t.getItemData(s);
|
|
3223
3230
|
if (!t.dispatch("lazyLoadSlide", {
|
|
3224
3231
|
index: s,
|
|
3225
3232
|
itemData: e
|
|
3226
3233
|
}).defaultPrevented)
|
|
3227
|
-
return
|
|
3234
|
+
return Ht(e, t, s);
|
|
3228
3235
|
}
|
|
3229
|
-
class
|
|
3236
|
+
class $i {
|
|
3230
3237
|
/**
|
|
3231
3238
|
* @param {PhotoSwipe} pswp
|
|
3232
3239
|
*/
|
|
3233
3240
|
constructor(t) {
|
|
3234
|
-
this.pswp = t, this.limit = Math.max(t.options.preload[0] + t.options.preload[1] + 1,
|
|
3241
|
+
this.pswp = t, this.limit = Math.max(t.options.preload[0] + t.options.preload[1] + 1, Di), this._cachedItems = [];
|
|
3235
3242
|
}
|
|
3236
3243
|
/**
|
|
3237
3244
|
* Lazy load nearby slides based on `preload` option.
|
|
@@ -3259,7 +3266,7 @@ class Ri {
|
|
|
3259
3266
|
loadSlideByIndex(t) {
|
|
3260
3267
|
const e = this.pswp.getLoopedIndex(t);
|
|
3261
3268
|
let i = this.getContentByIndex(e);
|
|
3262
|
-
i || (i =
|
|
3269
|
+
i || (i = Ri(e, this.pswp), i && this.addToCache(i));
|
|
3263
3270
|
}
|
|
3264
3271
|
/**
|
|
3265
3272
|
* @param {Slide} slide
|
|
@@ -3298,7 +3305,7 @@ class Ri {
|
|
|
3298
3305
|
this._cachedItems.forEach((t) => t.destroy()), this._cachedItems = [];
|
|
3299
3306
|
}
|
|
3300
3307
|
}
|
|
3301
|
-
let
|
|
3308
|
+
let Bi = class extends Mi {
|
|
3302
3309
|
/**
|
|
3303
3310
|
* Get total number of slides
|
|
3304
3311
|
*
|
|
@@ -3321,7 +3328,7 @@ let $i = class extends Ti {
|
|
|
3321
3328
|
* @returns {Content}
|
|
3322
3329
|
*/
|
|
3323
3330
|
createContentFromData(t, e) {
|
|
3324
|
-
return new
|
|
3331
|
+
return new Oi(t, this, e);
|
|
3325
3332
|
}
|
|
3326
3333
|
/**
|
|
3327
3334
|
* Get item data by index.
|
|
@@ -3355,7 +3362,7 @@ let $i = class extends Ti {
|
|
|
3355
3362
|
*/
|
|
3356
3363
|
_getGalleryDOMElements(t) {
|
|
3357
3364
|
var e, i;
|
|
3358
|
-
return (e = this.options) !== null && e !== void 0 && e.children || (i = this.options) !== null && i !== void 0 && i.childSelector ?
|
|
3365
|
+
return (e = this.options) !== null && e !== void 0 && e.children || (i = this.options) !== null && i !== void 0 && i.childSelector ? We(this.options.children, this.options.childSelector, t) || [] : [t];
|
|
3359
3366
|
}
|
|
3360
3367
|
/**
|
|
3361
3368
|
* Converts DOM element to item data object.
|
|
@@ -3389,11 +3396,11 @@ let $i = class extends Ti {
|
|
|
3389
3396
|
* @returns {Content} Image that is being decoded or false.
|
|
3390
3397
|
*/
|
|
3391
3398
|
lazyLoadData(t, e) {
|
|
3392
|
-
return
|
|
3399
|
+
return Ht(t, this, e);
|
|
3393
3400
|
}
|
|
3394
3401
|
};
|
|
3395
3402
|
const Z = 3e-3;
|
|
3396
|
-
class
|
|
3403
|
+
class Fi {
|
|
3397
3404
|
/**
|
|
3398
3405
|
* @param {PhotoSwipe} pswp
|
|
3399
3406
|
*/
|
|
@@ -3446,7 +3453,7 @@ class Bi {
|
|
|
3446
3453
|
_start() {
|
|
3447
3454
|
this.isOpening && this._useAnimation && this._placeholder && this._placeholder.tagName === "IMG" ? new Promise((t) => {
|
|
3448
3455
|
let e = !1, i = !0;
|
|
3449
|
-
|
|
3456
|
+
Ne(
|
|
3450
3457
|
/** @type {HTMLImageElement} */
|
|
3451
3458
|
this._placeholder
|
|
3452
3459
|
).finally(() => {
|
|
@@ -3537,7 +3544,7 @@ class Bi {
|
|
|
3537
3544
|
o[e] = i, n.startTransition(o);
|
|
3538
3545
|
}
|
|
3539
3546
|
}
|
|
3540
|
-
const
|
|
3547
|
+
const ki = {
|
|
3541
3548
|
allowPanToNext: !0,
|
|
3542
3549
|
spacing: 0.1,
|
|
3543
3550
|
loop: !0,
|
|
@@ -3564,7 +3571,7 @@ const Fi = {
|
|
|
3564
3571
|
preload: [1, 2],
|
|
3565
3572
|
easing: "cubic-bezier(.4,0,.22,1)"
|
|
3566
3573
|
};
|
|
3567
|
-
class
|
|
3574
|
+
class Zi extends Bi {
|
|
3568
3575
|
/**
|
|
3569
3576
|
* @param {PhotoSwipeOptions} [options]
|
|
3570
3577
|
*/
|
|
@@ -3578,7 +3585,7 @@ class ki extends $i {
|
|
|
3578
3585
|
}, this.viewportSize = {
|
|
3579
3586
|
x: 0,
|
|
3580
3587
|
y: 0
|
|
3581
|
-
}, this.bgOpacity = 1, this.currIndex = 0, this.potentialIndex = 0, this.isOpen = !1, this.isDestroying = !1, this.hasMouse = !1, this._initialItemData = {}, this._initialThumbBounds = void 0, this.topBar = void 0, this.element = void 0, this.template = void 0, this.container = void 0, this.scrollWrap = void 0, this.currSlide = void 0, this.events = new
|
|
3588
|
+
}, this.bgOpacity = 1, this.currIndex = 0, this.potentialIndex = 0, this.isOpen = !1, this.isDestroying = !1, this.hasMouse = !1, this._initialItemData = {}, this._initialThumbBounds = void 0, this.topBar = void 0, this.element = void 0, this.template = void 0, this.container = void 0, this.scrollWrap = void 0, this.currSlide = void 0, this.events = new Ve(), this.animations = new gi(), this.mainScroll = new ai(this), this.gestures = new oi(this), this.opener = new Fi(this), this.keyboard = new ci(this), this.contentLoader = new $i(this);
|
|
3582
3589
|
}
|
|
3583
3590
|
/** @returns {boolean} */
|
|
3584
3591
|
init() {
|
|
@@ -3586,7 +3593,7 @@ class ki extends $i {
|
|
|
3586
3593
|
return !1;
|
|
3587
3594
|
this.isOpen = !0, this.dispatch("init"), this.dispatch("beforeOpen"), this._createMainStructure();
|
|
3588
3595
|
let t = "pswp--open";
|
|
3589
|
-
return this.gestures.supportsTouch && (t += " pswp--touch"), this.options.mainClass && (t += " " + this.options.mainClass), this.element && (this.element.className += " " + t), this.currIndex = this.options.index || 0, this.potentialIndex = this.currIndex, this.dispatch("firstUpdate"), this.scrollWheel = new
|
|
3596
|
+
return this.gestures.supportsTouch && (t += " pswp--touch"), this.options.mainClass && (t += " " + this.options.mainClass), this.element && (this.element.className += " " + t), this.currIndex = this.options.index || 0, this.potentialIndex = this.currIndex, this.dispatch("firstUpdate"), this.scrollWheel = new vi(this), (Number.isNaN(this.currIndex) || this.currIndex < 0 || this.currIndex >= this.getNumItems()) && (this.currIndex = 0), this.gestures.supportsTouch || this.mouseDetected(), this.updateSize(), this.offset.y = window.pageYOffset, this._initialItemData = this.getItemData(this.currIndex), this.dispatch("gettingData", {
|
|
3590
3597
|
index: this.currIndex,
|
|
3591
3598
|
data: this._initialItemData,
|
|
3592
3599
|
slide: void 0
|
|
@@ -3705,7 +3712,7 @@ class ki extends $i {
|
|
|
3705
3712
|
if (!this.canLoop() && (e < 0 || e >= this.getNumItems()))
|
|
3706
3713
|
return;
|
|
3707
3714
|
const n = this.getItemData(e);
|
|
3708
|
-
t.slide = new
|
|
3715
|
+
t.slide = new Ge(n, e, this), e === this.currIndex && (this.currSlide = t.slide), t.slide.append(t.el);
|
|
3709
3716
|
}
|
|
3710
3717
|
/** @returns {Point} */
|
|
3711
3718
|
getViewportCenterPoint() {
|
|
@@ -3723,7 +3730,7 @@ class ki extends $i {
|
|
|
3723
3730
|
updateSize(t) {
|
|
3724
3731
|
if (this.isDestroying)
|
|
3725
3732
|
return;
|
|
3726
|
-
const e =
|
|
3733
|
+
const e = kt(this.options, this);
|
|
3727
3734
|
!t && j(e, this._prevViewportSize) || (S(this._prevViewportSize, e), this.dispatch("beforeResize"), S(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"));
|
|
3728
3735
|
}
|
|
3729
3736
|
/**
|
|
@@ -3775,7 +3782,7 @@ class ki extends $i {
|
|
|
3775
3782
|
* @private
|
|
3776
3783
|
*/
|
|
3777
3784
|
_createMainStructure() {
|
|
3778
|
-
this.element = x("pswp", "div"), this.element.setAttribute("tabindex", "-1"), this.element.setAttribute("role", "dialog"), this.template = this.element, this.bg = x("pswp__bg", "div", this.element), this.scrollWrap = x("pswp__scroll-wrap", "section", this.element), this.container = x("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
|
|
3785
|
+
this.element = x("pswp", "div"), this.element.setAttribute("tabindex", "-1"), this.element.setAttribute("role", "dialog"), this.template = this.element, this.bg = x("pswp__bg", "div", this.element), this.scrollWrap = x("pswp__scroll-wrap", "section", this.element), this.container = x("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 Ci(this), this.ui.init(), (this.options.appendToEl || document.body).appendChild(this.element);
|
|
3779
3786
|
}
|
|
3780
3787
|
/**
|
|
3781
3788
|
* Get position and dimensions of small thumbnail
|
|
@@ -3786,7 +3793,7 @@ class ki extends $i {
|
|
|
3786
3793
|
* @returns {Bounds | undefined}
|
|
3787
3794
|
*/
|
|
3788
3795
|
getThumbBounds() {
|
|
3789
|
-
return
|
|
3796
|
+
return Ti(this.currIndex, this.currSlide ? this.currSlide.data : this._initialItemData, this);
|
|
3790
3797
|
}
|
|
3791
3798
|
/**
|
|
3792
3799
|
* If the PhotoSwipe can have continuous loop
|
|
@@ -3802,7 +3809,7 @@ class ki extends $i {
|
|
|
3802
3809
|
*/
|
|
3803
3810
|
_prepareOptions(t) {
|
|
3804
3811
|
return window.matchMedia("(prefers-reduced-motion), (update: slow)").matches && (t.showHideAnimationType = "none", t.zoomAnimationDuration = 0), {
|
|
3805
|
-
...
|
|
3812
|
+
...ki,
|
|
3806
3813
|
...t
|
|
3807
3814
|
};
|
|
3808
3815
|
}
|
|
@@ -3811,20 +3818,20 @@ function N(s, t, e) {
|
|
|
3811
3818
|
const i = document.createElement(t);
|
|
3812
3819
|
return s && (i.className = s), e && e.appendChild(i), i;
|
|
3813
3820
|
}
|
|
3814
|
-
function
|
|
3821
|
+
function qi(s, t, e) {
|
|
3815
3822
|
let i = `translate3d(${s}px,0px,0)`;
|
|
3816
3823
|
return e !== void 0 && (i += ` scale3d(${e},${e},1)`), i;
|
|
3817
3824
|
}
|
|
3818
3825
|
function nt(s, t, e) {
|
|
3819
3826
|
s.style.width = typeof t == "number" ? `${t}px` : t, s.style.height = typeof e == "number" ? `${e}px` : e;
|
|
3820
3827
|
}
|
|
3821
|
-
const
|
|
3828
|
+
const T = {
|
|
3822
3829
|
IDLE: "idle",
|
|
3823
3830
|
LOADING: "loading",
|
|
3824
3831
|
LOADED: "loaded",
|
|
3825
3832
|
ERROR: "error"
|
|
3826
3833
|
};
|
|
3827
|
-
function
|
|
3834
|
+
function Ni(s) {
|
|
3828
3835
|
return "button" in s && s.button === 1 || s.ctrlKey || s.metaKey || s.altKey || s.shiftKey;
|
|
3829
3836
|
}
|
|
3830
3837
|
function H(s, t, e = document) {
|
|
@@ -3839,13 +3846,13 @@ function H(s, t, e = document) {
|
|
|
3839
3846
|
}
|
|
3840
3847
|
return i;
|
|
3841
3848
|
}
|
|
3842
|
-
function
|
|
3849
|
+
function Hi(s) {
|
|
3843
3850
|
return typeof s == "function" && s.prototype && s.prototype.goTo;
|
|
3844
3851
|
}
|
|
3845
|
-
function
|
|
3852
|
+
function Et() {
|
|
3846
3853
|
return !!(navigator.vendor && navigator.vendor.match(/apple/i));
|
|
3847
3854
|
}
|
|
3848
|
-
class
|
|
3855
|
+
class Wi {
|
|
3849
3856
|
/**
|
|
3850
3857
|
* @param {T} type
|
|
3851
3858
|
* @param {PhotoSwipeEventsMap[T]} [details]
|
|
@@ -3857,7 +3864,7 @@ class Hi {
|
|
|
3857
3864
|
this.defaultPrevented = !0;
|
|
3858
3865
|
}
|
|
3859
3866
|
}
|
|
3860
|
-
class
|
|
3867
|
+
class Vi {
|
|
3861
3868
|
constructor() {
|
|
3862
3869
|
this._listeners = {}, this._filters = {}, this.pswp = void 0, this.options = void 0;
|
|
3863
3870
|
}
|
|
@@ -3924,14 +3931,14 @@ class Wi {
|
|
|
3924
3931
|
return this.pswp.dispatch(t, e);
|
|
3925
3932
|
const n = (
|
|
3926
3933
|
/** @type {AugmentedEvent<T>} */
|
|
3927
|
-
new
|
|
3934
|
+
new Wi(t, e)
|
|
3928
3935
|
);
|
|
3929
3936
|
return (i = this._listeners[t]) === null || i === void 0 || i.forEach((o) => {
|
|
3930
3937
|
o.call(this, n);
|
|
3931
3938
|
}), n;
|
|
3932
3939
|
}
|
|
3933
3940
|
}
|
|
3934
|
-
class
|
|
3941
|
+
class ji {
|
|
3935
3942
|
/**
|
|
3936
3943
|
* @param {string | false} imageSrc
|
|
3937
3944
|
* @param {HTMLElement} container
|
|
@@ -3951,21 +3958,21 @@ class Vi {
|
|
|
3951
3958
|
* @param {number} height
|
|
3952
3959
|
*/
|
|
3953
3960
|
setDisplayedSize(t, e) {
|
|
3954
|
-
this.element && (this.element.tagName === "IMG" ? (nt(this.element, 250, "auto"), this.element.style.transformOrigin = "0 0", this.element.style.transform =
|
|
3961
|
+
this.element && (this.element.tagName === "IMG" ? (nt(this.element, 250, "auto"), this.element.style.transformOrigin = "0 0", this.element.style.transform = qi(0, 0, t / 250)) : nt(this.element, t, e));
|
|
3955
3962
|
}
|
|
3956
3963
|
destroy() {
|
|
3957
3964
|
var t;
|
|
3958
3965
|
(t = this.element) !== null && t !== void 0 && t.parentNode && this.element.remove(), this.element = null;
|
|
3959
3966
|
}
|
|
3960
3967
|
}
|
|
3961
|
-
class
|
|
3968
|
+
class Gi {
|
|
3962
3969
|
/**
|
|
3963
3970
|
* @param {SlideData} itemData Slide data
|
|
3964
3971
|
* @param {PhotoSwipeBase} instance PhotoSwipe or PhotoSwipeLightbox instance
|
|
3965
3972
|
* @param {number} index
|
|
3966
3973
|
*/
|
|
3967
3974
|
constructor(t, e, i) {
|
|
3968
|
-
this.instance = e, this.data = t, this.index = i, this.element = void 0, this.placeholder = void 0, this.slide = void 0, this.displayedImageWidth = 0, this.displayedImageHeight = 0, this.width = Number(this.data.w) || Number(this.data.width) || 0, this.height = Number(this.data.h) || Number(this.data.height) || 0, this.isAttached = !1, this.hasSlide = !1, this.isDecoding = !1, this.state =
|
|
3975
|
+
this.instance = e, this.data = t, this.index = i, this.element = void 0, this.placeholder = void 0, this.slide = void 0, this.displayedImageWidth = 0, this.displayedImageHeight = 0, this.width = Number(this.data.w) || Number(this.data.width) || 0, this.height = Number(this.data.h) || Number(this.data.height) || 0, this.isAttached = !1, this.hasSlide = !1, this.isDecoding = !1, this.state = T.IDLE, this.data.type ? this.type = this.data.type : this.data.src ? this.type = "image" : this.type = "html", this.instance.dispatch("contentInit", {
|
|
3969
3976
|
content: this
|
|
3970
3977
|
});
|
|
3971
3978
|
}
|
|
@@ -3993,7 +4000,7 @@ class ji {
|
|
|
3993
4000
|
this.data.msrc && this.slide.isFirstSlide ? this.data.msrc : !1,
|
|
3994
4001
|
this
|
|
3995
4002
|
);
|
|
3996
|
-
this.placeholder = new
|
|
4003
|
+
this.placeholder = new ji(i, this.slide.container);
|
|
3997
4004
|
}
|
|
3998
4005
|
this.element && !e || this.instance.dispatch("contentLoad", {
|
|
3999
4006
|
content: this,
|
|
@@ -4016,7 +4023,7 @@ class ji {
|
|
|
4016
4023
|
/** @type HTMLImageElement */
|
|
4017
4024
|
this.element
|
|
4018
4025
|
);
|
|
4019
|
-
this.updateSrcsetSizes(), this.data.srcset && (n.srcset = this.data.srcset), n.src = (e = this.data.src) !== null && e !== void 0 ? e : "", n.alt = (i = this.data.alt) !== null && i !== void 0 ? i : "", this.state =
|
|
4026
|
+
this.updateSrcsetSizes(), this.data.srcset && (n.srcset = this.data.srcset), n.src = (e = this.data.src) !== null && e !== void 0 ? e : "", n.alt = (i = this.data.alt) !== null && i !== void 0 ? i : "", this.state = T.LOADING, n.complete ? this.onLoaded() : (n.onload = () => {
|
|
4020
4027
|
this.onLoaded();
|
|
4021
4028
|
}, n.onerror = () => {
|
|
4022
4029
|
this.onError();
|
|
@@ -4034,16 +4041,16 @@ class ji {
|
|
|
4034
4041
|
* Content load success handler
|
|
4035
4042
|
*/
|
|
4036
4043
|
onLoaded() {
|
|
4037
|
-
this.state =
|
|
4044
|
+
this.state = T.LOADED, this.slide && this.element && (this.instance.dispatch("loadComplete", {
|
|
4038
4045
|
slide: this.slide,
|
|
4039
4046
|
content: this
|
|
4040
|
-
}), this.slide.isActive && this.slide.heavyAppended && !this.element.parentNode && (this.append(), this.slide.updateContentSize(!0)), (this.state ===
|
|
4047
|
+
}), this.slide.isActive && this.slide.heavyAppended && !this.element.parentNode && (this.append(), this.slide.updateContentSize(!0)), (this.state === T.LOADED || this.state === T.ERROR) && this.removePlaceholder());
|
|
4041
4048
|
}
|
|
4042
4049
|
/**
|
|
4043
4050
|
* Content load error handler
|
|
4044
4051
|
*/
|
|
4045
4052
|
onError() {
|
|
4046
|
-
this.state =
|
|
4053
|
+
this.state = T.ERROR, this.slide && (this.displayError(), this.instance.dispatch("loadComplete", {
|
|
4047
4054
|
slide: this.slide,
|
|
4048
4055
|
isError: !0,
|
|
4049
4056
|
content: this
|
|
@@ -4056,13 +4063,13 @@ class ji {
|
|
|
4056
4063
|
* @returns {Boolean} If the content is currently loading
|
|
4057
4064
|
*/
|
|
4058
4065
|
isLoading() {
|
|
4059
|
-
return this.instance.applyFilters("isContentLoading", this.state ===
|
|
4066
|
+
return this.instance.applyFilters("isContentLoading", this.state === T.LOADING, this);
|
|
4060
4067
|
}
|
|
4061
4068
|
/**
|
|
4062
4069
|
* @returns {Boolean} If the content is in error state
|
|
4063
4070
|
*/
|
|
4064
4071
|
isError() {
|
|
4065
|
-
return this.state ===
|
|
4072
|
+
return this.state === T.ERROR;
|
|
4066
4073
|
}
|
|
4067
4074
|
/**
|
|
4068
4075
|
* @returns {boolean} If the content is image
|
|
@@ -4095,7 +4102,7 @@ class ji {
|
|
|
4095
4102
|
* @returns {boolean} If the content can be zoomed
|
|
4096
4103
|
*/
|
|
4097
4104
|
isZoomable() {
|
|
4098
|
-
return this.instance.applyFilters("isContentZoomable", this.isImageContent() && this.state !==
|
|
4105
|
+
return this.instance.applyFilters("isContentZoomable", this.isImageContent() && this.state !== T.ERROR, this);
|
|
4099
4106
|
}
|
|
4100
4107
|
/**
|
|
4101
4108
|
* Update image srcset sizes attribute based on width and height
|
|
@@ -4154,7 +4161,7 @@ class ji {
|
|
|
4154
4161
|
append() {
|
|
4155
4162
|
if (this.isAttached || !this.element)
|
|
4156
4163
|
return;
|
|
4157
|
-
if (this.isAttached = !0, this.state ===
|
|
4164
|
+
if (this.isAttached = !0, this.state === T.ERROR) {
|
|
4158
4165
|
this.displayError();
|
|
4159
4166
|
return;
|
|
4160
4167
|
}
|
|
@@ -4163,7 +4170,7 @@ class ji {
|
|
|
4163
4170
|
}).defaultPrevented)
|
|
4164
4171
|
return;
|
|
4165
4172
|
const t = "decode" in this.element;
|
|
4166
|
-
this.isImageContent() ? t && this.slide && (!this.slide.isActive ||
|
|
4173
|
+
this.isImageContent() ? t && this.slide && (!this.slide.isActive || Et()) ? (this.isDecoding = !0, this.element.decode().catch(() => {
|
|
4167
4174
|
}).finally(() => {
|
|
4168
4175
|
this.isDecoding = !1, this.appendImage();
|
|
4169
4176
|
})) : this.appendImage() : this.slide && !this.element.parentNode && this.slide.container.appendChild(this.element);
|
|
@@ -4176,7 +4183,7 @@ class ji {
|
|
|
4176
4183
|
activate() {
|
|
4177
4184
|
this.instance.dispatch("contentActivate", {
|
|
4178
4185
|
content: this
|
|
4179
|
-
}).defaultPrevented || !this.slide || (this.isImageContent() && this.isDecoding && !
|
|
4186
|
+
}).defaultPrevented || !this.slide || (this.isImageContent() && this.isDecoding && !Et() ? this.appendImage() : this.isError() && this.load(!1, !0), this.slide.holderElement && this.slide.holderElement.setAttribute("aria-hidden", "false"));
|
|
4180
4187
|
}
|
|
4181
4188
|
/**
|
|
4182
4189
|
* Deactivate the content
|
|
@@ -4200,10 +4207,10 @@ class ji {
|
|
|
4200
4207
|
appendImage() {
|
|
4201
4208
|
this.isAttached && (this.instance.dispatch("contentAppendImage", {
|
|
4202
4209
|
content: this
|
|
4203
|
-
}).defaultPrevented || (this.slide && this.element && !this.element.parentNode && this.slide.container.appendChild(this.element), (this.state ===
|
|
4210
|
+
}).defaultPrevented || (this.slide && this.element && !this.element.parentNode && this.slide.container.appendChild(this.element), (this.state === T.LOADED || this.state === T.ERROR) && this.removePlaceholder()));
|
|
4204
4211
|
}
|
|
4205
4212
|
}
|
|
4206
|
-
function
|
|
4213
|
+
function Ui(s, t) {
|
|
4207
4214
|
if (s.getViewportSizeFn) {
|
|
4208
4215
|
const e = s.getViewportSizeFn(s, t);
|
|
4209
4216
|
if (e)
|
|
@@ -4230,14 +4237,14 @@ function K(s, t, e, i, n) {
|
|
|
4230
4237
|
}
|
|
4231
4238
|
return Number(o) || 0;
|
|
4232
4239
|
}
|
|
4233
|
-
function
|
|
4240
|
+
function Ki(s, t, e, i) {
|
|
4234
4241
|
return {
|
|
4235
4242
|
x: t.x - K("left", s, t, e, i) - K("right", s, t, e, i),
|
|
4236
4243
|
y: t.y - K("top", s, t, e, i) - K("bottom", s, t, e, i)
|
|
4237
4244
|
};
|
|
4238
4245
|
}
|
|
4239
4246
|
const At = 4e3;
|
|
4240
|
-
class
|
|
4247
|
+
class Xi {
|
|
4241
4248
|
/**
|
|
4242
4249
|
* @param {PhotoSwipeOptions} options PhotoSwipe options
|
|
4243
4250
|
* @param {SlideData} itemData Slide data
|
|
@@ -4317,30 +4324,30 @@ class Ki {
|
|
|
4317
4324
|
return this._parseZoomLevelOption("max") || Math.max(1, this.fit * 4);
|
|
4318
4325
|
}
|
|
4319
4326
|
}
|
|
4320
|
-
function
|
|
4327
|
+
function Wt(s, t, e) {
|
|
4321
4328
|
const i = t.createContentFromData(s, e);
|
|
4322
4329
|
let n;
|
|
4323
4330
|
const {
|
|
4324
4331
|
options: o
|
|
4325
4332
|
} = t;
|
|
4326
4333
|
if (o) {
|
|
4327
|
-
n = new
|
|
4334
|
+
n = new Xi(o, s, -1);
|
|
4328
4335
|
let r;
|
|
4329
|
-
t.pswp ? r = t.pswp.viewportSize : r =
|
|
4330
|
-
const a =
|
|
4336
|
+
t.pswp ? r = t.pswp.viewportSize : r = Ui(o, t);
|
|
4337
|
+
const a = Ki(o, r, s, e);
|
|
4331
4338
|
n.update(i.width, i.height, a);
|
|
4332
4339
|
}
|
|
4333
4340
|
return i.lazyLoad(), n && i.setDisplayedSize(Math.ceil(i.width * n.initial), Math.ceil(i.height * n.initial)), i;
|
|
4334
4341
|
}
|
|
4335
|
-
function
|
|
4342
|
+
function Yi(s, t) {
|
|
4336
4343
|
const e = t.getItemData(s);
|
|
4337
4344
|
if (!t.dispatch("lazyLoadSlide", {
|
|
4338
4345
|
index: s,
|
|
4339
4346
|
itemData: e
|
|
4340
4347
|
}).defaultPrevented)
|
|
4341
|
-
return
|
|
4348
|
+
return Wt(e, t, s);
|
|
4342
4349
|
}
|
|
4343
|
-
class
|
|
4350
|
+
class Ji extends Vi {
|
|
4344
4351
|
/**
|
|
4345
4352
|
* Get total number of slides
|
|
4346
4353
|
*
|
|
@@ -4363,7 +4370,7 @@ class Yi extends Wi {
|
|
|
4363
4370
|
* @returns {Content}
|
|
4364
4371
|
*/
|
|
4365
4372
|
createContentFromData(t, e) {
|
|
4366
|
-
return new
|
|
4373
|
+
return new Gi(t, this, e);
|
|
4367
4374
|
}
|
|
4368
4375
|
/**
|
|
4369
4376
|
* Get item data by index.
|
|
@@ -4431,10 +4438,10 @@ class Yi extends Wi {
|
|
|
4431
4438
|
* @returns {Content} Image that is being decoded or false.
|
|
4432
4439
|
*/
|
|
4433
4440
|
lazyLoadData(t, e) {
|
|
4434
|
-
return
|
|
4441
|
+
return Wt(t, this, e);
|
|
4435
4442
|
}
|
|
4436
4443
|
}
|
|
4437
|
-
class
|
|
4444
|
+
class Qi extends Ji {
|
|
4438
4445
|
/**
|
|
4439
4446
|
* @param {PhotoSwipeOptions} [options]
|
|
4440
4447
|
*/
|
|
@@ -4454,7 +4461,7 @@ class Ji extends Yi {
|
|
|
4454
4461
|
* @param {MouseEvent} e
|
|
4455
4462
|
*/
|
|
4456
4463
|
onThumbnailsClick(t) {
|
|
4457
|
-
if (
|
|
4464
|
+
if (Ni(t) || window.pswp)
|
|
4458
4465
|
return;
|
|
4459
4466
|
let e = {
|
|
4460
4467
|
x: t.clientX,
|
|
@@ -4522,7 +4529,7 @@ class Ji extends Yi {
|
|
|
4522
4529
|
} = this;
|
|
4523
4530
|
e && (i.dataSource = e);
|
|
4524
4531
|
const n = [], o = typeof i.pswpModule;
|
|
4525
|
-
if (
|
|
4532
|
+
if (Hi(i.pswpModule))
|
|
4526
4533
|
n.push(Promise.resolve(
|
|
4527
4534
|
/** @type {Type<PhotoSwipe>} */
|
|
4528
4535
|
i.pswpModule
|
|
@@ -4538,7 +4545,7 @@ class Ji extends Yi {
|
|
|
4538
4545
|
else
|
|
4539
4546
|
throw new Error("pswpModule is not valid");
|
|
4540
4547
|
}
|
|
4541
|
-
typeof i.openPromise == "function" && n.push(i.openPromise()), i.preloadFirstSlide !== !1 && t >= 0 && (this._preloadedContent =
|
|
4548
|
+
typeof i.openPromise == "function" && n.push(i.openPromise()), i.preloadFirstSlide !== !1 && t >= 0 && (this._preloadedContent = Yi(t, this));
|
|
4542
4549
|
const r = ++this._uid;
|
|
4543
4550
|
Promise.all(n).then((a) => {
|
|
4544
4551
|
if (this.shouldOpen) {
|
|
@@ -4584,12 +4591,12 @@ class Ji extends Yi {
|
|
|
4584
4591
|
});
|
|
4585
4592
|
}
|
|
4586
4593
|
}
|
|
4587
|
-
const
|
|
4594
|
+
const ts = () => {
|
|
4588
4595
|
let s = null;
|
|
4589
|
-
return s = new
|
|
4596
|
+
return s = new Qi({
|
|
4590
4597
|
gallery: "#photoswipe-gallery",
|
|
4591
4598
|
children: "a",
|
|
4592
|
-
pswpModule:
|
|
4599
|
+
pswpModule: Zi,
|
|
4593
4600
|
zoom: !1,
|
|
4594
4601
|
imageClickAction: "next",
|
|
4595
4602
|
tapAction: "next"
|
|
@@ -4610,12 +4617,12 @@ const Qi = () => {
|
|
|
4610
4617
|
}), s.init(), () => {
|
|
4611
4618
|
s && (s.destroy(), s = null);
|
|
4612
4619
|
};
|
|
4613
|
-
},
|
|
4614
|
-
const s = document.querySelector(
|
|
4620
|
+
}, es = "mbrs-game-ranking", is = ".c-header-page__ranking-button", ss = () => {
|
|
4621
|
+
const s = document.querySelector(is), t = s?.querySelector("button");
|
|
4615
4622
|
!s || !t || t.addEventListener("click", () => {
|
|
4616
|
-
document.getElementById(
|
|
4623
|
+
document.getElementById(es)?.scrollIntoView({ behavior: "smooth" });
|
|
4617
4624
|
});
|
|
4618
|
-
},
|
|
4625
|
+
}, Ct = (s) => Math.min(100, Math.max(0, Math.round(s))), ns = () => {
|
|
4619
4626
|
const s = document.querySelector(".js-limit-scroll-progress-bar"), t = document.querySelector(".c-progress__bar"), e = document.querySelector(".c-btn__close-progress");
|
|
4620
4627
|
if (!t && !e)
|
|
4621
4628
|
return;
|
|
@@ -4624,14 +4631,14 @@ const Qi = () => {
|
|
|
4624
4631
|
let o = i.scrollHeight - i.clientHeight;
|
|
4625
4632
|
if (!o)
|
|
4626
4633
|
return;
|
|
4627
|
-
s && (o = s.scrollHeight - i.clientHeight + (window.pageYOffset + s.getBoundingClientRect().top)), t.style.width = `${
|
|
4634
|
+
s && (o = s.scrollHeight - i.clientHeight + (window.pageYOffset + s.getBoundingClientRect().top)), t.style.width = `${Ct(n / o * 100)}%`;
|
|
4628
4635
|
}
|
|
4629
4636
|
if (e) {
|
|
4630
4637
|
const o = document.querySelector(".js-content-header"), r = document.querySelector(".js-limit-scroll-close-article-btn");
|
|
4631
4638
|
if (o && r) {
|
|
4632
4639
|
const a = window.pageYOffset + o.getBoundingClientRect().bottom, c = window.pageYOffset + r.getBoundingClientRect().bottom - i.clientHeight - a;
|
|
4633
4640
|
if (c > 0) {
|
|
4634
|
-
const d =
|
|
4641
|
+
const d = Ct((n - a) / c * 100);
|
|
4635
4642
|
e.style.setProperty("--progress", `${d}`), e.parentElement?.classList.toggle(
|
|
4636
4643
|
"c-btn--close-progress-complete",
|
|
4637
4644
|
d >= 100
|
|
@@ -4639,10 +4646,10 @@ const Qi = () => {
|
|
|
4639
4646
|
}
|
|
4640
4647
|
}
|
|
4641
4648
|
}
|
|
4642
|
-
},
|
|
4649
|
+
}, os = () => {
|
|
4643
4650
|
const s = document.querySelector(".c-progress"), t = document.querySelector(".c-btn__close-progress");
|
|
4644
|
-
(s || t) && window.addEventListener("scroll",
|
|
4645
|
-
},
|
|
4651
|
+
(s || t) && window.addEventListener("scroll", ns);
|
|
4652
|
+
}, rs = (s = {}) => {
|
|
4646
4653
|
const { buttonSelector: t = ".c-scroll-to-top" } = s, e = document.querySelector(t), i = e?.querySelector("button");
|
|
4647
4654
|
if (!e || !i)
|
|
4648
4655
|
return;
|
|
@@ -4664,7 +4671,7 @@ const Qi = () => {
|
|
|
4664
4671
|
});
|
|
4665
4672
|
};
|
|
4666
4673
|
window.addEventListener("scroll", r), i.addEventListener("click", a), r();
|
|
4667
|
-
},
|
|
4674
|
+
}, as = 500, ls = () => {
|
|
4668
4675
|
const s = document.querySelector("#mbrs-comments-container"), t = document.querySelector(".c-scroll-to-top-comment");
|
|
4669
4676
|
if (!s || !t)
|
|
4670
4677
|
return;
|
|
@@ -4680,7 +4687,7 @@ const Qi = () => {
|
|
|
4680
4687
|
}, o = () => {
|
|
4681
4688
|
e && (e = !1, window.removeEventListener("scroll", i), t.style.display = "none");
|
|
4682
4689
|
}, r = (u) => {
|
|
4683
|
-
u.offsetHeight >
|
|
4690
|
+
u.offsetHeight > as ? n() : o();
|
|
4684
4691
|
}, a = (u) => {
|
|
4685
4692
|
new ResizeObserver(() => {
|
|
4686
4693
|
r(u);
|
|
@@ -4717,7 +4724,7 @@ const Qi = () => {
|
|
|
4717
4724
|
) && h.disconnect();
|
|
4718
4725
|
});
|
|
4719
4726
|
h.observe(s, { childList: !0, subtree: !0 });
|
|
4720
|
-
},
|
|
4727
|
+
}, cs = "#page-content", Vt = "#text-tooltip", ds = ".mbrs-social-report-container", jt = "c-text-tooltip--show", hs = [
|
|
4721
4728
|
"#page-content .c-content",
|
|
4722
4729
|
"#page-content .c-content p",
|
|
4723
4730
|
"#page-content .c-content h2",
|
|
@@ -4730,16 +4737,16 @@ const Qi = () => {
|
|
|
4730
4737
|
"#page-content header span",
|
|
4731
4738
|
"#page-content header h1",
|
|
4732
4739
|
"#page-content header h2"
|
|
4733
|
-
],
|
|
4734
|
-
const e =
|
|
4735
|
-
return
|
|
4736
|
-
},
|
|
4740
|
+
], xt = (s) => s instanceof Element ? s : s.parentElement, Pt = (s, t) => s ? t.some((e) => !!s.closest(e)) : !1, us = (s, t) => {
|
|
4741
|
+
const e = xt(s.startContainer), i = xt(s.endContainer);
|
|
4742
|
+
return Pt(e, t) || Pt(i, t);
|
|
4743
|
+
}, ps = (s) => {
|
|
4737
4744
|
if (!s.focusNode)
|
|
4738
4745
|
return null;
|
|
4739
4746
|
const t = s.anchorNode?.compareDocumentPosition(s.focusNode);
|
|
4740
4747
|
return t ? (t & 4) > 0 : s.anchorOffset < s.focusOffset;
|
|
4741
|
-
},
|
|
4742
|
-
const i = document.querySelector(
|
|
4748
|
+
}, ms = (s, t, e) => {
|
|
4749
|
+
const i = document.querySelector(Vt), n = document.querySelector(cs), o = document.querySelectorAll(ds);
|
|
4743
4750
|
if (!i || !n) {
|
|
4744
4751
|
console.warn("Text tooltip : Tooltip or page content are not found in the DOM");
|
|
4745
4752
|
return;
|
|
@@ -4757,11 +4764,11 @@ const Qi = () => {
|
|
|
4757
4764
|
i.style.top = `${Math.max(l, c)}px`, i.style.left = `${Math.min(
|
|
4758
4765
|
Math.max(l, d),
|
|
4759
4766
|
window.innerWidth - i.offsetWidth - l
|
|
4760
|
-
)}px`, i.classList.add(
|
|
4767
|
+
)}px`, i.classList.add(jt);
|
|
4761
4768
|
}, Q = () => {
|
|
4762
|
-
const s = document.querySelector(`${
|
|
4763
|
-
s && s.classList.remove(
|
|
4764
|
-
},
|
|
4769
|
+
const s = document.querySelector(`${Vt}`);
|
|
4770
|
+
s && s.classList.remove(jt);
|
|
4771
|
+
}, fs = () => {
|
|
4765
4772
|
const s = window.getSelection();
|
|
4766
4773
|
if (!s?.rangeCount) {
|
|
4767
4774
|
Q();
|
|
@@ -4769,8 +4776,8 @@ const Qi = () => {
|
|
|
4769
4776
|
}
|
|
4770
4777
|
const t = s.getRangeAt(0), e = s.toString().trim();
|
|
4771
4778
|
if (e.length) {
|
|
4772
|
-
const i =
|
|
4773
|
-
i &&
|
|
4779
|
+
const i = us(t, hs), n = ps(s) || !1;
|
|
4780
|
+
i && ms(t, n, e);
|
|
4774
4781
|
return;
|
|
4775
4782
|
}
|
|
4776
4783
|
Q();
|
|
@@ -4779,46 +4786,46 @@ const Qi = () => {
|
|
|
4779
4786
|
window.getSelection()?.toString().trim().length || Q();
|
|
4780
4787
|
return;
|
|
4781
4788
|
}
|
|
4782
|
-
|
|
4783
|
-
},
|
|
4789
|
+
fs();
|
|
4790
|
+
}, gs = () => {
|
|
4784
4791
|
if (!window?.getSelection) {
|
|
4785
4792
|
console.warn("Selection API isn't supported");
|
|
4786
4793
|
return;
|
|
4787
4794
|
}
|
|
4788
4795
|
document.addEventListener("mouseup", X), document.addEventListener("selectionchange", X), document.addEventListener("touchend", X), document.addEventListener("touchcancel", X);
|
|
4789
|
-
},
|
|
4790
|
-
let
|
|
4791
|
-
const
|
|
4796
|
+
}, vs = "[data-social-bar-action-row]", lt = 'button, a[href], [role="button"], [data-a11y-dialog-show], [data-a11y-dialog-hide], [data-event-name], .js-mobile-share-button';
|
|
4797
|
+
let Tt = !1;
|
|
4798
|
+
const Gt = (s) => {
|
|
4792
4799
|
s.querySelector(lt)?.click();
|
|
4793
|
-
},
|
|
4794
|
-
const t =
|
|
4800
|
+
}, Ut = (s) => s instanceof HTMLElement ? s.closest(vs) : null, ys = (s) => {
|
|
4801
|
+
const t = Ut(s.target);
|
|
4795
4802
|
if (!t)
|
|
4796
4803
|
return;
|
|
4797
4804
|
const i = s.target.closest(lt);
|
|
4798
|
-
i && i !== t ||
|
|
4799
|
-
},
|
|
4805
|
+
i && i !== t || Gt(t);
|
|
4806
|
+
}, _s = (s) => {
|
|
4800
4807
|
if (s.key !== "Enter" && s.key !== " ")
|
|
4801
4808
|
return;
|
|
4802
|
-
const t = s.target, e =
|
|
4809
|
+
const t = s.target, e = Ut(t);
|
|
4803
4810
|
if (!e || !(t instanceof HTMLElement))
|
|
4804
4811
|
return;
|
|
4805
4812
|
const i = t.closest(lt);
|
|
4806
|
-
i && i !== e || (s.key === " " && s.preventDefault(),
|
|
4807
|
-
},
|
|
4808
|
-
|
|
4809
|
-
},
|
|
4813
|
+
i && i !== e || (s.key === " " && s.preventDefault(), Gt(e));
|
|
4814
|
+
}, ws = () => {
|
|
4815
|
+
Tt || (document.addEventListener("click", ys), document.addEventListener("keydown", _s), Tt = !0);
|
|
4816
|
+
}, bs = (s) => {
|
|
4810
4817
|
const { target: t } = s;
|
|
4811
4818
|
if (t instanceof Element) {
|
|
4812
4819
|
const e = t.closest(".c-search-form--button");
|
|
4813
4820
|
e && (s.preventDefault(), e.classList.remove("c-search-form--button"));
|
|
4814
4821
|
}
|
|
4815
|
-
},
|
|
4822
|
+
}, Ss = (s = document.querySelector(
|
|
4816
4823
|
".c-search-form--button"
|
|
4817
4824
|
)) => {
|
|
4818
4825
|
s && s.addEventListener("click", (t) => {
|
|
4819
|
-
|
|
4826
|
+
bs(t);
|
|
4820
4827
|
});
|
|
4821
|
-
},
|
|
4828
|
+
}, Ls = ({
|
|
4822
4829
|
tabsContainerElement: s,
|
|
4823
4830
|
event: t
|
|
4824
4831
|
}) => {
|
|
@@ -4834,38 +4841,38 @@ const Vt = (s) => {
|
|
|
4834
4841
|
}), n.forEach((a) => {
|
|
4835
4842
|
a.setAttribute("aria-hidden", "true");
|
|
4836
4843
|
}), e.setAttribute("aria-selected", "true"), r && r.removeAttribute("aria-hidden");
|
|
4837
|
-
}, It = (s) => s.code === "ArrowLeft" || s.keyCode === 39,
|
|
4844
|
+
}, It = (s) => s.code === "ArrowLeft" || s.keyCode === 39, Mt = (s) => s.code === "ArrowRight" || s.keyCode === 37, Es = (s = document.querySelectorAll(
|
|
4838
4845
|
".js-tabs"
|
|
4839
4846
|
)) => {
|
|
4840
4847
|
s.length > 0 && s.forEach((t) => {
|
|
4841
4848
|
const e = t.querySelectorAll('[role="tab"]');
|
|
4842
4849
|
e.forEach((n) => {
|
|
4843
4850
|
n.addEventListener("click", (o) => {
|
|
4844
|
-
|
|
4851
|
+
Ls({ tabsContainerElement: t, event: o });
|
|
4845
4852
|
});
|
|
4846
4853
|
});
|
|
4847
4854
|
const i = t.querySelector('[role="tablist"]');
|
|
4848
4855
|
if (i && e.length > 0) {
|
|
4849
4856
|
let n = 0;
|
|
4850
4857
|
i.addEventListener("keydown", (o) => {
|
|
4851
|
-
o instanceof KeyboardEvent && (It(o) ||
|
|
4858
|
+
o instanceof KeyboardEvent && (It(o) || Mt(o)) && (e[n].setAttribute("tabindex", "-1"), It(o) ? (n += 1, n >= e.length && (n = 0)) : Mt(o) && (n -= 1, n < 0 && (n = e.length - 1)), e[n].setAttribute("tabindex", "0"), e[n].focus());
|
|
4852
4859
|
});
|
|
4853
4860
|
}
|
|
4854
4861
|
});
|
|
4855
4862
|
}, tt = (s) => {
|
|
4856
4863
|
const [t, e] = s.split("h").map(Number);
|
|
4857
4864
|
return t * 60 + e;
|
|
4858
|
-
},
|
|
4865
|
+
}, Kt = () => {
|
|
4859
4866
|
const s = /* @__PURE__ */ new Date(), t = s.getHours(), e = s.getMinutes();
|
|
4860
4867
|
return t * 60 + e;
|
|
4861
4868
|
}, As = (s, t) => {
|
|
4862
|
-
const e =
|
|
4869
|
+
const e = Kt();
|
|
4863
4870
|
if (e < s || e > t)
|
|
4864
4871
|
return 0;
|
|
4865
4872
|
const i = t - s;
|
|
4866
4873
|
return (e - s) / i;
|
|
4867
|
-
},
|
|
4868
|
-
const t =
|
|
4874
|
+
}, Cs = (s) => {
|
|
4875
|
+
const t = Kt();
|
|
4869
4876
|
let e = null, i = null, n = -1;
|
|
4870
4877
|
return Array.from(s).find((o, r, a) => {
|
|
4871
4878
|
if (r === a.length - 1)
|
|
@@ -4876,11 +4883,11 @@ const Vt = (s) => {
|
|
|
4876
4883
|
const d = tt(l), h = tt(c);
|
|
4877
4884
|
return t >= d && t < h ? (e = l, i = c, n = r, !0) : !1;
|
|
4878
4885
|
}), { currentIntervalStartTime: e, currentIntervalEndTime: i, currentIntervalIndex: n };
|
|
4879
|
-
},
|
|
4886
|
+
}, xs = () => {
|
|
4880
4887
|
const s = document.querySelectorAll(".c-timeline__time");
|
|
4881
4888
|
if (!s || s.length < 2)
|
|
4882
4889
|
return;
|
|
4883
|
-
const t = document.querySelector(".c-timeline__progress-bar"), { currentIntervalStartTime: e, currentIntervalEndTime: i, currentIntervalIndex: n } =
|
|
4890
|
+
const t = document.querySelector(".c-timeline__progress-bar"), { currentIntervalStartTime: e, currentIntervalEndTime: i, currentIntervalIndex: n } = Cs(s);
|
|
4884
4891
|
if (!e || !i)
|
|
4885
4892
|
return;
|
|
4886
4893
|
const o = tt(e), r = tt(i), a = As(o, r);
|
|
@@ -4922,15 +4929,15 @@ const Vt = (s) => {
|
|
|
4922
4929
|
}
|
|
4923
4930
|
}
|
|
4924
4931
|
}
|
|
4925
|
-
}, ot = "c-icon-item__container--is-highlighted",
|
|
4932
|
+
}, ot = "c-icon-item__container--is-highlighted", Ps = (s) => {
|
|
4926
4933
|
s.find(
|
|
4927
4934
|
(e) => e.classList.contains(ot)
|
|
4928
4935
|
)?.classList.remove(ot);
|
|
4929
|
-
},
|
|
4936
|
+
}, Ts = () => {
|
|
4930
4937
|
const s = document.querySelector(".c-toolbar");
|
|
4931
4938
|
if (s) {
|
|
4932
4939
|
const t = window.location.origin + window.location.pathname, e = Array.from(s.querySelectorAll(".c-icon-item__container"));
|
|
4933
|
-
|
|
4940
|
+
Ps(e), e.find(
|
|
4934
4941
|
(n) => n.querySelector("a")?.getAttribute("href") === t
|
|
4935
4942
|
)?.classList.add(ot);
|
|
4936
4943
|
}
|
|
@@ -4964,10 +4971,10 @@ const Vt = (s) => {
|
|
|
4964
4971
|
"transform",
|
|
4965
4972
|
`translate(${f + p / 2}, ${m + y / 2})${C}`
|
|
4966
4973
|
);
|
|
4967
|
-
const g = d.getBBox(), _ = 8,
|
|
4974
|
+
const g = d.getBBox(), _ = 8, E = 4, B = 8, L = g.width + _, b = g.height + E;
|
|
4968
4975
|
h.setAttribute("width", `${L}`), h.setAttribute("height", `${b}`), h.setAttribute("x", `${-L / 2}`), h.setAttribute("y", `${-b - B}`);
|
|
4969
|
-
const
|
|
4970
|
-
d.setAttribute("y", `${
|
|
4976
|
+
const A = -b / 2 - B;
|
|
4977
|
+
d.setAttribute("y", `${A}`), l.setAttribute("aria-hidden", "false");
|
|
4971
4978
|
} else
|
|
4972
4979
|
a = !1;
|
|
4973
4980
|
}), !a && r < Is && requestAnimationFrame(() => o(r + 1));
|
|
@@ -4982,7 +4989,7 @@ const Vt = (s) => {
|
|
|
4982
4989
|
childList: !0,
|
|
4983
4990
|
subtree: !0
|
|
4984
4991
|
});
|
|
4985
|
-
},
|
|
4992
|
+
}, Ms = {
|
|
4986
4993
|
10: [{ id: "10387", name: "Troyes" }, { id: "10323", name: "Romilly-sur-Seine" }, { id: "10033", name: "Bar-sur-Aube" }],
|
|
4987
4994
|
11: [{ id: "11262", name: "Narbonne" }, { id: "11069", name: "Carcassonne" }, { id: "11076", name: "Castelnaudary" }],
|
|
4988
4995
|
12: [{ id: "12202", name: "Rodez" }, { id: "12145", name: "Millau" }, { id: "12300", name: "Villefranche-de-Rouergue" }],
|
|
@@ -5083,14 +5090,14 @@ const Vt = (s) => {
|
|
|
5083
5090
|
"07": [{ id: "07010", name: "Annonay" }, { id: "07019", name: "Aubenas" }, { id: "07324", name: "Tournon-sur-Rhône" }],
|
|
5084
5091
|
"05": [{ id: "05061", name: "Gap" }, { id: "05023", name: "Briançon" }, { id: "05046", name: "Embrun" }],
|
|
5085
5092
|
"08": [{ id: "08105", name: "Charleville-Mézières" }, { id: "08362", name: "Rethel" }, { id: "08190", name: "Givet" }]
|
|
5086
|
-
},
|
|
5093
|
+
}, zs = /<path\b([^>]*?)\/>/g, Os = /\b([:\w-]+)="([^"]*)"/g, Ds = (s) => {
|
|
5087
5094
|
const t = [];
|
|
5088
|
-
for (const e of s.matchAll(
|
|
5095
|
+
for (const e of s.matchAll(zs)) {
|
|
5089
5096
|
const i = e[1];
|
|
5090
5097
|
if (!i)
|
|
5091
5098
|
continue;
|
|
5092
5099
|
const n = /* @__PURE__ */ new Map();
|
|
5093
|
-
for (const c of i.matchAll(
|
|
5100
|
+
for (const c of i.matchAll(Os)) {
|
|
5094
5101
|
const [, d, h] = c;
|
|
5095
5102
|
d && n.set(d, h || "");
|
|
5096
5103
|
}
|
|
@@ -5103,11 +5110,11 @@ const Vt = (s) => {
|
|
|
5103
5110
|
});
|
|
5104
5111
|
}
|
|
5105
5112
|
return t;
|
|
5106
|
-
},
|
|
5107
|
-
var
|
|
5113
|
+
}, Rs = (s) => new Map(s.map((t) => [t.id, t]));
|
|
5114
|
+
var Xt = /* @__PURE__ */ ((s) => (s.MOBILE = "mobile", s.DESKTOP = "desktop", s))(Xt || {});
|
|
5108
5115
|
const Y = (s) => {
|
|
5109
5116
|
window.location.href = s;
|
|
5110
|
-
},
|
|
5117
|
+
}, $s = (s, t, e) => {
|
|
5111
5118
|
const i = e.get(s);
|
|
5112
5119
|
if (i)
|
|
5113
5120
|
return i;
|
|
@@ -5122,7 +5129,7 @@ const Y = (s) => {
|
|
|
5122
5129
|
(o) => o.id.startsWith(`town-${s}`)
|
|
5123
5130
|
);
|
|
5124
5131
|
return e.set(s, n), n;
|
|
5125
|
-
},
|
|
5132
|
+
}, Bs = (s, t) => t.get(s), Fs = (s) => {
|
|
5126
5133
|
if (s.size > 0)
|
|
5127
5134
|
return;
|
|
5128
5135
|
document.querySelectorAll(
|
|
@@ -5134,13 +5141,13 @@ const Y = (s) => {
|
|
|
5134
5141
|
Array.from(e.classList).filter((n) => n.startsWith("c-map-towns__path--"))
|
|
5135
5142
|
);
|
|
5136
5143
|
});
|
|
5137
|
-
},
|
|
5144
|
+
}, ks = (s, t) => {
|
|
5138
5145
|
const e = s.id, i = s.url, n = s.name;
|
|
5139
5146
|
if (!e || !i)
|
|
5140
5147
|
return null;
|
|
5141
5148
|
const o = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
5142
5149
|
o.setAttribute("d", s.path), o.setAttribute("class", "c-map-towns__path c-map-towns__zoom-town"), o.setAttribute("data-url", i);
|
|
5143
|
-
const r =
|
|
5150
|
+
const r = Bs(e, t);
|
|
5144
5151
|
if (r && r.forEach((a) => {
|
|
5145
5152
|
o.classList.add(a);
|
|
5146
5153
|
}), n) {
|
|
@@ -5148,15 +5155,15 @@ const Y = (s) => {
|
|
|
5148
5155
|
a.textContent = n, o.appendChild(a);
|
|
5149
5156
|
}
|
|
5150
5157
|
return o;
|
|
5151
|
-
},
|
|
5158
|
+
}, Zs = (s, t) => {
|
|
5152
5159
|
const e = document.createDocumentFragment();
|
|
5153
5160
|
return s.forEach((i) => {
|
|
5154
|
-
const n =
|
|
5161
|
+
const n = ks(i, t);
|
|
5155
5162
|
n && e.appendChild(n);
|
|
5156
5163
|
}), e;
|
|
5157
|
-
},
|
|
5164
|
+
}, qs = (s, t) => {
|
|
5158
5165
|
s.replaceChildren(t);
|
|
5159
|
-
},
|
|
5166
|
+
}, Ns = (s, t, e) => {
|
|
5160
5167
|
const i = document.createElementNS("http://www.w3.org/2000/svg", "g");
|
|
5161
5168
|
i.setAttribute("class", "js-city-marker c-map-towns__city-marker"), i.setAttribute("aria-hidden", "true"), i.setAttribute("data-scale", e.toString());
|
|
5162
5169
|
const n = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
@@ -5167,7 +5174,7 @@ const Y = (s) => {
|
|
|
5167
5174
|
r.setAttribute("class", "js-city-bg"), r.setAttribute("fill", "white"), r.setAttribute("rx", "4"), r.setAttribute("ry", "4");
|
|
5168
5175
|
const a = document.createElementNS("http://www.w3.org/2000/svg", "text");
|
|
5169
5176
|
return a.setAttribute("class", "js-city-text c-map-towns__city-text"), a.textContent = s, i.appendChild(n), i.appendChild(o), i.appendChild(r), i.appendChild(a), i;
|
|
5170
|
-
},
|
|
5177
|
+
}, Hs = (s, t) => {
|
|
5171
5178
|
const e = t.getBBox(), i = 5, n = e.width + i * 2, o = e.height + i * 2;
|
|
5172
5179
|
s.setAttribute(
|
|
5173
5180
|
"viewBox",
|
|
@@ -5181,18 +5188,18 @@ const rt = () => {
|
|
|
5181
5188
|
if (et)
|
|
5182
5189
|
return;
|
|
5183
5190
|
if (!document.querySelector(".c-map-towns")) {
|
|
5184
|
-
new MutationObserver((b,
|
|
5185
|
-
typeof document < "u" && document.querySelector(".c-map-towns") && (
|
|
5191
|
+
new MutationObserver((b, A) => {
|
|
5192
|
+
typeof document < "u" && document.querySelector(".c-map-towns") && (A.disconnect(), rt());
|
|
5186
5193
|
}).observe(document.body, { childList: !0, subtree: !0 });
|
|
5187
5194
|
return;
|
|
5188
5195
|
}
|
|
5189
|
-
const t = window.layout ===
|
|
5196
|
+
const t = window.layout === Xt.MOBILE, e = document.querySelector(".c-map-towns__map"), i = document.querySelector(".c-map-towns__droms"), n = document.querySelector(".c-map-towns__zooms"), o = (L) => {
|
|
5190
5197
|
const { target: b } = L;
|
|
5191
5198
|
if (!(b instanceof Element))
|
|
5192
5199
|
return;
|
|
5193
|
-
const
|
|
5194
|
-
if (
|
|
5195
|
-
const R =
|
|
5200
|
+
const A = b.closest(".js-city-marker");
|
|
5201
|
+
if (A) {
|
|
5202
|
+
const R = A.getAttribute("data-url");
|
|
5196
5203
|
R && Y(R);
|
|
5197
5204
|
return;
|
|
5198
5205
|
}
|
|
@@ -5220,19 +5227,19 @@ const rt = () => {
|
|
|
5220
5227
|
if (p)
|
|
5221
5228
|
return p;
|
|
5222
5229
|
const L = u instanceof HTMLScriptElement ? JSON.parse(u.textContent || '""') : "";
|
|
5223
|
-
return p = Ds(
|
|
5230
|
+
return p = Rs(Ds(L)), p;
|
|
5224
5231
|
}, w = () => {
|
|
5225
5232
|
r.setAttribute("aria-hidden", "true"), l.replaceChildren();
|
|
5226
5233
|
}, C = (L, b) => L.startsWith("97") ? document.querySelector(`path[id="town-${b}-drom"]`)?.getAttribute("d") || null : y().get(`town-${b}`)?.path || null, g = (L, b) => {
|
|
5227
|
-
const
|
|
5228
|
-
if (
|
|
5234
|
+
const I = Ms[L] || [];
|
|
5235
|
+
if (I.length === 0)
|
|
5229
5236
|
return;
|
|
5230
5237
|
const M = document.createDocumentFragment();
|
|
5231
|
-
|
|
5238
|
+
I.forEach((F) => {
|
|
5232
5239
|
const z = C(L, F.id);
|
|
5233
5240
|
if (!z)
|
|
5234
5241
|
return;
|
|
5235
|
-
const R =
|
|
5242
|
+
const R = Ns(F.name, z, b);
|
|
5236
5243
|
M.appendChild(R);
|
|
5237
5244
|
}), l.appendChild(M), requestAnimationFrame(() => {
|
|
5238
5245
|
ct(l);
|
|
@@ -5241,37 +5248,37 @@ const rt = () => {
|
|
|
5241
5248
|
const { target: b } = L;
|
|
5242
5249
|
if (!(b instanceof Element))
|
|
5243
5250
|
return;
|
|
5244
|
-
const
|
|
5245
|
-
if (!
|
|
5251
|
+
const A = b?.closest(".c-map-towns__dept-trigger");
|
|
5252
|
+
if (!A)
|
|
5246
5253
|
return;
|
|
5247
|
-
const
|
|
5248
|
-
|
|
5249
|
-
const z =
|
|
5250
|
-
if (d && h && M && (d.textContent = M, h.textContent = `Carte détaillée du département : ${M}`), !(
|
|
5254
|
+
const I = A.getAttribute("id")?.replace("out-", "") || "", M = A.getAttribute("data-name"), F = $s(I, y, f);
|
|
5255
|
+
Fs(m);
|
|
5256
|
+
const z = Zs(F, m);
|
|
5257
|
+
if (d && h && M && (d.textContent = M, h.textContent = `Carte détaillée du département : ${M}`), !(A instanceof SVGGraphicsElement))
|
|
5251
5258
|
return;
|
|
5252
|
-
const R =
|
|
5253
|
-
r.setAttribute("aria-hidden", "false"),
|
|
5254
|
-
},
|
|
5259
|
+
const R = Hs(a, A);
|
|
5260
|
+
r.setAttribute("aria-hidden", "false"), qs(l, z), g(I, R);
|
|
5261
|
+
}, E = (L) => {
|
|
5255
5262
|
const { target: b } = L;
|
|
5256
5263
|
if (!(b instanceof Element))
|
|
5257
5264
|
return;
|
|
5258
|
-
const
|
|
5259
|
-
|
|
5265
|
+
const I = b.closest(".c-map-towns__zoom-town")?.getAttribute("data-url");
|
|
5266
|
+
I && Y(I);
|
|
5260
5267
|
};
|
|
5261
|
-
e?.addEventListener("click", _), i?.addEventListener("click", _), l.addEventListener("click",
|
|
5268
|
+
e?.addEventListener("click", _), i?.addEventListener("click", _), l.addEventListener("click", E), c.addEventListener("click", () => {
|
|
5262
5269
|
w();
|
|
5263
5270
|
}), r.addEventListener("click", (L) => {
|
|
5264
5271
|
L.target === r && w();
|
|
5265
5272
|
});
|
|
5266
|
-
},
|
|
5267
|
-
|
|
5273
|
+
}, Xs = () => {
|
|
5274
|
+
we(), Es(), oe(), Ot(), fe(), os(), ts(), ze(), Ss(), ws(), le(), gs(), be(), Se(), Ee(), he(), se(
|
|
5268
5275
|
"localisation-input",
|
|
5269
5276
|
"https://www.20minutes.fr/elections/resultats/recherche",
|
|
5270
5277
|
"?searchValue=",
|
|
5271
5278
|
"text",
|
|
5272
5279
|
"text"
|
|
5273
|
-
),
|
|
5280
|
+
), de(), ct(), Ts(), te(), ee(), Ae(), rt(), Fe(), ke(), Le(), Qt(), xs(), rs(), ls(), ss();
|
|
5274
5281
|
};
|
|
5275
5282
|
export {
|
|
5276
|
-
|
|
5283
|
+
Xs as initScripts
|
|
5277
5284
|
};
|