aptechka 0.81.0 → 0.82.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 (121) hide show
  1. package/lib/{Animation-C4tLEBGM.js → Animation-DxtCzFP3.js} +2 -2
  2. package/lib/{Composed-BB1MtFiT.js → Composed-DtS09lSU.js} +2 -2
  3. package/lib/{Damped-DVG5nrYV.js → Damped-DMnIOXpC.js} +2 -2
  4. package/lib/{DerivedArray-D3scYQdp.js → DerivedArray-DG9iR0mf.js} +1 -1
  5. package/lib/{DragControls-Cm_88cLt.js → DragControls-DCC8iEOR.js} +4 -4
  6. package/lib/LocalLinks-Bua7BGRF.cjs +1 -0
  7. package/lib/LocalLinks-TQkTpAMx.js +62 -0
  8. package/lib/PageAnnouncerElement-C4k2kDJ5.cjs +1 -0
  9. package/lib/PageAnnouncerElement-sfh0_4vl.js +24 -0
  10. package/lib/PageScroll-C7QBpx0G.cjs +1 -0
  11. package/lib/PageScroll-cQ3B5-6N.js +62 -0
  12. package/lib/SourceElement-BQ7g2KWK.js +260 -0
  13. package/lib/SourceElement-TzgPNQOd.cjs +5 -0
  14. package/lib/{Store-BtVtCGLk.js → Store-CgQ3ReoB.js} +1 -1
  15. package/lib/{Tweened-C1lnK6n9.js → Tweened-lT68VACv.js} +2 -2
  16. package/lib/{Viewport-DbN_JWBM.js → Viewport-DGnJ31b4.js} +2 -2
  17. package/lib/accordion/index.js +1 -1
  18. package/lib/animation/index.js +3 -3
  19. package/lib/attribute/index.js +3 -3
  20. package/lib/billboard/index.js +2 -2
  21. package/lib/cache/Cache.d.ts +8 -0
  22. package/lib/cache/index.cjs +1 -0
  23. package/lib/cache/index.d.ts +1 -0
  24. package/lib/cache/index.js +37 -0
  25. package/lib/canvas/index.js +2 -2
  26. package/lib/controls/index.js +1 -1
  27. package/lib/css-property/index.js +3 -3
  28. package/lib/css-value-parser/index.js +1 -1
  29. package/lib/dev/index.js +2 -2
  30. package/lib/device/index.js +1 -1
  31. package/lib/{dom-fgxIeFxm.js → dom-BIeVMHfK.js} +2 -2
  32. package/lib/element-linked-store/index.js +2 -2
  33. package/lib/element-resizer/index.js +2 -2
  34. package/lib/en3/index.js +2 -2
  35. package/lib/history/History.d.ts +10 -0
  36. package/lib/history/index.cjs +1 -0
  37. package/lib/history/index.d.ts +1 -0
  38. package/lib/history/index.js +34 -0
  39. package/lib/iframe/index.cjs +1 -1
  40. package/lib/iframe/index.js +3 -3
  41. package/lib/image/index.cjs +1 -1
  42. package/lib/image/index.js +4 -4
  43. package/lib/{index-JqYHGoo6.js → index-LReFyN6i.js} +1 -1
  44. package/lib/intersector/index.js +2 -2
  45. package/lib/jsx/index.js +6 -6
  46. package/lib/ladder/index.js +2 -2
  47. package/lib/layout-box/index.js +2 -2
  48. package/lib/loading/index.js +1 -1
  49. package/lib/local-links/LocalLinks.d.ts +17 -0
  50. package/lib/local-links/index.cjs +1 -0
  51. package/lib/local-links/index.d.ts +1 -0
  52. package/lib/local-links/index.js +4 -0
  53. package/lib/masonry-layout/index.js +2 -2
  54. package/lib/media/index.js +2 -2
  55. package/lib/metadata-BcYZ5w3T.cjs +1 -0
  56. package/lib/metadata-jfowcCyz.js +12 -0
  57. package/lib/morph/index.cjs +1 -1
  58. package/lib/morph/index.js +141 -140
  59. package/lib/morph-B6sGhLCi.cjs +1 -0
  60. package/lib/morph-BQErz7qP.js +242 -0
  61. package/lib/need_redo_tweaker/index.cjs +1 -1
  62. package/lib/need_redo_tweaker/index.js +4 -4
  63. package/lib/{object-D6MVWB4l.js → object-CcMK4y_r.js} +12 -10
  64. package/lib/object-baN9pgbU.cjs +1 -0
  65. package/lib/page-announcer/PageAnnouncerElement.d.ts +10 -0
  66. package/lib/page-announcer/index.cjs +1 -0
  67. package/lib/page-announcer/index.d.ts +1 -0
  68. package/lib/page-announcer/index.js +4 -0
  69. package/lib/page-scroll/PageScroll.d.ts +23 -0
  70. package/lib/page-scroll/index.cjs +1 -0
  71. package/lib/page-scroll/index.d.ts +1 -0
  72. package/lib/page-scroll/index.js +4 -0
  73. package/lib/pixel-perfect/index.js +3 -3
  74. package/lib/pointer/index.js +4 -4
  75. package/lib/popover/index.cjs +1 -1
  76. package/lib/popover/index.js +3 -3
  77. package/lib/radio/index.js +1 -1
  78. package/lib/{render-CMQbWthg.js → render-CiA0mn5V.js} +3 -3
  79. package/lib/router/Route.d.ts +1 -2
  80. package/lib/router/Router.d.ts +18 -23
  81. package/lib/router/index.cjs +1 -1
  82. package/lib/router/index.d.ts +1 -1
  83. package/lib/router/index.js +183 -249
  84. package/lib/scroll/index.js +8 -8
  85. package/lib/scroll-entries/index.js +1 -1
  86. package/lib/{scroll-7JSxRKFK.js → scroll-jcbHDexr.js} +2 -2
  87. package/lib/scroll-kit/index.js +4 -4
  88. package/lib/sequence/index.cjs +1 -1
  89. package/lib/sequence/index.js +3 -3
  90. package/lib/size-element/index.js +1 -1
  91. package/lib/slicer/index.js +1 -1
  92. package/lib/source/SourceElement.d.ts +1 -1
  93. package/lib/source/index.cjs +1 -1
  94. package/lib/source/index.js +1 -1
  95. package/lib/spa/SPA.d.ts +29 -0
  96. package/lib/spa/index.cjs +1 -0
  97. package/lib/spa/index.d.ts +1 -0
  98. package/lib/spa/index.js +130 -0
  99. package/lib/store/index.js +3 -3
  100. package/lib/{stylesheet-JlRFfJIc.js → stylesheet-DbHOxtjw.js} +1 -1
  101. package/lib/ticker/index.js +2 -2
  102. package/lib/url-CPgw9bd5.cjs +1 -0
  103. package/lib/url-DAl-mgbC.js +97 -0
  104. package/lib/utils/index.cjs +1 -1
  105. package/lib/utils/index.d.ts +2 -0
  106. package/lib/utils/index.js +141 -120
  107. package/lib/utils/morph.d.ts +49 -0
  108. package/lib/utils/object.d.ts +1 -1
  109. package/lib/utils/url.d.ts +6 -0
  110. package/lib/video/index.cjs +1 -1
  111. package/lib/video/index.js +3 -3
  112. package/lib/window-resizer/index.js +1 -1
  113. package/lib/youtube/index.cjs +1 -1
  114. package/lib/youtube/index.js +3 -3
  115. package/package.json +49 -1
  116. package/lib/SourceElement-BBfaAgwe.cjs +0 -5
  117. package/lib/SourceElement-BiNNtaz9.js +0 -265
  118. package/lib/object-CCiXnER2.cjs +0 -1
  119. package/lib/router/Link.d.ts +0 -8
  120. package/lib/url-CoUSEREU.cjs +0 -1
  121. package/lib/url-IGj2LgDW.js +0 -66
