aptechka 0.16.0 → 0.18.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.
Files changed (141) hide show
  1. package/lib/animation/Animation.d.ts +34 -0
  2. package/lib/animation/Damped.d.ts +18 -0
  3. package/lib/animation/Tweened.d.ts +14 -0
  4. package/lib/animation/index.d.ts +3 -0
  5. package/lib/attribute/index.d.ts +14 -0
  6. package/lib/canvas/index.d.ts +34 -0
  7. package/lib/class-linked-status/index.d.ts +11 -0
  8. package/lib/connector/index.d.ts +15 -0
  9. package/lib/controls/AutoplayControls.d.ts +16 -0
  10. package/lib/controls/Controls.d.ts +8 -0
  11. package/lib/controls/DragControls.d.ts +15 -0
  12. package/lib/controls/KeyboardControls.d.ts +13 -0
  13. package/lib/controls/WheelControls.d.ts +18 -0
  14. package/lib/controls/index.d.ts +5 -0
  15. package/lib/css-property/index.d.ts +16 -0
  16. package/lib/css-unit-parser/index.d.ts +6 -0
  17. package/lib/css-value-parser/index.d.ts +6 -0
  18. package/lib/dev/index.d.ts +1 -0
  19. package/lib/device/Device.d.ts +18 -0
  20. package/lib/device/Viewport.d.ts +28 -0
  21. package/lib/device/index.d.ts +2 -0
  22. package/lib/element-resizer/index.d.ts +9 -0
  23. package/lib/image/index.d.ts +10 -0
  24. package/lib/intersector/index.d.ts +9 -0
  25. package/lib/ladder/index.d.ts +23 -0
  26. package/lib/layout-box/index.d.ts +95 -0
  27. package/lib/loading/index.d.ts +38 -0
  28. package/lib/media/index.d.ts +11 -0
  29. package/lib/need_redo_tweaker/CheckboxElement.d.ts +14 -0
  30. package/lib/need_redo_tweaker/TweakerBooleanManagerElement.d.ts +10 -0
  31. package/lib/need_redo_tweaker/TweakerColorManagerElement.d.ts +10 -0
  32. package/lib/need_redo_tweaker/TweakerElement.d.ts +17 -0
  33. package/lib/need_redo_tweaker/TweakerFieldElement.d.ts +19 -0
  34. package/lib/need_redo_tweaker/TweakerFolderElement.d.ts +23 -0
  35. package/lib/need_redo_tweaker/TweakerLinkManagerElement.d.ts +10 -0
  36. package/lib/need_redo_tweaker/TweakerNumberManagerElement.d.ts +13 -0
  37. package/lib/need_redo_tweaker/TweakerSelectManagerElement.d.ts +10 -0
  38. package/lib/need_redo_tweaker/TweakerStoreManagerElement.d.ts +9 -0
  39. package/lib/need_redo_tweaker/TweakerStringManagerElement.d.ts +10 -0
  40. package/lib/need_redo_tweaker/element-constructor/ElementConstructor.d.ts +74 -0
  41. package/lib/need_redo_tweaker/element-constructor/createStylesheet.d.ts +2 -0
  42. package/lib/need_redo_tweaker/element-constructor/createTheme.d.ts +12 -0
  43. package/lib/need_redo_tweaker/element-constructor/index.d.ts +4 -0
  44. package/lib/need_redo_tweaker/element-constructor/knownSvgTags.d.ts +1 -0
  45. package/lib/need_redo_tweaker/element-constructor/tags.d.ts +118 -0
  46. package/lib/need_redo_tweaker/index.cjs +4 -4
  47. package/lib/need_redo_tweaker/index.d.ts +1 -0
  48. package/lib/need_redo_tweaker/index.js +1 -2
  49. package/lib/need_redo_tweaker/select/SelectElement.d.ts +24 -0
  50. package/lib/need_redo_tweaker/select/SelectHeadElement.d.ts +12 -0
  51. package/lib/need_redo_tweaker/select/SelectOptionElement.d.ts +13 -0
  52. package/lib/need_redo_tweaker/select/SelectUserElement.d.ts +6 -0
  53. package/lib/need_redo_tweaker/select/index.d.ts +4 -0
  54. package/lib/need_redo_tweaker/theme/index.d.ts +35 -0
  55. package/lib/need_redo_tweaker/tweakerManagerConstructors.d.ts +14 -0
  56. package/lib/need_redo_tweaker/tweakerStorage.d.ts +23 -0
  57. package/lib/notifier/index.d.ts +8 -0
  58. package/lib/object-DOa0yKM9.js +114 -0
  59. package/lib/object-HBC5QlzO.cjs +1 -0
  60. package/lib/order/index.d.ts +22 -0
  61. package/lib/pointer/Pointer.d.ts +22 -0
  62. package/lib/pointer/PointerElement.d.ts +13 -0
  63. package/lib/pointer/index.d.ts +2 -0
  64. package/lib/popover/PopoverButtonElement.d.ts +14 -0
  65. package/lib/popover/PopoverElement.d.ts +25 -0
  66. package/lib/popover/index.d.ts +2 -0
  67. package/lib/scroll/ScrollBulletButtonsElement.d.ts +11 -0
  68. package/lib/scroll/ScrollButtonElement.d.ts +5 -0
  69. package/lib/scroll/ScrollElement.d.ts +81 -0
  70. package/lib/scroll/ScrollSection.d.ts +22 -0
  71. package/lib/scroll/ScrollSegmentElement.d.ts +62 -0
  72. package/lib/scroll/ScrollSetButtonElement.d.ts +9 -0
  73. package/lib/scroll/ScrollStepButtonElement.d.ts +9 -0
  74. package/lib/scroll/ScrollUserElement.d.ts +6 -0
  75. package/lib/scroll/ScrollbarElement.d.ts +13 -0
  76. package/lib/scroll/index.d.ts +6 -0
  77. package/lib/scroll-entries/index.d.ts +20 -0
  78. package/lib/sequence/index.d.ts +20 -0
  79. package/lib/slicer/Letter.d.ts +11 -0
  80. package/lib/slicer/SlicerElement.d.ts +20 -0
  81. package/lib/slicer/Word.d.ts +16 -0
  82. package/lib/slicer/index.d.ts +3 -0
  83. package/lib/source/SourceClass.d.ts +11 -0
  84. package/lib/source/SourceElement.d.ts +24 -0
  85. package/lib/source/SourceManager.d.ts +13 -0
  86. package/lib/source/SourceSet.d.ts +8 -0
  87. package/lib/source/index.d.ts +4 -0
  88. package/lib/store/Composed.d.ts +7 -0
  89. package/lib/store/Derived.d.ts +7 -0
  90. package/lib/store/DerivedArray.d.ts +7 -0
  91. package/lib/store/Resource.d.ts +11 -0
  92. package/lib/store/Store.d.ts +35 -0
  93. package/lib/store/StoreRegistry.d.ts +22 -0
  94. package/lib/store/index.d.ts +6 -0
  95. package/lib/test/starting-style/index.d.ts +1 -0
  96. package/lib/ticker/index.d.ts +21 -0
  97. package/lib/utils/array.d.ts +2 -0
  98. package/lib/utils/attributes.d.ts +2 -0
  99. package/lib/utils/browser.d.ts +1 -0
  100. package/lib/utils/bytes.d.ts +1 -0
  101. package/lib/utils/canvas.d.ts +7 -0
  102. package/lib/utils/collisions.d.ts +3 -0
  103. package/lib/utils/coordinates.d.ts +13 -0
  104. package/lib/utils/cssom.d.ts +5 -0
  105. package/lib/utils/decoding.d.ts +2 -0
  106. package/lib/utils/dom.d.ts +5 -0
  107. package/lib/utils/easings.d.ts +17 -0
  108. package/lib/utils/events.d.ts +8 -0
  109. package/lib/utils/file.d.ts +1 -0
  110. package/lib/utils/function.d.ts +2 -0
  111. package/lib/utils/gestures.d.ts +1 -0
  112. package/lib/utils/index.cjs +1 -1
  113. package/lib/utils/index.d.ts +27 -0
  114. package/lib/utils/index.js +155 -140
  115. package/lib/utils/jss.d.ts +12 -0
  116. package/lib/utils/layout.d.ts +3 -0
  117. package/lib/utils/math.d.ts +11 -0
  118. package/lib/utils/number.d.ts +3 -0
  119. package/lib/utils/object.d.ts +9 -0
  120. package/lib/utils/polyfills.d.ts +1 -0
  121. package/lib/utils/promises.d.ts +1 -0
  122. package/lib/utils/string.d.ts +8 -0
  123. package/lib/utils/style.d.ts +2 -0
  124. package/lib/utils/ts-shape.d.ts +20 -0
  125. package/lib/utils/ts-utility.d.ts +26 -0
  126. package/lib/utils/url.d.ts +9 -0
  127. package/lib/video/index.d.ts +21 -0
  128. package/lib/window-resizer/index.d.ts +9 -0
  129. package/package.json +3 -47
  130. package/lib/en3/index.cjs +0 -8
  131. package/lib/en3/index.js +0 -374
  132. package/lib/file-BEr-o55N.js +0 -31
  133. package/lib/file-C9BbxzVU.cjs +0 -1
  134. package/lib/morph/index.cjs +0 -1
  135. package/lib/morph/index.js +0 -225
  136. package/lib/object-CCiXnER2.cjs +0 -1
  137. package/lib/object-D6MVWB4l.js +0 -85
  138. package/lib/router/index.cjs +0 -1
  139. package/lib/router/index.js +0 -266
  140. package/lib/url-C3dWnJQg.cjs +0 -1
  141. package/lib/url-DMNfW7uN.js +0 -22
