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