@20minutes/hela 2.21.10 → 2.21.11
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/countdown.d.ts +1 -2
- package/dist/components/atoms/Tag/Tag.d.ts +1 -1
- package/dist/components/molecules/Countdown/Countdown.d.ts +2 -1
- package/dist/index.es.js +31 -17
- package/dist/index.umd.cjs +1 -1
- package/dist/js/scripts.es.js +316 -309
- 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/dist/types/Window.d.ts +0 -7
- package/package.json +1 -1
package/dist/js/scripts.es.js
CHANGED
|
@@ -115,36 +115,43 @@ const Vt = () => /Android/i.test(navigator.userAgent), jt = typeof window < "u"
|
|
|
115
115
|
Jt(i);
|
|
116
116
|
});
|
|
117
117
|
});
|
|
118
|
-
},
|
|
119
|
-
const e =
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
118
|
+
}, te = "[data-countdown][data-countdown-end-date]", ee = (s) => {
|
|
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
|
+
return !t || !e || !i || !n ? null : {
|
|
121
|
+
daysElement: t,
|
|
122
|
+
hoursElement: e,
|
|
123
|
+
minutesElement: i,
|
|
124
|
+
secondsElement: n
|
|
125
|
+
};
|
|
126
|
+
}, dt = (s, t) => {
|
|
127
|
+
const e = s - Date.now();
|
|
128
|
+
if (e <= 0)
|
|
129
|
+
return !1;
|
|
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
|
+
return t.daysElement.textContent = i.toString(), t.hoursElement.textContent = n.toString(), t.minutesElement.textContent = o.toString(), t.secondsElement.textContent = r.toString(), !0;
|
|
132
|
+
}, ie = () => {
|
|
133
|
+
document.querySelectorAll(te).forEach((t) => {
|
|
134
|
+
const e = t.dataset.countdownEndDate, i = e ? new Date(e).getTime() : Number.NaN, n = ee(t);
|
|
135
|
+
if (!n)
|
|
125
136
|
return;
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
else {
|
|
137
|
-
const u = Math.floor(h / 864e5), f = Math.floor(h % (1e3 * 60 * 60 * 24) / (1e3 * 60 * 60)), m = Math.floor(h % (1e3 * 60 * 60) / (1e3 * 60)), p = Math.floor(h % (1e3 * 60) / 1e3);
|
|
138
|
-
i.innerHTML = u.toString(), n.innerHTML = f.toString(), o.innerHTML = m.toString(), r.innerHTML = p.toString();
|
|
139
|
-
}
|
|
137
|
+
if (Number.isNaN(i)) {
|
|
138
|
+
t.remove();
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
if (!dt(i, n)) {
|
|
142
|
+
t.remove();
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
const o = setInterval(() => {
|
|
146
|
+
dt(i, n) || (clearInterval(o), t.remove());
|
|
140
147
|
}, 1e3);
|
|
141
|
-
}
|
|
142
|
-
},
|
|
148
|
+
});
|
|
149
|
+
}, se = (s) => {
|
|
143
150
|
const t = s.getBBox(), e = t.width / 20;
|
|
144
151
|
return [t.x - e, t.y - e, t.width + e * 2, t.height + e * 2].join(
|
|
145
152
|
" "
|
|
146
153
|
);
|
|
147
|
-
},
|
|
154
|
+
}, ne = () => {
|
|
148
155
|
const s = document.querySelector(".c-map-districts-container"), t = document.querySelector(".c-map-districts");
|
|
149
156
|
if (!s || !t)
|
|
150
157
|
return;
|
|
@@ -195,7 +202,7 @@ const Vt = () => /Android/i.test(navigator.userAgent), jt = typeof window < "u"
|
|
|
195
202
|
);
|
|
196
203
|
d(
|
|
197
204
|
y || p,
|
|
198
|
-
|
|
205
|
+
se(y || p)
|
|
199
206
|
);
|
|
200
207
|
}
|
|
201
208
|
}, u = () => {
|
|
@@ -204,7 +211,7 @@ const Vt = () => /Android/i.test(navigator.userAgent), jt = typeof window < "u"
|
|
|
204
211
|
t.addEventListener("click", u), n && n.addEventListener("click", u), document.querySelectorAll(".c-map-districts__zoomable").forEach((m) => {
|
|
205
212
|
m.addEventListener("click", (p) => h(p));
|
|
206
213
|
});
|
|
207
|
-
},
|
|
214
|
+
}, oe = () => {
|
|
208
215
|
const s = document.getElementById("elections-form-search"), t = document.querySelector(".c-search-form__autocomplete");
|
|
209
216
|
if (!s || !t)
|
|
210
217
|
return;
|
|
@@ -232,59 +239,59 @@ const Vt = () => /Android/i.test(navigator.userAgent), jt = typeof window < "u"
|
|
|
232
239
|
}), s.addEventListener("focusin", () => {
|
|
233
240
|
t.childElementCount > 0 && t.classList.remove("u-hidden");
|
|
234
241
|
});
|
|
235
|
-
},
|
|
242
|
+
}, re = (s, t) => {
|
|
236
243
|
s.setAttribute("aria-expanded", "true"), s.parentNode?.querySelectorAll(".js-ellipsis-target")?.forEach((n) => {
|
|
237
244
|
n.classList.remove(t);
|
|
238
245
|
});
|
|
239
246
|
const i = s.querySelector(".js-ellipsis-button__label");
|
|
240
247
|
i instanceof HTMLSpanElement && (i.innerHTML = "Voir moins");
|
|
241
|
-
},
|
|
248
|
+
}, ae = (s, t) => {
|
|
242
249
|
s.parentNode?.querySelectorAll(".js-ellipsis-target")?.forEach((n) => {
|
|
243
250
|
n.classList.add(t);
|
|
244
251
|
}), s.setAttribute("aria-expanded", "false");
|
|
245
252
|
const i = s.querySelector(".js-ellipsis-button__label");
|
|
246
253
|
i instanceof HTMLSpanElement && (i.innerHTML = "Voir plus");
|
|
247
|
-
},
|
|
254
|
+
}, le = (s, t) => {
|
|
248
255
|
const e = s.currentTarget;
|
|
249
256
|
if (s.preventDefault(), e instanceof HTMLButtonElement) {
|
|
250
257
|
const i = t ? "u-ellipsis-multiline" : "u-ellipsis";
|
|
251
|
-
return e.getAttribute("aria-expanded") === "true" ?
|
|
258
|
+
return e.getAttribute("aria-expanded") === "true" ? ae(e, i) : re(e, i);
|
|
252
259
|
}
|
|
253
260
|
return null;
|
|
254
|
-
},
|
|
261
|
+
}, ce = (s = document.querySelector(
|
|
255
262
|
".js-ellipsis-button"
|
|
256
263
|
)) => {
|
|
257
264
|
s && document.querySelectorAll(".js-ellipsis-button").forEach((e) => {
|
|
258
265
|
const i = e.getAttribute("data-multiple") === "true";
|
|
259
|
-
e.addEventListener("click", (n) =>
|
|
266
|
+
e.addEventListener("click", (n) => le(n, i));
|
|
260
267
|
});
|
|
261
|
-
},
|
|
268
|
+
}, de = (s) => {
|
|
262
269
|
s.setAttribute("aria-expanded", "true"), s.parentNode?.querySelectorAll(".js-expand-target")?.forEach((i) => {
|
|
263
270
|
i.setAttribute("aria-hidden", "false");
|
|
264
271
|
});
|
|
265
272
|
const e = s.querySelector(".js-expand-button__label");
|
|
266
273
|
e instanceof HTMLSpanElement && (e.innerHTML = "Voir moins");
|
|
267
|
-
},
|
|
274
|
+
}, he = (s) => {
|
|
268
275
|
s.parentNode?.querySelectorAll(".js-expand-target")?.forEach((i) => {
|
|
269
276
|
i.setAttribute("aria-hidden", "true");
|
|
270
277
|
}), s.setAttribute("aria-expanded", "false");
|
|
271
278
|
const e = s.querySelector(".js-expand-button__label");
|
|
272
279
|
e instanceof HTMLSpanElement && (e.innerHTML = "Voir plus");
|
|
273
|
-
},
|
|
280
|
+
}, ue = (s) => {
|
|
274
281
|
const t = s.currentTarget;
|
|
275
|
-
return s.preventDefault(), t instanceof HTMLButtonElement ? t.getAttribute("aria-expanded") === "true" ?
|
|
276
|
-
},
|
|
282
|
+
return s.preventDefault(), t instanceof HTMLButtonElement ? t.getAttribute("aria-expanded") === "true" ? he(t) : de(t) : null;
|
|
283
|
+
}, pe = (s) => {
|
|
277
284
|
const t = s.parentNode?.querySelector(".js-expand-target");
|
|
278
285
|
return !t || t.classList.contains("c-elections-result__members") ? !1 : (t.textContent?.trim().length ?? 0) < 255;
|
|
279
|
-
},
|
|
286
|
+
}, me = (s = document.querySelector(
|
|
280
287
|
".js-expand-button"
|
|
281
288
|
)) => {
|
|
282
289
|
s && document.querySelectorAll(".js-expand-button").forEach((e) => {
|
|
283
|
-
|
|
290
|
+
pe(e) ? (e.style.display = "none", e.parentNode?.querySelectorAll(".js-expand-target")?.forEach((n) => {
|
|
284
291
|
n.setAttribute("aria-hidden", "false");
|
|
285
|
-
})) : e.addEventListener("click",
|
|
292
|
+
})) : e.addEventListener("click", ue);
|
|
286
293
|
});
|
|
287
|
-
},
|
|
294
|
+
}, Tt = (s, t) => {
|
|
288
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;
|
|
289
296
|
if (e && i && n) {
|
|
290
297
|
const a = new IntersectionObserver(
|
|
@@ -298,10 +305,10 @@ const Vt = () => /Android/i.test(navigator.userAgent), jt = typeof window < "u"
|
|
|
298
305
|
);
|
|
299
306
|
a.observe(e), a.observe(i);
|
|
300
307
|
}
|
|
301
|
-
},
|
|
308
|
+
}, fe = () => Tt(".js-close-article-btn", ".js-limit-scroll-close-article-btn"), ge = () => Tt(".js-chatbot-btn", ".js-limit-scroll-chatbot-btn"), ve = () => {
|
|
302
309
|
const s = document.querySelector(".js-game-alert");
|
|
303
310
|
jt && s && s.classList.remove("u-hidden");
|
|
304
|
-
},
|
|
311
|
+
}, ye = () => {
|
|
305
312
|
const s = document.querySelectorAll(".js-half-donut-result");
|
|
306
313
|
for (const t of Array.from(s)) {
|
|
307
314
|
const e = t.querySelector(".c-half-donut"), i = t.querySelector(".c-legend");
|
|
@@ -320,7 +327,7 @@ const Vt = () => /Android/i.test(navigator.userAgent), jt = typeof window < "u"
|
|
|
320
327
|
});
|
|
321
328
|
});
|
|
322
329
|
}
|
|
323
|
-
},
|
|
330
|
+
}, _e = () => {
|
|
324
331
|
const s = document.querySelector(".c-image-slider__container");
|
|
325
332
|
if (!s)
|
|
326
333
|
return () => {
|
|
@@ -384,19 +391,19 @@ const Vt = () => /Android/i.test(navigator.userAgent), jt = typeof window < "u"
|
|
|
384
391
|
}), c(!0), h(), () => {
|
|
385
392
|
u();
|
|
386
393
|
};
|
|
387
|
-
},
|
|
394
|
+
}, we = (s) => {
|
|
388
395
|
s.stopImmediatePropagation(), s.preventDefault();
|
|
389
396
|
const t = s.currentTarget, e = document.getElementById("info-button-content");
|
|
390
397
|
!(t instanceof HTMLButtonElement) || !e || (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")));
|
|
391
|
-
},
|
|
398
|
+
}, be = () => {
|
|
392
399
|
const s = document.querySelector(".js-info-banner__button");
|
|
393
|
-
s instanceof HTMLButtonElement && s.addEventListener("click",
|
|
400
|
+
s instanceof HTMLButtonElement && s.addEventListener("click", we);
|
|
394
401
|
}, v = {
|
|
395
402
|
inert: ":not([inert]):not([inert] *)",
|
|
396
403
|
negTabIndex: ':not([tabindex^="-"])',
|
|
397
404
|
disabled: ":not(:disabled)"
|
|
398
405
|
};
|
|
399
|
-
var
|
|
406
|
+
var Se = [
|
|
400
407
|
`a[href]${v.inert}${v.negTabIndex}`,
|
|
401
408
|
`area[href]${v.inert}${v.negTabIndex}`,
|
|
402
409
|
`input:not([type="hidden"]):not([type="radio"])${v.inert}${v.negTabIndex}${v.disabled}`,
|
|
@@ -417,14 +424,14 @@ var _e = [
|
|
|
417
424
|
function ht(s) {
|
|
418
425
|
(s.querySelector("[autofocus]") || s).focus();
|
|
419
426
|
}
|
|
420
|
-
function
|
|
427
|
+
function Le(s) {
|
|
421
428
|
const t = W(s, !0), e = t ? W(s, !1) || t : null;
|
|
422
429
|
return [t, e];
|
|
423
430
|
}
|
|
424
431
|
function W(s, t) {
|
|
425
432
|
if (t && mt(s))
|
|
426
433
|
return s;
|
|
427
|
-
if (
|
|
434
|
+
if (Ee(s))
|
|
428
435
|
if (s.shadowRoot) {
|
|
429
436
|
let e = ut(s.shadowRoot, t);
|
|
430
437
|
for (; e; ) {
|
|
@@ -460,16 +467,16 @@ function ut(s, t) {
|
|
|
460
467
|
function pt(s, t) {
|
|
461
468
|
return t ? s.nextElementSibling : s.previousElementSibling;
|
|
462
469
|
}
|
|
463
|
-
const
|
|
464
|
-
function
|
|
470
|
+
const Ae = (s) => s.matches("details:not([open]) *") && !s.matches("details>summary:first-of-type") ? !0 : !(s.offsetWidth || s.offsetHeight || s.getClientRects().length), mt = (s) => s.shadowRoot?.delegatesFocus ? !1 : s.matches(Se.join(",")) && !Ae(s);
|
|
471
|
+
function Ee(s) {
|
|
465
472
|
return s.shadowRoot && s.getAttribute("tabindex") === "-1" ? !1 : !s.matches(":disabled,[hidden],[inert]");
|
|
466
473
|
}
|
|
467
474
|
function V(s = document) {
|
|
468
475
|
const t = s.activeElement;
|
|
469
476
|
return t ? t.shadowRoot ? V(t.shadowRoot) || document.activeElement : t : null;
|
|
470
477
|
}
|
|
471
|
-
function
|
|
472
|
-
const [e, i] =
|
|
478
|
+
function Ce(s, t) {
|
|
479
|
+
const [e, i] = Le(s);
|
|
473
480
|
if (!e)
|
|
474
481
|
return t.preventDefault();
|
|
475
482
|
const n = V();
|
|
@@ -479,16 +486,16 @@ function R(s, t) {
|
|
|
479
486
|
function e(i) {
|
|
480
487
|
if (!i || i === document || i === window)
|
|
481
488
|
return null;
|
|
482
|
-
const n =
|
|
489
|
+
const n = zt(i);
|
|
483
490
|
return n && (i = n), i.closest(s) || e(i.getRootNode().host);
|
|
484
491
|
}
|
|
485
492
|
return e(t);
|
|
486
493
|
}
|
|
487
|
-
function
|
|
488
|
-
return s.assignedSlot || (s.parentNode ?
|
|
494
|
+
function zt(s) {
|
|
495
|
+
return s.assignedSlot || (s.parentNode ? zt(s.parentNode) : null);
|
|
489
496
|
}
|
|
490
497
|
const Z = "data-a11y-dialog";
|
|
491
|
-
class
|
|
498
|
+
class Mt {
|
|
492
499
|
$el;
|
|
493
500
|
id;
|
|
494
501
|
previouslyFocused;
|
|
@@ -600,7 +607,7 @@ class zt {
|
|
|
600
607
|
e = !!this.$el.querySelector('[popover]:not([popover="manual"]):popover-open');
|
|
601
608
|
} catch {
|
|
602
609
|
}
|
|
603
|
-
t.key === "Escape" && this.$el.getAttribute("role") !== "alertdialog" && !e && (t.preventDefault(), this.hide(t)), t.key === "Tab" &&
|
|
610
|
+
t.key === "Escape" && this.$el.getAttribute("role") !== "alertdialog" && !e && (t.preventDefault(), this.hide(t)), t.key === "Tab" && Ce(this.$el, t);
|
|
604
611
|
}
|
|
605
612
|
/**
|
|
606
613
|
* If the dialog is shown and the focus is not within a dialog element (either
|
|
@@ -615,13 +622,13 @@ class zt {
|
|
|
615
622
|
}
|
|
616
623
|
function ft() {
|
|
617
624
|
for (const s of document.querySelectorAll("[data-a11y-dialog]"))
|
|
618
|
-
new
|
|
625
|
+
new Mt(s);
|
|
619
626
|
}
|
|
620
627
|
typeof document < "u" && (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", ft) : ft());
|
|
621
|
-
const
|
|
628
|
+
const xe = () => document.querySelectorAll(".js-modal").forEach((s) => {
|
|
622
629
|
if (!(s instanceof HTMLElement))
|
|
623
630
|
return;
|
|
624
|
-
const t = new
|
|
631
|
+
const t = new Mt(s);
|
|
625
632
|
if (s.id === "dialog-menu") {
|
|
626
633
|
const e = document.querySelectorAll("button[data-a11y-dialog-show='dialog-menu']"), i = document.querySelectorAll("button[data-a11y-dialog-hide='dialog-menu']");
|
|
627
634
|
e.length > 0 && i.length > 0 && (t.on("show", () => {
|
|
@@ -643,27 +650,27 @@ const Ae = () => document.querySelectorAll(".js-modal").forEach((s) => {
|
|
|
643
650
|
}).on("hide", () => {
|
|
644
651
|
document.body.classList.remove("noscroll");
|
|
645
652
|
});
|
|
646
|
-
}), J = "50px",
|
|
653
|
+
}), J = "50px", lt = ({
|
|
647
654
|
navigationContainer: s,
|
|
648
655
|
navigatedList: t,
|
|
649
656
|
nextBtn: e,
|
|
650
657
|
prevBtn: i
|
|
651
658
|
}) => {
|
|
652
659
|
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 = "");
|
|
653
|
-
},
|
|
660
|
+
}, Pe = ({
|
|
654
661
|
navigationContainer: s,
|
|
655
662
|
navigatedList: t,
|
|
656
663
|
nextBtn: e,
|
|
657
664
|
prevBtn: i
|
|
658
665
|
}) => {
|
|
659
666
|
const n = t.scrollLeft > 0, o = t.scrollLeft + (t.clientWidth + 0.5) < t.scrollWidth;
|
|
660
|
-
n && o ? (e.classList?.add("o-nav-button--visible"), i.classList?.add("o-nav-button--visible")) : n ? (e.classList?.remove("o-nav-button--visible"), i.classList?.add("o-nav-button--visible")) : o ? (e.classList?.add("o-nav-button--visible"), i.classList?.remove("o-nav-button--visible")) : (e.classList?.remove("o-nav-button--visible"), i.classList?.remove("o-nav-button--visible")), e.classList.contains("c-slider__button-container--has-space-around") && i.classList.contains("c-slider__button-container--has-space-around") &&
|
|
667
|
+
n && o ? (e.classList?.add("o-nav-button--visible"), i.classList?.add("o-nav-button--visible")) : n ? (e.classList?.remove("o-nav-button--visible"), i.classList?.add("o-nav-button--visible")) : o ? (e.classList?.add("o-nav-button--visible"), i.classList?.remove("o-nav-button--visible")) : (e.classList?.remove("o-nav-button--visible"), i.classList?.remove("o-nav-button--visible")), e.classList.contains("c-slider__button-container--has-space-around") && i.classList.contains("c-slider__button-container--has-space-around") && lt({
|
|
661
668
|
navigationContainer: s,
|
|
662
669
|
navigatedList: t,
|
|
663
670
|
nextBtn: e,
|
|
664
671
|
prevBtn: i
|
|
665
672
|
});
|
|
666
|
-
},
|
|
673
|
+
}, Ie = ({
|
|
667
674
|
navigationContainer: s,
|
|
668
675
|
navigatedList: t,
|
|
669
676
|
nextBtn: e,
|
|
@@ -708,14 +715,14 @@ const Ae = () => document.querySelectorAll(".js-modal").forEach((s) => {
|
|
|
708
715
|
behavior: "smooth"
|
|
709
716
|
}), e.classList.remove("o-nav-button--visible"), i.classList.add("o-nav-button--visible");
|
|
710
717
|
}
|
|
711
|
-
e.classList.contains("c-slider__button-container--has-space-around") && i.classList.contains("c-slider__button-container--has-space-around") &&
|
|
718
|
+
e.classList.contains("c-slider__button-container--has-space-around") && i.classList.contains("c-slider__button-container--has-space-around") && lt({
|
|
712
719
|
navigationContainer: s,
|
|
713
720
|
navigatedList: t,
|
|
714
721
|
nextBtn: e,
|
|
715
722
|
prevBtn: i
|
|
716
723
|
});
|
|
717
724
|
}
|
|
718
|
-
},
|
|
725
|
+
}, Te = ({
|
|
719
726
|
navigationContainer: s,
|
|
720
727
|
navigatedList: t,
|
|
721
728
|
nextBtn: e,
|
|
@@ -756,26 +763,26 @@ const Ae = () => document.querySelectorAll(".js-modal").forEach((s) => {
|
|
|
756
763
|
left: 0,
|
|
757
764
|
behavior: "smooth"
|
|
758
765
|
}), i.classList.remove("o-nav-button--visible"), t.clientWidth < t.scrollWidth && e.classList.add("o-nav-button--visible");
|
|
759
|
-
e.classList.contains("c-slider__button-container--has-space-around") && i.classList.contains("c-slider__button-container--has-space-around") &&
|
|
766
|
+
e.classList.contains("c-slider__button-container--has-space-around") && i.classList.contains("c-slider__button-container--has-space-around") && lt({
|
|
760
767
|
navigationContainer: s,
|
|
761
768
|
navigatedList: t,
|
|
762
769
|
nextBtn: e,
|
|
763
770
|
prevBtn: i
|
|
764
771
|
});
|
|
765
772
|
}
|
|
766
|
-
},
|
|
773
|
+
}, ze = ({
|
|
767
774
|
navigationContainer: s,
|
|
768
775
|
navigatedList: t,
|
|
769
776
|
nextBtn: e,
|
|
770
777
|
prevBtn: i
|
|
771
778
|
}) => {
|
|
772
|
-
|
|
779
|
+
Pe({
|
|
773
780
|
navigationContainer: s,
|
|
774
781
|
navigatedList: t,
|
|
775
782
|
nextBtn: e,
|
|
776
783
|
prevBtn: i
|
|
777
784
|
});
|
|
778
|
-
},
|
|
785
|
+
}, Me = (s) => {
|
|
779
786
|
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(
|
|
780
787
|
".js-navigation-container__list"
|
|
781
788
|
), c = s.querySelector(".o-nav-button--next-button"), d = s.querySelector(
|
|
@@ -783,7 +790,7 @@ const Ae = () => document.querySelectorAll(".js-modal").forEach((s) => {
|
|
|
783
790
|
);
|
|
784
791
|
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(
|
|
785
792
|
"click",
|
|
786
|
-
|
|
793
|
+
Ie.bind(!1, {
|
|
787
794
|
navigationContainer: s,
|
|
788
795
|
navigatedList: l,
|
|
789
796
|
nextBtn: c,
|
|
@@ -792,7 +799,7 @@ const Ae = () => document.querySelectorAll(".js-modal").forEach((s) => {
|
|
|
792
799
|
})
|
|
793
800
|
), d.addEventListener(
|
|
794
801
|
"click",
|
|
795
|
-
|
|
802
|
+
Te.bind(!1, {
|
|
796
803
|
navigationContainer: s,
|
|
797
804
|
navigatedList: l,
|
|
798
805
|
nextBtn: c,
|
|
@@ -816,7 +823,7 @@ const Ae = () => document.querySelectorAll(".js-modal").forEach((s) => {
|
|
|
816
823
|
}, 0)), d.click());
|
|
817
824
|
}, n);
|
|
818
825
|
}
|
|
819
|
-
},
|
|
826
|
+
}, Oe = () => {
|
|
820
827
|
const s = document.querySelectorAll(".js-navigation-container");
|
|
821
828
|
Array.from(s).forEach((t) => {
|
|
822
829
|
const e = t.querySelector(
|
|
@@ -826,13 +833,13 @@ const Ae = () => document.querySelectorAll(".js-modal").forEach((s) => {
|
|
|
826
833
|
const i = new ResizeObserver((n) => {
|
|
827
834
|
n.forEach((o) => {
|
|
828
835
|
const { width: r } = o.contentRect;
|
|
829
|
-
r > 0 && (
|
|
836
|
+
r > 0 && (Me(t), i.disconnect());
|
|
830
837
|
});
|
|
831
838
|
});
|
|
832
839
|
i.observe(e);
|
|
833
840
|
}
|
|
834
841
|
});
|
|
835
|
-
},
|
|
842
|
+
}, De = () => {
|
|
836
843
|
const s = document.querySelectorAll(".js-navigation-container");
|
|
837
844
|
for (const t of Array.from(s))
|
|
838
845
|
if (t) {
|
|
@@ -845,7 +852,7 @@ const Ae = () => document.querySelectorAll(".js-modal").forEach((s) => {
|
|
|
845
852
|
);
|
|
846
853
|
e && i && n && window.addEventListener(
|
|
847
854
|
"resize",
|
|
848
|
-
|
|
855
|
+
ze.bind(!1, {
|
|
849
856
|
navigationContainer: t,
|
|
850
857
|
navigatedList: e,
|
|
851
858
|
nextBtn: i,
|
|
@@ -864,7 +871,7 @@ function S(s, t) {
|
|
|
864
871
|
function Ot(s) {
|
|
865
872
|
s.x = Math.round(s.x), s.y = Math.round(s.y);
|
|
866
873
|
}
|
|
867
|
-
function
|
|
874
|
+
function it(s, t) {
|
|
868
875
|
const e = Math.abs(s.x - t.x), i = Math.abs(s.y - t.y);
|
|
869
876
|
return Math.sqrt(e * e + i * i);
|
|
870
877
|
}
|
|
@@ -881,17 +888,17 @@ function G(s, t, e) {
|
|
|
881
888
|
function D(s, t, e, i) {
|
|
882
889
|
s.style.transform = G(t, e, i);
|
|
883
890
|
}
|
|
884
|
-
const
|
|
891
|
+
const $e = "cubic-bezier(.4,0,.22,1)";
|
|
885
892
|
function Dt(s, t, e, i) {
|
|
886
|
-
s.style.transition = t ? `${t} ${e}ms ${i ||
|
|
893
|
+
s.style.transition = t ? `${t} ${e}ms ${i || $e}` : "none";
|
|
887
894
|
}
|
|
888
|
-
function
|
|
895
|
+
function st(s, t, e) {
|
|
889
896
|
s.style.width = typeof t == "number" ? `${t}px` : t, s.style.height = typeof e == "number" ? `${e}px` : e;
|
|
890
897
|
}
|
|
891
|
-
function
|
|
898
|
+
function Re(s) {
|
|
892
899
|
Dt(s);
|
|
893
900
|
}
|
|
894
|
-
function
|
|
901
|
+
function Be(s) {
|
|
895
902
|
return "decode" in s ? s.decode().catch(() => {
|
|
896
903
|
}) : s.complete ? Promise.resolve(s) : new Promise((t, e) => {
|
|
897
904
|
s.onload = () => t(s), s.onerror = e;
|
|
@@ -903,10 +910,10 @@ const P = {
|
|
|
903
910
|
LOADED: "loaded",
|
|
904
911
|
ERROR: "error"
|
|
905
912
|
};
|
|
906
|
-
function
|
|
913
|
+
function Fe(s) {
|
|
907
914
|
return "button" in s && s.button === 1 || s.ctrlKey || s.metaKey || s.altKey || s.shiftKey;
|
|
908
915
|
}
|
|
909
|
-
function
|
|
916
|
+
function Ze(s, t, e = document) {
|
|
910
917
|
let i = [];
|
|
911
918
|
if (s instanceof Element)
|
|
912
919
|
i = [s];
|
|
@@ -930,7 +937,7 @@ try {
|
|
|
930
937
|
}));
|
|
931
938
|
} catch {
|
|
932
939
|
}
|
|
933
|
-
class
|
|
940
|
+
class ke {
|
|
934
941
|
constructor() {
|
|
935
942
|
this._pool = [];
|
|
936
943
|
}
|
|
@@ -1010,7 +1017,7 @@ function Rt(s, t) {
|
|
|
1010
1017
|
y: window.innerHeight
|
|
1011
1018
|
};
|
|
1012
1019
|
}
|
|
1013
|
-
function
|
|
1020
|
+
function N(s, t, e, i, n) {
|
|
1014
1021
|
let o = 0;
|
|
1015
1022
|
if (t.paddingFn)
|
|
1016
1023
|
o = t.paddingFn(e, i, n)[s];
|
|
@@ -1024,11 +1031,11 @@ function q(s, t, e, i, n) {
|
|
|
1024
1031
|
}
|
|
1025
1032
|
function Bt(s, t, e, i) {
|
|
1026
1033
|
return {
|
|
1027
|
-
x: t.x -
|
|
1028
|
-
y: t.y -
|
|
1034
|
+
x: t.x - N("left", s, t, e, i) - N("right", s, t, e, i),
|
|
1035
|
+
y: t.y - N("top", s, t, e, i) - N("bottom", s, t, e, i)
|
|
1029
1036
|
};
|
|
1030
1037
|
}
|
|
1031
|
-
class
|
|
1038
|
+
class Ne {
|
|
1032
1039
|
/**
|
|
1033
1040
|
* @param {Slide} slide
|
|
1034
1041
|
*/
|
|
@@ -1065,7 +1072,7 @@ class Fe {
|
|
|
1065
1072
|
_updateAxis(t) {
|
|
1066
1073
|
const {
|
|
1067
1074
|
pswp: e
|
|
1068
|
-
} = this.slide, i = this.slide[t === "x" ? "width" : "height"] * this.currZoomLevel, o =
|
|
1075
|
+
} = this.slide, i = this.slide[t === "x" ? "width" : "height"] * this.currZoomLevel, o = N(t === "x" ? "left" : "top", e.options, e.viewportSize, this.slide.data, this.slide.index), r = this.slide.panAreaSize[t];
|
|
1069
1076
|
this.center[t] = Math.round((r - i) / 2) + o, this.max[t] = i > r ? Math.round(r - i) + o : this.center[t], this.min[t] = i > r ? o : this.center[t];
|
|
1070
1077
|
}
|
|
1071
1078
|
// _getZeroBounds
|
|
@@ -1164,7 +1171,7 @@ let Ft = class {
|
|
|
1164
1171
|
return this._parseZoomLevelOption("max") || Math.max(1, this.fit * 4);
|
|
1165
1172
|
}
|
|
1166
1173
|
};
|
|
1167
|
-
class
|
|
1174
|
+
class qe {
|
|
1168
1175
|
/**
|
|
1169
1176
|
* @param {SlideData} data
|
|
1170
1177
|
* @param {number} index
|
|
@@ -1181,7 +1188,7 @@ class Ze {
|
|
|
1181
1188
|
slide: this,
|
|
1182
1189
|
data: this.data,
|
|
1183
1190
|
index: e
|
|
1184
|
-
}), 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
|
|
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 Ne(this), this.prevDisplayedWidth = -1, this.prevDisplayedHeight = -1, this.pswp.dispatch("slideInit", {
|
|
1185
1192
|
slide: this
|
|
1186
1193
|
});
|
|
1187
1194
|
}
|
|
@@ -1434,11 +1441,11 @@ class Ze {
|
|
|
1434
1441
|
t !== this.currentResolution && (this.currentResolution = t, this.updateContentSize(), this.pswp.dispatch("resolutionChanged"));
|
|
1435
1442
|
}
|
|
1436
1443
|
}
|
|
1437
|
-
const
|
|
1438
|
-
function
|
|
1444
|
+
const He = 0.35, We = 0.6, yt = 0.4, _t = 0.5;
|
|
1445
|
+
function Ve(s, t) {
|
|
1439
1446
|
return s * t / (1 - t);
|
|
1440
1447
|
}
|
|
1441
|
-
class
|
|
1448
|
+
class je {
|
|
1442
1449
|
/**
|
|
1443
1450
|
* @param {Gestures} gestures
|
|
1444
1451
|
*/
|
|
@@ -1464,7 +1471,7 @@ class He {
|
|
|
1464
1471
|
if (!this.pswp.dispatch("verticalDrag", {
|
|
1465
1472
|
panY: o
|
|
1466
1473
|
}).defaultPrevented) {
|
|
1467
|
-
this._setPanWithFriction("y", o,
|
|
1474
|
+
this._setPanWithFriction("y", o, We);
|
|
1468
1475
|
const r = 1 - Math.abs(this._getVerticalDragRatio(n.pan.y));
|
|
1469
1476
|
this.pswp.applyBgOpacity(r), n.applyCurrentZoomPan();
|
|
1470
1477
|
}
|
|
@@ -1500,7 +1507,7 @@ class He {
|
|
|
1500
1507
|
const {
|
|
1501
1508
|
pan: n,
|
|
1502
1509
|
bounds: o
|
|
1503
|
-
} = i, r = n[t], a = this.pswp.bgOpacity < 1 && t === "y", c = r +
|
|
1510
|
+
} = i, r = n[t], a = this.pswp.bgOpacity < 1 && t === "y", c = r + Ve(e[t], 0.995);
|
|
1504
1511
|
if (a) {
|
|
1505
1512
|
const m = this._getVerticalDragRatio(r), p = this._getVerticalDragRatio(c);
|
|
1506
1513
|
if (m < 0 && p < -yt || m > 0 && p > yt) {
|
|
@@ -1615,16 +1622,16 @@ class He {
|
|
|
1615
1622
|
} = n;
|
|
1616
1623
|
if (r.correctPan(t, e) !== e || i) {
|
|
1617
1624
|
const l = Math.round(e - o[t]);
|
|
1618
|
-
o[t] += l * (i ||
|
|
1625
|
+
o[t] += l * (i || He);
|
|
1619
1626
|
} else
|
|
1620
1627
|
o[t] = e;
|
|
1621
1628
|
}
|
|
1622
1629
|
}
|
|
1623
|
-
const
|
|
1630
|
+
const Ge = 0.05, Ue = 0.15;
|
|
1624
1631
|
function wt(s, t, e) {
|
|
1625
1632
|
return s.x = (t.x + e.x) / 2, s.y = (t.y + e.y) / 2, s;
|
|
1626
1633
|
}
|
|
1627
|
-
class
|
|
1634
|
+
class Ke {
|
|
1628
1635
|
/**
|
|
1629
1636
|
* @param {Gestures} gestures
|
|
1630
1637
|
*/
|
|
@@ -1662,7 +1669,7 @@ class je {
|
|
|
1662
1669
|
if (!r.isZoomable() || o.mainScroll.isShifted())
|
|
1663
1670
|
return;
|
|
1664
1671
|
wt(this._startZoomPoint, e, n), wt(this._zoomPoint, t, i);
|
|
1665
|
-
let c = 1 /
|
|
1672
|
+
let c = 1 / it(e, n) * it(t, i) * this._startZoomLevel;
|
|
1666
1673
|
if (c > r.zoomLevels.initial + r.zoomLevels.initial / 15 && (this._wasOverFitZoomLevel = !0), c < a)
|
|
1667
1674
|
if (o.options.pinchToClose && !this._wasOverFitZoomLevel && this._startZoomLevel <= r.zoomLevels.initial) {
|
|
1668
1675
|
const d = 1 - (a - c) / (a / 1.2);
|
|
@@ -1670,8 +1677,8 @@ class je {
|
|
|
1670
1677
|
bgOpacity: d
|
|
1671
1678
|
}).defaultPrevented || o.applyBgOpacity(d);
|
|
1672
1679
|
} else
|
|
1673
|
-
c = a - (a - c) *
|
|
1674
|
-
else c > l && (c = l + (c - l) *
|
|
1680
|
+
c = a - (a - c) * Ue;
|
|
1681
|
+
else c > l && (c = l + (c - l) * Ge);
|
|
1675
1682
|
r.pan.x = this._calculatePanForZoomLevel("x", c), r.pan.y = this._calculatePanForZoomLevel("y", c), r.setZoomLevel(c), r.applyCurrentZoomPan();
|
|
1676
1683
|
}
|
|
1677
1684
|
end() {
|
|
@@ -1759,7 +1766,7 @@ function bt(s) {
|
|
|
1759
1766
|
return !!/** @type {HTMLElement} */
|
|
1760
1767
|
s.target.closest(".pswp__container");
|
|
1761
1768
|
}
|
|
1762
|
-
class
|
|
1769
|
+
class Xe {
|
|
1763
1770
|
/**
|
|
1764
1771
|
* @param {Gestures} gestures
|
|
1765
1772
|
*/
|
|
@@ -1833,8 +1840,8 @@ class Ge {
|
|
|
1833
1840
|
}
|
|
1834
1841
|
}
|
|
1835
1842
|
}
|
|
1836
|
-
const
|
|
1837
|
-
class
|
|
1843
|
+
const Ye = 10, Je = 300, Qe = 25;
|
|
1844
|
+
class ti {
|
|
1838
1845
|
/**
|
|
1839
1846
|
* @param {PhotoSwipe} pswp
|
|
1840
1847
|
*/
|
|
@@ -1866,7 +1873,7 @@ class Ye {
|
|
|
1866
1873
|
}, this._intervalP1 = {
|
|
1867
1874
|
x: 0,
|
|
1868
1875
|
y: 0
|
|
1869
|
-
}, 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
|
|
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 je(this), this.zoomLevels = new Ke(this), this.tapHandler = new Xe(this), t.on("bindEvents", () => {
|
|
1870
1877
|
t.events.add(
|
|
1871
1878
|
t.scrollWrap,
|
|
1872
1879
|
"click",
|
|
@@ -1986,8 +1993,8 @@ class Ye {
|
|
|
1986
1993
|
this.tapHandler.click(this.startP1, t);
|
|
1987
1994
|
return;
|
|
1988
1995
|
}
|
|
1989
|
-
const i = this.pswp.options.doubleTapAction ?
|
|
1990
|
-
this._tapTimer ? (this._clearTapTimer(),
|
|
1996
|
+
const i = this.pswp.options.doubleTapAction ? Je : 0;
|
|
1997
|
+
this._tapTimer ? (this._clearTapTimer(), it(this._lastStartP1, this.startP1) < Qe && this.tapHandler.doubleTap(this.startP1, t)) : (S(this._lastStartP1, this.startP1), this._tapTimer = setTimeout(() => {
|
|
1991
1998
|
this.tapHandler.tap(this.startP1, t), this._clearTapTimer();
|
|
1992
1999
|
}, i));
|
|
1993
2000
|
}
|
|
@@ -2073,7 +2080,7 @@ class Ye {
|
|
|
2073
2080
|
const t = Math.abs(this.p1.x - this.startP1.x) - Math.abs(this.p1.y - this.startP1.y);
|
|
2074
2081
|
if (t !== 0) {
|
|
2075
2082
|
const e = t > 0 ? "x" : "y";
|
|
2076
|
-
Math.abs(this.p1[e] - this.startP1[e]) >=
|
|
2083
|
+
Math.abs(this.p1[e] - this.startP1[e]) >= Ye && (this.dragAxis = e);
|
|
2077
2084
|
}
|
|
2078
2085
|
}
|
|
2079
2086
|
}
|
|
@@ -2097,8 +2104,8 @@ class Ye {
|
|
|
2097
2104
|
this.pswp.mainScroll.isShifted() && (t.preventDefault(), t.stopPropagation());
|
|
2098
2105
|
}
|
|
2099
2106
|
}
|
|
2100
|
-
const
|
|
2101
|
-
class
|
|
2107
|
+
const ei = 0.35;
|
|
2108
|
+
class ii {
|
|
2102
2109
|
/**
|
|
2103
2110
|
* @param {PhotoSwipe} pswp
|
|
2104
2111
|
*/
|
|
@@ -2251,7 +2258,7 @@ class Qe {
|
|
|
2251
2258
|
let i = (this.slideWidth * this._currPositionIndex - t) / this.slideWidth;
|
|
2252
2259
|
i += this.pswp.currIndex;
|
|
2253
2260
|
const n = Math.round(t - this.x);
|
|
2254
|
-
(i < 0 && n > 0 || i >= this.pswp.getNumItems() - 1 && n < 0) && (t = this.x + n *
|
|
2261
|
+
(i < 0 && n > 0 || i >= this.pswp.getNumItems() - 1 && n < 0) && (t = this.x + n * ei);
|
|
2255
2262
|
}
|
|
2256
2263
|
this.x = t, this.pswp.container && D(this.pswp.container, t), this.pswp.dispatch("moveMainScroll", {
|
|
2257
2264
|
x: t,
|
|
@@ -2259,7 +2266,7 @@ class Qe {
|
|
|
2259
2266
|
});
|
|
2260
2267
|
}
|
|
2261
2268
|
}
|
|
2262
|
-
const
|
|
2269
|
+
const si = {
|
|
2263
2270
|
Escape: 27,
|
|
2264
2271
|
z: 90,
|
|
2265
2272
|
ArrowLeft: 37,
|
|
@@ -2267,8 +2274,8 @@ const ti = {
|
|
|
2267
2274
|
ArrowRight: 39,
|
|
2268
2275
|
ArrowDown: 40,
|
|
2269
2276
|
Tab: 9
|
|
2270
|
-
}, O = (s, t) => t ? s :
|
|
2271
|
-
class
|
|
2277
|
+
}, O = (s, t) => t ? s : si[s];
|
|
2278
|
+
class ni {
|
|
2272
2279
|
/**
|
|
2273
2280
|
* @param {PhotoSwipe} pswp
|
|
2274
2281
|
*/
|
|
@@ -2308,7 +2315,7 @@ class ei {
|
|
|
2308
2315
|
} = this;
|
|
2309
2316
|
if (e.dispatch("keydown", {
|
|
2310
2317
|
originalEvent: t
|
|
2311
|
-
}).defaultPrevented ||
|
|
2318
|
+
}).defaultPrevented || Fe(t))
|
|
2312
2319
|
return;
|
|
2313
2320
|
let i, n, o = !1;
|
|
2314
2321
|
const r = "key" in t;
|
|
@@ -2360,8 +2367,8 @@ class ei {
|
|
|
2360
2367
|
) && e.focus();
|
|
2361
2368
|
}
|
|
2362
2369
|
}
|
|
2363
|
-
const
|
|
2364
|
-
class
|
|
2370
|
+
const oi = "cubic-bezier(.4,0,.22,1)";
|
|
2371
|
+
class ri {
|
|
2365
2372
|
/**
|
|
2366
2373
|
* onComplete can be unpredictable, be careful about current state
|
|
2367
2374
|
*
|
|
@@ -2377,7 +2384,7 @@ class si {
|
|
|
2377
2384
|
onFinish: r = () => {
|
|
2378
2385
|
},
|
|
2379
2386
|
duration: a = 333,
|
|
2380
|
-
easing: l =
|
|
2387
|
+
easing: l = oi
|
|
2381
2388
|
} = t;
|
|
2382
2389
|
this.onFinish = r;
|
|
2383
2390
|
const c = o ? "transform" : "opacity", d = (e = t[c]) !== null && e !== void 0 ? e : "";
|
|
@@ -2404,11 +2411,11 @@ class si {
|
|
|
2404
2411
|
}
|
|
2405
2412
|
// Destroy is called automatically onFinish
|
|
2406
2413
|
destroy() {
|
|
2407
|
-
this._helperTimeout && clearTimeout(this._helperTimeout),
|
|
2414
|
+
this._helperTimeout && clearTimeout(this._helperTimeout), Re(this._target), this._target.removeEventListener("transitionend", this._onTransitionEnd, !1), this._target.removeEventListener("transitioncancel", this._onTransitionEnd, !1), this._finished || this._finalizeAnimation();
|
|
2408
2415
|
}
|
|
2409
2416
|
}
|
|
2410
|
-
const
|
|
2411
|
-
class
|
|
2417
|
+
const ai = 12, li = 0.75;
|
|
2418
|
+
class ci {
|
|
2412
2419
|
/**
|
|
2413
2420
|
* @param {number} initialVelocity Initial velocity, px per ms.
|
|
2414
2421
|
*
|
|
@@ -2425,7 +2432,7 @@ class ri {
|
|
|
2425
2432
|
* Recommended value from 10 to 50
|
|
2426
2433
|
*/
|
|
2427
2434
|
constructor(t, e, i) {
|
|
2428
|
-
this.velocity = t * 1e3, this._dampingRatio = e ||
|
|
2435
|
+
this.velocity = t * 1e3, this._dampingRatio = e || li, this._naturalFrequency = i || ai, this._dampedFrequency = this._naturalFrequency, this._dampingRatio < 1 && (this._dampedFrequency *= Math.sqrt(1 - this._dampingRatio * this._dampingRatio));
|
|
2429
2436
|
}
|
|
2430
2437
|
/**
|
|
2431
2438
|
* @param {number} deltaPosition Difference between current and end position of the animation
|
|
@@ -2447,7 +2454,7 @@ class ri {
|
|
|
2447
2454
|
return i;
|
|
2448
2455
|
}
|
|
2449
2456
|
}
|
|
2450
|
-
class
|
|
2457
|
+
class di {
|
|
2451
2458
|
/**
|
|
2452
2459
|
* @param {SpringAnimationProps} props
|
|
2453
2460
|
*/
|
|
@@ -2465,7 +2472,7 @@ class ai {
|
|
|
2465
2472
|
naturalFrequency: c
|
|
2466
2473
|
} = t;
|
|
2467
2474
|
this.onFinish = a;
|
|
2468
|
-
const d = new
|
|
2475
|
+
const d = new ci(n, l, c);
|
|
2469
2476
|
let h = Date.now(), u = e - i;
|
|
2470
2477
|
const f = () => {
|
|
2471
2478
|
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)));
|
|
@@ -2477,7 +2484,7 @@ class ai {
|
|
|
2477
2484
|
this._raf >= 0 && cancelAnimationFrame(this._raf), this._raf = 0;
|
|
2478
2485
|
}
|
|
2479
2486
|
}
|
|
2480
|
-
class
|
|
2487
|
+
class hi {
|
|
2481
2488
|
constructor() {
|
|
2482
2489
|
this.activeAnimations = [];
|
|
2483
2490
|
}
|
|
@@ -2500,10 +2507,10 @@ class li {
|
|
|
2500
2507
|
* @returns {Animation}
|
|
2501
2508
|
*/
|
|
2502
2509
|
_start(t, e) {
|
|
2503
|
-
const i = e ? new
|
|
2510
|
+
const i = e ? new di(
|
|
2504
2511
|
/** @type SpringAnimationProps */
|
|
2505
2512
|
t
|
|
2506
|
-
) : new
|
|
2513
|
+
) : new ri(
|
|
2507
2514
|
/** @type CssAnimationProps */
|
|
2508
2515
|
t
|
|
2509
2516
|
);
|
|
@@ -2546,7 +2553,7 @@ class li {
|
|
|
2546
2553
|
return this.activeAnimations.some((t) => t.props.isPan);
|
|
2547
2554
|
}
|
|
2548
2555
|
}
|
|
2549
|
-
class
|
|
2556
|
+
class ui {
|
|
2550
2557
|
/**
|
|
2551
2558
|
* @param {PhotoSwipe} pswp
|
|
2552
2559
|
*/
|
|
@@ -2588,7 +2595,7 @@ class ci {
|
|
|
2588
2595
|
e.isPannable() && (t.deltaMode === 1 && (i *= 18, n *= 18), e.panTo(e.pan.x - i, e.pan.y - n));
|
|
2589
2596
|
}
|
|
2590
2597
|
}
|
|
2591
|
-
function
|
|
2598
|
+
function pi(s) {
|
|
2592
2599
|
if (typeof s == "string")
|
|
2593
2600
|
return s;
|
|
2594
2601
|
if (!s || !s.isCustomSVG)
|
|
@@ -2600,7 +2607,7 @@ function di(s) {
|
|
|
2600
2607
|
t.size || 32
|
|
2601
2608
|
), t.outlineID && (e += '<use class="pswp__icn-shadow" xlink:href="#' + t.outlineID + '"/>'), e += t.inner, e += "</svg>", e;
|
|
2602
2609
|
}
|
|
2603
|
-
class
|
|
2610
|
+
class mi {
|
|
2604
2611
|
/**
|
|
2605
2612
|
* @param {PhotoSwipe} pswp
|
|
2606
2613
|
* @param {UIElementData} data
|
|
@@ -2632,7 +2639,7 @@ class hi {
|
|
|
2632
2639
|
const f = u || h;
|
|
2633
2640
|
f && l.setAttribute("aria-label", f);
|
|
2634
2641
|
}
|
|
2635
|
-
l.innerHTML =
|
|
2642
|
+
l.innerHTML = pi(o), e.onInit && e.onInit(l, t), e.onClick && (l.onclick = (h) => {
|
|
2636
2643
|
typeof e.onClick == "string" ? t[e.onClick]() : typeof e.onClick == "function" && e.onClick(h, l, t);
|
|
2637
2644
|
});
|
|
2638
2645
|
const c = e.appendTo || "bar";
|
|
@@ -2645,7 +2652,7 @@ function Zt(s, t, e) {
|
|
|
2645
2652
|
t.options.loop || (e ? s.disabled = !(t.currIndex < t.getNumItems() - 1) : s.disabled = !(t.currIndex > 0));
|
|
2646
2653
|
});
|
|
2647
2654
|
}
|
|
2648
|
-
const
|
|
2655
|
+
const fi = {
|
|
2649
2656
|
name: "arrowPrev",
|
|
2650
2657
|
className: "pswp__button--arrow--prev",
|
|
2651
2658
|
title: "Previous",
|
|
@@ -2660,7 +2667,7 @@ const ui = {
|
|
|
2660
2667
|
},
|
|
2661
2668
|
onClick: "prev",
|
|
2662
2669
|
onInit: Zt
|
|
2663
|
-
},
|
|
2670
|
+
}, gi = {
|
|
2664
2671
|
name: "arrowNext",
|
|
2665
2672
|
className: "pswp__button--arrow--next",
|
|
2666
2673
|
title: "Next",
|
|
@@ -2677,7 +2684,7 @@ const ui = {
|
|
|
2677
2684
|
onInit: (s, t) => {
|
|
2678
2685
|
Zt(s, t, !0);
|
|
2679
2686
|
}
|
|
2680
|
-
},
|
|
2687
|
+
}, vi = {
|
|
2681
2688
|
name: "close",
|
|
2682
2689
|
title: "Close",
|
|
2683
2690
|
order: 20,
|
|
@@ -2688,7 +2695,7 @@ const ui = {
|
|
|
2688
2695
|
outlineID: "pswp__icn-close"
|
|
2689
2696
|
},
|
|
2690
2697
|
onClick: "close"
|
|
2691
|
-
},
|
|
2698
|
+
}, yi = {
|
|
2692
2699
|
name: "zoom",
|
|
2693
2700
|
title: "Zoom",
|
|
2694
2701
|
order: 10,
|
|
@@ -2700,7 +2707,7 @@ const ui = {
|
|
|
2700
2707
|
outlineID: "pswp__icn-zoom"
|
|
2701
2708
|
},
|
|
2702
2709
|
onClick: "toggleZoom"
|
|
2703
|
-
},
|
|
2710
|
+
}, _i = {
|
|
2704
2711
|
name: "preloader",
|
|
2705
2712
|
appendTo: "bar",
|
|
2706
2713
|
order: 7,
|
|
@@ -2731,7 +2738,7 @@ const ui = {
|
|
|
2731
2738
|
t.currSlide === a.slide && r();
|
|
2732
2739
|
}), t.ui && (t.ui.updatePreloaderVisibility = r);
|
|
2733
2740
|
}
|
|
2734
|
-
},
|
|
2741
|
+
}, wi = {
|
|
2735
2742
|
name: "counter",
|
|
2736
2743
|
order: 5,
|
|
2737
2744
|
onInit: (s, t) => {
|
|
@@ -2743,7 +2750,7 @@ const ui = {
|
|
|
2743
2750
|
function St(s, t) {
|
|
2744
2751
|
s.classList.toggle("pswp--zoomed-in", t);
|
|
2745
2752
|
}
|
|
2746
|
-
class
|
|
2753
|
+
class bi {
|
|
2747
2754
|
/**
|
|
2748
2755
|
* @param {PhotoSwipe} pswp
|
|
2749
2756
|
*/
|
|
@@ -2755,7 +2762,7 @@ class yi {
|
|
|
2755
2762
|
const {
|
|
2756
2763
|
pswp: t
|
|
2757
2764
|
} = this;
|
|
2758
|
-
this.isRegistered = !1, this.uiElementsData = [
|
|
2765
|
+
this.isRegistered = !1, this.uiElementsData = [vi, fi, gi, yi, _i, wi], t.dispatch("uiRegister"), this.uiElementsData.sort((e, i) => (e.order || 0) - (i.order || 0)), this.items = [], this.isRegistered = !0, this.uiElementsData.forEach((e) => {
|
|
2759
2766
|
this.registerElement(e);
|
|
2760
2767
|
}), t.on("change", () => {
|
|
2761
2768
|
var e;
|
|
@@ -2766,7 +2773,7 @@ class yi {
|
|
|
2766
2773
|
* @param {UIElementData} elementData
|
|
2767
2774
|
*/
|
|
2768
2775
|
registerElement(t) {
|
|
2769
|
-
this.isRegistered ? this.items.push(new
|
|
2776
|
+
this.isRegistered ? this.items.push(new mi(this.pswp, t)) : this.uiElementsData.push(t);
|
|
2770
2777
|
}
|
|
2771
2778
|
/**
|
|
2772
2779
|
* Fired each time zoom or pan position is changed.
|
|
@@ -2798,7 +2805,7 @@ class yi {
|
|
|
2798
2805
|
St(t, r <= n), (i.imageClickAction === "zoom" || i.imageClickAction === "zoom-or-close") && t.classList.add("pswp--click-to-zoom");
|
|
2799
2806
|
}
|
|
2800
2807
|
}
|
|
2801
|
-
function
|
|
2808
|
+
function Si(s) {
|
|
2802
2809
|
const t = s.getBoundingClientRect();
|
|
2803
2810
|
return {
|
|
2804
2811
|
x: t.left,
|
|
@@ -2806,7 +2813,7 @@ function _i(s) {
|
|
|
2806
2813
|
w: t.width
|
|
2807
2814
|
};
|
|
2808
2815
|
}
|
|
2809
|
-
function
|
|
2816
|
+
function Li(s, t, e) {
|
|
2810
2817
|
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 = {
|
|
2811
2818
|
x: i.left + a,
|
|
2812
2819
|
y: i.top + l,
|
|
@@ -2819,7 +2826,7 @@ function wi(s, t, e) {
|
|
|
2819
2826
|
y: l
|
|
2820
2827
|
}, c;
|
|
2821
2828
|
}
|
|
2822
|
-
function
|
|
2829
|
+
function Ai(s, t, e) {
|
|
2823
2830
|
const i = e.dispatch("thumbBounds", {
|
|
2824
2831
|
index: s,
|
|
2825
2832
|
itemData: t,
|
|
@@ -2838,9 +2845,9 @@ function bi(s, t, e) {
|
|
|
2838
2845
|
n.querySelector(a)
|
|
2839
2846
|
);
|
|
2840
2847
|
}
|
|
2841
|
-
return r = e.applyFilters("thumbEl", r, t, s), r && (t.thumbCropped ? o =
|
|
2848
|
+
return r = e.applyFilters("thumbEl", r, t, s), r && (t.thumbCropped ? o = Li(r, t.width || t.w || 0, t.height || t.h || 0) : o = Si(r)), e.applyFilters("thumbBounds", o, t, s);
|
|
2842
2849
|
}
|
|
2843
|
-
let
|
|
2850
|
+
let Ei = class {
|
|
2844
2851
|
/**
|
|
2845
2852
|
* @param {T} type
|
|
2846
2853
|
* @param {PhotoSwipeEventsMap[T]} [details]
|
|
@@ -2851,7 +2858,7 @@ let Si = class {
|
|
|
2851
2858
|
preventDefault() {
|
|
2852
2859
|
this.defaultPrevented = !0;
|
|
2853
2860
|
}
|
|
2854
|
-
},
|
|
2861
|
+
}, Ci = class {
|
|
2855
2862
|
constructor() {
|
|
2856
2863
|
this._listeners = {}, this._filters = {}, this.pswp = void 0, this.options = void 0;
|
|
2857
2864
|
}
|
|
@@ -2918,13 +2925,13 @@ let Si = class {
|
|
|
2918
2925
|
return this.pswp.dispatch(t, e);
|
|
2919
2926
|
const n = (
|
|
2920
2927
|
/** @type {AugmentedEvent<T>} */
|
|
2921
|
-
new
|
|
2928
|
+
new Ei(t, e)
|
|
2922
2929
|
);
|
|
2923
2930
|
return (i = this._listeners[t]) === null || i === void 0 || i.forEach((o) => {
|
|
2924
2931
|
o.call(this, n);
|
|
2925
2932
|
}), n;
|
|
2926
2933
|
}
|
|
2927
|
-
},
|
|
2934
|
+
}, xi = class {
|
|
2928
2935
|
/**
|
|
2929
2936
|
* @param {string | false} imageSrc
|
|
2930
2937
|
* @param {HTMLElement} container
|
|
@@ -2944,13 +2951,13 @@ let Si = class {
|
|
|
2944
2951
|
* @param {number} height
|
|
2945
2952
|
*/
|
|
2946
2953
|
setDisplayedSize(t, e) {
|
|
2947
|
-
this.element && (this.element.tagName === "IMG" ? (
|
|
2954
|
+
this.element && (this.element.tagName === "IMG" ? (st(this.element, 250, "auto"), this.element.style.transformOrigin = "0 0", this.element.style.transform = G(0, 0, t / 250)) : st(this.element, t, e));
|
|
2948
2955
|
}
|
|
2949
2956
|
destroy() {
|
|
2950
2957
|
var t;
|
|
2951
2958
|
(t = this.element) !== null && t !== void 0 && t.parentNode && this.element.remove(), this.element = null;
|
|
2952
2959
|
}
|
|
2953
|
-
},
|
|
2960
|
+
}, Pi = class {
|
|
2954
2961
|
/**
|
|
2955
2962
|
* @param {SlideData} itemData Slide data
|
|
2956
2963
|
* @param {PhotoSwipeBase} instance PhotoSwipe or PhotoSwipeLightbox instance
|
|
@@ -2985,7 +2992,7 @@ let Si = class {
|
|
|
2985
2992
|
this.data.msrc && this.slide.isFirstSlide ? this.data.msrc : !1,
|
|
2986
2993
|
this
|
|
2987
2994
|
);
|
|
2988
|
-
this.placeholder = new
|
|
2995
|
+
this.placeholder = new xi(i, this.slide.container);
|
|
2989
2996
|
}
|
|
2990
2997
|
this.element && !e || this.instance.dispatch("contentLoad", {
|
|
2991
2998
|
content: this,
|
|
@@ -3073,7 +3080,7 @@ let Si = class {
|
|
|
3073
3080
|
content: this,
|
|
3074
3081
|
width: t,
|
|
3075
3082
|
height: e
|
|
3076
|
-
}).defaultPrevented && (
|
|
3083
|
+
}).defaultPrevented && (st(this.element, t, e), this.isImageContent() && !this.isError()))) {
|
|
3077
3084
|
const i = !this.displayedImageWidth && t;
|
|
3078
3085
|
this.displayedImageWidth = t, this.displayedImageHeight = e, i ? this.loadImage(!1) : this.updateSrcsetSizes(), this.slide && this.instance.dispatch("imageSizeChange", {
|
|
3079
3086
|
slide: this.slide,
|
|
@@ -3195,7 +3202,7 @@ let Si = class {
|
|
|
3195
3202
|
}).defaultPrevented || (this.slide && this.element && !this.element.parentNode && this.slide.container.appendChild(this.element), (this.state === P.LOADED || this.state === P.ERROR) && this.removePlaceholder()));
|
|
3196
3203
|
}
|
|
3197
3204
|
};
|
|
3198
|
-
const
|
|
3205
|
+
const Ii = 5;
|
|
3199
3206
|
function kt(s, t, e) {
|
|
3200
3207
|
const i = t.createContentFromData(s, e);
|
|
3201
3208
|
let n;
|
|
@@ -3211,7 +3218,7 @@ function kt(s, t, e) {
|
|
|
3211
3218
|
}
|
|
3212
3219
|
return i.lazyLoad(), n && i.setDisplayedSize(Math.ceil(i.width * n.initial), Math.ceil(i.height * n.initial)), i;
|
|
3213
3220
|
}
|
|
3214
|
-
function
|
|
3221
|
+
function Ti(s, t) {
|
|
3215
3222
|
const e = t.getItemData(s);
|
|
3216
3223
|
if (!t.dispatch("lazyLoadSlide", {
|
|
3217
3224
|
index: s,
|
|
@@ -3219,12 +3226,12 @@ function xi(s, t) {
|
|
|
3219
3226
|
}).defaultPrevented)
|
|
3220
3227
|
return kt(e, t, s);
|
|
3221
3228
|
}
|
|
3222
|
-
class
|
|
3229
|
+
class zi {
|
|
3223
3230
|
/**
|
|
3224
3231
|
* @param {PhotoSwipe} pswp
|
|
3225
3232
|
*/
|
|
3226
3233
|
constructor(t) {
|
|
3227
|
-
this.pswp = t, this.limit = Math.max(t.options.preload[0] + t.options.preload[1] + 1,
|
|
3234
|
+
this.pswp = t, this.limit = Math.max(t.options.preload[0] + t.options.preload[1] + 1, Ii), this._cachedItems = [];
|
|
3228
3235
|
}
|
|
3229
3236
|
/**
|
|
3230
3237
|
* Lazy load nearby slides based on `preload` option.
|
|
@@ -3252,7 +3259,7 @@ class Pi {
|
|
|
3252
3259
|
loadSlideByIndex(t) {
|
|
3253
3260
|
const e = this.pswp.getLoopedIndex(t);
|
|
3254
3261
|
let i = this.getContentByIndex(e);
|
|
3255
|
-
i || (i =
|
|
3262
|
+
i || (i = Ti(e, this.pswp), i && this.addToCache(i));
|
|
3256
3263
|
}
|
|
3257
3264
|
/**
|
|
3258
3265
|
* @param {Slide} slide
|
|
@@ -3291,7 +3298,7 @@ class Pi {
|
|
|
3291
3298
|
this._cachedItems.forEach((t) => t.destroy()), this._cachedItems = [];
|
|
3292
3299
|
}
|
|
3293
3300
|
}
|
|
3294
|
-
let
|
|
3301
|
+
let Mi = class extends Ci {
|
|
3295
3302
|
/**
|
|
3296
3303
|
* Get total number of slides
|
|
3297
3304
|
*
|
|
@@ -3314,7 +3321,7 @@ let Ti = class extends Li {
|
|
|
3314
3321
|
* @returns {Content}
|
|
3315
3322
|
*/
|
|
3316
3323
|
createContentFromData(t, e) {
|
|
3317
|
-
return new
|
|
3324
|
+
return new Pi(t, this, e);
|
|
3318
3325
|
}
|
|
3319
3326
|
/**
|
|
3320
3327
|
* Get item data by index.
|
|
@@ -3348,7 +3355,7 @@ let Ti = class extends Li {
|
|
|
3348
3355
|
*/
|
|
3349
3356
|
_getGalleryDOMElements(t) {
|
|
3350
3357
|
var e, i;
|
|
3351
|
-
return (e = this.options) !== null && e !== void 0 && e.children || (i = this.options) !== null && i !== void 0 && i.childSelector ?
|
|
3358
|
+
return (e = this.options) !== null && e !== void 0 && e.children || (i = this.options) !== null && i !== void 0 && i.childSelector ? Ze(this.options.children, this.options.childSelector, t) || [] : [t];
|
|
3352
3359
|
}
|
|
3353
3360
|
/**
|
|
3354
3361
|
* Converts DOM element to item data object.
|
|
@@ -3386,7 +3393,7 @@ let Ti = class extends Li {
|
|
|
3386
3393
|
}
|
|
3387
3394
|
};
|
|
3388
3395
|
const k = 3e-3;
|
|
3389
|
-
class
|
|
3396
|
+
class Oi {
|
|
3390
3397
|
/**
|
|
3391
3398
|
* @param {PhotoSwipe} pswp
|
|
3392
3399
|
*/
|
|
@@ -3439,7 +3446,7 @@ class Ii {
|
|
|
3439
3446
|
_start() {
|
|
3440
3447
|
this.isOpening && this._useAnimation && this._placeholder && this._placeholder.tagName === "IMG" ? new Promise((t) => {
|
|
3441
3448
|
let e = !1, i = !0;
|
|
3442
|
-
|
|
3449
|
+
Be(
|
|
3443
3450
|
/** @type {HTMLImageElement} */
|
|
3444
3451
|
this._placeholder
|
|
3445
3452
|
).finally(() => {
|
|
@@ -3530,7 +3537,7 @@ class Ii {
|
|
|
3530
3537
|
o[e] = i, n.startTransition(o);
|
|
3531
3538
|
}
|
|
3532
3539
|
}
|
|
3533
|
-
const
|
|
3540
|
+
const Di = {
|
|
3534
3541
|
allowPanToNext: !0,
|
|
3535
3542
|
spacing: 0.1,
|
|
3536
3543
|
loop: !0,
|
|
@@ -3557,7 +3564,7 @@ const Mi = {
|
|
|
3557
3564
|
preload: [1, 2],
|
|
3558
3565
|
easing: "cubic-bezier(.4,0,.22,1)"
|
|
3559
3566
|
};
|
|
3560
|
-
class
|
|
3567
|
+
class $i extends Mi {
|
|
3561
3568
|
/**
|
|
3562
3569
|
* @param {PhotoSwipeOptions} [options]
|
|
3563
3570
|
*/
|
|
@@ -3571,7 +3578,7 @@ class zi extends Ti {
|
|
|
3571
3578
|
}, this.viewportSize = {
|
|
3572
3579
|
x: 0,
|
|
3573
3580
|
y: 0
|
|
3574
|
-
}, 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
|
|
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 ke(), this.animations = new hi(), this.mainScroll = new ii(this), this.gestures = new ti(this), this.opener = new Oi(this), this.keyboard = new ni(this), this.contentLoader = new zi(this);
|
|
3575
3582
|
}
|
|
3576
3583
|
/** @returns {boolean} */
|
|
3577
3584
|
init() {
|
|
@@ -3579,7 +3586,7 @@ class zi extends Ti {
|
|
|
3579
3586
|
return !1;
|
|
3580
3587
|
this.isOpen = !0, this.dispatch("init"), this.dispatch("beforeOpen"), this._createMainStructure();
|
|
3581
3588
|
let t = "pswp--open";
|
|
3582
|
-
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
|
|
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 ui(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", {
|
|
3583
3590
|
index: this.currIndex,
|
|
3584
3591
|
data: this._initialItemData,
|
|
3585
3592
|
slide: void 0
|
|
@@ -3698,7 +3705,7 @@ class zi extends Ti {
|
|
|
3698
3705
|
if (!this.canLoop() && (e < 0 || e >= this.getNumItems()))
|
|
3699
3706
|
return;
|
|
3700
3707
|
const n = this.getItemData(e);
|
|
3701
|
-
t.slide = new
|
|
3708
|
+
t.slide = new qe(n, e, this), e === this.currIndex && (this.currSlide = t.slide), t.slide.append(t.el);
|
|
3702
3709
|
}
|
|
3703
3710
|
/** @returns {Point} */
|
|
3704
3711
|
getViewportCenterPoint() {
|
|
@@ -3768,7 +3775,7 @@ class zi extends Ti {
|
|
|
3768
3775
|
* @private
|
|
3769
3776
|
*/
|
|
3770
3777
|
_createMainStructure() {
|
|
3771
|
-
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
|
|
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 bi(this), this.ui.init(), (this.options.appendToEl || document.body).appendChild(this.element);
|
|
3772
3779
|
}
|
|
3773
3780
|
/**
|
|
3774
3781
|
* Get position and dimensions of small thumbnail
|
|
@@ -3779,7 +3786,7 @@ class zi extends Ti {
|
|
|
3779
3786
|
* @returns {Bounds | undefined}
|
|
3780
3787
|
*/
|
|
3781
3788
|
getThumbBounds() {
|
|
3782
|
-
return
|
|
3789
|
+
return Ai(this.currIndex, this.currSlide ? this.currSlide.data : this._initialItemData, this);
|
|
3783
3790
|
}
|
|
3784
3791
|
/**
|
|
3785
3792
|
* If the PhotoSwipe can have continuous loop
|
|
@@ -3795,29 +3802,29 @@ class zi extends Ti {
|
|
|
3795
3802
|
*/
|
|
3796
3803
|
_prepareOptions(t) {
|
|
3797
3804
|
return window.matchMedia("(prefers-reduced-motion), (update: slow)").matches && (t.showHideAnimationType = "none", t.zoomAnimationDuration = 0), {
|
|
3798
|
-
...
|
|
3805
|
+
...Di,
|
|
3799
3806
|
...t
|
|
3800
3807
|
};
|
|
3801
3808
|
}
|
|
3802
3809
|
}
|
|
3803
|
-
function
|
|
3810
|
+
function q(s, t, e) {
|
|
3804
3811
|
const i = document.createElement(t);
|
|
3805
3812
|
return s && (i.className = s), e && e.appendChild(i), i;
|
|
3806
3813
|
}
|
|
3807
|
-
function
|
|
3814
|
+
function Ri(s, t, e) {
|
|
3808
3815
|
let i = `translate3d(${s}px,0px,0)`;
|
|
3809
3816
|
return e !== void 0 && (i += ` scale3d(${e},${e},1)`), i;
|
|
3810
3817
|
}
|
|
3811
|
-
function
|
|
3818
|
+
function nt(s, t, e) {
|
|
3812
3819
|
s.style.width = typeof t == "number" ? `${t}px` : t, s.style.height = typeof e == "number" ? `${e}px` : e;
|
|
3813
3820
|
}
|
|
3814
|
-
const
|
|
3821
|
+
const I = {
|
|
3815
3822
|
IDLE: "idle",
|
|
3816
3823
|
LOADING: "loading",
|
|
3817
3824
|
LOADED: "loaded",
|
|
3818
3825
|
ERROR: "error"
|
|
3819
3826
|
};
|
|
3820
|
-
function
|
|
3827
|
+
function Bi(s) {
|
|
3821
3828
|
return "button" in s && s.button === 1 || s.ctrlKey || s.metaKey || s.altKey || s.shiftKey;
|
|
3822
3829
|
}
|
|
3823
3830
|
function H(s, t, e = document) {
|
|
@@ -3832,13 +3839,13 @@ function H(s, t, e = document) {
|
|
|
3832
3839
|
}
|
|
3833
3840
|
return i;
|
|
3834
3841
|
}
|
|
3835
|
-
function
|
|
3842
|
+
function Fi(s) {
|
|
3836
3843
|
return typeof s == "function" && s.prototype && s.prototype.goTo;
|
|
3837
3844
|
}
|
|
3838
3845
|
function Lt() {
|
|
3839
3846
|
return !!(navigator.vendor && navigator.vendor.match(/apple/i));
|
|
3840
3847
|
}
|
|
3841
|
-
class
|
|
3848
|
+
class Zi {
|
|
3842
3849
|
/**
|
|
3843
3850
|
* @param {T} type
|
|
3844
3851
|
* @param {PhotoSwipeEventsMap[T]} [details]
|
|
@@ -3850,7 +3857,7 @@ class Ri {
|
|
|
3850
3857
|
this.defaultPrevented = !0;
|
|
3851
3858
|
}
|
|
3852
3859
|
}
|
|
3853
|
-
class
|
|
3860
|
+
class ki {
|
|
3854
3861
|
constructor() {
|
|
3855
3862
|
this._listeners = {}, this._filters = {}, this.pswp = void 0, this.options = void 0;
|
|
3856
3863
|
}
|
|
@@ -3917,20 +3924,20 @@ class Bi {
|
|
|
3917
3924
|
return this.pswp.dispatch(t, e);
|
|
3918
3925
|
const n = (
|
|
3919
3926
|
/** @type {AugmentedEvent<T>} */
|
|
3920
|
-
new
|
|
3927
|
+
new Zi(t, e)
|
|
3921
3928
|
);
|
|
3922
3929
|
return (i = this._listeners[t]) === null || i === void 0 || i.forEach((o) => {
|
|
3923
3930
|
o.call(this, n);
|
|
3924
3931
|
}), n;
|
|
3925
3932
|
}
|
|
3926
3933
|
}
|
|
3927
|
-
class
|
|
3934
|
+
class Ni {
|
|
3928
3935
|
/**
|
|
3929
3936
|
* @param {string | false} imageSrc
|
|
3930
3937
|
* @param {HTMLElement} container
|
|
3931
3938
|
*/
|
|
3932
3939
|
constructor(t, e) {
|
|
3933
|
-
if (this.element =
|
|
3940
|
+
if (this.element = q("pswp__img pswp__img--placeholder", t ? "img" : "div", e), t) {
|
|
3934
3941
|
const i = (
|
|
3935
3942
|
/** @type {HTMLImageElement} */
|
|
3936
3943
|
this.element
|
|
@@ -3944,21 +3951,21 @@ class Fi {
|
|
|
3944
3951
|
* @param {number} height
|
|
3945
3952
|
*/
|
|
3946
3953
|
setDisplayedSize(t, e) {
|
|
3947
|
-
this.element && (this.element.tagName === "IMG" ? (
|
|
3954
|
+
this.element && (this.element.tagName === "IMG" ? (nt(this.element, 250, "auto"), this.element.style.transformOrigin = "0 0", this.element.style.transform = Ri(0, 0, t / 250)) : nt(this.element, t, e));
|
|
3948
3955
|
}
|
|
3949
3956
|
destroy() {
|
|
3950
3957
|
var t;
|
|
3951
3958
|
(t = this.element) !== null && t !== void 0 && t.parentNode && this.element.remove(), this.element = null;
|
|
3952
3959
|
}
|
|
3953
3960
|
}
|
|
3954
|
-
class
|
|
3961
|
+
class qi {
|
|
3955
3962
|
/**
|
|
3956
3963
|
* @param {SlideData} itemData Slide data
|
|
3957
3964
|
* @param {PhotoSwipeBase} instance PhotoSwipe or PhotoSwipeLightbox instance
|
|
3958
3965
|
* @param {number} index
|
|
3959
3966
|
*/
|
|
3960
3967
|
constructor(t, e, i) {
|
|
3961
|
-
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 =
|
|
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 = I.IDLE, this.data.type ? this.type = this.data.type : this.data.src ? this.type = "image" : this.type = "html", this.instance.dispatch("contentInit", {
|
|
3962
3969
|
content: this
|
|
3963
3970
|
});
|
|
3964
3971
|
}
|
|
@@ -3986,12 +3993,12 @@ class Zi {
|
|
|
3986
3993
|
this.data.msrc && this.slide.isFirstSlide ? this.data.msrc : !1,
|
|
3987
3994
|
this
|
|
3988
3995
|
);
|
|
3989
|
-
this.placeholder = new
|
|
3996
|
+
this.placeholder = new Ni(i, this.slide.container);
|
|
3990
3997
|
}
|
|
3991
3998
|
this.element && !e || this.instance.dispatch("contentLoad", {
|
|
3992
3999
|
content: this,
|
|
3993
4000
|
isLazy: t
|
|
3994
|
-
}).defaultPrevented || (this.isImageContent() ? (this.element =
|
|
4001
|
+
}).defaultPrevented || (this.isImageContent() ? (this.element = q("pswp__img", "img"), this.displayedImageWidth && this.loadImage(t)) : (this.element = q("pswp__content", "div"), this.element.innerHTML = this.data.html || ""), e && this.slide && this.slide.updateContentSize(!0));
|
|
3995
4002
|
}
|
|
3996
4003
|
/**
|
|
3997
4004
|
* Preload image
|
|
@@ -4009,7 +4016,7 @@ class Zi {
|
|
|
4009
4016
|
/** @type HTMLImageElement */
|
|
4010
4017
|
this.element
|
|
4011
4018
|
);
|
|
4012
|
-
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 =
|
|
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 = I.LOADING, n.complete ? this.onLoaded() : (n.onload = () => {
|
|
4013
4020
|
this.onLoaded();
|
|
4014
4021
|
}, n.onerror = () => {
|
|
4015
4022
|
this.onError();
|
|
@@ -4027,16 +4034,16 @@ class Zi {
|
|
|
4027
4034
|
* Content load success handler
|
|
4028
4035
|
*/
|
|
4029
4036
|
onLoaded() {
|
|
4030
|
-
this.state =
|
|
4037
|
+
this.state = I.LOADED, this.slide && this.element && (this.instance.dispatch("loadComplete", {
|
|
4031
4038
|
slide: this.slide,
|
|
4032
4039
|
content: this
|
|
4033
|
-
}), this.slide.isActive && this.slide.heavyAppended && !this.element.parentNode && (this.append(), this.slide.updateContentSize(!0)), (this.state ===
|
|
4040
|
+
}), this.slide.isActive && this.slide.heavyAppended && !this.element.parentNode && (this.append(), this.slide.updateContentSize(!0)), (this.state === I.LOADED || this.state === I.ERROR) && this.removePlaceholder());
|
|
4034
4041
|
}
|
|
4035
4042
|
/**
|
|
4036
4043
|
* Content load error handler
|
|
4037
4044
|
*/
|
|
4038
4045
|
onError() {
|
|
4039
|
-
this.state =
|
|
4046
|
+
this.state = I.ERROR, this.slide && (this.displayError(), this.instance.dispatch("loadComplete", {
|
|
4040
4047
|
slide: this.slide,
|
|
4041
4048
|
isError: !0,
|
|
4042
4049
|
content: this
|
|
@@ -4049,13 +4056,13 @@ class Zi {
|
|
|
4049
4056
|
* @returns {Boolean} If the content is currently loading
|
|
4050
4057
|
*/
|
|
4051
4058
|
isLoading() {
|
|
4052
|
-
return this.instance.applyFilters("isContentLoading", this.state ===
|
|
4059
|
+
return this.instance.applyFilters("isContentLoading", this.state === I.LOADING, this);
|
|
4053
4060
|
}
|
|
4054
4061
|
/**
|
|
4055
4062
|
* @returns {Boolean} If the content is in error state
|
|
4056
4063
|
*/
|
|
4057
4064
|
isError() {
|
|
4058
|
-
return this.state ===
|
|
4065
|
+
return this.state === I.ERROR;
|
|
4059
4066
|
}
|
|
4060
4067
|
/**
|
|
4061
4068
|
* @returns {boolean} If the content is image
|
|
@@ -4074,7 +4081,7 @@ class Zi {
|
|
|
4074
4081
|
content: this,
|
|
4075
4082
|
width: t,
|
|
4076
4083
|
height: e
|
|
4077
|
-
}).defaultPrevented && (
|
|
4084
|
+
}).defaultPrevented && (nt(this.element, t, e), this.isImageContent() && !this.isError()))) {
|
|
4078
4085
|
const i = !this.displayedImageWidth && t;
|
|
4079
4086
|
this.displayedImageWidth = t, this.displayedImageHeight = e, i ? this.loadImage(!1) : this.updateSrcsetSizes(), this.slide && this.instance.dispatch("imageSizeChange", {
|
|
4080
4087
|
slide: this.slide,
|
|
@@ -4088,7 +4095,7 @@ class Zi {
|
|
|
4088
4095
|
* @returns {boolean} If the content can be zoomed
|
|
4089
4096
|
*/
|
|
4090
4097
|
isZoomable() {
|
|
4091
|
-
return this.instance.applyFilters("isContentZoomable", this.isImageContent() && this.state !==
|
|
4098
|
+
return this.instance.applyFilters("isContentZoomable", this.isImageContent() && this.state !== I.ERROR, this);
|
|
4092
4099
|
}
|
|
4093
4100
|
/**
|
|
4094
4101
|
* Update image srcset sizes attribute based on width and height
|
|
@@ -4136,9 +4143,9 @@ class Zi {
|
|
|
4136
4143
|
displayError() {
|
|
4137
4144
|
if (this.slide) {
|
|
4138
4145
|
var t, e;
|
|
4139
|
-
let i =
|
|
4146
|
+
let i = q("pswp__error-msg", "div");
|
|
4140
4147
|
i.innerText = (t = (e = this.instance.options) === null || e === void 0 ? void 0 : e.errorMsg) !== null && t !== void 0 ? t : "", i = /** @type {HTMLDivElement} */
|
|
4141
|
-
this.instance.applyFilters("contentErrorElement", i, this), this.element =
|
|
4148
|
+
this.instance.applyFilters("contentErrorElement", i, this), this.element = q("pswp__content pswp__error-msg-container", "div"), this.element.appendChild(i), this.slide.container.innerText = "", this.slide.container.appendChild(this.element), this.slide.updateContentSize(!0), this.removePlaceholder();
|
|
4142
4149
|
}
|
|
4143
4150
|
}
|
|
4144
4151
|
/**
|
|
@@ -4147,7 +4154,7 @@ class Zi {
|
|
|
4147
4154
|
append() {
|
|
4148
4155
|
if (this.isAttached || !this.element)
|
|
4149
4156
|
return;
|
|
4150
|
-
if (this.isAttached = !0, this.state ===
|
|
4157
|
+
if (this.isAttached = !0, this.state === I.ERROR) {
|
|
4151
4158
|
this.displayError();
|
|
4152
4159
|
return;
|
|
4153
4160
|
}
|
|
@@ -4193,10 +4200,10 @@ class Zi {
|
|
|
4193
4200
|
appendImage() {
|
|
4194
4201
|
this.isAttached && (this.instance.dispatch("contentAppendImage", {
|
|
4195
4202
|
content: this
|
|
4196
|
-
}).defaultPrevented || (this.slide && this.element && !this.element.parentNode && this.slide.container.appendChild(this.element), (this.state ===
|
|
4203
|
+
}).defaultPrevented || (this.slide && this.element && !this.element.parentNode && this.slide.container.appendChild(this.element), (this.state === I.LOADED || this.state === I.ERROR) && this.removePlaceholder()));
|
|
4197
4204
|
}
|
|
4198
4205
|
}
|
|
4199
|
-
function
|
|
4206
|
+
function Hi(s, t) {
|
|
4200
4207
|
if (s.getViewportSizeFn) {
|
|
4201
4208
|
const e = s.getViewportSizeFn(s, t);
|
|
4202
4209
|
if (e)
|
|
@@ -4223,14 +4230,14 @@ function K(s, t, e, i, n) {
|
|
|
4223
4230
|
}
|
|
4224
4231
|
return Number(o) || 0;
|
|
4225
4232
|
}
|
|
4226
|
-
function
|
|
4233
|
+
function Wi(s, t, e, i) {
|
|
4227
4234
|
return {
|
|
4228
4235
|
x: t.x - K("left", s, t, e, i) - K("right", s, t, e, i),
|
|
4229
4236
|
y: t.y - K("top", s, t, e, i) - K("bottom", s, t, e, i)
|
|
4230
4237
|
};
|
|
4231
4238
|
}
|
|
4232
4239
|
const At = 4e3;
|
|
4233
|
-
class
|
|
4240
|
+
class Vi {
|
|
4234
4241
|
/**
|
|
4235
4242
|
* @param {PhotoSwipeOptions} options PhotoSwipe options
|
|
4236
4243
|
* @param {SlideData} itemData Slide data
|
|
@@ -4310,30 +4317,30 @@ class Ni {
|
|
|
4310
4317
|
return this._parseZoomLevelOption("max") || Math.max(1, this.fit * 4);
|
|
4311
4318
|
}
|
|
4312
4319
|
}
|
|
4313
|
-
function
|
|
4320
|
+
function Nt(s, t, e) {
|
|
4314
4321
|
const i = t.createContentFromData(s, e);
|
|
4315
4322
|
let n;
|
|
4316
4323
|
const {
|
|
4317
4324
|
options: o
|
|
4318
4325
|
} = t;
|
|
4319
4326
|
if (o) {
|
|
4320
|
-
n = new
|
|
4327
|
+
n = new Vi(o, s, -1);
|
|
4321
4328
|
let r;
|
|
4322
|
-
t.pswp ? r = t.pswp.viewportSize : r =
|
|
4323
|
-
const a =
|
|
4329
|
+
t.pswp ? r = t.pswp.viewportSize : r = Hi(o, t);
|
|
4330
|
+
const a = Wi(o, r, s, e);
|
|
4324
4331
|
n.update(i.width, i.height, a);
|
|
4325
4332
|
}
|
|
4326
4333
|
return i.lazyLoad(), n && i.setDisplayedSize(Math.ceil(i.width * n.initial), Math.ceil(i.height * n.initial)), i;
|
|
4327
4334
|
}
|
|
4328
|
-
function
|
|
4335
|
+
function ji(s, t) {
|
|
4329
4336
|
const e = t.getItemData(s);
|
|
4330
4337
|
if (!t.dispatch("lazyLoadSlide", {
|
|
4331
4338
|
index: s,
|
|
4332
4339
|
itemData: e
|
|
4333
4340
|
}).defaultPrevented)
|
|
4334
|
-
return
|
|
4341
|
+
return Nt(e, t, s);
|
|
4335
4342
|
}
|
|
4336
|
-
class
|
|
4343
|
+
class Gi extends ki {
|
|
4337
4344
|
/**
|
|
4338
4345
|
* Get total number of slides
|
|
4339
4346
|
*
|
|
@@ -4356,7 +4363,7 @@ class Wi extends Bi {
|
|
|
4356
4363
|
* @returns {Content}
|
|
4357
4364
|
*/
|
|
4358
4365
|
createContentFromData(t, e) {
|
|
4359
|
-
return new
|
|
4366
|
+
return new qi(t, this, e);
|
|
4360
4367
|
}
|
|
4361
4368
|
/**
|
|
4362
4369
|
* Get item data by index.
|
|
@@ -4424,10 +4431,10 @@ class Wi extends Bi {
|
|
|
4424
4431
|
* @returns {Content} Image that is being decoded or false.
|
|
4425
4432
|
*/
|
|
4426
4433
|
lazyLoadData(t, e) {
|
|
4427
|
-
return
|
|
4434
|
+
return Nt(t, this, e);
|
|
4428
4435
|
}
|
|
4429
4436
|
}
|
|
4430
|
-
class
|
|
4437
|
+
class Ui extends Gi {
|
|
4431
4438
|
/**
|
|
4432
4439
|
* @param {PhotoSwipeOptions} [options]
|
|
4433
4440
|
*/
|
|
@@ -4447,7 +4454,7 @@ class Vi extends Wi {
|
|
|
4447
4454
|
* @param {MouseEvent} e
|
|
4448
4455
|
*/
|
|
4449
4456
|
onThumbnailsClick(t) {
|
|
4450
|
-
if (
|
|
4457
|
+
if (Bi(t) || window.pswp)
|
|
4451
4458
|
return;
|
|
4452
4459
|
let e = {
|
|
4453
4460
|
x: t.clientX,
|
|
@@ -4515,7 +4522,7 @@ class Vi extends Wi {
|
|
|
4515
4522
|
} = this;
|
|
4516
4523
|
e && (i.dataSource = e);
|
|
4517
4524
|
const n = [], o = typeof i.pswpModule;
|
|
4518
|
-
if (
|
|
4525
|
+
if (Fi(i.pswpModule))
|
|
4519
4526
|
n.push(Promise.resolve(
|
|
4520
4527
|
/** @type {Type<PhotoSwipe>} */
|
|
4521
4528
|
i.pswpModule
|
|
@@ -4531,7 +4538,7 @@ class Vi extends Wi {
|
|
|
4531
4538
|
else
|
|
4532
4539
|
throw new Error("pswpModule is not valid");
|
|
4533
4540
|
}
|
|
4534
|
-
typeof i.openPromise == "function" && n.push(i.openPromise()), i.preloadFirstSlide !== !1 && t >= 0 && (this._preloadedContent =
|
|
4541
|
+
typeof i.openPromise == "function" && n.push(i.openPromise()), i.preloadFirstSlide !== !1 && t >= 0 && (this._preloadedContent = ji(t, this));
|
|
4535
4542
|
const r = ++this._uid;
|
|
4536
4543
|
Promise.all(n).then((a) => {
|
|
4537
4544
|
if (this.shouldOpen) {
|
|
@@ -4577,12 +4584,12 @@ class Vi extends Wi {
|
|
|
4577
4584
|
});
|
|
4578
4585
|
}
|
|
4579
4586
|
}
|
|
4580
|
-
const
|
|
4587
|
+
const Ki = () => {
|
|
4581
4588
|
let s = null;
|
|
4582
|
-
return s = new
|
|
4589
|
+
return s = new Ui({
|
|
4583
4590
|
gallery: "#photoswipe-gallery",
|
|
4584
4591
|
children: "a",
|
|
4585
|
-
pswpModule:
|
|
4592
|
+
pswpModule: $i,
|
|
4586
4593
|
zoom: !1,
|
|
4587
4594
|
imageClickAction: "next",
|
|
4588
4595
|
tapAction: "next"
|
|
@@ -4603,7 +4610,7 @@ const ji = () => {
|
|
|
4603
4610
|
}), s.init(), () => {
|
|
4604
4611
|
s && (s.destroy(), s = null);
|
|
4605
4612
|
};
|
|
4606
|
-
}, Et = (s) => Math.min(100, Math.max(0, Math.round(s))),
|
|
4613
|
+
}, Et = (s) => Math.min(100, Math.max(0, Math.round(s))), Xi = () => {
|
|
4607
4614
|
const s = document.querySelector(".js-limit-scroll-progress-bar"), t = document.querySelector(".c-progress__bar"), e = document.querySelector(".c-btn__close-progress");
|
|
4608
4615
|
if (!t && !e)
|
|
4609
4616
|
return;
|
|
@@ -4627,10 +4634,10 @@ const ji = () => {
|
|
|
4627
4634
|
}
|
|
4628
4635
|
}
|
|
4629
4636
|
}
|
|
4630
|
-
},
|
|
4637
|
+
}, Yi = () => {
|
|
4631
4638
|
const s = document.querySelector(".c-progress"), t = document.querySelector(".c-btn__close-progress");
|
|
4632
|
-
(s || t) && window.addEventListener("scroll",
|
|
4633
|
-
},
|
|
4639
|
+
(s || t) && window.addEventListener("scroll", Xi);
|
|
4640
|
+
}, Ji = (s = {}) => {
|
|
4634
4641
|
const { buttonSelector: t = ".c-scroll-to-top" } = s, e = document.querySelector(t), i = e?.querySelector("button");
|
|
4635
4642
|
if (!e || !i)
|
|
4636
4643
|
return;
|
|
@@ -4652,7 +4659,7 @@ const ji = () => {
|
|
|
4652
4659
|
});
|
|
4653
4660
|
};
|
|
4654
4661
|
window.addEventListener("scroll", r), i.addEventListener("click", a), r();
|
|
4655
|
-
},
|
|
4662
|
+
}, Qi = 500, ts = () => {
|
|
4656
4663
|
const s = document.querySelector("#mbrs-comments-container"), t = document.querySelector(".c-scroll-to-top-comment");
|
|
4657
4664
|
if (!s || !t)
|
|
4658
4665
|
return;
|
|
@@ -4668,7 +4675,7 @@ const ji = () => {
|
|
|
4668
4675
|
}, o = () => {
|
|
4669
4676
|
e && (e = !1, window.removeEventListener("scroll", i), t.style.display = "none");
|
|
4670
4677
|
}, r = (u) => {
|
|
4671
|
-
u.offsetHeight >
|
|
4678
|
+
u.offsetHeight > Qi ? n() : o();
|
|
4672
4679
|
}, a = (u) => {
|
|
4673
4680
|
new ResizeObserver(() => {
|
|
4674
4681
|
r(u);
|
|
@@ -4705,7 +4712,7 @@ const ji = () => {
|
|
|
4705
4712
|
) && h.disconnect();
|
|
4706
4713
|
});
|
|
4707
4714
|
h.observe(s, { childList: !0, subtree: !0 });
|
|
4708
|
-
},
|
|
4715
|
+
}, tt = "#page-content", ot = "#text-tooltip", es = ".tooltip-btn", qt = "c-text-tooltip--show", is = [
|
|
4709
4716
|
"#page-content .c-content p",
|
|
4710
4717
|
"#page-content .c-content h2",
|
|
4711
4718
|
"#page-content .c-content h3",
|
|
@@ -4717,17 +4724,17 @@ const ji = () => {
|
|
|
4717
4724
|
"#page-content header span",
|
|
4718
4725
|
"#page-content header h1",
|
|
4719
4726
|
"#page-content header h2"
|
|
4720
|
-
], Ct = (s, t) => s instanceof Element ? t.some((e) => s.matches(e)) : !1,
|
|
4727
|
+
], Ct = (s, t) => s instanceof Element ? t.some((e) => s.matches(e)) : !1, ss = (s, t) => {
|
|
4721
4728
|
const e = s.startContainer.nodeType === Node.ELEMENT_NODE ? s.startContainer : s.startContainer.parentElement, i = s.endContainer.nodeType === Node.ELEMENT_NODE ? s.endContainer : s.endContainer.parentElement;
|
|
4722
4729
|
return !!e && Ct(e, t) || !!i && Ct(i, t);
|
|
4723
|
-
},
|
|
4730
|
+
}, ns = (s) => {
|
|
4724
4731
|
if (!s.focusNode)
|
|
4725
4732
|
return null;
|
|
4726
4733
|
const t = s.anchorNode?.compareDocumentPosition(s.focusNode);
|
|
4727
4734
|
return t ? (t & 4) > 0 : s.anchorOffset < s.focusOffset;
|
|
4728
|
-
},
|
|
4729
|
-
const i = document.querySelector(`${
|
|
4730
|
-
`${
|
|
4735
|
+
}, os = (s, t, e) => {
|
|
4736
|
+
const i = document.querySelector(`${tt} ${ot}`), n = document.querySelector(`${tt}`), o = document.querySelectorAll(
|
|
4737
|
+
`${tt} ${ot} ${es}`
|
|
4731
4738
|
);
|
|
4732
4739
|
if (!i || !n) {
|
|
4733
4740
|
console.warn("Text tooltip : Tooltip or it's parent are not found in the DOM");
|
|
@@ -4737,10 +4744,10 @@ const ji = () => {
|
|
|
4737
4744
|
l.setAttribute("data-selected-text", e);
|
|
4738
4745
|
});
|
|
4739
4746
|
const r = s.getClientRects(), a = r[t ? r.length - 1 : 0];
|
|
4740
|
-
i.style.top = `${a.top - n.getBoundingClientRect().top - (i.offsetHeight + 10)}px`, a.width < i.offsetWidth ? i.style.left = `${a.left - n.getBoundingClientRect().left + a.width / 2 - i.offsetWidth / 2}px` : t ? i.style.left = `${a.left - n.getBoundingClientRect().left + a.width - i.offsetWidth}px` : i.style.left = `${a.left - n.getBoundingClientRect().left}px`, i.classList.add(
|
|
4747
|
+
i.style.top = `${a.top - n.getBoundingClientRect().top - (i.offsetHeight + 10)}px`, a.width < i.offsetWidth ? i.style.left = `${a.left - n.getBoundingClientRect().left + a.width / 2 - i.offsetWidth / 2}px` : t ? i.style.left = `${a.left - n.getBoundingClientRect().left + a.width - i.offsetWidth}px` : i.style.left = `${a.left - n.getBoundingClientRect().left}px`, i.classList.add(qt);
|
|
4741
4748
|
}, xt = () => {
|
|
4742
|
-
const s = document.querySelector(`${
|
|
4743
|
-
s && s.classList.remove(
|
|
4749
|
+
const s = document.querySelector(`${ot}`);
|
|
4750
|
+
s && s.classList.remove(qt);
|
|
4744
4751
|
}, X = ({ type: s }) => {
|
|
4745
4752
|
const t = window.getSelection();
|
|
4746
4753
|
if (s === "selectionchange") {
|
|
@@ -4751,30 +4758,30 @@ const ji = () => {
|
|
|
4751
4758
|
return;
|
|
4752
4759
|
const e = t.getRangeAt(0), i = t.toString().trim();
|
|
4753
4760
|
if (i.length) {
|
|
4754
|
-
const n =
|
|
4755
|
-
n &&
|
|
4761
|
+
const n = ss(e, is), o = ns(t) || !1;
|
|
4762
|
+
n && os(e, o, i);
|
|
4756
4763
|
return;
|
|
4757
4764
|
}
|
|
4758
4765
|
xt();
|
|
4759
|
-
},
|
|
4766
|
+
}, rs = () => {
|
|
4760
4767
|
if (!window?.getSelection) {
|
|
4761
4768
|
console.warn("Selection API isn't supported");
|
|
4762
4769
|
return;
|
|
4763
4770
|
}
|
|
4764
4771
|
document.addEventListener("mouseup", X), document.addEventListener("selectionchange", X), document.addEventListener("touchend", X), document.addEventListener("touchcancel", X);
|
|
4765
|
-
},
|
|
4772
|
+
}, as = (s) => {
|
|
4766
4773
|
const { target: t } = s;
|
|
4767
4774
|
if (t instanceof Element) {
|
|
4768
4775
|
const e = t.closest(".c-search-form--button");
|
|
4769
4776
|
e && (s.preventDefault(), e.classList.remove("c-search-form--button"));
|
|
4770
4777
|
}
|
|
4771
|
-
},
|
|
4778
|
+
}, ls = (s = document.querySelector(
|
|
4772
4779
|
".c-search-form--button"
|
|
4773
4780
|
)) => {
|
|
4774
4781
|
s && s.addEventListener("click", (t) => {
|
|
4775
|
-
|
|
4782
|
+
as(t);
|
|
4776
4783
|
});
|
|
4777
|
-
},
|
|
4784
|
+
}, cs = ({
|
|
4778
4785
|
tabsContainerElement: s,
|
|
4779
4786
|
event: t
|
|
4780
4787
|
}) => {
|
|
@@ -4790,21 +4797,21 @@ const ji = () => {
|
|
|
4790
4797
|
}), n.forEach((a) => {
|
|
4791
4798
|
a.setAttribute("aria-hidden", "true");
|
|
4792
4799
|
}), e.setAttribute("aria-selected", "true"), r && r.removeAttribute("aria-hidden");
|
|
4793
|
-
}, Pt = (s) => s.code === "ArrowLeft" || s.keyCode === 39,
|
|
4800
|
+
}, Pt = (s) => s.code === "ArrowLeft" || s.keyCode === 39, It = (s) => s.code === "ArrowRight" || s.keyCode === 37, ds = (s = document.querySelectorAll(
|
|
4794
4801
|
".js-tabs"
|
|
4795
4802
|
)) => {
|
|
4796
4803
|
s.length > 0 && s.forEach((t) => {
|
|
4797
4804
|
const e = t.querySelectorAll('[role="tab"]');
|
|
4798
4805
|
e.forEach((n) => {
|
|
4799
4806
|
n.addEventListener("click", (o) => {
|
|
4800
|
-
|
|
4807
|
+
cs({ tabsContainerElement: t, event: o });
|
|
4801
4808
|
});
|
|
4802
4809
|
});
|
|
4803
4810
|
const i = t.querySelector('[role="tablist"]');
|
|
4804
4811
|
if (i && e.length > 0) {
|
|
4805
4812
|
let n = 0;
|
|
4806
4813
|
i.addEventListener("keydown", (o) => {
|
|
4807
|
-
o instanceof KeyboardEvent && (Pt(o) ||
|
|
4814
|
+
o instanceof KeyboardEvent && (Pt(o) || It(o)) && (e[n].setAttribute("tabindex", "-1"), Pt(o) ? (n += 1, n >= e.length && (n = 0)) : It(o) && (n -= 1, n < 0 && (n = e.length - 1)), e[n].setAttribute("tabindex", "0"), e[n].focus());
|
|
4808
4815
|
});
|
|
4809
4816
|
}
|
|
4810
4817
|
});
|
|
@@ -4814,13 +4821,13 @@ const ji = () => {
|
|
|
4814
4821
|
}, Ht = () => {
|
|
4815
4822
|
const s = /* @__PURE__ */ new Date(), t = s.getHours(), e = s.getMinutes();
|
|
4816
4823
|
return t * 60 + e;
|
|
4817
|
-
},
|
|
4824
|
+
}, hs = (s, t) => {
|
|
4818
4825
|
const e = Ht();
|
|
4819
4826
|
if (e < s || e > t)
|
|
4820
4827
|
return 0;
|
|
4821
4828
|
const i = t - s;
|
|
4822
4829
|
return (e - s) / i;
|
|
4823
|
-
},
|
|
4830
|
+
}, us = (s) => {
|
|
4824
4831
|
const t = Ht();
|
|
4825
4832
|
let e = null, i = null, n = -1;
|
|
4826
4833
|
return Array.from(s).find((o, r, a) => {
|
|
@@ -4832,14 +4839,14 @@ const ji = () => {
|
|
|
4832
4839
|
const d = Q(l), h = Q(c);
|
|
4833
4840
|
return t >= d && t < h ? (e = l, i = c, n = r, !0) : !1;
|
|
4834
4841
|
}), { currentIntervalStartTime: e, currentIntervalEndTime: i, currentIntervalIndex: n };
|
|
4835
|
-
},
|
|
4842
|
+
}, ps = () => {
|
|
4836
4843
|
const s = document.querySelectorAll(".c-timeline__time");
|
|
4837
4844
|
if (!s || s.length < 2)
|
|
4838
4845
|
return;
|
|
4839
|
-
const t = document.querySelector(".c-timeline__progress-bar"), { currentIntervalStartTime: e, currentIntervalEndTime: i, currentIntervalIndex: n } =
|
|
4846
|
+
const t = document.querySelector(".c-timeline__progress-bar"), { currentIntervalStartTime: e, currentIntervalEndTime: i, currentIntervalIndex: n } = us(s);
|
|
4840
4847
|
if (!e || !i)
|
|
4841
4848
|
return;
|
|
4842
|
-
const o = Q(e), r = Q(i), a =
|
|
4849
|
+
const o = Q(e), r = Q(i), a = hs(o, r);
|
|
4843
4850
|
if (t instanceof HTMLElement) {
|
|
4844
4851
|
if (t.classList.contains("c-timeline__progress-bar--is-desktop") && s.length >= 5) {
|
|
4845
4852
|
const l = "172px / 2";
|
|
@@ -4878,25 +4885,25 @@ const ji = () => {
|
|
|
4878
4885
|
}
|
|
4879
4886
|
}
|
|
4880
4887
|
}
|
|
4881
|
-
},
|
|
4888
|
+
}, rt = "c-icon-item__container--is-highlighted", ms = (s) => {
|
|
4882
4889
|
s.find(
|
|
4883
|
-
(e) => e.classList.contains(
|
|
4884
|
-
)?.classList.remove(
|
|
4885
|
-
},
|
|
4890
|
+
(e) => e.classList.contains(rt)
|
|
4891
|
+
)?.classList.remove(rt);
|
|
4892
|
+
}, fs = () => {
|
|
4886
4893
|
const s = document.querySelector(".c-toolbar");
|
|
4887
4894
|
if (s) {
|
|
4888
4895
|
const t = window.location.origin + window.location.pathname, e = Array.from(s.querySelectorAll(".c-icon-item__container"));
|
|
4889
|
-
|
|
4896
|
+
ms(e), e.find(
|
|
4890
4897
|
(n) => n.querySelector("a")?.getAttribute("href") === t
|
|
4891
|
-
)?.classList.add(
|
|
4898
|
+
)?.classList.add(rt);
|
|
4892
4899
|
}
|
|
4893
|
-
},
|
|
4900
|
+
}, gs = 12, ct = (s) => {
|
|
4894
4901
|
const t = s || document.querySelector(".c-map-towns");
|
|
4895
4902
|
if (!t) {
|
|
4896
4903
|
new MutationObserver((o, r) => {
|
|
4897
4904
|
if (typeof document < "u") {
|
|
4898
4905
|
const a = document.querySelector(".c-map-towns");
|
|
4899
|
-
a && (r.disconnect(),
|
|
4906
|
+
a && (r.disconnect(), ct(a));
|
|
4900
4907
|
}
|
|
4901
4908
|
}).observe(document.body, { childList: !0, subtree: !0 });
|
|
4902
4909
|
return;
|
|
@@ -4926,7 +4933,7 @@ const ji = () => {
|
|
|
4926
4933
|
d.setAttribute("y", `${E}`), l.setAttribute("aria-hidden", "false");
|
|
4927
4934
|
} else
|
|
4928
4935
|
a = !1;
|
|
4929
|
-
}), !a && r <
|
|
4936
|
+
}), !a && r < gs && requestAnimationFrame(() => o(r + 1));
|
|
4930
4937
|
};
|
|
4931
4938
|
return requestAnimationFrame(() => o()), !0;
|
|
4932
4939
|
};
|
|
@@ -4938,7 +4945,7 @@ const ji = () => {
|
|
|
4938
4945
|
childList: !0,
|
|
4939
4946
|
subtree: !0
|
|
4940
4947
|
});
|
|
4941
|
-
},
|
|
4948
|
+
}, vs = {
|
|
4942
4949
|
10: [{ id: "10387", name: "Troyes" }, { id: "10323", name: "Romilly-sur-Seine" }, { id: "10033", name: "Bar-sur-Aube" }],
|
|
4943
4950
|
11: [{ id: "11262", name: "Narbonne" }, { id: "11069", name: "Carcassonne" }, { id: "11076", name: "Castelnaudary" }],
|
|
4944
4951
|
12: [{ id: "12202", name: "Rodez" }, { id: "12145", name: "Millau" }, { id: "12300", name: "Villefranche-de-Rouergue" }],
|
|
@@ -5039,14 +5046,14 @@ const ji = () => {
|
|
|
5039
5046
|
"07": [{ id: "07010", name: "Annonay" }, { id: "07019", name: "Aubenas" }, { id: "07324", name: "Tournon-sur-Rhône" }],
|
|
5040
5047
|
"05": [{ id: "05061", name: "Gap" }, { id: "05023", name: "Briançon" }, { id: "05046", name: "Embrun" }],
|
|
5041
5048
|
"08": [{ id: "08105", name: "Charleville-Mézières" }, { id: "08362", name: "Rethel" }, { id: "08190", name: "Givet" }]
|
|
5042
|
-
},
|
|
5049
|
+
}, ys = /<path\b([^>]*?)\/>/g, _s = /\b([:\w-]+)="([^"]*)"/g, ws = (s) => {
|
|
5043
5050
|
const t = [];
|
|
5044
|
-
for (const e of s.matchAll(
|
|
5051
|
+
for (const e of s.matchAll(ys)) {
|
|
5045
5052
|
const i = e[1];
|
|
5046
5053
|
if (!i)
|
|
5047
5054
|
continue;
|
|
5048
5055
|
const n = /* @__PURE__ */ new Map();
|
|
5049
|
-
for (const c of i.matchAll(
|
|
5056
|
+
for (const c of i.matchAll(_s)) {
|
|
5050
5057
|
const [, d, h] = c;
|
|
5051
5058
|
d && n.set(d, h || "");
|
|
5052
5059
|
}
|
|
@@ -5059,11 +5066,11 @@ const ji = () => {
|
|
|
5059
5066
|
});
|
|
5060
5067
|
}
|
|
5061
5068
|
return t;
|
|
5062
|
-
},
|
|
5069
|
+
}, bs = (s) => new Map(s.map((t) => [t.id, t]));
|
|
5063
5070
|
var Wt = /* @__PURE__ */ ((s) => (s.MOBILE = "mobile", s.DESKTOP = "desktop", s))(Wt || {});
|
|
5064
5071
|
const Y = (s) => {
|
|
5065
5072
|
window.location.href = s;
|
|
5066
|
-
},
|
|
5073
|
+
}, Ss = (s, t, e) => {
|
|
5067
5074
|
const i = e.get(s);
|
|
5068
5075
|
if (i)
|
|
5069
5076
|
return i;
|
|
@@ -5078,7 +5085,7 @@ const Y = (s) => {
|
|
|
5078
5085
|
(o) => o.id.startsWith(`town-${s}`)
|
|
5079
5086
|
);
|
|
5080
5087
|
return e.set(s, n), n;
|
|
5081
|
-
},
|
|
5088
|
+
}, Ls = (s, t) => t.get(s), As = (s) => {
|
|
5082
5089
|
if (s.size > 0)
|
|
5083
5090
|
return;
|
|
5084
5091
|
document.querySelectorAll(
|
|
@@ -5090,13 +5097,13 @@ const Y = (s) => {
|
|
|
5090
5097
|
Array.from(e.classList).filter((n) => n.startsWith("c-map-towns__path--"))
|
|
5091
5098
|
);
|
|
5092
5099
|
});
|
|
5093
|
-
},
|
|
5100
|
+
}, Es = (s, t) => {
|
|
5094
5101
|
const e = s.id, i = s.url, n = s.name;
|
|
5095
5102
|
if (!e || !i)
|
|
5096
5103
|
return null;
|
|
5097
5104
|
const o = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
5098
5105
|
o.setAttribute("d", s.path), o.setAttribute("class", "c-map-towns__path c-map-towns__zoom-town"), o.setAttribute("data-url", i);
|
|
5099
|
-
const r =
|
|
5106
|
+
const r = Ls(e, t);
|
|
5100
5107
|
if (r && r.forEach((a) => {
|
|
5101
5108
|
o.classList.add(a);
|
|
5102
5109
|
}), n) {
|
|
@@ -5104,15 +5111,15 @@ const Y = (s) => {
|
|
|
5104
5111
|
a.textContent = n, o.appendChild(a);
|
|
5105
5112
|
}
|
|
5106
5113
|
return o;
|
|
5107
|
-
},
|
|
5114
|
+
}, Cs = (s, t) => {
|
|
5108
5115
|
const e = document.createDocumentFragment();
|
|
5109
5116
|
return s.forEach((i) => {
|
|
5110
|
-
const n =
|
|
5117
|
+
const n = Es(i, t);
|
|
5111
5118
|
n && e.appendChild(n);
|
|
5112
5119
|
}), e;
|
|
5113
|
-
},
|
|
5120
|
+
}, xs = (s, t) => {
|
|
5114
5121
|
s.replaceChildren(t);
|
|
5115
|
-
},
|
|
5122
|
+
}, Ps = (s, t, e) => {
|
|
5116
5123
|
const i = document.createElementNS("http://www.w3.org/2000/svg", "g");
|
|
5117
5124
|
i.setAttribute("class", "js-city-marker c-map-towns__city-marker"), i.setAttribute("aria-hidden", "true"), i.setAttribute("data-scale", e.toString());
|
|
5118
5125
|
const n = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
@@ -5123,7 +5130,7 @@ const Y = (s) => {
|
|
|
5123
5130
|
r.setAttribute("class", "js-city-bg"), r.setAttribute("fill", "white"), r.setAttribute("rx", "4"), r.setAttribute("ry", "4");
|
|
5124
5131
|
const a = document.createElementNS("http://www.w3.org/2000/svg", "text");
|
|
5125
5132
|
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;
|
|
5126
|
-
},
|
|
5133
|
+
}, Is = (s, t) => {
|
|
5127
5134
|
const e = t.getBBox(), i = 5, n = e.width + i * 2, o = e.height + i * 2;
|
|
5128
5135
|
s.setAttribute(
|
|
5129
5136
|
"viewBox",
|
|
@@ -5132,13 +5139,13 @@ const Y = (s) => {
|
|
|
5132
5139
|
const r = s.clientWidth || 800, a = s.clientHeight || 600;
|
|
5133
5140
|
return Math.max(n / r, o / a);
|
|
5134
5141
|
};
|
|
5135
|
-
let
|
|
5136
|
-
const
|
|
5137
|
-
if (
|
|
5142
|
+
let et = !1;
|
|
5143
|
+
const at = () => {
|
|
5144
|
+
if (et)
|
|
5138
5145
|
return;
|
|
5139
5146
|
if (!document.querySelector(".c-map-towns")) {
|
|
5140
5147
|
new MutationObserver((b, E) => {
|
|
5141
|
-
typeof document < "u" && document.querySelector(".c-map-towns") && (E.disconnect(),
|
|
5148
|
+
typeof document < "u" && document.querySelector(".c-map-towns") && (E.disconnect(), at());
|
|
5142
5149
|
}).observe(document.body, { childList: !0, subtree: !0 });
|
|
5143
5150
|
return;
|
|
5144
5151
|
}
|
|
@@ -5152,46 +5159,46 @@ const lt = () => {
|
|
|
5152
5159
|
$ && Y($);
|
|
5153
5160
|
return;
|
|
5154
5161
|
}
|
|
5155
|
-
const
|
|
5156
|
-
if (
|
|
5157
|
-
Y(
|
|
5162
|
+
const z = b.closest(".c-map-towns__zoom-item")?.getAttribute("data-city-url");
|
|
5163
|
+
if (z) {
|
|
5164
|
+
Y(z);
|
|
5158
5165
|
return;
|
|
5159
5166
|
}
|
|
5160
|
-
const
|
|
5161
|
-
|
|
5167
|
+
const M = b.closest(".c-map-towns__dept-trigger")?.getAttribute("data-url");
|
|
5168
|
+
M && Y(M);
|
|
5162
5169
|
};
|
|
5163
5170
|
if (t) {
|
|
5164
|
-
e?.addEventListener("click", o), i?.addEventListener("click", o), n?.addEventListener("click", o),
|
|
5171
|
+
e?.addEventListener("click", o), i?.addEventListener("click", o), n?.addEventListener("click", o), et = !0;
|
|
5165
5172
|
return;
|
|
5166
5173
|
}
|
|
5167
5174
|
const r = document.getElementById("js-zoom-overlay"), a = document.getElementById("js-zoom-svg"), l = document.getElementById("js-zoom-group"), c = document.getElementById("js-zoom-close");
|
|
5168
5175
|
if (!(r instanceof HTMLElement) || !(a instanceof SVGSVGElement) || !(l instanceof SVGGElement) || !(c instanceof HTMLElement)) {
|
|
5169
|
-
requestAnimationFrame(
|
|
5176
|
+
requestAnimationFrame(at);
|
|
5170
5177
|
return;
|
|
5171
5178
|
}
|
|
5172
|
-
|
|
5179
|
+
et = !0;
|
|
5173
5180
|
const d = document.getElementById("js-zoom-label"), h = document.getElementById("js-zoom-title"), u = document.getElementById("js-town-sprite-data"), f = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map();
|
|
5174
5181
|
let p = null;
|
|
5175
5182
|
const y = () => {
|
|
5176
5183
|
if (p)
|
|
5177
5184
|
return p;
|
|
5178
5185
|
const L = u instanceof HTMLScriptElement ? JSON.parse(u.textContent || '""') : "";
|
|
5179
|
-
return p =
|
|
5186
|
+
return p = bs(ws(L)), p;
|
|
5180
5187
|
}, w = () => {
|
|
5181
5188
|
r.setAttribute("aria-hidden", "true"), l.replaceChildren();
|
|
5182
5189
|
}, 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) => {
|
|
5183
|
-
const
|
|
5184
|
-
if (
|
|
5190
|
+
const T = vs[L] || [];
|
|
5191
|
+
if (T.length === 0)
|
|
5185
5192
|
return;
|
|
5186
|
-
const
|
|
5187
|
-
|
|
5188
|
-
const
|
|
5189
|
-
if (!
|
|
5193
|
+
const z = document.createDocumentFragment();
|
|
5194
|
+
T.forEach((F) => {
|
|
5195
|
+
const M = C(L, F.id);
|
|
5196
|
+
if (!M)
|
|
5190
5197
|
return;
|
|
5191
|
-
const $ =
|
|
5192
|
-
|
|
5193
|
-
}), l.appendChild(
|
|
5194
|
-
|
|
5198
|
+
const $ = Ps(F.name, M, b);
|
|
5199
|
+
z.appendChild($);
|
|
5200
|
+
}), l.appendChild(z), requestAnimationFrame(() => {
|
|
5201
|
+
ct(l);
|
|
5195
5202
|
});
|
|
5196
5203
|
}, _ = (L) => {
|
|
5197
5204
|
const { target: b } = L;
|
|
@@ -5200,34 +5207,34 @@ const lt = () => {
|
|
|
5200
5207
|
const E = b?.closest(".c-map-towns__dept-trigger");
|
|
5201
5208
|
if (!E)
|
|
5202
5209
|
return;
|
|
5203
|
-
const
|
|
5204
|
-
|
|
5205
|
-
const
|
|
5206
|
-
if (d && h &&
|
|
5210
|
+
const T = E.getAttribute("id")?.replace("out-", "") || "", z = E.getAttribute("data-name"), F = Ss(T, y, f);
|
|
5211
|
+
As(m);
|
|
5212
|
+
const M = Cs(F, m);
|
|
5213
|
+
if (d && h && z && (d.textContent = z, h.textContent = `Carte détaillée du département : ${z}`), !(E instanceof SVGGraphicsElement))
|
|
5207
5214
|
return;
|
|
5208
|
-
const $ =
|
|
5209
|
-
r.setAttribute("aria-hidden", "false"),
|
|
5215
|
+
const $ = Is(a, E);
|
|
5216
|
+
r.setAttribute("aria-hidden", "false"), xs(l, M), g(T, $);
|
|
5210
5217
|
}, A = (L) => {
|
|
5211
5218
|
const { target: b } = L;
|
|
5212
5219
|
if (!(b instanceof Element))
|
|
5213
5220
|
return;
|
|
5214
|
-
const
|
|
5215
|
-
|
|
5221
|
+
const T = b.closest(".c-map-towns__zoom-town")?.getAttribute("data-url");
|
|
5222
|
+
T && Y(T);
|
|
5216
5223
|
};
|
|
5217
5224
|
e?.addEventListener("click", _), i?.addEventListener("click", _), l.addEventListener("click", A), c.addEventListener("click", () => {
|
|
5218
5225
|
w();
|
|
5219
5226
|
}), r.addEventListener("click", (L) => {
|
|
5220
5227
|
L.target === r && w();
|
|
5221
5228
|
});
|
|
5222
|
-
},
|
|
5223
|
-
|
|
5229
|
+
}, Rs = () => {
|
|
5230
|
+
me(), ds(), Qt(), be(), ce(), Yi(), Ki(), xe(), ls(), ie(), rs(), fe(), ge(), ye(), oe(), Yt(
|
|
5224
5231
|
"localisation-input",
|
|
5225
5232
|
"https://www.20minutes.fr/elections/resultats/recherche",
|
|
5226
5233
|
"?searchValue=",
|
|
5227
5234
|
"text",
|
|
5228
5235
|
"text"
|
|
5229
|
-
),
|
|
5236
|
+
), ne(), ct(), fs(), Ut(), Kt(), _e(), at(), Oe(), De(), ve(), Gt(), ps(), Ji(), ts();
|
|
5230
5237
|
};
|
|
5231
5238
|
export {
|
|
5232
|
-
|
|
5239
|
+
Rs as initScripts
|
|
5233
5240
|
};
|