@fox-js/fox 3.0.1-22 → 3.0.1-23

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/libs/index.cjs.js CHANGED
@@ -1,3 +1,3 @@
1
1
  "use strict";/*!
2
- * fox v3.0.0 Thu Apr 20 2023 19:50:32 GMT+0800 (中国标准时间)
3
- */Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("vue"),Nr=Array.isArray,Hr=r=>nt(r)==="[object Map]",Dr=r=>nt(r)==="[object Set]",Vr=r=>r instanceof Date,S=r=>typeof r=="function",Br=r=>typeof r=="string",Ur=r=>typeof r=="symbol",br=r=>r!==null&&typeof r=="object",kr=r=>br(r)&&S(r.then)&&S(r.catch),Wr=Object.prototype.toString,nt=r=>Wr.call(r),Ft=r=>nt(r)==="[object Object]",zr=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol";function Nt(r){return r.__esModule||zr&&r[Symbol.toStringTag]==="Module"}const Jr=typeof Promise<"u"&&Promise.toString().indexOf("[native code]")!==-1;function T(...r){let e=r[0]!==void 0&&r[0]!==null?r[0]:{},t=1,n=r.length,i=!1;for(typeof e=="boolean"&&(i=e,e=r[t]??{},t++),typeof e!="object"&&(e={});t<n;t++)if(r[t]!==null&&r[t]!==void 0){let s=r[t];for(let o in s){let a=e[o],l=s[o];if(a!==l)if(i===!0&&l&&typeof l=="object"){let u;Array.isArray(l)?u=a&&Array.isArray(a)?a:[]:u=a&&typeof a=="object"?a:{},e[o]=T(i,u,l)}else l!==void 0&&(e[o]=l)}}return e}function Oe(r,e,t=!1){if(!t)T(!0,r,e);else{if(typeof e!="object")return{};typeof r!="object"&&(r={});for(let i in e){let s=r[i],o=e[i];if(s!==o)if(typeof o=="object"){if(!Array.isArray(o)&&!Ft(o))continue;s=Oe(s,o,t),r[i]=s}else{if(typeof o=="function")continue;r[i]=o}}const n=Object.getOwnPropertySymbols(e);for(let i of n){let s=r[i],o=e[i];if(s!==o)if(typeof o=="object"){if(!Array.isArray(o)&&!Ft(o))continue;s=Oe(s,o,t),r[i]=s}else{if(typeof o=="function")continue;r[i]=o}}}return r}class oe{static seed=new Date().getTime();static get(){let e=++oe.seed;return e>=Number.MAX_VALUE&&(oe.seed=0),e}}const lt=Jr?Promise.resolve():null;function qe(r,...e){lt!==null?e&&e.length>0?lt.then(()=>{r(e)}):lt.then(r):e&&e.length>0?setTimeout(()=>{r(e)}):setTimeout(r)}function Ht(r){return r==null?!1:typeof r=="boolean"?r:typeof r=="string"?r.toLocaleLowerCase()==="true":!!r}function Gr(r){return typeof r=="number"?r:Number(r)}const Qr={"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object Array]":"array","[object Date]":"date","[object RegExp]":"regExp","[object Object]":"object"};function jt(r){let t=Object.prototype.toString.call(r);return r==null?String(r):Qr[t]||"object"}function Tt(r,e){if(r==e)return!0;if(r===void 0||e===void 0)return!1;let t=jt(r),n=jt(e);if(t!==n)return!1;if(t==="object"){let i=Object.keys(r),s=Object.keys(e);if(i.length!==s.length)return!1;for(let o=0;o<i.length;o++){let a=i[o],l=r[a],u=e[a];if(!Tt(l,u))return!1}return!0}else if(t==="array"){if(r.length!==e.length)return!1;for(let i=0;i<r.length;i++){let s=r[i],o=e[i];if(!Tt(s,o))return!1}return!0}return!1}const Zt=Symbol("idKey"),ce=Symbol("valueKey"),R=Symbol("childrenKey"),Q=Symbol("growKey");class xr{[Q]=!0;[Zt];[ce]=w.ref();[R]=new Map;constructor(e){this[Zt]=e}}class Xr{get(e,t){if(t=="value")return e[ce].value;if(t==="grow")return e[Q];let n=e[R].get(t);if(n)return Le(n);if(e[Q])return n=Vt(t),n[Q]=e[Q],e[R].set(t,n),Le(n)}set(e,t,n){return t=="value"?(e[ce].value=n,!0):t==="grow"?(e[Q]=Ht(n),!0):n==null?(e[R].delete(t),!0):(console.error(`illegal property:${t}`),!1)}deleteProperty(e,t){return t==="value"||t=="grow"?(console.error(`can not delete property:${String(t)}`),!1):(e[R].delete(t),!0)}}const Dt="__proxy__";function Vt(r){let e=new xr(r);return Reflect.set(e,Dt,new Proxy(e,new Xr)),e}function Le(r){return Reflect.get(r,Dt)}class Rr extends xr{constructor(){super("__root__")}put(...e){let t=e.length;if(t<2)return console.error("参数至少包括一个(key, value)"),!1;let n=this;for(let i=0;i<t-1;i++){let s=e[i],o;n[R].has(s)?o=n[R].get(s):(o=Vt(s),n[R].set(s,o)),n=o}return n[ce].value=e[t-1],!0}get(...e){let t=e.length;if(t===0)return;let n=this;for(let i=0;i<t;i++){let s=e[i];if(n[R].has(s))n=n[R].get(s);else return}return n[ce].value}remove(...e){let t=e.length;if(t==0)return!1;let n=this;for(let s=0;s<t-1;s++){let o=e[s];if(n[R].has(o))n=n[R].get(o);else return!1}let i=e[t-1];return n[R].has(i)?(n[R].delete(i),!0):!1}contains(...e){let t=e.length;if(t==0)return!1;let n=this;for(let s=0;s<t-1;s++){let o=e[s];if(n[R].has(o))n=n[R].get(o);else return!1}let i=e[t-1];return n[R].has(i)}clear(){this[R].clear()}}const Yr=["put","get","contains","remove","clear"];function er(r){return Yr.includes(r)}class Zr{get(e,t){if(t=="value")return e[ce].value;if(t==="grow")return e[Q];if(t===R)return e[R];if(typeof t=="string"&&er(t))return e[t];let n=String(t),i=e[R].get(n);if(i)return Le(i);if(e[Q])return i=Vt(n),i[Q]=e[Q],e[R].set(n,i),Le(i)}set(e,t,n){return t=="value"?(e[ce].value=n,!0):t==="grow"?(e[Q]=Ht(n),!0):er(t)?!1:n==null?(e[R].delete(t),!0):(console.error(`illegal property:${t}`),!1)}deleteProperty(e,t){return t==="value"||t=="grow"?(console.error(`can not delete property:${String(t)}`),!1):(e[R].delete(t),!0)}}function en(){let r=new Rr,e=new Zr,t=new Proxy(r,e);return Object.assign({put(...i){return Reflect.apply(r.put,r,i)},get(...i){return Reflect.apply(r.get,r,i)},remove(...i){return Reflect.apply(r.remove,r,i)},contains(...i){return Reflect.apply(r.contains,r,i)},clear(){return Reflect.apply(r.clear,r,[])}},t),Reflect.set(r,Dt,t),r}let $t=new Proxy(Rr,{construct(r,...e){let t=en();return Le(t)}});const ee="default",Sr=Symbol("sync"),H=Symbol("resolveRoute");function tr(r){let e=!1;return function(...t){if(!e)return e=!0,Reflect.apply(r,{},t)}}function tn(r){let e=r.src;return new Promise((t,n)=>{const i=tr(a=>{Nt(a)&&(a=a.default),r.component=a,console.debug("success load async module"),t()}),s=tr(a=>{console.debug("reject load async module"),n(a)});let o;try{o=e(i,s)}catch(a){s(a)}if(o)if(typeof o.then=="function")o.then(i,s);else{const a=o.component;a&&typeof a.then=="function"&&a.then(i,s)}})}class rn{name;level;rootName;rootIndex=0;constructor(e,t,n,i){this.name=e,this.level=t,this.rootName=n,this.rootIndex=i}}class et{to;routeModel;from;data={};constructor(e,t){this.to=e,this.from=t}static from(e){let t=new et(e.to,e.from),n=e.data??{};return T(!0,t.data,n),t}}class K{path;get fullPath(){const e=this.path??`/${this.name}`;return`${this.root??ee}!${e}`}alias;name;root;params;query;matched;meta;success;error;destroy;opsType;updateType;viewTagAttrs;index;active;slot;session;static clone(e,t){let n=new K;return Oe(n,e,t),n}static isSame(e,t){return e===t?!0:!(e==null||t==null||e.path&&e.path!==t.path||e.name&&e.name!==t.name||e.root!==t.root||e.index!==t.index)}static isSameForRouteModel(e,t){return e===t?!0:!(e==null||t==null||e.path&&e.path!=t.path||e.name&&e.name!=t.name)}static from(e){let t=new K;if(e==null)return t;let n=t;for(let s in e){let o=e[s];n[s]=o}const i=Object.getOwnPropertySymbols(e);if(Array.isArray(i)&&i.length>0)for(let s of i)n[s]=e[s];return t}}class nn{id;name;props;meta;src;component;constructor(e,t,n,i){this.id=oe.get(),this.name=e,this.src=t,typeof t!="function"&&(this.component=t),this.props=n,this.meta=i}get isResolved(){return this.component!==void 0}resolve(){return tn(this)}}class rr{models=[]}class at{path;match;redirect;name;layers=[]}const V=Symbol("chainKey"),N=Symbol("cursorKey"),ut=Symbol("$persistentModeKey"),j=Symbol("statusKey"),Y=Symbol("argsKey"),Ne=Symbol("exArgsKey"),de=Symbol("successFnsKey"),Se=Symbol("errorFnsKey"),se=Symbol("sessionKey"),Z=Symbol("_go");class Me{[V]=[];[N]=0;[ut]=!1;[j]="Free";[Y]=[];[Ne]=[];[de]=[];[Se]=[];[se];get session(){return this[se]}constructor(e,t=!1){this[se]=e,this[ut]=t}[Z](e,...t){let n=this[j];if(this[j]="Busy",this[N]+=e,this[N]<0&&(this[N]=0),this[Y]=t,n==="Exception"||n==="Reject"){let a=[{session:this[se]},...this[Ne]];for(;this[Se].length>0;)try{let l=this[Se].shift();typeof l=="function"&&qe(()=>{Reflect.apply(l,{},a)})}catch(l){console.error(l.message,l)}return this[j]=n,this[V]=[],this[N]=0,this}else if(n==="Finished"||this[N]>=this[V].length){let a=[{session:this[se]},...this[Y]];for(;this[de].length>0;){let l=this[de].shift();typeof l=="function"&&qe(()=>{Reflect.apply(l,{},a)})}return this[j]="Free",this}if(this[N]>=this[V].length)return this[j]="Free",this;let i=this[V][this[N]];this[ut]||(this[V].splice(0,this[N]+1),this[N]=-1);let s=this[N]+1;try{let o=!1,a={go:(l,...u)=>{o||(o=!0,Reflect.apply(this[Z],this,[l,...u]))},resolve:(...l)=>{o||(o=!0,Reflect.apply(this[Z],this,[1,...l]))},reject:(...l)=>{o||(o=!0,Reflect.apply(this.reject,this,[...l]))},insert:l=>{o||(this[V].splice(s,0,l),s++)},session:this[se]};qe(()=>{Reflect.apply(i,{},[a,...this[Y]])})}catch(o){this.throw(o)}return this}go(e,...t){return Reflect.apply(this[Z],this,[e,...t])}finish(...e){return this[j]="Finished",this[Y]=e,Reflect.apply(this[Z],this,[0])}reject(...e){return this[j]="Reject",this[Ne]=e,Reflect.apply(this[Z],this,[0])}throw(...e){return this[j]="Exception",this[Ne]=e,Reflect.apply(this[Z],this,[0])}reset(...e){this[j]="Busy",this[Y]=e,this[V]=[],this[N]=0;let n=[{session:this[se]},...this[Y]];for(;this[de].length>0;){let i=this[de].shift();qe(()=>{Reflect.apply(i,this,n)})}return this[j]="Free",this}post(e){return this[j]==="Reject"||this[j]==="Exception"?this:(Array.isArray(e)?this[V]=[...this[V],...e]:this[V].push(e),this[j]==="Busy"?this:(Reflect.apply(this[Z],this,[0,...this[Y]]),this))}wait(e,t){return e&&typeof e=="function"&&this[de].push(e),t&&typeof t=="function"&&this[Se].push(t),this[j]==="Busy"?this:(Reflect.apply(this[Z],this,[0,...this[Y]]),this)}exception(e){return e&&typeof e=="function"&&this[Se].push(e),this[j]==="Busy"?this:Reflect.apply(this[Z],this,[0,...this[Y]])}isFinish(){return this[j]=="Reject"||this[j]=="Free"&&this[N]>=this[V].length}}const ye=Symbol("registerKey");class sn{policy;callback;constructor(e,t){this.callback=e,this.policy=t}}class _t{[ye]=new Map;constructor(){}on(e,t,n=!1){let i=this[ye].get(e);i||(i=new Array,this[ye].set(e,i));let s=n===!0?1:0,o=new sn(t,s);return i.push(o),this}off(e,t){if(!t)return this[ye].delete(e),this;let n=this[ye].get(e);if(n){for(let i=0;i<n.length;i++)if(n[i].callback===t){n.splice(i,1);break}}return this}bind(e,t,n=!1){return this.on(e,t,n)}unbind(e,t){return this.off(e,t)}once(e,t){return this.on(e,t,!0)}all(...e){let t=e.length;if(t<1)return this;let n=e[t-1];if(typeof n!="function")return console.error("callback can not benn empty"),this;let i=t-1,s=new Array(i),o=[].splice.call(e,0,i);for(let a=0;a<o.length;a++)this.once(o[a],l=>{s[a]=l,i-=1,i==0&&Reflect.apply(n,{},s)});return this}emit(e,...t){let n=this[ye].get(e);if(!n)return this;for(let i=0;i<n.length;){let s=n[i];if(s.policy==1?n.splice(i,1):i++,typeof s.callback=="function")try{qe(()=>{Reflect.apply(s.callback,{},t)})}catch(o){console.error(o.message,o)}}return this}trigger(e,...t){return Reflect.apply(this.emit,this,[e,...t])}}const Pe=Symbol("registerKey");class on{[Pe]=new Map;constructor(){}set(e,t){this[Pe].set(e,t)}get(e){return this[Pe].get(e)}has(e){return this[Pe].has(e)}delete(e){return this[Pe].delete(e)}}const fe=Symbol("lc");function tt(r,e=!1){let t=r;if(Reflect.has(t,fe))return t[fe];if(e){const n=new on;return t[fe]=n,n}return null}function Pr(r,e=!1){let t=null,n=r;for(;n&&!(Reflect.has(n,fe)&&(t=n[fe],t));)n=n.$parent;if(!t&&e){const i=r;i&&i.$parent&&(t=tt(i.$parent,e))}return t}function Bt(r,e){let t=r;for(;t;){if(Reflect.has(t,fe)){const n=t[fe];if(n.has(e))return n.get(e)}t=t.$parent}return null}function ln(r,e,t){Pr(r,!0)?.set(e,t)}function an(r,e){Pr(r,!0)?.delete(e)}function nr(r){if(Array.isArray(r.children)&&r.children.length>0){let e=r.children[0];if(e!=null&&e.component!=null&&e.component.proxy!=null)return tt(e.component.proxy,!1)}return null}const rt=Symbol("hooksKey");function un(r){let e=r.get(rt);e||(e=[],r.set(rt,e))}function ir(r,e){let t=r.get(rt);if(t!=null)for(let n=t.length-1;n>=0;n--){let i=t[n];if(i.type===e)try{Reflect.apply(i.hook,i.target,[])}catch(s){console.error(s.message,s)}}}var Kt=(r=>(r.DEACTIVATED="da",r.ACTIVATED="a",r))(Kt||{});class fn{type;hook;target;constructor(e,t,n){this.target=n,this.hook=t,this.type=e}}function cn(r,e,t,n){let i=new fn(e,t,n);return r.push(i),!0}function hn(r,e,t,n){let i=-1;for(let s=0;s<r.length;s++){let o=r[s];if(o.type===e&&o.hook===t&&o.target===n){i=s;break}}return i!=-1?(r.splice(i,1),!0):!1}function Cr(r){return(e,t)=>{let n;if(t)n=t;else{const s=w.getCurrentInstance();if(s==null||s.proxy==null){console.error("can not get current instance or proxy");return}n=s.proxy}const i=Bt(n,rt);if(i==null){console.warn("can not get hooks context");return}w.onUnmounted(()=>{hn(i,r,e,n)}),cn(i,r,e,n)}}let dn=Cr("a"),yn=Cr("da");const qt=Symbol("routeKey");function sr(r,e){r.set(qt,e)}function Ut(r){let e=Bt(r,qt);return typeof e=="function"?e():e??null}const it=Symbol("rk"),ft=Symbol("vd"),or=Symbol("rv"),ct=Symbol("rvi"),lr=Symbol("pv"),ht=Symbol("pvi");function pn(r){for(var e=[],t=0;t<r.length;){var n=r[t];if(n==="*"||n==="+"||n==="?"){e.push({type:"MODIFIER",index:t,value:r[t++]});continue}if(n==="\\"){e.push({type:"ESCAPED_CHAR",index:t++,value:r[t++]});continue}if(n==="{"){e.push({type:"OPEN",index:t,value:r[t++]});continue}if(n==="}"){e.push({type:"CLOSE",index:t,value:r[t++]});continue}if(n===":"){for(var i="",s=t+1;s<r.length;){var o=r.charCodeAt(s);if(o>=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122||o===95){i+=r[s++];continue}break}if(!i)throw new TypeError("Missing parameter name at ".concat(t));e.push({type:"NAME",index:t,value:i}),t=s;continue}if(n==="("){var a=1,l="",s=t+1;if(r[s]==="?")throw new TypeError('Pattern cannot start with "?" at '.concat(s));for(;s<r.length;){if(r[s]==="\\"){l+=r[s++]+r[s++];continue}if(r[s]===")"){if(a--,a===0){s++;break}}else if(r[s]==="("&&(a++,r[s+1]!=="?"))throw new TypeError("Capturing groups are not allowed at ".concat(s));l+=r[s++]}if(a)throw new TypeError("Unbalanced pattern at ".concat(t));if(!l)throw new TypeError("Missing pattern at ".concat(t));e.push({type:"PATTERN",index:t,value:l}),t=s;continue}e.push({type:"CHAR",index:t,value:r[t++]})}return e.push({type:"END",index:t,value:""}),e}function Er(r,e){e===void 0&&(e={});for(var t=pn(r),n=e.prefixes,i=n===void 0?"./":n,s="[^".concat(ge(e.delimiter||"/#?"),"]+?"),o=[],a=0,l=0,u="",f=function(A){if(l<t.length&&t[l].type===A)return t[l++].value},c=function(A){var P=f(A);if(P!==void 0)return P;var C=t[l],W=C.type,M=C.index;throw new TypeError("Unexpected ".concat(W," at ").concat(M,", expected ").concat(A))},h=function(){for(var A="",P;P=f("CHAR")||f("ESCAPED_CHAR");)A+=P;return A};l<t.length;){var d=f("CHAR"),v=f("NAME"),p=f("PATTERN");if(v||p){var y=d||"";i.indexOf(y)===-1&&(u+=y,y=""),u&&(o.push(u),u=""),o.push({name:v||a++,prefix:y,suffix:"",pattern:p||s,modifier:f("MODIFIER")||""});continue}var m=d||f("ESCAPED_CHAR");if(m){u+=m;continue}u&&(o.push(u),u="");var g=f("OPEN");if(g){var y=h(),$=f("NAME")||"",x=f("PATTERN")||"",_=h();c("CLOSE"),o.push({name:$||(x?a++:""),pattern:$&&!x?s:x,prefix:y,suffix:_,modifier:f("MODIFIER")||""});continue}c("END")}return o}function vn(r,e){return mn(Er(r,e),e)}function mn(r,e){e===void 0&&(e={});var t=kt(e),n=e.encode,i=n===void 0?function(l){return l}:n,s=e.validate,o=s===void 0?!0:s,a=r.map(function(l){if(typeof l=="object")return new RegExp("^(?:".concat(l.pattern,")$"),t)});return function(l){for(var u="",f=0;f<r.length;f++){var c=r[f];if(typeof c=="string"){u+=c;continue}var h=l?l[c.name]:void 0,d=c.modifier==="?"||c.modifier==="*",v=c.modifier==="*"||c.modifier==="+";if(Array.isArray(h)){if(!v)throw new TypeError('Expected "'.concat(c.name,'" to not repeat, but got an array'));if(h.length===0){if(d)continue;throw new TypeError('Expected "'.concat(c.name,'" to not be empty'))}for(var p=0;p<h.length;p++){var y=i(h[p],c);if(o&&!a[f].test(y))throw new TypeError('Expected all "'.concat(c.name,'" to match "').concat(c.pattern,'", but got "').concat(y,'"'));u+=c.prefix+y+c.suffix}continue}if(typeof h=="string"||typeof h=="number"){var y=i(String(h),c);if(o&&!a[f].test(y))throw new TypeError('Expected "'.concat(c.name,'" to match "').concat(c.pattern,'", but got "').concat(y,'"'));u+=c.prefix+y+c.suffix;continue}if(!d){var m=v?"an array":"a string";throw new TypeError('Expected "'.concat(c.name,'" to be ').concat(m))}}return u}}function gn(r,e){var t=[],n=Ar(r,t,e);return wn(n,t,e)}function wn(r,e,t){t===void 0&&(t={});var n=t.decode,i=n===void 0?function(s){return s}:n;return function(s){var o=r.exec(s);if(!o)return!1;for(var a=o[0],l=o.index,u=Object.create(null),f=function(h){if(o[h]===void 0)return"continue";var d=e[h-1];d.modifier==="*"||d.modifier==="+"?u[d.name]=o[h].split(d.prefix+d.suffix).map(function(v){return i(v,d)}):u[d.name]=i(o[h],d)},c=1;c<o.length;c++)f(c);return{path:a,index:l,params:u}}}function ge(r){return r.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function kt(r){return r&&r.sensitive?"":"i"}function bn(r,e){if(!e)return r;for(var t=/\((?:\?<(.*?)>)?(?!\?)/g,n=0,i=t.exec(r.source);i;)e.push({name:i[1]||n++,prefix:"",suffix:"",modifier:"",pattern:""}),i=t.exec(r.source);return r}function xn(r,e,t){var n=r.map(function(i){return Ar(i,e,t).source});return new RegExp("(?:".concat(n.join("|"),")"),kt(t))}function Rn(r,e,t){return Sn(Er(r,t),e,t)}function Sn(r,e,t){t===void 0&&(t={});for(var n=t.strict,i=n===void 0?!1:n,s=t.start,o=s===void 0?!0:s,a=t.end,l=a===void 0?!0:a,u=t.encode,f=u===void 0?function(M){return M}:u,c=t.delimiter,h=c===void 0?"/#?":c,d=t.endsWith,v=d===void 0?"":d,p="[".concat(ge(v),"]|$"),y="[".concat(ge(h),"]"),m=o?"^":"",g=0,$=r;g<$.length;g++){var x=$[g];if(typeof x=="string")m+=ge(f(x));else{var _=ge(f(x.prefix)),A=ge(f(x.suffix));if(x.pattern)if(e&&e.push(x),_||A)if(x.modifier==="+"||x.modifier==="*"){var P=x.modifier==="*"?"?":"";m+="(?:".concat(_,"((?:").concat(x.pattern,")(?:").concat(A).concat(_,"(?:").concat(x.pattern,"))*)").concat(A,")").concat(P)}else m+="(?:".concat(_,"(").concat(x.pattern,")").concat(A,")").concat(x.modifier);else x.modifier==="+"||x.modifier==="*"?m+="((?:".concat(x.pattern,")").concat(x.modifier,")"):m+="(".concat(x.pattern,")").concat(x.modifier);else m+="(?:".concat(_).concat(A,")").concat(x.modifier)}}if(l)i||(m+="".concat(y,"?")),m+=t.endsWith?"(?=".concat(p,")"):"$";else{var C=r[r.length-1],W=typeof C=="string"?y.indexOf(C[C.length-1])>-1:C===void 0;i||(m+="(?:".concat(y,"(?=").concat(p,"))?")),W||(m+="(?=".concat(y,"|").concat(p,")"))}return new RegExp(m,kt(t))}function Ar(r,e,t){return r instanceof RegExp?bn(r,e):Array.isArray(r)?xn(r,e,t):Rn(r,e,t)}var F=(r=>(r[r.Push=0]="Push",r[r.Replace=1]="Replace",r[r.Put=2]="Put",r[r.Append=3]="Append",r[r.Open=4]="Open",r))(F||{}),Xe=(r=>(r[r.Part=0]="Part",r[r.All=1]="All",r))(Xe||{});const G=Symbol("rootKey"),J=Symbol("rootNodeKey"),ue=Symbol("parentNodeKey"),Ye=Symbol("nameKey");class re{instance=null;model;route;active=!0;index=0;constructor(e,t,n=0,i=!0){this.route=e,this.model=t,this.index=n,this.active=i}}class Ce{_slots;get slots(){return this._slots==null&&(this._slots=w.shallowRef([])),this._slots}get empty(){return this._slots==null||this._slots.value.length==0}[Ye];[G];[J]=null;[ue]=null;get name(){return this[Ye]}constructor(e,t,n){this[Ye]=e,this[G]=t,n&&(this[J]=n)}}class B{view;index;level;constructor(e,t,n){this.view=e,this.index=t,this.level=n}static include(e,t){for(let n=0;n<e.length;n++){let i=e[n];if(i.view===t.view&&(t.index==-1||i.index===t.index)&&i.level===t.level)return!0}return!1}}class dt{views=[]}class Pn{layers=[]}class Cn{time;route}class En{forbidTime=300;submitRecorder=new Cn;isSameRoute(e,t){return e==null||t==null?!1:e.name===t.name&&e.path===t.path&&e.root===t.root}acquire(e){let t=new Date().getTime();if(this.isSameRoute(e,this.submitRecorder.route)&&this.submitRecorder.time&&t-this.submitRecorder.time<=this.forbidTime){this.submitRecorder.time=t;return}return this.submitRecorder.route=e,this.submitRecorder.time=t,t}release(e){this.submitRecorder.time===e&&(this.submitRecorder.route=void 0)}}const we=Symbol("_notifyChange");class ar{currentRoute;routes;constructor(e,t){this.currentRoute=e,this.routes=t}}const Ie=typeof window<"u",L=function(){return window},He=function(){return window.document};function An(r){let e=r,t=e.lastIndexOf("/");return t>0&&t<e.length-1?e=e.substring(0,t+1):t===0&&e.indexOf(".")!==-1?e="/":t===-1&&(e.indexOf(".")==-1?e=`/${e}/`:e="/"),e.indexOf("/")!==0&&(e=`/${e}`),e}function yt(){if(!Ie)return"/";let r=L().location,e=`${r.protocol}//${r.host}`;return e+=An(r.pathname),e}function Ot(r,e,t){r.addEventListener?r.addEventListener(e,t,!1):r.attachEvent?r.attachEvent(`on${e}`,t):r[`on${e}`]=t}function Lt(r,e,t){r.removeEventListener?r.removeEventListener(e,t):r.detachEvent?r.detachEvent(`on${e}`,t):r[`on${e}`]=null}const De=Symbol("ignoreHistoryChangeOnceKey"),ur=Symbol("_navigateFirstRoute"),Ve=Symbol("_getRouteMark"),pt=Symbol("_getUrlSearch"),vt=Symbol("_generateLocation"),Ee=Symbol("_setRouteMarkRecorder"),Ae=Symbol("beforeRestoreFiltersKey"),fr=Symbol("_beforeRestore"),cr="Symbol(_fox_restore_point)";function mt(r,...e){return typeof r=="function"?Reflect.apply(r,null,[...e]):r}class Fr{base;storage;mode;query;firstNavigate=!0;historyMonitor;traceless=!1;changeHandler;historyChange;[De]=!1;[Ae]=new Array;constructor(e="hash",t="",n="",i=!0,s=!0,o=!1,a){this.mode=e,this.base=t,this.query=n,this.firstNavigate=i,this.historyMonitor=s,this.traceless=o,this.storage=a??L().sessionStorage}init(e=!0){const t=L();return typeof this.historyChange!="function"&&(this.historyChange=()=>{if(this[De]){this[De]=!1;return}if(mt(this.historyMonitor)){const n=t.history.state;this[we](n);try{let i=[];if(typeof n=="string"?i=JSON.parse(n):i=n,Array.isArray(i)&&i.length>0){const s=this[Ve]()??"/";this[Ee](s,i)}}catch{}}}),Ot(t,"popstate",this.historyChange),this.firstNavigate&&e&&this[ur](),Promise.resolve()}destroy(){if(this.historyChange){const e=L();Lt(e,"popstate",this.historyChange)}}[fr](e,t,n,i){for(let s of this[Ae])try{const o=[],a=Reflect.apply(s,{},[e,t,n,i]);if(a===!1)return a}catch(o){console.error(o.message,o)}return!0}beforeRestoreEach(e){this[Ae].push(e)}removeBeforeRestoreEach(e){const t=this[Ae].indexOf(e);return t!==-1?(this[Ae].splice(t,1),!0):!1}[ur](){const e=this[Ve]()??"/",t=this.storage.getItem(cr);if(t)try{const o=JSON.parse(t);if(o.mark===e&&Array.isArray(o.routes)&&o.routes.length>0){const a=o.routes.filter((l,u)=>this[fr](l,u,e,o.routes));if(a.length>0){const l=this[pt](),u=a.length-1;a[u].query=l||a[u].query,this[we](a);return}}}catch{}const n=e.indexOf("!");let i;n!=-1?i=e.substring(n+1):i=e;const s=new K;s.path=i,s.query=this[pt](),this[we]([s])}[Ee](e,t){try{const i=JSON.stringify({mark:e,routes:t});this.storage.setItem(cr,i)}catch(n){console.error(n.message,n)}}setRestorePoint(e){const t=this[Ve]()??"/";this[Ee](t,e)}[we](e){typeof this.changeHandler=="function"&&this.changeHandler(e)}[Ve](){const e=L();if(this.mode==="path"){let t=e.location.pathname;return this.base&&t.indexOf(this.base)===0&&(t=t.substring(this.base.length)),t}else{const t=e.location.hash,n=t.indexOf("#");if(n!=-1)return t.substring(n+1)}return null}[pt](){let t=L().location.search;return t.length>0&&t.indexOf("?")===0&&(t=t.substring(1)),t}listen(e){this.changeHandler=e}go(e,t=!0){const n=L();this[De]=!t,n.history.go(e)}push(e){const t=this[vt](e.currentRoute);mt(this.traceless,e.currentRoute)||L().history.pushState(e.routes,"",t);const n=e.currentRoute.fullPath;this[Ee](n,e.routes)}replace(e){const t=this[vt](e.currentRoute);mt(this.traceless,e.currentRoute)||L().history.replaceState(e.routes,"",t);const n=e.currentRoute.fullPath;this[Ee](n,e.routes)}[vt](e){const t=L();let n="";if(e.query){let a="";if(typeof e.query=="object")for(let l of Reflect.ownKeys(e.query)){let u=encodeURIComponent(e.query[l]),f=`${encodeURIComponent(String(l))}=${u}`;a.length>0&&(a+="&"),a+=f}else a=e.query;this.query?(n=a.length>0?`${this.query}&${a}`:this.query,n.length>0&&n.charAt(0)!=="?"&&(n=`?${n}`)):a.length>0&&(n=`?${a}`)}const i=t.location;let s=e.alias??e.fullPath;s.startsWith(ee)&&(s=s.substring(ee.length+1));let o;return n?this.mode=="path"?s.indexOf("/")===0?o=`${this.base}${s}${n}`:o=`${this.base}/${s}${n}`:o=`${i.pathname}${n}#${s}`:this.mode=="path"?s.indexOf("/")===0?o=`${this.base}${s}`:o=`${this.base}/${s}`:o=`${i.pathname}#${s}`,`${i.origin}${o}`}}function Fn(r=!0,e=null,t="",n=!0,i=!1,s){return e!==null&&(e=L().location.pathname),e&&e.endsWith("/")&&(e=e.substring(0,e.length-1)),new Fr("path",e??"",t,r,n,i,s)}function jr(r=!0,e="",t=!0,n=!1,i){return new Fr("hash","",e,r,t,n,i)}class jn{maxSize=50;cursor=-1;queue=[];changeHandler;base;historyMonitor=!1;traceless=!1;constructor(e,t=50){this.base=e,this.maxSize=t}init(e=!0){return Promise.resolve()}destroy(){this.queue=[]}beforeRestoreEach(e){}removeBeforeRestoreEach(e){return!1}listen(e){this.changeHandler=e}[we](e){typeof this.changeHandler=="function"&&this.changeHandler(e)}go(e,t=!0){if(this.queue.length==0||this.cursor<=0||this.cursor>=this.queue.length-1)return;let n=this.cursor+e;if(n<0?n=0:n>this.queue.length-1&&(n=this.queue.length-1),n!=this.cursor&&(this.cursor=n,t)){const i=this.queue[n];this[we](i.routes)}}push(e){this.queue.length>=this.maxSize&&this.queue.splice(0,1),this.queue.push(e),this.cursor=this.queue.length-1}replace(e){let t=this.queue.length-this.cursor;this.queue.splice(this.cursor,t),this.queue[this.cursor]=e}setRestorePoint(e){}}function Tr(r="",e=50){return new jn(r,e)}const Be=Symbol("_constructRouteModel"),Ue=Symbol("_findRouteModel"),gt=Symbol("_findRootView"),hr=Symbol("_getFirstView"),le=Symbol("_removeView"),dr=Symbol("_buildPage"),yr=Symbol("_resolveComponent"),pr=Symbol("_update"),ne=Symbol("_merge"),wt=Symbol("_handleHistoryChange"),ke=Symbol("_handleRouteUpdated"),We=Symbol("routeUpdatedCallback"),b=Symbol("currentRoutes"),pe=Symbol("current"),vr=Symbol("_addRouteRecorder"),Fe=Symbol("_removeRouteRecorder"),ze=Symbol("_cloneRouteRecorder"),q=Symbol("_handleError"),Je=Symbol("errorCallback"),U=Symbol("registerKey"),Ge=Symbol("notFoundKey"),bt=Symbol("notFoundPathKey"),k=Symbol("forestKey"),E=Symbol("historyKey"),je=Symbol("beforeFiltersKey"),Te=Symbol("afterFiltersKey"),$e=Symbol("destroyFiltersKey"),ve=Symbol("mainDispatcherKey"),xt=Symbol("initKey"),ae=Symbol("readyKey"),Rt=Symbol("readyHandlersKey"),Qe=Symbol("_markReady"),mr=Symbol("_createNextFn"),St=Symbol("_start"),Pt=Symbol("_before"),Ct=Symbol("_after"),gr=Symbol("_destroy"),Et=Symbol("_load"),_e=Symbol("_unload"),Ke=Symbol("routerGuardKey");function Tn(r){return r.layers.length==0||r.layers[0].views.length==0}function $n(r){let e=[];return r.layers.forEach(t=>{t.models==null||t.models==null||t.models.forEach(n=>{if(!(n==null||n==null))if(typeof n.meta=="object"){let i=T(!0,{},n.meta);e.push(i)}else n.meta&&e.push(n.meta)})}),e}class _n{[U]=new Array;[Ge];[bt]="*";[ae]=!1;[Rt]=[];[k]=new Pn;[E];[b]=new Array;[Je]=null;[We]=null;[je]=new Array;[Te]=new Array;[$e]=new Array;[ve]=new Me;[Ke]=new En;[xt]=!1;[pe]=w.ref(null);get current(){return this[pe].value}options;constructor(e){this.options=e??{},this.options.notFoundPath&&this.setNotFoundPath(this.options.notFoundPath);let t=this.options.routes||[];this.addRoutes(t),this.options.notFound&&this.setNotFoundRoute(this.options.notFound),e.history?this[E]=e.history:this[E]=Ie?jr():Tr(),this[E]?.listen(async n=>{let i=!0;try{if(typeof n=="string"){const s=this[H](n);s&&await this[wt]([s])}else await this[wt](n)}catch(s){console.error(s.message,s),i=!1}this[ae]===!1&&this[Qe](i)})}[q](e="error",t){if(t&&typeof t.error=="function")try{t.error(e)}catch{}if(typeof this[Je]=="function")try{this[Je](e,t)}catch{}console.error(e)}init(){this[xt]!==!0&&(this[E]?.init(!this[ae]),this[xt]=!0)}isReady(){return this[ae]?Promise.resolve():new Promise((e,t)=>{this[Rt].push([e,t])})}[Qe](e){this[ae]=!0,this[Rt].forEach(([t,n])=>{try{e?t():n()}catch(i){console.error(i.message,i)}})}[wt](e){try{if(!e){let o=[...this[b]].reverse();return this[_e](o),Ie&&L().location.reload(),Promise.resolve()}let t=null,n=[],i=[],s=0;for(;s<e.length&&s<this[b].length&&K.isSame(e[s],this[b][s]);s++)e[s].active===!0&&e[s].active!==this[b][s].active&&(t=e[s]);if(s<e.length&&(n=e.slice(s)),s<this[b].length&&(i=this[b].slice(s).reverse()),i.length===0&&n.length===0){if(t!==null)return this.restore([t])}else if(i.length>0){if(this[_e](i)){if(n.length>0)return this.restore(n);if(t!==null)return this.restore([t])}}else return this.restore(n)}catch(t){this[q](t)}return Promise.resolve()}[ke](e){if(e)this[pe].value=e;else{let t=this[b].length;t>0?this[pe].value=this[b][t-1]:this[pe].value=null}if(typeof this[We]=="function")try{this[We](this[pe].value)}catch{}}[vr](e){if(e.opsType===F.Open){let t=!1;const n=this[b].length-1;for(let i=n;i>=0;i--){const s=this[b][i];if(e.root==s.root){if(e.path===s.path){this[b].splice(i,1,e),t=!0;continue}e.active&&(s.active=!1)}}t||this[b].push(e)}else this[b].push(e)}[ze](){let e=[];for(let t of this[b]){let n=K.clone(t,!0);e.push(n)}return e}[Fe](e){if(!this[b])return;let t=-1;for(let n=0;n<this[b].length;n++)if(K.isSame(this[b][n],e)){t=n;break}if(t!=-1){let n=this[b][t];this[b].splice(t,1),this[gr](n,n.session)}}set historyMonitor(e){this[E]&&(this[E].historyMonitor=e)}get historyMonitor(){return this[E]?this[E].historyMonitor:!1}set traceless(e){this[E]&&(this[E].traceless=e)}get traceless(){return this[E]?this[E].traceless:!1}setRestorePoint(){const e=this[ze]();this[E]?.setRestorePoint(e)}onRouteUpdated(e){this[We]=e}onError(e){this[Je]=e}beforeEach(e){this[je].push(e)}removeBeforeEach(e){const t=this[je].indexOf(e);return t!==-1?(this[je].splice(t,1),!0):!1}afterEach(e){this[Te].push(e)}removeAfterEach(e){const t=this[Te].indexOf(e);return t!==-1?(this[Te].splice(t,1),!0):!1}destroyEach(e){this[$e].push(e)}removeDestroyEach(e){const t=this[$e].indexOf(e);return t!==-1?(this[$e].splice(t,1),!0):!1}beforeRestoreEach(e){this[E]?.beforeRestoreEach(e)}removeBeforeRestoreEach(e){return this[E]?.removeBeforeRestoreEach(e)??!1}addRoutes(e){for(let t of e)this.addRoute(t)}addRoute(e,t=-1){if(e.path===this[bt]){this.setNotFoundRoute(e);return}const n=this[Be](e);if(t==-1)this[U]=[...this[U],...n];else for(let i=n.length-1;i>=0;i--)this[U].splice(t,0,n[i])}removeRoute(e){const t=this[H](e);if(t===null)return console.warn("route格式错误",e),!1;for(let n=0;n<this[U].length;n++){const i=this[U][n];if(t?.path&&i.path===t.path)return this[U].splice(n,1),!0;if(t?.name&&i.name===t.name)return this[U].splice(n,1),!0}return!1}hasRoute(e){const t=this[H](e);return t===null?(console.warn("route格式错误",e),!1):this[U].findIndex(i=>{if(t?.path&&i.path===t.path||t?.name&&i.name===t.name)return!0})!==-1}setNotFoundPath(e){this[bt]=e}setNotFoundRoute(e){const t=this[Be](e);this[Ge]=t[0]}getRoutes(){return[...this[U]]}[Be](e){let t=e.path??"";t.length>0&&t.charAt(0)!=="/"&&(t=`/${t}`);let n=e.components??(e.component&&{"":e.component});if(n==null){const a=new at;return a.path=t,a.redirect=e.redirect,[a]}let i=[];for(let a in n){let l=n[a];a.length===0&&(a=ee);let u=new nn(a,l,e.props,e.meta);i.push(u)}let s=!1,o=[];if(e.children)for(let a of e.children){let l=this[Be](a);for(let u of l){let f=new at;f.name=u.name,u.path&&u.path.length>0?t!=="/"?f.path=`${t}${u.path}`:f.path=u.path:(s=!0,f.path=t);let c=new rr;c.models=[...i],f.layers=[c,...u.layers],o.push(f)}}if(!s){const a=new rr;a.models=i;const l=new at;l.name=e.name,l.path=t,l.layers=[a],o.splice(0,0,l)}return o}[Ue](e){const t=e.route;try{for(let n of this[U])if(t.path&&n.path){let i=n.match;i||(i=n.match=gn(n.path));let s=i(t.path);if(!s)continue;if(n.redirect){let o=new K;T(!0,o,t),o.path=n.redirect;let a={route:o,find:void 0};return this[Ue](a)?(e.route=a.route,e.find=a.find,!0):!1}if(t.params=t.params??{},T(!0,t.params,s.params),t.query){let o=t.query;if(typeof o=="string"){let a={},l=o.split("&");for(let u of l){let f=u.split("=");if(f.length!==2)continue;let c=decodeURIComponent(f[0].trim()),h=decodeURIComponent(f[1].trim());a[c]=h}T(!0,t.params,a)}else typeof o=="object"&&T(!0,t.params,o)}return e.find=n,!0}else if(t.name===n.name){t.params=t.params??{};let i=vn(n.path);return t.path=i(t.params),e.find=n,!0}}catch(n){console.error(n.message,n),typeof t.error=="function"&&t.error(n.message)}return!1}[H](e){let t=null;if(Array.isArray(e))if(t=new K,typeof e[0]=="object")t=K.from(e[0]);else for(let n=0;n<e.length;n++)n===0?e[n].charAt(0)==="/"?t.path=e[n]:t.name=e[n]:n===1?t.params=e[n]:n===2?t.root=e[n]:n===3&&T(!1,t,e[n]);else typeof e=="object"?t=K.from(e):typeof e=="string"&&(t=new K,e.charAt(0)=="/"?t.path=e:t.name=e);if(t){if(t.path){let n=t.path.indexOf("?");n!==-1&&n<t.path.length-1&&(t.query=t.path.substring(n+1),t.path=t.path.substring(0,n))}t.root=t.root??ee,t.opsType=t.opsType??this.options.defaultOperationType??F.Push}return t}push(...e){let t=this[H](e);return t?(t.opsType=t.opsType||F.Push,this.to(t)):(this[q]("resolve route fail",t),this)}put(...e){let t=this[H](e);return t?(t.opsType=F.Put,this.to(t)):(this[q]("resolve route fail",t),this)}replace(...e){let t=this[H](e);return t?(t.opsType=F.Replace,this.to(t)):(this[q]("resolve route fail",t),this)}append(...e){let t=this[H](e);return t?(t.opsType=F.Append,this.to(t)):(this[q]("resolve route fail",t),this)}remove(e){return new Promise(t=>{this[ve].post(n=>{try{if(this[b].length===0){n.resolve(),t(!1);return}let i=-1,s,o=[];if(e){if(e.root?s=e.root:s=this[b][0].root??ee,e.all)for(let l=this[b].length-1;l>0;l--){let u=this[b][l];u.opsType===F.Append&&u.root===s&&(o.splice(0,0,u),i=l-1)}else if(e.until)for(let l=this[b].length-1;l>0;l--){let u=this[b][l];if(u.opsType===F.Append&&u.root===s){if(e.until.charAt(0)==="/"&&e.until===u.path){i=l;break}else if(e.until===u.name){i=l;break}o.splice(0,0,u)}}}else{s=ee;let l=this[hr](this[k]);l&&(s=l.name);for(let u=this[b].length-1;u>0;u--){let f=this[b][u];if(f.opsType===F.Append&&f.root===s){o.push(f),i=u-1;break}}}if(o.length===0){let l="can not find route";console.warn(l),n.resolve(l),t(!1);return}let a=0;if(this[b].forEach(l=>{l.opsType!==F.Put&&a++}),this[_e](o)){let l=0;this[b].forEach(f=>{f.opsType!==F.Put&&l++});const u=l-a;this[E]?.go(u,!1),n.resolve(),t(!0)}}catch(i){this[q](i),n.resolve(),t(!1)}})})}open(...e){let t=this[H](e);return t?(t.opsType=F.Open,this.to(t)):(this[q]("resolve route fail",t),this)}close(e){return this[ve].post(t=>{try{let n=this[H](e);if(!n){t.reject("resolve route fail");return}let i=[];for(let s=0;s<this[b].length;s++){let o=this[b][s];if(o.root===n.root){if(!n.path&&!n.name){i.push(o);continue}if(n.path&&n.path===o.path){i.push(o);break}else if(n.name&&n.name===o.name){i.push(o);break}}}if(i.length===0){t.resolve();return}this[_e](i)&&this[ke](),t.resolve()}catch(n){this[q](n),t.resolve()}}),this}to(...e){let t=this[H](e);if(!t)return this[q]("resolve route fail",t),this;let n=this[Ke].acquire(t);return n==null?(this[q]("route forbid",t),this):(this[ve].post(i=>{try{let s=this[St](t);this[Pt](s),this[Et](s),this[Ct](s),s.wait((o,a)=>{const l=o.session.to;try{let u=K.clone(l,!0);const f=new ar(u,this[ze]());l.opsType===F.Replace?this[E]?.replace(f):this[E]?.push(f)}catch(u){console.error(u.message,u)}if(this[Ke].release(n),this[ke](l),typeof t.success=="function")try{Reflect.apply(t.success,{},[])}catch(u){console.error(u.message,u)}this[ae]===!1&&this[Qe](!0),i.resolve()},(o,a)=>{this[Ke].release(n),a!==null&&this[q](a,t),this[ae]===!1&&this[Qe](!1),i.resolve()})}catch(s){this[Ke].release(n),this[q](s,t),i.resolve()}}),this)}back(e=1){this[E]?.go(-e)}[mr](e){return(t,n)=>{if(typeof t=="boolean")e.session.redirect=!1,t?e.resolve():e.reject(n??null);else if(t){const i=this[H](t);if(i){const s=e.session.to;i.success=s.success,i.error=s.error,e.session.to=i,e.session.redirect=!0,e.session.routeModel=null,e.resolve()}else e.session.redirect=!1,e.reject("route resolve fail")}else e.session.redirect=!1,e.resolve()}}[St](e){let t=this[b].length>0?this[b][0]:void 0,n=new et(e,t),i={route:e,find:null};return this[Ue](i),i.find&&(n.routeModel=i.find,e.matched=$n(i.find),Array.isArray(e.matched)&&e.matched.length>0&&(e.meta=i.find.layers[0].models[0].meta)),new Me(n)}[Pt](e){for(let t of this[je])e.post(n=>{let i=this[mr](n);Reflect.apply(t,{},[n.session.to,n.session.from,i,n.session])})}[Ct](e){e.post(t=>{for(let n of this[Te])try{Reflect.apply(n,{},[t.session.to,t.session.from,t.session])}catch(i){console.error(i.message,i)}t.resolve()})}[gr](e,t){for(let n of this[$e])try{Reflect.apply(n,{},[e,t])}catch(i){console.error(i.message,i)}typeof e.destroy=="function"&&Reflect.apply(e.destroy,e,[])}[Et](e){e.post(t=>{let n=t.session.to,i=t.session.routeModel;if(i==null){let o={route:n,find:null};if(this[Ue](o))i=o.find,t.session.routeModel=i;else if(this[Ge])i=this[Ge];else{t.reject(`not find route model, path:${n.path??n.name}`);return}}let s=et.from(t.session);this[dr](n,i,s).then(o=>{this[k],t.resolve()},o=>{t.reject(o)})})}[_e](e){if(e.length==0)return!0;let t=this[k],n=[];for(let i of e){let s=this[gt](t,i);s!=null&&n.push({...s,route:i})}if(n.length==0){let i="can not find view index";return this[q](i),!1}for(let i of n.reverse())this[le](t,{x:i.x,y:i.y},[i.route.index??0],!0);return!0}[gt](e,t){const n=t.root??ee;let i;for(let s=0;s<e.layers.length;s++){const o=e.layers[s];for(let a=o.views.length-1;a>=0;a--){const l=o.views[a];if(l[G]&&l[Ye]===n)return i={x:a,y:s},i}}return null}[hr](e){return e.layers.length>0&&e.layers[0].views.length>0?e.layers[0].views[0]:null}[le](e,t,n=null,i=!0){if(t.y>=e.layers.length||t.x>=e.layers[t.y].views.length)return;let s=e.layers[t.y].views[t.x],o=!1,a=[],l=!1,u=[...s.slots.value];for(let c=u.length-1;c>=0;c--){let h=u[c];(!n||n.indexOf(h.index)!=-1)&&(h.route&&s[G]&&(this[Fe](h.route),h.active===!0&&h.route.opsType==F.Append&&(l=!0)),a.push(new B(s,h.index,t.y)),u.splice(c,1))}if(u.length==0)i?s.slots.value=u:e.layers[t.y].views.splice(t.x,1);else{if(l){let c=u.length-1,h=u[c];h.active=!0,h.route&&(h.route.active=h.active)}s.slots.value=u}e.layers[t.y].views.length==0&&(o=!0);let f=t.y+1;for(;f<e.layers.length;f++){let c=e.layers[f].views,h=[];for(let d=c.length-1;(o||a.length>0)&&d>=0;d--){let v=c[d];if(v[ue]&&(o||B.include(a,v[ue]))){let p=v.slots.value;for(let y=p.length-1;y>=0;y--){let m=p[y];m.route&&v[G]&&this[Fe](m.route),h.push(new B(v,m.index,f)),p.splice(y,1)}e.layers[f].views.splice(d,1)}}a=h,e.layers[f].views.length==0&&(o=!0)}}restore(e){if(!e||this[U].length==0){let t=this[k];if(t.layers.length>0){let n=t.layers[0].views;n.length>0&&(n[0].slots.value=[])}return this[b]=[],this[ke](),Promise.resolve()}else return new Promise((n,i)=>{let s=null,o=!1;for(let a=0;a<e.length;a++){const l=e[a];this[ve].post(u=>{const f=this[St](l);this[Pt](f),this[Et](f),this[Ct](f),f.wait((c,h)=>{s=c.session.to,o=c.session.redirect,u.resolve()},(c,h)=>{s=null,h!==null&&this[q](h),u.resolve()})})}this[ve].post(a=>{if(s&&o===!0){const l=K.clone(s,!0),u=new ar(l,this[ze]());this[E]?.replace(u)}a.resolve(),n()})})}[dr](e,t,n){let i=e.updateType??Xe.Part;return this[yr](t).then(()=>{this[pr](t,e,n,i)})}[yr](e){let t=[];for(let n=0;n<e.layers.length;n++){let i=e.layers[n];for(let s=0;s<i.models.length;s++){let o=i.models[s];o.isResolved||t.push(o.resolve())}}return t.length>0?Promise.all(t):Promise.resolve()}[pr](e,t,n,i){if(e.layers[0].models.length!==1)return Promise.reject("illegal route structure(multi root node)");const s=e.layers[0].models[0];let o=this[k],a=Tn(o),l=t.root??ee,u;!a&&i==Xe.Part&&(u=this[gt](o,t));let f,c=0;if(u==null||u==null)if(a||i===Xe.All){if(o.layers.length==0&&(o.layers[0]=new dt),o.layers[0].views.length==0){let h=t.root??ee;f=new Ce(h,!0,null),o.layers[0].views=[f]}else f=o.layers[0].views[0];u={x:0,y:0}}else{let h=t.slot;if(!h)return Promise.reject("can not rebuild view(because not route slot)");let d=h.level;if(d>o.layers.length)return Promise.reject("can not insert view(override level)");let v;if(h.rootName){let p=o.layers[d-1];for(let y of p.views){if(y[G]&&y.name===h.rootName){v=new B(y,h.rootIndex??0,d-1);break}if(y[J]&&y[J].view.name===h.rootName&&y[J].index===h.rootIndex){v=y[J];break}}}if(!v)return Promise.reject("can not insert view(not find root node ref)");f=new Ce(l,!0,v),o.layers[d].views.push(f),u={x:o.layers[d].views.length-1,y:d}}else f=o.layers[u.y].views[u.x];if(c=u.y,f[G]=!0,t.opsType===F.Append){t.index=oe.get(),t.active=!0;let h=f.slots.value;if(h.length>0){let m=h[h.length-1];m.active=!1,m.route&&(m.route.active=m.active)}let d=new re(t,s,t.index,!0);f.slots.value=[...h,d];let v=c+1,p=1,y=new B(f,t.index,c);this[ne](o,v,e,p,y)}else if(t.opsType===F.Open){let h=f.slots.value;const d=t.active??!0;let v=!1;for(let p of h){if(p.route!==null&&K.isSameForRouteModel(p.route,t)){if(p.active===d)return t.index=p.index,t.active=d,p.route=t,Promise.resolve();p.active=d,v=!0,t.index=p.index,t.active=d,p.route=t}else d&&(p.active=!1);p.route&&(p.route.active=p.active)}if(!v){t.index=oe.get(),t.active=d;let p=new re(t,s,t.index,d);h.push(p);let y=c+1,m=1,g=new B(f,t.index,c);this[ne](o,y,e,m,g)}f.slots.value=[...h]}else{let h=f.slots.value;if(h.length==0){t.index=oe.get(),t.active=!0,f.slots.value=[new re(t,s,t.index)];let d=c+1,v=1,p=new B(f,t.index,c);this[ne](o,d,e,v,p)}else{let d=h[0];if(d.model!==s){this[le](o,u,null,!0),t.index=oe.get(),t.active=!0,f.slots.value=[new re(t,s,t.index)];let v=c+1,p=1,y=new B(f,t.index,c);this[ne](o,v,e,p,y)}else{d.route!==null&&this[Fe](d.route);let v=!1;const p=t.active??!0;d.active!==p&&(d.active=p,v=!0),t.active=p,t.index=d.index,d.route=t;let y=[];for(let _=1;_<h.length;_++)y.push(h[_].index);y.length>0?this[le](o,u,y,!0):v&&(f.slots.value=[...h]);let m=[new B(f,t.index,c)],g=c+1,$=1,x=new B(f,t.index,c);for(;m.length>0&&g<o.layers.length&&$<e.layers.length;g++,$++){let _=[];for(let P=0;P<o.layers[g].views.length;P++){let C=o.layers[g].views[P];C[ue]&&B.include(m,C[ue])&&_.unshift(P)}let A=[];for(let P of _){let C=o.layers[g].views[P],W=e.layers[$].models,M;for(let I=0;I<W.length;I++)if(C.name===W[I].name){M=W[I];break}if(!M)this[le](o,{x:P,y:g},null,!1);else{let I=C.slots.value;if(I.length==0){let X=0;C.slots.value=[new re(null,M,X)];let z=g+1,te=$+1;this[ne](o,z,e,te,x)}else{let X=I[0];if(X.model!==M){this[le](o,{x:P,y:g},null,!0),C.slots.value=[new re(null,M,0)];let z=g+1,te=$+1;this[ne](o,z,e,te,x)}else{C[G]&&X.route!==null&&this[Fe](X.route);let z=[];for(let te=1;te<I.length;te++)z.push(I[te].index);z.length>0&&this[le](o,{x:P,y:g},z,!0),A.push(new B(C,X.index,g))}}C[G]=!1}}m=A}this[ne](o,g,e,$,x)}}}if(f&&f[J]){let h=f[J];h&&(t.slot=new rn(l,c,h?.view.name,h?.index??0))}n.to=void 0,n.routeModel=void 0,t.session=n,this[vr](t)}[ne](e,t,n,i,s){let o=i,a=t;for(;a<e.layers.length&&o<n.layers.length;a++,o++){let l=e.layers[a].views;for(let u of n.layers[o].models){let f=new Ce(u.name,!1,s),c=new re(null,u);f.slots.value=[c],l.push(f)}}for(;o<n.layers.length;o++){let l=new dt;l.views=[];for(let u of n.layers[o].models){let f=new Ce(u.name,!1,s),c=new re(null,u);f.slots.value=[c],l.views.push(f)}e.layers.push(l)}}[Sr](e,t,n,i,s,o){if(t<0||t>this[k].layers.length)return null;if(t<this[k].layers.length){let f=this[k].layers[t],c=null;for(let h of f.views){let d=!1;if(n!==null?(d=h.name===e&&h[J]?.view===n,d&&i!==-1&&(d=h[J]?.index===i)):d=h.name===e,!!d){s!==null&&(h[ue]={view:s,index:o,level:t-1}),c=h;break}}if(c!==null)return c}let a=null,l=null;s!==null&&(s[G]?a={view:s,index:o,level:t-1}:a=s[J],l={view:s,index:o,level:t-1});let u=new Ce(e,!0,a);if(u[ue]=l,t==this[k].layers.length){let f=new dt;f.views=[u],this[k].layers.push(f)}else this[k].layers[t].views.push(u);return u}}const Kn="fox-router-view",qn="fox-router-link";function $r(r,e=!1){let t=null;return e?t=r.showFromClass??r.enterFromClass:t=r.enterFromClass,t||(t=r.transitionName,t?e?`${t}-show-from`:`${t}-enter-from`:null)}function _r(r,e=!1){let t=null;return e?t=r.showActiveClass??r.enterActiveClass:t=r.enterActiveClass,t||(t=r.transitionName,t?e?`${t}-show-active`:`${t}-enter-active`:null)}function On(r,e=!1){let t=null;return e?t=r.showToClass??r.enterToClass:t=r.enterToClass,t||(t=r.transitionName,t?e?`${t}-show-to`:`${t}-enter-to`:null)}function Ln(r,e=!1){let t=null;return e?t=r.hideFromClass??r.leaveFromClass:t=r.leaveFromClass,t||(t=r.transitionName,t?e?`${t}-hide-from`:`${t}-leave-from`:null)}function Mn(r,e=!1){let t=null;return e?t=r.hideActiveClass??r.leaveActiveClass:t=r.leaveActiveClass,t||(t=r.transitionName,t?e?`${t}-hide-active`:`${t}-leave-active`:null)}function In(r,e=!1){let t=null;return e?t=r.hideToClass??r.leaveToClass:t=r.leaveToClass,t||(t=r.transitionName,t?e?`${t}-hide-to`:`${t}-leave-to`:null)}function Nn(r,e=!1){let t=null;return e?t=r.beforeShow??r.beforeEnter:t=r.beforeEnter,t}function Hn(r,e=!1){let t=null;return e?t=r.show??r.enter:t=r.enter,t}function Dn(r,e=!1){let t=null;return e?t=r.afterShow??r.afterEnter:t=r.afterEnter,t}function Vn(r,e=!1){let t=null;return e?t=r.showCancelled??r.enterCancelled:t=r.enterCancelled,t}function Bn(r,e=!1){let t=null;return e?t=r.hide??r.leave:t=r.leave,t}function Un(r,e=!1){let t=null;return e?t=r.afterHide??r.afterLeave:t=r.afterLeave,t}function kn(r,e=!1){let t=null;return e?t=r.hideCancelled??r.leaveCancelled:t=r.leaveCancelled,t}function Wt(r){let e,t=r.duration;return typeof t=="object"?e={enter:t.enter??-1,leave:t.leave??-1,show:t.show??-1,hide:t.hide??-1}:(typeof t=="string"&&(t=t.length==0?-1:Number(t)),e={enter:t,leave:t,show:t,hide:t}),e}function be(r,e){r.classList.contains(e)||r.classList.add(e)}function xe(r,e){r.classList.remove(e)}const Wn=Ie&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout;function zt(r){Wn(r)}function D(r,e,t){S(e)&&(r==null&&(r={}),Reflect.apply(e,r,t))}function Kr(r,e,t,n=-1,i,s,o,a){if(S(s)){if(i!==void 0&&i>=0){setTimeout(()=>{Reflect.apply(s,r,[e,t,n]),S(a)&&Reflect.apply(a,r,[])},i);return}const l=["animationend","transitionend"],u=f=>{l.forEach(c=>{Lt(e,c,u)}),Reflect.apply(s,r,[e,t,n]),a&&Reflect.apply(a,r,[])};l.forEach(f=>{Ot(e,f,u)})}if(S(o)){const l="animationcancel",u=f=>{Reflect.apply(o,r,[e,t,n]),Lt(e,l,u)};Ot(e,l,u)}}function Jt(r){return!Ie||r===null?!1:r.opsType===F.Append||r.opsType===F.Open}function qr(r,e,t,n={},i,s=-1){if(e||Jt(i)){const o=$r(n,e);o&&be(t,o);const a=_r(n,e);a&&be(t,a);const l=Nn(n,e);D(r,l,[t,e,i,s])}}function Or(r,e,t,n={},i,s,o,a){if(!Jt(s)&&!e){S(a)&&a(r,a,[t]);return}const l=$r(n,e),u=_r(n,e),f=On(n,e),c=Hn(n,e),h=Dn(n,e),d=Vn(n,e);zt(()=>{Kr(r,t,s,o,i,()=>{u&&xe(t,u),f&&xe(t,f),S(h)&&D(r,h,[t,e,s,o]),S(a)&&a(r,a,[t])},()=>{S(d)&&D(r,d,[t,e,s,o])}),l&&xe(t,l),f&&be(t,f),S(c)&&D(r,c,[t,e,s,o])})}function Lr(r,e,t,n={},i,s,o,a,l){if(!Jt(o)&&!e){!e&&S(s)&&s();return}const u=Ln(n,e),f=Mn(n,e),c=In(n,e),h=Bn(n,e),d=Un(n,e),v=kn(n,e);u&&be(t,u),f&&be(t,f),S(h)&&D(r,h,[t,e,o,a]),zt(()=>{Kr(r,t,o,a,i,()=>{f&&xe(t,f),c&&xe(t,c),S(d)&&D(r,d,[t,e,o,a]),S(l)&&D(r,l,[t]),!e&&S(s)&&s()},()=>{S(v)&&D(r,v,[t,e,o,a]),S(l)&&D(r,l,[t]),!e&&S(s)&&s()}),u&&xe(t,u),c&&be(t,c)})}function Mt(r,e={},t,n=-1){const i=e.mode??"default",s=Wt(e);return{mode:i,persisted:!1,beforeEnter:a=>{qr(r,!1,a,e,t,n)},enter:a=>{Or(r,!1,a,e,s.enter,t,n)},leave:(a,l)=>{Lr(r,!1,a,e,s.leave,l,t,n)},clone:a=>Mt(r,e,t,n)}}function Mr(r){return r.el}function zn(r,e,t={},n,i,s,o){if(s){const a=Mr(e);if(a==null)return;const l=Wt(t);qr(r,!0,a,t,n,i),Or(r,!0,a,t,l.show,n,i,u=>{S(o)&&D(r,o,[u])})}else S(o)&&D(r,o,[])}function Jn(r,e,t={},n,i,s,o){if(s){const a=Mr(e);if(a==null)return;const l=Wt(t);Lr(r,!0,a,t,l.hide,null,n,i,u=>{S(o)&&D(r,o,[u])})}else S(o)&&D(r,o,[])}function Gn(r,e={}){zt(()=>{for(let t=0;t<r.length;t++)Reflect.apply(r[t],e,[])})}function ie(r,e,t){return typeof r=="function"?Reflect.apply(r,{},[e,t]):r}function At(r,e){if(!r)return null;const t=r(e);return t.length===1?t[0]:t}class Qn{node;state;constructor(e,t){this.node=e,this.state=t}}const It=w.defineComponent({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,required:!1,default:"default"},modelSlot:{type:[Object],required:!1},multi:{type:Boolean,required:!1,default:!1},tag:{type:[String,Object,Function],required:!1,default:"div"},viewTag:{type:[String,Object,Function],required:!1,default:"div"},viewTagProps:{type:[Object,Function],required:!1,default(){return{}}},viewClass:{type:[String,Function],required:!1},viewActiveClass:{type:[String,Function],required:!1},viewInactiveClass:{type:[String,Function],required:!1},transition:{type:[Boolean,String,Function],required:!1,default:!1},transitionName:{type:String,required:!1},enterFromClass:{type:String,required:!1},enterActiveClass:{type:String,required:!1},enterToClass:{type:String,required:!1},leaveFromClass:{type:String,required:!1},leaveActiveClass:{type:String,required:!1},leaveToClass:{type:String,required:!1},showFromClass:{type:String,required:!1},showActiveClass:{type:String,required:!1},showToClass:{type:String,required:!1},hideFromClass:{type:String,required:!1},hideActiveClass:{type:String,required:!1},hideToClass:{type:String,required:!1},beforeEnter:{type:Function,required:!1},enter:{type:Function,required:!1},afterEnter:{type:Function,required:!1},enterCancelled:{type:Function,required:!1},beforeLeave:{type:Function,required:!1},leave:{type:Function,required:!1},afterLeave:{type:Function,required:!1},leaveCancelled:{type:Function,required:!1},beforeShow:{type:Function,required:!1},show:{type:Function,required:!1},afterShow:{type:Function,required:!1},showCancelled:{type:Function,required:!1},beforeHide:{type:Function,required:!1},hide:{type:Function,required:!1},afterHide:{type:Function,required:!1},hideCancelled:{type:Function,required:!1}},setup(r,e){const t=w.getCurrentInstance();if(t===null||t.proxy===null){console.error("instance or instance.proxy not exist");return}const n=r.multi===!0,i=w.inject(it,null),s=w.inject(ft,0),o=w.inject(or,null),a=w.inject(ct,-1);let l=null;const u=r.modelSlot;if(u){if(w.provide(ft,s+1),w.provide(ct,u.index),w.provide(ht,u.index),!u.route){console.warn("child view render error, route not exist");return}const h=tt(t.proxy,!0);un(h),sr(h,()=>u.route??null)}else{if(i==null){console.error("router is not been injected");return}const c=r.name,h=w.inject(lr,null),d=w.inject(ht,0);if(l=i[Sr](c,s,o,a,h,d),l===null)return;w.provide(lr,l);const v=l[G]===!0;if(v&&w.provide(or,l),!n&&(w.provide(ct,-1),w.provide(ft,s+1),w.provide(ht,-1),v)){const p=tt(t.proxy,!0);sr(p,()=>{const y=l.slots.value;return y.length>0?y[0].route:null})}}const f={value:new Map};return w.onUnmounted(()=>{f.value&&f.value.clear()}),()=>{if(n){const c=new Map,h=[],d=l?.slots.value,v=[];for(let m=0;m<d.length;m++){const g=d[m],$=`${r.name}_${g.index}`,x=ie(r.transition,g.route,m)??!0,_={modelSlot:g};let A;e.slots.default?A=w.h(It,_,{default:e.slots.default}):A=w.h(It,_);const P={},C=ie(r.viewClass,g.route,m);typeof C=="string"&&C.length>0&&(P[C]=!0);const W=ie(r.viewActiveClass,g.route,m),M=ie(r.viewInactiveClass,g.route,m),I=f.value.get($);if(typeof W=="string"&&W.length>0&&(P[W]=g.active),typeof M=="string"&&M.length>0&&(P[M]=!g.active),I&&g.active!==I.state){const he=I.node;g.active?v.unshift(()=>{const ot=()=>{let Re=nr(he);Re!=null&&ir(Re,Kt.ACTIVATED)};zn(t,he,r,g.route,m,x,ot)}):v.push(()=>{const ot=()=>{const Re=nr(he);Re!=null&&ir(Re,Kt.DEACTIVATED)};Jn(t,he,r,g.route,m,x,ot)})}const X={class:P,key:$},z=ie(r.viewTagProps,g.route,m);z!==null&&typeof z=="object"&&T(!0,X,z),g.route?.viewTagAttrs&&typeof g.route?.viewTagAttrs=="object"&&T(!0,X,g.route.viewTagAttrs);const te=ie(r.viewTag,g.route,m),st=w.h(te,X,{default:()=>[A]});if(c.set($,new Qn(st,g.active)),f.value.delete($),x){const he=Mt(t,r,g.route,m);st.transition=he}h.push(st)}f.value.forEach(m=>{m.node.transition=null}),f.value=c,Gn(v,t);const p=ie(r.tag,null,-1),y={};return Object.assign(y,e.attrs),w.h(p,y,{default:()=>h})}else if(u!=null){const c=u.model,h={};c.props&&(typeof c.props=="object"?T(!1,h,c.props):c.props===!0&&typeof u.route?.params=="object"&&T(!1,h,u.route?.params));const d=w.h(c.component,h);return At(e.slots.default,{Component:d,route:u.route})??d}else{const c=l.slots.value;if(c.length>0){const h=c[0],d=h.route??(t.proxy&&Ut(t.proxy))??null,v=h.model,p={};v.props&&(typeof v.props=="object"?T(!1,p,v.props):v.props===!0&&typeof d?.params=="object"&&T(!1,p,d?.params));const y=w.h(v.component,p);if(ie(r.transition,d,-1)??!0){const g=Mt(t,r,d,-1);y.transition=g}return At(e.slots.default,{Component:y,route:d})??y}else return At(e.slots.fallback,{})}}}});function Xn(r){if(!(r.metaKey||r.altKey||r.ctrlKey||r.shiftKey)&&!r.defaultPrevented&&!(r.button!=null&&r.button!==0)){if(r.currentTarget&&r.currentTarget.getAttribute){const e=r.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return r.preventDefault&&r.preventDefault(),!0}}function Yn(r,e){return r==null||e==null?!1:!!(r===e||r.path&&r.path===e.path||r.name&&r.name===e.name)}function Zn(r,e){return r==null||e==null?!1:!!(r.path&&e.path&&e.path.startsWith(r.path)||r.name&&r.name==e.name)}function me(r,e){return typeof r=="function"?Reflect.apply(r,{},[e]):r}let ei=w.defineComponent({name:"RouterLink",inheritAttrs:!1,props:{tag:{type:[String,Object,Function],required:!1,default:"a"},to:{type:[String,Object,Function],required:!0},root:{type:String},activeClass:{type:[String,Function],required:!1,default:"fox-router-link-active"},exact:{type:[String,Boolean,Function],required:!1},exactActiveClass:{type:[String,Function],required:!1,default:"fox-router-link-exact-active"},event:{type:[String,Function],required:!1,default:"onClick"}},setup(r,e){const t=w.inject(it,null);return()=>{let n=me(r.to,null),i=me(r.tag,n);if(i==null){console.warn("can not resolve link tag");return}let s=null,o=null;t!==null&&(s=t[H](n),r.root&&(s.root=r.root),o=t.current);let a={},l=me(r.activeClass,s);if(typeof l=="string"&&l.length>0&&(a[l]=Zn(s,o)),me(r.exact,s)===!0){let h=me(r.exactActiveClass,s);typeof h=="string"&&h.length>0&&(a[h]=Yn(s,o))}let f={class:a};(i==="a"||i==="A")&&(f.href=s?.path??s?.name??"#"),T(!0,f,e.attrs);let c=me(r.event,s);if(typeof c=="string"){const h=d=>{if(t==null){console.warn("router is not been injected");return}if(s==null){console.warn("route is not been resolved");return}Xn(d)&&t.to(s)};f[c]=h}return w.h(i,f,e.slots)}}});var O=(r=>(r[r.Loading=0]="Loading",r[r.Loaded=1]="Loaded",r[r.Defining=2]="Defining",r[r.Defined=3]="Defined",r))(O||{}),Ze=(r=>(r[r.normal=0]="normal",r[r.factory=1]="factory",r))(Ze||{});class ti{register=new Map;constructor(){}get(e){return this.register.get(e)??null}set(e,t){this.register.set(e,t)}remove(e){let t=this.register.get(e);return this.register.delete(e),t??null}has(e){return this.register.has(e)}clear(){this.register.clear()}}class wr{moduleManager=new ti;options={paths:{},alias:{},nature:[],timeout:3e3};set paths(e){this.options.paths=e}get paths(){return this.options.paths}set alias(e){this.options.alias=e}get alias(){return this.options.alias}set naturePaths(e){this.options.nature=e}get naturePaths(){return this.options.nature}set timeout(e){this.options.timeout=e}get timeout(){return this.options.timeout}_query;set query(e){this._query=e}get query(){return this._query}get head(){return He().head}constructor(){}setModule(e,t){const n={id:e,src:"",status:O.Defined};typeof t=="function"?(n.exports=t,n.type=Ze.factory):n.exports=t,this.moduleManager.set(e,n)}removeModule(e){this.moduleManager.remove(e)}ensure(...e){const t=[];let n=e.length-1;const i={};typeof e[n]=="object"&&(Object.assign(i,e[n]),n--);let s=null;typeof e[n]=="function"&&(s=e[n],n--);for(let l=0;l<=n;l++)if(Array.isArray(e[l])){let u=e[l];for(let f=0;f<u.length;f++)u[f]&&t.push(this.resolvePath(u[f]))}else if(typeof e[l]=="string"){let u=e[l].split(",");for(let f=0;f<u.length;f++)u[f]&&t.push(this.resolvePath(u[f]))}const o=new ri(t.length,(l,u)=>{if(o.isOK())try{typeof s=="function"&&Reflect.apply(s,{},u)}catch(f){console.error(f.message,f)}else try{console.error(l),typeof s=="function"&&Reflect.apply(s,{},[])}catch(f){console.error(f.message,f)}}),a=new Me;for(let l=0;l<t.length;l++){const u=new ni(l,t[l],i,o);this.mount(a,u)}return this}remove(...e){let t=[],n=e.length-1,i={};typeof e[n]=="object"&&(Object.assign(i,e[n]),n--);let s=null;typeof e[n]=="function"&&(s=e[n],n--);for(let o=0;o<=n;o++)if(Array.isArray(e[o])){let a=e[o];for(let l=0;l<a.length;l++)a[l]&&t.push(this.resolvePath(a[l]))}else{let a=e[o].split(",");for(let l=0;l<a.length;l++)a[l]&&t.push(this.resolvePath(a[l]))}return t.forEach(o=>{this.unmount(o,i)}),typeof s=="function"&&Reflect.apply(s,{},[]),this}mount(e,t){if(t.src==="exports"){e.post(i=>{t.progress.work(!0,t.index,"exports"),i.resolve()});return}else if(t.src==="module"){e.post(i=>{t.progress.work(!0,t.index,"module"),i.resolve()});return}if(this.isNaturePath(t.src)){let i=t.params.jsPoint;i||(i=this.head),this.mountJS(e,t,i);return}else if(this.isNaturePath(t.src)){let i=t.params.cssPoint;i||(i=this.head),this.mountCSS(e,t,i);return}let n=this.getFileNamePostfix(t.src);if(n==="js"||n.length===0){let i=t.params.jsPoint;i||(i=this.head),this.mountJS(e,t,i);return}else if(n==="css"){let i=t.params.cssPoint;i||(i=this.head),this.mountCSS(e,t,i);return}}mountCSS(e,t,n){e.post(i=>{const s=t.src,o=this.moduleManager.get(s);if(o&&(o.status==O.Defined||o.status==O.Loaded)&&o.exports){o.type===Ze.factory&&typeof o.exports=="function"?t.progress.work(!0,t.index,o.exports()):t.progress.work(!0,t.index,o.exports),i.resolve();return}const a=He(),l=a.createElement("link");if(Reflect.has(l,"onload"))l.onload=()=>{l.onload=null,l.onerror=null,t.progress.work(!0,t.index,t.src),i.resolve()},l.onerror=()=>{try{n.removeChild(l)}catch(c){console.error(c.message,c)}l.onload=null,l.onerror=null,t.progress.work(!1,t.index,null),i.reject()};else{const c={timeout:this.options.timeout??3e3,time:0,success:()=>{t.progress.work(!0,t.index,t.src),i.resolve()},error:()=>{try{n.removeChild(l)}catch(h){console.error(h.message,h)}t.progress.work(!1,t.index,null),i.resolve()}};setTimeout(()=>{Ir(l,c)},1)}let f=a.getElementById(s);f&&f.parentNode&&f.parentNode.removeChild(f),l.rel="stylesheet",l.type="text/css",l.id=s,l.href=s,n.appendChild(l)})}mountJS(e,t,n){e.post(i=>{const s=t.src;let o=this.moduleManager.get(s);if(o&&(o.status==O.Defined||o.status==O.Loaded)){if(o.exports){o.type===Ze.factory&&typeof o.exports=="function"?t.progress.work(!0,t.index,o.exports()):t.progress.work(!0,t.index,o.exports),i.resolve();return}if(document.querySelector(`script[src='${s}`)){t.progress.work(!0,t.index,o.exports),i.resolve();return}}o={id:s,src:s,status:O.Loading},this.moduleManager.set(s,o);const l=He().createElement("script");if("onload"in l)l.onload=()=>{l.onload=null,l.onerror=null,o.status==O.Loading&&(o.status=O.Loaded,t.progress.work(!0,t.index,s)),i.resolve()},l.onerror=()=>{try{n.removeChild(l)}catch(c){console.error(c.message,c)}l.onload=null,l.onerror=null,this.moduleManager.remove(s),t.progress.work(!1,t.index,null),i.resolve()};else{const c=l;c.onreadystatechange=()=>{/loaded|complete/.test(c.readyState)&&(c.onreadystatechange=null,o.status==O.Loading&&(o.status=O.Loaded,t.progress.work(!0,t.index,s)),i.resolve())}}l.defer=!0,l.src=s;const f=L();f.define=this.createDefine(o,t),n.appendChild(l)})}unmount(e,t={}){const n=He(),i=this.getFileNamePostfix(e);if(i==="js"||i.length===0){const s=n.querySelector(`script[src="${e}"]`);s&&s.parentNode&&s.parentNode.removeChild(s),this.moduleManager.remove(e);return}else if(i==="css"){const s=n.querySelector(`style[href="${e}"]`);s&&s.parentNode&&s.parentNode.removeChild(s);return}}trimEmptyElement(e){let t=[];for(let n=0;n<e.length;n++){if(e[n]===void 0||e[n]===null)continue;const i=e[n].trim();i.length!==0&&t.push(i)}return t}createDefine(e,t){const n=this,i=function(...s){e.status=O.Defining;let o,a,l,u=s.length;u===1?(l=s[0],o=void 0):u===2?(l=s[1],Array.isArray(s[0])?(a=n.trimEmptyElement(s[0]),o=void 0):a=void 0):(o=s[0],a=n.trimEmptyElement(s[1]),l=s[2]),o&&(e.id=o,n.options.alias[o]=e.src),a&&a.length>0?n.ensure(a,(...f)=>{const c=f.map(h=>h==="exports"?((!e.exports||typeof e.exports!="object")&&(e.exports={}),e.exports):h==="module"?e:h);if(typeof l=="function"){const h=Reflect.apply(l,e,c);h&&typeof h=="object"&&(e.exports=h)}else e.exports=l;e.status=O.Defined,t.progress.work(!0,t.index,e.exports)}):(typeof l=="function"?e.exports=Reflect.apply(l,e,[]):e.exports=l,e.status=O.Defined,t.progress.work(!0,t.index,e.exports))};return i.amd=!0,i}resolvePath(e){try{if(e==="exports"||e==="module"||this.isNaturePath(e))return e;e=this.parserPath(e,!0);let t=this.getFileNamePostfix(e);t=t.toLowerCase();let n=this.createSearch(this.query);return e.indexOf("?")==-1?(t!=="js"&&t!=="css"&&(e+=".js"),n.length>0&&(e+=`?${n}`)):n.length>0&&(e+=`&${n}`),e}catch(t){throw console.error(`resolve path[${e}] fail`,t),t}}createSearch(e){let t="";if(e){for(let n in e){let i=`${e[n]}`;t+=`${encodeURIComponent(n)}=${encodeURIComponent(i)}&`}t.length>0&&(t=t.substring(0,t.length-1))}return t}getFileNamePostfix(e){let t=e.lastIndexOf("?");t==-1&&(t=e.length);let n=e.lastIndexOf(".",t);return n==-1?"":e.substring(n+1,t)}isNaturePath(e){if(!this.options.nature)return!1;if(typeof this.options.nature=="function")return this.options.nature(e);const t=this.options.nature;if(t&&Array.isArray(t))for(let n=0;n<t.length;n++){const i=t[n];if(e.indexOf(i)===0)return!0}return!1}parserPath(e,t){if(e.indexOf("http://")==0||e.indexOf("https://")==0||e.indexOf("file:///")==0)return e;if(e.indexOf("/")==0)return`${yt()}${e.slice(1)}`;if(e.indexOf("./")==0)return`${yt()}${e.slice(2)}`;if(e.indexOf("//")==0)return`${L().location.protocol}${e}`;if(t){let i=this.options.alias[e];if(!i){let s=e.indexOf("/");if(s==-1)i=e;else{let o=e.slice(0,s),a=this.options.paths[o];a?i=a+e.slice(s):i=e}}return this.parserPath(i,!1)}return`${yt()}${e}`}}function Ir(r,e){let t=r.sheet,n=!1;if(e.isOldWebKit)t&&(n=!0);else if(t)try{t.cssRules&&(n=!0)}catch(i){i.name==="NS_ERROR_DOM_SECURITY_ERR"&&(n=!0)}setTimeout(()=>{e.time+=20,n?e.success():e.timeout>e.timeout?e.error():Ir(r,e)},20)}class ri{callback;values;status;size;lastIndex;constructor(e,t){this.size=e,this.callback=t,this.status=!0,this.values=[],this.lastIndex=-1}work(e,t,n){if(this.status=e,this.status===!0&&(this.lastIndex!==t&&this.size--,this.lastIndex=t,this.values.push(n)),this.size===0||this.status===!1)try{Reflect.apply(this.callback,this,[this.status,this.values])}catch(i){console.error(i.message,i)}}isOK(){return this.status}}class ni{index;src;params;progress;constructor(e,t,n,i){this.index=e,this.src=t,this.params=n,this.progress=i}}const Gt=Symbol("fk"),Qt=Symbol("fbk"),Xt=Symbol("fepk");function ii(r={}){const e=new _n(r),t=new $t,n=new _t,i=new wr,s={get router(){return e},get bus(){return t},get Bus(){return $t},get EventProxy(){return _t},get eventproxy(){return n},get EventChain(){return Me},get Require(){return wr},get require(){return i},get extend(){return T},get clone(){return Oe},get isESModule(){return Nt},install(o){o.provide(it,e),o.provide(Gt,s),o.provide(Qt,t),o.provide(Xt,n),o.component(Kn,It),o.component(qn,ei),Reflect.defineProperty(o.config.globalProperties,"$fox",{get(){return s}}),Reflect.defineProperty(o.config.globalProperties,"$router",{get(){return e}}),Reflect.defineProperty(o.config.globalProperties,"$bus",{get(){return t}}),Reflect.defineProperty(o.config.globalProperties,"$bus",{get(){return t}}),Reflect.defineProperty(o.config.globalProperties,"$eventProxy",{get(){return n}}),o.config.globalProperties.$fox_on=function(a,l,u=!1){n.on(a,l,u)},o.config.globalProperties.$fox_off=function(a,l){n.off(a,l)},o.config.globalProperties.$fox_once=function(a,l){n.once(a,l)},o.config.globalProperties.$fox_all=function(...a){let l=n;Reflect.apply(l.all,l,a)},o.config.globalProperties.$fox_trigger=function(a,...l){let u=n;Reflect.apply(u.trigger,u,[a,...l])},o.config.globalProperties.$fox_emit=function(a,...l){let u=n;Reflect.apply(u.trigger,u,[a,...l])},o.mixin({computed:{$route(){return Ut(this)}}}),e.init()}};return s}function Yt(r){return r?r.$router:w.inject(it)}function si(r){return r||(r=w.getCurrentInstance()?.proxy??void 0),r?Ut(r):null}function oi(r){return r?r.$fox:w.inject(Gt)}function li(r){return r?r.$bus:w.inject(Qt)}function ai(r){return r?r.$eventProxy:w.inject(Xt)}function ui(r){const e=Yt(),t=(n,i,s)=>{try{Reflect.apply(r,{},[n,i])}catch(o){console.error(o)}s()};e.beforeEach(t),w.onUnmounted(()=>{e.removeBeforeEach(t)})}function fi(r){const e=Yt(),t=(n,i,s)=>{try{Reflect.apply(r,{},[n,i])}catch(o){console.error(o)}s()};e.afterEach(t),w.onUnmounted(()=>{e.removeAfterEach(t)})}exports.Bus=$t;exports.EventChain=Me;exports.EventProxy=_t;exports.Route=K;exports.clone=Oe;exports.createFox=ii;exports.createMemoryHistory=Tr;exports.createWebHashHistory=jr;exports.createWebHistory=Fn;exports.deleteContextValue=an;exports.extend=T;exports.foxBusKey=Qt;exports.foxEventProxyKey=Xt;exports.foxKey=Gt;exports.injectContextValue=Bt;exports.isArray=Nr;exports.isDate=Vr;exports.isESModule=Nt;exports.isEqual=Tt;exports.isFunction=S;exports.isMap=Hr;exports.isObject=br;exports.isPlainObject=Ft;exports.isPromise=kr;exports.isSet=Dr;exports.isString=Br;exports.isSymbol=Ur;exports.onAfterRouteUpdate=fi;exports.onBeforeRouteUpdate=ui;exports.onFoxActivated=dn;exports.onFoxInactivated=yn;exports.provideContextValue=ln;exports.sessionKey=se;exports.toBoolean=Ht;exports.toNumber=Gr;exports.toTypeString=nt;exports.typeOf=jt;exports.useBus=li;exports.useEventProxy=ai;exports.useFox=oi;exports.useRoute=si;exports.useRouter=Yt;
2
+ * fox v3.0.0 Mon May 08 2023 09:56:51 GMT+0800 (中国标准时间)
3
+ */Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("vue"),Nr=Array.isArray,Hr=r=>nt(r)==="[object Map]",Dr=r=>nt(r)==="[object Set]",Vr=r=>r instanceof Date,S=r=>typeof r=="function",Br=r=>typeof r=="string",Ur=r=>typeof r=="symbol",br=r=>r!==null&&typeof r=="object",kr=r=>br(r)&&S(r.then)&&S(r.catch),Wr=Object.prototype.toString,nt=r=>Wr.call(r),Ft=r=>nt(r)==="[object Object]",zr=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol";function Nt(r){return r.__esModule||zr&&r[Symbol.toStringTag]==="Module"}const Jr=typeof Promise<"u"&&Promise.toString().indexOf("[native code]")!==-1;function T(...r){let e=r[0]!==void 0&&r[0]!==null?r[0]:{},t=1,n=r.length,i=!1;for(typeof e=="boolean"&&(i=e,e=r[t]??{},t++),typeof e!="object"&&(e={});t<n;t++)if(r[t]!==null&&r[t]!==void 0){let s=r[t];for(let o in s){let a=e[o],l=s[o];if(a!==l)if(i===!0&&l&&typeof l=="object"){let u;Array.isArray(l)?u=a&&Array.isArray(a)?a:[]:u=a&&typeof a=="object"?a:{},e[o]=T(i,u,l)}else l!==void 0&&(e[o]=l)}}return e}function Oe(r,e,t=!1){if(!t)T(!0,r,e);else{if(typeof e!="object")return{};typeof r!="object"&&(r={});for(let i in e){let s=r[i],o=e[i];if(s!==o)if(typeof o=="object"){if(!Array.isArray(o)&&!Ft(o))continue;s=Oe(s,o,t),r[i]=s}else{if(typeof o=="function")continue;r[i]=o}}const n=Object.getOwnPropertySymbols(e);for(let i of n){let s=r[i],o=e[i];if(s!==o)if(typeof o=="object"){if(!Array.isArray(o)&&!Ft(o))continue;s=Oe(s,o,t),r[i]=s}else{if(typeof o=="function")continue;r[i]=o}}}return r}class oe{static seed=new Date().getTime();static get(){let e=++oe.seed;return e>=Number.MAX_VALUE&&(oe.seed=0),e}}const lt=Jr?Promise.resolve():null;function qe(r,...e){lt!==null?e&&e.length>0?lt.then(()=>{r(e)}):lt.then(r):e&&e.length>0?setTimeout(()=>{r(e)}):setTimeout(r)}function Ht(r){return r==null?!1:typeof r=="boolean"?r:typeof r=="string"?r.toLocaleLowerCase()==="true":!!r}function Gr(r){return typeof r=="number"?r:Number(r)}const Qr={"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object Array]":"array","[object Date]":"date","[object RegExp]":"regExp","[object Object]":"object"};function jt(r){let t=Object.prototype.toString.call(r);return r==null?String(r):Qr[t]||"object"}function Tt(r,e){if(r==e)return!0;if(r===void 0||e===void 0)return!1;let t=jt(r),n=jt(e);if(t!==n)return!1;if(t==="object"){let i=Object.keys(r),s=Object.keys(e);if(i.length!==s.length)return!1;for(let o=0;o<i.length;o++){let a=i[o],l=r[a],u=e[a];if(!Tt(l,u))return!1}return!0}else if(t==="array"){if(r.length!==e.length)return!1;for(let i=0;i<r.length;i++){let s=r[i],o=e[i];if(!Tt(s,o))return!1}return!0}return!1}const Zt=Symbol("idKey"),ce=Symbol("valueKey"),R=Symbol("childrenKey"),Q=Symbol("growKey");class xr{[Q]=!0;[Zt];[ce]=w.ref();[R]=new Map;constructor(e){this[Zt]=e}}class Xr{get(e,t){if(t=="value")return e[ce].value;if(t==="grow")return e[Q];let n=e[R].get(t);if(n)return Le(n);if(e[Q])return n=Vt(t),n[Q]=e[Q],e[R].set(t,n),Le(n)}set(e,t,n){return t=="value"?(e[ce].value=n,!0):t==="grow"?(e[Q]=Ht(n),!0):n==null?(e[R].delete(t),!0):(console.error(`illegal property:${t}`),!1)}deleteProperty(e,t){return t==="value"||t=="grow"?(console.error(`can not delete property:${String(t)}`),!1):(e[R].delete(t),!0)}}const Dt="__proxy__";function Vt(r){let e=new xr(r);return Reflect.set(e,Dt,new Proxy(e,new Xr)),e}function Le(r){return Reflect.get(r,Dt)}class Rr extends xr{constructor(){super("__root__")}put(...e){let t=e.length;if(t<2)return console.error("参数至少包括一个(key, value)"),!1;let n=this;for(let i=0;i<t-1;i++){let s=e[i],o;n[R].has(s)?o=n[R].get(s):(o=Vt(s),n[R].set(s,o)),n=o}return n[ce].value=e[t-1],!0}get(...e){let t=e.length;if(t===0)return;let n=this;for(let i=0;i<t;i++){let s=e[i];if(n[R].has(s))n=n[R].get(s);else return}return n[ce].value}remove(...e){let t=e.length;if(t==0)return!1;let n=this;for(let s=0;s<t-1;s++){let o=e[s];if(n[R].has(o))n=n[R].get(o);else return!1}let i=e[t-1];return n[R].has(i)?(n[R].delete(i),!0):!1}contains(...e){let t=e.length;if(t==0)return!1;let n=this;for(let s=0;s<t-1;s++){let o=e[s];if(n[R].has(o))n=n[R].get(o);else return!1}let i=e[t-1];return n[R].has(i)}clear(){this[R].clear()}}const Yr=["put","get","contains","remove","clear"];function er(r){return Yr.includes(r)}class Zr{get(e,t){if(t=="value")return e[ce].value;if(t==="grow")return e[Q];if(t===R)return e[R];if(typeof t=="string"&&er(t))return e[t];let n=String(t),i=e[R].get(n);if(i)return Le(i);if(e[Q])return i=Vt(n),i[Q]=e[Q],e[R].set(n,i),Le(i)}set(e,t,n){return t=="value"?(e[ce].value=n,!0):t==="grow"?(e[Q]=Ht(n),!0):er(t)?!1:n==null?(e[R].delete(t),!0):(console.error(`illegal property:${t}`),!1)}deleteProperty(e,t){return t==="value"||t=="grow"?(console.error(`can not delete property:${String(t)}`),!1):(e[R].delete(t),!0)}}function en(){let r=new Rr,e=new Zr,t=new Proxy(r,e);return Object.assign({put(...i){return Reflect.apply(r.put,r,i)},get(...i){return Reflect.apply(r.get,r,i)},remove(...i){return Reflect.apply(r.remove,r,i)},contains(...i){return Reflect.apply(r.contains,r,i)},clear(){return Reflect.apply(r.clear,r,[])}},t),Reflect.set(r,Dt,t),r}const $t=new Proxy(Rr,{construct(r,...e){const t=en();return Le(t)}}),ee="default",Sr=Symbol("sync"),H=Symbol("resolveRoute");function tr(r){let e=!1;return function(...t){if(!e)return e=!0,Reflect.apply(r,{},t)}}function tn(r){let e=r.src;return new Promise((t,n)=>{const i=tr(a=>{Nt(a)&&(a=a.default),r.component=a,console.debug("success load async module"),t()}),s=tr(a=>{console.debug("reject load async module"),n(a)});let o;try{o=e(i,s)}catch(a){s(a)}if(o)if(typeof o.then=="function")o.then(i,s);else{const a=o.component;a&&typeof a.then=="function"&&a.then(i,s)}})}class rn{name;level;rootName;rootIndex=0;constructor(e,t,n,i){this.name=e,this.level=t,this.rootName=n,this.rootIndex=i}}class et{to;routeModel;from;data={};constructor(e,t){this.to=e,this.from=t}static from(e){let t=new et(e.to,e.from),n=e.data??{};return T(!0,t.data,n),t}}class K{path;get fullPath(){const e=this.path??`/${this.name}`;return`${this.root??ee}!${e}`}alias;name;root;params;query;matched;meta;success;error;destroy;opsType;updateType;viewTagAttrs;index;active;slot;session;static clone(e,t){let n=new K;return Oe(n,e,t),n}static isSame(e,t){return e===t?!0:!(e==null||t==null||e.path&&e.path!==t.path||e.name&&e.name!==t.name||e.root!==t.root||e.index!==t.index)}static isSameForRouteModel(e,t){return e===t?!0:!(e==null||t==null||e.path&&e.path!=t.path||e.name&&e.name!=t.name)}static from(e){let t=new K;if(e==null)return t;let n=t;for(let s in e){let o=e[s];n[s]=o}const i=Object.getOwnPropertySymbols(e);if(Array.isArray(i)&&i.length>0)for(let s of i)n[s]=e[s];return t}}class nn{id;name;props;meta;src;component;constructor(e,t,n,i){this.id=oe.get(),this.name=e,this.src=t,typeof t!="function"&&(this.component=t),this.props=n,this.meta=i}get isResolved(){return this.component!==void 0}resolve(){return tn(this)}}class rr{models=[]}class at{path;match;redirect;name;layers=[]}const V=Symbol("chainKey"),N=Symbol("cursorKey"),ut=Symbol("$persistentModeKey"),j=Symbol("statusKey"),Y=Symbol("argsKey"),Ne=Symbol("exArgsKey"),de=Symbol("successFnsKey"),Se=Symbol("errorFnsKey"),se=Symbol("sessionKey"),Z=Symbol("_go");class Me{[V]=[];[N]=0;[ut]=!1;[j]="Free";[Y]=[];[Ne]=[];[de]=[];[Se]=[];[se];get session(){return this[se]}constructor(e,t=!1){this[se]=e,this[ut]=t}[Z](e,...t){let n=this[j];if(this[j]="Busy",this[N]+=e,this[N]<0&&(this[N]=0),this[Y]=t,n==="Exception"||n==="Reject"){let a=[{session:this[se]},...this[Ne]];for(;this[Se].length>0;)try{let l=this[Se].shift();typeof l=="function"&&qe(()=>{Reflect.apply(l,{},a)})}catch(l){console.error(l.message,l)}return this[j]=n,this[V]=[],this[N]=0,this}else if(n==="Finished"||this[N]>=this[V].length){let a=[{session:this[se]},...this[Y]];for(;this[de].length>0;){let l=this[de].shift();typeof l=="function"&&qe(()=>{Reflect.apply(l,{},a)})}return this[j]="Free",this}if(this[N]>=this[V].length)return this[j]="Free",this;let i=this[V][this[N]];this[ut]||(this[V].splice(0,this[N]+1),this[N]=-1);let s=this[N]+1;try{let o=!1,a={go:(l,...u)=>{o||(o=!0,Reflect.apply(this[Z],this,[l,...u]))},resolve:(...l)=>{o||(o=!0,Reflect.apply(this[Z],this,[1,...l]))},reject:(...l)=>{o||(o=!0,Reflect.apply(this.reject,this,[...l]))},insert:l=>{o||(this[V].splice(s,0,l),s++)},session:this[se]};qe(()=>{Reflect.apply(i,{},[a,...this[Y]])})}catch(o){this.throw(o)}return this}go(e,...t){return Reflect.apply(this[Z],this,[e,...t])}finish(...e){return this[j]="Finished",this[Y]=e,Reflect.apply(this[Z],this,[0])}reject(...e){return this[j]="Reject",this[Ne]=e,Reflect.apply(this[Z],this,[0])}throw(...e){return this[j]="Exception",this[Ne]=e,Reflect.apply(this[Z],this,[0])}reset(...e){this[j]="Busy",this[Y]=e,this[V]=[],this[N]=0;let n=[{session:this[se]},...this[Y]];for(;this[de].length>0;){let i=this[de].shift();qe(()=>{Reflect.apply(i,this,n)})}return this[j]="Free",this}post(e){return this[j]==="Reject"||this[j]==="Exception"?this:(Array.isArray(e)?this[V]=[...this[V],...e]:this[V].push(e),this[j]==="Busy"?this:(Reflect.apply(this[Z],this,[0,...this[Y]]),this))}wait(e,t){return e&&typeof e=="function"&&this[de].push(e),t&&typeof t=="function"&&this[Se].push(t),this[j]==="Busy"?this:(Reflect.apply(this[Z],this,[0,...this[Y]]),this)}exception(e){return e&&typeof e=="function"&&this[Se].push(e),this[j]==="Busy"?this:Reflect.apply(this[Z],this,[0,...this[Y]])}isFinish(){return this[j]=="Reject"||this[j]=="Free"&&this[N]>=this[V].length}}const ye=Symbol("registerKey");class sn{policy;callback;constructor(e,t){this.callback=e,this.policy=t}}class _t{[ye]=new Map;constructor(){}on(e,t,n=!1){let i=this[ye].get(e);i||(i=new Array,this[ye].set(e,i));let s=n===!0?1:0,o=new sn(t,s);return i.push(o),this}off(e,t){if(!t)return this[ye].delete(e),this;let n=this[ye].get(e);if(n){for(let i=0;i<n.length;i++)if(n[i].callback===t){n.splice(i,1);break}}return this}bind(e,t,n=!1){return this.on(e,t,n)}unbind(e,t){return this.off(e,t)}once(e,t){return this.on(e,t,!0)}all(...e){let t=e.length;if(t<1)return this;let n=e[t-1];if(typeof n!="function")return console.error("callback can not benn empty"),this;let i=t-1,s=new Array(i),o=[].splice.call(e,0,i);for(let a=0;a<o.length;a++)this.once(o[a],l=>{s[a]=l,i-=1,i==0&&Reflect.apply(n,{},s)});return this}emit(e,...t){let n=this[ye].get(e);if(!n)return this;for(let i=0;i<n.length;){let s=n[i];if(s.policy==1?n.splice(i,1):i++,typeof s.callback=="function")try{qe(()=>{Reflect.apply(s.callback,{},t)})}catch(o){console.error(o.message,o)}}return this}trigger(e,...t){return Reflect.apply(this.emit,this,[e,...t])}}const Pe=Symbol("registerKey");class on{[Pe]=new Map;constructor(){}set(e,t){this[Pe].set(e,t)}get(e){return this[Pe].get(e)}has(e){return this[Pe].has(e)}delete(e){return this[Pe].delete(e)}}const fe=Symbol("lc");function tt(r,e=!1){let t=r;if(Reflect.has(t,fe))return t[fe];if(e){const n=new on;return t[fe]=n,n}return null}function Pr(r,e=!1){let t=null,n=r;for(;n&&!(Reflect.has(n,fe)&&(t=n[fe],t));)n=n.$parent;if(!t&&e){const i=r;i&&i.$parent&&(t=tt(i.$parent,e))}return t}function Bt(r,e){let t=r;for(;t;){if(Reflect.has(t,fe)){const n=t[fe];if(n.has(e))return n.get(e)}t=t.$parent}return null}function ln(r,e,t){Pr(r,!0)?.set(e,t)}function an(r,e){Pr(r,!0)?.delete(e)}function nr(r){if(Array.isArray(r.children)&&r.children.length>0){let e=r.children[0];if(e!=null&&e.component!=null&&e.component.proxy!=null)return tt(e.component.proxy,!1)}return null}const rt=Symbol("hooksKey");function un(r){let e=r.get(rt);e||(e=[],r.set(rt,e))}function ir(r,e){let t=r.get(rt);if(t!=null)for(let n=t.length-1;n>=0;n--){let i=t[n];if(i.type===e)try{Reflect.apply(i.hook,i.target,[])}catch(s){console.error(s.message,s)}}}var Kt=(r=>(r.DEACTIVATED="da",r.ACTIVATED="a",r))(Kt||{});class fn{type;hook;target;constructor(e,t,n){this.target=n,this.hook=t,this.type=e}}function cn(r,e,t,n){let i=new fn(e,t,n);return r.push(i),!0}function hn(r,e,t,n){let i=-1;for(let s=0;s<r.length;s++){let o=r[s];if(o.type===e&&o.hook===t&&o.target===n){i=s;break}}return i!=-1?(r.splice(i,1),!0):!1}function Cr(r){return(e,t)=>{let n;if(t)n=t;else{const s=w.getCurrentInstance();if(s==null||s.proxy==null){console.error("can not get current instance or proxy");return}n=s.proxy}const i=Bt(n,rt);if(i==null){console.warn("can not get hooks context");return}w.onUnmounted(()=>{hn(i,r,e,n)}),cn(i,r,e,n)}}let dn=Cr("a"),yn=Cr("da");const qt=Symbol("routeKey");function sr(r,e){r.set(qt,e)}function Ut(r){let e=Bt(r,qt);return typeof e=="function"?e():e??null}const it=Symbol("rk"),ft=Symbol("vd"),or=Symbol("rv"),ct=Symbol("rvi"),lr=Symbol("pv"),ht=Symbol("pvi");function pn(r){for(var e=[],t=0;t<r.length;){var n=r[t];if(n==="*"||n==="+"||n==="?"){e.push({type:"MODIFIER",index:t,value:r[t++]});continue}if(n==="\\"){e.push({type:"ESCAPED_CHAR",index:t++,value:r[t++]});continue}if(n==="{"){e.push({type:"OPEN",index:t,value:r[t++]});continue}if(n==="}"){e.push({type:"CLOSE",index:t,value:r[t++]});continue}if(n===":"){for(var i="",s=t+1;s<r.length;){var o=r.charCodeAt(s);if(o>=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122||o===95){i+=r[s++];continue}break}if(!i)throw new TypeError("Missing parameter name at ".concat(t));e.push({type:"NAME",index:t,value:i}),t=s;continue}if(n==="("){var a=1,l="",s=t+1;if(r[s]==="?")throw new TypeError('Pattern cannot start with "?" at '.concat(s));for(;s<r.length;){if(r[s]==="\\"){l+=r[s++]+r[s++];continue}if(r[s]===")"){if(a--,a===0){s++;break}}else if(r[s]==="("&&(a++,r[s+1]!=="?"))throw new TypeError("Capturing groups are not allowed at ".concat(s));l+=r[s++]}if(a)throw new TypeError("Unbalanced pattern at ".concat(t));if(!l)throw new TypeError("Missing pattern at ".concat(t));e.push({type:"PATTERN",index:t,value:l}),t=s;continue}e.push({type:"CHAR",index:t,value:r[t++]})}return e.push({type:"END",index:t,value:""}),e}function Er(r,e){e===void 0&&(e={});for(var t=pn(r),n=e.prefixes,i=n===void 0?"./":n,s="[^".concat(ge(e.delimiter||"/#?"),"]+?"),o=[],a=0,l=0,u="",f=function(A){if(l<t.length&&t[l].type===A)return t[l++].value},c=function(A){var P=f(A);if(P!==void 0)return P;var C=t[l],W=C.type,M=C.index;throw new TypeError("Unexpected ".concat(W," at ").concat(M,", expected ").concat(A))},h=function(){for(var A="",P;P=f("CHAR")||f("ESCAPED_CHAR");)A+=P;return A};l<t.length;){var d=f("CHAR"),v=f("NAME"),p=f("PATTERN");if(v||p){var y=d||"";i.indexOf(y)===-1&&(u+=y,y=""),u&&(o.push(u),u=""),o.push({name:v||a++,prefix:y,suffix:"",pattern:p||s,modifier:f("MODIFIER")||""});continue}var m=d||f("ESCAPED_CHAR");if(m){u+=m;continue}u&&(o.push(u),u="");var g=f("OPEN");if(g){var y=h(),$=f("NAME")||"",x=f("PATTERN")||"",_=h();c("CLOSE"),o.push({name:$||(x?a++:""),pattern:$&&!x?s:x,prefix:y,suffix:_,modifier:f("MODIFIER")||""});continue}c("END")}return o}function vn(r,e){return mn(Er(r,e),e)}function mn(r,e){e===void 0&&(e={});var t=kt(e),n=e.encode,i=n===void 0?function(l){return l}:n,s=e.validate,o=s===void 0?!0:s,a=r.map(function(l){if(typeof l=="object")return new RegExp("^(?:".concat(l.pattern,")$"),t)});return function(l){for(var u="",f=0;f<r.length;f++){var c=r[f];if(typeof c=="string"){u+=c;continue}var h=l?l[c.name]:void 0,d=c.modifier==="?"||c.modifier==="*",v=c.modifier==="*"||c.modifier==="+";if(Array.isArray(h)){if(!v)throw new TypeError('Expected "'.concat(c.name,'" to not repeat, but got an array'));if(h.length===0){if(d)continue;throw new TypeError('Expected "'.concat(c.name,'" to not be empty'))}for(var p=0;p<h.length;p++){var y=i(h[p],c);if(o&&!a[f].test(y))throw new TypeError('Expected all "'.concat(c.name,'" to match "').concat(c.pattern,'", but got "').concat(y,'"'));u+=c.prefix+y+c.suffix}continue}if(typeof h=="string"||typeof h=="number"){var y=i(String(h),c);if(o&&!a[f].test(y))throw new TypeError('Expected "'.concat(c.name,'" to match "').concat(c.pattern,'", but got "').concat(y,'"'));u+=c.prefix+y+c.suffix;continue}if(!d){var m=v?"an array":"a string";throw new TypeError('Expected "'.concat(c.name,'" to be ').concat(m))}}return u}}function gn(r,e){var t=[],n=Ar(r,t,e);return wn(n,t,e)}function wn(r,e,t){t===void 0&&(t={});var n=t.decode,i=n===void 0?function(s){return s}:n;return function(s){var o=r.exec(s);if(!o)return!1;for(var a=o[0],l=o.index,u=Object.create(null),f=function(h){if(o[h]===void 0)return"continue";var d=e[h-1];d.modifier==="*"||d.modifier==="+"?u[d.name]=o[h].split(d.prefix+d.suffix).map(function(v){return i(v,d)}):u[d.name]=i(o[h],d)},c=1;c<o.length;c++)f(c);return{path:a,index:l,params:u}}}function ge(r){return r.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function kt(r){return r&&r.sensitive?"":"i"}function bn(r,e){if(!e)return r;for(var t=/\((?:\?<(.*?)>)?(?!\?)/g,n=0,i=t.exec(r.source);i;)e.push({name:i[1]||n++,prefix:"",suffix:"",modifier:"",pattern:""}),i=t.exec(r.source);return r}function xn(r,e,t){var n=r.map(function(i){return Ar(i,e,t).source});return new RegExp("(?:".concat(n.join("|"),")"),kt(t))}function Rn(r,e,t){return Sn(Er(r,t),e,t)}function Sn(r,e,t){t===void 0&&(t={});for(var n=t.strict,i=n===void 0?!1:n,s=t.start,o=s===void 0?!0:s,a=t.end,l=a===void 0?!0:a,u=t.encode,f=u===void 0?function(M){return M}:u,c=t.delimiter,h=c===void 0?"/#?":c,d=t.endsWith,v=d===void 0?"":d,p="[".concat(ge(v),"]|$"),y="[".concat(ge(h),"]"),m=o?"^":"",g=0,$=r;g<$.length;g++){var x=$[g];if(typeof x=="string")m+=ge(f(x));else{var _=ge(f(x.prefix)),A=ge(f(x.suffix));if(x.pattern)if(e&&e.push(x),_||A)if(x.modifier==="+"||x.modifier==="*"){var P=x.modifier==="*"?"?":"";m+="(?:".concat(_,"((?:").concat(x.pattern,")(?:").concat(A).concat(_,"(?:").concat(x.pattern,"))*)").concat(A,")").concat(P)}else m+="(?:".concat(_,"(").concat(x.pattern,")").concat(A,")").concat(x.modifier);else x.modifier==="+"||x.modifier==="*"?m+="((?:".concat(x.pattern,")").concat(x.modifier,")"):m+="(".concat(x.pattern,")").concat(x.modifier);else m+="(?:".concat(_).concat(A,")").concat(x.modifier)}}if(l)i||(m+="".concat(y,"?")),m+=t.endsWith?"(?=".concat(p,")"):"$";else{var C=r[r.length-1],W=typeof C=="string"?y.indexOf(C[C.length-1])>-1:C===void 0;i||(m+="(?:".concat(y,"(?=").concat(p,"))?")),W||(m+="(?=".concat(y,"|").concat(p,")"))}return new RegExp(m,kt(t))}function Ar(r,e,t){return r instanceof RegExp?bn(r,e):Array.isArray(r)?xn(r,e,t):Rn(r,e,t)}var F=(r=>(r[r.Push=0]="Push",r[r.Replace=1]="Replace",r[r.Put=2]="Put",r[r.Append=3]="Append",r[r.Open=4]="Open",r))(F||{}),Xe=(r=>(r[r.Part=0]="Part",r[r.All=1]="All",r))(Xe||{});const G=Symbol("rootKey"),J=Symbol("rootNodeKey"),ue=Symbol("parentNodeKey"),Ye=Symbol("nameKey");class re{instance=null;model;route;active=!0;index=0;constructor(e,t,n=0,i=!0){this.route=e,this.model=t,this.index=n,this.active=i}}class Ce{_slots;get slots(){return this._slots==null&&(this._slots=w.shallowRef([])),this._slots}get empty(){return this._slots==null||this._slots.value.length==0}[Ye];[G];[J]=null;[ue]=null;get name(){return this[Ye]}constructor(e,t,n){this[Ye]=e,this[G]=t,n&&(this[J]=n)}}class B{view;index;level;constructor(e,t,n){this.view=e,this.index=t,this.level=n}static include(e,t){for(let n=0;n<e.length;n++){let i=e[n];if(i.view===t.view&&(t.index==-1||i.index===t.index)&&i.level===t.level)return!0}return!1}}class dt{views=[]}class Pn{layers=[]}class Cn{time;route}class En{forbidTime=300;submitRecorder=new Cn;isSameRoute(e,t){return e==null||t==null?!1:e.name===t.name&&e.path===t.path&&e.root===t.root}acquire(e){let t=new Date().getTime();if(this.isSameRoute(e,this.submitRecorder.route)&&this.submitRecorder.time&&t-this.submitRecorder.time<=this.forbidTime){this.submitRecorder.time=t;return}return this.submitRecorder.route=e,this.submitRecorder.time=t,t}release(e){this.submitRecorder.time===e&&(this.submitRecorder.route=void 0)}}const we=Symbol("_notifyChange");class ar{currentRoute;routes;constructor(e,t){this.currentRoute=e,this.routes=t}}const Ie=typeof window<"u",L=function(){return window},He=function(){return window.document};function An(r){let e=r,t=e.lastIndexOf("/");return t>0&&t<e.length-1?e=e.substring(0,t+1):t===0&&e.indexOf(".")!==-1?e="/":t===-1&&(e.indexOf(".")==-1?e=`/${e}/`:e="/"),e.indexOf("/")!==0&&(e=`/${e}`),e}function yt(){if(!Ie)return"/";let r=L().location,e=`${r.protocol}//${r.host}`;return e+=An(r.pathname),e}function Ot(r,e,t){r.addEventListener?r.addEventListener(e,t,!1):r.attachEvent?r.attachEvent(`on${e}`,t):r[`on${e}`]=t}function Lt(r,e,t){r.removeEventListener?r.removeEventListener(e,t):r.detachEvent?r.detachEvent(`on${e}`,t):r[`on${e}`]=null}const De=Symbol("ignoreHistoryChangeOnceKey"),ur=Symbol("_navigateFirstRoute"),Ve=Symbol("_getRouteMark"),pt=Symbol("_getUrlSearch"),vt=Symbol("_generateLocation"),Ee=Symbol("_setRouteMarkRecorder"),Ae=Symbol("beforeRestoreFiltersKey"),fr=Symbol("_beforeRestore"),cr="Symbol(_fox_restore_point)";function mt(r,...e){return typeof r=="function"?Reflect.apply(r,null,[...e]):r}class Fr{base;storage;mode;query;firstNavigate=!0;historyMonitor;traceless=!1;changeHandler;historyChange;[De]=!1;[Ae]=new Array;constructor(e="hash",t="",n="",i=!0,s=!0,o=!1,a){this.mode=e,this.base=t,this.query=n,this.firstNavigate=i,this.historyMonitor=s,this.traceless=o,this.storage=a??L().sessionStorage}init(e=!0){const t=L();return typeof this.historyChange!="function"&&(this.historyChange=()=>{if(this[De]){this[De]=!1;return}if(mt(this.historyMonitor)){const n=t.history.state;this[we](n);try{let i=[];if(typeof n=="string"?i=JSON.parse(n):i=n,Array.isArray(i)&&i.length>0){const s=this[Ve]()??"/";this[Ee](s,i)}}catch{}}}),Ot(t,"popstate",this.historyChange),this.firstNavigate&&e&&this[ur](),Promise.resolve()}destroy(){if(this.historyChange){const e=L();Lt(e,"popstate",this.historyChange)}}[fr](e,t,n,i){for(let s of this[Ae])try{const o=[],a=Reflect.apply(s,{},[e,t,n,i]);if(a===!1)return a}catch(o){console.error(o.message,o)}return!0}beforeRestoreEach(e){this[Ae].push(e)}removeBeforeRestoreEach(e){const t=this[Ae].indexOf(e);return t!==-1?(this[Ae].splice(t,1),!0):!1}[ur](){const e=this[Ve]()??"/",t=this.storage.getItem(cr);if(t)try{const o=JSON.parse(t);if(o.mark===e&&Array.isArray(o.routes)&&o.routes.length>0){const a=o.routes.filter((l,u)=>this[fr](l,u,e,o.routes));if(a.length>0){const l=this[pt](),u=a.length-1;a[u].query=l||a[u].query,this[we](a);return}}}catch{}const n=e.indexOf("!");let i;n!=-1?i=e.substring(n+1):i=e;const s=new K;s.path=i,s.query=this[pt](),this[we]([s])}[Ee](e,t){try{const i=JSON.stringify({mark:e,routes:t});this.storage.setItem(cr,i)}catch(n){console.error(n.message,n)}}setRestorePoint(e){const t=this[Ve]()??"/";this[Ee](t,e)}[we](e){typeof this.changeHandler=="function"&&this.changeHandler(e)}[Ve](){const e=L();if(this.mode==="path"){let t=e.location.pathname;return this.base&&t.indexOf(this.base)===0&&(t=t.substring(this.base.length)),t}else{const t=e.location.hash,n=t.indexOf("#");if(n!=-1)return t.substring(n+1)}return null}[pt](){let t=L().location.search;return t.length>0&&t.indexOf("?")===0&&(t=t.substring(1)),t}listen(e){this.changeHandler=e}go(e,t=!0){const n=L();this[De]=!t,n.history.go(e)}push(e){const t=this[vt](e.currentRoute);mt(this.traceless,e.currentRoute)||L().history.pushState(e.routes,"",t);const n=e.currentRoute.fullPath;this[Ee](n,e.routes)}replace(e){const t=this[vt](e.currentRoute);mt(this.traceless,e.currentRoute)||L().history.replaceState(e.routes,"",t);const n=e.currentRoute.fullPath;this[Ee](n,e.routes)}[vt](e){const t=L();let n="";if(e.query){let a="";if(typeof e.query=="object")for(let l of Reflect.ownKeys(e.query)){let u=encodeURIComponent(e.query[l]),f=`${encodeURIComponent(String(l))}=${u}`;a.length>0&&(a+="&"),a+=f}else a=e.query;this.query?(n=a.length>0?`${this.query}&${a}`:this.query,n.length>0&&n.charAt(0)!=="?"&&(n=`?${n}`)):a.length>0&&(n=`?${a}`)}const i=t.location;let s=e.alias??e.fullPath;s.startsWith(ee)&&(s=s.substring(ee.length+1));let o;return n?this.mode=="path"?s.indexOf("/")===0?o=`${this.base}${s}${n}`:o=`${this.base}/${s}${n}`:o=`${i.pathname}${n}#${s}`:this.mode=="path"?s.indexOf("/")===0?o=`${this.base}${s}`:o=`${this.base}/${s}`:o=`${i.pathname}#${s}`,`${i.origin}${o}`}}function Fn(r=!0,e=null,t="",n=!0,i=!1,s){return e!==null&&(e=L().location.pathname),e&&e.endsWith("/")&&(e=e.substring(0,e.length-1)),new Fr("path",e??"",t,r,n,i,s)}function jr(r=!0,e="",t=!0,n=!1,i){return new Fr("hash","",e,r,t,n,i)}class jn{maxSize=50;cursor=-1;queue=[];changeHandler;base;historyMonitor=!1;traceless=!1;constructor(e,t=50){this.base=e,this.maxSize=t}init(e=!0){return Promise.resolve()}destroy(){this.queue=[]}beforeRestoreEach(e){}removeBeforeRestoreEach(e){return!1}listen(e){this.changeHandler=e}[we](e){typeof this.changeHandler=="function"&&this.changeHandler(e)}go(e,t=!0){if(this.queue.length==0||this.cursor<=0||this.cursor>=this.queue.length-1)return;let n=this.cursor+e;if(n<0?n=0:n>this.queue.length-1&&(n=this.queue.length-1),n!=this.cursor&&(this.cursor=n,t)){const i=this.queue[n];this[we](i.routes)}}push(e){this.queue.length>=this.maxSize&&this.queue.splice(0,1),this.queue.push(e),this.cursor=this.queue.length-1}replace(e){let t=this.queue.length-this.cursor;this.queue.splice(this.cursor,t),this.queue[this.cursor]=e}setRestorePoint(e){}}function Tr(r="",e=50){return new jn(r,e)}const Be=Symbol("_constructRouteModel"),Ue=Symbol("_findRouteModel"),gt=Symbol("_findRootView"),hr=Symbol("_getFirstView"),le=Symbol("_removeView"),dr=Symbol("_buildPage"),yr=Symbol("_resolveComponent"),pr=Symbol("_update"),ne=Symbol("_merge"),wt=Symbol("_handleHistoryChange"),ke=Symbol("_handleRouteUpdated"),We=Symbol("routeUpdatedCallback"),b=Symbol("currentRoutes"),pe=Symbol("current"),vr=Symbol("_addRouteRecorder"),Fe=Symbol("_removeRouteRecorder"),ze=Symbol("_cloneRouteRecorder"),q=Symbol("_handleError"),Je=Symbol("errorCallback"),U=Symbol("registerKey"),Ge=Symbol("notFoundKey"),bt=Symbol("notFoundPathKey"),k=Symbol("forestKey"),E=Symbol("historyKey"),je=Symbol("beforeFiltersKey"),Te=Symbol("afterFiltersKey"),$e=Symbol("destroyFiltersKey"),ve=Symbol("mainDispatcherKey"),xt=Symbol("initKey"),ae=Symbol("readyKey"),Rt=Symbol("readyHandlersKey"),Qe=Symbol("_markReady"),mr=Symbol("_createNextFn"),St=Symbol("_start"),Pt=Symbol("_before"),Ct=Symbol("_after"),gr=Symbol("_destroy"),Et=Symbol("_load"),_e=Symbol("_unload"),Ke=Symbol("routerGuardKey");function Tn(r){return r.layers.length==0||r.layers[0].views.length==0}function $n(r){let e=[];return r.layers.forEach(t=>{t.models==null||t.models==null||t.models.forEach(n=>{if(!(n==null||n==null))if(typeof n.meta=="object"){let i=T(!0,{},n.meta);e.push(i)}else n.meta&&e.push(n.meta)})}),e}class _n{[U]=new Array;[Ge];[bt]="*";[ae]=!1;[Rt]=[];[k]=new Pn;[E];[b]=new Array;[Je]=null;[We]=null;[je]=new Array;[Te]=new Array;[$e]=new Array;[ve]=new Me;[Ke]=new En;[xt]=!1;[pe]=w.ref(null);get current(){return this[pe].value}options;constructor(e){this.options=e??{},this.options.notFoundPath&&this.setNotFoundPath(this.options.notFoundPath);let t=this.options.routes||[];this.addRoutes(t),this.options.notFound&&this.setNotFoundRoute(this.options.notFound),e.history?this[E]=e.history:this[E]=Ie?jr():Tr(),this[E]?.listen(async n=>{let i=!0;try{if(typeof n=="string"){const s=this[H](n);s&&await this[wt]([s])}else await this[wt](n)}catch(s){console.error(s.message,s),i=!1}this[ae]===!1&&this[Qe](i)})}[q](e="error",t){if(t&&typeof t.error=="function")try{t.error(e)}catch{}if(typeof this[Je]=="function")try{this[Je](e,t)}catch{}console.error(e)}init(){this[xt]!==!0&&(this[E]?.init(!this[ae]),this[xt]=!0)}isReady(){return this[ae]?Promise.resolve():new Promise((e,t)=>{this[Rt].push([e,t])})}[Qe](e){this[ae]=!0,this[Rt].forEach(([t,n])=>{try{e?t():n()}catch(i){console.error(i.message,i)}})}[wt](e){try{if(!e){let o=[...this[b]].reverse();return this[_e](o),Ie&&L().location.reload(),Promise.resolve()}let t=null,n=[],i=[],s=0;for(;s<e.length&&s<this[b].length&&K.isSame(e[s],this[b][s]);s++)e[s].active===!0&&e[s].active!==this[b][s].active&&(t=e[s]);if(s<e.length&&(n=e.slice(s)),s<this[b].length&&(i=this[b].slice(s).reverse()),i.length===0&&n.length===0){if(t!==null)return this.restore([t])}else if(i.length>0){if(this[_e](i)){if(n.length>0)return this.restore(n);if(t!==null)return this.restore([t])}}else return this.restore(n)}catch(t){this[q](t)}return Promise.resolve()}[ke](e){if(e)this[pe].value=e;else{let t=this[b].length;t>0?this[pe].value=this[b][t-1]:this[pe].value=null}if(typeof this[We]=="function")try{this[We](this[pe].value)}catch{}}[vr](e){if(e.opsType===F.Open){let t=!1;const n=this[b].length-1;for(let i=n;i>=0;i--){const s=this[b][i];if(e.root==s.root){if(e.path===s.path){this[b].splice(i,1,e),t=!0;continue}e.active&&(s.active=!1)}}t||this[b].push(e)}else this[b].push(e)}[ze](){let e=[];for(let t of this[b]){let n=K.clone(t,!0);e.push(n)}return e}[Fe](e){if(!this[b])return;let t=-1;for(let n=0;n<this[b].length;n++)if(K.isSame(this[b][n],e)){t=n;break}if(t!=-1){let n=this[b][t];this[b].splice(t,1),this[gr](n,n.session)}}set historyMonitor(e){this[E]&&(this[E].historyMonitor=e)}get historyMonitor(){return this[E]?this[E].historyMonitor:!1}set traceless(e){this[E]&&(this[E].traceless=e)}get traceless(){return this[E]?this[E].traceless:!1}setRestorePoint(){const e=this[ze]();this[E]?.setRestorePoint(e)}onRouteUpdated(e){this[We]=e}onError(e){this[Je]=e}beforeEach(e){this[je].push(e)}removeBeforeEach(e){const t=this[je].indexOf(e);return t!==-1?(this[je].splice(t,1),!0):!1}afterEach(e){this[Te].push(e)}removeAfterEach(e){const t=this[Te].indexOf(e);return t!==-1?(this[Te].splice(t,1),!0):!1}destroyEach(e){this[$e].push(e)}removeDestroyEach(e){const t=this[$e].indexOf(e);return t!==-1?(this[$e].splice(t,1),!0):!1}beforeRestoreEach(e){this[E]?.beforeRestoreEach(e)}removeBeforeRestoreEach(e){return this[E]?.removeBeforeRestoreEach(e)??!1}addRoutes(e){for(let t of e)this.addRoute(t)}addRoute(e,t=-1){if(e.path===this[bt]){this.setNotFoundRoute(e);return}const n=this[Be](e);if(t==-1)this[U]=[...this[U],...n];else for(let i=n.length-1;i>=0;i--)this[U].splice(t,0,n[i])}removeRoute(e){const t=this[H](e);if(t===null)return console.warn("route格式错误",e),!1;for(let n=0;n<this[U].length;n++){const i=this[U][n];if(t?.path&&i.path===t.path)return this[U].splice(n,1),!0;if(t?.name&&i.name===t.name)return this[U].splice(n,1),!0}return!1}hasRoute(e){const t=this[H](e);return t===null?(console.warn("route格式错误",e),!1):this[U].findIndex(i=>{if(t?.path&&i.path===t.path||t?.name&&i.name===t.name)return!0})!==-1}setNotFoundPath(e){this[bt]=e}setNotFoundRoute(e){const t=this[Be](e);this[Ge]=t[0]}getRoutes(){return[...this[U]]}[Be](e){let t=e.path??"";t.length>0&&t.charAt(0)!=="/"&&(t=`/${t}`);let n=e.components??(e.component&&{"":e.component});if(n==null){const a=new at;return a.path=t,a.redirect=e.redirect,[a]}let i=[];for(let a in n){let l=n[a];a.length===0&&(a=ee);let u=new nn(a,l,e.props,e.meta);i.push(u)}let s=!1,o=[];if(e.children)for(let a of e.children){let l=this[Be](a);for(let u of l){let f=new at;f.name=u.name,u.path&&u.path.length>0?t!=="/"?f.path=`${t}${u.path}`:f.path=u.path:(s=!0,f.path=t);let c=new rr;c.models=[...i],f.layers=[c,...u.layers],o.push(f)}}if(!s){const a=new rr;a.models=i;const l=new at;l.name=e.name,l.path=t,l.layers=[a],o.splice(0,0,l)}return o}[Ue](e){const t=e.route;try{for(let n of this[U])if(t.path&&n.path){let i=n.match;i||(i=n.match=gn(n.path));let s=i(t.path);if(!s)continue;if(n.redirect){let o=new K;T(!0,o,t),o.path=n.redirect;let a={route:o,find:void 0};return this[Ue](a)?(e.route=a.route,e.find=a.find,!0):!1}if(t.params=t.params??{},T(!0,t.params,s.params),t.query){let o=t.query;if(typeof o=="string"){let a={},l=o.split("&");for(let u of l){let f=u.split("=");if(f.length!==2)continue;let c=decodeURIComponent(f[0].trim()),h=decodeURIComponent(f[1].trim());a[c]=h}T(!0,t.params,a)}else typeof o=="object"&&T(!0,t.params,o)}return e.find=n,!0}else if(t.name===n.name){t.params=t.params??{};let i=vn(n.path);return t.path=i(t.params),e.find=n,!0}}catch(n){console.error(n.message,n),typeof t.error=="function"&&t.error(n.message)}return!1}[H](e){let t=null;if(Array.isArray(e))if(t=new K,typeof e[0]=="object")t=K.from(e[0]);else for(let n=0;n<e.length;n++)n===0?e[n].charAt(0)==="/"?t.path=e[n]:t.name=e[n]:n===1?t.params=e[n]:n===2?t.root=e[n]:n===3&&T(!1,t,e[n]);else typeof e=="object"?t=K.from(e):typeof e=="string"&&(t=new K,e.charAt(0)=="/"?t.path=e:t.name=e);if(t){if(t.path){let n=t.path.indexOf("?");n!==-1&&n<t.path.length-1&&(t.query=t.path.substring(n+1),t.path=t.path.substring(0,n))}t.root=t.root??ee,t.opsType=t.opsType??this.options.defaultOperationType??F.Push}return t}push(...e){let t=this[H](e);return t?(t.opsType=t.opsType||F.Push,this.to(t)):(this[q]("resolve route fail",t),this)}put(...e){let t=this[H](e);return t?(t.opsType=F.Put,this.to(t)):(this[q]("resolve route fail",t),this)}replace(...e){let t=this[H](e);return t?(t.opsType=F.Replace,this.to(t)):(this[q]("resolve route fail",t),this)}append(...e){let t=this[H](e);return t?(t.opsType=F.Append,this.to(t)):(this[q]("resolve route fail",t),this)}remove(e){return new Promise(t=>{this[ve].post(n=>{try{if(this[b].length===0){n.resolve(),t(!1);return}let i=-1,s,o=[];if(e){if(e.root?s=e.root:s=this[b][0].root??ee,e.all)for(let l=this[b].length-1;l>0;l--){let u=this[b][l];u.opsType===F.Append&&u.root===s&&(o.splice(0,0,u),i=l-1)}else if(e.until)for(let l=this[b].length-1;l>0;l--){let u=this[b][l];if(u.opsType===F.Append&&u.root===s){if(e.until.charAt(0)==="/"&&e.until===u.path){i=l;break}else if(e.until===u.name){i=l;break}o.splice(0,0,u)}}}else{s=ee;let l=this[hr](this[k]);l&&(s=l.name);for(let u=this[b].length-1;u>0;u--){let f=this[b][u];if(f.opsType===F.Append&&f.root===s){o.push(f),i=u-1;break}}}if(o.length===0){let l="can not find route";console.warn(l),n.resolve(l),t(!1);return}let a=0;if(this[b].forEach(l=>{l.opsType!==F.Put&&a++}),this[_e](o)){let l=0;this[b].forEach(f=>{f.opsType!==F.Put&&l++});const u=l-a;this[E]?.go(u,!1),n.resolve(),t(!0)}}catch(i){this[q](i),n.resolve(),t(!1)}})})}open(...e){let t=this[H](e);return t?(t.opsType=F.Open,this.to(t)):(this[q]("resolve route fail",t),this)}close(e){return this[ve].post(t=>{try{let n=this[H](e);if(!n){t.reject("resolve route fail");return}let i=[];for(let s=0;s<this[b].length;s++){let o=this[b][s];if(o.root===n.root){if(!n.path&&!n.name){i.push(o);continue}if(n.path&&n.path===o.path){i.push(o);break}else if(n.name&&n.name===o.name){i.push(o);break}}}if(i.length===0){t.resolve();return}this[_e](i)&&this[ke](),t.resolve()}catch(n){this[q](n),t.resolve()}}),this}to(...e){let t=this[H](e);if(!t)return this[q]("resolve route fail",t),this;let n=this[Ke].acquire(t);return n==null?(this[q]("route forbid",t),this):(this[ve].post(i=>{try{let s=this[St](t);this[Pt](s),this[Et](s),this[Ct](s),s.wait((o,a)=>{const l=o.session.to;try{let u=K.clone(l,!0);const f=new ar(u,this[ze]());l.opsType===F.Replace?this[E]?.replace(f):this[E]?.push(f)}catch(u){console.error(u.message,u)}if(this[Ke].release(n),this[ke](l),typeof t.success=="function")try{Reflect.apply(t.success,{},[])}catch(u){console.error(u.message,u)}this[ae]===!1&&this[Qe](!0),i.resolve()},(o,a)=>{this[Ke].release(n),a!==null&&this[q](a,t),this[ae]===!1&&this[Qe](!1),i.resolve()})}catch(s){this[Ke].release(n),this[q](s,t),i.resolve()}}),this)}back(e=1){this[E]?.go(-e)}[mr](e){return(t,n)=>{if(typeof t=="boolean")e.session.redirect=!1,t?e.resolve():e.reject(n??null);else if(t){const i=this[H](t);if(i){const s=e.session.to;i.success=s.success,i.error=s.error,e.session.to=i,e.session.redirect=!0,e.session.routeModel=null,e.resolve()}else e.session.redirect=!1,e.reject("route resolve fail")}else e.session.redirect=!1,e.resolve()}}[St](e){let t=this[b].length>0?this[b][0]:void 0,n=new et(e,t),i={route:e,find:null};return this[Ue](i),i.find&&(n.routeModel=i.find,e.matched=$n(i.find),Array.isArray(e.matched)&&e.matched.length>0&&(e.meta=i.find.layers[0].models[0].meta)),new Me(n)}[Pt](e){for(let t of this[je])e.post(n=>{let i=this[mr](n);Reflect.apply(t,{},[n.session.to,n.session.from,i,n.session])})}[Ct](e){e.post(t=>{for(let n of this[Te])try{Reflect.apply(n,{},[t.session.to,t.session.from,t.session])}catch(i){console.error(i.message,i)}t.resolve()})}[gr](e,t){for(let n of this[$e])try{Reflect.apply(n,{},[e,t])}catch(i){console.error(i.message,i)}typeof e.destroy=="function"&&Reflect.apply(e.destroy,e,[])}[Et](e){e.post(t=>{let n=t.session.to,i=t.session.routeModel;if(i==null){let o={route:n,find:null};if(this[Ue](o))i=o.find,t.session.routeModel=i;else if(this[Ge])i=this[Ge];else{t.reject(`not find route model, path:${n.path??n.name}`);return}}let s=et.from(t.session);this[dr](n,i,s).then(o=>{this[k],t.resolve()},o=>{t.reject(o)})})}[_e](e){if(e.length==0)return!0;let t=this[k],n=[];for(let i of e){let s=this[gt](t,i);s!=null&&n.push({...s,route:i})}if(n.length==0){let i="can not find view index";return this[q](i),!1}for(let i of n.reverse())this[le](t,{x:i.x,y:i.y},[i.route.index??0],!0);return!0}[gt](e,t){const n=t.root??ee;let i;for(let s=0;s<e.layers.length;s++){const o=e.layers[s];for(let a=o.views.length-1;a>=0;a--){const l=o.views[a];if(l[G]&&l[Ye]===n)return i={x:a,y:s},i}}return null}[hr](e){return e.layers.length>0&&e.layers[0].views.length>0?e.layers[0].views[0]:null}[le](e,t,n=null,i=!0){if(t.y>=e.layers.length||t.x>=e.layers[t.y].views.length)return;let s=e.layers[t.y].views[t.x],o=!1,a=[],l=!1,u=[...s.slots.value];for(let c=u.length-1;c>=0;c--){let h=u[c];(!n||n.indexOf(h.index)!=-1)&&(h.route&&s[G]&&(this[Fe](h.route),h.active===!0&&h.route.opsType==F.Append&&(l=!0)),a.push(new B(s,h.index,t.y)),u.splice(c,1))}if(u.length==0)i?s.slots.value=u:e.layers[t.y].views.splice(t.x,1);else{if(l){let c=u.length-1,h=u[c];h.active=!0,h.route&&(h.route.active=h.active)}s.slots.value=u}e.layers[t.y].views.length==0&&(o=!0);let f=t.y+1;for(;f<e.layers.length;f++){let c=e.layers[f].views,h=[];for(let d=c.length-1;(o||a.length>0)&&d>=0;d--){let v=c[d];if(v[ue]&&(o||B.include(a,v[ue]))){let p=v.slots.value;for(let y=p.length-1;y>=0;y--){let m=p[y];m.route&&v[G]&&this[Fe](m.route),h.push(new B(v,m.index,f)),p.splice(y,1)}e.layers[f].views.splice(d,1)}}a=h,e.layers[f].views.length==0&&(o=!0)}}restore(e){if(!e||this[U].length==0){let t=this[k];if(t.layers.length>0){let n=t.layers[0].views;n.length>0&&(n[0].slots.value=[])}return this[b]=[],this[ke](),Promise.resolve()}else return new Promise((n,i)=>{let s=null,o=!1;for(let a=0;a<e.length;a++){const l=e[a];this[ve].post(u=>{const f=this[St](l);this[Pt](f),this[Et](f),this[Ct](f),f.wait((c,h)=>{s=c.session.to,o=c.session.redirect,u.resolve()},(c,h)=>{s=null,h!==null&&this[q](h),u.resolve()})})}this[ve].post(a=>{if(s&&o===!0){const l=K.clone(s,!0),u=new ar(l,this[ze]());this[E]?.replace(u)}a.resolve(),n()})})}[dr](e,t,n){let i=e.updateType??Xe.Part;return this[yr](t).then(()=>{this[pr](t,e,n,i)})}[yr](e){let t=[];for(let n=0;n<e.layers.length;n++){let i=e.layers[n];for(let s=0;s<i.models.length;s++){let o=i.models[s];o.isResolved||t.push(o.resolve())}}return t.length>0?Promise.all(t):Promise.resolve()}[pr](e,t,n,i){if(e.layers[0].models.length!==1)return Promise.reject("illegal route structure(multi root node)");const s=e.layers[0].models[0];let o=this[k],a=Tn(o),l=t.root??ee,u;!a&&i==Xe.Part&&(u=this[gt](o,t));let f,c=0;if(u==null||u==null)if(a||i===Xe.All){if(o.layers.length==0&&(o.layers[0]=new dt),o.layers[0].views.length==0){let h=t.root??ee;f=new Ce(h,!0,null),o.layers[0].views=[f]}else f=o.layers[0].views[0];u={x:0,y:0}}else{let h=t.slot;if(!h)return Promise.reject("can not rebuild view(because not route slot)");let d=h.level;if(d>o.layers.length)return Promise.reject("can not insert view(override level)");let v;if(h.rootName){let p=o.layers[d-1];for(let y of p.views){if(y[G]&&y.name===h.rootName){v=new B(y,h.rootIndex??0,d-1);break}if(y[J]&&y[J].view.name===h.rootName&&y[J].index===h.rootIndex){v=y[J];break}}}if(!v)return Promise.reject("can not insert view(not find root node ref)");f=new Ce(l,!0,v),o.layers[d].views.push(f),u={x:o.layers[d].views.length-1,y:d}}else f=o.layers[u.y].views[u.x];if(c=u.y,f[G]=!0,t.opsType===F.Append){t.index=oe.get(),t.active=!0;let h=f.slots.value;if(h.length>0){let m=h[h.length-1];m.active=!1,m.route&&(m.route.active=m.active)}let d=new re(t,s,t.index,!0);f.slots.value=[...h,d];let v=c+1,p=1,y=new B(f,t.index,c);this[ne](o,v,e,p,y)}else if(t.opsType===F.Open){let h=f.slots.value;const d=t.active??!0;let v=!1;for(let p of h){if(p.route!==null&&K.isSameForRouteModel(p.route,t)){if(p.active===d)return t.index=p.index,t.active=d,p.route=t,Promise.resolve();p.active=d,v=!0,t.index=p.index,t.active=d,p.route=t}else d&&(p.active=!1);p.route&&(p.route.active=p.active)}if(!v){t.index=oe.get(),t.active=d;let p=new re(t,s,t.index,d);h.push(p);let y=c+1,m=1,g=new B(f,t.index,c);this[ne](o,y,e,m,g)}f.slots.value=[...h]}else{let h=f.slots.value;if(h.length==0){t.index=oe.get(),t.active=!0,f.slots.value=[new re(t,s,t.index)];let d=c+1,v=1,p=new B(f,t.index,c);this[ne](o,d,e,v,p)}else{let d=h[0];if(d.model!==s){this[le](o,u,null,!0),t.index=oe.get(),t.active=!0,f.slots.value=[new re(t,s,t.index)];let v=c+1,p=1,y=new B(f,t.index,c);this[ne](o,v,e,p,y)}else{d.route!==null&&this[Fe](d.route);let v=!1;const p=t.active??!0;d.active!==p&&(d.active=p,v=!0),t.active=p,t.index=d.index,d.route=t;let y=[];for(let _=1;_<h.length;_++)y.push(h[_].index);y.length>0?this[le](o,u,y,!0):v&&(f.slots.value=[...h]);let m=[new B(f,t.index,c)],g=c+1,$=1,x=new B(f,t.index,c);for(;m.length>0&&g<o.layers.length&&$<e.layers.length;g++,$++){let _=[];for(let P=0;P<o.layers[g].views.length;P++){let C=o.layers[g].views[P];C[ue]&&B.include(m,C[ue])&&_.unshift(P)}let A=[];for(let P of _){let C=o.layers[g].views[P],W=e.layers[$].models,M;for(let I=0;I<W.length;I++)if(C.name===W[I].name){M=W[I];break}if(!M)this[le](o,{x:P,y:g},null,!1);else{let I=C.slots.value;if(I.length==0){let X=0;C.slots.value=[new re(null,M,X)];let z=g+1,te=$+1;this[ne](o,z,e,te,x)}else{let X=I[0];if(X.model!==M){this[le](o,{x:P,y:g},null,!0),C.slots.value=[new re(null,M,0)];let z=g+1,te=$+1;this[ne](o,z,e,te,x)}else{C[G]&&X.route!==null&&this[Fe](X.route);let z=[];for(let te=1;te<I.length;te++)z.push(I[te].index);z.length>0&&this[le](o,{x:P,y:g},z,!0),A.push(new B(C,X.index,g))}}C[G]=!1}}m=A}this[ne](o,g,e,$,x)}}}if(f&&f[J]){let h=f[J];h&&(t.slot=new rn(l,c,h?.view.name,h?.index??0))}n.to=void 0,n.routeModel=void 0,t.session=n,this[vr](t)}[ne](e,t,n,i,s){let o=i,a=t;for(;a<e.layers.length&&o<n.layers.length;a++,o++){let l=e.layers[a].views;for(let u of n.layers[o].models){let f=new Ce(u.name,!1,s),c=new re(null,u);f.slots.value=[c],l.push(f)}}for(;o<n.layers.length;o++){let l=new dt;l.views=[];for(let u of n.layers[o].models){let f=new Ce(u.name,!1,s),c=new re(null,u);f.slots.value=[c],l.views.push(f)}e.layers.push(l)}}[Sr](e,t,n,i,s,o){if(t<0||t>this[k].layers.length)return null;if(t<this[k].layers.length){let f=this[k].layers[t],c=null;for(let h of f.views){let d=!1;if(n!==null?(d=h.name===e&&h[J]?.view===n,d&&i!==-1&&(d=h[J]?.index===i)):d=h.name===e,!!d){s!==null&&(h[ue]={view:s,index:o,level:t-1}),c=h;break}}if(c!==null)return c}let a=null,l=null;s!==null&&(s[G]?a={view:s,index:o,level:t-1}:a=s[J],l={view:s,index:o,level:t-1});let u=new Ce(e,!0,a);if(u[ue]=l,t==this[k].layers.length){let f=new dt;f.views=[u],this[k].layers.push(f)}else this[k].layers[t].views.push(u);return u}}const Kn="fox-router-view",qn="fox-router-link";function $r(r,e=!1){let t=null;return e?t=r.showFromClass??r.enterFromClass:t=r.enterFromClass,t||(t=r.transitionName,t?e?`${t}-show-from`:`${t}-enter-from`:null)}function _r(r,e=!1){let t=null;return e?t=r.showActiveClass??r.enterActiveClass:t=r.enterActiveClass,t||(t=r.transitionName,t?e?`${t}-show-active`:`${t}-enter-active`:null)}function On(r,e=!1){let t=null;return e?t=r.showToClass??r.enterToClass:t=r.enterToClass,t||(t=r.transitionName,t?e?`${t}-show-to`:`${t}-enter-to`:null)}function Ln(r,e=!1){let t=null;return e?t=r.hideFromClass??r.leaveFromClass:t=r.leaveFromClass,t||(t=r.transitionName,t?e?`${t}-hide-from`:`${t}-leave-from`:null)}function Mn(r,e=!1){let t=null;return e?t=r.hideActiveClass??r.leaveActiveClass:t=r.leaveActiveClass,t||(t=r.transitionName,t?e?`${t}-hide-active`:`${t}-leave-active`:null)}function In(r,e=!1){let t=null;return e?t=r.hideToClass??r.leaveToClass:t=r.leaveToClass,t||(t=r.transitionName,t?e?`${t}-hide-to`:`${t}-leave-to`:null)}function Nn(r,e=!1){let t=null;return e?t=r.beforeShow??r.beforeEnter:t=r.beforeEnter,t}function Hn(r,e=!1){let t=null;return e?t=r.show??r.enter:t=r.enter,t}function Dn(r,e=!1){let t=null;return e?t=r.afterShow??r.afterEnter:t=r.afterEnter,t}function Vn(r,e=!1){let t=null;return e?t=r.showCancelled??r.enterCancelled:t=r.enterCancelled,t}function Bn(r,e=!1){let t=null;return e?t=r.hide??r.leave:t=r.leave,t}function Un(r,e=!1){let t=null;return e?t=r.afterHide??r.afterLeave:t=r.afterLeave,t}function kn(r,e=!1){let t=null;return e?t=r.hideCancelled??r.leaveCancelled:t=r.leaveCancelled,t}function Wt(r){let e,t=r.duration;return typeof t=="object"?e={enter:t.enter??-1,leave:t.leave??-1,show:t.show??-1,hide:t.hide??-1}:(typeof t=="string"&&(t=t.length==0?-1:Number(t)),e={enter:t,leave:t,show:t,hide:t}),e}function be(r,e){r.classList.contains(e)||r.classList.add(e)}function xe(r,e){r.classList.remove(e)}const Wn=Ie&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout;function zt(r){Wn(r)}function D(r,e,t){S(e)&&(r==null&&(r={}),Reflect.apply(e,r,t))}function Kr(r,e,t,n=-1,i,s,o,a){if(S(s)){if(i!==void 0&&i>=0){setTimeout(()=>{Reflect.apply(s,r,[e,t,n]),S(a)&&Reflect.apply(a,r,[])},i);return}const l=["animationend","transitionend"],u=f=>{l.forEach(c=>{Lt(e,c,u)}),Reflect.apply(s,r,[e,t,n]),a&&Reflect.apply(a,r,[])};l.forEach(f=>{Ot(e,f,u)})}if(S(o)){const l="animationcancel",u=f=>{Reflect.apply(o,r,[e,t,n]),Lt(e,l,u)};Ot(e,l,u)}}function Jt(r){return!Ie||r===null?!1:r.opsType===F.Append||r.opsType===F.Open}function qr(r,e,t,n={},i,s=-1){if(e||Jt(i)){const o=$r(n,e);o&&be(t,o);const a=_r(n,e);a&&be(t,a);const l=Nn(n,e);D(r,l,[t,e,i,s])}}function Or(r,e,t,n={},i,s,o,a){if(!Jt(s)&&!e){S(a)&&a(r,a,[t]);return}const l=$r(n,e),u=_r(n,e),f=On(n,e),c=Hn(n,e),h=Dn(n,e),d=Vn(n,e);zt(()=>{Kr(r,t,s,o,i,()=>{u&&xe(t,u),f&&xe(t,f),S(h)&&D(r,h,[t,e,s,o]),S(a)&&a(r,a,[t])},()=>{S(d)&&D(r,d,[t,e,s,o])}),l&&xe(t,l),f&&be(t,f),S(c)&&D(r,c,[t,e,s,o])})}function Lr(r,e,t,n={},i,s,o,a,l){if(!Jt(o)&&!e){!e&&S(s)&&s();return}const u=Ln(n,e),f=Mn(n,e),c=In(n,e),h=Bn(n,e),d=Un(n,e),v=kn(n,e);u&&be(t,u),f&&be(t,f),S(h)&&D(r,h,[t,e,o,a]),zt(()=>{Kr(r,t,o,a,i,()=>{f&&xe(t,f),c&&xe(t,c),S(d)&&D(r,d,[t,e,o,a]),S(l)&&D(r,l,[t]),!e&&S(s)&&s()},()=>{S(v)&&D(r,v,[t,e,o,a]),S(l)&&D(r,l,[t]),!e&&S(s)&&s()}),u&&xe(t,u),c&&be(t,c)})}function Mt(r,e={},t,n=-1){const i=e.mode??"default",s=Wt(e);return{mode:i,persisted:!1,beforeEnter:a=>{qr(r,!1,a,e,t,n)},enter:a=>{Or(r,!1,a,e,s.enter,t,n)},leave:(a,l)=>{Lr(r,!1,a,e,s.leave,l,t,n)},clone:a=>Mt(r,e,t,n)}}function Mr(r){return r.el}function zn(r,e,t={},n,i,s,o){if(s){const a=Mr(e);if(a==null)return;const l=Wt(t);qr(r,!0,a,t,n,i),Or(r,!0,a,t,l.show,n,i,u=>{S(o)&&D(r,o,[u])})}else S(o)&&D(r,o,[])}function Jn(r,e,t={},n,i,s,o){if(s){const a=Mr(e);if(a==null)return;const l=Wt(t);Lr(r,!0,a,t,l.hide,null,n,i,u=>{S(o)&&D(r,o,[u])})}else S(o)&&D(r,o,[])}function Gn(r,e={}){zt(()=>{for(let t=0;t<r.length;t++)Reflect.apply(r[t],e,[])})}function ie(r,e,t){return typeof r=="function"?Reflect.apply(r,{},[e,t]):r}function At(r,e){if(!r)return null;const t=r(e);return t.length===1?t[0]:t}class Qn{node;state;constructor(e,t){this.node=e,this.state=t}}const It=w.defineComponent({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,required:!1,default:"default"},modelSlot:{type:[Object],required:!1},multi:{type:Boolean,required:!1,default:!1},tag:{type:[String,Object,Function],required:!1,default:"div"},viewTag:{type:[String,Object,Function],required:!1,default:"div"},viewTagProps:{type:[Object,Function],required:!1,default(){return{}}},viewClass:{type:[String,Function],required:!1},viewActiveClass:{type:[String,Function],required:!1},viewInactiveClass:{type:[String,Function],required:!1},transition:{type:[Boolean,String,Function],required:!1,default:!1},transitionName:{type:String,required:!1},enterFromClass:{type:String,required:!1},enterActiveClass:{type:String,required:!1},enterToClass:{type:String,required:!1},leaveFromClass:{type:String,required:!1},leaveActiveClass:{type:String,required:!1},leaveToClass:{type:String,required:!1},showFromClass:{type:String,required:!1},showActiveClass:{type:String,required:!1},showToClass:{type:String,required:!1},hideFromClass:{type:String,required:!1},hideActiveClass:{type:String,required:!1},hideToClass:{type:String,required:!1},beforeEnter:{type:Function,required:!1},enter:{type:Function,required:!1},afterEnter:{type:Function,required:!1},enterCancelled:{type:Function,required:!1},beforeLeave:{type:Function,required:!1},leave:{type:Function,required:!1},afterLeave:{type:Function,required:!1},leaveCancelled:{type:Function,required:!1},beforeShow:{type:Function,required:!1},show:{type:Function,required:!1},afterShow:{type:Function,required:!1},showCancelled:{type:Function,required:!1},beforeHide:{type:Function,required:!1},hide:{type:Function,required:!1},afterHide:{type:Function,required:!1},hideCancelled:{type:Function,required:!1}},setup(r,e){const t=w.getCurrentInstance();if(t===null||t.proxy===null){console.error("instance or instance.proxy not exist");return}const n=r.multi===!0,i=w.inject(it,null),s=w.inject(ft,0),o=w.inject(or,null),a=w.inject(ct,-1);let l=null;const u=r.modelSlot;if(u){if(w.provide(ft,s+1),w.provide(ct,u.index),w.provide(ht,u.index),!u.route){console.warn("child view render error, route not exist");return}const h=tt(t.proxy,!0);un(h),sr(h,()=>u.route??null)}else{if(i==null){console.error("router is not been injected");return}const c=r.name,h=w.inject(lr,null),d=w.inject(ht,0);if(l=i[Sr](c,s,o,a,h,d),l===null)return;w.provide(lr,l);const v=l[G]===!0;if(v&&w.provide(or,l),!n&&(w.provide(ct,-1),w.provide(ft,s+1),w.provide(ht,-1),v)){const p=tt(t.proxy,!0);sr(p,()=>{const y=l.slots.value;return y.length>0?y[0].route:null})}}const f={value:new Map};return w.onUnmounted(()=>{f.value&&f.value.clear()}),()=>{if(n){const c=new Map,h=[],d=l?.slots.value,v=[];for(let m=0;m<d.length;m++){const g=d[m],$=`${r.name}_${g.index}`,x=ie(r.transition,g.route,m)??!0,_={modelSlot:g};let A;e.slots.default?A=w.h(It,_,{default:e.slots.default}):A=w.h(It,_);const P={},C=ie(r.viewClass,g.route,m);typeof C=="string"&&C.length>0&&(P[C]=!0);const W=ie(r.viewActiveClass,g.route,m),M=ie(r.viewInactiveClass,g.route,m),I=f.value.get($);if(typeof W=="string"&&W.length>0&&(P[W]=g.active),typeof M=="string"&&M.length>0&&(P[M]=!g.active),I&&g.active!==I.state){const he=I.node;g.active?v.unshift(()=>{const ot=()=>{let Re=nr(he);Re!=null&&ir(Re,Kt.ACTIVATED)};zn(t,he,r,g.route,m,x,ot)}):v.push(()=>{const ot=()=>{const Re=nr(he);Re!=null&&ir(Re,Kt.DEACTIVATED)};Jn(t,he,r,g.route,m,x,ot)})}const X={class:P,key:$},z=ie(r.viewTagProps,g.route,m);z!==null&&typeof z=="object"&&T(!0,X,z),g.route?.viewTagAttrs&&typeof g.route?.viewTagAttrs=="object"&&T(!0,X,g.route.viewTagAttrs);const te=ie(r.viewTag,g.route,m),st=w.h(te,X,{default:()=>[A]});if(c.set($,new Qn(st,g.active)),f.value.delete($),x){const he=Mt(t,r,g.route,m);st.transition=he}h.push(st)}f.value.forEach(m=>{m.node.transition=null}),f.value=c,Gn(v,t);const p=ie(r.tag,null,-1),y={};return Object.assign(y,e.attrs),w.h(p,y,{default:()=>h})}else if(u!=null){const c=u.model,h={};c.props&&(typeof c.props=="object"?T(!1,h,c.props):c.props===!0&&typeof u.route?.params=="object"&&T(!1,h,u.route?.params));const d=w.h(c.component,h);return At(e.slots.default,{Component:d,route:u.route})??d}else{const c=l.slots.value;if(c.length>0){const h=c[0],d=h.route??(t.proxy&&Ut(t.proxy))??null,v=h.model,p={};v.props&&(typeof v.props=="object"?T(!1,p,v.props):v.props===!0&&typeof d?.params=="object"&&T(!1,p,d?.params));const y=w.h(v.component,p);if(ie(r.transition,d,-1)??!0){const g=Mt(t,r,d,-1);y.transition=g}return At(e.slots.default,{Component:y,route:d})??y}else return At(e.slots.fallback,{})}}}});function Xn(r){if(!(r.metaKey||r.altKey||r.ctrlKey||r.shiftKey)&&!r.defaultPrevented&&!(r.button!=null&&r.button!==0)){if(r.currentTarget&&r.currentTarget.getAttribute){const e=r.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return r.preventDefault&&r.preventDefault(),!0}}function Yn(r,e){return r==null||e==null?!1:!!(r===e||r.path&&r.path===e.path||r.name&&r.name===e.name)}function Zn(r,e){return r==null||e==null?!1:!!(r.path&&e.path&&e.path.startsWith(r.path)||r.name&&r.name==e.name)}function me(r,e){return typeof r=="function"?Reflect.apply(r,{},[e]):r}let ei=w.defineComponent({name:"RouterLink",inheritAttrs:!1,props:{tag:{type:[String,Object,Function],required:!1,default:"a"},to:{type:[String,Object,Function],required:!0},root:{type:String},activeClass:{type:[String,Function],required:!1,default:"fox-router-link-active"},exact:{type:[String,Boolean,Function],required:!1},exactActiveClass:{type:[String,Function],required:!1,default:"fox-router-link-exact-active"},event:{type:[String,Function],required:!1,default:"onClick"}},setup(r,e){const t=w.inject(it,null);return()=>{let n=me(r.to,null),i=me(r.tag,n);if(i==null){console.warn("can not resolve link tag");return}let s=null,o=null;t!==null&&(s=t[H](n),r.root&&(s.root=r.root),o=t.current);let a={},l=me(r.activeClass,s);if(typeof l=="string"&&l.length>0&&(a[l]=Zn(s,o)),me(r.exact,s)===!0){let h=me(r.exactActiveClass,s);typeof h=="string"&&h.length>0&&(a[h]=Yn(s,o))}let f={class:a};(i==="a"||i==="A")&&(f.href=s?.path??s?.name??"#"),T(!0,f,e.attrs);let c=me(r.event,s);if(typeof c=="string"){const h=d=>{if(t==null){console.warn("router is not been injected");return}if(s==null){console.warn("route is not been resolved");return}Xn(d)&&t.to(s)};f[c]=h}return w.h(i,f,e.slots)}}});var O=(r=>(r[r.Loading=0]="Loading",r[r.Loaded=1]="Loaded",r[r.Defining=2]="Defining",r[r.Defined=3]="Defined",r))(O||{}),Ze=(r=>(r[r.normal=0]="normal",r[r.factory=1]="factory",r))(Ze||{});class ti{register=new Map;constructor(){}get(e){return this.register.get(e)??null}set(e,t){this.register.set(e,t)}remove(e){let t=this.register.get(e);return this.register.delete(e),t??null}has(e){return this.register.has(e)}clear(){this.register.clear()}}class wr{moduleManager=new ti;options={paths:{},alias:{},nature:[],timeout:3e3};set paths(e){this.options.paths=e}get paths(){return this.options.paths}set alias(e){this.options.alias=e}get alias(){return this.options.alias}set naturePaths(e){this.options.nature=e}get naturePaths(){return this.options.nature}set timeout(e){this.options.timeout=e}get timeout(){return this.options.timeout}_query;set query(e){this._query=e}get query(){return this._query}get head(){return He().head}constructor(){}setModule(e,t){const n={id:e,src:"",status:O.Defined};typeof t=="function"?(n.exports=t,n.type=Ze.factory):n.exports=t,this.moduleManager.set(e,n)}removeModule(e){this.moduleManager.remove(e)}ensure(...e){const t=[];let n=e.length-1;const i={};typeof e[n]=="object"&&(Object.assign(i,e[n]),n--);let s=null;typeof e[n]=="function"&&(s=e[n],n--);for(let l=0;l<=n;l++)if(Array.isArray(e[l])){let u=e[l];for(let f=0;f<u.length;f++)u[f]&&t.push(this.resolvePath(u[f]))}else if(typeof e[l]=="string"){let u=e[l].split(",");for(let f=0;f<u.length;f++)u[f]&&t.push(this.resolvePath(u[f]))}const o=new ri(t.length,(l,u)=>{if(o.isOK())try{typeof s=="function"&&Reflect.apply(s,{},u)}catch(f){console.error(f.message,f)}else try{console.error(l),typeof s=="function"&&Reflect.apply(s,{},[])}catch(f){console.error(f.message,f)}}),a=new Me;for(let l=0;l<t.length;l++){const u=new ni(l,t[l],i,o);this.mount(a,u)}return this}remove(...e){let t=[],n=e.length-1,i={};typeof e[n]=="object"&&(Object.assign(i,e[n]),n--);let s=null;typeof e[n]=="function"&&(s=e[n],n--);for(let o=0;o<=n;o++)if(Array.isArray(e[o])){let a=e[o];for(let l=0;l<a.length;l++)a[l]&&t.push(this.resolvePath(a[l]))}else{let a=e[o].split(",");for(let l=0;l<a.length;l++)a[l]&&t.push(this.resolvePath(a[l]))}return t.forEach(o=>{this.unmount(o,i)}),typeof s=="function"&&Reflect.apply(s,{},[]),this}mount(e,t){if(t.src==="exports"){e.post(i=>{t.progress.work(!0,t.index,"exports"),i.resolve()});return}else if(t.src==="module"){e.post(i=>{t.progress.work(!0,t.index,"module"),i.resolve()});return}if(this.isNaturePath(t.src)){let i=t.params.jsPoint;i||(i=this.head),this.mountJS(e,t,i);return}else if(this.isNaturePath(t.src)){let i=t.params.cssPoint;i||(i=this.head),this.mountCSS(e,t,i);return}let n=this.getFileNamePostfix(t.src);if(n==="js"||n.length===0){let i=t.params.jsPoint;i||(i=this.head),this.mountJS(e,t,i);return}else if(n==="css"){let i=t.params.cssPoint;i||(i=this.head),this.mountCSS(e,t,i);return}}mountCSS(e,t,n){e.post(i=>{const s=t.src,o=this.moduleManager.get(s);if(o&&(o.status==O.Defined||o.status==O.Loaded)&&o.exports){o.type===Ze.factory&&typeof o.exports=="function"?t.progress.work(!0,t.index,o.exports()):t.progress.work(!0,t.index,o.exports),i.resolve();return}const a=He(),l=a.createElement("link");if(Reflect.has(l,"onload"))l.onload=()=>{l.onload=null,l.onerror=null,t.progress.work(!0,t.index,t.src),i.resolve()},l.onerror=()=>{try{n.removeChild(l)}catch(c){console.error(c.message,c)}l.onload=null,l.onerror=null,t.progress.work(!1,t.index,null),i.reject()};else{const c={timeout:this.options.timeout??3e3,time:0,success:()=>{t.progress.work(!0,t.index,t.src),i.resolve()},error:()=>{try{n.removeChild(l)}catch(h){console.error(h.message,h)}t.progress.work(!1,t.index,null),i.resolve()}};setTimeout(()=>{Ir(l,c)},1)}let f=a.getElementById(s);f&&f.parentNode&&f.parentNode.removeChild(f),l.rel="stylesheet",l.type="text/css",l.id=s,l.href=s,n.appendChild(l)})}mountJS(e,t,n){e.post(i=>{const s=t.src;let o=this.moduleManager.get(s);if(o&&(o.status==O.Defined||o.status==O.Loaded)){if(o.exports){o.type===Ze.factory&&typeof o.exports=="function"?t.progress.work(!0,t.index,o.exports()):t.progress.work(!0,t.index,o.exports),i.resolve();return}if(document.querySelector(`script[src='${s}`)){t.progress.work(!0,t.index,o.exports),i.resolve();return}}o={id:s,src:s,status:O.Loading},this.moduleManager.set(s,o);const l=He().createElement("script");if("onload"in l)l.onload=()=>{l.onload=null,l.onerror=null,o.status==O.Loading&&(o.status=O.Loaded,t.progress.work(!0,t.index,s)),i.resolve()},l.onerror=()=>{try{n.removeChild(l)}catch(c){console.error(c.message,c)}l.onload=null,l.onerror=null,this.moduleManager.remove(s),t.progress.work(!1,t.index,null),i.resolve()};else{const c=l;c.onreadystatechange=()=>{/loaded|complete/.test(c.readyState)&&(c.onreadystatechange=null,o.status==O.Loading&&(o.status=O.Loaded,t.progress.work(!0,t.index,s)),i.resolve())}}l.defer=!0,l.src=s;const f=L();f.define=this.createDefine(o,t),n.appendChild(l)})}unmount(e,t={}){const n=He(),i=this.getFileNamePostfix(e);if(i==="js"||i.length===0){const s=n.querySelector(`script[src="${e}"]`);s&&s.parentNode&&s.parentNode.removeChild(s),this.moduleManager.remove(e);return}else if(i==="css"){const s=n.querySelector(`style[href="${e}"]`);s&&s.parentNode&&s.parentNode.removeChild(s);return}}trimEmptyElement(e){let t=[];for(let n=0;n<e.length;n++){if(e[n]===void 0||e[n]===null)continue;const i=e[n].trim();i.length!==0&&t.push(i)}return t}createDefine(e,t){const n=this,i=function(...s){e.status=O.Defining;let o,a,l,u=s.length;u===1?(l=s[0],o=void 0):u===2?(l=s[1],Array.isArray(s[0])?(a=n.trimEmptyElement(s[0]),o=void 0):a=void 0):(o=s[0],a=n.trimEmptyElement(s[1]),l=s[2]),o&&(e.id=o,n.options.alias[o]=e.src),a&&a.length>0?n.ensure(a,(...f)=>{const c=f.map(h=>h==="exports"?((!e.exports||typeof e.exports!="object")&&(e.exports={}),e.exports):h==="module"?e:h);if(typeof l=="function"){const h=Reflect.apply(l,e,c);h&&typeof h=="object"&&(e.exports=h)}else e.exports=l;e.status=O.Defined,t.progress.work(!0,t.index,e.exports)}):(typeof l=="function"?e.exports=Reflect.apply(l,e,[]):e.exports=l,e.status=O.Defined,t.progress.work(!0,t.index,e.exports))};return i.amd=!0,i}resolvePath(e){try{if(e==="exports"||e==="module"||this.isNaturePath(e))return e;e=this.parserPath(e,!0);let t=this.getFileNamePostfix(e);t=t.toLowerCase();let n=this.createSearch(this.query);return e.indexOf("?")==-1?(t!=="js"&&t!=="css"&&(e+=".js"),n.length>0&&(e+=`?${n}`)):n.length>0&&(e+=`&${n}`),e}catch(t){throw console.error(`resolve path[${e}] fail`,t),t}}createSearch(e){let t="";if(e){for(let n in e){let i=`${e[n]}`;t+=`${encodeURIComponent(n)}=${encodeURIComponent(i)}&`}t.length>0&&(t=t.substring(0,t.length-1))}return t}getFileNamePostfix(e){let t=e.lastIndexOf("?");t==-1&&(t=e.length);let n=e.lastIndexOf(".",t);return n==-1?"":e.substring(n+1,t)}isNaturePath(e){if(!this.options.nature)return!1;if(typeof this.options.nature=="function")return this.options.nature(e);const t=this.options.nature;if(t&&Array.isArray(t))for(let n=0;n<t.length;n++){const i=t[n];if(e.indexOf(i)===0)return!0}return!1}parserPath(e,t){if(e.indexOf("http://")==0||e.indexOf("https://")==0||e.indexOf("file:///")==0)return e;if(e.indexOf("/")==0)return`${yt()}${e.slice(1)}`;if(e.indexOf("./")==0)return`${yt()}${e.slice(2)}`;if(e.indexOf("//")==0)return`${L().location.protocol}${e}`;if(t){let i=this.options.alias[e];if(!i){let s=e.indexOf("/");if(s==-1)i=e;else{let o=e.slice(0,s),a=this.options.paths[o];a?i=a+e.slice(s):i=e}}return this.parserPath(i,!1)}return`${yt()}${e}`}}function Ir(r,e){let t=r.sheet,n=!1;if(e.isOldWebKit)t&&(n=!0);else if(t)try{t.cssRules&&(n=!0)}catch(i){i.name==="NS_ERROR_DOM_SECURITY_ERR"&&(n=!0)}setTimeout(()=>{e.time+=20,n?e.success():e.timeout>e.timeout?e.error():Ir(r,e)},20)}class ri{callback;values;status;size;lastIndex;constructor(e,t){this.size=e,this.callback=t,this.status=!0,this.values=[],this.lastIndex=-1}work(e,t,n){if(this.status=e,this.status===!0&&(this.lastIndex!==t&&this.size--,this.lastIndex=t,this.values.push(n)),this.size===0||this.status===!1)try{Reflect.apply(this.callback,this,[this.status,this.values])}catch(i){console.error(i.message,i)}}isOK(){return this.status}}class ni{index;src;params;progress;constructor(e,t,n,i){this.index=e,this.src=t,this.params=n,this.progress=i}}const Gt=Symbol("fk"),Qt=Symbol("fbk"),Xt=Symbol("fepk");function ii(r={}){const e=new _n(r),t=new $t,n=new _t,i=new wr,s={get router(){return e},get bus(){return t},get Bus(){return $t},get EventProxy(){return _t},get eventproxy(){return n},get EventChain(){return Me},get Require(){return wr},get require(){return i},get extend(){return T},get clone(){return Oe},get isESModule(){return Nt},install(o){o.provide(it,e),o.provide(Gt,s),o.provide(Qt,t),o.provide(Xt,n),o.component(Kn,It),o.component(qn,ei),Reflect.defineProperty(o.config.globalProperties,"$fox",{get(){return s}}),Reflect.defineProperty(o.config.globalProperties,"$router",{get(){return e}}),Reflect.defineProperty(o.config.globalProperties,"$bus",{get(){return t}}),Reflect.defineProperty(o.config.globalProperties,"$bus",{get(){return t}}),Reflect.defineProperty(o.config.globalProperties,"$eventProxy",{get(){return n}}),o.config.globalProperties.$fox_on=function(a,l,u=!1){n.on(a,l,u)},o.config.globalProperties.$fox_off=function(a,l){n.off(a,l)},o.config.globalProperties.$fox_once=function(a,l){n.once(a,l)},o.config.globalProperties.$fox_all=function(...a){let l=n;Reflect.apply(l.all,l,a)},o.config.globalProperties.$fox_trigger=function(a,...l){let u=n;Reflect.apply(u.trigger,u,[a,...l])},o.config.globalProperties.$fox_emit=function(a,...l){let u=n;Reflect.apply(u.trigger,u,[a,...l])},o.mixin({computed:{$route(){return Ut(this)}}}),e.init()}};return s}function Yt(r){return r?r.$router:w.inject(it)}function si(r){return r||(r=w.getCurrentInstance()?.proxy??void 0),r?Ut(r):null}function oi(r){return r?r.$fox:w.inject(Gt)}function li(r){return r?r.$bus:w.inject(Qt)}function ai(r){return r?r.$eventProxy:w.inject(Xt)}function ui(r){const e=Yt(),t=(n,i,s)=>{try{Reflect.apply(r,{},[n,i])}catch(o){console.error(o)}s()};e.beforeEach(t),w.onUnmounted(()=>{e.removeBeforeEach(t)})}function fi(r){const e=Yt(),t=(n,i,s)=>{try{Reflect.apply(r,{},[n,i])}catch(o){console.error(o)}s()};e.afterEach(t),w.onUnmounted(()=>{e.removeAfterEach(t)})}exports.Bus=$t;exports.EventChain=Me;exports.EventProxy=_t;exports.Route=K;exports.clone=Oe;exports.createFox=ii;exports.createMemoryHistory=Tr;exports.createWebHashHistory=jr;exports.createWebHistory=Fn;exports.deleteContextValue=an;exports.extend=T;exports.foxBusKey=Qt;exports.foxEventProxyKey=Xt;exports.foxKey=Gt;exports.injectContextValue=Bt;exports.isArray=Nr;exports.isDate=Vr;exports.isESModule=Nt;exports.isEqual=Tt;exports.isFunction=S;exports.isMap=Hr;exports.isObject=br;exports.isPlainObject=Ft;exports.isPromise=kr;exports.isSet=Dr;exports.isString=Br;exports.isSymbol=Ur;exports.onAfterRouteUpdate=fi;exports.onBeforeRouteUpdate=ui;exports.onFoxActivated=dn;exports.onFoxInactivated=yn;exports.provideContextValue=ln;exports.sessionKey=se;exports.toBoolean=Ht;exports.toNumber=Gr;exports.toTypeString=nt;exports.typeOf=jt;exports.useBus=li;exports.useEventProxy=ai;exports.useFox=oi;exports.useRoute=si;exports.useRouter=Yt;
@@ -44,7 +44,14 @@ declare const _buildPage: unique symbol;
44
44
  /**
45
45
  * 导出Bus
46
46
  */
47
- export declare let Bus: any;
47
+ export declare const Bus: any;
48
+
49
+ /**
50
+ * Bus Interface
51
+ */
52
+ export declare interface BusInterface extends Tree {
53
+ [propName: string | symbol | number]: any;
54
+ }
48
55
 
49
56
  /**
50
57
  * callback function
@@ -394,7 +401,7 @@ export declare interface Fox {
394
401
  /**
395
402
  * 返回全局Bus
396
403
  */
397
- get bus(): Tree;
404
+ get bus(): BusInterface;
398
405
  /**
399
406
  * 返回Bus构造函数
400
407
  */
package/libs/index.esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { ref as vr, getCurrentInstance as Lt, onUnmounted as it, shallowRef as Vr, defineComponent as gr, inject as G, provide as re, h as fe } from "vue";
2
2
  /*!
3
- * fox v3.0.0 Thu Apr 20 2023 19:50:32 GMT+0800 (中国标准时间)
3
+ * fox v3.0.0 Mon May 08 2023 09:56:51 GMT+0800 (中国标准时间)
4
4
  */
5
5
  const Zn = Array.isArray, es = (r) => Mt(r) === "[object Map]", ts = (r) => Mt(r) === "[object Set]", rs = (r) => r instanceof Date, R = (r) => typeof r == "function", ns = (r) => typeof r == "string", ss = (r) => typeof r == "symbol", Br = (r) => r !== null && typeof r == "object", is = (r) => Br(r) && R(r.then) && R(r.catch), Ur = Object.prototype.toString, Mt = (r) => Ur.call(r), kt = (r) => Mt(r) === "[object Object]", kr = typeof Symbol == "function" && typeof Symbol.toStringTag == "symbol";
6
6
  function wr(r) {
@@ -380,7 +380,7 @@ function Xr() {
380
380
  }
381
381
  }, t), Reflect.set(r, Nt, t), r;
382
382
  }
383
- let Qt = new Proxy(Rr, {
383
+ const Qt = new Proxy(Rr, {
384
384
  /**
385
385
  * 拦截构造函数
386
386
  * @param target
@@ -388,11 +388,10 @@ let Qt = new Proxy(Rr, {
388
388
  * @returns
389
389
  */
390
390
  construct(r, ...e) {
391
- let t = Xr();
391
+ const t = Xr();
392
392
  return Me(t);
393
393
  }
394
- });
395
- const ee = "default", Sr = Symbol("sync"), I = Symbol("resolveRoute");
394
+ }), ee = "default", Sr = Symbol("sync"), I = Symbol("resolveRoute");
396
395
  function Xt(r) {
397
396
  let e = !1;
398
397
  return function(...t) {
package/libs/index.umd.js CHANGED
@@ -1,3 +1,3 @@
1
1
  (function(v,w){typeof exports=="object"&&typeof module<"u"?w(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],w):(v=typeof globalThis<"u"?globalThis:v||self,w(v.Fox={},v.Vue))})(this,function(v,w){"use strict";/*!
2
- * fox v3.0.0 Thu Apr 20 2023 19:50:32 GMT+0800 (中国标准时间)
3
- */const Hr=Array.isArray,Dr=r=>He(r)==="[object Map]",Vr=r=>He(r)==="[object Set]",Br=r=>r instanceof Date,S=r=>typeof r=="function",Ur=r=>typeof r=="string",kr=r=>typeof r=="symbol",er=r=>r!==null&&typeof r=="object",Wr=r=>er(r)&&S(r.then)&&S(r.catch),zr=Object.prototype.toString,He=r=>zr.call(r),ot=r=>He(r)==="[object Object]",Jr=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol";function lt(r){return r.__esModule||Jr&&r[Symbol.toStringTag]==="Module"}const Gr=typeof Promise<"u"&&Promise.toString().indexOf("[native code]")!==-1;function j(...r){let e=r[0]!==void 0&&r[0]!==null?r[0]:{},t=1,n=r.length,i=!1;for(typeof e=="boolean"&&(i=e,e=r[t]??{},t++),typeof e!="object"&&(e={});t<n;t++)if(r[t]!==null&&r[t]!==void 0){let s=r[t];for(let o in s){let a=e[o],l=s[o];if(a!==l)if(i===!0&&l&&typeof l=="object"){let u;Array.isArray(l)?u=a&&Array.isArray(a)?a:[]:u=a&&typeof a=="object"?a:{},e[o]=j(i,u,l)}else l!==void 0&&(e[o]=l)}}return e}function Se(r,e,t=!1){if(!t)j(!0,r,e);else{if(typeof e!="object")return{};typeof r!="object"&&(r={});for(let i in e){let s=r[i],o=e[i];if(s!==o)if(typeof o=="object"){if(!Array.isArray(o)&&!ot(o))continue;s=Se(s,o,t),r[i]=s}else{if(typeof o=="function")continue;r[i]=o}}const n=Object.getOwnPropertySymbols(e);for(let i of n){let s=r[i],o=e[i];if(s!==o)if(typeof o=="object"){if(!Array.isArray(o)&&!ot(o))continue;s=Se(s,o,t),r[i]=s}else{if(typeof o=="function")continue;r[i]=o}}}return r}class ne{static seed=new Date().getTime();static get(){let e=++ne.seed;return e>=Number.MAX_VALUE&&(ne.seed=0),e}}const at=Gr?Promise.resolve():null;function Pe(r,...e){at!==null?e&&e.length>0?at.then(()=>{r(e)}):at.then(r):e&&e.length>0?setTimeout(()=>{r(e)}):setTimeout(r)}function ut(r){return r==null?!1:typeof r=="boolean"?r:typeof r=="string"?r.toLocaleLowerCase()==="true":!!r}function Qr(r){return typeof r=="number"?r:Number(r)}const Xr={"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object Array]":"array","[object Date]":"date","[object RegExp]":"regExp","[object Object]":"object"};function ft(r){let t=Object.prototype.toString.call(r);return r==null?String(r):Xr[t]||"object"}function ct(r,e){if(r==e)return!0;if(r===void 0||e===void 0)return!1;let t=ft(r),n=ft(e);if(t!==n)return!1;if(t==="object"){let i=Object.keys(r),s=Object.keys(e);if(i.length!==s.length)return!1;for(let o=0;o<i.length;o++){let a=i[o],l=r[a],u=e[a];if(!ct(l,u))return!1}return!0}else if(t==="array"){if(r.length!==e.length)return!1;for(let i=0;i<r.length;i++){let s=r[i],o=e[i];if(!ct(s,o))return!1}return!0}return!1}const tr=Symbol("idKey"),ae=Symbol("valueKey"),P=Symbol("childrenKey"),z=Symbol("growKey");class rr{[z]=!0;[tr];[ae]=w.ref();[P]=new Map;constructor(e){this[tr]=e}}class Yr{get(e,t){if(t=="value")return e[ae].value;if(t==="grow")return e[z];let n=e[P].get(t);if(n)return Ce(n);if(e[z])return n=dt(t),n[z]=e[z],e[P].set(t,n),Ce(n)}set(e,t,n){return t=="value"?(e[ae].value=n,!0):t==="grow"?(e[z]=ut(n),!0):n==null?(e[P].delete(t),!0):(console.error(`illegal property:${t}`),!1)}deleteProperty(e,t){return t==="value"||t=="grow"?(console.error(`can not delete property:${String(t)}`),!1):(e[P].delete(t),!0)}}const ht="__proxy__";function dt(r){let e=new rr(r);return Reflect.set(e,ht,new Proxy(e,new Yr)),e}function Ce(r){return Reflect.get(r,ht)}class nr extends rr{constructor(){super("__root__")}put(...e){let t=e.length;if(t<2)return console.error("参数至少包括一个(key, value)"),!1;let n=this;for(let i=0;i<t-1;i++){let s=e[i],o;n[P].has(s)?o=n[P].get(s):(o=dt(s),n[P].set(s,o)),n=o}return n[ae].value=e[t-1],!0}get(...e){let t=e.length;if(t===0)return;let n=this;for(let i=0;i<t;i++){let s=e[i];if(n[P].has(s))n=n[P].get(s);else return}return n[ae].value}remove(...e){let t=e.length;if(t==0)return!1;let n=this;for(let s=0;s<t-1;s++){let o=e[s];if(n[P].has(o))n=n[P].get(o);else return!1}let i=e[t-1];return n[P].has(i)?(n[P].delete(i),!0):!1}contains(...e){let t=e.length;if(t==0)return!1;let n=this;for(let s=0;s<t-1;s++){let o=e[s];if(n[P].has(o))n=n[P].get(o);else return!1}let i=e[t-1];return n[P].has(i)}clear(){this[P].clear()}}const Zr=["put","get","contains","remove","clear"];function ir(r){return Zr.includes(r)}class en{get(e,t){if(t=="value")return e[ae].value;if(t==="grow")return e[z];if(t===P)return e[P];if(typeof t=="string"&&ir(t))return e[t];let n=String(t),i=e[P].get(n);if(i)return Ce(i);if(e[z])return i=dt(n),i[z]=e[z],e[P].set(n,i),Ce(i)}set(e,t,n){return t=="value"?(e[ae].value=n,!0):t==="grow"?(e[z]=ut(n),!0):ir(t)?!1:n==null?(e[P].delete(t),!0):(console.error(`illegal property:${t}`),!1)}deleteProperty(e,t){return t==="value"||t=="grow"?(console.error(`can not delete property:${String(t)}`),!1):(e[P].delete(t),!0)}}function tn(){let r=new nr,e=new en,t=new Proxy(r,e);return Object.assign({put(...i){return Reflect.apply(r.put,r,i)},get(...i){return Reflect.apply(r.get,r,i)},remove(...i){return Reflect.apply(r.remove,r,i)},contains(...i){return Reflect.apply(r.contains,r,i)},clear(){return Reflect.apply(r.clear,r,[])}},t),Reflect.set(r,ht,t),r}let yt=new Proxy(nr,{construct(r,...e){let t=tn();return Ce(t)}});const Y="default",sr=Symbol("sync"),I=Symbol("resolveRoute");function or(r){let e=!1;return function(...t){if(!e)return e=!0,Reflect.apply(r,{},t)}}function rn(r){let e=r.src;return new Promise((t,n)=>{const i=or(a=>{lt(a)&&(a=a.default),r.component=a,console.debug("success load async module"),t()}),s=or(a=>{console.debug("reject load async module"),n(a)});let o;try{o=e(i,s)}catch(a){s(a)}if(o)if(typeof o.then=="function")o.then(i,s);else{const a=o.component;a&&typeof a.then=="function"&&a.then(i,s)}})}class nn{name;level;rootName;rootIndex=0;constructor(e,t,n,i){this.name=e,this.level=t,this.rootName=n,this.rootIndex=i}}class De{to;routeModel;from;data={};constructor(e,t){this.to=e,this.from=t}static from(e){let t=new De(e.to,e.from),n=e.data??{};return j(!0,t.data,n),t}}class q{path;get fullPath(){const e=this.path??`/${this.name}`;return`${this.root??Y}!${e}`}alias;name;root;params;query;matched;meta;success;error;destroy;opsType;updateType;viewTagAttrs;index;active;slot;session;static clone(e,t){let n=new q;return Se(n,e,t),n}static isSame(e,t){return e===t?!0:!(e==null||t==null||e.path&&e.path!==t.path||e.name&&e.name!==t.name||e.root!==t.root||e.index!==t.index)}static isSameForRouteModel(e,t){return e===t?!0:!(e==null||t==null||e.path&&e.path!=t.path||e.name&&e.name!=t.name)}static from(e){let t=new q;if(e==null)return t;let n=t;for(let s in e){let o=e[s];n[s]=o}const i=Object.getOwnPropertySymbols(e);if(Array.isArray(i)&&i.length>0)for(let s of i)n[s]=e[s];return t}}class sn{id;name;props;meta;src;component;constructor(e,t,n,i){this.id=ne.get(),this.name=e,this.src=t,typeof t!="function"&&(this.component=t),this.props=n,this.meta=i}get isResolved(){return this.component!==void 0}resolve(){return rn(this)}}class lr{models=[]}class mt{path;match;redirect;name;layers=[]}const B=Symbol("chainKey"),N=Symbol("cursorKey"),pt=Symbol("$persistentModeKey"),$=Symbol("statusKey"),Z=Symbol("argsKey"),Ve=Symbol("exArgsKey"),de=Symbol("successFnsKey"),Ee=Symbol("errorFnsKey"),ie=Symbol("sessionKey"),ee=Symbol("_go");class Ae{[B]=[];[N]=0;[pt]=!1;[$]="Free";[Z]=[];[Ve]=[];[de]=[];[Ee]=[];[ie];get session(){return this[ie]}constructor(e,t=!1){this[ie]=e,this[pt]=t}[ee](e,...t){let n=this[$];if(this[$]="Busy",this[N]+=e,this[N]<0&&(this[N]=0),this[Z]=t,n==="Exception"||n==="Reject"){let a=[{session:this[ie]},...this[Ve]];for(;this[Ee].length>0;)try{let l=this[Ee].shift();typeof l=="function"&&Pe(()=>{Reflect.apply(l,{},a)})}catch(l){console.error(l.message,l)}return this[$]=n,this[B]=[],this[N]=0,this}else if(n==="Finished"||this[N]>=this[B].length){let a=[{session:this[ie]},...this[Z]];for(;this[de].length>0;){let l=this[de].shift();typeof l=="function"&&Pe(()=>{Reflect.apply(l,{},a)})}return this[$]="Free",this}if(this[N]>=this[B].length)return this[$]="Free",this;let i=this[B][this[N]];this[pt]||(this[B].splice(0,this[N]+1),this[N]=-1);let s=this[N]+1;try{let o=!1,a={go:(l,...u)=>{o||(o=!0,Reflect.apply(this[ee],this,[l,...u]))},resolve:(...l)=>{o||(o=!0,Reflect.apply(this[ee],this,[1,...l]))},reject:(...l)=>{o||(o=!0,Reflect.apply(this.reject,this,[...l]))},insert:l=>{o||(this[B].splice(s,0,l),s++)},session:this[ie]};Pe(()=>{Reflect.apply(i,{},[a,...this[Z]])})}catch(o){this.throw(o)}return this}go(e,...t){return Reflect.apply(this[ee],this,[e,...t])}finish(...e){return this[$]="Finished",this[Z]=e,Reflect.apply(this[ee],this,[0])}reject(...e){return this[$]="Reject",this[Ve]=e,Reflect.apply(this[ee],this,[0])}throw(...e){return this[$]="Exception",this[Ve]=e,Reflect.apply(this[ee],this,[0])}reset(...e){this[$]="Busy",this[Z]=e,this[B]=[],this[N]=0;let n=[{session:this[ie]},...this[Z]];for(;this[de].length>0;){let i=this[de].shift();Pe(()=>{Reflect.apply(i,this,n)})}return this[$]="Free",this}post(e){return this[$]==="Reject"||this[$]==="Exception"?this:(Array.isArray(e)?this[B]=[...this[B],...e]:this[B].push(e),this[$]==="Busy"?this:(Reflect.apply(this[ee],this,[0,...this[Z]]),this))}wait(e,t){return e&&typeof e=="function"&&this[de].push(e),t&&typeof t=="function"&&this[Ee].push(t),this[$]==="Busy"?this:(Reflect.apply(this[ee],this,[0,...this[Z]]),this)}exception(e){return e&&typeof e=="function"&&this[Ee].push(e),this[$]==="Busy"?this:Reflect.apply(this[ee],this,[0,...this[Z]])}isFinish(){return this[$]=="Reject"||this[$]=="Free"&&this[N]>=this[B].length}}const ye=Symbol("registerKey");class on{policy;callback;constructor(e,t){this.callback=e,this.policy=t}}class vt{[ye]=new Map;constructor(){}on(e,t,n=!1){let i=this[ye].get(e);i||(i=new Array,this[ye].set(e,i));let s=n===!0?1:0,o=new on(t,s);return i.push(o),this}off(e,t){if(!t)return this[ye].delete(e),this;let n=this[ye].get(e);if(n){for(let i=0;i<n.length;i++)if(n[i].callback===t){n.splice(i,1);break}}return this}bind(e,t,n=!1){return this.on(e,t,n)}unbind(e,t){return this.off(e,t)}once(e,t){return this.on(e,t,!0)}all(...e){let t=e.length;if(t<1)return this;let n=e[t-1];if(typeof n!="function")return console.error("callback can not benn empty"),this;let i=t-1,s=new Array(i),o=[].splice.call(e,0,i);for(let a=0;a<o.length;a++)this.once(o[a],l=>{s[a]=l,i-=1,i==0&&Reflect.apply(n,{},s)});return this}emit(e,...t){let n=this[ye].get(e);if(!n)return this;for(let i=0;i<n.length;){let s=n[i];if(s.policy==1?n.splice(i,1):i++,typeof s.callback=="function")try{Pe(()=>{Reflect.apply(s.callback,{},t)})}catch(o){console.error(o.message,o)}}return this}trigger(e,...t){return Reflect.apply(this.emit,this,[e,...t])}}const Fe=Symbol("registerKey");class ln{[Fe]=new Map;constructor(){}set(e,t){this[Fe].set(e,t)}get(e){return this[Fe].get(e)}has(e){return this[Fe].has(e)}delete(e){return this[Fe].delete(e)}}const ue=Symbol("lc");function Be(r,e=!1){let t=r;if(Reflect.has(t,ue))return t[ue];if(e){const n=new ln;return t[ue]=n,n}return null}function ar(r,e=!1){let t=null,n=r;for(;n&&!(Reflect.has(n,ue)&&(t=n[ue],t));)n=n.$parent;if(!t&&e){const i=r;i&&i.$parent&&(t=Be(i.$parent,e))}return t}function gt(r,e){let t=r;for(;t;){if(Reflect.has(t,ue)){const n=t[ue];if(n.has(e))return n.get(e)}t=t.$parent}return null}function an(r,e,t){ar(r,!0)?.set(e,t)}function un(r,e){ar(r,!0)?.delete(e)}function ur(r){if(Array.isArray(r.children)&&r.children.length>0){let e=r.children[0];if(e!=null&&e.component!=null&&e.component.proxy!=null)return Be(e.component.proxy,!1)}return null}const Ue=Symbol("hooksKey");function fn(r){let e=r.get(Ue);e||(e=[],r.set(Ue,e))}function fr(r,e){let t=r.get(Ue);if(t!=null)for(let n=t.length-1;n>=0;n--){let i=t[n];if(i.type===e)try{Reflect.apply(i.hook,i.target,[])}catch(s){console.error(s.message,s)}}}var wt=(r=>(r.DEACTIVATED="da",r.ACTIVATED="a",r))(wt||{});class cn{type;hook;target;constructor(e,t,n){this.target=n,this.hook=t,this.type=e}}function hn(r,e,t,n){let i=new cn(e,t,n);return r.push(i),!0}function dn(r,e,t,n){let i=-1;for(let s=0;s<r.length;s++){let o=r[s];if(o.type===e&&o.hook===t&&o.target===n){i=s;break}}return i!=-1?(r.splice(i,1),!0):!1}function cr(r){return(e,t)=>{let n;if(t)n=t;else{const s=w.getCurrentInstance();if(s==null||s.proxy==null){console.error("can not get current instance or proxy");return}n=s.proxy}const i=gt(n,Ue);if(i==null){console.warn("can not get hooks context");return}w.onUnmounted(()=>{dn(i,r,e,n)}),hn(i,r,e,n)}}let yn=cr("a"),mn=cr("da");const bt=Symbol("routeKey");function hr(r,e){r.set(bt,e)}function Rt(r){let e=gt(r,bt);return typeof e=="function"?e():e??null}const ke=Symbol("rk"),xt=Symbol("vd"),dr=Symbol("rv"),St=Symbol("rvi"),yr=Symbol("pv"),Pt=Symbol("pvi");function pn(r){for(var e=[],t=0;t<r.length;){var n=r[t];if(n==="*"||n==="+"||n==="?"){e.push({type:"MODIFIER",index:t,value:r[t++]});continue}if(n==="\\"){e.push({type:"ESCAPED_CHAR",index:t++,value:r[t++]});continue}if(n==="{"){e.push({type:"OPEN",index:t,value:r[t++]});continue}if(n==="}"){e.push({type:"CLOSE",index:t,value:r[t++]});continue}if(n===":"){for(var i="",s=t+1;s<r.length;){var o=r.charCodeAt(s);if(o>=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122||o===95){i+=r[s++];continue}break}if(!i)throw new TypeError("Missing parameter name at ".concat(t));e.push({type:"NAME",index:t,value:i}),t=s;continue}if(n==="("){var a=1,l="",s=t+1;if(r[s]==="?")throw new TypeError('Pattern cannot start with "?" at '.concat(s));for(;s<r.length;){if(r[s]==="\\"){l+=r[s++]+r[s++];continue}if(r[s]===")"){if(a--,a===0){s++;break}}else if(r[s]==="("&&(a++,r[s+1]!=="?"))throw new TypeError("Capturing groups are not allowed at ".concat(s));l+=r[s++]}if(a)throw new TypeError("Unbalanced pattern at ".concat(t));if(!l)throw new TypeError("Missing pattern at ".concat(t));e.push({type:"PATTERN",index:t,value:l}),t=s;continue}e.push({type:"CHAR",index:t,value:r[t++]})}return e.push({type:"END",index:t,value:""}),e}function mr(r,e){e===void 0&&(e={});for(var t=pn(r),n=e.prefixes,i=n===void 0?"./":n,s="[^".concat(me(e.delimiter||"/#?"),"]+?"),o=[],a=0,l=0,u="",f=function(F){if(l<t.length&&t[l].type===F)return t[l++].value},c=function(F){var C=f(F);if(C!==void 0)return C;var E=t[l],Q=E.type,D=E.index;throw new TypeError("Unexpected ".concat(Q," at ").concat(D,", expected ").concat(F))},h=function(){for(var F="",C;C=f("CHAR")||f("ESCAPED_CHAR");)F+=C;return F};l<t.length;){var d=f("CHAR"),p=f("NAME"),m=f("PATTERN");if(p||m){var y=d||"";i.indexOf(y)===-1&&(u+=y,y=""),u&&(o.push(u),u=""),o.push({name:p||a++,prefix:y,suffix:"",pattern:m||s,modifier:f("MODIFIER")||""});continue}var g=d||f("ESCAPED_CHAR");if(g){u+=g;continue}u&&(o.push(u),u="");var b=f("OPEN");if(b){var y=h(),_=f("NAME")||"",x=f("PATTERN")||"",K=h();c("CLOSE"),o.push({name:_||(x?a++:""),pattern:_&&!x?s:x,prefix:y,suffix:K,modifier:f("MODIFIER")||""});continue}c("END")}return o}function vn(r,e){return gn(mr(r,e),e)}function gn(r,e){e===void 0&&(e={});var t=Ct(e),n=e.encode,i=n===void 0?function(l){return l}:n,s=e.validate,o=s===void 0?!0:s,a=r.map(function(l){if(typeof l=="object")return new RegExp("^(?:".concat(l.pattern,")$"),t)});return function(l){for(var u="",f=0;f<r.length;f++){var c=r[f];if(typeof c=="string"){u+=c;continue}var h=l?l[c.name]:void 0,d=c.modifier==="?"||c.modifier==="*",p=c.modifier==="*"||c.modifier==="+";if(Array.isArray(h)){if(!p)throw new TypeError('Expected "'.concat(c.name,'" to not repeat, but got an array'));if(h.length===0){if(d)continue;throw new TypeError('Expected "'.concat(c.name,'" to not be empty'))}for(var m=0;m<h.length;m++){var y=i(h[m],c);if(o&&!a[f].test(y))throw new TypeError('Expected all "'.concat(c.name,'" to match "').concat(c.pattern,'", but got "').concat(y,'"'));u+=c.prefix+y+c.suffix}continue}if(typeof h=="string"||typeof h=="number"){var y=i(String(h),c);if(o&&!a[f].test(y))throw new TypeError('Expected "'.concat(c.name,'" to match "').concat(c.pattern,'", but got "').concat(y,'"'));u+=c.prefix+y+c.suffix;continue}if(!d){var g=p?"an array":"a string";throw new TypeError('Expected "'.concat(c.name,'" to be ').concat(g))}}return u}}function wn(r,e){var t=[],n=pr(r,t,e);return bn(n,t,e)}function bn(r,e,t){t===void 0&&(t={});var n=t.decode,i=n===void 0?function(s){return s}:n;return function(s){var o=r.exec(s);if(!o)return!1;for(var a=o[0],l=o.index,u=Object.create(null),f=function(h){if(o[h]===void 0)return"continue";var d=e[h-1];d.modifier==="*"||d.modifier==="+"?u[d.name]=o[h].split(d.prefix+d.suffix).map(function(p){return i(p,d)}):u[d.name]=i(o[h],d)},c=1;c<o.length;c++)f(c);return{path:a,index:l,params:u}}}function me(r){return r.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function Ct(r){return r&&r.sensitive?"":"i"}function Rn(r,e){if(!e)return r;for(var t=/\((?:\?<(.*?)>)?(?!\?)/g,n=0,i=t.exec(r.source);i;)e.push({name:i[1]||n++,prefix:"",suffix:"",modifier:"",pattern:""}),i=t.exec(r.source);return r}function xn(r,e,t){var n=r.map(function(i){return pr(i,e,t).source});return new RegExp("(?:".concat(n.join("|"),")"),Ct(t))}function Sn(r,e,t){return Pn(mr(r,t),e,t)}function Pn(r,e,t){t===void 0&&(t={});for(var n=t.strict,i=n===void 0?!1:n,s=t.start,o=s===void 0?!0:s,a=t.end,l=a===void 0?!0:a,u=t.encode,f=u===void 0?function(D){return D}:u,c=t.delimiter,h=c===void 0?"/#?":c,d=t.endsWith,p=d===void 0?"":d,m="[".concat(me(p),"]|$"),y="[".concat(me(h),"]"),g=o?"^":"",b=0,_=r;b<_.length;b++){var x=_[b];if(typeof x=="string")g+=me(f(x));else{var K=me(f(x.prefix)),F=me(f(x.suffix));if(x.pattern)if(e&&e.push(x),K||F)if(x.modifier==="+"||x.modifier==="*"){var C=x.modifier==="*"?"?":"";g+="(?:".concat(K,"((?:").concat(x.pattern,")(?:").concat(F).concat(K,"(?:").concat(x.pattern,"))*)").concat(F,")").concat(C)}else g+="(?:".concat(K,"(").concat(x.pattern,")").concat(F,")").concat(x.modifier);else x.modifier==="+"||x.modifier==="*"?g+="((?:".concat(x.pattern,")").concat(x.modifier,")"):g+="(".concat(x.pattern,")").concat(x.modifier);else g+="(?:".concat(K).concat(F,")").concat(x.modifier)}}if(l)i||(g+="".concat(y,"?")),g+=t.endsWith?"(?=".concat(m,")"):"$";else{var E=r[r.length-1],Q=typeof E=="string"?y.indexOf(E[E.length-1])>-1:E===void 0;i||(g+="(?:".concat(y,"(?=").concat(m,"))?")),Q||(g+="(?=".concat(y,"|").concat(m,")"))}return new RegExp(g,Ct(t))}function pr(r,e,t){return r instanceof RegExp?Rn(r,e):Array.isArray(r)?xn(r,e,t):Sn(r,e,t)}var T=(r=>(r[r.Push=0]="Push",r[r.Replace=1]="Replace",r[r.Put=2]="Put",r[r.Append=3]="Append",r[r.Open=4]="Open",r))(T||{}),We=(r=>(r[r.Part=0]="Part",r[r.All=1]="All",r))(We||{});const J=Symbol("rootKey"),G=Symbol("rootNodeKey"),fe=Symbol("parentNodeKey"),ze=Symbol("nameKey");class se{instance=null;model;route;active=!0;index=0;constructor(e,t,n=0,i=!0){this.route=e,this.model=t,this.index=n,this.active=i}}class Te{_slots;get slots(){return this._slots==null&&(this._slots=w.shallowRef([])),this._slots}get empty(){return this._slots==null||this._slots.value.length==0}[ze];[J];[G]=null;[fe]=null;get name(){return this[ze]}constructor(e,t,n){this[ze]=e,this[J]=t,n&&(this[G]=n)}}class U{view;index;level;constructor(e,t,n){this.view=e,this.index=t,this.level=n}static include(e,t){for(let n=0;n<e.length;n++){let i=e[n];if(i.view===t.view&&(t.index==-1||i.index===t.index)&&i.level===t.level)return!0}return!1}}class Et{views=[]}class Cn{layers=[]}class En{time;route}class An{forbidTime=300;submitRecorder=new En;isSameRoute(e,t){return e==null||t==null?!1:e.name===t.name&&e.path===t.path&&e.root===t.root}acquire(e){let t=new Date().getTime();if(this.isSameRoute(e,this.submitRecorder.route)&&this.submitRecorder.time&&t-this.submitRecorder.time<=this.forbidTime){this.submitRecorder.time=t;return}return this.submitRecorder.route=e,this.submitRecorder.time=t,t}release(e){this.submitRecorder.time===e&&(this.submitRecorder.route=void 0)}}const pe=Symbol("_notifyChange");class vr{currentRoute;routes;constructor(e,t){this.currentRoute=e,this.routes=t}}const je=typeof window<"u",L=function(){return window},Je=function(){return window.document};function Fn(r){let e=r,t=e.lastIndexOf("/");return t>0&&t<e.length-1?e=e.substring(0,t+1):t===0&&e.indexOf(".")!==-1?e="/":t===-1&&(e.indexOf(".")==-1?e=`/${e}/`:e="/"),e.indexOf("/")!==0&&(e=`/${e}`),e}function At(){if(!je)return"/";let r=L().location,e=`${r.protocol}//${r.host}`;return e+=Fn(r.pathname),e}function Ft(r,e,t){r.addEventListener?r.addEventListener(e,t,!1):r.attachEvent?r.attachEvent(`on${e}`,t):r[`on${e}`]=t}function Tt(r,e,t){r.removeEventListener?r.removeEventListener(e,t):r.detachEvent?r.detachEvent(`on${e}`,t):r[`on${e}`]=null}const Ge=Symbol("ignoreHistoryChangeOnceKey"),gr=Symbol("_navigateFirstRoute"),Qe=Symbol("_getRouteMark"),jt=Symbol("_getUrlSearch"),$t=Symbol("_generateLocation"),$e=Symbol("_setRouteMarkRecorder"),_e=Symbol("beforeRestoreFiltersKey"),wr=Symbol("_beforeRestore"),br="Symbol(_fox_restore_point)";function _t(r,...e){return typeof r=="function"?Reflect.apply(r,null,[...e]):r}class Rr{base;storage;mode;query;firstNavigate=!0;historyMonitor;traceless=!1;changeHandler;historyChange;[Ge]=!1;[_e]=new Array;constructor(e="hash",t="",n="",i=!0,s=!0,o=!1,a){this.mode=e,this.base=t,this.query=n,this.firstNavigate=i,this.historyMonitor=s,this.traceless=o,this.storage=a??L().sessionStorage}init(e=!0){const t=L();return typeof this.historyChange!="function"&&(this.historyChange=()=>{if(this[Ge]){this[Ge]=!1;return}if(_t(this.historyMonitor)){const n=t.history.state;this[pe](n);try{let i=[];if(typeof n=="string"?i=JSON.parse(n):i=n,Array.isArray(i)&&i.length>0){const s=this[Qe]()??"/";this[$e](s,i)}}catch{}}}),Ft(t,"popstate",this.historyChange),this.firstNavigate&&e&&this[gr](),Promise.resolve()}destroy(){if(this.historyChange){const e=L();Tt(e,"popstate",this.historyChange)}}[wr](e,t,n,i){for(let s of this[_e])try{const o=[],a=Reflect.apply(s,{},[e,t,n,i]);if(a===!1)return a}catch(o){console.error(o.message,o)}return!0}beforeRestoreEach(e){this[_e].push(e)}removeBeforeRestoreEach(e){const t=this[_e].indexOf(e);return t!==-1?(this[_e].splice(t,1),!0):!1}[gr](){const e=this[Qe]()??"/",t=this.storage.getItem(br);if(t)try{const o=JSON.parse(t);if(o.mark===e&&Array.isArray(o.routes)&&o.routes.length>0){const a=o.routes.filter((l,u)=>this[wr](l,u,e,o.routes));if(a.length>0){const l=this[jt](),u=a.length-1;a[u].query=l||a[u].query,this[pe](a);return}}}catch{}const n=e.indexOf("!");let i;n!=-1?i=e.substring(n+1):i=e;const s=new q;s.path=i,s.query=this[jt](),this[pe]([s])}[$e](e,t){try{const i=JSON.stringify({mark:e,routes:t});this.storage.setItem(br,i)}catch(n){console.error(n.message,n)}}setRestorePoint(e){const t=this[Qe]()??"/";this[$e](t,e)}[pe](e){typeof this.changeHandler=="function"&&this.changeHandler(e)}[Qe](){const e=L();if(this.mode==="path"){let t=e.location.pathname;return this.base&&t.indexOf(this.base)===0&&(t=t.substring(this.base.length)),t}else{const t=e.location.hash,n=t.indexOf("#");if(n!=-1)return t.substring(n+1)}return null}[jt](){let t=L().location.search;return t.length>0&&t.indexOf("?")===0&&(t=t.substring(1)),t}listen(e){this.changeHandler=e}go(e,t=!0){const n=L();this[Ge]=!t,n.history.go(e)}push(e){const t=this[$t](e.currentRoute);_t(this.traceless,e.currentRoute)||L().history.pushState(e.routes,"",t);const n=e.currentRoute.fullPath;this[$e](n,e.routes)}replace(e){const t=this[$t](e.currentRoute);_t(this.traceless,e.currentRoute)||L().history.replaceState(e.routes,"",t);const n=e.currentRoute.fullPath;this[$e](n,e.routes)}[$t](e){const t=L();let n="";if(e.query){let a="";if(typeof e.query=="object")for(let l of Reflect.ownKeys(e.query)){let u=encodeURIComponent(e.query[l]),f=`${encodeURIComponent(String(l))}=${u}`;a.length>0&&(a+="&"),a+=f}else a=e.query;this.query?(n=a.length>0?`${this.query}&${a}`:this.query,n.length>0&&n.charAt(0)!=="?"&&(n=`?${n}`)):a.length>0&&(n=`?${a}`)}const i=t.location;let s=e.alias??e.fullPath;s.startsWith(Y)&&(s=s.substring(Y.length+1));let o;return n?this.mode=="path"?s.indexOf("/")===0?o=`${this.base}${s}${n}`:o=`${this.base}/${s}${n}`:o=`${i.pathname}${n}#${s}`:this.mode=="path"?s.indexOf("/")===0?o=`${this.base}${s}`:o=`${this.base}/${s}`:o=`${i.pathname}#${s}`,`${i.origin}${o}`}}function Tn(r=!0,e=null,t="",n=!0,i=!1,s){return e!==null&&(e=L().location.pathname),e&&e.endsWith("/")&&(e=e.substring(0,e.length-1)),new Rr("path",e??"",t,r,n,i,s)}function xr(r=!0,e="",t=!0,n=!1,i){return new Rr("hash","",e,r,t,n,i)}class jn{maxSize=50;cursor=-1;queue=[];changeHandler;base;historyMonitor=!1;traceless=!1;constructor(e,t=50){this.base=e,this.maxSize=t}init(e=!0){return Promise.resolve()}destroy(){this.queue=[]}beforeRestoreEach(e){}removeBeforeRestoreEach(e){return!1}listen(e){this.changeHandler=e}[pe](e){typeof this.changeHandler=="function"&&this.changeHandler(e)}go(e,t=!0){if(this.queue.length==0||this.cursor<=0||this.cursor>=this.queue.length-1)return;let n=this.cursor+e;if(n<0?n=0:n>this.queue.length-1&&(n=this.queue.length-1),n!=this.cursor&&(this.cursor=n,t)){const i=this.queue[n];this[pe](i.routes)}}push(e){this.queue.length>=this.maxSize&&this.queue.splice(0,1),this.queue.push(e),this.cursor=this.queue.length-1}replace(e){let t=this.queue.length-this.cursor;this.queue.splice(this.cursor,t),this.queue[this.cursor]=e}setRestorePoint(e){}}function Sr(r="",e=50){return new jn(r,e)}function hi(r){}const Xe=Symbol("_constructRouteModel"),Ye=Symbol("_findRouteModel"),Kt=Symbol("_findRootView"),Pr=Symbol("_getFirstView"),ce=Symbol("_removeView"),Cr=Symbol("_buildPage"),Er=Symbol("_resolveComponent"),Ar=Symbol("_update"),oe=Symbol("_merge"),qt=Symbol("_handleHistoryChange"),Ze=Symbol("_handleRouteUpdated"),et=Symbol("routeUpdatedCallback"),R=Symbol("currentRoutes"),ve=Symbol("current"),Fr=Symbol("_addRouteRecorder"),Ke=Symbol("_removeRouteRecorder"),tt=Symbol("_cloneRouteRecorder"),O=Symbol("_handleError"),rt=Symbol("errorCallback"),k=Symbol("registerKey"),nt=Symbol("notFoundKey"),Ot=Symbol("notFoundPathKey"),W=Symbol("forestKey"),A=Symbol("historyKey"),qe=Symbol("beforeFiltersKey"),Oe=Symbol("afterFiltersKey"),Le=Symbol("destroyFiltersKey"),ge=Symbol("mainDispatcherKey"),Lt=Symbol("initKey"),he=Symbol("readyKey"),Mt=Symbol("readyHandlersKey"),it=Symbol("_markReady"),Tr=Symbol("_createNextFn"),It=Symbol("_start"),Nt=Symbol("_before"),Ht=Symbol("_after"),jr=Symbol("_destroy"),Dt=Symbol("_load"),Me=Symbol("_unload"),Ie=Symbol("routerGuardKey");function $n(r){return r.layers.length==0||r.layers[0].views.length==0}function _n(r){let e=[];return r.layers.forEach(t=>{t.models==null||t.models==null||t.models.forEach(n=>{if(!(n==null||n==null))if(typeof n.meta=="object"){let i=j(!0,{},n.meta);e.push(i)}else n.meta&&e.push(n.meta)})}),e}class Kn{[k]=new Array;[nt];[Ot]="*";[he]=!1;[Mt]=[];[W]=new Cn;[A];[R]=new Array;[rt]=null;[et]=null;[qe]=new Array;[Oe]=new Array;[Le]=new Array;[ge]=new Ae;[Ie]=new An;[Lt]=!1;[ve]=w.ref(null);get current(){return this[ve].value}options;constructor(e){this.options=e??{},this.options.notFoundPath&&this.setNotFoundPath(this.options.notFoundPath);let t=this.options.routes||[];this.addRoutes(t),this.options.notFound&&this.setNotFoundRoute(this.options.notFound),e.history?this[A]=e.history:this[A]=je?xr():Sr(),this[A]?.listen(async n=>{let i=!0;try{if(typeof n=="string"){const s=this[I](n);s&&await this[qt]([s])}else await this[qt](n)}catch(s){console.error(s.message,s),i=!1}this[he]===!1&&this[it](i)})}[O](e="error",t){if(t&&typeof t.error=="function")try{t.error(e)}catch{}if(typeof this[rt]=="function")try{this[rt](e,t)}catch{}console.error(e)}init(){this[Lt]!==!0&&(this[A]?.init(!this[he]),this[Lt]=!0)}isReady(){return this[he]?Promise.resolve():new Promise((e,t)=>{this[Mt].push([e,t])})}[it](e){this[he]=!0,this[Mt].forEach(([t,n])=>{try{e?t():n()}catch(i){console.error(i.message,i)}})}[qt](e){try{if(!e){let o=[...this[R]].reverse();return this[Me](o),je&&L().location.reload(),Promise.resolve()}let t=null,n=[],i=[],s=0;for(;s<e.length&&s<this[R].length&&q.isSame(e[s],this[R][s]);s++)e[s].active===!0&&e[s].active!==this[R][s].active&&(t=e[s]);if(s<e.length&&(n=e.slice(s)),s<this[R].length&&(i=this[R].slice(s).reverse()),i.length===0&&n.length===0){if(t!==null)return this.restore([t])}else if(i.length>0){if(this[Me](i)){if(n.length>0)return this.restore(n);if(t!==null)return this.restore([t])}}else return this.restore(n)}catch(t){this[O](t)}return Promise.resolve()}[Ze](e){if(e)this[ve].value=e;else{let t=this[R].length;t>0?this[ve].value=this[R][t-1]:this[ve].value=null}if(typeof this[et]=="function")try{this[et](this[ve].value)}catch{}}[Fr](e){if(e.opsType===T.Open){let t=!1;const n=this[R].length-1;for(let i=n;i>=0;i--){const s=this[R][i];if(e.root==s.root){if(e.path===s.path){this[R].splice(i,1,e),t=!0;continue}e.active&&(s.active=!1)}}t||this[R].push(e)}else this[R].push(e)}[tt](){let e=[];for(let t of this[R]){let n=q.clone(t,!0);e.push(n)}return e}[Ke](e){if(!this[R])return;let t=-1;for(let n=0;n<this[R].length;n++)if(q.isSame(this[R][n],e)){t=n;break}if(t!=-1){let n=this[R][t];this[R].splice(t,1),this[jr](n,n.session)}}set historyMonitor(e){this[A]&&(this[A].historyMonitor=e)}get historyMonitor(){return this[A]?this[A].historyMonitor:!1}set traceless(e){this[A]&&(this[A].traceless=e)}get traceless(){return this[A]?this[A].traceless:!1}setRestorePoint(){const e=this[tt]();this[A]?.setRestorePoint(e)}onRouteUpdated(e){this[et]=e}onError(e){this[rt]=e}beforeEach(e){this[qe].push(e)}removeBeforeEach(e){const t=this[qe].indexOf(e);return t!==-1?(this[qe].splice(t,1),!0):!1}afterEach(e){this[Oe].push(e)}removeAfterEach(e){const t=this[Oe].indexOf(e);return t!==-1?(this[Oe].splice(t,1),!0):!1}destroyEach(e){this[Le].push(e)}removeDestroyEach(e){const t=this[Le].indexOf(e);return t!==-1?(this[Le].splice(t,1),!0):!1}beforeRestoreEach(e){this[A]?.beforeRestoreEach(e)}removeBeforeRestoreEach(e){return this[A]?.removeBeforeRestoreEach(e)??!1}addRoutes(e){for(let t of e)this.addRoute(t)}addRoute(e,t=-1){if(e.path===this[Ot]){this.setNotFoundRoute(e);return}const n=this[Xe](e);if(t==-1)this[k]=[...this[k],...n];else for(let i=n.length-1;i>=0;i--)this[k].splice(t,0,n[i])}removeRoute(e){const t=this[I](e);if(t===null)return console.warn("route格式错误",e),!1;for(let n=0;n<this[k].length;n++){const i=this[k][n];if(t?.path&&i.path===t.path)return this[k].splice(n,1),!0;if(t?.name&&i.name===t.name)return this[k].splice(n,1),!0}return!1}hasRoute(e){const t=this[I](e);return t===null?(console.warn("route格式错误",e),!1):this[k].findIndex(i=>{if(t?.path&&i.path===t.path||t?.name&&i.name===t.name)return!0})!==-1}setNotFoundPath(e){this[Ot]=e}setNotFoundRoute(e){const t=this[Xe](e);this[nt]=t[0]}getRoutes(){return[...this[k]]}[Xe](e){let t=e.path??"";t.length>0&&t.charAt(0)!=="/"&&(t=`/${t}`);let n=e.components??(e.component&&{"":e.component});if(n==null){const a=new mt;return a.path=t,a.redirect=e.redirect,[a]}let i=[];for(let a in n){let l=n[a];a.length===0&&(a=Y);let u=new sn(a,l,e.props,e.meta);i.push(u)}let s=!1,o=[];if(e.children)for(let a of e.children){let l=this[Xe](a);for(let u of l){let f=new mt;f.name=u.name,u.path&&u.path.length>0?t!=="/"?f.path=`${t}${u.path}`:f.path=u.path:(s=!0,f.path=t);let c=new lr;c.models=[...i],f.layers=[c,...u.layers],o.push(f)}}if(!s){const a=new lr;a.models=i;const l=new mt;l.name=e.name,l.path=t,l.layers=[a],o.splice(0,0,l)}return o}[Ye](e){const t=e.route;try{for(let n of this[k])if(t.path&&n.path){let i=n.match;i||(i=n.match=wn(n.path));let s=i(t.path);if(!s)continue;if(n.redirect){let o=new q;j(!0,o,t),o.path=n.redirect;let a={route:o,find:void 0};return this[Ye](a)?(e.route=a.route,e.find=a.find,!0):!1}if(t.params=t.params??{},j(!0,t.params,s.params),t.query){let o=t.query;if(typeof o=="string"){let a={},l=o.split("&");for(let u of l){let f=u.split("=");if(f.length!==2)continue;let c=decodeURIComponent(f[0].trim()),h=decodeURIComponent(f[1].trim());a[c]=h}j(!0,t.params,a)}else typeof o=="object"&&j(!0,t.params,o)}return e.find=n,!0}else if(t.name===n.name){t.params=t.params??{};let i=vn(n.path);return t.path=i(t.params),e.find=n,!0}}catch(n){console.error(n.message,n),typeof t.error=="function"&&t.error(n.message)}return!1}[I](e){let t=null;if(Array.isArray(e))if(t=new q,typeof e[0]=="object")t=q.from(e[0]);else for(let n=0;n<e.length;n++)n===0?e[n].charAt(0)==="/"?t.path=e[n]:t.name=e[n]:n===1?t.params=e[n]:n===2?t.root=e[n]:n===3&&j(!1,t,e[n]);else typeof e=="object"?t=q.from(e):typeof e=="string"&&(t=new q,e.charAt(0)=="/"?t.path=e:t.name=e);if(t){if(t.path){let n=t.path.indexOf("?");n!==-1&&n<t.path.length-1&&(t.query=t.path.substring(n+1),t.path=t.path.substring(0,n))}t.root=t.root??Y,t.opsType=t.opsType??this.options.defaultOperationType??T.Push}return t}push(...e){let t=this[I](e);return t?(t.opsType=t.opsType||T.Push,this.to(t)):(this[O]("resolve route fail",t),this)}put(...e){let t=this[I](e);return t?(t.opsType=T.Put,this.to(t)):(this[O]("resolve route fail",t),this)}replace(...e){let t=this[I](e);return t?(t.opsType=T.Replace,this.to(t)):(this[O]("resolve route fail",t),this)}append(...e){let t=this[I](e);return t?(t.opsType=T.Append,this.to(t)):(this[O]("resolve route fail",t),this)}remove(e){return new Promise(t=>{this[ge].post(n=>{try{if(this[R].length===0){n.resolve(),t(!1);return}let i=-1,s,o=[];if(e){if(e.root?s=e.root:s=this[R][0].root??Y,e.all)for(let l=this[R].length-1;l>0;l--){let u=this[R][l];u.opsType===T.Append&&u.root===s&&(o.splice(0,0,u),i=l-1)}else if(e.until)for(let l=this[R].length-1;l>0;l--){let u=this[R][l];if(u.opsType===T.Append&&u.root===s){if(e.until.charAt(0)==="/"&&e.until===u.path){i=l;break}else if(e.until===u.name){i=l;break}o.splice(0,0,u)}}}else{s=Y;let l=this[Pr](this[W]);l&&(s=l.name);for(let u=this[R].length-1;u>0;u--){let f=this[R][u];if(f.opsType===T.Append&&f.root===s){o.push(f),i=u-1;break}}}if(o.length===0){let l="can not find route";console.warn(l),n.resolve(l),t(!1);return}let a=0;if(this[R].forEach(l=>{l.opsType!==T.Put&&a++}),this[Me](o)){let l=0;this[R].forEach(f=>{f.opsType!==T.Put&&l++});const u=l-a;this[A]?.go(u,!1),n.resolve(),t(!0)}}catch(i){this[O](i),n.resolve(),t(!1)}})})}open(...e){let t=this[I](e);return t?(t.opsType=T.Open,this.to(t)):(this[O]("resolve route fail",t),this)}close(e){return this[ge].post(t=>{try{let n=this[I](e);if(!n){t.reject("resolve route fail");return}let i=[];for(let s=0;s<this[R].length;s++){let o=this[R][s];if(o.root===n.root){if(!n.path&&!n.name){i.push(o);continue}if(n.path&&n.path===o.path){i.push(o);break}else if(n.name&&n.name===o.name){i.push(o);break}}}if(i.length===0){t.resolve();return}this[Me](i)&&this[Ze](),t.resolve()}catch(n){this[O](n),t.resolve()}}),this}to(...e){let t=this[I](e);if(!t)return this[O]("resolve route fail",t),this;let n=this[Ie].acquire(t);return n==null?(this[O]("route forbid",t),this):(this[ge].post(i=>{try{let s=this[It](t);this[Nt](s),this[Dt](s),this[Ht](s),s.wait((o,a)=>{const l=o.session.to;try{let u=q.clone(l,!0);const f=new vr(u,this[tt]());l.opsType===T.Replace?this[A]?.replace(f):this[A]?.push(f)}catch(u){console.error(u.message,u)}if(this[Ie].release(n),this[Ze](l),typeof t.success=="function")try{Reflect.apply(t.success,{},[])}catch(u){console.error(u.message,u)}this[he]===!1&&this[it](!0),i.resolve()},(o,a)=>{this[Ie].release(n),a!==null&&this[O](a,t),this[he]===!1&&this[it](!1),i.resolve()})}catch(s){this[Ie].release(n),this[O](s,t),i.resolve()}}),this)}back(e=1){this[A]?.go(-e)}[Tr](e){return(t,n)=>{if(typeof t=="boolean")e.session.redirect=!1,t?e.resolve():e.reject(n??null);else if(t){const i=this[I](t);if(i){const s=e.session.to;i.success=s.success,i.error=s.error,e.session.to=i,e.session.redirect=!0,e.session.routeModel=null,e.resolve()}else e.session.redirect=!1,e.reject("route resolve fail")}else e.session.redirect=!1,e.resolve()}}[It](e){let t=this[R].length>0?this[R][0]:void 0,n=new De(e,t),i={route:e,find:null};return this[Ye](i),i.find&&(n.routeModel=i.find,e.matched=_n(i.find),Array.isArray(e.matched)&&e.matched.length>0&&(e.meta=i.find.layers[0].models[0].meta)),new Ae(n)}[Nt](e){for(let t of this[qe])e.post(n=>{let i=this[Tr](n);Reflect.apply(t,{},[n.session.to,n.session.from,i,n.session])})}[Ht](e){e.post(t=>{for(let n of this[Oe])try{Reflect.apply(n,{},[t.session.to,t.session.from,t.session])}catch(i){console.error(i.message,i)}t.resolve()})}[jr](e,t){for(let n of this[Le])try{Reflect.apply(n,{},[e,t])}catch(i){console.error(i.message,i)}typeof e.destroy=="function"&&Reflect.apply(e.destroy,e,[])}[Dt](e){e.post(t=>{let n=t.session.to,i=t.session.routeModel;if(i==null){let o={route:n,find:null};if(this[Ye](o))i=o.find,t.session.routeModel=i;else if(this[nt])i=this[nt];else{t.reject(`not find route model, path:${n.path??n.name}`);return}}let s=De.from(t.session);this[Cr](n,i,s).then(o=>{this[W],t.resolve()},o=>{t.reject(o)})})}[Me](e){if(e.length==0)return!0;let t=this[W],n=[];for(let i of e){let s=this[Kt](t,i);s!=null&&n.push({...s,route:i})}if(n.length==0){let i="can not find view index";return this[O](i),!1}for(let i of n.reverse())this[ce](t,{x:i.x,y:i.y},[i.route.index??0],!0);return!0}[Kt](e,t){const n=t.root??Y;let i;for(let s=0;s<e.layers.length;s++){const o=e.layers[s];for(let a=o.views.length-1;a>=0;a--){const l=o.views[a];if(l[J]&&l[ze]===n)return i={x:a,y:s},i}}return null}[Pr](e){return e.layers.length>0&&e.layers[0].views.length>0?e.layers[0].views[0]:null}[ce](e,t,n=null,i=!0){if(t.y>=e.layers.length||t.x>=e.layers[t.y].views.length)return;let s=e.layers[t.y].views[t.x],o=!1,a=[],l=!1,u=[...s.slots.value];for(let c=u.length-1;c>=0;c--){let h=u[c];(!n||n.indexOf(h.index)!=-1)&&(h.route&&s[J]&&(this[Ke](h.route),h.active===!0&&h.route.opsType==T.Append&&(l=!0)),a.push(new U(s,h.index,t.y)),u.splice(c,1))}if(u.length==0)i?s.slots.value=u:e.layers[t.y].views.splice(t.x,1);else{if(l){let c=u.length-1,h=u[c];h.active=!0,h.route&&(h.route.active=h.active)}s.slots.value=u}e.layers[t.y].views.length==0&&(o=!0);let f=t.y+1;for(;f<e.layers.length;f++){let c=e.layers[f].views,h=[];for(let d=c.length-1;(o||a.length>0)&&d>=0;d--){let p=c[d];if(p[fe]&&(o||U.include(a,p[fe]))){let m=p.slots.value;for(let y=m.length-1;y>=0;y--){let g=m[y];g.route&&p[J]&&this[Ke](g.route),h.push(new U(p,g.index,f)),m.splice(y,1)}e.layers[f].views.splice(d,1)}}a=h,e.layers[f].views.length==0&&(o=!0)}}restore(e){if(!e||this[k].length==0){let t=this[W];if(t.layers.length>0){let n=t.layers[0].views;n.length>0&&(n[0].slots.value=[])}return this[R]=[],this[Ze](),Promise.resolve()}else return new Promise((n,i)=>{let s=null,o=!1;for(let a=0;a<e.length;a++){const l=e[a];this[ge].post(u=>{const f=this[It](l);this[Nt](f),this[Dt](f),this[Ht](f),f.wait((c,h)=>{s=c.session.to,o=c.session.redirect,u.resolve()},(c,h)=>{s=null,h!==null&&this[O](h),u.resolve()})})}this[ge].post(a=>{if(s&&o===!0){const l=q.clone(s,!0),u=new vr(l,this[tt]());this[A]?.replace(u)}a.resolve(),n()})})}[Cr](e,t,n){let i=e.updateType??We.Part;return this[Er](t).then(()=>{this[Ar](t,e,n,i)})}[Er](e){let t=[];for(let n=0;n<e.layers.length;n++){let i=e.layers[n];for(let s=0;s<i.models.length;s++){let o=i.models[s];o.isResolved||t.push(o.resolve())}}return t.length>0?Promise.all(t):Promise.resolve()}[Ar](e,t,n,i){if(e.layers[0].models.length!==1)return Promise.reject("illegal route structure(multi root node)");const s=e.layers[0].models[0];let o=this[W],a=$n(o),l=t.root??Y,u;!a&&i==We.Part&&(u=this[Kt](o,t));let f,c=0;if(u==null||u==null)if(a||i===We.All){if(o.layers.length==0&&(o.layers[0]=new Et),o.layers[0].views.length==0){let h=t.root??Y;f=new Te(h,!0,null),o.layers[0].views=[f]}else f=o.layers[0].views[0];u={x:0,y:0}}else{let h=t.slot;if(!h)return Promise.reject("can not rebuild view(because not route slot)");let d=h.level;if(d>o.layers.length)return Promise.reject("can not insert view(override level)");let p;if(h.rootName){let m=o.layers[d-1];for(let y of m.views){if(y[J]&&y.name===h.rootName){p=new U(y,h.rootIndex??0,d-1);break}if(y[G]&&y[G].view.name===h.rootName&&y[G].index===h.rootIndex){p=y[G];break}}}if(!p)return Promise.reject("can not insert view(not find root node ref)");f=new Te(l,!0,p),o.layers[d].views.push(f),u={x:o.layers[d].views.length-1,y:d}}else f=o.layers[u.y].views[u.x];if(c=u.y,f[J]=!0,t.opsType===T.Append){t.index=ne.get(),t.active=!0;let h=f.slots.value;if(h.length>0){let g=h[h.length-1];g.active=!1,g.route&&(g.route.active=g.active)}let d=new se(t,s,t.index,!0);f.slots.value=[...h,d];let p=c+1,m=1,y=new U(f,t.index,c);this[oe](o,p,e,m,y)}else if(t.opsType===T.Open){let h=f.slots.value;const d=t.active??!0;let p=!1;for(let m of h){if(m.route!==null&&q.isSameForRouteModel(m.route,t)){if(m.active===d)return t.index=m.index,t.active=d,m.route=t,Promise.resolve();m.active=d,p=!0,t.index=m.index,t.active=d,m.route=t}else d&&(m.active=!1);m.route&&(m.route.active=m.active)}if(!p){t.index=ne.get(),t.active=d;let m=new se(t,s,t.index,d);h.push(m);let y=c+1,g=1,b=new U(f,t.index,c);this[oe](o,y,e,g,b)}f.slots.value=[...h]}else{let h=f.slots.value;if(h.length==0){t.index=ne.get(),t.active=!0,f.slots.value=[new se(t,s,t.index)];let d=c+1,p=1,m=new U(f,t.index,c);this[oe](o,d,e,p,m)}else{let d=h[0];if(d.model!==s){this[ce](o,u,null,!0),t.index=ne.get(),t.active=!0,f.slots.value=[new se(t,s,t.index)];let p=c+1,m=1,y=new U(f,t.index,c);this[oe](o,p,e,m,y)}else{d.route!==null&&this[Ke](d.route);let p=!1;const m=t.active??!0;d.active!==m&&(d.active=m,p=!0),t.active=m,t.index=d.index,d.route=t;let y=[];for(let K=1;K<h.length;K++)y.push(h[K].index);y.length>0?this[ce](o,u,y,!0):p&&(f.slots.value=[...h]);let g=[new U(f,t.index,c)],b=c+1,_=1,x=new U(f,t.index,c);for(;g.length>0&&b<o.layers.length&&_<e.layers.length;b++,_++){let K=[];for(let C=0;C<o.layers[b].views.length;C++){let E=o.layers[b].views[C];E[fe]&&U.include(g,E[fe])&&K.unshift(C)}let F=[];for(let C of K){let E=o.layers[b].views[C],Q=e.layers[_].models,D;for(let V=0;V<Q.length;V++)if(E.name===Q[V].name){D=Q[V];break}if(!D)this[ce](o,{x:C,y:b},null,!1);else{let V=E.slots.value;if(V.length==0){let te=0;E.slots.value=[new se(null,D,te)];let X=b+1,re=_+1;this[oe](o,X,e,re,x)}else{let te=V[0];if(te.model!==D){this[ce](o,{x:C,y:b},null,!0),E.slots.value=[new se(null,D,0)];let X=b+1,re=_+1;this[oe](o,X,e,re,x)}else{E[J]&&te.route!==null&&this[Ke](te.route);let X=[];for(let re=1;re<V.length;re++)X.push(V[re].index);X.length>0&&this[ce](o,{x:C,y:b},X,!0),F.push(new U(E,te.index,b))}}E[J]=!1}}g=F}this[oe](o,b,e,_,x)}}}if(f&&f[G]){let h=f[G];h&&(t.slot=new nn(l,c,h?.view.name,h?.index??0))}n.to=void 0,n.routeModel=void 0,t.session=n,this[Fr](t)}[oe](e,t,n,i,s){let o=i,a=t;for(;a<e.layers.length&&o<n.layers.length;a++,o++){let l=e.layers[a].views;for(let u of n.layers[o].models){let f=new Te(u.name,!1,s),c=new se(null,u);f.slots.value=[c],l.push(f)}}for(;o<n.layers.length;o++){let l=new Et;l.views=[];for(let u of n.layers[o].models){let f=new Te(u.name,!1,s),c=new se(null,u);f.slots.value=[c],l.views.push(f)}e.layers.push(l)}}[sr](e,t,n,i,s,o){if(t<0||t>this[W].layers.length)return null;if(t<this[W].layers.length){let f=this[W].layers[t],c=null;for(let h of f.views){let d=!1;if(n!==null?(d=h.name===e&&h[G]?.view===n,d&&i!==-1&&(d=h[G]?.index===i)):d=h.name===e,!!d){s!==null&&(h[fe]={view:s,index:o,level:t-1}),c=h;break}}if(c!==null)return c}let a=null,l=null;s!==null&&(s[J]?a={view:s,index:o,level:t-1}:a=s[G],l={view:s,index:o,level:t-1});let u=new Te(e,!0,a);if(u[fe]=l,t==this[W].layers.length){let f=new Et;f.views=[u],this[W].layers.push(f)}else this[W].layers[t].views.push(u);return u}}const qn="fox-router-view",On="fox-router-link";function $r(r,e=!1){let t=null;return e?t=r.showFromClass??r.enterFromClass:t=r.enterFromClass,t||(t=r.transitionName,t?e?`${t}-show-from`:`${t}-enter-from`:null)}function _r(r,e=!1){let t=null;return e?t=r.showActiveClass??r.enterActiveClass:t=r.enterActiveClass,t||(t=r.transitionName,t?e?`${t}-show-active`:`${t}-enter-active`:null)}function Ln(r,e=!1){let t=null;return e?t=r.showToClass??r.enterToClass:t=r.enterToClass,t||(t=r.transitionName,t?e?`${t}-show-to`:`${t}-enter-to`:null)}function Mn(r,e=!1){let t=null;return e?t=r.hideFromClass??r.leaveFromClass:t=r.leaveFromClass,t||(t=r.transitionName,t?e?`${t}-hide-from`:`${t}-leave-from`:null)}function In(r,e=!1){let t=null;return e?t=r.hideActiveClass??r.leaveActiveClass:t=r.leaveActiveClass,t||(t=r.transitionName,t?e?`${t}-hide-active`:`${t}-leave-active`:null)}function Nn(r,e=!1){let t=null;return e?t=r.hideToClass??r.leaveToClass:t=r.leaveToClass,t||(t=r.transitionName,t?e?`${t}-hide-to`:`${t}-leave-to`:null)}function Hn(r,e=!1){let t=null;return e?t=r.beforeShow??r.beforeEnter:t=r.beforeEnter,t}function Dn(r,e=!1){let t=null;return e?t=r.show??r.enter:t=r.enter,t}function Vn(r,e=!1){let t=null;return e?t=r.afterShow??r.afterEnter:t=r.afterEnter,t}function Bn(r,e=!1){let t=null;return e?t=r.showCancelled??r.enterCancelled:t=r.enterCancelled,t}function Un(r,e=!1){let t=null;return e?t=r.hide??r.leave:t=r.leave,t}function kn(r,e=!1){let t=null;return e?t=r.afterHide??r.afterLeave:t=r.afterLeave,t}function Wn(r,e=!1){let t=null;return e?t=r.hideCancelled??r.leaveCancelled:t=r.leaveCancelled,t}function Vt(r){let e,t=r.duration;return typeof t=="object"?e={enter:t.enter??-1,leave:t.leave??-1,show:t.show??-1,hide:t.hide??-1}:(typeof t=="string"&&(t=t.length==0?-1:Number(t)),e={enter:t,leave:t,show:t,hide:t}),e}function we(r,e){r.classList.contains(e)||r.classList.add(e)}function be(r,e){r.classList.remove(e)}const zn=je&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout;function Bt(r){zn(r)}function H(r,e,t){S(e)&&(r==null&&(r={}),Reflect.apply(e,r,t))}function Kr(r,e,t,n=-1,i,s,o,a){if(S(s)){if(i!==void 0&&i>=0){setTimeout(()=>{Reflect.apply(s,r,[e,t,n]),S(a)&&Reflect.apply(a,r,[])},i);return}const l=["animationend","transitionend"],u=f=>{l.forEach(c=>{Tt(e,c,u)}),Reflect.apply(s,r,[e,t,n]),a&&Reflect.apply(a,r,[])};l.forEach(f=>{Ft(e,f,u)})}if(S(o)){const l="animationcancel",u=f=>{Reflect.apply(o,r,[e,t,n]),Tt(e,l,u)};Ft(e,l,u)}}function Ut(r){return!je||r===null?!1:r.opsType===T.Append||r.opsType===T.Open}function qr(r,e,t,n={},i,s=-1){if(e||Ut(i)){const o=$r(n,e);o&&we(t,o);const a=_r(n,e);a&&we(t,a);const l=Hn(n,e);H(r,l,[t,e,i,s])}}function Or(r,e,t,n={},i,s,o,a){if(!Ut(s)&&!e){S(a)&&a(r,a,[t]);return}const l=$r(n,e),u=_r(n,e),f=Ln(n,e),c=Dn(n,e),h=Vn(n,e),d=Bn(n,e);Bt(()=>{Kr(r,t,s,o,i,()=>{u&&be(t,u),f&&be(t,f),S(h)&&H(r,h,[t,e,s,o]),S(a)&&a(r,a,[t])},()=>{S(d)&&H(r,d,[t,e,s,o])}),l&&be(t,l),f&&we(t,f),S(c)&&H(r,c,[t,e,s,o])})}function Lr(r,e,t,n={},i,s,o,a,l){if(!Ut(o)&&!e){!e&&S(s)&&s();return}const u=Mn(n,e),f=In(n,e),c=Nn(n,e),h=Un(n,e),d=kn(n,e),p=Wn(n,e);u&&we(t,u),f&&we(t,f),S(h)&&H(r,h,[t,e,o,a]),Bt(()=>{Kr(r,t,o,a,i,()=>{f&&be(t,f),c&&be(t,c),S(d)&&H(r,d,[t,e,o,a]),S(l)&&H(r,l,[t]),!e&&S(s)&&s()},()=>{S(p)&&H(r,p,[t,e,o,a]),S(l)&&H(r,l,[t]),!e&&S(s)&&s()}),u&&be(t,u),c&&we(t,c)})}function kt(r,e={},t,n=-1){const i=e.mode??"default",s=Vt(e);return{mode:i,persisted:!1,beforeEnter:a=>{qr(r,!1,a,e,t,n)},enter:a=>{Or(r,!1,a,e,s.enter,t,n)},leave:(a,l)=>{Lr(r,!1,a,e,s.leave,l,t,n)},clone:a=>kt(r,e,t,n)}}function Mr(r){return r.el}function Jn(r,e,t={},n,i,s,o){if(s){const a=Mr(e);if(a==null)return;const l=Vt(t);qr(r,!0,a,t,n,i),Or(r,!0,a,t,l.show,n,i,u=>{S(o)&&H(r,o,[u])})}else S(o)&&H(r,o,[])}function Gn(r,e,t={},n,i,s,o){if(s){const a=Mr(e);if(a==null)return;const l=Vt(t);Lr(r,!0,a,t,l.hide,null,n,i,u=>{S(o)&&H(r,o,[u])})}else S(o)&&H(r,o,[])}function Qn(r,e={}){Bt(()=>{for(let t=0;t<r.length;t++)Reflect.apply(r[t],e,[])})}function le(r,e,t){return typeof r=="function"?Reflect.apply(r,{},[e,t]):r}function Wt(r,e){if(!r)return null;const t=r(e);return t.length===1?t[0]:t}class Xn{node;state;constructor(e,t){this.node=e,this.state=t}}const zt=w.defineComponent({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,required:!1,default:"default"},modelSlot:{type:[Object],required:!1},multi:{type:Boolean,required:!1,default:!1},tag:{type:[String,Object,Function],required:!1,default:"div"},viewTag:{type:[String,Object,Function],required:!1,default:"div"},viewTagProps:{type:[Object,Function],required:!1,default(){return{}}},viewClass:{type:[String,Function],required:!1},viewActiveClass:{type:[String,Function],required:!1},viewInactiveClass:{type:[String,Function],required:!1},transition:{type:[Boolean,String,Function],required:!1,default:!1},transitionName:{type:String,required:!1},enterFromClass:{type:String,required:!1},enterActiveClass:{type:String,required:!1},enterToClass:{type:String,required:!1},leaveFromClass:{type:String,required:!1},leaveActiveClass:{type:String,required:!1},leaveToClass:{type:String,required:!1},showFromClass:{type:String,required:!1},showActiveClass:{type:String,required:!1},showToClass:{type:String,required:!1},hideFromClass:{type:String,required:!1},hideActiveClass:{type:String,required:!1},hideToClass:{type:String,required:!1},beforeEnter:{type:Function,required:!1},enter:{type:Function,required:!1},afterEnter:{type:Function,required:!1},enterCancelled:{type:Function,required:!1},beforeLeave:{type:Function,required:!1},leave:{type:Function,required:!1},afterLeave:{type:Function,required:!1},leaveCancelled:{type:Function,required:!1},beforeShow:{type:Function,required:!1},show:{type:Function,required:!1},afterShow:{type:Function,required:!1},showCancelled:{type:Function,required:!1},beforeHide:{type:Function,required:!1},hide:{type:Function,required:!1},afterHide:{type:Function,required:!1},hideCancelled:{type:Function,required:!1}},setup(r,e){const t=w.getCurrentInstance();if(t===null||t.proxy===null){console.error("instance or instance.proxy not exist");return}const n=r.multi===!0,i=w.inject(ke,null),s=w.inject(xt,0),o=w.inject(dr,null),a=w.inject(St,-1);let l=null;const u=r.modelSlot;if(u){if(w.provide(xt,s+1),w.provide(St,u.index),w.provide(Pt,u.index),!u.route){console.warn("child view render error, route not exist");return}const h=Be(t.proxy,!0);fn(h),hr(h,()=>u.route??null)}else{if(i==null){console.error("router is not been injected");return}const c=r.name,h=w.inject(yr,null),d=w.inject(Pt,0);if(l=i[sr](c,s,o,a,h,d),l===null)return;w.provide(yr,l);const p=l[J]===!0;if(p&&w.provide(dr,l),!n&&(w.provide(St,-1),w.provide(xt,s+1),w.provide(Pt,-1),p)){const m=Be(t.proxy,!0);hr(m,()=>{const y=l.slots.value;return y.length>0?y[0].route:null})}}const f={value:new Map};return w.onUnmounted(()=>{f.value&&f.value.clear()}),()=>{if(n){const c=new Map,h=[],d=l?.slots.value,p=[];for(let g=0;g<d.length;g++){const b=d[g],_=`${r.name}_${b.index}`,x=le(r.transition,b.route,g)??!0,K={modelSlot:b};let F;e.slots.default?F=w.h(zt,K,{default:e.slots.default}):F=w.h(zt,K);const C={},E=le(r.viewClass,b.route,g);typeof E=="string"&&E.length>0&&(C[E]=!0);const Q=le(r.viewActiveClass,b.route,g),D=le(r.viewInactiveClass,b.route,g),V=f.value.get(_);if(typeof Q=="string"&&Q.length>0&&(C[Q]=b.active),typeof D=="string"&&D.length>0&&(C[D]=!b.active),V&&b.active!==V.state){const xe=V.node;b.active?p.unshift(()=>{const Zt=()=>{let Ne=ur(xe);Ne!=null&&fr(Ne,wt.ACTIVATED)};Jn(t,xe,r,b.route,g,x,Zt)}):p.push(()=>{const Zt=()=>{const Ne=ur(xe);Ne!=null&&fr(Ne,wt.DEACTIVATED)};Gn(t,xe,r,b.route,g,x,Zt)})}const te={class:C,key:_},X=le(r.viewTagProps,b.route,g);X!==null&&typeof X=="object"&&j(!0,te,X),b.route?.viewTagAttrs&&typeof b.route?.viewTagAttrs=="object"&&j(!0,te,b.route.viewTagAttrs);const re=le(r.viewTag,b.route,g),Yt=w.h(re,te,{default:()=>[F]});if(c.set(_,new Xn(Yt,b.active)),f.value.delete(_),x){const xe=kt(t,r,b.route,g);Yt.transition=xe}h.push(Yt)}f.value.forEach(g=>{g.node.transition=null}),f.value=c,Qn(p,t);const m=le(r.tag,null,-1),y={};return Object.assign(y,e.attrs),w.h(m,y,{default:()=>h})}else if(u!=null){const c=u.model,h={};c.props&&(typeof c.props=="object"?j(!1,h,c.props):c.props===!0&&typeof u.route?.params=="object"&&j(!1,h,u.route?.params));const d=w.h(c.component,h);return Wt(e.slots.default,{Component:d,route:u.route})??d}else{const c=l.slots.value;if(c.length>0){const h=c[0],d=h.route??(t.proxy&&Rt(t.proxy))??null,p=h.model,m={};p.props&&(typeof p.props=="object"?j(!1,m,p.props):p.props===!0&&typeof d?.params=="object"&&j(!1,m,d?.params));const y=w.h(p.component,m);if(le(r.transition,d,-1)??!0){const b=kt(t,r,d,-1);y.transition=b}return Wt(e.slots.default,{Component:y,route:d})??y}else return Wt(e.slots.fallback,{})}}}});function Yn(r){if(!(r.metaKey||r.altKey||r.ctrlKey||r.shiftKey)&&!r.defaultPrevented&&!(r.button!=null&&r.button!==0)){if(r.currentTarget&&r.currentTarget.getAttribute){const e=r.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return r.preventDefault&&r.preventDefault(),!0}}function Zn(r,e){return r==null||e==null?!1:!!(r===e||r.path&&r.path===e.path||r.name&&r.name===e.name)}function ei(r,e){return r==null||e==null?!1:!!(r.path&&e.path&&e.path.startsWith(r.path)||r.name&&r.name==e.name)}function Re(r,e){return typeof r=="function"?Reflect.apply(r,{},[e]):r}let ti=w.defineComponent({name:"RouterLink",inheritAttrs:!1,props:{tag:{type:[String,Object,Function],required:!1,default:"a"},to:{type:[String,Object,Function],required:!0},root:{type:String},activeClass:{type:[String,Function],required:!1,default:"fox-router-link-active"},exact:{type:[String,Boolean,Function],required:!1},exactActiveClass:{type:[String,Function],required:!1,default:"fox-router-link-exact-active"},event:{type:[String,Function],required:!1,default:"onClick"}},setup(r,e){const t=w.inject(ke,null);return()=>{let n=Re(r.to,null),i=Re(r.tag,n);if(i==null){console.warn("can not resolve link tag");return}let s=null,o=null;t!==null&&(s=t[I](n),r.root&&(s.root=r.root),o=t.current);let a={},l=Re(r.activeClass,s);if(typeof l=="string"&&l.length>0&&(a[l]=ei(s,o)),Re(r.exact,s)===!0){let h=Re(r.exactActiveClass,s);typeof h=="string"&&h.length>0&&(a[h]=Zn(s,o))}let f={class:a};(i==="a"||i==="A")&&(f.href=s?.path??s?.name??"#"),j(!0,f,e.attrs);let c=Re(r.event,s);if(typeof c=="string"){const h=d=>{if(t==null){console.warn("router is not been injected");return}if(s==null){console.warn("route is not been resolved");return}Yn(d)&&t.to(s)};f[c]=h}return w.h(i,f,e.slots)}}});var M=(r=>(r[r.Loading=0]="Loading",r[r.Loaded=1]="Loaded",r[r.Defining=2]="Defining",r[r.Defined=3]="Defined",r))(M||{}),st=(r=>(r[r.normal=0]="normal",r[r.factory=1]="factory",r))(st||{});class ri{register=new Map;constructor(){}get(e){return this.register.get(e)??null}set(e,t){this.register.set(e,t)}remove(e){let t=this.register.get(e);return this.register.delete(e),t??null}has(e){return this.register.has(e)}clear(){this.register.clear()}}class Ir{moduleManager=new ri;options={paths:{},alias:{},nature:[],timeout:3e3};set paths(e){this.options.paths=e}get paths(){return this.options.paths}set alias(e){this.options.alias=e}get alias(){return this.options.alias}set naturePaths(e){this.options.nature=e}get naturePaths(){return this.options.nature}set timeout(e){this.options.timeout=e}get timeout(){return this.options.timeout}_query;set query(e){this._query=e}get query(){return this._query}get head(){return Je().head}constructor(){}setModule(e,t){const n={id:e,src:"",status:M.Defined};typeof t=="function"?(n.exports=t,n.type=st.factory):n.exports=t,this.moduleManager.set(e,n)}removeModule(e){this.moduleManager.remove(e)}ensure(...e){const t=[];let n=e.length-1;const i={};typeof e[n]=="object"&&(Object.assign(i,e[n]),n--);let s=null;typeof e[n]=="function"&&(s=e[n],n--);for(let l=0;l<=n;l++)if(Array.isArray(e[l])){let u=e[l];for(let f=0;f<u.length;f++)u[f]&&t.push(this.resolvePath(u[f]))}else if(typeof e[l]=="string"){let u=e[l].split(",");for(let f=0;f<u.length;f++)u[f]&&t.push(this.resolvePath(u[f]))}const o=new ni(t.length,(l,u)=>{if(o.isOK())try{typeof s=="function"&&Reflect.apply(s,{},u)}catch(f){console.error(f.message,f)}else try{console.error(l),typeof s=="function"&&Reflect.apply(s,{},[])}catch(f){console.error(f.message,f)}}),a=new Ae;for(let l=0;l<t.length;l++){const u=new ii(l,t[l],i,o);this.mount(a,u)}return this}remove(...e){let t=[],n=e.length-1,i={};typeof e[n]=="object"&&(Object.assign(i,e[n]),n--);let s=null;typeof e[n]=="function"&&(s=e[n],n--);for(let o=0;o<=n;o++)if(Array.isArray(e[o])){let a=e[o];for(let l=0;l<a.length;l++)a[l]&&t.push(this.resolvePath(a[l]))}else{let a=e[o].split(",");for(let l=0;l<a.length;l++)a[l]&&t.push(this.resolvePath(a[l]))}return t.forEach(o=>{this.unmount(o,i)}),typeof s=="function"&&Reflect.apply(s,{},[]),this}mount(e,t){if(t.src==="exports"){e.post(i=>{t.progress.work(!0,t.index,"exports"),i.resolve()});return}else if(t.src==="module"){e.post(i=>{t.progress.work(!0,t.index,"module"),i.resolve()});return}if(this.isNaturePath(t.src)){let i=t.params.jsPoint;i||(i=this.head),this.mountJS(e,t,i);return}else if(this.isNaturePath(t.src)){let i=t.params.cssPoint;i||(i=this.head),this.mountCSS(e,t,i);return}let n=this.getFileNamePostfix(t.src);if(n==="js"||n.length===0){let i=t.params.jsPoint;i||(i=this.head),this.mountJS(e,t,i);return}else if(n==="css"){let i=t.params.cssPoint;i||(i=this.head),this.mountCSS(e,t,i);return}}mountCSS(e,t,n){e.post(i=>{const s=t.src,o=this.moduleManager.get(s);if(o&&(o.status==M.Defined||o.status==M.Loaded)&&o.exports){o.type===st.factory&&typeof o.exports=="function"?t.progress.work(!0,t.index,o.exports()):t.progress.work(!0,t.index,o.exports),i.resolve();return}const a=Je(),l=a.createElement("link");if(Reflect.has(l,"onload"))l.onload=()=>{l.onload=null,l.onerror=null,t.progress.work(!0,t.index,t.src),i.resolve()},l.onerror=()=>{try{n.removeChild(l)}catch(c){console.error(c.message,c)}l.onload=null,l.onerror=null,t.progress.work(!1,t.index,null),i.reject()};else{const c={timeout:this.options.timeout??3e3,time:0,success:()=>{t.progress.work(!0,t.index,t.src),i.resolve()},error:()=>{try{n.removeChild(l)}catch(h){console.error(h.message,h)}t.progress.work(!1,t.index,null),i.resolve()}};setTimeout(()=>{Nr(l,c)},1)}let f=a.getElementById(s);f&&f.parentNode&&f.parentNode.removeChild(f),l.rel="stylesheet",l.type="text/css",l.id=s,l.href=s,n.appendChild(l)})}mountJS(e,t,n){e.post(i=>{const s=t.src;let o=this.moduleManager.get(s);if(o&&(o.status==M.Defined||o.status==M.Loaded)){if(o.exports){o.type===st.factory&&typeof o.exports=="function"?t.progress.work(!0,t.index,o.exports()):t.progress.work(!0,t.index,o.exports),i.resolve();return}if(document.querySelector(`script[src='${s}`)){t.progress.work(!0,t.index,o.exports),i.resolve();return}}o={id:s,src:s,status:M.Loading},this.moduleManager.set(s,o);const l=Je().createElement("script");if("onload"in l)l.onload=()=>{l.onload=null,l.onerror=null,o.status==M.Loading&&(o.status=M.Loaded,t.progress.work(!0,t.index,s)),i.resolve()},l.onerror=()=>{try{n.removeChild(l)}catch(c){console.error(c.message,c)}l.onload=null,l.onerror=null,this.moduleManager.remove(s),t.progress.work(!1,t.index,null),i.resolve()};else{const c=l;c.onreadystatechange=()=>{/loaded|complete/.test(c.readyState)&&(c.onreadystatechange=null,o.status==M.Loading&&(o.status=M.Loaded,t.progress.work(!0,t.index,s)),i.resolve())}}l.defer=!0,l.src=s;const f=L();f.define=this.createDefine(o,t),n.appendChild(l)})}unmount(e,t={}){const n=Je(),i=this.getFileNamePostfix(e);if(i==="js"||i.length===0){const s=n.querySelector(`script[src="${e}"]`);s&&s.parentNode&&s.parentNode.removeChild(s),this.moduleManager.remove(e);return}else if(i==="css"){const s=n.querySelector(`style[href="${e}"]`);s&&s.parentNode&&s.parentNode.removeChild(s);return}}trimEmptyElement(e){let t=[];for(let n=0;n<e.length;n++){if(e[n]===void 0||e[n]===null)continue;const i=e[n].trim();i.length!==0&&t.push(i)}return t}createDefine(e,t){const n=this,i=function(...s){e.status=M.Defining;let o,a,l,u=s.length;u===1?(l=s[0],o=void 0):u===2?(l=s[1],Array.isArray(s[0])?(a=n.trimEmptyElement(s[0]),o=void 0):a=void 0):(o=s[0],a=n.trimEmptyElement(s[1]),l=s[2]),o&&(e.id=o,n.options.alias[o]=e.src),a&&a.length>0?n.ensure(a,(...f)=>{const c=f.map(h=>h==="exports"?((!e.exports||typeof e.exports!="object")&&(e.exports={}),e.exports):h==="module"?e:h);if(typeof l=="function"){const h=Reflect.apply(l,e,c);h&&typeof h=="object"&&(e.exports=h)}else e.exports=l;e.status=M.Defined,t.progress.work(!0,t.index,e.exports)}):(typeof l=="function"?e.exports=Reflect.apply(l,e,[]):e.exports=l,e.status=M.Defined,t.progress.work(!0,t.index,e.exports))};return i.amd=!0,i}resolvePath(e){try{if(e==="exports"||e==="module"||this.isNaturePath(e))return e;e=this.parserPath(e,!0);let t=this.getFileNamePostfix(e);t=t.toLowerCase();let n=this.createSearch(this.query);return e.indexOf("?")==-1?(t!=="js"&&t!=="css"&&(e+=".js"),n.length>0&&(e+=`?${n}`)):n.length>0&&(e+=`&${n}`),e}catch(t){throw console.error(`resolve path[${e}] fail`,t),t}}createSearch(e){let t="";if(e){for(let n in e){let i=`${e[n]}`;t+=`${encodeURIComponent(n)}=${encodeURIComponent(i)}&`}t.length>0&&(t=t.substring(0,t.length-1))}return t}getFileNamePostfix(e){let t=e.lastIndexOf("?");t==-1&&(t=e.length);let n=e.lastIndexOf(".",t);return n==-1?"":e.substring(n+1,t)}isNaturePath(e){if(!this.options.nature)return!1;if(typeof this.options.nature=="function")return this.options.nature(e);const t=this.options.nature;if(t&&Array.isArray(t))for(let n=0;n<t.length;n++){const i=t[n];if(e.indexOf(i)===0)return!0}return!1}parserPath(e,t){if(e.indexOf("http://")==0||e.indexOf("https://")==0||e.indexOf("file:///")==0)return e;if(e.indexOf("/")==0)return`${At()}${e.slice(1)}`;if(e.indexOf("./")==0)return`${At()}${e.slice(2)}`;if(e.indexOf("//")==0)return`${L().location.protocol}${e}`;if(t){let i=this.options.alias[e];if(!i){let s=e.indexOf("/");if(s==-1)i=e;else{let o=e.slice(0,s),a=this.options.paths[o];a?i=a+e.slice(s):i=e}}return this.parserPath(i,!1)}return`${At()}${e}`}}function Nr(r,e){let t=r.sheet,n=!1;if(e.isOldWebKit)t&&(n=!0);else if(t)try{t.cssRules&&(n=!0)}catch(i){i.name==="NS_ERROR_DOM_SECURITY_ERR"&&(n=!0)}setTimeout(()=>{e.time+=20,n?e.success():e.timeout>e.timeout?e.error():Nr(r,e)},20)}class ni{callback;values;status;size;lastIndex;constructor(e,t){this.size=e,this.callback=t,this.status=!0,this.values=[],this.lastIndex=-1}work(e,t,n){if(this.status=e,this.status===!0&&(this.lastIndex!==t&&this.size--,this.lastIndex=t,this.values.push(n)),this.size===0||this.status===!1)try{Reflect.apply(this.callback,this,[this.status,this.values])}catch(i){console.error(i.message,i)}}isOK(){return this.status}}class ii{index;src;params;progress;constructor(e,t,n,i){this.index=e,this.src=t,this.params=n,this.progress=i}}const Jt=Symbol("fk"),Gt=Symbol("fbk"),Qt=Symbol("fepk");function si(r={}){const e=new Kn(r),t=new yt,n=new vt,i=new Ir,s={get router(){return e},get bus(){return t},get Bus(){return yt},get EventProxy(){return vt},get eventproxy(){return n},get EventChain(){return Ae},get Require(){return Ir},get require(){return i},get extend(){return j},get clone(){return Se},get isESModule(){return lt},install(o){o.provide(ke,e),o.provide(Jt,s),o.provide(Gt,t),o.provide(Qt,n),o.component(qn,zt),o.component(On,ti),Reflect.defineProperty(o.config.globalProperties,"$fox",{get(){return s}}),Reflect.defineProperty(o.config.globalProperties,"$router",{get(){return e}}),Reflect.defineProperty(o.config.globalProperties,"$bus",{get(){return t}}),Reflect.defineProperty(o.config.globalProperties,"$bus",{get(){return t}}),Reflect.defineProperty(o.config.globalProperties,"$eventProxy",{get(){return n}}),o.config.globalProperties.$fox_on=function(a,l,u=!1){n.on(a,l,u)},o.config.globalProperties.$fox_off=function(a,l){n.off(a,l)},o.config.globalProperties.$fox_once=function(a,l){n.once(a,l)},o.config.globalProperties.$fox_all=function(...a){let l=n;Reflect.apply(l.all,l,a)},o.config.globalProperties.$fox_trigger=function(a,...l){let u=n;Reflect.apply(u.trigger,u,[a,...l])},o.config.globalProperties.$fox_emit=function(a,...l){let u=n;Reflect.apply(u.trigger,u,[a,...l])},o.mixin({computed:{$route(){return Rt(this)}}}),e.init()}};return s}function Xt(r){return r?r.$router:w.inject(ke)}function oi(r){return r||(r=w.getCurrentInstance()?.proxy??void 0),r?Rt(r):null}function li(r){return r?r.$fox:w.inject(Jt)}function ai(r){return r?r.$bus:w.inject(Gt)}function ui(r){return r?r.$eventProxy:w.inject(Qt)}function fi(r){const e=Xt(),t=(n,i,s)=>{try{Reflect.apply(r,{},[n,i])}catch(o){console.error(o)}s()};e.beforeEach(t),w.onUnmounted(()=>{e.removeBeforeEach(t)})}function ci(r){const e=Xt(),t=(n,i,s)=>{try{Reflect.apply(r,{},[n,i])}catch(o){console.error(o)}s()};e.afterEach(t),w.onUnmounted(()=>{e.removeAfterEach(t)})}const di="";v.Bus=yt,v.EventChain=Ae,v.EventProxy=vt,v.Route=q,v.clone=Se,v.createFox=si,v.createMemoryHistory=Sr,v.createWebHashHistory=xr,v.createWebHistory=Tn,v.deleteContextValue=un,v.extend=j,v.foxBusKey=Gt,v.foxEventProxyKey=Qt,v.foxKey=Jt,v.injectContextValue=gt,v.isArray=Hr,v.isDate=Br,v.isESModule=lt,v.isEqual=ct,v.isFunction=S,v.isMap=Dr,v.isObject=er,v.isPlainObject=ot,v.isPromise=Wr,v.isSet=Vr,v.isString=Ur,v.isSymbol=kr,v.onAfterRouteUpdate=ci,v.onBeforeRouteUpdate=fi,v.onFoxActivated=yn,v.onFoxInactivated=mn,v.provideContextValue=an,v.sessionKey=ie,v.toBoolean=ut,v.toNumber=Qr,v.toTypeString=He,v.typeOf=ft,v.useBus=ai,v.useEventProxy=ui,v.useFox=li,v.useRoute=oi,v.useRouter=Xt,Object.defineProperty(v,Symbol.toStringTag,{value:"Module"})});
2
+ * fox v3.0.0 Mon May 08 2023 09:56:51 GMT+0800 (中国标准时间)
3
+ */const Hr=Array.isArray,Dr=r=>He(r)==="[object Map]",Vr=r=>He(r)==="[object Set]",Br=r=>r instanceof Date,S=r=>typeof r=="function",Ur=r=>typeof r=="string",kr=r=>typeof r=="symbol",er=r=>r!==null&&typeof r=="object",Wr=r=>er(r)&&S(r.then)&&S(r.catch),zr=Object.prototype.toString,He=r=>zr.call(r),ot=r=>He(r)==="[object Object]",Jr=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol";function lt(r){return r.__esModule||Jr&&r[Symbol.toStringTag]==="Module"}const Gr=typeof Promise<"u"&&Promise.toString().indexOf("[native code]")!==-1;function j(...r){let e=r[0]!==void 0&&r[0]!==null?r[0]:{},t=1,n=r.length,i=!1;for(typeof e=="boolean"&&(i=e,e=r[t]??{},t++),typeof e!="object"&&(e={});t<n;t++)if(r[t]!==null&&r[t]!==void 0){let s=r[t];for(let o in s){let a=e[o],l=s[o];if(a!==l)if(i===!0&&l&&typeof l=="object"){let u;Array.isArray(l)?u=a&&Array.isArray(a)?a:[]:u=a&&typeof a=="object"?a:{},e[o]=j(i,u,l)}else l!==void 0&&(e[o]=l)}}return e}function Se(r,e,t=!1){if(!t)j(!0,r,e);else{if(typeof e!="object")return{};typeof r!="object"&&(r={});for(let i in e){let s=r[i],o=e[i];if(s!==o)if(typeof o=="object"){if(!Array.isArray(o)&&!ot(o))continue;s=Se(s,o,t),r[i]=s}else{if(typeof o=="function")continue;r[i]=o}}const n=Object.getOwnPropertySymbols(e);for(let i of n){let s=r[i],o=e[i];if(s!==o)if(typeof o=="object"){if(!Array.isArray(o)&&!ot(o))continue;s=Se(s,o,t),r[i]=s}else{if(typeof o=="function")continue;r[i]=o}}}return r}class ne{static seed=new Date().getTime();static get(){let e=++ne.seed;return e>=Number.MAX_VALUE&&(ne.seed=0),e}}const at=Gr?Promise.resolve():null;function Pe(r,...e){at!==null?e&&e.length>0?at.then(()=>{r(e)}):at.then(r):e&&e.length>0?setTimeout(()=>{r(e)}):setTimeout(r)}function ut(r){return r==null?!1:typeof r=="boolean"?r:typeof r=="string"?r.toLocaleLowerCase()==="true":!!r}function Qr(r){return typeof r=="number"?r:Number(r)}const Xr={"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object Array]":"array","[object Date]":"date","[object RegExp]":"regExp","[object Object]":"object"};function ft(r){let t=Object.prototype.toString.call(r);return r==null?String(r):Xr[t]||"object"}function ct(r,e){if(r==e)return!0;if(r===void 0||e===void 0)return!1;let t=ft(r),n=ft(e);if(t!==n)return!1;if(t==="object"){let i=Object.keys(r),s=Object.keys(e);if(i.length!==s.length)return!1;for(let o=0;o<i.length;o++){let a=i[o],l=r[a],u=e[a];if(!ct(l,u))return!1}return!0}else if(t==="array"){if(r.length!==e.length)return!1;for(let i=0;i<r.length;i++){let s=r[i],o=e[i];if(!ct(s,o))return!1}return!0}return!1}const tr=Symbol("idKey"),ae=Symbol("valueKey"),P=Symbol("childrenKey"),z=Symbol("growKey");class rr{[z]=!0;[tr];[ae]=w.ref();[P]=new Map;constructor(e){this[tr]=e}}class Yr{get(e,t){if(t=="value")return e[ae].value;if(t==="grow")return e[z];let n=e[P].get(t);if(n)return Ce(n);if(e[z])return n=dt(t),n[z]=e[z],e[P].set(t,n),Ce(n)}set(e,t,n){return t=="value"?(e[ae].value=n,!0):t==="grow"?(e[z]=ut(n),!0):n==null?(e[P].delete(t),!0):(console.error(`illegal property:${t}`),!1)}deleteProperty(e,t){return t==="value"||t=="grow"?(console.error(`can not delete property:${String(t)}`),!1):(e[P].delete(t),!0)}}const ht="__proxy__";function dt(r){let e=new rr(r);return Reflect.set(e,ht,new Proxy(e,new Yr)),e}function Ce(r){return Reflect.get(r,ht)}class nr extends rr{constructor(){super("__root__")}put(...e){let t=e.length;if(t<2)return console.error("参数至少包括一个(key, value)"),!1;let n=this;for(let i=0;i<t-1;i++){let s=e[i],o;n[P].has(s)?o=n[P].get(s):(o=dt(s),n[P].set(s,o)),n=o}return n[ae].value=e[t-1],!0}get(...e){let t=e.length;if(t===0)return;let n=this;for(let i=0;i<t;i++){let s=e[i];if(n[P].has(s))n=n[P].get(s);else return}return n[ae].value}remove(...e){let t=e.length;if(t==0)return!1;let n=this;for(let s=0;s<t-1;s++){let o=e[s];if(n[P].has(o))n=n[P].get(o);else return!1}let i=e[t-1];return n[P].has(i)?(n[P].delete(i),!0):!1}contains(...e){let t=e.length;if(t==0)return!1;let n=this;for(let s=0;s<t-1;s++){let o=e[s];if(n[P].has(o))n=n[P].get(o);else return!1}let i=e[t-1];return n[P].has(i)}clear(){this[P].clear()}}const Zr=["put","get","contains","remove","clear"];function ir(r){return Zr.includes(r)}class en{get(e,t){if(t=="value")return e[ae].value;if(t==="grow")return e[z];if(t===P)return e[P];if(typeof t=="string"&&ir(t))return e[t];let n=String(t),i=e[P].get(n);if(i)return Ce(i);if(e[z])return i=dt(n),i[z]=e[z],e[P].set(n,i),Ce(i)}set(e,t,n){return t=="value"?(e[ae].value=n,!0):t==="grow"?(e[z]=ut(n),!0):ir(t)?!1:n==null?(e[P].delete(t),!0):(console.error(`illegal property:${t}`),!1)}deleteProperty(e,t){return t==="value"||t=="grow"?(console.error(`can not delete property:${String(t)}`),!1):(e[P].delete(t),!0)}}function tn(){let r=new nr,e=new en,t=new Proxy(r,e);return Object.assign({put(...i){return Reflect.apply(r.put,r,i)},get(...i){return Reflect.apply(r.get,r,i)},remove(...i){return Reflect.apply(r.remove,r,i)},contains(...i){return Reflect.apply(r.contains,r,i)},clear(){return Reflect.apply(r.clear,r,[])}},t),Reflect.set(r,ht,t),r}const yt=new Proxy(nr,{construct(r,...e){const t=tn();return Ce(t)}}),Y="default",sr=Symbol("sync"),I=Symbol("resolveRoute");function or(r){let e=!1;return function(...t){if(!e)return e=!0,Reflect.apply(r,{},t)}}function rn(r){let e=r.src;return new Promise((t,n)=>{const i=or(a=>{lt(a)&&(a=a.default),r.component=a,console.debug("success load async module"),t()}),s=or(a=>{console.debug("reject load async module"),n(a)});let o;try{o=e(i,s)}catch(a){s(a)}if(o)if(typeof o.then=="function")o.then(i,s);else{const a=o.component;a&&typeof a.then=="function"&&a.then(i,s)}})}class nn{name;level;rootName;rootIndex=0;constructor(e,t,n,i){this.name=e,this.level=t,this.rootName=n,this.rootIndex=i}}class De{to;routeModel;from;data={};constructor(e,t){this.to=e,this.from=t}static from(e){let t=new De(e.to,e.from),n=e.data??{};return j(!0,t.data,n),t}}class q{path;get fullPath(){const e=this.path??`/${this.name}`;return`${this.root??Y}!${e}`}alias;name;root;params;query;matched;meta;success;error;destroy;opsType;updateType;viewTagAttrs;index;active;slot;session;static clone(e,t){let n=new q;return Se(n,e,t),n}static isSame(e,t){return e===t?!0:!(e==null||t==null||e.path&&e.path!==t.path||e.name&&e.name!==t.name||e.root!==t.root||e.index!==t.index)}static isSameForRouteModel(e,t){return e===t?!0:!(e==null||t==null||e.path&&e.path!=t.path||e.name&&e.name!=t.name)}static from(e){let t=new q;if(e==null)return t;let n=t;for(let s in e){let o=e[s];n[s]=o}const i=Object.getOwnPropertySymbols(e);if(Array.isArray(i)&&i.length>0)for(let s of i)n[s]=e[s];return t}}class sn{id;name;props;meta;src;component;constructor(e,t,n,i){this.id=ne.get(),this.name=e,this.src=t,typeof t!="function"&&(this.component=t),this.props=n,this.meta=i}get isResolved(){return this.component!==void 0}resolve(){return rn(this)}}class lr{models=[]}class mt{path;match;redirect;name;layers=[]}const B=Symbol("chainKey"),N=Symbol("cursorKey"),pt=Symbol("$persistentModeKey"),$=Symbol("statusKey"),Z=Symbol("argsKey"),Ve=Symbol("exArgsKey"),de=Symbol("successFnsKey"),Ee=Symbol("errorFnsKey"),ie=Symbol("sessionKey"),ee=Symbol("_go");class Ae{[B]=[];[N]=0;[pt]=!1;[$]="Free";[Z]=[];[Ve]=[];[de]=[];[Ee]=[];[ie];get session(){return this[ie]}constructor(e,t=!1){this[ie]=e,this[pt]=t}[ee](e,...t){let n=this[$];if(this[$]="Busy",this[N]+=e,this[N]<0&&(this[N]=0),this[Z]=t,n==="Exception"||n==="Reject"){let a=[{session:this[ie]},...this[Ve]];for(;this[Ee].length>0;)try{let l=this[Ee].shift();typeof l=="function"&&Pe(()=>{Reflect.apply(l,{},a)})}catch(l){console.error(l.message,l)}return this[$]=n,this[B]=[],this[N]=0,this}else if(n==="Finished"||this[N]>=this[B].length){let a=[{session:this[ie]},...this[Z]];for(;this[de].length>0;){let l=this[de].shift();typeof l=="function"&&Pe(()=>{Reflect.apply(l,{},a)})}return this[$]="Free",this}if(this[N]>=this[B].length)return this[$]="Free",this;let i=this[B][this[N]];this[pt]||(this[B].splice(0,this[N]+1),this[N]=-1);let s=this[N]+1;try{let o=!1,a={go:(l,...u)=>{o||(o=!0,Reflect.apply(this[ee],this,[l,...u]))},resolve:(...l)=>{o||(o=!0,Reflect.apply(this[ee],this,[1,...l]))},reject:(...l)=>{o||(o=!0,Reflect.apply(this.reject,this,[...l]))},insert:l=>{o||(this[B].splice(s,0,l),s++)},session:this[ie]};Pe(()=>{Reflect.apply(i,{},[a,...this[Z]])})}catch(o){this.throw(o)}return this}go(e,...t){return Reflect.apply(this[ee],this,[e,...t])}finish(...e){return this[$]="Finished",this[Z]=e,Reflect.apply(this[ee],this,[0])}reject(...e){return this[$]="Reject",this[Ve]=e,Reflect.apply(this[ee],this,[0])}throw(...e){return this[$]="Exception",this[Ve]=e,Reflect.apply(this[ee],this,[0])}reset(...e){this[$]="Busy",this[Z]=e,this[B]=[],this[N]=0;let n=[{session:this[ie]},...this[Z]];for(;this[de].length>0;){let i=this[de].shift();Pe(()=>{Reflect.apply(i,this,n)})}return this[$]="Free",this}post(e){return this[$]==="Reject"||this[$]==="Exception"?this:(Array.isArray(e)?this[B]=[...this[B],...e]:this[B].push(e),this[$]==="Busy"?this:(Reflect.apply(this[ee],this,[0,...this[Z]]),this))}wait(e,t){return e&&typeof e=="function"&&this[de].push(e),t&&typeof t=="function"&&this[Ee].push(t),this[$]==="Busy"?this:(Reflect.apply(this[ee],this,[0,...this[Z]]),this)}exception(e){return e&&typeof e=="function"&&this[Ee].push(e),this[$]==="Busy"?this:Reflect.apply(this[ee],this,[0,...this[Z]])}isFinish(){return this[$]=="Reject"||this[$]=="Free"&&this[N]>=this[B].length}}const ye=Symbol("registerKey");class on{policy;callback;constructor(e,t){this.callback=e,this.policy=t}}class vt{[ye]=new Map;constructor(){}on(e,t,n=!1){let i=this[ye].get(e);i||(i=new Array,this[ye].set(e,i));let s=n===!0?1:0,o=new on(t,s);return i.push(o),this}off(e,t){if(!t)return this[ye].delete(e),this;let n=this[ye].get(e);if(n){for(let i=0;i<n.length;i++)if(n[i].callback===t){n.splice(i,1);break}}return this}bind(e,t,n=!1){return this.on(e,t,n)}unbind(e,t){return this.off(e,t)}once(e,t){return this.on(e,t,!0)}all(...e){let t=e.length;if(t<1)return this;let n=e[t-1];if(typeof n!="function")return console.error("callback can not benn empty"),this;let i=t-1,s=new Array(i),o=[].splice.call(e,0,i);for(let a=0;a<o.length;a++)this.once(o[a],l=>{s[a]=l,i-=1,i==0&&Reflect.apply(n,{},s)});return this}emit(e,...t){let n=this[ye].get(e);if(!n)return this;for(let i=0;i<n.length;){let s=n[i];if(s.policy==1?n.splice(i,1):i++,typeof s.callback=="function")try{Pe(()=>{Reflect.apply(s.callback,{},t)})}catch(o){console.error(o.message,o)}}return this}trigger(e,...t){return Reflect.apply(this.emit,this,[e,...t])}}const Fe=Symbol("registerKey");class ln{[Fe]=new Map;constructor(){}set(e,t){this[Fe].set(e,t)}get(e){return this[Fe].get(e)}has(e){return this[Fe].has(e)}delete(e){return this[Fe].delete(e)}}const ue=Symbol("lc");function Be(r,e=!1){let t=r;if(Reflect.has(t,ue))return t[ue];if(e){const n=new ln;return t[ue]=n,n}return null}function ar(r,e=!1){let t=null,n=r;for(;n&&!(Reflect.has(n,ue)&&(t=n[ue],t));)n=n.$parent;if(!t&&e){const i=r;i&&i.$parent&&(t=Be(i.$parent,e))}return t}function gt(r,e){let t=r;for(;t;){if(Reflect.has(t,ue)){const n=t[ue];if(n.has(e))return n.get(e)}t=t.$parent}return null}function an(r,e,t){ar(r,!0)?.set(e,t)}function un(r,e){ar(r,!0)?.delete(e)}function ur(r){if(Array.isArray(r.children)&&r.children.length>0){let e=r.children[0];if(e!=null&&e.component!=null&&e.component.proxy!=null)return Be(e.component.proxy,!1)}return null}const Ue=Symbol("hooksKey");function fn(r){let e=r.get(Ue);e||(e=[],r.set(Ue,e))}function fr(r,e){let t=r.get(Ue);if(t!=null)for(let n=t.length-1;n>=0;n--){let i=t[n];if(i.type===e)try{Reflect.apply(i.hook,i.target,[])}catch(s){console.error(s.message,s)}}}var wt=(r=>(r.DEACTIVATED="da",r.ACTIVATED="a",r))(wt||{});class cn{type;hook;target;constructor(e,t,n){this.target=n,this.hook=t,this.type=e}}function hn(r,e,t,n){let i=new cn(e,t,n);return r.push(i),!0}function dn(r,e,t,n){let i=-1;for(let s=0;s<r.length;s++){let o=r[s];if(o.type===e&&o.hook===t&&o.target===n){i=s;break}}return i!=-1?(r.splice(i,1),!0):!1}function cr(r){return(e,t)=>{let n;if(t)n=t;else{const s=w.getCurrentInstance();if(s==null||s.proxy==null){console.error("can not get current instance or proxy");return}n=s.proxy}const i=gt(n,Ue);if(i==null){console.warn("can not get hooks context");return}w.onUnmounted(()=>{dn(i,r,e,n)}),hn(i,r,e,n)}}let yn=cr("a"),mn=cr("da");const bt=Symbol("routeKey");function hr(r,e){r.set(bt,e)}function Rt(r){let e=gt(r,bt);return typeof e=="function"?e():e??null}const ke=Symbol("rk"),xt=Symbol("vd"),dr=Symbol("rv"),St=Symbol("rvi"),yr=Symbol("pv"),Pt=Symbol("pvi");function pn(r){for(var e=[],t=0;t<r.length;){var n=r[t];if(n==="*"||n==="+"||n==="?"){e.push({type:"MODIFIER",index:t,value:r[t++]});continue}if(n==="\\"){e.push({type:"ESCAPED_CHAR",index:t++,value:r[t++]});continue}if(n==="{"){e.push({type:"OPEN",index:t,value:r[t++]});continue}if(n==="}"){e.push({type:"CLOSE",index:t,value:r[t++]});continue}if(n===":"){for(var i="",s=t+1;s<r.length;){var o=r.charCodeAt(s);if(o>=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122||o===95){i+=r[s++];continue}break}if(!i)throw new TypeError("Missing parameter name at ".concat(t));e.push({type:"NAME",index:t,value:i}),t=s;continue}if(n==="("){var a=1,l="",s=t+1;if(r[s]==="?")throw new TypeError('Pattern cannot start with "?" at '.concat(s));for(;s<r.length;){if(r[s]==="\\"){l+=r[s++]+r[s++];continue}if(r[s]===")"){if(a--,a===0){s++;break}}else if(r[s]==="("&&(a++,r[s+1]!=="?"))throw new TypeError("Capturing groups are not allowed at ".concat(s));l+=r[s++]}if(a)throw new TypeError("Unbalanced pattern at ".concat(t));if(!l)throw new TypeError("Missing pattern at ".concat(t));e.push({type:"PATTERN",index:t,value:l}),t=s;continue}e.push({type:"CHAR",index:t,value:r[t++]})}return e.push({type:"END",index:t,value:""}),e}function mr(r,e){e===void 0&&(e={});for(var t=pn(r),n=e.prefixes,i=n===void 0?"./":n,s="[^".concat(me(e.delimiter||"/#?"),"]+?"),o=[],a=0,l=0,u="",f=function(F){if(l<t.length&&t[l].type===F)return t[l++].value},c=function(F){var C=f(F);if(C!==void 0)return C;var E=t[l],Q=E.type,D=E.index;throw new TypeError("Unexpected ".concat(Q," at ").concat(D,", expected ").concat(F))},h=function(){for(var F="",C;C=f("CHAR")||f("ESCAPED_CHAR");)F+=C;return F};l<t.length;){var d=f("CHAR"),p=f("NAME"),m=f("PATTERN");if(p||m){var y=d||"";i.indexOf(y)===-1&&(u+=y,y=""),u&&(o.push(u),u=""),o.push({name:p||a++,prefix:y,suffix:"",pattern:m||s,modifier:f("MODIFIER")||""});continue}var g=d||f("ESCAPED_CHAR");if(g){u+=g;continue}u&&(o.push(u),u="");var b=f("OPEN");if(b){var y=h(),_=f("NAME")||"",x=f("PATTERN")||"",K=h();c("CLOSE"),o.push({name:_||(x?a++:""),pattern:_&&!x?s:x,prefix:y,suffix:K,modifier:f("MODIFIER")||""});continue}c("END")}return o}function vn(r,e){return gn(mr(r,e),e)}function gn(r,e){e===void 0&&(e={});var t=Ct(e),n=e.encode,i=n===void 0?function(l){return l}:n,s=e.validate,o=s===void 0?!0:s,a=r.map(function(l){if(typeof l=="object")return new RegExp("^(?:".concat(l.pattern,")$"),t)});return function(l){for(var u="",f=0;f<r.length;f++){var c=r[f];if(typeof c=="string"){u+=c;continue}var h=l?l[c.name]:void 0,d=c.modifier==="?"||c.modifier==="*",p=c.modifier==="*"||c.modifier==="+";if(Array.isArray(h)){if(!p)throw new TypeError('Expected "'.concat(c.name,'" to not repeat, but got an array'));if(h.length===0){if(d)continue;throw new TypeError('Expected "'.concat(c.name,'" to not be empty'))}for(var m=0;m<h.length;m++){var y=i(h[m],c);if(o&&!a[f].test(y))throw new TypeError('Expected all "'.concat(c.name,'" to match "').concat(c.pattern,'", but got "').concat(y,'"'));u+=c.prefix+y+c.suffix}continue}if(typeof h=="string"||typeof h=="number"){var y=i(String(h),c);if(o&&!a[f].test(y))throw new TypeError('Expected "'.concat(c.name,'" to match "').concat(c.pattern,'", but got "').concat(y,'"'));u+=c.prefix+y+c.suffix;continue}if(!d){var g=p?"an array":"a string";throw new TypeError('Expected "'.concat(c.name,'" to be ').concat(g))}}return u}}function wn(r,e){var t=[],n=pr(r,t,e);return bn(n,t,e)}function bn(r,e,t){t===void 0&&(t={});var n=t.decode,i=n===void 0?function(s){return s}:n;return function(s){var o=r.exec(s);if(!o)return!1;for(var a=o[0],l=o.index,u=Object.create(null),f=function(h){if(o[h]===void 0)return"continue";var d=e[h-1];d.modifier==="*"||d.modifier==="+"?u[d.name]=o[h].split(d.prefix+d.suffix).map(function(p){return i(p,d)}):u[d.name]=i(o[h],d)},c=1;c<o.length;c++)f(c);return{path:a,index:l,params:u}}}function me(r){return r.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function Ct(r){return r&&r.sensitive?"":"i"}function Rn(r,e){if(!e)return r;for(var t=/\((?:\?<(.*?)>)?(?!\?)/g,n=0,i=t.exec(r.source);i;)e.push({name:i[1]||n++,prefix:"",suffix:"",modifier:"",pattern:""}),i=t.exec(r.source);return r}function xn(r,e,t){var n=r.map(function(i){return pr(i,e,t).source});return new RegExp("(?:".concat(n.join("|"),")"),Ct(t))}function Sn(r,e,t){return Pn(mr(r,t),e,t)}function Pn(r,e,t){t===void 0&&(t={});for(var n=t.strict,i=n===void 0?!1:n,s=t.start,o=s===void 0?!0:s,a=t.end,l=a===void 0?!0:a,u=t.encode,f=u===void 0?function(D){return D}:u,c=t.delimiter,h=c===void 0?"/#?":c,d=t.endsWith,p=d===void 0?"":d,m="[".concat(me(p),"]|$"),y="[".concat(me(h),"]"),g=o?"^":"",b=0,_=r;b<_.length;b++){var x=_[b];if(typeof x=="string")g+=me(f(x));else{var K=me(f(x.prefix)),F=me(f(x.suffix));if(x.pattern)if(e&&e.push(x),K||F)if(x.modifier==="+"||x.modifier==="*"){var C=x.modifier==="*"?"?":"";g+="(?:".concat(K,"((?:").concat(x.pattern,")(?:").concat(F).concat(K,"(?:").concat(x.pattern,"))*)").concat(F,")").concat(C)}else g+="(?:".concat(K,"(").concat(x.pattern,")").concat(F,")").concat(x.modifier);else x.modifier==="+"||x.modifier==="*"?g+="((?:".concat(x.pattern,")").concat(x.modifier,")"):g+="(".concat(x.pattern,")").concat(x.modifier);else g+="(?:".concat(K).concat(F,")").concat(x.modifier)}}if(l)i||(g+="".concat(y,"?")),g+=t.endsWith?"(?=".concat(m,")"):"$";else{var E=r[r.length-1],Q=typeof E=="string"?y.indexOf(E[E.length-1])>-1:E===void 0;i||(g+="(?:".concat(y,"(?=").concat(m,"))?")),Q||(g+="(?=".concat(y,"|").concat(m,")"))}return new RegExp(g,Ct(t))}function pr(r,e,t){return r instanceof RegExp?Rn(r,e):Array.isArray(r)?xn(r,e,t):Sn(r,e,t)}var T=(r=>(r[r.Push=0]="Push",r[r.Replace=1]="Replace",r[r.Put=2]="Put",r[r.Append=3]="Append",r[r.Open=4]="Open",r))(T||{}),We=(r=>(r[r.Part=0]="Part",r[r.All=1]="All",r))(We||{});const J=Symbol("rootKey"),G=Symbol("rootNodeKey"),fe=Symbol("parentNodeKey"),ze=Symbol("nameKey");class se{instance=null;model;route;active=!0;index=0;constructor(e,t,n=0,i=!0){this.route=e,this.model=t,this.index=n,this.active=i}}class Te{_slots;get slots(){return this._slots==null&&(this._slots=w.shallowRef([])),this._slots}get empty(){return this._slots==null||this._slots.value.length==0}[ze];[J];[G]=null;[fe]=null;get name(){return this[ze]}constructor(e,t,n){this[ze]=e,this[J]=t,n&&(this[G]=n)}}class U{view;index;level;constructor(e,t,n){this.view=e,this.index=t,this.level=n}static include(e,t){for(let n=0;n<e.length;n++){let i=e[n];if(i.view===t.view&&(t.index==-1||i.index===t.index)&&i.level===t.level)return!0}return!1}}class Et{views=[]}class Cn{layers=[]}class En{time;route}class An{forbidTime=300;submitRecorder=new En;isSameRoute(e,t){return e==null||t==null?!1:e.name===t.name&&e.path===t.path&&e.root===t.root}acquire(e){let t=new Date().getTime();if(this.isSameRoute(e,this.submitRecorder.route)&&this.submitRecorder.time&&t-this.submitRecorder.time<=this.forbidTime){this.submitRecorder.time=t;return}return this.submitRecorder.route=e,this.submitRecorder.time=t,t}release(e){this.submitRecorder.time===e&&(this.submitRecorder.route=void 0)}}const pe=Symbol("_notifyChange");class vr{currentRoute;routes;constructor(e,t){this.currentRoute=e,this.routes=t}}const je=typeof window<"u",L=function(){return window},Je=function(){return window.document};function Fn(r){let e=r,t=e.lastIndexOf("/");return t>0&&t<e.length-1?e=e.substring(0,t+1):t===0&&e.indexOf(".")!==-1?e="/":t===-1&&(e.indexOf(".")==-1?e=`/${e}/`:e="/"),e.indexOf("/")!==0&&(e=`/${e}`),e}function At(){if(!je)return"/";let r=L().location,e=`${r.protocol}//${r.host}`;return e+=Fn(r.pathname),e}function Ft(r,e,t){r.addEventListener?r.addEventListener(e,t,!1):r.attachEvent?r.attachEvent(`on${e}`,t):r[`on${e}`]=t}function Tt(r,e,t){r.removeEventListener?r.removeEventListener(e,t):r.detachEvent?r.detachEvent(`on${e}`,t):r[`on${e}`]=null}const Ge=Symbol("ignoreHistoryChangeOnceKey"),gr=Symbol("_navigateFirstRoute"),Qe=Symbol("_getRouteMark"),jt=Symbol("_getUrlSearch"),$t=Symbol("_generateLocation"),$e=Symbol("_setRouteMarkRecorder"),_e=Symbol("beforeRestoreFiltersKey"),wr=Symbol("_beforeRestore"),br="Symbol(_fox_restore_point)";function _t(r,...e){return typeof r=="function"?Reflect.apply(r,null,[...e]):r}class Rr{base;storage;mode;query;firstNavigate=!0;historyMonitor;traceless=!1;changeHandler;historyChange;[Ge]=!1;[_e]=new Array;constructor(e="hash",t="",n="",i=!0,s=!0,o=!1,a){this.mode=e,this.base=t,this.query=n,this.firstNavigate=i,this.historyMonitor=s,this.traceless=o,this.storage=a??L().sessionStorage}init(e=!0){const t=L();return typeof this.historyChange!="function"&&(this.historyChange=()=>{if(this[Ge]){this[Ge]=!1;return}if(_t(this.historyMonitor)){const n=t.history.state;this[pe](n);try{let i=[];if(typeof n=="string"?i=JSON.parse(n):i=n,Array.isArray(i)&&i.length>0){const s=this[Qe]()??"/";this[$e](s,i)}}catch{}}}),Ft(t,"popstate",this.historyChange),this.firstNavigate&&e&&this[gr](),Promise.resolve()}destroy(){if(this.historyChange){const e=L();Tt(e,"popstate",this.historyChange)}}[wr](e,t,n,i){for(let s of this[_e])try{const o=[],a=Reflect.apply(s,{},[e,t,n,i]);if(a===!1)return a}catch(o){console.error(o.message,o)}return!0}beforeRestoreEach(e){this[_e].push(e)}removeBeforeRestoreEach(e){const t=this[_e].indexOf(e);return t!==-1?(this[_e].splice(t,1),!0):!1}[gr](){const e=this[Qe]()??"/",t=this.storage.getItem(br);if(t)try{const o=JSON.parse(t);if(o.mark===e&&Array.isArray(o.routes)&&o.routes.length>0){const a=o.routes.filter((l,u)=>this[wr](l,u,e,o.routes));if(a.length>0){const l=this[jt](),u=a.length-1;a[u].query=l||a[u].query,this[pe](a);return}}}catch{}const n=e.indexOf("!");let i;n!=-1?i=e.substring(n+1):i=e;const s=new q;s.path=i,s.query=this[jt](),this[pe]([s])}[$e](e,t){try{const i=JSON.stringify({mark:e,routes:t});this.storage.setItem(br,i)}catch(n){console.error(n.message,n)}}setRestorePoint(e){const t=this[Qe]()??"/";this[$e](t,e)}[pe](e){typeof this.changeHandler=="function"&&this.changeHandler(e)}[Qe](){const e=L();if(this.mode==="path"){let t=e.location.pathname;return this.base&&t.indexOf(this.base)===0&&(t=t.substring(this.base.length)),t}else{const t=e.location.hash,n=t.indexOf("#");if(n!=-1)return t.substring(n+1)}return null}[jt](){let t=L().location.search;return t.length>0&&t.indexOf("?")===0&&(t=t.substring(1)),t}listen(e){this.changeHandler=e}go(e,t=!0){const n=L();this[Ge]=!t,n.history.go(e)}push(e){const t=this[$t](e.currentRoute);_t(this.traceless,e.currentRoute)||L().history.pushState(e.routes,"",t);const n=e.currentRoute.fullPath;this[$e](n,e.routes)}replace(e){const t=this[$t](e.currentRoute);_t(this.traceless,e.currentRoute)||L().history.replaceState(e.routes,"",t);const n=e.currentRoute.fullPath;this[$e](n,e.routes)}[$t](e){const t=L();let n="";if(e.query){let a="";if(typeof e.query=="object")for(let l of Reflect.ownKeys(e.query)){let u=encodeURIComponent(e.query[l]),f=`${encodeURIComponent(String(l))}=${u}`;a.length>0&&(a+="&"),a+=f}else a=e.query;this.query?(n=a.length>0?`${this.query}&${a}`:this.query,n.length>0&&n.charAt(0)!=="?"&&(n=`?${n}`)):a.length>0&&(n=`?${a}`)}const i=t.location;let s=e.alias??e.fullPath;s.startsWith(Y)&&(s=s.substring(Y.length+1));let o;return n?this.mode=="path"?s.indexOf("/")===0?o=`${this.base}${s}${n}`:o=`${this.base}/${s}${n}`:o=`${i.pathname}${n}#${s}`:this.mode=="path"?s.indexOf("/")===0?o=`${this.base}${s}`:o=`${this.base}/${s}`:o=`${i.pathname}#${s}`,`${i.origin}${o}`}}function Tn(r=!0,e=null,t="",n=!0,i=!1,s){return e!==null&&(e=L().location.pathname),e&&e.endsWith("/")&&(e=e.substring(0,e.length-1)),new Rr("path",e??"",t,r,n,i,s)}function xr(r=!0,e="",t=!0,n=!1,i){return new Rr("hash","",e,r,t,n,i)}class jn{maxSize=50;cursor=-1;queue=[];changeHandler;base;historyMonitor=!1;traceless=!1;constructor(e,t=50){this.base=e,this.maxSize=t}init(e=!0){return Promise.resolve()}destroy(){this.queue=[]}beforeRestoreEach(e){}removeBeforeRestoreEach(e){return!1}listen(e){this.changeHandler=e}[pe](e){typeof this.changeHandler=="function"&&this.changeHandler(e)}go(e,t=!0){if(this.queue.length==0||this.cursor<=0||this.cursor>=this.queue.length-1)return;let n=this.cursor+e;if(n<0?n=0:n>this.queue.length-1&&(n=this.queue.length-1),n!=this.cursor&&(this.cursor=n,t)){const i=this.queue[n];this[pe](i.routes)}}push(e){this.queue.length>=this.maxSize&&this.queue.splice(0,1),this.queue.push(e),this.cursor=this.queue.length-1}replace(e){let t=this.queue.length-this.cursor;this.queue.splice(this.cursor,t),this.queue[this.cursor]=e}setRestorePoint(e){}}function Sr(r="",e=50){return new jn(r,e)}function hi(r){}const Xe=Symbol("_constructRouteModel"),Ye=Symbol("_findRouteModel"),Kt=Symbol("_findRootView"),Pr=Symbol("_getFirstView"),ce=Symbol("_removeView"),Cr=Symbol("_buildPage"),Er=Symbol("_resolveComponent"),Ar=Symbol("_update"),oe=Symbol("_merge"),qt=Symbol("_handleHistoryChange"),Ze=Symbol("_handleRouteUpdated"),et=Symbol("routeUpdatedCallback"),R=Symbol("currentRoutes"),ve=Symbol("current"),Fr=Symbol("_addRouteRecorder"),Ke=Symbol("_removeRouteRecorder"),tt=Symbol("_cloneRouteRecorder"),O=Symbol("_handleError"),rt=Symbol("errorCallback"),k=Symbol("registerKey"),nt=Symbol("notFoundKey"),Ot=Symbol("notFoundPathKey"),W=Symbol("forestKey"),A=Symbol("historyKey"),qe=Symbol("beforeFiltersKey"),Oe=Symbol("afterFiltersKey"),Le=Symbol("destroyFiltersKey"),ge=Symbol("mainDispatcherKey"),Lt=Symbol("initKey"),he=Symbol("readyKey"),Mt=Symbol("readyHandlersKey"),it=Symbol("_markReady"),Tr=Symbol("_createNextFn"),It=Symbol("_start"),Nt=Symbol("_before"),Ht=Symbol("_after"),jr=Symbol("_destroy"),Dt=Symbol("_load"),Me=Symbol("_unload"),Ie=Symbol("routerGuardKey");function $n(r){return r.layers.length==0||r.layers[0].views.length==0}function _n(r){let e=[];return r.layers.forEach(t=>{t.models==null||t.models==null||t.models.forEach(n=>{if(!(n==null||n==null))if(typeof n.meta=="object"){let i=j(!0,{},n.meta);e.push(i)}else n.meta&&e.push(n.meta)})}),e}class Kn{[k]=new Array;[nt];[Ot]="*";[he]=!1;[Mt]=[];[W]=new Cn;[A];[R]=new Array;[rt]=null;[et]=null;[qe]=new Array;[Oe]=new Array;[Le]=new Array;[ge]=new Ae;[Ie]=new An;[Lt]=!1;[ve]=w.ref(null);get current(){return this[ve].value}options;constructor(e){this.options=e??{},this.options.notFoundPath&&this.setNotFoundPath(this.options.notFoundPath);let t=this.options.routes||[];this.addRoutes(t),this.options.notFound&&this.setNotFoundRoute(this.options.notFound),e.history?this[A]=e.history:this[A]=je?xr():Sr(),this[A]?.listen(async n=>{let i=!0;try{if(typeof n=="string"){const s=this[I](n);s&&await this[qt]([s])}else await this[qt](n)}catch(s){console.error(s.message,s),i=!1}this[he]===!1&&this[it](i)})}[O](e="error",t){if(t&&typeof t.error=="function")try{t.error(e)}catch{}if(typeof this[rt]=="function")try{this[rt](e,t)}catch{}console.error(e)}init(){this[Lt]!==!0&&(this[A]?.init(!this[he]),this[Lt]=!0)}isReady(){return this[he]?Promise.resolve():new Promise((e,t)=>{this[Mt].push([e,t])})}[it](e){this[he]=!0,this[Mt].forEach(([t,n])=>{try{e?t():n()}catch(i){console.error(i.message,i)}})}[qt](e){try{if(!e){let o=[...this[R]].reverse();return this[Me](o),je&&L().location.reload(),Promise.resolve()}let t=null,n=[],i=[],s=0;for(;s<e.length&&s<this[R].length&&q.isSame(e[s],this[R][s]);s++)e[s].active===!0&&e[s].active!==this[R][s].active&&(t=e[s]);if(s<e.length&&(n=e.slice(s)),s<this[R].length&&(i=this[R].slice(s).reverse()),i.length===0&&n.length===0){if(t!==null)return this.restore([t])}else if(i.length>0){if(this[Me](i)){if(n.length>0)return this.restore(n);if(t!==null)return this.restore([t])}}else return this.restore(n)}catch(t){this[O](t)}return Promise.resolve()}[Ze](e){if(e)this[ve].value=e;else{let t=this[R].length;t>0?this[ve].value=this[R][t-1]:this[ve].value=null}if(typeof this[et]=="function")try{this[et](this[ve].value)}catch{}}[Fr](e){if(e.opsType===T.Open){let t=!1;const n=this[R].length-1;for(let i=n;i>=0;i--){const s=this[R][i];if(e.root==s.root){if(e.path===s.path){this[R].splice(i,1,e),t=!0;continue}e.active&&(s.active=!1)}}t||this[R].push(e)}else this[R].push(e)}[tt](){let e=[];for(let t of this[R]){let n=q.clone(t,!0);e.push(n)}return e}[Ke](e){if(!this[R])return;let t=-1;for(let n=0;n<this[R].length;n++)if(q.isSame(this[R][n],e)){t=n;break}if(t!=-1){let n=this[R][t];this[R].splice(t,1),this[jr](n,n.session)}}set historyMonitor(e){this[A]&&(this[A].historyMonitor=e)}get historyMonitor(){return this[A]?this[A].historyMonitor:!1}set traceless(e){this[A]&&(this[A].traceless=e)}get traceless(){return this[A]?this[A].traceless:!1}setRestorePoint(){const e=this[tt]();this[A]?.setRestorePoint(e)}onRouteUpdated(e){this[et]=e}onError(e){this[rt]=e}beforeEach(e){this[qe].push(e)}removeBeforeEach(e){const t=this[qe].indexOf(e);return t!==-1?(this[qe].splice(t,1),!0):!1}afterEach(e){this[Oe].push(e)}removeAfterEach(e){const t=this[Oe].indexOf(e);return t!==-1?(this[Oe].splice(t,1),!0):!1}destroyEach(e){this[Le].push(e)}removeDestroyEach(e){const t=this[Le].indexOf(e);return t!==-1?(this[Le].splice(t,1),!0):!1}beforeRestoreEach(e){this[A]?.beforeRestoreEach(e)}removeBeforeRestoreEach(e){return this[A]?.removeBeforeRestoreEach(e)??!1}addRoutes(e){for(let t of e)this.addRoute(t)}addRoute(e,t=-1){if(e.path===this[Ot]){this.setNotFoundRoute(e);return}const n=this[Xe](e);if(t==-1)this[k]=[...this[k],...n];else for(let i=n.length-1;i>=0;i--)this[k].splice(t,0,n[i])}removeRoute(e){const t=this[I](e);if(t===null)return console.warn("route格式错误",e),!1;for(let n=0;n<this[k].length;n++){const i=this[k][n];if(t?.path&&i.path===t.path)return this[k].splice(n,1),!0;if(t?.name&&i.name===t.name)return this[k].splice(n,1),!0}return!1}hasRoute(e){const t=this[I](e);return t===null?(console.warn("route格式错误",e),!1):this[k].findIndex(i=>{if(t?.path&&i.path===t.path||t?.name&&i.name===t.name)return!0})!==-1}setNotFoundPath(e){this[Ot]=e}setNotFoundRoute(e){const t=this[Xe](e);this[nt]=t[0]}getRoutes(){return[...this[k]]}[Xe](e){let t=e.path??"";t.length>0&&t.charAt(0)!=="/"&&(t=`/${t}`);let n=e.components??(e.component&&{"":e.component});if(n==null){const a=new mt;return a.path=t,a.redirect=e.redirect,[a]}let i=[];for(let a in n){let l=n[a];a.length===0&&(a=Y);let u=new sn(a,l,e.props,e.meta);i.push(u)}let s=!1,o=[];if(e.children)for(let a of e.children){let l=this[Xe](a);for(let u of l){let f=new mt;f.name=u.name,u.path&&u.path.length>0?t!=="/"?f.path=`${t}${u.path}`:f.path=u.path:(s=!0,f.path=t);let c=new lr;c.models=[...i],f.layers=[c,...u.layers],o.push(f)}}if(!s){const a=new lr;a.models=i;const l=new mt;l.name=e.name,l.path=t,l.layers=[a],o.splice(0,0,l)}return o}[Ye](e){const t=e.route;try{for(let n of this[k])if(t.path&&n.path){let i=n.match;i||(i=n.match=wn(n.path));let s=i(t.path);if(!s)continue;if(n.redirect){let o=new q;j(!0,o,t),o.path=n.redirect;let a={route:o,find:void 0};return this[Ye](a)?(e.route=a.route,e.find=a.find,!0):!1}if(t.params=t.params??{},j(!0,t.params,s.params),t.query){let o=t.query;if(typeof o=="string"){let a={},l=o.split("&");for(let u of l){let f=u.split("=");if(f.length!==2)continue;let c=decodeURIComponent(f[0].trim()),h=decodeURIComponent(f[1].trim());a[c]=h}j(!0,t.params,a)}else typeof o=="object"&&j(!0,t.params,o)}return e.find=n,!0}else if(t.name===n.name){t.params=t.params??{};let i=vn(n.path);return t.path=i(t.params),e.find=n,!0}}catch(n){console.error(n.message,n),typeof t.error=="function"&&t.error(n.message)}return!1}[I](e){let t=null;if(Array.isArray(e))if(t=new q,typeof e[0]=="object")t=q.from(e[0]);else for(let n=0;n<e.length;n++)n===0?e[n].charAt(0)==="/"?t.path=e[n]:t.name=e[n]:n===1?t.params=e[n]:n===2?t.root=e[n]:n===3&&j(!1,t,e[n]);else typeof e=="object"?t=q.from(e):typeof e=="string"&&(t=new q,e.charAt(0)=="/"?t.path=e:t.name=e);if(t){if(t.path){let n=t.path.indexOf("?");n!==-1&&n<t.path.length-1&&(t.query=t.path.substring(n+1),t.path=t.path.substring(0,n))}t.root=t.root??Y,t.opsType=t.opsType??this.options.defaultOperationType??T.Push}return t}push(...e){let t=this[I](e);return t?(t.opsType=t.opsType||T.Push,this.to(t)):(this[O]("resolve route fail",t),this)}put(...e){let t=this[I](e);return t?(t.opsType=T.Put,this.to(t)):(this[O]("resolve route fail",t),this)}replace(...e){let t=this[I](e);return t?(t.opsType=T.Replace,this.to(t)):(this[O]("resolve route fail",t),this)}append(...e){let t=this[I](e);return t?(t.opsType=T.Append,this.to(t)):(this[O]("resolve route fail",t),this)}remove(e){return new Promise(t=>{this[ge].post(n=>{try{if(this[R].length===0){n.resolve(),t(!1);return}let i=-1,s,o=[];if(e){if(e.root?s=e.root:s=this[R][0].root??Y,e.all)for(let l=this[R].length-1;l>0;l--){let u=this[R][l];u.opsType===T.Append&&u.root===s&&(o.splice(0,0,u),i=l-1)}else if(e.until)for(let l=this[R].length-1;l>0;l--){let u=this[R][l];if(u.opsType===T.Append&&u.root===s){if(e.until.charAt(0)==="/"&&e.until===u.path){i=l;break}else if(e.until===u.name){i=l;break}o.splice(0,0,u)}}}else{s=Y;let l=this[Pr](this[W]);l&&(s=l.name);for(let u=this[R].length-1;u>0;u--){let f=this[R][u];if(f.opsType===T.Append&&f.root===s){o.push(f),i=u-1;break}}}if(o.length===0){let l="can not find route";console.warn(l),n.resolve(l),t(!1);return}let a=0;if(this[R].forEach(l=>{l.opsType!==T.Put&&a++}),this[Me](o)){let l=0;this[R].forEach(f=>{f.opsType!==T.Put&&l++});const u=l-a;this[A]?.go(u,!1),n.resolve(),t(!0)}}catch(i){this[O](i),n.resolve(),t(!1)}})})}open(...e){let t=this[I](e);return t?(t.opsType=T.Open,this.to(t)):(this[O]("resolve route fail",t),this)}close(e){return this[ge].post(t=>{try{let n=this[I](e);if(!n){t.reject("resolve route fail");return}let i=[];for(let s=0;s<this[R].length;s++){let o=this[R][s];if(o.root===n.root){if(!n.path&&!n.name){i.push(o);continue}if(n.path&&n.path===o.path){i.push(o);break}else if(n.name&&n.name===o.name){i.push(o);break}}}if(i.length===0){t.resolve();return}this[Me](i)&&this[Ze](),t.resolve()}catch(n){this[O](n),t.resolve()}}),this}to(...e){let t=this[I](e);if(!t)return this[O]("resolve route fail",t),this;let n=this[Ie].acquire(t);return n==null?(this[O]("route forbid",t),this):(this[ge].post(i=>{try{let s=this[It](t);this[Nt](s),this[Dt](s),this[Ht](s),s.wait((o,a)=>{const l=o.session.to;try{let u=q.clone(l,!0);const f=new vr(u,this[tt]());l.opsType===T.Replace?this[A]?.replace(f):this[A]?.push(f)}catch(u){console.error(u.message,u)}if(this[Ie].release(n),this[Ze](l),typeof t.success=="function")try{Reflect.apply(t.success,{},[])}catch(u){console.error(u.message,u)}this[he]===!1&&this[it](!0),i.resolve()},(o,a)=>{this[Ie].release(n),a!==null&&this[O](a,t),this[he]===!1&&this[it](!1),i.resolve()})}catch(s){this[Ie].release(n),this[O](s,t),i.resolve()}}),this)}back(e=1){this[A]?.go(-e)}[Tr](e){return(t,n)=>{if(typeof t=="boolean")e.session.redirect=!1,t?e.resolve():e.reject(n??null);else if(t){const i=this[I](t);if(i){const s=e.session.to;i.success=s.success,i.error=s.error,e.session.to=i,e.session.redirect=!0,e.session.routeModel=null,e.resolve()}else e.session.redirect=!1,e.reject("route resolve fail")}else e.session.redirect=!1,e.resolve()}}[It](e){let t=this[R].length>0?this[R][0]:void 0,n=new De(e,t),i={route:e,find:null};return this[Ye](i),i.find&&(n.routeModel=i.find,e.matched=_n(i.find),Array.isArray(e.matched)&&e.matched.length>0&&(e.meta=i.find.layers[0].models[0].meta)),new Ae(n)}[Nt](e){for(let t of this[qe])e.post(n=>{let i=this[Tr](n);Reflect.apply(t,{},[n.session.to,n.session.from,i,n.session])})}[Ht](e){e.post(t=>{for(let n of this[Oe])try{Reflect.apply(n,{},[t.session.to,t.session.from,t.session])}catch(i){console.error(i.message,i)}t.resolve()})}[jr](e,t){for(let n of this[Le])try{Reflect.apply(n,{},[e,t])}catch(i){console.error(i.message,i)}typeof e.destroy=="function"&&Reflect.apply(e.destroy,e,[])}[Dt](e){e.post(t=>{let n=t.session.to,i=t.session.routeModel;if(i==null){let o={route:n,find:null};if(this[Ye](o))i=o.find,t.session.routeModel=i;else if(this[nt])i=this[nt];else{t.reject(`not find route model, path:${n.path??n.name}`);return}}let s=De.from(t.session);this[Cr](n,i,s).then(o=>{this[W],t.resolve()},o=>{t.reject(o)})})}[Me](e){if(e.length==0)return!0;let t=this[W],n=[];for(let i of e){let s=this[Kt](t,i);s!=null&&n.push({...s,route:i})}if(n.length==0){let i="can not find view index";return this[O](i),!1}for(let i of n.reverse())this[ce](t,{x:i.x,y:i.y},[i.route.index??0],!0);return!0}[Kt](e,t){const n=t.root??Y;let i;for(let s=0;s<e.layers.length;s++){const o=e.layers[s];for(let a=o.views.length-1;a>=0;a--){const l=o.views[a];if(l[J]&&l[ze]===n)return i={x:a,y:s},i}}return null}[Pr](e){return e.layers.length>0&&e.layers[0].views.length>0?e.layers[0].views[0]:null}[ce](e,t,n=null,i=!0){if(t.y>=e.layers.length||t.x>=e.layers[t.y].views.length)return;let s=e.layers[t.y].views[t.x],o=!1,a=[],l=!1,u=[...s.slots.value];for(let c=u.length-1;c>=0;c--){let h=u[c];(!n||n.indexOf(h.index)!=-1)&&(h.route&&s[J]&&(this[Ke](h.route),h.active===!0&&h.route.opsType==T.Append&&(l=!0)),a.push(new U(s,h.index,t.y)),u.splice(c,1))}if(u.length==0)i?s.slots.value=u:e.layers[t.y].views.splice(t.x,1);else{if(l){let c=u.length-1,h=u[c];h.active=!0,h.route&&(h.route.active=h.active)}s.slots.value=u}e.layers[t.y].views.length==0&&(o=!0);let f=t.y+1;for(;f<e.layers.length;f++){let c=e.layers[f].views,h=[];for(let d=c.length-1;(o||a.length>0)&&d>=0;d--){let p=c[d];if(p[fe]&&(o||U.include(a,p[fe]))){let m=p.slots.value;for(let y=m.length-1;y>=0;y--){let g=m[y];g.route&&p[J]&&this[Ke](g.route),h.push(new U(p,g.index,f)),m.splice(y,1)}e.layers[f].views.splice(d,1)}}a=h,e.layers[f].views.length==0&&(o=!0)}}restore(e){if(!e||this[k].length==0){let t=this[W];if(t.layers.length>0){let n=t.layers[0].views;n.length>0&&(n[0].slots.value=[])}return this[R]=[],this[Ze](),Promise.resolve()}else return new Promise((n,i)=>{let s=null,o=!1;for(let a=0;a<e.length;a++){const l=e[a];this[ge].post(u=>{const f=this[It](l);this[Nt](f),this[Dt](f),this[Ht](f),f.wait((c,h)=>{s=c.session.to,o=c.session.redirect,u.resolve()},(c,h)=>{s=null,h!==null&&this[O](h),u.resolve()})})}this[ge].post(a=>{if(s&&o===!0){const l=q.clone(s,!0),u=new vr(l,this[tt]());this[A]?.replace(u)}a.resolve(),n()})})}[Cr](e,t,n){let i=e.updateType??We.Part;return this[Er](t).then(()=>{this[Ar](t,e,n,i)})}[Er](e){let t=[];for(let n=0;n<e.layers.length;n++){let i=e.layers[n];for(let s=0;s<i.models.length;s++){let o=i.models[s];o.isResolved||t.push(o.resolve())}}return t.length>0?Promise.all(t):Promise.resolve()}[Ar](e,t,n,i){if(e.layers[0].models.length!==1)return Promise.reject("illegal route structure(multi root node)");const s=e.layers[0].models[0];let o=this[W],a=$n(o),l=t.root??Y,u;!a&&i==We.Part&&(u=this[Kt](o,t));let f,c=0;if(u==null||u==null)if(a||i===We.All){if(o.layers.length==0&&(o.layers[0]=new Et),o.layers[0].views.length==0){let h=t.root??Y;f=new Te(h,!0,null),o.layers[0].views=[f]}else f=o.layers[0].views[0];u={x:0,y:0}}else{let h=t.slot;if(!h)return Promise.reject("can not rebuild view(because not route slot)");let d=h.level;if(d>o.layers.length)return Promise.reject("can not insert view(override level)");let p;if(h.rootName){let m=o.layers[d-1];for(let y of m.views){if(y[J]&&y.name===h.rootName){p=new U(y,h.rootIndex??0,d-1);break}if(y[G]&&y[G].view.name===h.rootName&&y[G].index===h.rootIndex){p=y[G];break}}}if(!p)return Promise.reject("can not insert view(not find root node ref)");f=new Te(l,!0,p),o.layers[d].views.push(f),u={x:o.layers[d].views.length-1,y:d}}else f=o.layers[u.y].views[u.x];if(c=u.y,f[J]=!0,t.opsType===T.Append){t.index=ne.get(),t.active=!0;let h=f.slots.value;if(h.length>0){let g=h[h.length-1];g.active=!1,g.route&&(g.route.active=g.active)}let d=new se(t,s,t.index,!0);f.slots.value=[...h,d];let p=c+1,m=1,y=new U(f,t.index,c);this[oe](o,p,e,m,y)}else if(t.opsType===T.Open){let h=f.slots.value;const d=t.active??!0;let p=!1;for(let m of h){if(m.route!==null&&q.isSameForRouteModel(m.route,t)){if(m.active===d)return t.index=m.index,t.active=d,m.route=t,Promise.resolve();m.active=d,p=!0,t.index=m.index,t.active=d,m.route=t}else d&&(m.active=!1);m.route&&(m.route.active=m.active)}if(!p){t.index=ne.get(),t.active=d;let m=new se(t,s,t.index,d);h.push(m);let y=c+1,g=1,b=new U(f,t.index,c);this[oe](o,y,e,g,b)}f.slots.value=[...h]}else{let h=f.slots.value;if(h.length==0){t.index=ne.get(),t.active=!0,f.slots.value=[new se(t,s,t.index)];let d=c+1,p=1,m=new U(f,t.index,c);this[oe](o,d,e,p,m)}else{let d=h[0];if(d.model!==s){this[ce](o,u,null,!0),t.index=ne.get(),t.active=!0,f.slots.value=[new se(t,s,t.index)];let p=c+1,m=1,y=new U(f,t.index,c);this[oe](o,p,e,m,y)}else{d.route!==null&&this[Ke](d.route);let p=!1;const m=t.active??!0;d.active!==m&&(d.active=m,p=!0),t.active=m,t.index=d.index,d.route=t;let y=[];for(let K=1;K<h.length;K++)y.push(h[K].index);y.length>0?this[ce](o,u,y,!0):p&&(f.slots.value=[...h]);let g=[new U(f,t.index,c)],b=c+1,_=1,x=new U(f,t.index,c);for(;g.length>0&&b<o.layers.length&&_<e.layers.length;b++,_++){let K=[];for(let C=0;C<o.layers[b].views.length;C++){let E=o.layers[b].views[C];E[fe]&&U.include(g,E[fe])&&K.unshift(C)}let F=[];for(let C of K){let E=o.layers[b].views[C],Q=e.layers[_].models,D;for(let V=0;V<Q.length;V++)if(E.name===Q[V].name){D=Q[V];break}if(!D)this[ce](o,{x:C,y:b},null,!1);else{let V=E.slots.value;if(V.length==0){let te=0;E.slots.value=[new se(null,D,te)];let X=b+1,re=_+1;this[oe](o,X,e,re,x)}else{let te=V[0];if(te.model!==D){this[ce](o,{x:C,y:b},null,!0),E.slots.value=[new se(null,D,0)];let X=b+1,re=_+1;this[oe](o,X,e,re,x)}else{E[J]&&te.route!==null&&this[Ke](te.route);let X=[];for(let re=1;re<V.length;re++)X.push(V[re].index);X.length>0&&this[ce](o,{x:C,y:b},X,!0),F.push(new U(E,te.index,b))}}E[J]=!1}}g=F}this[oe](o,b,e,_,x)}}}if(f&&f[G]){let h=f[G];h&&(t.slot=new nn(l,c,h?.view.name,h?.index??0))}n.to=void 0,n.routeModel=void 0,t.session=n,this[Fr](t)}[oe](e,t,n,i,s){let o=i,a=t;for(;a<e.layers.length&&o<n.layers.length;a++,o++){let l=e.layers[a].views;for(let u of n.layers[o].models){let f=new Te(u.name,!1,s),c=new se(null,u);f.slots.value=[c],l.push(f)}}for(;o<n.layers.length;o++){let l=new Et;l.views=[];for(let u of n.layers[o].models){let f=new Te(u.name,!1,s),c=new se(null,u);f.slots.value=[c],l.views.push(f)}e.layers.push(l)}}[sr](e,t,n,i,s,o){if(t<0||t>this[W].layers.length)return null;if(t<this[W].layers.length){let f=this[W].layers[t],c=null;for(let h of f.views){let d=!1;if(n!==null?(d=h.name===e&&h[G]?.view===n,d&&i!==-1&&(d=h[G]?.index===i)):d=h.name===e,!!d){s!==null&&(h[fe]={view:s,index:o,level:t-1}),c=h;break}}if(c!==null)return c}let a=null,l=null;s!==null&&(s[J]?a={view:s,index:o,level:t-1}:a=s[G],l={view:s,index:o,level:t-1});let u=new Te(e,!0,a);if(u[fe]=l,t==this[W].layers.length){let f=new Et;f.views=[u],this[W].layers.push(f)}else this[W].layers[t].views.push(u);return u}}const qn="fox-router-view",On="fox-router-link";function $r(r,e=!1){let t=null;return e?t=r.showFromClass??r.enterFromClass:t=r.enterFromClass,t||(t=r.transitionName,t?e?`${t}-show-from`:`${t}-enter-from`:null)}function _r(r,e=!1){let t=null;return e?t=r.showActiveClass??r.enterActiveClass:t=r.enterActiveClass,t||(t=r.transitionName,t?e?`${t}-show-active`:`${t}-enter-active`:null)}function Ln(r,e=!1){let t=null;return e?t=r.showToClass??r.enterToClass:t=r.enterToClass,t||(t=r.transitionName,t?e?`${t}-show-to`:`${t}-enter-to`:null)}function Mn(r,e=!1){let t=null;return e?t=r.hideFromClass??r.leaveFromClass:t=r.leaveFromClass,t||(t=r.transitionName,t?e?`${t}-hide-from`:`${t}-leave-from`:null)}function In(r,e=!1){let t=null;return e?t=r.hideActiveClass??r.leaveActiveClass:t=r.leaveActiveClass,t||(t=r.transitionName,t?e?`${t}-hide-active`:`${t}-leave-active`:null)}function Nn(r,e=!1){let t=null;return e?t=r.hideToClass??r.leaveToClass:t=r.leaveToClass,t||(t=r.transitionName,t?e?`${t}-hide-to`:`${t}-leave-to`:null)}function Hn(r,e=!1){let t=null;return e?t=r.beforeShow??r.beforeEnter:t=r.beforeEnter,t}function Dn(r,e=!1){let t=null;return e?t=r.show??r.enter:t=r.enter,t}function Vn(r,e=!1){let t=null;return e?t=r.afterShow??r.afterEnter:t=r.afterEnter,t}function Bn(r,e=!1){let t=null;return e?t=r.showCancelled??r.enterCancelled:t=r.enterCancelled,t}function Un(r,e=!1){let t=null;return e?t=r.hide??r.leave:t=r.leave,t}function kn(r,e=!1){let t=null;return e?t=r.afterHide??r.afterLeave:t=r.afterLeave,t}function Wn(r,e=!1){let t=null;return e?t=r.hideCancelled??r.leaveCancelled:t=r.leaveCancelled,t}function Vt(r){let e,t=r.duration;return typeof t=="object"?e={enter:t.enter??-1,leave:t.leave??-1,show:t.show??-1,hide:t.hide??-1}:(typeof t=="string"&&(t=t.length==0?-1:Number(t)),e={enter:t,leave:t,show:t,hide:t}),e}function we(r,e){r.classList.contains(e)||r.classList.add(e)}function be(r,e){r.classList.remove(e)}const zn=je&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout;function Bt(r){zn(r)}function H(r,e,t){S(e)&&(r==null&&(r={}),Reflect.apply(e,r,t))}function Kr(r,e,t,n=-1,i,s,o,a){if(S(s)){if(i!==void 0&&i>=0){setTimeout(()=>{Reflect.apply(s,r,[e,t,n]),S(a)&&Reflect.apply(a,r,[])},i);return}const l=["animationend","transitionend"],u=f=>{l.forEach(c=>{Tt(e,c,u)}),Reflect.apply(s,r,[e,t,n]),a&&Reflect.apply(a,r,[])};l.forEach(f=>{Ft(e,f,u)})}if(S(o)){const l="animationcancel",u=f=>{Reflect.apply(o,r,[e,t,n]),Tt(e,l,u)};Ft(e,l,u)}}function Ut(r){return!je||r===null?!1:r.opsType===T.Append||r.opsType===T.Open}function qr(r,e,t,n={},i,s=-1){if(e||Ut(i)){const o=$r(n,e);o&&we(t,o);const a=_r(n,e);a&&we(t,a);const l=Hn(n,e);H(r,l,[t,e,i,s])}}function Or(r,e,t,n={},i,s,o,a){if(!Ut(s)&&!e){S(a)&&a(r,a,[t]);return}const l=$r(n,e),u=_r(n,e),f=Ln(n,e),c=Dn(n,e),h=Vn(n,e),d=Bn(n,e);Bt(()=>{Kr(r,t,s,o,i,()=>{u&&be(t,u),f&&be(t,f),S(h)&&H(r,h,[t,e,s,o]),S(a)&&a(r,a,[t])},()=>{S(d)&&H(r,d,[t,e,s,o])}),l&&be(t,l),f&&we(t,f),S(c)&&H(r,c,[t,e,s,o])})}function Lr(r,e,t,n={},i,s,o,a,l){if(!Ut(o)&&!e){!e&&S(s)&&s();return}const u=Mn(n,e),f=In(n,e),c=Nn(n,e),h=Un(n,e),d=kn(n,e),p=Wn(n,e);u&&we(t,u),f&&we(t,f),S(h)&&H(r,h,[t,e,o,a]),Bt(()=>{Kr(r,t,o,a,i,()=>{f&&be(t,f),c&&be(t,c),S(d)&&H(r,d,[t,e,o,a]),S(l)&&H(r,l,[t]),!e&&S(s)&&s()},()=>{S(p)&&H(r,p,[t,e,o,a]),S(l)&&H(r,l,[t]),!e&&S(s)&&s()}),u&&be(t,u),c&&we(t,c)})}function kt(r,e={},t,n=-1){const i=e.mode??"default",s=Vt(e);return{mode:i,persisted:!1,beforeEnter:a=>{qr(r,!1,a,e,t,n)},enter:a=>{Or(r,!1,a,e,s.enter,t,n)},leave:(a,l)=>{Lr(r,!1,a,e,s.leave,l,t,n)},clone:a=>kt(r,e,t,n)}}function Mr(r){return r.el}function Jn(r,e,t={},n,i,s,o){if(s){const a=Mr(e);if(a==null)return;const l=Vt(t);qr(r,!0,a,t,n,i),Or(r,!0,a,t,l.show,n,i,u=>{S(o)&&H(r,o,[u])})}else S(o)&&H(r,o,[])}function Gn(r,e,t={},n,i,s,o){if(s){const a=Mr(e);if(a==null)return;const l=Vt(t);Lr(r,!0,a,t,l.hide,null,n,i,u=>{S(o)&&H(r,o,[u])})}else S(o)&&H(r,o,[])}function Qn(r,e={}){Bt(()=>{for(let t=0;t<r.length;t++)Reflect.apply(r[t],e,[])})}function le(r,e,t){return typeof r=="function"?Reflect.apply(r,{},[e,t]):r}function Wt(r,e){if(!r)return null;const t=r(e);return t.length===1?t[0]:t}class Xn{node;state;constructor(e,t){this.node=e,this.state=t}}const zt=w.defineComponent({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,required:!1,default:"default"},modelSlot:{type:[Object],required:!1},multi:{type:Boolean,required:!1,default:!1},tag:{type:[String,Object,Function],required:!1,default:"div"},viewTag:{type:[String,Object,Function],required:!1,default:"div"},viewTagProps:{type:[Object,Function],required:!1,default(){return{}}},viewClass:{type:[String,Function],required:!1},viewActiveClass:{type:[String,Function],required:!1},viewInactiveClass:{type:[String,Function],required:!1},transition:{type:[Boolean,String,Function],required:!1,default:!1},transitionName:{type:String,required:!1},enterFromClass:{type:String,required:!1},enterActiveClass:{type:String,required:!1},enterToClass:{type:String,required:!1},leaveFromClass:{type:String,required:!1},leaveActiveClass:{type:String,required:!1},leaveToClass:{type:String,required:!1},showFromClass:{type:String,required:!1},showActiveClass:{type:String,required:!1},showToClass:{type:String,required:!1},hideFromClass:{type:String,required:!1},hideActiveClass:{type:String,required:!1},hideToClass:{type:String,required:!1},beforeEnter:{type:Function,required:!1},enter:{type:Function,required:!1},afterEnter:{type:Function,required:!1},enterCancelled:{type:Function,required:!1},beforeLeave:{type:Function,required:!1},leave:{type:Function,required:!1},afterLeave:{type:Function,required:!1},leaveCancelled:{type:Function,required:!1},beforeShow:{type:Function,required:!1},show:{type:Function,required:!1},afterShow:{type:Function,required:!1},showCancelled:{type:Function,required:!1},beforeHide:{type:Function,required:!1},hide:{type:Function,required:!1},afterHide:{type:Function,required:!1},hideCancelled:{type:Function,required:!1}},setup(r,e){const t=w.getCurrentInstance();if(t===null||t.proxy===null){console.error("instance or instance.proxy not exist");return}const n=r.multi===!0,i=w.inject(ke,null),s=w.inject(xt,0),o=w.inject(dr,null),a=w.inject(St,-1);let l=null;const u=r.modelSlot;if(u){if(w.provide(xt,s+1),w.provide(St,u.index),w.provide(Pt,u.index),!u.route){console.warn("child view render error, route not exist");return}const h=Be(t.proxy,!0);fn(h),hr(h,()=>u.route??null)}else{if(i==null){console.error("router is not been injected");return}const c=r.name,h=w.inject(yr,null),d=w.inject(Pt,0);if(l=i[sr](c,s,o,a,h,d),l===null)return;w.provide(yr,l);const p=l[J]===!0;if(p&&w.provide(dr,l),!n&&(w.provide(St,-1),w.provide(xt,s+1),w.provide(Pt,-1),p)){const m=Be(t.proxy,!0);hr(m,()=>{const y=l.slots.value;return y.length>0?y[0].route:null})}}const f={value:new Map};return w.onUnmounted(()=>{f.value&&f.value.clear()}),()=>{if(n){const c=new Map,h=[],d=l?.slots.value,p=[];for(let g=0;g<d.length;g++){const b=d[g],_=`${r.name}_${b.index}`,x=le(r.transition,b.route,g)??!0,K={modelSlot:b};let F;e.slots.default?F=w.h(zt,K,{default:e.slots.default}):F=w.h(zt,K);const C={},E=le(r.viewClass,b.route,g);typeof E=="string"&&E.length>0&&(C[E]=!0);const Q=le(r.viewActiveClass,b.route,g),D=le(r.viewInactiveClass,b.route,g),V=f.value.get(_);if(typeof Q=="string"&&Q.length>0&&(C[Q]=b.active),typeof D=="string"&&D.length>0&&(C[D]=!b.active),V&&b.active!==V.state){const xe=V.node;b.active?p.unshift(()=>{const Zt=()=>{let Ne=ur(xe);Ne!=null&&fr(Ne,wt.ACTIVATED)};Jn(t,xe,r,b.route,g,x,Zt)}):p.push(()=>{const Zt=()=>{const Ne=ur(xe);Ne!=null&&fr(Ne,wt.DEACTIVATED)};Gn(t,xe,r,b.route,g,x,Zt)})}const te={class:C,key:_},X=le(r.viewTagProps,b.route,g);X!==null&&typeof X=="object"&&j(!0,te,X),b.route?.viewTagAttrs&&typeof b.route?.viewTagAttrs=="object"&&j(!0,te,b.route.viewTagAttrs);const re=le(r.viewTag,b.route,g),Yt=w.h(re,te,{default:()=>[F]});if(c.set(_,new Xn(Yt,b.active)),f.value.delete(_),x){const xe=kt(t,r,b.route,g);Yt.transition=xe}h.push(Yt)}f.value.forEach(g=>{g.node.transition=null}),f.value=c,Qn(p,t);const m=le(r.tag,null,-1),y={};return Object.assign(y,e.attrs),w.h(m,y,{default:()=>h})}else if(u!=null){const c=u.model,h={};c.props&&(typeof c.props=="object"?j(!1,h,c.props):c.props===!0&&typeof u.route?.params=="object"&&j(!1,h,u.route?.params));const d=w.h(c.component,h);return Wt(e.slots.default,{Component:d,route:u.route})??d}else{const c=l.slots.value;if(c.length>0){const h=c[0],d=h.route??(t.proxy&&Rt(t.proxy))??null,p=h.model,m={};p.props&&(typeof p.props=="object"?j(!1,m,p.props):p.props===!0&&typeof d?.params=="object"&&j(!1,m,d?.params));const y=w.h(p.component,m);if(le(r.transition,d,-1)??!0){const b=kt(t,r,d,-1);y.transition=b}return Wt(e.slots.default,{Component:y,route:d})??y}else return Wt(e.slots.fallback,{})}}}});function Yn(r){if(!(r.metaKey||r.altKey||r.ctrlKey||r.shiftKey)&&!r.defaultPrevented&&!(r.button!=null&&r.button!==0)){if(r.currentTarget&&r.currentTarget.getAttribute){const e=r.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return r.preventDefault&&r.preventDefault(),!0}}function Zn(r,e){return r==null||e==null?!1:!!(r===e||r.path&&r.path===e.path||r.name&&r.name===e.name)}function ei(r,e){return r==null||e==null?!1:!!(r.path&&e.path&&e.path.startsWith(r.path)||r.name&&r.name==e.name)}function Re(r,e){return typeof r=="function"?Reflect.apply(r,{},[e]):r}let ti=w.defineComponent({name:"RouterLink",inheritAttrs:!1,props:{tag:{type:[String,Object,Function],required:!1,default:"a"},to:{type:[String,Object,Function],required:!0},root:{type:String},activeClass:{type:[String,Function],required:!1,default:"fox-router-link-active"},exact:{type:[String,Boolean,Function],required:!1},exactActiveClass:{type:[String,Function],required:!1,default:"fox-router-link-exact-active"},event:{type:[String,Function],required:!1,default:"onClick"}},setup(r,e){const t=w.inject(ke,null);return()=>{let n=Re(r.to,null),i=Re(r.tag,n);if(i==null){console.warn("can not resolve link tag");return}let s=null,o=null;t!==null&&(s=t[I](n),r.root&&(s.root=r.root),o=t.current);let a={},l=Re(r.activeClass,s);if(typeof l=="string"&&l.length>0&&(a[l]=ei(s,o)),Re(r.exact,s)===!0){let h=Re(r.exactActiveClass,s);typeof h=="string"&&h.length>0&&(a[h]=Zn(s,o))}let f={class:a};(i==="a"||i==="A")&&(f.href=s?.path??s?.name??"#"),j(!0,f,e.attrs);let c=Re(r.event,s);if(typeof c=="string"){const h=d=>{if(t==null){console.warn("router is not been injected");return}if(s==null){console.warn("route is not been resolved");return}Yn(d)&&t.to(s)};f[c]=h}return w.h(i,f,e.slots)}}});var M=(r=>(r[r.Loading=0]="Loading",r[r.Loaded=1]="Loaded",r[r.Defining=2]="Defining",r[r.Defined=3]="Defined",r))(M||{}),st=(r=>(r[r.normal=0]="normal",r[r.factory=1]="factory",r))(st||{});class ri{register=new Map;constructor(){}get(e){return this.register.get(e)??null}set(e,t){this.register.set(e,t)}remove(e){let t=this.register.get(e);return this.register.delete(e),t??null}has(e){return this.register.has(e)}clear(){this.register.clear()}}class Ir{moduleManager=new ri;options={paths:{},alias:{},nature:[],timeout:3e3};set paths(e){this.options.paths=e}get paths(){return this.options.paths}set alias(e){this.options.alias=e}get alias(){return this.options.alias}set naturePaths(e){this.options.nature=e}get naturePaths(){return this.options.nature}set timeout(e){this.options.timeout=e}get timeout(){return this.options.timeout}_query;set query(e){this._query=e}get query(){return this._query}get head(){return Je().head}constructor(){}setModule(e,t){const n={id:e,src:"",status:M.Defined};typeof t=="function"?(n.exports=t,n.type=st.factory):n.exports=t,this.moduleManager.set(e,n)}removeModule(e){this.moduleManager.remove(e)}ensure(...e){const t=[];let n=e.length-1;const i={};typeof e[n]=="object"&&(Object.assign(i,e[n]),n--);let s=null;typeof e[n]=="function"&&(s=e[n],n--);for(let l=0;l<=n;l++)if(Array.isArray(e[l])){let u=e[l];for(let f=0;f<u.length;f++)u[f]&&t.push(this.resolvePath(u[f]))}else if(typeof e[l]=="string"){let u=e[l].split(",");for(let f=0;f<u.length;f++)u[f]&&t.push(this.resolvePath(u[f]))}const o=new ni(t.length,(l,u)=>{if(o.isOK())try{typeof s=="function"&&Reflect.apply(s,{},u)}catch(f){console.error(f.message,f)}else try{console.error(l),typeof s=="function"&&Reflect.apply(s,{},[])}catch(f){console.error(f.message,f)}}),a=new Ae;for(let l=0;l<t.length;l++){const u=new ii(l,t[l],i,o);this.mount(a,u)}return this}remove(...e){let t=[],n=e.length-1,i={};typeof e[n]=="object"&&(Object.assign(i,e[n]),n--);let s=null;typeof e[n]=="function"&&(s=e[n],n--);for(let o=0;o<=n;o++)if(Array.isArray(e[o])){let a=e[o];for(let l=0;l<a.length;l++)a[l]&&t.push(this.resolvePath(a[l]))}else{let a=e[o].split(",");for(let l=0;l<a.length;l++)a[l]&&t.push(this.resolvePath(a[l]))}return t.forEach(o=>{this.unmount(o,i)}),typeof s=="function"&&Reflect.apply(s,{},[]),this}mount(e,t){if(t.src==="exports"){e.post(i=>{t.progress.work(!0,t.index,"exports"),i.resolve()});return}else if(t.src==="module"){e.post(i=>{t.progress.work(!0,t.index,"module"),i.resolve()});return}if(this.isNaturePath(t.src)){let i=t.params.jsPoint;i||(i=this.head),this.mountJS(e,t,i);return}else if(this.isNaturePath(t.src)){let i=t.params.cssPoint;i||(i=this.head),this.mountCSS(e,t,i);return}let n=this.getFileNamePostfix(t.src);if(n==="js"||n.length===0){let i=t.params.jsPoint;i||(i=this.head),this.mountJS(e,t,i);return}else if(n==="css"){let i=t.params.cssPoint;i||(i=this.head),this.mountCSS(e,t,i);return}}mountCSS(e,t,n){e.post(i=>{const s=t.src,o=this.moduleManager.get(s);if(o&&(o.status==M.Defined||o.status==M.Loaded)&&o.exports){o.type===st.factory&&typeof o.exports=="function"?t.progress.work(!0,t.index,o.exports()):t.progress.work(!0,t.index,o.exports),i.resolve();return}const a=Je(),l=a.createElement("link");if(Reflect.has(l,"onload"))l.onload=()=>{l.onload=null,l.onerror=null,t.progress.work(!0,t.index,t.src),i.resolve()},l.onerror=()=>{try{n.removeChild(l)}catch(c){console.error(c.message,c)}l.onload=null,l.onerror=null,t.progress.work(!1,t.index,null),i.reject()};else{const c={timeout:this.options.timeout??3e3,time:0,success:()=>{t.progress.work(!0,t.index,t.src),i.resolve()},error:()=>{try{n.removeChild(l)}catch(h){console.error(h.message,h)}t.progress.work(!1,t.index,null),i.resolve()}};setTimeout(()=>{Nr(l,c)},1)}let f=a.getElementById(s);f&&f.parentNode&&f.parentNode.removeChild(f),l.rel="stylesheet",l.type="text/css",l.id=s,l.href=s,n.appendChild(l)})}mountJS(e,t,n){e.post(i=>{const s=t.src;let o=this.moduleManager.get(s);if(o&&(o.status==M.Defined||o.status==M.Loaded)){if(o.exports){o.type===st.factory&&typeof o.exports=="function"?t.progress.work(!0,t.index,o.exports()):t.progress.work(!0,t.index,o.exports),i.resolve();return}if(document.querySelector(`script[src='${s}`)){t.progress.work(!0,t.index,o.exports),i.resolve();return}}o={id:s,src:s,status:M.Loading},this.moduleManager.set(s,o);const l=Je().createElement("script");if("onload"in l)l.onload=()=>{l.onload=null,l.onerror=null,o.status==M.Loading&&(o.status=M.Loaded,t.progress.work(!0,t.index,s)),i.resolve()},l.onerror=()=>{try{n.removeChild(l)}catch(c){console.error(c.message,c)}l.onload=null,l.onerror=null,this.moduleManager.remove(s),t.progress.work(!1,t.index,null),i.resolve()};else{const c=l;c.onreadystatechange=()=>{/loaded|complete/.test(c.readyState)&&(c.onreadystatechange=null,o.status==M.Loading&&(o.status=M.Loaded,t.progress.work(!0,t.index,s)),i.resolve())}}l.defer=!0,l.src=s;const f=L();f.define=this.createDefine(o,t),n.appendChild(l)})}unmount(e,t={}){const n=Je(),i=this.getFileNamePostfix(e);if(i==="js"||i.length===0){const s=n.querySelector(`script[src="${e}"]`);s&&s.parentNode&&s.parentNode.removeChild(s),this.moduleManager.remove(e);return}else if(i==="css"){const s=n.querySelector(`style[href="${e}"]`);s&&s.parentNode&&s.parentNode.removeChild(s);return}}trimEmptyElement(e){let t=[];for(let n=0;n<e.length;n++){if(e[n]===void 0||e[n]===null)continue;const i=e[n].trim();i.length!==0&&t.push(i)}return t}createDefine(e,t){const n=this,i=function(...s){e.status=M.Defining;let o,a,l,u=s.length;u===1?(l=s[0],o=void 0):u===2?(l=s[1],Array.isArray(s[0])?(a=n.trimEmptyElement(s[0]),o=void 0):a=void 0):(o=s[0],a=n.trimEmptyElement(s[1]),l=s[2]),o&&(e.id=o,n.options.alias[o]=e.src),a&&a.length>0?n.ensure(a,(...f)=>{const c=f.map(h=>h==="exports"?((!e.exports||typeof e.exports!="object")&&(e.exports={}),e.exports):h==="module"?e:h);if(typeof l=="function"){const h=Reflect.apply(l,e,c);h&&typeof h=="object"&&(e.exports=h)}else e.exports=l;e.status=M.Defined,t.progress.work(!0,t.index,e.exports)}):(typeof l=="function"?e.exports=Reflect.apply(l,e,[]):e.exports=l,e.status=M.Defined,t.progress.work(!0,t.index,e.exports))};return i.amd=!0,i}resolvePath(e){try{if(e==="exports"||e==="module"||this.isNaturePath(e))return e;e=this.parserPath(e,!0);let t=this.getFileNamePostfix(e);t=t.toLowerCase();let n=this.createSearch(this.query);return e.indexOf("?")==-1?(t!=="js"&&t!=="css"&&(e+=".js"),n.length>0&&(e+=`?${n}`)):n.length>0&&(e+=`&${n}`),e}catch(t){throw console.error(`resolve path[${e}] fail`,t),t}}createSearch(e){let t="";if(e){for(let n in e){let i=`${e[n]}`;t+=`${encodeURIComponent(n)}=${encodeURIComponent(i)}&`}t.length>0&&(t=t.substring(0,t.length-1))}return t}getFileNamePostfix(e){let t=e.lastIndexOf("?");t==-1&&(t=e.length);let n=e.lastIndexOf(".",t);return n==-1?"":e.substring(n+1,t)}isNaturePath(e){if(!this.options.nature)return!1;if(typeof this.options.nature=="function")return this.options.nature(e);const t=this.options.nature;if(t&&Array.isArray(t))for(let n=0;n<t.length;n++){const i=t[n];if(e.indexOf(i)===0)return!0}return!1}parserPath(e,t){if(e.indexOf("http://")==0||e.indexOf("https://")==0||e.indexOf("file:///")==0)return e;if(e.indexOf("/")==0)return`${At()}${e.slice(1)}`;if(e.indexOf("./")==0)return`${At()}${e.slice(2)}`;if(e.indexOf("//")==0)return`${L().location.protocol}${e}`;if(t){let i=this.options.alias[e];if(!i){let s=e.indexOf("/");if(s==-1)i=e;else{let o=e.slice(0,s),a=this.options.paths[o];a?i=a+e.slice(s):i=e}}return this.parserPath(i,!1)}return`${At()}${e}`}}function Nr(r,e){let t=r.sheet,n=!1;if(e.isOldWebKit)t&&(n=!0);else if(t)try{t.cssRules&&(n=!0)}catch(i){i.name==="NS_ERROR_DOM_SECURITY_ERR"&&(n=!0)}setTimeout(()=>{e.time+=20,n?e.success():e.timeout>e.timeout?e.error():Nr(r,e)},20)}class ni{callback;values;status;size;lastIndex;constructor(e,t){this.size=e,this.callback=t,this.status=!0,this.values=[],this.lastIndex=-1}work(e,t,n){if(this.status=e,this.status===!0&&(this.lastIndex!==t&&this.size--,this.lastIndex=t,this.values.push(n)),this.size===0||this.status===!1)try{Reflect.apply(this.callback,this,[this.status,this.values])}catch(i){console.error(i.message,i)}}isOK(){return this.status}}class ii{index;src;params;progress;constructor(e,t,n,i){this.index=e,this.src=t,this.params=n,this.progress=i}}const Jt=Symbol("fk"),Gt=Symbol("fbk"),Qt=Symbol("fepk");function si(r={}){const e=new Kn(r),t=new yt,n=new vt,i=new Ir,s={get router(){return e},get bus(){return t},get Bus(){return yt},get EventProxy(){return vt},get eventproxy(){return n},get EventChain(){return Ae},get Require(){return Ir},get require(){return i},get extend(){return j},get clone(){return Se},get isESModule(){return lt},install(o){o.provide(ke,e),o.provide(Jt,s),o.provide(Gt,t),o.provide(Qt,n),o.component(qn,zt),o.component(On,ti),Reflect.defineProperty(o.config.globalProperties,"$fox",{get(){return s}}),Reflect.defineProperty(o.config.globalProperties,"$router",{get(){return e}}),Reflect.defineProperty(o.config.globalProperties,"$bus",{get(){return t}}),Reflect.defineProperty(o.config.globalProperties,"$bus",{get(){return t}}),Reflect.defineProperty(o.config.globalProperties,"$eventProxy",{get(){return n}}),o.config.globalProperties.$fox_on=function(a,l,u=!1){n.on(a,l,u)},o.config.globalProperties.$fox_off=function(a,l){n.off(a,l)},o.config.globalProperties.$fox_once=function(a,l){n.once(a,l)},o.config.globalProperties.$fox_all=function(...a){let l=n;Reflect.apply(l.all,l,a)},o.config.globalProperties.$fox_trigger=function(a,...l){let u=n;Reflect.apply(u.trigger,u,[a,...l])},o.config.globalProperties.$fox_emit=function(a,...l){let u=n;Reflect.apply(u.trigger,u,[a,...l])},o.mixin({computed:{$route(){return Rt(this)}}}),e.init()}};return s}function Xt(r){return r?r.$router:w.inject(ke)}function oi(r){return r||(r=w.getCurrentInstance()?.proxy??void 0),r?Rt(r):null}function li(r){return r?r.$fox:w.inject(Jt)}function ai(r){return r?r.$bus:w.inject(Gt)}function ui(r){return r?r.$eventProxy:w.inject(Qt)}function fi(r){const e=Xt(),t=(n,i,s)=>{try{Reflect.apply(r,{},[n,i])}catch(o){console.error(o)}s()};e.beforeEach(t),w.onUnmounted(()=>{e.removeBeforeEach(t)})}function ci(r){const e=Xt(),t=(n,i,s)=>{try{Reflect.apply(r,{},[n,i])}catch(o){console.error(o)}s()};e.afterEach(t),w.onUnmounted(()=>{e.removeAfterEach(t)})}const di="";v.Bus=yt,v.EventChain=Ae,v.EventProxy=vt,v.Route=q,v.clone=Se,v.createFox=si,v.createMemoryHistory=Sr,v.createWebHashHistory=xr,v.createWebHistory=Tn,v.deleteContextValue=un,v.extend=j,v.foxBusKey=Gt,v.foxEventProxyKey=Qt,v.foxKey=Jt,v.injectContextValue=gt,v.isArray=Hr,v.isDate=Br,v.isESModule=lt,v.isEqual=ct,v.isFunction=S,v.isMap=Dr,v.isObject=er,v.isPlainObject=ot,v.isPromise=Wr,v.isSet=Vr,v.isString=Ur,v.isSymbol=kr,v.onAfterRouteUpdate=ci,v.onBeforeRouteUpdate=fi,v.onFoxActivated=yn,v.onFoxInactivated=mn,v.provideContextValue=an,v.sessionKey=ie,v.toBoolean=ut,v.toNumber=Qr,v.toTypeString=He,v.typeOf=ft,v.useBus=ai,v.useEventProxy=ui,v.useFox=li,v.useRoute=oi,v.useRouter=Xt,Object.defineProperty(v,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fox-js/fox",
3
- "version": "3.0.1-22",
3
+ "version": "3.0.1-23",
4
4
  "description": "Fox Router and commons Utils",
5
5
  "author": "jiangcheng",
6
6
  "keywords": [