@kitbag/router 0.13.3 → 0.13.4
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/README.md +1 -1
- package/dist/kitbag-router.js +495 -479
- package/dist/kitbag-router.umd.cjs +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(P,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],f):(P=typeof globalThis<"u"?globalThis:P||self,f(P["@kitbag/router"]={},P.Vue))})(this,function(P,f){"use strict";var Tr=Object.defineProperty;var Mr=(P,f,_)=>f in P?Tr(P,f,{enumerable:!0,configurable:!0,writable:!0,value:_}):P[f]=_;var I=(P,f,_)=>Mr(P,typeof f!="symbol"?f+"":f,_);class _ extends Error{constructor(){super("Router not installed")}}function se(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function rn(e){return e.every(t=>Array.isArray(t))}function ce(e){return typeof e=="string"&&e.length>0}function he(e){return{value:ce(e)?e.replace(/^#*/,""):void 0}}function on(e,t){return he(`${e.value??""}${t.value??""}`)}class Je extends Error{constructor(t){super(`Child property on meta for ${t} conflicts with the parent meta.`)}}function an(e,t){return sn(e,t),{...e,...t}}function sn(e,t){const n=Object.keys(e).find(r=>r in t&&typeof t[r]!=typeof e[r]);if(n)throw new Je(n)}class Qe extends Error{constructor(t){super(`Invalid Param "${t}": Router does not support multiple params by the same name. All param names must be unique.`)}}function ee(e){return Array.isArray(e)?e:[e]}function Ge(e,t){return e.filter(n=>t===n).length}function te(...e){const t=e.flatMap(n=>Array.isArray(n)?n:Object.keys(n).map(cn));for(const n of t)if(Ge(t,n)>1)throw new Qe(n)}function cn(e){return e.startsWith("?")?e.slice(1):e}function un(e,t){return te(e.params,t.params),{value:`${e.value}${t.value}`,params:{...e.params,...t.params}}}function fn(e,t){return te(e.params,t.params),{value:[e.value,t.value].filter(ce).join("&"),params:{...e.params,...t.params}}}function ln(e,t){return te(e,t),{...e,...t}}function hn(e){return"host"in e&&!!e.host}function Ke(e){return"parent"in e&&!!e.parent}function xe(e){return"component"in e&&!!e.component}function Ue(e){return"components"in e&&!!e.components}function pn(e){return"state"in e&&!!e.state}function ze(e,t){return{...t,path:un(e.path,t.path),query:fn(e.query,t.query),meta:an(e.meta,t.meta),state:ln(e.state,t.state),hash:on(e.hash,t.hash),matches:[...e.matches,t.matched],host:e.host,depth:e.depth+1}}function Ce(){return typeof window<"u"&&typeof window.document<"u"}class ne extends Error{}const W="[",J="]";function dn(e){return e!==String&&e!==Boolean&&e!==Number&&e!==Date}function mn(e){return typeof e=="function"&&dn(e)}function pe(e){return typeof e=="object"&&"get"in e&&typeof e.get=="function"&&"set"in e&&typeof e.set=="function"}function gn(e){return pe(e)&&e.defaultValue!==void 0}function yn(e,t){return tt(e,t)}function Rn(e,t){return e[t]??String}const $={invalid:e=>{throw new ne(e)}},wn={get:e=>e,set:(e,{invalid:t})=>{if(typeof e!="string")throw t();return e}},Ye={get:(e,{invalid:t})=>{if(e==="true")return!0;if(e==="false")return!1;throw t()},set:(e,{invalid:t})=>{if(typeof e!="boolean")throw t();return e.toString()}},Xe={get:(e,{invalid:t})=>{const n=Number(e);if(isNaN(n))throw t();return n},set:(e,{invalid:t})=>{if(typeof e!="number")throw t();return e.toString()}},Ze={get:(e,{invalid:t})=>{const n=new Date(e);if(isNaN(n.getTime()))throw t();return n},set:(e,{invalid:t})=>{if(typeof e!="object"||!(e instanceof Date))throw t();return e.toISOString()}},et={get:(e,{invalid:t})=>{try{return JSON.parse(e)}catch{throw t()}},set:(e,{invalid:t})=>{try{return JSON.stringify(e)}catch{throw t()}}};function ue(e,t,n=!1){if(e===void 0||!ce(e)){if(gn(t))return t.defaultValue;if(n)return;throw new ne}if(t===String)return wn.get(e,$);if(t===Boolean)return Ye.get(e,$);if(t===Number)return Xe.get(e,$);if(t===Date)return Ze.get(e,$);if(t===JSON)return et.get(e,$);if(mn(t))return t(e,$);if(pe(t))return t.get(e,$);if(t instanceof RegExp){if(t.test(e))return e;throw new ne}return e}function ie(e,t,n=!1){if(e===void 0){if(n)return"";throw new ne}if(t===Boolean)return Ye.set(e,$);if(t===Number)return Xe.set(e,$);if(t===Date)return Ze.set(e,$);if(t===JSON)return et.set(e,$);if(pe(t))return t.set(e,$);try{return e.toString()}catch{throw new ne}}function tt(e,t){return pe(e)?{...e,defaultValue:t??e.defaultValue}:{get:n=>ue(n,e),set:n=>ie(n,e),defaultValue:t}}function Q(){return Q=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Q.apply(this,arguments)}var V;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(V||(V={}));var re=process.env.NODE_ENV!=="production"?function(e){return Object.freeze(e)}:function(e){return e};function Y(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}var de="beforeunload",vn="hashchange",nt="popstate";function rt(e){e===void 0&&(e={});var t=e,n=t.window,r=n===void 0?document.defaultView:n,o=r.history;function a(){var R=r.location,p=R.pathname,y=R.search,k=R.hash,A=o.state||{};return[A.idx,re({pathname:p,search:y,hash:k,state:A.usr||null,key:A.key||"default"})]}var s=null;function c(){if(s)d.call(s),s=null;else{var R=V.Pop,p=a(),y=p[0],k=p[1];if(d.length)if(y!=null){var A=l-y;A&&(s={action:R,location:k,retry:function(){C(A*-1)}},C(A))}else process.env.NODE_ENV!=="production"&&Y(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation.");else U(R)}}r.addEventListener(nt,c);var u=V.Pop,i=a(),l=i[0],h=i[1],g=oe(),d=oe();l==null&&(l=0,o.replaceState(Q({},o.state,{idx:l}),""));function b(R){return typeof R=="string"?R:X(R)}function w(R,p){return p===void 0&&(p=null),re(Q({pathname:h.pathname,hash:"",search:""},typeof R=="string"?fe(R):R,{state:p,key:ge()}))}function v(R,p){return[{usr:R.state,key:R.key,idx:p},b(R)]}function x(R,p,y){return!d.length||(d.call({action:R,location:p,retry:y}),!1)}function U(R){u=R;var p=a();l=p[0],h=p[1],g.call({action:u,location:h})}function m(R,p){var y=V.Push,k=w(R,p);function A(){m(R,p)}if(x(y,k,A)){var L=v(k,l+1),j=L[0],H=L[1];try{o.pushState(j,"",H)}catch{r.location.assign(H)}U(y)}}function S(R,p){var y=V.Replace,k=w(R,p);function A(){S(R,p)}if(x(y,k,A)){var L=v(k,l),j=L[0],H=L[1];o.replaceState(j,"",H),U(y)}}function C(R){o.go(R)}var B={get action(){return u},get location(){return h},createHref:b,push:m,replace:S,go:C,back:function(){C(-1)},forward:function(){C(1)},listen:function(p){return g.push(p)},block:function(p){var y=d.push(p);return d.length===1&&r.addEventListener(de,me),function(){y(),d.length||r.removeEventListener(de,me)}}};return B}function Pn(e){e===void 0&&(e={});var t=e,n=t.window,r=n===void 0?document.defaultView:n,o=r.history;function a(){var p=fe(r.location.hash.substr(1)),y=p.pathname,k=y===void 0?"/":y,A=p.search,L=A===void 0?"":A,j=p.hash,H=j===void 0?"":j,M=o.state||{};return[M.idx,re({pathname:k,search:L,hash:H,state:M.usr||null,key:M.key||"default"})]}var s=null;function c(){if(s)d.call(s),s=null;else{var p=V.Pop,y=a(),k=y[0],A=y[1];if(d.length)if(k!=null){var L=l-k;L&&(s={action:p,location:A,retry:function(){B(L*-1)}},B(L))}else process.env.NODE_ENV!=="production"&&Y(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation.");else m(p)}}r.addEventListener(nt,c),r.addEventListener(vn,function(){var p=a(),y=p[1];X(y)!==X(h)&&c()});var u=V.Pop,i=a(),l=i[0],h=i[1],g=oe(),d=oe();l==null&&(l=0,o.replaceState(Q({},o.state,{idx:l}),""));function b(){var p=document.querySelector("base"),y="";if(p&&p.getAttribute("href")){var k=r.location.href,A=k.indexOf("#");y=A===-1?k:k.slice(0,A)}return y}function w(p){return b()+"#"+(typeof p=="string"?p:X(p))}function v(p,y){return y===void 0&&(y=null),re(Q({pathname:h.pathname,hash:"",search:""},typeof p=="string"?fe(p):p,{state:y,key:ge()}))}function x(p,y){return[{usr:p.state,key:p.key,idx:y},w(p)]}function U(p,y,k){return!d.length||(d.call({action:p,location:y,retry:k}),!1)}function m(p){u=p;var y=a();l=y[0],h=y[1],g.call({action:u,location:h})}function S(p,y){var k=V.Push,A=v(p,y);function L(){S(p,y)}if(process.env.NODE_ENV!=="production"&&Y(A.pathname.charAt(0)==="/","Relative pathnames are not supported in hash history.push("+JSON.stringify(p)+")"),U(k,A,L)){var j=x(A,l+1),H=j[0],M=j[1];try{o.pushState(H,"",M)}catch{r.location.assign(M)}m(k)}}function C(p,y){var k=V.Replace,A=v(p,y);function L(){C(p,y)}if(process.env.NODE_ENV!=="production"&&Y(A.pathname.charAt(0)==="/","Relative pathnames are not supported in hash history.replace("+JSON.stringify(p)+")"),U(k,A,L)){var j=x(A,l),H=j[0],M=j[1];o.replaceState(H,"",M),m(k)}}function B(p){o.go(p)}var R={get action(){return u},get location(){return h},createHref:w,push:S,replace:C,go:B,back:function(){B(-1)},forward:function(){B(1)},listen:function(y){return g.push(y)},block:function(y){var k=d.push(y);return d.length===1&&r.addEventListener(de,me),function(){k(),d.length||r.removeEventListener(de,me)}}};return R}function ot(e){e===void 0&&(e={});var t=e,n=t.initialEntries,r=n===void 0?["/"]:n,o=t.initialIndex,a=r.map(function(m){var S=re(Q({pathname:"/",search:"",hash:"",state:null,key:ge()},typeof m=="string"?fe(m):m));return process.env.NODE_ENV!=="production"&&Y(S.pathname.charAt(0)==="/","Relative pathnames are not supported in createMemoryHistory({ initialEntries }) (invalid entry: "+JSON.stringify(m)+")"),S}),s=at(o??a.length-1,0,a.length-1),c=V.Pop,u=a[s],i=oe(),l=oe();function h(m){return typeof m=="string"?m:X(m)}function g(m,S){return S===void 0&&(S=null),re(Q({pathname:u.pathname,search:"",hash:""},typeof m=="string"?fe(m):m,{state:S,key:ge()}))}function d(m,S,C){return!l.length||(l.call({action:m,location:S,retry:C}),!1)}function b(m,S){c=m,u=S,i.call({action:c,location:u})}function w(m,S){var C=V.Push,B=g(m,S);function R(){w(m,S)}process.env.NODE_ENV!=="production"&&Y(u.pathname.charAt(0)==="/","Relative pathnames are not supported in memory history.push("+JSON.stringify(m)+")"),d(C,B,R)&&(s+=1,a.splice(s,a.length,B),b(C,B))}function v(m,S){var C=V.Replace,B=g(m,S);function R(){v(m,S)}process.env.NODE_ENV!=="production"&&Y(u.pathname.charAt(0)==="/","Relative pathnames are not supported in memory history.replace("+JSON.stringify(m)+")"),d(C,B,R)&&(a[s]=B,b(C,B))}function x(m){var S=at(s+m,0,a.length-1),C=V.Pop,B=a[S];function R(){x(m)}d(C,B,R)&&(s=S,b(C,B))}var U={get index(){return s},get action(){return c},get location(){return u},createHref:h,push:w,replace:v,go:x,back:function(){x(-1)},forward:function(){x(1)},listen:function(S){return i.push(S)},block:function(S){return l.push(S)}};return U}function at(e,t,n){return Math.min(Math.max(e,t),n)}function me(e){e.preventDefault(),e.returnValue=""}function oe(){var e=[];return{get length(){return e.length},push:function(n){return e.push(n),function(){e=e.filter(function(r){return r!==n})}},call:function(n){e.forEach(function(r){return r&&r(n)})}}}function ge(){return Math.random().toString(36).substr(2,8)}function X(e){var t=e.pathname,n=t===void 0?"/":t,r=e.search,o=r===void 0?"":r,a=e.hash,s=a===void 0?"":a;return o&&o!=="?"&&(n+=o.charAt(0)==="?"?o:"?"+o),s&&s!=="#"&&(n+=s.charAt(0)==="#"?s:"#"+s),n}function fe(e){var t={};if(e){var n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));var r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}class st extends Error{constructor(t,n){super(`useRoute called with incorrect route. Given ${t}, expected ${n}`)}}const ct=Symbol();function En(){const e=f.inject(ct);if(!e)throw new _;return e}const ut=Symbol();function ye(){const e=f.inject(ut);if(!e)throw new _;return e}const it=Symbol("isRouterRouteSymbol");function bn(e){return typeof e=="object"&&e!==null&&it in e}function Sn(e,t){function n(w,v,x){if(typeof w=="object"){const m={...e.params,...w};return t(e.name,m,v)}const U={...e.params,[w]:v};return t(e.name,U,x)}const r=(...w)=>{const v=new URLSearchParams(e.query.toString());v.set(...w),n({},{query:v})},o=(...w)=>{const v=new URLSearchParams(e.query.toString());v.append(...w),n({},{query:v})},a=(...w)=>{const v=new URLSearchParams(e.query.toString());v.delete(...w),n({},{query:v})},{id:s,matched:c,matches:u,name:i,hash:l}=f.toRefs(e),h=f.computed({get(){return new Proxy(e.params,{set(w,v,x){return n(v,x),!0}})},set(w){n(w)}}),g=f.computed({get(){return new Proxy(e.query,{get(w,v,x){switch(v){case"append":return o;case"set":return r;case"delete":return a;default:return Reflect.get(w,v,x)}}})},set(w){n({},{query:w})}}),d=f.computed({get(){return new Proxy(e.state,{set(w,v,x){return n({},{state:{...e.state,[v]:x}}),!0}})},set(w){n({},{state:w})}});return f.reactive({id:s,matched:c,matches:u,state:d,query:g,hash:l,params:h,name:i,update:n,[it]:!0})}const ft=Symbol();function kn(e,t){const n=f.reactive({...e}),r=s=>{Object.assign(n,{[ft]:!1,...s})},o=n,a=Sn(o,t);return{currentRoute:o,routerRoute:a,updateRoute:r}}function D(e){return!e.startsWith("http")?xn(e):An(e)}function An(e){const{protocol:t,host:n,pathname:r,search:o,searchParams:a,hash:s}=new URL(e,e);return{protocol:t,host:n,pathname:r,search:o,searchParams:a,hash:s}}function xn(e){const{pathname:t,search:n,searchParams:r,hash:o}=new URL(e,"https://localhost");return{pathname:t,search:n,searchParams:r,hash:o}}function Un(e){return t=>{const{host:n}=D(t);return!(n===void 0||n===e)}}function Cn({mode:e,listener:t}){const n=Bn(e),r=(u,i)=>{if(i!=null&&i.replace){n.replace(u,i.state);return}n.push(u,i==null?void 0:i.state)},o=()=>{const u=X(n.location);n.replace(u)};let a;return{...n,update:r,refresh:o,startListening:()=>{a==null||a(),a=n.listen(t)},stopListening:()=>{a==null||a()}}}function Bn(e="auto"){switch(e){case"auto":return Ce()?rt():ot();case"browser":return rt();case"memory":return ot();case"hash":return Pn();default:const t=e;throw new Error(`Switch is not exhaustive for mode: ${t}`)}}class Re{constructor(){I(this,"onBeforeRouteEnter",new Set);I(this,"onBeforeRouteUpdate",new Set);I(this,"onBeforeRouteLeave",new Set);I(this,"onAfterRouteEnter",new Set);I(this,"onAfterRouteUpdate",new Set);I(this,"onAfterRouteLeave",new Set)}}class lt extends Error{constructor(){super("Uncaught CallbackContextAbortError");I(this,"response");this.response={status:"ABORT"}}}class ae extends Error{constructor(n){super("Uncaught CallbackContextPushError");I(this,"response");this.response={status:"PUSH",to:n}}}class we extends Error{constructor(n){super("Uncaught CallbackContextRejectionError");I(this,"response");this.response={status:"REJECT",type:n}}}function Ln(e,t){const n=new Re;return e.matches.forEach((r,o)=>{r.onBeforeRouteEnter&&Be(e,t,o)&&ee(r.onBeforeRouteEnter).forEach(a=>n.onBeforeRouteEnter.add(a)),r.onBeforeRouteUpdate&&Ne(e,t,o)&&ee(r.onBeforeRouteUpdate).forEach(a=>n.onBeforeRouteUpdate.add(a))}),t.matches.forEach((r,o)=>{r.onBeforeRouteLeave&&Le(e,t,o)&&ee(r.onBeforeRouteLeave).forEach(a=>n.onBeforeRouteLeave.add(a))}),n}function Nn(e,t){const n=new Re;return e.matches.forEach((r,o)=>{r.onAfterRouteEnter&&Be(e,t,o)&&ee(r.onAfterRouteEnter).forEach(a=>n.onAfterRouteEnter.add(a)),r.onAfterRouteUpdate&&Ne(e,t,o)&&ee(r.onAfterRouteUpdate).forEach(a=>n.onAfterRouteUpdate.add(a))}),t.matches.forEach((r,o)=>{r.onAfterRouteLeave&&Le(e,t,o)&&ee(r.onAfterRouteLeave).forEach(a=>n.onAfterRouteLeave.add(a))}),n}function T(e){return typeof e!="string"?!1:/^(https?:\/\/|\/).*/g.test(e)}function ht(e){return T(e)?e:`/${e}`}function pt(){return{reject:o=>{throw new we(o)},push:(...o)=>{throw new ae(o)},replace:(o,a,s)=>{if(T(o)){const i=a??{};throw new ae([o,{...i,replace:!0}])}const c=a,u=s??{};throw new ae([o,c,{...u,replace:!0}])},abort:()=>{throw new lt}}}function jn(){const{reject:e,push:t,replace:n,abort:r}=pt();async function o({to:s,from:c,hooks:u}){const{global:i,component:l}=u,h=Ln(s,c),g=[...i.onBeforeRouteEnter,...h.onBeforeRouteEnter,...i.onBeforeRouteUpdate,...h.onBeforeRouteUpdate,...l.onBeforeRouteUpdate,...i.onBeforeRouteLeave,...h.onBeforeRouteLeave,...l.onBeforeRouteLeave];try{const d=g.map(b=>b(s,{from:c,reject:e,push:t,replace:n,abort:r}));await Promise.all(d)}catch(d){if(d instanceof ae||d instanceof we||d instanceof lt)return d.response;throw d}return{status:"SUCCESS"}}async function a({to:s,from:c,hooks:u}){const{global:i,component:l}=u,h=Nn(s,c),g=[...l.onAfterRouteLeave,...h.onAfterRouteLeave,...i.onAfterRouteLeave,...l.onAfterRouteUpdate,...h.onAfterRouteUpdate,...i.onAfterRouteUpdate,...l.onAfterRouteEnter,...h.onAfterRouteEnter,...i.onAfterRouteEnter];try{const d=g.map(b=>b(s,{from:c,reject:e,push:t,replace:n}));await Promise.all(d)}catch(d){if(d instanceof ae||d instanceof we)return d.response;throw d}return{status:"SUCCESS"}}return{runBeforeRouteHooks:o,runAfterRouteHooks:a}}const Be=(e,t,n)=>{var a;const r=e.matches,o=(t==null?void 0:t.matches)??[];return r.length<n||r[n].id!==((a=o[n])==null?void 0:a.id)},Le=(e,t,n)=>{var a;const r=e.matches,o=(t==null?void 0:t.matches)??[];return r.length<n||r[n].id!==((a=o[n])==null?void 0:a.id)},Ne=(e,t,n)=>{var r;return e.matches[n].id===((r=t==null?void 0:t.matches[n])==null?void 0:r.id)};function dt(e){switch(e){case"onBeforeRouteEnter":case"onAfterRouteEnter":return Be;case"onBeforeRouteUpdate":case"onAfterRouteUpdate":return Ne;case"onBeforeRouteLeave":case"onAfterRouteLeave":return Le;default:throw new Error(`Switch is not exhaustive for lifecycle: ${e}`)}}function Vn(){const e={global:new Re,component:new Re};function t({lifecycle:r,timing:o,depth:a,hook:s}){const c=dt(r),u=e[o][r],i=(l,h)=>{if(c(l,h.from,a))return s(l,h)};return u.add(i),()=>u.delete(i)}function n({lifecycle:r,timing:o,depth:a,hook:s}){const c=dt(r),u=e[o][r],i=(l,h)=>{if(c(l,h.from,a))return s(l,h)};return u.add(i),()=>u.delete(i)}return{...e,addBeforeRouteHook:t,addAfterRouteHook:n}}const mt=Symbol();function Hn(){const e=Vn();return{onBeforeRouteEnter:c=>e.addBeforeRouteHook({lifecycle:"onBeforeRouteEnter",hook:c,timing:"global",depth:0}),onBeforeRouteUpdate:c=>e.addBeforeRouteHook({lifecycle:"onBeforeRouteUpdate",hook:c,timing:"global",depth:0}),onBeforeRouteLeave:c=>e.addBeforeRouteHook({lifecycle:"onBeforeRouteLeave",hook:c,timing:"global",depth:0}),onAfterRouteEnter:c=>e.addAfterRouteHook({lifecycle:"onAfterRouteEnter",hook:c,timing:"global",depth:0}),onAfterRouteUpdate:c=>e.addAfterRouteHook({lifecycle:"onAfterRouteUpdate",hook:c,timing:"global",depth:0}),onAfterRouteLeave:c=>e.addAfterRouteHook({lifecycle:"onAfterRouteLeave",hook:c,timing:"global",depth:0}),hooks:e}}function $n(e){return f.defineComponent(()=>()=>f.h("h1",e),{name:e,props:[]})}function gt(e){const t=new URLSearchParams(e);return{get:(...n)=>t.get(...n),getAll:(...n)=>t.getAll(...n),set:(...n)=>{t.set(...n)},append:(...n)=>{t.append(...n)},delete:(...n)=>{t.delete(...n)},toString:(...n)=>t.toString(...n),forEach:(...n)=>{t.forEach(...n)},entries:(...n)=>t.entries(...n),keys:(...n)=>t.keys(...n),values:(...n)=>t.values(...n),has:(...n)=>t.has(...n)}}function yt(){let e=0;return()=>(++e).toString()}const je=yt();function On({rejections:e}){const t=a=>{const s={...e};return f.markRaw(s[a]??$n(a))},n=a=>{const s=f.markRaw(t(a)),c={id:je(),component:s,meta:{},state:{}};return{id:c.id,matched:c,matches:[c],name:a,query:gt(""),params:{},state:{},[ft]:!0}},r=a=>{if(!a){o.value=null;return}const s=t(a);o.value={type:a,component:s}},o=f.ref(null);return{setRejection:r,rejection:o,getRejectionRoute:n}}class qn extends Error{constructor(t){super(`Route not found: "${t}"`)}}function Ve(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function _n(e,t){const n=Array.from(e.matchAll(t));if(n.length===0)return[e];let r=0;const o=n.reduce((s,c)=>{const u=Ve(e.slice(r,c.index));u.length&&s.push(u);const[i]=c;return s.push(i),r=c.index+i.length,s},[]),a=e.slice(r);return a&&o.push(a),o}function Tn(e){const t=Rt(e.path.value);return new RegExp(`^${t}$`,"i")}function Mn(e){const t=new URLSearchParams(e.query.value);return Array.from(t.entries()).filter(([,n])=>!$e(n)).map(([n,r])=>{const o=Rt(r);return new RegExp(`${Ve(n)}=${o}(&|$)`,"i")})}function Rt(e){return _n(e,new RegExp(Dn,"g")).map(t=>t.startsWith(W)?wt(t):Ve(t)).join("")}function wt(e){return[In,Wn].reduce((t,n)=>n(t),e)}const Dn=`\\${W}\\??([\\w-_]+)\\${J}`,He=`\\${W}\\?([\\w-_]+)\\${J}`,vt=`\\${W}([\\w-_]+)\\${J}`;function In(e){return e.replace(new RegExp(He,"g"),".*")}function $e(e){return new RegExp(He,"g").test(e)}function Wn(e){return e.replace(new RegExp(vt,"g"),".+")}function ve(e){const[t]=Pe(e,new RegExp(He,"g")),[n]=Pe(e,new RegExp(vt,"g"));return t??n}function Pe(e,t){return Array.from(e.matchAll(t)).flatMap(([,...r])=>r.map(o=>ce(o)?o:""))}function Pt(e,t,n){const r=bt(t,n),[o]=Pe(e,r);return o}function Et(e,t){if(!t)return e;const{name:n,param:r,value:o}=t,a=bt(e,n);return Pe(e,a).reduce((c,u)=>u===void 0?c:c.replace(u,()=>ie(o,r,n.startsWith("?"))),e)}function bt(e,t){const n=[Fn,Jn,wt].reduce((r,o)=>o(r,t),e);return new RegExp(n,"g")}function Fn(e,t){if(!t.startsWith("?"))return e;const n=new RegExp(`\\${W}\\${t}\\${J}`,"g");return e.replace(n,"(.*)")}function Jn(e,t){if(t.startsWith("?"))return e;const n=new RegExp(`\\${W}${t}\\${J}`,"g");return e.replace(n,"(.+)")}function St({protocol:e,host:t,pathname:n,search:r,searchParams:o,hash:a}){const s=new URL("https://localhost");e&&(s.protocol=e),t&&(s.host=t),n&&(s.pathname=n),o?s.search=o.toString():r&&(s.search=r),a&&(s.hash=a);const c=s.toString().replace(/^https:\/\/localhost\/*/,"/");return ht(c)}function Qn(e,t){const n=new URLSearchParams(e),r=new URLSearchParams(t);for(const[o,a]of r.entries())n.append(o,a);return n}function Gn(e,t={}){const{params:n={},query:r}=t,o=Yn(e.query,n),a=Qn(o,r),s=zn(e.path,n),c=he(e.hash.value??t.hash).value,u=Kn(e.host,n),{protocol:i,host:l}=D(u);return St({protocol:i,host:l,pathname:s,searchParams:a,hash:c})}function Kn(e,t){const n=e.value&&!e.value.startsWith("http")?`https://${e.value}`:e.value;return Object.entries(e.params).reduce((r,[o,a])=>{const s=ve(`${W}${o}${J}`);return s?Et(r,{name:o,param:a,value:t[s]}):r},n)}function zn(e,t){return Object.entries(e.params).reduce((n,[r,o])=>{const a=ve(`${W}${r}${J}`);return a?Et(n,{name:r,param:o,value:t[a]}):n},e.value)}function Yn(e,t){const n=new URLSearchParams(e.value);if(!e.value)return n;for(const[r,o]of Array.from(n.entries())){const a=ve(o);if(!a)continue;const c=ie(t[a],e.params[a],$e(o)),u=t[a]===void 0&&c==="";$e(o)&&u?n.delete(r,o):n.set(r,c)}return n}function Xn(e){return(t,n,r)=>{if(T(t)){const u=n??{},{searchParams:i,...l}=D(t);return Object.entries(u.query??{}).forEach(([h,g])=>{i.append(h,g)}),St({...l,searchParams:i})}const o=n??{},a=r??{},s=e.find(u=>u.name===t);if(!s)throw new qn(String(t));return Gn(s,{params:o,query:a.query,hash:a.hash})}}class Zn extends Error{constructor(){super("initialUrl must be set if window.location is unavailable")}}function er(e){if(e)return e;if(Ce())return window.location.toString();throw new Zn}const tr=(e,t)=>{try{kt(e,t)}catch{return!1}return!0},kt=(e,t)=>{const{pathname:n,search:r}=D(t);return{...nr(e.path,n),...rr(e.query,r)}};function nr(e,t){const n={},r=decodeURIComponent(t);for(const[o,a]of Object.entries(e.params)){const s=o.startsWith("?"),c=s?o.slice(1):o,u=Pt(r,e.value,o),i=ue(u,a,s);n[c]=i}return n}function rr(e,t){const n={},r=new URLSearchParams(t);for(const[o,a]of Object.entries(e.params)){const s=o.startsWith("?"),c=s?o.slice(1):o,u=r.get(c)??void 0,i=ue(u,a,s);n[c]=i}return n}const or=e=>"name"in e.matched&&!!e.matched.name,ar=(e,t)=>{const{pathname:n}=D(t);return Tn(e).test(n)},sr=(e,t)=>{const{search:n}=D(t);return Mn(e).every(o=>o.test(n))},Oe=(e,t)=>{const{hash:n}=D(t),{value:r}=e.hash;return r===void 0||`#${r.toLowerCase()}`===n.toLowerCase()};function cr(e){const{searchParams:t,pathname:n}=D(e),r=-1,o=1;return(a,s)=>{const c=xt(a,t),u=At(a,n),i=xt(s,t),l=At(s,n);return a.depth>s.depth?r:a.depth<s.depth?o:c+u>i+l?r:c+u<i+l?o:Oe(a,e)?r:Oe(s,e)?o:0}}function At(e,t){const n=Object.keys(e.path.params).filter(o=>o.startsWith("?")).map(o=>o),r=n.filter(o=>Pt(t,e.path.value,o)===void 0);return n.length-r.length}function xt(e,t){const n=new URLSearchParams(e.query.value),r=Array.from(n.keys()),o=r.filter(a=>!t.has(a));return r.length-o.length}function Ut(e){return!!e&&typeof e=="object"}const Ee=!0;function ur(e,t,n){if(Ut(e)&&t in e){const r=e[t];if(typeof r=="string")return ue(r,n,Ee)}return ue(void 0,n,Ee)}function ir(e,t){const n={};for(const[r,o]of Object.entries(e)){const a=ur(t,r,o);n[r]=a}return n}function fr(e,t,n){if(Ut(e)&&t in e){const r=e[t];return ie(r,n,Ee)}return ie(void 0,n,Ee)}const Ct=(e,t)=>{const n={};for(const[r,o]of Object.entries(e)){const a=fr(t,r,o);n[r]=a}return n},lr=[or,ar,sr,Oe,tr];function qe(e,t,n){const r=cr(t),o=e.filter(u=>lr.every(i=>i(u,t))).sort(r);if(o.length===0)return;const[a]=o,{search:s,hash:c}=D(t);return{id:a.id,matched:a.matched,matches:a.matches,name:a.name,query:gt(s),params:kt(a,t),state:ir(a.state,n),hash:c}}function _e(e,t){const n=new RegExp(`\\${W}(\\??[\\w-_]+)\\${J}`,"g");return Array.from(e.matchAll(n)).reduce((o,[a,s])=>{const c=ve(a);if(!c)return o;const u=Rn(t,c);return te([c],o),o[s]=u,o},{})}function be(e,t){return{value:e,params:_e(e,t)}}function hr(e,t){return ce(t)?e.map(n=>{const r=`${t}${n.path.value}`;return{...n,path:be(r,n.path.params)}}):e}class pr extends Error{constructor(t){super(`Invalid Name "${t}": Router does not support multiple routes with the same name. All name names must be unique.`)}}function dr(e){const t=e.map(({name:n})=>n);for(const n of t)if(Ge(t,n)>1)throw new pr(n)}function mr(){const e=f.reactive(new Map),t=Ce()?s():null,n=c=>{e.set(c,!1),t==null||t.observe(c)},r=c=>{e.delete(c),t==null||t.unobserve(c)},o=()=>{t==null||t.disconnect()},a=c=>e.get(c)??!1;function s(){return new IntersectionObserver(c=>{c.forEach(u=>{e.set(u.target,u.isIntersecting)})})}return{observe:n,unobserve:r,disconnect:o,isElementVisible:a}}const Bt=Symbol("visibilityObserver");function gr(){const e=f.inject(Bt);if(!e)throw new _;return e}function yr(e,t){const n=rn(e)?e.flat():e,r=hr(n,t==null?void 0:t.base);dr(r);const o=yt(),a=kr(),s=mr(),c=Xn(r),u=Cn({mode:t==null?void 0:t.historyMode,listener:({location:E})=>{const N=X(E);U(N,{state:E.state,replace:!0})}}),{runBeforeRouteHooks:i,runAfterRouteHooks:l}=jn(),{hooks:h,onBeforeRouteEnter:g,onAfterRouteUpdate:d,onBeforeRouteLeave:b,onAfterRouteEnter:w,onBeforeRouteUpdate:v,onAfterRouteLeave:x}=Hn();async function U(E,N={}){const G=o();if(u.stopListening(),Fe(E)){u.update(E,N);return}const O=qe(r,E,N.state)??y("NotFound"),Ae={...A},K=await i({to:O,from:Ae,hooks:h});switch(K.status){case"ABORT":return;case"PUSH":u.update(E,N),await m(...K.to);return;case"REJECT":u.update(E,N),R(K.type);break;case"SUCCESS":u.update(E,N),R(null);break;default:throw new Error(`Switch is not exhaustive for before hook response status: ${JSON.stringify(K)}`)}const F=G;a.setProps(O).then(q=>{if(F===G)switch(q.status){case"SUCCESS":break;case"PUSH":m(...q.to);break;case"REJECT":R(q.type);break;default:const le=q;throw new Error(`Switch is not exhaustive for prop store response status: ${JSON.stringify(le)}`)}}),j(O);const z=await l({to:O,from:Ae,hooks:h});switch(z.status){case"PUSH":await m(...z.to);break;case"REJECT":R(z.type);break;case"SUCCESS":break;default:const q=z;throw new Error(`Switch is not exhaustive for after hook response status: ${JSON.stringify(q)}`)}u.startListening()}const m=(E,N,G)=>{if(T(E)){const q={...N},le=c(E,q);return U(le,q)}const O={...G},K=c(E,N??{},O),F=tn(E),z=Ct((F==null?void 0:F.state)??{},O.state);return U(K,{...O,state:z})},S=(E,N,G)=>{if(T(E)){const q={...N,replace:!0},le=c(E,q);return U(le,q)}const O={...G,replace:!0},K=c(E,N??{},O),F=tn(E),z=Ct((F==null?void 0:F.state)??{},O.state);return U(K,{...O,state:z})},C=E=>{R(E)},B=(E,N={})=>{if(!T(E)){const G=c(E,N);return qe(r,G)}if(!Fe(E))return qe(r,E)},{setRejection:R,rejection:p,getRejectionRoute:y}=On(t??{}),k=y("NotFound"),{currentRoute:A,routerRoute:L,updateRoute:j}=kn(k,m);u.startListening();const H=er(t==null?void 0:t.initialUrl),M=u.location.state,{host:Xt}=D(H),Fe=Un(Xt);let Zt=!1;async function en(){Zt||(await U(H,{replace:!0,state:M}),Zt=!0)}function tn(E){return r.find(N=>N.name===E)}function _r(E){E.component("RouterView",zt),E.component("RouterLink",Kt),E.provide(ct,p),E.provide(mt,h),E.provide(Tt,a),E.provide(Bt,s),E.provide(ut,nn),en()}const nn={route:L,resolve:c,push:m,replace:S,reject:C,find:B,refresh:u.refresh,forward:u.forward,back:u.back,go:u.go,install:_r,isExternal:Fe,onBeforeRouteEnter:g,onAfterRouteUpdate:d,onBeforeRouteLeave:b,onAfterRouteEnter:w,onBeforeRouteUpdate:v,onAfterRouteLeave:x,prefetch:t==null?void 0:t.prefetch,start:en};return nn}function Te(e,t){return{value:e,params:_e(e,t)}}function Lt(e,t){return{value:e,params:_e(e,t)}}function Rr(e){return se(e)&&typeof e.hash=="string"}function Nt(e){return e===void 0?he():Rr(e)?e:he(e)}function jt(e){return e===void 0?"":e}function wr(e){return se(e)&&typeof e.value=="string"}function Vt(e){return e===void 0?be("",{}):wr(e)?e:be(e,{})}function vr(e){return se(e)&&typeof e.value=="string"}function Ht(e){return e===void 0?Te("",{}):vr(e)?e:Te(e,{})}function Z(e){const t=je(),n=jt(e.name),r=Vt(e.path),o=Ht(e.query),a=Nt(e.hash),s=e.meta??{},c=pn(e)?e.state:{},u=f.markRaw({id:t,meta:{},state:{},...e}),i={id:t,matched:u,matches:[u],name:n,path:r,query:o,hash:a,meta:s,state:c,depth:1,host:Lt("",{}),prefetch:e.prefetch},l=Ke(e)?ze(e.parent,i):i;return te(l.path.params,l.query.params),l}const Se={template:"<div>This is component</div>"},Me=Z({name:"parentA",path:"/parentA/[paramA]"}),$t=Z({parent:Me,name:"parentA.childA",path:"/[?paramB]"}),Pr=Z({parent:Me,name:"parentA.childB",path:"/[paramD]",component:Se}),Er=Z({parent:$t,name:"parentA.childA.grandChildA",path:"/[paramC]",component:Se});Z({name:"parentB",path:"/parentB",component:Se}),Z({name:"parentC",path:"/",component:Se});const br="lazy",Sr={components:!0,props:!1};function ke(e){return["eager","lazy"].includes(e)}function Ot({routerPrefetch:e,routePrefetch:t,linkPrefetch:n},r){const o=De(n,r),a=De(t,r),s=De(e,r),c=[o,a,s,Sr[r],br].reduce((u,i)=>ke(u)?u:u===!0&&ke(i)?i:u===!0&&!ke(i)?u:u===void 0?i:u,void 0);return ke(c)?c:!1}function De(e,t){return se(e)?e[t]:e}function qt(e){return typeof e=="object"&&e!==null&&"then"in e}function _t(e){try{const t=e();return qt(t)?t.catch(n=>n):t}catch(t){return t}}const Tt=Symbol();function kr(){const e=f.reactive(new Map),{push:t,replace:n,reject:r}=pt(),o=(h,g,d)=>g.matches.filter(b=>Ot({...d,routePrefetch:b.prefetch},"props")===h).flatMap(b=>i(b)).reduce((b,{id:w,name:v,props:x})=>{if(!x)return b;const U=u(w,v,g),m=_t(()=>x(g,{push:t,replace:n,reject:r}));return b[U]=m,b},{}),a=h=>{Object.entries(h).forEach(([g,d])=>{e.set(g,d)})},s=async h=>{const g=h.matches.flatMap(i),d=[],b=[];for(const{id:w,name:v,props:x}of g){if(!x)continue;const U=u(w,v,h);if(d.push(U),!e.has(U)){const m=_t(()=>x(h,{push:t,replace:n,reject:r}));e.set(U,m)}b.push((async()=>{const m=await e.get(U);if(m instanceof Error)throw m})())}l(d);try{return await Promise.all(b),{status:"SUCCESS"}}catch(w){if(w instanceof ae||w instanceof we)return w.response;throw w}},c=(h,g,d)=>{const b=u(h,g,d);return e.get(b)};function u(h,g,d){return[h,g,d.id,JSON.stringify(d.params)].join("-")}function i(h){return Ue(h)?Object.entries(h.props??{}).map(([g,d])=>({id:h.id,name:g,props:d})):xe(h)?[{id:h.id,name:"default",props:h.props}]:[]}function l(h){for(const g in e.keys())h.includes(g)||e.delete(g)}return{getPrefetchProps:o,setPrefetchProps:a,getProps:c,setProps:s}}function Mt(){const e=f.inject(Tt);if(!e)throw new _;return e}const Ar=f.defineAsyncComponent(()=>new Promise(e=>{e({default:{template:"foo"}})}));function Dt(e){return e.name===Ar.name&&"setup"in e}function xr(e){const t=new Map,n=f.ref(),{getPrefetchProps:r,setPrefetchProps:o}=Mt(),{observe:a,unobserve:s,isElementVisible:c}=gr(),u=()=>{const l=Array.from(t.values()).reduce((h,g)=>(Object.assign(h,g),h),{});o(l)};f.onMounted(()=>{if(!n.value){console.warn("The usePrefetching composition will not work correctly if the element ref is not bound.");return}a(n.value)}),f.onBeforeUnmount(()=>{n.value&&s(n.value)}),f.watch(()=>f.toValue(e),({route:l,...h})=>{t.clear(),l&&i("eager",l,h)},{immediate:!0}),f.watch(()=>!!(n.value&&c(n.value)),l=>{const{route:h,...g}=f.toValue(e);!h||!l||i("lazy",h,g)},{immediate:!0});function i(l,h,g){Ur(l,h,g),t.has(l)||t.set(l,r(l,h,g))}return{element:n,commit:u}}function Ur(e,t,n){t.matches.forEach(r=>{Ot({...n,routePrefetch:r.prefetch},"components")===e&&(xe(r)&&Dt(r.component)&&r.component.setup(),Ue(r)&&Object.values(r.components).forEach(a=>{Dt(a)&&a.setup()}))})}function It(e,t={},n={}){const r=ye(),o=f.toRef(e),a=f.computed(()=>T(o.value)?{}:f.toValue(t)),s=f.computed(()=>T(o.value)?f.toValue(t):f.toValue(n)),c=f.computed(()=>{if(T(o.value))return o.value;try{return r.resolve(o.value,a.value,s.value)}catch(v){throw v instanceof ne&&console.error(`Failed to resolve route "${o.value.toString()}" in RouterLink.`,v),v}}),u=f.computed(()=>r.find(c.value,s.value)),i=f.computed(()=>!!u.value&&r.route.matches.includes(u.value.matched)),l=f.computed(()=>!!u.value&&r.route.matched===u.value.matched),h=f.computed(()=>r.isExternal(c.value)),{element:g,commit:d}=xr(()=>({route:u.value,routerPrefetch:r.prefetch,linkPrefetch:s.value.prefetch})),b=v=>(d(),r.push(c.value,{...s.value,...v}));return{element:g,route:u,href:c,isMatch:i,isExactMatch:l,isExternal:h,push:b,replace:v=>b(v)}}function Wt(e,t,{exact:n}={}){return bn(e)?t===void 0?!0:n?e.matched.name===t:e.matches.map(r=>r.name).includes(t):!1}function Ft(e,t){const n=ye();function r(){if(!e)return;if(!Wt(n.route,e,t))throw new st(e,n.route.name)}return f.watch(n.route,r,{immediate:!0,deep:!0}),n.route}const Jt=Symbol();function Ie(){return f.inject(Jt,0)}function Qt(){const e=f.inject(mt);if(!e)throw new _;return e}function Gt(e){return t=>{const n=Ie(),o=Qt().addBeforeRouteHook({lifecycle:e,hook:t,depth:n,timing:"component"});return f.onUnmounted(o),o}}function We(e){return t=>{const n=Ie(),o=Qt().addAfterRouteHook({lifecycle:e,hook:t,depth:n,timing:"component"});return f.onUnmounted(o),o}}const Cr=Gt("onBeforeRouteUpdate"),Br=Gt("onBeforeRouteLeave"),Lr=We("onAfterRouteEnter"),Nr=We("onAfterRouteUpdate"),jr=We("onAfterRouteLeave"),Vr=["href"],Kt=f.defineComponent({__name:"routerLink",props:{to:{},prefetch:{type:[Boolean,String,Object],default:void 0},query:{},hash:{},replace:{type:Boolean},state:{}},setup(e){const t=e,n=ye(),r=f.computed(()=>T(t.to)?t.to:t.to(n.resolve)),o=f.computed(()=>{const{to:g,...d}=t;return d}),{element:a,isMatch:s,isExactMatch:c,isExternal:u,push:i}=It(r,o),l=f.computed(()=>({"router-link--match":s.value,"router-link--exact-match":c.value}));function h(g){g.preventDefault(),i()}return(g,d)=>(f.openBlock(),f.createElementBlock("a",{ref_key:"element",ref:a,href:r.value,class:f.normalizeClass(["router-link",l.value]),onClick:h},[f.renderSlot(g.$slots,"default",f.normalizeProps(f.guardReactiveProps({resolved:r.value,isMatch:f.unref(s),isExactMatch:f.unref(c),isExternal:f.unref(u)})))],10,Vr))}});function Hr(e,t){return f.defineComponent({name:"PropsWrapper",expose:[],setup(){const n=t();return()=>n instanceof Error?"":qt(n)?f.h($r(e,n)):f.h(e,n)}})}function $r(e,t){return f.defineComponent({name:"AsyncPropsWrapper",expose:[],setup(){const n=f.ref();return(async()=>n.value=await t)(),()=>n.value instanceof Error?"":n.value?f.h(e,n.value):""}})}const zt=f.defineComponent({__name:"routerView",props:{name:{default:"default"}},setup(e){const t=Ft(),n=En(),r=Ie(),{getProps:o}=Mt(),a=f.resolveComponent("RouterView",!0);f.provide(Jt,r+1);const s=f.computed(()=>{if(n.value)return n.value.component;const i=t.matches.at(r);if(!i)return null;const l=c(i),h=o(i.id,e.name,t);return l?h?Hr(l,()=>h):l:null});function c(i){return u(i)[e.name]}function u(i){return Ue(i)?i.components:xe(i)?{default:i.component}:typeof a=="string"?{}:{default:a}}return(i,l)=>s.value?f.renderSlot(i.$slots,"default",f.normalizeProps(f.mergeProps({key:0},{route:f.unref(t),component:s.value,rejection:f.unref(n)})),()=>[(f.openBlock(),f.createBlock(f.resolveDynamicComponent(s.value)))]):f.createCommentVNode("",!0)}});function Or(e){return se(e)&&typeof e.value=="string"}function Yt(e){return Or(e)?e:Lt(e,{})}function qr(e){const t=je(),n=jt(e.name),r=Vt(e.path),o=Ht(e.query),a=Nt(e.hash),s=e.meta??{},c=hn(e)?Yt(e.host):Yt(""),u=f.markRaw({id:t,meta:{},state:{},...e}),i={id:t,matched:u,matches:[u],name:n,host:c,path:r,query:o,hash:a,meta:s,depth:1,state:{}},l=Ke(e)?ze(e.parent,i):i;return te(l.path.params,l.query.params,l.host.params),l}P.DuplicateParamsError=Qe,P.MetaPropertyConflict=Je,P.RouterLink=Kt,P.RouterNotInstalledError=_,P.RouterView=zt,P.UseRouteInvalidError=st,P.asUrl=ht,P.createExternalRoute=qr,P.createParam=tt,P.createRoute=Z,P.createRouter=yr,P.isRoute=Wt,P.isUrl=T,P.onAfterRouteEnter=Lr,P.onAfterRouteLeave=Nr,P.onAfterRouteUpdate=jr,P.onBeforeRouteLeave=Cr,P.onBeforeRouteUpdate=Br,P.path=be,P.query=Te,P.useLink=It,P.useRoute=Ft,P.useRouter=ye,P.withDefault=yn,Object.defineProperty(P,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(P,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],i):(P=typeof globalThis<"u"?globalThis:P||self,i(P["@kitbag/router"]={},P.Vue))})(this,function(P,i){"use strict";var Mr=Object.defineProperty;var Dr=(P,i,_)=>i in P?Mr(P,i,{enumerable:!0,configurable:!0,writable:!0,value:_}):P[i]=_;var I=(P,i,_)=>Dr(P,typeof i!="symbol"?i+"":i,_);class _ extends Error{constructor(){super("Router not installed")}}function se(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function rn(e){return e.every(t=>Array.isArray(t))}function ce(e){return typeof e=="string"&&e.length>0}function he(e){return{value:ce(e)?e.replace(/^#*/,""):void 0}}function on(e,t){return he(`${e.value??""}${t.value??""}`)}class Qe extends Error{constructor(t){super(`Child property on meta for ${t} conflicts with the parent meta.`)}}function an(e,t){return sn(e,t),{...e,...t}}function sn(e,t){const n=Object.keys(e).find(r=>r in t&&typeof t[r]!=typeof e[r]);if(n)throw new Qe(n)}class Ge extends Error{constructor(t){super(`Invalid Param "${t}": Router does not support multiple params by the same name. All param names must be unique.`)}}function ee(e){return Array.isArray(e)?e:[e]}function Ke(e,t){return e.filter(n=>t===n).length}function te(...e){const t=e.flatMap(n=>Array.isArray(n)?n:Object.keys(n).map(cn));for(const n of t)if(Ke(t,n)>1)throw new Ge(n)}function cn(e){return e.startsWith("?")?e.slice(1):e}function un(e,t){return te(e.params,t.params),{value:`${e.value}${t.value}`,params:{...e.params,...t.params}}}function fn(e,t){return te(e.params,t.params),{value:[e.value,t.value].filter(ce).join("&"),params:{...e.params,...t.params}}}function ln(e,t){return te(e,t),{...e,...t}}function hn(e){return"host"in e&&!!e.host}function ze(e){return"parent"in e&&!!e.parent}function xe(e){return"component"in e&&!!e.component}function Ue(e){return"components"in e&&!!e.components}function pn(e){return"state"in e&&!!e.state}function Ye(e,t){return{...t,path:un(e.path,t.path),query:fn(e.query,t.query),meta:an(e.meta,t.meta),state:ln(e.state,t.state),hash:on(e.hash,t.hash),matches:[...e.matches,t.matched],host:e.host,depth:e.depth+1}}function Ce(){return typeof window<"u"&&typeof window.document<"u"}class ne extends Error{}const W="[",J="]";function dn(e){return e!==String&&e!==Boolean&&e!==Number&&e!==Date}function mn(e){return typeof e=="function"&&dn(e)}function pe(e){return typeof e=="object"&&"get"in e&&typeof e.get=="function"&&"set"in e&&typeof e.set=="function"}function gn(e){return pe(e)&&e.defaultValue!==void 0}function yn(e,t){return nt(e,t)}function Rn(e,t){return e[t]??String}const $={invalid:e=>{throw new ne(e)}},wn={get:e=>e,set:(e,{invalid:t})=>{if(typeof e!="string")throw t();return e}},Xe={get:(e,{invalid:t})=>{if(e==="true")return!0;if(e==="false")return!1;throw t()},set:(e,{invalid:t})=>{if(typeof e!="boolean")throw t();return e.toString()}},Ze={get:(e,{invalid:t})=>{const n=Number(e);if(isNaN(n))throw t();return n},set:(e,{invalid:t})=>{if(typeof e!="number")throw t();return e.toString()}},et={get:(e,{invalid:t})=>{const n=new Date(e);if(isNaN(n.getTime()))throw t();return n},set:(e,{invalid:t})=>{if(typeof e!="object"||!(e instanceof Date))throw t();return e.toISOString()}},tt={get:(e,{invalid:t})=>{try{return JSON.parse(e)}catch{throw t()}},set:(e,{invalid:t})=>{try{return JSON.stringify(e)}catch{throw t()}}};function ue(e,t,n=!1){if(e===void 0||!ce(e)){if(gn(t))return t.defaultValue;if(n)return;throw new ne}if(t===String)return wn.get(e,$);if(t===Boolean)return Xe.get(e,$);if(t===Number)return Ze.get(e,$);if(t===Date)return et.get(e,$);if(t===JSON)return tt.get(e,$);if(mn(t))return t(e,$);if(pe(t))return t.get(e,$);if(t instanceof RegExp){if(t.test(e))return e;throw new ne}return e}function ie(e,t,n=!1){if(e===void 0){if(n)return"";throw new ne}if(t===Boolean)return Xe.set(e,$);if(t===Number)return Ze.set(e,$);if(t===Date)return et.set(e,$);if(t===JSON)return tt.set(e,$);if(pe(t))return t.set(e,$);try{return e.toString()}catch{throw new ne}}function nt(e,t){return pe(e)?{...e,defaultValue:t??e.defaultValue}:{get:n=>ue(n,e),set:n=>ie(n,e),defaultValue:t}}function Q(){return Q=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Q.apply(this,arguments)}var V;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(V||(V={}));var re=process.env.NODE_ENV!=="production"?function(e){return Object.freeze(e)}:function(e){return e};function Y(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}var de="beforeunload",vn="hashchange",rt="popstate";function ot(e){e===void 0&&(e={});var t=e,n=t.window,r=n===void 0?document.defaultView:n,o=r.history;function a(){var R=r.location,p=R.pathname,y=R.search,k=R.hash,x=o.state||{};return[x.idx,re({pathname:p,search:y,hash:k,state:x.usr||null,key:x.key||"default"})]}var s=null;function c(){if(s)d.call(s),s=null;else{var R=V.Pop,p=a(),y=p[0],k=p[1];if(d.length)if(y!=null){var x=l-y;x&&(s={action:R,location:k,retry:function(){C(x*-1)}},C(x))}else process.env.NODE_ENV!=="production"&&Y(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation.");else U(R)}}r.addEventListener(rt,c);var u=V.Pop,f=a(),l=f[0],h=f[1],g=oe(),d=oe();l==null&&(l=0,o.replaceState(Q({},o.state,{idx:l}),""));function b(R){return typeof R=="string"?R:X(R)}function v(R,p){return p===void 0&&(p=null),re(Q({pathname:h.pathname,hash:"",search:""},typeof R=="string"?fe(R):R,{state:p,key:ge()}))}function w(R,p){return[{usr:R.state,key:R.key,idx:p},b(R)]}function A(R,p,y){return!d.length||(d.call({action:R,location:p,retry:y}),!1)}function U(R){u=R;var p=a();l=p[0],h=p[1],g.call({action:u,location:h})}function m(R,p){var y=V.Push,k=v(R,p);function x(){m(R,p)}if(A(y,k,x)){var L=w(k,l+1),j=L[0],H=L[1];try{o.pushState(j,"",H)}catch{r.location.assign(H)}U(y)}}function S(R,p){var y=V.Replace,k=v(R,p);function x(){S(R,p)}if(A(y,k,x)){var L=w(k,l),j=L[0],H=L[1];o.replaceState(j,"",H),U(y)}}function C(R){o.go(R)}var B={get action(){return u},get location(){return h},createHref:b,push:m,replace:S,go:C,back:function(){C(-1)},forward:function(){C(1)},listen:function(p){return g.push(p)},block:function(p){var y=d.push(p);return d.length===1&&r.addEventListener(de,me),function(){y(),d.length||r.removeEventListener(de,me)}}};return B}function Pn(e){e===void 0&&(e={});var t=e,n=t.window,r=n===void 0?document.defaultView:n,o=r.history;function a(){var p=fe(r.location.hash.substr(1)),y=p.pathname,k=y===void 0?"/":y,x=p.search,L=x===void 0?"":x,j=p.hash,H=j===void 0?"":j,M=o.state||{};return[M.idx,re({pathname:k,search:L,hash:H,state:M.usr||null,key:M.key||"default"})]}var s=null;function c(){if(s)d.call(s),s=null;else{var p=V.Pop,y=a(),k=y[0],x=y[1];if(d.length)if(k!=null){var L=l-k;L&&(s={action:p,location:x,retry:function(){B(L*-1)}},B(L))}else process.env.NODE_ENV!=="production"&&Y(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation.");else m(p)}}r.addEventListener(rt,c),r.addEventListener(vn,function(){var p=a(),y=p[1];X(y)!==X(h)&&c()});var u=V.Pop,f=a(),l=f[0],h=f[1],g=oe(),d=oe();l==null&&(l=0,o.replaceState(Q({},o.state,{idx:l}),""));function b(){var p=document.querySelector("base"),y="";if(p&&p.getAttribute("href")){var k=r.location.href,x=k.indexOf("#");y=x===-1?k:k.slice(0,x)}return y}function v(p){return b()+"#"+(typeof p=="string"?p:X(p))}function w(p,y){return y===void 0&&(y=null),re(Q({pathname:h.pathname,hash:"",search:""},typeof p=="string"?fe(p):p,{state:y,key:ge()}))}function A(p,y){return[{usr:p.state,key:p.key,idx:y},v(p)]}function U(p,y,k){return!d.length||(d.call({action:p,location:y,retry:k}),!1)}function m(p){u=p;var y=a();l=y[0],h=y[1],g.call({action:u,location:h})}function S(p,y){var k=V.Push,x=w(p,y);function L(){S(p,y)}if(process.env.NODE_ENV!=="production"&&Y(x.pathname.charAt(0)==="/","Relative pathnames are not supported in hash history.push("+JSON.stringify(p)+")"),U(k,x,L)){var j=A(x,l+1),H=j[0],M=j[1];try{o.pushState(H,"",M)}catch{r.location.assign(M)}m(k)}}function C(p,y){var k=V.Replace,x=w(p,y);function L(){C(p,y)}if(process.env.NODE_ENV!=="production"&&Y(x.pathname.charAt(0)==="/","Relative pathnames are not supported in hash history.replace("+JSON.stringify(p)+")"),U(k,x,L)){var j=A(x,l),H=j[0],M=j[1];o.replaceState(H,"",M),m(k)}}function B(p){o.go(p)}var R={get action(){return u},get location(){return h},createHref:v,push:S,replace:C,go:B,back:function(){B(-1)},forward:function(){B(1)},listen:function(y){return g.push(y)},block:function(y){var k=d.push(y);return d.length===1&&r.addEventListener(de,me),function(){k(),d.length||r.removeEventListener(de,me)}}};return R}function at(e){e===void 0&&(e={});var t=e,n=t.initialEntries,r=n===void 0?["/"]:n,o=t.initialIndex,a=r.map(function(m){var S=re(Q({pathname:"/",search:"",hash:"",state:null,key:ge()},typeof m=="string"?fe(m):m));return process.env.NODE_ENV!=="production"&&Y(S.pathname.charAt(0)==="/","Relative pathnames are not supported in createMemoryHistory({ initialEntries }) (invalid entry: "+JSON.stringify(m)+")"),S}),s=st(o??a.length-1,0,a.length-1),c=V.Pop,u=a[s],f=oe(),l=oe();function h(m){return typeof m=="string"?m:X(m)}function g(m,S){return S===void 0&&(S=null),re(Q({pathname:u.pathname,search:"",hash:""},typeof m=="string"?fe(m):m,{state:S,key:ge()}))}function d(m,S,C){return!l.length||(l.call({action:m,location:S,retry:C}),!1)}function b(m,S){c=m,u=S,f.call({action:c,location:u})}function v(m,S){var C=V.Push,B=g(m,S);function R(){v(m,S)}process.env.NODE_ENV!=="production"&&Y(u.pathname.charAt(0)==="/","Relative pathnames are not supported in memory history.push("+JSON.stringify(m)+")"),d(C,B,R)&&(s+=1,a.splice(s,a.length,B),b(C,B))}function w(m,S){var C=V.Replace,B=g(m,S);function R(){w(m,S)}process.env.NODE_ENV!=="production"&&Y(u.pathname.charAt(0)==="/","Relative pathnames are not supported in memory history.replace("+JSON.stringify(m)+")"),d(C,B,R)&&(a[s]=B,b(C,B))}function A(m){var S=st(s+m,0,a.length-1),C=V.Pop,B=a[S];function R(){A(m)}d(C,B,R)&&(s=S,b(C,B))}var U={get index(){return s},get action(){return c},get location(){return u},createHref:h,push:v,replace:w,go:A,back:function(){A(-1)},forward:function(){A(1)},listen:function(S){return f.push(S)},block:function(S){return l.push(S)}};return U}function st(e,t,n){return Math.min(Math.max(e,t),n)}function me(e){e.preventDefault(),e.returnValue=""}function oe(){var e=[];return{get length(){return e.length},push:function(n){return e.push(n),function(){e=e.filter(function(r){return r!==n})}},call:function(n){e.forEach(function(r){return r&&r(n)})}}}function ge(){return Math.random().toString(36).substr(2,8)}function X(e){var t=e.pathname,n=t===void 0?"/":t,r=e.search,o=r===void 0?"":r,a=e.hash,s=a===void 0?"":a;return o&&o!=="?"&&(n+=o.charAt(0)==="?"?o:"?"+o),s&&s!=="#"&&(n+=s.charAt(0)==="#"?s:"#"+s),n}function fe(e){var t={};if(e){var n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));var r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}class ct extends Error{constructor(t,n){super(`useRoute called with incorrect route. Given ${t}, expected ${n}`)}}const ut=Symbol();function En(){const e=i.inject(ut);if(!e)throw new _;return e}const it=Symbol();function ye(){const e=i.inject(it);if(!e)throw new _;return e}const ft=Symbol("isRouterRouteSymbol");function bn(e){return typeof e=="object"&&e!==null&&ft in e}function Sn(e,t){function n(v,w,A){if(typeof v=="object"){const m={...e.params,...v};return t(e.name,m,w)}const U={...e.params,[v]:w};return t(e.name,U,A)}const r=(...v)=>{const w=new URLSearchParams(e.query.toString());w.set(...v),n({},{query:w})},o=(...v)=>{const w=new URLSearchParams(e.query.toString());w.append(...v),n({},{query:w})},a=(...v)=>{const w=new URLSearchParams(e.query.toString());w.delete(...v),n({},{query:w})},{id:s,matched:c,matches:u,name:f,hash:l}=i.toRefs(e),h=i.computed({get(){return new Proxy(e.params,{set(v,w,A){return n(w,A),!0}})},set(v){n(v)}}),g=i.computed({get(){return new Proxy(e.query,{get(v,w,A){switch(w){case"append":return o;case"set":return r;case"delete":return a;default:return Reflect.get(v,w,A)}}})},set(v){n({},{query:v})}}),d=i.computed({get(){return new Proxy(e.state,{set(v,w,A){return n({},{state:{...e.state,[w]:A}}),!0}})},set(v){n({},{state:v})}});return i.reactive({id:s,matched:c,matches:u,state:d,query:g,hash:l,params:h,name:f,update:n,[ft]:!0})}const lt=Symbol();function kn(e,t){const n=i.reactive({...e}),r=s=>{Object.assign(n,{[lt]:!1,...s})},o=n,a=Sn(o,t);return{currentRoute:o,routerRoute:a,updateRoute:r}}function D(e){return!e.startsWith("http")?xn(e):An(e)}function An(e){const{protocol:t,host:n,pathname:r,search:o,searchParams:a,hash:s}=new URL(e,e);return{protocol:t,host:n,pathname:r,search:o,searchParams:a,hash:s}}function xn(e){const{pathname:t,search:n,searchParams:r,hash:o}=new URL(e,"https://localhost");return{pathname:t,search:n,searchParams:r,hash:o}}function Un(e){return t=>{const{host:n}=D(t);return!(n===void 0||n===e)}}function Cn({mode:e,listener:t}){const n=Bn(e),r=(u,f)=>{if(f!=null&&f.replace){n.replace(u,f.state);return}n.push(u,f==null?void 0:f.state)},o=()=>{const u=X(n.location);n.replace(u)};let a;return{...n,update:r,refresh:o,startListening:()=>{a==null||a(),a=n.listen(t)},stopListening:()=>{a==null||a()}}}function Bn(e="auto"){switch(e){case"auto":return Ce()?ot():at();case"browser":return ot();case"memory":return at();case"hash":return Pn();default:const t=e;throw new Error(`Switch is not exhaustive for mode: ${t}`)}}class Re{constructor(){I(this,"onBeforeRouteEnter",new Set);I(this,"onBeforeRouteUpdate",new Set);I(this,"onBeforeRouteLeave",new Set);I(this,"onAfterRouteEnter",new Set);I(this,"onAfterRouteUpdate",new Set);I(this,"onAfterRouteLeave",new Set)}}class ht extends Error{constructor(){super("Uncaught CallbackContextAbortError");I(this,"response");this.response={status:"ABORT"}}}class ae extends Error{constructor(n){super("Uncaught CallbackContextPushError");I(this,"response");this.response={status:"PUSH",to:n}}}class we extends Error{constructor(n){super("Uncaught CallbackContextRejectionError");I(this,"response");this.response={status:"REJECT",type:n}}}function Ln(e,t){const n=new Re;return e.matches.forEach((r,o)=>{r.onBeforeRouteEnter&&Be(e,t,o)&&ee(r.onBeforeRouteEnter).forEach(a=>n.onBeforeRouteEnter.add(a)),r.onBeforeRouteUpdate&&Ne(e,t,o)&&ee(r.onBeforeRouteUpdate).forEach(a=>n.onBeforeRouteUpdate.add(a))}),t.matches.forEach((r,o)=>{r.onBeforeRouteLeave&&Le(e,t,o)&&ee(r.onBeforeRouteLeave).forEach(a=>n.onBeforeRouteLeave.add(a))}),n}function Nn(e,t){const n=new Re;return e.matches.forEach((r,o)=>{r.onAfterRouteEnter&&Be(e,t,o)&&ee(r.onAfterRouteEnter).forEach(a=>n.onAfterRouteEnter.add(a)),r.onAfterRouteUpdate&&Ne(e,t,o)&&ee(r.onAfterRouteUpdate).forEach(a=>n.onAfterRouteUpdate.add(a))}),t.matches.forEach((r,o)=>{r.onAfterRouteLeave&&Le(e,t,o)&&ee(r.onAfterRouteLeave).forEach(a=>n.onAfterRouteLeave.add(a))}),n}function T(e){return typeof e!="string"?!1:/^(https?:\/\/|\/).*/g.test(e)}function pt(e){return T(e)?e:`/${e}`}function dt(){return{reject:o=>{throw new we(o)},push:(...o)=>{throw new ae(o)},replace:(o,a,s)=>{if(T(o)){const f=a??{};throw new ae([o,{...f,replace:!0}])}const c=a,u=s??{};throw new ae([o,c,{...u,replace:!0}])},abort:()=>{throw new ht}}}function jn(){const{reject:e,push:t,replace:n,abort:r}=dt();async function o({to:s,from:c,hooks:u}){const{global:f,component:l}=u,h=Ln(s,c),g=[...f.onBeforeRouteEnter,...h.onBeforeRouteEnter,...f.onBeforeRouteUpdate,...h.onBeforeRouteUpdate,...l.onBeforeRouteUpdate,...f.onBeforeRouteLeave,...h.onBeforeRouteLeave,...l.onBeforeRouteLeave];try{const d=g.map(b=>b(s,{from:c,reject:e,push:t,replace:n,abort:r}));await Promise.all(d)}catch(d){if(d instanceof ae||d instanceof we||d instanceof ht)return d.response;throw d}return{status:"SUCCESS"}}async function a({to:s,from:c,hooks:u}){const{global:f,component:l}=u,h=Nn(s,c),g=[...l.onAfterRouteLeave,...h.onAfterRouteLeave,...f.onAfterRouteLeave,...l.onAfterRouteUpdate,...h.onAfterRouteUpdate,...f.onAfterRouteUpdate,...l.onAfterRouteEnter,...h.onAfterRouteEnter,...f.onAfterRouteEnter];try{const d=g.map(b=>b(s,{from:c,reject:e,push:t,replace:n}));await Promise.all(d)}catch(d){if(d instanceof ae||d instanceof we)return d.response;throw d}return{status:"SUCCESS"}}return{runBeforeRouteHooks:o,runAfterRouteHooks:a}}const Be=(e,t,n)=>{var a;const r=e.matches,o=(t==null?void 0:t.matches)??[];return r.length<n||r[n].id!==((a=o[n])==null?void 0:a.id)},Le=(e,t,n)=>{var a;const r=e.matches,o=(t==null?void 0:t.matches)??[];return r.length<n||r[n].id!==((a=o[n])==null?void 0:a.id)},Ne=(e,t,n)=>{var r;return e.matches[n].id===((r=t==null?void 0:t.matches[n])==null?void 0:r.id)};function mt(e){switch(e){case"onBeforeRouteEnter":case"onAfterRouteEnter":return Be;case"onBeforeRouteUpdate":case"onAfterRouteUpdate":return Ne;case"onBeforeRouteLeave":case"onAfterRouteLeave":return Le;default:throw new Error(`Switch is not exhaustive for lifecycle: ${e}`)}}function Vn(){const e={global:new Re,component:new Re};function t({lifecycle:r,timing:o,depth:a,hook:s}){const c=mt(r),u=e[o][r],f=(l,h)=>{if(c(l,h.from,a))return s(l,h)};return u.add(f),()=>u.delete(f)}function n({lifecycle:r,timing:o,depth:a,hook:s}){const c=mt(r),u=e[o][r],f=(l,h)=>{if(c(l,h.from,a))return s(l,h)};return u.add(f),()=>u.delete(f)}return{...e,addBeforeRouteHook:t,addAfterRouteHook:n}}const gt=Symbol();function Hn(){const e=Vn();return{onBeforeRouteEnter:c=>e.addBeforeRouteHook({lifecycle:"onBeforeRouteEnter",hook:c,timing:"global",depth:0}),onBeforeRouteUpdate:c=>e.addBeforeRouteHook({lifecycle:"onBeforeRouteUpdate",hook:c,timing:"global",depth:0}),onBeforeRouteLeave:c=>e.addBeforeRouteHook({lifecycle:"onBeforeRouteLeave",hook:c,timing:"global",depth:0}),onAfterRouteEnter:c=>e.addAfterRouteHook({lifecycle:"onAfterRouteEnter",hook:c,timing:"global",depth:0}),onAfterRouteUpdate:c=>e.addAfterRouteHook({lifecycle:"onAfterRouteUpdate",hook:c,timing:"global",depth:0}),onAfterRouteLeave:c=>e.addAfterRouteHook({lifecycle:"onAfterRouteLeave",hook:c,timing:"global",depth:0}),hooks:e}}function $n(e){return i.defineComponent(()=>()=>i.h("h1",e),{name:e,props:[]})}function yt(e){const t=new URLSearchParams(e);return{get:(...n)=>t.get(...n),getAll:(...n)=>t.getAll(...n),set:(...n)=>{t.set(...n)},append:(...n)=>{t.append(...n)},delete:(...n)=>{t.delete(...n)},toString:(...n)=>t.toString(...n),forEach:(...n)=>{t.forEach(...n)},entries:(...n)=>t.entries(...n),keys:(...n)=>t.keys(...n),values:(...n)=>t.values(...n),has:(...n)=>t.has(...n)}}function Rt(){let e=0;return()=>(++e).toString()}const je=Rt();function On({rejections:e}){const t=a=>{const s={...e};return i.markRaw(s[a]??$n(a))},n=a=>{const s=i.markRaw(t(a)),c={id:je(),component:s,meta:{},state:{}};return{id:c.id,matched:c,matches:[c],name:a,query:yt(""),params:{},state:{},[lt]:!0}},r=a=>{if(!a){o.value=null;return}const s=t(a);o.value={type:a,component:s}},o=i.ref(null);return{setRejection:r,rejection:o,getRejectionRoute:n}}class qn extends Error{constructor(t){super(`Route not found: "${t}"`)}}function Ve(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function _n(e,t){const n=Array.from(e.matchAll(t));if(n.length===0)return[e];let r=0;const o=n.reduce((s,c)=>{const u=Ve(e.slice(r,c.index));u.length&&s.push(u);const[f]=c;return s.push(f),r=c.index+f.length,s},[]),a=e.slice(r);return a&&o.push(a),o}function Tn(e){const t=wt(e.path.value);return new RegExp(`^${t}$`,"i")}function Mn(e){const t=new URLSearchParams(e.query.value);return Array.from(t.entries()).filter(([,n])=>!$e(n)).map(([n,r])=>{const o=wt(r);return new RegExp(`${Ve(n)}=${o}(&|$)`,"i")})}function wt(e){return _n(e,new RegExp(Dn,"g")).map(t=>t.startsWith(W)?vt(t):Ve(t)).join("")}function vt(e){return[In,Wn].reduce((t,n)=>n(t),e)}const Dn=`\\${W}\\??([\\w-_]+)\\${J}`,He=`\\${W}\\?([\\w-_]+)\\${J}`,Pt=`\\${W}([\\w-_]+)\\${J}`;function In(e){return e.replace(new RegExp(He,"g"),".*")}function $e(e){return new RegExp(He,"g").test(e)}function Wn(e){return e.replace(new RegExp(Pt,"g"),".+")}function ve(e){const[t]=Pe(e,new RegExp(He,"g")),[n]=Pe(e,new RegExp(Pt,"g"));return t??n}function Pe(e,t){return Array.from(e.matchAll(t)).flatMap(([,...r])=>r.map(o=>ce(o)?o:""))}function Et(e,t,n){const r=St(t,n),[o]=Pe(e,r);return o}function bt(e,t){if(!t)return e;const{name:n,param:r,value:o}=t,a=St(e,n);return Pe(e,a).reduce((c,u)=>u===void 0?c:c.replace(u,()=>ie(o,r,n.startsWith("?"))),e)}function St(e,t){const n=[Fn,Jn,vt].reduce((r,o)=>o(r,t),e);return new RegExp(n,"g")}function Fn(e,t){if(!t.startsWith("?"))return e;const n=new RegExp(`\\${W}\\${t}\\${J}`,"g");return e.replace(n,"(.*)")}function Jn(e,t){if(t.startsWith("?"))return e;const n=new RegExp(`\\${W}${t}\\${J}`,"g");return e.replace(n,"(.+)")}function kt({protocol:e,host:t,pathname:n,search:r,searchParams:o,hash:a}){const s=new URL("https://localhost");e&&(s.protocol=e),t&&(s.host=t),n&&(s.pathname=n),o?s.search=o.toString():r&&(s.search=r),a&&(s.hash=a);const c=s.toString().replace(/^https:\/\/localhost\/*/,"/");return pt(c)}function Qn(e,t){const n=new URLSearchParams(e),r=new URLSearchParams(t);for(const[o,a]of r.entries())n.append(o,a);return n}function Gn(e,t={}){const{params:n={},query:r}=t,o=Yn(e.query,n),a=Qn(o,r),s=zn(e.path,n),c=he(e.hash.value??t.hash).value,u=Kn(e.host,n),{protocol:f,host:l}=D(u);return kt({protocol:f,host:l,pathname:s,searchParams:a,hash:c})}function Kn(e,t){const n=e.value&&!e.value.startsWith("http")?`https://${e.value}`:e.value;return Object.entries(e.params).reduce((r,[o,a])=>{const s=ve(`${W}${o}${J}`);return s?bt(r,{name:o,param:a,value:t[s]}):r},n)}function zn(e,t){return Object.entries(e.params).reduce((n,[r,o])=>{const a=ve(`${W}${r}${J}`);return a?bt(n,{name:r,param:o,value:t[a]}):n},e.value)}function Yn(e,t){const n=new URLSearchParams(e.value);if(!e.value)return n;for(const[r,o]of Array.from(n.entries())){const a=ve(o);if(!a)continue;const c=ie(t[a],e.params[a],$e(o)),u=t[a]===void 0&&c==="";$e(o)&&u?n.delete(r,o):n.set(r,c)}return n}function Xn(e){return(t,n,r)=>{if(T(t)){const u=n??{},{searchParams:f,...l}=D(t);return Object.entries(u.query??{}).forEach(([h,g])=>{f.append(h,g)}),kt({...l,searchParams:f})}const o=n??{},a=r??{},s=e.find(u=>u.name===t);if(!s)throw new qn(String(t));return Gn(s,{params:o,query:a.query,hash:a.hash})}}class Zn extends Error{constructor(){super("initialUrl must be set if window.location is unavailable")}}function er(e){if(e)return e;if(Ce())return window.location.toString();throw new Zn}const tr=(e,t)=>{try{At(e,t)}catch{return!1}return!0},At=(e,t)=>{const{pathname:n,search:r}=D(t);return{...nr(e.path,n),...rr(e.query,r)}};function nr(e,t){const n={},r=decodeURIComponent(t);for(const[o,a]of Object.entries(e.params)){const s=o.startsWith("?"),c=s?o.slice(1):o,u=Et(r,e.value,o),f=ue(u,a,s);n[c]=f}return n}function rr(e,t){const n={},r=new URLSearchParams(t);for(const[o,a]of Object.entries(e.params)){const s=o.startsWith("?"),c=s?o.slice(1):o,u=r.get(c)??void 0,f=ue(u,a,s);n[c]=f}return n}const or=e=>"name"in e.matched&&!!e.matched.name,ar=(e,t)=>{const{pathname:n}=D(t);return Tn(e).test(n)},sr=(e,t)=>{const{search:n}=D(t);return Mn(e).every(o=>o.test(n))},Oe=(e,t)=>{const{hash:n}=D(t),{value:r}=e.hash;return r===void 0||`#${r.toLowerCase()}`===n.toLowerCase()};function cr(e){const{searchParams:t,pathname:n}=D(e),r=-1,o=1;return(a,s)=>{const c=Ut(a,t),u=xt(a,n),f=Ut(s,t),l=xt(s,n);return a.depth>s.depth?r:a.depth<s.depth?o:c+u>f+l?r:c+u<f+l?o:Oe(a,e)?r:Oe(s,e)?o:0}}function xt(e,t){const n=Object.keys(e.path.params).filter(o=>o.startsWith("?")).map(o=>o),r=n.filter(o=>Et(t,e.path.value,o)===void 0);return n.length-r.length}function Ut(e,t){const n=new URLSearchParams(e.query.value),r=Array.from(n.keys()),o=r.filter(a=>!t.has(a));return r.length-o.length}function Ct(e){return!!e&&typeof e=="object"}const Ee=!0;function ur(e,t,n){if(Ct(e)&&t in e){const r=e[t];if(typeof r=="string")return ue(r,n,Ee)}return ue(void 0,n,Ee)}function ir(e,t){const n={};for(const[r,o]of Object.entries(e)){const a=ur(t,r,o);n[r]=a}return n}function fr(e,t,n){if(Ct(e)&&t in e){const r=e[t];return ie(r,n,Ee)}return ie(void 0,n,Ee)}const Bt=(e,t)=>{const n={};for(const[r,o]of Object.entries(e)){const a=fr(t,r,o);n[r]=a}return n},lr=[or,ar,sr,Oe,tr];function qe(e,t,n){const r=cr(t),o=e.filter(u=>lr.every(f=>f(u,t))).sort(r);if(o.length===0)return;const[a]=o,{search:s,hash:c}=D(t);return{id:a.id,matched:a.matched,matches:a.matches,name:a.name,query:yt(s),params:At(a,t),state:ir(a.state,n),hash:c}}function _e(e,t){const n=new RegExp(`\\${W}(\\??[\\w-_]+)\\${J}`,"g");return Array.from(e.matchAll(n)).reduce((o,[a,s])=>{const c=ve(a);if(!c)return o;const u=Rn(t,c);return te([c],o),o[s]=u,o},{})}function be(e,t){return{value:e,params:_e(e,t)}}function hr(e,t){return ce(t)?e.map(n=>{const r=`${t}${n.path.value}`;return{...n,path:be(r,n.path.params)}}):e}class pr extends Error{constructor(t){super(`Invalid Name "${t}": Router does not support multiple routes with the same name. All name names must be unique.`)}}function dr(e){const t=e.map(({name:n})=>n);for(const n of t)if(Ke(t,n)>1)throw new pr(n)}function mr(){const e=i.reactive(new Map),t=Ce()?s():null,n=c=>{e.set(c,!1),t==null||t.observe(c)},r=c=>{e.delete(c),t==null||t.unobserve(c)},o=()=>{t==null||t.disconnect()},a=c=>e.get(c)??!1;function s(){return new IntersectionObserver(c=>{c.forEach(u=>{e.set(u.target,u.isIntersecting)})})}return{observe:n,unobserve:r,disconnect:o,isElementVisible:a}}const Lt=Symbol("visibilityObserver");function gr(){const e=i.inject(Lt);if(!e)throw new _;return e}function yr(e,t){const n=rn(e)?e.flat():e,r=hr(n,t==null?void 0:t.base);dr(r);const o=Rt(),a=kr(),s=mr(),c=Xn(r),u=Cn({mode:t==null?void 0:t.historyMode,listener:({location:E})=>{const N=X(E);U(N,{state:E.state,replace:!0})}}),{runBeforeRouteHooks:f,runAfterRouteHooks:l}=jn(),{hooks:h,onBeforeRouteEnter:g,onAfterRouteUpdate:d,onBeforeRouteLeave:b,onAfterRouteEnter:v,onBeforeRouteUpdate:w,onAfterRouteLeave:A}=Hn();async function U(E,N={}){const G=o();if(u.stopListening(),Je(E)){u.update(E,N);return}const O=qe(r,E,N.state)??y("NotFound"),Ae={...x},K=await f({to:O,from:Ae,hooks:h});switch(K.status){case"ABORT":return;case"PUSH":u.update(E,N),await m(...K.to);return;case"REJECT":u.update(E,N),R(K.type);break;case"SUCCESS":u.update(E,N),R(null);break;default:throw new Error(`Switch is not exhaustive for before hook response status: ${JSON.stringify(K)}`)}const F=G;a.setProps(O).then(q=>{if(F===G)switch(q.status){case"SUCCESS":break;case"PUSH":m(...q.to);break;case"REJECT":R(q.type);break;default:const le=q;throw new Error(`Switch is not exhaustive for prop store response status: ${JSON.stringify(le)}`)}}),j(O);const z=await l({to:O,from:Ae,hooks:h});switch(z.status){case"PUSH":await m(...z.to);break;case"REJECT":R(z.type);break;case"SUCCESS":break;default:const q=z;throw new Error(`Switch is not exhaustive for after hook response status: ${JSON.stringify(q)}`)}u.startListening()}const m=(E,N,G)=>{if(T(E)){const q={...N},le=c(E,q);return U(le,q)}const O={...G},K=c(E,N??{},O),F=tn(E),z=Bt((F==null?void 0:F.state)??{},O.state);return U(K,{...O,state:z})},S=(E,N,G)=>{if(T(E)){const q={...N,replace:!0},le=c(E,q);return U(le,q)}const O={...G,replace:!0},K=c(E,N??{},O),F=tn(E),z=Bt((F==null?void 0:F.state)??{},O.state);return U(K,{...O,state:z})},C=E=>{R(E)},B=(E,N={})=>{if(!T(E)){const G=c(E,N);return qe(r,G)}if(!Je(E))return qe(r,E)},{setRejection:R,rejection:p,getRejectionRoute:y}=On(t??{}),k=y("NotFound"),{currentRoute:x,routerRoute:L,updateRoute:j}=kn(k,m);u.startListening();const H=er(t==null?void 0:t.initialUrl),M=u.location.state,{host:Xt}=D(H),Je=Un(Xt);let Zt=!1;async function en(){Zt||(await U(H,{replace:!0,state:M}),Zt=!0)}function tn(E){return r.find(N=>N.name===E)}function Tr(E){E.component("RouterView",zt),E.component("RouterLink",Kt),E.provide(ut,p),E.provide(gt,h),E.provide(Mt,a),E.provide(Lt,s),E.provide(it,nn),en()}const nn={route:L,resolve:c,push:m,replace:S,reject:C,find:B,refresh:u.refresh,forward:u.forward,back:u.back,go:u.go,install:Tr,isExternal:Je,onBeforeRouteEnter:g,onAfterRouteUpdate:d,onBeforeRouteLeave:b,onAfterRouteEnter:v,onBeforeRouteUpdate:w,onAfterRouteLeave:A,prefetch:t==null?void 0:t.prefetch,start:en};return nn}function Te(e,t){return{value:e,params:_e(e,t)}}function Nt(e,t){return{value:e,params:_e(e,t)}}function Rr(e){return se(e)&&typeof e.hash=="string"}function jt(e){return e===void 0?he():Rr(e)?e:he(e)}function Vt(e){return e===void 0?"":e}function wr(e){return se(e)&&typeof e.value=="string"}function Ht(e){return e===void 0?be("",{}):wr(e)?e:be(e,{})}function vr(e){return se(e)&&typeof e.value=="string"}function $t(e){return e===void 0?Te("",{}):vr(e)?e:Te(e,{})}function Z(e){const t=je(),n=Vt(e.name),r=Ht(e.path),o=$t(e.query),a=jt(e.hash),s=e.meta??{},c=pn(e)?e.state:{},u=i.markRaw({id:t,meta:{},state:{},...e}),f={id:t,matched:u,matches:[u],name:n,path:r,query:o,hash:a,meta:s,state:c,depth:1,host:Nt("",{}),prefetch:e.prefetch},l=ze(e)?Ye(e.parent,f):f;return te(l.path.params,l.query.params),l}const Se={template:"<div>This is component</div>"},Me=Z({name:"parentA",path:"/parentA/[paramA]"}),Ot=Z({parent:Me,name:"parentA.childA",path:"/[?paramB]"}),Pr=Z({parent:Me,name:"parentA.childB",path:"/[paramD]",component:Se}),Er=Z({parent:Ot,name:"parentA.childA.grandChildA",path:"/[paramC]",component:Se});Z({name:"parentB",path:"/parentB",component:Se}),Z({name:"parentC",path:"/",component:Se});const br="lazy",Sr={components:!0,props:!1};function ke(e){return["eager","lazy"].includes(e)}function qt({routerPrefetch:e,routePrefetch:t,linkPrefetch:n},r){const o=De(n,r),a=De(t,r),s=De(e,r),c=[o,a,s,Sr[r],br].reduce((u,f)=>ke(u)?u:u===!0&&ke(f)?f:u===!0&&!ke(f)?u:u===void 0?f:u,void 0);return ke(c)?c:!1}function De(e,t){return se(e)?e[t]:e}function _t(e){return typeof e=="object"&&e!==null&&"then"in e}function Tt(e){try{const t=e();return _t(t)?t.catch(n=>n):t}catch(t){return t}}const Mt=Symbol();function kr(){const e=i.reactive(new Map),{push:t,replace:n,reject:r}=dt(),o=(h,g,d)=>g.matches.filter(b=>qt({...d,routePrefetch:b.prefetch},"props")===h).flatMap(b=>f(b)).reduce((b,{id:v,name:w,props:A})=>{if(!A)return b;const U=u(v,w,g),m=Tt(()=>A(g,{push:t,replace:n,reject:r}));return b[U]=m,b},{}),a=h=>{Object.entries(h).forEach(([g,d])=>{e.set(g,d)})},s=async h=>{const g=h.matches.flatMap(f),d=[],b=[];for(const{id:v,name:w,props:A}of g){if(!A)continue;const U=u(v,w,h);if(d.push(U),!e.has(U)){const m=Tt(()=>A(h,{push:t,replace:n,reject:r}));e.set(U,m)}b.push((async()=>{const m=await e.get(U);if(m instanceof Error)throw m})())}l(d);try{return await Promise.all(b),{status:"SUCCESS"}}catch(v){if(v instanceof ae||v instanceof we)return v.response;throw v}},c=(h,g,d)=>{const b=u(h,g,d);return e.get(b)};function u(h,g,d){return[h,g,d.id,JSON.stringify(d.params)].join("-")}function f(h){return Ue(h)?Object.entries(h.props??{}).map(([g,d])=>({id:h.id,name:g,props:d})):xe(h)?[{id:h.id,name:"default",props:h.props}]:[]}function l(h){for(const g in e.keys())h.includes(g)||e.delete(g)}return{getPrefetchProps:o,setPrefetchProps:a,getProps:c,setProps:s}}function Dt(){const e=i.inject(Mt);if(!e)throw new _;return e}const Ar=i.defineAsyncComponent(()=>new Promise(e=>{e({default:{template:"foo"}})}));function It(e){return e.name===Ar.name&&"setup"in e}function xr(e){const t=new Map,n=i.ref(),{getPrefetchProps:r,setPrefetchProps:o}=Dt(),{observe:a,unobserve:s,isElementVisible:c}=gr(),u=()=>{const l=Array.from(t.values()).reduce((h,g)=>(Object.assign(h,g),h),{});o(l)};i.onMounted(()=>{if(!n.value){console.warn("The usePrefetching composition will not work correctly if the element ref is not bound.");return}a(n.value)}),i.onBeforeUnmount(()=>{n.value&&s(n.value)}),i.watch(()=>i.toValue(e),({route:l,...h})=>{t.clear(),l&&f("eager",l,h)},{immediate:!0}),i.watch(()=>!!(n.value&&c(n.value)),l=>{const{route:h,...g}=i.toValue(e);!h||!l||f("lazy",h,g)},{immediate:!0});function f(l,h,g){Ur(l,h,g),t.has(l)||t.set(l,r(l,h,g))}return{element:n,commit:u}}function Ur(e,t,n){t.matches.forEach(r=>{qt({...n,routePrefetch:r.prefetch},"components")===e&&(xe(r)&&It(r.component)&&r.component.setup(),Ue(r)&&Object.values(r.components).forEach(a=>{It(a)&&a.setup()}))})}function Ie(e,t,{exact:n}={}){return bn(e)?t===void 0?!0:n?e.matched.name===t:e.matches.map(r=>r.name).includes(t):!1}function Wt(e,t={},n={}){const r=ye(),o=i.toRef(e),a=i.computed(()=>T(o.value)?{}:i.toValue(t)),s=i.computed(()=>T(o.value)?i.toValue(t):i.toValue(n)),c=i.computed(()=>{if(T(o.value))return o.value;try{return r.resolve(o.value,a.value,s.value)}catch(w){throw w instanceof ne&&console.error(`Failed to resolve route "${o.value.toString()}" in RouterLink.`,w),w}}),u=i.computed(()=>r.find(c.value,s.value)),f=i.computed(()=>Ie(r.route)&&r.route.matches.some(w=>{var A;return w.id===((A=u.value)==null?void 0:A.id)})),l=i.computed(()=>{var w;return r.route.id===((w=u.value)==null?void 0:w.id)}),h=i.computed(()=>r.isExternal(c.value)),{element:g,commit:d}=xr(()=>({route:u.value,routerPrefetch:r.prefetch,linkPrefetch:s.value.prefetch})),b=w=>(d(),r.push(c.value,{...s.value,...w}));return{element:g,route:u,href:c,isMatch:f,isExactMatch:l,isExternal:h,push:b,replace:w=>b(w)}}function Ft(e,t){const n=ye();function r(){if(!e)return;if(!Ie(n.route,e,t))throw new ct(e,n.route.name)}return i.watch(n.route,r,{immediate:!0,deep:!0}),n.route}const Jt=Symbol();function We(){return i.inject(Jt,0)}function Qt(){const e=i.inject(gt);if(!e)throw new _;return e}function Gt(e){return t=>{const n=We(),o=Qt().addBeforeRouteHook({lifecycle:e,hook:t,depth:n,timing:"component"});return i.onUnmounted(o),o}}function Fe(e){return t=>{const n=We(),o=Qt().addAfterRouteHook({lifecycle:e,hook:t,depth:n,timing:"component"});return i.onUnmounted(o),o}}const Cr=Gt("onBeforeRouteUpdate"),Br=Gt("onBeforeRouteLeave"),Lr=Fe("onAfterRouteEnter"),Nr=Fe("onAfterRouteUpdate"),jr=Fe("onAfterRouteLeave"),Vr=["href"],Kt=i.defineComponent({__name:"routerLink",props:{to:{},prefetch:{type:[Boolean,String,Object],default:void 0},query:{},hash:{},replace:{type:Boolean},state:{}},setup(e){const t=e,n=ye(),r=i.computed(()=>T(t.to)?t.to:t.to(n.resolve)),o=i.computed(()=>{const{to:g,...d}=t;return d}),{element:a,isMatch:s,isExactMatch:c,isExternal:u,push:f}=Wt(r,o),l=i.computed(()=>({"router-link--match":s.value,"router-link--exact-match":c.value}));function h(g){g.preventDefault(),f()}return(g,d)=>(i.openBlock(),i.createElementBlock("a",{ref_key:"element",ref:a,href:r.value,class:i.normalizeClass(["router-link",l.value]),onClick:h},[i.renderSlot(g.$slots,"default",i.normalizeProps(i.guardReactiveProps({resolved:r.value,isMatch:i.unref(s),isExactMatch:i.unref(c),isExternal:i.unref(u)})))],10,Vr))}});function Hr(e,t){return i.defineComponent({name:"PropsWrapper",expose:[],setup(){const n=t(),r=i.getCurrentInstance();return()=>n instanceof Error?"":_t(n)?r!=null&&r.suspense?i.h(Or(e,n)):i.h($r(e,n)):i.h(e,n)}})}function $r(e,t){return i.defineComponent({name:"AsyncPropsWrapper",expose:[],setup(){const n=i.ref();return(async()=>n.value=await t)(),()=>n.value instanceof Error?"":n.value?i.h(e,n.value):""}})}function Or(e,t){return i.defineComponent({name:"SuspenseAsyncPropsWrapper",expose:[],async setup(){const n=await t;return()=>i.h(e,n)}})}const zt=i.defineComponent({__name:"routerView",props:{name:{default:"default"}},setup(e){const t=Ft(),n=En(),r=We(),{getProps:o}=Dt(),a=i.resolveComponent("RouterView",!0);i.provide(Jt,r+1);const s=i.computed(()=>{if(n.value)return n.value.component;const f=t.matches.at(r);if(!f)return null;const l=c(f),h=o(f.id,e.name,t);return l?h?Hr(l,()=>h):l:null});function c(f){return u(f)[e.name]}function u(f){return Ue(f)?f.components:xe(f)?{default:f.component}:typeof a=="string"?{}:{default:a}}return(f,l)=>s.value?i.renderSlot(f.$slots,"default",i.normalizeProps(i.mergeProps({key:0},{route:i.unref(t),component:s.value,rejection:i.unref(n)})),()=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(s.value)))]):i.createCommentVNode("",!0)}});function qr(e){return se(e)&&typeof e.value=="string"}function Yt(e){return qr(e)?e:Nt(e,{})}function _r(e){const t=je(),n=Vt(e.name),r=Ht(e.path),o=$t(e.query),a=jt(e.hash),s=e.meta??{},c=hn(e)?Yt(e.host):Yt(""),u=i.markRaw({id:t,meta:{},state:{},...e}),f={id:t,matched:u,matches:[u],name:n,host:c,path:r,query:o,hash:a,meta:s,depth:1,state:{}},l=ze(e)?Ye(e.parent,f):f;return te(l.path.params,l.query.params,l.host.params),l}P.DuplicateParamsError=Ge,P.MetaPropertyConflict=Qe,P.RouterLink=Kt,P.RouterNotInstalledError=_,P.RouterView=zt,P.UseRouteInvalidError=ct,P.asUrl=pt,P.createExternalRoute=_r,P.createParam=nt,P.createRoute=Z,P.createRouter=yr,P.isRoute=Ie,P.isUrl=T,P.onAfterRouteEnter=Lr,P.onAfterRouteLeave=Nr,P.onAfterRouteUpdate=jr,P.onBeforeRouteLeave=Cr,P.onBeforeRouteUpdate=Br,P.path=be,P.query=Te,P.useLink=Wt,P.useRoute=Ft,P.useRouter=ye,P.withDefault=yn,Object.defineProperty(P,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kitbag/router",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.13.
|
|
4
|
+
"version": "0.13.4",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/kitbagjs/router/issues"
|
|
7
7
|
},
|
|
@@ -36,10 +36,10 @@
|
|
|
36
36
|
"@vitejs/plugin-vue": "^5.2.1",
|
|
37
37
|
"@vue/test-utils": "^2.4.6",
|
|
38
38
|
"eslint": "^9.16.0",
|
|
39
|
-
"globals": "^15.
|
|
39
|
+
"globals": "^15.13.0",
|
|
40
40
|
"happy-dom": "^15.11.7",
|
|
41
41
|
"typedoc": "^0.27.3",
|
|
42
|
-
"typedoc-plugin-markdown": "^4.3.
|
|
42
|
+
"typedoc-plugin-markdown": "^4.3.2",
|
|
43
43
|
"typedoc-vitepress-theme": "^1.1.1",
|
|
44
44
|
"typescript": "^5.6.3",
|
|
45
45
|
"vite": "^6.0.1",
|