aptechka 0.1.12 → 0.1.15
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/Damped-Fy7tHx4d.js +33 -0
- package/lib/Damped-mdFs8WSd.cjs +1 -0
- package/lib/{WheelControls-CX9WUbBC.js → WheelControls-BN4XGOpG.js} +29 -34
- package/lib/WheelControls-Dc1xcVG6.cjs +1 -0
- package/lib/animation/Tweened.d.ts +0 -1
- package/lib/animation/index.cjs +1 -1
- package/lib/animation/index.js +20 -26
- package/lib/component/Component.d.ts +7 -3
- package/lib/component/hooks/custom-element.d.ts +2 -0
- package/lib/component/index.cjs +1 -1
- package/lib/component/index.d.ts +2 -1
- package/lib/component/index.js +174 -139
- package/lib/controls/index.cjs +1 -1
- package/lib/controls/index.js +20 -23
- package/lib/en3/{test → core}/En3Raycaster.d.ts +1 -1
- package/lib/en3/core/en3.d.ts +2 -0
- package/lib/en3/index.cjs +7 -7
- package/lib/en3/index.d.ts +1 -1
- package/lib/en3/index.js +540 -523
- package/lib/index-B-ZmkQyB.cjs +9 -0
- package/lib/{index-BWTXnG5n.js → index-Dizn7btU.js} +96 -96
- package/lib/layout-box/index.cjs +1 -1
- package/lib/layout-box/index.d.ts +15 -0
- package/lib/layout-box/index.js +102 -93
- package/lib/morph/Morph.d.ts +1 -0
- package/lib/morph/index.cjs +1 -1
- package/lib/morph/index.js +130 -122
- package/lib/object-BZELAoVj.cjs +1 -0
- package/lib/object-R34VLqhp.js +85 -0
- package/lib/order/index.cjs +1 -1
- package/lib/order/index.d.ts +1 -0
- package/lib/order/index.js +1 -1
- package/lib/popover/index.cjs +1 -1
- package/lib/popover/index.js +50 -50
- package/lib/resized/index.d.ts +11 -0
- package/lib/router/index.cjs +1 -1
- package/lib/router/index.js +101 -105
- package/lib/scroll/index.cjs +1 -1
- package/lib/scroll/index.js +2 -2
- package/lib/select/index.cjs +1 -1
- package/lib/select/index.js +1 -1
- package/lib/studio/index.cjs +1 -1
- package/lib/studio/index.js +1 -1
- package/lib/utils/index.cjs +1 -1
- package/lib/utils/index.d.ts +1 -1
- package/lib/utils/index.js +15 -14
- package/lib/utils/object.d.ts +1 -0
- package/package.json +1 -1
- package/lib/Damped-BwpMU9Gi.cjs +0 -1
- package/lib/Damped-urvryQLo.js +0 -36
- package/lib/WheelControls-CfDeGCOU.cjs +0 -1
- package/lib/component/hooks/shadow.d.ts +0 -1
- package/lib/index-3G1lTMEf.cjs +0 -9
- package/lib/object-C1ph624j.cjs +0 -1
- package/lib/object-DIPjdukP.js +0 -73
package/lib/popover/index.js
CHANGED
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
import { Attribute as
|
|
2
|
-
import { CustomElement as
|
|
3
|
-
import { S as
|
|
4
|
-
import { g as
|
|
5
|
-
import { AbstractButtonElement as
|
|
6
|
-
var
|
|
7
|
-
for (var n = r > 1 ? void 0 : r ?
|
|
1
|
+
import { Attribute as T } from "../attribute/index.js";
|
|
2
|
+
import { CustomElement as D, define as P } from "../custom-element/index.js";
|
|
3
|
+
import { S as I } from "../Store-JOKrNVEr.js";
|
|
4
|
+
import { g as N } from "../style-j2TwriJ_.js";
|
|
5
|
+
import { AbstractButtonElement as q } from "../abstract-elements/index.js";
|
|
6
|
+
var B = Object.defineProperty, G = Object.getOwnPropertyDescriptor, H = (e, t, s, r) => {
|
|
7
|
+
for (var n = r > 1 ? void 0 : r ? G(t, s) : t, p = e.length - 1, l; p >= 0; p--)
|
|
8
8
|
(l = e[p]) && (n = (r ? l(t, s, n) : l(n)) || n);
|
|
9
|
-
return r && n &&
|
|
10
|
-
},
|
|
9
|
+
return r && n && B(t, s, n), n;
|
|
10
|
+
}, M = (e, t, s) => {
|
|
11
11
|
if (!t.has(e))
|
|
12
12
|
throw TypeError("Cannot " + s);
|
|
13
|
-
}, i = (e, t, s) => (
|
|
13
|
+
}, i = (e, t, s) => (M(e, t, "read from private field"), s ? s.call(e) : t.get(e)), o = (e, t, s) => {
|
|
14
14
|
if (t.has(e))
|
|
15
15
|
throw TypeError("Cannot add the same private member more than once");
|
|
16
16
|
t instanceof WeakSet ? t.add(e) : t.set(e, s);
|
|
17
|
-
},
|
|
18
|
-
let a = class extends
|
|
17
|
+
}, S = (e, t, s, r) => (M(e, t, "write to private field"), r ? r.call(e, s) : t.set(e, s), s), C = (e, t, s) => (M(e, t, "access private method"), s), L, h, g, d, m, f, W, A, u, w, y, E, k, $, v;
|
|
18
|
+
let a = class extends D {
|
|
19
19
|
constructor() {
|
|
20
|
-
super(...arguments), o(this,
|
|
21
|
-
i(this, h).current || (i(this, h).current = !0, i(this,
|
|
20
|
+
super(...arguments), o(this, W), o(this, u), o(this, k), o(this, L, -1), o(this, h, new I(!1)), o(this, g, void 0), o(this, d, new T(this, "history", !1)), o(this, m, new T(this, "single", !1)), o(this, f, !1), this.open = () => {
|
|
21
|
+
i(this, h).current || (i(this, h).current = !0, i(this, m).current && (a.__opened.forEach((e) => e.close()), a.__opened = []), a.__opened.push(this), S(this, L, a.__opened.length - 1), i(this, d).current && i(this, f) && history.pushState("", "", i(this, W, A)), clearTimeout(i(this, g)), this.classList.add("triggered"), this.style.display = "block", setTimeout(() => {
|
|
22
22
|
addEventListener("click", i(this, y)), addEventListener("keydown", i(this, E)), this.style.opacity = "1", this.classList.add("opened");
|
|
23
23
|
}));
|
|
24
|
-
}
|
|
24
|
+
}, this.close = () => {
|
|
25
25
|
i(this, h).current && (i(this, h).current = !1, a.__opened = a.__opened.filter((e) => e !== this), i(this, d).current && history.replaceState(
|
|
26
26
|
"",
|
|
27
27
|
"",
|
|
28
|
-
location.href.replace(new RegExp(`[&?]${i(this,
|
|
28
|
+
location.href.replace(new RegExp(`[&?]${i(this, u, w)}`, "g"), "")
|
|
29
29
|
), this.classList.remove("opened"), this.style.opacity = "0", removeEventListener("click", i(this, y)), removeEventListener("keydown", i(this, E)), setTimeout(() => {
|
|
30
30
|
this.classList.remove("triggered"), this.style.display = "none";
|
|
31
|
-
},
|
|
32
|
-
}
|
|
33
|
-
|
|
31
|
+
}, N(this)));
|
|
32
|
+
}, o(this, y, (e) => {
|
|
33
|
+
C(this, k, $).call(this, () => {
|
|
34
34
|
const t = e.composedPath();
|
|
35
35
|
(!t.find((s) => s === this) && !t.find(
|
|
36
36
|
(s) => s instanceof HTMLElement && s.closest("e-popover-button")
|
|
37
37
|
) || t[0] instanceof HTMLElement && t[0].hasAttribute("outside")) && this.close();
|
|
38
38
|
});
|
|
39
39
|
}), o(this, E, (e) => {
|
|
40
|
-
|
|
40
|
+
C(this, k, $).call(this, () => {
|
|
41
41
|
e.code === "Escape" && this.close();
|
|
42
42
|
});
|
|
43
43
|
}), o(this, v, () => {
|
|
44
|
-
|
|
44
|
+
S(this, f, !1), i(this, h).current && i(this, d).current && !location.search.includes(i(this, u, w)) ? this.close() : !i(this, h).current && i(this, d).current && location.search.includes(i(this, u, w)) && this.open(), S(this, f, !0);
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
47
|
get history() {
|
|
48
48
|
return i(this, d);
|
|
49
49
|
}
|
|
50
50
|
get single() {
|
|
51
|
-
return i(this,
|
|
51
|
+
return i(this, m);
|
|
52
52
|
}
|
|
53
53
|
get opened() {
|
|
54
54
|
return i(this, h);
|
|
@@ -59,70 +59,70 @@ let a = class extends I {
|
|
|
59
59
|
}, 0);
|
|
60
60
|
}
|
|
61
61
|
disconnectedCallback() {
|
|
62
|
-
clearTimeout(i(this,
|
|
62
|
+
clearTimeout(i(this, g)), removeEventListener("popstate", i(this, v));
|
|
63
63
|
}
|
|
64
64
|
};
|
|
65
|
-
|
|
65
|
+
L = /* @__PURE__ */ new WeakMap();
|
|
66
66
|
h = /* @__PURE__ */ new WeakMap();
|
|
67
|
-
m = /* @__PURE__ */ new WeakMap();
|
|
68
|
-
d = /* @__PURE__ */ new WeakMap();
|
|
69
67
|
g = /* @__PURE__ */ new WeakMap();
|
|
68
|
+
d = /* @__PURE__ */ new WeakMap();
|
|
69
|
+
m = /* @__PURE__ */ new WeakMap();
|
|
70
70
|
f = /* @__PURE__ */ new WeakMap();
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
return `${location.pathname}${location.search ? location.search + "&" : "?"}${i(this,
|
|
71
|
+
W = /* @__PURE__ */ new WeakSet();
|
|
72
|
+
A = function() {
|
|
73
|
+
return `${location.pathname}${location.search ? location.search + "&" : "?"}${i(this, u, w)}`;
|
|
74
74
|
};
|
|
75
|
-
|
|
75
|
+
u = /* @__PURE__ */ new WeakSet();
|
|
76
76
|
w = function() {
|
|
77
77
|
return `modal-${this.id}`;
|
|
78
78
|
};
|
|
79
79
|
y = /* @__PURE__ */ new WeakMap();
|
|
80
80
|
E = /* @__PURE__ */ new WeakMap();
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
(a.__opened[i(this,
|
|
81
|
+
k = /* @__PURE__ */ new WeakSet();
|
|
82
|
+
$ = function(e) {
|
|
83
|
+
(a.__opened[i(this, L) - 1] || a.__opened.length === 1) && e();
|
|
84
84
|
};
|
|
85
85
|
v = /* @__PURE__ */ new WeakMap();
|
|
86
|
-
|
|
87
|
-
a =
|
|
88
|
-
|
|
86
|
+
a.__opened = [];
|
|
87
|
+
a = H([
|
|
88
|
+
P("e-popover")
|
|
89
89
|
], a);
|
|
90
|
-
var
|
|
91
|
-
for (var n = r > 1 ? void 0 : r ?
|
|
90
|
+
var R = Object.defineProperty, z = Object.getOwnPropertyDescriptor, F = (e, t, s, r) => {
|
|
91
|
+
for (var n = r > 1 ? void 0 : r ? z(t, s) : t, p = e.length - 1, l; p >= 0; p--)
|
|
92
92
|
(l = e[p]) && (n = (r ? l(t, s, n) : l(n)) || n);
|
|
93
|
-
return r && n &&
|
|
94
|
-
},
|
|
93
|
+
return r && n && R(t, s, n), n;
|
|
94
|
+
}, x = (e, t, s) => {
|
|
95
95
|
if (!t.has(e))
|
|
96
96
|
throw TypeError("Cannot " + s);
|
|
97
|
-
},
|
|
97
|
+
}, _ = (e, t, s) => (x(e, t, "read from private field"), s ? s.call(e) : t.get(e)), J = (e, t, s) => {
|
|
98
98
|
if (t.has(e))
|
|
99
99
|
throw TypeError("Cannot add the same private member more than once");
|
|
100
100
|
t instanceof WeakSet ? t.add(e) : t.set(e, s);
|
|
101
|
-
},
|
|
102
|
-
let O = class extends
|
|
101
|
+
}, K = (e, t, s, r) => (x(e, t, "write to private field"), r ? r.call(e, s) : t.set(e, s), s), c;
|
|
102
|
+
let O = class extends q {
|
|
103
103
|
constructor() {
|
|
104
|
-
super(...arguments),
|
|
104
|
+
super(...arguments), J(this, c, void 0);
|
|
105
105
|
}
|
|
106
106
|
get popoverElement() {
|
|
107
|
-
return
|
|
107
|
+
return _(this, c);
|
|
108
108
|
}
|
|
109
109
|
click() {
|
|
110
|
-
if (
|
|
110
|
+
if (_(this, c)) {
|
|
111
111
|
const e = this.getAttribute("type") || "open";
|
|
112
|
-
e === "open" || e === "toggle" && !
|
|
112
|
+
e === "open" || e === "toggle" && !_(this, c).opened.current ? _(this, c).open() : (e === "close" || e === "toggle" && _(this, c).opened.current) && _(this, c).close();
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
connectedCallback() {
|
|
116
116
|
const e = this.getAttribute("target");
|
|
117
117
|
if (e) {
|
|
118
118
|
const t = document.querySelector(`#${e}`) || this.getRootNode().querySelector(`#${e}`);
|
|
119
|
-
t ?
|
|
119
|
+
t ? K(this, c, t) : console.warn(this, `target ${e} not found`);
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
};
|
|
123
123
|
c = /* @__PURE__ */ new WeakMap();
|
|
124
|
-
O =
|
|
125
|
-
|
|
124
|
+
O = F([
|
|
125
|
+
P("e-popover-button")
|
|
126
126
|
], O);
|
|
127
127
|
export {
|
|
128
128
|
O as PopoverButtonElement,
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Store, StoreOptions } from '../store';
|
|
2
|
+
import { ElementOrSelector } from '../utils';
|
|
3
|
+
export interface ResizedOptions extends StoreOptions<number, 'number'> {
|
|
4
|
+
dispatcher?: ElementOrSelector;
|
|
5
|
+
}
|
|
6
|
+
export type ResizedCallback = () => number;
|
|
7
|
+
export declare class Resized extends Store<number, 'number'> {
|
|
8
|
+
#private;
|
|
9
|
+
constructor(callback: ResizedCallback, options?: ResizedOptions);
|
|
10
|
+
close(): void;
|
|
11
|
+
}
|
package/lib/router/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var X=(n,t)=>(t=Symbol[n])?t:Symbol.for("Symbol."+n);var z=(n,t,s)=>{if(!t.has(n))throw TypeError("Cannot "+s)};var e=(n,t,s)=>(z(n,t,"read from private field"),s?s.call(n):t.get(n)),o=(n,t,s)=>{if(t.has(n))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(n):t.set(n,s)},r=(n,t,s,i)=>(z(n,t,"write to private field"),i?i.call(n,s):t.set(n,s),s);var F=(n,t,s)=>(z(n,t,"access private method"),s);var B=(n,t,s)=>new Promise((i,f)=>{var h=u=>{try{d(s.next(u))}catch(T){f(T)}},a=u=>{try{d(s.throw(u))}catch(T){f(T)}},d=u=>u.done?i(u.value):Promise.resolve(u.value).then(h,a);d((s=s.apply(n,t)).next())});var G=(n,t,s)=>(t=n[X("asyncIterator")])?t.call(n):(n=n[X("iterator")](),t={},s=(i,f)=>(f=n[i])&&(t[i]=h=>new Promise((a,d,u)=>(h=f.call(n,h),u=h.done,Promise.resolve(h.value).then(T=>a({value:T,done:u}),d)))),s("next"),s("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const et=require("urlpattern-polyfill"),st=require("../notifier/index.cjs"),_=require("../browser-CpzFX2xg.cjs"),it=require("../function-MthRj-GJ.cjs"),Z=require("../object-BZELAoVj.cjs");var b,O,R,m,l,v,S,p,P,y,I,$;class nt{constructor(t,s){o(this,I);o(this,b,void 0);o(this,O,void 0);o(this,R,void 0);o(this,m,void 0);o(this,l,void 0);o(this,v,void 0);o(this,S,void 0);o(this,p,null);o(this,P,[]);o(this,y,[]);r(this,b,t),r(this,O,s),r(this,R,new URLPattern({pathname:e(this,b)})),r(this,m,null),r(this,l,null),r(this,v,!1),r(this,S,null),_.isBrowser&&r(this,p,new MutationObserver(i=>{i[0].addedNodes.forEach(h=>{e(this,m)?e(this,y).push(h):e(this,P).push(h)})}))}get pattern(){return e(this,b)}get urlPattern(){return e(this,R)}get isActive(){return e(this,v)}get element(){return e(this,l)}get outlet(){return e(this,S)}testPathname(t){return this.urlPattern.test({pathname:t})}render(t,s){return B(this,null,function*(){var i,f;if(e(this,p).observe(document.head,{childList:!0,subtree:!0}),e(this,m))e(this,P).forEach(h=>{document.head.appendChild(h)});else{const h=yield e(this,O).call(this);if(r(this,y,[...e(this,P)]),typeof h.default=="function"&&(r(this,m,h.default),Z.isESClass(h.default))){const a="e-"+((i=e(this,m))==null?void 0:i.name.toLowerCase());customElements.get(a)||customElements.define(a,h.default)}}if(yield F(this,I,$).call(this),e(this,m)){const h=e(this,R).exec({pathname:s}),a=(h==null?void 0:h.pathname.groups)||{},d=Object.fromEntries(new URLSearchParams(location.search)),u={pathnameParams:a,searchParams:d};Z.isESClass(e(this,m))?r(this,l,new(e(this,m))(u)):r(this,l,e(this,m).call(this,u)),t.appendChild(e(this,l)),r(this,S,e(this,l).querySelector("[data-outlet]")||((f=e(this,l).shadowRoot)==null?void 0:f.querySelector("[data-outlet]"))||e(this,l).shadowRoot||e(this,l)),r(this,v,!0)}e(this,p).disconnect()})}close(){var t;e(this,p).disconnect(),(t=e(this,l))==null||t.remove(),r(this,v,!1),e(this,y).forEach(s=>document.head.removeChild(s)),r(this,y,[])}getAnchorElements(){var s;let t=[];return e(this,l)&&(t=[...e(this,l).querySelectorAll("a")]),(s=e(this,l))!=null&&s.shadowRoot&&(t=[...t,...e(this,l).shadowRoot.querySelectorAll("a")]),t}}b=new WeakMap,O=new WeakMap,R=new WeakMap,m=new WeakMap,l=new WeakMap,v=new WeakMap,S=new WeakMap,p=new WeakMap,P=new WeakMap,y=new WeakMap,I=new WeakSet,$=function(){return B(this,null,function*(){const t=e(this,P).filter(a=>a instanceof HTMLElement?a.tagName==="STYLE"||a.tagName==="SCRIPT"||a.tagName==="LINK":!1);try{for(var s=G(t),i,f,h;i=!(f=yield s.next()).done;i=!1){const a=f.value;yield new Promise(d=>{a.onload=()=>{d()}})}}catch(f){h=[f]}finally{try{i&&(f=s.return)&&(yield f.call(s))}finally{if(h)throw h[0]}}})};var H,g,A,U,j;class rt{constructor(t,s){o(this,H,void 0);o(this,g,void 0);o(this,A,void 0);o(this,U,void 0);o(this,j,t=>{t.preventDefault(),e(this,H).navigate(e(this,A),e(this,U))});r(this,H,t),r(this,g,s),r(this,A,e(this,g).getAttribute("href")||"/"),r(this,U,e(this,g).getAttribute("data-history-action")||"push"),e(this,g).addEventListener("click",e(this,j)),location.pathname===e(this,A)&&e(this,g).classList.add("current")}destroy(){e(this,g).removeEventListener("click",e(this,j)),e(this,g).classList.remove("current")}}H=new WeakMap,g=new WeakMap,A=new WeakMap,U=new WeakMap,j=new WeakMap;globalThis.URLPattern=et.URLPattern;var k,q,w,C,M,E,N,x,D,K,tt,W;const Y=class Y{constructor(t){o(this,K);o(this,k,null);o(this,q,void 0);o(this,w,[]);o(this,C,null);o(this,M,[]);o(this,E,void 0);o(this,N,null);o(this,x,new st.Notifier);o(this,D,it.debounce(()=>{const t=s=>s.split("/").length;r(this,w,e(this,w).sort((s,i)=>t(s.pattern)-t(i.pattern))),this.navigate(location.pathname.replace(e(this,q),""))},0));o(this,W,t=>{t.state&&this.navigate(t.state,"none")});r(this,q,(t==null?void 0:t.base)||""),Y.active=this,_.isBrowser&&(r(this,k,(t==null?void 0:t.rootElement)||document.body),addEventListener("popstate",e(this,W)))}get currentPathname(){return e(this,N)}get candidatePathname(){return e(this,E)}get routes(){return e(this,w)}navigationEvent(t){return e(this,x).subscribe(t)}defineRoute(t,s){const i=new nt(t,s);e(this,w).push(i),e(this,D).call(this)}navigate(t,s="push"){return B(this,null,function*(){var u,Q;if(e(this,E)===t||e(this,N)===t)return;Y.active=this,r(this,E,t);const i=e(this,w).filter(c=>c.isActive),f=e(this,w).filter(c=>!i.includes(c)&&c.testPathname(t)),h=i.filter(c=>!c.testPathname(t)),a=i.filter(c=>c.testPathname(t));let d=!0;if(this.preprocessor)try{yield new Promise((c,L)=>{var V;(V=this.preprocessor)==null||V.call(this,{pathname:t,resolve:c,reject:L})})}catch(c){c?console.error(c):console.log("Route change canceled"),d=!1}if(d&&e(this,E)===t){r(this,C,a[a.length-1]),h.forEach(L=>{L.close()}),r(this,N,t);try{for(var T=G(f),at,ct,lt;at=!(ct=yield T.next()).done;at=!1){const L=ct.value;yield L.render(((u=e(this,C))==null?void 0:u.outlet)||e(this,k),t),r(this,C,L)}}catch(ct){lt=[ct]}finally{try{at&&(ct=T.return)&&(yield ct.call(T))}finally{if(lt)throw lt[0]}}const c=e(this,q)+t+location.search;s==="push"?history.pushState(c,"",c):s==="replace"&&history.replaceState(c,"",c),F(this,K,tt).call(this),(Q=this.postprocessor)==null||Q.call(this,{pathname:t}),e(this,x).notify({pathname:t})}})}};k=new WeakMap,q=new WeakMap,w=new WeakMap,C=new WeakMap,M=new WeakMap,E=new WeakMap,N=new WeakMap,x=new WeakMap,D=new WeakMap,K=new WeakSet,tt=function(){const t=e(this,w).filter(i=>i.isActive),s=Array.from(new Set([...e(this,k).querySelectorAll("a"),...t.map(i=>i.getAnchorElements()).flat()].filter(i=>{var f;return(f=i.getAttribute("href"))==null?void 0:f.startsWith("/")})));e(this,M).forEach(i=>{i.destroy()}),r(this,M,s.map(i=>new rt(this,i)))},W=new WeakMap;let J=Y;exports.Router=J;
|
package/lib/router/index.js
CHANGED
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
var B = (i, t, s) => (it(i, typeof t != "symbol" ? t + "" : t, s), s), z = (i, t, s) => {
|
|
5
|
-
if (!t.has(i))
|
|
1
|
+
var Q = (o, t) => (t = Symbol[o]) ? t : Symbol.for("Symbol." + o);
|
|
2
|
+
var $ = (o, t, s) => {
|
|
3
|
+
if (!t.has(o))
|
|
6
4
|
throw TypeError("Cannot " + s);
|
|
7
5
|
};
|
|
8
|
-
var e = (
|
|
9
|
-
if (t.has(
|
|
6
|
+
var e = (o, t, s) => ($(o, t, "read from private field"), s ? s.call(o) : t.get(o)), n = (o, t, s) => {
|
|
7
|
+
if (t.has(o))
|
|
10
8
|
throw TypeError("Cannot add the same private member more than once");
|
|
11
|
-
t instanceof WeakSet ? t.add(
|
|
12
|
-
}, r = (
|
|
13
|
-
var
|
|
14
|
-
var
|
|
9
|
+
t instanceof WeakSet ? t.add(o) : t.set(o, s);
|
|
10
|
+
}, r = (o, t, s, i) => ($(o, t, "write to private field"), i ? i.call(o, s) : t.set(o, s), s);
|
|
11
|
+
var z = (o, t, s) => ($(o, t, "access private method"), s);
|
|
12
|
+
var j = (o, t, s) => new Promise((i, f) => {
|
|
15
13
|
var h = (u) => {
|
|
16
14
|
try {
|
|
17
15
|
d(s.next(u));
|
|
@@ -24,31 +22,31 @@ var D = (i, t, s) => new Promise((o, f) => {
|
|
|
24
22
|
} catch (T) {
|
|
25
23
|
f(T);
|
|
26
24
|
}
|
|
27
|
-
}, d = (u) => u.done ?
|
|
28
|
-
d((s = s.apply(
|
|
25
|
+
}, d = (u) => u.done ? i(u.value) : Promise.resolve(u.value).then(h, a);
|
|
26
|
+
d((s = s.apply(o, t)).next());
|
|
29
27
|
});
|
|
30
|
-
var
|
|
31
|
-
import { URLPattern as
|
|
32
|
-
import { Notifier as
|
|
33
|
-
import { i as
|
|
34
|
-
import { d as
|
|
35
|
-
import { i as
|
|
36
|
-
var R,
|
|
37
|
-
class
|
|
28
|
+
var F = (o, t, s) => (t = o[Q("asyncIterator")]) ? t.call(o) : (o = o[Q("iterator")](), t = {}, s = (i, f) => (f = o[i]) && (t[i] = (h) => new Promise((a, d, u) => (h = f.call(o, h), u = h.done, Promise.resolve(h.value).then((T) => a({ value: T, done: u }), d)))), s("next"), s("return"), t);
|
|
29
|
+
import { URLPattern as et } from "urlpattern-polyfill";
|
|
30
|
+
import { Notifier as st } from "../notifier/index.js";
|
|
31
|
+
import { i as Z } from "../browser-0zX67oeU.js";
|
|
32
|
+
import { d as it } from "../function-C10DGppn.js";
|
|
33
|
+
import { i as V } from "../object-R34VLqhp.js";
|
|
34
|
+
var R, U, b, m, c, w, A, v, P, E, B, _;
|
|
35
|
+
class ot {
|
|
38
36
|
constructor(t, s) {
|
|
39
|
-
n(this,
|
|
37
|
+
n(this, B);
|
|
40
38
|
n(this, R, void 0);
|
|
41
|
-
n(this,
|
|
39
|
+
n(this, U, void 0);
|
|
42
40
|
n(this, b, void 0);
|
|
43
41
|
n(this, m, void 0);
|
|
44
|
-
n(this,
|
|
45
|
-
n(this,
|
|
42
|
+
n(this, c, void 0);
|
|
43
|
+
n(this, w, void 0);
|
|
46
44
|
n(this, A, void 0);
|
|
47
|
-
n(this,
|
|
45
|
+
n(this, v, null);
|
|
48
46
|
n(this, P, []);
|
|
49
47
|
n(this, E, []);
|
|
50
|
-
r(this, R, t), r(this,
|
|
51
|
-
|
|
48
|
+
r(this, R, t), r(this, U, s), r(this, b, new URLPattern({ pathname: e(this, R) })), r(this, m, null), r(this, c, null), r(this, w, !1), r(this, A, null), Z && r(this, v, new MutationObserver((i) => {
|
|
49
|
+
i[0].addedNodes.forEach((h) => {
|
|
52
50
|
e(this, m) ? e(this, E).push(h) : e(this, P).push(h);
|
|
53
51
|
});
|
|
54
52
|
}));
|
|
@@ -60,10 +58,10 @@ class ht {
|
|
|
60
58
|
return e(this, b);
|
|
61
59
|
}
|
|
62
60
|
get isActive() {
|
|
63
|
-
return e(this,
|
|
61
|
+
return e(this, w);
|
|
64
62
|
}
|
|
65
63
|
get element() {
|
|
66
|
-
return e(this,
|
|
64
|
+
return e(this, c);
|
|
67
65
|
}
|
|
68
66
|
get outlet() {
|
|
69
67
|
return e(this, A);
|
|
@@ -72,9 +70,9 @@ class ht {
|
|
|
72
70
|
return this.urlPattern.test({ pathname: t });
|
|
73
71
|
}
|
|
74
72
|
render(t, s) {
|
|
75
|
-
return
|
|
76
|
-
var
|
|
77
|
-
if (e(this,
|
|
73
|
+
return j(this, null, function* () {
|
|
74
|
+
var i, f;
|
|
75
|
+
if (e(this, v).observe(document.head, {
|
|
78
76
|
childList: !0,
|
|
79
77
|
subtree: !0
|
|
80
78
|
}), e(this, m))
|
|
@@ -82,44 +80,44 @@ class ht {
|
|
|
82
80
|
document.head.appendChild(h);
|
|
83
81
|
});
|
|
84
82
|
else {
|
|
85
|
-
const h = yield e(this,
|
|
86
|
-
if (r(this, E, [...e(this, P)]), typeof h.default == "function" && (r(this, m, h.default),
|
|
87
|
-
const a = "e-" + ((
|
|
83
|
+
const h = yield e(this, U).call(this);
|
|
84
|
+
if (r(this, E, [...e(this, P)]), typeof h.default == "function" && (r(this, m, h.default), V(h.default))) {
|
|
85
|
+
const a = "e-" + ((i = e(this, m)) == null ? void 0 : i.name.toLowerCase());
|
|
88
86
|
customElements.get(a) || customElements.define(a, h.default);
|
|
89
87
|
}
|
|
90
88
|
}
|
|
91
|
-
if (yield
|
|
89
|
+
if (yield z(this, B, _).call(this), e(this, m)) {
|
|
92
90
|
const h = e(this, b).exec({ pathname: s }), a = (h == null ? void 0 : h.pathname.groups) || {}, d = Object.fromEntries(
|
|
93
91
|
new URLSearchParams(location.search)
|
|
94
92
|
), u = {
|
|
95
93
|
pathnameParams: a,
|
|
96
94
|
searchParams: d
|
|
97
95
|
};
|
|
98
|
-
|
|
96
|
+
V(e(this, m)) ? r(this, c, new (e(this, m))(
|
|
99
97
|
u
|
|
100
|
-
)) : r(this,
|
|
98
|
+
)) : r(this, c, e(this, m).call(this, u)), t.appendChild(e(this, c)), r(this, A, e(this, c).querySelector("[data-outlet]") || ((f = e(this, c).shadowRoot) == null ? void 0 : f.querySelector("[data-outlet]")) || e(this, c).shadowRoot || e(this, c)), r(this, w, !0);
|
|
101
99
|
}
|
|
102
|
-
e(this,
|
|
100
|
+
e(this, v).disconnect();
|
|
103
101
|
});
|
|
104
102
|
}
|
|
105
103
|
close() {
|
|
106
104
|
var t;
|
|
107
|
-
e(this,
|
|
105
|
+
e(this, v).disconnect(), (t = e(this, c)) == null || t.remove(), r(this, w, !1), e(this, E).forEach((s) => document.head.removeChild(s)), r(this, E, []);
|
|
108
106
|
}
|
|
109
107
|
getAnchorElements() {
|
|
110
108
|
var s;
|
|
111
109
|
let t = [];
|
|
112
|
-
return e(this,
|
|
110
|
+
return e(this, c) && (t = [...e(this, c).querySelectorAll("a")]), (s = e(this, c)) != null && s.shadowRoot && (t = [
|
|
113
111
|
...t,
|
|
114
|
-
...e(this,
|
|
112
|
+
...e(this, c).shadowRoot.querySelectorAll("a")
|
|
115
113
|
]), t;
|
|
116
114
|
}
|
|
117
115
|
}
|
|
118
|
-
R = new WeakMap(),
|
|
119
|
-
return
|
|
116
|
+
R = new WeakMap(), U = new WeakMap(), b = new WeakMap(), m = new WeakMap(), c = new WeakMap(), w = new WeakMap(), A = new WeakMap(), v = new WeakMap(), P = new WeakMap(), E = new WeakMap(), B = new WeakSet(), _ = function() {
|
|
117
|
+
return j(this, null, function* () {
|
|
120
118
|
const t = e(this, P).filter((a) => a instanceof HTMLElement ? a.tagName === "STYLE" || a.tagName === "SCRIPT" || a.tagName === "LINK" : !1);
|
|
121
119
|
try {
|
|
122
|
-
for (var s =
|
|
120
|
+
for (var s = F(t), i, f, h; i = !(f = yield s.next()).done; i = !1) {
|
|
123
121
|
const a = f.value;
|
|
124
122
|
yield new Promise((d) => {
|
|
125
123
|
a.onload = () => {
|
|
@@ -131,7 +129,7 @@ R = new WeakMap(), H = new WeakMap(), b = new WeakMap(), m = new WeakMap(), l =
|
|
|
131
129
|
h = [f];
|
|
132
130
|
} finally {
|
|
133
131
|
try {
|
|
134
|
-
|
|
132
|
+
i && (f = s.return) && (yield f.call(s));
|
|
135
133
|
} finally {
|
|
136
134
|
if (h)
|
|
137
135
|
throw h[0];
|
|
@@ -139,46 +137,44 @@ R = new WeakMap(), H = new WeakMap(), b = new WeakMap(), m = new WeakMap(), l =
|
|
|
139
137
|
}
|
|
140
138
|
});
|
|
141
139
|
};
|
|
142
|
-
var
|
|
143
|
-
class
|
|
140
|
+
var H, g, S, O, x;
|
|
141
|
+
class rt {
|
|
144
142
|
constructor(t, s) {
|
|
145
|
-
n(this,
|
|
146
|
-
n(this,
|
|
143
|
+
n(this, H, void 0);
|
|
144
|
+
n(this, g, void 0);
|
|
147
145
|
n(this, S, void 0);
|
|
148
|
-
n(this,
|
|
149
|
-
n(this,
|
|
150
|
-
t.preventDefault(), e(this,
|
|
146
|
+
n(this, O, void 0);
|
|
147
|
+
n(this, x, (t) => {
|
|
148
|
+
t.preventDefault(), e(this, H).navigate(e(this, S), e(this, O));
|
|
151
149
|
});
|
|
152
|
-
r(this,
|
|
150
|
+
r(this, H, t), r(this, g, s), r(this, S, e(this, g).getAttribute("href") || "/"), r(this, O, e(this, g).getAttribute("data-history-action") || "push"), e(this, g).addEventListener("click", e(this, x)), location.pathname === e(this, S) && e(this, g).classList.add("current");
|
|
153
151
|
}
|
|
154
152
|
destroy() {
|
|
155
|
-
e(this,
|
|
153
|
+
e(this, g).removeEventListener("click", e(this, x)), e(this, g).classList.remove("current");
|
|
156
154
|
}
|
|
157
155
|
}
|
|
158
|
-
|
|
159
|
-
globalThis.URLPattern =
|
|
160
|
-
var k, N,
|
|
161
|
-
const
|
|
156
|
+
H = new WeakMap(), g = new WeakMap(), S = new WeakMap(), O = new WeakMap(), x = new WeakMap();
|
|
157
|
+
globalThis.URLPattern = et;
|
|
158
|
+
var k, N, p, C, I, L, q, M, D, K, tt, W;
|
|
159
|
+
const Y = class Y {
|
|
162
160
|
constructor(t) {
|
|
163
|
-
n(this,
|
|
161
|
+
n(this, K);
|
|
164
162
|
n(this, k, null);
|
|
165
163
|
n(this, N, void 0);
|
|
166
|
-
n(this,
|
|
164
|
+
n(this, p, []);
|
|
167
165
|
n(this, C, null);
|
|
168
|
-
n(this,
|
|
166
|
+
n(this, I, []);
|
|
169
167
|
n(this, L, void 0);
|
|
170
168
|
n(this, q, null);
|
|
171
|
-
n(this,
|
|
172
|
-
|
|
173
|
-
B(this, "postprocessor");
|
|
174
|
-
n(this, W, nt(() => {
|
|
169
|
+
n(this, M, new st());
|
|
170
|
+
n(this, D, it(() => {
|
|
175
171
|
const t = (s) => s.split("/").length;
|
|
176
|
-
r(this,
|
|
172
|
+
r(this, p, e(this, p).sort((s, i) => t(s.pattern) - t(i.pattern))), this.navigate(location.pathname.replace(e(this, N), ""));
|
|
177
173
|
}, 0));
|
|
178
|
-
n(this,
|
|
174
|
+
n(this, W, (t) => {
|
|
179
175
|
t.state && this.navigate(t.state, "none");
|
|
180
176
|
});
|
|
181
|
-
r(this, N, (t == null ? void 0 : t.base) || ""),
|
|
177
|
+
r(this, N, (t == null ? void 0 : t.base) || ""), Y.active = this, Z && (r(this, k, (t == null ? void 0 : t.rootElement) || document.body), addEventListener("popstate", e(this, W)));
|
|
182
178
|
}
|
|
183
179
|
get currentPathname() {
|
|
184
180
|
return e(this, q);
|
|
@@ -187,79 +183,79 @@ const U = class U {
|
|
|
187
183
|
return e(this, L);
|
|
188
184
|
}
|
|
189
185
|
get routes() {
|
|
190
|
-
return e(this,
|
|
186
|
+
return e(this, p);
|
|
191
187
|
}
|
|
192
188
|
navigationEvent(t) {
|
|
193
|
-
return e(this,
|
|
189
|
+
return e(this, M).subscribe(t);
|
|
194
190
|
}
|
|
195
191
|
defineRoute(t, s) {
|
|
196
|
-
const
|
|
197
|
-
e(this,
|
|
192
|
+
const i = new ot(t, s);
|
|
193
|
+
e(this, p).push(i), e(this, D).call(this);
|
|
198
194
|
}
|
|
199
195
|
navigate(t, s = "push") {
|
|
200
|
-
return
|
|
201
|
-
var u,
|
|
196
|
+
return j(this, null, function* () {
|
|
197
|
+
var u, G;
|
|
202
198
|
if (e(this, L) === t || e(this, q) === t)
|
|
203
199
|
return;
|
|
204
|
-
|
|
205
|
-
const
|
|
206
|
-
(
|
|
207
|
-
), h =
|
|
200
|
+
Y.active = this, r(this, L, t);
|
|
201
|
+
const i = e(this, p).filter((l) => l.isActive), f = e(this, p).filter(
|
|
202
|
+
(l) => !i.includes(l) && l.testPathname(t)
|
|
203
|
+
), h = i.filter((l) => !l.testPathname(t)), a = i.filter((l) => l.testPathname(t));
|
|
208
204
|
let d = !0;
|
|
209
205
|
if (this.preprocessor)
|
|
210
206
|
try {
|
|
211
|
-
yield new Promise((
|
|
212
|
-
var
|
|
213
|
-
(
|
|
207
|
+
yield new Promise((l, y) => {
|
|
208
|
+
var J;
|
|
209
|
+
(J = this.preprocessor) == null || J.call(this, { pathname: t, resolve: l, reject: y });
|
|
214
210
|
});
|
|
215
|
-
} catch (
|
|
216
|
-
|
|
211
|
+
} catch (l) {
|
|
212
|
+
l ? console.error(l) : console.log("Route change canceled"), d = !1;
|
|
217
213
|
}
|
|
218
214
|
if (d && e(this, L) === t) {
|
|
219
215
|
r(this, C, a[a.length - 1]), h.forEach((y) => {
|
|
220
216
|
y.close();
|
|
221
217
|
}), r(this, q, t);
|
|
222
218
|
try {
|
|
223
|
-
for (var T =
|
|
224
|
-
const y =
|
|
219
|
+
for (var T = F(f), mt, gt, pt; mt = !(gt = yield T.next()).done; mt = !1) {
|
|
220
|
+
const y = gt.value;
|
|
225
221
|
yield y.render(
|
|
226
222
|
((u = e(this, C)) == null ? void 0 : u.outlet) || e(this, k),
|
|
227
223
|
t
|
|
228
224
|
), r(this, C, y);
|
|
229
225
|
}
|
|
230
|
-
} catch (
|
|
231
|
-
|
|
226
|
+
} catch (gt) {
|
|
227
|
+
pt = [gt];
|
|
232
228
|
} finally {
|
|
233
229
|
try {
|
|
234
|
-
|
|
230
|
+
mt && (gt = T.return) && (yield gt.call(T));
|
|
235
231
|
} finally {
|
|
236
|
-
if (
|
|
237
|
-
throw
|
|
232
|
+
if (pt)
|
|
233
|
+
throw pt[0];
|
|
238
234
|
}
|
|
239
235
|
}
|
|
240
|
-
const
|
|
241
|
-
s === "push" ? history.pushState(
|
|
236
|
+
const l = e(this, N) + t + location.search;
|
|
237
|
+
s === "push" ? history.pushState(l, "", l) : s === "replace" && history.replaceState(l, "", l), z(this, K, tt).call(this), (G = this.postprocessor) == null || G.call(this, { pathname: t }), e(this, M).notify({ pathname: t });
|
|
242
238
|
}
|
|
243
239
|
});
|
|
244
240
|
}
|
|
245
241
|
};
|
|
246
|
-
k = new WeakMap(), N = new WeakMap(),
|
|
247
|
-
const t = e(this,
|
|
242
|
+
k = new WeakMap(), N = new WeakMap(), p = new WeakMap(), C = new WeakMap(), I = new WeakMap(), L = new WeakMap(), q = new WeakMap(), M = new WeakMap(), D = new WeakMap(), K = new WeakSet(), tt = function() {
|
|
243
|
+
const t = e(this, p).filter((i) => i.isActive), s = Array.from(
|
|
248
244
|
new Set(
|
|
249
245
|
[
|
|
250
246
|
...e(this, k).querySelectorAll("a"),
|
|
251
|
-
...t.map((
|
|
252
|
-
].filter((
|
|
247
|
+
...t.map((i) => i.getAnchorElements()).flat()
|
|
248
|
+
].filter((i) => {
|
|
253
249
|
var f;
|
|
254
|
-
return (f =
|
|
250
|
+
return (f = i.getAttribute("href")) == null ? void 0 : f.startsWith("/");
|
|
255
251
|
})
|
|
256
252
|
)
|
|
257
253
|
);
|
|
258
|
-
e(this,
|
|
259
|
-
|
|
260
|
-
}), r(this,
|
|
261
|
-
},
|
|
262
|
-
let
|
|
254
|
+
e(this, I).forEach((i) => {
|
|
255
|
+
i.destroy();
|
|
256
|
+
}), r(this, I, s.map((i) => new rt(this, i)));
|
|
257
|
+
}, W = new WeakMap();
|
|
258
|
+
let X = Y;
|
|
263
259
|
export {
|
|
264
|
-
|
|
260
|
+
X as Router
|
|
265
261
|
};
|