@20minutes/hela 2.24.0 → 2.24.1

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.
@@ -5,8 +5,8 @@ const Yt = () => /Android/i.test(navigator.userAgent), Jt = typeof window < "u"
5
5
  "https://app.adjust.com/15shf6wg?campaign=Bandeau_1&deep_link=20minutes%3A%2F%2Fhome"
6
6
  );
7
7
  }, te = () => {
8
- const s = document.querySelector("#js-election-selector");
9
- s && s.addEventListener("change", (t) => {
8
+ const s = document.getElementById("js-election-selector");
9
+ s instanceof HTMLSelectElement && s.addEventListener("change", (t) => {
10
10
  window.location.replace(t.target.value);
11
11
  });
12
12
  }, ee = () => {
@@ -902,10 +902,10 @@ function Bt(s, t, e, i) {
902
902
  function st(s, t, e) {
903
903
  s.style.width = typeof t == "number" ? `${t}px` : t, s.style.height = typeof e == "number" ? `${e}px` : e;
904
904
  }
905
- function qe(s) {
905
+ function Ne(s) {
906
906
  Bt(s);
907
907
  }
908
- function Ne(s) {
908
+ function qe(s) {
909
909
  return "decode" in s ? s.decode().catch(() => {
910
910
  }) : s.complete ? Promise.resolve(s) : new Promise((t, e) => {
911
911
  s.onload = () => t(s), s.onerror = e;
@@ -1024,7 +1024,7 @@ function kt(s, t) {
1024
1024
  y: window.innerHeight
1025
1025
  };
1026
1026
  }
1027
- function q(s, t, e, i, n) {
1027
+ function N(s, t, e, i, n) {
1028
1028
  let o = 0;
1029
1029
  if (t.paddingFn)
1030
1030
  o = t.paddingFn(e, i, n)[s];
@@ -1038,8 +1038,8 @@ function q(s, t, e, i, n) {
1038
1038
  }
1039
1039
  function Zt(s, t, e, i) {
1040
1040
  return {
1041
- x: t.x - q("left", s, t, e, i) - q("right", s, t, e, i),
1042
- y: t.y - q("top", s, t, e, i) - q("bottom", s, t, e, i)
1041
+ x: t.x - N("left", s, t, e, i) - N("right", s, t, e, i),
1042
+ y: t.y - N("top", s, t, e, i) - N("bottom", s, t, e, i)
1043
1043
  };
1044
1044
  }
1045
1045
  class je {
@@ -1079,7 +1079,7 @@ class je {
1079
1079
  _updateAxis(t) {
1080
1080
  const {
1081
1081
  pswp: e
1082
- } = this.slide, i = this.slide[t === "x" ? "width" : "height"] * this.currZoomLevel, o = q(t === "x" ? "left" : "top", e.options, e.viewportSize, this.slide.data, this.slide.index), r = this.slide.panAreaSize[t];
1082
+ } = 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];
1083
1083
  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];
1084
1084
  }
1085
1085
  // _getZeroBounds
@@ -1098,7 +1098,7 @@ class je {
1098
1098
  }
1099
1099
  }
1100
1100
  const yt = 4e3;
1101
- let qt = class {
1101
+ let Nt = class {
1102
1102
  /**
1103
1103
  * @param {PhotoSwipeOptions} options PhotoSwipe options
1104
1104
  * @param {SlideData} itemData Slide data
@@ -1191,7 +1191,7 @@ class Ge {
1191
1191
  }, this.pan = {
1192
1192
  x: 0,
1193
1193
  y: 0
1194
- }, this.isFirstSlide = this.isActive && !i.opener.isOpen, this.zoomLevels = new qt(i.options, t, e, i), this.pswp.dispatch("gettingData", {
1194
+ }, this.isFirstSlide = this.isActive && !i.opener.isOpen, this.zoomLevels = new Nt(i.options, t, e, i), this.pswp.dispatch("gettingData", {
1195
1195
  slide: this,
1196
1196
  data: this.data,
1197
1197
  index: e
@@ -2418,7 +2418,7 @@ class hi {
2418
2418
  }
2419
2419
  // Destroy is called automatically onFinish
2420
2420
  destroy() {
2421
- this._helperTimeout && clearTimeout(this._helperTimeout), qe(this._target), this._target.removeEventListener("transitionend", this._onTransitionEnd, !1), this._target.removeEventListener("transitioncancel", this._onTransitionEnd, !1), this._finished || this._finalizeAnimation();
2421
+ this._helperTimeout && clearTimeout(this._helperTimeout), Ne(this._target), this._target.removeEventListener("transitionend", this._onTransitionEnd, !1), this._target.removeEventListener("transitioncancel", this._onTransitionEnd, !1), this._finished || this._finalizeAnimation();
2422
2422
  }
2423
2423
  }
2424
2424
  const ui = 12, pi = 0.75;
@@ -2654,7 +2654,7 @@ class _i {
2654
2654
  c === "bar" ? (t.topBar || (t.topBar = x("pswp__top-bar pswp__hide-on-close", "div", t.scrollWrap)), d = t.topBar) : (l.classList.add("pswp__hide-on-close"), c === "wrapper" && (d = t.scrollWrap)), (i = d) === null || i === void 0 || i.appendChild(t.applyFilters("uiElement", l, e));
2655
2655
  }
2656
2656
  }
2657
- function Nt(s, t, e) {
2657
+ function qt(s, t, e) {
2658
2658
  s.classList.add("pswp__button--arrow"), s.setAttribute("aria-controls", "pswp__items"), t.on("change", () => {
2659
2659
  t.options.loop || (e ? s.disabled = !(t.currIndex < t.getNumItems() - 1) : s.disabled = !(t.currIndex > 0));
2660
2660
  });
@@ -2673,7 +2673,7 @@ const wi = {
2673
2673
  outlineID: "pswp__icn-arrow"
2674
2674
  },
2675
2675
  onClick: "prev",
2676
- onInit: Nt
2676
+ onInit: qt
2677
2677
  }, bi = {
2678
2678
  name: "arrowNext",
2679
2679
  className: "pswp__button--arrow--next",
@@ -2689,7 +2689,7 @@ const wi = {
2689
2689
  },
2690
2690
  onClick: "next",
2691
2691
  onInit: (s, t) => {
2692
- Nt(s, t, !0);
2692
+ qt(s, t, !0);
2693
2693
  }
2694
2694
  }, Si = {
2695
2695
  name: "close",
@@ -3217,7 +3217,7 @@ function Ht(s, t, e) {
3217
3217
  options: o
3218
3218
  } = t;
3219
3219
  if (o) {
3220
- n = new qt(o, s, -1);
3220
+ n = new Nt(o, s, -1);
3221
3221
  let r;
3222
3222
  t.pswp ? r = t.pswp.viewportSize : r = kt(o, t);
3223
3223
  const a = Zt(o, r, s, e);
@@ -3453,7 +3453,7 @@ class Fi {
3453
3453
  _start() {
3454
3454
  this.isOpening && this._useAnimation && this._placeholder && this._placeholder.tagName === "IMG" ? new Promise((t) => {
3455
3455
  let e = !1, i = !0;
3456
- Ne(
3456
+ qe(
3457
3457
  /** @type {HTMLImageElement} */
3458
3458
  this._placeholder
3459
3459
  ).finally(() => {
@@ -3814,11 +3814,11 @@ class Zi extends Bi {
3814
3814
  };
3815
3815
  }
3816
3816
  }
3817
- function N(s, t, e) {
3817
+ function q(s, t, e) {
3818
3818
  const i = document.createElement(t);
3819
3819
  return s && (i.className = s), e && e.appendChild(i), i;
3820
3820
  }
3821
- function qi(s, t, e) {
3821
+ function Ni(s, t, e) {
3822
3822
  let i = `translate3d(${s}px,0px,0)`;
3823
3823
  return e !== void 0 && (i += ` scale3d(${e},${e},1)`), i;
3824
3824
  }
@@ -3831,7 +3831,7 @@ const T = {
3831
3831
  LOADED: "loaded",
3832
3832
  ERROR: "error"
3833
3833
  };
3834
- function Ni(s) {
3834
+ function qi(s) {
3835
3835
  return "button" in s && s.button === 1 || s.ctrlKey || s.metaKey || s.altKey || s.shiftKey;
3836
3836
  }
3837
3837
  function H(s, t, e = document) {
@@ -3944,7 +3944,7 @@ class ji {
3944
3944
  * @param {HTMLElement} container
3945
3945
  */
3946
3946
  constructor(t, e) {
3947
- if (this.element = N("pswp__img pswp__img--placeholder", t ? "img" : "div", e), t) {
3947
+ if (this.element = q("pswp__img pswp__img--placeholder", t ? "img" : "div", e), t) {
3948
3948
  const i = (
3949
3949
  /** @type {HTMLImageElement} */
3950
3950
  this.element
@@ -3958,7 +3958,7 @@ class ji {
3958
3958
  * @param {number} height
3959
3959
  */
3960
3960
  setDisplayedSize(t, e) {
3961
- this.element && (this.element.tagName === "IMG" ? (nt(this.element, 250, "auto"), this.element.style.transformOrigin = "0 0", this.element.style.transform = qi(0, 0, t / 250)) : nt(this.element, t, e));
3961
+ this.element && (this.element.tagName === "IMG" ? (nt(this.element, 250, "auto"), this.element.style.transformOrigin = "0 0", this.element.style.transform = Ni(0, 0, t / 250)) : nt(this.element, t, e));
3962
3962
  }
3963
3963
  destroy() {
3964
3964
  var t;
@@ -4005,7 +4005,7 @@ class Gi {
4005
4005
  this.element && !e || this.instance.dispatch("contentLoad", {
4006
4006
  content: this,
4007
4007
  isLazy: t
4008
- }).defaultPrevented || (this.isImageContent() ? (this.element = N("pswp__img", "img"), this.displayedImageWidth && this.loadImage(t)) : (this.element = N("pswp__content", "div"), this.element.innerHTML = this.data.html || ""), e && this.slide && this.slide.updateContentSize(!0));
4008
+ }).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));
4009
4009
  }
4010
4010
  /**
4011
4011
  * Preload image
@@ -4150,9 +4150,9 @@ class Gi {
4150
4150
  displayError() {
4151
4151
  if (this.slide) {
4152
4152
  var t, e;
4153
- let i = N("pswp__error-msg", "div");
4153
+ let i = q("pswp__error-msg", "div");
4154
4154
  i.innerText = (t = (e = this.instance.options) === null || e === void 0 ? void 0 : e.errorMsg) !== null && t !== void 0 ? t : "", i = /** @type {HTMLDivElement} */
4155
- this.instance.applyFilters("contentErrorElement", i, this), this.element = N("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();
4155
+ 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();
4156
4156
  }
4157
4157
  }
4158
4158
  /**
@@ -4461,7 +4461,7 @@ class Qi extends Ji {
4461
4461
  * @param {MouseEvent} e
4462
4462
  */
4463
4463
  onThumbnailsClick(t) {
4464
- if (Ni(t) || window.pswp)
4464
+ if (qi(t) || window.pswp)
4465
4465
  return;
4466
4466
  let e = {
4467
4467
  x: t.clientX,
@@ -4622,33 +4622,41 @@ const ts = () => {
4622
4622
  !s || !t || t.addEventListener("click", () => {
4623
4623
  document.getElementById(es)?.scrollIntoView({ behavior: "smooth" });
4624
4624
  });
4625
- }, Ct = (s) => Math.min(100, Math.max(0, Math.round(s))), ns = () => {
4626
- const s = document.querySelector(".js-limit-scroll-progress-bar"), t = document.querySelector(".c-progress__bar"), e = document.querySelector(".c-btn__close-progress");
4625
+ }, Ct = (s) => Math.min(100, Math.max(0, Math.round(s))), ns = ({
4626
+ limitElement: s,
4627
+ progressBar: t,
4628
+ closeProgress: e,
4629
+ startElement: i,
4630
+ endElement: n
4631
+ }) => {
4627
4632
  if (!t && !e)
4628
4633
  return;
4629
- const { documentElement: i } = document, n = i.scrollTop;
4634
+ const { documentElement: o } = document, r = o.scrollTop;
4630
4635
  if (t) {
4631
- let o = i.scrollHeight - i.clientHeight;
4632
- if (!o)
4636
+ let a = o.scrollHeight - o.clientHeight;
4637
+ if (!a)
4633
4638
  return;
4634
- s && (o = s.scrollHeight - i.clientHeight + (window.pageYOffset + s.getBoundingClientRect().top)), t.style.width = `${Ct(n / o * 100)}%`;
4635
- }
4636
- if (e) {
4637
- const o = document.querySelector(".js-content-header"), r = document.querySelector(".js-limit-scroll-close-article-btn");
4638
- if (o && r) {
4639
- const a = window.pageYOffset + o.getBoundingClientRect().bottom, c = window.pageYOffset + r.getBoundingClientRect().bottom - i.clientHeight - a;
4640
- if (c > 0) {
4641
- const d = Ct((n - a) / c * 100);
4642
- e.style.setProperty("--progress", `${d}`), e.parentElement?.classList.toggle(
4643
- "c-btn--close-progress-complete",
4644
- d >= 100
4645
- );
4646
- }
4639
+ s && (a = s.scrollHeight - o.clientHeight + (window.pageYOffset + s.getBoundingClientRect().top)), t.style.width = `${Ct(r / a * 100)}%`;
4640
+ }
4641
+ if (e && i && n) {
4642
+ const a = window.pageYOffset + i.getBoundingClientRect().bottom, c = window.pageYOffset + n.getBoundingClientRect().bottom - o.clientHeight - a;
4643
+ if (c > 0) {
4644
+ const d = Ct((r - a) / c * 100);
4645
+ e.style.setProperty("--progress", `${d}`), e.parentElement?.classList.toggle(
4646
+ "c-btn--close-progress-complete",
4647
+ d >= 100
4648
+ );
4647
4649
  }
4648
4650
  }
4649
4651
  }, os = () => {
4650
- const s = document.querySelector(".c-progress"), t = document.querySelector(".c-btn__close-progress");
4651
- (s || t) && window.addEventListener("scroll", ns);
4652
+ const s = {
4653
+ limitElement: document.querySelector(".js-limit-scroll-progress-bar"),
4654
+ progressBar: document.querySelector(".c-progress__bar"),
4655
+ closeProgress: document.querySelector(".c-btn__close-progress"),
4656
+ startElement: document.querySelector(".js-content-header"),
4657
+ endElement: document.querySelector(".js-limit-scroll-close-article-btn")
4658
+ };
4659
+ (s.progressBar || s.closeProgress) && window.addEventListener("scroll", () => ns(s));
4652
4660
  }, rs = (s = {}) => {
4653
4661
  const { buttonSelector: t = ".c-scroll-to-top" } = s, e = document.querySelector(t), i = e?.querySelector("button");
4654
4662
  if (!e || !i)
@@ -4672,7 +4680,7 @@ const ts = () => {
4672
4680
  };
4673
4681
  window.addEventListener("scroll", r), i.addEventListener("click", a), r();
4674
4682
  }, as = 500, ls = () => {
4675
- const s = document.querySelector("#mbrs-comments-container"), t = document.querySelector(".c-scroll-to-top-comment");
4683
+ const s = document.getElementById("mbrs-comments-container"), t = document.querySelector(".c-scroll-to-top-comment");
4676
4684
  if (!s || !t)
4677
4685
  return;
4678
4686
  t.style.display = "none", t.addEventListener("click", () => {
@@ -5161,9 +5169,9 @@ const Y = (s) => {
5161
5169
  const n = ks(i, t);
5162
5170
  n && e.appendChild(n);
5163
5171
  }), e;
5164
- }, qs = (s, t) => {
5172
+ }, Ns = (s, t) => {
5165
5173
  s.replaceChildren(t);
5166
- }, Ns = (s, t, e) => {
5174
+ }, qs = (s, t, e) => {
5167
5175
  const i = document.createElementNS("http://www.w3.org/2000/svg", "g");
5168
5176
  i.setAttribute("class", "js-city-marker c-map-towns__city-marker"), i.setAttribute("aria-hidden", "true"), i.setAttribute("data-scale", e.toString());
5169
5177
  const n = document.createElementNS("http://www.w3.org/2000/svg", "path");
@@ -5239,7 +5247,7 @@ const rt = () => {
5239
5247
  const z = C(L, F.id);
5240
5248
  if (!z)
5241
5249
  return;
5242
- const R = Ns(F.name, z, b);
5250
+ const R = qs(F.name, z, b);
5243
5251
  M.appendChild(R);
5244
5252
  }), l.appendChild(M), requestAnimationFrame(() => {
5245
5253
  ct(l);
@@ -5257,7 +5265,7 @@ const rt = () => {
5257
5265
  if (d && h && M && (d.textContent = M, h.textContent = `Carte détaillée du département : ${M}`), !(A instanceof SVGGraphicsElement))
5258
5266
  return;
5259
5267
  const R = Hs(a, A);
5260
- r.setAttribute("aria-hidden", "false"), qs(l, z), g(I, R);
5268
+ r.setAttribute("aria-hidden", "false"), Ns(l, z), g(I, R);
5261
5269
  }, E = (L) => {
5262
5270
  const { target: b } = L;
5263
5271
  if (!(b instanceof Element))