aptechka 0.80.2 → 0.81.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,284 +1,286 @@
1
- var ge = Object.defineProperty, be = Object.defineProperties;
1
+ var be = Object.defineProperty, ve = Object.defineProperties;
2
2
  var Ee = Object.getOwnPropertyDescriptors;
3
- var _t = Object.getOwnPropertySymbols;
4
- var ve = Object.prototype.hasOwnProperty, Le = Object.prototype.propertyIsEnumerable;
5
- var te = (h, e) => (e = Symbol[h]) ? e : Symbol.for("Symbol." + h), se = (h) => {
3
+ var te = Object.getOwnPropertySymbols;
4
+ var Le = Object.prototype.hasOwnProperty, Se = Object.prototype.propertyIsEnumerable;
5
+ var ee = (h, e) => (e = Symbol[h]) ? e : Symbol.for("Symbol." + h), se = (h) => {
6
6
  throw TypeError(h);
7
7
  };
8
- var ee = (h, e, s) => e in h ? ge(h, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : h[e] = s, Ht = (h, e) => {
9
- for (var s in e || (e = {}))
10
- ve.call(e, s) && ee(h, s, e[s]);
11
- if (_t)
12
- for (var s of _t(e))
13
- Le.call(e, s) && ee(h, s, e[s]);
8
+ var ae = (h, e, a) => e in h ? be(h, e, { enumerable: !0, configurable: !0, writable: !0, value: a }) : h[e] = a, Ht = (h, e) => {
9
+ for (var a in e || (e = {}))
10
+ Le.call(e, a) && ae(h, a, e[a]);
11
+ if (te)
12
+ for (var a of te(e))
13
+ Se.call(e, a) && ae(h, a, e[a]);
14
14
  return h;
15
- }, zt = (h, e) => be(h, Ee(e));
16
- var qt = (h, e, s) => e.has(h) || se("Cannot " + s);
17
- var t = (h, e, s) => (qt(h, e, "read from private field"), s ? s.call(h) : e.get(h)), l = (h, e, s) => e.has(h) ? se("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(h) : e.set(h, s), o = (h, e, s, a) => (qt(h, e, "write to private field"), a ? a.call(h, s) : e.set(h, s), s), g = (h, e, s) => (qt(h, e, "access private method"), s);
18
- var Q = (h, e, s) => new Promise((a, n) => {
19
- var E = (c) => {
15
+ }, zt = (h, e) => ve(h, Ee(e));
16
+ var qt = (h, e, a) => e.has(h) || se("Cannot " + a);
17
+ var t = (h, e, a) => (qt(h, e, "read from private field"), a ? a.call(h) : e.get(h)), l = (h, e, a) => e.has(h) ? se("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(h) : e.set(h, a), o = (h, e, a, i) => (qt(h, e, "write to private field"), i ? i.call(h, a) : e.set(h, a), a), g = (h, e, a) => (qt(h, e, "access private method"), a);
18
+ var J = (h, e, a) => new Promise((i, n) => {
19
+ var v = (c) => {
20
20
  try {
21
- d(s.next(c));
22
- } catch (v) {
23
- n(v);
21
+ u(a.next(c));
22
+ } catch (E) {
23
+ n(E);
24
24
  }
25
- }, f = (c) => {
25
+ }, p = (c) => {
26
26
  try {
27
- d(s.throw(c));
28
- } catch (v) {
29
- n(v);
27
+ u(a.throw(c));
28
+ } catch (E) {
29
+ n(E);
30
30
  }
31
- }, d = (c) => c.done ? a(c.value) : Promise.resolve(c.value).then(E, f);
32
- d((s = s.apply(h, e)).next());
31
+ }, u = (c) => c.done ? i(c.value) : Promise.resolve(c.value).then(v, p);
32
+ u((a = a.apply(h, e)).next());
33
33
  });
34
- var ie = (h, e, s) => (e = h[te("asyncIterator")]) ? e.call(h) : (h = h[te("iterator")](), e = {}, s = (a, n) => (n = h[a]) && (e[a] = (E) => new Promise((f, d, c) => (E = n.call(h, E), c = E.done, Promise.resolve(E.value).then((v) => f({ value: v, done: c }), d)))), s("next"), s("return"), e);
35
- import { i as re } from "../index-JqYHGoo6.js";
34
+ var ie = (h, e, a) => (e = h[ee("asyncIterator")]) ? e.call(h) : (h = h[ee("iterator")](), e = {}, a = (i, n) => (n = h[i]) && (e[i] = (v) => new Promise((p, u, c) => (v = n.call(h, v), c = v.done, Promise.resolve(v.value).then((E) => p({ value: E, done: c }), u)))), a("next"), a("return"), e);
35
+ import { i as oe } from "../index-JqYHGoo6.js";
36
36
  import { d as I } from "../events-CsVF98U6.js";
37
- import { w as Se, s as ye } from "../scroll-7JSxRKFK.js";
37
+ import { w as Ae, s as Pe } from "../scroll-7JSxRKFK.js";
38
38
  import "construct-style-sheets-polyfill";
39
- import { n as Ae, c as It, s as Pe } from "../url-CGbjOTU4.js";
40
- import { c as oe } from "../string-BlMQbe8b.js";
41
- import { c as ke } from "../math-BOBiC4TN.js";
39
+ import { n as ye, c as It, s as ke } from "../url-IGj2LgDW.js";
42
40
  import { cssValueParser as we } from "../css-value-parser/index.js";
43
- class he extends HTMLElement {
41
+ import { c as he } from "../string-BlMQbe8b.js";
42
+ import { c as Ce } from "../math-BOBiC4TN.js";
43
+ class le extends HTMLElement {
44
44
  connectedCallback() {
45
45
  const e = {
46
46
  "aria-live": "assertive",
47
47
  "aria-atomic": "true",
48
48
  style: "position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"
49
49
  };
50
- for (const [s, a] of Object.entries(e))
51
- this.setAttribute(s, a);
50
+ for (const [a, i] of Object.entries(e))
51
+ this.setAttribute(a, i);
52
52
  }
53
53
  }
54
- re && !customElements.get("morph-announcer") && customElements.define("morph-announcer", he);
55
- var R, i, x, rt, Ut, le, Et, ot;
54
+ oe && !customElements.get("morph-announcer") && customElements.define("morph-announcer", le);
55
+ var R, s, x, nt, Ut, ce, bt, rt;
56
56
  class Wt {
57
- constructor(e, s) {
57
+ constructor(e, a) {
58
58
  l(this, x);
59
59
  l(this, R);
60
- l(this, i);
61
- l(this, Et, (e) => {
62
- e.preventDefault(), g(this, x, le).call(this);
60
+ l(this, s);
61
+ l(this, bt, (e) => {
62
+ e.preventDefault(), g(this, x, ce).call(this);
63
63
  });
64
- l(this, ot, () => {
65
- const e = t(this, i).hasAttribute("data-revalidate");
66
- t(this, R).prefetch(t(this, x, rt), e), t(this, i).removeEventListener("pointerenter", t(this, ot));
64
+ l(this, rt, () => {
65
+ const e = t(this, s).hasAttribute("data-revalidate");
66
+ t(this, R).prefetch(t(this, x, nt), e), t(this, s).removeEventListener("pointerenter", t(this, rt));
67
67
  });
68
- o(this, R, s), o(this, i, e), t(this, i).addEventListener("click", t(this, Et)), this.checkCurrent(location.href.replace(location.origin, ""));
69
- const a = g(this, x, Ut).call(this, t(this, i).getAttribute("data-pagination-set-link") || t(this, i).getAttribute("data-pagination-more-link") || t(this, i).getAttribute("data-pagination-next-link") || t(this, i).getAttribute("data-pagination-prev-link"));
70
- a && this.updatePagination(
71
- a.currentPage,
72
- a.selector
73
- ), t(this, i).hasAttribute("data-prefetch") && t(this, i).addEventListener("pointerenter", t(this, ot));
68
+ o(this, R, a), o(this, s, e), t(this, s).addEventListener("click", t(this, bt)), this.checkCurrent(location.href.replace(location.origin, ""));
69
+ const i = g(this, x, Ut).call(this, t(this, s).getAttribute("data-pagination-set-link") || t(this, s).getAttribute("data-pagination-more-link") || t(this, s).getAttribute("data-pagination-next-link") || t(this, s).getAttribute("data-pagination-prev-link"));
70
+ i && this.updatePagination(
71
+ i.currentPage,
72
+ i.selector
73
+ ), t(this, s).hasAttribute("data-prefetch") && t(this, s).addEventListener("pointerenter", t(this, rt));
74
74
  }
75
75
  get element() {
76
- return t(this, i);
76
+ return t(this, s);
77
77
  }
78
78
  checkCurrent(e) {
79
- var v, it;
80
- const s = t(this, R).normalizePath(e), a = t(this, R).normalizePath(t(this, x, rt));
81
- t(this, i).hasAttribute("data-include") && s.pathname.includes(a.pathname) ? t(this, i).classList.add("current") : a.pathname === s.pathname ? t(this, i).classList.add("current") : (v = t(this, i).getAttribute("data-associated-paths")) != null && v.split(",").find((w) => s.pathname.includes(w)) ? t(this, i).classList.add("current") : t(this, i).classList.remove("current"), s.path === a.path ? t(this, i).classList.add("exact") : t(this, i).classList.remove("exact");
82
- const [n, E] = (it = t(this, x, rt).split("#")[0]) == null ? void 0 : it.split("?"), f = new URLSearchParams(E), d = new URLSearchParams(location.search);
79
+ var E, at;
80
+ const a = t(this, R).normalizePath(e), i = t(this, R).normalizePath(t(this, x, nt));
81
+ t(this, s).hasAttribute("data-include") && a.pathname.includes(i.pathname) ? t(this, s).classList.add("current") : i.pathname === a.pathname ? t(this, s).classList.add("current") : (E = t(this, s).getAttribute("data-associated-paths")) != null && E.split(",").find((k) => a.pathname.includes(k)) ? t(this, s).classList.add("current") : t(this, s).classList.remove("current"), a.path === i.path ? t(this, s).classList.add("exact") : t(this, s).classList.remove("exact");
82
+ const [n, v] = (at = t(this, x, nt).split("#")[0]) == null ? void 0 : at.split("?"), p = new URLSearchParams(v), u = new URLSearchParams(location.search);
83
83
  let c = 0;
84
- for (const [w] of d)
85
- f.has(w) && d.get(w) === f.get(w) && c++;
86
- c ? (t(this, i).classList.toggle(
84
+ for (const [k] of u)
85
+ p.has(k) && u.get(k) === p.get(k) && c++;
86
+ c ? (t(this, s).classList.toggle(
87
87
  "all-params-matched",
88
- d.size === c
89
- ), t(this, i).classList.toggle(
88
+ u.size === c
89
+ ), t(this, s).classList.toggle(
90
90
  "some-params-matched",
91
- d.size !== c
92
- )) : !d.size && t(this, i).hasAttribute("data-match-no-params") ? t(this, i).classList.add("all-params-matched") : (t(this, i).classList.remove("all-params-matched"), t(this, i).classList.remove("some-params-matched"));
93
- for (const w in t(this, i).dataset) {
94
- const at = oe(w);
95
- if (at.startsWith("match-param-")) {
96
- const M = at.split("match-param-")[1], P = t(this, i).dataset[w], y = `param-${M}-matched`;
97
- d.has(M) && d.get(M) === P || !d.has(M) && (P === "" || P === "*" || P === "all" || P === "any" || P === "vse") ? t(this, i).classList.add(y) : t(this, i).classList.remove(y);
91
+ u.size !== c
92
+ )) : !u.size && t(this, s).hasAttribute("data-match-no-params") ? t(this, s).classList.add("all-params-matched") : (t(this, s).classList.remove("all-params-matched"), t(this, s).classList.remove("some-params-matched"));
93
+ for (const k in t(this, s).dataset) {
94
+ const st = he(k);
95
+ if (st.startsWith("match-param-")) {
96
+ const q = st.split("match-param-")[1], L = t(this, s).dataset[k], w = `param-${q}-matched`;
97
+ u.has(q) && u.get(q) === L || !u.has(q) && (L === "" || L === "*" || L === "all" || L === "any" || L === "vse") ? t(this, s).classList.add(w) : t(this, s).classList.remove(w);
98
98
  }
99
99
  }
100
100
  }
101
- updatePagination(e, s) {
102
- const a = g(this, x, Ut).call(this, s);
103
- if (a)
104
- if (a.element.setAttribute(
101
+ updatePagination(e, a) {
102
+ const i = g(this, x, Ut).call(this, a);
103
+ if (i)
104
+ if (i.element.setAttribute(
105
105
  "data-current-page",
106
106
  e.toString()
107
- ), t(this, i).hasAttribute("data-pagination-more-link"))
108
- if (e < a.totalPages) {
109
- t(this, i).style.display = "";
110
- const n = t(this, i).querySelector(
107
+ ), t(this, s).hasAttribute("data-pagination-more-link"))
108
+ if (e < i.totalPages) {
109
+ t(this, s).style.display = "";
110
+ const n = t(this, s).querySelector(
111
111
  "[data-pagination-more-link-counter]"
112
112
  );
113
- n && (n.textContent = (a.totalPages - e).toString());
114
- const E = t(this, i).getAttribute("href"), f = new URL(E, window.location.origin);
115
- f.searchParams.set("page", (e + 1).toString());
116
- const d = f.href.replace(f.origin, "").toString();
117
- t(this, i).setAttribute("href", d), this.checkCurrent(d);
113
+ n && (n.textContent = (i.totalPages - e).toString());
114
+ const v = t(this, s).getAttribute("href"), p = new URL(v, window.location.origin);
115
+ p.searchParams.set("page", (e + 1).toString());
116
+ const u = p.href.replace(p.origin, "").toString();
117
+ t(this, s).setAttribute("href", u), this.checkCurrent(u);
118
118
  } else
119
- t(this, i).style.display = "none";
120
- else if (t(this, i).hasAttribute("data-pagination-prev-link") || t(this, i).hasAttribute("data-pagination-next-link")) {
121
- const n = t(this, i).hasAttribute("data-pagination-prev-link"), E = t(this, i).getAttribute("href"), f = new URL(E, window.location.origin), d = e + (n ? -1 : 1);
122
- f.searchParams.set(
119
+ t(this, s).style.display = "none";
120
+ else if (t(this, s).hasAttribute("data-pagination-prev-link") || t(this, s).hasAttribute("data-pagination-next-link")) {
121
+ const n = t(this, s).hasAttribute("data-pagination-prev-link"), v = t(this, s).getAttribute("href"), p = new URL(v, window.location.origin), u = e + (n ? -1 : 1);
122
+ p.searchParams.set(
123
123
  "page",
124
- ke(d, 1, a.totalPages).toString()
124
+ Ce(u, 1, i.totalPages).toString()
125
125
  );
126
- const c = f.href.replace(f.origin, "").toString();
127
- t(this, i).setAttribute("href", c), n ? d < 1 ? (t(this, i).classList.add("pagination-disabled"), t(this, i).setAttribute("tabindex", "-1")) : (t(this, i).classList.remove("pagination-disabled"), t(this, i).removeAttribute("tabindex")) : d > a.totalPages ? (t(this, i).classList.add("pagination-disabled"), t(this, i).setAttribute("tabindex", "-1")) : (t(this, i).classList.remove("pagination-disabled"), t(this, i).removeAttribute("tabindex"));
128
- } else t(this, i).hasAttribute("data-pagination-set-link") && (t(this, i).getAttribute("data-value") === e.toString() ? t(this, i).classList.add("pagination-current") : t(this, i).classList.remove("pagination-current"));
126
+ const c = p.href.replace(p.origin, "").toString();
127
+ t(this, s).setAttribute("href", c), n ? u < 1 ? (t(this, s).classList.add("pagination-disabled"), t(this, s).setAttribute("tabindex", "-1")) : (t(this, s).classList.remove("pagination-disabled"), t(this, s).removeAttribute("tabindex")) : u > i.totalPages ? (t(this, s).classList.add("pagination-disabled"), t(this, s).setAttribute("tabindex", "-1")) : (t(this, s).classList.remove("pagination-disabled"), t(this, s).removeAttribute("tabindex"));
128
+ } else t(this, s).hasAttribute("data-pagination-set-link") && (t(this, s).getAttribute("data-value") === e.toString() ? t(this, s).classList.add("pagination-current") : t(this, s).classList.remove("pagination-current"));
129
129
  }
130
130
  destroy() {
131
- t(this, i).removeEventListener("click", t(this, Et)), t(this, i).removeEventListener("pointerenter", t(this, ot)), t(this, i).classList.remove("current", "exact", "pagination-current");
131
+ t(this, s).removeEventListener("click", t(this, bt)), t(this, s).removeEventListener("pointerenter", t(this, rt)), t(this, s).classList.remove("current", "exact", "pagination-current");
132
132
  }
133
133
  }
134
- R = new WeakMap(), i = new WeakMap(), x = new WeakSet(), rt = function() {
135
- const e = new URL(t(this, i).href);
134
+ R = new WeakMap(), s = new WeakMap(), x = new WeakSet(), nt = function() {
135
+ const e = new URL(t(this, s).href);
136
136
  return t(this, R).normalizePath(
137
137
  e.pathname + e.search + e.hash
138
138
  ).path;
139
139
  }, Ut = function(e) {
140
140
  if (!e)
141
141
  return;
142
- const s = document.querySelector(e);
143
- if (s) {
144
- const a = parseInt(
145
- s.getAttribute("data-current-page") || "1"
142
+ const a = document.querySelector(e);
143
+ if (a) {
144
+ const i = parseInt(
145
+ a.getAttribute("data-current-page") || "1"
146
146
  ), n = parseInt(
147
- s.getAttribute("data-total-pages") || "1"
147
+ a.getAttribute("data-total-pages") || "1"
148
148
  );
149
149
  return {
150
- element: s,
151
- currentPage: a,
150
+ element: a,
151
+ currentPage: i,
152
152
  totalPages: n,
153
153
  selector: e
154
154
  };
155
155
  }
156
- }, le = function() {
157
- var s;
156
+ }, ce = function() {
157
+ var a;
158
158
  if (document.documentElement.classList.contains("click-disabled"))
159
159
  return;
160
- if (t(this, i).hasAttribute("data-back") && t(this, R).previousURL)
160
+ if (t(this, s).hasAttribute("data-back") && t(this, R).previousURL)
161
161
  history.back();
162
162
  else {
163
- const a = t(this, i).getAttribute(
163
+ const i = t(this, s).getAttribute(
164
164
  "data-history-action"
165
- ) || "push", n = t(this, i).hasAttribute("data-center-scroll"), E = getComputedStyle(t(this, i)).getPropertyValue("--offset-scroll").trim(), f = E ? we.parse(E) : void 0, d = t(this, i).hasAttribute("data-revalidate") || t(this, i).hasAttribute("data-pagination-more-link") || t(this, i).hasAttribute("data-pagination-set-link") || t(this, i).hasAttribute("data-pagination-next-link") || t(this, i).hasAttribute("data-pagination-prev-link"), c = t(this, i).hasAttribute(
165
+ ) || "push", n = t(this, s).hasAttribute("data-center-scroll"), v = getComputedStyle(t(this, s)).getPropertyValue("--offset-scroll").trim(), p = v ? we.parse(v) : void 0, u = t(this, s).hasAttribute("data-revalidate") || t(this, s).hasAttribute("data-pagination-more-link") || t(this, s).hasAttribute("data-pagination-set-link") || t(this, s).hasAttribute("data-pagination-next-link") || t(this, s).hasAttribute("data-pagination-prev-link"), c = t(this, s).hasAttribute(
166
166
  "data-keep-search-parameters"
167
- ), v = t(this, i).hasAttribute("data-keep-scroll-position") || t(this, i).hasAttribute("data-pagination-more-link"), it = t(this, i).getAttribute(
167
+ ), E = t(this, s).hasAttribute("data-keep-scroll-position") || t(this, s).hasAttribute("data-pagination-more-link"), at = t(this, s).getAttribute(
168
168
  "data-scroll-behaviour"
169
- ), w = ((s = t(this, i).getAttribute("data-submorph")) == null ? void 0 : s.split(",").map((y) => y.trim())) || t(this, i).hasAttribute("data-pagination-more-link") && [
170
- t(this, i).getAttribute("data-pagination-more-link")
171
- ] || t(this, i).hasAttribute("data-pagination-set-link") && [
172
- t(this, i).getAttribute("data-pagination-set-link")
173
- ] || t(this, i).hasAttribute("data-pagination-next-link") && [
174
- t(this, i).getAttribute("data-pagination-next-link")
175
- ] || t(this, i).hasAttribute("data-pagination-prev-link") && [
176
- t(this, i).getAttribute("data-pagination-prev-link")
177
- ] || void 0, at = t(this, i).hasAttribute("data-clear-state");
178
- let M = t(this, x, rt);
179
- if (t(this, i).hasAttribute("data-toggle-params")) {
180
- const [y, m] = t(this, x, rt).split("?"), J = new URLSearchParams(m), B = new URLSearchParams(location.search), nt = new URLSearchParams();
181
- for (const [H] of J)
182
- (!B.has(H) || B.has(H) && B.get(H) !== J.get(H)) && nt.append(H, J.get(H));
183
- if (t(this, i).hasAttribute("data-merge-params"))
169
+ ), k = ((a = t(this, s).getAttribute("data-submorph")) == null ? void 0 : a.split(",").map((w) => w.trim())) || t(this, s).hasAttribute("data-pagination-more-link") && [
170
+ t(this, s).getAttribute("data-pagination-more-link")
171
+ ] || t(this, s).hasAttribute("data-pagination-set-link") && [
172
+ t(this, s).getAttribute("data-pagination-set-link")
173
+ ] || t(this, s).hasAttribute("data-pagination-next-link") && [
174
+ t(this, s).getAttribute("data-pagination-next-link")
175
+ ] || t(this, s).hasAttribute("data-pagination-prev-link") && [
176
+ t(this, s).getAttribute("data-pagination-prev-link")
177
+ ] || void 0, st = t(this, s).hasAttribute("data-clear-state");
178
+ let q = t(this, x, nt);
179
+ if (t(this, s).hasAttribute("data-toggle-params")) {
180
+ const [w, wt] = t(this, x, nt).split("?"), d = new URLSearchParams(wt), B = new URLSearchParams(location.search), it = new URLSearchParams();
181
+ for (const [H] of d)
182
+ (!B.has(H) || B.has(H) && B.get(H) !== d.get(H)) && it.append(H, d.get(H));
183
+ if (t(this, s).hasAttribute("data-merge-params"))
184
184
  for (const [H] of B)
185
- J.has(H) || nt.append(H, B.get(H));
186
- M = `${y}?${nt.toString()}`;
185
+ d.has(H) || it.append(H, B.get(H));
186
+ q = `${w}?${it.toString()}`;
187
187
  }
188
- const P = g(this, x, Ut).call(this, t(this, i).getAttribute("data-pagination-set-link") || t(this, i).getAttribute("data-pagination-more-link") || t(this, i).getAttribute("data-pagination-next-link") || t(this, i).getAttribute("data-pagination-prev-link"));
189
- P && (t(this, i).hasAttribute("data-pagination-set-link") ? t(this, R).links.forEach((y) => {
190
- y.updatePagination(
191
- parseInt(t(this, i).getAttribute("data-value") || "1"),
192
- P.selector
188
+ const L = g(this, x, Ut).call(this, t(this, s).getAttribute("data-pagination-set-link") || t(this, s).getAttribute("data-pagination-more-link") || t(this, s).getAttribute("data-pagination-next-link") || t(this, s).getAttribute("data-pagination-prev-link"));
189
+ L && (t(this, s).hasAttribute("data-pagination-set-link") ? t(this, R).links.forEach((w) => {
190
+ w.updatePagination(
191
+ parseInt(t(this, s).getAttribute("data-value") || "1"),
192
+ L.selector
193
193
  );
194
- }) : t(this, i).hasAttribute("data-pagination-prev-link") ? t(this, R).links.forEach((y) => {
195
- y.updatePagination(
196
- P.currentPage - 1,
197
- P.selector
194
+ }) : t(this, s).hasAttribute("data-pagination-prev-link") ? t(this, R).links.forEach((w) => {
195
+ w.updatePagination(
196
+ L.currentPage - 1,
197
+ L.selector
198
198
  );
199
- }) : t(this, i).hasAttribute("data-pagination-next-link") ? t(this, R).links.forEach((y) => {
200
- y.updatePagination(
201
- P.currentPage + 1,
202
- P.selector
199
+ }) : t(this, s).hasAttribute("data-pagination-next-link") ? t(this, R).links.forEach((w) => {
200
+ w.updatePagination(
201
+ L.currentPage + 1,
202
+ L.selector
203
203
  );
204
- }) : t(this, i).hasAttribute("data-pagination-more-link") && t(this, R).links.forEach((y) => {
205
- y.updatePagination(
206
- P.currentPage + 1,
207
- P.selector
204
+ }) : t(this, s).hasAttribute("data-pagination-more-link") && t(this, R).links.forEach((w) => {
205
+ w.updatePagination(
206
+ L.currentPage + 1,
207
+ L.selector
208
208
  );
209
- })), t(this, R).navigate(M, {
210
- historyAction: a,
209
+ })), t(this, R).navigate(q, {
210
+ historyAction: i,
211
211
  centerScroll: n,
212
- offsetScroll: f,
213
- revalidate: d,
212
+ offsetScroll: p,
213
+ revalidate: u,
214
214
  keepSearchParameters: c,
215
- submorph: w,
216
- clearState: at,
217
- keepScrollPosition: v,
218
- scrollBehaviour: it,
219
- submorphAppend: t(this, i).hasAttribute("data-pagination-more-link"),
220
- mergeParams: !!P || t(this, i).hasAttribute("data-merge-params") && !t(this, i).hasAttribute("data-toggle-params")
215
+ submorph: k,
216
+ clearState: st,
217
+ keepScrollPosition: E,
218
+ scrollBehaviour: at,
219
+ submorphAppend: t(this, s).hasAttribute("data-pagination-more-link"),
220
+ mergeParams: !!L || t(this, s).hasAttribute("data-merge-params") && !t(this, s).hasAttribute("data-toggle-params"),
221
+ detail: t(this, s).getAttribute("data-detail"),
222
+ removeParams: t(this, s).getAttribute("data-remove-params") || void 0
221
223
  });
222
224
  }
223
- }, Et = new WeakMap(), ot = new WeakMap();
224
- var U, ht, vt, Vt, Lt;
225
- class Ce {
225
+ }, bt = new WeakMap(), rt = new WeakMap();
226
+ var U, ot, vt, Vt, Et;
227
+ class Re {
226
228
  constructor(e) {
227
229
  l(this, vt);
228
230
  l(this, U);
229
- l(this, ht, []);
230
- l(this, Lt, () => {
231
+ l(this, ot, []);
232
+ l(this, Et, () => {
231
233
  g(this, vt, Vt).call(this);
232
234
  });
233
235
  o(this, U, e);
234
- for (const s in t(this, U).dataset) {
235
- const a = oe(s);
236
- if (a.startsWith("param-")) {
237
- const n = a.split("param-")[1], E = t(this, U).dataset[s];
238
- t(this, ht).push({
236
+ for (const a in t(this, U).dataset) {
237
+ const i = he(a);
238
+ if (i.startsWith("param-")) {
239
+ const n = i.split("param-")[1], v = t(this, U).dataset[a];
240
+ t(this, ot).push({
239
241
  name: n,
240
- value: E
242
+ value: v
241
243
  });
242
244
  }
243
245
  }
244
246
  document.addEventListener(
245
247
  "morphURLParametersChange",
246
- t(this, Lt)
248
+ t(this, Et)
247
249
  ), g(this, vt, Vt).call(this);
248
250
  }
249
251
  destroy() {
250
252
  document.removeEventListener(
251
253
  "morphURLParametersChange",
252
- t(this, Lt)
254
+ t(this, Et)
253
255
  );
254
256
  }
255
257
  }
256
- U = new WeakMap(), ht = new WeakMap(), vt = new WeakSet(), Vt = function() {
258
+ U = new WeakMap(), ot = new WeakMap(), vt = new WeakSet(), Vt = function() {
257
259
  const e = new URLSearchParams(location.search);
258
- let s = !!t(this, ht).find((n) => e.has(n.name) && (e.get(n.name) === n.value || n.value === "*" || n.value === "all" || n.value === "any" || n.value === "vse" || e.get(n.name) === "*" || e.get(n.name) === "all" || e.get(n.name) === "any" || e.get(n.name) === "vse"));
259
- !s && t(this, U).hasAttribute("data-match-no-params") && (s = !t(this, ht).filter((n) => e.has(n.name)).length);
260
- const a = t(this, U).getAttribute("data-hide-class");
261
- s ? a ? t(this, U).classList.remove(a) : t(this, U).style.display = "" : a ? t(this, U).classList.add(a) : t(this, U).style.display = "none";
262
- }, Lt = new WeakMap();
263
- const Re = new DOMParser();
264
- var W, Z, T, V, _, Y, lt, tt, $, St, ct;
265
- class ae {
266
- constructor(e, s) {
260
+ let a = !!t(this, ot).find((n) => e.has(n.name) && (e.get(n.name) === n.value || n.value === "*" || n.value === "all" || n.value === "any" || n.value === "vse" || e.get(n.name) === "*" || e.get(n.name) === "all" || e.get(n.name) === "any" || e.get(n.name) === "vse"));
261
+ !a && t(this, U).hasAttribute("data-match-no-params") && (a = !t(this, ot).filter((n) => e.has(n.name)).length);
262
+ const i = t(this, U).getAttribute("data-hide-class");
263
+ a ? i ? t(this, U).classList.remove(i) : t(this, U).style.display = "" : i ? t(this, U).classList.add(i) : t(this, U).style.display = "none";
264
+ }, Et = new WeakMap();
265
+ const xe = new DOMParser();
266
+ var W, Q, T, V, Z, Y, ht, _, $, Lt, lt;
267
+ class ne {
268
+ constructor(e, a) {
267
269
  l(this, W);
268
- l(this, Z);
270
+ l(this, Q);
269
271
  l(this, T, { x: 0, y: 0 });
270
272
  l(this, V, null);
271
- l(this, _, null);
273
+ l(this, Z, null);
272
274
  l(this, Y, null);
273
- l(this, lt, null);
274
- l(this, tt, null);
275
+ l(this, ht, null);
276
+ l(this, _, null);
275
277
  l(this, $, null);
276
- l(this, St);
277
- l(this, ct, !1);
278
- o(this, W, e), o(this, Z, s);
278
+ l(this, Lt);
279
+ l(this, lt, !1);
280
+ o(this, W, e), o(this, Q, a);
279
281
  }
280
282
  get pathname() {
281
- return t(this, Z);
283
+ return t(this, Q);
282
284
  }
283
285
  get scrollState() {
284
286
  return t(this, T);
@@ -287,58 +289,58 @@ class ae {
287
289
  return t(this, Y);
288
290
  }
289
291
  needRavalidation() {
290
- o(this, ct, !0);
292
+ o(this, lt, !0);
291
293
  }
292
294
  setHeaders(e) {
293
- o(this, St, e);
295
+ o(this, Lt, e);
294
296
  }
295
297
  setInitialDocument(e) {
296
298
  o(this, V, e.cloneNode(!0));
297
299
  }
298
300
  abort() {
299
301
  var e;
300
- return (e = t(this, tt)) == null ? void 0 : e.abort(
301
- `[${t(this, Z)}] page loading cancelled`
302
+ return (e = t(this, _)) == null ? void 0 : e.abort(
303
+ `[${t(this, Q)}] page loading cancelled`
302
304
  );
303
305
  }
304
- fetch(e, s, a) {
305
- return Q(this, null, function* () {
306
+ fetch(e, a, i) {
307
+ return J(this, null, function* () {
306
308
  var n;
307
- if (!a && !t(this, ct)) {
308
- const d = ((n = t(this, V)) == null ? void 0 : n.documentElement.getAttribute("data-cache")) && s !== e, c = t(this, V) && t(this, W).isPopstateNavigation;
309
- if (t(this, $) || d || c)
309
+ if (!i && !t(this, lt)) {
310
+ const u = ((n = t(this, V)) == null ? void 0 : n.documentElement.getAttribute("data-cache")) && a !== e, c = t(this, V) && t(this, W).isPopstateNavigation;
311
+ if (t(this, $) || u || c)
310
312
  return t(this, $);
311
313
  }
312
- return o(this, $, new Promise((E) => Q(this, null, function* () {
314
+ return o(this, $, new Promise((v) => J(this, null, function* () {
313
315
  try {
314
- o(this, tt, new AbortController());
315
- const d = yield (yield fetch(e, {
316
- signal: t(this, tt).signal,
316
+ o(this, _, new AbortController());
317
+ const u = yield (yield fetch(e, {
318
+ signal: t(this, _).signal,
317
319
  headers: Ht({
318
320
  "X-MORPH": "true",
319
- "X-MORPH-CURRENT-PATH": encodeURIComponent(s),
321
+ "X-MORPH-CURRENT-PATH": encodeURIComponent(a),
320
322
  "X-MORPH-NEW-PATH": encodeURIComponent(e)
321
- }, t(this, St))
322
- })).text(), c = Re.parseFromString(d, "text/html");
323
- this.setInitialDocument(c), o(this, ct, !1);
324
- } catch (f) {
325
- console.warn(f);
323
+ }, t(this, Lt))
324
+ })).text(), c = xe.parseFromString(u, "text/html");
325
+ this.setInitialDocument(c), o(this, lt, !1);
326
+ } catch (p) {
327
+ console.warn(p);
326
328
  } finally {
327
- o(this, tt, null), o(this, $, null), E();
329
+ o(this, _, null), o(this, $, null), v();
328
330
  }
329
331
  }))), t(this, $);
330
332
  });
331
333
  }
332
334
  cloneDocument() {
333
- o(this, Y, (t(this, _) || t(this, V)).cloneNode(!0));
335
+ o(this, Y, (t(this, Z) || t(this, V)).cloneNode(!0));
334
336
  }
335
337
  get title() {
336
338
  let e = "";
337
339
  if (t(this, Y).title)
338
340
  e = t(this, Y).title;
339
341
  else {
340
- const s = t(this, Y).querySelector("h1");
341
- e = (s == null ? void 0 : s.innerText) || (s == null ? void 0 : s.textContent) || t(this, Z);
342
+ const a = t(this, Y).querySelector("h1");
343
+ e = (a == null ? void 0 : a.innerText) || (a == null ? void 0 : a.textContent) || t(this, Q);
342
344
  }
343
345
  return e;
344
346
  }
@@ -346,7 +348,7 @@ class ae {
346
348
  t(this, T).x = 0, t(this, T).y = 0;
347
349
  }
348
350
  clearDocumentState() {
349
- o(this, _, null);
351
+ o(this, Z, null);
350
352
  }
351
353
  saveScrollState() {
352
354
  t(this, V).documentElement.hasAttribute(
@@ -363,7 +365,7 @@ class ae {
363
365
  saveDocumentState() {
364
366
  t(this, V).documentElement.hasAttribute(
365
367
  "data-no-page-restoration"
366
- ) ? o(this, _, null) : o(this, _, document.cloneNode(!0));
368
+ ) ? o(this, Z, null) : o(this, Z, document.cloneNode(!0));
367
369
  }
368
370
  renewScrollPosition() {
369
371
  t(this, W).scrollElement.scroll({
@@ -373,56 +375,56 @@ class ae {
373
375
  });
374
376
  }
375
377
  saveState(e) {
376
- o(this, lt, e);
378
+ o(this, ht, e);
377
379
  }
378
380
  clearState() {
379
- const e = t(this, lt);
380
- return o(this, lt, null), e;
381
+ const e = t(this, ht);
382
+ return o(this, ht, null), e;
381
383
  }
382
384
  }
383
- W = new WeakMap(), Z = new WeakMap(), T = new WeakMap(), V = new WeakMap(), _ = new WeakMap(), Y = new WeakMap(), lt = new WeakMap(), tt = new WeakMap(), $ = new WeakMap(), St = new WeakMap(), ct = new WeakMap();
384
- var q, dt, A, j, b, et, F, G, D, yt, O, At, st, ut, mt, Pt, pt, kt, p, Ft, wt, gt, Ot, ce, Bt, Xt, Kt, Yt, Tt, ft;
385
- const bt = class bt {
385
+ W = new WeakMap(), Q = new WeakMap(), T = new WeakMap(), V = new WeakMap(), Z = new WeakMap(), Y = new WeakMap(), ht = new WeakMap(), _ = new WeakMap(), $ = new WeakMap(), Lt = new WeakMap(), lt = new WeakMap();
386
+ var z, ct, P, j, b, tt, F, G, N, St, O, At, et, dt, ut, Pt, mt, yt, f, Ft, kt, pt, Ot, de, Bt, Xt, Kt, Yt, Tt, ft;
387
+ const gt = class gt {
386
388
  constructor(e) {
387
- l(this, p);
388
- l(this, q, null);
389
- l(this, dt, null);
390
- l(this, A, []);
389
+ l(this, f);
390
+ l(this, z, null);
391
+ l(this, ct, null);
392
+ l(this, P, []);
391
393
  l(this, j);
392
394
  l(this, b, null);
393
- l(this, et);
395
+ l(this, tt);
394
396
  l(this, F, []);
395
397
  l(this, G, !1);
396
- l(this, D, null);
397
- l(this, yt, !1);
398
+ l(this, N, null);
399
+ l(this, St, !1);
398
400
  l(this, O, /* @__PURE__ */ new Map());
399
401
  l(this, At, []);
400
- l(this, st, null);
402
+ l(this, et, null);
403
+ l(this, dt, 0);
401
404
  l(this, ut, 0);
402
- l(this, mt, 0);
403
405
  l(this, Pt);
404
- l(this, pt);
405
- l(this, kt);
406
- l(this, wt, (e) => {
407
- var s, a;
408
- return (((s = e.getAttribute("href")) == null ? void 0 : s.startsWith("/")) || ((a = e.getAttribute("href")) == null ? void 0 : a.startsWith("?"))) && !e.hasAttribute("download") && !e.hasAttribute("data-morph-skip") && !e.closest("[data-morph-skip]") && e.getAttribute("target") !== "_blank";
406
+ l(this, mt);
407
+ l(this, yt);
408
+ l(this, kt, (e) => {
409
+ var a, i;
410
+ return (((a = e.getAttribute("href")) == null ? void 0 : a.startsWith("/")) || ((i = e.getAttribute("href")) == null ? void 0 : i.startsWith("?"))) && !e.hasAttribute("download") && !e.hasAttribute("data-morph-skip") && !e.closest("[data-morph-skip]") && e.getAttribute("target") !== "_blank";
409
411
  });
410
- l(this, Tt, (e) => Q(this, null, function* () {
412
+ l(this, Tt, (e) => J(this, null, function* () {
411
413
  e.preventDefault(), o(this, G, !0), yield this.navigate(location.href.replace(location.origin, ""), {
412
414
  historyAction: "none",
413
- submorph: t(this, pt) ? void 0 : t(this, Pt),
414
- revalidate: t(this, pt),
415
- keepScrollPosition: t(this, kt)
415
+ submorph: t(this, mt) ? void 0 : t(this, Pt),
416
+ revalidate: t(this, mt),
417
+ keepScrollPosition: t(this, yt)
416
418
  }), o(this, G, !1);
417
419
  }));
418
420
  l(this, ft, () => {
419
- const { left: e, top: s } = this.scrollValue, a = s - t(this, mt), n = e - t(this, ut);
420
- o(this, mt, s), o(this, ut, e), document.documentElement.classList.toggle("scroll-y", s > 0), document.documentElement.classList.toggle("scroll-x", e > 0), document.documentElement.classList.toggle(
421
+ const { left: e, top: a } = this.scrollValue, i = a - t(this, ut), n = e - t(this, dt);
422
+ o(this, ut, a), o(this, dt, e), document.documentElement.classList.toggle("scroll-y", a > 0), document.documentElement.classList.toggle("scroll-x", e > 0), document.documentElement.classList.toggle(
421
423
  "scroll-y-forward",
422
- a > 0
424
+ i > 0
423
425
  ), document.documentElement.classList.toggle(
424
426
  "scroll-y-backward",
425
- a < 0
427
+ i < 0
426
428
  ), document.documentElement.classList.toggle(
427
429
  "scroll-x-forward",
428
430
  n > 0
@@ -432,82 +434,83 @@ const bt = class bt {
432
434
  ), I(document, "morphScroll", {
433
435
  detail: {
434
436
  left: e,
435
- top: s
437
+ top: a
436
438
  }
437
439
  });
438
440
  });
439
- if (re && !bt.instance) {
440
- bt.instance = this, o(this, q, {
441
- base: Ae(e == null ? void 0 : e.base),
441
+ if (oe && !gt.instance) {
442
+ gt.instance = this, o(this, z, {
443
+ base: ye(e == null ? void 0 : e.base),
442
444
  waitForHeadToLoad: (e == null ? void 0 : e.waitForHeadToLoad) !== !1,
443
445
  trailingSlash: (e == null ? void 0 : e.trailingSlash) || !1,
444
446
  scrollSelector: e == null ? void 0 : e.scrollSelector,
445
447
  morphInsideScrollContainer: (e == null ? void 0 : e.morphInsideScrollContainer) || !1
446
- }), o(this, dt, g(this, p, Ot).call(this, document.body));
447
- const s = this.normalizePath(
448
+ }), o(this, ct, g(this, f, Ot).call(this, document.body));
449
+ const a = this.normalizePath(
448
450
  location.pathname + location.search + location.hash
449
451
  );
450
- o(this, b, s);
451
- const a = new ae(this, t(this, b).pathname);
452
- a.setInitialDocument(document), t(this, O).set(t(this, b).pathname, a), document.documentElement.setAttribute(
452
+ o(this, b, a);
453
+ const i = new ne(this, t(this, b).pathname);
454
+ i.setInitialDocument(document), t(this, O).set(t(this, b).pathname, i), document.documentElement.setAttribute(
453
455
  "data-current-pathname",
454
456
  t(this, b).pathname
455
457
  ), document.documentElement.setAttribute(
456
458
  "data-current-leaf",
457
- s.leaf
459
+ a.leaf
458
460
  ), this.findLinks(), this.findParamsDependent(), history.scrollRestoration = "manual", addEventListener("popstate", t(this, Tt)), It({
459
461
  action: "replace",
460
- pathname: s.pathname,
461
- searchParameters: s.parameters,
462
- hash: s.hash
463
- }), o(this, st, new he()), g(this, p, Kt).call(this, document);
462
+ pathname: a.pathname,
463
+ searchParameters: a.parameters,
464
+ hash: a.hash
465
+ }), o(this, et, new le()), g(this, f, Kt).call(this, document);
464
466
  }
465
467
  }
466
468
  get currentURL() {
467
469
  return t(this, b);
468
470
  }
469
471
  get previousURL() {
470
- return t(this, et);
472
+ return t(this, tt);
471
473
  }
472
474
  get links() {
473
- return t(this, A);
475
+ return t(this, P);
474
476
  }
475
477
  get scrollElement() {
476
- return t(this, D);
478
+ return t(this, N);
477
479
  }
478
480
  get isPopstateNavigation() {
479
481
  return t(this, G);
480
482
  }
481
483
  get scrollValue() {
482
- let e = 0, s = 0;
483
- return t(this, yt) ? (e = window.scrollY, s = window.scrollX) : (e = t(this, D).scrollTop, s = t(this, D).scrollLeft), { top: e, left: s };
484
+ let e = 0, a = 0;
485
+ return t(this, St) ? (e = window.scrollY, a = window.scrollX) : (e = t(this, N).scrollTop, a = t(this, N).scrollLeft), { top: e, left: a };
484
486
  }
485
487
  get isNavigating() {
486
488
  return !!t(this, F).length;
487
489
  }
488
490
  saveState(e) {
489
- const s = t(this, O).get(t(this, b).path);
490
- s && s.saveState(e);
491
+ const a = t(this, O).get(t(this, b).path);
492
+ a && a.saveState(e);
491
493
  }
492
494
  getState() {
493
495
  const e = t(this, O).get(t(this, b).path);
494
496
  return e == null ? void 0 : e.clearState();
495
497
  }
496
- normalizePath(e, s) {
497
- return Pe(e, {
498
- base: t(this, q).base,
499
- trailingSlash: t(this, q).trailingSlash,
500
- mergeParams: s != null && s.mergeParams ? location.search : ""
498
+ normalizePath(e, a) {
499
+ return ke(e, {
500
+ base: t(this, z).base,
501
+ trailingSlash: t(this, z).trailingSlash,
502
+ mergeParams: a != null && a.mergeParams ? location.search : "",
503
+ removeParams: a == null ? void 0 : a.removeParams
501
504
  });
502
505
  }
503
- prefetch(e, s) {
504
- return Q(this, null, function* () {
506
+ prefetch(e, a) {
507
+ return J(this, null, function* () {
505
508
  var n;
506
509
  if (t(this, F).length)
507
510
  return;
508
511
  e = ((n = this.pathnameModifier) == null ? void 0 : n.call(this, e)) || e;
509
- const a = g(this, p, gt).call(this, e);
510
- a == null || a.fetch(e, t(this, b).path, s);
512
+ const i = g(this, f, pt).call(this, e);
513
+ i == null || i.fetch(e, t(this, b).path, a);
511
514
  });
512
515
  }
513
516
  excludeHeadChild(e) {
@@ -516,251 +519,255 @@ const bt = class bt {
516
519
  setHeaders(e) {
517
520
  }
518
521
  needRavalidation(e) {
519
- const s = this.normalizePath(e), a = g(this, p, gt).call(this, s.path);
520
- a == null || a.needRavalidation();
522
+ const a = this.normalizePath(e), i = g(this, f, pt).call(this, a.path);
523
+ i == null || i.needRavalidation();
521
524
  }
522
- navigate(P) {
523
- return Q(this, arguments, function* (e, {
524
- historyAction: s = "push",
525
- centerScroll: a,
525
+ navigate(w) {
526
+ return J(this, arguments, function* (e, {
527
+ historyAction: a = "push",
528
+ centerScroll: i,
526
529
  offsetScroll: n,
527
- scrollBehaviour: E,
528
- revalidate: f,
529
- keepSearchParameters: d,
530
+ scrollBehaviour: v,
531
+ revalidate: p,
532
+ keepSearchParameters: u,
530
533
  submorph: c,
531
- submorphAppend: v,
532
- clearState: it,
533
- keepScrollPosition: w,
534
- mergeParams: at,
535
- detail: M
534
+ submorphAppend: E,
535
+ clearState: at,
536
+ keepScrollPosition: k,
537
+ mergeParams: st,
538
+ removeParams: q,
539
+ detail: L
536
540
  } = {}) {
537
- var J, B, nt, H;
541
+ var B, it, H, $t;
538
542
  if (t(this, F).length)
539
543
  return;
540
- o(this, Pt, c), o(this, pt, f), o(this, kt, w);
541
- const y = ((J = this.pathnameModifier) == null ? void 0 : J.call(this, e)) || e, m = this.normalizePath(y, {
542
- mergeParams: at
544
+ o(this, Pt, c), o(this, mt, p), o(this, yt, k);
545
+ const wt = ((B = this.pathnameModifier) == null ? void 0 : B.call(this, e)) || e, d = this.normalizePath(wt, {
546
+ mergeParams: st,
547
+ removeParams: q
543
548
  });
544
- if (!f && (((B = t(this, j)) == null ? void 0 : B.pathname) === m.pathname || t(this, b).pathname === m.pathname)) {
545
- w || g(this, p, Yt).call(this, m.hash || 0, {
546
- centerScroll: a,
549
+ if (!p && (((it = t(this, j)) == null ? void 0 : it.pathname) === d.pathname || t(this, b).pathname === d.pathname)) {
550
+ k || g(this, f, Yt).call(this, d.hash || 0, {
551
+ centerScroll: i,
547
552
  offsetScroll: n,
548
553
  behavior: "smooth"
549
554
  }), I(document, "morphSamePath", {
550
- custom: !0
551
- }), ((nt = t(this, b)) == null ? void 0 : nt.parameters) !== m.parameters && (o(this, et, t(this, b)), o(this, b, m), It({
552
- action: ((H = t(this, b)) == null ? void 0 : H.hash) !== m.hash ? "replace" : s,
553
- pathname: m.pathname,
554
- searchParameters: m.parameters,
555
- hash: m.hash
555
+ detail: {
556
+ detail: L
557
+ }
558
+ }), ((H = t(this, b)) == null ? void 0 : H.parameters) !== d.parameters && (o(this, tt, t(this, b)), o(this, b, d), It({
559
+ action: (($t = t(this, b)) == null ? void 0 : $t.hash) !== d.hash ? "replace" : a,
560
+ pathname: d.pathname,
561
+ searchParameters: d.parameters,
562
+ hash: d.hash
556
563
  }), I(document, "morphURLParametersChange", {
557
564
  detail: {
558
565
  newURL: t(this, b),
559
- previousURL: t(this, et),
560
- detail: M
566
+ previousURL: t(this, tt),
567
+ detail: L
561
568
  }
562
- })), t(this, A).forEach((X) => {
563
- X.checkCurrent(m.path);
569
+ })), t(this, P).forEach((X) => {
570
+ X.checkCurrent(d.path);
564
571
  });
565
572
  return;
566
573
  } else
567
- t(this, A).forEach((X) => {
568
- X.checkCurrent(m.path);
574
+ t(this, P).forEach((X) => {
575
+ X.checkCurrent(d.path);
569
576
  });
570
- o(this, j, m);
577
+ o(this, j, d);
571
578
  try {
572
579
  let X = !0;
573
580
  if (this.preprocessor)
574
581
  try {
575
- yield new Promise((r, k) => {
576
- var N;
577
- (N = this.preprocessor) == null || N.call(this, {
578
- url: m,
582
+ yield new Promise((r, y) => {
583
+ var M;
584
+ (M = this.preprocessor) == null || M.call(this, {
585
+ url: d,
579
586
  resolve: r,
580
- reject: k,
587
+ reject: y,
581
588
  submorph: c,
582
- detail: M
589
+ detail: L
583
590
  });
584
591
  });
585
592
  } catch (r) {
586
593
  r ? console.error(r) : console.log("Route change canceled"), X = !1;
587
594
  }
588
- if (!X || t(this, j).pathname !== m.pathname) {
589
- t(this, A).forEach((r) => {
595
+ if (!X || t(this, j).pathname !== d.pathname) {
596
+ t(this, P).forEach((r) => {
590
597
  r.checkCurrent(t(this, b).path);
591
598
  });
592
599
  return;
593
600
  }
594
- const $t = {
595
- url: m,
601
+ const jt = {
602
+ url: d,
596
603
  submorph: c,
597
- detail: M
604
+ detail: L
598
605
  };
599
- c ? v || c.forEach((r) => {
600
- document.querySelectorAll(r).forEach((k) => {
601
- k.classList.add("out"), k.setAttribute("data-morph-out", "");
606
+ c ? E || c.forEach((r) => {
607
+ document.querySelectorAll(r).forEach((y) => {
608
+ y.classList.add("out"), y.setAttribute("data-morph-out", "");
602
609
  });
603
- }) : t(this, dt).forEach((r) => {
604
- var k, N;
605
- (k = r.firstElementChild) == null || k.classList.add("out"), (N = r.firstElementChild) == null || N.setAttribute("data-morph-out", "");
610
+ }) : t(this, ct).forEach((r) => {
611
+ var y, M;
612
+ (y = r.firstElementChild) == null || y.classList.add("out"), (M = r.firstElementChild) == null || M.setAttribute("data-morph-out", "");
606
613
  }), I(document, "morphNavigation", {
607
- detail: $t
614
+ detail: jt
608
615
  });
609
- const Mt = g(this, p, gt).call(this, t(this, b).pathname), S = g(this, p, gt).call(this, m.pathname);
616
+ const Mt = g(this, f, pt).call(this, t(this, b).pathname), A = g(this, f, pt).call(this, d.pathname);
610
617
  if (t(this, O).forEach((r) => {
611
- r.pathname !== m.pathname && r.abort();
612
- }), yield S == null ? void 0 : S.fetch(y, t(this, b).path, f), t(this, j).pathname !== m.pathname) {
613
- t(this, A).forEach((r) => {
618
+ r.pathname !== d.pathname && r.abort();
619
+ }), yield A == null ? void 0 : A.fetch(wt, t(this, b).path, p), t(this, j).pathname !== d.pathname) {
620
+ t(this, P).forEach((r) => {
614
621
  r.checkCurrent(t(this, b).path);
615
622
  });
616
623
  return;
617
624
  }
618
- Mt.clearState(), Mt.saveScrollState(), Mt.saveDocumentState(), (!t(this, G) || f) && (S.clearScrollState(), S.clearDocumentState()), it && S.clearState(), S.cloneDocument(), t(this, st).textContent = S.title, document.body.appendChild(t(this, st));
619
- const Ct = zt(Ht({}, $t), {
620
- document: S.document
625
+ Mt.clearState(), Mt.saveScrollState(), Mt.saveDocumentState(), (!t(this, G) || p) && (A.clearScrollState(), A.clearDocumentState()), at && A.clearState(), A.cloneDocument(), t(this, et).textContent = A.title, document.body.appendChild(t(this, et));
626
+ const Ct = zt(Ht({}, jt), {
627
+ document: A.document
621
628
  });
622
- v || Ct.document.querySelectorAll("[data-morph-out]").forEach((r) => {
629
+ E || Ct.document.querySelectorAll("[data-morph-out]").forEach((r) => {
623
630
  r.classList.remove("out");
624
631
  }), I(document, "morphStart", {
625
632
  detail: Ct
626
633
  });
627
- const jt = Array.from(document.head.children), Gt = Array.from(S.document.head.children), Jt = g(this, p, ce).call(this, jt, Gt), de = g(this, p, Bt).call(this, jt, Jt), Rt = g(this, p, Bt).call(this, Gt, Jt).filter((r) => !this.excludeHeadChild(r));
628
- Rt.forEach((r, k) => {
629
- r.tagName === "SCRIPT" && (Rt[k] = g(this, p, Ft).call(this, r));
634
+ const Gt = Array.from(document.head.children), Jt = Array.from(A.document.head.children), Qt = g(this, f, de).call(this, Gt, Jt), ue = g(this, f, Bt).call(this, Gt, Qt), Rt = g(this, f, Bt).call(this, Jt, Qt).filter((r) => !this.excludeHeadChild(r));
635
+ Rt.forEach((r, y) => {
636
+ r.tagName === "SCRIPT" && (Rt[y] = g(this, f, Ft).call(this, r));
630
637
  }), Rt.forEach((r) => {
631
638
  document.head.appendChild(r);
632
639
  });
633
640
  const Nt = Rt.filter((r) => {
634
641
  if (r.hasAttribute("data-no-waiting"))
635
642
  return !1;
636
- if (g(this, p, Xt).call(this, r))
643
+ if (g(this, f, Xt).call(this, r))
637
644
  return !0;
638
645
  });
639
- t(this, q).waitForHeadToLoad && Nt.length && (yield new Promise((r) => Q(this, null, function* () {
640
- let k = 0;
646
+ t(this, z).waitForHeadToLoad && Nt.length && (yield new Promise((r) => J(this, null, function* () {
647
+ let y = 0;
641
648
  try {
642
- for (var N = ie(Nt), me, K, z; me = !(K = yield N.next()).done; me = !1) {
649
+ for (var M = ie(Nt), fe, K, D; fe = !(K = yield M.next()).done; fe = !1) {
643
650
  const xt = K.value;
644
651
  xt.onload = () => {
645
- k++, k === Nt.length && r();
652
+ y++, y === Nt.length && r();
646
653
  };
647
654
  }
648
655
  } catch (K) {
649
- z = [K];
656
+ D = [K];
650
657
  } finally {
651
658
  try {
652
- me && (K = N.return) && (yield K.call(N));
659
+ fe && (K = M.return) && (yield K.call(M));
653
660
  } finally {
654
- if (z)
655
- throw z[0];
661
+ if (D)
662
+ throw D[0];
656
663
  }
657
664
  }
658
- }))), yield Se(10);
659
- const Qt = [];
660
- v || de.forEach((r) => {
661
- r.hasAttribute("data-permanent") || (g(this, p, Xt).call(this, r) ? Qt.push(r) : r.remove());
665
+ }))), yield Ae(10);
666
+ const Zt = [];
667
+ E || ue.forEach((r) => {
668
+ r.hasAttribute("data-permanent") || (g(this, f, Xt).call(this, r) ? Zt.push(r) : r.remove());
662
669
  });
663
- const ue = g(this, p, Ot).call(this, S.document.body);
664
- !t(this, q).morphInsideScrollContainer && !c && g(this, p, Kt).call(this, S.document), document.documentElement.setAttribute(
670
+ const me = g(this, f, Ot).call(this, A.document.body);
671
+ !t(this, z).morphInsideScrollContainer && !c && g(this, f, Kt).call(this, A.document), document.documentElement.setAttribute(
665
672
  "data-current-pathname",
666
- m.pathname
673
+ d.pathname
667
674
  ), document.documentElement.setAttribute(
668
675
  "data-current-leaf",
669
- m.leaf
676
+ d.leaf
670
677
  ), It({
671
- action: s,
672
- pathname: m.pathname,
673
- searchParameters: m.parameters || (d ? location.search : ""),
674
- hash: m.hash
675
- }), t(this, st).remove(), o(this, et, t(this, b)), o(this, b, m);
678
+ action: a,
679
+ pathname: d.pathname,
680
+ searchParameters: d.parameters || (u ? location.search : ""),
681
+ hash: d.hash
682
+ }), t(this, et).remove(), o(this, tt, t(this, b)), o(this, b, d);
676
683
  const Dt = [];
677
- t(this, dt).forEach((r, k) => {
678
- const N = ue[k], me = getComputedStyle(r).getPropertyValue("--morph-duration");
679
- let K = [], z = [];
680
- c ? (c.forEach((u) => {
681
- const L = r.querySelector(u), C = N.querySelector(u);
682
- L && C && (z.push(L), K.push(C));
683
- }), z.forEach((u) => {
684
- u.parentElement && Dt.push(u.parentElement);
685
- })) : (K.push(...N.childNodes), z.push(...r.childNodes), Dt.push(r));
684
+ t(this, ct).forEach((r, y) => {
685
+ const M = me[y], fe = getComputedStyle(r).getPropertyValue("--morph-duration");
686
+ let K = [], D = [];
687
+ c ? (c.forEach((m) => {
688
+ const S = r.querySelector(m), C = M.querySelector(m);
689
+ S && C && (D.push(S), K.push(C));
690
+ }), D.forEach((m) => {
691
+ m.parentElement && Dt.push(m.parentElement);
692
+ })) : (K.push(...M.childNodes), D.push(...r.childNodes), Dt.push(r));
686
693
  const xt = [];
687
- v || z.forEach((u) => {
688
- u instanceof HTMLElement && (this.destroyOldLinks(u), u.classList.add("old"), u.querySelectorAll(
694
+ E || D.forEach((m) => {
695
+ m instanceof HTMLElement && (this.destroyOldLinks(m), m.classList.add("old"), m.querySelectorAll(
689
696
  "[data-morph-transfer]"
690
697
  ).forEach((C) => {
691
- const fe = C.getAttribute("data-morph-transfer");
698
+ const ge = C.getAttribute("data-morph-transfer");
692
699
  xt.push({
693
700
  element: C,
694
- selector: fe
701
+ selector: ge
695
702
  });
696
703
  }));
697
- }), K.forEach((u) => {
698
- u instanceof HTMLElement && (xt.forEach((L) => {
699
- const C = u.querySelector(L.selector);
704
+ }), K.forEach((m) => {
705
+ m instanceof HTMLElement && (xt.forEach((S) => {
706
+ const C = m.querySelector(S.selector);
700
707
  C && C.replaceWith(
701
- S.document.importNode(L.element, !0)
708
+ A.document.importNode(S.element, !0)
702
709
  );
703
- }), this.findNewLinks(u), u.classList.add("new"));
704
- }), c ? v ? K.forEach((u, L) => {
705
- z[L] instanceof HTMLElement && z[L].append(...u.childNodes);
706
- }) : K.forEach((u, L) => {
710
+ }), this.findNewLinks(m), m.classList.add("new"));
711
+ }), c ? E ? K.forEach((m, S) => {
712
+ D[S] instanceof HTMLElement && D[S].append(...m.childNodes);
713
+ }) : K.forEach((m, S) => {
707
714
  var C;
708
- (C = z[L].parentElement) == null || C.insertBefore(
709
- u,
710
- z[L]
715
+ (C = D[S].parentElement) == null || C.insertBefore(
716
+ m,
717
+ D[S]
711
718
  );
712
719
  }) : r.prepend(...K), setTimeout(() => {
713
- v || z.forEach((u) => {
714
- u instanceof HTMLElement && u.classList.add("old-idle");
715
- }), K.forEach((u) => {
716
- var L;
717
- u instanceof HTMLElement && ((L = u.parentElement) == null || L.style.setProperty(
720
+ E || D.forEach((m) => {
721
+ m instanceof HTMLElement && m.classList.add("old-idle");
722
+ }), K.forEach((m) => {
723
+ var S;
724
+ m instanceof HTMLElement && ((S = m.parentElement) == null || S.style.setProperty(
718
725
  "--new-content-height",
719
- u.offsetHeight + "px"
720
- ), u.classList.add("new-idle"));
726
+ m.offsetHeight + "px"
727
+ ), m.classList.add("new-idle"));
721
728
  });
722
729
  }, 0);
723
- const Zt = zt(Ht({}, Ct), {
730
+ const _t = zt(Ht({}, Ct), {
724
731
  morphElement: r
725
732
  });
726
733
  I(document, "morphNewChildrenAdded", {
727
- detail: Zt
734
+ detail: _t
728
735
  });
729
- const pe = new Promise((u) => {
736
+ const pe = new Promise((m) => {
730
737
  setTimeout(
731
738
  () => {
732
- v || z.forEach((L) => {
733
- L.remove();
734
- }), K.forEach((L) => {
739
+ E || D.forEach((S) => {
740
+ S.remove();
741
+ }), K.forEach((S) => {
735
742
  var C;
736
- L instanceof HTMLElement && ((C = L.parentElement) == null || C.style.removeProperty(
743
+ S instanceof HTMLElement && ((C = S.parentElement) == null || C.style.removeProperty(
737
744
  "--new-content-height"
738
- ), L.classList.remove("new-idle", "new"));
739
- }), v || I(document, "morphOldChildrenRemoved", {
740
- detail: Zt
741
- }), u();
745
+ ), S.classList.remove("new-idle", "new"));
746
+ }), E || I(document, "morphOldChildrenRemoved", {
747
+ detail: _t
748
+ }), m();
742
749
  },
743
- (parseFloat(me) || 0) * 1e3 + 10
750
+ (parseFloat(fe) || 0) * 1e3 + 10
744
751
  );
745
752
  });
746
753
  t(this, F).push(pe);
747
754
  }), this.isPopstateNavigation ? document.documentElement.style.setProperty(
748
755
  "--new-document-scroll-position",
749
- (this.scrollValue.top - S.scrollState.y) * 1 + "px"
756
+ (this.scrollValue.top - A.scrollState.y) * 1 + "px"
750
757
  ) : document.documentElement.style.setProperty(
751
758
  "--new-document-scroll-position",
752
759
  this.scrollValue.top + "px"
753
760
  ), I(document, "morphBeforeNavigationScroll", {
754
- detail: S.scrollState
755
- }), m.hash ? (S.clearScrollState(), g(this, p, Yt).call(this, m.hash, {
756
- centerScroll: a,
761
+ detail: A.scrollState
762
+ }), d.hash ? (A.clearScrollState(), g(this, f, Yt).call(this, d.hash, {
763
+ centerScroll: i,
757
764
  offsetScroll: n,
758
- behavior: E
759
- })) : t(this, G) ? S.restoreScrollPosition() : w || S.renewScrollPosition(), yield Promise.all(t(this, F)), v || Qt.forEach((r) => r.remove()), o(this, F, []), Dt.forEach((r) => {
760
- r.querySelectorAll("script").forEach((N) => {
761
- N.replaceWith(g(this, p, Ft).call(this, N));
765
+ behavior: v
766
+ })) : t(this, G) ? A.restoreScrollPosition() : k || A.renewScrollPosition(), yield Promise.all(t(this, F)), E || Zt.forEach((r) => r.remove()), o(this, F, []), Dt.forEach((r) => {
767
+ r.querySelectorAll("script").forEach((M) => {
768
+ M.replaceWith(g(this, f, Ft).call(this, M));
762
769
  });
763
- }), t(this, A).forEach((r) => {
770
+ }), t(this, P).forEach((r) => {
764
771
  r.checkCurrent(t(this, b).path);
765
772
  }), this.findParamsDependent(), I(document, "morphComplete", {
766
773
  detail: Ct
@@ -774,32 +781,32 @@ const bt = class bt {
774
781
  });
775
782
  }
776
783
  addLink(e) {
777
- t(this, A).push(new Wt(e, this));
784
+ t(this, P).push(new Wt(e, this));
778
785
  }
779
786
  addLinks(e) {
780
- e.forEach((s) => {
781
- this.addLink(s);
787
+ e.forEach((a) => {
788
+ this.addLink(a);
782
789
  });
783
790
  }
784
791
  removeLink(e) {
785
- o(this, A, t(this, A).filter((s) => s.element === e ? (s.destroy(), !1) : !0));
792
+ o(this, P, t(this, P).filter((a) => a.element === e ? (a.destroy(), !1) : !0));
786
793
  }
787
794
  destroyOldLinks(e) {
788
- o(this, A, t(this, A).filter((s) => e.contains(s.element) ? (s.destroy(), !1) : !0));
795
+ o(this, P, t(this, P).filter((a) => e.contains(a.element) ? (a.destroy(), !1) : !0));
789
796
  }
790
797
  findNewLinks(e) {
791
- const s = [...e.querySelectorAll("a")].filter(
792
- t(this, wt)
798
+ const a = [...e.querySelectorAll("a")].filter(
799
+ t(this, kt)
793
800
  );
794
- t(this, A).push(
795
- ...s.map((a) => new Wt(a, this))
801
+ t(this, P).push(
802
+ ...a.map((i) => new Wt(i, this))
796
803
  );
797
804
  }
798
805
  findLinks() {
799
806
  const e = [
800
807
  ...document.documentElement.querySelectorAll("a")
801
- ].filter(t(this, wt));
802
- t(this, A).forEach((s) => s.destroy()), o(this, A, e.map((s) => new Wt(s, this)));
808
+ ].filter(t(this, kt));
809
+ t(this, P).forEach((a) => a.destroy()), o(this, P, e.map((a) => new Wt(a, this)));
803
810
  }
804
811
  findParamsDependent() {
805
812
  const e = [
@@ -807,55 +814,55 @@ const bt = class bt {
807
814
  "[data-morph-params-dependent]"
808
815
  )
809
816
  ];
810
- t(this, At).forEach((s) => s.destroy()), o(this, At, e.map(
811
- (s) => new Ce(s)
817
+ t(this, At).forEach((a) => a.destroy()), o(this, At, e.map(
818
+ (a) => new Re(a)
812
819
  ));
813
820
  }
814
821
  };
815
- q = new WeakMap(), dt = new WeakMap(), A = new WeakMap(), j = new WeakMap(), b = new WeakMap(), et = new WeakMap(), F = new WeakMap(), G = new WeakMap(), D = new WeakMap(), yt = new WeakMap(), O = new WeakMap(), At = new WeakMap(), st = new WeakMap(), ut = new WeakMap(), mt = new WeakMap(), Pt = new WeakMap(), pt = new WeakMap(), kt = new WeakMap(), p = new WeakSet(), Ft = function(e) {
816
- const s = document.createElement("script");
817
- for (let a = 0; a < e.attributes.length; a++) {
818
- const n = e.attributes[a];
819
- s.setAttribute(n.name, n.value);
820
- }
821
- return e.hasAttribute("src") || (s.innerHTML = e.innerHTML), s;
822
- }, wt = new WeakMap(), gt = function(e) {
823
- const s = this.normalizePath(e);
824
- let a = t(this, O).get(s.pathname);
825
- return a || (a = new ae(this, s.pathname), t(this, O).set(s.pathname, a)), a;
822
+ z = new WeakMap(), ct = new WeakMap(), P = new WeakMap(), j = new WeakMap(), b = new WeakMap(), tt = new WeakMap(), F = new WeakMap(), G = new WeakMap(), N = new WeakMap(), St = new WeakMap(), O = new WeakMap(), At = new WeakMap(), et = new WeakMap(), dt = new WeakMap(), ut = new WeakMap(), Pt = new WeakMap(), mt = new WeakMap(), yt = new WeakMap(), f = new WeakSet(), Ft = function(e) {
823
+ const a = document.createElement("script");
824
+ for (let i = 0; i < e.attributes.length; i++) {
825
+ const n = e.attributes[i];
826
+ a.setAttribute(n.name, n.value);
827
+ }
828
+ return e.hasAttribute("src") || (a.innerHTML = e.innerHTML), a;
829
+ }, kt = new WeakMap(), pt = function(e) {
830
+ const a = this.normalizePath(e);
831
+ let i = t(this, O).get(a.pathname);
832
+ return i || (i = new ne(this, a.pathname), t(this, O).set(a.pathname, i)), i;
826
833
  }, Ot = function(e) {
827
- const s = [...e.querySelectorAll("[data-morph]")];
828
- return s.length ? s : [e];
829
- }, ce = function(e, s) {
834
+ const a = [...e.querySelectorAll("[data-morph]")];
835
+ return a.length ? a : [e];
836
+ }, de = function(e, a) {
830
837
  return e.filter(
831
- (a) => s.find(
832
- (n) => n.outerHTML === a.outerHTML
838
+ (i) => a.find(
839
+ (n) => n.outerHTML === i.outerHTML
833
840
  )
834
841
  );
835
- }, Bt = function(e, s) {
842
+ }, Bt = function(e, a) {
836
843
  return e.filter(
837
- (a) => !s.find(
838
- (n) => n.outerHTML === a.outerHTML
844
+ (i) => !a.find(
845
+ (n) => n.outerHTML === i.outerHTML
839
846
  )
840
847
  );
841
848
  }, Xt = function(e) {
842
849
  return e.tagName === "SCRIPT" || e.tagName === "STYLE" || e.tagName === "LINK" && e.getAttribute("rel") === "stylesheet";
843
850
  }, Kt = function(e) {
844
- var s, a;
845
- (s = t(this, D)) == null || s.removeEventListener(
851
+ var a, i;
852
+ (a = t(this, N)) == null || a.removeEventListener(
846
853
  "scroll",
847
854
  t(this, ft)
848
- ), o(this, mt, 0), o(this, ut, 0), o(this, D, t(this, q).scrollSelector && e.querySelector(t(this, q).scrollSelector) || window), o(this, yt, t(this, D) === window), (a = t(this, D)) == null || a.addEventListener("scroll", t(this, ft)), t(this, ft).call(this);
849
- }, Yt = function(e, s) {
850
- const a = typeof e == "string" ? document.getElementById(e) : e;
851
- (typeof a == "number" || a) && ye(a, {
852
- scrollElement: t(this, D),
853
- behavior: (s == null ? void 0 : s.behavior) || "instant",
854
- center: s == null ? void 0 : s.centerScroll,
855
- offset: s == null ? void 0 : s.offsetScroll
855
+ ), o(this, ut, 0), o(this, dt, 0), o(this, N, t(this, z).scrollSelector && e.querySelector(t(this, z).scrollSelector) || window), o(this, St, t(this, N) === window), (i = t(this, N)) == null || i.addEventListener("scroll", t(this, ft)), t(this, ft).call(this);
856
+ }, Yt = function(e, a) {
857
+ const i = typeof e == "string" ? document.getElementById(e) : e;
858
+ (typeof i == "number" || i) && Pe(i, {
859
+ scrollElement: t(this, N),
860
+ behavior: (a == null ? void 0 : a.behavior) || "instant",
861
+ center: a == null ? void 0 : a.centerScroll,
862
+ offset: a == null ? void 0 : a.offsetScroll
856
863
  });
857
- }, Tt = new WeakMap(), ft = new WeakMap(), bt.instance = null;
858
- let ne = bt;
864
+ }, Tt = new WeakMap(), ft = new WeakMap(), gt.instance = null;
865
+ let re = gt;
859
866
  export {
860
- ne as Morph
867
+ re as Morph
861
868
  };