@@ -1,85 +0,0 @@
1
- function c(e) {
2
- return typeof e == "object" && e !== null && !Array.isArray(e);
3
- }
4
- function y(e) {
5
- if (e === null || typeof e != "object")
6
- return e;
7
- if (e instanceof Date)
8
- return new Date(e.getTime());
9
- if (e instanceof Node)
10
- return e;
11
- const t = Array.isArray(e) ? [] : {};
12
- for (const r in e)
13
- e.hasOwnProperty(r) && (t[r] = y(e[r]));
14
- return t;
15
- }
16
- function a(e, t, r = c) {
17
- for (const n in t)
18
- r(t[n]) ? (e[n] || Object.assign(e, { [n]: {} }), a(e[n], t[n], r)) : Object.assign(e, { [n]: t[n] });
19
- return e;
20
- }
21
- function u(e) {
22
- return e === null || typeof e == "undefined";
23
- }
24
- function i(e, t) {
25
- if (typeof e != typeof t)
26
- return !1;
27
- if ([e, t].some((r) => u(r)))
28
- return e === t;
29
- if (Array.isArray(e)) {
30
- const r = e.length > t.length ? e : t, n = e.length > t.length ? t : e;
31
- return r.every(
32
- (s, f) => i(s, n[f])
33
- );
34
- }
35
- if (typeof e != "object" || e instanceof Node || typeof e == "object" && e.constructor.toString().startsWith("class"))
36
- return e === t;
37
- for (const r in e) {
38
- if (!t.hasOwnProperty(r))
39
- return !1;
40
- if (typeof e[r] == "object" && typeof t[r] == "object") {
41
- if (!i(e[r], t[r]))
42
- return !1;
43
- } else if (e[r] !== t[r])
44
- return !1;
45
- }
46
- return !0;
47
- }
48
- function p(e, t) {
49
- const r = {};
50
- for (const n in e)
51
- t.includes(n) && (r[n] = e[n]);
52
- return r;
53
- }
54
- function o(e, t) {
55
- const r = {};
56
- for (const n in e)
57
- t.includes(n) || (r[n] = e[n]);
58
- return r;
59
- }
60
- function l(e) {
61
- var t;
62
- return typeof e == "function" && ((t = Object.getOwnPropertyDescriptor(e, "prototype")) == null ? void 0 : t.writable) === !1;
63
- }
64
- function O(e, ...t) {
65
- t.forEach((r) => {
66
- Object.getOwnPropertyNames(r.prototype).forEach((n) => {
67
- Object.defineProperty(
68
- e.prototype,
69
- n,
70
- Object.getOwnPropertyDescriptor(r.prototype, n) || /* @__PURE__ */ Object.create(null)
71
- );
72
- });
73
- });
74
- }
75
- export {
76
- c as a,
77
- u as b,
78
- y as c,
79
- i as d,
80
- O as e,
81
- l as i,
82
- a as m,
83
- o,
84
- p
85
- };
@@ -1 +0,0 @@
1
- "use strict";var Z=(n,e)=>(e=Symbol[n])?e:Symbol.for("Symbol."+n),$=n=>{throw TypeError(n)};var K=(n,e,s)=>e.has(n)||$("Cannot "+s);var t=(n,e,s)=>(K(n,e,"read from private field"),s?s.call(n):e.get(n)),r=(n,e,s)=>e.has(n)?$("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,s),a=(n,e,s,i)=>(K(n,e,"write to private field"),i?i.call(n,s):e.set(n,s),s),W=(n,e,s)=>(K(n,e,"access private method"),s);var M=(n,e,s)=>new Promise((i,h)=>{var o=d=>{try{f(s.next(d))}catch(w){h(w)}},c=d=>{try{f(s.throw(d))}catch(w){h(w)}},f=d=>d.done?i(d.value):Promise.resolve(d.value).then(o,c);f((s=s.apply(n,e)).next())});var Y=(n,e,s)=>(e=n[Z("asyncIterator")])?e.call(n):(n=n[Z("iterator")](),e={},s=(i,h)=>(h=n[i])&&(e[i]=o=>new Promise((c,f,d)=>(o=h.call(n,o),d=o.done,Promise.resolve(o.value).then(w=>c({value:w,done:d}),f)))),s("next"),s("return"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const at=require("urlpattern-polyfill"),rt=require("../notifier/index.cjs"),tt=require("../browser-CpzFX2xg.cjs"),ht=require("../function-MthRj-GJ.cjs"),F=require("../url-C3dWnJQg.cjs"),ot=require("../object-CCiXnER2.cjs");var R,O,A,p,m,v,k,L,b,E,x,et;class ct{constructor(e,s){r(this,x);r(this,R);r(this,O);r(this,A);r(this,p);r(this,m);r(this,v);r(this,k);r(this,L,null);r(this,b,[]);r(this,E,[]);a(this,R,e),a(this,O,s),a(this,A,new URLPattern({pathname:t(this,R)})),a(this,p,null),a(this,m,null),a(this,v,!1),a(this,k,null),tt.isBrowser&&a(this,L,new MutationObserver(i=>{i[0].addedNodes.forEach(o=>{t(this,p)?t(this,E).push(o):t(this,b).push(o)})}))}get pattern(){return t(this,R)}get urlPattern(){return t(this,A)}get isActive(){return t(this,v)}get element(){return t(this,m)}get nest(){return t(this,k)}testPathname(e){return this.urlPattern.test({pathname:e})}render(e,s){return M(this,null,function*(){var i,h;if(t(this,L).observe(document.head,{childList:!0,subtree:!0}),t(this,p))t(this,b).forEach(o=>{document.head.appendChild(o)});else{const o=yield t(this,O).call(this);if(a(this,E,[...t(this,b)]),typeof o.default=="function"&&(a(this,p,o.default),ot.isESClass(o.default))){const c="e-"+((i=t(this,p))==null?void 0:i.name.toLowerCase());customElements.get(c)||customElements.define(c,o.default)}}if(yield W(this,x,et).call(this),t(this,p)){const o=t(this,A).exec({pathname:s}),c=(o==null?void 0:o.pathname.groups)||{},f=Object.fromEntries(new URLSearchParams(location.search)),d={pathnameParams:c,searchParams:f};a(this,m,new(t(this,p))(d)),e.appendChild(t(this,m)),a(this,k,t(this,m).querySelector("[data-nest]")||((h=t(this,m).shadowRoot)==null?void 0:h.querySelector("[data-nest]"))||t(this,m).shadowRoot||t(this,m)),a(this,v,!0)}t(this,L).disconnect()})}close(){var e;t(this,L).disconnect(),(e=t(this,m))==null||e.remove(),a(this,v,!1),t(this,E).forEach(s=>document.head.removeChild(s)),a(this,E,[])}getAnchorElements(){var s;let e=[];return t(this,m)&&(e=[...t(this,m).querySelectorAll("a")]),(s=t(this,m))!=null&&s.shadowRoot&&(e=[...e,...t(this,m).shadowRoot.querySelectorAll("a")]),e}}R=new WeakMap,O=new WeakMap,A=new WeakMap,p=new WeakMap,m=new WeakMap,v=new WeakMap,k=new WeakMap,L=new WeakMap,b=new WeakMap,E=new WeakMap,x=new WeakSet,et=function(){return M(this,null,function*(){const e=t(this,b).filter(c=>c instanceof HTMLElement?c.tagName==="STYLE"||c.tagName==="SCRIPT"||c.tagName==="LINK":!1);try{for(var s=Y(e),i,h,o;i=!(h=yield s.next()).done;i=!1){const c=h.value;yield new Promise(f=>{c.onload=()=>{f()}})}}catch(h){o=[h]}finally{try{i&&(h=s.return)&&(yield h.call(s))}finally{if(o)throw o[0]}}})};var S,u,P,U,q,j;class lt{constructor(e,s){r(this,S);r(this,u);r(this,P);r(this,U);r(this,q);r(this,j,e=>{e.preventDefault(),t(this,S).links.forEach(s=>{var i;t(this,P)===t(s,P)||(i=t(s,q))!=null&&i.includes(t(this,P))?t(s,u).classList.add("clicked"):t(s,u).classList.remove("clicked")}),t(this,S).navigate(t(this,P),t(this,U))});var o,c;a(this,S,e),a(this,u,s),a(this,P,t(this,u).getAttribute("href")||"/"),a(this,U,t(this,u).getAttribute("data-history-action")||"push"),t(this,u).addEventListener("click",t(this,j));const i=e.normalizePath(t(this,P)),h=e.normalizePath(location.pathname);a(this,q,(o=t(this,u).getAttribute("data-match-paths"))==null?void 0:o.split(",").map(f=>e.normalizePath(f.trim()).pathname)),t(this,u).hasAttribute("data-include")?h.pathname.includes(i.pathname)&&t(this,u).classList.add("current"):i.pathname===h.pathname||(c=t(this,q))!=null&&c.includes(h.pathname)?(t(this,u).classList.add("current"),t(this,u).classList.add("clicked")):t(this,u).classList.remove("clicked")}destroy(){t(this,u).removeEventListener("click",t(this,j)),t(this,u).classList.remove("current")}}S=new WeakMap,u=new WeakMap,P=new WeakMap,U=new WeakMap,q=new WeakMap,j=new WeakMap;globalThis.URLPattern=at.URLPattern;var N,C,g,z,T,y,H,B,I,_,st,D;class ut{constructor(e){r(this,_);r(this,N,null);r(this,C,null);r(this,g,[]);r(this,z,null);r(this,T,[]);r(this,y);r(this,H,null);r(this,B,new rt.Notifier);r(this,I,ht.debounce(()=>{const e=s=>s.split("/").length;a(this,g,t(this,g).sort((s,i)=>e(s.pattern)-e(i.pattern))),this.navigate(location.pathname)},0));r(this,D,e=>{e.state&&this.navigate(e.state,"none")});tt.isBrowser&&(e!=null&&e.base?a(this,C,F.normalizeBase(e.base)):a(this,C,"/"),a(this,N,(e==null?void 0:e.rootElement)||document.body),addEventListener("popstate",t(this,D)))}get currentPathname(){return t(this,H)}get candidatePathname(){return t(this,y)}get routes(){return t(this,g)}get links(){return t(this,T)}navigationEvent(e){return t(this,B).subscribe(e)}defineRoute(e,s){const i=new ct(e,s);t(this,g).push(i),t(this,I).call(this)}navigate(e,s="push"){return M(this,null,function*(){var Q,V;const i=this.normalizePath(e);let{pathname:h,hash:o,parameters:c,leaf:f}=i;if(t(this,y)===h||t(this,H)===h)return;a(this,y,h);const d=t(this,g).filter(l=>l.isActive),w=t(this,g).filter(l=>!d.includes(l)&&l.testPathname(f)),it=d.filter(l=>!l.testPathname(f)),G=d.filter(l=>l.testPathname(f));let J=!0;if(this.preprocessor)try{yield new Promise((l,nt)=>{var X;(X=this.preprocessor)==null||X.call(this,{path:i,resolve:l,reject:nt})})}catch(l){l?console.error(l):console.log("Route change canceled"),J=!1}if(J&&t(this,y)===h){a(this,z,G[G.length-1]),it.forEach(l=>{l.close()}),a(this,H,h),F.changeHistory(s,h,c,o);try{for(var ft=Y(w),pt,gt,Pt;pt=!(gt=yield ft.next()).done;pt=!1){const l=gt.value;yield l.render(((Q=t(this,z))==null?void 0:Q.nest)||t(this,N),h),a(this,z,l)}}catch(gt){Pt=[gt]}finally{try{pt&&(gt=ft.return)&&(yield gt.call(ft))}finally{if(Pt)throw Pt[0]}}W(this,_,st).call(this),(V=this.postprocessor)==null||V.call(this,{pathname:h}),t(this,B).notify({pathname:h})}})}normalizePath(e){return F.splitPath(e,t(this,C))}}N=new WeakMap,C=new WeakMap,g=new WeakMap,z=new WeakMap,T=new WeakMap,y=new WeakMap,H=new WeakMap,B=new WeakMap,I=new WeakMap,_=new WeakSet,st=function(){const e=t(this,g).filter(i=>i.isActive),s=Array.from(new Set([...t(this,N).querySelectorAll("a"),...e.map(i=>i.getAnchorElements()).flat()].filter(i=>{var h;return(h=i.getAttribute("href"))==null?void 0:h.startsWith("/")})));t(this,T).forEach(i=>{i.destroy()}),a(this,T,s.map(i=>new lt(this,i)))},D=new WeakMap;exports.Router=ut;
@@ -1,266 +0,0 @@
1
- var X = (a, e) => (e = Symbol[a]) ? e : Symbol.for("Symbol." + a), Z = (a) => {
2
- throw TypeError(a);
3
- };
4
- var W = (a, e, s) => e.has(a) || Z("Cannot " + s);
5
- var t = (a, e, s) => (W(a, e, "read from private field"), s ? s.call(a) : e.get(a)), h = (a, e, s) => e.has(a) ? Z("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(a) : e.set(a, s), n = (a, e, s, i) => (W(a, e, "write to private field"), i ? i.call(a, s) : e.set(a, s), s), Y = (a, e, s) => (W(a, e, "access private method"), s);
6
- var I = (a, e, s) => new Promise((i, r) => {
7
- var o = (m) => {
8
- try {
9
- f(s.next(m));
10
- } catch (w) {
11
- r(w);
12
- }
13
- }, c = (m) => {
14
- try {
15
- f(s.throw(m));
16
- } catch (w) {
17
- r(w);
18
- }
19
- }, f = (m) => m.done ? i(m.value) : Promise.resolve(m.value).then(o, c);
20
- f((s = s.apply(a, e)).next());
21
- });
22
- var $ = (a, e, s) => (e = a[X("asyncIterator")]) ? e.call(a) : (a = a[X("iterator")](), e = {}, s = (i, r) => (r = a[i]) && (e[i] = (o) => new Promise((c, f, m) => (o = r.call(a, o), m = o.done, Promise.resolve(o.value).then((w) => c({ value: w, done: m }), f)))), s("next"), s("return"), e);
23
- import { URLPattern as at } from "urlpattern-polyfill";
24
- import { Notifier as nt } from "../notifier/index.js";
25
- import { i as _ } from "../browser-0zX67oeU.js";
26
- import { d as ht } from "../function-C10DGppn.js";
27
- import { n as rt, c as ot, s as ct } from "../url-DMNfW7uN.js";
28
- import { i as lt } from "../object-D6MVWB4l.js";
29
- var y, U, A, p, d, L, k, v, E, R, M, tt;
30
- class ut {
31
- constructor(e, s) {
32
- h(this, M);
33
- h(this, y);
34
- h(this, U);
35
- h(this, A);
36
- h(this, p);
37
- h(this, d);
38
- h(this, L);
39
- h(this, k);
40
- h(this, v, null);
41
- h(this, E, []);
42
- h(this, R, []);
43
- n(this, y, e), n(this, U, s), n(this, A, new URLPattern({ pathname: t(this, y) })), n(this, p, null), n(this, d, null), n(this, L, !1), n(this, k, null), _ && n(this, v, new MutationObserver((i) => {
44
- i[0].addedNodes.forEach((o) => {
45
- t(this, p) ? t(this, R).push(o) : t(this, E).push(o);
46
- });
47
- }));
48
- }
49
- get pattern() {
50
- return t(this, y);
51
- }
52
- get urlPattern() {
53
- return t(this, A);
54
- }
55
- get isActive() {
56
- return t(this, L);
57
- }
58
- get element() {
59
- return t(this, d);
60
- }
61
- get nest() {
62
- return t(this, k);
63
- }
64
- testPathname(e) {
65
- return this.urlPattern.test({ pathname: e });
66
- }
67
- render(e, s) {
68
- return I(this, null, function* () {
69
- var i, r;
70
- if (t(this, v).observe(document.head, {
71
- childList: !0,
72
- subtree: !0
73
- }), t(this, p))
74
- t(this, E).forEach((o) => {
75
- document.head.appendChild(o);
76
- });
77
- else {
78
- const o = yield t(this, U).call(this);
79
- if (n(this, R, [...t(this, E)]), typeof o.default == "function" && (n(this, p, o.default), lt(o.default))) {
80
- const c = "e-" + ((i = t(this, p)) == null ? void 0 : i.name.toLowerCase());
81
- customElements.get(c) || customElements.define(c, o.default);
82
- }
83
- }
84
- if (yield Y(this, M, tt).call(this), t(this, p)) {
85
- const o = t(this, A).exec({ pathname: s }), c = (o == null ? void 0 : o.pathname.groups) || {}, f = Object.fromEntries(
86
- new URLSearchParams(location.search)
87
- ), m = {
88
- pathnameParams: c,
89
- searchParams: f
90
- };
91
- 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);
92
- }
93
- t(this, v).disconnect();
94
- });
95
- }
96
- close() {
97
- var e;
98
- 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, []);
99
- }
100
- getAnchorElements() {
101
- var s;
102
- let e = [];
103
- return t(this, d) && (e = [...t(this, d).querySelectorAll("a")]), (s = t(this, d)) != null && s.shadowRoot && (e = [
104
- ...e,
105
- ...t(this, d).shadowRoot.querySelectorAll("a")
106
- ]), e;
107
- }
108
- }
109
- y = new WeakMap(), U = new WeakMap(), A = new WeakMap(), p = new WeakMap(), d = new WeakMap(), L = new WeakMap(), k = new WeakMap(), v = new WeakMap(), E = new WeakMap(), R = new WeakMap(), M = new WeakSet(), tt = function() {
110
- return I(this, null, function* () {
111
- const e = t(this, E).filter((c) => c instanceof HTMLElement ? c.tagName === "STYLE" || c.tagName === "SCRIPT" || c.tagName === "LINK" : !1);
112
- try {
113
- for (var s = $(e), i, r, o; i = !(r = yield s.next()).done; i = !1) {
114
- const c = r.value;
115
- yield new Promise((f) => {
116
- c.onload = () => {
117
- f();
118
- };
119
- });
120
- }
121
- } catch (r) {
122
- o = [r];
123
- } finally {
124
- try {
125
- i && (r = s.return) && (yield r.call(s));
126
- } finally {
127
- if (o)
128
- throw o[0];
129
- }
130
- }
131
- });
132
- };
133
- var S, u, P, O, N, x;
134
- class mt {
135
- constructor(e, s) {
136
- h(this, S);
137
- h(this, u);
138
- h(this, P);
139
- h(this, O);
140
- h(this, N);
141
- h(this, x, (e) => {
142
- e.preventDefault(), t(this, S).links.forEach((s) => {
143
- var i;
144
- t(this, P) === t(s, P) || (i = t(s, N)) != null && i.includes(t(this, P)) ? t(s, u).classList.add("clicked") : t(s, u).classList.remove("clicked");
145
- }), t(this, S).navigate(t(this, P), t(this, O));
146
- });
147
- var o, c;
148
- n(this, S, e), n(this, u, s), n(this, P, t(this, u).getAttribute("href") || "/"), n(this, O, t(this, u).getAttribute(
149
- "data-history-action"
150
- ) || "push"), t(this, u).addEventListener("click", t(this, x));
151
- const i = e.normalizePath(t(this, P)), r = e.normalizePath(location.pathname);
152
- n(this, N, (o = t(this, u).getAttribute("data-match-paths")) == null ? void 0 : o.split(",").map((f) => e.normalizePath(f.trim()).pathname)), t(this, u).hasAttribute("data-include") ? r.pathname.includes(i.pathname) && t(this, u).classList.add("current") : i.pathname === r.pathname || (c = t(this, N)) != null && c.includes(r.pathname) ? (t(this, u).classList.add("current"), t(this, u).classList.add("clicked")) : t(this, u).classList.remove("clicked");
153
- }
154
- destroy() {
155
- t(this, u).removeEventListener("click", t(this, x)), t(this, u).classList.remove("current");
156
- }
157
- }
158
- S = new WeakMap(), u = new WeakMap(), P = new WeakMap(), O = new WeakMap(), N = new WeakMap(), x = new WeakMap();
159
- globalThis.URLPattern = at;
160
- var C, z, g, q, H, b, T, B, j, D, et, K;
161
- class vt {
162
- constructor(e) {
163
- h(this, D);
164
- h(this, C, null);
165
- h(this, z, null);
166
- h(this, g, []);
167
- h(this, q, null);
168
- h(this, H, []);
169
- h(this, b);
170
- h(this, T, null);
171
- h(this, B, new nt());
172
- h(this, j, ht(() => {
173
- const e = (s) => s.split("/").length;
174
- n(this, g, t(this, g).sort((s, i) => e(s.pattern) - e(i.pattern))), this.navigate(location.pathname);
175
- }, 0));
176
- h(this, K, (e) => {
177
- e.state && this.navigate(e.state, "none");
178
- });
179
- _ && (e != null && e.base ? n(this, z, rt(e.base)) : n(this, z, "/"), n(this, C, (e == null ? void 0 : e.rootElement) || document.body), addEventListener("popstate", t(this, K)));
180
- }
181
- get currentPathname() {
182
- return t(this, T);
183
- }
184
- get candidatePathname() {
185
- return t(this, b);
186
- }
187
- get routes() {
188
- return t(this, g);
189
- }
190
- get links() {
191
- return t(this, H);
192
- }
193
- navigationEvent(e) {
194
- return t(this, B).subscribe(e);
195
- }
196
- defineRoute(e, s) {
197
- const i = new ut(e, s);
198
- t(this, g).push(i), t(this, j).call(this);
199
- }
200
- navigate(e, s = "push") {
201
- return I(this, null, function* () {
202
- var J, Q;
203
- const i = this.normalizePath(e);
204
- let { pathname: r, hash: o, parameters: c, leaf: f } = i;
205
- if (t(this, b) === r || t(this, T) === r)
206
- return;
207
- n(this, b, r);
208
- const m = t(this, g).filter((l) => l.isActive), w = t(this, g).filter(
209
- (l) => !m.includes(l) && l.testPathname(f)
210
- ), st = m.filter((l) => !l.testPathname(f)), F = m.filter((l) => l.testPathname(f));
211
- let G = !0;
212
- if (this.preprocessor)
213
- try {
214
- yield new Promise((l, it) => {
215
- var V;
216
- (V = this.preprocessor) == null || V.call(this, { path: i, resolve: l, reject: it });
217
- });
218
- } catch (l) {
219
- l ? console.error(l) : console.log("Route change canceled"), G = !1;
220
- }
221
- if (G && t(this, b) === r) {
222
- n(this, q, F[F.length - 1]), st.forEach((l) => {
223
- l.close();
224
- }), n(this, T, r), ot(s, r, c, o);
225
- try {
226
- for (var bt = $(w), yt, At, kt; yt = !(At = yield bt.next()).done; yt = !1) {
227
- const l = At.value;
228
- yield l.render(((J = t(this, q)) == null ? void 0 : J.nest) || t(this, C), r), n(this, q, l);
229
- }
230
- } catch (At) {
231
- kt = [At];
232
- } finally {
233
- try {
234
- yt && (At = bt.return) && (yield At.call(bt));
235
- } finally {
236
- if (kt)
237
- throw kt[0];
238
- }
239
- }
240
- Y(this, D, et).call(this), (Q = this.postprocessor) == null || Q.call(this, { pathname: r }), t(this, B).notify({ pathname: r });
241
- }
242
- });
243
- }
244
- normalizePath(e) {
245
- return ct(e, t(this, z));
246
- }
247
- }
248
- C = new WeakMap(), z = new WeakMap(), g = new WeakMap(), q = new WeakMap(), H = new WeakMap(), b = new WeakMap(), T = new WeakMap(), B = new WeakMap(), j = new WeakMap(), D = new WeakSet(), et = function() {
249
- const e = t(this, g).filter((i) => i.isActive), s = Array.from(
250
- new Set(
251
- [
252
- ...t(this, C).querySelectorAll("a"),
253
- ...e.map((i) => i.getAnchorElements()).flat()
254
- ].filter((i) => {
255
- var r;
256
- return (r = i.getAttribute("href")) == null ? void 0 : r.startsWith("/");
257
- })
258
- )
259
- );
260
- t(this, H).forEach((i) => {
261
- i.destroy();
262
- }), n(this, H, s.map((i) => new mt(this, i)));
263
- }, K = new WeakMap();
264
- export {
265
- vt as Router
266
- };
@@ -1 +0,0 @@
1
- "use strict";function h(t,n=""){n=n.endsWith("/")?n.slice(0,-1):n,t=t.replace(n,""),t.startsWith("/")&&(t=t.slice(1));const c=t.split("#"),s=c[0].split("?"),i=s[0].startsWith("/")?s[0]:"/"+s[0],o=n+i,e=s==null?void 0:s[1],r=c==null?void 0:c[1];return{leaf:i,pathname:o,parameters:e,hash:r}}function p(t){return t.endsWith("/")||(t+="/"),t}function a(t,n,c,s){const i=c||location.search,o=s?s.startsWith("#")?s:"#"+s:"",e=i?i.startsWith("?")?i:"?"+i:"",r=`${n}${o}${e}`;t==="push"?history.pushState(r,"",r):t==="replace"&&history.replaceState(r,"",r)}exports.changeHistory=a;exports.normalizeBase=p;exports.splitPath=h;
@@ -1,22 +0,0 @@
1
- function h(t, n = "") {
2
- n = n.endsWith("/") ? n.slice(0, -1) : n, t = t.replace(n, ""), t.startsWith("/") && (t = t.slice(1));
3
- const i = t.split("#"), s = i[0].split("?"), c = s[0].startsWith("/") ? s[0] : "/" + s[0], r = n + c, e = s == null ? void 0 : s[1], o = i == null ? void 0 : i[1];
4
- return {
5
- leaf: c,
6
- pathname: r,
7
- parameters: e,
8
- hash: o
9
- };
10
- }
11
- function p(t) {
12
- return t.endsWith("/") || (t += "/"), t;
13
- }
14
- function a(t, n, i, s) {
15
- const c = i || location.search, r = s ? s.startsWith("#") ? s : "#" + s : "", e = c ? c.startsWith("?") ? c : "?" + c : "", o = `${n}${r}${e}`;
16
- t === "push" ? history.pushState(o, "", o) : t === "replace" && history.replaceState(o, "", o);
17
- }
18
- export {
19
- a as c,
20
- p as n,
21
- h as s
22
- };