@fox-js/fox 3.1.1-2 → 3.1.1-3
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 +2 -2
- package/libs/index.esm.d.ts +129 -3
- package/libs/index.esm.js +776 -605
- package/libs/index.umd.js +3 -3
- package/package.json +1 -1
package/libs/index.cjs.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";/*!
|
|
2
|
-
* fox v3.1.0
|
|
3
|
-
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("vue"),Se=typeof window<"u",q=function(){return window},De=function(){return window.document};function ts(s){let e=s,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 pt(){if(!Se)return"/";let s=q().location,e=`${s.protocol}//${s.host}`;return e+=ts(s.pathname),e}function st(s,e,t,r=!1){s.addEventListener?s.addEventListener(e,t,r):s.attachEvent?s.attachEvent(`on${e}`,t):s[`on${e}`]=t}function nt(s,e,t){s.removeEventListener?s.removeEventListener(e,t):s.detachEvent?s.detachEvent(`on${e}`,t):s[`on${e}`]=null}const Ue=(s,e,t)=>{e=e??{bubbles:!1,cancelable:!1,detail:void 0};const r=document.createEvent("Events");let n=!0,i=!0;for(let a in e)a==="bubbles"?n=!!e[a]:a==="cancelable"?i=!!e[a]:r[a]=e[a];r.initEvent(s,n,i),(t??document).dispatchEvent(r)},rs=Array.isArray,ss=s=>ut(s)==="[object Map]",ns=s=>ut(s)==="[object Set]",is=s=>s instanceof Date,R=s=>typeof s=="function",os=s=>typeof s=="string",ls=s=>typeof s=="symbol",Sr=s=>s!==null&&typeof s=="object",as=s=>Sr(s)&&R(s.then)&&R(s.catch),Pr=s=>s==null,us=Object.prototype.toString,ut=s=>us.call(s),Er=s=>ut(s)==="[object Object]",fs=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol";function Bt(s){return s.__esModule||fs&&s[Symbol.toStringTag]==="Module"}const cs=typeof Promise<"u"&&Promise.toString().indexOf("[native code]")!==-1;function _(...s){let e=s[0]!==void 0&&s[0]!==null?s[0]:{},t=1,r=s.length,n=!1;for(typeof e=="boolean"&&(n=e,e=s[t]??{},t++),typeof e!="object"&&(e={});t<r;t++)if(s[t]!==null&&s[t]!==void 0){let i=s[t];for(let o in i){let a=e[o],l=i[o];if(a!==l)if(n===!0&&l&&typeof l=="object"){let u;Array.isArray(l)?u=a&&Array.isArray(a)?a:[]:u=a&&typeof a=="object"?a:{},e[o]=_(n,u,l)}else l!==void 0&&(e[o]=l)}}return e}function ft(s,e,t=!1){if(!t)_(!0,s,e);else{if(typeof e!="object")return{};typeof s!="object"&&(s={});for(let r of Reflect.ownKeys(e)){let n=s[r],i=e[r];if(n!==i)if(typeof i=="object"){if(!Array.isArray(i)&&!Er(i))continue;n=ft(n,i,t),s[r]=n}else{if(typeof i=="function")continue;s[r]=i}}}return s}class le{static seed=new Date().getTime();static get(){let e=++le.seed;return e>=Number.MAX_VALUE&&(le.seed=0),e}}const mt=cs?Promise.resolve():null;function Me(s,...e){mt!==null?e&&e.length>0?mt.then(()=>{s(e)}):mt.then(s):e&&e.length>0?setTimeout(()=>{s(e)}):setTimeout(s)}function Vt(s){return s==null?!1:typeof s=="boolean"?s:typeof s=="string"?s.toLocaleLowerCase()==="true":!!s}function hs(s){return typeof s=="number"?s:Number(s)}const ys={"[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 Ot(s){let t=Object.prototype.toString.call(s);return s==null?String(s):ys[t]||"object"}function Mt(s,e){if(s==e)return!0;if(s===void 0||e===void 0)return!1;let t=Ot(s),r=Ot(e);if(t!==r)return!1;if(t==="object"){let n=Object.keys(s),i=Object.keys(e);if(n.length!==i.length)return!1;for(let o=0;o<n.length;o++){let a=n[o],l=s[a],u=e[a];if(!Mt(l,u))return!1}return!0}else if(t==="array"){if(s.length!==e.length)return!1;for(let n=0;n<s.length;n++){let i=s[n],o=e[n];if(!Mt(i,o))return!1}return!0}return!1}const Cr=s=>{const e={};for(let t of Reflect.ownKeys(s)){let r=s[t];r&&!Array.isArray(r)&&typeof r=="object"&&(r=Cr(r)),typeof t=="symbol"?e[String(t)]=r:e[t]=r}return e},ds=/^Symbol\((.*)\)$/,Fr=s=>{const e={};for(let t of Reflect.ownKeys(s)){let r=s[t];r&&!Array.isArray(r)&&typeof r=="object"&&(r=Fr(r));const n=ds.exec(t);if(n&&n[1]){const i=Symbol.for(n[1]);e[i]=r}else e[t]=r}return e},tr=Symbol("idKey"),ye=Symbol("valueKey"),S=Symbol("childrenKey"),X=Symbol("growKey");class Ar{[X]=!0;[tr];[ye]=w.ref();[S]=new Map;constructor(e){this[tr]=e}}class ps{get(e,t){if(t=="value")return e[ye].value;if(t==="grow")return e[X];let r=e[S].get(t);if(r)return Ie(r);if(e[X])return r=Wt(t),r[X]=e[X],e[S].set(t,r),Ie(r)}set(e,t,r){return t=="value"?(e[ye].value=r,!0):t==="grow"?(e[X]=Vt(r),!0):r==null?(e[S].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[S].delete(t),!0)}}const kt="__proxy__";function Wt(s){const e=new Ar(s);return Reflect.set(e,kt,new Proxy(e,new ps)),e}function Ie(s){return Reflect.get(s,kt)}class ms{name="";persistPolicy="momery";storage;initFlag=!1;state={};constructor(e={}){if(e.persistPolicy&&e.persistPolicy!=="momery"&&Pr(e.name))throw new Error("name can not be empty, where persistPolicy is not momery.");this.name=e.name??"",this.persistPolicy=e.persistPolicy??"momery",this.storage=e.storage}init(e){this.restore(e),this.initFlag=!0}getStorage(){if(!this.persistPolicy)return null;let e=null;if(this.persistPolicy==="custom")e=this.storage;else if(Se){const t=q();e=this.persistPolicy==="session"?t.sessionStorage:t.localStorage}return e}saveState(){if(!this.persistPolicy||this.persistPolicy==="momery")return;let e=this.getStorage();if(e===null||!this.state)return;const t=`_bus_${this.name}`,r=JSON.stringify(this.state??{});e.setItem(t,r)}removeState(){if(!this.persistPolicy||this.persistPolicy==="momery")return;let e=this.getStorage();if(e===null||!this.state)return;const t=`_bus_${this.name}`;e.removeItem(t)}restore(e){if(!this.persistPolicy||this.persistPolicy==="momery")return;let t=this.getStorage();if(t===null)return;const r=`_bus_${this.name}`,n=t.getItem(r);n&&(this.state=JSON.parse(n),Reflect.ownKeys(this.state).forEach(o=>{if(typeof o!="string")return;const a=this.state[o],l=o.split(/\//g);l.push(a),Reflect.apply(e.put,e,l)}))}put(e){if(this.initFlag&&this.persistPolicy!=="momery")try{const t=e.length,r=e.slice(0,t-1).join("/"),n=e[t-1];this.state[r]=n,this.saveState()}catch(t){console.error(t)}}remove(e){if(this.initFlag&&this.persistPolicy!=="momery")try{const t=e.length,r=e.slice(0,t-1).join("/"),n={};Reflect.ownKeys(this.state).forEach(o=>{typeof o=="string"&&(o===r||o.startsWith(r)||(n[o]=this.state[o]))}),this.state=n,this.saveState()}catch(t){console.error(t)}}clear(){if(this.initFlag)try{this.state={},this.removeState()}catch(e){console.error(e)}}}class Tr extends Ar{_persistHandler;constructor(e={}){super("__root__"),this._persistHandler=new ms(e),this._persistHandler.init(this)}put(...e){let t=e.length;if(t<2)return console.error("参数至少包括一个(key, value)"),!1;let r=this;for(let n=0;n<t-1;n++){let i=e[n],o;r[S].has(i)?o=r[S].get(i):(o=Wt(i),r[S].set(i,o)),r=o}return r[ye].value=e[t-1],this._persistHandler.put(e),!0}get(...e){let t=e.length;if(t===0)return;let r=this;for(let n=0;n<t;n++){let i=e[n];if(r[S].has(i))r=r[S].get(i);else return}return r[ye].value}remove(...e){let t=e.length;if(t==0)return!1;let r=this;for(let i=0;i<t-1;i++){const o=e[i];if(r[S].has(o))r=r[S].get(o);else return!1}const n=e[t-1];return r[S].has(n)?(r[S].delete(n),this._persistHandler.remove(e),!0):!1}contains(...e){const t=e.length;if(t==0)return!1;let r=this;for(let i=0;i<t-1;i++){let o=e[i];if(r[S].has(o))r=r[S].get(o);else return!1}const n=e[t-1];return r[S].has(n)}clear(){this[S].clear(),this._persistHandler.clear()}}const vs=["put","get","contains","remove","clear","_persistHandler"];function rr(s){return vs.includes(s)}class gs{get(e,t){if(t=="value")return e[ye].value;if(t==="grow")return e[X];if(t===S)return e[S];if(typeof t=="string"&&rr(t))return e[t];let r=String(t),n=e[S].get(r);if(n)return Ie(n);if(e[X])return n=Wt(r),n[X]=e[X],e[S].set(r,n),Ie(n)}set(e,t,r){return t=="value"?(e[ye].value=r,!0):t==="grow"?(e[X]=Vt(r),!0):rr(t)?!1:r==null?(e[S].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[S].delete(t),!0)}}function ws(s){const e=new Tr(s),t=new gs,r=new Proxy(e,t);return Reflect.set(e,kt,r),e}const It=new Proxy(Tr,{construct(s,e){const t=ws(e[0]??{});return Ie(t)}}),te="default",_r=Symbol("sync"),D=Symbol("resolveRoute");function sr(s){let e=!1;return function(...t){if(!e)return e=!0,Reflect.apply(s,{},t)}}function bs(s){let e=s.src;return new Promise((t,r)=>{const n=sr(a=>{Bt(a)&&(a=a.default),s.component=a,console.debug("success load async module"),t()}),i=sr(a=>{console.debug("reject load async module"),r(a)});let o;try{o=e(n,i)}catch(a){i(a)}if(o)if(typeof o.then=="function")o.then(n,i);else{const a=o.component;a&&typeof a.then=="function"&&a.then(n,i)}})}class xs{name;level;rootName;rootIndex=0;constructor(e,t,r,n){this.name=e,this.level=t,this.rootName=r,this.rootIndex=n}}class it{to;routeModel;from;data={};constructor(e,t){this.to=e,this.from=t}static from(e){let t=new it(e.to,e.from),r=e.data??{};return _(!0,t.data,r),t}}class P{path;get fullPath(){const e=this.path??`/${this.name}`;return`${this.root??te}!${e}`}alias;name;root;params;query;traceless;template;matched;meta;success;error;destroy;opsType;updateType;historyUpdatePolicy;viewTagAttrs;index;active;slot;session;static clone(e,t){let r=new P;return ft(r,e,t),r}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 P;if(e==null)return t;let r=t;for(let i in e){let o=e[i];r[i]=o}const n=Object.getOwnPropertySymbols(e);if(Array.isArray(n)&&n.length>0)for(let i of n)r[i]=e[i];return t}}class Rs{id;name;props;meta;src;component;constructor(e,t,r,n){this.id=le.get(),this.name=e,this.src=t,typeof t!="function"&&(this.component=t),this.props=r,this.meta=n}get isResolved(){return this.component!==void 0}resolve(){return bs(this)}}class nr{models=[]}class vt{path;match;redirect;name;layers=[]}var j=(s=>(s[s.Push=0]="Push",s[s.Replace=1]="Replace",s[s.Put=2]="Put",s[s.Append=3]="Append",s[s.Open=4]="Open",s))(j||{});const Kr="FoxBeforeEnter",$r="FoxEnter",jr="FoxLeave",qr="FoxLeave",ot="FoxLeaveEnd",B=Symbol("chainKey"),H=Symbol("cursorKey"),gt=Symbol("$persistentModeKey"),T=Symbol("statusKey"),Z=Symbol("argsKey"),Be=Symbol("exArgsKey"),de=Symbol("successFnsKey"),Ce=Symbol("errorFnsKey"),oe=Symbol("sessionKey"),ee=Symbol("_go");class Ne{[B]=[];[H]=0;[gt]=!1;[T]="Free";[Z]=[];[Be]=[];[de]=[];[Ce]=[];[oe];get session(){return this[oe]}constructor(e,t=!1){this[oe]=e,this[gt]=t}[ee](e,...t){let r=this[T];if(this[T]="Busy",this[H]+=e,this[H]<0&&(this[H]=0),this[Z]=t,r==="Exception"||r==="Reject"){let a=[{session:this[oe]},...this[Be]];for(;this[Ce].length>0;)try{let l=this[Ce].shift();typeof l=="function"&&Me(()=>{Reflect.apply(l,{},a)})}catch(l){console.error(l.message,l)}return this[T]=r,this[B]=[],this[H]=0,this}else if(r==="Finished"||this[H]>=this[B].length){let a=[{session:this[oe]},...this[Z]];for(;this[de].length>0;){let l=this[de].shift();typeof l=="function"&&Me(()=>{Reflect.apply(l,{},a)})}return this[T]="Free",this}if(this[H]>=this[B].length)return this[T]="Free",this;let n=this[B][this[H]];this[gt]||(this[B].splice(0,this[H]+1),this[H]=-1);let i=this[H]+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(i,0,l),i++)},session:this[oe]};Me(()=>{Reflect.apply(n,{},[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[T]="Finished",this[Z]=e,Reflect.apply(this[ee],this,[0])}reject(...e){return this[T]="Reject",this[Be]=e,Reflect.apply(this[ee],this,[0])}throw(...e){return this[T]="Exception",this[Be]=e,Reflect.apply(this[ee],this,[0])}reset(...e){this[T]="Busy",this[Z]=e,this[B]=[],this[H]=0;let r=[{session:this[oe]},...this[Z]];for(;this[de].length>0;){let n=this[de].shift();Me(()=>{Reflect.apply(n,this,r)})}return this[T]="Free",this}post(e){return this[T]==="Reject"||this[T]==="Exception"?this:(Array.isArray(e)?this[B]=[...this[B],...e]:this[B].push(e),this[T]==="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[Ce].push(t),this[T]==="Busy"?this:(Reflect.apply(this[ee],this,[0,...this[Z]]),this)}exception(e){return e&&typeof e=="function"&&this[Ce].push(e),this[T]==="Busy"?this:Reflect.apply(this[ee],this,[0,...this[Z]])}isFinish(){return this[T]=="Reject"||this[T]=="Free"&&this[H]>=this[B].length}}const pe=Symbol("registerKey");class Ss{policy;callback;constructor(e,t){this.callback=e,this.policy=t}}class Nt{[pe]=new Map;constructor(){}on(e,t,r=!1){let n=this[pe].get(e);n||(n=new Array,this[pe].set(e,n));let i=r===!0?1:0,o=new Ss(t,i);return n.push(o),this}off(e,t){if(!t)return this[pe].delete(e),this;let r=this[pe].get(e);if(r){for(let n=0;n<r.length;n++)if(r[n].callback===t){r.splice(n,1);break}}return this}bind(e,t,r=!1){return this.on(e,t,r)}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 r=e[t-1];if(typeof r!="function")return console.error("callback can not benn empty"),this;let n=t-1,i=new Array(n),o=[].splice.call(e,0,n);for(let a=0;a<o.length;a++)this.once(o[a],l=>{i[a]=l,n-=1,n==0&&Reflect.apply(r,{},i)});return this}emit(e,...t){let r=this[pe].get(e);if(!r)return this;for(let n=0;n<r.length;){let i=r[n];if(i.policy==1?r.splice(n,1):n++,typeof i.callback=="function")try{Me(()=>{Reflect.apply(i.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 Ps{[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 he=Symbol("lc");function lt(s,e=!1){let t=s;if(Reflect.has(t,he))return t[he];if(e){const r=new Ps;return t[he]=r,r}return null}function Lr(s,e=!1){let t=null,r=s;for(;r&&!(Reflect.has(r,he)&&(t=r[he],t));)r=r.$parent;if(!t&&e){const n=s;n&&n.$parent&&(t=lt(n.$parent,e))}return t}function zt(s,e){let t=s;for(;t;){if(Reflect.has(t,he)){const r=t[he];if(r.has(e))return r.get(e)}t=t.$parent}return null}function Es(s,e,t){Lr(s,!0)?.set(e,t)}function Cs(s,e){Lr(s,!0)?.delete(e)}function ir(s){if(Array.isArray(s.children)&&s.children.length>0){let e=s.children[0];if(e!=null&&e.component!=null&&e.component.proxy!=null)return lt(e.component.proxy,!1)}return null}const at=Symbol("hooksKey");function Fs(s){let e=s.get(at);e||(e=[],s.set(at,e))}function or(s,e){let t=s.get(at);if(t!=null)for(let r=t.length-1;r>=0;r--){let n=t[r];if(n.type===e)try{Reflect.apply(n.hook,n.target,[])}catch(i){console.error(i.message,i)}}}var Ht=(s=>(s.DEACTIVATED="da",s.ACTIVATED="a",s))(Ht||{});class As{type;hook;target;constructor(e,t,r){this.target=r,this.hook=t,this.type=e}}function Ts(s,e,t,r){let n=new As(e,t,r);return s.push(n),!0}function _s(s,e,t,r){let n=-1;for(let i=0;i<s.length;i++){let o=s[i];if(o.type===e&&o.hook===t&&o.target===r){n=i;break}}return n!=-1?(s.splice(n,1),!0):!1}function Or(s){return(e,t)=>{let r;if(t)r=t;else{const i=w.getCurrentInstance();if(i==null||i.proxy==null){console.error("can not get current instance or proxy");return}r=i.proxy}const n=zt(r,at);if(n==null){console.warn("hooks context not found");return}w.onUnmounted(()=>{_s(n,s,e,r)}),Ts(n,s,e,r)}}const Ks=Or("a"),$s=Or("da"),Mr=Symbol("routeKey");function lr(s,e){s.set(Mr,e)}function Jt(s){let e=zt(s,Mr);return typeof e=="function"?e():e??null}const ct=Symbol("rk"),wt=Symbol("vd"),ar=Symbol("rv"),bt=Symbol("rvi"),ur=Symbol("pv"),xt=Symbol("pvi");function js(s){for(var e=[],t=0;t<s.length;){var r=s[t];if(r==="*"||r==="+"||r==="?"){e.push({type:"MODIFIER",index:t,value:s[t++]});continue}if(r==="\\"){e.push({type:"ESCAPED_CHAR",index:t++,value:s[t++]});continue}if(r==="{"){e.push({type:"OPEN",index:t,value:s[t++]});continue}if(r==="}"){e.push({type:"CLOSE",index:t,value:s[t++]});continue}if(r===":"){for(var n="",i=t+1;i<s.length;){var o=s.charCodeAt(i);if(o>=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122||o===95){n+=s[i++];continue}break}if(!n)throw new TypeError("Missing parameter name at ".concat(t));e.push({type:"NAME",index:t,value:n}),t=i;continue}if(r==="("){var a=1,l="",i=t+1;if(s[i]==="?")throw new TypeError('Pattern cannot start with "?" at '.concat(i));for(;i<s.length;){if(s[i]==="\\"){l+=s[i++]+s[i++];continue}if(s[i]===")"){if(a--,a===0){i++;break}}else if(s[i]==="("&&(a++,s[i+1]!=="?"))throw new TypeError("Capturing groups are not allowed at ".concat(i));l+=s[i++]}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=i;continue}e.push({type:"CHAR",index:t,value:s[t++]})}return e.push({type:"END",index:t,value:""}),e}function Ir(s,e){e===void 0&&(e={});for(var t=js(s),r=e.prefixes,n=r===void 0?"./":r,i="[^".concat(be(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 E=f(A);if(E!==void 0)return E;var C=t[l],z=C.type,I=C.index;throw new TypeError("Unexpected ".concat(z," at ").concat(I,", expected ").concat(A))},h=function(){for(var A="",E;E=f("CHAR")||f("ESCAPED_CHAR");)A+=E;return A};l<t.length;){var y=f("CHAR"),d=f("NAME"),m=f("PATTERN");if(d||m){var p=y||"";n.indexOf(p)===-1&&(u+=p,p=""),u&&(o.push(u),u=""),o.push({name:d||a++,prefix:p,suffix:"",pattern:m||i,modifier:f("MODIFIER")||""});continue}var v=y||f("ESCAPED_CHAR");if(v){u+=v;continue}u&&(o.push(u),u="");var g=f("OPEN");if(g){var p=h(),K=f("NAME")||"",x=f("PATTERN")||"",$=h();c("CLOSE"),o.push({name:K||(x?a++:""),pattern:K&&!x?i:x,prefix:p,suffix:$,modifier:f("MODIFIER")||""});continue}c("END")}return o}function qs(s,e){return Ls(Ir(s,e),e)}function Ls(s,e){e===void 0&&(e={});var t=Gt(e),r=e.encode,n=r===void 0?function(l){return l}:r,i=e.validate,o=i===void 0?!0:i,a=s.map(function(l){if(typeof l=="object")return new RegExp("^(?:".concat(l.pattern,")$"),t)});return function(l){for(var u="",f=0;f<s.length;f++){var c=s[f];if(typeof c=="string"){u+=c;continue}var h=l?l[c.name]:void 0,y=c.modifier==="?"||c.modifier==="*",d=c.modifier==="*"||c.modifier==="+";if(Array.isArray(h)){if(!d)throw new TypeError('Expected "'.concat(c.name,'" to not repeat, but got an array'));if(h.length===0){if(y)continue;throw new TypeError('Expected "'.concat(c.name,'" to not be empty'))}for(var m=0;m<h.length;m++){var p=n(h[m],c);if(o&&!a[f].test(p))throw new TypeError('Expected all "'.concat(c.name,'" to match "').concat(c.pattern,'", but got "').concat(p,'"'));u+=c.prefix+p+c.suffix}continue}if(typeof h=="string"||typeof h=="number"){var p=n(String(h),c);if(o&&!a[f].test(p))throw new TypeError('Expected "'.concat(c.name,'" to match "').concat(c.pattern,'", but got "').concat(p,'"'));u+=c.prefix+p+c.suffix;continue}if(!y){var v=d?"an array":"a string";throw new TypeError('Expected "'.concat(c.name,'" to be ').concat(v))}}return u}}function Os(s,e){var t=[],r=Nr(s,t,e);return Ms(r,t,e)}function Ms(s,e,t){t===void 0&&(t={});var r=t.decode,n=r===void 0?function(i){return i}:r;return function(i){var o=s.exec(i);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 y=e[h-1];y.modifier==="*"||y.modifier==="+"?u[y.name]=o[h].split(y.prefix+y.suffix).map(function(d){return n(d,y)}):u[y.name]=n(o[h],y)},c=1;c<o.length;c++)f(c);return{path:a,index:l,params:u}}}function be(s){return s.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function Gt(s){return s&&s.sensitive?"":"i"}function Is(s,e){if(!e)return s;for(var t=/\((?:\?<(.*?)>)?(?!\?)/g,r=0,n=t.exec(s.source);n;)e.push({name:n[1]||r++,prefix:"",suffix:"",modifier:"",pattern:""}),n=t.exec(s.source);return s}function Ns(s,e,t){var r=s.map(function(n){return Nr(n,e,t).source});return new RegExp("(?:".concat(r.join("|"),")"),Gt(t))}function Hs(s,e,t){return Ds(Ir(s,t),e,t)}function Ds(s,e,t){t===void 0&&(t={});for(var r=t.strict,n=r===void 0?!1:r,i=t.start,o=i===void 0?!0:i,a=t.end,l=a===void 0?!0:a,u=t.encode,f=u===void 0?function(I){return I}:u,c=t.delimiter,h=c===void 0?"/#?":c,y=t.endsWith,d=y===void 0?"":y,m="[".concat(be(d),"]|$"),p="[".concat(be(h),"]"),v=o?"^":"",g=0,K=s;g<K.length;g++){var x=K[g];if(typeof x=="string")v+=be(f(x));else{var $=be(f(x.prefix)),A=be(f(x.suffix));if(x.pattern)if(e&&e.push(x),$||A)if(x.modifier==="+"||x.modifier==="*"){var E=x.modifier==="*"?"?":"";v+="(?:".concat($,"((?:").concat(x.pattern,")(?:").concat(A).concat($,"(?:").concat(x.pattern,"))*)").concat(A,")").concat(E)}else v+="(?:".concat($,"(").concat(x.pattern,")").concat(A,")").concat(x.modifier);else x.modifier==="+"||x.modifier==="*"?v+="((?:".concat(x.pattern,")").concat(x.modifier,")"):v+="(".concat(x.pattern,")").concat(x.modifier);else v+="(?:".concat($).concat(A,")").concat(x.modifier)}}if(l)n||(v+="".concat(p,"?")),v+=t.endsWith?"(?=".concat(m,")"):"$";else{var C=s[s.length-1],z=typeof C=="string"?p.indexOf(C[C.length-1])>-1:C===void 0;n||(v+="(?:".concat(p,"(?=").concat(m,"))?")),z||(v+="(?=".concat(p,"|").concat(m,")"))}return new RegExp(v,Gt(t))}function Nr(s,e,t){return s instanceof RegExp?Is(s,e):Array.isArray(s)?Ns(s,e,t):Hs(s,e,t)}var et=(s=>(s[s.Part=0]="Part",s[s.All=1]="All",s))(et||{});const Q=Symbol("rootKey"),G=Symbol("rootNodeKey"),ce=Symbol("parentNodeKey"),tt=Symbol("nameKey");class se{instance=null;model;route;active=!0;index=0;constructor(e,t,r=0,n=!0){this.route=e,this.model=t,this.index=r,this.active=n}}class Ae{_slots;get slots(){return this._slots==null&&(this._slots=w.shallowRef([])),this._slots}get empty(){return this._slots==null||this._slots.value.length==0}[tt];[Q];[G]=null;[ce]=null;get name(){return this[tt]}constructor(e,t,r){this[tt]=e,this[Q]=t,r&&(this[G]=r)}}class V{view;index;level;constructor(e,t,r){this.view=e,this.index=t,this.level=r}static include(e,t){for(let r=0;r<e.length;r++){let n=e[r];if(n.view===t.view&&(t.index==-1||n.index===t.index)&&n.level===t.level)return!0}return!1}}class Rt{views=[]}class Us{layers=[]}class Bs{time;route}class Vs{forbidTime=300;submitRecorder=new Bs;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 xe=Symbol("_notifyChange");class fr{currentRoute;routes;constructor(e,t){this.currentRoute=e,this.routes=t}}const ae=Symbol("historyChangeConsumerKey"),cr=Symbol("_navigateFirstRoute"),Ve=Symbol("_getRouteMark"),St=Symbol("_getUrlSearch"),Pt=Symbol("_generateLocation"),ke=Symbol("_setRouteMarkRecorder"),Te=Symbol("beforeRestoreFiltersKey"),hr=Symbol("_beforeRestore"),yr="Symbol(_fox_restore_point)";function _e(s,...e){return typeof s=="function"?Reflect.apply(s,null,[...e]):s}function dr(s){if(!Array.isArray(s))return!1;if(s.length===0)return!0;const e=s[0];return!!(Reflect.has(e,"path")&&Reflect.has(e,"root"))}class Hr{base;storage;mode;query;firstNavigate=!0;historyMonitor;traceless=!1;changeHandler;historyChange;[ae]=!1;[Te]=new Array;backTimeout=320;constructor(e="hash",t="",r="",n=!0,i=!0,o=!1,a,l){this.mode=e,this.base=t,this.query=r,this.firstNavigate=n,this.historyMonitor=i,this.traceless=o,this.storage=a??q().sessionStorage,this.backTimeout=l??320}init(e=!0){const t=q();return typeof this.historyChange!="function"&&(this.historyChange=()=>{if(typeof this[ae]=="function"){const r=this[ae]();if(this[ae]=!1,r)return}else if(this[ae]===!0){this[ae]=!1;return}if(_e(this.historyMonitor)){const r=t.history.state;this[xe](r);try{let n=[];if(typeof r=="string"?n=JSON.parse(r):n=r,Array.isArray(n)&&n.length>0){const i=this[Ve]()??"/";this[ke](i,n)}}catch{}}}),st(t,"popstate",this.historyChange),this.firstNavigate&&e&&this[cr](),Promise.resolve()}destroy(){if(this.historyChange){const e=q();nt(e,"popstate",this.historyChange)}}[hr](e,t,r,n){for(let i of this[Te])try{const o=Reflect.apply(i,{},[e,t,r,n]);if(o===!1)return o}catch(o){console.error(o.message,o)}return!0}beforeRestoreEach(e){this[Te].push(e)}removeBeforeRestoreEach(e){const t=this[Te].indexOf(e);return t!==-1?(this[Te].splice(t,1),!0):!1}[cr](){const e=this[Ve]()??"/",t=this.storage.getItem(yr);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)=>(l.params=l.params?Fr(l.params):{},this[hr](l,u,e,o.routes)));if(a.length>0){const l=this[St](),u=a.length-1;a[u].query=l||a[u].query,this[xe](a);return}}}catch{}const r=e.indexOf("!");let n;r!=-1?n=e.substring(r+1):n=e;const i=new P;i.path=n,i.query=this[St](),this[xe]([i])}[ke](e,t){try{t.forEach(i=>{i.params=i.params?Cr(i.params):{}});const n=JSON.stringify({mark:e,routes:t});this.storage.setItem(yr,n)}catch(r){console.error(r.message,r)}}setRestorePoint(e){const t=this[Ve]()??"/";this[ke](t,e)}[xe](e){typeof this.changeHandler=="function"&&this.changeHandler(e)}[Ve](){const e=q();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,r=t.indexOf("#");if(r!=-1)return t.substring(r+1)}return null}[St](){let t=q().location.search;return t.length>0&&t.indexOf("?")===0&&(t=t.substring(1)),t}listen(e){this.changeHandler=e}go(e,t=!1){const r=q();this[ae]=t,r.history.go(e)}goBack(e,t){const r=q(),n=r.history.state;if(dr(n)&&n.length>0){let i=!1;for(let f=n.length-1;f>=0;f--){const c=P.from(n[f]);if(!(c.historyUpdatePolicy==="traceless"||_e(this.traceless,c))&&P.isSame(c,e)){i=!0;break}}if(!i){t();return}const o=this.backTimeout;let a=null;const l=()=>{r.history.go(-1),a=setTimeout(l,o)},u=()=>{clearTimeout(a);const c=q().history.state;if(dr(c)&&c.length>0){let h=c.length;const y=c[h-1],d=P.from(y);if(P.isSame(d,e))return t(),!0;if(h>0){let m=!1;for(let p=h-1;p>=0;p--){const v=P.from(c[p]);if(!(v.traceless===!0||_e(this.traceless,v))&&P.isSame(v,e)){m=!0;break}}return m?(setTimeout(()=>{a=setTimeout(l,o),this.go(-1,u)},0),!0):(t(),!0)}}return t(),!0};a=setTimeout(l,o),this.go(-1,u)}else t()}setRouteMark(e){const t=e.currentRoute.fullPath;this[ke](t,e.routes)}push(e){const t=this[Pt](e.currentRoute);e.currentRoute.historyUpdatePolicy!=="traceless"&&!_e(this.traceless,e.currentRoute)&&q().history.pushState(e.routes,"",t),this.setRouteMark(e)}replace(e){const t=this[Pt](e.currentRoute);(e.currentRoute.historyUpdatePolicy!=="traceless"||!_e(this.traceless,e.currentRoute))&&q().history.replaceState(e.routes,"",t),this.setRouteMark(e)}[Pt](e){const t=q();let r="";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?(r=a.length>0?`${this.query}&${a}`:this.query,r.length>0&&r.charAt(0)!=="?"&&(r=`?${r}`)):a.length>0&&(r=`?${a}`)}const n=t.location;let i=e.alias??e.fullPath;i.startsWith(te)&&(i=i.substring(te.length+1));let o;return r?this.mode=="path"?i.indexOf("/")===0?o=`${this.base}${i}${r}`:o=`${this.base}/${i}${r}`:o=`${n.pathname}${r}#${i}`:this.mode=="path"?i.indexOf("/")===0?o=`${this.base}${i}`:o=`${this.base}/${i}`:o=`${n.pathname}#${i}`,`${n.origin}${o}`}}function ks(s=!0,e=null,t="",r=!0,n=!1,i){return e!==null&&(e=q().location.pathname),e&&e.endsWith("/")&&(e=e.substring(0,e.length-1)),new Hr("path",e??"",t,s,r,n,i)}function Dr(s=!0,e="",t=!0,r=!1,n){return new Hr("hash","",e,s,t,r,n)}class Ws{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}[xe](e){typeof this.changeHandler=="function"&&this.changeHandler(e)}go(e,t=!1){if(this.queue.length==0||this.cursor<=0)return;let r=this.cursor+e;if(r<0?r=0:r>this.queue.length-1&&(r=this.queue.length-1),r!=this.cursor){this.cursor=r;let n=!1;if(typeof t=="function"?n=t():n=t,!n){const i=this.queue[r];this[xe](i.routes)}}}goBack(e,t){if(this.queue.length==0||this.cursor<=0)return;let r=0;if(e===null)r=this.cursor+1;else for(let n=this.cursor;n>=0;n--){const i=this.queue[n];if(P.isSame(i.currentRoute,e))break;r++}if(r===0){t();return}this.go(-r,()=>(t(),!0))}setRouteMark(e){}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 Ur(s="",e=50){return new Ws(s,e)}const We=Symbol("_constructRouteModel"),ze=Symbol("_findRouteModel"),Et=Symbol("_findRootView"),pr=Symbol("_getFirstView"),ue=Symbol("_removeView"),mr=Symbol("_buildPage"),vr=Symbol("_resolveComponent"),gr=Symbol("_update"),ne=Symbol("_merge"),Ct=Symbol("_handleHistoryChange"),Je=Symbol("_handleRouteUpdated"),Ge=Symbol("routeUpdatedCallback"),b=Symbol("currentRoutes"),me=Symbol("current"),wr=Symbol("_addRouteRecorder"),Ke=Symbol("_removeRouteRecorder"),Qe=Symbol("_cloneRouteRecorder"),L=Symbol("_handleError"),Xe=Symbol("errorCallback"),k=Symbol("registerKey"),Ye=Symbol("notFoundKey"),Ft=Symbol("notFoundPathKey"),W=Symbol("forestKey"),F=Symbol("historyKey"),$e=Symbol("beforeFiltersKey"),je=Symbol("afterFiltersKey"),qe=Symbol("destroyFiltersKey"),At=Symbol("propsFilterKey"),ve=Symbol("mainDispatcherKey"),Tt=Symbol("initKey"),fe=Symbol("readyKey"),_t=Symbol("readyHandlersKey"),Ze=Symbol("_markReady"),br=Symbol("_createNextFn"),Kt=Symbol("_start"),$t=Symbol("_before"),jt=Symbol("_after"),xr=Symbol("_destroy"),qt=Symbol("_load"),Le=Symbol("_unload"),Oe=Symbol("routerGuardKey");function zs(s){return s.layers.length==0||s.layers[0].views.length==0}function Js(s){let e=[];return s.layers.forEach(t=>{t.models==null||t.models==null||t.models.forEach(r=>{if(!(r==null||r==null))if(typeof r.meta=="object"){let n=_(!0,{},r.meta);e.push(n)}else r.meta&&e.push(r.meta)})}),e}class Gs{[k]=new Array;[Ye];[Ft]="*";[fe]=!1;[_t]=[];[W]=new Us;[F];[b]=new Array;[Xe]=null;[Ge]=null;[$e]=new Array;[je]=new Array;[qe]=new Array;[At]=null;[ve]=new Ne;[Oe]=new Vs;[Tt]=!1;[me]=w.ref(null);get current(){return this[me].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[F]=e.history:this[F]=Se?Dr():Ur(),this[F]?.listen(async r=>{let n=!0;try{if(typeof r=="string"){const i=this[D](r);i&&await this[Ct]([i])}else await this[Ct](r)}catch(i){console.error(i.message,i),n=!1}this[fe]===!1&&this[Ze](n)})}[L](e="error",t){if(t&&typeof t.error=="function")try{t.error(e)}catch{}if(typeof this[Xe]=="function")try{this[Xe](e,t)}catch{}console.error(e)}init(){this[Tt]!==!0&&(this[F]?.init(!this[fe]),this[Tt]=!0)}isReady(){return this[fe]?Promise.resolve():new Promise((e,t)=>{this[_t].push([e,t])})}[Ze](e){this[fe]=!0,this[_t].forEach(([t,r])=>{try{e?t():r()}catch(n){console.error(n.message,n)}})}[Ct](e){try{if(!e){let o=[...this[b]].reverse();return this[Le](o),Se&&q().location.reload(),Promise.resolve()}let t=null,r=[],n=[],i=0;for(;i<e.length&&i<this[b].length&&P.isSame(e[i],this[b][i]);i++)e[i].active===!0&&e[i].active!==this[b][i].active&&(t=e[i]);if(i<e.length&&(r=e.slice(i)),i<this[b].length&&(n=this[b].slice(i).reverse()),n.length===0&&r.length===0){if(t!==null)return this.restore([t])}else if(n.length>0){if(this[Le](n)){if(r.length>0)return this.restore(r);if(t!==null)return this.restore([t])}}else return this.restore(r)}catch(t){this[L](t)}return Promise.resolve()}[Je](e){if(e)this[me].value=e;else{let t=this[b].length;t>0?this[me].value=this[b][t-1]:this[me].value=null}if(typeof this[Ge]=="function")try{this[Ge](this[me].value)}catch{}}[wr](e){if(e.opsType===j.Open){let t=!1;const r=this[b].length-1;for(let n=r;n>=0;n--){const i=this[b][n];if(e.root==i.root){if(e.path===i.path){this[b].splice(n,1,e),t=!0;continue}e.active&&(i.active=!1)}}t||this[b].push(e)}else this[b].push(e)}[Qe](){let e=[];for(let t of this[b]){let r=P.clone(t,!0);e.push(r)}return e}[Ke](e){if(!this[b])return;let t=-1;for(let r=0;r<this[b].length;r++)if(P.isSame(this[b][r],e)){t=r;break}if(t!=-1){let r=this[b][t];this[b].splice(t,1),this[xr](r,r.session)}}set historyMonitor(e){this[F]&&(this[F].historyMonitor=e)}get historyMonitor(){return this[F]?this[F].historyMonitor:!1}set traceless(e){this[F]&&(this[F].traceless=e)}get traceless(){return this[F]?this[F].traceless:!1}set propsFilter(e){this[At]=e}get propsFilter(){return this[At]}setRestorePoint(){const e=this[Qe]();this[F]?.setRestorePoint(e)}onRouteUpdated(e){this[Ge]=e}onError(e){this[Xe]=e}beforeEach(e){this[$e].push(e)}removeBeforeEach(e){const t=this[$e].indexOf(e);return t!==-1?(this[$e].splice(t,1),!0):!1}afterEach(e){this[je].push(e)}removeAfterEach(e){const t=this[je].indexOf(e);return t!==-1?(this[je].splice(t,1),!0):!1}destroyEach(e){this[qe].push(e)}removeDestroyEach(e){const t=this[qe].indexOf(e);return t!==-1?(this[qe].splice(t,1),!0):!1}beforeRestoreEach(e){this[F]?.beforeRestoreEach(e)}removeBeforeRestoreEach(e){return this[F]?.removeBeforeRestoreEach(e)??!1}addRoutes(e){for(let t of e)this.addRoute(t)}addRoute(e,t=-1){if(e.path===this[Ft]){this.setNotFoundRoute(e);return}const r=this[We](e);if(t==-1)this[k]=[...this[k],...r];else for(let n=r.length-1;n>=0;n--)this[k].splice(t,0,r[n])}removeRoute(e){const t=this[D](e);if(t===null)return console.warn("route格式错误",e),!1;for(let r=0;r<this[k].length;r++){const n=this[k][r];if(t?.path&&n.path===t.path)return this[k].splice(r,1),!0;if(t?.name&&n.name===t.name)return this[k].splice(r,1),!0}return!1}hasRoute(e){const t=this[D](e);return t===null?(console.warn("route格式错误",e),!1):this[k].findIndex(n=>{if(t?.path&&n.path===t.path||t?.name&&n.name===t.name)return!0})!==-1}setNotFoundPath(e){this[Ft]=e}setNotFoundRoute(e){const t=this[We](e);this[Ye]=t[0]}getRoutes(){return[...this[k]]}[We](e){let t=e.path??"";t.length>0&&t.charAt(0)!=="/"&&(t=`/${t}`);let r=e.components??(e.component&&{"":e.component});if(r==null){const a=new vt;return a.path=t,a.redirect=e.redirect,[a]}let n=[];for(let a in r){let l=r[a];a.length===0&&(a=te);let u=new Rs(a,l,e.props,e.meta);n.push(u)}let i=!1,o=[];if(e.children)for(let a of e.children){let l=this[We](a);for(let u of l){let f=new vt;f.name=u.name,u.path&&u.path.length>0?t!=="/"?f.path=`${t}${u.path}`:f.path=u.path:(i=!0,f.path=t);let c=new nr;c.models=[...n],f.layers=[c,...u.layers],o.push(f)}}if(!i){const a=new nr;a.models=n;const l=new vt;l.name=e.name,l.path=t,l.layers=[a],o.splice(0,0,l)}return o}[ze](e){const t=e.route;try{for(let r of this[k]){const n=t.template??t.path,i=t.template??t.name;if(n&&r.path){let o=r.match;o||(o=r.match=Os(r.path));const a=o(n);if(!a)continue;if(r.redirect){const l=new P;_(!0,l,t),l.path=r.redirect;const u={route:l,find:void 0};return this[ze](u)?(e.route=u.route,e.find=u.find,t.template&&e.find&&(e.find={...e.find},e.find.path=t.path),!0):!1}if(t.params=t.params??{},_(!0,t.params,a.params),t.query){const l=t.query;if(typeof l=="string"){const u={},f=l.split("&");for(let c of f){const h=c.split("=");if(h.length!==2)continue;const y=decodeURIComponent(h[0].trim()),d=decodeURIComponent(h[1].trim());u[y]=d}_(!0,t.params,u)}else typeof l=="object"&&_(!0,t.params,l)}return e.find=r,t.template&&e.find&&(e.find={...e.find},e.find.path=t.path),!0}else if(i===r.name){t.params=t.params??{};const o=qs(r.path);return t.path=o(t.params),e.find=r,t.template&&e.find&&(e.find={...e.find},e.find.name=t.name),!0}}}catch(r){console.error(r.message,r),typeof t.error=="function"&&t.error(r.message)}return!1}[D](e){let t=null;if(Array.isArray(e))if(t=new P,typeof e[0]=="object")t=P.from(e[0]);else for(let r=0;r<e.length;r++)r===0?e[r].charAt(0)==="/"?t.path=e[r]:t.name=e[r]:r===1?t.params=e[r]:r===2?t.root=e[r]:r===3&&_(!1,t,e[r]);else typeof e=="object"?t=P.from(e):typeof e=="string"&&(t=new P,e.charAt(0)=="/"?t.path=e:t.name=e);if(t){if(t.path){let r=t.path.indexOf("?");r!==-1&&r<t.path.length-1&&(t.query=t.path.substring(r+1),t.path=t.path.substring(0,r))}t.root=t.root??te,t.opsType=t.opsType??this.options.defaultOperationType??j.Push,t.traceless&&!t.historyUpdatePolicy&&(t.historyUpdatePolicy="traceless")}return t}push(...e){const t=this[D](e);return t?(t.opsType=j.Push,t.historyUpdatePolicy=t.historyUpdatePolicy??"push",this.to(t)):(this[L]("resolve route fail",t),this)}put(...e){const t=this[D](e);return t?(t.opsType=j.Put,t.historyUpdatePolicy=t.historyUpdatePolicy??"traceless",this.to(t)):(this[L]("resolve route fail",t),this)}replace(...e){const t=this[D](e);return t?(t.opsType=j.Replace,t.historyUpdatePolicy=t.historyUpdatePolicy??"replace",this.to(t)):(this[L]("resolve route fail",t),this)}append(...e){const t=this[D](e);return t?(t.opsType=j.Append,t.historyUpdatePolicy=t.historyUpdatePolicy??"push",this.to(t)):(this[L]("resolve route fail",t),this)}remove(e,t){return new Promise(r=>{this[ve].post(n=>{try{if(this[b].length===0){n.resolve(),r(!1);return}let i=-1,o,a=[];if(e){if(e.root?o=e.root:o=this[b][0].root??te,e.all)for(let u=this[b].length-1;u>0;u--){let f=this[b][u];f.opsType===j.Append&&f.root===o&&(a.splice(0,0,f),i=u-1)}else if(e.until)for(let u=this[b].length-1;u>0;u--){let f=this[b][u];if(f.opsType===j.Append&&f.root===o){if(e.until.charAt(0)==="/"&&e.until===f.path){i=u;break}else if(e.until===f.name){i=u;break}a.splice(0,0,f)}}}else{o=te;let u=this[pr](this[W]);u&&(o=u.name);for(let f=this[b].length-1;f>0;f--){let c=this[b][f];if(c.opsType===j.Append&&c.root===o){a.push(c),i=f-1;break}}}if(a.length===0){let u="can not find route";console.warn(u),n.resolve(u),r(!1);return}let l=null;if(i!==-1&&(l=this[b][i]),this[Le](a)){if(t===!1)return n.resolve(),r(!0),!0;const u=()=>(n.resolve(),r(!0),!0),f=this[b].length;if(l&&P.isSame(l,this[b][f-1])){this[F]?.goBack(l,u);return}u()}}catch(i){this[L](i),n.resolve(),r(!1)}})})}open(...e){let t=this[D](e);return t?(t.opsType=j.Open,t.historyUpdatePolicy=t.historyUpdatePolicy??"push",this.to(t)):(this[L]("resolve route fail",t),this)}close(e){return this[ve].post(t=>{try{let r=this[D](e);if(!r){t.reject("resolve route fail");return}let n=[];for(let i=0;i<this[b].length;i++){let o=this[b][i];if(o.root===r.root){if(!r.path&&!r.name){n.push(o);continue}if(r.path&&r.path===o.path){n.push(o);break}else if(r.name&&r.name===o.name){n.push(o);break}}}if(n.length===0){t.resolve();return}this[Le](n)&&this[Je](),t.resolve()}catch(r){this[L](r),t.resolve()}}),this}to(...e){let t=this[D](e);if(!t)return this[L]("resolve route fail",t),this;let r=this[Oe].acquire(t);return r==null?(this[L]("route forbid",t),this):(this[ve].post(n=>{try{let i=this[Kt](t);this[$t](i),this[qt](i),this[jt](i),i.wait((o,a)=>{const l=o.session.to;if(o.session.updateResult&&o.session.updateResult.status==="success")try{let u=P.clone(l,!0);const f=new fr(u,this[Qe]());l.historyUpdatePolicy==="replace"?this[F]?.replace(f):l.historyUpdatePolicy==="traceless"?this[F]?.setRouteMark(f):this[F]?.push(f)}catch(u){console.error(u.message,u)}if(this[Oe].release(r),this[Je](l),typeof t.success=="function")try{Reflect.apply(t.success,{},[])}catch(u){console.error(u.message,u)}this[fe]===!1&&this[Ze](!0),n.resolve()},(o,a)=>{this[Oe].release(r),a!==null&&this[L](a,t),this[fe]===!1&&this[Ze](!1),n.resolve()})}catch(i){this[Oe].release(r),this[L](i,t),n.resolve()}}),this)}back(e=1){this[F]?.go(-e,!1)}[br](e){return(t,r)=>{if(typeof t=="boolean")e.session.redirect=!1,t?e.resolve():e.reject(r??null);else if(t){const n=this[D](t);if(n){const i=e.session.to;n.success=i.success,n.error=i.error,e.session.to=n,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()}}[Kt](e){let t=this[b].length>0?this[b][0]:void 0,r=new it(e,t),n={route:e,find:null};return this[ze](n),n.find&&(r.routeModel=n.find,e.matched=Js(n.find),Array.isArray(e.matched)&&e.matched.length>0&&(e.meta=n.find.layers[0].models[0].meta)),new Ne(r)}[$t](e){for(let t of this[$e])e.post(r=>{const n=this[br](r);Reflect.apply(t,{},[r.session.to,r.session.from,n,r.session])})}[jt](e){e.post(t=>{for(let r of this[je])try{Reflect.apply(r,{},[t.session.to,t.session.from,t.session])}catch(n){console.error(n.message,n)}t.resolve()})}[xr](e,t){for(let r of this[qe])try{Reflect.apply(r,{},[e,t])}catch(n){console.error(n.message,n)}typeof e.destroy=="function"&&Reflect.apply(e.destroy,e,[])}[qt](e){e.post(t=>{let r=t.session.to,n=t.session.routeModel;if(n==null){let o={route:r,find:null};if(this[ze](o))n=o.find,t.session.routeModel=n;else if(this[Ye])n=this[Ye];else{t.reject(`not find route model, path:${r.path??r.name}`);return}}let i=it.from(t.session);this[mr](r,n,i).then(o=>{this[W],t.session.updateResult=o??{status:"success",message:""},t.resolve()},o=>{t.reject(o)})})}[Le](e){if(e.length==0)return!0;let t=this[W],r=[];for(let n of e){let i=this[Et](t,n);i!=null&&r.push({...i,route:n})}if(r.length==0){let n="can not find view index";return this[L](n),!1}for(let n of r.reverse())this[ue](t,{x:n.x,y:n.y},[n.route.index??0],!0);return!0}[Et](e,t){const r=t.root??te;let n;for(let i=0;i<e.layers.length;i++){const o=e.layers[i];for(let a=o.views.length-1;a>=0;a--){const l=o.views[a];if(l[Q]&&l[tt]===r)return n={x:a,y:i},n}}return null}[pr](e){return e.layers.length>0&&e.layers[0].views.length>0?e.layers[0].views[0]:null}[ue](e,t,r=null,n=!0){if(t.y>=e.layers.length||t.x>=e.layers[t.y].views.length)return;let i=e.layers[t.y].views[t.x],o=!1,a=[],l=!1,u=[...i.slots.value];for(let c=u.length-1;c>=0;c--){let h=u[c];(!r||r.indexOf(h.index)!=-1)&&(h.route&&i[Q]&&(this[Ke](h.route),h.active===!0&&h.route.opsType==j.Append&&(l=!0)),a.push(new V(i,h.index,t.y)),u.splice(c,1))}if(u.length==0)n?i.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)}i.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 y=c.length-1;(o||a.length>0)&&y>=0;y--){let d=c[y];if(d[ce]&&(o||V.include(a,d[ce]))){let m=d.slots.value;for(let p=m.length-1;p>=0;p--){let v=m[p];v.route&&d[Q]&&this[Ke](v.route),h.push(new V(d,v.index,f)),m.splice(p,1)}e.layers[f].views.splice(y,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 r=t.layers[0].views;r.length>0&&(r[0].slots.value=[])}return this[b]=[],this[Je](),Promise.resolve()}else return new Promise((r,n)=>{let i=null,o=!1;for(let a=0;a<e.length;a++){const l=e[a];this[ve].post(u=>{const f=this[Kt](l);this[$t](f),this[qt](f),this[jt](f),f.wait((c,h)=>{i=c.session.to,o=c.session.redirect,u.resolve()},(c,h)=>{i=null,h!==null&&this[L](h),u.resolve()})})}this[ve].post(a=>{if(i&&o===!0){const l=P.clone(i,!0),u=new fr(l,this[Qe]());this[F]?.replace(u)}a.resolve(),r()})})}[mr](e,t,r){const n=e.updateType??et.Part;return this[vr](t).then(()=>{const o=this[gr](t,e,r,n);if(o.status==="error")throw Error(o.message);return o})}[vr](e){let t=[];for(let r=0;r<e.layers.length;r++){let n=e.layers[r];for(let i=0;i<n.models.length;i++){let o=n.models[i];o.isResolved||t.push(o.resolve())}}return t.length>0?Promise.all(t):Promise.resolve()}[gr](e,t,r,n){if(e.layers[0].models.length!==1)return{status:"error",message:"illegal route structure(multi root node)"};const i=e.layers[0].models[0];let o=this[W],a=zs(o),l=t.root??te,u;!a&&n==et.Part&&(u=this[Et](o,t));let f,c=0;if(u==null||u==null)if(a||n===et.All){if(o.layers.length==0&&(o.layers[0]=new Rt),o.layers[0].views.length==0){let h=t.root??te;f=new Ae(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{status:"error",message:"can not rebuild view(because not route slot)"};let y=h.level;if(y>o.layers.length)return{status:"error",message:"can not insert view(override level)"};let d;if(h.rootName){let m=o.layers[y-1];for(let p of m.views){if(p[Q]&&p.name===h.rootName){d=new V(p,h.rootIndex??0,y-1);break}if(p[G]&&p[G].view.name===h.rootName&&p[G].index===h.rootIndex){d=p[G];break}}}if(!d)return{status:"error",message:"can not insert view(not find root node ref)"};f=new Ae(l,!0,d),o.layers[y].views.push(f),u={x:o.layers[y].views.length-1,y}}else f=o.layers[u.y].views[u.x];if(c=u.y,f[Q]=!0,t.opsType===j.Append){t.index=t.index??le.get(),t.active=!0;let h=f.slots.value;if(h.length>0){let v=h[h.length-1];v.active=!1,v.route&&(v.route.active=v.active)}let y=new se(t,i,t.index,!0);f.slots.value=[...h,y];let d=c+1,m=1,p=new V(f,t.index,c);this[ne](o,d,e,m,p)}else if(t.opsType===j.Open){let h=f.slots.value;const y=t.active??!0;let d=!1;for(let m of h){if(m.route!==null&&P.isSameForRouteModel(m.route,t)){if(m.active===y)return t.index=m.index,t.active=y,m.route=t,{status:"no-change",message:""};m.active=y,d=!0,t.index=m.index,t.active=y,m.route=t}else y&&(m.active=!1);m.route&&(m.route.active=m.active)}if(!d){t.index=t.index??le.get(),t.active=y;let m=new se(t,i,t.index,y);h.push(m);let p=c+1,v=1,g=new V(f,t.index,c);this[ne](o,p,e,v,g)}f.slots.value=[...h]}else{let h=f.slots.value;if(h.length==0){t.index=t.index??le.get(),t.active=!0,f.slots.value=[new se(t,i,t.index)];let y=c+1,d=1,m=new V(f,t.index,c);this[ne](o,y,e,d,m)}else{let y=h[0];if(y.model!==i){this[ue](o,u,null,!0),t.index=t.index??le.get(),t.active=!0,f.slots.value=[new se(t,i,t.index)];let d=c+1,m=1,p=new V(f,t.index,c);this[ne](o,d,e,m,p)}else{y.route!==null&&this[Ke](y.route);let d=!1;const m=t.active??!0;y.active!==m&&(y.active=m,d=!0),t.active=m,t.index=y.index,y.route=t;let p=[];for(let $=1;$<h.length;$++)p.push(h[$].index);p.length>0?this[ue](o,u,p,!0):d&&(f.slots.value=[...h]);let v=[new V(f,t.index,c)],g=c+1,K=1,x=new V(f,t.index,c);for(;v.length>0&&g<o.layers.length&&K<e.layers.length;g++,K++){let $=[];for(let E=0;E<o.layers[g].views.length;E++){let C=o.layers[g].views[E];C[ce]&&V.include(v,C[ce])&&$.unshift(E)}let A=[];for(let E of $){let C=o.layers[g].views[E],z=e.layers[K].models,I;for(let N=0;N<z.length;N++)if(C.name===z[N].name){I=z[N];break}if(!I)this[ue](o,{x:E,y:g},null,!1);else{let N=C.slots.value;if(N.length==0){let Y=0;C.slots.value=[new se(null,I,Y)];let J=g+1,re=K+1;this[ne](o,J,e,re,x)}else{let Y=N[0];if(Y.model!==I){this[ue](o,{x:E,y:g},null,!0),C.slots.value=[new se(null,I,0)];let J=g+1,re=K+1;this[ne](o,J,e,re,x)}else{C[Q]&&Y.route!==null&&this[Ke](Y.route);let J=[];for(let re=1;re<N.length;re++)J.push(N[re].index);J.length>0&&this[ue](o,{x:E,y:g},J,!0),A.push(new V(C,Y.index,g))}}C[Q]=!1}}v=A}this[ne](o,g,e,K,x)}}}if(f&&f[G]){let h=f[G];h&&(t.slot=new xs(l,c,h?.view.name,h?.index??0))}return r.to=void 0,r.routeModel=void 0,t.session=r,this[wr](t),{status:"success",message:""}}[ne](e,t,r,n,i){let o=n,a=t;for(;a<e.layers.length&&o<r.layers.length;a++,o++){let l=e.layers[a].views;for(let u of r.layers[o].models){let f=new Ae(u.name,!1,i),c=new se(null,u);f.slots.value=[c],l.push(f)}}for(;o<r.layers.length;o++){let l=new Rt;l.views=[];for(let u of r.layers[o].models){let f=new Ae(u.name,!1,i),c=new se(null,u);f.slots.value=[c],l.views.push(f)}e.layers.push(l)}}[_r](e,t,r,n,i,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 y=!1;if(r!==null?(y=h.name===e&&h[G]?.view===r,y&&n!==-1&&(y=h[G]?.index===n)):y=h.name===e,!!y){i!==null&&(h[ce]={view:i,index:o,level:t-1}),c=h;break}}if(c!==null)return c}let a=null,l=null;i!==null&&(i[Q]?a={view:i,index:o,level:t-1}:a=i[G],l={view:i,index:o,level:t-1});let u=new Ae(e,!0,a);if(u[ce]=l,t==this[W].layers.length){let f=new Rt;f.views=[u],this[W].layers.push(f)}else this[W].layers[t].views.push(u);return u}}const Qs="fox-router-view",Xs="fox-router-link";function Br(s,e=!1){let t=null;return e?t=s.showFromClass??s.enterFromClass:t=s.enterFromClass,t||(t=s.transitionName,t?e?`${t}-show-from`:`${t}-enter-from`:null)}function Vr(s,e=!1){let t=null;return e?t=s.showActiveClass??s.enterActiveClass:t=s.enterActiveClass,t||(t=s.transitionName,t?e?`${t}-show-active`:`${t}-enter-active`:null)}function Ys(s,e=!1){let t=null;return e?t=s.showToClass??s.enterToClass:t=s.enterToClass,t||(t=s.transitionName,t?e?`${t}-show-to`:`${t}-enter-to`:null)}function kr(s,e=!1){let t=null;return e?t=s.hideFromClass??s.leaveFromClass:t=s.leaveFromClass,t||(t=s.transitionName,t?e?`${t}-hide-from`:`${t}-leave-from`:null)}function Wr(s,e=!1){let t=null;return e?t=s.hideActiveClass??s.leaveActiveClass:t=s.leaveActiveClass,t||(t=s.transitionName,t?e?`${t}-hide-active`:`${t}-leave-active`:null)}function Zs(s,e=!1){let t=null;return e?t=s.hideToClass??s.leaveToClass:t=s.leaveToClass,t||(t=s.transitionName,t?e?`${t}-hide-to`:`${t}-leave-to`:null)}function en(s,e=!1){let t=null;return e?t=s.beforeShow??s.beforeEnter:t=s.beforeEnter,t}function tn(s,e=!1){let t=null;return e?t=s.show??s.enter:t=s.enter,t}function rn(s,e=!1){let t=null;return e?t=s.afterShow??s.afterEnter:t=s.afterEnter,t}function sn(s,e=!1){let t=null;return e?t=s.showCancelled??s.enterCancelled:t=s.enterCancelled,t}function nn(s,e=!1){let t=null;return e?t=s.beforeHide??s.beforeLeave:t=s.beforeLeave,t}function on(s,e=!1){let t=null;return e?t=s.hide??s.leave:t=s.leave,t}function ln(s,e=!1){let t=null;return e?t=s.afterHide??s.afterLeave:t=s.afterLeave,t}function an(s,e=!1){let t=null;return e?t=s.hideCancelled??s.leaveCancelled:t=s.leaveCancelled,t}function Qt(s){let e,t=s.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 Pe(s,e){s.classList.contains(e)||s.classList.add(e)}function Re(s,e){s.classList.remove(e)}const un=Se&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout;function ht(s){un(s)}function M(s,e,t){R(e)&&(s==null&&(s={}),Reflect.apply(e,s,t))}function zr(s,e,t,r=-1,n,i,o,a){if(R(i)){if(n!==void 0&&n>=0){setTimeout(()=>{Reflect.apply(i,s,[e,t,r]),R(a)&&Reflect.apply(a,s,[])},n);return}const l=["animationend","transitionend",ot],u=f=>{const c=f.target||f.srcElement,h=f.currentTarget;c===h&&(l.forEach(y=>{nt(e,y,u)}),Reflect.apply(i,s,[e,t,r]),a&&Reflect.apply(a,s,[]))};l.forEach(f=>{st(e,f,u)})}if(R(o)){const l="animationcancel",u=f=>{const c=f.target||f.srcElement,h=f.currentTarget;c===h&&(nt(e,l,u),Reflect.apply(o,s,[e,t,r]))};st(e,l,u)}}function yt(s){return!Se||s===null?!1:s.opsType===j.Append||s.opsType===j.Open}function Jr(s,e,t,r={},n,i=-1){if(e||yt(n)){const o=Br(r,e);o&&Pe(t,o);const a=Vr(r,e);a&&Pe(t,a);const l=en(r,e);M(s,l,[t,e,n,i])}}function Gr(s,e,t,r={},n,i,o,a){if(!yt(i)&&!e){R(a)&&a(s,a,[t]);return}const l=Br(r,e),u=Vr(r,e),f=Ys(r,e),c=tn(r,e),h=rn(r,e),y=sn(r,e);if(!l&&!u&&!f&&!c){R(a)&&a(s,a,[t]);return}ht(()=>{zr(s,t,i,o,n,()=>{u&&Re(t,u),f&&Re(t,f),R(h)&&M(s,h,[t,e,i,o]),R(a)&&a(s,a,[t])},()=>{R(y)&&M(s,y,[t,e,i,o])}),l&&Re(t,l),f&&Pe(t,f),R(c)&&M(s,c,[t,e,i,o])})}function Qr(s,e,t,r={},n,i=-1){if(e||yt(n)){const o=kr(r,e);o&&Pe(t,o);const a=Wr(r,e);a&&Pe(t,a);const l=nn(r,e);M(s,l,[t,e,n,i])}}function Xr(s,e,t,r={},n,i,o,a,l){if(!yt(o)&&!e){!e&&R(i)&&i();return}const u=kr(r,e),f=Wr(r,e),c=Zs(r,e),h=on(r,e),y=ln(r,e),d=an(r,e);if(!u&&!f&&!c&&!h){!e&&R(i)&&i();return}ht(()=>{zr(s,t,o,a,n,()=>{f&&Re(t,f),c&&Re(t,c),R(y)&&M(s,y,[t,e,o,a]),R(l)&&M(s,l,[t]),!e&&R(i)&&i()},()=>{R(d)&&M(s,d,[t,e,o,a]),R(l)&&M(s,l,[t]),!e&&R(i)&&i()}),u&&Re(t,u),c&&Pe(t,c),R(h)&&M(s,h,[t,e,o,a])})}function Dt(s,e={},t,r=-1){const n=e.mode??"default",i=Qt(e);return{mode:n,persisted:!1,beforeEnter:a=>{Jr(s,!1,a,e,t,r)},enter:a=>{Gr(s,!1,a,e,i.enter,t,r)},leave:(a,l)=>{Qr(s,!1,a,e,t,r),Xr(s,!1,a,e,i.leave,l,t,r)},clone:a=>Dt(s,e,t,r)}}function Yr(s){return s.el}function fn(s,e,t={},r,n,i,o){if(i===!0){const a=Yr(e);if(a==null)return;const l=Qt(t);Jr(s,!0,a,t,r,n),Gr(s,!0,a,t,l.show,r,n,u=>{R(o)&&M(s,o,[u])})}else R(o)&&M(s,o,[])}function cn(s,e,t={},r,n,i,o){if(i===!0){const a=Yr(e);if(a==null)return;const l=Qt(t);Qr(s,!0,a,t,r,n),Xr(s,!0,a,t,l.hide,null,r,n,u=>{R(o)&&M(s,o,[u])})}else R(o)&&M(s,o,[])}function hn(s,e={}){ht(()=>{for(let t=0;t<s.length;t++)Reflect.apply(s[t],e,[])})}function Zr(s,e={},t,r=-1){return{mode:e.mode??"default",persisted:!1,beforeEnter:o=>{Ue(Kr,{},o)},enter:o=>{Ue($r,{},o)},leave:(o,a)=>{Ue(jr,{},o),ht(()=>{const l=u=>{const f=u.target||u.srcElement,c=u.currentTarget;f===c&&(nt(o,ot,l),a&&Reflect.apply(a,s,[]))};st(o,ot,l),Ue(qr,{},o)})},clone:o=>Zr(s,e,t,r)}}function ie(s,e,t){return typeof s=="function"?Reflect.apply(s,{},[e,t]):s}function Lt(s,e){if(!s)return null;const t=s(e);return t.length===1?t[0]:t}function ge(s,e){return typeof e=="function"?e(s):s}class yn{node;state;constructor(e,t){this.node=e,this.state=t}}const Ut=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(s,e){const t=w.getCurrentInstance();if(t===null||t.proxy===null){console.error("instance or instance.proxy not exist");return}const r=s.multi===!0,n=w.inject(ct,null),i=w.inject(wt,0),o=w.inject(ar,null),a=w.inject(bt,-1);let l=null;const u=s.modelSlot;if(u){if(w.provide(wt,i+1),w.provide(bt,u.index),w.provide(xt,u.index),!u.route){console.warn("child view render error, route not exist");return}const h=lt(t.proxy,!0);Fs(h),lr(h,()=>u.route??null)}else{if(n==null){console.error("router is not been injected");return}const c=s.name,h=w.inject(ur,null),y=w.inject(xt,0);if(l=n[_r](c,i,o,a,h,y),l===null)return;w.provide(ur,l);const d=l[Q]===!0;if(d&&w.provide(ar,l),!r&&(w.provide(bt,-1),w.provide(wt,i+1),w.provide(xt,-1),d)){const m=lt(t.proxy,!0);lr(m,()=>{const p=l.slots.value;return p.length>0?p[0].route:null})}}const f={value:new Map};return w.onUnmounted(()=>{f.value&&f.value.clear()}),()=>{if(r){const c=new Map,h=[],y=l?.slots.value,d=[];for(let v=0;v<y.length;v++){const g=y[v],K=`${s.name}_${g.index}`,x=ie(s.transition,g.route,v)??!0,$={modelSlot:g};let A;e.slots.default?A=w.h(Ut,$,{default:e.slots.default}):A=w.h(Ut,$);const E={},C=ie(s.viewClass,g.route,v);typeof C=="string"&&C.length>0&&(E[C]=!0);const z=ie(s.viewActiveClass,g.route,v),I=ie(s.viewInactiveClass,g.route,v),N=f.value.get(K);if(typeof z=="string"&&z.length>0&&(E[z]=g.active),typeof I=="string"&&I.length>0&&(E[I]=!g.active),N&&g.active!==N.state){const U=N.node;g.active?d.unshift(()=>{const dt=()=>{let Ee=ir(U);Ee!=null&&or(Ee,Ht.ACTIVATED)};fn(t,U,s,g.route,v,x,dt)}):d.push(()=>{const dt=()=>{const Ee=ir(U);Ee!=null&&or(Ee,Ht.DEACTIVATED)};cn(t,U,s,g.route,v,x,dt)})}const Y={class:E,key:K},J=ie(s.viewTagProps,g.route,v);if(J!==null&&typeof J=="object"){const U=ge(J,n?.propsFilter);_(!0,Y,U)}if(g.route?.viewTagAttrs&&typeof g.route?.viewTagAttrs=="object"){const U=ge(g.route.viewTagAttrs,n?.propsFilter);_(!0,Y,U)}const re=ie(s.viewTag,g.route,v),He=w.h(re,Y,{default:()=>[A]});if(c.set(K,new yn(He,g.active)),f.value.delete(K),x===!0){const U=Dt(t,s,g.route,v);He.transition=U}else if(x==="custom"){const U=Zr(t,s,g.route,v);He.transition=U}h.push(He)}f.value=c,hn(d,t);const m=ie(s.tag,null,-1),p={};return Object.assign(p,e.attrs),w.h(m,p,{default:()=>h})}else if(u!=null){const c=u.model,h={};if(c.props){if(typeof c.props=="object"){const d=ge(c.props,n?.propsFilter);_(!1,h,d)}else if(c.props===!0&&typeof u.route?.params=="object"){const d=ge(u.route.params,n?.propsFilter);_(!1,h,d)}}const y=w.h(c.component,h);return Lt(e.slots.default,{Component:y,route:u.route})??y}else{const c=l.slots.value;if(c.length>0){const h=c[0],y=h.route??(t.proxy&&Jt(t.proxy))??null,d=h.model,m={};if(d.props){if(typeof d.props=="object"){const g=ge(d.props,n?.propsFilter);_(!1,m,g)}else if(d.props===!0&&typeof y?.params=="object"){const g=ge(y.params,n?.propsFilter);_(!1,m,g)}}const p=w.h(d.component,m);if(ie(s.transition,y,-1)??!0){const g=Dt(t,s,y,-1);p.transition=g}return Lt(e.slots.default,{Component:p,route:y})??p}else return Lt(e.slots.fallback,{})}}}});function dn(s){if(!(s.metaKey||s.altKey||s.ctrlKey||s.shiftKey)&&!s.defaultPrevented&&!(s.button!=null&&s.button!==0)){if(s.currentTarget&&s.currentTarget.getAttribute){const e=s.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return s.preventDefault&&s.preventDefault(),!0}}function pn(s,e){return s==null||e==null?!1:!!(s===e||s.path&&s.path===e.path||s.name&&s.name===e.name)}function mn(s,e){return s==null||e==null?!1:!!(s.path&&e.path&&e.path.startsWith(s.path)||s.name&&s.name==e.name)}function we(s,e){return typeof s=="function"?Reflect.apply(s,{},[e]):s}let vn=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(s,e){const t=w.inject(ct,null);return()=>{let r=we(s.to,null),n=we(s.tag,r);if(n==null){console.warn("can not resolve link tag");return}let i=null,o=null;t!==null&&(i=t[D](r),s.root&&(i.root=s.root),o=t.current);let a={},l=we(s.activeClass,i);if(typeof l=="string"&&l.length>0&&(a[l]=mn(i,o)),we(s.exact,i)===!0){let h=we(s.exactActiveClass,i);typeof h=="string"&&h.length>0&&(a[h]=pn(i,o))}let f={class:a};(n==="a"||n==="A")&&(f.href=i?.path??i?.name??"#"),_(!0,f,e.attrs);let c=we(s.event,i);if(typeof c=="string"){const h=y=>{if(t==null){console.warn("router is not been injected");return}if(i==null){console.warn("route is not been resolved");return}dn(y)&&t.to(i)};f[c]=h}return w.h(n,f,e.slots)}}});var O=(s=>(s[s.Loading=0]="Loading",s[s.Loaded=1]="Loaded",s[s.Defining=2]="Defining",s[s.Defined=3]="Defined",s))(O||{}),rt=(s=>(s[s.normal=0]="normal",s[s.factory=1]="factory",s))(rt||{});class gn{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 Rr{moduleManager=new gn;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 De().head}constructor(){}setModule(e,t){const r={id:e,src:"",status:O.Defined};typeof t=="function"?(r.exports=t,r.type=rt.factory):r.exports=t,this.moduleManager.set(e,r)}removeModule(e){this.moduleManager.remove(e)}ensure(...e){const t=[];let r=e.length-1;const n={};typeof e[r]=="object"&&(Object.assign(n,e[r]),r--);let i=null;typeof e[r]=="function"&&(i=e[r],r--);for(let l=0;l<=r;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 wn(t.length,(l,u)=>{if(o.isOK())try{typeof i=="function"&&Reflect.apply(i,{},u)}catch(f){console.error(f.message,f)}else try{console.error(l),typeof i=="function"&&Reflect.apply(i,{},[])}catch(f){console.error(f.message,f)}}),a=new Ne;for(let l=0;l<t.length;l++){const u=new bn(l,t[l],n,o);this.mount(a,u)}return this}remove(...e){let t=[],r=e.length-1,n={};typeof e[r]=="object"&&(Object.assign(n,e[r]),r--);let i=null;typeof e[r]=="function"&&(i=e[r],r--);for(let o=0;o<=r;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,n)}),typeof i=="function"&&Reflect.apply(i,{},[]),this}mount(e,t){if(t.src==="exports"){e.post(n=>{t.progress.work(!0,t.index,"exports"),n.resolve()});return}else if(t.src==="module"){e.post(n=>{t.progress.work(!0,t.index,"module"),n.resolve()});return}if(this.isNaturePath(t.src)){let n=t.params.jsPoint;n||(n=this.head),this.mountJS(e,t,n);return}else if(this.isNaturePath(t.src)){let n=t.params.cssPoint;n||(n=this.head),this.mountCSS(e,t,n);return}let r=this.getFileNamePostfix(t.src);if(r==="js"||r.length===0){let n=t.params.jsPoint;n||(n=this.head),this.mountJS(e,t,n);return}else if(r==="css"){let n=t.params.cssPoint;n||(n=this.head),this.mountCSS(e,t,n);return}}mountCSS(e,t,r){e.post(n=>{const i=t.src,o=this.moduleManager.get(i);if(o&&(o.status==O.Defined||o.status==O.Loaded)&&o.exports){o.type===rt.factory&&typeof o.exports=="function"?t.progress.work(!0,t.index,o.exports()):t.progress.work(!0,t.index,o.exports),n.resolve();return}const a=De(),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),n.resolve()},l.onerror=()=>{try{r.removeChild(l)}catch(c){console.error(c.message,c)}l.onload=null,l.onerror=null,t.progress.work(!1,t.index,null),n.reject()};else{const c={timeout:this.options.timeout??3e3,time:0,success:()=>{t.progress.work(!0,t.index,t.src),n.resolve()},error:()=>{try{r.removeChild(l)}catch(h){console.error(h.message,h)}t.progress.work(!1,t.index,null),n.resolve()}};setTimeout(()=>{es(l,c)},1)}let f=a.getElementById(i);f&&f.parentNode&&f.parentNode.removeChild(f),l.rel="stylesheet",l.type="text/css",l.id=i,l.href=i,r.appendChild(l)})}mountJS(e,t,r){e.post(n=>{const i=t.src;let o=this.moduleManager.get(i);if(o&&(o.status==O.Defined||o.status==O.Loaded)){if(o.exports){o.type===rt.factory&&typeof o.exports=="function"?t.progress.work(!0,t.index,o.exports()):t.progress.work(!0,t.index,o.exports),n.resolve();return}if(document.querySelector(`script[src='${i}`)){t.progress.work(!0,t.index,o.exports),n.resolve();return}}o={id:i,src:i,status:O.Loading},this.moduleManager.set(i,o);const l=De().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,i)),n.resolve()},l.onerror=()=>{try{r.removeChild(l)}catch(c){console.error(c.message,c)}l.onload=null,l.onerror=null,this.moduleManager.remove(i),t.progress.work(!1,t.index,null),n.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,i)),n.resolve())}}l.defer=!0,l.src=i;const f=q();f.define=this.createDefine(o,t),r.appendChild(l)})}unmount(e,t={}){const r=De(),n=this.getFileNamePostfix(e);if(n==="js"||n.length===0){const i=r.querySelector(`script[src="${e}"]`);i&&i.parentNode&&i.parentNode.removeChild(i),this.moduleManager.remove(e);return}else if(n==="css"){const i=r.querySelector(`style[href="${e}"]`);i&&i.parentNode&&i.parentNode.removeChild(i);return}}trimEmptyElement(e){let t=[];for(let r=0;r<e.length;r++){if(e[r]===void 0||e[r]===null)continue;const n=e[r].trim();n.length!==0&&t.push(n)}return t}createDefine(e,t){const r=this,n=function(...i){e.status=O.Defining;let o,a,l,u=i.length;u===1?(l=i[0],o=void 0):u===2?(l=i[1],Array.isArray(i[0])?(a=r.trimEmptyElement(i[0]),o=void 0):a=void 0):(o=i[0],a=r.trimEmptyElement(i[1]),l=i[2]),o&&(e.id=o,r.options.alias[o]=e.src),a&&a.length>0?r.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 n.amd=!0,n}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 r=this.createSearch(this.query);return e.indexOf("?")==-1?(t!=="js"&&t!=="css"&&(e+=".js"),r.length>0&&(e+=`?${r}`)):r.length>0&&(e+=`&${r}`),e}catch(t){throw console.error(`resolve path[${e}] fail`,t),t}}createSearch(e){let t="";if(e){for(let r in e){let n=`${e[r]}`;t+=`${encodeURIComponent(r)}=${encodeURIComponent(n)}&`}t.length>0&&(t=t.substring(0,t.length-1))}return t}getFileNamePostfix(e){let t=e.lastIndexOf("?");t==-1&&(t=e.length);let r=e.lastIndexOf(".",t);return r==-1?"":e.substring(r+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 r=0;r<t.length;r++){const n=t[r];if(e.indexOf(n)===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`${pt()}${e.slice(1)}`;if(e.indexOf("./")==0)return`${pt()}${e.slice(2)}`;if(e.indexOf("//")==0)return`${q().location.protocol}${e}`;if(t){let n=this.options.alias[e];if(!n){let i=e.indexOf("/");if(i==-1)n=e;else{let o=e.slice(0,i),a=this.options.paths[o];a?n=a+e.slice(i):n=e}}return this.parserPath(n,!1)}return`${pt()}${e}`}}function es(s,e){let t=s.sheet,r=!1;if(e.isOldWebKit)t&&(r=!0);else if(t)try{t.cssRules&&(r=!0)}catch(n){n.name==="NS_ERROR_DOM_SECURITY_ERR"&&(r=!0)}setTimeout(()=>{e.time+=20,r?e.success():e.timeout>e.timeout?e.error():es(s,e)},20)}class wn{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,r){if(this.status=e,this.status===!0&&(this.lastIndex!==t&&this.size--,this.lastIndex=t,this.values.push(r)),this.size===0||this.status===!1)try{Reflect.apply(this.callback,this,[this.status,this.values])}catch(n){console.error(n.message,n)}}isOK(){return this.status}}class bn{index;src;params;progress;constructor(e,t,r,n){this.index=e,this.src=t,this.params=r,this.progress=n}}const Xt=Symbol("fk"),Yt=Symbol("fbk"),Zt=Symbol("fepk");function xn(s={}){const e=new Gs(s),t=new It,r=new Nt,n=new Rr,i={get router(){return e},get bus(){return t},get Bus(){return It},get EventProxy(){return Nt},get eventproxy(){return r},get EventChain(){return Ne},get Require(){return Rr},get require(){return n},get extend(){return _},get clone(){return ft},get isESModule(){return Bt},install(o){o.provide(ct,e),o.provide(Xt,i),o.provide(Yt,t),o.provide(Zt,r),o.component(Qs,Ut),o.component(Xs,vn),Reflect.defineProperty(o.config.globalProperties,"$fox",{get(){return i}}),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 r}}),o.config.globalProperties.$fox_on=function(a,l,u=!1){r.on(a,l,u)},o.config.globalProperties.$fox_off=function(a,l){r.off(a,l)},o.config.globalProperties.$fox_once=function(a,l){r.once(a,l)},o.config.globalProperties.$fox_all=function(...a){let l=r;Reflect.apply(l.all,l,a)},o.config.globalProperties.$fox_trigger=function(a,...l){let u=r;Reflect.apply(u.trigger,u,[a,...l])},o.config.globalProperties.$fox_emit=function(a,...l){let u=r;Reflect.apply(u.trigger,u,[a,...l])},o.mixin({computed:{$route(){return Jt(this)}}}),e.init()}};return i}function er(s){return s?s.$router:w.inject(ct)}function Rn(s){return s||(s=w.getCurrentInstance()?.proxy??void 0),s?Jt(s):null}function Sn(s){return s?s.$fox:w.inject(Xt)}function Pn(s){return s?s.$bus:w.inject(Yt)}function En(s){return s?s.$eventProxy:w.inject(Zt)}function Cn(s){const e=er(),t=(r,n,i)=>{try{Reflect.apply(s,{},[r,n])}catch(o){console.error(o)}i()};e.beforeEach(t),w.onUnmounted(()=>{e.removeBeforeEach(t)})}function Fn(s){const e=er(),t=(r,n,i)=>{try{Reflect.apply(s,{},[r,n])}catch(o){console.error(o)}i()};e.afterEach(t),w.onUnmounted(()=>{e.removeAfterEach(t)})}exports.Bus=It;exports.EventChain=Ne;exports.EventProxy=Nt;exports.FoxBeforeEnter=Kr;exports.FoxBeforeLeave=jr;exports.FoxEnter=$r;exports.FoxLeave=qr;exports.FoxLeaveEnd=ot;exports.OperationType=j;exports.Route=P;exports.clone=ft;exports.createFox=xn;exports.createMemoryHistory=Ur;exports.createWebHashHistory=Dr;exports.createWebHistory=ks;exports.deleteContextValue=Cs;exports.extend=_;exports.foxBusKey=Yt;exports.foxEventProxyKey=Zt;exports.foxKey=Xt;exports.injectContextValue=zt;exports.isArray=rs;exports.isDate=is;exports.isESModule=Bt;exports.isEqual=Mt;exports.isFunction=R;exports.isMap=ss;exports.isNil=Pr;exports.isObject=Sr;exports.isPlainObject=Er;exports.isPromise=as;exports.isSet=ns;exports.isString=os;exports.isSymbol=ls;exports.onAfterRouteUpdate=Fn;exports.onBeforeRouteUpdate=Cn;exports.onFoxActivated=Ks;exports.onFoxInactivated=$s;exports.provideContextValue=Es;exports.sessionKey=oe;exports.toBoolean=Vt;exports.toNumber=hs;exports.toTypeString=ut;exports.typeOf=Ot;exports.useBus=Pn;exports.useEventProxy=En;exports.useFox=Sn;exports.useRoute=Rn;exports.useRouter=er;
|
|
2
|
+
* fox v3.1.0 Thu Apr 25 2024 00:11:27 GMT+0800 (中国标准时间)
|
|
3
|
+
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("vue"),ye=typeof window<"u",T=function(){return window},Ue=function(){return window.document};function is(s){let e=s,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 pt(){if(!ye)return"/";let s=T().location,e=`${s.protocol}//${s.host}`;return e+=is(s.pathname),e}function nt(s,e,t,r=!1){s.addEventListener?s.addEventListener(e,t,r):s.attachEvent?s.attachEvent(`on${e}`,t):s[`on${e}`]=t}function it(s,e,t){s.removeEventListener?s.removeEventListener(e,t):s.detachEvent?s.detachEvent(`on${e}`,t):s[`on${e}`]=null}const ke=(s,e,t)=>{e=e??{bubbles:!1,cancelable:!1,detail:void 0};const r=document.createEvent("Events");let n=!0,i=!0;for(let a in e)a==="bubbles"?n=!!e[a]:a==="cancelable"?i=!!e[a]:r[a]=e[a];r.initEvent(s,n,i),(t??document).dispatchEvent(r)},os=Array.isArray,ls=s=>ct(s)==="[object Map]",as=s=>ct(s)==="[object Set]",us=s=>s instanceof Date,R=s=>typeof s=="function",cs=s=>typeof s=="string",fs=s=>typeof s=="symbol",Er=s=>s!==null&&typeof s=="object",hs=s=>Er(s)&&R(s.then)&&R(s.catch),He=s=>s==null,ys=Object.prototype.toString,ct=s=>ys.call(s),Cr=s=>ct(s)==="[object Object]",ds=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol";function Bt(s){return s.__esModule||ds&&s[Symbol.toStringTag]==="Module"}const ms=typeof Promise<"u"&&Promise.toString().indexOf("[native code]")!==-1;function K(...s){let e=s[0]!==void 0&&s[0]!==null?s[0]:{},t=1,r=s.length,n=!1;for(typeof e=="boolean"&&(n=e,e=s[t]??{},t++),typeof e!="object"&&(e={});t<r;t++)if(s[t]!==null&&s[t]!==void 0){let i=s[t];for(let o in i){let a=e[o],l=i[o];if(a!==l)if(n===!0&&l&&typeof l=="object"){let u;Array.isArray(l)?u=a&&Array.isArray(a)?a:[]:u=a&&typeof a=="object"?a:{},e[o]=K(n,u,l)}else l!==void 0&&(e[o]=l)}}return e}function ft(s,e,t=!1){if(!t)K(!0,s,e);else{if(typeof e!="object")return{};typeof s!="object"&&(s={});for(let r of Reflect.ownKeys(e)){let n=s[r],i=e[r];if(n!==i)if(typeof i=="object"){if(!Array.isArray(i)&&!Cr(i))continue;n=ft(n,i,t),s[r]=n}else{if(typeof i=="function")continue;s[r]=i}}}return s}class le{static seed=new Date().getTime();static get(){let e=++le.seed;return e>=Number.MAX_VALUE&&(le.seed=0),e}}const vt=ms?Promise.resolve():null;function Me(s,...e){vt!==null?e&&e.length>0?vt.then(()=>{s(e)}):vt.then(s):e&&e.length>0?setTimeout(()=>{s(e)}):setTimeout(s)}function Vt(s){return s==null?!1:typeof s=="boolean"?s:typeof s=="string"?s.toLocaleLowerCase()==="true":!!s}function ps(s){return typeof s=="number"?s:Number(s)}const vs={"[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 Mt(s){let t=Object.prototype.toString.call(s);return s==null?String(s):vs[t]||"object"}function It(s,e){if(s==e)return!0;if(s===void 0||e===void 0)return!1;let t=Mt(s),r=Mt(e);if(t!==r)return!1;if(t==="object"){let n=Object.keys(s),i=Object.keys(e);if(n.length!==i.length)return!1;for(let o=0;o<n.length;o++){let a=n[o],l=s[a],u=e[a];if(!It(l,u))return!1}return!0}else if(t==="array"){if(s.length!==e.length)return!1;for(let n=0;n<s.length;n++){let i=s[n],o=e[n];if(!It(i,o))return!1}return!0}return!1}const Fr=s=>{const e={};for(let t of Reflect.ownKeys(s)){let r=s[t];r&&!Array.isArray(r)&&typeof r=="object"&&(r=Fr(r)),typeof t=="symbol"?e[String(t)]=r:e[t]=r}return e},gs=/^Symbol\((.*)\)$/,Ar=s=>{const e={};for(let t of Reflect.ownKeys(s)){let r=s[t];r&&!Array.isArray(r)&&typeof r=="object"&&(r=Ar(r));const n=gs.exec(t);if(n&&n[1]){const i=Symbol.for(n[1]);e[i]=r}else e[t]=r}return e};function _r(s,e){let t=null;return function(...r){t&&clearTimeout(t),t=setTimeout(()=>{t=null,Reflect.apply(s,null,[...r])},e)}}const sr=Symbol("idKey"),de=Symbol("valueKey"),S=Symbol("childrenKey"),X=Symbol("growKey");class Tr{[X]=!0;[sr];[de]=w.ref();[S]=new Map;constructor(e){this[sr]=e}}class ws{get(e,t){if(t=="value")return e[de].value;if(t==="grow")return e[X];let r=e[S].get(t);if(r)return Ie(r);if(e[X])return r=zt(t),r[X]=e[X],e[S].set(t,r),Ie(r)}set(e,t,r){return t=="value"?(e[de].value=r,!0):t==="grow"?(e[X]=Vt(r),!0):r==null?(e[S].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[S].delete(t),!0)}}const Wt="__proxy__";function zt(s){const e=new Tr(s);return Reflect.set(e,Wt,new Proxy(e,new ws)),e}function Ie(s){return Reflect.get(s,Wt)}let bs=class{name="";persistPolicy="memory";storage;initFlag=!1;state={};constructor(e={},t){if(e.persistPolicy&&e.persistPolicy!=="memory"&&He(e.name))throw new Error("name can not be empty, where persistPolicy is not memory.");this.name=e.name??"",this.persistPolicy=e.persistPolicy??"memory",this.storage=e.storage,t&&typeof t=="object"&&Object.assign(this.state,t)}init(e){this.restore(e),this.initFlag=!0}getStorage(){if(!this.persistPolicy)return null;let e=null;if(this.persistPolicy==="custom")e=this.storage;else if(ye){const t=T();e=this.persistPolicy==="session"?t.sessionStorage:t.localStorage}return e}saveState(){if(!this.persistPolicy||this.persistPolicy==="memory")return;let e=this.getStorage();if(e===null||!this.state)return;const t=`_bus_${this.name}`,r=JSON.stringify(this.state??{});e.setItem(t,r)}removeState(){if(!this.persistPolicy||this.persistPolicy==="memory")return;let e=this.getStorage();if(e===null||!this.state)return;const t=`_bus_${this.name}`;e.removeItem(t)}restore(e){if(!this.persistPolicy||this.persistPolicy==="memory")return;let t=this.getStorage();if(t===null)return;const r=`_bus_${this.name}`,n=t.getItem(r);if(n){const i=JSON.parse(n);Object.assign(this.state,i),Reflect.ownKeys(this.state).forEach(a=>{if(typeof a!="string")return;const l=this.state[a],u=a.split(/\//g);u.push(l),Reflect.apply(e.put,e,u)})}}put(e){if(this.initFlag&&this.persistPolicy!=="memory")try{const t=e.length,r=e.slice(0,t-1).join("/"),n=e[t-1];this.state[r]=n,this.saveState()}catch(t){console.error(t)}}remove(e){if(this.initFlag&&this.persistPolicy!=="memory")try{const t=e.length,r=e.slice(0,t-1).join("/"),n={};Reflect.ownKeys(this.state).forEach(o=>{typeof o=="string"&&(o===r||o.startsWith(r)||(n[o]=this.state[o]))}),this.state=n,this.saveState()}catch(t){console.error(t)}}clear(){if(this.initFlag)try{this.state={},this.removeState()}catch(e){console.error(e)}}};class Kr extends Tr{_persistHandler;constructor(e={},t){super("__root__"),this._persistHandler=new bs(e,t),this._persistHandler.init(this)}put(...e){let t=e.length;if(t<2)return console.error("参数至少包括一个(key, value)"),!1;let r=this;for(let n=0;n<t-1;n++){let i=e[n],o;r[S].has(i)?o=r[S].get(i):(o=zt(i),r[S].set(i,o)),r=o}return r[de].value=e[t-1],this._persistHandler.put(e),!0}get(...e){let t=e.length;if(t===0)return;let r=this;for(let n=0;n<t;n++){let i=e[n];if(r[S].has(i))r=r[S].get(i);else return}return r[de].value}remove(...e){let t=e.length;if(t==0)return!1;let r=this;for(let i=0;i<t-1;i++){const o=e[i];if(r[S].has(o))r=r[S].get(o);else return!1}const n=e[t-1];return r[S].has(n)?(r[S].delete(n),this._persistHandler.remove(e),!0):!1}contains(...e){const t=e.length;if(t==0)return!1;let r=this;for(let i=0;i<t-1;i++){let o=e[i];if(r[S].has(o))r=r[S].get(o);else return!1}const n=e[t-1];return r[S].has(n)}clear(){this[S].clear(),this._persistHandler.clear()}}const xs=["put","get","contains","remove","clear","_persistHandler"];function nr(s){return xs.includes(s)}class Rs{get(e,t){if(t=="value")return e[de].value;if(t==="grow")return e[X];if(t===S)return e[S];if(typeof t=="string"&&nr(t))return e[t];const r=String(t);let n=e[S].get(r);if(n)return Ie(n);if(e[X])return n=zt(r),n[X]=e[X],e[S].set(r,n),Ie(n)}set(e,t,r){return t=="value"?(e[de].value=r,!0):t==="grow"?(e[X]=Vt(r),!0):nr(t)?!1:r==null?(e[S].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[S].delete(t),!0)}}function Ss(s,e){const t=new Kr(s,e),r=new Rs,n=new Proxy(t,r);return Reflect.set(t,Wt,n),t}const Nt=new Proxy(Kr,{construct(s,e){const t=e[0]??{},r=e[1],n=Ss(t,r);return Ie(n)}}),Jt=s=>!s||typeof s!="object"?!0:Reflect.ownKeys(s).length===0;class $r{name="";persistPolicy="memory";storage;constructor(e={}){if(e.persistPolicy&&e.persistPolicy!=="memory"&&He(e.name))throw new Error("name can not be empty, where persistPolicy is not memory.");this.name=e.name??"",this.persistPolicy=e.persistPolicy??"memory",this.storage=e.storage}getStorage(){if(!this.persistPolicy)return null;let e=null;if(this.persistPolicy==="custom")e=this.storage;else if(ye){const t=T();e=this.persistPolicy==="session"?t.sessionStorage:t.localStorage}return e}saveState(e){if(!this.persistPolicy||this.persistPolicy==="memory")return;let t=this.getStorage();if(t===null||Jt(e))return;const r=`_state_${this.name}`,n=JSON.stringify(e??{});t.setItem(r,n)}removeState(){if(!this.persistPolicy||this.persistPolicy==="memory")return;let e=this.getStorage();if(e===null)return;const t=`_state_${this.name}`;e.removeItem(t)}restore(e){if(!this.persistPolicy||this.persistPolicy==="memory")return;let t=this.getStorage();if(t===null)return;const r=`_state_${this.name}`,n=t.getItem(r);if(n){const i=JSON.parse(n);Object.assign(e,i)}}}function jr(s,e,t){const r=new $r(t);r.restore(e);const n=l=>{const u=w.toRaw(l),c={};for(let f in u){const h=u[f];He(h)||(c[f]=h)}Jt(c)?r.removeState():r.saveState(c)};let i=null;if(t&&t.debounce===!1)i=n;else{const l=t&&t.debounceDelay?t.debounceDelay:250;i=_r(n,l)}const o=s?w.shallowReactive(e):w.reactive(e);return w.effectScope().run(()=>{w.watch(o,l=>{const u=w.toRaw(l);i(u)})}),o}function Ps(s,e){return jr(!1,s,e)}function Es(s,e){return jr(!0,s,e)}function Cs(s,e){const t=new $r(e);t.restore(s);const r=a=>{const l=w.toRaw(a),u={};for(let c in l){const f=l[c];He(f)||(u[c]=f)}Jt(u)?t.removeState():t.saveState(u)};let n=null;if(e&&e.debounce===!1)n=r;else{const a=e&&e.debounceDelay?e.debounceDelay:250;n=_r(r,a)}const i={get(a,l){return a[l]},set(a,l,u){return a[l]=u,n(a),!0}};return new Proxy(s,i)}function Fs(s,e){return Cs(s,e)}const te="default",qr=Symbol("sync"),D=Symbol("resolveRoute");function ir(s){let e=!1;return function(...t){if(!e)return e=!0,Reflect.apply(s,{},t)}}function As(s){let e=s.src;return new Promise((t,r)=>{const n=ir(a=>{Bt(a)&&(a=a.default),s.component=a,console.debug("success load async module"),t()}),i=ir(a=>{console.debug("reject load async module"),r(a)});let o;try{o=e(n,i)}catch(a){i(a)}if(o)if(typeof o.then=="function")o.then(n,i);else{const a=o.component;a&&typeof a.then=="function"&&a.then(n,i)}})}class _s{name;level;rootName;rootIndex=0;constructor(e,t,r,n){this.name=e,this.level=t,this.rootName=r,this.rootIndex=n}}class ot{to;routeModel;from;data={};constructor(e,t){this.to=e,this.from=t}static from(e){let t=new ot(e.to,e.from),r=e.data??{};return K(!0,t.data,r),t}}class P{path;get fullPath(){const e=this.path??`/${this.name}`;return`${this.root??te}!${e}`}alias;name;root;params;query;traceless;template;matched;meta;success;error;destroy;opsType;updateType;historyUpdatePolicy;viewTagAttrs;index;active;slot;session;static clone(e,t){let r=new P;return ft(r,e,t),r}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 P;if(e==null)return t;let r=t;for(let i in e){let o=e[i];r[i]=o}const n=Object.getOwnPropertySymbols(e);if(Array.isArray(n)&&n.length>0)for(let i of n)r[i]=e[i];return t}}class Ts{id;name;props;meta;src;component;constructor(e,t,r,n){this.id=le.get(),this.name=e,this.src=t,typeof t!="function"&&(this.component=t),this.props=r,this.meta=n}get isResolved(){return this.component!==void 0}resolve(){return As(this)}}class or{models=[]}class gt{path;match;redirect;name;layers=[]}var q=(s=>(s[s.Push=0]="Push",s[s.Replace=1]="Replace",s[s.Put=2]="Put",s[s.Append=3]="Append",s[s.Open=4]="Open",s))(q||{});const Or="FoxBeforeEnter",Lr="FoxEnter",Mr="FoxLeave",Ir="FoxLeave",lt="FoxLeaveEnd",k=Symbol("chainKey"),H=Symbol("cursorKey"),wt=Symbol("$persistentModeKey"),_=Symbol("statusKey"),Z=Symbol("argsKey"),Be=Symbol("exArgsKey"),me=Symbol("successFnsKey"),Ce=Symbol("errorFnsKey"),oe=Symbol("sessionKey"),ee=Symbol("_go");class Ne{[k]=[];[H]=0;[wt]=!1;[_]="Free";[Z]=[];[Be]=[];[me]=[];[Ce]=[];[oe];get session(){return this[oe]}constructor(e,t=!1){this[oe]=e,this[wt]=t}[ee](e,...t){let r=this[_];if(this[_]="Busy",this[H]+=e,this[H]<0&&(this[H]=0),this[Z]=t,r==="Exception"||r==="Reject"){let a=[{session:this[oe]},...this[Be]];for(;this[Ce].length>0;)try{let l=this[Ce].shift();typeof l=="function"&&Me(()=>{Reflect.apply(l,{},a)})}catch(l){console.error(l.message,l)}return this[_]=r,this[k]=[],this[H]=0,this}else if(r==="Finished"||this[H]>=this[k].length){let a=[{session:this[oe]},...this[Z]];for(;this[me].length>0;){let l=this[me].shift();typeof l=="function"&&Me(()=>{Reflect.apply(l,{},a)})}return this[_]="Free",this}if(this[H]>=this[k].length)return this[_]="Free",this;let n=this[k][this[H]];this[wt]||(this[k].splice(0,this[H]+1),this[H]=-1);let i=this[H]+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[k].splice(i,0,l),i++)},session:this[oe]};Me(()=>{Reflect.apply(n,{},[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[Be]=e,Reflect.apply(this[ee],this,[0])}throw(...e){return this[_]="Exception",this[Be]=e,Reflect.apply(this[ee],this,[0])}reset(...e){this[_]="Busy",this[Z]=e,this[k]=[],this[H]=0;let r=[{session:this[oe]},...this[Z]];for(;this[me].length>0;){let n=this[me].shift();Me(()=>{Reflect.apply(n,this,r)})}return this[_]="Free",this}post(e){return this[_]==="Reject"||this[_]==="Exception"?this:(Array.isArray(e)?this[k]=[...this[k],...e]:this[k].push(e),this[_]==="Busy"?this:(Reflect.apply(this[ee],this,[0,...this[Z]]),this))}wait(e,t){return e&&typeof e=="function"&&this[me].push(e),t&&typeof t=="function"&&this[Ce].push(t),this[_]==="Busy"?this:(Reflect.apply(this[ee],this,[0,...this[Z]]),this)}exception(e){return e&&typeof e=="function"&&this[Ce].push(e),this[_]==="Busy"?this:Reflect.apply(this[ee],this,[0,...this[Z]])}isFinish(){return this[_]=="Reject"||this[_]=="Free"&&this[H]>=this[k].length}}const pe=Symbol("registerKey");class Ks{policy;callback;constructor(e,t){this.callback=e,this.policy=t}}class Ht{[pe]=new Map;constructor(){}on(e,t,r=!1){let n=this[pe].get(e);n||(n=new Array,this[pe].set(e,n));let i=r===!0?1:0,o=new Ks(t,i);return n.push(o),this}off(e,t){if(!t)return this[pe].delete(e),this;let r=this[pe].get(e);if(r){for(let n=0;n<r.length;n++)if(r[n].callback===t){r.splice(n,1);break}}return this}bind(e,t,r=!1){return this.on(e,t,r)}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 r=e[t-1];if(typeof r!="function")return console.error("callback can not benn empty"),this;let n=t-1,i=new Array(n),o=[].splice.call(e,0,n);for(let a=0;a<o.length;a++)this.once(o[a],l=>{i[a]=l,n-=1,n==0&&Reflect.apply(r,{},i)});return this}emit(e,...t){let r=this[pe].get(e);if(!r)return this;for(let n=0;n<r.length;){let i=r[n];if(i.policy==1?r.splice(n,1):n++,typeof i.callback=="function")try{Me(()=>{Reflect.apply(i.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 $s{[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 he=Symbol("lc");function at(s,e=!1){let t=s;if(Reflect.has(t,he))return t[he];if(e){const r=new $s;return t[he]=r,r}return null}function Nr(s,e=!1){let t=null,r=s;for(;r&&!(Reflect.has(r,he)&&(t=r[he],t));)r=r.$parent;if(!t&&e){const n=s;n&&n.$parent&&(t=at(n.$parent,e))}return t}function Gt(s,e){let t=s;for(;t;){if(Reflect.has(t,he)){const r=t[he];if(r.has(e))return r.get(e)}t=t.$parent}return null}function js(s,e,t){Nr(s,!0)?.set(e,t)}function qs(s,e){Nr(s,!0)?.delete(e)}function lr(s){if(Array.isArray(s.children)&&s.children.length>0){let e=s.children[0];if(e!=null&&e.component!=null&&e.component.proxy!=null)return at(e.component.proxy,!1)}return null}const ut=Symbol("hooksKey");function Os(s){let e=s.get(ut);e||(e=[],s.set(ut,e))}function ar(s,e){let t=s.get(ut);if(t!=null)for(let r=t.length-1;r>=0;r--){let n=t[r];if(n.type===e)try{Reflect.apply(n.hook,n.target,[])}catch(i){console.error(i.message,i)}}}var Dt=(s=>(s.DEACTIVATED="da",s.ACTIVATED="a",s))(Dt||{});class Ls{type;hook;target;constructor(e,t,r){this.target=r,this.hook=t,this.type=e}}function Ms(s,e,t,r){let n=new Ls(e,t,r);return s.push(n),!0}function Is(s,e,t,r){let n=-1;for(let i=0;i<s.length;i++){let o=s[i];if(o.type===e&&o.hook===t&&o.target===r){n=i;break}}return n!=-1?(s.splice(n,1),!0):!1}function Hr(s){return(e,t)=>{let r;if(t)r=t;else{const i=w.getCurrentInstance();if(i==null||i.proxy==null){console.error("can not get current instance or proxy");return}r=i.proxy}const n=Gt(r,ut);if(n==null){console.warn("hooks context not found");return}w.onUnmounted(()=>{Is(n,s,e,r)}),Ms(n,s,e,r)}}const Ns=Hr("a"),Hs=Hr("da"),Dr=Symbol("routeKey");function ur(s,e){s.set(Dr,e)}function Qt(s){let e=Gt(s,Dr);return typeof e=="function"?e():e??null}const ht=Symbol("rk"),bt=Symbol("vd"),cr=Symbol("rv"),xt=Symbol("rvi"),fr=Symbol("pv"),Rt=Symbol("pvi");function Ds(s){for(var e=[],t=0;t<s.length;){var r=s[t];if(r==="*"||r==="+"||r==="?"){e.push({type:"MODIFIER",index:t,value:s[t++]});continue}if(r==="\\"){e.push({type:"ESCAPED_CHAR",index:t++,value:s[t++]});continue}if(r==="{"){e.push({type:"OPEN",index:t,value:s[t++]});continue}if(r==="}"){e.push({type:"CLOSE",index:t,value:s[t++]});continue}if(r===":"){for(var n="",i=t+1;i<s.length;){var o=s.charCodeAt(i);if(o>=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122||o===95){n+=s[i++];continue}break}if(!n)throw new TypeError("Missing parameter name at ".concat(t));e.push({type:"NAME",index:t,value:n}),t=i;continue}if(r==="("){var a=1,l="",i=t+1;if(s[i]==="?")throw new TypeError('Pattern cannot start with "?" at '.concat(i));for(;i<s.length;){if(s[i]==="\\"){l+=s[i++]+s[i++];continue}if(s[i]===")"){if(a--,a===0){i++;break}}else if(s[i]==="("&&(a++,s[i+1]!=="?"))throw new TypeError("Capturing groups are not allowed at ".concat(i));l+=s[i++]}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=i;continue}e.push({type:"CHAR",index:t,value:s[t++]})}return e.push({type:"END",index:t,value:""}),e}function Ur(s,e){e===void 0&&(e={});for(var t=Ds(s),r=e.prefixes,n=r===void 0?"./":r,i="[^".concat(xe(e.delimiter||"/#?"),"]+?"),o=[],a=0,l=0,u="",c=function(A){if(l<t.length&&t[l].type===A)return t[l++].value},f=function(A){var E=c(A);if(E!==void 0)return E;var C=t[l],z=C.type,I=C.index;throw new TypeError("Unexpected ".concat(z," at ").concat(I,", expected ").concat(A))},h=function(){for(var A="",E;E=c("CHAR")||c("ESCAPED_CHAR");)A+=E;return A};l<t.length;){var y=c("CHAR"),d=c("NAME"),p=c("PATTERN");if(d||p){var m=y||"";n.indexOf(m)===-1&&(u+=m,m=""),u&&(o.push(u),u=""),o.push({name:d||a++,prefix:m,suffix:"",pattern:p||i,modifier:c("MODIFIER")||""});continue}var v=y||c("ESCAPED_CHAR");if(v){u+=v;continue}u&&(o.push(u),u="");var g=c("OPEN");if(g){var m=h(),$=c("NAME")||"",x=c("PATTERN")||"",j=h();f("CLOSE"),o.push({name:$||(x?a++:""),pattern:$&&!x?i:x,prefix:m,suffix:j,modifier:c("MODIFIER")||""});continue}f("END")}return o}function Us(s,e){return ks(Ur(s,e),e)}function ks(s,e){e===void 0&&(e={});var t=Xt(e),r=e.encode,n=r===void 0?function(l){return l}:r,i=e.validate,o=i===void 0?!0:i,a=s.map(function(l){if(typeof l=="object")return new RegExp("^(?:".concat(l.pattern,")$"),t)});return function(l){for(var u="",c=0;c<s.length;c++){var f=s[c];if(typeof f=="string"){u+=f;continue}var h=l?l[f.name]:void 0,y=f.modifier==="?"||f.modifier==="*",d=f.modifier==="*"||f.modifier==="+";if(Array.isArray(h)){if(!d)throw new TypeError('Expected "'.concat(f.name,'" to not repeat, but got an array'));if(h.length===0){if(y)continue;throw new TypeError('Expected "'.concat(f.name,'" to not be empty'))}for(var p=0;p<h.length;p++){var m=n(h[p],f);if(o&&!a[c].test(m))throw new TypeError('Expected all "'.concat(f.name,'" to match "').concat(f.pattern,'", but got "').concat(m,'"'));u+=f.prefix+m+f.suffix}continue}if(typeof h=="string"||typeof h=="number"){var m=n(String(h),f);if(o&&!a[c].test(m))throw new TypeError('Expected "'.concat(f.name,'" to match "').concat(f.pattern,'", but got "').concat(m,'"'));u+=f.prefix+m+f.suffix;continue}if(!y){var v=d?"an array":"a string";throw new TypeError('Expected "'.concat(f.name,'" to be ').concat(v))}}return u}}function Bs(s,e){var t=[],r=kr(s,t,e);return Vs(r,t,e)}function Vs(s,e,t){t===void 0&&(t={});var r=t.decode,n=r===void 0?function(i){return i}:r;return function(i){var o=s.exec(i);if(!o)return!1;for(var a=o[0],l=o.index,u=Object.create(null),c=function(h){if(o[h]===void 0)return"continue";var y=e[h-1];y.modifier==="*"||y.modifier==="+"?u[y.name]=o[h].split(y.prefix+y.suffix).map(function(d){return n(d,y)}):u[y.name]=n(o[h],y)},f=1;f<o.length;f++)c(f);return{path:a,index:l,params:u}}}function xe(s){return s.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function Xt(s){return s&&s.sensitive?"":"i"}function Ws(s,e){if(!e)return s;for(var t=/\((?:\?<(.*?)>)?(?!\?)/g,r=0,n=t.exec(s.source);n;)e.push({name:n[1]||r++,prefix:"",suffix:"",modifier:"",pattern:""}),n=t.exec(s.source);return s}function zs(s,e,t){var r=s.map(function(n){return kr(n,e,t).source});return new RegExp("(?:".concat(r.join("|"),")"),Xt(t))}function Js(s,e,t){return Gs(Ur(s,t),e,t)}function Gs(s,e,t){t===void 0&&(t={});for(var r=t.strict,n=r===void 0?!1:r,i=t.start,o=i===void 0?!0:i,a=t.end,l=a===void 0?!0:a,u=t.encode,c=u===void 0?function(I){return I}:u,f=t.delimiter,h=f===void 0?"/#?":f,y=t.endsWith,d=y===void 0?"":y,p="[".concat(xe(d),"]|$"),m="[".concat(xe(h),"]"),v=o?"^":"",g=0,$=s;g<$.length;g++){var x=$[g];if(typeof x=="string")v+=xe(c(x));else{var j=xe(c(x.prefix)),A=xe(c(x.suffix));if(x.pattern)if(e&&e.push(x),j||A)if(x.modifier==="+"||x.modifier==="*"){var E=x.modifier==="*"?"?":"";v+="(?:".concat(j,"((?:").concat(x.pattern,")(?:").concat(A).concat(j,"(?:").concat(x.pattern,"))*)").concat(A,")").concat(E)}else v+="(?:".concat(j,"(").concat(x.pattern,")").concat(A,")").concat(x.modifier);else x.modifier==="+"||x.modifier==="*"?v+="((?:".concat(x.pattern,")").concat(x.modifier,")"):v+="(".concat(x.pattern,")").concat(x.modifier);else v+="(?:".concat(j).concat(A,")").concat(x.modifier)}}if(l)n||(v+="".concat(m,"?")),v+=t.endsWith?"(?=".concat(p,")"):"$";else{var C=s[s.length-1],z=typeof C=="string"?m.indexOf(C[C.length-1])>-1:C===void 0;n||(v+="(?:".concat(m,"(?=").concat(p,"))?")),z||(v+="(?=".concat(m,"|").concat(p,")"))}return new RegExp(v,Xt(t))}function kr(s,e,t){return s instanceof RegExp?Ws(s,e):Array.isArray(s)?zs(s,e,t):Js(s,e,t)}var tt=(s=>(s[s.Part=0]="Part",s[s.All=1]="All",s))(tt||{});const Q=Symbol("rootKey"),G=Symbol("rootNodeKey"),fe=Symbol("parentNodeKey"),rt=Symbol("nameKey");class se{instance=null;model;route;active=!0;index=0;constructor(e,t,r=0,n=!0){this.route=e,this.model=t,this.index=r,this.active=n}}class Ae{_slots;get slots(){return this._slots==null&&(this._slots=w.shallowRef([])),this._slots}get empty(){return this._slots==null||this._slots.value.length==0}[rt];[Q];[G]=null;[fe]=null;get name(){return this[rt]}constructor(e,t,r){this[rt]=e,this[Q]=t,r&&(this[G]=r)}}class B{view;index;level;constructor(e,t,r){this.view=e,this.index=t,this.level=r}static include(e,t){for(let r=0;r<e.length;r++){let n=e[r];if(n.view===t.view&&(t.index==-1||n.index===t.index)&&n.level===t.level)return!0}return!1}}class St{views=[]}class Qs{layers=[]}class Xs{time;route}class Ys{forbidTime=300;submitRecorder=new Xs;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 Re=Symbol("_notifyChange");class hr{currentRoute;routes;constructor(e,t){this.currentRoute=e,this.routes=t}}const ae=Symbol("historyChangeConsumerKey"),yr=Symbol("_navigateFirstRoute"),Ve=Symbol("_getRouteMark"),Pt=Symbol("_getUrlSearch"),Et=Symbol("_generateLocation"),We=Symbol("_setRouteMarkRecorder"),_e=Symbol("beforeRestoreFiltersKey"),dr=Symbol("_beforeRestore"),mr="Symbol(_fox_restore_point)";function Te(s,...e){return typeof s=="function"?Reflect.apply(s,null,[...e]):s}function pr(s){if(!Array.isArray(s))return!1;if(s.length===0)return!0;const e=s[0];return!!(Reflect.has(e,"path")&&Reflect.has(e,"root"))}class Br{base;storage;mode;query;firstNavigate=!0;historyMonitor;traceless=!1;changeHandler;historyChange;[ae]=!1;[_e]=new Array;backTimeout=320;constructor(e="hash",t="",r="",n=!0,i=!0,o=!1,a,l){this.mode=e,this.base=t,this.query=r,this.firstNavigate=n,this.historyMonitor=i,this.traceless=o,this.storage=a??T().sessionStorage,this.backTimeout=l??320}init(e=!0){const t=T();return typeof this.historyChange!="function"&&(this.historyChange=()=>{if(typeof this[ae]=="function"){const r=this[ae]();if(this[ae]=!1,r)return}else if(this[ae]===!0){this[ae]=!1;return}if(Te(this.historyMonitor)){const r=t.history.state;this[Re](r);try{let n=[];if(typeof r=="string"?n=JSON.parse(r):n=r,Array.isArray(n)&&n.length>0){const i=this[Ve]()??"/";this[We](i,n)}}catch{}}}),nt(t,"popstate",this.historyChange),this.firstNavigate&&e&&this[yr](),Promise.resolve()}destroy(){if(this.historyChange){const e=T();it(e,"popstate",this.historyChange)}}[dr](e,t,r,n){for(let i of this[_e])try{const o=Reflect.apply(i,{},[e,t,r,n]);if(o===!1)return o}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}[yr](){const e=this[Ve]()??"/",t=this.storage.getItem(mr);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)=>(l.params=l.params?Ar(l.params):{},this[dr](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[Re](a);return}}}catch{}const r=e.indexOf("!");let n;r!=-1?n=e.substring(r+1):n=e;const i=new P;i.path=n,i.query=this[Pt](),this[Re]([i])}[We](e,t){try{t.forEach(i=>{i.params=i.params?Fr(i.params):{}});const n=JSON.stringify({mark:e,routes:t});this.storage.setItem(mr,n)}catch(r){console.error(r.message,r)}}setRestorePoint(e){const t=this[Ve]()??"/";this[We](t,e)}[Re](e){typeof this.changeHandler=="function"&&this.changeHandler(e)}[Ve](){const e=T();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,r=t.indexOf("#");if(r!=-1)return t.substring(r+1)}return null}[Pt](){let t=T().location.search;return t.length>0&&t.indexOf("?")===0&&(t=t.substring(1)),t}listen(e){this.changeHandler=e}go(e,t=!1){const r=T();this[ae]=t,r.history.go(e)}goBack(e,t){const r=T(),n=r.history.state;if(pr(n)&&n.length>0){let i=!1;for(let c=n.length-1;c>=0;c--){const f=P.from(n[c]);if(!(f.historyUpdatePolicy==="traceless"||Te(this.traceless,f))&&P.isSame(f,e)){i=!0;break}}if(!i){t();return}const o=this.backTimeout;let a=null;const l=()=>{r.history.go(-1),a=setTimeout(l,o)},u=()=>{clearTimeout(a);const f=T().history.state;if(pr(f)&&f.length>0){let h=f.length;const y=f[h-1],d=P.from(y);if(P.isSame(d,e))return t(),!0;if(h>0){let p=!1;for(let m=h-1;m>=0;m--){const v=P.from(f[m]);if(!(v.traceless===!0||Te(this.traceless,v))&&P.isSame(v,e)){p=!0;break}}return p?(setTimeout(()=>{a=setTimeout(l,o),this.go(-1,u)},0),!0):(t(),!0)}}return t(),!0};a=setTimeout(l,o),this.go(-1,u)}else t()}setRouteMark(e){const t=e.currentRoute.fullPath;this[We](t,e.routes)}push(e){const t=this[Et](e.currentRoute);e.currentRoute.historyUpdatePolicy!=="traceless"&&!Te(this.traceless,e.currentRoute)&&T().history.pushState(e.routes,"",t),this.setRouteMark(e)}replace(e){const t=this[Et](e.currentRoute);(e.currentRoute.historyUpdatePolicy!=="traceless"||!Te(this.traceless,e.currentRoute))&&T().history.replaceState(e.routes,"",t),this.setRouteMark(e)}[Et](e){const t=T();let r="";if(e.query){let a="";if(typeof e.query=="object")for(let l of Reflect.ownKeys(e.query)){let u=encodeURIComponent(e.query[l]),c=`${encodeURIComponent(String(l))}=${u}`;a.length>0&&(a+="&"),a+=c}else a=e.query;this.query?(r=a.length>0?`${this.query}&${a}`:this.query,r.length>0&&r.charAt(0)!=="?"&&(r=`?${r}`)):a.length>0&&(r=`?${a}`)}const n=t.location;let i=e.alias??e.fullPath;i.startsWith(te)&&(i=i.substring(te.length+1));let o;return r?this.mode=="path"?i.indexOf("/")===0?o=`${this.base}${i}${r}`:o=`${this.base}/${i}${r}`:o=`${n.pathname}${r}#${i}`:this.mode=="path"?i.indexOf("/")===0?o=`${this.base}${i}`:o=`${this.base}/${i}`:o=`${n.pathname}#${i}`,`${n.origin}${o}`}}function Zs(s=!0,e=null,t="",r=!0,n=!1,i){return e!==null&&(e=T().location.pathname),e&&e.endsWith("/")&&(e=e.substring(0,e.length-1)),new Br("path",e??"",t,s,r,n,i)}function Vr(s=!0,e="",t=!0,r=!1,n){return new Br("hash","",e,s,t,r,n)}class en{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}[Re](e){typeof this.changeHandler=="function"&&this.changeHandler(e)}go(e,t=!1){if(this.queue.length==0||this.cursor<=0)return;let r=this.cursor+e;if(r<0?r=0:r>this.queue.length-1&&(r=this.queue.length-1),r!=this.cursor){this.cursor=r;let n=!1;if(typeof t=="function"?n=t():n=t,!n){const i=this.queue[r];this[Re](i.routes)}}}goBack(e,t){if(this.queue.length==0||this.cursor<=0)return;let r=0;if(e===null)r=this.cursor+1;else for(let n=this.cursor;n>=0;n--){const i=this.queue[n];if(P.isSame(i.currentRoute,e))break;r++}if(r===0){t();return}this.go(-r,()=>(t(),!0))}setRouteMark(e){}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 Wr(s="",e=50){return new en(s,e)}const ze=Symbol("_constructRouteModel"),Je=Symbol("_findRouteModel"),Ct=Symbol("_findRootView"),vr=Symbol("_getFirstView"),ue=Symbol("_removeView"),gr=Symbol("_buildPage"),wr=Symbol("_resolveComponent"),br=Symbol("_update"),ne=Symbol("_merge"),Ft=Symbol("_handleHistoryChange"),Ge=Symbol("_handleRouteUpdated"),Qe=Symbol("routeUpdatedCallback"),b=Symbol("currentRoutes"),ve=Symbol("current"),xr=Symbol("_addRouteRecorder"),Ke=Symbol("_removeRouteRecorder"),Xe=Symbol("_cloneRouteRecorder"),O=Symbol("_handleError"),Ye=Symbol("errorCallback"),V=Symbol("registerKey"),Ze=Symbol("notFoundKey"),At=Symbol("notFoundPathKey"),W=Symbol("forestKey"),F=Symbol("historyKey"),$e=Symbol("beforeFiltersKey"),je=Symbol("afterFiltersKey"),qe=Symbol("destroyFiltersKey"),_t=Symbol("propsFilterKey"),ge=Symbol("mainDispatcherKey"),Tt=Symbol("initKey"),ce=Symbol("readyKey"),Kt=Symbol("readyHandlersKey"),et=Symbol("_markReady"),Rr=Symbol("_createNextFn"),$t=Symbol("_start"),jt=Symbol("_before"),qt=Symbol("_after"),Sr=Symbol("_destroy"),Ot=Symbol("_load"),Oe=Symbol("_unload"),Le=Symbol("routerGuardKey");function tn(s){return s.layers.length==0||s.layers[0].views.length==0}function rn(s){let e=[];return s.layers.forEach(t=>{t.models==null||t.models==null||t.models.forEach(r=>{if(!(r==null||r==null))if(typeof r.meta=="object"){let n=K(!0,{},r.meta);e.push(n)}else r.meta&&e.push(r.meta)})}),e}class sn{[V]=new Array;[Ze];[At]="*";[ce]=!1;[Kt]=[];[W]=new Qs;[F];[b]=new Array;[Ye]=null;[Qe]=null;[$e]=new Array;[je]=new Array;[qe]=new Array;[_t]=null;[ge]=new Ne;[Le]=new Ys;[Tt]=!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[F]=e.history:this[F]=ye?Vr():Wr(),this[F]?.listen(async r=>{let n=!0;try{if(typeof r=="string"){const i=this[D](r);i&&await this[Ft]([i])}else await this[Ft](r)}catch(i){console.error(i.message,i),n=!1}this[ce]===!1&&this[et](n)})}[O](e="error",t){if(t&&typeof t.error=="function")try{t.error(e)}catch{}if(typeof this[Ye]=="function")try{this[Ye](e,t)}catch{}console.error(e)}init(){this[Tt]!==!0&&(this[F]?.init(!this[ce]),this[Tt]=!0)}isReady(){return this[ce]?Promise.resolve():new Promise((e,t)=>{this[Kt].push([e,t])})}[et](e){this[ce]=!0,this[Kt].forEach(([t,r])=>{try{e?t():r()}catch(n){console.error(n.message,n)}})}[Ft](e){try{if(!e){let o=[...this[b]].reverse();return this[Oe](o),ye&&T().location.reload(),Promise.resolve()}let t=null,r=[],n=[],i=0;for(;i<e.length&&i<this[b].length&&P.isSame(e[i],this[b][i]);i++)e[i].active===!0&&e[i].active!==this[b][i].active&&(t=e[i]);if(i<e.length&&(r=e.slice(i)),i<this[b].length&&(n=this[b].slice(i).reverse()),n.length===0&&r.length===0){if(t!==null)return this.restore([t])}else if(n.length>0){if(this[Oe](n)){if(r.length>0)return this.restore(r);if(t!==null)return this.restore([t])}}else return this.restore(r)}catch(t){this[O](t)}return Promise.resolve()}[Ge](e){if(e)this[ve].value=e;else{let t=this[b].length;t>0?this[ve].value=this[b][t-1]:this[ve].value=null}if(typeof this[Qe]=="function")try{this[Qe](this[ve].value)}catch{}}[xr](e){if(e.opsType===q.Open){let t=!1;const r=this[b].length-1;for(let n=r;n>=0;n--){const i=this[b][n];if(e.root==i.root){if(e.path===i.path){this[b].splice(n,1,e),t=!0;continue}e.active&&(i.active=!1)}}t||this[b].push(e)}else this[b].push(e)}[Xe](){let e=[];for(let t of this[b]){let r=P.clone(t,!0);e.push(r)}return e}[Ke](e){if(!this[b])return;let t=-1;for(let r=0;r<this[b].length;r++)if(P.isSame(this[b][r],e)){t=r;break}if(t!=-1){let r=this[b][t];this[b].splice(t,1),this[Sr](r,r.session)}}set historyMonitor(e){this[F]&&(this[F].historyMonitor=e)}get historyMonitor(){return this[F]?this[F].historyMonitor:!1}set traceless(e){this[F]&&(this[F].traceless=e)}get traceless(){return this[F]?this[F].traceless:!1}set propsFilter(e){this[_t]=e}get propsFilter(){return this[_t]}setRestorePoint(){const e=this[Xe]();this[F]?.setRestorePoint(e)}onRouteUpdated(e){this[Qe]=e}onError(e){this[Ye]=e}beforeEach(e){this[$e].push(e)}removeBeforeEach(e){const t=this[$e].indexOf(e);return t!==-1?(this[$e].splice(t,1),!0):!1}afterEach(e){this[je].push(e)}removeAfterEach(e){const t=this[je].indexOf(e);return t!==-1?(this[je].splice(t,1),!0):!1}destroyEach(e){this[qe].push(e)}removeDestroyEach(e){const t=this[qe].indexOf(e);return t!==-1?(this[qe].splice(t,1),!0):!1}beforeRestoreEach(e){this[F]?.beforeRestoreEach(e)}removeBeforeRestoreEach(e){return this[F]?.removeBeforeRestoreEach(e)??!1}addRoutes(e){for(let t of e)this.addRoute(t)}addRoute(e,t=-1){if(e.path===this[At]){this.setNotFoundRoute(e);return}const r=this[ze](e);if(t==-1)this[V]=[...this[V],...r];else for(let n=r.length-1;n>=0;n--)this[V].splice(t,0,r[n])}removeRoute(e){const t=this[D](e);if(t===null)return console.warn("route格式错误",e),!1;for(let r=0;r<this[V].length;r++){const n=this[V][r];if(t?.path&&n.path===t.path)return this[V].splice(r,1),!0;if(t?.name&&n.name===t.name)return this[V].splice(r,1),!0}return!1}hasRoute(e){const t=this[D](e);return t===null?(console.warn("route格式错误",e),!1):this[V].findIndex(n=>{if(t?.path&&n.path===t.path||t?.name&&n.name===t.name)return!0})!==-1}setNotFoundPath(e){this[At]=e}setNotFoundRoute(e){const t=this[ze](e);this[Ze]=t[0]}getRoutes(){return[...this[V]]}[ze](e){let t=e.path??"";t.length>0&&t.charAt(0)!=="/"&&(t=`/${t}`);let r=e.components??(e.component&&{"":e.component});if(r==null){const a=new gt;return a.path=t,a.redirect=e.redirect,[a]}let n=[];for(let a in r){let l=r[a];a.length===0&&(a=te);let u=new Ts(a,l,e.props,e.meta);n.push(u)}let i=!1,o=[];if(e.children)for(let a of e.children){let l=this[ze](a);for(let u of l){let c=new gt;c.name=u.name,u.path&&u.path.length>0?t!=="/"?c.path=`${t}${u.path}`:c.path=u.path:(i=!0,c.path=t);let f=new or;f.models=[...n],c.layers=[f,...u.layers],o.push(c)}}if(!i){const a=new or;a.models=n;const l=new gt;l.name=e.name,l.path=t,l.layers=[a],o.splice(0,0,l)}return o}[Je](e){const t=e.route;try{for(let r of this[V]){const n=t.template??t.path,i=t.template??t.name;if(n&&r.path){let o=r.match;o||(o=r.match=Bs(r.path));const a=o(n);if(!a)continue;if(r.redirect){const l=new P;K(!0,l,t),l.path=r.redirect;const u={route:l,find:void 0};return this[Je](u)?(e.route=u.route,e.find=u.find,t.template&&e.find&&(e.find={...e.find},e.find.path=t.path),!0):!1}if(t.params=t.params??{},K(!0,t.params,a.params),t.query){const l=t.query;if(typeof l=="string"){const u={},c=l.split("&");for(let f of c){const h=f.split("=");if(h.length!==2)continue;const y=decodeURIComponent(h[0].trim()),d=decodeURIComponent(h[1].trim());u[y]=d}K(!0,t.params,u)}else typeof l=="object"&&K(!0,t.params,l)}return e.find=r,t.template&&e.find&&(e.find={...e.find},e.find.path=t.path),!0}else if(i===r.name){t.params=t.params??{};const o=Us(r.path);return t.path=o(t.params),e.find=r,t.template&&e.find&&(e.find={...e.find},e.find.name=t.name),!0}}}catch(r){console.error(r.message,r),typeof t.error=="function"&&t.error(r.message)}return!1}[D](e){let t=null;if(Array.isArray(e))if(t=new P,typeof e[0]=="object")t=P.from(e[0]);else for(let r=0;r<e.length;r++)r===0?e[r].charAt(0)==="/"?t.path=e[r]:t.name=e[r]:r===1?t.params=e[r]:r===2?t.root=e[r]:r===3&&K(!1,t,e[r]);else typeof e=="object"?t=P.from(e):typeof e=="string"&&(t=new P,e.charAt(0)=="/"?t.path=e:t.name=e);if(t){if(t.path){let r=t.path.indexOf("?");r!==-1&&r<t.path.length-1&&(t.query=t.path.substring(r+1),t.path=t.path.substring(0,r))}t.root=t.root??te,t.opsType=t.opsType??this.options.defaultOperationType??q.Push,t.traceless&&!t.historyUpdatePolicy&&(t.historyUpdatePolicy="traceless")}return t}push(...e){const t=this[D](e);return t?(t.opsType=q.Push,t.historyUpdatePolicy=t.historyUpdatePolicy??"push",this.to(t)):(this[O]("resolve route fail",t),this)}put(...e){const t=this[D](e);return t?(t.opsType=q.Put,t.historyUpdatePolicy=t.historyUpdatePolicy??"traceless",this.to(t)):(this[O]("resolve route fail",t),this)}replace(...e){const t=this[D](e);return t?(t.opsType=q.Replace,t.historyUpdatePolicy=t.historyUpdatePolicy??"replace",this.to(t)):(this[O]("resolve route fail",t),this)}append(...e){const t=this[D](e);return t?(t.opsType=q.Append,t.historyUpdatePolicy=t.historyUpdatePolicy??"push",this.to(t)):(this[O]("resolve route fail",t),this)}remove(e,t){return new Promise(r=>{this[ge].post(n=>{try{if(this[b].length===0){n.resolve(),r(!1);return}let i=-1,o,a=[];if(e){if(e.root?o=e.root:o=this[b][0].root??te,e.all)for(let u=this[b].length-1;u>0;u--){let c=this[b][u];c.opsType===q.Append&&c.root===o&&(a.splice(0,0,c),i=u-1)}else if(e.until)for(let u=this[b].length-1;u>0;u--){let c=this[b][u];if(c.opsType===q.Append&&c.root===o){if(e.until.charAt(0)==="/"&&e.until===c.path){i=u;break}else if(e.until===c.name){i=u;break}a.splice(0,0,c)}}}else{o=te;let u=this[vr](this[W]);u&&(o=u.name);for(let c=this[b].length-1;c>0;c--){let f=this[b][c];if(f.opsType===q.Append&&f.root===o){a.push(f),i=c-1;break}}}if(a.length===0){let u="can not find route";console.warn(u),n.resolve(u),r(!1);return}let l=null;if(i!==-1&&(l=this[b][i]),this[Oe](a)){if(t===!1)return n.resolve(),r(!0),!0;const u=()=>(n.resolve(),r(!0),!0),c=this[b].length;if(l&&P.isSame(l,this[b][c-1])){this[F]?.goBack(l,u);return}u()}}catch(i){this[O](i),n.resolve(),r(!1)}})})}open(...e){let t=this[D](e);return t?(t.opsType=q.Open,t.historyUpdatePolicy=t.historyUpdatePolicy??"push",this.to(t)):(this[O]("resolve route fail",t),this)}close(e){return this[ge].post(t=>{try{let r=this[D](e);if(!r){t.reject("resolve route fail");return}let n=[];for(let i=0;i<this[b].length;i++){let o=this[b][i];if(o.root===r.root){if(!r.path&&!r.name){n.push(o);continue}if(r.path&&r.path===o.path){n.push(o);break}else if(r.name&&r.name===o.name){n.push(o);break}}}if(n.length===0){t.resolve();return}this[Oe](n)&&this[Ge](),t.resolve()}catch(r){this[O](r),t.resolve()}}),this}to(...e){let t=this[D](e);if(!t)return this[O]("resolve route fail",t),this;let r=this[Le].acquire(t);return r==null?(this[O]("route forbid",t),this):(this[ge].post(n=>{try{let i=this[$t](t);this[jt](i),this[Ot](i),this[qt](i),i.wait((o,a)=>{const l=o.session.to;if(o.session.updateResult&&o.session.updateResult.status==="success")try{let u=P.clone(l,!0);const c=new hr(u,this[Xe]());l.historyUpdatePolicy==="replace"?this[F]?.replace(c):l.historyUpdatePolicy==="traceless"?this[F]?.setRouteMark(c):this[F]?.push(c)}catch(u){console.error(u.message,u)}if(this[Le].release(r),this[Ge](l),typeof t.success=="function")try{Reflect.apply(t.success,{},[])}catch(u){console.error(u.message,u)}this[ce]===!1&&this[et](!0),n.resolve()},(o,a)=>{this[Le].release(r),a!==null&&this[O](a,t),this[ce]===!1&&this[et](!1),n.resolve()})}catch(i){this[Le].release(r),this[O](i,t),n.resolve()}}),this)}back(e=1){this[F]?.go(-e,!1)}[Rr](e){return(t,r)=>{if(typeof t=="boolean")e.session.redirect=!1,t?e.resolve():e.reject(r??null);else if(t){const n=this[D](t);if(n){const i=e.session.to;n.success=i.success,n.error=i.error,e.session.to=n,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()}}[$t](e){let t=this[b].length>0?this[b][0]:void 0,r=new ot(e,t),n={route:e,find:null};return this[Je](n),n.find&&(r.routeModel=n.find,e.matched=rn(n.find),Array.isArray(e.matched)&&e.matched.length>0&&(e.meta=n.find.layers[0].models[0].meta)),new Ne(r)}[jt](e){for(let t of this[$e])e.post(r=>{const n=this[Rr](r);Reflect.apply(t,{},[r.session.to,r.session.from,n,r.session])})}[qt](e){e.post(t=>{for(let r of this[je])try{Reflect.apply(r,{},[t.session.to,t.session.from,t.session])}catch(n){console.error(n.message,n)}t.resolve()})}[Sr](e,t){for(let r of this[qe])try{Reflect.apply(r,{},[e,t])}catch(n){console.error(n.message,n)}typeof e.destroy=="function"&&Reflect.apply(e.destroy,e,[])}[Ot](e){e.post(t=>{let r=t.session.to,n=t.session.routeModel;if(n==null){let o={route:r,find:null};if(this[Je](o))n=o.find,t.session.routeModel=n;else if(this[Ze])n=this[Ze];else{t.reject(`not find route model, path:${r.path??r.name}`);return}}let i=ot.from(t.session);this[gr](r,n,i).then(o=>{this[W],t.session.updateResult=o??{status:"success",message:""},t.resolve()},o=>{t.reject(o)})})}[Oe](e){if(e.length==0)return!0;let t=this[W],r=[];for(let n of e){let i=this[Ct](t,n);i!=null&&r.push({...i,route:n})}if(r.length==0)return this[O]("can not find view index"),!1;for(let n of r.reverse())this[ue](t,{x:n.x,y:n.y},[n.route.index??0],!0);return!0}[Ct](e,t){const r=t.root??te;let n;for(let i=0;i<e.layers.length;i++){const o=e.layers[i];for(let a=o.views.length-1;a>=0;a--){const l=o.views[a];if(l[Q]&&l[rt]===r)return n={x:a,y:i},n}}return null}[vr](e){return e.layers.length>0&&e.layers[0].views.length>0?e.layers[0].views[0]:null}[ue](e,t,r=null,n=!0){if(t.y>=e.layers.length||t.x>=e.layers[t.y].views.length)return;let i=e.layers[t.y].views[t.x],o=!1,a=[],l=!1,u=[...i.slots.value];for(let f=u.length-1;f>=0;f--){let h=u[f];(!r||r.indexOf(h.index)!=-1)&&(h.route&&i[Q]&&(this[Ke](h.route),h.active===!0&&h.route.opsType==q.Append&&(l=!0)),a.push(new B(i,h.index,t.y)),u.splice(f,1))}if(u.length==0)n?i.slots.value=u:e.layers[t.y].views.splice(t.x,1);else{if(l){let f=u.length-1,h=u[f];h.active=!0,h.route&&(h.route.active=h.active)}i.slots.value=u}e.layers[t.y].views.length==0&&(o=!0);let c=t.y+1;for(;c<e.layers.length;c++){let f=e.layers[c].views,h=[];for(let y=f.length-1;(o||a.length>0)&&y>=0;y--){let d=f[y];if(d[fe]&&(o||B.include(a,d[fe]))){let p=d.slots.value;for(let m=p.length-1;m>=0;m--){let v=p[m];v.route&&d[Q]&&this[Ke](v.route),h.push(new B(d,v.index,c)),p.splice(m,1)}e.layers[c].views.splice(y,1)}}a=h,e.layers[c].views.length==0&&(o=!0)}}restore(e){if(!e||this[V].length==0){let t=this[W];if(t.layers.length>0){let r=t.layers[0].views;r.length>0&&(r[0].slots.value=[])}return this[b]=[],this[Ge](),Promise.resolve()}else return new Promise((r,n)=>{let i=null,o=!1;for(let a=0;a<e.length;a++){const l=e[a];this[ge].post(u=>{const c=this[$t](l);this[jt](c),this[Ot](c),this[qt](c),c.wait((f,h)=>{i=f.session.to,o=f.session.redirect,u.resolve()},(f,h)=>{i=null,h!==null&&this[O](h),u.resolve()})})}this[ge].post(a=>{if(i&&o===!0){const l=P.clone(i,!0),u=new hr(l,this[Xe]());this[F]?.replace(u)}a.resolve(),r()})})}[gr](e,t,r){const n=e.updateType??tt.Part;return this[wr](t).then(()=>{const o=this[br](t,e,r,n);if(o.status==="error")throw Error(o.message);return o})}[wr](e){let t=[];for(let r=0;r<e.layers.length;r++){let n=e.layers[r];for(let i=0;i<n.models.length;i++){let o=n.models[i];o.isResolved||t.push(o.resolve())}}return t.length>0?Promise.all(t):Promise.resolve()}[br](e,t,r,n){if(e.layers[0].models.length!==1)return{status:"error",message:"illegal route structure(multi root node)"};const i=e.layers[0].models[0];let o=this[W],a=tn(o),l=t.root??te,u;!a&&n==tt.Part&&(u=this[Ct](o,t));let c,f=0;if(u==null||u==null)if(a||n===tt.All){if(o.layers.length==0&&(o.layers[0]=new St),o.layers[0].views.length==0){let h=t.root??te;c=new Ae(h,!0,null),o.layers[0].views=[c]}else c=o.layers[0].views[0];u={x:0,y:0}}else{let h=t.slot;if(!h)return{status:"error",message:"can not rebuild view(because not route slot)"};let y=h.level;if(y>o.layers.length)return{status:"error",message:"can not insert view(override level)"};let d;if(h.rootName){let p=o.layers[y-1];for(let m of p.views){if(m[Q]&&m.name===h.rootName){d=new B(m,h.rootIndex??0,y-1);break}if(m[G]&&m[G].view.name===h.rootName&&m[G].index===h.rootIndex){d=m[G];break}}}if(!d)return{status:"error",message:"can not insert view(not find root node ref)"};c=new Ae(l,!0,d),o.layers[y].views.push(c),u={x:o.layers[y].views.length-1,y}}else c=o.layers[u.y].views[u.x];if(f=u.y,c[Q]=!0,t.opsType===q.Append){t.index=t.index??le.get(),t.active=!0;let h=c.slots.value;if(h.length>0){let v=h[h.length-1];v.active=!1,v.route&&(v.route.active=v.active)}let y=new se(t,i,t.index,!0);c.slots.value=[...h,y];let d=f+1,p=1,m=new B(c,t.index,f);this[ne](o,d,e,p,m)}else if(t.opsType===q.Open){let h=c.slots.value;const y=t.active??!0;let d=!1;for(let p of h){if(p.route!==null&&P.isSameForRouteModel(p.route,t)){if(p.active===y)return t.index=p.index,t.active=y,p.route=t,{status:"no-change",message:""};p.active=y,d=!0,t.index=p.index,t.active=y,p.route=t}else y&&(p.active=!1);p.route&&(p.route.active=p.active)}if(!d){t.index=t.index??le.get(),t.active=y;let p=new se(t,i,t.index,y);h.push(p);let m=f+1,v=1,g=new B(c,t.index,f);this[ne](o,m,e,v,g)}c.slots.value=[...h]}else{let h=c.slots.value;if(h.length==0){t.index=t.index??le.get(),t.active=!0,c.slots.value=[new se(t,i,t.index)];let y=f+1,d=1,p=new B(c,t.index,f);this[ne](o,y,e,d,p)}else{let y=h[0];if(y.model!==i){this[ue](o,u,null,!0),t.index=t.index??le.get(),t.active=!0,c.slots.value=[new se(t,i,t.index)];let d=f+1,p=1,m=new B(c,t.index,f);this[ne](o,d,e,p,m)}else{y.route!==null&&this[Ke](y.route);let d=!1;const p=t.active??!0;y.active!==p&&(y.active=p,d=!0),t.active=p,t.index=y.index,y.route=t;let m=[];for(let j=1;j<h.length;j++)m.push(h[j].index);m.length>0?this[ue](o,u,m,!0):d&&(c.slots.value=[...h]);let v=[new B(c,t.index,f)],g=f+1,$=1,x=new B(c,t.index,f);for(;v.length>0&&g<o.layers.length&&$<e.layers.length;g++,$++){let j=[];for(let E=0;E<o.layers[g].views.length;E++){let C=o.layers[g].views[E];C[fe]&&B.include(v,C[fe])&&j.unshift(E)}let A=[];for(let E of j){let C=o.layers[g].views[E],z=e.layers[$].models,I;for(let N=0;N<z.length;N++)if(C.name===z[N].name){I=z[N];break}if(!I)this[ue](o,{x:E,y:g},null,!1);else{let N=C.slots.value;if(N.length==0){let Y=0;C.slots.value=[new se(null,I,Y)];let J=g+1,re=$+1;this[ne](o,J,e,re,x)}else{let Y=N[0];if(Y.model!==I){this[ue](o,{x:E,y:g},null,!0),C.slots.value=[new se(null,I,0)];let J=g+1,re=$+1;this[ne](o,J,e,re,x)}else{C[Q]&&Y.route!==null&&this[Ke](Y.route);let J=[];for(let re=1;re<N.length;re++)J.push(N[re].index);J.length>0&&this[ue](o,{x:E,y:g},J,!0),A.push(new B(C,Y.index,g))}}C[Q]=!1}}v=A}this[ne](o,g,e,$,x)}}}if(c&&c[G]){let h=c[G];h&&(t.slot=new _s(l,f,h?.view.name,h?.index??0))}return r.to=void 0,r.routeModel=void 0,t.session=r,this[xr](t),{status:"success",message:""}}[ne](e,t,r,n,i){let o=n,a=t;for(;a<e.layers.length&&o<r.layers.length;a++,o++){let l=e.layers[a].views;for(let u of r.layers[o].models){let c=new Ae(u.name,!1,i),f=new se(null,u);c.slots.value=[f],l.push(c)}}for(;o<r.layers.length;o++){let l=new St;l.views=[];for(let u of r.layers[o].models){let c=new Ae(u.name,!1,i),f=new se(null,u);c.slots.value=[f],l.views.push(c)}e.layers.push(l)}}[qr](e,t,r,n,i,o){if(t<0||t>this[W].layers.length)return null;if(t<this[W].layers.length){let c=this[W].layers[t],f=null;for(let h of c.views){let y=!1;if(r!==null?(y=h.name===e&&h[G]?.view===r,y&&n!==-1&&(y=h[G]?.index===n)):y=h.name===e,!!y){i!==null&&(h[fe]={view:i,index:o,level:t-1}),f=h;break}}if(f!==null)return f}let a=null,l=null;i!==null&&(i[Q]?a={view:i,index:o,level:t-1}:a=i[G],l={view:i,index:o,level:t-1});let u=new Ae(e,!0,a);if(u[fe]=l,t==this[W].layers.length){let c=new St;c.views=[u],this[W].layers.push(c)}else this[W].layers[t].views.push(u);return u}}const nn="fox-router-view",on="fox-router-link";function zr(s,e=!1){let t=null;return e?t=s.showFromClass??s.enterFromClass:t=s.enterFromClass,t||(t=s.transitionName,t?e?`${t}-show-from`:`${t}-enter-from`:null)}function Jr(s,e=!1){let t=null;return e?t=s.showActiveClass??s.enterActiveClass:t=s.enterActiveClass,t||(t=s.transitionName,t?e?`${t}-show-active`:`${t}-enter-active`:null)}function ln(s,e=!1){let t=null;return e?t=s.showToClass??s.enterToClass:t=s.enterToClass,t||(t=s.transitionName,t?e?`${t}-show-to`:`${t}-enter-to`:null)}function Gr(s,e=!1){let t=null;return e?t=s.hideFromClass??s.leaveFromClass:t=s.leaveFromClass,t||(t=s.transitionName,t?e?`${t}-hide-from`:`${t}-leave-from`:null)}function Qr(s,e=!1){let t=null;return e?t=s.hideActiveClass??s.leaveActiveClass:t=s.leaveActiveClass,t||(t=s.transitionName,t?e?`${t}-hide-active`:`${t}-leave-active`:null)}function an(s,e=!1){let t=null;return e?t=s.hideToClass??s.leaveToClass:t=s.leaveToClass,t||(t=s.transitionName,t?e?`${t}-hide-to`:`${t}-leave-to`:null)}function un(s,e=!1){let t=null;return e?t=s.beforeShow??s.beforeEnter:t=s.beforeEnter,t}function cn(s,e=!1){let t=null;return e?t=s.show??s.enter:t=s.enter,t}function fn(s,e=!1){let t=null;return e?t=s.afterShow??s.afterEnter:t=s.afterEnter,t}function hn(s,e=!1){let t=null;return e?t=s.showCancelled??s.enterCancelled:t=s.enterCancelled,t}function yn(s,e=!1){let t=null;return e?t=s.beforeHide??s.beforeLeave:t=s.beforeLeave,t}function dn(s,e=!1){let t=null;return e?t=s.hide??s.leave:t=s.leave,t}function mn(s,e=!1){let t=null;return e?t=s.afterHide??s.afterLeave:t=s.afterLeave,t}function pn(s,e=!1){let t=null;return e?t=s.hideCancelled??s.leaveCancelled:t=s.leaveCancelled,t}function Yt(s){let e,t=s.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 Pe(s,e){s.classList.contains(e)||s.classList.add(e)}function Se(s,e){s.classList.remove(e)}const vn=ye&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout;function yt(s){vn(s)}function M(s,e,t){R(e)&&(s==null&&(s={}),Reflect.apply(e,s,t))}function Xr(s,e,t,r=-1,n,i,o,a){if(R(i)){if(n!==void 0&&n>=0){setTimeout(()=>{Reflect.apply(i,s,[e,t,r]),R(a)&&Reflect.apply(a,s,[])},n);return}const l=["animationend","transitionend",lt],u=c=>{const f=c.target||c.srcElement,h=c.currentTarget;f===h&&(l.forEach(y=>{it(e,y,u)}),Reflect.apply(i,s,[e,t,r]))};l.forEach(c=>{nt(e,c,u)})}if(R(o)){const l="animationcancel",u=c=>{const f=c.target||c.srcElement,h=c.currentTarget;f===h&&(it(e,l,u),Reflect.apply(o,s,[e,t,r]))};nt(e,l,u)}}function dt(s){return!ye||s===null?!1:s.opsType===q.Append||s.opsType===q.Open}function Yr(s,e,t,r={},n,i=-1){if(e||dt(n)){const o=zr(r,e);o&&Pe(t,o);const a=Jr(r,e);a&&Pe(t,a);const l=un(r,e);M(s,l,[t,e,n,i])}}function Zr(s,e,t,r={},n,i,o,a){if(!dt(i)&&!e){R(a)&&a(s,a,[t]);return}const l=zr(r,e),u=Jr(r,e),c=ln(r,e),f=cn(r,e),h=fn(r,e),y=hn(r,e);if(!l&&!u&&!c&&!f){R(a)&&a(s,a,[t]);return}yt(()=>{Xr(s,t,i,o,n,()=>{u&&Se(t,u),c&&Se(t,c),R(h)&&M(s,h,[t,e,i,o]),R(a)&&a(s,a,[t])},()=>{R(y)&&M(s,y,[t,e,i,o])}),l&&Se(t,l),c&&Pe(t,c),R(f)&&M(s,f,[t,e,i,o])})}function es(s,e,t,r={},n,i=-1){if(e||dt(n)){const o=Gr(r,e);o&&Pe(t,o);const a=Qr(r,e);a&&Pe(t,a);const l=yn(r,e);M(s,l,[t,e,n,i])}}function ts(s,e,t,r={},n,i,o,a,l){if(!dt(o)&&!e){!e&&R(i)&&i();return}const u=Gr(r,e),c=Qr(r,e),f=an(r,e),h=dn(r,e),y=mn(r,e),d=pn(r,e);if(!u&&!c&&!f&&!h){!e&&R(i)&&i();return}yt(()=>{Xr(s,t,o,a,n,()=>{c&&Se(t,c),f&&Se(t,f),R(y)&&M(s,y,[t,e,o,a]),R(l)&&M(s,l,[t]),!e&&R(i)&&i()},()=>{R(d)&&M(s,d,[t,e,o,a]),R(l)&&M(s,l,[t]),!e&&R(i)&&i()}),u&&Se(t,u),f&&Pe(t,f),R(h)&&M(s,h,[t,e,o,a])})}function Ut(s,e={},t,r=-1){const n=e.mode??"default",i=Yt(e);return{mode:n,persisted:!1,beforeEnter:a=>{Yr(s,!1,a,e,t,r)},enter:a=>{Zr(s,!1,a,e,i.enter,t,r)},leave:(a,l)=>{es(s,!1,a,e,t,r),ts(s,!1,a,e,i.leave,l,t,r)},clone:a=>Ut(s,e,t,r)}}function rs(s){return s.el}function gn(s,e,t={},r,n,i,o){if(i===!0){const a=rs(e);if(a==null)return;const l=Yt(t);Yr(s,!0,a,t,r,n),Zr(s,!0,a,t,l.show,r,n,u=>{R(o)&&M(s,o,[u])})}else R(o)&&M(s,o,[])}function wn(s,e,t={},r,n,i,o){if(i===!0){const a=rs(e);if(a==null)return;const l=Yt(t);es(s,!0,a,t,r,n),ts(s,!0,a,t,l.hide,null,r,n,u=>{R(o)&&M(s,o,[u])})}else R(o)&&M(s,o,[])}function bn(s,e={}){yt(()=>{for(let t=0;t<s.length;t++)Reflect.apply(s[t],e,[])})}function ss(s,e={},t,r=-1){return{mode:e.mode??"default",persisted:!1,beforeEnter:o=>{ke(Or,{},o)},enter:o=>{ke(Lr,{},o)},leave:(o,a)=>{ke(Mr,{},o),yt(()=>{const l=u=>{const c=u.target||u.srcElement,f=u.currentTarget;c===f&&(it(o,lt,l),a&&Reflect.apply(a,s,[]))};nt(o,lt,l),ke(Ir,{},o)})},clone:o=>ss(s,e,t,r)}}function ie(s,e,t){return typeof s=="function"?Reflect.apply(s,{},[e,t]):s}function Lt(s,e){if(!s)return null;const t=s(e);return t.length===1?t[0]:t}function we(s,e){return typeof e=="function"?e(s):s}class xn{node;state;constructor(e,t){this.node=e,this.state=t}}const kt=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(s,e){const t=w.getCurrentInstance();if(t===null||t.proxy===null){console.error("instance or instance.proxy not exist");return}const r=s.multi===!0,n=w.inject(ht,null),i=w.inject(bt,0),o=w.inject(cr,null),a=w.inject(xt,-1);let l=null;const u=s.modelSlot;if(u){if(w.provide(bt,i+1),w.provide(xt,u.index),w.provide(Rt,u.index),!u.route){console.warn("child view render error, route not exist");return}const h=at(t.proxy,!0);Os(h),ur(h,()=>u.route??null)}else{if(n==null){console.error("router is not been injected");return}const f=s.name,h=w.inject(fr,null),y=w.inject(Rt,0);if(l=n[qr](f,i,o,a,h,y),l===null)return;w.provide(fr,l);const d=l[Q]===!0;if(d&&w.provide(cr,l),!r&&(w.provide(xt,-1),w.provide(bt,i+1),w.provide(Rt,-1),d)){const p=at(t.proxy,!0);ur(p,()=>{const m=l.slots.value;return m.length>0?m[0].route:null})}}const c={value:new Map};return w.onUnmounted(()=>{c.value&&c.value.clear()}),()=>{if(r){const f=new Map,h=[],y=l?.slots.value,d=[];for(let v=0;v<y.length;v++){const g=y[v],$=`${s.name}_${g.index}`,x=ie(s.transition,g.route,v)??!0,j={modelSlot:g};let A;e.slots.default?A=w.h(kt,j,{default:e.slots.default}):A=w.h(kt,j);const E={},C=ie(s.viewClass,g.route,v);typeof C=="string"&&C.length>0&&(E[C]=!0);const z=ie(s.viewActiveClass,g.route,v),I=ie(s.viewInactiveClass,g.route,v),N=c.value.get($);if(typeof z=="string"&&z.length>0&&(E[z]=g.active),typeof I=="string"&&I.length>0&&(E[I]=!g.active),N&&g.active!==N.state){const U=N.node;g.active?d.unshift(()=>{const mt=()=>{let Ee=lr(U);Ee!=null&&ar(Ee,Dt.ACTIVATED)};gn(t,U,s,g.route,v,x,mt)}):d.push(()=>{const mt=()=>{const Ee=lr(U);Ee!=null&&ar(Ee,Dt.DEACTIVATED)};wn(t,U,s,g.route,v,x,mt)})}const Y={class:E,key:$},J=ie(s.viewTagProps,g.route,v);if(J!==null&&typeof J=="object"){const U=we(J,n?.propsFilter);K(!0,Y,U)}if(g.route?.viewTagAttrs&&typeof g.route?.viewTagAttrs=="object"){const U=we(g.route.viewTagAttrs,n?.propsFilter);K(!0,Y,U)}const re=ie(s.viewTag,g.route,v),De=w.h(re,Y,{default:()=>[A]});if(f.set($,new xn(De,g.active)),c.value.delete($),x===!0){const U=Ut(t,s,g.route,v);De.transition=U}else if(x==="custom"){const U=ss(t,s,g.route,v);De.transition=U}h.push(De)}c.value=f,bn(d,t);const p=ie(s.tag,null,-1),m={};return Object.assign(m,e.attrs),w.h(p,m,{default:()=>h})}else if(u!=null){const f=u.model,h={};if(f.props){if(typeof f.props=="object"){const d=we(f.props,n?.propsFilter);K(!1,h,d)}else if(f.props===!0&&typeof u.route?.params=="object"){const d=we(u.route.params,n?.propsFilter);K(!1,h,d)}}const y=w.h(f.component,h);return Lt(e.slots.default,{Component:y,route:u.route})??y}else{const f=l.slots.value;if(f.length>0){const h=f[0],y=h.route??(t.proxy&&Qt(t.proxy))??null,d=h.model,p={};if(d.props){if(typeof d.props=="object"){const g=we(d.props,n?.propsFilter);K(!1,p,g)}else if(d.props===!0&&typeof y?.params=="object"){const g=we(y.params,n?.propsFilter);K(!1,p,g)}}const m=w.h(d.component,p);if(ie(s.transition,y,-1)??!0){const g=Ut(t,s,y,-1);m.transition=g}return Lt(e.slots.default,{Component:m,route:y})??m}else return Lt(e.slots.fallback,{})}}}});function Rn(s){if(!(s.metaKey||s.altKey||s.ctrlKey||s.shiftKey)&&!s.defaultPrevented&&!(s.button!=null&&s.button!==0)){if(s.currentTarget&&s.currentTarget.getAttribute){const e=s.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return s.preventDefault&&s.preventDefault(),!0}}function Sn(s,e){return s==null||e==null?!1:!!(s===e||s.path&&s.path===e.path||s.name&&s.name===e.name)}function Pn(s,e){return s==null||e==null?!1:!!(s.path&&e.path&&e.path.startsWith(s.path)||s.name&&s.name==e.name)}function be(s,e){return typeof s=="function"?Reflect.apply(s,{},[e]):s}let En=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(s,e){const t=w.inject(ht,null);return()=>{let r=be(s.to,null),n=be(s.tag,r);if(n==null){console.warn("can not resolve link tag");return}let i=null,o=null;t!==null&&(i=t[D](r),s.root&&(i.root=s.root),o=t.current);let a={},l=be(s.activeClass,i);if(typeof l=="string"&&l.length>0&&(a[l]=Pn(i,o)),be(s.exact,i)===!0){let h=be(s.exactActiveClass,i);typeof h=="string"&&h.length>0&&(a[h]=Sn(i,o))}let c={class:a};(n==="a"||n==="A")&&(c.href=i?.path??i?.name??"#"),K(!0,c,e.attrs);let f=be(s.event,i);if(typeof f=="string"){const h=y=>{if(t==null){console.warn("router is not been injected");return}if(i==null){console.warn("route is not been resolved");return}Rn(y)&&t.to(i)};c[f]=h}return w.h(n,c,e.slots)}}});var L=(s=>(s[s.Loading=0]="Loading",s[s.Loaded=1]="Loaded",s[s.Defining=2]="Defining",s[s.Defined=3]="Defined",s))(L||{}),st=(s=>(s[s.normal=0]="normal",s[s.factory=1]="factory",s))(st||{});class Cn{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 Pr{moduleManager=new Cn;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 Ue().head}constructor(){}setModule(e,t){const r={id:e,src:"",status:L.Defined};typeof t=="function"?(r.exports=t,r.type=st.factory):r.exports=t,this.moduleManager.set(e,r)}removeModule(e){this.moduleManager.remove(e)}ensure(...e){const t=[];let r=e.length-1;const n={};typeof e[r]=="object"&&(Object.assign(n,e[r]),r--);let i=null;typeof e[r]=="function"&&(i=e[r],r--);for(let l=0;l<=r;l++)if(Array.isArray(e[l])){let u=e[l];for(let c=0;c<u.length;c++)u[c]&&t.push(this.resolvePath(u[c]))}else if(typeof e[l]=="string"){let u=e[l].split(",");for(let c=0;c<u.length;c++)u[c]&&t.push(this.resolvePath(u[c]))}const o=new Fn(t.length,(l,u)=>{if(o.isOK())try{typeof i=="function"&&Reflect.apply(i,{},u)}catch(c){console.error(c.message,c)}else try{console.error(l),typeof i=="function"&&Reflect.apply(i,{},[])}catch(c){console.error(c.message,c)}}),a=new Ne;for(let l=0;l<t.length;l++){const u=new An(l,t[l],n,o);this.mount(a,u)}return this}remove(...e){let t=[],r=e.length-1,n={};typeof e[r]=="object"&&(Object.assign(n,e[r]),r--);let i=null;typeof e[r]=="function"&&(i=e[r],r--);for(let o=0;o<=r;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,n)}),typeof i=="function"&&Reflect.apply(i,{},[]),this}mount(e,t){if(t.src==="exports"){e.post(n=>{t.progress.work(!0,t.index,"exports"),n.resolve()});return}else if(t.src==="module"){e.post(n=>{t.progress.work(!0,t.index,"module"),n.resolve()});return}if(this.isNaturePath(t.src)){let n=t.params.jsPoint;n||(n=this.head),this.mountJS(e,t,n);return}else if(this.isNaturePath(t.src)){let n=t.params.cssPoint;n||(n=this.head),this.mountCSS(e,t,n);return}let r=this.getFileNamePostfix(t.src);if(r==="js"||r.length===0){let n=t.params.jsPoint;n||(n=this.head),this.mountJS(e,t,n);return}else if(r==="css"){let n=t.params.cssPoint;n||(n=this.head),this.mountCSS(e,t,n);return}}mountCSS(e,t,r){e.post(n=>{const i=t.src,o=this.moduleManager.get(i);if(o&&(o.status==L.Defined||o.status==L.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),n.resolve();return}const a=Ue(),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),n.resolve()},l.onerror=()=>{try{r.removeChild(l)}catch(f){console.error(f.message,f)}l.onload=null,l.onerror=null,t.progress.work(!1,t.index,null),n.reject()};else{const f={timeout:this.options.timeout??3e3,time:0,success:()=>{t.progress.work(!0,t.index,t.src),n.resolve()},error:()=>{try{r.removeChild(l)}catch(h){console.error(h.message,h)}t.progress.work(!1,t.index,null),n.resolve()}};setTimeout(()=>{ns(l,f)},1)}let c=a.getElementById(i);c&&c.parentNode&&c.parentNode.removeChild(c),l.rel="stylesheet",l.type="text/css",l.id=i,l.href=i,r.appendChild(l)})}mountJS(e,t,r){e.post(n=>{const i=t.src;let o=this.moduleManager.get(i);if(o&&(o.status==L.Defined||o.status==L.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),n.resolve();return}if(document.querySelector(`script[src='${i}`)){t.progress.work(!0,t.index,o.exports),n.resolve();return}}o={id:i,src:i,status:L.Loading},this.moduleManager.set(i,o);const l=Ue().createElement("script");if("onload"in l)l.onload=()=>{l.onload=null,l.onerror=null,o.status===L.Loading&&(o.status=L.Loaded,t.progress.work(!0,t.index,i)),n.resolve()},l.onerror=()=>{try{r.removeChild(l)}catch(f){console.error(f.message,f)}l.onload=null,l.onerror=null,this.moduleManager.remove(i),t.progress.work(!1,t.index,null),n.resolve()};else{const f=l;f.onreadystatechange=()=>{/loaded|complete/.test(f.readyState)&&(f.onreadystatechange=null,o.status==L.Loading&&(o.status=L.Loaded,t.progress.work(!0,t.index,i)),n.resolve())}}l.defer=!0,l.src=i;const c=T();c.define=this.createDefine(o,t),r.appendChild(l)})}unmount(e,t={}){const r=Ue(),n=this.getFileNamePostfix(e);if(n==="js"||n.length===0){const i=r.querySelector(`script[src="${e}"]`);i&&i.parentNode&&i.parentNode.removeChild(i),this.moduleManager.remove(e);return}else if(n==="css"){const i=r.querySelector(`style[href="${e}"]`);i&&i.parentNode&&i.parentNode.removeChild(i);return}}trimEmptyElement(e){let t=[];for(let r=0;r<e.length;r++){if(e[r]===void 0||e[r]===null)continue;const n=e[r].trim();n.length!==0&&t.push(n)}return t}createDefine(e,t){const r=this,n=function(...i){e.status=L.Defining;let o,a,l,u=i.length;u===1?(l=i[0],o=void 0):u===2?(l=i[1],Array.isArray(i[0])?(a=r.trimEmptyElement(i[0]),o=void 0):a=void 0):(o=i[0],a=r.trimEmptyElement(i[1]),l=i[2]),o&&(e.id=o,r.options.alias[o]=e.src),a&&a.length>0?r.ensure(a,(...c)=>{const f=c.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,f);h&&typeof h=="object"&&(e.exports=h)}else e.exports=l;e.status=L.Defined,t.progress.work(!0,t.index,e.exports)}):(typeof l=="function"?e.exports=Reflect.apply(l,e,[]):e.exports=l,e.status=L.Defined,t.progress.work(!0,t.index,e.exports))};return n.amd=!0,n}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 r=this.createSearch(this.query);return e.indexOf("?")==-1?(t!=="js"&&t!=="css"&&(e+=".js"),r.length>0&&(e+=`?${r}`)):r.length>0&&(e+=`&${r}`),e}catch(t){throw console.error(`resolve path[${e}] fail`,t),t}}createSearch(e){let t="";if(e){for(let r in e){let n=`${e[r]}`;t+=`${encodeURIComponent(r)}=${encodeURIComponent(n)}&`}t.length>0&&(t=t.substring(0,t.length-1))}return t}getFileNamePostfix(e){let t=e.lastIndexOf("?");t==-1&&(t=e.length);let r=e.lastIndexOf(".",t);return r==-1?"":e.substring(r+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 r=0;r<t.length;r++){const n=t[r];if(e.indexOf(n)===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`${pt()}${e.slice(1)}`;if(e.indexOf("./")==0)return`${pt()}${e.slice(2)}`;if(e.indexOf("//")==0)return`${T().location.protocol}${e}`;if(t){let n=this.options.alias[e];if(!n){let i=e.indexOf("/");if(i==-1)n=e;else{let o=e.slice(0,i),a=this.options.paths[o];a?n=a+e.slice(i):n=e}}return this.parserPath(n,!1)}return`${pt()}${e}`}}function ns(s,e){let t=s.sheet,r=!1;if(e.isOldWebKit)t&&(r=!0);else if(t)try{t.cssRules&&(r=!0)}catch(n){n.name==="NS_ERROR_DOM_SECURITY_ERR"&&(r=!0)}setTimeout(()=>{e.time+=20,r?e.success():e.timeout>e.timeout?e.error():ns(s,e)},20)}class Fn{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,r){if(this.status=e,this.status===!0&&(this.lastIndex!==t&&this.size--,this.lastIndex=t,this.values.push(r)),this.size===0||this.status===!1)try{Reflect.apply(this.callback,this,[this.status,this.values])}catch(n){console.error(n.message,n)}}isOK(){return this.status}}class An{index;src;params;progress;constructor(e,t,r,n){this.index=e,this.src=t,this.params=r,this.progress=n}}const Zt=Symbol("fk"),er=Symbol("fbk"),tr=Symbol("fepk");function _n(s={}){const e=new sn(s),t=new Nt,r=new Ht,n=new Pr,i={get router(){return e},get bus(){return t},get Bus(){return Nt},get EventProxy(){return Ht},get eventproxy(){return r},get EventChain(){return Ne},get Require(){return Pr},get require(){return n},get extend(){return K},get clone(){return ft},get isESModule(){return Bt},install(o){o.provide(ht,e),o.provide(Zt,i),o.provide(er,t),o.provide(tr,r),o.component(nn,kt),o.component(on,En),Reflect.defineProperty(o.config.globalProperties,"$fox",{get(){return i}}),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 r}}),o.config.globalProperties.$fox_on=function(a,l,u=!1){r.on(a,l,u)},o.config.globalProperties.$fox_off=function(a,l){r.off(a,l)},o.config.globalProperties.$fox_once=function(a,l){r.once(a,l)},o.config.globalProperties.$fox_all=function(...a){let l=r;Reflect.apply(l.all,l,a)},o.config.globalProperties.$fox_trigger=function(a,...l){let u=r;Reflect.apply(u.trigger,u,[a,...l])},o.config.globalProperties.$fox_emit=function(a,...l){let u=r;Reflect.apply(u.trigger,u,[a,...l])},o.mixin({computed:{$route(){return Qt(this)}}}),e.init()}};return i}function rr(s){return s?s.$router:w.inject(ht)}function Tn(s){return s||(s=w.getCurrentInstance()?.proxy??void 0),s?Qt(s):null}function Kn(s){return s?s.$fox:w.inject(Zt)}function $n(s){return s?s.$bus:w.inject(er)}function jn(s){return s?s.$eventProxy:w.inject(tr)}function qn(s){const e=rr(),t=(r,n,i)=>{try{Reflect.apply(s,{},[r,n])}catch(o){console.error(o)}i()};e.beforeEach(t),w.onUnmounted(()=>{e.removeBeforeEach(t)})}function On(s){const e=rr(),t=(r,n,i)=>{try{Reflect.apply(s,{},[r,n])}catch(o){console.error(o)}i()};e.afterEach(t),w.onUnmounted(()=>{e.removeAfterEach(t)})}exports.Bus=Nt;exports.EventChain=Ne;exports.EventProxy=Ht;exports.FoxBeforeEnter=Or;exports.FoxBeforeLeave=Mr;exports.FoxEnter=Lr;exports.FoxLeave=Ir;exports.FoxLeaveEnd=lt;exports.OperationType=q;exports.Route=P;exports.clone=ft;exports.createFox=_n;exports.createMemoryHistory=Wr;exports.createWebHashHistory=Vr;exports.createWebHistory=Zs;exports.deleteContextValue=qs;exports.extend=K;exports.foxBusKey=er;exports.foxEventProxyKey=tr;exports.foxKey=Zt;exports.injectContextValue=Gt;exports.isArray=os;exports.isDate=us;exports.isESModule=Bt;exports.isEqual=It;exports.isFunction=R;exports.isMap=ls;exports.isNil=He;exports.isObject=Er;exports.isPlainObject=Cr;exports.isPromise=hs;exports.isSet=as;exports.isString=cs;exports.isSymbol=fs;exports.onAfterRouteUpdate=On;exports.onBeforeRouteUpdate=qn;exports.onFoxActivated=Ns;exports.onFoxInactivated=Hs;exports.provideContextValue=js;exports.rawState=Fs;exports.reactiveState=Ps;exports.sessionKey=oe;exports.shallowReactiveState=Es;exports.toBoolean=Vt;exports.toNumber=ps;exports.toTypeString=ct;exports.typeOf=Mt;exports.useBus=$n;exports.useEventProxy=jn;exports.useFox=Kn;exports.useRoute=Tn;exports.useRouter=rr;
|
package/libs/index.esm.d.ts
CHANGED
|
@@ -45,7 +45,7 @@ declare const _buildPage: unique symbol;
|
|
|
45
45
|
/**
|
|
46
46
|
* 导出Bus
|
|
47
47
|
*/
|
|
48
|
-
export declare const Bus:
|
|
48
|
+
export declare const Bus: typeof TreeImpl;
|
|
49
49
|
|
|
50
50
|
/**
|
|
51
51
|
* Bus Interface
|
|
@@ -464,7 +464,7 @@ export declare const FoxBeforeLeave = "FoxLeave";
|
|
|
464
464
|
/**
|
|
465
465
|
* 全局Bus
|
|
466
466
|
*/
|
|
467
|
-
export declare const foxBusKey: FoxInjectionKey<
|
|
467
|
+
export declare const foxBusKey: FoxInjectionKey<BusInterface>;
|
|
468
468
|
|
|
469
469
|
/**
|
|
470
470
|
* Fox过渡进入事件
|
|
@@ -833,6 +833,16 @@ declare const parentNodeKey: unique symbol;
|
|
|
833
833
|
|
|
834
834
|
declare const persistentModeKey: unique symbol;
|
|
835
835
|
|
|
836
|
+
/**
|
|
837
|
+
* 持久化策略
|
|
838
|
+
*/
|
|
839
|
+
declare type PersistPolicy = 'memory' | 'session' | 'local' | 'custom';
|
|
840
|
+
|
|
841
|
+
/**
|
|
842
|
+
* 持久化策略
|
|
843
|
+
*/
|
|
844
|
+
declare type PersistPolicy_2 = 'memory' | 'session' | 'local' | 'custom';
|
|
845
|
+
|
|
836
846
|
/**
|
|
837
847
|
* 属性函数
|
|
838
848
|
*/
|
|
@@ -859,6 +869,22 @@ export declare function provideContextValue(proxy: ComponentPublicInstance, key:
|
|
|
859
869
|
|
|
860
870
|
declare type Proxy_2 = ComponentPublicInstance | null;
|
|
861
871
|
|
|
872
|
+
/**
|
|
873
|
+
* raw state
|
|
874
|
+
* @param state
|
|
875
|
+
* @param options
|
|
876
|
+
* @returns
|
|
877
|
+
*/
|
|
878
|
+
export declare function rawState<T extends Record<string, any>>(state: T, options?: StateOptions): T;
|
|
879
|
+
|
|
880
|
+
/**
|
|
881
|
+
* reactive state
|
|
882
|
+
* @param state
|
|
883
|
+
* @param options
|
|
884
|
+
* @returns
|
|
885
|
+
*/
|
|
886
|
+
export declare function reactiveState<T extends Record<string, any>>(state: T, options?: StateOptions): T;
|
|
887
|
+
|
|
862
888
|
declare const readyHandlersKey: unique symbol;
|
|
863
889
|
|
|
864
890
|
declare const readyKey: unique symbol;
|
|
@@ -1645,6 +1671,14 @@ declare class Session {
|
|
|
1645
1671
|
|
|
1646
1672
|
export declare const sessionKey: unique symbol;
|
|
1647
1673
|
|
|
1674
|
+
/**
|
|
1675
|
+
* shallow reactive state
|
|
1676
|
+
* @param state
|
|
1677
|
+
* @param options
|
|
1678
|
+
* @returns
|
|
1679
|
+
*/
|
|
1680
|
+
export declare function shallowReactiveState<T extends Record<string, any>>(state: T, options?: StateOptions): T;
|
|
1681
|
+
|
|
1648
1682
|
/**
|
|
1649
1683
|
* 插槽
|
|
1650
1684
|
*/
|
|
@@ -1676,6 +1710,17 @@ declare class Slot {
|
|
|
1676
1710
|
|
|
1677
1711
|
declare const _start: unique symbol;
|
|
1678
1712
|
|
|
1713
|
+
/**
|
|
1714
|
+
* state参数
|
|
1715
|
+
*/
|
|
1716
|
+
export declare type StateOptions = {
|
|
1717
|
+
name?: string;
|
|
1718
|
+
persistPolicy?: PersistPolicy_2;
|
|
1719
|
+
storage?: Storage;
|
|
1720
|
+
debounce?: boolean;
|
|
1721
|
+
debounceDelay?: number;
|
|
1722
|
+
};
|
|
1723
|
+
|
|
1679
1724
|
declare const statusKey: unique symbol;
|
|
1680
1725
|
|
|
1681
1726
|
/**
|
|
@@ -1769,6 +1814,48 @@ declare interface Tree extends TreeNode {
|
|
|
1769
1814
|
clear(): void;
|
|
1770
1815
|
}
|
|
1771
1816
|
|
|
1817
|
+
/**
|
|
1818
|
+
* 数据tree
|
|
1819
|
+
*/
|
|
1820
|
+
declare class TreeImpl extends TreeNodeImpl implements Tree {
|
|
1821
|
+
/**
|
|
1822
|
+
* 持久化处理器
|
|
1823
|
+
*/
|
|
1824
|
+
private _persistHandler;
|
|
1825
|
+
/**
|
|
1826
|
+
* 默认构造函数
|
|
1827
|
+
*/
|
|
1828
|
+
constructor(options?: TreeOptions, defaultState?: Record<string, any>);
|
|
1829
|
+
/**
|
|
1830
|
+
* 加入数据
|
|
1831
|
+
* @param args
|
|
1832
|
+
* @returns {boolean}
|
|
1833
|
+
*/
|
|
1834
|
+
put(...args: any[]): boolean;
|
|
1835
|
+
/**
|
|
1836
|
+
* 获取内容
|
|
1837
|
+
* @param args
|
|
1838
|
+
* @returns {any}
|
|
1839
|
+
*/
|
|
1840
|
+
get(...args: any[]): any | undefined;
|
|
1841
|
+
/**
|
|
1842
|
+
* 移除数据
|
|
1843
|
+
* @param args
|
|
1844
|
+
* @returns {boolean}
|
|
1845
|
+
*/
|
|
1846
|
+
remove(...args: any[]): boolean;
|
|
1847
|
+
/**
|
|
1848
|
+
* 判断是否包含数据
|
|
1849
|
+
* @param args
|
|
1850
|
+
* @returns {boolean}
|
|
1851
|
+
*/
|
|
1852
|
+
contains(...args: any[]): boolean;
|
|
1853
|
+
/**
|
|
1854
|
+
* 清空所以数据
|
|
1855
|
+
*/
|
|
1856
|
+
clear(): void;
|
|
1857
|
+
}
|
|
1858
|
+
|
|
1772
1859
|
/**
|
|
1773
1860
|
* tree node
|
|
1774
1861
|
*/
|
|
@@ -1780,6 +1867,45 @@ declare interface TreeNode {
|
|
|
1780
1867
|
[childrenKey]: Map<string, TreeNode>;
|
|
1781
1868
|
}
|
|
1782
1869
|
|
|
1870
|
+
/**
|
|
1871
|
+
* 树节点
|
|
1872
|
+
* @param id
|
|
1873
|
+
* @param data
|
|
1874
|
+
* @constructor
|
|
1875
|
+
*/
|
|
1876
|
+
declare class TreeNodeImpl implements TreeNode {
|
|
1877
|
+
/**
|
|
1878
|
+
* 自动创建解决策略
|
|
1879
|
+
*/
|
|
1880
|
+
[growKey]: boolean;
|
|
1881
|
+
/**
|
|
1882
|
+
* id
|
|
1883
|
+
*/
|
|
1884
|
+
[idKey]: string;
|
|
1885
|
+
/**
|
|
1886
|
+
* value
|
|
1887
|
+
*/
|
|
1888
|
+
[valueKey]: Ref<any>;
|
|
1889
|
+
/**
|
|
1890
|
+
* children
|
|
1891
|
+
*/
|
|
1892
|
+
[childrenKey]: Map<string, TreeNode>;
|
|
1893
|
+
/**
|
|
1894
|
+
* 构造函数
|
|
1895
|
+
* @param id
|
|
1896
|
+
*/
|
|
1897
|
+
constructor(id: string);
|
|
1898
|
+
}
|
|
1899
|
+
|
|
1900
|
+
/**
|
|
1901
|
+
* Tree参数
|
|
1902
|
+
*/
|
|
1903
|
+
declare type TreeOptions = {
|
|
1904
|
+
name?: string;
|
|
1905
|
+
persistPolicy?: PersistPolicy;
|
|
1906
|
+
storage?: Storage_2;
|
|
1907
|
+
};
|
|
1908
|
+
|
|
1783
1909
|
/**
|
|
1784
1910
|
* 判断类型
|
|
1785
1911
|
* @param obj
|
|
@@ -1810,7 +1936,7 @@ declare enum UpdateType {
|
|
|
1810
1936
|
* @param proxy
|
|
1811
1937
|
* @returns
|
|
1812
1938
|
*/
|
|
1813
|
-
export declare function useBus(proxy?: Proxy_2):
|
|
1939
|
+
export declare function useBus(proxy?: Proxy_2): BusInterface;
|
|
1814
1940
|
|
|
1815
1941
|
/**
|
|
1816
1942
|
* Returns the global event proxy
|