@@ -1,41 +1,36 @@
1
- import { ChangeHistoryAction, SplitPathResult } from '../utils';
2
- import { Link } from './Link';
1
+ import { History } from '../history';
2
+ import { LocalLinksLinkOptions, LocalLinksOptions } from '../local-links';
3
3
  import { Route, RouteModule } from './Route';
4
4
  export interface RouterPreprocessorEntry {
5
- path: SplitPathResult;
5
+ url: URL;
6
6
  resolve: () => void;
7
7
  reject: () => void;
8
8
  }
9
9
  export type RouterPreprocessor = (entry: RouterPreprocessorEntry) => void;
10
10
  export interface RouterPostprocessorEntry {
11
- pathname: string;
11
+ url: URL;
12
12
  }
13
13
  export type RouterPostprocessor = (entry: RouterPostprocessorEntry) => void;
14
- export interface RouterAfterNavigationEntry {
15
- pathname: string;
14
+ export type RouterURLModifier = (url: URL) => URL;
15
+ export interface RouterNavigateOptions extends LocalLinksLinkOptions {
16
16
  }
17
- export type RouterAfterNavigationCallback = (entry: RouterAfterNavigationEntry) => void;
18
- export interface RouterNavigateOptions {
19
- historyAction?: ChangeHistoryAction;
20
- revalidate?: boolean;
21
- }
22
- export interface RouterParameters {
17
+ export interface RouterOptions extends Pick<LocalLinksOptions, 'base' | 'trailingSlash' | 'includeAnchor'> {
23
18
  rootElement?: HTMLElement;
24
- base?: string;
19
+ scrollSelector?: string;
20
+ beforeNavigation?: () => void | Promise<void>;
21
+ afterNavigation?: () => void | Promise<void>;
22
+ urlModifier?: RouterURLModifier;
23
+ preprocessor?: RouterPreprocessor;
24
+ postprocessor?: RouterPostprocessor;
25
+ viewTransition?: boolean;
25
26
  }
26
27
  export declare class Router {
27
28
  #private;
28
- preprocessor?: RouterPreprocessor;
29
- postprocessor?: RouterPostprocessor;
30
- constructor(parameters?: RouterParameters);
31
- get candidateURL(): SplitPathResult | null;
32
- get currentURL(): SplitPathResult;
29
+ constructor(options?: RouterOptions);
30
+ history(): History;
31
+ get scroll(): typeof scroll;
33
32
  get routes(): Route[];
34
- get links(): Link[];
35
33
  run(): void;
36
- destroy(): void;
37
- navigationEvent(callback: RouterAfterNavigationCallback): () => void;
38
34
  defineRoute(pattern: string, module: RouteModule): void;
39
- navigate(path: string, options?: RouterNavigateOptions): Promise<void>;
40
- normalizePath(path: string): SplitPathResult;
35
+ navigate(url: string | URL, options?: RouterNavigateOptions): Promise<void>;
41
36
  }
@@ -1 +1 @@
1
- "use strict";var Y=c=>{throw TypeError(c)};var F=(c,t,s)=>t.has(c)||Y("Cannot "+s);var e=(c,t,s)=>(F(c,t,"read from private field"),s?s.call(c):t.get(c)),a=(c,t,s)=>t.has(c)?Y("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(c):t.set(c,s),h=(c,t,s,i)=>(F(c,t,"write to private field"),i?i.call(c,s):t.set(c,s),s),n=(c,t,s)=>(F(c,t,"access private method"),s);var g=(c,t,s)=>new Promise((i,l)=>{var m=f=>{try{L(s.next(f))}catch(D){l(D)}},w=f=>{try{L(s.throw(f))}catch(D){l(D)}},L=f=>f.done?i(f.value):Promise.resolve(f.value).then(m,w);L((s=s.apply(c,t)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const pt=require("../notifier/index.cjs");require("construct-style-sheets-polyfill");require("../index-CKTweR3M.cjs");const x=require("../url-CoUSEREU.cjs"),ft=require("urlpattern-polyfill"),gt=require("../render-DBQUdpsp.cjs"),Rt=require("../dom-hTEdqeoj.cjs"),_=require("../object-CCiXnER2.cjs");var b,y,B,G,H;class yt{constructor(t,s){a(this,B);a(this,b);a(this,y);a(this,H,t=>{t.preventDefault();const s=e(this,B,G),i=e(this,y).getAttribute("data-history-action")||"push";e(this,b).navigate(s,{historyAction:i})});h(this,b,t),h(this,y,s),e(this,y).addEventListener("click",e(this,H))}checkCurrent(t){}destroy(){e(this,y).removeEventListener("click",e(this,H)),e(this,y).classList.remove("current")}}b=new WeakMap,y=new WeakMap,B=new WeakSet,G=function(){const t=new URL(e(this,y).href);return e(this,b).normalizePath(t.pathname+t.search+t.hash).path},H=new WeakMap;var C,T,S,d,u,k,M,P,A,N,o,J,Q,V,X,Z,$,tt,et,st,K;class vt{constructor(t,s){a(this,o);a(this,C);a(this,T);a(this,S);a(this,d,null);a(this,u,null);a(this,k,!1);a(this,M,null);a(this,P);a(this,A,[]);a(this,N,[]);h(this,C,t),h(this,T,s),h(this,S,new URLPattern({pathname:e(this,C)})),h(this,P,new MutationObserver(n(this,o,et).bind(this)))}get pattern(){return e(this,C)}get isActive(){return e(this,k)}get element(){return e(this,u)}get nest(){return e(this,M)}testPathname(t){return e(this,S).test({pathname:t})}render(t,s){return g(this,null,function*(){e(this,P).observe(document.head,{childList:!0,subtree:!0}),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()})}close(){n(this,o,$).call(this)}getAnchorElements(){const t=[];return e(this,u)&&(t.push(...e(this,u).querySelectorAll("a")),Rt.traverseShadowRoots(e(this,u),s=>{t.push(...s.shadowRoot.querySelectorAll("a"))})),t}}C=new WeakMap,T=new WeakMap,S=new WeakMap,d=new WeakMap,u=new WeakMap,k=new WeakMap,M=new WeakMap,P=new WeakMap,A=new WeakMap,N=new WeakMap,o=new WeakSet,J=function(){return g(this,null,function*(){const t=yield e(this,T).call(this);h(this,N,[...e(this,A)]),typeof t.default=="function"&&(h(this,d,t.default),yield n(this,o,Q).call(this))})},Q=function(){return g(this,null,function*(){if(e(this,d)&&_.isESClass(e(this,d))){const t=`e-${e(this,d).name.toLowerCase()}`;customElements.get(t)||customElements.define(t,e(this,d))}})},V=function(){e(this,A).forEach(t=>{document.head.appendChild(t.cloneNode(!0))})},X=function(t,s){return g(this,null,function*(){const l={urlPatternResult:e(this,S).exec({pathname:s})};_.isESClass(e(this,d))?(h(this,u,new(e(this,d))(l)),t.appendChild(e(this,u))):h(this,u,gt.render(t,e(this,d),l)),n(this,o,Z).call(this),h(this,k,!0)})},Z=function(){var t;e(this,u)&&h(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))},$=function(){var t;e(this,P).disconnect(),(t=e(this,u))==null||t.remove(),h(this,k,!1),n(this,o,tt).call(this)},tt=function(){e(this,N).forEach(t=>{t.parentNode===document.head&&document.head.removeChild(t)}),h(this,N,[])},et=function(t){t.forEach(s=>{s.addedNodes.forEach(i=>{e(this,d)?e(this,N).push(i):e(this,A).push(i)})})},st=function(){return g(this,null,function*(){const t=e(this,A).filter(n(this,o,K));yield Promise.all(t.map(s=>new Promise(i=>{n(this,o,K).call(this,s)?s.onload=()=>i():i()})))})},K=function(t){return t instanceof HTMLElement&&(t.tagName==="STYLE"||t.tagName==="SCRIPT"||t.tagName==="LINK")};globalThis.URLPattern=ft.URLPattern;var q,I,R,U,E,v,j,p,z,r,it,at,rt,ht,nt,ot,ct,lt,ut,W,dt,mt,O;class wt{constructor(t){a(this,r);a(this,q);a(this,I);a(this,R,[]);a(this,U,null);a(this,E,[]);a(this,v,null);a(this,j,null);a(this,p,null);a(this,z,new pt.Notifier);a(this,O,t=>{var s;(s=t.state)!=null&&s.path&&this.navigate(t.state.path,{historyAction:"none"})});var s;h(this,I,t!=null&&t.base?x.normalizeBase(t.base):"/"),h(this,q,(s=t==null?void 0:t.rootElement)!=null?s:document.body),h(this,p,this.normalizePath(location.pathname+location.search+location.hash)),n(this,r,it).call(this)}get candidateURL(){return e(this,v)}get currentURL(){return e(this,p)}get routes(){return e(this,R)}get links(){return e(this,E)}run(){n(this,r,lt).call(this),this.navigate(e(this,p).path,{revalidate:!0})}destroy(){removeEventListener("popstate",e(this,O)),n(this,r,W).call(this),e(this,R).forEach(t=>t.close()),e(this,z).close()}navigationEvent(t){return e(this,z).subscribe(t)}defineRoute(t,s){const i=new vt(t,s);e(this,R).push(i)}navigate(t,s){return g(this,null,function*(){var l,m,w;const i=this.normalizePath(t);if(!(s!=null&&s.revalidate)&&(((l=e(this,v))==null?void 0:l.pathname)===i.pathname||e(this,p).pathname===i.pathname)){((m=e(this,p))==null?void 0:m.parameters)!==i.parameters&&(h(this,j,e(this,p)),h(this,p,i),x.changeHistory({action:((w=e(this,p))==null?void 0:w.hash)!==i.hash?"replace":(s==null?void 0:s.historyAction)||"push",pathname:i.pathname,searchParameters:i.parameters,hash:i.hash})),e(this,E).forEach(L=>{L.checkCurrent(i)});return}h(this,v,i),(yield n(this,r,at).call(this,e(this,v)))&&i.path===e(this,v).path&&(yield n(this,r,rt).call(this,e(this,v),s))})}normalizePath(t){return x.splitPath(t,{base:e(this,I)})}}q=new WeakMap,I=new WeakMap,R=new WeakMap,U=new WeakMap,E=new WeakMap,v=new WeakMap,j=new WeakMap,p=new WeakMap,z=new WeakMap,r=new WeakSet,it=function(){addEventListener("popstate",e(this,O))},at=function(t){return g(this,null,function*(){if(!this.preprocessor)return!0;try{return yield new Promise((s,i)=>{var l;(l=this.preprocessor)==null||l.call(this,{path:t,resolve:s,reject:i})}),!0}catch(s){return console.error(s!=null?s:"Route change canceled"),!1}})},rt=function(i){return g(this,arguments,function*(t,s={}){var f;const{activeRoutes:l,newRoutes:m,oldRoutes:w,keepRoutes:L}=n(this,r,ht).call(this,t.leaf);h(this,U,(f=L[L.length-1])!=null?f:null),n(this,r,nt).call(this,w),h(this,p,t),x.changeHistory({action:s.historyAction||"push",pathname:t.pathname,searchParameters:t.parameters,hash:t.hash}),yield n(this,r,ot).call(this,m,t.leaf),n(this,r,ut).call(this),n(this,r,ct).call(this,t.pathname)})},ht=function(t){const s=e(this,R).filter(i=>i.isActive);return{activeRoutes:s,newRoutes:e(this,R).filter(i=>!s.includes(i)&&i.testPathname(t)),oldRoutes:s.filter(i=>!i.testPathname(t)),keepRoutes:s.filter(i=>i.testPathname(t))}},nt=function(t){t.forEach(s=>s.close())},ot=function(t,s){return g(this,null,function*(){var i,l;for(const m of t){const w=(l=(i=e(this,U))==null?void 0:i.nest)!=null?l:e(this,q);yield m.render(w,s),h(this,U,m)}})},ct=function(t){var s;(s=this.postprocessor)==null||s.call(this,{pathname:t}),e(this,z).notify({pathname:t})},lt=function(){e(this,R).sort((t,s)=>{const i=t.pattern.split("/").length,l=s.pattern.split("/").length;return i-l})},ut=function(){n(this,r,W).call(this),n(this,r,dt).call(this)},W=function(){e(this,E).forEach(t=>t.destroy()),h(this,E,[])},dt=function(){const t=e(this,R).filter(i=>i.isActive),s=n(this,r,mt).call(this,t);h(this,E,s.map(i=>new yt(this,i)))},mt=function(t){const s=Array.from(e(this,q).querySelectorAll("a")),i=t.flatMap(l=>l.getAnchorElements());return Array.from(new Set([...s,...i].filter(l=>{var m;return(m=l.getAttribute("href"))==null?void 0:m.startsWith("/")})))},O=new WeakMap;exports.Router=wt;
1
+ "use strict";var lt=Object.defineProperty,ut=Object.defineProperties;var ct=Object.getOwnPropertyDescriptors;var K=Object.getOwnPropertySymbols;var dt=Object.prototype.hasOwnProperty,ft=Object.prototype.propertyIsEnumerable;var Y=i=>{throw TypeError(i)};var W=(i,t,e)=>t in i?lt(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e,_=(i,t)=>{for(var e in t||(t={}))dt.call(t,e)&&W(i,e,t[e]);if(K)for(var e of K(t))ft.call(t,e)&&W(i,e,t[e]);return i},$=(i,t)=>ut(i,ct(t));var B=(i,t,e)=>t.has(i)||Y("Cannot "+e);var s=(i,t,e)=>(B(i,t,"read from private field"),e?e.call(i):t.get(i)),n=(i,t,e)=>t.has(i)?Y("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,e),h=(i,t,e,r)=>(B(i,t,"write to private field"),r?r.call(i,e):t.set(i,e),e),u=(i,t,e)=>(B(i,t,"access private method"),e);var G=(i,t,e,r)=>({set _(a){h(i,t,a,e)},get _(){return s(i,t,r)}});var p=(i,t,e)=>new Promise((r,a)=>{var c=m=>{try{w(e.next(m))}catch(L){a(L)}},H=m=>{try{w(e.throw(m))}catch(L){a(L)}},w=m=>m.done?r(m.value):Promise.resolve(m.value).then(c,H);w((e=e.apply(i,t)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const mt=require("../history/index.cjs"),gt=require("../LocalLinks-Bua7BGRF.cjs"),wt=require("../PageAnnouncerElement-C4k2kDJ5.cjs"),pt=require("../PageScroll-C7QBpx0G.cjs");require("construct-style-sheets-polyfill");require("../index-CKTweR3M.cjs");const J=require("../url-CPgw9bd5.cjs"),Rt=require("urlpattern-polyfill"),Pt=require("../render-DBQUdpsp.cjs"),vt=require("../object-baN9pgbU.cjs");var S,M,E,g,d,q,U,P,v,b,o,Q,X,Z,tt,et,st,it,rt,I;class bt{constructor(t,e){n(this,o);n(this,S);n(this,M);n(this,E);n(this,g,null);n(this,d,null);n(this,q,!1);n(this,U,null);n(this,P);n(this,v,[]);n(this,b,[]);h(this,S,t),h(this,M,e),h(this,E,new URLPattern({pathname:s(this,S)})),h(this,P,new MutationObserver(u(this,o,it).bind(this)))}get pattern(){return s(this,S)}get isActive(){return s(this,q)}get element(){return s(this,d)}get nest(){return s(this,U)}testPathname(t){return s(this,E).test({pathname:t})}render(t,e){return p(this,null,function*(){s(this,P).observe(document.head,{childList:!0,subtree:!0}),s(this,g)?u(this,o,X).call(this):yield u(this,o,Q).call(this),yield u(this,o,rt).call(this),s(this,g)&&(yield u(this,o,Z).call(this,t,e)),s(this,P).disconnect()})}close(){u(this,o,et).call(this)}}S=new WeakMap,M=new WeakMap,E=new WeakMap,g=new WeakMap,d=new WeakMap,q=new WeakMap,U=new WeakMap,P=new WeakMap,v=new WeakMap,b=new WeakMap,o=new WeakSet,Q=function(){return p(this,null,function*(){const t=yield s(this,M).call(this);h(this,b,[...s(this,v)]),typeof t.default=="function"&&h(this,g,t.default)})},X=function(){s(this,v).forEach(t=>{document.head.appendChild(t.cloneNode(!0))})},Z=function(t,e){return p(this,null,function*(){const a={urlPatternResult:s(this,E).exec({pathname:e.pathname})};vt.isESClass(s(this,g))?(h(this,d,new(s(this,g))(a)),t.appendChild(s(this,d))):h(this,d,Pt.render(t,s(this,g),a)),u(this,o,tt).call(this),h(this,q,!0)})},tt=function(){var t;s(this,d)&&h(this,U,s(this,d).querySelector("[data-nest]")||((t=s(this,d).shadowRoot)==null?void 0:t.querySelector("[data-nest]"))||s(this,d).shadowRoot||s(this,d))},et=function(){var t;s(this,P).disconnect(),(t=s(this,d))==null||t.remove(),h(this,q,!1),u(this,o,st).call(this)},st=function(){s(this,b).forEach(t=>{t.parentNode===document.head&&document.head.removeChild(t)}),h(this,b,[])},it=function(t){t.forEach(e=>{e.addedNodes.forEach(r=>{s(this,g)?s(this,b).push(r):s(this,v).push(r)})})},rt=function(){return p(this,null,function*(){const t=s(this,v).filter(u(this,o,I));yield Promise.all(t.map(e=>new Promise(r=>{u(this,o,I).call(this,e)?e.onload=()=>r():r()})))})},I=function(t){return t instanceof HTMLElement&&(t.tagName==="STYLE"||t.tagName==="SCRIPT"||t.tagName==="LINK")};globalThis.URLPattern=Rt.URLPattern;var l,y,T,N,k,A,R,C,f,at,nt,ht,z,ot;class yt{constructor(t){n(this,f);n(this,l,null);n(this,y,null);n(this,T,null);n(this,N,null);n(this,k,null);n(this,A,0);n(this,R,[]);n(this,C,null);h(this,l,$(_({},t),{rootElement:(t==null?void 0:t.rootElement)||document.body,base:J.normalizeBase(t==null?void 0:t.base)})),h(this,k,new wt.PageAnnouncerElement),h(this,y,new pt.PageScroll(s(this,l).scrollSelector)),s(this,y).update(),h(this,T,new gt.LocalLinks({base:s(this,l).base,trailingSlash:s(this,l).trailingSlash,includeAnchor:t==null?void 0:t.includeAnchor,onClick:(e,r)=>{try{this.navigate(e,r)}catch(a){window.location.assign(e)}}})),s(this,T).update(),h(this,N,new mt.History({onPop:e=>{this.navigate(e)}}))}history(){return s(this,N)}get scroll(){return scroll}get routes(){return s(this,R)}run(){u(this,f,ot).call(this),this.navigate(new URL(location.href),{revalidate:!0})}defineRoute(t,e){const r=new bt(t,e);s(this,R).push(r)}navigate(t,e){return p(this,null,function*(){var O,j,x,V,D,F;const r=s(this,N).isBack,a=++G(this,A)._;let c=J.normalizeURL(t,{base:s(this,l).base,trailingSlash:s(this,l).trailingSlash});if(s(this,l).urlModifier&&(c=s(this,l).urlModifier(c)),!(yield u(this,f,at).call(this,c))||s(this,A)!==a||(yield(j=(O=s(this,l)).beforeNavigation)==null?void 0:j.call(O),s(this,A)!==a))return;const{activeRoutes:H,newRoutes:w,oldRoutes:m,keepRoutes:L}=u(this,f,nt).call(this,c);h(this,C,(x=L[L.length-1])!=null?x:null),r||(s(this,N).push(c),((V=e==null?void 0:e.keepScrollPosition)==null||V)&&s(this,y).element.scrollTo({top:0,behavior:"instant"})),s(this,k).create(document,c.pathname),s(this,l).viewTransition&&document.startViewTransition?yield document.startViewTransition(()=>u(this,f,z).call(this,m,w,c)).finished:yield u(this,f,z).call(this,m,w,c),s(this,y).update(),s(this,T).update(),s(this,k).done(),yield(F=(D=s(this,l)).afterNavigation)==null?void 0:F.call(D)})}}l=new WeakMap,y=new WeakMap,T=new WeakMap,N=new WeakMap,k=new WeakMap,A=new WeakMap,R=new WeakMap,C=new WeakMap,f=new WeakSet,at=function(t){return p(this,null,function*(){if(!s(this,l).preprocessor)return!0;try{return yield new Promise((e,r)=>{var a,c;(c=(a=s(this,l)).preprocessor)==null||c.call(a,{url:t,resolve:e,reject:r})}),!0}catch(e){return console.error(e!=null?e:"Route change canceled"),!1}})},nt=function(t){let e=t.pathname.replace(s(this,l).base,"");e.startsWith("/")||(e=`/${e}`);const r=s(this,R).filter(a=>a.isActive);return{activeRoutes:r,newRoutes:s(this,R).filter(a=>!r.includes(a)&&a.testPathname(e)),oldRoutes:r.filter(a=>!a.testPathname(e)),keepRoutes:r.filter(a=>a.testPathname(e))}},ht=function(t){t.forEach(e=>e.close())},z=function(t,e,r){return p(this,null,function*(){var a,c;u(this,f,ht).call(this,t);for(const H of e){const w=(c=(a=s(this,C))==null?void 0:a.nest)!=null?c:s(this,l).rootElement;yield H.render(w,r),h(this,C,H)}})},ot=function(){s(this,R).sort((t,e)=>{const r=t.pattern.split("/").length,a=e.pattern.split("/").length;return r-a})};exports.Router=yt;
@@ -1,2 +1,2 @@
1
- export { Router, type RouterAfterNavigationCallback, type RouterParameters, type RouterPostprocessor, type RouterPreprocessor, type RouterPreprocessorEntry, } from './Router';
1
+ export { Router, type RouterPostprocessor, type RouterPreprocessor, type RouterPreprocessorEntry, } from './Router';
2
2
  export { type RouteModule, type RouteParameters } from './Route';
@@ -1,319 +1,253 @@
1
- var W = (c) => {
2
- throw TypeError(c);
1
+ var ot = Object.defineProperty, lt = Object.defineProperties;
2
+ var ut = Object.getOwnPropertyDescriptors;
3
+ var K = Object.getOwnPropertySymbols;
4
+ var ct = Object.prototype.hasOwnProperty, dt = Object.prototype.propertyIsEnumerable;
5
+ var Y = (i) => {
6
+ throw TypeError(i);
3
7
  };
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
+ var W = (i, t, e) => t in i ? ot(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e, j = (i, t) => {
9
+ for (var e in t || (t = {}))
10
+ ct.call(t, e) && W(i, e, t[e]);
11
+ if (K)
12
+ for (var e of K(t))
13
+ dt.call(t, e) && W(i, e, t[e]);
14
+ return i;
15
+ }, G = (i, t) => lt(i, ut(t));
16
+ var I = (i, t, e) => t.has(i) || Y("Cannot " + e);
17
+ var s = (i, t, e) => (I(i, t, "read from private field"), e ? e.call(i) : t.get(i)), n = (i, t, e) => t.has(i) ? Y("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(i) : t.set(i, e), h = (i, t, e, a) => (I(i, t, "write to private field"), a ? a.call(i, e) : t.set(i, e), e), u = (i, t, e) => (I(i, t, "access private method"), e);
18
+ var J = (i, t, e, a) => ({
19
+ set _(r) {
20
+ h(i, t, r, e);
21
+ },
22
+ get _() {
23
+ return s(i, t, a);
24
+ }
25
+ });
26
+ var g = (i, t, e) => new Promise((a, r) => {
27
+ var c = (f) => {
8
28
  try {
9
- y(s.next(f));
10
- } catch (D) {
11
- l(D);
29
+ w(e.next(f));
30
+ } catch (L) {
31
+ r(L);
12
32
  }
13
- }, w = (f) => {
33
+ }, U = (f) => {
14
34
  try {
15
- y(s.throw(f));
16
- } catch (D) {
17
- l(D);
35
+ w(e.throw(f));
36
+ } catch (L) {
37
+ r(L);
18
38
  }
19
- }, y = (f) => f.done ? i(f.value) : Promise.resolve(f.value).then(m, w);
20
- y((s = s.apply(c, t)).next());
39
+ }, w = (f) => f.done ? a(f.value) : Promise.resolve(f.value).then(c, U);
40
+ w((e = e.apply(i, t)).next());
21
41
  });
22
- import { Notifier as pt } from "../notifier/index.js";
42
+ import { History as mt } from "../history/index.js";
43
+ import { L as ft } from "../LocalLinks-TQkTpAMx.js";
44
+ import { P as pt } from "../PageAnnouncerElement-sfh0_4vl.js";
45
+ import { P as wt } from "../PageScroll-cQ3B5-6N.js";
23
46
  import "construct-style-sheets-polyfill";
24
- import "../index-JqYHGoo6.js";
25
- import { n as ft, c as Y, s as Rt } from "../url-IGj2LgDW.js";
26
- import { URLPattern as gt } from "urlpattern-polyfill";
27
- import { r as vt } from "../render-CMQbWthg.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
43
- });
44
- });
45
- r(this, b, t), r(this, v, s), e(this, v).addEventListener("click", e(this, T));
46
- }
47
- checkCurrent(t) {
48
- }
49
- destroy() {
50
- e(this, v).removeEventListener("click", e(this, T)), e(this, v).classList.remove("current");
51
- }
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)
47
+ import "../index-LReFyN6i.js";
48
+ import { a as gt, n as Rt } from "../url-DAl-mgbC.js";
49
+ import { URLPattern as Pt } from "urlpattern-polyfill";
50
+ import { r as vt } from "../render-CiA0mn5V.js";
51
+ import { i as bt } from "../object-CcMK4y_r.js";
52
+ var E, M, S, p, d, T, B, P, v, b, o, Q, X, Z, _, tt, et, st, it, z;
53
+ class Nt {
54
+ constructor(t, e) {
55
+ n(this, o);
56
+ n(this, E);
57
+ n(this, M);
58
+ n(this, S);
59
+ n(this, p, null);
60
+ n(this, d, null);
61
+ n(this, T, !1);
62
+ n(this, B, null);
63
+ n(this, P);
64
+ n(this, v, []);
65
+ n(this, b, []);
66
+ h(this, E, t), h(this, M, e), h(this, S, new URLPattern({ pathname: s(this, E) })), h(this, P, new MutationObserver(
67
+ u(this, o, st).bind(this)
75
68
  ));
76
69
  }
77
70
  get pattern() {
78
- return e(this, k);
71
+ return s(this, E);
79
72
  }
80
73
  get isActive() {
81
- return e(this, U);
74
+ return s(this, T);
82
75
  }
83
76
  get element() {
84
- return e(this, u);
77
+ return s(this, d);
85
78
  }
86
79
  get nest() {
87
- return e(this, M);
80
+ return s(this, B);
88
81
  }
89
82
  testPathname(t) {
90
- return e(this, C).test({ pathname: t });
83
+ return s(this, S).test({ pathname: t });
91
84
  }
92
- render(t, s) {
93
- return R(this, null, function* () {
94
- e(this, P).observe(document.head, {
85
+ render(t, e) {
86
+ return g(this, null, function* () {
87
+ s(this, P).observe(document.head, {
95
88
  childList: !0,
96
89
  subtree: !0
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();
90
+ }), s(this, p) ? u(this, o, X).call(this) : yield u(this, o, Q).call(this), yield u(this, o, it).call(this), s(this, p) && (yield u(this, o, Z).call(this, t, e)), s(this, P).disconnect();
98
91
  });
99
92
  }
100
93
  close() {
101
- n(this, o, _).call(this);
102
- }
103
- getAnchorElements() {
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;
94
+ u(this, o, tt).call(this);
108
95
  }
109
96
  }
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
- );
123
- }
97
+ E = new WeakMap(), M = new WeakMap(), S = new WeakMap(), p = new WeakMap(), d = new WeakMap(), T = new WeakMap(), B = new WeakMap(), P = new WeakMap(), v = new WeakMap(), b = new WeakMap(), o = new WeakSet(), Q = function() {
98
+ return g(this, null, function* () {
99
+ const t = yield s(this, M).call(this);
100
+ h(this, b, [...s(this, v)]), typeof t.default == "function" && h(this, p, t.default);
124
101
  });
125
- }, V = function() {
126
- e(this, A).forEach((t) => {
102
+ }, X = function() {
103
+ s(this, v).forEach((t) => {
127
104
  document.head.appendChild(t.cloneNode(!0));
128
105
  });
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(
106
+ }, Z = function(t, e) {
107
+ return g(this, null, function* () {
108
+ const r = { urlPatternResult: s(this, S).exec({ pathname: e.pathname }) };
109
+ bt(s(this, p)) ? (h(this, d, new (s(this, p))(r)), t.appendChild(s(this, d))) : h(this, d, vt(
133
110
  t,
134
- e(this, d),
135
- l
136
- )), n(this, o, Z).call(this), r(this, U, !0);
111
+ s(this, p),
112
+ r
113
+ )), u(this, o, _).call(this), h(this, T, !0);
137
114
  });
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
115
  }, _ = function() {
142
116
  var t;
143
- e(this, P).disconnect(), (t = e(this, u)) == null || t.remove(), r(this, U, !1), n(this, o, tt).call(this);
117
+ s(this, d) && h(this, B, s(this, d).querySelector("[data-nest]") || ((t = s(this, d).shadowRoot) == null ? void 0 : t.querySelector("[data-nest]")) || s(this, d).shadowRoot || s(this, d));
144
118
  }, tt = function() {
145
- e(this, N).forEach((t) => {
119
+ var t;
120
+ s(this, P).disconnect(), (t = s(this, d)) == null || t.remove(), h(this, T, !1), u(this, o, et).call(this);
121
+ }, et = function() {
122
+ s(this, b).forEach((t) => {
146
123
  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);
124
+ }), h(this, b, []);
125
+ }, st = function(t) {
126
+ t.forEach((e) => {
127
+ e.addedNodes.forEach((a) => {
128
+ s(this, p) ? s(this, b).push(a) : s(this, v).push(a);
152
129
  });
153
130
  });
154
- }, st = function() {
155
- return R(this, null, function* () {
156
- const t = e(this, A).filter(n(this, o, F));
131
+ }, it = function() {
132
+ return g(this, null, function* () {
133
+ const t = s(this, v).filter(u(this, o, z));
157
134
  yield Promise.all(
158
135
  t.map(
159
- (s) => new Promise((i) => {
160
- n(this, o, F).call(this, s) ? s.onload = () => i() : i();
136
+ (e) => new Promise((a) => {
137
+ u(this, o, z).call(this, e) ? e.onload = () => a() : a();
161
138
  })
162
139
  )
163
140
  );
164
141
  });
165
- }, F = function(t) {
142
+ }, z = function(t) {
166
143
  return t instanceof HTMLElement && (t.tagName === "STYLE" || t.tagName === "SCRIPT" || t.tagName === "LINK");
167
144
  };
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 {
145
+ globalThis.URLPattern = Pt;
146
+ var l, N, k, y, C, H, R, A, m, at, rt, nt, O, ht;
147
+ class It {
171
148
  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) => {
183
- var s;
184
- (s = t.state) != null && s.path && this.navigate(t.state.path, {
185
- historyAction: "none"
186
- });
187
- });
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);
149
+ n(this, m);
150
+ n(this, l, null);
151
+ n(this, N, null);
152
+ n(this, k, null);
153
+ n(this, y, null);
154
+ n(this, C, null);
155
+ n(this, H, 0);
156
+ n(this, R, []);
157
+ n(this, A, null);
158
+ h(this, l, G(j({}, t), {
159
+ rootElement: (t == null ? void 0 : t.rootElement) || document.body,
160
+ base: gt(t == null ? void 0 : t.base)
161
+ })), h(this, C, new pt()), h(this, N, new wt(s(this, l).scrollSelector)), s(this, N).update(), h(this, k, new ft({
162
+ base: s(this, l).base,
163
+ trailingSlash: s(this, l).trailingSlash,
164
+ includeAnchor: t == null ? void 0 : t.includeAnchor,
165
+ onClick: (e, a) => {
166
+ try {
167
+ this.navigate(e, a);
168
+ } catch (r) {
169
+ window.location.assign(e);
170
+ }
171
+ }
172
+ })), s(this, k).update(), h(this, y, new mt({
173
+ onPop: (e) => {
174
+ this.navigate(e);
175
+ }
176
+ }));
192
177
  }
193
- get candidateURL() {
194
- return e(this, L);
178
+ history() {
179
+ return s(this, y);
195
180
  }
196
- get currentURL() {
197
- return e(this, p);
181
+ get scroll() {
182
+ return scroll;
198
183
  }
199
184
  get routes() {
200
- return e(this, g);
201
- }
202
- get links() {
203
- return e(this, E);
185
+ return s(this, R);
204
186
  }
205
187
  run() {
206
- n(this, h, lt).call(this), this.navigate(e(this, p).path, { revalidate: !0 });
207
- }
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();
210
- }
211
- navigationEvent(t) {
212
- return e(this, H).subscribe(t);
213
- }
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
- });
188
+ u(this, m, ht).call(this), this.navigate(new URL(location.href), { revalidate: !0 });
189
+ }
190
+ defineRoute(t, e) {
191
+ const a = new Nt(t, e);
192
+ s(this, R).push(a);
193
+ }
194
+ navigate(t, e) {
195
+ return g(this, null, function* () {
196
+ var q, x, V, $, D, F;
197
+ const a = s(this, y).isBack, r = ++J(this, H)._;
198
+ let c = Rt(t, {
199
+ base: s(this, l).base,
200
+ trailingSlash: s(this, l).trailingSlash
201
+ });
202
+ if (s(this, l).urlModifier && (c = s(this, l).urlModifier(c)), !(yield u(this, m, at).call(this, c)) || s(this, H) !== r || (yield (x = (q = s(this, l)).beforeNavigation) == null ? void 0 : x.call(q), s(this, H) !== r))
231
203
  return;
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));
204
+ const { activeRoutes: U, newRoutes: w, oldRoutes: f, keepRoutes: L } = u(this, m, rt).call(this, c);
205
+ h(this, A, (V = L[L.length - 1]) != null ? V : null), a || (s(this, y).push(c), (($ = e == null ? void 0 : e.keepScrollPosition) == null || $) && s(this, N).element.scrollTo({ top: 0, behavior: "instant" })), s(this, C).create(document, c.pathname), s(this, l).viewTransition && document.startViewTransition ? yield document.startViewTransition(() => u(this, m, O).call(this, f, w, c)).finished : yield u(this, m, O).call(this, f, w, c), s(this, N).update(), s(this, k).update(), s(this, C).done(), yield (F = (D = s(this, l)).afterNavigation) == null ? void 0 : F.call(D);
234
206
  });
235
207
  }
236
- normalizePath(t) {
237
- return Rt(t, { base: e(this, I) });
238
- }
239
208
  }
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;
209
+ l = new WeakMap(), N = new WeakMap(), k = new WeakMap(), y = new WeakMap(), C = new WeakMap(), H = new WeakMap(), R = new WeakMap(), A = new WeakMap(), m = new WeakSet(), at = function(t) {
210
+ return g(this, null, function* () {
211
+ if (!s(this, l).preprocessor)
212
+ return !0;
245
213
  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 });
214
+ return yield new Promise((e, a) => {
215
+ var r, c;
216
+ (c = (r = s(this, l)).preprocessor) == null || c.call(r, { url: t, resolve: e, reject: a });
249
217
  }), !0;
250
- } catch (s) {
251
- return console.error(s != null ? s : "Route change canceled"), !1;
218
+ } catch (e) {
219
+ return console.error(e != null ? e : "Route change canceled"), !1;
252
220
  }
253
221
  });
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
222
  }, rt = function(t) {
266
- const s = e(this, g).filter((i) => i.isActive);
223
+ let e = t.pathname.replace(s(this, l).base, "");
224
+ e.startsWith("/") || (e = `/${e}`);
225
+ const a = s(this, R).filter((r) => r.isActive);
267
226
  return {
268
- activeRoutes: s,
269
- newRoutes: e(this, g).filter(
270
- (i) => !s.includes(i) && i.testPathname(t)
227
+ activeRoutes: a,
228
+ newRoutes: s(this, R).filter(
229
+ (r) => !a.includes(r) && r.testPathname(e)
271
230
  ),
272
- oldRoutes: s.filter((i) => !i.testPathname(t)),
273
- keepRoutes: s.filter((i) => i.testPathname(t))
231
+ oldRoutes: a.filter((r) => !r.testPathname(e)),
232
+ keepRoutes: a.filter((r) => r.testPathname(e))
274
233
  };
275
234
  }, 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);
235
+ t.forEach((e) => e.close());
236
+ }, O = function(t, e, a) {
237
+ return g(this, null, function* () {
238
+ var r, c;
239
+ u(this, m, nt).call(this, t);
240
+ for (const U of e) {
241
+ const w = (c = (r = s(this, A)) == null ? void 0 : r.nest) != null ? c : s(this, l).rootElement;
242
+ yield U.render(w, a), h(this, A, U);
283
243
  }
284
244
  });
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;
245
+ }, ht = function() {
246
+ s(this, R).sort((t, e) => {
247
+ const a = t.pattern.split("/").length, r = e.pattern.split("/").length;
248
+ return a - r;
292
249
  });
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(
307
- new Set(
308
- [...s, ...i].filter(
309
- (l) => {
310
- var m;
311
- return (m = l.getAttribute("href")) == null ? void 0 : m.startsWith("/");
312
- }
313
- )
314
- )
315
- );
316
- }, x = new WeakMap();
250
+ };
317
251
  export {
318
- zt as Router
252
+ It as Router
319
253
  };