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