@koishijs/plugin-console
Version:
Web User Interface for Koishi
33 lines (29 loc) • 43.2 kB
JavaScript
import{getCurrentInstance as ie,inject as B,computed as j,unref as Q,watchEffect as $t,shallowRef as xt,shallowReactive as Ot,onUnmounted as It,onDeactivated as Tt,onActivated as Nt,defineComponent as Ze,reactive as Mt,h as et,provide as me,ref as jt,watch as tt,nextTick as Lt}from"./vue.js";function Ut(){return nt().__VUE_DEVTOOLS_GLOBAL_HOOK__}function nt(){return typeof navigator<"u"&&typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}const Bt=typeof Proxy=="function",Dt="devtools-plugin:setup",Ht="plugin:settings:set";let z,we;function Vt(){var e;return z!==void 0||(typeof window<"u"&&window.performance?(z=!0,we=window.performance):typeof globalThis<"u"&&(!((e=globalThis.perf_hooks)===null||e===void 0)&&e.performance)?(z=!0,we=globalThis.perf_hooks.performance):z=!1),z}function Gt(){return Vt()?we.now():Date.now()}class Kt{constructor(t,n){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=t,this.hook=n;const o={};if(t.settings)for(const f in t.settings){const d=t.settings[f];o[f]=d.defaultValue}const r=`__vue-devtools-plugin-settings__${t.id}`;let u=Object.assign({},o);try{const f=localStorage.getItem(r),d=JSON.parse(f);Object.assign(u,d)}catch{}this.fallbacks={getSettings(){return u},setSettings(f){try{localStorage.setItem(r,JSON.stringify(f))}catch{}u=f},now(){return Gt()}},n&&n.on(Ht,(f,d)=>{f===this.plugin.id&&this.fallbacks.setSettings(d)}),this.proxiedOn=new Proxy({},{get:(f,d)=>this.target?this.target.on[d]:(...l)=>{this.onQueue.push({method:d,args:l})}}),this.proxiedTarget=new Proxy({},{get:(f,d)=>this.target?this.target[d]:d==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(d)?(...l)=>(this.targetQueue.push({method:d,args:l,resolve:()=>{}}),this.fallbacks[d](...l)):(...l)=>new Promise(p=>{this.targetQueue.push({method:d,args:l,resolve:p})})})}async setRealTarget(t){this.target=t;for(const n of this.onQueue)this.target.on[n.method](...n.args);for(const n of this.targetQueue)n.resolve(await this.target[n.method](...n.args))}}function Wt(e,t){const n=e,o=nt(),r=Ut(),u=Bt&&n.enableEarlyProxy;if(r&&(o.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!u))r.emit(Dt,e,t);else{const f=u?new Kt(n,r):null;(o.__VUE_DEVTOOLS_PLUGINS__=o.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:n,setupFn:t,proxy:f}),f&&t(f.proxiedTarget)}}/*!
* vue-router v4.4.5
* (c) 2024 Eduardo San Martin Morote
* @license MIT
*/const U=typeof document<"u";function ot(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function rt(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&ot(e.default)}const C=Object.assign;function ge(e,t){const n={};for(const o in t){const r=t[o];n[o]=T(r)?r.map(e):e(r)}return n}const te=()=>{},T=Array.isArray;function y(e){const t=Array.from(arguments).slice(1);console.warn.apply(console,["[Vue Router warn]: "+e].concat(t))}const st=/#/g,qt=/&/g,zt=/\//g,Qt=/=/g,Ft=/\?/g,it=/\+/g,Yt=/%5B/g,Jt=/%5D/g,at=/%5E/g,Xt=/%60/g,lt=/%7B/g,Zt=/%7C/g,ct=/%7D/g,en=/%20/g;function ke(e){return encodeURI(""+e).replace(Zt,"|").replace(Yt,"[").replace(Jt,"]")}function tn(e){return ke(e).replace(lt,"{").replace(ct,"}").replace(at,"^")}function Ee(e){return ke(e).replace(it,"%2B").replace(en,"+").replace(st,"%23").replace(qt,"%26").replace(Xt,"`").replace(lt,"{").replace(ct,"}").replace(at,"^")}function nn(e){return Ee(e).replace(Qt,"%3D")}function on(e){return ke(e).replace(st,"%23").replace(Ft,"%3F")}function rn(e){return e==null?"":on(e).replace(zt,"%2F")}function F(e){try{return decodeURIComponent(""+e)}catch{y(`Error decoding "${e}". Using original value`)}return""+e}const sn=/\/$/,an=e=>e.replace(sn,"");function ve(e,t,n="/"){let o,r={},u="",f="";const d=t.indexOf("#");let l=t.indexOf("?");return d<l&&d>=0&&(l=-1),l>-1&&(o=t.slice(0,l),u=t.slice(l+1,d>-1?d:t.length),r=e(u)),d>-1&&(o=o||t.slice(0,d),f=t.slice(d,t.length)),o=un(o??t,n),{fullPath:o+(u&&"?")+u+f,path:o,query:r,hash:F(f)}}function ln(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function Me(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function je(e,t,n){const o=t.matched.length-1,r=n.matched.length-1;return o>-1&&o===r&&G(t.matched[o],n.matched[r])&&ut(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function G(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function ut(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!cn(e[n],t[n]))return!1;return!0}function cn(e,t){return T(e)?Le(e,t):T(t)?Le(t,e):e===t}function Le(e,t){return T(t)?e.length===t.length&&e.every((n,o)=>n===t[o]):e.length===1&&e[0]===t}function un(e,t){if(e.startsWith("/"))return e;if(!t.startsWith("/"))return y(`Cannot resolve a relative location without an absolute path. Trying to resolve "${e}" from "${t}". It should look like "/${t}".`),e;if(!e)return t;const n=t.split("/"),o=e.split("/"),r=o[o.length-1];(r===".."||r===".")&&o.push("");let u=n.length-1,f,d;for(f=0;f<o.length;f++)if(d=o[f],d!==".")if(d==="..")u>1&&u--;else break;return n.slice(0,u).join("/")+"/"+o.slice(f).join("/")}const H={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};var Y;(function(e){e.pop="pop",e.push="push"})(Y||(Y={}));var W;(function(e){e.back="back",e.forward="forward",e.unknown=""})(W||(W={}));const ye="";function ft(e){if(!e)if(U){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),an(e)}const fn=/^[^#]+#/;function dt(e,t){return e.replace(fn,"#")+t}function dn(e,t){const n=document.documentElement.getBoundingClientRect(),o=e.getBoundingClientRect();return{behavior:t.behavior,left:o.left-n.left-(t.left||0),top:o.top-n.top-(t.top||0)}}const ae=()=>({left:window.scrollX,top:window.scrollY});function hn(e){let t;if("el"in e){const n=e.el,o=typeof n=="string"&&n.startsWith("#");if(typeof e.el=="string"&&(!o||!document.getElementById(e.el.slice(1))))try{const u=document.querySelector(e.el);if(o&&u){y(`The selector "${e.el}" should be passed as "el: document.querySelector('${e.el}')" because it starts with "#".`);return}}catch{y(`The selector "${e.el}" is invalid. If you are using an id selector, make sure to escape it. You can find more information about escaping characters in selectors at https://mathiasbynens.be/notes/css-escapes or use CSS.escape (https://developer.mozilla.org/en-US/docs/Web/API/CSS/escape).`);return}const r=typeof n=="string"?o?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!r){y(`Couldn't find element using selector "${e.el}" returned by scrollBehavior.`);return}t=dn(r,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function Ue(e,t){return(history.state?history.state.position-t:-1)+e}const be=new Map;function pn(e,t){be.set(e,t)}function mn(e){const t=be.get(e);return be.delete(e),t}let gn=()=>location.protocol+"//"+location.host;function ht(e,t){const{pathname:n,search:o,hash:r}=t,u=e.indexOf("#");if(u>-1){let d=r.includes(e.slice(u))?e.slice(u).length:1,l=r.slice(d);return l[0]!=="/"&&(l="/"+l),Me(l,"")}return Me(n,e)+o+r}function vn(e,t,n,o){let r=[],u=[],f=null;const d=({state:c})=>{const h=ht(e,location),_=n.value,w=t.value;let k=0;if(c){if(n.value=h,t.value=c,f&&f===_){f=null;return}k=w?c.position-w.position:0}else o(h);r.forEach(A=>{A(n.value,_,{delta:k,type:Y.pop,direction:k?k>0?W.forward:W.back:W.unknown})})};function l(){f=n.value}function p(c){r.push(c);const h=()=>{const _=r.indexOf(c);_>-1&&r.splice(_,1)};return u.push(h),h}function i(){const{history:c}=window;c.state&&c.replaceState(C({},c.state,{scroll:ae()}),"")}function s(){for(const c of u)c();u=[],window.removeEventListener("popstate",d),window.removeEventListener("beforeunload",i)}return window.addEventListener("popstate",d),window.addEventListener("beforeunload",i,{passive:!0}),{pauseListeners:l,listen:p,destroy:s}}function Be(e,t,n,o=!1,r=!1){return{back:e,current:t,forward:n,replaced:o,position:window.history.length,scroll:r?ae():null}}function yn(e){const{history:t,location:n}=window,o={value:ht(e,n)},r={value:t.state};r.value||u(o.value,{back:null,current:o.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function u(l,p,i){const s=e.indexOf("#"),c=s>-1?(n.host&&document.querySelector("base")?e:e.slice(s))+l:gn()+e+l;try{t[i?"replaceState":"pushState"](p,"",c),r.value=p}catch(h){y("Error with push/replace State",h),n[i?"replace":"assign"](c)}}function f(l,p){const i=C({},t.state,Be(r.value.back,l,r.value.forward,!0),p,{position:r.value.position});u(l,i,!0),o.value=l}function d(l,p){const i=C({},r.value,t.state,{forward:l,scroll:ae()});t.state||y(`history.state seems to have been manually replaced without preserving the necessary values. Make sure to preserve existing history state if you are manually calling history.replaceState:
history.replaceState(history.state, '', url)
You can find more information at https://router.vuejs.org/guide/migration/#Usage-of-history-state`),u(i.current,i,!0);const s=C({},Be(o.value,l,null),{position:i.position+1},p);u(l,s,!1),o.value=l}return{location:o,state:r,push:d,replace:f}}function _n(e){e=ft(e);const t=yn(e),n=vn(e,t.state,t.location,t.replace);function o(u,f=!0){f||n.pauseListeners(),history.go(u)}const r=C({location:"",base:e,go:o,createHref:dt.bind(null,e)},t,n);return Object.defineProperty(r,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(r,"state",{enumerable:!0,get:()=>t.state.value}),r}function lo(e=""){let t=[],n=[ye],o=0;e=ft(e);function r(d){o++,o!==n.length&&n.splice(o),n.push(d)}function u(d,l,{direction:p,delta:i}){const s={direction:p,delta:i,type:Y.pop};for(const c of t)c(d,l,s)}const f={location:ye,state:{},base:e,createHref:dt.bind(null,e),replace(d){n.splice(o--,1),r(d)},push(d,l){r(d)},listen(d){return t.push(d),()=>{const l=t.indexOf(d);l>-1&&t.splice(l,1)}},destroy(){t=[],n=[ye],o=0},go(d,l=!0){const p=this.location,i=d<0?W.back:W.forward;o=Math.max(0,Math.min(o+d,n.length-1)),l&&u(this.location,p,{direction:i,delta:d})}};return Object.defineProperty(f,"location",{enumerable:!0,get:()=>n[o]}),f}function co(e){return e=location.host?e||location.pathname+location.search:"",e.includes("#")||(e+="#"),!e.endsWith("#/")&&!e.endsWith("#")&&y(`A hash base must end with a "#":
"${e}" should be "${e.replace(/#.*$/,"#")}".`),_n(e)}function se(e){return typeof e=="string"||e&&typeof e=="object"}function pt(e){return typeof e=="string"||typeof e=="symbol"}const mt=Symbol("navigation failure");var De;(function(e){e[e.aborted=4]="aborted",e[e.cancelled=8]="cancelled",e[e.duplicated=16]="duplicated"})(De||(De={}));const wn={1({location:e,currentLocation:t}){return`No match for
${JSON.stringify(e)}${t?`
while being at
`+JSON.stringify(t):""}`},2({from:e,to:t}){return`Redirected from "${e.fullPath}" to "${bn(t)}" via a navigation guard.`},4({from:e,to:t}){return`Navigation aborted from "${e.fullPath}" to "${t.fullPath}" via a navigation guard.`},8({from:e,to:t}){return`Navigation cancelled from "${e.fullPath}" to "${t.fullPath}" with a new navigation.`},16({from:e,to:t}){return`Avoided redundant navigation to current location: "${e.fullPath}".`}};function J(e,t){return C(new Error(wn[e](t)),{type:e,[mt]:!0},t)}function L(e,t){return e instanceof Error&&mt in e&&(t==null||!!(e.type&t))}const En=["params","query","hash"];function bn(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of En)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}const He="[^/]+?",Rn={sensitive:!1,strict:!1,start:!0,end:!0},Pn=/[.+*?^${}()[\]/\\]/g;function Sn(e,t){const n=C({},Rn,t),o=[];let r=n.start?"^":"";const u=[];for(const p of e){const i=p.length?[]:[90];n.strict&&!p.length&&(r+="/");for(let s=0;s<p.length;s++){const c=p[s];let h=40+(n.sensitive?.25:0);if(c.type===0)s||(r+="/"),r+=c.value.replace(Pn,"\\$&"),h+=40;else if(c.type===1){const{value:_,repeatable:w,optional:k,regexp:A}=c;u.push({name:_,repeatable:w,optional:k});const R=A||He;if(R!==He){h+=10;try{new RegExp(`(${R})`)}catch(I){throw new Error(`Invalid custom RegExp for param "${_}" (${R}): `+I.message)}}let P=w?`((?:${R})(?:/(?:${R}))*)`:`(${R})`;s||(P=k&&p.length<2?`(?:/${P})`:"/"+P),k&&(P+="?"),r+=P,h+=20,k&&(h+=-8),w&&(h+=-20),R===".*"&&(h+=-50)}i.push(h)}o.push(i)}if(n.strict&&n.end){const p=o.length-1;o[p][o[p].length-1]+=.7000000000000001}n.strict||(r+="/?"),n.end?r+="$":n.strict&&(r+="(?:/|$)");const f=new RegExp(r,n.sensitive?"":"i");function d(p){const i=p.match(f),s={};if(!i)return null;for(let c=1;c<i.length;c++){const h=i[c]||"",_=u[c-1];s[_.name]=h&&_.repeatable?h.split("/"):h}return s}function l(p){let i="",s=!1;for(const c of e){(!s||!i.endsWith("/"))&&(i+="/"),s=!1;for(const h of c)if(h.type===0)i+=h.value;else if(h.type===1){const{value:_,repeatable:w,optional:k}=h,A=_ in p?p[_]:"";if(T(A)&&!w)throw new Error(`Provided param "${_}" is an array but it is not repeatable (* or + modifiers)`);const R=T(A)?A.join("/"):A;if(!R)if(k)c.length<2&&(i.endsWith("/")?i=i.slice(0,-1):s=!0);else throw new Error(`Missing required param "${_}"`);i+=R}}return i||"/"}return{re:f,score:o,keys:u,parse:d,stringify:l}}function kn(e,t){let n=0;for(;n<e.length&&n<t.length;){const o=t[n]-e[n];if(o)return o;n++}return e.length<t.length?e.length===1&&e[0]===80?-1:1:e.length>t.length?t.length===1&&t[0]===80?1:-1:0}function gt(e,t){let n=0;const o=e.score,r=t.score;for(;n<o.length&&n<r.length;){const u=kn(o[n],r[n]);if(u)return u;n++}if(Math.abs(r.length-o.length)===1){if(Ve(o))return 1;if(Ve(r))return-1}return r.length-o.length}function Ve(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const Cn={type:0,value:""},An=/[a-zA-Z0-9_]/;function $n(e){if(!e)return[[]];if(e==="/")return[[Cn]];if(!e.startsWith("/"))throw new Error(`Route paths should start with a "/": "${e}" should be "/${e}".`);function t(h){throw new Error(`ERR (${n})/"${p}": ${h}`)}let n=0,o=n;const r=[];let u;function f(){u&&r.push(u),u=[]}let d=0,l,p="",i="";function s(){p&&(n===0?u.push({type:0,value:p}):n===1||n===2||n===3?(u.length>1&&(l==="*"||l==="+")&&t(`A repeatable param (${p}) must be alone in its segment. eg: '/:ids+.`),u.push({type:1,value:p,regexp:i,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):t("Invalid state to consume buffer"),p="")}function c(){p+=l}for(;d<e.length;){if(l=e[d++],l==="\\"&&n!==2){o=n,n=4;continue}switch(n){case 0:l==="/"?(p&&s(),f()):l===":"?(s(),n=1):c();break;case 4:c(),n=o;break;case 1:l==="("?n=2:An.test(l)?c():(s(),n=0,l!=="*"&&l!=="?"&&l!=="+"&&d--);break;case 2:l===")"?i[i.length-1]=="\\"?i=i.slice(0,-1)+l:n=3:i+=l;break;case 3:s(),n=0,l!=="*"&&l!=="?"&&l!=="+"&&d--,i="";break;default:t("Unknown state");break}}return n===2&&t(`Unfinished custom RegExp for param "${p}"`),s(),f(),r}function xn(e,t,n){const o=Sn($n(e.path),n);{const u=new Set;for(const f of o.keys)u.has(f.name)&&y(`Found duplicated params with name "${f.name}" for path "${e.path}". Only the last one will be available on "$route.params".`),u.add(f.name)}const r=C(o,{record:e,parent:t,children:[],alias:[]});return t&&!r.record.aliasOf==!t.record.aliasOf&&t.children.push(r),r}function On(e,t){const n=[],o=new Map;t=qe({strict:!1,end:!0,sensitive:!1},t);function r(s){return o.get(s)}function u(s,c,h){const _=!h,w=Ke(s);Mn(w,c),w.aliasOf=h&&h.record;const k=qe(t,s),A=[w];if("alias"in s){const I=typeof s.alias=="string"?[s.alias]:s.alias;for(const M of I)A.push(Ke(C({},w,{components:h?h.record.components:w.components,path:M,aliasOf:h?h.record:w})))}let R,P;for(const I of A){const{path:M}=I;if(c&&M[0]!=="/"){const D=c.record.path,N=D[D.length-1]==="/"?"":"/";I.path=c.record.path+(M&&N+M)}if(I.path==="*")throw new Error(`Catch all routes ("*") must now be defined using a param with a custom regexp.
See more at https://router.vuejs.org/guide/migration/#Removed-star-or-catch-all-routes.`);if(R=xn(I,c,k),c&&M[0]==="/"&&jn(R,c),h?(h.alias.push(R),Nn(h,R)):(P=P||R,P!==R&&P.alias.push(R),_&&s.name&&!We(R)&&f(s.name)),vt(R)&&l(R),w.children){const D=w.children;for(let N=0;N<D.length;N++)u(D[N],R,h&&h.children[N])}h=h||R}return P?()=>{f(P)}:te}function f(s){if(pt(s)){const c=o.get(s);c&&(o.delete(s),n.splice(n.indexOf(c),1),c.children.forEach(f),c.alias.forEach(f))}else{const c=n.indexOf(s);c>-1&&(n.splice(c,1),s.record.name&&o.delete(s.record.name),s.children.forEach(f),s.alias.forEach(f))}}function d(){return n}function l(s){const c=Ln(s,n);n.splice(c,0,s),s.record.name&&!We(s)&&o.set(s.record.name,s)}function p(s,c){let h,_={},w,k;if("name"in s&&s.name){if(h=o.get(s.name),!h)throw J(1,{location:s});{const P=Object.keys(s.params||{}).filter(I=>!h.keys.find(M=>M.name===I));P.length&&y(`Discarded invalid param(s) "${P.join('", "')}" when navigating. See https://github.com/vuejs/router/blob/main/packages/router/CHANGELOG.md#414-2022-08-22 for more details.`)}k=h.record.name,_=C(Ge(c.params,h.keys.filter(P=>!P.optional).concat(h.parent?h.parent.keys.filter(P=>P.optional):[]).map(P=>P.name)),s.params&&Ge(s.params,h.keys.map(P=>P.name))),w=h.stringify(_)}else if(s.path!=null)w=s.path,w.startsWith("/")||y(`The Matcher cannot resolve relative paths but received "${w}". Unless you directly called \`matcher.resolve("${w}")\`, this is probably a bug in vue-router. Please open an issue at https://github.com/vuejs/router/issues/new/choose.`),h=n.find(P=>P.re.test(w)),h&&(_=h.parse(w),k=h.record.name);else{if(h=c.name?o.get(c.name):n.find(P=>P.re.test(c.path)),!h)throw J(1,{location:s,currentLocation:c});k=h.record.name,_=C({},c.params,s.params),w=h.stringify(_)}const A=[];let R=h;for(;R;)A.unshift(R.record),R=R.parent;return{name:k,path:w,params:_,matched:A,meta:Tn(A)}}e.forEach(s=>u(s));function i(){n.length=0,o.clear()}return{addRoute:u,resolve:p,removeRoute:f,clearRoutes:i,getRoutes:d,getRecordMatcher:r}}function Ge(e,t){const n={};for(const o of t)o in e&&(n[o]=e[o]);return n}function Ke(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:In(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function In(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const o in e.components)t[o]=typeof n=="object"?n[o]:n;return t}function We(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function Tn(e){return e.reduce((t,n)=>C(t,n.meta),{})}function qe(e,t){const n={};for(const o in e)n[o]=o in t?t[o]:e[o];return n}function Re(e,t){return e.name===t.name&&e.optional===t.optional&&e.repeatable===t.repeatable}function Nn(e,t){for(const n of e.keys)if(!n.optional&&!t.keys.find(Re.bind(null,n)))return y(`Alias "${t.record.path}" and the original record: "${e.record.path}" must have the exact same param named "${n.name}"`);for(const n of t.keys)if(!n.optional&&!e.keys.find(Re.bind(null,n)))return y(`Alias "${t.record.path}" and the original record: "${e.record.path}" must have the exact same param named "${n.name}"`)}function Mn(e,t){t&&t.record.name&&!e.name&&!e.path&&y(`The route named "${String(t.record.name)}" has a child without a name and an empty path. Using that name won't render the empty path child so you probably want to move the name to the child instead. If this is intentional, add a name to the child route to remove the warning.`)}function jn(e,t){for(const n of t.keys)if(!e.keys.find(Re.bind(null,n)))return y(`Absolute path "${e.record.path}" must have the exact same param named "${n.name}" as its parent "${t.record.path}".`)}function Ln(e,t){let n=0,o=t.length;for(;n!==o;){const u=n+o>>1;gt(e,t[u])<0?o=u:n=u+1}const r=Un(e);return r&&(o=t.lastIndexOf(r,o-1),o<0&&y(`Finding ancestor route "${r.record.path}" failed for "${e.record.path}"`)),o}function Un(e){let t=e;for(;t=t.parent;)if(vt(t)&>(e,t)===0)return t}function vt({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Bn(e){const t={};if(e===""||e==="?")return t;const o=(e[0]==="?"?e.slice(1):e).split("&");for(let r=0;r<o.length;++r){const u=o[r].replace(it," "),f=u.indexOf("="),d=F(f<0?u:u.slice(0,f)),l=f<0?null:F(u.slice(f+1));if(d in t){let p=t[d];T(p)||(p=t[d]=[p]),p.push(l)}else t[d]=l}return t}function ze(e){let t="";for(let n in e){const o=e[n];if(n=nn(n),o==null){o!==void 0&&(t+=(t.length?"&":"")+n);continue}(T(o)?o.map(u=>u&&Ee(u)):[o&&Ee(o)]).forEach(u=>{u!==void 0&&(t+=(t.length?"&":"")+n,u!=null&&(t+="="+u))})}return t}function Dn(e){const t={};for(const n in e){const o=e[n];o!==void 0&&(t[n]=T(o)?o.map(r=>r==null?null:""+r):o==null?o:""+o)}return t}const Ce=Symbol("router view location matched"),Qe=Symbol("router view depth"),le=Symbol("router"),Ae=Symbol("route location"),Pe=Symbol("router view location");function Z(){let e=[];function t(o){return e.push(o),()=>{const r=e.indexOf(o);r>-1&&e.splice(r,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function yt(e,t,n){const o=()=>{e[t].delete(n)};It(o),Tt(o),Nt(()=>{e[t].add(n)}),e[t].add(n)}function uo(e){if(!ie()){y("getCurrentInstance() returned null. onBeforeRouteLeave() must be called at the top of a setup function");return}const t=B(Ce,{}).value;if(!t){y("No active route record was found when calling `onBeforeRouteLeave()`. Make sure you call this function inside a component child of <router-view>. Maybe you called it inside of App.vue?");return}yt(t,"leaveGuards",e)}function fo(e){if(!ie()){y("getCurrentInstance() returned null. onBeforeRouteUpdate() must be called at the top of a setup function");return}const t=B(Ce,{}).value;if(!t){y("No active route record was found when calling `onBeforeRouteUpdate()`. Make sure you call this function inside a component child of <router-view>. Maybe you called it inside of App.vue?");return}yt(t,"updateGuards",e)}function V(e,t,n,o,r,u=f=>f()){const f=o&&(o.enterCallbacks[r]=o.enterCallbacks[r]||[]);return()=>new Promise((d,l)=>{const p=c=>{c===!1?l(J(4,{from:n,to:t})):c instanceof Error?l(c):se(c)?l(J(2,{from:t,to:c})):(f&&o.enterCallbacks[r]===f&&typeof c=="function"&&f.push(c),d())},i=u(()=>e.call(o&&o.instances[r],t,n,Hn(p,t,n)));let s=Promise.resolve(i);if(e.length<3&&(s=s.then(p)),e.length>2){const c=`The "next" callback was never called inside of ${e.name?'"'+e.name+'"':""}:
${e.toString()}
. If you are returning a value instead of calling "next", make sure to remove the "next" parameter from your function.`;if(typeof i=="object"&&"then"in i)s=s.then(h=>p._called?h:(y(c),Promise.reject(new Error("Invalid navigation guard"))));else if(i!==void 0&&!p._called){y(c),l(new Error("Invalid navigation guard"));return}}s.catch(c=>l(c))})}function Hn(e,t,n){let o=0;return function(){o++===1&&y(`The "next" callback was called more than once in one navigation guard when going from "${n.fullPath}" to "${t.fullPath}". It should be called exactly one time in each navigation guard. This will fail in production.`),e._called=!0,o===1&&e.apply(null,arguments)}}function _e(e,t,n,o,r=u=>u()){const u=[];for(const f of e){!f.components&&!f.children.length&&y(`Record with path "${f.path}" is either missing a "component(s)" or "children" property.`);for(const d in f.components){let l=f.components[d];{if(!l||typeof l!="object"&&typeof l!="function")throw y(`Component "${d}" in record with path "${f.path}" is not a valid component. Received "${String(l)}".`),new Error("Invalid route component");if("then"in l){y(`Component "${d}" in record with path "${f.path}" is a Promise instead of a function that returns a Promise. Did you write "import('./MyPage.vue')" instead of "() => import('./MyPage.vue')" ? This will break in production if not fixed.`);const p=l;l=()=>p}else l.__asyncLoader&&!l.__warnedDefineAsync&&(l.__warnedDefineAsync=!0,y(`Component "${d}" in record with path "${f.path}" is defined using "defineAsyncComponent()". Write "() => import('./MyPage.vue')" instead of "defineAsyncComponent(() => import('./MyPage.vue'))".`))}if(!(t!=="beforeRouteEnter"&&!f.instances[d]))if(ot(l)){const i=(l.__vccOpts||l)[t];i&&u.push(V(i,n,o,f,d,r))}else{let p=l();"catch"in p||(y(`Component "${d}" in record with path "${f.path}" is a function that does not return a Promise. If you were passing a functional component, make sure to add a "displayName" to the component. This will break in production if not fixed.`),p=Promise.resolve(p)),u.push(()=>p.then(i=>{if(!i)throw new Error(`Couldn't resolve component "${d}" at "${f.path}"`);const s=rt(i)?i.default:i;f.mods[d]=i,f.components[d]=s;const h=(s.__vccOpts||s)[t];return h&&V(h,n,o,f,d,r)()}))}}}return u}function ho(e){return e.matched.every(t=>t.redirect)?Promise.reject(new Error("Cannot load a route that redirects.")):Promise.all(e.matched.map(t=>t.components&&Promise.all(Object.keys(t.components).reduce((n,o)=>{const r=t.components[o];return typeof r=="function"&&!("displayName"in r)&&n.push(r().then(u=>{if(!u)return Promise.reject(new Error(`Couldn't resolve component "${o}" at "${t.path}". Ensure you passed a function that returns a promise.`));const f=rt(u)?u.default:u;t.mods[o]=u,t.components[o]=f})),n},[])))).then(()=>e)}function Fe(e){const t=B(le),n=B(Ae);let o=!1,r=null;const u=j(()=>{const i=Q(e.to);return(!o||i!==r)&&(se(i)||(o?y(`Invalid value for prop "to" in useLink()
- to:`,i,`
- previous to:`,r,`
- props:`,e):y(`Invalid value for prop "to" in useLink()
- to:`,i,`
- props:`,e)),r=i,o=!0),t.resolve(i)}),f=j(()=>{const{matched:i}=u.value,{length:s}=i,c=i[s-1],h=n.matched;if(!c||!h.length)return-1;const _=h.findIndex(G.bind(null,c));if(_>-1)return _;const w=Ye(i[s-2]);return s>1&&Ye(c)===w&&h[h.length-1].path!==w?h.findIndex(G.bind(null,i[s-2])):_}),d=j(()=>f.value>-1&&Wn(n.params,u.value.params)),l=j(()=>f.value>-1&&f.value===n.matched.length-1&&ut(n.params,u.value.params));function p(i={}){return Kn(i)?t[Q(e.replace)?"replace":"push"](Q(e.to)).catch(te):Promise.resolve()}if(U){const i=ie();if(i){const s={route:u.value,isActive:d.value,isExactActive:l.value,error:null};i.__vrl_devtools=i.__vrl_devtools||[],i.__vrl_devtools.push(s),$t(()=>{s.route=u.value,s.isActive=d.value,s.isExactActive=l.value,s.error=se(Q(e.to))?null:'Invalid "to" value'},{flush:"post"})}}return{route:u,href:j(()=>u.value.href),isActive:d,isExactActive:l,navigate:p}}const Vn=Ze({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:Fe,setup(e,{slots:t}){const n=Mt(Fe(e)),{options:o}=B(le),r=j(()=>({[Je(e.activeClass,o.linkActiveClass,"router-link-active")]:n.isActive,[Je(e.exactActiveClass,o.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const u=t.default&&t.default(n);return e.custom?u:et("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:r.value},u)}}}),Gn=Vn;function Kn(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function Wn(e,t){for(const n in t){const o=t[n],r=e[n];if(typeof o=="string"){if(o!==r)return!1}else if(!T(r)||r.length!==o.length||o.some((u,f)=>u!==r[f]))return!1}return!0}function Ye(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Je=(e,t,n)=>e??t??n,qn=Ze({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){Qn();const o=B(Pe),r=j(()=>e.route||o.value),u=B(Qe,0),f=j(()=>{let p=Q(u);const{matched:i}=r.value;let s;for(;(s=i[p])&&!s.components;)p++;return p}),d=j(()=>r.value.matched[f.value]);me(Qe,j(()=>f.value+1)),me(Ce,d),me(Pe,r);const l=jt();return tt(()=>[l.value,d.value,e.name],([p,i,s],[c,h,_])=>{i&&(i.instances[s]=p,h&&h!==i&&p&&p===c&&(i.leaveGuards.size||(i.leaveGuards=h.leaveGuards),i.updateGuards.size||(i.updateGuards=h.updateGuards))),p&&i&&(!h||!G(i,h)||!c)&&(i.enterCallbacks[s]||[]).forEach(w=>w(p))},{flush:"post"}),()=>{const p=r.value,i=e.name,s=d.value,c=s&&s.components[i];if(!c)return Xe(n.default,{Component:c,route:p});const h=s.props[i],_=h?h===!0?p.params:typeof h=="function"?h(p):h:null,k=et(c,C({},_,t,{onVnodeUnmounted:A=>{A.component.isUnmounted&&(s.instances[i]=null)},ref:l}));if(U&&k.ref){const A={depth:f.value,name:s.name,path:s.path,meta:s.meta};(T(k.ref)?k.ref.map(P=>P.i):[k.ref.i]).forEach(P=>{P.__vrv_devtools=A})}return Xe(n.default,{Component:k,route:p})||k}}});function Xe(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const zn=qn;function Qn(){const e=ie(),t=e.parent&&e.parent.type.name,n=e.parent&&e.parent.subTree&&e.parent.subTree.type;if(t&&(t==="KeepAlive"||t.includes("Transition"))&&typeof n=="object"&&n.name==="RouterView"){const o=t==="KeepAlive"?"keep-alive":"transition";y(`<router-view> can no longer be used directly inside <transition> or <keep-alive>.
Use slot props instead:
<router-view v-slot="{ Component }">
<${o}>
<component :is="Component" />
</${o}>
</router-view>`)}}function ee(e,t){const n=C({},e,{matched:e.matched.map(o=>so(o,["instances","children","aliasOf"]))});return{_custom:{type:null,readOnly:!0,display:e.fullPath,tooltip:t,value:n}}}function re(e){return{_custom:{display:e}}}let Fn=0;function Yn(e,t,n){if(t.__hasDevtools)return;t.__hasDevtools=!0;const o=Fn++;Wt({id:"org.vuejs.router"+(o?"."+o:""),label:"Vue Router",packageName:"vue-router",homepage:"https://router.vuejs.org",logo:"https://router.vuejs.org/logo.png",componentStateTypes:["Routing"],app:e},r=>{typeof r.now!="function"&&console.warn("[Vue Router]: You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html."),r.on.inspectComponent((i,s)=>{i.instanceData&&i.instanceData.state.push({type:"Routing",key:"$route",editable:!1,value:ee(t.currentRoute.value,"Current Route")})}),r.on.visitComponentTree(({treeNode:i,componentInstance:s})=>{if(s.__vrv_devtools){const c=s.__vrv_devtools;i.tags.push({label:(c.name?`${c.name.toString()}: `:"")+c.path,textColor:0,tooltip:"This component is rendered by <router-view>",backgroundColor:_t})}T(s.__vrl_devtools)&&(s.__devtoolsApi=r,s.__vrl_devtools.forEach(c=>{let h=c.route.path,_=bt,w="",k=0;c.error?(h=c.error,_=to,k=no):c.isExactActive?(_=Et,w="This is exactly active"):c.isActive&&(_=wt,w="This link is active"),i.tags.push({label:h,textColor:k,tooltip:w,backgroundColor:_})}))}),tt(t.currentRoute,()=>{l(),r.notifyComponentUpdate(),r.sendInspectorTree(d),r.sendInspectorState(d)});const u="router:navigations:"+o;r.addTimelineLayer({id:u,label:`Router${o?" "+o:""} Navigations`,color:4237508}),t.onError((i,s)=>{r.addTimelineEvent({layerId:u,event:{title:"Error during Navigation",subtitle:s.fullPath,logType:"error",time:r.now(),data:{error:i},groupId:s.meta.__navigationId}})});let f=0;t.beforeEach((i,s)=>{const c={guard:re("beforeEach"),from:ee(s,"Current Location during this navigation"),to:ee(i,"Target location")};Object.defineProperty(i.meta,"__navigationId",{value:f++}),r.addTimelineEvent({layerId:u,event:{time:r.now(),title:"Start of navigation",subtitle:i.fullPath,data:c,groupId:i.meta.__navigationId}})}),t.afterEach((i,s,c)=>{const h={guard:re("afterEach")};c?(h.failure={_custom:{type:Error,readOnly:!0,display:c?c.message:"",tooltip:"Navigation Failure",value:c}},h.status=re("❌")):h.status=re("✅"),h.from=ee(s,"Current Location during this navigation"),h.to=ee(i,"Target location"),r.addTimelineEvent({layerId:u,event:{title:"End of navigation",subtitle:i.fullPath,time:r.now(),data:h,logType:c?"warning":"default",groupId:i.meta.__navigationId}})});const d="router-inspector:"+o;r.addInspector({id:d,label:"Routes"+(o?" "+o:""),icon:"book",treeFilterPlaceholder:"Search routes"});function l(){if(!p)return;const i=p;let s=n.getRoutes().filter(c=>!c.parent||!c.parent.record.components);s.forEach(St),i.filter&&(s=s.filter(c=>Se(c,i.filter.toLowerCase()))),s.forEach(c=>Pt(c,t.currentRoute.value)),i.rootNodes=s.map(Rt)}let p;r.on.getInspectorTree(i=>{p=i,i.app===e&&i.inspectorId===d&&l()}),r.on.getInspectorState(i=>{if(i.app===e&&i.inspectorId===d){const c=n.getRoutes().find(h=>h.record.__vd_id===i.nodeId);c&&(i.state={options:Xn(c)})}}),r.sendInspectorTree(d),r.sendInspectorState(d)})}function Jn(e){return e.optional?e.repeatable?"*":"?":e.repeatable?"+":""}function Xn(e){const{record:t}=e,n=[{editable:!1,key:"path",value:t.path}];return t.name!=null&&n.push({editable:!1,key:"name",value:t.name}),n.push({editable:!1,key:"regexp",value:e.re}),e.keys.length&&n.push({editable:!1,key:"keys",value:{_custom:{type:null,readOnly:!0,display:e.keys.map(o=>`${o.name}${Jn(o)}`).join(" "),tooltip:"Param keys",value:e.keys}}}),t.redirect!=null&&n.push({editable:!1,key:"redirect",value:t.redirect}),e.alias.length&&n.push({editable:!1,key:"aliases",value:e.alias.map(o=>o.record.path)}),Object.keys(e.record.meta).length&&n.push({editable:!1,key:"meta",value:e.record.meta}),n.push({key:"score",editable:!1,value:{_custom:{type:null,readOnly:!0,display:e.score.map(o=>o.join(", ")).join(" | "),tooltip:"Score used to sort routes",value:e.score}}}),n}const _t=15485081,wt=2450411,Et=8702998,Zn=2282478,bt=16486972,eo=6710886,to=16704226,no=12131356;function Rt(e){const t=[],{record:n}=e;n.name!=null&&t.push({label:String(n.name),textColor:0,backgroundColor:Zn}),n.aliasOf&&t.push({label:"alias",textColor:0,backgroundColor:bt}),e.__vd_match&&t.push({label:"matches",textColor:0,backgroundColor:_t}),e.__vd_exactActive&&t.push({label:"exact",textColor:0,backgroundColor:Et}),e.__vd_active&&t.push({label:"active",textColor:0,backgroundColor:wt}),n.redirect&&t.push({label:typeof n.redirect=="string"?`redirect: ${n.redirect}`:"redirects",textColor:16777215,backgroundColor:eo});let o=n.__vd_id;return o==null&&(o=String(oo++),n.__vd_id=o),{id:o,label:n.path,tags:t,children:e.children.map(Rt)}}let oo=0;const ro=/^\/(.*)\/([a-z]*)$/;function Pt(e,t){const n=t.matched.length&&G(t.matched[t.matched.length-1],e.record);e.__vd_exactActive=e.__vd_active=n,n||(e.__vd_active=t.matched.some(o=>G(o,e.record))),e.children.forEach(o=>Pt(o,t))}function St(e){e.__vd_match=!1,e.children.forEach(St)}function Se(e,t){const n=String(e.re).match(ro);if(e.__vd_match=!1,!n||n.length<3)return!1;if(new RegExp(n[1].replace(/\$$/,""),n[2]).test(t))return e.children.forEach(f=>Se(f,t)),e.record.path!=="/"||t==="/"?(e.__vd_match=e.re.test(t),!0):!1;const r=e.record.path.toLowerCase(),u=F(r);return!t.startsWith("/")&&(u.includes(t)||r.includes(t))||u.startsWith(t)||r.startsWith(t)||e.record.name&&String(e.record.name).includes(t)?!0:e.children.some(f=>Se(f,t))}function so(e,t){const n={};for(const o in e)t.includes(o)||(n[o]=e[o]);return n}function po(e){const t=On(e.routes,e),n=e.parseQuery||Bn,o=e.stringifyQuery||ze,r=e.history;if(!r)throw new Error('Provide the "history" option when calling "createRouter()": https://router.vuejs.org/api/interfaces/RouterOptions.html#history');const u=Z(),f=Z(),d=Z(),l=xt(H);let p=H;U&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const i=ge.bind(null,a=>""+a),s=ge.bind(null,rn),c=ge.bind(null,F);function h(a,g){let m,v;return pt(a)?(m=t.getRecordMatcher(a),m||y(`Parent route "${String(a)}" not found when adding child route`,g),v=g):v=a,t.addRoute(v,m)}function _(a){const g=t.getRecordMatcher(a);g?t.removeRoute(g):y(`Cannot remove non-existent route "${String(a)}"`)}function w(){return t.getRoutes().map(a=>a.record)}function k(a){return!!t.getRecordMatcher(a)}function A(a,g){if(g=C({},g||l.value),typeof a=="string"){const E=ve(n,a,g.path),$=t.resolve({path:E.path},g),K=r.createHref(E.fullPath);return K.startsWith("//")?y(`Location "${a}" resolved to "${K}". A resolved location cannot start with multiple slashes.`):$.matched.length||y(`No match found for location with path "${a}"`),C(E,$,{params:c($.params),hash:F(E.hash),redirectedFrom:void 0,href:K})}if(!se(a))return y(`router.resolve() was passed an invalid location. This will fail in production.
- Location:`,a),A({});let m;if(a.path!=null)"params"in a&&!("name"in a)&&Object.keys(a.params).length&&y(`Path "${a.path}" was passed with params but they will be ignored. Use a named route alongside params instead.`),m=C({},a,{path:ve(n,a.path,g.path).path});else{const E=C({},a.params);for(const $ in E)E[$]==null&&delete E[$];m=C({},a,{params:s(E)}),g.params=s(g.params)}const v=t.resolve(m,g),S=a.hash||"";S&&!S.startsWith("#")&&y(`A \`hash\` should always start with the character "#". Replace "${S}" with "#${S}".`),v.params=i(c(v.params));const x=ln(o,C({},a,{hash:tn(S),path:v.path})),b=r.createHref(x);return b.startsWith("//")?y(`Location "${a}" resolved to "${b}". A resolved location cannot start with multiple slashes.`):v.matched.length||y(`No match found for location with path "${a.path!=null?a.path:a}"`),C({fullPath:x,hash:S,query:o===ze?Dn(a.query):a.query||{}},v,{redirectedFrom:void 0,href:b})}function R(a){return typeof a=="string"?ve(n,a,l.value.path):C({},a)}function P(a,g){if(p!==a)return J(8,{from:g,to:a})}function I(a){return N(a)}function M(a){return I(C(R(a),{replace:!0}))}function D(a){const g=a.matched[a.matched.length-1];if(g&&g.redirect){const{redirect:m}=g;let v=typeof m=="function"?m(a):m;if(typeof v=="string"&&(v=v.includes("?")||v.includes("#")?v=R(v):{path:v},v.params={}),v.path==null&&!("name"in v))throw y(`Invalid redirect found:
${JSON.stringify(v,null,2)}
when navigating to "${a.fullPath}". A redirect must contain a name or path. This will break in production.`),new Error("Invalid redirect");return C({query:a.query,hash:a.hash,params:v.path!=null?{}:a.params},v)}}function N(a,g){const m=p=A(a),v=l.value,S=a.state,x=a.force,b=a.replace===!0,E=D(m);if(E)return N(C(R(E),{state:typeof E=="object"?C({},S,E.state):S,force:x,replace:b}),g||m);const $=m;$.redirectedFrom=g;let K;return!x&&je(o,v,m)&&(K=J(16,{to:$,from:v}),Te(v,v,!0,!1)),(K?Promise.resolve(K):$e($,v)).catch(O=>L(O)?L(O,2)?O:de(O):fe(O,$,v)).then(O=>{if(O){if(L(O,2))return je(o,A(O.to),$)&&g&&(g._count=g._count?g._count+1:1)>30?(y(`Detected a possibly infinite redirection in a navigation guard when going from "${v.fullPath}" to "${$.fullPath}". Aborting to avoid a Stack Overflow.
Are you always returning a new location within a navigation guard? That would lead to this error. Only return when redirecting or aborting, that should fix this. This might break in production if not fixed.`),Promise.reject(new Error("Infinite redirect in navigation guard"))):N(C({replace:b},R(O.to),{state:typeof O.to=="object"?C({},S,O.to.state):S,force:x}),g||$)}else O=Oe($,v,!0,b,S);return xe($,v,O),O})}function kt(a,g){const m=P(a,g);return m?Promise.reject(m):Promise.resolve()}function ce(a){const g=oe.values().next().value;return g&&typeof g.runWithContext=="function"?g.runWithContext(a):a()}function $e(a,g){let m;const[v,S,x]=io(a,g);m=_e(v.reverse(),"beforeRouteLeave",a,g);for(const E of v)E.leaveGuards.forEach($=>{m.push(V($,a,g))});const b=kt.bind(null,a,g);return m.push(b),q(m).then(()=>{m=[];for(const E of u.list())m.push(V(E,a,g));return m.push(b),q(m)}).then(()=>{m=_e(S,"beforeRouteUpdate",a,g);for(const E of S)E.updateGuards.forEach($=>{m.push(V($,a,g))});return m.push(b),q(m)}).then(()=>{m=[];for(const E of x)if(E.beforeEnter)if(T(E.beforeEnter))for(const $ of E.beforeEnter)m.push(V($,a,g));else m.push(V(E.beforeEnter,a,g));return m.push(b),q(m)}).then(()=>(a.matched.forEach(E=>E.enterCallbacks={}),m=_e(x,"beforeRouteEnter",a,g,ce),m.push(b),q(m))).then(()=>{m=[];for(const E of f.list())m.push(V(E,a,g));return m.push(b),q(m)}).catch(E=>L(E,8)?E:Promise.reject(E))}function xe(a,g,m){d.list().forEach(v=>ce(()=>v(a,g,m)))}function Oe(a,g,m,v,S){const x=P(a,g);if(x)return x;const b=g===H,E=U?history.state:{};m&&(v||b?r.replace(a.fullPath,C({scroll:b&&E&&E.scroll},S)):r.push(a.fullPath,S)),l.value=a,Te(a,g,m,b),de()}let X;function Ct(){X||(X=r.listen((a,g,m)=>{if(!Ne.listening)return;const v=A(a),S=D(v);if(S){N(C(S,{replace:!0}),v).catch(te);return}p=v;const x=l.value;U&&pn(Ue(x.fullPath,m.delta),ae()),$e(v,x).catch(b=>L(b,12)?b:L(b,2)?(N(b.to,v).then(E=>{L(E,20)&&!m.delta&&m.type===Y.pop&&r.go(-1,!1)}).catch(te),Promise.reject()):(m.delta&&r.go(-m.delta,!1),fe(b,v,x))).then(b=>{b=b||Oe(v,x,!1),b&&(m.delta&&!L(b,8)?r.go(-m.delta,!1):m.type===Y.pop&&L(b,20)&&r.go(-1,!1)),xe(v,x,b)}).catch(te)}))}let ue=Z(),Ie=Z(),ne;function fe(a,g,m){de(a);const v=Ie.list();return v.length?v.forEach(S=>S(a,g,m)):(y("uncaught error during route navigation:"),console.error(a)),Promise.reject(a)}function At(){return ne&&l.value!==H?Promise.resolve():new Promise((a,g)=>{ue.add([a,g])})}function de(a){return ne||(ne=!a,Ct(),ue.list().forEach(([g,m])=>a?m(a):g()),ue.reset()),a}function Te(a,g,m,v){const{scrollBehavior:S}=e;if(!U||!S)return Promise.resolve();const x=!m&&mn(Ue(a.fullPath,0))||(v||!m)&&history.state&&history.state.scroll||null;return Lt().then(()=>S(a,g,x)).then(b=>b&&hn(b)).catch(b=>fe(b,a,g))}const he=a=>r.go(a);let pe;const oe=new Set,Ne={currentRoute:l,listening:!0,addRoute:h,removeRoute:_,clearRoutes:t.clearRoutes,hasRoute:k,getRoutes:w,resolve:A,options:e,push:I,replace:M,go:he,back:()=>he(-1),forward:()=>he(1),beforeEach:u.add,beforeResolve:f.add,afterEach:d.add,onError:Ie.add,isReady:At,install(a){const g=this;a.component("RouterLink",Gn),a.component("RouterView",zn),a.config.globalProperties.$router=g,Object.defineProperty(a.config.globalProperties,"$route",{enumerable:!0,get:()=>Q(l)}),U&&!pe&&l.value===H&&(pe=!0,I(r.location).catch(S=>{y("Unexpected error when starting the router:",S)}));const m={};for(const S in H)Object.defineProperty(m,S,{get:()=>l.value[S],enumerable:!0});a.provide(le,g),a.provide(Ae,Ot(m)),a.provide(Pe,l);const v=a.unmount;oe.add(a),a.unmount=function(){oe.delete(a),oe.size<1&&(p=H,X&&X(),X=null,l.value=H,pe=!1,ne=!1),v()},U&&Yn(a,g,t)}};function q(a){return a.reduce((g,m)=>g.then(()=>ce(m)),Promise.resolve())}return Ne}function io(e,t){const n=[],o=[],r=[],u=Math.max(t.matched.length,e.matched.length);for(let f=0;f<u;f++){const d=t.matched[f];d&&(e.matched.find(p=>G(p,d))?o.push(d):n.push(d));const l=e.matched[f];l&&(t.matched.find(p=>G(p,l))||r.push(l))}return[n,o,r]}function mo(){return B(le)}function go(e){return B(Ae)}export{De as NavigationFailureType,Gn as RouterLink,zn as RouterView,H as START_LOCATION,lo as createMemoryHistory,po as createRouter,On as createRouterMatcher,co as createWebHashHistory,_n as createWebHistory,L as isNavigationFailure,ho as loadRouteLocation,Ce as matchedRouteKey,uo as onBeforeRouteLeave,fo as onBeforeRouteUpdate,Bn as parseQuery,Ae as routeLocationKey,le as routerKey,Pe as routerViewLocationKey,ze as stringifyQuery,Fe as useLink,go as useRoute,mo as useRouter,Qe as viewDepthKey};