aptechka 0.44.2 → 0.45.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/{Animation-Je56LXXj.js → Animation-CKBO5DMV.js} +4 -3
- package/lib/Animation-CwizHYX9.cjs +1 -0
- package/lib/{Damped-BMmEn7PH.js → Damped-CucKOQsI.js} +5 -4
- package/lib/Damped-DbaLw6w1.cjs +1 -0
- package/lib/{Tweened-BNCj14Jz.js → Tweened-CcPeZ0UE.js} +7 -6
- package/lib/Tweened-Dm6Avip9.cjs +1 -0
- package/lib/animation/index.cjs +1 -1
- package/lib/animation/index.js +3 -3
- package/lib/controls/index.cjs +1 -1
- package/lib/controls/index.js +2 -2
- package/lib/morph/Morph.d.ts +14 -27
- package/lib/morph/MorphRoute.d.ts +23 -0
- package/lib/morph/index.cjs +1 -1
- package/lib/morph/index.d.ts +1 -1
- package/lib/morph/index.js +329 -306
- package/lib/need_redo_tweaker/index.cjs +3 -3
- package/lib/need_redo_tweaker/index.js +61 -60
- package/lib/number-0243DApo.cjs +1 -0
- package/lib/number-DwCxt_Ck.js +33 -0
- package/lib/pointer/index.cjs +1 -1
- package/lib/pointer/index.js +1 -1
- package/lib/polyfills-DJrTJQky.js +24 -0
- package/lib/polyfills-Df4r-ETT.cjs +1 -0
- package/lib/scroll/index.cjs +1 -1
- package/lib/scroll/index.js +33 -33
- package/lib/scroll-DNUlcfbO.js +22 -0
- package/lib/scroll-DPDSZypW.cjs +1 -0
- package/lib/scroll-segment/index.cjs +1 -1
- package/lib/scroll-segment/index.js +1 -1
- package/lib/utils/index.cjs +1 -1
- package/lib/utils/index.js +158 -172
- package/lib/utils/polyfills.d.ts +1 -0
- package/lib/utils/scroll.d.ts +2 -1
- package/package.json +1 -1
- package/lib/Animation-D1lL_XhF.cjs +0 -1
- package/lib/Damped-BbJjFOLH.cjs +0 -1
- package/lib/Tweened-Dk1UNPSH.cjs +0 -1
- package/lib/polyfills-BANSrI_m.cjs +0 -1
- package/lib/polyfills-CxfUK5OU.js +0 -37
package/lib/morph/index.js
CHANGED
|
@@ -1,368 +1,391 @@
|
|
|
1
|
-
var
|
|
2
|
-
throw TypeError(
|
|
1
|
+
var mt = (i, t) => (t = Symbol[i]) ? t : Symbol.for("Symbol." + i), ft = (i) => {
|
|
2
|
+
throw TypeError(i);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
4
|
+
var _ = (i, t, s) => t.has(i) || ft("Cannot " + s);
|
|
5
|
+
var e = (i, t, s) => (_(i, t, "read from private field"), s ? s.call(i) : t.get(i)), r = (i, t, s) => t.has(i) ? ft("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(i) : t.set(i, s), a = (i, t, s, o) => (_(i, t, "write to private field"), o ? o.call(i, s) : t.set(i, s), s), d = (i, t, s) => (_(i, t, "access private method"), s);
|
|
6
|
+
var M = (i, t, s) => new Promise((o, u) => {
|
|
7
|
+
var m = (l) => {
|
|
8
8
|
try {
|
|
9
|
-
|
|
10
|
-
} catch (
|
|
11
|
-
|
|
9
|
+
A(s.next(l));
|
|
10
|
+
} catch (g) {
|
|
11
|
+
u(g);
|
|
12
12
|
}
|
|
13
|
-
},
|
|
13
|
+
}, V = (l) => {
|
|
14
14
|
try {
|
|
15
|
-
|
|
16
|
-
} catch (
|
|
17
|
-
|
|
15
|
+
A(s.throw(l));
|
|
16
|
+
} catch (g) {
|
|
17
|
+
u(g);
|
|
18
18
|
}
|
|
19
|
-
},
|
|
20
|
-
|
|
19
|
+
}, A = (l) => l.done ? o(l.value) : Promise.resolve(l.value).then(m, V);
|
|
20
|
+
A((s = s.apply(i, t)).next());
|
|
21
21
|
});
|
|
22
|
-
var
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import
|
|
27
|
-
import {
|
|
28
|
-
|
|
29
|
-
class
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
restoreScrollState: t(this, W)
|
|
22
|
+
var pt = (i, t, s) => (t = i[mt("asyncIterator")]) ? t.call(i) : (i = i[mt("iterator")](), t = {}, s = (o, u) => (u = i[o]) && (t[o] = (m) => new Promise((V, A, l) => (m = u.call(i, m), l = m.done, Promise.resolve(m.value).then((g) => V({ value: g, done: l }), A)))), s("next"), s("return"), t);
|
|
23
|
+
import { d as Q } from "../events-CsVF98U6.js";
|
|
24
|
+
import { r as Mt } from "../polyfills-DJrTJQky.js";
|
|
25
|
+
import { s as Tt } from "../scroll-DNUlcfbO.js";
|
|
26
|
+
import "../index-euf5anj6.js";
|
|
27
|
+
import { n as Ct, c as Et, s as Ht } from "../url-CfcHdBT6.js";
|
|
28
|
+
import { cssValueParser as kt } from "../css-value-parser/index.js";
|
|
29
|
+
class St extends HTMLElement {
|
|
30
|
+
connectedCallback() {
|
|
31
|
+
const t = {
|
|
32
|
+
"aria-live": "assertive",
|
|
33
|
+
"aria-atomic": "true",
|
|
34
|
+
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"
|
|
35
|
+
};
|
|
36
|
+
for (const [s, o] of Object.entries(t))
|
|
37
|
+
this.setAttribute(s, o);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
customElements.get("morph-announcer") || customElements.define("morph-announcer", St);
|
|
41
|
+
var R, c, T, W, z;
|
|
42
|
+
class gt {
|
|
43
|
+
constructor(t, s) {
|
|
44
|
+
r(this, R);
|
|
45
|
+
r(this, c);
|
|
46
|
+
r(this, T);
|
|
47
|
+
r(this, W, (t) => {
|
|
48
|
+
t.preventDefault();
|
|
49
|
+
const s = e(this, c).getAttribute(
|
|
50
|
+
"data-history-action"
|
|
51
|
+
) || "push", o = e(this, c).hasAttribute("data-center-scroll"), u = getComputedStyle(e(this, c)).getPropertyValue("--offset-scroll").trim(), m = u ? kt.parse(u) : void 0, V = e(this, c).hasAttribute("data-revalidate");
|
|
52
|
+
e(this, R).navigate(e(this, T), {
|
|
53
|
+
historyAction: s,
|
|
54
|
+
centerScroll: o,
|
|
55
|
+
offsetScroll: m,
|
|
56
|
+
revalidate: V
|
|
58
57
|
});
|
|
59
58
|
});
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
r(this, z, () => {
|
|
60
|
+
e(this, R).prefetch(e(this, T)), e(this, c).removeEventListener("pointerenter", e(this, z));
|
|
62
61
|
});
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
) || "push");
|
|
67
|
-
const n = t(this, h).getAttribute(
|
|
68
|
-
"data-save-scroll-state"
|
|
69
|
-
);
|
|
70
|
-
typeof n == "string" && (n === "" ? a(this, v, Rt(t(this, h))) : a(this, v, document.getElementById(n))), a(this, B, t(this, h).hasAttribute(
|
|
71
|
-
"data-save-document-state"
|
|
72
|
-
)), a(this, Y, t(this, h).hasAttribute(
|
|
73
|
-
"data-restore-document-state"
|
|
74
|
-
)), a(this, W, t(this, h).hasAttribute(
|
|
75
|
-
"data-restore-scroll-state"
|
|
76
|
-
)), a(this, j, t(this, h).getAttribute("data-state") || void 0), t(this, h).addEventListener("click", t(this, K));
|
|
77
|
-
const c = s.normalizePath(t(this, L)), d = s.normalizePath(location.pathname);
|
|
78
|
-
a(this, x, (b = t(this, h).getAttribute("data-match-paths")) == null ? void 0 : b.split(",").map((f) => s.normalizePath(f.trim()).pathname)), t(this, h).hasAttribute("data-include") ? d.pathname.includes(c.pathname) && t(this, h).classList.add("current") : c.pathname === d.pathname || (p = t(this, x)) != null && p.includes(d.pathname) ? (t(this, h).classList.add("current"), t(this, h).classList.add("clicked")) : t(this, h).classList.remove("clicked"), t(this, h).hasAttribute("data-prefetch") && t(this, h).addEventListener("pointerenter", t(this, D));
|
|
62
|
+
a(this, R, s), a(this, c, t), a(this, T, e(this, c).getAttribute("href") || "/"), e(this, c).addEventListener("click", e(this, W));
|
|
63
|
+
const o = s.normalizePath(e(this, T)), u = s.normalizePath(location.pathname);
|
|
64
|
+
e(this, c).hasAttribute("data-include") && u.pathname.includes(o.pathname) ? e(this, c).classList.add("current") : o.pathname === u.pathname && e(this, c).classList.add("current"), e(this, c).hasAttribute("data-prefetch") && e(this, c).addEventListener("pointerenter", e(this, z));
|
|
79
65
|
}
|
|
80
66
|
get element() {
|
|
81
|
-
return
|
|
67
|
+
return e(this, c);
|
|
82
68
|
}
|
|
83
69
|
destroy() {
|
|
84
|
-
|
|
70
|
+
e(this, c).removeEventListener("click", e(this, W)), e(this, c).removeEventListener("pointerenter", e(this, z)), e(this, c).classList.remove("current");
|
|
85
71
|
}
|
|
86
72
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
73
|
+
R = new WeakMap(), c = new WeakMap(), T = new WeakMap(), W = new WeakMap(), z = new WeakMap();
|
|
74
|
+
var C, q, p, H, k, w;
|
|
75
|
+
class Lt {
|
|
76
|
+
constructor(t, s, o) {
|
|
77
|
+
r(this, C);
|
|
78
|
+
r(this, q);
|
|
79
|
+
r(this, p, { x: 0, y: 0 });
|
|
80
|
+
r(this, H);
|
|
81
|
+
r(this, k, null);
|
|
82
|
+
r(this, w, null);
|
|
83
|
+
a(this, C, t), a(this, q, s), a(this, H, o.cloneNode(!0));
|
|
84
|
+
}
|
|
85
|
+
get pathname() {
|
|
86
|
+
return e(this, q);
|
|
87
|
+
}
|
|
88
|
+
get scrollState() {
|
|
89
|
+
return e(this, p);
|
|
90
|
+
}
|
|
91
|
+
get document() {
|
|
92
|
+
return e(this, w);
|
|
93
|
+
}
|
|
94
|
+
cloneDocument() {
|
|
95
|
+
a(this, w, (e(this, k) || e(this, H)).cloneNode(!0));
|
|
96
|
+
}
|
|
97
|
+
get title() {
|
|
98
|
+
let t = "";
|
|
99
|
+
if (e(this, w).title)
|
|
100
|
+
t = e(this, w).title;
|
|
101
|
+
else {
|
|
102
|
+
const s = e(this, w).querySelector("h1");
|
|
103
|
+
t = (s == null ? void 0 : s.innerText) || (s == null ? void 0 : s.textContent) || e(this, q);
|
|
104
|
+
}
|
|
105
|
+
return t;
|
|
106
|
+
}
|
|
107
|
+
clearScrollState() {
|
|
108
|
+
e(this, p).x = 0, e(this, p).y = 0;
|
|
109
|
+
}
|
|
110
|
+
clearDocumentState() {
|
|
111
|
+
a(this, k, null);
|
|
112
|
+
}
|
|
113
|
+
saveScrollState() {
|
|
114
|
+
e(this, H).documentElement.hasAttribute(
|
|
115
|
+
"data-no-scroll-restoration"
|
|
116
|
+
) ? (e(this, p).x = 0, e(this, p).y = 0) : (e(this, p).x = e(this, C).scrollElement.scrollLeft, e(this, p).y = e(this, C).scrollElement.scrollTop);
|
|
117
|
+
}
|
|
118
|
+
saveDocumentState() {
|
|
119
|
+
e(this, H).documentElement.hasAttribute(
|
|
120
|
+
"data-no-page-restoration"
|
|
121
|
+
) ? a(this, k, null) : a(this, k, document.cloneNode(!0));
|
|
122
|
+
}
|
|
123
|
+
restoreScrollPosition() {
|
|
124
|
+
e(this, C).scrollElement.scroll({
|
|
125
|
+
top: e(this, p).y,
|
|
126
|
+
left: e(this, p).x
|
|
127
|
+
});
|
|
97
128
|
}
|
|
98
129
|
}
|
|
99
|
-
|
|
100
|
-
var
|
|
101
|
-
class
|
|
102
|
-
constructor(
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
o(this, w);
|
|
118
|
-
o(this, R);
|
|
119
|
-
o(this, I, !1);
|
|
120
|
-
o(this, T, null);
|
|
121
|
-
o(this, nt, (e) => {
|
|
130
|
+
C = new WeakMap(), q = new WeakMap(), p = new WeakMap(), H = new WeakMap(), k = new WeakMap(), w = new WeakMap();
|
|
131
|
+
var b, B, L, U, P, f, j, x, N, F, I, D, h, $, tt, et, vt, st, it, nt, X;
|
|
132
|
+
class It {
|
|
133
|
+
constructor(t) {
|
|
134
|
+
r(this, h);
|
|
135
|
+
r(this, b);
|
|
136
|
+
r(this, B, null);
|
|
137
|
+
r(this, L, []);
|
|
138
|
+
r(this, U, new DOMParser());
|
|
139
|
+
r(this, P);
|
|
140
|
+
r(this, f, null);
|
|
141
|
+
r(this, j);
|
|
142
|
+
r(this, x, []);
|
|
143
|
+
r(this, N, !1);
|
|
144
|
+
r(this, F, null);
|
|
145
|
+
r(this, I, /* @__PURE__ */ new Map());
|
|
146
|
+
r(this, D, null);
|
|
147
|
+
r(this, X, (t) => M(this, null, function* () {
|
|
122
148
|
var s;
|
|
123
|
-
(s =
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
)
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
149
|
+
(s = t.state) != null && s.path && (a(this, N, !0), yield this.navigate(t.state.path, { historyAction: "none" }), a(this, N, !1));
|
|
150
|
+
}));
|
|
151
|
+
a(this, b, {
|
|
152
|
+
base: Ct(t == null ? void 0 : t.base),
|
|
153
|
+
waitForHeadToLoad: (t == null ? void 0 : t.waitForHeadToLoad) !== !1,
|
|
154
|
+
cachePages: (t == null ? void 0 : t.cachePages) !== !1,
|
|
155
|
+
trailingSlash: (t == null ? void 0 : t.trailingSlash) || !1,
|
|
156
|
+
scrollSelector: (t == null ? void 0 : t.scrollSelector) || "body"
|
|
157
|
+
}), a(this, B, d(this, h, et).call(this, document.body));
|
|
158
|
+
const s = this.normalizePath(location.pathname + location.hash);
|
|
159
|
+
a(this, f, s.pathname), e(this, I).set(
|
|
160
|
+
e(this, f),
|
|
161
|
+
new Lt(this, e(this, f), document)
|
|
162
|
+
), document.documentElement.setAttribute(
|
|
163
|
+
"data-current-pathname",
|
|
164
|
+
e(this, f)
|
|
165
|
+
), document.documentElement.setAttribute(
|
|
166
|
+
"data-current-leaf",
|
|
167
|
+
s.leaf
|
|
168
|
+
), this.findLinks(), addEventListener("popstate", e(this, X)), Et({
|
|
169
|
+
action: "replace",
|
|
170
|
+
pathname: e(this, f),
|
|
171
|
+
searchParameters: s.parameters,
|
|
172
|
+
hash: s.hash
|
|
173
|
+
}), a(this, D, new St()), d(this, h, nt).call(this);
|
|
145
174
|
}
|
|
146
175
|
get currentPathname() {
|
|
147
|
-
return
|
|
176
|
+
return e(this, f);
|
|
148
177
|
}
|
|
149
178
|
get previousPathname() {
|
|
150
|
-
return
|
|
151
|
-
}
|
|
152
|
-
get currentState() {
|
|
153
|
-
return t(this, X);
|
|
179
|
+
return e(this, j);
|
|
154
180
|
}
|
|
155
181
|
get links() {
|
|
156
|
-
return
|
|
182
|
+
return e(this, L);
|
|
183
|
+
}
|
|
184
|
+
get scrollElement() {
|
|
185
|
+
return e(this, F);
|
|
157
186
|
}
|
|
158
|
-
normalizePath(
|
|
159
|
-
return
|
|
160
|
-
base:
|
|
161
|
-
trailingSlash:
|
|
187
|
+
normalizePath(t) {
|
|
188
|
+
return Ht(t, {
|
|
189
|
+
base: e(this, b).base,
|
|
190
|
+
trailingSlash: e(this, b).trailingSlash
|
|
162
191
|
});
|
|
163
192
|
}
|
|
164
|
-
prefetch(
|
|
165
|
-
return
|
|
166
|
-
const s = this.normalizePath(
|
|
167
|
-
|
|
193
|
+
prefetch(t) {
|
|
194
|
+
return M(this, null, function* () {
|
|
195
|
+
const s = this.normalizePath(t);
|
|
196
|
+
d(this, h, tt).call(this, s.pathname);
|
|
168
197
|
});
|
|
169
198
|
}
|
|
170
|
-
navigate(
|
|
171
|
-
return
|
|
199
|
+
navigate(V) {
|
|
200
|
+
return M(this, arguments, function* (t, {
|
|
172
201
|
historyAction: s = "push",
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
restoreDocumentState: b,
|
|
177
|
-
restoreScrollState: p
|
|
202
|
+
centerScroll: o,
|
|
203
|
+
offsetScroll: u,
|
|
204
|
+
revalidate: m
|
|
178
205
|
} = {}) {
|
|
179
|
-
|
|
180
|
-
if (t(this, H).length)
|
|
181
|
-
return;
|
|
182
|
-
t(this, I) || (b || a(this, R, void 0), p || a(this, w, void 0));
|
|
183
|
-
const C = this.normalizePath(e);
|
|
184
|
-
let { pathname: l, hash: Ct, parameters: Mt, leaf: kt } = C;
|
|
185
|
-
if (t(this, P) === l || t(this, E) === l)
|
|
206
|
+
if (e(this, x).length)
|
|
186
207
|
return;
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
return;
|
|
206
|
-
if (a(this, R, d ? document.cloneNode(!0) : void 0), N.title)
|
|
207
|
-
t(this, T).textContent = N.title;
|
|
208
|
-
else {
|
|
209
|
-
const i = N.querySelector("h1"), g = (i == null ? void 0 : i.innerText) || (i == null ? void 0 : i.textContent) || l;
|
|
210
|
-
t(this, T).textContent = g;
|
|
211
|
-
}
|
|
212
|
-
document.body.appendChild(t(this, T));
|
|
213
|
-
const dt = {
|
|
214
|
-
pathname: l,
|
|
215
|
-
isCached: Z,
|
|
216
|
-
state: n,
|
|
217
|
-
newDocument: N
|
|
218
|
-
};
|
|
219
|
-
st(document, "morphStart", {
|
|
220
|
-
detail: dt
|
|
221
|
-
});
|
|
222
|
-
const ut = Array.from(document.head.children), mt = Array.from(
|
|
223
|
-
N.head.children
|
|
224
|
-
), ft = A(this, m, Tt).call(this, ut, mt), Ht = A(this, m, ct).call(this, ut, ft), tt = A(this, m, ct).call(this, mt, ft);
|
|
225
|
-
tt.forEach((i, g) => {
|
|
226
|
-
if (i.tagName === "SCRIPT" && i.getAttribute("src")) {
|
|
227
|
-
const y = document.createElement("script");
|
|
228
|
-
y.type = "module", y.src = i.getAttribute("src"), tt[g] = y;
|
|
229
|
-
}
|
|
230
|
-
}), tt.forEach((i) => {
|
|
231
|
-
document.head.appendChild(i);
|
|
232
|
-
});
|
|
233
|
-
const at = tt.filter(
|
|
234
|
-
(i) => !i.hasAttribute("data-no-waiting") && (i.tagName === "STYLE" || i.tagName === "SCRIPT" || i.tagName === "LINK") && i.getAttribute("rel") !== "canonical"
|
|
235
|
-
);
|
|
236
|
-
t(this, G) && at.length && (yield new Promise((i) => O(this, null, function* () {
|
|
237
|
-
let g = 0;
|
|
238
|
-
try {
|
|
239
|
-
for (var y = St(at), gt, q, Lt; gt = !(q = yield y.next()).done; gt = !1) {
|
|
240
|
-
const et = q.value;
|
|
241
|
-
et.onload = () => {
|
|
242
|
-
g++, g === at.length && i();
|
|
243
|
-
};
|
|
208
|
+
const A = this.normalizePath(t);
|
|
209
|
+
let { pathname: l, hash: g, parameters: yt, leaf: wt } = A;
|
|
210
|
+
if (!(e(this, P) === l || e(this, f) === l)) {
|
|
211
|
+
a(this, P, l);
|
|
212
|
+
try {
|
|
213
|
+
let K = !0;
|
|
214
|
+
if (this.preprocessor)
|
|
215
|
+
try {
|
|
216
|
+
yield new Promise((n, v) => {
|
|
217
|
+
var y;
|
|
218
|
+
(y = this.preprocessor) == null || y.call(this, {
|
|
219
|
+
pathname: l,
|
|
220
|
+
resolve: n,
|
|
221
|
+
reject: v
|
|
222
|
+
});
|
|
223
|
+
});
|
|
224
|
+
} catch (n) {
|
|
225
|
+
n ? console.error(n) : console.log("Route change canceled"), K = !1;
|
|
244
226
|
}
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
227
|
+
if (!K || e(this, P) !== l)
|
|
228
|
+
return;
|
|
229
|
+
const ot = yield d(this, h, $).call(this, e(this, f)), S = yield d(this, h, $).call(this, l, m);
|
|
230
|
+
if (e(this, P) !== l)
|
|
231
|
+
return;
|
|
232
|
+
ot.saveScrollState(), ot.saveDocumentState(), e(this, N) || (S.clearScrollState(), S.clearDocumentState()), S.cloneDocument(), e(this, D).textContent = S.title, document.body.appendChild(e(this, D));
|
|
233
|
+
const rt = {
|
|
234
|
+
pathname: l
|
|
235
|
+
};
|
|
236
|
+
Q(document, "morphStart", {
|
|
237
|
+
detail: rt
|
|
238
|
+
});
|
|
239
|
+
const at = Array.from(document.head.children), lt = Array.from(S.document.head.children), ht = d(this, h, vt).call(this, at, lt), bt = d(this, h, st).call(this, at, ht), Y = d(this, h, st).call(this, lt, ht);
|
|
240
|
+
Y.forEach((n, v) => {
|
|
241
|
+
if (n.tagName === "SCRIPT" && n.getAttribute("src")) {
|
|
242
|
+
const y = document.createElement("script");
|
|
243
|
+
y.type = "module", y.src = n.getAttribute("src"), Y[v] = y;
|
|
244
|
+
}
|
|
245
|
+
}), Y.forEach((n) => {
|
|
246
|
+
document.head.appendChild(n);
|
|
247
|
+
});
|
|
248
|
+
const Z = Y.filter((n) => {
|
|
249
|
+
if (n.hasAttribute("data-no-waiting"))
|
|
250
|
+
return !1;
|
|
251
|
+
if (d(this, h, it).call(this, n))
|
|
252
|
+
return !0;
|
|
253
|
+
});
|
|
254
|
+
e(this, b).waitForHeadToLoad && Z.length && (yield new Promise((n) => M(this, null, function* () {
|
|
255
|
+
let v = 0;
|
|
248
256
|
try {
|
|
249
|
-
|
|
257
|
+
for (var y = pt(Z), ut, O, dt; ut = !(O = yield y.next()).done; ut = !1) {
|
|
258
|
+
const G = O.value;
|
|
259
|
+
G.onload = () => {
|
|
260
|
+
v++, v === Z.length && n();
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
} catch (O) {
|
|
264
|
+
dt = [O];
|
|
250
265
|
} finally {
|
|
251
|
-
|
|
252
|
-
|
|
266
|
+
try {
|
|
267
|
+
ut && (O = y.return) && (yield O.call(y));
|
|
268
|
+
} finally {
|
|
269
|
+
if (dt)
|
|
270
|
+
throw dt[0];
|
|
271
|
+
}
|
|
253
272
|
}
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
}), q.forEach((u) => {
|
|
273
|
-
u instanceof HTMLElement && (u.classList.remove("current"), u.classList.add("new"));
|
|
274
|
-
}), i.prepend(...q), t(this, w)) {
|
|
275
|
-
const u = document.querySelector(
|
|
276
|
-
t(this, w).selector
|
|
277
|
-
);
|
|
278
|
-
u && u.scroll({
|
|
279
|
-
top: t(this, w).y,
|
|
280
|
-
left: t(this, w).x,
|
|
281
|
-
behavior: "auto"
|
|
273
|
+
})));
|
|
274
|
+
const ct = [];
|
|
275
|
+
bt.forEach((n) => {
|
|
276
|
+
n.hasAttribute("data-permanent") || (d(this, h, it).call(this, n) ? ct.push(n) : n.remove());
|
|
277
|
+
});
|
|
278
|
+
const Pt = d(this, h, et).call(this, S.document.body);
|
|
279
|
+
if (e(this, B).forEach((n, v) => {
|
|
280
|
+
const y = Pt[v], ut = getComputedStyle(n).getPropertyValue("--morph-duration"), O = [...y.childNodes];
|
|
281
|
+
if (ut) {
|
|
282
|
+
const dt = [...n.childNodes];
|
|
283
|
+
dt.forEach((E) => {
|
|
284
|
+
E instanceof HTMLElement && E.classList.add("old");
|
|
285
|
+
}), O.forEach((E) => {
|
|
286
|
+
E instanceof HTMLElement && E.classList.add("new");
|
|
287
|
+
}), n.prepend(...O), Mt(() => {
|
|
288
|
+
O.forEach((E) => {
|
|
289
|
+
E instanceof HTMLElement && E.classList.add("in");
|
|
290
|
+
});
|
|
282
291
|
});
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
292
|
+
const G = {
|
|
293
|
+
morphElement: n,
|
|
294
|
+
pathname: l
|
|
295
|
+
};
|
|
296
|
+
Q(document, "morphNewChildrenAdded", {
|
|
297
|
+
detail: G
|
|
287
298
|
});
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
299
|
+
const At = new Promise((E) => {
|
|
300
|
+
setTimeout(() => {
|
|
301
|
+
dt.forEach((J) => J.remove()), O.forEach((J) => {
|
|
302
|
+
J instanceof HTMLElement && J.classList.remove("in", "new");
|
|
303
|
+
}), Q(document, "morphOldChildrenRemoved", {
|
|
304
|
+
detail: G
|
|
305
|
+
}), E();
|
|
306
|
+
}, (parseFloat(ut) || 0) * 1e3 + 10);
|
|
307
|
+
});
|
|
308
|
+
e(this, x).push(At);
|
|
309
|
+
} else
|
|
310
|
+
n.innerHTML = "", n.append(...O);
|
|
311
|
+
}), d(this, h, nt).call(this), g) {
|
|
312
|
+
S.clearScrollState();
|
|
313
|
+
const n = document.getElementById(g);
|
|
314
|
+
n instanceof HTMLElement && Tt(n, {
|
|
315
|
+
scrollElement: e(this, F),
|
|
316
|
+
behaviour: "instant",
|
|
317
|
+
center: o,
|
|
318
|
+
offset: u
|
|
306
319
|
});
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
320
|
+
} else e(this, N) && S.restoreScrollPosition();
|
|
321
|
+
yield Promise.all(e(this, x)), ct.forEach((n) => n.remove()), a(this, j, e(this, f)), a(this, f, l), a(this, x, []), this.findLinks(), document.documentElement.setAttribute("data-current-pathname", l), document.documentElement.setAttribute("data-current-leaf", wt), e(this, D).remove(), Et({
|
|
322
|
+
action: s,
|
|
323
|
+
pathname: l,
|
|
324
|
+
searchParameters: yt,
|
|
325
|
+
hash: g
|
|
326
|
+
}), Q(document, "morphComplete", {
|
|
327
|
+
detail: rt
|
|
328
|
+
});
|
|
329
|
+
} catch (K) {
|
|
330
|
+
console.error(K);
|
|
331
|
+
}
|
|
332
|
+
a(this, P, void 0);
|
|
315
333
|
}
|
|
316
|
-
a(this, P, void 0);
|
|
317
334
|
});
|
|
318
335
|
}
|
|
319
|
-
addLink(
|
|
320
|
-
|
|
336
|
+
addLink(t) {
|
|
337
|
+
e(this, L).push(new gt(t, this));
|
|
321
338
|
}
|
|
322
|
-
addLinks(
|
|
323
|
-
|
|
339
|
+
addLinks(t) {
|
|
340
|
+
t.forEach((s) => {
|
|
324
341
|
this.addLink(s);
|
|
325
342
|
});
|
|
326
343
|
}
|
|
327
|
-
removeLink(
|
|
328
|
-
a(this,
|
|
344
|
+
removeLink(t) {
|
|
345
|
+
a(this, L, e(this, L).filter((s) => s.element === t ? (s.destroy(), !1) : !0));
|
|
329
346
|
}
|
|
330
347
|
findLinks() {
|
|
331
|
-
const
|
|
348
|
+
const t = [
|
|
332
349
|
...document.documentElement.querySelectorAll("a")
|
|
333
350
|
].filter(
|
|
334
351
|
(s) => {
|
|
335
|
-
var
|
|
336
|
-
return ((
|
|
352
|
+
var o;
|
|
353
|
+
return ((o = s.getAttribute("href")) == null ? void 0 : o.startsWith("/")) && !s.hasAttribute("download") && !s.hasAttribute("data-morph-skip") && !s.closest("[data-morph-skip]");
|
|
337
354
|
}
|
|
338
355
|
);
|
|
339
|
-
|
|
356
|
+
e(this, L).forEach((s) => s.destroy()), a(this, L, t.map((s) => new gt(s, this)));
|
|
340
357
|
}
|
|
341
358
|
}
|
|
342
|
-
|
|
343
|
-
return
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
359
|
+
b = new WeakMap(), B = new WeakMap(), L = new WeakMap(), U = new WeakMap(), P = new WeakMap(), f = new WeakMap(), j = new WeakMap(), x = new WeakMap(), N = new WeakMap(), F = new WeakMap(), I = new WeakMap(), D = new WeakMap(), h = new WeakSet(), $ = function(t, s = !1) {
|
|
360
|
+
return M(this, null, function* () {
|
|
361
|
+
let o = e(this, I).get(t);
|
|
362
|
+
return (!o || s) && (o = yield d(this, h, tt).call(this, t)), o;
|
|
363
|
+
});
|
|
364
|
+
}, tt = function(t) {
|
|
365
|
+
return M(this, null, function* () {
|
|
366
|
+
const o = yield (yield fetch(t)).text(), u = e(this, U).parseFromString(o, "text/html"), m = new Lt(this, t, u);
|
|
367
|
+
return e(this, I).set(t, m), m;
|
|
349
368
|
});
|
|
350
|
-
},
|
|
351
|
-
const s = [...
|
|
352
|
-
return s.length ? s : [
|
|
353
|
-
},
|
|
354
|
-
return
|
|
355
|
-
(
|
|
356
|
-
(
|
|
369
|
+
}, et = function(t) {
|
|
370
|
+
const s = [...t.querySelectorAll("[data-morph]")];
|
|
371
|
+
return s.length ? s : [t];
|
|
372
|
+
}, vt = function(t, s) {
|
|
373
|
+
return t.filter(
|
|
374
|
+
(o) => s.find(
|
|
375
|
+
(u) => u.outerHTML === o.outerHTML
|
|
357
376
|
)
|
|
358
377
|
);
|
|
359
|
-
},
|
|
360
|
-
return
|
|
361
|
-
(
|
|
362
|
-
(
|
|
378
|
+
}, st = function(t, s) {
|
|
379
|
+
return t.filter(
|
|
380
|
+
(o) => !s.find(
|
|
381
|
+
(u) => u.outerHTML === o.outerHTML
|
|
363
382
|
)
|
|
364
383
|
);
|
|
365
|
-
},
|
|
384
|
+
}, it = function(t) {
|
|
385
|
+
return t.tagName === "SCRIPT" || t.tagName === "STYLE" || t.tagName === "LINK" && t.getAttribute("rel") === "stylesheet";
|
|
386
|
+
}, nt = function() {
|
|
387
|
+
a(this, F, document.querySelector(e(this, b).scrollSelector) || document.documentElement);
|
|
388
|
+
}, X = new WeakMap();
|
|
366
389
|
export {
|
|
367
|
-
|
|
390
|
+
It as Morph
|
|
368
391
|
};
|