aptechka 0.72.8 → 0.73.1

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