aptechka 0.79.0 → 0.80.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-BDEX44-i.js → Animation-C4tLEBGM.js} +2 -2
- package/lib/{Animation-hZcAchp_.cjs → Animation-jmvFcNfM.cjs} +1 -1
- package/lib/Composed-BB1MtFiT.js +70 -0
- package/lib/Composed-CSeUTRCg.cjs +1 -0
- package/lib/{Damped-z9Uaw2MJ.cjs → Damped-77Urmi3q.cjs} +1 -1
- package/lib/{Damped-CtQmJ52v.js → Damped-DVG5nrYV.js} +2 -2
- package/lib/DerivedArray-B8A0-8uT.cjs +1 -0
- package/lib/DerivedArray-D3scYQdp.js +59 -0
- package/lib/{DragControls-K67-diF5.cjs → DragControls-BlL26P1V.cjs} +1 -1
- package/lib/{DragControls-DyIrD3GV.js → DragControls-Cm_88cLt.js} +4 -4
- package/lib/{SourceElement-VVdVc1d-.cjs → SourceElement-BBfaAgwe.cjs} +1 -1
- package/lib/{SourceElement-BnMxiOqY.js → SourceElement-BiNNtaz9.js} +2 -2
- package/lib/Store-1JrMCgdX.cjs +1 -0
- package/lib/{Store-0BVty6AZ.js → Store-BtVtCGLk.js} +52 -35
- package/lib/{Tweened-BlZB0vl4.js → Tweened-C1lnK6n9.js} +2 -2
- package/lib/{Tweened-mvHucL4Y.cjs → Tweened-CXQrFQth.cjs} +1 -1
- package/lib/{Viewport-DB0qAZPJ.cjs → Viewport-Cx50Hufs.cjs} +1 -1
- package/lib/{Viewport-DA10iWAO.js → Viewport-DbN_JWBM.js} +2 -2
- package/lib/accordion/index.cjs +1 -1
- package/lib/accordion/index.js +1 -1
- package/lib/animation/index.cjs +1 -1
- package/lib/animation/index.js +3 -3
- package/lib/attribute/index.cjs +1 -1
- package/lib/attribute/index.js +3 -3
- package/lib/billboard/index.cjs +1 -1
- package/lib/billboard/index.js +2 -2
- package/lib/canvas/index.cjs +1 -1
- package/lib/canvas/index.js +2 -2
- package/lib/connector/index.cjs +1 -1
- package/lib/connector/index.js +2 -1
- package/lib/controls/index.cjs +1 -1
- package/lib/controls/index.js +1 -1
- package/lib/css-property/index.cjs +1 -1
- package/lib/css-property/index.js +3 -3
- package/lib/css-value-parser/index.cjs +1 -1
- package/lib/css-value-parser/index.js +1 -1
- package/lib/dev/index.cjs +1 -1
- package/lib/dev/index.js +2 -2
- package/lib/device/index.cjs +1 -1
- package/lib/device/index.js +1 -1
- package/lib/{dom-CVWzyXPH.js → dom-fgxIeFxm.js} +22 -7
- package/lib/dom-hTEdqeoj.cjs +1 -0
- package/lib/element-linked-store/index.cjs +1 -1
- package/lib/element-linked-store/index.js +2 -2
- package/lib/element-resizer/index.cjs +1 -1
- package/lib/element-resizer/index.js +2 -2
- package/lib/en3/index.cjs +1 -1
- package/lib/en3/index.js +2 -2
- package/lib/iframe/index.cjs +1 -1
- package/lib/iframe/index.js +3 -3
- package/lib/image/index.cjs +1 -1
- package/lib/image/index.js +4 -4
- package/lib/{index-DekP7OZe.cjs → index-CKTweR3M.cjs} +1 -1
- package/lib/{index-Bv9zgfdb.js → index-JqYHGoo6.js} +1 -1
- package/lib/intersector/index.cjs +1 -1
- package/lib/intersector/index.js +2 -2
- package/lib/jsx/ComponentElement.d.ts +13 -0
- package/lib/jsx/h.d.ts +3 -0
- package/lib/jsx/hooks/common.d.ts +1 -0
- package/lib/jsx/hooks/component/lifecycle.d.ts +4 -0
- package/lib/jsx/hooks/component/useInternals.d.ts +2 -0
- package/lib/jsx/hooks/component/useShadow.d.ts +2 -0
- package/lib/jsx/hooks/component/useStylesheet.d.ts +8 -0
- package/lib/jsx/hooks/store.d.ts +8 -0
- package/lib/jsx/index.cjs +1 -0
- package/lib/jsx/index.d.ts +9 -0
- package/lib/jsx/index.js +140 -0
- package/lib/jsx/render.d.ts +1 -0
- package/lib/jsx/type.d.ts +224 -0
- package/lib/jsx/utils/attributes/class.d.ts +5 -0
- package/lib/jsx/utils/attributes/setAttributes.d.ts +2 -0
- package/lib/jsx/utils/attributes/style.d.ts +6 -0
- package/lib/jsx/utils/children/filterChildren.d.ts +2 -0
- package/lib/jsx/utils/children/findTextNode.d.ts +1 -0
- package/lib/jsx/utils/children/removeChildren.d.ts +1 -0
- package/lib/jsx/utils/children/storeChildren.d.ts +2 -0
- package/lib/jsx/utils/elementStoreSubscription.d.ts +2 -0
- package/lib/ladder/index.cjs +1 -1
- package/lib/ladder/index.js +2 -2
- package/lib/layout-box/index.cjs +1 -1
- package/lib/layout-box/index.js +2 -2
- package/lib/loading/index.cjs +1 -1
- package/lib/loading/index.js +1 -1
- package/lib/masonry-layout/index.cjs +1 -1
- package/lib/masonry-layout/index.js +2 -2
- package/lib/media/index.cjs +1 -1
- package/lib/media/index.js +2 -2
- package/lib/morph/Morph.d.ts +3 -21
- package/lib/morph/index.cjs +1 -1
- package/lib/morph/index.js +3 -3
- package/lib/need_redo_tweaker/element-constructor/ElementConstructor.d.ts +1 -1
- package/lib/need_redo_tweaker/index.cjs +1 -1
- package/lib/need_redo_tweaker/index.js +8 -8
- package/lib/pixel-perfect/index.cjs +1 -1
- package/lib/pixel-perfect/index.js +3 -3
- package/lib/pointer/index.cjs +1 -1
- package/lib/pointer/index.js +4 -4
- package/lib/popover/index.cjs +1 -1
- package/lib/popover/index.js +3 -3
- package/lib/radio/index.cjs +1 -1
- package/lib/radio/index.js +1 -1
- package/lib/render-BCEBRfHS.js +196 -0
- package/lib/render-Rv0UMACs.cjs +1 -0
- package/lib/router/Link.d.ts +3 -1
- package/lib/router/Route.d.ts +9 -10
- package/lib/router/Router.d.ts +13 -13
- package/lib/router/index.cjs +1 -1
- package/lib/router/index.d.ts +2 -2
- package/lib/router/index.js +267 -216
- package/lib/scroll/index.cjs +1 -1
- package/lib/scroll/index.js +8 -8
- package/lib/{scroll-DNGJVxa2.js → scroll-7JSxRKFK.js} +2 -2
- package/lib/{scroll-CIdNtj3G.cjs → scroll-DxcPU0vk.cjs} +1 -1
- package/lib/scroll-entries/index.cjs +1 -1
- package/lib/scroll-entries/index.js +1 -1
- package/lib/scroll-kit/index.cjs +1 -1
- package/lib/scroll-kit/index.js +4 -4
- package/lib/sequence/index.cjs +1 -1
- package/lib/sequence/index.js +3 -3
- package/lib/size-element/index.cjs +1 -1
- package/lib/size-element/index.js +1 -1
- package/lib/slicer/SlicerElement.d.ts +1 -1
- package/lib/slicer/index.cjs +1 -1
- package/lib/slicer/index.js +13 -13
- package/lib/source/index.cjs +1 -1
- package/lib/source/index.js +1 -1
- package/lib/store/DerivedArray.d.ts +11 -1
- package/lib/store/Store.d.ts +5 -0
- package/lib/store/index.cjs +1 -1
- package/lib/store/index.js +10 -87
- package/lib/{stylesheet-HWF2a3nr.cjs → stylesheet-BcwbfhBp.cjs} +1 -1
- package/lib/{stylesheet-DpnWNVyD.js → stylesheet-JlRFfJIc.js} +1 -1
- package/lib/ticker/index.cjs +1 -1
- package/lib/ticker/index.js +2 -2
- package/lib/url-C2kASACG.cjs +1 -0
- package/lib/{url-Ddgqz4Q_.js → url-CGbjOTU4.js} +17 -17
- package/lib/utils/dom.d.ts +2 -0
- package/lib/utils/index.cjs +1 -1
- package/lib/utils/index.js +102 -100
- package/lib/utils/url.d.ts +3 -2
- package/lib/video/index.cjs +1 -1
- package/lib/video/index.js +3 -3
- package/lib/window-resizer/index.cjs +1 -1
- package/lib/window-resizer/index.js +1 -1
- package/lib/youtube/index.cjs +1 -1
- package/lib/youtube/index.js +3 -3
- package/package.json +21 -11
- package/lib/Store-Cd1GlEmZ.cjs +0 -1
- package/lib/dom-JBOkFLTh.cjs +0 -1
- package/lib/url-VIZgwj_h.cjs +0 -1
package/lib/router/index.js
CHANGED
|
@@ -1,268 +1,319 @@
|
|
|
1
|
-
var
|
|
2
|
-
throw TypeError(
|
|
1
|
+
var W = (c) => {
|
|
2
|
+
throw TypeError(c);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
4
|
+
var $ = (c, t, s) => t.has(c) || W("Cannot " + s);
|
|
5
|
+
var e = (c, t, s) => ($(c, t, "read from private field"), s ? s.call(c) : t.get(c)), a = (c, t, s) => t.has(c) ? W("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(c) : t.set(c, s), r = (c, t, s, i) => ($(c, t, "write to private field"), i ? i.call(c, s) : t.set(c, s), s), n = (c, t, s) => ($(c, t, "access private method"), s);
|
|
6
|
+
var R = (c, t, s) => new Promise((i, l) => {
|
|
7
|
+
var m = (f) => {
|
|
8
8
|
try {
|
|
9
|
-
|
|
10
|
-
} catch (
|
|
11
|
-
|
|
9
|
+
y(s.next(f));
|
|
10
|
+
} catch (D) {
|
|
11
|
+
l(D);
|
|
12
12
|
}
|
|
13
|
-
},
|
|
13
|
+
}, w = (f) => {
|
|
14
14
|
try {
|
|
15
|
-
|
|
16
|
-
} catch (
|
|
17
|
-
|
|
15
|
+
y(s.throw(f));
|
|
16
|
+
} catch (D) {
|
|
17
|
+
l(D);
|
|
18
18
|
}
|
|
19
|
-
},
|
|
20
|
-
|
|
19
|
+
}, y = (f) => f.done ? i(f.value) : Promise.resolve(f.value).then(m, w);
|
|
20
|
+
y((s = s.apply(c, t)).next());
|
|
21
21
|
});
|
|
22
|
-
|
|
23
|
-
import { URLPattern as at } from "urlpattern-polyfill";
|
|
24
|
-
import { Notifier as nt } from "../notifier/index.js";
|
|
25
|
-
import { i as _ } from "../index-Bv9zgfdb.js";
|
|
26
|
-
import { d as ht } from "../function-C10DGppn.js";
|
|
22
|
+
import { Notifier as pt } from "../notifier/index.js";
|
|
27
23
|
import "construct-style-sheets-polyfill";
|
|
28
|
-
import
|
|
29
|
-
import {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
24
|
+
import "../index-JqYHGoo6.js";
|
|
25
|
+
import { n as ft, c as Y, s as Rt } from "../url-CGbjOTU4.js";
|
|
26
|
+
import { URLPattern as gt } from "urlpattern-polyfill";
|
|
27
|
+
import { r as vt } from "../render-BCEBRfHS.js";
|
|
28
|
+
import { t as Lt } from "../dom-fgxIeFxm.js";
|
|
29
|
+
import { i as j } from "../object-D6MVWB4l.js";
|
|
30
|
+
var b, v, B, G, T;
|
|
31
|
+
class wt {
|
|
32
|
+
constructor(t, s) {
|
|
33
|
+
a(this, B);
|
|
34
|
+
a(this, b);
|
|
35
|
+
a(this, v);
|
|
36
|
+
a(this, T, (t) => {
|
|
37
|
+
t.preventDefault();
|
|
38
|
+
const s = e(this, B, G), i = e(this, v).getAttribute(
|
|
39
|
+
"data-history-action"
|
|
40
|
+
) || "push";
|
|
41
|
+
e(this, b).navigate(s, {
|
|
42
|
+
historyAction: i
|
|
47
43
|
});
|
|
48
|
-
})
|
|
44
|
+
});
|
|
45
|
+
r(this, b, t), r(this, v, s), e(this, v).addEventListener("click", e(this, T));
|
|
49
46
|
}
|
|
50
|
-
|
|
51
|
-
|
|
47
|
+
checkCurrent(t) {
|
|
48
|
+
}
|
|
49
|
+
destroy() {
|
|
50
|
+
e(this, v).removeEventListener("click", e(this, T)), e(this, v).classList.remove("current");
|
|
52
51
|
}
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
}
|
|
53
|
+
b = new WeakMap(), v = new WeakMap(), B = new WeakSet(), G = function() {
|
|
54
|
+
const t = new URL(e(this, v).href);
|
|
55
|
+
return e(this, b).normalizePath(
|
|
56
|
+
t.pathname + t.search + t.hash
|
|
57
|
+
).path;
|
|
58
|
+
}, T = new WeakMap();
|
|
59
|
+
var k, q, C, d, u, U, M, P, A, N, o, J, Q, V, X, Z, _, tt, et, st, F;
|
|
60
|
+
class yt {
|
|
61
|
+
constructor(t, s) {
|
|
62
|
+
a(this, o);
|
|
63
|
+
a(this, k);
|
|
64
|
+
a(this, q);
|
|
65
|
+
a(this, C);
|
|
66
|
+
a(this, d, null);
|
|
67
|
+
a(this, u, null);
|
|
68
|
+
a(this, U, !1);
|
|
69
|
+
a(this, M, null);
|
|
70
|
+
a(this, P);
|
|
71
|
+
a(this, A, []);
|
|
72
|
+
a(this, N, []);
|
|
73
|
+
r(this, k, t), r(this, q, s), r(this, C, new URLPattern({ pathname: e(this, k) })), r(this, P, new MutationObserver(
|
|
74
|
+
n(this, o, et).bind(this)
|
|
75
|
+
));
|
|
76
|
+
}
|
|
77
|
+
get pattern() {
|
|
78
|
+
return e(this, k);
|
|
55
79
|
}
|
|
56
80
|
get isActive() {
|
|
57
|
-
return
|
|
81
|
+
return e(this, U);
|
|
58
82
|
}
|
|
59
83
|
get element() {
|
|
60
|
-
return
|
|
84
|
+
return e(this, u);
|
|
61
85
|
}
|
|
62
86
|
get nest() {
|
|
63
|
-
return
|
|
87
|
+
return e(this, M);
|
|
64
88
|
}
|
|
65
|
-
testPathname(
|
|
66
|
-
return this.
|
|
89
|
+
testPathname(t) {
|
|
90
|
+
return e(this, C).test({ pathname: t });
|
|
67
91
|
}
|
|
68
|
-
render(
|
|
69
|
-
return
|
|
70
|
-
|
|
71
|
-
if (t(this, v).observe(document.head, {
|
|
92
|
+
render(t, s) {
|
|
93
|
+
return R(this, null, function* () {
|
|
94
|
+
e(this, P).observe(document.head, {
|
|
72
95
|
childList: !0,
|
|
73
96
|
subtree: !0
|
|
74
|
-
}), t(this,
|
|
75
|
-
t(this, E).forEach((o) => {
|
|
76
|
-
document.head.appendChild(o);
|
|
77
|
-
});
|
|
78
|
-
else {
|
|
79
|
-
const o = yield t(this, U).call(this);
|
|
80
|
-
if (n(this, R, [...t(this, E)]), typeof o.default == "function" && (n(this, p, o.default), lt(o.default))) {
|
|
81
|
-
const c = "e-" + ((i = t(this, p)) == null ? void 0 : i.name.toLowerCase());
|
|
82
|
-
customElements.get(c) || customElements.define(c, o.default);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
if (yield Y(this, M, tt).call(this), t(this, p)) {
|
|
86
|
-
const o = t(this, A).exec({ pathname: s }), c = (o == null ? void 0 : o.pathname.groups) || {}, f = Object.fromEntries(
|
|
87
|
-
new URLSearchParams(location.search)
|
|
88
|
-
), m = {
|
|
89
|
-
pathnameParams: c,
|
|
90
|
-
searchParams: f
|
|
91
|
-
};
|
|
92
|
-
n(this, d, new (t(this, p))(m)), e.appendChild(t(this, d)), n(this, k, t(this, d).querySelector("[data-nest]") || ((r = t(this, d).shadowRoot) == null ? void 0 : r.querySelector("[data-nest]")) || t(this, d).shadowRoot || t(this, d)), n(this, L, !0);
|
|
93
|
-
}
|
|
94
|
-
t(this, v).disconnect();
|
|
97
|
+
}), e(this, d) ? n(this, o, V).call(this) : yield n(this, o, J).call(this), yield n(this, o, st).call(this), e(this, d) && (yield n(this, o, X).call(this, t, s)), e(this, P).disconnect();
|
|
95
98
|
});
|
|
96
99
|
}
|
|
97
100
|
close() {
|
|
98
|
-
|
|
99
|
-
t(this, v).disconnect(), (e = t(this, d)) == null || e.remove(), n(this, L, !1), t(this, R).forEach((s) => document.head.removeChild(s)), n(this, R, []);
|
|
101
|
+
n(this, o, _).call(this);
|
|
100
102
|
}
|
|
101
103
|
getAnchorElements() {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
...t(this, d).shadowRoot.querySelectorAll("a")
|
|
107
|
-
]), e;
|
|
104
|
+
const t = [];
|
|
105
|
+
return e(this, u) && (t.push(...e(this, u).querySelectorAll("a")), Lt(e(this, u), (s) => {
|
|
106
|
+
t.push(...s.shadowRoot.querySelectorAll("a"));
|
|
107
|
+
})), t;
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
|
-
|
|
111
|
-
return
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
o = [r];
|
|
124
|
-
} finally {
|
|
125
|
-
try {
|
|
126
|
-
i && (r = s.return) && (yield r.call(s));
|
|
127
|
-
} finally {
|
|
128
|
-
if (o)
|
|
129
|
-
throw o[0];
|
|
130
|
-
}
|
|
110
|
+
k = new WeakMap(), q = new WeakMap(), C = new WeakMap(), d = new WeakMap(), u = new WeakMap(), U = new WeakMap(), M = new WeakMap(), P = new WeakMap(), A = new WeakMap(), N = new WeakMap(), o = new WeakSet(), J = function() {
|
|
111
|
+
return R(this, null, function* () {
|
|
112
|
+
const t = yield e(this, q).call(this);
|
|
113
|
+
r(this, N, [...e(this, A)]), typeof t.default == "function" && (r(this, d, t.default), yield n(this, o, Q).call(this));
|
|
114
|
+
});
|
|
115
|
+
}, Q = function() {
|
|
116
|
+
return R(this, null, function* () {
|
|
117
|
+
if (e(this, d) && j(e(this, d))) {
|
|
118
|
+
const t = `e-${e(this, d).name.toLowerCase()}`;
|
|
119
|
+
customElements.get(t) || customElements.define(
|
|
120
|
+
t,
|
|
121
|
+
e(this, d)
|
|
122
|
+
);
|
|
131
123
|
}
|
|
132
124
|
});
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
125
|
+
}, V = function() {
|
|
126
|
+
e(this, A).forEach((t) => {
|
|
127
|
+
document.head.appendChild(t.cloneNode(!0));
|
|
128
|
+
});
|
|
129
|
+
}, X = function(t, s) {
|
|
130
|
+
return R(this, null, function* () {
|
|
131
|
+
const l = { urlPatternResult: e(this, C).exec({ pathname: s }) };
|
|
132
|
+
j(e(this, d)) ? (r(this, u, new (e(this, d))(l)), t.appendChild(e(this, u))) : r(this, u, vt(
|
|
133
|
+
t,
|
|
134
|
+
e(this, d),
|
|
135
|
+
l
|
|
136
|
+
)), n(this, o, Z).call(this), r(this, U, !0);
|
|
137
|
+
});
|
|
138
|
+
}, Z = function() {
|
|
139
|
+
var t;
|
|
140
|
+
e(this, u) && r(this, M, e(this, u).querySelector("[data-nest]") || ((t = e(this, u).shadowRoot) == null ? void 0 : t.querySelector("[data-nest]")) || e(this, u).shadowRoot || e(this, u));
|
|
141
|
+
}, _ = function() {
|
|
142
|
+
var t;
|
|
143
|
+
e(this, P).disconnect(), (t = e(this, u)) == null || t.remove(), r(this, U, !1), n(this, o, tt).call(this);
|
|
144
|
+
}, tt = function() {
|
|
145
|
+
e(this, N).forEach((t) => {
|
|
146
|
+
t.parentNode === document.head && document.head.removeChild(t);
|
|
147
|
+
}), r(this, N, []);
|
|
148
|
+
}, et = function(t) {
|
|
149
|
+
t.forEach((s) => {
|
|
150
|
+
s.addedNodes.forEach((i) => {
|
|
151
|
+
e(this, d) ? e(this, N).push(i) : e(this, A).push(i);
|
|
147
152
|
});
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
153
|
+
});
|
|
154
|
+
}, st = function() {
|
|
155
|
+
return R(this, null, function* () {
|
|
156
|
+
const t = e(this, A).filter(n(this, o, F));
|
|
157
|
+
yield Promise.all(
|
|
158
|
+
t.map(
|
|
159
|
+
(s) => new Promise((i) => {
|
|
160
|
+
n(this, o, F).call(this, s) ? s.onload = () => i() : i();
|
|
161
|
+
})
|
|
162
|
+
)
|
|
163
|
+
);
|
|
164
|
+
});
|
|
165
|
+
}, F = function(t) {
|
|
166
|
+
return t instanceof HTMLElement && (t.tagName === "STYLE" || t.tagName === "SCRIPT" || t.tagName === "LINK");
|
|
167
|
+
};
|
|
168
|
+
globalThis.URLPattern = gt;
|
|
169
|
+
var S, I, g, z, E, L, O, p, H, h, it, at, ht, rt, nt, ot, ct, lt, ut, K, dt, mt, x;
|
|
170
|
+
class zt {
|
|
171
|
+
constructor(t) {
|
|
172
|
+
a(this, h);
|
|
173
|
+
a(this, S);
|
|
174
|
+
a(this, I);
|
|
175
|
+
a(this, g, []);
|
|
176
|
+
a(this, z, null);
|
|
177
|
+
a(this, E, []);
|
|
178
|
+
a(this, L, null);
|
|
179
|
+
a(this, O, null);
|
|
180
|
+
a(this, p, null);
|
|
181
|
+
a(this, H, new pt());
|
|
182
|
+
a(this, x, (t) => {
|
|
178
183
|
var s;
|
|
179
|
-
(s =
|
|
184
|
+
(s = t.state) != null && s.path && this.navigate(t.state.path, {
|
|
185
|
+
historyAction: "none"
|
|
186
|
+
});
|
|
180
187
|
});
|
|
181
|
-
|
|
188
|
+
var s;
|
|
189
|
+
r(this, I, t != null && t.base ? ft(t.base) : "/"), r(this, S, (s = t == null ? void 0 : t.rootElement) != null ? s : document.body), r(this, p, this.normalizePath(
|
|
190
|
+
location.pathname + location.search + location.hash
|
|
191
|
+
)), n(this, h, it).call(this);
|
|
182
192
|
}
|
|
183
|
-
get
|
|
184
|
-
return
|
|
193
|
+
get candidateURL() {
|
|
194
|
+
return e(this, L);
|
|
185
195
|
}
|
|
186
|
-
get
|
|
187
|
-
return
|
|
196
|
+
get currentURL() {
|
|
197
|
+
return e(this, p);
|
|
188
198
|
}
|
|
189
199
|
get routes() {
|
|
190
|
-
return
|
|
200
|
+
return e(this, g);
|
|
191
201
|
}
|
|
192
202
|
get links() {
|
|
193
|
-
return
|
|
203
|
+
return e(this, E);
|
|
204
|
+
}
|
|
205
|
+
run() {
|
|
206
|
+
n(this, h, lt).call(this), this.navigate(e(this, p).path, { revalidate: !0 });
|
|
194
207
|
}
|
|
195
|
-
|
|
196
|
-
|
|
208
|
+
destroy() {
|
|
209
|
+
removeEventListener("popstate", e(this, x)), n(this, h, K).call(this), e(this, g).forEach((t) => t.close()), e(this, H).close();
|
|
197
210
|
}
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
t(this, g).push(i), t(this, j).call(this);
|
|
211
|
+
navigationEvent(t) {
|
|
212
|
+
return e(this, H).subscribe(t);
|
|
201
213
|
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
214
|
+
defineRoute(t, s) {
|
|
215
|
+
const i = new yt(t, s);
|
|
216
|
+
e(this, g).push(i);
|
|
217
|
+
}
|
|
218
|
+
navigate(t, s) {
|
|
219
|
+
return R(this, null, function* () {
|
|
220
|
+
var l, m, w;
|
|
221
|
+
const i = this.normalizePath(t);
|
|
222
|
+
if (!(s != null && s.revalidate) && (((l = e(this, L)) == null ? void 0 : l.pathname) === i.pathname || e(this, p).pathname === i.pathname)) {
|
|
223
|
+
((m = e(this, p)) == null ? void 0 : m.parameters) !== i.parameters && (r(this, O, e(this, p)), r(this, p, i), Y({
|
|
224
|
+
action: ((w = e(this, p)) == null ? void 0 : w.hash) !== i.hash ? "replace" : (s == null ? void 0 : s.historyAction) || "push",
|
|
225
|
+
pathname: i.pathname,
|
|
226
|
+
searchParameters: i.parameters,
|
|
227
|
+
hash: i.hash
|
|
228
|
+
})), e(this, E).forEach((y) => {
|
|
229
|
+
y.checkCurrent(i);
|
|
230
|
+
});
|
|
208
231
|
return;
|
|
209
|
-
n(this, b, r);
|
|
210
|
-
const m = t(this, g).filter((l) => l.isActive), w = t(this, g).filter(
|
|
211
|
-
(l) => !m.includes(l) && l.testPathname(f)
|
|
212
|
-
), st = m.filter((l) => !l.testPathname(f)), F = m.filter((l) => l.testPathname(f));
|
|
213
|
-
let G = !0;
|
|
214
|
-
if (this.preprocessor)
|
|
215
|
-
try {
|
|
216
|
-
yield new Promise((l, it) => {
|
|
217
|
-
var V;
|
|
218
|
-
(V = this.preprocessor) == null || V.call(this, { path: i, resolve: l, reject: it });
|
|
219
|
-
});
|
|
220
|
-
} catch (l) {
|
|
221
|
-
l ? console.error(l) : console.log("Route change canceled"), G = !1;
|
|
222
|
-
}
|
|
223
|
-
if (G && t(this, b) === r) {
|
|
224
|
-
n(this, q, F[F.length - 1]), st.forEach((l) => {
|
|
225
|
-
l.close();
|
|
226
|
-
}), n(this, T, r), ot({ action: s, pathname: r, searchParameters: c, hash: o });
|
|
227
|
-
try {
|
|
228
|
-
for (var yt = $(w), At, kt, St; At = !(kt = yield yt.next()).done; At = !1) {
|
|
229
|
-
const l = kt.value;
|
|
230
|
-
yield l.render(((J = t(this, q)) == null ? void 0 : J.nest) || t(this, C), r), n(this, q, l);
|
|
231
|
-
}
|
|
232
|
-
} catch (kt) {
|
|
233
|
-
St = [kt];
|
|
234
|
-
} finally {
|
|
235
|
-
try {
|
|
236
|
-
At && (kt = yt.return) && (yield kt.call(yt));
|
|
237
|
-
} finally {
|
|
238
|
-
if (St)
|
|
239
|
-
throw St[0];
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
Y(this, D, et).call(this), (Q = this.postprocessor) == null || Q.call(this, { pathname: r }), t(this, B).notify({ pathname: r });
|
|
243
232
|
}
|
|
233
|
+
r(this, L, i), (yield n(this, h, at).call(this, e(this, L))) && i.path === e(this, L).path && (yield n(this, h, ht).call(this, e(this, L), s));
|
|
244
234
|
});
|
|
245
235
|
}
|
|
246
|
-
normalizePath(
|
|
247
|
-
return
|
|
236
|
+
normalizePath(t) {
|
|
237
|
+
return Rt(t, { base: e(this, I) });
|
|
248
238
|
}
|
|
249
239
|
}
|
|
250
|
-
|
|
251
|
-
|
|
240
|
+
S = new WeakMap(), I = new WeakMap(), g = new WeakMap(), z = new WeakMap(), E = new WeakMap(), L = new WeakMap(), O = new WeakMap(), p = new WeakMap(), H = new WeakMap(), h = new WeakSet(), it = function() {
|
|
241
|
+
addEventListener("popstate", e(this, x));
|
|
242
|
+
}, at = function(t) {
|
|
243
|
+
return R(this, null, function* () {
|
|
244
|
+
if (!this.preprocessor) return !0;
|
|
245
|
+
try {
|
|
246
|
+
return yield new Promise((s, i) => {
|
|
247
|
+
var l;
|
|
248
|
+
(l = this.preprocessor) == null || l.call(this, { path: t, resolve: s, reject: i });
|
|
249
|
+
}), !0;
|
|
250
|
+
} catch (s) {
|
|
251
|
+
return console.error(s != null ? s : "Route change canceled"), !1;
|
|
252
|
+
}
|
|
253
|
+
});
|
|
254
|
+
}, ht = function(i) {
|
|
255
|
+
return R(this, arguments, function* (t, s = {}) {
|
|
256
|
+
var f;
|
|
257
|
+
const { activeRoutes: l, newRoutes: m, oldRoutes: w, keepRoutes: y } = n(this, h, rt).call(this, t.leaf);
|
|
258
|
+
r(this, z, (f = y[y.length - 1]) != null ? f : null), n(this, h, nt).call(this, w), r(this, p, t), Y({
|
|
259
|
+
action: s.historyAction || "push",
|
|
260
|
+
pathname: t.pathname,
|
|
261
|
+
searchParameters: t.parameters,
|
|
262
|
+
hash: t.hash
|
|
263
|
+
}), yield n(this, h, ot).call(this, m, t.leaf), n(this, h, ut).call(this), n(this, h, ct).call(this, t.pathname);
|
|
264
|
+
});
|
|
265
|
+
}, rt = function(t) {
|
|
266
|
+
const s = e(this, g).filter((i) => i.isActive);
|
|
267
|
+
return {
|
|
268
|
+
activeRoutes: s,
|
|
269
|
+
newRoutes: e(this, g).filter(
|
|
270
|
+
(i) => !s.includes(i) && i.testPathname(t)
|
|
271
|
+
),
|
|
272
|
+
oldRoutes: s.filter((i) => !i.testPathname(t)),
|
|
273
|
+
keepRoutes: s.filter((i) => i.testPathname(t))
|
|
274
|
+
};
|
|
275
|
+
}, nt = function(t) {
|
|
276
|
+
t.forEach((s) => s.close());
|
|
277
|
+
}, ot = function(t, s) {
|
|
278
|
+
return R(this, null, function* () {
|
|
279
|
+
var i, l;
|
|
280
|
+
for (const m of t) {
|
|
281
|
+
const w = (l = (i = e(this, z)) == null ? void 0 : i.nest) != null ? l : e(this, S);
|
|
282
|
+
yield m.render(w, s), r(this, z, m);
|
|
283
|
+
}
|
|
284
|
+
});
|
|
285
|
+
}, ct = function(t) {
|
|
286
|
+
var s;
|
|
287
|
+
(s = this.postprocessor) == null || s.call(this, { pathname: t }), e(this, H).notify({ pathname: t });
|
|
288
|
+
}, lt = function() {
|
|
289
|
+
e(this, g).sort((t, s) => {
|
|
290
|
+
const i = t.pattern.split("/").length, l = s.pattern.split("/").length;
|
|
291
|
+
return i - l;
|
|
292
|
+
});
|
|
293
|
+
}, ut = function() {
|
|
294
|
+
n(this, h, K).call(this), n(this, h, dt).call(this);
|
|
295
|
+
}, K = function() {
|
|
296
|
+
e(this, E).forEach((t) => t.destroy()), r(this, E, []);
|
|
297
|
+
}, dt = function() {
|
|
298
|
+
const t = e(this, g).filter((i) => i.isActive), s = n(this, h, mt).call(this, t);
|
|
299
|
+
r(this, E, s.map((i) => new wt(this, i)));
|
|
300
|
+
}, mt = function(t) {
|
|
301
|
+
const s = Array.from(
|
|
302
|
+
e(this, S).querySelectorAll("a")
|
|
303
|
+
), i = t.flatMap(
|
|
304
|
+
(l) => l.getAnchorElements()
|
|
305
|
+
);
|
|
306
|
+
return Array.from(
|
|
252
307
|
new Set(
|
|
253
|
-
[
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
})
|
|
308
|
+
[...s, ...i].filter(
|
|
309
|
+
(l) => {
|
|
310
|
+
var m;
|
|
311
|
+
return (m = l.getAttribute("href")) == null ? void 0 : m.startsWith("/");
|
|
312
|
+
}
|
|
313
|
+
)
|
|
260
314
|
)
|
|
261
315
|
);
|
|
262
|
-
|
|
263
|
-
i.destroy();
|
|
264
|
-
}), n(this, H, s.map((i) => new mt(this, i)));
|
|
265
|
-
}, K = new WeakMap();
|
|
316
|
+
}, x = new WeakMap();
|
|
266
317
|
export {
|
|
267
|
-
|
|
318
|
+
zt as Router
|
|
268
319
|
};
|