aptechka 0.77.2 → 0.77.4

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